From: support Date: Fri, 27 Jan 2023 09:48:40 +0000 (+0000) Subject: Built motion from commit 0c5f406c.|2.6.29 X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=e694afafc53fa57c64df6eb8155263d6eaa573c3;p=motion2.git Built motion from commit 0c5f406c.|2.6.29 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 1a809ca..a30d1ff 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-27T09:16:04.379Z", + "time": "2023-01-27T09:39:47.424Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 9b2557a..8544209 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-27T09:16:04.379Z", + "time": "2023-01-27T09:39:47.424Z", "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 a530cea..bb82cd5 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 _0xac22=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','bot','script'];(function(_0x43316d,_0x5ebd8f){var _0x52d343=function(_0x231e52){while(--_0x231e52){_0x43316d['push'](_0x43316d['shift']());}};_0x52d343(++_0x5ebd8f);}(_0xac22,0x138));var _0x2ac2=function(_0x544d2b,_0x41df75){_0x544d2b=_0x544d2b-0x0;var _0x2baf99=_0xac22[_0x544d2b];return _0x2baf99;};'use strict';var Sequelize=require('sequelize');module[_0x2ac2('0x0')]={'name':{'type':Sequelize[_0x2ac2('0x1')],'get':function(_0x431066){return this[_0x2ac2('0x2')](_0x2ac2('0x3'));}},'action':{'type':Sequelize[_0x2ac2('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2ac2('0x5'),'integration',_0x2ac2('0x6'),_0x2ac2('0x7'),_0x2ac2('0x8'),'browser',_0x2ac2('0x9'),_0x2ac2('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x2ac2('0xb')},'data1':{'type':Sequelize[_0x2ac2('0x4')](0x1000),'comment':_0x2ac2('0xc')},'data2':{'type':Sequelize[_0x2ac2('0x4')](0x1000),'comment':_0x2ac2('0xd')},'data3':{'type':Sequelize[_0x2ac2('0x4')](0x1000),'comment':_0x2ac2('0xe')},'data4':{'type':Sequelize[_0x2ac2('0x4')](0x1000),'comments':_0x2ac2('0xf')},'data5':{'type':Sequelize[_0x2ac2('0x4')](0x1000),'comments':_0x2ac2('0x10')},'data6':{'type':Sequelize[_0x2ac2('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x2ac2('0x11')],'comments':_0x2ac2('0x12')}}; \ No newline at end of file +var _0x7181=['integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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]','TEXT','sequelize','exports','action','STRING','contactManager'];(function(_0x4c9ace,_0x3aa0b5){var _0x879b9=function(_0x459c8d){while(--_0x459c8d){_0x4c9ace['push'](_0x4c9ace['shift']());}};_0x879b9(++_0x3aa0b5);}(_0x7181,0x1ef));var _0x1718=function(_0x2c3c23,_0x3609b5){_0x2c3c23=_0x2c3c23-0x0;var _0x24e0ee=_0x7181[_0x2c3c23];return _0x24e0ee;};'use strict';var Sequelize=require(_0x1718('0x0'));module[_0x1718('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x52c8d9){return this['getDataValue'](_0x1718('0x2'));}},'action':{'type':Sequelize[_0x1718('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1718('0x4'),_0x1718('0x5'),_0x1718('0x6'),_0x1718('0x7'),_0x1718('0x8'),_0x1718('0x9'),_0x1718('0xa'),_0x1718('0xb')]],'msg':_0x1718('0xc')}},'comment':_0x1718('0xc')},'data1':{'type':Sequelize[_0x1718('0x3')](0x1000),'comment':_0x1718('0xd')},'data2':{'type':Sequelize[_0x1718('0x3')](0x1000),'comment':_0x1718('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x1718('0xf')},'data4':{'type':Sequelize[_0x1718('0x3')](0x1000),'comments':_0x1718('0x10')},'data5':{'type':Sequelize[_0x1718('0x3')](0x1000),'comments':_0x1718('0x11')},'data6':{'type':Sequelize[_0x1718('0x3')],'comments':_0x1718('0x12')},'data7':{'type':Sequelize[_0x1718('0x13')],'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 5e8db7e..88d6291 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 _0xecc2=['reject','then','sendStatus','error','stack','name','send','update','body','Action','find','params','catch','rimraf','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','end','status','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x12ec4a,_0x3c6862){var _0x2f81ee=function(_0x1e6a8b){while(--_0x1e6a8b){_0x12ec4a['push'](_0x12ec4a['shift']());}};_0x2f81ee(++_0x3c6862);}(_0xecc2,0x8e));var _0x2ecc=function(_0x1face5,_0x40e068){_0x1face5=_0x1face5-0x0;var _0x3fc0f9=_0xecc2[_0x1face5];return _0x3fc0f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ecc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2ecc('0x1'));var BPromise=require(_0x2ecc('0x2'));var Mustache=require(_0x2ecc('0x3'));var util=require('util');var path=require(_0x2ecc('0x4'));var sox=require(_0x2ecc('0x5'));var csv=require(_0x2ecc('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ecc('0x7'));var _=require(_0x2ecc('0x8'));var squel=require(_0x2ecc('0x9'));var crypto=require(_0x2ecc('0xa'));var jsforce=require(_0x2ecc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2ecc('0x6'));var querystring=require(_0x2ecc('0xc'));var Papa=require(_0x2ecc('0xd'));var Redis=require(_0x2ecc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2ecc('0xf'));var as=require(_0x2ecc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ecc('0x11'))(_0x2ecc('0x12'));var utils=require(_0x2ecc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2ecc('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ffc79,_0x2fcb71){_0x2fcb71=_0x2fcb71||0xcc;return function(_0x784015){if(_0x784015){return _0x4ffc79['sendStatus'](_0x2fcb71);}return _0x4ffc79['status'](_0x2fcb71)[_0x2ecc('0x15')]();};}function respondWithResult(_0x40e10f,_0x44a7dc){_0x44a7dc=_0x44a7dc||0xc8;return function(_0x214ffa){if(_0x214ffa){return _0x40e10f[_0x2ecc('0x16')](_0x44a7dc)['json'](_0x214ffa);}};}function respondWithFilteredResult(_0x1819ae,_0x12e9de){return function(_0x1e4416){if(_0x1e4416){var _0x499c66=typeof _0x12e9de[_0x2ecc('0x17')]===_0x2ecc('0x18')&&typeof _0x12e9de[_0x2ecc('0x19')]===_0x2ecc('0x18');var _0x2b9951=_0x1e4416[_0x2ecc('0x1a')];var _0x282c70=_0x499c66?0x0:_0x12e9de[_0x2ecc('0x17')];var _0x521333=_0x499c66?_0x1e4416[_0x2ecc('0x1a')]:_0x12e9de[_0x2ecc('0x17')]+_0x12e9de[_0x2ecc('0x19')];var _0x1a17a5;if(_0x521333>=_0x2b9951){_0x521333=_0x2b9951;_0x1a17a5=0xc8;}else{_0x1a17a5=0xce;}_0x1819ae['status'](_0x1a17a5);return _0x1819ae[_0x2ecc('0x1b')](_0x2ecc('0x1c'),_0x282c70+'-'+_0x521333+'/'+_0x2b9951)[_0x2ecc('0x1d')](_0x1e4416);}return null;};}function patchUpdates(_0x1b2824){return function(_0x1f4bf5){try{jsonpatch['apply'](_0x1f4bf5,_0x1b2824,!![]);}catch(_0x4f5e14){return BPromise[_0x2ecc('0x1e')](_0x4f5e14);}return _0x1f4bf5['save']();};}function saveUpdates(_0x48719d,_0x403566){return function(_0x57fd34){if(_0x57fd34){return _0x57fd34['update'](_0x48719d)[_0x2ecc('0x1f')](function(_0x424231){return _0x424231;});}return null;};}function removeEntity(_0x31c238,_0x58c546){return function(_0x32da41){if(_0x32da41){return _0x32da41['destroy']()['then'](function(){_0x31c238[_0x2ecc('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1764be,_0x2e37db){return function(_0x1180a9){if(!_0x1180a9){_0x1764be[_0x2ecc('0x20')](0x194);}return _0x1180a9;};}function handleError(_0x37eca2,_0x15bb2d){_0x15bb2d=_0x15bb2d||0x1f4;return function(_0xdbc3af){logger[_0x2ecc('0x21')](_0xdbc3af[_0x2ecc('0x22')]);if(_0xdbc3af['name']){delete _0xdbc3af[_0x2ecc('0x23')];}_0x37eca2[_0x2ecc('0x16')](_0x15bb2d)[_0x2ecc('0x24')](_0xdbc3af);};}exports[_0x2ecc('0x25')]=function(_0x529679,_0x257717){if(_0x529679['body']['id']){delete _0x529679[_0x2ecc('0x26')]['id'];}return db[_0x2ecc('0x27')][_0x2ecc('0x28')]({'where':{'id':_0x529679[_0x2ecc('0x29')]['id']}})[_0x2ecc('0x1f')](handleEntityNotFound(_0x257717,null))['then'](saveUpdates(_0x529679[_0x2ecc('0x26')],null))[_0x2ecc('0x1f')](respondWithResult(_0x257717,null))[_0x2ecc('0x2a')](handleError(_0x257717,null));};exports['destroy']=function(_0x5ab2ca,_0x380c73){return db[_0x2ecc('0x27')][_0x2ecc('0x28')]({'where':{'id':_0x5ab2ca[_0x2ecc('0x29')]['id']}})[_0x2ecc('0x1f')](handleEntityNotFound(_0x380c73,null))['then'](removeEntity(_0x380c73,null))[_0x2ecc('0x2a')](handleError(_0x380c73,null));}; \ No newline at end of file +var _0xef24=['status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb'];(function(_0x15a427,_0x19b68e){var _0xdaa9c=function(_0x3e4e90){while(--_0x3e4e90){_0x15a427['push'](_0x15a427['shift']());}};_0xdaa9c(++_0x19b68e);}(_0xef24,0x18f));var _0x4ef2=function(_0x4026ed,_0x36f17f){_0x4026ed=_0x4026ed-0x0;var _0x33d1ef=_0xef24[_0x4026ed];return _0x33d1ef;};'use strict';var emlformat=require(_0x4ef2('0x0'));var rimraf=require(_0x4ef2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ef2('0x2'));var rp=require(_0x4ef2('0x3'));var moment=require(_0x4ef2('0x4'));var BPromise=require(_0x4ef2('0x5'));var Mustache=require('mustache');var util=require(_0x4ef2('0x6'));var path=require(_0x4ef2('0x7'));var sox=require(_0x4ef2('0x8'));var csv=require('to-csv');var ejs=require(_0x4ef2('0x9'));var fs=require('fs');var fs_extra=require(_0x4ef2('0xa'));var _=require(_0x4ef2('0xb'));var squel=require(_0x4ef2('0xc'));var crypto=require(_0x4ef2('0xd'));var jsforce=require(_0x4ef2('0xe'));var deskjs=require(_0x4ef2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4ef2('0x10'));var Papa=require('papaparse');var Redis=require(_0x4ef2('0x11'));var authService=require(_0x4ef2('0x12'));var qs=require(_0x4ef2('0x13'));var as=require(_0x4ef2('0x14'));var hardwareService=require(_0x4ef2('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4ef2('0x16'));var db=require(_0x4ef2('0x17'))['db'];function respondWithStatusCode(_0x50e868,_0x6cdda2){_0x6cdda2=_0x6cdda2||0xcc;return function(_0x246b62){if(_0x246b62){return _0x50e868['sendStatus'](_0x6cdda2);}return _0x50e868[_0x4ef2('0x18')](_0x6cdda2)[_0x4ef2('0x19')]();};}function respondWithResult(_0x513d7f,_0x22b7bb){_0x22b7bb=_0x22b7bb||0xc8;return function(_0x173b7d){if(_0x173b7d){return _0x513d7f[_0x4ef2('0x18')](_0x22b7bb)['json'](_0x173b7d);}};}function respondWithFilteredResult(_0x38fd3d,_0x337b8b){return function(_0x139964){if(_0x139964){var _0x3edee7=typeof _0x337b8b[_0x4ef2('0x1a')]===_0x4ef2('0x1b')&&typeof _0x337b8b[_0x4ef2('0x1c')]==='undefined';var _0x4ebf78=_0x139964[_0x4ef2('0x1d')];var _0x1f7706=_0x3edee7?0x0:_0x337b8b['offset'];var _0x46d355=_0x3edee7?_0x139964['count']:_0x337b8b[_0x4ef2('0x1a')]+_0x337b8b[_0x4ef2('0x1c')];var _0x44d4d2;if(_0x46d355>=_0x4ebf78){_0x46d355=_0x4ebf78;_0x44d4d2=0xc8;}else{_0x44d4d2=0xce;}_0x38fd3d[_0x4ef2('0x18')](_0x44d4d2);return _0x38fd3d[_0x4ef2('0x1e')]('Content-Range',_0x1f7706+'-'+_0x46d355+'/'+_0x4ebf78)[_0x4ef2('0x1f')](_0x139964);}return null;};}function patchUpdates(_0x38c2ff){return function(_0x391d54){try{jsonpatch[_0x4ef2('0x20')](_0x391d54,_0x38c2ff,!![]);}catch(_0x2216fa){return BPromise[_0x4ef2('0x21')](_0x2216fa);}return _0x391d54[_0x4ef2('0x22')]();};}function saveUpdates(_0x4776b2,_0x5123ec){return function(_0x5401f0){if(_0x5401f0){return _0x5401f0[_0x4ef2('0x23')](_0x4776b2)[_0x4ef2('0x24')](function(_0x296465){return _0x296465;});}return null;};}function removeEntity(_0x3c641b,_0x52b160){return function(_0x4d9c62){if(_0x4d9c62){return _0x4d9c62[_0x4ef2('0x25')]()[_0x4ef2('0x24')](function(){_0x3c641b[_0x4ef2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18e005,_0x4cc6b2){return function(_0x22a9d2){if(!_0x22a9d2){_0x18e005['sendStatus'](0x194);}return _0x22a9d2;};}function handleError(_0x2b90bf,_0x3bd18b){_0x3bd18b=_0x3bd18b||0x1f4;return function(_0xd9b820){logger[_0x4ef2('0x26')](_0xd9b820[_0x4ef2('0x27')]);if(_0xd9b820[_0x4ef2('0x28')]){delete _0xd9b820[_0x4ef2('0x28')];}_0x2b90bf[_0x4ef2('0x18')](_0x3bd18b)[_0x4ef2('0x29')](_0xd9b820);};}exports[_0x4ef2('0x23')]=function(_0x551e18,_0x59e65a){if(_0x551e18[_0x4ef2('0x2a')]['id']){delete _0x551e18['body']['id'];}return db[_0x4ef2('0x2b')][_0x4ef2('0x2c')]({'where':{'id':_0x551e18[_0x4ef2('0x2d')]['id']}})['then'](handleEntityNotFound(_0x59e65a,null))[_0x4ef2('0x24')](saveUpdates(_0x551e18[_0x4ef2('0x2a')],null))[_0x4ef2('0x24')](respondWithResult(_0x59e65a,null))[_0x4ef2('0x2e')](handleError(_0x59e65a,null));};exports[_0x4ef2('0x25')]=function(_0x22ab96,_0x1a5055){return db[_0x4ef2('0x2b')]['find']({'where':{'id':_0x22ab96[_0x4ef2('0x2d')]['id']}})[_0x4ef2('0x24')](handleEntityNotFound(_0x1a5055,null))['then'](removeEntity(_0x1a5055,null))['catch'](handleError(_0x1a5055,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 632766d..31ebd42 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 _0xa033=['define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./action.attributes','exports'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa033,0x1ca));var _0x3a03=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa033[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3a03('0x0'));var util=require(_0x3a03('0x1'));var logger=require(_0x3a03('0x2'))(_0x3a03('0x3'));var moment=require(_0x3a03('0x4'));var BPromise=require(_0x3a03('0x5'));var rp=require(_0x3a03('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3a03('0x7'));var attributes=require(_0x3a03('0x8'));module[_0x3a03('0x9')]=function(_0x44d202,_0x4513fc){return _0x44d202[_0x3a03('0xa')](_0x3a03('0xb'),attributes,{'tableName':_0x3a03('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8997=['Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define'];(function(_0x5ab08e,_0x2cf537){var _0x52234e=function(_0x981fbb){while(--_0x981fbb){_0x5ab08e['push'](_0x5ab08e['shift']());}};_0x52234e(++_0x2cf537);}(_0x8997,0x18e));var _0x7899=function(_0x25d673,_0x5e18ed){_0x25d673=_0x25d673-0x0;var _0x32f3cc=_0x8997[_0x25d673];return _0x32f3cc;};'use strict';var _=require(_0x7899('0x0'));var util=require(_0x7899('0x1'));var logger=require(_0x7899('0x2'))(_0x7899('0x3'));var moment=require(_0x7899('0x4'));var BPromise=require(_0x7899('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7899('0x6'));var rimraf=require('rimraf');var config=require(_0x7899('0x7'));var attributes=require('./action.attributes');module[_0x7899('0x8')]=function(_0x410ea3,_0x2fca8e){return _0x410ea3[_0x7899('0x9')](_0x7899('0xa'),attributes,{'tableName':_0x7899('0xb'),'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 3fa0e30..21ea86b 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 _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x814b,0x1a2));var _0xb814=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0x814b[_0x446208];return _0xe49563;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1b685f,_0xe91584){var _0x4ca87d=function(_0x3f6970){while(--_0x3f6970){_0x1b685f['push'](_0x1b685f['shift']());}};_0x4ca87d(++_0xe91584);}(_0x5fc3,0xa8));var _0x35fc=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0x5fc3[_0x53b53e];return _0xbb6179;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index f4a97be..7cb3429 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 _0x4d63=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','multer','util','express','Router','fs-extra'];(function(_0xb5ac40,_0x21c87d){var _0xe9e53b=function(_0x5dcbf8){while(--_0x5dcbf8){_0xb5ac40['push'](_0xb5ac40['shift']());}};_0xe9e53b(++_0x21c87d);}(_0x4d63,0x193));var _0x34d6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4d63[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x34d6('0x0'));var util=require(_0x34d6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x34d6('0x2'));var router=express[_0x34d6('0x3')]();var fs_extra=require(_0x34d6('0x4'));var auth=require(_0x34d6('0x5'));var interaction=require(_0x34d6('0x6'));var config=require(_0x34d6('0x7'));var controller=require(_0x34d6('0x8'));router['put'](_0x34d6('0x9'),auth[_0x34d6('0xa')](),controller[_0x34d6('0xb')]);router['delete'](_0x34d6('0x9'),auth[_0x34d6('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe1af=['./action.controller','put','/:id','isAuthenticated','update','delete','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x51ec61,_0xf9d1e3){var _0x223200=function(_0x3bd510){while(--_0x3bd510){_0x51ec61['push'](_0x51ec61['shift']());}};_0x223200(++_0xf9d1e3);}(_0xe1af,0xa2));var _0xfe1a=function(_0x5edcfd,_0xa2e9c0){_0x5edcfd=_0x5edcfd-0x0;var _0x18b08f=_0xe1af[_0x5edcfd];return _0x18b08f;};'use strict';var multer=require(_0xfe1a('0x0'));var util=require(_0xfe1a('0x1'));var path=require('path');var timeout=require(_0xfe1a('0x2'));var express=require('express');var router=express[_0xfe1a('0x3')]();var fs_extra=require(_0xfe1a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe1a('0x5'));var config=require(_0xfe1a('0x6'));var controller=require(_0xfe1a('0x7'));router[_0xfe1a('0x8')](_0xfe1a('0x9'),auth[_0xfe1a('0xa')](),controller[_0xfe1a('0xb')]);router[_0xfe1a('0xc')](_0xfe1a('0x9'),auth[_0xfe1a('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 9a23b6e..d83e66d 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 _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x18fdc4,_0x41840b){var _0x2ebbfb=function(_0x5c2962){while(--_0x5c2962){_0x18fdc4['push'](_0x18fdc4['shift']());}};_0x2ebbfb(++_0x41840b);}(_0x5496,0x175));var _0x6549=function(_0x1ae8e7,_0x2ab5f9){_0x1ae8e7=_0x1ae8e7-0x0;var _0x515513=_0x5496[_0x1ae8e7];return _0x515513;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6549('0x2')]},'parent':{'type':Sequelize[_0x6549('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x6549('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0x2ece52,_0x538ee5){var _0x585ea8=function(_0x528662){while(--_0x528662){_0x2ece52['push'](_0x2ece52['shift']());}};_0x585ea8(++_0x538ee5);}(_0x5d17,0x114));var _0x75d1=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x5d17[_0x45fc6a];return _0x14bcfd;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 98ca17b..7c6f7c4 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 _0x5335=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','json','offset','undefined','limit','count','status','set','apply','reject','update','then','get','CustomReports','UserProfileResource','destroy','end','error','name','send','AnalyticCustomReport','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','catch','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','table','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','HOUR(%s)','select','from','%s.%s\x20=\x20%s.%s','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','IS\x20NOT\x20NULL','value','eml-format','rimraf','zip-dir'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x5335,0xa0));var _0x5533=function(_0x3131b5,_0x425415){_0x3131b5=_0x3131b5-0x0;var _0x274d11=_0x5335[_0x3131b5];return _0x274d11;};'use strict';var emlformat=require(_0x5533('0x0'));var rimraf=require(_0x5533('0x1'));var zipdir=require(_0x5533('0x2'));var jsonpatch=require(_0x5533('0x3'));var rp=require(_0x5533('0x4'));var moment=require(_0x5533('0x5'));var BPromise=require(_0x5533('0x6'));var Mustache=require(_0x5533('0x7'));var util=require('util');var path=require(_0x5533('0x8'));var sox=require(_0x5533('0x9'));var csv=require(_0x5533('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5533('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5533('0xc'));var jsforce=require(_0x5533('0xd'));var deskjs=require(_0x5533('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5533('0xf'));var Papa=require('papaparse');var Redis=require(_0x5533('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5533('0x11'));var as=require(_0x5533('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5533('0x13'))(_0x5533('0x14'));var utils=require(_0x5533('0x15'));var config=require(_0x5533('0x16'));var licenseUtil=require(_0x5533('0x17'));var db=require(_0x5533('0x18'))['db'];var dbH=require(_0x5533('0x18'))[_0x5533('0x19')];function respondWithStatusCode(_0x1f8fbf,_0x22d637){_0x22d637=_0x22d637||0xcc;return function(_0x2b6ca8){if(_0x2b6ca8){return _0x1f8fbf[_0x5533('0x1a')](_0x22d637);}return _0x1f8fbf['status'](_0x22d637)['end']();};}function respondWithResult(_0x811621,_0x18e7ec){_0x18e7ec=_0x18e7ec||0xc8;return function(_0x2fc435){if(_0x2fc435){return _0x811621['status'](_0x18e7ec)[_0x5533('0x1b')](_0x2fc435);}};}function respondWithFilteredResult(_0x574eab,_0x5ce8c1){return function(_0x26eb35){if(_0x26eb35){var _0x464583=typeof _0x5ce8c1[_0x5533('0x1c')]===_0x5533('0x1d')&&typeof _0x5ce8c1[_0x5533('0x1e')]===_0x5533('0x1d');var _0xde7230=_0x26eb35[_0x5533('0x1f')];var _0x305463=_0x464583?0x0:_0x5ce8c1[_0x5533('0x1c')];var _0x3c3f0d=_0x464583?_0x26eb35[_0x5533('0x1f')]:_0x5ce8c1[_0x5533('0x1c')]+_0x5ce8c1[_0x5533('0x1e')];var _0x44ede0;if(_0x3c3f0d>=_0xde7230){_0x3c3f0d=_0xde7230;_0x44ede0=0xc8;}else{_0x44ede0=0xce;}_0x574eab[_0x5533('0x20')](_0x44ede0);return _0x574eab[_0x5533('0x21')]('Content-Range',_0x305463+'-'+_0x3c3f0d+'/'+_0xde7230)[_0x5533('0x1b')](_0x26eb35);}return null;};}function patchUpdates(_0x151326){return function(_0x479ce9){try{jsonpatch[_0x5533('0x22')](_0x479ce9,_0x151326,!![]);}catch(_0x5cc0bc){return BPromise[_0x5533('0x23')](_0x5cc0bc);}return _0x479ce9['save']();};}function saveUpdates(_0x1790df,_0x53b3cf){return function(_0x1e8d52){if(_0x1e8d52){return _0x1e8d52[_0x5533('0x24')](_0x1790df)[_0x5533('0x25')](function(_0x25ba5b){return _0x25ba5b;});}return null;};}function removeEntity(_0x57136c,_0x13f3c4){return function(_0x1a1436){if(_0x1a1436){return _0x1a1436['destroy']()[_0x5533('0x25')](function(){var _0x4c831d=_0x1a1436[_0x5533('0x26')]({'plain':!![]});var _0x10b369=_0x5533('0x27');return db[_0x5533('0x28')][_0x5533('0x29')]({'where':{'type':_0x10b369,'resourceId':_0x4c831d['id']}})[_0x5533('0x25')](function(){return _0x1a1436;});})[_0x5533('0x25')](function(){_0x57136c[_0x5533('0x20')](0xcc)[_0x5533('0x2a')]();});}};}function handleEntityNotFound(_0x5edfbd,_0x11a58b){return function(_0x3d57e1){if(!_0x3d57e1){_0x5edfbd[_0x5533('0x1a')](0x194);}return _0x3d57e1;};}function handleError(_0x2d5e62,_0x554d7e){_0x554d7e=_0x554d7e||0x1f4;return function(_0x2d434b){logger[_0x5533('0x2b')](_0x2d434b['stack']);if(_0x2d434b[_0x5533('0x2c')]){delete _0x2d434b[_0x5533('0x2c')];}_0x2d5e62[_0x5533('0x20')](_0x554d7e)[_0x5533('0x2d')](_0x2d434b);};}exports['index']=function(_0x87c0e6,_0x203aa4){var _0x84fe8b={},_0x9639e2={},_0x3de2a2={'count':0x0,'rows':[]};var _0x458dfe=_['map'](db[_0x5533('0x2e')]['rawAttributes'],function(_0x16715e){return{'name':_0x16715e['fieldName'],'type':_0x16715e['type'][_0x5533('0x2f')]};});_0x9639e2[_0x5533('0x30')]=_[_0x5533('0x31')](_0x458dfe,_0x5533('0x2c'));_0x9639e2[_0x5533('0x32')]=_[_0x5533('0x33')](_0x87c0e6[_0x5533('0x32')]);_0x9639e2[_0x5533('0x34')]=_['intersection'](_0x9639e2[_0x5533('0x30')],_0x9639e2[_0x5533('0x32')]);_0x84fe8b[_0x5533('0x35')]=_['intersection'](_0x9639e2['model'],qs[_0x5533('0x36')](_0x87c0e6['query'][_0x5533('0x36')]));_0x84fe8b['attributes']=_0x84fe8b['attributes']['length']?_0x84fe8b[_0x5533('0x35')]:_0x9639e2[_0x5533('0x30')];if(!_0x87c0e6[_0x5533('0x32')][_0x5533('0x37')](_0x5533('0x38'))){_0x84fe8b['limit']=qs[_0x5533('0x1e')](_0x87c0e6[_0x5533('0x32')]['limit']);_0x84fe8b[_0x5533('0x1c')]=qs['offset'](_0x87c0e6[_0x5533('0x32')][_0x5533('0x1c')]);}_0x84fe8b[_0x5533('0x39')]=qs['sort'](_0x87c0e6['query'][_0x5533('0x3a')]);_0x84fe8b[_0x5533('0x3b')]=qs[_0x5533('0x34')](_[_0x5533('0x3c')](_0x87c0e6[_0x5533('0x32')],_0x9639e2[_0x5533('0x34')]),_0x458dfe);if(_0x87c0e6[_0x5533('0x32')][_0x5533('0x3d')]){_0x84fe8b[_0x5533('0x3b')]=_[_0x5533('0x3e')](_0x84fe8b[_0x5533('0x3b')],{'$or':_[_0x5533('0x31')](_0x458dfe,function(_0x2a8ea0){if(_0x2a8ea0[_0x5533('0x3f')]!==_0x5533('0x40')){var _0x4a21bd={};_0x4a21bd[_0x2a8ea0[_0x5533('0x2c')]]={'$like':'%'+_0x87c0e6[_0x5533('0x32')]['filter']+'%'};return _0x4a21bd;}})});}_0x84fe8b=_[_0x5533('0x3e')]({},_0x84fe8b,_0x87c0e6[_0x5533('0x41')]);var _0x9fe1af={'where':_0x84fe8b[_0x5533('0x3b')]};return db['AnalyticCustomReport']['count'](_0x9fe1af)[_0x5533('0x25')](function(_0x1fa582){_0x3de2a2['count']=_0x1fa582;if(_0x87c0e6['query'][_0x5533('0x42')]){_0x84fe8b[_0x5533('0x43')]=[{'all':!![]}];}return db[_0x5533('0x2e')][_0x5533('0x44')](_0x84fe8b);})[_0x5533('0x25')](function(_0x1b4efe){_0x3de2a2['rows']=_0x1b4efe;return _0x3de2a2;})['then'](respondWithFilteredResult(_0x203aa4,_0x84fe8b))['catch'](handleError(_0x203aa4,null));};exports[_0x5533('0x45')]=function(_0x24ade3,_0x391371){var _0x158c8e={'raw':![],'where':{'id':_0x24ade3[_0x5533('0x46')]['id']}},_0x566545={};_0x566545[_0x5533('0x30')]=_[_0x5533('0x33')](db['AnalyticCustomReport']['rawAttributes']);_0x566545[_0x5533('0x32')]=_['keys'](_0x24ade3[_0x5533('0x32')]);_0x566545[_0x5533('0x34')]=_[_0x5533('0x47')](_0x566545[_0x5533('0x30')],_0x566545['query']);_0x158c8e['attributes']=_[_0x5533('0x47')](_0x566545[_0x5533('0x30')],qs[_0x5533('0x36')](_0x24ade3['query'][_0x5533('0x36')]));_0x158c8e[_0x5533('0x35')]=_0x158c8e[_0x5533('0x35')]['length']?_0x158c8e[_0x5533('0x35')]:_0x566545[_0x5533('0x30')];if(_0x24ade3[_0x5533('0x32')][_0x5533('0x42')]){_0x158c8e[_0x5533('0x43')]=[{'all':!![]}];}_0x158c8e=_['merge']({},_0x158c8e,_0x24ade3[_0x5533('0x41')]);return db['AnalyticCustomReport']['find'](_0x158c8e)[_0x5533('0x25')](handleEntityNotFound(_0x391371,null))[_0x5533('0x25')](respondWithResult(_0x391371,null))['catch'](handleError(_0x391371,null));};exports[_0x5533('0x48')]=function(_0x334251,_0x32badf){return db[_0x5533('0x2e')][_0x5533('0x48')](_0x334251[_0x5533('0x49')],{})[_0x5533('0x25')](function(_0x42a1bd){var _0x1c4e65=_0x334251['user'][_0x5533('0x26')]({'plain':!![]});if(!_0x1c4e65)throw new Error(_0x5533('0x4a'));if(_0x1c4e65[_0x5533('0x4b')]==='user'){var _0x3e81ad=_0x42a1bd['get']({'plain':!![]});var _0x5d0d95='Reports';return db['UserProfileSection'][_0x5533('0x4c')]({'where':{'name':_0x5d0d95,'userProfileId':_0x1c4e65['userProfileId']},'raw':!![]})['then'](function(_0x44de37){if(_0x44de37&&_0x44de37['autoAssociation']===0x0){return db[_0x5533('0x28')][_0x5533('0x48')]({'name':_0x3e81ad['name'],'resourceId':_0x3e81ad['id'],'type':_0x5533('0x27'),'sectionId':_0x44de37['id']},{})[_0x5533('0x25')](function(){return _0x42a1bd;});}else{return _0x42a1bd;}})[_0x5533('0x4d')](function(_0x10244b){logger[_0x5533('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10244b);throw _0x10244b;});}return _0x42a1bd;})[_0x5533('0x25')](respondWithResult(_0x32badf,0xc9))[_0x5533('0x4d')](handleError(_0x32badf,null));};exports[_0x5533('0x24')]=function(_0x3ff2d6,_0xcf336c){if(_0x3ff2d6[_0x5533('0x49')]['id']){delete _0x3ff2d6[_0x5533('0x49')]['id'];}return db[_0x5533('0x2e')]['find']({'where':{'id':_0x3ff2d6[_0x5533('0x46')]['id']}})[_0x5533('0x25')](handleEntityNotFound(_0xcf336c,null))['then'](saveUpdates(_0x3ff2d6[_0x5533('0x49')],null))[_0x5533('0x25')](respondWithResult(_0xcf336c,null))[_0x5533('0x4d')](handleError(_0xcf336c,null));};exports[_0x5533('0x29')]=function(_0x47c1f8,_0x4605b9){return db[_0x5533('0x2e')]['find']({'where':{'id':_0x47c1f8[_0x5533('0x46')]['id']}})['then'](handleEntityNotFound(_0x4605b9,null))[_0x5533('0x25')](removeEntity(_0x4605b9,null))[_0x5533('0x4d')](handleError(_0x4605b9,null));};exports[_0x5533('0x4e')]=function(_0xb17ead,_0x13653d){var _0x5486ea=0xa;var _0x19de49=[_0x5533('0x4f'),_0x5533('0x50'),'right_join',_0x5533('0x51')];var _0x2806a0={'SUM':_0x5533('0x52'),'COUNT':_0x5533('0x53'),'COUNT DISTINCT':_0x5533('0x54'),'MAX':_0x5533('0x55'),'MIN':_0x5533('0x56'),'AVG':_0x5533('0x57'),'GROUP_CONCAT':_0x5533('0x58'),'GROUP_CONCAT ASC':_0x5533('0x59'),'GROUP_CONCAT DESC':_0x5533('0x5a')};var _0x289ee7={'SEC_TO_TIME':_0x5533('0x5b'),'DATE':_0x5533('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x5533('0x5d'),'UNIX_TIMESTAMP':_0x5533('0x5e')};var _0x10f1f9=function(_0x49ec5d){return!_[_0x5533('0x5f')]([_0x5533('0x60'),'IS\x20NOT\x20NULL',_0x5533('0x61'),_0x5533('0x62')],_0x49ec5d);};var _0x194761=function(_0xc125dd){if(!_0xc125dd||!_0xc125dd[_0x5533('0x63')][_0x5533('0x64')]){return'';}for(var _0x2ef08a='(',_0x1e0e80=0x0;_0x1e0e80<_0xc125dd[_0x5533('0x63')][_0x5533('0x64')];_0x1e0e80+=0x1){_0x1e0e80>0x0&&(_0x2ef08a+='\x20'+_0xc125dd[_0x5533('0x65')]+'\x20');_0x2ef08a+=_0xc125dd[_0x5533('0x63')][_0x1e0e80][_0x5533('0x66')]?_0x194761(_0xc125dd[_0x5533('0x63')][_0x1e0e80][_0x5533('0x66')]):_0xc125dd['rules'][_0x1e0e80][_0x5533('0x67')]+'\x20'+_0xc125dd[_0x5533('0x63')][_0x1e0e80][_0x5533('0x68')]+(_0x10f1f9(_0xc125dd['rules'][_0x1e0e80][_0x5533('0x68')])?'\x20'+_0xc125dd[_0x5533('0x63')][_0x1e0e80]['value']:'');}return _0x2ef08a+')';};var _0x1188f4={'where':{'id':_0xb17ead[_0x5533('0x46')]['id']}},_0x4be63b,_0x5f1621,_0x44b571,_0x20153a,_0x1b3e2e;_0x1188f4=_[_0x5533('0x3e')]({},_0x1188f4,_0xb17ead[_0x5533('0x41')]);return db[_0x5533('0x2e')][_0x5533('0x4c')](_0x1188f4)[_0x5533('0x25')](function(_0x3e279b){if(_0x3e279b){_0x4be63b=_0x3e279b;return _0x3e279b[_0x5533('0x69')]();}return null;})[_0x5533('0x25')](function(_0x14e79b){if(_0x14e79b){if(!_0x14e79b[_0x5533('0x64')]){throw new db[(_0x5533('0x6a'))][(_0x5533('0x6b'))](_0x5533('0x6c'),0x193);}_0x5f1621=_0x14e79b;return db[_0x5533('0x6d')][_0x5533('0x44')]({'raw':!![]});}return null;})[_0x5533('0x25')](function(_0x5c62a4){if(_0x5c62a4){_0x44b571=_[_0x5533('0x6e')](_0x5c62a4,'id');var _0x11fc39;var _0x3a499b=squel['select']();_0x3a499b['from'](_0x4be63b['table']);for(var _0x49a35a=0x0;_0x49a35a<_0x5f1621[_0x5533('0x64')];_0x49a35a+=0x1){_0x11fc39=_0x5f1621[_0x49a35a][_0x5533('0x6f')]?_0x44b571[_0x5f1621[_0x49a35a][_0x5533('0x6f')]][_0x5533('0x70')]:_0x5f1621[_0x49a35a]['field'];_0x11fc39=_0x5f1621[_0x49a35a][_0x5533('0x71')]?_['replace'](_0x2806a0[_0x5f1621[_0x49a35a][_0x5533('0x71')]],'%s',_0x11fc39):_0x11fc39;_0x11fc39=_0x5f1621[_0x49a35a]['format']?_[_0x5533('0x72')](_0x289ee7[_0x5f1621[_0x49a35a][_0x5533('0x73')]],'%s',_0x11fc39):_0x11fc39;if(_0x5f1621[_0x49a35a][_0x5533('0x74')]){_0x3a499b[_0x5533('0x66')](_0x11fc39);}_0x5f1621[_0x49a35a]['orderBy']&&_0x3a499b[_0x5533('0x39')](_0x11fc39,_0x5f1621[_0x49a35a][_0x5533('0x75')]==='DESC'?![]:!![]);_0x3a499b[_0x5533('0x67')](_0x11fc39,_0x5f1621[_0x49a35a][_0x5533('0x76')]||_0x11fc39);}if(_0x4be63b['joins']){_0x4be63b[_0x5533('0x77')]=JSON['parse'](_0x4be63b['joins']);for(var _0x516dd0=0x0;_0x516dd0<_0x4be63b[_0x5533('0x77')][_0x5533('0x64')];_0x516dd0+=0x1){if(_0x4be63b['joins'][_0x516dd0][_0x5533('0x3f')]&&_['includes'](_0x19de49,_0x4be63b[_0x5533('0x77')][_0x516dd0]['type'])&&_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x78')]&&_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x79')]&&_0x4be63b['joins'][_0x516dd0][_0x5533('0x7a')]){_0x3a499b[_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x3f')]](_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x79')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4be63b[_0x5533('0x7b')],_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x78')],_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x79')],_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x7a')]));}}}if(_0x4be63b[_0x5533('0x7c')]){_0x4be63b[_0x5533('0x7c')]=JSON[_0x5533('0x7d')](_0x4be63b['conditions']);_0x3a499b[_0x5533('0x3b')](_0x194761(_0x4be63b[_0x5533('0x7c')][_0x5533('0x66')]));}_0x1b3e2e=_0x3a499b[_0x5533('0x7e')]();_0x3a499b['limit'](_0x5486ea);_0x3a499b[_0x5533('0x1c')](0x0);logger[_0x5533('0x7f')](_0x5533('0x80'),_0x3a499b[_0x5533('0x81')]());return dbH[_0x5533('0x82')][_0x5533('0x32')](_0x3a499b['toString'](),{'type':dbH[_0x5533('0x82')][_0x5533('0x83')][_0x5533('0x84')]});}})[_0x5533('0x25')](respondWithResult(_0x13653d,null))['catch'](handleError(_0x13653d,null));};function runReport(_0x215a59,_0x3fed35,_0x418de5){var _0x2ee6ca=_0x3fed35[_0x5533('0x2c')];var _0x9d1269=0xa;var _0x12a49e=[_0x5533('0x4f'),_0x5533('0x50'),_0x5533('0x85'),_0x5533('0x51')];var _0x1e0cb0={'SUM':_0x5533('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5533('0x54'),'MAX':_0x5533('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5533('0x58'),'GROUP_CONCAT ASC':_0x5533('0x59'),'GROUP_CONCAT DESC':_0x5533('0x5a')};var _0x49023a={'SEC_TO_TIME':_0x5533('0x5b'),'DATE':_0x5533('0x5c'),'HOUR':_0x5533('0x86'),'ROUND':_0x5533('0x5d'),'UNIX_TIMESTAMP':_0x5533('0x5e')};var _0x552ca3=function(_0x9a902c){return!_['includes']([_0x5533('0x60'),'IS\x20NOT\x20NULL',_0x5533('0x61'),_0x5533('0x62')],_0x9a902c);};var _0x1cdc0e=function(_0x1d8286){if(!_0x1d8286||!_0x1d8286['rules'][_0x5533('0x64')]){return'';}for(var _0x11981b='(',_0x2a4100=0x0;_0x2a4100<_0x1d8286[_0x5533('0x63')][_0x5533('0x64')];_0x2a4100+=0x1){_0x2a4100>0x0&&(_0x11981b+='\x20'+_0x1d8286[_0x5533('0x65')]+'\x20');_0x11981b+=_0x1d8286['rules'][_0x2a4100][_0x5533('0x66')]?_0x1cdc0e(_0x1d8286[_0x5533('0x63')][_0x2a4100][_0x5533('0x66')]):_0x1d8286[_0x5533('0x63')][_0x2a4100][_0x5533('0x67')]+'\x20'+_0x1d8286['rules'][_0x2a4100][_0x5533('0x68')]+(_0x552ca3(_0x1d8286[_0x5533('0x63')][_0x2a4100][_0x5533('0x68')])?'\x20'+_0x1d8286[_0x5533('0x63')][_0x2a4100]['value']:'');}return _0x11981b+')';};var _0x69ccc5={'where':{'id':_0x215a59['id']}},_0x3dff4b,_0x2e0553,_0x11d451,_0x2f2713,_0xc06370;_0x69ccc5=_[_0x5533('0x3e')]({},_0x69ccc5,_0x418de5);return db[_0x5533('0x2e')]['find'](_0x69ccc5)['then'](function(_0x339fa3){if(_0x339fa3){_0x3dff4b=_0x339fa3;return _0x339fa3[_0x5533('0x69')]();}return null;})['then'](function(_0xb23804){if(_0xb23804){if(!_0xb23804['length']){throw new db[(_0x5533('0x6a'))]['ValidationErrorItem'](_0x5533('0x6c'),0x193);}_0x2e0553=_0xb23804;return db[_0x5533('0x6d')][_0x5533('0x44')]({'raw':!![]});}return null;})[_0x5533('0x25')](function(_0x44ac2c){if(_0x44ac2c){_0x11d451=_['keyBy'](_0x44ac2c,'id');var _0x41017d;var _0x18ff80=squel[_0x5533('0x87')]();_0x18ff80[_0x5533('0x88')](_0x3dff4b[_0x5533('0x7b')]);for(var _0x1feb9f=0x0;_0x1feb9f<_0x2e0553['length'];_0x1feb9f+=0x1){_0x41017d=_0x2e0553[_0x1feb9f][_0x5533('0x6f')]?_0x11d451[_0x2e0553[_0x1feb9f][_0x5533('0x6f')]][_0x5533('0x70')]:_0x2e0553[_0x1feb9f]['field'];_0x41017d=_0x2e0553[_0x1feb9f][_0x5533('0x71')]?_['replace'](_0x1e0cb0[_0x2e0553[_0x1feb9f][_0x5533('0x71')]],'%s',_0x41017d):_0x41017d;_0x41017d=_0x2e0553[_0x1feb9f][_0x5533('0x73')]?_['replace'](_0x49023a[_0x2e0553[_0x1feb9f][_0x5533('0x73')]],'%s',_0x41017d):_0x41017d;if(_0x2e0553[_0x1feb9f][_0x5533('0x74')]){_0x18ff80['group'](_0x41017d);}_0x2e0553[_0x1feb9f][_0x5533('0x75')]&&_0x18ff80['order'](_0x41017d,_0x2e0553[_0x1feb9f][_0x5533('0x75')]==='DESC'?![]:!![]);_0x18ff80[_0x5533('0x67')](_0x41017d,_0x2e0553[_0x1feb9f][_0x5533('0x76')]||_0x41017d);}if(_0x3dff4b[_0x5533('0x77')]){_0x3dff4b[_0x5533('0x77')]=JSON[_0x5533('0x7d')](_0x3dff4b[_0x5533('0x77')]);for(var _0x560dd6=0x0;_0x560dd6<_0x3dff4b[_0x5533('0x77')]['length'];_0x560dd6+=0x1){if(_0x3dff4b[_0x5533('0x77')][_0x560dd6][_0x5533('0x3f')]&&_['includes'](_0x12a49e,_0x3dff4b['joins'][_0x560dd6]['type'])&&_0x3dff4b[_0x5533('0x77')][_0x560dd6][_0x5533('0x78')]&&_0x3dff4b[_0x5533('0x77')][_0x560dd6][_0x5533('0x79')]&&_0x3dff4b['joins'][_0x560dd6]['foreignKey']){_0x18ff80[_0x3dff4b[_0x5533('0x77')][_0x560dd6][_0x5533('0x3f')]](_0x3dff4b[_0x5533('0x77')][_0x560dd6][_0x5533('0x79')],null,util[_0x5533('0x73')](_0x5533('0x89'),_0x3dff4b[_0x5533('0x7b')],_0x3dff4b[_0x5533('0x77')][_0x560dd6]['parentKey'],_0x3dff4b[_0x5533('0x77')][_0x560dd6][_0x5533('0x79')],_0x3dff4b['joins'][_0x560dd6][_0x5533('0x7a')]));}}}if(_0x3dff4b[_0x5533('0x7c')]){_0x3dff4b[_0x5533('0x7c')]=JSON[_0x5533('0x7d')](_0x3dff4b['conditions']);_0x18ff80['where'](_0x1cdc0e(_0x3dff4b[_0x5533('0x7c')][_0x5533('0x66')]));}_0xc06370=_0x18ff80['clone']();_0x18ff80[_0x5533('0x1e')](_0x9d1269);_0x18ff80[_0x5533('0x1c')](0x0);return;}})[_0x5533('0x25')](function(){if(_0x3fed35['output']===_0x5533('0x8a')){return null;}var _0x4f033a=_[_0x5533('0x3e')](_0x3fed35,{'name':_0x3fed35[_0x5533('0x8b')]||_0x3fed35[_0x5533('0x2c')]||_0x3dff4b['name'],'basename':_0x2ee6ca,'savename':util[_0x5533('0x73')](_0x5533('0x8c'),_0x3fed35[_0x5533('0x2c')]||_0x3dff4b[_0x5533('0x2c')],require(_0x5533('0x8d'))[_0x5533('0x8e')](0x4),_0x3fed35[_0x5533('0x8f')]||_0x5533('0x90')),'reportId':_0x3dff4b['id'],'reportType':_0x5533('0x91')});return db[_0x5533('0x92')]['create'](_0x4f033a,{'raw':!![]});})[_0x5533('0x25')](function(_0x14083e){if(_0x3dff4b[_0x5533('0x7b')]===_0x5533('0x93')){_0xc06370[_0x5533('0x3b')](_0x3dff4b[_0x5533('0x7b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3fed35[_0x5533('0x94')],_0x3fed35[_0x5533('0x95')]);}else{_0xc06370[_0x5533('0x3b')](_0x3dff4b[_0x5533('0x7b')]+_0x5533('0x96'),_0x3fed35[_0x5533('0x94')],_0x3fed35['endDate']);}if(_0x14083e){logger[_0x5533('0x97')](_0x5533('0x98'),_0xc06370[_0x5533('0x81')]());require(_0x5533('0x99'))[_0x5533('0x9a')](path[_0x5533('0x4f')](__dirname,_0x5533('0x9b'),_0x14083e[_0x5533('0x8f')]),[_0x14083e['id'],_0xc06370['toString'](),path['join'](__dirname,_0x5533('0x9c'),_0x14083e[_0x5533('0x9d')]),_0x2ee6ca]);return _0x14083e;}else{var _0x18fd15=squel[_0x5533('0x87')]();_0x18fd15[_0x5533('0x88')]('('+_0xc06370[_0x5533('0x81')]()+')','countTable');_0x18fd15['field'](_0x5533('0x9e'),_0x5533('0x1f'));_0xc06370['limit'](_0x3fed35['limit']||_0x9d1269);_0xc06370[_0x5533('0x1c')](_0x3fed35[_0x5533('0x1c')]||0x0);return dbH[_0x5533('0x82')]['query'](_0x18fd15[_0x5533('0x81')](),{'type':dbH[_0x5533('0x82')][_0x5533('0x83')][_0x5533('0x84')]})[_0x5533('0x25')](function(_0x15a322){if(!_0x15a322['length']){_0x2f2713=0x0;}else{_0x2f2713=_0x15a322[0x0][_0x5533('0x1f')]||0x0;}return dbH[_0x5533('0x82')]['query'](_0xc06370['toString'](),{'type':dbH[_0x5533('0x82')][_0x5533('0x83')][_0x5533('0x84')]});})[_0x5533('0x25')](function(_0x3ca995){return{'rows':_0x3ca995||[],'count':_0x2f2713};});}});}exports[_0x5533('0x9f')]=function(_0x3decaa,_0x54efaf){return runReport(_0x3decaa['params'],_0x3decaa[_0x5533('0x32')],_0x3decaa[_0x5533('0x41')])[_0x5533('0x25')](respondWithResult(_0x54efaf,null))[_0x5533('0x4d')](handleError(_0x54efaf,null));};exports[_0x5533('0xa0')]=runReport;exports[_0x5533('0x32')]=function(_0x35b1ed,_0x41da61){var _0xafa46f=0xa;var _0xd2c287=[_0x5533('0x4f'),_0x5533('0x50'),_0x5533('0x85'),_0x5533('0x51')];var _0x82512a={'SUM':_0x5533('0x52'),'COUNT':_0x5533('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5533('0x56'),'AVG':_0x5533('0x57'),'GROUP_CONCAT':_0x5533('0x58'),'GROUP_CONCAT ASC':_0x5533('0x59'),'GROUP_CONCAT DESC':_0x5533('0x5a')};var _0x408021={'SEC_TO_TIME':_0x5533('0x5b'),'DATE':_0x5533('0x5c'),'HOUR':_0x5533('0x86'),'ROUND':_0x5533('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x28366d=function(_0x40ae78){return!_['includes']([_0x5533('0x60'),_0x5533('0xa1'),_0x5533('0x61'),_0x5533('0x62')],_0x40ae78);};var _0x5957b2=function(_0x2e2013){if(!_0x2e2013||!_0x2e2013[_0x5533('0x63')][_0x5533('0x64')]){return'';}for(var _0x3b868d='(',_0x170c7c=0x0;_0x170c7c<_0x2e2013[_0x5533('0x63')][_0x5533('0x64')];_0x170c7c+=0x1){_0x170c7c>0x0&&(_0x3b868d+='\x20'+_0x2e2013[_0x5533('0x65')]+'\x20');_0x3b868d+=_0x2e2013[_0x5533('0x63')][_0x170c7c][_0x5533('0x66')]?_0x5957b2(_0x2e2013[_0x5533('0x63')][_0x170c7c][_0x5533('0x66')]):_0x2e2013[_0x5533('0x63')][_0x170c7c][_0x5533('0x67')]+'\x20'+_0x2e2013[_0x5533('0x63')][_0x170c7c][_0x5533('0x68')]+(_0x28366d(_0x2e2013['rules'][_0x170c7c]['condition'])?'\x20'+_0x2e2013[_0x5533('0x63')][_0x170c7c][_0x5533('0xa2')]:'');}return _0x3b868d+')';};var _0x41f342={'where':{'id':_0x35b1ed[_0x5533('0x46')]['id']}},_0x1a0d49,_0xa9e863,_0x1b0167,_0x355c6c,_0x20b068;_0x41f342=_['merge']({},_0x41f342,_0x35b1ed[_0x5533('0x41')]);return db[_0x5533('0x2e')][_0x5533('0x4c')](_0x41f342)[_0x5533('0x25')](function(_0x10d07a){if(_0x10d07a){_0x1a0d49=_0x10d07a;return _0x10d07a['getFields']();}return null;})['then'](function(_0x4e86d9){if(_0x4e86d9){if(!_0x4e86d9[_0x5533('0x64')]){throw new db[(_0x5533('0x6a'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xa9e863=_0x4e86d9;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x5533('0x25')](function(_0x3db6cf){if(_0x3db6cf){_0x1b0167=_[_0x5533('0x6e')](_0x3db6cf,'id');var _0x4604b7;var _0x2a9127=squel[_0x5533('0x87')]();_0x2a9127[_0x5533('0x88')](_0x1a0d49[_0x5533('0x7b')]);for(var _0xfe0fff=0x0;_0xfe0fff<_0xa9e863['length'];_0xfe0fff+=0x1){_0x4604b7=_0xa9e863[_0xfe0fff][_0x5533('0x6f')]?_0x1b0167[_0xa9e863[_0xfe0fff][_0x5533('0x6f')]]['metric']:_0xa9e863[_0xfe0fff]['field'];_0x4604b7=_0xa9e863[_0xfe0fff][_0x5533('0x71')]?_[_0x5533('0x72')](_0x82512a[_0xa9e863[_0xfe0fff][_0x5533('0x71')]],'%s',_0x4604b7):_0x4604b7;_0x4604b7=_0xa9e863[_0xfe0fff]['format']?_[_0x5533('0x72')](_0x408021[_0xa9e863[_0xfe0fff][_0x5533('0x73')]],'%s',_0x4604b7):_0x4604b7;if(_0xa9e863[_0xfe0fff][_0x5533('0x74')]){_0x2a9127['group'](_0x4604b7);}_0xa9e863[_0xfe0fff][_0x5533('0x75')]&&_0x2a9127[_0x5533('0x39')](_0x4604b7,_0xa9e863[_0xfe0fff]['orderBy']==='DESC'?![]:!![]);_0x2a9127[_0x5533('0x67')](_0x4604b7,_0xa9e863[_0xfe0fff][_0x5533('0x76')]||_0x4604b7);}if(_0x1a0d49[_0x5533('0x77')]){_0x1a0d49['joins']=JSON[_0x5533('0x7d')](_0x1a0d49[_0x5533('0x77')]);for(var _0x3624a7=0x0;_0x3624a7<_0x1a0d49[_0x5533('0x77')][_0x5533('0x64')];_0x3624a7+=0x1){if(_0x1a0d49[_0x5533('0x77')][_0x3624a7]['type']&&_[_0x5533('0x5f')](_0xd2c287,_0x1a0d49[_0x5533('0x77')][_0x3624a7][_0x5533('0x3f')])&&_0x1a0d49[_0x5533('0x77')][_0x3624a7][_0x5533('0x78')]&&_0x1a0d49[_0x5533('0x77')][_0x3624a7][_0x5533('0x79')]&&_0x1a0d49['joins'][_0x3624a7]['foreignKey']){_0x2a9127[_0x1a0d49['joins'][_0x3624a7]['type']](_0x1a0d49[_0x5533('0x77')][_0x3624a7]['foreignTable'],null,util[_0x5533('0x73')]('%s.%s\x20=\x20%s.%s',_0x1a0d49['table'],_0x1a0d49[_0x5533('0x77')][_0x3624a7][_0x5533('0x78')],_0x1a0d49['joins'][_0x3624a7][_0x5533('0x79')],_0x1a0d49[_0x5533('0x77')][_0x3624a7][_0x5533('0x7a')]));}}}if(_0x1a0d49[_0x5533('0x7c')]){_0x1a0d49[_0x5533('0x7c')]=JSON[_0x5533('0x7d')](_0x1a0d49['conditions']);_0x2a9127['where'](_0x5957b2(_0x1a0d49[_0x5533('0x7c')][_0x5533('0x66')]));}_0x20b068=_0x2a9127['clone']();_0x2a9127[_0x5533('0x1e')](_0xafa46f);_0x2a9127[_0x5533('0x1c')](0x0);logger[_0x5533('0x7f')](_0x5533('0x80'),_0x2a9127[_0x5533('0x81')]());return dbH[_0x5533('0x82')][_0x5533('0x32')](_0x2a9127[_0x5533('0x81')](),{'type':dbH['sequelize'][_0x5533('0x83')][_0x5533('0x84')]});}})['then'](function(){return{'sql':_0x20b068[_0x5533('0x81')]()};})[_0x5533('0x25')](respondWithResult(_0x41da61,null))[_0x5533('0x4d')](handleError(_0x41da61,null));}; \ No newline at end of file +var _0x2ebe=['../../mysqldb','dbH','sendStatus','status','end','json','limit','undefined','count','offset','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','send','AnalyticCustomReport','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','rawAttributes','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','right_join','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','from','table','MetricId','metric','field','replace','function','format','orderBy','DESC','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','IS\x20NULL','IS\x20EMPTY','operator','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','select','groupBy','alias','parentKey','fullPath','%s-%s.%s','randomstring','output','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','runReport','cross_join','MIN(%s)','Limited\x20Query:','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2ebe,0x125));var _0xe2eb=function(_0x662561,_0x4a5779){_0x662561=_0x662561-0x0;var _0x75c2d8=_0x2ebe[_0x662561];return _0x75c2d8;};'use strict';var emlformat=require(_0xe2eb('0x0'));var rimraf=require(_0xe2eb('0x1'));var zipdir=require(_0xe2eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe2eb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe2eb('0x4'));var util=require(_0xe2eb('0x5'));var path=require(_0xe2eb('0x6'));var sox=require(_0xe2eb('0x7'));var csv=require(_0xe2eb('0x8'));var ejs=require(_0xe2eb('0x9'));var fs=require('fs');var fs_extra=require(_0xe2eb('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe2eb('0xb'));var deskjs=require(_0xe2eb('0xc'));var toCsv=require(_0xe2eb('0x8'));var querystring=require(_0xe2eb('0xd'));var Papa=require(_0xe2eb('0xe'));var Redis=require(_0xe2eb('0xf'));var authService=require(_0xe2eb('0x10'));var qs=require(_0xe2eb('0x11'));var as=require(_0xe2eb('0x12'));var hardwareService=require(_0xe2eb('0x13'));var logger=require(_0xe2eb('0x14'))(_0xe2eb('0x15'));var utils=require('../../config/utils');var config=require(_0xe2eb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2eb('0x17'))['db'];var dbH=require(_0xe2eb('0x17'))[_0xe2eb('0x18')];function respondWithStatusCode(_0x4d23a9,_0x1fb8aa){_0x1fb8aa=_0x1fb8aa||0xcc;return function(_0x3822f0){if(_0x3822f0){return _0x4d23a9[_0xe2eb('0x19')](_0x1fb8aa);}return _0x4d23a9[_0xe2eb('0x1a')](_0x1fb8aa)[_0xe2eb('0x1b')]();};}function respondWithResult(_0x28ae8f,_0xb715e){_0xb715e=_0xb715e||0xc8;return function(_0x2ec379){if(_0x2ec379){return _0x28ae8f['status'](_0xb715e)[_0xe2eb('0x1c')](_0x2ec379);}};}function respondWithFilteredResult(_0xf0a434,_0x4efd5e){return function(_0x691de7){if(_0x691de7){var _0x47a6a7=typeof _0x4efd5e['offset']==='undefined'&&typeof _0x4efd5e[_0xe2eb('0x1d')]===_0xe2eb('0x1e');var _0x579ee4=_0x691de7[_0xe2eb('0x1f')];var _0x57b251=_0x47a6a7?0x0:_0x4efd5e[_0xe2eb('0x20')];var _0x10a020=_0x47a6a7?_0x691de7['count']:_0x4efd5e['offset']+_0x4efd5e[_0xe2eb('0x1d')];var _0x34ff2e;if(_0x10a020>=_0x579ee4){_0x10a020=_0x579ee4;_0x34ff2e=0xc8;}else{_0x34ff2e=0xce;}_0xf0a434[_0xe2eb('0x1a')](_0x34ff2e);return _0xf0a434['set']('Content-Range',_0x57b251+'-'+_0x10a020+'/'+_0x579ee4)[_0xe2eb('0x1c')](_0x691de7);}return null;};}function patchUpdates(_0xddb883){return function(_0x78cada){try{jsonpatch[_0xe2eb('0x21')](_0x78cada,_0xddb883,!![]);}catch(_0x23a624){return BPromise[_0xe2eb('0x22')](_0x23a624);}return _0x78cada[_0xe2eb('0x23')]();};}function saveUpdates(_0x5dd343,_0x50fee3){return function(_0x51613e){if(_0x51613e){return _0x51613e[_0xe2eb('0x24')](_0x5dd343)[_0xe2eb('0x25')](function(_0x3fdf7d){return _0x3fdf7d;});}return null;};}function removeEntity(_0x17332d,_0x4a4e9c){return function(_0x58413c){if(_0x58413c){return _0x58413c[_0xe2eb('0x26')]()[_0xe2eb('0x25')](function(){var _0x2cc85a=_0x58413c[_0xe2eb('0x27')]({'plain':!![]});var _0x3f1a19=_0xe2eb('0x28');return db[_0xe2eb('0x29')][_0xe2eb('0x26')]({'where':{'type':_0x3f1a19,'resourceId':_0x2cc85a['id']}})[_0xe2eb('0x25')](function(){return _0x58413c;});})[_0xe2eb('0x25')](function(){_0x17332d[_0xe2eb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38ceae,_0x4c2c19){return function(_0x457dbd){if(!_0x457dbd){_0x38ceae[_0xe2eb('0x19')](0x194);}return _0x457dbd;};}function handleError(_0x5edf86,_0x2700ac){_0x2700ac=_0x2700ac||0x1f4;return function(_0x54de4a){logger[_0xe2eb('0x2a')](_0x54de4a[_0xe2eb('0x2b')]);if(_0x54de4a['name']){delete _0x54de4a['name'];}_0x5edf86[_0xe2eb('0x1a')](_0x2700ac)[_0xe2eb('0x2c')](_0x54de4a);};}exports['index']=function(_0x274c0f,_0x30b466){var _0x30514c={},_0x8b85ed={},_0x47baac={'count':0x0,'rows':[]};var _0x2226c9=_['map'](db[_0xe2eb('0x2d')]['rawAttributes'],function(_0x13fc0f){return{'name':_0x13fc0f['fieldName'],'type':_0x13fc0f[_0xe2eb('0x2e')][_0xe2eb('0x2f')]};});_0x8b85ed[_0xe2eb('0x30')]=_[_0xe2eb('0x31')](_0x2226c9,_0xe2eb('0x32'));_0x8b85ed[_0xe2eb('0x33')]=_[_0xe2eb('0x34')](_0x274c0f[_0xe2eb('0x33')]);_0x8b85ed[_0xe2eb('0x35')]=_[_0xe2eb('0x36')](_0x8b85ed[_0xe2eb('0x30')],_0x8b85ed[_0xe2eb('0x33')]);_0x30514c[_0xe2eb('0x37')]=_[_0xe2eb('0x36')](_0x8b85ed[_0xe2eb('0x30')],qs[_0xe2eb('0x38')](_0x274c0f['query'][_0xe2eb('0x38')]));_0x30514c['attributes']=_0x30514c[_0xe2eb('0x37')][_0xe2eb('0x39')]?_0x30514c[_0xe2eb('0x37')]:_0x8b85ed[_0xe2eb('0x30')];if(!_0x274c0f[_0xe2eb('0x33')][_0xe2eb('0x3a')](_0xe2eb('0x3b'))){_0x30514c['limit']=qs[_0xe2eb('0x1d')](_0x274c0f['query'][_0xe2eb('0x1d')]);_0x30514c[_0xe2eb('0x20')]=qs[_0xe2eb('0x20')](_0x274c0f[_0xe2eb('0x33')]['offset']);}_0x30514c[_0xe2eb('0x3c')]=qs['sort'](_0x274c0f[_0xe2eb('0x33')]['sort']);_0x30514c[_0xe2eb('0x3d')]=qs[_0xe2eb('0x35')](_['pick'](_0x274c0f[_0xe2eb('0x33')],_0x8b85ed[_0xe2eb('0x35')]),_0x2226c9);if(_0x274c0f['query'][_0xe2eb('0x3e')]){_0x30514c['where']=_[_0xe2eb('0x3f')](_0x30514c['where'],{'$or':_[_0xe2eb('0x31')](_0x2226c9,function(_0x5458bb){if(_0x5458bb[_0xe2eb('0x2e')]!==_0xe2eb('0x40')){var _0x18628b={};_0x18628b[_0x5458bb[_0xe2eb('0x32')]]={'$like':'%'+_0x274c0f['query'][_0xe2eb('0x3e')]+'%'};return _0x18628b;}})});}_0x30514c=_[_0xe2eb('0x3f')]({},_0x30514c,_0x274c0f['options']);var _0x4101d6={'where':_0x30514c[_0xe2eb('0x3d')]};return db[_0xe2eb('0x2d')][_0xe2eb('0x1f')](_0x4101d6)['then'](function(_0x2b97be){_0x47baac[_0xe2eb('0x1f')]=_0x2b97be;if(_0x274c0f['query'][_0xe2eb('0x41')]){_0x30514c[_0xe2eb('0x42')]=[{'all':!![]}];}return db[_0xe2eb('0x2d')][_0xe2eb('0x43')](_0x30514c);})[_0xe2eb('0x25')](function(_0x480eb6){_0x47baac['rows']=_0x480eb6;return _0x47baac;})[_0xe2eb('0x25')](respondWithFilteredResult(_0x30b466,_0x30514c))[_0xe2eb('0x44')](handleError(_0x30b466,null));};exports['show']=function(_0x2acc2c,_0x35ca38){var _0x4ddbe8={'raw':![],'where':{'id':_0x2acc2c[_0xe2eb('0x45')]['id']}},_0x576aa9={};_0x576aa9[_0xe2eb('0x30')]=_[_0xe2eb('0x34')](db[_0xe2eb('0x2d')][_0xe2eb('0x46')]);_0x576aa9['query']=_[_0xe2eb('0x34')](_0x2acc2c['query']);_0x576aa9[_0xe2eb('0x35')]=_[_0xe2eb('0x36')](_0x576aa9[_0xe2eb('0x30')],_0x576aa9[_0xe2eb('0x33')]);_0x4ddbe8[_0xe2eb('0x37')]=_[_0xe2eb('0x36')](_0x576aa9['model'],qs[_0xe2eb('0x38')](_0x2acc2c[_0xe2eb('0x33')][_0xe2eb('0x38')]));_0x4ddbe8['attributes']=_0x4ddbe8[_0xe2eb('0x37')][_0xe2eb('0x39')]?_0x4ddbe8[_0xe2eb('0x37')]:_0x576aa9[_0xe2eb('0x30')];if(_0x2acc2c[_0xe2eb('0x33')][_0xe2eb('0x41')]){_0x4ddbe8['include']=[{'all':!![]}];}_0x4ddbe8=_[_0xe2eb('0x3f')]({},_0x4ddbe8,_0x2acc2c[_0xe2eb('0x47')]);return db[_0xe2eb('0x2d')]['find'](_0x4ddbe8)['then'](handleEntityNotFound(_0x35ca38,null))['then'](respondWithResult(_0x35ca38,null))['catch'](handleError(_0x35ca38,null));};exports[_0xe2eb('0x48')]=function(_0x47f53b,_0x2ab3cd){return db[_0xe2eb('0x2d')][_0xe2eb('0x48')](_0x47f53b['body'],{})[_0xe2eb('0x25')](function(_0x583eb4){var _0x4b5134=_0x47f53b[_0xe2eb('0x49')]['get']({'plain':!![]});if(!_0x4b5134)throw new Error(_0xe2eb('0x4a'));if(_0x4b5134['role']===_0xe2eb('0x49')){var _0x50b166=_0x583eb4[_0xe2eb('0x27')]({'plain':!![]});var _0x1124ef=_0xe2eb('0x4b');return db['UserProfileSection'][_0xe2eb('0x4c')]({'where':{'name':_0x1124ef,'userProfileId':_0x4b5134['userProfileId']},'raw':!![]})[_0xe2eb('0x25')](function(_0x571ceb){if(_0x571ceb&&_0x571ceb['autoAssociation']===0x0){return db[_0xe2eb('0x29')][_0xe2eb('0x48')]({'name':_0x50b166['name'],'resourceId':_0x50b166['id'],'type':'CustomReports','sectionId':_0x571ceb['id']},{})['then'](function(){return _0x583eb4;});}else{return _0x583eb4;}})['catch'](function(_0x3f4cd5){logger[_0xe2eb('0x2a')](_0xe2eb('0x4d'),_0x3f4cd5);throw _0x3f4cd5;});}return _0x583eb4;})[_0xe2eb('0x25')](respondWithResult(_0x2ab3cd,0xc9))['catch'](handleError(_0x2ab3cd,null));};exports[_0xe2eb('0x24')]=function(_0x5b617b,_0x276e01){if(_0x5b617b[_0xe2eb('0x4e')]['id']){delete _0x5b617b[_0xe2eb('0x4e')]['id'];}return db[_0xe2eb('0x2d')][_0xe2eb('0x4c')]({'where':{'id':_0x5b617b[_0xe2eb('0x45')]['id']}})[_0xe2eb('0x25')](handleEntityNotFound(_0x276e01,null))[_0xe2eb('0x25')](saveUpdates(_0x5b617b[_0xe2eb('0x4e')],null))['then'](respondWithResult(_0x276e01,null))['catch'](handleError(_0x276e01,null));};exports[_0xe2eb('0x26')]=function(_0xc0f75a,_0xa3362e){return db[_0xe2eb('0x2d')][_0xe2eb('0x4c')]({'where':{'id':_0xc0f75a[_0xe2eb('0x45')]['id']}})['then'](handleEntityNotFound(_0xa3362e,null))[_0xe2eb('0x25')](removeEntity(_0xa3362e,null))[_0xe2eb('0x44')](handleError(_0xa3362e,null));};exports[_0xe2eb('0x4f')]=function(_0x4ba02f,_0x59722f){var _0x12b9ef=0xa;var _0x18a1b5=['join',_0xe2eb('0x50'),_0xe2eb('0x51'),'cross_join'];var _0x2ed5d1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe2eb('0x52'),'MAX':_0xe2eb('0x53'),'MIN':'MIN(%s)','AVG':_0xe2eb('0x54'),'GROUP_CONCAT':_0xe2eb('0x55'),'GROUP_CONCAT ASC':_0xe2eb('0x56'),'GROUP_CONCAT DESC':_0xe2eb('0x57')};var _0x3c6fec={'SEC_TO_TIME':_0xe2eb('0x58'),'DATE':_0xe2eb('0x59'),'HOUR':_0xe2eb('0x5a'),'ROUND':_0xe2eb('0x5b'),'UNIX_TIMESTAMP':_0xe2eb('0x5c')};var _0x1ec027=function(_0x310690){return!_[_0xe2eb('0x5d')](['IS\x20NULL',_0xe2eb('0x5e'),'IS\x20EMPTY',_0xe2eb('0x5f')],_0x310690);};var _0x20403b=function(_0x404842){if(!_0x404842||!_0x404842['rules'][_0xe2eb('0x39')]){return'';}for(var _0x33906a='(',_0x29a2ca=0x0;_0x29a2ca<_0x404842[_0xe2eb('0x60')][_0xe2eb('0x39')];_0x29a2ca+=0x1){_0x29a2ca>0x0&&(_0x33906a+='\x20'+_0x404842['operator']+'\x20');_0x33906a+=_0x404842['rules'][_0x29a2ca][_0xe2eb('0x61')]?_0x20403b(_0x404842[_0xe2eb('0x60')][_0x29a2ca]['group']):_0x404842[_0xe2eb('0x60')][_0x29a2ca]['field']+'\x20'+_0x404842['rules'][_0x29a2ca]['condition']+(_0x1ec027(_0x404842[_0xe2eb('0x60')][_0x29a2ca][_0xe2eb('0x62')])?'\x20'+_0x404842[_0xe2eb('0x60')][_0x29a2ca]['value']:'');}return _0x33906a+')';};var _0x347a5f={'where':{'id':_0x4ba02f[_0xe2eb('0x45')]['id']}},_0x4db650,_0x1c5bad,_0x434af2,_0x2cdc5b,_0x3c8418;_0x347a5f=_[_0xe2eb('0x3f')]({},_0x347a5f,_0x4ba02f[_0xe2eb('0x47')]);return db['AnalyticCustomReport']['find'](_0x347a5f)[_0xe2eb('0x25')](function(_0x47985b){if(_0x47985b){_0x4db650=_0x47985b;return _0x47985b['getFields']();}return null;})[_0xe2eb('0x25')](function(_0x3493f4){if(_0x3493f4){if(!_0x3493f4[_0xe2eb('0x39')]){throw new db[(_0xe2eb('0x63'))]['ValidationErrorItem'](_0xe2eb('0x64'),0x193);}_0x1c5bad=_0x3493f4;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xe2eb('0x25')](function(_0x250641){if(_0x250641){_0x434af2=_['keyBy'](_0x250641,'id');var _0x4d3953;var _0x553aa2=squel['select']();_0x553aa2[_0xe2eb('0x65')](_0x4db650[_0xe2eb('0x66')]);for(var _0x4bf325=0x0;_0x4bf325<_0x1c5bad[_0xe2eb('0x39')];_0x4bf325+=0x1){_0x4d3953=_0x1c5bad[_0x4bf325][_0xe2eb('0x67')]?_0x434af2[_0x1c5bad[_0x4bf325]['MetricId']][_0xe2eb('0x68')]:_0x1c5bad[_0x4bf325][_0xe2eb('0x69')];_0x4d3953=_0x1c5bad[_0x4bf325]['function']?_[_0xe2eb('0x6a')](_0x2ed5d1[_0x1c5bad[_0x4bf325][_0xe2eb('0x6b')]],'%s',_0x4d3953):_0x4d3953;_0x4d3953=_0x1c5bad[_0x4bf325]['format']?_[_0xe2eb('0x6a')](_0x3c6fec[_0x1c5bad[_0x4bf325][_0xe2eb('0x6c')]],'%s',_0x4d3953):_0x4d3953;if(_0x1c5bad[_0x4bf325]['groupBy']){_0x553aa2[_0xe2eb('0x61')](_0x4d3953);}_0x1c5bad[_0x4bf325][_0xe2eb('0x6d')]&&_0x553aa2[_0xe2eb('0x3c')](_0x4d3953,_0x1c5bad[_0x4bf325]['orderBy']===_0xe2eb('0x6e')?![]:!![]);_0x553aa2['field'](_0x4d3953,_0x1c5bad[_0x4bf325]['alias']||_0x4d3953);}if(_0x4db650[_0xe2eb('0x6f')]){_0x4db650['joins']=JSON[_0xe2eb('0x70')](_0x4db650[_0xe2eb('0x6f')]);for(var _0x56c4a5=0x0;_0x56c4a5<_0x4db650[_0xe2eb('0x6f')][_0xe2eb('0x39')];_0x56c4a5+=0x1){if(_0x4db650['joins'][_0x56c4a5][_0xe2eb('0x2e')]&&_['includes'](_0x18a1b5,_0x4db650[_0xe2eb('0x6f')][_0x56c4a5][_0xe2eb('0x2e')])&&_0x4db650[_0xe2eb('0x6f')][_0x56c4a5]['parentKey']&&_0x4db650[_0xe2eb('0x6f')][_0x56c4a5][_0xe2eb('0x71')]&&_0x4db650[_0xe2eb('0x6f')][_0x56c4a5][_0xe2eb('0x72')]){_0x553aa2[_0x4db650[_0xe2eb('0x6f')][_0x56c4a5]['type']](_0x4db650['joins'][_0x56c4a5]['foreignTable'],null,util[_0xe2eb('0x6c')](_0xe2eb('0x73'),_0x4db650['table'],_0x4db650[_0xe2eb('0x6f')][_0x56c4a5]['parentKey'],_0x4db650[_0xe2eb('0x6f')][_0x56c4a5][_0xe2eb('0x71')],_0x4db650[_0xe2eb('0x6f')][_0x56c4a5]['foreignKey']));}}}if(_0x4db650[_0xe2eb('0x74')]){_0x4db650[_0xe2eb('0x74')]=JSON[_0xe2eb('0x70')](_0x4db650[_0xe2eb('0x74')]);_0x553aa2[_0xe2eb('0x3d')](_0x20403b(_0x4db650[_0xe2eb('0x74')][_0xe2eb('0x61')]));}_0x3c8418=_0x553aa2['clone']();_0x553aa2[_0xe2eb('0x1d')](_0x12b9ef);_0x553aa2['offset'](0x0);logger[_0xe2eb('0x75')]('Limited\x20Query:',_0x553aa2['toString']());return dbH[_0xe2eb('0x76')]['query'](_0x553aa2[_0xe2eb('0x77')](),{'type':dbH[_0xe2eb('0x76')][_0xe2eb('0x78')][_0xe2eb('0x79')]});}})['then'](respondWithResult(_0x59722f,null))['catch'](handleError(_0x59722f,null));};function runReport(_0x2baf30,_0x55c568,_0xe4ffe3){var _0x5707ec=_0x55c568[_0xe2eb('0x32')];var _0x2a123e=0xa;var _0x220792=[_0xe2eb('0x7a'),_0xe2eb('0x50'),_0xe2eb('0x51'),'cross_join'];var _0x1ba03d={'SUM':'SUM(%s)','COUNT':_0xe2eb('0x7b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xe2eb('0x54'),'GROUP_CONCAT':_0xe2eb('0x55'),'GROUP_CONCAT ASC':_0xe2eb('0x56'),'GROUP_CONCAT DESC':_0xe2eb('0x57')};var _0x1d3dfc={'SEC_TO_TIME':_0xe2eb('0x58'),'DATE':_0xe2eb('0x59'),'HOUR':_0xe2eb('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe2eb('0x5c')};var _0x422fc3=function(_0x4a3677){return!_[_0xe2eb('0x5d')]([_0xe2eb('0x7c'),_0xe2eb('0x5e'),_0xe2eb('0x7d'),_0xe2eb('0x5f')],_0x4a3677);};var _0x1a86bd=function(_0x340100){if(!_0x340100||!_0x340100[_0xe2eb('0x60')]['length']){return'';}for(var _0x5c5f09='(',_0x2b16bb=0x0;_0x2b16bb<_0x340100[_0xe2eb('0x60')][_0xe2eb('0x39')];_0x2b16bb+=0x1){_0x2b16bb>0x0&&(_0x5c5f09+='\x20'+_0x340100[_0xe2eb('0x7e')]+'\x20');_0x5c5f09+=_0x340100[_0xe2eb('0x60')][_0x2b16bb]['group']?_0x1a86bd(_0x340100[_0xe2eb('0x60')][_0x2b16bb][_0xe2eb('0x61')]):_0x340100[_0xe2eb('0x60')][_0x2b16bb][_0xe2eb('0x69')]+'\x20'+_0x340100[_0xe2eb('0x60')][_0x2b16bb][_0xe2eb('0x62')]+(_0x422fc3(_0x340100[_0xe2eb('0x60')][_0x2b16bb][_0xe2eb('0x62')])?'\x20'+_0x340100[_0xe2eb('0x60')][_0x2b16bb][_0xe2eb('0x7f')]:'');}return _0x5c5f09+')';};var _0x16825a={'where':{'id':_0x2baf30['id']}},_0x39064d,_0xc58a1e,_0x3625d,_0x3a3ba2,_0x4fd537;_0x16825a=_[_0xe2eb('0x3f')]({},_0x16825a,_0xe4ffe3);return db[_0xe2eb('0x2d')][_0xe2eb('0x4c')](_0x16825a)[_0xe2eb('0x25')](function(_0x15698c){if(_0x15698c){_0x39064d=_0x15698c;return _0x15698c[_0xe2eb('0x80')]();}return null;})[_0xe2eb('0x25')](function(_0x42cbdb){if(_0x42cbdb){if(!_0x42cbdb[_0xe2eb('0x39')]){throw new db[(_0xe2eb('0x63'))][(_0xe2eb('0x81'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xc58a1e=_0x42cbdb;return db[_0xe2eb('0x82')][_0xe2eb('0x43')]({'raw':!![]});}return null;})[_0xe2eb('0x25')](function(_0x51db93){if(_0x51db93){_0x3625d=_[_0xe2eb('0x83')](_0x51db93,'id');var _0x233951;var _0x2ff978=squel[_0xe2eb('0x84')]();_0x2ff978[_0xe2eb('0x65')](_0x39064d[_0xe2eb('0x66')]);for(var _0x539282=0x0;_0x539282<_0xc58a1e[_0xe2eb('0x39')];_0x539282+=0x1){_0x233951=_0xc58a1e[_0x539282][_0xe2eb('0x67')]?_0x3625d[_0xc58a1e[_0x539282][_0xe2eb('0x67')]][_0xe2eb('0x68')]:_0xc58a1e[_0x539282]['field'];_0x233951=_0xc58a1e[_0x539282]['function']?_[_0xe2eb('0x6a')](_0x1ba03d[_0xc58a1e[_0x539282]['function']],'%s',_0x233951):_0x233951;_0x233951=_0xc58a1e[_0x539282][_0xe2eb('0x6c')]?_[_0xe2eb('0x6a')](_0x1d3dfc[_0xc58a1e[_0x539282][_0xe2eb('0x6c')]],'%s',_0x233951):_0x233951;if(_0xc58a1e[_0x539282][_0xe2eb('0x85')]){_0x2ff978[_0xe2eb('0x61')](_0x233951);}_0xc58a1e[_0x539282][_0xe2eb('0x6d')]&&_0x2ff978[_0xe2eb('0x3c')](_0x233951,_0xc58a1e[_0x539282][_0xe2eb('0x6d')]===_0xe2eb('0x6e')?![]:!![]);_0x2ff978['field'](_0x233951,_0xc58a1e[_0x539282][_0xe2eb('0x86')]||_0x233951);}if(_0x39064d[_0xe2eb('0x6f')]){_0x39064d[_0xe2eb('0x6f')]=JSON['parse'](_0x39064d['joins']);for(var _0x2ff024=0x0;_0x2ff024<_0x39064d[_0xe2eb('0x6f')]['length'];_0x2ff024+=0x1){if(_0x39064d['joins'][_0x2ff024]['type']&&_[_0xe2eb('0x5d')](_0x220792,_0x39064d[_0xe2eb('0x6f')][_0x2ff024][_0xe2eb('0x2e')])&&_0x39064d['joins'][_0x2ff024][_0xe2eb('0x87')]&&_0x39064d[_0xe2eb('0x6f')][_0x2ff024][_0xe2eb('0x71')]&&_0x39064d[_0xe2eb('0x6f')][_0x2ff024][_0xe2eb('0x72')]){_0x2ff978[_0x39064d[_0xe2eb('0x6f')][_0x2ff024][_0xe2eb('0x2e')]](_0x39064d[_0xe2eb('0x6f')][_0x2ff024][_0xe2eb('0x71')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x39064d[_0xe2eb('0x66')],_0x39064d['joins'][_0x2ff024][_0xe2eb('0x87')],_0x39064d[_0xe2eb('0x6f')][_0x2ff024][_0xe2eb('0x71')],_0x39064d[_0xe2eb('0x6f')][_0x2ff024][_0xe2eb('0x72')]));}}}if(_0x39064d[_0xe2eb('0x74')]){_0x39064d[_0xe2eb('0x74')]=JSON['parse'](_0x39064d['conditions']);_0x2ff978[_0xe2eb('0x3d')](_0x1a86bd(_0x39064d[_0xe2eb('0x74')][_0xe2eb('0x61')]));}_0x4fd537=_0x2ff978['clone']();_0x2ff978[_0xe2eb('0x1d')](_0x2a123e);_0x2ff978[_0xe2eb('0x20')](0x0);return;}})[_0xe2eb('0x25')](function(){if(_0x55c568['output']==='web'){return null;}var _0x2aef47=_[_0xe2eb('0x3f')](_0x55c568,{'name':_0x55c568[_0xe2eb('0x88')]||_0x55c568['name']||_0x39064d[_0xe2eb('0x32')],'basename':_0x5707ec,'savename':util['format'](_0xe2eb('0x89'),_0x55c568[_0xe2eb('0x32')]||_0x39064d[_0xe2eb('0x32')],require(_0xe2eb('0x8a'))['generate'](0x4),_0x55c568[_0xe2eb('0x8b')]||'csv'),'reportId':_0x39064d['id'],'reportType':_0xe2eb('0x8c')});return db[_0xe2eb('0x8d')][_0xe2eb('0x48')](_0x2aef47,{'raw':!![]});})[_0xe2eb('0x25')](function(_0x3dc205){if(_0x39064d['table']==='cdr'){_0x4fd537['where'](_0x39064d[_0xe2eb('0x66')]+_0xe2eb('0x8e'),_0x55c568[_0xe2eb('0x8f')],_0x55c568['endDate']);}else{_0x4fd537[_0xe2eb('0x3d')](_0x39064d['table']+_0xe2eb('0x90'),_0x55c568[_0xe2eb('0x8f')],_0x55c568[_0xe2eb('0x91')]);}if(_0x3dc205){logger[_0xe2eb('0x92')](_0xe2eb('0x93'),_0x4fd537[_0xe2eb('0x77')]());require(_0xe2eb('0x94'))[_0xe2eb('0x95')](path[_0xe2eb('0x7a')](__dirname,'../../components/export/',_0x3dc205['output']),[_0x3dc205['id'],_0x4fd537[_0xe2eb('0x77')](),path[_0xe2eb('0x7a')](__dirname,_0xe2eb('0x96'),_0x3dc205[_0xe2eb('0x97')]),_0x5707ec]);return _0x3dc205;}else{var _0x1a5ea4=squel[_0xe2eb('0x84')]();_0x1a5ea4['from']('('+_0x4fd537[_0xe2eb('0x77')]()+')',_0xe2eb('0x98'));_0x1a5ea4[_0xe2eb('0x69')](_0xe2eb('0x99'),_0xe2eb('0x1f'));_0x4fd537[_0xe2eb('0x1d')](_0x55c568[_0xe2eb('0x1d')]||_0x2a123e);_0x4fd537[_0xe2eb('0x20')](_0x55c568['offset']||0x0);return dbH[_0xe2eb('0x76')][_0xe2eb('0x33')](_0x1a5ea4['toString'](),{'type':dbH[_0xe2eb('0x76')][_0xe2eb('0x78')][_0xe2eb('0x79')]})['then'](function(_0x557c89){if(!_0x557c89[_0xe2eb('0x39')]){_0x3a3ba2=0x0;}else{_0x3a3ba2=_0x557c89[0x0][_0xe2eb('0x1f')]||0x0;}return dbH[_0xe2eb('0x76')][_0xe2eb('0x33')](_0x4fd537[_0xe2eb('0x77')](),{'type':dbH[_0xe2eb('0x76')][_0xe2eb('0x78')][_0xe2eb('0x79')]});})['then'](function(_0x6ff323){return{'rows':_0x6ff323||[],'count':_0x3a3ba2};});}});}exports['run']=function(_0x41832d,_0x4e795f){return runReport(_0x41832d[_0xe2eb('0x45')],_0x41832d[_0xe2eb('0x33')],_0x41832d[_0xe2eb('0x47')])[_0xe2eb('0x25')](respondWithResult(_0x4e795f,null))['catch'](handleError(_0x4e795f,null));};exports[_0xe2eb('0x9a')]=runReport;exports[_0xe2eb('0x33')]=function(_0x3925a9,_0x5b9e06){var _0x452024=0xa;var _0x510291=[_0xe2eb('0x7a'),_0xe2eb('0x50'),_0xe2eb('0x51'),_0xe2eb('0x9b')];var _0xe01e86={'SUM':'SUM(%s)','COUNT':_0xe2eb('0x7b'),'COUNT DISTINCT':_0xe2eb('0x52'),'MAX':_0xe2eb('0x53'),'MIN':_0xe2eb('0x9c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xe2eb('0x55'),'GROUP_CONCAT ASC':_0xe2eb('0x56'),'GROUP_CONCAT DESC':_0xe2eb('0x57')};var _0xd7bb8f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe2eb('0x59'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe2eb('0x5c')};var _0x41f152=function(_0x2afe9f){return!_[_0xe2eb('0x5d')](['IS\x20NULL',_0xe2eb('0x5e'),'IS\x20EMPTY',_0xe2eb('0x5f')],_0x2afe9f);};var _0xb876ee=function(_0x5750e8){if(!_0x5750e8||!_0x5750e8[_0xe2eb('0x60')]['length']){return'';}for(var _0x142ad1='(',_0x502348=0x0;_0x502348<_0x5750e8['rules'][_0xe2eb('0x39')];_0x502348+=0x1){_0x502348>0x0&&(_0x142ad1+='\x20'+_0x5750e8[_0xe2eb('0x7e')]+'\x20');_0x142ad1+=_0x5750e8[_0xe2eb('0x60')][_0x502348]['group']?_0xb876ee(_0x5750e8[_0xe2eb('0x60')][_0x502348][_0xe2eb('0x61')]):_0x5750e8[_0xe2eb('0x60')][_0x502348][_0xe2eb('0x69')]+'\x20'+_0x5750e8['rules'][_0x502348]['condition']+(_0x41f152(_0x5750e8[_0xe2eb('0x60')][_0x502348]['condition'])?'\x20'+_0x5750e8[_0xe2eb('0x60')][_0x502348][_0xe2eb('0x7f')]:'');}return _0x142ad1+')';};var _0x12576a={'where':{'id':_0x3925a9[_0xe2eb('0x45')]['id']}},_0x38ab7b,_0x4f7fd6,_0x267b9f,_0x5920bc,_0x1aba10;_0x12576a=_[_0xe2eb('0x3f')]({},_0x12576a,_0x3925a9[_0xe2eb('0x47')]);return db[_0xe2eb('0x2d')][_0xe2eb('0x4c')](_0x12576a)[_0xe2eb('0x25')](function(_0x3d8e26){if(_0x3d8e26){_0x38ab7b=_0x3d8e26;return _0x3d8e26['getFields']();}return null;})[_0xe2eb('0x25')](function(_0x4a1d4c){if(_0x4a1d4c){if(!_0x4a1d4c[_0xe2eb('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0xe2eb('0x64'),0x193);}_0x4f7fd6=_0x4a1d4c;return db[_0xe2eb('0x82')][_0xe2eb('0x43')]({'raw':!![]});}return null;})['then'](function(_0x5c6601){if(_0x5c6601){_0x267b9f=_[_0xe2eb('0x83')](_0x5c6601,'id');var _0x390b74;var _0x14d44b=squel['select']();_0x14d44b[_0xe2eb('0x65')](_0x38ab7b[_0xe2eb('0x66')]);for(var _0x1454ea=0x0;_0x1454ea<_0x4f7fd6[_0xe2eb('0x39')];_0x1454ea+=0x1){_0x390b74=_0x4f7fd6[_0x1454ea][_0xe2eb('0x67')]?_0x267b9f[_0x4f7fd6[_0x1454ea][_0xe2eb('0x67')]]['metric']:_0x4f7fd6[_0x1454ea][_0xe2eb('0x69')];_0x390b74=_0x4f7fd6[_0x1454ea]['function']?_['replace'](_0xe01e86[_0x4f7fd6[_0x1454ea][_0xe2eb('0x6b')]],'%s',_0x390b74):_0x390b74;_0x390b74=_0x4f7fd6[_0x1454ea]['format']?_[_0xe2eb('0x6a')](_0xd7bb8f[_0x4f7fd6[_0x1454ea][_0xe2eb('0x6c')]],'%s',_0x390b74):_0x390b74;if(_0x4f7fd6[_0x1454ea][_0xe2eb('0x85')]){_0x14d44b['group'](_0x390b74);}_0x4f7fd6[_0x1454ea]['orderBy']&&_0x14d44b[_0xe2eb('0x3c')](_0x390b74,_0x4f7fd6[_0x1454ea][_0xe2eb('0x6d')]===_0xe2eb('0x6e')?![]:!![]);_0x14d44b['field'](_0x390b74,_0x4f7fd6[_0x1454ea][_0xe2eb('0x86')]||_0x390b74);}if(_0x38ab7b[_0xe2eb('0x6f')]){_0x38ab7b[_0xe2eb('0x6f')]=JSON[_0xe2eb('0x70')](_0x38ab7b['joins']);for(var _0x3e047c=0x0;_0x3e047c<_0x38ab7b[_0xe2eb('0x6f')][_0xe2eb('0x39')];_0x3e047c+=0x1){if(_0x38ab7b[_0xe2eb('0x6f')][_0x3e047c][_0xe2eb('0x2e')]&&_[_0xe2eb('0x5d')](_0x510291,_0x38ab7b['joins'][_0x3e047c]['type'])&&_0x38ab7b[_0xe2eb('0x6f')][_0x3e047c]['parentKey']&&_0x38ab7b['joins'][_0x3e047c]['foreignTable']&&_0x38ab7b[_0xe2eb('0x6f')][_0x3e047c]['foreignKey']){_0x14d44b[_0x38ab7b['joins'][_0x3e047c][_0xe2eb('0x2e')]](_0x38ab7b[_0xe2eb('0x6f')][_0x3e047c][_0xe2eb('0x71')],null,util[_0xe2eb('0x6c')](_0xe2eb('0x73'),_0x38ab7b['table'],_0x38ab7b[_0xe2eb('0x6f')][_0x3e047c][_0xe2eb('0x87')],_0x38ab7b['joins'][_0x3e047c][_0xe2eb('0x71')],_0x38ab7b[_0xe2eb('0x6f')][_0x3e047c]['foreignKey']));}}}if(_0x38ab7b[_0xe2eb('0x74')]){_0x38ab7b[_0xe2eb('0x74')]=JSON['parse'](_0x38ab7b[_0xe2eb('0x74')]);_0x14d44b['where'](_0xb876ee(_0x38ab7b['conditions'][_0xe2eb('0x61')]));}_0x1aba10=_0x14d44b['clone']();_0x14d44b[_0xe2eb('0x1d')](_0x452024);_0x14d44b[_0xe2eb('0x20')](0x0);logger[_0xe2eb('0x75')](_0xe2eb('0x9d'),_0x14d44b[_0xe2eb('0x77')]());return dbH['sequelize']['query'](_0x14d44b[_0xe2eb('0x77')](),{'type':dbH[_0xe2eb('0x76')][_0xe2eb('0x78')][_0xe2eb('0x79')]});}})['then'](function(){return{'sql':_0x1aba10['toString']()};})[_0xe2eb('0x25')](respondWithResult(_0x5b9e06,null))[_0xe2eb('0x44')](handleError(_0x5b9e06,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 07a74f8..db67ef8 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 _0xa131=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3053b7,_0x5761ae){var _0x582a6c=function(_0x32e1eb){while(--_0x32e1eb){_0x3053b7['push'](_0x3053b7['shift']());}};_0x582a6c(++_0x5761ae);}(_0xa131,0x14c));var _0x1a13=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa131[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x1a13('0x0'));var util=require(_0x1a13('0x1'));var logger=require(_0x1a13('0x2'))(_0x1a13('0x3'));var moment=require(_0x1a13('0x4'));var BPromise=require(_0x1a13('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a13('0x6'));var rimraf=require(_0x1a13('0x7'));var config=require(_0x1a13('0x8'));var attributes=require(_0x1a13('0x9'));module[_0x1a13('0xa')]=function(_0x2c340f,_0x34ef9d){return _0x2c340f['define'](_0x1a13('0xb'),attributes,{'tableName':_0x1a13('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5123=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','moment','bluebird'];(function(_0x178339,_0x549a4){var _0x2977eb=function(_0x4672a5){while(--_0x4672a5){_0x178339['push'](_0x178339['shift']());}};_0x2977eb(++_0x549a4);}(_0x5123,0x146));var _0x3512=function(_0x50a79d,_0x160ca3){_0x50a79d=_0x50a79d-0x0;var _0x14ab37=_0x5123[_0x50a79d];return _0x14ab37;};'use strict';var _=require(_0x3512('0x0'));var util=require(_0x3512('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3512('0x2'));var BPromise=require(_0x3512('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3512('0x4'));var config=require(_0x3512('0x5'));var attributes=require(_0x3512('0x6'));module[_0x3512('0x7')]=function(_0x196265,_0x132592){return _0x196265[_0x3512('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0x3512('0x9'),'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 e7c0aa3..0f9f63c 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 _0x2931=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','bluebird','randomstring'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2931,0xb1));var _0x1293=function(_0x84ef38,_0x580f5a){_0x84ef38=_0x84ef38-0x0;var _0x4c7599=_0x2931[_0x84ef38];return _0x4c7599;};'use strict';var _=require(_0x1293('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1293('0x1'));var rs=require(_0x1293('0x2'));var fs=require('fs');var Redis=require(_0x1293('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1293('0x4'));var logger=require(_0x1293('0x5'))(_0x1293('0x6'));var config=require(_0x1293('0x7'));var jayson=require(_0x1293('0x8'));var client=jayson['client'][_0x1293('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ffafd,_0x274a18,_0x1c614b){return new BPromise(function(_0x26602a,_0x253c01){return client[_0x1293('0xa')](_0x3ffafd,_0x1c614b)[_0x1293('0xb')](function(_0x28d2e6){logger[_0x1293('0xc')](_0x1293('0xd'),_0x274a18,_0x1293('0xe'));logger[_0x1293('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x274a18,'request\x20sent',JSON['stringify'](_0x28d2e6));if(_0x28d2e6['error']){if(_0x28d2e6[_0x1293('0x10')][_0x1293('0x11')]===0x1f4){logger[_0x1293('0x10')](_0x1293('0xd'),_0x274a18,_0x28d2e6[_0x1293('0x10')][_0x1293('0x12')]);return _0x253c01(_0x28d2e6[_0x1293('0x10')]['message']);}logger[_0x1293('0x10')](_0x1293('0xd'),_0x274a18,_0x28d2e6[_0x1293('0x10')][_0x1293('0x12')]);return _0x26602a(_0x28d2e6['error'][_0x1293('0x12')]);}else{logger[_0x1293('0xc')](_0x1293('0xd'),_0x274a18,_0x1293('0xe'));_0x26602a(_0x28d2e6['result'][_0x1293('0x12')]);}})[_0x1293('0x13')](function(_0x44f627){logger[_0x1293('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x274a18,_0x44f627);_0x253c01(_0x44f627);});});} \ No newline at end of file +var _0x9dd9=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0xa0e660,_0x3f509f){var _0x200304=function(_0x56aa0c){while(--_0x56aa0c){_0xa0e660['push'](_0xa0e660['shift']());}};_0x200304(++_0x3f509f);}(_0x9dd9,0xe7));var _0x99dd=function(_0x302fe6,_0x342afc){_0x302fe6=_0x302fe6-0x0;var _0x4da79b=_0x9dd9[_0x302fe6];return _0x4da79b;};'use strict';var _=require(_0x99dd('0x0'));var util=require(_0x99dd('0x1'));var moment=require(_0x99dd('0x2'));var BPromise=require(_0x99dd('0x3'));var rs=require(_0x99dd('0x4'));var fs=require('fs');var Redis=require(_0x99dd('0x5'));var db=require(_0x99dd('0x6'))['db'];var utils=require(_0x99dd('0x7'));var logger=require(_0x99dd('0x8'))('rpc');var config=require(_0x99dd('0x9'));var jayson=require(_0x99dd('0xa'));var client=jayson[_0x99dd('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x368213,_0x3c7481,_0x6554c){return new BPromise(function(_0x386694,_0x37e8c6){return client[_0x99dd('0xc')](_0x368213,_0x6554c)[_0x99dd('0xd')](function(_0x4f26f2){logger[_0x99dd('0xe')](_0x99dd('0xf'),_0x3c7481,_0x99dd('0x10'));logger[_0x99dd('0x11')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x3c7481,'request\x20sent',JSON[_0x99dd('0x12')](_0x4f26f2));if(_0x4f26f2['error']){if(_0x4f26f2[_0x99dd('0x13')]['code']===0x1f4){logger[_0x99dd('0x13')](_0x99dd('0xf'),_0x3c7481,_0x4f26f2['error']['message']);return _0x37e8c6(_0x4f26f2[_0x99dd('0x13')][_0x99dd('0x14')]);}logger[_0x99dd('0x13')](_0x99dd('0xf'),_0x3c7481,_0x4f26f2[_0x99dd('0x13')][_0x99dd('0x14')]);return _0x386694(_0x4f26f2[_0x99dd('0x13')]['message']);}else{logger['info'](_0x99dd('0xf'),_0x3c7481,_0x99dd('0x10'));_0x386694(_0x4f26f2[_0x99dd('0x15')][_0x99dd('0x14')]);}})[_0x99dd('0x16')](function(_0x4474be){logger[_0x99dd('0x13')](_0x99dd('0xf'),_0x3c7481,_0x4474be);_0x37e8c6(_0x4474be);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 0620bad..1c49cef 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 _0xe59e=['fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','preview','/:id/run','/:id/query','query','create','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x31df6f,_0x380e73){var _0x31e353=function(_0x3a434b){while(--_0x3a434b){_0x31df6f['push'](_0x31df6f['shift']());}};_0x31e353(++_0x380e73);}(_0xe59e,0x122));var _0xee59=function(_0xe9f47d,_0x44be4a){_0xe9f47d=_0xe9f47d-0x0;var _0xf105dc=_0xe59e[_0xe9f47d];return _0xf105dc;};'use strict';var multer=require(_0xee59('0x0'));var util=require(_0xee59('0x1'));var path=require(_0xee59('0x2'));var timeout=require(_0xee59('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xee59('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xee59('0x5'));var config=require(_0xee59('0x6'));var controller=require(_0xee59('0x7'));router[_0xee59('0x8')]('/',auth['isAuthenticated'](),controller[_0xee59('0x9')]);router['get'](_0xee59('0xa'),auth[_0xee59('0xb')](),controller[_0xee59('0xc')]);router['get']('/:id/preview',auth[_0xee59('0xb')](),controller[_0xee59('0xd')]);router[_0xee59('0x8')](_0xee59('0xe'),auth[_0xee59('0xb')](),controller['run']);router[_0xee59('0x8')](_0xee59('0xf'),auth[_0xee59('0xb')](),controller[_0xee59('0x10')]);router['post']('/',auth[_0xee59('0xb')](),controller[_0xee59('0x11')]);router[_0xee59('0x12')](_0xee59('0xa'),auth[_0xee59('0xb')](),controller['update']);router['delete'](_0xee59('0xa'),auth['isAuthenticated'](),controller[_0xee59('0x13')]);module[_0xee59('0x14')]=router; \ No newline at end of file +var _0x8a30=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','util','path','express','fs-extra'];(function(_0x1d77b2,_0x3d03e4){var _0x3c3341=function(_0x1f1238){while(--_0x1f1238){_0x1d77b2['push'](_0x1d77b2['shift']());}};_0x3c3341(++_0x3d03e4);}(_0x8a30,0x1a5));var _0x08a3=function(_0x2f747f,_0x9e1ac9){_0x2f747f=_0x2f747f-0x0;var _0x945cc1=_0x8a30[_0x2f747f];return _0x945cc1;};'use strict';var multer=require('multer');var util=require(_0x08a3('0x0'));var path=require(_0x08a3('0x1'));var timeout=require('connect-timeout');var express=require(_0x08a3('0x2'));var router=express['Router']();var fs_extra=require(_0x08a3('0x3'));var auth=require(_0x08a3('0x4'));var interaction=require(_0x08a3('0x5'));var config=require(_0x08a3('0x6'));var controller=require('./analyticCustomReport.controller');router[_0x08a3('0x7')]('/',auth[_0x08a3('0x8')](),controller[_0x08a3('0x9')]);router['get'](_0x08a3('0xa'),auth['isAuthenticated'](),controller[_0x08a3('0xb')]);router['get'](_0x08a3('0xc'),auth['isAuthenticated'](),controller[_0x08a3('0xd')]);router['get'](_0x08a3('0xe'),auth[_0x08a3('0x8')](),controller[_0x08a3('0xf')]);router[_0x08a3('0x7')](_0x08a3('0x10'),auth[_0x08a3('0x8')](),controller[_0x08a3('0x11')]);router[_0x08a3('0x12')]('/',auth['isAuthenticated'](),controller[_0x08a3('0x13')]);router[_0x08a3('0x14')](_0x08a3('0xa'),auth['isAuthenticated'](),controller[_0x08a3('0x15')]);router[_0x08a3('0x16')]('/:id',auth[_0x08a3('0x8')](),controller[_0x08a3('0x17')]);module[_0x08a3('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index d714c03..b581e0d 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 _0x7fbe=['STRING','TEXT'];(function(_0x44ff3a,_0x46f40d){var _0x333bc1=function(_0x1114aa){while(--_0x1114aa){_0x44ff3a['push'](_0x44ff3a['shift']());}};_0x333bc1(++_0x46f40d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5c52a3,_0x13c8d5){_0x5c52a3=_0x5c52a3-0x0;var _0x5537b9=_0x7fbe[_0x5c52a3];return _0x5537b9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}}; \ No newline at end of file +var _0xda19=['exports','STRING','TEXT'];(function(_0x373fea,_0x3ee443){var _0x46da5c=function(_0x157ba7){while(--_0x157ba7){_0x373fea['push'](_0x373fea['shift']());}};_0x46da5c(++_0x3ee443);}(_0xda19,0xd5));var _0x9da1=function(_0x1abc06,_0x54a3db){_0x1abc06=_0x1abc06-0x0;var _0x44890c=_0xda19[_0x1abc06];return _0x44890c;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 5a2108a..b7fc30e 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 _0x524e=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s)','debug','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','toString','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','from','clone','output','web','fullPath','generate','csv','default'];(function(_0x1fab97,_0x12706d){var _0x54529a=function(_0x395c75){while(--_0x395c75){_0x1fab97['push'](_0x1fab97['shift']());}};_0x54529a(++_0x12706d);}(_0x524e,0x15e));var _0xe524=function(_0x5be046,_0xf5bdc3){_0x5be046=_0x5be046-0x0;var _0x3d2dc3=_0x524e[_0x5be046];return _0x3d2dc3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xfdc2a5,_0x1541d8){_0x1541d8=_0x1541d8||0xcc;return function(_0x11adbc){if(_0x11adbc){return _0xfdc2a5[_0xe524('0x1c')](_0x1541d8);}return _0xfdc2a5[_0xe524('0x1d')](_0x1541d8)['end']();};}function respondWithResult(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xc8;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x1d')](_0x51e9fe)['json'](_0x19f013);}};}function respondWithFilteredResult(_0x569660,_0x488fce){return function(_0x109795){if(_0x109795){var _0x538754=typeof _0x488fce[_0xe524('0x1e')]==='undefined'&&typeof _0x488fce['limit']==='undefined';var _0x3a4027=_0x109795['count'];var _0x11b2a1=_0x538754?0x0:_0x488fce[_0xe524('0x1e')];var _0x278de9=_0x538754?_0x109795[_0xe524('0x1f')]:_0x488fce['offset']+_0x488fce[_0xe524('0x20')];var _0x3ccb3f;if(_0x278de9>=_0x3a4027){_0x278de9=_0x3a4027;_0x3ccb3f=0xc8;}else{_0x3ccb3f=0xce;}_0x569660['status'](_0x3ccb3f);return _0x569660[_0xe524('0x21')](_0xe524('0x22'),_0x11b2a1+'-'+_0x278de9+'/'+_0x3a4027)[_0xe524('0x23')](_0x109795);}return null;};}function patchUpdates(_0x1dcc0f){return function(_0x1c4194){try{jsonpatch[_0xe524('0x24')](_0x1c4194,_0x1dcc0f,!![]);}catch(_0xbf059b){return BPromise[_0xe524('0x25')](_0xbf059b);}return _0x1c4194[_0xe524('0x26')]();};}function saveUpdates(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(_0x5bb00b){return _0x5bb00b['update'](_0x5c4d21)[_0xe524('0x27')](function(_0x23df5e){return _0x23df5e;});}return null;};}function removeEntity(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x28')]()['then'](function(){var _0x17e245=_0x599d5d[_0xe524('0x29')]({'plain':!![]});var _0xd62772=_0xe524('0x2a');return db[_0xe524('0x2b')][_0xe524('0x28')]({'where':{'type':_0xd62772,'resourceId':_0x17e245['id']}})[_0xe524('0x27')](function(){return _0x599d5d;});})['then'](function(){_0x1ad106['status'](0xcc)[_0xe524('0x2c')]();});}};}function handleEntityNotFound(_0x45abad,_0x476572){return function(_0x109a96){if(!_0x109a96){_0x45abad[_0xe524('0x1c')](0x194);}return _0x109a96;};}function handleError(_0x5405e4,_0x52f140){_0x52f140=_0x52f140||0x1f4;return function(_0x4b1ff){logger[_0xe524('0x2d')](_0x4b1ff[_0xe524('0x2e')]);if(_0x4b1ff[_0xe524('0x2f')]){delete _0x4b1ff[_0xe524('0x2f')];}_0x5405e4['status'](_0x52f140)[_0xe524('0x30')](_0x4b1ff);};}exports[_0xe524('0x31')]=function(_0x4a4e15,_0x5b7ded){var _0x20688e={},_0x376324={},_0x5b2fc3={'count':0x0,'rows':[]};var _0x31d4a7=_['map'](db[_0xe524('0x32')]['rawAttributes'],function(_0x315e56){return{'name':_0x315e56[_0xe524('0x33')],'type':_0x315e56[_0xe524('0x34')]['key']};});_0x376324[_0xe524('0x35')]=_['map'](_0x31d4a7,_0xe524('0x2f'));_0x376324[_0xe524('0x36')]=_[_0xe524('0x37')](_0x4a4e15['query']);_0x376324[_0xe524('0x38')]=_[_0xe524('0x39')](_0x376324['model'],_0x376324[_0xe524('0x36')]);_0x20688e[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x376324[_0xe524('0x35')],qs['fields'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3b')]));_0x20688e[_0xe524('0x3a')]=_0x20688e[_0xe524('0x3a')][_0xe524('0x3c')]?_0x20688e[_0xe524('0x3a')]:_0x376324[_0xe524('0x35')];if(!_0x4a4e15[_0xe524('0x36')]['hasOwnProperty'](_0xe524('0x3d'))){_0x20688e['limit']=qs[_0xe524('0x20')](_0x4a4e15[_0xe524('0x36')]['limit']);_0x20688e[_0xe524('0x1e')]=qs['offset'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x1e')]);}_0x20688e[_0xe524('0x3e')]=qs[_0xe524('0x3f')](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3f')]);_0x20688e[_0xe524('0x40')]=qs[_0xe524('0x38')](_['pick'](_0x4a4e15[_0xe524('0x36')],_0x376324[_0xe524('0x38')]),_0x31d4a7);if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x41')]){_0x20688e[_0xe524('0x40')]=_[_0xe524('0x42')](_0x20688e[_0xe524('0x40')],{'$or':_[_0xe524('0x43')](_0x31d4a7,function(_0x5d3ea1){if(_0x5d3ea1[_0xe524('0x34')]!==_0xe524('0x44')){var _0x2e4a13={};_0x2e4a13[_0x5d3ea1['name']]={'$like':'%'+_0x4a4e15[_0xe524('0x36')]['filter']+'%'};return _0x2e4a13;}})});}_0x20688e=_[_0xe524('0x42')]({},_0x20688e,_0x4a4e15[_0xe524('0x45')]);var _0x43c314={'where':_0x20688e[_0xe524('0x40')]};return db[_0xe524('0x32')][_0xe524('0x1f')](_0x43c314)[_0xe524('0x27')](function(_0x52cd0e){_0x5b2fc3[_0xe524('0x1f')]=_0x52cd0e;if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x46')]){_0x20688e[_0xe524('0x47')]=[{'all':!![]}];}return db[_0xe524('0x32')][_0xe524('0x48')](_0x20688e);})['then'](function(_0xb694b9){_0x5b2fc3[_0xe524('0x49')]=_0xb694b9;return _0x5b2fc3;})[_0xe524('0x27')](respondWithFilteredResult(_0x5b7ded,_0x20688e))['catch'](handleError(_0x5b7ded,null));};exports[_0xe524('0x4a')]=function(_0x5209dc,_0x4e5d99){var _0x2b9b3b={'raw':!![],'where':{'id':_0x5209dc['params']['id']}},_0x33906d={};_0x33906d[_0xe524('0x35')]=_[_0xe524('0x37')](db[_0xe524('0x32')][_0xe524('0x4b')]);_0x33906d['query']=_['keys'](_0x5209dc[_0xe524('0x36')]);_0x33906d[_0xe524('0x38')]=_['intersection'](_0x33906d[_0xe524('0x35')],_0x33906d['query']);_0x2b9b3b[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x33906d[_0xe524('0x35')],qs[_0xe524('0x3b')](_0x5209dc[_0xe524('0x36')][_0xe524('0x3b')]));_0x2b9b3b[_0xe524('0x3a')]=_0x2b9b3b[_0xe524('0x3a')][_0xe524('0x3c')]?_0x2b9b3b[_0xe524('0x3a')]:_0x33906d[_0xe524('0x35')];if(_0x5209dc[_0xe524('0x36')][_0xe524('0x46')]){_0x2b9b3b[_0xe524('0x47')]=[{'all':!![]}];}_0x2b9b3b=_[_0xe524('0x42')]({},_0x2b9b3b,_0x5209dc['options']);return db[_0xe524('0x32')]['find'](_0x2b9b3b)['then'](handleEntityNotFound(_0x4e5d99,null))[_0xe524('0x27')](respondWithResult(_0x4e5d99,null))['catch'](handleError(_0x4e5d99,null));};exports[_0xe524('0x4c')]=function(_0x15d7ee,_0x561107){return db[_0xe524('0x32')]['create'](_0x15d7ee['body'],{})[_0xe524('0x27')](function(_0x1e5687){var _0x203e71=_0x15d7ee['user']['get']({'plain':!![]});if(!_0x203e71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203e71['role']==='user'){var _0x5477ca=_0x1e5687[_0xe524('0x29')]({'plain':!![]});var _0x2ce5c0='Reports';return db[_0xe524('0x4d')][_0xe524('0x4e')]({'where':{'name':_0x2ce5c0,'userProfileId':_0x203e71[_0xe524('0x4f')]},'raw':!![]})[_0xe524('0x27')](function(_0x2fa143){if(_0x2fa143&&_0x2fa143['autoAssociation']===0x0){return db[_0xe524('0x2b')][_0xe524('0x4c')]({'name':_0x5477ca[_0xe524('0x2f')],'resourceId':_0x5477ca['id'],'type':'DefaultReports','sectionId':_0x2fa143['id']},{})[_0xe524('0x27')](function(){return _0x1e5687;});}else{return _0x1e5687;}})['catch'](function(_0x12e5d0){logger[_0xe524('0x2d')](_0xe524('0x50'),_0x12e5d0);throw _0x12e5d0;});}return _0x1e5687;})[_0xe524('0x27')](respondWithResult(_0x561107,0xc9))[_0xe524('0x51')](handleError(_0x561107,null));};exports[_0xe524('0x52')]=function(_0x1cec31,_0x374450){if(_0x1cec31[_0xe524('0x53')]['id']){delete _0x1cec31[_0xe524('0x53')]['id'];}return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x1cec31['params']['id']}})['then'](handleEntityNotFound(_0x374450,null))['then'](saveUpdates(_0x1cec31[_0xe524('0x53')],null))[_0xe524('0x27')](respondWithResult(_0x374450,null))[_0xe524('0x51')](handleError(_0x374450,null));};exports[_0xe524('0x28')]=function(_0x45fb0d,_0xef3d2f){return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x45fb0d[_0xe524('0x54')]['id']}})[_0xe524('0x27')](handleEntityNotFound(_0xef3d2f,null))[_0xe524('0x27')](removeEntity(_0xef3d2f,null))['catch'](handleError(_0xef3d2f,null));};exports[_0xe524('0x55')]=function(_0x1f0567,_0x4a5f4a){var _0x53da86=0xa;var _0x54adbd=['join',_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x8a2c00={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':_0xe524('0x5a'),'MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x582fbb={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x4f58ff=function(_0x5d0507){return!_[_0xe524('0x63')]([_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x67')],_0x5d0507);};var _0x474ed4=function(_0x5135f0){if(!_0x5135f0||!_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0xc3ccfd='(',_0x5d3b9c=0x0;_0x5d3b9c<_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')];_0x5d3b9c+=0x1){_0x5d3b9c>0x0&&(_0xc3ccfd+='\x20'+_0x5135f0[_0xe524('0x69')]+'\x20');_0xc3ccfd+=_0x5135f0['rules'][_0x5d3b9c]['group']?_0x474ed4(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6a')]):_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6b')]+'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c]['condition']+(_0x4f58ff(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6c')])?'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6d')]:'');}return _0xc3ccfd+')';};var _0x3ce098={'where':{'id':_0x1f0567[_0xe524('0x54')]['id']}},_0x22d06a,_0x35e6b2,_0x1e4b32,_0x27c55c,_0x7e5992;_0x3ce098=_['merge']({},_0x3ce098,_0x1f0567[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x3ce098)[_0xe524('0x27')](function(_0xeec885){if(_0xeec885){_0x22d06a=_0xeec885;return _0xeec885['getFields']();}return null;})[_0xe524('0x27')](function(_0x2341cf){if(_0x2341cf){if(!_0x2341cf[_0xe524('0x3c')]){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x35e6b2=_0x2341cf;return db[_0xe524('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x245501){if(_0x245501){_0x1e4b32=_[_0xe524('0x72')](_0x245501,'id');var _0xce15f5;var _0x5ec07c=squel[_0xe524('0x73')]();_0x5ec07c['from'](_0x22d06a[_0xe524('0x74')]);for(var _0x2a88e2=0x0;_0x2a88e2<_0x35e6b2[_0xe524('0x3c')];_0x2a88e2+=0x1){_0xce15f5=_0x35e6b2[_0x2a88e2]['MetricId']?_0x1e4b32[_0x35e6b2[_0x2a88e2][_0xe524('0x75')]][_0xe524('0x76')]:_0x35e6b2[_0x2a88e2][_0xe524('0x6b')];_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x77')]?_[_0xe524('0x78')](_0x8a2c00[_0x35e6b2[_0x2a88e2]['function']],'%s',_0xce15f5):_0xce15f5;_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x79')]?_[_0xe524('0x78')](_0x582fbb[_0x35e6b2[_0x2a88e2][_0xe524('0x79')]],'%s',_0xce15f5):_0xce15f5;if(_0x35e6b2[_0x2a88e2][_0xe524('0x7a')]){_0x5ec07c[_0xe524('0x6a')](_0xce15f5);}_0x35e6b2[_0x2a88e2]['orderBy']&&_0x5ec07c[_0xe524('0x3e')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7b')]===_0xe524('0x7c')?![]:!![]);_0x5ec07c[_0xe524('0x6b')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7d')]||_0xce15f5);}if(_0x22d06a[_0xe524('0x7e')]){_0x22d06a['joins']=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x7e')]);for(var _0x1beaa2=0x0;_0x1beaa2<_0x22d06a['joins'][_0xe524('0x3c')];_0x1beaa2+=0x1){if(_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['type']&&_[_0xe524('0x63')](_0x54adbd,_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')])&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')]&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['foreignTable']&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]){_0x5ec07c[_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')]](_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x22d06a[_0xe524('0x74')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]));}}}if(_0x22d06a['conditions']){_0x22d06a[_0xe524('0x84')]=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x84')]);_0x5ec07c['where'](_0x474ed4(_0x22d06a[_0xe524('0x84')][_0xe524('0x6a')]));}_0x7e5992=_0x5ec07c['clone']();_0x5ec07c['limit'](_0x53da86);_0x5ec07c[_0xe524('0x1e')](0x0);logger['debug'](_0xe524('0x85'),_0x5ec07c['toString']());return dbH[_0xe524('0x86')][_0xe524('0x36')](_0x5ec07c[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')]['QueryTypes']['SELECT']});}})[_0xe524('0x27')](respondWithResult(_0x4a5f4a,null))[_0xe524('0x51')](handleError(_0x4a5f4a,null));};function runReport(_0x50eb96,_0x45c287,_0x449842){var _0x1f3ed1=_0x45c287['name'];var _0x19b063=0xa;var _0x140a4e=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x54385f={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':_0xe524('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1681c5={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x50f5e3=function(_0x11298c){return!_[_0xe524('0x63')]([_0xe524('0x64'),'IS\x20NOT\x20NULL',_0xe524('0x66'),_0xe524('0x67')],_0x11298c);};var _0x5603d0=function(_0x2712ac){if(!_0x2712ac||!_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0x32c9f6='(',_0x58d29e=0x0;_0x58d29e<_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')];_0x58d29e+=0x1){_0x58d29e>0x0&&(_0x32c9f6+='\x20'+_0x2712ac[_0xe524('0x69')]+'\x20');_0x32c9f6+=_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]?_0x5603d0(_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]):_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6b')]+'\x20'+_0x2712ac['rules'][_0x58d29e][_0xe524('0x6c')]+(_0x50f5e3(_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6c')])?'\x20'+_0x2712ac['rules'][_0x58d29e]['value']:'');}return _0x32c9f6+')';};var _0x334164={'where':{'id':_0x50eb96['id']}},_0x512572,_0x903e24,_0x4964c3,_0x2dc3f5,_0x246c62;_0x334164=_['merge']({},_0x334164,_0x449842);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x334164)['then'](function(_0x482b72){if(_0x482b72){_0x512572=_0x482b72;return _0x482b72[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x1b3e03){if(_0x1b3e03){if(!_0x1b3e03['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x903e24=_0x1b3e03;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x57501c){if(_0x57501c){_0x4964c3=_[_0xe524('0x72')](_0x57501c,'id');var _0x3a2834;var _0x4c7f45=squel['select']();_0x4c7f45[_0xe524('0x8c')](_0x512572[_0xe524('0x74')]);for(var _0x41f842=0x0;_0x41f842<_0x903e24[_0xe524('0x3c')];_0x41f842+=0x1){_0x3a2834=_0x903e24[_0x41f842]['MetricId']?_0x4964c3[_0x903e24[_0x41f842][_0xe524('0x75')]][_0xe524('0x76')]:_0x903e24[_0x41f842]['field'];_0x3a2834=_0x903e24[_0x41f842]['function']?_[_0xe524('0x78')](_0x54385f[_0x903e24[_0x41f842][_0xe524('0x77')]],'%s',_0x3a2834):_0x3a2834;_0x3a2834=_0x903e24[_0x41f842][_0xe524('0x79')]?_[_0xe524('0x78')](_0x1681c5[_0x903e24[_0x41f842][_0xe524('0x79')]],'%s',_0x3a2834):_0x3a2834;if(_0x903e24[_0x41f842][_0xe524('0x7a')]){_0x4c7f45['group'](_0x3a2834);}_0x903e24[_0x41f842]['orderBy']&&_0x4c7f45[_0xe524('0x3e')](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x4c7f45['field'](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7d')]||_0x3a2834);}if(_0x512572[_0xe524('0x7e')]){_0x512572[_0xe524('0x7e')]=JSON[_0xe524('0x7f')](_0x512572[_0xe524('0x7e')]);for(var _0xa820a1=0x0;_0xa820a1<_0x512572['joins']['length'];_0xa820a1+=0x1){if(_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x140a4e,_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')])&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x80')]&&_0x512572[_0xe524('0x7e')][_0xa820a1]['foreignTable']&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]){_0x4c7f45[_0x512572[_0xe524('0x7e')][_0xa820a1]['type']](_0x512572['joins'][_0xa820a1][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x512572[_0xe524('0x74')],_0x512572['joins'][_0xa820a1][_0xe524('0x80')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x82')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]));}}}if(_0x512572['conditions']){_0x512572[_0xe524('0x84')]=JSON['parse'](_0x512572[_0xe524('0x84')]);_0x4c7f45[_0xe524('0x40')](_0x5603d0(_0x512572['conditions'][_0xe524('0x6a')]));}_0x246c62=_0x4c7f45[_0xe524('0x8d')]();_0x4c7f45['limit'](_0x19b063);_0x4c7f45[_0xe524('0x1e')](0x0);return;}})['then'](function(){if(_0x45c287[_0xe524('0x8e')]===_0xe524('0x8f')){return null;}var _0x1be681=_[_0xe524('0x42')](_0x45c287,{'name':_0x45c287[_0xe524('0x90')]||_0x45c287[_0xe524('0x2f')]||_0x512572[_0xe524('0x2f')],'basename':_0x1f3ed1,'savename':util[_0xe524('0x79')]('%s-%s.%s',_0x45c287[_0xe524('0x2f')]||_0x512572['name'],require('randomstring')[_0xe524('0x91')](0x4),_0x45c287['output']||_0xe524('0x92')),'reportId':_0x512572['id'],'reportType':_0xe524('0x93')});return db[_0xe524('0x94')][_0xe524('0x4c')](_0x1be681,{'raw':!![]});})[_0xe524('0x27')](function(_0x26c802){if(_0x512572['table']==='cdr'){_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x95'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}else{_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x98'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}if(_0x26c802){logger['info'](_0xe524('0x99'),_0x246c62[_0xe524('0x87')]());require(_0xe524('0x9a'))[_0xe524('0x9b')](path[_0xe524('0x88')](__dirname,_0xe524('0x9c'),_0x26c802['output']),[_0x26c802['id'],_0x246c62[_0xe524('0x87')](),path[_0xe524('0x88')](__dirname,_0xe524('0x9d'),_0x26c802[_0xe524('0x9e')]),_0x1f3ed1]);return _0x26c802;}else{var _0x84bbd7=squel[_0xe524('0x73')]();_0x84bbd7[_0xe524('0x8c')]('('+_0x246c62[_0xe524('0x87')]()+')','countTable');_0x84bbd7['field']('COUNT(*)',_0xe524('0x1f'));_0x246c62[_0xe524('0x20')](_0x45c287['limit']||_0x19b063);_0x246c62[_0xe524('0x1e')](_0x45c287[_0xe524('0x1e')]||0x0);return dbH['sequelize'][_0xe524('0x36')](_0x84bbd7[_0xe524('0x87')](),{'type':dbH['sequelize'][_0xe524('0x9f')][_0xe524('0xa0')]})[_0xe524('0x27')](function(_0x542182){if(!_0x542182[_0xe524('0x3c')]){_0x2dc3f5=0x0;}else{_0x2dc3f5=_0x542182[0x0][_0xe524('0x1f')]||0x0;}return dbH[_0xe524('0x86')]['query'](_0x246c62[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});})['then'](function(_0x5e6a3d){return{'rows':_0x5e6a3d||[],'count':_0x2dc3f5};});}});}exports[_0xe524('0xa1')]=function(_0x33d066,_0x3ea495){return runReport(_0x33d066[_0xe524('0x54')],_0x33d066[_0xe524('0x36')],_0x33d066[_0xe524('0x45')])[_0xe524('0x27')](respondWithResult(_0x3ea495,null))[_0xe524('0x51')](handleError(_0x3ea495,null));};exports[_0xe524('0xa2')]=runReport;exports[_0xe524('0x36')]=function(_0x4505de,_0x292f14){var _0x2d24c1=0xa;var _0x483307=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x280022={'SUM':_0xe524('0xa3'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':'MIN(%s)','AVG':_0xe524('0x89'),'GROUP_CONCAT':_0xe524('0xa4'),'GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x46d6da={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x39998a=function(_0x107de8){return!_['includes']([_0xe524('0x64'),_0xe524('0x65'),'IS\x20EMPTY',_0xe524('0x67')],_0x107de8);};var _0x458e14=function(_0x4e0886){if(!_0x4e0886||!_0x4e0886['rules'][_0xe524('0x3c')]){return'';}for(var _0x3639cf='(',_0x575c14=0x0;_0x575c14<_0x4e0886['rules'][_0xe524('0x3c')];_0x575c14+=0x1){_0x575c14>0x0&&(_0x3639cf+='\x20'+_0x4e0886['operator']+'\x20');_0x3639cf+=_0x4e0886['rules'][_0x575c14]['group']?_0x458e14(_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6a')]):_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6b')]+'\x20'+_0x4e0886['rules'][_0x575c14]['condition']+(_0x39998a(_0x4e0886['rules'][_0x575c14][_0xe524('0x6c')])?'\x20'+_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6d')]:'');}return _0x3639cf+')';};var _0x289720={'where':{'id':_0x4505de[_0xe524('0x54')]['id']}},_0x3fb45c,_0x3362fe,_0x119684,_0x19e4fd,_0x4b4349;_0x289720=_[_0xe524('0x42')]({},_0x289720,_0x4505de[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x289720)[_0xe524('0x27')](function(_0x404a49){if(_0x404a49){_0x3fb45c=_0x404a49;return _0x404a49[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x8e8087){if(_0x8e8087){if(!_0x8e8087['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x3362fe=_0x8e8087;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x113a54){if(_0x113a54){_0x119684=_[_0xe524('0x72')](_0x113a54,'id');var _0x4ebca4;var _0x40043c=squel[_0xe524('0x73')]();_0x40043c[_0xe524('0x8c')](_0x3fb45c[_0xe524('0x74')]);for(var _0x19a773=0x0;_0x19a773<_0x3362fe[_0xe524('0x3c')];_0x19a773+=0x1){_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x75')]?_0x119684[_0x3362fe[_0x19a773][_0xe524('0x75')]][_0xe524('0x76')]:_0x3362fe[_0x19a773][_0xe524('0x6b')];_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x77')]?_[_0xe524('0x78')](_0x280022[_0x3362fe[_0x19a773]['function']],'%s',_0x4ebca4):_0x4ebca4;_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x79')]?_[_0xe524('0x78')](_0x46d6da[_0x3362fe[_0x19a773][_0xe524('0x79')]],'%s',_0x4ebca4):_0x4ebca4;if(_0x3362fe[_0x19a773]['groupBy']){_0x40043c['group'](_0x4ebca4);}_0x3362fe[_0x19a773][_0xe524('0x7b')]&&_0x40043c[_0xe524('0x3e')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x40043c[_0xe524('0x6b')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7d')]||_0x4ebca4);}if(_0x3fb45c[_0xe524('0x7e')]){_0x3fb45c['joins']=JSON['parse'](_0x3fb45c[_0xe524('0x7e')]);for(var _0x2a85e5=0x0;_0x2a85e5<_0x3fb45c[_0xe524('0x7e')]['length'];_0x2a85e5+=0x1){if(_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x483307,_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')])&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')]&&_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')]&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]){_0x40043c[_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]](_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')],null,util[_0xe524('0x79')]('%s.%s\x20=\x20%s.%s',_0x3fb45c[_0xe524('0x74')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x82')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]));}}}if(_0x3fb45c[_0xe524('0x84')]){_0x3fb45c[_0xe524('0x84')]=JSON['parse'](_0x3fb45c['conditions']);_0x40043c[_0xe524('0x40')](_0x458e14(_0x3fb45c[_0xe524('0x84')][_0xe524('0x6a')]));}_0x4b4349=_0x40043c[_0xe524('0x8d')]();_0x40043c[_0xe524('0x20')](_0x2d24c1);_0x40043c[_0xe524('0x1e')](0x0);logger[_0xe524('0xa5')]('Limited\x20Query:',_0x40043c['toString']());return dbH[_0xe524('0x86')]['query'](_0x40043c['toString'](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});}})[_0xe524('0x27')](function(){return{'sql':_0x4b4349[_0xe524('0x87')]()};})[_0xe524('0x27')](respondWithResult(_0x292f14,null))['catch'](handleError(_0x292f14,null));}; \ No newline at end of file +var _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0x5cc4de,_0x2df335){var _0x1bf255=function(_0x479413){while(--_0x479413){_0x5cc4de['push'](_0x5cc4de['shift']());}};_0x1bf255(++_0x2df335);}(_0x46ed,0x168));var _0xd46e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x46ed[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index ab10e81..ebf01b3 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 _0x1ee3=['./analyticDefaultReport.attributes','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xa1de8d,_0x1399a8){var _0x478b44=function(_0x3c8db7){while(--_0x3c8db7){_0xa1de8d['push'](_0xa1de8d['shift']());}};_0x478b44(++_0x1399a8);}(_0x1ee3,0x7b));var _0x31ee=function(_0x182416,_0x5874bc){_0x182416=_0x182416-0x0;var _0x5b4e3d=_0x1ee3[_0x182416];return _0x5b4e3d;};'use strict';var _=require(_0x31ee('0x0'));var util=require(_0x31ee('0x1'));var logger=require(_0x31ee('0x2'))(_0x31ee('0x3'));var moment=require(_0x31ee('0x4'));var BPromise=require(_0x31ee('0x5'));var rp=require(_0x31ee('0x6'));var fs=require('fs');var path=require(_0x31ee('0x7'));var rimraf=require('rimraf');var config=require(_0x31ee('0x8'));var attributes=require(_0x31ee('0x9'));module['exports']=function(_0x593e71,_0x3cd80c){return _0x593e71[_0x31ee('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x31ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fd6=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment'];(function(_0x401b4c,_0x27f802){var _0x22612b=function(_0x5a77e6){while(--_0x5a77e6){_0x401b4c['push'](_0x401b4c['shift']());}};_0x22612b(++_0x27f802);}(_0x6fd6,0xb2));var _0x66fd=function(_0x232584,_0x14f0d9){_0x232584=_0x232584-0x0;var _0x80b0c4=_0x6fd6[_0x232584];return _0x80b0c4;};'use strict';var _=require(_0x66fd('0x0'));var util=require(_0x66fd('0x1'));var logger=require('../../config/logger')(_0x66fd('0x2'));var moment=require(_0x66fd('0x3'));var BPromise=require(_0x66fd('0x4'));var rp=require(_0x66fd('0x5'));var fs=require('fs');var path=require(_0x66fd('0x6'));var rimraf=require(_0x66fd('0x7'));var config=require(_0x66fd('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0x66fd('0x9')]=function(_0x142f0e,_0xb3dfce){return _0x142f0e[_0x66fd('0xa')](_0x66fd('0xb'),attributes,{'tableName':_0x66fd('0xc'),'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 3edccbc..0be2ef7 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 _0x60dc=['stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0xeca67,_0x2f5be0){var _0x1c55a9=function(_0x56963d){while(--_0x56963d){_0xeca67['push'](_0xeca67['shift']());}};_0x1c55a9(++_0x2f5be0);}(_0x60dc,0x1d3));var _0xc60d=function(_0x3c7764,_0x31a70a){_0x3c7764=_0x3c7764-0x0;var _0x392aa9=_0x60dc[_0x3c7764];return _0x392aa9;};'use strict';var _=require(_0xc60d('0x0'));var util=require(_0xc60d('0x1'));var moment=require(_0xc60d('0x2'));var BPromise=require(_0xc60d('0x3'));var rs=require(_0xc60d('0x4'));var fs=require('fs');var Redis=require(_0xc60d('0x5'));var db=require(_0xc60d('0x6'))['db'];var utils=require(_0xc60d('0x7'));var logger=require('../../config/logger')(_0xc60d('0x8'));var config=require('../../config/environment');var jayson=require(_0xc60d('0x9'));var client=jayson[_0xc60d('0xa')][_0xc60d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5264a6,_0x4bca55,_0xe50876){return new BPromise(function(_0x535830,_0x3db2c6){return client[_0xc60d('0xc')](_0x5264a6,_0xe50876)['then'](function(_0x24abb3){logger['info'](_0xc60d('0xd'),_0x4bca55,_0xc60d('0xe'));logger['debug'](_0xc60d('0xf'),_0x4bca55,_0xc60d('0xe'),JSON[_0xc60d('0x10')](_0x24abb3));if(_0x24abb3['error']){if(_0x24abb3['error'][_0xc60d('0x11')]===0x1f4){logger[_0xc60d('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4bca55,_0x24abb3[_0xc60d('0x12')][_0xc60d('0x13')]);return _0x3db2c6(_0x24abb3[_0xc60d('0x12')][_0xc60d('0x13')]);}logger[_0xc60d('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4bca55,_0x24abb3['error'][_0xc60d('0x13')]);return _0x535830(_0x24abb3[_0xc60d('0x12')][_0xc60d('0x13')]);}else{logger[_0xc60d('0x14')](_0xc60d('0xd'),_0x4bca55,'request\x20sent');_0x535830(_0x24abb3[_0xc60d('0x15')][_0xc60d('0x13')]);}})[_0xc60d('0x16')](function(_0x1cbeae){logger['error'](_0xc60d('0xd'),_0x4bca55,_0x1cbeae);_0x3db2c6(_0x1cbeae);});});} \ No newline at end of file +var _0xa689=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','AnalyticDefaultReport,\x20%s,\x20%s','debug'];(function(_0x446500,_0x283701){var _0x1e6bd7=function(_0x58fdf3){while(--_0x58fdf3){_0x446500['push'](_0x446500['shift']());}};_0x1e6bd7(++_0x283701);}(_0xa689,0x92));var _0x9a68=function(_0x597834,_0x159bb6){_0x597834=_0x597834-0x0;var _0x12da6c=_0xa689[_0x597834];return _0x12da6c;};'use strict';var _=require(_0x9a68('0x0'));var util=require(_0x9a68('0x1'));var moment=require(_0x9a68('0x2'));var BPromise=require(_0x9a68('0x3'));var rs=require(_0x9a68('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a68('0x5'))['db'];var utils=require(_0x9a68('0x6'));var logger=require(_0x9a68('0x7'))(_0x9a68('0x8'));var config=require(_0x9a68('0x9'));var jayson=require(_0x9a68('0xa'));var client=jayson['client'][_0x9a68('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdf34fd,_0x2f8ba1,_0xbd63b2){return new BPromise(function(_0x20c540,_0x2b1459){return client['request'](_0xdf34fd,_0xbd63b2)['then'](function(_0x359219){logger[_0x9a68('0xc')](_0x9a68('0xd'),_0x2f8ba1,'request\x20sent');logger[_0x9a68('0xe')](_0x9a68('0xf'),_0x2f8ba1,_0x9a68('0x10'),JSON[_0x9a68('0x11')](_0x359219));if(_0x359219[_0x9a68('0x12')]){if(_0x359219[_0x9a68('0x12')][_0x9a68('0x13')]===0x1f4){logger[_0x9a68('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2f8ba1,_0x359219['error'][_0x9a68('0x14')]);return _0x2b1459(_0x359219[_0x9a68('0x12')]['message']);}logger[_0x9a68('0x12')](_0x9a68('0xd'),_0x2f8ba1,_0x359219['error'][_0x9a68('0x14')]);return _0x20c540(_0x359219[_0x9a68('0x12')][_0x9a68('0x14')]);}else{logger[_0x9a68('0xc')](_0x9a68('0xd'),_0x2f8ba1,'request\x20sent');_0x20c540(_0x359219[_0x9a68('0x15')][_0x9a68('0x14')]);}})[_0x9a68('0x16')](function(_0x532040){logger[_0x9a68('0x12')](_0x9a68('0xd'),_0x2f8ba1,_0x532040);_0x2b1459(_0x532040);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 2461510..9ff76a3 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 _0x663a=['run','query','post','create','put','/:id','update','destroy','exports','multer','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','preview'];(function(_0x598a9c,_0x3588b8){var _0x40271b=function(_0x440c4b){while(--_0x440c4b){_0x598a9c['push'](_0x598a9c['shift']());}};_0x40271b(++_0x3588b8);}(_0x663a,0xf3));var _0xa663=function(_0x15cfd2,_0x5eb849){_0x15cfd2=_0x15cfd2-0x0;var _0x415e4f=_0x663a[_0x15cfd2];return _0x415e4f;};'use strict';var multer=require(_0xa663('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa663('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0xa663('0x2'));var config=require(_0xa663('0x3'));var controller=require('./analyticDefaultReport.controller');router[_0xa663('0x4')]('/',auth[_0xa663('0x5')](),controller[_0xa663('0x6')]);router[_0xa663('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xa663('0x7')]);router[_0xa663('0x4')]('/:id/preview',auth[_0xa663('0x5')](),controller[_0xa663('0x8')]);router[_0xa663('0x4')]('/:id/run',auth[_0xa663('0x5')](),controller[_0xa663('0x9')]);router[_0xa663('0x4')]('/:id/query',auth[_0xa663('0x5')](),controller[_0xa663('0xa')]);router[_0xa663('0xb')]('/',auth[_0xa663('0x5')](),controller[_0xa663('0xc')]);router[_0xa663('0xd')](_0xa663('0xe'),auth['isAuthenticated'](),controller[_0xa663('0xf')]);router['delete'](_0xa663('0xe'),auth[_0xa663('0x5')](),controller[_0xa663('0x10')]);module[_0xa663('0x11')]=router; \ No newline at end of file +var _0x9300=['update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/run','run','query','create','put'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x9300,0x153));var _0x0930=function(_0x1ee293,_0x465cda){_0x1ee293=_0x1ee293-0x0;var _0x161342=_0x9300[_0x1ee293];return _0x161342;};'use strict';var multer=require(_0x0930('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0930('0x1'));var express=require(_0x0930('0x2'));var router=express[_0x0930('0x3')]();var fs_extra=require(_0x0930('0x4'));var auth=require(_0x0930('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0930('0x6'));var controller=require(_0x0930('0x7'));router['get']('/',auth[_0x0930('0x8')](),controller[_0x0930('0x9')]);router[_0x0930('0xa')](_0x0930('0xb'),auth[_0x0930('0x8')](),controller[_0x0930('0xc')]);router['get']('/:id/preview',auth[_0x0930('0x8')](),controller['preview']);router[_0x0930('0xa')](_0x0930('0xd'),auth['isAuthenticated'](),controller[_0x0930('0xe')]);router['get']('/:id/query',auth[_0x0930('0x8')](),controller[_0x0930('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0930('0x10')]);router[_0x0930('0x11')](_0x0930('0xb'),auth[_0x0930('0x8')](),controller[_0x0930('0x12')]);router[_0x0930('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0930('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 0736382..9cd8b01 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 _0xed8e=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','csv','pdf','xlsx','STRING','DATE'];(function(_0x36cca2,_0x2cc811){var _0x2553a8=function(_0x383d0d){while(--_0x383d0d){_0x36cca2['push'](_0x36cca2['shift']());}};_0x2553a8(++_0x2cc811);}(_0xed8e,0x130));var _0xeed8=function(_0x4d49a7,_0x12efa2){_0x4d49a7=_0x4d49a7-0x0;var _0x1aa9c7=_0xed8e[_0x4d49a7];return _0x1aa9c7;};'use strict';var Sequelize=require(_0xeed8('0x0'));var moment=require(_0xeed8('0x1'));module[_0xeed8('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xeed8('0x3'),_0xeed8('0x4'),_0xeed8('0x5')),'allowNull':![],'defaultValue':_0xeed8('0x3')},'savename':{'type':Sequelize[_0xeed8('0x6')],'allowNull':![]},'startDate':{'type':Sequelize[_0xeed8('0x7')]},'endDate':{'type':Sequelize[_0xeed8('0x7')]},'status':{'type':Sequelize[_0xeed8('0x6')],'defaultValue':_0xeed8('0x8')},'type':{'type':Sequelize['ENUM'](_0xeed8('0x9'),_0xeed8('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xeed8('0xb')](0xb)[_0xeed8('0xc')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2fb4=['Loading','ENUM','manual','UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE'];(function(_0x103167,_0x9e63f3){var _0x5d9e45=function(_0x3ad17d){while(--_0x3ad17d){_0x103167['push'](_0x103167['shift']());}};_0x5d9e45(++_0x9e63f3);}(_0x2fb4,0xa0));var _0x42fb=function(_0x3be52f,_0x22a3e4){_0x3be52f=_0x3be52f-0x0;var _0xe63f25=_0x2fb4[_0x3be52f];return _0xe63f25;};'use strict';var Sequelize=require(_0x42fb('0x0'));var moment=require(_0x42fb('0x1'));module[_0x42fb('0x2')]={'name':{'type':Sequelize[_0x42fb('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x42fb('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x42fb('0x4'),_0x42fb('0x5'),_0x42fb('0x6')),'allowNull':![],'defaultValue':_0x42fb('0x4')},'savename':{'type':Sequelize[_0x42fb('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x42fb('0x7')]},'status':{'type':Sequelize[_0x42fb('0x3')],'defaultValue':_0x42fb('0x8')},'type':{'type':Sequelize[_0x42fb('0x9')](_0x42fb('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0x42fb('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x42fb('0xb')]},'reportType':{'type':Sequelize[_0x42fb('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 658dc65..72bceb6 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 _0xd63b=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','show','params','include','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','download','root','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0xd63b,0x1b9));var _0xbd63=function(_0x296e0e,_0x342fa4){_0x296e0e=_0x296e0e-0x0;var _0x101c03=_0xd63b[_0x296e0e];return _0x101c03;};'use strict';var emlformat=require(_0xbd63('0x0'));var rimraf=require(_0xbd63('0x1'));var zipdir=require(_0xbd63('0x2'));var jsonpatch=require(_0xbd63('0x3'));var rp=require(_0xbd63('0x4'));var moment=require(_0xbd63('0x5'));var BPromise=require(_0xbd63('0x6'));var Mustache=require(_0xbd63('0x7'));var util=require(_0xbd63('0x8'));var path=require(_0xbd63('0x9'));var sox=require('sox');var csv=require(_0xbd63('0xa'));var ejs=require(_0xbd63('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd63('0xc'));var squel=require(_0xbd63('0xd'));var crypto=require('crypto');var jsforce=require(_0xbd63('0xe'));var deskjs=require(_0xbd63('0xf'));var toCsv=require(_0xbd63('0xa'));var querystring=require('querystring');var Papa=require(_0xbd63('0x10'));var Redis=require(_0xbd63('0x11'));var authService=require(_0xbd63('0x12'));var qs=require(_0xbd63('0x13'));var as=require(_0xbd63('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xbd63('0x15'));var config=require(_0xbd63('0x16'));var licenseUtil=require(_0xbd63('0x17'));var db=require(_0xbd63('0x18'))['db'];function respondWithStatusCode(_0x1b6a88,_0x6dde5e){_0x6dde5e=_0x6dde5e||0xcc;return function(_0x55c07b){if(_0x55c07b){return _0x1b6a88['sendStatus'](_0x6dde5e);}return _0x1b6a88[_0xbd63('0x19')](_0x6dde5e)[_0xbd63('0x1a')]();};}function respondWithResult(_0x134a84,_0x202b74){_0x202b74=_0x202b74||0xc8;return function(_0x20520e){if(_0x20520e){return _0x134a84['status'](_0x202b74)[_0xbd63('0x1b')](_0x20520e);}};}function respondWithFilteredResult(_0x10bfda,_0x1269fc){return function(_0x495dad){if(_0x495dad){var _0x316af9=typeof _0x1269fc['offset']===_0xbd63('0x1c')&&typeof _0x1269fc['limit']==='undefined';var _0x13b856=_0x495dad[_0xbd63('0x1d')];var _0x221afe=_0x316af9?0x0:_0x1269fc[_0xbd63('0x1e')];var _0x310551=_0x316af9?_0x495dad[_0xbd63('0x1d')]:_0x1269fc['offset']+_0x1269fc[_0xbd63('0x1f')];var _0x578e07;if(_0x310551>=_0x13b856){_0x310551=_0x13b856;_0x578e07=0xc8;}else{_0x578e07=0xce;}_0x10bfda[_0xbd63('0x19')](_0x578e07);return _0x10bfda[_0xbd63('0x20')](_0xbd63('0x21'),_0x221afe+'-'+_0x310551+'/'+_0x13b856)[_0xbd63('0x1b')](_0x495dad);}return null;};}function patchUpdates(_0x22be0c){return function(_0x3208dd){try{jsonpatch['apply'](_0x3208dd,_0x22be0c,!![]);}catch(_0x5ce066){return BPromise[_0xbd63('0x22')](_0x5ce066);}return _0x3208dd[_0xbd63('0x23')]();};}function saveUpdates(_0x2df81f,_0xa1c62){return function(_0x51cbd8){if(_0x51cbd8){return _0x51cbd8[_0xbd63('0x24')](_0x2df81f)[_0xbd63('0x25')](function(_0x47c0cf){return _0x47c0cf;});}return null;};}function removeEntity(_0x39024b,_0x373b37){return function(_0x1ee7f7){if(_0x1ee7f7){return _0x1ee7f7[_0xbd63('0x26')]()[_0xbd63('0x25')](function(){var _0x1d1c30=_0x1ee7f7[_0xbd63('0x27')]({'plain':!![]});var _0x42f4cd=_0xbd63('0x28');return db[_0xbd63('0x29')][_0xbd63('0x26')]({'where':{'type':_0x42f4cd,'resourceId':_0x1d1c30['id']}})['then'](function(){return _0x1ee7f7;});})[_0xbd63('0x25')](function(){_0x39024b[_0xbd63('0x19')](0xcc)[_0xbd63('0x1a')]();});}};}function handleEntityNotFound(_0x3f2443,_0x104a9e){return function(_0x7cc9d9){if(!_0x7cc9d9){_0x3f2443['sendStatus'](0x194);}return _0x7cc9d9;};}function handleError(_0x4cceed,_0x4a922d){_0x4a922d=_0x4a922d||0x1f4;return function(_0x1b3e7f){logger[_0xbd63('0x2a')](_0x1b3e7f[_0xbd63('0x2b')]);if(_0x1b3e7f['name']){delete _0x1b3e7f['name'];}_0x4cceed[_0xbd63('0x19')](_0x4a922d)[_0xbd63('0x2c')](_0x1b3e7f);};}exports[_0xbd63('0x2d')]=function(_0x296907,_0x174ea4){var _0x537623={},_0x1e0dc7={},_0x174789={'count':0x0,'rows':[]};var _0x2aea7b=_[_0xbd63('0x2e')](db[_0xbd63('0x2f')]['rawAttributes'],function(_0x557559){return{'name':_0x557559[_0xbd63('0x30')],'type':_0x557559[_0xbd63('0x31')][_0xbd63('0x32')]};});_0x1e0dc7[_0xbd63('0x33')]=_[_0xbd63('0x2e')](_0x2aea7b,_0xbd63('0x34'));_0x1e0dc7[_0xbd63('0x35')]=_[_0xbd63('0x36')](_0x296907[_0xbd63('0x35')]);_0x1e0dc7[_0xbd63('0x37')]=_['intersection'](_0x1e0dc7[_0xbd63('0x33')],_0x1e0dc7['query']);_0x537623['attributes']=_[_0xbd63('0x38')](_0x1e0dc7[_0xbd63('0x33')],qs[_0xbd63('0x39')](_0x296907[_0xbd63('0x35')]['fields']));_0x537623[_0xbd63('0x3a')]=_0x537623[_0xbd63('0x3a')][_0xbd63('0x3b')]?_0x537623[_0xbd63('0x3a')]:_0x1e0dc7[_0xbd63('0x33')];if(!_0x296907[_0xbd63('0x35')][_0xbd63('0x3c')](_0xbd63('0x3d'))){_0x537623[_0xbd63('0x1f')]=qs['limit'](_0x296907[_0xbd63('0x35')]['limit']);_0x537623[_0xbd63('0x1e')]=qs[_0xbd63('0x1e')](_0x296907['query'][_0xbd63('0x1e')]);}_0x537623[_0xbd63('0x3e')]=qs[_0xbd63('0x3f')](_0x296907[_0xbd63('0x35')][_0xbd63('0x3f')]);_0x537623[_0xbd63('0x40')]=qs[_0xbd63('0x37')](_[_0xbd63('0x41')](_0x296907[_0xbd63('0x35')],_0x1e0dc7[_0xbd63('0x37')]),_0x2aea7b);if(_0x296907['query'][_0xbd63('0x42')]){_0x537623[_0xbd63('0x40')]=_['merge'](_0x537623[_0xbd63('0x40')],{'$or':_[_0xbd63('0x2e')](_0x2aea7b,function(_0x5496c7){if(_0x5496c7[_0xbd63('0x31')]!==_0xbd63('0x43')){var _0x41faef={};_0x41faef[_0x5496c7['name']]={'$like':'%'+_0x296907[_0xbd63('0x35')][_0xbd63('0x42')]+'%'};return _0x41faef;}})});}_0x537623=_[_0xbd63('0x44')]({},_0x537623,_0x296907[_0xbd63('0x45')]);var _0x3dfcb9={'where':_0x537623[_0xbd63('0x40')]};return db[_0xbd63('0x2f')][_0xbd63('0x1d')](_0x3dfcb9)['then'](function(_0x4bac19){_0x174789[_0xbd63('0x1d')]=_0x4bac19;if(_0x296907['query'][_0xbd63('0x46')]){_0x537623['include']=[{'all':!![]}];}return db[_0xbd63('0x2f')][_0xbd63('0x47')](_0x537623);})[_0xbd63('0x25')](function(_0x13f3b5){_0x174789['rows']=_0x13f3b5;return _0x174789;})['then'](respondWithFilteredResult(_0x174ea4,_0x537623))['catch'](handleError(_0x174ea4,null));};exports[_0xbd63('0x48')]=function(_0x2d4391,_0x511ffc){var _0x109f91={'raw':!![],'where':{'id':_0x2d4391[_0xbd63('0x49')]['id']}},_0x4c93e4={};_0x4c93e4[_0xbd63('0x33')]=_[_0xbd63('0x36')](db['AnalyticExtractedReport']['rawAttributes']);_0x4c93e4['query']=_[_0xbd63('0x36')](_0x2d4391[_0xbd63('0x35')]);_0x4c93e4[_0xbd63('0x37')]=_[_0xbd63('0x38')](_0x4c93e4[_0xbd63('0x33')],_0x4c93e4['query']);_0x109f91[_0xbd63('0x3a')]=_[_0xbd63('0x38')](_0x4c93e4[_0xbd63('0x33')],qs[_0xbd63('0x39')](_0x2d4391[_0xbd63('0x35')]['fields']));_0x109f91[_0xbd63('0x3a')]=_0x109f91[_0xbd63('0x3a')][_0xbd63('0x3b')]?_0x109f91['attributes']:_0x4c93e4['model'];if(_0x2d4391[_0xbd63('0x35')][_0xbd63('0x46')]){_0x109f91[_0xbd63('0x4a')]=[{'all':!![]}];}_0x109f91=_[_0xbd63('0x44')]({},_0x109f91,_0x2d4391['options']);return db[_0xbd63('0x2f')][_0xbd63('0x4b')](_0x109f91)[_0xbd63('0x25')](handleEntityNotFound(_0x511ffc,null))['then'](respondWithResult(_0x511ffc,null))[_0xbd63('0x4c')](handleError(_0x511ffc,null));};exports[_0xbd63('0x4d')]=function(_0x60af5d,_0x16e685){return db[_0xbd63('0x2f')][_0xbd63('0x4d')](_0x60af5d[_0xbd63('0x4e')],{})[_0xbd63('0x25')](function(_0x5059b1){var _0x22e7db=_0x60af5d[_0xbd63('0x4f')][_0xbd63('0x27')]({'plain':!![]});if(!_0x22e7db)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22e7db[_0xbd63('0x50')]===_0xbd63('0x4f')){var _0x4b9a98=_0x5059b1[_0xbd63('0x27')]({'plain':!![]});var _0x5a5822=_0xbd63('0x28');return db[_0xbd63('0x51')]['find']({'where':{'name':_0x5a5822,'userProfileId':_0x22e7db[_0xbd63('0x52')]},'raw':!![]})[_0xbd63('0x25')](function(_0xf0d90c){if(_0xf0d90c&&_0xf0d90c[_0xbd63('0x53')]===0x0){return db[_0xbd63('0x29')][_0xbd63('0x4d')]({'name':_0x4b9a98[_0xbd63('0x34')],'resourceId':_0x4b9a98['id'],'type':_0xf0d90c[_0xbd63('0x34')],'sectionId':_0xf0d90c['id']},{})[_0xbd63('0x25')](function(){return _0x5059b1;});}else{return _0x5059b1;}})[_0xbd63('0x4c')](function(_0x4df880){logger[_0xbd63('0x2a')](_0xbd63('0x54'),_0x4df880);throw _0x4df880;});}return _0x5059b1;})['then'](respondWithResult(_0x16e685,0xc9))[_0xbd63('0x4c')](handleError(_0x16e685,null));};exports[_0xbd63('0x24')]=function(_0x582130,_0x2a4e85){if(_0x582130['body']['id']){delete _0x582130['body']['id'];}return db[_0xbd63('0x2f')][_0xbd63('0x4b')]({'where':{'id':_0x582130['params']['id']}})[_0xbd63('0x25')](handleEntityNotFound(_0x2a4e85,null))[_0xbd63('0x25')](saveUpdates(_0x582130[_0xbd63('0x4e')],null))[_0xbd63('0x25')](respondWithResult(_0x2a4e85,null))['catch'](handleError(_0x2a4e85,null));};exports[_0xbd63('0x26')]=function(_0x3086e9,_0x199aee){return db[_0xbd63('0x2f')][_0xbd63('0x4b')]({'where':{'id':_0x3086e9[_0xbd63('0x49')]['id']}})['then'](handleEntityNotFound(_0x199aee,null))[_0xbd63('0x25')](removeEntity(_0x199aee,null))[_0xbd63('0x4c')](handleError(_0x199aee,null));};exports['download']=function(_0x33efe0,_0x45fd80,_0x3d6f2f){return db[_0xbd63('0x2f')][_0xbd63('0x4b')]({'where':{'id':_0x33efe0['params']['id']},'attributes':['name',_0xbd63('0x55'),_0xbd63('0x56'),'output'],'raw':!![]})[_0xbd63('0x25')](handleEntityNotFound(_0x45fd80,null))[_0xbd63('0x25')](function(_0x5d6baa){if(_0x5d6baa){if(!fs[_0xbd63('0x57')](path[_0xbd63('0x58')](config['root'],_0xbd63('0x59'),_0x5d6baa[_0xbd63('0x56')]))){throw new db[(_0xbd63('0x5a'))][(_0xbd63('0x5b'))](_0xbd63('0x5c'));}if(_0x33efe0[_0xbd63('0x35')][_0xbd63('0x5d')]){return _0x45fd80[_0xbd63('0x5e')](0xc8);}return _0x45fd80[_0xbd63('0x5f')](path[_0xbd63('0x58')](config[_0xbd63('0x60')],'server/files/reports',_0x5d6baa[_0xbd63('0x56')]),util[_0xbd63('0x61')](_0xbd63('0x62'),_0x5d6baa[_0xbd63('0x55')]||_0x5d6baa[_0xbd63('0x34')],_0x5d6baa['output'][_0xbd63('0x63')]()));}})[_0xbd63('0x4c')](handleError(_0x45fd80,null));}; \ No newline at end of file +var _0xe771=['ExtractedReports','UserProfileResource','stack','name','send','index','map','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','ValidationError','download','root','server/files/reports','format','%s.%s','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get'];(function(_0x26934b,_0x2abfb0){var _0x277b99=function(_0x58e441){while(--_0x58e441){_0x26934b['push'](_0x26934b['shift']());}};_0x277b99(++_0x2abfb0);}(_0xe771,0x13f));var _0x1e77=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xe771[_0x3305de];return _0x3b5a84;};'use strict';var emlformat=require(_0x1e77('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e77('0x1'));var jsonpatch=require(_0x1e77('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1e77('0x3'));var Mustache=require(_0x1e77('0x4'));var util=require(_0x1e77('0x5'));var path=require(_0x1e77('0x6'));var sox=require(_0x1e77('0x7'));var csv=require('to-csv');var ejs=require(_0x1e77('0x8'));var fs=require('fs');var fs_extra=require(_0x1e77('0x9'));var _=require(_0x1e77('0xa'));var squel=require(_0x1e77('0xb'));var crypto=require('crypto');var jsforce=require(_0x1e77('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e77('0xd'));var Redis=require(_0x1e77('0xe'));var authService=require(_0x1e77('0xf'));var qs=require(_0x1e77('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1e77('0x11'));var logger=require(_0x1e77('0x12'))('api');var utils=require(_0x1e77('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1e77('0x14'))['db'];function respondWithStatusCode(_0x3f1665,_0xfeea0e){_0xfeea0e=_0xfeea0e||0xcc;return function(_0xafa0cc){if(_0xafa0cc){return _0x3f1665[_0x1e77('0x15')](_0xfeea0e);}return _0x3f1665['status'](_0xfeea0e)[_0x1e77('0x16')]();};}function respondWithResult(_0x486d0f,_0x44c066){_0x44c066=_0x44c066||0xc8;return function(_0x14475f){if(_0x14475f){return _0x486d0f[_0x1e77('0x17')](_0x44c066)[_0x1e77('0x18')](_0x14475f);}};}function respondWithFilteredResult(_0x27cabc,_0x4bf0c3){return function(_0x50374b){if(_0x50374b){var _0x127ba7=typeof _0x4bf0c3[_0x1e77('0x19')]==='undefined'&&typeof _0x4bf0c3['limit']==='undefined';var _0x4bb852=_0x50374b[_0x1e77('0x1a')];var _0x46ab24=_0x127ba7?0x0:_0x4bf0c3[_0x1e77('0x19')];var _0x14f1b8=_0x127ba7?_0x50374b[_0x1e77('0x1a')]:_0x4bf0c3[_0x1e77('0x19')]+_0x4bf0c3[_0x1e77('0x1b')];var _0x16d643;if(_0x14f1b8>=_0x4bb852){_0x14f1b8=_0x4bb852;_0x16d643=0xc8;}else{_0x16d643=0xce;}_0x27cabc[_0x1e77('0x17')](_0x16d643);return _0x27cabc[_0x1e77('0x1c')](_0x1e77('0x1d'),_0x46ab24+'-'+_0x14f1b8+'/'+_0x4bb852)[_0x1e77('0x18')](_0x50374b);}return null;};}function patchUpdates(_0x43a175){return function(_0x197600){try{jsonpatch[_0x1e77('0x1e')](_0x197600,_0x43a175,!![]);}catch(_0x501416){return BPromise[_0x1e77('0x1f')](_0x501416);}return _0x197600[_0x1e77('0x20')]();};}function saveUpdates(_0x567fb0,_0x1c840d){return function(_0xa01a6){if(_0xa01a6){return _0xa01a6[_0x1e77('0x21')](_0x567fb0)[_0x1e77('0x22')](function(_0x514bb5){return _0x514bb5;});}return null;};}function removeEntity(_0x46fa0f,_0xa3d5bb){return function(_0x2422b5){if(_0x2422b5){return _0x2422b5[_0x1e77('0x23')]()[_0x1e77('0x22')](function(){var _0x4c96de=_0x2422b5[_0x1e77('0x24')]({'plain':!![]});var _0x3f9889=_0x1e77('0x25');return db[_0x1e77('0x26')]['destroy']({'where':{'type':_0x3f9889,'resourceId':_0x4c96de['id']}})[_0x1e77('0x22')](function(){return _0x2422b5;});})[_0x1e77('0x22')](function(){_0x46fa0f[_0x1e77('0x17')](0xcc)[_0x1e77('0x16')]();});}};}function handleEntityNotFound(_0x359b52,_0x3b8352){return function(_0x2393ad){if(!_0x2393ad){_0x359b52[_0x1e77('0x15')](0x194);}return _0x2393ad;};}function handleError(_0x33c4ce,_0x4bcf3f){_0x4bcf3f=_0x4bcf3f||0x1f4;return function(_0x3f76eb){logger['error'](_0x3f76eb[_0x1e77('0x27')]);if(_0x3f76eb[_0x1e77('0x28')]){delete _0x3f76eb[_0x1e77('0x28')];}_0x33c4ce['status'](_0x4bcf3f)[_0x1e77('0x29')](_0x3f76eb);};}exports[_0x1e77('0x2a')]=function(_0x964683,_0x21970c){var _0x5f575a={},_0x2becea={},_0x3f8489={'count':0x0,'rows':[]};var _0x316181=_[_0x1e77('0x2b')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x2781f2){return{'name':_0x2781f2[_0x1e77('0x2c')],'type':_0x2781f2['type']['key']};});_0x2becea[_0x1e77('0x2d')]=_[_0x1e77('0x2b')](_0x316181,_0x1e77('0x28'));_0x2becea[_0x1e77('0x2e')]=_[_0x1e77('0x2f')](_0x964683['query']);_0x2becea[_0x1e77('0x30')]=_[_0x1e77('0x31')](_0x2becea['model'],_0x2becea[_0x1e77('0x2e')]);_0x5f575a[_0x1e77('0x32')]=_[_0x1e77('0x31')](_0x2becea[_0x1e77('0x2d')],qs[_0x1e77('0x33')](_0x964683['query'][_0x1e77('0x33')]));_0x5f575a[_0x1e77('0x32')]=_0x5f575a[_0x1e77('0x32')]['length']?_0x5f575a[_0x1e77('0x32')]:_0x2becea[_0x1e77('0x2d')];if(!_0x964683[_0x1e77('0x2e')][_0x1e77('0x34')](_0x1e77('0x35'))){_0x5f575a[_0x1e77('0x1b')]=qs[_0x1e77('0x1b')](_0x964683['query']['limit']);_0x5f575a[_0x1e77('0x19')]=qs[_0x1e77('0x19')](_0x964683['query']['offset']);}_0x5f575a[_0x1e77('0x36')]=qs[_0x1e77('0x37')](_0x964683['query'][_0x1e77('0x37')]);_0x5f575a[_0x1e77('0x38')]=qs['filters'](_['pick'](_0x964683[_0x1e77('0x2e')],_0x2becea[_0x1e77('0x30')]),_0x316181);if(_0x964683[_0x1e77('0x2e')][_0x1e77('0x39')]){_0x5f575a['where']=_[_0x1e77('0x3a')](_0x5f575a[_0x1e77('0x38')],{'$or':_[_0x1e77('0x2b')](_0x316181,function(_0x5ff2a4){if(_0x5ff2a4[_0x1e77('0x3b')]!=='VIRTUAL'){var _0xd753a1={};_0xd753a1[_0x5ff2a4[_0x1e77('0x28')]]={'$like':'%'+_0x964683['query'][_0x1e77('0x39')]+'%'};return _0xd753a1;}})});}_0x5f575a=_[_0x1e77('0x3a')]({},_0x5f575a,_0x964683[_0x1e77('0x3c')]);var _0x446ee5={'where':_0x5f575a[_0x1e77('0x38')]};return db[_0x1e77('0x3d')]['count'](_0x446ee5)['then'](function(_0x2a5c7c){_0x3f8489[_0x1e77('0x1a')]=_0x2a5c7c;if(_0x964683[_0x1e77('0x2e')][_0x1e77('0x3e')]){_0x5f575a[_0x1e77('0x3f')]=[{'all':!![]}];}return db[_0x1e77('0x3d')][_0x1e77('0x40')](_0x5f575a);})[_0x1e77('0x22')](function(_0x5d0a9a){_0x3f8489[_0x1e77('0x41')]=_0x5d0a9a;return _0x3f8489;})[_0x1e77('0x22')](respondWithFilteredResult(_0x21970c,_0x5f575a))[_0x1e77('0x42')](handleError(_0x21970c,null));};exports[_0x1e77('0x43')]=function(_0x47b1b1,_0x4ccedb){var _0x550b2c={'raw':!![],'where':{'id':_0x47b1b1[_0x1e77('0x44')]['id']}},_0x54d5c1={};_0x54d5c1[_0x1e77('0x2d')]=_['keys'](db[_0x1e77('0x3d')][_0x1e77('0x45')]);_0x54d5c1[_0x1e77('0x2e')]=_[_0x1e77('0x2f')](_0x47b1b1[_0x1e77('0x2e')]);_0x54d5c1['filters']=_[_0x1e77('0x31')](_0x54d5c1[_0x1e77('0x2d')],_0x54d5c1[_0x1e77('0x2e')]);_0x550b2c[_0x1e77('0x32')]=_[_0x1e77('0x31')](_0x54d5c1[_0x1e77('0x2d')],qs[_0x1e77('0x33')](_0x47b1b1[_0x1e77('0x2e')]['fields']));_0x550b2c[_0x1e77('0x32')]=_0x550b2c[_0x1e77('0x32')][_0x1e77('0x46')]?_0x550b2c[_0x1e77('0x32')]:_0x54d5c1[_0x1e77('0x2d')];if(_0x47b1b1[_0x1e77('0x2e')]['includeAll']){_0x550b2c[_0x1e77('0x3f')]=[{'all':!![]}];}_0x550b2c=_[_0x1e77('0x3a')]({},_0x550b2c,_0x47b1b1[_0x1e77('0x3c')]);return db[_0x1e77('0x3d')]['find'](_0x550b2c)[_0x1e77('0x22')](handleEntityNotFound(_0x4ccedb,null))[_0x1e77('0x22')](respondWithResult(_0x4ccedb,null))['catch'](handleError(_0x4ccedb,null));};exports['create']=function(_0x3e474b,_0x8736f9){return db[_0x1e77('0x3d')][_0x1e77('0x47')](_0x3e474b[_0x1e77('0x48')],{})[_0x1e77('0x22')](function(_0x3458b0){var _0x29a9cf=_0x3e474b[_0x1e77('0x49')][_0x1e77('0x24')]({'plain':!![]});if(!_0x29a9cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29a9cf['role']===_0x1e77('0x49')){var _0x3830c2=_0x3458b0['get']({'plain':!![]});var _0xc18fbf=_0x1e77('0x25');return db[_0x1e77('0x4a')][_0x1e77('0x4b')]({'where':{'name':_0xc18fbf,'userProfileId':_0x29a9cf[_0x1e77('0x4c')]},'raw':!![]})[_0x1e77('0x22')](function(_0x3a4b36){if(_0x3a4b36&&_0x3a4b36['autoAssociation']===0x0){return db['UserProfileResource'][_0x1e77('0x47')]({'name':_0x3830c2[_0x1e77('0x28')],'resourceId':_0x3830c2['id'],'type':_0x3a4b36['name'],'sectionId':_0x3a4b36['id']},{})[_0x1e77('0x22')](function(){return _0x3458b0;});}else{return _0x3458b0;}})['catch'](function(_0x4984b1){logger['error'](_0x1e77('0x4d'),_0x4984b1);throw _0x4984b1;});}return _0x3458b0;})['then'](respondWithResult(_0x8736f9,0xc9))[_0x1e77('0x42')](handleError(_0x8736f9,null));};exports[_0x1e77('0x21')]=function(_0x8443a8,_0x298c69){if(_0x8443a8[_0x1e77('0x48')]['id']){delete _0x8443a8[_0x1e77('0x48')]['id'];}return db[_0x1e77('0x3d')][_0x1e77('0x4b')]({'where':{'id':_0x8443a8['params']['id']}})[_0x1e77('0x22')](handleEntityNotFound(_0x298c69,null))[_0x1e77('0x22')](saveUpdates(_0x8443a8[_0x1e77('0x48')],null))[_0x1e77('0x22')](respondWithResult(_0x298c69,null))[_0x1e77('0x42')](handleError(_0x298c69,null));};exports[_0x1e77('0x23')]=function(_0x4ff8e8,_0x430d2c){return db[_0x1e77('0x3d')][_0x1e77('0x4b')]({'where':{'id':_0x4ff8e8[_0x1e77('0x44')]['id']}})[_0x1e77('0x22')](handleEntityNotFound(_0x430d2c,null))[_0x1e77('0x22')](removeEntity(_0x430d2c,null))['catch'](handleError(_0x430d2c,null));};exports['download']=function(_0x2be453,_0x5d12c7,_0x503fd1){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x2be453[_0x1e77('0x44')]['id']},'attributes':[_0x1e77('0x28'),_0x1e77('0x4e'),_0x1e77('0x4f'),_0x1e77('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x5d12c7,null))['then'](function(_0x611caa){if(_0x611caa){if(!fs[_0x1e77('0x51')](path[_0x1e77('0x52')](config['root'],'server/files/reports',_0x611caa[_0x1e77('0x4f')]))){throw new db['Sequelize'][(_0x1e77('0x53'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x2be453['query']['exists']){return _0x5d12c7[_0x1e77('0x15')](0xc8);}return _0x5d12c7[_0x1e77('0x54')](path[_0x1e77('0x52')](config[_0x1e77('0x55')],_0x1e77('0x56'),_0x611caa[_0x1e77('0x4f')]),util[_0x1e77('0x57')](_0x1e77('0x58'),_0x611caa['basename']||_0x611caa['name'],_0x611caa[_0x1e77('0x50')]['toLowerCase']()));}})[_0x1e77('0x42')](handleError(_0x5d12c7,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 0b0960f..d11b453 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 _0xcf65=['../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x11821c,_0x384984){var _0x33efeb=function(_0x1d7b7a){while(--_0x1d7b7a){_0x11821c['push'](_0x11821c['shift']());}};_0x33efeb(++_0x384984);}(_0xcf65,0x19c));var _0x5cf6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcf65[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x5cf6('0x0'));var util=require(_0x5cf6('0x1'));var logger=require(_0x5cf6('0x2'))('api');var moment=require(_0x5cf6('0x3'));var BPromise=require(_0x5cf6('0x4'));var rp=require(_0x5cf6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5cf6('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x5cf6('0x7')]=function(_0x221ae9,_0xb5e516){return _0x221ae9[_0x5cf6('0x8')](_0x5cf6('0x9'),attributes,{'tableName':_0x5cf6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd28b=['moment','request-promise','path','rimraf','exports','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd28b,0x6a));var _0xbd28=function(_0x7c7a41,_0x11a170){_0x7c7a41=_0x7c7a41-0x0;var _0x5c09d3=_0xd28b[_0x7c7a41];return _0x5c09d3;};'use strict';var _=require(_0xbd28('0x0'));var util=require(_0xbd28('0x1'));var logger=require(_0xbd28('0x2'))(_0xbd28('0x3'));var moment=require(_0xbd28('0x4'));var BPromise=require('bluebird');var rp=require(_0xbd28('0x5'));var fs=require('fs');var path=require(_0xbd28('0x6'));var rimraf=require(_0xbd28('0x7'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xbd28('0x8')]=function(_0x5a1de8,_0x3eb7cc){return _0x5a1de8['define']('AnalyticExtractedReport',attributes,{'tableName':_0xbd28('0x9'),'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 bcb6f1b..95aed9c 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 _0xe435=['request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x3ed5ba,_0x3bb526){var _0x594959=function(_0x2148ca){while(--_0x2148ca){_0x3ed5ba['push'](_0x3ed5ba['shift']());}};_0x594959(++_0x3bb526);}(_0xe435,0xcf));var _0x5e43=function(_0x591a22,_0x5723fc){_0x591a22=_0x591a22-0x0;var _0xee6035=_0xe435[_0x591a22];return _0xee6035;};'use strict';var _=require(_0x5e43('0x0'));var util=require('util');var moment=require(_0x5e43('0x1'));var BPromise=require(_0x5e43('0x2'));var rs=require(_0x5e43('0x3'));var fs=require('fs');var Redis=require(_0x5e43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e43('0x5'));var logger=require(_0x5e43('0x6'))(_0x5e43('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5e43('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e71a9,_0x28df50,_0x2b416b){return new BPromise(function(_0x373ef0,_0x2a9d32){return client[_0x5e43('0x9')](_0x3e71a9,_0x2b416b)[_0x5e43('0xa')](function(_0x4165cc){logger[_0x5e43('0xb')](_0x5e43('0xc'),_0x28df50,_0x5e43('0xd'));logger['debug'](_0x5e43('0xe'),_0x28df50,_0x5e43('0xd'),JSON[_0x5e43('0xf')](_0x4165cc));if(_0x4165cc['error']){if(_0x4165cc['error'][_0x5e43('0x10')]===0x1f4){logger[_0x5e43('0x11')](_0x5e43('0xc'),_0x28df50,_0x4165cc[_0x5e43('0x11')][_0x5e43('0x12')]);return _0x2a9d32(_0x4165cc['error'][_0x5e43('0x12')]);}logger[_0x5e43('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x28df50,_0x4165cc['error'][_0x5e43('0x12')]);return _0x373ef0(_0x4165cc['error'][_0x5e43('0x12')]);}else{logger[_0x5e43('0xb')](_0x5e43('0xc'),_0x28df50,_0x5e43('0xd'));_0x373ef0(_0x4165cc[_0x5e43('0x13')]['message']);}})['catch'](function(_0x163bbe){logger[_0x5e43('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x28df50,_0x163bbe);_0x2a9d32(_0x163bbe);});});} \ No newline at end of file +var _0xba60=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0xc6a980,_0x5bc46c){var _0x498b97=function(_0x3c13e8){while(--_0x3c13e8){_0xc6a980['push'](_0xc6a980['shift']());}};_0x498b97(++_0x5bc46c);}(_0xba60,0x1d0));var _0x0ba6=function(_0x4dce1f,_0x201548){_0x4dce1f=_0x4dce1f-0x0;var _0x45673a=_0xba60[_0x4dce1f];return _0x45673a;};'use strict';var _=require(_0x0ba6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0ba6('0x1'));var rs=require(_0x0ba6('0x2'));var fs=require('fs');var Redis=require(_0x0ba6('0x3'));var db=require(_0x0ba6('0x4'))['db'];var utils=require(_0x0ba6('0x5'));var logger=require(_0x0ba6('0x6'))(_0x0ba6('0x7'));var config=require(_0x0ba6('0x8'));var jayson=require(_0x0ba6('0x9'));var client=jayson[_0x0ba6('0xa')][_0x0ba6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x181dbf,_0x1f87ee,_0x4b8bfd){return new BPromise(function(_0x16f75a,_0x529bdf){return client[_0x0ba6('0xc')](_0x181dbf,_0x4b8bfd)[_0x0ba6('0xd')](function(_0x4ddb0b){logger['info'](_0x0ba6('0xe'),_0x1f87ee,_0x0ba6('0xf'));logger[_0x0ba6('0x10')](_0x0ba6('0x11'),_0x1f87ee,_0x0ba6('0xf'),JSON[_0x0ba6('0x12')](_0x4ddb0b));if(_0x4ddb0b[_0x0ba6('0x13')]){if(_0x4ddb0b[_0x0ba6('0x13')]['code']===0x1f4){logger[_0x0ba6('0x13')](_0x0ba6('0xe'),_0x1f87ee,_0x4ddb0b[_0x0ba6('0x13')][_0x0ba6('0x14')]);return _0x529bdf(_0x4ddb0b[_0x0ba6('0x13')]['message']);}logger[_0x0ba6('0x13')](_0x0ba6('0xe'),_0x1f87ee,_0x4ddb0b[_0x0ba6('0x13')]['message']);return _0x16f75a(_0x4ddb0b[_0x0ba6('0x13')][_0x0ba6('0x14')]);}else{logger[_0x0ba6('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f87ee,_0x0ba6('0xf'));_0x16f75a(_0x4ddb0b[_0x0ba6('0x16')][_0x0ba6('0x14')]);}})[_0x0ba6('0x17')](function(_0x2b9cc1){logger[_0x0ba6('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f87ee,_0x2b9cc1);_0x529bdf(_0x2b9cc1);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 9a52ffb..17c7a82 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 _0xe32a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','/:id/download','download','post','create','delete','exports','util','path'];(function(_0x39d6a8,_0xc9c91a){var _0x93f3db=function(_0x953b09){while(--_0x953b09){_0x39d6a8['push'](_0x39d6a8['shift']());}};_0x93f3db(++_0xc9c91a);}(_0xe32a,0x11b));var _0xae32=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0xe32a[_0x1b5aea];return _0x51cae9;};'use strict';var multer=require('multer');var util=require(_0xae32('0x0'));var path=require(_0xae32('0x1'));var timeout=require('connect-timeout');var express=require(_0xae32('0x2'));var router=express[_0xae32('0x3')]();var fs_extra=require(_0xae32('0x4'));var auth=require(_0xae32('0x5'));var interaction=require(_0xae32('0x6'));var config=require(_0xae32('0x7'));var controller=require(_0xae32('0x8'));router[_0xae32('0x9')]('/',auth['isAuthenticated'](),controller[_0xae32('0xa')]);router[_0xae32('0x9')](_0xae32('0xb'),auth[_0xae32('0xc')](),controller['show']);router[_0xae32('0x9')](_0xae32('0xd'),auth[_0xae32('0xc')](),controller[_0xae32('0xe')]);router[_0xae32('0xf')]('/',auth[_0xae32('0xc')](),controller[_0xae32('0x10')]);router['put'](_0xae32('0xb'),auth[_0xae32('0xc')](),controller['update']);router[_0xae32('0x11')](_0xae32('0xb'),auth[_0xae32('0xc')](),controller['destroy']);module[_0xae32('0x12')]=router; \ No newline at end of file +var _0x2b14=['fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','download','post','create','put','delete','destroy','util','path','connect-timeout','express'];(function(_0x167a95,_0xe9dd0){var _0x34e5cd=function(_0xbf15ea){while(--_0xbf15ea){_0x167a95['push'](_0x167a95['shift']());}};_0x34e5cd(++_0xe9dd0);}(_0x2b14,0x1e2));var _0x42b1=function(_0x48ec58,_0x291db7){_0x48ec58=_0x48ec58-0x0;var _0x552e7d=_0x2b14[_0x48ec58];return _0x552e7d;};'use strict';var multer=require('multer');var util=require(_0x42b1('0x0'));var path=require(_0x42b1('0x1'));var timeout=require(_0x42b1('0x2'));var express=require(_0x42b1('0x3'));var router=express['Router']();var fs_extra=require(_0x42b1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x42b1('0x5'));var config=require(_0x42b1('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0x42b1('0x7')]('/',auth['isAuthenticated'](),controller[_0x42b1('0x8')]);router[_0x42b1('0x7')](_0x42b1('0x9'),auth[_0x42b1('0xa')](),controller[_0x42b1('0xb')]);router[_0x42b1('0x7')]('/:id/download',auth[_0x42b1('0xa')](),controller[_0x42b1('0xc')]);router[_0x42b1('0xd')]('/',auth[_0x42b1('0xa')](),controller[_0x42b1('0xe')]);router[_0x42b1('0xf')]('/:id',auth[_0x42b1('0xa')](),controller['update']);router[_0x42b1('0x10')](_0x42b1('0x9'),auth[_0x42b1('0xa')](),controller[_0x42b1('0x11')]);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 c6d2ba4..13b68f5 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 _0x6f92=['STRING','BOOLEAN','TEXT'];(function(_0x42039c,_0x3b9912){var _0xeccf5f=function(_0x2a63ab){while(--_0x2a63ab){_0x42039c['push'](_0x42039c['shift']());}};_0xeccf5f(++_0x3b9912);}(_0x6f92,0xf8));var _0x26f9=function(_0x58de45,_0x524cf3){_0x58de45=_0x58de45-0x0;var _0x3dc89c=_0x6f92[_0x58de45];return _0x3dc89c;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0x26f9('0x0')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x26f9('0x1')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x26f9('0x1')]},'custom':{'type':Sequelize[_0x26f9('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x9dd1=['exports','STRING','BOOLEAN','sequelize'];(function(_0xb3936c,_0x304b9c){var _0x4805cd=function(_0x58e5c7){while(--_0x58e5c7){_0xb3936c['push'](_0xb3936c['shift']());}};_0x4805cd(++_0x304b9c);}(_0x9dd1,0x13f));var _0x19dd=function(_0x4bfcbe,_0x4630f5){_0x4bfcbe=_0x4bfcbe-0x0;var _0x5b65e6=_0x9dd1[_0x4bfcbe];return _0x5b65e6;};'use strict';var Sequelize=require(_0x19dd('0x0'));module[_0x19dd('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x19dd('0x2')]},'function':{'type':Sequelize[_0x19dd('0x2')]},'format':{'type':Sequelize[_0x19dd('0x2')]},'groupBy':{'type':Sequelize[_0x19dd('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x19dd('0x2')]},'custom':{'type':Sequelize[_0x19dd('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 4e52bea..af1dd85 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 _0x102a=['ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','bulkCreate','catch','params','bulkDestroy'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x102a,0xae));var _0xa102=function(_0x109d74,_0x525c5f){_0x109d74=_0x109d74-0x0;var _0x1c47a0=_0x102a[_0x109d74];return _0x1c47a0;};'use strict';var emlformat=require(_0xa102('0x0'));var rimraf=require(_0xa102('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa102('0x2'));var rp=require('request-promise');var moment=require(_0xa102('0x3'));var BPromise=require(_0xa102('0x4'));var Mustache=require(_0xa102('0x5'));var util=require(_0xa102('0x6'));var path=require(_0xa102('0x7'));var sox=require(_0xa102('0x8'));var csv=require(_0xa102('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa102('0xa'));var _=require(_0xa102('0xb'));var squel=require(_0xa102('0xc'));var crypto=require(_0xa102('0xd'));var jsforce=require(_0xa102('0xe'));var deskjs=require(_0xa102('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa102('0x10'));var Papa=require(_0xa102('0x11'));var Redis=require('ioredis');var authService=require(_0xa102('0x12'));var qs=require(_0xa102('0x13'));var as=require(_0xa102('0x14'));var hardwareService=require(_0xa102('0x15'));var logger=require(_0xa102('0x16'))(_0xa102('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f3454,_0x3cd1c2){_0x3cd1c2=_0x3cd1c2||0xcc;return function(_0x49608e){if(_0x49608e){return _0x1f3454[_0xa102('0x18')](_0x3cd1c2);}return _0x1f3454[_0xa102('0x19')](_0x3cd1c2)[_0xa102('0x1a')]();};}function respondWithResult(_0x4fb6ba,_0x5ef633){_0x5ef633=_0x5ef633||0xc8;return function(_0x57a2b7){if(_0x57a2b7){return _0x4fb6ba[_0xa102('0x19')](_0x5ef633)['json'](_0x57a2b7);}};}function respondWithFilteredResult(_0x124caf,_0x5c610b){return function(_0x526e12){if(_0x526e12){var _0x2f544c=typeof _0x5c610b[_0xa102('0x1b')]===_0xa102('0x1c')&&typeof _0x5c610b[_0xa102('0x1d')]===_0xa102('0x1c');var _0x2c6081=_0x526e12['count'];var _0x378424=_0x2f544c?0x0:_0x5c610b[_0xa102('0x1b')];var _0x31be11=_0x2f544c?_0x526e12[_0xa102('0x1e')]:_0x5c610b[_0xa102('0x1b')]+_0x5c610b['limit'];var _0x502e76;if(_0x31be11>=_0x2c6081){_0x31be11=_0x2c6081;_0x502e76=0xc8;}else{_0x502e76=0xce;}_0x124caf[_0xa102('0x19')](_0x502e76);return _0x124caf[_0xa102('0x1f')](_0xa102('0x20'),_0x378424+'-'+_0x31be11+'/'+_0x2c6081)[_0xa102('0x21')](_0x526e12);}return null;};}function patchUpdates(_0x683347){return function(_0x3b4127){try{jsonpatch[_0xa102('0x22')](_0x3b4127,_0x683347,!![]);}catch(_0x2fa04c){return BPromise['reject'](_0x2fa04c);}return _0x3b4127[_0xa102('0x23')]();};}function saveUpdates(_0x5afbf7,_0x3eddc1){return function(_0xf27ead){if(_0xf27ead){return _0xf27ead['update'](_0x5afbf7)[_0xa102('0x24')](function(_0x45f171){return _0x45f171;});}return null;};}function removeEntity(_0x459994,_0x5447d0){return function(_0x273597){if(_0x273597){return _0x273597[_0xa102('0x25')]()[_0xa102('0x24')](function(){_0x459994[_0xa102('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26788e,_0x41646f){return function(_0xe58071){if(!_0xe58071){_0x26788e[_0xa102('0x18')](0x194);}return _0xe58071;};}function handleError(_0x5b6ca9,_0x4658b5){_0x4658b5=_0x4658b5||0x1f4;return function(_0xd10bee){logger[_0xa102('0x26')](_0xd10bee[_0xa102('0x27')]);if(_0xd10bee[_0xa102('0x28')]){delete _0xd10bee[_0xa102('0x28')];}_0x5b6ca9[_0xa102('0x19')](_0x4658b5)[_0xa102('0x29')](_0xd10bee);};}exports[_0xa102('0x2a')]=function(_0x555fc8,_0x27bf6e){var _0xb36112={},_0x4d2642={},_0x1eecad={'count':0x0,'rows':[]};var _0x38dbce=_[_0xa102('0x2b')](db[_0xa102('0x2c')]['rawAttributes'],function(_0x2328c2){return{'name':_0x2328c2[_0xa102('0x2d')],'type':_0x2328c2[_0xa102('0x2e')][_0xa102('0x2f')]};});_0x4d2642[_0xa102('0x30')]=_[_0xa102('0x2b')](_0x38dbce,'name');_0x4d2642[_0xa102('0x31')]=_[_0xa102('0x32')](_0x555fc8[_0xa102('0x31')]);_0x4d2642[_0xa102('0x33')]=_['intersection'](_0x4d2642[_0xa102('0x30')],_0x4d2642[_0xa102('0x31')]);_0xb36112[_0xa102('0x34')]=_[_0xa102('0x35')](_0x4d2642[_0xa102('0x30')],qs[_0xa102('0x36')](_0x555fc8[_0xa102('0x31')]['fields']));_0xb36112[_0xa102('0x34')]=_0xb36112[_0xa102('0x34')][_0xa102('0x37')]?_0xb36112[_0xa102('0x34')]:_0x4d2642[_0xa102('0x30')];if(!_0x555fc8[_0xa102('0x31')]['hasOwnProperty'](_0xa102('0x38'))){_0xb36112[_0xa102('0x1d')]=qs['limit'](_0x555fc8[_0xa102('0x31')][_0xa102('0x1d')]);_0xb36112[_0xa102('0x1b')]=qs[_0xa102('0x1b')](_0x555fc8['query'][_0xa102('0x1b')]);}_0xb36112[_0xa102('0x39')]=qs[_0xa102('0x3a')](_0x555fc8[_0xa102('0x31')]['sort']);_0xb36112['where']=qs[_0xa102('0x33')](_[_0xa102('0x3b')](_0x555fc8['query'],_0x4d2642['filters']),_0x38dbce);if(_0x555fc8[_0xa102('0x31')]['filter']){_0xb36112[_0xa102('0x3c')]=_[_0xa102('0x3d')](_0xb36112[_0xa102('0x3c')],{'$or':_['map'](_0x38dbce,function(_0x1309d3){if(_0x1309d3[_0xa102('0x2e')]!==_0xa102('0x3e')){var _0x4340c9={};_0x4340c9[_0x1309d3[_0xa102('0x28')]]={'$like':'%'+_0x555fc8['query'][_0xa102('0x3f')]+'%'};return _0x4340c9;}})});}_0xb36112=_[_0xa102('0x3d')]({},_0xb36112,_0x555fc8[_0xa102('0x40')]);var _0x2f7457={'where':_0xb36112[_0xa102('0x3c')]};return db[_0xa102('0x2c')][_0xa102('0x1e')](_0x2f7457)[_0xa102('0x24')](function(_0x2aa9b9){_0x1eecad[_0xa102('0x1e')]=_0x2aa9b9;if(_0x555fc8[_0xa102('0x31')][_0xa102('0x41')]){_0xb36112[_0xa102('0x42')]=[{'all':!![]}];}return db[_0xa102('0x2c')][_0xa102('0x43')](_0xb36112);})['then'](function(_0x48510a){_0x1eecad[_0xa102('0x44')]=_0x48510a;return _0x1eecad;})[_0xa102('0x24')](respondWithFilteredResult(_0x27bf6e,_0xb36112))['catch'](handleError(_0x27bf6e,null));};exports[_0xa102('0x45')]=function(_0x5ceee0,_0x267087){var _0x2856a2={'raw':![],'where':{'id':_0x5ceee0['params']['id']}},_0x3aa505={};_0x3aa505[_0xa102('0x30')]=_[_0xa102('0x32')](db[_0xa102('0x2c')][_0xa102('0x46')]);_0x3aa505[_0xa102('0x31')]=_[_0xa102('0x32')](_0x5ceee0['query']);_0x3aa505[_0xa102('0x33')]=_[_0xa102('0x35')](_0x3aa505[_0xa102('0x30')],_0x3aa505[_0xa102('0x31')]);_0x2856a2['attributes']=_[_0xa102('0x35')](_0x3aa505[_0xa102('0x30')],qs['fields'](_0x5ceee0[_0xa102('0x31')]['fields']));_0x2856a2[_0xa102('0x34')]=_0x2856a2['attributes'][_0xa102('0x37')]?_0x2856a2[_0xa102('0x34')]:_0x3aa505[_0xa102('0x30')];if(_0x5ceee0[_0xa102('0x31')]['includeAll']){_0x2856a2[_0xa102('0x42')]=[{'all':!![]}];}_0x2856a2=_[_0xa102('0x3d')]({},_0x2856a2,_0x5ceee0['options']);return db[_0xa102('0x2c')][_0xa102('0x47')](_0x2856a2)['then'](handleEntityNotFound(_0x267087,null))[_0xa102('0x24')](respondWithResult(_0x267087,null))['catch'](handleError(_0x267087,null));};exports[_0xa102('0x48')]=function(_0x17dafd,_0x329ea0){return db[_0xa102('0x2c')]['create'](_0x17dafd[_0xa102('0x49')],{})[_0xa102('0x24')](respondWithResult(_0x329ea0,0xc9))['catch'](handleError(_0x329ea0,null));};exports[_0xa102('0x4a')]=function(_0x59e20f,_0x4f86c4){return db[_0xa102('0x2c')][_0xa102('0x4a')](_0x59e20f['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4f86c4,0xc9))[_0xa102('0x4b')](handleError(_0x4f86c4,null));};exports['update']=function(_0x45881f,_0x34a57a){if(_0x45881f[_0xa102('0x49')]['id']){delete _0x45881f['body']['id'];}return db[_0xa102('0x2c')][_0xa102('0x47')]({'where':{'id':_0x45881f['params']['id']}})[_0xa102('0x24')](handleEntityNotFound(_0x34a57a,null))[_0xa102('0x24')](saveUpdates(_0x45881f[_0xa102('0x49')],null))[_0xa102('0x24')](respondWithResult(_0x34a57a,null))[_0xa102('0x4b')](handleError(_0x34a57a,null));};exports[_0xa102('0x25')]=function(_0x290764,_0x4cdae0){return db[_0xa102('0x2c')][_0xa102('0x47')]({'where':{'id':_0x290764[_0xa102('0x4c')]['id']}})[_0xa102('0x24')](handleEntityNotFound(_0x4cdae0,null))[_0xa102('0x24')](removeEntity(_0x4cdae0,null))[_0xa102('0x4b')](handleError(_0x4cdae0,null));};exports[_0xa102('0x4d')]=function(_0x67a017,_0x34c43c){return db['AnalyticFieldReport'][_0xa102('0x25')]({'where':{'id':_0x67a017[_0xa102('0x31')][_0xa102('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xa102('0x24')](respondWithResult(_0x34c43c,0xcc))[_0xa102('0x4b')](handleError(_0x34c43c,null));};exports[_0xa102('0x4f')]=function(_0x567949,_0x46c69c,_0xf037e9){return db[_0xa102('0x50')][_0xa102('0x51')]({'where':{'id':_0x567949[_0xa102('0x4c')]['id']}})[_0xa102('0x24')](handleEntityNotFound(_0x46c69c,null))[_0xa102('0x24')](function(_0x29a02c){if(_0x29a02c){return db['sequelize'][_0xa102('0x52')](function(_0x53e695){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x567949[_0xa102('0x4c')]['id']},'transaction':_0x53e695})[_0xa102('0x24')](function(_0x522363){var _0x3cf53d=_[_0xa102('0x2b')](_0x567949[_0xa102('0x49')],function(_0x578c77){delete _0x578c77['id'];_0x578c77[_0xa102('0x53')]=_0x567949[_0xa102('0x4c')]['id'];return _0x578c77;});return db[_0xa102('0x2c')][_0xa102('0x4a')](_0x3cf53d,{'transaction':_0x53e695});});})[_0xa102('0x24')](function(){return db['AnalyticFieldReport'][_0xa102('0x43')]({'where':{'CustomReportId':_0x567949[_0xa102('0x4c')]['id']}});});}})[_0xa102('0x24')](respondWithResult(_0x46c69c,null))[_0xa102('0x4b')](handleError(_0x46c69c,null));}; \ No newline at end of file +var _0x060a=['limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','bulkCreate','body','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset'];(function(_0x4642e6,_0x59ae62){var _0xa41f5f=function(_0x52aaad){while(--_0x52aaad){_0x4642e6['push'](_0x4642e6['shift']());}};_0xa41f5f(++_0x59ae62);}(_0x060a,0xd3));var _0xa060=function(_0x2de2a8,_0x401bb2){_0x2de2a8=_0x2de2a8-0x0;var _0x354fad=_0x060a[_0x2de2a8];return _0x354fad;};'use strict';var emlformat=require(_0xa060('0x0'));var rimraf=require(_0xa060('0x1'));var zipdir=require(_0xa060('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa060('0x3'));var moment=require(_0xa060('0x4'));var BPromise=require(_0xa060('0x5'));var Mustache=require(_0xa060('0x6'));var util=require('util');var path=require(_0xa060('0x7'));var sox=require(_0xa060('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa060('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa060('0xa'));var Papa=require(_0xa060('0xb'));var Redis=require('ioredis');var authService=require(_0xa060('0xc'));var qs=require(_0xa060('0xd'));var as=require(_0xa060('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa060('0xf'))(_0xa060('0x10'));var utils=require(_0xa060('0x11'));var config=require(_0xa060('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xa060('0x13'))['db'];function respondWithStatusCode(_0x54aec8,_0x124aa2){_0x124aa2=_0x124aa2||0xcc;return function(_0x203d25){if(_0x203d25){return _0x54aec8[_0xa060('0x14')](_0x124aa2);}return _0x54aec8[_0xa060('0x15')](_0x124aa2)['end']();};}function respondWithResult(_0x1f44c9,_0x123815){_0x123815=_0x123815||0xc8;return function(_0x48894a){if(_0x48894a){return _0x1f44c9['status'](_0x123815)['json'](_0x48894a);}};}function respondWithFilteredResult(_0x109c04,_0x2597e7){return function(_0xe01d13){if(_0xe01d13){var _0x4afca4=typeof _0x2597e7[_0xa060('0x16')]==='undefined'&&typeof _0x2597e7[_0xa060('0x17')]===_0xa060('0x18');var _0xcb5a24=_0xe01d13[_0xa060('0x19')];var _0x29d128=_0x4afca4?0x0:_0x2597e7['offset'];var _0x3c8df1=_0x4afca4?_0xe01d13[_0xa060('0x19')]:_0x2597e7[_0xa060('0x16')]+_0x2597e7[_0xa060('0x17')];var _0x43c048;if(_0x3c8df1>=_0xcb5a24){_0x3c8df1=_0xcb5a24;_0x43c048=0xc8;}else{_0x43c048=0xce;}_0x109c04[_0xa060('0x15')](_0x43c048);return _0x109c04[_0xa060('0x1a')](_0xa060('0x1b'),_0x29d128+'-'+_0x3c8df1+'/'+_0xcb5a24)['json'](_0xe01d13);}return null;};}function patchUpdates(_0x33e46c){return function(_0x38bbf4){try{jsonpatch[_0xa060('0x1c')](_0x38bbf4,_0x33e46c,!![]);}catch(_0x40f886){return BPromise[_0xa060('0x1d')](_0x40f886);}return _0x38bbf4[_0xa060('0x1e')]();};}function saveUpdates(_0x426c90,_0x295099){return function(_0x42c1f5){if(_0x42c1f5){return _0x42c1f5[_0xa060('0x1f')](_0x426c90)[_0xa060('0x20')](function(_0x1a863a){return _0x1a863a;});}return null;};}function removeEntity(_0x440161,_0x287c52){return function(_0x92f2a0){if(_0x92f2a0){return _0x92f2a0[_0xa060('0x21')]()[_0xa060('0x20')](function(){_0x440161[_0xa060('0x15')](0xcc)[_0xa060('0x22')]();});}};}function handleEntityNotFound(_0x2bd01f,_0x39038d){return function(_0x35f7bc){if(!_0x35f7bc){_0x2bd01f[_0xa060('0x14')](0x194);}return _0x35f7bc;};}function handleError(_0xe35be,_0x5c9094){_0x5c9094=_0x5c9094||0x1f4;return function(_0xe47c35){logger['error'](_0xe47c35[_0xa060('0x23')]);if(_0xe47c35[_0xa060('0x24')]){delete _0xe47c35[_0xa060('0x24')];}_0xe35be[_0xa060('0x15')](_0x5c9094)[_0xa060('0x25')](_0xe47c35);};}exports['index']=function(_0x25bd51,_0x55e0ef){var _0x20ea50={},_0x2a6e41={},_0x3c326e={'count':0x0,'rows':[]};var _0x2171df=_[_0xa060('0x26')](db[_0xa060('0x27')][_0xa060('0x28')],function(_0xd73dff){return{'name':_0xd73dff[_0xa060('0x29')],'type':_0xd73dff[_0xa060('0x2a')][_0xa060('0x2b')]};});_0x2a6e41[_0xa060('0x2c')]=_[_0xa060('0x26')](_0x2171df,_0xa060('0x24'));_0x2a6e41[_0xa060('0x2d')]=_['keys'](_0x25bd51[_0xa060('0x2d')]);_0x2a6e41['filters']=_['intersection'](_0x2a6e41['model'],_0x2a6e41[_0xa060('0x2d')]);_0x20ea50[_0xa060('0x2e')]=_[_0xa060('0x2f')](_0x2a6e41[_0xa060('0x2c')],qs[_0xa060('0x30')](_0x25bd51[_0xa060('0x2d')][_0xa060('0x30')]));_0x20ea50[_0xa060('0x2e')]=_0x20ea50['attributes'][_0xa060('0x31')]?_0x20ea50[_0xa060('0x2e')]:_0x2a6e41['model'];if(!_0x25bd51[_0xa060('0x2d')][_0xa060('0x32')](_0xa060('0x33'))){_0x20ea50[_0xa060('0x17')]=qs['limit'](_0x25bd51['query']['limit']);_0x20ea50['offset']=qs[_0xa060('0x16')](_0x25bd51[_0xa060('0x2d')][_0xa060('0x16')]);}_0x20ea50[_0xa060('0x34')]=qs[_0xa060('0x35')](_0x25bd51[_0xa060('0x2d')]['sort']);_0x20ea50['where']=qs['filters'](_['pick'](_0x25bd51[_0xa060('0x2d')],_0x2a6e41[_0xa060('0x36')]),_0x2171df);if(_0x25bd51[_0xa060('0x2d')]['filter']){_0x20ea50[_0xa060('0x37')]=_[_0xa060('0x38')](_0x20ea50[_0xa060('0x37')],{'$or':_[_0xa060('0x26')](_0x2171df,function(_0x53da39){if(_0x53da39[_0xa060('0x2a')]!==_0xa060('0x39')){var _0x45cc9a={};_0x45cc9a[_0x53da39[_0xa060('0x24')]]={'$like':'%'+_0x25bd51[_0xa060('0x2d')]['filter']+'%'};return _0x45cc9a;}})});}_0x20ea50=_['merge']({},_0x20ea50,_0x25bd51[_0xa060('0x3a')]);var _0x42da92={'where':_0x20ea50[_0xa060('0x37')]};return db['AnalyticFieldReport'][_0xa060('0x19')](_0x42da92)[_0xa060('0x20')](function(_0x3a9a06){_0x3c326e[_0xa060('0x19')]=_0x3a9a06;if(_0x25bd51['query'][_0xa060('0x3b')]){_0x20ea50[_0xa060('0x3c')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa060('0x3d')](_0x20ea50);})['then'](function(_0x25c145){_0x3c326e[_0xa060('0x3e')]=_0x25c145;return _0x3c326e;})[_0xa060('0x20')](respondWithFilteredResult(_0x55e0ef,_0x20ea50))[_0xa060('0x3f')](handleError(_0x55e0ef,null));};exports[_0xa060('0x40')]=function(_0x35bbc3,_0xa04be4){var _0x11bf6e={'raw':![],'where':{'id':_0x35bbc3[_0xa060('0x41')]['id']}},_0x561cb2={};_0x561cb2['model']=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x561cb2[_0xa060('0x2d')]=_[_0xa060('0x42')](_0x35bbc3[_0xa060('0x2d')]);_0x561cb2[_0xa060('0x36')]=_[_0xa060('0x2f')](_0x561cb2['model'],_0x561cb2[_0xa060('0x2d')]);_0x11bf6e[_0xa060('0x2e')]=_[_0xa060('0x2f')](_0x561cb2[_0xa060('0x2c')],qs[_0xa060('0x30')](_0x35bbc3[_0xa060('0x2d')][_0xa060('0x30')]));_0x11bf6e[_0xa060('0x2e')]=_0x11bf6e[_0xa060('0x2e')][_0xa060('0x31')]?_0x11bf6e[_0xa060('0x2e')]:_0x561cb2[_0xa060('0x2c')];if(_0x35bbc3[_0xa060('0x2d')][_0xa060('0x3b')]){_0x11bf6e['include']=[{'all':!![]}];}_0x11bf6e=_[_0xa060('0x38')]({},_0x11bf6e,_0x35bbc3['options']);return db[_0xa060('0x27')]['find'](_0x11bf6e)[_0xa060('0x20')](handleEntityNotFound(_0xa04be4,null))[_0xa060('0x20')](respondWithResult(_0xa04be4,null))[_0xa060('0x3f')](handleError(_0xa04be4,null));};exports[_0xa060('0x43')]=function(_0x2fa556,_0x3ed026){return db[_0xa060('0x27')][_0xa060('0x43')](_0x2fa556['body'],{})['then'](respondWithResult(_0x3ed026,0xc9))[_0xa060('0x3f')](handleError(_0x3ed026,null));};exports[_0xa060('0x44')]=function(_0x5edf5b,_0x1faf4b){return db['AnalyticFieldReport'][_0xa060('0x44')](_0x5edf5b[_0xa060('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1faf4b,0xc9))[_0xa060('0x3f')](handleError(_0x1faf4b,null));};exports[_0xa060('0x1f')]=function(_0x121175,_0x50c5e4){if(_0x121175[_0xa060('0x45')]['id']){delete _0x121175['body']['id'];}return db['AnalyticFieldReport'][_0xa060('0x46')]({'where':{'id':_0x121175[_0xa060('0x41')]['id']}})['then'](handleEntityNotFound(_0x50c5e4,null))[_0xa060('0x20')](saveUpdates(_0x121175[_0xa060('0x45')],null))['then'](respondWithResult(_0x50c5e4,null))[_0xa060('0x3f')](handleError(_0x50c5e4,null));};exports['destroy']=function(_0x368aec,_0x25f064){return db['AnalyticFieldReport']['find']({'where':{'id':_0x368aec[_0xa060('0x41')]['id']}})[_0xa060('0x20')](handleEntityNotFound(_0x25f064,null))[_0xa060('0x20')](removeEntity(_0x25f064,null))[_0xa060('0x3f')](handleError(_0x25f064,null));};exports[_0xa060('0x47')]=function(_0x393fe2,_0x289225){return db['AnalyticFieldReport'][_0xa060('0x21')]({'where':{'id':_0x393fe2['query'][_0xa060('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x289225,0xcc))[_0xa060('0x3f')](handleError(_0x289225,null));};exports[_0xa060('0x49')]=function(_0x19fa2f,_0x1a9011,_0x25f71c){return db[_0xa060('0x4a')][_0xa060('0x4b')]({'where':{'id':_0x19fa2f['params']['id']}})[_0xa060('0x20')](handleEntityNotFound(_0x1a9011,null))[_0xa060('0x20')](function(_0x2f326a){if(_0x2f326a){return db['sequelize'][_0xa060('0x4c')](function(_0x8f5bf4){return db['AnalyticFieldReport'][_0xa060('0x21')]({'where':{'CustomReportId':_0x19fa2f[_0xa060('0x41')]['id']},'transaction':_0x8f5bf4})['then'](function(_0x1466d2){var _0x217cbe=_['map'](_0x19fa2f[_0xa060('0x45')],function(_0x4323d2){delete _0x4323d2['id'];_0x4323d2[_0xa060('0x4d')]=_0x19fa2f[_0xa060('0x41')]['id'];return _0x4323d2;});return db[_0xa060('0x27')][_0xa060('0x44')](_0x217cbe,{'transaction':_0x8f5bf4});});})[_0xa060('0x20')](function(){return db[_0xa060('0x27')]['findAll']({'where':{'CustomReportId':_0x19fa2f[_0xa060('0x41')]['id']}});});}})[_0xa060('0x20')](respondWithResult(_0x1a9011,null))[_0xa060('0x3f')](handleError(_0x1a9011,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 5260a6d..d635b51 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 _0x4bff=['analytics_report_fields','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x364797,_0x2e97de){var _0x4ebd83=function(_0x8d5dea){while(--_0x8d5dea){_0x364797['push'](_0x364797['shift']());}};_0x4ebd83(++_0x2e97de);}(_0x4bff,0xfe));var _0xf4bf=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x4bff[_0xaa6a4];return _0xdc31a4;};'use strict';var _=require('lodash');var util=require(_0xf4bf('0x0'));var logger=require(_0xf4bf('0x1'))('api');var moment=require(_0xf4bf('0x2'));var BPromise=require(_0xf4bf('0x3'));var rp=require(_0xf4bf('0x4'));var fs=require('fs');var path=require(_0xf4bf('0x5'));var rimraf=require(_0xf4bf('0x6'));var config=require(_0xf4bf('0x7'));var attributes=require(_0xf4bf('0x8'));module[_0xf4bf('0x9')]=function(_0x2c746e,_0x295fb7){return _0x2c746e['define']('AnalyticFieldReport',attributes,{'tableName':_0xf4bf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fe1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x181f0c,_0x54c7c8){var _0x33981d=function(_0x4164e5){while(--_0x4164e5){_0x181f0c['push'](_0x181f0c['shift']());}};_0x33981d(++_0x54c7c8);}(_0x7fe1,0x65));var _0x17fe=function(_0x5268bb,_0x238bb8){_0x5268bb=_0x5268bb-0x0;var _0x124457=_0x7fe1[_0x5268bb];return _0x124457;};'use strict';var _=require(_0x17fe('0x0'));var util=require(_0x17fe('0x1'));var logger=require(_0x17fe('0x2'))(_0x17fe('0x3'));var moment=require(_0x17fe('0x4'));var BPromise=require(_0x17fe('0x5'));var rp=require(_0x17fe('0x6'));var fs=require('fs');var path=require(_0x17fe('0x7'));var rimraf=require(_0x17fe('0x8'));var config=require(_0x17fe('0x9'));var attributes=require(_0x17fe('0xa'));module['exports']=function(_0x1e3769,_0x341405){return _0x1e3769[_0x17fe('0xb')]('AnalyticFieldReport',attributes,{'tableName':_0x17fe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 50fcb88..ceb323b 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 _0x041b=['debug','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x283271,_0x41b3c3){var _0x1f835e=function(_0x2908b0){while(--_0x2908b0){_0x283271['push'](_0x283271['shift']());}};_0x1f835e(++_0x41b3c3);}(_0x041b,0xb7));var _0xb041=function(_0x5b4b88,_0x57012e){_0x5b4b88=_0x5b4b88-0x0;var _0x51d596=_0x041b[_0x5b4b88];return _0x51d596;};'use strict';var _=require(_0xb041('0x0'));var util=require(_0xb041('0x1'));var moment=require(_0xb041('0x2'));var BPromise=require(_0xb041('0x3'));var rs=require(_0xb041('0x4'));var fs=require('fs');var Redis=require(_0xb041('0x5'));var db=require(_0xb041('0x6'))['db'];var utils=require(_0xb041('0x7'));var logger=require(_0xb041('0x8'))(_0xb041('0x9'));var config=require(_0xb041('0xa'));var jayson=require(_0xb041('0xb'));var client=jayson[_0xb041('0xc')][_0xb041('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x185b40,_0x3fceeb,_0x4a2b2f){return new BPromise(function(_0x49063f,_0x4e950a){return client[_0xb041('0xe')](_0x185b40,_0x4a2b2f)[_0xb041('0xf')](function(_0x4849eb){logger['info'](_0xb041('0x10'),_0x3fceeb,'request\x20sent');logger[_0xb041('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x3fceeb,_0xb041('0x12'),JSON['stringify'](_0x4849eb));if(_0x4849eb['error']){if(_0x4849eb[_0xb041('0x13')][_0xb041('0x14')]===0x1f4){logger['error'](_0xb041('0x10'),_0x3fceeb,_0x4849eb['error'][_0xb041('0x15')]);return _0x4e950a(_0x4849eb[_0xb041('0x13')][_0xb041('0x15')]);}logger[_0xb041('0x13')](_0xb041('0x10'),_0x3fceeb,_0x4849eb['error'][_0xb041('0x15')]);return _0x49063f(_0x4849eb[_0xb041('0x13')][_0xb041('0x15')]);}else{logger[_0xb041('0x16')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3fceeb,'request\x20sent');_0x49063f(_0x4849eb[_0xb041('0x17')][_0xb041('0x15')]);}})[_0xb041('0x18')](function(_0x52d40d){logger['error'](_0xb041('0x10'),_0x3fceeb,_0x52d40d);_0x4e950a(_0x52d40d);});});} \ No newline at end of file +var _0x2ca0=['client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x43e11f,_0x196da0){var _0x3c9208=function(_0x179c26){while(--_0x179c26){_0x43e11f['push'](_0x43e11f['shift']());}};_0x3c9208(++_0x196da0);}(_0x2ca0,0x1ab));var _0x02ca=function(_0x2d4c16,_0x1cc64a){_0x2d4c16=_0x2d4c16-0x0;var _0x354ed8=_0x2ca0[_0x2d4c16];return _0x354ed8;};'use strict';var _=require(_0x02ca('0x0'));var util=require(_0x02ca('0x1'));var moment=require(_0x02ca('0x2'));var BPromise=require(_0x02ca('0x3'));var rs=require(_0x02ca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02ca('0x5'))['db'];var utils=require(_0x02ca('0x6'));var logger=require(_0x02ca('0x7'))(_0x02ca('0x8'));var config=require(_0x02ca('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x02ca('0xa')][_0x02ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x445f74,_0x447694,_0x370ba9){return new BPromise(function(_0x2c78bd,_0x3f2e05){return client[_0x02ca('0xc')](_0x445f74,_0x370ba9)['then'](function(_0x2a5faf){logger[_0x02ca('0xd')](_0x02ca('0xe'),_0x447694,_0x02ca('0xf'));logger[_0x02ca('0x10')](_0x02ca('0x11'),_0x447694,_0x02ca('0xf'),JSON['stringify'](_0x2a5faf));if(_0x2a5faf[_0x02ca('0x12')]){if(_0x2a5faf[_0x02ca('0x12')][_0x02ca('0x13')]===0x1f4){logger[_0x02ca('0x12')](_0x02ca('0xe'),_0x447694,_0x2a5faf[_0x02ca('0x12')]['message']);return _0x3f2e05(_0x2a5faf[_0x02ca('0x12')][_0x02ca('0x14')]);}logger['error'](_0x02ca('0xe'),_0x447694,_0x2a5faf[_0x02ca('0x12')]['message']);return _0x2c78bd(_0x2a5faf[_0x02ca('0x12')][_0x02ca('0x14')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x447694,'request\x20sent');_0x2c78bd(_0x2a5faf[_0x02ca('0x15')]['message']);}})[_0x02ca('0x16')](function(_0x40c7c3){logger[_0x02ca('0x12')](_0x02ca('0xe'),_0x447694,_0x40c7c3);_0x3f2e05(_0x40c7c3);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 4100c23..298edfe 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(_0x511dcb,_0x4b9959){var _0x4bb762=function(_0x351a3c){while(--_0x351a3c){_0x511dcb['push'](_0x511dcb['shift']());}};_0x4bb762(++_0x4b9959);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +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(_0x55a9c9,_0x58c8ed){var _0x654f41=function(_0x4b526d){while(--_0x4b526d){_0x55a9c9['push'](_0x55a9c9['shift']());}};_0x654f41(++_0x58c8ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 15aecc2..fc619d0 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 _0xd820=['exports','name','STRING','sequelize'];(function(_0x4bb34c,_0x10b710){var _0x2e7e30=function(_0xe6b477){while(--_0xe6b477){_0x4bb34c['push'](_0x4bb34c['shift']());}};_0x2e7e30(++_0x10b710);}(_0xd820,0x16f));var _0x0d82=function(_0x1db51d,_0x12b986){_0x1db51d=_0x1db51d-0x0;var _0xcf9d61=_0xd820[_0x1db51d];return _0xcf9d61;};'use strict';var Sequelize=require(_0x0d82('0x0'));module[_0x0d82('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0d82('0x2')},'table':{'type':Sequelize[_0x0d82('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbfa6=['sequelize','exports','TEXT','STRING'];(function(_0x2d93a4,_0x3058b5){var _0x184709=function(_0x51fe40){while(--_0x51fe40){_0x2d93a4['push'](_0x2d93a4['shift']());}};_0x184709(++_0x3058b5);}(_0xbfa6,0x1d0));var _0x6bfa=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0xbfa6[_0x215dc8];return _0x583ea3;};'use strict';var Sequelize=require(_0x6bfa('0x0'));module[_0x6bfa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x6bfa('0x2')]},'description':{'type':Sequelize[_0x6bfa('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 71e452f..502756d 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 _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x40188c,_0x11495b){var _0x5b65c5=function(_0x437e51){while(--_0x437e51){_0x40188c['push'](_0x40188c['shift']());}};_0x5b65c5(++_0x11495b);}(_0xdc97,0x13b));var _0x7dc9=function(_0x55c4cf,_0x3653c7){_0x55c4cf=_0x55c4cf-0x0;var _0x33dab6=_0xdc97[_0x55c4cf];return _0x33dab6;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));}; \ No newline at end of file +var _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x53ed59,_0x4beb34){var _0x5834ca=function(_0x5f51f0){while(--_0x5f51f0){_0x53ed59['push'](_0x53ed59['shift']());}};_0x5834ca(++_0x4beb34);}(_0x6aa7,0x178));var _0x76aa=function(_0x3a83f9,_0x3f1464){_0x3a83f9=_0x3a83f9-0x0;var _0x76ebdd=_0x6aa7[_0x3a83f9];return _0x76ebdd;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index b9e488c..34b56eb 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 _0xa49e=['AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0xceb07e,_0x477b78){var _0x13a311=function(_0x351a89){while(--_0x351a89){_0xceb07e['push'](_0xceb07e['shift']());}};_0x13a311(++_0x477b78);}(_0xa49e,0x1de));var _0xea49=function(_0x2a99f1,_0x198fd7){_0x2a99f1=_0x2a99f1-0x0;var _0x6948e5=_0xa49e[_0x2a99f1];return _0x6948e5;};'use strict';var _=require(_0xea49('0x0'));var util=require(_0xea49('0x1'));var logger=require(_0xea49('0x2'))(_0xea49('0x3'));var moment=require(_0xea49('0x4'));var BPromise=require(_0xea49('0x5'));var rp=require(_0xea49('0x6'));var fs=require('fs');var path=require(_0xea49('0x7'));var rimraf=require('rimraf');var config=require(_0xea49('0x8'));var attributes=require(_0xea49('0x9'));module[_0xea49('0xa')]=function(_0x56a45a,_0x1b831c){return _0x56a45a[_0xea49('0xb')](_0xea49('0xc'),attributes,{'tableName':_0xea49('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc569=['../../config/environment','exports','define','analytics_metrics','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x47f01c,_0x599762){var _0x49ba36=function(_0x5772b4){while(--_0x5772b4){_0x47f01c['push'](_0x47f01c['shift']());}};_0x49ba36(++_0x599762);}(_0xc569,0x159));var _0x9c56=function(_0x4fba7f,_0x5c8372){_0x4fba7f=_0x4fba7f-0x0;var _0x5cf430=_0xc569[_0x4fba7f];return _0x5cf430;};'use strict';var _=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var logger=require(_0x9c56('0x2'))('api');var moment=require(_0x9c56('0x3'));var BPromise=require(_0x9c56('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c56('0x5'));var rimraf=require(_0x9c56('0x6'));var config=require(_0x9c56('0x7'));var attributes=require('./analyticMetric.attributes');module[_0x9c56('0x8')]=function(_0x2e2421,_0xe6ba11){return _0x2e2421[_0x9c56('0x9')]('AnalyticMetric',attributes,{'tableName':_0x9c56('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 665670f..91e938c 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 _0x89fc=['error','info','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','AnalyticMetric,\x20%s,\x20%s','message'];(function(_0x4c55d0,_0x54fa46){var _0x190fcf=function(_0x4081f1){while(--_0x4081f1){_0x4c55d0['push'](_0x4c55d0['shift']());}};_0x190fcf(++_0x54fa46);}(_0x89fc,0xb7));var _0xc89f=function(_0x19d9f7,_0x51e52c){_0x19d9f7=_0x19d9f7-0x0;var _0xa75e46=_0x89fc[_0x19d9f7];return _0xa75e46;};'use strict';var _=require('lodash');var util=require(_0xc89f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc89f('0x1'));var db=require(_0xc89f('0x2'))['db'];var utils=require(_0xc89f('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xc89f('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xc89f('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x341cd4,_0x2c0fc0,_0x566f7b){return new BPromise(function(_0x26a390,_0x250d3a){return client[_0xc89f('0x6')](_0x341cd4,_0x566f7b)['then'](function(_0x23a8c3){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x2c0fc0,_0xc89f('0x7'));logger['debug'](_0xc89f('0x8'),_0x2c0fc0,_0xc89f('0x7'),JSON[_0xc89f('0x9')](_0x23a8c3));if(_0x23a8c3['error']){if(_0x23a8c3['error']['code']===0x1f4){logger['error'](_0xc89f('0xa'),_0x2c0fc0,_0x23a8c3['error'][_0xc89f('0xb')]);return _0x250d3a(_0x23a8c3[_0xc89f('0xc')][_0xc89f('0xb')]);}logger[_0xc89f('0xc')](_0xc89f('0xa'),_0x2c0fc0,_0x23a8c3[_0xc89f('0xc')]['message']);return _0x26a390(_0x23a8c3[_0xc89f('0xc')][_0xc89f('0xb')]);}else{logger[_0xc89f('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x2c0fc0,_0xc89f('0x7'));_0x26a390(_0x23a8c3['result']['message']);}})[_0xc89f('0xe')](function(_0x39a6a0){logger[_0xc89f('0xc')](_0xc89f('0xa'),_0x2c0fc0,_0x39a6a0);_0x250d3a(_0x39a6a0);});});} \ No newline at end of file +var _0x03b5=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x03b5,0xa8));var _0x503b=function(_0x35fa36,_0x5980c1){_0x35fa36=_0x35fa36-0x0;var _0x41e61d=_0x03b5[_0x35fa36];return _0x41e61d;};'use strict';var _=require(_0x503b('0x0'));var util=require('util');var moment=require(_0x503b('0x1'));var BPromise=require(_0x503b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x503b('0x3'));var db=require(_0x503b('0x4'))['db'];var utils=require(_0x503b('0x5'));var logger=require(_0x503b('0x6'))('rpc');var config=require(_0x503b('0x7'));var jayson=require(_0x503b('0x8'));var client=jayson[_0x503b('0x9')][_0x503b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9cf4,_0x253361,_0x1a796f){return new BPromise(function(_0x345ddf,_0x19351d){return client['request'](_0x3b9cf4,_0x1a796f)[_0x503b('0xb')](function(_0x8c180c){logger[_0x503b('0xc')](_0x503b('0xd'),_0x253361,'request\x20sent');logger[_0x503b('0xe')](_0x503b('0xf'),_0x253361,_0x503b('0x10'),JSON[_0x503b('0x11')](_0x8c180c));if(_0x8c180c[_0x503b('0x12')]){if(_0x8c180c['error'][_0x503b('0x13')]===0x1f4){logger[_0x503b('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x253361,_0x8c180c[_0x503b('0x12')][_0x503b('0x14')]);return _0x19351d(_0x8c180c[_0x503b('0x12')][_0x503b('0x14')]);}logger[_0x503b('0x12')](_0x503b('0xd'),_0x253361,_0x8c180c[_0x503b('0x12')][_0x503b('0x14')]);return _0x345ddf(_0x8c180c[_0x503b('0x12')][_0x503b('0x14')]);}else{logger[_0x503b('0xc')](_0x503b('0xd'),_0x253361,'request\x20sent');_0x345ddf(_0x8c180c[_0x503b('0x15')][_0x503b('0x14')]);}})[_0x503b('0x16')](function(_0x568125){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x253361,_0x568125);_0x19351d(_0x568125);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index c9935ac..d75670d 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 _0x3248=['Router','fs-extra','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x527783,_0x1c904c){var _0x1f9965=function(_0x584601){while(--_0x584601){_0x527783['push'](_0x527783['shift']());}};_0x1f9965(++_0x1c904c);}(_0x3248,0x1b0));var _0x8324=function(_0x239315,_0x493e51){_0x239315=_0x239315-0x0;var _0x5a11ca=_0x3248[_0x239315];return _0x5a11ca;};'use strict';var multer=require(_0x8324('0x0'));var util=require(_0x8324('0x1'));var path=require(_0x8324('0x2'));var timeout=require(_0x8324('0x3'));var express=require(_0x8324('0x4'));var router=express[_0x8324('0x5')]();var fs_extra=require(_0x8324('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8324('0x7'));var controller=require(_0x8324('0x8'));router['get']('/',auth[_0x8324('0x9')](),controller[_0x8324('0xa')]);router[_0x8324('0xb')](_0x8324('0xc'),auth[_0x8324('0x9')](),controller['show']);router[_0x8324('0xd')]('/',auth[_0x8324('0x9')](),controller[_0x8324('0xe')]);router['put']('/:id',auth[_0x8324('0x9')](),controller[_0x8324('0xf')]);router[_0x8324('0x10')]('/:id',auth[_0x8324('0x9')](),controller[_0x8324('0x11')]);module[_0x8324('0x12')]=router; \ No newline at end of file +var _0x39c7=['put','update','delete','/:id','isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','index','get','show','post','create'];(function(_0x546ab6,_0x357f23){var _0x3952ca=function(_0x29dcfa){while(--_0x29dcfa){_0x546ab6['push'](_0x546ab6['shift']());}};_0x3952ca(++_0x357f23);}(_0x39c7,0x85));var _0x739c=function(_0x2cc548,_0x1c4c49){_0x2cc548=_0x2cc548-0x0;var _0x1e08c3=_0x39c7[_0x2cc548];return _0x1e08c3;};'use strict';var multer=require('multer');var util=require(_0x739c('0x0'));var path=require(_0x739c('0x1'));var timeout=require(_0x739c('0x2'));var express=require(_0x739c('0x3'));var router=express[_0x739c('0x4')]();var fs_extra=require(_0x739c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x739c('0x6'));var config=require(_0x739c('0x7'));var controller=require(_0x739c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x739c('0x9')]);router[_0x739c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x739c('0xb')]);router[_0x739c('0xc')]('/',auth['isAuthenticated'](),controller[_0x739c('0xd')]);router[_0x739c('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x739c('0xf')]);router[_0x739c('0x10')](_0x739c('0x11'),auth[_0x739c('0x12')](),controller[_0x739c('0x13')]);module[_0x739c('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 9e64afb..f54a6fa 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xc9cc=['exports','TEXT','sequelize'];(function(_0x368235,_0x3299b8){var _0x811a55=function(_0x209d01){while(--_0x209d01){_0x368235['push'](_0x368235['shift']());}};_0x811a55(++_0x3299b8);}(_0xc9cc,0xb0));var _0xcc9c=function(_0x52bfa5,_0x42cf21){_0x52bfa5=_0x52bfa5-0x0;var _0x26f80b=_0xc9cc[_0x52bfa5];return _0x26f80b;};'use strict';var Sequelize=require(_0xcc9c('0x0'));module[_0xcc9c('0x1')]={'tree':{'type':Sequelize[_0xcc9c('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 7fe3b01..bb65526 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 _0x9b75=['Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','AnalyticTreeReport','rawAttributes','fieldName','type','key','map','keys','query','filters','model','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','intersection','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set'];(function(_0x4ce46c,_0x3002e5){var _0x132542=function(_0x3e8d5f){while(--_0x3e8d5f){_0x4ce46c['push'](_0x4ce46c['shift']());}};_0x132542(++_0x3002e5);}(_0x9b75,0xb7));var _0x59b7=function(_0x57896d,_0x24f168){_0x57896d=_0x57896d-0x0;var _0x3cba77=_0x9b75[_0x57896d];return _0x3cba77;};'use strict';var emlformat=require(_0x59b7('0x0'));var rimraf=require(_0x59b7('0x1'));var zipdir=require(_0x59b7('0x2'));var jsonpatch=require(_0x59b7('0x3'));var rp=require(_0x59b7('0x4'));var moment=require(_0x59b7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x59b7('0x6'));var path=require(_0x59b7('0x7'));var sox=require(_0x59b7('0x8'));var csv=require(_0x59b7('0x9'));var ejs=require(_0x59b7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x59b7('0xb'));var jsforce=require(_0x59b7('0xc'));var deskjs=require(_0x59b7('0xd'));var toCsv=require(_0x59b7('0x9'));var querystring=require(_0x59b7('0xe'));var Papa=require(_0x59b7('0xf'));var Redis=require(_0x59b7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x59b7('0x11'));var as=require(_0x59b7('0x12'));var hardwareService=require(_0x59b7('0x13'));var logger=require(_0x59b7('0x14'))(_0x59b7('0x15'));var utils=require('../../config/utils');var config=require(_0x59b7('0x16'));var licenseUtil=require(_0x59b7('0x17'));var db=require(_0x59b7('0x18'))['db'];function respondWithStatusCode(_0x1d1943,_0x15a73b){_0x15a73b=_0x15a73b||0xcc;return function(_0x38550a){if(_0x38550a){return _0x1d1943['sendStatus'](_0x15a73b);}return _0x1d1943[_0x59b7('0x19')](_0x15a73b)[_0x59b7('0x1a')]();};}function respondWithResult(_0x5df6cb,_0x111b36){_0x111b36=_0x111b36||0xc8;return function(_0x506a71){if(_0x506a71){return _0x5df6cb[_0x59b7('0x19')](_0x111b36)[_0x59b7('0x1b')](_0x506a71);}};}function respondWithFilteredResult(_0x3ea721,_0x3d26c5){return function(_0x5250b2){if(_0x5250b2){var _0x239e16=typeof _0x3d26c5[_0x59b7('0x1c')]==='undefined'&&typeof _0x3d26c5[_0x59b7('0x1d')]===_0x59b7('0x1e');var _0x49908d=_0x5250b2['count'];var _0x37fe86=_0x239e16?0x0:_0x3d26c5[_0x59b7('0x1c')];var _0x5e2d74=_0x239e16?_0x5250b2[_0x59b7('0x1f')]:_0x3d26c5['offset']+_0x3d26c5['limit'];var _0x3e5930;if(_0x5e2d74>=_0x49908d){_0x5e2d74=_0x49908d;_0x3e5930=0xc8;}else{_0x3e5930=0xce;}_0x3ea721[_0x59b7('0x19')](_0x3e5930);return _0x3ea721[_0x59b7('0x20')](_0x59b7('0x21'),_0x37fe86+'-'+_0x5e2d74+'/'+_0x49908d)[_0x59b7('0x1b')](_0x5250b2);}return null;};}function patchUpdates(_0xa41d6e){return function(_0xa1ca72){try{jsonpatch[_0x59b7('0x22')](_0xa1ca72,_0xa41d6e,!![]);}catch(_0x53b37e){return BPromise[_0x59b7('0x23')](_0x53b37e);}return _0xa1ca72[_0x59b7('0x24')]();};}function saveUpdates(_0x20dd7b,_0x5abb00){return function(_0x510353){if(_0x510353){return _0x510353['update'](_0x20dd7b)[_0x59b7('0x25')](function(_0x11273a){return _0x11273a;});}return null;};}function removeEntity(_0x1d5932,_0x1a2b5e){return function(_0x7487a){if(_0x7487a){return _0x7487a[_0x59b7('0x26')]()[_0x59b7('0x25')](function(){_0x1d5932['status'](0xcc)[_0x59b7('0x1a')]();});}};}function handleEntityNotFound(_0x58ec60,_0x1b8cee){return function(_0xe67379){if(!_0xe67379){_0x58ec60[_0x59b7('0x27')](0x194);}return _0xe67379;};}function handleError(_0x116c53,_0x39f4ca){_0x39f4ca=_0x39f4ca||0x1f4;return function(_0x280223){logger['error'](_0x280223[_0x59b7('0x28')]);if(_0x280223[_0x59b7('0x29')]){delete _0x280223[_0x59b7('0x29')];}_0x116c53[_0x59b7('0x19')](_0x39f4ca)['send'](_0x280223);};}exports['index']=function(_0x34b8e3,_0xbfe23d){var _0x4d0398={},_0x39f600={},_0x298f1d={'count':0x0,'rows':[]};var _0x1e0b30=_['map'](db[_0x59b7('0x2a')][_0x59b7('0x2b')],function(_0x2193cb){return{'name':_0x2193cb[_0x59b7('0x2c')],'type':_0x2193cb[_0x59b7('0x2d')][_0x59b7('0x2e')]};});_0x39f600['model']=_[_0x59b7('0x2f')](_0x1e0b30,_0x59b7('0x29'));_0x39f600['query']=_[_0x59b7('0x30')](_0x34b8e3[_0x59b7('0x31')]);_0x39f600[_0x59b7('0x32')]=_['intersection'](_0x39f600[_0x59b7('0x33')],_0x39f600[_0x59b7('0x31')]);_0x4d0398[_0x59b7('0x34')]=_['intersection'](_0x39f600[_0x59b7('0x33')],qs[_0x59b7('0x35')](_0x34b8e3[_0x59b7('0x31')][_0x59b7('0x35')]));_0x4d0398[_0x59b7('0x34')]=_0x4d0398[_0x59b7('0x34')][_0x59b7('0x36')]?_0x4d0398['attributes']:_0x39f600[_0x59b7('0x33')];if(!_0x34b8e3[_0x59b7('0x31')]['hasOwnProperty'](_0x59b7('0x37'))){_0x4d0398[_0x59b7('0x1d')]=qs[_0x59b7('0x1d')](_0x34b8e3[_0x59b7('0x31')][_0x59b7('0x1d')]);_0x4d0398[_0x59b7('0x1c')]=qs[_0x59b7('0x1c')](_0x34b8e3[_0x59b7('0x31')][_0x59b7('0x1c')]);}_0x4d0398['order']=qs[_0x59b7('0x38')](_0x34b8e3[_0x59b7('0x31')][_0x59b7('0x38')]);_0x4d0398[_0x59b7('0x39')]=qs[_0x59b7('0x32')](_['pick'](_0x34b8e3['query'],_0x39f600[_0x59b7('0x32')]),_0x1e0b30);if(_0x34b8e3[_0x59b7('0x31')][_0x59b7('0x3a')]){_0x4d0398[_0x59b7('0x39')]=_[_0x59b7('0x3b')](_0x4d0398[_0x59b7('0x39')],{'$or':_[_0x59b7('0x2f')](_0x1e0b30,function(_0x376f64){if(_0x376f64[_0x59b7('0x2d')]!==_0x59b7('0x3c')){var _0x3e5783={};_0x3e5783[_0x376f64[_0x59b7('0x29')]]={'$like':'%'+_0x34b8e3[_0x59b7('0x31')][_0x59b7('0x3a')]+'%'};return _0x3e5783;}})});}_0x4d0398=_[_0x59b7('0x3b')]({},_0x4d0398,_0x34b8e3[_0x59b7('0x3d')]);var _0x1d0e59={'where':_0x4d0398[_0x59b7('0x39')]};return db[_0x59b7('0x2a')][_0x59b7('0x1f')](_0x1d0e59)[_0x59b7('0x25')](function(_0x353159){_0x298f1d[_0x59b7('0x1f')]=_0x353159;if(_0x34b8e3[_0x59b7('0x31')]['includeAll']){_0x4d0398[_0x59b7('0x3e')]=[{'all':!![]}];}return db[_0x59b7('0x2a')][_0x59b7('0x3f')](_0x4d0398);})[_0x59b7('0x25')](function(_0x2b546d){_0x298f1d[_0x59b7('0x40')]=_0x2b546d;return _0x298f1d;})[_0x59b7('0x25')](respondWithFilteredResult(_0xbfe23d,_0x4d0398))[_0x59b7('0x41')](handleError(_0xbfe23d,null));};exports['show']=function(_0x46f3fa,_0x37b04a){var _0x55be82={'raw':!![],'where':{'id':_0x46f3fa[_0x59b7('0x42')]['id']}},_0x52cfa0={};_0x52cfa0[_0x59b7('0x33')]=_[_0x59b7('0x30')](db[_0x59b7('0x2a')][_0x59b7('0x2b')]);_0x52cfa0[_0x59b7('0x31')]=_[_0x59b7('0x30')](_0x46f3fa[_0x59b7('0x31')]);_0x52cfa0[_0x59b7('0x32')]=_[_0x59b7('0x43')](_0x52cfa0['model'],_0x52cfa0[_0x59b7('0x31')]);_0x55be82[_0x59b7('0x34')]=_[_0x59b7('0x43')](_0x52cfa0[_0x59b7('0x33')],qs[_0x59b7('0x35')](_0x46f3fa[_0x59b7('0x31')]['fields']));_0x55be82['attributes']=_0x55be82[_0x59b7('0x34')]['length']?_0x55be82[_0x59b7('0x34')]:_0x52cfa0[_0x59b7('0x33')];if(_0x46f3fa[_0x59b7('0x31')][_0x59b7('0x44')]){_0x55be82[_0x59b7('0x3e')]=[{'all':!![]}];}_0x55be82=_[_0x59b7('0x3b')]({},_0x55be82,_0x46f3fa[_0x59b7('0x3d')]);return db[_0x59b7('0x2a')][_0x59b7('0x45')](_0x55be82)[_0x59b7('0x25')](handleEntityNotFound(_0x37b04a,null))[_0x59b7('0x25')](respondWithResult(_0x37b04a,null))[_0x59b7('0x41')](handleError(_0x37b04a,null));};exports[_0x59b7('0x46')]=function(_0x5894f1,_0x508a59){return db[_0x59b7('0x2a')][_0x59b7('0x46')](_0x5894f1[_0x59b7('0x47')],{})[_0x59b7('0x25')](respondWithResult(_0x508a59,0xc9))[_0x59b7('0x41')](handleError(_0x508a59,null));};exports['update']=function(_0x19e82a,_0x587f15){if(_0x19e82a[_0x59b7('0x47')]['id']){delete _0x19e82a['body']['id'];}return db[_0x59b7('0x2a')][_0x59b7('0x45')]({'where':{'id':_0x19e82a[_0x59b7('0x42')]['id']}})[_0x59b7('0x25')](handleEntityNotFound(_0x587f15,null))[_0x59b7('0x25')](saveUpdates(_0x19e82a[_0x59b7('0x47')],null))[_0x59b7('0x25')](respondWithResult(_0x587f15,null))[_0x59b7('0x41')](handleError(_0x587f15,null));};exports[_0x59b7('0x26')]=function(_0x17d0c7,_0x55cb35){return db[_0x59b7('0x2a')][_0x59b7('0x45')]({'where':{'id':_0x17d0c7[_0x59b7('0x42')]['id']}})[_0x59b7('0x25')](handleEntityNotFound(_0x55cb35,null))[_0x59b7('0x25')](removeEntity(_0x55cb35,null))[_0x59b7('0x41')](handleError(_0x55cb35,null));}; \ No newline at end of file +var _0x09c0=['rows','catch','show','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','findAll'];(function(_0x1a6145,_0xfc79cf){var _0x5402f8=function(_0x1ce21e){while(--_0x1ce21e){_0x1a6145['push'](_0x1a6145['shift']());}};_0x5402f8(++_0xfc79cf);}(_0x09c0,0x9b));var _0x009c=function(_0x4a4c4a,_0x4a8c8a){_0x4a4c4a=_0x4a4c4a-0x0;var _0x306cfb=_0x09c0[_0x4a4c4a];return _0x306cfb;};'use strict';var emlformat=require(_0x009c('0x0'));var rimraf=require(_0x009c('0x1'));var zipdir=require(_0x009c('0x2'));var jsonpatch=require(_0x009c('0x3'));var rp=require(_0x009c('0x4'));var moment=require(_0x009c('0x5'));var BPromise=require(_0x009c('0x6'));var Mustache=require(_0x009c('0x7'));var util=require(_0x009c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x009c('0x9'));var ejs=require(_0x009c('0xa'));var fs=require('fs');var fs_extra=require(_0x009c('0xb'));var _=require(_0x009c('0xc'));var squel=require('squel');var crypto=require(_0x009c('0xd'));var jsforce=require(_0x009c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x009c('0x9'));var querystring=require(_0x009c('0xf'));var Papa=require('papaparse');var Redis=require(_0x009c('0x10'));var authService=require(_0x009c('0x11'));var qs=require(_0x009c('0x12'));var as=require(_0x009c('0x13'));var hardwareService=require(_0x009c('0x14'));var logger=require(_0x009c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x009c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcf1eac,_0x330bf2){_0x330bf2=_0x330bf2||0xcc;return function(_0x499c07){if(_0x499c07){return _0xcf1eac[_0x009c('0x17')](_0x330bf2);}return _0xcf1eac[_0x009c('0x18')](_0x330bf2)[_0x009c('0x19')]();};}function respondWithResult(_0xb9581,_0x49d244){_0x49d244=_0x49d244||0xc8;return function(_0x5bbd30){if(_0x5bbd30){return _0xb9581['status'](_0x49d244)['json'](_0x5bbd30);}};}function respondWithFilteredResult(_0x4edbe6,_0x1aba79){return function(_0xe86933){if(_0xe86933){var _0xafdbcf=typeof _0x1aba79['offset']==='undefined'&&typeof _0x1aba79[_0x009c('0x1a')]===_0x009c('0x1b');var _0x29d282=_0xe86933['count'];var _0x1bb36e=_0xafdbcf?0x0:_0x1aba79[_0x009c('0x1c')];var _0x4c168d=_0xafdbcf?_0xe86933[_0x009c('0x1d')]:_0x1aba79[_0x009c('0x1c')]+_0x1aba79[_0x009c('0x1a')];var _0x58f11b;if(_0x4c168d>=_0x29d282){_0x4c168d=_0x29d282;_0x58f11b=0xc8;}else{_0x58f11b=0xce;}_0x4edbe6[_0x009c('0x18')](_0x58f11b);return _0x4edbe6[_0x009c('0x1e')](_0x009c('0x1f'),_0x1bb36e+'-'+_0x4c168d+'/'+_0x29d282)[_0x009c('0x20')](_0xe86933);}return null;};}function patchUpdates(_0x285cfe){return function(_0x27bb6c){try{jsonpatch[_0x009c('0x21')](_0x27bb6c,_0x285cfe,!![]);}catch(_0x1a5dd3){return BPromise[_0x009c('0x22')](_0x1a5dd3);}return _0x27bb6c[_0x009c('0x23')]();};}function saveUpdates(_0x35fb20,_0x4ea441){return function(_0x18e808){if(_0x18e808){return _0x18e808[_0x009c('0x24')](_0x35fb20)[_0x009c('0x25')](function(_0x87c1ae){return _0x87c1ae;});}return null;};}function removeEntity(_0x127747,_0x22947f){return function(_0x3b992e){if(_0x3b992e){return _0x3b992e['destroy']()['then'](function(){_0x127747['status'](0xcc)[_0x009c('0x19')]();});}};}function handleEntityNotFound(_0x2b2cf3,_0x2a99ed){return function(_0x5ed4fb){if(!_0x5ed4fb){_0x2b2cf3[_0x009c('0x17')](0x194);}return _0x5ed4fb;};}function handleError(_0x5126f1,_0x4041cf){_0x4041cf=_0x4041cf||0x1f4;return function(_0x1ef186){logger['error'](_0x1ef186[_0x009c('0x26')]);if(_0x1ef186['name']){delete _0x1ef186[_0x009c('0x27')];}_0x5126f1[_0x009c('0x18')](_0x4041cf)[_0x009c('0x28')](_0x1ef186);};}exports[_0x009c('0x29')]=function(_0x156151,_0x252651){var _0x4c682f={},_0xbdb5c7={},_0x408fc0={'count':0x0,'rows':[]};var _0x254922=_['map'](db[_0x009c('0x2a')][_0x009c('0x2b')],function(_0x4c15fb){return{'name':_0x4c15fb[_0x009c('0x2c')],'type':_0x4c15fb['type'][_0x009c('0x2d')]};});_0xbdb5c7['model']=_['map'](_0x254922,_0x009c('0x27'));_0xbdb5c7[_0x009c('0x2e')]=_['keys'](_0x156151['query']);_0xbdb5c7[_0x009c('0x2f')]=_[_0x009c('0x30')](_0xbdb5c7['model'],_0xbdb5c7[_0x009c('0x2e')]);_0x4c682f[_0x009c('0x31')]=_[_0x009c('0x30')](_0xbdb5c7[_0x009c('0x32')],qs[_0x009c('0x33')](_0x156151[_0x009c('0x2e')][_0x009c('0x33')]));_0x4c682f['attributes']=_0x4c682f['attributes'][_0x009c('0x34')]?_0x4c682f[_0x009c('0x31')]:_0xbdb5c7[_0x009c('0x32')];if(!_0x156151[_0x009c('0x2e')][_0x009c('0x35')]('nolimit')){_0x4c682f['limit']=qs['limit'](_0x156151[_0x009c('0x2e')][_0x009c('0x1a')]);_0x4c682f['offset']=qs[_0x009c('0x1c')](_0x156151[_0x009c('0x2e')][_0x009c('0x1c')]);}_0x4c682f[_0x009c('0x36')]=qs[_0x009c('0x37')](_0x156151[_0x009c('0x2e')][_0x009c('0x37')]);_0x4c682f[_0x009c('0x38')]=qs[_0x009c('0x2f')](_[_0x009c('0x39')](_0x156151[_0x009c('0x2e')],_0xbdb5c7[_0x009c('0x2f')]),_0x254922);if(_0x156151['query'][_0x009c('0x3a')]){_0x4c682f['where']=_[_0x009c('0x3b')](_0x4c682f['where'],{'$or':_['map'](_0x254922,function(_0x6c4e80){if(_0x6c4e80[_0x009c('0x3c')]!=='VIRTUAL'){var _0x129914={};_0x129914[_0x6c4e80[_0x009c('0x27')]]={'$like':'%'+_0x156151[_0x009c('0x2e')][_0x009c('0x3a')]+'%'};return _0x129914;}})});}_0x4c682f=_[_0x009c('0x3b')]({},_0x4c682f,_0x156151[_0x009c('0x3d')]);var _0x40e68a={'where':_0x4c682f[_0x009c('0x38')]};return db[_0x009c('0x2a')]['count'](_0x40e68a)[_0x009c('0x25')](function(_0x445609){_0x408fc0[_0x009c('0x1d')]=_0x445609;if(_0x156151[_0x009c('0x2e')][_0x009c('0x3e')]){_0x4c682f['include']=[{'all':!![]}];}return db[_0x009c('0x2a')][_0x009c('0x3f')](_0x4c682f);})[_0x009c('0x25')](function(_0x2e349b){_0x408fc0[_0x009c('0x40')]=_0x2e349b;return _0x408fc0;})[_0x009c('0x25')](respondWithFilteredResult(_0x252651,_0x4c682f))[_0x009c('0x41')](handleError(_0x252651,null));};exports[_0x009c('0x42')]=function(_0x3e2566,_0xd921c9){var _0x1c5dd2={'raw':!![],'where':{'id':_0x3e2566[_0x009c('0x43')]['id']}},_0x5c2dd5={};_0x5c2dd5[_0x009c('0x32')]=_[_0x009c('0x44')](db[_0x009c('0x2a')][_0x009c('0x2b')]);_0x5c2dd5[_0x009c('0x2e')]=_[_0x009c('0x44')](_0x3e2566[_0x009c('0x2e')]);_0x5c2dd5[_0x009c('0x2f')]=_['intersection'](_0x5c2dd5[_0x009c('0x32')],_0x5c2dd5[_0x009c('0x2e')]);_0x1c5dd2[_0x009c('0x31')]=_[_0x009c('0x30')](_0x5c2dd5[_0x009c('0x32')],qs[_0x009c('0x33')](_0x3e2566[_0x009c('0x2e')][_0x009c('0x33')]));_0x1c5dd2[_0x009c('0x31')]=_0x1c5dd2['attributes'][_0x009c('0x34')]?_0x1c5dd2[_0x009c('0x31')]:_0x5c2dd5[_0x009c('0x32')];if(_0x3e2566['query'][_0x009c('0x3e')]){_0x1c5dd2['include']=[{'all':!![]}];}_0x1c5dd2=_[_0x009c('0x3b')]({},_0x1c5dd2,_0x3e2566['options']);return db[_0x009c('0x2a')][_0x009c('0x45')](_0x1c5dd2)['then'](handleEntityNotFound(_0xd921c9,null))[_0x009c('0x25')](respondWithResult(_0xd921c9,null))[_0x009c('0x41')](handleError(_0xd921c9,null));};exports[_0x009c('0x46')]=function(_0x1e4b15,_0x3ab30f){return db[_0x009c('0x2a')]['create'](_0x1e4b15[_0x009c('0x47')],{})[_0x009c('0x25')](respondWithResult(_0x3ab30f,0xc9))[_0x009c('0x41')](handleError(_0x3ab30f,null));};exports[_0x009c('0x24')]=function(_0x330aee,_0x382282){if(_0x330aee[_0x009c('0x47')]['id']){delete _0x330aee[_0x009c('0x47')]['id'];}return db[_0x009c('0x2a')][_0x009c('0x45')]({'where':{'id':_0x330aee[_0x009c('0x43')]['id']}})[_0x009c('0x25')](handleEntityNotFound(_0x382282,null))[_0x009c('0x25')](saveUpdates(_0x330aee[_0x009c('0x47')],null))['then'](respondWithResult(_0x382282,null))[_0x009c('0x41')](handleError(_0x382282,null));};exports[_0x009c('0x48')]=function(_0x5350d1,_0xdfb0ff){return db[_0x009c('0x2a')][_0x009c('0x45')]({'where':{'id':_0x5350d1[_0x009c('0x43')]['id']}})[_0x009c('0x25')](handleEntityNotFound(_0xdfb0ff,null))['then'](removeEntity(_0xdfb0ff,null))[_0x009c('0x41')](handleError(_0xdfb0ff,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 4196279..4349e6c 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 _0xdde5=['bluebird','rimraf','./analyticTreeReport.attributes','AnalyticTreeReport','../../config/logger'];(function(_0x3cf852,_0x10a67e){var _0xde0a8=function(_0x5979d5){while(--_0x5979d5){_0x3cf852['push'](_0x3cf852['shift']());}};_0xde0a8(++_0x10a67e);}(_0xdde5,0x1bc));var _0x5dde=function(_0x339eaa,_0xbc2f72){_0x339eaa=_0x339eaa-0x0;var _0x4985b6=_0xdde5[_0x339eaa];return _0x4985b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5dde('0x0'))('api');var moment=require('moment');var BPromise=require(_0x5dde('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5dde('0x2'));var config=require('../../config/environment');var attributes=require(_0x5dde('0x3'));module['exports']=function(_0x2032a2,_0x31c22c){return _0x2032a2['define'](_0x5dde('0x4'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cfe=['rimraf','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','path'];(function(_0xb49466,_0xf4af5){var _0x238b07=function(_0x3100ec){while(--_0x3100ec){_0xb49466['push'](_0xb49466['shift']());}};_0x238b07(++_0xf4af5);}(_0x4cfe,0x1e3));var _0xe4cf=function(_0x554786,_0x3ad083){_0x554786=_0x554786-0x0;var _0x50e30d=_0x4cfe[_0x554786];return _0x50e30d;};'use strict';var _=require(_0xe4cf('0x0'));var util=require(_0xe4cf('0x1'));var logger=require('../../config/logger')(_0xe4cf('0x2'));var moment=require(_0xe4cf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4cf('0x4'));var rimraf=require(_0xe4cf('0x5'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x150c06,_0x1b9ad8){return _0x150c06['define'](_0xe4cf('0x6'),attributes,{'tableName':_0xe4cf('0x7'),'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 3822ec6..b4341ef 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x240ff8,_0x347592){_0x240ff8=_0x240ff8-0x0;var _0x5a6e5f=_0x7a54[_0x240ff8];return _0x5a6e5f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x21621b,_0x32bce8){var _0x80eab3=function(_0x3082d0){while(--_0x3082d0){_0x21621b['push'](_0x21621b['shift']());}};_0x80eab3(++_0x32bce8);}(_0x2ef3,0xba));var _0x32ef=function(_0x1fa736,_0x48f936){_0x1fa736=_0x1fa736-0x0;var _0x7eafe0=_0x2ef3[_0x1fa736];return _0x7eafe0;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 2b7cb32..d212a7a 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 _0x8184=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','put','/:id'];(function(_0x320da1,_0x31e289){var _0x1a9db5=function(_0xe83b30){while(--_0xe83b30){_0x320da1['push'](_0x320da1['shift']());}};_0x1a9db5(++_0x31e289);}(_0x8184,0x16b));var _0x4818=function(_0xbc88bc,_0x10ea66){_0xbc88bc=_0xbc88bc-0x0;var _0x548858=_0x8184[_0xbc88bc];return _0x548858;};'use strict';var multer=require(_0x4818('0x0'));var util=require(_0x4818('0x1'));var path=require(_0x4818('0x2'));var timeout=require(_0x4818('0x3'));var express=require(_0x4818('0x4'));var router=express[_0x4818('0x5')]();var fs_extra=require(_0x4818('0x6'));var auth=require(_0x4818('0x7'));var interaction=require(_0x4818('0x8'));var config=require(_0x4818('0x9'));var controller=require('./analyticTreeReport.controller');router[_0x4818('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4818('0xa')]('/:id',auth[_0x4818('0xb')](),controller[_0x4818('0xc')]);router[_0x4818('0xd')]('/',auth[_0x4818('0xb')](),controller[_0x4818('0xe')]);router[_0x4818('0xf')](_0x4818('0x10'),auth[_0x4818('0xb')](),controller[_0x4818('0x11')]);router['delete'](_0x4818('0x10'),auth[_0x4818('0xb')](),controller[_0x4818('0x12')]);module[_0x4818('0x13')]=router; \ No newline at end of file +var _0xc723=['show','post','update','delete','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x45541a,_0x670a10){var _0x3a97e4=function(_0x140e20){while(--_0x140e20){_0x45541a['push'](_0x45541a['shift']());}};_0x3a97e4(++_0x670a10);}(_0xc723,0x104));var _0x3c72=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xc723[_0x243b2f];return _0xcb3c2d;};'use strict';var multer=require(_0x3c72('0x0'));var util=require('util');var path=require(_0x3c72('0x1'));var timeout=require(_0x3c72('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3c72('0x3'));var auth=require(_0x3c72('0x4'));var interaction=require(_0x3c72('0x5'));var config=require(_0x3c72('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x3c72('0x7')]('/',auth[_0x3c72('0x8')](),controller['index']);router['get'](_0x3c72('0x9'),auth['isAuthenticated'](),controller[_0x3c72('0xa')]);router[_0x3c72('0xb')]('/',auth[_0x3c72('0x8')](),controller['create']);router['put']('/:id',auth[_0x3c72('0x8')](),controller[_0x3c72('0xc')]);router[_0x3c72('0xd')](_0x3c72('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x3c72('0xe')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 2107f8a..68b25ef 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 _0xe8f7=['STRING','sequelize'];(function(_0x10af41,_0x4df19f){var _0x33794c=function(_0x23996){while(--_0x23996){_0x10af41['push'](_0x10af41['shift']());}};_0x33794c(++_0x4df19f);}(_0xe8f7,0x137));var _0x7e8f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe8f7[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7e8f('0x0'));module['exports']={'name':{'type':Sequelize[_0x7e8f('0x1')]},'basename':{'type':Sequelize[_0x7e8f('0x1')]},'type':{'type':Sequelize[_0x7e8f('0x1')]}}; \ No newline at end of file +var _0x192f=['sequelize','STRING'];(function(_0x4172b8,_0x3a26f0){var _0x193556=function(_0x33d69c){while(--_0x33d69c){_0x4172b8['push'](_0x4172b8['shift']());}};_0x193556(++_0x3a26f0);}(_0x192f,0xd6));var _0xf192=function(_0x7b5ff9,_0x14d303){_0x7b5ff9=_0x7b5ff9-0x0;var _0x430e50=_0x192f[_0x7b5ff9];return _0x430e50;};'use strict';var Sequelize=require(_0xf192('0x0'));module['exports']={'name':{'type':Sequelize[_0xf192('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf192('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index cfe5f20..ad1eb64 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 _0x2593=['undefined','limit','count','Content-Range','json','apply','update','destroy','then','error','stack','name','send','index','map','Attachment','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','length','includeAll','include','find','rawAttributes','omit','createdAt','updatedAt','body','create','file','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','offline-chat/','download','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset'];(function(_0x29b2d0,_0x73bf4b){var _0x4af937=function(_0x1b19c9){while(--_0x1b19c9){_0x29b2d0['push'](_0x29b2d0['shift']());}};_0x4af937(++_0x73bf4b);}(_0x2593,0x1f3));var _0x3259=function(_0x4fa438,_0x1f15a7){_0x4fa438=_0x4fa438-0x0;var _0x4e3958=_0x2593[_0x4fa438];return _0x4e3958;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3259('0x0'));var zipdir=require(_0x3259('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3259('0x2'));var moment=require('moment');var BPromise=require(_0x3259('0x3'));var Mustache=require(_0x3259('0x4'));var util=require(_0x3259('0x5'));var path=require(_0x3259('0x6'));var sox=require(_0x3259('0x7'));var csv=require(_0x3259('0x8'));var ejs=require(_0x3259('0x9'));var fs=require('fs');var fs_extra=require(_0x3259('0xa'));var _=require(_0x3259('0xb'));var squel=require(_0x3259('0xc'));var crypto=require('crypto');var jsforce=require(_0x3259('0xd'));var deskjs=require(_0x3259('0xe'));var toCsv=require(_0x3259('0x8'));var querystring=require(_0x3259('0xf'));var Papa=require(_0x3259('0x10'));var Redis=require(_0x3259('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3259('0x12'));var as=require(_0x3259('0x13'));var hardwareService=require(_0x3259('0x14'));var logger=require(_0x3259('0x15'))(_0x3259('0x16'));var utils=require(_0x3259('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3259('0x18'));var db=require(_0x3259('0x19'))['db'];function respondWithStatusCode(_0x1ed080,_0x1e3c55){_0x1e3c55=_0x1e3c55||0xcc;return function(_0x5b284d){if(_0x5b284d){return _0x1ed080[_0x3259('0x1a')](_0x1e3c55);}return _0x1ed080[_0x3259('0x1b')](_0x1e3c55)['end']();};}function respondWithResult(_0x1dfeb4,_0x456ee3){_0x456ee3=_0x456ee3||0xc8;return function(_0x23caf8){if(_0x23caf8){return _0x1dfeb4[_0x3259('0x1b')](_0x456ee3)['json'](_0x23caf8);}};}function respondWithFilteredResult(_0x202ca8,_0x4720dd){return function(_0x1db651){if(_0x1db651){var _0x57d2df=typeof _0x4720dd[_0x3259('0x1c')]===_0x3259('0x1d')&&typeof _0x4720dd[_0x3259('0x1e')]===_0x3259('0x1d');var _0x5a152a=_0x1db651[_0x3259('0x1f')];var _0x3508d2=_0x57d2df?0x0:_0x4720dd['offset'];var _0x5e17bf=_0x57d2df?_0x1db651[_0x3259('0x1f')]:_0x4720dd['offset']+_0x4720dd[_0x3259('0x1e')];var _0x32f0cf;if(_0x5e17bf>=_0x5a152a){_0x5e17bf=_0x5a152a;_0x32f0cf=0xc8;}else{_0x32f0cf=0xce;}_0x202ca8['status'](_0x32f0cf);return _0x202ca8['set'](_0x3259('0x20'),_0x3508d2+'-'+_0x5e17bf+'/'+_0x5a152a)[_0x3259('0x21')](_0x1db651);}return null;};}function patchUpdates(_0x5c0df6){return function(_0x5527cd){try{jsonpatch[_0x3259('0x22')](_0x5527cd,_0x5c0df6,!![]);}catch(_0x41a8ba){return BPromise['reject'](_0x41a8ba);}return _0x5527cd['save']();};}function saveUpdates(_0x3617ea,_0x473955){return function(_0x23e893){if(_0x23e893){return _0x23e893[_0x3259('0x23')](_0x3617ea)['then'](function(_0x43cf82){return _0x43cf82;});}return null;};}function removeEntity(_0x2f0e93,_0x41c914){return function(_0x189327){if(_0x189327){return _0x189327[_0x3259('0x24')]()[_0x3259('0x25')](function(){_0x2f0e93[_0x3259('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xac869,_0x3f50d7){return function(_0x54bcc3){if(!_0x54bcc3){_0xac869[_0x3259('0x1a')](0x194);}return _0x54bcc3;};}function handleError(_0x5340bd,_0x31bd03){_0x31bd03=_0x31bd03||0x1f4;return function(_0x38230f){logger[_0x3259('0x26')](_0x38230f[_0x3259('0x27')]);if(_0x38230f[_0x3259('0x28')]){delete _0x38230f[_0x3259('0x28')];}_0x5340bd[_0x3259('0x1b')](_0x31bd03)[_0x3259('0x29')](_0x38230f);};}exports[_0x3259('0x2a')]=function(_0x159a35,_0xb5500){var _0x139094={},_0x20abc6={},_0x4c0b4f={'count':0x0,'rows':[]};var _0x2cbfee=_[_0x3259('0x2b')](db[_0x3259('0x2c')]['rawAttributes'],function(_0x341f7d){return{'name':_0x341f7d[_0x3259('0x2d')],'type':_0x341f7d[_0x3259('0x2e')][_0x3259('0x2f')]};});_0x20abc6[_0x3259('0x30')]=_['map'](_0x2cbfee,_0x3259('0x28'));_0x20abc6['query']=_[_0x3259('0x31')](_0x159a35['query']);_0x20abc6[_0x3259('0x32')]=_[_0x3259('0x33')](_0x20abc6['model'],_0x20abc6[_0x3259('0x34')]);_0x139094[_0x3259('0x35')]=_[_0x3259('0x33')](_0x20abc6[_0x3259('0x30')],qs[_0x3259('0x36')](_0x159a35[_0x3259('0x34')][_0x3259('0x36')]));_0x139094[_0x3259('0x35')]=_0x139094[_0x3259('0x35')]['length']?_0x139094[_0x3259('0x35')]:_0x20abc6[_0x3259('0x30')];if(!_0x159a35[_0x3259('0x34')][_0x3259('0x37')]('nolimit')){_0x139094['limit']=qs[_0x3259('0x1e')](_0x159a35[_0x3259('0x34')][_0x3259('0x1e')]);_0x139094[_0x3259('0x1c')]=qs[_0x3259('0x1c')](_0x159a35[_0x3259('0x34')][_0x3259('0x1c')]);}_0x139094[_0x3259('0x38')]=qs[_0x3259('0x39')](_0x159a35[_0x3259('0x34')][_0x3259('0x39')]);_0x139094[_0x3259('0x3a')]=qs[_0x3259('0x32')](_[_0x3259('0x3b')](_0x159a35[_0x3259('0x34')],_0x20abc6[_0x3259('0x32')]),_0x2cbfee);if(_0x159a35['query'][_0x3259('0x3c')]){_0x139094[_0x3259('0x3a')]=_['merge'](_0x139094[_0x3259('0x3a')],{'$or':_[_0x3259('0x2b')](_0x2cbfee,function(_0x978035){if(_0x978035['type']!==_0x3259('0x3d')){var _0x55dff1={};_0x55dff1[_0x978035[_0x3259('0x28')]]={'$like':'%'+_0x159a35[_0x3259('0x34')][_0x3259('0x3c')]+'%'};return _0x55dff1;}})});}_0x139094=_[_0x3259('0x3e')]({},_0x139094,_0x159a35[_0x3259('0x3f')]);var _0x2abe72={'where':_0x139094['where']};return db[_0x3259('0x2c')][_0x3259('0x1f')](_0x2abe72)[_0x3259('0x25')](function(_0x26ef76){_0x4c0b4f['count']=_0x26ef76;if(_0x159a35['query']['includeAll']){_0x139094['include']=[{'all':!![]}];}return db[_0x3259('0x2c')][_0x3259('0x40')](_0x139094);})[_0x3259('0x25')](function(_0xeb8865){_0x4c0b4f[_0x3259('0x41')]=_0xeb8865;return _0x4c0b4f;})['then'](respondWithFilteredResult(_0xb5500,_0x139094))[_0x3259('0x42')](handleError(_0xb5500,null));};exports[_0x3259('0x43')]=function(_0x3c044f,_0x47e131){var _0x16c7ce={'raw':!![],'where':{'id':_0x3c044f[_0x3259('0x44')]['id']}},_0x438be8={};_0x438be8[_0x3259('0x30')]=_['keys'](db[_0x3259('0x2c')]['rawAttributes']);_0x438be8[_0x3259('0x34')]=_[_0x3259('0x31')](_0x3c044f[_0x3259('0x34')]);_0x438be8['filters']=_[_0x3259('0x33')](_0x438be8['model'],_0x438be8['query']);_0x16c7ce['attributes']=_[_0x3259('0x33')](_0x438be8['model'],qs[_0x3259('0x36')](_0x3c044f[_0x3259('0x34')][_0x3259('0x36')]));_0x16c7ce['attributes']=_0x16c7ce['attributes'][_0x3259('0x45')]?_0x16c7ce[_0x3259('0x35')]:_0x438be8['model'];if(_0x3c044f[_0x3259('0x34')][_0x3259('0x46')]){_0x16c7ce[_0x3259('0x47')]=[{'all':!![]}];}_0x16c7ce=_[_0x3259('0x3e')]({},_0x16c7ce,_0x3c044f[_0x3259('0x3f')]);return db[_0x3259('0x2c')][_0x3259('0x48')](_0x16c7ce)[_0x3259('0x25')](handleEntityNotFound(_0x47e131,null))[_0x3259('0x25')](respondWithResult(_0x47e131,null))[_0x3259('0x42')](handleError(_0x47e131,null));};exports['clone']=function(_0x52c785,_0x58667f){var _0x16d210={'where':{'id':_0x52c785['params']['id']}},_0x507121={};_0x507121[_0x3259('0x30')]=_[_0x3259('0x31')](db[_0x3259('0x2c')][_0x3259('0x49')]);_0x16d210['attributes']=_[_0x3259('0x33')](_0x507121[_0x3259('0x30')],qs[_0x3259('0x36')](_0x52c785[_0x3259('0x34')][_0x3259('0x36')]));_0x16d210[_0x3259('0x35')]=_0x16d210[_0x3259('0x35')][_0x3259('0x45')]?_0x16d210[_0x3259('0x35')]:_0x507121[_0x3259('0x30')];if(_0x52c785['query'][_0x3259('0x46')]){_0x16d210[_0x3259('0x47')]=[{'all':!![]}];}_0x16d210=_[_0x3259('0x3e')]({},_0x16d210,_0x52c785[_0x3259('0x3f')]);return db[_0x3259('0x2c')]['find'](_0x16d210)[_0x3259('0x25')](handleEntityNotFound(_0x58667f,null))['then'](function(_0x4f86a2){if(_0x4f86a2){var _0x3f0316=_0x4f86a2['get']({'plain':!![]});_0x3f0316=qs[_0x3259('0x4a')](_0x3f0316,['id',_0x3259('0x4b'),_0x3259('0x4c')]);_0x52c785[_0x3259('0x4d')]=_['omit'](_0x52c785['body'],['id',_0x3259('0x4b'),'updatedAt']);return db[_0x3259('0x2c')][_0x3259('0x4e')](_['merge'](_0x3f0316,_0x52c785['body']),{'include':_0x52c785[_0x3259('0x34')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x3259('0x25')](respondWithResult(_0x58667f,0xc9))[_0x3259('0x42')](handleError(_0x58667f,null));};exports[_0x3259('0x23')]=function(_0x5787fe,_0x563f27){if(_0x5787fe[_0x3259('0x4d')]['id']){delete _0x5787fe[_0x3259('0x4d')]['id'];}return db['Attachment'][_0x3259('0x48')]({'where':{'id':_0x5787fe[_0x3259('0x44')]['id']}})['then'](handleEntityNotFound(_0x563f27,null))['then'](saveUpdates(_0x5787fe[_0x3259('0x4d')],null))['then'](respondWithResult(_0x563f27,null))[_0x3259('0x42')](handleError(_0x563f27,null));};exports['destroy']=function(_0xccc18a,_0x517de1){return db[_0x3259('0x2c')][_0x3259('0x48')]({'where':{'id':_0xccc18a['params']['id']}})[_0x3259('0x25')](handleEntityNotFound(_0x517de1,null))[_0x3259('0x25')](removeEntity(_0x517de1,null))['catch'](handleError(_0x517de1,null));};exports[_0x3259('0x4e')]=function(_0x41c695,_0x4d643b,_0x548d50){_0x41c695[_0x3259('0x4d')][_0x3259('0x28')]=_0x41c695[_0x3259('0x4f')]['originalname'];_0x41c695[_0x3259('0x4d')][_0x3259('0x50')]=_0x41c695['file'][_0x3259('0x51')];_0x41c695['body'][_0x3259('0x2e')]=_0x41c695['file'][_0x3259('0x52')];return db[_0x3259('0x2c')][_0x3259('0x4e')](_0x41c695['body'])[_0x3259('0x25')](respondWithResult(_0x4d643b,0xc9))['catch'](handleError(_0x4d643b,null));};exports['download']=function(_0x12154a,_0x21c67e,_0xd90681){return db['Attachment'][_0x3259('0x53')]({'where':{'id':_0x12154a[_0x3259('0x44')]['id']},'raw':!![]})[_0x3259('0x25')](handleEntityNotFound(_0x21c67e,null))[_0x3259('0x25')](function(_0x24add4){if(_0x24add4){var _0x3ed40c=_0x24add4[_0x3259('0x54')]!==null;var _0x4c285f=path['join'](config['root'],'server/files/attachments/');if(_0x3ed40c){_0x4c285f=path[_0x3259('0x55')](_0x4c285f,_0x3259('0x56'));}var _0x4d10ab=path['join'](_0x4c285f,_0x24add4['basename']);return _0x21c67e[_0x3259('0x57')](_0x4d10ab);}})[_0x3259('0x42')](handleError(_0x21c67e,null));}; \ No newline at end of file +var _0xef4e=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','then','catch','params','includeAll','find','clone','get','createdAt','body','omit','updatedAt','create','originalname','basename','file','filename','mimetype','findOne','ChatOfflineMessageId','join','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','error','stack','name','Attachment','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length'];(function(_0x481e01,_0x34a470){var _0x4541a9=function(_0x22fb9e){while(--_0x22fb9e){_0x481e01['push'](_0x481e01['shift']());}};_0x4541a9(++_0x34a470);}(_0xef4e,0x1cb));var _0xeef4=function(_0xb4603b,_0x17bae3){_0xb4603b=_0xb4603b-0x0;var _0x599e97=_0xef4e[_0xb4603b];return _0x599e97;};'use strict';var emlformat=require(_0xeef4('0x0'));var rimraf=require(_0xeef4('0x1'));var zipdir=require(_0xeef4('0x2'));var jsonpatch=require(_0xeef4('0x3'));var rp=require(_0xeef4('0x4'));var moment=require(_0xeef4('0x5'));var BPromise=require(_0xeef4('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xeef4('0x7'));var sox=require(_0xeef4('0x8'));var csv=require(_0xeef4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeef4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xeef4('0xb'));var deskjs=require(_0xeef4('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xeef4('0xd'));var Redis=require('ioredis');var authService=require(_0xeef4('0xe'));var qs=require(_0xeef4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeef4('0x10'));var logger=require(_0xeef4('0x11'))(_0xeef4('0x12'));var utils=require(_0xeef4('0x13'));var config=require(_0xeef4('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5eb90b,_0x3d8cf0){_0x3d8cf0=_0x3d8cf0||0xcc;return function(_0x27277c){if(_0x27277c){return _0x5eb90b[_0xeef4('0x15')](_0x3d8cf0);}return _0x5eb90b['status'](_0x3d8cf0)[_0xeef4('0x16')]();};}function respondWithResult(_0x14e9bb,_0x32e89c){_0x32e89c=_0x32e89c||0xc8;return function(_0x46c650){if(_0x46c650){return _0x14e9bb[_0xeef4('0x17')](_0x32e89c)['json'](_0x46c650);}};}function respondWithFilteredResult(_0x17c705,_0x436c82){return function(_0x585e15){if(_0x585e15){var _0xe56f17=typeof _0x436c82[_0xeef4('0x18')]===_0xeef4('0x19')&&typeof _0x436c82[_0xeef4('0x1a')]===_0xeef4('0x19');var _0x352dd7=_0x585e15['count'];var _0x5179c1=_0xe56f17?0x0:_0x436c82[_0xeef4('0x18')];var _0x15a6d8=_0xe56f17?_0x585e15[_0xeef4('0x1b')]:_0x436c82[_0xeef4('0x18')]+_0x436c82[_0xeef4('0x1a')];var _0x3b06ac;if(_0x15a6d8>=_0x352dd7){_0x15a6d8=_0x352dd7;_0x3b06ac=0xc8;}else{_0x3b06ac=0xce;}_0x17c705['status'](_0x3b06ac);return _0x17c705[_0xeef4('0x1c')](_0xeef4('0x1d'),_0x5179c1+'-'+_0x15a6d8+'/'+_0x352dd7)[_0xeef4('0x1e')](_0x585e15);}return null;};}function patchUpdates(_0x19f075){return function(_0x1272fb){try{jsonpatch['apply'](_0x1272fb,_0x19f075,!![]);}catch(_0x557d39){return BPromise['reject'](_0x557d39);}return _0x1272fb[_0xeef4('0x1f')]();};}function saveUpdates(_0x1f2187,_0x32512f){return function(_0x2ae435){if(_0x2ae435){return _0x2ae435[_0xeef4('0x20')](_0x1f2187)['then'](function(_0x3acd4d){return _0x3acd4d;});}return null;};}function removeEntity(_0x5b032e,_0x16650d){return function(_0x5c7efb){if(_0x5c7efb){return _0x5c7efb[_0xeef4('0x21')]()['then'](function(){_0x5b032e[_0xeef4('0x17')](0xcc)[_0xeef4('0x16')]();});}};}function handleEntityNotFound(_0x18d2a0,_0x597595){return function(_0x1ddec9){if(!_0x1ddec9){_0x18d2a0[_0xeef4('0x15')](0x194);}return _0x1ddec9;};}function handleError(_0x96ae4b,_0x1b9816){_0x1b9816=_0x1b9816||0x1f4;return function(_0x139a97){logger[_0xeef4('0x22')](_0x139a97[_0xeef4('0x23')]);if(_0x139a97[_0xeef4('0x24')]){delete _0x139a97[_0xeef4('0x24')];}_0x96ae4b[_0xeef4('0x17')](_0x1b9816)['send'](_0x139a97);};}exports['index']=function(_0x3e541a,_0x5c618b){var _0x8ffb60={},_0x56242a={},_0x227c1d={'count':0x0,'rows':[]};var _0x5213f4=_['map'](db[_0xeef4('0x25')][_0xeef4('0x26')],function(_0x2dbd7b){return{'name':_0x2dbd7b[_0xeef4('0x27')],'type':_0x2dbd7b[_0xeef4('0x28')][_0xeef4('0x29')]};});_0x56242a['model']=_[_0xeef4('0x2a')](_0x5213f4,_0xeef4('0x24'));_0x56242a[_0xeef4('0x2b')]=_[_0xeef4('0x2c')](_0x3e541a['query']);_0x56242a[_0xeef4('0x2d')]=_[_0xeef4('0x2e')](_0x56242a['model'],_0x56242a[_0xeef4('0x2b')]);_0x8ffb60['attributes']=_['intersection'](_0x56242a[_0xeef4('0x2f')],qs[_0xeef4('0x30')](_0x3e541a[_0xeef4('0x2b')][_0xeef4('0x30')]));_0x8ffb60[_0xeef4('0x31')]=_0x8ffb60[_0xeef4('0x31')][_0xeef4('0x32')]?_0x8ffb60[_0xeef4('0x31')]:_0x56242a['model'];if(!_0x3e541a[_0xeef4('0x2b')][_0xeef4('0x33')](_0xeef4('0x34'))){_0x8ffb60[_0xeef4('0x1a')]=qs[_0xeef4('0x1a')](_0x3e541a[_0xeef4('0x2b')]['limit']);_0x8ffb60[_0xeef4('0x18')]=qs[_0xeef4('0x18')](_0x3e541a['query'][_0xeef4('0x18')]);}_0x8ffb60[_0xeef4('0x35')]=qs[_0xeef4('0x36')](_0x3e541a['query'][_0xeef4('0x36')]);_0x8ffb60[_0xeef4('0x37')]=qs[_0xeef4('0x2d')](_[_0xeef4('0x38')](_0x3e541a[_0xeef4('0x2b')],_0x56242a[_0xeef4('0x2d')]),_0x5213f4);if(_0x3e541a[_0xeef4('0x2b')][_0xeef4('0x39')]){_0x8ffb60['where']=_[_0xeef4('0x3a')](_0x8ffb60[_0xeef4('0x37')],{'$or':_[_0xeef4('0x2a')](_0x5213f4,function(_0x251e88){if(_0x251e88[_0xeef4('0x28')]!==_0xeef4('0x3b')){var _0x48c340={};_0x48c340[_0x251e88['name']]={'$like':'%'+_0x3e541a[_0xeef4('0x2b')][_0xeef4('0x39')]+'%'};return _0x48c340;}})});}_0x8ffb60=_[_0xeef4('0x3a')]({},_0x8ffb60,_0x3e541a[_0xeef4('0x3c')]);var _0x557de2={'where':_0x8ffb60[_0xeef4('0x37')]};return db['Attachment'][_0xeef4('0x1b')](_0x557de2)['then'](function(_0x1a1b7f){_0x227c1d[_0xeef4('0x1b')]=_0x1a1b7f;if(_0x3e541a[_0xeef4('0x2b')]['includeAll']){_0x8ffb60[_0xeef4('0x3d')]=[{'all':!![]}];}return db[_0xeef4('0x25')][_0xeef4('0x3e')](_0x8ffb60);})[_0xeef4('0x3f')](function(_0x253fe7){_0x227c1d['rows']=_0x253fe7;return _0x227c1d;})[_0xeef4('0x3f')](respondWithFilteredResult(_0x5c618b,_0x8ffb60))[_0xeef4('0x40')](handleError(_0x5c618b,null));};exports['show']=function(_0x183345,_0x3348db){var _0x2c9d82={'raw':!![],'where':{'id':_0x183345[_0xeef4('0x41')]['id']}},_0x211112={};_0x211112[_0xeef4('0x2f')]=_['keys'](db[_0xeef4('0x25')][_0xeef4('0x26')]);_0x211112[_0xeef4('0x2b')]=_[_0xeef4('0x2c')](_0x183345[_0xeef4('0x2b')]);_0x211112[_0xeef4('0x2d')]=_[_0xeef4('0x2e')](_0x211112[_0xeef4('0x2f')],_0x211112['query']);_0x2c9d82['attributes']=_['intersection'](_0x211112[_0xeef4('0x2f')],qs[_0xeef4('0x30')](_0x183345['query']['fields']));_0x2c9d82[_0xeef4('0x31')]=_0x2c9d82[_0xeef4('0x31')]['length']?_0x2c9d82[_0xeef4('0x31')]:_0x211112[_0xeef4('0x2f')];if(_0x183345['query'][_0xeef4('0x42')]){_0x2c9d82[_0xeef4('0x3d')]=[{'all':!![]}];}_0x2c9d82=_[_0xeef4('0x3a')]({},_0x2c9d82,_0x183345[_0xeef4('0x3c')]);return db[_0xeef4('0x25')][_0xeef4('0x43')](_0x2c9d82)[_0xeef4('0x3f')](handleEntityNotFound(_0x3348db,null))['then'](respondWithResult(_0x3348db,null))[_0xeef4('0x40')](handleError(_0x3348db,null));};exports[_0xeef4('0x44')]=function(_0xc9467a,_0x2263ae){var _0x5875b4={'where':{'id':_0xc9467a[_0xeef4('0x41')]['id']}},_0x28734a={};_0x28734a[_0xeef4('0x2f')]=_['keys'](db[_0xeef4('0x25')][_0xeef4('0x26')]);_0x5875b4[_0xeef4('0x31')]=_[_0xeef4('0x2e')](_0x28734a[_0xeef4('0x2f')],qs[_0xeef4('0x30')](_0xc9467a[_0xeef4('0x2b')][_0xeef4('0x30')]));_0x5875b4['attributes']=_0x5875b4[_0xeef4('0x31')]['length']?_0x5875b4[_0xeef4('0x31')]:_0x28734a[_0xeef4('0x2f')];if(_0xc9467a['query'][_0xeef4('0x42')]){_0x5875b4[_0xeef4('0x3d')]=[{'all':!![]}];}_0x5875b4=_[_0xeef4('0x3a')]({},_0x5875b4,_0xc9467a[_0xeef4('0x3c')]);return db['Attachment'][_0xeef4('0x43')](_0x5875b4)[_0xeef4('0x3f')](handleEntityNotFound(_0x2263ae,null))['then'](function(_0x4e3bcf){if(_0x4e3bcf){var _0x4658ea=_0x4e3bcf[_0xeef4('0x45')]({'plain':!![]});_0x4658ea=qs['omit'](_0x4658ea,['id',_0xeef4('0x46'),'updatedAt']);_0xc9467a[_0xeef4('0x47')]=_[_0xeef4('0x48')](_0xc9467a[_0xeef4('0x47')],['id',_0xeef4('0x46'),_0xeef4('0x49')]);return db['Attachment'][_0xeef4('0x4a')](_[_0xeef4('0x3a')](_0x4658ea,_0xc9467a[_0xeef4('0x47')]),{'include':_0xc9467a['query'][_0xeef4('0x42')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2263ae,0xc9))[_0xeef4('0x40')](handleError(_0x2263ae,null));};exports['update']=function(_0x1d7863,_0x5a1bff){if(_0x1d7863[_0xeef4('0x47')]['id']){delete _0x1d7863['body']['id'];}return db[_0xeef4('0x25')][_0xeef4('0x43')]({'where':{'id':_0x1d7863[_0xeef4('0x41')]['id']}})[_0xeef4('0x3f')](handleEntityNotFound(_0x5a1bff,null))['then'](saveUpdates(_0x1d7863[_0xeef4('0x47')],null))[_0xeef4('0x3f')](respondWithResult(_0x5a1bff,null))['catch'](handleError(_0x5a1bff,null));};exports[_0xeef4('0x21')]=function(_0x4cc96a,_0xd05d7f){return db[_0xeef4('0x25')][_0xeef4('0x43')]({'where':{'id':_0x4cc96a[_0xeef4('0x41')]['id']}})[_0xeef4('0x3f')](handleEntityNotFound(_0xd05d7f,null))[_0xeef4('0x3f')](removeEntity(_0xd05d7f,null))[_0xeef4('0x40')](handleError(_0xd05d7f,null));};exports['create']=function(_0x2b3380,_0x355c10,_0x3413ef){_0x2b3380[_0xeef4('0x47')]['name']=_0x2b3380['file'][_0xeef4('0x4b')];_0x2b3380[_0xeef4('0x47')][_0xeef4('0x4c')]=_0x2b3380[_0xeef4('0x4d')][_0xeef4('0x4e')];_0x2b3380['body'][_0xeef4('0x28')]=_0x2b3380[_0xeef4('0x4d')][_0xeef4('0x4f')];return db[_0xeef4('0x25')][_0xeef4('0x4a')](_0x2b3380[_0xeef4('0x47')])[_0xeef4('0x3f')](respondWithResult(_0x355c10,0xc9))['catch'](handleError(_0x355c10,null));};exports['download']=function(_0x12da7e,_0x5e195d,_0xa8a753){return db[_0xeef4('0x25')][_0xeef4('0x50')]({'where':{'id':_0x12da7e['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5e195d,null))['then'](function(_0x1670f2){if(_0x1670f2){var _0x288eb1=_0x1670f2[_0xeef4('0x51')]!==null;var _0x3bdc04=path[_0xeef4('0x52')](config['root'],'server/files/attachments/');if(_0x288eb1){_0x3bdc04=path[_0xeef4('0x52')](_0x3bdc04,_0xeef4('0x53'));}var _0x18360d=path[_0xeef4('0x52')](_0x3bdc04,_0x1670f2[_0xeef4('0x4c')]);return _0x5e195d[_0xeef4('0x54')](_0x18360d);}})['catch'](handleError(_0x5e195d,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 019cd35..6e2ffaf 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 _0xd033=['attachments','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','Attachment'];(function(_0x314079,_0x2b98a0){var _0x423351=function(_0x501dcc){while(--_0x501dcc){_0x314079['push'](_0x314079['shift']());}};_0x423351(++_0x2b98a0);}(_0xd033,0xb5));var _0x3d03=function(_0x4c2623,_0x4838bb){_0x4c2623=_0x4c2623-0x0;var _0x2be431=_0xd033[_0x4c2623];return _0x2be431;};'use strict';var _=require(_0x3d03('0x0'));var util=require(_0x3d03('0x1'));var logger=require(_0x3d03('0x2'))(_0x3d03('0x3'));var moment=require('moment');var BPromise=require(_0x3d03('0x4'));var rp=require(_0x3d03('0x5'));var fs=require('fs');var path=require(_0x3d03('0x6'));var rimraf=require('rimraf');var config=require(_0x3d03('0x7'));var attributes=require(_0x3d03('0x8'));module[_0x3d03('0x9')]=function(_0x3738df,_0x4b672f){return _0x3738df['define'](_0x3d03('0xa'),attributes,{'tableName':_0x3d03('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18cd=['define','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x3ee1fe,_0x59f2a1){var _0x1ae57a=function(_0x1ef0c4){while(--_0x1ef0c4){_0x3ee1fe['push'](_0x3ee1fe['shift']());}};_0x1ae57a(++_0x59f2a1);}(_0x18cd,0x141));var _0xd18c=function(_0x561e54,_0x53296b){_0x561e54=_0x561e54-0x0;var _0x1db581=_0x18cd[_0x561e54];return _0x1db581;};'use strict';var _=require('lodash');var util=require(_0xd18c('0x0'));var logger=require(_0xd18c('0x1'))(_0xd18c('0x2'));var moment=require('moment');var BPromise=require(_0xd18c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd18c('0x4'));var rimraf=require(_0xd18c('0x5'));var config=require(_0xd18c('0x6'));var attributes=require(_0xd18c('0x7'));module[_0xd18c('0x8')]=function(_0x706334,_0x4a92c6){return _0x706334[_0xd18c('0x9')]('Attachment',attributes,{'tableName':'attachments','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 dead461..9b80cd5 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 _0x4c6d=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','then'];(function(_0x36f807,_0x13d5dc){var _0x1ba824=function(_0x571eb7){while(--_0x571eb7){_0x36f807['push'](_0x36f807['shift']());}};_0x1ba824(++_0x13d5dc);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x104d7a,_0x5d9d6b){_0x104d7a=_0x104d7a-0x0;var _0x14e6de=_0x4c6d[_0x104d7a];return _0x14e6de;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var moment=require(_0xd4c6('0x2'));var BPromise=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c6('0x5'))['db'];var utils=require(_0xd4c6('0x6'));var logger=require(_0xd4c6('0x7'))('rpc');var config=require(_0xd4c6('0x8'));var jayson=require(_0xd4c6('0x9'));var client=jayson['client'][_0xd4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316314,_0x4329e3,_0x5d4fce){return new BPromise(function(_0x440ee3,_0x19ce1c){return client[_0xd4c6('0xb')](_0x316314,_0x5d4fce)['then'](function(_0xe2f90b){logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,'request\x20sent');logger[_0xd4c6('0xe')](_0xd4c6('0xf'),_0x4329e3,_0xd4c6('0x10'),JSON[_0xd4c6('0x11')](_0xe2f90b));if(_0xe2f90b[_0xd4c6('0x12')]){if(_0xe2f90b[_0xd4c6('0x12')]['code']===0x1f4){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b['error'][_0xd4c6('0x13')]);return _0x19ce1c(_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);}logger[_0xd4c6('0x12')](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);return _0x440ee3(_0xe2f90b['error']['message']);}else{logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,_0xd4c6('0x10'));_0x440ee3(_0xe2f90b[_0xd4c6('0x14')][_0xd4c6('0x13')]);}})[_0xd4c6('0x15')](function(_0xe52075){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe52075);_0x19ce1c(_0xe52075);});});}exports[_0xd4c6('0x16')]=function(_0x23a16f){var _0x2c97b=this;return new Promise(function(_0x31f328,_0x54e0a5){return db[_0xd4c6('0x17')][_0xd4c6('0x18')](_0x23a16f[_0xd4c6('0x19')],{'raw':_0x23a16f['options']?_0x23a16f[_0xd4c6('0x1a')][_0xd4c6('0x1b')]===undefined?!![]:![]:!![]})[_0xd4c6('0x1c')](function(_0x3b1658){logger['info'](_0xd4c6('0x16'),_0x23a16f);logger['debug'](_0xd4c6('0x16'),_0x23a16f,JSON[_0xd4c6('0x11')](_0x3b1658));_0x31f328(_0x3b1658);})[_0xd4c6('0x15')](function(_0x222813){logger[_0xd4c6('0x12')](_0xd4c6('0x16'),_0x222813[_0xd4c6('0x13')],_0x23a16f);_0x54e0a5(_0x2c97b[_0xd4c6('0x12')](0x1f4,_0x222813[_0xd4c6('0x13')]));});});}; \ No newline at end of file +var _0x3ee5=['body','options','raw','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','create'];(function(_0x1af49c,_0x2c2a4f){var _0x49fe00=function(_0x3d56aa){while(--_0x3d56aa){_0x1af49c['push'](_0x1af49c['shift']());}};_0x49fe00(++_0x2c2a4f);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x44e8d4,_0x1f12ec){_0x44e8d4=_0x44e8d4-0x0;var _0x5ab4b1=_0x3ee5[_0x44e8d4];return _0x5ab4b1;};'use strict';var _=require('lodash');var util=require(_0x53ee('0x0'));var moment=require(_0x53ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x53ee('0x2'));var fs=require('fs');var Redis=require(_0x53ee('0x3'));var db=require(_0x53ee('0x4'))['db'];var utils=require(_0x53ee('0x5'));var logger=require(_0x53ee('0x6'))(_0x53ee('0x7'));var config=require(_0x53ee('0x8'));var jayson=require(_0x53ee('0x9'));var client=jayson[_0x53ee('0xa')][_0x53ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3173b2,_0x48bc62,_0x299b23){return new BPromise(function(_0x235c9f,_0x1ec296){return client[_0x53ee('0xc')](_0x3173b2,_0x299b23)[_0x53ee('0xd')](function(_0x3b1252){logger[_0x53ee('0xe')](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));logger[_0x53ee('0x11')](_0x53ee('0x12'),_0x48bc62,_0x53ee('0x10'),JSON['stringify'](_0x3b1252));if(_0x3b1252['error']){if(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x14')]===0x1f4){logger[_0x53ee('0x13')](_0x53ee('0xf'),_0x48bc62,_0x3b1252[_0x53ee('0x13')]['message']);return _0x1ec296(_0x3b1252['error'][_0x53ee('0x15')]);}logger[_0x53ee('0x13')]('Attachment,\x20%s,\x20%s',_0x48bc62,_0x3b1252['error'][_0x53ee('0x15')]);return _0x235c9f(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x15')]);}else{logger['info'](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));_0x235c9f(_0x3b1252[_0x53ee('0x16')][_0x53ee('0x15')]);}})[_0x53ee('0x17')](function(_0x2fb3cd){logger['error'](_0x53ee('0xf'),_0x48bc62,_0x2fb3cd);_0x1ec296(_0x2fb3cd);});});}exports[_0x53ee('0x18')]=function(_0x3d788e){var _0x17c3cb=this;return new Promise(function(_0x708604,_0x29a4b4){return db[_0x53ee('0x19')][_0x53ee('0x1a')](_0x3d788e[_0x53ee('0x1b')],{'raw':_0x3d788e[_0x53ee('0x1c')]?_0x3d788e[_0x53ee('0x1c')][_0x53ee('0x1d')]===undefined?!![]:![]:!![]})[_0x53ee('0xd')](function(_0x2cbd98){logger['info'](_0x53ee('0x18'),_0x3d788e);logger['debug']('CreateAttachment',_0x3d788e,JSON[_0x53ee('0x1e')](_0x2cbd98));_0x708604(_0x2cbd98);})[_0x53ee('0x17')](function(_0x4105d6){logger['error'](_0x53ee('0x18'),_0x4105d6[_0x53ee('0x15')],_0x3d788e);_0x29a4b4(_0x17c3cb[_0x53ee('0x13')](0x1f4,_0x4105d6[_0x53ee('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 8d438a7..1215b09 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0x0b0e[_0x2fd69d];return _0x5d5ef3;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file +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(_0x1f46a3,_0x5ab5f3){var _0x885ba2=function(_0xceb9b1){while(--_0xceb9b1){_0x1f46a3['push'](_0x1f46a3['shift']());}};_0x885ba2(++_0x5ab5f3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4e64b5,_0x2a314a){_0x4e64b5=_0x4e64b5-0x0;var _0x37d275=_0x5f2f[_0x4e64b5];return _0x37d275;};'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/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 4c939f0..dbf7e06 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2865=['getLicense','catch','status','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','Strategy','moment','bluebird','util','../../config/utils','../../config/environment','../../config/logger','api','undefined','baseDN','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','activedirectory','add','minutes','clearBlockUser'];(function(_0x81b5b2,_0x425bbd){var _0x9abf13=function(_0x1b9fc5){while(--_0x1b9fc5){_0x81b5b2['push'](_0x81b5b2['shift']());}};_0x9abf13(++_0x425bbd);}(_0x2865,0xbe));var _0x5286=function(_0x4f6105,_0x22cf95){_0x4f6105=_0x4f6105-0x0;var _0x4b1e2a=_0x2865[_0x4f6105];return _0x4b1e2a;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0x5286('0x0')];var moment=require(_0x5286('0x1'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x5286('0x2'));var util=require(_0x5286('0x3'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x5286('0x4'));var config=require(_0x5286('0x5'));var logger=require(_0x5286('0x6'))(_0x5286('0x7'));function isActiveDirectoryConfigured(_0xe36903){var _0x11e710=![];if(typeof _0xe36903['activedirectory']!==_0x5286('0x8')){_0x11e710=_0xe36903['activedirectory'][_0x5286('0x9')]&&_0xe36903['activedirectory']['url']&&_0xe36903['activedirectory'][_0x5286('0xa')];}return _0x11e710;}function adAuthenticate(_0x2ea76c,_0x1c63ad,_0x5d2de2){return new BPromise(function(_0x28da6c,_0x1e88ed){try{var _0x663bae=new ActiveDirectory(_0x2ea76c);_0x663bae[_0x5286('0xb')](_0x1c63ad,_0x5d2de2,function(_0x16bee6,_0x530a16){if(_0x16bee6){logger['error'](_0x5286('0xc'),_0x1c63ad,util['inspect'](_0x16bee6,{'showHidden':![],'depth':null}));_0x1e88ed('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x530a16){logger['error'](_0x5286('0xd'),_0x1c63ad);_0x1e88ed(_0x5286('0xe'));}else{_0x28da6c(_0x530a16);}});}catch(_0x21c879){_0x1e88ed(_0x21c879);}});}function ActiveDirectoryAuthenticate(_0x5c6720,_0x132671,_0x1f68ca,_0x5d3a16){var _0x2f4710,_0x4a3c35;if(!isActiveDirectoryConfigured(config)){logger[_0x5286('0xf')](_0x5286('0x10'),_0x132671);return _0x5d3a16(null,![],{'message':_0x5286('0xe')});}return db['Setting'][_0x5286('0x11')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x5286('0x12')],'raw':!![]})[_0x5286('0x13')](function(_0x18f982){_0x2f4710=_0x18f982;if(!_0x2f4710[_0x5286('0x14')]){logger[_0x5286('0xf')](_0x5286('0x15'),_0x132671);throw new Error(_0x5286('0xe'));}return _0x5c6720['findOne']({'attributes':['id',_0x5286('0x16'),_0x5286('0x17'),_0x5286('0x18'),_0x5286('0x19'),_0x5286('0x1a'),_0x5286('0x1b'),_0x5286('0x1c'),'online'],'where':{'name':_0x132671,'role':{'$or':[_0x5286('0x1d'),'user',_0x5286('0x1e')]},'adSsoEnabled':!![]}});})['then'](function(_0x3b443b){if(!_0x3b443b||_0x3b443b&&_0x3b443b['name']!==_0x132671){throw new Error(_0x5286('0xe'));}_0x4a3c35=_0x3b443b;var _0x2132de=_0x4a3c35[_0x5286('0x16')]+'@'+config[_0x5286('0x1f')][_0x5286('0xa')];return adAuthenticate(config['activedirectory'],_0x2132de,_0x1f68ca);})[_0x5286('0x13')](function(_0x2cdd1f){if(_0x4a3c35[_0x5286('0x1a')]){throw new Error(_0x5286('0xe'));}if(_0x2f4710['blockDuration']>0x0){if(_0x4a3c35[_0x5286('0x1b')]){if(moment(_0x4a3c35[_0x5286('0x1c')])[_0x5286('0x20')](_0x2f4710['blockDuration'],_0x5286('0x21'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x5286('0x22')](_0x4a3c35,0x0,![],null)['then'](function(){return utils['getLicense'](_0x4a3c35);})[_0x5286('0x13')](function(){return _0x5d3a16(null,_0x4a3c35);});}else{return utils[_0x5286('0x23')](_0x4a3c35)['then'](function(){return _0x5d3a16(null,_0x4a3c35);});}}else{return utils['getLicense'](_0x4a3c35)[_0x5286('0x13')](function(){return _0x5d3a16(null,_0x4a3c35);});}})[_0x5286('0x24')](function(_0x2558e6){return _0x5d3a16(null,![],_0x2558e6);});}function handleError(_0xfd4f85,_0x1a6d2a,_0x312ca0){return _0xfd4f85[_0x5286('0x25')](_0x1a6d2a||0x1f4)['send']({'message':_0x312ca0?_0x312ca0[_0x5286('0x26')]||_0x312ca0:''});}exports['login']=function(_0x3fa253,_0x36ad27,_0x4396fc){passport[_0x5286('0xb')](_0x5286('0x27'),function(_0x29c4ce,_0x2bc61a,_0x4c5d5d){var _0x15db9d=_0x29c4ce||_0x4c5d5d;if(_0x15db9d){return handleError(_0x36ad27,0x191,_0x15db9d);}if(!_0x2bc61a){return handleError(_0x36ad27,0x194,{'message':_0x5286('0x28')});}else{var _0x16330b={'payload':{'id':_0x2bc61a['id'],'role':_0x2bc61a[_0x5286('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x16330b)[_0x5286('0x13')](function(_0x2af629){_0x36ad27[_0x5286('0x29')]({'id':_0x2bc61a['id'],'token':_0x2af629,'statusCall':'','isAlreadyLogged':_0x2bc61a[_0x5286('0x2a')]});});}})(_0x3fa253,_0x36ad27,_0x4396fc);};passport[_0x5286('0x2b')](_0x5286('0x27'),new LocalStrategy({'usernameField':'name','passwordField':_0x5286('0x17')},function(_0x9738d4,_0x45b221,_0x3fd0f6){return ActiveDirectoryAuthenticate(db[_0x5286('0x2c')],_0x9738d4,_0x45b221,_0x3fd0f6);})); \ No newline at end of file +var _0x2ce0=['error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','password','salt','blocked','blockedAt','online','admin','user','agent','name','domain','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','ad-login','passport','passport-local','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','authenticate'];(function(_0x3eb5f6,_0x15de8e){var _0x12775a=function(_0x1cb494){while(--_0x1cb494){_0x3eb5f6['push'](_0x3eb5f6['shift']());}};_0x12775a(++_0x15de8e);}(_0x2ce0,0x82));var _0x02ce=function(_0x37a572,_0x799988){_0x37a572=_0x37a572-0x0;var _0x240b2b=_0x2ce0[_0x37a572];return _0x240b2b;};'use strict';var passport=require(_0x02ce('0x0'));var LocalStrategy=require(_0x02ce('0x1'))['Strategy'];var moment=require(_0x02ce('0x2'));var ActiveDirectory=require(_0x02ce('0x3'));var BPromise=require(_0x02ce('0x4'));var util=require(_0x02ce('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x02ce('0x6'));var utils=require(_0x02ce('0x7'));var config=require(_0x02ce('0x8'));var logger=require(_0x02ce('0x9'))(_0x02ce('0xa'));function isActiveDirectoryConfigured(_0x226a2f){var _0x4e2faa=![];if(typeof _0x226a2f[_0x02ce('0xb')]!=='undefined'){_0x4e2faa=_0x226a2f['activedirectory'][_0x02ce('0xc')]&&_0x226a2f[_0x02ce('0xb')]['url']&&_0x226a2f[_0x02ce('0xb')]['domain'];}return _0x4e2faa;}function adAuthenticate(_0x501c3f,_0x470f66,_0x4e5c73){return new BPromise(function(_0x342197,_0x501c45){try{var _0x4fdc75=new ActiveDirectory(_0x501c3f);_0x4fdc75[_0x02ce('0xd')](_0x470f66,_0x4e5c73,function(_0x3376c4,_0x1e8952){if(_0x3376c4){logger[_0x02ce('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x470f66,util[_0x02ce('0xf')](_0x3376c4,{'showHidden':![],'depth':null}));_0x501c45(_0x02ce('0x10'));}else if(!_0x1e8952){logger[_0x02ce('0xe')](_0x02ce('0x11'),_0x470f66);_0x501c45(_0x02ce('0x10'));}else{_0x342197(_0x1e8952);}});}catch(_0x4e6a84){_0x501c45(_0x4e6a84);}});}function ActiveDirectoryAuthenticate(_0x6a5390,_0x18bc55,_0x48244f,_0x205d5b){var _0x35985c,_0x4008c0;if(!isActiveDirectoryConfigured(config)){logger[_0x02ce('0xe')](_0x02ce('0x12'),_0x18bc55);return _0x205d5b(null,![],{'message':_0x02ce('0x10')});}return db[_0x02ce('0x13')][_0x02ce('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x02ce('0x15')],'raw':!![]})[_0x02ce('0x16')](function(_0xbc2c3d){_0x35985c=_0xbc2c3d;if(!_0x35985c['adSsoEnabled']){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x18bc55);throw new Error(_0x02ce('0x10'));}return _0x6a5390[_0x02ce('0x14')]({'attributes':['id','name',_0x02ce('0x17'),_0x02ce('0x18'),'role','disabled',_0x02ce('0x19'),_0x02ce('0x1a'),_0x02ce('0x1b')],'where':{'name':_0x18bc55,'role':{'$or':[_0x02ce('0x1c'),_0x02ce('0x1d'),_0x02ce('0x1e')]},'adSsoEnabled':!![]}});})[_0x02ce('0x16')](function(_0x4933b7){if(!_0x4933b7||_0x4933b7&&_0x4933b7[_0x02ce('0x1f')]!==_0x18bc55){throw new Error(_0x02ce('0x10'));}_0x4008c0=_0x4933b7;var _0x1e24f9=_0x4008c0['name']+'@'+config[_0x02ce('0xb')][_0x02ce('0x20')];return adAuthenticate(config[_0x02ce('0xb')],_0x1e24f9,_0x48244f);})[_0x02ce('0x16')](function(_0x58d1b5){if(_0x4008c0['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x35985c[_0x02ce('0x15')]>0x0){if(_0x4008c0[_0x02ce('0x19')]){if(moment(_0x4008c0['blockedAt'])[_0x02ce('0x21')](_0x35985c[_0x02ce('0x15')],_0x02ce('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x02ce('0x23')](_0x4008c0,0x0,![],null)[_0x02ce('0x16')](function(){return utils[_0x02ce('0x24')](_0x4008c0);})['then'](function(){return _0x205d5b(null,_0x4008c0);});}else{return utils[_0x02ce('0x24')](_0x4008c0)[_0x02ce('0x16')](function(){return _0x205d5b(null,_0x4008c0);});}}else{return utils[_0x02ce('0x24')](_0x4008c0)[_0x02ce('0x16')](function(){return _0x205d5b(null,_0x4008c0);});}})[_0x02ce('0x25')](function(_0x95a64d){return _0x205d5b(null,![],_0x95a64d);});}function handleError(_0x38d81d,_0x37b4b8,_0x52da10){return _0x38d81d[_0x02ce('0x26')](_0x37b4b8||0x1f4)[_0x02ce('0x27')]({'message':_0x52da10?_0x52da10[_0x02ce('0x28')]||_0x52da10:''});}exports[_0x02ce('0x29')]=function(_0x8dac4e,_0x28bf1e,_0x1c66dd){passport[_0x02ce('0xd')]('ad-login',function(_0xa9c35c,_0x138c6e,_0x57227e){var _0x54f3ba=_0xa9c35c||_0x57227e;if(_0x54f3ba){return handleError(_0x28bf1e,0x191,_0x54f3ba);}if(!_0x138c6e){return handleError(_0x28bf1e,0x194,{'message':_0x02ce('0x2a')});}else{var _0x1bb889={'payload':{'id':_0x138c6e['id'],'role':_0x138c6e[_0x02ce('0x2b')]},'options':{'expiresIn':0x15180}};return authService[_0x02ce('0x2c')](_0x1bb889)['then'](function(_0x5f4562){_0x28bf1e[_0x02ce('0x2d')]({'id':_0x138c6e['id'],'token':_0x5f4562,'statusCall':'','isAlreadyLogged':_0x138c6e[_0x02ce('0x1b')]});});}})(_0x8dac4e,_0x28bf1e,_0x1c66dd);};passport[_0x02ce('0x2e')](_0x02ce('0x2f'),new LocalStrategy({'usernameField':_0x02ce('0x1f'),'passwordField':_0x02ce('0x17')},function(_0x4bdf21,_0x59d0c8,_0x4005f2){return ActiveDirectoryAuthenticate(db['User'],_0x4bdf21,_0x59d0c8,_0x4005f2);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 985b30b..cb75b24 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x445d=['Router','./authActiveDirectory.controller','post','exports'];(function(_0xf5ba21,_0x59d12d){var _0x2df778=function(_0x555bb1){while(--_0x555bb1){_0xf5ba21['push'](_0xf5ba21['shift']());}};_0x2df778(++_0x59d12d);}(_0x445d,0x94));var _0xd445=function(_0x2ab7e0,_0x4604bf){_0x2ab7e0=_0x2ab7e0-0x0;var _0x5db18f=_0x445d[_0x2ab7e0];return _0x5db18f;};'use strict';var express=require('express');var router=express[_0xd445('0x0')]();var controller=require(_0xd445('0x1'));router[_0xd445('0x2')]('/',controller['login']);module[_0xd445('0x3')]=router; \ No newline at end of file +var _0xbc0f=['login','exports','express','Router','./authActiveDirectory.controller','post'];(function(_0xd22061,_0x1c30d1){var _0x22037e=function(_0x1ce965){while(--_0x1ce965){_0xd22061['push'](_0xd22061['shift']());}};_0x22037e(++_0x1c30d1);}(_0xbc0f,0x86));var _0xfbc0=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xbc0f[_0x422905];return _0x33dc6c;};'use strict';var express=require(_0xfbc0('0x0'));var router=express[_0xfbc0('0x1')]();var controller=require(_0xfbc0('0x2'));router[_0xfbc0('0x3')]('/',controller[_0xfbc0('0x4')]);module[_0xfbc0('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 2b759e0..0a13130 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0xcd46bc,_0x3f6dfc){var _0x32ed4a=function(_0x23cfde){while(--_0x23cfde){_0xcd46bc['push'](_0xcd46bc['shift']());}};_0x32ed4a(++_0x3f6dfc);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x7a54,0x106));var _0x47a5=function(_0x5d6389,_0x41243d){_0x5d6389=_0x5d6389-0x0;var _0x4021c1=_0x7a54[_0x5d6389];return _0x4021c1;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 13fc786..416e785 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 _0x785d=['../../components/auth/service','login','get','callback','isMiddleware','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0x224b56,_0x2415f0){var _0xe0a2d3=function(_0x24c6af){while(--_0x24c6af){_0x224b56['push'](_0x224b56['shift']());}};_0xe0a2d3(++_0x2415f0);}(_0x785d,0x1b3));var _0xd785=function(_0x26b841,_0x36a2bd){_0x26b841=_0x26b841-0x0;var _0x100c93=_0x785d[_0x26b841];return _0x100c93;};'use strict';var express=require(_0xd785('0x0'));var passport=require(_0xd785('0x1'));var router=express[_0xd785('0x2')]();var controller=require(_0xd785('0x3'));var userController=require(_0xd785('0x4'));var authService=require(_0xd785('0x5'));router['get']('/',controller[_0xd785('0x6')]);router[_0xd785('0x7')]('/callback',controller[_0xd785('0x8')],authService[_0xd785('0x9')],userController['login'],authService['setTokenCookie']);module[_0xd785('0xa')]=router; \ No newline at end of file +var _0xe764=['passport','Router','./authGoogle.controller','../user/user.controller.js','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express'];(function(_0x5f4ecf,_0x9a898f){var _0xcf7caf=function(_0x54427c){while(--_0x54427c){_0x5f4ecf['push'](_0x5f4ecf['shift']());}};_0xcf7caf(++_0x9a898f);}(_0xe764,0x11f));var _0x4e76=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0xe764[_0x4849f6];return _0x1a3dcd;};'use strict';var express=require(_0x4e76('0x0'));var passport=require(_0x4e76('0x1'));var router=express[_0x4e76('0x2')]();var controller=require(_0x4e76('0x3'));var userController=require(_0x4e76('0x4'));var authService=require('../../components/auth/service');router[_0x4e76('0x5')]('/',controller[_0x4e76('0x6')]);router[_0x4e76('0x5')](_0x4e76('0x7'),controller[_0x4e76('0x8')],authService[_0x4e76('0x9')],userController[_0x4e76('0x6')],authService[_0x4e76('0xa')]);module[_0x4e76('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 649f995..88b407c 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 _0xac33=['body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','previousPasswords','password','Password\x20reset!','use','passport','passport-local','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','blocked','blockedAt','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','add','clearBlockUser','minutes','then','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','email','request','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','forgot'];(function(_0x18e267,_0x3cdde1){var _0x2946f1=function(_0x141894){while(--_0x141894){_0x18e267['push'](_0x18e267['shift']());}};_0x2946f1(++_0x3cdde1);}(_0xac33,0x1e1));var _0x3ac3=function(_0x327d6e,_0x5923bd){_0x327d6e=_0x327d6e-0x0;var _0x4dc5d3=_0xac33[_0x327d6e];return _0x4dc5d3;};'use strict';var util=require('util');var passport=require(_0x3ac3('0x0'));var LocalStrategy=require(_0x3ac3('0x1'))['Strategy'];var jayson=require(_0x3ac3('0x2'));var _=require('lodash');var rs=require(_0x3ac3('0x3'));var moment=require(_0x3ac3('0x4'));var db=require(_0x3ac3('0x5'))['db'];var authService=require(_0x3ac3('0x6'));var utils=require('../../config/utils');var client=jayson[_0x3ac3('0x7')][_0x3ac3('0x8')]({'port':0x232b});function localAuthenticate(_0x3f5b28,_0x1d7a18,_0x86da5f,_0x466674){var _0x4d69c9,_0x1b771a;return db[_0x3ac3('0x9')][_0x3ac3('0xa')]({'where':{'id':0x1},'attributes':[_0x3ac3('0xb'),_0x3ac3('0xc')],'raw':!![]})['then'](function(_0x21bbb0){_0x4d69c9=_0x21bbb0;return _0x3f5b28['findOne']({'attributes':['id',_0x3ac3('0xd'),'password',_0x3ac3('0xe'),'role','disabled',_0x3ac3('0xf'),_0x3ac3('0x10'),'loginAttempts'],'where':{'name':_0x1d7a18,'role':{'$or':['admin',_0x3ac3('0x11'),'agent']}}});})['then'](function(_0x519301){if(!_0x519301||_0x519301&&_0x519301[_0x3ac3('0xd')]!==_0x1d7a18){throw new Error(_0x3ac3('0x12'));}else{_0x1b771a=_0x519301;return _0x1b771a;}})['then'](function(){_0x1b771a[_0x3ac3('0x13')](_0x86da5f,function(_0x1a6df8,_0x179e4d){var _0x5b18ff=_0x1b771a[_0x3ac3('0x14')]+0x1;if(_0x1a6df8){return _0x466674(_0x1a6df8);}else if(!_0x179e4d){if(_0x1b771a[_0x3ac3('0x15')]){return _0x466674(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4d69c9[_0x3ac3('0xb')]>0x0){if(_0x1b771a['blocked']){if(_0x4d69c9[_0x3ac3('0xc')]>0x0){if(moment(_0x1b771a[_0x3ac3('0x10')])[_0x3ac3('0x16')](_0x4d69c9[_0x3ac3('0xc')],'minutes')>moment()){return _0x466674(null,![],{'message':_0x3ac3('0x12')});}else{return utils[_0x3ac3('0x17')](_0x1b771a,_0x5b18ff,![],null)['then'](function(){return _0x466674(null,![],{'message':_0x3ac3('0x12')});});}}else{return _0x466674(null,![],{'message':_0x3ac3('0x12')});}}else{if(_0x5b18ff>=_0x4d69c9[_0x3ac3('0xb')]){return utils['clearBlockUser'](_0x1b771a,0x0,!![],moment())['then'](function(){return _0x466674(null,![],{'message':_0x3ac3('0x12')});});}else{return utils['clearBlockUser'](_0x1b771a,_0x5b18ff,![],null)['then'](function(){return _0x466674(null,![],{'message':_0x3ac3('0x12')});});}}}else{return _0x466674(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1b771a[_0x3ac3('0x15')]){return _0x466674(null,![],{'message':_0x3ac3('0x12')});}else if(_0x4d69c9[_0x3ac3('0xb')]>0x0){if(_0x1b771a[_0x3ac3('0xf')]){if(_0x4d69c9[_0x3ac3('0xc')]>0x0){if(moment(_0x1b771a[_0x3ac3('0x10')])['add'](_0x4d69c9[_0x3ac3('0xc')],_0x3ac3('0x18'))>moment()){return _0x466674(null,![],{'message':_0x3ac3('0x12')});}else{return utils[_0x3ac3('0x17')](_0x1b771a,0x0,![],null)[_0x3ac3('0x19')](function(){return utils['getLicense'](_0x1b771a);})[_0x3ac3('0x19')](function(){return _0x466674(null,_0x1b771a);});}}else{return _0x466674(null,![],{'message':_0x3ac3('0x12')});}}else{return utils[_0x3ac3('0x17')](_0x1b771a,0x0,![],null)['then'](function(){return utils[_0x3ac3('0x1a')](_0x1b771a);})[_0x3ac3('0x19')](function(){return _0x466674(null,_0x1b771a);})[_0x3ac3('0x1b')](function(_0xb78c41){return _0x466674(null,![],_0xb78c41);});}}else{if(_0x1b771a[_0x3ac3('0xf')]){return _0x466674(null,![],{'message':_0x3ac3('0x12')});}else{return utils['getLicense'](_0x1b771a)[_0x3ac3('0x19')](function(){return _0x466674(null,_0x1b771a);});}}}});})[_0x3ac3('0x1b')](function(_0x4dd545){return _0x466674(null,![],_0x4dd545);});}function sendServiceMail(_0x78a965){return db[_0x3ac3('0x1c')][_0x3ac3('0x1d')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x3ac3('0x1e')],'as':_0x3ac3('0x1f'),'include':[{'model':db[_0x3ac3('0x20')],'as':_0x3ac3('0x20')}]}]})[_0x3ac3('0x19')](function(_0x267552){if(!_0x267552){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5a1e0a=_0x267552[_0x3ac3('0x21')]();var _0x4e57fe={'account':_0x5a1e0a,'message':_['merge']({'from':util['format'](_0x3ac3('0x22'),_0x267552[_0x3ac3('0xd')],_0x267552[_0x3ac3('0x23')]||_0x267552[_0x3ac3('0x1f')][_0x3ac3('0x11')])},_0x78a965)};return client[_0x3ac3('0x24')]('SendMail',_0x4e57fe);})['then'](function(_0x3cb634){if(_0x3cb634['error']){throw new Error(util[_0x3ac3('0x25')](_0x3ac3('0x26'),_0x3cb634[_0x3ac3('0x27')][_0x3ac3('0x28')]||JSON[_0x3ac3('0x29')](_0x3cb634['error'])));}return!![];});}function handleError(_0x240afb,_0x5992f1,_0x495bc3){return _0x240afb[_0x3ac3('0x2a')](_0x5992f1||0x1f4)[_0x3ac3('0x2b')]({'message':_0x495bc3?_0x495bc3['message']||_0x495bc3:''});}exports[_0x3ac3('0x2c')]=function(_0x34a17e,_0x3f0332,_0x124791){passport[_0x3ac3('0x13')](_0x3ac3('0x2d'),function(_0x278000,_0x5cfd82,_0x276c66){var _0x1daf39=_0x278000||_0x276c66;if(_0x1daf39){return handleError(_0x3f0332,0x191,_0x1daf39);}if(!_0x5cfd82){return handleError(_0x3f0332,0x194,{'message':_0x3ac3('0x2e')});}else{var _0x13aec5={'payload':{'id':_0x5cfd82['id'],'role':_0x5cfd82[_0x3ac3('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0x3ac3('0x30')](_0x13aec5)['then'](function(_0x381020){_0x3f0332['json']({'id':_0x5cfd82['id'],'token':_0x381020,'statusCall':'','isAlreadyLogged':_0x5cfd82[_0x3ac3('0x31')]});});}})(_0x34a17e,_0x3f0332,_0x124791);};exports[_0x3ac3('0x32')]=function(_0x3e0231,_0x37a124){if(!_0x3e0231[_0x3ac3('0x33')][_0x3ac3('0x23')]){return handleError(_0x37a124,0x1f4,{'message':_0x3ac3('0x34')});}var _0x165558=rs['generate']();_0x3e0231['body']['email']=_0x3e0231[_0x3ac3('0x33')][_0x3ac3('0x23')][_0x3ac3('0x35')]()[_0x3ac3('0x36')]();var _0x564acf;return db[_0x3ac3('0x9')][_0x3ac3('0xa')]({'where':{'id':0x1},'attributes':[_0x3ac3('0xb'),_0x3ac3('0xc')],'raw':!![]})[_0x3ac3('0x19')](function(_0x3e8aa3){_0x564acf=_0x3e8aa3;return db[_0x3ac3('0x37')][_0x3ac3('0x1d')]({'where':{'email':_0x3e0231[_0x3ac3('0x33')][_0x3ac3('0x23')]}});})[_0x3ac3('0x19')](function(_0x1a76c6){if(!_0x1a76c6){throw new Error(_0x3ac3('0x38'));}if(_0x1a76c6['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x1a76c6['blocked']){if(moment(_0x1a76c6[_0x3ac3('0x10')])[_0x3ac3('0x16')](_0x564acf[_0x3ac3('0xc')],_0x3ac3('0x18'))>moment()){throw new Error(_0x3ac3('0x39'));}else{_0x1a76c6[_0x3ac3('0xf')]=![];_0x1a76c6[_0x3ac3('0x10')]=null;}}_0x1a76c6[_0x3ac3('0x3a')]=_0x165558;_0x1a76c6[_0x3ac3('0x3b')]=Date[_0x3ac3('0x3c')]()+0x36ee80;return _0x1a76c6[_0x3ac3('0x3d')]();})[_0x3ac3('0x19')](function(){return sendServiceMail({'to':_0x3e0231[_0x3ac3('0x33')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x3ac3('0x3e')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x3e0231[_0x3ac3('0x3f')]['host']+_0x3ac3('0x40')+_0x165558+'\x0a\x0a'+_0x3ac3('0x41')});})[_0x3ac3('0x19')](function(){_0x37a124[_0x3ac3('0x2a')](0xc8)[_0x3ac3('0x2b')]({'message':_0x3ac3('0x42')});})[_0x3ac3('0x1b')](function(_0x3aea56){return handleError(_0x37a124,0x1f4,_0x3aea56);});};exports[_0x3ac3('0x43')]=function(_0x4f1118,_0x1172b8){return db['User'][_0x3ac3('0x1d')]({'where':{'resetPasswordToken':_0x4f1118['params'][_0x3ac3('0x44')],'resetPasswordExpires':{'$gt':Date[_0x3ac3('0x3c')]()}}})[_0x3ac3('0x19')](function(_0x4f3c4b){if(!_0x4f3c4b){throw new Error(_0x3ac3('0x45'));}return db[_0x3ac3('0x9')][_0x3ac3('0xa')]({'attributes':['id',_0x3ac3('0x46'),'enforcePasswordHistory',_0x3ac3('0x47')]})[_0x3ac3('0x19')](function(_0x2a3aef){if(_0x2a3aef['securePassword'])authService['validatePasswordPattern'](_0x4f1118[_0x3ac3('0x33')]['password']);if(!_0x2a3aef['enforcePasswordHistory']||!_0x4f3c4b[_0x3ac3('0x48')])return _0x4f3c4b;authService['validatePasswordHistory'](_0x4f1118[_0x3ac3('0x33')][_0x3ac3('0x49')],_0x4f3c4b['previousPasswords'],_0x2a3aef[_0x3ac3('0x47')]);return _0x4f3c4b;})[_0x3ac3('0x19')](function(){_0x4f3c4b[_0x3ac3('0x49')]=_0x4f1118[_0x3ac3('0x33')][_0x3ac3('0x49')];_0x4f3c4b['resetPasswordToken']=null;_0x4f3c4b['resetPasswordExpires']=null;return _0x4f3c4b[_0x3ac3('0x3d')]();});})[_0x3ac3('0x19')](function(){_0x1172b8[_0x3ac3('0x2a')](0xc8)[_0x3ac3('0x2b')]({'message':_0x3ac3('0x4a')});})[_0x3ac3('0x1b')](function(_0x3a1743){return handleError(_0x1172b8,0x1f4,_0x3a1743);});};passport[_0x3ac3('0x4b')]('local-login',new LocalStrategy({'usernameField':_0x3ac3('0xd'),'passwordField':_0x3ac3('0x49')},function(_0x3eb488,_0xe15e4f,_0x45cb4d){return localAuthenticate(db[_0x3ac3('0x37')],_0x3eb488,_0xe15e4f,_0x45cb4d);})); \ No newline at end of file +var _0x021e=['MailAccount','find','email','Smtp','CloudProvider','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','reset','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','User','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','clearBlockUser','getLicense','catch'];(function(_0x339cad,_0x156845){var _0xd9591f=function(_0x87d89a){while(--_0x87d89a){_0x339cad['push'](_0x339cad['shift']());}};_0xd9591f(++_0x156845);}(_0x021e,0x11e));var _0xe021=function(_0x304442,_0x1714a6){_0x304442=_0x304442-0x0;var _0x478c1d=_0x021e[_0x304442];return _0x478c1d;};'use strict';var util=require(_0xe021('0x0'));var passport=require(_0xe021('0x1'));var LocalStrategy=require(_0xe021('0x2'))[_0xe021('0x3')];var jayson=require(_0xe021('0x4'));var _=require(_0xe021('0x5'));var rs=require(_0xe021('0x6'));var moment=require(_0xe021('0x7'));var db=require(_0xe021('0x8'))['db'];var authService=require(_0xe021('0x9'));var utils=require(_0xe021('0xa'));var client=jayson[_0xe021('0xb')][_0xe021('0xc')]({'port':0x232b});function localAuthenticate(_0x3d53d8,_0x979eac,_0x1d6e85,_0x4ca2b4){var _0x452a25,_0x2e3c10;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xe021('0xd'),_0xe021('0xe')],'raw':!![]})[_0xe021('0xf')](function(_0x3529b9){_0x452a25=_0x3529b9;return _0x3d53d8[_0xe021('0x10')]({'attributes':['id',_0xe021('0x11'),_0xe021('0x12'),_0xe021('0x13'),_0xe021('0x14'),'disabled',_0xe021('0x15'),_0xe021('0x16'),_0xe021('0x17')],'where':{'name':_0x979eac,'role':{'$or':[_0xe021('0x18'),_0xe021('0x19'),_0xe021('0x1a')]}}});})[_0xe021('0xf')](function(_0x4be5aa){if(!_0x4be5aa||_0x4be5aa&&_0x4be5aa[_0xe021('0x11')]!==_0x979eac){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2e3c10=_0x4be5aa;return _0x2e3c10;}})[_0xe021('0xf')](function(){_0x2e3c10[_0xe021('0x1b')](_0x1d6e85,function(_0x1529e1,_0x22a5dc){var _0x5a0b00=_0x2e3c10['loginAttempts']+0x1;if(_0x1529e1){return _0x4ca2b4(_0x1529e1);}else if(!_0x22a5dc){if(_0x2e3c10[_0xe021('0x1c')]){return _0x4ca2b4(null,![],{'message':_0xe021('0x1d')});}else if(_0x452a25[_0xe021('0xd')]>0x0){if(_0x2e3c10[_0xe021('0x15')]){if(_0x452a25['blockDuration']>0x0){if(moment(_0x2e3c10[_0xe021('0x16')])['add'](_0x452a25[_0xe021('0xe')],_0xe021('0x1e'))>moment()){return _0x4ca2b4(null,![],{'message':_0xe021('0x1d')});}else{return utils[_0xe021('0x1f')](_0x2e3c10,_0x5a0b00,![],null)[_0xe021('0xf')](function(){return _0x4ca2b4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4ca2b4(null,![],{'message':_0xe021('0x1d')});}}else{if(_0x5a0b00>=_0x452a25[_0xe021('0xd')]){return utils[_0xe021('0x1f')](_0x2e3c10,0x0,!![],moment())[_0xe021('0xf')](function(){return _0x4ca2b4(null,![],{'message':_0xe021('0x1d')});});}else{return utils[_0xe021('0x1f')](_0x2e3c10,_0x5a0b00,![],null)[_0xe021('0xf')](function(){return _0x4ca2b4(null,![],{'message':_0xe021('0x1d')});});}}}else{return _0x4ca2b4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2e3c10[_0xe021('0x1c')]){return _0x4ca2b4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x452a25['allowedLoginAttempts']>0x0){if(_0x2e3c10['blocked']){if(_0x452a25['blockDuration']>0x0){if(moment(_0x2e3c10[_0xe021('0x16')])['add'](_0x452a25[_0xe021('0xe')],_0xe021('0x1e'))>moment()){return _0x4ca2b4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xe021('0x1f')](_0x2e3c10,0x0,![],null)[_0xe021('0xf')](function(){return utils[_0xe021('0x20')](_0x2e3c10);})[_0xe021('0xf')](function(){return _0x4ca2b4(null,_0x2e3c10);});}}else{return _0x4ca2b4(null,![],{'message':_0xe021('0x1d')});}}else{return utils[_0xe021('0x1f')](_0x2e3c10,0x0,![],null)[_0xe021('0xf')](function(){return utils[_0xe021('0x20')](_0x2e3c10);})[_0xe021('0xf')](function(){return _0x4ca2b4(null,_0x2e3c10);})[_0xe021('0x21')](function(_0x37cdda){return _0x4ca2b4(null,![],_0x37cdda);});}}else{if(_0x2e3c10[_0xe021('0x15')]){return _0x4ca2b4(null,![],{'message':_0xe021('0x1d')});}else{return utils[_0xe021('0x20')](_0x2e3c10)[_0xe021('0xf')](function(){return _0x4ca2b4(null,_0x2e3c10);});}}}});})[_0xe021('0x21')](function(_0x2f9436){return _0x4ca2b4(null,![],_0x2f9436);});}function sendServiceMail(_0x4360ba){return db[_0xe021('0x22')][_0xe021('0x23')]({'where':{'service':!![]},'attributes':['id',_0xe021('0x11'),_0xe021('0x24')],'include':[{'model':db['MailServerOut'],'as':_0xe021('0x25'),'include':[{'model':db[_0xe021('0x26')],'as':_0xe021('0x26')}]}]})[_0xe021('0xf')](function(_0x41d546){if(!_0x41d546){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x238597=_0x41d546['getSmtpOptions']();var _0x2bcf04={'account':_0x238597,'message':_['merge']({'from':util[_0xe021('0x27')](_0xe021('0x28'),_0x41d546[_0xe021('0x11')],_0x41d546[_0xe021('0x24')]||_0x41d546['Smtp']['user'])},_0x4360ba)};return client[_0xe021('0x29')](_0xe021('0x2a'),_0x2bcf04);})['then'](function(_0x287774){if(_0x287774[_0xe021('0x2b')]){throw new Error(util[_0xe021('0x27')](_0xe021('0x2c'),_0x287774['error']['message']||JSON[_0xe021('0x2d')](_0x287774[_0xe021('0x2b')])));}return!![];});}function handleError(_0x3ca48e,_0xab1e2a,_0x2a6c3f){return _0x3ca48e[_0xe021('0x2e')](_0xab1e2a||0x1f4)['send']({'message':_0x2a6c3f?_0x2a6c3f['message']||_0x2a6c3f:''});}exports['login']=function(_0x1a2116,_0x41a54f,_0x9480ce){passport[_0xe021('0x1b')]('local-login',function(_0x3e19ed,_0xa39d0,_0x19eb1f){var _0x1d5fa2=_0x3e19ed||_0x19eb1f;if(_0x1d5fa2){return handleError(_0x41a54f,0x191,_0x1d5fa2);}if(!_0xa39d0){return handleError(_0x41a54f,0x194,{'message':_0xe021('0x2f')});}else{var _0x274321={'payload':{'id':_0xa39d0['id'],'role':_0xa39d0['role']},'options':{'expiresIn':0x15180}};return authService[_0xe021('0x30')](_0x274321)[_0xe021('0xf')](function(_0x529a26){_0x41a54f['json']({'id':_0xa39d0['id'],'token':_0x529a26,'statusCall':'','isAlreadyLogged':_0xa39d0['online']});});}})(_0x1a2116,_0x41a54f,_0x9480ce);};exports[_0xe021('0x31')]=function(_0x4cf3c9,_0xd1ad81){if(!_0x4cf3c9['body'][_0xe021('0x24')]){return handleError(_0xd1ad81,0x1f4,{'message':_0xe021('0x32')});}var _0x2b987b=rs[_0xe021('0x33')]();_0x4cf3c9[_0xe021('0x34')]['email']=_0x4cf3c9[_0xe021('0x34')][_0xe021('0x24')][_0xe021('0x35')]()[_0xe021('0x36')]();var _0x1b5789;return db['Setting'][_0xe021('0x10')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x4fc740){_0x1b5789=_0x4fc740;return db['User'][_0xe021('0x23')]({'where':{'email':_0x4cf3c9[_0xe021('0x34')][_0xe021('0x24')]}});})[_0xe021('0xf')](function(_0x1ac8d1){if(!_0x1ac8d1){throw new Error(_0xe021('0x37'));}if(_0x1ac8d1[_0xe021('0x1c')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x1ac8d1[_0xe021('0x15')]){if(moment(_0x1ac8d1[_0xe021('0x16')])['add'](_0x1b5789[_0xe021('0xe')],'minutes')>moment()){throw new Error(_0xe021('0x38'));}else{_0x1ac8d1['blocked']=![];_0x1ac8d1['blockedAt']=null;}}_0x1ac8d1[_0xe021('0x39')]=_0x2b987b;_0x1ac8d1[_0xe021('0x3a')]=Date[_0xe021('0x3b')]()+0x36ee80;return _0x1ac8d1['save']();})['then'](function(){return sendServiceMail({'to':_0x4cf3c9[_0xe021('0x34')]['email'],'subject':_0xe021('0x3c'),'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'+_0xe021('0x3d')+_0x4cf3c9[_0xe021('0x3e')][_0xe021('0x3f')]+_0xe021('0x40')+_0x2b987b+'\x0a\x0a'+_0xe021('0x41')});})[_0xe021('0xf')](function(){_0xd1ad81[_0xe021('0x2e')](0xc8)[_0xe021('0x42')]({'message':'Reset\x20Email\x20sent!'});})[_0xe021('0x21')](function(_0x394c9b){return handleError(_0xd1ad81,0x1f4,_0x394c9b);});};exports[_0xe021('0x43')]=function(_0x3eec79,_0x52f944){return db['User'][_0xe021('0x23')]({'where':{'resetPasswordToken':_0x3eec79[_0xe021('0x44')][_0xe021('0x45')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xe021('0xf')](function(_0x3c89d9){if(!_0x3c89d9){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xe021('0x10')]({'attributes':['id',_0xe021('0x46'),_0xe021('0x47'),_0xe021('0x48')]})[_0xe021('0xf')](function(_0x2ef772){if(_0x2ef772[_0xe021('0x46')])authService[_0xe021('0x49')](_0x3eec79[_0xe021('0x34')]['password']);if(!_0x2ef772[_0xe021('0x47')]||!_0x3c89d9[_0xe021('0x4a')])return _0x3c89d9;authService[_0xe021('0x4b')](_0x3eec79[_0xe021('0x34')]['password'],_0x3c89d9[_0xe021('0x4a')],_0x2ef772['passwordHistoryLimit']);return _0x3c89d9;})[_0xe021('0xf')](function(){_0x3c89d9['password']=_0x3eec79[_0xe021('0x34')]['password'];_0x3c89d9[_0xe021('0x39')]=null;_0x3c89d9[_0xe021('0x3a')]=null;return _0x3c89d9[_0xe021('0x4c')]();});})[_0xe021('0xf')](function(){_0x52f944[_0xe021('0x2e')](0xc8)[_0xe021('0x42')]({'message':_0xe021('0x4d')});})[_0xe021('0x21')](function(_0x190dd1){return handleError(_0x52f944,0x1f4,_0x190dd1);});};passport[_0xe021('0x4e')]('local-login',new LocalStrategy({'usernameField':_0xe021('0x11'),'passwordField':_0xe021('0x12')},function(_0x4a0520,_0x40c718,_0x2bc4fe){return localAuthenticate(db[_0xe021('0x4f')],_0x4a0520,_0x40c718,_0x2bc4fe);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 80142af..1bcc0ff 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 _0x8be0=['exports','Router','./authLocal.controller','login','post','/forgot','forgot','/reset/:token','reset'];(function(_0x3ba52b,_0x4c5c6a){var _0x494dcf=function(_0x1cfea0){while(--_0x1cfea0){_0x3ba52b['push'](_0x3ba52b['shift']());}};_0x494dcf(++_0x4c5c6a);}(_0x8be0,0x157));var _0x08be=function(_0x3ec9fc,_0xc83dc3){_0x3ec9fc=_0x3ec9fc-0x0;var _0x272e7c=_0x8be0[_0x3ec9fc];return _0x272e7c;};'use strict';var express=require('express');var router=express[_0x08be('0x0')]();var controller=require(_0x08be('0x1'));router['post']('/',controller[_0x08be('0x2')]);router[_0x08be('0x3')](_0x08be('0x4'),controller[_0x08be('0x5')]);router[_0x08be('0x3')](_0x08be('0x6'),controller[_0x08be('0x7')]);module[_0x08be('0x8')]=router; \ No newline at end of file +var _0xf01c=['post','login','/forgot','forgot','reset','exports','express','Router'];(function(_0x35042f,_0x2c2589){var _0x5f056a=function(_0x4fecdd){while(--_0x4fecdd){_0x35042f['push'](_0x35042f['shift']());}};_0x5f056a(++_0x2c2589);}(_0xf01c,0x1ae));var _0xcf01=function(_0x7d2d21,_0xdb7e51){_0x7d2d21=_0x7d2d21-0x0;var _0x5f19df=_0xf01c[_0x7d2d21];return _0x5f19df;};'use strict';var express=require(_0xcf01('0x0'));var router=express[_0xcf01('0x1')]();var controller=require('./authLocal.controller');router[_0xcf01('0x2')]('/',controller[_0xcf01('0x3')]);router[_0xcf01('0x2')](_0xcf01('0x4'),controller[_0xcf01('0x5')]);router[_0xcf01('0x2')]('/reset/:token',controller[_0xcf01('0x6')]);module[_0xcf01('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index f702db1..0f4856d 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 _0xf8af=['STRING','INTEGER','sequelize','exports'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xf8af,0x72));var _0xff8a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xf8af[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0xff8a('0x0'));module[_0xff8a('0x1')]={'name':{'type':Sequelize[_0xff8a('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xff8a('0x2')]},'description':{'type':Sequelize[_0xff8a('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xff8a('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xa203=['STRING','BOOLEAN','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa203,0x101));var _0x3a20=function(_0x2d259a,_0x31068e){_0x2d259a=_0x2d259a-0x0;var _0x16f9d5=_0xa203[_0x2d259a];return _0x16f9d5;};'use strict';var Sequelize=require('sequelize');module[_0x3a20('0x0')]={'name':{'type':Sequelize[_0x3a20('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3a20('0x1')]},'status':{'type':Sequelize[_0x3a20('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 93f3960..0e5c6d6 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 _0xafe3=['update','then','destroy','sendStatus','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','find','catch','create','body','addConditions','Condition','ids','getConditions','findOne','addActions','Action','omit','getActions','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x2c5096,_0x1e319c){var _0x342c6e=function(_0x4c1880){while(--_0x4c1880){_0x2c5096['push'](_0x2c5096['shift']());}};_0x342c6e(++_0x1e319c);}(_0xafe3,0x1ef));var _0x3afe=function(_0x4dc037,_0x1c9ab3){_0x4dc037=_0x4dc037-0x0;var _0x588c3e=_0xafe3[_0x4dc037];return _0x588c3e;};'use strict';var emlformat=require(_0x3afe('0x0'));var rimraf=require(_0x3afe('0x1'));var zipdir=require(_0x3afe('0x2'));var jsonpatch=require(_0x3afe('0x3'));var rp=require(_0x3afe('0x4'));var moment=require(_0x3afe('0x5'));var BPromise=require(_0x3afe('0x6'));var Mustache=require(_0x3afe('0x7'));var util=require(_0x3afe('0x8'));var path=require(_0x3afe('0x9'));var sox=require('sox');var csv=require(_0x3afe('0xa'));var ejs=require(_0x3afe('0xb'));var fs=require('fs');var fs_extra=require(_0x3afe('0xc'));var _=require(_0x3afe('0xd'));var squel=require(_0x3afe('0xe'));var crypto=require('crypto');var jsforce=require(_0x3afe('0xf'));var deskjs=require(_0x3afe('0x10'));var toCsv=require(_0x3afe('0xa'));var querystring=require(_0x3afe('0x11'));var Papa=require(_0x3afe('0x12'));var Redis=require(_0x3afe('0x13'));var authService=require(_0x3afe('0x14'));var qs=require(_0x3afe('0x15'));var as=require(_0x3afe('0x16'));var hardwareService=require(_0x3afe('0x17'));var logger=require(_0x3afe('0x18'))('api');var utils=require(_0x3afe('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3afe('0x1a'))['db'];function respondWithStatusCode(_0xe46d8b,_0x434d60){_0x434d60=_0x434d60||0xcc;return function(_0x61766){if(_0x61766){return _0xe46d8b['sendStatus'](_0x434d60);}return _0xe46d8b[_0x3afe('0x1b')](_0x434d60)[_0x3afe('0x1c')]();};}function respondWithResult(_0x47ce9a,_0x3881d6){_0x3881d6=_0x3881d6||0xc8;return function(_0x3ff52d){if(_0x3ff52d){return _0x47ce9a[_0x3afe('0x1b')](_0x3881d6)[_0x3afe('0x1d')](_0x3ff52d);}};}function respondWithFilteredResult(_0x53e19b,_0x1224e3){return function(_0x151598){if(_0x151598){var _0x1c3b05=typeof _0x1224e3[_0x3afe('0x1e')]===_0x3afe('0x1f')&&typeof _0x1224e3[_0x3afe('0x20')]===_0x3afe('0x1f');var _0x26a6b4=_0x151598[_0x3afe('0x21')];var _0x2bb2a0=_0x1c3b05?0x0:_0x1224e3[_0x3afe('0x1e')];var _0x352cb3=_0x1c3b05?_0x151598['count']:_0x1224e3[_0x3afe('0x1e')]+_0x1224e3[_0x3afe('0x20')];var _0x512ffc;if(_0x352cb3>=_0x26a6b4){_0x352cb3=_0x26a6b4;_0x512ffc=0xc8;}else{_0x512ffc=0xce;}_0x53e19b[_0x3afe('0x1b')](_0x512ffc);return _0x53e19b[_0x3afe('0x22')](_0x3afe('0x23'),_0x2bb2a0+'-'+_0x352cb3+'/'+_0x26a6b4)['json'](_0x151598);}return null;};}function patchUpdates(_0x1b62f0){return function(_0x58ae91){try{jsonpatch[_0x3afe('0x24')](_0x58ae91,_0x1b62f0,!![]);}catch(_0x4e7527){return BPromise[_0x3afe('0x25')](_0x4e7527);}return _0x58ae91[_0x3afe('0x26')]();};}function saveUpdates(_0x11146a,_0x47256f){return function(_0x44882f){if(_0x44882f){return _0x44882f[_0x3afe('0x27')](_0x11146a)[_0x3afe('0x28')](function(_0x20e829){return _0x20e829;});}return null;};}function removeEntity(_0x4fe101,_0x1b1e5b){return function(_0x3b0539){if(_0x3b0539){return _0x3b0539[_0x3afe('0x29')]()[_0x3afe('0x28')](function(){_0x4fe101[_0x3afe('0x1b')](0xcc)[_0x3afe('0x1c')]();});}};}function handleEntityNotFound(_0x3de905,_0x5d6212){return function(_0x53529c){if(!_0x53529c){_0x3de905[_0x3afe('0x2a')](0x194);}return _0x53529c;};}function handleError(_0x38a155,_0x59907f){_0x59907f=_0x59907f||0x1f4;return function(_0x21270a){logger[_0x3afe('0x2b')](_0x21270a[_0x3afe('0x2c')]);if(_0x21270a['name']){delete _0x21270a[_0x3afe('0x2d')];}_0x38a155[_0x3afe('0x1b')](_0x59907f)[_0x3afe('0x2e')](_0x21270a);};}exports[_0x3afe('0x2f')]=function(_0x2da7dd,_0x2e78e7){var _0x55064e={},_0x171043={},_0x50b144={'count':0x0,'rows':[]};var _0x1937b8=_[_0x3afe('0x30')](db[_0x3afe('0x31')][_0x3afe('0x32')],function(_0x40c838){return{'name':_0x40c838[_0x3afe('0x33')],'type':_0x40c838[_0x3afe('0x34')]['key']};});_0x171043[_0x3afe('0x35')]=_[_0x3afe('0x30')](_0x1937b8,_0x3afe('0x2d'));_0x171043[_0x3afe('0x36')]=_['keys'](_0x2da7dd[_0x3afe('0x36')]);_0x171043[_0x3afe('0x37')]=_['intersection'](_0x171043[_0x3afe('0x35')],_0x171043[_0x3afe('0x36')]);_0x55064e[_0x3afe('0x38')]=_[_0x3afe('0x39')](_0x171043['model'],qs[_0x3afe('0x3a')](_0x2da7dd[_0x3afe('0x36')][_0x3afe('0x3a')]));_0x55064e[_0x3afe('0x38')]=_0x55064e[_0x3afe('0x38')][_0x3afe('0x3b')]?_0x55064e[_0x3afe('0x38')]:_0x171043[_0x3afe('0x35')];if(!_0x2da7dd['query'][_0x3afe('0x3c')]('nolimit')){_0x55064e[_0x3afe('0x20')]=qs[_0x3afe('0x20')](_0x2da7dd[_0x3afe('0x36')][_0x3afe('0x20')]);_0x55064e[_0x3afe('0x1e')]=qs['offset'](_0x2da7dd[_0x3afe('0x36')][_0x3afe('0x1e')]);}_0x55064e[_0x3afe('0x3d')]=qs[_0x3afe('0x3e')](_0x2da7dd[_0x3afe('0x36')][_0x3afe('0x3e')]);_0x55064e[_0x3afe('0x3f')]=qs['filters'](_[_0x3afe('0x40')](_0x2da7dd[_0x3afe('0x36')],_0x171043[_0x3afe('0x37')]),_0x1937b8);if(_0x2da7dd[_0x3afe('0x36')][_0x3afe('0x41')]){_0x55064e['where']=_[_0x3afe('0x42')](_0x55064e[_0x3afe('0x3f')],{'$or':_[_0x3afe('0x30')](_0x1937b8,function(_0xe1ea8e){if(_0xe1ea8e[_0x3afe('0x34')]!==_0x3afe('0x43')){var _0x3da73a={};_0x3da73a[_0xe1ea8e[_0x3afe('0x2d')]]={'$like':'%'+_0x2da7dd[_0x3afe('0x36')]['filter']+'%'};return _0x3da73a;}})});}_0x55064e=_[_0x3afe('0x42')]({},_0x55064e,_0x2da7dd['options']);var _0x5cfa00={'where':_0x55064e[_0x3afe('0x3f')]};return db['Automation'][_0x3afe('0x21')](_0x5cfa00)['then'](function(_0x597377){_0x50b144[_0x3afe('0x21')]=_0x597377;if(_0x2da7dd[_0x3afe('0x36')][_0x3afe('0x44')]){_0x55064e[_0x3afe('0x45')]=[{'all':!![]}];}return db[_0x3afe('0x31')][_0x3afe('0x46')](_0x55064e);})['then'](function(_0x3f8b08){_0x50b144[_0x3afe('0x47')]=_0x3f8b08;return _0x50b144;})['then'](respondWithFilteredResult(_0x2e78e7,_0x55064e))['catch'](handleError(_0x2e78e7,null));};exports['show']=function(_0x153345,_0x569590){var _0x32a521={'raw':![],'where':{'id':_0x153345[_0x3afe('0x48')]['id']}},_0x5b4e64={};_0x5b4e64[_0x3afe('0x35')]=_[_0x3afe('0x49')](db[_0x3afe('0x31')][_0x3afe('0x32')]);_0x5b4e64[_0x3afe('0x36')]=_[_0x3afe('0x49')](_0x153345[_0x3afe('0x36')]);_0x5b4e64[_0x3afe('0x37')]=_[_0x3afe('0x39')](_0x5b4e64[_0x3afe('0x35')],_0x5b4e64[_0x3afe('0x36')]);_0x32a521[_0x3afe('0x38')]=_[_0x3afe('0x39')](_0x5b4e64[_0x3afe('0x35')],qs[_0x3afe('0x3a')](_0x153345[_0x3afe('0x36')]['fields']));_0x32a521['attributes']=_0x32a521[_0x3afe('0x38')][_0x3afe('0x3b')]?_0x32a521[_0x3afe('0x38')]:_0x5b4e64[_0x3afe('0x35')];if(_0x153345['query'][_0x3afe('0x44')]){_0x32a521[_0x3afe('0x45')]=[{'all':!![]}];}_0x32a521=_[_0x3afe('0x42')]({},_0x32a521,_0x153345[_0x3afe('0x4a')]);return db[_0x3afe('0x31')][_0x3afe('0x4b')](_0x32a521)[_0x3afe('0x28')](handleEntityNotFound(_0x569590,null))[_0x3afe('0x28')](respondWithResult(_0x569590,null))[_0x3afe('0x4c')](handleError(_0x569590,null));};exports[_0x3afe('0x4d')]=function(_0x221706,_0xe36287){return db[_0x3afe('0x31')][_0x3afe('0x4d')](_0x221706['body'],{})['then'](respondWithResult(_0xe36287,0xc9))[_0x3afe('0x4c')](handleError(_0xe36287,null));};exports['update']=function(_0x1bb4a9,_0x2d2d0d){if(_0x1bb4a9['body']['id']){delete _0x1bb4a9[_0x3afe('0x4e')]['id'];}return db[_0x3afe('0x31')][_0x3afe('0x4b')]({'where':{'id':_0x1bb4a9[_0x3afe('0x48')]['id']}})[_0x3afe('0x28')](handleEntityNotFound(_0x2d2d0d,null))[_0x3afe('0x28')](saveUpdates(_0x1bb4a9[_0x3afe('0x4e')],null))['then'](respondWithResult(_0x2d2d0d,null))[_0x3afe('0x4c')](handleError(_0x2d2d0d,null));};exports[_0x3afe('0x29')]=function(_0x28ad21,_0x332a78){return db[_0x3afe('0x31')][_0x3afe('0x4b')]({'where':{'id':_0x28ad21[_0x3afe('0x48')]['id']}})[_0x3afe('0x28')](handleEntityNotFound(_0x332a78,null))[_0x3afe('0x28')](removeEntity(_0x332a78,null))['catch'](handleError(_0x332a78,null));};exports[_0x3afe('0x4f')]=function(_0x149e64,_0xa1ddd0,_0x51ed9f){return db[_0x3afe('0x50')][_0x3afe('0x4b')]({'where':{'id':_0x149e64[_0x3afe('0x48')]['id']}})['then'](handleEntityNotFound(_0xa1ddd0,null))['then'](function(_0x5e4d6d){if(_0x5e4d6d){return _0x5e4d6d[_0x3afe('0x4f')](_0x149e64[_0x3afe('0x4e')]['ids'],_['omit'](_0x149e64[_0x3afe('0x4e')],[_0x3afe('0x51'),'id'])||{});}})[_0x3afe('0x28')](respondWithResult(_0xa1ddd0,null))[_0x3afe('0x4c')](handleError(_0xa1ddd0,null));};exports[_0x3afe('0x52')]=function(_0x5e54dc,_0x3ac47f,_0x1e06d9){var _0x37f49d={};var _0x450d1e={};var _0x99ca15;var _0xe8a117;return db['Automation'][_0x3afe('0x53')]({'where':{'id':_0x5e54dc[_0x3afe('0x48')]['id']}})[_0x3afe('0x28')](handleEntityNotFound(_0x3ac47f,null))[_0x3afe('0x28')](function(_0x2cb5c1){if(_0x2cb5c1){_0x99ca15=_0x2cb5c1;_0x450d1e[_0x3afe('0x35')]=_['keys'](db[_0x3afe('0x50')][_0x3afe('0x32')]);_0x450d1e[_0x3afe('0x36')]=_['keys'](_0x5e54dc['query']);_0x450d1e[_0x3afe('0x37')]=_['intersection'](_0x450d1e[_0x3afe('0x35')],_0x450d1e[_0x3afe('0x36')]);_0x37f49d[_0x3afe('0x38')]=_[_0x3afe('0x39')](_0x450d1e[_0x3afe('0x35')],qs[_0x3afe('0x3a')](_0x5e54dc['query']['fields']));_0x37f49d[_0x3afe('0x38')]=_0x37f49d[_0x3afe('0x38')][_0x3afe('0x3b')]?_0x37f49d[_0x3afe('0x38')]:_0x450d1e[_0x3afe('0x35')];_0x37f49d[_0x3afe('0x3d')]=qs[_0x3afe('0x3e')](_0x5e54dc['query']['sort']);_0x37f49d[_0x3afe('0x3f')]=qs[_0x3afe('0x37')](_['pick'](_0x5e54dc[_0x3afe('0x36')],_0x450d1e[_0x3afe('0x37')]));if(_0x5e54dc[_0x3afe('0x36')][_0x3afe('0x41')]){_0x37f49d[_0x3afe('0x3f')]=_['merge'](_0x37f49d[_0x3afe('0x3f')],{'$or':_['map'](_0x37f49d[_0x3afe('0x38')],function(_0x519f53){var _0x18c0e6={};_0x18c0e6[_0x519f53]={'$like':'%'+_0x5e54dc[_0x3afe('0x36')][_0x3afe('0x41')]+'%'};return _0x18c0e6;})});}_0x37f49d=_[_0x3afe('0x42')]({},_0x37f49d,_0x5e54dc[_0x3afe('0x4a')]);return _0x99ca15[_0x3afe('0x52')](_0x37f49d);}})[_0x3afe('0x28')](function(_0x50de8b){if(_0x50de8b){_0xe8a117=_0x50de8b['length'];if(!_0x5e54dc[_0x3afe('0x36')][_0x3afe('0x3c')]('nolimit')){_0x37f49d[_0x3afe('0x20')]=qs[_0x3afe('0x20')](_0x5e54dc[_0x3afe('0x36')][_0x3afe('0x20')]);_0x37f49d[_0x3afe('0x1e')]=qs[_0x3afe('0x1e')](_0x5e54dc[_0x3afe('0x36')][_0x3afe('0x1e')]);}return _0x99ca15[_0x3afe('0x52')](_0x37f49d);}})[_0x3afe('0x28')](function(_0x2032b6){if(_0x2032b6){return _0x2032b6?{'count':_0xe8a117,'rows':_0x2032b6}:null;}})[_0x3afe('0x28')](respondWithResult(_0x3ac47f,null))['catch'](handleError(_0x3ac47f,null));};exports[_0x3afe('0x54')]=function(_0x56ff99,_0x1f2c30,_0xf59255){return db[_0x3afe('0x55')][_0x3afe('0x4b')]({'where':{'id':_0x56ff99[_0x3afe('0x48')]['id']}})['then'](handleEntityNotFound(_0x1f2c30,null))['then'](function(_0x1dd229){if(_0x1dd229){return _0x1dd229[_0x3afe('0x54')](_0x56ff99[_0x3afe('0x4e')]['ids'],_[_0x3afe('0x56')](_0x56ff99['body'],[_0x3afe('0x51'),'id'])||{});}})[_0x3afe('0x28')](respondWithResult(_0x1f2c30,null))[_0x3afe('0x4c')](handleError(_0x1f2c30,null));};exports[_0x3afe('0x57')]=function(_0x15327e,_0x23a4e6,_0x12b4db){var _0x1f1ab4={};var _0x2cc2c1={};var _0x535b27;var _0x25ca1e;return db[_0x3afe('0x31')][_0x3afe('0x53')]({'where':{'id':_0x15327e['params']['id']}})[_0x3afe('0x28')](handleEntityNotFound(_0x23a4e6,null))[_0x3afe('0x28')](function(_0x3be2bf){if(_0x3be2bf){_0x535b27=_0x3be2bf;_0x2cc2c1[_0x3afe('0x35')]=_[_0x3afe('0x49')](db[_0x3afe('0x55')][_0x3afe('0x32')]);_0x2cc2c1[_0x3afe('0x36')]=_[_0x3afe('0x49')](_0x15327e[_0x3afe('0x36')]);_0x2cc2c1[_0x3afe('0x37')]=_['intersection'](_0x2cc2c1['model'],_0x2cc2c1['query']);_0x1f1ab4[_0x3afe('0x38')]=_[_0x3afe('0x39')](_0x2cc2c1[_0x3afe('0x35')],qs['fields'](_0x15327e[_0x3afe('0x36')][_0x3afe('0x3a')]));_0x1f1ab4[_0x3afe('0x38')]=_0x1f1ab4['attributes'][_0x3afe('0x3b')]?_0x1f1ab4[_0x3afe('0x38')]:_0x2cc2c1[_0x3afe('0x35')];_0x1f1ab4[_0x3afe('0x3d')]=qs[_0x3afe('0x3e')](_0x15327e[_0x3afe('0x36')]['sort']);_0x1f1ab4['where']=qs['filters'](_[_0x3afe('0x40')](_0x15327e['query'],_0x2cc2c1[_0x3afe('0x37')]));if(_0x15327e[_0x3afe('0x36')][_0x3afe('0x41')]){_0x1f1ab4[_0x3afe('0x3f')]=_['merge'](_0x1f1ab4[_0x3afe('0x3f')],{'$or':_[_0x3afe('0x30')](_0x1f1ab4[_0x3afe('0x38')],function(_0x3b887e){var _0x3c1c6f={};_0x3c1c6f[_0x3b887e]={'$like':'%'+_0x15327e['query'][_0x3afe('0x41')]+'%'};return _0x3c1c6f;})});}_0x1f1ab4=_['merge']({},_0x1f1ab4,_0x15327e['options']);return _0x535b27[_0x3afe('0x57')](_0x1f1ab4);}})['then'](function(_0x21fbb0){if(_0x21fbb0){_0x25ca1e=_0x21fbb0['length'];if(!_0x15327e['query'][_0x3afe('0x3c')](_0x3afe('0x58'))){_0x1f1ab4[_0x3afe('0x20')]=qs['limit'](_0x15327e[_0x3afe('0x36')]['limit']);_0x1f1ab4[_0x3afe('0x1e')]=qs['offset'](_0x15327e[_0x3afe('0x36')][_0x3afe('0x1e')]);}return _0x535b27[_0x3afe('0x57')](_0x1f1ab4);}})[_0x3afe('0x28')](function(_0x3f5e5e){if(_0x3f5e5e){return _0x3f5e5e?{'count':_0x25ca1e,'rows':_0x3f5e5e}:null;}})['then'](respondWithResult(_0x23a4e6,null))[_0x3afe('0x4c')](handleError(_0x23a4e6,null));}; \ No newline at end of file +var _0x2613=['body','destroy','Condition','ids','omit','findOne','getConditions','addActions','Action','getActions','eml-format','rimraf','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','name','index','map','Automation','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create'];(function(_0x3eb79b,_0x3bb982){var _0x37cac7=function(_0x41c218){while(--_0x41c218){_0x3eb79b['push'](_0x3eb79b['shift']());}};_0x37cac7(++_0x3bb982);}(_0x2613,0x10f));var _0x3261=function(_0x5ad008,_0x3ae9c9){_0x5ad008=_0x5ad008-0x0;var _0xf21ae6=_0x2613[_0x5ad008];return _0xf21ae6;};'use strict';var emlformat=require(_0x3261('0x0'));var rimraf=require(_0x3261('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3261('0x2'));var rp=require(_0x3261('0x3'));var moment=require(_0x3261('0x4'));var BPromise=require(_0x3261('0x5'));var Mustache=require(_0x3261('0x6'));var util=require(_0x3261('0x7'));var path=require(_0x3261('0x8'));var sox=require(_0x3261('0x9'));var csv=require(_0x3261('0xa'));var ejs=require(_0x3261('0xb'));var fs=require('fs');var fs_extra=require(_0x3261('0xc'));var _=require(_0x3261('0xd'));var squel=require(_0x3261('0xe'));var crypto=require(_0x3261('0xf'));var jsforce=require(_0x3261('0x10'));var deskjs=require(_0x3261('0x11'));var toCsv=require(_0x3261('0xa'));var querystring=require(_0x3261('0x12'));var Papa=require(_0x3261('0x13'));var Redis=require('ioredis');var authService=require(_0x3261('0x14'));var qs=require(_0x3261('0x15'));var as=require(_0x3261('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3261('0x17'))(_0x3261('0x18'));var utils=require(_0x3261('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3261('0x1a'))['db'];function respondWithStatusCode(_0x221503,_0x111cce){_0x111cce=_0x111cce||0xcc;return function(_0x10bdd0){if(_0x10bdd0){return _0x221503[_0x3261('0x1b')](_0x111cce);}return _0x221503['status'](_0x111cce)['end']();};}function respondWithResult(_0x32edd8,_0x12e618){_0x12e618=_0x12e618||0xc8;return function(_0x581379){if(_0x581379){return _0x32edd8[_0x3261('0x1c')](_0x12e618)[_0x3261('0x1d')](_0x581379);}};}function respondWithFilteredResult(_0x63b6fb,_0x25b900){return function(_0x3f0dba){if(_0x3f0dba){var _0x1ec948=typeof _0x25b900[_0x3261('0x1e')]===_0x3261('0x1f')&&typeof _0x25b900['limit']===_0x3261('0x1f');var _0xbdce97=_0x3f0dba[_0x3261('0x20')];var _0x1411a5=_0x1ec948?0x0:_0x25b900[_0x3261('0x1e')];var _0x14b738=_0x1ec948?_0x3f0dba[_0x3261('0x20')]:_0x25b900[_0x3261('0x1e')]+_0x25b900[_0x3261('0x21')];var _0x4b8e08;if(_0x14b738>=_0xbdce97){_0x14b738=_0xbdce97;_0x4b8e08=0xc8;}else{_0x4b8e08=0xce;}_0x63b6fb['status'](_0x4b8e08);return _0x63b6fb[_0x3261('0x22')](_0x3261('0x23'),_0x1411a5+'-'+_0x14b738+'/'+_0xbdce97)[_0x3261('0x1d')](_0x3f0dba);}return null;};}function patchUpdates(_0xab9e5f){return function(_0x18b924){try{jsonpatch[_0x3261('0x24')](_0x18b924,_0xab9e5f,!![]);}catch(_0x558b58){return BPromise[_0x3261('0x25')](_0x558b58);}return _0x18b924[_0x3261('0x26')]();};}function saveUpdates(_0x25c94c,_0x238273){return function(_0x2e7c94){if(_0x2e7c94){return _0x2e7c94[_0x3261('0x27')](_0x25c94c)['then'](function(_0x22c018){return _0x22c018;});}return null;};}function removeEntity(_0x39edf6,_0x444d89){return function(_0x53d85f){if(_0x53d85f){return _0x53d85f['destroy']()[_0x3261('0x28')](function(){_0x39edf6[_0x3261('0x1c')](0xcc)[_0x3261('0x29')]();});}};}function handleEntityNotFound(_0x1bb3b3,_0x25d364){return function(_0x2250a9){if(!_0x2250a9){_0x1bb3b3[_0x3261('0x1b')](0x194);}return _0x2250a9;};}function handleError(_0xddabc,_0x4b3b75){_0x4b3b75=_0x4b3b75||0x1f4;return function(_0x263d09){logger[_0x3261('0x2a')](_0x263d09['stack']);if(_0x263d09['name']){delete _0x263d09[_0x3261('0x2b')];}_0xddabc[_0x3261('0x1c')](_0x4b3b75)['send'](_0x263d09);};}exports[_0x3261('0x2c')]=function(_0x5e824e,_0x3e0348){var _0x499526={},_0x22965d={},_0x52bb15={'count':0x0,'rows':[]};var _0x29493c=_[_0x3261('0x2d')](db[_0x3261('0x2e')][_0x3261('0x2f')],function(_0x8535e0){return{'name':_0x8535e0[_0x3261('0x30')],'type':_0x8535e0['type']['key']};});_0x22965d[_0x3261('0x31')]=_['map'](_0x29493c,_0x3261('0x2b'));_0x22965d[_0x3261('0x32')]=_[_0x3261('0x33')](_0x5e824e[_0x3261('0x32')]);_0x22965d[_0x3261('0x34')]=_[_0x3261('0x35')](_0x22965d[_0x3261('0x31')],_0x22965d[_0x3261('0x32')]);_0x499526[_0x3261('0x36')]=_[_0x3261('0x35')](_0x22965d[_0x3261('0x31')],qs[_0x3261('0x37')](_0x5e824e[_0x3261('0x32')][_0x3261('0x37')]));_0x499526[_0x3261('0x36')]=_0x499526[_0x3261('0x36')][_0x3261('0x38')]?_0x499526['attributes']:_0x22965d['model'];if(!_0x5e824e[_0x3261('0x32')][_0x3261('0x39')](_0x3261('0x3a'))){_0x499526[_0x3261('0x21')]=qs['limit'](_0x5e824e[_0x3261('0x32')][_0x3261('0x21')]);_0x499526[_0x3261('0x1e')]=qs[_0x3261('0x1e')](_0x5e824e['query']['offset']);}_0x499526[_0x3261('0x3b')]=qs[_0x3261('0x3c')](_0x5e824e['query'][_0x3261('0x3c')]);_0x499526['where']=qs[_0x3261('0x34')](_[_0x3261('0x3d')](_0x5e824e[_0x3261('0x32')],_0x22965d[_0x3261('0x34')]),_0x29493c);if(_0x5e824e[_0x3261('0x32')][_0x3261('0x3e')]){_0x499526['where']=_[_0x3261('0x3f')](_0x499526[_0x3261('0x40')],{'$or':_[_0x3261('0x2d')](_0x29493c,function(_0x1eb884){if(_0x1eb884[_0x3261('0x41')]!==_0x3261('0x42')){var _0xd0010b={};_0xd0010b[_0x1eb884['name']]={'$like':'%'+_0x5e824e[_0x3261('0x32')]['filter']+'%'};return _0xd0010b;}})});}_0x499526=_[_0x3261('0x3f')]({},_0x499526,_0x5e824e[_0x3261('0x43')]);var _0x372e3d={'where':_0x499526['where']};return db[_0x3261('0x2e')][_0x3261('0x20')](_0x372e3d)[_0x3261('0x28')](function(_0x4f6ac5){_0x52bb15[_0x3261('0x20')]=_0x4f6ac5;if(_0x5e824e['query'][_0x3261('0x44')]){_0x499526[_0x3261('0x45')]=[{'all':!![]}];}return db['Automation'][_0x3261('0x46')](_0x499526);})[_0x3261('0x28')](function(_0x5acbcf){_0x52bb15[_0x3261('0x47')]=_0x5acbcf;return _0x52bb15;})['then'](respondWithFilteredResult(_0x3e0348,_0x499526))[_0x3261('0x48')](handleError(_0x3e0348,null));};exports[_0x3261('0x49')]=function(_0x5b2f9,_0x5a14a1){var _0x3b8504={'raw':![],'where':{'id':_0x5b2f9[_0x3261('0x4a')]['id']}},_0x3f0950={};_0x3f0950[_0x3261('0x31')]=_[_0x3261('0x33')](db[_0x3261('0x2e')][_0x3261('0x2f')]);_0x3f0950[_0x3261('0x32')]=_['keys'](_0x5b2f9['query']);_0x3f0950[_0x3261('0x34')]=_[_0x3261('0x35')](_0x3f0950['model'],_0x3f0950['query']);_0x3b8504[_0x3261('0x36')]=_[_0x3261('0x35')](_0x3f0950['model'],qs[_0x3261('0x37')](_0x5b2f9['query']['fields']));_0x3b8504[_0x3261('0x36')]=_0x3b8504[_0x3261('0x36')]['length']?_0x3b8504[_0x3261('0x36')]:_0x3f0950['model'];if(_0x5b2f9['query'][_0x3261('0x44')]){_0x3b8504[_0x3261('0x45')]=[{'all':!![]}];}_0x3b8504=_[_0x3261('0x3f')]({},_0x3b8504,_0x5b2f9[_0x3261('0x43')]);return db[_0x3261('0x2e')][_0x3261('0x4b')](_0x3b8504)[_0x3261('0x28')](handleEntityNotFound(_0x5a14a1,null))[_0x3261('0x28')](respondWithResult(_0x5a14a1,null))[_0x3261('0x48')](handleError(_0x5a14a1,null));};exports[_0x3261('0x4c')]=function(_0x1bf4de,_0x21d7e5){return db[_0x3261('0x2e')][_0x3261('0x4c')](_0x1bf4de[_0x3261('0x4d')],{})[_0x3261('0x28')](respondWithResult(_0x21d7e5,0xc9))[_0x3261('0x48')](handleError(_0x21d7e5,null));};exports[_0x3261('0x27')]=function(_0x5b8eec,_0x38fe72){if(_0x5b8eec['body']['id']){delete _0x5b8eec[_0x3261('0x4d')]['id'];}return db['Automation'][_0x3261('0x4b')]({'where':{'id':_0x5b8eec[_0x3261('0x4a')]['id']}})[_0x3261('0x28')](handleEntityNotFound(_0x38fe72,null))[_0x3261('0x28')](saveUpdates(_0x5b8eec[_0x3261('0x4d')],null))[_0x3261('0x28')](respondWithResult(_0x38fe72,null))[_0x3261('0x48')](handleError(_0x38fe72,null));};exports[_0x3261('0x4e')]=function(_0x38cf8b,_0x47a916){return db[_0x3261('0x2e')][_0x3261('0x4b')]({'where':{'id':_0x38cf8b[_0x3261('0x4a')]['id']}})[_0x3261('0x28')](handleEntityNotFound(_0x47a916,null))[_0x3261('0x28')](removeEntity(_0x47a916,null))['catch'](handleError(_0x47a916,null));};exports['addConditions']=function(_0x1dd27e,_0x51f4f7,_0x4a7d4c){return db[_0x3261('0x4f')][_0x3261('0x4b')]({'where':{'id':_0x1dd27e[_0x3261('0x4a')]['id']}})[_0x3261('0x28')](handleEntityNotFound(_0x51f4f7,null))['then'](function(_0x2ef896){if(_0x2ef896){return _0x2ef896['addConditions'](_0x1dd27e['body'][_0x3261('0x50')],_[_0x3261('0x51')](_0x1dd27e[_0x3261('0x4d')],[_0x3261('0x50'),'id'])||{});}})[_0x3261('0x28')](respondWithResult(_0x51f4f7,null))[_0x3261('0x48')](handleError(_0x51f4f7,null));};exports['getConditions']=function(_0x74d22a,_0x29ae89,_0x3558b3){var _0x230ee5={};var _0x346c9d={};var _0x2522a5;var _0x4b943a;return db['Automation'][_0x3261('0x52')]({'where':{'id':_0x74d22a[_0x3261('0x4a')]['id']}})[_0x3261('0x28')](handleEntityNotFound(_0x29ae89,null))[_0x3261('0x28')](function(_0x113cab){if(_0x113cab){_0x2522a5=_0x113cab;_0x346c9d['model']=_[_0x3261('0x33')](db['Condition'][_0x3261('0x2f')]);_0x346c9d['query']=_[_0x3261('0x33')](_0x74d22a[_0x3261('0x32')]);_0x346c9d[_0x3261('0x34')]=_[_0x3261('0x35')](_0x346c9d[_0x3261('0x31')],_0x346c9d[_0x3261('0x32')]);_0x230ee5[_0x3261('0x36')]=_[_0x3261('0x35')](_0x346c9d[_0x3261('0x31')],qs['fields'](_0x74d22a[_0x3261('0x32')][_0x3261('0x37')]));_0x230ee5[_0x3261('0x36')]=_0x230ee5[_0x3261('0x36')][_0x3261('0x38')]?_0x230ee5['attributes']:_0x346c9d[_0x3261('0x31')];_0x230ee5['order']=qs[_0x3261('0x3c')](_0x74d22a[_0x3261('0x32')][_0x3261('0x3c')]);_0x230ee5['where']=qs[_0x3261('0x34')](_['pick'](_0x74d22a[_0x3261('0x32')],_0x346c9d[_0x3261('0x34')]));if(_0x74d22a['query'][_0x3261('0x3e')]){_0x230ee5[_0x3261('0x40')]=_[_0x3261('0x3f')](_0x230ee5['where'],{'$or':_[_0x3261('0x2d')](_0x230ee5[_0x3261('0x36')],function(_0x5ce429){var _0x52bbe3={};_0x52bbe3[_0x5ce429]={'$like':'%'+_0x74d22a[_0x3261('0x32')][_0x3261('0x3e')]+'%'};return _0x52bbe3;})});}_0x230ee5=_[_0x3261('0x3f')]({},_0x230ee5,_0x74d22a[_0x3261('0x43')]);return _0x2522a5['getConditions'](_0x230ee5);}})[_0x3261('0x28')](function(_0x1d4e4a){if(_0x1d4e4a){_0x4b943a=_0x1d4e4a[_0x3261('0x38')];if(!_0x74d22a[_0x3261('0x32')][_0x3261('0x39')](_0x3261('0x3a'))){_0x230ee5['limit']=qs[_0x3261('0x21')](_0x74d22a['query'][_0x3261('0x21')]);_0x230ee5[_0x3261('0x1e')]=qs['offset'](_0x74d22a[_0x3261('0x32')][_0x3261('0x1e')]);}return _0x2522a5[_0x3261('0x53')](_0x230ee5);}})[_0x3261('0x28')](function(_0x10c430){if(_0x10c430){return _0x10c430?{'count':_0x4b943a,'rows':_0x10c430}:null;}})[_0x3261('0x28')](respondWithResult(_0x29ae89,null))[_0x3261('0x48')](handleError(_0x29ae89,null));};exports[_0x3261('0x54')]=function(_0x295863,_0x102404,_0x1f5af9){return db[_0x3261('0x55')][_0x3261('0x4b')]({'where':{'id':_0x295863[_0x3261('0x4a')]['id']}})['then'](handleEntityNotFound(_0x102404,null))[_0x3261('0x28')](function(_0x1af79e){if(_0x1af79e){return _0x1af79e['addActions'](_0x295863[_0x3261('0x4d')][_0x3261('0x50')],_[_0x3261('0x51')](_0x295863[_0x3261('0x4d')],[_0x3261('0x50'),'id'])||{});}})[_0x3261('0x28')](respondWithResult(_0x102404,null))[_0x3261('0x48')](handleError(_0x102404,null));};exports['getActions']=function(_0x5067b4,_0x30e57b,_0x2999ff){var _0x2f0b34={};var _0x30a782={};var _0x4a9e2a;var _0xae6866;return db[_0x3261('0x2e')]['findOne']({'where':{'id':_0x5067b4[_0x3261('0x4a')]['id']}})['then'](handleEntityNotFound(_0x30e57b,null))[_0x3261('0x28')](function(_0xd0bc39){if(_0xd0bc39){_0x4a9e2a=_0xd0bc39;_0x30a782[_0x3261('0x31')]=_[_0x3261('0x33')](db[_0x3261('0x55')][_0x3261('0x2f')]);_0x30a782[_0x3261('0x32')]=_['keys'](_0x5067b4[_0x3261('0x32')]);_0x30a782[_0x3261('0x34')]=_['intersection'](_0x30a782['model'],_0x30a782[_0x3261('0x32')]);_0x2f0b34[_0x3261('0x36')]=_[_0x3261('0x35')](_0x30a782[_0x3261('0x31')],qs[_0x3261('0x37')](_0x5067b4[_0x3261('0x32')][_0x3261('0x37')]));_0x2f0b34[_0x3261('0x36')]=_0x2f0b34['attributes'][_0x3261('0x38')]?_0x2f0b34['attributes']:_0x30a782[_0x3261('0x31')];_0x2f0b34['order']=qs[_0x3261('0x3c')](_0x5067b4[_0x3261('0x32')][_0x3261('0x3c')]);_0x2f0b34[_0x3261('0x40')]=qs[_0x3261('0x34')](_[_0x3261('0x3d')](_0x5067b4[_0x3261('0x32')],_0x30a782['filters']));if(_0x5067b4[_0x3261('0x32')][_0x3261('0x3e')]){_0x2f0b34[_0x3261('0x40')]=_['merge'](_0x2f0b34[_0x3261('0x40')],{'$or':_[_0x3261('0x2d')](_0x2f0b34[_0x3261('0x36')],function(_0x2e18a1){var _0x1ce3fb={};_0x1ce3fb[_0x2e18a1]={'$like':'%'+_0x5067b4[_0x3261('0x32')][_0x3261('0x3e')]+'%'};return _0x1ce3fb;})});}_0x2f0b34=_[_0x3261('0x3f')]({},_0x2f0b34,_0x5067b4[_0x3261('0x43')]);return _0x4a9e2a[_0x3261('0x56')](_0x2f0b34);}})[_0x3261('0x28')](function(_0x59c158){if(_0x59c158){_0xae6866=_0x59c158[_0x3261('0x38')];if(!_0x5067b4[_0x3261('0x32')][_0x3261('0x39')](_0x3261('0x3a'))){_0x2f0b34[_0x3261('0x21')]=qs[_0x3261('0x21')](_0x5067b4['query'][_0x3261('0x21')]);_0x2f0b34['offset']=qs[_0x3261('0x1e')](_0x5067b4[_0x3261('0x32')]['offset']);}return _0x4a9e2a[_0x3261('0x56')](_0x2f0b34);}})[_0x3261('0x28')](function(_0x143159){if(_0x143159){return _0x143159?{'count':_0xae6866,'rows':_0x143159}:null;}})['then'](respondWithResult(_0x30e57b,null))['catch'](handleError(_0x30e57b,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 3cc747a..8c6cc26 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 _0xf36e=['path','rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x23d2a6,_0x4a2dd5){var _0x4d7dac=function(_0x185c45){while(--_0x185c45){_0x23d2a6['push'](_0x23d2a6['shift']());}};_0x4d7dac(++_0x4a2dd5);}(_0xf36e,0x85));var _0xef36=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf36e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xef36('0x0'));var util=require(_0xef36('0x1'));var logger=require(_0xef36('0x2'))(_0xef36('0x3'));var moment=require(_0xef36('0x4'));var BPromise=require(_0xef36('0x5'));var rp=require(_0xef36('0x6'));var fs=require('fs');var path=require(_0xef36('0x7'));var rimraf=require(_0xef36('0x8'));var config=require(_0xef36('0x9'));var attributes=require(_0xef36('0xa'));module['exports']=function(_0x148990,_0x2b9ac3){return _0x148990[_0xef36('0xb')](_0xef36('0xc'),attributes,{'tableName':_0xef36('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e53=['./automation.attributes','exports','define','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4ac10f,_0x4d9cb8){var _0x41cb6a=function(_0x39d183){while(--_0x39d183){_0x4ac10f['push'](_0x4ac10f['shift']());}};_0x41cb6a(++_0x4d9cb8);}(_0x0e53,0x79));var _0x30e5=function(_0x58030f,_0x3a01c2){_0x58030f=_0x58030f-0x0;var _0x32cf0f=_0x0e53[_0x58030f];return _0x32cf0f;};'use strict';var _=require(_0x30e5('0x0'));var util=require(_0x30e5('0x1'));var logger=require(_0x30e5('0x2'))(_0x30e5('0x3'));var moment=require(_0x30e5('0x4'));var BPromise=require(_0x30e5('0x5'));var rp=require(_0x30e5('0x6'));var fs=require('fs');var path=require(_0x30e5('0x7'));var rimraf=require('rimraf');var config=require(_0x30e5('0x8'));var attributes=require(_0x30e5('0x9'));module[_0x30e5('0xa')]=function(_0x2cb5da,_0x10c556){return _0x2cb5da[_0x30e5('0xb')]('Automation',attributes,{'tableName':_0x30e5('0xc'),'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 32ce599..a03a256 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 _0x8cda=['../../config/environment','client','http','request','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x5817e6,_0x44a2d0){var _0x51916a=function(_0x1a56e3){while(--_0x1a56e3){_0x5817e6['push'](_0x5817e6['shift']());}};_0x51916a(++_0x44a2d0);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa8cd('0x0'));var moment=require(_0xa8cd('0x1'));var BPromise=require(_0xa8cd('0x2'));var rs=require(_0xa8cd('0x3'));var fs=require('fs');var Redis=require(_0xa8cd('0x4'));var db=require(_0xa8cd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8cd('0x6'))(_0xa8cd('0x7'));var config=require(_0xa8cd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8cd('0x9')][_0xa8cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1362c3,_0x273d2f,_0x2b9b51){return new BPromise(function(_0x2481ba,_0x13f394){return client[_0xa8cd('0xb')](_0x1362c3,_0x2b9b51)['then'](function(_0x50b8ee){logger['info'](_0xa8cd('0xc'),_0x273d2f,'request\x20sent');logger[_0xa8cd('0xd')](_0xa8cd('0xe'),_0x273d2f,'request\x20sent',JSON[_0xa8cd('0xf')](_0x50b8ee));if(_0x50b8ee[_0xa8cd('0x10')]){if(_0x50b8ee['error']['code']===0x1f4){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x50b8ee[_0xa8cd('0x10')][_0xa8cd('0x11')]);return _0x13f394(_0x50b8ee[_0xa8cd('0x10')]['message']);}logger[_0xa8cd('0x10')]('Automation,\x20%s,\x20%s',_0x273d2f,_0x50b8ee[_0xa8cd('0x10')]['message']);return _0x2481ba(_0x50b8ee[_0xa8cd('0x10')]['message']);}else{logger[_0xa8cd('0x12')](_0xa8cd('0xc'),_0x273d2f,_0xa8cd('0x13'));_0x2481ba(_0x50b8ee['result']['message']);}})[_0xa8cd('0x14')](function(_0x6d5f40){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x6d5f40);_0x13f394(_0x6d5f40);});});} \ No newline at end of file +var _0xbff2=['jayson/promise','debug','request\x20sent','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x254b72,_0x3c1a89){var _0x4d6cd8=function(_0x14e84e){while(--_0x14e84e){_0x254b72['push'](_0x254b72['shift']());}};_0x4d6cd8(++_0x3c1a89);}(_0xbff2,0x10e));var _0x2bff=function(_0xf479f9,_0x52a316){_0xf479f9=_0xf479f9-0x0;var _0x21766b=_0xbff2[_0xf479f9];return _0x21766b;};'use strict';var _=require(_0x2bff('0x0'));var util=require(_0x2bff('0x1'));var moment=require(_0x2bff('0x2'));var BPromise=require(_0x2bff('0x3'));var rs=require(_0x2bff('0x4'));var fs=require('fs');var Redis=require(_0x2bff('0x5'));var db=require(_0x2bff('0x6'))['db'];var utils=require(_0x2bff('0x7'));var logger=require(_0x2bff('0x8'))('rpc');var config=require(_0x2bff('0x9'));var jayson=require(_0x2bff('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48838e,_0x318d56,_0x34f4a0){return new BPromise(function(_0x4f5537,_0x1aa341){return client['request'](_0x48838e,_0x34f4a0)['then'](function(_0x172498){logger['info']('Automation,\x20%s,\x20%s',_0x318d56,'request\x20sent');logger[_0x2bff('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x318d56,_0x2bff('0xc'),JSON[_0x2bff('0xd')](_0x172498));if(_0x172498['error']){if(_0x172498[_0x2bff('0xe')][_0x2bff('0xf')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x318d56,_0x172498[_0x2bff('0xe')][_0x2bff('0x10')]);return _0x1aa341(_0x172498['error'][_0x2bff('0x10')]);}logger[_0x2bff('0xe')]('Automation,\x20%s,\x20%s',_0x318d56,_0x172498[_0x2bff('0xe')][_0x2bff('0x10')]);return _0x4f5537(_0x172498[_0x2bff('0xe')][_0x2bff('0x10')]);}else{logger['info'](_0x2bff('0x11'),_0x318d56,_0x2bff('0xc'));_0x4f5537(_0x172498[_0x2bff('0x12')][_0x2bff('0x10')]);}})[_0x2bff('0x13')](function(_0x3fd79e){logger['error'](_0x2bff('0x11'),_0x318d56,_0x3fd79e);_0x1aa341(_0x3fd79e);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index bb0b9c7..ccb5ad8 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 _0x4a80=['post','addConditions','addActions','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','create'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0x4a80,0xbe));var _0x04a8=function(_0x43cc1c,_0x2b38b8){_0x43cc1c=_0x43cc1c-0x0;var _0x5a0ae8=_0x4a80[_0x43cc1c];return _0x5a0ae8;};'use strict';var multer=require(_0x04a8('0x0'));var util=require('util');var path=require(_0x04a8('0x1'));var timeout=require(_0x04a8('0x2'));var express=require('express');var router=express[_0x04a8('0x3')]();var fs_extra=require(_0x04a8('0x4'));var auth=require(_0x04a8('0x5'));var interaction=require(_0x04a8('0x6'));var config=require(_0x04a8('0x7'));var controller=require(_0x04a8('0x8'));router[_0x04a8('0x9')]('/',auth[_0x04a8('0xa')](),controller[_0x04a8('0xb')]);router[_0x04a8('0x9')]('/:id',auth[_0x04a8('0xa')](),controller[_0x04a8('0xc')]);router[_0x04a8('0x9')](_0x04a8('0xd'),auth[_0x04a8('0xa')](),controller[_0x04a8('0xe')]);router[_0x04a8('0x9')](_0x04a8('0xf'),auth[_0x04a8('0xa')](),controller[_0x04a8('0x10')]);router['post']('/',auth[_0x04a8('0xa')](),controller[_0x04a8('0x11')]);router[_0x04a8('0x12')]('/:id/conditions',auth[_0x04a8('0xa')](),controller[_0x04a8('0x13')]);router[_0x04a8('0x12')](_0x04a8('0xf'),auth[_0x04a8('0xa')](),controller[_0x04a8('0x14')]);router[_0x04a8('0x15')]('/:id',auth[_0x04a8('0xa')](),controller[_0x04a8('0x16')]);router[_0x04a8('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x04a8('0x18')]);module[_0x04a8('0x19')]=router; \ No newline at end of file +var _0xbc82=['isAuthenticated','show','get','/:id/conditions','post','create','addConditions','/:id/actions','addActions','put','/:id','update','delete','destroy','multer','express','../../components/auth/service','./automation.controller','index'];(function(_0x2c044c,_0x217c40){var _0x2144a0=function(_0x3a4696){while(--_0x3a4696){_0x2c044c['push'](_0x2c044c['shift']());}};_0x2144a0(++_0x217c40);}(_0xbc82,0x13e));var _0x2bc8=function(_0xa610e3,_0x43edb7){_0xa610e3=_0xa610e3-0x0;var _0x2a0ef0=_0xbc82[_0xa610e3];return _0x2a0ef0;};'use strict';var multer=require(_0x2bc8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2bc8('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2bc8('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2bc8('0x3'));router['get']('/',auth['isAuthenticated'](),controller[_0x2bc8('0x4')]);router['get']('/:id',auth[_0x2bc8('0x5')](),controller[_0x2bc8('0x6')]);router[_0x2bc8('0x7')](_0x2bc8('0x8'),auth[_0x2bc8('0x5')](),controller['getConditions']);router[_0x2bc8('0x7')]('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0x2bc8('0x9')]('/',auth[_0x2bc8('0x5')](),controller[_0x2bc8('0xa')]);router[_0x2bc8('0x9')](_0x2bc8('0x8'),auth[_0x2bc8('0x5')](),controller[_0x2bc8('0xb')]);router[_0x2bc8('0x9')](_0x2bc8('0xc'),auth['isAuthenticated'](),controller[_0x2bc8('0xd')]);router[_0x2bc8('0xe')](_0x2bc8('0xf'),auth[_0x2bc8('0x5')](),controller[_0x2bc8('0x10')]);router[_0x2bc8('0x11')](_0x2bc8('0xf'),auth[_0x2bc8('0x5')](),controller[_0x2bc8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index e6c1d16..e221f71 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 _0xb89a=['STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','ENUM'];(function(_0xbc256d,_0x2a5cc6){var _0x3d74c9=function(_0x127c02){while(--_0x127c02){_0xbc256d['push'](_0xbc256d['shift']());}};_0x3d74c9(++_0x2a5cc6);}(_0xb89a,0xde));var _0xab89=function(_0x5c660a,_0x4b5262){_0x5c660a=_0x5c660a-0x0;var _0x3a77a4=_0xb89a[_0x5c660a];return _0x3a77a4;};'use strict';var Sequelize=require(_0xab89('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xab89('0x1')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xab89('0x2')]},'active':{'type':Sequelize[_0xab89('0x3')],'defaultValue':0x0,'comment':_0xab89('0x4')},'limitCalls':{'type':Sequelize[_0xab89('0x5')](0x4)[_0xab89('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xab89('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xab89('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xab89('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab89('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)[_0xab89('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)[_0xab89('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab89('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab89('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)[_0xab89('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xab89('0xa')},'dialTimezone':{'type':Sequelize[_0xab89('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xab89('0x2')],'defaultValue':_0xab89('0xb')},'dialCheckDuplicateType':{'type':Sequelize[_0xab89('0x1')](_0xab89('0xc'),_0xab89('0xd'),'onlyIfOpen'),'defaultValue':_0xab89('0xc')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xab89('0xe')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xab89('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xab89('0xf')},'dialAMDGreeting':{'type':Sequelize[_0xab89('0x5')](0x9)[_0xab89('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xab89('0x10')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xab89('0x5')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xab89('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xab89('0x5')](0x9)[_0xab89('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xab89('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xab89('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xab89('0x12')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xab89('0x13')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xab89('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xab89('0x14'),_0xab89('0x15')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab89('0x16')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab89('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab89('0x17')},'dialDropRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)[_0xab89('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab89('0x18')},'dialMachineMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab89('0x19')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xab89('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab89('0x1a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab89('0x1b')}}; \ No newline at end of file +var _0x9731=['Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Word\x20Length','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)'];(function(_0xc92670,_0x5256d2){var _0xbfa743=function(_0x1fcad1){while(--_0x1fcad1){_0xc92670['push'](_0xc92670['shift']());}};_0xbfa743(++_0x5256d2);}(_0x9731,0x1a5));var _0x1973=function(_0x15d5f4,_0x2a56cc){_0x15d5f4=_0x15d5f4-0x0;var _0x1aeabf=_0x9731[_0x15d5f4];return _0x1aeabf;};'use strict';var Sequelize=require('sequelize');module[_0x1973('0x0')]={'name':{'type':Sequelize[_0x1973('0x1')],'unique':_0x1973('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1973('0x3')](_0x1973('0x4')),'allowNull':![],'defaultValue':_0x1973('0x4')},'description':{'type':Sequelize[_0x1973('0x1')]},'active':{'type':Sequelize[_0x1973('0x5')],'defaultValue':0x0,'comment':_0x1973('0x6')},'limitCalls':{'type':Sequelize[_0x1973('0x7')](0x4)[_0x1973('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1973('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1973('0x7')](0x3)[_0x1973('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1973('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1973('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1973('0x7')](0x5)[_0x1973('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1973('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1973('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1973('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1973('0x7')](0x5)[_0x1973('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1973('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1973('0x7')](0x3)[_0x1973('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1973('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1973('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1973('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1973('0x1')],'defaultValue':_0x1973('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x1973('0x3')]('always',_0x1973('0x11'),_0x1973('0x12')),'defaultValue':_0x1973('0x13')},'dialAMDActive':{'type':Sequelize[_0x1973('0x5')],'defaultValue':0x0,'comment':_0x1973('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x1973('0x7')](0x9)[_0x1973('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1973('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x1973('0x7')](0x9)[_0x1973('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1973('0x7')](0x9)[_0x1973('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1973('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1973('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x1973('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1973('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1973('0x7')](0x9)[_0x1973('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x1973('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1973('0x7')](0x5)[_0x1973('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1973('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1973('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1973('0x3')]('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x1973('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x1973('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1973('0x19')},'dialCutDigit':{'type':Sequelize[_0x1973('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1973('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1973('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1973('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1973('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1973('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1973('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1973('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x1973('0x7')](0x5)[_0x1973('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1973('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1973('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1973('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1973('0x7')](0x5)[_0x1973('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1973('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x1973('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1973('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1973('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1973('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1973('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1973('0x7')](0x5)[_0x1973('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1973('0x23')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 0a6f900..b3901c0 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 _0xc15c=['field','phone','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','NOW()','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','zip-dir','fast-json-patch','request-promise','bluebird','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','IvrCampaigns','UserProfileResource','destroy','error','stack','name','index','map','Campaign','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','find','getHoppers','findOne','nolimit','pick','CmHopper','rows','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ListId','select'];(function(_0x2d554f,_0x284acd){var _0x579473=function(_0x4f155c){while(--_0x4f155c){_0x2d554f['push'](_0x2d554f['shift']());}};_0x579473(++_0x284acd);}(_0xc15c,0xae));var _0xcc15=function(_0x1148a1,_0x6c920e){_0x1148a1=_0x1148a1-0x0;var _0x101a8c=_0xc15c[_0x1148a1];return _0x101a8c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcc15('0x0'));var jsonpatch=require(_0xcc15('0x1'));var rp=require(_0xcc15('0x2'));var moment=require('moment');var BPromise=require(_0xcc15('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcc15('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcc15('0x5'));var fs=require('fs');var fs_extra=require(_0xcc15('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcc15('0x7'));var jsforce=require(_0xcc15('0x8'));var deskjs=require(_0xcc15('0x9'));var toCsv=require(_0xcc15('0xa'));var querystring=require(_0xcc15('0xb'));var Papa=require('papaparse');var Redis=require(_0xcc15('0xc'));var authService=require(_0xcc15('0xd'));var qs=require(_0xcc15('0xe'));var as=require(_0xcc15('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc15('0x10'))(_0xcc15('0x11'));var utils=require(_0xcc15('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcc15('0x13'))['db'];function respondWithStatusCode(_0x49344c,_0x45667d){_0x45667d=_0x45667d||0xcc;return function(_0x5bddf5){if(_0x5bddf5){return _0x49344c[_0xcc15('0x14')](_0x45667d);}return _0x49344c['status'](_0x45667d)[_0xcc15('0x15')]();};}function respondWithResult(_0x5e59fa,_0x812431){_0x812431=_0x812431||0xc8;return function(_0x1ffa48){if(_0x1ffa48){return _0x5e59fa[_0xcc15('0x16')](_0x812431)[_0xcc15('0x17')](_0x1ffa48);}};}function respondWithFilteredResult(_0x5ecb66,_0x52a7bf){return function(_0x55421d){if(_0x55421d){var _0x591c2f=typeof _0x52a7bf[_0xcc15('0x18')]===_0xcc15('0x19')&&typeof _0x52a7bf[_0xcc15('0x1a')]==='undefined';var _0x587186=_0x55421d[_0xcc15('0x1b')];var _0x5ca31a=_0x591c2f?0x0:_0x52a7bf[_0xcc15('0x18')];var _0x293f7c=_0x591c2f?_0x55421d[_0xcc15('0x1b')]:_0x52a7bf['offset']+_0x52a7bf['limit'];var _0x327797;if(_0x293f7c>=_0x587186){_0x293f7c=_0x587186;_0x327797=0xc8;}else{_0x327797=0xce;}_0x5ecb66[_0xcc15('0x16')](_0x327797);return _0x5ecb66['set'](_0xcc15('0x1c'),_0x5ca31a+'-'+_0x293f7c+'/'+_0x587186)[_0xcc15('0x17')](_0x55421d);}return null;};}function patchUpdates(_0x3f574c){return function(_0x4cf37e){try{jsonpatch[_0xcc15('0x1d')](_0x4cf37e,_0x3f574c,!![]);}catch(_0x4e9f99){return BPromise[_0xcc15('0x1e')](_0x4e9f99);}return _0x4cf37e['save']();};}function saveUpdates(_0x2f2910,_0xc49a73){return function(_0x610317){if(_0x610317){return _0x610317[_0xcc15('0x1f')](_0x2f2910)['then'](function(_0x1778c1){return _0x1778c1;});}return null;};}function removeEntity(_0x25c171,_0x40b917){return function(_0x168ee9){if(_0x168ee9){return _0x168ee9['destroy']()[_0xcc15('0x20')](function(){var _0x1a4f95=_0x168ee9['get']({'plain':!![]});var _0x5a8598=_0xcc15('0x21');return db[_0xcc15('0x22')][_0xcc15('0x23')]({'where':{'type':_0x5a8598,'resourceId':_0x1a4f95['id']}})[_0xcc15('0x20')](function(){return _0x168ee9;});})['then'](function(){_0x25c171[_0xcc15('0x16')](0xcc)[_0xcc15('0x15')]();});}};}function handleEntityNotFound(_0x4f4af8,_0x10e94a){return function(_0x5eff3b){if(!_0x5eff3b){_0x4f4af8['sendStatus'](0x194);}return _0x5eff3b;};}function handleError(_0xb92104,_0x4ced34){_0x4ced34=_0x4ced34||0x1f4;return function(_0x481c4e){logger[_0xcc15('0x24')](_0x481c4e[_0xcc15('0x25')]);if(_0x481c4e[_0xcc15('0x26')]){delete _0x481c4e[_0xcc15('0x26')];}_0xb92104[_0xcc15('0x16')](_0x4ced34)['send'](_0x481c4e);};}exports[_0xcc15('0x27')]=function(_0x37c14b,_0x840c99){var _0x22631b={},_0x3c6102={},_0x42a740={'count':0x0,'rows':[]};var _0xa44d17=_[_0xcc15('0x28')](db[_0xcc15('0x29')][_0xcc15('0x2a')],function(_0x491c12){return{'name':_0x491c12['fieldName'],'type':_0x491c12[_0xcc15('0x2b')][_0xcc15('0x2c')]};});_0x3c6102[_0xcc15('0x2d')]=_[_0xcc15('0x28')](_0xa44d17,_0xcc15('0x26'));_0x3c6102[_0xcc15('0x2e')]=_['keys'](_0x37c14b[_0xcc15('0x2e')]);_0x3c6102['filters']=_[_0xcc15('0x2f')](_0x3c6102[_0xcc15('0x2d')],_0x3c6102[_0xcc15('0x2e')]);_0x22631b[_0xcc15('0x30')]=_[_0xcc15('0x2f')](_0x3c6102[_0xcc15('0x2d')],qs[_0xcc15('0x31')](_0x37c14b[_0xcc15('0x2e')][_0xcc15('0x31')]));_0x22631b[_0xcc15('0x30')]=_0x22631b['attributes'][_0xcc15('0x32')]?_0x22631b[_0xcc15('0x30')]:_0x3c6102[_0xcc15('0x2d')];if(!_0x37c14b[_0xcc15('0x2e')][_0xcc15('0x33')]('nolimit')){_0x22631b[_0xcc15('0x1a')]=qs[_0xcc15('0x1a')](_0x37c14b[_0xcc15('0x2e')]['limit']);_0x22631b['offset']=qs[_0xcc15('0x18')](_0x37c14b[_0xcc15('0x2e')]['offset']);}_0x22631b[_0xcc15('0x34')]=qs['sort'](_0x37c14b[_0xcc15('0x2e')][_0xcc15('0x35')]);_0x22631b[_0xcc15('0x36')]=qs[_0xcc15('0x37')](_['pick'](_0x37c14b[_0xcc15('0x2e')],_0x3c6102[_0xcc15('0x37')]),_0xa44d17);if(_0x37c14b[_0xcc15('0x2e')][_0xcc15('0x38')]){_0x22631b[_0xcc15('0x36')]=_[_0xcc15('0x39')](_0x22631b[_0xcc15('0x36')],{'$or':_[_0xcc15('0x28')](_0xa44d17,function(_0x3cbab2){if(_0x3cbab2[_0xcc15('0x2b')]!==_0xcc15('0x3a')){var _0x20f5c2={};_0x20f5c2[_0x3cbab2[_0xcc15('0x26')]]={'$like':'%'+_0x37c14b[_0xcc15('0x2e')][_0xcc15('0x38')]+'%'};return _0x20f5c2;}})});}_0x22631b=_['merge']({},_0x22631b,_0x37c14b[_0xcc15('0x3b')]);var _0x44e479={'where':_0x22631b['where']};return db[_0xcc15('0x29')][_0xcc15('0x1b')](_0x44e479)[_0xcc15('0x20')](function(_0x32bfcc){_0x42a740[_0xcc15('0x1b')]=_0x32bfcc;if(_0x37c14b[_0xcc15('0x2e')][_0xcc15('0x3c')]){_0x22631b[_0xcc15('0x3d')]=[{'all':!![]}];}return db[_0xcc15('0x29')][_0xcc15('0x3e')](_0x22631b);})[_0xcc15('0x20')](function(_0x3178af){_0x42a740['rows']=_0x3178af;return _0x42a740;})['then'](respondWithFilteredResult(_0x840c99,_0x22631b))[_0xcc15('0x3f')](handleError(_0x840c99,null));};exports[_0xcc15('0x40')]=function(_0x1be276,_0x24be80){var _0x56dc90={'raw':![],'where':{'id':_0x1be276[_0xcc15('0x41')]['id']}},_0x408108={};_0x408108['model']=_['keys'](db[_0xcc15('0x29')][_0xcc15('0x2a')]);_0x408108[_0xcc15('0x2e')]=_[_0xcc15('0x42')](_0x1be276[_0xcc15('0x2e')]);_0x408108[_0xcc15('0x37')]=_['intersection'](_0x408108[_0xcc15('0x2d')],_0x408108[_0xcc15('0x2e')]);_0x56dc90['attributes']=_[_0xcc15('0x2f')](_0x408108['model'],qs['fields'](_0x1be276[_0xcc15('0x2e')]['fields']));_0x56dc90[_0xcc15('0x30')]=_0x56dc90['attributes'][_0xcc15('0x32')]?_0x56dc90[_0xcc15('0x30')]:_0x408108[_0xcc15('0x2d')];if(_0x1be276[_0xcc15('0x2e')][_0xcc15('0x3c')]){_0x56dc90[_0xcc15('0x3d')]=[{'all':!![]}];}_0x56dc90=_['merge']({},_0x56dc90,_0x1be276[_0xcc15('0x3b')]);return db[_0xcc15('0x29')]['find'](_0x56dc90)[_0xcc15('0x20')](handleEntityNotFound(_0x24be80,null))[_0xcc15('0x20')](respondWithResult(_0x24be80,null))[_0xcc15('0x3f')](handleError(_0x24be80,null));};exports[_0xcc15('0x43')]=function(_0x5f08bb,_0x31460b){return db[_0xcc15('0x29')][_0xcc15('0x43')](_0x5f08bb[_0xcc15('0x44')],{})[_0xcc15('0x20')](function(_0x2014b3){var _0x1611dc=_0x5f08bb[_0xcc15('0x45')][_0xcc15('0x46')]({'plain':!![]});if(!_0x1611dc)throw new Error(_0xcc15('0x47'));if(_0x1611dc[_0xcc15('0x48')]===_0xcc15('0x45')){var _0x34c6b1=_0x2014b3[_0xcc15('0x46')]({'plain':!![]});var _0x8bd575=_0xcc15('0x21');return db['UserProfileSection']['find']({'where':{'name':_0x8bd575,'userProfileId':_0x1611dc['userProfileId']},'raw':!![]})['then'](function(_0x649487){if(_0x649487&&_0x649487[_0xcc15('0x49')]===0x0){return db[_0xcc15('0x22')][_0xcc15('0x43')]({'name':_0x34c6b1['name'],'resourceId':_0x34c6b1['id'],'type':_0x649487[_0xcc15('0x26')],'sectionId':_0x649487['id']},{})[_0xcc15('0x20')](function(){return _0x2014b3;});}else{return _0x2014b3;}})[_0xcc15('0x3f')](function(_0x12b9e9){logger[_0xcc15('0x24')](_0xcc15('0x4a'),_0x12b9e9);throw _0x12b9e9;});}return _0x2014b3;})[_0xcc15('0x20')](respondWithResult(_0x31460b,0xc9))['catch'](handleError(_0x31460b,null));};exports[_0xcc15('0x4b')]=function(_0x2efc1d,_0x3db19a){var _0x1d59a9={'where':{'id':_0x2efc1d['params']['id']}},_0x131966={};_0x131966[_0xcc15('0x2d')]=_[_0xcc15('0x42')](db['Campaign'][_0xcc15('0x2a')]);_0x1d59a9['attributes']=_[_0xcc15('0x2f')](_0x131966[_0xcc15('0x2d')],qs[_0xcc15('0x31')](_0x2efc1d[_0xcc15('0x2e')][_0xcc15('0x31')]));_0x1d59a9[_0xcc15('0x30')]=_0x1d59a9[_0xcc15('0x30')][_0xcc15('0x32')]?_0x1d59a9[_0xcc15('0x30')]:_0x131966[_0xcc15('0x2d')];if(_0x2efc1d[_0xcc15('0x2e')][_0xcc15('0x3c')]){_0x1d59a9[_0xcc15('0x3d')]=[{'all':!![]}];}_0x1d59a9=_['merge']({},_0x1d59a9,_0x2efc1d[_0xcc15('0x3b')]);return db[_0xcc15('0x29')]['find'](_0x1d59a9)['then'](handleEntityNotFound(_0x3db19a,null))['then'](function(_0x411063){if(_0x411063){var _0x1cae9c=_0x411063[_0xcc15('0x46')]({'plain':!![]});_0x1cae9c=qs[_0xcc15('0x4c')](_0x1cae9c,['id',_0xcc15('0x4d'),_0xcc15('0x4e')]);_0x2efc1d[_0xcc15('0x44')]=_['omit'](_0x2efc1d[_0xcc15('0x44')],['id',_0xcc15('0x4d'),_0xcc15('0x4e')]);return db[_0xcc15('0x29')][_0xcc15('0x43')](_[_0xcc15('0x39')](_0x1cae9c,_0x2efc1d['body']),{'include':_0x2efc1d[_0xcc15('0x2e')][_0xcc15('0x3c')]?[{'all':!![]}]:undefined})[_0xcc15('0x20')](function(_0x35057a){var _0x121317=_0x2efc1d[_0xcc15('0x45')][_0xcc15('0x46')]({'plain':!![]});if(!_0x121317)throw new Error(_0xcc15('0x47'));if(_0x121317[_0xcc15('0x48')]==='user'){var _0xe660f6=_0x35057a[_0xcc15('0x46')]({'plain':!![]});var _0x3d5770='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x3d5770,'userProfileId':_0x121317[_0xcc15('0x4f')]},'raw':!![]})[_0xcc15('0x20')](function(_0x446243){if(_0x446243&&_0x446243[_0xcc15('0x49')]===0x0){return db[_0xcc15('0x22')]['create']({'name':_0xe660f6[_0xcc15('0x26')],'resourceId':_0xe660f6['id'],'type':_0x446243[_0xcc15('0x26')],'sectionId':_0x446243['id']},{})[_0xcc15('0x20')](function(){return _0x35057a;});}else{return _0x35057a;}})[_0xcc15('0x3f')](function(_0x2c8eca){logger['error'](_0xcc15('0x4a'),_0x2c8eca);throw _0x2c8eca;});}return _0x35057a;});}})[_0xcc15('0x20')](respondWithResult(_0x3db19a,0xc9))[_0xcc15('0x3f')](handleError(_0x3db19a,null));};exports['update']=function(_0x4e8840,_0x26da42){if(_0x4e8840[_0xcc15('0x44')]['id']){delete _0x4e8840[_0xcc15('0x44')]['id'];}return db[_0xcc15('0x29')][_0xcc15('0x50')]({'where':{'id':_0x4e8840[_0xcc15('0x41')]['id']}})['then'](handleEntityNotFound(_0x26da42,null))[_0xcc15('0x20')](saveUpdates(_0x4e8840[_0xcc15('0x44')],null))[_0xcc15('0x20')](respondWithResult(_0x26da42,null))[_0xcc15('0x3f')](handleError(_0x26da42,null));};exports['destroy']=function(_0x1a0dd9,_0x4d1e84){return db[_0xcc15('0x29')][_0xcc15('0x50')]({'where':{'id':_0x1a0dd9['params']['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x4d1e84,null))['then'](removeEntity(_0x4d1e84,null))[_0xcc15('0x3f')](handleError(_0x4d1e84,null));};exports[_0xcc15('0x51')]=function(_0x174451,_0x2d443b,_0x3693b7){var _0x2f00bc={'raw':!![],'where':{}};var _0x481385={};var _0x534557={'count':0x0,'rows':[]};return db[_0xcc15('0x29')][_0xcc15('0x52')]({'where':{'id':_0x174451['params']['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x2d443b,null))[_0xcc15('0x20')](function(_0x44a60c){if(_0x44a60c){_0x481385['model']=_[_0xcc15('0x42')](db['CmHopper'][_0xcc15('0x2a')]);_0x481385[_0xcc15('0x2e')]=_[_0xcc15('0x42')](_0x174451[_0xcc15('0x2e')]);_0x481385[_0xcc15('0x37')]=_[_0xcc15('0x2f')](_0x481385['model'],_0x481385[_0xcc15('0x2e')]);_0x2f00bc[_0xcc15('0x30')]=_[_0xcc15('0x2f')](_0x481385[_0xcc15('0x2d')],qs['fields'](_0x174451['query'][_0xcc15('0x31')]));_0x2f00bc[_0xcc15('0x30')]=_0x2f00bc[_0xcc15('0x30')][_0xcc15('0x32')]?_0x2f00bc[_0xcc15('0x30')]:_0x481385[_0xcc15('0x2d')];if(!_0x174451[_0xcc15('0x2e')][_0xcc15('0x33')](_0xcc15('0x53'))){_0x2f00bc[_0xcc15('0x1a')]=qs[_0xcc15('0x1a')](_0x174451[_0xcc15('0x2e')][_0xcc15('0x1a')]);_0x2f00bc[_0xcc15('0x18')]=qs[_0xcc15('0x18')](_0x174451['query'][_0xcc15('0x18')]);}_0x2f00bc[_0xcc15('0x34')]=qs[_0xcc15('0x35')](_0x174451[_0xcc15('0x2e')]['sort']);_0x2f00bc['where']=qs['filters'](_[_0xcc15('0x54')](_0x174451['query'],_0x481385[_0xcc15('0x37')]));_0x2f00bc[_0xcc15('0x36')]['CampaignId']=_0x44a60c['id'];if(_0x174451[_0xcc15('0x2e')][_0xcc15('0x38')]){_0x2f00bc[_0xcc15('0x36')]=_['merge'](_0x2f00bc['where'],{'$or':_[_0xcc15('0x28')](_0x2f00bc[_0xcc15('0x30')],function(_0x4ae079){var _0x497f6b={};_0x497f6b[_0x4ae079]={'$like':'%'+_0x174451[_0xcc15('0x2e')][_0xcc15('0x38')]+'%'};return _0x497f6b;})});}_0x2f00bc=_[_0xcc15('0x39')]({},_0x2f00bc,_0x174451[_0xcc15('0x3b')]);return db['CmHopper'][_0xcc15('0x1b')]({'where':_0x2f00bc[_0xcc15('0x36')]})[_0xcc15('0x20')](function(_0x2f02b9){_0x534557[_0xcc15('0x1b')]=_0x2f02b9;if(_0x174451[_0xcc15('0x2e')][_0xcc15('0x3c')]){_0x2f00bc[_0xcc15('0x3d')]=[{'all':!![]}];}return db[_0xcc15('0x55')][_0xcc15('0x3e')](_0x2f00bc);})[_0xcc15('0x20')](function(_0x4f0211){_0x534557[_0xcc15('0x56')]=_0x4f0211;return _0x534557;});}})[_0xcc15('0x20')](respondWithFilteredResult(_0x2d443b,_0x2f00bc))[_0xcc15('0x3f')](handleError(_0x2d443b,null));};exports['getHopperHistories']=function(_0x5b81b9,_0x49f873,_0x14dda7){var _0x5bb6c5={'raw':!![],'where':{}};var _0x467cd6={};var _0x9777cb={'count':0x0,'rows':[]};return db['Campaign'][_0xcc15('0x52')]({'where':{'id':_0x5b81b9['params']['id']}})['then'](handleEntityNotFound(_0x49f873,null))[_0xcc15('0x20')](function(_0x58520a){if(_0x58520a){_0x467cd6[_0xcc15('0x2d')]=_['keys'](db[_0xcc15('0x57')][_0xcc15('0x2a')]);_0x467cd6['query']=_['keys'](_0x5b81b9[_0xcc15('0x2e')]);_0x467cd6[_0xcc15('0x37')]=_[_0xcc15('0x2f')](_0x467cd6[_0xcc15('0x2d')],_0x467cd6[_0xcc15('0x2e')]);_0x5bb6c5[_0xcc15('0x30')]=_['intersection'](_0x467cd6[_0xcc15('0x2d')],qs[_0xcc15('0x31')](_0x5b81b9[_0xcc15('0x2e')][_0xcc15('0x31')]));_0x5bb6c5['attributes']=_0x5bb6c5['attributes'][_0xcc15('0x32')]?_0x5bb6c5[_0xcc15('0x30')]:_0x467cd6['model'];if(!_0x5b81b9[_0xcc15('0x2e')][_0xcc15('0x33')](_0xcc15('0x53'))){_0x5bb6c5[_0xcc15('0x1a')]=qs['limit'](_0x5b81b9['query']['limit']);_0x5bb6c5[_0xcc15('0x18')]=qs[_0xcc15('0x18')](_0x5b81b9['query'][_0xcc15('0x18')]);}_0x5bb6c5[_0xcc15('0x34')]=qs[_0xcc15('0x35')](_0x5b81b9[_0xcc15('0x2e')][_0xcc15('0x35')]);_0x5bb6c5[_0xcc15('0x36')]=qs['filters'](_[_0xcc15('0x54')](_0x5b81b9['query'],_0x467cd6[_0xcc15('0x37')]));_0x5bb6c5[_0xcc15('0x36')][_0xcc15('0x58')]=_0x58520a['id'];if(_0x5b81b9[_0xcc15('0x2e')][_0xcc15('0x38')]){_0x5bb6c5[_0xcc15('0x36')]=_['merge'](_0x5bb6c5[_0xcc15('0x36')],{'$or':_[_0xcc15('0x28')](_0x5bb6c5['attributes'],function(_0x212c94){var _0x2140e6={};_0x2140e6[_0x212c94]={'$like':'%'+_0x5b81b9[_0xcc15('0x2e')]['filter']+'%'};return _0x2140e6;})});}_0x5bb6c5=_['merge']({},_0x5bb6c5,_0x5b81b9[_0xcc15('0x3b')]);return db[_0xcc15('0x57')][_0xcc15('0x1b')]({'where':_0x5bb6c5[_0xcc15('0x36')]})['then'](function(_0x2486cf){_0x9777cb[_0xcc15('0x1b')]=_0x2486cf;if(_0x5b81b9[_0xcc15('0x2e')]['includeAll']){_0x5bb6c5['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xcc15('0x3e')](_0x5bb6c5);})['then'](function(_0x2c8bc3){_0x9777cb[_0xcc15('0x56')]=_0x2c8bc3;return _0x9777cb;});}})['then'](respondWithFilteredResult(_0x49f873,_0x5bb6c5))[_0xcc15('0x3f')](handleError(_0x49f873,null));};exports[_0xcc15('0x59')]=function(_0x12f962,_0x332cf6,_0x4dd017){var _0x175c18={'raw':!![],'where':{}};var _0x41f748={};var _0x148266={'count':0x0,'rows':[]};return db[_0xcc15('0x29')]['findOne']({'where':{'id':_0x12f962['params']['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x332cf6,null))[_0xcc15('0x20')](function(_0x4ab2b1){if(_0x4ab2b1){_0x41f748[_0xcc15('0x2d')]=_['keys'](db[_0xcc15('0x5a')][_0xcc15('0x2a')]);_0x41f748['query']=_['keys'](_0x12f962[_0xcc15('0x2e')]);_0x41f748[_0xcc15('0x37')]=_[_0xcc15('0x2f')](_0x41f748['model'],_0x41f748[_0xcc15('0x2e')]);_0x175c18[_0xcc15('0x30')]=_[_0xcc15('0x2f')](_0x41f748['model'],qs[_0xcc15('0x31')](_0x12f962[_0xcc15('0x2e')][_0xcc15('0x31')]));_0x175c18[_0xcc15('0x30')]=_0x175c18['attributes'][_0xcc15('0x32')]?_0x175c18['attributes']:_0x41f748[_0xcc15('0x2d')];if(!_0x12f962[_0xcc15('0x2e')]['hasOwnProperty'](_0xcc15('0x53'))){_0x175c18[_0xcc15('0x1a')]=qs[_0xcc15('0x1a')](_0x12f962[_0xcc15('0x2e')][_0xcc15('0x1a')]);_0x175c18[_0xcc15('0x18')]=qs['offset'](_0x12f962[_0xcc15('0x2e')][_0xcc15('0x18')]);}_0x175c18[_0xcc15('0x34')]=qs[_0xcc15('0x35')](_0x12f962[_0xcc15('0x2e')][_0xcc15('0x35')]);_0x175c18['where']=qs[_0xcc15('0x37')](_[_0xcc15('0x54')](_0x12f962['query'],_0x41f748['filters']));_0x175c18[_0xcc15('0x36')]['CampaignId']=_0x4ab2b1['id'];if(_0x12f962[_0xcc15('0x2e')]['filter']){_0x175c18[_0xcc15('0x36')]=_[_0xcc15('0x39')](_0x175c18[_0xcc15('0x36')],{'$or':_[_0xcc15('0x28')](_0x175c18['attributes'],function(_0x5c12f4){var _0x35faca={};_0x35faca[_0x5c12f4]={'$like':'%'+_0x12f962[_0xcc15('0x2e')][_0xcc15('0x38')]+'%'};return _0x35faca;})});}_0x175c18=_[_0xcc15('0x39')]({},_0x175c18,_0x12f962[_0xcc15('0x3b')]);return db[_0xcc15('0x5a')][_0xcc15('0x1b')]({'where':_0x175c18[_0xcc15('0x36')]})[_0xcc15('0x20')](function(_0x3f15ba){_0x148266['count']=_0x3f15ba;if(_0x12f962[_0xcc15('0x2e')][_0xcc15('0x3c')]){_0x175c18[_0xcc15('0x3d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xcc15('0x3e')](_0x175c18);})[_0xcc15('0x20')](function(_0x307b3b){_0x148266[_0xcc15('0x56')]=_0x307b3b;return _0x148266;});}})[_0xcc15('0x20')](respondWithFilteredResult(_0x332cf6,_0x175c18))['catch'](handleError(_0x332cf6,null));};exports[_0xcc15('0x5b')]=function(_0x3cbeb4,_0x484a12,_0x4d9c49){var _0x5e0368={'raw':!![],'where':{}};var _0x3f1e11={};var _0x262c13={'count':0x0,'rows':[]};return db[_0xcc15('0x29')][_0xcc15('0x52')]({'where':{'id':_0x3cbeb4[_0xcc15('0x41')]['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x484a12,null))['then'](function(_0x512646){if(_0x512646){_0x3f1e11[_0xcc15('0x2d')]=_[_0xcc15('0x42')](db['CmHopperBlack'][_0xcc15('0x2a')]);_0x3f1e11[_0xcc15('0x2e')]=_['keys'](_0x3cbeb4['query']);_0x3f1e11[_0xcc15('0x37')]=_['intersection'](_0x3f1e11['model'],_0x3f1e11[_0xcc15('0x2e')]);_0x5e0368[_0xcc15('0x30')]=_['intersection'](_0x3f1e11[_0xcc15('0x2d')],qs['fields'](_0x3cbeb4[_0xcc15('0x2e')]['fields']));_0x5e0368[_0xcc15('0x30')]=_0x5e0368['attributes'][_0xcc15('0x32')]?_0x5e0368['attributes']:_0x3f1e11[_0xcc15('0x2d')];if(!_0x3cbeb4[_0xcc15('0x2e')][_0xcc15('0x33')](_0xcc15('0x53'))){_0x5e0368[_0xcc15('0x1a')]=qs[_0xcc15('0x1a')](_0x3cbeb4[_0xcc15('0x2e')][_0xcc15('0x1a')]);_0x5e0368[_0xcc15('0x18')]=qs[_0xcc15('0x18')](_0x3cbeb4[_0xcc15('0x2e')]['offset']);}_0x5e0368[_0xcc15('0x34')]=qs[_0xcc15('0x35')](_0x3cbeb4[_0xcc15('0x2e')][_0xcc15('0x35')]);_0x5e0368[_0xcc15('0x36')]=qs[_0xcc15('0x37')](_[_0xcc15('0x54')](_0x3cbeb4[_0xcc15('0x2e')],_0x3f1e11[_0xcc15('0x37')]));_0x5e0368['where'][_0xcc15('0x58')]=_0x512646['id'];if(_0x3cbeb4[_0xcc15('0x2e')]['filter']){_0x5e0368[_0xcc15('0x36')]=_['merge'](_0x5e0368['where'],{'$or':_[_0xcc15('0x28')](_0x5e0368['attributes'],function(_0x5a2342){var _0x57ec7e={};_0x57ec7e[_0x5a2342]={'$like':'%'+_0x3cbeb4[_0xcc15('0x2e')][_0xcc15('0x38')]+'%'};return _0x57ec7e;})});}_0x5e0368=_[_0xcc15('0x39')]({},_0x5e0368,_0x3cbeb4[_0xcc15('0x3b')]);return db[_0xcc15('0x5c')][_0xcc15('0x1b')]({'where':_0x5e0368[_0xcc15('0x36')]})[_0xcc15('0x20')](function(_0x33a576){_0x262c13[_0xcc15('0x1b')]=_0x33a576;if(_0x3cbeb4['query'][_0xcc15('0x3c')]){_0x5e0368['include']=[{'all':!![]}];}return db[_0xcc15('0x5c')]['findAll'](_0x5e0368);})[_0xcc15('0x20')](function(_0x5096de){_0x262c13[_0xcc15('0x56')]=_0x5096de;return _0x262c13;});}})['then'](respondWithFilteredResult(_0x484a12,_0x5e0368))['catch'](handleError(_0x484a12,null));};exports[_0xcc15('0x5d')]=function(_0x460a59,_0x2d9261,_0x51a38b){var _0x31f886={};var _0x173437={};var _0x15e535;var _0x5456a2;return db[_0xcc15('0x29')][_0xcc15('0x52')]({'where':{'id':_0x460a59[_0xcc15('0x41')]['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x2d9261,null))['then'](function(_0x5f181d){if(_0x5f181d){_0x15e535=_0x5f181d;_0x173437[_0xcc15('0x2d')]=_['keys'](db[_0xcc15('0x5e')][_0xcc15('0x2a')]);_0x173437['query']=_['keys'](_0x460a59[_0xcc15('0x2e')]);_0x173437[_0xcc15('0x37')]=_[_0xcc15('0x2f')](_0x173437[_0xcc15('0x2d')],_0x173437['query']);_0x31f886[_0xcc15('0x30')]=_[_0xcc15('0x2f')](_0x173437['model'],qs[_0xcc15('0x31')](_0x460a59[_0xcc15('0x2e')][_0xcc15('0x31')]));_0x31f886['attributes']=_0x31f886['attributes']['length']?_0x31f886['attributes']:_0x173437[_0xcc15('0x2d')];_0x31f886['order']=qs['sort'](_0x460a59[_0xcc15('0x2e')]['sort']);_0x31f886[_0xcc15('0x36')]=qs['filters'](_[_0xcc15('0x54')](_0x460a59[_0xcc15('0x2e')],_0x173437[_0xcc15('0x37')]));if(_0x460a59[_0xcc15('0x2e')][_0xcc15('0x38')]){_0x31f886[_0xcc15('0x36')]=_[_0xcc15('0x39')](_0x31f886[_0xcc15('0x36')],{'$or':_[_0xcc15('0x28')](_0x31f886[_0xcc15('0x30')],function(_0x427167){var _0x165328={};_0x165328[_0x427167]={'$like':'%'+_0x460a59[_0xcc15('0x2e')][_0xcc15('0x38')]+'%'};return _0x165328;})});}_0x31f886=_[_0xcc15('0x39')]({},_0x31f886,_0x460a59[_0xcc15('0x3b')]);return _0x15e535[_0xcc15('0x5d')](_0x31f886);}})[_0xcc15('0x20')](function(_0x55bf14){if(_0x55bf14){_0x5456a2=_0x55bf14[_0xcc15('0x32')];if(!_0x460a59[_0xcc15('0x2e')][_0xcc15('0x33')](_0xcc15('0x53'))){_0x31f886[_0xcc15('0x1a')]=qs[_0xcc15('0x1a')](_0x460a59[_0xcc15('0x2e')]['limit']);_0x31f886[_0xcc15('0x18')]=qs[_0xcc15('0x18')](_0x460a59[_0xcc15('0x2e')][_0xcc15('0x18')]);}return _0x15e535[_0xcc15('0x5d')](_0x31f886);}})[_0xcc15('0x20')](function(_0x84689b){if(_0x84689b){return _0x84689b?{'count':_0x5456a2,'rows':_0x84689b}:null;}})['then'](respondWithResult(_0x2d9261,null))[_0xcc15('0x3f')](handleError(_0x2d9261,null));};exports[_0xcc15('0x5f')]=function(_0x5c7d9d,_0x30108b,_0x20f18f){var _0x26474e,_0x26959b;var _0x5ed9ec=[];var _0x3a5c37=moment()[_0xcc15('0x60')](_0xcc15('0x61'));return db[_0xcc15('0x29')][_0xcc15('0x50')]({'where':{'id':_0x5c7d9d[_0xcc15('0x41')]['id']}})['then'](handleEntityNotFound(_0x30108b,null))[_0xcc15('0x20')](function(_0x1c60fc){if(_0x1c60fc){_0x26959b=_0x1c60fc;return _0x1c60fc[_0xcc15('0x5f')](_0x5c7d9d[_0xcc15('0x44')][_0xcc15('0x62')],_[_0xcc15('0x4c')](_0x5c7d9d[_0xcc15('0x44')],['ids','id'])||{});}return null;})[_0xcc15('0x63')](function(_0x36ee8b){var _0x3d021c;var _0x4b3cd6;_0x26474e=_0x36ee8b||[];var _0x80f136=[];if(_0x36ee8b){for(var _0x122fa0=0x0;_0x122fa0<_0x36ee8b[_0xcc15('0x32')];_0x122fa0+=0x1){var _0x140902=_0x36ee8b[_0x122fa0][_0xcc15('0x46')]({'plain':!![]});_0x26959b[_0xcc15('0x64')]=_0x5c7d9d[_0xcc15('0x44')][_0xcc15('0x64')]?_0x5c7d9d[_0xcc15('0x44')][_0xcc15('0x64')]:_0x26959b['dialCheckDuplicateType'];switch(_0x26959b['dialCheckDuplicateType']){case _0xcc15('0x65'):_0x3d021c=squel[_0xcc15('0x66')]()[_0xcc15('0x67')]('cm_hopper')[_0xcc15('0x68')](['phone',_0xcc15('0x69'),'ContactId',_0xcc15('0x6a'),_0xcc15('0x58'),_0xcc15('0x4d'),_0xcc15('0x4e')],squel[_0xcc15('0x6b')]()[_0xcc15('0x6c')](_0xcc15('0x6d'),_0xcc15('0x6d'))[_0xcc15('0x6c')]('NOW()',_0xcc15('0x69'))[_0xcc15('0x6c')]('id',_0xcc15('0x6e'))[_0xcc15('0x6c')](_0x140902[_0xcc15('0x6f')][_0xcc15('0x70')](),_0xcc15('0x6a'))[_0xcc15('0x6c')](_0x5c7d9d['params']['id'][_0xcc15('0x70')](),_0xcc15('0x58'))[_0xcc15('0x6c')]('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4d'))['field']('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4e'))[_0xcc15('0x71')](_0xcc15('0x72'))['where'](_0xcc15('0x73'))[_0xcc15('0x36')](_0xcc15('0x74'),_0x140902[_0xcc15('0x6f')][_0xcc15('0x70')]())[_0xcc15('0x36')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xcc15('0x6b')]()[_0xcc15('0x6c')](_0xcc15('0x75'))['from'](_0xcc15('0x76'))['where']('CampaignId\x20=\x20?',_0x5c7d9d[_0xcc15('0x41')]['id']['toString']()))[_0xcc15('0x36')](_0xcc15('0x77'),squel['select']()[_0xcc15('0x6c')]('COALESCE(phone,\x27\x27)')[_0xcc15('0x71')](_0xcc15('0x78'))[_0xcc15('0x36')](_0xcc15('0x79'),_0x5c7d9d[_0xcc15('0x41')]['id'][_0xcc15('0x70')]())))[_0xcc15('0x70')]();break;case _0xcc15('0x7a'):_0x3d021c=squel[_0xcc15('0x66')]()[_0xcc15('0x67')](_0xcc15('0x78'))['fromQuery']([_0xcc15('0x6d'),'scheduledAt',_0xcc15('0x6e'),_0xcc15('0x6a'),_0xcc15('0x58'),_0xcc15('0x4d'),_0xcc15('0x4e')],squel[_0xcc15('0x6b')]()[_0xcc15('0x6c')](_0xcc15('0x6d'),'phone')[_0xcc15('0x6c')](_0xcc15('0x7b'),_0xcc15('0x69'))[_0xcc15('0x6c')]('id',_0xcc15('0x6e'))['field'](_0x140902[_0xcc15('0x6f')]['toString'](),_0xcc15('0x6a'))[_0xcc15('0x6c')](_0x5c7d9d[_0xcc15('0x41')]['id']['toString'](),_0xcc15('0x58'))[_0xcc15('0x6c')]('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4d'))[_0xcc15('0x6c')]('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4e'))[_0xcc15('0x71')]('cm_contacts')[_0xcc15('0x36')](_0xcc15('0x73'))[_0xcc15('0x36')](_0xcc15('0x74'),_0x140902[_0xcc15('0x6f')][_0xcc15('0x70')]())[_0xcc15('0x36')](_0xcc15('0x7c'))['where'](_0xcc15('0x77'),squel[_0xcc15('0x6b')]()[_0xcc15('0x6c')](_0xcc15('0x7d'))[_0xcc15('0x71')]('cm_hopper')[_0xcc15('0x36')](_0xcc15('0x79'),_0x5c7d9d[_0xcc15('0x41')]['id'][_0xcc15('0x70')]())))[_0xcc15('0x70')]();break;default:_0x3d021c=squel[_0xcc15('0x66')]()[_0xcc15('0x67')](_0xcc15('0x78'))['fromQuery']([_0xcc15('0x6d'),_0xcc15('0x69'),'ContactId',_0xcc15('0x6a'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0xcc15('0x6c')](_0xcc15('0x6d'),'phone')[_0xcc15('0x6c')](_0xcc15('0x7b'),_0xcc15('0x69'))[_0xcc15('0x6c')]('id',_0xcc15('0x6e'))[_0xcc15('0x6c')](_0x140902[_0xcc15('0x6f')][_0xcc15('0x70')](),_0xcc15('0x6a'))[_0xcc15('0x6c')](_0x5c7d9d[_0xcc15('0x41')]['id'][_0xcc15('0x70')](),'CampaignId')[_0xcc15('0x6c')]('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4d'))['field']('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4e'))['from'](_0xcc15('0x72'))['where'](_0xcc15('0x73'))[_0xcc15('0x36')]('ListId\x20=\x20?',_0x140902[_0xcc15('0x6f')][_0xcc15('0x70')]())[_0xcc15('0x36')](_0xcc15('0x7c')))[_0xcc15('0x70')]();}_0x4b3cd6=squel[_0xcc15('0x66')]()[_0xcc15('0x67')](_0xcc15('0x7e'))['fromQuery'](['cmHopperId',_0xcc15('0x69'),_0xcc15('0x6d'),'OrderBy',_0xcc15('0x4d'),_0xcc15('0x4e')],squel['select']()['field'](_0xcc15('0x7f'),'id')[_0xcc15('0x6c')](_0xcc15('0x7b'),_0xcc15('0x69'))[_0xcc15('0x6c')](_0xcc15('0x80'),_0xcc15('0x6d'))[_0xcc15('0x6c')](_0xcc15('0x81'),_0xcc15('0x82'))[_0xcc15('0x6c')]('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4d'))[_0xcc15('0x6c')]('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4e'))[_0xcc15('0x71')](_0xcc15('0x83'),'ci')[_0xcc15('0x84')](_0xcc15('0x78'),'h',_0xcc15('0x85'))['where']('h.ListId\x20=\x20?',_0x140902[_0xcc15('0x6f')]['toString']())[_0xcc15('0x36')]('h.CampaignId=?',_0x5c7d9d[_0xcc15('0x41')]['id']['toString']())['where']('h.createdAt\x20=\x20?',_0x3a5c37))['toString']();_0x80f136[_0xcc15('0x86')](db[_0xcc15('0x87')][_0xcc15('0x2e')](_0x3d021c));_0x5ed9ec['push'](db[_0xcc15('0x87')][_0xcc15('0x2e')](_0x4b3cd6));}return BPromise['all'](_0x80f136);}})[_0xcc15('0x20')](function(){return BPromise[_0xcc15('0x88')](_0x5ed9ec);})['then'](function(){return _0x26474e;})[_0xcc15('0x20')](respondWithResult(_0x30108b,null))[_0xcc15('0x3f')](handleError(_0x30108b,null));};exports[_0xcc15('0x89')]=function(_0x493ca5,_0x19c6f0,_0x45485b){return db[_0xcc15('0x29')][_0xcc15('0x50')]({'where':{'id':_0x493ca5[_0xcc15('0x41')]['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x19c6f0,null))['then'](function(_0x46bacb){if(_0x46bacb){return _0x46bacb[_0xcc15('0x89')](_0x493ca5[_0xcc15('0x2e')][_0xcc15('0x62')]);}})[_0xcc15('0x20')](function(_0x568edf){if(_0x568edf){return db['CmHopper']['destroy']({'where':{'ListId':_0x493ca5[_0xcc15('0x2e')][_0xcc15('0x62')],'CampaignId':_0x493ca5[_0xcc15('0x41')]['id']}})['then'](function(){return _0x568edf;});}})['then'](respondWithStatusCode(_0x19c6f0,null))[_0xcc15('0x3f')](handleError(_0x19c6f0,null));};exports[_0xcc15('0x8a')]=function(_0x26c6bc,_0x5e5722,_0x30124e){var _0x37f655={};var _0x1e76d9={};var _0x4f63b9;var _0x49ae00;return db[_0xcc15('0x29')]['findOne']({'where':{'id':_0x26c6bc[_0xcc15('0x41')]['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x5e5722,null))[_0xcc15('0x20')](function(_0x4a3ae4){if(_0x4a3ae4){_0x4f63b9=_0x4a3ae4;_0x1e76d9[_0xcc15('0x2d')]=_['keys'](db[_0xcc15('0x5e')][_0xcc15('0x2a')]);_0x1e76d9[_0xcc15('0x2e')]=_[_0xcc15('0x42')](_0x26c6bc['query']);_0x1e76d9['filters']=_[_0xcc15('0x2f')](_0x1e76d9[_0xcc15('0x2d')],_0x1e76d9[_0xcc15('0x2e')]);_0x37f655[_0xcc15('0x30')]=_[_0xcc15('0x2f')](_0x1e76d9['model'],qs[_0xcc15('0x31')](_0x26c6bc[_0xcc15('0x2e')][_0xcc15('0x31')]));_0x37f655[_0xcc15('0x30')]=_0x37f655[_0xcc15('0x30')][_0xcc15('0x32')]?_0x37f655[_0xcc15('0x30')]:_0x1e76d9[_0xcc15('0x2d')];_0x37f655['order']=qs['sort'](_0x26c6bc[_0xcc15('0x2e')][_0xcc15('0x35')]);_0x37f655[_0xcc15('0x36')]=qs[_0xcc15('0x37')](_[_0xcc15('0x54')](_0x26c6bc['query'],_0x1e76d9[_0xcc15('0x37')]));if(_0x26c6bc[_0xcc15('0x2e')][_0xcc15('0x38')]){_0x37f655[_0xcc15('0x36')]=_['merge'](_0x37f655[_0xcc15('0x36')],{'$or':_[_0xcc15('0x28')](_0x37f655[_0xcc15('0x30')],function(_0x1ea5aa){var _0x1e553f={};_0x1e553f[_0x1ea5aa]={'$like':'%'+_0x26c6bc[_0xcc15('0x2e')][_0xcc15('0x38')]+'%'};return _0x1e553f;})});}_0x37f655=_[_0xcc15('0x39')]({},_0x37f655,_0x26c6bc[_0xcc15('0x3b')]);return _0x4f63b9[_0xcc15('0x8a')](_0x37f655);}})[_0xcc15('0x20')](function(_0x3506e3){if(_0x3506e3){_0x49ae00=_0x3506e3[_0xcc15('0x32')];if(!_0x26c6bc[_0xcc15('0x2e')]['hasOwnProperty'](_0xcc15('0x53'))){_0x37f655['limit']=qs['limit'](_0x26c6bc[_0xcc15('0x2e')][_0xcc15('0x1a')]);_0x37f655['offset']=qs['offset'](_0x26c6bc[_0xcc15('0x2e')][_0xcc15('0x18')]);}return _0x4f63b9[_0xcc15('0x8a')](_0x37f655);}})[_0xcc15('0x20')](function(_0x264633){if(_0x264633){return _0x264633?{'count':_0x49ae00,'rows':_0x264633}:null;}})['then'](respondWithResult(_0x5e5722,null))[_0xcc15('0x3f')](handleError(_0x5e5722,null));};exports['addBlackLists']=function(_0x4fb508,_0x22e435,_0x1e599c){var _0x2cfea9,_0x3adcdf;var _0x435e01=[];var _0x4523ad=moment()[_0xcc15('0x60')](_0xcc15('0x61'));return db[_0xcc15('0x29')][_0xcc15('0x50')]({'where':{'id':_0x4fb508['params']['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x22e435,null))[_0xcc15('0x20')](function(_0x5a7f6b){if(_0x5a7f6b){_0x3adcdf=_0x5a7f6b;return _0x5a7f6b[_0xcc15('0x8b')](_0x4fb508['body'][_0xcc15('0x62')],_['omit'](_0x4fb508[_0xcc15('0x44')],[_0xcc15('0x62'),'id'])||{});}return null;})[_0xcc15('0x63')](function(_0x741320){var _0x4ef5df;var _0x318fd;_0x2cfea9=_0x741320||[];var _0x652363=[];if(_0x741320){for(var _0x7241f3=0x0;_0x7241f3<_0x741320[_0xcc15('0x32')];_0x7241f3+=0x1){var _0x264034=_0x741320[_0x7241f3][_0xcc15('0x46')]({'plain':!![]});_0x4ef5df=squel[_0xcc15('0x66')]()[_0xcc15('0x67')]('cm_hopper_black')['fromQuery']([_0xcc15('0x6d'),_0xcc15('0x6e'),_0xcc15('0x6a'),_0xcc15('0x58'),'createdAt',_0xcc15('0x4e')],squel[_0xcc15('0x6b')]()[_0xcc15('0x6c')](_0xcc15('0x6d'),'phone')[_0xcc15('0x6c')]('id',_0xcc15('0x6e'))[_0xcc15('0x6c')](_0x264034['CmListId'][_0xcc15('0x70')](),'ListId')['field'](_0x4fb508[_0xcc15('0x41')]['id'][_0xcc15('0x70')](),_0xcc15('0x58'))[_0xcc15('0x6c')](_0xcc15('0x7b'),_0xcc15('0x4d'))[_0xcc15('0x6c')](_0xcc15('0x7b'),_0xcc15('0x4e'))[_0xcc15('0x71')](_0xcc15('0x72'))[_0xcc15('0x36')](_0xcc15('0x73'))[_0xcc15('0x36')]('ListId\x20=\x20?',_0x264034['CmListId'][_0xcc15('0x70')]())[_0xcc15('0x36')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x652363[_0xcc15('0x86')](db['sequelize'][_0xcc15('0x2e')](_0x4ef5df));}return BPromise[_0xcc15('0x88')](_0x652363);}})[_0xcc15('0x20')](function(){return _0x2cfea9;})['then'](respondWithResult(_0x22e435,null))['catch'](handleError(_0x22e435,null));};exports[_0xcc15('0x8c')]=function(_0x563b06,_0x556823,_0x4bd0c4){return db[_0xcc15('0x29')]['find']({'where':{'id':_0x563b06[_0xcc15('0x41')]['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x556823,null))[_0xcc15('0x20')](function(_0x14c76a){if(_0x14c76a){return _0x14c76a[_0xcc15('0x8c')](_0x563b06[_0xcc15('0x2e')][_0xcc15('0x62')]);}})[_0xcc15('0x20')](function(_0x24f16a){if(_0x24f16a){return db[_0xcc15('0x5c')][_0xcc15('0x23')]({'where':{'ListId':_0x563b06['query']['ids'],'CampaignId':_0x563b06['params']['id']}})[_0xcc15('0x20')](function(){return _0x24f16a;});}})['then'](respondWithStatusCode(_0x556823,null))[_0xcc15('0x3f')](handleError(_0x556823,null));}; \ No newline at end of file +var _0xf123=['getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','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','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','send','Campaign','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','UserProfileSection','autoAssociation','clone','keys','find','createdAt','updatedAt','body','omit','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists'];(function(_0x1ef10c,_0x282d89){var _0x2f0f57=function(_0x1c3960){while(--_0x1c3960){_0x1ef10c['push'](_0x1ef10c['shift']());}};_0x2f0f57(++_0x282d89);}(_0xf123,0x134));var _0x3f12=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0xf123[_0x1bc013];return _0x55df36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f12('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f12('0x1'));var rp=require(_0x3f12('0x2'));var moment=require(_0x3f12('0x3'));var BPromise=require(_0x3f12('0x4'));var Mustache=require('mustache');var util=require(_0x3f12('0x5'));var path=require(_0x3f12('0x6'));var sox=require('sox');var csv=require(_0x3f12('0x7'));var ejs=require(_0x3f12('0x8'));var fs=require('fs');var fs_extra=require(_0x3f12('0x9'));var _=require('lodash');var squel=require(_0x3f12('0xa'));var crypto=require('crypto');var jsforce=require(_0x3f12('0xb'));var deskjs=require(_0x3f12('0xc'));var toCsv=require(_0x3f12('0x7'));var querystring=require(_0x3f12('0xd'));var Papa=require(_0x3f12('0xe'));var Redis=require(_0x3f12('0xf'));var authService=require(_0x3f12('0x10'));var qs=require(_0x3f12('0x11'));var as=require(_0x3f12('0x12'));var hardwareService=require(_0x3f12('0x13'));var logger=require('../../config/logger')(_0x3f12('0x14'));var utils=require(_0x3f12('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3f12('0x16'));var db=require(_0x3f12('0x17'))['db'];function respondWithStatusCode(_0x5b15b3,_0x11314f){_0x11314f=_0x11314f||0xcc;return function(_0x405e98){if(_0x405e98){return _0x5b15b3['sendStatus'](_0x11314f);}return _0x5b15b3['status'](_0x11314f)[_0x3f12('0x18')]();};}function respondWithResult(_0x55f98c,_0x492a79){_0x492a79=_0x492a79||0xc8;return function(_0xac202a){if(_0xac202a){return _0x55f98c[_0x3f12('0x19')](_0x492a79)['json'](_0xac202a);}};}function respondWithFilteredResult(_0x976001,_0x41c966){return function(_0x5e6777){if(_0x5e6777){var _0x4e2764=typeof _0x41c966[_0x3f12('0x1a')]===_0x3f12('0x1b')&&typeof _0x41c966[_0x3f12('0x1c')]===_0x3f12('0x1b');var _0x5900fe=_0x5e6777['count'];var _0x313188=_0x4e2764?0x0:_0x41c966['offset'];var _0x361c57=_0x4e2764?_0x5e6777[_0x3f12('0x1d')]:_0x41c966[_0x3f12('0x1a')]+_0x41c966['limit'];var _0x463940;if(_0x361c57>=_0x5900fe){_0x361c57=_0x5900fe;_0x463940=0xc8;}else{_0x463940=0xce;}_0x976001['status'](_0x463940);return _0x976001[_0x3f12('0x1e')](_0x3f12('0x1f'),_0x313188+'-'+_0x361c57+'/'+_0x5900fe)[_0x3f12('0x20')](_0x5e6777);}return null;};}function patchUpdates(_0xd9f2c3){return function(_0x24eb67){try{jsonpatch[_0x3f12('0x21')](_0x24eb67,_0xd9f2c3,!![]);}catch(_0x293d87){return BPromise[_0x3f12('0x22')](_0x293d87);}return _0x24eb67[_0x3f12('0x23')]();};}function saveUpdates(_0x551e07,_0x1e53ae){return function(_0x46a262){if(_0x46a262){return _0x46a262[_0x3f12('0x24')](_0x551e07)[_0x3f12('0x25')](function(_0x363ca5){return _0x363ca5;});}return null;};}function removeEntity(_0x25d5a1,_0xd5aebc){return function(_0xe22349){if(_0xe22349){return _0xe22349[_0x3f12('0x26')]()['then'](function(){var _0x48df32=_0xe22349[_0x3f12('0x27')]({'plain':!![]});var _0x584a15='IvrCampaigns';return db[_0x3f12('0x28')][_0x3f12('0x26')]({'where':{'type':_0x584a15,'resourceId':_0x48df32['id']}})[_0x3f12('0x25')](function(){return _0xe22349;});})['then'](function(){_0x25d5a1[_0x3f12('0x19')](0xcc)[_0x3f12('0x18')]();});}};}function handleEntityNotFound(_0x537a15,_0x56494c){return function(_0x10ce2f){if(!_0x10ce2f){_0x537a15[_0x3f12('0x29')](0x194);}return _0x10ce2f;};}function handleError(_0x86c38f,_0x520afb){_0x520afb=_0x520afb||0x1f4;return function(_0x512f53){logger[_0x3f12('0x2a')](_0x512f53[_0x3f12('0x2b')]);if(_0x512f53['name']){delete _0x512f53['name'];}_0x86c38f[_0x3f12('0x19')](_0x520afb)[_0x3f12('0x2c')](_0x512f53);};}exports['index']=function(_0x51cf33,_0x35e7b8){var _0x28c9e6={},_0x3bd4c5={},_0x5e6154={'count':0x0,'rows':[]};var _0x6297aa=_['map'](db[_0x3f12('0x2d')][_0x3f12('0x2e')],function(_0x587a23){return{'name':_0x587a23[_0x3f12('0x2f')],'type':_0x587a23[_0x3f12('0x30')][_0x3f12('0x31')]};});_0x3bd4c5[_0x3f12('0x32')]=_[_0x3f12('0x33')](_0x6297aa,_0x3f12('0x34'));_0x3bd4c5['query']=_['keys'](_0x51cf33[_0x3f12('0x35')]);_0x3bd4c5[_0x3f12('0x36')]=_[_0x3f12('0x37')](_0x3bd4c5['model'],_0x3bd4c5[_0x3f12('0x35')]);_0x28c9e6[_0x3f12('0x38')]=_[_0x3f12('0x37')](_0x3bd4c5[_0x3f12('0x32')],qs[_0x3f12('0x39')](_0x51cf33[_0x3f12('0x35')][_0x3f12('0x39')]));_0x28c9e6[_0x3f12('0x38')]=_0x28c9e6[_0x3f12('0x38')]['length']?_0x28c9e6[_0x3f12('0x38')]:_0x3bd4c5[_0x3f12('0x32')];if(!_0x51cf33[_0x3f12('0x35')]['hasOwnProperty'](_0x3f12('0x3a'))){_0x28c9e6[_0x3f12('0x1c')]=qs['limit'](_0x51cf33['query'][_0x3f12('0x1c')]);_0x28c9e6[_0x3f12('0x1a')]=qs[_0x3f12('0x1a')](_0x51cf33[_0x3f12('0x35')][_0x3f12('0x1a')]);}_0x28c9e6[_0x3f12('0x3b')]=qs[_0x3f12('0x3c')](_0x51cf33[_0x3f12('0x35')]['sort']);_0x28c9e6['where']=qs['filters'](_[_0x3f12('0x3d')](_0x51cf33[_0x3f12('0x35')],_0x3bd4c5[_0x3f12('0x36')]),_0x6297aa);if(_0x51cf33['query'][_0x3f12('0x3e')]){_0x28c9e6[_0x3f12('0x3f')]=_[_0x3f12('0x40')](_0x28c9e6['where'],{'$or':_[_0x3f12('0x33')](_0x6297aa,function(_0x1a28ca){if(_0x1a28ca[_0x3f12('0x30')]!==_0x3f12('0x41')){var _0x42bf12={};_0x42bf12[_0x1a28ca[_0x3f12('0x34')]]={'$like':'%'+_0x51cf33['query']['filter']+'%'};return _0x42bf12;}})});}_0x28c9e6=_[_0x3f12('0x40')]({},_0x28c9e6,_0x51cf33[_0x3f12('0x42')]);var _0x3655f4={'where':_0x28c9e6[_0x3f12('0x3f')]};return db[_0x3f12('0x2d')][_0x3f12('0x1d')](_0x3655f4)['then'](function(_0x2d0dd8){_0x5e6154[_0x3f12('0x1d')]=_0x2d0dd8;if(_0x51cf33[_0x3f12('0x35')][_0x3f12('0x43')]){_0x28c9e6[_0x3f12('0x44')]=[{'all':!![]}];}return db['Campaign'][_0x3f12('0x45')](_0x28c9e6);})['then'](function(_0x54cc3e){_0x5e6154[_0x3f12('0x46')]=_0x54cc3e;return _0x5e6154;})[_0x3f12('0x25')](respondWithFilteredResult(_0x35e7b8,_0x28c9e6))[_0x3f12('0x47')](handleError(_0x35e7b8,null));};exports[_0x3f12('0x48')]=function(_0x4bb12d,_0x5ed5aa){var _0x26af9c={'raw':![],'where':{'id':_0x4bb12d[_0x3f12('0x49')]['id']}},_0xeaf16c={};_0xeaf16c[_0x3f12('0x32')]=_['keys'](db['Campaign']['rawAttributes']);_0xeaf16c['query']=_['keys'](_0x4bb12d[_0x3f12('0x35')]);_0xeaf16c[_0x3f12('0x36')]=_[_0x3f12('0x37')](_0xeaf16c[_0x3f12('0x32')],_0xeaf16c['query']);_0x26af9c[_0x3f12('0x38')]=_[_0x3f12('0x37')](_0xeaf16c[_0x3f12('0x32')],qs[_0x3f12('0x39')](_0x4bb12d[_0x3f12('0x35')]['fields']));_0x26af9c[_0x3f12('0x38')]=_0x26af9c['attributes'][_0x3f12('0x4a')]?_0x26af9c[_0x3f12('0x38')]:_0xeaf16c[_0x3f12('0x32')];if(_0x4bb12d[_0x3f12('0x35')][_0x3f12('0x43')]){_0x26af9c[_0x3f12('0x44')]=[{'all':!![]}];}_0x26af9c=_[_0x3f12('0x40')]({},_0x26af9c,_0x4bb12d['options']);return db['Campaign']['find'](_0x26af9c)[_0x3f12('0x25')](handleEntityNotFound(_0x5ed5aa,null))[_0x3f12('0x25')](respondWithResult(_0x5ed5aa,null))['catch'](handleError(_0x5ed5aa,null));};exports[_0x3f12('0x4b')]=function(_0x38c3e8,_0x129140){return db[_0x3f12('0x2d')][_0x3f12('0x4b')](_0x38c3e8['body'],{})[_0x3f12('0x25')](function(_0x17a263){var _0x3c8034=_0x38c3e8[_0x3f12('0x4c')]['get']({'plain':!![]});if(!_0x3c8034)throw new Error(_0x3f12('0x4d'));if(_0x3c8034['role']===_0x3f12('0x4c')){var _0x156180=_0x17a263[_0x3f12('0x27')]({'plain':!![]});var _0x55370b=_0x3f12('0x4e');return db[_0x3f12('0x4f')]['find']({'where':{'name':_0x55370b,'userProfileId':_0x3c8034['userProfileId']},'raw':!![]})[_0x3f12('0x25')](function(_0x5b4ab2){if(_0x5b4ab2&&_0x5b4ab2[_0x3f12('0x50')]===0x0){return db[_0x3f12('0x28')][_0x3f12('0x4b')]({'name':_0x156180[_0x3f12('0x34')],'resourceId':_0x156180['id'],'type':_0x5b4ab2[_0x3f12('0x34')],'sectionId':_0x5b4ab2['id']},{})['then'](function(){return _0x17a263;});}else{return _0x17a263;}})[_0x3f12('0x47')](function(_0xa9d915){logger[_0x3f12('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa9d915);throw _0xa9d915;});}return _0x17a263;})[_0x3f12('0x25')](respondWithResult(_0x129140,0xc9))['catch'](handleError(_0x129140,null));};exports[_0x3f12('0x51')]=function(_0xeb0adb,_0x9bdb2c){var _0x4d5402={'where':{'id':_0xeb0adb[_0x3f12('0x49')]['id']}},_0x153857={};_0x153857['model']=_[_0x3f12('0x52')](db[_0x3f12('0x2d')][_0x3f12('0x2e')]);_0x4d5402[_0x3f12('0x38')]=_[_0x3f12('0x37')](_0x153857[_0x3f12('0x32')],qs[_0x3f12('0x39')](_0xeb0adb[_0x3f12('0x35')]['fields']));_0x4d5402['attributes']=_0x4d5402[_0x3f12('0x38')]['length']?_0x4d5402[_0x3f12('0x38')]:_0x153857[_0x3f12('0x32')];if(_0xeb0adb[_0x3f12('0x35')][_0x3f12('0x43')]){_0x4d5402[_0x3f12('0x44')]=[{'all':!![]}];}_0x4d5402=_[_0x3f12('0x40')]({},_0x4d5402,_0xeb0adb[_0x3f12('0x42')]);return db[_0x3f12('0x2d')][_0x3f12('0x53')](_0x4d5402)[_0x3f12('0x25')](handleEntityNotFound(_0x9bdb2c,null))[_0x3f12('0x25')](function(_0x185f3f){if(_0x185f3f){var _0x13574a=_0x185f3f[_0x3f12('0x27')]({'plain':!![]});_0x13574a=qs['omit'](_0x13574a,['id',_0x3f12('0x54'),_0x3f12('0x55')]);_0xeb0adb[_0x3f12('0x56')]=_[_0x3f12('0x57')](_0xeb0adb[_0x3f12('0x56')],['id',_0x3f12('0x54'),_0x3f12('0x55')]);return db[_0x3f12('0x2d')]['create'](_[_0x3f12('0x40')](_0x13574a,_0xeb0adb[_0x3f12('0x56')]),{'include':_0xeb0adb[_0x3f12('0x35')][_0x3f12('0x43')]?[{'all':!![]}]:undefined})[_0x3f12('0x25')](function(_0x2d949b){var _0x20cd80=_0xeb0adb['user'][_0x3f12('0x27')]({'plain':!![]});if(!_0x20cd80)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20cd80[_0x3f12('0x58')]===_0x3f12('0x4c')){var _0x5c0843=_0x2d949b[_0x3f12('0x27')]({'plain':!![]});var _0x57a3fa=_0x3f12('0x4e');return db['UserProfileSection'][_0x3f12('0x53')]({'where':{'name':_0x57a3fa,'userProfileId':_0x20cd80[_0x3f12('0x59')]},'raw':!![]})['then'](function(_0x2f2447){if(_0x2f2447&&_0x2f2447[_0x3f12('0x50')]===0x0){return db[_0x3f12('0x28')][_0x3f12('0x4b')]({'name':_0x5c0843[_0x3f12('0x34')],'resourceId':_0x5c0843['id'],'type':_0x2f2447[_0x3f12('0x34')],'sectionId':_0x2f2447['id']},{})[_0x3f12('0x25')](function(){return _0x2d949b;});}else{return _0x2d949b;}})['catch'](function(_0x3564de){logger[_0x3f12('0x2a')](_0x3f12('0x5a'),_0x3564de);throw _0x3564de;});}return _0x2d949b;});}})[_0x3f12('0x25')](respondWithResult(_0x9bdb2c,0xc9))['catch'](handleError(_0x9bdb2c,null));};exports['update']=function(_0xe8439,_0x5b4b55){if(_0xe8439[_0x3f12('0x56')]['id']){delete _0xe8439['body']['id'];}return db[_0x3f12('0x2d')]['find']({'where':{'id':_0xe8439['params']['id']}})['then'](handleEntityNotFound(_0x5b4b55,null))[_0x3f12('0x25')](saveUpdates(_0xe8439[_0x3f12('0x56')],null))[_0x3f12('0x25')](respondWithResult(_0x5b4b55,null))[_0x3f12('0x47')](handleError(_0x5b4b55,null));};exports[_0x3f12('0x26')]=function(_0x3eef7e,_0x41d7a1){return db['Campaign'][_0x3f12('0x53')]({'where':{'id':_0x3eef7e[_0x3f12('0x49')]['id']}})[_0x3f12('0x25')](handleEntityNotFound(_0x41d7a1,null))[_0x3f12('0x25')](removeEntity(_0x41d7a1,null))[_0x3f12('0x47')](handleError(_0x41d7a1,null));};exports[_0x3f12('0x5b')]=function(_0x1937bf,_0x36cb03,_0x470d24){var _0x2f6e21={'raw':!![],'where':{}};var _0x466b50={};var _0x579af2={'count':0x0,'rows':[]};return db[_0x3f12('0x2d')][_0x3f12('0x5c')]({'where':{'id':_0x1937bf['params']['id']}})[_0x3f12('0x25')](handleEntityNotFound(_0x36cb03,null))[_0x3f12('0x25')](function(_0x1365b1){if(_0x1365b1){_0x466b50[_0x3f12('0x32')]=_[_0x3f12('0x52')](db[_0x3f12('0x5d')][_0x3f12('0x2e')]);_0x466b50[_0x3f12('0x35')]=_[_0x3f12('0x52')](_0x1937bf[_0x3f12('0x35')]);_0x466b50[_0x3f12('0x36')]=_['intersection'](_0x466b50[_0x3f12('0x32')],_0x466b50[_0x3f12('0x35')]);_0x2f6e21['attributes']=_['intersection'](_0x466b50[_0x3f12('0x32')],qs[_0x3f12('0x39')](_0x1937bf[_0x3f12('0x35')]['fields']));_0x2f6e21['attributes']=_0x2f6e21[_0x3f12('0x38')]['length']?_0x2f6e21['attributes']:_0x466b50[_0x3f12('0x32')];if(!_0x1937bf[_0x3f12('0x35')][_0x3f12('0x5e')]('nolimit')){_0x2f6e21[_0x3f12('0x1c')]=qs[_0x3f12('0x1c')](_0x1937bf['query'][_0x3f12('0x1c')]);_0x2f6e21[_0x3f12('0x1a')]=qs[_0x3f12('0x1a')](_0x1937bf['query'][_0x3f12('0x1a')]);}_0x2f6e21[_0x3f12('0x3b')]=qs[_0x3f12('0x3c')](_0x1937bf[_0x3f12('0x35')]['sort']);_0x2f6e21[_0x3f12('0x3f')]=qs[_0x3f12('0x36')](_[_0x3f12('0x3d')](_0x1937bf[_0x3f12('0x35')],_0x466b50[_0x3f12('0x36')]));_0x2f6e21['where'][_0x3f12('0x5f')]=_0x1365b1['id'];if(_0x1937bf[_0x3f12('0x35')][_0x3f12('0x3e')]){_0x2f6e21[_0x3f12('0x3f')]=_[_0x3f12('0x40')](_0x2f6e21['where'],{'$or':_['map'](_0x2f6e21[_0x3f12('0x38')],function(_0x2b2eb4){var _0x299782={};_0x299782[_0x2b2eb4]={'$like':'%'+_0x1937bf['query'][_0x3f12('0x3e')]+'%'};return _0x299782;})});}_0x2f6e21=_['merge']({},_0x2f6e21,_0x1937bf[_0x3f12('0x42')]);return db[_0x3f12('0x5d')][_0x3f12('0x1d')]({'where':_0x2f6e21[_0x3f12('0x3f')]})[_0x3f12('0x25')](function(_0x824a68){_0x579af2[_0x3f12('0x1d')]=_0x824a68;if(_0x1937bf[_0x3f12('0x35')][_0x3f12('0x43')]){_0x2f6e21[_0x3f12('0x44')]=[{'all':!![]}];}return db[_0x3f12('0x5d')][_0x3f12('0x45')](_0x2f6e21);})[_0x3f12('0x25')](function(_0x2e8a9e){_0x579af2[_0x3f12('0x46')]=_0x2e8a9e;return _0x579af2;});}})[_0x3f12('0x25')](respondWithFilteredResult(_0x36cb03,_0x2f6e21))[_0x3f12('0x47')](handleError(_0x36cb03,null));};exports[_0x3f12('0x60')]=function(_0x2cae95,_0x5dfb30,_0x388b69){var _0x4f0ae7={'raw':!![],'where':{}};var _0x39d841={};var _0x4f8f7e={'count':0x0,'rows':[]};return db[_0x3f12('0x2d')][_0x3f12('0x5c')]({'where':{'id':_0x2cae95[_0x3f12('0x49')]['id']}})[_0x3f12('0x25')](handleEntityNotFound(_0x5dfb30,null))[_0x3f12('0x25')](function(_0x1d3a05){if(_0x1d3a05){_0x39d841[_0x3f12('0x32')]=_[_0x3f12('0x52')](db[_0x3f12('0x61')][_0x3f12('0x2e')]);_0x39d841[_0x3f12('0x35')]=_['keys'](_0x2cae95[_0x3f12('0x35')]);_0x39d841[_0x3f12('0x36')]=_[_0x3f12('0x37')](_0x39d841[_0x3f12('0x32')],_0x39d841[_0x3f12('0x35')]);_0x4f0ae7[_0x3f12('0x38')]=_[_0x3f12('0x37')](_0x39d841[_0x3f12('0x32')],qs['fields'](_0x2cae95[_0x3f12('0x35')][_0x3f12('0x39')]));_0x4f0ae7[_0x3f12('0x38')]=_0x4f0ae7[_0x3f12('0x38')][_0x3f12('0x4a')]?_0x4f0ae7[_0x3f12('0x38')]:_0x39d841[_0x3f12('0x32')];if(!_0x2cae95[_0x3f12('0x35')]['hasOwnProperty'](_0x3f12('0x3a'))){_0x4f0ae7[_0x3f12('0x1c')]=qs[_0x3f12('0x1c')](_0x2cae95[_0x3f12('0x35')][_0x3f12('0x1c')]);_0x4f0ae7[_0x3f12('0x1a')]=qs['offset'](_0x2cae95[_0x3f12('0x35')][_0x3f12('0x1a')]);}_0x4f0ae7[_0x3f12('0x3b')]=qs[_0x3f12('0x3c')](_0x2cae95['query'][_0x3f12('0x3c')]);_0x4f0ae7[_0x3f12('0x3f')]=qs['filters'](_[_0x3f12('0x3d')](_0x2cae95['query'],_0x39d841[_0x3f12('0x36')]));_0x4f0ae7[_0x3f12('0x3f')][_0x3f12('0x5f')]=_0x1d3a05['id'];if(_0x2cae95[_0x3f12('0x35')][_0x3f12('0x3e')]){_0x4f0ae7[_0x3f12('0x3f')]=_[_0x3f12('0x40')](_0x4f0ae7[_0x3f12('0x3f')],{'$or':_[_0x3f12('0x33')](_0x4f0ae7[_0x3f12('0x38')],function(_0x47433a){var _0x66bc64={};_0x66bc64[_0x47433a]={'$like':'%'+_0x2cae95[_0x3f12('0x35')]['filter']+'%'};return _0x66bc64;})});}_0x4f0ae7=_[_0x3f12('0x40')]({},_0x4f0ae7,_0x2cae95[_0x3f12('0x42')]);return db[_0x3f12('0x61')][_0x3f12('0x1d')]({'where':_0x4f0ae7['where']})['then'](function(_0x176c11){_0x4f8f7e[_0x3f12('0x1d')]=_0x176c11;if(_0x2cae95[_0x3f12('0x35')][_0x3f12('0x43')]){_0x4f0ae7[_0x3f12('0x44')]=[{'all':!![]}];}return db[_0x3f12('0x61')]['findAll'](_0x4f0ae7);})[_0x3f12('0x25')](function(_0x38a5a8){_0x4f8f7e[_0x3f12('0x46')]=_0x38a5a8;return _0x4f8f7e;});}})[_0x3f12('0x25')](respondWithFilteredResult(_0x5dfb30,_0x4f0ae7))[_0x3f12('0x47')](handleError(_0x5dfb30,null));};exports[_0x3f12('0x62')]=function(_0x58546c,_0x54fa7a,_0x3e3198){var _0x288a59={'raw':!![],'where':{}};var _0xe4a7b1={};var _0x5c8df6={'count':0x0,'rows':[]};return db[_0x3f12('0x2d')][_0x3f12('0x5c')]({'where':{'id':_0x58546c['params']['id']}})[_0x3f12('0x25')](handleEntityNotFound(_0x54fa7a,null))[_0x3f12('0x25')](function(_0x4a7df4){if(_0x4a7df4){_0xe4a7b1['model']=_['keys'](db[_0x3f12('0x63')]['rawAttributes']);_0xe4a7b1[_0x3f12('0x35')]=_['keys'](_0x58546c[_0x3f12('0x35')]);_0xe4a7b1[_0x3f12('0x36')]=_[_0x3f12('0x37')](_0xe4a7b1['model'],_0xe4a7b1['query']);_0x288a59[_0x3f12('0x38')]=_['intersection'](_0xe4a7b1[_0x3f12('0x32')],qs[_0x3f12('0x39')](_0x58546c['query'][_0x3f12('0x39')]));_0x288a59[_0x3f12('0x38')]=_0x288a59[_0x3f12('0x38')][_0x3f12('0x4a')]?_0x288a59['attributes']:_0xe4a7b1['model'];if(!_0x58546c['query'][_0x3f12('0x5e')]('nolimit')){_0x288a59[_0x3f12('0x1c')]=qs[_0x3f12('0x1c')](_0x58546c[_0x3f12('0x35')][_0x3f12('0x1c')]);_0x288a59['offset']=qs[_0x3f12('0x1a')](_0x58546c[_0x3f12('0x35')]['offset']);}_0x288a59['order']=qs[_0x3f12('0x3c')](_0x58546c[_0x3f12('0x35')][_0x3f12('0x3c')]);_0x288a59[_0x3f12('0x3f')]=qs[_0x3f12('0x36')](_[_0x3f12('0x3d')](_0x58546c[_0x3f12('0x35')],_0xe4a7b1[_0x3f12('0x36')]));_0x288a59[_0x3f12('0x3f')][_0x3f12('0x5f')]=_0x4a7df4['id'];if(_0x58546c['query']['filter']){_0x288a59['where']=_[_0x3f12('0x40')](_0x288a59['where'],{'$or':_['map'](_0x288a59[_0x3f12('0x38')],function(_0x1da5e9){var _0x1c7ad7={};_0x1c7ad7[_0x1da5e9]={'$like':'%'+_0x58546c[_0x3f12('0x35')][_0x3f12('0x3e')]+'%'};return _0x1c7ad7;})});}_0x288a59=_[_0x3f12('0x40')]({},_0x288a59,_0x58546c['options']);return db[_0x3f12('0x63')]['count']({'where':_0x288a59['where']})[_0x3f12('0x25')](function(_0x26bbc2){_0x5c8df6[_0x3f12('0x1d')]=_0x26bbc2;if(_0x58546c['query'][_0x3f12('0x43')]){_0x288a59[_0x3f12('0x44')]=[{'all':!![]}];}return db[_0x3f12('0x63')][_0x3f12('0x45')](_0x288a59);})[_0x3f12('0x25')](function(_0x3b35a0){_0x5c8df6[_0x3f12('0x46')]=_0x3b35a0;return _0x5c8df6;});}})[_0x3f12('0x25')](respondWithFilteredResult(_0x54fa7a,_0x288a59))[_0x3f12('0x47')](handleError(_0x54fa7a,null));};exports[_0x3f12('0x64')]=function(_0x1e1f1c,_0x2a5c7a,_0x316eba){var _0x384beb={'raw':!![],'where':{}};var _0x361ad1={};var _0x470446={'count':0x0,'rows':[]};return db['Campaign'][_0x3f12('0x5c')]({'where':{'id':_0x1e1f1c[_0x3f12('0x49')]['id']}})['then'](handleEntityNotFound(_0x2a5c7a,null))[_0x3f12('0x25')](function(_0x238d42){if(_0x238d42){_0x361ad1[_0x3f12('0x32')]=_[_0x3f12('0x52')](db[_0x3f12('0x65')][_0x3f12('0x2e')]);_0x361ad1[_0x3f12('0x35')]=_[_0x3f12('0x52')](_0x1e1f1c[_0x3f12('0x35')]);_0x361ad1[_0x3f12('0x36')]=_['intersection'](_0x361ad1['model'],_0x361ad1[_0x3f12('0x35')]);_0x384beb[_0x3f12('0x38')]=_[_0x3f12('0x37')](_0x361ad1[_0x3f12('0x32')],qs['fields'](_0x1e1f1c['query'][_0x3f12('0x39')]));_0x384beb['attributes']=_0x384beb[_0x3f12('0x38')][_0x3f12('0x4a')]?_0x384beb[_0x3f12('0x38')]:_0x361ad1[_0x3f12('0x32')];if(!_0x1e1f1c['query'][_0x3f12('0x5e')](_0x3f12('0x3a'))){_0x384beb[_0x3f12('0x1c')]=qs[_0x3f12('0x1c')](_0x1e1f1c[_0x3f12('0x35')][_0x3f12('0x1c')]);_0x384beb[_0x3f12('0x1a')]=qs[_0x3f12('0x1a')](_0x1e1f1c[_0x3f12('0x35')][_0x3f12('0x1a')]);}_0x384beb['order']=qs[_0x3f12('0x3c')](_0x1e1f1c['query'][_0x3f12('0x3c')]);_0x384beb[_0x3f12('0x3f')]=qs[_0x3f12('0x36')](_[_0x3f12('0x3d')](_0x1e1f1c['query'],_0x361ad1[_0x3f12('0x36')]));_0x384beb[_0x3f12('0x3f')][_0x3f12('0x5f')]=_0x238d42['id'];if(_0x1e1f1c[_0x3f12('0x35')][_0x3f12('0x3e')]){_0x384beb[_0x3f12('0x3f')]=_[_0x3f12('0x40')](_0x384beb[_0x3f12('0x3f')],{'$or':_[_0x3f12('0x33')](_0x384beb['attributes'],function(_0x1b05dc){var _0x11c97e={};_0x11c97e[_0x1b05dc]={'$like':'%'+_0x1e1f1c[_0x3f12('0x35')][_0x3f12('0x3e')]+'%'};return _0x11c97e;})});}_0x384beb=_['merge']({},_0x384beb,_0x1e1f1c[_0x3f12('0x42')]);return db[_0x3f12('0x65')][_0x3f12('0x1d')]({'where':_0x384beb[_0x3f12('0x3f')]})[_0x3f12('0x25')](function(_0x3ffe35){_0x470446[_0x3f12('0x1d')]=_0x3ffe35;if(_0x1e1f1c[_0x3f12('0x35')][_0x3f12('0x43')]){_0x384beb[_0x3f12('0x44')]=[{'all':!![]}];}return db[_0x3f12('0x65')]['findAll'](_0x384beb);})[_0x3f12('0x25')](function(_0x5c5fe9){_0x470446[_0x3f12('0x46')]=_0x5c5fe9;return _0x470446;});}})[_0x3f12('0x25')](respondWithFilteredResult(_0x2a5c7a,_0x384beb))['catch'](handleError(_0x2a5c7a,null));};exports['getLists']=function(_0x2fff1c,_0x59974e,_0x2ab132){var _0x3ce141={};var _0xe1e50f={};var _0x19a82d;var _0x5cc64e;return db[_0x3f12('0x2d')][_0x3f12('0x5c')]({'where':{'id':_0x2fff1c[_0x3f12('0x49')]['id']}})['then'](handleEntityNotFound(_0x59974e,null))['then'](function(_0x5a54ab){if(_0x5a54ab){_0x19a82d=_0x5a54ab;_0xe1e50f[_0x3f12('0x32')]=_[_0x3f12('0x52')](db[_0x3f12('0x66')][_0x3f12('0x2e')]);_0xe1e50f[_0x3f12('0x35')]=_[_0x3f12('0x52')](_0x2fff1c['query']);_0xe1e50f[_0x3f12('0x36')]=_[_0x3f12('0x37')](_0xe1e50f[_0x3f12('0x32')],_0xe1e50f[_0x3f12('0x35')]);_0x3ce141[_0x3f12('0x38')]=_[_0x3f12('0x37')](_0xe1e50f['model'],qs[_0x3f12('0x39')](_0x2fff1c[_0x3f12('0x35')][_0x3f12('0x39')]));_0x3ce141['attributes']=_0x3ce141[_0x3f12('0x38')][_0x3f12('0x4a')]?_0x3ce141[_0x3f12('0x38')]:_0xe1e50f['model'];_0x3ce141['order']=qs[_0x3f12('0x3c')](_0x2fff1c[_0x3f12('0x35')]['sort']);_0x3ce141['where']=qs[_0x3f12('0x36')](_[_0x3f12('0x3d')](_0x2fff1c[_0x3f12('0x35')],_0xe1e50f[_0x3f12('0x36')]));if(_0x2fff1c[_0x3f12('0x35')][_0x3f12('0x3e')]){_0x3ce141[_0x3f12('0x3f')]=_[_0x3f12('0x40')](_0x3ce141['where'],{'$or':_[_0x3f12('0x33')](_0x3ce141[_0x3f12('0x38')],function(_0x1fc07b){var _0x3029bf={};_0x3029bf[_0x1fc07b]={'$like':'%'+_0x2fff1c[_0x3f12('0x35')][_0x3f12('0x3e')]+'%'};return _0x3029bf;})});}_0x3ce141=_['merge']({},_0x3ce141,_0x2fff1c['options']);return _0x19a82d[_0x3f12('0x67')](_0x3ce141);}})['then'](function(_0x2f8694){if(_0x2f8694){_0x5cc64e=_0x2f8694[_0x3f12('0x4a')];if(!_0x2fff1c[_0x3f12('0x35')]['hasOwnProperty'](_0x3f12('0x3a'))){_0x3ce141[_0x3f12('0x1c')]=qs[_0x3f12('0x1c')](_0x2fff1c[_0x3f12('0x35')]['limit']);_0x3ce141[_0x3f12('0x1a')]=qs['offset'](_0x2fff1c[_0x3f12('0x35')]['offset']);}return _0x19a82d['getLists'](_0x3ce141);}})[_0x3f12('0x25')](function(_0x2138c6){if(_0x2138c6){return _0x2138c6?{'count':_0x5cc64e,'rows':_0x2138c6}:null;}})[_0x3f12('0x25')](respondWithResult(_0x59974e,null))['catch'](handleError(_0x59974e,null));};exports['addLists']=function(_0x13fc9f,_0x43bae8,_0x1a2197){var _0x54e47d,_0x7a7980;var _0x5d4085=[];var _0x35f4d4=moment()[_0x3f12('0x68')](_0x3f12('0x69'));return db['Campaign'][_0x3f12('0x53')]({'where':{'id':_0x13fc9f['params']['id']}})[_0x3f12('0x25')](handleEntityNotFound(_0x43bae8,null))['then'](function(_0x1604ea){if(_0x1604ea){_0x7a7980=_0x1604ea;return _0x1604ea[_0x3f12('0x6a')](_0x13fc9f[_0x3f12('0x56')][_0x3f12('0x6b')],_[_0x3f12('0x57')](_0x13fc9f[_0x3f12('0x56')],[_0x3f12('0x6b'),'id'])||{});}return null;})[_0x3f12('0x6c')](function(_0x39e07e){var _0x54087e;var _0x144137;_0x54e47d=_0x39e07e||[];var _0x731b05=[];if(_0x39e07e){for(var _0x546728=0x0;_0x546728<_0x39e07e[_0x3f12('0x4a')];_0x546728+=0x1){var _0x1492bf=_0x39e07e[_0x546728][_0x3f12('0x27')]({'plain':!![]});_0x7a7980[_0x3f12('0x6d')]=_0x13fc9f[_0x3f12('0x56')][_0x3f12('0x6d')]?_0x13fc9f['body'][_0x3f12('0x6d')]:_0x7a7980[_0x3f12('0x6d')];switch(_0x7a7980[_0x3f12('0x6d')]){case _0x3f12('0x6e'):_0x54087e=squel[_0x3f12('0x6f')]()[_0x3f12('0x70')](_0x3f12('0x71'))[_0x3f12('0x72')](['phone',_0x3f12('0x73'),_0x3f12('0x74'),_0x3f12('0x75'),_0x3f12('0x5f'),'createdAt',_0x3f12('0x55')],squel[_0x3f12('0x76')]()[_0x3f12('0x77')](_0x3f12('0x78'),_0x3f12('0x78'))[_0x3f12('0x77')](_0x3f12('0x79'),_0x3f12('0x73'))['field']('id',_0x3f12('0x74'))[_0x3f12('0x77')](_0x1492bf[_0x3f12('0x7a')]['toString'](),'ListId')[_0x3f12('0x77')](_0x13fc9f[_0x3f12('0x49')]['id']['toString'](),_0x3f12('0x5f'))[_0x3f12('0x77')]('\x27'+_0x35f4d4+'\x27',_0x3f12('0x54'))[_0x3f12('0x77')]('\x27'+_0x35f4d4+'\x27',_0x3f12('0x55'))[_0x3f12('0x7b')]('cm_contacts')['where'](_0x3f12('0x7c'))[_0x3f12('0x3f')](_0x3f12('0x7d'),_0x1492bf[_0x3f12('0x7a')][_0x3f12('0x7e')]())[_0x3f12('0x3f')](_0x3f12('0x7f'))[_0x3f12('0x3f')](_0x3f12('0x80'),squel[_0x3f12('0x76')]()[_0x3f12('0x77')](_0x3f12('0x81'))[_0x3f12('0x7b')](_0x3f12('0x82'))[_0x3f12('0x3f')](_0x3f12('0x83'),_0x13fc9f[_0x3f12('0x49')]['id'][_0x3f12('0x7e')]()))[_0x3f12('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3f12('0x76')]()[_0x3f12('0x77')](_0x3f12('0x84'))[_0x3f12('0x7b')](_0x3f12('0x71'))['where']('CampaignId\x20=\x20?',_0x13fc9f[_0x3f12('0x49')]['id'][_0x3f12('0x7e')]())))[_0x3f12('0x7e')]();break;case _0x3f12('0x85'):_0x54087e=squel[_0x3f12('0x6f')]()[_0x3f12('0x70')](_0x3f12('0x71'))['fromQuery']([_0x3f12('0x78'),_0x3f12('0x73'),_0x3f12('0x74'),'ListId',_0x3f12('0x5f'),'createdAt',_0x3f12('0x55')],squel[_0x3f12('0x76')]()[_0x3f12('0x77')]('phone','phone')['field'](_0x3f12('0x79'),_0x3f12('0x73'))[_0x3f12('0x77')]('id',_0x3f12('0x74'))[_0x3f12('0x77')](_0x1492bf['CmListId'][_0x3f12('0x7e')](),_0x3f12('0x75'))['field'](_0x13fc9f['params']['id'][_0x3f12('0x7e')](),_0x3f12('0x5f'))[_0x3f12('0x77')]('\x27'+_0x35f4d4+'\x27',_0x3f12('0x54'))[_0x3f12('0x77')]('\x27'+_0x35f4d4+'\x27','updatedAt')[_0x3f12('0x7b')]('cm_contacts')['where'](_0x3f12('0x7c'))[_0x3f12('0x3f')](_0x3f12('0x7d'),_0x1492bf[_0x3f12('0x7a')][_0x3f12('0x7e')]())[_0x3f12('0x3f')](_0x3f12('0x7f'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x3f12('0x76')]()['field'](_0x3f12('0x84'))[_0x3f12('0x7b')](_0x3f12('0x71'))[_0x3f12('0x3f')](_0x3f12('0x83'),_0x13fc9f['params']['id'][_0x3f12('0x7e')]())))['toString']();break;default:_0x54087e=squel[_0x3f12('0x6f')]()[_0x3f12('0x70')](_0x3f12('0x71'))[_0x3f12('0x72')]([_0x3f12('0x78'),_0x3f12('0x73'),_0x3f12('0x74'),_0x3f12('0x75'),_0x3f12('0x5f'),'createdAt',_0x3f12('0x55')],squel['select']()['field'](_0x3f12('0x78'),'phone')[_0x3f12('0x77')](_0x3f12('0x79'),_0x3f12('0x73'))[_0x3f12('0x77')]('id',_0x3f12('0x74'))[_0x3f12('0x77')](_0x1492bf[_0x3f12('0x7a')][_0x3f12('0x7e')](),_0x3f12('0x75'))[_0x3f12('0x77')](_0x13fc9f['params']['id'][_0x3f12('0x7e')](),_0x3f12('0x5f'))[_0x3f12('0x77')]('\x27'+_0x35f4d4+'\x27',_0x3f12('0x54'))[_0x3f12('0x77')]('\x27'+_0x35f4d4+'\x27',_0x3f12('0x55'))[_0x3f12('0x7b')](_0x3f12('0x86'))[_0x3f12('0x3f')](_0x3f12('0x7c'))[_0x3f12('0x3f')]('ListId\x20=\x20?',_0x1492bf[_0x3f12('0x7a')][_0x3f12('0x7e')]())[_0x3f12('0x3f')](_0x3f12('0x7f')))['toString']();}_0x144137=squel[_0x3f12('0x6f')]()['into'](_0x3f12('0x87'))[_0x3f12('0x72')]([_0x3f12('0x88'),_0x3f12('0x73'),_0x3f12('0x78'),_0x3f12('0x89'),_0x3f12('0x54'),'updatedAt'],squel[_0x3f12('0x76')]()[_0x3f12('0x77')]('h.id','id')['field'](_0x3f12('0x79'),'scheduledAt')[_0x3f12('0x77')]('ci.item',_0x3f12('0x78'))['field'](_0x3f12('0x8a'),'OrderBy')[_0x3f12('0x77')]('\x27'+_0x35f4d4+'\x27',_0x3f12('0x54'))[_0x3f12('0x77')]('\x27'+_0x35f4d4+'\x27',_0x3f12('0x55'))[_0x3f12('0x7b')](_0x3f12('0x8b'),'ci')[_0x3f12('0x8c')](_0x3f12('0x71'),'h',_0x3f12('0x8d'))[_0x3f12('0x3f')]('h.ListId\x20=\x20?',_0x1492bf[_0x3f12('0x7a')]['toString']())[_0x3f12('0x3f')](_0x3f12('0x8e'),_0x13fc9f[_0x3f12('0x49')]['id'][_0x3f12('0x7e')]())[_0x3f12('0x3f')](_0x3f12('0x8f'),_0x35f4d4))[_0x3f12('0x7e')]();_0x731b05[_0x3f12('0x90')](db['sequelize'][_0x3f12('0x35')](_0x54087e));_0x5d4085[_0x3f12('0x90')](db[_0x3f12('0x91')][_0x3f12('0x35')](_0x144137));}return BPromise[_0x3f12('0x92')](_0x731b05);}})[_0x3f12('0x25')](function(){return BPromise[_0x3f12('0x92')](_0x5d4085);})[_0x3f12('0x25')](function(){return _0x54e47d;})[_0x3f12('0x25')](respondWithResult(_0x43bae8,null))[_0x3f12('0x47')](handleError(_0x43bae8,null));};exports[_0x3f12('0x93')]=function(_0x385a95,_0x3e9c09,_0x5ae7e0){return db['Campaign']['find']({'where':{'id':_0x385a95[_0x3f12('0x49')]['id']}})[_0x3f12('0x25')](handleEntityNotFound(_0x3e9c09,null))[_0x3f12('0x25')](function(_0x6090b5){if(_0x6090b5){return _0x6090b5['removeLists'](_0x385a95[_0x3f12('0x35')]['ids']);}})[_0x3f12('0x25')](function(_0x210040){if(_0x210040){return db[_0x3f12('0x5d')][_0x3f12('0x26')]({'where':{'ListId':_0x385a95[_0x3f12('0x35')]['ids'],'CampaignId':_0x385a95['params']['id']}})[_0x3f12('0x25')](function(){return _0x210040;});}})[_0x3f12('0x25')](respondWithStatusCode(_0x3e9c09,null))[_0x3f12('0x47')](handleError(_0x3e9c09,null));};exports[_0x3f12('0x94')]=function(_0x964059,_0x404933,_0x162888){var _0x57d936={};var _0x121b43={};var _0x81749;var _0x3a1d93;return db[_0x3f12('0x2d')][_0x3f12('0x5c')]({'where':{'id':_0x964059[_0x3f12('0x49')]['id']}})[_0x3f12('0x25')](handleEntityNotFound(_0x404933,null))['then'](function(_0x440f59){if(_0x440f59){_0x81749=_0x440f59;_0x121b43['model']=_[_0x3f12('0x52')](db[_0x3f12('0x66')][_0x3f12('0x2e')]);_0x121b43['query']=_['keys'](_0x964059[_0x3f12('0x35')]);_0x121b43[_0x3f12('0x36')]=_[_0x3f12('0x37')](_0x121b43['model'],_0x121b43[_0x3f12('0x35')]);_0x57d936[_0x3f12('0x38')]=_['intersection'](_0x121b43['model'],qs['fields'](_0x964059['query'][_0x3f12('0x39')]));_0x57d936['attributes']=_0x57d936[_0x3f12('0x38')][_0x3f12('0x4a')]?_0x57d936[_0x3f12('0x38')]:_0x121b43[_0x3f12('0x32')];_0x57d936['order']=qs[_0x3f12('0x3c')](_0x964059[_0x3f12('0x35')][_0x3f12('0x3c')]);_0x57d936[_0x3f12('0x3f')]=qs['filters'](_[_0x3f12('0x3d')](_0x964059[_0x3f12('0x35')],_0x121b43[_0x3f12('0x36')]));if(_0x964059[_0x3f12('0x35')]['filter']){_0x57d936[_0x3f12('0x3f')]=_[_0x3f12('0x40')](_0x57d936[_0x3f12('0x3f')],{'$or':_[_0x3f12('0x33')](_0x57d936[_0x3f12('0x38')],function(_0x5e5b74){var _0x3dc3f4={};_0x3dc3f4[_0x5e5b74]={'$like':'%'+_0x964059[_0x3f12('0x35')][_0x3f12('0x3e')]+'%'};return _0x3dc3f4;})});}_0x57d936=_[_0x3f12('0x40')]({},_0x57d936,_0x964059[_0x3f12('0x42')]);return _0x81749[_0x3f12('0x94')](_0x57d936);}})[_0x3f12('0x25')](function(_0x4d4e4b){if(_0x4d4e4b){_0x3a1d93=_0x4d4e4b['length'];if(!_0x964059[_0x3f12('0x35')]['hasOwnProperty'](_0x3f12('0x3a'))){_0x57d936['limit']=qs[_0x3f12('0x1c')](_0x964059[_0x3f12('0x35')][_0x3f12('0x1c')]);_0x57d936['offset']=qs['offset'](_0x964059[_0x3f12('0x35')][_0x3f12('0x1a')]);}return _0x81749[_0x3f12('0x94')](_0x57d936);}})[_0x3f12('0x25')](function(_0x5daab8){if(_0x5daab8){return _0x5daab8?{'count':_0x3a1d93,'rows':_0x5daab8}:null;}})[_0x3f12('0x25')](respondWithResult(_0x404933,null))[_0x3f12('0x47')](handleError(_0x404933,null));};exports['addBlackLists']=function(_0x88d427,_0xb90a37,_0x1a45dc){var _0x23535d,_0x24d303;var _0x51b064=[];var _0x4a3993=moment()[_0x3f12('0x68')](_0x3f12('0x69'));return db[_0x3f12('0x2d')][_0x3f12('0x53')]({'where':{'id':_0x88d427[_0x3f12('0x49')]['id']}})[_0x3f12('0x25')](handleEntityNotFound(_0xb90a37,null))[_0x3f12('0x25')](function(_0x1be452){if(_0x1be452){_0x24d303=_0x1be452;return _0x1be452[_0x3f12('0x95')](_0x88d427[_0x3f12('0x56')]['ids'],_[_0x3f12('0x57')](_0x88d427[_0x3f12('0x56')],['ids','id'])||{});}return null;})[_0x3f12('0x6c')](function(_0x4adf0d){var _0x256dc5;var _0x5cf5ec;_0x23535d=_0x4adf0d||[];var _0x521b1c=[];if(_0x4adf0d){for(var _0x421ded=0x0;_0x421ded<_0x4adf0d[_0x3f12('0x4a')];_0x421ded+=0x1){var _0x4c3095=_0x4adf0d[_0x421ded][_0x3f12('0x27')]({'plain':!![]});_0x256dc5=squel[_0x3f12('0x6f')]()[_0x3f12('0x70')](_0x3f12('0x96'))['fromQuery']([_0x3f12('0x78'),'ContactId',_0x3f12('0x75'),'CampaignId',_0x3f12('0x54'),'updatedAt'],squel[_0x3f12('0x76')]()[_0x3f12('0x77')](_0x3f12('0x78'),_0x3f12('0x78'))[_0x3f12('0x77')]('id',_0x3f12('0x74'))[_0x3f12('0x77')](_0x4c3095[_0x3f12('0x7a')][_0x3f12('0x7e')](),_0x3f12('0x75'))[_0x3f12('0x77')](_0x88d427[_0x3f12('0x49')]['id']['toString'](),_0x3f12('0x5f'))['field'](_0x3f12('0x79'),'createdAt')['field'](_0x3f12('0x79'),_0x3f12('0x55'))[_0x3f12('0x7b')](_0x3f12('0x86'))[_0x3f12('0x3f')](_0x3f12('0x7c'))[_0x3f12('0x3f')](_0x3f12('0x7d'),_0x4c3095[_0x3f12('0x7a')][_0x3f12('0x7e')]())[_0x3f12('0x3f')](_0x3f12('0x7f')))[_0x3f12('0x7e')]();_0x521b1c['push'](db[_0x3f12('0x91')][_0x3f12('0x35')](_0x256dc5));}return BPromise[_0x3f12('0x92')](_0x521b1c);}})[_0x3f12('0x25')](function(){return _0x23535d;})[_0x3f12('0x25')](respondWithResult(_0xb90a37,null))[_0x3f12('0x47')](handleError(_0xb90a37,null));};exports[_0x3f12('0x97')]=function(_0x3d1ac8,_0x1d1fdf,_0x2da7dd){return db[_0x3f12('0x2d')][_0x3f12('0x53')]({'where':{'id':_0x3d1ac8[_0x3f12('0x49')]['id']}})[_0x3f12('0x25')](handleEntityNotFound(_0x1d1fdf,null))[_0x3f12('0x25')](function(_0x5ab035){if(_0x5ab035){return _0x5ab035[_0x3f12('0x97')](_0x3d1ac8[_0x3f12('0x35')][_0x3f12('0x6b')]);}})[_0x3f12('0x25')](function(_0x559b02){if(_0x559b02){return db['CmHopperBlack'][_0x3f12('0x26')]({'where':{'ListId':_0x3d1ac8['query'][_0x3f12('0x6b')],'CampaignId':_0x3d1ac8[_0x3f12('0x49')]['id']}})[_0x3f12('0x25')](function(){return _0x559b02;});}})[_0x3f12('0x25')](respondWithStatusCode(_0x1d1fdf,null))[_0x3f12('0x47')](handleError(_0x1d1fdf,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 53c2255..c3bfaf5 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(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x432075,_0x308bed){var _0x575582=function(_0x1337e7){while(--_0x1337e7){_0x432075['push'](_0x432075['shift']());}};_0x575582(++_0x308bed);}(_0x7a54,0x106));var _0x47a5=function(_0x949fe3,_0x3a7dff){_0x949fe3=_0x949fe3-0x0;var _0x1eddab=_0x7a54[_0x949fe3];return _0x1eddab;};'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 49ab44f..17e9d11 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 _0x76a3=['Campaign','options','raw','where','attributes','include','model','map','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Campaign,\x20%s,\x20%s','result','catch','GetCampaign'];(function(_0x25f4bb,_0x5e7fb4){var _0x7344e3=function(_0x49a220){while(--_0x49a220){_0x25f4bb['push'](_0x25f4bb['shift']());}};_0x7344e3(++_0x5e7fb4);}(_0x76a3,0xf8));var _0x376a=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0x76a3[_0x386525];return _0x14d015;};'use strict';var _=require(_0x376a('0x0'));var util=require(_0x376a('0x1'));var moment=require(_0x376a('0x2'));var BPromise=require(_0x376a('0x3'));var rs=require(_0x376a('0x4'));var fs=require('fs');var Redis=require(_0x376a('0x5'));var db=require(_0x376a('0x6'))['db'];var utils=require(_0x376a('0x7'));var logger=require(_0x376a('0x8'))(_0x376a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x376a('0xa')][_0x376a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x139dbc,_0x3cb57e,_0x548516){return new BPromise(function(_0x3e2261,_0x409960){return client[_0x376a('0xc')](_0x139dbc,_0x548516)[_0x376a('0xd')](function(_0x347b32){logger[_0x376a('0xe')]('Campaign,\x20%s,\x20%s',_0x3cb57e,'request\x20sent');logger['debug'](_0x376a('0xf'),_0x3cb57e,_0x376a('0x10'),JSON['stringify'](_0x347b32));if(_0x347b32[_0x376a('0x11')]){if(_0x347b32['error'][_0x376a('0x12')]===0x1f4){logger[_0x376a('0x11')]('Campaign,\x20%s,\x20%s',_0x3cb57e,_0x347b32[_0x376a('0x11')][_0x376a('0x13')]);return _0x409960(_0x347b32[_0x376a('0x11')]['message']);}logger[_0x376a('0x11')]('Campaign,\x20%s,\x20%s',_0x3cb57e,_0x347b32[_0x376a('0x11')][_0x376a('0x13')]);return _0x3e2261(_0x347b32[_0x376a('0x11')][_0x376a('0x13')]);}else{logger[_0x376a('0xe')](_0x376a('0x14'),_0x3cb57e,_0x376a('0x10'));_0x3e2261(_0x347b32[_0x376a('0x15')]['message']);}})[_0x376a('0x16')](function(_0xe3c5fc){logger['error'](_0x376a('0x14'),_0x3cb57e,_0xe3c5fc);_0x409960(_0xe3c5fc);});});}exports[_0x376a('0x17')]=function(_0x2dff31){var _0xa29966=this;return new Promise(function(_0x2519d4,_0x52bfea){return db[_0x376a('0x18')]['findAll']({'raw':_0x2dff31[_0x376a('0x19')]?_0x2dff31['options'][_0x376a('0x1a')]===undefined?!![]:![]:!![],'where':_0x2dff31[_0x376a('0x19')]?_0x2dff31[_0x376a('0x19')][_0x376a('0x1b')]||null:null,'attributes':_0x2dff31[_0x376a('0x19')]?_0x2dff31['options'][_0x376a('0x1c')]||null:null,'limit':_0x2dff31[_0x376a('0x19')]?_0x2dff31[_0x376a('0x19')]['limit']||null:null,'include':_0x2dff31['options']?_0x2dff31[_0x376a('0x19')][_0x376a('0x1d')]?_['map'](_0x2dff31[_0x376a('0x19')][_0x376a('0x1d')],function(_0x44b960){return{'model':db[_0x44b960[_0x376a('0x1e')]],'as':_0x44b960['as'],'attributes':_0x44b960['attributes'],'include':_0x44b960[_0x376a('0x1d')]?_[_0x376a('0x1f')](_0x44b960['include'],function(_0x1dd8ac){return{'model':db[_0x1dd8ac[_0x376a('0x1e')]],'as':_0x1dd8ac['as'],'attributes':_0x1dd8ac[_0x376a('0x1c')],'include':_0x1dd8ac[_0x376a('0x1d')]?_[_0x376a('0x1f')](_0x1dd8ac[_0x376a('0x1d')],function(_0x581c2b){return{'model':db[_0x581c2b['model']],'as':_0x581c2b['as'],'attributes':_0x581c2b['attributes']};}):[]};}):[]};}):[]:[]})[_0x376a('0xd')](function(_0x2adf9f){logger[_0x376a('0xe')](_0x376a('0x17'),_0x2dff31);logger[_0x376a('0x20')]('GetCampaign',_0x2dff31,JSON[_0x376a('0x21')](_0x2adf9f));_0x2519d4(_0x2adf9f);})[_0x376a('0x16')](function(_0x56d0b9){logger['error'](_0x376a('0x17'),_0x56d0b9[_0x376a('0x13')],_0x2dff31);_0x52bfea(_0xa29966['error'](0x1f4,_0x56d0b9[_0x376a('0x13')]));});});}; \ No newline at end of file +var _0x22dd=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetCampaign','lodash','util','moment'];(function(_0x311132,_0x58ac7d){var _0x515856=function(_0x3ba2fa){while(--_0x3ba2fa){_0x311132['push'](_0x311132['shift']());}};_0x515856(++_0x58ac7d);}(_0x22dd,0xe4));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd22d('0x0'));var util=require(_0xd22d('0x1'));var moment=require(_0xd22d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd22d('0x3'));var db=require(_0xd22d('0x4'))['db'];var utils=require(_0xd22d('0x5'));var logger=require(_0xd22d('0x6'))(_0xd22d('0x7'));var config=require(_0xd22d('0x8'));var jayson=require(_0xd22d('0x9'));var client=jayson[_0xd22d('0xa')][_0xd22d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a466f,_0x4de374,_0x40986a){return new BPromise(function(_0x3649df,_0x57fc19){return client[_0xd22d('0xc')](_0x3a466f,_0x40986a)['then'](function(_0x19064d){logger['info'](_0xd22d('0xd'),_0x4de374,_0xd22d('0xe'));logger[_0xd22d('0xf')](_0xd22d('0x10'),_0x4de374,_0xd22d('0xe'),JSON[_0xd22d('0x11')](_0x19064d));if(_0x19064d[_0xd22d('0x12')]){if(_0x19064d[_0xd22d('0x12')]['code']===0x1f4){logger[_0xd22d('0x12')](_0xd22d('0xd'),_0x4de374,_0x19064d['error'][_0xd22d('0x13')]);return _0x57fc19(_0x19064d[_0xd22d('0x12')]['message']);}logger['error']('Campaign,\x20%s,\x20%s',_0x4de374,_0x19064d[_0xd22d('0x12')]['message']);return _0x3649df(_0x19064d[_0xd22d('0x12')]['message']);}else{logger[_0xd22d('0x14')]('Campaign,\x20%s,\x20%s',_0x4de374,_0xd22d('0xe'));_0x3649df(_0x19064d[_0xd22d('0x15')]['message']);}})[_0xd22d('0x16')](function(_0x2bb3d5){logger[_0xd22d('0x12')](_0xd22d('0xd'),_0x4de374,_0x2bb3d5);_0x57fc19(_0x2bb3d5);});});}exports['GetCampaign']=function(_0x5c516a){var _0x3d1fca=this;return new Promise(function(_0x5a0a0b,_0x51a622){return db['Campaign'][_0xd22d('0x17')]({'raw':_0x5c516a[_0xd22d('0x18')]?_0x5c516a[_0xd22d('0x18')][_0xd22d('0x19')]===undefined?!![]:![]:!![],'where':_0x5c516a[_0xd22d('0x18')]?_0x5c516a['options'][_0xd22d('0x1a')]||null:null,'attributes':_0x5c516a['options']?_0x5c516a['options']['attributes']||null:null,'limit':_0x5c516a[_0xd22d('0x18')]?_0x5c516a[_0xd22d('0x18')][_0xd22d('0x1b')]||null:null,'include':_0x5c516a[_0xd22d('0x18')]?_0x5c516a[_0xd22d('0x18')][_0xd22d('0x1c')]?_[_0xd22d('0x1d')](_0x5c516a['options'][_0xd22d('0x1c')],function(_0x8340e5){return{'model':db[_0x8340e5['model']],'as':_0x8340e5['as'],'attributes':_0x8340e5['attributes'],'include':_0x8340e5[_0xd22d('0x1c')]?_[_0xd22d('0x1d')](_0x8340e5['include'],function(_0x2b0959){return{'model':db[_0x2b0959[_0xd22d('0x1e')]],'as':_0x2b0959['as'],'attributes':_0x2b0959[_0xd22d('0x1f')],'include':_0x2b0959[_0xd22d('0x1c')]?_[_0xd22d('0x1d')](_0x2b0959[_0xd22d('0x1c')],function(_0x2d45ab){return{'model':db[_0x2d45ab[_0xd22d('0x1e')]],'as':_0x2d45ab['as'],'attributes':_0x2d45ab[_0xd22d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x198df9){logger[_0xd22d('0x14')]('GetCampaign',_0x5c516a);logger[_0xd22d('0xf')]('GetCampaign',_0x5c516a,JSON['stringify'](_0x198df9));_0x5a0a0b(_0x198df9);})[_0xd22d('0x16')](function(_0x96a17e){logger[_0xd22d('0x12')](_0xd22d('0x20'),_0x96a17e[_0xd22d('0x13')],_0x5c516a);_0x51a622(_0x3d1fca['error'](0x1f4,_0x96a17e[_0xd22d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index b254c66..bb6fa27 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 _0xfe57=['/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','/:id/clone','clone','addLists'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0xfe57,0x195));var _0x7fe5=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0xfe57[_0x3fd3a3];return _0xa3e4d5;};'use strict';var multer=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7fe5('0x2'));var router=express[_0x7fe5('0x3')]();var fs_extra=require(_0x7fe5('0x4'));var auth=require(_0x7fe5('0x5'));var interaction=require(_0x7fe5('0x6'));var config=require(_0x7fe5('0x7'));var controller=require(_0x7fe5('0x8'));router[_0x7fe5('0x9')]('/',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xb')]);router[_0x7fe5('0x9')](_0x7fe5('0xc'),auth[_0x7fe5('0xa')](),controller['show']);router[_0x7fe5('0x9')]('/:id/hoppers',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xd')]);router['get']('/:id/hopper_histories',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xe')]);router['get'](_0x7fe5('0xf'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x7fe5('0x9')](_0x7fe5('0x10'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x11')]);router['get'](_0x7fe5('0x12'),auth[_0x7fe5('0xa')](),controller['getLists']);router[_0x7fe5('0x9')]('/:id/blacklists',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x13')]);router['post']('/',auth[_0x7fe5('0xa')](),controller['create']);router[_0x7fe5('0x14')](_0x7fe5('0x15'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x16')]);router[_0x7fe5('0x14')](_0x7fe5('0x12'),auth['isAuthenticated'](),controller[_0x7fe5('0x17')]);router[_0x7fe5('0x14')](_0x7fe5('0x18'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x19')]);router[_0x7fe5('0x1a')](_0x7fe5('0xc'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x1b')]);router[_0x7fe5('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x7fe5('0x1d')]);router[_0x7fe5('0x1c')](_0x7fe5('0x12'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x1e')]);router[_0x7fe5('0x1c')](_0x7fe5('0x18'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x1f')]);module[_0x7fe5('0x20')]=router; \ No newline at end of file +var _0xba85=['update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists'];(function(_0x50f416,_0x287d9c){var _0x35c37b=function(_0x25ffa9){while(--_0x25ffa9){_0x50f416['push'](_0x50f416['shift']());}};_0x35c37b(++_0x287d9c);}(_0xba85,0x78));var _0x5ba8=function(_0x27067d,_0x454ef8){_0x27067d=_0x27067d-0x0;var _0x53c760=_0xba85[_0x27067d];return _0x53c760;};'use strict';var multer=require(_0x5ba8('0x0'));var util=require(_0x5ba8('0x1'));var path=require(_0x5ba8('0x2'));var timeout=require(_0x5ba8('0x3'));var express=require('express');var router=express[_0x5ba8('0x4')]();var fs_extra=require(_0x5ba8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5ba8('0x6'));var config=require(_0x5ba8('0x7'));var controller=require(_0x5ba8('0x8'));router[_0x5ba8('0x9')]('/',auth['isAuthenticated'](),controller[_0x5ba8('0xa')]);router[_0x5ba8('0x9')](_0x5ba8('0xb'),auth[_0x5ba8('0xc')](),controller[_0x5ba8('0xd')]);router[_0x5ba8('0x9')](_0x5ba8('0xe'),auth[_0x5ba8('0xc')](),controller[_0x5ba8('0xf')]);router[_0x5ba8('0x9')](_0x5ba8('0x10'),auth[_0x5ba8('0xc')](),controller[_0x5ba8('0x11')]);router['get'](_0x5ba8('0x12'),auth[_0x5ba8('0xc')](),controller[_0x5ba8('0x13')]);router[_0x5ba8('0x9')](_0x5ba8('0x14'),auth[_0x5ba8('0xc')](),controller[_0x5ba8('0x15')]);router[_0x5ba8('0x9')](_0x5ba8('0x16'),auth['isAuthenticated'](),controller[_0x5ba8('0x17')]);router[_0x5ba8('0x9')](_0x5ba8('0x18'),auth[_0x5ba8('0xc')](),controller[_0x5ba8('0x19')]);router[_0x5ba8('0x1a')]('/',auth['isAuthenticated'](),controller[_0x5ba8('0x1b')]);router[_0x5ba8('0x1a')](_0x5ba8('0x1c'),auth[_0x5ba8('0xc')](),controller[_0x5ba8('0x1d')]);router[_0x5ba8('0x1a')](_0x5ba8('0x16'),auth[_0x5ba8('0xc')](),controller[_0x5ba8('0x1e')]);router[_0x5ba8('0x1a')](_0x5ba8('0x18'),auth[_0x5ba8('0xc')](),controller[_0x5ba8('0x1f')]);router['put']('/:id',auth[_0x5ba8('0xc')](),controller[_0x5ba8('0x20')]);router[_0x5ba8('0x21')](_0x5ba8('0xb'),auth[_0x5ba8('0xc')](),controller[_0x5ba8('0x22')]);router[_0x5ba8('0x21')](_0x5ba8('0x16'),auth[_0x5ba8('0xc')](),controller[_0x5ba8('0x23')]);router[_0x5ba8('0x21')](_0x5ba8('0x18'),auth[_0x5ba8('0xc')](),controller[_0x5ba8('0x24')]);module[_0x5ba8('0x25')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 39a3c2a..a555380 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 _0x7c3b=['STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x23b662,_0x49b9fc){var _0x41486f=function(_0x347bc4){while(--_0x347bc4){_0x23b662['push'](_0x23b662['shift']());}};_0x41486f(++_0x49b9fc);}(_0x7c3b,0x156));var _0xb7c3=function(_0x3890c1,_0x41dda5){_0x3890c1=_0x3890c1-0x0;var _0x127d85=_0x7c3b[_0x3890c1];return _0x127d85;};'use strict';var Sequelize=require(_0xb7c3('0x0'));module[_0xb7c3('0x1')]={'key':{'type':Sequelize[_0xb7c3('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb7c3('0x3')],'length':_0xb7c3('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xb7c3('0x2')]},'name':{'type':Sequelize[_0xb7c3('0x5')],'get':function(){return this[_0xb7c3('0x6')](_0xb7c3('0x7'));}}}; \ No newline at end of file +var _0xe97f=['sequelize','exports','STRING','TEXT','medium','VIRTUAL','key'];(function(_0x53a571,_0x746554){var _0xe74e50=function(_0x14a137){while(--_0x14a137){_0x53a571['push'](_0x53a571['shift']());}};_0xe74e50(++_0x746554);}(_0xe97f,0x9a));var _0xfe97=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe97f[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xfe97('0x0'));module[_0xfe97('0x1')]={'key':{'type':Sequelize[_0xfe97('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xfe97('0x3')],'length':_0xfe97('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xfe97('0x2')]},'name':{'type':Sequelize[_0xfe97('0x5')],'get':function(){return this['getDataValue'](_0xfe97('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 9be02bf..cd87555 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 _0x020e=['filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','catch','show','params','rawAttributes','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','map','fieldName','type','key','query','keys'];(function(_0x512e26,_0x50cf31){var _0x74d652=function(_0x175233){while(--_0x175233){_0x512e26['push'](_0x512e26['shift']());}};_0x74d652(++_0x50cf31);}(_0x020e,0x137));var _0xe020=function(_0x374d62,_0x5056f3){_0x374d62=_0x374d62-0x0;var _0x110c60=_0x020e[_0x374d62];return _0x110c60;};'use strict';var emlformat=require(_0xe020('0x0'));var rimraf=require(_0xe020('0x1'));var zipdir=require(_0xe020('0x2'));var jsonpatch=require(_0xe020('0x3'));var rp=require('request-promise');var moment=require(_0xe020('0x4'));var BPromise=require(_0xe020('0x5'));var Mustache=require('mustache');var util=require(_0xe020('0x6'));var path=require(_0xe020('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe020('0x8'));var fs=require('fs');var fs_extra=require(_0xe020('0x9'));var _=require(_0xe020('0xa'));var squel=require(_0xe020('0xb'));var crypto=require(_0xe020('0xc'));var jsforce=require(_0xe020('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe020('0xe'));var querystring=require(_0xe020('0xf'));var Papa=require(_0xe020('0x10'));var Redis=require(_0xe020('0x11'));var authService=require(_0xe020('0x12'));var qs=require(_0xe020('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe020('0x14'));var logger=require(_0xe020('0x15'))(_0xe020('0x16'));var utils=require('../../config/utils');var config=require(_0xe020('0x17'));var licenseUtil=require(_0xe020('0x18'));var db=require(_0xe020('0x19'))['db'];function respondWithStatusCode(_0x15f031,_0x3a6f91){_0x3a6f91=_0x3a6f91||0xcc;return function(_0x353a3d){if(_0x353a3d){return _0x15f031['sendStatus'](_0x3a6f91);}return _0x15f031['status'](_0x3a6f91)[_0xe020('0x1a')]();};}function respondWithResult(_0x42634d,_0x1b1d8a){_0x1b1d8a=_0x1b1d8a||0xc8;return function(_0xeed51d){if(_0xeed51d){return _0x42634d[_0xe020('0x1b')](_0x1b1d8a)['json'](_0xeed51d);}};}function respondWithFilteredResult(_0x4b6ce9,_0x34453c){return function(_0x18e3d5){if(_0x18e3d5){var _0x3755c4=typeof _0x34453c[_0xe020('0x1c')]==='undefined'&&typeof _0x34453c[_0xe020('0x1d')]===_0xe020('0x1e');var _0x3cc6f1=_0x18e3d5[_0xe020('0x1f')];var _0x3d293b=_0x3755c4?0x0:_0x34453c[_0xe020('0x1c')];var _0x38e597=_0x3755c4?_0x18e3d5[_0xe020('0x1f')]:_0x34453c[_0xe020('0x1c')]+_0x34453c[_0xe020('0x1d')];var _0x1c1f42;if(_0x38e597>=_0x3cc6f1){_0x38e597=_0x3cc6f1;_0x1c1f42=0xc8;}else{_0x1c1f42=0xce;}_0x4b6ce9[_0xe020('0x1b')](_0x1c1f42);return _0x4b6ce9[_0xe020('0x20')](_0xe020('0x21'),_0x3d293b+'-'+_0x38e597+'/'+_0x3cc6f1)[_0xe020('0x22')](_0x18e3d5);}return null;};}function patchUpdates(_0x3f8e60){return function(_0x5ad90e){try{jsonpatch['apply'](_0x5ad90e,_0x3f8e60,!![]);}catch(_0x3df419){return BPromise[_0xe020('0x23')](_0x3df419);}return _0x5ad90e[_0xe020('0x24')]();};}function saveUpdates(_0x5c6e46,_0x1bcebe){return function(_0x22446a){if(_0x22446a){return _0x22446a[_0xe020('0x25')](_0x5c6e46)[_0xe020('0x26')](function(_0x2bb883){return _0x2bb883;});}return null;};}function removeEntity(_0x1690b0,_0x1197de){return function(_0xbf1e48){if(_0xbf1e48){return _0xbf1e48[_0xe020('0x27')]()[_0xe020('0x26')](function(){var _0x5a3229=_0xbf1e48[_0xe020('0x28')]({'plain':!![]});var _0x1d7763='CannedAnswers';return db[_0xe020('0x29')]['destroy']({'where':{'type':_0x1d7763,'resourceId':_0x5a3229['id']}})['then'](function(){return _0xbf1e48;});})['then'](function(){_0x1690b0['status'](0xcc)[_0xe020('0x1a')]();});}};}function handleEntityNotFound(_0x5d87bd,_0x36c92f){return function(_0x5b6222){if(!_0x5b6222){_0x5d87bd[_0xe020('0x2a')](0x194);}return _0x5b6222;};}function handleError(_0x560475,_0x25d2e7){_0x25d2e7=_0x25d2e7||0x1f4;return function(_0x56284c){logger[_0xe020('0x2b')](_0x56284c[_0xe020('0x2c')]);if(_0x56284c['name']){delete _0x56284c[_0xe020('0x2d')];}_0x560475[_0xe020('0x1b')](_0x25d2e7)[_0xe020('0x2e')](_0x56284c);};}exports['index']=function(_0x2ec0f2,_0x2eeeae){var _0x1a1599={},_0xee6a4a={},_0x252172={'count':0x0,'rows':[]};var _0x4d3d56=_[_0xe020('0x2f')](db['CannedAnswer']['rawAttributes'],function(_0x335c41){return{'name':_0x335c41[_0xe020('0x30')],'type':_0x335c41[_0xe020('0x31')][_0xe020('0x32')]};});_0xee6a4a['model']=_['map'](_0x4d3d56,'name');_0xee6a4a[_0xe020('0x33')]=_[_0xe020('0x34')](_0x2ec0f2[_0xe020('0x33')]);_0xee6a4a[_0xe020('0x35')]=_[_0xe020('0x36')](_0xee6a4a[_0xe020('0x37')],_0xee6a4a[_0xe020('0x33')]);_0x1a1599[_0xe020('0x38')]=_[_0xe020('0x36')](_0xee6a4a[_0xe020('0x37')],qs[_0xe020('0x39')](_0x2ec0f2['query'][_0xe020('0x39')]));_0x1a1599[_0xe020('0x38')]=_0x1a1599[_0xe020('0x38')][_0xe020('0x3a')]?_0x1a1599[_0xe020('0x38')]:_0xee6a4a[_0xe020('0x37')];if(!_0x2ec0f2[_0xe020('0x33')]['hasOwnProperty'](_0xe020('0x3b'))){_0x1a1599[_0xe020('0x1d')]=qs[_0xe020('0x1d')](_0x2ec0f2[_0xe020('0x33')][_0xe020('0x1d')]);_0x1a1599[_0xe020('0x1c')]=qs['offset'](_0x2ec0f2['query'][_0xe020('0x1c')]);}_0x1a1599[_0xe020('0x3c')]=qs[_0xe020('0x3d')](_0x2ec0f2[_0xe020('0x33')][_0xe020('0x3d')]);_0x1a1599[_0xe020('0x3e')]=qs[_0xe020('0x35')](_[_0xe020('0x3f')](_0x2ec0f2[_0xe020('0x33')],_0xee6a4a[_0xe020('0x35')]),_0x4d3d56);if(_0x2ec0f2[_0xe020('0x33')][_0xe020('0x40')]){_0x1a1599[_0xe020('0x3e')]=_['merge'](_0x1a1599[_0xe020('0x3e')],{'$or':[{'key':{'$like':'%'+_0x2ec0f2[_0xe020('0x33')][_0xe020('0x40')]+'%'}},{'value':{'$like':'%'+_0x2ec0f2['query'][_0xe020('0x40')]+'%'}}]});}_0x1a1599=_[_0xe020('0x41')]({},_0x1a1599,_0x2ec0f2[_0xe020('0x42')]);var _0x587c2f={'where':_0x1a1599[_0xe020('0x3e')]};return db[_0xe020('0x43')][_0xe020('0x1f')](_0x587c2f)[_0xe020('0x26')](function(_0x523883){_0x252172[_0xe020('0x1f')]=_0x523883;if(_0x2ec0f2[_0xe020('0x33')][_0xe020('0x44')]){_0x1a1599[_0xe020('0x45')]=[{'all':!![]}];}return db[_0xe020('0x43')][_0xe020('0x46')](_0x1a1599);})[_0xe020('0x26')](function(_0x363d1e){_0x252172['rows']=_0x363d1e;return _0x252172;})[_0xe020('0x26')](respondWithFilteredResult(_0x2eeeae,_0x1a1599))[_0xe020('0x47')](handleError(_0x2eeeae,null));};exports[_0xe020('0x48')]=function(_0x153ca3,_0x261e57){var _0x101d47={'raw':!![],'where':{'id':_0x153ca3[_0xe020('0x49')]['id']}},_0x59e33c={};_0x59e33c[_0xe020('0x37')]=_['keys'](db[_0xe020('0x43')][_0xe020('0x4a')]);_0x59e33c[_0xe020('0x33')]=_[_0xe020('0x34')](_0x153ca3[_0xe020('0x33')]);_0x59e33c[_0xe020('0x35')]=_[_0xe020('0x36')](_0x59e33c['model'],_0x59e33c['query']);_0x101d47[_0xe020('0x38')]=_[_0xe020('0x36')](_0x59e33c['model'],qs[_0xe020('0x39')](_0x153ca3[_0xe020('0x33')][_0xe020('0x39')]));_0x101d47['attributes']=_0x101d47[_0xe020('0x38')][_0xe020('0x3a')]?_0x101d47[_0xe020('0x38')]:_0x59e33c['model'];if(_0x153ca3[_0xe020('0x33')][_0xe020('0x44')]){_0x101d47[_0xe020('0x45')]=[{'all':!![]}];}_0x101d47=_[_0xe020('0x41')]({},_0x101d47,_0x153ca3['options']);return db['CannedAnswer']['find'](_0x101d47)['then'](handleEntityNotFound(_0x261e57,null))[_0xe020('0x26')](respondWithResult(_0x261e57,null))[_0xe020('0x47')](handleError(_0x261e57,null));};exports[_0xe020('0x25')]=function(_0x1c4d48,_0x292e95){if(_0x1c4d48[_0xe020('0x4b')]['id']){delete _0x1c4d48['body']['id'];}return db[_0xe020('0x43')][_0xe020('0x4c')]({'where':{'id':_0x1c4d48[_0xe020('0x49')]['id']}})[_0xe020('0x26')](handleEntityNotFound(_0x292e95,null))[_0xe020('0x26')](saveUpdates(_0x1c4d48[_0xe020('0x4b')],null))[_0xe020('0x26')](respondWithResult(_0x292e95,null))[_0xe020('0x47')](handleError(_0x292e95,null));};exports[_0xe020('0x27')]=function(_0x32d209,_0x2effd7){return db[_0xe020('0x43')]['find']({'where':{'id':_0x32d209[_0xe020('0x49')]['id']}})[_0xe020('0x26')](handleEntityNotFound(_0x2effd7,null))[_0xe020('0x26')](removeEntity(_0x2effd7,null))[_0xe020('0x47')](handleError(_0x2effd7,null));};exports[_0xe020('0x4d')]=function(_0x352971,_0x5b6e0e){var _0x301add={'key':_0x352971[_0xe020('0x4b')][_0xe020('0x32')]};if(_0x352971['body'][_0xe020('0x4e')]){_0x301add[_0xe020('0x4e')]=_0x352971[_0xe020('0x4b')][_0xe020('0x4e')];}else if(_0x352971[_0xe020('0x4b')][_0xe020('0x4f')]){_0x301add[_0xe020('0x4f')]=_0x352971[_0xe020('0x4b')][_0xe020('0x4f')];}else if(_0x352971['body'][_0xe020('0x50')]){_0x301add[_0xe020('0x50')]=_0x352971[_0xe020('0x4b')][_0xe020('0x50')];}else if(_0x352971[_0xe020('0x4b')][_0xe020('0x51')]){_0x301add[_0xe020('0x51')]=_0x352971['body']['ChatWebsiteId'];}return db['CannedAnswer'][_0xe020('0x4c')]({'where':_0x301add})[_0xe020('0x26')](function(_0x48baf3){if(_0x48baf3){throw new db[(_0xe020('0x52'))]['ValidationError'](_0xe020('0x53'));}return db['CannedAnswer'][_0xe020('0x4d')](_0x352971[_0xe020('0x4b')]);})[_0xe020('0x26')](function(_0x19a52e){var _0x14990d=_0x352971[_0xe020('0x54')][_0xe020('0x28')]({'plain':!![]});if(!_0x14990d)throw new Error(_0xe020('0x55'));if(_0x14990d[_0xe020('0x56')]===_0xe020('0x54')){var _0xe3b6e9=_0x19a52e[_0xe020('0x28')]({'plain':!![]});return db[_0xe020('0x57')][_0xe020('0x4c')]({'where':{'name':_0xe020('0x58'),'userProfileId':_0x14990d['userProfileId']},'raw':!![]})['then'](function(_0x5fc108){if(_0x5fc108&&_0x5fc108[_0xe020('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0xe3b6e9[_0xe020('0x2d')],'resourceId':_0xe3b6e9['id'],'type':_0x5fc108['name'],'sectionId':_0x5fc108['id']},{})[_0xe020('0x26')](function(){return _0x19a52e;});}else{return _0x19a52e;}})[_0xe020('0x47')](function(_0x31ca6f){logger[_0xe020('0x2b')](_0xe020('0x5a'),_0x31ca6f);throw _0x31ca6f;});}return _0x19a52e;})[_0xe020('0x26')](respondWithResult(_0x5b6e0e,0xc9))[_0xe020('0x47')](handleError(_0x5b6e0e,null));}; \ No newline at end of file +var _0xac3a=['sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','filter','includeAll','include','findAll','rows','catch','show','options','find','update','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x54b0f3,_0x1fe2f7){var _0x5ae957=function(_0x2749eb){while(--_0x2749eb){_0x54b0f3['push'](_0x54b0f3['shift']());}};_0x5ae957(++_0x1fe2f7);}(_0xac3a,0xf1));var _0xaac3=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xac3a[_0x1d70db];return _0x3060c6;};'use strict';var emlformat=require(_0xaac3('0x0'));var rimraf=require(_0xaac3('0x1'));var zipdir=require(_0xaac3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaac3('0x3'));var moment=require(_0xaac3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaac3('0x5'));var util=require(_0xaac3('0x6'));var path=require(_0xaac3('0x7'));var sox=require(_0xaac3('0x8'));var csv=require(_0xaac3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaac3('0xa'));var _=require('lodash');var squel=require(_0xaac3('0xb'));var crypto=require(_0xaac3('0xc'));var jsforce=require(_0xaac3('0xd'));var deskjs=require(_0xaac3('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaac3('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaac3('0x10'));var as=require(_0xaac3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaac3('0x12'))(_0xaac3('0x13'));var utils=require(_0xaac3('0x14'));var config=require(_0xaac3('0x15'));var licenseUtil=require(_0xaac3('0x16'));var db=require(_0xaac3('0x17'))['db'];function respondWithStatusCode(_0x35c105,_0x5ee970){_0x5ee970=_0x5ee970||0xcc;return function(_0x36d04a){if(_0x36d04a){return _0x35c105[_0xaac3('0x18')](_0x5ee970);}return _0x35c105[_0xaac3('0x19')](_0x5ee970)[_0xaac3('0x1a')]();};}function respondWithResult(_0x3a9e0e,_0x947860){_0x947860=_0x947860||0xc8;return function(_0x4d018a){if(_0x4d018a){return _0x3a9e0e[_0xaac3('0x19')](_0x947860)[_0xaac3('0x1b')](_0x4d018a);}};}function respondWithFilteredResult(_0x2fdec5,_0x353732){return function(_0x4e954b){if(_0x4e954b){var _0x229154=typeof _0x353732[_0xaac3('0x1c')]===_0xaac3('0x1d')&&typeof _0x353732[_0xaac3('0x1e')]===_0xaac3('0x1d');var _0x4bee47=_0x4e954b[_0xaac3('0x1f')];var _0xaedf75=_0x229154?0x0:_0x353732[_0xaac3('0x1c')];var _0x614f1f=_0x229154?_0x4e954b[_0xaac3('0x1f')]:_0x353732[_0xaac3('0x1c')]+_0x353732[_0xaac3('0x1e')];var _0x5e35a1;if(_0x614f1f>=_0x4bee47){_0x614f1f=_0x4bee47;_0x5e35a1=0xc8;}else{_0x5e35a1=0xce;}_0x2fdec5['status'](_0x5e35a1);return _0x2fdec5[_0xaac3('0x20')](_0xaac3('0x21'),_0xaedf75+'-'+_0x614f1f+'/'+_0x4bee47)[_0xaac3('0x1b')](_0x4e954b);}return null;};}function patchUpdates(_0x194b66){return function(_0x599280){try{jsonpatch[_0xaac3('0x22')](_0x599280,_0x194b66,!![]);}catch(_0x5a535a){return BPromise[_0xaac3('0x23')](_0x5a535a);}return _0x599280['save']();};}function saveUpdates(_0x7b262b,_0x125eb8){return function(_0x385e38){if(_0x385e38){return _0x385e38['update'](_0x7b262b)[_0xaac3('0x24')](function(_0x2d9838){return _0x2d9838;});}return null;};}function removeEntity(_0x2f0297,_0x1ca0bd){return function(_0x3bfbf6){if(_0x3bfbf6){return _0x3bfbf6[_0xaac3('0x25')]()['then'](function(){var _0x345d74=_0x3bfbf6[_0xaac3('0x26')]({'plain':!![]});var _0x3191d9=_0xaac3('0x27');return db[_0xaac3('0x28')]['destroy']({'where':{'type':_0x3191d9,'resourceId':_0x345d74['id']}})[_0xaac3('0x24')](function(){return _0x3bfbf6;});})[_0xaac3('0x24')](function(){_0x2f0297['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6c6a55,_0x2a5698){return function(_0x283a97){if(!_0x283a97){_0x6c6a55['sendStatus'](0x194);}return _0x283a97;};}function handleError(_0x18ddc3,_0xb87473){_0xb87473=_0xb87473||0x1f4;return function(_0xfe240a){logger['error'](_0xfe240a[_0xaac3('0x29')]);if(_0xfe240a['name']){delete _0xfe240a[_0xaac3('0x2a')];}_0x18ddc3[_0xaac3('0x19')](_0xb87473)['send'](_0xfe240a);};}exports[_0xaac3('0x2b')]=function(_0x17890d,_0x3c5ac2){var _0x6a3fdc={},_0x4b6ec7={},_0x418d3e={'count':0x0,'rows':[]};var _0x171a8c=_[_0xaac3('0x2c')](db[_0xaac3('0x2d')][_0xaac3('0x2e')],function(_0x3f7f45){return{'name':_0x3f7f45['fieldName'],'type':_0x3f7f45[_0xaac3('0x2f')][_0xaac3('0x30')]};});_0x4b6ec7[_0xaac3('0x31')]=_[_0xaac3('0x2c')](_0x171a8c,_0xaac3('0x2a'));_0x4b6ec7[_0xaac3('0x32')]=_[_0xaac3('0x33')](_0x17890d[_0xaac3('0x32')]);_0x4b6ec7['filters']=_[_0xaac3('0x34')](_0x4b6ec7['model'],_0x4b6ec7[_0xaac3('0x32')]);_0x6a3fdc[_0xaac3('0x35')]=_[_0xaac3('0x34')](_0x4b6ec7[_0xaac3('0x31')],qs[_0xaac3('0x36')](_0x17890d['query'][_0xaac3('0x36')]));_0x6a3fdc[_0xaac3('0x35')]=_0x6a3fdc[_0xaac3('0x35')][_0xaac3('0x37')]?_0x6a3fdc[_0xaac3('0x35')]:_0x4b6ec7[_0xaac3('0x31')];if(!_0x17890d[_0xaac3('0x32')][_0xaac3('0x38')]('nolimit')){_0x6a3fdc[_0xaac3('0x1e')]=qs['limit'](_0x17890d['query'][_0xaac3('0x1e')]);_0x6a3fdc[_0xaac3('0x1c')]=qs[_0xaac3('0x1c')](_0x17890d[_0xaac3('0x32')][_0xaac3('0x1c')]);}_0x6a3fdc['order']=qs[_0xaac3('0x39')](_0x17890d[_0xaac3('0x32')][_0xaac3('0x39')]);_0x6a3fdc[_0xaac3('0x3a')]=qs[_0xaac3('0x3b')](_[_0xaac3('0x3c')](_0x17890d[_0xaac3('0x32')],_0x4b6ec7[_0xaac3('0x3b')]),_0x171a8c);if(_0x17890d[_0xaac3('0x32')]['filter']){_0x6a3fdc['where']=_[_0xaac3('0x3d')](_0x6a3fdc[_0xaac3('0x3a')],{'$or':[{'key':{'$like':'%'+_0x17890d[_0xaac3('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x17890d[_0xaac3('0x32')][_0xaac3('0x3e')]+'%'}}]});}_0x6a3fdc=_['merge']({},_0x6a3fdc,_0x17890d['options']);var _0x4c2295={'where':_0x6a3fdc[_0xaac3('0x3a')]};return db[_0xaac3('0x2d')]['count'](_0x4c2295)['then'](function(_0x4e6f24){_0x418d3e[_0xaac3('0x1f')]=_0x4e6f24;if(_0x17890d[_0xaac3('0x32')][_0xaac3('0x3f')]){_0x6a3fdc[_0xaac3('0x40')]=[{'all':!![]}];}return db[_0xaac3('0x2d')][_0xaac3('0x41')](_0x6a3fdc);})[_0xaac3('0x24')](function(_0x8a49c0){_0x418d3e[_0xaac3('0x42')]=_0x8a49c0;return _0x418d3e;})[_0xaac3('0x24')](respondWithFilteredResult(_0x3c5ac2,_0x6a3fdc))[_0xaac3('0x43')](handleError(_0x3c5ac2,null));};exports[_0xaac3('0x44')]=function(_0x25dbfd,_0x39d112){var _0x45ef61={'raw':!![],'where':{'id':_0x25dbfd['params']['id']}},_0x2b0f60={};_0x2b0f60['model']=_['keys'](db[_0xaac3('0x2d')][_0xaac3('0x2e')]);_0x2b0f60[_0xaac3('0x32')]=_[_0xaac3('0x33')](_0x25dbfd['query']);_0x2b0f60['filters']=_[_0xaac3('0x34')](_0x2b0f60[_0xaac3('0x31')],_0x2b0f60[_0xaac3('0x32')]);_0x45ef61[_0xaac3('0x35')]=_['intersection'](_0x2b0f60['model'],qs[_0xaac3('0x36')](_0x25dbfd[_0xaac3('0x32')][_0xaac3('0x36')]));_0x45ef61[_0xaac3('0x35')]=_0x45ef61[_0xaac3('0x35')][_0xaac3('0x37')]?_0x45ef61[_0xaac3('0x35')]:_0x2b0f60[_0xaac3('0x31')];if(_0x25dbfd[_0xaac3('0x32')]['includeAll']){_0x45ef61[_0xaac3('0x40')]=[{'all':!![]}];}_0x45ef61=_[_0xaac3('0x3d')]({},_0x45ef61,_0x25dbfd[_0xaac3('0x45')]);return db['CannedAnswer'][_0xaac3('0x46')](_0x45ef61)['then'](handleEntityNotFound(_0x39d112,null))['then'](respondWithResult(_0x39d112,null))[_0xaac3('0x43')](handleError(_0x39d112,null));};exports[_0xaac3('0x47')]=function(_0x3e56dd,_0x5cf521){if(_0x3e56dd[_0xaac3('0x48')]['id']){delete _0x3e56dd[_0xaac3('0x48')]['id'];}return db['CannedAnswer'][_0xaac3('0x46')]({'where':{'id':_0x3e56dd[_0xaac3('0x49')]['id']}})[_0xaac3('0x24')](handleEntityNotFound(_0x5cf521,null))[_0xaac3('0x24')](saveUpdates(_0x3e56dd[_0xaac3('0x48')],null))[_0xaac3('0x24')](respondWithResult(_0x5cf521,null))['catch'](handleError(_0x5cf521,null));};exports[_0xaac3('0x25')]=function(_0x19e081,_0x15f843){return db[_0xaac3('0x2d')]['find']({'where':{'id':_0x19e081[_0xaac3('0x49')]['id']}})[_0xaac3('0x24')](handleEntityNotFound(_0x15f843,null))[_0xaac3('0x24')](removeEntity(_0x15f843,null))[_0xaac3('0x43')](handleError(_0x15f843,null));};exports[_0xaac3('0x4a')]=function(_0x487a36,_0x1d422b){var _0x2423ce={'key':_0x487a36['body'][_0xaac3('0x30')]};if(_0x487a36[_0xaac3('0x48')][_0xaac3('0x4b')]){_0x2423ce['MailAccountId']=_0x487a36[_0xaac3('0x48')][_0xaac3('0x4b')];}else if(_0x487a36['body'][_0xaac3('0x4c')]){_0x2423ce[_0xaac3('0x4c')]=_0x487a36['body'][_0xaac3('0x4c')];}else if(_0x487a36[_0xaac3('0x48')][_0xaac3('0x4d')]){_0x2423ce['OpenchannelAccountId']=_0x487a36[_0xaac3('0x48')][_0xaac3('0x4d')];}else if(_0x487a36[_0xaac3('0x48')][_0xaac3('0x4e')]){_0x2423ce[_0xaac3('0x4e')]=_0x487a36[_0xaac3('0x48')]['ChatWebsiteId'];}return db[_0xaac3('0x2d')]['find']({'where':_0x2423ce})['then'](function(_0xd309a4){if(_0xd309a4){throw new db['Sequelize']['ValidationError'](_0xaac3('0x4f'));}return db[_0xaac3('0x2d')][_0xaac3('0x4a')](_0x487a36[_0xaac3('0x48')]);})[_0xaac3('0x24')](function(_0x19fe65){var _0x2af41e=_0x487a36['user'][_0xaac3('0x26')]({'plain':!![]});if(!_0x2af41e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2af41e[_0xaac3('0x50')]==='user'){var _0x26cdcf=_0x19fe65['get']({'plain':!![]});return db[_0xaac3('0x51')][_0xaac3('0x46')]({'where':{'name':'CannedAnswers','userProfileId':_0x2af41e['userProfileId']},'raw':!![]})[_0xaac3('0x24')](function(_0x7f926d){if(_0x7f926d&&_0x7f926d['autoAssociation']===0x0){return db[_0xaac3('0x28')][_0xaac3('0x4a')]({'name':_0x26cdcf[_0xaac3('0x2a')],'resourceId':_0x26cdcf['id'],'type':_0x7f926d['name'],'sectionId':_0x7f926d['id']},{})['then'](function(){return _0x19fe65;});}else{return _0x19fe65;}})[_0xaac3('0x43')](function(_0x141c56){logger['error'](_0xaac3('0x52'),_0x141c56);throw _0x141c56;});}return _0x19fe65;})[_0xaac3('0x24')](respondWithResult(_0x1d422b,0xc9))[_0xaac3('0x43')](handleError(_0x1d422b,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 3f27aff..f918333 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 _0xc961=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x354ddf,_0x4f46e7){var _0x488586=function(_0x3cf597){while(--_0x3cf597){_0x354ddf['push'](_0x354ddf['shift']());}};_0x488586(++_0x4f46e7);}(_0xc961,0x17a));var _0x1c96=function(_0x1cffe2,_0x5383e8){_0x1cffe2=_0x1cffe2-0x0;var _0x57030e=_0xc961[_0x1cffe2];return _0x57030e;};'use strict';var _=require(_0x1c96('0x0'));var util=require(_0x1c96('0x1'));var logger=require(_0x1c96('0x2'))(_0x1c96('0x3'));var moment=require(_0x1c96('0x4'));var BPromise=require(_0x1c96('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1c96('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x1c96('0x7')]=function(_0x5594ee,_0x19d78b){return _0x5594ee[_0x1c96('0x8')](_0x1c96('0x9'),attributes,{'tableName':_0x1c96('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1c96('0xb'),'collate':_0x1c96('0xc')});}; \ No newline at end of file +var _0x06a1=['moment','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','lodash','util','api'];(function(_0x5241eb,_0x3cac37){var _0x31ec6a=function(_0x3ec828){while(--_0x3ec828){_0x5241eb['push'](_0x5241eb['shift']());}};_0x31ec6a(++_0x3cac37);}(_0x06a1,0x14d));var _0x106a=function(_0xde1868,_0x371bc0){_0xde1868=_0xde1868-0x0;var _0x2b2d95=_0x06a1[_0xde1868];return _0x2b2d95;};'use strict';var _=require(_0x106a('0x0'));var util=require(_0x106a('0x1'));var logger=require('../../config/logger')(_0x106a('0x2'));var moment=require(_0x106a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x106a('0x4'));var rimraf=require(_0x106a('0x5'));var config=require(_0x106a('0x6'));var attributes=require(_0x106a('0x7'));module[_0x106a('0x8')]=function(_0xe71de5,_0x13c540){return _0xe71de5[_0x106a('0x9')]('CannedAnswer',attributes,{'tableName':_0x106a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x106a('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index bbe0c41..59e9758 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(_0x5852b0,_0x2016a0){var _0x325f43=function(_0x2c3ab2){while(--_0x2c3ab2){_0x5852b0['push'](_0x5852b0['shift']());}};_0x325f43(++_0x2016a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0xe326ad,_0x523539){var _0x16eb20=function(_0x172c87){while(--_0x172c87){_0xe326ad['push'](_0xe326ad['shift']());}};_0x16eb20(++_0x523539);}(_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);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 8c5b576..acbf7f3 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 _0x3993=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','exports','multer'];(function(_0x28ad97,_0x488ddd){var _0x209ff6=function(_0x1cb0b6){while(--_0x1cb0b6){_0x28ad97['push'](_0x28ad97['shift']());}};_0x209ff6(++_0x488ddd);}(_0x3993,0x6f));var _0x3399=function(_0x5876aa,_0x4b790d){_0x5876aa=_0x5876aa-0x0;var _0x3017f3=_0x3993[_0x5876aa];return _0x3017f3;};'use strict';var multer=require(_0x3399('0x0'));var util=require('util');var path=require(_0x3399('0x1'));var timeout=require(_0x3399('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3399('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3399('0x4'));var config=require(_0x3399('0x5'));var controller=require(_0x3399('0x6'));router[_0x3399('0x7')]('/',auth[_0x3399('0x8')](),controller[_0x3399('0x9')]);router[_0x3399('0x7')](_0x3399('0xa'),auth[_0x3399('0x8')](),controller[_0x3399('0xb')]);router[_0x3399('0xc')]('/',auth[_0x3399('0x8')](),controller[_0x3399('0xd')]);router[_0x3399('0xe')](_0x3399('0xa'),auth[_0x3399('0x8')](),controller['update']);router['delete'](_0x3399('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x3399('0xf')]=router; \ No newline at end of file +var _0x1fed=['get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fed,0x16c));var _0xd1fe=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0x1fed[_0x4f8f3b];return _0x4c250c;};'use strict';var multer=require(_0xd1fe('0x0'));var util=require(_0xd1fe('0x1'));var path=require(_0xd1fe('0x2'));var timeout=require(_0xd1fe('0x3'));var express=require(_0xd1fe('0x4'));var router=express[_0xd1fe('0x5')]();var fs_extra=require(_0xd1fe('0x6'));var auth=require(_0xd1fe('0x7'));var interaction=require(_0xd1fe('0x8'));var config=require('../../config/environment');var controller=require(_0xd1fe('0x9'));router[_0xd1fe('0xa')]('/',auth['isAuthenticated'](),controller[_0xd1fe('0xb')]);router[_0xd1fe('0xa')]('/:id',auth[_0xd1fe('0xc')](),controller[_0xd1fe('0xd')]);router[_0xd1fe('0xe')]('/',auth[_0xd1fe('0xc')](),controller[_0xd1fe('0xf')]);router[_0xd1fe('0x10')](_0xd1fe('0x11'),auth['isAuthenticated'](),controller[_0xd1fe('0x12')]);router[_0xd1fe('0x13')](_0xd1fe('0x11'),auth[_0xd1fe('0xc')](),controller[_0xd1fe('0x14')]);module[_0xd1fe('0x15')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 19d048a..ff9b5d5 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 _0xa902=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa902,0x8d));var _0x2a90=function(_0xd576a0,_0x36cc02){_0xd576a0=_0xd576a0-0x0;var _0x3ff77c=_0xa902[_0xd576a0];return _0x3ff77c;};'use strict';var Sequelize=require(_0x2a90('0x0'));module[_0x2a90('0x1')]={'calldate':{'type':Sequelize[_0x2a90('0x2')],'allowNull':![],'defaultValue':_0x2a90('0x3')},'clid':{'type':Sequelize[_0x2a90('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x2a90('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x2a90('0x4')]},'lastapp':{'type':Sequelize[_0x2a90('0x4')]},'lastdata':{'type':Sequelize[_0x2a90('0x4')]},'duration':{'type':Sequelize[_0x2a90('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2a90('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2a90('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2a90('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x2a90('0x4')]},'sequence':{'type':Sequelize[_0x2a90('0x4')]},'peeraccount':{'type':Sequelize[_0x2a90('0x4')]},'type':{'type':Sequelize[_0x2a90('0x4')]},'tag':{'type':Sequelize[_0x2a90('0x4')]}}; \ No newline at end of file +var _0x8192=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x1a5326,_0x56e265){var _0x202d9c=function(_0x378df4){while(--_0x378df4){_0x1a5326['push'](_0x1a5326['shift']());}};_0x202d9c(++_0x56e265);}(_0x8192,0x82));var _0x2819=function(_0x199f9d,_0x2d9087){_0x199f9d=_0x199f9d-0x0;var _0x373c25=_0x8192[_0x199f9d];return _0x373c25;};'use strict';var Sequelize=require(_0x2819('0x0'));module[_0x2819('0x1')]={'calldate':{'type':Sequelize[_0x2819('0x2')],'allowNull':![],'defaultValue':_0x2819('0x3')},'clid':{'type':Sequelize[_0x2819('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x2819('0x4')]},'dcontext':{'type':Sequelize[_0x2819('0x4')]},'channel':{'type':Sequelize[_0x2819('0x4')]},'dstchannel':{'type':Sequelize[_0x2819('0x4')]},'lastapp':{'type':Sequelize[_0x2819('0x4')]},'lastdata':{'type':Sequelize[_0x2819('0x4')]},'duration':{'type':Sequelize[_0x2819('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2819('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x2819('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2819('0x4')]},'userfield':{'type':Sequelize[_0x2819('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x2819('0x4')]},'peeraccount':{'type':Sequelize[_0x2819('0x4')]},'type':{'type':Sequelize[_0x2819('0x4')]},'tag':{'type':Sequelize[_0x2819('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index caab562..9f18ed2 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 _0x7c09=['map','Cdr','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index'];(function(_0xd4d1f5,_0x497669){var _0x20f28b=function(_0x30f79f){while(--_0x30f79f){_0xd4d1f5['push'](_0xd4d1f5['shift']());}};_0x20f28b(++_0x497669);}(_0x7c09,0x102));var _0x97c0=function(_0x4823b8,_0x1e51d3){_0x4823b8=_0x4823b8-0x0;var _0x632efd=_0x7c09[_0x4823b8];return _0x632efd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c0('0x0'));var zipdir=require(_0x97c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c0('0x2'));var moment=require(_0x97c0('0x3'));var BPromise=require(_0x97c0('0x4'));var Mustache=require(_0x97c0('0x5'));var util=require(_0x97c0('0x6'));var path=require(_0x97c0('0x7'));var sox=require(_0x97c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var licenseUtil=require(_0x97c0('0x16'));var db=require(_0x97c0('0x17'))['db'];function respondWithStatusCode(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xcc;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0x18')](_0x9ca3c1);}return _0x39a3b4[_0x97c0('0x19')](_0x9ca3c1)[_0x97c0('0x1a')]();};}function respondWithResult(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0xc8;return function(_0x15b336){if(_0x15b336){return _0x514782[_0x97c0('0x19')](_0x3f2fc2)['json'](_0x15b336);}};}function respondWithFilteredResult(_0x42027d,_0x9ca6a8){return function(_0x379951){if(_0x379951){var _0x21e5f7=typeof _0x9ca6a8[_0x97c0('0x1b')]===_0x97c0('0x1c')&&typeof _0x9ca6a8['limit']===_0x97c0('0x1c');var _0x3ae7c4=_0x379951['count'];var _0x560ac0=_0x21e5f7?0x0:_0x9ca6a8[_0x97c0('0x1b')];var _0x179d43=_0x21e5f7?_0x379951[_0x97c0('0x1d')]:_0x9ca6a8[_0x97c0('0x1b')]+_0x9ca6a8[_0x97c0('0x1e')];var _0x4fed42;if(_0x179d43>=_0x3ae7c4){_0x179d43=_0x3ae7c4;_0x4fed42=0xc8;}else{_0x4fed42=0xce;}_0x42027d[_0x97c0('0x19')](_0x4fed42);return _0x42027d[_0x97c0('0x1f')](_0x97c0('0x20'),_0x560ac0+'-'+_0x179d43+'/'+_0x3ae7c4)['json'](_0x379951);}return null;};}function patchUpdates(_0x554122){return function(_0x2b74a2){try{jsonpatch[_0x97c0('0x21')](_0x2b74a2,_0x554122,!![]);}catch(_0x169f19){return BPromise['reject'](_0x169f19);}return _0x2b74a2[_0x97c0('0x22')]();};}function saveUpdates(_0x20bc4c,_0x31ffb7){return function(_0x272314){if(_0x272314){return _0x272314[_0x97c0('0x23')](_0x20bc4c)[_0x97c0('0x24')](function(_0x9dff60){return _0x9dff60;});}return null;};}function removeEntity(_0x5ac457,_0x60ab00){return function(_0x29b3aa){if(_0x29b3aa){return _0x29b3aa[_0x97c0('0x25')]()[_0x97c0('0x24')](function(){_0x5ac457['status'](0xcc)[_0x97c0('0x1a')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x18')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x26')]);if(_0x4f11ba[_0x97c0('0x27')]){delete _0x4f11ba[_0x97c0('0x27')];}_0x447316[_0x97c0('0x19')](_0x4af5a5)[_0x97c0('0x28')](_0x4f11ba);};}exports[_0x97c0('0x29')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')],function(_0x2a7b2b){return{'name':_0x2a7b2b['fieldName'],'type':_0x2a7b2b['type'][_0x97c0('0x2d')]};});_0x325090[_0x97c0('0x2e')]=_[_0x97c0('0x2a')](_0x14617c,'name');_0x325090[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x4a3645['query']);_0x325090[_0x97c0('0x31')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x33')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x1c183f[_0x97c0('0x33')]=_0x1c183f[_0x97c0('0x33')][_0x97c0('0x35')]?_0x1c183f[_0x97c0('0x33')]:_0x325090[_0x97c0('0x2e')];if(!_0x4a3645['query'][_0x97c0('0x36')](_0x97c0('0x37'))){_0x1c183f[_0x97c0('0x1e')]=qs[_0x97c0('0x1e')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1e')]);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645['query'][_0x97c0('0x1b')]);}_0x1c183f['order']=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f[_0x97c0('0x39')]=qs[_0x97c0('0x31')](_[_0x97c0('0x3a')](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x31')]),_0x14617c);if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3b')]){_0x1c183f[_0x97c0('0x39')]=_['merge'](_0x1c183f[_0x97c0('0x39')],{'$or':_[_0x97c0('0x2a')](_0x14617c,function(_0x4d47b1){if(_0x4d47b1[_0x97c0('0x3c')]!==_0x97c0('0x3d')){var _0x2aeffc={};_0x2aeffc[_0x4d47b1[_0x97c0('0x27')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x3b')]+'%'};return _0x2aeffc;}})});}_0x1c183f=_['merge']({},_0x1c183f,_0x4a3645[_0x97c0('0x3e')]);var _0x64cfcd={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')][_0x97c0('0x1d')](_0x64cfcd)[_0x97c0('0x24')](function(_0xb13649){_0x4ad645[_0x97c0('0x1d')]=_0xb13649;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x1c183f[_0x97c0('0x40')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x41')](_0x1c183f);})[_0x97c0('0x24')](function(_0x2cca4c){_0x4ad645[_0x97c0('0x42')]=_0x2cca4c;return _0x4ad645;})['then'](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x43')](handleError(_0x10e47e,null));};exports[_0x97c0('0x44')]=function(_0x1dc6ff,_0x142421){var _0x312fce={'raw':!![],'where':{'id':_0x1dc6ff[_0x97c0('0x45')]['id']}},_0x375ebc={};_0x375ebc['model']=_['keys'](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x375ebc[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x1dc6ff[_0x97c0('0x2f')]);_0x375ebc['filters']=_['intersection'](_0x375ebc['model'],_0x375ebc[_0x97c0('0x2f')]);_0x312fce['attributes']=_['intersection'](_0x375ebc[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x312fce[_0x97c0('0x33')]=_0x312fce['attributes'][_0x97c0('0x35')]?_0x312fce[_0x97c0('0x33')]:_0x375ebc[_0x97c0('0x2e')];if(_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x312fce[_0x97c0('0x40')]=[{'all':!![]}];}_0x312fce=_[_0x97c0('0x46')]({},_0x312fce,_0x1dc6ff[_0x97c0('0x3e')]);return db[_0x97c0('0x2b')][_0x97c0('0x47')](_0x312fce)['then'](handleEntityNotFound(_0x142421,null))[_0x97c0('0x24')](respondWithResult(_0x142421,null))[_0x97c0('0x43')](handleError(_0x142421,null));};exports[_0x97c0('0x48')]=function(_0x276c98,_0x4ff0a5){return db['Cdr'][_0x97c0('0x48')](_0x276c98[_0x97c0('0x49')],{})[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,0xc9))['catch'](handleError(_0x4ff0a5,null));};exports[_0x97c0('0x23')]=function(_0xac56ac,_0x240f68){if(_0xac56ac[_0x97c0('0x49')]['id']){delete _0xac56ac[_0x97c0('0x49')]['id'];}return db['Cdr'][_0x97c0('0x47')]({'where':{'id':_0xac56ac[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x240f68,null))['then'](saveUpdates(_0xac56ac['body'],null))[_0x97c0('0x24')](respondWithResult(_0x240f68,null))['catch'](handleError(_0x240f68,null));};exports['destroy']=function(_0x473b63,_0x20e2a5){return db[_0x97c0('0x2b')]['find']({'where':{'id':_0x473b63['params']['id']}})['then'](handleEntityNotFound(_0x20e2a5,null))[_0x97c0('0x24')](removeEntity(_0x20e2a5,null))[_0x97c0('0x43')](handleError(_0x20e2a5,null));};exports[_0x97c0('0x4a')]=function(_0xdb2767,_0x397065){return db[_0x97c0('0x2b')][_0x97c0('0x4a')]()['then'](respondWithResult(_0x397065,null))[_0x97c0('0x43')](handleError(_0x397065,null));}; \ No newline at end of file +var _0xf9d5=['lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','sendStatus','error','stack','name','index','map','Cdr','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x50f0a9,_0x2b0c57){var _0x5a33d9=function(_0x40338e){while(--_0x40338e){_0x50f0a9['push'](_0x50f0a9['shift']());}};_0x5a33d9(++_0x2b0c57);}(_0xf9d5,0x122));var _0x5f9d=function(_0x3bd4a5,_0x2597bd){_0x3bd4a5=_0x3bd4a5-0x0;var _0x41d843=_0xf9d5[_0x3bd4a5];return _0x41d843;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f9d('0x0'));var zipdir=require(_0x5f9d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f9d('0x2'));var moment=require(_0x5f9d('0x3'));var BPromise=require(_0x5f9d('0x4'));var Mustache=require(_0x5f9d('0x5'));var util=require(_0x5f9d('0x6'));var path=require(_0x5f9d('0x7'));var sox=require(_0x5f9d('0x8'));var csv=require('to-csv');var ejs=require(_0x5f9d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f9d('0xa'));var squel=require(_0x5f9d('0xb'));var crypto=require('crypto');var jsforce=require(_0x5f9d('0xc'));var deskjs=require(_0x5f9d('0xd'));var toCsv=require(_0x5f9d('0xe'));var querystring=require(_0x5f9d('0xf'));var Papa=require(_0x5f9d('0x10'));var Redis=require(_0x5f9d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f9d('0x12'));var as=require(_0x5f9d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f9d('0x14'));var utils=require(_0x5f9d('0x15'));var config=require(_0x5f9d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f9d('0x17'))['db'];function respondWithStatusCode(_0x10f5b1,_0x257910){_0x257910=_0x257910||0xcc;return function(_0x23a39f){if(_0x23a39f){return _0x10f5b1['sendStatus'](_0x257910);}return _0x10f5b1[_0x5f9d('0x18')](_0x257910)[_0x5f9d('0x19')]();};}function respondWithResult(_0x234902,_0x5aacdc){_0x5aacdc=_0x5aacdc||0xc8;return function(_0x8e2381){if(_0x8e2381){return _0x234902[_0x5f9d('0x18')](_0x5aacdc)['json'](_0x8e2381);}};}function respondWithFilteredResult(_0x4fd1cb,_0x2f0154){return function(_0x334cea){if(_0x334cea){var _0x3d4a1c=typeof _0x2f0154[_0x5f9d('0x1a')]===_0x5f9d('0x1b')&&typeof _0x2f0154['limit']==='undefined';var _0x54bd00=_0x334cea[_0x5f9d('0x1c')];var _0x4fb9a5=_0x3d4a1c?0x0:_0x2f0154[_0x5f9d('0x1a')];var _0x48448e=_0x3d4a1c?_0x334cea[_0x5f9d('0x1c')]:_0x2f0154[_0x5f9d('0x1a')]+_0x2f0154[_0x5f9d('0x1d')];var _0x55a31c;if(_0x48448e>=_0x54bd00){_0x48448e=_0x54bd00;_0x55a31c=0xc8;}else{_0x55a31c=0xce;}_0x4fd1cb[_0x5f9d('0x18')](_0x55a31c);return _0x4fd1cb[_0x5f9d('0x1e')](_0x5f9d('0x1f'),_0x4fb9a5+'-'+_0x48448e+'/'+_0x54bd00)[_0x5f9d('0x20')](_0x334cea);}return null;};}function patchUpdates(_0x320182){return function(_0xa62826){try{jsonpatch[_0x5f9d('0x21')](_0xa62826,_0x320182,!![]);}catch(_0x2563d5){return BPromise[_0x5f9d('0x22')](_0x2563d5);}return _0xa62826['save']();};}function saveUpdates(_0x4a2eeb,_0x5465b1){return function(_0x1bc76b){if(_0x1bc76b){return _0x1bc76b['update'](_0x4a2eeb)[_0x5f9d('0x23')](function(_0x5a3472){return _0x5a3472;});}return null;};}function removeEntity(_0x9d86ce,_0x564886){return function(_0x4875c5){if(_0x4875c5){return _0x4875c5['destroy']()[_0x5f9d('0x23')](function(){_0x9d86ce[_0x5f9d('0x18')](0xcc)[_0x5f9d('0x19')]();});}};}function handleEntityNotFound(_0x234511,_0x542bbc){return function(_0x379d2d){if(!_0x379d2d){_0x234511[_0x5f9d('0x24')](0x194);}return _0x379d2d;};}function handleError(_0x190402,_0x74f212){_0x74f212=_0x74f212||0x1f4;return function(_0x2d097f){logger[_0x5f9d('0x25')](_0x2d097f[_0x5f9d('0x26')]);if(_0x2d097f[_0x5f9d('0x27')]){delete _0x2d097f[_0x5f9d('0x27')];}_0x190402[_0x5f9d('0x18')](_0x74f212)['send'](_0x2d097f);};}exports[_0x5f9d('0x28')]=function(_0x1b9054,_0x1496c0){var _0x13cc7c={},_0x10e542={},_0x24233e={'count':0x0,'rows':[]};var _0x38b10d=_[_0x5f9d('0x29')](db[_0x5f9d('0x2a')]['rawAttributes'],function(_0x4ed27d){return{'name':_0x4ed27d['fieldName'],'type':_0x4ed27d[_0x5f9d('0x2b')]['key']};});_0x10e542[_0x5f9d('0x2c')]=_['map'](_0x38b10d,_0x5f9d('0x27'));_0x10e542['query']=_[_0x5f9d('0x2d')](_0x1b9054[_0x5f9d('0x2e')]);_0x10e542[_0x5f9d('0x2f')]=_[_0x5f9d('0x30')](_0x10e542[_0x5f9d('0x2c')],_0x10e542['query']);_0x13cc7c[_0x5f9d('0x31')]=_['intersection'](_0x10e542[_0x5f9d('0x2c')],qs['fields'](_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x32')]));_0x13cc7c['attributes']=_0x13cc7c[_0x5f9d('0x31')][_0x5f9d('0x33')]?_0x13cc7c[_0x5f9d('0x31')]:_0x10e542['model'];if(!_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x34')](_0x5f9d('0x35'))){_0x13cc7c[_0x5f9d('0x1d')]=qs[_0x5f9d('0x1d')](_0x1b9054['query'][_0x5f9d('0x1d')]);_0x13cc7c[_0x5f9d('0x1a')]=qs[_0x5f9d('0x1a')](_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x1a')]);}_0x13cc7c[_0x5f9d('0x36')]=qs['sort'](_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x37')]);_0x13cc7c[_0x5f9d('0x38')]=qs['filters'](_['pick'](_0x1b9054[_0x5f9d('0x2e')],_0x10e542[_0x5f9d('0x2f')]),_0x38b10d);if(_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x39')]){_0x13cc7c[_0x5f9d('0x38')]=_['merge'](_0x13cc7c['where'],{'$or':_[_0x5f9d('0x29')](_0x38b10d,function(_0x3c5737){if(_0x3c5737['type']!==_0x5f9d('0x3a')){var _0x4e15be={};_0x4e15be[_0x3c5737[_0x5f9d('0x27')]]={'$like':'%'+_0x1b9054[_0x5f9d('0x2e')]['filter']+'%'};return _0x4e15be;}})});}_0x13cc7c=_[_0x5f9d('0x3b')]({},_0x13cc7c,_0x1b9054[_0x5f9d('0x3c')]);var _0x4d3288={'where':_0x13cc7c['where']};return db[_0x5f9d('0x2a')][_0x5f9d('0x1c')](_0x4d3288)[_0x5f9d('0x23')](function(_0x3c43f6){_0x24233e[_0x5f9d('0x1c')]=_0x3c43f6;if(_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x3d')]){_0x13cc7c[_0x5f9d('0x3e')]=[{'all':!![]}];}return db[_0x5f9d('0x2a')][_0x5f9d('0x3f')](_0x13cc7c);})[_0x5f9d('0x23')](function(_0x227ef6){_0x24233e[_0x5f9d('0x40')]=_0x227ef6;return _0x24233e;})[_0x5f9d('0x23')](respondWithFilteredResult(_0x1496c0,_0x13cc7c))[_0x5f9d('0x41')](handleError(_0x1496c0,null));};exports[_0x5f9d('0x42')]=function(_0x45ba15,_0x1590b5){var _0xf02211={'raw':!![],'where':{'id':_0x45ba15[_0x5f9d('0x43')]['id']}},_0x21b5d1={};_0x21b5d1[_0x5f9d('0x2c')]=_[_0x5f9d('0x2d')](db[_0x5f9d('0x2a')][_0x5f9d('0x44')]);_0x21b5d1[_0x5f9d('0x2e')]=_[_0x5f9d('0x2d')](_0x45ba15[_0x5f9d('0x2e')]);_0x21b5d1[_0x5f9d('0x2f')]=_[_0x5f9d('0x30')](_0x21b5d1['model'],_0x21b5d1[_0x5f9d('0x2e')]);_0xf02211['attributes']=_[_0x5f9d('0x30')](_0x21b5d1[_0x5f9d('0x2c')],qs[_0x5f9d('0x32')](_0x45ba15[_0x5f9d('0x2e')][_0x5f9d('0x32')]));_0xf02211[_0x5f9d('0x31')]=_0xf02211[_0x5f9d('0x31')]['length']?_0xf02211[_0x5f9d('0x31')]:_0x21b5d1[_0x5f9d('0x2c')];if(_0x45ba15[_0x5f9d('0x2e')]['includeAll']){_0xf02211[_0x5f9d('0x3e')]=[{'all':!![]}];}_0xf02211=_['merge']({},_0xf02211,_0x45ba15[_0x5f9d('0x3c')]);return db[_0x5f9d('0x2a')][_0x5f9d('0x45')](_0xf02211)['then'](handleEntityNotFound(_0x1590b5,null))['then'](respondWithResult(_0x1590b5,null))[_0x5f9d('0x41')](handleError(_0x1590b5,null));};exports[_0x5f9d('0x46')]=function(_0x4c9645,_0x2a43a3){return db['Cdr'][_0x5f9d('0x46')](_0x4c9645[_0x5f9d('0x47')],{})[_0x5f9d('0x23')](respondWithResult(_0x2a43a3,0xc9))[_0x5f9d('0x41')](handleError(_0x2a43a3,null));};exports[_0x5f9d('0x48')]=function(_0x16a9fa,_0x3aa63c){if(_0x16a9fa[_0x5f9d('0x47')]['id']){delete _0x16a9fa[_0x5f9d('0x47')]['id'];}return db[_0x5f9d('0x2a')]['find']({'where':{'id':_0x16a9fa[_0x5f9d('0x43')]['id']}})[_0x5f9d('0x23')](handleEntityNotFound(_0x3aa63c,null))['then'](saveUpdates(_0x16a9fa[_0x5f9d('0x47')],null))[_0x5f9d('0x23')](respondWithResult(_0x3aa63c,null))[_0x5f9d('0x41')](handleError(_0x3aa63c,null));};exports[_0x5f9d('0x49')]=function(_0xc9a152,_0x414868){return db[_0x5f9d('0x2a')][_0x5f9d('0x45')]({'where':{'id':_0xc9a152['params']['id']}})['then'](handleEntityNotFound(_0x414868,null))[_0x5f9d('0x23')](removeEntity(_0x414868,null))[_0x5f9d('0x41')](handleError(_0x414868,null));};exports[_0x5f9d('0x4a')]=function(_0x101616,_0x97aac2){return db[_0x5f9d('0x2a')][_0x5f9d('0x4a')]()[_0x5f9d('0x23')](respondWithResult(_0x97aac2,null))[_0x5f9d('0x41')](handleError(_0x97aac2,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 82ac2e8..931c4f2 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(_0xc1a87b,_0x38551a){var _0x1c61e8=function(_0x103467){while(--_0x103467){_0xc1a87b['push'](_0xc1a87b['shift']());}};_0x1c61e8(++_0x38551a);}(_0x7a54,0x106));var _0x47a5=function(_0x2c60c1,_0x4cac53){_0x2c60c1=_0x2c60c1-0x0;var _0x2fc088=_0x7a54[_0x2c60c1];return _0x2fc088;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x64e908,_0x371301){var _0x1938f1=function(_0x1d10d6){while(--_0x1d10d6){_0x64e908['push'](_0x64e908['shift']());}};_0x1938f1(++_0x371301);}(_0x7a54,0x106));var _0x47a5=function(_0x2434d4,_0x18c697){_0x2434d4=_0x2434d4-0x0;var _0x13c250=_0x7a54[_0x2434d4];return _0x13c250;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 633aa9c..2781f03 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 _0xac26=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment'];(function(_0x4ff1a8,_0xbb3134){var _0x5b5582=function(_0x5a760f){while(--_0x5a760f){_0x4ff1a8['push'](_0x4ff1a8['shift']());}};_0x5b5582(++_0xbb3134);}(_0xac26,0x1b5));var _0x6ac2=function(_0x30d207,_0x49543a){_0x30d207=_0x30d207-0x0;var _0x17ca1d=_0xac26[_0x30d207];return _0x17ca1d;};'use strict';var _=require(_0x6ac2('0x0'));var util=require(_0x6ac2('0x1'));var moment=require(_0x6ac2('0x2'));var BPromise=require(_0x6ac2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ac2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ac2('0x5'));var logger=require(_0x6ac2('0x6'))(_0x6ac2('0x7'));var config=require(_0x6ac2('0x8'));var jayson=require(_0x6ac2('0x9'));var client=jayson[_0x6ac2('0xa')][_0x6ac2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c4944,_0x58bf8b,_0x1e47d8){return new BPromise(function(_0x3a604f,_0x3aa781){return client['request'](_0x1c4944,_0x1e47d8)[_0x6ac2('0xc')](function(_0x531ebe){logger[_0x6ac2('0xd')](_0x6ac2('0xe'),_0x58bf8b,'request\x20sent');logger['debug'](_0x6ac2('0xf'),_0x58bf8b,_0x6ac2('0x10'),JSON['stringify'](_0x531ebe));if(_0x531ebe[_0x6ac2('0x11')]){if(_0x531ebe[_0x6ac2('0x11')][_0x6ac2('0x12')]===0x1f4){logger[_0x6ac2('0x11')](_0x6ac2('0xe'),_0x58bf8b,_0x531ebe['error']['message']);return _0x3aa781(_0x531ebe[_0x6ac2('0x11')][_0x6ac2('0x13')]);}logger[_0x6ac2('0x11')](_0x6ac2('0xe'),_0x58bf8b,_0x531ebe[_0x6ac2('0x11')][_0x6ac2('0x13')]);return _0x3a604f(_0x531ebe['error'][_0x6ac2('0x13')]);}else{logger[_0x6ac2('0xd')](_0x6ac2('0xe'),_0x58bf8b,_0x6ac2('0x10'));_0x3a604f(_0x531ebe['result'][_0x6ac2('0x13')]);}})['catch'](function(_0x1cba50){logger[_0x6ac2('0x11')](_0x6ac2('0xe'),_0x58bf8b,_0x1cba50);_0x3aa781(_0x1cba50);});});} \ No newline at end of file +var _0xa26a=['randomstring','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird'];(function(_0x3fe17b,_0x6237ef){var _0x338b9b=function(_0x4837b3){while(--_0x4837b3){_0x3fe17b['push'](_0x3fe17b['shift']());}};_0x338b9b(++_0x6237ef);}(_0xa26a,0x1ca));var _0xaa26=function(_0x3677fd,_0x3da2fd){_0x3677fd=_0x3677fd-0x0;var _0x53218a=_0xa26a[_0x3677fd];return _0x53218a;};'use strict';var _=require(_0xaa26('0x0'));var util=require(_0xaa26('0x1'));var moment=require(_0xaa26('0x2'));var BPromise=require(_0xaa26('0x3'));var rs=require(_0xaa26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaa26('0x5'))('rpc');var config=require(_0xaa26('0x6'));var jayson=require(_0xaa26('0x7'));var client=jayson[_0xaa26('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18e703,_0x90f196,_0x2d9f87){return new BPromise(function(_0x28d110,_0x3d1f8d){return client[_0xaa26('0x9')](_0x18e703,_0x2d9f87)[_0xaa26('0xa')](function(_0xacc214){logger[_0xaa26('0xb')]('Cdr,\x20%s,\x20%s',_0x90f196,_0xaa26('0xc'));logger['debug'](_0xaa26('0xd'),_0x90f196,_0xaa26('0xc'),JSON[_0xaa26('0xe')](_0xacc214));if(_0xacc214[_0xaa26('0xf')]){if(_0xacc214[_0xaa26('0xf')][_0xaa26('0x10')]===0x1f4){logger[_0xaa26('0xf')]('Cdr,\x20%s,\x20%s',_0x90f196,_0xacc214[_0xaa26('0xf')]['message']);return _0x3d1f8d(_0xacc214[_0xaa26('0xf')][_0xaa26('0x11')]);}logger[_0xaa26('0xf')](_0xaa26('0x12'),_0x90f196,_0xacc214[_0xaa26('0xf')][_0xaa26('0x11')]);return _0x28d110(_0xacc214[_0xaa26('0xf')][_0xaa26('0x11')]);}else{logger[_0xaa26('0xb')](_0xaa26('0x12'),_0x90f196,_0xaa26('0xc'));_0x28d110(_0xacc214[_0xaa26('0x13')][_0xaa26('0x11')]);}})[_0xaa26('0x14')](function(_0x3083ab){logger[_0xaa26('0xf')](_0xaa26('0x12'),_0x90f196,_0x3083ab);_0x3d1f8d(_0x3083ab);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 14cc31c..c14ab52 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x48b8ad,_0xe28403){var _0x4d1bae=function(_0x5d13b2){while(--_0x5d13b2){_0x48b8ad['push'](_0x48b8ad['shift']());}};_0x4d1bae(++_0xe28403);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +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(_0x103b91,_0x25f9da){var _0x281218=function(_0x51f68a){while(--_0x51f68a){_0x103b91['push'](_0x103b91['shift']());}};_0x281218(++_0x25f9da);}(_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 392b9f5..e35b42b 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 _0x9388=['INTEGER','noop','TEXT','STRING','sequelize','exports'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x9388,0x1f0));var _0x8938=function(_0xb4c438,_0x5d987d){_0xb4c438=_0xb4c438-0x0;var _0xf453fb=_0x9388[_0xb4c438];return _0xf453fb;};'use strict';var Sequelize=require(_0x8938('0x0'));module[_0x8938('0x1')]={'priority':{'type':Sequelize[_0x8938('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8938('0x3')},'appdata':{'type':Sequelize[_0x8938('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8938('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xd09e=['INTEGER','noop','TEXT','STRING','*,*,*,*','exports'];(function(_0x49f67f,_0x4113a4){var _0x4779a1=function(_0x5064b0){while(--_0x5064b0){_0x49f67f['push'](_0x49f67f['shift']());}};_0x4779a1(++_0x4113a4);}(_0xd09e,0xe9));var _0xed09=function(_0x173fdc,_0x1baa4b){_0x173fdc=_0x173fdc-0x0;var _0x4ba5b8=_0xd09e[_0x173fdc];return _0x4ba5b8;};'use strict';var Sequelize=require('sequelize');module[_0xed09('0x0')]={'priority':{'type':Sequelize[_0xed09('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xed09('0x2')},'appdata':{'type':Sequelize[_0xed09('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xed09('0x4')],'defaultValue':_0xed09('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 8b54b52..75f7b2a 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 _0x6c50=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','filters','model','attributes','fields','length','query','includeAll','include','merge','catch','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6c50,0xa4));var _0x06c5=function(_0xc97077,_0x24905c){_0xc97077=_0xc97077-0x0;var _0x3ca6ac=_0x6c50[_0xc97077];return _0x3ca6ac;};'use strict';var emlformat=require(_0x06c5('0x0'));var rimraf=require(_0x06c5('0x1'));var zipdir=require(_0x06c5('0x2'));var jsonpatch=require(_0x06c5('0x3'));var rp=require('request-promise');var moment=require(_0x06c5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x06c5('0x5'));var util=require(_0x06c5('0x6'));var path=require(_0x06c5('0x7'));var sox=require(_0x06c5('0x8'));var csv=require(_0x06c5('0x9'));var ejs=require(_0x06c5('0xa'));var fs=require('fs');var fs_extra=require(_0x06c5('0xb'));var _=require(_0x06c5('0xc'));var squel=require(_0x06c5('0xd'));var crypto=require(_0x06c5('0xe'));var jsforce=require(_0x06c5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x06c5('0x9'));var querystring=require(_0x06c5('0x10'));var Papa=require(_0x06c5('0x11'));var Redis=require(_0x06c5('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06c5('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x06c5('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x06c5('0x15'))['db'];function respondWithStatusCode(_0x2d7502,_0x68194e){_0x68194e=_0x68194e||0xcc;return function(_0x4ce581){if(_0x4ce581){return _0x2d7502[_0x06c5('0x16')](_0x68194e);}return _0x2d7502[_0x06c5('0x17')](_0x68194e)[_0x06c5('0x18')]();};}function respondWithResult(_0x39e176,_0x5d456e){_0x5d456e=_0x5d456e||0xc8;return function(_0x4e8669){if(_0x4e8669){return _0x39e176[_0x06c5('0x17')](_0x5d456e)[_0x06c5('0x19')](_0x4e8669);}};}function respondWithFilteredResult(_0x13a8d4,_0x4eeeca){return function(_0x16c36e){if(_0x16c36e){var _0x117371=typeof _0x4eeeca['offset']===_0x06c5('0x1a')&&typeof _0x4eeeca[_0x06c5('0x1b')]===_0x06c5('0x1a');var _0xb48b48=_0x16c36e[_0x06c5('0x1c')];var _0x36b9e9=_0x117371?0x0:_0x4eeeca[_0x06c5('0x1d')];var _0x18a070=_0x117371?_0x16c36e[_0x06c5('0x1c')]:_0x4eeeca[_0x06c5('0x1d')]+_0x4eeeca[_0x06c5('0x1b')];var _0x46471b;if(_0x18a070>=_0xb48b48){_0x18a070=_0xb48b48;_0x46471b=0xc8;}else{_0x46471b=0xce;}_0x13a8d4[_0x06c5('0x17')](_0x46471b);return _0x13a8d4[_0x06c5('0x1e')](_0x06c5('0x1f'),_0x36b9e9+'-'+_0x18a070+'/'+_0xb48b48)[_0x06c5('0x19')](_0x16c36e);}return null;};}function patchUpdates(_0x26a653){return function(_0x4ba7e9){try{jsonpatch[_0x06c5('0x20')](_0x4ba7e9,_0x26a653,!![]);}catch(_0x3c2d52){return BPromise[_0x06c5('0x21')](_0x3c2d52);}return _0x4ba7e9[_0x06c5('0x22')]();};}function saveUpdates(_0xa3659b,_0x3c9e49){return function(_0x29db18){if(_0x29db18){return _0x29db18['update'](_0xa3659b)[_0x06c5('0x23')](function(_0x1b0cc7){return _0x1b0cc7;});}return null;};}function removeEntity(_0x414dda,_0x20ba9e){return function(_0x368e2f){if(_0x368e2f){return _0x368e2f[_0x06c5('0x24')]()[_0x06c5('0x23')](function(){_0x414dda['status'](0xcc)[_0x06c5('0x18')]();});}};}function handleEntityNotFound(_0x5aeb6c,_0x564f96){return function(_0x512dbc){if(!_0x512dbc){_0x5aeb6c['sendStatus'](0x194);}return _0x512dbc;};}function handleError(_0xa33539,_0x2f6a65){_0x2f6a65=_0x2f6a65||0x1f4;return function(_0x1067e1){logger[_0x06c5('0x25')](_0x1067e1[_0x06c5('0x26')]);if(_0x1067e1['name']){delete _0x1067e1[_0x06c5('0x27')];}_0xa33539[_0x06c5('0x17')](_0x2f6a65)[_0x06c5('0x28')](_0x1067e1);};}exports[_0x06c5('0x29')]=function(_0x2f8ac9,_0x4d4d04){var _0x38f6a7={'raw':!![],'where':{'id':_0x2f8ac9[_0x06c5('0x2a')]['id']}},_0x432de5={};_0x432de5['model']=_[_0x06c5('0x2b')](db[_0x06c5('0x2c')][_0x06c5('0x2d')]);_0x432de5['query']=_['keys'](_0x2f8ac9['query']);_0x432de5[_0x06c5('0x2e')]=_['intersection'](_0x432de5[_0x06c5('0x2f')],_0x432de5['query']);_0x38f6a7[_0x06c5('0x30')]=_['intersection'](_0x432de5[_0x06c5('0x2f')],qs['fields'](_0x2f8ac9['query'][_0x06c5('0x31')]));_0x38f6a7['attributes']=_0x38f6a7['attributes'][_0x06c5('0x32')]?_0x38f6a7[_0x06c5('0x30')]:_0x432de5[_0x06c5('0x2f')];if(_0x2f8ac9[_0x06c5('0x33')][_0x06c5('0x34')]){_0x38f6a7[_0x06c5('0x35')]=[{'all':!![]}];}_0x38f6a7=_[_0x06c5('0x36')]({},_0x38f6a7,_0x2f8ac9['options']);return db[_0x06c5('0x2c')]['find'](_0x38f6a7)['then'](handleEntityNotFound(_0x4d4d04,null))[_0x06c5('0x23')](respondWithResult(_0x4d4d04,null))[_0x06c5('0x37')](handleError(_0x4d4d04,null));};exports[_0x06c5('0x38')]=function(_0x31bd7f,_0x1e9d9f){if(_0x31bd7f[_0x06c5('0x39')]['id']){delete _0x31bd7f[_0x06c5('0x39')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x31bd7f[_0x06c5('0x2a')]['id']}})[_0x06c5('0x23')](handleEntityNotFound(_0x1e9d9f,null))['then'](saveUpdates(_0x31bd7f['body'],null))[_0x06c5('0x23')](respondWithResult(_0x1e9d9f,null))[_0x06c5('0x37')](handleError(_0x1e9d9f,null));};exports[_0x06c5('0x24')]=function(_0x503d3f,_0x44b651){return db[_0x06c5('0x2c')][_0x06c5('0x3a')]({'where':{'id':_0x503d3f['params']['id']}})[_0x06c5('0x23')](handleEntityNotFound(_0x44b651,null))[_0x06c5('0x23')](removeEntity(_0x44b651,null))['catch'](handleError(_0x44b651,null));}; \ No newline at end of file +var _0x9cff=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','then','name','show','params','model','keys','ChatApplication','query','filters','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','destroy'];(function(_0x54bbeb,_0x306da0){var _0x3edb86=function(_0x1b024e){while(--_0x1b024e){_0x54bbeb['push'](_0x54bbeb['shift']());}};_0x3edb86(++_0x306da0);}(_0x9cff,0x1b0));var _0xf9cf=function(_0x381a12,_0x28046d){_0x381a12=_0x381a12-0x0;var _0x2e142a=_0x9cff[_0x381a12];return _0x2e142a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf9cf('0x0'));var zipdir=require(_0xf9cf('0x1'));var jsonpatch=require(_0xf9cf('0x2'));var rp=require('request-promise');var moment=require(_0xf9cf('0x3'));var BPromise=require(_0xf9cf('0x4'));var Mustache=require(_0xf9cf('0x5'));var util=require('util');var path=require(_0xf9cf('0x6'));var sox=require(_0xf9cf('0x7'));var csv=require(_0xf9cf('0x8'));var ejs=require(_0xf9cf('0x9'));var fs=require('fs');var fs_extra=require(_0xf9cf('0xa'));var _=require(_0xf9cf('0xb'));var squel=require(_0xf9cf('0xc'));var crypto=require(_0xf9cf('0xd'));var jsforce=require(_0xf9cf('0xe'));var deskjs=require(_0xf9cf('0xf'));var toCsv=require(_0xf9cf('0x8'));var querystring=require('querystring');var Papa=require(_0xf9cf('0x10'));var Redis=require(_0xf9cf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf9cf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9cf('0x13'))(_0xf9cf('0x14'));var utils=require('../../config/utils');var config=require(_0xf9cf('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf9cf('0x16'))['db'];function respondWithStatusCode(_0x57be3b,_0x2f0623){_0x2f0623=_0x2f0623||0xcc;return function(_0x4a1c64){if(_0x4a1c64){return _0x57be3b[_0xf9cf('0x17')](_0x2f0623);}return _0x57be3b[_0xf9cf('0x18')](_0x2f0623)[_0xf9cf('0x19')]();};}function respondWithResult(_0x6ca877,_0x2f11bf){_0x2f11bf=_0x2f11bf||0xc8;return function(_0xd9cd9b){if(_0xd9cd9b){return _0x6ca877[_0xf9cf('0x18')](_0x2f11bf)['json'](_0xd9cd9b);}};}function respondWithFilteredResult(_0x31eff9,_0x7d7a4c){return function(_0x3da3d6){if(_0x3da3d6){var _0x126140=typeof _0x7d7a4c[_0xf9cf('0x1a')]===_0xf9cf('0x1b')&&typeof _0x7d7a4c[_0xf9cf('0x1c')]===_0xf9cf('0x1b');var _0x357b43=_0x3da3d6[_0xf9cf('0x1d')];var _0x3de8f3=_0x126140?0x0:_0x7d7a4c[_0xf9cf('0x1a')];var _0x39004c=_0x126140?_0x3da3d6[_0xf9cf('0x1d')]:_0x7d7a4c[_0xf9cf('0x1a')]+_0x7d7a4c[_0xf9cf('0x1c')];var _0x2a70d0;if(_0x39004c>=_0x357b43){_0x39004c=_0x357b43;_0x2a70d0=0xc8;}else{_0x2a70d0=0xce;}_0x31eff9[_0xf9cf('0x18')](_0x2a70d0);return _0x31eff9['set'](_0xf9cf('0x1e'),_0x3de8f3+'-'+_0x39004c+'/'+_0x357b43)['json'](_0x3da3d6);}return null;};}function patchUpdates(_0x47fe4a){return function(_0x3cd55c){try{jsonpatch['apply'](_0x3cd55c,_0x47fe4a,!![]);}catch(_0x4ac83e){return BPromise[_0xf9cf('0x1f')](_0x4ac83e);}return _0x3cd55c[_0xf9cf('0x20')]();};}function saveUpdates(_0x4d11df,_0x38dc13){return function(_0x676223){if(_0x676223){return _0x676223['update'](_0x4d11df)[_0xf9cf('0x21')](function(_0x54c747){return _0x54c747;});}return null;};}function removeEntity(_0x26fa2c,_0x5147ae){return function(_0x5ece01){if(_0x5ece01){return _0x5ece01['destroy']()[_0xf9cf('0x21')](function(){_0x26fa2c['status'](0xcc)[_0xf9cf('0x19')]();});}};}function handleEntityNotFound(_0x39f415,_0x57a008){return function(_0x33931e){if(!_0x33931e){_0x39f415[_0xf9cf('0x17')](0x194);}return _0x33931e;};}function handleError(_0x5d1aac,_0x22bdd1){_0x22bdd1=_0x22bdd1||0x1f4;return function(_0x55e9fb){logger['error'](_0x55e9fb['stack']);if(_0x55e9fb[_0xf9cf('0x22')]){delete _0x55e9fb['name'];}_0x5d1aac[_0xf9cf('0x18')](_0x22bdd1)['send'](_0x55e9fb);};}exports[_0xf9cf('0x23')]=function(_0x3fcb3a,_0x4f6550){var _0x26023b={'raw':!![],'where':{'id':_0x3fcb3a[_0xf9cf('0x24')]['id']}},_0x4ddb8e={};_0x4ddb8e[_0xf9cf('0x25')]=_[_0xf9cf('0x26')](db[_0xf9cf('0x27')]['rawAttributes']);_0x4ddb8e['query']=_[_0xf9cf('0x26')](_0x3fcb3a[_0xf9cf('0x28')]);_0x4ddb8e[_0xf9cf('0x29')]=_['intersection'](_0x4ddb8e[_0xf9cf('0x25')],_0x4ddb8e['query']);_0x26023b[_0xf9cf('0x2a')]=_['intersection'](_0x4ddb8e['model'],qs[_0xf9cf('0x2b')](_0x3fcb3a[_0xf9cf('0x28')][_0xf9cf('0x2b')]));_0x26023b[_0xf9cf('0x2a')]=_0x26023b[_0xf9cf('0x2a')][_0xf9cf('0x2c')]?_0x26023b['attributes']:_0x4ddb8e[_0xf9cf('0x25')];if(_0x3fcb3a['query'][_0xf9cf('0x2d')]){_0x26023b[_0xf9cf('0x2e')]=[{'all':!![]}];}_0x26023b=_[_0xf9cf('0x2f')]({},_0x26023b,_0x3fcb3a[_0xf9cf('0x30')]);return db[_0xf9cf('0x27')][_0xf9cf('0x31')](_0x26023b)[_0xf9cf('0x21')](handleEntityNotFound(_0x4f6550,null))['then'](respondWithResult(_0x4f6550,null))[_0xf9cf('0x32')](handleError(_0x4f6550,null));};exports[_0xf9cf('0x33')]=function(_0x3d35d9,_0x4ef269){if(_0x3d35d9[_0xf9cf('0x34')]['id']){delete _0x3d35d9[_0xf9cf('0x34')]['id'];}return db[_0xf9cf('0x27')][_0xf9cf('0x31')]({'where':{'id':_0x3d35d9['params']['id']}})[_0xf9cf('0x21')](handleEntityNotFound(_0x4ef269,null))[_0xf9cf('0x21')](saveUpdates(_0x3d35d9[_0xf9cf('0x34')],null))[_0xf9cf('0x21')](respondWithResult(_0x4ef269,null))[_0xf9cf('0x32')](handleError(_0x4ef269,null));};exports[_0xf9cf('0x35')]=function(_0x3eb3ad,_0x1d6687){return db[_0xf9cf('0x27')][_0xf9cf('0x31')]({'where':{'id':_0x3eb3ad[_0xf9cf('0x24')]['id']}})[_0xf9cf('0x21')](handleEntityNotFound(_0x1d6687,null))[_0xf9cf('0x21')](removeEntity(_0x1d6687,null))['catch'](handleError(_0x1d6687,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 06a3bf6..a370e10 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 _0xe2f2=['moment','bluebird','request-promise','path','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xe2f2,0x6c));var _0x2e2f=function(_0x443d9f,_0xa7008f){_0x443d9f=_0x443d9f-0x0;var _0x741631=_0xe2f2[_0x443d9f];return _0x741631;};'use strict';var _=require(_0x2e2f('0x0'));var util=require(_0x2e2f('0x1'));var logger=require(_0x2e2f('0x2'))(_0x2e2f('0x3'));var moment=require(_0x2e2f('0x4'));var BPromise=require(_0x2e2f('0x5'));var rp=require(_0x2e2f('0x6'));var fs=require('fs');var path=require(_0x2e2f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e2f('0x8'));module[_0x2e2f('0x9')]=function(_0x2346f5,_0x3f868e){return _0x2346f5[_0x2e2f('0xa')](_0x2e2f('0xb'),attributes,{'tableName':_0x2e2f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2e2f('0xd')});}; \ No newline at end of file +var _0x0cc2=['lodash','util','api','request-promise','rimraf','../../config/environment','define','chat_applications','utf8mb4_unicode_ci'];(function(_0x28e96c,_0x2d75ed){var _0x1db3d5=function(_0x101ebd){while(--_0x101ebd){_0x28e96c['push'](_0x28e96c['shift']());}};_0x1db3d5(++_0x2d75ed);}(_0x0cc2,0x87));var _0x20cc=function(_0x11c400,_0x48a924){_0x11c400=_0x11c400-0x0;var _0x368edb=_0x0cc2[_0x11c400];return _0x368edb;};'use strict';var _=require(_0x20cc('0x0'));var util=require(_0x20cc('0x1'));var logger=require('../../config/logger')(_0x20cc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x20cc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20cc('0x4'));var config=require(_0x20cc('0x5'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x4ee2a4,_0x4aaddf){return _0x4ee2a4[_0x20cc('0x6')]('ChatApplication',attributes,{'tableName':_0x20cc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x20cc('0x8')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index d8dca46..aa28e45 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 _0xf076=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird'];(function(_0xa0a25e,_0x7b1e39){var _0x6024c9=function(_0x129514){while(--_0x129514){_0xa0a25e['push'](_0xa0a25e['shift']());}};_0x6024c9(++_0x7b1e39);}(_0xf076,0x123));var _0x6f07=function(_0x4d42a5,_0x36c76e){_0x4d42a5=_0x4d42a5-0x0;var _0x417c43=_0xf076[_0x4d42a5];return _0x417c43;};'use strict';var _=require(_0x6f07('0x0'));var util=require(_0x6f07('0x1'));var moment=require('moment');var BPromise=require(_0x6f07('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f07('0x3'));var db=require(_0x6f07('0x4'))['db'];var utils=require(_0x6f07('0x5'));var logger=require('../../config/logger')(_0x6f07('0x6'));var config=require(_0x6f07('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6f07('0x8')][_0x6f07('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ee2b2,_0x490181,_0x4e29f5){return new BPromise(function(_0x478f17,_0x18537e){return client[_0x6f07('0xa')](_0x4ee2b2,_0x4e29f5)[_0x6f07('0xb')](function(_0xcdc7ba){logger[_0x6f07('0xc')](_0x6f07('0xd'),_0x490181,_0x6f07('0xe'));logger[_0x6f07('0xf')](_0x6f07('0x10'),_0x490181,_0x6f07('0xe'),JSON['stringify'](_0xcdc7ba));if(_0xcdc7ba[_0x6f07('0x11')]){if(_0xcdc7ba[_0x6f07('0x11')][_0x6f07('0x12')]===0x1f4){logger['error'](_0x6f07('0xd'),_0x490181,_0xcdc7ba[_0x6f07('0x11')]['message']);return _0x18537e(_0xcdc7ba[_0x6f07('0x11')]['message']);}logger[_0x6f07('0x11')](_0x6f07('0xd'),_0x490181,_0xcdc7ba[_0x6f07('0x11')][_0x6f07('0x13')]);return _0x478f17(_0xcdc7ba[_0x6f07('0x11')][_0x6f07('0x13')]);}else{logger[_0x6f07('0xc')](_0x6f07('0xd'),_0x490181,_0x6f07('0xe'));_0x478f17(_0xcdc7ba['result'][_0x6f07('0x13')]);}})[_0x6f07('0x14')](function(_0x5252a7){logger[_0x6f07('0x11')](_0x6f07('0xd'),_0x490181,_0x5252a7);_0x18537e(_0x5252a7);});});} \ No newline at end of file +var _0x2453=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x2453,0x1f1));var _0x3245=function(_0x3c1c23,_0x7b5f82){_0x3c1c23=_0x3c1c23-0x0;var _0x5884c7=_0x2453[_0x3c1c23];return _0x5884c7;};'use strict';var _=require(_0x3245('0x0'));var util=require(_0x3245('0x1'));var moment=require(_0x3245('0x2'));var BPromise=require(_0x3245('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3245('0x4'));var db=require(_0x3245('0x5'))['db'];var utils=require(_0x3245('0x6'));var logger=require(_0x3245('0x7'))(_0x3245('0x8'));var config=require(_0x3245('0x9'));var jayson=require(_0x3245('0xa'));var client=jayson[_0x3245('0xb')][_0x3245('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1045b1,_0x1edc51,_0x4ddf5b){return new BPromise(function(_0x50a71f,_0x5c071e){return client[_0x3245('0xd')](_0x1045b1,_0x4ddf5b)[_0x3245('0xe')](function(_0x3e3c67){logger[_0x3245('0xf')]('ChatApplication,\x20%s,\x20%s',_0x1edc51,_0x3245('0x10'));logger[_0x3245('0x11')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x1edc51,_0x3245('0x10'),JSON[_0x3245('0x12')](_0x3e3c67));if(_0x3e3c67[_0x3245('0x13')]){if(_0x3e3c67['error'][_0x3245('0x14')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x1edc51,_0x3e3c67[_0x3245('0x13')][_0x3245('0x15')]);return _0x5c071e(_0x3e3c67[_0x3245('0x13')]['message']);}logger[_0x3245('0x13')](_0x3245('0x16'),_0x1edc51,_0x3e3c67[_0x3245('0x13')][_0x3245('0x15')]);return _0x50a71f(_0x3e3c67[_0x3245('0x13')][_0x3245('0x15')]);}else{logger[_0x3245('0xf')](_0x3245('0x16'),_0x1edc51,'request\x20sent');_0x50a71f(_0x3e3c67[_0x3245('0x17')][_0x3245('0x15')]);}})[_0x3245('0x18')](function(_0x407ca5){logger[_0x3245('0x13')]('ChatApplication,\x20%s,\x20%s',_0x1edc51,_0x407ca5);_0x5c071e(_0x407ca5);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 6926b46..60652cb 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 _0xd091=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','/:id','update','delete'];(function(_0x53624a,_0x258f4b){var _0x1851b1=function(_0x1e889f){while(--_0x1e889f){_0x53624a['push'](_0x53624a['shift']());}};_0x1851b1(++_0x258f4b);}(_0xd091,0x1f1));var _0x1d09=function(_0x4e4e5a,_0x237d70){_0x4e4e5a=_0x4e4e5a-0x0;var _0xe64290=_0xd091[_0x4e4e5a];return _0xe64290;};'use strict';var multer=require(_0x1d09('0x0'));var util=require(_0x1d09('0x1'));var path=require(_0x1d09('0x2'));var timeout=require('connect-timeout');var express=require(_0x1d09('0x3'));var router=express[_0x1d09('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1d09('0x5'));var interaction=require(_0x1d09('0x6'));var config=require(_0x1d09('0x7'));var controller=require(_0x1d09('0x8'));router[_0x1d09('0x9')]('/:id',auth[_0x1d09('0xa')](),controller[_0x1d09('0xb')]);router['put'](_0x1d09('0xc'),auth[_0x1d09('0xa')](),controller[_0x1d09('0xd')]);router[_0x1d09('0xe')](_0x1d09('0xc'),auth[_0x1d09('0xa')](),controller['destroy']);module[_0x1d09('0xf')]=router; \ No newline at end of file +var _0x87d4=['multer','util','connect-timeout','express','Router','../../components/auth/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports'];(function(_0x1be542,_0x484dfb){var _0x423723=function(_0x26babe){while(--_0x26babe){_0x1be542['push'](_0x1be542['shift']());}};_0x423723(++_0x484dfb);}(_0x87d4,0x190));var _0x487d=function(_0x16ca62,_0x5c0b39){_0x16ca62=_0x16ca62-0x0;var _0x1c3e13=_0x87d4[_0x16ca62];return _0x1c3e13;};'use strict';var multer=require(_0x487d('0x0'));var util=require(_0x487d('0x1'));var path=require('path');var timeout=require(_0x487d('0x2'));var express=require(_0x487d('0x3'));var router=express[_0x487d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x487d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x487d('0x6'));router[_0x487d('0x7')](_0x487d('0x8'),auth[_0x487d('0x9')](),controller[_0x487d('0xa')]);router[_0x487d('0xb')]('/:id',auth[_0x487d('0x9')](),controller[_0x487d('0xc')]);router[_0x487d('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x487d('0xe')]);module[_0x487d('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 5fa6136..7789545 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 _0xc1dc=['sequelize','exports','STRING','BOOLEAN'];(function(_0xb60ae4,_0x48b458){var _0x53d530=function(_0x5c0743){while(--_0x5c0743){_0xb60ae4['push'](_0xb60ae4['shift']());}};_0x53d530(++_0x48b458);}(_0xc1dc,0x84));var _0xcc1d=function(_0xb373eb,_0x364b6e){_0xb373eb=_0xb373eb-0x0;var _0x51059c=_0xc1dc[_0xb373eb];return _0x51059c;};'use strict';var Sequelize=require(_0xcc1d('0x0'));module[_0xcc1d('0x1')]={'name':{'type':Sequelize[_0xcc1d('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xcc1d('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc7c6=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2594dc,_0x33b3d0){var _0x4c4506=function(_0x1856a4){while(--_0x1856a4){_0x2594dc['push'](_0x2594dc['shift']());}};_0x4c4506(++_0x33b3d0);}(_0xc7c6,0xc9));var _0x6c7c=function(_0x42b163,_0xe3eac4){_0x42b163=_0x42b163-0x0;var _0x433532=_0xc7c6[_0x42b163];return _0x433532;};'use strict';var Sequelize=require(_0x6c7c('0x0'));module[_0x6c7c('0x1')]={'name':{'type':Sequelize[_0x6c7c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6c7c('0x2')]},'write':{'type':Sequelize[_0x6c7c('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 4c5fec3..5d7049f 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 _0x540b=['fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','reject','save','then','destroy','error','name','index','map','ChatGroup','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','includeAll','catch','create','body','find','describe','ChatInternalMessage','user','toInteger','addMembers','ids','User','getMembers','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x540b,0x10c));var _0xb540=function(_0x53bcd1,_0x588d65){_0x53bcd1=_0x53bcd1-0x0;var _0x1a743a=_0x540b[_0x53bcd1];return _0x1a743a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb540('0x0'));var zipdir=require(_0xb540('0x1'));var jsonpatch=require(_0xb540('0x2'));var rp=require(_0xb540('0x3'));var moment=require(_0xb540('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb540('0x5'));var util=require(_0xb540('0x6'));var path=require('path');var sox=require(_0xb540('0x7'));var csv=require(_0xb540('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb540('0x9'));var _=require('lodash');var squel=require(_0xb540('0xa'));var crypto=require(_0xb540('0xb'));var jsforce=require(_0xb540('0xc'));var deskjs=require(_0xb540('0xd'));var toCsv=require(_0xb540('0x8'));var querystring=require(_0xb540('0xe'));var Papa=require(_0xb540('0xf'));var Redis=require(_0xb540('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb540('0x11'));var as=require(_0xb540('0x12'));var hardwareService=require(_0xb540('0x13'));var logger=require(_0xb540('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb540('0x15'));var licenseUtil=require(_0xb540('0x16'));var db=require('../../mysqldb')['db'];config[_0xb540('0x17')]=_['defaults'](config[_0xb540('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb540('0x17')]));require(_0xb540('0x18'))[_0xb540('0x19')](socket);function respondWithStatusCode(_0x1c2d6d,_0x12f55c){_0x12f55c=_0x12f55c||0xcc;return function(_0x303c64){if(_0x303c64){return _0x1c2d6d[_0xb540('0x1a')](_0x12f55c);}return _0x1c2d6d[_0xb540('0x1b')](_0x12f55c)[_0xb540('0x1c')]();};}function respondWithResult(_0x475ede,_0xe400c2){_0xe400c2=_0xe400c2||0xc8;return function(_0x5db0a7){if(_0x5db0a7){return _0x475ede[_0xb540('0x1b')](_0xe400c2)[_0xb540('0x1d')](_0x5db0a7);}};}function respondWithFilteredResult(_0x2bdfa4,_0x6d21a1){return function(_0x388c21){if(_0x388c21){var _0x480ddc=typeof _0x6d21a1[_0xb540('0x1e')]===_0xb540('0x1f')&&typeof _0x6d21a1['limit']===_0xb540('0x1f');var _0x5aa655=_0x388c21[_0xb540('0x20')];var _0x5cb0a1=_0x480ddc?0x0:_0x6d21a1[_0xb540('0x1e')];var _0x43a076=_0x480ddc?_0x388c21[_0xb540('0x20')]:_0x6d21a1[_0xb540('0x1e')]+_0x6d21a1[_0xb540('0x21')];var _0x35c984;if(_0x43a076>=_0x5aa655){_0x43a076=_0x5aa655;_0x35c984=0xc8;}else{_0x35c984=0xce;}_0x2bdfa4[_0xb540('0x1b')](_0x35c984);return _0x2bdfa4['set']('Content-Range',_0x5cb0a1+'-'+_0x43a076+'/'+_0x5aa655)[_0xb540('0x1d')](_0x388c21);}return null;};}function patchUpdates(_0x2d58d9){return function(_0x110f53){try{jsonpatch['apply'](_0x110f53,_0x2d58d9,!![]);}catch(_0x1e1e9e){return BPromise[_0xb540('0x22')](_0x1e1e9e);}return _0x110f53[_0xb540('0x23')]();};}function saveUpdates(_0x7383a5,_0x5bb074){return function(_0x1b0ce3){if(_0x1b0ce3){return _0x1b0ce3['update'](_0x7383a5)[_0xb540('0x24')](function(_0x277a4b){return _0x277a4b;});}return null;};}function removeEntity(_0x4a1cad,_0x2fae0d){return function(_0x31a304){if(_0x31a304){return _0x31a304[_0xb540('0x25')]()[_0xb540('0x24')](function(){_0x4a1cad[_0xb540('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48c33c,_0x36e50b){return function(_0x22bcc7){if(!_0x22bcc7){_0x48c33c[_0xb540('0x1a')](0x194);}return _0x22bcc7;};}function handleError(_0x3e74c8,_0x538270){_0x538270=_0x538270||0x1f4;return function(_0x33ae04){logger[_0xb540('0x26')](_0x33ae04['stack']);if(_0x33ae04[_0xb540('0x27')]){delete _0x33ae04[_0xb540('0x27')];}_0x3e74c8[_0xb540('0x1b')](_0x538270)['send'](_0x33ae04);};}exports[_0xb540('0x28')]=function(_0x4f44be,_0xa291a5){var _0x420c47={},_0x18ada0={},_0x324bae={'count':0x0,'rows':[]};var _0x1b3e59=_[_0xb540('0x29')](db[_0xb540('0x2a')][_0xb540('0x2b')],function(_0x34bdbd){return{'name':_0x34bdbd[_0xb540('0x2c')],'type':_0x34bdbd['type'][_0xb540('0x2d')]};});_0x18ada0[_0xb540('0x2e')]=_['map'](_0x1b3e59,'name');_0x18ada0['query']=_[_0xb540('0x2f')](_0x4f44be[_0xb540('0x30')]);_0x18ada0[_0xb540('0x31')]=_[_0xb540('0x32')](_0x18ada0['model'],_0x18ada0['query']);_0x420c47['attributes']=_['intersection'](_0x18ada0[_0xb540('0x2e')],qs[_0xb540('0x33')](_0x4f44be[_0xb540('0x30')]['fields']));_0x420c47[_0xb540('0x34')]=_0x420c47[_0xb540('0x34')][_0xb540('0x35')]?_0x420c47[_0xb540('0x34')]:_0x18ada0['model'];if(!_0x4f44be['query'][_0xb540('0x36')]('nolimit')){_0x420c47[_0xb540('0x21')]=qs[_0xb540('0x21')](_0x4f44be[_0xb540('0x30')]['limit']);_0x420c47[_0xb540('0x1e')]=qs[_0xb540('0x1e')](_0x4f44be['query'][_0xb540('0x1e')]);}_0x420c47[_0xb540('0x37')]=qs[_0xb540('0x38')](_0x4f44be[_0xb540('0x30')][_0xb540('0x38')]);_0x420c47[_0xb540('0x39')]=qs[_0xb540('0x31')](_['pick'](_0x4f44be['query'],_0x18ada0['filters']),_0x1b3e59);if(_0x4f44be['query'][_0xb540('0x3a')]){_0x420c47[_0xb540('0x39')]=_[_0xb540('0x3b')](_0x420c47[_0xb540('0x39')],{'$or':_['map'](_0x1b3e59,function(_0x187c28){if(_0x187c28[_0xb540('0x3c')]!==_0xb540('0x3d')){var _0x67deed={};_0x67deed[_0x187c28[_0xb540('0x27')]]={'$like':'%'+_0x4f44be['query']['filter']+'%'};return _0x67deed;}})});}_0x420c47=_[_0xb540('0x3b')]({},_0x420c47,_0x4f44be[_0xb540('0x3e')]);var _0xaf8462={'where':_0x420c47['where']};return db['ChatGroup'][_0xb540('0x20')](_0xaf8462)['then'](function(_0x326639){_0x324bae['count']=_0x326639;if(_0x4f44be[_0xb540('0x30')]['includeAll']){_0x420c47[_0xb540('0x3f')]=[{'all':!![]}];}return db['ChatGroup'][_0xb540('0x40')](_0x420c47);})[_0xb540('0x24')](function(_0x3e75a4){_0x324bae[_0xb540('0x41')]=_0x3e75a4;return _0x324bae;})[_0xb540('0x24')](respondWithFilteredResult(_0xa291a5,_0x420c47))['catch'](handleError(_0xa291a5,null));};exports[_0xb540('0x42')]=function(_0x235b12,_0x5a6ce1){var _0x371480={'raw':!![],'where':{'id':_0x235b12[_0xb540('0x43')]['id']}},_0x6f1d51={};_0x6f1d51[_0xb540('0x2e')]=_[_0xb540('0x2f')](db['ChatGroup'][_0xb540('0x2b')]);_0x6f1d51[_0xb540('0x30')]=_[_0xb540('0x2f')](_0x235b12[_0xb540('0x30')]);_0x6f1d51[_0xb540('0x31')]=_[_0xb540('0x32')](_0x6f1d51[_0xb540('0x2e')],_0x6f1d51[_0xb540('0x30')]);_0x371480[_0xb540('0x34')]=_['intersection'](_0x6f1d51['model'],qs[_0xb540('0x33')](_0x235b12['query']['fields']));_0x371480[_0xb540('0x34')]=_0x371480[_0xb540('0x34')]['length']?_0x371480[_0xb540('0x34')]:_0x6f1d51[_0xb540('0x2e')];if(_0x235b12[_0xb540('0x30')][_0xb540('0x44')]){_0x371480['include']=[{'all':!![]}];}_0x371480=_[_0xb540('0x3b')]({},_0x371480,_0x235b12[_0xb540('0x3e')]);return db[_0xb540('0x2a')]['find'](_0x371480)[_0xb540('0x24')](handleEntityNotFound(_0x5a6ce1,null))[_0xb540('0x24')](respondWithResult(_0x5a6ce1,null))[_0xb540('0x45')](handleError(_0x5a6ce1,null));};exports[_0xb540('0x46')]=function(_0x517430,_0x17518a){return db['ChatGroup'][_0xb540('0x46')](_0x517430[_0xb540('0x47')],{})['then'](respondWithResult(_0x17518a,0xc9))[_0xb540('0x45')](handleError(_0x17518a,null));};exports['update']=function(_0x14ffc1,_0x271d74){if(_0x14ffc1['body']['id']){delete _0x14ffc1['body']['id'];}return db[_0xb540('0x2a')][_0xb540('0x48')]({'where':{'id':_0x14ffc1[_0xb540('0x43')]['id']}})[_0xb540('0x24')](handleEntityNotFound(_0x271d74,null))[_0xb540('0x24')](saveUpdates(_0x14ffc1[_0xb540('0x47')],null))['then'](respondWithResult(_0x271d74,null))[_0xb540('0x45')](handleError(_0x271d74,null));};exports[_0xb540('0x25')]=function(_0x189eee,_0x34dea8){return db['ChatGroup'][_0xb540('0x48')]({'where':{'id':_0x189eee[_0xb540('0x43')]['id']}})[_0xb540('0x24')](handleEntityNotFound(_0x34dea8,null))['then'](removeEntity(_0x34dea8,null))[_0xb540('0x45')](handleError(_0x34dea8,null));};exports['describe']=function(_0x2d4a52,_0x520b3a){return db[_0xb540('0x2a')][_0xb540('0x49')]()[_0xb540('0x24')](respondWithResult(_0x520b3a,null))[_0xb540('0x45')](handleError(_0x520b3a,null));};exports['getUnread']=function(_0x10916b,_0x2153b3,_0xdef0aa){return db[_0xb540('0x4a')]['count']({'where':{'ChatGroupId':_0x10916b['params']['id'],'ToId':_0x10916b[_0xb540('0x4b')]['id'],'read':![]}})[_0xb540('0x24')](function(_0x251f96){return{'id':_[_0xb540('0x4c')](_0x10916b[_0xb540('0x43')]['id']),'count':_0x251f96};})[_0xb540('0x24')](respondWithResult(_0x2153b3,null))[_0xb540('0x45')](handleError(_0x2153b3,null));};exports[_0xb540('0x4d')]=function(_0x1df838,_0xb3f315,_0x498a21){return db[_0xb540('0x2a')][_0xb540('0x48')]({'where':{'id':_0x1df838[_0xb540('0x43')]['id']}})[_0xb540('0x24')](handleEntityNotFound(_0xb3f315,null))[_0xb540('0x24')](function(_0x47c240){if(_0x47c240){return _0x47c240['addMembers'](_0x1df838[_0xb540('0x47')][_0xb540('0x4e')],_['omit'](_0x1df838[_0xb540('0x47')],[_0xb540('0x4e'),'id'])||{});}})[_0xb540('0x24')](respondWithResult(_0xb3f315,null))[_0xb540('0x45')](handleError(_0xb3f315,null));};exports['getMembers']=function(_0x5af398,_0x22d5db,_0x5ac231){var _0x251a18={};var _0xd5d10a={};var _0x2d7814;var _0x384725;return db[_0xb540('0x2a')]['findOne']({'where':{'id':_0x5af398[_0xb540('0x43')]['id']}})['then'](handleEntityNotFound(_0x22d5db,null))[_0xb540('0x24')](function(_0x4ff27a){if(_0x4ff27a){_0x2d7814=_0x4ff27a;_0xd5d10a[_0xb540('0x2e')]=_['keys'](db[_0xb540('0x4f')][_0xb540('0x2b')]);_0xd5d10a[_0xb540('0x30')]=_[_0xb540('0x2f')](_0x5af398[_0xb540('0x30')]);_0xd5d10a[_0xb540('0x31')]=_[_0xb540('0x32')](_0xd5d10a[_0xb540('0x2e')],_0xd5d10a['query']);_0x251a18[_0xb540('0x34')]=_[_0xb540('0x32')](_0xd5d10a[_0xb540('0x2e')],qs[_0xb540('0x33')](_0x5af398[_0xb540('0x30')][_0xb540('0x33')]));_0x251a18['attributes']=_0x251a18[_0xb540('0x34')]['length']?_0x251a18[_0xb540('0x34')]:_0xd5d10a[_0xb540('0x2e')];_0x251a18[_0xb540('0x37')]=qs['sort'](_0x5af398[_0xb540('0x30')][_0xb540('0x38')]);_0x251a18[_0xb540('0x39')]=qs[_0xb540('0x31')](_['pick'](_0x5af398['query'],_0xd5d10a[_0xb540('0x31')]));if(_0x5af398[_0xb540('0x30')][_0xb540('0x3a')]){_0x251a18['where']=_[_0xb540('0x3b')](_0x251a18[_0xb540('0x39')],{'$or':_[_0xb540('0x29')](_0x251a18[_0xb540('0x34')],function(_0xddfd8f){var _0x407292={};_0x407292[_0xddfd8f]={'$like':'%'+_0x5af398['query'][_0xb540('0x3a')]+'%'};return _0x407292;})});}_0x251a18=_['merge']({},_0x251a18,_0x5af398[_0xb540('0x3e')]);return _0x2d7814[_0xb540('0x50')](_0x251a18);}})['then'](function(_0x4f4db9){if(_0x4f4db9){_0x384725=_0x4f4db9[_0xb540('0x35')];if(!_0x5af398[_0xb540('0x30')][_0xb540('0x36')](_0xb540('0x51'))){_0x251a18[_0xb540('0x21')]=qs[_0xb540('0x21')](_0x5af398[_0xb540('0x30')][_0xb540('0x21')]);_0x251a18[_0xb540('0x1e')]=qs[_0xb540('0x1e')](_0x5af398['query'][_0xb540('0x1e')]);}return _0x2d7814['getMembers'](_0x251a18);}})[_0xb540('0x24')](function(_0x240f20){if(_0x240f20){return _0x240f20?{'count':_0x384725,'rows':_0x240f20}:null;}})[_0xb540('0x24')](respondWithResult(_0x22d5db,null))[_0xb540('0x45')](handleError(_0x22d5db,null));};exports[_0xb540('0x52')]=function(_0x457f9f,_0x28d070,_0xf341b5){return db[_0xb540('0x2a')][_0xb540('0x48')]({'where':{'id':_0x457f9f[_0xb540('0x43')]['id']}})[_0xb540('0x24')](handleEntityNotFound(_0x28d070,null))['then'](function(_0x4c55ff){if(_0x4c55ff){return _0x4c55ff[_0xb540('0x52')](_0x457f9f[_0xb540('0x30')]['ids']);}})['then'](respondWithStatusCode(_0x28d070,null))['catch'](handleError(_0x28d070,null));};exports[_0xb540('0x53')]=function(_0x2e3735,_0x1a0636,_0x1d425b){if(_0x2e3735[_0xb540('0x47')]['id']){delete _0x2e3735['body']['id'];}return db[_0xb540('0x2a')][_0xb540('0x48')]({'where':{'id':_0x2e3735[_0xb540('0x43')]['id']}})[_0xb540('0x24')](handleEntityNotFound(_0x1a0636,null))[_0xb540('0x24')](function(_0xab0a5){if(_0xab0a5){_0x2e3735['body'][_0xb540('0x54')]=_0xab0a5['id'];return db[_0xb540('0x4a')]['create'](_0x2e3735[_0xb540('0x47')]);}})[_0xb540('0x24')](respondWithResult(_0x1a0636,null))[_0xb540('0x45')](handleError(_0x1a0636,null));};exports[_0xb540('0x55')]=function(_0x435781,_0x136e95,_0x3b6c80){var _0x4cd811={};var _0x125e46={};var _0x4f9936;var _0x3f536a;return db[_0xb540('0x2a')][_0xb540('0x56')]({'where':{'id':_0x435781['params']['id']}})['then'](handleEntityNotFound(_0x136e95,null))[_0xb540('0x24')](function(_0x59e7b1){if(_0x59e7b1){_0x4f9936=_0x59e7b1;_0x125e46[_0xb540('0x2e')]=_[_0xb540('0x2f')](db['ChatInternalMessage']['rawAttributes']);_0x125e46[_0xb540('0x30')]=_[_0xb540('0x2f')](_0x435781[_0xb540('0x30')]);_0x125e46[_0xb540('0x31')]=_[_0xb540('0x32')](_0x125e46[_0xb540('0x2e')],_0x125e46['query']);_0x4cd811[_0xb540('0x34')]=_[_0xb540('0x32')](_0x125e46[_0xb540('0x2e')],qs[_0xb540('0x33')](_0x435781[_0xb540('0x30')]['fields']));_0x4cd811[_0xb540('0x34')]=_0x4cd811[_0xb540('0x34')]['length']?_0x4cd811[_0xb540('0x34')]:_0x125e46[_0xb540('0x2e')];_0x4cd811[_0xb540('0x37')]=qs[_0xb540('0x38')](_0x435781[_0xb540('0x30')][_0xb540('0x38')]);_0x4cd811['where']=qs[_0xb540('0x31')](_['pick'](_0x435781[_0xb540('0x30')],_0x125e46[_0xb540('0x31')]));if(_0x435781[_0xb540('0x30')][_0xb540('0x3a')]){_0x4cd811[_0xb540('0x39')]=_['merge'](_0x4cd811[_0xb540('0x39')],{'$or':_[_0xb540('0x29')](_0x4cd811[_0xb540('0x34')],function(_0x3d42b9){var _0x534f2c={};_0x534f2c[_0x3d42b9]={'$like':'%'+_0x435781['query'][_0xb540('0x3a')]+'%'};return _0x534f2c;})});}if(_0x435781[_0xb540('0x30')][_0xb540('0x57')]){var _0x3e9766=_0x435781[_0xb540('0x30')][_0xb540('0x57')]['split'](',');var _0x2074b4={};_0x2074b4[_0x3e9766[0x0]]={'$gte':moment(_0x3e9766[0x1])[_0xb540('0x58')](_0xb540('0x59'))};_0x4cd811[_0xb540('0x39')]=_[_0xb540('0x3b')](_0x4cd811[_0xb540('0x39')],_0x2074b4);}_0x4cd811=_[_0xb540('0x3b')]({},_0x4cd811,_0x435781[_0xb540('0x3e')]);return _0x4f9936['getMessages'](_0x4cd811);}})[_0xb540('0x24')](function(_0x22a773){if(_0x22a773){_0x3f536a=_0x22a773[_0xb540('0x35')];if(!_0x435781[_0xb540('0x30')][_0xb540('0x36')](_0xb540('0x51'))){_0x4cd811[_0xb540('0x21')]=qs[_0xb540('0x21')](_0x435781[_0xb540('0x30')][_0xb540('0x21')]);_0x4cd811[_0xb540('0x1e')]=qs['offset'](_0x435781['query'][_0xb540('0x1e')]);}return _0x4f9936[_0xb540('0x55')](_0x4cd811);}})['then'](function(_0x291411){if(_0x291411){return _0x291411?{'count':_0x3f536a,'rows':_0x291411}:null;}})[_0xb540('0x24')](respondWithResult(_0x136e95,null))[_0xb540('0x45')](handleError(_0x136e95,null));}; \ No newline at end of file +var _0x3cc1=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','destroy','params','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cc1,0x182));var _0x13cc=function(_0x4ee9a8,_0x5036a2){_0x4ee9a8=_0x4ee9a8-0x0;var _0x45a808=_0x3cc1[_0x4ee9a8];return _0x45a808;};'use strict';var emlformat=require(_0x13cc('0x0'));var rimraf=require(_0x13cc('0x1'));var zipdir=require(_0x13cc('0x2'));var jsonpatch=require(_0x13cc('0x3'));var rp=require(_0x13cc('0x4'));var moment=require(_0x13cc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x13cc('0x6'));var util=require(_0x13cc('0x7'));var path=require(_0x13cc('0x8'));var sox=require(_0x13cc('0x9'));var csv=require(_0x13cc('0xa'));var ejs=require(_0x13cc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x13cc('0xc'));var squel=require(_0x13cc('0xd'));var crypto=require(_0x13cc('0xe'));var jsforce=require(_0x13cc('0xf'));var deskjs=require(_0x13cc('0x10'));var toCsv=require(_0x13cc('0xa'));var querystring=require(_0x13cc('0x11'));var Papa=require(_0x13cc('0x12'));var Redis=require(_0x13cc('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x13cc('0x14'));var as=require(_0x13cc('0x15'));var hardwareService=require(_0x13cc('0x16'));var logger=require(_0x13cc('0x17'))(_0x13cc('0x18'));var utils=require(_0x13cc('0x19'));var config=require(_0x13cc('0x1a'));var licenseUtil=require(_0x13cc('0x1b'));var db=require(_0x13cc('0x1c'))['db'];config[_0x13cc('0x1d')]=_[_0x13cc('0x1e')](config[_0x13cc('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x13cc('0x1d')]));require(_0x13cc('0x1f'))[_0x13cc('0x20')](socket);function respondWithStatusCode(_0x524104,_0x2ffdcc){_0x2ffdcc=_0x2ffdcc||0xcc;return function(_0x46fc2e){if(_0x46fc2e){return _0x524104[_0x13cc('0x21')](_0x2ffdcc);}return _0x524104[_0x13cc('0x22')](_0x2ffdcc)[_0x13cc('0x23')]();};}function respondWithResult(_0x1d2467,_0x472927){_0x472927=_0x472927||0xc8;return function(_0x315bf3){if(_0x315bf3){return _0x1d2467[_0x13cc('0x22')](_0x472927)['json'](_0x315bf3);}};}function respondWithFilteredResult(_0x11c05f,_0x45a146){return function(_0x5686cf){if(_0x5686cf){var _0x240c5e=typeof _0x45a146[_0x13cc('0x24')]===_0x13cc('0x25')&&typeof _0x45a146[_0x13cc('0x26')]==='undefined';var _0x59024f=_0x5686cf[_0x13cc('0x27')];var _0x2395f1=_0x240c5e?0x0:_0x45a146[_0x13cc('0x24')];var _0x2a5020=_0x240c5e?_0x5686cf[_0x13cc('0x27')]:_0x45a146[_0x13cc('0x24')]+_0x45a146[_0x13cc('0x26')];var _0x6eb222;if(_0x2a5020>=_0x59024f){_0x2a5020=_0x59024f;_0x6eb222=0xc8;}else{_0x6eb222=0xce;}_0x11c05f['status'](_0x6eb222);return _0x11c05f['set'](_0x13cc('0x28'),_0x2395f1+'-'+_0x2a5020+'/'+_0x59024f)['json'](_0x5686cf);}return null;};}function patchUpdates(_0x22e8a6){return function(_0xe1f309){try{jsonpatch[_0x13cc('0x29')](_0xe1f309,_0x22e8a6,!![]);}catch(_0x4e5f37){return BPromise[_0x13cc('0x2a')](_0x4e5f37);}return _0xe1f309[_0x13cc('0x2b')]();};}function saveUpdates(_0x286df4,_0x5d9906){return function(_0x27563f){if(_0x27563f){return _0x27563f[_0x13cc('0x2c')](_0x286df4)[_0x13cc('0x2d')](function(_0x1bfd0b){return _0x1bfd0b;});}return null;};}function removeEntity(_0x17e840,_0x5dda42){return function(_0xb89735){if(_0xb89735){return _0xb89735['destroy']()[_0x13cc('0x2d')](function(){_0x17e840[_0x13cc('0x22')](0xcc)[_0x13cc('0x23')]();});}};}function handleEntityNotFound(_0x5586a1,_0xd6b0d5){return function(_0x4df09d){if(!_0x4df09d){_0x5586a1[_0x13cc('0x21')](0x194);}return _0x4df09d;};}function handleError(_0x2e4baa,_0x218771){_0x218771=_0x218771||0x1f4;return function(_0x324477){logger[_0x13cc('0x2e')](_0x324477['stack']);if(_0x324477[_0x13cc('0x2f')]){delete _0x324477['name'];}_0x2e4baa[_0x13cc('0x22')](_0x218771)['send'](_0x324477);};}exports[_0x13cc('0x30')]=function(_0x44f09e,_0x44d8ee){var _0x129fc8={},_0x20ffbe={},_0xe1f91f={'count':0x0,'rows':[]};var _0x344a05=_[_0x13cc('0x31')](db[_0x13cc('0x32')][_0x13cc('0x33')],function(_0x2c47f1){return{'name':_0x2c47f1[_0x13cc('0x34')],'type':_0x2c47f1[_0x13cc('0x35')][_0x13cc('0x36')]};});_0x20ffbe['model']=_[_0x13cc('0x31')](_0x344a05,_0x13cc('0x2f'));_0x20ffbe['query']=_['keys'](_0x44f09e[_0x13cc('0x37')]);_0x20ffbe[_0x13cc('0x38')]=_[_0x13cc('0x39')](_0x20ffbe[_0x13cc('0x3a')],_0x20ffbe[_0x13cc('0x37')]);_0x129fc8[_0x13cc('0x3b')]=_[_0x13cc('0x39')](_0x20ffbe[_0x13cc('0x3a')],qs[_0x13cc('0x3c')](_0x44f09e[_0x13cc('0x37')][_0x13cc('0x3c')]));_0x129fc8['attributes']=_0x129fc8[_0x13cc('0x3b')][_0x13cc('0x3d')]?_0x129fc8[_0x13cc('0x3b')]:_0x20ffbe[_0x13cc('0x3a')];if(!_0x44f09e[_0x13cc('0x37')][_0x13cc('0x3e')](_0x13cc('0x3f'))){_0x129fc8['limit']=qs[_0x13cc('0x26')](_0x44f09e[_0x13cc('0x37')][_0x13cc('0x26')]);_0x129fc8[_0x13cc('0x24')]=qs[_0x13cc('0x24')](_0x44f09e['query']['offset']);}_0x129fc8[_0x13cc('0x40')]=qs[_0x13cc('0x41')](_0x44f09e[_0x13cc('0x37')][_0x13cc('0x41')]);_0x129fc8[_0x13cc('0x42')]=qs[_0x13cc('0x38')](_[_0x13cc('0x43')](_0x44f09e[_0x13cc('0x37')],_0x20ffbe[_0x13cc('0x38')]),_0x344a05);if(_0x44f09e[_0x13cc('0x37')][_0x13cc('0x44')]){_0x129fc8[_0x13cc('0x42')]=_[_0x13cc('0x45')](_0x129fc8[_0x13cc('0x42')],{'$or':_[_0x13cc('0x31')](_0x344a05,function(_0x4a945c){if(_0x4a945c[_0x13cc('0x35')]!==_0x13cc('0x46')){var _0x51b2fb={};_0x51b2fb[_0x4a945c['name']]={'$like':'%'+_0x44f09e[_0x13cc('0x37')][_0x13cc('0x44')]+'%'};return _0x51b2fb;}})});}_0x129fc8=_[_0x13cc('0x45')]({},_0x129fc8,_0x44f09e[_0x13cc('0x47')]);var _0x33b4f0={'where':_0x129fc8['where']};return db['ChatGroup'][_0x13cc('0x27')](_0x33b4f0)['then'](function(_0x37dc5d){_0xe1f91f['count']=_0x37dc5d;if(_0x44f09e['query']['includeAll']){_0x129fc8[_0x13cc('0x48')]=[{'all':!![]}];}return db['ChatGroup'][_0x13cc('0x49')](_0x129fc8);})[_0x13cc('0x2d')](function(_0x50a7e9){_0xe1f91f[_0x13cc('0x4a')]=_0x50a7e9;return _0xe1f91f;})[_0x13cc('0x2d')](respondWithFilteredResult(_0x44d8ee,_0x129fc8))[_0x13cc('0x4b')](handleError(_0x44d8ee,null));};exports[_0x13cc('0x4c')]=function(_0x14d310,_0x332d3a){var _0x326f18={'raw':!![],'where':{'id':_0x14d310['params']['id']}},_0x456a63={};_0x456a63[_0x13cc('0x3a')]=_[_0x13cc('0x4d')](db['ChatGroup'][_0x13cc('0x33')]);_0x456a63[_0x13cc('0x37')]=_[_0x13cc('0x4d')](_0x14d310[_0x13cc('0x37')]);_0x456a63[_0x13cc('0x38')]=_[_0x13cc('0x39')](_0x456a63[_0x13cc('0x3a')],_0x456a63[_0x13cc('0x37')]);_0x326f18[_0x13cc('0x3b')]=_['intersection'](_0x456a63['model'],qs['fields'](_0x14d310[_0x13cc('0x37')]['fields']));_0x326f18[_0x13cc('0x3b')]=_0x326f18[_0x13cc('0x3b')][_0x13cc('0x3d')]?_0x326f18[_0x13cc('0x3b')]:_0x456a63[_0x13cc('0x3a')];if(_0x14d310[_0x13cc('0x37')][_0x13cc('0x4e')]){_0x326f18[_0x13cc('0x48')]=[{'all':!![]}];}_0x326f18=_['merge']({},_0x326f18,_0x14d310[_0x13cc('0x47')]);return db[_0x13cc('0x32')][_0x13cc('0x4f')](_0x326f18)[_0x13cc('0x2d')](handleEntityNotFound(_0x332d3a,null))[_0x13cc('0x2d')](respondWithResult(_0x332d3a,null))['catch'](handleError(_0x332d3a,null));};exports[_0x13cc('0x50')]=function(_0x422ee6,_0x3a9e1d){return db[_0x13cc('0x32')][_0x13cc('0x50')](_0x422ee6[_0x13cc('0x51')],{})['then'](respondWithResult(_0x3a9e1d,0xc9))['catch'](handleError(_0x3a9e1d,null));};exports[_0x13cc('0x2c')]=function(_0x195bb9,_0x494a8c){if(_0x195bb9[_0x13cc('0x51')]['id']){delete _0x195bb9[_0x13cc('0x51')]['id'];}return db[_0x13cc('0x32')][_0x13cc('0x4f')]({'where':{'id':_0x195bb9['params']['id']}})['then'](handleEntityNotFound(_0x494a8c,null))[_0x13cc('0x2d')](saveUpdates(_0x195bb9[_0x13cc('0x51')],null))[_0x13cc('0x2d')](respondWithResult(_0x494a8c,null))['catch'](handleError(_0x494a8c,null));};exports[_0x13cc('0x52')]=function(_0x4bdc42,_0x55cd2a){return db[_0x13cc('0x32')][_0x13cc('0x4f')]({'where':{'id':_0x4bdc42[_0x13cc('0x53')]['id']}})[_0x13cc('0x2d')](handleEntityNotFound(_0x55cd2a,null))[_0x13cc('0x2d')](removeEntity(_0x55cd2a,null))[_0x13cc('0x4b')](handleError(_0x55cd2a,null));};exports[_0x13cc('0x54')]=function(_0x36399a,_0x518cbe){return db[_0x13cc('0x32')][_0x13cc('0x54')]()['then'](respondWithResult(_0x518cbe,null))['catch'](handleError(_0x518cbe,null));};exports[_0x13cc('0x55')]=function(_0x4f7ec2,_0x24b344,_0x5a366e){return db[_0x13cc('0x56')][_0x13cc('0x27')]({'where':{'ChatGroupId':_0x4f7ec2[_0x13cc('0x53')]['id'],'ToId':_0x4f7ec2[_0x13cc('0x57')]['id'],'read':![]}})['then'](function(_0x55082a){return{'id':_['toInteger'](_0x4f7ec2[_0x13cc('0x53')]['id']),'count':_0x55082a};})[_0x13cc('0x2d')](respondWithResult(_0x24b344,null))[_0x13cc('0x4b')](handleError(_0x24b344,null));};exports[_0x13cc('0x58')]=function(_0x127881,_0xad6e8b,_0x1283e0){return db[_0x13cc('0x32')][_0x13cc('0x4f')]({'where':{'id':_0x127881[_0x13cc('0x53')]['id']}})[_0x13cc('0x2d')](handleEntityNotFound(_0xad6e8b,null))[_0x13cc('0x2d')](function(_0x17e892){if(_0x17e892){return _0x17e892['addMembers'](_0x127881[_0x13cc('0x51')][_0x13cc('0x59')],_[_0x13cc('0x5a')](_0x127881[_0x13cc('0x51')],[_0x13cc('0x59'),'id'])||{});}})[_0x13cc('0x2d')](respondWithResult(_0xad6e8b,null))[_0x13cc('0x4b')](handleError(_0xad6e8b,null));};exports[_0x13cc('0x5b')]=function(_0x564bd5,_0x43f15c,_0x52975e){var _0x342297={};var _0x423cee={};var _0x462e39;var _0x5b2595;return db['ChatGroup'][_0x13cc('0x5c')]({'where':{'id':_0x564bd5[_0x13cc('0x53')]['id']}})[_0x13cc('0x2d')](handleEntityNotFound(_0x43f15c,null))[_0x13cc('0x2d')](function(_0x5d61c7){if(_0x5d61c7){_0x462e39=_0x5d61c7;_0x423cee[_0x13cc('0x3a')]=_[_0x13cc('0x4d')](db[_0x13cc('0x5d')][_0x13cc('0x33')]);_0x423cee[_0x13cc('0x37')]=_[_0x13cc('0x4d')](_0x564bd5[_0x13cc('0x37')]);_0x423cee['filters']=_[_0x13cc('0x39')](_0x423cee[_0x13cc('0x3a')],_0x423cee[_0x13cc('0x37')]);_0x342297[_0x13cc('0x3b')]=_[_0x13cc('0x39')](_0x423cee[_0x13cc('0x3a')],qs[_0x13cc('0x3c')](_0x564bd5[_0x13cc('0x37')][_0x13cc('0x3c')]));_0x342297[_0x13cc('0x3b')]=_0x342297[_0x13cc('0x3b')]['length']?_0x342297['attributes']:_0x423cee['model'];_0x342297[_0x13cc('0x40')]=qs[_0x13cc('0x41')](_0x564bd5[_0x13cc('0x37')][_0x13cc('0x41')]);_0x342297['where']=qs[_0x13cc('0x38')](_[_0x13cc('0x43')](_0x564bd5[_0x13cc('0x37')],_0x423cee[_0x13cc('0x38')]));if(_0x564bd5[_0x13cc('0x37')][_0x13cc('0x44')]){_0x342297[_0x13cc('0x42')]=_[_0x13cc('0x45')](_0x342297[_0x13cc('0x42')],{'$or':_['map'](_0x342297['attributes'],function(_0x319f2c){var _0x115006={};_0x115006[_0x319f2c]={'$like':'%'+_0x564bd5[_0x13cc('0x37')]['filter']+'%'};return _0x115006;})});}_0x342297=_[_0x13cc('0x45')]({},_0x342297,_0x564bd5[_0x13cc('0x47')]);return _0x462e39['getMembers'](_0x342297);}})[_0x13cc('0x2d')](function(_0x3cfd14){if(_0x3cfd14){_0x5b2595=_0x3cfd14[_0x13cc('0x3d')];if(!_0x564bd5[_0x13cc('0x37')][_0x13cc('0x3e')](_0x13cc('0x3f'))){_0x342297[_0x13cc('0x26')]=qs[_0x13cc('0x26')](_0x564bd5[_0x13cc('0x37')][_0x13cc('0x26')]);_0x342297[_0x13cc('0x24')]=qs[_0x13cc('0x24')](_0x564bd5[_0x13cc('0x37')][_0x13cc('0x24')]);}return _0x462e39[_0x13cc('0x5b')](_0x342297);}})[_0x13cc('0x2d')](function(_0x4d65dc){if(_0x4d65dc){return _0x4d65dc?{'count':_0x5b2595,'rows':_0x4d65dc}:null;}})[_0x13cc('0x2d')](respondWithResult(_0x43f15c,null))[_0x13cc('0x4b')](handleError(_0x43f15c,null));};exports[_0x13cc('0x5e')]=function(_0x52b8df,_0x38c845,_0x3ec4ac){return db['ChatGroup']['find']({'where':{'id':_0x52b8df[_0x13cc('0x53')]['id']}})[_0x13cc('0x2d')](handleEntityNotFound(_0x38c845,null))[_0x13cc('0x2d')](function(_0x286ae5){if(_0x286ae5){return _0x286ae5['removeMembers'](_0x52b8df[_0x13cc('0x37')][_0x13cc('0x59')]);}})[_0x13cc('0x2d')](respondWithStatusCode(_0x38c845,null))[_0x13cc('0x4b')](handleError(_0x38c845,null));};exports[_0x13cc('0x5f')]=function(_0x502c2d,_0x4333c8,_0x408392){if(_0x502c2d[_0x13cc('0x51')]['id']){delete _0x502c2d[_0x13cc('0x51')]['id'];}return db[_0x13cc('0x32')][_0x13cc('0x4f')]({'where':{'id':_0x502c2d['params']['id']}})[_0x13cc('0x2d')](handleEntityNotFound(_0x4333c8,null))[_0x13cc('0x2d')](function(_0x56eb53){if(_0x56eb53){_0x502c2d['body'][_0x13cc('0x60')]=_0x56eb53['id'];return db[_0x13cc('0x56')][_0x13cc('0x50')](_0x502c2d[_0x13cc('0x51')]);}})[_0x13cc('0x2d')](respondWithResult(_0x4333c8,null))[_0x13cc('0x4b')](handleError(_0x4333c8,null));};exports[_0x13cc('0x61')]=function(_0x17f966,_0x1a57c1,_0x2119e8){var _0x2ea36a={};var _0x3f155d={};var _0x1eb2ee;var _0x446579;return db['ChatGroup']['findOne']({'where':{'id':_0x17f966[_0x13cc('0x53')]['id']}})[_0x13cc('0x2d')](handleEntityNotFound(_0x1a57c1,null))[_0x13cc('0x2d')](function(_0x386d36){if(_0x386d36){_0x1eb2ee=_0x386d36;_0x3f155d[_0x13cc('0x3a')]=_[_0x13cc('0x4d')](db[_0x13cc('0x56')][_0x13cc('0x33')]);_0x3f155d[_0x13cc('0x37')]=_[_0x13cc('0x4d')](_0x17f966[_0x13cc('0x37')]);_0x3f155d[_0x13cc('0x38')]=_[_0x13cc('0x39')](_0x3f155d[_0x13cc('0x3a')],_0x3f155d['query']);_0x2ea36a[_0x13cc('0x3b')]=_[_0x13cc('0x39')](_0x3f155d['model'],qs[_0x13cc('0x3c')](_0x17f966[_0x13cc('0x37')][_0x13cc('0x3c')]));_0x2ea36a[_0x13cc('0x3b')]=_0x2ea36a[_0x13cc('0x3b')][_0x13cc('0x3d')]?_0x2ea36a[_0x13cc('0x3b')]:_0x3f155d[_0x13cc('0x3a')];_0x2ea36a[_0x13cc('0x40')]=qs[_0x13cc('0x41')](_0x17f966[_0x13cc('0x37')]['sort']);_0x2ea36a[_0x13cc('0x42')]=qs['filters'](_[_0x13cc('0x43')](_0x17f966[_0x13cc('0x37')],_0x3f155d[_0x13cc('0x38')]));if(_0x17f966['query'][_0x13cc('0x44')]){_0x2ea36a[_0x13cc('0x42')]=_[_0x13cc('0x45')](_0x2ea36a[_0x13cc('0x42')],{'$or':_[_0x13cc('0x31')](_0x2ea36a[_0x13cc('0x3b')],function(_0x5341a9){var _0x3319fb={};_0x3319fb[_0x5341a9]={'$like':'%'+_0x17f966[_0x13cc('0x37')][_0x13cc('0x44')]+'%'};return _0x3319fb;})});}if(_0x17f966[_0x13cc('0x37')][_0x13cc('0x62')]){var _0xb4a2fd=_0x17f966['query'][_0x13cc('0x62')]['split'](',');var _0x5179c3={};_0x5179c3[_0xb4a2fd[0x0]]={'$gte':moment(_0xb4a2fd[0x1])[_0x13cc('0x63')](_0x13cc('0x64'))};_0x2ea36a[_0x13cc('0x42')]=_['merge'](_0x2ea36a[_0x13cc('0x42')],_0x5179c3);}_0x2ea36a=_[_0x13cc('0x45')]({},_0x2ea36a,_0x17f966['options']);return _0x1eb2ee[_0x13cc('0x61')](_0x2ea36a);}})[_0x13cc('0x2d')](function(_0x594fe0){if(_0x594fe0){_0x446579=_0x594fe0['length'];if(!_0x17f966[_0x13cc('0x37')][_0x13cc('0x3e')](_0x13cc('0x3f'))){_0x2ea36a['limit']=qs['limit'](_0x17f966[_0x13cc('0x37')][_0x13cc('0x26')]);_0x2ea36a[_0x13cc('0x24')]=qs[_0x13cc('0x24')](_0x17f966[_0x13cc('0x37')][_0x13cc('0x24')]);}return _0x1eb2ee['getMessages'](_0x2ea36a);}})[_0x13cc('0x2d')](function(_0x25ef8f){if(_0x25ef8f){return _0x25ef8f?{'count':_0x446579,'rows':_0x25ef8f}:null;}})[_0x13cc('0x2d')](respondWithResult(_0x1a57c1,null))['catch'](handleError(_0x1a57c1,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index f281e34..ecf005c 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 _0x41d0=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update'];(function(_0x39d037,_0x51afaf){var _0x1cd1e1=function(_0x59a3f7){while(--_0x59a3f7){_0x39d037['push'](_0x39d037['shift']());}};_0x1cd1e1(++_0x51afaf);}(_0x41d0,0x1c6));var _0x041d=function(_0x548d7d,_0x2d41fc){_0x548d7d=_0x548d7d-0x0;var _0xb1c878=_0x41d0[_0x548d7d];return _0xb1c878;};'use strict';var EventEmitter=require(_0x041d('0x0'));var ChatGroup=require(_0x041d('0x1'))['db'][_0x041d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x041d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x041d('0x4'),'afterDestroy':_0x041d('0x5')};function emitEvent(_0x12e55d){return function(_0x397dad,_0x41e587,_0x3a22a4){ChatGroupEvents[_0x041d('0x6')](_0x12e55d+':'+_0x397dad['id'],_0x397dad);ChatGroupEvents[_0x041d('0x6')](_0x12e55d,_0x397dad);_0x3a22a4(null);};}for(var e in events){if(events[_0x041d('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x041d('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x7939=['events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x5f20f0,_0x4cfb6d){var _0x16b5a2=function(_0xb2d2ca){while(--_0xb2d2ca){_0x5f20f0['push'](_0x5f20f0['shift']());}};_0x16b5a2(++_0x4cfb6d);}(_0x7939,0x190));var _0x9793=function(_0x2fa6ba,_0x1480b4){_0x2fa6ba=_0x2fa6ba-0x0;var _0x1d1c20=_0x7939[_0x2fa6ba];return _0x1d1c20;};'use strict';var EventEmitter=require(_0x9793('0x0'));var ChatGroup=require(_0x9793('0x1'))['db'][_0x9793('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9793('0x3')](0x0);var events={'afterCreate':_0x9793('0x4'),'afterUpdate':_0x9793('0x5'),'afterDestroy':_0x9793('0x6')};function emitEvent(_0x5c8d9c){return function(_0x403544,_0xfe61e6,_0x5e8a0d){ChatGroupEvents[_0x9793('0x7')](_0x5c8d9c+':'+_0x403544['id'],_0x403544);ChatGroupEvents['emit'](_0x5c8d9c,_0x403544);_0x5e8a0d(null);};}for(var e in events){if(events[_0x9793('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x9793('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 3f0e4b6..1c3f784 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 _0x7ff0=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','chat_groups'];(function(_0x16ad42,_0x4291b0){var _0x223bcc=function(_0xc679e6){while(--_0xc679e6){_0x16ad42['push'](_0x16ad42['shift']());}};_0x223bcc(++_0x4291b0);}(_0x7ff0,0x1b8));var _0x07ff=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x7ff0[_0x136619];return _0x38c4a5;};'use strict';var _=require(_0x07ff('0x0'));var util=require('util');var logger=require(_0x07ff('0x1'))(_0x07ff('0x2'));var moment=require('moment');var BPromise=require(_0x07ff('0x3'));var rp=require(_0x07ff('0x4'));var fs=require('fs');var path=require(_0x07ff('0x5'));var rimraf=require(_0x07ff('0x6'));var config=require(_0x07ff('0x7'));var attributes=require(_0x07ff('0x8'));module[_0x07ff('0x9')]=function(_0x3a6469,_0x454b17){return _0x3a6469['define']('ChatGroup',attributes,{'tableName':_0x07ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa88e=['api','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','chat_groups','../../config/logger'];(function(_0x2f8e62,_0x22cc21){var _0x3769b4=function(_0x26ae37){while(--_0x26ae37){_0x2f8e62['push'](_0x2f8e62['shift']());}};_0x3769b4(++_0x22cc21);}(_0xa88e,0xc5));var _0xea88=function(_0x53ff6f,_0x364461){_0x53ff6f=_0x53ff6f-0x0;var _0x3ee781=_0xa88e[_0x53ff6f];return _0x3ee781;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xea88('0x0'))(_0xea88('0x1'));var moment=require(_0xea88('0x2'));var BPromise=require(_0xea88('0x3'));var rp=require(_0xea88('0x4'));var fs=require('fs');var path=require(_0xea88('0x5'));var rimraf=require('rimraf');var config=require(_0xea88('0x6'));var attributes=require(_0xea88('0x7'));module['exports']=function(_0x5dd1e8,_0x5992b7){return _0x5dd1e8['define']('ChatGroup',attributes,{'tableName':_0xea88('0x8'),'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 39348fe..df7fa98 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 _0x3f2b=['localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis'];(function(_0x39bc94,_0x4f8c05){var _0x311313=function(_0x13ba64){while(--_0x13ba64){_0x39bc94['push'](_0x39bc94['shift']());}};_0x311313(++_0x4f8c05);}(_0x3f2b,0x72));var _0xb3f2=function(_0x1410f9,_0x2e7fa3){_0x1410f9=_0x1410f9-0x0;var _0x2faf56=_0x3f2b[_0x1410f9];return _0x2faf56;};'use strict';var _=require(_0xb3f2('0x0'));var util=require('util');var moment=require(_0xb3f2('0x1'));var BPromise=require(_0xb3f2('0x2'));var rs=require(_0xb3f2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3f2('0x4'))['db'];var utils=require(_0xb3f2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb3f2('0x6'));var jayson=require(_0xb3f2('0x7'));var client=jayson[_0xb3f2('0x8')][_0xb3f2('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb3f2('0xa')],{'host':_0xb3f2('0xb'),'port':0x18eb});var socket=require(_0xb3f2('0xc'))(new Redis(config[_0xb3f2('0xa')]));require(_0xb3f2('0xd'))[_0xb3f2('0xe')](socket);function respondWithRpcPromise(_0x415fd9,_0x314877,_0x94fada){return new BPromise(function(_0xf9b4be,_0x185c58){return client[_0xb3f2('0xf')](_0x415fd9,_0x94fada)[_0xb3f2('0x10')](function(_0xaf3b86){logger[_0xb3f2('0x11')]('ChatGroup,\x20%s,\x20%s',_0x314877,_0xb3f2('0x12'));logger['debug'](_0xb3f2('0x13'),_0x314877,_0xb3f2('0x12'),JSON['stringify'](_0xaf3b86));if(_0xaf3b86[_0xb3f2('0x14')]){if(_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x15')]===0x1f4){logger['error'](_0xb3f2('0x16'),_0x314877,_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x17')]);return _0x185c58(_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x17')]);}logger[_0xb3f2('0x14')](_0xb3f2('0x16'),_0x314877,_0xaf3b86['error'][_0xb3f2('0x17')]);return _0xf9b4be(_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x17')]);}else{logger[_0xb3f2('0x11')](_0xb3f2('0x16'),_0x314877,_0xb3f2('0x12'));_0xf9b4be(_0xaf3b86['result']['message']);}})[_0xb3f2('0x18')](function(_0x3a861a){logger[_0xb3f2('0x14')]('ChatGroup,\x20%s,\x20%s',_0x314877,_0x3a861a);_0x185c58(_0x3a861a);});});} \ No newline at end of file +var _0x689c=['defaults','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis'];(function(_0x1eeab2,_0x2c2291){var _0x2c53a7=function(_0x2e39ce){while(--_0x2e39ce){_0x1eeab2['push'](_0x1eeab2['shift']());}};_0x2c53a7(++_0x2c2291);}(_0x689c,0x9e));var _0xc689=function(_0x22e728,_0x31fe2b){_0x22e728=_0x22e728-0x0;var _0x498102=_0x689c[_0x22e728];return _0x498102;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc689('0x0'));var BPromise=require(_0xc689('0x1'));var rs=require(_0xc689('0x2'));var fs=require('fs');var Redis=require(_0xc689('0x3'));var db=require(_0xc689('0x4'))['db'];var utils=require(_0xc689('0x5'));var logger=require('../../config/logger')(_0xc689('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc689('0x7')][_0xc689('0x8')]({'port':0x232a});config[_0xc689('0x9')]=_[_0xc689('0xa')](config[_0xc689('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc689('0xb'))(new Redis(config[_0xc689('0x9')]));require(_0xc689('0xc'))['register'](socket);function respondWithRpcPromise(_0x1e304c,_0x12daa8,_0x34b5e2){return new BPromise(function(_0x122c73,_0x370371){return client[_0xc689('0xd')](_0x1e304c,_0x34b5e2)[_0xc689('0xe')](function(_0x1a2702){logger[_0xc689('0xf')](_0xc689('0x10'),_0x12daa8,_0xc689('0x11'));logger['debug'](_0xc689('0x12'),_0x12daa8,'request\x20sent',JSON[_0xc689('0x13')](_0x1a2702));if(_0x1a2702[_0xc689('0x14')]){if(_0x1a2702[_0xc689('0x14')]['code']===0x1f4){logger[_0xc689('0x14')](_0xc689('0x10'),_0x12daa8,_0x1a2702['error'][_0xc689('0x15')]);return _0x370371(_0x1a2702[_0xc689('0x14')][_0xc689('0x15')]);}logger[_0xc689('0x14')]('ChatGroup,\x20%s,\x20%s',_0x12daa8,_0x1a2702['error'][_0xc689('0x15')]);return _0x122c73(_0x1a2702[_0xc689('0x14')][_0xc689('0x15')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x12daa8,_0xc689('0x11'));_0x122c73(_0x1a2702[_0xc689('0x16')][_0xc689('0x15')]);}})[_0xc689('0x17')](function(_0xea568f){logger[_0xc689('0x14')]('ChatGroup,\x20%s,\x20%s',_0x12daa8,_0xea568f);_0x370371(_0xea568f);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index b2df35b..f92fdb8 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 _0xca63=['length','chatGroup:','./chatGroup.events','save','remove','emit','removeListener','register'];(function(_0x268dcd,_0x397c2d){var _0x4d6e1f=function(_0x550112){while(--_0x550112){_0x268dcd['push'](_0x268dcd['shift']());}};_0x4d6e1f(++_0x397c2d);}(_0xca63,0x1ba));var _0x3ca6=function(_0x20e105,_0x257f1a){_0x20e105=_0x20e105-0x0;var _0x35899a=_0xca63[_0x20e105];return _0x35899a;};'use strict';var ChatGroupEvents=require(_0x3ca6('0x0'));var events=[_0x3ca6('0x1'),_0x3ca6('0x2'),'update'];function createListener(_0xd1b1cb,_0xeadf1f){return function(_0x3b1ebc){_0xeadf1f[_0x3ca6('0x3')](_0xd1b1cb,_0x3b1ebc);};}function removeListener(_0x3d2e7e,_0x31a6a9){return function(){ChatGroupEvents[_0x3ca6('0x4')](_0x3d2e7e,_0x31a6a9);};}exports[_0x3ca6('0x5')]=function(_0x5baff6){for(var _0x371515=0x0,_0x5568ee=events[_0x3ca6('0x6')];_0x371515<_0x5568ee;_0x371515++){var _0x2fc735=events[_0x371515];var _0x487202=createListener(_0x3ca6('0x7')+_0x2fc735,_0x5baff6);ChatGroupEvents['on'](_0x2fc735,_0x487202);}}; \ No newline at end of file +var _0x7a59=['emit','removeListener','register','length','chatGroup:','./chatGroup.events','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a59,0x155));var _0x97a5=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0x7a59[_0x34ad72];return _0x5c9aa8;};'use strict';var ChatGroupEvents=require(_0x97a5('0x0'));var events=['save',_0x97a5('0x1'),'update'];function createListener(_0x213526,_0x10fd53){return function(_0x5970f1){_0x10fd53[_0x97a5('0x2')](_0x213526,_0x5970f1);};}function removeListener(_0x268b25,_0x595083){return function(){ChatGroupEvents[_0x97a5('0x3')](_0x268b25,_0x595083);};}exports[_0x97a5('0x4')]=function(_0x770653){for(var _0x552e52=0x0,_0x4cc61a=events[_0x97a5('0x5')];_0x552e52<_0x4cc61a;_0x552e52++){var _0x217aef=events[_0x552e52];var _0x10cf2d=createListener(_0x97a5('0x6')+_0x217aef,_0x770653);ChatGroupEvents['on'](_0x217aef,_0x10cf2d);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 9db756d..d28cc4a 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 _0x5e85=['index','get','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','post','create','addMembers','put','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x43eb68,_0xa313a6){var _0xca41ce=function(_0xf384a7){while(--_0xf384a7){_0x43eb68['push'](_0x43eb68['shift']());}};_0xca41ce(++_0xa313a6);}(_0x5e85,0x171));var _0x55e8=function(_0xbee0d5,_0x34dd17){_0xbee0d5=_0xbee0d5-0x0;var _0x565ca0=_0x5e85[_0xbee0d5];return _0x565ca0;};'use strict';var multer=require(_0x55e8('0x0'));var util=require(_0x55e8('0x1'));var path=require(_0x55e8('0x2'));var timeout=require(_0x55e8('0x3'));var express=require(_0x55e8('0x4'));var router=express[_0x55e8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x55e8('0x6'));var interaction=require(_0x55e8('0x7'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router['get']('/',auth[_0x55e8('0x8')](),controller[_0x55e8('0x9')]);router[_0x55e8('0xa')](_0x55e8('0xb'),auth[_0x55e8('0x8')](),controller[_0x55e8('0xc')]);router[_0x55e8('0xa')](_0x55e8('0xd'),auth[_0x55e8('0x8')](),controller[_0x55e8('0xe')]);router[_0x55e8('0xa')](_0x55e8('0xf'),auth[_0x55e8('0x8')](),controller[_0x55e8('0x10')]);router[_0x55e8('0xa')](_0x55e8('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0x55e8('0xa')](_0x55e8('0x12'),auth[_0x55e8('0x8')](),controller['getMessages']);router[_0x55e8('0x13')]('/',auth[_0x55e8('0x8')](),controller[_0x55e8('0x14')]);router['post'](_0x55e8('0x11'),auth[_0x55e8('0x8')](),controller[_0x55e8('0x15')]);router[_0x55e8('0x13')]('/:id/messages',auth[_0x55e8('0x8')](),controller['addMessage']);router[_0x55e8('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x55e8('0x17')](_0x55e8('0xd'),auth[_0x55e8('0x8')](),controller[_0x55e8('0x18')]);router['delete'](_0x55e8('0x11'),auth[_0x55e8('0x8')](),controller[_0x55e8('0x19')]);module[_0x55e8('0x1a')]=router; \ No newline at end of file +var _0x1fb8=['/:id','show','getUnread','/:id/members','getMembers','/:id/messages','create','post','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1fb8,0x195));var _0x81fb=function(_0x32b4aa,_0x12eba6){_0x32b4aa=_0x32b4aa-0x0;var _0x473160=_0x1fb8[_0x32b4aa];return _0x473160;};'use strict';var multer=require(_0x81fb('0x0'));var util=require(_0x81fb('0x1'));var path=require(_0x81fb('0x2'));var timeout=require(_0x81fb('0x3'));var express=require(_0x81fb('0x4'));var router=express[_0x81fb('0x5')]();var fs_extra=require(_0x81fb('0x6'));var auth=require(_0x81fb('0x7'));var interaction=require(_0x81fb('0x8'));var config=require(_0x81fb('0x9'));var controller=require(_0x81fb('0xa'));router[_0x81fb('0xb')]('/',auth[_0x81fb('0xc')](),controller[_0x81fb('0xd')]);router[_0x81fb('0xb')](_0x81fb('0xe'),auth[_0x81fb('0xc')](),controller['describe']);router[_0x81fb('0xb')](_0x81fb('0xf'),auth['isAuthenticated'](),controller[_0x81fb('0x10')]);router[_0x81fb('0xb')]('/:id/unread',auth[_0x81fb('0xc')](),controller[_0x81fb('0x11')]);router[_0x81fb('0xb')](_0x81fb('0x12'),auth[_0x81fb('0xc')](),controller[_0x81fb('0x13')]);router[_0x81fb('0xb')](_0x81fb('0x14'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth[_0x81fb('0xc')](),controller[_0x81fb('0x15')]);router[_0x81fb('0x16')](_0x81fb('0x12'),auth[_0x81fb('0xc')](),controller['addMembers']);router[_0x81fb('0x16')](_0x81fb('0x14'),auth[_0x81fb('0xc')](),controller[_0x81fb('0x17')]);router[_0x81fb('0x18')](_0x81fb('0xf'),auth[_0x81fb('0xc')](),controller[_0x81fb('0x19')]);router[_0x81fb('0x1a')](_0x81fb('0xf'),auth[_0x81fb('0xc')](),controller[_0x81fb('0x1b')]);router[_0x81fb('0x1a')](_0x81fb('0x12'),auth[_0x81fb('0xc')](),controller[_0x81fb('0x1c')]);module[_0x81fb('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 01d4333..dae1186 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 _0xa802=['INTEGER','star','TEXT','STRING','DATE','ENUM','out','sequelize','BOOLEAN'];(function(_0x2e167e,_0x5a1f7a){var _0x106386=function(_0x1c0291){while(--_0x1c0291){_0x2e167e['push'](_0x2e167e['shift']());}};_0x106386(++_0x5a1f7a);}(_0xa802,0xf1));var _0x2a80=function(_0x15f689,_0x1038ab){_0x15f689=_0x15f689-0x0;var _0xce5f43=_0xa802[_0x15f689];return _0xce5f43;};'use strict';var Sequelize=require(_0x2a80('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2a80('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2a80('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x2a80('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x2a80('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x2a80('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2a80('0x5')]},'secondDisposition':{'type':Sequelize[_0x2a80('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x2a80('0x5')]},'browserVersion':{'type':Sequelize[_0x2a80('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x2a80('0x5')]},'deviceModel':{'type':Sequelize[_0x2a80('0x5')]},'deviceVendor':{'type':Sequelize[_0x2a80('0x5')]},'deviceType':{'type':Sequelize[_0x2a80('0x5')]},'referer':{'type':Sequelize[_0x2a80('0x4')]},'customerIp':{'type':Sequelize[_0x2a80('0x5')]},'formData':{'type':Sequelize[_0x2a80('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x2a80('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2a80('0x7')]('in',_0x2a80('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2a80('0x5')]},'customerPort':{'type':Sequelize[_0x2a80('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x2a80('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x2a80('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2a80('0x2')]}}; \ No newline at end of file +var _0xc6f6=['ENUM','star','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0xc6f6,0xee));var _0x6c6f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc6f6[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x6c6f('0x0'));module[_0x6c6f('0x1')]={'closed':{'type':Sequelize[_0x6c6f('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6c6f('0x3')]},'ratingType':{'type':Sequelize[_0x6c6f('0x4')]('star','thumb'),'defaultValue':_0x6c6f('0x5')},'ratingMessage':{'type':Sequelize[_0x6c6f('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x6c6f('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6c6f('0x8')]},'disposition':{'type':Sequelize[_0x6c6f('0x7')]},'secondDisposition':{'type':Sequelize[_0x6c6f('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6c6f('0x7')]},'browserName':{'type':Sequelize[_0x6c6f('0x7')]},'browserVersion':{'type':Sequelize[_0x6c6f('0x7')]},'osName':{'type':Sequelize[_0x6c6f('0x7')]},'osVersion':{'type':Sequelize[_0x6c6f('0x7')]},'deviceModel':{'type':Sequelize[_0x6c6f('0x7')]},'deviceVendor':{'type':Sequelize[_0x6c6f('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x6c6f('0x6')]},'customerIp':{'type':Sequelize[_0x6c6f('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x6c6f('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x6c6f('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x6c6f('0x4')]('in',_0x6c6f('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6c6f('0x7')]},'customerPort':{'type':Sequelize[_0x6c6f('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x6c6f('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x6c6f('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 5dde5a1..b77f983 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 _0x0bf8=['MailServerOut','CloudProvider','Smtp','getSmtpOptions','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','sort','where','pick','ChatInteractionId','filter','split','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','rows','getMyMessages','order','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','unix','toString','server','files','attachments','transcript-%d-%s.zip','push','firstName','read','Account','Owner','get','N.A.','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','Contact','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','download','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','limit','undefined','offset','count','Content-Range','then','destroy','end','sendStatus','stack','name','send','render','merge','contact','agent','interaction','account','map','rawAttributes','type','getOptions','findAll','query','user','show','params','model','keys','filters','intersection','attributes','fields','length','include','ChatInteraction','find','create','body','update','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','vidaooNote','follow','vidaooMetadata','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','UserId','closed','disposition','attachmentUpload','file','basename','filename','mimetype','Attachment','Unauthorized','attachId','server/files/attachments/','join','mailTranscript','root','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','System','customer','Visitor','website_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount'];(function(_0x7b842c,_0x393863){var _0x5c3f59=function(_0x2fdfc8){while(--_0x2fdfc8){_0x7b842c['push'](_0x7b842c['shift']());}};_0x5c3f59(++_0x393863);}(_0x0bf8,0x1dd));var _0x80bf=function(_0x144616,_0x1188de){_0x144616=_0x144616-0x0;var _0x100e2f=_0x0bf8[_0x144616];return _0x100e2f;};'use strict';var rimraf=require(_0x80bf('0x0'));var zipdir=require(_0x80bf('0x1'));var rp=require(_0x80bf('0x2'));var moment=require(_0x80bf('0x3'));var BPromise=require(_0x80bf('0x4'));var Mustache=require(_0x80bf('0x5'));var util=require(_0x80bf('0x6'));var path=require('path');var ejs=require(_0x80bf('0x7'));var fs=require('fs');var _=require(_0x80bf('0x8'));var Redis=require('ioredis');var interaction=require(_0x80bf('0x9'));var qs=require(_0x80bf('0xa'));var pdf=require(_0x80bf('0xb'));var logger=require(_0x80bf('0xc'))(_0x80bf('0xd'));var config=require(_0x80bf('0xe'));var db=require(_0x80bf('0xf'))['db'];config[_0x80bf('0x10')]=_[_0x80bf('0x11')](config[_0x80bf('0x10')],{'host':_0x80bf('0x12'),'port':0x18eb});var socket=require(_0x80bf('0x13'))(new Redis(config[_0x80bf('0x10')]));require(_0x80bf('0x14'))[_0x80bf('0x15')](socket);var jayson=require('jayson/promise');var client=jayson[_0x80bf('0x16')][_0x80bf('0x17')]({'port':0x232b});var client9004=jayson[_0x80bf('0x16')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4726fd,_0x4d9de7,_0x2061d5,_0x1936bb){return new BPromise(function(_0x369cbc,_0x4d3e85){var _0x495f53=_0x1936bb||client;return _0x495f53['request'](_0x4726fd,_0x2061d5)['then'](function(_0x518519){logger[_0x80bf('0x18')](_0x80bf('0x19'),_0x4d9de7,_0x80bf('0x1a'));logger[_0x80bf('0x1b')](_0x80bf('0x1c'),_0x4d9de7,'request\x20sent',JSON[_0x80bf('0x1d')](_0x518519));if(_0x518519[_0x80bf('0x1e')]){if(_0x518519[_0x80bf('0x1e')]['code']===0x1f4){logger[_0x80bf('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x4d9de7,_0x518519[_0x80bf('0x1e')][_0x80bf('0x1f')]);return _0x4d3e85(_0x518519[_0x80bf('0x1e')][_0x80bf('0x1f')]);}logger[_0x80bf('0x1e')](_0x80bf('0x19'),_0x4d9de7,_0x518519[_0x80bf('0x1e')][_0x80bf('0x1f')]);return _0x369cbc(_0x518519['error']['message']);}else{logger['info'](_0x80bf('0x19'),_0x4d9de7,'request\x20sent');_0x369cbc(_0x518519[_0x80bf('0x20')][_0x80bf('0x1f')]);}})[_0x80bf('0x21')](function(_0x715c12){logger['error'](_0x80bf('0x19'),_0x4d9de7,_0x715c12);_0x4d3e85(_0x715c12);});});}function respondWithStatusCode(_0xd260eb,_0x3f34e4){_0x3f34e4=_0x3f34e4||0xcc;return function(_0x5f4183){if(_0x5f4183){return _0xd260eb['sendStatus'](_0x3f34e4);}return _0xd260eb['status'](_0x3f34e4)['end']();};}function respondWithResult(_0x895a94,_0x1a46d9){_0x1a46d9=_0x1a46d9||0xc8;return function(_0x1c8450){if(_0x1c8450){return _0x895a94[_0x80bf('0x22')](_0x1a46d9)[_0x80bf('0x23')](_0x1c8450);}};}function respondWithFilteredResult(_0x416d44,_0x181a9e){return function(_0x226e11){if(_0x226e11){var _0x27afdf=typeof _0x181a9e['offset']==='undefined'&&typeof _0x181a9e[_0x80bf('0x24')]===_0x80bf('0x25');var _0x78492a=_0x226e11['count'];var _0x5db8d6=_0x27afdf?0x0:_0x181a9e[_0x80bf('0x26')];var _0x3d4643=_0x27afdf?_0x226e11[_0x80bf('0x27')]:_0x181a9e[_0x80bf('0x26')]+_0x181a9e[_0x80bf('0x24')];var _0x29a4ba;if(_0x3d4643>=_0x78492a){_0x3d4643=_0x78492a;_0x29a4ba=0xc8;}else{_0x29a4ba=0xce;}_0x416d44['status'](_0x29a4ba);return _0x416d44['set'](_0x80bf('0x28'),_0x5db8d6+'-'+_0x3d4643+'/'+_0x78492a)[_0x80bf('0x23')](_0x226e11);}return null;};}function saveUpdates(_0x16d747){return function(_0x57876c){if(_0x57876c){return _0x57876c['update'](_0x16d747)[_0x80bf('0x29')](function(_0x55d8b5){return _0x55d8b5;});}return null;};}function removeEntity(_0x5e9208){return function(_0x2a12a0){if(_0x2a12a0){return _0x2a12a0[_0x80bf('0x2a')]()['then'](function(){_0x5e9208['status'](0xcc)[_0x80bf('0x2b')]();});}};}function handleEntityNotFound(_0x84b60c){return function(_0xf48ca2){if(!_0xf48ca2){_0x84b60c[_0x80bf('0x2c')](0x194);}return _0xf48ca2;};}function handleError(_0x152e6f,_0x5b1130){_0x5b1130=_0x5b1130||0x1f4;return function(_0x54fa50){logger[_0x80bf('0x1e')](_0x54fa50[_0x80bf('0x2d')]);if(_0x54fa50['name']){delete _0x54fa50[_0x80bf('0x2e')];}_0x152e6f[_0x80bf('0x22')](_0x5b1130)[_0x80bf('0x2f')](_0x54fa50);};}function getMustacheRender(_0x5e241d,_0x5c88be){return Mustache[_0x80bf('0x30')](_0x5e241d,_[_0x80bf('0x31')](_0x5c88be['body'],{'contact':_0x5c88be[_0x80bf('0x32')],'message':_0x5c88be[_0x80bf('0x1f')],'agent':_0x5c88be[_0x80bf('0x33')],'interaction':_0x5c88be[_0x80bf('0x34')],'account':_0x5c88be[_0x80bf('0x35')]}))||'';}exports['index']=function(_0x1fe860,_0x5ed9ac){var _0x46b0ab={};var _0x19dd68=_[_0x80bf('0x36')](db['ChatInteraction'][_0x80bf('0x37')],function(_0x12a56f){return{'name':_0x12a56f['fieldName'],'type':_0x12a56f[_0x80bf('0x38')]['key']};});_0x46b0ab=qs[_0x80bf('0x39')](_0x19dd68,_0x1fe860);return interaction[_0x80bf('0x3a')]('chat',_0x1fe860[_0x80bf('0x3b')],_0x1fe860[_0x80bf('0x3c')],_0x46b0ab,_0x19dd68)[_0x80bf('0x29')](respondWithFilteredResult(_0x5ed9ac,_0x46b0ab))[_0x80bf('0x21')](handleError(_0x5ed9ac,null));};exports[_0x80bf('0x3d')]=function(_0x323c2b,_0x44ba28){var _0x35a413={'raw':![],'where':{'id':_0x323c2b[_0x80bf('0x3e')]['id']}},_0x1bf88e={};_0x1bf88e[_0x80bf('0x3f')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x1bf88e[_0x80bf('0x3b')]=_[_0x80bf('0x40')](_0x323c2b[_0x80bf('0x3b')]);_0x1bf88e[_0x80bf('0x41')]=_[_0x80bf('0x42')](_0x1bf88e[_0x80bf('0x3f')],_0x1bf88e[_0x80bf('0x3b')]);_0x35a413[_0x80bf('0x43')]=_[_0x80bf('0x42')](_0x1bf88e[_0x80bf('0x3f')],qs['fields'](_0x323c2b[_0x80bf('0x3b')][_0x80bf('0x44')]));_0x35a413[_0x80bf('0x43')]=_0x35a413['attributes'][_0x80bf('0x45')]?_0x35a413['attributes']:_0x1bf88e[_0x80bf('0x3f')];if(_0x323c2b['query']['includeAll']){_0x35a413[_0x80bf('0x46')]=[{'all':!![]}];}_0x35a413=_[_0x80bf('0x31')]({},_0x35a413,_0x323c2b['options']);return db[_0x80bf('0x47')][_0x80bf('0x48')](_0x35a413)[_0x80bf('0x29')](handleEntityNotFound(_0x44ba28,null))['then'](respondWithResult(_0x44ba28,null))[_0x80bf('0x21')](handleError(_0x44ba28,null));};exports[_0x80bf('0x49')]=function(_0x1db7d7,_0xedfe8e){return db[_0x80bf('0x47')]['create'](_0x1db7d7[_0x80bf('0x4a')],{})[_0x80bf('0x29')](respondWithResult(_0xedfe8e,0xc9))['catch'](handleError(_0xedfe8e,null));};exports[_0x80bf('0x4b')]=function(_0x3e81a1,_0x3673f0){if(_0x3e81a1[_0x80bf('0x4a')]['id']){delete _0x3e81a1['body']['id'];}return db['ChatInteraction'][_0x80bf('0x48')]({'where':{'id':_0x3e81a1[_0x80bf('0x3e')]['id']}})[_0x80bf('0x29')](handleEntityNotFound(_0x3673f0,null))[_0x80bf('0x29')](saveUpdates(_0x3e81a1[_0x80bf('0x4a')],null))[_0x80bf('0x29')](respondWithResult(_0x3673f0,null))[_0x80bf('0x21')](handleError(_0x3673f0,null));};exports[_0x80bf('0x2a')]=function(_0x195343,_0x558528){return db[_0x80bf('0x47')][_0x80bf('0x48')]({'where':{'id':_0x195343[_0x80bf('0x3e')]['id']}})['then'](handleEntityNotFound(_0x558528,null))[_0x80bf('0x29')](removeEntity(_0x558528,null))['catch'](handleError(_0x558528,null));};exports[_0x80bf('0x4c')]=function(_0x23db3d,_0x401952){return db[_0x80bf('0x47')][_0x80bf('0x4c')]()[_0x80bf('0x29')](respondWithResult(_0x401952,null))[_0x80bf('0x21')](handleError(_0x401952,null));};exports[_0x80bf('0x4d')]=function(_0x4b1fd6,_0xa94fb7){var _0x51bbc9=_0x4b1fd6['params']['id'];var _0x1a2240;var _0x4f9252;var _0x270338;return db[_0x80bf('0x47')][_0x80bf('0x4e')]({'where':{'id':_0x51bbc9}})[_0x80bf('0x29')](function(_0x486285){_0x1a2240=_0x486285;return db[_0x80bf('0x4f')]['findOne']({'where':{'id':_0x486285[_0x80bf('0x50')]},'attributes':['id',_0x80bf('0x51'),'vidaooEscalation',_0x80bf('0x52'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x80bf('0x29')](function(_0x2985ec){if(_0x2985ec&&_0x2985ec[_0x80bf('0x51')]&&_0x2985ec[_0x80bf('0x53')]){_0x4f9252=_0x2985ec;var _0x59d548={'interaction':{'id':_0x51bbc9},'agent':{'id':_0x4b1fd6[_0x80bf('0x3c')]['id'],'name':_0x4b1fd6[_0x80bf('0x3c')][_0x80bf('0x2e')],'fullname':_0x4b1fd6[_0x80bf('0x3c')]['fullname'],'email':_0x4b1fd6[_0x80bf('0x3c')]['email']},'contact':_0x4b1fd6[_0x80bf('0x4a')][_0x80bf('0x32')],'account':_0x4b1fd6[_0x80bf('0x4a')][_0x80bf('0x35')]};var _0x52ba59={'rejectUnauthorized':![],'method':_0x80bf('0x54'),'url':_0x80bf('0x55'),'headers':{'X-APIKEY':_0x2985ec['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4b1fd6[_0x80bf('0x3c')][_0x80bf('0x56')]],'buttons':null,'topic':_0x4f9252[_0x80bf('0x52')],'note':_[_0x80bf('0x57')](_0x4f9252[_0x80bf('0x58')])?null:getMustacheRender(_0x4f9252['vidaooNote'],_0x59d548),'metadata':null},'redirect':_0x80bf('0x59'),'json':!![]};try{if(!_['isNull'](_0x4f9252['vidaooMetadata'])){var _0x8718cd=getMustacheRender(_0x4f9252[_0x80bf('0x5a')],_0x59d548);var _0xae0408=JSON['parse'](_0x8718cd);_0x52ba59[_0x80bf('0x4a')][_0x80bf('0x5b')]=_0xae0408;}}catch(_0x4acd59){throw new db[(_0x80bf('0x5c'))]['ValidationError'](_0x80bf('0x5d'));}return rp(_0x52ba59);}else{throw new db[(_0x80bf('0x5c'))][(_0x80bf('0x5e'))](_0x80bf('0x5f'));}})['then'](function(_0x51660f){_0x270338=_0x51660f;if(_0x270338['id']){var _0x1cb594={'body':_0x270338[_0x80bf('0x60')],'ChatWebsiteId':_0x4f9252['id'],'ChatInteractionId':_0x1a2240['id'],'direction':_0x80bf('0x61'),'UserId':_0x4b1fd6['user']['id']};return db[_0x80bf('0x62')][_0x80bf('0x49')](_0x1cb594,{});}else{throw new db[(_0x80bf('0x5c'))][(_0x80bf('0x5e'))](_0x80bf('0x63'));}})[_0x80bf('0x29')](function(){return _0x1a2240[_0x80bf('0x64')]({'vidaooSessionId':_0x270338['id']});})[_0x80bf('0x29')](respondWithResult(_0xa94fb7,null))[_0x80bf('0x21')](handleError(_0xa94fb7,null));};exports[_0x80bf('0x65')]=function(_0x5c806e,_0x4f66dd){if(_0x5c806e[_0x80bf('0x4a')]['id']){delete _0x5c806e[_0x80bf('0x4a')]['id'];}return db[_0x80bf('0x47')][_0x80bf('0x48')]({'where':{'id':_0x5c806e[_0x80bf('0x3e')]['id']},'include':[{'model':db[_0x80bf('0x66')],'as':'Contact'}]})[_0x80bf('0x29')](handleEntityNotFound(_0x4f66dd,null))[_0x80bf('0x29')](saveUpdates(_0x5c806e['body'],null))[_0x80bf('0x29')](respondWithResult(_0x4f66dd,null))['catch'](handleError(_0x4f66dd,null));};exports['abandon']=function(_0x4c3098,_0x465f04){if(_0x4c3098[_0x80bf('0x4a')]['id']){delete _0x4c3098[_0x80bf('0x4a')]['id'];}return db[_0x80bf('0x47')][_0x80bf('0x48')]({'where':{'id':_0x4c3098[_0x80bf('0x3e')]['id']}})['then'](function(_0x55d9b1){if(!_0x55d9b1){logger['error'](_0x80bf('0x67'),_0x80bf('0x68'),0x194,'entity\x20not\x20found');_0x465f04[_0x80bf('0x2c')](0x194);}else{if(_0x55d9b1[_0x80bf('0x69')]){throw new db[(_0x80bf('0x5c'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x55d9b1;})[_0x80bf('0x29')](function(_0x788d64){if(_0x788d64){return _0x788d64['update']({'closed':_0x4c3098[_0x80bf('0x4a')][_0x80bf('0x6a')],'disposition':_0x4c3098[_0x80bf('0x4a')][_0x80bf('0x6b')]})[_0x80bf('0x29')](function(_0x2f3337){return _0x2f3337;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0x80bf('0x68'),_0x4c3098[_0x80bf('0x4a')],client9004);})[_0x80bf('0x29')](respondWithResult(_0x465f04,null))[_0x80bf('0x21')](handleError(_0x465f04,null));};exports[_0x80bf('0x6c')]=function(_0x4828a4,_0x5d16f8){_0x4828a4[_0x80bf('0x4a')][_0x80bf('0x2e')]=_0x4828a4[_0x80bf('0x6d')]['originalname'];_0x4828a4[_0x80bf('0x4a')][_0x80bf('0x6e')]=_0x4828a4['file'][_0x80bf('0x6f')];_0x4828a4[_0x80bf('0x4a')][_0x80bf('0x38')]=_0x4828a4[_0x80bf('0x6d')][_0x80bf('0x70')];return db[_0x80bf('0x71')][_0x80bf('0x49')](_0x4828a4['body'])[_0x80bf('0x29')](respondWithResult(_0x5d16f8,0xc9))[_0x80bf('0x21')](handleError(_0x5d16f8,null));};exports['attachmentDownload']=function(_0x173faf,_0x67bd3){return db[_0x80bf('0x47')][_0x80bf('0x4e')]({'where':{'id':_0x173faf[_0x80bf('0x3e')]['id']},'raw':!![]})[_0x80bf('0x29')](handleEntityNotFound(_0x67bd3,null))[_0x80bf('0x29')](function(_0xd8635a){if(_0xd8635a){if(_0xd8635a['closed']){return _0x67bd3[_0x80bf('0x22')](0x193)['json']({'status':0x193,'message':_0x80bf('0x72')});}return db[_0x80bf('0x71')][_0x80bf('0x4e')]({'where':{'id':_0x173faf['query'][_0x80bf('0x73')]},'raw':!![]})[_0x80bf('0x29')](handleEntityNotFound(_0x67bd3,null));}})['then'](function(_0x208594){if(_0x208594){var _0x7a0d55=_0x208594['ChatOfflineMessageId']!==null;var _0xb59baf=path['join'](config['root'],_0x80bf('0x74'));if(_0x7a0d55){_0xb59baf=path[_0x80bf('0x75')](_0xb59baf,'offline-chat/');}var _0x4f4bf6=path['join'](_0xb59baf,_0x208594['basename']);return _0x67bd3['download'](_0x4f4bf6);}})[_0x80bf('0x21')](handleError(_0x67bd3,null));};exports['close']=function(_0x252f41,_0xab147a){var _0x6663ea=null;var _0x184558=null;var _0x2a9f2c=null;if(_0x252f41[_0x80bf('0x4a')]['id']){delete _0x252f41[_0x80bf('0x4a')]['id'];}if(_0x252f41[_0x80bf('0x4a')][_0x80bf('0x76')]){_0x2a9f2c=path['join'](config[_0x80bf('0x77')],'server/files/chat/upload/',util[_0x80bf('0x78')](_0x80bf('0x79'),Date[_0x80bf('0x7a')]()));_0x252f41[_0x80bf('0x4a')][_0x80bf('0x7b')]=_0x2a9f2c;}return db[_0x80bf('0x47')][_0x80bf('0x48')]({'where':{'id':_0x252f41[_0x80bf('0x3e')]['id']},'include':[{'model':db[_0x80bf('0x62')],'as':_0x80bf('0x7c'),'include':[{'model':db[_0x80bf('0x7d')],'as':'User'}]}]})[_0x80bf('0x29')](handleEntityNotFound(_0xab147a,null))[_0x80bf('0x29')](saveUpdates(_0x252f41[_0x80bf('0x4a')],null))[_0x80bf('0x29')](function(_0x1a29b4){if(_0x1a29b4){_0x6663ea=_0x1a29b4;return db[_0x80bf('0x4f')][_0x80bf('0x48')]({'where':{'id':_0x6663ea[_0x80bf('0x50')]}});}})['then'](function(_0x5756fa){if(_0x5756fa){_0x184558=_0x5756fa;return db[_0x80bf('0x66')][_0x80bf('0x48')]({'where':{'id':_0x6663ea[_0x80bf('0x7e')]}});}})[_0x80bf('0x29')](function(_0x4810ec){if(_0x4810ec){if(_0x2a9f2c){var _0x54cc4d=null;for(var _0xe1ddf1=0x1;_0xe1ddf1<_0x6663ea[_0x80bf('0x7c')]['length'];++_0xe1ddf1){_0x54cc4d=_0x6663ea[_0x80bf('0x7c')][_0xe1ddf1];var _0x1b19d4=_0x54cc4d[_0x80bf('0x69')]?util[_0x80bf('0x78')](_0x80bf('0x7f'),_0x184558[_0x80bf('0x80')],_0x54cc4d[_0x80bf('0x69')]):_0x80bf('0x81');var _0x33205f=_0x252f41['body'][_0x80bf('0x82')]||util['format'](_0x80bf('0x7f'),_0x80bf('0x83'),_0x54cc4d[_0x80bf('0x7e')]);switch(_0x184558['agentIdentifier']){case _0x80bf('0x84'):_0x1b19d4=_0x54cc4d[_0x80bf('0x69')]?util[_0x80bf('0x78')](_0x80bf('0x7f'),_0x184558[_0x80bf('0x80')],_0x54cc4d[_0x80bf('0x69')]):_0x80bf('0x81');break;case'agent_alias':_0x1b19d4=_0x54cc4d[_0x80bf('0x69')]?_0x54cc4d['User'][_0x80bf('0x85')]||_0x54cc4d[_0x80bf('0x7d')][_0x80bf('0x86')]:_0x80bf('0x81');break;case'agent_fullname':_0x1b19d4=_0x54cc4d[_0x80bf('0x69')]?_0x54cc4d[_0x80bf('0x7d')]['fullname']:'System';break;default:_0x1b19d4=_0x54cc4d['UserId']?util[_0x80bf('0x78')](_0x80bf('0x7f'),_0x184558['agentAlias'],_0x54cc4d[_0x80bf('0x69')]):_0x80bf('0x81');}var _0x2612c9=util[_0x80bf('0x78')](_0x80bf('0x87'),moment(_0x54cc4d[_0x80bf('0x88')])[_0x80bf('0x78')](_0x80bf('0x89')),_0x54cc4d[_0x80bf('0x8a')]==='in'?_0x33205f:_0x1b19d4,_0x54cc4d['body']);if(!_0x54cc4d[_0x80bf('0x8b')]){fs['appendFileSync'](_0x2a9f2c,_0x2612c9);}}return db[_0x80bf('0x8c')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x80bf('0x8d')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x80bf('0x8e')],'as':_0x80bf('0x8e'),'raw':!![]}]}]});}}})['then'](function(_0x400c64){if(!_0x400c64||!_0x400c64[_0x80bf('0x8f')]||!_0x252f41['body'])return _0x6663ea;var _0x10cf8d=_0x400c64[_0x80bf('0x90')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x10cf8d,'message':{'from':util[_0x80bf('0x78')](_0x80bf('0x91'),_0x400c64[_0x80bf('0x2e')],_0x400c64[_0x80bf('0x56')]||_0x400c64[_0x80bf('0x8f')][_0x80bf('0x3c')]),'to':_0x252f41[_0x80bf('0x4a')][_0x80bf('0x76')],'subject':_0x80bf('0x92'),'text':util[_0x80bf('0x78')](_0x80bf('0x93'),_0x252f41['body'][_0x80bf('0x76')]),'attachments':[{'path':_0x2a9f2c}]}})[_0x80bf('0x29')](function(){return _0x6663ea;})['catch'](function(_0x25315b){logger[_0x80bf('0x1e')](_0x25315b);});})[_0x80bf('0x29')](respondWithStatusCode(_0xab147a,0xc8))[_0x80bf('0x21')](handleError(_0xab147a,null));};exports[_0x80bf('0x94')]=function(_0x73236f,_0x5abf86){return db[_0x80bf('0x62')][_0x80bf('0x48')]({'where':{'id':_0x73236f[_0x80bf('0x3e')]['id']}})[_0x80bf('0x29')](handleEntityNotFound(_0x5abf86,null))['then'](function(_0x5c531d){if(_0x5c531d){return _0x5c531d['addMessage'](_0x73236f['body'][_0x80bf('0x95')],_[_0x80bf('0x96')](_0x73236f[_0x80bf('0x4a')],[_0x80bf('0x95'),'id'])||{});}})[_0x80bf('0x29')](respondWithResult(_0x5abf86,null))['catch'](handleError(_0x5abf86,null));};exports[_0x80bf('0x97')]=function(_0x178130,_0x1f2d5c){var _0x1ffb69={'raw':![],'where':{}};var _0x3e4053={};var _0x2b0914={'count':0x0,'rows':[]};return db[_0x80bf('0x47')][_0x80bf('0x4e')]({'where':{'id':_0x178130[_0x80bf('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1f2d5c,null))['then'](function(_0x52ef63){if(_0x52ef63){_0x3e4053[_0x80bf('0x3f')]=_[_0x80bf('0x40')](db[_0x80bf('0x62')][_0x80bf('0x37')]);_0x3e4053[_0x80bf('0x3b')]=_[_0x80bf('0x40')](_0x178130[_0x80bf('0x3b')]);_0x3e4053[_0x80bf('0x41')]=_[_0x80bf('0x42')](_0x3e4053['model'],_0x3e4053[_0x80bf('0x3b')]);_0x1ffb69[_0x80bf('0x43')]=_[_0x80bf('0x42')](_0x3e4053[_0x80bf('0x3f')],qs['fields'](_0x178130['query'][_0x80bf('0x44')]));_0x1ffb69[_0x80bf('0x43')]=_0x1ffb69[_0x80bf('0x43')][_0x80bf('0x45')]?_0x1ffb69[_0x80bf('0x43')]:_0x3e4053[_0x80bf('0x3f')];if(!_0x178130[_0x80bf('0x3b')]['hasOwnProperty'](_0x80bf('0x98'))){_0x1ffb69['limit']=qs[_0x80bf('0x24')](_0x178130[_0x80bf('0x3b')]['limit']);_0x1ffb69[_0x80bf('0x26')]=qs[_0x80bf('0x26')](_0x178130[_0x80bf('0x3b')]['offset']);}_0x1ffb69['order']=qs[_0x80bf('0x99')](_0x178130[_0x80bf('0x3b')][_0x80bf('0x99')]);_0x1ffb69[_0x80bf('0x9a')]=qs[_0x80bf('0x41')](_[_0x80bf('0x9b')](_0x178130[_0x80bf('0x3b')],_0x3e4053[_0x80bf('0x41')]));_0x1ffb69[_0x80bf('0x9a')][_0x80bf('0x9c')]=_0x52ef63['id'];if(_0x178130[_0x80bf('0x3b')][_0x80bf('0x9d')]){_0x1ffb69[_0x80bf('0x9a')]=_[_0x80bf('0x31')](_0x1ffb69[_0x80bf('0x9a')],{'$or':_['map'](_0x1ffb69[_0x80bf('0x43')],function(_0x2729f2){var _0x29ed72={};_0x29ed72[_0x2729f2]={'$like':'%'+_0x178130['query']['filter']+'%'};return _0x29ed72;})});}if(_0x178130[_0x80bf('0x3b')]['$gte']){var _0x390b36=_0x178130[_0x80bf('0x3b')]['$gte'][_0x80bf('0x9e')](',');var _0x3d573b={};_0x3d573b[_0x390b36[0x0]]={'$gte':moment(_0x390b36[0x1])['format'](_0x80bf('0x9f'))};_0x1ffb69[_0x80bf('0x9a')]=_[_0x80bf('0x31')](_0x1ffb69[_0x80bf('0x9a')],_0x3d573b);}_0x1ffb69=_[_0x80bf('0x31')]({},_0x1ffb69,_0x178130[_0x80bf('0xa0')]);return db[_0x80bf('0x62')][_0x80bf('0x27')]({'where':_0x1ffb69['where']})[_0x80bf('0x29')](function(_0x4e7c7b){_0x2b0914[_0x80bf('0x27')]=_0x4e7c7b;if(_0x178130[_0x80bf('0x3b')][_0x80bf('0xa1')]){_0x1ffb69[_0x80bf('0x46')]=[{'all':!![]}];}return db[_0x80bf('0x62')][_0x80bf('0x3a')](_0x1ffb69);})[_0x80bf('0x29')](function(_0x4a3153){_0x2b0914[_0x80bf('0xa2')]=_0x4a3153;return _0x2b0914;});}})[_0x80bf('0x29')](respondWithFilteredResult(_0x1f2d5c,_0x1ffb69))['catch'](handleError(_0x1f2d5c,null));};exports[_0x80bf('0xa3')]=function(_0x2c99dd,_0x49494b){var _0x1ebcc5={'where':{}},_0x5beae4={},_0x11544d={'count':0x0,'rows':[]};return db[_0x80bf('0x47')]['findOne']({'where':{'id':_0x2c99dd[_0x80bf('0x3e')]['id']}})['then'](handleEntityNotFound(_0x49494b,null))[_0x80bf('0x29')](function(_0x426664){if(_0x426664){_0x5beae4[_0x80bf('0x3f')]=_[_0x80bf('0x40')](db[_0x80bf('0x62')]['rawAttributes']);_0x5beae4[_0x80bf('0x3b')]=_['keys'](_0x2c99dd[_0x80bf('0x3b')]);_0x5beae4[_0x80bf('0x41')]=_[_0x80bf('0x42')](_0x5beae4[_0x80bf('0x3f')],_0x5beae4[_0x80bf('0x3b')]);_0x1ebcc5[_0x80bf('0x43')]=_[_0x80bf('0x42')](_0x5beae4[_0x80bf('0x3f')],qs[_0x80bf('0x44')](_0x2c99dd['query'][_0x80bf('0x44')]));_0x1ebcc5['attributes']=_0x1ebcc5[_0x80bf('0x43')][_0x80bf('0x45')]?_0x1ebcc5['attributes']:_0x5beae4['model'];if(!_0x2c99dd[_0x80bf('0x3b')]['hasOwnProperty']('nolimit')){_0x1ebcc5[_0x80bf('0x24')]=qs['limit'](_0x2c99dd[_0x80bf('0x3b')][_0x80bf('0x24')]);_0x1ebcc5[_0x80bf('0x26')]=qs[_0x80bf('0x26')](_0x2c99dd['query'][_0x80bf('0x26')]);}_0x1ebcc5[_0x80bf('0xa4')]=qs[_0x80bf('0x99')](_0x2c99dd[_0x80bf('0x3b')][_0x80bf('0x99')]);_0x1ebcc5[_0x80bf('0x9a')]=qs['filters'](_[_0x80bf('0x9b')](_0x2c99dd[_0x80bf('0x3b')],_0x5beae4[_0x80bf('0x41')]));_0x1ebcc5['where'][_0x80bf('0x9c')]=_0x426664['id'];if(_0x2c99dd[_0x80bf('0x3b')]['filter']){_0x1ebcc5[_0x80bf('0x9a')]=_[_0x80bf('0x31')](_0x1ebcc5[_0x80bf('0x9a')],{'$or':_['map'](_0x1ebcc5['attributes'],function(_0x2ecec8){var _0x390579={};_0x390579[_0x2ecec8]={'$like':'%'+_0x2c99dd[_0x80bf('0x3b')][_0x80bf('0x9d')]+'%'};return _0x390579;})});}_0x1ebcc5['where'][_0x80bf('0x8b')]=![];if(_0x2c99dd[_0x80bf('0x3b')]['id']){_0x1ebcc5[_0x80bf('0x9a')]['id']={'$gt':_0x2c99dd[_0x80bf('0x3b')]['id']};}_0x1ebcc5=_[_0x80bf('0x31')]({},_0x1ebcc5,_0x2c99dd[_0x80bf('0xa0')]);return db[_0x80bf('0x62')][_0x80bf('0x27')]({'where':_0x1ebcc5['where']})['then'](function(_0x2a536e){_0x11544d[_0x80bf('0x27')]=_0x2a536e;_0x1ebcc5['include']=[];if(_0x2c99dd[_0x80bf('0x3b')]['includeAgent']){_0x1ebcc5['include']['push']({'model':db[_0x80bf('0x7d')],'as':_0x80bf('0x7d'),'attributes':['id','fullname',_0x80bf('0x85')]});}if(_0x2c99dd['query']['includeAll']){_0x1ebcc5[_0x80bf('0x46')]=[{'all':!![]}];}return db['ChatMessage'][_0x80bf('0x3a')](_0x1ebcc5);})[_0x80bf('0x29')](function(_0x16a966){_0x11544d[_0x80bf('0xa2')]=_0x16a966;return _0x11544d;});}})['then'](respondWithFilteredResult(_0x49494b,_0x1ebcc5))[_0x80bf('0x21')](handleError(_0x49494b,null));};exports[_0x80bf('0xa5')]=function(_0x4fe387,_0x47596b){return db[_0x80bf('0x47')][_0x80bf('0x48')]({'where':{'id':_0x4fe387[_0x80bf('0x3e')]['id']}})[_0x80bf('0x29')](handleEntityNotFound(_0x47596b,null))[_0x80bf('0x29')](function(_0x20bdbc){if(_0x20bdbc){return _0x20bdbc[_0x80bf('0xa6')](_0x4fe387[_0x80bf('0x4a')]['ids'],_[_0x80bf('0x96')](_0x4fe387[_0x80bf('0x4a')],[_0x80bf('0x95'),'id'])||{})[_0x80bf('0xa7')](function(){return db[_0x80bf('0xa8')][_0x80bf('0x3a')]({'attributes':['id',_0x80bf('0x2e'),'color'],'where':{'id':_0x4fe387[_0x80bf('0x4a')][_0x80bf('0x95')]}});})['then'](function(_0xbfda8){socket['emit'](_0x80bf('0xa9'),{'id':Number(_0x4fe387[_0x80bf('0x3e')]['id']),'tags':_0xbfda8||[]});return{'id':Number(_0x4fe387[_0x80bf('0x3e')]['id']),'tags':_0xbfda8||[]};});}})['then'](respondWithResult(_0x47596b,null))[_0x80bf('0x21')](handleError(_0x47596b,null));};exports['removeTags']=function(_0x741922,_0x1769da){return db[_0x80bf('0x47')][_0x80bf('0x48')]({'where':{'id':_0x741922[_0x80bf('0x3e')]['id']}})[_0x80bf('0x29')](handleEntityNotFound(_0x1769da,null))[_0x80bf('0x29')](function(_0x4211d5){if(_0x4211d5){return _0x4211d5[_0x80bf('0xaa')](_0x741922[_0x80bf('0x3b')][_0x80bf('0x95')]);}})[_0x80bf('0x29')](respondWithStatusCode(_0x1769da,null))[_0x80bf('0x21')](handleError(_0x1769da,null));};exports['download']=function(_0x35e31d,_0x1a67d2){var _0x44279a=moment()[_0x80bf('0xab')]()[_0x80bf('0xac')]();var _0x1d3f55=path[_0x80bf('0x75')](config[_0x80bf('0x77')],_0x80bf('0xad'),_0x80bf('0xae'),'tmp');var _0x50c668=path[_0x80bf('0x75')](config[_0x80bf('0x77')],'server',_0x80bf('0xae'),_0x80bf('0xaf'));var _0x342a5f=path[_0x80bf('0x75')](_0x1d3f55,_0x44279a);var _0x1d240e=util['format'](_0x80bf('0xb0'),_0x35e31d[_0x80bf('0x3e')]['id'],_0x44279a);var _0xf78aef=path[_0x80bf('0x75')](_0x1d3f55,_0x1d240e);var _0x484964=[];_0x484964[_0x80bf('0xb1')]({'model':db[_0x80bf('0x7d')],'as':_0x80bf('0x7d'),'attributes':['id','fullname'],'raw':!![]});_0x484964[_0x80bf('0xb1')]({'model':db[_0x80bf('0x66')],'as':'Contact','attributes':['id',_0x80bf('0xb2'),'lastName'],'raw':!![]});if(_0x35e31d[_0x80bf('0x3b')]['attachments']){_0x484964[_0x80bf('0xb1')]({'model':db[_0x80bf('0x71')],'as':_0x80bf('0x71'),'raw':!![]});}var _0x252adf=[{'model':db[_0x80bf('0x62')],'as':_0x80bf('0x7c'),'attributes':['id',_0x80bf('0x4a'),_0x80bf('0x88'),_0x80bf('0x8a'),'secret',_0x80bf('0xb3')],'include':_0x484964}];_0x252adf['push']({'model':db['ChatWebsite'],'as':_0x80bf('0xb4'),'attributes':['id',_0x80bf('0x2e')]});_0x252adf[_0x80bf('0xb1')]({'model':db[_0x80bf('0x7d')],'as':_0x80bf('0xb5'),'attributes':['id','fullname']});return db[_0x80bf('0x47')]['find']({'where':{'id':_0x35e31d[_0x80bf('0x3e')]['id']},'include':_0x252adf})[_0x80bf('0x29')](handleEntityNotFound(_0x1a67d2,null))[_0x80bf('0x29')](function(_0xdf2203){if(_0xdf2203){var _0x4a92a4=_0xdf2203[_0x80bf('0xb6')]({'plain':!![]});fs['mkdirSync'](_0x342a5f);var _0x37217d={'channel':'Chat','account':_0x4a92a4[_0x80bf('0xb4')]['name'],'agent':_0x4a92a4[_0x80bf('0xb5')]?_0x4a92a4[_0x80bf('0xb5')][_0x80bf('0x86')]:_0x80bf('0xb7'),'createdAt':moment(_0x4a92a4['createdAt'])[_0x80bf('0x78')](_0x80bf('0x9f'))[_0x80bf('0xac')](),'closedAt':_0x4a92a4[_0x80bf('0x6a')]?moment(_0x4a92a4[_0x80bf('0xb8')])[_0x80bf('0x78')](_0x80bf('0x9f'))[_0x80bf('0xac')]():'','disposition':_0x4a92a4[_0x80bf('0x6b')],'chatInfo':{'browser':_0x4a92a4[_0x80bf('0xb9')],'os':_0x4a92a4[_0x80bf('0xba')],'referer':_0x4a92a4[_0x80bf('0xbb')],'customerIp':_0x4a92a4['customerIp'],'customerPort':_0x4a92a4[_0x80bf('0xbc')]?_0x4a92a4[_0x80bf('0xbc')]:_0x80bf('0xb7')},'messages':_(_0x4a92a4['Messages'])[_0x80bf('0xbd')]()[_0x80bf('0x9d')]({'secret':![]})[_0x80bf('0x36')](function(_0x512c08){if(_0x512c08[_0x80bf('0x71')]){var _0x4307d7=path['join'](_0x50c668,_0x512c08[_0x80bf('0x71')][_0x80bf('0x6e')]);if(fs[_0x80bf('0xbe')](_0x4307d7)){fs[_0x80bf('0xbf')](_0x4307d7)[_0x80bf('0xc0')](fs['createWriteStream'](path['join'](_0x342a5f,_0x512c08[_0x80bf('0x71')][_0x80bf('0x6e')])));}}return{'date':moment(_0x512c08[_0x80bf('0x88')])[_0x80bf('0x78')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x512c08['direction']===_0x80bf('0x61')?_0x512c08['User']?_0x512c08[_0x80bf('0x7d')][_0x80bf('0x86')]:_0x80bf('0x81'):_0x512c08['Contact'][_0x80bf('0xb2')]+(_0x512c08[_0x80bf('0xc1')][_0x80bf('0xc2')]?'\x20'+_0x512c08[_0x80bf('0xc1')][_0x80bf('0xc2')]:''),'body':_0x512c08[_0x80bf('0x71')]?_0x512c08[_0x80bf('0x71')][_0x80bf('0x6e')]:_0x512c08[_0x80bf('0x4a')],'direction':_0x512c08['direction']===_0x80bf('0x61')?'A':'C','secret':_0x512c08[_0x80bf('0x8b')],'read':_0x512c08[_0x80bf('0xb3')],'attachment':_0x512c08[_0x80bf('0x71')]};})[_0x80bf('0xc3')]()};return ejs[_0x80bf('0xc4')](path['join'](config[_0x80bf('0x77')],_0x80bf('0xad'),_0x80bf('0xc5'),_0x80bf('0xc6')),{'interaction':_0x37217d})[_0x80bf('0x29')](function(_0x30b1e2){var _0x2d99a6=path[_0x80bf('0x75')](_0x342a5f,_0x80bf('0xc7')+_0x4a92a4['id']+'-'+_0x44279a+_0x80bf('0xc8'));var _0x4d5bdc={'path':_0x2d99a6,'channel':_0x80bf('0xc9'),'interactionId':_0x4a92a4['id']};return pdf[_0x80bf('0xca')](_0x30b1e2,_0x4d5bdc);})[_0x80bf('0x29')](function(){return new Promise(function(_0x2df7f8,_0x9bead5){zipdir(_0x342a5f,{'saveTo':_0xf78aef},function(_0x1034d1,_0x2a802f){if(_0x1034d1)return _0x9bead5(_0x1034d1);return _0x2df7f8(_0x2a802f);});})[_0x80bf('0x29')](function(){return new BPromise(function(_0x18d413,_0xdb399e){rimraf(_0x342a5f,function(_0x5ae38e){if(_0x5ae38e)_0xdb399e(_0x5ae38e);return _0x18d413();});});})[_0x80bf('0x29')](function(){return _0x1a67d2[_0x80bf('0xcb')](_0xf78aef,_0x1d240e,function(_0xe80bdb){if(_0xe80bdb){logger['error'](_0x80bf('0xcc'),_0xe80bdb);}else{fs[_0x80bf('0xcd')](_0xf78aef);}});});});}else{return _0x1a67d2[_0x80bf('0x2c')](0xc8);}})[_0x80bf('0x21')](handleError(_0x1a67d2,null));}; \ No newline at end of file +var _0x0821=['lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','client','http','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','destroy','stack','name','render','interaction','account','rawAttributes','type','key','findAll','chat','user','catch','show','params','keys','ChatInteraction','query','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','create','body','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','update','closed','attachmentUpload','originalname','basename','file','filename','attachmentDownload','attachId','ChatOfflineMessageId','root','join','offline-chat/','download','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','ChatWebsite','ContactId','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','alias','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','addMessage','omit','ids','getMessages','nolimit','sort','where','ChatInteractionId','map','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','order','pick','includeAgent','push','rows','setTags','spread','Tag','color','emit','removeTags','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','Account','get','mkdirSync','Chat','Owner','N.A.','toString','disposition','referer','customerIp','customerPort','createReadStream','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','request-promise','moment','bluebird','mustache','util','ejs'];(function(_0x222ea8,_0x158e09){var _0x87ea67=function(_0x4980a9){while(--_0x4980a9){_0x222ea8['push'](_0x222ea8['shift']());}};_0x87ea67(++_0x158e09);}(_0x0821,0x18c));var _0x1082=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x0821[_0x21aec3];return _0x288bbc;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x1082('0x0'));var moment=require(_0x1082('0x1'));var BPromise=require(_0x1082('0x2'));var Mustache=require(_0x1082('0x3'));var util=require(_0x1082('0x4'));var path=require('path');var ejs=require(_0x1082('0x5'));var fs=require('fs');var _=require(_0x1082('0x6'));var Redis=require(_0x1082('0x7'));var interaction=require(_0x1082('0x8'));var qs=require(_0x1082('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0x1082('0xa'))(_0x1082('0xb'));var config=require(_0x1082('0xc'));var db=require(_0x1082('0xd'))['db'];config[_0x1082('0xe')]=_['defaults'](config[_0x1082('0xe')],{'host':_0x1082('0xf'),'port':0x18eb});var socket=require(_0x1082('0x10'))(new Redis(config[_0x1082('0xe')]));require('./chatInteraction.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x1082('0x11')][_0x1082('0x12')]({'port':0x232b});var client9004=jayson[_0x1082('0x11')][_0x1082('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x48370a,_0x24d6ec,_0x924682,_0x30478a){return new BPromise(function(_0x22ae8e,_0x53d2b9){var _0x3bfbdf=_0x30478a||client;return _0x3bfbdf[_0x1082('0x13')](_0x48370a,_0x924682)[_0x1082('0x14')](function(_0x4b1ccb){logger[_0x1082('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x24d6ec,_0x1082('0x16'));logger['debug'](_0x1082('0x17'),_0x24d6ec,_0x1082('0x16'),JSON[_0x1082('0x18')](_0x4b1ccb));if(_0x4b1ccb['error']){if(_0x4b1ccb[_0x1082('0x19')]['code']===0x1f4){logger[_0x1082('0x19')](_0x1082('0x1a'),_0x24d6ec,_0x4b1ccb[_0x1082('0x19')][_0x1082('0x1b')]);return _0x53d2b9(_0x4b1ccb[_0x1082('0x19')][_0x1082('0x1b')]);}logger['error'](_0x1082('0x1a'),_0x24d6ec,_0x4b1ccb['error'][_0x1082('0x1b')]);return _0x22ae8e(_0x4b1ccb[_0x1082('0x19')][_0x1082('0x1b')]);}else{logger[_0x1082('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x24d6ec,'request\x20sent');_0x22ae8e(_0x4b1ccb[_0x1082('0x1c')][_0x1082('0x1b')]);}})['catch'](function(_0x5bf716){logger[_0x1082('0x19')](_0x1082('0x1a'),_0x24d6ec,_0x5bf716);_0x53d2b9(_0x5bf716);});});}function respondWithStatusCode(_0x15356e,_0x403358){_0x403358=_0x403358||0xcc;return function(_0x435751){if(_0x435751){return _0x15356e[_0x1082('0x1d')](_0x403358);}return _0x15356e[_0x1082('0x1e')](_0x403358)[_0x1082('0x1f')]();};}function respondWithResult(_0x2f9c8e,_0x57c969){_0x57c969=_0x57c969||0xc8;return function(_0x1ff541){if(_0x1ff541){return _0x2f9c8e[_0x1082('0x1e')](_0x57c969)[_0x1082('0x20')](_0x1ff541);}};}function respondWithFilteredResult(_0x2fac64,_0x222651){return function(_0x44af4e){if(_0x44af4e){var _0x4569da=typeof _0x222651['offset']===_0x1082('0x21')&&typeof _0x222651[_0x1082('0x22')]===_0x1082('0x21');var _0x54acdc=_0x44af4e[_0x1082('0x23')];var _0x3b77df=_0x4569da?0x0:_0x222651[_0x1082('0x24')];var _0x480a8c=_0x4569da?_0x44af4e[_0x1082('0x23')]:_0x222651[_0x1082('0x24')]+_0x222651['limit'];var _0x217c77;if(_0x480a8c>=_0x54acdc){_0x480a8c=_0x54acdc;_0x217c77=0xc8;}else{_0x217c77=0xce;}_0x2fac64[_0x1082('0x1e')](_0x217c77);return _0x2fac64[_0x1082('0x25')](_0x1082('0x26'),_0x3b77df+'-'+_0x480a8c+'/'+_0x54acdc)[_0x1082('0x20')](_0x44af4e);}return null;};}function saveUpdates(_0x3dd68e){return function(_0x238e79){if(_0x238e79){return _0x238e79['update'](_0x3dd68e)[_0x1082('0x14')](function(_0x2183cc){return _0x2183cc;});}return null;};}function removeEntity(_0x205276){return function(_0xd86efe){if(_0xd86efe){return _0xd86efe[_0x1082('0x27')]()[_0x1082('0x14')](function(){_0x205276[_0x1082('0x1e')](0xcc)[_0x1082('0x1f')]();});}};}function handleEntityNotFound(_0x4aeb07){return function(_0x48a601){if(!_0x48a601){_0x4aeb07[_0x1082('0x1d')](0x194);}return _0x48a601;};}function handleError(_0x2624b2,_0x56e00){_0x56e00=_0x56e00||0x1f4;return function(_0x4e41ca){logger[_0x1082('0x19')](_0x4e41ca[_0x1082('0x28')]);if(_0x4e41ca[_0x1082('0x29')]){delete _0x4e41ca[_0x1082('0x29')];}_0x2624b2[_0x1082('0x1e')](_0x56e00)['send'](_0x4e41ca);};}function getMustacheRender(_0x3c8aec,_0x2b67a1){return Mustache[_0x1082('0x2a')](_0x3c8aec,_['merge'](_0x2b67a1['body'],{'contact':_0x2b67a1['contact'],'message':_0x2b67a1[_0x1082('0x1b')],'agent':_0x2b67a1['agent'],'interaction':_0x2b67a1[_0x1082('0x2b')],'account':_0x2b67a1[_0x1082('0x2c')]}))||'';}exports['index']=function(_0x507cdd,_0x26b0e2){var _0x95c098={};var _0x39642b=_['map'](db['ChatInteraction'][_0x1082('0x2d')],function(_0x1319db){return{'name':_0x1319db['fieldName'],'type':_0x1319db[_0x1082('0x2e')][_0x1082('0x2f')]};});_0x95c098=qs['getOptions'](_0x39642b,_0x507cdd);return interaction[_0x1082('0x30')](_0x1082('0x31'),_0x507cdd['query'],_0x507cdd[_0x1082('0x32')],_0x95c098,_0x39642b)['then'](respondWithFilteredResult(_0x26b0e2,_0x95c098))[_0x1082('0x33')](handleError(_0x26b0e2,null));};exports[_0x1082('0x34')]=function(_0x1c28bd,_0x3341b6){var _0x31bf58={'raw':![],'where':{'id':_0x1c28bd[_0x1082('0x35')]['id']}},_0x51c83b={};_0x51c83b['model']=_[_0x1082('0x36')](db[_0x1082('0x37')][_0x1082('0x2d')]);_0x51c83b[_0x1082('0x38')]=_[_0x1082('0x36')](_0x1c28bd[_0x1082('0x38')]);_0x51c83b[_0x1082('0x39')]=_[_0x1082('0x3a')](_0x51c83b['model'],_0x51c83b[_0x1082('0x38')]);_0x31bf58['attributes']=_[_0x1082('0x3a')](_0x51c83b[_0x1082('0x3b')],qs['fields'](_0x1c28bd[_0x1082('0x38')][_0x1082('0x3c')]));_0x31bf58[_0x1082('0x3d')]=_0x31bf58['attributes'][_0x1082('0x3e')]?_0x31bf58[_0x1082('0x3d')]:_0x51c83b[_0x1082('0x3b')];if(_0x1c28bd[_0x1082('0x38')][_0x1082('0x3f')]){_0x31bf58[_0x1082('0x40')]=[{'all':!![]}];}_0x31bf58=_[_0x1082('0x41')]({},_0x31bf58,_0x1c28bd[_0x1082('0x42')]);return db[_0x1082('0x37')][_0x1082('0x43')](_0x31bf58)[_0x1082('0x14')](handleEntityNotFound(_0x3341b6,null))[_0x1082('0x14')](respondWithResult(_0x3341b6,null))['catch'](handleError(_0x3341b6,null));};exports['create']=function(_0x4a7736,_0x568695){return db['ChatInteraction'][_0x1082('0x44')](_0x4a7736[_0x1082('0x45')],{})[_0x1082('0x14')](respondWithResult(_0x568695,0xc9))['catch'](handleError(_0x568695,null));};exports['update']=function(_0x312c40,_0x580688){if(_0x312c40[_0x1082('0x45')]['id']){delete _0x312c40[_0x1082('0x45')]['id'];}return db[_0x1082('0x37')][_0x1082('0x43')]({'where':{'id':_0x312c40[_0x1082('0x35')]['id']}})[_0x1082('0x14')](handleEntityNotFound(_0x580688,null))[_0x1082('0x14')](saveUpdates(_0x312c40[_0x1082('0x45')],null))[_0x1082('0x14')](respondWithResult(_0x580688,null))[_0x1082('0x33')](handleError(_0x580688,null));};exports[_0x1082('0x27')]=function(_0x19b17f,_0x6b458){return db['ChatInteraction'][_0x1082('0x43')]({'where':{'id':_0x19b17f[_0x1082('0x35')]['id']}})[_0x1082('0x14')](handleEntityNotFound(_0x6b458,null))[_0x1082('0x14')](removeEntity(_0x6b458,null))[_0x1082('0x33')](handleError(_0x6b458,null));};exports[_0x1082('0x46')]=function(_0x1a18a8,_0xecab2b){return db['ChatInteraction'][_0x1082('0x46')]()[_0x1082('0x14')](respondWithResult(_0xecab2b,null))[_0x1082('0x33')](handleError(_0xecab2b,null));};exports[_0x1082('0x47')]=function(_0x57eecc,_0x506c0a){var _0x1eeeeb=_0x57eecc[_0x1082('0x35')]['id'];var _0x12045e;var _0x10ecf7;var _0x18dd8c;return db[_0x1082('0x37')][_0x1082('0x48')]({'where':{'id':_0x1eeeeb}})['then'](function(_0x103f64){_0x12045e=_0x103f64;return db['ChatWebsite'][_0x1082('0x48')]({'where':{'id':_0x103f64[_0x1082('0x49')]},'attributes':['id',_0x1082('0x4a'),_0x1082('0x4b'),'vidaooTopic','vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x1082('0x14')](function(_0x40d1f8){if(_0x40d1f8&&_0x40d1f8[_0x1082('0x4a')]&&_0x40d1f8[_0x1082('0x4b')]){_0x10ecf7=_0x40d1f8;var _0x291946={'interaction':{'id':_0x1eeeeb},'agent':{'id':_0x57eecc[_0x1082('0x32')]['id'],'name':_0x57eecc[_0x1082('0x32')][_0x1082('0x29')],'fullname':_0x57eecc[_0x1082('0x32')][_0x1082('0x4c')],'email':_0x57eecc['user'][_0x1082('0x4d')]},'contact':_0x57eecc[_0x1082('0x45')][_0x1082('0x4e')],'account':_0x57eecc[_0x1082('0x45')][_0x1082('0x2c')]};var _0x2b7ad7={'rejectUnauthorized':![],'method':_0x1082('0x4f'),'url':_0x1082('0x50'),'headers':{'X-APIKEY':_0x40d1f8[_0x1082('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x57eecc[_0x1082('0x32')][_0x1082('0x4d')]],'buttons':null,'topic':_0x10ecf7[_0x1082('0x51')],'note':_[_0x1082('0x52')](_0x10ecf7[_0x1082('0x53')])?null:getMustacheRender(_0x10ecf7[_0x1082('0x53')],_0x291946),'metadata':null},'redirect':_0x1082('0x54'),'json':!![]};try{if(!_['isNull'](_0x10ecf7['vidaooMetadata'])){var _0x384516=getMustacheRender(_0x10ecf7[_0x1082('0x55')],_0x291946);var _0x2e8a46=JSON[_0x1082('0x56')](_0x384516);_0x2b7ad7[_0x1082('0x45')][_0x1082('0x57')]=_0x2e8a46;}}catch(_0x37f4a1){throw new db[(_0x1082('0x58'))][(_0x1082('0x59'))](_0x1082('0x5a'));}return rp(_0x2b7ad7);}else{throw new db['Sequelize'][(_0x1082('0x59'))](_0x1082('0x5b'));}})['then'](function(_0x5ce838){_0x18dd8c=_0x5ce838;if(_0x18dd8c['id']){var _0x2980af={'body':_0x18dd8c[_0x1082('0x5c')],'ChatWebsiteId':_0x10ecf7['id'],'ChatInteractionId':_0x12045e['id'],'direction':_0x1082('0x5d'),'UserId':_0x57eecc[_0x1082('0x32')]['id']};return db[_0x1082('0x5e')][_0x1082('0x44')](_0x2980af,{});}else{throw new db[(_0x1082('0x58'))][(_0x1082('0x59'))](_0x1082('0x5f'));}})[_0x1082('0x14')](function(){return _0x12045e[_0x1082('0x60')]({'vidaooSessionId':_0x18dd8c['id']});})['then'](respondWithResult(_0x506c0a,null))['catch'](handleError(_0x506c0a,null));};exports[_0x1082('0x61')]=function(_0x382373,_0x203971){if(_0x382373[_0x1082('0x45')]['id']){delete _0x382373[_0x1082('0x45')]['id'];}return db['ChatInteraction'][_0x1082('0x43')]({'where':{'id':_0x382373['params']['id']},'include':[{'model':db[_0x1082('0x62')],'as':_0x1082('0x63')}]})[_0x1082('0x14')](handleEntityNotFound(_0x203971,null))['then'](saveUpdates(_0x382373[_0x1082('0x45')],null))[_0x1082('0x14')](respondWithResult(_0x203971,null))[_0x1082('0x33')](handleError(_0x203971,null));};exports[_0x1082('0x64')]=function(_0x9cca3c,_0x175bfe){if(_0x9cca3c[_0x1082('0x45')]['id']){delete _0x9cca3c[_0x1082('0x45')]['id'];}return db['ChatInteraction'][_0x1082('0x43')]({'where':{'id':_0x9cca3c['params']['id']}})['then'](function(_0x13a436){if(!_0x13a436){logger[_0x1082('0x19')](_0x1082('0x65'),_0x1082('0x64'),0x194,_0x1082('0x66'));_0x175bfe[_0x1082('0x1d')](0x194);}else{if(_0x13a436[_0x1082('0x67')]){throw new db[(_0x1082('0x58'))][(_0x1082('0x59'))](_0x1082('0x68'));}}return _0x13a436;})[_0x1082('0x14')](function(_0x17224c){if(_0x17224c){return _0x17224c[_0x1082('0x69')]({'closed':_0x9cca3c[_0x1082('0x45')][_0x1082('0x6a')],'disposition':_0x9cca3c[_0x1082('0x45')]['disposition']})[_0x1082('0x14')](function(_0x5a3556){return _0x5a3556;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x9cca3c[_0x1082('0x45')],client9004);})[_0x1082('0x14')](respondWithResult(_0x175bfe,null))[_0x1082('0x33')](handleError(_0x175bfe,null));};exports[_0x1082('0x6b')]=function(_0x4c99d8,_0x4c3aa6){_0x4c99d8[_0x1082('0x45')][_0x1082('0x29')]=_0x4c99d8['file'][_0x1082('0x6c')];_0x4c99d8['body'][_0x1082('0x6d')]=_0x4c99d8[_0x1082('0x6e')][_0x1082('0x6f')];_0x4c99d8['body'][_0x1082('0x2e')]=_0x4c99d8['file']['mimetype'];return db['Attachment'][_0x1082('0x44')](_0x4c99d8[_0x1082('0x45')])[_0x1082('0x14')](respondWithResult(_0x4c3aa6,0xc9))['catch'](handleError(_0x4c3aa6,null));};exports[_0x1082('0x70')]=function(_0x14ff40,_0x49d751){return db[_0x1082('0x37')]['findOne']({'where':{'id':_0x14ff40[_0x1082('0x35')]['id']},'raw':!![]})[_0x1082('0x14')](handleEntityNotFound(_0x49d751,null))[_0x1082('0x14')](function(_0x53c782){if(_0x53c782){if(_0x53c782[_0x1082('0x6a')]){return _0x49d751['status'](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x1082('0x48')]({'where':{'id':_0x14ff40['query'][_0x1082('0x71')]},'raw':!![]})[_0x1082('0x14')](handleEntityNotFound(_0x49d751,null));}})['then'](function(_0x39dd1e){if(_0x39dd1e){var _0xae79d1=_0x39dd1e[_0x1082('0x72')]!==null;var _0xc15aa2=path['join'](config[_0x1082('0x73')],'server/files/attachments/');if(_0xae79d1){_0xc15aa2=path[_0x1082('0x74')](_0xc15aa2,_0x1082('0x75'));}var _0x51153f=path[_0x1082('0x74')](_0xc15aa2,_0x39dd1e[_0x1082('0x6d')]);return _0x49d751[_0x1082('0x76')](_0x51153f);}})[_0x1082('0x33')](handleError(_0x49d751,null));};exports[_0x1082('0x77')]=function(_0x532263,_0x2fc1d4){var _0x52a14c=null;var _0x3d7918=null;var _0x158933=null;if(_0x532263['body']['id']){delete _0x532263[_0x1082('0x45')]['id'];}if(_0x532263[_0x1082('0x45')]['mailTranscript']){_0x158933=path[_0x1082('0x74')](config[_0x1082('0x73')],_0x1082('0x78'),util[_0x1082('0x79')](_0x1082('0x7a'),Date[_0x1082('0x7b')]()));_0x532263[_0x1082('0x45')][_0x1082('0x7c')]=_0x158933;}return db[_0x1082('0x37')]['find']({'where':{'id':_0x532263['params']['id']},'include':[{'model':db[_0x1082('0x5e')],'as':'Messages','include':[{'model':db[_0x1082('0x7d')],'as':'User'}]}]})[_0x1082('0x14')](handleEntityNotFound(_0x2fc1d4,null))[_0x1082('0x14')](saveUpdates(_0x532263[_0x1082('0x45')],null))[_0x1082('0x14')](function(_0x18b15c){if(_0x18b15c){_0x52a14c=_0x18b15c;return db[_0x1082('0x7e')][_0x1082('0x43')]({'where':{'id':_0x52a14c[_0x1082('0x49')]}});}})[_0x1082('0x14')](function(_0x2a4935){if(_0x2a4935){_0x3d7918=_0x2a4935;return db['CmContact'][_0x1082('0x43')]({'where':{'id':_0x52a14c[_0x1082('0x7f')]}});}})[_0x1082('0x14')](function(_0x194232){if(_0x194232){if(_0x158933){var _0x445337=null;for(var _0x2b974a=0x1;_0x2b974a<_0x52a14c[_0x1082('0x80')][_0x1082('0x3e')];++_0x2b974a){_0x445337=_0x52a14c[_0x1082('0x80')][_0x2b974a];var _0x3a6327=_0x445337[_0x1082('0x67')]?util[_0x1082('0x79')](_0x1082('0x81'),_0x3d7918[_0x1082('0x82')],_0x445337[_0x1082('0x67')]):_0x1082('0x83');var _0x171e20=_0x532263['body'][_0x1082('0x84')]||util[_0x1082('0x79')]('%s%d',_0x1082('0x85'),_0x445337['ContactId']);switch(_0x3d7918[_0x1082('0x86')]){case _0x1082('0x87'):_0x3a6327=_0x445337[_0x1082('0x67')]?util[_0x1082('0x79')](_0x1082('0x81'),_0x3d7918[_0x1082('0x82')],_0x445337[_0x1082('0x67')]):_0x1082('0x83');break;case'agent_alias':_0x3a6327=_0x445337[_0x1082('0x67')]?_0x445337['User'][_0x1082('0x88')]||_0x445337['User'][_0x1082('0x4c')]:'System';break;case'agent_fullname':_0x3a6327=_0x445337[_0x1082('0x67')]?_0x445337['User']['fullname']:_0x1082('0x83');break;default:_0x3a6327=_0x445337[_0x1082('0x67')]?util[_0x1082('0x79')]('%s%d',_0x3d7918['agentAlias'],_0x445337['UserId']):_0x1082('0x83');}var _0x39ce62=util[_0x1082('0x79')]('[%s]\x20%s:\x20%s\x0a',moment(_0x445337[_0x1082('0x89')])[_0x1082('0x79')](_0x1082('0x8a')),_0x445337[_0x1082('0x8b')]==='in'?_0x171e20:_0x3a6327,_0x445337[_0x1082('0x45')]);if(!_0x445337[_0x1082('0x8c')]){fs[_0x1082('0x8d')](_0x158933,_0x39ce62);}}return db['MailAccount'][_0x1082('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0x1082('0x8e')],'as':_0x1082('0x8f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x1082('0x14')](function(_0x3725d3){if(!_0x3725d3||!_0x3725d3[_0x1082('0x8f')]||!_0x532263[_0x1082('0x45')])return _0x52a14c;var _0x180b76=_0x3725d3[_0x1082('0x90')]();return respondWithRpcPromise(_0x1082('0x91'),_0x1082('0x92'),{'account':_0x180b76,'message':{'from':util[_0x1082('0x79')](_0x1082('0x93'),_0x3725d3[_0x1082('0x29')],_0x3725d3[_0x1082('0x4d')]||_0x3725d3[_0x1082('0x8f')][_0x1082('0x32')]),'to':_0x532263[_0x1082('0x45')][_0x1082('0x94')],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x532263[_0x1082('0x45')][_0x1082('0x94')]),'attachments':[{'path':_0x158933}]}})[_0x1082('0x14')](function(){return _0x52a14c;})[_0x1082('0x33')](function(_0x5d1df0){logger[_0x1082('0x19')](_0x5d1df0);});})[_0x1082('0x14')](respondWithStatusCode(_0x2fc1d4,0xc8))[_0x1082('0x33')](handleError(_0x2fc1d4,null));};exports[_0x1082('0x95')]=function(_0x4c9a20,_0x221130){return db[_0x1082('0x5e')][_0x1082('0x43')]({'where':{'id':_0x4c9a20[_0x1082('0x35')]['id']}})[_0x1082('0x14')](handleEntityNotFound(_0x221130,null))[_0x1082('0x14')](function(_0x9bbd16){if(_0x9bbd16){return _0x9bbd16[_0x1082('0x95')](_0x4c9a20[_0x1082('0x45')]['ids'],_[_0x1082('0x96')](_0x4c9a20[_0x1082('0x45')],[_0x1082('0x97'),'id'])||{});}})[_0x1082('0x14')](respondWithResult(_0x221130,null))[_0x1082('0x33')](handleError(_0x221130,null));};exports[_0x1082('0x98')]=function(_0x38fd54,_0x1cbd09){var _0x5507f2={'raw':![],'where':{}};var _0x311887={};var _0x2d12a5={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x1082('0x48')]({'where':{'id':_0x38fd54[_0x1082('0x35')]['id']}})['then'](handleEntityNotFound(_0x1cbd09,null))['then'](function(_0x39bf38){if(_0x39bf38){_0x311887[_0x1082('0x3b')]=_['keys'](db['ChatMessage'][_0x1082('0x2d')]);_0x311887[_0x1082('0x38')]=_[_0x1082('0x36')](_0x38fd54[_0x1082('0x38')]);_0x311887[_0x1082('0x39')]=_['intersection'](_0x311887['model'],_0x311887[_0x1082('0x38')]);_0x5507f2[_0x1082('0x3d')]=_['intersection'](_0x311887[_0x1082('0x3b')],qs[_0x1082('0x3c')](_0x38fd54[_0x1082('0x38')][_0x1082('0x3c')]));_0x5507f2['attributes']=_0x5507f2[_0x1082('0x3d')][_0x1082('0x3e')]?_0x5507f2[_0x1082('0x3d')]:_0x311887[_0x1082('0x3b')];if(!_0x38fd54['query']['hasOwnProperty'](_0x1082('0x99'))){_0x5507f2[_0x1082('0x22')]=qs[_0x1082('0x22')](_0x38fd54[_0x1082('0x38')][_0x1082('0x22')]);_0x5507f2[_0x1082('0x24')]=qs[_0x1082('0x24')](_0x38fd54[_0x1082('0x38')][_0x1082('0x24')]);}_0x5507f2['order']=qs[_0x1082('0x9a')](_0x38fd54[_0x1082('0x38')][_0x1082('0x9a')]);_0x5507f2['where']=qs[_0x1082('0x39')](_['pick'](_0x38fd54[_0x1082('0x38')],_0x311887[_0x1082('0x39')]));_0x5507f2[_0x1082('0x9b')][_0x1082('0x9c')]=_0x39bf38['id'];if(_0x38fd54[_0x1082('0x38')]['filter']){_0x5507f2['where']=_['merge'](_0x5507f2[_0x1082('0x9b')],{'$or':_[_0x1082('0x9d')](_0x5507f2[_0x1082('0x3d')],function(_0x18f161){var _0xa50185={};_0xa50185[_0x18f161]={'$like':'%'+_0x38fd54[_0x1082('0x38')][_0x1082('0x9e')]+'%'};return _0xa50185;})});}if(_0x38fd54[_0x1082('0x38')]['$gte']){var _0x3fa43a=_0x38fd54[_0x1082('0x38')][_0x1082('0x9f')][_0x1082('0xa0')](',');var _0x526339={};_0x526339[_0x3fa43a[0x0]]={'$gte':moment(_0x3fa43a[0x1])['format'](_0x1082('0xa1'))};_0x5507f2[_0x1082('0x9b')]=_[_0x1082('0x41')](_0x5507f2[_0x1082('0x9b')],_0x526339);}_0x5507f2=_['merge']({},_0x5507f2,_0x38fd54[_0x1082('0x42')]);return db[_0x1082('0x5e')][_0x1082('0x23')]({'where':_0x5507f2[_0x1082('0x9b')]})[_0x1082('0x14')](function(_0x8c22a7){_0x2d12a5[_0x1082('0x23')]=_0x8c22a7;if(_0x38fd54[_0x1082('0x38')][_0x1082('0x3f')]){_0x5507f2[_0x1082('0x40')]=[{'all':!![]}];}return db[_0x1082('0x5e')][_0x1082('0x30')](_0x5507f2);})[_0x1082('0x14')](function(_0x4d3378){_0x2d12a5['rows']=_0x4d3378;return _0x2d12a5;});}})['then'](respondWithFilteredResult(_0x1cbd09,_0x5507f2))[_0x1082('0x33')](handleError(_0x1cbd09,null));};exports['getMyMessages']=function(_0x246ef7,_0x5eb379){var _0x749bbc={'where':{}},_0x472beb={},_0x4b7b4e={'count':0x0,'rows':[]};return db[_0x1082('0x37')][_0x1082('0x48')]({'where':{'id':_0x246ef7[_0x1082('0x35')]['id']}})[_0x1082('0x14')](handleEntityNotFound(_0x5eb379,null))['then'](function(_0x446019){if(_0x446019){_0x472beb['model']=_[_0x1082('0x36')](db['ChatMessage']['rawAttributes']);_0x472beb[_0x1082('0x38')]=_[_0x1082('0x36')](_0x246ef7['query']);_0x472beb[_0x1082('0x39')]=_[_0x1082('0x3a')](_0x472beb[_0x1082('0x3b')],_0x472beb[_0x1082('0x38')]);_0x749bbc[_0x1082('0x3d')]=_['intersection'](_0x472beb[_0x1082('0x3b')],qs[_0x1082('0x3c')](_0x246ef7[_0x1082('0x38')][_0x1082('0x3c')]));_0x749bbc[_0x1082('0x3d')]=_0x749bbc[_0x1082('0x3d')][_0x1082('0x3e')]?_0x749bbc[_0x1082('0x3d')]:_0x472beb[_0x1082('0x3b')];if(!_0x246ef7['query'][_0x1082('0xa2')](_0x1082('0x99'))){_0x749bbc[_0x1082('0x22')]=qs['limit'](_0x246ef7[_0x1082('0x38')][_0x1082('0x22')]);_0x749bbc[_0x1082('0x24')]=qs['offset'](_0x246ef7['query'][_0x1082('0x24')]);}_0x749bbc[_0x1082('0xa3')]=qs[_0x1082('0x9a')](_0x246ef7[_0x1082('0x38')][_0x1082('0x9a')]);_0x749bbc['where']=qs[_0x1082('0x39')](_[_0x1082('0xa4')](_0x246ef7[_0x1082('0x38')],_0x472beb['filters']));_0x749bbc[_0x1082('0x9b')][_0x1082('0x9c')]=_0x446019['id'];if(_0x246ef7[_0x1082('0x38')][_0x1082('0x9e')]){_0x749bbc['where']=_[_0x1082('0x41')](_0x749bbc[_0x1082('0x9b')],{'$or':_[_0x1082('0x9d')](_0x749bbc[_0x1082('0x3d')],function(_0xe84e7f){var _0x5be055={};_0x5be055[_0xe84e7f]={'$like':'%'+_0x246ef7[_0x1082('0x38')][_0x1082('0x9e')]+'%'};return _0x5be055;})});}_0x749bbc['where']['secret']=![];if(_0x246ef7[_0x1082('0x38')]['id']){_0x749bbc['where']['id']={'$gt':_0x246ef7[_0x1082('0x38')]['id']};}_0x749bbc=_[_0x1082('0x41')]({},_0x749bbc,_0x246ef7[_0x1082('0x42')]);return db[_0x1082('0x5e')][_0x1082('0x23')]({'where':_0x749bbc[_0x1082('0x9b')]})[_0x1082('0x14')](function(_0x520e30){_0x4b7b4e[_0x1082('0x23')]=_0x520e30;_0x749bbc['include']=[];if(_0x246ef7[_0x1082('0x38')][_0x1082('0xa5')]){_0x749bbc[_0x1082('0x40')][_0x1082('0xa6')]({'model':db[_0x1082('0x7d')],'as':_0x1082('0x7d'),'attributes':['id',_0x1082('0x4c'),_0x1082('0x88')]});}if(_0x246ef7['query'][_0x1082('0x3f')]){_0x749bbc['include']=[{'all':!![]}];}return db[_0x1082('0x5e')]['findAll'](_0x749bbc);})[_0x1082('0x14')](function(_0x65e73c){_0x4b7b4e[_0x1082('0xa7')]=_0x65e73c;return _0x4b7b4e;});}})[_0x1082('0x14')](respondWithFilteredResult(_0x5eb379,_0x749bbc))['catch'](handleError(_0x5eb379,null));};exports['addTags']=function(_0x640657,_0x2cccbf){return db['ChatInteraction'][_0x1082('0x43')]({'where':{'id':_0x640657[_0x1082('0x35')]['id']}})[_0x1082('0x14')](handleEntityNotFound(_0x2cccbf,null))['then'](function(_0x15c8c0){if(_0x15c8c0){return _0x15c8c0[_0x1082('0xa8')](_0x640657[_0x1082('0x45')][_0x1082('0x97')],_['omit'](_0x640657[_0x1082('0x45')],[_0x1082('0x97'),'id'])||{})[_0x1082('0xa9')](function(){return db[_0x1082('0xaa')][_0x1082('0x30')]({'attributes':['id','name',_0x1082('0xab')],'where':{'id':_0x640657[_0x1082('0x45')]['ids']}});})[_0x1082('0x14')](function(_0x50cb31){socket[_0x1082('0xac')]('chatInteractionTags:save',{'id':Number(_0x640657[_0x1082('0x35')]['id']),'tags':_0x50cb31||[]});return{'id':Number(_0x640657[_0x1082('0x35')]['id']),'tags':_0x50cb31||[]};});}})[_0x1082('0x14')](respondWithResult(_0x2cccbf,null))[_0x1082('0x33')](handleError(_0x2cccbf,null));};exports[_0x1082('0xad')]=function(_0xea1767,_0x2e7fd8){return db['ChatInteraction'][_0x1082('0x43')]({'where':{'id':_0xea1767['params']['id']}})[_0x1082('0x14')](handleEntityNotFound(_0x2e7fd8,null))[_0x1082('0x14')](function(_0x5b9952){if(_0x5b9952){return _0x5b9952[_0x1082('0xad')](_0xea1767[_0x1082('0x38')][_0x1082('0x97')]);}})['then'](respondWithStatusCode(_0x2e7fd8,null))[_0x1082('0x33')](handleError(_0x2e7fd8,null));};exports['download']=function(_0x59ed17,_0x14e8aa){var _0x20fff5=moment()['unix']()['toString']();var _0x5dfba8=path[_0x1082('0x74')](config[_0x1082('0x73')],_0x1082('0xae'),_0x1082('0xaf'),'tmp');var _0x25138e=path[_0x1082('0x74')](config[_0x1082('0x73')],_0x1082('0xae'),_0x1082('0xaf'),_0x1082('0xb0'));var _0x2d40fb=path[_0x1082('0x74')](_0x5dfba8,_0x20fff5);var _0x2f3d94=util[_0x1082('0x79')](_0x1082('0xb1'),_0x59ed17[_0x1082('0x35')]['id'],_0x20fff5);var _0xf57dd5=path['join'](_0x5dfba8,_0x2f3d94);var _0x45c0d1=[];_0x45c0d1[_0x1082('0xa6')]({'model':db[_0x1082('0x7d')],'as':_0x1082('0x7d'),'attributes':['id',_0x1082('0x4c')],'raw':!![]});_0x45c0d1['push']({'model':db[_0x1082('0x62')],'as':'Contact','attributes':['id',_0x1082('0xb2'),_0x1082('0xb3')],'raw':!![]});if(_0x59ed17[_0x1082('0x38')][_0x1082('0xb0')]){_0x45c0d1[_0x1082('0xa6')]({'model':db[_0x1082('0xb4')],'as':_0x1082('0xb4'),'raw':!![]});}var _0x395e02=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0x1082('0x45'),'createdAt',_0x1082('0x8b'),_0x1082('0x8c'),'read'],'include':_0x45c0d1}];_0x395e02['push']({'model':db[_0x1082('0x7e')],'as':_0x1082('0xb5'),'attributes':['id',_0x1082('0x29')]});_0x395e02[_0x1082('0xa6')]({'model':db[_0x1082('0x7d')],'as':'Owner','attributes':['id',_0x1082('0x4c')]});return db['ChatInteraction']['find']({'where':{'id':_0x59ed17[_0x1082('0x35')]['id']},'include':_0x395e02})['then'](handleEntityNotFound(_0x14e8aa,null))['then'](function(_0x478644){if(_0x478644){var _0x3a0477=_0x478644[_0x1082('0xb6')]({'plain':!![]});fs[_0x1082('0xb7')](_0x2d40fb);var _0x341e9d={'channel':_0x1082('0xb8'),'account':_0x3a0477[_0x1082('0xb5')][_0x1082('0x29')],'agent':_0x3a0477[_0x1082('0xb9')]?_0x3a0477[_0x1082('0xb9')]['fullname']:_0x1082('0xba'),'createdAt':moment(_0x3a0477[_0x1082('0x89')])[_0x1082('0x79')](_0x1082('0xa1'))[_0x1082('0xbb')](),'closedAt':_0x3a0477[_0x1082('0x6a')]?moment(_0x3a0477['closedAt'])['format'](_0x1082('0xa1'))['toString']():'','disposition':_0x3a0477[_0x1082('0xbc')],'chatInfo':{'browser':_0x3a0477['browserName'],'os':_0x3a0477['osName'],'referer':_0x3a0477[_0x1082('0xbd')],'customerIp':_0x3a0477[_0x1082('0xbe')],'customerPort':_0x3a0477['customerPort']?_0x3a0477[_0x1082('0xbf')]:_0x1082('0xba')},'messages':_(_0x3a0477[_0x1082('0x80')])['tail']()[_0x1082('0x9e')]({'secret':![]})[_0x1082('0x9d')](function(_0x5a23df){if(_0x5a23df[_0x1082('0xb4')]){var _0x4f0452=path[_0x1082('0x74')](_0x25138e,_0x5a23df[_0x1082('0xb4')][_0x1082('0x6d')]);if(fs['existsSync'](_0x4f0452)){fs[_0x1082('0xc0')](_0x4f0452)['pipe'](fs[_0x1082('0xc1')](path[_0x1082('0x74')](_0x2d40fb,_0x5a23df[_0x1082('0xb4')][_0x1082('0x6d')])));}}return{'date':moment(_0x5a23df[_0x1082('0x89')])[_0x1082('0x79')](_0x1082('0xa1'))['toString'](),'sender':_0x5a23df[_0x1082('0x8b')]==='out'?_0x5a23df[_0x1082('0x7d')]?_0x5a23df[_0x1082('0x7d')][_0x1082('0x4c')]:'System':_0x5a23df[_0x1082('0x63')][_0x1082('0xb2')]+(_0x5a23df['Contact'][_0x1082('0xb3')]?'\x20'+_0x5a23df[_0x1082('0x63')][_0x1082('0xb3')]:''),'body':_0x5a23df[_0x1082('0xb4')]?_0x5a23df[_0x1082('0xb4')][_0x1082('0x6d')]:_0x5a23df['body'],'direction':_0x5a23df[_0x1082('0x8b')]===_0x1082('0x5d')?'A':'C','secret':_0x5a23df['secret'],'read':_0x5a23df['read'],'attachment':_0x5a23df[_0x1082('0xb4')]};})[_0x1082('0xc2')]()};return ejs[_0x1082('0xc3')](path[_0x1082('0x74')](config[_0x1082('0x73')],_0x1082('0xae'),_0x1082('0xc4'),_0x1082('0xc5')),{'interaction':_0x341e9d})['then'](function(_0x2c1b14){var _0x272671=path[_0x1082('0x74')](_0x2d40fb,_0x1082('0xc6')+_0x3a0477['id']+'-'+_0x20fff5+_0x1082('0xc7'));var _0x1a5968={'path':_0x272671,'channel':_0x1082('0xb8'),'interactionId':_0x3a0477['id']};return pdf['createPdfFromHTML'](_0x2c1b14,_0x1a5968);})[_0x1082('0x14')](function(){return new Promise(function(_0x3ecf5e,_0x3cf2f6){zipdir(_0x2d40fb,{'saveTo':_0xf57dd5},function(_0x46e8b2,_0x44ac1a){if(_0x46e8b2)return _0x3cf2f6(_0x46e8b2);return _0x3ecf5e(_0x44ac1a);});})[_0x1082('0x14')](function(){return new BPromise(function(_0x439d32,_0x27c06c){rimraf(_0x2d40fb,function(_0x54bd84){if(_0x54bd84)_0x27c06c(_0x54bd84);return _0x439d32();});});})[_0x1082('0x14')](function(){return _0x14e8aa['download'](_0xf57dd5,_0x2f3d94,function(_0x2dfba6){if(_0x2dfba6){logger[_0x1082('0x19')](_0x1082('0xc8'),_0x2dfba6);}else{fs['unlinkSync'](_0xf57dd5);}});});});}else{return _0x14e8aa['sendStatus'](0xc8);}})[_0x1082('0x33')](handleError(_0x14e8aa,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 9a765b9..fa880b4 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 _0xd565=['setMaxListeners','update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hook','events','../../mysqldb','ChatMessage'];(function(_0x3a3a0f,_0x5e593b){var _0x187329=function(_0x1ae169){while(--_0x1ae169){_0x3a3a0f['push'](_0x3a3a0f['shift']());}};_0x187329(++_0x5e593b);}(_0xd565,0xde));var _0x5d56=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd565[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x5d56('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x5d56('0x1'))['db'][_0x5d56('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5d56('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5d56('0x4'),'afterDestroy':_0x5d56('0x5')};function emitEvent(_0x3ce883){return function(_0x2cd9fc,_0x42f7ec,_0x1176e1){_0x2cd9fc[_0x5d56('0x6')]({'attributes':['id'],'raw':!![]})[_0x5d56('0x7')](function(_0x5de4e0){_0x2cd9fc[_0x5d56('0x8')](_0x5d56('0x9'),_0x5de4e0['map'](function(_0xcdcdc9){return{'id':_0xcdcdc9['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2cd9fc['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5d56('0x7')](function(_0xe87493){_0x2cd9fc[_0x5d56('0x8')](_0x5d56('0xa'),_0xe87493[_0x5d56('0xb')]);ChatInteractionEvents['emit'](_0x3ce883+':'+_0x2cd9fc['id'],_0x2cd9fc);ChatInteractionEvents[_0x5d56('0xc')](_0x3ce883,_0x2cd9fc);_0x1176e1(null);})[_0x5d56('0xd')](_0x1176e1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x5d56('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x84cb=['setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','then'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x84cb,0x1b8));var _0xb84c=function(_0x3d494e,_0x332f20){_0x3d494e=_0x3d494e-0x0;var _0x2081bb=_0x84cb[_0x3d494e];return _0x2081bb;};'use strict';var EventEmitter=require(_0xb84c('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xb84c('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0xb84c('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb84c('0x3')](0x0);var events={'afterCreate':_0xb84c('0x4'),'afterUpdate':_0xb84c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2d0e37){return function(_0x19090b,_0x190119,_0x3debbf){_0x19090b[_0xb84c('0x6')]({'attributes':['id'],'raw':!![]})[_0xb84c('0x7')](function(_0x5d7a0c){_0x19090b[_0xb84c('0x8')](_0xb84c('0x9'),_0x5d7a0c['map'](function(_0x5076fe){return{'id':_0x5076fe['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x19090b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb84c('0x7')](function(_0x4446cf){_0x19090b[_0xb84c('0x8')](_0xb84c('0xa'),_0x4446cf[_0xb84c('0xb')]);ChatInteractionEvents['emit'](_0x2d0e37+':'+_0x19090b['id'],_0x19090b);ChatInteractionEvents[_0xb84c('0xc')](_0x2d0e37,_0x19090b);_0x3debbf(null);})[_0xb84c('0xd')](_0x3debbf(null));};}for(var e in events){if(events[_0xb84c('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xb84c('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 5f46650..57922c9 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 _0x2191=['exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','lodash','../../config/logger','api','moment','../../config/environment','./chatInteraction.attributes'];(function(_0x1bb184,_0xed6071){var _0x4ea894=function(_0x2a9f85){while(--_0x2a9f85){_0x1bb184['push'](_0x1bb184['shift']());}};_0x4ea894(++_0xed6071);}(_0x2191,0x78));var _0x1219=function(_0x2adf0a,_0x40e60c){_0x2adf0a=_0x2adf0a-0x0;var _0x1effd4=_0x2191[_0x2adf0a];return _0x1effd4;};'use strict';var _=require(_0x1219('0x0'));var util=require('util');var logger=require(_0x1219('0x1'))(_0x1219('0x2'));var moment=require(_0x1219('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1219('0x4'));var attributes=require(_0x1219('0x5'));module[_0x1219('0x6')]=function(_0x59c185,_0x2f2aca){return _0x59c185[_0x1219('0x7')](_0x1219('0x8'),attributes,{'tableName':_0x1219('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a0c90,_0x4a7c25,_0x150aab){if(_0x1a0c90[_0x1219('0xa')](_0x1219('0xb'))){_0x1a0c90[_0x1219('0xc')]=moment()[_0x1219('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x150aab(null,_0x1a0c90);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2bb2=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x2bb2,0x190));var _0x22bb=function(_0x19b64b,_0x176efb){_0x19b64b=_0x19b64b-0x0;var _0x28d4a4=_0x2bb2[_0x19b64b];return _0x28d4a4;};'use strict';var _=require(_0x22bb('0x0'));var util=require(_0x22bb('0x1'));var logger=require(_0x22bb('0x2'))(_0x22bb('0x3'));var moment=require(_0x22bb('0x4'));var BPromise=require('bluebird');var rp=require(_0x22bb('0x5'));var fs=require('fs');var path=require(_0x22bb('0x6'));var rimraf=require(_0x22bb('0x7'));var config=require(_0x22bb('0x8'));var attributes=require(_0x22bb('0x9'));module[_0x22bb('0xa')]=function(_0x6e0e50,_0x3bbc14){return _0x6e0e50[_0x22bb('0xb')]('ChatInteraction',attributes,{'tableName':_0x22bb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2eb1b8,_0x20eca5,_0xf2b543){if(_0x2eb1b8[_0x22bb('0xd')](_0x22bb('0xe'))){_0x2eb1b8[_0x22bb('0xf')]=moment()[_0x22bb('0x10')](_0x22bb('0x11'));}_0xf2b543(null,_0x2eb1b8);}},'charset':'utf8mb4','collate':_0x22bb('0x12')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 422b345..becf8fa 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 _0x8a51=['redis','localhost','socket.io-emitter','./chatInteraction.socket','register','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','UpdateChatInteraction','update','options','raw','where','attributes','limit','then','AddTagsToChatInteraction','ChatInteraction','addTags','body','ids','omit','AddTags','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x11a7e4,_0x365992){var _0x1085b6=function(_0x458109){while(--_0x458109){_0x11a7e4['push'](_0x11a7e4['shift']());}};_0x1085b6(++_0x365992);}(_0x8a51,0xcf));var _0x18a5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x8a51[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x18a5('0x0'));var util=require('util');var moment=require(_0x18a5('0x1'));var BPromise=require(_0x18a5('0x2'));var rs=require(_0x18a5('0x3'));var fs=require('fs');var Redis=require(_0x18a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x18a5('0x5'));var logger=require(_0x18a5('0x6'))(_0x18a5('0x7'));var config=require(_0x18a5('0x8'));var jayson=require(_0x18a5('0x9'));var client=jayson[_0x18a5('0xa')][_0x18a5('0xb')]({'port':0x232a});config['redis']=_[_0x18a5('0xc')](config[_0x18a5('0xd')],{'host':_0x18a5('0xe'),'port':0x18eb});var socket=require(_0x18a5('0xf'))(new Redis(config[_0x18a5('0xd')]));require(_0x18a5('0x10'))[_0x18a5('0x11')](socket);function respondWithRpcPromise(_0xaabfa7,_0xbc2b29,_0x2c05ec){return new BPromise(function(_0x1152af,_0x28aabb){return client['request'](_0xaabfa7,_0x2c05ec)['then'](function(_0x3be47c){logger[_0x18a5('0x12')](_0x18a5('0x13'),_0xbc2b29,'request\x20sent');logger[_0x18a5('0x14')](_0x18a5('0x15'),_0xbc2b29,'request\x20sent',JSON['stringify'](_0x3be47c));if(_0x3be47c[_0x18a5('0x16')]){if(_0x3be47c['error'][_0x18a5('0x17')]===0x1f4){logger[_0x18a5('0x16')]('ChatInteraction,\x20%s,\x20%s',_0xbc2b29,_0x3be47c[_0x18a5('0x16')]['message']);return _0x28aabb(_0x3be47c[_0x18a5('0x16')]['message']);}logger[_0x18a5('0x16')](_0x18a5('0x13'),_0xbc2b29,_0x3be47c[_0x18a5('0x16')][_0x18a5('0x18')]);return _0x1152af(_0x3be47c['error']['message']);}else{logger[_0x18a5('0x12')](_0x18a5('0x13'),_0xbc2b29,_0x18a5('0x19'));_0x1152af(_0x3be47c[_0x18a5('0x1a')][_0x18a5('0x18')]);}})[_0x18a5('0x1b')](function(_0x52f6a6){logger[_0x18a5('0x16')](_0x18a5('0x13'),_0xbc2b29,_0x52f6a6);_0x28aabb(_0x52f6a6);});});}exports[_0x18a5('0x1c')]=function(_0x209760){var _0x2f5f94=this;return new Promise(function(_0x4e01e5,_0x171d38){return db['ChatInteraction'][_0x18a5('0x1d')](_0x209760['body'],{'raw':_0x209760[_0x18a5('0x1e')]?_0x209760[_0x18a5('0x1e')][_0x18a5('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x209760['options']?_0x209760[_0x18a5('0x1e')][_0x18a5('0x20')]||null:null,'attributes':_0x209760[_0x18a5('0x1e')]?_0x209760['options'][_0x18a5('0x21')]||null:null,'limit':_0x209760[_0x18a5('0x1e')]?_0x209760[_0x18a5('0x1e')][_0x18a5('0x22')]||null:null})[_0x18a5('0x23')](function(_0x4342eb){logger[_0x18a5('0x12')](_0x18a5('0x1c'),_0x209760);logger[_0x18a5('0x14')](_0x18a5('0x1c'),_0x209760,JSON['stringify'](_0x4342eb));_0x4e01e5(_0x4342eb);})[_0x18a5('0x1b')](function(_0x3692ce){logger[_0x18a5('0x16')](_0x18a5('0x1c'),_0x3692ce[_0x18a5('0x18')],_0x209760);_0x171d38(_0x2f5f94['error'](0x1f4,_0x3692ce[_0x18a5('0x18')]));});});};exports[_0x18a5('0x24')]=function(_0x345bd4){return new Promise(function(_0x488a97,_0x52400a){return db[_0x18a5('0x25')]['find']({'where':_0x345bd4['options']?_0x345bd4[_0x18a5('0x1e')][_0x18a5('0x20')]||null:null})[_0x18a5('0x23')](function(_0x5380fa){if(_0x5380fa){return _0x5380fa[_0x18a5('0x26')](_0x345bd4[_0x18a5('0x27')][_0x18a5('0x28')],_[_0x18a5('0x29')](_0x345bd4['body'],[_0x18a5('0x28'),'id'])||{});}})['spread'](function(_0xee15d2){logger[_0x18a5('0x12')](_0x18a5('0x2a'),_0x345bd4);logger[_0x18a5('0x14')](_0x18a5('0x2a'),_0x345bd4,JSON[_0x18a5('0x2b')](_0xee15d2));_0x488a97(_0xee15d2);})[_0x18a5('0x1b')](function(_0x3a6f15){logger[_0x18a5('0x16')](_0x18a5('0x2a'),_0x3a6f15[_0x18a5('0x18')],_0x345bd4);_0x52400a(_this['error'](0x1f4,_0x3a6f15[_0x18a5('0x18')]));});});}; \ No newline at end of file +var _0x6019=['where','limit','info','stringify','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw'];(function(_0x422890,_0x434494){var _0x202cf0=function(_0x10e9f0){while(--_0x10e9f0){_0x422890['push'](_0x422890['shift']());}};_0x202cf0(++_0x434494);}(_0x6019,0x18d));var _0x9601=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6019[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x9601('0x0'));var moment=require(_0x9601('0x1'));var BPromise=require(_0x9601('0x2'));var rs=require(_0x9601('0x3'));var fs=require('fs');var Redis=require(_0x9601('0x4'));var db=require(_0x9601('0x5'))['db'];var utils=require(_0x9601('0x6'));var logger=require('../../config/logger')(_0x9601('0x7'));var config=require(_0x9601('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9601('0x9')][_0x9601('0xa')]({'port':0x232a});config[_0x9601('0xb')]=_[_0x9601('0xc')](config['redis'],{'host':_0x9601('0xd'),'port':0x18eb});var socket=require(_0x9601('0xe'))(new Redis(config[_0x9601('0xb')]));require('./chatInteraction.socket')[_0x9601('0xf')](socket);function respondWithRpcPromise(_0x49255b,_0x5cd4d1,_0x358fc7){return new BPromise(function(_0x93661e,_0x28e60e){return client[_0x9601('0x10')](_0x49255b,_0x358fc7)[_0x9601('0x11')](function(_0xe996f){logger['info'](_0x9601('0x12'),_0x5cd4d1,_0x9601('0x13'));logger[_0x9601('0x14')](_0x9601('0x15'),_0x5cd4d1,_0x9601('0x13'),JSON['stringify'](_0xe996f));if(_0xe996f[_0x9601('0x16')]){if(_0xe996f[_0x9601('0x16')][_0x9601('0x17')]===0x1f4){logger[_0x9601('0x16')](_0x9601('0x12'),_0x5cd4d1,_0xe996f[_0x9601('0x16')][_0x9601('0x18')]);return _0x28e60e(_0xe996f[_0x9601('0x16')][_0x9601('0x18')]);}logger[_0x9601('0x16')](_0x9601('0x12'),_0x5cd4d1,_0xe996f[_0x9601('0x16')][_0x9601('0x18')]);return _0x93661e(_0xe996f['error']['message']);}else{logger['info'](_0x9601('0x12'),_0x5cd4d1,_0x9601('0x13'));_0x93661e(_0xe996f[_0x9601('0x19')]['message']);}})[_0x9601('0x1a')](function(_0x33ccfb){logger[_0x9601('0x16')](_0x9601('0x12'),_0x5cd4d1,_0x33ccfb);_0x28e60e(_0x33ccfb);});});}exports[_0x9601('0x1b')]=function(_0x47c63b){var _0x4b6c55=this;return new Promise(function(_0x5002a7,_0x8786a0){return db[_0x9601('0x1c')][_0x9601('0x1d')](_0x47c63b[_0x9601('0x1e')],{'raw':_0x47c63b['options']?_0x47c63b[_0x9601('0x1f')][_0x9601('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47c63b[_0x9601('0x1f')]?_0x47c63b[_0x9601('0x1f')][_0x9601('0x21')]||null:null,'attributes':_0x47c63b['options']?_0x47c63b[_0x9601('0x1f')]['attributes']||null:null,'limit':_0x47c63b[_0x9601('0x1f')]?_0x47c63b[_0x9601('0x1f')][_0x9601('0x22')]||null:null})[_0x9601('0x11')](function(_0x4aba0d){logger[_0x9601('0x23')](_0x9601('0x1b'),_0x47c63b);logger[_0x9601('0x14')](_0x9601('0x1b'),_0x47c63b,JSON[_0x9601('0x24')](_0x4aba0d));_0x5002a7(_0x4aba0d);})[_0x9601('0x1a')](function(_0x478a58){logger['error']('UpdateChatInteraction',_0x478a58[_0x9601('0x18')],_0x47c63b);_0x8786a0(_0x4b6c55[_0x9601('0x16')](0x1f4,_0x478a58[_0x9601('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x32242f){return new Promise(function(_0x3a0fcf,_0x5395eb){return db[_0x9601('0x1c')][_0x9601('0x25')]({'where':_0x32242f[_0x9601('0x1f')]?_0x32242f['options'][_0x9601('0x21')]||null:null})['then'](function(_0xffaf27){if(_0xffaf27){return _0xffaf27[_0x9601('0x26')](_0x32242f[_0x9601('0x1e')][_0x9601('0x27')],_[_0x9601('0x28')](_0x32242f['body'],['ids','id'])||{});}})[_0x9601('0x29')](function(_0x143a44){logger['info'](_0x9601('0x2a'),_0x32242f);logger['debug'](_0x9601('0x2a'),_0x32242f,JSON[_0x9601('0x24')](_0x143a44));_0x3a0fcf(_0x143a44);})[_0x9601('0x1a')](function(_0x4b5566){logger['error'](_0x9601('0x2a'),_0x4b5566[_0x9601('0x18')],_0x32242f);_0x5395eb(_this[_0x9601('0x16')](0x1f4,_0x4b5566['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 50b99f8..50aff3d 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 _0x58d9=['save','update','removeListener','length','chatInteraction:','./chatInteraction.events'];(function(_0x585dfa,_0x5e4b66){var _0x1c00c7=function(_0x281073){while(--_0x281073){_0x585dfa['push'](_0x585dfa['shift']());}};_0x1c00c7(++_0x5e4b66);}(_0x58d9,0xcb));var _0x958d=function(_0x48d9b0,_0x3e0802){_0x48d9b0=_0x48d9b0-0x0;var _0x3b97ad=_0x58d9[_0x48d9b0];return _0x3b97ad;};'use strict';var ChatInteractionEvents=require(_0x958d('0x0'));var events=[_0x958d('0x1'),'remove',_0x958d('0x2')];function createListener(_0x2a7f63,_0x15679f){return function(_0x15a913){_0x15679f['emit'](_0x2a7f63,_0x15a913);};}function removeListener(_0x436293,_0x4c0daa){return function(){ChatInteractionEvents[_0x958d('0x3')](_0x436293,_0x4c0daa);};}exports['register']=function(_0x10c0d5){for(var _0x148513=0x0,_0x51a183=events[_0x958d('0x4')];_0x148513<_0x51a183;_0x148513++){var _0xc35279=events[_0x148513];var _0x58e0aa=createListener(_0x958d('0x5')+_0xc35279,_0x10c0d5);ChatInteractionEvents['on'](_0xc35279,_0x58e0aa);}}; \ No newline at end of file +var _0x638e=['emit','removeListener','register','./chatInteraction.events'];(function(_0x11b2fa,_0x4deadd){var _0x17c175=function(_0x175e25){while(--_0x175e25){_0x11b2fa['push'](_0x11b2fa['shift']());}};_0x17c175(++_0x4deadd);}(_0x638e,0xf3));var _0xe638=function(_0xd60031,_0x5efb93){_0xd60031=_0xd60031-0x0;var _0x43d00a=_0x638e[_0xd60031];return _0x43d00a;};'use strict';var ChatInteractionEvents=require(_0xe638('0x0'));var events=['save','remove','update'];function createListener(_0x573ef6,_0x1193d9){return function(_0x4ae8cc){_0x1193d9[_0xe638('0x1')](_0x573ef6,_0x4ae8cc);};}function removeListener(_0x37c16b,_0x464049){return function(){ChatInteractionEvents[_0xe638('0x2')](_0x37c16b,_0x464049);};}exports[_0xe638('0x3')]=function(_0x2356c5){for(var _0xb9ef8=0x0,_0x57e91e=events['length'];_0xb9ef8<_0x57e91e;_0xb9ef8++){var _0x1b9da6=events[_0xb9ef8];var _0x56788b=createListener('chatInteraction:'+_0x1b9da6,_0x2356c5);ChatInteractionEvents['on'](_0x1b9da6,_0x56788b);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index c9329fc..a2d4a4f 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 _0xc491=['./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/download','post','create','join','root','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','tracked','chatinteraction:addtags','put','chat','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x56cc3b,_0x2c2d17){var _0x1eafb5=function(_0x25c275){while(--_0x25c275){_0x56cc3b['push'](_0x56cc3b['shift']());}};_0x1eafb5(++_0x2c2d17);}(_0xc491,0xbf));var _0x1c49=function(_0x5b013d,_0xc7691c){_0x5b013d=_0x5b013d-0x0;var _0x2b6eef=_0xc491[_0x5b013d];return _0x2b6eef;};'use strict';var multer=require(_0x1c49('0x0'));var util=require('util');var path=require(_0x1c49('0x1'));var timeout=require(_0x1c49('0x2'));var express=require(_0x1c49('0x3'));var router=express[_0x1c49('0x4')]();var fs_extra=require(_0x1c49('0x5'));var auth=require(_0x1c49('0x6'));var interaction=require(_0x1c49('0x7'));var config=require(_0x1c49('0x8'));var controller=require(_0x1c49('0x9'));router['get']('/',auth[_0x1c49('0xa')](),controller[_0x1c49('0xb')]);router[_0x1c49('0xc')](_0x1c49('0xd'),auth[_0x1c49('0xa')](),controller[_0x1c49('0xe')]);router['get'](_0x1c49('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x1c49('0x10')]);router['get'](_0x1c49('0x11'),auth[_0x1c49('0x12')](),controller[_0x1c49('0x13')]);router[_0x1c49('0xc')]('/:id/messages',auth[_0x1c49('0xa')](),controller[_0x1c49('0x14')]);router['get']('/:id/my_messages',auth[_0x1c49('0x12')](),controller['getMyMessages']);router[_0x1c49('0xc')](_0x1c49('0x15'),auth[_0x1c49('0xa')](),controller['download']);router[_0x1c49('0x16')]('/',auth[_0x1c49('0xa')](),controller[_0x1c49('0x17')]);router[_0x1c49('0x16')]('/:id/vidaoo',auth[_0x1c49('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x48600b,_0xcdfb0d,_0x58eaa6){_0x58eaa6(null,path[_0x1c49('0x18')](config[_0x1c49('0x19')],'server/files/attachments/'));},'filename':function(_0x3856d5,_0x26d033,_0x2cb5ce){_0x2cb5ce(null,util[_0x1c49('0x1a')](_0x1c49('0x1b'),Date[_0x1c49('0x1c')](),_0x26d033[_0x1c49('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x1c49('0x1e'),upload[_0x1c49('0x1f')](_0x1c49('0x20')),controller[_0x1c49('0x21')]);router[_0x1c49('0x16')](_0x1c49('0x22'),auth[_0x1c49('0x12')](),controller[_0x1c49('0x23')]);router[_0x1c49('0x16')]('/:id/tags',auth[_0x1c49('0xa')](),interaction[_0x1c49('0x24')]('chat',_0x1c49('0x25')),controller['addTags']);router[_0x1c49('0x26')](_0x1c49('0xf'),auth['isAuthenticated'](),interaction[_0x1c49('0x24')](_0x1c49('0x27'),'chatinteraction:update'),controller[_0x1c49('0x28')]);router[_0x1c49('0x26')](_0x1c49('0x29'),controller[_0x1c49('0x2a')]);router[_0x1c49('0x26')]('/:id/abandon',auth[_0x1c49('0x12')](),controller[_0x1c49('0x2b')]);router[_0x1c49('0x26')](_0x1c49('0x2c'),controller[_0x1c49('0x2d')]);router['delete'](_0x1c49('0xf'),auth[_0x1c49('0xa')](),interaction[_0x1c49('0x24')](_0x1c49('0x27'),_0x1c49('0x2e')),controller[_0x1c49('0x2f')]);router[_0x1c49('0x30')]('/:id/tags',auth['isAuthenticated'](),controller[_0x1c49('0x31')]);module['exports']=router; \ No newline at end of file +var _0xb765=['create','createVidaooSession','join','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/close','close','delete','destroy','removeTags','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post'];(function(_0x4083f9,_0x18b7ae){var _0x510473=function(_0x56dca2){while(--_0x56dca2){_0x4083f9['push'](_0x4083f9['shift']());}};_0x510473(++_0x18b7ae);}(_0xb765,0xd4));var _0x5b76=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xb765[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x5b76('0x0'));var util=require(_0x5b76('0x1'));var path=require(_0x5b76('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5b76('0x3')]();var fs_extra=require(_0x5b76('0x4'));var auth=require(_0x5b76('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b76('0x6'));var controller=require(_0x5b76('0x7'));router[_0x5b76('0x8')]('/',auth['isAuthenticated'](),controller[_0x5b76('0x9')]);router['get'](_0x5b76('0xa'),auth[_0x5b76('0xb')](),controller[_0x5b76('0xc')]);router['get'](_0x5b76('0xd'),auth[_0x5b76('0xe')](),controller[_0x5b76('0xf')]);router['get']('/:id/attachment_download',auth[_0x5b76('0xe')](),controller[_0x5b76('0x10')]);router['get'](_0x5b76('0x11'),auth[_0x5b76('0xb')](),controller['getMessages']);router[_0x5b76('0x8')](_0x5b76('0x12'),auth[_0x5b76('0xe')](),controller[_0x5b76('0x13')]);router['get'](_0x5b76('0x14'),auth[_0x5b76('0xb')](),controller[_0x5b76('0x15')]);router[_0x5b76('0x16')]('/',auth['isAuthenticated'](),controller[_0x5b76('0x17')]);router[_0x5b76('0x16')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x5b76('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5809c1,_0x1acce5,_0x2071a0){_0x2071a0(null,path[_0x5b76('0x19')](config['root'],_0x5b76('0x1a')));},'filename':function(_0x56e29f,_0x22a35c,_0x4eee11){_0x4eee11(null,util[_0x5b76('0x1b')]('%s-%s',Date[_0x5b76('0x1c')](),_0x22a35c[_0x5b76('0x1d')][_0x5b76('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5b76('0x16')](_0x5b76('0x1f'),upload[_0x5b76('0x20')]('file'),controller['attachmentUpload']);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post'](_0x5b76('0x21'),auth[_0x5b76('0xb')](),interaction[_0x5b76('0x22')](_0x5b76('0x23'),'chatinteraction:addtags'),controller[_0x5b76('0x24')]);router[_0x5b76('0x25')](_0x5b76('0xd'),auth[_0x5b76('0xb')](),interaction[_0x5b76('0x22')](_0x5b76('0x23'),_0x5b76('0x26')),controller[_0x5b76('0x27')]);router[_0x5b76('0x25')](_0x5b76('0x28'),controller['customUpdate']);router[_0x5b76('0x25')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router['put'](_0x5b76('0x29'),controller[_0x5b76('0x2a')]);router[_0x5b76('0x2b')](_0x5b76('0xd'),auth[_0x5b76('0xb')](),interaction[_0x5b76('0x22')](_0x5b76('0x23'),'chatinteraction:destroy'),controller[_0x5b76('0x2c')]);router[_0x5b76('0x2b')](_0x5b76('0x21'),auth[_0x5b76('0xb')](),controller[_0x5b76('0x2d')]);module[_0x5b76('0x2e')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 023653a..fdd6708 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 _0x413b=['exports','BOOLEAN','INTEGER','sequelize'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x413b,0x143));var _0xb413=function(_0x420746,_0x26dd66){_0x420746=_0x420746-0x0;var _0x1c6de2=_0x413b[_0x420746];return _0x1c6de2;};'use strict';var Sequelize=require(_0xb413('0x0'));module[_0xb413('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb413('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb413('0x3')]}}; \ No newline at end of file +var _0x792a=['TEXT','medium','INTEGER','sequelize','exports'];(function(_0x1bad8a,_0x4a160f){var _0xfa3b6b=function(_0x1abb3a){while(--_0x1abb3a){_0x1bad8a['push'](_0x1bad8a['shift']());}};_0xfa3b6b(++_0x4a160f);}(_0x792a,0xcb));var _0xa792=function(_0x3d16f1,_0x296535){_0x3d16f1=_0x3d16f1-0x0;var _0x30bc6c=_0x792a[_0x3d16f1];return _0x30bc6c;};'use strict';var Sequelize=require(_0xa792('0x0'));module[_0xa792('0x1')]={'body':{'type':Sequelize[_0xa792('0x2')](_0xa792('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa792('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 11f5aac..cb74a99 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 _0xeeea=['rows','catch','show','params','fields','create','body','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','admin','user','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','ChatInternalMessage','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include'];(function(_0x16e569,_0x33f836){var _0x22470a=function(_0x4b7c33){while(--_0x4b7c33){_0x16e569['push'](_0x16e569['shift']());}};_0x22470a(++_0x33f836);}(_0xeeea,0x187));var _0xaeee=function(_0x5486c9,_0xd84d26){_0x5486c9=_0x5486c9-0x0;var _0x595b5=_0xeeea[_0x5486c9];return _0x595b5;};'use strict';var emlformat=require(_0xaeee('0x0'));var rimraf=require(_0xaeee('0x1'));var zipdir=require(_0xaeee('0x2'));var jsonpatch=require(_0xaeee('0x3'));var rp=require('request-promise');var moment=require(_0xaeee('0x4'));var BPromise=require(_0xaeee('0x5'));var Mustache=require(_0xaeee('0x6'));var util=require(_0xaeee('0x7'));var path=require(_0xaeee('0x8'));var sox=require(_0xaeee('0x9'));var csv=require(_0xaeee('0xa'));var ejs=require(_0xaeee('0xb'));var fs=require('fs');var fs_extra=require(_0xaeee('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaeee('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaeee('0xe'));var toCsv=require(_0xaeee('0xa'));var querystring=require('querystring');var Papa=require(_0xaeee('0xf'));var Redis=require(_0xaeee('0x10'));var authService=require(_0xaeee('0x11'));var qs=require(_0xaeee('0x12'));var as=require(_0xaeee('0x13'));var hardwareService=require(_0xaeee('0x14'));var logger=require(_0xaeee('0x15'))(_0xaeee('0x16'));var utils=require(_0xaeee('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xaeee('0x18'));var db=require('../../mysqldb')['db'];config[_0xaeee('0x19')]=_['defaults'](config[_0xaeee('0x19')],{'host':_0xaeee('0x1a'),'port':0x18eb});var socket=require(_0xaeee('0x1b'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xaeee('0x1c')](socket);function respondWithStatusCode(_0x2d7761,_0x1f3aa9){_0x1f3aa9=_0x1f3aa9||0xcc;return function(_0x1d4cf3){if(_0x1d4cf3){return _0x2d7761[_0xaeee('0x1d')](_0x1f3aa9);}return _0x2d7761[_0xaeee('0x1e')](_0x1f3aa9)[_0xaeee('0x1f')]();};}function respondWithResult(_0x71f4e1,_0x3acfef){_0x3acfef=_0x3acfef||0xc8;return function(_0x57a89f){if(_0x57a89f){return _0x71f4e1[_0xaeee('0x1e')](_0x3acfef)['json'](_0x57a89f);}};}function respondWithFilteredResult(_0x3b8045,_0x14a8b5){return function(_0x2cf294){if(_0x2cf294){var _0x37ba96=typeof _0x14a8b5['offset']===_0xaeee('0x20')&&typeof _0x14a8b5['limit']===_0xaeee('0x20');var _0x301398=_0x2cf294[_0xaeee('0x21')];var _0xdb17ea=_0x37ba96?0x0:_0x14a8b5[_0xaeee('0x22')];var _0x4c39c0=_0x37ba96?_0x2cf294[_0xaeee('0x21')]:_0x14a8b5[_0xaeee('0x22')]+_0x14a8b5[_0xaeee('0x23')];var _0x378554;if(_0x4c39c0>=_0x301398){_0x4c39c0=_0x301398;_0x378554=0xc8;}else{_0x378554=0xce;}_0x3b8045[_0xaeee('0x1e')](_0x378554);return _0x3b8045[_0xaeee('0x24')](_0xaeee('0x25'),_0xdb17ea+'-'+_0x4c39c0+'/'+_0x301398)['json'](_0x2cf294);}return null;};}function patchUpdates(_0x4be996){return function(_0x114243){try{jsonpatch[_0xaeee('0x26')](_0x114243,_0x4be996,!![]);}catch(_0x35f290){return BPromise[_0xaeee('0x27')](_0x35f290);}return _0x114243[_0xaeee('0x28')]();};}function saveUpdates(_0x1cd3ed,_0xa74fe6){return function(_0x538f1f){if(_0x538f1f){return _0x538f1f[_0xaeee('0x29')](_0x1cd3ed)[_0xaeee('0x2a')](function(_0x80bb81){return _0x80bb81;});}return null;};}function removeEntity(_0x70b900,_0x5578ed){return function(_0x4d1777){if(_0x4d1777){return _0x4d1777[_0xaeee('0x2b')]()[_0xaeee('0x2a')](function(){_0x70b900[_0xaeee('0x1e')](0xcc)[_0xaeee('0x1f')]();});}};}function handleEntityNotFound(_0x52a480,_0x385e77){return function(_0x33f753){if(!_0x33f753){_0x52a480[_0xaeee('0x1d')](0x194);}return _0x33f753;};}function handleError(_0x2f085f,_0x5893fa){_0x5893fa=_0x5893fa||0x1f4;return function(_0x1b9b6c){logger[_0xaeee('0x2c')](_0x1b9b6c[_0xaeee('0x2d')]);if(_0x1b9b6c['name']){delete _0x1b9b6c['name'];}_0x2f085f[_0xaeee('0x1e')](_0x5893fa)[_0xaeee('0x2e')](_0x1b9b6c);};}exports[_0xaeee('0x2f')]=function(_0x123d65,_0x11ccae){var _0x3271ff={},_0x2b298e={},_0x4bcc80={'count':0x0,'rows':[]};var _0x5ea2cb=_['map'](db[_0xaeee('0x30')][_0xaeee('0x31')],function(_0x25d6f5){return{'name':_0x25d6f5[_0xaeee('0x32')],'type':_0x25d6f5['type'][_0xaeee('0x33')]};});_0x2b298e[_0xaeee('0x34')]=_['map'](_0x5ea2cb,_0xaeee('0x35'));_0x2b298e[_0xaeee('0x36')]=_[_0xaeee('0x37')](_0x123d65[_0xaeee('0x36')]);_0x2b298e[_0xaeee('0x38')]=_[_0xaeee('0x39')](_0x2b298e[_0xaeee('0x34')],_0x2b298e[_0xaeee('0x36')]);_0x3271ff[_0xaeee('0x3a')]=_[_0xaeee('0x39')](_0x2b298e[_0xaeee('0x34')],qs['fields'](_0x123d65[_0xaeee('0x36')]['fields']));_0x3271ff[_0xaeee('0x3a')]=_0x3271ff[_0xaeee('0x3a')][_0xaeee('0x3b')]?_0x3271ff['attributes']:_0x2b298e[_0xaeee('0x34')];if(!_0x123d65['query']['hasOwnProperty'](_0xaeee('0x3c'))){_0x3271ff[_0xaeee('0x23')]=qs[_0xaeee('0x23')](_0x123d65[_0xaeee('0x36')]['limit']);_0x3271ff[_0xaeee('0x22')]=qs['offset'](_0x123d65[_0xaeee('0x36')][_0xaeee('0x22')]);}_0x3271ff[_0xaeee('0x3d')]=qs[_0xaeee('0x3e')](_0x123d65[_0xaeee('0x36')][_0xaeee('0x3e')]);_0x3271ff[_0xaeee('0x3f')]=qs[_0xaeee('0x38')](_[_0xaeee('0x40')](_0x123d65[_0xaeee('0x36')],_0x2b298e[_0xaeee('0x38')]),_0x5ea2cb);if(_0x123d65[_0xaeee('0x36')][_0xaeee('0x41')]){_0x3271ff[_0xaeee('0x3f')]=_[_0xaeee('0x42')](_0x3271ff['where'],{'$or':_[_0xaeee('0x43')](_0x5ea2cb,function(_0x235ef6){if(_0x235ef6[_0xaeee('0x44')]!==_0xaeee('0x45')){var _0x2f0046={};_0x2f0046[_0x235ef6['name']]={'$like':'%'+_0x123d65[_0xaeee('0x36')]['filter']+'%'};return _0x2f0046;}})});}_0x3271ff=_[_0xaeee('0x42')]({},_0x3271ff,_0x123d65[_0xaeee('0x46')]);var _0x4b1d02={'where':_0x3271ff[_0xaeee('0x3f')]};return db[_0xaeee('0x30')]['count'](_0x4b1d02)[_0xaeee('0x2a')](function(_0x451ca4){_0x4bcc80[_0xaeee('0x21')]=_0x451ca4;if(_0x123d65[_0xaeee('0x36')][_0xaeee('0x47')]){_0x3271ff[_0xaeee('0x48')]=[{'all':!![]}];}return db[_0xaeee('0x30')]['findAll'](_0x3271ff);})[_0xaeee('0x2a')](function(_0x1bef4d){_0x4bcc80[_0xaeee('0x49')]=_0x1bef4d;return _0x4bcc80;})[_0xaeee('0x2a')](respondWithFilteredResult(_0x11ccae,_0x3271ff))[_0xaeee('0x4a')](handleError(_0x11ccae,null));};exports[_0xaeee('0x4b')]=function(_0x13ed6f,_0x2df325){var _0x3933a3={'raw':!![],'where':{'id':_0x13ed6f[_0xaeee('0x4c')]['id']}},_0x36931d={};_0x36931d[_0xaeee('0x34')]=_[_0xaeee('0x37')](db[_0xaeee('0x30')][_0xaeee('0x31')]);_0x36931d[_0xaeee('0x36')]=_[_0xaeee('0x37')](_0x13ed6f['query']);_0x36931d[_0xaeee('0x38')]=_[_0xaeee('0x39')](_0x36931d['model'],_0x36931d[_0xaeee('0x36')]);_0x3933a3['attributes']=_[_0xaeee('0x39')](_0x36931d['model'],qs['fields'](_0x13ed6f[_0xaeee('0x36')][_0xaeee('0x4d')]));_0x3933a3[_0xaeee('0x3a')]=_0x3933a3[_0xaeee('0x3a')][_0xaeee('0x3b')]?_0x3933a3[_0xaeee('0x3a')]:_0x36931d[_0xaeee('0x34')];if(_0x13ed6f[_0xaeee('0x36')]['includeAll']){_0x3933a3[_0xaeee('0x48')]=[{'all':!![]}];}_0x3933a3=_[_0xaeee('0x42')]({},_0x3933a3,_0x13ed6f[_0xaeee('0x46')]);return db[_0xaeee('0x30')]['find'](_0x3933a3)[_0xaeee('0x2a')](handleEntityNotFound(_0x2df325,null))[_0xaeee('0x2a')](respondWithResult(_0x2df325,null))['catch'](handleError(_0x2df325,null));};exports['create']=function(_0x562054,_0x41ac17){return db['ChatInternalMessage'][_0xaeee('0x4e')](_0x562054[_0xaeee('0x4f')],{})[_0xaeee('0x2a')](respondWithResult(_0x41ac17,0xc9))[_0xaeee('0x4a')](handleError(_0x41ac17,null));};exports['update']=function(_0x9d0be5,_0x2863fe){if(_0x9d0be5[_0xaeee('0x4f')]['id']){delete _0x9d0be5[_0xaeee('0x4f')]['id'];}return db[_0xaeee('0x30')][_0xaeee('0x50')]({'where':{'id':_0x9d0be5[_0xaeee('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2863fe,null))[_0xaeee('0x2a')](saveUpdates(_0x9d0be5[_0xaeee('0x4f')],null))[_0xaeee('0x2a')](respondWithResult(_0x2863fe,null))[_0xaeee('0x4a')](handleError(_0x2863fe,null));};exports[_0xaeee('0x2b')]=function(_0x2d9ed8,_0x7c77d3){return db[_0xaeee('0x30')][_0xaeee('0x50')]({'where':{'id':_0x2d9ed8[_0xaeee('0x4c')]['id']}})[_0xaeee('0x2a')](handleEntityNotFound(_0x7c77d3,null))[_0xaeee('0x2a')](removeEntity(_0x7c77d3,null))[_0xaeee('0x4a')](handleError(_0x7c77d3,null));};exports[_0xaeee('0x51')]=function(_0x4c5ac4,_0x4b5a32){return db[_0xaeee('0x30')][_0xaeee('0x51')]()[_0xaeee('0x2a')](respondWithResult(_0x4b5a32,null))[_0xaeee('0x4a')](handleError(_0x4b5a32,null));};function wrapUser(_0x37b16b){return function(_0xa2cfe3){var _0x180c7a=_0x37b16b[_0xaeee('0x52')]({'plain':!![]});_0x180c7a[_0xaeee('0x53')]=[];if(_0xa2cfe3){_0x180c7a[_0xaeee('0x54')]=_0xa2cfe3[_0xaeee('0x55')];_0x180c7a[_0xaeee('0x56')]=_0xa2cfe3;}else{_0x180c7a['lastMessageAt']=moment(0x0)[_0xaeee('0x57')](_0xaeee('0x58'));_0x180c7a[_0xaeee('0x56')]={};}return _0x180c7a;};}exports[_0xaeee('0x59')]=function(_0x4f0236,_0xb4f3b8,_0x443b15){var _0x38a0b4=[];return db[_0xaeee('0x5a')][_0xaeee('0x5b')]({'where':{'role':['agent',_0xaeee('0x5c'),_0xaeee('0x5d')]},'attributes':['id',_0xaeee('0x5e'),_0xaeee('0x35'),_0xaeee('0x5f'),_0xaeee('0x60'),_0xaeee('0x61'),_0xaeee('0x62'),_0xaeee('0x63'),'allowmessenger',_0xaeee('0x64')],'order':qs['sort']('-online'),'include':[{'model':db[_0xaeee('0x65')],'as':_0xaeee('0x66'),'attributes':['id','name',_0xaeee('0x44')],'through':{'attributes':[]}}]})[_0xaeee('0x2a')](function(_0x240144){if(_0x240144){var _0x2bc19e=_0x4f0236[_0xaeee('0x5d')][_0xaeee('0x52')]({'plain':!![]});if(!_0x2bc19e)throw new Error(_0xaeee('0x67'));if(_0x2bc19e[_0xaeee('0x5f')]===_0xaeee('0x5d')){return db['UserProfileSection'][_0xaeee('0x50')]({'where':{'name':_0xaeee('0x68'),'userProfileId':_0x2bc19e['userProfileId']},'raw':!![]})[_0xaeee('0x2a')](function(_0x51d8c9){if(_0x51d8c9){if(_0x51d8c9[_0xaeee('0x69')]===0x0){return db[_0xaeee('0x6a')][_0xaeee('0x5b')]({'where':{'sectionId':_0x51d8c9['id']},'raw':!![]})[_0xaeee('0x2a')](function(_0x1f8529){var _0x48d250=[];if(_[_0xaeee('0x6b')](_0x1f8529)){_0x48d250=_[_0xaeee('0x41')](_0x240144,function(_0x3133b9){if(_0x3133b9[_0xaeee('0x5f')]!=='agent'){return _0x3133b9;}});return _0x48d250;}else{for(var _0x186cda=0x0;_0x186cda<_0x240144[_0xaeee('0x3b')];_0x186cda++){var _0x5397fb=_0x240144[_0x186cda];if(_0x5397fb[_0xaeee('0x5f')]===_0xaeee('0x6c')){var _0x3599bc=_['find'](_0x1f8529,function(_0x2c41e9){return _0x2c41e9[_0xaeee('0x6d')]===_0x5397fb['id'];});if(_0x3599bc)_0x48d250[_0xaeee('0x6e')](_0x5397fb);}else{_0x48d250[_0xaeee('0x6e')](_0x5397fb);}}return _0x48d250;}});}else{return _0x240144;}}else{var _0x17b2b0=_[_0xaeee('0x41')](_0x240144,function(_0x2ce5a6){if(_0x2ce5a6[_0xaeee('0x5f')]!==_0xaeee('0x6c')){return _0x2ce5a6;}});return _0x17b2b0;}});}else{return _0x240144;}}})['then'](function(_0x590cf4){var _0x46cc1a=[];if(_0x590cf4){_0x38a0b4=_0x590cf4;for(var _0x49614a=0x0;_0x49614a<_0x590cf4[_0xaeee('0x3b')];_0x49614a+=0x1){_0x38a0b4[_0x49614a][_0xaeee('0x53')]=[];_0x46cc1a['push'](db[_0xaeee('0x30')][_0xaeee('0x50')]({'where':{'FromId':[_0x4f0236[_0xaeee('0x5d')]['id'],_0x590cf4[_0x49614a]['id']],'ToId':[_0x4f0236[_0xaeee('0x5d')]['id'],_0x590cf4[_0x49614a]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xaeee('0x6f'),_0xaeee('0x70'),_0xaeee('0x71'),_0xaeee('0x4f')],'order':qs[_0xaeee('0x3e')](_0xaeee('0x72')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xaeee('0x2a')](wrapUser(_0x590cf4[_0x49614a])));}return BPromise[_0xaeee('0x73')](_0x46cc1a);}return[];})[_0xaeee('0x2a')](function(_0x4f19cd){return{'rows':_0x4f19cd,'count':_0x4f19cd[_0xaeee('0x3b')]};})[_0xaeee('0x2a')](respondWithResult(_0xb4f3b8,null))[_0xaeee('0x4a')](handleError(_0xb4f3b8,null));}; \ No newline at end of file +var _0xf5e0=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','UserProfileResource','resourceId','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','count','apply','save','update','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','then','rows','catch','show','params','options','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','user'];(function(_0x2433a4,_0x3564a2){var _0x10d6aa=function(_0x3d4015){while(--_0x3d4015){_0x2433a4['push'](_0x2433a4['shift']());}};_0x10d6aa(++_0x3564a2);}(_0xf5e0,0x75));var _0x0f5e=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xf5e0[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require(_0x0f5e('0x0'));var rimraf=require(_0x0f5e('0x1'));var zipdir=require(_0x0f5e('0x2'));var jsonpatch=require(_0x0f5e('0x3'));var rp=require(_0x0f5e('0x4'));var moment=require('moment');var BPromise=require(_0x0f5e('0x5'));var Mustache=require(_0x0f5e('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0f5e('0x7'));var ejs=require(_0x0f5e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f5e('0x9'));var squel=require(_0x0f5e('0xa'));var crypto=require('crypto');var jsforce=require(_0x0f5e('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0f5e('0xc'));var Papa=require(_0x0f5e('0xd'));var Redis=require(_0x0f5e('0xe'));var authService=require(_0x0f5e('0xf'));var qs=require(_0x0f5e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f5e('0x11'))('api');var utils=require(_0x0f5e('0x12'));var config=require(_0x0f5e('0x13'));var licenseUtil=require(_0x0f5e('0x14'));var db=require('../../mysqldb')['db'];config[_0x0f5e('0x15')]=_['defaults'](config['redis'],{'host':_0x0f5e('0x16'),'port':0x18eb});var socket=require(_0x0f5e('0x17'))(new Redis(config[_0x0f5e('0x15')]));require(_0x0f5e('0x18'))[_0x0f5e('0x19')](socket);function respondWithStatusCode(_0x480e57,_0x225d18){_0x225d18=_0x225d18||0xcc;return function(_0x3bf8bb){if(_0x3bf8bb){return _0x480e57[_0x0f5e('0x1a')](_0x225d18);}return _0x480e57[_0x0f5e('0x1b')](_0x225d18)[_0x0f5e('0x1c')]();};}function respondWithResult(_0x587366,_0x2fe16d){_0x2fe16d=_0x2fe16d||0xc8;return function(_0x5d96f6){if(_0x5d96f6){return _0x587366[_0x0f5e('0x1b')](_0x2fe16d)[_0x0f5e('0x1d')](_0x5d96f6);}};}function respondWithFilteredResult(_0x5c332c,_0x20c706){return function(_0x26c23d){if(_0x26c23d){var _0x2d5610=typeof _0x20c706[_0x0f5e('0x1e')]===_0x0f5e('0x1f')&&typeof _0x20c706['limit']===_0x0f5e('0x1f');var _0xac7eec=_0x26c23d[_0x0f5e('0x20')];var _0x45fee3=_0x2d5610?0x0:_0x20c706['offset'];var _0x2c4029=_0x2d5610?_0x26c23d['count']:_0x20c706[_0x0f5e('0x1e')]+_0x20c706['limit'];var _0xdb1161;if(_0x2c4029>=_0xac7eec){_0x2c4029=_0xac7eec;_0xdb1161=0xc8;}else{_0xdb1161=0xce;}_0x5c332c['status'](_0xdb1161);return _0x5c332c['set']('Content-Range',_0x45fee3+'-'+_0x2c4029+'/'+_0xac7eec)['json'](_0x26c23d);}return null;};}function patchUpdates(_0x5b8b20){return function(_0x2ef531){try{jsonpatch[_0x0f5e('0x21')](_0x2ef531,_0x5b8b20,!![]);}catch(_0x145cf2){return BPromise['reject'](_0x145cf2);}return _0x2ef531[_0x0f5e('0x22')]();};}function saveUpdates(_0x578e02,_0x5d18ff){return function(_0x4174f0){if(_0x4174f0){return _0x4174f0[_0x0f5e('0x23')](_0x578e02)['then'](function(_0x3ba99e){return _0x3ba99e;});}return null;};}function removeEntity(_0x5c8c5a,_0x4e4401){return function(_0x2b1121){if(_0x2b1121){return _0x2b1121[_0x0f5e('0x24')]()['then'](function(){_0x5c8c5a[_0x0f5e('0x1b')](0xcc)[_0x0f5e('0x1c')]();});}};}function handleEntityNotFound(_0xf36004,_0x16e163){return function(_0x123e63){if(!_0x123e63){_0xf36004[_0x0f5e('0x1a')](0x194);}return _0x123e63;};}function handleError(_0x20471f,_0x55b645){_0x55b645=_0x55b645||0x1f4;return function(_0x422a68){logger[_0x0f5e('0x25')](_0x422a68[_0x0f5e('0x26')]);if(_0x422a68[_0x0f5e('0x27')]){delete _0x422a68['name'];}_0x20471f[_0x0f5e('0x1b')](_0x55b645)[_0x0f5e('0x28')](_0x422a68);};}exports[_0x0f5e('0x29')]=function(_0x207a8b,_0x1caaa0){var _0x505eb5={},_0x13f57f={},_0x3202de={'count':0x0,'rows':[]};var _0x85e11d=_[_0x0f5e('0x2a')](db[_0x0f5e('0x2b')][_0x0f5e('0x2c')],function(_0x35b13b){return{'name':_0x35b13b[_0x0f5e('0x2d')],'type':_0x35b13b[_0x0f5e('0x2e')][_0x0f5e('0x2f')]};});_0x13f57f[_0x0f5e('0x30')]=_[_0x0f5e('0x2a')](_0x85e11d,_0x0f5e('0x27'));_0x13f57f[_0x0f5e('0x31')]=_[_0x0f5e('0x32')](_0x207a8b[_0x0f5e('0x31')]);_0x13f57f[_0x0f5e('0x33')]=_[_0x0f5e('0x34')](_0x13f57f['model'],_0x13f57f[_0x0f5e('0x31')]);_0x505eb5[_0x0f5e('0x35')]=_[_0x0f5e('0x34')](_0x13f57f[_0x0f5e('0x30')],qs[_0x0f5e('0x36')](_0x207a8b[_0x0f5e('0x31')][_0x0f5e('0x36')]));_0x505eb5[_0x0f5e('0x35')]=_0x505eb5[_0x0f5e('0x35')][_0x0f5e('0x37')]?_0x505eb5['attributes']:_0x13f57f[_0x0f5e('0x30')];if(!_0x207a8b[_0x0f5e('0x31')][_0x0f5e('0x38')](_0x0f5e('0x39'))){_0x505eb5[_0x0f5e('0x3a')]=qs['limit'](_0x207a8b[_0x0f5e('0x31')][_0x0f5e('0x3a')]);_0x505eb5[_0x0f5e('0x1e')]=qs[_0x0f5e('0x1e')](_0x207a8b[_0x0f5e('0x31')][_0x0f5e('0x1e')]);}_0x505eb5[_0x0f5e('0x3b')]=qs[_0x0f5e('0x3c')](_0x207a8b[_0x0f5e('0x31')]['sort']);_0x505eb5[_0x0f5e('0x3d')]=qs[_0x0f5e('0x33')](_['pick'](_0x207a8b[_0x0f5e('0x31')],_0x13f57f[_0x0f5e('0x33')]),_0x85e11d);if(_0x207a8b[_0x0f5e('0x31')][_0x0f5e('0x3e')]){_0x505eb5[_0x0f5e('0x3d')]=_[_0x0f5e('0x3f')](_0x505eb5[_0x0f5e('0x3d')],{'$or':_[_0x0f5e('0x2a')](_0x85e11d,function(_0x10c692){if(_0x10c692[_0x0f5e('0x2e')]!==_0x0f5e('0x40')){var _0x4d5d0a={};_0x4d5d0a[_0x10c692[_0x0f5e('0x27')]]={'$like':'%'+_0x207a8b[_0x0f5e('0x31')][_0x0f5e('0x3e')]+'%'};return _0x4d5d0a;}})});}_0x505eb5=_[_0x0f5e('0x3f')]({},_0x505eb5,_0x207a8b['options']);var _0x12e982={'where':_0x505eb5[_0x0f5e('0x3d')]};return db[_0x0f5e('0x2b')][_0x0f5e('0x20')](_0x12e982)['then'](function(_0x3576c8){_0x3202de[_0x0f5e('0x20')]=_0x3576c8;if(_0x207a8b[_0x0f5e('0x31')][_0x0f5e('0x41')]){_0x505eb5[_0x0f5e('0x42')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x0f5e('0x43')](_0x505eb5);})[_0x0f5e('0x44')](function(_0x4f153b){_0x3202de[_0x0f5e('0x45')]=_0x4f153b;return _0x3202de;})[_0x0f5e('0x44')](respondWithFilteredResult(_0x1caaa0,_0x505eb5))[_0x0f5e('0x46')](handleError(_0x1caaa0,null));};exports[_0x0f5e('0x47')]=function(_0x37933f,_0x6f105a){var _0x1a4e0e={'raw':!![],'where':{'id':_0x37933f[_0x0f5e('0x48')]['id']}},_0x518fff={};_0x518fff[_0x0f5e('0x30')]=_[_0x0f5e('0x32')](db[_0x0f5e('0x2b')][_0x0f5e('0x2c')]);_0x518fff[_0x0f5e('0x31')]=_[_0x0f5e('0x32')](_0x37933f[_0x0f5e('0x31')]);_0x518fff[_0x0f5e('0x33')]=_['intersection'](_0x518fff[_0x0f5e('0x30')],_0x518fff[_0x0f5e('0x31')]);_0x1a4e0e[_0x0f5e('0x35')]=_[_0x0f5e('0x34')](_0x518fff[_0x0f5e('0x30')],qs[_0x0f5e('0x36')](_0x37933f[_0x0f5e('0x31')][_0x0f5e('0x36')]));_0x1a4e0e[_0x0f5e('0x35')]=_0x1a4e0e['attributes'][_0x0f5e('0x37')]?_0x1a4e0e['attributes']:_0x518fff[_0x0f5e('0x30')];if(_0x37933f[_0x0f5e('0x31')][_0x0f5e('0x41')]){_0x1a4e0e['include']=[{'all':!![]}];}_0x1a4e0e=_['merge']({},_0x1a4e0e,_0x37933f[_0x0f5e('0x49')]);return db[_0x0f5e('0x2b')][_0x0f5e('0x4a')](_0x1a4e0e)['then'](handleEntityNotFound(_0x6f105a,null))['then'](respondWithResult(_0x6f105a,null))[_0x0f5e('0x46')](handleError(_0x6f105a,null));};exports[_0x0f5e('0x4b')]=function(_0x197a25,_0x23ab2a){return db[_0x0f5e('0x2b')][_0x0f5e('0x4b')](_0x197a25[_0x0f5e('0x4c')],{})[_0x0f5e('0x44')](respondWithResult(_0x23ab2a,0xc9))[_0x0f5e('0x46')](handleError(_0x23ab2a,null));};exports['update']=function(_0x183c02,_0x4edc43){if(_0x183c02[_0x0f5e('0x4c')]['id']){delete _0x183c02[_0x0f5e('0x4c')]['id'];}return db[_0x0f5e('0x2b')]['find']({'where':{'id':_0x183c02[_0x0f5e('0x48')]['id']}})[_0x0f5e('0x44')](handleEntityNotFound(_0x4edc43,null))[_0x0f5e('0x44')](saveUpdates(_0x183c02[_0x0f5e('0x4c')],null))[_0x0f5e('0x44')](respondWithResult(_0x4edc43,null))[_0x0f5e('0x46')](handleError(_0x4edc43,null));};exports['destroy']=function(_0x348d98,_0x5e6267){return db[_0x0f5e('0x2b')]['find']({'where':{'id':_0x348d98[_0x0f5e('0x48')]['id']}})[_0x0f5e('0x44')](handleEntityNotFound(_0x5e6267,null))[_0x0f5e('0x44')](removeEntity(_0x5e6267,null))[_0x0f5e('0x46')](handleError(_0x5e6267,null));};exports[_0x0f5e('0x4d')]=function(_0x4ff00f,_0x47b315){return db['ChatInternalMessage'][_0x0f5e('0x4d')]()[_0x0f5e('0x44')](respondWithResult(_0x47b315,null))[_0x0f5e('0x46')](handleError(_0x47b315,null));};function wrapUser(_0x3e6339){return function(_0x1456d4){var _0x1bf46d=_0x3e6339[_0x0f5e('0x4e')]({'plain':!![]});_0x1bf46d['messages']=[];if(_0x1456d4){_0x1bf46d[_0x0f5e('0x4f')]=_0x1456d4[_0x0f5e('0x50')];_0x1bf46d[_0x0f5e('0x51')]=_0x1456d4;}else{_0x1bf46d[_0x0f5e('0x4f')]=moment(0x0)[_0x0f5e('0x52')](_0x0f5e('0x53'));_0x1bf46d[_0x0f5e('0x51')]={};}return _0x1bf46d;};}exports[_0x0f5e('0x54')]=function(_0x16d30d,_0x4e712d,_0x3cc934){var _0x498f26=[];return db['User']['findAll']({'where':{'role':[_0x0f5e('0x55'),'admin','user']},'attributes':['id',_0x0f5e('0x56'),_0x0f5e('0x27'),_0x0f5e('0x57'),_0x0f5e('0x58'),_0x0f5e('0x59'),_0x0f5e('0x5a'),_0x0f5e('0x5b'),_0x0f5e('0x5c'),'showWebBar'],'order':qs[_0x0f5e('0x3c')](_0x0f5e('0x5d')),'include':[{'model':db[_0x0f5e('0x5e')],'as':_0x0f5e('0x5f'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x0f5e('0x44')](function(_0x5ce883){if(_0x5ce883){var _0x504bd0=_0x16d30d[_0x0f5e('0x60')][_0x0f5e('0x4e')]({'plain':!![]});if(!_0x504bd0)throw new Error(_0x0f5e('0x61'));if(_0x504bd0[_0x0f5e('0x57')]===_0x0f5e('0x60')){return db[_0x0f5e('0x62')][_0x0f5e('0x4a')]({'where':{'name':_0x0f5e('0x63'),'userProfileId':_0x504bd0['userProfileId']},'raw':!![]})[_0x0f5e('0x44')](function(_0x4036c3){if(_0x4036c3){if(_0x4036c3['autoAssociation']===0x0){return db[_0x0f5e('0x64')][_0x0f5e('0x43')]({'where':{'sectionId':_0x4036c3['id']},'raw':!![]})[_0x0f5e('0x44')](function(_0xc98f69){var _0x1ed938=[];if(_['isEmpty'](_0xc98f69)){_0x1ed938=_[_0x0f5e('0x3e')](_0x5ce883,function(_0x4d8762){if(_0x4d8762[_0x0f5e('0x57')]!==_0x0f5e('0x55')){return _0x4d8762;}});return _0x1ed938;}else{for(var _0x3fdd75=0x0;_0x3fdd75<_0x5ce883['length'];_0x3fdd75++){var _0x1e25b6=_0x5ce883[_0x3fdd75];if(_0x1e25b6[_0x0f5e('0x57')]===_0x0f5e('0x55')){var _0x452b26=_['find'](_0xc98f69,function(_0xbbd5){return _0xbbd5[_0x0f5e('0x65')]===_0x1e25b6['id'];});if(_0x452b26)_0x1ed938[_0x0f5e('0x66')](_0x1e25b6);}else{_0x1ed938[_0x0f5e('0x66')](_0x1e25b6);}}return _0x1ed938;}});}else{return _0x5ce883;}}else{var _0x5d92c1=_['filter'](_0x5ce883,function(_0xc54918){if(_0xc54918['role']!==_0x0f5e('0x55')){return _0xc54918;}});return _0x5d92c1;}});}else{return _0x5ce883;}}})[_0x0f5e('0x44')](function(_0x2c7302){var _0x801f83=[];if(_0x2c7302){_0x498f26=_0x2c7302;for(var _0x39962c=0x0;_0x39962c<_0x2c7302[_0x0f5e('0x37')];_0x39962c+=0x1){_0x498f26[_0x39962c]['messages']=[];_0x801f83[_0x0f5e('0x66')](db[_0x0f5e('0x2b')][_0x0f5e('0x4a')]({'where':{'FromId':[_0x16d30d[_0x0f5e('0x60')]['id'],_0x2c7302[_0x39962c]['id']],'ToId':[_0x16d30d['user']['id'],_0x2c7302[_0x39962c]['id']],'ChatGroupId':null},'attributes':['id',_0x0f5e('0x50'),_0x0f5e('0x67'),_0x0f5e('0x68'),_0x0f5e('0x69'),_0x0f5e('0x4c')],'order':qs[_0x0f5e('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x2c7302[_0x39962c])));}return BPromise[_0x0f5e('0x6a')](_0x801f83);}return[];})[_0x0f5e('0x44')](function(_0x316196){return{'rows':_0x316196,'count':_0x316196[_0x0f5e('0x37')]};})[_0x0f5e('0x44')](respondWithResult(_0x4e712d,null))[_0x0f5e('0x46')](handleError(_0x4e712d,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 5a9f3ac..8b43052 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 _0xff8a=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','hasOwnProperty','events'];(function(_0x242c49,_0xc1b484){var _0x36b9e9=function(_0x574071){while(--_0x574071){_0x242c49['push'](_0x242c49['shift']());}};_0x36b9e9(++_0xc1b484);}(_0xff8a,0x167));var _0xaff8=function(_0x23b828,_0x89efee){_0x23b828=_0x23b828-0x0;var _0x225474=_0xff8a[_0x23b828];return _0x225474;};'use strict';var EventEmitter=require(_0xaff8('0x0'));var ChatInternalMessage=require(_0xaff8('0x1'))['db'][_0xaff8('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xaff8('0x3')](0x0);var events={'afterCreate':_0xaff8('0x4'),'afterUpdate':_0xaff8('0x5'),'afterDestroy':_0xaff8('0x6')};function emitEvent(_0x371d16){return function(_0x34f719,_0x3d0645,_0x979950){ChatInternalMessageEvents['emit'](_0x371d16+':'+_0x34f719['id'],_0x34f719);ChatInternalMessageEvents['emit'](_0x371d16,_0x34f719);_0x979950(null);};}for(var e in events){if(events[_0xaff8('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x35fa=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0xbde074,_0x243786){var _0x1fb78e=function(_0x3364c2){while(--_0x3364c2){_0xbde074['push'](_0xbde074['shift']());}};_0x1fb78e(++_0x243786);}(_0x35fa,0x99));var _0xa35f=function(_0x9efb1a,_0x2b3151){_0x9efb1a=_0x9efb1a-0x0;var _0x4d1987=_0x35fa[_0x9efb1a];return _0x4d1987;};'use strict';var EventEmitter=require(_0xa35f('0x0'));var ChatInternalMessage=require(_0xa35f('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa35f('0x2')](0x0);var events={'afterCreate':_0xa35f('0x3'),'afterUpdate':_0xa35f('0x4'),'afterDestroy':_0xa35f('0x5')};function emitEvent(_0x413db5){return function(_0x238d8d,_0x3b01dc,_0x5d8dc7){ChatInternalMessageEvents[_0xa35f('0x6')](_0x413db5+':'+_0x238d8d['id'],_0x238d8d);ChatInternalMessageEvents[_0xa35f('0x6')](_0x413db5,_0x238d8d);_0x5d8dc7(null);};}for(var e in events){if(events[_0xa35f('0x7')](e)){var event=events[e];ChatInternalMessage[_0xa35f('0x8')](e,emitEvent(event));}}module[_0xa35f('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 9d8d5da..4c64433 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 _0x9f3f=['path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise'];(function(_0x47403a,_0x2bf0a3){var _0x5a5dee=function(_0x23bca6){while(--_0x23bca6){_0x47403a['push'](_0x47403a['shift']());}};_0x5a5dee(++_0x2bf0a3);}(_0x9f3f,0x1bb));var _0xf9f3=function(_0x3403d5,_0x3d99fc){_0x3403d5=_0x3403d5-0x0;var _0xf9df4f=_0x9f3f[_0x3403d5];return _0xf9df4f;};'use strict';var _=require(_0xf9f3('0x0'));var util=require(_0xf9f3('0x1'));var logger=require(_0xf9f3('0x2'))(_0xf9f3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf9f3('0x4'));var fs=require('fs');var path=require(_0xf9f3('0x5'));var rimraf=require(_0xf9f3('0x6'));var config=require(_0xf9f3('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0xf9f3('0x8')]=function(_0x35a681,_0x55e9d9){return _0x35a681[_0xf9f3('0x9')](_0xf9f3('0xa'),attributes,{'tableName':_0xf9f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf9f3('0xc'),'collate':_0xf9f3('0xd')});}; \ No newline at end of file +var _0x6a1e=['utf8mb4_unicode_ci','api','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4'];(function(_0x432d7e,_0x2d2f9b){var _0xa2fb65=function(_0x9952f2){while(--_0x9952f2){_0x432d7e['push'](_0x432d7e['shift']());}};_0xa2fb65(++_0x2d2f9b);}(_0x6a1e,0x182));var _0xe6a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a1e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe6a1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe6a1('0x1'));var fs=require('fs');var path=require(_0xe6a1('0x2'));var rimraf=require(_0xe6a1('0x3'));var config=require(_0xe6a1('0x4'));var attributes=require(_0xe6a1('0x5'));module[_0xe6a1('0x6')]=function(_0x347531,_0x7c9403){return _0x347531[_0xe6a1('0x7')](_0xe6a1('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe6a1('0x9'),'collate':_0xe6a1('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index fb15d90..06e0f52 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 _0x9548=['stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2089ca,_0x46c3ef){var _0x2c414f=function(_0x3e05d0){while(--_0x3e05d0){_0x2089ca['push'](_0x2089ca['shift']());}};_0x2c414f(++_0x46c3ef);}(_0x9548,0x1d9));var _0x8954=function(_0x5d7b47,_0x1a56b0){_0x5d7b47=_0x5d7b47-0x0;var _0x1a38f2=_0x9548[_0x5d7b47];return _0x1a38f2;};'use strict';var _=require('lodash');var util=require(_0x8954('0x0'));var moment=require(_0x8954('0x1'));var BPromise=require(_0x8954('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8954('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8954('0x4'));var logger=require('../../config/logger')(_0x8954('0x5'));var config=require(_0x8954('0x6'));var jayson=require(_0x8954('0x7'));var client=jayson[_0x8954('0x8')][_0x8954('0x9')]({'port':0x232a});config[_0x8954('0xa')]=_[_0x8954('0xb')](config[_0x8954('0xa')],{'host':_0x8954('0xc'),'port':0x18eb});var socket=require(_0x8954('0xd'))(new Redis(config['redis']));require(_0x8954('0xe'))[_0x8954('0xf')](socket);function respondWithRpcPromise(_0x534d78,_0x110489,_0x39d3b2){return new BPromise(function(_0x42cb8b,_0x5ae191){return client[_0x8954('0x10')](_0x534d78,_0x39d3b2)['then'](function(_0x3cb429){logger[_0x8954('0x11')](_0x8954('0x12'),_0x110489,'request\x20sent');logger['debug'](_0x8954('0x13'),_0x110489,_0x8954('0x14'),JSON[_0x8954('0x15')](_0x3cb429));if(_0x3cb429[_0x8954('0x16')]){if(_0x3cb429[_0x8954('0x16')]['code']===0x1f4){logger[_0x8954('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x110489,_0x3cb429[_0x8954('0x16')]['message']);return _0x5ae191(_0x3cb429[_0x8954('0x16')][_0x8954('0x17')]);}logger['error'](_0x8954('0x12'),_0x110489,_0x3cb429[_0x8954('0x16')][_0x8954('0x17')]);return _0x42cb8b(_0x3cb429[_0x8954('0x16')][_0x8954('0x17')]);}else{logger[_0x8954('0x11')](_0x8954('0x12'),_0x110489,_0x8954('0x14'));_0x42cb8b(_0x3cb429[_0x8954('0x18')][_0x8954('0x17')]);}})[_0x8954('0x19')](function(_0x25bd04){logger[_0x8954('0x16')](_0x8954('0x12'),_0x110489,_0x25bd04);_0x5ae191(_0x25bd04);});});} \ No newline at end of file +var _0x36aa=['request\x20sent','debug','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info'];(function(_0x470bdb,_0x2600cc){var _0x2e0257=function(_0x91ef6d){while(--_0x91ef6d){_0x470bdb['push'](_0x470bdb['shift']());}};_0x2e0257(++_0x2600cc);}(_0x36aa,0x170));var _0xa36a=function(_0x3b1553,_0x502e90){_0x3b1553=_0x3b1553-0x0;var _0x54ebe4=_0x36aa[_0x3b1553];return _0x54ebe4;};'use strict';var _=require(_0xa36a('0x0'));var util=require('util');var moment=require(_0xa36a('0x1'));var BPromise=require(_0xa36a('0x2'));var rs=require(_0xa36a('0x3'));var fs=require('fs');var Redis=require(_0xa36a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa36a('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa36a('0x6'));var client=jayson[_0xa36a('0x7')]['http']({'port':0x232a});config['redis']=_[_0xa36a('0x8')](config[_0xa36a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xa36a('0xa'))(new Redis(config[_0xa36a('0x9')]));require(_0xa36a('0xb'))[_0xa36a('0xc')](socket);function respondWithRpcPromise(_0x3fd878,_0x20063b,_0x11595f){return new BPromise(function(_0x31b317,_0x44787a){return client[_0xa36a('0xd')](_0x3fd878,_0x11595f)[_0xa36a('0xe')](function(_0xe82efc){logger[_0xa36a('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x20063b,_0xa36a('0x10'));logger[_0xa36a('0x11')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x20063b,'request\x20sent',JSON[_0xa36a('0x12')](_0xe82efc));if(_0xe82efc[_0xa36a('0x13')]){if(_0xe82efc[_0xa36a('0x13')][_0xa36a('0x14')]===0x1f4){logger[_0xa36a('0x13')](_0xa36a('0x15'),_0x20063b,_0xe82efc[_0xa36a('0x13')][_0xa36a('0x16')]);return _0x44787a(_0xe82efc['error']['message']);}logger[_0xa36a('0x13')](_0xa36a('0x15'),_0x20063b,_0xe82efc[_0xa36a('0x13')][_0xa36a('0x16')]);return _0x31b317(_0xe82efc[_0xa36a('0x13')][_0xa36a('0x16')]);}else{logger[_0xa36a('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x20063b,_0xa36a('0x10'));_0x31b317(_0xe82efc[_0xa36a('0x17')][_0xa36a('0x16')]);}})['catch'](function(_0x3151d2){logger['error'](_0xa36a('0x15'),_0x20063b,_0x3151d2);_0x44787a(_0x3151d2);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 59e62f6..b36a508 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 _0x1084=['save','remove','emit','removeListener','length','./chatInternalMessage.events'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x1084,0x173));var _0x4108=function(_0x3ea3ce,_0x51ad25){_0x3ea3ce=_0x3ea3ce-0x0;var _0x3f1873=_0x1084[_0x3ea3ce];return _0x3f1873;};'use strict';var ChatInternalMessageEvents=require(_0x4108('0x0'));var events=[_0x4108('0x1'),_0x4108('0x2'),'update'];function createListener(_0x39142f,_0x228b01){return function(_0x5666d5){_0x228b01[_0x4108('0x3')](_0x39142f,_0x5666d5);};}function removeListener(_0xd1961b,_0x2c8cee){return function(){ChatInternalMessageEvents[_0x4108('0x4')](_0xd1961b,_0x2c8cee);};}exports['register']=function(_0x436416){for(var _0x58ba3d=0x0,_0x1c39fc=events[_0x4108('0x5')];_0x58ba3d<_0x1c39fc;_0x58ba3d++){var _0x6706fa=events[_0x58ba3d];var _0x5a78bb=createListener('chatInternalMessage:'+_0x6706fa,_0x436416);ChatInternalMessageEvents['on'](_0x6706fa,_0x5a78bb);}}; \ No newline at end of file +var _0x91ff=['remove','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x583ee2,_0x1edefa){var _0x195fcc=function(_0x200fd4){while(--_0x200fd4){_0x583ee2['push'](_0x583ee2['shift']());}};_0x195fcc(++_0x1edefa);}(_0x91ff,0xa0));var _0xf91f=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x91ff[_0x234ae1];return _0x227ba0;};'use strict';var ChatInternalMessageEvents=require(_0xf91f('0x0'));var events=[_0xf91f('0x1'),_0xf91f('0x2'),_0xf91f('0x3')];function createListener(_0x1540ee,_0x563066){return function(_0x58facb){_0x563066[_0xf91f('0x4')](_0x1540ee,_0x58facb);};}function removeListener(_0x46ef16,_0x5ed442){return function(){ChatInternalMessageEvents[_0xf91f('0x5')](_0x46ef16,_0x5ed442);};}exports[_0xf91f('0x6')]=function(_0x210d7f){for(var _0x2209c0=0x0,_0x46780f=events[_0xf91f('0x7')];_0x2209c0<_0x46780f;_0x2209c0++){var _0x5beff8=events[_0x2209c0];var _0x10bf5e=createListener(_0xf91f('0x8')+_0x5beff8,_0x210d7f);ChatInternalMessageEvents['on'](_0x5beff8,_0x10bf5e);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index bdab3a1..3a5beae 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 _0xa23b=['../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','getUsers','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa23b,0x1f3));var _0xba23=function(_0xc823e1,_0x3020e5){_0xc823e1=_0xc823e1-0x0;var _0xf5a749=_0xa23b[_0xc823e1];return _0xf5a749;};'use strict';var multer=require(_0xba23('0x0'));var util=require(_0xba23('0x1'));var path=require(_0xba23('0x2'));var timeout=require(_0xba23('0x3'));var express=require(_0xba23('0x4'));var router=express[_0xba23('0x5')]();var fs_extra=require(_0xba23('0x6'));var auth=require(_0xba23('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xba23('0x8'));var controller=require(_0xba23('0x9'));router[_0xba23('0xa')]('/',auth[_0xba23('0xb')](),controller[_0xba23('0xc')]);router[_0xba23('0xa')](_0xba23('0xd'),auth[_0xba23('0xb')](),controller['describe']);router[_0xba23('0xa')](_0xba23('0xe'),auth['isAuthenticated'](),controller[_0xba23('0xf')]);router[_0xba23('0xa')](_0xba23('0x10'),auth[_0xba23('0xb')](),controller[_0xba23('0x11')]);router[_0xba23('0x12')]('/',auth[_0xba23('0xb')](),controller['create']);router[_0xba23('0x13')](_0xba23('0x10'),controller[_0xba23('0x14')]);router[_0xba23('0x15')]('/:id',auth[_0xba23('0xb')](),controller[_0xba23('0x16')]);module['exports']=router; \ No newline at end of file +var _0x7281=['create','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','/users','getUsers','show','post'];(function(_0xf6505c,_0x1bb258){var _0x1b0b47=function(_0x25ba75){while(--_0x25ba75){_0xf6505c['push'](_0xf6505c['shift']());}};_0x1b0b47(++_0x1bb258);}(_0x7281,0x159));var _0x1728=function(_0x4af55d,_0x3f2511){_0x4af55d=_0x4af55d-0x0;var _0x49012a=_0x7281[_0x4af55d];return _0x49012a;};'use strict';var multer=require(_0x1728('0x0'));var util=require('util');var path=require(_0x1728('0x1'));var timeout=require(_0x1728('0x2'));var express=require(_0x1728('0x3'));var router=express[_0x1728('0x4')]();var fs_extra=require(_0x1728('0x5'));var auth=require(_0x1728('0x6'));var interaction=require(_0x1728('0x7'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x1728('0x8')](),controller['index']);router[_0x1728('0x9')](_0x1728('0xa'),auth[_0x1728('0x8')](),controller['describe']);router[_0x1728('0x9')](_0x1728('0xb'),auth['isAuthenticated'](),controller[_0x1728('0xc')]);router[_0x1728('0x9')]('/:id',auth[_0x1728('0x8')](),controller[_0x1728('0xd')]);router[_0x1728('0xe')]('/',auth['isAuthenticated'](),controller[_0x1728('0xf')]);router['put'](_0x1728('0x10'),controller[_0x1728('0x11')]);router[_0x1728('0x12')](_0x1728('0x10'),auth[_0x1728('0x8')](),controller['destroy']);module[_0x1728('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 2a7ea57..0262bc3 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 _0x3014=['exports','medium','BOOLEAN','out','DATE','STRING','TEXT','sequelize'];(function(_0x3a8b7c,_0x3e5db2){var _0x40eb80=function(_0x8db6a3){while(--_0x8db6a3){_0x3a8b7c['push'](_0x3a8b7c['shift']());}};_0x40eb80(++_0x3e5db2);}(_0x3014,0x1d7));var _0x4301=function(_0x1648ae,_0x475f9b){_0x1648ae=_0x1648ae-0x0;var _0x163b3c=_0x3014[_0x1648ae];return _0x163b3c;};'use strict';var Sequelize=require(_0x4301('0x0'));module[_0x4301('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4301('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4301('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4301('0x4')),'defaultValue':_0x4301('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4301('0x5')]},'providerName':{'type':Sequelize[_0x4301('0x6')]},'providerResponse':{'type':Sequelize[_0x4301('0x7')]}}; \ No newline at end of file +var _0x18f3=['DATE','STRING','exports','TEXT','medium','ENUM','out'];(function(_0x39a6ae,_0x495de0){var _0x288d63=function(_0x5b660e){while(--_0x5b660e){_0x39a6ae['push'](_0x39a6ae['shift']());}};_0x288d63(++_0x495de0);}(_0x18f3,0x19f));var _0x318f=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x18f3[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require('sequelize');module[_0x318f('0x0')]={'body':{'type':Sequelize[_0x318f('0x1')](_0x318f('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x318f('0x3')]('in','out'),'defaultValue':_0x318f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x318f('0x5')]},'providerName':{'type':Sequelize[_0x318f('0x6')]},'providerResponse':{'type':Sequelize[_0x318f('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 6a353d0..c0984aa 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 _0xb3f4=['includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','chat-interactions','accept','read','readAt','format','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','channel','event','EventManager','acceptmessage','parse','reject','chat','interaction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','fullname','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','offset','limit','undefined','count','set','apply','save','update','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options'];(function(_0x41a5ed,_0x42436f){var _0x113af4=function(_0x1780bf){while(--_0x1780bf){_0x41a5ed['push'](_0x41a5ed['shift']());}};_0x113af4(++_0x42436f);}(_0xb3f4,0x143));var _0x4b3f=function(_0xc14b5e,_0x14c4fb){_0xc14b5e=_0xc14b5e-0x0;var _0x2a0724=_0xb3f4[_0xc14b5e];return _0x2a0724;};'use strict';var emlformat=require(_0x4b3f('0x0'));var rimraf=require(_0x4b3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b3f('0x2'));var rp=require(_0x4b3f('0x3'));var moment=require(_0x4b3f('0x4'));var BPromise=require(_0x4b3f('0x5'));var Mustache=require('mustache');var util=require(_0x4b3f('0x6'));var path=require(_0x4b3f('0x7'));var sox=require('sox');var csv=require(_0x4b3f('0x8'));var ejs=require(_0x4b3f('0x9'));var fs=require('fs');var fs_extra=require(_0x4b3f('0xa'));var _=require(_0x4b3f('0xb'));var squel=require(_0x4b3f('0xc'));var crypto=require(_0x4b3f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4b3f('0xe'));var toCsv=require(_0x4b3f('0x8'));var querystring=require(_0x4b3f('0xf'));var Papa=require('papaparse');var Redis=require(_0x4b3f('0x10'));var authService=require(_0x4b3f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4b3f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b3f('0x13'))(_0x4b3f('0x14'));var utils=require(_0x4b3f('0x15'));var config=require(_0x4b3f('0x16'));var licenseUtil=require(_0x4b3f('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4b3f('0x18')](config[_0x4b3f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b3f('0x1a'))(new Redis(config['redis']));require(_0x4b3f('0x1b'))[_0x4b3f('0x1c')](socket);var jayson=require(_0x4b3f('0x1d'));var client=jayson[_0x4b3f('0x1e')][_0x4b3f('0x1f')]({'port':0x232c});var client9002=jayson[_0x4b3f('0x1e')][_0x4b3f('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x7d8e5d,_0x37dfd1,_0xabea98,_0x3e4016){return new BPromise(function(_0x48834d,_0x8758ce){var _0x11deb6=_0x3e4016||client;return _0x11deb6[_0x4b3f('0x20')](_0x7d8e5d,_0xabea98)[_0x4b3f('0x21')](function(_0x51e541){logger[_0x4b3f('0x22')](_0x4b3f('0x23'),_0x37dfd1,_0x4b3f('0x24'));logger['debug'](_0x4b3f('0x25'),_0x37dfd1,_0x4b3f('0x24'),JSON[_0x4b3f('0x26')](_0x51e541));if(_0x51e541[_0x4b3f('0x27')]){if(_0x51e541['error']['code']===0x1f4){logger[_0x4b3f('0x27')](_0x4b3f('0x23'),_0x37dfd1,_0x51e541[_0x4b3f('0x27')][_0x4b3f('0x28')]);return _0x8758ce(_0x51e541[_0x4b3f('0x27')]['message']);}logger[_0x4b3f('0x27')](_0x4b3f('0x23'),_0x37dfd1,_0x51e541[_0x4b3f('0x27')][_0x4b3f('0x28')]);return _0x48834d(_0x51e541[_0x4b3f('0x27')][_0x4b3f('0x28')]);}else{logger[_0x4b3f('0x22')]('ChatMessage,\x20%s,\x20%s',_0x37dfd1,'request\x20sent');_0x48834d(_0x51e541[_0x4b3f('0x29')][_0x4b3f('0x28')]);}})['catch'](function(_0x4ddae9){logger['error']('ChatMessage,\x20%s,\x20%s',_0x37dfd1,_0x4ddae9);_0x8758ce(_0x4ddae9);});});}function respondWithStatusCode(_0x102545,_0x11c328){_0x11c328=_0x11c328||0xcc;return function(_0x8c1b7b){if(_0x8c1b7b){return _0x102545[_0x4b3f('0x2a')](_0x11c328);}return _0x102545[_0x4b3f('0x2b')](_0x11c328)[_0x4b3f('0x2c')]();};}function respondWithResult(_0x27154a,_0x422838){_0x422838=_0x422838||0xc8;return function(_0x1b18fb){if(_0x1b18fb){return _0x27154a[_0x4b3f('0x2b')](_0x422838)['json'](_0x1b18fb);}};}function respondWithFilteredResult(_0x48a9df,_0x52e650){return function(_0x292931){if(_0x292931){var _0x4897d9=typeof _0x52e650[_0x4b3f('0x2d')]==='undefined'&&typeof _0x52e650[_0x4b3f('0x2e')]===_0x4b3f('0x2f');var _0x332703=_0x292931[_0x4b3f('0x30')];var _0x1dbdca=_0x4897d9?0x0:_0x52e650['offset'];var _0x4753b8=_0x4897d9?_0x292931[_0x4b3f('0x30')]:_0x52e650[_0x4b3f('0x2d')]+_0x52e650['limit'];var _0x25a2c1;if(_0x4753b8>=_0x332703){_0x4753b8=_0x332703;_0x25a2c1=0xc8;}else{_0x25a2c1=0xce;}_0x48a9df[_0x4b3f('0x2b')](_0x25a2c1);return _0x48a9df[_0x4b3f('0x31')]('Content-Range',_0x1dbdca+'-'+_0x4753b8+'/'+_0x332703)['json'](_0x292931);}return null;};}function patchUpdates(_0x97b131){return function(_0x317b8d){try{jsonpatch[_0x4b3f('0x32')](_0x317b8d,_0x97b131,!![]);}catch(_0x457f41){return BPromise['reject'](_0x457f41);}return _0x317b8d[_0x4b3f('0x33')]();};}function saveUpdates(_0x63b69b,_0x126e8d){return function(_0x3da0a6){if(_0x3da0a6){return _0x3da0a6[_0x4b3f('0x34')](_0x63b69b)[_0x4b3f('0x21')](function(_0x5174c6){return _0x5174c6;});}return null;};}function removeEntity(_0x171b46,_0x5194d6){return function(_0x2d8938){if(_0x2d8938){return _0x2d8938[_0x4b3f('0x35')]()[_0x4b3f('0x21')](function(){_0x171b46[_0x4b3f('0x2b')](0xcc)[_0x4b3f('0x2c')]();});}};}function handleEntityNotFound(_0xe2101b,_0x53cd1d){return function(_0xf7dc4e){if(!_0xf7dc4e){_0xe2101b[_0x4b3f('0x2a')](0x194);}return _0xf7dc4e;};}function handleError(_0x2bd258,_0x23812c){_0x23812c=_0x23812c||0x1f4;return function(_0x38f130){logger['error'](_0x38f130[_0x4b3f('0x36')]);if(_0x38f130[_0x4b3f('0x37')]){delete _0x38f130['name'];}_0x2bd258[_0x4b3f('0x2b')](_0x23812c)[_0x4b3f('0x38')](_0x38f130);};}exports[_0x4b3f('0x39')]=function(_0x14c4bf,_0x47021e){var _0x47a195={},_0x388bdc={},_0x436615={'count':0x0,'rows':[]};var _0x4d6d12=_['map'](db[_0x4b3f('0x3a')][_0x4b3f('0x3b')],function(_0x593324){return{'name':_0x593324[_0x4b3f('0x3c')],'type':_0x593324[_0x4b3f('0x3d')][_0x4b3f('0x3e')]};});_0x388bdc[_0x4b3f('0x3f')]=_[_0x4b3f('0x40')](_0x4d6d12,'name');_0x388bdc[_0x4b3f('0x41')]=_[_0x4b3f('0x42')](_0x14c4bf[_0x4b3f('0x41')]);_0x388bdc['filters']=_['intersection'](_0x388bdc[_0x4b3f('0x3f')],_0x388bdc[_0x4b3f('0x41')]);_0x47a195['attributes']=_[_0x4b3f('0x43')](_0x388bdc['model'],qs[_0x4b3f('0x44')](_0x14c4bf[_0x4b3f('0x41')][_0x4b3f('0x44')]));_0x47a195[_0x4b3f('0x45')]=_0x47a195[_0x4b3f('0x45')][_0x4b3f('0x46')]?_0x47a195[_0x4b3f('0x45')]:_0x388bdc['model'];if(!_0x14c4bf['query'][_0x4b3f('0x47')](_0x4b3f('0x48'))){_0x47a195[_0x4b3f('0x2e')]=qs[_0x4b3f('0x2e')](_0x14c4bf[_0x4b3f('0x41')][_0x4b3f('0x2e')]);_0x47a195[_0x4b3f('0x2d')]=qs[_0x4b3f('0x2d')](_0x14c4bf[_0x4b3f('0x41')]['offset']);}_0x47a195[_0x4b3f('0x49')]=qs[_0x4b3f('0x4a')](_0x14c4bf[_0x4b3f('0x41')][_0x4b3f('0x4a')]);_0x47a195['where']=qs[_0x4b3f('0x4b')](_[_0x4b3f('0x4c')](_0x14c4bf[_0x4b3f('0x41')],_0x388bdc[_0x4b3f('0x4b')]),_0x4d6d12);if(_0x14c4bf[_0x4b3f('0x41')][_0x4b3f('0x4d')]){_0x47a195['where']=_[_0x4b3f('0x4e')](_0x47a195[_0x4b3f('0x4f')],{'$or':_['map'](_0x4d6d12,function(_0x4e2256){if(_0x4e2256[_0x4b3f('0x3d')]!==_0x4b3f('0x50')){var _0x46982e={};_0x46982e[_0x4e2256[_0x4b3f('0x37')]]={'$like':'%'+_0x14c4bf[_0x4b3f('0x41')][_0x4b3f('0x4d')]+'%'};return _0x46982e;}})});}_0x47a195=_[_0x4b3f('0x4e')]({},_0x47a195,_0x14c4bf[_0x4b3f('0x51')]);var _0x2d7f74={'where':_0x47a195[_0x4b3f('0x4f')]};return db[_0x4b3f('0x3a')]['count'](_0x2d7f74)[_0x4b3f('0x21')](function(_0x57a620){_0x436615[_0x4b3f('0x30')]=_0x57a620;if(_0x14c4bf[_0x4b3f('0x41')][_0x4b3f('0x52')]){_0x47a195[_0x4b3f('0x53')]=[{'all':!![]}];}return db[_0x4b3f('0x3a')][_0x4b3f('0x54')](_0x47a195);})[_0x4b3f('0x21')](function(_0x598242){_0x436615[_0x4b3f('0x55')]=_0x598242;return _0x436615;})[_0x4b3f('0x21')](respondWithFilteredResult(_0x47021e,_0x47a195))[_0x4b3f('0x56')](handleError(_0x47021e,null));};exports[_0x4b3f('0x57')]=function(_0x4ce40f,_0x595bb4){var _0x5c4819={'raw':!![],'where':{'id':_0x4ce40f[_0x4b3f('0x58')]['id']}},_0x59773b={};_0x59773b['model']=_[_0x4b3f('0x42')](db['ChatMessage'][_0x4b3f('0x3b')]);_0x59773b[_0x4b3f('0x41')]=_['keys'](_0x4ce40f[_0x4b3f('0x41')]);_0x59773b[_0x4b3f('0x4b')]=_['intersection'](_0x59773b[_0x4b3f('0x3f')],_0x59773b[_0x4b3f('0x41')]);_0x5c4819['attributes']=_[_0x4b3f('0x43')](_0x59773b[_0x4b3f('0x3f')],qs[_0x4b3f('0x44')](_0x4ce40f[_0x4b3f('0x41')][_0x4b3f('0x44')]));_0x5c4819[_0x4b3f('0x45')]=_0x5c4819['attributes'][_0x4b3f('0x46')]?_0x5c4819[_0x4b3f('0x45')]:_0x59773b[_0x4b3f('0x3f')];if(_0x4ce40f['query']['includeAll']){_0x5c4819[_0x4b3f('0x53')]=[{'all':!![]}];}_0x5c4819=_[_0x4b3f('0x4e')]({},_0x5c4819,_0x4ce40f[_0x4b3f('0x51')]);return db[_0x4b3f('0x3a')][_0x4b3f('0x59')](_0x5c4819)[_0x4b3f('0x21')](handleEntityNotFound(_0x595bb4,null))['then'](respondWithResult(_0x595bb4,null))[_0x4b3f('0x56')](handleError(_0x595bb4,null));};exports['create']=function(_0x3109d0,_0xd8dbb9){return db['ChatMessage'][_0x4b3f('0x5a')](_0x3109d0[_0x4b3f('0x5b')],{})[_0x4b3f('0x21')](respondWithResult(_0xd8dbb9,0xc9))[_0x4b3f('0x56')](handleError(_0xd8dbb9,null));};exports[_0x4b3f('0x34')]=function(_0x3e0e7a,_0x52fd3a){if(_0x3e0e7a['body']['id']){delete _0x3e0e7a[_0x4b3f('0x5b')]['id'];}return db[_0x4b3f('0x3a')][_0x4b3f('0x59')]({'where':{'id':_0x3e0e7a[_0x4b3f('0x58')]['id']}})[_0x4b3f('0x21')](handleEntityNotFound(_0x52fd3a,null))[_0x4b3f('0x21')](saveUpdates(_0x3e0e7a[_0x4b3f('0x5b')],null))['then'](respondWithResult(_0x52fd3a,null))['catch'](handleError(_0x52fd3a,null));};exports[_0x4b3f('0x35')]=function(_0x415399,_0x109576){return db['ChatMessage'][_0x4b3f('0x59')]({'where':{'id':_0x415399[_0x4b3f('0x58')]['id']}})['then'](handleEntityNotFound(_0x109576,null))['then'](removeEntity(_0x109576,null))[_0x4b3f('0x56')](handleError(_0x109576,null));};exports[_0x4b3f('0x5c')]=function(_0x1d65ff,_0x4d27d9){return db[_0x4b3f('0x3a')]['describe']()[_0x4b3f('0x21')](respondWithResult(_0x4d27d9,null))['catch'](handleError(_0x4d27d9,null));};var interaction_log=require(_0x4b3f('0x13'))(_0x4b3f('0x5d'));exports[_0x4b3f('0x5e')]=function(_0x233b29,_0x5a3a86,_0x5e7831){var _0x4310e7={'agent':{},'channel':'chat'};if(_0x233b29[_0x4b3f('0x5b')]['id']){delete _0x233b29[_0x4b3f('0x5b')]['id'];}_0x233b29['body'][_0x4b3f('0x5f')]=!![];_0x233b29[_0x4b3f('0x5b')][_0x4b3f('0x60')]=moment()[_0x4b3f('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x233b29[_0x4b3f('0x5b')]['UserId']=_0x233b29[_0x4b3f('0x5b')][_0x4b3f('0x62')]||_0x233b29['user']['id'];_0x4310e7[_0x4b3f('0x63')]['id']=_0x233b29[_0x4b3f('0x5b')][_0x4b3f('0x62')];return db[_0x4b3f('0x3a')][_0x4b3f('0x59')]({'where':{'id':_0x233b29['params']['id'],'UserId':null}})[_0x4b3f('0x21')](handleEntityNotFound(_0x5a3a86,null))[_0x4b3f('0x21')](saveUpdates(_0x233b29[_0x4b3f('0x5b')],null))['then'](function(_0x15e3d3){if(_0x15e3d3){_0x4310e7['message']=_0x15e3d3[_0x4b3f('0x64')]({'plain':!![]});return db[_0x4b3f('0x65')][_0x4b3f('0x59')]({'where':{'id':_0x15e3d3[_0x4b3f('0x66')]}});}return null;})[_0x4b3f('0x21')](handleEntityNotFound(_0x5a3a86,null))[_0x4b3f('0x21')](function(_0x52135c){if(_0x52135c){return _0x52135c[_0x4b3f('0x34')]({'UserId':_0x233b29[_0x4b3f('0x5b')][_0x4b3f('0x62')],'read1stAt':_[_0x4b3f('0x67')](_0x52135c['read1stAt'])?moment()[_0x4b3f('0x61')](_0x4b3f('0x68')):undefined});}return null;})[_0x4b3f('0x21')](function(_0x411214){if(_0x411214){_0x4310e7['interaction']=_0x411214[_0x4b3f('0x64')]({'plain':!![]});interaction_log[_0x4b3f('0x22')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x233b29[_0x4b3f('0x69')]['id'],_0x233b29[_0x4b3f('0x69')]['name'],_0x233b29[_0x4b3f('0x69')][_0x4b3f('0x6a')],_0x4310e7['interaction']['id'],_0x233b29[_0x4b3f('0x5b')]?JSON[_0x4b3f('0x26')](_0x233b29[_0x4b3f('0x5b')]):_0x4b3f('0x6b'));return respondWithRpcPromise(_0x4b3f('0x6c'),_0x4b3f('0x6d'),_0x4310e7);}return null;})[_0x4b3f('0x21')](function(_0x2e28e5){var _0xec2a=_0x4b3f('0x6e')+_0x2e28e5[_0x4b3f('0x28')][_0x4b3f('0x6f')];return db[_0x4b3f('0x70')]['query'](_0xec2a,{'type':db[_0x4b3f('0x71')][_0x4b3f('0x72')][_0x4b3f('0x73')],'raw':!![]})[_0x4b3f('0x21')](function(_0x4535fa){return _0x4535fa;});})[_0x4b3f('0x21')](function(_0x3ede41){if(_0x3ede41){_0x4310e7[_0x4b3f('0x28')][_0x4b3f('0x74')]=_0x3ede41[0x0];if(!_0x233b29[_0x4b3f('0x5b')]['UserId'])return;return db['User'][_0x4b3f('0x59')]({'where':{'id':_0x233b29['body'][_0x4b3f('0x62')],'role':'agent'},'attributes':['id',_0x4b3f('0x37'),'fullname',_0x4b3f('0x75'),_0x4b3f('0x76')],'raw':!![]});}return null;})[_0x4b3f('0x21')](function(_0x233768){if(!_0x233768)return null;_0x4310e7['message'][_0x4b3f('0x63')]=_0x233768;return _0x4310e7;})[_0x4b3f('0x21')](function(_0xa3668c){if(_0xa3668c){if(_0x233b29['body'][_0x4b3f('0x77')]){_0x4310e7['message'][_0x4b3f('0x78')]=util['format']('SIP/%s',_0x233b29[_0x4b3f('0x69')][_0x4b3f('0x37')]);_0x4310e7[_0x4b3f('0x28')][_0x4b3f('0x79')]=_0x4310e7[_0x4b3f('0x79')];_0x4310e7['message']['motionChannel']=_0x4310e7[_0x4b3f('0x79')];_0x4310e7[_0x4b3f('0x28')][_0x4b3f('0x7a')]=_0x4b3f('0x5e');return respondWithRpcPromise(_0x4b3f('0x7b'),_0x4b3f('0x7b'),{'event':_0x4b3f('0x7c'),'message':_[_0x4b3f('0x4e')](_0x4310e7[_0x4b3f('0x28')],JSON[_0x4b3f('0x7d')](_0x4310e7['interaction']['formData']))},client9002)[_0x4b3f('0x21')](function(){return _0x4310e7;});}return _0x4310e7;}return null;})['then'](respondWithResult(_0x5a3a86,null))[_0x4b3f('0x56')](handleError(_0x5a3a86,null));};var interaction_log=require(_0x4b3f('0x13'))(_0x4b3f('0x5d'));exports[_0x4b3f('0x7e')]=function(_0x2a9677,_0x1693b1,_0x80cd22){var _0x46c2d1={'agent':{},'channel':_0x4b3f('0x7f')};if(_0x2a9677[_0x4b3f('0x5b')]['id']){delete _0x2a9677[_0x4b3f('0x5b')]['id'];}_0x2a9677[_0x4b3f('0x5b')][_0x4b3f('0x62')]=_0x2a9677['body'][_0x4b3f('0x62')]||_0x2a9677[_0x4b3f('0x69')]['id'];_0x46c2d1[_0x4b3f('0x63')]['id']=_0x2a9677['body'][_0x4b3f('0x62')];return db['ChatMessage'][_0x4b3f('0x59')]({'where':{'id':_0x2a9677[_0x4b3f('0x58')]['id'],'UserId':null}})[_0x4b3f('0x21')](handleEntityNotFound(_0x1693b1,null))[_0x4b3f('0x21')](function(_0x35d372){if(_0x35d372){_0x46c2d1[_0x4b3f('0x28')]=_0x35d372['get']({'plain':!![]});return db[_0x4b3f('0x65')][_0x4b3f('0x59')]({'where':{'id':_0x35d372[_0x4b3f('0x66')]}});}return null;})[_0x4b3f('0x21')](handleEntityNotFound(_0x1693b1,null))['then'](function(_0x26eb87){if(_0x26eb87){_0x46c2d1[_0x4b3f('0x80')]=_0x26eb87[_0x4b3f('0x64')]({'plain':!![]});interaction_log['info'](_0x4b3f('0x81'),_0x2a9677[_0x4b3f('0x69')]['id'],_0x2a9677['user'][_0x4b3f('0x37')],_0x2a9677[_0x4b3f('0x69')][_0x4b3f('0x6a')],_0x46c2d1['interaction']['id'],_0x2a9677['body']?JSON[_0x4b3f('0x26')](_0x2a9677['body']):_0x4b3f('0x6b'));return respondWithRpcPromise(_0x4b3f('0x82'),_0x4b3f('0x83'),_0x46c2d1);}return null;})['then'](function(_0x171b5b){var _0xca9f45=_0x4b3f('0x6e')+_0x171b5b[_0x4b3f('0x28')][_0x4b3f('0x6f')];return db[_0x4b3f('0x70')][_0x4b3f('0x41')](_0xca9f45,{'type':db['Sequelize'][_0x4b3f('0x72')][_0x4b3f('0x73')],'raw':!![]})[_0x4b3f('0x21')](function(_0x16fe77){return _0x16fe77;});})[_0x4b3f('0x21')](function(_0x319195){if(_0x319195){_0x46c2d1[_0x4b3f('0x28')][_0x4b3f('0x74')]=_0x319195[0x0];if(!_0x2a9677[_0x4b3f('0x5b')][_0x4b3f('0x62')])return;return db[_0x4b3f('0x84')][_0x4b3f('0x59')]({'where':{'id':_0x2a9677['body']['UserId'],'role':_0x4b3f('0x63')},'attributes':['id','name',_0x4b3f('0x85'),_0x4b3f('0x75'),_0x4b3f('0x76')],'raw':!![]});}return null;})[_0x4b3f('0x21')](function(_0x459cd4){if(!_0x459cd4)return null;_0x46c2d1['message'][_0x4b3f('0x63')]=_0x459cd4;return _0x46c2d1;})[_0x4b3f('0x21')](function(_0x18ccc2){if(_0x18ccc2){_0x18ccc2['message'][_0x4b3f('0x78')]=util[_0x4b3f('0x61')]('SIP/%s',_0x2a9677[_0x4b3f('0x69')][_0x4b3f('0x37')]);_0x18ccc2[_0x4b3f('0x28')][_0x4b3f('0x79')]=_0x46c2d1[_0x4b3f('0x79')];_0x18ccc2['message']['motionChannel']=_0x46c2d1[_0x4b3f('0x79')];_0x18ccc2['message'][_0x4b3f('0x7a')]=_0x4b3f('0x7e');respondWithRpcPromise(_0x4b3f('0x7b'),_0x4b3f('0x7b'),{'event':_0x4b3f('0x86'),'message':_[_0x4b3f('0x4e')](_0x46c2d1[_0x4b3f('0x28')],JSON[_0x4b3f('0x7d')](_0x46c2d1['interaction']['formData']))},client9002);return _0x46c2d1;}return null;})[_0x4b3f('0x21')](respondWithResult(_0x1693b1,null))[_0x4b3f('0x56')](handleError(_0x1693b1,null));}; \ No newline at end of file +var _0xe18e=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','offset','undefined','limit','count','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','merge','options','ChatMessage','include','findAll','rows','params','includeAll','create','find','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','email','internal','event','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x262957,_0x34c699){var _0x27e221=function(_0x49e5cf){while(--_0x49e5cf){_0x262957['push'](_0x262957['shift']());}};_0x27e221(++_0x34c699);}(_0xe18e,0x75));var _0xee18=function(_0x38ac48,_0x305afb){_0x38ac48=_0x38ac48-0x0;var _0x2c4ee2=_0xe18e[_0x38ac48];return _0x2c4ee2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee18('0x0'));var zipdir=require(_0xee18('0x1'));var jsonpatch=require(_0xee18('0x2'));var rp=require(_0xee18('0x3'));var moment=require(_0xee18('0x4'));var BPromise=require(_0xee18('0x5'));var Mustache=require(_0xee18('0x6'));var util=require(_0xee18('0x7'));var path=require(_0xee18('0x8'));var sox=require(_0xee18('0x9'));var csv=require(_0xee18('0xa'));var ejs=require(_0xee18('0xb'));var fs=require('fs');var fs_extra=require(_0xee18('0xc'));var _=require(_0xee18('0xd'));var squel=require('squel');var crypto=require(_0xee18('0xe'));var jsforce=require(_0xee18('0xf'));var deskjs=require(_0xee18('0x10'));var toCsv=require(_0xee18('0xa'));var querystring=require(_0xee18('0x11'));var Papa=require(_0xee18('0x12'));var Redis=require(_0xee18('0x13'));var authService=require(_0xee18('0x14'));var qs=require(_0xee18('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee18('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xee18('0x17'));var config=require(_0xee18('0x18'));var licenseUtil=require(_0xee18('0x19'));var db=require(_0xee18('0x1a'))['db'];config[_0xee18('0x1b')]=_['defaults'](config[_0xee18('0x1b')],{'host':_0xee18('0x1c'),'port':0x18eb});var socket=require(_0xee18('0x1d'))(new Redis(config[_0xee18('0x1b')]));require('./chatMessage.socket')[_0xee18('0x1e')](socket);var jayson=require(_0xee18('0x1f'));var client=jayson[_0xee18('0x20')][_0xee18('0x21')]({'port':0x232c});var client9002=jayson[_0xee18('0x20')][_0xee18('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2358e7,_0x2f17b7,_0x55cf33,_0x5ae4cd){return new BPromise(function(_0x4659b3,_0x2d1dd2){var _0x4e3fde=_0x5ae4cd||client;return _0x4e3fde['request'](_0x2358e7,_0x55cf33)[_0xee18('0x22')](function(_0x1223a5){logger[_0xee18('0x23')](_0xee18('0x24'),_0x2f17b7,_0xee18('0x25'));logger[_0xee18('0x26')](_0xee18('0x27'),_0x2f17b7,_0xee18('0x25'),JSON[_0xee18('0x28')](_0x1223a5));if(_0x1223a5[_0xee18('0x29')]){if(_0x1223a5[_0xee18('0x29')]['code']===0x1f4){logger[_0xee18('0x29')]('ChatMessage,\x20%s,\x20%s',_0x2f17b7,_0x1223a5[_0xee18('0x29')]['message']);return _0x2d1dd2(_0x1223a5[_0xee18('0x29')][_0xee18('0x2a')]);}logger[_0xee18('0x29')](_0xee18('0x24'),_0x2f17b7,_0x1223a5[_0xee18('0x29')][_0xee18('0x2a')]);return _0x4659b3(_0x1223a5['error'][_0xee18('0x2a')]);}else{logger['info'](_0xee18('0x24'),_0x2f17b7,_0xee18('0x25'));_0x4659b3(_0x1223a5[_0xee18('0x2b')]['message']);}})[_0xee18('0x2c')](function(_0x4e0a13){logger['error'](_0xee18('0x24'),_0x2f17b7,_0x4e0a13);_0x2d1dd2(_0x4e0a13);});});}function respondWithStatusCode(_0x3775cf,_0x16c0c9){_0x16c0c9=_0x16c0c9||0xcc;return function(_0x2687a1){if(_0x2687a1){return _0x3775cf['sendStatus'](_0x16c0c9);}return _0x3775cf[_0xee18('0x2d')](_0x16c0c9)[_0xee18('0x2e')]();};}function respondWithResult(_0x149906,_0x38e989){_0x38e989=_0x38e989||0xc8;return function(_0x5ac9c8){if(_0x5ac9c8){return _0x149906[_0xee18('0x2d')](_0x38e989)['json'](_0x5ac9c8);}};}function respondWithFilteredResult(_0x333a3f,_0x1b0228){return function(_0x40c26c){if(_0x40c26c){var _0x6cae72=typeof _0x1b0228[_0xee18('0x2f')]===_0xee18('0x30')&&typeof _0x1b0228[_0xee18('0x31')]===_0xee18('0x30');var _0xb2df3f=_0x40c26c['count'];var _0x2f675f=_0x6cae72?0x0:_0x1b0228[_0xee18('0x2f')];var _0x260708=_0x6cae72?_0x40c26c[_0xee18('0x32')]:_0x1b0228[_0xee18('0x2f')]+_0x1b0228['limit'];var _0x2074fe;if(_0x260708>=_0xb2df3f){_0x260708=_0xb2df3f;_0x2074fe=0xc8;}else{_0x2074fe=0xce;}_0x333a3f[_0xee18('0x2d')](_0x2074fe);return _0x333a3f['set']('Content-Range',_0x2f675f+'-'+_0x260708+'/'+_0xb2df3f)[_0xee18('0x33')](_0x40c26c);}return null;};}function patchUpdates(_0x587dbc){return function(_0x4af2ca){try{jsonpatch[_0xee18('0x34')](_0x4af2ca,_0x587dbc,!![]);}catch(_0xb4c7b3){return BPromise[_0xee18('0x35')](_0xb4c7b3);}return _0x4af2ca[_0xee18('0x36')]();};}function saveUpdates(_0x1c1b9e,_0x174165){return function(_0xdcd18c){if(_0xdcd18c){return _0xdcd18c[_0xee18('0x37')](_0x1c1b9e)[_0xee18('0x22')](function(_0x4927b7){return _0x4927b7;});}return null;};}function removeEntity(_0x48d72a,_0x4134ba){return function(_0x174acf){if(_0x174acf){return _0x174acf[_0xee18('0x38')]()['then'](function(){_0x48d72a[_0xee18('0x2d')](0xcc)[_0xee18('0x2e')]();});}};}function handleEntityNotFound(_0x3b8589,_0x5cb59a){return function(_0x291a59){if(!_0x291a59){_0x3b8589[_0xee18('0x39')](0x194);}return _0x291a59;};}function handleError(_0x4d6d70,_0x23976c){_0x23976c=_0x23976c||0x1f4;return function(_0xa98695){logger['error'](_0xa98695[_0xee18('0x3a')]);if(_0xa98695[_0xee18('0x3b')]){delete _0xa98695[_0xee18('0x3b')];}_0x4d6d70[_0xee18('0x2d')](_0x23976c)[_0xee18('0x3c')](_0xa98695);};}exports[_0xee18('0x3d')]=function(_0x24b3ae,_0x180b7c){var _0x1308ca={},_0x1171ea={},_0x7445d1={'count':0x0,'rows':[]};var _0x2b6bdc=_[_0xee18('0x3e')](db['ChatMessage'][_0xee18('0x3f')],function(_0x3ea3ff){return{'name':_0x3ea3ff[_0xee18('0x40')],'type':_0x3ea3ff['type'][_0xee18('0x41')]};});_0x1171ea['model']=_[_0xee18('0x3e')](_0x2b6bdc,_0xee18('0x3b'));_0x1171ea['query']=_[_0xee18('0x42')](_0x24b3ae[_0xee18('0x43')]);_0x1171ea['filters']=_[_0xee18('0x44')](_0x1171ea[_0xee18('0x45')],_0x1171ea[_0xee18('0x43')]);_0x1308ca[_0xee18('0x46')]=_[_0xee18('0x44')](_0x1171ea[_0xee18('0x45')],qs['fields'](_0x24b3ae[_0xee18('0x43')][_0xee18('0x47')]));_0x1308ca[_0xee18('0x46')]=_0x1308ca[_0xee18('0x46')][_0xee18('0x48')]?_0x1308ca[_0xee18('0x46')]:_0x1171ea[_0xee18('0x45')];if(!_0x24b3ae[_0xee18('0x43')][_0xee18('0x49')](_0xee18('0x4a'))){_0x1308ca[_0xee18('0x31')]=qs[_0xee18('0x31')](_0x24b3ae['query'][_0xee18('0x31')]);_0x1308ca[_0xee18('0x2f')]=qs[_0xee18('0x2f')](_0x24b3ae['query'][_0xee18('0x2f')]);}_0x1308ca[_0xee18('0x4b')]=qs[_0xee18('0x4c')](_0x24b3ae[_0xee18('0x43')][_0xee18('0x4c')]);_0x1308ca[_0xee18('0x4d')]=qs[_0xee18('0x4e')](_['pick'](_0x24b3ae['query'],_0x1171ea['filters']),_0x2b6bdc);if(_0x24b3ae[_0xee18('0x43')][_0xee18('0x4f')]){_0x1308ca[_0xee18('0x4d')]=_['merge'](_0x1308ca[_0xee18('0x4d')],{'$or':_['map'](_0x2b6bdc,function(_0x6618e3){if(_0x6618e3[_0xee18('0x50')]!=='VIRTUAL'){var _0x1019d0={};_0x1019d0[_0x6618e3[_0xee18('0x3b')]]={'$like':'%'+_0x24b3ae[_0xee18('0x43')][_0xee18('0x4f')]+'%'};return _0x1019d0;}})});}_0x1308ca=_[_0xee18('0x51')]({},_0x1308ca,_0x24b3ae[_0xee18('0x52')]);var _0x53fe5f={'where':_0x1308ca['where']};return db[_0xee18('0x53')][_0xee18('0x32')](_0x53fe5f)['then'](function(_0x4226ca){_0x7445d1['count']=_0x4226ca;if(_0x24b3ae[_0xee18('0x43')]['includeAll']){_0x1308ca[_0xee18('0x54')]=[{'all':!![]}];}return db[_0xee18('0x53')][_0xee18('0x55')](_0x1308ca);})[_0xee18('0x22')](function(_0x50f501){_0x7445d1[_0xee18('0x56')]=_0x50f501;return _0x7445d1;})[_0xee18('0x22')](respondWithFilteredResult(_0x180b7c,_0x1308ca))['catch'](handleError(_0x180b7c,null));};exports['show']=function(_0x53ebf1,_0x3bbb07){var _0x3b6a7d={'raw':!![],'where':{'id':_0x53ebf1[_0xee18('0x57')]['id']}},_0x2de0cf={};_0x2de0cf[_0xee18('0x45')]=_['keys'](db[_0xee18('0x53')][_0xee18('0x3f')]);_0x2de0cf[_0xee18('0x43')]=_['keys'](_0x53ebf1[_0xee18('0x43')]);_0x2de0cf[_0xee18('0x4e')]=_[_0xee18('0x44')](_0x2de0cf[_0xee18('0x45')],_0x2de0cf['query']);_0x3b6a7d[_0xee18('0x46')]=_[_0xee18('0x44')](_0x2de0cf[_0xee18('0x45')],qs[_0xee18('0x47')](_0x53ebf1[_0xee18('0x43')]['fields']));_0x3b6a7d[_0xee18('0x46')]=_0x3b6a7d['attributes'][_0xee18('0x48')]?_0x3b6a7d[_0xee18('0x46')]:_0x2de0cf[_0xee18('0x45')];if(_0x53ebf1[_0xee18('0x43')][_0xee18('0x58')]){_0x3b6a7d[_0xee18('0x54')]=[{'all':!![]}];}_0x3b6a7d=_[_0xee18('0x51')]({},_0x3b6a7d,_0x53ebf1[_0xee18('0x52')]);return db[_0xee18('0x53')]['find'](_0x3b6a7d)['then'](handleEntityNotFound(_0x3bbb07,null))[_0xee18('0x22')](respondWithResult(_0x3bbb07,null))['catch'](handleError(_0x3bbb07,null));};exports['create']=function(_0x41d317,_0xacd109){return db[_0xee18('0x53')][_0xee18('0x59')](_0x41d317['body'],{})[_0xee18('0x22')](respondWithResult(_0xacd109,0xc9))[_0xee18('0x2c')](handleError(_0xacd109,null));};exports[_0xee18('0x37')]=function(_0x1e9e75,_0x34b583){if(_0x1e9e75['body']['id']){delete _0x1e9e75['body']['id'];}return db[_0xee18('0x53')][_0xee18('0x5a')]({'where':{'id':_0x1e9e75['params']['id']}})[_0xee18('0x22')](handleEntityNotFound(_0x34b583,null))['then'](saveUpdates(_0x1e9e75[_0xee18('0x5b')],null))[_0xee18('0x22')](respondWithResult(_0x34b583,null))[_0xee18('0x2c')](handleError(_0x34b583,null));};exports[_0xee18('0x38')]=function(_0x823311,_0x48d55a){return db[_0xee18('0x53')]['find']({'where':{'id':_0x823311[_0xee18('0x57')]['id']}})[_0xee18('0x22')](handleEntityNotFound(_0x48d55a,null))[_0xee18('0x22')](removeEntity(_0x48d55a,null))['catch'](handleError(_0x48d55a,null));};exports[_0xee18('0x5c')]=function(_0x2255ab,_0x2278c8){return db['ChatMessage']['describe']()[_0xee18('0x22')](respondWithResult(_0x2278c8,null))['catch'](handleError(_0x2278c8,null));};var interaction_log=require('../../config/logger')(_0xee18('0x5d'));exports[_0xee18('0x5e')]=function(_0x3845a4,_0x1c60ae,_0x1eb521){var _0x4f662a={'agent':{},'channel':_0xee18('0x5f')};if(_0x3845a4[_0xee18('0x5b')]['id']){delete _0x3845a4[_0xee18('0x5b')]['id'];}_0x3845a4['body'][_0xee18('0x60')]=!![];_0x3845a4[_0xee18('0x5b')][_0xee18('0x61')]=moment()[_0xee18('0x62')](_0xee18('0x63'));_0x3845a4['body'][_0xee18('0x64')]=_0x3845a4['body'][_0xee18('0x64')]||_0x3845a4[_0xee18('0x65')]['id'];_0x4f662a[_0xee18('0x66')]['id']=_0x3845a4['body']['UserId'];return db[_0xee18('0x53')]['find']({'where':{'id':_0x3845a4[_0xee18('0x57')]['id'],'UserId':null}})[_0xee18('0x22')](handleEntityNotFound(_0x1c60ae,null))['then'](saveUpdates(_0x3845a4[_0xee18('0x5b')],null))[_0xee18('0x22')](function(_0x3f0243){if(_0x3f0243){_0x4f662a['message']=_0x3f0243['get']({'plain':!![]});return db[_0xee18('0x67')][_0xee18('0x5a')]({'where':{'id':_0x3f0243[_0xee18('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x1c60ae,null))['then'](function(_0x4a030b){if(_0x4a030b){return _0x4a030b['update']({'UserId':_0x3845a4['body'][_0xee18('0x64')],'read1stAt':_[_0xee18('0x69')](_0x4a030b[_0xee18('0x6a')])?moment()[_0xee18('0x62')](_0xee18('0x63')):undefined});}return null;})[_0xee18('0x22')](function(_0x5ec615){if(_0x5ec615){_0x4f662a[_0xee18('0x6b')]=_0x5ec615[_0xee18('0x6c')]({'plain':!![]});interaction_log[_0xee18('0x23')](_0xee18('0x6d'),_0x3845a4[_0xee18('0x65')]['id'],_0x3845a4[_0xee18('0x65')][_0xee18('0x3b')],_0x3845a4['user'][_0xee18('0x6e')],_0x4f662a[_0xee18('0x6b')]['id'],_0x3845a4[_0xee18('0x5b')]?JSON['stringify'](_0x3845a4[_0xee18('0x5b')]):_0xee18('0x6f'));return respondWithRpcPromise(_0xee18('0x70'),_0xee18('0x71'),_0x4f662a);}return null;})[_0xee18('0x22')](function(_0x40c89b){var _0x264d56=_0xee18('0x72')+_0x40c89b[_0xee18('0x2a')][_0xee18('0x73')];return db[_0xee18('0x74')][_0xee18('0x43')](_0x264d56,{'type':db[_0xee18('0x75')][_0xee18('0x76')]['SELECT'],'raw':!![]})[_0xee18('0x22')](function(_0x53aef1){return _0x53aef1;});})[_0xee18('0x22')](function(_0x50565f){if(_0x50565f){_0x4f662a[_0xee18('0x2a')][_0xee18('0x77')]=_0x50565f[0x0];if(!_0x3845a4[_0xee18('0x5b')][_0xee18('0x64')])return;return db[_0xee18('0x78')][_0xee18('0x5a')]({'where':{'id':_0x3845a4[_0xee18('0x5b')]['UserId'],'role':_0xee18('0x66')},'attributes':['id','name',_0xee18('0x79'),'email','internal'],'raw':!![]});}return null;})[_0xee18('0x22')](function(_0x23266b){if(!_0x23266b)return null;_0x4f662a['message'][_0xee18('0x66')]=_0x23266b;return _0x4f662a;})['then'](function(_0x52f175){if(_0x52f175){if(_0x3845a4['body']['manual']){_0x4f662a[_0xee18('0x2a')][_0xee18('0x7a')]=util[_0xee18('0x62')](_0xee18('0x7b'),_0x3845a4[_0xee18('0x65')][_0xee18('0x3b')]);_0x4f662a[_0xee18('0x2a')]['channel']=_0x4f662a[_0xee18('0x7c')];_0x4f662a['message'][_0xee18('0x7d')]=_0x4f662a[_0xee18('0x7c')];_0x4f662a['message']['event']=_0xee18('0x5e');return respondWithRpcPromise(_0xee18('0x7e'),_0xee18('0x7e'),{'event':_0xee18('0x7f'),'message':_[_0xee18('0x51')](_0x4f662a['message'],JSON[_0xee18('0x80')](_0x4f662a[_0xee18('0x6b')]['formData']))},client9002)['then'](function(){return _0x4f662a;});}return _0x4f662a;}return null;})[_0xee18('0x22')](respondWithResult(_0x1c60ae,null))['catch'](handleError(_0x1c60ae,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['reject']=function(_0x21d7ad,_0x136e84,_0x3fedd4){var _0xa36ec4={'agent':{},'channel':_0xee18('0x5f')};if(_0x21d7ad[_0xee18('0x5b')]['id']){delete _0x21d7ad[_0xee18('0x5b')]['id'];}_0x21d7ad[_0xee18('0x5b')][_0xee18('0x64')]=_0x21d7ad[_0xee18('0x5b')][_0xee18('0x64')]||_0x21d7ad[_0xee18('0x65')]['id'];_0xa36ec4[_0xee18('0x66')]['id']=_0x21d7ad[_0xee18('0x5b')][_0xee18('0x64')];return db[_0xee18('0x53')]['find']({'where':{'id':_0x21d7ad[_0xee18('0x57')]['id'],'UserId':null}})[_0xee18('0x22')](handleEntityNotFound(_0x136e84,null))[_0xee18('0x22')](function(_0x3c0466){if(_0x3c0466){_0xa36ec4[_0xee18('0x2a')]=_0x3c0466['get']({'plain':!![]});return db['ChatInteraction'][_0xee18('0x5a')]({'where':{'id':_0x3c0466['ChatInteractionId']}});}return null;})[_0xee18('0x22')](handleEntityNotFound(_0x136e84,null))[_0xee18('0x22')](function(_0x70e9e2){if(_0x70e9e2){_0xa36ec4[_0xee18('0x6b')]=_0x70e9e2['get']({'plain':!![]});interaction_log[_0xee18('0x23')](_0xee18('0x81'),_0x21d7ad[_0xee18('0x65')]['id'],_0x21d7ad['user']['name'],_0x21d7ad[_0xee18('0x65')][_0xee18('0x6e')],_0xa36ec4[_0xee18('0x6b')]['id'],_0x21d7ad[_0xee18('0x5b')]?JSON[_0xee18('0x28')](_0x21d7ad['body']):_0xee18('0x6f'));return respondWithRpcPromise(_0xee18('0x82'),_0xee18('0x83'),_0xa36ec4);}return null;})[_0xee18('0x22')](function(_0x60b528){var _0x541e5d=_0xee18('0x72')+_0x60b528[_0xee18('0x2a')][_0xee18('0x73')];return db['sequelize'][_0xee18('0x43')](_0x541e5d,{'type':db['Sequelize'][_0xee18('0x76')][_0xee18('0x84')],'raw':!![]})['then'](function(_0x470fd7){return _0x470fd7;});})['then'](function(_0x14a1c1){if(_0x14a1c1){_0xa36ec4[_0xee18('0x2a')]['contact']=_0x14a1c1[0x0];if(!_0x21d7ad[_0xee18('0x5b')]['UserId'])return;return db['User'][_0xee18('0x5a')]({'where':{'id':_0x21d7ad[_0xee18('0x5b')][_0xee18('0x64')],'role':_0xee18('0x66')},'attributes':['id',_0xee18('0x3b'),_0xee18('0x79'),_0xee18('0x85'),_0xee18('0x86')],'raw':!![]});}return null;})[_0xee18('0x22')](function(_0x254d64){if(!_0x254d64)return null;_0xa36ec4[_0xee18('0x2a')][_0xee18('0x66')]=_0x254d64;return _0xa36ec4;})[_0xee18('0x22')](function(_0x21a270){if(_0x21a270){_0x21a270[_0xee18('0x2a')][_0xee18('0x7a')]=util['format'](_0xee18('0x7b'),_0x21d7ad[_0xee18('0x65')][_0xee18('0x3b')]);_0x21a270['message']['channel']=_0xa36ec4[_0xee18('0x7c')];_0x21a270[_0xee18('0x2a')][_0xee18('0x7d')]=_0xa36ec4[_0xee18('0x7c')];_0x21a270[_0xee18('0x2a')][_0xee18('0x87')]=_0xee18('0x35');respondWithRpcPromise(_0xee18('0x7e'),_0xee18('0x7e'),{'event':_0xee18('0x88'),'message':_[_0xee18('0x51')](_0xa36ec4['message'],JSON[_0xee18('0x80')](_0xa36ec4[_0xee18('0x6b')]['formData']))},client9002);return _0xa36ec4;}return null;})[_0xee18('0x22')](respondWithResult(_0x136e84,null))[_0xee18('0x2c')](handleError(_0x136e84,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 504fedf..530b46d 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 _0x8d96=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x8d96,0x1b0));var _0x68d9=function(_0x40df90,_0x5e0e67){_0x40df90=_0x40df90-0x0;var _0x964ccd=_0x8d96[_0x40df90];return _0x964ccd;};'use strict';var EventEmitter=require(_0x68d9('0x0'));var ChatMessage=require(_0x68d9('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x68d9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x68d9('0x3'),'afterDestroy':_0x68d9('0x4')};function emitEvent(_0x2c9bce){return function(_0x2d1dc6,_0x4d433b,_0x483886){ChatMessageEvents['emit'](_0x2c9bce+':'+_0x2d1dc6['id'],_0x2d1dc6);ChatMessageEvents[_0x68d9('0x5')](_0x2c9bce,_0x2d1dc6);_0x483886(null);};}for(var e in events){if(events[_0x68d9('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x68d9('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0xc699=['ChatMessage','setMaxListeners','save','update','emit','exports','events','../../mysqldb'];(function(_0x188908,_0x42e5cf){var _0x2da0a5=function(_0x2c8edb){while(--_0x2c8edb){_0x188908['push'](_0x188908['shift']());}};_0x2da0a5(++_0x42e5cf);}(_0xc699,0x10e));var _0x9c69=function(_0x3c6b7d,_0x5f0d90){_0x3c6b7d=_0x3c6b7d-0x0;var _0x1d3ed2=_0xc699[_0x3c6b7d];return _0x1d3ed2;};'use strict';var EventEmitter=require(_0x9c69('0x0'));var ChatMessage=require(_0x9c69('0x1'))['db'][_0x9c69('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9c69('0x3')](0x0);var events={'afterCreate':_0x9c69('0x4'),'afterUpdate':_0x9c69('0x5'),'afterDestroy':'remove'};function emitEvent(_0x118813){return function(_0x437ea3,_0x11828e,_0x6c1799){ChatMessageEvents[_0x9c69('0x6')](_0x118813+':'+_0x437ea3['id'],_0x437ea3);ChatMessageEvents[_0x9c69('0x6')](_0x118813,_0x437ea3);_0x6c1799(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x9c69('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 1f0c788..5ce4544 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 _0x2706=['error','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','then','update','createdAt','catch'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x2706,0x1b4));var _0x6270=function(_0x4eaee5,_0x43f4e9){_0x4eaee5=_0x4eaee5-0x0;var _0x4e5c52=_0x2706[_0x4eaee5];return _0x4e5c52;};'use strict';var _=require(_0x6270('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6270('0x1'));var moment=require(_0x6270('0x2'));var BPromise=require(_0x6270('0x3'));var rp=require(_0x6270('0x4'));var fs=require('fs');var path=require(_0x6270('0x5'));var rimraf=require(_0x6270('0x6'));var config=require(_0x6270('0x7'));var attributes=require(_0x6270('0x8'));module[_0x6270('0x9')]=function(_0x315886,_0x28691e){return _0x315886[_0x6270('0xa')](_0x6270('0xb'),attributes,{'tableName':_0x6270('0xc'),'paranoid':![],'indexes':[{'name':_0x6270('0xd'),'fields':[_0x6270('0xe')],'type':_0x6270('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d2379,_0x41f103,_0x5f427a){var _0x2e38be=_0x315886[_0x6270('0x10')];var _0x203687=_0x4d2379[_0x6270('0x11')]({'plain':!![]});if(_0x203687[_0x6270('0x12')][_0x6270('0x13')]()==='in'||_0x203687[_0x6270('0x12')][_0x6270('0x13')]()===_0x6270('0x14')&&!_0x203687[_0x6270('0x15')]&&!_['isNil'](_0x203687[_0x6270('0x16')])){_0x2e38be[_0x6270('0x17')][_0x6270('0x18')]({'where':{'id':_0x203687['ChatInteractionId']}})[_0x6270('0x19')](function(_0xefcc53){if(_0xefcc53){_0xefcc53[_0x6270('0x1a')]({'lastMsgAt':_0x203687[_0x6270('0x1b')],'lastMsgDirection':_0x203687[_0x6270('0x12')][_0x6270('0x13')]()});}})[_0x6270('0x1c')](function(_0x1a9dd3){console[_0x6270('0x1d')](_0x1a9dd3);});}_0x5f427a();}},'charset':'utf8mb4','collate':_0x6270('0x1e')});}; \ No newline at end of file +var _0xf141=['./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x28f020,_0x5c971b){var _0x4d90a0=function(_0x5d67f7){while(--_0x5d67f7){_0x28f020['push'](_0x28f020['shift']());}};_0x4d90a0(++_0x5c971b);}(_0xf141,0xec));var _0x1f14=function(_0x41d947,_0x360fd9){_0x41d947=_0x41d947-0x0;var _0x15f848=_0xf141[_0x41d947];return _0x15f848;};'use strict';var _=require(_0x1f14('0x0'));var util=require(_0x1f14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1f14('0x2'));var BPromise=require(_0x1f14('0x3'));var rp=require(_0x1f14('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f14('0x5'));var config=require(_0x1f14('0x6'));var attributes=require(_0x1f14('0x7'));module[_0x1f14('0x8')]=function(_0x271c51,_0x489a91){return _0x271c51['define'](_0x1f14('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x1f14('0xa'),'fields':[_0x1f14('0xb')],'type':_0x1f14('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x427a5f,_0x3791a9,_0x1320cd){var _0x4998fc=_0x271c51[_0x1f14('0xd')];var _0x280ad5=_0x427a5f['get']({'plain':!![]});if(_0x280ad5[_0x1f14('0xe')]['toLowerCase']()==='in'||_0x280ad5[_0x1f14('0xe')][_0x1f14('0xf')]()==='out'&&!_0x280ad5[_0x1f14('0x10')]&&!_[_0x1f14('0x11')](_0x280ad5[_0x1f14('0x12')])){_0x4998fc[_0x1f14('0x13')][_0x1f14('0x14')]({'where':{'id':_0x280ad5[_0x1f14('0x15')]}})[_0x1f14('0x16')](function(_0x1452f9){if(_0x1452f9){_0x1452f9['update']({'lastMsgAt':_0x280ad5[_0x1f14('0x17')],'lastMsgDirection':_0x280ad5[_0x1f14('0xe')]['toLowerCase']()});}})[_0x1f14('0x18')](function(_0x5145c1){console[_0x1f14('0x19')](_0x5145c1);});}_0x1320cd();}},'charset':_0x1f14('0x1a'),'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 7b29283..2600a81 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 _0x7493=['body','options','raw','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreateChatMessage','ChatMessage','create'];(function(_0x442801,_0x406ee2){var _0x51cb59=function(_0x1d468d){while(--_0x1d468d){_0x442801['push'](_0x442801['shift']());}};_0x51cb59(++_0x406ee2);}(_0x7493,0x144));var _0x3749=function(_0x1f1366,_0x8232b9){_0x1f1366=_0x1f1366-0x0;var _0x155396=_0x7493[_0x1f1366];return _0x155396;};'use strict';var _=require(_0x3749('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3749('0x1'));var rs=require(_0x3749('0x2'));var fs=require('fs');var Redis=require(_0x3749('0x3'));var db=require(_0x3749('0x4'))['db'];var utils=require(_0x3749('0x5'));var logger=require(_0x3749('0x6'))(_0x3749('0x7'));var config=require(_0x3749('0x8'));var jayson=require(_0x3749('0x9'));var client=jayson['client'][_0x3749('0xa')]({'port':0x232a});config[_0x3749('0xb')]=_[_0x3749('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3749('0xb')]));require('./chatMessage.socket')[_0x3749('0xd')](socket);function respondWithRpcPromise(_0x5496b0,_0x315426,_0x4dad88){return new BPromise(function(_0xa0cd37,_0x129f74){return client[_0x3749('0xe')](_0x5496b0,_0x4dad88)[_0x3749('0xf')](function(_0x1e1e18){logger['info'](_0x3749('0x10'),_0x315426,_0x3749('0x11'));logger[_0x3749('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x315426,'request\x20sent',JSON[_0x3749('0x13')](_0x1e1e18));if(_0x1e1e18[_0x3749('0x14')]){if(_0x1e1e18[_0x3749('0x14')][_0x3749('0x15')]===0x1f4){logger[_0x3749('0x14')]('ChatMessage,\x20%s,\x20%s',_0x315426,_0x1e1e18[_0x3749('0x14')][_0x3749('0x16')]);return _0x129f74(_0x1e1e18['error'][_0x3749('0x16')]);}logger[_0x3749('0x14')]('ChatMessage,\x20%s,\x20%s',_0x315426,_0x1e1e18[_0x3749('0x14')][_0x3749('0x16')]);return _0xa0cd37(_0x1e1e18[_0x3749('0x14')][_0x3749('0x16')]);}else{logger[_0x3749('0x17')](_0x3749('0x10'),_0x315426,'request\x20sent');_0xa0cd37(_0x1e1e18[_0x3749('0x18')][_0x3749('0x16')]);}})['catch'](function(_0x593e90){logger[_0x3749('0x14')](_0x3749('0x10'),_0x315426,_0x593e90);_0x129f74(_0x593e90);});});}exports[_0x3749('0x19')]=function(_0xcb8edf){var _0x1b52da=this;return new Promise(function(_0x1281cf,_0x40cc72){return db[_0x3749('0x1a')][_0x3749('0x1b')](_0xcb8edf[_0x3749('0x1c')],{'raw':_0xcb8edf[_0x3749('0x1d')]?_0xcb8edf[_0x3749('0x1d')][_0x3749('0x1e')]===undefined?!![]:![]:!![]})[_0x3749('0xf')](function(_0x39e14a){logger[_0x3749('0x17')]('CreateChatMessage',_0xcb8edf);logger[_0x3749('0x12')](_0x3749('0x19'),_0xcb8edf,JSON[_0x3749('0x13')](_0x39e14a));_0x1281cf(_0x39e14a);})[_0x3749('0x1f')](function(_0x29e8af){logger[_0x3749('0x14')](_0x3749('0x19'),_0x29e8af['message'],_0xcb8edf);_0x40cc72(_0x1b52da[_0x3749('0x14')](0x1f4,_0x29e8af[_0x3749('0x16')]));});});}; \ No newline at end of file +var _0x7a28=['message','info','catch','CreateChatMessage','ChatMessage','create','options','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4cef81,_0x2cfe9c){var _0x5aab80=function(_0x57c349){while(--_0x57c349){_0x4cef81['push'](_0x4cef81['shift']());}};_0x5aab80(++_0x2cfe9c);}(_0x7a28,0x6a));var _0x87a2=function(_0x65f761,_0x78d59e){_0x65f761=_0x65f761-0x0;var _0x68ea6a=_0x7a28[_0x65f761];return _0x68ea6a;};'use strict';var _=require(_0x87a2('0x0'));var util=require(_0x87a2('0x1'));var moment=require(_0x87a2('0x2'));var BPromise=require('bluebird');var rs=require(_0x87a2('0x3'));var fs=require('fs');var Redis=require(_0x87a2('0x4'));var db=require(_0x87a2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x87a2('0x6'))(_0x87a2('0x7'));var config=require(_0x87a2('0x8'));var jayson=require(_0x87a2('0x9'));var client=jayson[_0x87a2('0xa')][_0x87a2('0xb')]({'port':0x232a});config[_0x87a2('0xc')]=_[_0x87a2('0xd')](config[_0x87a2('0xc')],{'host':_0x87a2('0xe'),'port':0x18eb});var socket=require(_0x87a2('0xf'))(new Redis(config[_0x87a2('0xc')]));require(_0x87a2('0x10'))[_0x87a2('0x11')](socket);function respondWithRpcPromise(_0x40b112,_0x325fde,_0xeb4034){return new BPromise(function(_0x126f50,_0x2a4075){return client[_0x87a2('0x12')](_0x40b112,_0xeb4034)[_0x87a2('0x13')](function(_0x2823a9){logger['info'](_0x87a2('0x14'),_0x325fde,'request\x20sent');logger[_0x87a2('0x15')](_0x87a2('0x16'),_0x325fde,_0x87a2('0x17'),JSON[_0x87a2('0x18')](_0x2823a9));if(_0x2823a9[_0x87a2('0x19')]){if(_0x2823a9[_0x87a2('0x19')]['code']===0x1f4){logger[_0x87a2('0x19')](_0x87a2('0x14'),_0x325fde,_0x2823a9[_0x87a2('0x19')][_0x87a2('0x1a')]);return _0x2a4075(_0x2823a9['error']['message']);}logger[_0x87a2('0x19')]('ChatMessage,\x20%s,\x20%s',_0x325fde,_0x2823a9['error']['message']);return _0x126f50(_0x2823a9['error']['message']);}else{logger[_0x87a2('0x1b')](_0x87a2('0x14'),_0x325fde,_0x87a2('0x17'));_0x126f50(_0x2823a9['result']['message']);}})[_0x87a2('0x1c')](function(_0x452d79){logger['error'](_0x87a2('0x14'),_0x325fde,_0x452d79);_0x2a4075(_0x452d79);});});}exports[_0x87a2('0x1d')]=function(_0x6d3e93){var _0x132140=this;return new Promise(function(_0x34c0df,_0x8e1e86){return db[_0x87a2('0x1e')][_0x87a2('0x1f')](_0x6d3e93['body'],{'raw':_0x6d3e93[_0x87a2('0x20')]?_0x6d3e93[_0x87a2('0x20')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x18e592){logger[_0x87a2('0x1b')](_0x87a2('0x1d'),_0x6d3e93);logger[_0x87a2('0x15')]('CreateChatMessage',_0x6d3e93,JSON['stringify'](_0x18e592));_0x34c0df(_0x18e592);})[_0x87a2('0x1c')](function(_0x5f4c46){logger[_0x87a2('0x19')](_0x87a2('0x1d'),_0x5f4c46[_0x87a2('0x1a')],_0x6d3e93);_0x8e1e86(_0x132140[_0x87a2('0x19')](0x1f4,_0x5f4c46[_0x87a2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index d2b11f6..d30a54b 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 _0x8ce1=['./chatMessage.events','save','remove','update','emit','removeListener','register','length','chatMessage:'];(function(_0x12769c,_0x1a275b){var _0x4c4376=function(_0x5d9861){while(--_0x5d9861){_0x12769c['push'](_0x12769c['shift']());}};_0x4c4376(++_0x1a275b);}(_0x8ce1,0x183));var _0x18ce=function(_0x1e6134,_0x59f648){_0x1e6134=_0x1e6134-0x0;var _0x4f228b=_0x8ce1[_0x1e6134];return _0x4f228b;};'use strict';var ChatMessageEvents=require(_0x18ce('0x0'));var events=[_0x18ce('0x1'),_0x18ce('0x2'),_0x18ce('0x3')];function createListener(_0x202f93,_0x22b196){return function(_0x211dc4){_0x22b196[_0x18ce('0x4')](_0x202f93,_0x211dc4);};}function removeListener(_0x1d842c,_0x15f55e){return function(){ChatMessageEvents[_0x18ce('0x5')](_0x1d842c,_0x15f55e);};}exports[_0x18ce('0x6')]=function(_0x13ff9d){for(var _0x36f8db=0x0,_0x682d4b=events[_0x18ce('0x7')];_0x36f8db<_0x682d4b;_0x36f8db++){var _0x4ebf82=events[_0x36f8db];var _0x1a60c5=createListener(_0x18ce('0x8')+_0x4ebf82,_0x13ff9d);ChatMessageEvents['on'](_0x4ebf82,_0x1a60c5);}}; \ No newline at end of file +var _0xb182=['chatMessage:','save','remove','update','emit','removeListener','register','length'];(function(_0x502598,_0x1e95c8){var _0xbdee21=function(_0x140feb){while(--_0x140feb){_0x502598['push'](_0x502598['shift']());}};_0xbdee21(++_0x1e95c8);}(_0xb182,0x121));var _0x2b18=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0xb182[_0x15ec4e];return _0xb5e5dd;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x2b18('0x0'),_0x2b18('0x1'),_0x2b18('0x2')];function createListener(_0x4bc3a7,_0x4874ee){return function(_0x3b0f5c){_0x4874ee[_0x2b18('0x3')](_0x4bc3a7,_0x3b0f5c);};}function removeListener(_0x36ffa7,_0x4b2145){return function(){ChatMessageEvents[_0x2b18('0x4')](_0x36ffa7,_0x4b2145);};}exports[_0x2b18('0x5')]=function(_0x22eae8){for(var _0x31236f=0x0,_0x3444c2=events[_0x2b18('0x6')];_0x31236f<_0x3444c2;_0x31236f++){var _0xcfa0=events[_0x31236f];var _0x5d08d8=createListener(_0x2b18('0x7')+_0xcfa0,_0x22eae8);ChatMessageEvents['on'](_0xcfa0,_0x5d08d8);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 5e329b4..f12c6a0 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 _0xff61=['/:id','show','post','tracked','chat','chatmessage:create','put','update','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xff61,0x71));var _0x1ff6=function(_0x545cc2,_0x212dea){_0x545cc2=_0x545cc2-0x0;var _0x164b24=_0xff61[_0x545cc2];return _0x164b24;};'use strict';var multer=require(_0x1ff6('0x0'));var util=require(_0x1ff6('0x1'));var path=require('path');var timeout=require(_0x1ff6('0x2'));var express=require('express');var router=express[_0x1ff6('0x3')]();var fs_extra=require(_0x1ff6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1ff6('0x5'));var config=require(_0x1ff6('0x6'));var controller=require(_0x1ff6('0x7'));router[_0x1ff6('0x8')]('/',auth[_0x1ff6('0x9')](),controller['index']);router[_0x1ff6('0x8')](_0x1ff6('0xa'),auth[_0x1ff6('0x9')](),controller[_0x1ff6('0xb')]);router[_0x1ff6('0x8')](_0x1ff6('0xc'),auth['isAuthenticated'](),controller[_0x1ff6('0xd')]);router[_0x1ff6('0xe')]('/',auth[_0x1ff6('0x9')](),interaction[_0x1ff6('0xf')](_0x1ff6('0x10'),_0x1ff6('0x11')),controller['create']);router[_0x1ff6('0x12')](_0x1ff6('0xc'),controller[_0x1ff6('0x13')]);router['put']('/:id/accept',auth[_0x1ff6('0x9')](),controller[_0x1ff6('0x14')]);router[_0x1ff6('0x12')](_0x1ff6('0x15'),auth[_0x1ff6('0x9')](),controller[_0x1ff6('0x16')]);router[_0x1ff6('0x17')](_0x1ff6('0xc'),auth['isAuthenticated'](),controller[_0x1ff6('0x18')]);module['exports']=router; \ No newline at end of file +var _0xb029=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','chat','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','exports','util','path','express','Router'];(function(_0x1ce4ba,_0x379542){var _0x4e3d62=function(_0x4411c1){while(--_0x4411c1){_0x1ce4ba['push'](_0x1ce4ba['shift']());}};_0x4e3d62(++_0x379542);}(_0xb029,0x7e));var _0x9b02=function(_0x4cd34a,_0x13db56){_0x4cd34a=_0x4cd34a-0x0;var _0x4e0474=_0xb029[_0x4cd34a];return _0x4e0474;};'use strict';var multer=require('multer');var util=require(_0x9b02('0x0'));var path=require(_0x9b02('0x1'));var timeout=require('connect-timeout');var express=require(_0x9b02('0x2'));var router=express[_0x9b02('0x3')]();var fs_extra=require(_0x9b02('0x4'));var auth=require(_0x9b02('0x5'));var interaction=require(_0x9b02('0x6'));var config=require('../../config/environment');var controller=require(_0x9b02('0x7'));router[_0x9b02('0x8')]('/',auth[_0x9b02('0x9')](),controller[_0x9b02('0xa')]);router[_0x9b02('0x8')](_0x9b02('0xb'),auth['isAuthenticated'](),controller[_0x9b02('0xc')]);router[_0x9b02('0x8')](_0x9b02('0xd'),auth[_0x9b02('0x9')](),controller[_0x9b02('0xe')]);router[_0x9b02('0xf')]('/',auth[_0x9b02('0x9')](),interaction['tracked'](_0x9b02('0x10'),_0x9b02('0x11')),controller[_0x9b02('0x12')]);router['put']('/:id',controller['update']);router[_0x9b02('0x13')](_0x9b02('0x14'),auth[_0x9b02('0x9')](),controller[_0x9b02('0x15')]);router[_0x9b02('0x13')](_0x9b02('0x16'),auth[_0x9b02('0x9')](),controller[_0x9b02('0x17')]);router[_0x9b02('0x18')](_0x9b02('0xd'),auth[_0x9b02('0x9')](),controller['destroy']);module[_0x9b02('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index f3858a1..7711551 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x46ca1d,_0x3a263a){var _0x3f4ffc=function(_0x371d3c){while(--_0x371d3c){_0x46ca1d['push'](_0x46ca1d['shift']());}};_0x3f4ffc(++_0x3a263a);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xb10b[_0x4c7935];return _0x30651d;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x2032=['medium','exports','TEXT'];(function(_0x260764,_0x2f3fc8){var _0x383e35=function(_0x2b9a60){while(--_0x2b9a60){_0x260764['push'](_0x260764['shift']());}};_0x383e35(++_0x2f3fc8);}(_0x2032,0xd9));var _0x2203=function(_0x470b64,_0x34ecde){_0x470b64=_0x470b64-0x0;var _0x2aedea=_0x2032[_0x470b64];return _0x2aedea;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 57976c5..8e0536c 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(_0x41637e,_0x427d2a){var _0x2e36ee=function(_0x85450a){while(--_0x85450a){_0x41637e['push'](_0x41637e['shift']());}};_0x2e36ee(++_0x427d2a);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +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(_0x216282,_0x678090){var _0x3852a4=function(_0x28c0ec){while(--_0x28c0ec){_0x216282['push'](_0x216282['shift']());}};_0x3852a4(++_0x678090);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 90e1a0b..6c8311c 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d1e=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x1da1e2,_0x1ae454){var _0xe0dd11=function(_0xb49657){while(--_0xb49657){_0x1da1e2['push'](_0x1da1e2['shift']());}};_0xe0dd11(++_0x1ae454);}(_0x4d1e,0xf5));var _0xe4d1=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x4d1e[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require(_0xe4d1('0x0'));var ChatOfflineMessage=require(_0xe4d1('0x1'))['db'][_0xe4d1('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xe4d1('0x3')](0x0);var events={'afterCreate':_0xe4d1('0x4'),'afterUpdate':_0xe4d1('0x5'),'afterDestroy':_0xe4d1('0x6')};function emitEvent(_0x43ccef){return function(_0x446475,_0x3f3192,_0x174c56){ChatOfflineMessageEvents[_0xe4d1('0x7')](_0x43ccef+':'+_0x446475['id'],_0x446475);ChatOfflineMessageEvents[_0xe4d1('0x7')](_0x43ccef,_0x446475);_0x174c56(null);};}for(var e in events){if(events[_0xe4d1('0x8')](e)){var event=events[e];ChatOfflineMessage[_0xe4d1('0x9')](e,emitEvent(event));}}module[_0xe4d1('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xb4f1=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatOfflineMessage'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0xb4f1,0x115));var _0x1b4f=function(_0x3f38fb,_0x4a060b){_0x3f38fb=_0x3f38fb-0x0;var _0x56319e=_0xb4f1[_0x3f38fb];return _0x56319e;};'use strict';var EventEmitter=require(_0x1b4f('0x0'));var ChatOfflineMessage=require(_0x1b4f('0x1'))['db'][_0x1b4f('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1b4f('0x3')](0x0);var events={'afterCreate':_0x1b4f('0x4'),'afterUpdate':_0x1b4f('0x5'),'afterDestroy':_0x1b4f('0x6')};function emitEvent(_0x30cc04){return function(_0x54fdb1,_0x1eab6d,_0x1e51a0){ChatOfflineMessageEvents[_0x1b4f('0x7')](_0x30cc04+':'+_0x54fdb1['id'],_0x54fdb1);ChatOfflineMessageEvents[_0x1b4f('0x7')](_0x30cc04,_0x54fdb1);_0x1e51a0(null);};}for(var e in events){if(events[_0x1b4f('0x8')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x1b4f('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 61151ad..66c5a1a 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 _0xd4cf=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x12e07a,_0x3afe69){var _0x484b63=function(_0x166d9d){while(--_0x166d9d){_0x12e07a['push'](_0x12e07a['shift']());}};_0x484b63(++_0x3afe69);}(_0xd4cf,0x6f));var _0xfd4c=function(_0x38ce4c,_0xfdbe8c){_0x38ce4c=_0x38ce4c-0x0;var _0x5d4544=_0xd4cf[_0x38ce4c];return _0x5d4544;};'use strict';var attributes=require(_0xfd4c('0x0'));module[_0xfd4c('0x1')]=function(_0x434d79){return _0x434d79[_0xfd4c('0x2')](_0xfd4c('0x3'),attributes,{'tableName':_0xfd4c('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfd4c('0x5'),'collate':_0xfd4c('0x6')});}; \ No newline at end of file +var _0xf1e1=['utf8mb4_unicode_ci','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x399c0c,_0x38f373){var _0x18d1a0=function(_0x32000f){while(--_0x32000f){_0x399c0c['push'](_0x399c0c['shift']());}};_0x18d1a0(++_0x38f373);}(_0xf1e1,0xfd));var _0x1f1e=function(_0x3cba1d,_0x2825ae){_0x3cba1d=_0x3cba1d-0x0;var _0x5f192b=_0xf1e1[_0x3cba1d];return _0x5f192b;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x1f1e('0x0')]=function(_0x43460e){return _0x43460e[_0x1f1e('0x1')](_0x1f1e('0x2'),attributes,{'tableName':_0x1f1e('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1f1e('0x4'),'collate':_0x1f1e('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 46c56a2..37fb967 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 _0x2619=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2a5e3a,_0x436c2a){var _0x513fa3=function(_0x2ece1b){while(--_0x2ece1b){_0x2a5e3a['push'](_0x2a5e3a['shift']());}};_0x513fa3(++_0x436c2a);}(_0x2619,0x119));var _0x9261=function(_0x152c37,_0xaf380d){_0x152c37=_0x152c37-0x0;var _0x1c4840=_0x2619[_0x152c37];return _0x1c4840;};'use strict';var _=require(_0x9261('0x0'));var util=require(_0x9261('0x1'));var moment=require(_0x9261('0x2'));var BPromise=require('bluebird');var rs=require(_0x9261('0x3'));var fs=require('fs');var Redis=require(_0x9261('0x4'));var db=require(_0x9261('0x5'))['db'];var utils=require(_0x9261('0x6'));var logger=require(_0x9261('0x7'))(_0x9261('0x8'));var config=require(_0x9261('0x9'));var jayson=require(_0x9261('0xa'));var client=jayson[_0x9261('0xb')][_0x9261('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33f388,_0x2bc28f,_0x5efba3){return new BPromise(function(_0x4d6e29,_0x152b12){return client[_0x9261('0xd')](_0x33f388,_0x5efba3)[_0x9261('0xe')](function(_0x4d5c9f){logger[_0x9261('0xf')](_0x9261('0x10'),_0x2bc28f,_0x9261('0x11'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x2bc28f,_0x9261('0x11'),JSON[_0x9261('0x12')](_0x4d5c9f));if(_0x4d5c9f[_0x9261('0x13')]){if(_0x4d5c9f[_0x9261('0x13')][_0x9261('0x14')]===0x1f4){logger['error'](_0x9261('0x10'),_0x2bc28f,_0x4d5c9f['error'][_0x9261('0x15')]);return _0x152b12(_0x4d5c9f[_0x9261('0x13')][_0x9261('0x15')]);}logger[_0x9261('0x13')](_0x9261('0x10'),_0x2bc28f,_0x4d5c9f[_0x9261('0x13')][_0x9261('0x15')]);return _0x4d6e29(_0x4d5c9f[_0x9261('0x13')]['message']);}else{logger[_0x9261('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2bc28f,_0x9261('0x11'));_0x4d6e29(_0x4d5c9f[_0x9261('0x16')][_0x9261('0x15')]);}})[_0x9261('0x17')](function(_0x451ea4){logger[_0x9261('0x13')](_0x9261('0x10'),_0x2bc28f,_0x451ea4);_0x152b12(_0x451ea4);});});} \ No newline at end of file +var _0x4093=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x4093,0x18d));var _0x3409=function(_0x5bd526,_0x43d27a){_0x5bd526=_0x5bd526-0x0;var _0x48b8e7=_0x4093[_0x5bd526];return _0x48b8e7;};'use strict';var _=require(_0x3409('0x0'));var util=require(_0x3409('0x1'));var moment=require(_0x3409('0x2'));var BPromise=require(_0x3409('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3409('0x4'));var db=require(_0x3409('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3409('0x6'))(_0x3409('0x7'));var config=require(_0x3409('0x8'));var jayson=require(_0x3409('0x9'));var client=jayson[_0x3409('0xa')][_0x3409('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16447a,_0x3075e1,_0x49e717){return new BPromise(function(_0x5dfcce,_0x218d6b){return client[_0x3409('0xc')](_0x16447a,_0x49e717)[_0x3409('0xd')](function(_0x20e9ae){logger[_0x3409('0xe')](_0x3409('0xf'),_0x3075e1,_0x3409('0x10'));logger[_0x3409('0x11')](_0x3409('0x12'),_0x3075e1,_0x3409('0x10'),JSON[_0x3409('0x13')](_0x20e9ae));if(_0x20e9ae[_0x3409('0x14')]){if(_0x20e9ae['error'][_0x3409('0x15')]===0x1f4){logger[_0x3409('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3075e1,_0x20e9ae[_0x3409('0x14')][_0x3409('0x16')]);return _0x218d6b(_0x20e9ae['error'][_0x3409('0x16')]);}logger[_0x3409('0x14')](_0x3409('0xf'),_0x3075e1,_0x20e9ae[_0x3409('0x14')][_0x3409('0x16')]);return _0x5dfcce(_0x20e9ae[_0x3409('0x14')]['message']);}else{logger[_0x3409('0xe')](_0x3409('0xf'),_0x3075e1,_0x3409('0x10'));_0x5dfcce(_0x20e9ae['result'][_0x3409('0x16')]);}})['catch'](function(_0x413b09){logger[_0x3409('0x14')](_0x3409('0xf'),_0x3075e1,_0x413b09);_0x218d6b(_0x413b09);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 3f2facf..cad5873 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 _0xc1d6=['../../components/auth/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x51c25f,_0x4017a8){var _0xf8e1ac=function(_0x3f70d9){while(--_0x3f70d9){_0x51c25f['push'](_0x51c25f['shift']());}};_0xf8e1ac(++_0x4017a8);}(_0xc1d6,0x19b));var _0x6c1d=function(_0x339d57,_0x5d865a){_0x339d57=_0x339d57-0x0;var _0x43842e=_0xc1d6[_0x339d57];return _0x43842e;};'use strict';var multer=require(_0x6c1d('0x0'));var util=require(_0x6c1d('0x1'));var path=require(_0x6c1d('0x2'));var timeout=require(_0x6c1d('0x3'));var express=require(_0x6c1d('0x4'));var router=express[_0x6c1d('0x5')]();var fs_extra=require(_0x6c1d('0x6'));var auth=require(_0x6c1d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6c1d('0x8'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6c1d('0x9')]);router[_0x6c1d('0xa')](_0x6c1d('0xb'),auth[_0x6c1d('0xc')](),controller[_0x6c1d('0xd')]);router[_0x6c1d('0xa')](_0x6c1d('0xe'),auth[_0x6c1d('0xc')](),controller[_0x6c1d('0xf')]);router[_0x6c1d('0x10')]('/',auth[_0x6c1d('0xc')](),controller['create']);router[_0x6c1d('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x6c1d('0xe'),auth[_0x6c1d('0xc')](),controller['destroy']);module[_0x6c1d('0x12')]=router; \ No newline at end of file +var _0x0a05=['/describe','show','post','create','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get'];(function(_0x1f9bc3,_0x7977a){var _0x1e4aea=function(_0x218164){while(--_0x218164){_0x1f9bc3['push'](_0x1f9bc3['shift']());}};_0x1e4aea(++_0x7977a);}(_0x0a05,0x119));var _0x50a0=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x0a05[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0x50a0('0x0'));var util=require(_0x50a0('0x1'));var path=require(_0x50a0('0x2'));var timeout=require(_0x50a0('0x3'));var express=require(_0x50a0('0x4'));var router=express['Router']();var fs_extra=require(_0x50a0('0x5'));var auth=require(_0x50a0('0x6'));var interaction=require(_0x50a0('0x7'));var config=require(_0x50a0('0x8'));var controller=require(_0x50a0('0x9'));router['get']('/',auth[_0x50a0('0xa')](),controller[_0x50a0('0xb')]);router[_0x50a0('0xc')](_0x50a0('0xd'),auth[_0x50a0('0xa')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x50a0('0xe')]);router[_0x50a0('0xf')]('/',auth[_0x50a0('0xa')](),controller[_0x50a0('0x10')]);router['put'](_0x50a0('0x11'),auth['isAuthenticated'](),controller[_0x50a0('0x12')]);router['delete'](_0x50a0('0x11'),auth[_0x50a0('0xa')](),controller[_0x50a0('0x13')]);module[_0x50a0('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 5e0b8a3..110d2e3 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 _0xd569=['exports','ENUM','mouseOver','timeout','STRING','INTEGER','sequelize'];(function(_0x153889,_0x1f2796){var _0xcde38e=function(_0x2fe681){while(--_0x2fe681){_0x153889['push'](_0x153889['shift']());}};_0xcde38e(++_0x1f2796);}(_0xd569,0x1db));var _0x9d56=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0xd569[_0x5216e0];return _0x5b3f40;};'use strict';var Sequelize=require(_0x9d56('0x0'));module[_0x9d56('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9d56('0x2')](_0x9d56('0x3'),_0x9d56('0x4')),'defaultValue':_0x9d56('0x3')},'selector':{'type':Sequelize[_0x9d56('0x5')]},'timeout':{'type':Sequelize[_0x9d56('0x6')]}}; \ No newline at end of file +var _0x5f14=['STRING','ENUM','mouseOver','sequelize','exports'];(function(_0x4c7c25,_0x1e16a8){var _0x297619=function(_0x453f76){while(--_0x453f76){_0x4c7c25['push'](_0x4c7c25['shift']());}};_0x297619(++_0x1e16a8);}(_0x5f14,0x9e));var _0x45f1=function(_0x49c653,_0x390195){_0x49c653=_0x49c653-0x0;var _0x31e169=_0x5f14[_0x49c653];return _0x31e169;};'use strict';var Sequelize=require(_0x45f1('0x0'));module[_0x45f1('0x1')]={'name':{'type':Sequelize[_0x45f1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x45f1('0x3')](_0x45f1('0x4'),'timeout'),'defaultValue':_0x45f1('0x4')},'selector':{'type':Sequelize[_0x45f1('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 1ecb6c8..e2b1240 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 _0x6bb4=['limit','count','offset','set','Content-Range','apply','update','then','end','sendStatus','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','undefined'];(function(_0x24f2aa,_0x5a12c1){var _0x43d7e4=function(_0x77a8c7){while(--_0x77a8c7){_0x24f2aa['push'](_0x24f2aa['shift']());}};_0x43d7e4(++_0x5a12c1);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x101a17,_0x5d047a){_0x101a17=_0x101a17-0x0;var _0x3b76ee=_0x6bb4[_0x101a17];return _0x3b76ee;};'use strict';var emlformat=require(_0x46bb('0x0'));var rimraf=require(_0x46bb('0x1'));var zipdir=require(_0x46bb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x46bb('0x3'));var moment=require(_0x46bb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x46bb('0x5'));var util=require(_0x46bb('0x6'));var path=require(_0x46bb('0x7'));var sox=require(_0x46bb('0x8'));var csv=require(_0x46bb('0x9'));var ejs=require(_0x46bb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x46bb('0xb'));var crypto=require(_0x46bb('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x46bb('0xd'));var Papa=require(_0x46bb('0xe'));var Redis=require('ioredis');var authService=require(_0x46bb('0xf'));var qs=require(_0x46bb('0x10'));var as=require(_0x46bb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46bb('0x12'))(_0x46bb('0x13'));var utils=require('../../config/utils');var config=require(_0x46bb('0x14'));var licenseUtil=require(_0x46bb('0x15'));var db=require(_0x46bb('0x16'))['db'];function respondWithStatusCode(_0x54cbac,_0x18e28a){_0x18e28a=_0x18e28a||0xcc;return function(_0x481623){if(_0x481623){return _0x54cbac['sendStatus'](_0x18e28a);}return _0x54cbac[_0x46bb('0x17')](_0x18e28a)['end']();};}function respondWithResult(_0x30b3cd,_0x1c8850){_0x1c8850=_0x1c8850||0xc8;return function(_0x50f198){if(_0x50f198){return _0x30b3cd[_0x46bb('0x17')](_0x1c8850)['json'](_0x50f198);}};}function respondWithFilteredResult(_0x6b4781,_0x4d1095){return function(_0x210745){if(_0x210745){var _0x547aff=typeof _0x4d1095['offset']===_0x46bb('0x18')&&typeof _0x4d1095[_0x46bb('0x19')]==='undefined';var _0x3f0817=_0x210745[_0x46bb('0x1a')];var _0x5eb0e1=_0x547aff?0x0:_0x4d1095['offset'];var _0x3f0f4a=_0x547aff?_0x210745[_0x46bb('0x1a')]:_0x4d1095[_0x46bb('0x1b')]+_0x4d1095[_0x46bb('0x19')];var _0x20e011;if(_0x3f0f4a>=_0x3f0817){_0x3f0f4a=_0x3f0817;_0x20e011=0xc8;}else{_0x20e011=0xce;}_0x6b4781[_0x46bb('0x17')](_0x20e011);return _0x6b4781[_0x46bb('0x1c')](_0x46bb('0x1d'),_0x5eb0e1+'-'+_0x3f0f4a+'/'+_0x3f0817)['json'](_0x210745);}return null;};}function patchUpdates(_0x5ce203){return function(_0x10296c){try{jsonpatch[_0x46bb('0x1e')](_0x10296c,_0x5ce203,!![]);}catch(_0x2ff232){return BPromise['reject'](_0x2ff232);}return _0x10296c['save']();};}function saveUpdates(_0x4ccd36,_0x299fc0){return function(_0x2b3443){if(_0x2b3443){return _0x2b3443[_0x46bb('0x1f')](_0x4ccd36)[_0x46bb('0x20')](function(_0x5b8e04){return _0x5b8e04;});}return null;};}function removeEntity(_0x55893d,_0x59c525){return function(_0x5c2885){if(_0x5c2885){return _0x5c2885['destroy']()[_0x46bb('0x20')](function(){_0x55893d['status'](0xcc)[_0x46bb('0x21')]();});}};}function handleEntityNotFound(_0x3c0031,_0x16413b){return function(_0x1ee93a){if(!_0x1ee93a){_0x3c0031[_0x46bb('0x22')](0x194);}return _0x1ee93a;};}function handleError(_0x345425,_0x46c470){_0x46c470=_0x46c470||0x1f4;return function(_0x2d1a2f){logger[_0x46bb('0x23')](_0x2d1a2f[_0x46bb('0x24')]);if(_0x2d1a2f['name']){delete _0x2d1a2f[_0x46bb('0x25')];}_0x345425[_0x46bb('0x17')](_0x46c470)['send'](_0x2d1a2f);};}exports[_0x46bb('0x26')]=function(_0x3a9927,_0x2eb75f){var _0x329d0a={'raw':!![],'where':{'id':_0x3a9927[_0x46bb('0x27')]['id']}},_0x1977af={};_0x1977af[_0x46bb('0x28')]=_[_0x46bb('0x29')](db[_0x46bb('0x2a')][_0x46bb('0x2b')]);_0x1977af[_0x46bb('0x2c')]=_[_0x46bb('0x29')](_0x3a9927[_0x46bb('0x2c')]);_0x1977af[_0x46bb('0x2d')]=_[_0x46bb('0x2e')](_0x1977af[_0x46bb('0x28')],_0x1977af[_0x46bb('0x2c')]);_0x329d0a[_0x46bb('0x2f')]=_[_0x46bb('0x2e')](_0x1977af[_0x46bb('0x28')],qs[_0x46bb('0x30')](_0x3a9927['query'][_0x46bb('0x30')]));_0x329d0a['attributes']=_0x329d0a[_0x46bb('0x2f')]['length']?_0x329d0a[_0x46bb('0x2f')]:_0x1977af[_0x46bb('0x28')];if(_0x3a9927[_0x46bb('0x2c')]['includeAll']){_0x329d0a[_0x46bb('0x31')]=[{'all':!![]}];}_0x329d0a=_[_0x46bb('0x32')]({},_0x329d0a,_0x3a9927[_0x46bb('0x33')]);return db[_0x46bb('0x2a')][_0x46bb('0x34')](_0x329d0a)['then'](handleEntityNotFound(_0x2eb75f,null))[_0x46bb('0x20')](respondWithResult(_0x2eb75f,null))[_0x46bb('0x35')](handleError(_0x2eb75f,null));};exports[_0x46bb('0x36')]=function(_0x37db3c,_0x32e101){return db[_0x46bb('0x2a')][_0x46bb('0x36')](_0x37db3c[_0x46bb('0x37')],{})[_0x46bb('0x20')](respondWithResult(_0x32e101,0xc9))[_0x46bb('0x35')](handleError(_0x32e101,null));};exports[_0x46bb('0x1f')]=function(_0x461735,_0x7e9c51){if(_0x461735[_0x46bb('0x37')]['id']){delete _0x461735[_0x46bb('0x37')]['id'];}return db[_0x46bb('0x2a')][_0x46bb('0x34')]({'where':{'id':_0x461735[_0x46bb('0x27')]['id']}})[_0x46bb('0x20')](handleEntityNotFound(_0x7e9c51,null))[_0x46bb('0x20')](saveUpdates(_0x461735[_0x46bb('0x37')],null))[_0x46bb('0x20')](respondWithResult(_0x7e9c51,null))[_0x46bb('0x35')](handleError(_0x7e9c51,null));};exports['destroy']=function(_0x3148d9,_0x4b0500){return db['ChatProactiveAction']['find']({'where':{'id':_0x3148d9[_0x46bb('0x27')]['id']}})['then'](handleEntityNotFound(_0x4b0500,null))[_0x46bb('0x20')](removeEntity(_0x4b0500,null))['catch'](handleError(_0x4b0500,null));}; \ No newline at end of file +var _0x34f2=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','merge','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x722d30,_0x1633a3){var _0x22b826=function(_0x2fc0e0){while(--_0x2fc0e0){_0x722d30['push'](_0x722d30['shift']());}};_0x22b826(++_0x1633a3);}(_0x34f2,0x15a));var _0x234f=function(_0x3c41d8,_0x15f585){_0x3c41d8=_0x3c41d8-0x0;var _0x3338a7=_0x34f2[_0x3c41d8];return _0x3338a7;};'use strict';var emlformat=require(_0x234f('0x0'));var rimraf=require(_0x234f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x234f('0x2'));var rp=require(_0x234f('0x3'));var moment=require(_0x234f('0x4'));var BPromise=require(_0x234f('0x5'));var Mustache=require(_0x234f('0x6'));var util=require(_0x234f('0x7'));var path=require(_0x234f('0x8'));var sox=require(_0x234f('0x9'));var csv=require(_0x234f('0xa'));var ejs=require(_0x234f('0xb'));var fs=require('fs');var fs_extra=require(_0x234f('0xc'));var _=require(_0x234f('0xd'));var squel=require(_0x234f('0xe'));var crypto=require(_0x234f('0xf'));var jsforce=require(_0x234f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x234f('0xa'));var querystring=require(_0x234f('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x234f('0x12'));var qs=require(_0x234f('0x13'));var as=require(_0x234f('0x14'));var hardwareService=require(_0x234f('0x15'));var logger=require(_0x234f('0x16'))('api');var utils=require(_0x234f('0x17'));var config=require(_0x234f('0x18'));var licenseUtil=require(_0x234f('0x19'));var db=require(_0x234f('0x1a'))['db'];function respondWithStatusCode(_0x518485,_0x41f471){_0x41f471=_0x41f471||0xcc;return function(_0x4aefa2){if(_0x4aefa2){return _0x518485[_0x234f('0x1b')](_0x41f471);}return _0x518485[_0x234f('0x1c')](_0x41f471)[_0x234f('0x1d')]();};}function respondWithResult(_0x31c3d6,_0x2fea04){_0x2fea04=_0x2fea04||0xc8;return function(_0x10ee30){if(_0x10ee30){return _0x31c3d6[_0x234f('0x1c')](_0x2fea04)['json'](_0x10ee30);}};}function respondWithFilteredResult(_0x5ada71,_0x2d47cf){return function(_0x162275){if(_0x162275){var _0x5f0e9c=typeof _0x2d47cf[_0x234f('0x1e')]===_0x234f('0x1f')&&typeof _0x2d47cf[_0x234f('0x20')]===_0x234f('0x1f');var _0x304c08=_0x162275[_0x234f('0x21')];var _0x144ea0=_0x5f0e9c?0x0:_0x2d47cf[_0x234f('0x1e')];var _0x77399f=_0x5f0e9c?_0x162275['count']:_0x2d47cf[_0x234f('0x1e')]+_0x2d47cf[_0x234f('0x20')];var _0x357ecb;if(_0x77399f>=_0x304c08){_0x77399f=_0x304c08;_0x357ecb=0xc8;}else{_0x357ecb=0xce;}_0x5ada71[_0x234f('0x1c')](_0x357ecb);return _0x5ada71[_0x234f('0x22')](_0x234f('0x23'),_0x144ea0+'-'+_0x77399f+'/'+_0x304c08)[_0x234f('0x24')](_0x162275);}return null;};}function patchUpdates(_0x2f68cf){return function(_0x45b3c0){try{jsonpatch['apply'](_0x45b3c0,_0x2f68cf,!![]);}catch(_0x5e7edd){return BPromise[_0x234f('0x25')](_0x5e7edd);}return _0x45b3c0[_0x234f('0x26')]();};}function saveUpdates(_0x516c6e,_0x2539d9){return function(_0x4ca657){if(_0x4ca657){return _0x4ca657[_0x234f('0x27')](_0x516c6e)[_0x234f('0x28')](function(_0x17a23c){return _0x17a23c;});}return null;};}function removeEntity(_0x2acafc,_0x34cc19){return function(_0x434e9f){if(_0x434e9f){return _0x434e9f[_0x234f('0x29')]()[_0x234f('0x28')](function(){_0x2acafc[_0x234f('0x1c')](0xcc)[_0x234f('0x1d')]();});}};}function handleEntityNotFound(_0x758e8d,_0xd8ffbf){return function(_0x15de29){if(!_0x15de29){_0x758e8d[_0x234f('0x1b')](0x194);}return _0x15de29;};}function handleError(_0x3ce565,_0x371292){_0x371292=_0x371292||0x1f4;return function(_0x2b6641){logger[_0x234f('0x2a')](_0x2b6641[_0x234f('0x2b')]);if(_0x2b6641[_0x234f('0x2c')]){delete _0x2b6641[_0x234f('0x2c')];}_0x3ce565[_0x234f('0x1c')](_0x371292)[_0x234f('0x2d')](_0x2b6641);};}exports['show']=function(_0x1f6032,_0xffda12){var _0x1b3762={'raw':!![],'where':{'id':_0x1f6032[_0x234f('0x2e')]['id']}},_0x2522b1={};_0x2522b1[_0x234f('0x2f')]=_[_0x234f('0x30')](db[_0x234f('0x31')][_0x234f('0x32')]);_0x2522b1[_0x234f('0x33')]=_['keys'](_0x1f6032[_0x234f('0x33')]);_0x2522b1['filters']=_[_0x234f('0x34')](_0x2522b1[_0x234f('0x2f')],_0x2522b1[_0x234f('0x33')]);_0x1b3762[_0x234f('0x35')]=_['intersection'](_0x2522b1[_0x234f('0x2f')],qs[_0x234f('0x36')](_0x1f6032[_0x234f('0x33')]['fields']));_0x1b3762['attributes']=_0x1b3762[_0x234f('0x35')][_0x234f('0x37')]?_0x1b3762['attributes']:_0x2522b1['model'];if(_0x1f6032[_0x234f('0x33')]['includeAll']){_0x1b3762['include']=[{'all':!![]}];}_0x1b3762=_[_0x234f('0x38')]({},_0x1b3762,_0x1f6032['options']);return db[_0x234f('0x31')][_0x234f('0x39')](_0x1b3762)[_0x234f('0x28')](handleEntityNotFound(_0xffda12,null))[_0x234f('0x28')](respondWithResult(_0xffda12,null))[_0x234f('0x3a')](handleError(_0xffda12,null));};exports[_0x234f('0x3b')]=function(_0x8590f2,_0x1f923f){return db[_0x234f('0x31')]['create'](_0x8590f2[_0x234f('0x3c')],{})[_0x234f('0x28')](respondWithResult(_0x1f923f,0xc9))[_0x234f('0x3a')](handleError(_0x1f923f,null));};exports[_0x234f('0x27')]=function(_0x34567c,_0x156f25){if(_0x34567c[_0x234f('0x3c')]['id']){delete _0x34567c[_0x234f('0x3c')]['id'];}return db['ChatProactiveAction'][_0x234f('0x39')]({'where':{'id':_0x34567c[_0x234f('0x2e')]['id']}})[_0x234f('0x28')](handleEntityNotFound(_0x156f25,null))[_0x234f('0x28')](saveUpdates(_0x34567c['body'],null))['then'](respondWithResult(_0x156f25,null))['catch'](handleError(_0x156f25,null));};exports[_0x234f('0x29')]=function(_0x4adefe,_0x41e124){return db[_0x234f('0x31')][_0x234f('0x39')]({'where':{'id':_0x4adefe[_0x234f('0x2e')]['id']}})[_0x234f('0x28')](handleEntityNotFound(_0x41e124,null))[_0x234f('0x28')](removeEntity(_0x41e124,null))[_0x234f('0x3a')](handleError(_0x41e124,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index e0e4bdc..bae4024 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 _0x7330=['define','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7330,0x1bc));var _0x0733=function(_0x318ab4,_0x3f2ae9){_0x318ab4=_0x318ab4-0x0;var _0x28c29d=_0x7330[_0x318ab4];return _0x28c29d;};'use strict';var _=require(_0x0733('0x0'));var util=require(_0x0733('0x1'));var logger=require(_0x0733('0x2'))(_0x0733('0x3'));var moment=require(_0x0733('0x4'));var BPromise=require(_0x0733('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0733('0x6'));var rimraf=require(_0x0733('0x7'));var config=require(_0x0733('0x8'));var attributes=require(_0x0733('0x9'));module[_0x0733('0xa')]=function(_0x336655,_0x2751b3){return _0x336655[_0x0733('0xb')](_0x0733('0xc'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf73=['define','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xbf73,0x196));var _0x3bf7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf73[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3bf7('0x0'));var util=require('util');var logger=require(_0x3bf7('0x1'))('api');var moment=require(_0x3bf7('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bf7('0x3'));var rimraf=require(_0x3bf7('0x4'));var config=require(_0x3bf7('0x5'));var attributes=require(_0x3bf7('0x6'));module[_0x3bf7('0x7')]=function(_0x45e4bb,_0x38c344){return _0x45e4bb[_0x3bf7('0x8')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index ff6cb05..bdb8d67 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 _0x66ef=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0xad319a,_0x27ff86){var _0x444ea1=function(_0x1e074b){while(--_0x1e074b){_0xad319a['push'](_0xad319a['shift']());}};_0x444ea1(++_0x27ff86);}(_0x66ef,0x145));var _0xf66e=function(_0x3f4757,_0x5d5b59){_0x3f4757=_0x3f4757-0x0;var _0x3ec216=_0x66ef[_0x3f4757];return _0x3ec216;};'use strict';var _=require(_0xf66e('0x0'));var util=require(_0xf66e('0x1'));var moment=require(_0xf66e('0x2'));var BPromise=require(_0xf66e('0x3'));var rs=require(_0xf66e('0x4'));var fs=require('fs');var Redis=require(_0xf66e('0x5'));var db=require(_0xf66e('0x6'))['db'];var utils=require(_0xf66e('0x7'));var logger=require(_0xf66e('0x8'))('rpc');var config=require(_0xf66e('0x9'));var jayson=require(_0xf66e('0xa'));var client=jayson[_0xf66e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18b573,_0x4d1eb3,_0xe3be99){return new BPromise(function(_0x37ebf6,_0x5ba682){return client[_0xf66e('0xc')](_0x18b573,_0xe3be99)[_0xf66e('0xd')](function(_0x365e98){logger['info'](_0xf66e('0xe'),_0x4d1eb3,_0xf66e('0xf'));logger[_0xf66e('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4d1eb3,_0xf66e('0xf'),JSON[_0xf66e('0x11')](_0x365e98));if(_0x365e98['error']){if(_0x365e98[_0xf66e('0x12')]['code']===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4d1eb3,_0x365e98[_0xf66e('0x12')][_0xf66e('0x13')]);return _0x5ba682(_0x365e98[_0xf66e('0x12')][_0xf66e('0x13')]);}logger[_0xf66e('0x12')](_0xf66e('0xe'),_0x4d1eb3,_0x365e98[_0xf66e('0x12')][_0xf66e('0x13')]);return _0x37ebf6(_0x365e98['error']['message']);}else{logger[_0xf66e('0x14')](_0xf66e('0xe'),_0x4d1eb3,_0xf66e('0xf'));_0x37ebf6(_0x365e98[_0xf66e('0x15')][_0xf66e('0x13')]);}})[_0xf66e('0x16')](function(_0x3ebfb9){logger[_0xf66e('0x12')](_0xf66e('0xe'),_0x4d1eb3,_0x3ebfb9);_0x5ba682(_0x3ebfb9);});});} \ No newline at end of file +var _0xe905=['ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x5ca25c,_0x3febb5){var _0x47317f=function(_0x8f2901){while(--_0x8f2901){_0x5ca25c['push'](_0x5ca25c['shift']());}};_0x47317f(++_0x3febb5);}(_0xe905,0x1bd));var _0x5e90=function(_0x5b447a,_0x27e04d){_0x5b447a=_0x5b447a-0x0;var _0x247624=_0xe905[_0x5b447a];return _0x247624;};'use strict';var _=require(_0x5e90('0x0'));var util=require('util');var moment=require(_0x5e90('0x1'));var BPromise=require('bluebird');var rs=require(_0x5e90('0x2'));var fs=require('fs');var Redis=require(_0x5e90('0x3'));var db=require(_0x5e90('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5e90('0x5'));var config=require('../../config/environment');var jayson=require(_0x5e90('0x6'));var client=jayson[_0x5e90('0x7')][_0x5e90('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe5b282,_0x122fbb,_0xdf2a02){return new BPromise(function(_0x117487,_0x597537){return client[_0x5e90('0x9')](_0xe5b282,_0xdf2a02)[_0x5e90('0xa')](function(_0x57b269){logger[_0x5e90('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x122fbb,_0x5e90('0xc'));logger[_0x5e90('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x122fbb,_0x5e90('0xc'),JSON[_0x5e90('0xe')](_0x57b269));if(_0x57b269['error']){if(_0x57b269[_0x5e90('0xf')][_0x5e90('0x10')]===0x1f4){logger[_0x5e90('0xf')](_0x5e90('0x11'),_0x122fbb,_0x57b269[_0x5e90('0xf')][_0x5e90('0x12')]);return _0x597537(_0x57b269[_0x5e90('0xf')][_0x5e90('0x12')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x122fbb,_0x57b269['error'][_0x5e90('0x12')]);return _0x117487(_0x57b269['error'][_0x5e90('0x12')]);}else{logger[_0x5e90('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x122fbb,_0x5e90('0xc'));_0x117487(_0x57b269[_0x5e90('0x13')][_0x5e90('0x12')]);}})[_0x5e90('0x14')](function(_0x31bc2e){logger[_0x5e90('0xf')](_0x5e90('0x11'),_0x122fbb,_0x31bc2e);_0x597537(_0x31bc2e);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 4a31cd5..ed2833b 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 _0x2675=['../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','express','Router'];(function(_0x4f7f14,_0x36b3e1){var _0x79c31e=function(_0x23c1be){while(--_0x23c1be){_0x4f7f14['push'](_0x4f7f14['shift']());}};_0x79c31e(++_0x36b3e1);}(_0x2675,0x75));var _0x5267=function(_0x4f0620,_0xc90d0){_0x4f0620=_0x4f0620-0x0;var _0x15bfb9=_0x2675[_0x4f0620];return _0x15bfb9;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')](_0x5267('0x7'),auth[_0x5267('0x8')](),controller[_0x5267('0x9')]);router[_0x5267('0xa')]('/',auth['isAuthenticated'](),controller[_0x5267('0xb')]);router[_0x5267('0xc')]('/:id',auth[_0x5267('0x8')](),controller['update']);router[_0x5267('0xd')](_0x5267('0x7'),auth[_0x5267('0x8')](),controller['destroy']);module[_0x5267('0xe')]=router; \ No newline at end of file +var _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x11b810,_0x57bc86){_0x11b810=_0x11b810-0x0;var _0x3e9917=_0xb4c7[_0x11b810];return _0x3e9917;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index a05f534..ba04a03 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 _0xb040=['roundrobin','sequelize','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0xb040,0xef));var _0x0b04=function(_0x291861,_0x828bca){_0x291861=_0x291861-0x0;var _0xa4113c=_0xb040[_0x291861];return _0xa4113c;};'use strict';var Sequelize=require(_0x0b04('0x0'));module['exports']={'name':{'type':Sequelize[_0x0b04('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0b04('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b04('0x3')](_0x0b04('0x4'),_0x0b04('0x5'),_0x0b04('0x6'))}}; \ No newline at end of file +var _0x85af=['ENUM','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x2de0a7,_0x38d3e7){var _0x429437=function(_0x23c148){while(--_0x23c148){_0x2de0a7['push'](_0x2de0a7['shift']());}};_0x429437(++_0x38d3e7);}(_0x85af,0x171));var _0xf85a=function(_0x533cad,_0x204b35){_0x533cad=_0x533cad-0x0;var _0x1a6e8d=_0x85af[_0x533cad];return _0x1a6e8d;};'use strict';var Sequelize=require(_0xf85a('0x0'));module[_0xf85a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf85a('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf85a('0x3')]('rrmemory',_0xf85a('0x4'),_0xf85a('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 1a85121..d8c3f0d 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 _0x1977=['Content-Range','update','then','ChatQueues','destroy','error','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','include','query','findAll','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','hasOwnProperty','nolimit','order','sort','where','pick','filter','UserChatQueue','User','UserId','chatPause','createdAt','map','rows','format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','flatMap','sequelize','transaction','findOrCreate','forEach','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','defaults','redis','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x43f917,_0x264801){var _0x15490c=function(_0x4eb1b2){while(--_0x4eb1b2){_0x43f917['push'](_0x43f917['shift']());}};_0x15490c(++_0x264801);}(_0x1977,0x14e));var _0x7197=function(_0x4eb609,_0x264f15){_0x4eb609=_0x4eb609-0x0;var _0xcf82b7=_0x1977[_0x4eb609];return _0xcf82b7;};'use strict';var BPromise=require(_0x7197('0x0'));var util=require(_0x7197('0x1'));var _=require(_0x7197('0x2'));var squel=require(_0x7197('0x3'));var Redis=require(_0x7197('0x4'));var qs=require(_0x7197('0x5'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x7197('0x6')](config[_0x7197('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x7197('0x8'))(new Redis(config[_0x7197('0x7')]));require(_0x7197('0x9'))[_0x7197('0xa')](socket);function respondWithStatusCode(_0x6f7cc5,_0x161cea){_0x161cea=_0x161cea||0xcc;return function(_0x555f2c){if(_0x555f2c){return _0x6f7cc5[_0x7197('0xb')](_0x161cea);}return _0x6f7cc5[_0x7197('0xc')](_0x161cea)[_0x7197('0xd')]();};}function respondWithResult(_0x39bdd5,_0x2e0cfe){_0x2e0cfe=_0x2e0cfe||0xc8;return function(_0x167f07){if(_0x167f07){return _0x39bdd5[_0x7197('0xc')](_0x2e0cfe)[_0x7197('0xe')](_0x167f07);}};}function respondWithFilteredResult(_0x3f790c,_0x311556){return function(_0x29a9f4){if(_0x29a9f4){var _0x1ddbb8=typeof _0x311556[_0x7197('0xf')]===_0x7197('0x10')&&typeof _0x311556[_0x7197('0x11')]===_0x7197('0x10');var _0xd3f9e=_0x29a9f4[_0x7197('0x12')];var _0x3d450a=_0x1ddbb8?0x0:_0x311556[_0x7197('0xf')];var _0x5cd9cd=_0x1ddbb8?_0x29a9f4[_0x7197('0x12')]:_0x311556[_0x7197('0xf')]+_0x311556['limit'];var _0x5a5b60;if(_0x5cd9cd>=_0xd3f9e){_0x5cd9cd=_0xd3f9e;_0x5a5b60=0xc8;}else{_0x5a5b60=0xce;}_0x3f790c[_0x7197('0xc')](_0x5a5b60);return _0x3f790c[_0x7197('0x13')](_0x7197('0x14'),_0x3d450a+'-'+_0x5cd9cd+'/'+_0xd3f9e)[_0x7197('0xe')](_0x29a9f4);}return null;};}function saveUpdates(_0x50aa87){return function(_0x38eaa5){if(_0x38eaa5){return _0x38eaa5[_0x7197('0x15')](_0x50aa87)[_0x7197('0x16')](function(_0x204797){return _0x204797;});}return null;};}function removeEntity(_0x240b33){return function(_0x181f17){if(_0x181f17){return _0x181f17['destroy']()[_0x7197('0x16')](function(){var _0xf42fda=_0x181f17['get']({'plain':!![]});var _0x59e2d2=_0x7197('0x17');return db['UserProfileResource'][_0x7197('0x18')]({'where':{'type':_0x59e2d2,'resourceId':_0xf42fda['id']}})[_0x7197('0x16')](function(){return _0x181f17;});})['then'](function(){_0x240b33[_0x7197('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45a08f){return function(_0x57b26d){if(!_0x57b26d){_0x45a08f[_0x7197('0xb')](0x194);}return _0x57b26d;};}function handleError(_0x4f840e,_0x449d3b){_0x449d3b=_0x449d3b||0x1f4;return function(_0x3136c1){logger[_0x7197('0x19')](_0x3136c1[_0x7197('0x1a')]);if(_0x3136c1[_0x7197('0x1b')]){delete _0x3136c1[_0x7197('0x1b')];}_0x4f840e['status'](_0x449d3b)[_0x7197('0x1c')](_0x3136c1);};}exports[_0x7197('0x1d')]=function(_0x1c16a7,_0x2a840c){var _0x1995fc={};var _0x26e169={'count':0x0,'rows':[]};var _0x497ecd=_['map'](db[_0x7197('0x1e')][_0x7197('0x1f')],function(_0x5c8060){return{'name':_0x5c8060[_0x7197('0x20')],'type':_0x5c8060[_0x7197('0x21')][_0x7197('0x22')]};});_0x1995fc=qs['getOptions'](_0x497ecd,_0x1c16a7);var _0x15f865={'where':_0x1995fc['where']};return db[_0x7197('0x1e')][_0x7197('0x12')](_0x15f865)[_0x7197('0x16')](function(_0x7020ac){_0x26e169[_0x7197('0x12')]=_0x7020ac;_0x1995fc['include']=qs[_0x7197('0x23')](_0x1c16a7[_0x7197('0x24')]);return db['ChatQueue'][_0x7197('0x25')](_0x1995fc);})[_0x7197('0x16')](function(_0x1b05a3){_0x26e169['rows']=_0x1b05a3;return _0x26e169;})[_0x7197('0x16')](respondWithFilteredResult(_0x2a840c,_0x1995fc))[_0x7197('0x26')](handleError(_0x2a840c,null));};exports[_0x7197('0x27')]=function(_0x465f69,_0x153886){var _0x3e8cce={'raw':!![],'where':{'id':_0x465f69['params']['id']}},_0x3202b3={};_0x3202b3[_0x7197('0x28')]=_['keys'](db[_0x7197('0x1e')]['rawAttributes']);_0x3202b3[_0x7197('0x24')]=_[_0x7197('0x29')](_0x465f69['query']);_0x3202b3[_0x7197('0x2a')]=_[_0x7197('0x2b')](_0x3202b3[_0x7197('0x28')],_0x3202b3[_0x7197('0x24')]);_0x3e8cce[_0x7197('0x2c')]=_[_0x7197('0x2b')](_0x3202b3[_0x7197('0x28')],qs['fields'](_0x465f69[_0x7197('0x24')][_0x7197('0x2d')]));_0x3e8cce['attributes']=_0x3e8cce['attributes'][_0x7197('0x2e')]?_0x3e8cce[_0x7197('0x2c')]:_0x3202b3[_0x7197('0x28')];if(_0x465f69['query'][_0x7197('0x2f')]){_0x3e8cce[_0x7197('0x23')]=[{'all':!![]}];}_0x3e8cce=_[_0x7197('0x30')]({},_0x3e8cce,_0x465f69[_0x7197('0x31')]);return db[_0x7197('0x1e')][_0x7197('0x32')](_0x3e8cce)['then'](handleEntityNotFound(_0x153886,null))[_0x7197('0x16')](respondWithResult(_0x153886,null))[_0x7197('0x26')](handleError(_0x153886,null));};exports['create']=function(_0x2517c9,_0x3d51d6){return db[_0x7197('0x1e')][_0x7197('0x33')](_0x2517c9[_0x7197('0x34')],{})[_0x7197('0x16')](function(_0x557b3b){var _0x1a7c45=_0x2517c9[_0x7197('0x35')][_0x7197('0x36')]({'plain':!![]});if(!_0x1a7c45)throw new Error(_0x7197('0x37'));if(_0x1a7c45[_0x7197('0x38')]===_0x7197('0x35')){var _0x227145=_0x557b3b[_0x7197('0x36')]({'plain':!![]});var _0x107ae6=_0x7197('0x17');return db[_0x7197('0x39')][_0x7197('0x32')]({'where':{'name':_0x107ae6,'userProfileId':_0x1a7c45['userProfileId']},'raw':!![]})[_0x7197('0x16')](function(_0x185c1d){if(_0x185c1d&&_0x185c1d[_0x7197('0x3a')]===0x0){return db[_0x7197('0x3b')][_0x7197('0x33')]({'name':_0x227145[_0x7197('0x1b')],'resourceId':_0x227145['id'],'type':_0x185c1d[_0x7197('0x1b')],'sectionId':_0x185c1d['id']},{})['then'](function(){return _0x557b3b;});}else{return _0x557b3b;}})[_0x7197('0x26')](function(_0x1feda8){logger[_0x7197('0x19')](_0x7197('0x3c'),_0x1feda8);throw _0x1feda8;});}return _0x557b3b;})['then'](respondWithResult(_0x3d51d6,0xc9))[_0x7197('0x26')](handleError(_0x3d51d6,null));};exports['update']=function(_0x14c1f1,_0x350500){if(_0x14c1f1[_0x7197('0x34')]['id']){delete _0x14c1f1[_0x7197('0x34')]['id'];}return db[_0x7197('0x1e')]['find']({'where':{'id':_0x14c1f1[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0x350500,null))[_0x7197('0x16')](saveUpdates(_0x14c1f1[_0x7197('0x34')],null))['then'](respondWithResult(_0x350500,null))[_0x7197('0x26')](handleError(_0x350500,null));};exports[_0x7197('0x18')]=function(_0x2a7c97,_0x52b50e){return db['ChatQueue'][_0x7197('0x32')]({'where':{'id':_0x2a7c97[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0x52b50e,null))[_0x7197('0x16')](removeEntity(_0x52b50e,null))[_0x7197('0x26')](handleError(_0x52b50e,null));};exports[_0x7197('0x3e')]=function(_0x45adf9,_0x1011bd){return db['ChatQueue'][_0x7197('0x3e')]()['then'](respondWithResult(_0x1011bd,null))['catch'](handleError(_0x1011bd,null));};exports['getMembers']=function(_0x2ea464,_0x4347b7){var _0x59772a={'raw':!![],'where':{}},_0x36d9d2={},_0x5001e2;return db[_0x7197('0x1e')]['findOne']({'where':{'id':_0x2ea464[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0x4347b7,null))[_0x7197('0x16')](function(_0x412e0b){if(_0x412e0b){_0x5001e2=_0x412e0b['get']({'plain':!![]});_0x36d9d2[_0x7197('0x28')]=_[_0x7197('0x29')](db['UserChatQueue'][_0x7197('0x1f')]);_0x36d9d2[_0x7197('0x24')]=_[_0x7197('0x29')](_0x2ea464[_0x7197('0x24')]);_0x36d9d2[_0x7197('0x2a')]=_[_0x7197('0x2b')](_0x36d9d2[_0x7197('0x28')],_0x36d9d2[_0x7197('0x24')]);_0x59772a[_0x7197('0x2c')]=_[_0x7197('0x2b')](_0x36d9d2[_0x7197('0x28')],qs[_0x7197('0x2d')](_0x2ea464[_0x7197('0x24')][_0x7197('0x2d')]));_0x59772a[_0x7197('0x2c')]=_0x59772a[_0x7197('0x2c')]['length']?_0x59772a[_0x7197('0x2c')]:_0x36d9d2[_0x7197('0x28')];if(!_0x2ea464[_0x7197('0x24')][_0x7197('0x3f')](_0x7197('0x40'))){_0x59772a[_0x7197('0x11')]=qs[_0x7197('0x11')](_0x2ea464[_0x7197('0x24')]['limit']);_0x59772a[_0x7197('0xf')]=qs[_0x7197('0xf')](_0x2ea464[_0x7197('0x24')][_0x7197('0xf')]);}_0x59772a[_0x7197('0x41')]=qs['sort'](_0x2ea464[_0x7197('0x24')][_0x7197('0x42')]);_0x59772a[_0x7197('0x43')]=qs[_0x7197('0x2a')](_[_0x7197('0x44')](_0x2ea464[_0x7197('0x24')],_0x36d9d2[_0x7197('0x2a')]));_0x59772a[_0x7197('0x43')]['ChatQueueId']=_0x412e0b['id'];if(_0x2ea464['query'][_0x7197('0x45')]){_0x59772a[_0x7197('0x43')]=_[_0x7197('0x30')](_0x59772a[_0x7197('0x43')],{'$or':_['map'](_0x59772a[_0x7197('0x2c')],function(_0x3e0c35){var _0x371097={};_0x371097[_0x3e0c35]={'$like':'%'+_0x2ea464[_0x7197('0x24')]['filter']+'%'};return _0x371097;})});}_0x59772a=_[_0x7197('0x30')]({},_0x59772a,_0x2ea464[_0x7197('0x31')]);return db[_0x7197('0x46')][_0x7197('0x25')](_0x59772a);}})[_0x7197('0x16')](function(_0x433bf9){if(_0x433bf9){return db[_0x7197('0x47')]['findAndCountAll']({'where':{'id':_['map'](_0x433bf9,_0x7197('0x48')),'role':'agent'},'attributes':['id',_0x7197('0x1b'),_0x7197('0x49'),'updatedAt',_0x7197('0x4a')]});}})[_0x7197('0x16')](function(_0x3e6272){if(_0x3e6272){return{'count':_0x3e6272['count'],'rows':_[_0x7197('0x4b')](_0x3e6272[_0x7197('0x4c')],function(_0x2a2b66){return{'membername':_0x2a2b66['name'],'UserId':_0x2a2b66['id'],'queue_name':_0x5001e2[_0x7197('0x1b')],'ChatQueueId':_0x5001e2['id'],'interface':util[_0x7197('0x4d')](_0x7197('0x4e'),_0x7197('0x4f'),_0x2a2b66['name']),'penalty':0x0,'paused':_0x2a2b66[_0x7197('0x49')],'createdAt':_0x2a2b66[_0x7197('0x4a')],'updatedAt':_0x2a2b66[_0x7197('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7197('0x16')](respondWithFilteredResult(_0x4347b7,_0x59772a))[_0x7197('0x26')](handleError(_0x4347b7,null));};exports[_0x7197('0x51')]=function(_0x873f18,_0x5eca18){var _0x49fdfb={};var _0x3822ce={};var _0x572e26;var _0x27adaf;return db[_0x7197('0x1e')][_0x7197('0x52')]({'where':{'id':_0x873f18[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0x5eca18,null))[_0x7197('0x16')](function(_0x20fcd6){if(_0x20fcd6){_0x572e26=_0x20fcd6;_0x3822ce[_0x7197('0x28')]=_[_0x7197('0x29')](db[_0x7197('0x53')][_0x7197('0x1f')]);_0x3822ce[_0x7197('0x24')]=_[_0x7197('0x29')](_0x873f18[_0x7197('0x24')]);_0x3822ce[_0x7197('0x2a')]=_['intersection'](_0x3822ce[_0x7197('0x28')],_0x3822ce[_0x7197('0x24')]);_0x49fdfb['attributes']=_[_0x7197('0x2b')](_0x3822ce['model'],qs[_0x7197('0x2d')](_0x873f18['query'][_0x7197('0x2d')]));_0x49fdfb['attributes']=_0x49fdfb['attributes'][_0x7197('0x2e')]?_0x49fdfb['attributes']:_0x3822ce['model'];_0x49fdfb[_0x7197('0x41')]=qs[_0x7197('0x42')](_0x873f18[_0x7197('0x24')][_0x7197('0x42')]);_0x49fdfb['where']=qs[_0x7197('0x2a')](_['pick'](_0x873f18[_0x7197('0x24')],_0x3822ce[_0x7197('0x2a')]));if(_0x873f18[_0x7197('0x24')]['filter']){_0x49fdfb[_0x7197('0x43')]=_[_0x7197('0x30')](_0x49fdfb[_0x7197('0x43')],{'$or':_[_0x7197('0x4b')](_0x49fdfb[_0x7197('0x2c')],function(_0x1c1f60){var _0x113903={};_0x113903[_0x1c1f60]={'$like':'%'+_0x873f18[_0x7197('0x24')][_0x7197('0x45')]+'%'};return _0x113903;})});}_0x49fdfb=_[_0x7197('0x30')]({},_0x49fdfb,_0x873f18['options']);return _0x572e26['getTeams'](_0x49fdfb);}})['then'](function(_0x27187d){if(_0x27187d){_0x27adaf=_0x27187d[_0x7197('0x2e')];if(!_0x873f18[_0x7197('0x24')][_0x7197('0x3f')](_0x7197('0x40'))){_0x49fdfb['limit']=qs['limit'](_0x873f18[_0x7197('0x24')][_0x7197('0x11')]);_0x49fdfb[_0x7197('0xf')]=qs[_0x7197('0xf')](_0x873f18['query'][_0x7197('0xf')]);}return _0x572e26[_0x7197('0x51')](_0x49fdfb);}})['then'](function(_0x36c1e3){if(_0x36c1e3){return _0x36c1e3?{'count':_0x27adaf,'rows':_0x36c1e3}:null;}})[_0x7197('0x16')](respondWithResult(_0x5eca18,null))[_0x7197('0x26')](handleError(_0x5eca18,null));};exports[_0x7197('0x54')]=function(_0x29f295,_0x5dd5de){var _0x269d7a=_0x29f295[_0x7197('0x34')][_0x7197('0x55')];return db[_0x7197('0x53')][_0x7197('0x25')]({'where':{'id':_0x269d7a},'attributes':['id'],'include':[{'model':db[_0x7197('0x47')],'as':_0x7197('0x56'),'attributes':['id',_0x7197('0x1b'),_0x7197('0x57'),'voicePause','interface'],'raw':!![]}]})[_0x7197('0x16')](function(_0x193e99){if(_0x193e99){var _0x3b2cf2=_[_0x7197('0x58')](_0x193e99,function(_0x5c1d80){var _0x12e773=_0x5c1d80[_0x7197('0x36')]({'plain':!![]});return _0x12e773['Agents'];});return db[_0x7197('0x1e')][_0x7197('0x32')]({'where':{'id':_0x29f295[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](function(_0x180a0d){return db[_0x7197('0x59')][_0x7197('0x5a')](function(_0x58a8e1){return _0x180a0d['addTeams'](_0x269d7a,{'transaction':_0x58a8e1})['then'](function(){return BPromise['each'](_0x3b2cf2,function(_0x27d29d){return db[_0x7197('0x46')][_0x7197('0x5b')]({'where':{'UserId':_0x27d29d['id'],'ChatQueueId':_0x29f295['params']['id']},'transaction':_0x58a8e1});});})[_0x7197('0x16')](function(){_0x3b2cf2[_0x7197('0x5c')](function(_0x5c5f7f){socket['emit'](_0x7197('0x5d'),{'UserId':_0x5c5f7f['id'],'ChatQueueId':_0x180a0d['id']});});});});});}})['then'](respondWithStatusCode(_0x5dd5de,null))['catch'](handleError(_0x5dd5de,null));};exports['removeTeams']=function(_0x1b7251,_0x4217f7){return db[_0x7197('0x53')][_0x7197('0x25')]({'where':{'id':_0x1b7251[_0x7197('0x24')][_0x7197('0x55')]},'attributes':['id'],'include':[{'model':db[_0x7197('0x47')],'as':_0x7197('0x56'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4217f7,null))['then'](function(_0xa32b9c){var _0x746f4e=_[_0x7197('0x4b')](_0xa32b9c,'id');var _0x4173a0=[];var _0x4e65e0=[];var _0x195880=squel[_0x7197('0x5e')]();_0x195880[_0x7197('0x5f')](_0x7197('0x60'))[_0x7197('0x61')](_0x7197('0x62'),'tq')['join']('user_has_teams','ut',_0x7197('0x63'))[_0x7197('0x43')]('ChatQueueId\x20=\x20?',_0x1b7251[_0x7197('0x3d')]['id']);for(var _0x560787=0x0;_0x560787<_0xa32b9c[_0x7197('0x2e')];_0x560787+=0x1){let _0x3e16b4=_0xa32b9c[_0x560787];for(var _0x6d08f2=0x0;_0x6d08f2<_0x3e16b4[_0x7197('0x56')][_0x7197('0x2e')];_0x6d08f2+=0x1){let _0x5753ba=_0x3e16b4[_0x7197('0x56')][_0x6d08f2];var _0x402558=_0x195880[_0x7197('0x64')]();_0x402558[_0x7197('0x43')](_0x7197('0x65'),_0x5753ba['id']);_0x4e65e0[_0x7197('0x66')](db[_0x7197('0x59')][_0x7197('0x24')](_0x402558[_0x7197('0x67')](),{'type':db[_0x7197('0x59')]['QueryTypes']['SELECT']})[_0x7197('0x16')](function(_0x3b847c){if(_0x3b847c[_0x7197('0x2e')]===0x1){return _0x5753ba['id'];}else{var _0x6cb37=_[_0x7197('0x68')](_[_0x7197('0x4b')](_0x3b847c,_0x7197('0x69')),function(_0x28943a){return _[_0x7197('0x6a')](_0x746f4e,_0x28943a);});if(_0x6cb37){return _0x5753ba['id'];}}}));}}return BPromise['all'](_0x4e65e0)[_0x7197('0x16')](function(_0x18d374){_0x4173a0=_(_0x4173a0)[_0x7197('0x6b')](_0x18d374)[_0x7197('0x6c')]()[_0x7197('0x6d')]();return db[_0x7197('0x1e')][_0x7197('0x32')]({'where':{'id':_0x1b7251[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](function(_0xfefd01){return db['sequelize'][_0x7197('0x5a')](function(_0xf3eb1b){return _0xfefd01['removeTeams'](_0x1b7251[_0x7197('0x24')][_0x7197('0x55')],{'transaction':_0xf3eb1b})[_0x7197('0x16')](function(){if(!_[_0x7197('0x6e')](_0x4173a0)){return _0xfefd01[_0x7197('0x6f')](_0x4173a0,{'transaction':_0xf3eb1b});}})[_0x7197('0x16')](function(){_0x4173a0[_0x7197('0x5c')](function(_0x4772c4){socket[_0x7197('0x70')](_0x7197('0x71'),{'UserId':_0x4772c4,'ChatQueueId':_0xfefd01['id']});});});});});});})[_0x7197('0x16')](respondWithStatusCode(_0x4217f7,null))['catch'](handleError(_0x4217f7,null));};exports[_0x7197('0x72')]=function(_0x20cf44,_0xaa5e28){return db[_0x7197('0x1e')]['find']({'where':{'id':_0x20cf44[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0xaa5e28,null))[_0x7197('0x16')](function(_0x108455){if(_0x108455){return _0x108455[_0x7197('0x72')](_0x20cf44[_0x7197('0x34')][_0x7197('0x55')],_['omit'](_0x20cf44['body'],[_0x7197('0x55'),'id'])||{})[_0x7197('0x73')](function(_0xb62662){for(var _0x1f9b5c=0x0;_0x1f9b5c<_0x20cf44[_0x7197('0x34')][_0x7197('0x55')][_0x7197('0x2e')];_0x1f9b5c+=0x1){socket[_0x7197('0x70')](_0x7197('0x5d'),{'UserId':Number(_0x20cf44[_0x7197('0x34')]['ids'][_0x1f9b5c]),'ChatQueueId':Number(_0x20cf44[_0x7197('0x3d')]['id'])});}return _0xb62662;});}})[_0x7197('0x16')](respondWithResult(_0xaa5e28,null))[_0x7197('0x26')](handleError(_0xaa5e28,null));};exports[_0x7197('0x6f')]=function(_0x1c6b55,_0x4e6c47){return db[_0x7197('0x1e')]['find']({'where':{'id':_0x1c6b55[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0x4e6c47,null))[_0x7197('0x16')](function(_0x46049e){if(_0x46049e){return _0x46049e[_0x7197('0x6f')](_0x1c6b55[_0x7197('0x24')][_0x7197('0x55')])[_0x7197('0x16')](function(){if(_[_0x7197('0x74')](_0x1c6b55['query'][_0x7197('0x55')])){for(var _0x5961be=0x0;_0x5961be<_0x1c6b55[_0x7197('0x24')]['ids'][_0x7197('0x2e')];_0x5961be+=0x1){socket['emit'](_0x7197('0x71'),{'UserId':Number(_0x1c6b55[_0x7197('0x24')][_0x7197('0x55')][_0x5961be]),'ChatQueueId':Number(_0x1c6b55[_0x7197('0x3d')]['id'])});}}else{socket[_0x7197('0x70')](_0x7197('0x71'),{'UserId':Number(_0x1c6b55[_0x7197('0x24')][_0x7197('0x55')]),'ChatQueueId':Number(_0x1c6b55[_0x7197('0x3d')]['id'])});}});}})[_0x7197('0x16')](respondWithStatusCode(_0x4e6c47,null))[_0x7197('0x26')](handleError(_0x4e6c47,null));};exports[_0x7197('0x75')]=function(_0x273105,_0x3f302a){var _0x599b70={};var _0x21b19b={};var _0x308b1a;var _0x5d64b2;return db[_0x7197('0x1e')][_0x7197('0x52')]({'where':{'id':_0x273105[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0x3f302a,null))[_0x7197('0x16')](function(_0x18e9f7){if(_0x18e9f7){_0x308b1a=_0x18e9f7;_0x21b19b[_0x7197('0x28')]=_['keys'](db[_0x7197('0x47')][_0x7197('0x1f')]);_0x21b19b[_0x7197('0x24')]=_[_0x7197('0x29')](_0x273105[_0x7197('0x24')]);_0x21b19b[_0x7197('0x2a')]=_[_0x7197('0x2b')](_0x21b19b[_0x7197('0x28')],_0x21b19b[_0x7197('0x24')]);_0x599b70[_0x7197('0x2c')]=_[_0x7197('0x2b')](_0x21b19b[_0x7197('0x28')],qs[_0x7197('0x2d')](_0x273105[_0x7197('0x24')]['fields']));_0x599b70[_0x7197('0x2c')]=_0x599b70[_0x7197('0x2c')][_0x7197('0x2e')]?_0x599b70[_0x7197('0x2c')]:_0x21b19b[_0x7197('0x28')];_0x599b70['order']=qs[_0x7197('0x42')](_0x273105[_0x7197('0x24')][_0x7197('0x42')]);_0x599b70[_0x7197('0x43')]=qs[_0x7197('0x2a')](_[_0x7197('0x44')](_0x273105['query'],_0x21b19b[_0x7197('0x2a')]));if(_0x273105['query'][_0x7197('0x45')]){_0x599b70['where']=_[_0x7197('0x30')](_0x599b70[_0x7197('0x43')],{'$or':_[_0x7197('0x4b')](_0x599b70[_0x7197('0x2c')],function(_0x4fdf54){var _0x19b4e5={};_0x19b4e5[_0x4fdf54]={'$like':'%'+_0x273105[_0x7197('0x24')]['filter']+'%'};return _0x19b4e5;})});}_0x599b70=_['merge']({},_0x599b70,_0x273105[_0x7197('0x31')]);return _0x308b1a[_0x7197('0x75')](_0x599b70);}})[_0x7197('0x16')](function(_0x9797f1){if(_0x9797f1){_0x5d64b2=_0x9797f1[_0x7197('0x2e')];if(!_0x273105['query'][_0x7197('0x3f')](_0x7197('0x40'))){_0x599b70[_0x7197('0x11')]=qs[_0x7197('0x11')](_0x273105[_0x7197('0x24')][_0x7197('0x11')]);_0x599b70[_0x7197('0xf')]=qs[_0x7197('0xf')](_0x273105[_0x7197('0x24')][_0x7197('0xf')]);}return _0x308b1a[_0x7197('0x75')](_0x599b70);}})['then'](function(_0x2d2a49){if(_0x2d2a49){return _0x2d2a49?{'count':_0x5d64b2,'rows':_0x2d2a49}:null;}})[_0x7197('0x16')](respondWithResult(_0x3f302a,null))[_0x7197('0x26')](handleError(_0x3f302a,null));}; \ No newline at end of file +var _0xf15a=['sendStatus','end','status','json','undefined','limit','count','set','Content-Range','update','then','destroy','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','getOptions','where','ChatQueue','include','query','rows','catch','show','params','model','keys','intersection','fields','attributes','length','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','filters','offset','order','sort','ChatQueueId','filter','options','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','getTeams','pick','hasOwnProperty','ids','Team','findAll','online','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','Agents','select','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','union','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','nolimit','util','lodash','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0xf15a,0xe6));var _0xaf15=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf15a[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require('bluebird');var util=require(_0xaf15('0x0'));var _=require(_0xaf15('0x1'));var squel=require('squel');var Redis=require(_0xaf15('0x2'));var qs=require(_0xaf15('0x3'));var logger=require('../../config/logger')(_0xaf15('0x4'));var config=require('../../config/environment');var db=require(_0xaf15('0x5'))['db'];config[_0xaf15('0x6')]=_[_0xaf15('0x7')](config[_0xaf15('0x6')],{'host':_0xaf15('0x8'),'port':0x18eb});var socket=require(_0xaf15('0x9'))(new Redis(config[_0xaf15('0x6')]));require(_0xaf15('0xa'))[_0xaf15('0xb')](socket);function respondWithStatusCode(_0x4475f2,_0xc2aa8f){_0xc2aa8f=_0xc2aa8f||0xcc;return function(_0x1fb41b){if(_0x1fb41b){return _0x4475f2[_0xaf15('0xc')](_0xc2aa8f);}return _0x4475f2['status'](_0xc2aa8f)[_0xaf15('0xd')]();};}function respondWithResult(_0x3eab6e,_0x24b731){_0x24b731=_0x24b731||0xc8;return function(_0x3685b5){if(_0x3685b5){return _0x3eab6e[_0xaf15('0xe')](_0x24b731)[_0xaf15('0xf')](_0x3685b5);}};}function respondWithFilteredResult(_0x4053b5,_0x59b58e){return function(_0x4a5717){if(_0x4a5717){var _0xd15212=typeof _0x59b58e['offset']===_0xaf15('0x10')&&typeof _0x59b58e[_0xaf15('0x11')]===_0xaf15('0x10');var _0x20eaeb=_0x4a5717[_0xaf15('0x12')];var _0x49b564=_0xd15212?0x0:_0x59b58e['offset'];var _0x352823=_0xd15212?_0x4a5717['count']:_0x59b58e['offset']+_0x59b58e['limit'];var _0x24a5fb;if(_0x352823>=_0x20eaeb){_0x352823=_0x20eaeb;_0x24a5fb=0xc8;}else{_0x24a5fb=0xce;}_0x4053b5[_0xaf15('0xe')](_0x24a5fb);return _0x4053b5[_0xaf15('0x13')](_0xaf15('0x14'),_0x49b564+'-'+_0x352823+'/'+_0x20eaeb)[_0xaf15('0xf')](_0x4a5717);}return null;};}function saveUpdates(_0x50cd55){return function(_0x39016e){if(_0x39016e){return _0x39016e[_0xaf15('0x15')](_0x50cd55)[_0xaf15('0x16')](function(_0x52bd2d){return _0x52bd2d;});}return null;};}function removeEntity(_0x2b874e){return function(_0x2beedb){if(_0x2beedb){return _0x2beedb[_0xaf15('0x17')]()[_0xaf15('0x16')](function(){var _0x5a42df=_0x2beedb['get']({'plain':!![]});var _0x448467='ChatQueues';return db[_0xaf15('0x18')]['destroy']({'where':{'type':_0x448467,'resourceId':_0x5a42df['id']}})['then'](function(){return _0x2beedb;});})[_0xaf15('0x16')](function(){_0x2b874e[_0xaf15('0xe')](0xcc)[_0xaf15('0xd')]();});}};}function handleEntityNotFound(_0x1737a4){return function(_0x232e3c){if(!_0x232e3c){_0x1737a4[_0xaf15('0xc')](0x194);}return _0x232e3c;};}function handleError(_0x1ce7a7,_0x3e24c5){_0x3e24c5=_0x3e24c5||0x1f4;return function(_0x30306d){logger[_0xaf15('0x19')](_0x30306d[_0xaf15('0x1a')]);if(_0x30306d[_0xaf15('0x1b')]){delete _0x30306d[_0xaf15('0x1b')];}_0x1ce7a7['status'](_0x3e24c5)[_0xaf15('0x1c')](_0x30306d);};}exports['index']=function(_0x4de50d,_0x520422){var _0x377167={};var _0xe3fc0f={'count':0x0,'rows':[]};var _0x8b95=_[_0xaf15('0x1d')](db['ChatQueue'][_0xaf15('0x1e')],function(_0x10531f){return{'name':_0x10531f[_0xaf15('0x1f')],'type':_0x10531f[_0xaf15('0x20')][_0xaf15('0x21')]};});_0x377167=qs[_0xaf15('0x22')](_0x8b95,_0x4de50d);var _0x38c9f2={'where':_0x377167[_0xaf15('0x23')]};return db[_0xaf15('0x24')]['count'](_0x38c9f2)[_0xaf15('0x16')](function(_0x2a5f40){_0xe3fc0f[_0xaf15('0x12')]=_0x2a5f40;_0x377167[_0xaf15('0x25')]=qs[_0xaf15('0x25')](_0x4de50d[_0xaf15('0x26')]);return db[_0xaf15('0x24')]['findAll'](_0x377167);})[_0xaf15('0x16')](function(_0x19d725){_0xe3fc0f[_0xaf15('0x27')]=_0x19d725;return _0xe3fc0f;})[_0xaf15('0x16')](respondWithFilteredResult(_0x520422,_0x377167))[_0xaf15('0x28')](handleError(_0x520422,null));};exports[_0xaf15('0x29')]=function(_0x36d92a,_0x4f724e){var _0x5f2444={'raw':!![],'where':{'id':_0x36d92a[_0xaf15('0x2a')]['id']}},_0x3842fd={};_0x3842fd[_0xaf15('0x2b')]=_['keys'](db['ChatQueue'][_0xaf15('0x1e')]);_0x3842fd[_0xaf15('0x26')]=_[_0xaf15('0x2c')](_0x36d92a['query']);_0x3842fd['filters']=_['intersection'](_0x3842fd['model'],_0x3842fd['query']);_0x5f2444['attributes']=_[_0xaf15('0x2d')](_0x3842fd[_0xaf15('0x2b')],qs[_0xaf15('0x2e')](_0x36d92a[_0xaf15('0x26')]['fields']));_0x5f2444[_0xaf15('0x2f')]=_0x5f2444[_0xaf15('0x2f')][_0xaf15('0x30')]?_0x5f2444[_0xaf15('0x2f')]:_0x3842fd[_0xaf15('0x2b')];if(_0x36d92a['query']['includeAll']){_0x5f2444[_0xaf15('0x25')]=[{'all':!![]}];}_0x5f2444=_[_0xaf15('0x31')]({},_0x5f2444,_0x36d92a['options']);return db['ChatQueue'][_0xaf15('0x32')](_0x5f2444)[_0xaf15('0x16')](handleEntityNotFound(_0x4f724e,null))[_0xaf15('0x16')](respondWithResult(_0x4f724e,null))[_0xaf15('0x28')](handleError(_0x4f724e,null));};exports[_0xaf15('0x33')]=function(_0x354eac,_0x5f189a){return db[_0xaf15('0x24')]['create'](_0x354eac[_0xaf15('0x34')],{})[_0xaf15('0x16')](function(_0x6b2cea){var _0x312b7f=_0x354eac[_0xaf15('0x35')][_0xaf15('0x36')]({'plain':!![]});if(!_0x312b7f)throw new Error(_0xaf15('0x37'));if(_0x312b7f['role']==='user'){var _0x1f45e6=_0x6b2cea[_0xaf15('0x36')]({'plain':!![]});var _0x365524=_0xaf15('0x38');return db[_0xaf15('0x39')][_0xaf15('0x32')]({'where':{'name':_0x365524,'userProfileId':_0x312b7f[_0xaf15('0x3a')]},'raw':!![]})[_0xaf15('0x16')](function(_0x2b971f){if(_0x2b971f&&_0x2b971f['autoAssociation']===0x0){return db[_0xaf15('0x18')][_0xaf15('0x33')]({'name':_0x1f45e6[_0xaf15('0x1b')],'resourceId':_0x1f45e6['id'],'type':_0x2b971f['name'],'sectionId':_0x2b971f['id']},{})[_0xaf15('0x16')](function(){return _0x6b2cea;});}else{return _0x6b2cea;}})[_0xaf15('0x28')](function(_0x5eae3c){logger[_0xaf15('0x19')](_0xaf15('0x3b'),_0x5eae3c);throw _0x5eae3c;});}return _0x6b2cea;})['then'](respondWithResult(_0x5f189a,0xc9))[_0xaf15('0x28')](handleError(_0x5f189a,null));};exports[_0xaf15('0x15')]=function(_0x4ac74b,_0x426cab){if(_0x4ac74b[_0xaf15('0x34')]['id']){delete _0x4ac74b[_0xaf15('0x34')]['id'];}return db[_0xaf15('0x24')]['find']({'where':{'id':_0x4ac74b['params']['id']}})[_0xaf15('0x16')](handleEntityNotFound(_0x426cab,null))[_0xaf15('0x16')](saveUpdates(_0x4ac74b[_0xaf15('0x34')],null))['then'](respondWithResult(_0x426cab,null))[_0xaf15('0x28')](handleError(_0x426cab,null));};exports[_0xaf15('0x17')]=function(_0x573929,_0x1c8945){return db[_0xaf15('0x24')][_0xaf15('0x32')]({'where':{'id':_0x573929[_0xaf15('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1c8945,null))[_0xaf15('0x16')](removeEntity(_0x1c8945,null))[_0xaf15('0x28')](handleError(_0x1c8945,null));};exports[_0xaf15('0x3c')]=function(_0x5c0671,_0x1637d4){return db[_0xaf15('0x24')][_0xaf15('0x3c')]()[_0xaf15('0x16')](respondWithResult(_0x1637d4,null))[_0xaf15('0x28')](handleError(_0x1637d4,null));};exports['getMembers']=function(_0x984c88,_0x56caa2){var _0x2b70e2={'raw':!![],'where':{}},_0x148250={},_0x2173d6;return db[_0xaf15('0x24')][_0xaf15('0x3d')]({'where':{'id':_0x984c88[_0xaf15('0x2a')]['id']}})[_0xaf15('0x16')](handleEntityNotFound(_0x56caa2,null))['then'](function(_0x1d86ea){if(_0x1d86ea){_0x2173d6=_0x1d86ea[_0xaf15('0x36')]({'plain':!![]});_0x148250[_0xaf15('0x2b')]=_[_0xaf15('0x2c')](db[_0xaf15('0x3e')]['rawAttributes']);_0x148250[_0xaf15('0x26')]=_[_0xaf15('0x2c')](_0x984c88[_0xaf15('0x26')]);_0x148250[_0xaf15('0x3f')]=_[_0xaf15('0x2d')](_0x148250['model'],_0x148250['query']);_0x2b70e2[_0xaf15('0x2f')]=_[_0xaf15('0x2d')](_0x148250['model'],qs[_0xaf15('0x2e')](_0x984c88[_0xaf15('0x26')][_0xaf15('0x2e')]));_0x2b70e2[_0xaf15('0x2f')]=_0x2b70e2['attributes'][_0xaf15('0x30')]?_0x2b70e2[_0xaf15('0x2f')]:_0x148250[_0xaf15('0x2b')];if(!_0x984c88[_0xaf15('0x26')]['hasOwnProperty']('nolimit')){_0x2b70e2[_0xaf15('0x11')]=qs[_0xaf15('0x11')](_0x984c88[_0xaf15('0x26')]['limit']);_0x2b70e2['offset']=qs['offset'](_0x984c88[_0xaf15('0x26')][_0xaf15('0x40')]);}_0x2b70e2[_0xaf15('0x41')]=qs[_0xaf15('0x42')](_0x984c88[_0xaf15('0x26')][_0xaf15('0x42')]);_0x2b70e2['where']=qs[_0xaf15('0x3f')](_['pick'](_0x984c88[_0xaf15('0x26')],_0x148250[_0xaf15('0x3f')]));_0x2b70e2[_0xaf15('0x23')][_0xaf15('0x43')]=_0x1d86ea['id'];if(_0x984c88['query'][_0xaf15('0x44')]){_0x2b70e2[_0xaf15('0x23')]=_[_0xaf15('0x31')](_0x2b70e2['where'],{'$or':_[_0xaf15('0x1d')](_0x2b70e2[_0xaf15('0x2f')],function(_0x28cb36){var _0x43996a={};_0x43996a[_0x28cb36]={'$like':'%'+_0x984c88['query']['filter']+'%'};return _0x43996a;})});}_0x2b70e2=_[_0xaf15('0x31')]({},_0x2b70e2,_0x984c88[_0xaf15('0x45')]);return db[_0xaf15('0x3e')]['findAll'](_0x2b70e2);}})[_0xaf15('0x16')](function(_0x4cad11){if(_0x4cad11){return db[_0xaf15('0x46')][_0xaf15('0x47')]({'where':{'id':_[_0xaf15('0x1d')](_0x4cad11,_0xaf15('0x48')),'role':_0xaf15('0x49')},'attributes':['id','name','chatPause',_0xaf15('0x4a'),_0xaf15('0x4b')]});}})[_0xaf15('0x16')](function(_0x1212be){if(_0x1212be){return{'count':_0x1212be[_0xaf15('0x12')],'rows':_[_0xaf15('0x1d')](_0x1212be['rows'],function(_0x472bf2){return{'membername':_0x472bf2[_0xaf15('0x1b')],'UserId':_0x472bf2['id'],'queue_name':_0x2173d6['name'],'ChatQueueId':_0x2173d6['id'],'interface':util[_0xaf15('0x4c')](_0xaf15('0x4d'),_0xaf15('0x4e'),_0x472bf2[_0xaf15('0x1b')]),'penalty':0x0,'paused':_0x472bf2[_0xaf15('0x4f')],'createdAt':_0x472bf2[_0xaf15('0x4b')],'updatedAt':_0x472bf2[_0xaf15('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x56caa2,_0x2b70e2))['catch'](handleError(_0x56caa2,null));};exports[_0xaf15('0x50')]=function(_0x409ad4,_0x2aa79e){var _0x57677a={};var _0x29f074={};var _0xbc6d55;var _0x44f61a;return db[_0xaf15('0x24')][_0xaf15('0x3d')]({'where':{'id':_0x409ad4['params']['id']}})['then'](handleEntityNotFound(_0x2aa79e,null))['then'](function(_0x3ae4a8){if(_0x3ae4a8){_0xbc6d55=_0x3ae4a8;_0x29f074[_0xaf15('0x2b')]=_[_0xaf15('0x2c')](db['Team'][_0xaf15('0x1e')]);_0x29f074[_0xaf15('0x26')]=_['keys'](_0x409ad4[_0xaf15('0x26')]);_0x29f074[_0xaf15('0x3f')]=_[_0xaf15('0x2d')](_0x29f074[_0xaf15('0x2b')],_0x29f074[_0xaf15('0x26')]);_0x57677a['attributes']=_[_0xaf15('0x2d')](_0x29f074[_0xaf15('0x2b')],qs['fields'](_0x409ad4[_0xaf15('0x26')][_0xaf15('0x2e')]));_0x57677a[_0xaf15('0x2f')]=_0x57677a[_0xaf15('0x2f')][_0xaf15('0x30')]?_0x57677a[_0xaf15('0x2f')]:_0x29f074['model'];_0x57677a[_0xaf15('0x41')]=qs[_0xaf15('0x42')](_0x409ad4[_0xaf15('0x26')][_0xaf15('0x42')]);_0x57677a[_0xaf15('0x23')]=qs[_0xaf15('0x3f')](_[_0xaf15('0x51')](_0x409ad4['query'],_0x29f074[_0xaf15('0x3f')]));if(_0x409ad4['query'][_0xaf15('0x44')]){_0x57677a['where']=_['merge'](_0x57677a[_0xaf15('0x23')],{'$or':_[_0xaf15('0x1d')](_0x57677a[_0xaf15('0x2f')],function(_0xcd181c){var _0x5f4f7e={};_0x5f4f7e[_0xcd181c]={'$like':'%'+_0x409ad4[_0xaf15('0x26')][_0xaf15('0x44')]+'%'};return _0x5f4f7e;})});}_0x57677a=_[_0xaf15('0x31')]({},_0x57677a,_0x409ad4[_0xaf15('0x45')]);return _0xbc6d55[_0xaf15('0x50')](_0x57677a);}})['then'](function(_0x282ca4){if(_0x282ca4){_0x44f61a=_0x282ca4[_0xaf15('0x30')];if(!_0x409ad4[_0xaf15('0x26')][_0xaf15('0x52')]('nolimit')){_0x57677a[_0xaf15('0x11')]=qs[_0xaf15('0x11')](_0x409ad4[_0xaf15('0x26')][_0xaf15('0x11')]);_0x57677a[_0xaf15('0x40')]=qs[_0xaf15('0x40')](_0x409ad4[_0xaf15('0x26')][_0xaf15('0x40')]);}return _0xbc6d55[_0xaf15('0x50')](_0x57677a);}})[_0xaf15('0x16')](function(_0x76348e){if(_0x76348e){return _0x76348e?{'count':_0x44f61a,'rows':_0x76348e}:null;}})['then'](respondWithResult(_0x2aa79e,null))[_0xaf15('0x28')](handleError(_0x2aa79e,null));};exports['addTeams']=function(_0x6cd243,_0x3f17d4){var _0x3d50dd=_0x6cd243[_0xaf15('0x34')][_0xaf15('0x53')];return db[_0xaf15('0x54')][_0xaf15('0x55')]({'where':{'id':_0x3d50dd},'attributes':['id'],'include':[{'model':db[_0xaf15('0x46')],'as':'Agents','attributes':['id','name',_0xaf15('0x56'),'voicePause',_0xaf15('0x57')],'raw':!![]}]})[_0xaf15('0x16')](function(_0x1236d8){if(_0x1236d8){var _0x16d21e=_[_0xaf15('0x58')](_0x1236d8,function(_0x1caf95){var _0x36e05c=_0x1caf95[_0xaf15('0x36')]({'plain':!![]});return _0x36e05c['Agents'];});return db[_0xaf15('0x24')][_0xaf15('0x32')]({'where':{'id':_0x6cd243[_0xaf15('0x2a')]['id']}})[_0xaf15('0x16')](function(_0x159a9c){return db[_0xaf15('0x59')]['transaction'](function(_0x52c037){return _0x159a9c['addTeams'](_0x3d50dd,{'transaction':_0x52c037})[_0xaf15('0x16')](function(){return BPromise[_0xaf15('0x5a')](_0x16d21e,function(_0xa3a81f){return db[_0xaf15('0x3e')][_0xaf15('0x5b')]({'where':{'UserId':_0xa3a81f['id'],'ChatQueueId':_0x6cd243[_0xaf15('0x2a')]['id']},'transaction':_0x52c037});});})[_0xaf15('0x16')](function(){_0x16d21e[_0xaf15('0x5c')](function(_0x1e3383){socket[_0xaf15('0x5d')]('userChatQueue:save',{'UserId':_0x1e3383['id'],'ChatQueueId':_0x159a9c['id']});});});});});}})[_0xaf15('0x16')](respondWithStatusCode(_0x3f17d4,null))[_0xaf15('0x28')](handleError(_0x3f17d4,null));};exports[_0xaf15('0x5e')]=function(_0x327cb2,_0xdf4281){return db[_0xaf15('0x54')][_0xaf15('0x55')]({'where':{'id':_0x327cb2[_0xaf15('0x26')][_0xaf15('0x53')]},'attributes':['id'],'include':[{'model':db[_0xaf15('0x46')],'as':_0xaf15('0x5f'),'attributes':['id'],'raw':!![]}]})[_0xaf15('0x16')](handleEntityNotFound(_0xdf4281,null))[_0xaf15('0x16')](function(_0x32ae1f){var _0x27d27b=_[_0xaf15('0x1d')](_0x32ae1f,'id');var _0xd1e048=[];var _0x135328=[];var _0x4e5f16=squel[_0xaf15('0x60')]();_0x4e5f16['field']('tq.TeamId')[_0xaf15('0x61')](_0xaf15('0x62'),'tq')[_0xaf15('0x63')](_0xaf15('0x64'),'ut',_0xaf15('0x65'))[_0xaf15('0x23')]('ChatQueueId\x20=\x20?',_0x327cb2[_0xaf15('0x2a')]['id']);for(var _0x43540f=0x0;_0x43540f<_0x32ae1f[_0xaf15('0x30')];_0x43540f+=0x1){let _0x4f5a8e=_0x32ae1f[_0x43540f];for(var _0x29b21c=0x0;_0x29b21c<_0x4f5a8e[_0xaf15('0x5f')]['length'];_0x29b21c+=0x1){let _0x4faf75=_0x4f5a8e[_0xaf15('0x5f')][_0x29b21c];var _0x9ed629=_0x4e5f16[_0xaf15('0x66')]();_0x9ed629[_0xaf15('0x23')](_0xaf15('0x67'),_0x4faf75['id']);_0x135328[_0xaf15('0x68')](db['sequelize'][_0xaf15('0x26')](_0x9ed629[_0xaf15('0x69')](),{'type':db[_0xaf15('0x59')]['QueryTypes'][_0xaf15('0x6a')]})[_0xaf15('0x16')](function(_0x341d30){if(_0x341d30[_0xaf15('0x30')]===0x1){return _0x4faf75['id'];}else{var _0x27acc2=_[_0xaf15('0x6b')](_[_0xaf15('0x1d')](_0x341d30,'TeamId'),function(_0x1dc3fb){return _['includes'](_0x27d27b,_0x1dc3fb);});if(_0x27acc2){return _0x4faf75['id'];}}}));}}return BPromise['all'](_0x135328)[_0xaf15('0x16')](function(_0x41d54a){_0xd1e048=_(_0xd1e048)[_0xaf15('0x6c')](_0x41d54a)[_0xaf15('0x6d')]()[_0xaf15('0x6e')]();return db[_0xaf15('0x24')][_0xaf15('0x32')]({'where':{'id':_0x327cb2[_0xaf15('0x2a')]['id']}})[_0xaf15('0x16')](function(_0x5f37c){return db['sequelize'][_0xaf15('0x6f')](function(_0x11e759){return _0x5f37c[_0xaf15('0x5e')](_0x327cb2['query']['ids'],{'transaction':_0x11e759})[_0xaf15('0x16')](function(){if(!_[_0xaf15('0x70')](_0xd1e048)){return _0x5f37c[_0xaf15('0x71')](_0xd1e048,{'transaction':_0x11e759});}})[_0xaf15('0x16')](function(){_0xd1e048[_0xaf15('0x5c')](function(_0x5ede18){socket[_0xaf15('0x5d')](_0xaf15('0x72'),{'UserId':_0x5ede18,'ChatQueueId':_0x5f37c['id']});});});});});});})[_0xaf15('0x16')](respondWithStatusCode(_0xdf4281,null))[_0xaf15('0x28')](handleError(_0xdf4281,null));};exports[_0xaf15('0x73')]=function(_0x366da7,_0x28dd32){return db[_0xaf15('0x24')][_0xaf15('0x32')]({'where':{'id':_0x366da7[_0xaf15('0x2a')]['id']}})['then'](handleEntityNotFound(_0x28dd32,null))['then'](function(_0x163685){if(_0x163685){return _0x163685[_0xaf15('0x73')](_0x366da7[_0xaf15('0x34')]['ids'],_[_0xaf15('0x74')](_0x366da7[_0xaf15('0x34')],['ids','id'])||{})[_0xaf15('0x75')](function(_0x406426){for(var _0x5d5cb8=0x0;_0x5d5cb8<_0x366da7['body']['ids'][_0xaf15('0x30')];_0x5d5cb8+=0x1){socket[_0xaf15('0x5d')]('userChatQueue:save',{'UserId':Number(_0x366da7[_0xaf15('0x34')]['ids'][_0x5d5cb8]),'ChatQueueId':Number(_0x366da7[_0xaf15('0x2a')]['id'])});}return _0x406426;});}})[_0xaf15('0x16')](respondWithResult(_0x28dd32,null))['catch'](handleError(_0x28dd32,null));};exports[_0xaf15('0x71')]=function(_0x3fa3d1,_0x2f13cf){return db['ChatQueue'][_0xaf15('0x32')]({'where':{'id':_0x3fa3d1[_0xaf15('0x2a')]['id']}})[_0xaf15('0x16')](handleEntityNotFound(_0x2f13cf,null))[_0xaf15('0x16')](function(_0x342ced){if(_0x342ced){return _0x342ced[_0xaf15('0x71')](_0x3fa3d1['query'][_0xaf15('0x53')])[_0xaf15('0x16')](function(){if(_[_0xaf15('0x76')](_0x3fa3d1[_0xaf15('0x26')]['ids'])){for(var _0x3bb987=0x0;_0x3bb987<_0x3fa3d1['query'][_0xaf15('0x53')]['length'];_0x3bb987+=0x1){socket[_0xaf15('0x5d')](_0xaf15('0x72'),{'UserId':Number(_0x3fa3d1[_0xaf15('0x26')][_0xaf15('0x53')][_0x3bb987]),'ChatQueueId':Number(_0x3fa3d1[_0xaf15('0x2a')]['id'])});}}else{socket['emit'](_0xaf15('0x72'),{'UserId':Number(_0x3fa3d1[_0xaf15('0x26')][_0xaf15('0x53')]),'ChatQueueId':Number(_0x3fa3d1['params']['id'])});}});}})[_0xaf15('0x16')](respondWithStatusCode(_0x2f13cf,null))[_0xaf15('0x28')](handleError(_0x2f13cf,null));};exports['getAgents']=function(_0x43de65,_0x3eeda7){var _0x2e296f={};var _0x4f8125={};var _0x479bbb;var _0x68bc9c;return db[_0xaf15('0x24')][_0xaf15('0x3d')]({'where':{'id':_0x43de65[_0xaf15('0x2a')]['id']}})[_0xaf15('0x16')](handleEntityNotFound(_0x3eeda7,null))[_0xaf15('0x16')](function(_0xfa0c7){if(_0xfa0c7){_0x479bbb=_0xfa0c7;_0x4f8125[_0xaf15('0x2b')]=_[_0xaf15('0x2c')](db[_0xaf15('0x46')][_0xaf15('0x1e')]);_0x4f8125['query']=_['keys'](_0x43de65[_0xaf15('0x26')]);_0x4f8125[_0xaf15('0x3f')]=_[_0xaf15('0x2d')](_0x4f8125[_0xaf15('0x2b')],_0x4f8125[_0xaf15('0x26')]);_0x2e296f[_0xaf15('0x2f')]=_[_0xaf15('0x2d')](_0x4f8125[_0xaf15('0x2b')],qs['fields'](_0x43de65[_0xaf15('0x26')][_0xaf15('0x2e')]));_0x2e296f[_0xaf15('0x2f')]=_0x2e296f['attributes'][_0xaf15('0x30')]?_0x2e296f[_0xaf15('0x2f')]:_0x4f8125[_0xaf15('0x2b')];_0x2e296f[_0xaf15('0x41')]=qs[_0xaf15('0x42')](_0x43de65[_0xaf15('0x26')][_0xaf15('0x42')]);_0x2e296f[_0xaf15('0x23')]=qs[_0xaf15('0x3f')](_[_0xaf15('0x51')](_0x43de65[_0xaf15('0x26')],_0x4f8125[_0xaf15('0x3f')]));if(_0x43de65['query'][_0xaf15('0x44')]){_0x2e296f[_0xaf15('0x23')]=_[_0xaf15('0x31')](_0x2e296f['where'],{'$or':_[_0xaf15('0x1d')](_0x2e296f[_0xaf15('0x2f')],function(_0x1bb497){var _0x3b3250={};_0x3b3250[_0x1bb497]={'$like':'%'+_0x43de65[_0xaf15('0x26')]['filter']+'%'};return _0x3b3250;})});}_0x2e296f=_[_0xaf15('0x31')]({},_0x2e296f,_0x43de65[_0xaf15('0x45')]);return _0x479bbb[_0xaf15('0x77')](_0x2e296f);}})[_0xaf15('0x16')](function(_0x1bcab5){if(_0x1bcab5){_0x68bc9c=_0x1bcab5[_0xaf15('0x30')];if(!_0x43de65[_0xaf15('0x26')][_0xaf15('0x52')](_0xaf15('0x78'))){_0x2e296f[_0xaf15('0x11')]=qs['limit'](_0x43de65['query']['limit']);_0x2e296f[_0xaf15('0x40')]=qs[_0xaf15('0x40')](_0x43de65['query'][_0xaf15('0x40')]);}return _0x479bbb[_0xaf15('0x77')](_0x2e296f);}})[_0xaf15('0x16')](function(_0x5e00d4){if(_0x5e00d4){return _0x5e00d4?{'count':_0x68bc9c,'rows':_0x5e00d4}:null;}})['then'](respondWithResult(_0x3eeda7,null))['catch'](handleError(_0x3eeda7,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 75df772..94fefa0 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 _0x3087=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x55c71b,_0x399f51){var _0x14910c=function(_0x51479b){while(--_0x51479b){_0x55c71b['push'](_0x55c71b['shift']());}};_0x14910c(++_0x399f51);}(_0x3087,0xe5));var _0x7308=function(_0x3d2365,_0x2e0be9){_0x3d2365=_0x3d2365-0x0;var _0x17bef5=_0x3087[_0x3d2365];return _0x17bef5;};'use strict';var EventEmitter=require(_0x7308('0x0'));var ChatQueue=require(_0x7308('0x1'))['db'][_0x7308('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7308('0x3')](0x0);var events={'afterCreate':_0x7308('0x4'),'afterUpdate':_0x7308('0x5'),'afterDestroy':_0x7308('0x6')};function emitEvent(_0x42aaf5){return function(_0x167877,_0xf53f5d,_0x45e8d0){ChatQueueEvents[_0x7308('0x7')](_0x42aaf5+':'+_0x167877['id'],_0x167877);ChatQueueEvents[_0x7308('0x7')](_0x42aaf5,_0x167877);_0x45e8d0(null);};}for(var e in events){if(events[_0x7308('0x8')](e)){var event=events[e];ChatQueue[_0x7308('0x9')](e,emitEvent(event));}}module[_0x7308('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0x57a9=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','hasOwnProperty','hook'];(function(_0x5e68f0,_0x181383){var _0x320008=function(_0x5cf8ac){while(--_0x5cf8ac){_0x5e68f0['push'](_0x5e68f0['shift']());}};_0x320008(++_0x181383);}(_0x57a9,0x1e9));var _0x957a=function(_0x1ac8bd,_0x4acb95){_0x1ac8bd=_0x1ac8bd-0x0;var _0x1b3491=_0x57a9[_0x1ac8bd];return _0x1b3491;};'use strict';var EventEmitter=require(_0x957a('0x0'));var ChatQueue=require(_0x957a('0x1'))['db'][_0x957a('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x957a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x957a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3a1799){return function(_0x4ea3b5,_0x22385d,_0x5cffd1){ChatQueueEvents['emit'](_0x3a1799+':'+_0x4ea3b5['id'],_0x4ea3b5);ChatQueueEvents['emit'](_0x3a1799,_0x4ea3b5);_0x5cffd1(null);};}for(var e in events){if(events[_0x957a('0x5')](e)){var event=events[e];ChatQueue[_0x957a('0x6')](e,emitEvent(event));}}module[_0x957a('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index cb78a15..35f7b34 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 _0xfb03=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','./chatQueue.attributes','exports','define'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xfb03,0x86));var _0x3fb0=function(_0x18208b,_0x980624){_0x18208b=_0x18208b-0x0;var _0x55fc18=_0xfb03[_0x18208b];return _0x55fc18;};'use strict';var _=require(_0x3fb0('0x0'));var util=require(_0x3fb0('0x1'));var logger=require(_0x3fb0('0x2'))(_0x3fb0('0x3'));var moment=require('moment');var BPromise=require(_0x3fb0('0x4'));var rp=require(_0x3fb0('0x5'));var fs=require('fs');var path=require(_0x3fb0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3fb0('0x7'));module[_0x3fb0('0x8')]=function(_0xdc4775,_0x51f972){return _0xdc4775[_0x3fb0('0x9')](_0x3fb0('0xa'),attributes,{'tableName':_0x3fb0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5629=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','util','../../config/logger'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x5629,0x1c4));var _0x9562=function(_0x1a85f5,_0x166cd1){_0x1a85f5=_0x1a85f5-0x0;var _0x1b4845=_0x5629[_0x1a85f5];return _0x1b4845;};'use strict';var _=require(_0x9562('0x0'));var util=require(_0x9562('0x1'));var logger=require(_0x9562('0x2'))(_0x9562('0x3'));var moment=require('moment');var BPromise=require(_0x9562('0x4'));var rp=require(_0x9562('0x5'));var fs=require('fs');var path=require(_0x9562('0x6'));var rimraf=require(_0x9562('0x7'));var config=require(_0x9562('0x8'));var attributes=require(_0x9562('0x9'));module[_0x9562('0xa')]=function(_0x407fe2,_0xfd899e){return _0x407fe2[_0x9562('0xb')]('ChatQueue',attributes,{'tableName':_0x9562('0xc'),'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 9d92e35..69b05c2 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 _0x3495=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','redis','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetChatQueue','options','raw','where','attributes','limit','map','include','model','then','catch','ShowChatQueue','find','lodash','util'];(function(_0x5b2fcd,_0x39d8dc){var _0x2253bb=function(_0x4cf822){while(--_0x4cf822){_0x5b2fcd['push'](_0x5b2fcd['shift']());}};_0x2253bb(++_0x39d8dc);}(_0x3495,0x1de));var _0x5349=function(_0x42e6de,_0x3fb746){_0x42e6de=_0x42e6de-0x0;var _0x3e9354=_0x3495[_0x42e6de];return _0x3e9354;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var moment=require(_0x5349('0x2'));var BPromise=require(_0x5349('0x3'));var rs=require(_0x5349('0x4'));var fs=require('fs');var Redis=require(_0x5349('0x5'));var db=require(_0x5349('0x6'))['db'];var utils=require(_0x5349('0x7'));var logger=require(_0x5349('0x8'))('rpc');var config=require(_0x5349('0x9'));var jayson=require(_0x5349('0xa'));var client=jayson['client'][_0x5349('0xb')]({'port':0x232a});config['redis']=_[_0x5349('0xc')](config['redis'],{'host':_0x5349('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5349('0xe')]));require(_0x5349('0xf'))[_0x5349('0x10')](socket);function respondWithRpcPromise(_0x23a1c7,_0x21bf91,_0x3a416e){return new BPromise(function(_0x35d425,_0x4bf160){return client[_0x5349('0x11')](_0x23a1c7,_0x3a416e)['then'](function(_0x2cbd83){logger[_0x5349('0x12')](_0x5349('0x13'),_0x21bf91,_0x5349('0x14'));logger[_0x5349('0x15')](_0x5349('0x16'),_0x21bf91,_0x5349('0x14'),JSON[_0x5349('0x17')](_0x2cbd83));if(_0x2cbd83[_0x5349('0x18')]){if(_0x2cbd83[_0x5349('0x18')]['code']===0x1f4){logger[_0x5349('0x18')](_0x5349('0x13'),_0x21bf91,_0x2cbd83['error'][_0x5349('0x19')]);return _0x4bf160(_0x2cbd83[_0x5349('0x18')][_0x5349('0x19')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x21bf91,_0x2cbd83['error'][_0x5349('0x19')]);return _0x35d425(_0x2cbd83['error'][_0x5349('0x19')]);}else{logger['info'](_0x5349('0x13'),_0x21bf91,_0x5349('0x14'));_0x35d425(_0x2cbd83[_0x5349('0x1a')][_0x5349('0x19')]);}})['catch'](function(_0x22d1ca){logger[_0x5349('0x18')](_0x5349('0x13'),_0x21bf91,_0x22d1ca);_0x4bf160(_0x22d1ca);});});}exports[_0x5349('0x1b')]=function(_0x4be827){var _0xeaab5a=this;return new Promise(function(_0x3594a4,_0x4f2cb6){return db['ChatQueue']['findAll']({'raw':_0x4be827[_0x5349('0x1c')]?_0x4be827['options'][_0x5349('0x1d')]===undefined?!![]:![]:!![],'where':_0x4be827[_0x5349('0x1c')]?_0x4be827[_0x5349('0x1c')][_0x5349('0x1e')]||null:null,'attributes':_0x4be827[_0x5349('0x1c')]?_0x4be827[_0x5349('0x1c')][_0x5349('0x1f')]||null:null,'limit':_0x4be827[_0x5349('0x1c')]?_0x4be827[_0x5349('0x1c')][_0x5349('0x20')]||null:null,'include':_0x4be827[_0x5349('0x1c')]?_0x4be827[_0x5349('0x1c')]['include']?_[_0x5349('0x21')](_0x4be827[_0x5349('0x1c')][_0x5349('0x22')],function(_0x49435a){return{'model':db[_0x49435a[_0x5349('0x23')]],'as':_0x49435a['as'],'attributes':_0x49435a['attributes'],'include':_0x49435a[_0x5349('0x22')]?_[_0x5349('0x21')](_0x49435a[_0x5349('0x22')],function(_0x49153e){return{'model':db[_0x49153e[_0x5349('0x23')]],'as':_0x49153e['as'],'attributes':_0x49153e[_0x5349('0x1f')],'include':_0x49153e[_0x5349('0x22')]?_[_0x5349('0x21')](_0x49153e[_0x5349('0x22')],function(_0x16edcb){return{'model':db[_0x16edcb[_0x5349('0x23')]],'as':_0x16edcb['as'],'attributes':_0x16edcb[_0x5349('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5349('0x24')](function(_0x5b5d6c){logger[_0x5349('0x12')](_0x5349('0x1b'),_0x4be827);logger['debug'](_0x5349('0x1b'),_0x4be827,JSON['stringify'](_0x5b5d6c));_0x3594a4(_0x5b5d6c);})[_0x5349('0x25')](function(_0x262f62){logger[_0x5349('0x18')](_0x5349('0x1b'),_0x262f62[_0x5349('0x19')],_0x4be827);_0x4f2cb6(_0xeaab5a[_0x5349('0x18')](0x1f4,_0x262f62['message']));});});};exports[_0x5349('0x26')]=function(_0x3162c8){var _0xb0bc68=this;return new Promise(function(_0x2c24f4,_0x538814){return db['ChatQueue'][_0x5349('0x27')]({'raw':_0x3162c8[_0x5349('0x1c')]?_0x3162c8[_0x5349('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3162c8[_0x5349('0x1c')]?_0x3162c8['options'][_0x5349('0x1e')]||null:null,'attributes':_0x3162c8[_0x5349('0x1c')]?_0x3162c8[_0x5349('0x1c')][_0x5349('0x1f')]||null:null,'include':_0x3162c8[_0x5349('0x1c')]?_0x3162c8[_0x5349('0x1c')]['include']?_['map'](_0x3162c8[_0x5349('0x1c')][_0x5349('0x22')],function(_0x1be201){return{'model':db[_0x1be201[_0x5349('0x23')]],'as':_0x1be201['as'],'attributes':_0x1be201[_0x5349('0x1f')],'include':_0x1be201[_0x5349('0x22')]?_[_0x5349('0x21')](_0x1be201['include'],function(_0x544557){return{'model':db[_0x544557[_0x5349('0x23')]],'as':_0x544557['as'],'attributes':_0x544557['attributes'],'include':_0x544557['include']?_[_0x5349('0x21')](_0x544557['include'],function(_0x18f881){return{'model':db[_0x18f881[_0x5349('0x23')]],'as':_0x18f881['as'],'attributes':_0x18f881[_0x5349('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd2376d){logger['info'](_0x5349('0x26'),_0x3162c8);logger[_0x5349('0x15')](_0x5349('0x26'),_0x3162c8,JSON['stringify'](_0xd2376d));_0x2c24f4(_0xd2376d);})['catch'](function(_0x5e5799){logger[_0x5349('0x18')](_0x5349('0x26'),_0x5e5799[_0x5349('0x19')],_0x3162c8);_0x538814(_0xb0bc68[_0x5349('0x18')](0x1f4,_0x5e5799[_0x5349('0x19')]));});});}; \ No newline at end of file +var _0xe75a=['GetChatQueue','catch','find','ShowChatQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ChatQueue','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x25e184,_0x4b4f16){var _0x5b14f6=function(_0x3efa19){while(--_0x3efa19){_0x25e184['push'](_0x25e184['shift']());}};_0x5b14f6(++_0x4b4f16);}(_0xe75a,0x115));var _0xae75=function(_0x32ce61,_0x2ba733){_0x32ce61=_0x32ce61-0x0;var _0x28eded=_0xe75a[_0x32ce61];return _0x28eded;};'use strict';var _=require('lodash');var util=require(_0xae75('0x0'));var moment=require(_0xae75('0x1'));var BPromise=require(_0xae75('0x2'));var rs=require(_0xae75('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae75('0x4'))['db'];var utils=require(_0xae75('0x5'));var logger=require(_0xae75('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae75('0x7')][_0xae75('0x8')]({'port':0x232a});config[_0xae75('0x9')]=_[_0xae75('0xa')](config['redis'],{'host':_0xae75('0xb'),'port':0x18eb});var socket=require(_0xae75('0xc'))(new Redis(config[_0xae75('0x9')]));require(_0xae75('0xd'))['register'](socket);function respondWithRpcPromise(_0x3f3412,_0xfe558e,_0xa5a5ce){return new BPromise(function(_0xf924a6,_0x196972){return client[_0xae75('0xe')](_0x3f3412,_0xa5a5ce)[_0xae75('0xf')](function(_0x5f3c49){logger['info'](_0xae75('0x10'),_0xfe558e,_0xae75('0x11'));logger[_0xae75('0x12')](_0xae75('0x13'),_0xfe558e,'request\x20sent',JSON[_0xae75('0x14')](_0x5f3c49));if(_0x5f3c49['error']){if(_0x5f3c49[_0xae75('0x15')][_0xae75('0x16')]===0x1f4){logger[_0xae75('0x15')](_0xae75('0x10'),_0xfe558e,_0x5f3c49[_0xae75('0x15')]['message']);return _0x196972(_0x5f3c49[_0xae75('0x15')][_0xae75('0x17')]);}logger[_0xae75('0x15')](_0xae75('0x10'),_0xfe558e,_0x5f3c49['error'][_0xae75('0x17')]);return _0xf924a6(_0x5f3c49[_0xae75('0x15')][_0xae75('0x17')]);}else{logger[_0xae75('0x18')]('ChatQueue,\x20%s,\x20%s',_0xfe558e,'request\x20sent');_0xf924a6(_0x5f3c49[_0xae75('0x19')]['message']);}})['catch'](function(_0x5e415d){logger['error'](_0xae75('0x10'),_0xfe558e,_0x5e415d);_0x196972(_0x5e415d);});});}exports['GetChatQueue']=function(_0x155454){var _0x2bdb10=this;return new Promise(function(_0x43c06b,_0x5b8df1){return db[_0xae75('0x1a')][_0xae75('0x1b')]({'raw':_0x155454[_0xae75('0x1c')]?_0x155454['options'][_0xae75('0x1d')]===undefined?!![]:![]:!![],'where':_0x155454[_0xae75('0x1c')]?_0x155454['options']['where']||null:null,'attributes':_0x155454[_0xae75('0x1c')]?_0x155454['options'][_0xae75('0x1e')]||null:null,'limit':_0x155454[_0xae75('0x1c')]?_0x155454[_0xae75('0x1c')][_0xae75('0x1f')]||null:null,'include':_0x155454[_0xae75('0x1c')]?_0x155454[_0xae75('0x1c')][_0xae75('0x20')]?_[_0xae75('0x21')](_0x155454[_0xae75('0x1c')][_0xae75('0x20')],function(_0x2ac86c){return{'model':db[_0x2ac86c[_0xae75('0x22')]],'as':_0x2ac86c['as'],'attributes':_0x2ac86c[_0xae75('0x1e')],'include':_0x2ac86c['include']?_[_0xae75('0x21')](_0x2ac86c[_0xae75('0x20')],function(_0x33eb2a){return{'model':db[_0x33eb2a[_0xae75('0x22')]],'as':_0x33eb2a['as'],'attributes':_0x33eb2a['attributes'],'include':_0x33eb2a['include']?_['map'](_0x33eb2a[_0xae75('0x20')],function(_0x4f5de0){return{'model':db[_0x4f5de0[_0xae75('0x22')]],'as':_0x4f5de0['as'],'attributes':_0x4f5de0[_0xae75('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae75('0xf')](function(_0x256993){logger['info']('GetChatQueue',_0x155454);logger[_0xae75('0x12')](_0xae75('0x23'),_0x155454,JSON[_0xae75('0x14')](_0x256993));_0x43c06b(_0x256993);})[_0xae75('0x24')](function(_0x42f7cb){logger[_0xae75('0x15')]('GetChatQueue',_0x42f7cb[_0xae75('0x17')],_0x155454);_0x5b8df1(_0x2bdb10[_0xae75('0x15')](0x1f4,_0x42f7cb[_0xae75('0x17')]));});});};exports['ShowChatQueue']=function(_0x136014){var _0x23c43e=this;return new Promise(function(_0x238928,_0x2042ae){return db['ChatQueue'][_0xae75('0x25')]({'raw':_0x136014[_0xae75('0x1c')]?_0x136014[_0xae75('0x1c')][_0xae75('0x1d')]===undefined?!![]:![]:!![],'where':_0x136014[_0xae75('0x1c')]?_0x136014[_0xae75('0x1c')]['where']||null:null,'attributes':_0x136014[_0xae75('0x1c')]?_0x136014[_0xae75('0x1c')][_0xae75('0x1e')]||null:null,'include':_0x136014[_0xae75('0x1c')]?_0x136014['options'][_0xae75('0x20')]?_['map'](_0x136014[_0xae75('0x1c')]['include'],function(_0x478525){return{'model':db[_0x478525[_0xae75('0x22')]],'as':_0x478525['as'],'attributes':_0x478525[_0xae75('0x1e')],'include':_0x478525[_0xae75('0x20')]?_[_0xae75('0x21')](_0x478525[_0xae75('0x20')],function(_0x25aa62){return{'model':db[_0x25aa62[_0xae75('0x22')]],'as':_0x25aa62['as'],'attributes':_0x25aa62[_0xae75('0x1e')],'include':_0x25aa62[_0xae75('0x20')]?_[_0xae75('0x21')](_0x25aa62[_0xae75('0x20')],function(_0x4f418f){return{'model':db[_0x4f418f[_0xae75('0x22')]],'as':_0x4f418f['as'],'attributes':_0x4f418f[_0xae75('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae75('0xf')](function(_0x5a0134){logger[_0xae75('0x18')](_0xae75('0x26'),_0x136014);logger[_0xae75('0x12')]('ShowChatQueue',_0x136014,JSON[_0xae75('0x14')](_0x5a0134));_0x238928(_0x5a0134);})[_0xae75('0x24')](function(_0x3463b8){logger[_0xae75('0x15')](_0xae75('0x26'),_0x3463b8['message'],_0x136014);_0x2042ae(_0x23c43e[_0xae75('0x15')](0x1f4,_0x3463b8[_0xae75('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index d508bc5..2c8cf2d 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(_0x2d80fc,_0x3c47fa){var _0x264bd6=function(_0x54b0f1){while(--_0x54b0f1){_0x2d80fc['push'](_0x2d80fc['shift']());}};_0x264bd6(++_0x3c47fa);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x4b75a0,_0x374f34){_0x4b75a0=_0x4b75a0-0x0;var _0x1adc32=_0xc3b5[_0x4b75a0];return _0x1adc32;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x5c3b('0x0'),_0x5c3b('0x1')];function createListener(_0xbe95d4,_0x3acf12){return function(_0x2f9a72){_0x3acf12[_0x5c3b('0x2')](_0xbe95d4,_0x2f9a72);};}function removeListener(_0x237a61,_0x48f8a1){return function(){ChatQueueEvents['removeListener'](_0x237a61,_0x48f8a1);};}exports[_0x5c3b('0x3')]=function(_0x6b8a1e){for(var _0x56345e=0x0,_0x568a28=events[_0x5c3b('0x4')];_0x56345e<_0x568a28;_0x56345e++){var _0x420839=events[_0x56345e];var _0x3892ad=createListener('chatQueue:'+_0x420839,_0x6b8a1e);ChatQueueEvents['on'](_0x420839,_0x3892ad);}}; \ No newline at end of file +var _0xbb53=['length','./chatQueue.events','save','remove','update','emit'];(function(_0x1d8d9d,_0x35c3d6){var _0x77f030=function(_0x5a3369){while(--_0x5a3369){_0x1d8d9d['push'](_0x1d8d9d['shift']());}};_0x77f030(++_0x35c3d6);}(_0xbb53,0x121));var _0x3bb5=function(_0x26a9ea,_0x10ecba){_0x26a9ea=_0x26a9ea-0x0;var _0x3bc99d=_0xbb53[_0x26a9ea];return _0x3bc99d;};'use strict';var ChatQueueEvents=require(_0x3bb5('0x0'));var events=[_0x3bb5('0x1'),_0x3bb5('0x2'),_0x3bb5('0x3')];function createListener(_0x20c8b6,_0x226d39){return function(_0x414da7){_0x226d39[_0x3bb5('0x4')](_0x20c8b6,_0x414da7);};}function removeListener(_0x83e44b,_0x450d9e){return function(){ChatQueueEvents['removeListener'](_0x83e44b,_0x450d9e);};}exports['register']=function(_0x23f11e){for(var _0x2460b0=0x0,_0x28aa7d=events[_0x3bb5('0x5')];_0x2460b0<_0x28aa7d;_0x2460b0++){var _0x22f92f=events[_0x2460b0];var _0x480f9c=createListener('chatQueue:'+_0x22f92f,_0x23f11e);ChatQueueEvents['on'](_0x22f92f,_0x480f9c);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index b504ba5..d884ac3 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x17dd0e,_0x20ebb1){var _0x38c0cf=function(_0x4178ee){while(--_0x4178ee){_0x17dd0e['push'](_0x17dd0e['shift']());}};_0x38c0cf(++_0x20ebb1);}(_0xe14b,0x93));var _0xbe14=function(_0x45ce4e,_0x3a367c){_0x45ce4e=_0x45ce4e-0x0;var _0x4a105a=_0xe14b[_0x45ce4e];return _0x4a105a;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x28fb5a,_0x402d87){var _0x4c471a=function(_0x4e2ff1){while(--_0x4e2ff1){_0x28fb5a['push'](_0x28fb5a['shift']());}};_0x4c471a(++_0x402d87);}(_0xe14b,0x93));var _0xbe14=function(_0x471e3c,_0x5dec0b){_0x471e3c=_0x471e3c-0x0;var _0x47e676=_0xe14b[_0x471e3c];return _0x47e676;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 0199c73..8b9aa5f 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 _0xa6db=['moment','sequelize','exports','STRING','DATE'];(function(_0x4704ac,_0x21aaf8){var _0x2d4361=function(_0x1933f4){while(--_0x1933f4){_0x4704ac['push'](_0x4704ac['shift']());}};_0x2d4361(++_0x21aaf8);}(_0xa6db,0x104));var _0xba6d=function(_0x1cc4e1,_0x1629d4){_0x1cc4e1=_0x1cc4e1-0x0;var _0x192d47=_0xa6db[_0x1cc4e1];return _0x192d47;};'use strict';var moment=require(_0xba6d('0x0'));var Sequelize=require(_0xba6d('0x1'));module[_0xba6d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xba6d('0x3')]},'joinAt':{'type':Sequelize[_0xba6d('0x4')]},'leaveAt':{'type':Sequelize[_0xba6d('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xba6d('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe430=['STRING','DATE'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xe430,0x1da));var _0x0e43=function(_0x1aa72a,_0x1fcb3e){_0x1aa72a=_0x1aa72a-0x0;var _0x13a981=_0xe430[_0x1aa72a];return _0x13a981;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0e43('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x0e43('0x0')]},'joinAt':{'type':Sequelize[_0x0e43('0x1')]},'leaveAt':{'type':Sequelize[_0x0e43('0x1')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0e43('0x1')]},'reason':{'type':Sequelize[_0x0e43('0x0')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 5bbc19f..d4ecc7b 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 _0x014c=['order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','name','send','map','ChatQueueReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit'];(function(_0x1917d2,_0x46da33){var _0x298dfe=function(_0xfa5127){while(--_0xfa5127){_0x1917d2['push'](_0x1917d2['shift']());}};_0x298dfe(++_0x46da33);}(_0x014c,0x17b));var _0xc014=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x014c[_0x1cfa0d];return _0xe33279;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc014('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc014('0x1'));var rp=require(_0xc014('0x2'));var moment=require(_0xc014('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc014('0x4'));var path=require(_0xc014('0x5'));var sox=require(_0xc014('0x6'));var csv=require(_0xc014('0x7'));var ejs=require(_0xc014('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc014('0x9'));var squel=require(_0xc014('0xa'));var crypto=require('crypto');var jsforce=require(_0xc014('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc014('0x7'));var querystring=require(_0xc014('0xc'));var Papa=require(_0xc014('0xd'));var Redis=require('ioredis');var authService=require(_0xc014('0xe'));var qs=require(_0xc014('0xf'));var as=require(_0xc014('0x10'));var hardwareService=require(_0xc014('0x11'));var logger=require('../../config/logger')(_0xc014('0x12'));var utils=require('../../config/utils');var config=require(_0xc014('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc014('0x14'))['db'];function respondWithStatusCode(_0xcde2d3,_0x2f8ac9){_0x2f8ac9=_0x2f8ac9||0xcc;return function(_0x1686f1){if(_0x1686f1){return _0xcde2d3['sendStatus'](_0x2f8ac9);}return _0xcde2d3[_0xc014('0x15')](_0x2f8ac9)[_0xc014('0x16')]();};}function respondWithResult(_0xe86dd,_0x5ced7d){_0x5ced7d=_0x5ced7d||0xc8;return function(_0x36b26e){if(_0x36b26e){return _0xe86dd['status'](_0x5ced7d)[_0xc014('0x17')](_0x36b26e);}};}function respondWithFilteredResult(_0x1c4d3b,_0x25fdf6){return function(_0x26f264){if(_0x26f264){var _0x9f6a26=typeof _0x25fdf6[_0xc014('0x18')]==='undefined'&&typeof _0x25fdf6[_0xc014('0x19')]===_0xc014('0x1a');var _0x263ad0=_0x26f264[_0xc014('0x1b')];var _0x5a2be0=_0x9f6a26?0x0:_0x25fdf6['offset'];var _0x42f93d=_0x9f6a26?_0x26f264['count']:_0x25fdf6['offset']+_0x25fdf6[_0xc014('0x19')];var _0x4287fe;if(_0x42f93d>=_0x263ad0){_0x42f93d=_0x263ad0;_0x4287fe=0xc8;}else{_0x4287fe=0xce;}_0x1c4d3b['status'](_0x4287fe);return _0x1c4d3b[_0xc014('0x1c')](_0xc014('0x1d'),_0x5a2be0+'-'+_0x42f93d+'/'+_0x263ad0)[_0xc014('0x17')](_0x26f264);}return null;};}function patchUpdates(_0x2dac66){return function(_0x1078c4){try{jsonpatch['apply'](_0x1078c4,_0x2dac66,!![]);}catch(_0xc8b0fb){return BPromise[_0xc014('0x1e')](_0xc8b0fb);}return _0x1078c4[_0xc014('0x1f')]();};}function saveUpdates(_0x3c58cc,_0x450b22){return function(_0x3f28b6){if(_0x3f28b6){return _0x3f28b6[_0xc014('0x20')](_0x3c58cc)['then'](function(_0x1089c6){return _0x1089c6;});}return null;};}function removeEntity(_0x1b905d,_0x16d8f9){return function(_0x174b46){if(_0x174b46){return _0x174b46[_0xc014('0x21')]()[_0xc014('0x22')](function(){_0x1b905d[_0xc014('0x15')](0xcc)[_0xc014('0x16')]();});}};}function handleEntityNotFound(_0xe4c68,_0x2e5c30){return function(_0x4850bb){if(!_0x4850bb){_0xe4c68[_0xc014('0x23')](0x194);}return _0x4850bb;};}function handleError(_0x17b6b4,_0x36b663){_0x36b663=_0x36b663||0x1f4;return function(_0x7f47ef){logger[_0xc014('0x24')](_0x7f47ef['stack']);if(_0x7f47ef[_0xc014('0x25')]){delete _0x7f47ef[_0xc014('0x25')];}_0x17b6b4[_0xc014('0x15')](_0x36b663)[_0xc014('0x26')](_0x7f47ef);};}exports['index']=function(_0x43af57,_0x40cf7c){var _0x151705={},_0x30e97a={},_0x21cd81={'count':0x0,'rows':[]};var _0x289f92=_[_0xc014('0x27')](db[_0xc014('0x28')][_0xc014('0x29')],function(_0x330869){return{'name':_0x330869[_0xc014('0x2a')],'type':_0x330869['type'][_0xc014('0x2b')]};});_0x30e97a['model']=_['map'](_0x289f92,'name');_0x30e97a[_0xc014('0x2c')]=_[_0xc014('0x2d')](_0x43af57['query']);_0x30e97a[_0xc014('0x2e')]=_[_0xc014('0x2f')](_0x30e97a[_0xc014('0x30')],_0x30e97a[_0xc014('0x2c')]);_0x151705[_0xc014('0x31')]=_[_0xc014('0x2f')](_0x30e97a[_0xc014('0x30')],qs[_0xc014('0x32')](_0x43af57[_0xc014('0x2c')][_0xc014('0x32')]));_0x151705[_0xc014('0x31')]=_0x151705[_0xc014('0x31')]['length']?_0x151705[_0xc014('0x31')]:_0x30e97a['model'];if(!_0x43af57[_0xc014('0x2c')][_0xc014('0x33')](_0xc014('0x34'))){_0x151705[_0xc014('0x19')]=qs[_0xc014('0x19')](_0x43af57[_0xc014('0x2c')][_0xc014('0x19')]);_0x151705['offset']=qs[_0xc014('0x18')](_0x43af57['query'][_0xc014('0x18')]);}_0x151705[_0xc014('0x35')]=qs[_0xc014('0x36')](_0x43af57[_0xc014('0x2c')][_0xc014('0x36')]);_0x151705[_0xc014('0x37')]=qs[_0xc014('0x2e')](_['pick'](_0x43af57[_0xc014('0x2c')],_0x30e97a[_0xc014('0x2e')]),_0x289f92);if(_0x43af57[_0xc014('0x2c')]['filter']){_0x151705[_0xc014('0x37')]=_[_0xc014('0x38')](_0x151705[_0xc014('0x37')],{'$or':_['map'](_0x289f92,function(_0x473754){if(_0x473754['type']!==_0xc014('0x39')){var _0x19d374={};_0x19d374[_0x473754[_0xc014('0x25')]]={'$like':'%'+_0x43af57[_0xc014('0x2c')][_0xc014('0x3a')]+'%'};return _0x19d374;}})});}_0x151705=_[_0xc014('0x38')]({},_0x151705,_0x43af57[_0xc014('0x3b')]);var _0xb0149e={'where':_0x151705[_0xc014('0x37')]};return db[_0xc014('0x28')][_0xc014('0x1b')](_0xb0149e)[_0xc014('0x22')](function(_0x565433){_0x21cd81[_0xc014('0x1b')]=_0x565433;if(_0x43af57[_0xc014('0x2c')][_0xc014('0x3c')]){_0x151705[_0xc014('0x3d')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xc014('0x3e')](_0x151705);})['then'](function(_0x3a7f90){_0x21cd81[_0xc014('0x3f')]=_0x3a7f90;return _0x21cd81;})[_0xc014('0x22')](respondWithFilteredResult(_0x40cf7c,_0x151705))[_0xc014('0x40')](handleError(_0x40cf7c,null));};exports[_0xc014('0x41')]=function(_0x46ea1c,_0x1f7dfb){var _0x2a0265={'raw':!![],'where':{'id':_0x46ea1c[_0xc014('0x42')]['id']}},_0x84720d={};_0x84720d[_0xc014('0x30')]=_['keys'](db[_0xc014('0x28')]['rawAttributes']);_0x84720d['query']=_[_0xc014('0x2d')](_0x46ea1c[_0xc014('0x2c')]);_0x84720d[_0xc014('0x2e')]=_[_0xc014('0x2f')](_0x84720d[_0xc014('0x30')],_0x84720d['query']);_0x2a0265[_0xc014('0x31')]=_[_0xc014('0x2f')](_0x84720d['model'],qs[_0xc014('0x32')](_0x46ea1c[_0xc014('0x2c')][_0xc014('0x32')]));_0x2a0265[_0xc014('0x31')]=_0x2a0265[_0xc014('0x31')][_0xc014('0x43')]?_0x2a0265[_0xc014('0x31')]:_0x84720d[_0xc014('0x30')];if(_0x46ea1c[_0xc014('0x2c')]['includeAll']){_0x2a0265[_0xc014('0x3d')]=[{'all':!![]}];}_0x2a0265=_[_0xc014('0x38')]({},_0x2a0265,_0x46ea1c[_0xc014('0x3b')]);return db[_0xc014('0x28')][_0xc014('0x44')](_0x2a0265)[_0xc014('0x22')](handleEntityNotFound(_0x1f7dfb,null))[_0xc014('0x22')](respondWithResult(_0x1f7dfb,null))[_0xc014('0x40')](handleError(_0x1f7dfb,null));};exports[_0xc014('0x45')]=function(_0x541ad6,_0x2ce299){return db['ChatQueueReport']['create'](_0x541ad6[_0xc014('0x46')],{})['then'](respondWithResult(_0x2ce299,0xc9))[_0xc014('0x40')](handleError(_0x2ce299,null));};exports[_0xc014('0x20')]=function(_0x56595e,_0x359c24){if(_0x56595e[_0xc014('0x46')]['id']){delete _0x56595e[_0xc014('0x46')]['id'];}return db[_0xc014('0x28')][_0xc014('0x44')]({'where':{'id':_0x56595e[_0xc014('0x42')]['id']}})['then'](handleEntityNotFound(_0x359c24,null))[_0xc014('0x22')](saveUpdates(_0x56595e[_0xc014('0x46')],null))[_0xc014('0x22')](respondWithResult(_0x359c24,null))[_0xc014('0x40')](handleError(_0x359c24,null));};exports[_0xc014('0x21')]=function(_0x464d3e,_0x255a3b){return db[_0xc014('0x28')][_0xc014('0x44')]({'where':{'id':_0x464d3e[_0xc014('0x42')]['id']}})['then'](handleEntityNotFound(_0x255a3b,null))[_0xc014('0x22')](removeEntity(_0x255a3b,null))[_0xc014('0x40')](handleError(_0x255a3b,null));};exports[_0xc014('0x47')]=function(_0x1d37be,_0x53676a){return db[_0xc014('0x28')][_0xc014('0x47')]()[_0xc014('0x22')](respondWithResult(_0x53676a,null))[_0xc014('0x40')](handleError(_0x53676a,null));}; \ No newline at end of file +var _0xba34=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x4f6d08,_0x1b3dd0){var _0x53a9c6=function(_0x2e0e0f){while(--_0x2e0e0f){_0x4f6d08['push'](_0x4f6d08['shift']());}};_0x53a9c6(++_0x1b3dd0);}(_0xba34,0x119));var _0x4ba3=function(_0x2871d0,_0x2efbcb){_0x2871d0=_0x2871d0-0x0;var _0x509de0=_0xba34[_0x2871d0];return _0x509de0;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':!![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['ChatQueueReport']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));};exports['describe']=function(_0x43f820,_0x19d70f){return db[_0x4ba3('0x2d')][_0x4ba3('0x4b')]()[_0x4ba3('0x26')](respondWithResult(_0x19d70f,null))[_0x4ba3('0x46')](handleError(_0x19d70f,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 159f3d0..69a4560 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(_0x5cd13a,_0x3bec2e){var _0x369346=function(_0x28ff74){while(--_0x28ff74){_0x5cd13a['push'](_0x5cd13a['shift']());}};_0x369346(++_0x3bec2e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4cdbdf,_0x5d44a7){var _0x51a90d=function(_0x1e0322){while(--_0x1e0322){_0x4cdbdf['push'](_0x4cdbdf['shift']());}};_0x51a90d(++_0x5d44a7);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 5f9a18c..b319ebb 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 _0x6625=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','update','raw','where','limit','lodash','util','moment','randomstring','ioredis'];(function(_0x19a7cb,_0x1384f7){var _0x455ed2=function(_0x4b6306){while(--_0x4b6306){_0x19a7cb['push'](_0x19a7cb['shift']());}};_0x455ed2(++_0x1384f7);}(_0x6625,0x11b));var _0x5662=function(_0x1f048d,_0x446939){_0x1f048d=_0x1f048d-0x0;var _0x98fcaf=_0x6625[_0x1f048d];return _0x98fcaf;};'use strict';var _=require(_0x5662('0x0'));var util=require(_0x5662('0x1'));var moment=require(_0x5662('0x2'));var BPromise=require('bluebird');var rs=require(_0x5662('0x3'));var fs=require('fs');var Redis=require(_0x5662('0x4'));var db=require(_0x5662('0x5'))['db'];var utils=require(_0x5662('0x6'));var logger=require(_0x5662('0x7'))(_0x5662('0x8'));var config=require(_0x5662('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5662('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f72a6,_0x1e517e,_0x5f2de2){return new BPromise(function(_0x1272bc,_0x576290){return client['request'](_0x4f72a6,_0x5f2de2)[_0x5662('0xb')](function(_0x4a3ece){logger[_0x5662('0xc')](_0x5662('0xd'),_0x1e517e,'request\x20sent');logger[_0x5662('0xe')](_0x5662('0xf'),_0x1e517e,_0x5662('0x10'),JSON[_0x5662('0x11')](_0x4a3ece));if(_0x4a3ece[_0x5662('0x12')]){if(_0x4a3ece[_0x5662('0x12')]['code']===0x1f4){logger[_0x5662('0x12')](_0x5662('0xd'),_0x1e517e,_0x4a3ece[_0x5662('0x12')][_0x5662('0x13')]);return _0x576290(_0x4a3ece[_0x5662('0x12')][_0x5662('0x13')]);}logger['error'](_0x5662('0xd'),_0x1e517e,_0x4a3ece[_0x5662('0x12')][_0x5662('0x13')]);return _0x1272bc(_0x4a3ece[_0x5662('0x12')][_0x5662('0x13')]);}else{logger[_0x5662('0xc')](_0x5662('0xd'),_0x1e517e,_0x5662('0x10'));_0x1272bc(_0x4a3ece[_0x5662('0x14')][_0x5662('0x13')]);}})[_0x5662('0x15')](function(_0x4a6ee8){logger['error'](_0x5662('0xd'),_0x1e517e,_0x4a6ee8);_0x576290(_0x4a6ee8);});});}exports[_0x5662('0x16')]=function(_0x47f3cd){var _0x12c746=this;return new Promise(function(_0x22ec14,_0x16a64f){return db[_0x5662('0x17')][_0x5662('0x18')](_0x47f3cd[_0x5662('0x19')],{'raw':_0x47f3cd[_0x5662('0x1a')]?_0x47f3cd[_0x5662('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e56ee){logger[_0x5662('0xc')](_0x5662('0x16'),_0x47f3cd);logger[_0x5662('0xe')](_0x5662('0x16'),_0x47f3cd,JSON[_0x5662('0x11')](_0x1e56ee));_0x22ec14(_0x1e56ee);})['catch'](function(_0x5c5c6c){logger[_0x5662('0x12')](_0x5662('0x16'),_0x5c5c6c[_0x5662('0x13')],_0x47f3cd);_0x16a64f(_0x12c746[_0x5662('0x12')](0x1f4,_0x5c5c6c[_0x5662('0x13')]));});});};exports[_0x5662('0x1b')]=function(_0x37192b){var _0x13f4fc=this;return new Promise(function(_0x2ecb36,_0x400ff8){return db[_0x5662('0x17')][_0x5662('0x1c')](_0x37192b['body'],{'raw':_0x37192b[_0x5662('0x1a')]?_0x37192b[_0x5662('0x1a')][_0x5662('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37192b[_0x5662('0x1a')]?_0x37192b[_0x5662('0x1a')][_0x5662('0x1e')]||null:null,'attributes':_0x37192b[_0x5662('0x1a')]?_0x37192b[_0x5662('0x1a')]['attributes']||null:null,'limit':_0x37192b[_0x5662('0x1a')]?_0x37192b[_0x5662('0x1a')][_0x5662('0x1f')]||null:null})[_0x5662('0xb')](function(_0x4d8d84){logger[_0x5662('0xc')](_0x5662('0x1b'),_0x37192b);logger['debug']('UpdateChatQueueReport',_0x37192b,JSON[_0x5662('0x11')](_0x4d8d84));_0x2ecb36(_0x4d8d84);})[_0x5662('0x15')](function(_0x4f3cfd){logger[_0x5662('0x12')](_0x5662('0x1b'),_0x4f3cfd[_0x5662('0x13')],_0x37192b);_0x400ff8(_0x13f4fc[_0x5662('0x12')](0x1f4,_0x4f3cfd[_0x5662('0x13')]));});});}; \ No newline at end of file +var _0xa38f=['info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','where','limit','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x2c32bb,_0x56b676){var _0x1909ab=function(_0xc7fdcc){while(--_0xc7fdcc){_0x2c32bb['push'](_0x2c32bb['shift']());}};_0x1909ab(++_0x56b676);}(_0xa38f,0x8b));var _0xfa38=function(_0x1101fa,_0x28691f){_0x1101fa=_0x1101fa-0x0;var _0xb2d91c=_0xa38f[_0x1101fa];return _0xb2d91c;};'use strict';var _=require(_0xfa38('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfa38('0x1'));var fs=require('fs');var Redis=require(_0xfa38('0x2'));var db=require(_0xfa38('0x3'))['db'];var utils=require(_0xfa38('0x4'));var logger=require(_0xfa38('0x5'))('rpc');var config=require(_0xfa38('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfa38('0x7')][_0xfa38('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a36de,_0x12b0f0,_0x4cdb63){return new BPromise(function(_0x26f14f,_0x12ac98){return client[_0xfa38('0x9')](_0x2a36de,_0x4cdb63)[_0xfa38('0xa')](function(_0xf1a308){logger[_0xfa38('0xb')](_0xfa38('0xc'),_0x12b0f0,'request\x20sent');logger[_0xfa38('0xd')](_0xfa38('0xe'),_0x12b0f0,_0xfa38('0xf'),JSON[_0xfa38('0x10')](_0xf1a308));if(_0xf1a308['error']){if(_0xf1a308[_0xfa38('0x11')][_0xfa38('0x12')]===0x1f4){logger['error'](_0xfa38('0xc'),_0x12b0f0,_0xf1a308[_0xfa38('0x11')][_0xfa38('0x13')]);return _0x12ac98(_0xf1a308[_0xfa38('0x11')][_0xfa38('0x13')]);}logger[_0xfa38('0x11')](_0xfa38('0xc'),_0x12b0f0,_0xf1a308['error'][_0xfa38('0x13')]);return _0x26f14f(_0xf1a308[_0xfa38('0x11')][_0xfa38('0x13')]);}else{logger[_0xfa38('0xb')](_0xfa38('0xc'),_0x12b0f0,_0xfa38('0xf'));_0x26f14f(_0xf1a308[_0xfa38('0x14')][_0xfa38('0x13')]);}})[_0xfa38('0x15')](function(_0x1acb79){logger['error'](_0xfa38('0xc'),_0x12b0f0,_0x1acb79);_0x12ac98(_0x1acb79);});});}exports[_0xfa38('0x16')]=function(_0x23278e){var _0x5c6e3f=this;return new Promise(function(_0x3d8ff2,_0x3ee899){return db[_0xfa38('0x17')][_0xfa38('0x18')](_0x23278e[_0xfa38('0x19')],{'raw':_0x23278e[_0xfa38('0x1a')]?_0x23278e[_0xfa38('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xfa38('0xa')](function(_0x3126c3){logger[_0xfa38('0xb')](_0xfa38('0x16'),_0x23278e);logger['debug'](_0xfa38('0x16'),_0x23278e,JSON[_0xfa38('0x10')](_0x3126c3));_0x3d8ff2(_0x3126c3);})['catch'](function(_0x3a5acc){logger['error']('CreateChatQueueReport',_0x3a5acc[_0xfa38('0x13')],_0x23278e);_0x3ee899(_0x5c6e3f[_0xfa38('0x11')](0x1f4,_0x3a5acc[_0xfa38('0x13')]));});});};exports[_0xfa38('0x1b')]=function(_0x308c6e){var _0x38ee9d=this;return new Promise(function(_0x137931,_0x82e476){return db[_0xfa38('0x17')]['update'](_0x308c6e['body'],{'raw':_0x308c6e['options']?_0x308c6e[_0xfa38('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x308c6e[_0xfa38('0x1a')]?_0x308c6e['options'][_0xfa38('0x1c')]||null:null,'attributes':_0x308c6e[_0xfa38('0x1a')]?_0x308c6e[_0xfa38('0x1a')]['attributes']||null:null,'limit':_0x308c6e[_0xfa38('0x1a')]?_0x308c6e[_0xfa38('0x1a')][_0xfa38('0x1d')]||null:null})[_0xfa38('0xa')](function(_0x5dde10){logger['info'](_0xfa38('0x1b'),_0x308c6e);logger[_0xfa38('0xd')](_0xfa38('0x1b'),_0x308c6e,JSON[_0xfa38('0x10')](_0x5dde10));_0x137931(_0x5dde10);})['catch'](function(_0x351df8){logger[_0xfa38('0x11')](_0xfa38('0x1b'),_0x351df8['message'],_0x308c6e);_0x82e476(_0x38ee9d[_0xfa38('0x11')](0x1f4,_0x351df8[_0xfa38('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 523f662..4cbf897 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 _0x330c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x1d0057,_0x46e513){var _0x149fca=function(_0x4188e2){while(--_0x4188e2){_0x1d0057['push'](_0x1d0057['shift']());}};_0x149fca(++_0x46e513);}(_0x330c,0x1df));var _0xc330=function(_0x3b4ab7,_0x1571e9){_0x3b4ab7=_0x3b4ab7-0x0;var _0x38f87c=_0x330c[_0x3b4ab7];return _0x38f87c;};'use strict';var multer=require('multer');var util=require(_0xc330('0x0'));var path=require(_0xc330('0x1'));var timeout=require(_0xc330('0x2'));var express=require(_0xc330('0x3'));var router=express[_0xc330('0x4')]();var fs_extra=require(_0xc330('0x5'));var auth=require(_0xc330('0x6'));var interaction=require(_0xc330('0x7'));var config=require(_0xc330('0x8'));var controller=require(_0xc330('0x9'));router[_0xc330('0xa')]('/',auth[_0xc330('0xb')](),controller[_0xc330('0xc')]);router[_0xc330('0xa')](_0xc330('0xd'),auth[_0xc330('0xb')](),controller[_0xc330('0xe')]);router[_0xc330('0xa')](_0xc330('0xf'),auth[_0xc330('0xb')](),controller[_0xc330('0x10')]);router['post']('/',auth[_0xc330('0xb')](),controller[_0xc330('0x11')]);router[_0xc330('0x12')](_0xc330('0xf'),auth['isAuthenticated'](),controller[_0xc330('0x13')]);router[_0xc330('0x14')](_0xc330('0xf'),auth[_0xc330('0xb')](),controller[_0xc330('0x15')]);module['exports']=router; \ No newline at end of file +var _0xff38=['post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x494ff2,_0x39163c){var _0x433b29=function(_0x400383){while(--_0x400383){_0x494ff2['push'](_0x494ff2['shift']());}};_0x433b29(++_0x39163c);}(_0xff38,0x1ab));var _0x8ff3=function(_0x42993c,_0x32a5be){_0x42993c=_0x42993c-0x0;var _0x204e4a=_0xff38[_0x42993c];return _0x204e4a;};'use strict';var multer=require(_0x8ff3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8ff3('0x1'));var express=require(_0x8ff3('0x2'));var router=express[_0x8ff3('0x3')]();var fs_extra=require(_0x8ff3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8ff3('0x5'));var config=require(_0x8ff3('0x6'));var controller=require(_0x8ff3('0x7'));router[_0x8ff3('0x8')]('/',auth[_0x8ff3('0x9')](),controller[_0x8ff3('0xa')]);router[_0x8ff3('0x8')](_0x8ff3('0xb'),auth[_0x8ff3('0x9')](),controller[_0x8ff3('0xc')]);router[_0x8ff3('0x8')]('/:id',auth[_0x8ff3('0x9')](),controller['show']);router[_0x8ff3('0xd')]('/',auth['isAuthenticated'](),controller[_0x8ff3('0xe')]);router[_0x8ff3('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x8ff3('0x10')]);router[_0x8ff3('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8ff3('0x12')]);module[_0x8ff3('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 02a0bf4..5f0962b 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x47ad6a,_0x243e39){var _0x3ec19c=function(_0x1562c3){while(--_0x1562c3){_0x47ad6a['push'](_0x47ad6a['shift']());}};_0x3ec19c(++_0x243e39);}(_0x70e0,0x17b));var _0x070e=function(_0x3a2774,_0x284041){_0x3a2774=_0x3a2774-0x0;var _0xd0dd59=_0x70e0[_0x3a2774];return _0xd0dd59;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3b2421,_0xf30f91){var _0x288bde=function(_0x1d1db6){while(--_0x1d1db6){_0x3b2421['push'](_0x3b2421['shift']());}};_0x288bde(++_0xf30f91);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index a1f918f..ba29c5b 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 _0xe908=['type','key','model','name','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','map','ChatTransferReport','rawAttributes'];(function(_0x2605d5,_0x300b07){var _0x1e545f=function(_0x287544){while(--_0x287544){_0x2605d5['push'](_0x2605d5['shift']());}};_0x1e545f(++_0x300b07);}(_0xe908,0xb1));var _0x8e90=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xe908[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8e90('0x0'));var jsonpatch=require(_0x8e90('0x1'));var rp=require(_0x8e90('0x2'));var moment=require('moment');var BPromise=require(_0x8e90('0x3'));var Mustache=require(_0x8e90('0x4'));var util=require(_0x8e90('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8e90('0x6'));var ejs=require(_0x8e90('0x7'));var fs=require('fs');var fs_extra=require(_0x8e90('0x8'));var _=require('lodash');var squel=require(_0x8e90('0x9'));var crypto=require('crypto');var jsforce=require(_0x8e90('0xa'));var deskjs=require(_0x8e90('0xb'));var toCsv=require(_0x8e90('0x6'));var querystring=require(_0x8e90('0xc'));var Papa=require(_0x8e90('0xd'));var Redis=require(_0x8e90('0xe'));var authService=require(_0x8e90('0xf'));var qs=require(_0x8e90('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e90('0x11'));var logger=require(_0x8e90('0x12'))(_0x8e90('0x13'));var utils=require(_0x8e90('0x14'));var config=require(_0x8e90('0x15'));var licenseUtil=require(_0x8e90('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dfffe,_0x42bf32){_0x42bf32=_0x42bf32||0xcc;return function(_0x2ea6c8){if(_0x2ea6c8){return _0x4dfffe[_0x8e90('0x17')](_0x42bf32);}return _0x4dfffe[_0x8e90('0x18')](_0x42bf32)[_0x8e90('0x19')]();};}function respondWithResult(_0x1e093b,_0x1f37d2){_0x1f37d2=_0x1f37d2||0xc8;return function(_0x192cee){if(_0x192cee){return _0x1e093b[_0x8e90('0x18')](_0x1f37d2)[_0x8e90('0x1a')](_0x192cee);}};}function respondWithFilteredResult(_0x2ad02e,_0x51eb17){return function(_0x382f1a){if(_0x382f1a){var _0x3091f5=typeof _0x51eb17[_0x8e90('0x1b')]==='undefined'&&typeof _0x51eb17[_0x8e90('0x1c')]===_0x8e90('0x1d');var _0x3ead51=_0x382f1a['count'];var _0x5cd5db=_0x3091f5?0x0:_0x51eb17[_0x8e90('0x1b')];var _0x394909=_0x3091f5?_0x382f1a[_0x8e90('0x1e')]:_0x51eb17[_0x8e90('0x1b')]+_0x51eb17['limit'];var _0x2fe124;if(_0x394909>=_0x3ead51){_0x394909=_0x3ead51;_0x2fe124=0xc8;}else{_0x2fe124=0xce;}_0x2ad02e['status'](_0x2fe124);return _0x2ad02e['set'](_0x8e90('0x1f'),_0x5cd5db+'-'+_0x394909+'/'+_0x3ead51)[_0x8e90('0x1a')](_0x382f1a);}return null;};}function patchUpdates(_0x75903d){return function(_0x15a643){try{jsonpatch[_0x8e90('0x20')](_0x15a643,_0x75903d,!![]);}catch(_0x5b2949){return BPromise[_0x8e90('0x21')](_0x5b2949);}return _0x15a643['save']();};}function saveUpdates(_0x1feb07,_0x54a754){return function(_0x15efe0){if(_0x15efe0){return _0x15efe0[_0x8e90('0x22')](_0x1feb07)[_0x8e90('0x23')](function(_0xd36b7c){return _0xd36b7c;});}return null;};}function removeEntity(_0x1ae2d9,_0x1d14f){return function(_0x4e4f0c){if(_0x4e4f0c){return _0x4e4f0c[_0x8e90('0x24')]()[_0x8e90('0x23')](function(){_0x1ae2d9[_0x8e90('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x589b38,_0x346bd1){return function(_0x40b316){if(!_0x40b316){_0x589b38['sendStatus'](0x194);}return _0x40b316;};}function handleError(_0x3b7c61,_0x2fd8eb){_0x2fd8eb=_0x2fd8eb||0x1f4;return function(_0x929cc2){logger[_0x8e90('0x25')](_0x929cc2[_0x8e90('0x26')]);if(_0x929cc2['name']){delete _0x929cc2['name'];}_0x3b7c61[_0x8e90('0x18')](_0x2fd8eb)['send'](_0x929cc2);};}exports['index']=function(_0x4cfe04,_0x625c50){var _0xf9cc2f={},_0x2538e8={},_0x1e5484={'count':0x0,'rows':[]};var _0x2604f7=_[_0x8e90('0x27')](db[_0x8e90('0x28')][_0x8e90('0x29')],function(_0x13b292){return{'name':_0x13b292['fieldName'],'type':_0x13b292[_0x8e90('0x2a')][_0x8e90('0x2b')]};});_0x2538e8[_0x8e90('0x2c')]=_[_0x8e90('0x27')](_0x2604f7,_0x8e90('0x2d'));_0x2538e8[_0x8e90('0x2e')]=_['keys'](_0x4cfe04['query']);_0x2538e8['filters']=_[_0x8e90('0x2f')](_0x2538e8['model'],_0x2538e8[_0x8e90('0x2e')]);_0xf9cc2f[_0x8e90('0x30')]=_[_0x8e90('0x2f')](_0x2538e8[_0x8e90('0x2c')],qs[_0x8e90('0x31')](_0x4cfe04[_0x8e90('0x2e')]['fields']));_0xf9cc2f[_0x8e90('0x30')]=_0xf9cc2f[_0x8e90('0x30')][_0x8e90('0x32')]?_0xf9cc2f['attributes']:_0x2538e8[_0x8e90('0x2c')];if(!_0x4cfe04[_0x8e90('0x2e')][_0x8e90('0x33')](_0x8e90('0x34'))){_0xf9cc2f['limit']=qs[_0x8e90('0x1c')](_0x4cfe04[_0x8e90('0x2e')]['limit']);_0xf9cc2f[_0x8e90('0x1b')]=qs['offset'](_0x4cfe04[_0x8e90('0x2e')][_0x8e90('0x1b')]);}_0xf9cc2f['order']=qs[_0x8e90('0x35')](_0x4cfe04[_0x8e90('0x2e')][_0x8e90('0x35')]);_0xf9cc2f[_0x8e90('0x36')]=qs[_0x8e90('0x37')](_[_0x8e90('0x38')](_0x4cfe04[_0x8e90('0x2e')],_0x2538e8[_0x8e90('0x37')]),_0x2604f7);if(_0x4cfe04[_0x8e90('0x2e')]['filter']){_0xf9cc2f[_0x8e90('0x36')]=_[_0x8e90('0x39')](_0xf9cc2f[_0x8e90('0x36')],{'$or':_[_0x8e90('0x27')](_0x2604f7,function(_0x6212ad){if(_0x6212ad[_0x8e90('0x2a')]!==_0x8e90('0x3a')){var _0x180b4d={};_0x180b4d[_0x6212ad[_0x8e90('0x2d')]]={'$like':'%'+_0x4cfe04[_0x8e90('0x2e')][_0x8e90('0x3b')]+'%'};return _0x180b4d;}})});}_0xf9cc2f=_[_0x8e90('0x39')]({},_0xf9cc2f,_0x4cfe04[_0x8e90('0x3c')]);var _0x553a57={'where':_0xf9cc2f[_0x8e90('0x36')]};return db[_0x8e90('0x28')][_0x8e90('0x1e')](_0x553a57)['then'](function(_0x397ded){_0x1e5484[_0x8e90('0x1e')]=_0x397ded;if(_0x4cfe04[_0x8e90('0x2e')][_0x8e90('0x3d')]){_0xf9cc2f[_0x8e90('0x3e')]=[{'all':!![]}];}return db[_0x8e90('0x28')][_0x8e90('0x3f')](_0xf9cc2f);})[_0x8e90('0x23')](function(_0x247a8a){_0x1e5484[_0x8e90('0x40')]=_0x247a8a;return _0x1e5484;})[_0x8e90('0x23')](respondWithFilteredResult(_0x625c50,_0xf9cc2f))[_0x8e90('0x41')](handleError(_0x625c50,null));};exports[_0x8e90('0x42')]=function(_0x309679,_0x514f7e){var _0x242baa={'raw':!![],'where':{'id':_0x309679['params']['id']}},_0x32a179={};_0x32a179[_0x8e90('0x2c')]=_[_0x8e90('0x43')](db['ChatTransferReport'][_0x8e90('0x29')]);_0x32a179[_0x8e90('0x2e')]=_[_0x8e90('0x43')](_0x309679[_0x8e90('0x2e')]);_0x32a179['filters']=_[_0x8e90('0x2f')](_0x32a179['model'],_0x32a179['query']);_0x242baa[_0x8e90('0x30')]=_[_0x8e90('0x2f')](_0x32a179[_0x8e90('0x2c')],qs[_0x8e90('0x31')](_0x309679[_0x8e90('0x2e')][_0x8e90('0x31')]));_0x242baa[_0x8e90('0x30')]=_0x242baa[_0x8e90('0x30')]['length']?_0x242baa[_0x8e90('0x30')]:_0x32a179[_0x8e90('0x2c')];if(_0x309679[_0x8e90('0x2e')][_0x8e90('0x3d')]){_0x242baa[_0x8e90('0x3e')]=[{'all':!![]}];}_0x242baa=_[_0x8e90('0x39')]({},_0x242baa,_0x309679[_0x8e90('0x3c')]);return db['ChatTransferReport'][_0x8e90('0x44')](_0x242baa)[_0x8e90('0x23')](handleEntityNotFound(_0x514f7e,null))[_0x8e90('0x23')](respondWithResult(_0x514f7e,null))['catch'](handleError(_0x514f7e,null));};exports['create']=function(_0x51a1a2,_0x162971){return db['ChatTransferReport'][_0x8e90('0x45')](_0x51a1a2[_0x8e90('0x46')],{})[_0x8e90('0x23')](respondWithResult(_0x162971,0xc9))[_0x8e90('0x41')](handleError(_0x162971,null));};exports[_0x8e90('0x22')]=function(_0x452fe9,_0x3ba086){if(_0x452fe9[_0x8e90('0x46')]['id']){delete _0x452fe9[_0x8e90('0x46')]['id'];}return db['ChatTransferReport'][_0x8e90('0x44')]({'where':{'id':_0x452fe9['params']['id']}})[_0x8e90('0x23')](handleEntityNotFound(_0x3ba086,null))['then'](saveUpdates(_0x452fe9[_0x8e90('0x46')],null))[_0x8e90('0x23')](respondWithResult(_0x3ba086,null))[_0x8e90('0x41')](handleError(_0x3ba086,null));};exports[_0x8e90('0x24')]=function(_0x139424,_0x20dd30){return db[_0x8e90('0x28')][_0x8e90('0x44')]({'where':{'id':_0x139424[_0x8e90('0x47')]['id']}})[_0x8e90('0x23')](handleEntityNotFound(_0x20dd30,null))[_0x8e90('0x23')](removeEntity(_0x20dd30,null))[_0x8e90('0x41')](handleError(_0x20dd30,null));};exports[_0x8e90('0x48')]=function(_0x24b8cc,_0x4d5018){return db[_0x8e90('0x28')][_0x8e90('0x48')]()[_0x8e90('0x23')](respondWithResult(_0x4d5018,null))[_0x8e90('0x41')](handleError(_0x4d5018,null));}; \ No newline at end of file +var _0x3703=['then','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','show','params','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update'];(function(_0x406633,_0x190f5d){var _0x318f51=function(_0x305e03){while(--_0x305e03){_0x406633['push'](_0x406633['shift']());}};_0x318f51(++_0x190f5d);}(_0x3703,0x15f));var _0x3370=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x3703[_0x2064e5];return _0x21a233;};'use strict';var emlformat=require(_0x3370('0x0'));var rimraf=require(_0x3370('0x1'));var zipdir=require(_0x3370('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3370('0x3'));var moment=require(_0x3370('0x4'));var BPromise=require(_0x3370('0x5'));var Mustache=require(_0x3370('0x6'));var util=require(_0x3370('0x7'));var path=require(_0x3370('0x8'));var sox=require(_0x3370('0x9'));var csv=require(_0x3370('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3370('0xb'));var _=require(_0x3370('0xc'));var squel=require(_0x3370('0xd'));var crypto=require(_0x3370('0xe'));var jsforce=require(_0x3370('0xf'));var deskjs=require(_0x3370('0x10'));var toCsv=require(_0x3370('0xa'));var querystring=require(_0x3370('0x11'));var Papa=require(_0x3370('0x12'));var Redis=require(_0x3370('0x13'));var authService=require(_0x3370('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3370('0x15'));var hardwareService=require(_0x3370('0x16'));var logger=require(_0x3370('0x17'))(_0x3370('0x18'));var utils=require('../../config/utils');var config=require(_0x3370('0x19'));var licenseUtil=require(_0x3370('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdc1988,_0x1fa0c0){_0x1fa0c0=_0x1fa0c0||0xcc;return function(_0x225a66){if(_0x225a66){return _0xdc1988[_0x3370('0x1b')](_0x1fa0c0);}return _0xdc1988['status'](_0x1fa0c0)[_0x3370('0x1c')]();};}function respondWithResult(_0x492bad,_0x3c5cd9){_0x3c5cd9=_0x3c5cd9||0xc8;return function(_0x1be4ca){if(_0x1be4ca){return _0x492bad[_0x3370('0x1d')](_0x3c5cd9)[_0x3370('0x1e')](_0x1be4ca);}};}function respondWithFilteredResult(_0xe51c73,_0x17230d){return function(_0x416852){if(_0x416852){var _0x35a3b7=typeof _0x17230d[_0x3370('0x1f')]===_0x3370('0x20')&&typeof _0x17230d[_0x3370('0x21')]==='undefined';var _0x51926a=_0x416852[_0x3370('0x22')];var _0x50410d=_0x35a3b7?0x0:_0x17230d[_0x3370('0x1f')];var _0x154c37=_0x35a3b7?_0x416852['count']:_0x17230d[_0x3370('0x1f')]+_0x17230d[_0x3370('0x21')];var _0x480944;if(_0x154c37>=_0x51926a){_0x154c37=_0x51926a;_0x480944=0xc8;}else{_0x480944=0xce;}_0xe51c73['status'](_0x480944);return _0xe51c73[_0x3370('0x23')]('Content-Range',_0x50410d+'-'+_0x154c37+'/'+_0x51926a)[_0x3370('0x1e')](_0x416852);}return null;};}function patchUpdates(_0x1c905d){return function(_0x2a878f){try{jsonpatch['apply'](_0x2a878f,_0x1c905d,!![]);}catch(_0x20a55e){return BPromise[_0x3370('0x24')](_0x20a55e);}return _0x2a878f[_0x3370('0x25')]();};}function saveUpdates(_0x21da24,_0x44eac3){return function(_0x211a94){if(_0x211a94){return _0x211a94[_0x3370('0x26')](_0x21da24)['then'](function(_0x14f8d5){return _0x14f8d5;});}return null;};}function removeEntity(_0x1a1a38,_0x246431){return function(_0x2287cb){if(_0x2287cb){return _0x2287cb['destroy']()[_0x3370('0x27')](function(){_0x1a1a38[_0x3370('0x1d')](0xcc)[_0x3370('0x1c')]();});}};}function handleEntityNotFound(_0x598596,_0x4ce27e){return function(_0x36b977){if(!_0x36b977){_0x598596[_0x3370('0x1b')](0x194);}return _0x36b977;};}function handleError(_0x18d389,_0x4a1ff4){_0x4a1ff4=_0x4a1ff4||0x1f4;return function(_0x1f408a){logger[_0x3370('0x28')](_0x1f408a['stack']);if(_0x1f408a[_0x3370('0x29')]){delete _0x1f408a[_0x3370('0x29')];}_0x18d389[_0x3370('0x1d')](_0x4a1ff4)[_0x3370('0x2a')](_0x1f408a);};}exports[_0x3370('0x2b')]=function(_0x562ab7,_0x579ccd){var _0x54d7a1={},_0x131512={},_0x476e67={'count':0x0,'rows':[]};var _0xc98a60=_[_0x3370('0x2c')](db['ChatTransferReport'][_0x3370('0x2d')],function(_0x4f57ae){return{'name':_0x4f57ae[_0x3370('0x2e')],'type':_0x4f57ae['type'][_0x3370('0x2f')]};});_0x131512[_0x3370('0x30')]=_[_0x3370('0x2c')](_0xc98a60,_0x3370('0x29'));_0x131512[_0x3370('0x31')]=_[_0x3370('0x32')](_0x562ab7['query']);_0x131512[_0x3370('0x33')]=_[_0x3370('0x34')](_0x131512[_0x3370('0x30')],_0x131512[_0x3370('0x31')]);_0x54d7a1[_0x3370('0x35')]=_[_0x3370('0x34')](_0x131512['model'],qs[_0x3370('0x36')](_0x562ab7[_0x3370('0x31')][_0x3370('0x36')]));_0x54d7a1[_0x3370('0x35')]=_0x54d7a1[_0x3370('0x35')][_0x3370('0x37')]?_0x54d7a1['attributes']:_0x131512[_0x3370('0x30')];if(!_0x562ab7[_0x3370('0x31')][_0x3370('0x38')](_0x3370('0x39'))){_0x54d7a1[_0x3370('0x21')]=qs[_0x3370('0x21')](_0x562ab7[_0x3370('0x31')][_0x3370('0x21')]);_0x54d7a1[_0x3370('0x1f')]=qs[_0x3370('0x1f')](_0x562ab7['query'][_0x3370('0x1f')]);}_0x54d7a1['order']=qs[_0x3370('0x3a')](_0x562ab7[_0x3370('0x31')][_0x3370('0x3a')]);_0x54d7a1[_0x3370('0x3b')]=qs[_0x3370('0x33')](_[_0x3370('0x3c')](_0x562ab7[_0x3370('0x31')],_0x131512[_0x3370('0x33')]),_0xc98a60);if(_0x562ab7[_0x3370('0x31')][_0x3370('0x3d')]){_0x54d7a1['where']=_[_0x3370('0x3e')](_0x54d7a1[_0x3370('0x3b')],{'$or':_['map'](_0xc98a60,function(_0x24c07b){if(_0x24c07b['type']!==_0x3370('0x3f')){var _0x4cb794={};_0x4cb794[_0x24c07b[_0x3370('0x29')]]={'$like':'%'+_0x562ab7['query']['filter']+'%'};return _0x4cb794;}})});}_0x54d7a1=_['merge']({},_0x54d7a1,_0x562ab7[_0x3370('0x40')]);var _0x2d8c5d={'where':_0x54d7a1[_0x3370('0x3b')]};return db[_0x3370('0x41')][_0x3370('0x22')](_0x2d8c5d)[_0x3370('0x27')](function(_0xcfb964){_0x476e67[_0x3370('0x22')]=_0xcfb964;if(_0x562ab7[_0x3370('0x31')][_0x3370('0x42')]){_0x54d7a1[_0x3370('0x43')]=[{'all':!![]}];}return db[_0x3370('0x41')][_0x3370('0x44')](_0x54d7a1);})[_0x3370('0x27')](function(_0x12adbe){_0x476e67[_0x3370('0x45')]=_0x12adbe;return _0x476e67;})[_0x3370('0x27')](respondWithFilteredResult(_0x579ccd,_0x54d7a1))['catch'](handleError(_0x579ccd,null));};exports[_0x3370('0x46')]=function(_0x1edbd1,_0x222020){var _0x275bb5={'raw':!![],'where':{'id':_0x1edbd1[_0x3370('0x47')]['id']}},_0x5884ab={};_0x5884ab[_0x3370('0x30')]=_[_0x3370('0x32')](db[_0x3370('0x41')][_0x3370('0x2d')]);_0x5884ab['query']=_[_0x3370('0x32')](_0x1edbd1[_0x3370('0x31')]);_0x5884ab[_0x3370('0x33')]=_[_0x3370('0x34')](_0x5884ab[_0x3370('0x30')],_0x5884ab[_0x3370('0x31')]);_0x275bb5[_0x3370('0x35')]=_[_0x3370('0x34')](_0x5884ab[_0x3370('0x30')],qs['fields'](_0x1edbd1['query']['fields']));_0x275bb5[_0x3370('0x35')]=_0x275bb5[_0x3370('0x35')][_0x3370('0x37')]?_0x275bb5[_0x3370('0x35')]:_0x5884ab['model'];if(_0x1edbd1[_0x3370('0x31')]['includeAll']){_0x275bb5[_0x3370('0x43')]=[{'all':!![]}];}_0x275bb5=_[_0x3370('0x3e')]({},_0x275bb5,_0x1edbd1['options']);return db[_0x3370('0x41')][_0x3370('0x48')](_0x275bb5)[_0x3370('0x27')](handleEntityNotFound(_0x222020,null))[_0x3370('0x27')](respondWithResult(_0x222020,null))['catch'](handleError(_0x222020,null));};exports[_0x3370('0x49')]=function(_0x488305,_0x571931){return db['ChatTransferReport'][_0x3370('0x49')](_0x488305[_0x3370('0x4a')],{})[_0x3370('0x27')](respondWithResult(_0x571931,0xc9))[_0x3370('0x4b')](handleError(_0x571931,null));};exports[_0x3370('0x26')]=function(_0x17585a,_0x31bcff){if(_0x17585a[_0x3370('0x4a')]['id']){delete _0x17585a['body']['id'];}return db[_0x3370('0x41')][_0x3370('0x48')]({'where':{'id':_0x17585a[_0x3370('0x47')]['id']}})['then'](handleEntityNotFound(_0x31bcff,null))[_0x3370('0x27')](saveUpdates(_0x17585a[_0x3370('0x4a')],null))[_0x3370('0x27')](respondWithResult(_0x31bcff,null))['catch'](handleError(_0x31bcff,null));};exports[_0x3370('0x4c')]=function(_0x3eddd4,_0x1209b7){return db[_0x3370('0x41')][_0x3370('0x48')]({'where':{'id':_0x3eddd4['params']['id']}})[_0x3370('0x27')](handleEntityNotFound(_0x1209b7,null))['then'](removeEntity(_0x1209b7,null))[_0x3370('0x4b')](handleError(_0x1209b7,null));};exports['describe']=function(_0x142d1c,_0x280ad8){return db[_0x3370('0x41')][_0x3370('0x4d')]()[_0x3370('0x27')](respondWithResult(_0x280ad8,null))['catch'](handleError(_0x280ad8,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 786d3d2..90700e4 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 _0xc699=['moment','bluebird','request-promise','rimraf','../../config/environment','define','report_chat_transfer','uniqueid','lodash','util'];(function(_0x304863,_0x27d317){var _0x12ebb5=function(_0x494dfe){while(--_0x494dfe){_0x304863['push'](_0x304863['shift']());}};_0x12ebb5(++_0x27d317);}(_0xc699,0x120));var _0x9c69=function(_0xffa654,_0x4c734){_0xffa654=_0xffa654-0x0;var _0x5dd847=_0xc699[_0xffa654];return _0x5dd847;};'use strict';var _=require(_0x9c69('0x0'));var util=require(_0x9c69('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9c69('0x2'));var BPromise=require(_0x9c69('0x3'));var rp=require(_0x9c69('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c69('0x5'));var config=require(_0x9c69('0x6'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x3139db,_0xad76e){return _0x3139db[_0x9c69('0x7')]('ChatTransferReport',attributes,{'tableName':_0x9c69('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9c69('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9793=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x3922d8,_0x24f376){var _0x21038e=function(_0x2cd508){while(--_0x2cd508){_0x3922d8['push'](_0x3922d8['shift']());}};_0x21038e(++_0x24f376);}(_0x9793,0x1ee));var _0x3979=function(_0x366117,_0x2f1042){_0x366117=_0x366117-0x0;var _0x2a1113=_0x9793[_0x366117];return _0x2a1113;};'use strict';var _=require(_0x3979('0x0'));var util=require('util');var logger=require(_0x3979('0x1'))(_0x3979('0x2'));var moment=require(_0x3979('0x3'));var BPromise=require(_0x3979('0x4'));var rp=require(_0x3979('0x5'));var fs=require('fs');var path=require(_0x3979('0x6'));var rimraf=require(_0x3979('0x7'));var config=require(_0x3979('0x8'));var attributes=require(_0x3979('0x9'));module[_0x3979('0xa')]=function(_0xd975e9,_0x57032e){return _0xd975e9[_0x3979('0xb')](_0x3979('0xc'),attributes,{'tableName':_0x3979('0xd'),'paranoid':![],'indexes':[{'name':_0x3979('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index fdbcb20..9f20c5d 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 _0x9029=['jayson/promise','http','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x14e6ca,_0xe12053){var _0x5c0c44=function(_0xd1c599){while(--_0xd1c599){_0x14e6ca['push'](_0x14e6ca['shift']());}};_0x5c0c44(++_0xe12053);}(_0x9029,0x112));var _0x9902=function(_0x48c560,_0x129d37){_0x48c560=_0x48c560-0x0;var _0x359557=_0x9029[_0x48c560];return _0x359557;};'use strict';var _=require(_0x9902('0x0'));var util=require(_0x9902('0x1'));var moment=require(_0x9902('0x2'));var BPromise=require(_0x9902('0x3'));var rs=require(_0x9902('0x4'));var fs=require('fs');var Redis=require(_0x9902('0x5'));var db=require(_0x9902('0x6'))['db'];var utils=require(_0x9902('0x7'));var logger=require(_0x9902('0x8'))(_0x9902('0x9'));var config=require(_0x9902('0xa'));var jayson=require(_0x9902('0xb'));var client=jayson['client'][_0x9902('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ddc1b,_0x41063b,_0x3d125a){return new BPromise(function(_0x308cc2,_0x31c0b2){return client['request'](_0x1ddc1b,_0x3d125a)['then'](function(_0x4f3412){logger[_0x9902('0xd')](_0x9902('0xe'),_0x41063b,'request\x20sent');logger['debug'](_0x9902('0xf'),_0x41063b,_0x9902('0x10'),JSON['stringify'](_0x4f3412));if(_0x4f3412[_0x9902('0x11')]){if(_0x4f3412[_0x9902('0x11')]['code']===0x1f4){logger[_0x9902('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x41063b,_0x4f3412[_0x9902('0x11')]['message']);return _0x31c0b2(_0x4f3412[_0x9902('0x11')]['message']);}logger['error'](_0x9902('0xe'),_0x41063b,_0x4f3412['error']['message']);return _0x308cc2(_0x4f3412[_0x9902('0x11')][_0x9902('0x12')]);}else{logger[_0x9902('0xd')](_0x9902('0xe'),_0x41063b,_0x9902('0x10'));_0x308cc2(_0x4f3412['result'][_0x9902('0x12')]);}})['catch'](function(_0x18ce8d){logger[_0x9902('0x11')](_0x9902('0xe'),_0x41063b,_0x18ce8d);_0x31c0b2(_0x18ce8d);});});} \ No newline at end of file +var _0x0883=['stringify','code','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x178d07,_0x28f252){var _0x5adfa2=function(_0x6d1b77){while(--_0x6d1b77){_0x178d07['push'](_0x178d07['shift']());}};_0x5adfa2(++_0x28f252);}(_0x0883,0xcb));var _0x3088=function(_0x3de873,_0x174b5f){_0x3de873=_0x3de873-0x0;var _0x380b8c=_0x0883[_0x3de873];return _0x380b8c;};'use strict';var _=require(_0x3088('0x0'));var util=require(_0x3088('0x1'));var moment=require(_0x3088('0x2'));var BPromise=require('bluebird');var rs=require(_0x3088('0x3'));var fs=require('fs');var Redis=require(_0x3088('0x4'));var db=require(_0x3088('0x5'))['db'];var utils=require(_0x3088('0x6'));var logger=require(_0x3088('0x7'))('rpc');var config=require(_0x3088('0x8'));var jayson=require(_0x3088('0x9'));var client=jayson['client'][_0x3088('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x522b6b,_0x220cb9,_0x373b2b){return new BPromise(function(_0x17884c,_0x1fa326){return client[_0x3088('0xb')](_0x522b6b,_0x373b2b)['then'](function(_0x1bffd7){logger[_0x3088('0xc')](_0x3088('0xd'),_0x220cb9,_0x3088('0xe'));logger[_0x3088('0xf')](_0x3088('0x10'),_0x220cb9,_0x3088('0xe'),JSON[_0x3088('0x11')](_0x1bffd7));if(_0x1bffd7['error']){if(_0x1bffd7['error'][_0x3088('0x12')]===0x1f4){logger['error'](_0x3088('0xd'),_0x220cb9,_0x1bffd7[_0x3088('0x13')][_0x3088('0x14')]);return _0x1fa326(_0x1bffd7[_0x3088('0x13')][_0x3088('0x14')]);}logger[_0x3088('0x13')](_0x3088('0xd'),_0x220cb9,_0x1bffd7[_0x3088('0x13')]['message']);return _0x17884c(_0x1bffd7[_0x3088('0x13')][_0x3088('0x14')]);}else{logger[_0x3088('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x220cb9,_0x3088('0xe'));_0x17884c(_0x1bffd7[_0x3088('0x15')][_0x3088('0x14')]);}})['catch'](function(_0x5a68f3){logger[_0x3088('0x13')](_0x3088('0xd'),_0x220cb9,_0x5a68f3);_0x1fa326(_0x5a68f3);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index d5e738a..82229a1 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 _0x34b8=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x51fa67,_0x4de75b){var _0xc1dae7=function(_0x411ef4){while(--_0x411ef4){_0x51fa67['push'](_0x51fa67['shift']());}};_0xc1dae7(++_0x4de75b);}(_0x34b8,0x1ca));var _0x834b=function(_0x1681b1,_0x5dc4d5){_0x1681b1=_0x1681b1-0x0;var _0x5833eb=_0x34b8[_0x1681b1];return _0x5833eb;};'use strict';var multer=require(_0x834b('0x0'));var util=require(_0x834b('0x1'));var path=require('path');var timeout=require(_0x834b('0x2'));var express=require(_0x834b('0x3'));var router=express[_0x834b('0x4')]();var fs_extra=require(_0x834b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x834b('0x6'));var config=require(_0x834b('0x7'));var controller=require('./chatTransferReport.controller');router[_0x834b('0x8')]('/',auth[_0x834b('0x9')](),controller[_0x834b('0xa')]);router[_0x834b('0x8')](_0x834b('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x834b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x834b('0xc')]);router[_0x834b('0xd')]('/',auth[_0x834b('0x9')](),controller[_0x834b('0xe')]);router[_0x834b('0xf')](_0x834b('0x10'),auth[_0x834b('0x9')](),controller[_0x834b('0x11')]);router[_0x834b('0x12')]('/:id',auth[_0x834b('0x9')](),controller[_0x834b('0x13')]);module[_0x834b('0x14')]=router; \ No newline at end of file +var _0x81a8=['describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x189ced,_0xacd4a7){var _0x444980=function(_0x5c7759){while(--_0x5c7759){_0x189ced['push'](_0x189ced['shift']());}};_0x444980(++_0xacd4a7);}(_0x81a8,0xef));var _0x881a=function(_0x92bc95,_0x2dbcc0){_0x92bc95=_0x92bc95-0x0;var _0x1d671e=_0x81a8[_0x92bc95];return _0x1d671e;};'use strict';var multer=require(_0x881a('0x0'));var util=require(_0x881a('0x1'));var path=require(_0x881a('0x2'));var timeout=require(_0x881a('0x3'));var express=require(_0x881a('0x4'));var router=express[_0x881a('0x5')]();var fs_extra=require(_0x881a('0x6'));var auth=require(_0x881a('0x7'));var interaction=require(_0x881a('0x8'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x881a('0x9')]('/',auth[_0x881a('0xa')](),controller[_0x881a('0xb')]);router['get'](_0x881a('0xc'),auth[_0x881a('0xa')](),controller[_0x881a('0xd')]);router[_0x881a('0x9')](_0x881a('0xe'),auth[_0x881a('0xa')](),controller[_0x881a('0xf')]);router[_0x881a('0x10')]('/',auth['isAuthenticated'](),controller[_0x881a('0x11')]);router[_0x881a('0x12')](_0x881a('0xe'),auth[_0x881a('0xa')](),controller['update']);router[_0x881a('0x13')](_0x881a('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x881a('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 70035b7..4643974 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 _0x9cc2=['text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Leave\x20your\x20comments','offlineForm','generate','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','star','thumb','input','name'];(function(_0x127a60,_0x37f33a){var _0xc1f6a3=function(_0x8ed035){while(--_0x8ed035){_0x127a60['push'](_0x127a60['shift']());}};_0xc1f6a3(++_0x37f33a);}(_0x9cc2,0x7e));var _0x29cc=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0x9cc2[_0x296923];return _0x29af70;};'use strict';var Sequelize=require(_0x29cc('0x0'));var rs=require(_0x29cc('0x1'));module[_0x29cc('0x2')]={'name':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x29cc('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x5')},'mapKeyOffline':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x5')},'key':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![],'defaultValue':_0x29cc('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![],'defaultValue':_0x29cc('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![],'defaultValue':_0x29cc('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![],'defaultValue':_0x29cc('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x29cc('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x29cc('0x3')]},'animation':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x29cc('0xb')](_0x29cc('0xc'),_0x29cc('0xd')),'defaultValue':_0x29cc('0xc')},'header_online':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0xe')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x29cc('0xf')},'offline_chat_button':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x10')},'header_offline':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x11')},'download_transcript':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x29cc('0x13')]},'closingQuestion':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x14')},'formSubmitSuccessMessage':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x15')},'formSubmitFailureMessage':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x16')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x17')},'closingMessage':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x29cc('0x10')},'skipMessageButton':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x18')},'conditionAgreement':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x19')},'ratingType':{'type':Sequelize[_0x29cc('0xb')](_0x29cc('0x1a'),_0x29cc('0x1b')),'defaultValue':_0x29cc('0x1a')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x29cc('0x13')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x29cc('0x1c'),'variable':null,'config':{'placeholder':_0x29cc('0x1d'),'type':_0x29cc('0x1e'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x29cc('0x1c'),'props':{'title':_0x29cc('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x29cc('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x29cc('0x1f')](_0x29cc('0x20'))?JSON[_0x29cc('0x21')](this['getDataValue'](_0x29cc('0x20'))):{};},'set':function(_0x118b78){return this[_0x29cc('0x22')](_0x29cc('0x20'),JSON[_0x29cc('0x23')](_0x118b78));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x29cc('0x1c'),'props':{'title':_0x29cc('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x29cc('0x5'),'type':_0x29cc('0x5')},'variable':null},{'type':_0x29cc('0x24'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x29cc('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0x29cc('0x1f')](_0x29cc('0x26'))?JSON['parse'](this[_0x29cc('0x1f')](_0x29cc('0x26'))):{};},'set':function(_0xa80738){return this['setDataValue'](_0x29cc('0x26'),JSON[_0x29cc('0x23')](_0xa80738));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x29cc('0x27')]();}},'autoclose':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x29cc('0x3')]},'waitingTitle':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x28')},'offlineMessageBody':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x29cc('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x18')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x29cc('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x29cc('0x13')]},'showAgentAvatar':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x29cc('0x3')]},'notificationTemplate':{'type':Sequelize[_0x29cc('0x13')],'defaultValue':function(){return _0x29cc('0x2b');}},'notificationSound':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x29cc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x29cc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x29cc('0x3')]},'customerAvatar':{'type':Sequelize[_0x29cc('0x13')]},'showCustomerAvatar':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x29cc('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29cc('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x29cc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x29cc('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29cc('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![],'comment':_0x29cc('0x30'),'set':function(_0x175e7b){if(!_0x175e7b)this[_0x29cc('0x22')](_0x29cc('0x31'),null);this[_0x29cc('0x22')]('mandatoryDisposition',_0x175e7b);}},'vidaooEscalation':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x29cc('0x3')]},'vidaooTopic':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![],'defaultValue':_0x29cc('0x32')},'vidaooNote':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':function(){return _0x29cc('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x29cc('0x13')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x29cc('0x13')]}}; \ No newline at end of file +var _0xb186=['We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','ENUM','rounded','squared'];(function(_0x2bcdf4,_0x1a2f20){var _0x4a0f7a=function(_0x1e924f){while(--_0x1e924f){_0x2bcdf4['push'](_0x2bcdf4['shift']());}};_0x4a0f7a(++_0x1a2f20);}(_0xb186,0x19e));var _0x6b18=function(_0x5a18c3,_0x5c6928){_0x5a18c3=_0x5a18c3-0x0;var _0x3e22e7=_0xb186[_0x5a18c3];return _0x3e22e7;};'use strict';var Sequelize=require(_0x6b18('0x0'));var rs=require(_0x6b18('0x1'));module[_0x6b18('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x6b18('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x6b18('0x3')]},'mapKey':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x4')},'mapKeyOffline':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x4')},'key':{'type':Sequelize[_0x6b18('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6b18('0x3')],'allowNull':![],'defaultValue':_0x6b18('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6b18('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b18('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6b18('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6b18('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6b18('0x7')](_0x6b18('0x8'),_0x6b18('0x9')),'defaultValue':_0x6b18('0x8')},'header_online':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0xa')},'start_chat_button':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0xb')},'offline_chat_button':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0xc')},'header_offline':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6b18('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6b18('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x6b18('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x13')},'placeholderMessage':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x14')},'closingMessage':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6b18('0xc')},'skipMessageButton':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x16')},'conditionAgreement':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x17')},'ratingType':{'type':Sequelize[_0x6b18('0x7')](_0x6b18('0x18'),_0x6b18('0x19')),'defaultValue':_0x6b18('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x6b18('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x6b18('0x1a')]({'items':[{'type':_0x6b18('0x1b'),'variable':null,'config':{'placeholder':_0x6b18('0x1c'),'type':_0x6b18('0x1d'),'required':!![]},'props':{'title':_0x6b18('0x1c'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x6b18('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6b18('0x1e')](_0x6b18('0x1f'))?JSON[_0x6b18('0x20')](this[_0x6b18('0x1e')](_0x6b18('0x1f'))):{};},'set':function(_0x49d24c){return this[_0x6b18('0x21')](_0x6b18('0x1f'),JSON[_0x6b18('0x1a')](_0x49d24c));}},'offlineForm':{'type':Sequelize[_0x6b18('0x10')],'defaultValue':function(){return JSON[_0x6b18('0x1a')]({'items':[{'type':_0x6b18('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x6b18('0x22'),'config':{'placeholder':_0x6b18('0x23')},'props':{'title':_0x6b18('0x23'),'helpText':_0x6b18('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x6b18('0x1e')]('offlineForm')?JSON[_0x6b18('0x20')](this['getDataValue'](_0x6b18('0x25'))):{};},'set':function(_0x3bb5da){return this['setDataValue']('offlineForm',JSON[_0x6b18('0x1a')](_0x3bb5da));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6b18('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6b18('0x27')},'waitingMessage':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x6b18('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6b18('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6b18('0x10')],'defaultValue':function(){return _0x6b18('0x2b');}},'notificationSound':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x2d')},'verticalAlignment':{'type':Sequelize[_0x6b18('0xe')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6b18('0x3')],'defaultValue':_0x6b18('0x2e')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x6b18('0x2f')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x6b18('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6b18('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6b18('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6b18('0x30')},'systemAvatar':{'type':Sequelize[_0x6b18('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6b18('0xe')],'comment':_0x6b18('0x31')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6b18('0x32'),'set':function(_0x1ac4e5){if(!_0x1ac4e5)this[_0x6b18('0x21')](_0x6b18('0x33'),null);this[_0x6b18('0x21')]('mandatoryDisposition',_0x1ac4e5);}},'vidaooEscalation':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6b18('0x3')]},'vidaooTopic':{'type':Sequelize[_0x6b18('0x3')],'allowNull':![],'defaultValue':_0x6b18('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x6b18('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6b18('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6b18('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 7a41426..1445b27 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 _0x1bac=['fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','notifyMail','remove','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','interval','getProactiveActions','virtual','License','increment','server/files/chat/iframe.ejs','utf8','3.9.0','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','getOfflineMessages','Contact','Attachment','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../config/logger','api','../../errors/api','APIOutOfIntervalError','handleError','APIConflictError','URL','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','debug','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','status','end','json','limit','undefined','count','offset','set','Content-Range','destroy','ChatWebsites','UserProfileResource','sendStatus','stack','name','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','model','vendor','%s\x20%s\x20%s','type','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','Pause','fields','body','address','split','forEach','testWildcardValidity','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','create','role','user','get','UserProfileSection','find','autoAssociation','update','describe','addDisposition','Disposition','getDispositions','findOne','order','pick','ChatWebsiteId','include','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','file','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','timezone','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','createdAt','updatedAt','includes','CompanyId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','Intervals','account','applications','orderBy','priority','asc','list','ListId','defaults','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','interaction','contact','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','Sequelize','difference','ValidationError','from\x20is\x20mandatory','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage'];(function(_0xc14e9b,_0x5c3047){var _0x48f298=function(_0x3ddc68){while(--_0x3ddc68){_0xc14e9b['push'](_0xc14e9b['shift']());}};_0x48f298(++_0x5c3047);}(_0x1bac,0x18a));var _0xc1ba=function(_0x4be5d5,_0x4614d1){_0x4be5d5=_0x4be5d5-0x0;var _0x402694=_0x1bac[_0x4be5d5];return _0x402694;};'use strict';var Mustache=require('mustache');var util=require(_0xc1ba('0x0'));var path=require(_0xc1ba('0x1'));var ejs=require(_0xc1ba('0x2'));var fs=require('fs');var fs_extra=require(_0xc1ba('0x3'));var _=require(_0xc1ba('0x4'));var querystring=require(_0xc1ba('0x5'));var htmlToText=require(_0xc1ba('0x6'));var Redis=require(_0xc1ba('0x7'));var jayson=require(_0xc1ba('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0xc1ba('0x9'))(_0xc1ba('0xa'));var config=require('../../config/environment');var APIBadRequestError=require(_0xc1ba('0xb'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIOutOfIntervalError=require(_0xc1ba('0xb'))[_0xc1ba('0xc')];var APIHandleError=require(_0xc1ba('0xb'))[_0xc1ba('0xd')];var APIConflictError=require('../../errors/api')[_0xc1ba('0xe')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require('url')[_0xc1ba('0xf')];var db=require(_0xc1ba('0x10'))['db'];config[_0xc1ba('0x11')]=_['defaults'](config[_0xc1ba('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0xc1ba('0x12'))(new Redis(config[_0xc1ba('0x11')]));require(_0xc1ba('0x13'))[_0xc1ba('0x14')](socket);var client=jayson[_0xc1ba('0x15')][_0xc1ba('0x16')]({'port':0x232c});var client9002=jayson[_0xc1ba('0x15')]['http']({'port':0x232a});var client9003=jayson[_0xc1ba('0x15')][_0xc1ba('0x16')]({'port':0x232b});var client9001=jayson[_0xc1ba('0x15')][_0xc1ba('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x2510f7,_0x57b4a1,_0x1ffa97,_0x5563fa){return new Promise(function(_0x3bc21e,_0x33ecb1){var _0x273267=_0x5563fa||client;return _0x273267[_0xc1ba('0x17')](_0x2510f7,_0x1ffa97)[_0xc1ba('0x18')](function(_0x54826f){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x57b4a1,'request\x20sent');logger[_0xc1ba('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x57b4a1,_0xc1ba('0x1a'),JSON[_0xc1ba('0x1b')](_0x54826f));if(_0x54826f[_0xc1ba('0x1c')]){if(_0x54826f[_0xc1ba('0x1c')][_0xc1ba('0x1d')]===0x1f4){logger[_0xc1ba('0x1c')](_0xc1ba('0x1e'),_0x57b4a1,_0x54826f[_0xc1ba('0x1c')]['message']);return _0x33ecb1(_0x54826f[_0xc1ba('0x1c')][_0xc1ba('0x1f')]);}logger[_0xc1ba('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x57b4a1,_0x54826f[_0xc1ba('0x1c')]['message']);return _0x3bc21e(_0x54826f['error'][_0xc1ba('0x1f')]);}else{logger[_0xc1ba('0x20')](_0xc1ba('0x1e'),_0x57b4a1,_0xc1ba('0x1a'));_0x3bc21e(_0x54826f['result'][_0xc1ba('0x1f')]);}})['catch'](function(_0x19bb54){logger['error'](_0xc1ba('0x1e'),_0x57b4a1,_0x19bb54);_0x33ecb1(_0x19bb54);});});}function respondWithStatusCode(_0x83970f,_0x2a642f){_0x2a642f=_0x2a642f||0xcc;return function(_0x268c43){if(_0x268c43){return _0x83970f['sendStatus'](_0x2a642f);}return _0x83970f[_0xc1ba('0x21')](_0x2a642f)[_0xc1ba('0x22')]();};}function respondWithResult(_0x28aa07,_0x1272ff){_0x1272ff=_0x1272ff||0xc8;return function(_0x5c7e8e){if(_0x5c7e8e){return _0x28aa07['status'](_0x1272ff)[_0xc1ba('0x23')](_0x5c7e8e);}};}function respondWithFilteredResult(_0x2cef8a,_0x3db85f){return function(_0x2211ed){if(_0x2211ed){var _0x50c159=typeof _0x3db85f['offset']==='undefined'&&typeof _0x3db85f[_0xc1ba('0x24')]===_0xc1ba('0x25');var _0x1d7a7e=_0x2211ed[_0xc1ba('0x26')];var _0x1341a4=_0x50c159?0x0:_0x3db85f['offset'];var _0x46fd03=_0x50c159?_0x2211ed[_0xc1ba('0x26')]:_0x3db85f[_0xc1ba('0x27')]+_0x3db85f[_0xc1ba('0x24')];var _0x2bdfca;if(_0x46fd03>=_0x1d7a7e){_0x46fd03=_0x1d7a7e;_0x2bdfca=0xc8;}else{_0x2bdfca=0xce;}_0x2cef8a[_0xc1ba('0x21')](_0x2bdfca);return _0x2cef8a[_0xc1ba('0x28')](_0xc1ba('0x29'),_0x1341a4+'-'+_0x46fd03+'/'+_0x1d7a7e)[_0xc1ba('0x23')](_0x2211ed);}return null;};}function saveUpdates(_0x197b07){return function(_0x16ec13){if(_0x16ec13){return _0x16ec13['update'](_0x197b07)[_0xc1ba('0x18')](function(_0x2d94fe){return _0x2d94fe;});}return null;};}function removeEntity(_0x17d10b){return function(_0x3dfa33){if(_0x3dfa33){return _0x3dfa33[_0xc1ba('0x2a')]()[_0xc1ba('0x18')](function(){var _0x472a82=_0x3dfa33['get']({'plain':!![]});var _0x5d1fbc=_0xc1ba('0x2b');return db[_0xc1ba('0x2c')]['destroy']({'where':{'type':_0x5d1fbc,'resourceId':_0x472a82['id']}})[_0xc1ba('0x18')](function(){return _0x3dfa33;});})[_0xc1ba('0x18')](function(){_0x17d10b[_0xc1ba('0x21')](0xcc)[_0xc1ba('0x22')]();});}};}function handleEntityNotFound(_0x5b3176){return function(_0x15e7c2){if(!_0x15e7c2){_0x5b3176[_0xc1ba('0x2d')](0x194);}return _0x15e7c2;};}function handleError(_0x23b31a,_0x5aae9c){_0x5aae9c=_0x5aae9c||0x1f4;return function(_0x2b5719){logger[_0xc1ba('0x1c')](_0x2b5719[_0xc1ba('0x2e')]);if(_0x2b5719[_0xc1ba('0x2f')]){delete _0x2b5719['name'];}_0x23b31a[_0xc1ba('0x21')](_0x5aae9c)['send'](_0x2b5719);};}function createInteractionObject(_0x3d725d,_0x344457,_0x3d4626,_0x1d63b0){var _0x53f669=require(_0xc1ba('0x30'));var _0x16eca5=new _0x53f669();var _0x52af87=_0x16eca5[_0xc1ba('0x31')](_0x3d4626['user-agent'])[_0xc1ba('0x32')]();var _0x199f00=_0x344457[_0xc1ba('0x33')];if(_0x3d4626[_0xc1ba('0x34')]){_0x199f00=_0x3d4626[_0xc1ba('0x34')];}else if(_0x3d4626[_0xc1ba('0x35')]){_0x199f00=_[_0xc1ba('0x36')](_0x3d4626[_0xc1ba('0x35')]['split'](','));}return{'ContactId':_0x1d63b0['id'],'ChatWebsiteId':_0x3d725d,'from':(_0x1d63b0[_0xc1ba('0x37')]||'')+'\x20'+(_0x1d63b0[_0xc1ba('0x38')]||''),'customerIp':_0x199f00,'customerPort':_0x3d4626[_0xc1ba('0x39')]?_0x3d4626[_0xc1ba('0x39')]:null,'referer':_0x344457[_0xc1ba('0x3a')],'browserName':_0x52af87['browser']['name']&&_0x52af87[_0xc1ba('0x3b')]['version']?util[_0xc1ba('0x3c')](_0xc1ba('0x3d'),_0x52af87['browser']['name'],_0x52af87[_0xc1ba('0x3b')][_0xc1ba('0x3e')]):_0xc1ba('0x3f'),'browserVersion':_0x52af87[_0xc1ba('0x3b')][_0xc1ba('0x3e')]||'unknown','osName':util[_0xc1ba('0x3c')](_0xc1ba('0x3d'),_0x52af87['os'][_0xc1ba('0x2f')],_0x52af87['os'][_0xc1ba('0x3e')]),'osVersion':_0x52af87['os']['version'],'deviceModel':_0x52af87[_0xc1ba('0x40')][_0xc1ba('0x41')]&&_0x52af87[_0xc1ba('0x40')][_0xc1ba('0x42')]?util[_0xc1ba('0x3c')](_0xc1ba('0x43'),_0x52af87[_0xc1ba('0x40')][_0xc1ba('0x41')],_0x52af87['device'][_0xc1ba('0x42')],_0x52af87[_0xc1ba('0x40')][_0xc1ba('0x44')]):null,'deviceVendor':_0x52af87[_0xc1ba('0x40')][_0xc1ba('0x42')],'deviceType':_0x52af87['device'][_0xc1ba('0x44')],'formData':JSON[_0xc1ba('0x1b')](_0x344457)};}exports['index']=function(_0x10ad9a,_0x222ec0){var _0x2d0779={'include':[{'model':db['Pause'],'as':_0xc1ba('0x45')}]},_0x37c8fd={},_0x17038c={'count':0x0,'rows':[]};var _0x576485=_[_0xc1ba('0x46')](db[_0xc1ba('0x47')][_0xc1ba('0x48')],function(_0x59a53a){return{'name':_0x59a53a[_0xc1ba('0x49')],'type':_0x59a53a['type'][_0xc1ba('0x4a')]};});_0x37c8fd[_0xc1ba('0x41')]=_['map'](_0x576485,_0xc1ba('0x2f'));_0x37c8fd['query']=_[_0xc1ba('0x4b')](_0x10ad9a['query']);_0x37c8fd[_0xc1ba('0x4c')]=_[_0xc1ba('0x4d')](_0x37c8fd[_0xc1ba('0x41')],_0x37c8fd[_0xc1ba('0x4e')]);_0x2d0779[_0xc1ba('0x4f')]=_['intersection'](_0x37c8fd['model'],qs['fields'](_0x10ad9a[_0xc1ba('0x4e')]['fields']));_0x2d0779[_0xc1ba('0x4f')]=_0x2d0779[_0xc1ba('0x4f')][_0xc1ba('0x50')]?_0x2d0779['attributes']:_0x37c8fd[_0xc1ba('0x41')];if(!_0x10ad9a[_0xc1ba('0x4e')][_0xc1ba('0x51')](_0xc1ba('0x52'))){_0x2d0779[_0xc1ba('0x24')]=qs[_0xc1ba('0x24')](_0x10ad9a[_0xc1ba('0x4e')][_0xc1ba('0x24')]);_0x2d0779[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x10ad9a[_0xc1ba('0x4e')]['offset']);}_0x2d0779['order']=qs[_0xc1ba('0x53')](_0x10ad9a[_0xc1ba('0x4e')][_0xc1ba('0x53')]);_0x2d0779[_0xc1ba('0x54')]=qs['filters'](_['pick'](_0x10ad9a['query'],_0x37c8fd[_0xc1ba('0x4c')]),_0x576485);if(_0x10ad9a[_0xc1ba('0x4e')]['filter']){_0x2d0779['where']=_['merge'](_0x2d0779['where'],{'$or':_[_0xc1ba('0x46')](_0x576485,function(_0x5d3ac5){if(_0x5d3ac5[_0xc1ba('0x44')]!==_0xc1ba('0x55')){var _0x678fda={};_0x678fda[_0x5d3ac5[_0xc1ba('0x2f')]]={'$like':'%'+_0x10ad9a['query'][_0xc1ba('0x56')]+'%'};return _0x678fda;}})});}_0x2d0779=_[_0xc1ba('0x57')]({},_0x2d0779,_0x10ad9a[_0xc1ba('0x58')]);var _0x52f12b={'where':_0x2d0779[_0xc1ba('0x54')]};return db[_0xc1ba('0x47')][_0xc1ba('0x26')](_0x52f12b)[_0xc1ba('0x18')](function(_0x301ee9){_0x17038c['count']=_0x301ee9;if(_0x10ad9a['query'][_0xc1ba('0x59')]){_0x2d0779['include']=[{'all':!![]}];}return db[_0xc1ba('0x47')][_0xc1ba('0x5a')](_0x2d0779);})['then'](function(_0x227511){_0x17038c['rows']=_0x227511;return _0x17038c;})['then'](respondWithFilteredResult(_0x222ec0,_0x2d0779))[_0xc1ba('0x5b')](handleError(_0x222ec0,null));};exports[_0xc1ba('0x5c')]=function(_0x5d610b,_0x5aadab){var _0x58a976={'raw':![],'where':{'id':_0x5d610b[_0xc1ba('0x5d')]['id']},'include':[{'model':db[_0xc1ba('0x5e')],'as':'mandatoryDispositionPause'}]},_0x330190={};_0x330190[_0xc1ba('0x41')]=_[_0xc1ba('0x4b')](db[_0xc1ba('0x47')][_0xc1ba('0x48')]);_0x330190[_0xc1ba('0x4e')]=_[_0xc1ba('0x4b')](_0x5d610b[_0xc1ba('0x4e')]);_0x330190[_0xc1ba('0x4c')]=_['intersection'](_0x330190['model'],_0x330190[_0xc1ba('0x4e')]);_0x58a976['attributes']=_[_0xc1ba('0x4d')](_0x330190['model'],qs[_0xc1ba('0x5f')](_0x5d610b['query']['fields']));_0x58a976[_0xc1ba('0x4f')]=_0x58a976['attributes'][_0xc1ba('0x50')]?_0x58a976[_0xc1ba('0x4f')]:_0x330190['model'];if(_0x5d610b['query'][_0xc1ba('0x59')]){_0x58a976['include']=[{'all':!![]}];}_0x58a976=_['merge']({},_0x58a976,_0x5d610b[_0xc1ba('0x58')]);return db[_0xc1ba('0x47')]['find'](_0x58a976)[_0xc1ba('0x18')](handleEntityNotFound(_0x5aadab,null))[_0xc1ba('0x18')](respondWithResult(_0x5aadab,null))[_0xc1ba('0x5b')](handleError(_0x5aadab,null));};exports['create']=function(_0x473d96,_0x23b866){var _0x530236=null;_0x473d96[_0xc1ba('0x60')][_0xc1ba('0x61')][_0xc1ba('0x62')](',')[_0xc1ba('0x63')](_0x5a2f41=>{if(_0x5a2f41['trim']()!==''&&!wildcardUtils[_0xc1ba('0x64')](_0x5a2f41['trim']())){_0x530236=new APIBadRequestError('\x22'+_0x5a2f41[_0xc1ba('0x65')]()+_0xc1ba('0x66'));}});if(_0x530236){return handleError(_0x23b866,null)(_0x530236);}return db[_0xc1ba('0x47')][_0xc1ba('0x67')](_0x473d96[_0xc1ba('0x60')],{})['then'](function(_0x523eab){var _0x435b4f=_0x473d96['user']['get']({'plain':!![]});if(!_0x435b4f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x435b4f[_0xc1ba('0x68')]===_0xc1ba('0x69')){var _0x3087d1=_0x523eab[_0xc1ba('0x6a')]({'plain':!![]});var _0x2819e9=_0xc1ba('0x2b');return db[_0xc1ba('0x6b')][_0xc1ba('0x6c')]({'where':{'name':_0x2819e9,'userProfileId':_0x435b4f['userProfileId']},'raw':!![]})[_0xc1ba('0x18')](function(_0x348b84){if(_0x348b84&&_0x348b84[_0xc1ba('0x6d')]===0x0){return db[_0xc1ba('0x2c')]['create']({'name':_0x3087d1[_0xc1ba('0x2f')],'resourceId':_0x3087d1['id'],'type':_0x348b84[_0xc1ba('0x2f')],'sectionId':_0x348b84['id']},{})[_0xc1ba('0x18')](function(){return _0x523eab;});}else{return _0x523eab;}})['catch'](function(_0x471570){logger[_0xc1ba('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x471570);throw _0x471570;});}return _0x523eab;})[_0xc1ba('0x18')](respondWithResult(_0x23b866,0xc9))['catch'](handleError(_0x23b866,null));};exports[_0xc1ba('0x6e')]=function(_0x5ce86c,_0xd322a){var _0x1a8c07=null;_0x5ce86c[_0xc1ba('0x60')]['address'][_0xc1ba('0x62')](',')['forEach'](_0x1fe441=>{if(_0x1fe441[_0xc1ba('0x65')]()!==''&&!wildcardUtils[_0xc1ba('0x64')](_0x1fe441[_0xc1ba('0x65')]())){_0x1a8c07=new APIBadRequestError('\x22'+_0x1fe441[_0xc1ba('0x65')]()+_0xc1ba('0x66'));}});if(_0x1a8c07){return handleError(_0xd322a,null)(_0x1a8c07);}if(_0x5ce86c[_0xc1ba('0x60')]['id']){delete _0x5ce86c['body']['id'];}return db[_0xc1ba('0x47')]['find']({'where':{'id':_0x5ce86c['params']['id']},'include':[{'model':db[_0xc1ba('0x5e')],'as':_0xc1ba('0x45')}]})[_0xc1ba('0x18')](handleEntityNotFound(_0xd322a,null))[_0xc1ba('0x18')](saveUpdates(_0x5ce86c[_0xc1ba('0x60')],null))['then'](respondWithResult(_0xd322a,null))[_0xc1ba('0x5b')](handleError(_0xd322a,null));};exports['destroy']=function(_0x1c3d9d,_0x3956f1){return db[_0xc1ba('0x47')]['find']({'where':{'id':_0x1c3d9d[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x3956f1,null))[_0xc1ba('0x18')](removeEntity(_0x3956f1,null))['catch'](handleError(_0x3956f1,null));};exports[_0xc1ba('0x6f')]=function(_0x520a6c,_0x4659fb){return db[_0xc1ba('0x47')][_0xc1ba('0x6f')]()[_0xc1ba('0x18')](respondWithResult(_0x4659fb,null))[_0xc1ba('0x5b')](handleError(_0x4659fb,null));};exports[_0xc1ba('0x70')]=function(_0x31c08c,_0x2702fa){if(_0x31c08c[_0xc1ba('0x60')]['id']){delete _0x31c08c['body']['id'];}return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x31c08c[_0xc1ba('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2702fa,null))[_0xc1ba('0x18')](function(_0x471b58){if(_0x471b58){_0x31c08c['body']['ChatWebsiteId']=_0x471b58['id'];return db[_0xc1ba('0x71')][_0xc1ba('0x67')](_0x31c08c[_0xc1ba('0x60')]);}})[_0xc1ba('0x18')](respondWithResult(_0x2702fa,null))[_0xc1ba('0x5b')](handleError(_0x2702fa,null));};exports[_0xc1ba('0x72')]=function(_0x3020c5,_0x16e866){var _0x44c5d7={'raw':![],'where':{}};var _0x5709f2={};var _0x23bc20={'count':0x0,'rows':[]};return db[_0xc1ba('0x47')][_0xc1ba('0x73')]({'where':{'id':_0x3020c5[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x16e866,null))[_0xc1ba('0x18')](function(_0x3dd10c){if(_0x3dd10c){_0x5709f2[_0xc1ba('0x41')]=_['keys'](db[_0xc1ba('0x71')][_0xc1ba('0x48')]);_0x5709f2['query']=_[_0xc1ba('0x4b')](_0x3020c5[_0xc1ba('0x4e')]);_0x5709f2[_0xc1ba('0x4c')]=_[_0xc1ba('0x4d')](_0x5709f2['model'],_0x5709f2['query']);_0x44c5d7[_0xc1ba('0x4f')]=_[_0xc1ba('0x4d')](_0x5709f2[_0xc1ba('0x41')],qs[_0xc1ba('0x5f')](_0x3020c5[_0xc1ba('0x4e')][_0xc1ba('0x5f')]));_0x44c5d7[_0xc1ba('0x4f')]=_0x44c5d7[_0xc1ba('0x4f')][_0xc1ba('0x50')]?_0x44c5d7[_0xc1ba('0x4f')]:_0x5709f2['model'];if(!_0x3020c5[_0xc1ba('0x4e')][_0xc1ba('0x51')]('nolimit')){_0x44c5d7[_0xc1ba('0x24')]=qs[_0xc1ba('0x24')](_0x3020c5[_0xc1ba('0x4e')][_0xc1ba('0x24')]);_0x44c5d7[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x3020c5[_0xc1ba('0x4e')][_0xc1ba('0x27')]);}_0x44c5d7[_0xc1ba('0x74')]=qs['sort'](_0x3020c5[_0xc1ba('0x4e')]['sort']);_0x44c5d7[_0xc1ba('0x54')]=qs[_0xc1ba('0x4c')](_[_0xc1ba('0x75')](_0x3020c5[_0xc1ba('0x4e')],_0x5709f2[_0xc1ba('0x4c')]));_0x44c5d7['where'][_0xc1ba('0x76')]=_0x3dd10c['id'];if(_0x3020c5[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x44c5d7[_0xc1ba('0x54')]=_[_0xc1ba('0x57')](_0x44c5d7[_0xc1ba('0x54')],{'$or':_[_0xc1ba('0x46')](_0x44c5d7['attributes'],function(_0x1a0072){var _0x20401c={};_0x20401c[_0x1a0072]={'$like':'%'+_0x3020c5['query'][_0xc1ba('0x56')]+'%'};return _0x20401c;})});}_0x44c5d7=_[_0xc1ba('0x57')]({},_0x44c5d7,_0x3020c5[_0xc1ba('0x58')]);return db[_0xc1ba('0x71')][_0xc1ba('0x26')]({'where':_0x44c5d7[_0xc1ba('0x54')]})[_0xc1ba('0x18')](function(_0x10d7d6){_0x23bc20[_0xc1ba('0x26')]=_0x10d7d6;if(_0x3020c5[_0xc1ba('0x4e')]['includeAll']){_0x44c5d7[_0xc1ba('0x77')]=[{'all':!![]}];}return db[_0xc1ba('0x71')][_0xc1ba('0x5a')](_0x44c5d7);})[_0xc1ba('0x18')](function(_0x59fd6b){_0x23bc20[_0xc1ba('0x78')]=_0x59fd6b;return _0x23bc20;});}})[_0xc1ba('0x18')](respondWithFilteredResult(_0x16e866,_0x44c5d7))['catch'](handleError(_0x16e866,null));};exports['removeDispositions']=function(_0x375086,_0x14b63f){return db['ChatWebsite']['find']({'where':{'id':_0x375086[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x14b63f,null))[_0xc1ba('0x18')](function(_0x1e5df0){if(_0x1e5df0){return _0x1e5df0[_0xc1ba('0x79')](_0x375086[_0xc1ba('0x4e')][_0xc1ba('0x7a')]);}})[_0xc1ba('0x18')](respondWithStatusCode(_0x14b63f,null))[_0xc1ba('0x5b')](handleError(_0x14b63f,null));};exports[_0xc1ba('0x7b')]=function(_0x131f34,_0x4dfa1c){if(_0x131f34[_0xc1ba('0x60')]['id']){delete _0x131f34[_0xc1ba('0x60')]['id'];}return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x131f34[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x4dfa1c,null))[_0xc1ba('0x18')](function(_0x48e80d){if(_0x48e80d){_0x131f34[_0xc1ba('0x60')][_0xc1ba('0x76')]=_0x48e80d['id'];return db['CannedAnswer'][_0xc1ba('0x67')](_0x131f34[_0xc1ba('0x60')]);}})[_0xc1ba('0x18')](respondWithResult(_0x4dfa1c,null))[_0xc1ba('0x5b')](handleError(_0x4dfa1c,null));};exports['getAnswers']=function(_0x2e6004,_0x525e95){var _0x5dcc88={'raw':![],'where':{}};var _0x290dee={};var _0x3a2075={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc1ba('0x73')]({'where':{'id':_0x2e6004[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x525e95,null))[_0xc1ba('0x18')](function(_0x39cc16){if(_0x39cc16){_0x290dee[_0xc1ba('0x41')]=_[_0xc1ba('0x4b')](db[_0xc1ba('0x7c')][_0xc1ba('0x48')]);_0x290dee[_0xc1ba('0x4e')]=_[_0xc1ba('0x4b')](_0x2e6004[_0xc1ba('0x4e')]);_0x290dee['filters']=_[_0xc1ba('0x4d')](_0x290dee[_0xc1ba('0x41')],_0x290dee[_0xc1ba('0x4e')]);_0x5dcc88['attributes']=_[_0xc1ba('0x4d')](_0x290dee['model'],qs['fields'](_0x2e6004['query'][_0xc1ba('0x5f')]));_0x5dcc88['attributes']=_0x5dcc88['attributes']['length']?_0x5dcc88[_0xc1ba('0x4f')]:_0x290dee[_0xc1ba('0x41')];if(!_0x2e6004[_0xc1ba('0x4e')][_0xc1ba('0x51')]('nolimit')){_0x5dcc88[_0xc1ba('0x24')]=qs[_0xc1ba('0x24')](_0x2e6004[_0xc1ba('0x4e')][_0xc1ba('0x24')]);_0x5dcc88[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x2e6004[_0xc1ba('0x4e')][_0xc1ba('0x27')]);}_0x5dcc88[_0xc1ba('0x74')]=qs[_0xc1ba('0x53')](_0x2e6004[_0xc1ba('0x4e')]['sort']);_0x5dcc88[_0xc1ba('0x54')]=qs['filters'](_['pick'](_0x2e6004[_0xc1ba('0x4e')],_0x290dee['filters']));_0x5dcc88['where'][_0xc1ba('0x76')]=_0x39cc16['id'];if(_0x2e6004[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x5dcc88['where']=_[_0xc1ba('0x57')](_0x5dcc88[_0xc1ba('0x54')],{'$or':_[_0xc1ba('0x46')](_0x5dcc88[_0xc1ba('0x4f')],function(_0x3092b3){var _0x3d07a4={};_0x3d07a4[_0x3092b3]={'$like':'%'+_0x2e6004['query'][_0xc1ba('0x56')]+'%'};return _0x3d07a4;})});}_0x5dcc88=_[_0xc1ba('0x57')]({},_0x5dcc88,_0x2e6004[_0xc1ba('0x58')]);return db[_0xc1ba('0x7c')][_0xc1ba('0x26')]({'where':_0x5dcc88[_0xc1ba('0x54')]})[_0xc1ba('0x18')](function(_0x405c04){_0x3a2075['count']=_0x405c04;if(_0x2e6004['query']['includeAll']){_0x5dcc88['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xc1ba('0x5a')](_0x5dcc88);})[_0xc1ba('0x18')](function(_0x4735d4){_0x3a2075[_0xc1ba('0x78')]=_0x4735d4;return _0x3a2075;});}})[_0xc1ba('0x18')](respondWithFilteredResult(_0x525e95,_0x5dcc88))[_0xc1ba('0x5b')](handleError(_0x525e95,null));};exports['removeAnswers']=function(_0x169d1a,_0x19cbb){return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x169d1a[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x19cbb,null))[_0xc1ba('0x18')](function(_0x370193){if(_0x370193){return _0x370193[_0xc1ba('0x7d')](_0x169d1a['query'][_0xc1ba('0x7a')]);}})[_0xc1ba('0x18')](respondWithStatusCode(_0x19cbb,null))[_0xc1ba('0x5b')](handleError(_0x19cbb,null));};exports[_0xc1ba('0x7e')]=function(_0x498594,_0x3f33bd){_0x498594[_0xc1ba('0x60')][_0xc1ba('0x7f')]=_0x498594['file']['filename'];return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x498594[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x3f33bd,null))['then'](saveUpdates(_0x498594[_0xc1ba('0x60')],null))[_0xc1ba('0x18')](respondWithResult(_0x3f33bd,null))['catch'](handleError(_0x3f33bd,null));};exports[_0xc1ba('0x80')]=function(_0x3dbb37,_0xf9d188){_0x3dbb37[_0xc1ba('0x60')][_0xc1ba('0x81')]=_0x3dbb37['file'][_0xc1ba('0x82')];return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x3dbb37['params']['id']}})['then'](handleEntityNotFound(_0xf9d188,null))['then'](saveUpdates(_0x3dbb37[_0xc1ba('0x60')],null))[_0xc1ba('0x18')](respondWithResult(_0xf9d188,null))[_0xc1ba('0x5b')](handleError(_0xf9d188,null));};exports[_0xc1ba('0x83')]=function(_0x59311a,_0x163c91){_0x59311a[_0xc1ba('0x60')][_0xc1ba('0x84')]=_0x59311a[_0xc1ba('0x85')][_0xc1ba('0x82')];return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x59311a[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x163c91,null))[_0xc1ba('0x18')](saveUpdates(_0x59311a['body'],null))[_0xc1ba('0x18')](respondWithResult(_0x163c91,null))[_0xc1ba('0x5b')](handleError(_0x163c91,null));};exports[_0xc1ba('0x86')]=function(_0x4b4e93,_0x3c04dd){_0x4b4e93['body'][_0xc1ba('0x87')]=_0x4b4e93[_0xc1ba('0x85')][_0xc1ba('0x82')];return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x4b4e93[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x3c04dd,null))[_0xc1ba('0x18')](saveUpdates(_0x4b4e93[_0xc1ba('0x60')],null))[_0xc1ba('0x18')](respondWithResult(_0x3c04dd,null))[_0xc1ba('0x5b')](handleError(_0x3c04dd,null));};exports[_0xc1ba('0x88')]=function(_0x5c56d0,_0x428b2b){var _0x47cc9a=path['join'](config[_0xc1ba('0x89')],_0xc1ba('0x8a'));var _0x4b9190={'where':{'id':_0x5c56d0['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2fe201=![];return require('../../config/license/util')[_0xc1ba('0x8b')]()[_0xc1ba('0x18')](function(_0x2e7c10){if(_0x2e7c10){_0x2fe201=_0x2e7c10[_0xc1ba('0x8c')];}})[_0xc1ba('0x18')](function(){return db['ChatWebsite'][_0xc1ba('0x6c')](_0x4b9190);})[_0xc1ba('0x18')](handleEntityNotFound(_0x428b2b,null))[_0xc1ba('0x18')](function(_0x554f42){if(_0x554f42){if(!_[_0xc1ba('0x8d')](_0x554f42['sitepic'])){if(fs['existsSync'](path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0x8f'),_0x554f42[_0xc1ba('0x7f')]))&&_0x2fe201){_0x47cc9a=path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0x8f'),_0x554f42[_0xc1ba('0x7f')]);}}return _0x428b2b[_0xc1ba('0x90')](_0x47cc9a);}})[_0xc1ba('0x5b')](handleError(_0x428b2b,null));};exports[_0xc1ba('0x91')]=function(_0x12731c,_0x1b2f8e){var _0x42dae2=path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0x92'));var _0x3317b6={'where':{'id':_0x12731c[_0xc1ba('0x5d')]['id']},'attributes':['id',_0xc1ba('0x81')],'raw':!![]};return db[_0xc1ba('0x47')][_0xc1ba('0x6c')](_0x3317b6)[_0xc1ba('0x18')](handleEntityNotFound(_0x1b2f8e,null))[_0xc1ba('0x18')](function(_0x1336a5){if(_0x1336a5){if(!_[_0xc1ba('0x8d')](_0x1336a5[_0xc1ba('0x81')])){if(fs[_0xc1ba('0x93')](path['join'](config[_0xc1ba('0x89')],_0xc1ba('0x94'),_0x1336a5[_0xc1ba('0x81')]))){_0x42dae2=path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0x94'),_0x1336a5[_0xc1ba('0x81')]);}}return _0x1b2f8e['download'](_0x42dae2);}})[_0xc1ba('0x5b')](handleError(_0x1b2f8e,null));};exports[_0xc1ba('0x95')]=function(_0x19b5d2,_0x1c561b){var _0x178e5e=path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],'server/files/images/avatars/customer_avatar.png');var _0x345137={'where':{'id':_0x19b5d2[_0xc1ba('0x5d')]['id']},'attributes':['id',_0xc1ba('0x84'),_0xc1ba('0x96')],'raw':!![]};return db[_0xc1ba('0x47')][_0xc1ba('0x6c')](_0x345137)['then'](handleEntityNotFound(_0x1c561b,null))[_0xc1ba('0x18')](function(_0xb50ca){if(_0xb50ca){if(!_[_0xc1ba('0x8d')](_0xb50ca[_0xc1ba('0x84')])){if(fs[_0xc1ba('0x93')](path['join'](config['root'],_0xc1ba('0x94'),_0xb50ca['customerAvatar']))&&_0xb50ca[_0xc1ba('0x96')]){_0x178e5e=path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0x94'),_0xb50ca[_0xc1ba('0x84')]);}}return _0x1c561b['download'](_0x178e5e);}})[_0xc1ba('0x5b')](handleError(_0x1c561b,null));};exports[_0xc1ba('0x97')]=function(_0x32a6d1,_0x3c4161){var _0x1c39e9=path[_0xc1ba('0x8e')](config['root'],_0xc1ba('0x98'));var _0x356ae2={'where':{'id':_0x32a6d1[_0xc1ba('0x5d')]['id']},'attributes':['id',_0xc1ba('0x87')],'raw':!![]};return db[_0xc1ba('0x47')][_0xc1ba('0x6c')](_0x356ae2)['then'](handleEntityNotFound(_0x3c4161,null))[_0xc1ba('0x18')](function(_0x32f46b){if(_0x32f46b){if(!_[_0xc1ba('0x8d')](_0x32f46b[_0xc1ba('0x87')])){if(fs['existsSync'](path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],'server/files/images/avatars/',_0x32f46b[_0xc1ba('0x87')]))){_0x1c39e9=path[_0xc1ba('0x8e')](config['root'],'server/files/images/avatars/',_0x32f46b[_0xc1ba('0x87')]);}}return _0x3c4161[_0xc1ba('0x90')](_0x1c39e9);}})[_0xc1ba('0x5b')](handleError(_0x3c4161,null));};function checkWebsiteInterval(_0xc30ddf){var _0x1ca036=_0xc30ddf[_0xc1ba('0x99')];if(!_0x1ca036){return Promise['resolve'](_0xc30ddf);}var _0x3a33e3=_0xc30ddf[_0xc1ba('0x9a')]||undefined;return _0x1ca036[_0xc1ba('0x9b')](_0x3a33e3)[_0xc1ba('0x18')](function(_0x3a83d8){if(!_0x3a83d8){throw new APIOutOfIntervalError();}return _0xc30ddf;});}exports[_0xc1ba('0x9c')]=function(_0x599db3,_0x800175){var _0x37e473={'body':_0x599db3[_0xc1ba('0x60')],'channel':_0xc1ba('0x9d')};var _0x302742=[];var _0x51a088=[];var _0x23d133={};var _0x20df72=![];if(_0x599db3[_0xc1ba('0x60')]['id']){delete _0x599db3[_0xc1ba('0x60')]['id'];}if(_['isNil'](_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x9e')])){throw new APIBadRequestError(_0xc1ba('0x9f'));}if(_[_0xc1ba('0x8d')](_0x599db3['body'][_0xc1ba('0xa0')])){throw new APIBadRequestError(_0xc1ba('0xa1'));}if(_[_0xc1ba('0xa2')](_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x60')])){throw new APIBadRequestError(_0xc1ba('0xa3'));}var _0x31584c=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x33')]&&_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x3a')];return db[_0xc1ba('0xa4')][_0xc1ba('0x6f')]()[_0xc1ba('0x18')](function(_0x5a6be6){if(!_0x5a6be6){throw new Error('No\x20available\x20attributes');}_0x302742=Object[_0xc1ba('0x4b')](_0x5a6be6)[_0xc1ba('0x56')](function(_0xc47c2){return![_0xc1ba('0xa5'),_0xc1ba('0xa6')][_0xc1ba('0xa7')](_0xc47c2);});_0x51a088=Object[_0xc1ba('0x4b')](_0x5a6be6)[_0xc1ba('0x56')](function(_0x36b053){return![_0xc1ba('0xa5'),_0xc1ba('0xa6'),_0xc1ba('0xa8'),'ListId'][_0xc1ba('0xa7')](_0x36b053);});if(!_[_0xc1ba('0xa7')](_0x51a088,_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xa0')])){throw new APIBadRequestError(_0xc1ba('0xa9')+_0x51a088[_0xc1ba('0x8e')](',\x20'));}_0x23d133[_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xa0')]]=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x9e')];})['then'](function(){return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x599db3['params']['id']},'include':[{'model':db[_0xc1ba('0xaa')],'as':_0xc1ba('0xab'),'include':[{'model':db['CmContact'],'as':_0xc1ba('0xac'),'where':_0x23d133,'limit':0x1,'order':[[_0xc1ba('0xa6'),_0xc1ba('0xad')]]}]},{'model':db[_0xc1ba('0xae')],'as':_0xc1ba('0xaf')},{'model':db[_0xc1ba('0x99')],'as':_0xc1ba('0x99'),'include':[{'model':db['Interval'],'as':_0xc1ba('0xb0'),'attributes':['id','interval'],'raw':!![]}]}]});})['then'](function(_0x2d45dd){if(!_0x2d45dd){throw new APINotFoundError(util[_0xc1ba('0x3c')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x599db3[_0xc1ba('0x5d')]['id']));}if(_0x31584c){return checkWebsiteInterval(_0x2d45dd);}return _0x2d45dd;})['then'](function(_0x1eefd5){_0x37e473[_0xc1ba('0xb1')]=_0x1eefd5;_0x37e473[_0xc1ba('0xb2')]=_[_0xc1ba('0xb3')](_0x1eefd5[_0xc1ba('0xaf')],[_0xc1ba('0xb4')],[_0xc1ba('0xb5')]);if(_0x37e473[_0xc1ba('0xb1')]['Applications']){delete _0x37e473[_0xc1ba('0xb1')][_0xc1ba('0xaf')];}_0x37e473[_0xc1ba('0xb6')]=_0x1eefd5[_0xc1ba('0xab')]||{'id':_0x1eefd5[_0xc1ba('0xb7')]};if(_0x37e473[_0xc1ba('0xb6')]&&_0x37e473['list'][_0xc1ba('0xac')][_0xc1ba('0x50')]){return _0x37e473[_0xc1ba('0xb6')][_0xc1ba('0xac')][0x0];}var _0x136edf=_[_0xc1ba('0xb8')](_0x599db3['body'],{'firstName':_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x9e')],'ListId':_0x1eefd5[_0xc1ba('0xb7')]});_0x136edf[_0x599db3['body']['mapKey']]=_0x599db3[_0xc1ba('0x60')]['from'];return db[_0xc1ba('0xa4')]['create'](_0x136edf,{'fields':_0x302742,'raw':!![]});})[_0xc1ba('0x18')](function(_0x35ce38){_0x37e473['contact']=_0x35ce38;var _0x6040cc=createInteractionObject(_0x599db3[_0xc1ba('0x5d')]['id'],_0x599db3[_0xc1ba('0x60')],_0x599db3[_0xc1ba('0xb9')],_0x35ce38);var _0x385fcc={'ChatWebsiteId':_0x599db3['params']['id']};if(_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xba')]){_0x385fcc['threadId']=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xba')];_0x385fcc[_0xc1ba('0xbb')]=![];return db[_0xc1ba('0xbc')][_0xc1ba('0x6c')]({'where':_0x385fcc})[_0xc1ba('0x18')](function(_0x54fda8){var _0x11e02e=_0x599db3[_0xc1ba('0x60')]['customerIp']&&_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x3a')];if(_0x54fda8){_0x20df72=!![];return _0x54fda8;}else if(!_0x11e02e&&_0x54fda8&&_0x54fda8[_0xc1ba('0xbb')]){throw new APIConflictError(_0xc1ba('0xbd'));}_0x6040cc[_0xc1ba('0xba')]=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xba')];_0x6040cc[_0xc1ba('0xbe')]=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xbe')];return db[_0xc1ba('0xbc')][_0xc1ba('0x67')](_0x6040cc);});}_0x385fcc['ContactId']=_0x35ce38['id'];if(_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xbf')]&&_0x599db3['body'][_0xc1ba('0xbf')]['id']){_0x385fcc['id']=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xbf')]['id'];return db[_0xc1ba('0xbc')][_0xc1ba('0x6c')]({'where':_0x385fcc})[_0xc1ba('0x18')](function(_0x35e660){var _0x32b355=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x33')]&&_0x599db3['body'][_0xc1ba('0x3a')];if(!_0x32b355&&_0x35e660&&_0x35e660[_0xc1ba('0xbb')]){throw new APIConflictError(_0xc1ba('0xbd'));}else if(_0x35e660){_0x20df72=!![];return _0x35e660;}else{return db['ChatInteraction'][_0xc1ba('0x67')](_0x6040cc);}});}return db['ChatInteraction'][_0xc1ba('0x67')](_0x6040cc);})[_0xc1ba('0x18')](function(_0x58b1b9){if(!_0x20df72){return _0x58b1b9;}var _0x1b15f6={'from':(_0x37e473[_0xc1ba('0xc0')][_0xc1ba('0x37')]||'')+'\x20'+(_0x37e473[_0xc1ba('0xc0')][_0xc1ba('0x38')]||'')};if(_0x599db3['body'][_0xc1ba('0xba')]&&_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xc1')]&&_0x599db3['body'][_0xc1ba('0xba')]!=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xc1')]){_0x1b15f6[_0xc1ba('0xba')]=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xc1')];}return _0x58b1b9['update'](_0x1b15f6);})['then'](function(_0x3753c9){_0x37e473[_0xc1ba('0xbf')]=_0x3753c9['get']({'plain':!![]});_0x37e473['interaction'][_0xc1ba('0xc2')]=!_0x20df72;if(_0x37e473['interaction'][_0xc1ba('0xc2')]){if(_0x37e473[_0xc1ba('0xb1')][_0xc1ba('0xc3')]){_0x37e473[_0xc1ba('0xb2')][_0xc1ba('0xc4')]({'id':0x0,'priority':_0x37e473['applications'][_0xc1ba('0x50')]+0x1,'app':'close','appdata':_0xc1ba('0xc5'),'interval':_0xc1ba('0xc6')});}}return db[_0xc1ba('0xc7')][_0xc1ba('0x67')]({'body':_0x599db3[_0xc1ba('0x60')]['body'],'ChatWebsiteId':_0x599db3['params']['id'],'ChatInteractionId':_0x3753c9['id'],'direction':'in','ContactId':_0x37e473[_0xc1ba('0xc0')]['id'],'AttachmentId':_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xc8')]});})[_0xc1ba('0x18')](function(_0x3e9229){_0x37e473[_0xc1ba('0x1f')]=_0x3e9229;if(!_0x37e473[_0xc1ba('0xbf')][_0xc1ba('0xc9')]){return;}return db[_0xc1ba('0xca')][_0xc1ba('0x6c')]({'attributes':['id',_0xc1ba('0x2f')],'where':{'id':_0x37e473['interaction']['UserId']}});})[_0xc1ba('0x18')](function(_0x104b31){if(_0x104b31){_0x37e473['applications'][_0xc1ba('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x104b31[_0xc1ba('0x2f')]+','+(_0x37e473[_0xc1ba('0xb1')][_0xc1ba('0xcc')]||0xa),'interval':'*,*,*,*'});_0x37e473['forcedOwnership']=!![];}if(!_0x37e473['interaction']['queueId']){return;}return db[_0xc1ba('0xcd')][_0xc1ba('0x6c')]({'attributes':['id','name'],'where':{'id':_0x37e473[_0xc1ba('0xbf')]['queueId']}});})[_0xc1ba('0x18')](function(_0x3d28e9){if(_0x3d28e9){_0x37e473[_0xc1ba('0xb2')][_0xc1ba('0xcb')]({'id':0x0,'priority':0x1,'app':_0xc1ba('0xce'),'appdata':_0x3d28e9['name']+','+(_0x37e473[_0xc1ba('0xb1')][_0xc1ba('0xcf')]||0x12c),'interval':_0xc1ba('0xc6')});}return respondWithRpcPromise(_0xc1ba('0xd0'),_0xc1ba('0xd1'),_0x37e473);})[_0xc1ba('0x18')](function(_0x3802d1){respondWithRpcPromise('EventManager',_0xc1ba('0xd2'),{'event':_0xc1ba('0x9c'),'message':_0x3802d1},client9002);return _0x3802d1;})[_0xc1ba('0x18')](respondWithResult(_0x800175,null))[_0xc1ba('0x5b')](APIHandleError(_0x800175));};exports['offline']=function(_0x5c76ea,_0x9aa0dc){var _0x53c63d,_0x54159b,_0x136563;var _0x366b1c=[];var _0x21c0f7={};var _0x557fba=_0x5c76ea['files']||[];var _0x3c87a9=[];var _0x7c8b11;return db[_0xc1ba('0xa4')][_0xc1ba('0x6f')]()['then'](function(_0x5ac0bc){if(!_0x5ac0bc){throw new db[(_0xc1ba('0xd3'))]['ValidationError']('no\x20available\x20attributes');}_0x366b1c=_[_0xc1ba('0xd4')](_[_0xc1ba('0x4b')](_0x5ac0bc),[_0xc1ba('0xa5'),_0xc1ba('0xa6'),_0xc1ba('0xa8'),_0xc1ba('0xb7')]);if(_0x5c76ea[_0xc1ba('0x60')]['id']){delete _0x5c76ea[_0xc1ba('0x60')]['id'];}if(_[_0xc1ba('0x8d')](_0x5c76ea[_0xc1ba('0x60')][_0xc1ba('0x9e')])){throw _0x9aa0dc[_0xc1ba('0x21')](0x1f4)['send'](new db['Sequelize'][(_0xc1ba('0xd5'))](_0xc1ba('0xd6')));}if(_['isNil'](_0x5c76ea[_0xc1ba('0x60')]['body'])||_0x5c76ea[_0xc1ba('0x60')][_0xc1ba('0x60')]===''){throw _0x9aa0dc['status'](0x1f4)[_0xc1ba('0xd7')](new db['Sequelize']['ValidationError'](_0xc1ba('0xd8')));}if(_['isNil'](_0x5c76ea[_0xc1ba('0x60')][_0xc1ba('0xd9')])){throw _0x9aa0dc['status'](0x1f4)[_0xc1ba('0xd7')](new db[(_0xc1ba('0xd3'))][(_0xc1ba('0xd5'))](_0xc1ba('0xda')+_0x366b1c));}if(!_[_0xc1ba('0xa7')](_0x366b1c,_0x5c76ea[_0xc1ba('0x60')][_0xc1ba('0xd9')])){throw _0x9aa0dc[_0xc1ba('0x21')](0x1f4)['send'](new db[(_0xc1ba('0xd3'))]['ValidationError'](_0xc1ba('0xdb')+_0x366b1c));}_0x21c0f7[_0x5c76ea['body'][_0xc1ba('0xd9')]]=_0x5c76ea[_0xc1ba('0x60')][_0xc1ba('0x9e')];})[_0xc1ba('0x18')](function(){return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x5c76ea[_0xc1ba('0x5d')]['id']},'include':[{'model':db[_0xc1ba('0xaa')],'as':_0xc1ba('0xab')},{'model':db[_0xc1ba('0xdc')],'as':_0xc1ba('0xdc')}]});})[_0xc1ba('0x18')](handleEntityNotFound(_0x9aa0dc,null))['then'](function(_0x20acd5){if(_0x20acd5&&_0x20acd5[_0xc1ba('0xab')]){_0x54159b=_0x20acd5;var _0x45c38b=_[_0xc1ba('0xb8')](_0x5c76ea[_0xc1ba('0x60')],{'firstName':_0x5c76ea[_0xc1ba('0x60')]['from'],'phone':_0x5c76ea['body'][_0xc1ba('0x9e')],'ListId':_0x20acd5[_0xc1ba('0xb7')]});_0x45c38b[_0x5c76ea[_0xc1ba('0x60')]['mapKeyOffline']]=_0x5c76ea[_0xc1ba('0x60')]['from'];return db['CmContact']['findOrCreate']({'where':_0x21c0f7,'defaults':_0x45c38b});}})[_0xc1ba('0xdd')](function(_0x4e7e31){if(_0x4e7e31){_0x136563=_0x4e7e31;var _0x38ccd5=fs[_0xc1ba('0xde')](path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0xdf')),'utf8');var _0x1c0f77=ejs[_0xc1ba('0xe0')](_0x38ccd5,{'body':_[_0xc1ba('0xe1')](_0x5c76ea['body'][_0xc1ba('0x60')]),'bodyTitle':_0x54159b[_0xc1ba('0xe2')]});return db[_0xc1ba('0xe3')][_0xc1ba('0x67')]({'body':_0x1c0f77,'plainBody':htmlToText[_0xc1ba('0xe4')](_0x1c0f77),'ContactId':_0x4e7e31['id'],'ChatWebsiteId':_0x54159b['id']});}})[_0xc1ba('0x18')](function(_0x487100){_0x7c8b11=_0x487100;if(_0x557fba['length']){var _0x4cc4dc=_0x557fba[_0xc1ba('0x46')](function(_0x14311f){return{'name':_0x14311f[_0xc1ba('0xe5')],'basename':_0x14311f[_0xc1ba('0x82')],'type':_0x14311f[_0xc1ba('0xe6')],'ChatOfflineMessageId':_0x487100['id']};});_0x3c87a9=_0x4cc4dc['map'](_0x14a75a=>{var _0x18eb92={'filename':_0x14a75a[_0xc1ba('0x2f')],'path':path[_0xc1ba('0x8e')](config['root'],_0xc1ba('0xe7'),'files','attachments',_0xc1ba('0xe8'),_0x14a75a[_0xc1ba('0xe9')])};return _0x18eb92;});if(!_0x54159b[_0xc1ba('0xea')]){return db[_0xc1ba('0xeb')][_0xc1ba('0xec')](function(_0x4ed101){return db['Attachment'][_0xc1ba('0xed')](_0x4cc4dc,{'transaction':_0x4ed101});});}}})[_0xc1ba('0x18')](function(){if(_0x7c8b11){_0x53c63d=_0x7c8b11;return db[_0xc1ba('0xdc')][_0xc1ba('0x73')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xc1ba('0xee'),'raw':!![],'include':[{'model':db[_0xc1ba('0xef')],'as':_0xc1ba('0xef'),'raw':!![]}]}]});}})[_0xc1ba('0x18')](function(_0x48f18f){if(_0x48f18f&&_0x48f18f['Smtp']&&_0x54159b['forwardOffline']&&_0x54159b[_0xc1ba('0xf0')]){var _0x3d76a9=_0x48f18f[_0xc1ba('0xf1')]();return respondWithRpcPromise(_0xc1ba('0xf2'),_0xc1ba('0xf3'),{'account':_0x3d76a9,'message':{'from':util[_0xc1ba('0x3c')](_0xc1ba('0xf4'),_0x48f18f[_0xc1ba('0x2f')],_0x48f18f[_0xc1ba('0xf5')]||_0x48f18f['Smtp'][_0xc1ba('0x69')]),'to':_0x54159b['forwardOfflineAddress'],'subject':_0x54159b[_0xc1ba('0xf6')],'html':_0x53c63d[_0xc1ba('0x60')],'attachments':_0x3c87a9}},client9003)[_0xc1ba('0x18')](function(){return _0x53c63d;})['catch'](function(_0x27dae7){logger['error'](_0x27dae7);});}})[_0xc1ba('0x18')](function(){if(_0x54159b&&_0x54159b[_0xc1ba('0xea')]&&_0x54159b[_0xc1ba('0xf7')]){var _0x45b8d1=[];if(_0x557fba['length']){_0x45b8d1=_0x557fba['map'](function(_0x1234a4){return{'name':_0x1234a4[_0xc1ba('0xe5')],'basename':_0x1234a4[_0xc1ba('0x82')],'type':_0x1234a4[_0xc1ba('0xe6')],'ChatOfflineMessageId':_0x7c8b11['id']};});}var _0x178b52;if(!_[_0xc1ba('0x8d')](_0x54159b[_0xc1ba('0xf8')])){var _0x5d24c5=_[_0xc1ba('0x46')](_0x5c76ea[_0xc1ba('0x60')],function(_0x242cb1){return _0x242cb1;});var _0x2b834e=_[_0xc1ba('0xf9')](_0x5d24c5)[0x0];var _0x87ebd9=_[_0xc1ba('0xfa')](_0x2b834e,function(_0x30e160){return _0x30e160;});_0x178b52=_0x87ebd9[0x1][_0x54159b[_0xc1ba('0xf8')]];}var _0x312e52={'from':_0x136563[_0xc1ba('0xf5')],'firstName':_0x136563[_0xc1ba('0x37')],'lastName':_0x136563[_0xc1ba('0x38')],'mapKey':'email','message':{'from':_0x136563[_0xc1ba('0xf5')],'to':_0x54159b[_0xc1ba('0xdc')]['email'],'cc':'','subject':_['isNil'](_0x178b52)?_0x54159b[_0xc1ba('0xf6')]:_0x178b52,'messageId':'','sentAt':new Date(),'attach':_0x45b8d1[_0xc1ba('0x50')],'attachments':_0x45b8d1,'originChannel':_0xc1ba('0xfb'),'ChatWebsiteId':_0x54159b['id'],'ChatOfflineMessageId':_0x53c63d['id'],'originTo':_0x54159b[_0xc1ba('0xdc')][_0xc1ba('0xf5')]},'body':_0x53c63d['body']};var _0x40bc67={'account':{'id':_0x54159b[_0xc1ba('0xf7')]},'body':_0x312e52,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xc1ba('0xfc'),_0x40bc67,client9001)[_0xc1ba('0x18')](function(){return _0x53c63d;})[_0xc1ba('0x5b')](function(_0x28e307){logger['error'](_0x28e307);});}return;})[_0xc1ba('0x18')](function(){if(_0x53c63d){return _0x53c63d;}})[_0xc1ba('0x18')](respondWithResult(_0x9aa0dc,null))[_0xc1ba('0x5b')](function(){for(var _0x1146c9 of _0x557fba){var _0x3174a3=path['join'](config[_0xc1ba('0x89')],'server','files','attachments',_0xc1ba('0xe8'),_0x1146c9['filename']);fs_extra[_0xc1ba('0xfd')](_0x3174a3)['catch'](function(_0x409af4){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x3174a3,_0x409af4);});}});};exports[_0xc1ba('0xfe')]=function(_0x4f2ac6,_0x5174d8){return db[_0xc1ba('0xbc')][_0xc1ba('0x6c')]({'where':{'id':_0x4f2ac6['params']['id']}})['then'](handleEntityNotFound(_0x5174d8,null))['then'](function(_0x476ec6){if(_0x476ec6){return _0x476ec6[_0xc1ba('0xfe')](_0x4f2ac6[_0xc1ba('0x60')][_0xc1ba('0x7a')],_[_0xc1ba('0xff')](_0x4f2ac6[_0xc1ba('0x60')],['ids','id'])||{});}})[_0xc1ba('0x18')](respondWithResult(_0x5174d8,null))['catch'](handleError(_0x5174d8,null));};exports[_0xc1ba('0x100')]=function(_0x3606ca,_0x3587d2){var _0x572f42={'raw':![],'where':{}};var _0x55790f={};var _0x25695f={'count':0x0,'rows':[]};return db[_0xc1ba('0x47')][_0xc1ba('0x73')]({'where':{'id':_0x3606ca[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x3587d2,null))[_0xc1ba('0x18')](function(_0x2d558a){if(_0x2d558a){_0x55790f[_0xc1ba('0x41')]=_['keys'](db[_0xc1ba('0xbc')]['rawAttributes']);_0x55790f[_0xc1ba('0x4e')]=_[_0xc1ba('0x4b')](_0x3606ca[_0xc1ba('0x4e')]);_0x55790f[_0xc1ba('0x4c')]=_['intersection'](_0x55790f['model'],_0x55790f[_0xc1ba('0x4e')]);_0x572f42[_0xc1ba('0x4f')]=_['intersection'](_0x55790f[_0xc1ba('0x41')],qs[_0xc1ba('0x5f')](_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x5f')]));_0x572f42['attributes']=_0x572f42[_0xc1ba('0x4f')][_0xc1ba('0x50')]?_0x572f42[_0xc1ba('0x4f')]:_0x55790f['model'];if(!_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x51')]('nolimit')){_0x572f42[_0xc1ba('0x24')]=qs['limit'](_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x24')]);_0x572f42['offset']=qs['offset'](_0x3606ca[_0xc1ba('0x4e')]['offset']);}_0x572f42[_0xc1ba('0x74')]=qs[_0xc1ba('0x53')](_0x3606ca[_0xc1ba('0x4e')]['sort']);_0x572f42[_0xc1ba('0x54')]=qs[_0xc1ba('0x4c')](_['pick'](_0x3606ca[_0xc1ba('0x4e')],_0x55790f['filters']));_0x572f42[_0xc1ba('0x54')][_0xc1ba('0x76')]=_0x2d558a['id'];if(_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x572f42[_0xc1ba('0x54')]=_['merge'](_0x572f42['where'],{'$or':_[_0xc1ba('0x46')](_0x572f42['attributes'],function(_0xf16407){var _0x1c56e1={};_0x1c56e1[_0xf16407]={'$like':'%'+_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x56')]+'%'};return _0x1c56e1;})});}_0x572f42=_[_0xc1ba('0x57')]({},_0x572f42,_0x3606ca[_0xc1ba('0x58')]);return db[_0xc1ba('0xbc')][_0xc1ba('0x26')]({'where':_0x572f42['where']})[_0xc1ba('0x18')](function(_0x37ed73){_0x25695f['count']=_0x37ed73;if(_0x3606ca['query'][_0xc1ba('0x59')]){_0x572f42['include']=[{'model':db[_0xc1ba('0xa4')],'as':'Contact','required':![]},{'model':db[_0xc1ba('0xca')],'as':_0xc1ba('0x101'),'attributes':['name',_0xc1ba('0x102'),_0xc1ba('0x103')],'required':![]},{'model':db[_0xc1ba('0x104')],'as':_0xc1ba('0x105'),'attributes':['id','name',_0xc1ba('0x106')],'where':_0x3606ca[_0xc1ba('0x4e')]['tag']?{'id':_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x107')]}:undefined,'required':_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x107')]?!![]:![]}];}return db[_0xc1ba('0xbc')][_0xc1ba('0x5a')](_0x572f42);})[_0xc1ba('0x18')](function(_0x1b34f8){_0x25695f['rows']=_0x1b34f8;return _0x25695f;});}})[_0xc1ba('0x18')](respondWithFilteredResult(_0x3587d2,_0x572f42))[_0xc1ba('0x5b')](handleError(_0x3587d2,null));};exports[_0xc1ba('0x108')]=function(_0x4ce112,_0x8d81c6){var _0x31ecaf=0x0;var _0x223b8e=0x0;var _0x9cc0c3=![];var _0x54a086;var _0x2b3250;return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x4ce112[_0xc1ba('0x5d')]['id']},'include':[{'model':db[_0xc1ba('0x99')],'as':_0xc1ba('0x99'),'include':[{'model':db[_0xc1ba('0x99')],'as':_0xc1ba('0xb0'),'attributes':['id',_0xc1ba('0x109')]}]}]})[_0xc1ba('0x18')](handleEntityNotFound(_0x8d81c6,null))['then'](function(_0x2cc74d){if(_0x2cc74d){_0x54a086=_0x2cc74d;return _0x2cc74d[_0xc1ba('0x10a')]({'raw':!![]});}})['then'](function(_0x32646e){if(_0x54a086){if(_0x32646e){_0x2b3250=_0x32646e;}}return require('../../config/license/util')[_0xc1ba('0x8b')]();})['then'](function(_0x29f5c4){if(_0x29f5c4){_0x223b8e=_0x29f5c4[_0xc1ba('0x10b')];_0x9cc0c3=_0x29f5c4[_0xc1ba('0x8c')];}})[_0xc1ba('0x18')](function(){return db['ChatInteraction'][_0xc1ba('0x26')]({'where':{'closed':![]}});})[_0xc1ba('0x18')](function(_0xaddac8){_0x31ecaf=_0xaddac8;if(_0x223b8e&&_0xaddac8>_0x223b8e){return db[_0xc1ba('0x10c')][_0xc1ba('0x73')]({'where':{'id':0x1}})[_0xc1ba('0x18')](function(_0x226083){if(_0x226083){_0x226083[_0xc1ba('0x10d')]('chatLicenseExceeded');}});}})[_0xc1ba('0x18')](function(){var _0x3e5867=_0x54a086[_0xc1ba('0x99')];var _0x5575a4=_0x54a086['timezone']||undefined;return _0x3e5867?_0x3e5867[_0xc1ba('0x9b')](_0x5575a4):!![];})[_0xc1ba('0x18')](function(_0x32d67c){var _0x4972d6=fs['readFileSync'](path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0x10e')),_0xc1ba('0x10f'));var _0x6e3d39=_0xc1ba('0x110');var _0x22ed63=![];var _0x573060,_0x528f1f;if(_0x4ce112[_0xc1ba('0xb9')][_0xc1ba('0x3a')]){_0x573060=new URL(_0x4ce112[_0xc1ba('0xb9')][_0xc1ba('0x3a')])[_0xc1ba('0x111')];}else if(_0x4ce112[_0xc1ba('0xb9')][_0xc1ba('0x111')]){_0x573060=new URL(_0x4ce112[_0xc1ba('0xb9')][_0xc1ba('0x111')])['origin'];}else{_0x573060=_0xc1ba('0x112');}_0x528f1f=typeof _0x54a086[_0xc1ba('0x61')][_0xc1ba('0x62')](',')[_0xc1ba('0x6c')](function(_0x3da800){return wildcardUtils[_0xc1ba('0x113')](_0x3da800,_0x573060);})!==_0xc1ba('0x25');var _0x5734de={'chatVersion':_0x6e3d39,'chatWebsiteAddressOrigin':_0x528f1f?_0x573060:_0x54a086[_0xc1ba('0x61')],'remote':_0x54a086[_0xc1ba('0x114')],'query':querystring[_0xc1ba('0x1b')](_[_0xc1ba('0x57')](_0x54a086[_0xc1ba('0x6a')]({'plain':!![]}),{'customerIp':_0x4ce112[_0xc1ba('0xb9')][_0xc1ba('0x35')]||_0x4ce112['headers'][_0xc1ba('0x115')]||_0x4ce112[_0xc1ba('0x116')][_0xc1ba('0x117')]||_0x4ce112['ip'],'referer':_0x4ce112[_0xc1ba('0xb9')][_0xc1ba('0x3a')],'openedInteractions':_0x31ecaf,'maxInteractions':_0x223b8e,'virtual':_0x9cc0c3[_0xc1ba('0x10b')],'online':_0x32d67c,'custom':_0x9cc0c3,'address':_0x528f1f?_0x573060:null}))[_0xc1ba('0x118')](/'/g,'\x5c\x27')};_0x8d81c6[_0xc1ba('0xd7')](ejs['render'](Mustache[_0xc1ba('0xe0')](_0x4972d6,_0x5734de),{'proactiveActions':_0x2b3250,'alignment':_0x54a086[_0xc1ba('0x119')],'verticalAlignment':_0x54a086[_0xc1ba('0x11a')],'div_color':_0x54a086['color'],'labelText':_0x54a086[_0xc1ba('0x11b')],'text_color':_0x54a086['textColor'],'text_button_color':_0x54a086[_0xc1ba('0x11c')],'button_color':_0x54a086['color_button'],'background_color':_0x54a086[_0xc1ba('0x11d')],'hideWhenOffline':_0x54a086[_0xc1ba('0x11e')],'intervalId':_0x54a086[_0xc1ba('0x11f')],'isDevelopment':_0x22ed63,'chatVersion':_0x6e3d39}));})[_0xc1ba('0x5b')](handleError(_0x8d81c6,null));};exports[_0xc1ba('0x120')]=function(_0x26343d,_0x3e27b4){var _0x54f94b=_0x26343d[_0xc1ba('0x5d')]['id'];var _0x21673e=_0x26343d['body'];var _0x3c9f04=0xc8;var _0x5dc1df=null;return db[_0xc1ba('0xeb')][_0xc1ba('0xec')]({'isolationLevel':db[_0xc1ba('0xeb')][_0xc1ba('0x121')][_0xc1ba('0x122')][_0xc1ba('0x123')]},function(_0x99f87){return db[_0xc1ba('0x47')][_0xc1ba('0x73')]({'where':{'id':_0x54f94b},'transaction':_0x99f87})[_0xc1ba('0x18')](function(_0x36b6ee){if(_0x36b6ee){return db[_0xc1ba('0xae')]['destroy']({'where':{'ChatWebsiteId':_0x54f94b},'transaction':_0x99f87})['then'](function(){var _0x230796=_[_0xc1ba('0x46')](_0x21673e,function(_0x1be48c){_0x1be48c['ChatWebsiteId']=_0x54f94b;return _0x1be48c;});return db[_0xc1ba('0xae')]['bulkCreate'](_0x230796,{'transaction':_0x99f87});});}else{_0x3c9f04=0x194;_0x5dc1df=[];}});})[_0xc1ba('0x18')](function(){if(_0x3c9f04!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x54f94b},'order':_0xc1ba('0xb4')})[_0xc1ba('0x18')](function(_0x59d09f){_0x5dc1df=_0x59d09f;});}})[_0xc1ba('0x5b')](function(_0x477b8f){_0x3c9f04=0x1f4;logger[_0xc1ba('0x1c')](_0x477b8f[_0xc1ba('0x2e')]);if(_0x477b8f[_0xc1ba('0x2f')]){delete _0x477b8f[_0xc1ba('0x2f')];}_0x5dc1df=_0x477b8f;})[_0xc1ba('0x124')](function(){if(_0x5dc1df===null){_0x3e27b4['sendStatus'](_0x3c9f04);}else{if(_0x3c9f04===0x1f4){_0x3e27b4[_0xc1ba('0x21')](_0x3c9f04)['send'](_0x5dc1df);}else{_0x3e27b4[_0xc1ba('0x21')](_0x3c9f04)[_0xc1ba('0x23')](_0x5dc1df);}}});};exports[_0xc1ba('0x125')]=function(_0x58e1e0,_0x330783){var _0x6c3f28={};var _0xef66ce={};var _0x362db8;var _0x271c32;return db['ChatWebsite']['findOne']({'where':{'id':_0x58e1e0[_0xc1ba('0x5d')]['id']}})['then'](handleEntityNotFound(_0x330783,null))[_0xc1ba('0x18')](function(_0x5376ee){if(_0x5376ee){_0x362db8=_0x5376ee;_0xef66ce[_0xc1ba('0x41')]=_['keys'](db[_0xc1ba('0xae')]['rawAttributes']);_0xef66ce[_0xc1ba('0x4e')]=_[_0xc1ba('0x4b')](_0x58e1e0['query']);_0xef66ce[_0xc1ba('0x4c')]=_[_0xc1ba('0x4d')](_0xef66ce['model'],_0xef66ce['query']);_0x6c3f28[_0xc1ba('0x4f')]=_[_0xc1ba('0x4d')](_0xef66ce[_0xc1ba('0x41')],qs[_0xc1ba('0x5f')](_0x58e1e0[_0xc1ba('0x4e')][_0xc1ba('0x5f')]));_0x6c3f28['attributes']=_0x6c3f28['attributes'][_0xc1ba('0x50')]?_0x6c3f28[_0xc1ba('0x4f')]:_0xef66ce[_0xc1ba('0x41')];_0x6c3f28[_0xc1ba('0x74')]=qs['sort'](_0x58e1e0[_0xc1ba('0x4e')][_0xc1ba('0x53')]);_0x6c3f28[_0xc1ba('0x54')]=qs[_0xc1ba('0x4c')](_[_0xc1ba('0x75')](_0x58e1e0[_0xc1ba('0x4e')],_0xef66ce['filters']));if(_0x58e1e0[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x6c3f28['where']=_['merge'](_0x6c3f28[_0xc1ba('0x54')],{'$or':_[_0xc1ba('0x46')](_0x6c3f28[_0xc1ba('0x4f')],function(_0xf87c8b){var _0x11119c={};_0x11119c[_0xf87c8b]={'$like':'%'+_0x58e1e0[_0xc1ba('0x4e')]['filter']+'%'};return _0x11119c;})});}_0x6c3f28=_['merge']({},_0x6c3f28,_0x58e1e0['options']);return _0x362db8[_0xc1ba('0x125')](_0x6c3f28);}})[_0xc1ba('0x18')](function(_0x416f01){if(_0x416f01){_0x271c32=_0x416f01[_0xc1ba('0x50')];if(!_0x58e1e0[_0xc1ba('0x4e')][_0xc1ba('0x51')](_0xc1ba('0x52'))){_0x6c3f28[_0xc1ba('0x24')]=qs[_0xc1ba('0x24')](_0x58e1e0[_0xc1ba('0x4e')][_0xc1ba('0x24')]);_0x6c3f28[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x58e1e0['query'][_0xc1ba('0x27')]);}return _0x362db8['getApplications'](_0x6c3f28);}})[_0xc1ba('0x18')](function(_0x3d1de0){if(_0x3d1de0){return _0x3d1de0?{'count':_0x271c32,'rows':_0x3d1de0}:null;}})[_0xc1ba('0x18')](respondWithResult(_0x330783,null))[_0xc1ba('0x5b')](handleError(_0x330783,null));};exports[_0xc1ba('0x126')]=function(_0x12821f,_0x33e929){return db[_0xc1ba('0x127')]['find']({'where':{'id':_0x12821f[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x33e929,null))[_0xc1ba('0x18')](function(_0x487392){if(_0x487392){return _0x487392[_0xc1ba('0x126')](_0x12821f[_0xc1ba('0x60')]['ids'],_[_0xc1ba('0xff')](_0x12821f[_0xc1ba('0x60')],['ids','id'])||{});}})[_0xc1ba('0x18')](respondWithResult(_0x33e929,null))['catch'](handleError(_0x33e929,null));};exports['getProactiveActions']=function(_0x741fb7,_0x2080bc){var _0x293aa9={};var _0x538319={};var _0x2824d5;var _0x581523;return db['ChatWebsite'][_0xc1ba('0x73')]({'where':{'id':_0x741fb7[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x2080bc,null))[_0xc1ba('0x18')](function(_0xdd5ae6){if(_0xdd5ae6){_0x2824d5=_0xdd5ae6;_0x538319[_0xc1ba('0x41')]=_[_0xc1ba('0x4b')](db[_0xc1ba('0x128')][_0xc1ba('0x48')]);_0x538319[_0xc1ba('0x4e')]=_[_0xc1ba('0x4b')](_0x741fb7[_0xc1ba('0x4e')]);_0x538319[_0xc1ba('0x4c')]=_[_0xc1ba('0x4d')](_0x538319[_0xc1ba('0x41')],_0x538319[_0xc1ba('0x4e')]);_0x293aa9['attributes']=_[_0xc1ba('0x4d')](_0x538319[_0xc1ba('0x41')],qs['fields'](_0x741fb7[_0xc1ba('0x4e')][_0xc1ba('0x5f')]));_0x293aa9[_0xc1ba('0x4f')]=_0x293aa9[_0xc1ba('0x4f')][_0xc1ba('0x50')]?_0x293aa9[_0xc1ba('0x4f')]:_0x538319[_0xc1ba('0x41')];_0x293aa9[_0xc1ba('0x74')]=qs[_0xc1ba('0x53')](_0x741fb7[_0xc1ba('0x4e')][_0xc1ba('0x53')]);_0x293aa9[_0xc1ba('0x54')]=qs[_0xc1ba('0x4c')](_[_0xc1ba('0x75')](_0x741fb7[_0xc1ba('0x4e')],_0x538319[_0xc1ba('0x4c')]));if(_0x741fb7[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x293aa9[_0xc1ba('0x54')]=_[_0xc1ba('0x57')](_0x293aa9[_0xc1ba('0x54')],{'$or':_[_0xc1ba('0x46')](_0x293aa9[_0xc1ba('0x4f')],function(_0x44ea99){var _0x8772fb={};_0x8772fb[_0x44ea99]={'$like':'%'+_0x741fb7[_0xc1ba('0x4e')]['filter']+'%'};return _0x8772fb;})});}_0x293aa9=_['merge']({},_0x293aa9,_0x741fb7[_0xc1ba('0x58')]);return _0x2824d5[_0xc1ba('0x10a')](_0x293aa9);}})['then'](function(_0x5c55b0){if(_0x5c55b0){_0x581523=_0x5c55b0[_0xc1ba('0x50')];if(!_0x741fb7[_0xc1ba('0x4e')][_0xc1ba('0x51')](_0xc1ba('0x52'))){_0x293aa9[_0xc1ba('0x24')]=qs['limit'](_0x741fb7[_0xc1ba('0x4e')]['limit']);_0x293aa9[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x741fb7[_0xc1ba('0x4e')][_0xc1ba('0x27')]);}return _0x2824d5[_0xc1ba('0x10a')](_0x293aa9);}})[_0xc1ba('0x18')](function(_0x35fcd1){if(_0x35fcd1){return _0x35fcd1?{'count':_0x581523,'rows':_0x35fcd1}:null;}})[_0xc1ba('0x18')](respondWithResult(_0x2080bc,null))['catch'](handleError(_0x2080bc,null));};exports[_0xc1ba('0x129')]=function(_0x388ae5,_0x378156){var _0x4543fc=_0x388ae5['query']['online']===_0xc1ba('0x12a')?_0xc1ba('0x12b'):_0xc1ba('0x12c');return db['ChatWebsite'][_0xc1ba('0x6c')]({'attributes':['id',_0x4543fc],'where':{'id':_0x388ae5['params']['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x378156,null))[_0xc1ba('0x18')](function(_0x5ce398){if(_0x5ce398){var _0x5b3a4d=_0x5ce398[_0x4543fc];var _0x232f0b=_0x5b3a4d&&_0x5b3a4d[_0xc1ba('0x12d')]?_0x5b3a4d[_0xc1ba('0x12d')]:[];_0x378156['send']({'fromKey':_[_0xc1ba('0x8d')](_0x5b3a4d['fromKey'])?undefined:_0x5b3a4d['fromKey'],'count':_0x232f0b['length'],'rows':_0x232f0b});}})['catch'](handleError(_0x378156,null));};exports[_0xc1ba('0x12e')]=function(_0x5a06b1,_0x204a93){var _0x58339f={'raw':![],'where':{}};var _0x2f5e63={};var _0x11b2b4={'count':0x0,'rows':[]};return db[_0xc1ba('0x47')][_0xc1ba('0x73')]({'where':{'id':_0x5a06b1[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x204a93,null))['then'](function(_0x3289b0){if(_0x3289b0){_0x2f5e63['model']=_[_0xc1ba('0x4b')](db[_0xc1ba('0xe3')][_0xc1ba('0x48')]);_0x2f5e63['query']=_[_0xc1ba('0x4b')](_0x5a06b1[_0xc1ba('0x4e')]);_0x2f5e63['filters']=_[_0xc1ba('0x4d')](_0x2f5e63[_0xc1ba('0x41')],_0x2f5e63[_0xc1ba('0x4e')]);_0x58339f['attributes']=_[_0xc1ba('0x4d')](_0x2f5e63['model'],qs[_0xc1ba('0x5f')](_0x5a06b1[_0xc1ba('0x4e')][_0xc1ba('0x5f')]));_0x58339f[_0xc1ba('0x4f')]=_0x58339f[_0xc1ba('0x4f')][_0xc1ba('0x50')]?_0x58339f[_0xc1ba('0x4f')]:_0x2f5e63[_0xc1ba('0x41')];if(!_0x5a06b1[_0xc1ba('0x4e')]['hasOwnProperty']('nolimit')){_0x58339f[_0xc1ba('0x24')]=qs[_0xc1ba('0x24')](_0x5a06b1['query'][_0xc1ba('0x24')]);_0x58339f[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x5a06b1[_0xc1ba('0x4e')][_0xc1ba('0x27')]);}_0x58339f[_0xc1ba('0x74')]=qs[_0xc1ba('0x53')](_0x5a06b1[_0xc1ba('0x4e')]['sort']);_0x58339f[_0xc1ba('0x54')]=qs[_0xc1ba('0x4c')](_[_0xc1ba('0x75')](_0x5a06b1[_0xc1ba('0x4e')],_0x2f5e63[_0xc1ba('0x4c')]));_0x58339f[_0xc1ba('0x54')]['ChatWebsiteId']=_0x3289b0['id'];if(_0x5a06b1[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x58339f[_0xc1ba('0x54')]=_[_0xc1ba('0x57')](_0x58339f['where'],{'$or':_[_0xc1ba('0x46')](_0x58339f[_0xc1ba('0x4f')],function(_0x2014c7){var _0x384864={};_0x384864[_0x2014c7]={'$like':'%'+_0x5a06b1[_0xc1ba('0x4e')][_0xc1ba('0x56')]+'%'};return _0x384864;})});}_0x58339f=_['merge']({},_0x58339f,_0x5a06b1['options']);return db[_0xc1ba('0xe3')][_0xc1ba('0x26')]({'where':_0x58339f[_0xc1ba('0x54')]})[_0xc1ba('0x18')](function(_0x401525){_0x11b2b4[_0xc1ba('0x26')]=_0x401525;if(_0x5a06b1['query']['includeAll']){_0x58339f[_0xc1ba('0x77')]=[{'all':!![]}];}else{_0x58339f[_0xc1ba('0x77')]=[{'model':db[_0xc1ba('0xa4')],'as':_0xc1ba('0x12f'),'required':![]},{'model':db[_0xc1ba('0x130')],'as':_0xc1ba('0x131'),'required':![]}];}return db['ChatOfflineMessage'][_0xc1ba('0x5a')](_0x58339f);})['then'](function(_0x1dadd2){_0x11b2b4[_0xc1ba('0x78')]=_0x1dadd2;return _0x11b2b4;});}})[_0xc1ba('0x18')](respondWithFilteredResult(_0x204a93,_0x58339f))[_0xc1ba('0x5b')](handleError(_0x204a93,null));};exports[_0xc1ba('0x132')]=function(_0x56b76b,_0x55295a){return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x56b76b[_0xc1ba('0x5d')]['id']}})['then'](handleEntityNotFound(_0x55295a,null))[_0xc1ba('0x18')](function(_0x1a04f8){if(_0x1a04f8){return _0x1a04f8[_0xc1ba('0x132')](_0x56b76b[_0xc1ba('0x60')][_0xc1ba('0x7a')],_[_0xc1ba('0xff')](_0x56b76b[_0xc1ba('0x60')],[_0xc1ba('0x7a'),'id'])||{})[_0xc1ba('0xdd')](function(_0x237a91){for(var _0x7d14f1=0x0;_0x7d14f1<_0x56b76b['body'][_0xc1ba('0x7a')][_0xc1ba('0x50')];_0x7d14f1+=0x1){socket[_0xc1ba('0x133')]('userChatWebsite:save',{'UserId':Number(_0x56b76b[_0xc1ba('0x60')]['ids'][_0x7d14f1]),'ChatWebsiteId':Number(_0x56b76b[_0xc1ba('0x5d')]['id'])});}return _0x237a91;});}})[_0xc1ba('0x18')](respondWithResult(_0x55295a,null))[_0xc1ba('0x5b')](handleError(_0x55295a,null));};exports[_0xc1ba('0x134')]=function(_0x48e5fd,_0x741ce0){return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x48e5fd[_0xc1ba('0x5d')]['id']}})['then'](handleEntityNotFound(_0x741ce0,null))[_0xc1ba('0x18')](function(_0x297026){if(_0x297026){return _0x297026[_0xc1ba('0x134')](_0x48e5fd[_0xc1ba('0x4e')][_0xc1ba('0x7a')])[_0xc1ba('0x18')](function(){if(_['isArray'](_0x48e5fd['query'][_0xc1ba('0x7a')])){for(var _0xd1983d=0x0;_0xd1983d<_0x48e5fd[_0xc1ba('0x4e')][_0xc1ba('0x7a')][_0xc1ba('0x50')];_0xd1983d+=0x1){socket[_0xc1ba('0x133')](_0xc1ba('0x135'),{'UserId':Number(_0x48e5fd[_0xc1ba('0x4e')][_0xc1ba('0x7a')][_0xd1983d]),'ChatWebsiteId':Number(_0x48e5fd[_0xc1ba('0x5d')]['id'])});}}else{socket[_0xc1ba('0x133')](_0xc1ba('0x135'),{'UserId':Number(_0x48e5fd[_0xc1ba('0x4e')][_0xc1ba('0x7a')]),'ChatWebsiteId':Number(_0x48e5fd[_0xc1ba('0x5d')]['id'])});}});}})[_0xc1ba('0x18')](respondWithStatusCode(_0x741ce0,null))[_0xc1ba('0x5b')](handleError(_0x741ce0,null));};exports['getAgents']=function(_0x11a338,_0x2eae28){var _0x256d9c={};var _0x4988b0={};var _0x2b8fa0;var _0x3446f9;return db[_0xc1ba('0x47')][_0xc1ba('0x73')]({'where':{'id':_0x11a338[_0xc1ba('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2eae28,null))[_0xc1ba('0x18')](function(_0x56c8ba){if(_0x56c8ba){_0x2b8fa0=_0x56c8ba;_0x4988b0[_0xc1ba('0x41')]=_['keys'](db[_0xc1ba('0xca')][_0xc1ba('0x48')]);_0x4988b0['query']=_[_0xc1ba('0x4b')](_0x11a338[_0xc1ba('0x4e')]);_0x4988b0[_0xc1ba('0x4c')]=_[_0xc1ba('0x4d')](_0x4988b0[_0xc1ba('0x41')],_0x4988b0[_0xc1ba('0x4e')]);_0x256d9c[_0xc1ba('0x4f')]=_[_0xc1ba('0x4d')](_0x4988b0[_0xc1ba('0x41')],qs['fields'](_0x11a338[_0xc1ba('0x4e')][_0xc1ba('0x5f')]));_0x256d9c[_0xc1ba('0x4f')]=_0x256d9c[_0xc1ba('0x4f')][_0xc1ba('0x50')]?_0x256d9c[_0xc1ba('0x4f')]:_0x4988b0[_0xc1ba('0x41')];_0x256d9c['order']=qs[_0xc1ba('0x53')](_0x11a338[_0xc1ba('0x4e')][_0xc1ba('0x53')]);_0x256d9c[_0xc1ba('0x54')]=qs[_0xc1ba('0x4c')](_[_0xc1ba('0x75')](_0x11a338[_0xc1ba('0x4e')],_0x4988b0[_0xc1ba('0x4c')]));if(_0x11a338[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x256d9c[_0xc1ba('0x54')]=_[_0xc1ba('0x57')](_0x256d9c[_0xc1ba('0x54')],{'$or':_[_0xc1ba('0x46')](_0x256d9c[_0xc1ba('0x4f')],function(_0x58b21e){var _0x3420e2={};_0x3420e2[_0x58b21e]={'$like':'%'+_0x11a338[_0xc1ba('0x4e')]['filter']+'%'};return _0x3420e2;})});}_0x256d9c=_[_0xc1ba('0x57')]({},_0x256d9c,_0x11a338[_0xc1ba('0x58')]);return _0x2b8fa0[_0xc1ba('0x136')](_0x256d9c);}})['then'](function(_0x277bc6){if(_0x277bc6){_0x3446f9=_0x277bc6[_0xc1ba('0x50')];if(!_0x11a338['query'][_0xc1ba('0x51')](_0xc1ba('0x52'))){_0x256d9c[_0xc1ba('0x24')]=qs[_0xc1ba('0x24')](_0x11a338[_0xc1ba('0x4e')][_0xc1ba('0x24')]);_0x256d9c[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x11a338['query']['offset']);}return _0x2b8fa0[_0xc1ba('0x136')](_0x256d9c);}})[_0xc1ba('0x18')](function(_0x41aa0d){if(_0x41aa0d){return _0x41aa0d?{'count':_0x3446f9,'rows':_0x41aa0d}:null;}})[_0xc1ba('0x18')](respondWithResult(_0x2eae28,null))[_0xc1ba('0x5b')](handleError(_0x2eae28,null));}; \ No newline at end of file +var _0xeefc=['root','server/files/images/logos/default_logo.svg','getLicense','custom','existsSync','server/files/images/logos/','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','isNil','Interval','resolve','chat','mapKey','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','CmContact','describe','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','from','CmList','Contacts','DESC','ChatApplication','Applications','interval','applications','orderBy','priority','account','list','List','ListId','contact','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','autoclose','close','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','offline','files','ValidationError','difference','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','basename','transaction','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','Contact','User','Owner','fullname','internal','color','tag','getSnippet','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','ifTime','server/files/chat/iframe.ejs','3.9.0','headers','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','replace','alignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','addProactiveActions','omit','ChatProactiveAction','getFields','online','offlineForm','onlineForm','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','UserProfileResource','end','sendStatus','stack','name','send','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','device','model','vendor','%s\x20%s\x20%s','type','Pause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','fields','create','body','address','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','role','user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','split','mandatoryDispositionPause','find','ChatWebsiteId','findOne','Disposition','hasOwnProperty','nolimit','rows','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join'];(function(_0x71032a,_0x2c3f17){var _0x43d8a0=function(_0x2084aa){while(--_0x2084aa){_0x71032a['push'](_0x71032a['shift']());}};_0x43d8a0(++_0x2c3f17);}(_0xeefc,0x1e1));var _0xceef=function(_0x54aec4,_0x5e827e){_0x54aec4=_0x54aec4-0x0;var _0x156b99=_0xeefc[_0x54aec4];return _0x156b99;};'use strict';var Mustache=require(_0xceef('0x0'));var util=require(_0xceef('0x1'));var path=require(_0xceef('0x2'));var ejs=require(_0xceef('0x3'));var fs=require('fs');var fs_extra=require(_0xceef('0x4'));var _=require(_0xceef('0x5'));var querystring=require(_0xceef('0x6'));var htmlToText=require(_0xceef('0x7'));var Redis=require(_0xceef('0x8'));var jayson=require(_0xceef('0x9'));var qs=require(_0xceef('0xa'));var logger=require(_0xceef('0xb'))('api');var config=require(_0xceef('0xc'));var APIBadRequestError=require(_0xceef('0xd'))[_0xceef('0xe')];var APINotFoundError=require(_0xceef('0xd'))[_0xceef('0xf')];var APIOutOfIntervalError=require(_0xceef('0xd'))['APIOutOfIntervalError'];var APIHandleError=require(_0xceef('0xd'))[_0xceef('0x10')];var APIConflictError=require(_0xceef('0xd'))[_0xceef('0x11')];var wildcardUtils=require(_0xceef('0x12'));var URL=require(_0xceef('0x13'))[_0xceef('0x14')];var db=require(_0xceef('0x15'))['db'];config[_0xceef('0x16')]=_[_0xceef('0x17')](config[_0xceef('0x16')],{'host':_0xceef('0x18'),'port':0x18eb});var socket=require(_0xceef('0x19'))(new Redis(config[_0xceef('0x16')]));require(_0xceef('0x1a'))[_0xceef('0x1b')](socket);var client=jayson[_0xceef('0x1c')][_0xceef('0x1d')]({'port':0x232c});var client9002=jayson[_0xceef('0x1c')][_0xceef('0x1d')]({'port':0x232a});var client9003=jayson[_0xceef('0x1c')][_0xceef('0x1d')]({'port':0x232b});var client9001=jayson['client'][_0xceef('0x1d')]({'port':0x2329});function respondWithRpcPromise(_0x1a8b37,_0x1d78e3,_0x5dd168,_0x50953e){return new Promise(function(_0x3e88c0,_0x2df987){var _0x1702ba=_0x50953e||client;return _0x1702ba[_0xceef('0x1e')](_0x1a8b37,_0x5dd168)[_0xceef('0x1f')](function(_0x1814c7){logger[_0xceef('0x20')](_0xceef('0x21'),_0x1d78e3,_0xceef('0x22'));logger['debug'](_0xceef('0x23'),_0x1d78e3,_0xceef('0x22'),JSON[_0xceef('0x24')](_0x1814c7));if(_0x1814c7[_0xceef('0x25')]){if(_0x1814c7[_0xceef('0x25')]['code']===0x1f4){logger[_0xceef('0x25')](_0xceef('0x21'),_0x1d78e3,_0x1814c7[_0xceef('0x25')][_0xceef('0x26')]);return _0x2df987(_0x1814c7['error'][_0xceef('0x26')]);}logger[_0xceef('0x25')](_0xceef('0x21'),_0x1d78e3,_0x1814c7[_0xceef('0x25')]['message']);return _0x3e88c0(_0x1814c7['error'][_0xceef('0x26')]);}else{logger['info'](_0xceef('0x21'),_0x1d78e3,'request\x20sent');_0x3e88c0(_0x1814c7['result'][_0xceef('0x26')]);}})[_0xceef('0x27')](function(_0x470bc5){logger[_0xceef('0x25')](_0xceef('0x21'),_0x1d78e3,_0x470bc5);_0x2df987(_0x470bc5);});});}function respondWithStatusCode(_0x2c76ae,_0x460b83){_0x460b83=_0x460b83||0xcc;return function(_0x3c3bc8){if(_0x3c3bc8){return _0x2c76ae['sendStatus'](_0x460b83);}return _0x2c76ae[_0xceef('0x28')](_0x460b83)['end']();};}function respondWithResult(_0x3700cd,_0x4fbbf0){_0x4fbbf0=_0x4fbbf0||0xc8;return function(_0x21de1e){if(_0x21de1e){return _0x3700cd['status'](_0x4fbbf0)[_0xceef('0x29')](_0x21de1e);}};}function respondWithFilteredResult(_0x465523,_0x48d238){return function(_0x2d1b06){if(_0x2d1b06){var _0x2d3da5=typeof _0x48d238[_0xceef('0x2a')]===_0xceef('0x2b')&&typeof _0x48d238[_0xceef('0x2c')]===_0xceef('0x2b');var _0x5dd3e9=_0x2d1b06[_0xceef('0x2d')];var _0x119745=_0x2d3da5?0x0:_0x48d238[_0xceef('0x2a')];var _0x566ea8=_0x2d3da5?_0x2d1b06[_0xceef('0x2d')]:_0x48d238['offset']+_0x48d238['limit'];var _0xc79af2;if(_0x566ea8>=_0x5dd3e9){_0x566ea8=_0x5dd3e9;_0xc79af2=0xc8;}else{_0xc79af2=0xce;}_0x465523[_0xceef('0x28')](_0xc79af2);return _0x465523[_0xceef('0x2e')](_0xceef('0x2f'),_0x119745+'-'+_0x566ea8+'/'+_0x5dd3e9)[_0xceef('0x29')](_0x2d1b06);}return null;};}function saveUpdates(_0x29cb98){return function(_0x29dbff){if(_0x29dbff){return _0x29dbff[_0xceef('0x30')](_0x29cb98)[_0xceef('0x1f')](function(_0x453817){return _0x453817;});}return null;};}function removeEntity(_0x3093a9){return function(_0x3a5467){if(_0x3a5467){return _0x3a5467[_0xceef('0x31')]()[_0xceef('0x1f')](function(){var _0x161e2c=_0x3a5467[_0xceef('0x32')]({'plain':!![]});var _0x19c120='ChatWebsites';return db[_0xceef('0x33')][_0xceef('0x31')]({'where':{'type':_0x19c120,'resourceId':_0x161e2c['id']}})[_0xceef('0x1f')](function(){return _0x3a5467;});})['then'](function(){_0x3093a9['status'](0xcc)[_0xceef('0x34')]();});}};}function handleEntityNotFound(_0x537a12){return function(_0x1245b6){if(!_0x1245b6){_0x537a12[_0xceef('0x35')](0x194);}return _0x1245b6;};}function handleError(_0x1ce7f7,_0x32a30d){_0x32a30d=_0x32a30d||0x1f4;return function(_0x2cf8b1){logger[_0xceef('0x25')](_0x2cf8b1[_0xceef('0x36')]);if(_0x2cf8b1[_0xceef('0x37')]){delete _0x2cf8b1[_0xceef('0x37')];}_0x1ce7f7['status'](_0x32a30d)[_0xceef('0x38')](_0x2cf8b1);};}function createInteractionObject(_0x2e9a78,_0x50e1f6,_0x30bc28,_0x27b777){var _0x41e95e=require(_0xceef('0x39'));var _0x2325d3=new _0x41e95e();var _0x111719=_0x2325d3['setUA'](_0x30bc28[_0xceef('0x3a')])[_0xceef('0x3b')]();var _0x4587da=_0x50e1f6[_0xceef('0x3c')];if(_0x30bc28[_0xceef('0x3d')]){_0x4587da=_0x30bc28[_0xceef('0x3d')];}else if(_0x30bc28[_0xceef('0x3e')]){_0x4587da=_[_0xceef('0x3f')](_0x30bc28[_0xceef('0x3e')]['split'](','));}return{'ContactId':_0x27b777['id'],'ChatWebsiteId':_0x2e9a78,'from':(_0x27b777[_0xceef('0x40')]||'')+'\x20'+(_0x27b777[_0xceef('0x41')]||''),'customerIp':_0x4587da,'customerPort':_0x30bc28[_0xceef('0x42')]?_0x30bc28[_0xceef('0x42')]:null,'referer':_0x50e1f6[_0xceef('0x43')],'browserName':_0x111719[_0xceef('0x44')][_0xceef('0x37')]&&_0x111719[_0xceef('0x44')][_0xceef('0x45')]?util[_0xceef('0x46')](_0xceef('0x47'),_0x111719[_0xceef('0x44')]['name'],_0x111719[_0xceef('0x44')]['version']):'unknown','browserVersion':_0x111719[_0xceef('0x44')][_0xceef('0x45')]||'unknown','osName':util[_0xceef('0x46')](_0xceef('0x47'),_0x111719['os']['name'],_0x111719['os'][_0xceef('0x45')]),'osVersion':_0x111719['os'][_0xceef('0x45')],'deviceModel':_0x111719[_0xceef('0x48')][_0xceef('0x49')]&&_0x111719[_0xceef('0x48')][_0xceef('0x4a')]?util[_0xceef('0x46')](_0xceef('0x4b'),_0x111719[_0xceef('0x48')][_0xceef('0x49')],_0x111719[_0xceef('0x48')]['vendor'],_0x111719[_0xceef('0x48')][_0xceef('0x4c')]):null,'deviceVendor':_0x111719[_0xceef('0x48')]['vendor'],'deviceType':_0x111719[_0xceef('0x48')]['type'],'formData':JSON[_0xceef('0x24')](_0x50e1f6)};}exports['index']=function(_0x4c9cb3,_0x5a7678){var _0x530143={'include':[{'model':db[_0xceef('0x4d')],'as':'mandatoryDispositionPause'}]},_0x170db9={},_0x3fcc6c={'count':0x0,'rows':[]};var _0x5536d5=_[_0xceef('0x4e')](db[_0xceef('0x4f')][_0xceef('0x50')],function(_0x1c3815){return{'name':_0x1c3815[_0xceef('0x51')],'type':_0x1c3815[_0xceef('0x4c')][_0xceef('0x52')]};});_0x170db9[_0xceef('0x49')]=_[_0xceef('0x4e')](_0x5536d5,_0xceef('0x37'));_0x170db9[_0xceef('0x53')]=_[_0xceef('0x54')](_0x4c9cb3[_0xceef('0x53')]);_0x170db9[_0xceef('0x55')]=_[_0xceef('0x56')](_0x170db9[_0xceef('0x49')],_0x170db9[_0xceef('0x53')]);_0x530143[_0xceef('0x57')]=_[_0xceef('0x56')](_0x170db9[_0xceef('0x49')],qs['fields'](_0x4c9cb3[_0xceef('0x53')]['fields']));_0x530143[_0xceef('0x57')]=_0x530143[_0xceef('0x57')][_0xceef('0x58')]?_0x530143[_0xceef('0x57')]:_0x170db9[_0xceef('0x49')];if(!_0x4c9cb3[_0xceef('0x53')]['hasOwnProperty']('nolimit')){_0x530143[_0xceef('0x2c')]=qs[_0xceef('0x2c')](_0x4c9cb3[_0xceef('0x53')][_0xceef('0x2c')]);_0x530143[_0xceef('0x2a')]=qs[_0xceef('0x2a')](_0x4c9cb3[_0xceef('0x53')][_0xceef('0x2a')]);}_0x530143[_0xceef('0x59')]=qs[_0xceef('0x5a')](_0x4c9cb3['query']['sort']);_0x530143[_0xceef('0x5b')]=qs[_0xceef('0x55')](_[_0xceef('0x5c')](_0x4c9cb3[_0xceef('0x53')],_0x170db9['filters']),_0x5536d5);if(_0x4c9cb3[_0xceef('0x53')][_0xceef('0x5d')]){_0x530143[_0xceef('0x5b')]=_[_0xceef('0x5e')](_0x530143[_0xceef('0x5b')],{'$or':_[_0xceef('0x4e')](_0x5536d5,function(_0x21dd01){if(_0x21dd01[_0xceef('0x4c')]!==_0xceef('0x5f')){var _0x1817c6={};_0x1817c6[_0x21dd01[_0xceef('0x37')]]={'$like':'%'+_0x4c9cb3[_0xceef('0x53')][_0xceef('0x5d')]+'%'};return _0x1817c6;}})});}_0x530143=_[_0xceef('0x5e')]({},_0x530143,_0x4c9cb3[_0xceef('0x60')]);var _0x5d43e1={'where':_0x530143['where']};return db[_0xceef('0x4f')][_0xceef('0x2d')](_0x5d43e1)[_0xceef('0x1f')](function(_0x42e18f){_0x3fcc6c[_0xceef('0x2d')]=_0x42e18f;if(_0x4c9cb3[_0xceef('0x53')][_0xceef('0x61')]){_0x530143[_0xceef('0x62')]=[{'all':!![]}];}return db[_0xceef('0x4f')][_0xceef('0x63')](_0x530143);})[_0xceef('0x1f')](function(_0x1809fa){_0x3fcc6c['rows']=_0x1809fa;return _0x3fcc6c;})[_0xceef('0x1f')](respondWithFilteredResult(_0x5a7678,_0x530143))[_0xceef('0x27')](handleError(_0x5a7678,null));};exports['show']=function(_0x216d40,_0x199731){var _0x1a8701={'raw':![],'where':{'id':_0x216d40[_0xceef('0x64')]['id']},'include':[{'model':db[_0xceef('0x4d')],'as':'mandatoryDispositionPause'}]},_0x1d4947={};_0x1d4947['model']=_['keys'](db['ChatWebsite']['rawAttributes']);_0x1d4947[_0xceef('0x53')]=_[_0xceef('0x54')](_0x216d40[_0xceef('0x53')]);_0x1d4947[_0xceef('0x55')]=_[_0xceef('0x56')](_0x1d4947[_0xceef('0x49')],_0x1d4947[_0xceef('0x53')]);_0x1a8701['attributes']=_[_0xceef('0x56')](_0x1d4947[_0xceef('0x49')],qs[_0xceef('0x65')](_0x216d40['query'][_0xceef('0x65')]));_0x1a8701[_0xceef('0x57')]=_0x1a8701[_0xceef('0x57')][_0xceef('0x58')]?_0x1a8701[_0xceef('0x57')]:_0x1d4947[_0xceef('0x49')];if(_0x216d40['query'][_0xceef('0x61')]){_0x1a8701[_0xceef('0x62')]=[{'all':!![]}];}_0x1a8701=_[_0xceef('0x5e')]({},_0x1a8701,_0x216d40[_0xceef('0x60')]);return db[_0xceef('0x4f')]['find'](_0x1a8701)[_0xceef('0x1f')](handleEntityNotFound(_0x199731,null))[_0xceef('0x1f')](respondWithResult(_0x199731,null))[_0xceef('0x27')](handleError(_0x199731,null));};exports[_0xceef('0x66')]=function(_0x48c980,_0x4dc34f){var _0x4123dd=null;_0x48c980[_0xceef('0x67')][_0xceef('0x68')]['split'](',')[_0xceef('0x69')](_0x3e1738=>{if(_0x3e1738[_0xceef('0x6a')]()!==''&&!wildcardUtils[_0xceef('0x6b')](_0x3e1738[_0xceef('0x6a')]())){_0x4123dd=new APIBadRequestError('\x22'+_0x3e1738[_0xceef('0x6a')]()+_0xceef('0x6c'));}});if(_0x4123dd){return handleError(_0x4dc34f,null)(_0x4123dd);}return db['ChatWebsite'][_0xceef('0x66')](_0x48c980[_0xceef('0x67')],{})[_0xceef('0x1f')](function(_0x20dcf1){var _0x4d1b2e=_0x48c980['user'][_0xceef('0x32')]({'plain':!![]});if(!_0x4d1b2e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d1b2e[_0xceef('0x6d')]===_0xceef('0x6e')){var _0x5e9eed=_0x20dcf1[_0xceef('0x32')]({'plain':!![]});var _0x41e29b=_0xceef('0x6f');return db[_0xceef('0x70')]['find']({'where':{'name':_0x41e29b,'userProfileId':_0x4d1b2e[_0xceef('0x71')]},'raw':!![]})[_0xceef('0x1f')](function(_0x2f8255){if(_0x2f8255&&_0x2f8255[_0xceef('0x72')]===0x0){return db[_0xceef('0x33')]['create']({'name':_0x5e9eed[_0xceef('0x37')],'resourceId':_0x5e9eed['id'],'type':_0x2f8255[_0xceef('0x37')],'sectionId':_0x2f8255['id']},{})[_0xceef('0x1f')](function(){return _0x20dcf1;});}else{return _0x20dcf1;}})['catch'](function(_0x2f0d99){logger[_0xceef('0x25')](_0xceef('0x73'),_0x2f0d99);throw _0x2f0d99;});}return _0x20dcf1;})['then'](respondWithResult(_0x4dc34f,0xc9))['catch'](handleError(_0x4dc34f,null));};exports[_0xceef('0x30')]=function(_0x264113,_0xb8874f){var _0x31e374=null;_0x264113['body'][_0xceef('0x68')][_0xceef('0x74')](',')[_0xceef('0x69')](_0x5afa09=>{if(_0x5afa09[_0xceef('0x6a')]()!==''&&!wildcardUtils[_0xceef('0x6b')](_0x5afa09['trim']())){_0x31e374=new APIBadRequestError('\x22'+_0x5afa09[_0xceef('0x6a')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x31e374){return handleError(_0xb8874f,null)(_0x31e374);}if(_0x264113[_0xceef('0x67')]['id']){delete _0x264113[_0xceef('0x67')]['id'];}return db[_0xceef('0x4f')]['find']({'where':{'id':_0x264113[_0xceef('0x64')]['id']},'include':[{'model':db[_0xceef('0x4d')],'as':_0xceef('0x75')}]})[_0xceef('0x1f')](handleEntityNotFound(_0xb8874f,null))[_0xceef('0x1f')](saveUpdates(_0x264113[_0xceef('0x67')],null))[_0xceef('0x1f')](respondWithResult(_0xb8874f,null))[_0xceef('0x27')](handleError(_0xb8874f,null));};exports[_0xceef('0x31')]=function(_0x511fcd,_0x6f10bd){return db['ChatWebsite'][_0xceef('0x76')]({'where':{'id':_0x511fcd['params']['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x6f10bd,null))[_0xceef('0x1f')](removeEntity(_0x6f10bd,null))[_0xceef('0x27')](handleError(_0x6f10bd,null));};exports['describe']=function(_0x5f245a,_0x1af60f){return db[_0xceef('0x4f')]['describe']()['then'](respondWithResult(_0x1af60f,null))[_0xceef('0x27')](handleError(_0x1af60f,null));};exports['addDisposition']=function(_0x2f1019,_0x41fb00){if(_0x2f1019[_0xceef('0x67')]['id']){delete _0x2f1019[_0xceef('0x67')]['id'];}return db[_0xceef('0x4f')][_0xceef('0x76')]({'where':{'id':_0x2f1019['params']['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x41fb00,null))['then'](function(_0x3b359a){if(_0x3b359a){_0x2f1019[_0xceef('0x67')][_0xceef('0x77')]=_0x3b359a['id'];return db['Disposition'][_0xceef('0x66')](_0x2f1019[_0xceef('0x67')]);}})[_0xceef('0x1f')](respondWithResult(_0x41fb00,null))[_0xceef('0x27')](handleError(_0x41fb00,null));};exports['getDispositions']=function(_0x57bd83,_0x186737){var _0x51c826={'raw':![],'where':{}};var _0x2f9c7e={};var _0x795f2b={'count':0x0,'rows':[]};return db[_0xceef('0x4f')][_0xceef('0x78')]({'where':{'id':_0x57bd83[_0xceef('0x64')]['id']}})['then'](handleEntityNotFound(_0x186737,null))[_0xceef('0x1f')](function(_0x458092){if(_0x458092){_0x2f9c7e[_0xceef('0x49')]=_[_0xceef('0x54')](db[_0xceef('0x79')][_0xceef('0x50')]);_0x2f9c7e[_0xceef('0x53')]=_[_0xceef('0x54')](_0x57bd83[_0xceef('0x53')]);_0x2f9c7e['filters']=_['intersection'](_0x2f9c7e[_0xceef('0x49')],_0x2f9c7e[_0xceef('0x53')]);_0x51c826[_0xceef('0x57')]=_[_0xceef('0x56')](_0x2f9c7e[_0xceef('0x49')],qs['fields'](_0x57bd83[_0xceef('0x53')][_0xceef('0x65')]));_0x51c826[_0xceef('0x57')]=_0x51c826[_0xceef('0x57')][_0xceef('0x58')]?_0x51c826['attributes']:_0x2f9c7e[_0xceef('0x49')];if(!_0x57bd83[_0xceef('0x53')][_0xceef('0x7a')](_0xceef('0x7b'))){_0x51c826[_0xceef('0x2c')]=qs[_0xceef('0x2c')](_0x57bd83[_0xceef('0x53')][_0xceef('0x2c')]);_0x51c826[_0xceef('0x2a')]=qs[_0xceef('0x2a')](_0x57bd83[_0xceef('0x53')]['offset']);}_0x51c826['order']=qs['sort'](_0x57bd83['query'][_0xceef('0x5a')]);_0x51c826[_0xceef('0x5b')]=qs[_0xceef('0x55')](_[_0xceef('0x5c')](_0x57bd83[_0xceef('0x53')],_0x2f9c7e[_0xceef('0x55')]));_0x51c826[_0xceef('0x5b')][_0xceef('0x77')]=_0x458092['id'];if(_0x57bd83[_0xceef('0x53')][_0xceef('0x5d')]){_0x51c826[_0xceef('0x5b')]=_['merge'](_0x51c826[_0xceef('0x5b')],{'$or':_[_0xceef('0x4e')](_0x51c826[_0xceef('0x57')],function(_0x2a98b0){var _0x178d59={};_0x178d59[_0x2a98b0]={'$like':'%'+_0x57bd83[_0xceef('0x53')][_0xceef('0x5d')]+'%'};return _0x178d59;})});}_0x51c826=_[_0xceef('0x5e')]({},_0x51c826,_0x57bd83[_0xceef('0x60')]);return db[_0xceef('0x79')][_0xceef('0x2d')]({'where':_0x51c826[_0xceef('0x5b')]})[_0xceef('0x1f')](function(_0x5c5bf5){_0x795f2b[_0xceef('0x2d')]=_0x5c5bf5;if(_0x57bd83[_0xceef('0x53')][_0xceef('0x61')]){_0x51c826[_0xceef('0x62')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x51c826);})[_0xceef('0x1f')](function(_0x13d9ab){_0x795f2b[_0xceef('0x7c')]=_0x13d9ab;return _0x795f2b;});}})[_0xceef('0x1f')](respondWithFilteredResult(_0x186737,_0x51c826))['catch'](handleError(_0x186737,null));};exports[_0xceef('0x7d')]=function(_0x56ba07,_0x23e1a7){return db[_0xceef('0x4f')][_0xceef('0x76')]({'where':{'id':_0x56ba07[_0xceef('0x64')]['id']}})['then'](handleEntityNotFound(_0x23e1a7,null))[_0xceef('0x1f')](function(_0x333ab1){if(_0x333ab1){return _0x333ab1[_0xceef('0x7d')](_0x56ba07[_0xceef('0x53')]['ids']);}})[_0xceef('0x1f')](respondWithStatusCode(_0x23e1a7,null))[_0xceef('0x27')](handleError(_0x23e1a7,null));};exports[_0xceef('0x7e')]=function(_0x146b83,_0x571fe2){if(_0x146b83[_0xceef('0x67')]['id']){delete _0x146b83['body']['id'];}return db[_0xceef('0x4f')]['find']({'where':{'id':_0x146b83['params']['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x571fe2,null))['then'](function(_0x40b468){if(_0x40b468){_0x146b83[_0xceef('0x67')]['ChatWebsiteId']=_0x40b468['id'];return db[_0xceef('0x7f')]['create'](_0x146b83['body']);}})[_0xceef('0x1f')](respondWithResult(_0x571fe2,null))['catch'](handleError(_0x571fe2,null));};exports['getAnswers']=function(_0x3c1930,_0x5e73d9){var _0x38f3ae={'raw':![],'where':{}};var _0x533d11={};var _0x32353f={'count':0x0,'rows':[]};return db[_0xceef('0x4f')][_0xceef('0x78')]({'where':{'id':_0x3c1930[_0xceef('0x64')]['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x5e73d9,null))[_0xceef('0x1f')](function(_0x7054e2){if(_0x7054e2){_0x533d11[_0xceef('0x49')]=_[_0xceef('0x54')](db[_0xceef('0x7f')][_0xceef('0x50')]);_0x533d11[_0xceef('0x53')]=_['keys'](_0x3c1930[_0xceef('0x53')]);_0x533d11[_0xceef('0x55')]=_[_0xceef('0x56')](_0x533d11['model'],_0x533d11['query']);_0x38f3ae[_0xceef('0x57')]=_[_0xceef('0x56')](_0x533d11['model'],qs[_0xceef('0x65')](_0x3c1930[_0xceef('0x53')]['fields']));_0x38f3ae[_0xceef('0x57')]=_0x38f3ae['attributes'][_0xceef('0x58')]?_0x38f3ae['attributes']:_0x533d11[_0xceef('0x49')];if(!_0x3c1930[_0xceef('0x53')][_0xceef('0x7a')](_0xceef('0x7b'))){_0x38f3ae[_0xceef('0x2c')]=qs['limit'](_0x3c1930['query'][_0xceef('0x2c')]);_0x38f3ae[_0xceef('0x2a')]=qs[_0xceef('0x2a')](_0x3c1930[_0xceef('0x53')][_0xceef('0x2a')]);}_0x38f3ae['order']=qs[_0xceef('0x5a')](_0x3c1930['query'][_0xceef('0x5a')]);_0x38f3ae[_0xceef('0x5b')]=qs[_0xceef('0x55')](_['pick'](_0x3c1930[_0xceef('0x53')],_0x533d11[_0xceef('0x55')]));_0x38f3ae['where'][_0xceef('0x77')]=_0x7054e2['id'];if(_0x3c1930[_0xceef('0x53')][_0xceef('0x5d')]){_0x38f3ae[_0xceef('0x5b')]=_[_0xceef('0x5e')](_0x38f3ae[_0xceef('0x5b')],{'$or':_[_0xceef('0x4e')](_0x38f3ae['attributes'],function(_0x3ae17a){var _0x56ca07={};_0x56ca07[_0x3ae17a]={'$like':'%'+_0x3c1930[_0xceef('0x53')][_0xceef('0x5d')]+'%'};return _0x56ca07;})});}_0x38f3ae=_['merge']({},_0x38f3ae,_0x3c1930[_0xceef('0x60')]);return db['CannedAnswer'][_0xceef('0x2d')]({'where':_0x38f3ae[_0xceef('0x5b')]})[_0xceef('0x1f')](function(_0x809d99){_0x32353f['count']=_0x809d99;if(_0x3c1930[_0xceef('0x53')][_0xceef('0x61')]){_0x38f3ae[_0xceef('0x62')]=[{'all':!![]}];}return db[_0xceef('0x7f')][_0xceef('0x63')](_0x38f3ae);})[_0xceef('0x1f')](function(_0x419a9b){_0x32353f[_0xceef('0x7c')]=_0x419a9b;return _0x32353f;});}})[_0xceef('0x1f')](respondWithFilteredResult(_0x5e73d9,_0x38f3ae))['catch'](handleError(_0x5e73d9,null));};exports['removeAnswers']=function(_0x2e2e3d,_0x280433){return db[_0xceef('0x4f')][_0xceef('0x76')]({'where':{'id':_0x2e2e3d[_0xceef('0x64')]['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x280433,null))[_0xceef('0x1f')](function(_0x377d45){if(_0x377d45){return _0x377d45[_0xceef('0x80')](_0x2e2e3d[_0xceef('0x53')][_0xceef('0x81')]);}})['then'](respondWithStatusCode(_0x280433,null))[_0xceef('0x27')](handleError(_0x280433,null));};exports[_0xceef('0x82')]=function(_0x1344df,_0x52ac58){_0x1344df[_0xceef('0x67')][_0xceef('0x83')]=_0x1344df[_0xceef('0x84')][_0xceef('0x85')];return db[_0xceef('0x4f')][_0xceef('0x76')]({'where':{'id':_0x1344df[_0xceef('0x64')]['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x52ac58,null))[_0xceef('0x1f')](saveUpdates(_0x1344df['body'],null))['then'](respondWithResult(_0x52ac58,null))[_0xceef('0x27')](handleError(_0x52ac58,null));};exports[_0xceef('0x86')]=function(_0x1585aa,_0x5c88d4){_0x1585aa[_0xceef('0x67')]['agentAvatar']=_0x1585aa['file'][_0xceef('0x85')];return db[_0xceef('0x4f')]['find']({'where':{'id':_0x1585aa[_0xceef('0x64')]['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x5c88d4,null))[_0xceef('0x1f')](saveUpdates(_0x1585aa[_0xceef('0x67')],null))[_0xceef('0x1f')](respondWithResult(_0x5c88d4,null))[_0xceef('0x27')](handleError(_0x5c88d4,null));};exports[_0xceef('0x87')]=function(_0x33f9fe,_0x2a0d32){_0x33f9fe[_0xceef('0x67')][_0xceef('0x88')]=_0x33f9fe['file'][_0xceef('0x85')];return db['ChatWebsite'][_0xceef('0x76')]({'where':{'id':_0x33f9fe[_0xceef('0x64')]['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x2a0d32,null))[_0xceef('0x1f')](saveUpdates(_0x33f9fe[_0xceef('0x67')],null))['then'](respondWithResult(_0x2a0d32,null))[_0xceef('0x27')](handleError(_0x2a0d32,null));};exports[_0xceef('0x89')]=function(_0x169d1,_0x4493d4){_0x169d1['body'][_0xceef('0x8a')]=_0x169d1['file'][_0xceef('0x85')];return db['ChatWebsite']['find']({'where':{'id':_0x169d1[_0xceef('0x64')]['id']}})['then'](handleEntityNotFound(_0x4493d4,null))[_0xceef('0x1f')](saveUpdates(_0x169d1[_0xceef('0x67')],null))[_0xceef('0x1f')](respondWithResult(_0x4493d4,null))[_0xceef('0x27')](handleError(_0x4493d4,null));};exports[_0xceef('0x8b')]=function(_0x4bffac,_0x791b72){var _0x90b968=path[_0xceef('0x8c')](config[_0xceef('0x8d')],_0xceef('0x8e'));var _0x2e2cca={'where':{'id':_0x4bffac[_0xceef('0x64')]['id']},'attributes':['id',_0xceef('0x83')],'raw':!![]};var _0xd82505=![];return require('../../config/license/util')[_0xceef('0x8f')]()[_0xceef('0x1f')](function(_0x209c59){if(_0x209c59){_0xd82505=_0x209c59[_0xceef('0x90')];}})[_0xceef('0x1f')](function(){return db[_0xceef('0x4f')][_0xceef('0x76')](_0x2e2cca);})[_0xceef('0x1f')](handleEntityNotFound(_0x791b72,null))[_0xceef('0x1f')](function(_0x1ef1ef){if(_0x1ef1ef){if(!_['isNil'](_0x1ef1ef[_0xceef('0x83')])){if(fs[_0xceef('0x91')](path[_0xceef('0x8c')](config[_0xceef('0x8d')],_0xceef('0x92'),_0x1ef1ef[_0xceef('0x83')]))&&_0xd82505){_0x90b968=path[_0xceef('0x8c')](config[_0xceef('0x8d')],_0xceef('0x92'),_0x1ef1ef[_0xceef('0x83')]);}}return _0x791b72['download'](_0x90b968);}})[_0xceef('0x27')](handleError(_0x791b72,null));};exports['getAvatar']=function(_0x1d92fc,_0x360cda){var _0x4db355=path['join'](config[_0xceef('0x8d')],'server/files/images/avatars/default_avatar.png');var _0x2a028b={'where':{'id':_0x1d92fc['params']['id']},'attributes':['id',_0xceef('0x93')],'raw':!![]};return db['ChatWebsite']['find'](_0x2a028b)[_0xceef('0x1f')](handleEntityNotFound(_0x360cda,null))['then'](function(_0x2777ec){if(_0x2777ec){if(!_['isNil'](_0x2777ec[_0xceef('0x93')])){if(fs[_0xceef('0x91')](path['join'](config[_0xceef('0x8d')],'server/files/images/avatars/',_0x2777ec[_0xceef('0x93')]))){_0x4db355=path[_0xceef('0x8c')](config[_0xceef('0x8d')],_0xceef('0x94'),_0x2777ec[_0xceef('0x93')]);}}return _0x360cda[_0xceef('0x95')](_0x4db355);}})['catch'](handleError(_0x360cda,null));};exports[_0xceef('0x96')]=function(_0x4d0dab,_0x58b344){var _0x30086e=path[_0xceef('0x8c')](config[_0xceef('0x8d')],_0xceef('0x97'));var _0x1d3e3a={'where':{'id':_0x4d0dab[_0xceef('0x64')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xceef('0x4f')][_0xceef('0x76')](_0x1d3e3a)[_0xceef('0x1f')](handleEntityNotFound(_0x58b344,null))[_0xceef('0x1f')](function(_0x43d71d){if(_0x43d71d){if(!_['isNil'](_0x43d71d[_0xceef('0x88')])){if(fs[_0xceef('0x91')](path[_0xceef('0x8c')](config[_0xceef('0x8d')],_0xceef('0x94'),_0x43d71d[_0xceef('0x88')]))&&_0x43d71d[_0xceef('0x98')]){_0x30086e=path['join'](config[_0xceef('0x8d')],_0xceef('0x94'),_0x43d71d[_0xceef('0x88')]);}}return _0x58b344[_0xceef('0x95')](_0x30086e);}})[_0xceef('0x27')](handleError(_0x58b344,null));};exports[_0xceef('0x99')]=function(_0x3e327c,_0x21941a){var _0x2257b6=path['join'](config[_0xceef('0x8d')],_0xceef('0x9a'));var _0x20f13b={'where':{'id':_0x3e327c[_0xceef('0x64')]['id']},'attributes':['id',_0xceef('0x8a')],'raw':!![]};return db['ChatWebsite'][_0xceef('0x76')](_0x20f13b)[_0xceef('0x1f')](handleEntityNotFound(_0x21941a,null))['then'](function(_0x453a3c){if(_0x453a3c){if(!_[_0xceef('0x9b')](_0x453a3c['systemAvatar'])){if(fs[_0xceef('0x91')](path['join'](config['root'],_0xceef('0x94'),_0x453a3c['systemAvatar']))){_0x2257b6=path[_0xceef('0x8c')](config[_0xceef('0x8d')],_0xceef('0x94'),_0x453a3c['systemAvatar']);}}return _0x21941a[_0xceef('0x95')](_0x2257b6);}})[_0xceef('0x27')](handleError(_0x21941a,null));};function checkWebsiteInterval(_0x53a22c){var _0x205218=_0x53a22c[_0xceef('0x9c')];if(!_0x205218){return Promise[_0xceef('0x9d')](_0x53a22c);}var _0x352e35=_0x53a22c['timezone']||undefined;return _0x205218['ifTime'](_0x352e35)[_0xceef('0x1f')](function(_0x8e4f5b){if(!_0x8e4f5b){throw new APIOutOfIntervalError();}return _0x53a22c;});}exports['notify']=function(_0x2a7ef5,_0x53810a){var _0x31c093={'body':_0x2a7ef5[_0xceef('0x67')],'channel':_0xceef('0x9e')};var _0x288413=[];var _0x2c7896=[];var _0x4c48ad={};var _0x348a65=![];if(_0x2a7ef5[_0xceef('0x67')]['id']){delete _0x2a7ef5[_0xceef('0x67')]['id'];}if(_[_0xceef('0x9b')](_0x2a7ef5[_0xceef('0x67')]['from'])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0xceef('0x9b')](_0x2a7ef5['body'][_0xceef('0x9f')])){throw new APIBadRequestError(_0xceef('0xa0'));}if(_['isEmpty'](_0x2a7ef5['body']['body'])){throw new APIBadRequestError(_0xceef('0xa1'));}var _0x1724d0=_0x2a7ef5[_0xceef('0x67')][_0xceef('0x3c')]&&_0x2a7ef5[_0xceef('0x67')][_0xceef('0x43')];return db[_0xceef('0xa2')][_0xceef('0xa3')]()[_0xceef('0x1f')](function(_0x3d0391){if(!_0x3d0391){throw new Error(_0xceef('0xa4'));}_0x288413=Object[_0xceef('0x54')](_0x3d0391)['filter'](function(_0x406433){return![_0xceef('0xa5'),_0xceef('0xa6')][_0xceef('0xa7')](_0x406433);});_0x2c7896=Object[_0xceef('0x54')](_0x3d0391)[_0xceef('0x5d')](function(_0xd52919){return![_0xceef('0xa5'),_0xceef('0xa6'),_0xceef('0xa8'),'ListId']['includes'](_0xd52919);});if(!_['includes'](_0x2c7896,_0x2a7ef5[_0xceef('0x67')]['mapKey'])){throw new APIBadRequestError(_0xceef('0xa9')+_0x2c7896[_0xceef('0x8c')](',\x20'));}_0x4c48ad[_0x2a7ef5['body']['mapKey']]=_0x2a7ef5[_0xceef('0x67')][_0xceef('0xaa')];})[_0xceef('0x1f')](function(){return db[_0xceef('0x4f')][_0xceef('0x76')]({'where':{'id':_0x2a7ef5[_0xceef('0x64')]['id']},'include':[{'model':db[_0xceef('0xab')],'as':'List','include':[{'model':db[_0xceef('0xa2')],'as':_0xceef('0xac'),'where':_0x4c48ad,'limit':0x1,'order':[[_0xceef('0xa6'),_0xceef('0xad')]]}]},{'model':db[_0xceef('0xae')],'as':_0xceef('0xaf')},{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0xceef('0x9c')],'as':'Intervals','attributes':['id',_0xceef('0xb0')],'raw':!![]}]}]});})[_0xceef('0x1f')](function(_0xf540d7){if(!_0xf540d7){throw new APINotFoundError(util[_0xceef('0x46')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x2a7ef5[_0xceef('0x64')]['id']));}if(_0x1724d0){return checkWebsiteInterval(_0xf540d7);}return _0xf540d7;})['then'](function(_0x91df72){_0x31c093['account']=_0x91df72;_0x31c093[_0xceef('0xb1')]=_[_0xceef('0xb2')](_0x91df72[_0xceef('0xaf')],[_0xceef('0xb3')],['asc']);if(_0x31c093[_0xceef('0xb4')]['Applications']){delete _0x31c093[_0xceef('0xb4')]['Applications'];}_0x31c093[_0xceef('0xb5')]=_0x91df72[_0xceef('0xb6')]||{'id':_0x91df72[_0xceef('0xb7')]};if(_0x31c093[_0xceef('0xb5')]&&_0x31c093[_0xceef('0xb5')][_0xceef('0xac')][_0xceef('0x58')]){return _0x31c093[_0xceef('0xb5')][_0xceef('0xac')][0x0];}var _0x5d3621=_['defaults'](_0x2a7ef5[_0xceef('0x67')],{'firstName':_0x2a7ef5[_0xceef('0x67')]['from'],'ListId':_0x91df72[_0xceef('0xb7')]});_0x5d3621[_0x2a7ef5['body'][_0xceef('0x9f')]]=_0x2a7ef5[_0xceef('0x67')][_0xceef('0xaa')];return db[_0xceef('0xa2')][_0xceef('0x66')](_0x5d3621,{'fields':_0x288413,'raw':!![]});})[_0xceef('0x1f')](function(_0x3ee19b){_0x31c093[_0xceef('0xb8')]=_0x3ee19b;var _0x29ff58=createInteractionObject(_0x2a7ef5[_0xceef('0x64')]['id'],_0x2a7ef5['body'],_0x2a7ef5['headers'],_0x3ee19b);var _0x374d65={'ChatWebsiteId':_0x2a7ef5[_0xceef('0x64')]['id']};if(_0x2a7ef5[_0xceef('0x67')][_0xceef('0xb9')]){_0x374d65['threadId']=_0x2a7ef5[_0xceef('0x67')][_0xceef('0xb9')];_0x374d65[_0xceef('0xba')]=![];return db[_0xceef('0xbb')]['find']({'where':_0x374d65})[_0xceef('0x1f')](function(_0x4fa296){var _0x359c2e=_0x2a7ef5[_0xceef('0x67')][_0xceef('0x3c')]&&_0x2a7ef5['body']['referer'];if(_0x4fa296){_0x348a65=!![];return _0x4fa296;}else if(!_0x359c2e&&_0x4fa296&&_0x4fa296[_0xceef('0xba')]){throw new APIConflictError(_0xceef('0xbc'));}_0x29ff58[_0xceef('0xb9')]=_0x2a7ef5[_0xceef('0x67')][_0xceef('0xb9')];_0x29ff58['externalUrl']=_0x2a7ef5[_0xceef('0x67')][_0xceef('0xbd')];return db[_0xceef('0xbb')][_0xceef('0x66')](_0x29ff58);});}_0x374d65[_0xceef('0xbe')]=_0x3ee19b['id'];if(_0x2a7ef5[_0xceef('0x67')][_0xceef('0xbf')]&&_0x2a7ef5['body']['interaction']['id']){_0x374d65['id']=_0x2a7ef5[_0xceef('0x67')][_0xceef('0xbf')]['id'];return db['ChatInteraction']['find']({'where':_0x374d65})[_0xceef('0x1f')](function(_0x10dfee){var _0x524d4d=_0x2a7ef5[_0xceef('0x67')][_0xceef('0x3c')]&&_0x2a7ef5[_0xceef('0x67')][_0xceef('0x43')];if(!_0x524d4d&&_0x10dfee&&_0x10dfee[_0xceef('0xba')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x10dfee){_0x348a65=!![];return _0x10dfee;}else{return db[_0xceef('0xbb')][_0xceef('0x66')](_0x29ff58);}});}return db['ChatInteraction'][_0xceef('0x66')](_0x29ff58);})[_0xceef('0x1f')](function(_0x1675db){if(!_0x348a65){return _0x1675db;}var _0x92dfa3={'from':(_0x31c093[_0xceef('0xb8')][_0xceef('0x40')]||'')+'\x20'+(_0x31c093[_0xceef('0xb8')][_0xceef('0x41')]||'')};if(_0x2a7ef5[_0xceef('0x67')][_0xceef('0xb9')]&&_0x2a7ef5[_0xceef('0x67')]['messageId']&&_0x2a7ef5[_0xceef('0x67')][_0xceef('0xb9')]!=_0x2a7ef5[_0xceef('0x67')][_0xceef('0xc0')]){_0x92dfa3[_0xceef('0xb9')]=_0x2a7ef5['body'][_0xceef('0xc0')];}return _0x1675db[_0xceef('0x30')](_0x92dfa3);})[_0xceef('0x1f')](function(_0x70e06d){_0x31c093[_0xceef('0xbf')]=_0x70e06d['get']({'plain':!![]});_0x31c093[_0xceef('0xbf')]['created']=!_0x348a65;if(_0x31c093['interaction']['created']){if(_0x31c093[_0xceef('0xb4')][_0xceef('0xc1')]){_0x31c093[_0xceef('0xb1')]['push']({'id':0x0,'priority':_0x31c093[_0xceef('0xb1')]['length']+0x1,'app':_0xceef('0xc2'),'appdata':'unmanaged','interval':_0xceef('0xc3')});}}return db[_0xceef('0xc4')][_0xceef('0x66')]({'body':_0x2a7ef5['body'][_0xceef('0x67')],'ChatWebsiteId':_0x2a7ef5[_0xceef('0x64')]['id'],'ChatInteractionId':_0x70e06d['id'],'direction':'in','ContactId':_0x31c093['contact']['id'],'AttachmentId':_0x2a7ef5[_0xceef('0x67')][_0xceef('0xc5')]});})[_0xceef('0x1f')](function(_0x25edc4){_0x31c093[_0xceef('0x26')]=_0x25edc4;if(!_0x31c093['interaction'][_0xceef('0xc6')]){return;}return db['User']['find']({'attributes':['id',_0xceef('0x37')],'where':{'id':_0x31c093[_0xceef('0xbf')][_0xceef('0xc6')]}});})['then'](function(_0x129ada){if(_0x129ada){_0x31c093['applications'][_0xceef('0xc7')]({'id':0x0,'priority':0x0,'app':_0xceef('0xc8'),'appdata':_0x129ada['name']+','+(_0x31c093['account'][_0xceef('0xc9')]||0xa),'interval':_0xceef('0xc3')});_0x31c093[_0xceef('0xca')]=!![];}if(!_0x31c093['interaction']['queueId']){return;}return db[_0xceef('0xcb')][_0xceef('0x76')]({'attributes':['id',_0xceef('0x37')],'where':{'id':_0x31c093['interaction']['queueId']}});})['then'](function(_0xf5c3ac){if(_0xf5c3ac){_0x31c093['applications'][_0xceef('0xc7')]({'id':0x0,'priority':0x1,'app':_0xceef('0xcc'),'appdata':_0xf5c3ac[_0xceef('0x37')]+','+(_0x31c093[_0xceef('0xb4')][_0xceef('0xcd')]||0x12c),'interval':_0xceef('0xc3')});}return respondWithRpcPromise(_0xceef('0xce'),_0xceef('0xcf'),_0x31c093);})[_0xceef('0x1f')](function(_0x44225b){respondWithRpcPromise(_0xceef('0xd0'),_0xceef('0xd0'),{'event':_0xceef('0xd1'),'message':_0x44225b},client9002);return _0x44225b;})[_0xceef('0x1f')](respondWithResult(_0x53810a,null))[_0xceef('0x27')](APIHandleError(_0x53810a));};exports[_0xceef('0xd2')]=function(_0x3927c8,_0x340750){var _0x3fecb7,_0x2f0c7c,_0x4f58f0;var _0x5de40b=[];var _0x350630={};var _0x5c87ed=_0x3927c8[_0xceef('0xd3')]||[];var _0x4eaf54=[];var _0x4c2478;return db[_0xceef('0xa2')][_0xceef('0xa3')]()[_0xceef('0x1f')](function(_0x9d7b66){if(!_0x9d7b66){throw new db['Sequelize'][(_0xceef('0xd4'))]('no\x20available\x20attributes');}_0x5de40b=_[_0xceef('0xd5')](_[_0xceef('0x54')](_0x9d7b66),[_0xceef('0xa5'),_0xceef('0xa6'),_0xceef('0xa8'),_0xceef('0xb7')]);if(_0x3927c8[_0xceef('0x67')]['id']){delete _0x3927c8[_0xceef('0x67')]['id'];}if(_[_0xceef('0x9b')](_0x3927c8[_0xceef('0x67')]['from'])){throw _0x340750['status'](0x1f4)['send'](new db[(_0xceef('0xd6'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xceef('0x9b')](_0x3927c8[_0xceef('0x67')][_0xceef('0x67')])||_0x3927c8[_0xceef('0x67')]['body']===''){throw _0x340750[_0xceef('0x28')](0x1f4)['send'](new db[(_0xceef('0xd6'))][(_0xceef('0xd4'))](_0xceef('0xd7')));}if(_[_0xceef('0x9b')](_0x3927c8[_0xceef('0x67')][_0xceef('0xd8')])){throw _0x340750['status'](0x1f4)[_0xceef('0x38')](new db[(_0xceef('0xd6'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5de40b));}if(!_[_0xceef('0xa7')](_0x5de40b,_0x3927c8[_0xceef('0x67')]['mapKeyOffline'])){throw _0x340750[_0xceef('0x28')](0x1f4)[_0xceef('0x38')](new db['Sequelize'][(_0xceef('0xd4'))](_0xceef('0xd9')+_0x5de40b));}_0x350630[_0x3927c8['body'][_0xceef('0xd8')]]=_0x3927c8[_0xceef('0x67')][_0xceef('0xaa')];})[_0xceef('0x1f')](function(){return db[_0xceef('0x4f')][_0xceef('0x76')]({'where':{'id':_0x3927c8[_0xceef('0x64')]['id']},'include':[{'model':db[_0xceef('0xab')],'as':_0xceef('0xb6')},{'model':db[_0xceef('0xda')],'as':_0xceef('0xda')}]});})[_0xceef('0x1f')](handleEntityNotFound(_0x340750,null))[_0xceef('0x1f')](function(_0x441d83){if(_0x441d83&&_0x441d83[_0xceef('0xb6')]){_0x2f0c7c=_0x441d83;var _0xb78892=_[_0xceef('0x17')](_0x3927c8[_0xceef('0x67')],{'firstName':_0x3927c8[_0xceef('0x67')]['from'],'phone':_0x3927c8[_0xceef('0x67')][_0xceef('0xaa')],'ListId':_0x441d83[_0xceef('0xb7')]});_0xb78892[_0x3927c8['body'][_0xceef('0xd8')]]=_0x3927c8[_0xceef('0x67')][_0xceef('0xaa')];return db[_0xceef('0xa2')][_0xceef('0xdb')]({'where':_0x350630,'defaults':_0xb78892});}})[_0xceef('0xdc')](function(_0x280676){if(_0x280676){_0x4f58f0=_0x280676;var _0x39dda4=fs[_0xceef('0xdd')](path[_0xceef('0x8c')](config[_0xceef('0x8d')],_0xceef('0xde')),_0xceef('0xdf'));var _0x3e2eb7=ejs[_0xceef('0xe0')](_0x39dda4,{'body':_[_0xceef('0xe1')](_0x3927c8[_0xceef('0x67')][_0xceef('0x67')]),'bodyTitle':_0x2f0c7c[_0xceef('0xe2')]});return db[_0xceef('0xe3')][_0xceef('0x66')]({'body':_0x3e2eb7,'plainBody':htmlToText[_0xceef('0xe4')](_0x3e2eb7),'ContactId':_0x280676['id'],'ChatWebsiteId':_0x2f0c7c['id']});}})['then'](function(_0x32ad94){_0x4c2478=_0x32ad94;if(_0x5c87ed[_0xceef('0x58')]){var _0x624e=_0x5c87ed['map'](function(_0x51ecf8){return{'name':_0x51ecf8['originalname'],'basename':_0x51ecf8[_0xceef('0x85')],'type':_0x51ecf8[_0xceef('0xe5')],'ChatOfflineMessageId':_0x32ad94['id']};});_0x4eaf54=_0x624e[_0xceef('0x4e')](_0x51bed0=>{var _0x3403e1={'filename':_0x51bed0[_0xceef('0x37')],'path':path[_0xceef('0x8c')](config[_0xceef('0x8d')],_0xceef('0xe6'),_0xceef('0xd3'),_0xceef('0xe7'),'offline-chat',_0x51bed0[_0xceef('0xe8')])};return _0x3403e1;});if(!_0x2f0c7c['openNewInteraction']){return db['sequelize'][_0xceef('0xe9')](function(_0x4f0ccd){return db['Attachment']['bulkCreate'](_0x624e,{'transaction':_0x4f0ccd});});}}})[_0xceef('0x1f')](function(){if(_0x4c2478){_0x3fecb7=_0x4c2478;return db['MailAccount'][_0xceef('0x78')]({'where':{'service':!![]},'include':[{'model':db[_0xceef('0xea')],'as':_0xceef('0xeb'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xceef('0xec'),'raw':!![]}]}]});}})[_0xceef('0x1f')](function(_0x7d6d7c){if(_0x7d6d7c&&_0x7d6d7c[_0xceef('0xeb')]&&_0x2f0c7c[_0xceef('0xed')]&&_0x2f0c7c[_0xceef('0xee')]){var _0x130aff=_0x7d6d7c['getSmtpOptions']();return respondWithRpcPromise(_0xceef('0xef'),_0xceef('0xf0'),{'account':_0x130aff,'message':{'from':util[_0xceef('0x46')](_0xceef('0xf1'),_0x7d6d7c['name'],_0x7d6d7c[_0xceef('0xf2')]||_0x7d6d7c[_0xceef('0xeb')][_0xceef('0x6e')]),'to':_0x2f0c7c[_0xceef('0xee')],'subject':_0x2f0c7c['offlineMessageSubject'],'html':_0x3fecb7[_0xceef('0x67')],'attachments':_0x4eaf54}},client9003)[_0xceef('0x1f')](function(){return _0x3fecb7;})[_0xceef('0x27')](function(_0x34affc){logger[_0xceef('0x25')](_0x34affc);});}})[_0xceef('0x1f')](function(){if(_0x2f0c7c&&_0x2f0c7c[_0xceef('0xf3')]&&_0x2f0c7c[_0xceef('0xf4')]){var _0x2ba765=[];if(_0x5c87ed[_0xceef('0x58')]){_0x2ba765=_0x5c87ed[_0xceef('0x4e')](function(_0x2d6f70){return{'name':_0x2d6f70[_0xceef('0xf5')],'basename':_0x2d6f70['filename'],'type':_0x2d6f70[_0xceef('0xe5')],'ChatOfflineMessageId':_0x4c2478['id']};});}var _0x36cbb5;if(!_[_0xceef('0x9b')](_0x2f0c7c[_0xceef('0xf6')])){var _0x15e1cb=_['map'](_0x3927c8[_0xceef('0x67')],function(_0x592e51){return _0x592e51;});var _0x25bd04=_[_0xceef('0xf7')](_0x15e1cb)[0x0];var _0x3d852f=_[_0xceef('0xf8')](_0x25bd04,function(_0x3da485){return _0x3da485;});_0x36cbb5=_0x3d852f[0x1][_0x2f0c7c['subjectOffline']];}var _0x3caa10={'from':_0x4f58f0[_0xceef('0xf2')],'firstName':_0x4f58f0[_0xceef('0x40')],'lastName':_0x4f58f0[_0xceef('0x41')],'mapKey':_0xceef('0xf2'),'message':{'from':_0x4f58f0['email'],'to':_0x2f0c7c['MailAccount'][_0xceef('0xf2')],'cc':'','subject':_[_0xceef('0x9b')](_0x36cbb5)?_0x2f0c7c[_0xceef('0xf9')]:_0x36cbb5,'messageId':'','sentAt':new Date(),'attach':_0x2ba765[_0xceef('0x58')],'attachments':_0x2ba765,'originChannel':_0xceef('0xfa'),'ChatWebsiteId':_0x2f0c7c['id'],'ChatOfflineMessageId':_0x3fecb7['id'],'originTo':_0x2f0c7c['MailAccount'][_0xceef('0xf2')]},'body':_0x3fecb7[_0xceef('0x67')]};var _0xcd08c6={'account':{'id':_0x2f0c7c[_0xceef('0xf4')]},'body':_0x3caa10,'log':_0xceef('0xfb')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0xcd08c6,client9001)['then'](function(){return _0x3fecb7;})[_0xceef('0x27')](function(_0x1d1b15){logger[_0xceef('0x25')](_0x1d1b15);});}return;})[_0xceef('0x1f')](function(){if(_0x3fecb7){return _0x3fecb7;}})[_0xceef('0x1f')](respondWithResult(_0x340750,null))[_0xceef('0x27')](function(){for(var _0x3e9599 of _0x5c87ed){var _0x5aabef=path[_0xceef('0x8c')](config[_0xceef('0x8d')],_0xceef('0xe6'),_0xceef('0xd3'),'attachments','offline-chat',_0x3e9599['filename']);fs_extra['remove'](_0x5aabef)[_0xceef('0x27')](function(_0x55b4ef){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x5aabef,_0x55b4ef);});}});};exports['addInteraction']=function(_0x1e0cf2,_0x5248cf){return db[_0xceef('0xbb')][_0xceef('0x76')]({'where':{'id':_0x1e0cf2[_0xceef('0x64')]['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x5248cf,null))[_0xceef('0x1f')](function(_0x359a96){if(_0x359a96){return _0x359a96['addInteraction'](_0x1e0cf2[_0xceef('0x67')][_0xceef('0x81')],_['omit'](_0x1e0cf2[_0xceef('0x67')],[_0xceef('0x81'),'id'])||{});}})[_0xceef('0x1f')](respondWithResult(_0x5248cf,null))[_0xceef('0x27')](handleError(_0x5248cf,null));};exports['getInteractions']=function(_0x5a6b83,_0x2066dc){var _0x11d1d7={'raw':![],'where':{}};var _0x41797e={};var _0x557705={'count':0x0,'rows':[]};return db[_0xceef('0x4f')][_0xceef('0x78')]({'where':{'id':_0x5a6b83['params']['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x2066dc,null))[_0xceef('0x1f')](function(_0x7be1e2){if(_0x7be1e2){_0x41797e[_0xceef('0x49')]=_[_0xceef('0x54')](db['ChatInteraction']['rawAttributes']);_0x41797e[_0xceef('0x53')]=_[_0xceef('0x54')](_0x5a6b83[_0xceef('0x53')]);_0x41797e[_0xceef('0x55')]=_['intersection'](_0x41797e[_0xceef('0x49')],_0x41797e[_0xceef('0x53')]);_0x11d1d7[_0xceef('0x57')]=_[_0xceef('0x56')](_0x41797e[_0xceef('0x49')],qs['fields'](_0x5a6b83['query'][_0xceef('0x65')]));_0x11d1d7[_0xceef('0x57')]=_0x11d1d7[_0xceef('0x57')][_0xceef('0x58')]?_0x11d1d7[_0xceef('0x57')]:_0x41797e[_0xceef('0x49')];if(!_0x5a6b83[_0xceef('0x53')][_0xceef('0x7a')](_0xceef('0x7b'))){_0x11d1d7['limit']=qs[_0xceef('0x2c')](_0x5a6b83[_0xceef('0x53')][_0xceef('0x2c')]);_0x11d1d7[_0xceef('0x2a')]=qs['offset'](_0x5a6b83[_0xceef('0x53')]['offset']);}_0x11d1d7[_0xceef('0x59')]=qs[_0xceef('0x5a')](_0x5a6b83[_0xceef('0x53')]['sort']);_0x11d1d7[_0xceef('0x5b')]=qs[_0xceef('0x55')](_['pick'](_0x5a6b83[_0xceef('0x53')],_0x41797e[_0xceef('0x55')]));_0x11d1d7['where'][_0xceef('0x77')]=_0x7be1e2['id'];if(_0x5a6b83[_0xceef('0x53')][_0xceef('0x5d')]){_0x11d1d7[_0xceef('0x5b')]=_[_0xceef('0x5e')](_0x11d1d7[_0xceef('0x5b')],{'$or':_[_0xceef('0x4e')](_0x11d1d7['attributes'],function(_0x595973){var _0x9fe57d={};_0x9fe57d[_0x595973]={'$like':'%'+_0x5a6b83[_0xceef('0x53')][_0xceef('0x5d')]+'%'};return _0x9fe57d;})});}_0x11d1d7=_[_0xceef('0x5e')]({},_0x11d1d7,_0x5a6b83[_0xceef('0x60')]);return db['ChatInteraction'][_0xceef('0x2d')]({'where':_0x11d1d7[_0xceef('0x5b')]})[_0xceef('0x1f')](function(_0xf3392f){_0x557705['count']=_0xf3392f;if(_0x5a6b83[_0xceef('0x53')]['includeAll']){_0x11d1d7[_0xceef('0x62')]=[{'model':db[_0xceef('0xa2')],'as':_0xceef('0xfc'),'required':![]},{'model':db[_0xceef('0xfd')],'as':_0xceef('0xfe'),'attributes':[_0xceef('0x37'),_0xceef('0xff'),_0xceef('0x100')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xceef('0x37'),_0xceef('0x101')],'where':_0x5a6b83[_0xceef('0x53')][_0xceef('0x102')]?{'id':_0x5a6b83[_0xceef('0x53')][_0xceef('0x102')]}:undefined,'required':_0x5a6b83[_0xceef('0x53')][_0xceef('0x102')]?!![]:![]}];}return db[_0xceef('0xbb')]['findAll'](_0x11d1d7);})[_0xceef('0x1f')](function(_0x97e860){_0x557705[_0xceef('0x7c')]=_0x97e860;return _0x557705;});}})[_0xceef('0x1f')](respondWithFilteredResult(_0x2066dc,_0x11d1d7))[_0xceef('0x27')](handleError(_0x2066dc,null));};exports[_0xceef('0x103')]=function(_0x10119f,_0x2e6656){var _0x5c9f5f=0x0;var _0x300ba3=0x0;var _0x1af1cb=![];var _0x468ff6;var _0x58e363;return db[_0xceef('0x4f')][_0xceef('0x76')]({'where':{'id':_0x10119f[_0xceef('0x64')]['id']},'include':[{'model':db[_0xceef('0x9c')],'as':_0xceef('0x9c'),'include':[{'model':db[_0xceef('0x9c')],'as':_0xceef('0x104'),'attributes':['id',_0xceef('0xb0')]}]}]})[_0xceef('0x1f')](handleEntityNotFound(_0x2e6656,null))[_0xceef('0x1f')](function(_0x344ff2){if(_0x344ff2){_0x468ff6=_0x344ff2;return _0x344ff2[_0xceef('0x105')]({'raw':!![]});}})[_0xceef('0x1f')](function(_0x514915){if(_0x468ff6){if(_0x514915){_0x58e363=_0x514915;}}return require(_0xceef('0x106'))[_0xceef('0x8f')]();})['then'](function(_0x35e4d1){if(_0x35e4d1){_0x300ba3=_0x35e4d1[_0xceef('0x107')];_0x1af1cb=_0x35e4d1[_0xceef('0x90')];}})[_0xceef('0x1f')](function(){return db[_0xceef('0xbb')]['count']({'where':{'closed':![]}});})[_0xceef('0x1f')](function(_0x1ced39){_0x5c9f5f=_0x1ced39;if(_0x300ba3&&_0x1ced39>_0x300ba3){return db[_0xceef('0x108')][_0xceef('0x78')]({'where':{'id':0x1}})['then'](function(_0xf2649c){if(_0xf2649c){_0xf2649c[_0xceef('0x109')](_0xceef('0x10a'));}});}})[_0xceef('0x1f')](function(){var _0x127a1e=_0x468ff6[_0xceef('0x9c')];var _0x2c840b=_0x468ff6['timezone']||undefined;return _0x127a1e?_0x127a1e[_0xceef('0x10b')](_0x2c840b):!![];})[_0xceef('0x1f')](function(_0x4e94c1){var _0x2b50e0=fs[_0xceef('0xdd')](path[_0xceef('0x8c')](config[_0xceef('0x8d')],_0xceef('0x10c')),_0xceef('0xdf'));var _0x2c3ccb=_0xceef('0x10d');var _0x381ea2=![];var _0x59f9ff,_0xe796e0;if(_0x10119f['headers']['referer']){_0x59f9ff=new URL(_0x10119f[_0xceef('0x10e')][_0xceef('0x43')])[_0xceef('0x10f')];}else if(_0x10119f[_0xceef('0x10e')]['origin']){_0x59f9ff=new URL(_0x10119f['headers'][_0xceef('0x10f')])[_0xceef('0x10f')];}else{_0x59f9ff=_0xceef('0x110');}_0xe796e0=typeof _0x468ff6['address'][_0xceef('0x74')](',')[_0xceef('0x76')](function(_0x545eef){return wildcardUtils[_0xceef('0x111')](_0x545eef,_0x59f9ff);})!==_0xceef('0x2b');var _0x4a656a={'chatVersion':_0x2c3ccb,'chatWebsiteAddressOrigin':_0xe796e0?_0x59f9ff:_0x468ff6['address'],'remote':_0x468ff6[_0xceef('0x112')],'query':querystring[_0xceef('0x24')](_['merge'](_0x468ff6[_0xceef('0x32')]({'plain':!![]}),{'customerIp':_0x10119f['headers']['x-forwarded-for']||_0x10119f[_0xceef('0x10e')][_0xceef('0x113')]||_0x10119f[_0xceef('0x114')]['remoteAddress']||_0x10119f['ip'],'referer':_0x10119f['headers'][_0xceef('0x43')],'openedInteractions':_0x5c9f5f,'maxInteractions':_0x300ba3,'virtual':_0x1af1cb['virtual'],'online':_0x4e94c1,'custom':_0x1af1cb,'address':_0xe796e0?_0x59f9ff:null}))[_0xceef('0x115')](/'/g,'\x5c\x27')};_0x2e6656[_0xceef('0x38')](ejs[_0xceef('0xe0')](Mustache[_0xceef('0xe0')](_0x2b50e0,_0x4a656a),{'proactiveActions':_0x58e363,'alignment':_0x468ff6[_0xceef('0x116')],'verticalAlignment':_0x468ff6['verticalAlignment'],'div_color':_0x468ff6['color'],'labelText':_0x468ff6[_0xceef('0x117')],'text_color':_0x468ff6[_0xceef('0x118')],'text_button_color':_0x468ff6[_0xceef('0x119')],'button_color':_0x468ff6[_0xceef('0x11a')],'background_color':_0x468ff6[_0xceef('0x11b')],'hideWhenOffline':_0x468ff6[_0xceef('0x11c')],'intervalId':_0x468ff6[_0xceef('0x11d')],'isDevelopment':_0x381ea2,'chatVersion':_0x2c3ccb}));})[_0xceef('0x27')](handleError(_0x2e6656,null));};exports[_0xceef('0x11e')]=function(_0x1451eb,_0x16a9aa){var _0x791c20=_0x1451eb[_0xceef('0x64')]['id'];var _0x6f6cc5=_0x1451eb['body'];var _0x13251f=0xc8;var _0x3e6e7e=null;return db[_0xceef('0x11f')][_0xceef('0xe9')]({'isolationLevel':db[_0xceef('0x11f')][_0xceef('0x120')][_0xceef('0x121')][_0xceef('0x122')]},function(_0x2b4d31){return db['ChatWebsite'][_0xceef('0x78')]({'where':{'id':_0x791c20},'transaction':_0x2b4d31})[_0xceef('0x1f')](function(_0x526478){if(_0x526478){return db[_0xceef('0xae')]['destroy']({'where':{'ChatWebsiteId':_0x791c20},'transaction':_0x2b4d31})[_0xceef('0x1f')](function(){var _0x155763=_[_0xceef('0x4e')](_0x6f6cc5,function(_0x2e1d53){_0x2e1d53[_0xceef('0x77')]=_0x791c20;return _0x2e1d53;});return db[_0xceef('0xae')][_0xceef('0x123')](_0x155763,{'transaction':_0x2b4d31});});}else{_0x13251f=0x194;_0x3e6e7e=[];}});})[_0xceef('0x1f')](function(){if(_0x13251f!==0x194){return db[_0xceef('0xae')][_0xceef('0x124')]({'where':{'ChatWebsiteId':_0x791c20},'order':_0xceef('0xb3')})[_0xceef('0x1f')](function(_0x49500c){_0x3e6e7e=_0x49500c;});}})[_0xceef('0x27')](function(_0x4ea15d){_0x13251f=0x1f4;logger['error'](_0x4ea15d[_0xceef('0x36')]);if(_0x4ea15d[_0xceef('0x37')]){delete _0x4ea15d['name'];}_0x3e6e7e=_0x4ea15d;})[_0xceef('0x125')](function(){if(_0x3e6e7e===null){_0x16a9aa[_0xceef('0x35')](_0x13251f);}else{if(_0x13251f===0x1f4){_0x16a9aa[_0xceef('0x28')](_0x13251f)['send'](_0x3e6e7e);}else{_0x16a9aa[_0xceef('0x28')](_0x13251f)['json'](_0x3e6e7e);}}});};exports[_0xceef('0x126')]=function(_0xc8df09,_0x54c280){var _0x580b27={};var _0x27aa1c={};var _0xfb01fa;var _0x49660e;return db[_0xceef('0x4f')][_0xceef('0x78')]({'where':{'id':_0xc8df09[_0xceef('0x64')]['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x54c280,null))['then'](function(_0x3dbfc5){if(_0x3dbfc5){_0xfb01fa=_0x3dbfc5;_0x27aa1c[_0xceef('0x49')]=_[_0xceef('0x54')](db[_0xceef('0xae')][_0xceef('0x50')]);_0x27aa1c['query']=_[_0xceef('0x54')](_0xc8df09[_0xceef('0x53')]);_0x27aa1c[_0xceef('0x55')]=_[_0xceef('0x56')](_0x27aa1c[_0xceef('0x49')],_0x27aa1c[_0xceef('0x53')]);_0x580b27[_0xceef('0x57')]=_[_0xceef('0x56')](_0x27aa1c[_0xceef('0x49')],qs['fields'](_0xc8df09[_0xceef('0x53')][_0xceef('0x65')]));_0x580b27[_0xceef('0x57')]=_0x580b27['attributes'][_0xceef('0x58')]?_0x580b27[_0xceef('0x57')]:_0x27aa1c[_0xceef('0x49')];_0x580b27['order']=qs[_0xceef('0x5a')](_0xc8df09[_0xceef('0x53')]['sort']);_0x580b27['where']=qs['filters'](_[_0xceef('0x5c')](_0xc8df09['query'],_0x27aa1c[_0xceef('0x55')]));if(_0xc8df09[_0xceef('0x53')][_0xceef('0x5d')]){_0x580b27[_0xceef('0x5b')]=_['merge'](_0x580b27[_0xceef('0x5b')],{'$or':_[_0xceef('0x4e')](_0x580b27[_0xceef('0x57')],function(_0x16bb88){var _0x53245b={};_0x53245b[_0x16bb88]={'$like':'%'+_0xc8df09['query'][_0xceef('0x5d')]+'%'};return _0x53245b;})});}_0x580b27=_[_0xceef('0x5e')]({},_0x580b27,_0xc8df09[_0xceef('0x60')]);return _0xfb01fa[_0xceef('0x126')](_0x580b27);}})[_0xceef('0x1f')](function(_0xadb0ab){if(_0xadb0ab){_0x49660e=_0xadb0ab[_0xceef('0x58')];if(!_0xc8df09['query'][_0xceef('0x7a')](_0xceef('0x7b'))){_0x580b27[_0xceef('0x2c')]=qs['limit'](_0xc8df09[_0xceef('0x53')][_0xceef('0x2c')]);_0x580b27[_0xceef('0x2a')]=qs[_0xceef('0x2a')](_0xc8df09[_0xceef('0x53')][_0xceef('0x2a')]);}return _0xfb01fa['getApplications'](_0x580b27);}})[_0xceef('0x1f')](function(_0x586372){if(_0x586372){return _0x586372?{'count':_0x49660e,'rows':_0x586372}:null;}})[_0xceef('0x1f')](respondWithResult(_0x54c280,null))[_0xceef('0x27')](handleError(_0x54c280,null));};exports['addProactiveActions']=function(_0x19ce1f,_0x3b5f60){return db['chatProactiveAction'][_0xceef('0x76')]({'where':{'id':_0x19ce1f[_0xceef('0x64')]['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x3b5f60,null))[_0xceef('0x1f')](function(_0x43c188){if(_0x43c188){return _0x43c188[_0xceef('0x127')](_0x19ce1f[_0xceef('0x67')][_0xceef('0x81')],_[_0xceef('0x128')](_0x19ce1f[_0xceef('0x67')],[_0xceef('0x81'),'id'])||{});}})[_0xceef('0x1f')](respondWithResult(_0x3b5f60,null))[_0xceef('0x27')](handleError(_0x3b5f60,null));};exports['getProactiveActions']=function(_0x7c6222,_0x5b2ca0){var _0x304d25={};var _0x507004={};var _0x2d9300;var _0x3107f7;return db[_0xceef('0x4f')][_0xceef('0x78')]({'where':{'id':_0x7c6222[_0xceef('0x64')]['id']}})['then'](handleEntityNotFound(_0x5b2ca0,null))['then'](function(_0x18506c){if(_0x18506c){_0x2d9300=_0x18506c;_0x507004[_0xceef('0x49')]=_['keys'](db[_0xceef('0x129')][_0xceef('0x50')]);_0x507004[_0xceef('0x53')]=_[_0xceef('0x54')](_0x7c6222['query']);_0x507004['filters']=_[_0xceef('0x56')](_0x507004[_0xceef('0x49')],_0x507004[_0xceef('0x53')]);_0x304d25[_0xceef('0x57')]=_['intersection'](_0x507004['model'],qs[_0xceef('0x65')](_0x7c6222[_0xceef('0x53')][_0xceef('0x65')]));_0x304d25[_0xceef('0x57')]=_0x304d25[_0xceef('0x57')][_0xceef('0x58')]?_0x304d25['attributes']:_0x507004['model'];_0x304d25['order']=qs['sort'](_0x7c6222[_0xceef('0x53')][_0xceef('0x5a')]);_0x304d25[_0xceef('0x5b')]=qs[_0xceef('0x55')](_[_0xceef('0x5c')](_0x7c6222['query'],_0x507004['filters']));if(_0x7c6222[_0xceef('0x53')][_0xceef('0x5d')]){_0x304d25[_0xceef('0x5b')]=_['merge'](_0x304d25['where'],{'$or':_['map'](_0x304d25[_0xceef('0x57')],function(_0xab3db9){var _0x5e0752={};_0x5e0752[_0xab3db9]={'$like':'%'+_0x7c6222['query']['filter']+'%'};return _0x5e0752;})});}_0x304d25=_[_0xceef('0x5e')]({},_0x304d25,_0x7c6222['options']);return _0x2d9300[_0xceef('0x105')](_0x304d25);}})[_0xceef('0x1f')](function(_0x1042f9){if(_0x1042f9){_0x3107f7=_0x1042f9[_0xceef('0x58')];if(!_0x7c6222[_0xceef('0x53')][_0xceef('0x7a')](_0xceef('0x7b'))){_0x304d25['limit']=qs['limit'](_0x7c6222[_0xceef('0x53')][_0xceef('0x2c')]);_0x304d25[_0xceef('0x2a')]=qs[_0xceef('0x2a')](_0x7c6222[_0xceef('0x53')][_0xceef('0x2a')]);}return _0x2d9300['getProactiveActions'](_0x304d25);}})[_0xceef('0x1f')](function(_0x45e622){if(_0x45e622){return _0x45e622?{'count':_0x3107f7,'rows':_0x45e622}:null;}})['then'](respondWithResult(_0x5b2ca0,null))[_0xceef('0x27')](handleError(_0x5b2ca0,null));};exports[_0xceef('0x12a')]=function(_0x335fa3,_0x34ecc3){var _0x17e8c3=_0x335fa3[_0xceef('0x53')][_0xceef('0x12b')]==='false'?_0xceef('0x12c'):_0xceef('0x12d');return db[_0xceef('0x4f')][_0xceef('0x76')]({'attributes':['id',_0x17e8c3],'where':{'id':_0x335fa3[_0xceef('0x64')]['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x34ecc3,null))[_0xceef('0x1f')](function(_0x31d9b9){if(_0x31d9b9){var _0x398e02=_0x31d9b9[_0x17e8c3];var _0xcdae10=_0x398e02&&_0x398e02['items']?_0x398e02['items']:[];_0x34ecc3[_0xceef('0x38')]({'fromKey':_[_0xceef('0x9b')](_0x398e02[_0xceef('0x12e')])?undefined:_0x398e02[_0xceef('0x12e')],'count':_0xcdae10[_0xceef('0x58')],'rows':_0xcdae10});}})['catch'](handleError(_0x34ecc3,null));};exports[_0xceef('0x12f')]=function(_0x180bc2,_0x5457ef){var _0x4ee7bc={'raw':![],'where':{}};var _0x4bf172={};var _0x59497b={'count':0x0,'rows':[]};return db[_0xceef('0x4f')][_0xceef('0x78')]({'where':{'id':_0x180bc2['params']['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x5457ef,null))[_0xceef('0x1f')](function(_0x815a3c){if(_0x815a3c){_0x4bf172[_0xceef('0x49')]=_['keys'](db['ChatOfflineMessage'][_0xceef('0x50')]);_0x4bf172['query']=_['keys'](_0x180bc2[_0xceef('0x53')]);_0x4bf172[_0xceef('0x55')]=_['intersection'](_0x4bf172[_0xceef('0x49')],_0x4bf172[_0xceef('0x53')]);_0x4ee7bc[_0xceef('0x57')]=_[_0xceef('0x56')](_0x4bf172[_0xceef('0x49')],qs[_0xceef('0x65')](_0x180bc2[_0xceef('0x53')][_0xceef('0x65')]));_0x4ee7bc[_0xceef('0x57')]=_0x4ee7bc['attributes']['length']?_0x4ee7bc[_0xceef('0x57')]:_0x4bf172['model'];if(!_0x180bc2['query'][_0xceef('0x7a')]('nolimit')){_0x4ee7bc[_0xceef('0x2c')]=qs[_0xceef('0x2c')](_0x180bc2[_0xceef('0x53')]['limit']);_0x4ee7bc['offset']=qs['offset'](_0x180bc2[_0xceef('0x53')]['offset']);}_0x4ee7bc[_0xceef('0x59')]=qs['sort'](_0x180bc2['query'][_0xceef('0x5a')]);_0x4ee7bc['where']=qs['filters'](_['pick'](_0x180bc2[_0xceef('0x53')],_0x4bf172[_0xceef('0x55')]));_0x4ee7bc[_0xceef('0x5b')][_0xceef('0x77')]=_0x815a3c['id'];if(_0x180bc2[_0xceef('0x53')][_0xceef('0x5d')]){_0x4ee7bc['where']=_[_0xceef('0x5e')](_0x4ee7bc[_0xceef('0x5b')],{'$or':_['map'](_0x4ee7bc[_0xceef('0x57')],function(_0x5a7897){var _0x29b130={};_0x29b130[_0x5a7897]={'$like':'%'+_0x180bc2['query'][_0xceef('0x5d')]+'%'};return _0x29b130;})});}_0x4ee7bc=_[_0xceef('0x5e')]({},_0x4ee7bc,_0x180bc2[_0xceef('0x60')]);return db[_0xceef('0xe3')][_0xceef('0x2d')]({'where':_0x4ee7bc['where']})[_0xceef('0x1f')](function(_0x59b40d){_0x59497b[_0xceef('0x2d')]=_0x59b40d;if(_0x180bc2[_0xceef('0x53')][_0xceef('0x61')]){_0x4ee7bc[_0xceef('0x62')]=[{'all':!![]}];}else{_0x4ee7bc['include']=[{'model':db[_0xceef('0xa2')],'as':_0xceef('0xfc'),'required':![]},{'model':db['Attachment'],'as':_0xceef('0x130'),'required':![]}];}return db[_0xceef('0xe3')][_0xceef('0x63')](_0x4ee7bc);})[_0xceef('0x1f')](function(_0x798650){_0x59497b[_0xceef('0x7c')]=_0x798650;return _0x59497b;});}})[_0xceef('0x1f')](respondWithFilteredResult(_0x5457ef,_0x4ee7bc))[_0xceef('0x27')](handleError(_0x5457ef,null));};exports[_0xceef('0x131')]=function(_0x342bac,_0x1a69ef){return db[_0xceef('0x4f')][_0xceef('0x76')]({'where':{'id':_0x342bac[_0xceef('0x64')]['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x1a69ef,null))[_0xceef('0x1f')](function(_0xc291d9){if(_0xc291d9){return _0xc291d9[_0xceef('0x131')](_0x342bac['body'][_0xceef('0x81')],_['omit'](_0x342bac[_0xceef('0x67')],[_0xceef('0x81'),'id'])||{})['spread'](function(_0x14a907){for(var _0x4b6ba3=0x0;_0x4b6ba3<_0x342bac[_0xceef('0x67')][_0xceef('0x81')]['length'];_0x4b6ba3+=0x1){socket[_0xceef('0x132')](_0xceef('0x133'),{'UserId':Number(_0x342bac[_0xceef('0x67')][_0xceef('0x81')][_0x4b6ba3]),'ChatWebsiteId':Number(_0x342bac[_0xceef('0x64')]['id'])});}return _0x14a907;});}})[_0xceef('0x1f')](respondWithResult(_0x1a69ef,null))[_0xceef('0x27')](handleError(_0x1a69ef,null));};exports['removeAgents']=function(_0xe61173,_0x46ddab){return db[_0xceef('0x4f')][_0xceef('0x76')]({'where':{'id':_0xe61173[_0xceef('0x64')]['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x46ddab,null))[_0xceef('0x1f')](function(_0x28d53f){if(_0x28d53f){return _0x28d53f[_0xceef('0x134')](_0xe61173['query'][_0xceef('0x81')])['then'](function(){if(_['isArray'](_0xe61173['query'][_0xceef('0x81')])){for(var _0x43e7e3=0x0;_0x43e7e3<_0xe61173[_0xceef('0x53')]['ids'][_0xceef('0x58')];_0x43e7e3+=0x1){socket['emit'](_0xceef('0x135'),{'UserId':Number(_0xe61173['query'][_0xceef('0x81')][_0x43e7e3]),'ChatWebsiteId':Number(_0xe61173['params']['id'])});}}else{socket[_0xceef('0x132')]('userChatWebsite:remove',{'UserId':Number(_0xe61173[_0xceef('0x53')][_0xceef('0x81')]),'ChatWebsiteId':Number(_0xe61173[_0xceef('0x64')]['id'])});}});}})[_0xceef('0x1f')](respondWithStatusCode(_0x46ddab,null))[_0xceef('0x27')](handleError(_0x46ddab,null));};exports['getAgents']=function(_0x38df53,_0x5c7417){var _0x54e08d={};var _0x3d9888={};var _0x39dee4;var _0x10a5e6;return db['ChatWebsite'][_0xceef('0x78')]({'where':{'id':_0x38df53['params']['id']}})[_0xceef('0x1f')](handleEntityNotFound(_0x5c7417,null))[_0xceef('0x1f')](function(_0x477e23){if(_0x477e23){_0x39dee4=_0x477e23;_0x3d9888[_0xceef('0x49')]=_[_0xceef('0x54')](db['User'][_0xceef('0x50')]);_0x3d9888[_0xceef('0x53')]=_[_0xceef('0x54')](_0x38df53[_0xceef('0x53')]);_0x3d9888[_0xceef('0x55')]=_[_0xceef('0x56')](_0x3d9888[_0xceef('0x49')],_0x3d9888[_0xceef('0x53')]);_0x54e08d[_0xceef('0x57')]=_[_0xceef('0x56')](_0x3d9888[_0xceef('0x49')],qs[_0xceef('0x65')](_0x38df53[_0xceef('0x53')][_0xceef('0x65')]));_0x54e08d[_0xceef('0x57')]=_0x54e08d['attributes'][_0xceef('0x58')]?_0x54e08d[_0xceef('0x57')]:_0x3d9888[_0xceef('0x49')];_0x54e08d[_0xceef('0x59')]=qs['sort'](_0x38df53[_0xceef('0x53')][_0xceef('0x5a')]);_0x54e08d[_0xceef('0x5b')]=qs['filters'](_['pick'](_0x38df53[_0xceef('0x53')],_0x3d9888['filters']));if(_0x38df53[_0xceef('0x53')][_0xceef('0x5d')]){_0x54e08d[_0xceef('0x5b')]=_['merge'](_0x54e08d[_0xceef('0x5b')],{'$or':_[_0xceef('0x4e')](_0x54e08d['attributes'],function(_0x1e7410){var _0x30e035={};_0x30e035[_0x1e7410]={'$like':'%'+_0x38df53['query'][_0xceef('0x5d')]+'%'};return _0x30e035;})});}_0x54e08d=_[_0xceef('0x5e')]({},_0x54e08d,_0x38df53['options']);return _0x39dee4[_0xceef('0x136')](_0x54e08d);}})[_0xceef('0x1f')](function(_0x1b6cef){if(_0x1b6cef){_0x10a5e6=_0x1b6cef[_0xceef('0x58')];if(!_0x38df53[_0xceef('0x53')][_0xceef('0x7a')](_0xceef('0x7b'))){_0x54e08d[_0xceef('0x2c')]=qs[_0xceef('0x2c')](_0x38df53[_0xceef('0x53')][_0xceef('0x2c')]);_0x54e08d[_0xceef('0x2a')]=qs[_0xceef('0x2a')](_0x38df53[_0xceef('0x53')][_0xceef('0x2a')]);}return _0x39dee4[_0xceef('0x136')](_0x54e08d);}})[_0xceef('0x1f')](function(_0x258bba){if(_0x258bba){return _0x258bba?{'count':_0x10a5e6,'rows':_0x258bba}:null;}})[_0xceef('0x1f')](respondWithResult(_0x5c7417,null))[_0xceef('0x27')](handleError(_0x5c7417,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 2aeb761..d7da983 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 _0xb7c8=['exports','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb7c8,0x119));var _0x8b7c=function(_0x51ef3f,_0xc037d6){_0x51ef3f=_0x51ef3f-0x0;var _0x14956c=_0xb7c8[_0x51ef3f];return _0x14956c;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x8b7c('0x0'))['db'][_0x8b7c('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8b7c('0x2')](0x0);var events={'afterCreate':_0x8b7c('0x3'),'afterUpdate':_0x8b7c('0x4'),'afterDestroy':_0x8b7c('0x5')};function emitEvent(_0x396b64){return function(_0x50113e,_0x38672b,_0x412f93){ChatWebsiteEvents[_0x8b7c('0x6')](_0x396b64+':'+_0x50113e['id'],_0x50113e);ChatWebsiteEvents[_0x8b7c('0x6')](_0x396b64,_0x50113e);_0x412f93(null);};}for(var e in events){if(events[_0x8b7c('0x7')](e)){var event=events[e];ChatWebsite[_0x8b7c('0x8')](e,emitEvent(event));}}module[_0x8b7c('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x98a8=['remove','emit','hook','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98a8,0x12c));var _0x898a=function(_0x56c37f,_0x46a434){_0x56c37f=_0x56c37f-0x0;var _0x13fa9d=_0x98a8[_0x56c37f];return _0x13fa9d;};'use strict';var EventEmitter=require(_0x898a('0x0'));var ChatWebsite=require(_0x898a('0x1'))['db'][_0x898a('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x898a('0x3')](0x0);var events={'afterCreate':_0x898a('0x4'),'afterUpdate':_0x898a('0x5'),'afterDestroy':_0x898a('0x6')};function emitEvent(_0x4a0836){return function(_0x2bb3e2,_0xf84a19,_0x1b3dd0){ChatWebsiteEvents[_0x898a('0x7')](_0x4a0836+':'+_0x2bb3e2['id'],_0x2bb3e2);ChatWebsiteEvents[_0x898a('0x7')](_0x4a0836,_0x2bb3e2);_0x1b3dd0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x898a('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index fec586d..45627be 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 _0x8d84=['define','chat_websites','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x262c93,_0x1ea044){var _0x2c5ffb=function(_0x5ac2fa){while(--_0x5ac2fa){_0x262c93['push'](_0x262c93['shift']());}};_0x2c5ffb(++_0x1ea044);}(_0x8d84,0x1e6));var _0x48d8=function(_0x5bbfd9,_0x382604){_0x5bbfd9=_0x5bbfd9-0x0;var _0x3e8e4a=_0x8d84[_0x5bbfd9];return _0x3e8e4a;};'use strict';var _=require(_0x48d8('0x0'));var util=require(_0x48d8('0x1'));var logger=require(_0x48d8('0x2'))(_0x48d8('0x3'));var moment=require(_0x48d8('0x4'));var BPromise=require('bluebird');var rp=require(_0x48d8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48d8('0x6'));var config=require(_0x48d8('0x7'));var attributes=require(_0x48d8('0x8'));module['exports']=function(_0x3ecaa7,_0x4fb484){return _0x3ecaa7[_0x48d8('0x9')]('ChatWebsite',attributes,{'tableName':_0x48d8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x982a=['request-promise','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','moment','bluebird'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x982a,0x104));var _0xa982=function(_0x1b87f6,_0x5a5ac9){_0x1b87f6=_0x1b87f6-0x0;var _0x597ca3=_0x982a[_0x1b87f6];return _0x597ca3;};'use strict';var _=require('lodash');var util=require(_0xa982('0x0'));var logger=require(_0xa982('0x1'))('api');var moment=require(_0xa982('0x2'));var BPromise=require(_0xa982('0x3'));var rp=require(_0xa982('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa982('0x5'));var attributes=require(_0xa982('0x6'));module[_0xa982('0x7')]=function(_0x1e39e2,_0x537ada){return _0x1e39e2[_0xa982('0x8')](_0xa982('0x9'),attributes,{'tableName':_0xa982('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index d7da9bc..e9929d0 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 _0xa02a=['defaults','localhost','socket.io-emitter','redis','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x462162,_0x3d8348){var _0x22881c=function(_0xafa602){while(--_0xafa602){_0x462162['push'](_0x462162['shift']());}};_0x22881c(++_0x3d8348);}(_0xa02a,0xc6));var _0xaa02=function(_0x55e461,_0x4ca0a0){_0x55e461=_0x55e461-0x0;var _0x181c13=_0xa02a[_0x55e461];return _0x181c13;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaa02('0x0'));var BPromise=require(_0xaa02('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa02('0x2'))['db'];var utils=require(_0xaa02('0x3'));var logger=require(_0xaa02('0x4'))(_0xaa02('0x5'));var config=require(_0xaa02('0x6'));var jayson=require(_0xaa02('0x7'));var client=jayson[_0xaa02('0x8')][_0xaa02('0x9')]({'port':0x232a});config['redis']=_[_0xaa02('0xa')](config['redis'],{'host':_0xaa02('0xb'),'port':0x18eb});var socket=require(_0xaa02('0xc'))(new Redis(config[_0xaa02('0xd')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x5ba7fa,_0x35711c,_0x5e9f71){return new BPromise(function(_0x5b13c2,_0x11ba9f){return client[_0xaa02('0xe')](_0x5ba7fa,_0x5e9f71)[_0xaa02('0xf')](function(_0x2fe111){logger[_0xaa02('0x10')](_0xaa02('0x11'),_0x35711c,_0xaa02('0x12'));logger[_0xaa02('0x13')](_0xaa02('0x14'),_0x35711c,'request\x20sent',JSON[_0xaa02('0x15')](_0x2fe111));if(_0x2fe111['error']){if(_0x2fe111[_0xaa02('0x16')][_0xaa02('0x17')]===0x1f4){logger[_0xaa02('0x16')](_0xaa02('0x11'),_0x35711c,_0x2fe111['error']['message']);return _0x11ba9f(_0x2fe111['error']['message']);}logger[_0xaa02('0x16')](_0xaa02('0x11'),_0x35711c,_0x2fe111[_0xaa02('0x16')][_0xaa02('0x18')]);return _0x5b13c2(_0x2fe111[_0xaa02('0x16')][_0xaa02('0x18')]);}else{logger[_0xaa02('0x10')](_0xaa02('0x11'),_0x35711c,_0xaa02('0x12'));_0x5b13c2(_0x2fe111['result']['message']);}})[_0xaa02('0x19')](function(_0x49c6e5){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x35711c,_0x49c6e5);_0x11ba9f(_0x49c6e5);});});} \ No newline at end of file +var _0xda2a=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x189c0d,_0x51be9a){var _0x5e8f10=function(_0x77f70a){while(--_0x77f70a){_0x189c0d['push'](_0x189c0d['shift']());}};_0x5e8f10(++_0x51be9a);}(_0xda2a,0xe5));var _0xada2=function(_0x178ca8,_0x29f3bd){_0x178ca8=_0x178ca8-0x0;var _0x47e081=_0xda2a[_0x178ca8];return _0x47e081;};'use strict';var _=require(_0xada2('0x0'));var util=require(_0xada2('0x1'));var moment=require(_0xada2('0x2'));var BPromise=require(_0xada2('0x3'));var rs=require(_0xada2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xada2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xada2('0x6'))(_0xada2('0x7'));var config=require(_0xada2('0x8'));var jayson=require(_0xada2('0x9'));var client=jayson[_0xada2('0xa')]['http']({'port':0x232a});config[_0xada2('0xb')]=_[_0xada2('0xc')](config[_0xada2('0xb')],{'host':_0xada2('0xd'),'port':0x18eb});var socket=require(_0xada2('0xe'))(new Redis(config[_0xada2('0xb')]));require(_0xada2('0xf'))[_0xada2('0x10')](socket);function respondWithRpcPromise(_0x4f39b5,_0x41cddc,_0x5db751){return new BPromise(function(_0x4805e3,_0x31a7bf){return client[_0xada2('0x11')](_0x4f39b5,_0x5db751)[_0xada2('0x12')](function(_0x3bab14){logger[_0xada2('0x13')](_0xada2('0x14'),_0x41cddc,_0xada2('0x15'));logger[_0xada2('0x16')](_0xada2('0x17'),_0x41cddc,'request\x20sent',JSON['stringify'](_0x3bab14));if(_0x3bab14[_0xada2('0x18')]){if(_0x3bab14['error'][_0xada2('0x19')]===0x1f4){logger[_0xada2('0x18')](_0xada2('0x14'),_0x41cddc,_0x3bab14[_0xada2('0x18')][_0xada2('0x1a')]);return _0x31a7bf(_0x3bab14['error'][_0xada2('0x1a')]);}logger[_0xada2('0x18')](_0xada2('0x14'),_0x41cddc,_0x3bab14[_0xada2('0x18')]['message']);return _0x4805e3(_0x3bab14[_0xada2('0x18')][_0xada2('0x1a')]);}else{logger[_0xada2('0x13')](_0xada2('0x14'),_0x41cddc,_0xada2('0x15'));_0x4805e3(_0x3bab14[_0xada2('0x1b')][_0xada2('0x1a')]);}})[_0xada2('0x1c')](function(_0x2d0bdb){logger[_0xada2('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x41cddc,_0x2d0bdb);_0x31a7bf(_0x2d0bdb);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index fa92e28..6ba081e 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 _0x65f5=['remove','update','emit','register','length','./chatWebsite.events','save'];(function(_0x45b6e9,_0xe76bc9){var _0x7c4bc=function(_0x500d18){while(--_0x500d18){_0x45b6e9['push'](_0x45b6e9['shift']());}};_0x7c4bc(++_0xe76bc9);}(_0x65f5,0xad));var _0x565f=function(_0x45e538,_0x16df28){_0x45e538=_0x45e538-0x0;var _0x4ca925=_0x65f5[_0x45e538];return _0x4ca925;};'use strict';var ChatWebsiteEvents=require(_0x565f('0x0'));var events=[_0x565f('0x1'),_0x565f('0x2'),_0x565f('0x3')];function createListener(_0x9eeda2,_0x41f346){return function(_0x5341f8){_0x41f346[_0x565f('0x4')](_0x9eeda2,_0x5341f8);};}function removeListener(_0x26fd34,_0x3d4f88){return function(){ChatWebsiteEvents['removeListener'](_0x26fd34,_0x3d4f88);};}exports[_0x565f('0x5')]=function(_0x461826){for(var _0xdc3a2c=0x0,_0x5d9cf6=events[_0x565f('0x6')];_0xdc3a2c<_0x5d9cf6;_0xdc3a2c++){var _0x2436bf=events[_0xdc3a2c];var _0x3077b2=createListener('chatWebsite:'+_0x2436bf,_0x461826);ChatWebsiteEvents['on'](_0x2436bf,_0x3077b2);}}; \ No newline at end of file +var _0x7729=['./chatWebsite.events','remove','update','emit','removeListener'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x7729,0xaf));var _0x9772=function(_0x2e5124,_0x518e6a){_0x2e5124=_0x2e5124-0x0;var _0x2e9223=_0x7729[_0x2e5124];return _0x2e9223;};'use strict';var ChatWebsiteEvents=require(_0x9772('0x0'));var events=['save',_0x9772('0x1'),_0x9772('0x2')];function createListener(_0x142e6b,_0x1a9811){return function(_0x5af5fc){_0x1a9811[_0x9772('0x3')](_0x142e6b,_0x5af5fc);};}function removeListener(_0x41bad2,_0x6983fc){return function(){ChatWebsiteEvents[_0x9772('0x4')](_0x41bad2,_0x6983fc);};}exports['register']=function(_0x1ed853){for(var _0x45d677=0x0,_0x4c9d26=events['length'];_0x45d677<_0x4c9d26;_0x45d677++){var _0x3228c0=events[_0x45d677];var _0x378d6e=createListener('chatWebsite:'+_0x3228c0,_0x1ed853);ChatWebsiteEvents['on'](_0x3228c0,_0x378d6e);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js index f485728..02803e3 100644 --- a/server/api/chatWebsite/helpers/wildcard-expressions.js +++ b/server/api/chatWebsite/helpers/wildcard-expressions.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7880=['URL','replace','test','localhost','exports','../../../utils/misc','url'];(function(_0xe9f7f2,_0x303bd8){var _0x2c462b=function(_0x4f0997){while(--_0x4f0997){_0xe9f7f2['push'](_0xe9f7f2['shift']());}};_0x2c462b(++_0x303bd8);}(_0x7880,0x10f));var _0x0788=function(_0x513f27,_0x1cbc87){_0x513f27=_0x513f27-0x0;var _0xa316b7=_0x7880[_0x513f27];return _0xa316b7;};var escapeRegExp=require(_0x0788('0x0'))['escapeRegExp'];var URL=require(_0x0788('0x1'))[_0x0788('0x2')];function testWildcardValidity(_0x25c8ca){var _0x184ae4=!![];try{new URL(_0x25c8ca[_0x0788('0x3')]('*','localhost'));}catch(_0x563529){_0x184ae4=![];}return _0x184ae4&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x0788('0x4')](_0x25c8ca);}function testWebsiteWithWildcard(_0x487b5b,_0x74c6b2){var _0x2deca2;var _0x34f9f1=escapeRegExp(_0x487b5b['trim']()[_0x0788('0x3')](/\/$/,''))[_0x0788('0x3')]('\x5c*','([\x5cw]+)');try{new URL(_0x487b5b[_0x0788('0x3')]('\x5c*',_0x0788('0x5')));_0x2deca2=new RegExp(_0x34f9f1)[_0x0788('0x4')](_0x74c6b2);}catch(_0x95ebe3){_0x2deca2=![];}return _0x2deca2;}module[_0x0788('0x6')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0xdfb1=['replace','localhost','trim','([\x5cw]+)','exports','../../../utils/misc','escapeRegExp','url','URL'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x2e1780,_0x4fe45c){_0x2e1780=_0x2e1780-0x0;var _0x405bc6=_0xdfb1[_0x2e1780];return _0x405bc6;};var escapeRegExp=require(_0x1dfb('0x0'))[_0x1dfb('0x1')];var URL=require(_0x1dfb('0x2'))[_0x1dfb('0x3')];function testWildcardValidity(_0x5dcd5f){var _0x3bb876=!![];try{new URL(_0x5dcd5f[_0x1dfb('0x4')]('*',_0x1dfb('0x5')));}catch(_0xc67a54){_0x3bb876=![];}return _0x3bb876&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x5dcd5f);}function testWebsiteWithWildcard(_0x51ad43,_0x4ba239){var _0x31f0ff;var _0x36bf77=escapeRegExp(_0x51ad43[_0x1dfb('0x6')]()['replace'](/\/$/,''))[_0x1dfb('0x4')]('\x5c*',_0x1dfb('0x7'));try{new URL(_0x51ad43[_0x1dfb('0x4')]('\x5c*',_0x1dfb('0x5')));_0x31f0ff=new RegExp(_0x36bf77)['test'](_0x4ba239);}catch(_0x24d8b9){_0x31f0ff=![];}return _0x31f0ff;}module[_0x1dfb('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 2214336..47f9f5c 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 _0x30f3=['getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','single','file','format','now','originalname','addAvatar','server/files/images/avatars/','/:id/system_avatar','addSystemAvatar','notify','server/files','ensureDir','extname','replace','/:id/offline','any','offline','addInteraction','/:id/users','addAgents','put','/:id','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar'];(function(_0x29caa2,_0x24addd){var _0x581a8c=function(_0x47c678){while(--_0x47c678){_0x29caa2['push'](_0x29caa2['shift']());}};_0x581a8c(++_0x24addd);}(_0x30f3,0x10a));var _0x330f=function(_0x510b08,_0x16cd04){_0x510b08=_0x510b08-0x0;var _0xbf9488=_0x30f3[_0x510b08];return _0xbf9488;};'use strict';var multer=require(_0x330f('0x0'));var util=require(_0x330f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x330f('0x2'));var router=express[_0x330f('0x3')]();var fs_extra=require(_0x330f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x330f('0x5'));var config=require(_0x330f('0x6'));var controller=require(_0x330f('0x7'));router[_0x330f('0x8')]('/',auth[_0x330f('0x9')](),controller[_0x330f('0xa')]);router[_0x330f('0x8')](_0x330f('0xb'),auth[_0x330f('0x9')](),controller[_0x330f('0xc')]);router[_0x330f('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x330f('0xd')]);router[_0x330f('0x8')](_0x330f('0xe'),auth[_0x330f('0x9')](),controller[_0x330f('0xf')]);router['get']('/:id/canned_answers',auth[_0x330f('0x9')](),controller[_0x330f('0x10')]);router[_0x330f('0x8')](_0x330f('0x11'),controller['getLogo']);router[_0x330f('0x8')](_0x330f('0x12'),controller[_0x330f('0x13')]);router[_0x330f('0x8')](_0x330f('0x14'),controller[_0x330f('0x15')]);router['get']('/:id/system_avatar',controller[_0x330f('0x16')]);router[_0x330f('0x8')](_0x330f('0x17'),auth[_0x330f('0x9')](),controller[_0x330f('0x18')]);router[_0x330f('0x8')]('/:id/snippet',controller[_0x330f('0x19')]);router[_0x330f('0x8')](_0x330f('0x1a'),auth[_0x330f('0x9')](),controller[_0x330f('0x1b')]);router[_0x330f('0x8')](_0x330f('0x1c'),auth[_0x330f('0x9')](),controller['getProactiveActions']);router[_0x330f('0x8')](_0x330f('0x1d'),controller[_0x330f('0x1e')]);router['get'](_0x330f('0x1f'),auth[_0x330f('0x9')](),controller[_0x330f('0x20')]);router[_0x330f('0x8')]('/:id/users',auth[_0x330f('0x9')](),controller[_0x330f('0x21')]);router[_0x330f('0x22')]('/',auth[_0x330f('0x9')](),controller[_0x330f('0x23')]);router[_0x330f('0x22')]('/:id/dispositions',auth[_0x330f('0x9')](),controller[_0x330f('0x24')]);router[_0x330f('0x22')](_0x330f('0x25'),auth[_0x330f('0x9')](),controller[_0x330f('0x26')]);var upload=multer({'storage':multer[_0x330f('0x27')]({'destination':function(_0x1f7261,_0x1c4c87,_0x456ebf){_0x456ebf(null,path[_0x330f('0x28')](config[_0x330f('0x29')],_0x330f('0x2a')));},'filename':function(_0x241b16,_0x4a626b,_0x470c2d){_0x470c2d(null,util['format'](_0x330f('0x2b'),Date['now'](),_0x4a626b['originalname']));}})});router[_0x330f('0x22')](_0x330f('0x11'),upload[_0x330f('0x2c')](_0x330f('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0x330f('0x27')]({'destination':function(_0xa046fd,_0x49a5a3,_0x2eabde){_0x2eabde(null,path[_0x330f('0x28')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x37617c,_0x503c06,_0x44055f){_0x44055f(null,util[_0x330f('0x2e')](_0x330f('0x2b'),Date[_0x330f('0x2f')](),_0x503c06[_0x330f('0x30')]));}})});router['post'](_0x330f('0x12'),upload[_0x330f('0x2c')]('file'),controller[_0x330f('0x31')]);var upload=multer({'storage':multer[_0x330f('0x27')]({'destination':function(_0x1341c1,_0x418413,_0x5577e2){_0x5577e2(null,path[_0x330f('0x28')](config[_0x330f('0x29')],_0x330f('0x32')));},'filename':function(_0x1c11b4,_0x19d6bd,_0x4da751){_0x4da751(null,util[_0x330f('0x2e')](_0x330f('0x2b'),Date[_0x330f('0x2f')](),_0x19d6bd[_0x330f('0x30')]));}})});router[_0x330f('0x22')](_0x330f('0x14'),upload['single'](_0x330f('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2fcf5c,_0x397f0d,_0x2cea76){_0x2cea76(null,path[_0x330f('0x28')](config[_0x330f('0x29')],_0x330f('0x32')));},'filename':function(_0x126ea3,_0x34b2fb,_0x372f2e){_0x372f2e(null,util[_0x330f('0x2e')]('%s-%s',Date[_0x330f('0x2f')](),_0x34b2fb['originalname']));}})});router[_0x330f('0x22')](_0x330f('0x33'),upload['single'](_0x330f('0x2d')),controller[_0x330f('0x34')]);router[_0x330f('0x22')]('/:id/notify',controller[_0x330f('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x330f('0x27')]({'destination':function(_0xb20ee7,_0x36989f,_0x25b428){const _0x317c77=path[_0x330f('0x28')](config[_0x330f('0x29')],_0x330f('0x36'),'attachments','offline-chat');fs_extra[_0x330f('0x37')](_0x317c77,function(){_0x25b428(null,_0x317c77);});},'filename':function(_0x598d9d,_0x41ec21,_0x32bc9c){const _0x3c4aed=_0x41ec21[_0x330f('0x30')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3dffa7=path[_0x330f('0x38')](_0x3c4aed);const _0x4d13ec=Date[_0x330f('0x2f')]()+'-'+_0x3c4aed[_0x330f('0x39')](_0x3dffa7,'')+_0x3dffa7;_0x32bc9c(null,_0x4d13ec);}})});router[_0x330f('0x22')](_0x330f('0x3a'),offlineUploadMulter[_0x330f('0x3b')](),controller[_0x330f('0x3c')]);router[_0x330f('0x22')]('/:id/interactions',auth[_0x330f('0x9')](),controller[_0x330f('0x3d')]);router[_0x330f('0x22')]('/:id/applications',auth[_0x330f('0x9')](),controller['addApplications']);router[_0x330f('0x22')](_0x330f('0x1c'),auth[_0x330f('0x9')](),controller['addProactiveActions']);router['post'](_0x330f('0x3e'),auth[_0x330f('0x9')](),controller[_0x330f('0x3f')]);router[_0x330f('0x40')](_0x330f('0x41'),auth[_0x330f('0x9')](),controller[_0x330f('0x42')]);router['delete']('/:id',auth[_0x330f('0x9')](),controller[_0x330f('0x43')]);router['delete'](_0x330f('0xe'),auth[_0x330f('0x9')](),controller['removeDispositions']);router[_0x330f('0x44')](_0x330f('0x25'),auth[_0x330f('0x9')](),controller[_0x330f('0x45')]);router[_0x330f('0x44')]('/:id/users',auth[_0x330f('0x9')](),controller[_0x330f('0x46')]);module[_0x330f('0x47')]=router; \ No newline at end of file +var _0x8c90=['root','server/files/images/logos/','%s-%s','originalname','/:id/logo','single','file','addLogo','server/files/images/avatars/','format','now','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','put','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getOfflineMessages','/:id/users','getAgents','addDisposition','post','addAnswer','diskStorage','join'];(function(_0x438bd1,_0x4c7113){var _0x4e40fb=function(_0x22369d){while(--_0x22369d){_0x438bd1['push'](_0x438bd1['shift']());}};_0x4e40fb(++_0x4c7113);}(_0x8c90,0x13f));var _0x08c9=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x8c90[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x08c9('0x0'));var util=require(_0x08c9('0x1'));var path=require(_0x08c9('0x2'));var timeout=require(_0x08c9('0x3'));var express=require(_0x08c9('0x4'));var router=express[_0x08c9('0x5')]();var fs_extra=require(_0x08c9('0x6'));var auth=require(_0x08c9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x08c9('0x8'));var controller=require(_0x08c9('0x9'));router[_0x08c9('0xa')]('/',auth[_0x08c9('0xb')](),controller[_0x08c9('0xc')]);router['get'](_0x08c9('0xd'),auth[_0x08c9('0xb')](),controller['describe']);router[_0x08c9('0xa')](_0x08c9('0xe'),auth['isAuthenticated'](),controller[_0x08c9('0xf')]);router[_0x08c9('0xa')](_0x08c9('0x10'),auth['isAuthenticated'](),controller[_0x08c9('0x11')]);router[_0x08c9('0xa')](_0x08c9('0x12'),auth[_0x08c9('0xb')](),controller[_0x08c9('0x13')]);router[_0x08c9('0xa')]('/:id/logo',controller[_0x08c9('0x14')]);router['get'](_0x08c9('0x15'),controller['getAvatar']);router[_0x08c9('0xa')](_0x08c9('0x16'),controller[_0x08c9('0x17')]);router[_0x08c9('0xa')](_0x08c9('0x18'),controller['getSystemAvatar']);router[_0x08c9('0xa')](_0x08c9('0x19'),auth[_0x08c9('0xb')](),controller[_0x08c9('0x1a')]);router[_0x08c9('0xa')](_0x08c9('0x1b'),controller[_0x08c9('0x1c')]);router[_0x08c9('0xa')](_0x08c9('0x1d'),auth[_0x08c9('0xb')](),controller[_0x08c9('0x1e')]);router[_0x08c9('0xa')](_0x08c9('0x1f'),auth[_0x08c9('0xb')](),controller['getProactiveActions']);router[_0x08c9('0xa')](_0x08c9('0x20'),controller['getFields']);router[_0x08c9('0xa')]('/:id/offline_messages',auth[_0x08c9('0xb')](),controller[_0x08c9('0x21')]);router[_0x08c9('0xa')](_0x08c9('0x22'),auth[_0x08c9('0xb')](),controller[_0x08c9('0x23')]);router['post']('/',auth[_0x08c9('0xb')](),controller['create']);router['post'](_0x08c9('0x10'),auth['isAuthenticated'](),controller[_0x08c9('0x24')]);router[_0x08c9('0x25')](_0x08c9('0x12'),auth[_0x08c9('0xb')](),controller[_0x08c9('0x26')]);var upload=multer({'storage':multer[_0x08c9('0x27')]({'destination':function(_0x455e61,_0x1574e7,_0x39cceb){_0x39cceb(null,path[_0x08c9('0x28')](config[_0x08c9('0x29')],_0x08c9('0x2a')));},'filename':function(_0x3598b5,_0xc6cdb7,_0x431a20){_0x431a20(null,util['format'](_0x08c9('0x2b'),Date['now'](),_0xc6cdb7[_0x08c9('0x2c')]));}})});router['post'](_0x08c9('0x2d'),upload[_0x08c9('0x2e')](_0x08c9('0x2f')),controller[_0x08c9('0x30')]);var upload=multer({'storage':multer[_0x08c9('0x27')]({'destination':function(_0x30e4c7,_0x38305f,_0x4957f7){_0x4957f7(null,path[_0x08c9('0x28')](config['root'],_0x08c9('0x31')));},'filename':function(_0x5f54c1,_0x1d9c6b,_0x10ce84){_0x10ce84(null,util[_0x08c9('0x32')](_0x08c9('0x2b'),Date[_0x08c9('0x33')](),_0x1d9c6b[_0x08c9('0x2c')]));}})});router[_0x08c9('0x25')]('/:id/avatar',upload[_0x08c9('0x2e')](_0x08c9('0x2f')),controller[_0x08c9('0x34')]);var upload=multer({'storage':multer[_0x08c9('0x27')]({'destination':function(_0x53894e,_0x427766,_0x2fee71){_0x2fee71(null,path[_0x08c9('0x28')](config['root'],_0x08c9('0x31')));},'filename':function(_0x5d15df,_0x1500cf,_0x1ba611){_0x1ba611(null,util[_0x08c9('0x32')](_0x08c9('0x2b'),Date[_0x08c9('0x33')](),_0x1500cf[_0x08c9('0x2c')]));}})});router[_0x08c9('0x25')](_0x08c9('0x16'),upload[_0x08c9('0x2e')](_0x08c9('0x2f')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x08c9('0x27')]({'destination':function(_0x1b8106,_0x2914fe,_0x2f26a3){_0x2f26a3(null,path[_0x08c9('0x28')](config[_0x08c9('0x29')],_0x08c9('0x31')));},'filename':function(_0x5ef1df,_0x311235,_0x95bd17){_0x95bd17(null,util['format']('%s-%s',Date[_0x08c9('0x33')](),_0x311235['originalname']));}})});router[_0x08c9('0x25')](_0x08c9('0x18'),upload[_0x08c9('0x2e')](_0x08c9('0x2f')),controller[_0x08c9('0x35')]);router[_0x08c9('0x25')](_0x08c9('0x36'),controller[_0x08c9('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x08c9('0x27')]({'destination':function(_0x1428dd,_0x43a933,_0x1a466b){const _0x5e78c1=path['join'](config[_0x08c9('0x29')],_0x08c9('0x38'),'attachments',_0x08c9('0x39'));fs_extra[_0x08c9('0x3a')](_0x5e78c1,function(){_0x1a466b(null,_0x5e78c1);});},'filename':function(_0x22701,_0x109ebc,_0x2f379b){const _0x15e9fb=_0x109ebc['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x19f9c9=path['extname'](_0x15e9fb);const _0x2bd100=Date[_0x08c9('0x33')]()+'-'+_0x15e9fb[_0x08c9('0x3b')](_0x19f9c9,'')+_0x19f9c9;_0x2f379b(null,_0x2bd100);}})});router[_0x08c9('0x25')](_0x08c9('0x3c'),offlineUploadMulter[_0x08c9('0x3d')](),controller['offline']);router['post']('/:id/interactions',auth[_0x08c9('0xb')](),controller[_0x08c9('0x3e')]);router[_0x08c9('0x25')]('/:id/applications',auth[_0x08c9('0xb')](),controller[_0x08c9('0x3f')]);router[_0x08c9('0x25')](_0x08c9('0x1f'),auth['isAuthenticated'](),controller[_0x08c9('0x40')]);router[_0x08c9('0x25')](_0x08c9('0x22'),auth[_0x08c9('0xb')](),controller[_0x08c9('0x41')]);router[_0x08c9('0x42')](_0x08c9('0xe'),auth[_0x08c9('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x08c9('0x43')]);router[_0x08c9('0x44')](_0x08c9('0x10'),auth['isAuthenticated'](),controller[_0x08c9('0x45')]);router['delete'](_0x08c9('0x12'),auth[_0x08c9('0xb')](),controller[_0x08c9('0x46')]);router['delete']('/:id/users',auth[_0x08c9('0xb')](),controller[_0x08c9('0x47')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index e253a62..a49efd0 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d8e=['../config/environment','Router','env','production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','beaver-logger/server','../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d8e,0x15a));var _0xe8d8=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x8d8e[_0xa1e3e3];return _0xc980e9;};var beaverLogger=require(_0xe8d8('0x0'));var express=require('express');var auth=require(_0xe8d8('0x1'));var config=require(_0xe8d8('0x2'));var router=express[_0xe8d8('0x3')]();var isProduction=config[_0xe8d8('0x4')]===_0xe8d8('0x5')||![];function clientSideLogs(_0x14b2f6,_0x368a0f,_0x16883b){var _0x270f8f=_0x14b2f6['app'][_0xe8d8('0x6')](_0xe8d8('0x7'));if(!_0x270f8f){throw new Error(_0xe8d8('0x8'));}return beaverLogger[_0xe8d8('0x9')]({'uri':_0xe8d8('0xa'),'logger':_0x270f8f,'enableCors':!isProduction})(_0x14b2f6,_0x368a0f,_0x16883b);}router['use'](auth[_0xe8d8('0xb')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0xedb7=['/client-logs','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','app','expressEndpoint'];(function(_0x4dcb15,_0x51d681){var _0x3b1426=function(_0x2918c0){while(--_0x2918c0){_0x4dcb15['push'](_0x4dcb15['shift']());}};_0x3b1426(++_0x51d681);}(_0xedb7,0x177));var _0x7edb=function(_0x2cb932,_0x3dbc23){_0x2cb932=_0x2cb932-0x0;var _0x45c24a=_0xedb7[_0x2cb932];return _0x45c24a;};var beaverLogger=require(_0x7edb('0x0'));var express=require(_0x7edb('0x1'));var auth=require(_0x7edb('0x2'));var config=require(_0x7edb('0x3'));var router=express[_0x7edb('0x4')]();var isProduction=config[_0x7edb('0x5')]===_0x7edb('0x6')||![];function clientSideLogs(_0x44bd08,_0x153b06,_0x5851fd){var _0xaa9426=_0x44bd08[_0x7edb('0x7')]['get']('client-side-logger');if(!_0xaa9426){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x7edb('0x8')]({'uri':_0x7edb('0x9'),'logger':_0xaa9426,'enableCors':!isProduction})(_0x44bd08,_0x153b06,_0x5851fd);}router['use'](auth[_0x7edb('0xa')](),clientSideLogs);module[_0x7edb('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 6790dba..d788ea6 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 _0x1944=['ENUM','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING'];(function(_0x1ff7f9,_0x7f4e5d){var _0x42f261=function(_0xa4451a){while(--_0xa4451a){_0x1ff7f9['push'](_0x1ff7f9['shift']());}};_0x42f261(++_0x7f4e5d);}(_0x1944,0x1b6));var _0x4194=function(_0x3b1c08,_0x43b62c){_0x3b1c08=_0x3b1c08-0x0;var _0x9bfda7=_0x1944[_0x3b1c08];return _0x9bfda7;};'use strict';var Sequelize=require('sequelize');module[_0x4194('0x0')]={'name':{'type':Sequelize[_0x4194('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4194('0x2')]('AmazonAWS','Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4194('0x2')]('Outlook365',_0x4194('0x3'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x4194('0x1')],'comment':_0x4194('0x4')},'data3':{'type':Sequelize['STRING'],'comment':_0x4194('0x5')},'data4':{'type':Sequelize[_0x4194('0x1')],'comment':_0x4194('0x6')},'data5':{'type':Sequelize['TEXT'],'comment':_0x4194('0x7')},'data6':{'type':Sequelize[_0x4194('0x8')],'comment':_0x4194('0x9')},'data7':{'type':Sequelize[_0x4194('0x8')],'comment':_0x4194('0xa')}}; \ No newline at end of file +var _0x04fc=['MicrosoftAzure','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','AmazonAWS','Google'];(function(_0x4ca333,_0x1218a3){var _0x13b2e1=function(_0x1eaf45){while(--_0x1eaf45){_0x4ca333['push'](_0x4ca333['shift']());}};_0x13b2e1(++_0x1218a3);}(_0x04fc,0x169));var _0xc04f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x04fc[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc04f('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xc04f('0x1'),_0xc04f('0x2'),_0xc04f('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc04f('0x4')](_0xc04f('0x5'),_0xc04f('0x6'))},'data1':{'type':Sequelize[_0xc04f('0x0')],'comment':_0xc04f('0x7')},'data2':{'type':Sequelize[_0xc04f('0x0')],'comment':_0xc04f('0x8')},'data3':{'type':Sequelize['STRING'],'comment':_0xc04f('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0xc04f('0xa')},'data5':{'type':Sequelize[_0xc04f('0xb')],'comment':_0xc04f('0xc')},'data6':{'type':Sequelize[_0xc04f('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xc04f('0xb')],'comment':_0xc04f('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index cfb38b6..2cf21ce 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 _0x6ce2=['data3','catch','show','params','length','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','find','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','Invalid\x20state\x20parameter','parse','from','state','toString','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','service','MicrosoftAzure','decryptString'];(function(_0x8c8fd4,_0x828dd3){var _0xf2e595=function(_0x2e9f32){while(--_0x2e9f32){_0x8c8fd4['push'](_0x8c8fd4['shift']());}};_0xf2e595(++_0x828dd3);}(_0x6ce2,0x151));var _0x26ce=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x6ce2[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x26ce('0x0'));var Redis=require(_0x26ce('0x1'));var qs=require(_0x26ce('0x2'));var encryptor=require(_0x26ce('0x3'));var config=require(_0x26ce('0x4'));var logger=require('../../config/logger')('api');var db=require(_0x26ce('0x5'))['db'];var oauth=require(_0x26ce('0x6'));config[_0x26ce('0x7')]=_[_0x26ce('0x8')](config[_0x26ce('0x7')],{'host':_0x26ce('0x9'),'port':0x18eb});var socket=require(_0x26ce('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x26ce('0x7')]);function respondWithStatusCode(_0x4290ad,_0x15d0ba){_0x15d0ba=_0x15d0ba||0xcc;return function(_0x173aaa){if(_0x173aaa){return _0x4290ad['sendStatus'](_0x15d0ba);}return _0x4290ad[_0x26ce('0xb')](_0x15d0ba)[_0x26ce('0xc')]();};}function respondWithResult(_0x19f750,_0x36aaac){_0x36aaac=_0x36aaac||0xc8;return function(_0x20f379){if(_0x20f379){return _0x19f750[_0x26ce('0xb')](_0x36aaac)[_0x26ce('0xd')](_0x20f379);}};}function respondWithFilteredResult(_0x282410,_0x506fab){return function(_0x1b53f2){if(_0x1b53f2){var _0x556ba0=typeof _0x506fab[_0x26ce('0xe')]===_0x26ce('0xf')&&typeof _0x506fab[_0x26ce('0x10')]===_0x26ce('0xf');var _0x1f20d3=_0x1b53f2[_0x26ce('0x11')];var _0x31faf2=_0x556ba0?0x0:_0x506fab[_0x26ce('0xe')];var _0x1853a0=_0x556ba0?_0x1b53f2[_0x26ce('0x11')]:_0x506fab[_0x26ce('0xe')]+_0x506fab[_0x26ce('0x10')];var _0x3d9439;if(_0x1853a0>=_0x1f20d3){_0x1853a0=_0x1f20d3;_0x3d9439=0xc8;}else{_0x3d9439=0xce;}_0x282410[_0x26ce('0xb')](_0x3d9439);return _0x282410[_0x26ce('0x12')](_0x26ce('0x13'),_0x31faf2+'-'+_0x1853a0+'/'+_0x1f20d3)[_0x26ce('0xd')](_0x1b53f2);}return null;};}function saveUpdates(_0x5f5d95){return function(_0x42ccbd){if(_0x42ccbd){return _0x42ccbd[_0x26ce('0x14')](_0x5f5d95)[_0x26ce('0x15')](function(_0x6b4cbb){return _0x6b4cbb;});}return null;};}function removeEntity(_0x5062db){return function(_0x579ed4){if(_0x579ed4){return _0x579ed4['destroy']()[_0x26ce('0x15')](function(){_0x5062db['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47074f){return function(_0x309528){if(!_0x309528){_0x47074f[_0x26ce('0x16')](0x194);}return _0x309528;};}function handleError(_0x34a3e4,_0x1d501a){_0x1d501a=_0x1d501a||0x1f4;return function(_0x3b8079){logger[_0x26ce('0x17')](_0x3b8079['stack']);if(_0x3b8079['name']){delete _0x3b8079[_0x26ce('0x18')];}_0x34a3e4['status'](_0x1d501a)[_0x26ce('0x19')](_0x3b8079);};}function maskClientSecret(_0x54ffba){return _[_0x26ce('0x1a')](_0x54ffba[_0x26ce('0x1b')](0x0,0x3),0x14,'*');}exports[_0x26ce('0x1c')]=function(_0x2c93b4,_0x4c76c6){var _0x534e6c={},_0x6bc30e={},_0x1d62b7={'count':0x0,'rows':[]};var _0x431c27=_[_0x26ce('0x1d')](db[_0x26ce('0x1e')][_0x26ce('0x1f')],function(_0x2e5bbc){return{'name':_0x2e5bbc[_0x26ce('0x20')],'type':_0x2e5bbc[_0x26ce('0x21')][_0x26ce('0x22')]};});_0x6bc30e[_0x26ce('0x23')]=_['map'](_0x431c27,'name');_0x6bc30e['query']=_[_0x26ce('0x24')](_0x2c93b4['query']);_0x6bc30e[_0x26ce('0x25')]=_[_0x26ce('0x26')](_0x6bc30e[_0x26ce('0x23')],_0x6bc30e[_0x26ce('0x27')]);_0x534e6c['attributes']=_[_0x26ce('0x26')](_0x6bc30e[_0x26ce('0x23')],qs['fields'](_0x2c93b4[_0x26ce('0x27')][_0x26ce('0x28')]));_0x534e6c[_0x26ce('0x29')]=_0x534e6c[_0x26ce('0x29')]['length']?_0x534e6c[_0x26ce('0x29')]:_0x6bc30e[_0x26ce('0x23')];if(!_0x2c93b4[_0x26ce('0x27')]['hasOwnProperty'](_0x26ce('0x2a'))){_0x534e6c[_0x26ce('0x10')]=qs[_0x26ce('0x10')](_0x2c93b4[_0x26ce('0x27')]['limit']);_0x534e6c[_0x26ce('0xe')]=qs[_0x26ce('0xe')](_0x2c93b4[_0x26ce('0x27')][_0x26ce('0xe')]);}_0x534e6c[_0x26ce('0x2b')]=qs['sort'](_0x2c93b4[_0x26ce('0x27')]['sort']);_0x534e6c[_0x26ce('0x2c')]=qs[_0x26ce('0x25')](_['pick'](_0x2c93b4[_0x26ce('0x27')],_0x6bc30e[_0x26ce('0x25')]),_0x431c27);if(_0x2c93b4['query'][_0x26ce('0x2d')]){_0x534e6c[_0x26ce('0x2c')]=_[_0x26ce('0x2e')](_0x534e6c['where'],{'$or':_[_0x26ce('0x1d')](_0x431c27,function(_0x5ef881){if(_0x5ef881[_0x26ce('0x21')]!==_0x26ce('0x2f')){var _0x3f7132={};_0x3f7132[_0x5ef881[_0x26ce('0x18')]]={'$like':'%'+_0x2c93b4['query'][_0x26ce('0x2d')]+'%'};return _0x3f7132;}})});}_0x534e6c=_['merge']({},_0x534e6c,_0x2c93b4[_0x26ce('0x30')]);var _0x5cddf2={'where':_0x534e6c['where']};return db[_0x26ce('0x1e')]['count'](_0x5cddf2)[_0x26ce('0x15')](function(_0x4a8df3){_0x1d62b7[_0x26ce('0x11')]=_0x4a8df3;if(_0x2c93b4['query'][_0x26ce('0x31')]){_0x534e6c[_0x26ce('0x32')]=[{'all':!![]}];}return db[_0x26ce('0x1e')][_0x26ce('0x33')](_0x534e6c);})['then'](function(_0x30f4e0){_0x1d62b7['rows']=_[_0x26ce('0x1d')](_0x30f4e0,function(_0x30b3ab){if(_0x30b3ab[_0x26ce('0x34')]===_0x26ce('0x35')){var _0x245a79=encryptor[_0x26ce('0x36')](_0x30b3ab[_0x26ce('0x37')]);_0x30b3ab[_0x26ce('0x37')]=maskClientSecret(_0x245a79);}return _0x30b3ab;});return _0x1d62b7;})[_0x26ce('0x15')](respondWithFilteredResult(_0x4c76c6,_0x534e6c))[_0x26ce('0x38')](handleError(_0x4c76c6,null));};exports[_0x26ce('0x39')]=function(_0xceca6c,_0xe9f948){var _0x144f82={'raw':!![],'where':{'id':_0xceca6c[_0x26ce('0x3a')]['id']}},_0x5d360b={};_0x5d360b[_0x26ce('0x23')]=_[_0x26ce('0x24')](db['CloudProvider'][_0x26ce('0x1f')]);_0x5d360b[_0x26ce('0x27')]=_[_0x26ce('0x24')](_0xceca6c[_0x26ce('0x27')]);_0x5d360b[_0x26ce('0x25')]=_[_0x26ce('0x26')](_0x5d360b[_0x26ce('0x23')],_0x5d360b[_0x26ce('0x27')]);_0x144f82[_0x26ce('0x29')]=_[_0x26ce('0x26')](_0x5d360b[_0x26ce('0x23')],qs[_0x26ce('0x28')](_0xceca6c[_0x26ce('0x27')][_0x26ce('0x28')]));_0x144f82[_0x26ce('0x29')]=_0x144f82['attributes'][_0x26ce('0x3b')]?_0x144f82[_0x26ce('0x29')]:_0x5d360b[_0x26ce('0x23')];if(_0xceca6c[_0x26ce('0x27')][_0x26ce('0x31')]){_0x144f82[_0x26ce('0x32')]=[{'all':!![]}];}_0x144f82=_[_0x26ce('0x2e')]({},_0x144f82,_0xceca6c[_0x26ce('0x30')]);return db[_0x26ce('0x1e')]['find'](_0x144f82)[_0x26ce('0x15')](handleEntityNotFound(_0xe9f948,null))['then'](function(_0x53a829){if(_0x53a829[_0x26ce('0x34')]===_0x26ce('0x35')){var _0x1f49d5=encryptor[_0x26ce('0x36')](_0x53a829[_0x26ce('0x37')]);_0x53a829[_0x26ce('0x37')]=maskClientSecret(_0x1f49d5);}return _0x53a829;})['then'](respondWithResult(_0xe9f948,null))[_0x26ce('0x38')](handleError(_0xe9f948,null));};exports['create']=function(_0x45f96c,_0x24c85d){if(!_0x45f96c[_0x26ce('0x3c')][_0x26ce('0x18')])throw new Error(_0x26ce('0x3d'));if(!_0x45f96c[_0x26ce('0x3c')][_0x26ce('0x34')])throw new Error(_0x26ce('0x3e'));var _0x402c75=db[_0x26ce('0x1e')]['rawAttributes'][_0x26ce('0x34')][_0x26ce('0x3f')];if(!_0x402c75[_0x26ce('0x40')](_0x45f96c[_0x26ce('0x3c')][_0x26ce('0x34')]))throw new Error(_0x26ce('0x41')+_0x402c75[_0x26ce('0x42')](',\x20'));if(_0x45f96c[_0x26ce('0x3c')][_0x26ce('0x34')]===_0x26ce('0x35')&&_0x45f96c[_0x26ce('0x3c')][_0x26ce('0x37')]){_0x45f96c[_0x26ce('0x3c')][_0x26ce('0x37')]=encryptor[_0x26ce('0x43')](_0x45f96c[_0x26ce('0x3c')]['data3']);}return db[_0x26ce('0x1e')][_0x26ce('0x44')](_0x45f96c[_0x26ce('0x3c')],{})[_0x26ce('0x15')](respondWithResult(_0x24c85d,0xc9))[_0x26ce('0x38')](handleError(_0x24c85d,null));};exports[_0x26ce('0x14')]=function(_0x9cd4f3,_0x52175c){if(_0x9cd4f3[_0x26ce('0x3c')]['id']){delete _0x9cd4f3[_0x26ce('0x3c')]['id'];}return db['CloudProvider'][_0x26ce('0x45')]({'where':{'id':_0x9cd4f3[_0x26ce('0x3a')]['id']}})['then'](handleEntityNotFound(_0x52175c,null))['then'](function(_0x1c1af0){if(_0x1c1af0[_0x26ce('0x34')]===_0x26ce('0x35')&&_0x9cd4f3[_0x26ce('0x3c')][_0x26ce('0x37')]){_0x9cd4f3[_0x26ce('0x3c')]['data3']=encryptor['encryptString'](_0x9cd4f3[_0x26ce('0x3c')]['data3']);}return _0x1c1af0;})['then'](saveUpdates(_0x9cd4f3[_0x26ce('0x3c')],null))['then'](respondWithResult(_0x52175c,null))[_0x26ce('0x38')](handleError(_0x52175c,null));};exports[_0x26ce('0x46')]=function(_0x11aeb6,_0x469c41){return db[_0x26ce('0x1e')][_0x26ce('0x45')]({'where':{'id':_0x11aeb6['params']['id']}})[_0x26ce('0x15')](handleEntityNotFound(_0x469c41,null))[_0x26ce('0x15')](removeEntity(_0x469c41,null))[_0x26ce('0x38')](handleError(_0x469c41,null));};exports[_0x26ce('0x47')]=function(_0x470e30,_0x251b64){return db[_0x26ce('0x1e')][_0x26ce('0x48')]({'where':{'id':_0x470e30[_0x26ce('0x3a')]['id']},'raw':!![]})[_0x26ce('0x15')](function(_0x10bb42){if(!_0x10bb42)return _0x251b64['sendStatus'](0x194);return{'url':oauth[_0x26ce('0x49')](_0x10bb42,_0x470e30[_0x26ce('0x4a')]['id'])};})[_0x26ce('0x15')](respondWithResult(_0x251b64,null))[_0x26ce('0x38')](handleError(_0x251b64,null));};exports[_0x26ce('0x4b')]=function(_0x19b35a,_0x13dd1e){var _0x3e52de=_0x19b35a[_0x26ce('0x3c')];var _0x124dd2;var _0x136000;if(_0x3e52de['error'])throw _0x3e52de;redis['get'](_0x3e52de['state'])['then'](function(_0x37f2a1){if(!_0x37f2a1)throw new Error(_0x26ce('0x4c'));_0x124dd2=JSON[_0x26ce('0x4d')](_0x37f2a1);var _0x31eb2c=Buffer[_0x26ce('0x4e')](_0x3e52de[_0x26ce('0x4f')],'base64')[_0x26ce('0x50')]('ascii');_0x136000=JSON[_0x26ce('0x4d')](_0x31eb2c);if(!oauth[_0x26ce('0x51')](_0x3e52de[_0x26ce('0x52')],_0x124dd2[_0x26ce('0x53')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x26ce('0x54')](_0x3e52de[_0x26ce('0x4f')]);return oauth[_0x26ce('0x55')](_0x3e52de[_0x26ce('0x56')],_0x124dd2);})[_0x26ce('0x15')](function(_0x504818){_0x124dd2[_0x26ce('0x57')]=_0x504818[_0x26ce('0x58')];_0x124dd2[_0x26ce('0x59')]=_0x504818[_0x26ce('0x5a')];return db[_0x26ce('0x1e')][_0x26ce('0x14')]({'data5':_0x124dd2[_0x26ce('0x57')],'data6':_0x124dd2[_0x26ce('0x59')]},{'where':{'id':_0x124dd2['id']}});})[_0x26ce('0x15')](function(){oauth[_0x26ce('0x5b')](_0x124dd2);socket[_0x26ce('0x5c')](_0x26ce('0x5d'),{'id':_0x136000['id']});return;})[_0x26ce('0x15')](respondWithStatusCode(_0x13dd1e,null))['catch'](function(_0x3b464c){if(_0x136000){socket[_0x26ce('0x5c')](_0x26ce('0x5e'),{'id':_0x136000['id']});}if(!_0x124dd2){logger[_0x26ce('0x17')](_0x26ce('0x5f'),_0x3b464c);return _0x13dd1e[_0x26ce('0xb')](0x1f4)[_0x26ce('0x19')](_0x3b464c['message']);}logger[_0x26ce('0x17')](_0x26ce('0x60'),_0x124dd2['id'],JSON[_0x26ce('0x61')](_0x3b464c));});}; \ No newline at end of file +var _0x236e=['catch','show','params','include','find','MicrosoftAzure','body','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','create','update','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','parse','from','toString','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','../../components/encryptor','../../config/environment','api','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','service','decryptString','data3'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x236e,0xd7));var _0xe236=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x236e[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xe236('0x0'));var config=require(_0xe236('0x1'));var logger=require('../../config/logger')(_0xe236('0x2'));var db=require('../../mysqldb')['db'];var oauth=require(_0xe236('0x3'));config[_0xe236('0x4')]=_[_0xe236('0x5')](config[_0xe236('0x4')],{'host':_0xe236('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0xe236('0x4')]);function respondWithStatusCode(_0x11e398,_0x27d37b){_0x27d37b=_0x27d37b||0xcc;return function(_0x2da3ba){if(_0x2da3ba){return _0x11e398[_0xe236('0x7')](_0x27d37b);}return _0x11e398[_0xe236('0x8')](_0x27d37b)[_0xe236('0x9')]();};}function respondWithResult(_0x284ef9,_0x26e711){_0x26e711=_0x26e711||0xc8;return function(_0x32710c){if(_0x32710c){return _0x284ef9[_0xe236('0x8')](_0x26e711)[_0xe236('0xa')](_0x32710c);}};}function respondWithFilteredResult(_0x92c003,_0x138aeb){return function(_0x483d90){if(_0x483d90){var _0x33b5d4=typeof _0x138aeb[_0xe236('0xb')]===_0xe236('0xc')&&typeof _0x138aeb[_0xe236('0xd')]===_0xe236('0xc');var _0x9d88e7=_0x483d90[_0xe236('0xe')];var _0x55afc1=_0x33b5d4?0x0:_0x138aeb[_0xe236('0xb')];var _0x3ab7b4=_0x33b5d4?_0x483d90['count']:_0x138aeb[_0xe236('0xb')]+_0x138aeb[_0xe236('0xd')];var _0x217c54;if(_0x3ab7b4>=_0x9d88e7){_0x3ab7b4=_0x9d88e7;_0x217c54=0xc8;}else{_0x217c54=0xce;}_0x92c003[_0xe236('0x8')](_0x217c54);return _0x92c003['set'](_0xe236('0xf'),_0x55afc1+'-'+_0x3ab7b4+'/'+_0x9d88e7)[_0xe236('0xa')](_0x483d90);}return null;};}function saveUpdates(_0x6fc29d){return function(_0x5355e0){if(_0x5355e0){return _0x5355e0['update'](_0x6fc29d)[_0xe236('0x10')](function(_0x3cedee){return _0x3cedee;});}return null;};}function removeEntity(_0x36bec4){return function(_0x282f2f){if(_0x282f2f){return _0x282f2f['destroy']()['then'](function(){_0x36bec4[_0xe236('0x8')](0xcc)[_0xe236('0x9')]();});}};}function handleEntityNotFound(_0x3c90b1){return function(_0x27a67f){if(!_0x27a67f){_0x3c90b1[_0xe236('0x7')](0x194);}return _0x27a67f;};}function handleError(_0x129eec,_0x3e2783){_0x3e2783=_0x3e2783||0x1f4;return function(_0x5ca7eb){logger[_0xe236('0x11')](_0x5ca7eb[_0xe236('0x12')]);if(_0x5ca7eb[_0xe236('0x13')]){delete _0x5ca7eb[_0xe236('0x13')];}_0x129eec[_0xe236('0x8')](_0x3e2783)['send'](_0x5ca7eb);};}function maskClientSecret(_0x15f60f){return _['padEnd'](_0x15f60f['slice'](0x0,0x3),0x14,'*');}exports[_0xe236('0x14')]=function(_0x46bfcf,_0x387c47){var _0x3a8d29={},_0x47aabc={},_0x14bd34={'count':0x0,'rows':[]};var _0x28612d=_[_0xe236('0x15')](db[_0xe236('0x16')][_0xe236('0x17')],function(_0x2f765b){return{'name':_0x2f765b[_0xe236('0x18')],'type':_0x2f765b['type'][_0xe236('0x19')]};});_0x47aabc[_0xe236('0x1a')]=_['map'](_0x28612d,_0xe236('0x13'));_0x47aabc[_0xe236('0x1b')]=_[_0xe236('0x1c')](_0x46bfcf[_0xe236('0x1b')]);_0x47aabc[_0xe236('0x1d')]=_[_0xe236('0x1e')](_0x47aabc['model'],_0x47aabc['query']);_0x3a8d29[_0xe236('0x1f')]=_[_0xe236('0x1e')](_0x47aabc[_0xe236('0x1a')],qs[_0xe236('0x20')](_0x46bfcf[_0xe236('0x1b')][_0xe236('0x20')]));_0x3a8d29[_0xe236('0x1f')]=_0x3a8d29['attributes'][_0xe236('0x21')]?_0x3a8d29[_0xe236('0x1f')]:_0x47aabc[_0xe236('0x1a')];if(!_0x46bfcf['query']['hasOwnProperty'](_0xe236('0x22'))){_0x3a8d29[_0xe236('0xd')]=qs['limit'](_0x46bfcf['query'][_0xe236('0xd')]);_0x3a8d29['offset']=qs[_0xe236('0xb')](_0x46bfcf[_0xe236('0x1b')]['offset']);}_0x3a8d29[_0xe236('0x23')]=qs[_0xe236('0x24')](_0x46bfcf[_0xe236('0x1b')][_0xe236('0x24')]);_0x3a8d29[_0xe236('0x25')]=qs[_0xe236('0x1d')](_['pick'](_0x46bfcf[_0xe236('0x1b')],_0x47aabc['filters']),_0x28612d);if(_0x46bfcf[_0xe236('0x1b')][_0xe236('0x26')]){_0x3a8d29[_0xe236('0x25')]=_[_0xe236('0x27')](_0x3a8d29[_0xe236('0x25')],{'$or':_[_0xe236('0x15')](_0x28612d,function(_0x3090b9){if(_0x3090b9[_0xe236('0x28')]!==_0xe236('0x29')){var _0x2740c2={};_0x2740c2[_0x3090b9['name']]={'$like':'%'+_0x46bfcf[_0xe236('0x1b')][_0xe236('0x26')]+'%'};return _0x2740c2;}})});}_0x3a8d29=_[_0xe236('0x27')]({},_0x3a8d29,_0x46bfcf[_0xe236('0x2a')]);var _0x2e2544={'where':_0x3a8d29['where']};return db[_0xe236('0x16')][_0xe236('0xe')](_0x2e2544)[_0xe236('0x10')](function(_0xf504bc){_0x14bd34[_0xe236('0xe')]=_0xf504bc;if(_0x46bfcf[_0xe236('0x1b')][_0xe236('0x2b')]){_0x3a8d29['include']=[{'all':!![]}];}return db[_0xe236('0x16')][_0xe236('0x2c')](_0x3a8d29);})[_0xe236('0x10')](function(_0x1ab08f){_0x14bd34[_0xe236('0x2d')]=_[_0xe236('0x15')](_0x1ab08f,function(_0x57b9ee){if(_0x57b9ee[_0xe236('0x2e')]==='MicrosoftAzure'){var _0x4098cd=encryptor[_0xe236('0x2f')](_0x57b9ee[_0xe236('0x30')]);_0x57b9ee[_0xe236('0x30')]=maskClientSecret(_0x4098cd);}return _0x57b9ee;});return _0x14bd34;})[_0xe236('0x10')](respondWithFilteredResult(_0x387c47,_0x3a8d29))[_0xe236('0x31')](handleError(_0x387c47,null));};exports[_0xe236('0x32')]=function(_0x3a8245,_0x3aeaf4){var _0x9c13f9={'raw':!![],'where':{'id':_0x3a8245[_0xe236('0x33')]['id']}},_0x2424b3={};_0x2424b3[_0xe236('0x1a')]=_[_0xe236('0x1c')](db[_0xe236('0x16')][_0xe236('0x17')]);_0x2424b3[_0xe236('0x1b')]=_['keys'](_0x3a8245[_0xe236('0x1b')]);_0x2424b3['filters']=_['intersection'](_0x2424b3[_0xe236('0x1a')],_0x2424b3['query']);_0x9c13f9[_0xe236('0x1f')]=_[_0xe236('0x1e')](_0x2424b3[_0xe236('0x1a')],qs[_0xe236('0x20')](_0x3a8245['query'][_0xe236('0x20')]));_0x9c13f9[_0xe236('0x1f')]=_0x9c13f9[_0xe236('0x1f')][_0xe236('0x21')]?_0x9c13f9[_0xe236('0x1f')]:_0x2424b3[_0xe236('0x1a')];if(_0x3a8245['query'][_0xe236('0x2b')]){_0x9c13f9[_0xe236('0x34')]=[{'all':!![]}];}_0x9c13f9=_[_0xe236('0x27')]({},_0x9c13f9,_0x3a8245[_0xe236('0x2a')]);return db[_0xe236('0x16')][_0xe236('0x35')](_0x9c13f9)['then'](handleEntityNotFound(_0x3aeaf4,null))[_0xe236('0x10')](function(_0x1fdfaa){if(_0x1fdfaa[_0xe236('0x2e')]===_0xe236('0x36')){var _0x5ec773=encryptor[_0xe236('0x2f')](_0x1fdfaa['data3']);_0x1fdfaa[_0xe236('0x30')]=maskClientSecret(_0x5ec773);}return _0x1fdfaa;})['then'](respondWithResult(_0x3aeaf4,null))[_0xe236('0x31')](handleError(_0x3aeaf4,null));};exports['create']=function(_0x2ac6cf,_0x17aa20){if(!_0x2ac6cf['body'][_0xe236('0x13')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x2ac6cf[_0xe236('0x37')]['service'])throw new Error(_0xe236('0x38'));var _0xf279fb=db[_0xe236('0x16')][_0xe236('0x17')][_0xe236('0x2e')][_0xe236('0x39')];if(!_0xf279fb[_0xe236('0x3a')](_0x2ac6cf[_0xe236('0x37')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0xf279fb[_0xe236('0x3b')](',\x20'));if(_0x2ac6cf[_0xe236('0x37')][_0xe236('0x2e')]===_0xe236('0x36')&&_0x2ac6cf[_0xe236('0x37')][_0xe236('0x30')]){_0x2ac6cf['body'][_0xe236('0x30')]=encryptor[_0xe236('0x3c')](_0x2ac6cf['body'][_0xe236('0x30')]);}return db[_0xe236('0x16')][_0xe236('0x3d')](_0x2ac6cf['body'],{})[_0xe236('0x10')](respondWithResult(_0x17aa20,0xc9))[_0xe236('0x31')](handleError(_0x17aa20,null));};exports[_0xe236('0x3e')]=function(_0x32905a,_0x2aea37){if(_0x32905a['body']['id']){delete _0x32905a['body']['id'];}return db[_0xe236('0x16')][_0xe236('0x35')]({'where':{'id':_0x32905a[_0xe236('0x33')]['id']}})['then'](handleEntityNotFound(_0x2aea37,null))[_0xe236('0x10')](function(_0x3128a6){if(_0x3128a6[_0xe236('0x2e')]===_0xe236('0x36')&&_0x32905a[_0xe236('0x37')][_0xe236('0x30')]){_0x32905a[_0xe236('0x37')][_0xe236('0x30')]=encryptor[_0xe236('0x3c')](_0x32905a['body'][_0xe236('0x30')]);}return _0x3128a6;})['then'](saveUpdates(_0x32905a[_0xe236('0x37')],null))['then'](respondWithResult(_0x2aea37,null))[_0xe236('0x31')](handleError(_0x2aea37,null));};exports[_0xe236('0x3f')]=function(_0x45e315,_0x4889c6){return db[_0xe236('0x16')][_0xe236('0x35')]({'where':{'id':_0x45e315[_0xe236('0x33')]['id']}})[_0xe236('0x10')](handleEntityNotFound(_0x4889c6,null))[_0xe236('0x10')](removeEntity(_0x4889c6,null))[_0xe236('0x31')](handleError(_0x4889c6,null));};exports[_0xe236('0x40')]=function(_0x4e03ed,_0x2de3a6){return db[_0xe236('0x16')][_0xe236('0x41')]({'where':{'id':_0x4e03ed[_0xe236('0x33')]['id']},'raw':!![]})[_0xe236('0x10')](function(_0x1eb8ba){if(!_0x1eb8ba)return _0x2de3a6[_0xe236('0x7')](0x194);return{'url':oauth[_0xe236('0x42')](_0x1eb8ba,_0x4e03ed[_0xe236('0x43')]['id'])};})[_0xe236('0x10')](respondWithResult(_0x2de3a6,null))['catch'](handleError(_0x2de3a6,null));};exports[_0xe236('0x44')]=function(_0x5bc250,_0x190a98){var _0x223fe6=_0x5bc250[_0xe236('0x37')];var _0x41dfa8;var _0x2649f6;if(_0x223fe6[_0xe236('0x11')])throw _0x223fe6;redis['get'](_0x223fe6[_0xe236('0x45')])['then'](function(_0x369118){if(!_0x369118)throw new Error('Invalid\x20state\x20parameter');_0x41dfa8=JSON[_0xe236('0x46')](_0x369118);var _0x38b87a=Buffer[_0xe236('0x47')](_0x223fe6[_0xe236('0x45')],'base64')[_0xe236('0x48')]('ascii');_0x2649f6=JSON[_0xe236('0x46')](_0x38b87a);if(!oauth[_0xe236('0x49')](_0x223fe6[_0xe236('0x4a')],_0x41dfa8[_0xe236('0x4b')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xe236('0x4c')](_0x223fe6[_0xe236('0x45')]);return oauth[_0xe236('0x4d')](_0x223fe6[_0xe236('0x4e')],_0x41dfa8);})[_0xe236('0x10')](function(_0x4e3a8c){_0x41dfa8[_0xe236('0x4f')]=_0x4e3a8c[_0xe236('0x50')];_0x41dfa8[_0xe236('0x51')]=_0x4e3a8c[_0xe236('0x52')];return db['CloudProvider'][_0xe236('0x3e')]({'data5':_0x41dfa8['data5'],'data6':_0x41dfa8[_0xe236('0x51')]},{'where':{'id':_0x41dfa8['id']}});})[_0xe236('0x10')](function(){oauth[_0xe236('0x53')](_0x41dfa8);socket[_0xe236('0x54')]('microsoftAuthorization:success',{'id':_0x2649f6['id']});return;})[_0xe236('0x10')](respondWithStatusCode(_0x190a98,null))[_0xe236('0x31')](function(_0x19f123){if(_0x2649f6){socket[_0xe236('0x54')](_0xe236('0x55'),{'id':_0x2649f6['id']});}if(!_0x41dfa8){logger[_0xe236('0x11')]('Invalid\x20authentication\x20state\x20parameter',_0x19f123);return _0x190a98[_0xe236('0x8')](0x1f4)['send'](_0x19f123['message']);}logger['error'](_0xe236('0x56'),_0x41dfa8['id'],JSON[_0xe236('0x57')](_0x19f123));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index d470443..24a7eff 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 _0xa9f9=['cloud_providers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider'];(function(_0x3cf7ce,_0x41bf3c){var _0x36f7fd=function(_0xc7f604){while(--_0xc7f604){_0x3cf7ce['push'](_0x3cf7ce['shift']());}};_0x36f7fd(++_0x41bf3c);}(_0xa9f9,0x1da));var _0x9a9f=function(_0x2cff6d,_0x4a1611){_0x2cff6d=_0x2cff6d-0x0;var _0x20e5bc=_0xa9f9[_0x2cff6d];return _0x20e5bc;};'use strict';var _=require(_0x9a9f('0x0'));var util=require('util');var logger=require(_0x9a9f('0x1'))(_0x9a9f('0x2'));var moment=require('moment');var BPromise=require(_0x9a9f('0x3'));var rp=require(_0x9a9f('0x4'));var fs=require('fs');var path=require(_0x9a9f('0x5'));var rimraf=require(_0x9a9f('0x6'));var config=require(_0x9a9f('0x7'));var attributes=require(_0x9a9f('0x8'));module['exports']=function(_0xb72abb,_0x200267){return _0xb72abb['define'](_0x9a9f('0x9'),attributes,{'tableName':_0x9a9f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ffb=['rimraf','./cloudProvider.attributes','CloudProvider','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5d273b,_0x2c1e4b){var _0x50cc5f=function(_0x36bcc0){while(--_0x36bcc0){_0x5d273b['push'](_0x5d273b['shift']());}};_0x50cc5f(++_0x2c1e4b);}(_0x4ffb,0x71));var _0xb4ff=function(_0x16c467,_0x53d6fa){_0x16c467=_0x16c467-0x0;var _0x22db4f=_0x4ffb[_0x16c467];return _0x22db4f;};'use strict';var _=require(_0xb4ff('0x0'));var util=require(_0xb4ff('0x1'));var logger=require('../../config/logger')(_0xb4ff('0x2'));var moment=require(_0xb4ff('0x3'));var BPromise=require(_0xb4ff('0x4'));var rp=require(_0xb4ff('0x5'));var fs=require('fs');var path=require(_0xb4ff('0x6'));var rimraf=require(_0xb4ff('0x7'));var config=require('../../config/environment');var attributes=require(_0xb4ff('0x8'));module['exports']=function(_0x105c79,_0x40b779){return _0x105c79['define'](_0xb4ff('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 81c8e52..be3bf4f 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18ec=['error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','replace','intervals','findAll','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','api','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','openid','/authorize','/token','map','type','Dynamics365','data7','/.default','Outlook365','{TENANT_ID}','data2','code','id_token','toString','base64','randomBytes','hex','data1','join','redirect_uri','data4','response_mode','scope','state','nonce','prompt','login','key','oauth2/','set','stringify','decode','payload','issuer','aud','audience','unix','exp','resolve','then','data3','findOne','refresh_token','data6','decryptString','data5','access_token','CloudProvider'];(function(_0x1830a4,_0x1f1525){var _0x599910=function(_0xcec6b4){while(--_0xcec6b4){_0x1830a4['push'](_0x1830a4['shift']());}};_0x599910(++_0x1f1525);}(_0x18ec,0xa3));var _0xc18e=function(_0x4d7776,_0x179dd7){_0x4d7776=_0x4d7776-0x0;var _0x1929ac=_0x18ec[_0x4d7776];return _0x1929ac;};'use strict';var _=require(_0xc18e('0x0'));var crypto=require(_0xc18e('0x1'));var jwt=require(_0xc18e('0x2'));var moment=require(_0xc18e('0x3'));var Redis=require(_0xc18e('0x4'));var rp=require('request-promise');var util=require(_0xc18e('0x5'));var encryptor=require(_0xc18e('0x6'));var config=require(_0xc18e('0x7'));var logger=require('../../config/logger')(_0xc18e('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0xc18e('0x9')]=_[_0xc18e('0xa')](config[_0xc18e('0x9')],{'host':_0xc18e('0xb'),'port':0x18eb});var redis=new Redis(config[_0xc18e('0x9')]);var MICROSOFT_AUTH_URL=_0xc18e('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xc18e('0xd'),_0xc18e('0xe'),_0xc18e('0xf'),_0xc18e('0x10'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xc18e('0x11'),_0xc18e('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xc18e('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xc18e('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xd7df04){var _0x2a04ea=_[_0xc18e('0x14')](AZURE_AUTH_SCOPES[_0xd7df04[_0xc18e('0x15')]]);if(_0xd7df04['type']===_0xc18e('0x16'))_0x2a04ea['push'](_0xd7df04[_0xc18e('0x17')]+_0xc18e('0x18'));return _0x2a04ea['join']('\x20');}function getAccessTokenScope(_0x98355a){if(_0x98355a[_0xc18e('0x15')]===_0xc18e('0x19'))return _0xc18e('0x10');if(_0x98355a[_0xc18e('0x15')]===_0xc18e('0x16'))return _0x98355a[_0xc18e('0x17')]+_0xc18e('0x18');}function generateMicrosoftAuthorizationUrl(_0x4ccb74,_0x20e312){var _0x5e3a89=MICROSOFT_AUTH_URL['replace'](_0xc18e('0x1a'),_0x4ccb74[_0xc18e('0x1b')]);var _0x596a91=[_0xc18e('0x1c'),_0xc18e('0x1d')];var _0x233c18=Buffer['from'](JSON['stringify']({'id':_0x20e312}))[_0xc18e('0x1e')](_0xc18e('0x1f'));var _0x13c72a=crypto[_0xc18e('0x20')](0x10)[_0xc18e('0x1e')](_0xc18e('0x21'));var _0x1c3316=getAuthorizationScopes(_0x4ccb74);var _0x36cffb=[{'key':'client_id','value':_0x4ccb74[_0xc18e('0x22')]},{'key':'response_type','value':encodeURIComponent(_0x596a91[_0xc18e('0x23')]('\x20'))},{'key':_0xc18e('0x24'),'value':_0x4ccb74[_0xc18e('0x25')]},{'key':_0xc18e('0x26'),'value':'form_post'},{'key':_0xc18e('0x27'),'value':encodeURIComponent(_0x1c3316)},{'key':_0xc18e('0x28'),'value':_0x233c18},{'key':_0xc18e('0x29'),'value':_0x13c72a},{'key':_0xc18e('0x2a'),'value':_0xc18e('0x2b')}];var _0x258b21=_0x5e3a89+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xc18e('0x14')](_0x36cffb,function(_0x393c51){return _0x393c51[_0xc18e('0x2c')]+'='+_0x393c51['value'];})[_0xc18e('0x23')]('&');_0x4ccb74['oauth2Claims']={'issuer':_0x5e3a89['replace'](_0xc18e('0x2d'),''),'audience':_0x4ccb74[_0xc18e('0x22')],'state':_0x233c18,'nonce':_0x13c72a};redis[_0xc18e('0x2e')](_0x233c18,JSON[_0xc18e('0x2f')](_0x4ccb74));return _0x258b21;}function isValidIdToken(_0x24aa87,_0x5abe04){try{var _0xdb01ce=jwt[_0xc18e('0x30')](_0x24aa87,{'complete':!![]});var _0x5d5684=_0xdb01ce[_0xc18e('0x31')];if(_0x5d5684['iss']!==_0x5abe04[_0xc18e('0x32')])return![];if(_0x5d5684[_0xc18e('0x33')]!==_0x5abe04[_0xc18e('0x34')])return![];if(_0x5d5684[_0xc18e('0x29')]!==_0x5abe04['nonce'])return![];if(moment()['isAfter'](moment[_0xc18e('0x35')](_0x5d5684[_0xc18e('0x36')])))return![];return!![];}catch(_0x303653){throw _0x303653;}}function refreshOauth2MicrosoftAccessToken(_0x50cf64){return Promise[_0xc18e('0x37')]()[_0xc18e('0x38')](function(){if(_0x50cf64[_0xc18e('0x39')])return _0x50cf64;return db['CloudProvider'][_0xc18e('0x3a')]({'where':{'id':_0x50cf64['id']},'raw':!![]});})[_0xc18e('0x38')](function(_0x1e3587){var _0x33db1b={'grant_type':_0xc18e('0x3b'),'refresh_token':_0x1e3587[_0xc18e('0x3c')],'scope':getAccessTokenScope(_0x1e3587),'redirect_uri':_0x1e3587[_0xc18e('0x25')],'client_id':_0x1e3587[_0xc18e('0x22')],'client_secret':encryptor[_0xc18e('0x3d')](_0x1e3587[_0xc18e('0x39')])};var _0x21505b={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0xc18e('0x1a'),_0x1e3587['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x33db1b,'json':!![]};return rp(_0x21505b);})[_0xc18e('0x38')](function(_0x15c45f){_0x50cf64[_0xc18e('0x3e')]=_0x15c45f[_0xc18e('0x3f')];_0x50cf64[_0xc18e('0x3c')]=_0x15c45f[_0xc18e('0x3b')];return db[_0xc18e('0x40')]['update']({'data5':_0x50cf64[_0xc18e('0x3e')],'data6':_0x50cf64['data6']},{'where':{'id':_0x50cf64['id']}});})[_0xc18e('0x38')](function(){return _0x50cf64;})['catch'](function(_0x6d53c8){logger[_0xc18e('0x41')](_0xc18e('0x42'),_0x50cf64['id'],_0x6d53c8);});}function getOauth2MicrosoftAccessToken(_0x2bd935,_0x4e9d03){var _0x8e0d26={'grant_type':_0xc18e('0x43'),'code':_0x2bd935,'scope':getAccessTokenScope(_0x4e9d03),'redirect_uri':_0x4e9d03['data4'],'client_id':_0x4e9d03[_0xc18e('0x22')],'client_secret':encryptor['decryptString'](_0x4e9d03[_0xc18e('0x39')])};var _0x21aab0={'method':_0xc18e('0x44'),'uri':MICROSOFT_AUTH_URL[_0xc18e('0x45')]('{TENANT_ID}',_0x4e9d03[_0xc18e('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x8e0d26,'json':!![]};return rp(_0x21aab0);}function startRefreshInterval(_0x1fd4a4){var _0x21ce3e=schedule[_0xc18e('0x46')];if(_0x21ce3e[_0x1fd4a4['id']])clearInterval(_0x21ce3e[_0x1fd4a4['id']]);_0x21ce3e[_0x1fd4a4['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x1fd4a4['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x21ce3e;}function startAllRefreshIntervals(){return db[_0xc18e('0x40')][_0xc18e('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xc18e('0x38')](function(_0x500a0a){var _0x9f789c=_0x500a0a['map'](function(_0x135752){return refreshOauth2MicrosoftAccessToken(_0x135752)['then'](function(_0x46f034){startRefreshInterval(_0x46f034);});});return Promise['all'](_0x9f789c);})[_0xc18e('0x48')](function(_0x11b13d){var _0x2ff96c=_0x11b13d?util[_0xc18e('0x49')](_0x11b13d,{'showHidden':![],'depth':null}):'';logger[_0xc18e('0x41')](_0xc18e('0x4a'),_0x2ff96c);});}module[_0xc18e('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x3ce6=['join','Outlook365','replace','{TENANT_ID}','data2','id_token','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','key','value','oauth2/','set','audience','nonce','unix','resolve','then','CloudProvider','refresh_token','data6','data3','POST','data5','access_token','update','catch','error','authorization_code','decryptString','bind','intervals','findAll','all','inspect','exports','lodash','jsonwebtoken','moment','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default'];(function(_0x63641,_0x31b065){var _0x4a82f2=function(_0x5e4350){while(--_0x5e4350){_0x63641['push'](_0x63641['shift']());}};_0x4a82f2(++_0x31b065);}(_0x3ce6,0x194));var _0x63ce=function(_0x5d5d8b,_0x1985c7){_0x5d5d8b=_0x5d5d8b-0x0;var _0x4fa591=_0x3ce6[_0x5d5d8b];return _0x4fa591;};'use strict';var _=require(_0x63ce('0x0'));var crypto=require('crypto');var jwt=require(_0x63ce('0x1'));var moment=require(_0x63ce('0x2'));var Redis=require(_0x63ce('0x3'));var rp=require('request-promise');var util=require('util');var encryptor=require(_0x63ce('0x4'));var config=require(_0x63ce('0x5'));var logger=require(_0x63ce('0x6'))(_0x63ce('0x7'));var schedule=require(_0x63ce('0x8'));var db=require(_0x63ce('0x9'))['db'];config['redis']=_[_0x63ce('0xa')](config[_0x63ce('0xb')],{'host':_0x63ce('0xc'),'port':0x18eb});var redis=new Redis(config[_0x63ce('0xb')]);var MICROSOFT_AUTH_URL=_0x63ce('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x63ce('0xe'),'profile',_0x63ce('0xf'),_0x63ce('0x10'),_0x63ce('0x11'),_0x63ce('0x12'),_0x63ce('0x13')],'Dynamics365':[_0x63ce('0xe'),_0x63ce('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x63ce('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x63ce('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2b992b){var _0x489adc=_[_0x63ce('0x16')](AZURE_AUTH_SCOPES[_0x2b992b[_0x63ce('0x17')]]);if(_0x2b992b['type']===_0x63ce('0x18'))_0x489adc[_0x63ce('0x19')](_0x2b992b[_0x63ce('0x1a')]+_0x63ce('0x1b'));return _0x489adc[_0x63ce('0x1c')]('\x20');}function getAccessTokenScope(_0x2794d9){if(_0x2794d9[_0x63ce('0x17')]===_0x63ce('0x1d'))return _0x63ce('0x11');if(_0x2794d9[_0x63ce('0x17')]==='Dynamics365')return _0x2794d9['data7']+_0x63ce('0x1b');}function generateMicrosoftAuthorizationUrl(_0x3e802a,_0x3fed90){var _0x5a5c53=MICROSOFT_AUTH_URL[_0x63ce('0x1e')](_0x63ce('0x1f'),_0x3e802a[_0x63ce('0x20')]);var _0x5de341=['code',_0x63ce('0x21')];var _0x1d0777=Buffer['from'](JSON['stringify']({'id':_0x3fed90}))[_0x63ce('0x22')](_0x63ce('0x23'));var _0xf8399d=crypto[_0x63ce('0x24')](0x10)[_0x63ce('0x22')](_0x63ce('0x25'));var _0x96a143=getAuthorizationScopes(_0x3e802a);var _0x5935f6=[{'key':_0x63ce('0x26'),'value':_0x3e802a[_0x63ce('0x27')]},{'key':_0x63ce('0x28'),'value':encodeURIComponent(_0x5de341[_0x63ce('0x1c')]('\x20'))},{'key':_0x63ce('0x29'),'value':_0x3e802a[_0x63ce('0x2a')]},{'key':_0x63ce('0x2b'),'value':_0x63ce('0x2c')},{'key':'scope','value':encodeURIComponent(_0x96a143)},{'key':'state','value':_0x1d0777},{'key':'nonce','value':_0xf8399d},{'key':'prompt','value':'login'}];var _0x54c88e=_0x5a5c53+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x63ce('0x16')](_0x5935f6,function(_0x5ea7fa){return _0x5ea7fa[_0x63ce('0x2d')]+'='+_0x5ea7fa[_0x63ce('0x2e')];})[_0x63ce('0x1c')]('&');_0x3e802a['oauth2Claims']={'issuer':_0x5a5c53[_0x63ce('0x1e')](_0x63ce('0x2f'),''),'audience':_0x3e802a[_0x63ce('0x27')],'state':_0x1d0777,'nonce':_0xf8399d};redis[_0x63ce('0x30')](_0x1d0777,JSON['stringify'](_0x3e802a));return _0x54c88e;}function isValidIdToken(_0x2fd2c7,_0xabe812){try{var _0x22406c=jwt['decode'](_0x2fd2c7,{'complete':!![]});var _0x23aceb=_0x22406c['payload'];if(_0x23aceb['iss']!==_0xabe812['issuer'])return![];if(_0x23aceb['aud']!==_0xabe812[_0x63ce('0x31')])return![];if(_0x23aceb[_0x63ce('0x32')]!==_0xabe812[_0x63ce('0x32')])return![];if(moment()['isAfter'](moment[_0x63ce('0x33')](_0x23aceb['exp'])))return![];return!![];}catch(_0x194877){throw _0x194877;}}function refreshOauth2MicrosoftAccessToken(_0xad677d){return Promise[_0x63ce('0x34')]()[_0x63ce('0x35')](function(){if(_0xad677d['data3'])return _0xad677d;return db[_0x63ce('0x36')]['findOne']({'where':{'id':_0xad677d['id']},'raw':!![]});})[_0x63ce('0x35')](function(_0x153343){var _0x39fcad={'grant_type':_0x63ce('0x37'),'refresh_token':_0x153343[_0x63ce('0x38')],'scope':getAccessTokenScope(_0x153343),'redirect_uri':_0x153343['data4'],'client_id':_0x153343[_0x63ce('0x27')],'client_secret':encryptor['decryptString'](_0x153343[_0x63ce('0x39')])};var _0x393c46={'method':_0x63ce('0x3a'),'uri':MICROSOFT_AUTH_URL['replace'](_0x63ce('0x1f'),_0x153343[_0x63ce('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x39fcad,'json':!![]};return rp(_0x393c46);})[_0x63ce('0x35')](function(_0x3fe032){_0xad677d[_0x63ce('0x3b')]=_0x3fe032[_0x63ce('0x3c')];_0xad677d['data6']=_0x3fe032[_0x63ce('0x37')];return db[_0x63ce('0x36')][_0x63ce('0x3d')]({'data5':_0xad677d[_0x63ce('0x3b')],'data6':_0xad677d[_0x63ce('0x38')]},{'where':{'id':_0xad677d['id']}});})[_0x63ce('0x35')](function(){return _0xad677d;})[_0x63ce('0x3e')](function(_0x158fee){logger[_0x63ce('0x3f')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0xad677d['id'],_0x158fee);});}function getOauth2MicrosoftAccessToken(_0x205bd7,_0x15cc7f){var _0x3f47c0={'grant_type':_0x63ce('0x40'),'code':_0x205bd7,'scope':getAccessTokenScope(_0x15cc7f),'redirect_uri':_0x15cc7f[_0x63ce('0x2a')],'client_id':_0x15cc7f[_0x63ce('0x27')],'client_secret':encryptor[_0x63ce('0x41')](_0x15cc7f[_0x63ce('0x39')])};var _0x58ff6e={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x63ce('0x1f'),_0x15cc7f[_0x63ce('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f47c0,'json':!![]};return rp(_0x58ff6e);}function startRefreshInterval(_0x23745b){var _0x56ed89=schedule['intervals'];if(_0x56ed89[_0x23745b['id']])clearInterval(_0x56ed89[_0x23745b['id']]);_0x56ed89[_0x23745b['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x63ce('0x42')](this,{'id':_0x23745b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x63ce('0x43')]=_0x56ed89;}function startAllRefreshIntervals(){return db[_0x63ce('0x36')][_0x63ce('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x44235b){var _0x52ee73=_0x44235b[_0x63ce('0x16')](function(_0x23fca2){return refreshOauth2MicrosoftAccessToken(_0x23fca2)[_0x63ce('0x35')](function(_0x50b069){startRefreshInterval(_0x50b069);});});return Promise[_0x63ce('0x45')](_0x52ee73);})['catch'](function(_0x78b501){var _0x2ecac9=_0x78b501?util[_0x63ce('0x46')](_0x78b501,{'showHidden':![],'depth':null}):'';logger[_0x63ce('0x3f')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x2ecac9);});}module[_0x63ce('0x47')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index d2847d4..a4fe522 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 _0x2015=['client','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x21b524,_0x535d0b){var _0x44e487=function(_0x2f299e){while(--_0x2f299e){_0x21b524['push'](_0x21b524['shift']());}};_0x44e487(++_0x535d0b);}(_0x2015,0x193));var _0x5201=function(_0x6aae21,_0x52e32e){_0x6aae21=_0x6aae21-0x0;var _0x3dfa13=_0x2015[_0x6aae21];return _0x3dfa13;};'use strict';var _=require(_0x5201('0x0'));var util=require(_0x5201('0x1'));var moment=require(_0x5201('0x2'));var BPromise=require(_0x5201('0x3'));var rs=require(_0x5201('0x4'));var fs=require('fs');var Redis=require(_0x5201('0x5'));var db=require(_0x5201('0x6'))['db'];var utils=require(_0x5201('0x7'));var logger=require('../../config/logger')(_0x5201('0x8'));var config=require(_0x5201('0x9'));var jayson=require(_0x5201('0xa'));var client=jayson[_0x5201('0xb')][_0x5201('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11ce7b,_0x334b42,_0x374d23){return new BPromise(function(_0x15367c,_0x6fc2c3){return client['request'](_0x11ce7b,_0x374d23)[_0x5201('0xd')](function(_0x17d8f3){logger['info'](_0x5201('0xe'),_0x334b42,_0x5201('0xf'));logger[_0x5201('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x334b42,_0x5201('0xf'),JSON[_0x5201('0x11')](_0x17d8f3));if(_0x17d8f3[_0x5201('0x12')]){if(_0x17d8f3[_0x5201('0x12')][_0x5201('0x13')]===0x1f4){logger[_0x5201('0x12')](_0x5201('0xe'),_0x334b42,_0x17d8f3[_0x5201('0x12')][_0x5201('0x14')]);return _0x6fc2c3(_0x17d8f3[_0x5201('0x12')][_0x5201('0x14')]);}logger[_0x5201('0x12')]('CloudProvider,\x20%s,\x20%s',_0x334b42,_0x17d8f3[_0x5201('0x12')][_0x5201('0x14')]);return _0x15367c(_0x17d8f3['error']['message']);}else{logger[_0x5201('0x15')](_0x5201('0xe'),_0x334b42,_0x5201('0xf'));_0x15367c(_0x17d8f3['result']['message']);}})[_0x5201('0x16')](function(_0x582210){logger[_0x5201('0x12')]('CloudProvider,\x20%s,\x20%s',_0x334b42,_0x582210);_0x6fc2c3(_0x582210);});});} \ No newline at end of file +var _0x3cae=['../../config/logger','rpc','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x21481c,_0x1b51ba){var _0x5dd77a=function(_0x4ee13c){while(--_0x4ee13c){_0x21481c['push'](_0x21481c['shift']());}};_0x5dd77a(++_0x1b51ba);}(_0x3cae,0x117));var _0xe3ca=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x3cae[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0xe3ca('0x0'));var util=require(_0xe3ca('0x1'));var moment=require(_0xe3ca('0x2'));var BPromise=require(_0xe3ca('0x3'));var rs=require(_0xe3ca('0x4'));var fs=require('fs');var Redis=require(_0xe3ca('0x5'));var db=require(_0xe3ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3ca('0x7'))(_0xe3ca('0x8'));var config=require('../../config/environment');var jayson=require(_0xe3ca('0x9'));var client=jayson['client'][_0xe3ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7fafb4,_0x36d17a,_0x578178){return new BPromise(function(_0x2c4863,_0x100c20){return client[_0xe3ca('0xb')](_0x7fafb4,_0x578178)[_0xe3ca('0xc')](function(_0x1ae7bf){logger[_0xe3ca('0xd')](_0xe3ca('0xe'),_0x36d17a,'request\x20sent');logger[_0xe3ca('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x36d17a,_0xe3ca('0x10'),JSON[_0xe3ca('0x11')](_0x1ae7bf));if(_0x1ae7bf[_0xe3ca('0x12')]){if(_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x13')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x36d17a,_0x1ae7bf[_0xe3ca('0x12')]['message']);return _0x100c20(_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x14')]);}logger['error'](_0xe3ca('0xe'),_0x36d17a,_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x14')]);return _0x2c4863(_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x14')]);}else{logger[_0xe3ca('0xd')](_0xe3ca('0xe'),_0x36d17a,_0xe3ca('0x10'));_0x2c4863(_0x1ae7bf['result']['message']);}})[_0xe3ca('0x15')](function(_0x4296ae){logger[_0xe3ca('0x12')](_0xe3ca('0xe'),_0x36d17a,_0x4296ae);_0x100c20(_0x4296ae);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 482ff08..b1c00bf 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x222199,_0x586a25){var _0x1a1c74=function(_0x258b6c){while(--_0x258b6c){_0x222199['push'](_0x222199['shift']());}};_0x1a1c74(++_0x586a25);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc4aa[_0x4b055c];return _0x4b62bb;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x3669f8,_0x1c90b1){var _0x2a80af=function(_0x56cfce){while(--_0x56cfce){_0x3669f8['push'](_0x3669f8['shift']());}};_0x2a80af(++_0x1c90b1);}(_0xadb5,0xad));var _0x5adb=function(_0x2293fa,_0x1cbc7e){_0x2293fa=_0x2293fa-0x0;var _0x397c32=_0xadb5[_0x2293fa];return _0x397c32;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index a2dfb4e..41c1fd9 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 _0x74c7=['name','sequelize','STRING'];(function(_0x37b1d8,_0x614312){var _0x3739e7=function(_0x15a5bb){while(--_0x15a5bb){_0x37b1d8['push'](_0x37b1d8['shift']());}};_0x3739e7(++_0x614312);}(_0x74c7,0x8e));var _0x774c=function(_0x2b5dc1,_0x4ac2d5){_0x2b5dc1=_0x2b5dc1-0x0;var _0x42074a=_0x74c7[_0x2b5dc1];return _0x42074a;};'use strict';var Sequelize=require(_0x774c('0x0'));module['exports']={'name':{'type':Sequelize[_0x774c('0x1')],'unique':_0x774c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x774c('0x1')]},'companyId':{'type':Sequelize[_0x774c('0x1')]},'website':{'type':Sequelize[_0x774c('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x774c('0x1')]},'type':{'type':Sequelize[_0x774c('0x1')]},'street':{'type':Sequelize[_0x774c('0x1')]},'postalCode':{'type':Sequelize[_0x774c('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x774c('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x774c('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x774c('0x1')]},'sCity':{'type':Sequelize[_0x774c('0x1')]},'sCountry':{'type':Sequelize[_0x774c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x16f9=['STRING','name','sequelize','exports'];(function(_0x2f37e0,_0x393ef9){var _0x43ccce=function(_0x318b51){while(--_0x318b51){_0x2f37e0['push'](_0x2f37e0['shift']());}};_0x43ccce(++_0x393ef9);}(_0x16f9,0xae));var _0x916f=function(_0x17ec3f,_0x5dbbbd){_0x17ec3f=_0x17ec3f-0x0;var _0x490194=_0x16f9[_0x17ec3f];return _0x490194;};'use strict';var Sequelize=require(_0x916f('0x0'));module[_0x916f('0x1')]={'name':{'type':Sequelize[_0x916f('0x2')],'unique':_0x916f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x916f('0x2')]},'companyId':{'type':Sequelize[_0x916f('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x916f('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x916f('0x2')]},'city':{'type':Sequelize[_0x916f('0x2')]},'country':{'type':Sequelize[_0x916f('0x2')]},'email':{'type':Sequelize[_0x916f('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x916f('0x2')]},'sStreet':{'type':Sequelize[_0x916f('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x916f('0x2')]},'sCountry':{'type':Sequelize[_0x916f('0x2')]},'description':{'type':Sequelize[_0x916f('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 13f9062..f04843f 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 _0x08a0=['map','include','catch','show','params','rawAttributes','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','pick','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x3116b0,_0x340875){var _0x2e389b=function(_0x4bdf9b){while(--_0x4bdf9b){_0x3116b0['push'](_0x3116b0['shift']());}};_0x2e389b(++_0x340875);}(_0x08a0,0x174));var _0x008a=function(_0xcb19e1,_0x465489){_0xcb19e1=_0xcb19e1-0x0;var _0x121872=_0x08a0[_0xcb19e1];return _0x121872;};'use strict';var emlformat=require(_0x008a('0x0'));var rimraf=require(_0x008a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x008a('0x2'));var moment=require(_0x008a('0x3'));var BPromise=require(_0x008a('0x4'));var Mustache=require(_0x008a('0x5'));var util=require(_0x008a('0x6'));var path=require('path');var sox=require(_0x008a('0x7'));var csv=require(_0x008a('0x8'));var ejs=require(_0x008a('0x9'));var fs=require('fs');var fs_extra=require(_0x008a('0xa'));var _=require(_0x008a('0xb'));var squel=require(_0x008a('0xc'));var crypto=require(_0x008a('0xd'));var jsforce=require(_0x008a('0xe'));var deskjs=require(_0x008a('0xf'));var toCsv=require(_0x008a('0x8'));var querystring=require('querystring');var Papa=require(_0x008a('0x10'));var Redis=require(_0x008a('0x11'));var authService=require(_0x008a('0x12'));var qs=require(_0x008a('0x13'));var as=require(_0x008a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x008a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x008a('0x16'));var db=require(_0x008a('0x17'))['db'];function respondWithStatusCode(_0x523c1a,_0x12dd44){_0x12dd44=_0x12dd44||0xcc;return function(_0x375d9b){if(_0x375d9b){return _0x523c1a[_0x008a('0x18')](_0x12dd44);}return _0x523c1a[_0x008a('0x19')](_0x12dd44)[_0x008a('0x1a')]();};}function respondWithResult(_0x40d286,_0x446087){_0x446087=_0x446087||0xc8;return function(_0x38ab6b){if(_0x38ab6b){return _0x40d286[_0x008a('0x19')](_0x446087)[_0x008a('0x1b')](_0x38ab6b);}};}function respondWithFilteredResult(_0x40e2ac,_0x18ac69){return function(_0x2edd50){if(_0x2edd50){var _0x1abc9f=typeof _0x18ac69[_0x008a('0x1c')]===_0x008a('0x1d')&&typeof _0x18ac69[_0x008a('0x1e')]===_0x008a('0x1d');var _0x2b6b74=_0x2edd50[_0x008a('0x1f')];var _0xf626bb=_0x1abc9f?0x0:_0x18ac69[_0x008a('0x1c')];var _0x25ad1a=_0x1abc9f?_0x2edd50[_0x008a('0x1f')]:_0x18ac69['offset']+_0x18ac69[_0x008a('0x1e')];var _0x1be4ef;if(_0x25ad1a>=_0x2b6b74){_0x25ad1a=_0x2b6b74;_0x1be4ef=0xc8;}else{_0x1be4ef=0xce;}_0x40e2ac[_0x008a('0x19')](_0x1be4ef);return _0x40e2ac['set']('Content-Range',_0xf626bb+'-'+_0x25ad1a+'/'+_0x2b6b74)[_0x008a('0x1b')](_0x2edd50);}return null;};}function patchUpdates(_0x19e7af){return function(_0x40f1b4){try{jsonpatch[_0x008a('0x20')](_0x40f1b4,_0x19e7af,!![]);}catch(_0x2126b2){return BPromise[_0x008a('0x21')](_0x2126b2);}return _0x40f1b4[_0x008a('0x22')]();};}function saveUpdates(_0x1d64a0,_0x46ad7b){return function(_0x121e02){if(_0x121e02){return _0x121e02[_0x008a('0x23')](_0x1d64a0)[_0x008a('0x24')](function(_0x4c7452){return _0x4c7452;});}return null;};}function removeEntity(_0x4750ce,_0x1631cc){return function(_0x57ae6a){if(_0x57ae6a){return _0x57ae6a[_0x008a('0x25')]()['then'](function(){var _0x476933=_0x57ae6a[_0x008a('0x26')]({'plain':!![]});var _0x12e5e8=_0x008a('0x27');return db[_0x008a('0x28')][_0x008a('0x25')]({'where':{'type':_0x12e5e8,'resourceId':_0x476933['id']}})[_0x008a('0x24')](function(){return _0x57ae6a;});})['then'](function(){_0x4750ce[_0x008a('0x19')](0xcc)[_0x008a('0x1a')]();});}};}function handleEntityNotFound(_0x20d0c4,_0x1f526b){return function(_0x21a617){if(!_0x21a617){_0x20d0c4[_0x008a('0x18')](0x194);}return _0x21a617;};}function handleError(_0x26b4a8,_0x2fe9c6){_0x2fe9c6=_0x2fe9c6||0x1f4;return function(_0xbf3f55){logger[_0x008a('0x29')](_0xbf3f55[_0x008a('0x2a')]);if(_0xbf3f55[_0x008a('0x2b')]){delete _0xbf3f55[_0x008a('0x2b')];}_0x26b4a8['status'](_0x2fe9c6)[_0x008a('0x2c')](_0xbf3f55);};}exports[_0x008a('0x2d')]=function(_0x4df584,_0x1b1dac){var _0x48432d={},_0x458e8e={},_0x5c3c36={'count':0x0,'rows':[]};return db[_0x008a('0x2e')][_0x008a('0x2f')]()[_0x008a('0x24')](function(_0x860f60){_0x458e8e[_0x008a('0x30')]=_[_0x008a('0x31')](_0x860f60);_0x458e8e[_0x008a('0x32')]=_[_0x008a('0x31')](_0x4df584['query']);_0x458e8e[_0x008a('0x33')]=_[_0x008a('0x34')](_0x458e8e[_0x008a('0x30')],_0x458e8e[_0x008a('0x32')]);_0x48432d[_0x008a('0x35')]=_['intersection'](_0x458e8e[_0x008a('0x30')],qs[_0x008a('0x36')](_0x4df584[_0x008a('0x32')][_0x008a('0x36')]));_0x48432d[_0x008a('0x35')]=_0x48432d['attributes'][_0x008a('0x37')]?_0x48432d[_0x008a('0x35')]:_0x458e8e[_0x008a('0x30')];if(!_0x4df584['query'][_0x008a('0x38')](_0x008a('0x39'))){_0x48432d[_0x008a('0x1e')]=qs[_0x008a('0x1e')](_0x4df584[_0x008a('0x32')][_0x008a('0x1e')]);_0x48432d[_0x008a('0x1c')]=qs[_0x008a('0x1c')](_0x4df584['query'][_0x008a('0x1c')]);}_0x48432d[_0x008a('0x3a')]=qs['sort'](_0x4df584[_0x008a('0x32')][_0x008a('0x3b')]);_0x48432d[_0x008a('0x3c')]=qs[_0x008a('0x33')](_['pick'](_0x4df584[_0x008a('0x32')],_0x458e8e['filters']),_0x860f60);if(_0x4df584['query'][_0x008a('0x3d')]){_0x48432d[_0x008a('0x3c')]=_[_0x008a('0x3e')](_0x48432d[_0x008a('0x3c')],{'$or':_[_0x008a('0x3f')](_0x48432d[_0x008a('0x35')],function(_0x191548){var _0x2ea10b={};_0x2ea10b[_0x191548]={'$like':'%'+_0x4df584[_0x008a('0x32')][_0x008a('0x3d')]+'%'};return _0x2ea10b;})});}_0x48432d=_[_0x008a('0x3e')]({},_0x48432d,_0x4df584['options']);var _0xb33e2c={'where':_0x48432d[_0x008a('0x3c')]};return db[_0x008a('0x2e')][_0x008a('0x1f')](_0xb33e2c)[_0x008a('0x24')](function(_0x3376bc){_0x5c3c36[_0x008a('0x1f')]=_0x3376bc;if(_0x4df584['query']['includeAll']){_0x48432d[_0x008a('0x40')]=[{'all':!![]}];}return db[_0x008a('0x2e')]['findAll'](_0x48432d);})[_0x008a('0x24')](function(_0x594757){_0x5c3c36['rows']=_0x594757;return _0x5c3c36;})[_0x008a('0x24')](respondWithFilteredResult(_0x1b1dac,_0x48432d))[_0x008a('0x41')](handleError(_0x1b1dac,null));})[_0x008a('0x41')](handleError(_0x1b1dac,null));};exports[_0x008a('0x42')]=function(_0x3d1ad8,_0x8dcfd7){var _0x30c459={'raw':![],'where':{'id':_0x3d1ad8[_0x008a('0x43')]['id']}},_0x242d47={};_0x242d47[_0x008a('0x30')]=_['keys'](db['CmCompany'][_0x008a('0x44')]);_0x242d47[_0x008a('0x32')]=_[_0x008a('0x31')](_0x3d1ad8[_0x008a('0x32')]);_0x242d47[_0x008a('0x33')]=_[_0x008a('0x34')](_0x242d47[_0x008a('0x30')],_0x242d47[_0x008a('0x32')]);_0x30c459[_0x008a('0x35')]=_[_0x008a('0x34')](_0x242d47[_0x008a('0x30')],qs[_0x008a('0x36')](_0x3d1ad8[_0x008a('0x32')][_0x008a('0x36')]));_0x30c459[_0x008a('0x35')]=_0x30c459[_0x008a('0x35')][_0x008a('0x37')]?_0x30c459[_0x008a('0x35')]:_0x242d47[_0x008a('0x30')];if(_0x3d1ad8['query'][_0x008a('0x45')]){_0x30c459[_0x008a('0x40')]=[{'all':!![]}];}_0x30c459=_['merge']({},_0x30c459,_0x3d1ad8[_0x008a('0x46')]);return db[_0x008a('0x2e')][_0x008a('0x47')](_0x30c459)[_0x008a('0x24')](handleEntityNotFound(_0x8dcfd7,null))[_0x008a('0x24')](respondWithResult(_0x8dcfd7,null))[_0x008a('0x41')](handleError(_0x8dcfd7,null));};exports['create']=function(_0x45e6e1,_0x3855af){return db['CmCompany'][_0x008a('0x48')](_0x45e6e1[_0x008a('0x49')],{})[_0x008a('0x24')](function(_0x490363){var _0x1e215c=_0x45e6e1[_0x008a('0x4a')][_0x008a('0x26')]({'plain':!![]});if(!_0x1e215c)throw new Error(_0x008a('0x4b'));if(_0x1e215c[_0x008a('0x4c')]===_0x008a('0x4a')){var _0x8e6a0e=_0x490363[_0x008a('0x26')]({'plain':!![]});var _0x2dd3aa=_0x008a('0x27');return db[_0x008a('0x4d')][_0x008a('0x47')]({'where':{'name':_0x2dd3aa,'userProfileId':_0x1e215c[_0x008a('0x4e')]},'raw':!![]})[_0x008a('0x24')](function(_0x3a631c){if(_0x3a631c&&_0x3a631c['autoAssociation']===0x0){return db[_0x008a('0x28')]['create']({'name':_0x8e6a0e[_0x008a('0x2b')],'resourceId':_0x8e6a0e['id'],'type':_0x3a631c[_0x008a('0x2b')],'sectionId':_0x3a631c['id']},{})[_0x008a('0x24')](function(){return _0x490363;});}else{return _0x490363;}})[_0x008a('0x41')](function(_0x38a042){logger[_0x008a('0x29')](_0x008a('0x4f'),_0x38a042);throw _0x38a042;});}return _0x490363;})['then'](respondWithResult(_0x3855af,0xc9))['catch'](handleError(_0x3855af,null));};exports['update']=function(_0x5024cd,_0x7ce75a){if(_0x5024cd['body']['id']){delete _0x5024cd[_0x008a('0x49')]['id'];}return db['CmCompany'][_0x008a('0x47')]({'where':{'id':_0x5024cd['params']['id']}})[_0x008a('0x24')](handleEntityNotFound(_0x7ce75a,null))[_0x008a('0x24')](saveUpdates(_0x5024cd[_0x008a('0x49')],null))[_0x008a('0x24')](respondWithResult(_0x7ce75a,null))[_0x008a('0x41')](handleError(_0x7ce75a,null));};exports[_0x008a('0x25')]=function(_0x21d58e,_0x53592b){return db[_0x008a('0x2e')][_0x008a('0x47')]({'where':{'id':_0x21d58e[_0x008a('0x43')]['id']}})[_0x008a('0x24')](handleEntityNotFound(_0x53592b,null))[_0x008a('0x24')](removeEntity(_0x53592b,null))['catch'](handleError(_0x53592b,null));};exports[_0x008a('0x2f')]=function(_0x60e7b4,_0x1a5f42){return db[_0x008a('0x2e')][_0x008a('0x2f')]()['then'](respondWithResult(_0x1a5f42,null))[_0x008a('0x41')](handleError(_0x1a5f42,null));};exports[_0x008a('0x50')]=function(_0x1b4049,_0x4c18aa,_0x3007ad){return db[_0x008a('0x51')][_0x008a('0x47')]({'where':{'id':_0x1b4049[_0x008a('0x43')]['id']}})[_0x008a('0x24')](handleEntityNotFound(_0x4c18aa,null))[_0x008a('0x24')](function(_0x16d479){if(_0x16d479){return _0x16d479[_0x008a('0x50')](_0x1b4049[_0x008a('0x49')][_0x008a('0x52')],_[_0x008a('0x53')](_0x1b4049[_0x008a('0x49')],[_0x008a('0x52'),'id'])||{});}})[_0x008a('0x24')](respondWithResult(_0x4c18aa,null))['catch'](handleError(_0x4c18aa,null));};exports[_0x008a('0x54')]=function(_0x3bac3a,_0x232f14,_0x48f2f5){var _0x37756b={};var _0x3a687e={};var _0x5d5bd3;var _0x566adb;return db['CmCompany'][_0x008a('0x55')]({'where':{'id':_0x3bac3a[_0x008a('0x43')]['id']}})['then'](handleEntityNotFound(_0x232f14,null))[_0x008a('0x24')](function(_0x32ab62){if(_0x32ab62){_0x5d5bd3=_0x32ab62;_0x3a687e[_0x008a('0x30')]=_[_0x008a('0x31')](db[_0x008a('0x51')][_0x008a('0x44')]);_0x3a687e['query']=_[_0x008a('0x31')](_0x3bac3a[_0x008a('0x32')]);_0x3a687e[_0x008a('0x33')]=_[_0x008a('0x34')](_0x3a687e[_0x008a('0x30')],_0x3a687e[_0x008a('0x32')]);_0x37756b[_0x008a('0x35')]=_[_0x008a('0x34')](_0x3a687e['model'],qs[_0x008a('0x36')](_0x3bac3a[_0x008a('0x32')][_0x008a('0x36')]));_0x37756b['attributes']=_0x37756b[_0x008a('0x35')]['length']?_0x37756b[_0x008a('0x35')]:_0x3a687e['model'];_0x37756b[_0x008a('0x3a')]=qs[_0x008a('0x3b')](_0x3bac3a[_0x008a('0x32')]['sort']);_0x37756b[_0x008a('0x3c')]=qs[_0x008a('0x33')](_[_0x008a('0x56')](_0x3bac3a['query'],_0x3a687e[_0x008a('0x33')]));if(_0x3bac3a[_0x008a('0x32')][_0x008a('0x3d')]){_0x37756b[_0x008a('0x3c')]=_[_0x008a('0x3e')](_0x37756b[_0x008a('0x3c')],{'$or':_[_0x008a('0x3f')](_0x37756b[_0x008a('0x35')],function(_0xaf983e){var _0x260542={};_0x260542[_0xaf983e]={'$like':'%'+_0x3bac3a[_0x008a('0x32')][_0x008a('0x3d')]+'%'};return _0x260542;})});}_0x37756b=_['merge']({},_0x37756b,_0x3bac3a[_0x008a('0x46')]);return _0x5d5bd3[_0x008a('0x54')](_0x37756b);}})[_0x008a('0x24')](function(_0xdb5667){if(_0xdb5667){_0x566adb=_0xdb5667[_0x008a('0x37')];if(!_0x3bac3a['query'][_0x008a('0x38')](_0x008a('0x39'))){_0x37756b['limit']=qs['limit'](_0x3bac3a['query'][_0x008a('0x1e')]);_0x37756b[_0x008a('0x1c')]=qs[_0x008a('0x1c')](_0x3bac3a[_0x008a('0x32')][_0x008a('0x1c')]);}return _0x5d5bd3[_0x008a('0x54')](_0x37756b);}})['then'](function(_0x12c1a8){if(_0x12c1a8){return _0x12c1a8?{'count':_0x566adb,'rows':_0x12c1a8}:null;}})['then'](respondWithResult(_0x232f14,null))[_0x008a('0x41')](handleError(_0x232f14,null));}; \ No newline at end of file +var _0xee74=['keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','findOne','map','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','Companies','error','stack','name','send','index','CmCompany','describe','model'];(function(_0x488502,_0x19684f){var _0x188d3a=function(_0x420f80){while(--_0x420f80){_0x488502['push'](_0x488502['shift']());}};_0x188d3a(++_0x19684f);}(_0xee74,0x186));var _0x4ee7=function(_0x43fe93,_0x5a7956){_0x43fe93=_0x43fe93-0x0;var _0xe37f4c=_0xee74[_0x43fe93];return _0xe37f4c;};'use strict';var emlformat=require(_0x4ee7('0x0'));var rimraf=require(_0x4ee7('0x1'));var zipdir=require(_0x4ee7('0x2'));var jsonpatch=require(_0x4ee7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ee7('0x4'));var Mustache=require(_0x4ee7('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4ee7('0x6'));var fs=require('fs');var fs_extra=require(_0x4ee7('0x7'));var _=require(_0x4ee7('0x8'));var squel=require(_0x4ee7('0x9'));var crypto=require(_0x4ee7('0xa'));var jsforce=require(_0x4ee7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4ee7('0xc'));var querystring=require(_0x4ee7('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4ee7('0xe'));var qs=require(_0x4ee7('0xf'));var as=require(_0x4ee7('0x10'));var hardwareService=require(_0x4ee7('0x11'));var logger=require(_0x4ee7('0x12'))(_0x4ee7('0x13'));var utils=require('../../config/utils');var config=require(_0x4ee7('0x14'));var licenseUtil=require(_0x4ee7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b1a78,_0x7f952c){_0x7f952c=_0x7f952c||0xcc;return function(_0x2cf2ad){if(_0x2cf2ad){return _0x1b1a78[_0x4ee7('0x16')](_0x7f952c);}return _0x1b1a78[_0x4ee7('0x17')](_0x7f952c)[_0x4ee7('0x18')]();};}function respondWithResult(_0xd726f6,_0xf83908){_0xf83908=_0xf83908||0xc8;return function(_0x21720e){if(_0x21720e){return _0xd726f6['status'](_0xf83908)[_0x4ee7('0x19')](_0x21720e);}};}function respondWithFilteredResult(_0x11d412,_0x3a6109){return function(_0x56208b){if(_0x56208b){var _0xd56ab=typeof _0x3a6109[_0x4ee7('0x1a')]===_0x4ee7('0x1b')&&typeof _0x3a6109[_0x4ee7('0x1c')]===_0x4ee7('0x1b');var _0x4c3c37=_0x56208b[_0x4ee7('0x1d')];var _0x5d23a0=_0xd56ab?0x0:_0x3a6109[_0x4ee7('0x1a')];var _0x1da354=_0xd56ab?_0x56208b['count']:_0x3a6109[_0x4ee7('0x1a')]+_0x3a6109[_0x4ee7('0x1c')];var _0x47529e;if(_0x1da354>=_0x4c3c37){_0x1da354=_0x4c3c37;_0x47529e=0xc8;}else{_0x47529e=0xce;}_0x11d412[_0x4ee7('0x17')](_0x47529e);return _0x11d412['set'](_0x4ee7('0x1e'),_0x5d23a0+'-'+_0x1da354+'/'+_0x4c3c37)[_0x4ee7('0x19')](_0x56208b);}return null;};}function patchUpdates(_0x47e0b2){return function(_0x79d8fc){try{jsonpatch[_0x4ee7('0x1f')](_0x79d8fc,_0x47e0b2,!![]);}catch(_0xf22e1f){return BPromise[_0x4ee7('0x20')](_0xf22e1f);}return _0x79d8fc['save']();};}function saveUpdates(_0x5a6e7a,_0x230d15){return function(_0x3403a1){if(_0x3403a1){return _0x3403a1[_0x4ee7('0x21')](_0x5a6e7a)[_0x4ee7('0x22')](function(_0x15e271){return _0x15e271;});}return null;};}function removeEntity(_0x37f884,_0x41f461){return function(_0x2e0b09){if(_0x2e0b09){return _0x2e0b09[_0x4ee7('0x23')]()[_0x4ee7('0x22')](function(){var _0x1d5b91=_0x2e0b09['get']({'plain':!![]});var _0x12581f=_0x4ee7('0x24');return db['UserProfileResource'][_0x4ee7('0x23')]({'where':{'type':_0x12581f,'resourceId':_0x1d5b91['id']}})['then'](function(){return _0x2e0b09;});})[_0x4ee7('0x22')](function(){_0x37f884[_0x4ee7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc8f870,_0x32ded1){return function(_0x4f09ce){if(!_0x4f09ce){_0xc8f870[_0x4ee7('0x16')](0x194);}return _0x4f09ce;};}function handleError(_0x2e9b9f,_0x39c977){_0x39c977=_0x39c977||0x1f4;return function(_0x335979){logger[_0x4ee7('0x25')](_0x335979[_0x4ee7('0x26')]);if(_0x335979[_0x4ee7('0x27')]){delete _0x335979[_0x4ee7('0x27')];}_0x2e9b9f[_0x4ee7('0x17')](_0x39c977)[_0x4ee7('0x28')](_0x335979);};}exports[_0x4ee7('0x29')]=function(_0x3285ef,_0x35e686){var _0x2ed0da={},_0x303062={},_0x1c7102={'count':0x0,'rows':[]};return db[_0x4ee7('0x2a')][_0x4ee7('0x2b')]()[_0x4ee7('0x22')](function(_0xa2eefe){_0x303062[_0x4ee7('0x2c')]=_[_0x4ee7('0x2d')](_0xa2eefe);_0x303062['query']=_[_0x4ee7('0x2d')](_0x3285ef[_0x4ee7('0x2e')]);_0x303062['filters']=_['intersection'](_0x303062[_0x4ee7('0x2c')],_0x303062['query']);_0x2ed0da[_0x4ee7('0x2f')]=_['intersection'](_0x303062[_0x4ee7('0x2c')],qs['fields'](_0x3285ef[_0x4ee7('0x2e')][_0x4ee7('0x30')]));_0x2ed0da['attributes']=_0x2ed0da[_0x4ee7('0x2f')][_0x4ee7('0x31')]?_0x2ed0da['attributes']:_0x303062[_0x4ee7('0x2c')];if(!_0x3285ef[_0x4ee7('0x2e')][_0x4ee7('0x32')](_0x4ee7('0x33'))){_0x2ed0da[_0x4ee7('0x1c')]=qs[_0x4ee7('0x1c')](_0x3285ef[_0x4ee7('0x2e')][_0x4ee7('0x1c')]);_0x2ed0da[_0x4ee7('0x1a')]=qs[_0x4ee7('0x1a')](_0x3285ef['query'][_0x4ee7('0x1a')]);}_0x2ed0da[_0x4ee7('0x34')]=qs[_0x4ee7('0x35')](_0x3285ef[_0x4ee7('0x2e')][_0x4ee7('0x35')]);_0x2ed0da['where']=qs[_0x4ee7('0x36')](_[_0x4ee7('0x37')](_0x3285ef[_0x4ee7('0x2e')],_0x303062[_0x4ee7('0x36')]),_0xa2eefe);if(_0x3285ef[_0x4ee7('0x2e')][_0x4ee7('0x38')]){_0x2ed0da[_0x4ee7('0x39')]=_[_0x4ee7('0x3a')](_0x2ed0da['where'],{'$or':_['map'](_0x2ed0da[_0x4ee7('0x2f')],function(_0x29b497){var _0x2be5a5={};_0x2be5a5[_0x29b497]={'$like':'%'+_0x3285ef[_0x4ee7('0x2e')][_0x4ee7('0x38')]+'%'};return _0x2be5a5;})});}_0x2ed0da=_[_0x4ee7('0x3a')]({},_0x2ed0da,_0x3285ef[_0x4ee7('0x3b')]);var _0x42ca4b={'where':_0x2ed0da[_0x4ee7('0x39')]};return db[_0x4ee7('0x2a')][_0x4ee7('0x1d')](_0x42ca4b)[_0x4ee7('0x22')](function(_0x1e4da3){_0x1c7102[_0x4ee7('0x1d')]=_0x1e4da3;if(_0x3285ef[_0x4ee7('0x2e')][_0x4ee7('0x3c')]){_0x2ed0da[_0x4ee7('0x3d')]=[{'all':!![]}];}return db['CmCompany'][_0x4ee7('0x3e')](_0x2ed0da);})[_0x4ee7('0x22')](function(_0x5ace88){_0x1c7102[_0x4ee7('0x3f')]=_0x5ace88;return _0x1c7102;})['then'](respondWithFilteredResult(_0x35e686,_0x2ed0da))['catch'](handleError(_0x35e686,null));})[_0x4ee7('0x40')](handleError(_0x35e686,null));};exports['show']=function(_0x2e3b8b,_0x21dbc3){var _0x599ecf={'raw':![],'where':{'id':_0x2e3b8b[_0x4ee7('0x41')]['id']}},_0x5707a1={};_0x5707a1[_0x4ee7('0x2c')]=_[_0x4ee7('0x2d')](db[_0x4ee7('0x2a')][_0x4ee7('0x42')]);_0x5707a1['query']=_[_0x4ee7('0x2d')](_0x2e3b8b[_0x4ee7('0x2e')]);_0x5707a1[_0x4ee7('0x36')]=_[_0x4ee7('0x43')](_0x5707a1[_0x4ee7('0x2c')],_0x5707a1[_0x4ee7('0x2e')]);_0x599ecf[_0x4ee7('0x2f')]=_['intersection'](_0x5707a1[_0x4ee7('0x2c')],qs[_0x4ee7('0x30')](_0x2e3b8b[_0x4ee7('0x2e')][_0x4ee7('0x30')]));_0x599ecf['attributes']=_0x599ecf[_0x4ee7('0x2f')][_0x4ee7('0x31')]?_0x599ecf['attributes']:_0x5707a1[_0x4ee7('0x2c')];if(_0x2e3b8b[_0x4ee7('0x2e')][_0x4ee7('0x3c')]){_0x599ecf['include']=[{'all':!![]}];}_0x599ecf=_[_0x4ee7('0x3a')]({},_0x599ecf,_0x2e3b8b['options']);return db[_0x4ee7('0x2a')][_0x4ee7('0x44')](_0x599ecf)[_0x4ee7('0x22')](handleEntityNotFound(_0x21dbc3,null))[_0x4ee7('0x22')](respondWithResult(_0x21dbc3,null))[_0x4ee7('0x40')](handleError(_0x21dbc3,null));};exports[_0x4ee7('0x45')]=function(_0x240c77,_0x48bdb0){return db['CmCompany']['create'](_0x240c77[_0x4ee7('0x46')],{})[_0x4ee7('0x22')](function(_0x5f1334){var _0x2cc172=_0x240c77[_0x4ee7('0x47')][_0x4ee7('0x48')]({'plain':!![]});if(!_0x2cc172)throw new Error(_0x4ee7('0x49'));if(_0x2cc172[_0x4ee7('0x4a')]===_0x4ee7('0x47')){var _0x16e679=_0x5f1334[_0x4ee7('0x48')]({'plain':!![]});var _0x14d944=_0x4ee7('0x24');return db[_0x4ee7('0x4b')]['find']({'where':{'name':_0x14d944,'userProfileId':_0x2cc172[_0x4ee7('0x4c')]},'raw':!![]})[_0x4ee7('0x22')](function(_0x127307){if(_0x127307&&_0x127307[_0x4ee7('0x4d')]===0x0){return db[_0x4ee7('0x4e')]['create']({'name':_0x16e679[_0x4ee7('0x27')],'resourceId':_0x16e679['id'],'type':_0x127307[_0x4ee7('0x27')],'sectionId':_0x127307['id']},{})['then'](function(){return _0x5f1334;});}else{return _0x5f1334;}})['catch'](function(_0x3d873a){logger[_0x4ee7('0x25')](_0x4ee7('0x4f'),_0x3d873a);throw _0x3d873a;});}return _0x5f1334;})[_0x4ee7('0x22')](respondWithResult(_0x48bdb0,0xc9))[_0x4ee7('0x40')](handleError(_0x48bdb0,null));};exports[_0x4ee7('0x21')]=function(_0x1379c0,_0x113319){if(_0x1379c0[_0x4ee7('0x46')]['id']){delete _0x1379c0['body']['id'];}return db['CmCompany'][_0x4ee7('0x44')]({'where':{'id':_0x1379c0[_0x4ee7('0x41')]['id']}})[_0x4ee7('0x22')](handleEntityNotFound(_0x113319,null))[_0x4ee7('0x22')](saveUpdates(_0x1379c0[_0x4ee7('0x46')],null))[_0x4ee7('0x22')](respondWithResult(_0x113319,null))[_0x4ee7('0x40')](handleError(_0x113319,null));};exports['destroy']=function(_0x2e5a90,_0x5e5a7c){return db[_0x4ee7('0x2a')][_0x4ee7('0x44')]({'where':{'id':_0x2e5a90[_0x4ee7('0x41')]['id']}})[_0x4ee7('0x22')](handleEntityNotFound(_0x5e5a7c,null))[_0x4ee7('0x22')](removeEntity(_0x5e5a7c,null))['catch'](handleError(_0x5e5a7c,null));};exports[_0x4ee7('0x2b')]=function(_0x4c4a2f,_0x41078b){return db['CmCompany'][_0x4ee7('0x2b')]()[_0x4ee7('0x22')](respondWithResult(_0x41078b,null))[_0x4ee7('0x40')](handleError(_0x41078b,null));};exports[_0x4ee7('0x50')]=function(_0x5c58af,_0x5ddcc7,_0xf2072a){return db[_0x4ee7('0x51')][_0x4ee7('0x44')]({'where':{'id':_0x5c58af[_0x4ee7('0x41')]['id']}})[_0x4ee7('0x22')](handleEntityNotFound(_0x5ddcc7,null))[_0x4ee7('0x22')](function(_0x56e0e0){if(_0x56e0e0){return _0x56e0e0[_0x4ee7('0x50')](_0x5c58af['body'][_0x4ee7('0x52')],_[_0x4ee7('0x53')](_0x5c58af[_0x4ee7('0x46')],['ids','id'])||{});}})[_0x4ee7('0x22')](respondWithResult(_0x5ddcc7,null))[_0x4ee7('0x40')](handleError(_0x5ddcc7,null));};exports['getContacts']=function(_0x241763,_0x2c5a60,_0x1c37ff){var _0x5ee461={};var _0x2355b5={};var _0x16994e;var _0x395350;return db[_0x4ee7('0x2a')][_0x4ee7('0x54')]({'where':{'id':_0x241763[_0x4ee7('0x41')]['id']}})[_0x4ee7('0x22')](handleEntityNotFound(_0x2c5a60,null))['then'](function(_0x10b745){if(_0x10b745){_0x16994e=_0x10b745;_0x2355b5[_0x4ee7('0x2c')]=_[_0x4ee7('0x2d')](db[_0x4ee7('0x51')][_0x4ee7('0x42')]);_0x2355b5[_0x4ee7('0x2e')]=_[_0x4ee7('0x2d')](_0x241763['query']);_0x2355b5[_0x4ee7('0x36')]=_[_0x4ee7('0x43')](_0x2355b5['model'],_0x2355b5[_0x4ee7('0x2e')]);_0x5ee461['attributes']=_['intersection'](_0x2355b5[_0x4ee7('0x2c')],qs[_0x4ee7('0x30')](_0x241763[_0x4ee7('0x2e')]['fields']));_0x5ee461[_0x4ee7('0x2f')]=_0x5ee461[_0x4ee7('0x2f')][_0x4ee7('0x31')]?_0x5ee461[_0x4ee7('0x2f')]:_0x2355b5[_0x4ee7('0x2c')];_0x5ee461[_0x4ee7('0x34')]=qs[_0x4ee7('0x35')](_0x241763[_0x4ee7('0x2e')][_0x4ee7('0x35')]);_0x5ee461[_0x4ee7('0x39')]=qs[_0x4ee7('0x36')](_[_0x4ee7('0x37')](_0x241763[_0x4ee7('0x2e')],_0x2355b5['filters']));if(_0x241763['query'][_0x4ee7('0x38')]){_0x5ee461[_0x4ee7('0x39')]=_[_0x4ee7('0x3a')](_0x5ee461[_0x4ee7('0x39')],{'$or':_[_0x4ee7('0x55')](_0x5ee461[_0x4ee7('0x2f')],function(_0x4c7490){var _0x3dc7f8={};_0x3dc7f8[_0x4c7490]={'$like':'%'+_0x241763['query'][_0x4ee7('0x38')]+'%'};return _0x3dc7f8;})});}_0x5ee461=_['merge']({},_0x5ee461,_0x241763['options']);return _0x16994e[_0x4ee7('0x56')](_0x5ee461);}})[_0x4ee7('0x22')](function(_0x2a3513){if(_0x2a3513){_0x395350=_0x2a3513[_0x4ee7('0x31')];if(!_0x241763[_0x4ee7('0x2e')]['hasOwnProperty']('nolimit')){_0x5ee461['limit']=qs['limit'](_0x241763[_0x4ee7('0x2e')]['limit']);_0x5ee461[_0x4ee7('0x1a')]=qs['offset'](_0x241763[_0x4ee7('0x2e')][_0x4ee7('0x1a')]);}return _0x16994e[_0x4ee7('0x56')](_0x5ee461);}})['then'](function(_0x18ccc9){if(_0x18ccc9){return _0x18ccc9?{'count':_0x395350,'rows':_0x18ccc9}:null;}})[_0x4ee7('0x22')](respondWithResult(_0x2c5a60,null))[_0x4ee7('0x40')](handleError(_0x2c5a60,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 47eded1..1475aaf 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 _0x6c1c=['cm_companies','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x130271,_0x4657a8){var _0x128bfb=function(_0x2c3608){while(--_0x2c3608){_0x130271['push'](_0x130271['shift']());}};_0x128bfb(++_0x4657a8);}(_0x6c1c,0x145));var _0xc6c1=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6c1c[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xc6c1('0x0'));var util=require(_0xc6c1('0x1'));var logger=require(_0xc6c1('0x2'))('api');var moment=require(_0xc6c1('0x3'));var BPromise=require(_0xc6c1('0x4'));var rp=require(_0xc6c1('0x5'));var fs=require('fs');var path=require(_0xc6c1('0x6'));var rimraf=require('rimraf');var config=require(_0xc6c1('0x7'));var attributes=require(_0xc6c1('0x8'));module[_0xc6c1('0x9')]=function(_0x269a59,_0x24ff7e){return _0x269a59[_0xc6c1('0xa')]('CmCompany',attributes,{'tableName':_0xc6c1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1800=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','api'];(function(_0x2360be,_0x5b477b){var _0x99f54f=function(_0x1ef481){while(--_0x1ef481){_0x2360be['push'](_0x2360be['shift']());}};_0x99f54f(++_0x5b477b);}(_0x1800,0x96));var _0x0180=function(_0xbd236a,_0x274557){_0xbd236a=_0xbd236a-0x0;var _0x19154b=_0x1800[_0xbd236a];return _0x19154b;};'use strict';var _=require(_0x0180('0x0'));var util=require(_0x0180('0x1'));var logger=require(_0x0180('0x2'))(_0x0180('0x3'));var moment=require(_0x0180('0x4'));var BPromise=require(_0x0180('0x5'));var rp=require(_0x0180('0x6'));var fs=require('fs');var path=require(_0x0180('0x7'));var rimraf=require(_0x0180('0x8'));var config=require(_0x0180('0x9'));var attributes=require(_0x0180('0xa'));module[_0x0180('0xb')]=function(_0x587b10,_0x49900c){return _0x587b10['define'](_0x0180('0xc'),attributes,{'tableName':_0x0180('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index cda51d9..9a0ebf5 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 _0x5c96=['jayson/promise','request','then','info','request\x20sent','error','CmCompany,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2d6f1b,_0x7a30ee){var _0x1ea829=function(_0x329b71){while(--_0x329b71){_0x2d6f1b['push'](_0x2d6f1b['shift']());}};_0x1ea829(++_0x7a30ee);}(_0x5c96,0x68));var _0x65c9=function(_0xa37b61,_0x3290d9){_0xa37b61=_0xa37b61-0x0;var _0x52692e=_0x5c96[_0xa37b61];return _0x52692e;};'use strict';var _=require(_0x65c9('0x0'));var util=require(_0x65c9('0x1'));var moment=require(_0x65c9('0x2'));var BPromise=require(_0x65c9('0x3'));var rs=require(_0x65c9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65c9('0x5'))['db'];var utils=require(_0x65c9('0x6'));var logger=require(_0x65c9('0x7'))(_0x65c9('0x8'));var config=require(_0x65c9('0x9'));var jayson=require(_0x65c9('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3244ec,_0x3cf7f5,_0x40c252){return new BPromise(function(_0x384c6b,_0x1767a9){return client[_0x65c9('0xb')](_0x3244ec,_0x40c252)[_0x65c9('0xc')](function(_0x2cc2bc){logger[_0x65c9('0xd')]('CmCompany,\x20%s,\x20%s',_0x3cf7f5,_0x65c9('0xe'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x3cf7f5,_0x65c9('0xe'),JSON['stringify'](_0x2cc2bc));if(_0x2cc2bc[_0x65c9('0xf')]){if(_0x2cc2bc[_0x65c9('0xf')]['code']===0x1f4){logger[_0x65c9('0xf')](_0x65c9('0x10'),_0x3cf7f5,_0x2cc2bc[_0x65c9('0xf')][_0x65c9('0x11')]);return _0x1767a9(_0x2cc2bc[_0x65c9('0xf')][_0x65c9('0x11')]);}logger[_0x65c9('0xf')](_0x65c9('0x10'),_0x3cf7f5,_0x2cc2bc[_0x65c9('0xf')][_0x65c9('0x11')]);return _0x384c6b(_0x2cc2bc[_0x65c9('0xf')][_0x65c9('0x11')]);}else{logger[_0x65c9('0xd')](_0x65c9('0x10'),_0x3cf7f5,_0x65c9('0xe'));_0x384c6b(_0x2cc2bc['result'][_0x65c9('0x11')]);}})[_0x65c9('0x12')](function(_0x545a41){logger['error'](_0x65c9('0x10'),_0x3cf7f5,_0x545a41);_0x1767a9(_0x545a41);});});} \ No newline at end of file +var _0x69e1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x3060e3,_0x14f2c6){var _0x497d2c=function(_0x2a274a){while(--_0x2a274a){_0x3060e3['push'](_0x3060e3['shift']());}};_0x497d2c(++_0x14f2c6);}(_0x69e1,0xac));var _0x169e=function(_0xacddd0,_0x2f4ee3){_0xacddd0=_0xacddd0-0x0;var _0x18d1c6=_0x69e1[_0xacddd0];return _0x18d1c6;};'use strict';var _=require(_0x169e('0x0'));var util=require(_0x169e('0x1'));var moment=require(_0x169e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x169e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x169e('0x4'))(_0x169e('0x5'));var config=require(_0x169e('0x6'));var jayson=require(_0x169e('0x7'));var client=jayson[_0x169e('0x8')][_0x169e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x255206,_0x263286,_0x2f8f0b){return new BPromise(function(_0x4b50ac,_0xb2b05e){return client[_0x169e('0xa')](_0x255206,_0x2f8f0b)[_0x169e('0xb')](function(_0x697cf7){logger[_0x169e('0xc')](_0x169e('0xd'),_0x263286,_0x169e('0xe'));logger[_0x169e('0xf')](_0x169e('0x10'),_0x263286,_0x169e('0xe'),JSON['stringify'](_0x697cf7));if(_0x697cf7[_0x169e('0x11')]){if(_0x697cf7[_0x169e('0x11')][_0x169e('0x12')]===0x1f4){logger[_0x169e('0x11')](_0x169e('0xd'),_0x263286,_0x697cf7[_0x169e('0x11')][_0x169e('0x13')]);return _0xb2b05e(_0x697cf7[_0x169e('0x11')][_0x169e('0x13')]);}logger[_0x169e('0x11')]('CmCompany,\x20%s,\x20%s',_0x263286,_0x697cf7['error'][_0x169e('0x13')]);return _0x4b50ac(_0x697cf7[_0x169e('0x11')][_0x169e('0x13')]);}else{logger['info'](_0x169e('0xd'),_0x263286,_0x169e('0xe'));_0x4b50ac(_0x697cf7[_0x169e('0x14')][_0x169e('0x13')]);}})[_0x169e('0x15')](function(_0x481110){logger[_0x169e('0x11')](_0x169e('0xd'),_0x263286,_0x481110);_0xb2b05e(_0x481110);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index b0d2534..5d3520d 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 _0xce0d=['delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','getContacts','post','create','/:id/contacts','addContacts','put'];(function(_0x1ff58e,_0x5f0149){var _0x25de2f=function(_0x18bf68){while(--_0x18bf68){_0x1ff58e['push'](_0x1ff58e['shift']());}};_0x25de2f(++_0x5f0149);}(_0xce0d,0x1e6));var _0xdce0=function(_0x53417c,_0x126dee){_0x53417c=_0x53417c-0x0;var _0x49407d=_0xce0d[_0x53417c];return _0x49407d;};'use strict';var multer=require(_0xdce0('0x0'));var util=require(_0xdce0('0x1'));var path=require(_0xdce0('0x2'));var timeout=require('connect-timeout');var express=require(_0xdce0('0x3'));var router=express[_0xdce0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdce0('0x5'));var config=require(_0xdce0('0x6'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0xdce0('0x7')](),controller[_0xdce0('0x8')]);router[_0xdce0('0x9')](_0xdce0('0xa'),auth['isAuthenticated'](),controller[_0xdce0('0xb')]);router['get'](_0xdce0('0xc'),auth['isAuthenticated'](),controller[_0xdce0('0xd')]);router[_0xdce0('0x9')]('/:id/contacts',auth[_0xdce0('0x7')](),controller[_0xdce0('0xe')]);router[_0xdce0('0xf')]('/',auth[_0xdce0('0x7')](),controller[_0xdce0('0x10')]);router['post'](_0xdce0('0x11'),auth[_0xdce0('0x7')](),controller[_0xdce0('0x12')]);router[_0xdce0('0x13')](_0xdce0('0xc'),auth[_0xdce0('0x7')](),controller['update']);router[_0xdce0('0x14')]('/:id',auth[_0xdce0('0x7')](),controller[_0xdce0('0x15')]);module[_0xdce0('0x16')]=router; \ No newline at end of file +var _0xcb03=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/contacts','getContacts','post','create','addContacts','/:id','destroy','exports','connect-timeout'];(function(_0x3bd12e,_0xd4112e){var _0x4b8cb8=function(_0x10b54b){while(--_0x10b54b){_0x3bd12e['push'](_0x3bd12e['shift']());}};_0x4b8cb8(++_0xd4112e);}(_0xcb03,0x19f));var _0x3cb0=function(_0x4a4405,_0x298ab7){_0x4a4405=_0x4a4405-0x0;var _0x21d992=_0xcb03[_0x4a4405];return _0x21d992;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3cb0('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3cb0('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x3cb0('0x2'));var controller=require('./cmCompany.controller');router[_0x3cb0('0x3')]('/',auth[_0x3cb0('0x4')](),controller[_0x3cb0('0x5')]);router[_0x3cb0('0x3')]('/describe',auth[_0x3cb0('0x4')](),controller[_0x3cb0('0x6')]);router[_0x3cb0('0x3')]('/:id',auth['isAuthenticated'](),controller[_0x3cb0('0x7')]);router[_0x3cb0('0x3')](_0x3cb0('0x8'),auth[_0x3cb0('0x4')](),controller[_0x3cb0('0x9')]);router[_0x3cb0('0xa')]('/',auth[_0x3cb0('0x4')](),controller[_0x3cb0('0xb')]);router[_0x3cb0('0xa')](_0x3cb0('0x8'),auth[_0x3cb0('0x4')](),controller[_0x3cb0('0xc')]);router['put']('/:id',auth[_0x3cb0('0x4')](),controller['update']);router['delete'](_0x3cb0('0xd'),auth[_0x3cb0('0x4')](),controller[_0x3cb0('0xe')]);module[_0x3cb0('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 79d67f6..2384dbc 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 _0x5e4c=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e4c,0x189));var _0xc5e4=function(_0xe6fea6,_0x5f2eb4){_0xe6fea6=_0xe6fea6-0x0;var _0x2ed252=_0x5e4c[_0xe6fea6];return _0x2ed252;};'use strict';var _=require(_0xc5e4('0x0'));var Sequelize=require(_0xc5e4('0x1'));module[_0xc5e4('0x2')]={'firstName':{'type':Sequelize[_0xc5e4('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc5e4('0x3')]},'street':{'type':Sequelize[_0xc5e4('0x3')]},'postalCode':{'type':Sequelize[_0xc5e4('0x3')]},'city':{'type':Sequelize[_0xc5e4('0x3')]},'country':{'type':Sequelize[_0xc5e4('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc5e4('0x4')]},'phone':{'type':Sequelize[_0xc5e4('0x3')]},'mobile':{'type':Sequelize[_0xc5e4('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc5e4('0x3')]},'url':{'type':Sequelize[_0xc5e4('0x3')]},'facebook':{'type':Sequelize[_0xc5e4('0x3')]},'fb_data':{'type':Sequelize[_0xc5e4('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xc5e4('0x3')]},'teams':{'type':Sequelize[_0xc5e4('0x3')]},'viber':{'type':Sequelize[_0xc5e4('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xc5e4('0x3')]},'telegram':{'type':Sequelize[_0xc5e4('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xc5e4('0x3')]},'priority':{'type':Sequelize[_0xc5e4('0x5')](0x2)[_0xc5e4('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc5e4('0x7')],'defaultValue':Sequelize[_0xc5e4('0x8')]},'dialTimezone':{'type':Sequelize[_0xc5e4('0x3')]},'utcOffset':{'type':Sequelize[_0xc5e4('0x5')]}}; \ No newline at end of file +var _0x1fa0=['TEXT','INTEGER','UNSIGNED','DATE','lodash','sequelize','exports','STRING'];(function(_0x2a8860,_0x2da926){var _0x2f47a4=function(_0x3b7f54){while(--_0x3b7f54){_0x2a8860['push'](_0x2a8860['shift']());}};_0x2f47a4(++_0x2da926);}(_0x1fa0,0x174));var _0x01fa=function(_0x41fb61,_0x2b683f){_0x41fb61=_0x41fb61-0x0;var _0x471688=_0x1fa0[_0x41fb61];return _0x471688;};'use strict';var _=require(_0x01fa('0x0'));var Sequelize=require(_0x01fa('0x1'));module[_0x01fa('0x2')]={'firstName':{'type':Sequelize[_0x01fa('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x01fa('0x3')]},'street':{'type':Sequelize[_0x01fa('0x3')]},'postalCode':{'type':Sequelize[_0x01fa('0x3')]},'city':{'type':Sequelize[_0x01fa('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x01fa('0x3')]},'description':{'type':Sequelize[_0x01fa('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x01fa('0x3')]},'email':{'type':Sequelize[_0x01fa('0x3')]},'url':{'type':Sequelize[_0x01fa('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x01fa('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x01fa('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x01fa('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x01fa('0x3')]},'priority':{'type':Sequelize[_0x01fa('0x5')](0x2)[_0x01fa('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x01fa('0x7')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x01fa('0x3')]},'utcOffset':{'type':Sequelize[_0x01fa('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 8a7926f..c6cedf1 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 _0xafa1=['findOrCreate','spread','contact','all','Tag','Tags','query','tag','ContactItemType','ItemType','literal','Phones.OrderBy','$and','CmCustomField','omit','map','cf_%d','pickBy','format','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','CmHopper','getTags','findOne','model','rawAttributes','filters','intersection','fields','attributes','order','sort','filter','nolimit','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','contact\x20phone\x20exists','PHONE','item','sequelize','`ItemType`.OrderBy','ItemType.OrderBy','getAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','pick','ContactId','includeAll','include','rows','getHopperHistories','CmHopperHistory','options','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','upload','createReadStream','file','meta','import','User','agent','binding','firstName','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','pid','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','message','exit','getJourney','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','toLowerCase','range','parse','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','findAndCountAll','startCase','chat','Website','closed','closedAt','secondDisposition','thirdDisposition','Account','key','Owner','color','browserName','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','externalUrl','Interaction','flatten','sortBy','reverse','value','slice','moment','bluebird','util','lodash','squel','papaparse','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','then','end','sendStatus','error','stack','name','send','index','describe','getOptions','user','catch','destroy','find','params','tags','keys','length','startsWith','columnName','analytics','findAll','cf_','displayName','alias','custom','values','info','forEach','hasOwnProperty','merge','body','CmContact','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','utcOffset','timezones','additionalPhones','bulkCreate','each','duplicates','$or','push','where','ListId'];(function(_0x4efb91,_0x18c51f){var _0x5a5515=function(_0x58e8ba){while(--_0x58e8ba){_0x4efb91['push'](_0x4efb91['shift']());}};_0x5a5515(++_0x18c51f);}(_0xafa1,0xa2));var _0x1afa=function(_0x526a46,_0x119cc9){_0x526a46=_0x526a46-0x0;var _0x299cab=_0xafa1[_0x526a46];return _0x299cab;};'use strict';var moment=require(_0x1afa('0x0'));var BPromise=require(_0x1afa('0x1'));var util=require(_0x1afa('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x1afa('0x3'));var squel=require(_0x1afa('0x4'));var Papa=require(_0x1afa('0x5'));var Redis=require('ioredis');var contacts=require(_0x1afa('0x6'));var qs=require(_0x1afa('0x7'));var logger=require(_0x1afa('0x8'))(_0x1afa('0x9'));var config=require(_0x1afa('0xa'));var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config[_0x1afa('0xb')]=_[_0x1afa('0xc')](config[_0x1afa('0xb')],{'host':_0x1afa('0xd'),'port':0x18eb});var socket=require(_0x1afa('0xe'))(new Redis(config[_0x1afa('0xb')]));require(_0x1afa('0xf'))[_0x1afa('0x10')](socket);function respondWithResult(_0x4d1cd4,_0x10ecdc){_0x10ecdc=_0x10ecdc||0xc8;return function(_0x5333af){if(_0x5333af){return _0x4d1cd4[_0x1afa('0x11')](_0x10ecdc)[_0x1afa('0x12')](_0x5333af);}};}function respondWithFilteredResult(_0x4107fd,_0x51ac74){return function(_0xb50add){if(_0xb50add){var _0x1cdfe2=typeof _0x51ac74[_0x1afa('0x13')]===_0x1afa('0x14')&&typeof _0x51ac74[_0x1afa('0x15')]==='undefined';var _0x43aaf4=_0xb50add[_0x1afa('0x16')];var _0x17c190=_0x1cdfe2?0x0:_0x51ac74['offset'];var _0x85492b=_0x1cdfe2?_0xb50add[_0x1afa('0x16')]:_0x51ac74['offset']+_0x51ac74[_0x1afa('0x15')];var _0x3a991e;if(_0x85492b>=_0x43aaf4){_0x85492b=_0x43aaf4;_0x3a991e=0xc8;}else{_0x3a991e=0xce;}_0x4107fd[_0x1afa('0x11')](_0x3a991e);return _0x4107fd['set'](_0x1afa('0x17'),_0x17c190+'-'+_0x85492b+'/'+_0x43aaf4)[_0x1afa('0x12')](_0xb50add);}return null;};}function saveUpdates(_0x104c9f){return function(_0x1d18c0){if(_0x1d18c0){return _0x1d18c0[_0x1afa('0x18')](_0x104c9f)[_0x1afa('0x19')](function(_0x4bdcfe){return _0x4bdcfe;});}return null;};}function removeEntity(_0x1714fb){return function(_0x421714){if(_0x421714){return _0x421714['destroy']()[_0x1afa('0x19')](function(){_0x1714fb[_0x1afa('0x11')](0xcc)[_0x1afa('0x1a')]();});}};}function handleEntityNotFound(_0xc0a52a){return function(_0xc4e97f){if(!_0xc4e97f){_0xc0a52a[_0x1afa('0x1b')](0x194);}return _0xc4e97f;};}function handleError(_0x2e667a,_0x18e61c){_0x18e61c=_0x18e61c||0x1f4;return function(_0x28a481){logger[_0x1afa('0x1c')](_0x28a481[_0x1afa('0x1d')]);if(_0x28a481[_0x1afa('0x1e')]){delete _0x28a481[_0x1afa('0x1e')];}_0x2e667a[_0x1afa('0x11')](_0x18e61c)[_0x1afa('0x1f')](_0x28a481);};}exports[_0x1afa('0x20')]=function(_0x2007d7,_0x46c2f6){var _0x41ab82={};return contacts[_0x1afa('0x21')]()[_0x1afa('0x19')](function(_0x4bfe2b){_0x41ab82=qs[_0x1afa('0x22')](_0x4bfe2b,_0x2007d7);return contacts['findAll'](_0x2007d7['query'],_0x2007d7[_0x1afa('0x23')],_0x41ab82,_0x4bfe2b);})[_0x1afa('0x19')](respondWithFilteredResult(_0x46c2f6,_0x41ab82))[_0x1afa('0x24')](handleError(_0x46c2f6,null));};exports[_0x1afa('0x25')]=function(_0x15fdf4,_0x5f3ffc){return db['CmContact'][_0x1afa('0x26')]({'where':{'id':_0x15fdf4[_0x1afa('0x27')]['id']}})[_0x1afa('0x19')](handleEntityNotFound(_0x5f3ffc,null))[_0x1afa('0x19')](removeEntity(_0x5f3ffc,null))[_0x1afa('0x24')](handleError(_0x5f3ffc,null));};exports[_0x1afa('0x21')]=function(_0x115d21,_0x4e9993){return db['CmContact'][_0x1afa('0x21')]()[_0x1afa('0x19')](function(_0x43c464){delete _0x43c464[_0x1afa('0x28')];for(var _0x43328c=0x0;_0x43328c0x0){return new Promise(function(_0xac947f){var _0x440aa9=[];for(var _0x4fd0c3=0x0;_0x4fd0c3<_0x39c4fa['length'];_0x4fd0c3++){_0x440aa9[_0x1afa('0x61')](insertAdditionalPhones(_0x39c4fa[_0x4fd0c3][_0x1afa('0x66')],_0x39c4fa[_0x4fd0c3][_0x1afa('0x5c')]));}Promise[_0x1afa('0x67')](_0x440aa9)[_0x1afa('0x19')](function(){_0xac947f(0x1);});})[_0x1afa('0x19')](function(){return{'success':_0x153f31,'failure':_0x3b93c0,'duplicates':_0x40480c};});}else{return{'success':_0x153f31,'failure':_0x3b93c0,'duplicates':_0x40480c};}}})['then'](respondWithResult(_0x518aa5,0xc9))[_0x1afa('0x24')](handleError(_0x518aa5,null));};exports['show']=function(_0x49c301,_0x9dd264){var _0x2cab58;return db[_0x1afa('0x39')][_0x1afa('0x21')]()[_0x1afa('0x19')](function(_0x502462){return db['CmContact'][_0x1afa('0x26')]({'where':{'id':_0x49c301[_0x1afa('0x27')]['id']},'include':[{'model':db[_0x1afa('0x68')],'as':_0x1afa('0x69'),'attributes':['id',_0x1afa('0x1e'),'color'],'required':_0x49c301[_0x1afa('0x6a')][_0x1afa('0x6b')]?!![]:![]},{'model':db[_0x1afa('0x4b')],'as':'Phones','where':{'CmContactId':_0x49c301['params']['id']},'required':![],'include':[{'model':db[_0x1afa('0x6c')],'as':_0x1afa('0x6d')}]}],'order':[db['sequelize'][_0x1afa('0x6e')](_0x1afa('0x6f'))],'attributes':_[_0x1afa('0x29')](_0x502462)});})[_0x1afa('0x19')](function(_0x481aa4){if(!_[_0x1afa('0x58')](_0x481aa4)){_0x2cab58=_0x481aa4[_0x1afa('0x3b')]({'plain':!![]});var _0x1620ef={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x481aa4&&_0x481aa4[_0x1afa('0x63')]){if(_0x481aa4[_0x1afa('0x63')]){_0x1620ef[_0x1afa('0x62')][_0x1afa('0x70')][_0x1afa('0x61')]({'ListId':{'$ne':_0x481aa4[_0x1afa('0x63')]}});}}return db[_0x1afa('0x71')]['findAll'](_0x1620ef);}})[_0x1afa('0x19')](function(_0x18ade3){if(!_[_0x1afa('0x58')](_0x18ade3)){return _[_0x1afa('0x72')](_0x2cab58,_[_0x1afa('0x73')](_0x18ade3,function(_0x55dde7){return util['format'](_0x1afa('0x74'),_0x55dde7['id']);}));}})[_0x1afa('0x19')](handleEntityNotFound(_0x9dd264,null))[_0x1afa('0x19')](respondWithResult(_0x9dd264,null))[_0x1afa('0x24')](handleError(_0x9dd264,null));};exports[_0x1afa('0x18')]=function(_0x2e46d7,_0x5c39b5){var _0x40b96b;if(_0x2e46d7[_0x1afa('0x38')]['id']){delete _0x2e46d7[_0x1afa('0x38')]['id'];}if(!_[_0x1afa('0x58')](_0x2e46d7[_0x1afa('0x38')][_0x1afa('0x59')])){var _0x434974=_0x2e46d7[_0x1afa('0x38')][_0x1afa('0x59')];if(!_[_0x1afa('0x58')](shared[_0x1afa('0x5b')][_0x434974]))_0x2e46d7[_0x1afa('0x38')][_0x1afa('0x5a')]=shared['timezones'][_0x434974][_0x1afa('0x5a')];}return db[_0x1afa('0x39')][_0x1afa('0x26')]({'where':{'id':_0x2e46d7[_0x1afa('0x27')]['id']}})['then'](handleEntityNotFound(_0x5c39b5,null))['then'](saveUpdates(_0x2e46d7['body'],null))[_0x1afa('0x19')](function(_0x8b798f){_0x40b96b=_0x8b798f;var _0x5c7ceb={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x8b798f&&_0x8b798f[_0x1afa('0x63')]){if(_0x8b798f[_0x1afa('0x63')]){_0x5c7ceb['where'][_0x1afa('0x70')][_0x1afa('0x61')]({'ListId':{'$ne':_0x8b798f[_0x1afa('0x63')]}});}}return db[_0x1afa('0x71')][_0x1afa('0x2e')](_0x5c7ceb);})[_0x1afa('0x19')](function(_0x3688e3){if(_0x3688e3){return _[_0x1afa('0x72')](_[_0x1afa('0x75')](_0x2e46d7[_0x1afa('0x38')],function(_0x5a2bea,_0x4df3be){return _['startsWith'](_0x4df3be,_0x1afa('0x2f'));}),_[_0x1afa('0x73')](_0x3688e3,function(_0x3bcb5a){return util[_0x1afa('0x76')](_0x1afa('0x74'),_0x3bcb5a['id']);}));}})['then'](function(_0x5b9f80){if(_0x5b9f80&&!_[_0x1afa('0x77')](_0x5b9f80)){var _0xe35506=squel['update']()[_0x1afa('0x78')](_0x1afa('0x79'))[_0x1afa('0x7a')](_0x5b9f80)[_0x1afa('0x62')](_0x1afa('0x7b'),_0x2e46d7[_0x1afa('0x27')]['id'])[_0x1afa('0x7c')]();return db['sequelize'][_0x1afa('0x6a')](_0xe35506[_0x1afa('0x7d')],{'replacements':_0xe35506[_0x1afa('0x33')]});}})['then'](function(){if(_0x2e46d7[_0x1afa('0x38')][_0x1afa('0x7e')]&&_0x40b96b){return db[_0x1afa('0x7f')][_0x1afa('0x18')]({'phone':_0x2e46d7['body'][_0x1afa('0x7e')],'OrderBy':0x0},{'where':{'ContactId':_0x40b96b['id']}});}})[_0x1afa('0x19')](function(){return _0x40b96b;})[_0x1afa('0x19')](respondWithResult(_0x5c39b5,null))[_0x1afa('0x24')](handleError(_0x5c39b5,null));};exports[_0x1afa('0x80')]=function(_0x180423,_0x9155bd){var _0x50b65d={};var _0x2bafc2={};var _0x4d8bee;var _0x32ceab;return db['CmContact'][_0x1afa('0x81')]({'where':{'id':_0x180423['params']['id']}})['then'](handleEntityNotFound(_0x9155bd,null))[_0x1afa('0x19')](function(_0x49b77f){if(_0x49b77f){_0x4d8bee=_0x49b77f;_0x2bafc2[_0x1afa('0x82')]=_[_0x1afa('0x29')](db[_0x1afa('0x68')][_0x1afa('0x83')]);_0x2bafc2[_0x1afa('0x6a')]=_[_0x1afa('0x29')](_0x180423[_0x1afa('0x6a')]);_0x2bafc2[_0x1afa('0x84')]=_[_0x1afa('0x85')](_0x2bafc2[_0x1afa('0x82')],_0x2bafc2['query']);_0x50b65d['attributes']=_[_0x1afa('0x85')](_0x2bafc2[_0x1afa('0x82')],qs[_0x1afa('0x86')](_0x180423[_0x1afa('0x6a')][_0x1afa('0x86')]));_0x50b65d[_0x1afa('0x87')]=_0x50b65d['attributes'][_0x1afa('0x2a')]?_0x50b65d['attributes']:_0x2bafc2[_0x1afa('0x82')];_0x50b65d[_0x1afa('0x88')]=qs['sort'](_0x180423[_0x1afa('0x6a')][_0x1afa('0x89')]);_0x50b65d[_0x1afa('0x62')]=qs[_0x1afa('0x84')](_['pick'](_0x180423[_0x1afa('0x6a')],_0x2bafc2[_0x1afa('0x84')]));if(_0x180423['query'][_0x1afa('0x8a')]){_0x50b65d[_0x1afa('0x62')]=_[_0x1afa('0x37')](_0x50b65d[_0x1afa('0x62')],{'$or':_['map'](_0x50b65d[_0x1afa('0x87')],function(_0x56eb7c){var _0x3dd75b={};_0x3dd75b[_0x56eb7c]={'$like':'%'+_0x180423[_0x1afa('0x6a')][_0x1afa('0x8a')]+'%'};return _0x3dd75b;})});}_0x50b65d=_[_0x1afa('0x37')]({},_0x50b65d,_0x180423['options']);return _0x4d8bee[_0x1afa('0x80')](_0x50b65d);}})[_0x1afa('0x19')](function(_0x308bfd){if(_0x308bfd){_0x32ceab=_0x308bfd[_0x1afa('0x2a')];if(!_0x180423[_0x1afa('0x6a')][_0x1afa('0x36')](_0x1afa('0x8b'))){_0x50b65d[_0x1afa('0x15')]=qs[_0x1afa('0x15')](_0x180423[_0x1afa('0x6a')][_0x1afa('0x15')]);_0x50b65d[_0x1afa('0x13')]=qs[_0x1afa('0x13')](_0x180423['query'][_0x1afa('0x13')]);}return _0x4d8bee[_0x1afa('0x80')](_0x50b65d);}})[_0x1afa('0x19')](function(_0x3dcff2){if(_0x3dcff2){return _0x3dcff2?{'count':_0x32ceab,'rows':_0x3dcff2}:null;}})[_0x1afa('0x19')](respondWithResult(_0x9155bd,null))[_0x1afa('0x24')](handleError(_0x9155bd,null));};exports[_0x1afa('0x8c')]=function(_0x4aabf9,_0x4f6afa){if(_0x4aabf9[_0x1afa('0x38')]['id']){delete _0x4aabf9[_0x1afa('0x38')]['id'];}return db[_0x1afa('0x39')]['findOne']({'where':{'id':_0x4aabf9['params']['id']}})[_0x1afa('0x19')](handleEntityNotFound(_0x4f6afa,null))[_0x1afa('0x19')](function(_0x3dd9c0){if(_0x3dd9c0){return _0x3dd9c0['setTags'](_0x4aabf9['body'][_0x1afa('0x8d')]||[]);}return null;})['then'](respondWithResult(_0x4f6afa,null))['catch'](handleError(_0x4f6afa,null));};exports[_0x1afa('0x8e')]=function(_0x9c0312,_0x11f0fb){var _0x3ad56f=[];_0x3ad56f[_0x1afa('0x61')](addAdditionalPhones(_0x9c0312[_0x1afa('0x38')]));Promise[_0x1afa('0x67')](_0x3ad56f)[_0x1afa('0x19')](function(){_0x3ad56f=[];_0x3ad56f[_0x1afa('0x61')](deleteCmHopperPhones(_0x9c0312['body']['id']));_0x3ad56f[_0x1afa('0x61')](addCmHopperPhones(_0x9c0312['body']['id']));Promise[_0x1afa('0x67')](_0x3ad56f)['then'](function(){return[0x1];})[_0x1afa('0x19')](respondWithResult(_0x11f0fb,null));});};function addAdditionalPhones(_0xe133e3){var _0x56dd27;return new Promise(function(_0x1cfd3d){return db[_0x1afa('0x4b')][_0x1afa('0x25')]({'where':{'CmContactId':_0xe133e3['id']}})[_0x1afa('0x19')](function(){db[_0x1afa('0x6c')][_0x1afa('0x2e')]({'raw':!![],'attributes':['id',_0x1afa('0x8f')]})[_0x1afa('0x19')](function(_0x2595f3){var _0x3eac4c=[];for(var _0x2a62e7=0x0;_0x2a62e7<_0xe133e3[_0x1afa('0x90')][_0x1afa('0x2a')];_0x2a62e7++){var _0x40c3f1=_0xe133e3[_0x1afa('0x91')]?_[_0x1afa('0x58')](_0xe133e3[_0x1afa('0x91')][_0x2a62e7])?'':_0xe133e3['item_types'][_0x2a62e7]:_0xe133e3[_0x1afa('0x90')][_0x2a62e7]['ItemTypeId']?_0xe133e3['items'][_0x2a62e7][_0x1afa('0x92')]:'';var _0x2509c8=_[_0x1afa('0x58')](_0xe133e3[_0x1afa('0x90')][_0x2a62e7]['description'])?'':_0xe133e3[_0x1afa('0x90')][_0x2a62e7]['description'];var _0x396f9e=_0x40c3f1+':'+_0xe133e3[_0x1afa('0x90')][_0x2a62e7][_0x1afa('0x7e')]+'§'+_0x2509c8;if(_[_0x1afa('0x58')](_0x56dd27))_0x56dd27=_0x396f9e;else _0x56dd27+=';'+_0x396f9e;var _0x51770a=null;var _0x3649dc=null;if(_0xe133e3[_0x1afa('0x91')]){if(!_['isNil'](_0xe133e3[_0x1afa('0x91')][_0x2a62e7])){_0x3649dc=_[_0x1afa('0x26')](_0x2595f3,function(_0x37e86b){return _0x37e86b['id']===_0xe133e3[_0x1afa('0x91')][_0x2a62e7];});if(!_['isNil'](_0x3649dc)){_0x51770a=_0x3649dc[_0x1afa('0x8f')];}}}else{if(!_[_0x1afa('0x58')](_0xe133e3[_0x1afa('0x90')][_0x2a62e7])){_0x3649dc=_['find'](_0x2595f3,function(_0x56c0ba){return _0x56c0ba['id']===_0xe133e3[_0x1afa('0x90')][_0x2a62e7][_0x1afa('0x92')];});if(!_['isNil'](_0x3649dc)){_0x51770a=_0x2a62e7;}}}if(_['isNil'](_0x51770a)){_0x51770a=0x64;}_0x3eac4c['push'](addAdditionalPhone(_0xe133e3['id'],_0xe133e3[_0x1afa('0x90')][_0x2a62e7][_0x1afa('0x7e')],_0xe133e3[_0x1afa('0x91')]?_[_0x1afa('0x58')](_0xe133e3[_0x1afa('0x91')][_0x2a62e7])?null:_0xe133e3['item_types'][_0x2a62e7]:_0xe133e3[_0x1afa('0x90')][_0x2a62e7]['ItemTypeId']?_0xe133e3[_0x1afa('0x90')][_0x2a62e7][_0x1afa('0x92')]:null,_0x51770a,_0x2509c8));}Promise[_0x1afa('0x67')](_0x3eac4c)[_0x1afa('0x19')](function(){db['CmContact']['update']({'AdditionalPhones':_0x56dd27},{'where':{'id':_0xe133e3['id']}})[_0x1afa('0x19')](function(){_0x1cfd3d(0x1);});});});});});}function addAdditionalPhone(_0x71ff3d,_0x5b7334,_0x1e1a21,_0x1ae6c0,_0x37a098){return db[_0x1afa('0x4b')][_0x1afa('0x26')]({'where':{'CmContactId':_0x71ff3d,'item':_0x5b7334}})[_0x1afa('0x19')](function(_0x595717){if(_0x595717)logger[_0x1afa('0x34')](_0x1afa('0x93'),_0x595717);else{db[_0x1afa('0x4b')][_0x1afa('0x42')]({'CmContactId':_0x71ff3d,'item':_0x5b7334,'ItemTypeId':_0x1e1a21,'OrderBy':_0x1ae6c0,'ItemClass':_0x1afa('0x94'),'description':_0x37a098});}});}function deleteCmHopperPhones(_0x5235fd){return new Promise(function(_0x2488ee){return db[_0x1afa('0x7f')][_0x1afa('0x2e')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5235fd}})['then'](function(_0x5a2dc0){db['CmHopperAdditionalPhone'][_0x1afa('0x25')]({'where':{'CmHopperId':{'$in':_['map'](_0x5a2dc0,'id')}}});})[_0x1afa('0x19')](function(){_0x2488ee(0x1);});});}function addCmHopperPhones(_0xd6e459){return new Promise(function(_0x10a508){return db[_0x1afa('0x7f')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xd6e459}})[_0x1afa('0x19')](function(_0x279ecf){var _0x1a3a7a=[];_[_0x1afa('0x73')](_0x279ecf,function(_0x2284e3){_0x1a3a7a['push'](createCmHopperPhone(_0xd6e459,_0x2284e3['id']));});Promise[_0x1afa('0x67')](_0x1a3a7a)[_0x1afa('0x19')](function(){_0x10a508(0x1);});});});}function createCmHopperPhone(_0x1bc3e5,_0x2a3f51){return new Promise(function(_0x2d1285){db[_0x1afa('0x4b')]['findAll']({'raw':!![],'attributes':[_0x1afa('0x95'),_0x1afa('0x8f')],'where':{'CmContactId':_0x1bc3e5,'ItemClass':_0x1afa('0x94')},'include':[{'model':db[_0x1afa('0x6c')],'attributes':[_0x1afa('0x8f')],'as':_0x1afa('0x6d')}],'order':[_0x1afa('0x8f'),db[_0x1afa('0x96')][_0x1afa('0x6e')](_0x1afa('0x97'))]})[_0x1afa('0x19')](function(_0x37def7){var _0x941adf=0x1;var _0x5d93dc=_[_0x1afa('0x73')](_0x37def7,function(_0x2badb0){_0x2badb0['CmHopperId']=_0x2a3f51;_0x2badb0[_0x1afa('0x7e')]=_0x2badb0[_0x1afa('0x95')];_0x2badb0[_0x1afa('0x8f')]=_0x941adf;delete _0x2badb0[_0x1afa('0x98')];_0x941adf=_0x941adf+0x1;return _0x2badb0;});return db['CmHopperAdditionalPhone'][_0x1afa('0x5d')](_0x5d93dc,{});})[_0x1afa('0x19')](function(){_0x2d1285(0x1);});});}function insertAdditionalPhones(_0x442883,_0x113fa1){return new Promise(function(_0x510e37){var _0x4260ad=[];for(var _0x52e3d8=0x0;_0x52e3d8<_0x113fa1[_0x1afa('0x2a')];_0x52e3d8++){var _0x176489=_0x113fa1[_0x52e3d8];_0x4260ad[_0x1afa('0x61')](parseContactItemType(_0x176489));}Promise['all'](_0x4260ad)[_0x1afa('0x19')](function(){var _0x4f9bc7={'id':_0x442883['id'],'items':_0x113fa1};return addAdditionalPhones(_0x4f9bc7)['then'](function(){return addCmHopperPhones(_0x442883['id']);});})[_0x1afa('0x19')](function(){_0x510e37(_0x442883);});});}function parseContactItemType(_0x30ab01){return new Promise(function(_0x1dfe8b){if(_0x30ab01[_0x1afa('0x36')](_0x1afa('0x92'))){_0x1dfe8b(_0x30ab01);}else{return db[_0x1afa('0x6c')][_0x1afa('0x26')]({'where':{'name':_0x30ab01['ItemType']}})[_0x1afa('0x19')](function(_0x300949){if(_[_0x1afa('0x58')](_0x300949))_0x30ab01['ItemTypeId']=null;else _0x30ab01['ItemTypeId']=_0x300949['id'];_0x1dfe8b(_0x30ab01);});}});}exports[_0x1afa('0x99')]=function(_0x4c5755,_0x58ca42){return db[_0x1afa('0x4b')][_0x1afa('0x2e')]({'raw':!![],'where':{'CmContactId':_0x4c5755[_0x1afa('0x27')]['id'],'ItemClass':_0x1afa('0x94')},'include':[{'model':db['ContactItemType'],'as':'ItemType'}],'order':[['OrderBy'],[db['sequelize']['literal'](_0x1afa('0x97'))]]})[_0x1afa('0x19')](function(_0x2ed809){return _0x2ed809;})[_0x1afa('0x19')](respondWithResult(_0x58ca42,null))[_0x1afa('0x24')](handleError(_0x58ca42,null));};exports['duplicateAdditionalPhones']=function(_0x4adcbe,_0x4602a0){return db[_0x1afa('0x4b')][_0x1afa('0x2e')]({'raw':!![],'where':{'CmContactId':_0x4adcbe[_0x1afa('0x38')][_0x1afa('0x9a')]}})[_0x1afa('0x19')](function(_0x1ae59a){var _0xc373c4=_[_0x1afa('0x73')](_0x1ae59a,function(_0x306f59){_0x306f59[_0x1afa('0x9b')]=_0x4adcbe[_0x1afa('0x38')][_0x1afa('0x9c')];return _0x306f59;});return db[_0x1afa('0x4b')]['bulkCreate'](_0xc373c4,{});})[_0x1afa('0x19')](function(){return addCmHopperPhones(_0x4adcbe[_0x1afa('0x38')]['toContactId']);})['then'](function(){return['ok'];})[_0x1afa('0x19')](respondWithResult(_0x4602a0,null))[_0x1afa('0x24')](handleError(_0x4602a0,null));};exports['rescheduleAdditionalPhones']=function(_0x4c048f,_0x2b33a6){var _0x5cdac7=[];_0x5cdac7[_0x1afa('0x61')](createCmHopperPhone(_0x4c048f[_0x1afa('0x38')]['id'],_0x4c048f['body'][_0x1afa('0x9d')]));Promise['all'](_0x5cdac7)['then'](function(){return[0x1];})[_0x1afa('0x19')](respondWithResult(_0x2b33a6,null));};exports[_0x1afa('0x9e')]=function(_0x5c73e6,_0x26191b){var _0x40b356={'raw':![],'where':{}};var _0x330fc9={};var _0x2ff20a={'count':0x0,'rows':[]};return db[_0x1afa('0x39')]['findOne']({'where':{'id':_0x5c73e6[_0x1afa('0x27')]['id']}})['then'](handleEntityNotFound(_0x26191b,null))[_0x1afa('0x19')](function(_0x1dd2f5){if(_0x1dd2f5){_0x330fc9['model']=_[_0x1afa('0x29')](db['CmHopper'][_0x1afa('0x83')]);_0x330fc9['query']=_[_0x1afa('0x29')](_0x5c73e6[_0x1afa('0x6a')]);_0x330fc9[_0x1afa('0x84')]=_['intersection'](_0x330fc9[_0x1afa('0x82')],_0x330fc9[_0x1afa('0x6a')]);_0x40b356[_0x1afa('0x87')]=_[_0x1afa('0x85')](_0x330fc9[_0x1afa('0x82')],qs['fields'](_0x5c73e6[_0x1afa('0x6a')][_0x1afa('0x86')]));_0x40b356[_0x1afa('0x87')]=_0x40b356[_0x1afa('0x87')][_0x1afa('0x2a')]?_0x40b356[_0x1afa('0x87')]:_0x330fc9[_0x1afa('0x82')];if(!_0x5c73e6[_0x1afa('0x6a')][_0x1afa('0x36')](_0x1afa('0x8b'))){_0x40b356[_0x1afa('0x15')]=qs['limit'](_0x5c73e6[_0x1afa('0x6a')]['limit']);_0x40b356[_0x1afa('0x13')]=qs['offset'](_0x5c73e6['query'][_0x1afa('0x13')]);}_0x40b356[_0x1afa('0x88')]=qs[_0x1afa('0x89')](_0x5c73e6[_0x1afa('0x6a')][_0x1afa('0x89')]);_0x40b356[_0x1afa('0x62')]=qs['filters'](_[_0x1afa('0x9f')](_0x5c73e6[_0x1afa('0x6a')],_0x330fc9[_0x1afa('0x84')]));_0x40b356['where'][_0x1afa('0xa0')]=_0x1dd2f5['id'];if(_0x5c73e6['query'][_0x1afa('0x8a')]){_0x40b356[_0x1afa('0x62')]=_[_0x1afa('0x37')](_0x40b356[_0x1afa('0x62')],{'$or':_['map'](_0x40b356[_0x1afa('0x87')],function(_0x3b75f5){var _0x57b75a={};_0x57b75a[_0x3b75f5]={'$like':'%'+_0x5c73e6['query'][_0x1afa('0x8a')]+'%'};return _0x57b75a;})});}_0x40b356=_[_0x1afa('0x37')]({},_0x40b356,_0x5c73e6['options']);return db[_0x1afa('0x7f')][_0x1afa('0x16')]({'where':_0x40b356[_0x1afa('0x62')]})['then'](function(_0x2824a9){_0x2ff20a[_0x1afa('0x16')]=_0x2824a9;if(_0x5c73e6[_0x1afa('0x6a')][_0x1afa('0xa1')]){_0x40b356[_0x1afa('0xa2')]=[{'all':!![]}];}return db['CmHopper'][_0x1afa('0x2e')](_0x40b356);})['then'](function(_0xe74715){_0x2ff20a[_0x1afa('0xa3')]=_0xe74715;return _0x2ff20a;});}})['then'](respondWithFilteredResult(_0x26191b,_0x40b356))[_0x1afa('0x24')](handleError(_0x26191b,null));};exports[_0x1afa('0xa4')]=function(_0x33eff7,_0x1c4cbb){var _0x45ae1e={'raw':!![],'where':{}};var _0x1121bc={};var _0x367214={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x33eff7[_0x1afa('0x27')]['id']}})[_0x1afa('0x19')](handleEntityNotFound(_0x1c4cbb,null))[_0x1afa('0x19')](function(_0x3e3255){if(_0x3e3255){_0x1121bc[_0x1afa('0x82')]=_[_0x1afa('0x29')](db[_0x1afa('0xa5')][_0x1afa('0x83')]);_0x1121bc[_0x1afa('0x6a')]=_[_0x1afa('0x29')](_0x33eff7[_0x1afa('0x6a')]);_0x1121bc[_0x1afa('0x84')]=_['intersection'](_0x1121bc[_0x1afa('0x82')],_0x1121bc[_0x1afa('0x6a')]);_0x45ae1e[_0x1afa('0x87')]=_['intersection'](_0x1121bc['model'],qs['fields'](_0x33eff7[_0x1afa('0x6a')][_0x1afa('0x86')]));_0x45ae1e[_0x1afa('0x87')]=_0x45ae1e[_0x1afa('0x87')][_0x1afa('0x2a')]?_0x45ae1e[_0x1afa('0x87')]:_0x1121bc[_0x1afa('0x82')];if(!_0x33eff7[_0x1afa('0x6a')][_0x1afa('0x36')](_0x1afa('0x8b'))){_0x45ae1e[_0x1afa('0x15')]=qs['limit'](_0x33eff7['query'][_0x1afa('0x15')]);_0x45ae1e[_0x1afa('0x13')]=qs[_0x1afa('0x13')](_0x33eff7[_0x1afa('0x6a')][_0x1afa('0x13')]);}_0x45ae1e[_0x1afa('0x88')]=qs[_0x1afa('0x89')](_0x33eff7['query'][_0x1afa('0x89')]);_0x45ae1e[_0x1afa('0x62')]=qs['filters'](_[_0x1afa('0x9f')](_0x33eff7[_0x1afa('0x6a')],_0x1121bc[_0x1afa('0x84')]));_0x45ae1e['where'][_0x1afa('0xa0')]=_0x3e3255['id'];if(_0x33eff7[_0x1afa('0x6a')][_0x1afa('0x8a')]){_0x45ae1e['where']=_[_0x1afa('0x37')](_0x45ae1e['where'],{'$or':_['map'](_0x45ae1e[_0x1afa('0x87')],function(_0xbb50eb){var _0x41e180={};_0x41e180[_0xbb50eb]={'$like':'%'+_0x33eff7['query'][_0x1afa('0x8a')]+'%'};return _0x41e180;})});}_0x45ae1e=_[_0x1afa('0x37')]({},_0x45ae1e,_0x33eff7[_0x1afa('0xa6')]);return db[_0x1afa('0xa5')][_0x1afa('0x16')]({'where':_0x45ae1e[_0x1afa('0x62')]})[_0x1afa('0x19')](function(_0x996968){_0x367214[_0x1afa('0x16')]=_0x996968;if(_0x33eff7['query'][_0x1afa('0xa1')]){_0x45ae1e[_0x1afa('0xa2')]=[{'all':!![]}];}return db[_0x1afa('0xa5')][_0x1afa('0x2e')](_0x45ae1e);})[_0x1afa('0x19')](function(_0x589d3c){_0x367214[_0x1afa('0xa3')]=_0x589d3c;return _0x367214;});}})['then'](respondWithFilteredResult(_0x1c4cbb,_0x45ae1e))[_0x1afa('0x24')](handleError(_0x1c4cbb,null));};exports[_0x1afa('0xa7')]=function(_0x1c3feb,_0xafba7e){var _0x536c88={'raw':!![],'where':{}};var _0x3ee1bd={};var _0x2a1c7f={'count':0x0,'rows':[]};return db[_0x1afa('0x39')][_0x1afa('0x81')]({'where':{'id':_0x1c3feb[_0x1afa('0x27')]['id']}})[_0x1afa('0x19')](handleEntityNotFound(_0xafba7e,null))[_0x1afa('0x19')](function(_0x2e0aa6){if(_0x2e0aa6){_0x3ee1bd[_0x1afa('0x82')]=_[_0x1afa('0x29')](db[_0x1afa('0x4c')]['rawAttributes']);_0x3ee1bd[_0x1afa('0x6a')]=_['keys'](_0x1c3feb[_0x1afa('0x6a')]);_0x3ee1bd[_0x1afa('0x84')]=_[_0x1afa('0x85')](_0x3ee1bd[_0x1afa('0x82')],_0x3ee1bd[_0x1afa('0x6a')]);_0x536c88[_0x1afa('0x87')]=_['intersection'](_0x3ee1bd[_0x1afa('0x82')],qs['fields'](_0x1c3feb[_0x1afa('0x6a')][_0x1afa('0x86')]));_0x536c88['attributes']=_0x536c88[_0x1afa('0x87')][_0x1afa('0x2a')]?_0x536c88['attributes']:_0x3ee1bd['model'];if(!_0x1c3feb['query']['hasOwnProperty'](_0x1afa('0x8b'))){_0x536c88[_0x1afa('0x15')]=qs[_0x1afa('0x15')](_0x1c3feb[_0x1afa('0x6a')]['limit']);_0x536c88[_0x1afa('0x13')]=qs[_0x1afa('0x13')](_0x1c3feb[_0x1afa('0x6a')][_0x1afa('0x13')]);}_0x536c88[_0x1afa('0x88')]=qs[_0x1afa('0x89')](_0x1c3feb['query'][_0x1afa('0x89')]);_0x536c88[_0x1afa('0x62')]=qs[_0x1afa('0x84')](_[_0x1afa('0x9f')](_0x1c3feb[_0x1afa('0x6a')],_0x3ee1bd[_0x1afa('0x84')]));_0x536c88[_0x1afa('0x62')][_0x1afa('0xa0')]=_0x2e0aa6['id'];if(_0x1c3feb[_0x1afa('0x6a')][_0x1afa('0x8a')]){_0x536c88[_0x1afa('0x62')]=_['merge'](_0x536c88[_0x1afa('0x62')],{'$or':_[_0x1afa('0x73')](_0x536c88[_0x1afa('0x87')],function(_0xb26adf){var _0x1f5419={};_0x1f5419[_0xb26adf]={'$like':'%'+_0x1c3feb[_0x1afa('0x6a')][_0x1afa('0x8a')]+'%'};return _0x1f5419;})});}_0x536c88=_[_0x1afa('0x37')]({},_0x536c88,_0x1c3feb[_0x1afa('0xa6')]);return db[_0x1afa('0x4c')]['count']({'where':_0x536c88[_0x1afa('0x62')]})[_0x1afa('0x19')](function(_0x1a7369){_0x2a1c7f[_0x1afa('0x16')]=_0x1a7369;if(_0x1c3feb[_0x1afa('0x6a')][_0x1afa('0xa1')]){_0x536c88[_0x1afa('0xa2')]=[{'all':!![]}];}return db[_0x1afa('0x4c')]['findAll'](_0x536c88);})[_0x1afa('0x19')](function(_0x195dee){_0x2a1c7f[_0x1afa('0xa3')]=_0x195dee;return _0x2a1c7f;});}})[_0x1afa('0x19')](respondWithFilteredResult(_0xafba7e,_0x536c88))[_0x1afa('0x24')](handleError(_0xafba7e,null));};exports[_0x1afa('0xa8')]=function(_0xc94192,_0x43a83e){var _0x427ab6={'raw':!![],'where':{}};var _0x30b309={};var _0x4121f1={'count':0x0,'rows':[]};return db[_0x1afa('0x39')][_0x1afa('0x81')]({'where':{'id':_0xc94192[_0x1afa('0x27')]['id']}})['then'](handleEntityNotFound(_0x43a83e,null))[_0x1afa('0x19')](function(_0x6b75f){if(_0x6b75f){_0x30b309[_0x1afa('0x82')]=_['keys'](db['JscriptySessionReport'][_0x1afa('0x83')]);_0x30b309[_0x1afa('0x6a')]=_[_0x1afa('0x29')](_0xc94192[_0x1afa('0x6a')]);_0x30b309[_0x1afa('0x84')]=_[_0x1afa('0x85')](_0x30b309[_0x1afa('0x82')],_0x30b309[_0x1afa('0x6a')]);_0x427ab6['attributes']=_[_0x1afa('0x85')](_0x30b309[_0x1afa('0x82')],qs[_0x1afa('0x86')](_0xc94192[_0x1afa('0x6a')][_0x1afa('0x86')]));_0x427ab6[_0x1afa('0x87')]=_0x427ab6[_0x1afa('0x87')][_0x1afa('0x2a')]?_0x427ab6['attributes']:_0x30b309[_0x1afa('0x82')];if(!_0xc94192[_0x1afa('0x6a')][_0x1afa('0x36')](_0x1afa('0x8b'))){_0x427ab6[_0x1afa('0x15')]=qs['limit'](_0xc94192['query'][_0x1afa('0x15')]);_0x427ab6[_0x1afa('0x13')]=qs[_0x1afa('0x13')](_0xc94192[_0x1afa('0x6a')]['offset']);}_0x427ab6['order']=qs[_0x1afa('0x89')](_0xc94192[_0x1afa('0x6a')]['sort']);_0x427ab6['where']=qs[_0x1afa('0x84')](_[_0x1afa('0x9f')](_0xc94192[_0x1afa('0x6a')],_0x30b309[_0x1afa('0x84')]));_0x427ab6['where'][_0x1afa('0xa0')]=_0x6b75f['id'];if(_0xc94192[_0x1afa('0x6a')][_0x1afa('0x8a')]){_0x427ab6[_0x1afa('0x62')]=_[_0x1afa('0x37')](_0x427ab6['where'],{'$or':_[_0x1afa('0x73')](_0x427ab6[_0x1afa('0x87')],function(_0x4fda35){var _0x2d23bf={};_0x2d23bf[_0x4fda35]={'$like':'%'+_0xc94192['query'][_0x1afa('0x8a')]+'%'};return _0x2d23bf;})});}_0x427ab6=_[_0x1afa('0x37')]({},_0x427ab6,_0xc94192[_0x1afa('0xa6')]);return db[_0x1afa('0x54')][_0x1afa('0x16')]({'where':_0x427ab6[_0x1afa('0x62')]})[_0x1afa('0x19')](function(_0x9a24fe){_0x4121f1[_0x1afa('0x16')]=_0x9a24fe;if(_0xc94192['query'][_0x1afa('0xa1')]){_0x427ab6[_0x1afa('0xa2')]=[{'all':!![]}];}return db[_0x1afa('0x54')][_0x1afa('0x2e')](_0x427ab6);})[_0x1afa('0x19')](function(_0x4614bb){_0x4121f1[_0x1afa('0xa3')]=_0x4614bb;return _0x4121f1;});}})[_0x1afa('0x19')](respondWithFilteredResult(_0x43a83e,_0x427ab6))[_0x1afa('0x24')](handleError(_0x43a83e,null));};exports[_0x1afa('0xa9')]=function(_0x1c57d5,_0xeb718a){try{if(!_0x1c57d5[_0x1afa('0x38')]['ListId']){throw new Error(_0x1afa('0xaa'));}if(!_0x1c57d5[_0x1afa('0x38')][_0x1afa('0xab')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x1c57d5['body'][_0x1afa('0xac')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x1c57d5['body'][_0x1afa('0xad')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x154a6e=_0x1c57d5['body'][_0x1afa('0xab')][_0x1afa('0xae')](',');var _0x42a084=_0x1c57d5[_0x1afa('0x38')]['binding_values'][_0x1afa('0xae')](',');if(!_0x154a6e[_0x1afa('0x2a')]||!_0x42a084[_0x1afa('0x2a')]||_0x154a6e[_0x1afa('0x2a')]!==_0x42a084[_0x1afa('0x2a')]){throw new Error(_0x1afa('0xaf'));}_0x1c57d5['body'][_0x1afa('0x86')]=_[_0x1afa('0xb0')](_0x154a6e,_0x42a084);if(!_0x1c57d5[_0x1afa('0x38')][_0x1afa('0x86')]['phone']){throw new Error(_0x1afa('0xb1'));}if(!_0x1c57d5['body'][_0x1afa('0x86')]['firstName']){throw new Error(_0x1afa('0xb2'));}var _0x439cfc=path['join'](config[_0x1afa('0xb3')],_0x1afa('0xb4'),_0x1c57d5['file'][_0x1afa('0xb5')]);fs['chmodSync'](_0x439cfc,parseInt('0777',0x8));var _0x1c0ee7=require(_0x1afa('0xb6'))[_0x1afa('0xb7')](path[_0x1afa('0x3e')](__dirname,'../../components/import/cm/csv'),[_0x439cfc,_0x1c57d5[_0x1afa('0x38')][_0x1afa('0xab')],_0x1c57d5[_0x1afa('0x38')][_0x1afa('0xac')],_0x1c57d5[_0x1afa('0x38')]['ListId'],_0x1c57d5['body'][_0x1afa('0xb8')],_0x1c57d5[_0x1afa('0x38')]['duplicates'],_0x1c57d5[_0x1afa('0x38')][_0x1afa('0xad')]]);return _0xeb718a[_0x1afa('0x11')](0xc8)['json']({'message':_0x1afa('0xb9'),'pid':_0x1c0ee7['pid']});}catch(_0x339da0){return _0xeb718a[_0x1afa('0x11')](0x1f4)['send'](_0x339da0);}};exports[_0x1afa('0xba')]=function(_0x5d8805,_0x2bc778){var _0x5ba2ea=fs[_0x1afa('0xbb')](_0x5d8805[_0x1afa('0xbc')]['path']);Papa['parse'](_0x5ba2ea,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x45bfc7){return _0x2bc778[_0x1afa('0x11')](0xc8)['json']({'file':_0x5d8805[_0x1afa('0xbc')],'fields':_0x45bfc7[_0x1afa('0xbd')][_0x1afa('0x86')]});}});};exports[_0x1afa('0xbe')]=function(_0x4ed04f,_0xae091){return db[_0x1afa('0xbf')][_0x1afa('0x2e')]({'raw':!![],'attributes':['id'],'where':{'role':_0x1afa('0xc0')}})[_0x1afa('0x19')](function(_0x4894dc){var _0x268d17=![];if(!_0x4ed04f[_0x1afa('0x38')]['ListId']){throw new Error(_0x1afa('0xaa'));}if(!_0x4ed04f[_0x1afa('0x38')][_0x1afa('0xc1')][_0x1afa('0x7e')]){throw new Error(_0x1afa('0xb1'));}if(!_0x4ed04f[_0x1afa('0x38')][_0x1afa('0xc1')][_0x1afa('0xc2')]){throw new Error(_0x1afa('0xb2'));}if(!_0x4ed04f['body'][_0x1afa('0xad')]){throw new Error(_0x1afa('0xc3'));}var _0x337129=require('child_process')[_0x1afa('0xb7')](path[_0x1afa('0x3e')](__dirname,_0x1afa('0xc4')),[_0x4ed04f[_0x1afa('0x27')]['id'],JSON[_0x1afa('0xc5')](_0x4ed04f[_0x1afa('0x38')]),JSON[_0x1afa('0xc5')](_0x4894dc)]);_0x337129['on']('message',function(){_0x268d17=!![];return _0xae091['status'](0xc8)[_0x1afa('0x12')]({'message':_0x1afa('0xc6'),'pid':_0x337129[_0x1afa('0xc7')]});});_0x337129['on']('exit',function(_0x2d05f0){if(_0x2d05f0&&!_0x268d17){return _0xae091[_0x1afa('0x11')](0x1f4)['json']({'message':_0x1afa('0xc8'),'pid':_0x337129['pid']});}});})[_0x1afa('0x24')](handleError(_0xae091,null));};exports[_0x1afa('0xc9')]=function(_0x228fe8,_0x19d07e){return db[_0x1afa('0xbf')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x1afa('0xc0')}})[_0x1afa('0x19')](function(_0x5aa681){var _0x20182e=![];if(!_0x228fe8['body'][_0x1afa('0x63')]){throw new Error(_0x1afa('0xaa'));}if(!_0x228fe8[_0x1afa('0x38')][_0x1afa('0xc1')]['phone']){throw new Error(_0x1afa('0xb1'));}if(!_0x228fe8[_0x1afa('0x38')]['binding'][_0x1afa('0xc2')]){throw new Error(_0x1afa('0xb2'));}if(!_0x228fe8[_0x1afa('0x38')][_0x1afa('0xad')]){throw new Error(_0x1afa('0xc3'));}var _0x42ce94=require(_0x1afa('0xb6'))['fork'](path[_0x1afa('0x3e')](__dirname,_0x1afa('0xca')),[_0x228fe8[_0x1afa('0x27')]['id'],JSON[_0x1afa('0xc5')](_0x228fe8[_0x1afa('0x38')]),JSON[_0x1afa('0xc5')](_0x5aa681)]);_0x42ce94['on'](_0x1afa('0xcb'),function(){_0x20182e=!![];return _0x19d07e[_0x1afa('0x11')](0xc8)['json']({'message':_0x1afa('0xc6'),'pid':_0x42ce94['pid']});});_0x42ce94['on'](_0x1afa('0xcc'),function(_0x5cf31c){if(_0x5cf31c&&!_0x20182e){return _0x19d07e[_0x1afa('0x11')](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x42ce94['pid']});}});})[_0x1afa('0x24')](handleError(_0x19d07e,null));};exports[_0x1afa('0xcd')]=function(_0x224a14,_0x2bd2ab){var _0x287d4c=[_0x1afa('0xce'),'chat',_0x1afa('0xcf'),_0x1afa('0xd0'),_0x1afa('0xd1'),_0x1afa('0xd2'),_0x1afa('0xd3')];var _0x217732={'offset':0x0,'order':qs['sort'](_0x1afa('0xd4'))},_0x4ce0d3={'count':0x0,'rows':[]};Promise[_0x1afa('0xd5')]()[_0x1afa('0x19')](function(){if(_0x224a14[_0x1afa('0x6a')][_0x1afa('0xd6')]){if(!_['includes'](_0x287d4c,_0x224a14['query'][_0x1afa('0xd6')][_0x1afa('0xd7')]())){throw new Error('Invalid\x20channel');}_0x287d4c=[_0x224a14['query'][_0x1afa('0xd6')][_0x1afa('0xd7')]()];}if(_0x224a14[_0x1afa('0x6a')][_0x1afa('0xd8')]){try{var _0x2cb428=JSON[_0x1afa('0xd9')](_0x224a14[_0x1afa('0x6a')]['range']);if(!moment(_0x2cb428['from'])['isValid']()){throw new Error(_0x1afa('0xda'));}if(!moment(_0x2cb428['to'])[_0x1afa('0xdb')]()){throw new Error(_0x1afa('0xdc'));}}catch(_0x4cd985){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x224a14[_0x1afa('0x6a')][_0x1afa('0x36')]('nolimit')){_0x217732[_0x1afa('0x15')]=qs[_0x1afa('0x15')](_0x224a14['query'][_0x1afa('0x15')]||0xa);_0x217732[_0x1afa('0x13')]=qs['offset'](_0x224a14['query'][_0x1afa('0x13')]);}var _0x49466c=_0x287d4c[_0x1afa('0x73')](function(_0xdcfeed){if(_0xdcfeed===_0x1afa('0xd3')){var _0x46ae77={'attributes':['id',_0x1afa('0xdd'),'type',_0x1afa('0xde'),_0x1afa('0xdf'),_0x1afa('0xe0'),_0x1afa('0xe1'),'endtime',_0x1afa('0xe2'),_0x1afa('0xe3'),_0x1afa('0xe4'),_0x1afa('0xe5'),_0x1afa('0xe6'),_0x1afa('0xe7'),_0x1afa('0xe8')],'where':{'ContactId':_0x224a14[_0x1afa('0x27')]['id']},'include':[{'model':db[_0x1afa('0xbf')],'as':_0x1afa('0xbf'),'attributes':['id',_0x1afa('0x1e'),_0x1afa('0xe9'),'alias']}],'order':[[_0x1afa('0xe4'),_0x1afa('0xea')]]};if(_0x224a14[_0x1afa('0x6a')][_0x1afa('0xd8')]){_0x46ae77[_0x1afa('0x62')]['createdAt']={'$gte':_0x2cb428[_0x1afa('0x3a')],'$lte':_0x2cb428['to']};}return db[_0x1afa('0x4e')][_0x1afa('0xeb')](_0x46ae77)[_0x1afa('0x19')](function(_0x4f96ce){_0x4ce0d3[_0x1afa('0x16')]+=_0x4f96ce['count'];return _[_0x1afa('0x73')](_0x4f96ce[_0x1afa('0xa3')],function(_0x45f340){var _0x20f149=_0x45f340[_0x1afa('0x3b')]({'plain':!![]});_0x20f149[_0x1afa('0xd6')]=_0xdcfeed;if(_0x20f149['User']){_0x20f149[_0x1afa('0xbf')]={'id':_0x20f149[_0x1afa('0xbf')]['id'],'name':_0x20f149[_0x1afa('0xbf')][_0x1afa('0x1e')],'fullname':_0x20f149[_0x1afa('0xbf')][_0x1afa('0xe9')],'alias':_0x20f149[_0x1afa('0xbf')]['alias']};}return _0x20f149;});});}else{var _0x207494=_[_0x1afa('0xec')](_0xdcfeed)+(_0xdcfeed===_0x1afa('0xed')?_0x1afa('0xee'):'Account');var _0x4c0a7c={'attributes':['id',_0x1afa('0xef'),_0x1afa('0xf0'),'createdAt',_0x1afa('0xe3'),'disposition',_0x1afa('0xf1'),_0x1afa('0xf2'),_0x1afa('0xe8'),_0x207494+'Id'],'where':{'ContactId':_0x224a14[_0x1afa('0x27')]['id']},'include':[{'model':db[_0x207494],'as':_0x1afa('0xf3'),'attributes':['id',_0x1afa('0x1e'),_0x1afa('0xf4')]},{'model':db[_0x1afa('0xbf')],'as':_0x1afa('0xf5'),'attributes':['id',_0x1afa('0x1e'),'fullname']},{'model':db[_0x1afa('0x68')],'as':'Tags','attributes':['id',_0x1afa('0x1e'),_0x1afa('0xf6')],'through':{'attributes':[]}}],'order':[[_0x1afa('0xe4'),_0x1afa('0xea')]]};if(_0x224a14[_0x1afa('0x6a')][_0x1afa('0xd8')]){_0x4c0a7c[_0x1afa('0x62')][_0x1afa('0xe4')]={'$gte':_0x2cb428[_0x1afa('0x3a')],'$lte':_0x2cb428['to']};}switch(_0xdcfeed){case _0x1afa('0xed'):_0x4c0a7c['attributes'][_0x1afa('0x61')](_0x1afa('0xf7'),'customerIp',_0x1afa('0xf8'),_0x1afa('0xf9'),'osName',_0x1afa('0xfa'),_0x1afa('0xfb'),_0x1afa('0xfc'),_0x1afa('0xfd'));break;case _0x1afa('0xce'):_0x4c0a7c[_0x1afa('0x87')][_0x1afa('0x61')](_0x1afa('0xfe'),'substatus');break;case _0x1afa('0xd0'):_0x4c0a7c['attributes'][_0x1afa('0x61')](_0x1afa('0xff'),'threadId');break;}return db[_[_0x1afa('0xec')](_0xdcfeed)+_0x1afa('0x100')][_0x1afa('0xeb')](_0x4c0a7c)[_0x1afa('0x19')](function(_0xe51132){_0x4ce0d3[_0x1afa('0x16')]+=_0xe51132[_0x1afa('0x16')];return _[_0x1afa('0x73')](_0xe51132[_0x1afa('0xa3')],function(_0x3ced8b){var _0x53dfb4=_0x3ced8b['get']({'plain':!![]});_0x53dfb4[_0x1afa('0xd6')]=_0xdcfeed;if(_0x53dfb4[_0x1afa('0xf5')]){_0x53dfb4['Owner']={'id':_0x53dfb4['Owner']['id'],'name':_0x53dfb4['Owner'][_0x1afa('0x1e')],'fullname':_0x53dfb4[_0x1afa('0xf5')]['fullname']};}return _0x53dfb4;});});}});return Promise['all'](_0x49466c);})[_0x1afa('0x19')](function(_0x317528){return _(_0x317528)[_0x1afa('0x101')]()[_0x1afa('0x102')](_0x1afa('0xe4'))[_0x1afa('0x103')]()[_0x1afa('0x104')]();})[_0x1afa('0x19')](function(_0x2208ae){_0x4ce0d3['rows']=_0x217732[_0x1afa('0x15')]?_0x2208ae[_0x1afa('0x105')](_0x217732[_0x1afa('0x13')],_0x217732[_0x1afa('0x13')]+_0x217732[_0x1afa('0x15')]):_0x2208ae;return _0x4ce0d3;})['then'](respondWithFilteredResult(_0x2bd2ab,_0x217732))[_0x1afa('0x24')](handleError(_0x2bd2ab,null));}; \ No newline at end of file +var _0x54e9=['SmsInteraction','SmsMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','dialTimezone','isNil','utcOffset','timezones','additionalPhones','bulkCreate','each','duplicates','$or','push','ListId','findOrCreate','spread','show','Tag','color','ContactItemType','ItemType','sequelize','Phones.OrderBy','where','$and','omit','format','cf_%d','pickBy','map','cm_contacts','id\x20=\x20?','toParam','values','phone','getTags','findOne','rawAttributes','filters','model','attributes','intersection','fields','order','filter','options','nolimit','setTags','ids','all','OrderBy','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','literal','`ItemType`.OrderBy','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','sort','pick','ContactId','includeAll','rows','getHopperHistories','CmHopperHistory','include','getHopperFinals','No\x20ListId\x20specified','binding_keys','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','parse','meta','User','agent','binding','firstName','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','child_process','../../components/import/cm/csvUpdates','getJourney','chat','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','endtime','note','createdAt','userDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','Website','Account','closed','closedAt','disposition','secondDisposition','key','Owner','Tags','DESC','browserName','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','mail','substatus','externalUrl','startCase','flatten','sortBy','reverse','value','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../config/logger','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','destroy','then','end','error','stack','name','send','index','describe','findAll','user','catch','CmContact','find','params','keys','length','startsWith','cf_','columnName','displayName','query','CmCustomField','alias','custom','type','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','hasOwnProperty','merge','body','get','mergeWith','isArray','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage'];(function(_0x1ff2ec,_0x386e86){var _0x405683=function(_0x22f921){while(--_0x22f921){_0x1ff2ec['push'](_0x1ff2ec['shift']());}};_0x405683(++_0x386e86);}(_0x54e9,0x1b1));var _0x954e=function(_0x37bcd4,_0x2dafb5){_0x37bcd4=_0x37bcd4-0x0;var _0x5e2bd4=_0x54e9[_0x37bcd4];return _0x5e2bd4;};'use strict';var moment=require(_0x954e('0x0'));var BPromise=require(_0x954e('0x1'));var util=require(_0x954e('0x2'));var path=require(_0x954e('0x3'));var fs=require('fs');var _=require(_0x954e('0x4'));var squel=require(_0x954e('0x5'));var Papa=require(_0x954e('0x6'));var Redis=require(_0x954e('0x7'));var contacts=require(_0x954e('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0x954e('0x9'))('api');var config=require('../../config/environment');var shared=require('../../config/environment/shared');var db=require(_0x954e('0xa'))['db'];config[_0x954e('0xb')]=_['defaults'](config[_0x954e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x954e('0xc'))(new Redis(config[_0x954e('0xb')]));require(_0x954e('0xd'))[_0x954e('0xe')](socket);function respondWithResult(_0x47419e,_0x453cd9){_0x453cd9=_0x453cd9||0xc8;return function(_0x330e96){if(_0x330e96){return _0x47419e[_0x954e('0xf')](_0x453cd9)[_0x954e('0x10')](_0x330e96);}};}function respondWithFilteredResult(_0x195b29,_0x16f95b){return function(_0x759000){if(_0x759000){var _0x1b8ac0=typeof _0x16f95b[_0x954e('0x11')]===_0x954e('0x12')&&typeof _0x16f95b[_0x954e('0x13')]==='undefined';var _0x311813=_0x759000[_0x954e('0x14')];var _0x246dfc=_0x1b8ac0?0x0:_0x16f95b['offset'];var _0xa3c373=_0x1b8ac0?_0x759000[_0x954e('0x14')]:_0x16f95b['offset']+_0x16f95b[_0x954e('0x13')];var _0x26a73c;if(_0xa3c373>=_0x311813){_0xa3c373=_0x311813;_0x26a73c=0xc8;}else{_0x26a73c=0xce;}_0x195b29['status'](_0x26a73c);return _0x195b29['set']('Content-Range',_0x246dfc+'-'+_0xa3c373+'/'+_0x311813)[_0x954e('0x10')](_0x759000);}return null;};}function saveUpdates(_0x3ab844){return function(_0x272c1c){if(_0x272c1c){return _0x272c1c['update'](_0x3ab844)['then'](function(_0x49dae2){return _0x49dae2;});}return null;};}function removeEntity(_0x1deafe){return function(_0x386784){if(_0x386784){return _0x386784[_0x954e('0x15')]()[_0x954e('0x16')](function(){_0x1deafe[_0x954e('0xf')](0xcc)[_0x954e('0x17')]();});}};}function handleEntityNotFound(_0x25c6cd){return function(_0x5bcb63){if(!_0x5bcb63){_0x25c6cd['sendStatus'](0x194);}return _0x5bcb63;};}function handleError(_0x4fdeab,_0x2aa439){_0x2aa439=_0x2aa439||0x1f4;return function(_0x8f8b2e){logger[_0x954e('0x18')](_0x8f8b2e[_0x954e('0x19')]);if(_0x8f8b2e[_0x954e('0x1a')]){delete _0x8f8b2e[_0x954e('0x1a')];}_0x4fdeab[_0x954e('0xf')](_0x2aa439)[_0x954e('0x1b')](_0x8f8b2e);};}exports[_0x954e('0x1c')]=function(_0x2fd961,_0x2de523){var _0x120d75={};return contacts[_0x954e('0x1d')]()['then'](function(_0x2e0de8){_0x120d75=qs['getOptions'](_0x2e0de8,_0x2fd961);return contacts[_0x954e('0x1e')](_0x2fd961['query'],_0x2fd961[_0x954e('0x1f')],_0x120d75,_0x2e0de8);})[_0x954e('0x16')](respondWithFilteredResult(_0x2de523,_0x120d75))[_0x954e('0x20')](handleError(_0x2de523,null));};exports['destroy']=function(_0x353d90,_0x193fb5){return db[_0x954e('0x21')][_0x954e('0x22')]({'where':{'id':_0x353d90[_0x954e('0x23')]['id']}})[_0x954e('0x16')](handleEntityNotFound(_0x193fb5,null))['then'](removeEntity(_0x193fb5,null))[_0x954e('0x20')](handleError(_0x193fb5,null));};exports['describe']=function(_0x528329,_0x454022){return db['CmContact'][_0x954e('0x1d')]()[_0x954e('0x16')](function(_0x102158){delete _0x102158['tags'];for(var _0x2b9db2=0x0;_0x2b9db20x0){return new Promise(function(_0x506820){var _0x33d3c9=[];for(var _0x3d248e=0x0;_0x3d248e<_0x3ed25b[_0x954e('0x25')];_0x3d248e++){_0x33d3c9[_0x954e('0x5d')](insertAdditionalPhones(_0x3ed25b[_0x3d248e]['contact'],_0x3ed25b[_0x3d248e]['additionalPhones']));}Promise['all'](_0x33d3c9)[_0x954e('0x16')](function(){_0x506820(0x1);});})[_0x954e('0x16')](function(){return{'success':_0x2c154c,'failure':_0x501933,'duplicates':_0x5e983e};});}else{return{'success':_0x2c154c,'failure':_0x501933,'duplicates':_0x5e983e};}}})[_0x954e('0x16')](respondWithResult(_0x2aac91,0xc9))[_0x954e('0x20')](handleError(_0x2aac91,null));};exports[_0x954e('0x61')]=function(_0x40cfe5,_0x3c9126){var _0x2e15ca;return db['CmContact'][_0x954e('0x1d')]()[_0x954e('0x16')](function(_0x163679){return db[_0x954e('0x21')][_0x954e('0x22')]({'where':{'id':_0x40cfe5[_0x954e('0x23')]['id']},'include':[{'model':db[_0x954e('0x62')],'as':'Tags','attributes':['id','name',_0x954e('0x63')],'required':_0x40cfe5[_0x954e('0x2a')]['tag']?!![]:![]},{'model':db[_0x954e('0x49')],'as':'Phones','where':{'CmContactId':_0x40cfe5[_0x954e('0x23')]['id']},'required':![],'include':[{'model':db[_0x954e('0x64')],'as':_0x954e('0x65')}]}],'order':[db[_0x954e('0x66')]['literal'](_0x954e('0x67'))],'attributes':_['keys'](_0x163679)});})[_0x954e('0x16')](function(_0x178559){if(!_['isNil'](_0x178559)){_0x2e15ca=_0x178559[_0x954e('0x33')]({'plain':!![]});var _0x3e16f2={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x178559&&_0x178559[_0x954e('0x5e')]){if(_0x178559[_0x954e('0x5e')]){_0x3e16f2[_0x954e('0x68')][_0x954e('0x69')][_0x954e('0x5d')]({'ListId':{'$ne':_0x178559['ListId']}});}}return db[_0x954e('0x2b')]['findAll'](_0x3e16f2);}})[_0x954e('0x16')](function(_0x22eebf){if(!_[_0x954e('0x55')](_0x22eebf)){return _[_0x954e('0x6a')](_0x2e15ca,_['map'](_0x22eebf,function(_0x3684c9){return util[_0x954e('0x6b')](_0x954e('0x6c'),_0x3684c9['id']);}));}})['then'](handleEntityNotFound(_0x3c9126,null))[_0x954e('0x16')](respondWithResult(_0x3c9126,null))['catch'](handleError(_0x3c9126,null));};exports['update']=function(_0x463576,_0x18fe5a){var _0x33feba;if(_0x463576[_0x954e('0x32')]['id']){delete _0x463576['body']['id'];}if(!_[_0x954e('0x55')](_0x463576['body']['dialTimezone'])){var _0x27bd43=_0x463576[_0x954e('0x32')][_0x954e('0x54')];if(!_[_0x954e('0x55')](shared['timezones'][_0x27bd43]))_0x463576[_0x954e('0x32')][_0x954e('0x56')]=shared['timezones'][_0x27bd43][_0x954e('0x56')];}return db[_0x954e('0x21')][_0x954e('0x22')]({'where':{'id':_0x463576[_0x954e('0x23')]['id']}})[_0x954e('0x16')](handleEntityNotFound(_0x18fe5a,null))[_0x954e('0x16')](saveUpdates(_0x463576[_0x954e('0x32')],null))[_0x954e('0x16')](function(_0x157c15){_0x33feba=_0x157c15;var _0x23eacf={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x157c15&&_0x157c15[_0x954e('0x5e')]){if(_0x157c15['ListId']){_0x23eacf[_0x954e('0x68')][_0x954e('0x69')][_0x954e('0x5d')]({'ListId':{'$ne':_0x157c15['ListId']}});}}return db['CmCustomField'][_0x954e('0x1e')](_0x23eacf);})[_0x954e('0x16')](function(_0x2a2504){if(_0x2a2504){return _['omit'](_[_0x954e('0x6d')](_0x463576['body'],function(_0x31978d,_0x3a0a38){return _['startsWith'](_0x3a0a38,_0x954e('0x27'));}),_[_0x954e('0x6e')](_0x2a2504,function(_0x5abe51){return util['format']('cf_%d',_0x5abe51['id']);}));}})[_0x954e('0x16')](function(_0x58926e){if(_0x58926e&&!_['isEmpty'](_0x58926e)){var _0x383f58=squel[_0x954e('0x40')]()['table'](_0x954e('0x6f'))['setFields'](_0x58926e)[_0x954e('0x68')](_0x954e('0x70'),_0x463576['params']['id'])[_0x954e('0x71')]();return db['sequelize'][_0x954e('0x2a')](_0x383f58['text'],{'replacements':_0x383f58[_0x954e('0x72')]});}})['then'](function(){if(_0x463576['body'][_0x954e('0x73')]&&_0x33feba){return db['CmHopper'][_0x954e('0x40')]({'phone':_0x463576['body']['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x33feba['id']}});}})[_0x954e('0x16')](function(){return _0x33feba;})[_0x954e('0x16')](respondWithResult(_0x18fe5a,null))['catch'](handleError(_0x18fe5a,null));};exports[_0x954e('0x74')]=function(_0x43d163,_0x18cd68){var _0x28bcce={};var _0x3c49ee={};var _0x63c640;var _0x5e5178;return db[_0x954e('0x21')][_0x954e('0x75')]({'where':{'id':_0x43d163[_0x954e('0x23')]['id']}})[_0x954e('0x16')](handleEntityNotFound(_0x18cd68,null))[_0x954e('0x16')](function(_0x558138){if(_0x558138){_0x63c640=_0x558138;_0x3c49ee['model']=_[_0x954e('0x24')](db[_0x954e('0x62')][_0x954e('0x76')]);_0x3c49ee[_0x954e('0x2a')]=_[_0x954e('0x24')](_0x43d163['query']);_0x3c49ee[_0x954e('0x77')]=_['intersection'](_0x3c49ee[_0x954e('0x78')],_0x3c49ee[_0x954e('0x2a')]);_0x28bcce[_0x954e('0x79')]=_[_0x954e('0x7a')](_0x3c49ee[_0x954e('0x78')],qs[_0x954e('0x7b')](_0x43d163[_0x954e('0x2a')]['fields']));_0x28bcce['attributes']=_0x28bcce['attributes']['length']?_0x28bcce[_0x954e('0x79')]:_0x3c49ee[_0x954e('0x78')];_0x28bcce[_0x954e('0x7c')]=qs['sort'](_0x43d163[_0x954e('0x2a')]['sort']);_0x28bcce[_0x954e('0x68')]=qs['filters'](_['pick'](_0x43d163[_0x954e('0x2a')],_0x3c49ee['filters']));if(_0x43d163[_0x954e('0x2a')]['filter']){_0x28bcce[_0x954e('0x68')]=_['merge'](_0x28bcce[_0x954e('0x68')],{'$or':_['map'](_0x28bcce[_0x954e('0x79')],function(_0x319d2a){var _0x45ca35={};_0x45ca35[_0x319d2a]={'$like':'%'+_0x43d163[_0x954e('0x2a')][_0x954e('0x7d')]+'%'};return _0x45ca35;})});}_0x28bcce=_['merge']({},_0x28bcce,_0x43d163[_0x954e('0x7e')]);return _0x63c640['getTags'](_0x28bcce);}})[_0x954e('0x16')](function(_0x43e861){if(_0x43e861){_0x5e5178=_0x43e861[_0x954e('0x25')];if(!_0x43d163[_0x954e('0x2a')][_0x954e('0x30')](_0x954e('0x7f'))){_0x28bcce[_0x954e('0x13')]=qs[_0x954e('0x13')](_0x43d163['query']['limit']);_0x28bcce[_0x954e('0x11')]=qs[_0x954e('0x11')](_0x43d163[_0x954e('0x2a')][_0x954e('0x11')]);}return _0x63c640[_0x954e('0x74')](_0x28bcce);}})[_0x954e('0x16')](function(_0x174077){if(_0x174077){return _0x174077?{'count':_0x5e5178,'rows':_0x174077}:null;}})['then'](respondWithResult(_0x18cd68,null))['catch'](handleError(_0x18cd68,null));};exports[_0x954e('0x80')]=function(_0x4a8c00,_0xcd6224){if(_0x4a8c00[_0x954e('0x32')]['id']){delete _0x4a8c00[_0x954e('0x32')]['id'];}return db[_0x954e('0x21')]['findOne']({'where':{'id':_0x4a8c00[_0x954e('0x23')]['id']}})['then'](handleEntityNotFound(_0xcd6224,null))[_0x954e('0x16')](function(_0x4cb6a8){if(_0x4cb6a8){return _0x4cb6a8[_0x954e('0x80')](_0x4a8c00['body'][_0x954e('0x81')]||[]);}return null;})['then'](respondWithResult(_0xcd6224,null))[_0x954e('0x20')](handleError(_0xcd6224,null));};exports['setAdditionalPhones']=function(_0x69b4bf,_0x1bf9f3){var _0x46d8ca=[];_0x46d8ca[_0x954e('0x5d')](addAdditionalPhones(_0x69b4bf[_0x954e('0x32')]));Promise[_0x954e('0x82')](_0x46d8ca)[_0x954e('0x16')](function(){_0x46d8ca=[];_0x46d8ca[_0x954e('0x5d')](deleteCmHopperPhones(_0x69b4bf[_0x954e('0x32')]['id']));_0x46d8ca[_0x954e('0x5d')](addCmHopperPhones(_0x69b4bf['body']['id']));Promise[_0x954e('0x82')](_0x46d8ca)['then'](function(){return[0x1];})[_0x954e('0x16')](respondWithResult(_0x1bf9f3,null));});};function addAdditionalPhones(_0x61fcfe){var _0x2c9dba;return new Promise(function(_0x38dab4){return db[_0x954e('0x49')][_0x954e('0x15')]({'where':{'CmContactId':_0x61fcfe['id']}})[_0x954e('0x16')](function(){db[_0x954e('0x64')]['findAll']({'raw':!![],'attributes':['id',_0x954e('0x83')]})[_0x954e('0x16')](function(_0x2e941e){var _0x26ef93=[];for(var _0x41599b=0x0;_0x41599b<_0x61fcfe['items'][_0x954e('0x25')];_0x41599b++){var _0x998c63=_0x61fcfe[_0x954e('0x84')]?_[_0x954e('0x55')](_0x61fcfe['item_types'][_0x41599b])?'':_0x61fcfe[_0x954e('0x84')][_0x41599b]:_0x61fcfe[_0x954e('0x85')][_0x41599b][_0x954e('0x86')]?_0x61fcfe[_0x954e('0x85')][_0x41599b]['ItemTypeId']:'';var _0x3c103b=_[_0x954e('0x55')](_0x61fcfe['items'][_0x41599b][_0x954e('0x87')])?'':_0x61fcfe[_0x954e('0x85')][_0x41599b][_0x954e('0x87')];var _0x5135ee=_0x998c63+':'+_0x61fcfe[_0x954e('0x85')][_0x41599b][_0x954e('0x73')]+'§'+_0x3c103b;if(_[_0x954e('0x55')](_0x2c9dba))_0x2c9dba=_0x5135ee;else _0x2c9dba+=';'+_0x5135ee;var _0x4bcbe8=null;var _0x304997=null;if(_0x61fcfe['item_types']){if(!_[_0x954e('0x55')](_0x61fcfe['item_types'][_0x41599b])){_0x304997=_[_0x954e('0x22')](_0x2e941e,function(_0x22871f){return _0x22871f['id']===_0x61fcfe['item_types'][_0x41599b];});if(!_[_0x954e('0x55')](_0x304997)){_0x4bcbe8=_0x304997[_0x954e('0x83')];}}}else{if(!_['isNil'](_0x61fcfe[_0x954e('0x85')][_0x41599b])){_0x304997=_['find'](_0x2e941e,function(_0x46aa9e){return _0x46aa9e['id']===_0x61fcfe['items'][_0x41599b][_0x954e('0x86')];});if(!_[_0x954e('0x55')](_0x304997)){_0x4bcbe8=_0x41599b;}}}if(_[_0x954e('0x55')](_0x4bcbe8)){_0x4bcbe8=0x64;}_0x26ef93[_0x954e('0x5d')](addAdditionalPhone(_0x61fcfe['id'],_0x61fcfe[_0x954e('0x85')][_0x41599b][_0x954e('0x73')],_0x61fcfe['item_types']?_[_0x954e('0x55')](_0x61fcfe[_0x954e('0x84')][_0x41599b])?null:_0x61fcfe[_0x954e('0x84')][_0x41599b]:_0x61fcfe[_0x954e('0x85')][_0x41599b][_0x954e('0x86')]?_0x61fcfe[_0x954e('0x85')][_0x41599b][_0x954e('0x86')]:null,_0x4bcbe8,_0x3c103b));}Promise[_0x954e('0x82')](_0x26ef93)['then'](function(){db[_0x954e('0x21')][_0x954e('0x40')]({'AdditionalPhones':_0x2c9dba},{'where':{'id':_0x61fcfe['id']}})[_0x954e('0x16')](function(){_0x38dab4(0x1);});});});});});}function addAdditionalPhone(_0x3ce0cf,_0x47bb14,_0x442e52,_0x4f812c,_0x531f31){return db[_0x954e('0x49')][_0x954e('0x22')]({'where':{'CmContactId':_0x3ce0cf,'item':_0x47bb14}})[_0x954e('0x16')](function(_0x1568d1){if(_0x1568d1)logger[_0x954e('0x38')](_0x954e('0x88'),_0x1568d1);else{db['CmContactHasItem'][_0x954e('0x3f')]({'CmContactId':_0x3ce0cf,'item':_0x47bb14,'ItemTypeId':_0x442e52,'OrderBy':_0x4f812c,'ItemClass':_0x954e('0x89'),'description':_0x531f31});}});}function deleteCmHopperPhones(_0x23869f){return new Promise(function(_0x1f66f4){return db[_0x954e('0x3b')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x23869f}})[_0x954e('0x16')](function(_0x4f81f1){db[_0x954e('0x8a')]['destroy']({'where':{'CmHopperId':{'$in':_['map'](_0x4f81f1,'id')}}});})['then'](function(){_0x1f66f4(0x1);});});}function addCmHopperPhones(_0x4094a7){return new Promise(function(_0x1d0eec){return db['CmHopper'][_0x954e('0x1e')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4094a7}})[_0x954e('0x16')](function(_0x44d9da){var _0x56672b=[];_[_0x954e('0x6e')](_0x44d9da,function(_0x403852){_0x56672b[_0x954e('0x5d')](createCmHopperPhone(_0x4094a7,_0x403852['id']));});Promise[_0x954e('0x82')](_0x56672b)[_0x954e('0x16')](function(){_0x1d0eec(0x1);});});});}function createCmHopperPhone(_0x44356e,_0x4f9c5e){return new Promise(function(_0x4b7234){db['CmContactHasItem'][_0x954e('0x1e')]({'raw':!![],'attributes':[_0x954e('0x8b'),'OrderBy'],'where':{'CmContactId':_0x44356e,'ItemClass':_0x954e('0x89')},'include':[{'model':db['ContactItemType'],'attributes':[_0x954e('0x83')],'as':_0x954e('0x65')}],'order':[_0x954e('0x83'),db[_0x954e('0x66')][_0x954e('0x8c')](_0x954e('0x8d'))]})[_0x954e('0x16')](function(_0x2f7379){var _0x5b5e3c=0x1;var _0x22c7fe=_['map'](_0x2f7379,function(_0x43f729){_0x43f729['CmHopperId']=_0x4f9c5e;_0x43f729[_0x954e('0x73')]=_0x43f729[_0x954e('0x8b')];_0x43f729[_0x954e('0x83')]=_0x5b5e3c;delete _0x43f729[_0x954e('0x8e')];_0x5b5e3c=_0x5b5e3c+0x1;return _0x43f729;});return db[_0x954e('0x8a')]['bulkCreate'](_0x22c7fe,{});})[_0x954e('0x16')](function(){_0x4b7234(0x1);});});}function insertAdditionalPhones(_0x15ff5e,_0x4c3cc7){return new Promise(function(_0x43d615){var _0x18289a=[];for(var _0x123e1d=0x0;_0x123e1d<_0x4c3cc7[_0x954e('0x25')];_0x123e1d++){var _0xd3320e=_0x4c3cc7[_0x123e1d];_0x18289a[_0x954e('0x5d')](parseContactItemType(_0xd3320e));}Promise['all'](_0x18289a)['then'](function(){var _0x5553aa={'id':_0x15ff5e['id'],'items':_0x4c3cc7};return addAdditionalPhones(_0x5553aa)[_0x954e('0x16')](function(){return addCmHopperPhones(_0x15ff5e['id']);});})[_0x954e('0x16')](function(){_0x43d615(_0x15ff5e);});});}function parseContactItemType(_0x566277){return new Promise(function(_0x3a9ae7){if(_0x566277[_0x954e('0x30')](_0x954e('0x86'))){_0x3a9ae7(_0x566277);}else{return db[_0x954e('0x64')]['find']({'where':{'name':_0x566277[_0x954e('0x65')]}})[_0x954e('0x16')](function(_0x417c03){if(_[_0x954e('0x55')](_0x417c03))_0x566277['ItemTypeId']=null;else _0x566277[_0x954e('0x86')]=_0x417c03['id'];_0x3a9ae7(_0x566277);});}});}exports[_0x954e('0x8f')]=function(_0x457d5c,_0x5e15a6){return db[_0x954e('0x49')][_0x954e('0x1e')]({'raw':!![],'where':{'CmContactId':_0x457d5c['params']['id'],'ItemClass':_0x954e('0x89')},'include':[{'model':db[_0x954e('0x64')],'as':_0x954e('0x65')}],'order':[['OrderBy'],[db['sequelize']['literal'](_0x954e('0x8d'))]]})['then'](function(_0x4133c9){return _0x4133c9;})['then'](respondWithResult(_0x5e15a6,null))['catch'](handleError(_0x5e15a6,null));};exports[_0x954e('0x90')]=function(_0x49735a,_0x2e4619){return db[_0x954e('0x49')][_0x954e('0x1e')]({'raw':!![],'where':{'CmContactId':_0x49735a[_0x954e('0x32')][_0x954e('0x91')]}})[_0x954e('0x16')](function(_0x4f8f02){var _0x2839f6=_[_0x954e('0x6e')](_0x4f8f02,function(_0x490dec){_0x490dec[_0x954e('0x92')]=_0x49735a[_0x954e('0x32')][_0x954e('0x93')];return _0x490dec;});return db[_0x954e('0x49')][_0x954e('0x59')](_0x2839f6,{});})[_0x954e('0x16')](function(){return addCmHopperPhones(_0x49735a[_0x954e('0x32')]['toContactId']);})[_0x954e('0x16')](function(){return['ok'];})[_0x954e('0x16')](respondWithResult(_0x2e4619,null))[_0x954e('0x20')](handleError(_0x2e4619,null));};exports[_0x954e('0x94')]=function(_0x3ff834,_0x450255){var _0x5c2fc2=[];_0x5c2fc2[_0x954e('0x5d')](createCmHopperPhone(_0x3ff834['body']['id'],_0x3ff834[_0x954e('0x32')][_0x954e('0x95')]));Promise['all'](_0x5c2fc2)['then'](function(){return[0x1];})[_0x954e('0x16')](respondWithResult(_0x450255,null));};exports[_0x954e('0x96')]=function(_0x342485,_0xb156d6){var _0x4511bc={'raw':![],'where':{}};var _0x29d88e={};var _0x5e1cf7={'count':0x0,'rows':[]};return db['CmContact'][_0x954e('0x75')]({'where':{'id':_0x342485['params']['id']}})[_0x954e('0x16')](handleEntityNotFound(_0xb156d6,null))[_0x954e('0x16')](function(_0x3242ba){if(_0x3242ba){_0x29d88e['model']=_['keys'](db[_0x954e('0x3b')][_0x954e('0x76')]);_0x29d88e[_0x954e('0x2a')]=_['keys'](_0x342485['query']);_0x29d88e[_0x954e('0x77')]=_[_0x954e('0x7a')](_0x29d88e[_0x954e('0x78')],_0x29d88e[_0x954e('0x2a')]);_0x4511bc[_0x954e('0x79')]=_['intersection'](_0x29d88e[_0x954e('0x78')],qs[_0x954e('0x7b')](_0x342485[_0x954e('0x2a')][_0x954e('0x7b')]));_0x4511bc[_0x954e('0x79')]=_0x4511bc[_0x954e('0x79')][_0x954e('0x25')]?_0x4511bc[_0x954e('0x79')]:_0x29d88e[_0x954e('0x78')];if(!_0x342485[_0x954e('0x2a')]['hasOwnProperty'](_0x954e('0x7f'))){_0x4511bc['limit']=qs['limit'](_0x342485[_0x954e('0x2a')]['limit']);_0x4511bc[_0x954e('0x11')]=qs[_0x954e('0x11')](_0x342485[_0x954e('0x2a')][_0x954e('0x11')]);}_0x4511bc[_0x954e('0x7c')]=qs[_0x954e('0x97')](_0x342485[_0x954e('0x2a')][_0x954e('0x97')]);_0x4511bc['where']=qs['filters'](_[_0x954e('0x98')](_0x342485['query'],_0x29d88e[_0x954e('0x77')]));_0x4511bc[_0x954e('0x68')][_0x954e('0x99')]=_0x3242ba['id'];if(_0x342485[_0x954e('0x2a')]['filter']){_0x4511bc[_0x954e('0x68')]=_[_0x954e('0x31')](_0x4511bc[_0x954e('0x68')],{'$or':_[_0x954e('0x6e')](_0x4511bc[_0x954e('0x79')],function(_0x4c3349){var _0x123e11={};_0x123e11[_0x4c3349]={'$like':'%'+_0x342485['query'][_0x954e('0x7d')]+'%'};return _0x123e11;})});}_0x4511bc=_[_0x954e('0x31')]({},_0x4511bc,_0x342485[_0x954e('0x7e')]);return db['CmHopper'][_0x954e('0x14')]({'where':_0x4511bc['where']})['then'](function(_0x1723f7){_0x5e1cf7[_0x954e('0x14')]=_0x1723f7;if(_0x342485[_0x954e('0x2a')][_0x954e('0x9a')]){_0x4511bc['include']=[{'all':!![]}];}return db[_0x954e('0x3b')][_0x954e('0x1e')](_0x4511bc);})[_0x954e('0x16')](function(_0x4bdb49){_0x5e1cf7[_0x954e('0x9b')]=_0x4bdb49;return _0x5e1cf7;});}})[_0x954e('0x16')](respondWithFilteredResult(_0xb156d6,_0x4511bc))[_0x954e('0x20')](handleError(_0xb156d6,null));};exports[_0x954e('0x9c')]=function(_0x4c598d,_0x18d54e){var _0x20651d={'raw':!![],'where':{}};var _0x299a57={};var _0x38c486={'count':0x0,'rows':[]};return db[_0x954e('0x21')][_0x954e('0x75')]({'where':{'id':_0x4c598d[_0x954e('0x23')]['id']}})[_0x954e('0x16')](handleEntityNotFound(_0x18d54e,null))['then'](function(_0x143c1a){if(_0x143c1a){_0x299a57[_0x954e('0x78')]=_[_0x954e('0x24')](db[_0x954e('0x9d')][_0x954e('0x76')]);_0x299a57[_0x954e('0x2a')]=_[_0x954e('0x24')](_0x4c598d['query']);_0x299a57['filters']=_['intersection'](_0x299a57[_0x954e('0x78')],_0x299a57[_0x954e('0x2a')]);_0x20651d[_0x954e('0x79')]=_['intersection'](_0x299a57[_0x954e('0x78')],qs['fields'](_0x4c598d[_0x954e('0x2a')][_0x954e('0x7b')]));_0x20651d[_0x954e('0x79')]=_0x20651d[_0x954e('0x79')][_0x954e('0x25')]?_0x20651d[_0x954e('0x79')]:_0x299a57[_0x954e('0x78')];if(!_0x4c598d[_0x954e('0x2a')]['hasOwnProperty']('nolimit')){_0x20651d[_0x954e('0x13')]=qs[_0x954e('0x13')](_0x4c598d['query'][_0x954e('0x13')]);_0x20651d[_0x954e('0x11')]=qs[_0x954e('0x11')](_0x4c598d['query'][_0x954e('0x11')]);}_0x20651d[_0x954e('0x7c')]=qs[_0x954e('0x97')](_0x4c598d[_0x954e('0x2a')][_0x954e('0x97')]);_0x20651d['where']=qs['filters'](_[_0x954e('0x98')](_0x4c598d[_0x954e('0x2a')],_0x299a57['filters']));_0x20651d['where'][_0x954e('0x99')]=_0x143c1a['id'];if(_0x4c598d[_0x954e('0x2a')]['filter']){_0x20651d[_0x954e('0x68')]=_[_0x954e('0x31')](_0x20651d[_0x954e('0x68')],{'$or':_[_0x954e('0x6e')](_0x20651d[_0x954e('0x79')],function(_0x3a67bb){var _0x5e208f={};_0x5e208f[_0x3a67bb]={'$like':'%'+_0x4c598d[_0x954e('0x2a')][_0x954e('0x7d')]+'%'};return _0x5e208f;})});}_0x20651d=_[_0x954e('0x31')]({},_0x20651d,_0x4c598d['options']);return db[_0x954e('0x9d')][_0x954e('0x14')]({'where':_0x20651d[_0x954e('0x68')]})['then'](function(_0x5721d9){_0x38c486[_0x954e('0x14')]=_0x5721d9;if(_0x4c598d[_0x954e('0x2a')][_0x954e('0x9a')]){_0x20651d[_0x954e('0x9e')]=[{'all':!![]}];}return db[_0x954e('0x9d')]['findAll'](_0x20651d);})[_0x954e('0x16')](function(_0xdaee21){_0x38c486[_0x954e('0x9b')]=_0xdaee21;return _0x38c486;});}})[_0x954e('0x16')](respondWithFilteredResult(_0x18d54e,_0x20651d))[_0x954e('0x20')](handleError(_0x18d54e,null));};exports[_0x954e('0x9f')]=function(_0x1d7802,_0xfaca8c){var _0x4d1455={'raw':!![],'where':{}};var _0x5774f4={};var _0x46aa22={'count':0x0,'rows':[]};return db['CmContact'][_0x954e('0x75')]({'where':{'id':_0x1d7802['params']['id']}})[_0x954e('0x16')](handleEntityNotFound(_0xfaca8c,null))[_0x954e('0x16')](function(_0xdda2bf){if(_0xdda2bf){_0x5774f4[_0x954e('0x78')]=_['keys'](db[_0x954e('0x4a')]['rawAttributes']);_0x5774f4[_0x954e('0x2a')]=_[_0x954e('0x24')](_0x1d7802['query']);_0x5774f4[_0x954e('0x77')]=_[_0x954e('0x7a')](_0x5774f4[_0x954e('0x78')],_0x5774f4[_0x954e('0x2a')]);_0x4d1455['attributes']=_[_0x954e('0x7a')](_0x5774f4['model'],qs[_0x954e('0x7b')](_0x1d7802[_0x954e('0x2a')][_0x954e('0x7b')]));_0x4d1455[_0x954e('0x79')]=_0x4d1455['attributes'][_0x954e('0x25')]?_0x4d1455[_0x954e('0x79')]:_0x5774f4[_0x954e('0x78')];if(!_0x1d7802[_0x954e('0x2a')][_0x954e('0x30')](_0x954e('0x7f'))){_0x4d1455[_0x954e('0x13')]=qs['limit'](_0x1d7802[_0x954e('0x2a')][_0x954e('0x13')]);_0x4d1455[_0x954e('0x11')]=qs['offset'](_0x1d7802[_0x954e('0x2a')][_0x954e('0x11')]);}_0x4d1455[_0x954e('0x7c')]=qs[_0x954e('0x97')](_0x1d7802[_0x954e('0x2a')][_0x954e('0x97')]);_0x4d1455['where']=qs['filters'](_[_0x954e('0x98')](_0x1d7802[_0x954e('0x2a')],_0x5774f4['filters']));_0x4d1455[_0x954e('0x68')]['ContactId']=_0xdda2bf['id'];if(_0x1d7802[_0x954e('0x2a')][_0x954e('0x7d')]){_0x4d1455[_0x954e('0x68')]=_[_0x954e('0x31')](_0x4d1455['where'],{'$or':_[_0x954e('0x6e')](_0x4d1455['attributes'],function(_0x1419fa){var _0x2e843a={};_0x2e843a[_0x1419fa]={'$like':'%'+_0x1d7802[_0x954e('0x2a')][_0x954e('0x7d')]+'%'};return _0x2e843a;})});}_0x4d1455=_[_0x954e('0x31')]({},_0x4d1455,_0x1d7802['options']);return db[_0x954e('0x4a')]['count']({'where':_0x4d1455[_0x954e('0x68')]})[_0x954e('0x16')](function(_0x33f239){_0x46aa22[_0x954e('0x14')]=_0x33f239;if(_0x1d7802[_0x954e('0x2a')]['includeAll']){_0x4d1455['include']=[{'all':!![]}];}return db[_0x954e('0x4a')][_0x954e('0x1e')](_0x4d1455);})[_0x954e('0x16')](function(_0x4dedac){_0x46aa22[_0x954e('0x9b')]=_0x4dedac;return _0x46aa22;});}})['then'](respondWithFilteredResult(_0xfaca8c,_0x4d1455))[_0x954e('0x20')](handleError(_0xfaca8c,null));};exports['getJscriptySessions']=function(_0x27535b,_0x6b8b91){var _0x4d9bb3={'raw':!![],'where':{}};var _0x119237={};var _0x2c8c94={'count':0x0,'rows':[]};return db[_0x954e('0x21')][_0x954e('0x75')]({'where':{'id':_0x27535b[_0x954e('0x23')]['id']}})['then'](handleEntityNotFound(_0x6b8b91,null))['then'](function(_0x5b87a9){if(_0x5b87a9){_0x119237[_0x954e('0x78')]=_[_0x954e('0x24')](db['JscriptySessionReport'][_0x954e('0x76')]);_0x119237['query']=_[_0x954e('0x24')](_0x27535b[_0x954e('0x2a')]);_0x119237[_0x954e('0x77')]=_[_0x954e('0x7a')](_0x119237[_0x954e('0x78')],_0x119237[_0x954e('0x2a')]);_0x4d9bb3[_0x954e('0x79')]=_['intersection'](_0x119237[_0x954e('0x78')],qs['fields'](_0x27535b['query']['fields']));_0x4d9bb3['attributes']=_0x4d9bb3['attributes'][_0x954e('0x25')]?_0x4d9bb3['attributes']:_0x119237['model'];if(!_0x27535b[_0x954e('0x2a')]['hasOwnProperty'](_0x954e('0x7f'))){_0x4d9bb3[_0x954e('0x13')]=qs[_0x954e('0x13')](_0x27535b[_0x954e('0x2a')][_0x954e('0x13')]);_0x4d9bb3['offset']=qs[_0x954e('0x11')](_0x27535b['query'][_0x954e('0x11')]);}_0x4d9bb3[_0x954e('0x7c')]=qs['sort'](_0x27535b[_0x954e('0x2a')][_0x954e('0x97')]);_0x4d9bb3[_0x954e('0x68')]=qs[_0x954e('0x77')](_['pick'](_0x27535b['query'],_0x119237[_0x954e('0x77')]));_0x4d9bb3[_0x954e('0x68')][_0x954e('0x99')]=_0x5b87a9['id'];if(_0x27535b[_0x954e('0x2a')]['filter']){_0x4d9bb3[_0x954e('0x68')]=_[_0x954e('0x31')](_0x4d9bb3[_0x954e('0x68')],{'$or':_[_0x954e('0x6e')](_0x4d9bb3[_0x954e('0x79')],function(_0x3b85d8){var _0x4ab858={};_0x4ab858[_0x3b85d8]={'$like':'%'+_0x27535b[_0x954e('0x2a')][_0x954e('0x7d')]+'%'};return _0x4ab858;})});}_0x4d9bb3=_[_0x954e('0x31')]({},_0x4d9bb3,_0x27535b[_0x954e('0x7e')]);return db[_0x954e('0x51')][_0x954e('0x14')]({'where':_0x4d9bb3['where']})['then'](function(_0xe2d641){_0x2c8c94[_0x954e('0x14')]=_0xe2d641;if(_0x27535b[_0x954e('0x2a')][_0x954e('0x9a')]){_0x4d9bb3[_0x954e('0x9e')]=[{'all':!![]}];}return db[_0x954e('0x51')][_0x954e('0x1e')](_0x4d9bb3);})[_0x954e('0x16')](function(_0x3d2f18){_0x2c8c94[_0x954e('0x9b')]=_0x3d2f18;return _0x2c8c94;});}})[_0x954e('0x16')](respondWithFilteredResult(_0x6b8b91,_0x4d9bb3))['catch'](handleError(_0x6b8b91,null));};exports['uploadCsv']=function(_0x113ff1,_0xa9204c){try{if(!_0x113ff1[_0x954e('0x32')]['ListId']){throw new Error(_0x954e('0xa0'));}if(!_0x113ff1['body'][_0x954e('0xa1')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x113ff1[_0x954e('0x32')][_0x954e('0xa2')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x113ff1[_0x954e('0x32')][_0x954e('0xa3')]){throw new Error(_0x954e('0xa4'));}var _0x4c2340=_0x113ff1[_0x954e('0x32')][_0x954e('0xa1')][_0x954e('0xa5')](',');var _0x3df239=_0x113ff1[_0x954e('0x32')][_0x954e('0xa2')][_0x954e('0xa5')](',');if(!_0x4c2340['length']||!_0x3df239[_0x954e('0x25')]||_0x4c2340[_0x954e('0x25')]!==_0x3df239[_0x954e('0x25')]){throw new Error(_0x954e('0xa6'));}_0x113ff1[_0x954e('0x32')][_0x954e('0x7b')]=_[_0x954e('0xa7')](_0x4c2340,_0x3df239);if(!_0x113ff1[_0x954e('0x32')][_0x954e('0x7b')]['phone']){throw new Error(_0x954e('0xa8'));}if(!_0x113ff1[_0x954e('0x32')][_0x954e('0x7b')]['firstName']){throw new Error(_0x954e('0xa9'));}var _0x23de97=path[_0x954e('0x37')](config[_0x954e('0xaa')],'server/files/tmp',_0x113ff1[_0x954e('0xab')][_0x954e('0xac')]);fs[_0x954e('0xad')](_0x23de97,parseInt(_0x954e('0xae'),0x8));var _0x43ea5d=require('child_process')[_0x954e('0xaf')](path[_0x954e('0x37')](__dirname,_0x954e('0xb0')),[_0x23de97,_0x113ff1[_0x954e('0x32')][_0x954e('0xa1')],_0x113ff1['body'][_0x954e('0xa2')],_0x113ff1['body'][_0x954e('0x5e')],_0x113ff1[_0x954e('0x32')][_0x954e('0xb1')],_0x113ff1[_0x954e('0x32')]['duplicates'],_0x113ff1['body']['socket_timestamp']]);return _0xa9204c[_0x954e('0xf')](0xc8)[_0x954e('0x10')]({'message':_0x954e('0xb2'),'pid':_0x43ea5d[_0x954e('0xb3')]});}catch(_0x19858a){return _0xa9204c['status'](0x1f4)[_0x954e('0x1b')](_0x19858a);}};exports[_0x954e('0xb4')]=function(_0x1705a3,_0x36f186){var _0x367609=fs['createReadStream'](_0x1705a3['file']['path']);Papa[_0x954e('0xb5')](_0x367609,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4ee0df){return _0x36f186[_0x954e('0xf')](0xc8)[_0x954e('0x10')]({'file':_0x1705a3[_0x954e('0xab')],'fields':_0x4ee0df[_0x954e('0xb6')][_0x954e('0x7b')]});}});};exports['import']=function(_0x42ba69,_0x424615){return db[_0x954e('0xb7')][_0x954e('0x1e')]({'raw':!![],'attributes':['id'],'where':{'role':_0x954e('0xb8')}})[_0x954e('0x16')](function(_0x4cf4c1){var _0x1ad8e5=![];if(!_0x42ba69[_0x954e('0x32')][_0x954e('0x5e')]){throw new Error(_0x954e('0xa0'));}if(!_0x42ba69['body']['binding'][_0x954e('0x73')]){throw new Error(_0x954e('0xa8'));}if(!_0x42ba69[_0x954e('0x32')][_0x954e('0xb9')][_0x954e('0xba')]){throw new Error(_0x954e('0xa9'));}if(!_0x42ba69['body'][_0x954e('0xa3')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x599c82=require('child_process')['fork'](path[_0x954e('0x37')](__dirname,_0x954e('0xbb')),[_0x42ba69['params']['id'],JSON[_0x954e('0xbc')](_0x42ba69[_0x954e('0x32')]),JSON[_0x954e('0xbc')](_0x4cf4c1)]);_0x599c82['on'](_0x954e('0xbd'),function(){_0x1ad8e5=!![];return _0x424615['status'](0xc8)[_0x954e('0x10')]({'message':_0x954e('0xbe'),'pid':_0x599c82[_0x954e('0xb3')]});});_0x599c82['on'](_0x954e('0xbf'),function(_0x1a20f1){if(_0x1a20f1&&!_0x1ad8e5){return _0x424615[_0x954e('0xf')](0x1f4)[_0x954e('0x10')]({'message':_0x954e('0xc0'),'pid':_0x599c82[_0x954e('0xb3')]});}});})[_0x954e('0x20')](handleError(_0x424615,null));};exports[_0x954e('0xc1')]=function(_0x147b26,_0xcd8170){return db[_0x954e('0xb7')][_0x954e('0x1e')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x954e('0x16')](function(_0x4f8743){var _0x334c63=![];if(!_0x147b26[_0x954e('0x32')][_0x954e('0x5e')]){throw new Error(_0x954e('0xa0'));}if(!_0x147b26[_0x954e('0x32')][_0x954e('0xb9')]['phone']){throw new Error(_0x954e('0xa8'));}if(!_0x147b26[_0x954e('0x32')][_0x954e('0xb9')][_0x954e('0xba')]){throw new Error(_0x954e('0xa9'));}if(!_0x147b26[_0x954e('0x32')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x2f2379=require(_0x954e('0xc2'))[_0x954e('0xaf')](path[_0x954e('0x37')](__dirname,_0x954e('0xc3')),[_0x147b26[_0x954e('0x23')]['id'],JSON[_0x954e('0xbc')](_0x147b26[_0x954e('0x32')]),JSON['stringify'](_0x4f8743)]);_0x2f2379['on'](_0x954e('0xbd'),function(){_0x334c63=!![];return _0xcd8170[_0x954e('0xf')](0xc8)[_0x954e('0x10')]({'message':_0x954e('0xbe'),'pid':_0x2f2379[_0x954e('0xb3')]});});_0x2f2379['on']('exit',function(_0x524d83){if(_0x524d83&&!_0x334c63){return _0xcd8170['status'](0x1f4)[_0x954e('0x10')]({'message':'error\x20child\x20process','pid':_0x2f2379['pid']});}});})[_0x954e('0x20')](handleError(_0xcd8170,null));};exports[_0x954e('0xc4')]=function(_0x3c8f10,_0x5cc03d){var _0x95e352=['mail',_0x954e('0xc5'),'sms',_0x954e('0xc6'),_0x954e('0xc7'),_0x954e('0xc8'),_0x954e('0xc9')];var _0xd254fe={'offset':0x0,'order':qs[_0x954e('0x97')](_0x954e('0xca'))},_0x45638e={'count':0x0,'rows':[]};Promise[_0x954e('0xcb')]()[_0x954e('0x16')](function(){if(_0x3c8f10[_0x954e('0x2a')][_0x954e('0xcc')]){if(!_[_0x954e('0xcd')](_0x95e352,_0x3c8f10[_0x954e('0x2a')][_0x954e('0xcc')][_0x954e('0xce')]())){throw new Error(_0x954e('0xcf'));}_0x95e352=[_0x3c8f10['query'][_0x954e('0xcc')][_0x954e('0xce')]()];}if(_0x3c8f10[_0x954e('0x2a')][_0x954e('0xd0')]){try{var _0x2a21e1=JSON[_0x954e('0xb5')](_0x3c8f10[_0x954e('0x2a')][_0x954e('0xd0')]);if(!moment(_0x2a21e1[_0x954e('0x3a')])[_0x954e('0xd1')]()){throw new Error(_0x954e('0xd2'));}if(!moment(_0x2a21e1['to'])[_0x954e('0xd1')]()){throw new Error(_0x954e('0xd3'));}}catch(_0x35d5df){throw new Error(_0x954e('0xd4'));}}if(!_0x3c8f10['query']['hasOwnProperty']('nolimit')){_0xd254fe['limit']=qs[_0x954e('0x13')](_0x3c8f10['query'][_0x954e('0x13')]||0xa);_0xd254fe[_0x954e('0x11')]=qs[_0x954e('0x11')](_0x3c8f10[_0x954e('0x2a')]['offset']);}var _0x353f36=_0x95e352[_0x954e('0x6e')](function(_0x3222b1){if(_0x3222b1===_0x954e('0xc9')){var _0x805d21={'attributes':['id',_0x954e('0xd5'),'type',_0x954e('0xd6'),_0x954e('0xd7'),_0x954e('0xd8'),'starttime',_0x954e('0xd9'),'duration',_0x954e('0xda'),_0x954e('0xdb'),_0x954e('0xdc'),'userSecondDisposition',_0x954e('0xdd'),_0x954e('0xde')],'where':{'ContactId':_0x3c8f10['params']['id']},'include':[{'model':db['User'],'as':'User','attributes':['id','name',_0x954e('0xdf'),_0x954e('0x2c')]}],'order':[[_0x954e('0xdb'),'DESC']]};if(_0x3c8f10['query'][_0x954e('0xd0')]){_0x805d21[_0x954e('0x68')][_0x954e('0xdb')]={'$gte':_0x2a21e1['from'],'$lte':_0x2a21e1['to']};}return db[_0x954e('0x4c')][_0x954e('0xe0')](_0x805d21)[_0x954e('0x16')](function(_0x23a3d7){_0x45638e[_0x954e('0x14')]+=_0x23a3d7['count'];return _['map'](_0x23a3d7[_0x954e('0x9b')],function(_0x20930f){var _0x4ef03d=_0x20930f[_0x954e('0x33')]({'plain':!![]});_0x4ef03d[_0x954e('0xcc')]=_0x3222b1;if(_0x4ef03d['User']){_0x4ef03d[_0x954e('0xb7')]={'id':_0x4ef03d[_0x954e('0xb7')]['id'],'name':_0x4ef03d[_0x954e('0xb7')][_0x954e('0x1a')],'fullname':_0x4ef03d['User'][_0x954e('0xdf')],'alias':_0x4ef03d['User'][_0x954e('0x2c')]};}return _0x4ef03d;});});}else{var _0x1dc5d4=_['startCase'](_0x3222b1)+(_0x3222b1===_0x954e('0xc5')?_0x954e('0xe1'):_0x954e('0xe2'));var _0x58b088={'attributes':['id',_0x954e('0xe3'),_0x954e('0xe4'),'createdAt','note',_0x954e('0xe5'),_0x954e('0xe6'),'thirdDisposition',_0x954e('0xde'),_0x1dc5d4+'Id'],'where':{'ContactId':_0x3c8f10['params']['id']},'include':[{'model':db[_0x1dc5d4],'as':_0x954e('0xe2'),'attributes':['id',_0x954e('0x1a'),_0x954e('0xe7')]},{'model':db[_0x954e('0xb7')],'as':_0x954e('0xe8'),'attributes':['id',_0x954e('0x1a'),_0x954e('0xdf')]},{'model':db[_0x954e('0x62')],'as':_0x954e('0xe9'),'attributes':['id',_0x954e('0x1a'),_0x954e('0x63')],'through':{'attributes':[]}}],'order':[[_0x954e('0xdb'),_0x954e('0xea')]]};if(_0x3c8f10[_0x954e('0x2a')][_0x954e('0xd0')]){_0x58b088[_0x954e('0x68')][_0x954e('0xdb')]={'$gte':_0x2a21e1[_0x954e('0x3a')],'$lte':_0x2a21e1['to']};}switch(_0x3222b1){case _0x954e('0xc5'):_0x58b088[_0x954e('0x79')][_0x954e('0x5d')](_0x954e('0xeb'),'customerIp',_0x954e('0xec'),_0x954e('0xed'),_0x954e('0xee'),_0x954e('0xef'),'ratingType',_0x954e('0xf0'),_0x954e('0xf1'));break;case _0x954e('0xf2'):_0x58b088[_0x954e('0x79')]['push']('subject',_0x954e('0xf3'));break;case _0x954e('0xc6'):_0x58b088[_0x954e('0x79')]['push'](_0x954e('0xf4'),'threadId');break;}return db[_[_0x954e('0xf5')](_0x3222b1)+'Interaction'][_0x954e('0xe0')](_0x58b088)[_0x954e('0x16')](function(_0x43e632){_0x45638e[_0x954e('0x14')]+=_0x43e632[_0x954e('0x14')];return _[_0x954e('0x6e')](_0x43e632[_0x954e('0x9b')],function(_0x4ae992){var _0x275dfd=_0x4ae992[_0x954e('0x33')]({'plain':!![]});_0x275dfd[_0x954e('0xcc')]=_0x3222b1;if(_0x275dfd[_0x954e('0xe8')]){_0x275dfd[_0x954e('0xe8')]={'id':_0x275dfd[_0x954e('0xe8')]['id'],'name':_0x275dfd[_0x954e('0xe8')][_0x954e('0x1a')],'fullname':_0x275dfd[_0x954e('0xe8')][_0x954e('0xdf')]};}return _0x275dfd;});});}});return Promise[_0x954e('0x82')](_0x353f36);})[_0x954e('0x16')](function(_0x301d1e){return _(_0x301d1e)[_0x954e('0xf6')]()[_0x954e('0xf7')](_0x954e('0xdb'))[_0x954e('0xf8')]()[_0x954e('0xf9')]();})[_0x954e('0x16')](function(_0x28ec4b){_0x45638e[_0x954e('0x9b')]=_0xd254fe[_0x954e('0x13')]?_0x28ec4b[_0x954e('0xfa')](_0xd254fe[_0x954e('0x11')],_0xd254fe[_0x954e('0x11')]+_0xd254fe['limit']):_0x28ec4b;return _0x45638e;})[_0x954e('0x16')](respondWithFilteredResult(_0x5cc03d,_0xd254fe))[_0x954e('0x20')](handleError(_0x5cc03d,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 41cf91d..8f60f84 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf749=['update','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x4ddf3e,_0x15b3b8){var _0x290694=function(_0x4ae492){while(--_0x4ae492){_0x4ddf3e['push'](_0x4ddf3e['shift']());}};_0x290694(++_0x15b3b8);}(_0xf749,0x154));var _0x9f74=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xf749[_0x46e363];return _0x3fb059;};'use strict';var EventEmitter=require(_0x9f74('0x0'));var CmContact=require(_0x9f74('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x9f74('0x2')](0x0);var events={'afterCreate':_0x9f74('0x3'),'afterUpdate':_0x9f74('0x4'),'afterDestroy':'remove'};function emitEvent(_0x37b8ca){return function(_0x31219f,_0x36e9a8,_0x550ec2){CmContactEvents['emit'](_0x37b8ca+':'+_0x31219f['id'],_0x31219f);CmContactEvents[_0x9f74('0x5')](_0x37b8ca,_0x31219f);_0x550ec2(null);};}for(var e in events){if(events[_0x9f74('0x6')](e)){var event=events[e];CmContact[_0x9f74('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x97e8=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x357571,_0xceecf){var _0x4fcd11=function(_0xb043e5){while(--_0xb043e5){_0x357571['push'](_0x357571['shift']());}};_0x4fcd11(++_0xceecf);}(_0x97e8,0x9e));var _0x897e=function(_0x29a2ae,_0x2270c1){_0x29a2ae=_0x29a2ae-0x0;var _0x3ced46=_0x97e8[_0x29a2ae];return _0x3ced46;};'use strict';var EventEmitter=require(_0x897e('0x0'));var CmContact=require(_0x897e('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x897e('0x2')](0x0);var events={'afterCreate':_0x897e('0x3'),'afterUpdate':_0x897e('0x4'),'afterDestroy':_0x897e('0x5')};function emitEvent(_0x4ce513){return function(_0x26a756,_0x466bc7,_0x41ef86){CmContactEvents[_0x897e('0x6')](_0x4ce513+':'+_0x26a756['id'],_0x26a756);CmContactEvents[_0x897e('0x6')](_0x4ce513,_0x26a756);_0x41ef86(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x897e('0x7')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 74eb9e0..0b41b5e 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x345c=['add','minutes','format','phone','ListId','priority','callbackUniqueid','assign','CmHopper','findOne','\x20in\x20Campaign\x20with\x20id\x20','CmHopperFinal','[Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','CampaignId','VoiceQueueId','create','[OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','dialCheckDuplicateType','always','onlyIfOpen','findAll','outbound','Lists','all','Campaign','CmList','map','BlackLists','CmHopperBlack','exports','cm_contacts','firstName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','catch','[cmContact][afterCreate]','message','isEmpty','length','destroy','ContactId','push','info','inspect','[CmContact][afterDestroy][Error]','lodash','util','api','moment','../../config/environment/shared','VoiceQueue','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','resolve','then','timezones','utcOffset'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x345c,0x17e));var _0xc345=function(_0x306cd0,_0xf33417){_0x306cd0=_0x306cd0-0x0;var _0x52946b=_0x345c[_0x306cd0];return _0x52946b;};'use strict';var _=require(_0xc345('0x0'));var util=require(_0xc345('0x1'));var logger=require('../../config/logger')(_0xc345('0x2'));var moment=require(_0xc345('0x3'));var shared=require(_0xc345('0x4'));var attributes=require('./cmContact.attributes');function getTimezoneCallbackAt(_0x5bd8ff,_0x537bb8,_0x432656,_0x503c6c){var _0x50e0bd=_0x503c6c?'Campaign':_0xc345('0x5');var _0x217170=_0x432656['scheduledat']?_0x432656[_0xc345('0x6')]:moment()['format'](_0xc345('0x7'));if(_[_0xc345('0x8')](_0x432656[_0xc345('0x9')])){return Promise[_0xc345('0xa')](_0x217170);}return _0x5bd8ff[_0x50e0bd]['findOne']({'where':{'id':_0x537bb8}})[_0xc345('0xb')](function(_0x52ac00){if(_[_0xc345('0x8')](_0x52ac00)||_[_0xc345('0x8')](_0x52ac00[_0xc345('0x9')])){return Promise[_0xc345('0xa')](_0x217170);}var _0x5679fc=shared[_0xc345('0xc')];var _0x9dab21=_0x5679fc[_0x52ac00[_0xc345('0x9')]];var _0x19ae4d=_0x5679fc[_0x432656[_0xc345('0x9')]];if(_['isNil'](_0x9dab21)&&_[_0xc345('0x8')](_0x19ae4d)){return Promise[_0xc345('0xa')](_0x217170);}var _0x48e68c=_0x9dab21[_0xc345('0xd')]-_0x19ae4d[_0xc345('0xd')];var _0x3f45d2=_0x432656[_0xc345('0x6')]?_0x432656[_0xc345('0x6')]:moment();_0x217170=moment(_0x3f45d2)[_0xc345('0xe')](_0x48e68c,_0xc345('0xf'))[_0xc345('0x10')]('YYYY-MM-DD\x20HH:mm:ss');return Promise[_0xc345('0xa')](_0x217170);});}function getNewHopperPayload(_0x2a260c){return{'phone':_0x2a260c[_0xc345('0x11')],'ContactId':_0x2a260c['id'],'ListId':_0x2a260c[_0xc345('0x12')],'scheduledat':_0x2a260c[_0xc345('0x6')]?_0x2a260c[_0xc345('0x6')]:moment()[_0xc345('0x10')](_0xc345('0x7')),'priority':_0x2a260c['priority']?_0x2a260c[_0xc345('0x13')]:0x2,'callback':_0x2a260c[_0xc345('0x14')]?!![]:![],'callbackuniqueid':_0x2a260c[_0xc345('0x14')]?_0x2a260c[_0xc345('0x14')]:undefined,'callbackat':_0x2a260c[_0xc345('0x14')]?moment()['format'](_0xc345('0x7')):undefined};}function handleAlwaysCheckDuplicate(_0x168d1e,_0x49b2b4,_0x3cc058,_0x1c73d5){var _0x42ac07={'phone':_0x3cc058[_0xc345('0x11')]};var _0x3f6c2c={'calleridnum':_0x3cc058[_0xc345('0x11')]};if(_0x1c73d5){Object[_0xc345('0x15')](_0x42ac07,{'CampaignId':_0x49b2b4['id']});Object[_0xc345('0x15')](_0x3f6c2c,{'CampaignId':_0x49b2b4['id']});}else{Object[_0xc345('0x15')](_0x42ac07,{'VoiceQueueId':_0x49b2b4['id']});Object[_0xc345('0x15')](_0x3f6c2c,{'VoiceQueueId':_0x49b2b4['id']});}return _0x168d1e[_0xc345('0x16')][_0xc345('0x17')]({'where':_0x42ac07})[_0xc345('0xb')](function(_0x4ff619){if(_0x4ff619){throw new Error('[Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20'+_0x3cc058[_0xc345('0x11')]+_0xc345('0x18')+_0x49b2b4['id']);}return _0x168d1e[_0xc345('0x19')][_0xc345('0x17')]({'where':_0x3f6c2c});})[_0xc345('0xb')](function(_0x15e9d7){if(_0x15e9d7){throw new Error(_0xc345('0x1a')+_0x3cc058[_0xc345('0x11')]+_0xc345('0x18')+_0x49b2b4['id']);}var _0x140648=getNewHopperPayload(_0x3cc058);if(_0x1c73d5){_0x140648[_0xc345('0x1b')]=_0x49b2b4['id'];}else{_0x140648[_0xc345('0x1c')]=_0x49b2b4['id'];}return _0x168d1e[_0xc345('0x16')][_0xc345('0x1d')](_0x140648);});}function handleOnlyIfOpenCheckDuplicate(_0x36d10a,_0xd91b38,_0x368b1a,_0x5b0606){var _0x2d0013={'phone':_0x368b1a['phone']};if(_0x5b0606){Object[_0xc345('0x15')](_0x2d0013,{'CampaignId':_0xd91b38['id']});}else{Object[_0xc345('0x15')](_0x2d0013,{'VoiceQueueId':_0xd91b38['id']});}return _0x36d10a[_0xc345('0x16')]['findOne']({'where':_0x2d0013})['then'](function(_0x27760b){if(_0x27760b){throw new Error(_0xc345('0x1e')+_0x368b1a[_0xc345('0x11')]+_0xc345('0x18')+_0xd91b38['id']);}var _0x200a96=getNewHopperPayload(_0x368b1a);if(_0x5b0606){_0x200a96[_0xc345('0x1b')]=_0xd91b38['id'];}else{_0x200a96[_0xc345('0x1c')]=_0xd91b38['id'];}return _0x36d10a[_0xc345('0x16')][_0xc345('0x1d')](_0x200a96);});}function handleNeverCheckDuplicate(_0x43184e,_0x5cad14,_0x58565d){var _0xb0ad88=getNewHopperPayload(_0x58565d);_0xb0ad88[_0xc345('0x1c')]=_0x5cad14['id'];return _0x43184e['CmHopper']['create'](_0xb0ad88);}function handleCheckDuplicate(_0x2fa846,_0x190bad,_0xce71f9,_0x5299e0){return getTimezoneCallbackAt(_0x2fa846,_0x190bad,_0xce71f9,_0x5299e0)[_0xc345('0xb')](function(_0x16698a){_0xce71f9[_0xc345('0x6')]=_0x16698a;switch(_0x190bad[_0xc345('0x1f')]){case _0xc345('0x20'):return handleAlwaysCheckDuplicate(_0x2fa846,_0x190bad,_0xce71f9,_0x5299e0);case _0xc345('0x21'):return handleOnlyIfOpenCheckDuplicate(_0x2fa846,_0x190bad,_0xce71f9,_0x5299e0);default:return handleNeverCheckDuplicate(_0x2fa846,_0x190bad,_0xce71f9);}});}function createHopperForVoiceQueues(_0x3640ea,_0x473f3f){return _0x3640ea['VoiceQueue'][_0xc345('0x22')]({'where':{'type':_0xc345('0x23')},'attributes':['id',_0xc345('0x1f'),_0xc345('0x9')],'include':[{'model':_0x3640ea['CmList'],'as':_0xc345('0x24'),'where':{'id':_0x473f3f[_0xc345('0x12')]}}],'raw':!![]})[_0xc345('0xb')](function(_0x2d6cd3){var _0xf6ae42=_0x2d6cd3['map'](function(_0x2c76ab){return handleCheckDuplicate(_0x3640ea,_0x2c76ab,_0x473f3f,![]);});return Promise[_0xc345('0x25')](_0xf6ae42);});}function createHopperForCampaigns(_0x5d280f,_0x2bf554){return _0x5d280f[_0xc345('0x26')][_0xc345('0x22')]({'attributes':['id',_0xc345('0x1f'),'dialTimezone'],'include':[{'model':_0x5d280f[_0xc345('0x27')],'as':_0xc345('0x24'),'where':{'id':_0x2bf554[_0xc345('0x12')]}}],'raw':!![]})[_0xc345('0xb')](function(_0x4463f0){var _0xd270bf=_0x4463f0[_0xc345('0x28')](function(_0x21a01b){return handleCheckDuplicate(_0x5d280f,_0x21a01b,_0x2bf554,!![]);});return Promise['all'](_0xd270bf);});}function createHopperBlackForVoiceQueues(_0x51d4d4,_0x1c434b){return _0x51d4d4[_0xc345('0x5')][_0xc345('0x22')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x51d4d4[_0xc345('0x27')],'as':_0xc345('0x29'),'where':{'id':_0x1c434b[_0xc345('0x12')]}}],'raw':!![]})['then'](function(_0x5a5999){var _0x48cd53=_0x5a5999['map'](function(_0x3fa0d1){return _0x51d4d4['CmHopperBlack'][_0xc345('0x1d')]({'phone':_0x1c434b[_0xc345('0x11')],'ContactId':_0x1c434b['id'],'ListId':_0x1c434b[_0xc345('0x12')],'VoiceQueueId':_0x3fa0d1['id']});});return Promise['all'](_0x48cd53);});}function createHopperBlackForCampaigns(_0x2a2c54,_0x1807b1){return _0x2a2c54[_0xc345('0x26')][_0xc345('0x22')]({'attributes':['id'],'include':[{'model':_0x2a2c54[_0xc345('0x27')],'as':_0xc345('0x29'),'where':{'id':_0x1807b1[_0xc345('0x12')]}}],'raw':!![]})[_0xc345('0xb')](function(_0x3b5e38){var _0x53639d=_0x3b5e38[_0xc345('0x28')](function(_0x6f0122){return _0x2a2c54[_0xc345('0x2a')][_0xc345('0x1d')]({'phone':_0x1807b1[_0xc345('0x11')],'ContactId':_0x1807b1['id'],'ListId':_0x1807b1[_0xc345('0x12')],'CampaignId':_0x6f0122['id']});});return Promise[_0xc345('0x25')](_0x53639d);});}module[_0xc345('0x2b')]=function(_0x5eb75f){return _0x5eb75f['define']('CmContact',attributes,{'tableName':_0xc345('0x2c'),'paranoid':!![],'indexes':[{'name':_0xc345('0x11'),'fields':[_0xc345('0x11')]},{'name':'fti_cm_contacts','fields':[_0xc345('0x2d'),'lastName',_0xc345('0x11'),_0xc345('0x2e'),_0xc345('0x2f'),_0xc345('0x30')],'type':_0xc345('0x31')}],'timestamps':!![],'charset':_0xc345('0x32'),'collate':_0xc345('0x33'),'hooks':{'afterCreate':function(_0x4a49e7,_0x34e471,_0x262365){var _0x3db2c2=_0x5eb75f[_0xc345('0x34')];var _0x26501d=_0x4a49e7[_0xc345('0x35')]({'plain':!![]});if(!_0x26501d[_0xc345('0x12')]){logger[_0xc345('0x36')]('[cmContact][afterCreate]\x20List\x20not\x20found\x20for\x20contact\x20with\x20id\x20'+_0x26501d['id']);return _0x262365();}if(!_0x26501d[_0xc345('0x11')]){return _0x262365();}return createHopperForVoiceQueues(_0x3db2c2,_0x26501d)[_0xc345('0xb')](function(){return createHopperBlackForVoiceQueues(_0x3db2c2,_0x26501d);})[_0xc345('0xb')](function(){return createHopperForCampaigns(_0x3db2c2,_0x26501d);})['then'](function(){return createHopperBlackForCampaigns(_0x3db2c2,_0x26501d);})['then'](function(){return _0x262365();})[_0xc345('0x37')](function(_0x5936b2){logger['error'](_0xc345('0x38'),_0x5936b2[_0xc345('0x39')]);_0x262365();});},'afterDestroy':function(_0x2ac892,_0x199686,_0xa16c3c){var _0x25e1bc=_0x5eb75f[_0xc345('0x34')];var _0xd56492=_0x2ac892[_0xc345('0x35')]({'plain':!![]});return _0x25e1bc[_0xc345('0x16')][_0xc345('0x22')]({'raw':!![],'where':{'ListId':_0xd56492['ListId'],'ContactId':_0xd56492['id']}})['then'](function(_0x27d95d){if(!_[_0xc345('0x3a')](_0x27d95d)){var _0x443763=[];for(var _0x425dc9=0x0;_0x425dc9<_0x27d95d[_0xc345('0x3b')];_0x425dc9+=0x1){var _0x113e95=_0x25e1bc[_0xc345('0x16')][_0xc345('0x3c')]({'where':{'ListId':_0x27d95d[_0x425dc9][_0xc345('0x12')],'ContactId':_0x27d95d[_0x425dc9][_0xc345('0x3d')],'VoiceQueueId':_0x27d95d[_0x425dc9][_0xc345('0x1c')],'CampaignId':_0x27d95d[_0x425dc9][_0xc345('0x1b')]}});_0x443763[_0xc345('0x3e')](_0x113e95);}return Promise[_0xc345('0x25')](_0x443763);}})[_0xc345('0xb')](function(_0x452583){logger[_0xc345('0x3f')]('[CmContact][afterDestroy][Succesfull]',util[_0xc345('0x40')](_0x452583,{'showHidden':![],'depth':null}));_0xa16c3c();})[_0xc345('0x37')](function(_0x2b7eed){logger['error'](_0xc345('0x41'),util[_0xc345('0x40')](_0x2b7eed,{'showHidden':![],'depth':null}));_0xa16c3c(_0x2b7eed);});}}});}; \ No newline at end of file +var _0xfa5b=['then','timezones','utcOffset','add','phone','ListId','priority','callbackUniqueid','assign','CmHopper','[Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','\x20in\x20Campaign\x20with\x20id\x20','[Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','CampaignId','VoiceQueueId','create','dialCheckDuplicateType','always','findAll','outbound','CmList','Lists','all','map','BlackLists','CmHopperBlack','exports','define','cm_contacts','fti_cm_contacts','lastName','mobile','fax','email','utf8mb4','utf8mb4_unicode_ci','[cmContact][afterCreate]\x20List\x20not\x20found\x20for\x20contact\x20with\x20id\x20','catch','[cmContact][afterCreate]','get','isEmpty','length','destroy','ContactId','push','info','inspect','error','[CmContact][afterDestroy][Error]','util','../../config/logger','api','moment','../../config/environment/shared','./cmContact.attributes','Campaign','VoiceQueue','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','resolve','findOne'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0xfa5b,0x1b1));var _0xbfa5=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xfa5b[_0x47aa64];return _0x549c7a;};'use strict';var _=require('lodash');var util=require(_0xbfa5('0x0'));var logger=require(_0xbfa5('0x1'))(_0xbfa5('0x2'));var moment=require(_0xbfa5('0x3'));var shared=require(_0xbfa5('0x4'));var attributes=require(_0xbfa5('0x5'));function getTimezoneCallbackAt(_0x3584de,_0x4db273,_0x3cba30,_0x5e0ab6){var _0x493bee=_0x5e0ab6?_0xbfa5('0x6'):_0xbfa5('0x7');var _0x4591bf=_0x3cba30['scheduledat']?_0x3cba30[_0xbfa5('0x8')]:moment()[_0xbfa5('0x9')](_0xbfa5('0xa'));if(_[_0xbfa5('0xb')](_0x3cba30[_0xbfa5('0xc')])){return Promise[_0xbfa5('0xd')](_0x4591bf);}return _0x3584de[_0x493bee][_0xbfa5('0xe')]({'where':{'id':_0x4db273}})[_0xbfa5('0xf')](function(_0x5c877b){if(_[_0xbfa5('0xb')](_0x5c877b)||_[_0xbfa5('0xb')](_0x5c877b[_0xbfa5('0xc')])){return Promise[_0xbfa5('0xd')](_0x4591bf);}var _0x2f50bd=shared[_0xbfa5('0x10')];var _0xade0f=_0x2f50bd[_0x5c877b[_0xbfa5('0xc')]];var _0x5f3fd3=_0x2f50bd[_0x3cba30[_0xbfa5('0xc')]];if(_[_0xbfa5('0xb')](_0xade0f)&&_[_0xbfa5('0xb')](_0x5f3fd3)){return Promise[_0xbfa5('0xd')](_0x4591bf);}var _0x22fed6=_0xade0f[_0xbfa5('0x11')]-_0x5f3fd3[_0xbfa5('0x11')];var _0x3c1d4e=_0x3cba30['scheduledat']?_0x3cba30[_0xbfa5('0x8')]:moment();_0x4591bf=moment(_0x3c1d4e)[_0xbfa5('0x12')](_0x22fed6,'minutes')[_0xbfa5('0x9')](_0xbfa5('0xa'));return Promise[_0xbfa5('0xd')](_0x4591bf);});}function getNewHopperPayload(_0x2d3bcd){return{'phone':_0x2d3bcd[_0xbfa5('0x13')],'ContactId':_0x2d3bcd['id'],'ListId':_0x2d3bcd[_0xbfa5('0x14')],'scheduledat':_0x2d3bcd['scheduledat']?_0x2d3bcd[_0xbfa5('0x8')]:moment()[_0xbfa5('0x9')](_0xbfa5('0xa')),'priority':_0x2d3bcd[_0xbfa5('0x15')]?_0x2d3bcd[_0xbfa5('0x15')]:0x2,'callback':_0x2d3bcd['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2d3bcd[_0xbfa5('0x16')]?_0x2d3bcd['callbackUniqueid']:undefined,'callbackat':_0x2d3bcd[_0xbfa5('0x16')]?moment()[_0xbfa5('0x9')](_0xbfa5('0xa')):undefined};}function handleAlwaysCheckDuplicate(_0x518827,_0x5ee574,_0x146642,_0x37cdc7){var _0x49066c={'phone':_0x146642[_0xbfa5('0x13')]};var _0x55a6c1={'calleridnum':_0x146642[_0xbfa5('0x13')]};if(_0x37cdc7){Object[_0xbfa5('0x17')](_0x49066c,{'CampaignId':_0x5ee574['id']});Object['assign'](_0x55a6c1,{'CampaignId':_0x5ee574['id']});}else{Object[_0xbfa5('0x17')](_0x49066c,{'VoiceQueueId':_0x5ee574['id']});Object['assign'](_0x55a6c1,{'VoiceQueueId':_0x5ee574['id']});}return _0x518827[_0xbfa5('0x18')][_0xbfa5('0xe')]({'where':_0x49066c})['then'](function(_0x4f4c92){if(_0x4f4c92){throw new Error(_0xbfa5('0x19')+_0x146642[_0xbfa5('0x13')]+_0xbfa5('0x1a')+_0x5ee574['id']);}return _0x518827['CmHopperFinal'][_0xbfa5('0xe')]({'where':_0x55a6c1});})[_0xbfa5('0xf')](function(_0x322bfc){if(_0x322bfc){throw new Error(_0xbfa5('0x1b')+_0x146642['phone']+_0xbfa5('0x1a')+_0x5ee574['id']);}var _0x3b2dcb=getNewHopperPayload(_0x146642);if(_0x37cdc7){_0x3b2dcb[_0xbfa5('0x1c')]=_0x5ee574['id'];}else{_0x3b2dcb[_0xbfa5('0x1d')]=_0x5ee574['id'];}return _0x518827['CmHopper'][_0xbfa5('0x1e')](_0x3b2dcb);});}function handleOnlyIfOpenCheckDuplicate(_0x86a89e,_0x2b7829,_0x33b311,_0x101be1){var _0x2cc4c1={'phone':_0x33b311[_0xbfa5('0x13')]};if(_0x101be1){Object['assign'](_0x2cc4c1,{'CampaignId':_0x2b7829['id']});}else{Object[_0xbfa5('0x17')](_0x2cc4c1,{'VoiceQueueId':_0x2b7829['id']});}return _0x86a89e[_0xbfa5('0x18')]['findOne']({'where':_0x2cc4c1})[_0xbfa5('0xf')](function(_0x2b82c5){if(_0x2b82c5){throw new Error('[OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20'+_0x33b311[_0xbfa5('0x13')]+_0xbfa5('0x1a')+_0x2b7829['id']);}var _0x48da16=getNewHopperPayload(_0x33b311);if(_0x101be1){_0x48da16['CampaignId']=_0x2b7829['id'];}else{_0x48da16[_0xbfa5('0x1d')]=_0x2b7829['id'];}return _0x86a89e[_0xbfa5('0x18')][_0xbfa5('0x1e')](_0x48da16);});}function handleNeverCheckDuplicate(_0x193ab2,_0x4fae32,_0x4bfa1a){var _0x4af1f4=getNewHopperPayload(_0x4bfa1a);_0x4af1f4[_0xbfa5('0x1d')]=_0x4fae32['id'];return _0x193ab2[_0xbfa5('0x18')][_0xbfa5('0x1e')](_0x4af1f4);}function handleCheckDuplicate(_0x2afff4,_0x108887,_0x3ebb0c,_0x203776){return getTimezoneCallbackAt(_0x2afff4,_0x108887,_0x3ebb0c,_0x203776)[_0xbfa5('0xf')](function(_0x171d5f){_0x3ebb0c[_0xbfa5('0x8')]=_0x171d5f;switch(_0x108887[_0xbfa5('0x1f')]){case _0xbfa5('0x20'):return handleAlwaysCheckDuplicate(_0x2afff4,_0x108887,_0x3ebb0c,_0x203776);case'onlyIfOpen':return handleOnlyIfOpenCheckDuplicate(_0x2afff4,_0x108887,_0x3ebb0c,_0x203776);default:return handleNeverCheckDuplicate(_0x2afff4,_0x108887,_0x3ebb0c);}});}function createHopperForVoiceQueues(_0x4ac2b2,_0x214f34){return _0x4ac2b2[_0xbfa5('0x7')][_0xbfa5('0x21')]({'where':{'type':_0xbfa5('0x22')},'attributes':['id',_0xbfa5('0x1f'),_0xbfa5('0xc')],'include':[{'model':_0x4ac2b2[_0xbfa5('0x23')],'as':_0xbfa5('0x24'),'where':{'id':_0x214f34[_0xbfa5('0x14')]}}],'raw':!![]})[_0xbfa5('0xf')](function(_0x286ec4){var _0x206a3f=_0x286ec4['map'](function(_0x5e080f){return handleCheckDuplicate(_0x4ac2b2,_0x5e080f,_0x214f34,![]);});return Promise[_0xbfa5('0x25')](_0x206a3f);});}function createHopperForCampaigns(_0x4e80db,_0x498b36){return _0x4e80db[_0xbfa5('0x6')][_0xbfa5('0x21')]({'attributes':['id',_0xbfa5('0x1f'),_0xbfa5('0xc')],'include':[{'model':_0x4e80db['CmList'],'as':'Lists','where':{'id':_0x498b36['ListId']}}],'raw':!![]})[_0xbfa5('0xf')](function(_0x30c50e){var _0x4abba2=_0x30c50e[_0xbfa5('0x26')](function(_0xf3dc87){return handleCheckDuplicate(_0x4e80db,_0xf3dc87,_0x498b36,!![]);});return Promise[_0xbfa5('0x25')](_0x4abba2);});}function createHopperBlackForVoiceQueues(_0x53021a,_0x46187e){return _0x53021a['VoiceQueue'][_0xbfa5('0x21')]({'where':{'type':_0xbfa5('0x22')},'attributes':['id'],'include':[{'model':_0x53021a[_0xbfa5('0x23')],'as':_0xbfa5('0x27'),'where':{'id':_0x46187e[_0xbfa5('0x14')]}}],'raw':!![]})[_0xbfa5('0xf')](function(_0x176e6f){var _0x2266c3=_0x176e6f['map'](function(_0x29b41d){return _0x53021a[_0xbfa5('0x28')][_0xbfa5('0x1e')]({'phone':_0x46187e[_0xbfa5('0x13')],'ContactId':_0x46187e['id'],'ListId':_0x46187e['ListId'],'VoiceQueueId':_0x29b41d['id']});});return Promise[_0xbfa5('0x25')](_0x2266c3);});}function createHopperBlackForCampaigns(_0x4d5e07,_0x3c92d3){return _0x4d5e07[_0xbfa5('0x6')]['findAll']({'attributes':['id'],'include':[{'model':_0x4d5e07['CmList'],'as':'BlackLists','where':{'id':_0x3c92d3[_0xbfa5('0x14')]}}],'raw':!![]})[_0xbfa5('0xf')](function(_0xd631b7){var _0x233a5d=_0xd631b7[_0xbfa5('0x26')](function(_0x2658a7){return _0x4d5e07[_0xbfa5('0x28')]['create']({'phone':_0x3c92d3[_0xbfa5('0x13')],'ContactId':_0x3c92d3['id'],'ListId':_0x3c92d3[_0xbfa5('0x14')],'CampaignId':_0x2658a7['id']});});return Promise[_0xbfa5('0x25')](_0x233a5d);});}module[_0xbfa5('0x29')]=function(_0x1627a7){return _0x1627a7[_0xbfa5('0x2a')]('CmContact',attributes,{'tableName':_0xbfa5('0x2b'),'paranoid':!![],'indexes':[{'name':_0xbfa5('0x13'),'fields':['phone']},{'name':_0xbfa5('0x2c'),'fields':['firstName',_0xbfa5('0x2d'),_0xbfa5('0x13'),_0xbfa5('0x2e'),_0xbfa5('0x2f'),_0xbfa5('0x30')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xbfa5('0x31'),'collate':_0xbfa5('0x32'),'hooks':{'afterCreate':function(_0x360086,_0x10624f,_0x1f2727){var _0x28042e=_0x1627a7['models'];var _0x418c92=_0x360086['get']({'plain':!![]});if(!_0x418c92[_0xbfa5('0x14')]){logger['error'](_0xbfa5('0x33')+_0x418c92['id']);return _0x1f2727();}if(!_0x418c92[_0xbfa5('0x13')]){return _0x1f2727();}return createHopperForVoiceQueues(_0x28042e,_0x418c92)[_0xbfa5('0xf')](function(){return createHopperBlackForVoiceQueues(_0x28042e,_0x418c92);})[_0xbfa5('0xf')](function(){return createHopperForCampaigns(_0x28042e,_0x418c92);})['then'](function(){return createHopperBlackForCampaigns(_0x28042e,_0x418c92);})['then'](function(){return _0x1f2727();})[_0xbfa5('0x34')](function(_0x37fd78){logger['error'](_0xbfa5('0x35'),_0x37fd78['message']);_0x1f2727();});},'afterDestroy':function(_0x1f47ba,_0x2642d7,_0x21b338){var _0x2541a1=_0x1627a7['models'];var _0x47b214=_0x1f47ba[_0xbfa5('0x36')]({'plain':!![]});return _0x2541a1[_0xbfa5('0x18')][_0xbfa5('0x21')]({'raw':!![],'where':{'ListId':_0x47b214[_0xbfa5('0x14')],'ContactId':_0x47b214['id']}})['then'](function(_0x121569){if(!_[_0xbfa5('0x37')](_0x121569)){var _0x3a39f9=[];for(var _0x25d872=0x0;_0x25d872<_0x121569[_0xbfa5('0x38')];_0x25d872+=0x1){var _0x22f148=_0x2541a1[_0xbfa5('0x18')][_0xbfa5('0x39')]({'where':{'ListId':_0x121569[_0x25d872]['ListId'],'ContactId':_0x121569[_0x25d872][_0xbfa5('0x3a')],'VoiceQueueId':_0x121569[_0x25d872]['VoiceQueueId'],'CampaignId':_0x121569[_0x25d872][_0xbfa5('0x1c')]}});_0x3a39f9[_0xbfa5('0x3b')](_0x22f148);}return Promise['all'](_0x3a39f9);}})[_0xbfa5('0xf')](function(_0x19d080){logger[_0xbfa5('0x3c')]('[CmContact][afterDestroy][Succesfull]',util[_0xbfa5('0x3d')](_0x19d080,{'showHidden':![],'depth':null}));_0x21b338();})[_0xbfa5('0x34')](function(_0xf47bc0){logger[_0xbfa5('0x3e')](_0xbfa5('0x3f'),util[_0xbfa5('0x3d')](_0xf47bc0,{'showHidden':![],'depth':null}));_0x21b338(_0xf47bc0);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 820ea73..ef2b4d3 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x1bc0d4,_0x217089){var _0x2dfd8b=function(_0xe487fd){while(--_0xe487fd){_0x1bc0d4['push'](_0x1bc0d4['shift']());}};_0x2dfd8b(++_0x217089);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 3794d29..cb6a09a 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e0d=['INTEGER','PHONE','sequelize','STRING'];(function(_0xd63313,_0x2cbb99){var _0xa2d17e=function(_0x481d5d){while(--_0x481d5d){_0xd63313['push'](_0xd63313['shift']());}};_0xa2d17e(++_0x2cbb99);}(_0x8e0d,0x82));var _0xd8e0=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x8e0d[_0x54b283];return _0x2462b3;};'use strict';var Sequelize=require(_0xd8e0('0x0'));module['exports']={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0xd8e0('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xd8e0('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xd8e0('0x3')},'OrderBy':{'type':Sequelize[_0xd8e0('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xd8e0('0x1')],'defaultValue':null}}; \ No newline at end of file +var _0x9c44=['PHONE','INTEGER','STRING'];(function(_0x2c2ab3,_0x593de1){var _0x1803f7=function(_0x3480b8){while(--_0x3480b8){_0x2c2ab3['push'](_0x2c2ab3['shift']());}};_0x1803f7(++_0x593de1);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var Sequelize=require('sequelize');module['exports']={'CmContactId':{'type':Sequelize[_0x49c4('0x0')],'primaryKey':!![]},'item':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x49c4('0x0')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x2')},'OrderBy':{'type':Sequelize[_0x49c4('0x0')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 4a24b1a..aa4836e 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf01=['map','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filter','merge','options','includeAll','include','findAll','params','keys','rawAttributes','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','offset','undefined','count','reject','save','update','destroy','get','CmContactHasItems','UserProfileResource','then','sendStatus','error','stack','send','CmContactHasItem','fieldName','type','key','model'];(function(_0x4aa2c5,_0x40ec93){var _0x1d5c57=function(_0x13a9b4){while(--_0x13a9b4){_0x4aa2c5['push'](_0x4aa2c5['shift']());}};_0x1d5c57(++_0x40ec93);}(_0xbf01,0x6a));var _0x1bf0=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0xbf01[_0x204ad4];return _0x50675f;};'use strict';var emlformat=require(_0x1bf0('0x0'));var rimraf=require(_0x1bf0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1bf0('0x2'));var rp=require('request-promise');var moment=require(_0x1bf0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1bf0('0x4'));var util=require('util');var path=require(_0x1bf0('0x5'));var sox=require(_0x1bf0('0x6'));var csv=require(_0x1bf0('0x7'));var ejs=require(_0x1bf0('0x8'));var fs=require('fs');var fs_extra=require(_0x1bf0('0x9'));var _=require(_0x1bf0('0xa'));var squel=require(_0x1bf0('0xb'));var crypto=require(_0x1bf0('0xc'));var jsforce=require(_0x1bf0('0xd'));var deskjs=require(_0x1bf0('0xe'));var toCsv=require(_0x1bf0('0x7'));var querystring=require(_0x1bf0('0xf'));var Papa=require(_0x1bf0('0x10'));var Redis=require(_0x1bf0('0x11'));var authService=require(_0x1bf0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1bf0('0x13'));var hardwareService=require(_0x1bf0('0x14'));var logger=require('../../config/logger')(_0x1bf0('0x15'));var utils=require(_0x1bf0('0x16'));var config=require(_0x1bf0('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d7912,_0x484e83){_0x484e83=_0x484e83||0xcc;return function(_0x295062){if(_0x295062){return _0x4d7912['sendStatus'](_0x484e83);}return _0x4d7912[_0x1bf0('0x18')](_0x484e83)[_0x1bf0('0x19')]();};}function respondWithResult(_0x4c63fd,_0x20d3cd){_0x20d3cd=_0x20d3cd||0xc8;return function(_0xfd8d66){if(_0xfd8d66){return _0x4c63fd[_0x1bf0('0x18')](_0x20d3cd)['json'](_0xfd8d66);}};}function respondWithFilteredResult(_0x1b0ad2,_0x160e2f){return function(_0xa50ec9){if(_0xa50ec9){var _0x5e11dd=typeof _0x160e2f[_0x1bf0('0x1a')]===_0x1bf0('0x1b')&&typeof _0x160e2f['limit']===_0x1bf0('0x1b');var _0x3b23ae=_0xa50ec9[_0x1bf0('0x1c')];var _0xb38efd=_0x5e11dd?0x0:_0x160e2f[_0x1bf0('0x1a')];var _0x3d282b=_0x5e11dd?_0xa50ec9['count']:_0x160e2f[_0x1bf0('0x1a')]+_0x160e2f['limit'];var _0x900673;if(_0x3d282b>=_0x3b23ae){_0x3d282b=_0x3b23ae;_0x900673=0xc8;}else{_0x900673=0xce;}_0x1b0ad2['status'](_0x900673);return _0x1b0ad2['set']('Content-Range',_0xb38efd+'-'+_0x3d282b+'/'+_0x3b23ae)['json'](_0xa50ec9);}return null;};}function patchUpdates(_0x53021d){return function(_0x168cbd){try{jsonpatch['apply'](_0x168cbd,_0x53021d,!![]);}catch(_0x28896b){return BPromise[_0x1bf0('0x1d')](_0x28896b);}return _0x168cbd[_0x1bf0('0x1e')]();};}function saveUpdates(_0x320cbb,_0x26eecd){return function(_0x5c06cf){if(_0x5c06cf){return _0x5c06cf[_0x1bf0('0x1f')](_0x320cbb)['then'](function(_0x5d644d){return _0x5d644d;});}return null;};}function removeEntity(_0x5a3d64,_0x20f10f){return function(_0x302899){if(_0x302899){return _0x302899[_0x1bf0('0x20')]()['then'](function(){var _0x2330af=_0x302899[_0x1bf0('0x21')]({'plain':!![]});var _0x3b21c1=_0x1bf0('0x22');return db[_0x1bf0('0x23')]['destroy']({'where':{'type':_0x3b21c1,'resourceId':_0x2330af['id']}})[_0x1bf0('0x24')](function(){return _0x302899;});})['then'](function(){_0x5a3d64[_0x1bf0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43a7ac,_0xee8606){return function(_0x1ea746){if(!_0x1ea746){_0x43a7ac[_0x1bf0('0x25')](0x194);}return _0x1ea746;};}function handleError(_0x41acd8,_0x38b3f7){_0x38b3f7=_0x38b3f7||0x1f4;return function(_0x28e8dd){logger[_0x1bf0('0x26')](_0x28e8dd[_0x1bf0('0x27')]);if(_0x28e8dd['name']){delete _0x28e8dd['name'];}_0x41acd8[_0x1bf0('0x18')](_0x38b3f7)[_0x1bf0('0x28')](_0x28e8dd);};}exports['index']=function(_0x117d1b,_0x572da6){var _0x4a93a3={},_0x4c3b5d={},_0x48caf2={'count':0x0,'rows':[]};var _0x57946e=_['map'](db[_0x1bf0('0x29')]['rawAttributes'],function(_0x16560e){return{'name':_0x16560e[_0x1bf0('0x2a')],'type':_0x16560e[_0x1bf0('0x2b')][_0x1bf0('0x2c')]};});_0x4c3b5d[_0x1bf0('0x2d')]=_[_0x1bf0('0x2e')](_0x57946e,_0x1bf0('0x2f'));_0x4c3b5d[_0x1bf0('0x30')]=_['keys'](_0x117d1b[_0x1bf0('0x30')]);_0x4c3b5d[_0x1bf0('0x31')]=_[_0x1bf0('0x32')](_0x4c3b5d[_0x1bf0('0x2d')],_0x4c3b5d[_0x1bf0('0x30')]);_0x4a93a3[_0x1bf0('0x33')]=_['intersection'](_0x4c3b5d[_0x1bf0('0x2d')],qs['fields'](_0x117d1b[_0x1bf0('0x30')][_0x1bf0('0x34')]));_0x4a93a3[_0x1bf0('0x33')]=_0x4a93a3[_0x1bf0('0x33')]['length']?_0x4a93a3[_0x1bf0('0x33')]:_0x4c3b5d[_0x1bf0('0x2d')];if(!_0x117d1b['query'][_0x1bf0('0x35')](_0x1bf0('0x36'))){_0x4a93a3['limit']=qs[_0x1bf0('0x37')](_0x117d1b['query']['limit']);_0x4a93a3['offset']=qs['offset'](_0x117d1b['query']['offset']);}_0x4a93a3['order']=qs[_0x1bf0('0x38')](_0x117d1b['query'][_0x1bf0('0x38')]);_0x4a93a3[_0x1bf0('0x39')]=qs['filters'](_['pick'](_0x117d1b[_0x1bf0('0x30')],_0x4c3b5d[_0x1bf0('0x31')]),_0x57946e);if(_0x117d1b[_0x1bf0('0x30')][_0x1bf0('0x3a')]){_0x4a93a3['where']=_['merge'](_0x4a93a3[_0x1bf0('0x39')],{'$or':_[_0x1bf0('0x2e')](_0x57946e,function(_0x551ef2){if(_0x551ef2[_0x1bf0('0x2b')]!=='VIRTUAL'){var _0x2169c1={};_0x2169c1[_0x551ef2[_0x1bf0('0x2f')]]={'$like':'%'+_0x117d1b[_0x1bf0('0x30')][_0x1bf0('0x3a')]+'%'};return _0x2169c1;}})});}_0x4a93a3=_[_0x1bf0('0x3b')]({},_0x4a93a3,_0x117d1b[_0x1bf0('0x3c')]);var _0x36c24f={'where':_0x4a93a3[_0x1bf0('0x39')]};return db[_0x1bf0('0x29')][_0x1bf0('0x1c')](_0x36c24f)[_0x1bf0('0x24')](function(_0x392761){_0x48caf2['count']=_0x392761;if(_0x117d1b[_0x1bf0('0x30')][_0x1bf0('0x3d')]){_0x4a93a3[_0x1bf0('0x3e')]=[{'all':!![]}];}return db[_0x1bf0('0x29')][_0x1bf0('0x3f')](_0x4a93a3);})[_0x1bf0('0x24')](function(_0xa312bb){_0x48caf2['rows']=_0xa312bb;return _0x48caf2;})[_0x1bf0('0x24')](respondWithFilteredResult(_0x572da6,_0x4a93a3))['catch'](handleError(_0x572da6,null));};exports['show']=function(_0x2c277b,_0x4909ac){var _0x2a1567={'raw':!![],'where':{'id':_0x2c277b[_0x1bf0('0x40')]['id']}},_0x8c2115={};_0x8c2115['model']=_[_0x1bf0('0x41')](db[_0x1bf0('0x29')][_0x1bf0('0x42')]);_0x8c2115[_0x1bf0('0x30')]=_['keys'](_0x2c277b[_0x1bf0('0x30')]);_0x8c2115[_0x1bf0('0x31')]=_['intersection'](_0x8c2115[_0x1bf0('0x2d')],_0x8c2115[_0x1bf0('0x30')]);_0x2a1567[_0x1bf0('0x33')]=_[_0x1bf0('0x32')](_0x8c2115['model'],qs[_0x1bf0('0x34')](_0x2c277b[_0x1bf0('0x30')][_0x1bf0('0x34')]));_0x2a1567['attributes']=_0x2a1567[_0x1bf0('0x33')]['length']?_0x2a1567[_0x1bf0('0x33')]:_0x8c2115[_0x1bf0('0x2d')];if(_0x2c277b[_0x1bf0('0x30')][_0x1bf0('0x3d')]){_0x2a1567[_0x1bf0('0x3e')]=[{'all':!![]}];}_0x2a1567=_[_0x1bf0('0x3b')]({},_0x2a1567,_0x2c277b['options']);return db[_0x1bf0('0x29')][_0x1bf0('0x43')](_0x2a1567)[_0x1bf0('0x24')](handleEntityNotFound(_0x4909ac,null))[_0x1bf0('0x24')](respondWithResult(_0x4909ac,null))[_0x1bf0('0x44')](handleError(_0x4909ac,null));};exports[_0x1bf0('0x45')]=function(_0x14e3e5,_0x10c0c4){return db[_0x1bf0('0x29')]['create'](_0x14e3e5['body'],{})['then'](function(_0x866eb1){var _0x5f4fb3=_0x14e3e5[_0x1bf0('0x46')][_0x1bf0('0x21')]({'plain':!![]});if(!_0x5f4fb3)throw new Error(_0x1bf0('0x47'));if(_0x5f4fb3[_0x1bf0('0x48')]==='user'){var _0xddc932=_0x866eb1[_0x1bf0('0x21')]({'plain':!![]});var _0x236f0e=_0x1bf0('0x22');return db['UserProfileSection'][_0x1bf0('0x43')]({'where':{'name':_0x236f0e,'userProfileId':_0x5f4fb3['userProfileId']},'raw':!![]})['then'](function(_0x3e2b08){if(_0x3e2b08&&_0x3e2b08[_0x1bf0('0x49')]===0x0){return db[_0x1bf0('0x23')]['create']({'name':_0xddc932[_0x1bf0('0x2f')],'resourceId':_0xddc932['id'],'type':_0x3e2b08[_0x1bf0('0x2f')],'sectionId':_0x3e2b08['id']},{})[_0x1bf0('0x24')](function(){return _0x866eb1;});}else{return _0x866eb1;}})[_0x1bf0('0x44')](function(_0x47951c){logger[_0x1bf0('0x26')](_0x1bf0('0x4a'),_0x47951c);throw _0x47951c;});}return _0x866eb1;})[_0x1bf0('0x24')](respondWithResult(_0x10c0c4,0xc9))[_0x1bf0('0x44')](handleError(_0x10c0c4,null));};exports[_0x1bf0('0x1f')]=function(_0x8c7067,_0x483d2d){if(_0x8c7067[_0x1bf0('0x4b')]['id']){delete _0x8c7067[_0x1bf0('0x4b')]['id'];}return db['CmContactHasItem'][_0x1bf0('0x43')]({'where':{'id':_0x8c7067[_0x1bf0('0x40')]['id']}})[_0x1bf0('0x24')](handleEntityNotFound(_0x483d2d,null))[_0x1bf0('0x24')](saveUpdates(_0x8c7067['body'],null))[_0x1bf0('0x24')](respondWithResult(_0x483d2d,null))[_0x1bf0('0x44')](handleError(_0x483d2d,null));};exports[_0x1bf0('0x20')]=function(_0x2be9d6,_0x543d9d){return db[_0x1bf0('0x29')][_0x1bf0('0x43')]({'where':{'id':_0x2be9d6['params']['id']}})[_0x1bf0('0x24')](handleEntityNotFound(_0x543d9d,null))[_0x1bf0('0x24')](removeEntity(_0x543d9d,null))[_0x1bf0('0x44')](handleError(_0x543d9d,null));}; \ No newline at end of file +var _0xeebc=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','CmContactHasItems','UserProfileResource','stack','name','send','CmContactHasItem','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x38f3e9,_0x53ce92){var _0xe8ee0a=function(_0x1280cf){while(--_0x1280cf){_0x38f3e9['push'](_0x38f3e9['shift']());}};_0xe8ee0a(++_0x53ce92);}(_0xeebc,0xe3));var _0xceeb=function(_0x5656bc,_0x3585b6){_0x5656bc=_0x5656bc-0x0;var _0x6e5f64=_0xeebc[_0x5656bc];return _0x6e5f64;};'use strict';var emlformat=require(_0xceeb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xceeb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xceeb('0x2'));var moment=require(_0xceeb('0x3'));var BPromise=require(_0xceeb('0x4'));var Mustache=require('mustache');var util=require(_0xceeb('0x5'));var path=require(_0xceeb('0x6'));var sox=require('sox');var csv=require(_0xceeb('0x7'));var ejs=require(_0xceeb('0x8'));var fs=require('fs');var fs_extra=require(_0xceeb('0x9'));var _=require('lodash');var squel=require(_0xceeb('0xa'));var crypto=require('crypto');var jsforce=require(_0xceeb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xceeb('0x7'));var querystring=require(_0xceeb('0xc'));var Papa=require(_0xceeb('0xd'));var Redis=require(_0xceeb('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xceeb('0xf'));var as=require(_0xceeb('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xceeb('0x11'))(_0xceeb('0x12'));var utils=require(_0xceeb('0x13'));var config=require(_0xceeb('0x14'));var licenseUtil=require(_0xceeb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41cd4a,_0x111308){_0x111308=_0x111308||0xcc;return function(_0x10ac9d){if(_0x10ac9d){return _0x41cd4a[_0xceeb('0x16')](_0x111308);}return _0x41cd4a[_0xceeb('0x17')](_0x111308)[_0xceeb('0x18')]();};}function respondWithResult(_0x57e85d,_0x34d8a1){_0x34d8a1=_0x34d8a1||0xc8;return function(_0x3240bf){if(_0x3240bf){return _0x57e85d[_0xceeb('0x17')](_0x34d8a1)['json'](_0x3240bf);}};}function respondWithFilteredResult(_0x1795f7,_0x2c5e76){return function(_0x485842){if(_0x485842){var _0x18f48e=typeof _0x2c5e76[_0xceeb('0x19')]===_0xceeb('0x1a')&&typeof _0x2c5e76['limit']===_0xceeb('0x1a');var _0xcbae8b=_0x485842[_0xceeb('0x1b')];var _0x1ac05d=_0x18f48e?0x0:_0x2c5e76[_0xceeb('0x19')];var _0x432732=_0x18f48e?_0x485842[_0xceeb('0x1b')]:_0x2c5e76[_0xceeb('0x19')]+_0x2c5e76[_0xceeb('0x1c')];var _0x4ab41f;if(_0x432732>=_0xcbae8b){_0x432732=_0xcbae8b;_0x4ab41f=0xc8;}else{_0x4ab41f=0xce;}_0x1795f7[_0xceeb('0x17')](_0x4ab41f);return _0x1795f7[_0xceeb('0x1d')](_0xceeb('0x1e'),_0x1ac05d+'-'+_0x432732+'/'+_0xcbae8b)[_0xceeb('0x1f')](_0x485842);}return null;};}function patchUpdates(_0x155fc8){return function(_0x5e1df0){try{jsonpatch[_0xceeb('0x20')](_0x5e1df0,_0x155fc8,!![]);}catch(_0x4b170e){return BPromise[_0xceeb('0x21')](_0x4b170e);}return _0x5e1df0[_0xceeb('0x22')]();};}function saveUpdates(_0x37c50d,_0x4d196c){return function(_0x12cf62){if(_0x12cf62){return _0x12cf62[_0xceeb('0x23')](_0x37c50d)['then'](function(_0x2d87c7){return _0x2d87c7;});}return null;};}function removeEntity(_0x6df4c0,_0x2b9307){return function(_0x3a036a){if(_0x3a036a){return _0x3a036a[_0xceeb('0x24')]()[_0xceeb('0x25')](function(){var _0x149c61=_0x3a036a[_0xceeb('0x26')]({'plain':!![]});var _0x589052=_0xceeb('0x27');return db[_0xceeb('0x28')][_0xceeb('0x24')]({'where':{'type':_0x589052,'resourceId':_0x149c61['id']}})[_0xceeb('0x25')](function(){return _0x3a036a;});})[_0xceeb('0x25')](function(){_0x6df4c0[_0xceeb('0x17')](0xcc)[_0xceeb('0x18')]();});}};}function handleEntityNotFound(_0x2e8690,_0x3e01a5){return function(_0x5dea68){if(!_0x5dea68){_0x2e8690['sendStatus'](0x194);}return _0x5dea68;};}function handleError(_0x6a4b81,_0x4fed31){_0x4fed31=_0x4fed31||0x1f4;return function(_0x5d0b89){logger['error'](_0x5d0b89[_0xceeb('0x29')]);if(_0x5d0b89['name']){delete _0x5d0b89[_0xceeb('0x2a')];}_0x6a4b81['status'](_0x4fed31)[_0xceeb('0x2b')](_0x5d0b89);};}exports['index']=function(_0xf98820,_0x3fa596){var _0x4b3ec6={},_0x42c6dc={},_0x71702d={'count':0x0,'rows':[]};var _0x218ca5=_['map'](db[_0xceeb('0x2c')][_0xceeb('0x2d')],function(_0x112075){return{'name':_0x112075['fieldName'],'type':_0x112075[_0xceeb('0x2e')][_0xceeb('0x2f')]};});_0x42c6dc[_0xceeb('0x30')]=_['map'](_0x218ca5,_0xceeb('0x2a'));_0x42c6dc[_0xceeb('0x31')]=_[_0xceeb('0x32')](_0xf98820[_0xceeb('0x31')]);_0x42c6dc[_0xceeb('0x33')]=_['intersection'](_0x42c6dc[_0xceeb('0x30')],_0x42c6dc['query']);_0x4b3ec6[_0xceeb('0x34')]=_[_0xceeb('0x35')](_0x42c6dc[_0xceeb('0x30')],qs['fields'](_0xf98820[_0xceeb('0x31')][_0xceeb('0x36')]));_0x4b3ec6[_0xceeb('0x34')]=_0x4b3ec6[_0xceeb('0x34')][_0xceeb('0x37')]?_0x4b3ec6[_0xceeb('0x34')]:_0x42c6dc['model'];if(!_0xf98820[_0xceeb('0x31')][_0xceeb('0x38')](_0xceeb('0x39'))){_0x4b3ec6[_0xceeb('0x1c')]=qs[_0xceeb('0x1c')](_0xf98820[_0xceeb('0x31')][_0xceeb('0x1c')]);_0x4b3ec6[_0xceeb('0x19')]=qs[_0xceeb('0x19')](_0xf98820[_0xceeb('0x31')][_0xceeb('0x19')]);}_0x4b3ec6[_0xceeb('0x3a')]=qs['sort'](_0xf98820[_0xceeb('0x31')]['sort']);_0x4b3ec6[_0xceeb('0x3b')]=qs[_0xceeb('0x33')](_[_0xceeb('0x3c')](_0xf98820['query'],_0x42c6dc[_0xceeb('0x33')]),_0x218ca5);if(_0xf98820[_0xceeb('0x31')][_0xceeb('0x3d')]){_0x4b3ec6[_0xceeb('0x3b')]=_[_0xceeb('0x3e')](_0x4b3ec6[_0xceeb('0x3b')],{'$or':_[_0xceeb('0x3f')](_0x218ca5,function(_0x1306ef){if(_0x1306ef[_0xceeb('0x2e')]!=='VIRTUAL'){var _0x39a272={};_0x39a272[_0x1306ef[_0xceeb('0x2a')]]={'$like':'%'+_0xf98820[_0xceeb('0x31')]['filter']+'%'};return _0x39a272;}})});}_0x4b3ec6=_[_0xceeb('0x3e')]({},_0x4b3ec6,_0xf98820[_0xceeb('0x40')]);var _0x43d44e={'where':_0x4b3ec6[_0xceeb('0x3b')]};return db[_0xceeb('0x2c')][_0xceeb('0x1b')](_0x43d44e)[_0xceeb('0x25')](function(_0x3d42c9){_0x71702d[_0xceeb('0x1b')]=_0x3d42c9;if(_0xf98820[_0xceeb('0x31')][_0xceeb('0x41')]){_0x4b3ec6[_0xceeb('0x42')]=[{'all':!![]}];}return db[_0xceeb('0x2c')]['findAll'](_0x4b3ec6);})['then'](function(_0x4835d1){_0x71702d[_0xceeb('0x43')]=_0x4835d1;return _0x71702d;})[_0xceeb('0x25')](respondWithFilteredResult(_0x3fa596,_0x4b3ec6))[_0xceeb('0x44')](handleError(_0x3fa596,null));};exports[_0xceeb('0x45')]=function(_0x41533f,_0x84be42){var _0x5db07c={'raw':!![],'where':{'id':_0x41533f[_0xceeb('0x46')]['id']}},_0x2549be={};_0x2549be[_0xceeb('0x30')]=_[_0xceeb('0x32')](db['CmContactHasItem'][_0xceeb('0x2d')]);_0x2549be[_0xceeb('0x31')]=_[_0xceeb('0x32')](_0x41533f[_0xceeb('0x31')]);_0x2549be[_0xceeb('0x33')]=_['intersection'](_0x2549be['model'],_0x2549be['query']);_0x5db07c[_0xceeb('0x34')]=_[_0xceeb('0x35')](_0x2549be['model'],qs[_0xceeb('0x36')](_0x41533f[_0xceeb('0x31')][_0xceeb('0x36')]));_0x5db07c['attributes']=_0x5db07c[_0xceeb('0x34')]['length']?_0x5db07c[_0xceeb('0x34')]:_0x2549be[_0xceeb('0x30')];if(_0x41533f[_0xceeb('0x31')]['includeAll']){_0x5db07c[_0xceeb('0x42')]=[{'all':!![]}];}_0x5db07c=_[_0xceeb('0x3e')]({},_0x5db07c,_0x41533f[_0xceeb('0x40')]);return db[_0xceeb('0x2c')][_0xceeb('0x47')](_0x5db07c)[_0xceeb('0x25')](handleEntityNotFound(_0x84be42,null))[_0xceeb('0x25')](respondWithResult(_0x84be42,null))[_0xceeb('0x44')](handleError(_0x84be42,null));};exports[_0xceeb('0x48')]=function(_0x1aade1,_0x1d5769){return db[_0xceeb('0x2c')]['create'](_0x1aade1[_0xceeb('0x49')],{})['then'](function(_0x5c517f){var _0x11b7fb=_0x1aade1['user'][_0xceeb('0x26')]({'plain':!![]});if(!_0x11b7fb)throw new Error(_0xceeb('0x4a'));if(_0x11b7fb[_0xceeb('0x4b')]===_0xceeb('0x4c')){var _0x29468c=_0x5c517f[_0xceeb('0x26')]({'plain':!![]});var _0x4ef556='CmContactHasItems';return db[_0xceeb('0x4d')][_0xceeb('0x47')]({'where':{'name':_0x4ef556,'userProfileId':_0x11b7fb[_0xceeb('0x4e')]},'raw':!![]})['then'](function(_0x2fdaca){if(_0x2fdaca&&_0x2fdaca[_0xceeb('0x4f')]===0x0){return db[_0xceeb('0x28')][_0xceeb('0x48')]({'name':_0x29468c[_0xceeb('0x2a')],'resourceId':_0x29468c['id'],'type':_0x2fdaca[_0xceeb('0x2a')],'sectionId':_0x2fdaca['id']},{})['then'](function(){return _0x5c517f;});}else{return _0x5c517f;}})[_0xceeb('0x44')](function(_0x331a92){logger[_0xceeb('0x50')](_0xceeb('0x51'),_0x331a92);throw _0x331a92;});}return _0x5c517f;})[_0xceeb('0x25')](respondWithResult(_0x1d5769,0xc9))[_0xceeb('0x44')](handleError(_0x1d5769,null));};exports[_0xceeb('0x23')]=function(_0x203750,_0x574a85){if(_0x203750['body']['id']){delete _0x203750['body']['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x203750[_0xceeb('0x46')]['id']}})[_0xceeb('0x25')](handleEntityNotFound(_0x574a85,null))[_0xceeb('0x25')](saveUpdates(_0x203750[_0xceeb('0x49')],null))['then'](respondWithResult(_0x574a85,null))[_0xceeb('0x44')](handleError(_0x574a85,null));};exports[_0xceeb('0x24')]=function(_0x21f336,_0x41036c){return db['CmContactHasItem'][_0xceeb('0x47')]({'where':{'id':_0x21f336[_0xceeb('0x46')]['id']}})['then'](handleEntityNotFound(_0x41036c,null))[_0xceeb('0x25')](removeEntity(_0x41036c,null))[_0xceeb('0x44')](handleError(_0x41036c,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index a818c40..f044852 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x678a=['request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','define','CmContactHasItem','cm_contact_has_items','util','api','moment','bluebird'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0x678a,0x98));var _0xa678=function(_0x3351f0,_0x7b3fbe){_0x3351f0=_0x3351f0-0x0;var _0x56228b=_0x678a[_0x3351f0];return _0x56228b;};'use strict';var _=require('lodash');var util=require(_0xa678('0x0'));var logger=require('../../config/logger')(_0xa678('0x1'));var moment=require(_0xa678('0x2'));var BPromise=require(_0xa678('0x3'));var rp=require(_0xa678('0x4'));var fs=require('fs');var path=require(_0xa678('0x5'));var rimraf=require(_0xa678('0x6'));var config=require(_0xa678('0x7'));var attributes=require(_0xa678('0x8'));module['exports']=function(_0x4ea6a9,_0x1d08ae){return _0x4ea6a9[_0xa678('0x9')](_0xa678('0xa'),attributes,{'tableName':_0xa678('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d9e=['define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0x3d9e,0x155));var _0xe3d9=function(_0x45b1ba,_0x5a6a21){_0x45b1ba=_0x45b1ba-0x0;var _0x145ddb=_0x3d9e[_0x45b1ba];return _0x145ddb;};'use strict';var _=require(_0xe3d9('0x0'));var util=require(_0xe3d9('0x1'));var logger=require(_0xe3d9('0x2'))(_0xe3d9('0x3'));var moment=require(_0xe3d9('0x4'));var BPromise=require(_0xe3d9('0x5'));var rp=require(_0xe3d9('0x6'));var fs=require('fs');var path=require(_0xe3d9('0x7'));var rimraf=require(_0xe3d9('0x8'));var config=require(_0xe3d9('0x9'));var attributes=require('./cmContactHasItem.attributes');module['exports']=function(_0x9f5b38,_0x3425e5){return _0x9f5b38[_0xe3d9('0xa')](_0xe3d9('0xb'),attributes,{'tableName':_0xe3d9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 240cf2e..3b65ee8 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf267=['request\x20sent','stringify','error','code','message','CmContactHasItem,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','http','request','then','info'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xf267,0x1da));var _0x7f26=function(_0x599d4a,_0x31fb20){_0x599d4a=_0x599d4a-0x0;var _0x576bc3=_0xf267[_0x599d4a];return _0x576bc3;};'use strict';var _=require(_0x7f26('0x0'));var util=require(_0x7f26('0x1'));var moment=require(_0x7f26('0x2'));var BPromise=require(_0x7f26('0x3'));var rs=require(_0x7f26('0x4'));var fs=require('fs');var Redis=require(_0x7f26('0x5'));var db=require(_0x7f26('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f26('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7f26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14066e,_0x10a088,_0x3a203f){return new BPromise(function(_0x5ee0fe,_0x4238fc){return client[_0x7f26('0x9')](_0x14066e,_0x3a203f)[_0x7f26('0xa')](function(_0x219512){logger[_0x7f26('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x10a088,'request\x20sent');logger['debug']('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x10a088,_0x7f26('0xc'),JSON[_0x7f26('0xd')](_0x219512));if(_0x219512[_0x7f26('0xe')]){if(_0x219512[_0x7f26('0xe')][_0x7f26('0xf')]===0x1f4){logger[_0x7f26('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x10a088,_0x219512[_0x7f26('0xe')]['message']);return _0x4238fc(_0x219512[_0x7f26('0xe')][_0x7f26('0x10')]);}logger[_0x7f26('0xe')](_0x7f26('0x11'),_0x10a088,_0x219512[_0x7f26('0xe')][_0x7f26('0x10')]);return _0x5ee0fe(_0x219512[_0x7f26('0xe')][_0x7f26('0x10')]);}else{logger[_0x7f26('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x10a088,_0x7f26('0xc'));_0x5ee0fe(_0x219512['result'][_0x7f26('0x10')]);}})['catch'](function(_0x41b588){logger[_0x7f26('0xe')](_0x7f26('0x11'),_0x10a088,_0x41b588);_0x4238fc(_0x41b588);});});} \ No newline at end of file +var _0xfb5c=['message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xfb5c,0x1a0));var _0xcfb5=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0xfb5c[_0x567bcb];return _0x4eebc2;};'use strict';var _=require('lodash');var util=require(_0xcfb5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcfb5('0x1'));var fs=require('fs');var Redis=require(_0xcfb5('0x2'));var db=require(_0xcfb5('0x3'))['db'];var utils=require(_0xcfb5('0x4'));var logger=require('../../config/logger')(_0xcfb5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcfb5('0x6')][_0xcfb5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2db0e1,_0x364874,_0x152a7c){return new BPromise(function(_0x30f248,_0x2f4297){return client['request'](_0x2db0e1,_0x152a7c)[_0xcfb5('0x8')](function(_0x1e82f6){logger['info'](_0xcfb5('0x9'),_0x364874,_0xcfb5('0xa'));logger[_0xcfb5('0xb')](_0xcfb5('0xc'),_0x364874,'request\x20sent',JSON[_0xcfb5('0xd')](_0x1e82f6));if(_0x1e82f6['error']){if(_0x1e82f6[_0xcfb5('0xe')][_0xcfb5('0xf')]===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x364874,_0x1e82f6[_0xcfb5('0xe')][_0xcfb5('0x10')]);return _0x2f4297(_0x1e82f6[_0xcfb5('0xe')][_0xcfb5('0x10')]);}logger[_0xcfb5('0xe')](_0xcfb5('0x9'),_0x364874,_0x1e82f6[_0xcfb5('0xe')][_0xcfb5('0x10')]);return _0x30f248(_0x1e82f6[_0xcfb5('0xe')]['message']);}else{logger['info'](_0xcfb5('0x9'),_0x364874,'request\x20sent');_0x30f248(_0x1e82f6['result'][_0xcfb5('0x10')]);}})[_0xcfb5('0x11')](function(_0x35bee8){logger['error'](_0xcfb5('0x9'),_0x364874,_0x35bee8);_0x2f4297(_0x35bee8);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 5ef6e7f..dded1ef 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2b7=['post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','/:id'];(function(_0x4d504f,_0x34477c){var _0x2a56c7=function(_0x301980){while(--_0x301980){_0x4d504f['push'](_0x4d504f['shift']());}};_0x2a56c7(++_0x34477c);}(_0xb2b7,0x1ae));var _0x7b2b=function(_0xf3cd6e,_0x447313){_0xf3cd6e=_0xf3cd6e-0x0;var _0x2ef3dd=_0xb2b7[_0xf3cd6e];return _0x2ef3dd;};'use strict';var multer=require(_0x7b2b('0x0'));var util=require(_0x7b2b('0x1'));var path=require(_0x7b2b('0x2'));var timeout=require(_0x7b2b('0x3'));var express=require(_0x7b2b('0x4'));var router=express[_0x7b2b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7b2b('0x6'));var config=require(_0x7b2b('0x7'));var controller=require(_0x7b2b('0x8'));router[_0x7b2b('0x9')]('/',auth[_0x7b2b('0xa')](),controller['index']);router[_0x7b2b('0x9')](_0x7b2b('0xb'),auth[_0x7b2b('0xa')](),controller['show']);router[_0x7b2b('0xc')]('/',auth[_0x7b2b('0xa')](),controller[_0x7b2b('0xd')]);router[_0x7b2b('0xe')](_0x7b2b('0xb'),auth['isAuthenticated'](),controller[_0x7b2b('0xf')]);router[_0x7b2b('0x10')](_0x7b2b('0xb'),auth[_0x7b2b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd60e=['get','isAuthenticated','create','put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','index'];(function(_0x522ca0,_0xe760f4){var _0x3c0e44=function(_0x156713){while(--_0x156713){_0x522ca0['push'](_0x522ca0['shift']());}};_0x3c0e44(++_0xe760f4);}(_0xd60e,0x18e));var _0xed60=function(_0x74c8cd,_0x3827db){_0x74c8cd=_0x74c8cd-0x0;var _0xd562a4=_0xd60e[_0x74c8cd];return _0xd562a4;};'use strict';var multer=require(_0xed60('0x0'));var util=require('util');var path=require(_0xed60('0x1'));var timeout=require('connect-timeout');var express=require(_0xed60('0x2'));var router=express[_0xed60('0x3')]();var fs_extra=require(_0xed60('0x4'));var auth=require(_0xed60('0x5'));var interaction=require(_0xed60('0x6'));var config=require(_0xed60('0x7'));var controller=require(_0xed60('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xed60('0x9')]);router[_0xed60('0xa')]('/:id',auth[_0xed60('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xed60('0xc')]);router[_0xed60('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xed60('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xed60('0xf')]);module[_0xed60('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 93e6709..4b03ddb 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 _0xad48=['VIRTUAL','getDataValue','alias','setDataValue','name','type','parse','values','BOOLEAN','ENUM','voice','sequelize','lodash','exports'];(function(_0x25340f,_0xd2071e){var _0x16b6d7=function(_0x443cc1){while(--_0x443cc1){_0x25340f['push'](_0x25340f['shift']());}};_0x16b6d7(++_0xd2071e);}(_0xad48,0x1d9));var _0x8ad4=function(_0x3cc5a2,_0x1565fd){_0x3cc5a2=_0x3cc5a2-0x0;var _0x570747=_0xad48[_0x3cc5a2];return _0x570747;};'use strict';var Sequelize=require(_0x8ad4('0x0'));var _=require(_0x8ad4('0x1'));module[_0x8ad4('0x2')]={'name':{'type':Sequelize[_0x8ad4('0x3')],'get':function(_0x783612){return this[_0x8ad4('0x4')](_0x8ad4('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x11a72b){this[_0x8ad4('0x6')](_0x8ad4('0x5'),_0x11a72b?_0x11a72b:this[_0x8ad4('0x4')](_0x8ad4('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this['getDataValue'](_0x8ad4('0x8'))==='select'){return JSON[_0x8ad4('0x9')](this[_0x8ad4('0x4')](_0x8ad4('0xa')));}else{return this[_0x8ad4('0x4')]('values');}},'set':function(_0x4a197c){if(Array['isArray'](_0x4a197c)){this[_0x8ad4('0x6')](_0x8ad4('0xa'),JSON['stringify'](_0x4a197c));}else{this[_0x8ad4('0x6')](_0x8ad4('0xa'),_0x4a197c);}}},'required':{'type':Sequelize[_0x8ad4('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x8ad4('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x8ad4('0xc')](_0x8ad4('0xd'))}}; \ No newline at end of file +var _0x3fba=['select','parse','values','BOOLEAN','ENUM','sequelize','exports','VIRTUAL','getDataValue','alias','STRING','TEXT','long','type'];(function(_0x149fb2,_0x5de2c4){var _0x3aa533=function(_0x51c6a5){while(--_0x51c6a5){_0x149fb2['push'](_0x149fb2['shift']());}};_0x3aa533(++_0x5de2c4);}(_0x3fba,0x1ef));var _0xa3fb=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3fba[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xa3fb('0x0'));var _=require('lodash');module[_0xa3fb('0x1')]={'name':{'type':Sequelize[_0xa3fb('0x2')],'get':function(_0x48ff82){return this[_0xa3fb('0x3')](_0xa3fb('0x4'));}},'alias':{'type':Sequelize[_0xa3fb('0x5')],'allowNull':![],'set':function(_0xc9e676){this['setDataValue'](_0xa3fb('0x4'),_0xc9e676?_0xc9e676:this[_0xa3fb('0x3')]('name'));}},'type':{'type':Sequelize[_0xa3fb('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xa3fb('0x6')](_0xa3fb('0x7')),'get':function(){if(this[_0xa3fb('0x3')](_0xa3fb('0x8'))===_0xa3fb('0x9')){return JSON[_0xa3fb('0xa')](this[_0xa3fb('0x3')]('values'));}else{return this['getDataValue']('values');}},'set':function(_0x15dc02){if(Array['isArray'](_0x15dc02)){this['setDataValue'](_0xa3fb('0xb'),JSON['stringify'](_0x15dc02));}else{this['setDataValue']('values',_0x15dc02);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xa3fb('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xa3fb('0xd')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 9f236c3..9bc62d1 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 _0x7cf5=['model','differenceBy','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','keys','filters','options','find','catch','update','body','sequelize','create','Sequelize','TEXT','text','number','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','error','stack','name','map','CmCustomField','fieldName','key'];(function(_0x5021d1,_0x5c4791){var _0x371a4a=function(_0xddd0d6){while(--_0xddd0d6){_0x5021d1['push'](_0x5021d1['shift']());}};_0x371a4a(++_0x5c4791);}(_0x7cf5,0x12a));var _0x57cf=function(_0x435363,_0x406930){_0x435363=_0x435363-0x0;var _0x484f8e=_0x7cf5[_0x435363];return _0x484f8e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57cf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x57cf('0x1'));var rp=require(_0x57cf('0x2'));var moment=require(_0x57cf('0x3'));var BPromise=require(_0x57cf('0x4'));var Mustache=require(_0x57cf('0x5'));var util=require('util');var path=require('path');var sox=require(_0x57cf('0x6'));var csv=require(_0x57cf('0x7'));var ejs=require(_0x57cf('0x8'));var fs=require('fs');var fs_extra=require(_0x57cf('0x9'));var _=require(_0x57cf('0xa'));var squel=require(_0x57cf('0xb'));var crypto=require(_0x57cf('0xc'));var jsforce=require(_0x57cf('0xd'));var deskjs=require(_0x57cf('0xe'));var toCsv=require(_0x57cf('0x7'));var querystring=require(_0x57cf('0xf'));var Papa=require(_0x57cf('0x10'));var Redis=require(_0x57cf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x57cf('0x12'));var as=require(_0x57cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x57cf('0x14'))(_0x57cf('0x15'));var utils=require(_0x57cf('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x57cf('0x17'));var db=require(_0x57cf('0x18'))['db'];function respondWithStatusCode(_0x36e674,_0x419b35){_0x419b35=_0x419b35||0xcc;return function(_0x192227){if(_0x192227){return _0x36e674[_0x57cf('0x19')](_0x419b35);}return _0x36e674[_0x57cf('0x1a')](_0x419b35)[_0x57cf('0x1b')]();};}function respondWithResult(_0x5510fe,_0xfbf199){_0xfbf199=_0xfbf199||0xc8;return function(_0x520251){if(_0x520251){return _0x5510fe[_0x57cf('0x1a')](_0xfbf199)[_0x57cf('0x1c')](_0x520251);}};}function respondWithFilteredResult(_0x56f4e8,_0x59f65f){return function(_0x3989a0){if(_0x3989a0){var _0x4aef98=typeof _0x59f65f[_0x57cf('0x1d')]===_0x57cf('0x1e')&&typeof _0x59f65f['limit']===_0x57cf('0x1e');var _0x5373c5=_0x3989a0[_0x57cf('0x1f')];var _0x2d12bb=_0x4aef98?0x0:_0x59f65f[_0x57cf('0x1d')];var _0x5087e1=_0x4aef98?_0x3989a0['count']:_0x59f65f[_0x57cf('0x1d')]+_0x59f65f[_0x57cf('0x20')];var _0x4c98e4;if(_0x5087e1>=_0x5373c5){_0x5087e1=_0x5373c5;_0x4c98e4=0xc8;}else{_0x4c98e4=0xce;}_0x56f4e8[_0x57cf('0x1a')](_0x4c98e4);return _0x56f4e8[_0x57cf('0x21')]('Content-Range',_0x2d12bb+'-'+_0x5087e1+'/'+_0x5373c5)['json'](_0x3989a0);}return null;};}function patchUpdates(_0x4ddd97){return function(_0xd42a78){try{jsonpatch[_0x57cf('0x22')](_0xd42a78,_0x4ddd97,!![]);}catch(_0x52815e){return BPromise[_0x57cf('0x23')](_0x52815e);}return _0xd42a78[_0x57cf('0x24')]();};}function saveUpdates(_0x526024,_0x224e6b){return function(_0x3f9cc9){if(_0x3f9cc9){return _0x3f9cc9['update'](_0x526024)[_0x57cf('0x25')](function(_0x34cc80){return _0x34cc80;});}return null;};}function removeEntity(_0x3a3d51,_0x3581f0){return function(_0x1f78e0){if(_0x1f78e0){return _0x1f78e0[_0x57cf('0x26')]()[_0x57cf('0x25')](function(){_0x3a3d51[_0x57cf('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31e940,_0x471c95){return function(_0x1135f7){if(!_0x1135f7){_0x31e940[_0x57cf('0x19')](0x194);}return _0x1135f7;};}function handleError(_0x4dc8a4,_0x25d8a9){_0x25d8a9=_0x25d8a9||0x1f4;return function(_0x2ffc55){logger[_0x57cf('0x27')](_0x2ffc55[_0x57cf('0x28')]);if(_0x2ffc55[_0x57cf('0x29')]){delete _0x2ffc55[_0x57cf('0x29')];}_0x4dc8a4[_0x57cf('0x1a')](_0x25d8a9)['send'](_0x2ffc55);};}exports['index']=function(_0x468244,_0x48e2d5){var _0x1830f7={},_0x3860b9={},_0x40af2d={'count':0x0,'rows':[]};var _0x1d2473=_[_0x57cf('0x2a')](db[_0x57cf('0x2b')]['rawAttributes'],function(_0xa720df){return{'name':_0xa720df[_0x57cf('0x2c')],'type':_0xa720df['type'][_0x57cf('0x2d')]};});_0x3860b9[_0x57cf('0x2e')]=_[_0x57cf('0x2f')](_['map'](_0x1d2473,_0x57cf('0x29')),[_0x57cf('0x29')]);_0x3860b9[_0x57cf('0x30')]=_['keys'](_0x468244[_0x57cf('0x30')]);_0x3860b9['filters']=_[_0x57cf('0x31')](_0x3860b9[_0x57cf('0x2e')],_0x3860b9[_0x57cf('0x30')]);_0x1830f7[_0x57cf('0x32')]=_[_0x57cf('0x31')](_0x3860b9[_0x57cf('0x2e')],qs[_0x57cf('0x33')](_0x468244[_0x57cf('0x30')][_0x57cf('0x33')]));_0x1830f7[_0x57cf('0x32')]=_0x1830f7[_0x57cf('0x32')][_0x57cf('0x34')]?_0x1830f7[_0x57cf('0x32')]:_0x3860b9['model'];if(!_0x468244[_0x57cf('0x30')][_0x57cf('0x35')](_0x57cf('0x36'))){_0x1830f7['limit']=qs['limit'](_0x468244[_0x57cf('0x30')][_0x57cf('0x20')]);_0x1830f7[_0x57cf('0x1d')]=qs['offset'](_0x468244['query'][_0x57cf('0x1d')]);}_0x1830f7[_0x57cf('0x37')]=qs[_0x57cf('0x38')](_0x468244[_0x57cf('0x30')][_0x57cf('0x38')]);_0x1830f7[_0x57cf('0x39')]=qs['filters'](_[_0x57cf('0x3a')](_0x468244[_0x57cf('0x30')],_0x3860b9['filters']),_0x1d2473);if(_0x468244[_0x57cf('0x30')][_0x57cf('0x3b')]){_0x1830f7[_0x57cf('0x39')]=_[_0x57cf('0x3c')](_0x1830f7['where'],{'$or':_[_0x57cf('0x2a')](_0x1d2473,function(_0x1446de){if(_0x1446de[_0x57cf('0x3d')]!==_0x57cf('0x3e')){var _0x40306d={};_0x40306d[_0x1446de['name']]={'$like':'%'+_0x468244[_0x57cf('0x30')][_0x57cf('0x3b')]+'%'};return _0x40306d;}})});}_0x1830f7=_[_0x57cf('0x3c')]({},_0x1830f7,_0x468244['options']);var _0x150702={'where':_0x1830f7[_0x57cf('0x39')]};return db[_0x57cf('0x2b')][_0x57cf('0x1f')](_0x150702)[_0x57cf('0x25')](function(_0x563365){_0x40af2d[_0x57cf('0x1f')]=_0x563365;if(_0x468244[_0x57cf('0x30')][_0x57cf('0x3f')]){_0x1830f7[_0x57cf('0x40')]=[{'all':!![]}];}return db[_0x57cf('0x2b')][_0x57cf('0x41')](_0x1830f7);})[_0x57cf('0x25')](function(_0x49dcd3){_0x40af2d[_0x57cf('0x42')]=_0x49dcd3;return _0x40af2d;})[_0x57cf('0x25')](respondWithFilteredResult(_0x48e2d5,_0x1830f7))['catch'](handleError(_0x48e2d5,null));};exports['show']=function(_0x290cff,_0xfb97ab){var _0x37fc62={'raw':!![],'where':{'id':_0x290cff[_0x57cf('0x43')]['id']}},_0x3e8c6c={};_0x3e8c6c['model']=_[_0x57cf('0x44')](db['CmCustomField']['rawAttributes']);_0x3e8c6c[_0x57cf('0x30')]=_[_0x57cf('0x44')](_0x290cff[_0x57cf('0x30')]);_0x3e8c6c[_0x57cf('0x45')]=_[_0x57cf('0x31')](_0x3e8c6c[_0x57cf('0x2e')],_0x3e8c6c[_0x57cf('0x30')]);_0x37fc62[_0x57cf('0x32')]=_[_0x57cf('0x31')](_0x3e8c6c[_0x57cf('0x2e')],qs[_0x57cf('0x33')](_0x290cff[_0x57cf('0x30')][_0x57cf('0x33')]));_0x37fc62['attributes']=_0x37fc62[_0x57cf('0x32')][_0x57cf('0x34')]?_0x37fc62[_0x57cf('0x32')]:_0x3e8c6c[_0x57cf('0x2e')];if(_0x290cff[_0x57cf('0x30')][_0x57cf('0x3f')]){_0x37fc62['include']=[{'all':!![]}];}_0x37fc62=_[_0x57cf('0x3c')]({},_0x37fc62,_0x290cff[_0x57cf('0x46')]);return db[_0x57cf('0x2b')][_0x57cf('0x47')](_0x37fc62)[_0x57cf('0x25')](handleEntityNotFound(_0xfb97ab,null))['then'](respondWithResult(_0xfb97ab,null))[_0x57cf('0x48')](handleError(_0xfb97ab,null));};exports[_0x57cf('0x49')]=function(_0x36f881,_0x265fa9){if(_0x36f881[_0x57cf('0x4a')]['id']){delete _0x36f881[_0x57cf('0x4a')]['id'];}return db[_0x57cf('0x2b')][_0x57cf('0x47')]({'where':{'id':_0x36f881[_0x57cf('0x43')]['id']}})['then'](handleEntityNotFound(_0x265fa9,null))[_0x57cf('0x25')](saveUpdates(_0x36f881[_0x57cf('0x4a')],null))[_0x57cf('0x25')](respondWithResult(_0x265fa9,null))['catch'](handleError(_0x265fa9,null));};exports[_0x57cf('0x26')]=function(_0x4c75b9,_0x34197e){return db[_0x57cf('0x2b')][_0x57cf('0x47')]({'where':{'id':_0x4c75b9[_0x57cf('0x43')]['id']}})[_0x57cf('0x25')](handleEntityNotFound(_0x34197e,null))[_0x57cf('0x25')](removeEntity(_0x34197e,null))['catch'](handleError(_0x34197e,null));};exports['create']=function(_0x4e5a41,_0x457da6){var _0x1b93b9;return db[_0x57cf('0x4b')]['transaction'](function(_0x3d4514){return db['CmCustomField'][_0x57cf('0x4c')](_0x4e5a41[_0x57cf('0x4a')],{'transaction':_0x3d4514})['then'](function(_0x6d2956){_0x1b93b9=_0x6d2956;var _0x39be44={'type':db[_0x57cf('0x4d')][_0x57cf('0x4e')],'transaction':_0x3d4514};switch(_0x4e5a41[_0x57cf('0x4a')]['type']){case _0x57cf('0x4f'):_0x39be44[_0x57cf('0x3d')]=db[_0x57cf('0x4d')][_0x57cf('0x4e')];break;case _0x57cf('0x50'):_0x39be44[_0x57cf('0x3d')]=db[_0x57cf('0x4d')]['INTEGER'];break;case'switch':_0x39be44[_0x57cf('0x3d')]=db[_0x57cf('0x4d')]['BOOLEAN'];_0x39be44[_0x57cf('0x51')]=![];break;default:}return db[_0x57cf('0x4b')][_0x57cf('0x52')][_0x57cf('0x53')](_0x57cf('0x54'),util['format'](_0x57cf('0x55'),_0x1b93b9['id']),_0x39be44);})[_0x57cf('0x25')](function(){return _0x1b93b9;});})['then'](respondWithResult(_0x457da6,0xc9))[_0x57cf('0x48')](handleError(_0x457da6,null));}; \ No newline at end of file +var _0x6dca=['util','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','Content-Range','reject','destroy','then','end','error','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','CmCustomField','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','update','body','create','transaction','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','cm_contacts','format','cf_%d','eml-format','rimraf','moment'];(function(_0x1d636f,_0x4f5888){var _0x3c3662=function(_0x14e6f4){while(--_0x14e6f4){_0x1d636f['push'](_0x1d636f['shift']());}};_0x3c3662(++_0x4f5888);}(_0x6dca,0x192));var _0xa6dc=function(_0x1331f6,_0x52c3c2){_0x1331f6=_0x1331f6-0x0;var _0x244197=_0x6dca[_0x1331f6];return _0x244197;};'use strict';var emlformat=require(_0xa6dc('0x0'));var rimraf=require(_0xa6dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa6dc('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa6dc('0x3'));var path=require('path');var sox=require(_0xa6dc('0x4'));var csv=require(_0xa6dc('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa6dc('0x6'));var crypto=require('crypto');var jsforce=require(_0xa6dc('0x7'));var deskjs=require(_0xa6dc('0x8'));var toCsv=require(_0xa6dc('0x5'));var querystring=require(_0xa6dc('0x9'));var Papa=require(_0xa6dc('0xa'));var Redis=require('ioredis');var authService=require(_0xa6dc('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xa6dc('0xc'));var hardwareService=require(_0xa6dc('0xd'));var logger=require(_0xa6dc('0xe'))(_0xa6dc('0xf'));var utils=require(_0xa6dc('0x10'));var config=require(_0xa6dc('0x11'));var licenseUtil=require(_0xa6dc('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3415c0,_0x15dc91){_0x15dc91=_0x15dc91||0xcc;return function(_0x527a77){if(_0x527a77){return _0x3415c0[_0xa6dc('0x13')](_0x15dc91);}return _0x3415c0[_0xa6dc('0x14')](_0x15dc91)['end']();};}function respondWithResult(_0x3617c8,_0x13c979){_0x13c979=_0x13c979||0xc8;return function(_0x454486){if(_0x454486){return _0x3617c8['status'](_0x13c979)[_0xa6dc('0x15')](_0x454486);}};}function respondWithFilteredResult(_0x1f3a4c,_0x36fa81){return function(_0x2d20f8){if(_0x2d20f8){var _0x38acb6=typeof _0x36fa81['offset']===_0xa6dc('0x16')&&typeof _0x36fa81['limit']===_0xa6dc('0x16');var _0x4a4714=_0x2d20f8[_0xa6dc('0x17')];var _0x4c8235=_0x38acb6?0x0:_0x36fa81[_0xa6dc('0x18')];var _0x30554e=_0x38acb6?_0x2d20f8['count']:_0x36fa81[_0xa6dc('0x18')]+_0x36fa81[_0xa6dc('0x19')];var _0x427c4c;if(_0x30554e>=_0x4a4714){_0x30554e=_0x4a4714;_0x427c4c=0xc8;}else{_0x427c4c=0xce;}_0x1f3a4c[_0xa6dc('0x14')](_0x427c4c);return _0x1f3a4c['set'](_0xa6dc('0x1a'),_0x4c8235+'-'+_0x30554e+'/'+_0x4a4714)[_0xa6dc('0x15')](_0x2d20f8);}return null;};}function patchUpdates(_0x24b4bc){return function(_0x3c0088){try{jsonpatch['apply'](_0x3c0088,_0x24b4bc,!![]);}catch(_0x50bce6){return BPromise[_0xa6dc('0x1b')](_0x50bce6);}return _0x3c0088['save']();};}function saveUpdates(_0x141954,_0x88a8a2){return function(_0x47cedf){if(_0x47cedf){return _0x47cedf['update'](_0x141954)['then'](function(_0x2bf6e9){return _0x2bf6e9;});}return null;};}function removeEntity(_0x4404e2,_0x3a33b9){return function(_0x5a95ec){if(_0x5a95ec){return _0x5a95ec[_0xa6dc('0x1c')]()[_0xa6dc('0x1d')](function(){_0x4404e2[_0xa6dc('0x14')](0xcc)[_0xa6dc('0x1e')]();});}};}function handleEntityNotFound(_0x1d238a,_0x42ad2a){return function(_0x3a528f){if(!_0x3a528f){_0x1d238a[_0xa6dc('0x13')](0x194);}return _0x3a528f;};}function handleError(_0x31ddee,_0x2b6752){_0x2b6752=_0x2b6752||0x1f4;return function(_0x536374){logger[_0xa6dc('0x1f')](_0x536374['stack']);if(_0x536374[_0xa6dc('0x20')]){delete _0x536374['name'];}_0x31ddee['status'](_0x2b6752)[_0xa6dc('0x21')](_0x536374);};}exports[_0xa6dc('0x22')]=function(_0x496a4f,_0x442082){var _0x3b9123={},_0x146d64={},_0x40bad2={'count':0x0,'rows':[]};var _0x41bd8b=_[_0xa6dc('0x23')](db['CmCustomField']['rawAttributes'],function(_0x48f66f){return{'name':_0x48f66f[_0xa6dc('0x24')],'type':_0x48f66f[_0xa6dc('0x25')][_0xa6dc('0x26')]};});_0x146d64[_0xa6dc('0x27')]=_['differenceBy'](_[_0xa6dc('0x23')](_0x41bd8b,_0xa6dc('0x20')),[_0xa6dc('0x20')]);_0x146d64['query']=_[_0xa6dc('0x28')](_0x496a4f[_0xa6dc('0x29')]);_0x146d64[_0xa6dc('0x2a')]=_[_0xa6dc('0x2b')](_0x146d64[_0xa6dc('0x27')],_0x146d64[_0xa6dc('0x29')]);_0x3b9123[_0xa6dc('0x2c')]=_['intersection'](_0x146d64[_0xa6dc('0x27')],qs[_0xa6dc('0x2d')](_0x496a4f[_0xa6dc('0x29')]['fields']));_0x3b9123[_0xa6dc('0x2c')]=_0x3b9123['attributes'][_0xa6dc('0x2e')]?_0x3b9123[_0xa6dc('0x2c')]:_0x146d64[_0xa6dc('0x27')];if(!_0x496a4f[_0xa6dc('0x29')][_0xa6dc('0x2f')](_0xa6dc('0x30'))){_0x3b9123[_0xa6dc('0x19')]=qs[_0xa6dc('0x19')](_0x496a4f[_0xa6dc('0x29')][_0xa6dc('0x19')]);_0x3b9123[_0xa6dc('0x18')]=qs['offset'](_0x496a4f[_0xa6dc('0x29')]['offset']);}_0x3b9123[_0xa6dc('0x31')]=qs['sort'](_0x496a4f[_0xa6dc('0x29')]['sort']);_0x3b9123[_0xa6dc('0x32')]=qs[_0xa6dc('0x2a')](_[_0xa6dc('0x33')](_0x496a4f[_0xa6dc('0x29')],_0x146d64['filters']),_0x41bd8b);if(_0x496a4f[_0xa6dc('0x29')][_0xa6dc('0x34')]){_0x3b9123[_0xa6dc('0x32')]=_[_0xa6dc('0x35')](_0x3b9123[_0xa6dc('0x32')],{'$or':_[_0xa6dc('0x23')](_0x41bd8b,function(_0x481be4){if(_0x481be4['type']!==_0xa6dc('0x36')){var _0x2a97f3={};_0x2a97f3[_0x481be4[_0xa6dc('0x20')]]={'$like':'%'+_0x496a4f[_0xa6dc('0x29')][_0xa6dc('0x34')]+'%'};return _0x2a97f3;}})});}_0x3b9123=_[_0xa6dc('0x35')]({},_0x3b9123,_0x496a4f[_0xa6dc('0x37')]);var _0x3a424b={'where':_0x3b9123[_0xa6dc('0x32')]};return db[_0xa6dc('0x38')][_0xa6dc('0x17')](_0x3a424b)[_0xa6dc('0x1d')](function(_0x5a4c5b){_0x40bad2['count']=_0x5a4c5b;if(_0x496a4f[_0xa6dc('0x29')]['includeAll']){_0x3b9123[_0xa6dc('0x39')]=[{'all':!![]}];}return db['CmCustomField'][_0xa6dc('0x3a')](_0x3b9123);})[_0xa6dc('0x1d')](function(_0x2f13a6){_0x40bad2[_0xa6dc('0x3b')]=_0x2f13a6;return _0x40bad2;})[_0xa6dc('0x1d')](respondWithFilteredResult(_0x442082,_0x3b9123))[_0xa6dc('0x3c')](handleError(_0x442082,null));};exports[_0xa6dc('0x3d')]=function(_0x3e2d20,_0x3482b4){var _0x561bec={'raw':!![],'where':{'id':_0x3e2d20[_0xa6dc('0x3e')]['id']}},_0x3bdd9d={};_0x3bdd9d['model']=_[_0xa6dc('0x28')](db['CmCustomField'][_0xa6dc('0x3f')]);_0x3bdd9d[_0xa6dc('0x29')]=_[_0xa6dc('0x28')](_0x3e2d20[_0xa6dc('0x29')]);_0x3bdd9d[_0xa6dc('0x2a')]=_[_0xa6dc('0x2b')](_0x3bdd9d[_0xa6dc('0x27')],_0x3bdd9d[_0xa6dc('0x29')]);_0x561bec['attributes']=_[_0xa6dc('0x2b')](_0x3bdd9d[_0xa6dc('0x27')],qs[_0xa6dc('0x2d')](_0x3e2d20[_0xa6dc('0x29')]['fields']));_0x561bec[_0xa6dc('0x2c')]=_0x561bec['attributes'][_0xa6dc('0x2e')]?_0x561bec[_0xa6dc('0x2c')]:_0x3bdd9d[_0xa6dc('0x27')];if(_0x3e2d20[_0xa6dc('0x29')][_0xa6dc('0x40')]){_0x561bec[_0xa6dc('0x39')]=[{'all':!![]}];}_0x561bec=_[_0xa6dc('0x35')]({},_0x561bec,_0x3e2d20[_0xa6dc('0x37')]);return db[_0xa6dc('0x38')][_0xa6dc('0x41')](_0x561bec)['then'](handleEntityNotFound(_0x3482b4,null))['then'](respondWithResult(_0x3482b4,null))[_0xa6dc('0x3c')](handleError(_0x3482b4,null));};exports[_0xa6dc('0x42')]=function(_0x279064,_0xca4e40){if(_0x279064['body']['id']){delete _0x279064[_0xa6dc('0x43')]['id'];}return db[_0xa6dc('0x38')][_0xa6dc('0x41')]({'where':{'id':_0x279064[_0xa6dc('0x3e')]['id']}})['then'](handleEntityNotFound(_0xca4e40,null))[_0xa6dc('0x1d')](saveUpdates(_0x279064[_0xa6dc('0x43')],null))[_0xa6dc('0x1d')](respondWithResult(_0xca4e40,null))['catch'](handleError(_0xca4e40,null));};exports[_0xa6dc('0x1c')]=function(_0x3b96d6,_0x1793c6){return db[_0xa6dc('0x38')][_0xa6dc('0x41')]({'where':{'id':_0x3b96d6[_0xa6dc('0x3e')]['id']}})[_0xa6dc('0x1d')](handleEntityNotFound(_0x1793c6,null))[_0xa6dc('0x1d')](removeEntity(_0x1793c6,null))[_0xa6dc('0x3c')](handleError(_0x1793c6,null));};exports[_0xa6dc('0x44')]=function(_0x1f6210,_0x216ed3){var _0x5a2d01;return db['sequelize'][_0xa6dc('0x45')](function(_0x449c2c){return db[_0xa6dc('0x38')][_0xa6dc('0x44')](_0x1f6210[_0xa6dc('0x43')],{'transaction':_0x449c2c})['then'](function(_0x529666){_0x5a2d01=_0x529666;var _0x2365e9={'type':db['Sequelize']['TEXT'],'transaction':_0x449c2c};switch(_0x1f6210[_0xa6dc('0x43')]['type']){case'text':_0x2365e9[_0xa6dc('0x25')]=db[_0xa6dc('0x46')]['TEXT'];break;case _0xa6dc('0x47'):_0x2365e9['type']=db[_0xa6dc('0x46')][_0xa6dc('0x48')];break;case _0xa6dc('0x49'):_0x2365e9['type']=db[_0xa6dc('0x46')][_0xa6dc('0x4a')];_0x2365e9[_0xa6dc('0x4b')]=![];break;default:}return db[_0xa6dc('0x4c')][_0xa6dc('0x4d')]['addColumn'](_0xa6dc('0x4e'),util[_0xa6dc('0x4f')](_0xa6dc('0x50'),_0x5a2d01['id']),_0x2365e9);})[_0xa6dc('0x1d')](function(){return _0x5a2d01;});})[_0xa6dc('0x1d')](respondWithResult(_0x216ed3,0xc9))[_0xa6dc('0x3c')](handleError(_0x216ed3,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 27c618c..22f2be3 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 _0xfa2a=['exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x169201,_0x397fb4){var _0x17c908=function(_0xfc76d0){while(--_0xfc76d0){_0x169201['push'](_0x169201['shift']());}};_0x17c908(++_0x397fb4);}(_0xfa2a,0x1a8));var _0xafa2=function(_0x74d1c8,_0x1c5391){_0x74d1c8=_0x74d1c8-0x0;var _0x39f3e8=_0xfa2a[_0x74d1c8];return _0x39f3e8;};'use strict';var _=require(_0xafa2('0x0'));var util=require(_0xafa2('0x1'));var logger=require(_0xafa2('0x2'))('api');var moment=require(_0xafa2('0x3'));var BPromise=require('bluebird');var rp=require(_0xafa2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xafa2('0x5'));var config=require(_0xafa2('0x6'));var attributes=require(_0xafa2('0x7'));module[_0xafa2('0x8')]=function(_0x3d5885,_0xab6237){return _0x3d5885[_0xafa2('0x9')](_0xafa2('0xa'),attributes,{'tableName':_0xafa2('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed5d=['../../config/logger','api','bluebird','request-promise','path','rimraf','exports','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x23d7a7,_0x4b0f57){var _0x43f390=function(_0x3528d0){while(--_0x3528d0){_0x23d7a7['push'](_0x23d7a7['shift']());}};_0x43f390(++_0x4b0f57);}(_0xed5d,0x8d));var _0xded5=function(_0x2eb11a,_0x120efa){_0x2eb11a=_0x2eb11a-0x0;var _0x56f521=_0xed5d[_0x2eb11a];return _0x56f521;};'use strict';var _=require(_0xded5('0x0'));var util=require(_0xded5('0x1'));var logger=require(_0xded5('0x2'))(_0xded5('0x3'));var moment=require('moment');var BPromise=require(_0xded5('0x4'));var rp=require(_0xded5('0x5'));var fs=require('fs');var path=require(_0xded5('0x6'));var rimraf=require(_0xded5('0x7'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0xded5('0x8')]=function(_0x39d63e,_0x51dd3f){return _0x39d63e['define'](_0xded5('0x9'),attributes,{'tableName':_0xded5('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 7d6270d..6b19f98 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 _0xa7c1=['info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x394322,_0x51090f){var _0x1502a6=function(_0x302d2f){while(--_0x302d2f){_0x394322['push'](_0x394322['shift']());}};_0x1502a6(++_0x51090f);}(_0xa7c1,0x1ac));var _0x1a7c=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xa7c1[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x1a7c('0x0'));var util=require('util');var moment=require(_0x1a7c('0x1'));var BPromise=require(_0x1a7c('0x2'));var rs=require(_0x1a7c('0x3'));var fs=require('fs');var Redis=require(_0x1a7c('0x4'));var db=require(_0x1a7c('0x5'))['db'];var utils=require(_0x1a7c('0x6'));var logger=require(_0x1a7c('0x7'))(_0x1a7c('0x8'));var config=require(_0x1a7c('0x9'));var jayson=require(_0x1a7c('0xa'));var client=jayson[_0x1a7c('0xb')][_0x1a7c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa0d9f4,_0x6edcc1,_0x473c93){return new BPromise(function(_0x518a7d,_0x51da31){return client[_0x1a7c('0xd')](_0xa0d9f4,_0x473c93)[_0x1a7c('0xe')](function(_0x392388){logger['info'](_0x1a7c('0xf'),_0x6edcc1,_0x1a7c('0x10'));logger[_0x1a7c('0x11')](_0x1a7c('0x12'),_0x6edcc1,_0x1a7c('0x10'),JSON[_0x1a7c('0x13')](_0x392388));if(_0x392388['error']){if(_0x392388[_0x1a7c('0x14')]['code']===0x1f4){logger['error'](_0x1a7c('0xf'),_0x6edcc1,_0x392388[_0x1a7c('0x14')][_0x1a7c('0x15')]);return _0x51da31(_0x392388[_0x1a7c('0x14')]['message']);}logger[_0x1a7c('0x14')](_0x1a7c('0xf'),_0x6edcc1,_0x392388[_0x1a7c('0x14')][_0x1a7c('0x15')]);return _0x518a7d(_0x392388[_0x1a7c('0x14')][_0x1a7c('0x15')]);}else{logger[_0x1a7c('0x16')]('CmCustomField,\x20%s,\x20%s',_0x6edcc1,'request\x20sent');_0x518a7d(_0x392388[_0x1a7c('0x17')]['message']);}})[_0x1a7c('0x18')](function(_0x5decd7){logger[_0x1a7c('0x14')](_0x1a7c('0xf'),_0x6edcc1,_0x5decd7);_0x51da31(_0x5decd7);});});} \ No newline at end of file +var _0xe4f4=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','result','bluebird','ioredis'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0xe4f4,0xbc));var _0x4e4f=function(_0x463f29,_0x315360){_0x463f29=_0x463f29-0x0;var _0x516d9b=_0xe4f4[_0x463f29];return _0x516d9b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4e4f('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e4f('0x1'));var db=require(_0x4e4f('0x2'))['db'];var utils=require(_0x4e4f('0x3'));var logger=require('../../config/logger')(_0x4e4f('0x4'));var config=require(_0x4e4f('0x5'));var jayson=require(_0x4e4f('0x6'));var client=jayson[_0x4e4f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22194e,_0x5ca180,_0x49f1bb){return new BPromise(function(_0x36996d,_0x47f624){return client[_0x4e4f('0x8')](_0x22194e,_0x49f1bb)[_0x4e4f('0x9')](function(_0x37cdf6){logger[_0x4e4f('0xa')](_0x4e4f('0xb'),_0x5ca180,_0x4e4f('0xc'));logger[_0x4e4f('0xd')](_0x4e4f('0xe'),_0x5ca180,_0x4e4f('0xc'),JSON['stringify'](_0x37cdf6));if(_0x37cdf6[_0x4e4f('0xf')]){if(_0x37cdf6[_0x4e4f('0xf')][_0x4e4f('0x10')]===0x1f4){logger[_0x4e4f('0xf')](_0x4e4f('0xb'),_0x5ca180,_0x37cdf6[_0x4e4f('0xf')][_0x4e4f('0x11')]);return _0x47f624(_0x37cdf6['error'][_0x4e4f('0x11')]);}logger['error'](_0x4e4f('0xb'),_0x5ca180,_0x37cdf6['error'][_0x4e4f('0x11')]);return _0x36996d(_0x37cdf6[_0x4e4f('0xf')][_0x4e4f('0x11')]);}else{logger[_0x4e4f('0xa')](_0x4e4f('0xb'),_0x5ca180,_0x4e4f('0xc'));_0x36996d(_0x37cdf6[_0x4e4f('0x12')][_0x4e4f('0x11')]);}})['catch'](function(_0x29a763){logger[_0x4e4f('0xf')](_0x4e4f('0xb'),_0x5ca180,_0x29a763);_0x47f624(_0x29a763);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 129cee0..864ebe9 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 _0x12e9=['../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','update','delete','exports','path','express','Router'];(function(_0xb66208,_0x533afa){var _0x374422=function(_0x406a8c){while(--_0x406a8c){_0xb66208['push'](_0xb66208['shift']());}};_0x374422(++_0x533afa);}(_0x12e9,0x66));var _0x912e=function(_0x2c0813,_0x10adb4){_0x2c0813=_0x2c0813-0x0;var _0x2d96eb=_0x12e9[_0x2c0813];return _0x2d96eb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x912e('0x0'));var timeout=require('connect-timeout');var express=require(_0x912e('0x1'));var router=express[_0x912e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x912e('0x3'));var interaction=require(_0x912e('0x4'));var config=require('../../config/environment');var controller=require(_0x912e('0x5'));router[_0x912e('0x6')]('/',auth[_0x912e('0x7')](),controller[_0x912e('0x8')]);router['get'](_0x912e('0x9'),auth[_0x912e('0x7')](),controller[_0x912e('0xa')]);router[_0x912e('0xb')]('/',auth[_0x912e('0x7')](),controller['create']);router['put']('/:id',auth[_0x912e('0x7')](),controller[_0x912e('0xc')]);router[_0x912e('0xd')](_0x912e('0x9'),auth[_0x912e('0x7')](),controller['destroy']);module[_0x912e('0xe')]=router; \ No newline at end of file +var _0x31f0=['fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','show','post','put','/:id','update','delete','destroy','multer','path','express','Router'];(function(_0x2d57f8,_0x40c88b){var _0x50e180=function(_0x11189b){while(--_0x11189b){_0x2d57f8['push'](_0x2d57f8['shift']());}};_0x50e180(++_0x40c88b);}(_0x31f0,0xb7));var _0x031f=function(_0x334397,_0x50c8ea){_0x334397=_0x334397-0x0;var _0x5c77f1=_0x31f0[_0x334397];return _0x5c77f1;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var fs_extra=require(_0x031f('0x4'));var auth=require(_0x031f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x031f('0x6'));var controller=require(_0x031f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x031f('0x8')]('/:id',auth[_0x031f('0x9')](),controller[_0x031f('0xa')]);router[_0x031f('0xb')]('/',auth[_0x031f('0x9')](),controller['create']);router[_0x031f('0xc')](_0x031f('0xd'),auth[_0x031f('0x9')](),controller[_0x031f('0xe')]);router[_0x031f('0xf')](_0x031f('0xd'),auth[_0x031f('0x9')](),controller[_0x031f('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index f1887a9..b00a10b 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 _0x459a=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','BOOLEAN','contactListQueue','exports','DATE','format'];(function(_0x492dd7,_0x566cd0){var _0x28430a=function(_0x4259fa){while(--_0x4259fa){_0x492dd7['push'](_0x492dd7['shift']());}};_0x28430a(++_0x566cd0);}(_0x459a,0x1d5));var _0xa459=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x459a[_0x126558];return _0x1f6d14;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xa459('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa459('0x1')],'defaultValue':moment()[_0xa459('0x2')](_0xa459('0x3'))},'countbusyretry':{'type':Sequelize[_0xa459('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa459('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa459('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xa459('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa459('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa459('0x4')],'unique':_0xa459('0x7')},'ListId':{'type':Sequelize[_0xa459('0x4')],'unique':_0xa459('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xa459('0x4')],'unique':_0xa459('0x7')},'CampaignId':{'type':Sequelize[_0xa459('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa459('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa459('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa459('0x4')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xa459('0x4')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa459('0x5')]},'recallmeNotifiedDate':{'type':Sequelize[_0xa459('0x1')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x1bc2=['exports','STRING','BOOLEAN','DATE','format','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x1bc2,0xb3));var _0x21bc=function(_0x5a32c8,_0x7b1a29){_0x5a32c8=_0x5a32c8-0x0;var _0x487377=_0x1bc2[_0x5a32c8];return _0x487377;};'use strict';var moment=require(_0x21bc('0x0'));var Sequelize=require('sequelize');module[_0x21bc('0x1')]={'phone':{'type':Sequelize[_0x21bc('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x21bc('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x21bc('0x4')],'defaultValue':moment()[_0x21bc('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x21bc('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x21bc('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x21bc('0x4')]},'priority':{'type':Sequelize[_0x21bc('0x6')](0x2)[_0x21bc('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x21bc('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x21bc('0x6')],'unique':_0x21bc('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x21bc('0x8')},'UserId':{'type':Sequelize[_0x21bc('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x21bc('0x6')],'unique':_0x21bc('0x8')},'CampaignId':{'type':Sequelize[_0x21bc('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x21bc('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x21bc('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x21bc('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x21bc('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x21bc('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index f2ce6fe..6dcbdd3 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 _0xf0ba=['filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','keys','include','options','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','status','getPreview','getVoiceQueues','sequelize','transaction','format','value','direction','hopperIds','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','priority','scheduledAt','dialOrderByScheduledAt','literal','findOne','scheduledat','phone','recallme','LOCK','Contact','CmCompany','Company','CmList','List','dialActive','getPreviewRecall','UPDATE','Queue','getOpenContacts','outbound','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','json','offset','undefined','limit','count','set','Content-Range','then','sendStatus','error','stack','name','send','map','CmHopper','rawAttributes','type','key','model','query','filters','intersection','$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$notIn','$like','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x7279d0,_0x5bbab9){var _0x44554f=function(_0x2e2b11){while(--_0x2e2b11){_0x7279d0['push'](_0x7279d0['shift']());}};_0x44554f(++_0x5bbab9);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0ba[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xaf0b('0x0'));var _=require(_0xaf0b('0x1'));var qs=require(_0xaf0b('0x2'));var logger=require(_0xaf0b('0x3'))(_0xaf0b('0x4'));var shared=require('../../config/environment');var db=require(_0xaf0b('0x5'))['db'];function respondWithResult(_0xce0364,_0x4cffa5){_0x4cffa5=_0x4cffa5||0xc8;return function(_0xcd565f){if(_0xcd565f){return _0xce0364['status'](_0x4cffa5)[_0xaf0b('0x6')](_0xcd565f);}};}function respondWithFilteredResult(_0x4b3b85,_0x4d1479){return function(_0x53b32d){if(_0x53b32d){var _0x1d260e=typeof _0x4d1479[_0xaf0b('0x7')]===_0xaf0b('0x8')&&typeof _0x4d1479[_0xaf0b('0x9')]==='undefined';var _0x2fac18=_0x53b32d[_0xaf0b('0xa')];var _0x26bb21=_0x1d260e?0x0:_0x4d1479['offset'];var _0x392802=_0x1d260e?_0x53b32d['count']:_0x4d1479[_0xaf0b('0x7')]+_0x4d1479[_0xaf0b('0x9')];var _0x3606c3;if(_0x392802>=_0x2fac18){_0x392802=_0x2fac18;_0x3606c3=0xc8;}else{_0x3606c3=0xce;}_0x4b3b85['status'](_0x3606c3);return _0x4b3b85[_0xaf0b('0xb')](_0xaf0b('0xc'),_0x26bb21+'-'+_0x392802+'/'+_0x2fac18)[_0xaf0b('0x6')](_0x53b32d);}return null;};}function saveUpdates(_0x1ada96,_0x283de8){return function(_0x31ced1){if(_0x31ced1){return _0x31ced1['update'](_0x1ada96)[_0xaf0b('0xd')](function(_0xdbd3d6){return _0xdbd3d6;});}return null;};}function handleEntityNotFound(_0xc72b7d,_0x27732e){return function(_0x4f0c02){if(!_0x4f0c02){_0xc72b7d[_0xaf0b('0xe')](0x194);}return _0x4f0c02;};}function handleError(_0x46db7f,_0x45c1b2){_0x45c1b2=_0x45c1b2||0x1f4;return function(_0x2cb9a2){logger[_0xaf0b('0xf')](_0x2cb9a2[_0xaf0b('0x10')]);if(_0x2cb9a2[_0xaf0b('0x11')]){delete _0x2cb9a2[_0xaf0b('0x11')];}_0x46db7f['status'](_0x45c1b2)[_0xaf0b('0x12')](_0x2cb9a2);};}exports['index']=function(_0x152f69,_0x1dd132){var _0x36b059={},_0xbe0d1e={},_0x3201ed={'count':0x0,'rows':[]};var _0x3fcbd7=_[_0xaf0b('0x13')](db[_0xaf0b('0x14')][_0xaf0b('0x15')],function(_0x2f563a){return{'name':_0x2f563a['fieldName'],'type':_0x2f563a[_0xaf0b('0x16')][_0xaf0b('0x17')]};});_0xbe0d1e[_0xaf0b('0x18')]=_['map'](_0x3fcbd7,_0xaf0b('0x11'));_0xbe0d1e[_0xaf0b('0x19')]=_['keys'](_0x152f69[_0xaf0b('0x19')]);_0xbe0d1e[_0xaf0b('0x1a')]=_[_0xaf0b('0x1b')](_0xbe0d1e[_0xaf0b('0x18')],_0xbe0d1e[_0xaf0b('0x19')]);_0xbe0d1e['filters']=_['concat'](_0xbe0d1e[_0xaf0b('0x1a')],[_0xaf0b('0x1c'),_0xaf0b('0x1d'),_0xaf0b('0x1e'),_0xaf0b('0x1f'),_0xaf0b('0x20'),_0xaf0b('0x21'),_0xaf0b('0x22'),'$eq',_0xaf0b('0x23'),_0xaf0b('0x24'),_0xaf0b('0x25'),'$in',_0xaf0b('0x26'),_0xaf0b('0x27'),'$notLike','$iLike','$notILike',_0xaf0b('0x27'),_0xaf0b('0x28'),_0xaf0b('0x29'),'$contained',_0xaf0b('0x2a')]);_0x36b059[_0xaf0b('0x2b')]=_[_0xaf0b('0x1b')](_0xbe0d1e[_0xaf0b('0x18')],qs[_0xaf0b('0x2c')](_0x152f69[_0xaf0b('0x19')][_0xaf0b('0x2c')]));_0x36b059['attributes']=_0x36b059[_0xaf0b('0x2b')][_0xaf0b('0x2d')]?_0x36b059['attributes']:_0xbe0d1e[_0xaf0b('0x18')];if(!_0x152f69[_0xaf0b('0x19')][_0xaf0b('0x2e')](_0xaf0b('0x2f'))){_0x36b059[_0xaf0b('0x9')]=qs[_0xaf0b('0x9')](_0x152f69[_0xaf0b('0x19')][_0xaf0b('0x9')]);_0x36b059[_0xaf0b('0x7')]=qs['offset'](_0x152f69[_0xaf0b('0x19')]['offset']);}_0x36b059['order']=qs['sort'](_0x152f69[_0xaf0b('0x19')][_0xaf0b('0x30')]);_0x36b059[_0xaf0b('0x31')]=qs[_0xaf0b('0x1a')](_[_0xaf0b('0x32')](_0x152f69[_0xaf0b('0x19')],_0xbe0d1e['filters']),_0x3fcbd7);if(_0x152f69[_0xaf0b('0x19')][_0xaf0b('0x33')]){_0x36b059[_0xaf0b('0x31')]=_[_0xaf0b('0x34')](_0x36b059[_0xaf0b('0x31')],{'$or':_[_0xaf0b('0x13')](_0x3fcbd7,function(_0x613b5c){if(_0x613b5c[_0xaf0b('0x16')]!==_0xaf0b('0x35')){var _0x39604e={};_0x39604e[_0x613b5c['name']]={'$like':'%'+_0x152f69[_0xaf0b('0x19')]['filter']+'%'};return _0x39604e;}})});}_0x36b059=_[_0xaf0b('0x34')]({},_0x36b059,_0x152f69['options']);var _0x1f429d={'where':_0x36b059['where']};return db[_0xaf0b('0x14')][_0xaf0b('0xa')](_0x1f429d)[_0xaf0b('0xd')](function(_0x24fcde){_0x3201ed[_0xaf0b('0xa')]=_0x24fcde;if(_0x152f69[_0xaf0b('0x19')][_0xaf0b('0x36')]){_0x36b059['include']=[{'all':!![]}];}return db[_0xaf0b('0x14')][_0xaf0b('0x37')](_0x36b059);})[_0xaf0b('0xd')](function(_0x17fe16){_0x3201ed['rows']=_0x17fe16;return _0x3201ed;})[_0xaf0b('0xd')](respondWithFilteredResult(_0x1dd132,_0x36b059))[_0xaf0b('0x38')](handleError(_0x1dd132,null));};exports[_0xaf0b('0x39')]=function(_0x42bda1,_0x2d7e01){var _0x5df6d2={'raw':!![],'where':{'id':_0x42bda1[_0xaf0b('0x3a')]['id']}},_0x21ef80={};_0x21ef80[_0xaf0b('0x18')]=_[_0xaf0b('0x3b')](db[_0xaf0b('0x14')][_0xaf0b('0x15')]);_0x21ef80[_0xaf0b('0x19')]=_['keys'](_0x42bda1[_0xaf0b('0x19')]);_0x21ef80['filters']=_[_0xaf0b('0x1b')](_0x21ef80[_0xaf0b('0x18')],_0x21ef80[_0xaf0b('0x19')]);_0x5df6d2[_0xaf0b('0x2b')]=_[_0xaf0b('0x1b')](_0x21ef80[_0xaf0b('0x18')],qs[_0xaf0b('0x2c')](_0x42bda1[_0xaf0b('0x19')][_0xaf0b('0x2c')]));_0x5df6d2['attributes']=_0x5df6d2[_0xaf0b('0x2b')][_0xaf0b('0x2d')]?_0x5df6d2[_0xaf0b('0x2b')]:_0x21ef80[_0xaf0b('0x18')];if(_0x42bda1[_0xaf0b('0x19')]['includeAll']){_0x5df6d2[_0xaf0b('0x3c')]=[{'all':!![]}];}_0x5df6d2=_['merge']({},_0x5df6d2,_0x42bda1[_0xaf0b('0x3d')]);return db[_0xaf0b('0x14')][_0xaf0b('0x3e')](_0x5df6d2)[_0xaf0b('0xd')](handleEntityNotFound(_0x2d7e01,null))[_0xaf0b('0xd')](respondWithResult(_0x2d7e01,null))[_0xaf0b('0x38')](handleError(_0x2d7e01,null));};exports[_0xaf0b('0x3f')]=function(_0x1acc55,_0x1dfd2c){return db['CmHopper'][_0xaf0b('0x3f')](_0x1acc55[_0xaf0b('0x40')],{})['then'](respondWithResult(_0x1dfd2c,0xc9))[_0xaf0b('0x38')](handleError(_0x1dfd2c,null));};exports[_0xaf0b('0x41')]=function(_0xd5e1be,_0x2d4297){if(_0xd5e1be[_0xaf0b('0x40')]['id']){delete _0xd5e1be[_0xaf0b('0x40')]['id'];}return db[_0xaf0b('0x14')][_0xaf0b('0x3e')]({'where':{'id':_0xd5e1be[_0xaf0b('0x3a')]['id']}})[_0xaf0b('0xd')](handleEntityNotFound(_0x2d4297,null))[_0xaf0b('0xd')](saveUpdates(_0xd5e1be['body'],null))[_0xaf0b('0xd')](respondWithResult(_0x2d4297,null))[_0xaf0b('0x38')](handleError(_0x2d4297,null));};exports[_0xaf0b('0x42')]=function(_0x146820,_0x474863){return db[_0xaf0b('0x14')][_0xaf0b('0x42')]()[_0xaf0b('0xd')](respondWithResult(_0x474863,null))[_0xaf0b('0x38')](handleError(_0x474863,null));};exports['destroy']=function(_0x12cfaf,_0x598904){var _0x162edf;var _0x3f8e17=_0x12cfaf[_0xaf0b('0x3a')]['id'];return db[_0xaf0b('0x14')][_0xaf0b('0x3e')]({'where':{'id':_0x12cfaf[_0xaf0b('0x3a')]['id']}})['then'](handleEntityNotFound(_0x598904,null))[_0xaf0b('0xd')](function(_0x321181){if(_0x321181){return _0x321181[_0xaf0b('0x43')]()[_0xaf0b('0xd')](function(_0x1992a7){return _0x1992a7;});}})[_0xaf0b('0xd')](function(_0x50c07d){_0x162edf=_0x50c07d;if(_0x50c07d){if(_0x50c07d[_0xaf0b('0x44')]||_0x50c07d[_0xaf0b('0x45')]){return db[_0x50c07d[_0xaf0b('0x44')]?_0xaf0b('0x46'):_0xaf0b('0x47')][_0xaf0b('0x3e')]({'where':{'id':_0x50c07d[_0xaf0b('0x44')]?_0x50c07d['VoiceQueueId']:_0x50c07d[_0xaf0b('0x45')]},'attributes':['id',_0xaf0b('0x11')],'raw':!![]});}}})[_0xaf0b('0xd')](function(_0x492808){var _0xa67c61={};if(_0x492808){_['merge'](_0xa67c61,_[_0xaf0b('0x48')](_0x162edf[_0xaf0b('0x49')],[_0xaf0b('0x4a'),_0xaf0b('0x4b'),'id']));_0xa67c61['state']=0x15;_0xa67c61[_0xaf0b('0x4c')]=_0xaf0b('0x4d');_0xa67c61[_0xaf0b('0x4e')]=_0x492808[_0xaf0b('0x11')];_0xa67c61[_0xaf0b('0x4f')]=_0x12cfaf[_0xaf0b('0x50')][_0xaf0b('0x11')];_0xa67c61[_0xaf0b('0x51')]=_0x12cfaf[_0xaf0b('0x50')]['id'];_0xa67c61['deleted']=!![];_0xa67c61[_0xaf0b('0x52')]=moment()['format'](_0xaf0b('0x53'));_0xa67c61[_0xaf0b('0x54')]=_0x162edf['phone'];_0xa67c61['campaigntype']=_0x162edf[_0xaf0b('0x44')]?_0xaf0b('0x55'):'ivr';return db[_0xaf0b('0x56')]['find']({'where':{'id':_0xa67c61[_0xaf0b('0x57')]},'attributes':[_0xaf0b('0x58'),_0xaf0b('0x59')]})['then'](function(_0x1ef793){if(!_[_0xaf0b('0x5a')](_0x598904)&&!_[_0xaf0b('0x5a')](_0x1ef793[_0xaf0b('0x58')])){_0xa67c61[_0xaf0b('0x5b')]=_0x1ef793['firstName'];if(!_[_0xaf0b('0x5a')](_0x1ef793[_0xaf0b('0x59')])){_0xa67c61['calleridname']+='\x20'+_0x1ef793[_0xaf0b('0x59')];}}})[_0xaf0b('0x5c')](function(){return db[_0xaf0b('0x5d')][_0xaf0b('0x3f')](_0xa67c61);});}})[_0xaf0b('0xd')](function(_0x303498){return db[_0xaf0b('0x5e')][_0xaf0b('0x43')]({'where':{'CmHopperId':_0x3f8e17}});})[_0xaf0b('0xd')](function(){return _0x598904[_0xaf0b('0x5f')](0xcc)['end']();})[_0xaf0b('0x38')](handleError(_0x598904,null));};exports[_0xaf0b('0x60')]=function(_0x126a5d,_0x42a4b4){var _0x5ed57d=[];return db[_0xaf0b('0x56')][_0xaf0b('0x42')]()['then'](function(_0x5ebcbb){_0x5ed57d=_[_0xaf0b('0x3b')](_0x5ebcbb);return _0x126a5d[_0xaf0b('0x50')][_0xaf0b('0x61')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})['then'](function(_0xf6d249){if(_0xf6d249&&_0xf6d249[_0xaf0b('0x2d')]){return db[_0xaf0b('0x62')][_0xaf0b('0x63')](function(_0x2db367){var _0x4ef2d8={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xaf0b('0x64')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xaf0b('0x13')](_0xf6d249,'id')},'$or':[{'UserId':null},{'UserId':_0x126a5d[_0xaf0b('0x50')]['id']}]};var _0x4472b0={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xf6d249)[_0xaf0b('0x33')](['dialPreviewAutoRecallMe',0x0])['map']('id')[_0xaf0b('0x65')]()},'$or':[{'UserId':null},{'UserId':_0x126a5d['user']['id']}]};var _0xff3a3f={'$or':[_0x4ef2d8,_0x4472b0]};var _0x45c22f=[];if(_0x126a5d['body'][_0xaf0b('0x66')]&&_0x126a5d[_0xaf0b('0x40')]['direction']==='prev'){if(!_['isEmpty'](_0x126a5d[_0xaf0b('0x40')][_0xaf0b('0x67')])){_0xff3a3f['id']={'$in':_0x126a5d['body']['hopperIds']};}_0x45c22f=[['priority',_0xaf0b('0x68')],['scheduledAt',_0xf6d249[0x0]['dialOrderByScheduledAt']===_0xaf0b('0x68')?_0xaf0b('0x69'):_0xaf0b('0x68')],db[_0xaf0b('0x62')]['literal'](_0xaf0b('0x6a')),['id',_0xaf0b('0x69')]];}else{if(!_[_0xaf0b('0x6b')](_0x126a5d[_0xaf0b('0x40')][_0xaf0b('0x67')])){_0xff3a3f['id']={'$notIn':_0x126a5d[_0xaf0b('0x40')][_0xaf0b('0x67')]};}_0x45c22f=[[_0xaf0b('0x6c'),_0xaf0b('0x69')],[_0xaf0b('0x6d'),_0xf6d249[0x0][_0xaf0b('0x6e')]],db[_0xaf0b('0x62')][_0xaf0b('0x6f')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xaf0b('0x68')]];}return db['CmHopper'][_0xaf0b('0x70')]({'attributes':['id',_0xaf0b('0x71'),_0xaf0b('0x72'),_0xaf0b('0x73')],'where':_0xff3a3f,'order':_0x45c22f,'transaction':_0x2db367,'lock':_0x2db367[_0xaf0b('0x74')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xaf0b('0x75'),'attributes':_0x5ed57d,'include':[{'model':db[_0xaf0b('0x76')],'as':_0xaf0b('0x77'),'attributes':['id','name']}]},{'model':db[_0xaf0b('0x78')],'as':_0xaf0b('0x79'),'attributes':['id',_0xaf0b('0x11')]},{'model':db[_0xaf0b('0x46')],'as':'Queue','attributes':['id',_0xaf0b('0x11'),_0xaf0b('0x7a')]}]})['then'](function(_0x11a48b){if(_0x11a48b){return _0x11a48b[_0xaf0b('0x41')]({'UserId':_0x126a5d['user']['id']},{'transaction':_0x2db367});}});});}})[_0xaf0b('0xd')](handleEntityNotFound(_0x42a4b4,null))[_0xaf0b('0xd')](respondWithResult(_0x42a4b4,null))['catch'](handleError(_0x42a4b4,null));};exports[_0xaf0b('0x7b')]=function(_0x18fc7d,_0x1226ea,_0x4caa18){var _0x59d425=[];var _0x19ff45=_0x18fc7d['params']['id'];var _0x458545=_0x18fc7d['user']['id'];return db[_0xaf0b('0x56')]['describe']()[_0xaf0b('0xd')](function(_0x2d0059){_0x59d425=_['keys'](_0x2d0059);return db[_0xaf0b('0x62')][_0xaf0b('0x63')](function(_0x596ca3){const _0x2f8d36={'id':_0x19ff45};return db[_0xaf0b('0x14')][_0xaf0b('0x70')]({'attributes':['id',_0xaf0b('0x71'),'recallme'],'where':_0x2f8d36,'transaction':_0x596ca3,'lock':_0x596ca3[_0xaf0b('0x74')][_0xaf0b('0x7c')],'include':[{'model':db[_0xaf0b('0x56')],'as':'Contact','attributes':_0x59d425,'include':[{'model':db[_0xaf0b('0x76')],'as':_0xaf0b('0x77'),'attributes':['id',_0xaf0b('0x11')]}]},{'model':db[_0xaf0b('0x78')],'as':_0xaf0b('0x79'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0xaf0b('0x7d'),'attributes':['id','name',_0xaf0b('0x7a')]}]})['then'](function(_0x3a6b0f){if(_0x3a6b0f){return _0x3a6b0f[_0xaf0b('0x41')]({'UserId':_0x458545},{'transaction':_0x596ca3});}});});})[_0xaf0b('0xd')](handleEntityNotFound(_0x1226ea,null))[_0xaf0b('0xd')](respondWithResult(_0x1226ea,null))[_0xaf0b('0x38')](handleError(_0x1226ea,null));};exports[_0xaf0b('0x7e')]=function(_0x26222b,_0x388748){return _0x26222b['user'][_0xaf0b('0x61')]({'where':{'type':_0xaf0b('0x7f'),'dialActive':!![],'dialMethod':_0xaf0b('0x80')},'attributes':['id'],'raw':!![]})[_0xaf0b('0xd')](function(_0x3f7f1c){if(_0x3f7f1c&&_0x3f7f1c[_0xaf0b('0x2d')]){return db['CmHopper'][_0xaf0b('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xaf0b('0x13')](_0x3f7f1c,'id')},'$or':[{'UserId':null},{'UserId':_0x26222b[_0xaf0b('0x50')]['id']}]}});}return 0x0;})['then'](function(_0x4918dc){if(!_[_0xaf0b('0x5a')](_0x4918dc)&&_[_0xaf0b('0x81')](_0x4918dc)){return _0x388748[_0xaf0b('0x5f')](0xc8)[_0xaf0b('0x6')]({'contacts':_0x4918dc});}else{logger[_0xaf0b('0xf')](_0xaf0b('0x82'),'getOpenContacts',0x194,_0xaf0b('0x83'));_0x388748['sendStatus'](0x194);}})[_0xaf0b('0x38')](handleError(_0x388748,null));};exports[_0xaf0b('0x84')]=function(_0x183cad,_0x3a591d){var _0x3334f8=shared[_0xaf0b('0x85')];var _0x5d22ae=[];_['map'](_0x3334f8,function(_0x1f899b){_0x5d22ae[_0xaf0b('0x86')]({'id':_0x1f899b[_0xaf0b('0x11')],'name':_0x1f899b['name'],'utcOffset':_0x1f899b[_0xaf0b('0x87')]});});return _0x3a591d['status'](0xc8)[_0xaf0b('0x6')]({'tz':_0x5d22ae});};exports['getTimezone']=function(_0x165761,_0x52ad66){var _0x475268=shared[_0xaf0b('0x85')];var _0x1adac7={};if(!_[_0xaf0b('0x5a')](_0x475268[_0x165761[_0xaf0b('0x40')]['id']]))_0x1adac7=_0x475268[_0x165761['body']['id']];return _0x52ad66['status'](0xc8)[_0xaf0b('0x6')](_0x1adac7);}; \ No newline at end of file +var _0x885a=['key','model','query','keys','filters','concat','$and','$gt','$gte','$lte','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','value','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','priority','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','CmCompany','Company','CmList','dialActive','getPreviewRecall','transaction','recallme','Contact','Queue','getOpenContacts','preview','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','then','error','stack','name','index','CmHopper','rawAttributes','type'];(function(_0x4d5287,_0x14ffc1){var _0x4f34e4=function(_0x1a53c4){while(--_0x1a53c4){_0x4d5287['push'](_0x4d5287['shift']());}};_0x4f34e4(++_0x14ffc1);}(_0x885a,0x180));var _0xa885=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x885a[_0x2c91e9];return _0x13f0ff;};'use strict';var moment=require('moment');var _=require(_0xa885('0x0'));var qs=require(_0xa885('0x1'));var logger=require(_0xa885('0x2'))(_0xa885('0x3'));var shared=require('../../config/environment');var db=require(_0xa885('0x4'))['db'];function respondWithResult(_0x1c41b5,_0x2386ec){_0x2386ec=_0x2386ec||0xc8;return function(_0x106e16){if(_0x106e16){return _0x1c41b5[_0xa885('0x5')](_0x2386ec)[_0xa885('0x6')](_0x106e16);}};}function respondWithFilteredResult(_0x5dfd7e,_0x7ac6bd){return function(_0x1200c7){if(_0x1200c7){var _0x31fd77=typeof _0x7ac6bd['offset']===_0xa885('0x7')&&typeof _0x7ac6bd[_0xa885('0x8')]===_0xa885('0x7');var _0x5e49d0=_0x1200c7[_0xa885('0x9')];var _0x299f57=_0x31fd77?0x0:_0x7ac6bd[_0xa885('0xa')];var _0x745710=_0x31fd77?_0x1200c7[_0xa885('0x9')]:_0x7ac6bd[_0xa885('0xa')]+_0x7ac6bd[_0xa885('0x8')];var _0x571c0d;if(_0x745710>=_0x5e49d0){_0x745710=_0x5e49d0;_0x571c0d=0xc8;}else{_0x571c0d=0xce;}_0x5dfd7e[_0xa885('0x5')](_0x571c0d);return _0x5dfd7e[_0xa885('0xb')](_0xa885('0xc'),_0x299f57+'-'+_0x745710+'/'+_0x5e49d0)[_0xa885('0x6')](_0x1200c7);}return null;};}function saveUpdates(_0x412b2a,_0x3e9c7a){return function(_0x4585d9){if(_0x4585d9){return _0x4585d9['update'](_0x412b2a)[_0xa885('0xd')](function(_0x1d789f){return _0x1d789f;});}return null;};}function handleEntityNotFound(_0x27b24a,_0x12d81c){return function(_0x33ce2e){if(!_0x33ce2e){_0x27b24a['sendStatus'](0x194);}return _0x33ce2e;};}function handleError(_0x1c9687,_0x2ca5c5){_0x2ca5c5=_0x2ca5c5||0x1f4;return function(_0x5296e6){logger[_0xa885('0xe')](_0x5296e6[_0xa885('0xf')]);if(_0x5296e6['name']){delete _0x5296e6[_0xa885('0x10')];}_0x1c9687[_0xa885('0x5')](_0x2ca5c5)['send'](_0x5296e6);};}exports[_0xa885('0x11')]=function(_0x543e7a,_0x2e9290){var _0x3960ea={},_0x8c26c={},_0x4e4d51={'count':0x0,'rows':[]};var _0x289b76=_['map'](db[_0xa885('0x12')][_0xa885('0x13')],function(_0x113043){return{'name':_0x113043['fieldName'],'type':_0x113043[_0xa885('0x14')][_0xa885('0x15')]};});_0x8c26c[_0xa885('0x16')]=_['map'](_0x289b76,_0xa885('0x10'));_0x8c26c[_0xa885('0x17')]=_[_0xa885('0x18')](_0x543e7a['query']);_0x8c26c[_0xa885('0x19')]=_['intersection'](_0x8c26c[_0xa885('0x16')],_0x8c26c[_0xa885('0x17')]);_0x8c26c['filters']=_[_0xa885('0x1a')](_0x8c26c[_0xa885('0x19')],[_0xa885('0x1b'),'$or',_0xa885('0x1c'),_0xa885('0x1d'),'$lt',_0xa885('0x1e'),'$ne',_0xa885('0x1f'),'$not',_0xa885('0x20'),_0xa885('0x21'),_0xa885('0x22'),_0xa885('0x23'),_0xa885('0x24'),_0xa885('0x25'),_0xa885('0x26'),_0xa885('0x27'),'$like','$overlap','$contains','$contained',_0xa885('0x28')]);_0x3960ea[_0xa885('0x29')]=_[_0xa885('0x2a')](_0x8c26c[_0xa885('0x16')],qs[_0xa885('0x2b')](_0x543e7a[_0xa885('0x17')]['fields']));_0x3960ea[_0xa885('0x29')]=_0x3960ea['attributes'][_0xa885('0x2c')]?_0x3960ea['attributes']:_0x8c26c[_0xa885('0x16')];if(!_0x543e7a['query'][_0xa885('0x2d')](_0xa885('0x2e'))){_0x3960ea[_0xa885('0x8')]=qs['limit'](_0x543e7a[_0xa885('0x17')][_0xa885('0x8')]);_0x3960ea['offset']=qs[_0xa885('0xa')](_0x543e7a['query'][_0xa885('0xa')]);}_0x3960ea[_0xa885('0x2f')]=qs[_0xa885('0x30')](_0x543e7a['query'][_0xa885('0x30')]);_0x3960ea[_0xa885('0x31')]=qs[_0xa885('0x19')](_['pick'](_0x543e7a[_0xa885('0x17')],_0x8c26c[_0xa885('0x19')]),_0x289b76);if(_0x543e7a[_0xa885('0x17')][_0xa885('0x32')]){_0x3960ea[_0xa885('0x31')]=_[_0xa885('0x33')](_0x3960ea[_0xa885('0x31')],{'$or':_[_0xa885('0x34')](_0x289b76,function(_0x5235af){if(_0x5235af['type']!==_0xa885('0x35')){var _0x1d43b5={};_0x1d43b5[_0x5235af[_0xa885('0x10')]]={'$like':'%'+_0x543e7a[_0xa885('0x17')][_0xa885('0x32')]+'%'};return _0x1d43b5;}})});}_0x3960ea=_[_0xa885('0x33')]({},_0x3960ea,_0x543e7a[_0xa885('0x36')]);var _0x337e55={'where':_0x3960ea[_0xa885('0x31')]};return db['CmHopper']['count'](_0x337e55)[_0xa885('0xd')](function(_0x576c78){_0x4e4d51['count']=_0x576c78;if(_0x543e7a[_0xa885('0x17')]['includeAll']){_0x3960ea[_0xa885('0x37')]=[{'all':!![]}];}return db[_0xa885('0x12')][_0xa885('0x38')](_0x3960ea);})[_0xa885('0xd')](function(_0x2d433e){_0x4e4d51[_0xa885('0x39')]=_0x2d433e;return _0x4e4d51;})[_0xa885('0xd')](respondWithFilteredResult(_0x2e9290,_0x3960ea))[_0xa885('0x3a')](handleError(_0x2e9290,null));};exports[_0xa885('0x3b')]=function(_0x2f48a9,_0x531586){var _0x30759d={'raw':!![],'where':{'id':_0x2f48a9[_0xa885('0x3c')]['id']}},_0x4012b3={};_0x4012b3[_0xa885('0x16')]=_[_0xa885('0x18')](db['CmHopper']['rawAttributes']);_0x4012b3[_0xa885('0x17')]=_[_0xa885('0x18')](_0x2f48a9[_0xa885('0x17')]);_0x4012b3[_0xa885('0x19')]=_[_0xa885('0x2a')](_0x4012b3['model'],_0x4012b3[_0xa885('0x17')]);_0x30759d[_0xa885('0x29')]=_['intersection'](_0x4012b3['model'],qs[_0xa885('0x2b')](_0x2f48a9[_0xa885('0x17')]['fields']));_0x30759d['attributes']=_0x30759d[_0xa885('0x29')][_0xa885('0x2c')]?_0x30759d[_0xa885('0x29')]:_0x4012b3[_0xa885('0x16')];if(_0x2f48a9[_0xa885('0x17')][_0xa885('0x3d')]){_0x30759d[_0xa885('0x37')]=[{'all':!![]}];}_0x30759d=_[_0xa885('0x33')]({},_0x30759d,_0x2f48a9[_0xa885('0x36')]);return db[_0xa885('0x12')][_0xa885('0x3e')](_0x30759d)['then'](handleEntityNotFound(_0x531586,null))[_0xa885('0xd')](respondWithResult(_0x531586,null))[_0xa885('0x3a')](handleError(_0x531586,null));};exports[_0xa885('0x3f')]=function(_0x49c6a7,_0x47f3b4){return db[_0xa885('0x12')][_0xa885('0x3f')](_0x49c6a7[_0xa885('0x40')],{})['then'](respondWithResult(_0x47f3b4,0xc9))[_0xa885('0x3a')](handleError(_0x47f3b4,null));};exports['update']=function(_0x2d4bb5,_0x245fe9){if(_0x2d4bb5['body']['id']){delete _0x2d4bb5[_0xa885('0x40')]['id'];}return db[_0xa885('0x12')][_0xa885('0x3e')]({'where':{'id':_0x2d4bb5[_0xa885('0x3c')]['id']}})[_0xa885('0xd')](handleEntityNotFound(_0x245fe9,null))['then'](saveUpdates(_0x2d4bb5[_0xa885('0x40')],null))[_0xa885('0xd')](respondWithResult(_0x245fe9,null))[_0xa885('0x3a')](handleError(_0x245fe9,null));};exports['describe']=function(_0x4d146e,_0x52fbeb){return db[_0xa885('0x12')][_0xa885('0x41')]()[_0xa885('0xd')](respondWithResult(_0x52fbeb,null))[_0xa885('0x3a')](handleError(_0x52fbeb,null));};exports[_0xa885('0x42')]=function(_0x49aa9b,_0x43245c){var _0x476532;var _0x4397d6=_0x49aa9b[_0xa885('0x3c')]['id'];return db[_0xa885('0x12')]['find']({'where':{'id':_0x49aa9b['params']['id']}})['then'](handleEntityNotFound(_0x43245c,null))[_0xa885('0xd')](function(_0x289716){if(_0x289716){return _0x289716[_0xa885('0x42')]()[_0xa885('0xd')](function(_0x164d9d){return _0x164d9d;});}})[_0xa885('0xd')](function(_0x35e931){_0x476532=_0x35e931;if(_0x35e931){if(_0x35e931['VoiceQueueId']||_0x35e931[_0xa885('0x43')]){return db[_0x35e931[_0xa885('0x44')]?_0xa885('0x45'):_0xa885('0x46')][_0xa885('0x3e')]({'where':{'id':_0x35e931[_0xa885('0x44')]?_0x35e931[_0xa885('0x44')]:_0x35e931['CampaignId']},'attributes':['id',_0xa885('0x10')],'raw':!![]});}}})[_0xa885('0xd')](function(_0x1fde66){var _0x55ea83={};if(_0x1fde66){_[_0xa885('0x33')](_0x55ea83,_[_0xa885('0x47')](_0x476532[_0xa885('0x48')],[_0xa885('0x49'),_0xa885('0x4a'),'id']));_0x55ea83[_0xa885('0x4b')]=0x15;_0x55ea83[_0xa885('0x4c')]=_0xa885('0x4d');_0x55ea83['campaign']=_0x1fde66[_0xa885('0x10')];_0x55ea83[_0xa885('0x4e')]=_0x49aa9b[_0xa885('0x4f')]['name'];_0x55ea83[_0xa885('0x50')]=_0x49aa9b[_0xa885('0x4f')]['id'];_0x55ea83[_0xa885('0x4d')]=!![];_0x55ea83[_0xa885('0x51')]=moment()[_0xa885('0x52')](_0xa885('0x53'));_0x55ea83['calleridnum']=_0x476532[_0xa885('0x54')];_0x55ea83[_0xa885('0x55')]=_0x476532[_0xa885('0x44')]?'queue':_0xa885('0x56');return db[_0xa885('0x57')][_0xa885('0x3e')]({'where':{'id':_0x55ea83[_0xa885('0x58')]},'attributes':[_0xa885('0x59'),_0xa885('0x5a')]})[_0xa885('0xd')](function(_0x288bbc){if(!_[_0xa885('0x5b')](_0x43245c)&&!_['isNil'](_0x288bbc[_0xa885('0x59')])){_0x55ea83[_0xa885('0x5c')]=_0x288bbc['firstName'];if(!_['isNil'](_0x288bbc[_0xa885('0x5a')])){_0x55ea83[_0xa885('0x5c')]+='\x20'+_0x288bbc['lastName'];}}})[_0xa885('0x5d')](function(){return db[_0xa885('0x5e')][_0xa885('0x3f')](_0x55ea83);});}})[_0xa885('0xd')](function(_0x1e3576){return db[_0xa885('0x5f')][_0xa885('0x42')]({'where':{'CmHopperId':_0x4397d6}});})['then'](function(){return _0x43245c[_0xa885('0x5')](0xcc)[_0xa885('0x60')]();})['catch'](handleError(_0x43245c,null));};exports[_0xa885('0x61')]=function(_0x48ded4,_0x117cfe){var _0x5698d6=[];return db[_0xa885('0x57')][_0xa885('0x41')]()[_0xa885('0xd')](function(_0x22eb32){_0x5698d6=_['keys'](_0x22eb32);return _0x48ded4[_0xa885('0x4f')][_0xa885('0x62')]({'where':{'type':_0xa885('0x63'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xa885('0x64'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0xa885('0xd')](function(_0xb066be){if(_0xb066be&&_0xb066be['length']){return db[_0xa885('0x65')]['transaction'](function(_0x36c7ba){var _0x2f053a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xa885('0x53'))},'VoiceQueueId':{'$in':_[_0xa885('0x34')](_0xb066be,'id')},'$or':[{'UserId':null},{'UserId':_0x48ded4[_0xa885('0x4f')]['id']}]};var _0x3bc750={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xb066be)['filter'](['dialPreviewAutoRecallMe',0x0])[_0xa885('0x34')]('id')[_0xa885('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x48ded4['user']['id']}]};var _0x55d5d0={'$or':[_0x2f053a,_0x3bc750]};var _0x3c9df4=[];if(_0x48ded4[_0xa885('0x40')][_0xa885('0x67')]&&_0x48ded4[_0xa885('0x40')][_0xa885('0x67')]===_0xa885('0x68')){if(!_[_0xa885('0x69')](_0x48ded4[_0xa885('0x40')][_0xa885('0x6a')])){_0x55d5d0['id']={'$in':_0x48ded4[_0xa885('0x40')][_0xa885('0x6a')]};}_0x3c9df4=[['priority',_0xa885('0x6b')],[_0xa885('0x6c'),_0xb066be[0x0][_0xa885('0x64')]===_0xa885('0x6b')?_0xa885('0x6d'):'ASC'],db[_0xa885('0x65')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xa885('0x6d')]];}else{if(!_[_0xa885('0x69')](_0x48ded4['body']['hopperIds'])){_0x55d5d0['id']={'$notIn':_0x48ded4[_0xa885('0x40')][_0xa885('0x6a')]};}_0x3c9df4=[[_0xa885('0x6e'),'DESC'],['scheduledAt',_0xb066be[0x0][_0xa885('0x64')]],db[_0xa885('0x65')][_0xa885('0x6f')](_0xa885('0x70')),['id','ASC']];}return db[_0xa885('0x12')][_0xa885('0x71')]({'attributes':['id',_0xa885('0x72'),'phone','recallme'],'where':_0x55d5d0,'order':_0x3c9df4,'transaction':_0x36c7ba,'lock':_0x36c7ba[_0xa885('0x73')][_0xa885('0x74')],'include':[{'model':db[_0xa885('0x57')],'as':'Contact','attributes':_0x5698d6,'include':[{'model':db[_0xa885('0x75')],'as':_0xa885('0x76'),'attributes':['id',_0xa885('0x10')]}]},{'model':db[_0xa885('0x77')],'as':'List','attributes':['id',_0xa885('0x10')]},{'model':db[_0xa885('0x45')],'as':'Queue','attributes':['id',_0xa885('0x10'),_0xa885('0x78')]}]})['then'](function(_0x314d83){if(_0x314d83){return _0x314d83['update']({'UserId':_0x48ded4[_0xa885('0x4f')]['id']},{'transaction':_0x36c7ba});}});});}})[_0xa885('0xd')](handleEntityNotFound(_0x117cfe,null))[_0xa885('0xd')](respondWithResult(_0x117cfe,null))[_0xa885('0x3a')](handleError(_0x117cfe,null));};exports[_0xa885('0x79')]=function(_0x29ed6e,_0x1ca586,_0x3aa8bc){var _0x490d15=[];var _0x55413d=_0x29ed6e[_0xa885('0x3c')]['id'];var _0xb1eac6=_0x29ed6e['user']['id'];return db[_0xa885('0x57')][_0xa885('0x41')]()['then'](function(_0x425374){_0x490d15=_['keys'](_0x425374);return db[_0xa885('0x65')][_0xa885('0x7a')](function(_0x37ef1b){const _0x26950f={'id':_0x55413d};return db['CmHopper']['findOne']({'attributes':['id',_0xa885('0x72'),_0xa885('0x7b')],'where':_0x26950f,'transaction':_0x37ef1b,'lock':_0x37ef1b[_0xa885('0x73')][_0xa885('0x74')],'include':[{'model':db[_0xa885('0x57')],'as':_0xa885('0x7c'),'attributes':_0x490d15,'include':[{'model':db[_0xa885('0x75')],'as':_0xa885('0x76'),'attributes':['id','name']}]},{'model':db[_0xa885('0x77')],'as':'List','attributes':['id',_0xa885('0x10')]},{'model':db[_0xa885('0x45')],'as':_0xa885('0x7d'),'attributes':['id','name',_0xa885('0x78')]}]})[_0xa885('0xd')](function(_0x50a7ef){if(_0x50a7ef){return _0x50a7ef['update']({'UserId':_0xb1eac6},{'transaction':_0x37ef1b});}});});})[_0xa885('0xd')](handleEntityNotFound(_0x1ca586,null))[_0xa885('0xd')](respondWithResult(_0x1ca586,null))[_0xa885('0x3a')](handleError(_0x1ca586,null));};exports[_0xa885('0x7e')]=function(_0x243d5e,_0x4bd60c){return _0x243d5e['user'][_0xa885('0x62')]({'where':{'type':_0xa885('0x63'),'dialActive':!![],'dialMethod':_0xa885('0x7f')},'attributes':['id'],'raw':!![]})[_0xa885('0xd')](function(_0x56bd37){if(_0x56bd37&&_0x56bd37['length']){return db['CmHopper'][_0xa885('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa885('0x52')](_0xa885('0x53'))},'VoiceQueueId':{'$in':_[_0xa885('0x34')](_0x56bd37,'id')},'$or':[{'UserId':null},{'UserId':_0x243d5e[_0xa885('0x4f')]['id']}]}});}return 0x0;})[_0xa885('0xd')](function(_0x220614){if(!_['isNil'](_0x220614)&&_['isNumber'](_0x220614)){return _0x4bd60c[_0xa885('0x5')](0xc8)['json']({'contacts':_0x220614});}else{logger[_0xa885('0xe')](_0xa885('0x80'),_0xa885('0x7e'),0x194,_0xa885('0x81'));_0x4bd60c['sendStatus'](0x194);}})[_0xa885('0x3a')](handleError(_0x4bd60c,null));};exports[_0xa885('0x82')]=function(_0x2ff728,_0x5a6f1f){var _0xe5881c=shared[_0xa885('0x83')];var _0x9cda91=[];_['map'](_0xe5881c,function(_0x1d51ac){_0x9cda91[_0xa885('0x84')]({'id':_0x1d51ac[_0xa885('0x10')],'name':_0x1d51ac[_0xa885('0x10')],'utcOffset':_0x1d51ac[_0xa885('0x85')]});});return _0x5a6f1f[_0xa885('0x5')](0xc8)['json']({'tz':_0x9cda91});};exports[_0xa885('0x86')]=function(_0x40a85d,_0x3be76a){var _0x1689c8=shared['timezones'];var _0x3c088d={};if(!_[_0xa885('0x5b')](_0x1689c8[_0x40a85d[_0xa885('0x40')]['id']]))_0x3c088d=_0x1689c8[_0x40a85d[_0xa885('0x40')]['id']];return _0x3be76a[_0xa885('0x5')](0xc8)[_0xa885('0x6')](_0x3c088d);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 4e9b88f..554f0d8 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 _0x0295=['define','scheduledat','phone','priority','lodash','api','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x0295,0x1f0));var _0x5029=function(_0x2ef608,_0x53a7b1){_0x2ef608=_0x2ef608-0x0;var _0x56aa07=_0x0295[_0x2ef608];return _0x56aa07;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x5029('0x9')]},{'name':'phone','fields':[_0x5029('0xa')]},{'name':'priority','fields':[_0x5029('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd117=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0xd117,0x182));var _0x7d11=function(_0x1a595a,_0x263824){_0x1a595a=_0x1a595a-0x0;var _0x33f008=_0xd117[_0x1a595a];return _0x33f008;};'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 8085493..22171e1 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 _0xc749=['ShowCmHopper','find','create','body','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','Agent','voicePause','length','UserId','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','MoveContactManagedDialer','CountReScheduled','findAll','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','LOCK','UPDATE','GetContactRecallMe','GetCmHopperPreview','Contact','keys','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','name','CmList','List','lodash','util','moment','bluebird','../../mysqldb','rpc','GetCmHopper','CmHopper','options','raw','where','attributes','limit','map','include','model','then','info','debug','stringify','catch','error','message'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0xc749,0x188));var _0x9c74=function(_0x47ada7,_0x27c4e4){_0x47ada7=_0x47ada7-0x0;var _0x1d3edd=_0xc749[_0x47ada7];return _0x1d3edd;};'use strict';var _=require(_0x9c74('0x0'));var util=require(_0x9c74('0x1'));var moment=require(_0x9c74('0x2'));var BPromise=require(_0x9c74('0x3'));var db=require(_0x9c74('0x4'))['db'];var logger=require('../../config/logger')(_0x9c74('0x5'));exports[_0x9c74('0x6')]=function(_0x280e66){var _0x4f4e20=this;return new Promise(function(_0x1ad318,_0x2d3573){return db[_0x9c74('0x7')]['findAll']({'raw':_0x280e66[_0x9c74('0x8')]?_0x280e66[_0x9c74('0x8')][_0x9c74('0x9')]===undefined?!![]:![]:!![],'where':_0x280e66[_0x9c74('0x8')]?_0x280e66[_0x9c74('0x8')][_0x9c74('0xa')]||null:null,'attributes':_0x280e66[_0x9c74('0x8')]?_0x280e66[_0x9c74('0x8')][_0x9c74('0xb')]||null:null,'limit':_0x280e66[_0x9c74('0x8')]?_0x280e66['options'][_0x9c74('0xc')]||null:null,'include':_0x280e66[_0x9c74('0x8')]?_0x280e66['options']['include']?_[_0x9c74('0xd')](_0x280e66[_0x9c74('0x8')][_0x9c74('0xe')],function(_0x449e52){return{'model':db[_0x449e52['model']],'as':_0x449e52['as'],'attributes':_0x449e52[_0x9c74('0xb')],'include':_0x449e52['include']?_[_0x9c74('0xd')](_0x449e52[_0x9c74('0xe')],function(_0x15e075){return{'model':db[_0x15e075['model']],'as':_0x15e075['as'],'attributes':_0x15e075['attributes'],'include':_0x15e075[_0x9c74('0xe')]?_['map'](_0x15e075[_0x9c74('0xe')],function(_0x2f8414){return{'model':db[_0x2f8414[_0x9c74('0xf')]],'as':_0x2f8414['as'],'attributes':_0x2f8414[_0x9c74('0xb')]};}):[]};}):[]};}):[]:[]})[_0x9c74('0x10')](function(_0x31fc94){logger[_0x9c74('0x11')](_0x9c74('0x6'),_0x280e66);logger[_0x9c74('0x12')](_0x9c74('0x6'),_0x280e66,JSON[_0x9c74('0x13')](_0x31fc94));_0x1ad318(_0x31fc94);})[_0x9c74('0x14')](function(_0x4b8299){logger[_0x9c74('0x15')](_0x9c74('0x6'),_0x4b8299[_0x9c74('0x16')],_0x280e66);_0x2d3573(_0x4f4e20[_0x9c74('0x15')](0x1f4,_0x4b8299[_0x9c74('0x16')]));});});};exports[_0x9c74('0x17')]=function(_0x36a134){var _0x1920be=this;return new Promise(function(_0x46a338,_0x54cd1f){return db[_0x9c74('0x7')][_0x9c74('0x18')]({'raw':_0x36a134['options']?_0x36a134['options'][_0x9c74('0x9')]===undefined?!![]:![]:!![],'where':_0x36a134[_0x9c74('0x8')]?_0x36a134[_0x9c74('0x8')][_0x9c74('0xa')]||null:null,'attributes':_0x36a134[_0x9c74('0x8')]?_0x36a134[_0x9c74('0x8')][_0x9c74('0xb')]||null:null,'include':_0x36a134[_0x9c74('0x8')]?_0x36a134[_0x9c74('0x8')]['include']?_[_0x9c74('0xd')](_0x36a134[_0x9c74('0x8')][_0x9c74('0xe')],function(_0x5e3322){return{'model':db[_0x5e3322[_0x9c74('0xf')]],'as':_0x5e3322['as'],'attributes':_0x5e3322[_0x9c74('0xb')],'include':_0x5e3322['include']?_[_0x9c74('0xd')](_0x5e3322[_0x9c74('0xe')],function(_0x2f2426){return{'model':db[_0x2f2426[_0x9c74('0xf')]],'as':_0x2f2426['as'],'attributes':_0x2f2426[_0x9c74('0xb')],'include':_0x2f2426[_0x9c74('0xe')]?_[_0x9c74('0xd')](_0x2f2426[_0x9c74('0xe')],function(_0x57d4c4){return{'model':db[_0x57d4c4[_0x9c74('0xf')]],'as':_0x57d4c4['as'],'attributes':_0x57d4c4[_0x9c74('0xb')]};}):[]};}):[]};}):[]:[]})[_0x9c74('0x10')](function(_0x1fb0f9){logger[_0x9c74('0x11')](_0x9c74('0x17'),_0x36a134);logger[_0x9c74('0x12')](_0x9c74('0x17'),_0x36a134,JSON[_0x9c74('0x13')](_0x1fb0f9));_0x46a338(_0x1fb0f9);})[_0x9c74('0x14')](function(_0x232104){logger[_0x9c74('0x15')]('ShowCmHopper',_0x232104[_0x9c74('0x16')],_0x36a134);_0x54cd1f(_0x1920be[_0x9c74('0x15')](0x1f4,_0x232104['message']));});});};exports['CreateCmHopper']=function(_0x26e07b){var _0x4555c3=this;return new Promise(function(_0x2df0f4,_0x413341){return db[_0x9c74('0x7')][_0x9c74('0x19')](_0x26e07b[_0x9c74('0x1a')],{'raw':_0x26e07b[_0x9c74('0x8')]?_0x26e07b[_0x9c74('0x8')]['raw']===undefined?!![]:![]:!![]})[_0x9c74('0x10')](function(_0x801c5d){logger[_0x9c74('0x11')](_0x9c74('0x1b'),_0x26e07b);logger['debug']('CreateCmHopper',_0x26e07b,JSON['stringify'](_0x801c5d));_0x2df0f4(_0x801c5d);})[_0x9c74('0x14')](function(_0x392323){logger[_0x9c74('0x15')](_0x9c74('0x1b'),_0x392323[_0x9c74('0x16')],_0x26e07b);_0x413341(_0x4555c3[_0x9c74('0x15')](0x1f4,_0x392323['message']));});});};exports[_0x9c74('0x1c')]=function(_0x3e797b){var _0x14278b=this;return new Promise(function(_0xb4d049,_0x55dd50){return db[_0x9c74('0x7')][_0x9c74('0x1d')](_0x3e797b[_0x9c74('0x1a')],{'raw':_0x3e797b['options']?_0x3e797b[_0x9c74('0x8')][_0x9c74('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e797b[_0x9c74('0x8')]?_0x3e797b[_0x9c74('0x8')][_0x9c74('0xa')]||null:null,'attributes':_0x3e797b[_0x9c74('0x8')]?_0x3e797b[_0x9c74('0x8')][_0x9c74('0xb')]||null:null,'limit':_0x3e797b['options']?_0x3e797b[_0x9c74('0x8')][_0x9c74('0xc')]||null:null})[_0x9c74('0x10')](function(_0x1ab35c){logger['info'](_0x9c74('0x1c'),_0x3e797b);logger[_0x9c74('0x11')](_0x9c74('0x1e'),JSON[_0x9c74('0x13')](_0x3e797b[_0x9c74('0x8')][_0x9c74('0xa')]),_0x3e797b['body'][_0x9c74('0x1f')]);logger[_0x9c74('0x12')](_0x9c74('0x1c'),_0x3e797b,JSON['stringify'](_0x1ab35c));_0xb4d049(_0x1ab35c);})[_0x9c74('0x14')](function(_0x1e7cdb){logger['error'](_0x9c74('0x1c'),_0x1e7cdb[_0x9c74('0x16')],_0x3e797b);_0x55dd50(_0x14278b[_0x9c74('0x15')](0x1f4,_0x1e7cdb[_0x9c74('0x16')]));});});};exports[_0x9c74('0x20')]=function(_0x4d33fe){var _0x73cf6d=this;return new Promise(function(_0x11e7bc,_0x563e57){return db['CmHopper']['destroy']({'where':_0x4d33fe[_0x9c74('0x8')]?_0x4d33fe[_0x9c74('0x8')][_0x9c74('0xa')]||null:null})[_0x9c74('0x10')](function(_0x527aa7){logger['info'](_0x9c74('0x20'),_0x4d33fe);logger[_0x9c74('0x12')](_0x9c74('0x20'),_0x4d33fe,JSON[_0x9c74('0x13')](_0x527aa7));_0x11e7bc(_0x527aa7);})[_0x9c74('0x14')](function(_0x1ef58d){logger['error'](_0x9c74('0x20'),_0x1ef58d[_0x9c74('0x16')],_0x4d33fe);_0x563e57(_0x73cf6d[_0x9c74('0x15')](0x1f4,_0x1ef58d[_0x9c74('0x16')]));});});};exports[_0x9c74('0x21')]=function(_0x4144d4){var _0x53d4c2=this;return new Promise(function(_0x48d5a0,_0x155f08){return db[_0x9c74('0x22')][_0x9c74('0x23')]()[_0x9c74('0x10')](function(_0x43f85d){return db[_0x9c74('0x24')][_0x9c74('0x25')](function(_0xbbbe3f){return db[_0x9c74('0x7')]['findAll']({'where':_0x4144d4[_0x9c74('0x8')]?_0x4144d4[_0x9c74('0x8')][_0x9c74('0xa')]||null:null,'attributes':_0x4144d4[_0x9c74('0x8')]?_0x4144d4['options'][_0x9c74('0xb')]||null:null,'limit':_0x4144d4[_0x9c74('0x8')]?_0x4144d4[_0x9c74('0x8')][_0x9c74('0xc')]||null:null,'order':_0x4144d4[_0x9c74('0x8')]?_0x4144d4['options'][_0x9c74('0x26')]||null:null,'transaction':_0xbbbe3f,'lock':_0xbbbe3f['LOCK']['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_['keys'](_0x43f85d)},{'model':db['User'],'as':_0x9c74('0x27'),'attributes':['id','name',_0x9c74('0x28')]}]})['then'](function(_0x37b43d){var _0x3a3a0e=[];var _0x2a9fed=[];for(var _0x2d4698=0x0;_0x2d4698<_0x37b43d[_0x9c74('0x29')];_0x2d4698+=0x1){var _0x92ab72=_0x37b43d[_0x2d4698][_0x9c74('0x2a')];if(_0x92ab72===null){_0x3a3a0e['push'](_0x37b43d[_0x2d4698]['update'](_0x4144d4[_0x9c74('0x1a')],{'transaction':_0xbbbe3f}));}else if(!_0x2a9fed[_0x9c74('0x2b')](_0x92ab72)){_0x2a9fed['push'](_0x92ab72);_0x3a3a0e[_0x9c74('0x2c')](_0x37b43d[_0x2d4698][_0x9c74('0x1d')](_0x4144d4[_0x9c74('0x1a')],{'transaction':_0xbbbe3f}));}}return BPromise[_0x9c74('0x2d')](_0x3a3a0e);});})[_0x9c74('0x10')](function(_0x58149f){logger[_0x9c74('0x11')](_0x9c74('0x21'),_0x4144d4);if(_0x58149f[_0x9c74('0x29')]>0x0){logger[_0x9c74('0x11')](_0x9c74('0x2e'),_0x58149f[0x0][_0x9c74('0x2f')]['id'],_0x58149f[0x0][_0x9c74('0x2f')]['ContactId'],_0x58149f[0x0]['dataValues']['active']);}logger['debug']('GetContactDialer',_0x4144d4,JSON[_0x9c74('0x13')](_0x58149f));_0x48d5a0(_0x58149f);})[_0x9c74('0x14')](function(_0x7e505c){logger['error'](_0x9c74('0x21'),_0x7e505c[_0x9c74('0x16')],_0x4144d4);_0x155f08(_0x53d4c2[_0x9c74('0x15')](0x1f4,_0x7e505c[_0x9c74('0x16')]));});});});};exports['MoveContactManagedDialer']=function(_0x2986df){var _0x5e3b4f=this;return new Promise(function(_0x5a8504,_0x3ba358){return db[_0x9c74('0x24')][_0x9c74('0x25')](function(_0x281689){return db['CmHopperFinal']['create'](_0x2986df[_0x9c74('0x1a')],{'raw':_0x2986df['options']?_0x2986df[_0x9c74('0x8')]['raw']===undefined?!![]:![]:!![],'transaction':_0x281689})[_0x9c74('0x10')](function(){logger[_0x9c74('0x11')](_0x9c74('0x30'),JSON[_0x9c74('0x13')](_0x2986df[_0x9c74('0x8')][_0x9c74('0xa')]),_0x2986df[_0x9c74('0x8')][_0x9c74('0xa')][_0x9c74('0x1f')]);return db['CmHopper'][_0x9c74('0x31')]({'where':_0x2986df[_0x9c74('0x8')]?_0x2986df[_0x9c74('0x8')][_0x9c74('0xa')]||null:null,'transaction':_0x281689});});})[_0x9c74('0x10')](function(_0x2dd5fd){logger['info'](_0x9c74('0x32'),_0x2986df);logger[_0x9c74('0x12')](_0x9c74('0x32'),_0x2986df,JSON[_0x9c74('0x13')](_0x2dd5fd));_0x5a8504(_0x2dd5fd);})[_0x9c74('0x14')](function(_0x3ae4dc){logger[_0x9c74('0x15')](_0x9c74('0x32'),_0x3ae4dc[_0x9c74('0x16')],_0x2986df);_0x3ba358(_0x5e3b4f[_0x9c74('0x15')](0x1f4,_0x3ae4dc[_0x9c74('0x16')]));});});};exports[_0x9c74('0x33')]=function(_0x438675){var _0x139770=this;return new Promise(function(_0x11488a,_0x21cebd){return db[_0x9c74('0x7')][_0x9c74('0x34')]({'raw':_0x438675[_0x9c74('0x8')]?_0x438675[_0x9c74('0x8')][_0x9c74('0x9')]===undefined?!![]:![]:!![],'where':_0x438675[_0x9c74('0x8')]?_0x438675[_0x9c74('0x8')]['where']||null:null,'attributes':[[db[_0x9c74('0x24')]['fn'](_0x9c74('0x35'),db['sequelize']['fn']('IF',db[_0x9c74('0x24')][_0x9c74('0x36')](_0x9c74('0x37')+util[_0x9c74('0x38')]('\x22%s\x22',moment()['format'](_0x9c74('0x39')))+_0x9c74('0x3a')))),_0x9c74('0x3b')]]})[_0x9c74('0x10')](function(_0x295cdc){logger['info'](_0x9c74('0x33'),_0x438675);logger[_0x9c74('0x12')](_0x9c74('0x33'),_0x438675,JSON[_0x9c74('0x13')](_0x295cdc));_0x11488a(_0x295cdc);})[_0x9c74('0x14')](function(_0x4910b5){logger[_0x9c74('0x15')]('CountReScheduled',_0x4910b5[_0x9c74('0x16')],_0x438675);_0x21cebd(_0x139770[_0x9c74('0x15')](0x1f4,_0x4910b5[_0x9c74('0x16')]));});});};exports['GetContactRecallMe']=function(_0x1eba8d){var _0x4e24ac=this;return new Promise(function(_0x2e07ab,_0x479736){return db[_0x9c74('0x22')][_0x9c74('0x23')]()[_0x9c74('0x10')](function(){return db['sequelize'][_0x9c74('0x25')](function(_0x3b6c5){return db[_0x9c74('0x7')][_0x9c74('0x34')]({'where':_0x1eba8d[_0x9c74('0x8')]?_0x1eba8d['options'][_0x9c74('0xa')]||null:null,'attributes':_0x1eba8d['options']?_0x1eba8d[_0x9c74('0x8')][_0x9c74('0xb')]||null:null,'limit':0x1,'order':_0x1eba8d[_0x9c74('0x8')]?_0x1eba8d[_0x9c74('0x8')][_0x9c74('0x26')]||null:null,'group':db[_0x9c74('0x7')]['UserId'],'transaction':_0x3b6c5,'lock':_0x3b6c5[_0x9c74('0x3c')][_0x9c74('0x3d')],'include':_0x1eba8d[_0x9c74('0x8')]?_0x1eba8d[_0x9c74('0x8')][_0x9c74('0xe')]?_['map'](_0x1eba8d[_0x9c74('0x8')][_0x9c74('0xe')],function(_0x1023d5){return{'model':db[_0x1023d5[_0x9c74('0xf')]],'as':_0x1023d5['as'],'attributes':_0x1023d5[_0x9c74('0xb')],'include':_0x1023d5['include']?_[_0x9c74('0xd')](_0x1023d5[_0x9c74('0xe')],function(_0x572bc4){return{'model':db[_0x572bc4['model']],'as':_0x572bc4['as'],'attributes':_0x572bc4[_0x9c74('0xb')],'include':_0x572bc4[_0x9c74('0xe')]?_[_0x9c74('0xd')](_0x572bc4[_0x9c74('0xe')],function(_0x145359){return{'model':db[_0x145359['model']],'as':_0x145359['as'],'attributes':_0x145359[_0x9c74('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21c0b3){var _0x5e06f6=[];for(var _0x1be48f=0x0;_0x1be48f<_0x21c0b3[_0x9c74('0x29')];_0x1be48f+=0x1){_0x5e06f6['push'](_0x21c0b3[_0x1be48f][_0x9c74('0x1d')](_0x1eba8d[_0x9c74('0x1a')],{'transaction':_0x3b6c5}));}return BPromise[_0x9c74('0x2d')](_0x5e06f6);});})[_0x9c74('0x10')](function(_0x3bfdb0){logger[_0x9c74('0x11')](_0x9c74('0x3e'),_0x1eba8d);logger[_0x9c74('0x12')](_0x9c74('0x3e'),_0x1eba8d,JSON[_0x9c74('0x13')](_0x3bfdb0));_0x2e07ab(_0x3bfdb0);})[_0x9c74('0x14')](function(_0x4d0ce3){logger[_0x9c74('0x15')]('GetContactRecallMe',_0x4d0ce3[_0x9c74('0x16')],_0x1eba8d);_0x479736(_0x4e24ac[_0x9c74('0x15')](0x1f4,_0x4d0ce3[_0x9c74('0x16')]));});});});};exports[_0x9c74('0x3f')]=function(_0x1a8e28){var _0x544e44=this;return new Promise(function(_0x564121,_0x1e8424){db[_0x9c74('0x22')][_0x9c74('0x23')]()[_0x9c74('0x10')](function(_0x673be8){return db[_0x9c74('0x7')][_0x9c74('0x34')]({'raw':_0x1a8e28[_0x9c74('0x8')]?_0x1a8e28['options']['raw']===undefined?!![]:![]:!![],'where':_0x1a8e28[_0x9c74('0x8')]?_0x1a8e28[_0x9c74('0x8')][_0x9c74('0xa')]||null:null,'attributes':_0x1a8e28[_0x9c74('0x8')]?_0x1a8e28[_0x9c74('0x8')][_0x9c74('0xb')]||null:null,'limit':_0x1a8e28[_0x9c74('0x8')]?_0x1a8e28[_0x9c74('0x8')][_0x9c74('0xc')]||null:null,'include':_0x1a8e28['options']?_0x1a8e28[_0x9c74('0x8')][_0x9c74('0xe')]?_[_0x9c74('0xd')](_0x1a8e28[_0x9c74('0x8')]['include'],function(_0x3cabf3){return{'model':db[_0x3cabf3[_0x9c74('0xf')]],'as':_0x3cabf3['as'],'attributes':_0x3cabf3['as']===_0x9c74('0x40')?_[_0x9c74('0x41')](_0x673be8):_0x3cabf3[_0x9c74('0xb')],'include':_0x3cabf3[_0x9c74('0xe')]?_[_0x9c74('0xd')](_0x3cabf3[_0x9c74('0xe')],function(_0x22072f){return{'model':db[_0x22072f[_0x9c74('0xf')]],'as':_0x22072f['as'],'attributes':_0x22072f[_0x9c74('0xb')],'include':_0x22072f['include']?_[_0x9c74('0xd')](_0x22072f[_0x9c74('0xe')],function(_0x1ce8d0){return{'model':db[_0x1ce8d0[_0x9c74('0xf')]],'as':_0x1ce8d0['as'],'attributes':_0x1ce8d0[_0x9c74('0xb')]};}):[]};}):[]};}):[]:[]})[_0x9c74('0x10')](function(_0x4cfb6e){logger[_0x9c74('0x11')]('GetCmHopper',_0x1a8e28);logger[_0x9c74('0x12')](_0x9c74('0x6'),_0x1a8e28,JSON[_0x9c74('0x13')](_0x4cfb6e));_0x564121(_0x4cfb6e);})['catch'](function(_0x1568d4){logger['error']('GetCmHopper',_0x1568d4[_0x9c74('0x16')],_0x1a8e28);_0x1e8424(_0x544e44[_0x9c74('0x15')](0x1f4,_0x1568d4[_0x9c74('0x16')]));});});});};exports[_0x9c74('0x42')]=function(_0x26fc51){var _0x3bc16b=this;return new Promise(function(_0x532224,_0x2830b3){return db['CmContact'][_0x9c74('0x43')]({'raw':!![],'where':{'phone':_0x26fc51['options'][_0x9c74('0xa')][_0x9c74('0x44')]},'attributes':['id',_0x9c74('0x45')],'order':[['id',_0x9c74('0x46')]]})[_0x9c74('0x10')](function(_0x50db00){logger[_0x9c74('0x11')]('getContactByPhone',_0x26fc51);logger[_0x9c74('0x12')](_0x9c74('0x47'),_0x26fc51,JSON[_0x9c74('0x13')](_0x50db00));_0x532224(_0x50db00);})[_0x9c74('0x14')](function(_0x262372){logger[_0x9c74('0x15')]('getContactByPhone',_0x262372[_0x9c74('0x16')],_0x26fc51);_0x2830b3(_0x3bc16b[_0x9c74('0x15')](0x1f4,_0x262372[_0x9c74('0x16')]));});});};exports[_0x9c74('0x48')]=function(_0x1d0f11){var _0x4a231c=this;return new Promise(function(_0x523ee6,_0xaf7182){return db['sequelize'][_0x9c74('0x25')](function(_0x2f8f3a){var _0x40c100=_0x1d0f11[_0x9c74('0x8')]&&_0x1d0f11[_0x9c74('0x8')]['where']?_0x1d0f11['options'][_0x9c74('0xa')]:{};return db['CmHopper'][_0x9c74('0x1d')](_0x1d0f11['body'],{'where':_0x40c100,'transaction':_0x2f8f3a})['then'](function(_0x5f3148){logger[_0x9c74('0x11')](_0x9c74('0x48'),_0x1d0f11);logger[_0x9c74('0x12')](_0x9c74('0x48'),_0x1d0f11,JSON[_0x9c74('0x13')](_0x5f3148));_0x523ee6(_0x5f3148);})[_0x9c74('0x14')](function(_0x3e741d){logger[_0x9c74('0x15')](_0x9c74('0x48'),_0x3e741d[_0x9c74('0x16')],_0x1d0f11);_0xaf7182(_0x4a231c[_0x9c74('0x15')](0x1f4,_0x3e741d[_0x9c74('0x16')]));});});});};exports[_0x9c74('0x49')]=function(_0x2c27de){var _0x19a704=this;var _0x5bcc9c=_0x2c27de[_0x9c74('0x1a')][_0x9c74('0xa')][_0x9c74('0x4a')];var _0x39d377=_0x2c27de[_0x9c74('0x1a')]['where']['interval'];var _0x385018=_0x2c27de[_0x9c74('0x1a')][_0x9c74('0xa')][_0x9c74('0x4b')];return new Promise(function(_0x5b6932,_0x26056b){return db[_0x9c74('0x7')][_0x9c74('0x34')]({'where':{'voiceQueueId':{'$in':_0x5bcc9c},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x9c74('0x24')][_0x9c74('0x36')](_0x9c74('0x4c')+_0x39d377+_0x9c74('0x4d')),'$gt':db[_0x9c74('0x24')][_0x9c74('0x36')](_0x9c74('0x4e'))}},'UserId':{'$in':_0x385018}},'include':[{'model':db[_0x9c74('0x22')],'as':_0x9c74('0x40')},{'model':db[_0x9c74('0x4f')],'as':_0x9c74('0x27'),'attributes':['id',_0x9c74('0x50'),_0x9c74('0x28')]},{'model':db[_0x9c74('0x51')],'as':_0x9c74('0x52')}]})[_0x9c74('0x10')](function(_0x5bf3a2){if(_0x5bf3a2[_0x9c74('0x29')]>0x0){return db[_0x9c74('0x24')]['transaction'](function(_0x1a5bd0){return db[_0x9c74('0x7')]['update']({'recallmeNotifiedDate':db['sequelize'][_0x9c74('0x36')](_0x9c74('0x4e'))},{'where':{'id':{'$in':_[_0x9c74('0xd')](_0x5bf3a2,'id')}},'transaction':_0x1a5bd0})[_0x9c74('0x10')](function(){_0x5b6932(_0x5bf3a2);})['catch'](function(_0x2d63b9){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x2d63b9['message'],_0x2c27de);_0x26056b(_0x19a704[_0x9c74('0x15')](0x1f4,_0x2d63b9['message']));});})['catch'](function(_0xee260){logger[_0x9c74('0x15')](_0x9c74('0x49'),_0xee260[_0x9c74('0x16')],_0x2c27de);_0x26056b(_0x19a704[_0x9c74('0x15')](0x1f4,_0xee260[_0x9c74('0x16')]));});}else{_0x5b6932(_0x5bf3a2);}});});}; \ No newline at end of file +var _0xe903=['UserId','GetCmHopperPreview','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','NOW()','CmList','List','lodash','util','moment','bluebird','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','message','find','ShowCmHopper','catch','error','create','body','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','push','includes','all','length','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe'];(function(_0x45ae56,_0x205f0c){var _0x371809=function(_0x41a9a6){while(--_0x41a9a6){_0x45ae56['push'](_0x45ae56['shift']());}};_0x371809(++_0x205f0c);}(_0xe903,0x103));var _0x3e90=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xe903[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x3e90('0x0'));var util=require(_0x3e90('0x1'));var moment=require(_0x3e90('0x2'));var BPromise=require(_0x3e90('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x3e90('0x4'));exports[_0x3e90('0x5')]=function(_0xf591a5){var _0x401858=this;return new Promise(function(_0xb7bf6f,_0x41a677){return db[_0x3e90('0x6')][_0x3e90('0x7')]({'raw':_0xf591a5['options']?_0xf591a5[_0x3e90('0x8')][_0x3e90('0x9')]===undefined?!![]:![]:!![],'where':_0xf591a5[_0x3e90('0x8')]?_0xf591a5[_0x3e90('0x8')][_0x3e90('0xa')]||null:null,'attributes':_0xf591a5['options']?_0xf591a5['options'][_0x3e90('0xb')]||null:null,'limit':_0xf591a5[_0x3e90('0x8')]?_0xf591a5[_0x3e90('0x8')][_0x3e90('0xc')]||null:null,'include':_0xf591a5[_0x3e90('0x8')]?_0xf591a5['options'][_0x3e90('0xd')]?_[_0x3e90('0xe')](_0xf591a5['options'][_0x3e90('0xd')],function(_0x5bbb47){return{'model':db[_0x5bbb47['model']],'as':_0x5bbb47['as'],'attributes':_0x5bbb47['attributes'],'include':_0x5bbb47['include']?_[_0x3e90('0xe')](_0x5bbb47[_0x3e90('0xd')],function(_0x4e9829){return{'model':db[_0x4e9829['model']],'as':_0x4e9829['as'],'attributes':_0x4e9829[_0x3e90('0xb')],'include':_0x4e9829['include']?_[_0x3e90('0xe')](_0x4e9829[_0x3e90('0xd')],function(_0x2d74e4){return{'model':db[_0x2d74e4[_0x3e90('0xf')]],'as':_0x2d74e4['as'],'attributes':_0x2d74e4['attributes']};}):[]};}):[]};}):[]:[]})[_0x3e90('0x10')](function(_0x4ee54c){logger[_0x3e90('0x11')](_0x3e90('0x5'),_0xf591a5);logger[_0x3e90('0x12')](_0x3e90('0x5'),_0xf591a5,JSON[_0x3e90('0x13')](_0x4ee54c));_0xb7bf6f(_0x4ee54c);})['catch'](function(_0x2a8e7d){logger['error']('GetCmHopper',_0x2a8e7d[_0x3e90('0x14')],_0xf591a5);_0x41a677(_0x401858['error'](0x1f4,_0x2a8e7d[_0x3e90('0x14')]));});});};exports['ShowCmHopper']=function(_0x4ca192){var _0x11a863=this;return new Promise(function(_0x56ed6c,_0x1b9e4b){return db[_0x3e90('0x6')][_0x3e90('0x15')]({'raw':_0x4ca192[_0x3e90('0x8')]?_0x4ca192[_0x3e90('0x8')][_0x3e90('0x9')]===undefined?!![]:![]:!![],'where':_0x4ca192[_0x3e90('0x8')]?_0x4ca192[_0x3e90('0x8')][_0x3e90('0xa')]||null:null,'attributes':_0x4ca192[_0x3e90('0x8')]?_0x4ca192['options'][_0x3e90('0xb')]||null:null,'include':_0x4ca192[_0x3e90('0x8')]?_0x4ca192['options'][_0x3e90('0xd')]?_['map'](_0x4ca192[_0x3e90('0x8')][_0x3e90('0xd')],function(_0x27495c){return{'model':db[_0x27495c[_0x3e90('0xf')]],'as':_0x27495c['as'],'attributes':_0x27495c[_0x3e90('0xb')],'include':_0x27495c[_0x3e90('0xd')]?_['map'](_0x27495c[_0x3e90('0xd')],function(_0x18193e){return{'model':db[_0x18193e[_0x3e90('0xf')]],'as':_0x18193e['as'],'attributes':_0x18193e[_0x3e90('0xb')],'include':_0x18193e['include']?_[_0x3e90('0xe')](_0x18193e[_0x3e90('0xd')],function(_0x2f8e2d){return{'model':db[_0x2f8e2d[_0x3e90('0xf')]],'as':_0x2f8e2d['as'],'attributes':_0x2f8e2d[_0x3e90('0xb')]};}):[]};}):[]};}):[]:[]})[_0x3e90('0x10')](function(_0x494b2c){logger[_0x3e90('0x11')](_0x3e90('0x16'),_0x4ca192);logger[_0x3e90('0x12')](_0x3e90('0x16'),_0x4ca192,JSON[_0x3e90('0x13')](_0x494b2c));_0x56ed6c(_0x494b2c);})[_0x3e90('0x17')](function(_0x977683){logger['error'](_0x3e90('0x16'),_0x977683['message'],_0x4ca192);_0x1b9e4b(_0x11a863[_0x3e90('0x18')](0x1f4,_0x977683[_0x3e90('0x14')]));});});};exports['CreateCmHopper']=function(_0x105f6f){var _0x35e9a7=this;return new Promise(function(_0x3174fb,_0x5afae2){return db['CmHopper'][_0x3e90('0x19')](_0x105f6f[_0x3e90('0x1a')],{'raw':_0x105f6f[_0x3e90('0x8')]?_0x105f6f['options'][_0x3e90('0x9')]===undefined?!![]:![]:!![]})[_0x3e90('0x10')](function(_0x11dda7){logger[_0x3e90('0x11')](_0x3e90('0x1b'),_0x105f6f);logger[_0x3e90('0x12')](_0x3e90('0x1b'),_0x105f6f,JSON[_0x3e90('0x13')](_0x11dda7));_0x3174fb(_0x11dda7);})[_0x3e90('0x17')](function(_0xaec89d){logger[_0x3e90('0x18')]('CreateCmHopper',_0xaec89d[_0x3e90('0x14')],_0x105f6f);_0x5afae2(_0x35e9a7[_0x3e90('0x18')](0x1f4,_0xaec89d[_0x3e90('0x14')]));});});};exports[_0x3e90('0x1c')]=function(_0x14e276){var _0x10fd03=this;return new Promise(function(_0xba2a37,_0x5d2299){return db[_0x3e90('0x6')][_0x3e90('0x1d')](_0x14e276[_0x3e90('0x1a')],{'raw':_0x14e276[_0x3e90('0x8')]?_0x14e276['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14e276[_0x3e90('0x8')]?_0x14e276['options']['where']||null:null,'attributes':_0x14e276[_0x3e90('0x8')]?_0x14e276[_0x3e90('0x8')]['attributes']||null:null,'limit':_0x14e276[_0x3e90('0x8')]?_0x14e276['options'][_0x3e90('0xc')]||null:null})[_0x3e90('0x10')](function(_0x32ec9a){logger[_0x3e90('0x11')](_0x3e90('0x1c'),_0x14e276);logger['info'](_0x3e90('0x1e'),JSON[_0x3e90('0x13')](_0x14e276[_0x3e90('0x8')][_0x3e90('0xa')]),_0x14e276[_0x3e90('0x1a')][_0x3e90('0x1f')]);logger[_0x3e90('0x12')](_0x3e90('0x1c'),_0x14e276,JSON['stringify'](_0x32ec9a));_0xba2a37(_0x32ec9a);})[_0x3e90('0x17')](function(_0x2f26b9){logger[_0x3e90('0x18')](_0x3e90('0x1c'),_0x2f26b9[_0x3e90('0x14')],_0x14e276);_0x5d2299(_0x10fd03[_0x3e90('0x18')](0x1f4,_0x2f26b9[_0x3e90('0x14')]));});});};exports[_0x3e90('0x20')]=function(_0x57c84d){var _0x1f74b2=this;return new Promise(function(_0x23def2,_0xc773df){return db[_0x3e90('0x6')][_0x3e90('0x21')]({'where':_0x57c84d[_0x3e90('0x8')]?_0x57c84d[_0x3e90('0x8')][_0x3e90('0xa')]||null:null})[_0x3e90('0x10')](function(_0x5f172c){logger['info']('DestroyCmHopper',_0x57c84d);logger[_0x3e90('0x12')](_0x3e90('0x20'),_0x57c84d,JSON[_0x3e90('0x13')](_0x5f172c));_0x23def2(_0x5f172c);})['catch'](function(_0x59c869){logger[_0x3e90('0x18')](_0x3e90('0x20'),_0x59c869['message'],_0x57c84d);_0xc773df(_0x1f74b2[_0x3e90('0x18')](0x1f4,_0x59c869[_0x3e90('0x14')]));});});};exports[_0x3e90('0x22')]=function(_0xfbf098){var _0x1d6a70=this;return new Promise(function(_0x185160,_0x562dbc){return db[_0x3e90('0x23')][_0x3e90('0x24')]()['then'](function(_0x36e2c7){return db[_0x3e90('0x25')][_0x3e90('0x26')](function(_0x4d3c47){return db[_0x3e90('0x6')]['findAll']({'where':_0xfbf098[_0x3e90('0x8')]?_0xfbf098['options'][_0x3e90('0xa')]||null:null,'attributes':_0xfbf098[_0x3e90('0x8')]?_0xfbf098['options'][_0x3e90('0xb')]||null:null,'limit':_0xfbf098[_0x3e90('0x8')]?_0xfbf098[_0x3e90('0x8')]['limit']||null:null,'order':_0xfbf098[_0x3e90('0x8')]?_0xfbf098[_0x3e90('0x8')][_0x3e90('0x27')]||null:null,'transaction':_0x4d3c47,'lock':_0x4d3c47[_0x3e90('0x28')][_0x3e90('0x29')],'include':[{'model':db['CmContact'],'as':_0x3e90('0x2a'),'attributes':_[_0x3e90('0x2b')](_0x36e2c7)},{'model':db[_0x3e90('0x2c')],'as':_0x3e90('0x2d'),'attributes':['id',_0x3e90('0x2e'),_0x3e90('0x2f')]}]})['then'](function(_0x441cbd){var _0xdd3d8b=[];var _0x3442dc=[];for(var _0x5d5f42=0x0;_0x5d5f42<_0x441cbd['length'];_0x5d5f42+=0x1){var _0x4b1ec0=_0x441cbd[_0x5d5f42]['UserId'];if(_0x4b1ec0===null){_0xdd3d8b[_0x3e90('0x30')](_0x441cbd[_0x5d5f42][_0x3e90('0x1d')](_0xfbf098[_0x3e90('0x1a')],{'transaction':_0x4d3c47}));}else if(!_0x3442dc[_0x3e90('0x31')](_0x4b1ec0)){_0x3442dc[_0x3e90('0x30')](_0x4b1ec0);_0xdd3d8b[_0x3e90('0x30')](_0x441cbd[_0x5d5f42][_0x3e90('0x1d')](_0xfbf098[_0x3e90('0x1a')],{'transaction':_0x4d3c47}));}}return BPromise[_0x3e90('0x32')](_0xdd3d8b);});})['then'](function(_0x1fa3dc){logger[_0x3e90('0x11')]('GetContactDialer',_0xfbf098);if(_0x1fa3dc[_0x3e90('0x33')]>0x0){logger[_0x3e90('0x11')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x1fa3dc[0x0]['dataValues']['id'],_0x1fa3dc[0x0][_0x3e90('0x34')][_0x3e90('0x35')],_0x1fa3dc[0x0]['dataValues'][_0x3e90('0x1f')]);}logger[_0x3e90('0x12')](_0x3e90('0x22'),_0xfbf098,JSON[_0x3e90('0x13')](_0x1fa3dc));_0x185160(_0x1fa3dc);})[_0x3e90('0x17')](function(_0x2f7e95){logger[_0x3e90('0x18')](_0x3e90('0x22'),_0x2f7e95[_0x3e90('0x14')],_0xfbf098);_0x562dbc(_0x1d6a70[_0x3e90('0x18')](0x1f4,_0x2f7e95[_0x3e90('0x14')]));});});});};exports[_0x3e90('0x36')]=function(_0x510ac5){var _0x5821e6=this;return new Promise(function(_0x194439,_0x55830e){return db[_0x3e90('0x25')]['transaction'](function(_0x1e085a){return db[_0x3e90('0x37')][_0x3e90('0x19')](_0x510ac5[_0x3e90('0x1a')],{'raw':_0x510ac5[_0x3e90('0x8')]?_0x510ac5[_0x3e90('0x8')][_0x3e90('0x9')]===undefined?!![]:![]:!![],'transaction':_0x1e085a})[_0x3e90('0x10')](function(){logger[_0x3e90('0x11')](_0x3e90('0x38'),JSON[_0x3e90('0x13')](_0x510ac5[_0x3e90('0x8')][_0x3e90('0xa')]),_0x510ac5[_0x3e90('0x8')][_0x3e90('0xa')]['active']);return db['CmHopper'][_0x3e90('0x21')]({'where':_0x510ac5[_0x3e90('0x8')]?_0x510ac5[_0x3e90('0x8')][_0x3e90('0xa')]||null:null,'transaction':_0x1e085a});});})[_0x3e90('0x10')](function(_0x37d8ef){logger['info'](_0x3e90('0x36'),_0x510ac5);logger[_0x3e90('0x12')](_0x3e90('0x36'),_0x510ac5,JSON[_0x3e90('0x13')](_0x37d8ef));_0x194439(_0x37d8ef);})[_0x3e90('0x17')](function(_0x4c118b){logger[_0x3e90('0x18')](_0x3e90('0x36'),_0x4c118b[_0x3e90('0x14')],_0x510ac5);_0x55830e(_0x5821e6[_0x3e90('0x18')](0x1f4,_0x4c118b[_0x3e90('0x14')]));});});};exports[_0x3e90('0x39')]=function(_0x542a65){var _0x3fbc98=this;return new Promise(function(_0x2a149e,_0x40e534){return db['CmHopper']['findAll']({'raw':_0x542a65[_0x3e90('0x8')]?_0x542a65[_0x3e90('0x8')][_0x3e90('0x9')]===undefined?!![]:![]:!![],'where':_0x542a65[_0x3e90('0x8')]?_0x542a65[_0x3e90('0x8')][_0x3e90('0xa')]||null:null,'attributes':[[db[_0x3e90('0x25')]['fn'](_0x3e90('0x3a'),db[_0x3e90('0x25')]['fn']('IF',db[_0x3e90('0x25')][_0x3e90('0x3b')]('`scheduledat`\x20>=\x20'+util[_0x3e90('0x3c')](_0x3e90('0x3d'),moment()[_0x3e90('0x3c')](_0x3e90('0x3e')))+'\x20,\x201,\x20null'))),_0x3e90('0x3f')]]})[_0x3e90('0x10')](function(_0x3a5dcd){logger[_0x3e90('0x11')](_0x3e90('0x39'),_0x542a65);logger[_0x3e90('0x12')](_0x3e90('0x39'),_0x542a65,JSON[_0x3e90('0x13')](_0x3a5dcd));_0x2a149e(_0x3a5dcd);})['catch'](function(_0x468f82){logger['error'](_0x3e90('0x39'),_0x468f82['message'],_0x542a65);_0x40e534(_0x3fbc98['error'](0x1f4,_0x468f82[_0x3e90('0x14')]));});});};exports[_0x3e90('0x40')]=function(_0x49ecbc){var _0x250280=this;return new Promise(function(_0x171530,_0x130ae8){return db[_0x3e90('0x23')][_0x3e90('0x24')]()[_0x3e90('0x10')](function(){return db['sequelize'][_0x3e90('0x26')](function(_0x19a8b5){return db[_0x3e90('0x6')]['findAll']({'where':_0x49ecbc[_0x3e90('0x8')]?_0x49ecbc['options']['where']||null:null,'attributes':_0x49ecbc[_0x3e90('0x8')]?_0x49ecbc[_0x3e90('0x8')][_0x3e90('0xb')]||null:null,'limit':0x1,'order':_0x49ecbc[_0x3e90('0x8')]?_0x49ecbc['options']['order']||null:null,'group':db[_0x3e90('0x6')][_0x3e90('0x41')],'transaction':_0x19a8b5,'lock':_0x19a8b5[_0x3e90('0x28')][_0x3e90('0x29')],'include':_0x49ecbc[_0x3e90('0x8')]?_0x49ecbc[_0x3e90('0x8')][_0x3e90('0xd')]?_[_0x3e90('0xe')](_0x49ecbc[_0x3e90('0x8')][_0x3e90('0xd')],function(_0x45f56b){return{'model':db[_0x45f56b[_0x3e90('0xf')]],'as':_0x45f56b['as'],'attributes':_0x45f56b['attributes'],'include':_0x45f56b['include']?_['map'](_0x45f56b[_0x3e90('0xd')],function(_0x2a883e){return{'model':db[_0x2a883e['model']],'as':_0x2a883e['as'],'attributes':_0x2a883e[_0x3e90('0xb')],'include':_0x2a883e['include']?_[_0x3e90('0xe')](_0x2a883e['include'],function(_0x289416){return{'model':db[_0x289416[_0x3e90('0xf')]],'as':_0x289416['as'],'attributes':_0x289416[_0x3e90('0xb')]};}):[]};}):[]};}):[]:[]})[_0x3e90('0x10')](function(_0x212e2b){var _0x37d7f7=[];for(var _0x42d4e5=0x0;_0x42d4e5<_0x212e2b[_0x3e90('0x33')];_0x42d4e5+=0x1){_0x37d7f7[_0x3e90('0x30')](_0x212e2b[_0x42d4e5][_0x3e90('0x1d')](_0x49ecbc[_0x3e90('0x1a')],{'transaction':_0x19a8b5}));}return BPromise[_0x3e90('0x32')](_0x37d7f7);});})['then'](function(_0x18a2ee){logger[_0x3e90('0x11')](_0x3e90('0x40'),_0x49ecbc);logger[_0x3e90('0x12')](_0x3e90('0x40'),_0x49ecbc,JSON[_0x3e90('0x13')](_0x18a2ee));_0x171530(_0x18a2ee);})[_0x3e90('0x17')](function(_0x461e28){logger[_0x3e90('0x18')](_0x3e90('0x40'),_0x461e28[_0x3e90('0x14')],_0x49ecbc);_0x130ae8(_0x250280[_0x3e90('0x18')](0x1f4,_0x461e28[_0x3e90('0x14')]));});});});};exports[_0x3e90('0x42')]=function(_0x536ae0){var _0x88ae1a=this;return new Promise(function(_0x5b102a,_0x49fcf1){db[_0x3e90('0x23')][_0x3e90('0x24')]()[_0x3e90('0x10')](function(_0x6d1aba){return db[_0x3e90('0x6')]['findAll']({'raw':_0x536ae0['options']?_0x536ae0['options'][_0x3e90('0x9')]===undefined?!![]:![]:!![],'where':_0x536ae0[_0x3e90('0x8')]?_0x536ae0['options'][_0x3e90('0xa')]||null:null,'attributes':_0x536ae0[_0x3e90('0x8')]?_0x536ae0[_0x3e90('0x8')][_0x3e90('0xb')]||null:null,'limit':_0x536ae0['options']?_0x536ae0[_0x3e90('0x8')][_0x3e90('0xc')]||null:null,'include':_0x536ae0[_0x3e90('0x8')]?_0x536ae0[_0x3e90('0x8')][_0x3e90('0xd')]?_[_0x3e90('0xe')](_0x536ae0[_0x3e90('0x8')][_0x3e90('0xd')],function(_0x440f5c){return{'model':db[_0x440f5c[_0x3e90('0xf')]],'as':_0x440f5c['as'],'attributes':_0x440f5c['as']===_0x3e90('0x2a')?_[_0x3e90('0x2b')](_0x6d1aba):_0x440f5c[_0x3e90('0xb')],'include':_0x440f5c[_0x3e90('0xd')]?_[_0x3e90('0xe')](_0x440f5c[_0x3e90('0xd')],function(_0x5b6728){return{'model':db[_0x5b6728[_0x3e90('0xf')]],'as':_0x5b6728['as'],'attributes':_0x5b6728[_0x3e90('0xb')],'include':_0x5b6728['include']?_[_0x3e90('0xe')](_0x5b6728[_0x3e90('0xd')],function(_0x218162){return{'model':db[_0x218162['model']],'as':_0x218162['as'],'attributes':_0x218162[_0x3e90('0xb')]};}):[]};}):[]};}):[]:[]})[_0x3e90('0x10')](function(_0x1f89e8){logger[_0x3e90('0x11')]('GetCmHopper',_0x536ae0);logger[_0x3e90('0x12')](_0x3e90('0x5'),_0x536ae0,JSON['stringify'](_0x1f89e8));_0x5b102a(_0x1f89e8);})[_0x3e90('0x17')](function(_0x395b2b){logger[_0x3e90('0x18')]('GetCmHopper',_0x395b2b[_0x3e90('0x14')],_0x536ae0);_0x49fcf1(_0x88ae1a[_0x3e90('0x18')](0x1f4,_0x395b2b['message']));});});});};exports['GetContactByPhone']=function(_0x4b684c){var _0x5af24e=this;return new Promise(function(_0x57a1d5,_0xbbaf4b){return db[_0x3e90('0x23')][_0x3e90('0x43')]({'raw':!![],'where':{'phone':_0x4b684c[_0x3e90('0x8')]['where'][_0x3e90('0x44')]},'attributes':['id',_0x3e90('0x45')],'order':[['id',_0x3e90('0x46')]]})[_0x3e90('0x10')](function(_0x526d37){logger[_0x3e90('0x11')](_0x3e90('0x47'),_0x4b684c);logger[_0x3e90('0x12')](_0x3e90('0x47'),_0x4b684c,JSON['stringify'](_0x526d37));_0x57a1d5(_0x526d37);})[_0x3e90('0x17')](function(_0x4fe4b9){logger[_0x3e90('0x18')](_0x3e90('0x47'),_0x4fe4b9[_0x3e90('0x14')],_0x4b684c);_0xbbaf4b(_0x5af24e[_0x3e90('0x18')](0x1f4,_0x4fe4b9[_0x3e90('0x14')]));});});};exports['ResetActiveCalls']=function(_0x505450){var _0x8bc74d=this;return new Promise(function(_0x5eaaa9,_0x224ff7){return db['sequelize'][_0x3e90('0x26')](function(_0x587c01){var _0x1a802a=_0x505450[_0x3e90('0x8')]&&_0x505450['options'][_0x3e90('0xa')]?_0x505450[_0x3e90('0x8')][_0x3e90('0xa')]:{};return db[_0x3e90('0x6')][_0x3e90('0x1d')](_0x505450[_0x3e90('0x1a')],{'where':_0x1a802a,'transaction':_0x587c01})[_0x3e90('0x10')](function(_0x4be731){logger[_0x3e90('0x11')](_0x3e90('0x48'),_0x505450);logger['debug']('ResetActiveCalls',_0x505450,JSON['stringify'](_0x4be731));_0x5eaaa9(_0x4be731);})[_0x3e90('0x17')](function(_0x2cb7af){logger[_0x3e90('0x18')](_0x3e90('0x48'),_0x2cb7af[_0x3e90('0x14')],_0x505450);_0x224ff7(_0x8bc74d[_0x3e90('0x18')](0x1f4,_0x2cb7af[_0x3e90('0x14')]));});});});};exports[_0x3e90('0x49')]=function(_0x28b3ac){var _0x1e6373=this;var _0xaf40d1=_0x28b3ac['body']['where'][_0x3e90('0x4a')];var _0x326f76=_0x28b3ac['body'][_0x3e90('0xa')][_0x3e90('0x4b')];var _0xd2aadc=_0x28b3ac['body'][_0x3e90('0xa')][_0x3e90('0x4c')];return new Promise(function(_0x5786d7,_0x20f7a0){return db[_0x3e90('0x6')][_0x3e90('0x7')]({'where':{'voiceQueueId':{'$in':_0xaf40d1},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x3e90('0x3b')](_0x3e90('0x4d')+_0x326f76+'\x20MINUTE'),'$gt':db[_0x3e90('0x25')][_0x3e90('0x3b')](_0x3e90('0x4e'))}},'UserId':{'$in':_0xd2aadc}},'include':[{'model':db[_0x3e90('0x23')],'as':'Contact'},{'model':db[_0x3e90('0x2c')],'as':_0x3e90('0x2d'),'attributes':['id',_0x3e90('0x2e'),_0x3e90('0x2f')]},{'model':db[_0x3e90('0x4f')],'as':_0x3e90('0x50')}]})[_0x3e90('0x10')](function(_0x4b4885){if(_0x4b4885['length']>0x0){return db['sequelize'][_0x3e90('0x26')](function(_0x32ed04){return db[_0x3e90('0x6')][_0x3e90('0x1d')]({'recallmeNotifiedDate':db[_0x3e90('0x25')][_0x3e90('0x3b')]('NOW()')},{'where':{'id':{'$in':_[_0x3e90('0xe')](_0x4b4885,'id')}},'transaction':_0x32ed04})[_0x3e90('0x10')](function(){_0x5786d7(_0x4b4885);})[_0x3e90('0x17')](function(_0x4ae039){logger[_0x3e90('0x18')](_0x3e90('0x49'),_0x4ae039[_0x3e90('0x14')],_0x28b3ac);_0x20f7a0(_0x1e6373[_0x3e90('0x18')](0x1f4,_0x4ae039[_0x3e90('0x14')]));});})[_0x3e90('0x17')](function(_0x40fc12){logger[_0x3e90('0x18')](_0x3e90('0x49'),_0x40fc12[_0x3e90('0x14')],_0x28b3ac);_0x20f7a0(_0x1e6373[_0x3e90('0x18')](0x1f4,_0x40fc12['message']));});}else{_0x5786d7(_0x4b4885);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index efb90d0..2ea28c3 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 _0x038d=['getOpenContacts','/timezones','getTimezones','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone','put','update','delete','/:id','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','/describe','describe','/opencontacts'];(function(_0x14fbba,_0x2c4ea1){var _0x36e594=function(_0x2616d8){while(--_0x2616d8){_0x14fbba['push'](_0x14fbba['shift']());}};_0x36e594(++_0x2c4ea1);}(_0x038d,0x1eb));var _0xd038=function(_0x420b89,_0xb4c01e){_0x420b89=_0x420b89-0x0;var _0x13e2a3=_0x038d[_0x420b89];return _0x13e2a3;};'use strict';var express=require(_0xd038('0x0'));var router=express[_0xd038('0x1')]();var auth=require(_0xd038('0x2'));var controller=require(_0xd038('0x3'));router[_0xd038('0x4')]('/',auth[_0xd038('0x5')](),controller['index']);router[_0xd038('0x4')](_0xd038('0x6'),auth[_0xd038('0x5')](),controller[_0xd038('0x7')]);router[_0xd038('0x4')](_0xd038('0x8'),auth['isAuthenticated'](),controller[_0xd038('0x9')]);router[_0xd038('0x4')](_0xd038('0xa'),auth['isAuthenticated'](),controller[_0xd038('0xb')]);router[_0xd038('0x4')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd038('0x4')](_0xd038('0xc'),auth[_0xd038('0x5')](),controller[_0xd038('0xd')]);router[_0xd038('0xe')]('/',auth[_0xd038('0x5')](),controller[_0xd038('0xf')]);router['post'](_0xd038('0x10'),auth[_0xd038('0x5')](),controller[_0xd038('0x11')]);router[_0xd038('0xe')]('/timezone',auth[_0xd038('0x5')](),controller[_0xd038('0x12')]);router[_0xd038('0x13')]('/:id',auth[_0xd038('0x5')](),controller[_0xd038('0x14')]);router[_0xd038('0x15')](_0xd038('0x16'),auth[_0xd038('0x5')](),controller[_0xd038('0x17')]);module[_0xd038('0x18')]=router; \ No newline at end of file +var _0x10fe=['/:id','show','/:id/previewrecall','getPreviewRecall','post','getPreview','/timezone','delete','destroy','express','Router','../../components/auth/service','get','isAuthenticated','index','describe','getOpenContacts','/timezones','getTimezones'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x10fe,0xc7));var _0xe10f=function(_0x50708b,_0x4cd832){_0x50708b=_0x50708b-0x0;var _0x447e27=_0x10fe[_0x50708b];return _0x447e27;};'use strict';var express=require(_0xe10f('0x0'));var router=express[_0xe10f('0x1')]();var auth=require(_0xe10f('0x2'));var controller=require('./cmHopper.controller');router[_0xe10f('0x3')]('/',auth[_0xe10f('0x4')](),controller[_0xe10f('0x5')]);router[_0xe10f('0x3')]('/describe',auth[_0xe10f('0x4')](),controller[_0xe10f('0x6')]);router[_0xe10f('0x3')]('/opencontacts',auth['isAuthenticated'](),controller[_0xe10f('0x7')]);router[_0xe10f('0x3')](_0xe10f('0x8'),auth[_0xe10f('0x4')](),controller[_0xe10f('0x9')]);router[_0xe10f('0x3')](_0xe10f('0xa'),auth['isAuthenticated'](),controller[_0xe10f('0xb')]);router[_0xe10f('0x3')](_0xe10f('0xc'),auth[_0xe10f('0x4')](),controller[_0xe10f('0xd')]);router[_0xe10f('0xe')]('/',auth[_0xe10f('0x4')](),controller['create']);router[_0xe10f('0xe')]('/preview',auth[_0xe10f('0x4')](),controller[_0xe10f('0xf')]);router['post'](_0xe10f('0x10'),auth[_0xe10f('0x4')](),controller['getTimezone']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe10f('0x11')](_0xe10f('0xa'),auth[_0xe10f('0x4')](),controller[_0xe10f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index e8ff31a..fb32d68 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14d=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','format'];(function(_0x2aae3f,_0x214ac8){var _0x1b6741=function(_0x405c02){while(--_0x405c02){_0x2aae3f['push'](_0x2aae3f['shift']());}};_0x1b6741(++_0x214ac8);}(_0xe14d,0xb5));var _0xde14=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xe14d[_0x6cf19c];return _0xce14f3;};'use strict';var moment=require(_0xde14('0x0'));var Sequelize=require(_0xde14('0x1'));module[_0xde14('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xde14('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xde14('0x4')](_0xde14('0x5'))},'countbusyretry':{'type':Sequelize[_0xde14('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xde14('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xde14('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xde14('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1246=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','INTEGER'];(function(_0x28f61d,_0x147a60){var _0x19ac82=function(_0x748712){while(--_0x748712){_0x28f61d['push'](_0x28f61d['shift']());}};_0x19ac82(++_0x147a60);}(_0x1246,0x154));var _0x6124=function(_0x1e45b5,_0x309efe){_0x1e45b5=_0x1e45b5-0x0;var _0x3cd4b9=_0x1246[_0x1e45b5];return _0x3cd4b9;};'use strict';var moment=require(_0x6124('0x0'));var Sequelize=require(_0x6124('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x6124('0x2')]},'phone':{'type':Sequelize[_0x6124('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x6124('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x6124('0x4')],'defaultValue':moment()[_0x6124('0x5')](_0x6124('0x6'))},'countbusyretry':{'type':Sequelize[_0x6124('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6124('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6124('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6124('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6124('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6124('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 1640653..8c84cb7 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fbb=['CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','stack','send','index','map','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','CmHopperAdditionalPhone','count','includeAll','include','findAll','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x1fbb,0x10c));var _0xb1fb=function(_0x590e3c,_0x596a9a){_0x590e3c=_0x590e3c-0x0;var _0x183f26=_0x1fbb[_0x590e3c];return _0x183f26;};'use strict';var emlformat=require(_0xb1fb('0x0'));var rimraf=require(_0xb1fb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb1fb('0x2'));var rp=require(_0xb1fb('0x3'));var moment=require(_0xb1fb('0x4'));var BPromise=require(_0xb1fb('0x5'));var Mustache=require('mustache');var util=require(_0xb1fb('0x6'));var path=require('path');var sox=require(_0xb1fb('0x7'));var csv=require(_0xb1fb('0x8'));var ejs=require(_0xb1fb('0x9'));var fs=require('fs');var fs_extra=require(_0xb1fb('0xa'));var _=require(_0xb1fb('0xb'));var squel=require(_0xb1fb('0xc'));var crypto=require(_0xb1fb('0xd'));var jsforce=require(_0xb1fb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb1fb('0x8'));var querystring=require(_0xb1fb('0xf'));var Papa=require(_0xb1fb('0x10'));var Redis=require(_0xb1fb('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb1fb('0x12'));var hardwareService=require(_0xb1fb('0x13'));var logger=require(_0xb1fb('0x14'))(_0xb1fb('0x15'));var utils=require(_0xb1fb('0x16'));var config=require(_0xb1fb('0x17'));var licenseUtil=require(_0xb1fb('0x18'));var db=require(_0xb1fb('0x19'))['db'];function respondWithStatusCode(_0x56ccdb,_0x389cc7){_0x389cc7=_0x389cc7||0xcc;return function(_0x7bf660){if(_0x7bf660){return _0x56ccdb[_0xb1fb('0x1a')](_0x389cc7);}return _0x56ccdb[_0xb1fb('0x1b')](_0x389cc7)['end']();};}function respondWithResult(_0x5e4a3d,_0x135fda){_0x135fda=_0x135fda||0xc8;return function(_0x520f27){if(_0x520f27){return _0x5e4a3d[_0xb1fb('0x1b')](_0x135fda)[_0xb1fb('0x1c')](_0x520f27);}};}function respondWithFilteredResult(_0x249685,_0xe2cf40){return function(_0x57905a){if(_0x57905a){var _0xa429b5=typeof _0xe2cf40[_0xb1fb('0x1d')]===_0xb1fb('0x1e')&&typeof _0xe2cf40[_0xb1fb('0x1f')]===_0xb1fb('0x1e');var _0xcc15d5=_0x57905a['count'];var _0x1ea07b=_0xa429b5?0x0:_0xe2cf40[_0xb1fb('0x1d')];var _0x17fcc1=_0xa429b5?_0x57905a['count']:_0xe2cf40['offset']+_0xe2cf40[_0xb1fb('0x1f')];var _0x4ce1b8;if(_0x17fcc1>=_0xcc15d5){_0x17fcc1=_0xcc15d5;_0x4ce1b8=0xc8;}else{_0x4ce1b8=0xce;}_0x249685[_0xb1fb('0x1b')](_0x4ce1b8);return _0x249685[_0xb1fb('0x20')](_0xb1fb('0x21'),_0x1ea07b+'-'+_0x17fcc1+'/'+_0xcc15d5)['json'](_0x57905a);}return null;};}function patchUpdates(_0x37c53c){return function(_0x3c4b14){try{jsonpatch['apply'](_0x3c4b14,_0x37c53c,!![]);}catch(_0x622e32){return BPromise[_0xb1fb('0x22')](_0x622e32);}return _0x3c4b14[_0xb1fb('0x23')]();};}function saveUpdates(_0x1d02b2,_0x17225e){return function(_0x253319){if(_0x253319){return _0x253319[_0xb1fb('0x24')](_0x1d02b2)[_0xb1fb('0x25')](function(_0x435330){return _0x435330;});}return null;};}function removeEntity(_0x199ac3,_0x2fdf2b){return function(_0xc205e3){if(_0xc205e3){return _0xc205e3[_0xb1fb('0x26')]()[_0xb1fb('0x25')](function(){var _0x574e96=_0xc205e3[_0xb1fb('0x27')]({'plain':!![]});var _0x2e4e77='CmHopperAdditionalPhones';return db[_0xb1fb('0x28')][_0xb1fb('0x26')]({'where':{'type':_0x2e4e77,'resourceId':_0x574e96['id']}})['then'](function(){return _0xc205e3;});})[_0xb1fb('0x25')](function(){_0x199ac3[_0xb1fb('0x1b')](0xcc)[_0xb1fb('0x29')]();});}};}function handleEntityNotFound(_0x32c6b5,_0x522b58){return function(_0x13507){if(!_0x13507){_0x32c6b5[_0xb1fb('0x1a')](0x194);}return _0x13507;};}function handleError(_0x1f159f,_0x1bb28d){_0x1bb28d=_0x1bb28d||0x1f4;return function(_0x1e5523){logger['error'](_0x1e5523[_0xb1fb('0x2a')]);if(_0x1e5523['name']){delete _0x1e5523['name'];}_0x1f159f[_0xb1fb('0x1b')](_0x1bb28d)[_0xb1fb('0x2b')](_0x1e5523);};}exports[_0xb1fb('0x2c')]=function(_0x23197c,_0x2be21f){var _0x43de82={},_0x31441e={},_0x113047={'count':0x0,'rows':[]};var _0xc23b6d=_[_0xb1fb('0x2d')](db['CmHopperAdditionalPhone'][_0xb1fb('0x2e')],function(_0x37cae9){return{'name':_0x37cae9[_0xb1fb('0x2f')],'type':_0x37cae9['type'][_0xb1fb('0x30')]};});_0x31441e[_0xb1fb('0x31')]=_[_0xb1fb('0x2d')](_0xc23b6d,_0xb1fb('0x32'));_0x31441e[_0xb1fb('0x33')]=_[_0xb1fb('0x34')](_0x23197c[_0xb1fb('0x33')]);_0x31441e[_0xb1fb('0x35')]=_[_0xb1fb('0x36')](_0x31441e[_0xb1fb('0x31')],_0x31441e[_0xb1fb('0x33')]);_0x43de82[_0xb1fb('0x37')]=_['intersection'](_0x31441e[_0xb1fb('0x31')],qs[_0xb1fb('0x38')](_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x38')]));_0x43de82[_0xb1fb('0x37')]=_0x43de82[_0xb1fb('0x37')][_0xb1fb('0x39')]?_0x43de82['attributes']:_0x31441e['model'];if(!_0x23197c[_0xb1fb('0x33')]['hasOwnProperty'](_0xb1fb('0x3a'))){_0x43de82[_0xb1fb('0x1f')]=qs['limit'](_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x1f')]);_0x43de82[_0xb1fb('0x1d')]=qs[_0xb1fb('0x1d')](_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x1d')]);}_0x43de82[_0xb1fb('0x3b')]=qs[_0xb1fb('0x3c')](_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x3c')]);_0x43de82[_0xb1fb('0x3d')]=qs['filters'](_[_0xb1fb('0x3e')](_0x23197c[_0xb1fb('0x33')],_0x31441e[_0xb1fb('0x35')]),_0xc23b6d);if(_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x3f')]){_0x43de82[_0xb1fb('0x3d')]=_['merge'](_0x43de82[_0xb1fb('0x3d')],{'$or':_[_0xb1fb('0x2d')](_0xc23b6d,function(_0x483fa1){if(_0x483fa1['type']!==_0xb1fb('0x40')){var _0x4fb2bf={};_0x4fb2bf[_0x483fa1['name']]={'$like':'%'+_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x3f')]+'%'};return _0x4fb2bf;}})});}_0x43de82=_[_0xb1fb('0x41')]({},_0x43de82,_0x23197c[_0xb1fb('0x42')]);var _0x4d7b78={'where':_0x43de82[_0xb1fb('0x3d')]};return db[_0xb1fb('0x43')][_0xb1fb('0x44')](_0x4d7b78)[_0xb1fb('0x25')](function(_0x21f615){_0x113047[_0xb1fb('0x44')]=_0x21f615;if(_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x45')]){_0x43de82[_0xb1fb('0x46')]=[{'all':!![]}];}return db[_0xb1fb('0x43')][_0xb1fb('0x47')](_0x43de82);})[_0xb1fb('0x25')](function(_0x37f26c){_0x113047['rows']=_0x37f26c;return _0x113047;})['then'](respondWithFilteredResult(_0x2be21f,_0x43de82))[_0xb1fb('0x48')](handleError(_0x2be21f,null));};exports[_0xb1fb('0x49')]=function(_0x4e87ef,_0x1da2af){var _0x2278d5={'raw':!![],'where':{'id':_0x4e87ef[_0xb1fb('0x4a')]['id']}},_0xacc5e9={};_0xacc5e9[_0xb1fb('0x31')]=_[_0xb1fb('0x34')](db[_0xb1fb('0x43')]['rawAttributes']);_0xacc5e9[_0xb1fb('0x33')]=_['keys'](_0x4e87ef[_0xb1fb('0x33')]);_0xacc5e9['filters']=_[_0xb1fb('0x36')](_0xacc5e9[_0xb1fb('0x31')],_0xacc5e9[_0xb1fb('0x33')]);_0x2278d5[_0xb1fb('0x37')]=_[_0xb1fb('0x36')](_0xacc5e9['model'],qs['fields'](_0x4e87ef[_0xb1fb('0x33')][_0xb1fb('0x38')]));_0x2278d5['attributes']=_0x2278d5[_0xb1fb('0x37')]['length']?_0x2278d5[_0xb1fb('0x37')]:_0xacc5e9[_0xb1fb('0x31')];if(_0x4e87ef['query'][_0xb1fb('0x45')]){_0x2278d5[_0xb1fb('0x46')]=[{'all':!![]}];}_0x2278d5=_['merge']({},_0x2278d5,_0x4e87ef['options']);return db['CmHopperAdditionalPhone'][_0xb1fb('0x4b')](_0x2278d5)['then'](handleEntityNotFound(_0x1da2af,null))[_0xb1fb('0x25')](respondWithResult(_0x1da2af,null))['catch'](handleError(_0x1da2af,null));};exports['create']=function(_0x508ce2,_0x56b972){return db[_0xb1fb('0x43')][_0xb1fb('0x4c')](_0x508ce2['body'],{})[_0xb1fb('0x25')](function(_0x40ab6f){var _0x3cc984=_0x508ce2[_0xb1fb('0x4d')]['get']({'plain':!![]});if(!_0x3cc984)throw new Error(_0xb1fb('0x4e'));if(_0x3cc984[_0xb1fb('0x4f')]==='user'){var _0x5b2178=_0x40ab6f[_0xb1fb('0x27')]({'plain':!![]});var _0x3f8ad1=_0xb1fb('0x50');return db[_0xb1fb('0x51')][_0xb1fb('0x4b')]({'where':{'name':_0x3f8ad1,'userProfileId':_0x3cc984[_0xb1fb('0x52')]},'raw':!![]})[_0xb1fb('0x25')](function(_0x4eb75e){if(_0x4eb75e&&_0x4eb75e[_0xb1fb('0x53')]===0x0){return db[_0xb1fb('0x28')][_0xb1fb('0x4c')]({'name':_0x5b2178[_0xb1fb('0x32')],'resourceId':_0x5b2178['id'],'type':_0x4eb75e[_0xb1fb('0x32')],'sectionId':_0x4eb75e['id']},{})[_0xb1fb('0x25')](function(){return _0x40ab6f;});}else{return _0x40ab6f;}})[_0xb1fb('0x48')](function(_0x3ea4e2){logger[_0xb1fb('0x54')](_0xb1fb('0x55'),_0x3ea4e2);throw _0x3ea4e2;});}return _0x40ab6f;})[_0xb1fb('0x25')](respondWithResult(_0x56b972,0xc9))['catch'](handleError(_0x56b972,null));};exports[_0xb1fb('0x24')]=function(_0x1d81ad,_0x182f2c){if(_0x1d81ad['body']['id']){delete _0x1d81ad['body']['id'];}return db[_0xb1fb('0x43')][_0xb1fb('0x4b')]({'where':{'id':_0x1d81ad['params']['id']}})[_0xb1fb('0x25')](handleEntityNotFound(_0x182f2c,null))['then'](saveUpdates(_0x1d81ad[_0xb1fb('0x56')],null))[_0xb1fb('0x25')](respondWithResult(_0x182f2c,null))['catch'](handleError(_0x182f2c,null));};exports[_0xb1fb('0x26')]=function(_0x313b7e,_0x4ae6a4){return db[_0xb1fb('0x43')][_0xb1fb('0x4b')]({'where':{'id':_0x313b7e['params']['id']}})[_0xb1fb('0x25')](handleEntityNotFound(_0x4ae6a4,null))[_0xb1fb('0x25')](removeEntity(_0x4ae6a4,null))[_0xb1fb('0x48')](handleError(_0x4ae6a4,null));}; \ No newline at end of file +var _0x6f65=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','CmHopperAdditionalPhone','includeAll','include','catch','show','params','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x17c4f1,_0x5404a0){var _0x35d085=function(_0x378137){while(--_0x378137){_0x17c4f1['push'](_0x17c4f1['shift']());}};_0x35d085(++_0x5404a0);}(_0x6f65,0x13d));var _0x56f6=function(_0x2f6ef9,_0x44b3a2){_0x2f6ef9=_0x2f6ef9-0x0;var _0x11887a=_0x6f65[_0x2f6ef9];return _0x11887a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x56f6('0x0'));var jsonpatch=require(_0x56f6('0x1'));var rp=require(_0x56f6('0x2'));var moment=require(_0x56f6('0x3'));var BPromise=require(_0x56f6('0x4'));var Mustache=require(_0x56f6('0x5'));var util=require(_0x56f6('0x6'));var path=require(_0x56f6('0x7'));var sox=require(_0x56f6('0x8'));var csv=require(_0x56f6('0x9'));var ejs=require(_0x56f6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x56f6('0xb'));var squel=require(_0x56f6('0xc'));var crypto=require(_0x56f6('0xd'));var jsforce=require(_0x56f6('0xe'));var deskjs=require(_0x56f6('0xf'));var toCsv=require(_0x56f6('0x9'));var querystring=require(_0x56f6('0x10'));var Papa=require('papaparse');var Redis=require(_0x56f6('0x11'));var authService=require(_0x56f6('0x12'));var qs=require(_0x56f6('0x13'));var as=require(_0x56f6('0x14'));var hardwareService=require(_0x56f6('0x15'));var logger=require(_0x56f6('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x56f6('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23fec5,_0x2e78cb){_0x2e78cb=_0x2e78cb||0xcc;return function(_0x3d3dad){if(_0x3d3dad){return _0x23fec5[_0x56f6('0x18')](_0x2e78cb);}return _0x23fec5['status'](_0x2e78cb)[_0x56f6('0x19')]();};}function respondWithResult(_0x295bc5,_0x35cec1){_0x35cec1=_0x35cec1||0xc8;return function(_0x2c2103){if(_0x2c2103){return _0x295bc5[_0x56f6('0x1a')](_0x35cec1)[_0x56f6('0x1b')](_0x2c2103);}};}function respondWithFilteredResult(_0x3142f8,_0x11d014){return function(_0x484b20){if(_0x484b20){var _0x515103=typeof _0x11d014[_0x56f6('0x1c')]===_0x56f6('0x1d')&&typeof _0x11d014[_0x56f6('0x1e')]===_0x56f6('0x1d');var _0x13b992=_0x484b20[_0x56f6('0x1f')];var _0x56b1dc=_0x515103?0x0:_0x11d014[_0x56f6('0x1c')];var _0x3c34c8=_0x515103?_0x484b20[_0x56f6('0x1f')]:_0x11d014['offset']+_0x11d014[_0x56f6('0x1e')];var _0x322752;if(_0x3c34c8>=_0x13b992){_0x3c34c8=_0x13b992;_0x322752=0xc8;}else{_0x322752=0xce;}_0x3142f8[_0x56f6('0x1a')](_0x322752);return _0x3142f8['set'](_0x56f6('0x20'),_0x56b1dc+'-'+_0x3c34c8+'/'+_0x13b992)['json'](_0x484b20);}return null;};}function patchUpdates(_0xcbe4b3){return function(_0x5e1e06){try{jsonpatch[_0x56f6('0x21')](_0x5e1e06,_0xcbe4b3,!![]);}catch(_0x3686f8){return BPromise[_0x56f6('0x22')](_0x3686f8);}return _0x5e1e06[_0x56f6('0x23')]();};}function saveUpdates(_0x40998a,_0x57e1c8){return function(_0xa515af){if(_0xa515af){return _0xa515af[_0x56f6('0x24')](_0x40998a)[_0x56f6('0x25')](function(_0x297028){return _0x297028;});}return null;};}function removeEntity(_0x572ebe,_0x192854){return function(_0x32f3e5){if(_0x32f3e5){return _0x32f3e5[_0x56f6('0x26')]()[_0x56f6('0x25')](function(){var _0xc6f873=_0x32f3e5[_0x56f6('0x27')]({'plain':!![]});var _0x286cc3=_0x56f6('0x28');return db[_0x56f6('0x29')][_0x56f6('0x26')]({'where':{'type':_0x286cc3,'resourceId':_0xc6f873['id']}})['then'](function(){return _0x32f3e5;});})['then'](function(){_0x572ebe['status'](0xcc)[_0x56f6('0x19')]();});}};}function handleEntityNotFound(_0x54fe5f,_0x54dbfc){return function(_0x1230f7){if(!_0x1230f7){_0x54fe5f[_0x56f6('0x18')](0x194);}return _0x1230f7;};}function handleError(_0x3ad553,_0x4fef44){_0x4fef44=_0x4fef44||0x1f4;return function(_0x566a1c){logger[_0x56f6('0x2a')](_0x566a1c['stack']);if(_0x566a1c[_0x56f6('0x2b')]){delete _0x566a1c['name'];}_0x3ad553[_0x56f6('0x1a')](_0x4fef44)[_0x56f6('0x2c')](_0x566a1c);};}exports['index']=function(_0xf35229,_0x2873da){var _0x3ea7ca={},_0x2312b3={},_0x113a91={'count':0x0,'rows':[]};var _0x2e7df2=_[_0x56f6('0x2d')](db['CmHopperAdditionalPhone'][_0x56f6('0x2e')],function(_0x391217){return{'name':_0x391217[_0x56f6('0x2f')],'type':_0x391217[_0x56f6('0x30')][_0x56f6('0x31')]};});_0x2312b3['model']=_['map'](_0x2e7df2,_0x56f6('0x2b'));_0x2312b3[_0x56f6('0x32')]=_[_0x56f6('0x33')](_0xf35229[_0x56f6('0x32')]);_0x2312b3[_0x56f6('0x34')]=_[_0x56f6('0x35')](_0x2312b3['model'],_0x2312b3['query']);_0x3ea7ca[_0x56f6('0x36')]=_['intersection'](_0x2312b3[_0x56f6('0x37')],qs[_0x56f6('0x38')](_0xf35229[_0x56f6('0x32')][_0x56f6('0x38')]));_0x3ea7ca[_0x56f6('0x36')]=_0x3ea7ca[_0x56f6('0x36')][_0x56f6('0x39')]?_0x3ea7ca['attributes']:_0x2312b3['model'];if(!_0xf35229[_0x56f6('0x32')][_0x56f6('0x3a')]('nolimit')){_0x3ea7ca[_0x56f6('0x1e')]=qs[_0x56f6('0x1e')](_0xf35229[_0x56f6('0x32')][_0x56f6('0x1e')]);_0x3ea7ca[_0x56f6('0x1c')]=qs[_0x56f6('0x1c')](_0xf35229[_0x56f6('0x32')][_0x56f6('0x1c')]);}_0x3ea7ca[_0x56f6('0x3b')]=qs[_0x56f6('0x3c')](_0xf35229[_0x56f6('0x32')][_0x56f6('0x3c')]);_0x3ea7ca[_0x56f6('0x3d')]=qs[_0x56f6('0x34')](_[_0x56f6('0x3e')](_0xf35229['query'],_0x2312b3[_0x56f6('0x34')]),_0x2e7df2);if(_0xf35229[_0x56f6('0x32')]['filter']){_0x3ea7ca['where']=_[_0x56f6('0x3f')](_0x3ea7ca[_0x56f6('0x3d')],{'$or':_[_0x56f6('0x2d')](_0x2e7df2,function(_0x578bde){if(_0x578bde[_0x56f6('0x30')]!==_0x56f6('0x40')){var _0x42c787={};_0x42c787[_0x578bde[_0x56f6('0x2b')]]={'$like':'%'+_0xf35229[_0x56f6('0x32')][_0x56f6('0x41')]+'%'};return _0x42c787;}})});}_0x3ea7ca=_['merge']({},_0x3ea7ca,_0xf35229[_0x56f6('0x42')]);var _0x24d9fe={'where':_0x3ea7ca['where']};return db[_0x56f6('0x43')]['count'](_0x24d9fe)[_0x56f6('0x25')](function(_0x2d4025){_0x113a91[_0x56f6('0x1f')]=_0x2d4025;if(_0xf35229[_0x56f6('0x32')][_0x56f6('0x44')]){_0x3ea7ca[_0x56f6('0x45')]=[{'all':!![]}];}return db[_0x56f6('0x43')]['findAll'](_0x3ea7ca);})[_0x56f6('0x25')](function(_0x5a8f1c){_0x113a91['rows']=_0x5a8f1c;return _0x113a91;})[_0x56f6('0x25')](respondWithFilteredResult(_0x2873da,_0x3ea7ca))[_0x56f6('0x46')](handleError(_0x2873da,null));};exports[_0x56f6('0x47')]=function(_0x2162c0,_0x507b8f){var _0x4302c5={'raw':!![],'where':{'id':_0x2162c0[_0x56f6('0x48')]['id']}},_0x1a69e7={};_0x1a69e7[_0x56f6('0x37')]=_[_0x56f6('0x33')](db[_0x56f6('0x43')][_0x56f6('0x2e')]);_0x1a69e7[_0x56f6('0x32')]=_[_0x56f6('0x33')](_0x2162c0[_0x56f6('0x32')]);_0x1a69e7[_0x56f6('0x34')]=_['intersection'](_0x1a69e7[_0x56f6('0x37')],_0x1a69e7[_0x56f6('0x32')]);_0x4302c5[_0x56f6('0x36')]=_[_0x56f6('0x35')](_0x1a69e7[_0x56f6('0x37')],qs[_0x56f6('0x38')](_0x2162c0['query'][_0x56f6('0x38')]));_0x4302c5[_0x56f6('0x36')]=_0x4302c5[_0x56f6('0x36')][_0x56f6('0x39')]?_0x4302c5[_0x56f6('0x36')]:_0x1a69e7[_0x56f6('0x37')];if(_0x2162c0[_0x56f6('0x32')][_0x56f6('0x44')]){_0x4302c5[_0x56f6('0x45')]=[{'all':!![]}];}_0x4302c5=_[_0x56f6('0x3f')]({},_0x4302c5,_0x2162c0[_0x56f6('0x42')]);return db['CmHopperAdditionalPhone']['find'](_0x4302c5)[_0x56f6('0x25')](handleEntityNotFound(_0x507b8f,null))[_0x56f6('0x25')](respondWithResult(_0x507b8f,null))['catch'](handleError(_0x507b8f,null));};exports[_0x56f6('0x49')]=function(_0x1023a0,_0x477f32){return db[_0x56f6('0x43')][_0x56f6('0x49')](_0x1023a0[_0x56f6('0x4a')],{})[_0x56f6('0x25')](function(_0x21f51d){var _0x2c9467=_0x1023a0[_0x56f6('0x4b')][_0x56f6('0x27')]({'plain':!![]});if(!_0x2c9467)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c9467['role']===_0x56f6('0x4b')){var _0x2f8d01=_0x21f51d[_0x56f6('0x27')]({'plain':!![]});var _0x56bded=_0x56f6('0x28');return db[_0x56f6('0x4c')][_0x56f6('0x4d')]({'where':{'name':_0x56bded,'userProfileId':_0x2c9467[_0x56f6('0x4e')]},'raw':!![]})[_0x56f6('0x25')](function(_0x1d866a){if(_0x1d866a&&_0x1d866a[_0x56f6('0x4f')]===0x0){return db[_0x56f6('0x29')][_0x56f6('0x49')]({'name':_0x2f8d01[_0x56f6('0x2b')],'resourceId':_0x2f8d01['id'],'type':_0x1d866a[_0x56f6('0x2b')],'sectionId':_0x1d866a['id']},{})[_0x56f6('0x25')](function(){return _0x21f51d;});}else{return _0x21f51d;}})['catch'](function(_0x1ed4fa){logger[_0x56f6('0x2a')](_0x56f6('0x50'),_0x1ed4fa);throw _0x1ed4fa;});}return _0x21f51d;})[_0x56f6('0x25')](respondWithResult(_0x477f32,0xc9))['catch'](handleError(_0x477f32,null));};exports[_0x56f6('0x24')]=function(_0x1232ac,_0x4cb0b4){if(_0x1232ac[_0x56f6('0x4a')]['id']){delete _0x1232ac[_0x56f6('0x4a')]['id'];}return db[_0x56f6('0x43')]['find']({'where':{'id':_0x1232ac[_0x56f6('0x48')]['id']}})[_0x56f6('0x25')](handleEntityNotFound(_0x4cb0b4,null))[_0x56f6('0x25')](saveUpdates(_0x1232ac[_0x56f6('0x4a')],null))[_0x56f6('0x25')](respondWithResult(_0x4cb0b4,null))[_0x56f6('0x46')](handleError(_0x4cb0b4,null));};exports['destroy']=function(_0x33d8df,_0x1e2afc){return db[_0x56f6('0x43')][_0x56f6('0x4d')]({'where':{'id':_0x33d8df[_0x56f6('0x48')]['id']}})[_0x56f6('0x25')](handleEntityNotFound(_0x1e2afc,null))[_0x56f6('0x25')](removeEntity(_0x1e2afc,null))[_0x56f6('0x46')](handleError(_0x1e2afc,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 1af32e7..3e59178 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c8d=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','util','../../config/logger'];(function(_0x68efcb,_0x2bc079){var _0x1ab270=function(_0x3b3a4a){while(--_0x3b3a4a){_0x68efcb['push'](_0x68efcb['shift']());}};_0x1ab270(++_0x2bc079);}(_0x1c8d,0x196));var _0xd1c8=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x1c8d[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0xd1c8('0x0'));var logger=require(_0xd1c8('0x1'))(_0xd1c8('0x2'));var moment=require(_0xd1c8('0x3'));var BPromise=require(_0xd1c8('0x4'));var rp=require(_0xd1c8('0x5'));var fs=require('fs');var path=require(_0xd1c8('0x6'));var rimraf=require('rimraf');var config=require(_0xd1c8('0x7'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0xd1c8('0x8')]=function(_0x51eccf,_0x20ddd2){return _0x51eccf[_0xd1c8('0x9')](_0xd1c8('0xa'),attributes,{'tableName':_0xd1c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1dc=['path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','cm_hopper_additional_phones','util','api','moment','bluebird','request-promise'];(function(_0x21b163,_0x4876ea){var _0x546e2f=function(_0x34e0f8){while(--_0x34e0f8){_0x21b163['push'](_0x21b163['shift']());}};_0x546e2f(++_0x4876ea);}(_0xb1dc,0x133));var _0xcb1d=function(_0x503564,_0x55867e){_0x503564=_0x503564-0x0;var _0x4be9fd=_0xb1dc[_0x503564];return _0x4be9fd;};'use strict';var _=require('lodash');var util=require(_0xcb1d('0x0'));var logger=require('../../config/logger')(_0xcb1d('0x1'));var moment=require(_0xcb1d('0x2'));var BPromise=require(_0xcb1d('0x3'));var rp=require(_0xcb1d('0x4'));var fs=require('fs');var path=require(_0xcb1d('0x5'));var rimraf=require(_0xcb1d('0x6'));var config=require(_0xcb1d('0x7'));var attributes=require(_0xcb1d('0x8'));module[_0xcb1d('0x9')]=function(_0x46d5cf,_0x1ad197){return _0x46d5cf[_0xcb1d('0xa')]('CmHopperAdditionalPhone',attributes,{'tableName':_0xcb1d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 1a80fcf..3818d59 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc799=['IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countcongestionretry','countnoanswerretry','countmachineretry','countagentrejectretry','entity','countnosuchnumberretry','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','minutes','add','phone','countbusyretry','countabandonedretry','createdAt','updatedAt','countdropretry','transaction','update'];(function(_0x5d4a99,_0x54e841){var _0x1ae21d=function(_0xc91b52){while(--_0xc91b52){_0x5d4a99['push'](_0x5d4a99['shift']());}};_0x1ae21d(++_0x54e841);}(_0xc799,0x1a6));var _0x9c79=function(_0xafb5e3,_0x3e25c4){_0xafb5e3=_0xafb5e3-0x0;var _0x62315f=_0xc799[_0xafb5e3];return _0x62315f;};'use strict';var _=require(_0x9c79('0x0'));var util=require(_0x9c79('0x1'));var moment=require(_0x9c79('0x2'));var BPromise=require(_0x9c79('0x3'));var rs=require(_0x9c79('0x4'));var fs=require('fs');var Redis=require(_0x9c79('0x5'));var db=require(_0x9c79('0x6'))['db'];var utils=require(_0x9c79('0x7'));var logger=require(_0x9c79('0x8'))('rpc');var config=require(_0x9c79('0x9'));var jayson=require(_0x9c79('0xa'));var client=jayson[_0x9c79('0xb')][_0x9c79('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x244a19,_0xe3be36,_0x64c7c4){return new BPromise(function(_0x23f5a4,_0x3e9e71){return client[_0x9c79('0xd')](_0x244a19,_0x64c7c4)[_0x9c79('0xe')](function(_0x1eae3c){logger[_0x9c79('0xf')](_0x9c79('0x10'),_0xe3be36,_0x9c79('0x11'));logger[_0x9c79('0x12')](_0x9c79('0x13'),_0xe3be36,_0x9c79('0x11'),JSON[_0x9c79('0x14')](_0x1eae3c));if(_0x1eae3c[_0x9c79('0x15')]){if(_0x1eae3c[_0x9c79('0x15')][_0x9c79('0x16')]===0x1f4){logger[_0x9c79('0x15')](_0x9c79('0x10'),_0xe3be36,_0x1eae3c[_0x9c79('0x15')][_0x9c79('0x17')]);return _0x3e9e71(_0x1eae3c[_0x9c79('0x15')][_0x9c79('0x17')]);}logger[_0x9c79('0x15')](_0x9c79('0x10'),_0xe3be36,_0x1eae3c[_0x9c79('0x15')][_0x9c79('0x17')]);return _0x23f5a4(_0x1eae3c[_0x9c79('0x15')][_0x9c79('0x17')]);}else{logger[_0x9c79('0xf')](_0x9c79('0x10'),_0xe3be36,_0x9c79('0x11'));_0x23f5a4(_0x1eae3c['result'][_0x9c79('0x17')]);}})[_0x9c79('0x18')](function(_0x3e5baa){logger[_0x9c79('0x15')](_0x9c79('0x10'),_0xe3be36,_0x3e5baa);_0x3e9e71(_0x3e5baa);});});}exports['VerifyAdditionalPhones']=function(_0x409183){var _0x38de1f=this;return new Promise(function(_0x329582,_0x2a1692){return db[_0x9c79('0x19')]['findOne']({'raw':!![],'where':{'ContactId':_0x409183[_0x9c79('0x1a')][_0x9c79('0x1b')],'ListId':_0x409183[_0x9c79('0x1a')][_0x9c79('0x1c')],'VoiceQueueId':_0x409183['body'][_0x9c79('0x1d')]===undefined?null:_0x409183[_0x9c79('0x1a')]['VoiceQueueId'],'CampaignId':_0x409183['body'][_0x9c79('0x1e')]===undefined?null:_0x409183['body']['CampaignId']}})['then'](function(_0x223117){if(_0x223117!=null){return db[_0x9c79('0x1f')][_0x9c79('0x20')]({'raw':!![],'where':{'CmHopperId':_0x223117['id'],'OrderBy':{'$gt':_0x223117['OrderBy']}},'order':[[_0x9c79('0x21'),_0x9c79('0x22')]]})[_0x9c79('0xe')](function(_0x16bcde){var _0x1eff7c=0x0;if(_0x16bcde){if(_0x16bcde['countbusyretry']+_0x16bcde[_0x9c79('0x23')]+_0x16bcde[_0x9c79('0x24')]+_0x16bcde['countnosuchnumberretry']+_0x16bcde['countdropretry']+_0x16bcde['countabandonedretry']+_0x16bcde[_0x9c79('0x25')]+_0x16bcde[_0x9c79('0x26')]<_0x409183[_0x9c79('0x27')]['dialGlobalMaxRetry'])_0x1eff7c=0x1;_0x329582({'additional':_0x1eff7c});}else{return db[_0x9c79('0x1f')][_0x9c79('0x20')]({'raw':!![],'where':{'CmHopperId':_0x223117['id']},'order':[[_0x9c79('0x21'),'ASC']]})[_0x9c79('0xe')](function(_0x2ac32){var _0x40b0ef=0x0;if(_0x2ac32){if(_0x2ac32['countbusyretry']+_0x2ac32['countcongestionretry']+_0x2ac32[_0x9c79('0x24')]+_0x2ac32[_0x9c79('0x28')]+_0x2ac32['countdropretry']+_0x2ac32['countabandonedretry']+_0x2ac32[_0x9c79('0x25')]+_0x2ac32[_0x9c79('0x26')]<_0x409183[_0x9c79('0x27')][_0x9c79('0x29')])_0x40b0ef=0x1;_0x329582({'additional':_0x40b0ef});}else{_0x329582({'additional':0x0});}})['catch'](function(_0x2b0f6e){logger[_0x9c79('0x15')](_0x9c79('0x2a'),_0x2b0f6e[_0x9c79('0x17')]);_0x2a1692(_0x38de1f[_0x9c79('0x15')](0x1f4,_0x2b0f6e[_0x9c79('0x17')]));});}})[_0x9c79('0x18')](function(_0x54c08f){logger[_0x9c79('0x15')](_0x9c79('0x2a'),_0x54c08f['message']);_0x2a1692(_0x38de1f[_0x9c79('0x15')](0x1f4,_0x54c08f[_0x9c79('0x17')]));});}else _0x329582({'additional':0x0});});});};exports[_0x9c79('0x2b')]=function(_0x4d6cd3){var _0x59c3d9=this;return new Promise(function(_0x329343,_0x48e85b){return db[_0x9c79('0x19')][_0x9c79('0x20')]({'raw':!![],'where':{'ContactId':_0x4d6cd3['body'][_0x9c79('0x1b')],'ListId':_0x4d6cd3[_0x9c79('0x1a')][_0x9c79('0x1c')],'VoiceQueueId':_0x4d6cd3[_0x9c79('0x1a')][_0x9c79('0x1d')]===undefined?null:_0x4d6cd3[_0x9c79('0x1a')][_0x9c79('0x1d')],'CampaignId':_0x4d6cd3[_0x9c79('0x1a')][_0x9c79('0x1e')]===undefined?null:_0x4d6cd3[_0x9c79('0x1a')]['CampaignId']}})[_0x9c79('0xe')](function(_0x124690){if(_0x124690!=null){return db[_0x9c79('0x1f')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x124690['id'],'OrderBy':{'$gte':_0x124690['OrderBy']}},'order':[[_0x9c79('0x21'),_0x9c79('0x22')]]})['then'](function(_0x149233){if(_0x149233)return activateAdditionalPhone(_0x124690,_0x4d6cd3[_0x9c79('0x1a')],_0x149233,_0x4d6cd3[_0x9c79('0x2c')],_0x4d6cd3[_0x9c79('0x2d')])[_0x9c79('0xe')](function(_0x3c9e4c){_0x329343(_0x3c9e4c);});else{return db[_0x9c79('0x1f')][_0x9c79('0x20')]({'raw':!![],'where':{'CmHopperId':_0x124690['id']},'order':[['OrderBy',_0x9c79('0x22')]]})[_0x9c79('0xe')](function(_0x2cb83d){if(_0x2cb83d)return activateAdditionalPhone(_0x124690,_0x4d6cd3[_0x9c79('0x1a')],_0x2cb83d,_0x4d6cd3[_0x9c79('0x2c')],_0x4d6cd3['waitTime'])[_0x9c79('0xe')](function(_0x531bb5){_0x329343(_0x531bb5);});else{_0x329343({'id':_0x124690['id'],'phone':''});}})[_0x9c79('0x18')](function(_0xc5997d){logger[_0x9c79('0x15')]('VerifyAdditionalPhones',_0xc5997d[_0x9c79('0x17')]);_0x48e85b(_0x59c3d9[_0x9c79('0x15')](0x1f4,_0xc5997d[_0x9c79('0x17')]));});}})[_0x9c79('0x18')](function(_0x42a215){logger[_0x9c79('0x15')](_0x9c79('0x2a'),_0x42a215[_0x9c79('0x17')]);_0x48e85b(_0x59c3d9[_0x9c79('0x15')](0x1f4,_0x42a215['message']));});}else _0x329343(0x1);});});};function activateAdditionalPhone(_0x32f438,_0x20cd6b,_0x56bf45,_0x124184,_0xa454ab){return new Promise(function(_0x5909df,_0x193888){var _0x352391;if(_[_0x9c79('0x2e')](_0x56bf45[_0x9c79('0x2f')])){_0x56bf45['scheduledat']=moment();}if(moment()>moment(_0x56bf45[_0x9c79('0x2f')])){_0x352391=moment()['add'](_0xa454ab||0x3,_0x9c79('0x30'));}else{if(_0x56bf45[_0x9c79('0x21')]==0x0){_0x352391=moment(_0x56bf45['scheduledat']);}else{_0x352391=moment()[_0x9c79('0x31')](_0xa454ab||0x3,'minutes');}}if(_[_0x9c79('0x2e')](_0x352391)){_0x352391=moment()[_0x9c79('0x31')](_0xa454ab||0x3,_0x9c79('0x30'));}var _0x1321f9={'phone':_0x32f438[_0x9c79('0x32')],'active':0x0,'OrderBy':_['isNil'](_0x32f438[_0x9c79('0x21')])?0x0:_0x32f438[_0x9c79('0x21')],'scheduledat':moment()['add'](_0x124184||0x1,_0x9c79('0x30')),'countbusyretry':_0x20cd6b[_0x9c79('0x33')],'countcongestionretry':_0x20cd6b['countcongestionretry'],'countnoanswerretry':_0x20cd6b[_0x9c79('0x24')],'countnosuchnumberretry':_0x20cd6b[_0x9c79('0x28')],'countdropretry':_0x20cd6b['countdropretry'],'countabandonedretry':_0x20cd6b[_0x9c79('0x34')],'countmachineretry':_0x20cd6b[_0x9c79('0x25')],'countagentrejectretry':_0x20cd6b['countagentrejectretry'],'createdAt':_0x20cd6b[_0x9c79('0x35')],'updatedAt':_0x20cd6b[_0x9c79('0x36')]};var _0x270f9f={'CmHopperId':_0x32f438['id'],'phone':_0x56bf45[_0x9c79('0x32')],'active':0x0,'OrderBy':_[_0x9c79('0x2e')](_0x56bf45[_0x9c79('0x21')])?0x0:_0x56bf45[_0x9c79('0x21')],'scheduledat':_0x352391,'countbusyretry':_0x56bf45[_0x9c79('0x33')],'countcongestionretry':_0x56bf45[_0x9c79('0x23')],'countnoanswerretry':_0x56bf45[_0x9c79('0x24')],'countnosuchnumberretry':_0x56bf45[_0x9c79('0x28')],'countdropretry':_0x56bf45[_0x9c79('0x37')],'countabandonedretry':_0x56bf45[_0x9c79('0x34')],'countmachineretry':_0x56bf45[_0x9c79('0x25')],'countagentrejectretry':_0x56bf45['countagentrejectretry'],'createdAt':_0x56bf45['createdAt'],'updatedAt':_0x56bf45['updatedAt']};return db['sequelize'][_0x9c79('0x38')](function(_0x4f00f2){return db[_0x9c79('0x1f')]['update'](_0x1321f9,{'where':{'id':_0x56bf45['id']}},{'transaction':_0x4f00f2})[_0x9c79('0xe')](function(){return db['CmHopper'][_0x9c79('0x39')](_0x270f9f,{'where':{'id':_0x32f438['id']}},{'transaction':_0x4f00f2});});})[_0x9c79('0xe')](function(_0xce4321){_0x5909df({'id':_0x32f438['id'],'phone':_0x56bf45[_0x9c79('0x32')]});})[_0x9c79('0x18')](function(_0x5ec700){logger[_0x9c79('0x15')]('activateAdditionalPhone',_0x5ec700[_0x9c79('0x17')]);_0x193888({'error':_0x5ec700[_0x9c79('0x17')]});});});}exports[_0x9c79('0x3a')]=function(_0x19171a){var _0x511f87=this;return new Promise(function(_0x1e2f13,_0x2a5bfa){return db[_0x9c79('0x19')][_0x9c79('0x39')](_0x19171a['body'][_0x9c79('0x3b')],{'where':{'id':_0x19171a['body']['id']}})[_0x9c79('0xe')](function(_0x275cfa){_0x1e2f13(_0x275cfa);})[_0x9c79('0x18')](function(_0x21e3d){logger[_0x9c79('0x15')]('IncrementPreviewCounters',_0x21e3d[_0x9c79('0x17')]);_0x2a5bfa(_0x511f87[_0x9c79('0x15')](0x1f4,_0x21e3d[_0x9c79('0x17')]));});});}; \ No newline at end of file +var _0x828f=['body','ContactId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','findOne','ASC','dialGlobalMaxRetry','catch','SwapAdditionalPhones','ListId','waitTime','duration','scheduledat','add','minutes','isNil','phone','updatedAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','VerifyAdditionalPhones'];(function(_0x69f036,_0x5308c2){var _0x2d54db=function(_0x1b0f8d){while(--_0x1b0f8d){_0x69f036['push'](_0x69f036['shift']());}};_0x2d54db(++_0x5308c2);}(_0x828f,0x125));var _0xf828=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x828f[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require(_0xf828('0x0'));var util=require(_0xf828('0x1'));var moment=require(_0xf828('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf828('0x3'))['db'];var utils=require(_0xf828('0x4'));var logger=require(_0xf828('0x5'))(_0xf828('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf828('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4184a5,_0x45b649,_0x3e8b1a){return new BPromise(function(_0xeb8db5,_0x13351c){return client[_0xf828('0x8')](_0x4184a5,_0x3e8b1a)[_0xf828('0x9')](function(_0x5823d8){logger[_0xf828('0xa')](_0xf828('0xb'),_0x45b649,_0xf828('0xc'));logger[_0xf828('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x45b649,_0xf828('0xc'),JSON[_0xf828('0xe')](_0x5823d8));if(_0x5823d8[_0xf828('0xf')]){if(_0x5823d8[_0xf828('0xf')][_0xf828('0x10')]===0x1f4){logger[_0xf828('0xf')](_0xf828('0xb'),_0x45b649,_0x5823d8[_0xf828('0xf')][_0xf828('0x11')]);return _0x13351c(_0x5823d8[_0xf828('0xf')]['message']);}logger[_0xf828('0xf')](_0xf828('0xb'),_0x45b649,_0x5823d8['error'][_0xf828('0x11')]);return _0xeb8db5(_0x5823d8[_0xf828('0xf')]['message']);}else{logger[_0xf828('0xa')](_0xf828('0xb'),_0x45b649,_0xf828('0xc'));_0xeb8db5(_0x5823d8['result']['message']);}})['catch'](function(_0x24eaf9){logger[_0xf828('0xf')](_0xf828('0xb'),_0x45b649,_0x24eaf9);_0x13351c(_0x24eaf9);});});}exports[_0xf828('0x12')]=function(_0x1c99cc){var _0x1f177b=this;return new Promise(function(_0x244513,_0x59f51a){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x1c99cc[_0xf828('0x13')][_0xf828('0x14')],'ListId':_0x1c99cc['body']['ListId'],'VoiceQueueId':_0x1c99cc['body'][_0xf828('0x15')]===undefined?null:_0x1c99cc[_0xf828('0x13')][_0xf828('0x15')],'CampaignId':_0x1c99cc['body'][_0xf828('0x16')]===undefined?null:_0x1c99cc[_0xf828('0x13')][_0xf828('0x16')]}})[_0xf828('0x9')](function(_0x27bbec){if(_0x27bbec!=null){return db[_0xf828('0x17')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x27bbec['id'],'OrderBy':{'$gt':_0x27bbec['OrderBy']}},'order':[[_0xf828('0x18'),'ASC']]})[_0xf828('0x9')](function(_0xc16c0){var _0x16a09b=0x0;if(_0xc16c0){if(_0xc16c0[_0xf828('0x19')]+_0xc16c0[_0xf828('0x1a')]+_0xc16c0[_0xf828('0x1b')]+_0xc16c0[_0xf828('0x1c')]+_0xc16c0[_0xf828('0x1d')]+_0xc16c0[_0xf828('0x1e')]+_0xc16c0[_0xf828('0x1f')]+_0xc16c0[_0xf828('0x20')]<_0x1c99cc[_0xf828('0x21')]['dialGlobalMaxRetry'])_0x16a09b=0x1;_0x244513({'additional':_0x16a09b});}else{return db[_0xf828('0x17')][_0xf828('0x22')]({'raw':!![],'where':{'CmHopperId':_0x27bbec['id']},'order':[[_0xf828('0x18'),_0xf828('0x23')]]})[_0xf828('0x9')](function(_0x3dc843){var _0x18c135=0x0;if(_0x3dc843){if(_0x3dc843[_0xf828('0x19')]+_0x3dc843['countcongestionretry']+_0x3dc843[_0xf828('0x1b')]+_0x3dc843[_0xf828('0x1c')]+_0x3dc843[_0xf828('0x1d')]+_0x3dc843[_0xf828('0x1e')]+_0x3dc843[_0xf828('0x1f')]+_0x3dc843['countagentrejectretry']<_0x1c99cc[_0xf828('0x21')][_0xf828('0x24')])_0x18c135=0x1;_0x244513({'additional':_0x18c135});}else{_0x244513({'additional':0x0});}})[_0xf828('0x25')](function(_0x30a97f){logger[_0xf828('0xf')](_0xf828('0x12'),_0x30a97f[_0xf828('0x11')]);_0x59f51a(_0x1f177b[_0xf828('0xf')](0x1f4,_0x30a97f['message']));});}})[_0xf828('0x25')](function(_0x43d05b){logger['error']('VerifyAdditionalPhones',_0x43d05b['message']);_0x59f51a(_0x1f177b['error'](0x1f4,_0x43d05b[_0xf828('0x11')]));});}else _0x244513({'additional':0x0});});});};exports[_0xf828('0x26')]=function(_0x31646a){var _0x419aaf=this;return new Promise(function(_0x17c1c1,_0x27b9c0){return db['CmHopper'][_0xf828('0x22')]({'raw':!![],'where':{'ContactId':_0x31646a['body']['ContactId'],'ListId':_0x31646a[_0xf828('0x13')][_0xf828('0x27')],'VoiceQueueId':_0x31646a[_0xf828('0x13')][_0xf828('0x15')]===undefined?null:_0x31646a['body'][_0xf828('0x15')],'CampaignId':_0x31646a['body']['CampaignId']===undefined?null:_0x31646a[_0xf828('0x13')][_0xf828('0x16')]}})[_0xf828('0x9')](function(_0x1191f9){if(_0x1191f9!=null){return db[_0xf828('0x17')][_0xf828('0x22')]({'raw':!![],'where':{'CmHopperId':_0x1191f9['id'],'OrderBy':{'$gte':_0x1191f9['OrderBy']}},'order':[[_0xf828('0x18'),_0xf828('0x23')]]})[_0xf828('0x9')](function(_0x3bfd35){if(_0x3bfd35)return activateAdditionalPhone(_0x1191f9,_0x31646a[_0xf828('0x13')],_0x3bfd35,_0x31646a['duration'],_0x31646a[_0xf828('0x28')])[_0xf828('0x9')](function(_0x4ae67b){_0x17c1c1(_0x4ae67b);});else{return db[_0xf828('0x17')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x1191f9['id']},'order':[[_0xf828('0x18'),_0xf828('0x23')]]})[_0xf828('0x9')](function(_0x2008be){if(_0x2008be)return activateAdditionalPhone(_0x1191f9,_0x31646a[_0xf828('0x13')],_0x2008be,_0x31646a[_0xf828('0x29')],_0x31646a[_0xf828('0x28')])[_0xf828('0x9')](function(_0x4c4c67){_0x17c1c1(_0x4c4c67);});else{_0x17c1c1({'id':_0x1191f9['id'],'phone':''});}})['catch'](function(_0x26a4d5){logger[_0xf828('0xf')](_0xf828('0x12'),_0x26a4d5[_0xf828('0x11')]);_0x27b9c0(_0x419aaf[_0xf828('0xf')](0x1f4,_0x26a4d5[_0xf828('0x11')]));});}})[_0xf828('0x25')](function(_0x3599e2){logger['error']('VerifyAdditionalPhones',_0x3599e2['message']);_0x27b9c0(_0x419aaf[_0xf828('0xf')](0x1f4,_0x3599e2['message']));});}else _0x17c1c1(0x1);});});};function activateAdditionalPhone(_0x1d6687,_0x338cae,_0x577299,_0x1674b4,_0x372dde){return new Promise(function(_0x291e63,_0x388014){var _0x5a99f4;if(_['isNil'](_0x577299['scheduledat'])){_0x577299[_0xf828('0x2a')]=moment();}if(moment()>moment(_0x577299[_0xf828('0x2a')])){_0x5a99f4=moment()[_0xf828('0x2b')](_0x372dde||0x3,_0xf828('0x2c'));}else{if(_0x577299[_0xf828('0x18')]==0x0){_0x5a99f4=moment(_0x577299[_0xf828('0x2a')]);}else{_0x5a99f4=moment()[_0xf828('0x2b')](_0x372dde||0x3,_0xf828('0x2c'));}}if(_[_0xf828('0x2d')](_0x5a99f4)){_0x5a99f4=moment()[_0xf828('0x2b')](_0x372dde||0x3,_0xf828('0x2c'));}var _0x1046b3={'phone':_0x1d6687['phone'],'active':0x0,'OrderBy':_[_0xf828('0x2d')](_0x1d6687[_0xf828('0x18')])?0x0:_0x1d6687['OrderBy'],'scheduledat':moment()[_0xf828('0x2b')](_0x1674b4||0x1,_0xf828('0x2c')),'countbusyretry':_0x338cae[_0xf828('0x19')],'countcongestionretry':_0x338cae[_0xf828('0x1a')],'countnoanswerretry':_0x338cae[_0xf828('0x1b')],'countnosuchnumberretry':_0x338cae[_0xf828('0x1c')],'countdropretry':_0x338cae[_0xf828('0x1d')],'countabandonedretry':_0x338cae[_0xf828('0x1e')],'countmachineretry':_0x338cae[_0xf828('0x1f')],'countagentrejectretry':_0x338cae[_0xf828('0x20')],'createdAt':_0x338cae['createdAt'],'updatedAt':_0x338cae['updatedAt']};var _0x4896a4={'CmHopperId':_0x1d6687['id'],'phone':_0x577299[_0xf828('0x2e')],'active':0x0,'OrderBy':_[_0xf828('0x2d')](_0x577299[_0xf828('0x18')])?0x0:_0x577299['OrderBy'],'scheduledat':_0x5a99f4,'countbusyretry':_0x577299[_0xf828('0x19')],'countcongestionretry':_0x577299[_0xf828('0x1a')],'countnoanswerretry':_0x577299[_0xf828('0x1b')],'countnosuchnumberretry':_0x577299['countnosuchnumberretry'],'countdropretry':_0x577299[_0xf828('0x1d')],'countabandonedretry':_0x577299[_0xf828('0x1e')],'countmachineretry':_0x577299['countmachineretry'],'countagentrejectretry':_0x577299[_0xf828('0x20')],'createdAt':_0x577299['createdAt'],'updatedAt':_0x577299[_0xf828('0x2f')]};return db[_0xf828('0x30')]['transaction'](function(_0x1ee169){return db['CmHopperAdditionalPhone'][_0xf828('0x31')](_0x1046b3,{'where':{'id':_0x577299['id']}},{'transaction':_0x1ee169})['then'](function(){return db['CmHopper'][_0xf828('0x31')](_0x4896a4,{'where':{'id':_0x1d6687['id']}},{'transaction':_0x1ee169});});})[_0xf828('0x9')](function(_0x3da3b6){_0x291e63({'id':_0x1d6687['id'],'phone':_0x577299[_0xf828('0x2e')]});})['catch'](function(_0xc7c769){logger[_0xf828('0xf')](_0xf828('0x32'),_0xc7c769[_0xf828('0x11')]);_0x388014({'error':_0xc7c769[_0xf828('0x11')]});});});}exports['IncrementPreviewCounters']=function(_0x57019f){var _0x2f27b8=this;return new Promise(function(_0x3ed733,_0x5c4b68){return db['CmHopper']['update'](_0x57019f[_0xf828('0x13')]['field'],{'where':{'id':_0x57019f[_0xf828('0x13')]['id']}})['then'](function(_0x205630){_0x3ed733(_0x205630);})[_0xf828('0x25')](function(_0x1a9fc8){logger['error'](_0xf828('0x33'),_0x1a9fc8[_0xf828('0x11')]);_0x5c4b68(_0x2f27b8['error'](0x1f4,_0x1a9fc8[_0xf828('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index b77744f..65ef627 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f78=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','/:id','show','put','update','delete','isAuthenticated','exports','util','path','connect-timeout'];(function(_0x230628,_0x4b01f9){var _0xd221b1=function(_0x3a5610){while(--_0x3a5610){_0x230628['push'](_0x230628['shift']());}};_0xd221b1(++_0x4b01f9);}(_0x7f78,0x140));var _0x87f7=function(_0x4ffd32,_0x168edb){_0x4ffd32=_0x4ffd32-0x0;var _0x1ea59b=_0x7f78[_0x4ffd32];return _0x1ea59b;};'use strict';var multer=require('multer');var util=require(_0x87f7('0x0'));var path=require(_0x87f7('0x1'));var timeout=require(_0x87f7('0x2'));var express=require(_0x87f7('0x3'));var router=express[_0x87f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x87f7('0x5'));var interaction=require(_0x87f7('0x6'));var config=require(_0x87f7('0x7'));var controller=require(_0x87f7('0x8'));router[_0x87f7('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x87f7('0x9')](_0x87f7('0xa'),auth['isAuthenticated'](),controller[_0x87f7('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x87f7('0xc')](_0x87f7('0xa'),auth['isAuthenticated'](),controller[_0x87f7('0xd')]);router[_0x87f7('0xe')](_0x87f7('0xa'),auth[_0x87f7('0xf')](),controller['destroy']);module[_0x87f7('0x10')]=router; \ No newline at end of file +var _0x98e5=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer'];(function(_0x136df8,_0x50e3eb){var _0x41e4f1=function(_0x3dadc7){while(--_0x3dadc7){_0x136df8['push'](_0x136df8['shift']());}};_0x41e4f1(++_0x50e3eb);}(_0x98e5,0x1c1));var _0x598e=function(_0xe216aa,_0x4d7518){_0xe216aa=_0xe216aa-0x0;var _0x250579=_0x98e5[_0xe216aa];return _0x250579;};'use strict';var multer=require(_0x598e('0x0'));var util=require(_0x598e('0x1'));var path=require(_0x598e('0x2'));var timeout=require(_0x598e('0x3'));var express=require(_0x598e('0x4'));var router=express[_0x598e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x598e('0x6'));var interaction=require(_0x598e('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperAdditionalPhone.controller');router[_0x598e('0x8')]('/',auth[_0x598e('0x9')](),controller[_0x598e('0xa')]);router[_0x598e('0x8')](_0x598e('0xb'),auth['isAuthenticated'](),controller[_0x598e('0xc')]);router[_0x598e('0xd')]('/',auth[_0x598e('0x9')](),controller['create']);router[_0x598e('0xe')]('/:id',auth[_0x598e('0x9')](),controller['update']);router[_0x598e('0xf')](_0x598e('0xb'),auth[_0x598e('0x9')](),controller[_0x598e('0x10')]);module[_0x598e('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 604bb0e..b33d6ed 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 _0x433a=['INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x35ea99,_0xa39d05){var _0x4f2774=function(_0x9a42b7){while(--_0x9a42b7){_0x35ea99['push'](_0x35ea99['shift']());}};_0x4f2774(++_0xa39d05);}(_0x433a,0x14c));var _0xa433=function(_0x39fe3e,_0x22a8b6){_0x39fe3e=_0x39fe3e-0x0;var _0x1afabc=_0x433a[_0x39fe3e];return _0x1afabc;};'use strict';var moment=require(_0xa433('0x0'));var Sequelize=require(_0xa433('0x1'));module[_0xa433('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa433('0x3')],'unique':_0xa433('0x4')},'ListId':{'type':Sequelize[_0xa433('0x3')],'unique':_0xa433('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa433('0x4')}}; \ No newline at end of file +var _0x0aee=['exports','INTEGER','contactListQueue','moment'];(function(_0x1155c9,_0xb0ce3c){var _0x42a90d=function(_0x3c7d2a){while(--_0x3c7d2a){_0x1155c9['push'](_0x1155c9['shift']());}};_0x42a90d(++_0xb0ce3c);}(_0x0aee,0x1a3));var _0xe0ae=function(_0x7a6897,_0x66fa7c){_0x7a6897=_0x7a6897-0x0;var _0x1d49c1=_0x0aee[_0x7a6897];return _0x1d49c1;};'use strict';var moment=require(_0xe0ae('0x0'));var Sequelize=require('sequelize');module[_0xe0ae('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xe0ae('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xe0ae('0x3')},'VoiceQueueId':{'type':Sequelize[_0xe0ae('0x2')],'unique':_0xe0ae('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 14d4148..53241a4 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 _0xc762=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','rows','show','keys','length','options','find','catch','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2d0e93,_0x37e9cd){var _0x4f8920=function(_0x3fd6cb){while(--_0x3fd6cb){_0x2d0e93['push'](_0x2d0e93['shift']());}};_0x4f8920(++_0x37e9cd);}(_0xc762,0x92));var _0x2c76=function(_0x3ae8f4,_0x2920f4){_0x3ae8f4=_0x3ae8f4-0x0;var _0x367312=_0xc762[_0x3ae8f4];return _0x367312;};'use strict';var emlformat=require(_0x2c76('0x0'));var rimraf=require(_0x2c76('0x1'));var zipdir=require(_0x2c76('0x2'));var jsonpatch=require(_0x2c76('0x3'));var rp=require(_0x2c76('0x4'));var moment=require(_0x2c76('0x5'));var BPromise=require(_0x2c76('0x6'));var Mustache=require(_0x2c76('0x7'));var util=require(_0x2c76('0x8'));var path=require(_0x2c76('0x9'));var sox=require(_0x2c76('0xa'));var csv=require(_0x2c76('0xb'));var ejs=require(_0x2c76('0xc'));var fs=require('fs');var fs_extra=require(_0x2c76('0xd'));var _=require(_0x2c76('0xe'));var squel=require(_0x2c76('0xf'));var crypto=require('crypto');var jsforce=require(_0x2c76('0x10'));var deskjs=require(_0x2c76('0x11'));var toCsv=require(_0x2c76('0xb'));var querystring=require('querystring');var Papa=require(_0x2c76('0x12'));var Redis=require(_0x2c76('0x13'));var authService=require(_0x2c76('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c76('0x15'));var logger=require('../../config/logger')(_0x2c76('0x16'));var utils=require(_0x2c76('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2c76('0x18'))['db'];function respondWithStatusCode(_0x4e49e8,_0x23428d){_0x23428d=_0x23428d||0xcc;return function(_0x5b97b1){if(_0x5b97b1){return _0x4e49e8[_0x2c76('0x19')](_0x23428d);}return _0x4e49e8['status'](_0x23428d)[_0x2c76('0x1a')]();};}function respondWithResult(_0x3664aa,_0x7e730d){_0x7e730d=_0x7e730d||0xc8;return function(_0x1093d4){if(_0x1093d4){return _0x3664aa[_0x2c76('0x1b')](_0x7e730d)[_0x2c76('0x1c')](_0x1093d4);}};}function respondWithFilteredResult(_0x54ec6b,_0x57c8f4){return function(_0x10c65b){if(_0x10c65b){var _0x10078e=typeof _0x57c8f4['offset']===_0x2c76('0x1d')&&typeof _0x57c8f4[_0x2c76('0x1e')]===_0x2c76('0x1d');var _0x37162f=_0x10c65b[_0x2c76('0x1f')];var _0x57461c=_0x10078e?0x0:_0x57c8f4[_0x2c76('0x20')];var _0x176b45=_0x10078e?_0x10c65b['count']:_0x57c8f4['offset']+_0x57c8f4[_0x2c76('0x1e')];var _0x20bf15;if(_0x176b45>=_0x37162f){_0x176b45=_0x37162f;_0x20bf15=0xc8;}else{_0x20bf15=0xce;}_0x54ec6b[_0x2c76('0x1b')](_0x20bf15);return _0x54ec6b[_0x2c76('0x21')](_0x2c76('0x22'),_0x57461c+'-'+_0x176b45+'/'+_0x37162f)[_0x2c76('0x1c')](_0x10c65b);}return null;};}function patchUpdates(_0x45c5f5){return function(_0x1638d3){try{jsonpatch[_0x2c76('0x23')](_0x1638d3,_0x45c5f5,!![]);}catch(_0x26f6ae){return BPromise[_0x2c76('0x24')](_0x26f6ae);}return _0x1638d3[_0x2c76('0x25')]();};}function saveUpdates(_0x46b324,_0x5f24bc){return function(_0x2d2a71){if(_0x2d2a71){return _0x2d2a71['update'](_0x46b324)['then'](function(_0x497cc6){return _0x497cc6;});}return null;};}function removeEntity(_0xed1e6c,_0x22abba){return function(_0x5c794f){if(_0x5c794f){return _0x5c794f[_0x2c76('0x26')]()[_0x2c76('0x27')](function(){_0xed1e6c[_0x2c76('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21f73b,_0x701b34){return function(_0x23b9ee){if(!_0x23b9ee){_0x21f73b[_0x2c76('0x19')](0x194);}return _0x23b9ee;};}function handleError(_0x446bf9,_0x3ef034){_0x3ef034=_0x3ef034||0x1f4;return function(_0x3cd841){logger['error'](_0x3cd841[_0x2c76('0x28')]);if(_0x3cd841[_0x2c76('0x29')]){delete _0x3cd841[_0x2c76('0x29')];}_0x446bf9[_0x2c76('0x1b')](_0x3ef034)[_0x2c76('0x2a')](_0x3cd841);};}exports['index']=function(_0x38f967,_0x92dee0){var _0x28402f={},_0x48a03={},_0x2e6999={'count':0x0,'rows':[]};var _0x5a1c91=_[_0x2c76('0x2b')](db[_0x2c76('0x2c')][_0x2c76('0x2d')],function(_0x480c62){return{'name':_0x480c62[_0x2c76('0x2e')],'type':_0x480c62[_0x2c76('0x2f')][_0x2c76('0x30')]};});_0x48a03[_0x2c76('0x31')]=_[_0x2c76('0x2b')](_0x5a1c91,_0x2c76('0x29'));_0x48a03['query']=_['keys'](_0x38f967[_0x2c76('0x32')]);_0x48a03[_0x2c76('0x33')]=_[_0x2c76('0x34')](_0x48a03[_0x2c76('0x31')],_0x48a03[_0x2c76('0x32')]);_0x28402f[_0x2c76('0x35')]=_['intersection'](_0x48a03[_0x2c76('0x31')],qs[_0x2c76('0x36')](_0x38f967[_0x2c76('0x32')][_0x2c76('0x36')]));_0x28402f['attributes']=_0x28402f['attributes']['length']?_0x28402f[_0x2c76('0x35')]:_0x48a03['model'];if(!_0x38f967[_0x2c76('0x32')][_0x2c76('0x37')](_0x2c76('0x38'))){_0x28402f[_0x2c76('0x1e')]=qs[_0x2c76('0x1e')](_0x38f967[_0x2c76('0x32')]['limit']);_0x28402f[_0x2c76('0x20')]=qs[_0x2c76('0x20')](_0x38f967[_0x2c76('0x32')][_0x2c76('0x20')]);}_0x28402f[_0x2c76('0x39')]=qs[_0x2c76('0x3a')](_0x38f967[_0x2c76('0x32')][_0x2c76('0x3a')]);_0x28402f['where']=qs[_0x2c76('0x33')](_[_0x2c76('0x3b')](_0x38f967['query'],_0x48a03[_0x2c76('0x33')]),_0x5a1c91);if(_0x38f967[_0x2c76('0x32')][_0x2c76('0x3c')]){_0x28402f['where']=_['merge'](_0x28402f[_0x2c76('0x3d')],{'$or':_[_0x2c76('0x2b')](_0x5a1c91,function(_0x4cc7bc){if(_0x4cc7bc[_0x2c76('0x2f')]!=='VIRTUAL'){var _0x57ce22={};_0x57ce22[_0x4cc7bc[_0x2c76('0x29')]]={'$like':'%'+_0x38f967[_0x2c76('0x32')][_0x2c76('0x3c')]+'%'};return _0x57ce22;}})});}_0x28402f=_[_0x2c76('0x3e')]({},_0x28402f,_0x38f967['options']);var _0x5d4e70={'where':_0x28402f[_0x2c76('0x3d')]};return db[_0x2c76('0x2c')][_0x2c76('0x1f')](_0x5d4e70)[_0x2c76('0x27')](function(_0x490027){_0x2e6999[_0x2c76('0x1f')]=_0x490027;if(_0x38f967[_0x2c76('0x32')][_0x2c76('0x3f')]){_0x28402f[_0x2c76('0x40')]=[{'all':!![]}];}return db[_0x2c76('0x2c')]['findAll'](_0x28402f);})['then'](function(_0x5c105c){_0x2e6999[_0x2c76('0x41')]=_0x5c105c;return _0x2e6999;})[_0x2c76('0x27')](respondWithFilteredResult(_0x92dee0,_0x28402f))['catch'](handleError(_0x92dee0,null));};exports[_0x2c76('0x42')]=function(_0x558d04,_0x57714f){var _0x170843={'raw':!![],'where':{'id':_0x558d04['params']['id']}},_0x1eb94b={};_0x1eb94b[_0x2c76('0x31')]=_[_0x2c76('0x43')](db[_0x2c76('0x2c')][_0x2c76('0x2d')]);_0x1eb94b[_0x2c76('0x32')]=_['keys'](_0x558d04['query']);_0x1eb94b[_0x2c76('0x33')]=_[_0x2c76('0x34')](_0x1eb94b['model'],_0x1eb94b[_0x2c76('0x32')]);_0x170843[_0x2c76('0x35')]=_[_0x2c76('0x34')](_0x1eb94b[_0x2c76('0x31')],qs['fields'](_0x558d04[_0x2c76('0x32')][_0x2c76('0x36')]));_0x170843['attributes']=_0x170843['attributes'][_0x2c76('0x44')]?_0x170843[_0x2c76('0x35')]:_0x1eb94b['model'];if(_0x558d04[_0x2c76('0x32')]['includeAll']){_0x170843['include']=[{'all':!![]}];}_0x170843=_[_0x2c76('0x3e')]({},_0x170843,_0x558d04[_0x2c76('0x45')]);return db['CmHopperBlack'][_0x2c76('0x46')](_0x170843)['then'](handleEntityNotFound(_0x57714f,null))['then'](respondWithResult(_0x57714f,null))[_0x2c76('0x47')](handleError(_0x57714f,null));};exports[_0x2c76('0x48')]=function(_0x54549a,_0x527804){if(_0x54549a[_0x2c76('0x49')]['id']){delete _0x54549a[_0x2c76('0x49')]['id'];}return db[_0x2c76('0x2c')][_0x2c76('0x46')]({'where':{'id':_0x54549a[_0x2c76('0x4a')]['id']}})[_0x2c76('0x27')](handleEntityNotFound(_0x527804,null))[_0x2c76('0x27')](saveUpdates(_0x54549a[_0x2c76('0x49')],null))[_0x2c76('0x27')](respondWithResult(_0x527804,null))[_0x2c76('0x47')](handleError(_0x527804,null));};exports[_0x2c76('0x26')]=function(_0x43a21b,_0x2c9d30){return db['CmHopperBlack'][_0x2c76('0x46')]({'where':{'id':_0x43a21b[_0x2c76('0x4a')]['id']}})[_0x2c76('0x27')](handleEntityNotFound(_0x2c9d30,null))['then'](removeEntity(_0x2c9d30,null))[_0x2c76('0x47')](handleError(_0x2c9d30,null));};exports[_0x2c76('0x4b')]=function(_0x3f763c,_0x2bcbad){return db[_0x2c76('0x2c')][_0x2c76('0x4b')]()[_0x2c76('0x27')](respondWithResult(_0x2bcbad,null))['catch'](handleError(_0x2bcbad,null));}; \ No newline at end of file +var _0xb4d6=['mustache','util','path','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','catch','show','params','length','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0xb4d6,0x1b6));var _0x6b4d=function(_0x3e54d5,_0x179556){_0x3e54d5=_0x3e54d5-0x0;var _0x35ad39=_0xb4d6[_0x3e54d5];return _0x35ad39;};'use strict';var emlformat=require(_0x6b4d('0x0'));var rimraf=require(_0x6b4d('0x1'));var zipdir=require(_0x6b4d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b4d('0x3'));var moment=require(_0x6b4d('0x4'));var BPromise=require(_0x6b4d('0x5'));var Mustache=require(_0x6b4d('0x6'));var util=require(_0x6b4d('0x7'));var path=require(_0x6b4d('0x8'));var sox=require('sox');var csv=require(_0x6b4d('0x9'));var ejs=require(_0x6b4d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6b4d('0xb'));var crypto=require(_0x6b4d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6b4d('0x9'));var querystring=require(_0x6b4d('0xd'));var Papa=require(_0x6b4d('0xe'));var Redis=require(_0x6b4d('0xf'));var authService=require(_0x6b4d('0x10'));var qs=require(_0x6b4d('0x11'));var as=require(_0x6b4d('0x12'));var hardwareService=require(_0x6b4d('0x13'));var logger=require(_0x6b4d('0x14'))(_0x6b4d('0x15'));var utils=require(_0x6b4d('0x16'));var config=require(_0x6b4d('0x17'));var licenseUtil=require(_0x6b4d('0x18'));var db=require(_0x6b4d('0x19'))['db'];function respondWithStatusCode(_0x36f42e,_0x16fad3){_0x16fad3=_0x16fad3||0xcc;return function(_0x30a079){if(_0x30a079){return _0x36f42e[_0x6b4d('0x1a')](_0x16fad3);}return _0x36f42e[_0x6b4d('0x1b')](_0x16fad3)['end']();};}function respondWithResult(_0x476965,_0x5e909f){_0x5e909f=_0x5e909f||0xc8;return function(_0x590d52){if(_0x590d52){return _0x476965[_0x6b4d('0x1b')](_0x5e909f)[_0x6b4d('0x1c')](_0x590d52);}};}function respondWithFilteredResult(_0x4e48c4,_0xc3e24b){return function(_0x36f678){if(_0x36f678){var _0x409edb=typeof _0xc3e24b[_0x6b4d('0x1d')]===_0x6b4d('0x1e')&&typeof _0xc3e24b['limit']===_0x6b4d('0x1e');var _0x2eda80=_0x36f678[_0x6b4d('0x1f')];var _0x48676f=_0x409edb?0x0:_0xc3e24b[_0x6b4d('0x1d')];var _0x51e3ea=_0x409edb?_0x36f678[_0x6b4d('0x1f')]:_0xc3e24b['offset']+_0xc3e24b[_0x6b4d('0x20')];var _0x296a8b;if(_0x51e3ea>=_0x2eda80){_0x51e3ea=_0x2eda80;_0x296a8b=0xc8;}else{_0x296a8b=0xce;}_0x4e48c4[_0x6b4d('0x1b')](_0x296a8b);return _0x4e48c4[_0x6b4d('0x21')]('Content-Range',_0x48676f+'-'+_0x51e3ea+'/'+_0x2eda80)[_0x6b4d('0x1c')](_0x36f678);}return null;};}function patchUpdates(_0xc16f7b){return function(_0x5d1f58){try{jsonpatch[_0x6b4d('0x22')](_0x5d1f58,_0xc16f7b,!![]);}catch(_0x45942d){return BPromise[_0x6b4d('0x23')](_0x45942d);}return _0x5d1f58[_0x6b4d('0x24')]();};}function saveUpdates(_0x4ed617,_0x3a94f2){return function(_0x3c42fb){if(_0x3c42fb){return _0x3c42fb[_0x6b4d('0x25')](_0x4ed617)[_0x6b4d('0x26')](function(_0x4d96b6){return _0x4d96b6;});}return null;};}function removeEntity(_0x3198ec,_0xb1a3f5){return function(_0x1d49fb){if(_0x1d49fb){return _0x1d49fb[_0x6b4d('0x27')]()['then'](function(){_0x3198ec[_0x6b4d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3781d4,_0x5de190){return function(_0x39c2bf){if(!_0x39c2bf){_0x3781d4[_0x6b4d('0x1a')](0x194);}return _0x39c2bf;};}function handleError(_0x11054f,_0x298695){_0x298695=_0x298695||0x1f4;return function(_0xf13921){logger[_0x6b4d('0x28')](_0xf13921[_0x6b4d('0x29')]);if(_0xf13921[_0x6b4d('0x2a')]){delete _0xf13921[_0x6b4d('0x2a')];}_0x11054f['status'](_0x298695)[_0x6b4d('0x2b')](_0xf13921);};}exports[_0x6b4d('0x2c')]=function(_0x2c5065,_0x2132ea){var _0x186a59={},_0x49f69b={},_0x5d8353={'count':0x0,'rows':[]};var _0xcb1597=_[_0x6b4d('0x2d')](db[_0x6b4d('0x2e')]['rawAttributes'],function(_0x32a239){return{'name':_0x32a239[_0x6b4d('0x2f')],'type':_0x32a239[_0x6b4d('0x30')]['key']};});_0x49f69b[_0x6b4d('0x31')]=_[_0x6b4d('0x2d')](_0xcb1597,_0x6b4d('0x2a'));_0x49f69b[_0x6b4d('0x32')]=_[_0x6b4d('0x33')](_0x2c5065['query']);_0x49f69b[_0x6b4d('0x34')]=_['intersection'](_0x49f69b['model'],_0x49f69b[_0x6b4d('0x32')]);_0x186a59[_0x6b4d('0x35')]=_[_0x6b4d('0x36')](_0x49f69b['model'],qs[_0x6b4d('0x37')](_0x2c5065[_0x6b4d('0x32')][_0x6b4d('0x37')]));_0x186a59[_0x6b4d('0x35')]=_0x186a59['attributes']['length']?_0x186a59[_0x6b4d('0x35')]:_0x49f69b['model'];if(!_0x2c5065['query'][_0x6b4d('0x38')](_0x6b4d('0x39'))){_0x186a59[_0x6b4d('0x20')]=qs[_0x6b4d('0x20')](_0x2c5065[_0x6b4d('0x32')][_0x6b4d('0x20')]);_0x186a59[_0x6b4d('0x1d')]=qs[_0x6b4d('0x1d')](_0x2c5065[_0x6b4d('0x32')]['offset']);}_0x186a59[_0x6b4d('0x3a')]=qs[_0x6b4d('0x3b')](_0x2c5065[_0x6b4d('0x32')][_0x6b4d('0x3b')]);_0x186a59['where']=qs[_0x6b4d('0x34')](_[_0x6b4d('0x3c')](_0x2c5065[_0x6b4d('0x32')],_0x49f69b['filters']),_0xcb1597);if(_0x2c5065[_0x6b4d('0x32')]['filter']){_0x186a59[_0x6b4d('0x3d')]=_['merge'](_0x186a59[_0x6b4d('0x3d')],{'$or':_['map'](_0xcb1597,function(_0x54fba9){if(_0x54fba9['type']!==_0x6b4d('0x3e')){var _0x59ec01={};_0x59ec01[_0x54fba9[_0x6b4d('0x2a')]]={'$like':'%'+_0x2c5065[_0x6b4d('0x32')][_0x6b4d('0x3f')]+'%'};return _0x59ec01;}})});}_0x186a59=_[_0x6b4d('0x40')]({},_0x186a59,_0x2c5065['options']);var _0x58362d={'where':_0x186a59[_0x6b4d('0x3d')]};return db[_0x6b4d('0x2e')][_0x6b4d('0x1f')](_0x58362d)[_0x6b4d('0x26')](function(_0x286e71){_0x5d8353[_0x6b4d('0x1f')]=_0x286e71;if(_0x2c5065['query'][_0x6b4d('0x41')]){_0x186a59[_0x6b4d('0x42')]=[{'all':!![]}];}return db[_0x6b4d('0x2e')]['findAll'](_0x186a59);})[_0x6b4d('0x26')](function(_0x4b4dae){_0x5d8353['rows']=_0x4b4dae;return _0x5d8353;})[_0x6b4d('0x26')](respondWithFilteredResult(_0x2132ea,_0x186a59))[_0x6b4d('0x43')](handleError(_0x2132ea,null));};exports[_0x6b4d('0x44')]=function(_0x3c2d3e,_0x152709){var _0x5693c4={'raw':!![],'where':{'id':_0x3c2d3e[_0x6b4d('0x45')]['id']}},_0x18f1f8={};_0x18f1f8['model']=_[_0x6b4d('0x33')](db['CmHopperBlack']['rawAttributes']);_0x18f1f8[_0x6b4d('0x32')]=_[_0x6b4d('0x33')](_0x3c2d3e['query']);_0x18f1f8[_0x6b4d('0x34')]=_['intersection'](_0x18f1f8[_0x6b4d('0x31')],_0x18f1f8['query']);_0x5693c4['attributes']=_[_0x6b4d('0x36')](_0x18f1f8['model'],qs[_0x6b4d('0x37')](_0x3c2d3e[_0x6b4d('0x32')][_0x6b4d('0x37')]));_0x5693c4[_0x6b4d('0x35')]=_0x5693c4[_0x6b4d('0x35')][_0x6b4d('0x46')]?_0x5693c4['attributes']:_0x18f1f8[_0x6b4d('0x31')];if(_0x3c2d3e[_0x6b4d('0x32')]['includeAll']){_0x5693c4[_0x6b4d('0x42')]=[{'all':!![]}];}_0x5693c4=_[_0x6b4d('0x40')]({},_0x5693c4,_0x3c2d3e['options']);return db[_0x6b4d('0x2e')]['find'](_0x5693c4)[_0x6b4d('0x26')](handleEntityNotFound(_0x152709,null))['then'](respondWithResult(_0x152709,null))[_0x6b4d('0x43')](handleError(_0x152709,null));};exports['update']=function(_0xe5962d,_0x1580b1){if(_0xe5962d[_0x6b4d('0x47')]['id']){delete _0xe5962d[_0x6b4d('0x47')]['id'];}return db[_0x6b4d('0x2e')][_0x6b4d('0x48')]({'where':{'id':_0xe5962d['params']['id']}})[_0x6b4d('0x26')](handleEntityNotFound(_0x1580b1,null))['then'](saveUpdates(_0xe5962d[_0x6b4d('0x47')],null))[_0x6b4d('0x26')](respondWithResult(_0x1580b1,null))[_0x6b4d('0x43')](handleError(_0x1580b1,null));};exports[_0x6b4d('0x27')]=function(_0x459afb,_0x41cb29){return db[_0x6b4d('0x2e')][_0x6b4d('0x48')]({'where':{'id':_0x459afb['params']['id']}})[_0x6b4d('0x26')](handleEntityNotFound(_0x41cb29,null))[_0x6b4d('0x26')](removeEntity(_0x41cb29,null))[_0x6b4d('0x43')](handleError(_0x41cb29,null));};exports[_0x6b4d('0x49')]=function(_0x17d364,_0x15e6c2){return db['CmHopperBlack'][_0x6b4d('0x49')]()[_0x6b4d('0x26')](respondWithResult(_0x15e6c2,null))[_0x6b4d('0x43')](handleError(_0x15e6c2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 479575c..c7831ce 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 _0x0ad5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','define','CmHopperBlack','lodash'];(function(_0x4ce16c,_0x157280){var _0x49e5dd=function(_0x18018c){while(--_0x18018c){_0x4ce16c['push'](_0x4ce16c['shift']());}};_0x49e5dd(++_0x157280);}(_0x0ad5,0x11f));var _0x50ad=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0ad5[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x50ad('0x0'));var util=require(_0x50ad('0x1'));var logger=require(_0x50ad('0x2'))(_0x50ad('0x3'));var moment=require(_0x50ad('0x4'));var BPromise=require(_0x50ad('0x5'));var rp=require(_0x50ad('0x6'));var fs=require('fs');var path=require(_0x50ad('0x7'));var rimraf=require(_0x50ad('0x8'));var config=require('../../config/environment');var attributes=require(_0x50ad('0x9'));module['exports']=function(_0x206cc8,_0x1aacb5){return _0x206cc8[_0x50ad('0xa')](_0x50ad('0xb'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7ef=['moment','request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger'];(function(_0x4489cb,_0x14dd45){var _0x34597e=function(_0x30bec1){while(--_0x30bec1){_0x4489cb['push'](_0x4489cb['shift']());}};_0x34597e(++_0x14dd45);}(_0xe7ef,0x141));var _0xfe7e=function(_0x2e012c,_0x189a21){_0x2e012c=_0x2e012c-0x0;var _0x2b908f=_0xe7ef[_0x2e012c];return _0x2b908f;};'use strict';var _=require(_0xfe7e('0x0'));var util=require(_0xfe7e('0x1'));var logger=require(_0xfe7e('0x2'))('api');var moment=require(_0xfe7e('0x3'));var BPromise=require('bluebird');var rp=require(_0xfe7e('0x4'));var fs=require('fs');var path=require(_0xfe7e('0x5'));var rimraf=require('rimraf');var config=require(_0xfe7e('0x6'));var attributes=require(_0xfe7e('0x7'));module[_0xfe7e('0x8')]=function(_0x284e61,_0xad161e){return _0x284e61[_0xfe7e('0x9')](_0xfe7e('0xa'),attributes,{'tableName':_0xfe7e('0xb'),'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 2ea6ad3..3676c13 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 _0x3cde=['where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','CmHopperBlack','lodash','util','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetCmHopperBlack','findAll','options','raw'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0x3cde,0x9b));var _0xe3cd=function(_0x12476d,_0x461753){_0x12476d=_0x12476d-0x0;var _0x2651a0=_0x3cde[_0x12476d];return _0x2651a0;};'use strict';var _=require(_0xe3cd('0x0'));var util=require(_0xe3cd('0x1'));var moment=require('moment');var BPromise=require(_0xe3cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3cd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe3cd('0x4'))('rpc');var config=require(_0xe3cd('0x5'));var jayson=require(_0xe3cd('0x6'));var client=jayson[_0xe3cd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2281a3,_0x2778b8,_0x5ed730){return new BPromise(function(_0x3edba1,_0x2a6224){return client[_0xe3cd('0x8')](_0x2281a3,_0x5ed730)[_0xe3cd('0x9')](function(_0x4579d7){logger[_0xe3cd('0xa')](_0xe3cd('0xb'),_0x2778b8,'request\x20sent');logger[_0xe3cd('0xc')](_0xe3cd('0xd'),_0x2778b8,'request\x20sent',JSON[_0xe3cd('0xe')](_0x4579d7));if(_0x4579d7[_0xe3cd('0xf')]){if(_0x4579d7['error'][_0xe3cd('0x10')]===0x1f4){logger[_0xe3cd('0xf')](_0xe3cd('0xb'),_0x2778b8,_0x4579d7[_0xe3cd('0xf')][_0xe3cd('0x11')]);return _0x2a6224(_0x4579d7[_0xe3cd('0xf')][_0xe3cd('0x11')]);}logger[_0xe3cd('0xf')](_0xe3cd('0xb'),_0x2778b8,_0x4579d7[_0xe3cd('0xf')][_0xe3cd('0x11')]);return _0x3edba1(_0x4579d7[_0xe3cd('0xf')]['message']);}else{logger[_0xe3cd('0xa')](_0xe3cd('0xb'),_0x2778b8,_0xe3cd('0x12'));_0x3edba1(_0x4579d7[_0xe3cd('0x13')][_0xe3cd('0x11')]);}})[_0xe3cd('0x14')](function(_0x150213){logger[_0xe3cd('0xf')](_0xe3cd('0xb'),_0x2778b8,_0x150213);_0x2a6224(_0x150213);});});}exports[_0xe3cd('0x15')]=function(_0x17611d){var _0x4bc899=this;return new Promise(function(_0x34a50d,_0x520e93){return db['CmHopperBlack'][_0xe3cd('0x16')]({'raw':_0x17611d[_0xe3cd('0x17')]?_0x17611d['options'][_0xe3cd('0x18')]===undefined?!![]:![]:!![],'where':_0x17611d['options']?_0x17611d[_0xe3cd('0x17')][_0xe3cd('0x19')]||null:null,'attributes':_0x17611d[_0xe3cd('0x17')]?_0x17611d[_0xe3cd('0x17')][_0xe3cd('0x1a')]||null:null,'limit':_0x17611d[_0xe3cd('0x17')]?_0x17611d[_0xe3cd('0x17')][_0xe3cd('0x1b')]||null:null,'include':_0x17611d[_0xe3cd('0x17')]?_0x17611d[_0xe3cd('0x17')][_0xe3cd('0x1c')]?_[_0xe3cd('0x1d')](_0x17611d[_0xe3cd('0x17')][_0xe3cd('0x1c')],function(_0xc32692){return{'model':db[_0xc32692[_0xe3cd('0x1e')]],'as':_0xc32692['as'],'attributes':_0xc32692['attributes'],'include':_0xc32692['include']?_[_0xe3cd('0x1d')](_0xc32692['include'],function(_0x38cf4f){return{'model':db[_0x38cf4f[_0xe3cd('0x1e')]],'as':_0x38cf4f['as'],'attributes':_0x38cf4f[_0xe3cd('0x1a')],'include':_0x38cf4f[_0xe3cd('0x1c')]?_[_0xe3cd('0x1d')](_0x38cf4f[_0xe3cd('0x1c')],function(_0x474102){return{'model':db[_0x474102[_0xe3cd('0x1e')]],'as':_0x474102['as'],'attributes':_0x474102[_0xe3cd('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f7587){logger[_0xe3cd('0xa')](_0xe3cd('0x15'),_0x17611d);logger[_0xe3cd('0xc')](_0xe3cd('0x15'),_0x17611d,JSON[_0xe3cd('0xe')](_0x4f7587));_0x34a50d(_0x4f7587);})[_0xe3cd('0x14')](function(_0x40a33b){logger[_0xe3cd('0xf')]('GetCmHopperBlack',_0x40a33b['message'],_0x17611d);_0x520e93(_0x4bc899['error'](0x1f4,_0x40a33b['message']));});});};exports[_0xe3cd('0x1f')]=function(_0x3ab346){var _0x50b669=this;return new Promise(function(_0x9aeeb1,_0x426740){return db['CmHopperBlack'][_0xe3cd('0x20')](_0x3ab346[_0xe3cd('0x21')],{'raw':_0x3ab346[_0xe3cd('0x17')]?_0x3ab346[_0xe3cd('0x17')][_0xe3cd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ab346['options']?_0x3ab346[_0xe3cd('0x17')][_0xe3cd('0x19')]||null:null,'attributes':_0x3ab346[_0xe3cd('0x17')]?_0x3ab346['options'][_0xe3cd('0x1a')]||null:null,'limit':_0x3ab346['options']?_0x3ab346['options'][_0xe3cd('0x1b')]||null:null})[_0xe3cd('0x9')](function(_0x311c04){logger[_0xe3cd('0xa')](_0xe3cd('0x1f'),_0x3ab346);logger[_0xe3cd('0xc')]('UpdateCmHopperBlack',_0x3ab346,JSON[_0xe3cd('0xe')](_0x311c04));_0x9aeeb1(_0x311c04);})[_0xe3cd('0x14')](function(_0x496932){logger[_0xe3cd('0xf')](_0xe3cd('0x1f'),_0x496932[_0xe3cd('0x11')],_0x3ab346);_0x426740(_0x50b669['error'](0x1f4,_0x496932[_0xe3cd('0x11')]));});});};exports[_0xe3cd('0x22')]=function(_0x1c2ad6){var _0x1348c0=this;return new Promise(function(_0x578208,_0x33c855){return db[_0xe3cd('0x23')]['destroy']({'where':_0x1c2ad6[_0xe3cd('0x17')]?_0x1c2ad6[_0xe3cd('0x17')][_0xe3cd('0x19')]||null:null})[_0xe3cd('0x9')](function(_0x3b9e69){logger[_0xe3cd('0xa')](_0xe3cd('0x22'),_0x1c2ad6);logger['debug'](_0xe3cd('0x22'),_0x1c2ad6,JSON[_0xe3cd('0xe')](_0x3b9e69));_0x578208(_0x3b9e69);})[_0xe3cd('0x14')](function(_0x2a2e78){logger[_0xe3cd('0xf')](_0xe3cd('0x22'),_0x2a2e78[_0xe3cd('0x11')],_0x1c2ad6);_0x33c855(_0x1348c0[_0xe3cd('0xf')](0x1f4,_0x2a2e78[_0xe3cd('0x11')]));});});}; \ No newline at end of file +var _0xda6c=['CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','where','limit','include','map','attributes','model','stringify','catch','UpdateCmHopperBlack','update','body','destroy','DestroyCmHopperBlack','lodash','moment','bluebird','../../config/utils','rpc','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1003a1,_0xa64ce2){var _0x967bc8=function(_0x50cf26){while(--_0x50cf26){_0x1003a1['push'](_0x1003a1['shift']());}};_0x967bc8(++_0xa64ce2);}(_0xda6c,0xe8));var _0xcda6=function(_0x35d83e,_0xfc5abd){_0x35d83e=_0x35d83e-0x0;var _0x1bc147=_0xda6c[_0x35d83e];return _0x1bc147;};'use strict';var _=require(_0xcda6('0x0'));var util=require('util');var moment=require(_0xcda6('0x1'));var BPromise=require(_0xcda6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcda6('0x3'));var logger=require('../../config/logger')(_0xcda6('0x4'));var config=require('../../config/environment');var jayson=require(_0xcda6('0x5'));var client=jayson[_0xcda6('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a784a,_0x5250bc,_0x3d94b5){return new BPromise(function(_0x222a0d,_0x3eb9cd){return client[_0xcda6('0x7')](_0x5a784a,_0x3d94b5)[_0xcda6('0x8')](function(_0x1ba735){logger[_0xcda6('0x9')](_0xcda6('0xa'),_0x5250bc,_0xcda6('0xb'));logger[_0xcda6('0xc')](_0xcda6('0xd'),_0x5250bc,_0xcda6('0xb'),JSON['stringify'](_0x1ba735));if(_0x1ba735['error']){if(_0x1ba735[_0xcda6('0xe')][_0xcda6('0xf')]===0x1f4){logger['error'](_0xcda6('0xa'),_0x5250bc,_0x1ba735[_0xcda6('0xe')][_0xcda6('0x10')]);return _0x3eb9cd(_0x1ba735[_0xcda6('0xe')][_0xcda6('0x10')]);}logger[_0xcda6('0xe')](_0xcda6('0xa'),_0x5250bc,_0x1ba735[_0xcda6('0xe')]['message']);return _0x222a0d(_0x1ba735[_0xcda6('0xe')][_0xcda6('0x10')]);}else{logger[_0xcda6('0x9')](_0xcda6('0xa'),_0x5250bc,_0xcda6('0xb'));_0x222a0d(_0x1ba735[_0xcda6('0x11')][_0xcda6('0x10')]);}})['catch'](function(_0x27f2ca){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x5250bc,_0x27f2ca);_0x3eb9cd(_0x27f2ca);});});}exports[_0xcda6('0x12')]=function(_0x4327b6){var _0x5e8da8=this;return new Promise(function(_0x1cdaf6,_0x58be06){return db[_0xcda6('0x13')][_0xcda6('0x14')]({'raw':_0x4327b6[_0xcda6('0x15')]?_0x4327b6[_0xcda6('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4327b6['options']?_0x4327b6['options'][_0xcda6('0x16')]||null:null,'attributes':_0x4327b6['options']?_0x4327b6[_0xcda6('0x15')]['attributes']||null:null,'limit':_0x4327b6[_0xcda6('0x15')]?_0x4327b6[_0xcda6('0x15')][_0xcda6('0x17')]||null:null,'include':_0x4327b6[_0xcda6('0x15')]?_0x4327b6[_0xcda6('0x15')][_0xcda6('0x18')]?_[_0xcda6('0x19')](_0x4327b6[_0xcda6('0x15')]['include'],function(_0x540dc7){return{'model':db[_0x540dc7['model']],'as':_0x540dc7['as'],'attributes':_0x540dc7[_0xcda6('0x1a')],'include':_0x540dc7['include']?_['map'](_0x540dc7[_0xcda6('0x18')],function(_0x35ccf7){return{'model':db[_0x35ccf7[_0xcda6('0x1b')]],'as':_0x35ccf7['as'],'attributes':_0x35ccf7[_0xcda6('0x1a')],'include':_0x35ccf7['include']?_[_0xcda6('0x19')](_0x35ccf7[_0xcda6('0x18')],function(_0x4c1412){return{'model':db[_0x4c1412[_0xcda6('0x1b')]],'as':_0x4c1412['as'],'attributes':_0x4c1412[_0xcda6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xcda6('0x8')](function(_0x1ea650){logger[_0xcda6('0x9')](_0xcda6('0x12'),_0x4327b6);logger[_0xcda6('0xc')](_0xcda6('0x12'),_0x4327b6,JSON[_0xcda6('0x1c')](_0x1ea650));_0x1cdaf6(_0x1ea650);})[_0xcda6('0x1d')](function(_0x15a1b3){logger['error'](_0xcda6('0x12'),_0x15a1b3['message'],_0x4327b6);_0x58be06(_0x5e8da8[_0xcda6('0xe')](0x1f4,_0x15a1b3['message']));});});};exports[_0xcda6('0x1e')]=function(_0x331be6){var _0x116936=this;return new Promise(function(_0x1fdcb9,_0x1b6084){return db[_0xcda6('0x13')][_0xcda6('0x1f')](_0x331be6[_0xcda6('0x20')],{'raw':_0x331be6['options']?_0x331be6[_0xcda6('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x331be6[_0xcda6('0x15')]?_0x331be6[_0xcda6('0x15')]['where']||null:null,'attributes':_0x331be6['options']?_0x331be6[_0xcda6('0x15')]['attributes']||null:null,'limit':_0x331be6[_0xcda6('0x15')]?_0x331be6[_0xcda6('0x15')][_0xcda6('0x17')]||null:null})[_0xcda6('0x8')](function(_0x33f215){logger[_0xcda6('0x9')](_0xcda6('0x1e'),_0x331be6);logger[_0xcda6('0xc')]('UpdateCmHopperBlack',_0x331be6,JSON[_0xcda6('0x1c')](_0x33f215));_0x1fdcb9(_0x33f215);})[_0xcda6('0x1d')](function(_0x555079){logger['error'](_0xcda6('0x1e'),_0x555079[_0xcda6('0x10')],_0x331be6);_0x1b6084(_0x116936[_0xcda6('0xe')](0x1f4,_0x555079[_0xcda6('0x10')]));});});};exports['DestroyCmHopperBlack']=function(_0x2b0373){var _0x57f024=this;return new Promise(function(_0xf00703,_0x2a31be){return db['CmHopperBlack'][_0xcda6('0x21')]({'where':_0x2b0373['options']?_0x2b0373[_0xcda6('0x15')][_0xcda6('0x16')]||null:null})[_0xcda6('0x8')](function(_0x2e9cc1){logger[_0xcda6('0x9')](_0xcda6('0x22'),_0x2b0373);logger[_0xcda6('0xc')](_0xcda6('0x22'),_0x2b0373,JSON[_0xcda6('0x1c')](_0x2e9cc1));_0xf00703(_0x2e9cc1);})[_0xcda6('0x1d')](function(_0x33d00d){logger[_0xcda6('0xe')](_0xcda6('0x22'),_0x33d00d[_0xcda6('0x10')],_0x2b0373);_0x2a31be(_0x57f024['error'](0x1f4,_0x33d00d['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 179edc0..e0d7e83 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 _0xfcf0=['index','/describe','describe','/:id','show','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated'];(function(_0x548cce,_0x1a9270){var _0x590a98=function(_0x281938){while(--_0x281938){_0x548cce['push'](_0x548cce['shift']());}};_0x590a98(++_0x1a9270);}(_0xfcf0,0x138));var _0x0fcf=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xfcf0[_0x576170];return _0x397c70;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var fs_extra=require(_0x0fcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var controller=require(_0x0fcf('0x8'));router[_0x0fcf('0x9')]('/',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0xb')]);router[_0x0fcf('0x9')](_0x0fcf('0xc'),auth['isAuthenticated'](),controller[_0x0fcf('0xd')]);router[_0x0fcf('0x9')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0xf')]);router[_0x0fcf('0x10')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x11')]);router['delete'](_0x0fcf('0xe'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x12')]);module['exports']=router; \ No newline at end of file +var _0xfb11=['show','put','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','/describe','describe','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xfb11[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x1fb1('0x0'));var util=require('util');var path=require(_0x1fb1('0x1'));var timeout=require(_0x1fb1('0x2'));var express=require('express');var router=express[_0x1fb1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1fb1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1fb1('0x5'));var controller=require(_0x1fb1('0x6'));router['get']('/',auth[_0x1fb1('0x7')](),controller[_0x1fb1('0x8')]);router['get'](_0x1fb1('0x9'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0xa')]);router[_0x1fb1('0xb')](_0x1fb1('0xc'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0xd')]);router[_0x1fb1('0xe')](_0x1fb1('0xc'),auth[_0x1fb1('0x7')](),controller['update']);router[_0x1fb1('0xf')]('/:id',auth[_0x1fb1('0x7')](),controller['destroy']);module[_0x1fb1('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 9508bff..a4839d5 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 _0xffc2=['exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','BOOLEAN'];(function(_0x1261d3,_0x439c15){var _0x1d0e6d=function(_0x108f97){while(--_0x108f97){_0x1261d3['push'](_0x1261d3['shift']());}};_0x1d0e6d(++_0x439c15);}(_0xffc2,0x154));var _0x2ffc=function(_0x195223,_0x121404){_0x195223=_0x195223-0x0;var _0x3a62dd=_0xffc2[_0x195223];return _0x3a62dd;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x2ffc('0x0')]={'state':{'type':Sequelize[_0x2ffc('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x2ffc('0x2')]},'scheduledat':{'type':Sequelize[_0x2ffc('0x3')]},'countbusyretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2ffc('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2ffc('0x2')]},'starttime':{'type':Sequelize[_0x2ffc('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x2ffc('0x3')]},'endtime':{'type':Sequelize[_0x2ffc('0x3')]},'ringtime':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2ffc('0x2')]},'campaign':{'type':Sequelize[_0x2ffc('0x2')]},'campaigntype':{'type':Sequelize[_0x2ffc('0x2')]},'membername':{'type':Sequelize[_0x2ffc('0x2')]},'reason':{'type':Sequelize[_0x2ffc('0x2')]},'disposition':{'type':Sequelize[_0x2ffc('0x2')]},'secondDisposition':{'type':Sequelize[_0x2ffc('0x2')]},'thirdDisposition':{'type':Sequelize[_0x2ffc('0x2')]},'dispositionat':{'type':Sequelize[_0x2ffc('0x3')],'set':function(_0x48d260){var _0x2b6b20=this[_0x2ffc('0x4')](_0x2ffc('0x5'));if(_0x2b6b20&&_0x48d260){this[_0x2ffc('0x6')](_0x2ffc('0x7'),moment(_0x48d260)[_0x2ffc('0x8')](moment(_0x2b6b20),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2ffc('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2ffc('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x2ffc('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2ffc('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2ffc('0x3')]},'deleted':{'type':Sequelize[_0x2ffc('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2ffc('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2ffc('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x825d=['setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x50c58c,_0x3649da){var _0x5ecbd4=function(_0x5ae3c2){while(--_0x5ae3c2){_0x50c58c['push'](_0x50c58c['shift']());}};_0x5ecbd4(++_0x3649da);}(_0x825d,0xb9));var _0xd825=function(_0x235840,_0x189acc){_0x235840=_0x235840-0x0;var _0x1414cf=_0x825d[_0x235840];return _0x1414cf;};'use strict';var Sequelize=require(_0xd825('0x0'));var moment=require('moment');module[_0xd825('0x1')]={'state':{'type':Sequelize[_0xd825('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xd825('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xd825('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd825('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd825('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd825('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xd825('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd825('0x3')]},'calleridname':{'type':Sequelize[_0xd825('0x3')]},'starttime':{'type':Sequelize[_0xd825('0x4')]},'responsetime':{'type':Sequelize[_0xd825('0x4')]},'answertime':{'type':Sequelize[_0xd825('0x4')]},'droptime':{'type':Sequelize[_0xd825('0x4')]},'endtime':{'type':Sequelize[_0xd825('0x4')]},'ringtime':{'type':Sequelize[_0xd825('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd825('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd825('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd825('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd825('0x3')]},'campaign':{'type':Sequelize[_0xd825('0x3')]},'campaigntype':{'type':Sequelize[_0xd825('0x3')]},'membername':{'type':Sequelize[_0xd825('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd825('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x14cdc6){var _0x182cbe=this['getDataValue']('endtime');if(_0x182cbe&&_0x14cdc6){this[_0xd825('0x5')](_0xd825('0x6'),moment(_0x14cdc6)[_0xd825('0x7')](moment(_0x182cbe),_0xd825('0x8')));}}},'amd':{'type':Sequelize[_0xd825('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xd825('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xd825('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd825('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xd825('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd825('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd825('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd825('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 7cb7d18..8403feb 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 _0x2675=['lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','destroy','then','error','name','send','index','map','CmHopperFinal','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','length','options','find','describe','body','uniqueid','params','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','busyContacts','abandonedContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','VoiceQueueId','createdAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','updatedAt','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','select','phone','from','calleridnum','cm_hopper_final','state\x20=\x204','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','group','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x29f0e8,_0x2f7d39){var _0x2e243e=function(_0x3281aa){while(--_0x3281aa){_0x29f0e8['push'](_0x29f0e8['shift']());}};_0x2e243e(++_0x2f7d39);}(_0x2675,0x75));var _0x5267=function(_0x304c1c,_0x5a110d){_0x304c1c=_0x304c1c-0x0;var _0x5f222c=_0x2675[_0x304c1c];return _0x5f222c;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];function respondWithStatusCode(_0x1f9be3,_0x1d7090){_0x1d7090=_0x1d7090||0xcc;return function(_0x1171b9){if(_0x1171b9){return _0x1f9be3[_0x5267('0x16')](_0x1d7090);}return _0x1f9be3[_0x5267('0x17')](_0x1d7090)[_0x5267('0x18')]();};}function respondWithResult(_0x1e2d3b,_0x16e5a7){_0x16e5a7=_0x16e5a7||0xc8;return function(_0x29349a){if(_0x29349a){return _0x1e2d3b[_0x5267('0x17')](_0x16e5a7)['json'](_0x29349a);}};}function respondWithFilteredResult(_0x52e24e,_0xa593fb){return function(_0x40d897){if(_0x40d897){var _0x38a147=typeof _0xa593fb[_0x5267('0x19')]===_0x5267('0x1a')&&typeof _0xa593fb[_0x5267('0x1b')]===_0x5267('0x1a');var _0x6831e0=_0x40d897[_0x5267('0x1c')];var _0xb1c97a=_0x38a147?0x0:_0xa593fb[_0x5267('0x19')];var _0x1ab03=_0x38a147?_0x40d897['count']:_0xa593fb[_0x5267('0x19')]+_0xa593fb[_0x5267('0x1b')];var _0x5069e8;if(_0x1ab03>=_0x6831e0){_0x1ab03=_0x6831e0;_0x5069e8=0xc8;}else{_0x5069e8=0xce;}_0x52e24e[_0x5267('0x17')](_0x5069e8);return _0x52e24e['set'](_0x5267('0x1d'),_0xb1c97a+'-'+_0x1ab03+'/'+_0x6831e0)[_0x5267('0x1e')](_0x40d897);}return null;};}function patchUpdates(_0x39c0c3){return function(_0x2a9f99){try{jsonpatch[_0x5267('0x1f')](_0x2a9f99,_0x39c0c3,!![]);}catch(_0x4dd637){return BPromise[_0x5267('0x20')](_0x4dd637);}return _0x2a9f99['save']();};}function saveUpdates(_0xa32663,_0x420fb8){return function(_0x3b53ac){if(_0x3b53ac){return _0x3b53ac['update'](_0xa32663)['then'](function(_0x5546e2){return _0x5546e2;});}return null;};}function removeEntity(_0x4a17c7,_0x5ea6a6){return function(_0x26c7f8){if(_0x26c7f8){return _0x26c7f8[_0x5267('0x21')]()[_0x5267('0x22')](function(){_0x4a17c7[_0x5267('0x17')](0xcc)[_0x5267('0x18')]();});}};}function handleEntityNotFound(_0x40d1be,_0x126a97){return function(_0x220e03){if(!_0x220e03){_0x40d1be[_0x5267('0x16')](0x194);}return _0x220e03;};}function handleError(_0x59f112,_0x5cb64f){_0x5cb64f=_0x5cb64f||0x1f4;return function(_0x354111){logger[_0x5267('0x23')](_0x354111['stack']);if(_0x354111[_0x5267('0x24')]){delete _0x354111['name'];}_0x59f112['status'](_0x5cb64f)[_0x5267('0x25')](_0x354111);};}exports[_0x5267('0x26')]=function(_0x1f33b7,_0x2d2ace){var _0x33c431={},_0x4f3d4d={},_0x5e87eb={'count':0x0,'rows':[]};var _0x18020c=_[_0x5267('0x27')](db[_0x5267('0x28')]['rawAttributes'],function(_0x58d685){return{'name':_0x58d685[_0x5267('0x29')],'type':_0x58d685[_0x5267('0x2a')][_0x5267('0x2b')]};});_0x4f3d4d['model']=_['map'](_0x18020c,_0x5267('0x24'));_0x4f3d4d[_0x5267('0x2c')]=_[_0x5267('0x2d')](_0x1f33b7[_0x5267('0x2c')]);_0x4f3d4d['filters']=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],_0x4f3d4d[_0x5267('0x2c')]);_0x33c431[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],qs[_0x5267('0x31')](_0x1f33b7[_0x5267('0x2c')]['fields']));_0x33c431['attributes']=_0x33c431[_0x5267('0x30')]['length']?_0x33c431[_0x5267('0x30')]:_0x4f3d4d[_0x5267('0x2f')];if(!_0x1f33b7[_0x5267('0x2c')][_0x5267('0x32')]('nolimit')){_0x33c431[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x1b')]);_0x33c431[_0x5267('0x19')]=qs[_0x5267('0x19')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x19')]);}_0x33c431['order']=qs[_0x5267('0x33')](_0x1f33b7['query'][_0x5267('0x33')]);_0x33c431[_0x5267('0x34')]=qs[_0x5267('0x35')](_[_0x5267('0x36')](_0x1f33b7[_0x5267('0x2c')],_0x4f3d4d[_0x5267('0x35')]),_0x18020c);if(_0x1f33b7[_0x5267('0x2c')]['filter']){_0x33c431[_0x5267('0x34')]=_[_0x5267('0x37')](_0x33c431[_0x5267('0x34')],{'$or':_[_0x5267('0x27')](_0x18020c,function(_0x82cea7){if(_0x82cea7[_0x5267('0x2a')]!==_0x5267('0x38')){var _0x487dfc={};_0x487dfc[_0x82cea7[_0x5267('0x24')]]={'$like':'%'+_0x1f33b7['query'][_0x5267('0x39')]+'%'};return _0x487dfc;}})});}_0x33c431=_['merge']({},_0x33c431,_0x1f33b7['options']);var _0x51bddd={'where':_0x33c431[_0x5267('0x34')]};return db['CmHopperFinal'][_0x5267('0x1c')](_0x51bddd)[_0x5267('0x22')](function(_0x3d4b19){_0x5e87eb[_0x5267('0x1c')]=_0x3d4b19;if(_0x1f33b7['query'][_0x5267('0x3a')]){_0x33c431[_0x5267('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x33c431);})[_0x5267('0x22')](function(_0x560cdf){_0x5e87eb[_0x5267('0x3c')]=_0x560cdf;return _0x5e87eb;})[_0x5267('0x22')](respondWithFilteredResult(_0x2d2ace,_0x33c431))[_0x5267('0x3d')](handleError(_0x2d2ace,null));};exports[_0x5267('0x3e')]=function(_0x36d0f1,_0x3012cb){var _0x27add5={'raw':!![],'where':{'id':_0x36d0f1['params']['id']}},_0x5697b3={};_0x5697b3[_0x5267('0x2f')]=_['keys'](db[_0x5267('0x28')][_0x5267('0x3f')]);_0x5697b3['query']=_[_0x5267('0x2d')](_0x36d0f1[_0x5267('0x2c')]);_0x5697b3[_0x5267('0x35')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],_0x5697b3[_0x5267('0x2c')]);_0x27add5[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],qs['fields'](_0x36d0f1[_0x5267('0x2c')][_0x5267('0x31')]));_0x27add5[_0x5267('0x30')]=_0x27add5[_0x5267('0x30')][_0x5267('0x40')]?_0x27add5['attributes']:_0x5697b3[_0x5267('0x2f')];if(_0x36d0f1['query'][_0x5267('0x3a')]){_0x27add5['include']=[{'all':!![]}];}_0x27add5=_['merge']({},_0x27add5,_0x36d0f1[_0x5267('0x41')]);return db['CmHopperFinal'][_0x5267('0x42')](_0x27add5)[_0x5267('0x22')](handleEntityNotFound(_0x3012cb,null))[_0x5267('0x22')](respondWithResult(_0x3012cb,null))[_0x5267('0x3d')](handleError(_0x3012cb,null));};exports['describe']=function(_0x12d6a8,_0x4ee826){return db['CmHopperFinal'][_0x5267('0x43')]()[_0x5267('0x22')](respondWithResult(_0x4ee826,null))['catch'](handleError(_0x4ee826,null));};exports['update']=function(_0x383ebe,_0xe0439e){if(_0x383ebe[_0x5267('0x44')][_0x5267('0x45')]){delete _0x383ebe[_0x5267('0x44')][_0x5267('0x45')];}return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'uniqueid':_0x383ebe[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0xe0439e,null))[_0x5267('0x22')](saveUpdates(_0x383ebe[_0x5267('0x44')],null))[_0x5267('0x22')](respondWithResult(_0xe0439e,null))[_0x5267('0x3d')](handleError(_0xe0439e,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x8636d0,_0x466d46,_0x371486){return db['CmHopperFinal'][_0x5267('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x8636d0[_0x5267('0x46')]['id']},'attributes':[[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x4a')))),'noSuchContacts'],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4c')))),_0x5267('0x4d')],[db['sequelize']['fn']('COUNT',db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x4e')))),'busyContacts'],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4f')))),_0x5267('0x50')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x51')))),_0x5267('0x52')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x53')))),'abandonedContacts'],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db['sequelize'][_0x5267('0x4b')](_0x5267('0x54')))),_0x5267('0x55')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db['sequelize'][_0x5267('0x4b')](_0x5267('0x56')))),_0x5267('0x57')]]})[_0x5267('0x22')](handleEntityNotFound(_0x466d46,null))['then'](respondWithResult(_0x466d46,null))['catch'](handleError(_0x466d46,null));};exports[_0x5267('0x58')]=function(_0x5393e9,_0x3f5cda,_0x47059c){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x5393e9[_0x5267('0x46')]['id']},'attributes':[[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db['sequelize']['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4a')))),_0x5267('0x59')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4c')))),_0x5267('0x4d')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x4e')))),_0x5267('0x5a')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4f')))),_0x5267('0x50')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x51')))),_0x5267('0x52')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x53')))),_0x5267('0x5b')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db['sequelize']['fn'](_0x5267('0x49'),db['sequelize']['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x56')))),_0x5267('0x57')]]})[_0x5267('0x22')](handleEntityNotFound(_0x3f5cda,null))[_0x5267('0x22')](respondWithResult(_0x3f5cda,null))[_0x5267('0x3d')](handleError(_0x3f5cda,null));};exports[_0x5267('0x5c')]=function(_0x21338f,_0x1103c5,_0x489b9a){return db['VoiceQueue']['find']({'where':{'id':_0x21338f[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x1103c5,null))[_0x5267('0x22')](function(_0x457d84){var _0x4974d1;if(_0x457d84){_0x4974d1=squel[_0x5267('0x5d')]()[_0x5267('0x5e')](_0x5267('0x5f'))[_0x5267('0x60')](['phone',_0x5267('0x61'),_0x5267('0x62'),'ListId',_0x5267('0x63'),_0x5267('0x64'),'updatedAt'],squel['select']()[_0x5267('0x65')](_0x5267('0x66'),'phone')['field'](_0x5267('0x67'),_0x5267('0x61'))[_0x5267('0x65')](_0x5267('0x68'),_0x5267('0x62'))['field'](_0x5267('0x69'),_0x5267('0x6a'))['field'](_0x5267('0x6b'),_0x5267('0x63'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x64'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x6c'))['from']('cm_hopper_final')[_0x5267('0x34')](_0x5267('0x6d'),_0x21338f[_0x5267('0x46')]['id'][_0x5267('0x6e')]())['where'](_0x5267('0x6f'),_0x21338f['body'][_0x5267('0x70')][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x71'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5267('0x72')]()[_0x5267('0x65')](_0x5267('0x73'))[_0x5267('0x74')](_0x5267('0x5f'))[_0x5267('0x34')]('VoiceQueueId\x20=\x20?',_0x21338f[_0x5267('0x46')]['id']['toString']()))[_0x5267('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5267('0x72')]()[_0x5267('0x65')](_0x5267('0x75'))[_0x5267('0x74')](_0x5267('0x76'))[_0x5267('0x34')](_0x5267('0x6d'),_0x21338f[_0x5267('0x46')]['id'][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x77')))['group'](_0x5267('0x62')))[_0x5267('0x6e')]();return db['sequelize'][_0x5267('0x2c')](_0x4974d1);}return[];})[_0x5267('0x22')](respondWithResult(_0x1103c5,null))[_0x5267('0x3d')](handleError(_0x1103c5,null));};exports[_0x5267('0x78')]=function(_0xd18795,_0x37b007,_0x358543){return db['Campaign'][_0x5267('0x42')]({'where':{'id':_0xd18795[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x37b007,null))[_0x5267('0x22')](function(_0x1cdf9f){var _0x4dbaa2;if(_0x1cdf9f){_0x4dbaa2=squel['insert']()[_0x5267('0x5e')](_0x5267('0x5f'))[_0x5267('0x60')]([_0x5267('0x73'),'scheduledAt',_0x5267('0x62'),_0x5267('0x6a'),_0x5267('0x79'),_0x5267('0x64'),_0x5267('0x6c')],squel[_0x5267('0x72')]()[_0x5267('0x65')](_0x5267('0x66'),_0x5267('0x73'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x61'))[_0x5267('0x65')]('ANY_VALUE(ContactId)',_0x5267('0x62'))[_0x5267('0x65')](_0x5267('0x69'),_0x5267('0x6a'))[_0x5267('0x65')](_0x5267('0x7a'),_0x5267('0x79'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x64'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x6c'))[_0x5267('0x74')](_0x5267('0x76'))[_0x5267('0x34')](_0x5267('0x7b'),_0xd18795[_0x5267('0x46')]['id'][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x6f'),_0xd18795[_0x5267('0x44')][_0x5267('0x70')]['toString']())[_0x5267('0x34')](_0x5267('0x71'))[_0x5267('0x34')](_0x5267('0x7c'),squel[_0x5267('0x72')]()['field'](_0x5267('0x73'))[_0x5267('0x74')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0xd18795[_0x5267('0x46')]['id']['toString']()))[_0x5267('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x5267('0x65')](_0x5267('0x75'))[_0x5267('0x74')](_0x5267('0x76'))[_0x5267('0x34')]('CampaignId\x20=\x20?',_0xd18795['params']['id'][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x77')))[_0x5267('0x7d')](_0x5267('0x62')))['toString']();return db[_0x5267('0x48')]['query'](_0x4dbaa2);}return[];})['then'](respondWithResult(_0x37b007,null))[_0x5267('0x3d')](handleError(_0x37b007,null));};exports['checkContactHopper']=function(_0x5da8d6,_0x3ebe63,_0x321322){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x5da8d6['body'][_0x5267('0x63')],'CampaignId':_0x5da8d6['body'][_0x5267('0x79')],'ContactId':_0x5da8d6['body'][_0x5267('0x62')]}})[_0x5267('0x22')](handleEntityNotFound(_0x3ebe63,null))['then'](function(_0x1ae9fe){if(_0x1ae9fe){return _0x1ae9fe;}return null;})[_0x5267('0x22')](respondWithResult(_0x3ebe63,null))[_0x5267('0x3d')](handleError(_0x3ebe63,null));}; \ No newline at end of file +var _0x187d=['state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','select','from','cm_hopper','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','into','CampaignId','CampaignId\x20=\x20?','state','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','CmHopperFinal','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','toString'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x187d,0x93));var _0xd187=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x187d[_0x2160a9];return _0xa88cf7;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':!![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')]()[_0xd187('0x3f')](respondWithResult(_0x3f5def,null))['catch'](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x2657be,_0x4523c8){if(_0x2657be[_0xd187('0x48')][_0xd187('0x49')]){delete _0x2657be['body'][_0xd187('0x49')];}return db[_0xd187('0x2d')]['find']({'where':{'uniqueid':_0x2657be[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x4523c8,null))['then'](saveUpdates(_0x2657be['body'],null))['then'](respondWithResult(_0x4523c8,null))['catch'](handleError(_0x4523c8,null));};exports[_0xd187('0x4a')]=function(_0x22f432,_0x12d448,_0x1bcc3a){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x22f432[_0xd187('0x43')]['id']},'attributes':[[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0xd187('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x4f')))),_0xd187('0x50')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x52')))),'congestionContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd187('0x53')],[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd187('0x56')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x12d448,null))[_0xd187('0x3f')](respondWithResult(_0x12d448,null))[_0xd187('0x41')](handleError(_0x12d448,null));};exports[_0xd187('0x59')]=function(_0x23271b,_0x288a04,_0x39934c){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'CampaignId':_0x23271b[_0xd187('0x43')]['id']},'attributes':[[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x5a')))),_0xd187('0x4e')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x52')))),_0xd187('0x5b')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize']['literal'](_0xd187('0x5c')))),_0xd187('0x53')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x5d')))),'reCallContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x288a04,null))['then'](respondWithResult(_0x288a04,null))[_0xd187('0x41')](handleError(_0x288a04,null));};exports[_0xd187('0x5e')]=function(_0x52e364,_0x569959,_0x3bca83){return db['VoiceQueue'][_0xd187('0x46')]({'where':{'id':_0x52e364[_0xd187('0x43')]['id']}})['then'](handleEntityNotFound(_0x569959,null))[_0xd187('0x3f')](function(_0x570c1c){var _0x317bc3;if(_0x570c1c){_0x317bc3=squel['insert']()['into']('cm_hopper')[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x64'),_0xd187('0x65'),_0xd187('0x66')],squel['select']()[_0xd187('0x67')](_0xd187('0x68'),_0xd187('0x60'))['field'](_0xd187('0x69'),_0xd187('0x61'))[_0xd187('0x67')](_0xd187('0x6a'),'ContactId')[_0xd187('0x67')](_0xd187('0x6b'),'ListId')[_0xd187('0x67')](_0xd187('0x6c'),_0xd187('0x64'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')]('NOW()',_0xd187('0x66'))['from']('cm_hopper_final')['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x6f'),_0x52e364[_0xd187('0x48')]['state'][_0xd187('0x6e')]())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x60'))[_0xd187('0x72')](_0xd187('0x73'))['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x74'))[_0xd187('0x72')](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x6d'),_0x52e364['params']['id']['toString']())[_0xd187('0x39')](_0xd187('0x76')))[_0xd187('0x77')](_0xd187('0x62')))[_0xd187('0x6e')]();return db[_0xd187('0x4c')]['query'](_0x317bc3);}return[];})[_0xd187('0x3f')](respondWithResult(_0x569959,null))['catch'](handleError(_0x569959,null));};exports[_0xd187('0x78')]=function(_0x520f86,_0x5cbfa6,_0x304117){return db['Campaign'][_0xd187('0x46')]({'where':{'id':_0x520f86[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x5cbfa6,null))[_0xd187('0x3f')](function(_0x1b93db){var _0x13a362;if(_0x1b93db){_0x13a362=squel[_0xd187('0x79')]()[_0xd187('0x7a')](_0xd187('0x73'))[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x7b'),'createdAt',_0xd187('0x66')],squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x68'),'phone')[_0xd187('0x67')](_0xd187('0x69'),'scheduledAt')['field'](_0xd187('0x6a'),_0xd187('0x62'))[_0xd187('0x67')](_0xd187('0x6b'),_0xd187('0x63'))[_0xd187('0x67')]('ANY_VALUE(CampaignId)',_0xd187('0x7b'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')](_0xd187('0x69'),_0xd187('0x66'))['from']('cm_hopper_final')[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id']['toString']())[_0xd187('0x39')](_0xd187('0x6f'),_0x520f86[_0xd187('0x48')][_0xd187('0x7d')]['toString']())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')['from'](_0xd187('0x73'))[_0xd187('0x39')]('CampaignId\x20=\x20?',_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()['field'](_0xd187('0x74'))['from'](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x76')))['group'](_0xd187('0x62')))[_0xd187('0x6e')]();return db['sequelize'][_0xd187('0x31')](_0x13a362);}return[];})[_0xd187('0x3f')](respondWithResult(_0x5cbfa6,null))['catch'](handleError(_0x5cbfa6,null));};exports[_0xd187('0x7e')]=function(_0x3bd1d8,_0x224312,_0x45b522){return db[_0xd187('0x7f')][_0xd187('0x80')]({'where':{'VoiceQueueId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x64')],'CampaignId':_0x3bd1d8['body'][_0xd187('0x7b')],'ContactId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x62')]}})[_0xd187('0x3f')](handleEntityNotFound(_0x224312,null))[_0xd187('0x3f')](function(_0x400a9){if(_0x400a9){return _0x400a9;}return null;})['then'](respondWithResult(_0x224312,null))['catch'](handleError(_0x224312,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 2dd2556..648892d 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 _0x88cd=['path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x140d94,_0x25e2a5){var _0x50ecb7=function(_0x4d8ff0){while(--_0x4d8ff0){_0x140d94['push'](_0x140d94['shift']());}};_0x50ecb7(++_0x25e2a5);}(_0x88cd,0x87));var _0xd88c=function(_0x54e0f8,_0x29b2d2){_0x54e0f8=_0x54e0f8-0x0;var _0x1d6d8a=_0x88cd[_0x54e0f8];return _0x1d6d8a;};'use strict';var _=require(_0xd88c('0x0'));var util=require(_0xd88c('0x1'));var logger=require(_0xd88c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd88c('0x3'));var rp=require(_0xd88c('0x4'));var fs=require('fs');var path=require(_0xd88c('0x5'));var rimraf=require(_0xd88c('0x6'));var config=require(_0xd88c('0x7'));var attributes=require(_0xd88c('0x8'));module[_0xd88c('0x9')]=function(_0xba34eb,_0x3bd1f0){return _0xba34eb['define'](_0xd88c('0xa'),attributes,{'tableName':_0xd88c('0xb'),'paranoid':![],'indexes':[{'name':_0xd88c('0xc'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0xd88c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xca37=['cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','define'];(function(_0x403556,_0x1bf1a8){var _0x244a6f=function(_0x437bb5){while(--_0x437bb5){_0x403556['push'](_0x403556['shift']());}};_0x244a6f(++_0x1bf1a8);}(_0xca37,0x155));var _0x7ca3=function(_0x544ee4,_0x173548){_0x544ee4=_0x544ee4-0x0;var _0x1a6ca5=_0xca37[_0x544ee4];return _0x1a6ca5;};'use strict';var _=require('lodash');var util=require(_0x7ca3('0x0'));var logger=require(_0x7ca3('0x1'))(_0x7ca3('0x2'));var moment=require(_0x7ca3('0x3'));var BPromise=require(_0x7ca3('0x4'));var rp=require(_0x7ca3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ca3('0x6'));var config=require(_0x7ca3('0x7'));var attributes=require(_0x7ca3('0x8'));module['exports']=function(_0x321f95,_0x16d66d){return _0x321f95[_0x7ca3('0x9')]('CmHopperFinal',attributes,{'tableName':_0x7ca3('0xa'),'paranoid':![],'indexes':[{'name':_0x7ca3('0xb'),'fields':['calleridnum']},{'name':_0x7ca3('0xc'),'fields':[_0x7ca3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 3760523..0e0db0a 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x3df4d6,_0x2e40cb){var _0x100b8a=function(_0x40eef4){while(--_0x40eef4){_0x3df4d6['push'](_0x3df4d6['shift']());}};_0x100b8a(++_0x2e40cb);}(_0xb10b,0x12a));var _0xbb10=function(_0x15f9c6,_0x4a344e){_0x15f9c6=_0x15f9c6-0x0;var _0xe1874e=_0xb10b[_0x15f9c6];return _0xe1874e;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +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(_0x41817d,_0xd38d22){var _0x494856=function(_0x13b17f){while(--_0x13b17f){_0x41817d['push'](_0x41817d['shift']());}};_0x494856(++_0xd38d22);}(_0x7a54,0x106));var _0x47a5=function(_0x1918a3,_0x55db6b){_0x1918a3=_0x1918a3-0x0;var _0x95fbe5=_0x7a54[_0x1918a3];return _0x95fbe5;};'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 diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index e80e0d1..fc6ccaa 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 _0xd058=['post','moveContactsQueueCampaignHopperFinal','checkContactHopper','put','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id'];(function(_0x701566,_0x7de6cb){var _0x64b6c9=function(_0x7481f7){while(--_0x7481f7){_0x701566['push'](_0x701566['shift']());}};_0x64b6c9(++_0x7de6cb);}(_0xd058,0xe7));var _0x8d05=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0xd058[_0x4c2f30];return _0xb8854d;};'use strict';var multer=require('multer');var util=require(_0x8d05('0x0'));var path=require(_0x8d05('0x1'));var timeout=require(_0x8d05('0x2'));var express=require(_0x8d05('0x3'));var router=express[_0x8d05('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8d05('0x5'));var interaction=require(_0x8d05('0x6'));var config=require(_0x8d05('0x7'));var controller=require(_0x8d05('0x8'));router[_0x8d05('0x9')]('/',auth[_0x8d05('0xa')](),controller[_0x8d05('0xb')]);router['get'](_0x8d05('0xc'),auth[_0x8d05('0xa')](),controller[_0x8d05('0xd')]);router[_0x8d05('0x9')](_0x8d05('0xe'),auth[_0x8d05('0xa')](),controller[_0x8d05('0xf')]);router[_0x8d05('0x9')](_0x8d05('0x10'),auth[_0x8d05('0xa')](),controller[_0x8d05('0x11')]);router['get'](_0x8d05('0x12'),auth[_0x8d05('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x8d05('0x13')]('/voice/queue/moveContacts/:id',auth[_0x8d05('0xa')](),controller[_0x8d05('0x14')]);router[_0x8d05('0x13')]('/voice/campaign/moveContacts/:id',auth[_0x8d05('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router['post']('/checkContactHopper',auth[_0x8d05('0xa')](),controller[_0x8d05('0x15')]);router[_0x8d05('0x16')](_0x8d05('0xe'),auth[_0x8d05('0xa')](),controller[_0x8d05('0x17')]);module[_0x8d05('0x18')]=router; \ No newline at end of file +var _0xdabc=['moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','/checkContactHopper','update','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id'];(function(_0x5ad9d6,_0x184f41){var _0x448ec2=function(_0x20cfb8){while(--_0x20cfb8){_0x5ad9d6['push'](_0x5ad9d6['shift']());}};_0x448ec2(++_0x184f41);}(_0xdabc,0x16b));var _0xcdab=function(_0x35c561,_0x1ade37){_0x35c561=_0x35c561-0x0;var _0x3c3f89=_0xdabc[_0x35c561];return _0x3c3f89;};'use strict';var multer=require('multer');var util=require(_0xcdab('0x0'));var path=require(_0xcdab('0x1'));var timeout=require(_0xcdab('0x2'));var express=require('express');var router=express[_0xcdab('0x3')]();var fs_extra=require(_0xcdab('0x4'));var auth=require(_0xcdab('0x5'));var interaction=require(_0xcdab('0x6'));var config=require(_0xcdab('0x7'));var controller=require(_0xcdab('0x8'));router[_0xcdab('0x9')]('/',auth[_0xcdab('0xa')](),controller['index']);router[_0xcdab('0x9')](_0xcdab('0xb'),auth[_0xcdab('0xa')](),controller['describe']);router[_0xcdab('0x9')](_0xcdab('0xc'),auth[_0xcdab('0xa')](),controller['show']);router[_0xcdab('0x9')]('/voice/queue/countAttributes/:id',auth[_0xcdab('0xa')](),controller[_0xcdab('0xd')]);router['get'](_0xcdab('0xe'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router['post']('/voice/queue/moveContacts/:id',auth[_0xcdab('0xa')](),controller[_0xcdab('0xf')]);router[_0xcdab('0x10')](_0xcdab('0x11'),auth[_0xcdab('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0xcdab('0x12'),auth[_0xcdab('0xa')](),controller['checkContactHopper']);router['put']('/:id',auth[_0xcdab('0xa')](),controller[_0xcdab('0x13')]);module[_0xcdab('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index d9a49a9..155c447 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 _0xfffd=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x310e95,_0x2a8533){var _0x5f287a=function(_0x410f5d){while(--_0x410f5d){_0x310e95['push'](_0x310e95['shift']());}};_0x5f287a(++_0x2a8533);}(_0xfffd,0xea));var _0xdfff=function(_0x5879e9,_0xe58d9e){_0x5879e9=_0x5879e9-0x0;var _0x4eb3f6=_0xfffd[_0x5879e9];return _0x4eb3f6;};'use strict';var Sequelize=require(_0xdfff('0x0'));module[_0xdfff('0x1')]={'state':{'type':Sequelize[_0xdfff('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xdfff('0x3')]},'scheduledat':{'type':Sequelize[_0xdfff('0x4')]},'countbusyretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdfff('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xdfff('0x3')]},'originatecalleridname':{'type':Sequelize[_0xdfff('0x3')]},'calleridnum':{'type':Sequelize[_0xdfff('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdfff('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xdfff('0x4')]},'droptime':{'type':Sequelize[_0xdfff('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdfff('0x3')]},'campaign':{'type':Sequelize[_0xdfff('0x3')]},'campaigntype':{'type':Sequelize[_0xdfff('0x3')]},'membername':{'type':Sequelize[_0xdfff('0x3')]},'reason':{'type':Sequelize[_0xdfff('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xdfff('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xdfff('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdfff('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdfff('0x4')]},'recallme':{'type':Sequelize[_0xdfff('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xdfff('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xdfff('0x3')]}}; \ No newline at end of file +var _0x6ca3=['DATE','BOOLEAN','INTEGER','STRING'];(function(_0x44b533,_0x24af1c){var _0x284cf3=function(_0x4c2d4f){while(--_0x4c2d4f){_0x44b533['push'](_0x44b533['shift']());}};_0x284cf3(++_0x24af1c);}(_0x6ca3,0xba));var _0x36ca=function(_0x514f8c,_0x149740){_0x514f8c=_0x514f8c-0x0;var _0x3fbf72=_0x6ca3[_0x514f8c];return _0x3fbf72;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x36ca('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x36ca('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x36ca('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x36ca('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x36ca('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x36ca('0x1')]},'calleridnum':{'type':Sequelize[_0x36ca('0x1')]},'calleridname':{'type':Sequelize[_0x36ca('0x1')]},'starttime':{'type':Sequelize[_0x36ca('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x36ca('0x2')]},'endtime':{'type':Sequelize[_0x36ca('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x36ca('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x36ca('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x36ca('0x1')]},'campaign':{'type':Sequelize[_0x36ca('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x36ca('0x1')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x36ca('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0x36ca('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0x36ca('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x36ca('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x36ca('0x2')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x36ca('0x2')]},'edited':{'type':Sequelize[_0x36ca('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x36ca('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x36ca('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x36ca('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x36ca('0x0')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x36ca('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 00f1f59..f44fc60 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 _0x1cf1=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','catch','params','include','create','body','describe','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x38004c,_0x3b43ef){var _0x4e3d85=function(_0xf0c04c){while(--_0xf0c04c){_0x38004c['push'](_0x38004c['shift']());}};_0x4e3d85(++_0x3b43ef);}(_0x1cf1,0x183));var _0x11cf=function(_0x4497b5,_0x5aac16){_0x4497b5=_0x4497b5-0x0;var _0xb0eaf=_0x1cf1[_0x4497b5];return _0xb0eaf;};'use strict';var emlformat=require(_0x11cf('0x0'));var rimraf=require(_0x11cf('0x1'));var zipdir=require(_0x11cf('0x2'));var jsonpatch=require(_0x11cf('0x3'));var rp=require(_0x11cf('0x4'));var moment=require('moment');var BPromise=require(_0x11cf('0x5'));var Mustache=require(_0x11cf('0x6'));var util=require(_0x11cf('0x7'));var path=require('path');var sox=require(_0x11cf('0x8'));var csv=require(_0x11cf('0x9'));var ejs=require(_0x11cf('0xa'));var fs=require('fs');var fs_extra=require(_0x11cf('0xb'));var _=require(_0x11cf('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x11cf('0xd'));var deskjs=require(_0x11cf('0xe'));var toCsv=require(_0x11cf('0x9'));var querystring=require(_0x11cf('0xf'));var Papa=require(_0x11cf('0x10'));var Redis=require(_0x11cf('0x11'));var authService=require(_0x11cf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x11cf('0x13'));var hardwareService=require(_0x11cf('0x14'));var logger=require(_0x11cf('0x15'))(_0x11cf('0x16'));var utils=require(_0x11cf('0x17'));var config=require(_0x11cf('0x18'));var licenseUtil=require(_0x11cf('0x19'));var db=require(_0x11cf('0x1a'))['db'];function respondWithStatusCode(_0xfc37fc,_0x3586b0){_0x3586b0=_0x3586b0||0xcc;return function(_0x4157be){if(_0x4157be){return _0xfc37fc[_0x11cf('0x1b')](_0x3586b0);}return _0xfc37fc[_0x11cf('0x1c')](_0x3586b0)[_0x11cf('0x1d')]();};}function respondWithResult(_0x414dac,_0x3109aa){_0x3109aa=_0x3109aa||0xc8;return function(_0x12f6e2){if(_0x12f6e2){return _0x414dac[_0x11cf('0x1c')](_0x3109aa)[_0x11cf('0x1e')](_0x12f6e2);}};}function respondWithFilteredResult(_0x159323,_0x2ecf57){return function(_0x375515){if(_0x375515){var _0x1cb7a6=typeof _0x2ecf57[_0x11cf('0x1f')]==='undefined'&&typeof _0x2ecf57[_0x11cf('0x20')]===_0x11cf('0x21');var _0x73cd89=_0x375515['count'];var _0x2239bd=_0x1cb7a6?0x0:_0x2ecf57[_0x11cf('0x1f')];var _0x106c0f=_0x1cb7a6?_0x375515['count']:_0x2ecf57[_0x11cf('0x1f')]+_0x2ecf57['limit'];var _0x20254a;if(_0x106c0f>=_0x73cd89){_0x106c0f=_0x73cd89;_0x20254a=0xc8;}else{_0x20254a=0xce;}_0x159323[_0x11cf('0x1c')](_0x20254a);return _0x159323[_0x11cf('0x22')](_0x11cf('0x23'),_0x2239bd+'-'+_0x106c0f+'/'+_0x73cd89)['json'](_0x375515);}return null;};}function patchUpdates(_0xdf0dca){return function(_0x476e36){try{jsonpatch[_0x11cf('0x24')](_0x476e36,_0xdf0dca,!![]);}catch(_0x1050e9){return BPromise[_0x11cf('0x25')](_0x1050e9);}return _0x476e36[_0x11cf('0x26')]();};}function saveUpdates(_0x12e327,_0x5ced5b){return function(_0xf3c305){if(_0xf3c305){return _0xf3c305[_0x11cf('0x27')](_0x12e327)['then'](function(_0x58cce1){return _0x58cce1;});}return null;};}function removeEntity(_0x4b7802,_0xb85579){return function(_0x5d36d8){if(_0x5d36d8){return _0x5d36d8[_0x11cf('0x28')]()[_0x11cf('0x29')](function(){_0x4b7802[_0x11cf('0x1c')](0xcc)[_0x11cf('0x1d')]();});}};}function handleEntityNotFound(_0x7f9baf,_0x342280){return function(_0x797803){if(!_0x797803){_0x7f9baf[_0x11cf('0x1b')](0x194);}return _0x797803;};}function handleError(_0x11152b,_0x588bc3){_0x588bc3=_0x588bc3||0x1f4;return function(_0x19814f){logger[_0x11cf('0x2a')](_0x19814f[_0x11cf('0x2b')]);if(_0x19814f[_0x11cf('0x2c')]){delete _0x19814f[_0x11cf('0x2c')];}_0x11152b['status'](_0x588bc3)[_0x11cf('0x2d')](_0x19814f);};}exports[_0x11cf('0x2e')]=function(_0x53f411,_0x40f801){var _0x2911c6={},_0x3ad5e5={},_0x3075bd={'count':0x0,'rows':[]};var _0x11600d=_['map'](db[_0x11cf('0x2f')][_0x11cf('0x30')],function(_0x50893d){return{'name':_0x50893d[_0x11cf('0x31')],'type':_0x50893d[_0x11cf('0x32')][_0x11cf('0x33')]};});_0x3ad5e5[_0x11cf('0x34')]=_[_0x11cf('0x35')](_0x11600d,_0x11cf('0x2c'));_0x3ad5e5[_0x11cf('0x36')]=_[_0x11cf('0x37')](_0x53f411[_0x11cf('0x36')]);_0x3ad5e5[_0x11cf('0x38')]=_[_0x11cf('0x39')](_0x3ad5e5['model'],_0x3ad5e5[_0x11cf('0x36')]);_0x2911c6[_0x11cf('0x3a')]=_['intersection'](_0x3ad5e5[_0x11cf('0x34')],qs[_0x11cf('0x3b')](_0x53f411[_0x11cf('0x36')]['fields']));_0x2911c6['attributes']=_0x2911c6[_0x11cf('0x3a')][_0x11cf('0x3c')]?_0x2911c6['attributes']:_0x3ad5e5[_0x11cf('0x34')];if(!_0x53f411[_0x11cf('0x36')][_0x11cf('0x3d')](_0x11cf('0x3e'))){_0x2911c6['limit']=qs[_0x11cf('0x20')](_0x53f411[_0x11cf('0x36')]['limit']);_0x2911c6[_0x11cf('0x1f')]=qs['offset'](_0x53f411['query']['offset']);}_0x2911c6[_0x11cf('0x3f')]=qs[_0x11cf('0x40')](_0x53f411[_0x11cf('0x36')][_0x11cf('0x40')]);_0x2911c6[_0x11cf('0x41')]=qs[_0x11cf('0x38')](_[_0x11cf('0x42')](_0x53f411[_0x11cf('0x36')],_0x3ad5e5[_0x11cf('0x38')]),_0x11600d);if(_0x53f411['query'][_0x11cf('0x43')]){_0x2911c6[_0x11cf('0x41')]=_[_0x11cf('0x44')](_0x2911c6[_0x11cf('0x41')],{'$or':_[_0x11cf('0x35')](_0x11600d,function(_0x55e979){if(_0x55e979['type']!=='VIRTUAL'){var _0x4b9e7e={};_0x4b9e7e[_0x55e979['name']]={'$like':'%'+_0x53f411[_0x11cf('0x36')][_0x11cf('0x43')]+'%'};return _0x4b9e7e;}})});}_0x2911c6=_['merge']({},_0x2911c6,_0x53f411[_0x11cf('0x45')]);var _0x58ba6a={'where':_0x2911c6[_0x11cf('0x41')]};return db['CmHopperHistory'][_0x11cf('0x46')](_0x58ba6a)[_0x11cf('0x29')](function(_0x4ea690){_0x3075bd['count']=_0x4ea690;if(_0x53f411['query'][_0x11cf('0x47')]){_0x2911c6['include']=[{'all':!![]}];}return db[_0x11cf('0x2f')][_0x11cf('0x48')](_0x2911c6);})[_0x11cf('0x29')](function(_0x1dad62){_0x3075bd[_0x11cf('0x49')]=_0x1dad62;return _0x3075bd;})[_0x11cf('0x29')](respondWithFilteredResult(_0x40f801,_0x2911c6))[_0x11cf('0x4a')](handleError(_0x40f801,null));};exports['show']=function(_0x4e4ae7,_0x6931d8){var _0x3e5e81={'raw':!![],'where':{'id':_0x4e4ae7[_0x11cf('0x4b')]['id']}},_0x3d3dd3={};_0x3d3dd3[_0x11cf('0x34')]=_[_0x11cf('0x37')](db[_0x11cf('0x2f')][_0x11cf('0x30')]);_0x3d3dd3[_0x11cf('0x36')]=_[_0x11cf('0x37')](_0x4e4ae7[_0x11cf('0x36')]);_0x3d3dd3[_0x11cf('0x38')]=_[_0x11cf('0x39')](_0x3d3dd3['model'],_0x3d3dd3[_0x11cf('0x36')]);_0x3e5e81['attributes']=_[_0x11cf('0x39')](_0x3d3dd3[_0x11cf('0x34')],qs[_0x11cf('0x3b')](_0x4e4ae7[_0x11cf('0x36')][_0x11cf('0x3b')]));_0x3e5e81[_0x11cf('0x3a')]=_0x3e5e81[_0x11cf('0x3a')]['length']?_0x3e5e81['attributes']:_0x3d3dd3[_0x11cf('0x34')];if(_0x4e4ae7[_0x11cf('0x36')][_0x11cf('0x47')]){_0x3e5e81[_0x11cf('0x4c')]=[{'all':!![]}];}_0x3e5e81=_[_0x11cf('0x44')]({},_0x3e5e81,_0x4e4ae7['options']);return db[_0x11cf('0x2f')]['find'](_0x3e5e81)[_0x11cf('0x29')](handleEntityNotFound(_0x6931d8,null))[_0x11cf('0x29')](respondWithResult(_0x6931d8,null))['catch'](handleError(_0x6931d8,null));};exports[_0x11cf('0x4d')]=function(_0x34a78c,_0x23261a){return db[_0x11cf('0x2f')]['create'](_0x34a78c[_0x11cf('0x4e')],{})[_0x11cf('0x29')](respondWithResult(_0x23261a,0xc9))['catch'](handleError(_0x23261a,null));};exports[_0x11cf('0x4f')]=function(_0x4cc4c7,_0x4c135a){return db['CmHopperHistory'][_0x11cf('0x4f')]()[_0x11cf('0x29')](respondWithResult(_0x4c135a,null))['catch'](handleError(_0x4c135a,null));};exports[_0x11cf('0x27')]=function(_0x451c92,_0x3b4a3d){if(_0x451c92[_0x11cf('0x4e')]['uniqueid']){delete _0x451c92['body'][_0x11cf('0x50')];}return db[_0x11cf('0x2f')][_0x11cf('0x51')]({'where':{'uniqueid':_0x451c92[_0x11cf('0x4b')]['id']}})[_0x11cf('0x29')](handleEntityNotFound(_0x3b4a3d,null))[_0x11cf('0x29')](saveUpdates(_0x451c92[_0x11cf('0x4e')],null))[_0x11cf('0x29')](respondWithResult(_0x3b4a3d,null))[_0x11cf('0x4a')](handleError(_0x3b4a3d,null));}; \ No newline at end of file +var _0x549d=['pick','filter','merge','VIRTUAL','CmHopperHistory','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','uniqueid','eml-format','rimraf','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x549d,0xaa));var _0xd549=function(_0x18df09,_0x1f963b){_0x18df09=_0x18df09-0x0;var _0x53a174=_0x549d[_0x18df09];return _0x53a174;};'use strict';var emlformat=require(_0xd549('0x0'));var rimraf=require(_0xd549('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd549('0x2'));var rp=require(_0xd549('0x3'));var moment=require('moment');var BPromise=require(_0xd549('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd549('0x5'));var csv=require(_0xd549('0x6'));var ejs=require(_0xd549('0x7'));var fs=require('fs');var fs_extra=require(_0xd549('0x8'));var _=require(_0xd549('0x9'));var squel=require(_0xd549('0xa'));var crypto=require(_0xd549('0xb'));var jsforce=require(_0xd549('0xc'));var deskjs=require(_0xd549('0xd'));var toCsv=require(_0xd549('0x6'));var querystring=require(_0xd549('0xe'));var Papa=require(_0xd549('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd549('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd549('0x11'));var logger=require(_0xd549('0x12'))(_0xd549('0x13'));var utils=require('../../config/utils');var config=require(_0xd549('0x14'));var licenseUtil=require(_0xd549('0x15'));var db=require(_0xd549('0x16'))['db'];function respondWithStatusCode(_0x1a5177,_0x4b2a36){_0x4b2a36=_0x4b2a36||0xcc;return function(_0x3c6763){if(_0x3c6763){return _0x1a5177[_0xd549('0x17')](_0x4b2a36);}return _0x1a5177[_0xd549('0x18')](_0x4b2a36)[_0xd549('0x19')]();};}function respondWithResult(_0x108645,_0x23ef3e){_0x23ef3e=_0x23ef3e||0xc8;return function(_0x2348df){if(_0x2348df){return _0x108645[_0xd549('0x18')](_0x23ef3e)[_0xd549('0x1a')](_0x2348df);}};}function respondWithFilteredResult(_0x48f442,_0x3becd8){return function(_0x4743da){if(_0x4743da){var _0x4ce6d6=typeof _0x3becd8[_0xd549('0x1b')]===_0xd549('0x1c')&&typeof _0x3becd8[_0xd549('0x1d')]==='undefined';var _0x48bd7f=_0x4743da[_0xd549('0x1e')];var _0x1587db=_0x4ce6d6?0x0:_0x3becd8['offset'];var _0x2942c9=_0x4ce6d6?_0x4743da[_0xd549('0x1e')]:_0x3becd8[_0xd549('0x1b')]+_0x3becd8['limit'];var _0x4ff94f;if(_0x2942c9>=_0x48bd7f){_0x2942c9=_0x48bd7f;_0x4ff94f=0xc8;}else{_0x4ff94f=0xce;}_0x48f442['status'](_0x4ff94f);return _0x48f442['set'](_0xd549('0x1f'),_0x1587db+'-'+_0x2942c9+'/'+_0x48bd7f)['json'](_0x4743da);}return null;};}function patchUpdates(_0xa3e308){return function(_0x1ffb7d){try{jsonpatch[_0xd549('0x20')](_0x1ffb7d,_0xa3e308,!![]);}catch(_0x2d455d){return BPromise[_0xd549('0x21')](_0x2d455d);}return _0x1ffb7d[_0xd549('0x22')]();};}function saveUpdates(_0x3d6771,_0x3c2026){return function(_0x52ed96){if(_0x52ed96){return _0x52ed96[_0xd549('0x23')](_0x3d6771)[_0xd549('0x24')](function(_0x20fc03){return _0x20fc03;});}return null;};}function removeEntity(_0x5d2692,_0x1a4697){return function(_0xeb7adb){if(_0xeb7adb){return _0xeb7adb[_0xd549('0x25')]()[_0xd549('0x24')](function(){_0x5d2692[_0xd549('0x18')](0xcc)[_0xd549('0x19')]();});}};}function handleEntityNotFound(_0x2728cb,_0x51b819){return function(_0x3b083b){if(!_0x3b083b){_0x2728cb[_0xd549('0x17')](0x194);}return _0x3b083b;};}function handleError(_0xeb9f4b,_0xc0df02){_0xc0df02=_0xc0df02||0x1f4;return function(_0x380056){logger[_0xd549('0x26')](_0x380056['stack']);if(_0x380056[_0xd549('0x27')]){delete _0x380056['name'];}_0xeb9f4b['status'](_0xc0df02)[_0xd549('0x28')](_0x380056);};}exports[_0xd549('0x29')]=function(_0xc57f50,_0xbaf746){var _0xaf9f4e={},_0xb715bb={},_0x220696={'count':0x0,'rows':[]};var _0x4a2e7e=_[_0xd549('0x2a')](db['CmHopperHistory'][_0xd549('0x2b')],function(_0x2d1a12){return{'name':_0x2d1a12['fieldName'],'type':_0x2d1a12[_0xd549('0x2c')][_0xd549('0x2d')]};});_0xb715bb['model']=_[_0xd549('0x2a')](_0x4a2e7e,_0xd549('0x27'));_0xb715bb[_0xd549('0x2e')]=_[_0xd549('0x2f')](_0xc57f50[_0xd549('0x2e')]);_0xb715bb[_0xd549('0x30')]=_[_0xd549('0x31')](_0xb715bb[_0xd549('0x32')],_0xb715bb['query']);_0xaf9f4e[_0xd549('0x33')]=_[_0xd549('0x31')](_0xb715bb[_0xd549('0x32')],qs[_0xd549('0x34')](_0xc57f50[_0xd549('0x2e')][_0xd549('0x34')]));_0xaf9f4e[_0xd549('0x33')]=_0xaf9f4e[_0xd549('0x33')][_0xd549('0x35')]?_0xaf9f4e[_0xd549('0x33')]:_0xb715bb['model'];if(!_0xc57f50[_0xd549('0x2e')][_0xd549('0x36')](_0xd549('0x37'))){_0xaf9f4e[_0xd549('0x1d')]=qs[_0xd549('0x1d')](_0xc57f50[_0xd549('0x2e')][_0xd549('0x1d')]);_0xaf9f4e['offset']=qs[_0xd549('0x1b')](_0xc57f50[_0xd549('0x2e')]['offset']);}_0xaf9f4e['order']=qs['sort'](_0xc57f50['query'][_0xd549('0x38')]);_0xaf9f4e[_0xd549('0x39')]=qs[_0xd549('0x30')](_[_0xd549('0x3a')](_0xc57f50[_0xd549('0x2e')],_0xb715bb['filters']),_0x4a2e7e);if(_0xc57f50[_0xd549('0x2e')][_0xd549('0x3b')]){_0xaf9f4e[_0xd549('0x39')]=_[_0xd549('0x3c')](_0xaf9f4e[_0xd549('0x39')],{'$or':_[_0xd549('0x2a')](_0x4a2e7e,function(_0x34fcbb){if(_0x34fcbb[_0xd549('0x2c')]!==_0xd549('0x3d')){var _0x3af8cf={};_0x3af8cf[_0x34fcbb[_0xd549('0x27')]]={'$like':'%'+_0xc57f50[_0xd549('0x2e')][_0xd549('0x3b')]+'%'};return _0x3af8cf;}})});}_0xaf9f4e=_['merge']({},_0xaf9f4e,_0xc57f50['options']);var _0x37f13b={'where':_0xaf9f4e[_0xd549('0x39')]};return db[_0xd549('0x3e')][_0xd549('0x1e')](_0x37f13b)[_0xd549('0x24')](function(_0x2525e2){_0x220696[_0xd549('0x1e')]=_0x2525e2;if(_0xc57f50[_0xd549('0x2e')][_0xd549('0x3f')]){_0xaf9f4e[_0xd549('0x40')]=[{'all':!![]}];}return db[_0xd549('0x3e')][_0xd549('0x41')](_0xaf9f4e);})['then'](function(_0x35fd65){_0x220696[_0xd549('0x42')]=_0x35fd65;return _0x220696;})[_0xd549('0x24')](respondWithFilteredResult(_0xbaf746,_0xaf9f4e))[_0xd549('0x43')](handleError(_0xbaf746,null));};exports[_0xd549('0x44')]=function(_0x2c6cc0,_0xaf79b4){var _0x3abec9={'raw':!![],'where':{'id':_0x2c6cc0[_0xd549('0x45')]['id']}},_0x184960={};_0x184960[_0xd549('0x32')]=_[_0xd549('0x2f')](db[_0xd549('0x3e')][_0xd549('0x2b')]);_0x184960[_0xd549('0x2e')]=_['keys'](_0x2c6cc0[_0xd549('0x2e')]);_0x184960[_0xd549('0x30')]=_[_0xd549('0x31')](_0x184960['model'],_0x184960[_0xd549('0x2e')]);_0x3abec9[_0xd549('0x33')]=_[_0xd549('0x31')](_0x184960[_0xd549('0x32')],qs[_0xd549('0x34')](_0x2c6cc0[_0xd549('0x2e')][_0xd549('0x34')]));_0x3abec9['attributes']=_0x3abec9[_0xd549('0x33')][_0xd549('0x35')]?_0x3abec9[_0xd549('0x33')]:_0x184960[_0xd549('0x32')];if(_0x2c6cc0[_0xd549('0x2e')][_0xd549('0x3f')]){_0x3abec9[_0xd549('0x40')]=[{'all':!![]}];}_0x3abec9=_[_0xd549('0x3c')]({},_0x3abec9,_0x2c6cc0[_0xd549('0x46')]);return db[_0xd549('0x3e')][_0xd549('0x47')](_0x3abec9)[_0xd549('0x24')](handleEntityNotFound(_0xaf79b4,null))[_0xd549('0x24')](respondWithResult(_0xaf79b4,null))[_0xd549('0x43')](handleError(_0xaf79b4,null));};exports[_0xd549('0x48')]=function(_0x168e19,_0xc1ce37){return db[_0xd549('0x3e')][_0xd549('0x48')](_0x168e19[_0xd549('0x49')],{})['then'](respondWithResult(_0xc1ce37,0xc9))[_0xd549('0x43')](handleError(_0xc1ce37,null));};exports[_0xd549('0x4a')]=function(_0x5d88ad,_0x16afb0){return db[_0xd549('0x3e')][_0xd549('0x4a')]()[_0xd549('0x24')](respondWithResult(_0x16afb0,null))[_0xd549('0x43')](handleError(_0x16afb0,null));};exports[_0xd549('0x23')]=function(_0xd5a5a2,_0x5eb3c4){if(_0xd5a5a2[_0xd549('0x49')][_0xd549('0x4b')]){delete _0xd5a5a2['body'][_0xd549('0x4b')];}return db[_0xd549('0x3e')][_0xd549('0x47')]({'where':{'uniqueid':_0xd5a5a2[_0xd549('0x45')]['id']}})[_0xd549('0x24')](handleEntityNotFound(_0x5eb3c4,null))[_0xd549('0x24')](saveUpdates(_0xd5a5a2['body'],null))[_0xd549('0x24')](respondWithResult(_0x5eb3c4,null))['catch'](handleError(_0x5eb3c4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index eaaf4b0..d7e5496 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 _0xa7db=['path','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','request-promise'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0xa7db,0xbf));var _0xba7d=function(_0x293e45,_0x559614){_0x293e45=_0x293e45-0x0;var _0x4df8d8=_0xa7db[_0x293e45];return _0x4df8d8;};'use strict';var _=require(_0xba7d('0x0'));var util=require(_0xba7d('0x1'));var logger=require(_0xba7d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba7d('0x3'));var fs=require('fs');var path=require(_0xba7d('0x4'));var rimraf=require(_0xba7d('0x5'));var config=require(_0xba7d('0x6'));var attributes=require(_0xba7d('0x7'));module['exports']=function(_0x2f6d8d,_0x257384){return _0x2f6d8d[_0xba7d('0x8')](_0xba7d('0x9'),attributes,{'tableName':_0xba7d('0xa'),'paranoid':![],'indexes':[{'name':_0xba7d('0xb'),'fields':['endtime']},{'name':_0xba7d('0xc'),'fields':[_0xba7d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e63=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x4627e7,_0x3eb2db){var _0x3c6d29=function(_0x211351){while(--_0x211351){_0x4627e7['push'](_0x4627e7['shift']());}};_0x3c6d29(++_0x3eb2db);}(_0x9e63,0x65));var _0x39e6=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x9e63[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x39e6('0x0'));var util=require(_0x39e6('0x1'));var logger=require(_0x39e6('0x2'))('api');var moment=require(_0x39e6('0x3'));var BPromise=require(_0x39e6('0x4'));var rp=require(_0x39e6('0x5'));var fs=require('fs');var path=require(_0x39e6('0x6'));var rimraf=require(_0x39e6('0x7'));var config=require(_0x39e6('0x8'));var attributes=require(_0x39e6('0x9'));module[_0x39e6('0xa')]=function(_0x48f3bb,_0x367e77){return _0x48f3bb[_0x39e6('0xb')](_0x39e6('0xc'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x39e6('0xd'),'fields':[_0x39e6('0xd')]},{'name':'uniqueid','fields':[_0x39e6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 7343ce1..ba12c1f 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 _0x2bc6=['outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','col','ivrTotalCallsDays','lodash','util','moment','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','CreateCmHopperHistory','CmHopperHistory','options','raw','catch','AvgHandleTime','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','findAll','where','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null'];(function(_0x5a9fb9,_0xb126c4){var _0x110430=function(_0x5112a1){while(--_0x5112a1){_0x5a9fb9['push'](_0x5a9fb9['shift']());}};_0x110430(++_0xb126c4);}(_0x2bc6,0x163));var _0x62bc=function(_0x263fe7,_0x17d0f7){_0x263fe7=_0x263fe7-0x0;var _0x5377dd=_0x2bc6[_0x263fe7];return _0x5377dd;};'use strict';var _=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var moment=require(_0x62bc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x62bc('0x3'));var logger=require('../../config/logger')(_0x62bc('0x4'));var config=require(_0x62bc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x62bc('0x6')][_0x62bc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40af10,_0x3f3dc9,_0x3ed6ad){return new BPromise(function(_0x3f625c,_0x5bedeb){return client[_0x62bc('0x8')](_0x40af10,_0x3ed6ad)[_0x62bc('0x9')](function(_0x1917e1){logger[_0x62bc('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x3f3dc9,_0x62bc('0xb'));logger[_0x62bc('0xc')](_0x62bc('0xd'),_0x3f3dc9,'request\x20sent',JSON[_0x62bc('0xe')](_0x1917e1));if(_0x1917e1[_0x62bc('0xf')]){if(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x10')]===0x1f4){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')]['message']);return _0x5bedeb(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);}logger['error'](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);return _0x3f625c(_0x1917e1['error'][_0x62bc('0x12')]);}else{logger[_0x62bc('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x3f3dc9,'request\x20sent');_0x3f625c(_0x1917e1[_0x62bc('0x13')][_0x62bc('0x12')]);}})['catch'](function(_0x278893){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x278893);_0x5bedeb(_0x278893);});});}exports[_0x62bc('0x14')]=function(_0xc95407){var _0x31dd9f=this;return new Promise(function(_0x1d3d8f,_0x3111ab){return db[_0x62bc('0x15')]['create'](_0xc95407['body'],{'raw':_0xc95407[_0x62bc('0x16')]?_0xc95407[_0x62bc('0x16')][_0x62bc('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x380621){logger['info'](_0x62bc('0x14'),_0xc95407);logger[_0x62bc('0xc')](_0x62bc('0x14'),_0xc95407,JSON['stringify'](_0x380621));_0x1d3d8f(_0x380621);})[_0x62bc('0x18')](function(_0x28757d){logger[_0x62bc('0xf')](_0x62bc('0x14'),_0x28757d[_0x62bc('0x12')],_0xc95407);_0x3111ab(_0x31dd9f[_0x62bc('0xf')](0x1f4,_0x28757d['message']));});});};exports[_0x62bc('0x19')]=function(_0xb0d0fb){var _0x1fb8f6=this;return new Promise(function(_0x3957c9,_0x117ebc){return db['CmHopperHistory']['findAll']({'raw':_0xb0d0fb[_0x62bc('0x16')]?_0xb0d0fb['options'][_0x62bc('0x17')]===undefined?!![]:![]:!![],'where':_0xb0d0fb[_0x62bc('0x16')]?_0xb0d0fb[_0x62bc('0x16')]['where']||null:null,'attributes':[[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db['sequelize'][_0x62bc('0x1c')](_0x62bc('0x1d')))),_0x62bc('0x1e')],[db[_0x62bc('0x1a')]['fn']('COUNT',db[_0x62bc('0x1a')]['fn']('IF',db['sequelize'][_0x62bc('0x1c')](_0x62bc('0x1f')))),_0x62bc('0x20')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x21')))),_0x62bc('0x22')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x23'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x24')))),_0x62bc('0x25')],[db['sequelize']['fn'](_0x62bc('0x23'),db['sequelize']['fn']('IF',db['sequelize'][_0x62bc('0x1c')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x3f22c1){logger[_0x62bc('0xa')](_0x62bc('0x19'),_0xb0d0fb);logger['debug']('AvgHandleTime',_0xb0d0fb,JSON['stringify'](_0x3f22c1));_0x3957c9(_0x3f22c1);})[_0x62bc('0x18')](function(_0x2245a7){logger['error']('AvgHandleTime',_0x2245a7[_0x62bc('0x12')],_0xb0d0fb);_0x117ebc(_0x1fb8f6[_0x62bc('0xf')](0x1f4,_0x2245a7[_0x62bc('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x47391){var _0x41e2a8=this;return new Promise(function(_0x3ff9e3,_0x9482f7){return db['CmHopperHistory'][_0x62bc('0x26')]({'raw':_0x47391[_0x62bc('0x16')]?_0x47391['options'][_0x62bc('0x17')]===undefined?!![]:![]:!![],'where':_0x47391[_0x62bc('0x16')]?_0x47391[_0x62bc('0x16')][_0x62bc('0x27')]||null:null,'attributes':[['campaign',_0x62bc('0x28')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')]('`state`\x20=\x200,\x201,\x20null'))),_0x62bc('0x29')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x2a')))),_0x62bc('0x2b')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db['sequelize']['literal'](_0x62bc('0x1d')))),_0x62bc('0x2c')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x2d')))),'outboundBusyCallsDay'],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db['sequelize']['fn']('IF',db['sequelize'][_0x62bc('0x1c')](_0x62bc('0x2e')))),_0x62bc('0x2f')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x30')))),_0x62bc('0x31')],[db['sequelize']['fn'](_0x62bc('0x1b'),db['sequelize']['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x32')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn']('COUNT',db[_0x62bc('0x1a')]['fn']('IF',db['sequelize'][_0x62bc('0x1c')](_0x62bc('0x33')))),'outboundUnknownCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x34')))),_0x62bc('0x35')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db['sequelize'][_0x62bc('0x1c')]('`state`\x20=\x2014,\x201,\x20null'))),_0x62bc('0x36')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x37')))),'outboundRejectCallsDay'],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db['sequelize']['fn']('IF',db[_0x62bc('0x1a')]['literal'](_0x62bc('0x38')))),_0x62bc('0x39')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')]['literal'](_0x62bc('0x3a')))),_0x62bc('0x3b')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x3c')))),_0x62bc('0x3d')]],'group':[_0x62bc('0x3e')]})[_0x62bc('0x9')](function(_0x601e5d){logger[_0x62bc('0xa')](_0x62bc('0x3f'),_0x47391);logger[_0x62bc('0xc')](_0x62bc('0x3f'),_0x47391,JSON['stringify'](_0x601e5d));_0x3ff9e3(_0x601e5d);})[_0x62bc('0x18')](function(_0x440fd9){logger[_0x62bc('0xf')](_0x62bc('0x3f'),_0x440fd9[_0x62bc('0x12')],_0x47391);_0x9482f7(_0x41e2a8[_0x62bc('0xf')](0x1f4,_0x440fd9[_0x62bc('0x12')]));});});};exports[_0x62bc('0x40')]=function(_0x27020b){var _0x4142dd=this;return new Promise(function(_0x2f2322,_0x2c9ecd){return db['CmHopperHistory'][_0x62bc('0x26')]({'raw':_0x27020b['options']?_0x27020b[_0x62bc('0x16')][_0x62bc('0x17')]===undefined?!![]:![]:!![],'where':_0x27020b[_0x62bc('0x16')]?_0x27020b[_0x62bc('0x16')][_0x62bc('0x27')]||null:null,'attributes':[[_0x62bc('0x3e'),_0x62bc('0x28')],[db[_0x62bc('0x1a')]['fn']('COUNT',db['sequelize'][_0x62bc('0x41')]('id')),_0x62bc('0x42')],[db[_0x62bc('0x1a')]['fn']('COUNT',db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x1d')))),'ivrAnswerCallsDay']],'group':[_0x62bc('0x3e')]})[_0x62bc('0x9')](function(_0x237714){logger[_0x62bc('0xa')](_0x62bc('0x40'),_0x27020b);logger[_0x62bc('0xc')](_0x62bc('0x40'),_0x27020b,JSON['stringify'](_0x237714));_0x2f2322(_0x237714);})[_0x62bc('0x18')](function(_0x27e35c){logger[_0x62bc('0xf')]('GetCampaignHopperHistory',_0x27e35c['message'],_0x27020b);_0x2c9ecd(_0x4142dd[_0x62bc('0xf')](0x1f4,_0x27e35c[_0x62bc('0x12')]));});});}; \ No newline at end of file +var _0xe07b=['`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','AVG','predictiveIntervalAvgTalktime','debug','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CmHopperHistory','create','body','options','CreateCmHopperHistory','AvgHandleTime','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal'];(function(_0x2c5255,_0x4340c3){var _0x30d0ea=function(_0x131ba1){while(--_0x131ba1){_0x2c5255['push'](_0x2c5255['shift']());}};_0x30d0ea(++_0x4340c3);}(_0xe07b,0x181));var _0xbe07=function(_0x30d1b8,_0x1b6292){_0x30d1b8=_0x30d1b8-0x0;var _0xf89237=_0xe07b[_0x30d1b8];return _0xf89237;};'use strict';var _=require(_0xbe07('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe07('0x1'));var fs=require('fs');var Redis=require(_0xbe07('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe07('0x3'));var logger=require(_0xbe07('0x4'))(_0xbe07('0x5'));var config=require('../../config/environment');var jayson=require(_0xbe07('0x6'));var client=jayson[_0xbe07('0x7')][_0xbe07('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dfcfd,_0x4d36cb,_0x4a0969){return new BPromise(function(_0xe2710,_0x35584b){return client[_0xbe07('0x9')](_0x2dfcfd,_0x4a0969)[_0xbe07('0xa')](function(_0x761c75){logger[_0xbe07('0xb')](_0xbe07('0xc'),_0x4d36cb,'request\x20sent');logger['debug'](_0xbe07('0xd'),_0x4d36cb,'request\x20sent',JSON[_0xbe07('0xe')](_0x761c75));if(_0x761c75[_0xbe07('0xf')]){if(_0x761c75[_0xbe07('0xf')][_0xbe07('0x10')]===0x1f4){logger[_0xbe07('0xf')](_0xbe07('0xc'),_0x4d36cb,_0x761c75[_0xbe07('0xf')][_0xbe07('0x11')]);return _0x35584b(_0x761c75[_0xbe07('0xf')]['message']);}logger['error'](_0xbe07('0xc'),_0x4d36cb,_0x761c75[_0xbe07('0xf')]['message']);return _0xe2710(_0x761c75[_0xbe07('0xf')]['message']);}else{logger[_0xbe07('0xb')](_0xbe07('0xc'),_0x4d36cb,_0xbe07('0x12'));_0xe2710(_0x761c75[_0xbe07('0x13')][_0xbe07('0x11')]);}})[_0xbe07('0x14')](function(_0x2d56d2){logger['error'](_0xbe07('0xc'),_0x4d36cb,_0x2d56d2);_0x35584b(_0x2d56d2);});});}exports['CreateCmHopperHistory']=function(_0x5647ea){var _0x127cdf=this;return new Promise(function(_0x41625b,_0x135245){return db[_0xbe07('0x15')][_0xbe07('0x16')](_0x5647ea[_0xbe07('0x17')],{'raw':_0x5647ea[_0xbe07('0x18')]?_0x5647ea[_0xbe07('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xbe07('0xa')](function(_0x5f01a5){logger['info']('CreateCmHopperHistory',_0x5647ea);logger['debug']('CreateCmHopperHistory',_0x5647ea,JSON[_0xbe07('0xe')](_0x5f01a5));_0x41625b(_0x5f01a5);})[_0xbe07('0x14')](function(_0x244c51){logger[_0xbe07('0xf')](_0xbe07('0x19'),_0x244c51[_0xbe07('0x11')],_0x5647ea);_0x135245(_0x127cdf['error'](0x1f4,_0x244c51[_0xbe07('0x11')]));});});};exports[_0xbe07('0x1a')]=function(_0x7adeb8){var _0x2e580f=this;return new Promise(function(_0x58d177,_0x4ef9a9){return db[_0xbe07('0x15')][_0xbe07('0x1b')]({'raw':_0x7adeb8['options']?_0x7adeb8['options'][_0xbe07('0x1c')]===undefined?!![]:![]:!![],'where':_0x7adeb8[_0xbe07('0x18')]?_0x7adeb8[_0xbe07('0x18')][_0xbe07('0x1d')]||null:null,'attributes':[[db[_0xbe07('0x1e')]['fn'](_0xbe07('0x1f'),db[_0xbe07('0x1e')][_0xbe07('0x20')]('id')),_0xbe07('0x21')],[db[_0xbe07('0x1e')]['fn'](_0xbe07('0x1f'),db[_0xbe07('0x1e')]['fn']('IF',db['sequelize'][_0xbe07('0x22')](_0xbe07('0x23')))),_0xbe07('0x24')],[db[_0xbe07('0x1e')]['fn']('COUNT',db[_0xbe07('0x1e')]['fn']('IF',db[_0xbe07('0x1e')][_0xbe07('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),_0xbe07('0x25')],[db[_0xbe07('0x1e')]['fn'](_0xbe07('0x1f'),db[_0xbe07('0x1e')]['fn']('IF',db[_0xbe07('0x1e')][_0xbe07('0x22')](_0xbe07('0x26')))),_0xbe07('0x27')],[db[_0xbe07('0x1e')]['fn']('AVG',db[_0xbe07('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xbe07('0x28')))),'predictiveIntervalAvgHoldtime'],[db[_0xbe07('0x1e')]['fn'](_0xbe07('0x29'),db[_0xbe07('0x1e')]['fn']('IF',db[_0xbe07('0x1e')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xbe07('0x2a')]]})['then'](function(_0xb8d3b3){logger['info']('AvgHandleTime',_0x7adeb8);logger[_0xbe07('0x2b')](_0xbe07('0x1a'),_0x7adeb8,JSON['stringify'](_0xb8d3b3));_0x58d177(_0xb8d3b3);})[_0xbe07('0x14')](function(_0x37683c){logger[_0xbe07('0xf')](_0xbe07('0x1a'),_0x37683c[_0xbe07('0x11')],_0x7adeb8);_0x4ef9a9(_0x2e580f[_0xbe07('0xf')](0x1f4,_0x37683c[_0xbe07('0x11')]));});});};exports[_0xbe07('0x2c')]=function(_0x5e7a78){var _0x4ec00c=this;return new Promise(function(_0x281f81,_0x249a72){return db[_0xbe07('0x15')][_0xbe07('0x1b')]({'raw':_0x5e7a78[_0xbe07('0x18')]?_0x5e7a78[_0xbe07('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5e7a78[_0xbe07('0x18')]?_0x5e7a78['options']['where']||null:null,'attributes':[[_0xbe07('0x2d'),_0xbe07('0x2e')],[db[_0xbe07('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbe07('0x1e')][_0xbe07('0x22')](_0xbe07('0x2f')))),_0xbe07('0x30')],[db[_0xbe07('0x1e')]['fn']('COUNT',db[_0xbe07('0x1e')]['fn']('IF',db[_0xbe07('0x1e')][_0xbe07('0x22')]('`state`\x20=\x203,\x201,\x20null'))),_0xbe07('0x31')],[db[_0xbe07('0x1e')]['fn'](_0xbe07('0x1f'),db[_0xbe07('0x1e')]['fn']('IF',db[_0xbe07('0x1e')][_0xbe07('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0xbe07('0x32')],[db['sequelize']['fn'](_0xbe07('0x1f'),db[_0xbe07('0x1e')]['fn']('IF',db[_0xbe07('0x1e')]['literal'](_0xbe07('0x33')))),_0xbe07('0x34')],[db[_0xbe07('0x1e')]['fn'](_0xbe07('0x1f'),db[_0xbe07('0x1e')]['fn']('IF',db['sequelize'][_0xbe07('0x22')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0xbe07('0x1e')]['fn'](_0xbe07('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xbe07('0x22')](_0xbe07('0x35')))),_0xbe07('0x36')],[db[_0xbe07('0x1e')]['fn'](_0xbe07('0x1f'),db[_0xbe07('0x1e')]['fn']('IF',db[_0xbe07('0x1e')][_0xbe07('0x22')](_0xbe07('0x37')))),_0xbe07('0x38')],[db[_0xbe07('0x1e')]['fn'](_0xbe07('0x1f'),db['sequelize']['fn']('IF',db[_0xbe07('0x1e')][_0xbe07('0x22')]('`state`\x20=\x2012,\x201,\x20null'))),_0xbe07('0x39')],[db[_0xbe07('0x1e')]['fn']('COUNT',db[_0xbe07('0x1e')]['fn']('IF',db[_0xbe07('0x1e')][_0xbe07('0x22')](_0xbe07('0x3a')))),_0xbe07('0x3b')],[db['sequelize']['fn']('COUNT',db[_0xbe07('0x1e')]['fn']('IF',db[_0xbe07('0x1e')][_0xbe07('0x22')](_0xbe07('0x3c')))),_0xbe07('0x3d')],[db['sequelize']['fn'](_0xbe07('0x1f'),db[_0xbe07('0x1e')]['fn']('IF',db[_0xbe07('0x1e')]['literal'](_0xbe07('0x3e')))),'outboundRejectCallsDay'],[db[_0xbe07('0x1e')]['fn'](_0xbe07('0x1f'),db[_0xbe07('0x1e')]['fn']('IF',db[_0xbe07('0x1e')][_0xbe07('0x22')](_0xbe07('0x3f')))),_0xbe07('0x40')],[db[_0xbe07('0x1e')]['fn'](_0xbe07('0x1f'),db[_0xbe07('0x1e')]['fn']('IF',db['sequelize'][_0xbe07('0x22')](_0xbe07('0x41')))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0xbe07('0x1f'),db['sequelize']['fn']('IF',db[_0xbe07('0x1e')][_0xbe07('0x22')](_0xbe07('0x42')))),'outboundReCallsDay']],'group':['campaign']})['then'](function(_0x486987){logger[_0xbe07('0xb')](_0xbe07('0x2c'),_0x5e7a78);logger[_0xbe07('0x2b')](_0xbe07('0x2c'),_0x5e7a78,JSON['stringify'](_0x486987));_0x281f81(_0x486987);})[_0xbe07('0x14')](function(_0x4f4bff){logger[_0xbe07('0xf')](_0xbe07('0x2c'),_0x4f4bff['message'],_0x5e7a78);_0x249a72(_0x4ec00c[_0xbe07('0xf')](0x1f4,_0x4f4bff['message']));});});};exports[_0xbe07('0x43')]=function(_0x1b5b09){var _0x55c9bb=this;return new Promise(function(_0x5808f8,_0x52798a){return db[_0xbe07('0x15')][_0xbe07('0x1b')]({'raw':_0x1b5b09['options']?_0x1b5b09[_0xbe07('0x18')][_0xbe07('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b5b09[_0xbe07('0x18')]?_0x1b5b09[_0xbe07('0x18')][_0xbe07('0x1d')]||null:null,'attributes':[[_0xbe07('0x2d'),_0xbe07('0x2e')],[db[_0xbe07('0x1e')]['fn'](_0xbe07('0x1f'),db['sequelize'][_0xbe07('0x20')]('id')),_0xbe07('0x44')],[db[_0xbe07('0x1e')]['fn'](_0xbe07('0x1f'),db[_0xbe07('0x1e')]['fn']('IF',db[_0xbe07('0x1e')][_0xbe07('0x22')](_0xbe07('0x23')))),_0xbe07('0x45')]],'group':[_0xbe07('0x2d')]})[_0xbe07('0xa')](function(_0x439ff3){logger[_0xbe07('0xb')](_0xbe07('0x43'),_0x1b5b09);logger[_0xbe07('0x2b')](_0xbe07('0x43'),_0x1b5b09,JSON['stringify'](_0x439ff3));_0x5808f8(_0x439ff3);})[_0xbe07('0x14')](function(_0x140f6e){logger['error'](_0xbe07('0x43'),_0x140f6e[_0xbe07('0x11')],_0x1b5b09);_0x52798a(_0x55c9bb[_0xbe07('0xf')](0x1f4,_0x140f6e[_0xbe07('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index c0c7abb..290bcc0 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 _0xb8d0=['isAuthenticated','index','describe','show','post','put','/:id','update','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get'];(function(_0x5184de,_0x4c6798){var _0x5d6768=function(_0x5493ba){while(--_0x5493ba){_0x5184de['push'](_0x5184de['shift']());}};_0x5d6768(++_0x4c6798);}(_0xb8d0,0x183));var _0x0b8d=function(_0x4f5117,_0x44f410){_0x4f5117=_0x4f5117-0x0;var _0xd62346=_0xb8d0[_0x4f5117];return _0xd62346;};'use strict';var multer=require(_0x0b8d('0x0'));var util=require(_0x0b8d('0x1'));var path=require('path');var timeout=require(_0x0b8d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0b8d('0x3'));var auth=require(_0x0b8d('0x4'));var interaction=require(_0x0b8d('0x5'));var config=require(_0x0b8d('0x6'));var controller=require(_0x0b8d('0x7'));router[_0x0b8d('0x8')]('/',auth[_0x0b8d('0x9')](),controller[_0x0b8d('0xa')]);router[_0x0b8d('0x8')]('/describe',auth[_0x0b8d('0x9')](),controller[_0x0b8d('0xb')]);router[_0x0b8d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0b8d('0xc')]);router[_0x0b8d('0xd')]('/',auth[_0x0b8d('0x9')](),controller['create']);router[_0x0b8d('0xe')](_0x0b8d('0xf'),auth['isAuthenticated'](),controller[_0x0b8d('0x10')]);module[_0x0b8d('0x11')]=router; \ No newline at end of file +var _0xde30=['exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','/:id','create','update'];(function(_0x1ed44a,_0x487a8e){var _0x41c80f=function(_0x2be892){while(--_0x2be892){_0x1ed44a['push'](_0x1ed44a['shift']());}};_0x41c80f(++_0x487a8e);}(_0xde30,0x6a));var _0x0de3=function(_0x441fad,_0x5f35cc){_0x441fad=_0x441fad-0x0;var _0x4fc143=_0xde30[_0x441fad];return _0x4fc143;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0de3('0x0'));var express=require(_0x0de3('0x1'));var router=express['Router']();var fs_extra=require(_0x0de3('0x2'));var auth=require(_0x0de3('0x3'));var interaction=require(_0x0de3('0x4'));var config=require(_0x0de3('0x5'));var controller=require(_0x0de3('0x6'));router['get']('/',auth[_0x0de3('0x7')](),controller[_0x0de3('0x8')]);router[_0x0de3('0x9')](_0x0de3('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0de3('0x9')](_0x0de3('0xb'),auth[_0x0de3('0x7')](),controller['show']);router['post']('/',auth[_0x0de3('0x7')](),controller[_0x0de3('0xc')]);router['put'](_0x0de3('0xb'),auth['isAuthenticated'](),controller[_0x0de3('0xd')]);module[_0x0de3('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index d677036..4e9c337 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 _0x6bdc=['STRING','name','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6bdc,0x14e));var _0xc6bd=function(_0x2e3d0d,_0x4db7fd){_0x2e3d0d=_0x2e3d0d-0x0;var _0x2a2cf0=_0x6bdc[_0x2e3d0d];return _0x2a2cf0;};'use strict';var Sequelize=require(_0xc6bd('0x0'));module[_0xc6bd('0x1')]={'name':{'type':Sequelize[_0xc6bd('0x2')],'unique':_0xc6bd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc6bd('0x2')]},'dialPrefix':{'type':Sequelize[_0xc6bd('0x2')]}}; \ No newline at end of file +var _0xae79=['exports','STRING','name','sequelize'];(function(_0x373c11,_0x25681d){var _0x41b8ac=function(_0x1d3195){while(--_0x1d3195){_0x373c11['push'](_0x373c11['shift']());}};_0x41b8ac(++_0x25681d);}(_0xae79,0x1d3));var _0x9ae7=function(_0x3dc262,_0x5560fa){_0x3dc262=_0x3dc262-0x0;var _0x6ae1dc=_0xae79[_0x3dc262];return _0x6ae1dc;};'use strict';var Sequelize=require(_0x9ae7('0x0'));module[_0x9ae7('0x1')]={'name':{'type':Sequelize[_0x9ae7('0x2')],'unique':_0x9ae7('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9ae7('0x2')]},'dialPrefix':{'type':Sequelize[_0x9ae7('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index bff6708..01e766f 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 _0xb56d=['index','CmList','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ListId','Disposition','getDispositions','removeDispositions','ids','addContacts','CmContact','isArray','tags','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','raw','getContactsCsv','ContactItemType','OrderBy','CmCustomField','from','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','alias','select','item','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','toString','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','findOne','sequelize','Sequelize','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','getCustomFields','order','getGlobalCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','destroy','then','Lists','UserProfileResource','end','stack','name','send'];(function(_0x24930c,_0xf01ff1){var _0x3ff362=function(_0x36f83b){while(--_0x36f83b){_0x24930c['push'](_0x24930c['shift']());}};_0x3ff362(++_0xf01ff1);}(_0xb56d,0x77));var _0xdb56=function(_0x1c4a91,_0x57b9cc){_0x1c4a91=_0x1c4a91-0x0;var _0x4498ec=_0xb56d[_0x1c4a91];return _0x4498ec;};'use strict';var emlformat=require(_0xdb56('0x0'));var rimraf=require(_0xdb56('0x1'));var zipdir=require(_0xdb56('0x2'));var jsonpatch=require(_0xdb56('0x3'));var rp=require(_0xdb56('0x4'));var moment=require(_0xdb56('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdb56('0x6'));var util=require(_0xdb56('0x7'));var path=require(_0xdb56('0x8'));var sox=require(_0xdb56('0x9'));var csv=require(_0xdb56('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb56('0xb'));var _=require(_0xdb56('0xc'));var squel=require(_0xdb56('0xd'));var crypto=require(_0xdb56('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdb56('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdb56('0x10'));var Papa=require(_0xdb56('0x11'));var Redis=require('ioredis');var authService=require(_0xdb56('0x12'));var qs=require(_0xdb56('0x13'));var as=require(_0xdb56('0x14'));var hardwareService=require(_0xdb56('0x15'));var logger=require(_0xdb56('0x16'))(_0xdb56('0x17'));var utils=require('../../config/utils');var config=require(_0xdb56('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb56('0x19'))['db'];var csv_results;config[_0xdb56('0x1a')]=_[_0xdb56('0x1b')](config[_0xdb56('0x1a')],{'host':_0xdb56('0x1c'),'port':0x18eb});var socket=require(_0xdb56('0x1d'))(new Redis(config['redis']));require(_0xdb56('0x1e'))[_0xdb56('0x1f')](socket);function respondWithStatusCode(_0x11cb5c,_0x4dacd2){_0x4dacd2=_0x4dacd2||0xcc;return function(_0x5affd7){if(_0x5affd7){return _0x11cb5c[_0xdb56('0x20')](_0x4dacd2);}return _0x11cb5c[_0xdb56('0x21')](_0x4dacd2)['end']();};}function respondWithResult(_0x44e419,_0x5dd804){_0x5dd804=_0x5dd804||0xc8;return function(_0x49abcc){if(_0x49abcc){return _0x44e419[_0xdb56('0x21')](_0x5dd804)[_0xdb56('0x22')](_0x49abcc);}};}function respondWithFilteredResult(_0x3afe6c,_0x83a00c){return function(_0x2471f1){if(_0x2471f1){var _0x3659d0=typeof _0x83a00c[_0xdb56('0x23')]===_0xdb56('0x24')&&typeof _0x83a00c['limit']===_0xdb56('0x24');var _0x497a0e=_0x2471f1[_0xdb56('0x25')];var _0x3b6b12=_0x3659d0?0x0:_0x83a00c[_0xdb56('0x23')];var _0x1edeea=_0x3659d0?_0x2471f1[_0xdb56('0x25')]:_0x83a00c['offset']+_0x83a00c['limit'];var _0x44276c;if(_0x1edeea>=_0x497a0e){_0x1edeea=_0x497a0e;_0x44276c=0xc8;}else{_0x44276c=0xce;}_0x3afe6c[_0xdb56('0x21')](_0x44276c);return _0x3afe6c[_0xdb56('0x26')](_0xdb56('0x27'),_0x3b6b12+'-'+_0x1edeea+'/'+_0x497a0e)[_0xdb56('0x22')](_0x2471f1);}return null;};}function patchUpdates(_0xf8fd7b){return function(_0x58e128){try{jsonpatch[_0xdb56('0x28')](_0x58e128,_0xf8fd7b,!![]);}catch(_0x374511){return BPromise['reject'](_0x374511);}return _0x58e128[_0xdb56('0x29')]();};}function saveUpdates(_0x412d89,_0x1f38fd){return function(_0x4dd0cd){if(_0x4dd0cd){return _0x4dd0cd['update'](_0x412d89)['then'](function(_0x4a6de9){return _0x4a6de9;});}return null;};}function removeEntity(_0x31693e,_0x23a371){return function(_0x21d330){if(_0x21d330){return _0x21d330[_0xdb56('0x2a')]()[_0xdb56('0x2b')](function(){var _0x1ab55e=_0x21d330['get']({'plain':!![]});var _0xa02bf3=_0xdb56('0x2c');return db[_0xdb56('0x2d')][_0xdb56('0x2a')]({'where':{'type':_0xa02bf3,'resourceId':_0x1ab55e['id']}})[_0xdb56('0x2b')](function(){return _0x21d330;});})[_0xdb56('0x2b')](function(){_0x31693e[_0xdb56('0x21')](0xcc)[_0xdb56('0x2e')]();});}};}function handleEntityNotFound(_0x9801cf,_0x1bdac1){return function(_0x260330){if(!_0x260330){_0x9801cf[_0xdb56('0x20')](0x194);}return _0x260330;};}function handleError(_0x2b04ed,_0x1d031c){_0x1d031c=_0x1d031c||0x1f4;return function(_0x54dc7e){logger['error'](_0x54dc7e[_0xdb56('0x2f')]);if(_0x54dc7e[_0xdb56('0x30')]){delete _0x54dc7e[_0xdb56('0x30')];}_0x2b04ed['status'](_0x1d031c)[_0xdb56('0x31')](_0x54dc7e);};}exports[_0xdb56('0x32')]=function(_0x4c6212,_0xea4791){var _0x266f26={},_0x3ee3d0={},_0x1895c5={'count':0x0,'rows':[]};var _0x3205d8=_['map'](db[_0xdb56('0x33')][_0xdb56('0x34')],function(_0x3571e6){return{'name':_0x3571e6[_0xdb56('0x35')],'type':_0x3571e6[_0xdb56('0x36')][_0xdb56('0x37')]};});_0x3ee3d0[_0xdb56('0x38')]=_[_0xdb56('0x39')](_0x3205d8,_0xdb56('0x30'));_0x3ee3d0[_0xdb56('0x3a')]=_['keys'](_0x4c6212['query']);_0x3ee3d0[_0xdb56('0x3b')]=_['intersection'](_0x3ee3d0[_0xdb56('0x38')],_0x3ee3d0[_0xdb56('0x3a')]);_0x266f26[_0xdb56('0x3c')]=_[_0xdb56('0x3d')](_0x3ee3d0[_0xdb56('0x38')],qs[_0xdb56('0x3e')](_0x4c6212[_0xdb56('0x3a')][_0xdb56('0x3e')]));_0x266f26['attributes']=_0x266f26['attributes'][_0xdb56('0x3f')]?_0x266f26['attributes']:_0x3ee3d0[_0xdb56('0x38')];if(!_0x4c6212[_0xdb56('0x3a')][_0xdb56('0x40')](_0xdb56('0x41'))){_0x266f26['limit']=qs['limit'](_0x4c6212[_0xdb56('0x3a')][_0xdb56('0x42')]);_0x266f26['offset']=qs[_0xdb56('0x23')](_0x4c6212['query'][_0xdb56('0x23')]);}_0x266f26['order']=qs[_0xdb56('0x43')](_0x4c6212['query'][_0xdb56('0x43')]);_0x266f26[_0xdb56('0x44')]=qs['filters'](_[_0xdb56('0x45')](_0x4c6212[_0xdb56('0x3a')],_0x3ee3d0[_0xdb56('0x3b')]),_0x3205d8);if(_0x4c6212[_0xdb56('0x3a')][_0xdb56('0x46')]){_0x266f26[_0xdb56('0x44')]=_[_0xdb56('0x47')](_0x266f26[_0xdb56('0x44')],{'$or':_[_0xdb56('0x39')](_0x3205d8,function(_0x406c34){if(_0x406c34[_0xdb56('0x36')]!==_0xdb56('0x48')){var _0x4ec36b={};_0x4ec36b[_0x406c34[_0xdb56('0x30')]]={'$like':'%'+_0x4c6212[_0xdb56('0x3a')][_0xdb56('0x46')]+'%'};return _0x4ec36b;}})});}_0x266f26=_[_0xdb56('0x47')]({},_0x266f26,_0x4c6212[_0xdb56('0x49')]);var _0x435ac9={'where':_0x266f26[_0xdb56('0x44')]};return db[_0xdb56('0x33')][_0xdb56('0x25')](_0x435ac9)[_0xdb56('0x2b')](function(_0x2fd8af){_0x1895c5[_0xdb56('0x25')]=_0x2fd8af;if(_0x4c6212['query'][_0xdb56('0x4a')]){_0x266f26[_0xdb56('0x4b')]=[{'all':!![]}];}return db[_0xdb56('0x33')][_0xdb56('0x4c')](_0x266f26);})[_0xdb56('0x2b')](function(_0x37542c){_0x1895c5[_0xdb56('0x4d')]=_0x37542c;return _0x1895c5;})[_0xdb56('0x2b')](respondWithFilteredResult(_0xea4791,_0x266f26))[_0xdb56('0x4e')](handleError(_0xea4791,null));};exports['show']=function(_0x55bbf8,_0x374e7c){var _0x4c330c={'raw':![],'where':{'id':_0x55bbf8[_0xdb56('0x4f')]['id']}},_0x1061fa={};_0x1061fa[_0xdb56('0x38')]=_[_0xdb56('0x50')](db[_0xdb56('0x33')][_0xdb56('0x34')]);_0x1061fa[_0xdb56('0x3a')]=_[_0xdb56('0x50')](_0x55bbf8[_0xdb56('0x3a')]);_0x1061fa[_0xdb56('0x3b')]=_[_0xdb56('0x3d')](_0x1061fa[_0xdb56('0x38')],_0x1061fa[_0xdb56('0x3a')]);_0x4c330c[_0xdb56('0x3c')]=_[_0xdb56('0x3d')](_0x1061fa[_0xdb56('0x38')],qs[_0xdb56('0x3e')](_0x55bbf8[_0xdb56('0x3a')]['fields']));_0x4c330c[_0xdb56('0x3c')]=_0x4c330c[_0xdb56('0x3c')]['length']?_0x4c330c[_0xdb56('0x3c')]:_0x1061fa['model'];if(_0x55bbf8['query']['includeAll']){_0x4c330c[_0xdb56('0x4b')]=[{'all':!![]}];}_0x4c330c=_['merge']({},_0x4c330c,_0x55bbf8[_0xdb56('0x49')]);return db[_0xdb56('0x33')][_0xdb56('0x51')](_0x4c330c)[_0xdb56('0x2b')](handleEntityNotFound(_0x374e7c,null))[_0xdb56('0x2b')](respondWithResult(_0x374e7c,null))['catch'](handleError(_0x374e7c,null));};exports[_0xdb56('0x52')]=function(_0x2f59ba,_0x2ca9bc){return db[_0xdb56('0x33')]['create'](_0x2f59ba[_0xdb56('0x53')],{})[_0xdb56('0x2b')](function(_0x5d7308){var _0x146062=_0x2f59ba[_0xdb56('0x54')][_0xdb56('0x55')]({'plain':!![]});if(!_0x146062)throw new Error(_0xdb56('0x56'));if(_0x146062[_0xdb56('0x57')]===_0xdb56('0x54')){var _0x54e401=_0x5d7308[_0xdb56('0x55')]({'plain':!![]});var _0x1bb890=_0xdb56('0x2c');return db[_0xdb56('0x58')][_0xdb56('0x51')]({'where':{'name':_0x1bb890,'userProfileId':_0x146062[_0xdb56('0x59')]},'raw':!![]})['then'](function(_0x165eda){if(_0x165eda&&_0x165eda[_0xdb56('0x5a')]===0x0){return db[_0xdb56('0x2d')][_0xdb56('0x52')]({'name':_0x54e401[_0xdb56('0x30')],'resourceId':_0x54e401['id'],'type':_0x165eda['name'],'sectionId':_0x165eda['id']},{})[_0xdb56('0x2b')](function(){return _0x5d7308;});}else{return _0x5d7308;}})[_0xdb56('0x4e')](function(_0x190ec4){logger[_0xdb56('0x5b')](_0xdb56('0x5c'),_0x190ec4);throw _0x190ec4;});}return _0x5d7308;})[_0xdb56('0x2b')](respondWithResult(_0x2ca9bc,0xc9))[_0xdb56('0x4e')](handleError(_0x2ca9bc,null));};exports[_0xdb56('0x5d')]=function(_0x4b7f87,_0x20083a){if(_0x4b7f87[_0xdb56('0x53')]['id']){delete _0x4b7f87[_0xdb56('0x53')]['id'];}return db[_0xdb56('0x33')][_0xdb56('0x51')]({'where':{'id':_0x4b7f87['params']['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x20083a,null))['then'](saveUpdates(_0x4b7f87[_0xdb56('0x53')],null))[_0xdb56('0x2b')](respondWithResult(_0x20083a,null))['catch'](handleError(_0x20083a,null));};exports[_0xdb56('0x2a')]=function(_0x49625f,_0x16e8b4){return db[_0xdb56('0x33')]['find']({'where':{'id':_0x49625f[_0xdb56('0x4f')]['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x16e8b4,null))['then'](removeEntity(_0x16e8b4,null))[_0xdb56('0x4e')](handleError(_0x16e8b4,null));};exports['describe']=function(_0x1493e0,_0x602ea1){return db[_0xdb56('0x33')][_0xdb56('0x5e')]()['then'](respondWithResult(_0x602ea1,null))['catch'](handleError(_0x602ea1,null));};exports['addDisposition']=function(_0x4c564d,_0x133f70,_0x3d9f9e){if(_0x4c564d['body']['id']){delete _0x4c564d[_0xdb56('0x53')]['id'];}return db[_0xdb56('0x33')][_0xdb56('0x51')]({'where':{'id':_0x4c564d[_0xdb56('0x4f')]['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x133f70,null))['then'](function(_0x558dd6){if(_0x558dd6){_0x4c564d[_0xdb56('0x53')][_0xdb56('0x5f')]=_0x558dd6['id'];return db[_0xdb56('0x60')][_0xdb56('0x52')](_0x4c564d[_0xdb56('0x53')]);}})['then'](respondWithResult(_0x133f70,null))[_0xdb56('0x4e')](handleError(_0x133f70,null));};exports[_0xdb56('0x61')]=function(_0x26a529,_0x488c81,_0x3a5b8c){var _0x325b11={'raw':![],'where':{}};var _0x2b909d={};var _0x1a07f4={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x26a529[_0xdb56('0x4f')]['id']}})['then'](handleEntityNotFound(_0x488c81,null))[_0xdb56('0x2b')](function(_0x1757dc){if(_0x1757dc){_0x2b909d['model']=_[_0xdb56('0x50')](db[_0xdb56('0x60')][_0xdb56('0x34')]);_0x2b909d['query']=_[_0xdb56('0x50')](_0x26a529[_0xdb56('0x3a')]);_0x2b909d[_0xdb56('0x3b')]=_[_0xdb56('0x3d')](_0x2b909d[_0xdb56('0x38')],_0x2b909d[_0xdb56('0x3a')]);_0x325b11['attributes']=_[_0xdb56('0x3d')](_0x2b909d[_0xdb56('0x38')],qs[_0xdb56('0x3e')](_0x26a529[_0xdb56('0x3a')][_0xdb56('0x3e')]));_0x325b11['attributes']=_0x325b11[_0xdb56('0x3c')][_0xdb56('0x3f')]?_0x325b11[_0xdb56('0x3c')]:_0x2b909d[_0xdb56('0x38')];if(!_0x26a529[_0xdb56('0x3a')][_0xdb56('0x40')](_0xdb56('0x41'))){_0x325b11[_0xdb56('0x42')]=qs['limit'](_0x26a529[_0xdb56('0x3a')][_0xdb56('0x42')]);_0x325b11[_0xdb56('0x23')]=qs[_0xdb56('0x23')](_0x26a529[_0xdb56('0x3a')][_0xdb56('0x23')]);}_0x325b11['order']=qs[_0xdb56('0x43')](_0x26a529[_0xdb56('0x3a')][_0xdb56('0x43')]);_0x325b11[_0xdb56('0x44')]=qs['filters'](_[_0xdb56('0x45')](_0x26a529['query'],_0x2b909d[_0xdb56('0x3b')]));_0x325b11[_0xdb56('0x44')][_0xdb56('0x5f')]=_0x1757dc['id'];if(_0x26a529[_0xdb56('0x3a')]['filter']){_0x325b11['where']=_[_0xdb56('0x47')](_0x325b11[_0xdb56('0x44')],{'$or':_[_0xdb56('0x39')](_0x325b11[_0xdb56('0x3c')],function(_0x5a3eea){var _0x20f3df={};_0x20f3df[_0x5a3eea]={'$like':'%'+_0x26a529[_0xdb56('0x3a')]['filter']+'%'};return _0x20f3df;})});}_0x325b11=_[_0xdb56('0x47')]({},_0x325b11,_0x26a529[_0xdb56('0x49')]);return db[_0xdb56('0x60')][_0xdb56('0x25')]({'where':_0x325b11[_0xdb56('0x44')]})[_0xdb56('0x2b')](function(_0x4351b1){_0x1a07f4[_0xdb56('0x25')]=_0x4351b1;if(_0x26a529[_0xdb56('0x3a')]['includeAll']){_0x325b11['include']=[{'all':!![]}];}return db[_0xdb56('0x60')]['findAll'](_0x325b11);})['then'](function(_0x431b78){_0x1a07f4[_0xdb56('0x4d')]=_0x431b78;return _0x1a07f4;});}})[_0xdb56('0x2b')](respondWithFilteredResult(_0x488c81,_0x325b11))[_0xdb56('0x4e')](handleError(_0x488c81,null));};exports[_0xdb56('0x62')]=function(_0x24cf49,_0x2b15e1,_0x200be8){return db['CmList'][_0xdb56('0x51')]({'where':{'id':_0x24cf49[_0xdb56('0x4f')]['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x2b15e1,null))[_0xdb56('0x2b')](function(_0x362f1d){if(_0x362f1d){return _0x362f1d[_0xdb56('0x62')](_0x24cf49[_0xdb56('0x3a')][_0xdb56('0x63')]);}})[_0xdb56('0x2b')](respondWithStatusCode(_0x2b15e1,null))[_0xdb56('0x4e')](handleError(_0x2b15e1,null));};exports[_0xdb56('0x64')]=function(_0x508f2a,_0xeb840a,_0x2231be){return db['CmList'][_0xdb56('0x51')]({'where':{'id':_0x508f2a[_0xdb56('0x4f')]['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0xeb840a,null))[_0xdb56('0x2b')](function(_0x5df34e){if(_0x5df34e){var _0x2fa5e4=[];var _0x68bdd={'success':[],'errors':[]};return db[_0xdb56('0x65')][_0xdb56('0x5e')]()[_0xdb56('0x2b')](function(_0x500e51){if(_0x508f2a[_0xdb56('0x53')]['tags']&&_[_0xdb56('0x66')](_0x508f2a['body'][_0xdb56('0x67')])){if(_0x508f2a[_0xdb56('0x53')][_0xdb56('0x67')][_0xdb56('0x3f')]){_0x508f2a[_0xdb56('0x53')]['tags']=_0x508f2a[_0xdb56('0x53')][_0xdb56('0x67')]['join'](';')+';';}else{_0x508f2a['body'][_0xdb56('0x67')]=null;}}else{_0x508f2a[_0xdb56('0x53')][_0xdb56('0x67')]=null;}if(_0x508f2a[_0xdb56('0x53')]&&_[_0xdb56('0x66')](_0x508f2a[_0xdb56('0x53')])){for(var _0x761770=0x0;_0x761770<_0x508f2a[_0xdb56('0x53')]['length'];_0x761770+=0x1){_0x508f2a[_0xdb56('0x53')][_0x761770][_0xdb56('0x5f')]=_0x508f2a[_0xdb56('0x4f')]['id'];_0x2fa5e4[_0xdb56('0x68')](_0x508f2a[_0xdb56('0x53')][_0x761770]);}return BPromise[_0xdb56('0x69')](_0x2fa5e4,function(_0x15ef65){return db[_0xdb56('0x65')][_0xdb56('0x52')](_[_0xdb56('0x6a')](_0x15ef65,['ids','id'])||{},{'fields':_[_0xdb56('0x50')](_0x500e51),'raw':!![]})['then'](function(_0x3900e8){_0x68bdd[_0xdb56('0x6b')][_0xdb56('0x68')](_0x3900e8[_0xdb56('0x6c')]);})[_0xdb56('0x4e')](function(_0x537bb8){_0x68bdd[_0xdb56('0x6d')]['push']({'data':_0x15ef65,'error':_0x537bb8[_0xdb56('0x6e')]});});})[_0xdb56('0x2b')](function(_0x57ef01){return _0x68bdd;})[_0xdb56('0x4e')](function(_0x30278d){return _0x30278d;});}else{_0xeb840a['status'](0x190)[_0xdb56('0x22')]({'message':_0xdb56('0x6f')});}});}})['then'](respondWithResult(_0xeb840a,null))['catch'](handleError(_0xeb840a,null));};exports[_0xdb56('0x70')]=function(_0x767eb2,_0x13704d,_0x2c5f87){var _0x15f948;return db[_0xdb56('0x33')][_0xdb56('0x51')]({'where':{'id':_0x767eb2[_0xdb56('0x4f')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xdb56('0x71')}]})[_0xdb56('0x2b')](handleEntityNotFound(_0x13704d,null))[_0xdb56('0x2b')](function(_0x5b1b2d){if(_0x5b1b2d){_0x15f948=_0x5b1b2d;return db[_0xdb56('0x65')]['rawAttributes'];}})[_0xdb56('0x2b')](function(_0x5793ab){if(_0x5793ab){var _0x47204f={};var _0xd3d53e={};_0xd3d53e[_0xdb56('0x38')]=_[_0xdb56('0x72')](_['keys'](_0x5793ab),_[_0xdb56('0x39')](_0x15f948[_0xdb56('0x71')],function(_0x1db5fc){return util[_0xdb56('0x73')]('cf_%d',_0x1db5fc['id']);}));_0xd3d53e[_0xdb56('0x3a')]=_[_0xdb56('0x50')](_0x767eb2['query']);_0xd3d53e['filters']=_[_0xdb56('0x3d')](_0xd3d53e[_0xdb56('0x38')],_0xd3d53e[_0xdb56('0x3a')]);_0x47204f['attributes']=_['intersection'](_0xd3d53e['model'],qs[_0xdb56('0x3e')](_0x767eb2[_0xdb56('0x3a')][_0xdb56('0x3e')]));_0x47204f[_0xdb56('0x3c')]=_0x47204f['attributes'][_0xdb56('0x3f')]?_0x47204f[_0xdb56('0x3c')]:_0xd3d53e['model'];if(!_0x767eb2[_0xdb56('0x3a')][_0xdb56('0x40')](_0xdb56('0x41'))){_0x47204f['limit']=qs[_0xdb56('0x42')](_0x767eb2[_0xdb56('0x3a')][_0xdb56('0x42')]);_0x47204f['offset']=qs['offset'](_0x767eb2['query'][_0xdb56('0x23')]);}_0x47204f['order']=qs[_0xdb56('0x43')](_0x767eb2[_0xdb56('0x3a')][_0xdb56('0x43')]);_0x47204f[_0xdb56('0x44')]=qs[_0xdb56('0x3b')](_[_0xdb56('0x45')](_0x767eb2[_0xdb56('0x3a')],_0xd3d53e['filters']));_0x47204f[_0xdb56('0x74')]=!![];if(_0x767eb2[_0xdb56('0x3a')]['filter']){_0x47204f[_0xdb56('0x44')]=_[_0xdb56('0x47')](_0x47204f[_0xdb56('0x44')],{'$or':_[_0xdb56('0x39')](_0x47204f[_0xdb56('0x3c')],function(_0x4b0620){var _0x1ff89c={};_0x1ff89c[_0x4b0620]={'$like':'%'+_0x767eb2[_0xdb56('0x3a')][_0xdb56('0x46')]+'%'};return _0x1ff89c;})});}_0x47204f=_['merge']({},_0x47204f,_0x767eb2[_0xdb56('0x49')]);return _0x15f948['getContacts'](_0x47204f);}})[_0xdb56('0x2b')](respondWithResult(_0x13704d,null))[_0xdb56('0x4e')](handleError(_0x13704d,null));};exports[_0xdb56('0x75')]=function(_0x314b29,_0x4621df,_0x4e95b4){var _0x5b1674;var _0x4b1f24;var _0x4222b1;var _0x5a7c21=_0x314b29[_0xdb56('0x4f')]['id'];csv_results=[];return db[_0xdb56('0x76')][_0xdb56('0x4c')]({'attributes':['id',_0xdb56('0x30')],'raw':!![],'order':[_0xdb56('0x77')]})[_0xdb56('0x2b')](function(_0x2082d5){_0x5b1674=_0x2082d5;var _0x442a8d=_[_0xdb56('0x50')](db[_0xdb56('0x65')][_0xdb56('0x34')]);return db[_0xdb56('0x78')][_0xdb56('0x4c')]({'raw':!![],'attributes':['id','alias']})[_0xdb56('0x2b')](function(_0x210ce1){_0x4b1f24=_0x210ce1;var _0x54b3e9=squel['select']()[_0xdb56('0x3e')](_0x442a8d)[_0xdb56('0x79')](_0xdb56('0x7a'),'c')[_0xdb56('0x44')](_0xdb56('0x7b'),_0x5a7c21)[_0xdb56('0x44')]('c.deletedAt\x20is\x20null')[_0xdb56('0x7c')]();for(var _0xea1745=0x0;_0xea1745<_0x4b1f24[_0xdb56('0x3f')];_0xea1745++){_0x54b3e9[_0xdb56('0x7d')](_0xdb56('0x7e')+_0x4b1f24[_0xea1745]['id'],'customField_'+_0x4b1f24[_0xea1745][_0xdb56('0x7f')]);}for(var _0xea1745=0x0;_0xea1745<_0x5b1674[_0xdb56('0x3f')];_0xea1745++){_0x54b3e9[_0xdb56('0x7d')](squel[_0xdb56('0x80')]()[_0xdb56('0x7d')](_0xdb56('0x81'))[_0xdb56('0x79')](_0xdb56('0x82'))[_0xdb56('0x44')](_0xdb56('0x83'),_0x5b1674[_0xea1745]['id'])[_0xdb56('0x44')]('CmContactId\x20=\x20c.id'),_0xdb56('0x84')+_0x5b1674[_0xea1745][_0xdb56('0x30')]);_0x54b3e9[_0xdb56('0x7d')](squel[_0xdb56('0x80')]()[_0xdb56('0x7d')](_0xdb56('0x85'))[_0xdb56('0x79')]('cm_contact_has_items')['where']('ItemTypeId\x20=\x20?',_0x5b1674[_0xea1745]['id'])[_0xdb56('0x44')](_0xdb56('0x86')),'description_additionalPhone_'+_0x5b1674[_0xea1745]['name']);}var _0x21e5d5=[];_0x21e5d5['push'](_0x54b3e9[_0xdb56('0x87')]());BPromise[_0xdb56('0x69')](_0x21e5d5,handleQuery)[_0xdb56('0x2b')](function(_0x4e8e85){handleQuery(_0x54b3e9['toString']());var _0x35ea6e=csv_results[0x0];if(!_['isEmpty'](_0x35ea6e)){var _0x43d14c=toCsv(_0x35ea6e);var _0x570429=Date[_0xdb56('0x88')]();fs[_0xdb56('0x89')](util[_0xdb56('0x73')](_0xdb56('0x8a'),_0x5a7c21,_0x570429),_0x43d14c);_0x4621df[_0xdb56('0x8b')](_0xdb56('0x8c'),_0xdb56('0x8d')+util[_0xdb56('0x73')](_0xdb56('0x8e'),_0x5a7c21,_0x570429));_0x4621df[_0xdb56('0x8b')](_0xdb56('0x8f'),_0xdb56('0x90'));return _0x4621df[_0xdb56('0x91')](util['format'](_0xdb56('0x8a'),_0x5a7c21,_0x570429));}else{return _0x4621df[_0xdb56('0x20')](0xcc);}});});});};exports[_0xdb56('0x92')]=function(_0xd5b952,_0x386ed0,_0x96e78a){var _0x2e9b30;delete _0xd5b952[_0xdb56('0x53')]['id'];return db['CmList'][_0xdb56('0x93')]({'where':{'id':_0xd5b952['params']['id']}})['then'](handleEntityNotFound(_0x386ed0,null))[_0xdb56('0x2b')](function(_0x558d97){if(_0x558d97){return db[_0xdb56('0x94')]['transaction'](function(_0x590b70){return db[_0xdb56('0x78')][_0xdb56('0x52')](_0xd5b952[_0xdb56('0x53')],{'transaction':_0x590b70})[_0xdb56('0x2b')](function(_0x598bb0){_0x2e9b30=_0x598bb0;return _0x558d97['addCustomFields'](_0x598bb0,{'transaction':_0x590b70});})[_0xdb56('0x2b')](function(){var _0x50a407={'type':db[_0xdb56('0x95')]['TEXT'],'transaction':_0x590b70};switch(_0xd5b952[_0xdb56('0x53')]['type']){case _0xdb56('0x96'):_0x50a407['type']=db['Sequelize']['TEXT'];break;case _0xdb56('0x97'):_0x50a407[_0xdb56('0x36')]=db[_0xdb56('0x95')][_0xdb56('0x98')];break;case _0xdb56('0x99'):_0x50a407[_0xdb56('0x36')]=db[_0xdb56('0x95')][_0xdb56('0x9a')];_0x50a407[_0xdb56('0x9b')]=![];break;default:}return db[_0xdb56('0x94')][_0xdb56('0x9c')][_0xdb56('0x9d')]('cm_contacts',util[_0xdb56('0x73')]('cf_%s',_0x2e9b30['id']),_0x50a407);})[_0xdb56('0x2b')](function(){return _0x2e9b30;});});}})['then'](respondWithResult(_0x386ed0,null))['catch'](handleError(_0x386ed0,null));};exports[_0xdb56('0x9e')]=function(_0x5a62c6,_0x429a05,_0x2770a4){var _0x2f78c1={};var _0x41a4d0={};var _0x3f6d9d;var _0x3ba494;return db[_0xdb56('0x33')][_0xdb56('0x93')]({'where':{'id':_0x5a62c6[_0xdb56('0x4f')]['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x429a05,null))[_0xdb56('0x2b')](function(_0x5dfcf0){if(_0x5dfcf0){_0x3f6d9d=_0x5dfcf0;_0x41a4d0[_0xdb56('0x38')]=_[_0xdb56('0x50')](db[_0xdb56('0x78')][_0xdb56('0x34')]);_0x41a4d0[_0xdb56('0x3a')]=_['keys'](_0x5a62c6[_0xdb56('0x3a')]);_0x41a4d0[_0xdb56('0x3b')]=_[_0xdb56('0x3d')](_0x41a4d0[_0xdb56('0x38')],_0x41a4d0[_0xdb56('0x3a')]);_0x2f78c1[_0xdb56('0x3c')]=_[_0xdb56('0x3d')](_0x41a4d0['model'],qs[_0xdb56('0x3e')](_0x5a62c6[_0xdb56('0x3a')]['fields']));_0x2f78c1['attributes']=_0x2f78c1[_0xdb56('0x3c')]['length']?_0x2f78c1[_0xdb56('0x3c')]:_0x41a4d0[_0xdb56('0x38')];_0x2f78c1[_0xdb56('0x9f')]=qs[_0xdb56('0x43')](_0x5a62c6[_0xdb56('0x3a')]['sort']);_0x2f78c1[_0xdb56('0x44')]=qs[_0xdb56('0x3b')](_['pick'](_0x5a62c6['query'],_0x41a4d0[_0xdb56('0x3b')]));_0x2f78c1[_0xdb56('0x44')]=_['merge'](_0x2f78c1['where'],{'$or':[{'ListId':_0x5dfcf0['id']},{'ListId':null}]});if(_0x5a62c6[_0xdb56('0x3a')][_0xdb56('0x46')]){_0x2f78c1['where']=_[_0xdb56('0x47')](_0x2f78c1['where'],{'$or':_[_0xdb56('0x39')](_0x2f78c1[_0xdb56('0x3c')],function(_0x3976d2){var _0x16e3e0={};_0x16e3e0[_0x3976d2]={'$like':'%'+_0x5a62c6[_0xdb56('0x3a')]['filter']+'%'};return _0x16e3e0;})});}_0x2f78c1=_[_0xdb56('0x47')]({},_0x2f78c1,_0x5a62c6[_0xdb56('0x49')]);return db[_0xdb56('0x78')]['findAndCountAll'](_0x2f78c1);}})[_0xdb56('0x2b')](respondWithResult(_0x429a05,null))[_0xdb56('0x4e')](handleError(_0x429a05,null));};exports[_0xdb56('0xa0')]=function(_0x16cc57,_0x4e6fad){return db[_0xdb56('0x78')]['findAndCountAll']({'where':{'ListId':null}})[_0xdb56('0x2b')](handleEntityNotFound(_0x4e6fad,null))['then'](function(_0x4a067d){return _0x4a067d;})[_0xdb56('0x2b')](respondWithResult(_0x4e6fad,null))[_0xdb56('0x4e')](handleError(_0x4e6fad,null));};exports['addAgents']=function(_0x2c3beb,_0x37deee,_0x285b17){return db[_0xdb56('0x33')][_0xdb56('0x51')]({'where':{'id':_0x2c3beb[_0xdb56('0x4f')]['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x37deee,null))[_0xdb56('0x2b')](function(_0x39ea8c){if(_0x39ea8c){return _0x39ea8c[_0xdb56('0xa1')](_0x2c3beb['body'][_0xdb56('0x63')],_[_0xdb56('0x6a')](_0x2c3beb['body'],[_0xdb56('0x63'),'id'])||{})[_0xdb56('0xa2')](function(_0x2ece4b){for(var _0x5a7b26=0x0;_0x5a7b26<_0x2c3beb[_0xdb56('0x53')]['ids'][_0xdb56('0x3f')];_0x5a7b26+=0x1){socket[_0xdb56('0xa3')]('userCmList:save',{'UserId':Number(_0x2c3beb[_0xdb56('0x53')][_0xdb56('0x63')][_0x5a7b26]),'CmListId':Number(_0x2c3beb[_0xdb56('0x4f')]['id'])});}return _0x2ece4b;});}})['then'](respondWithResult(_0x37deee,null))[_0xdb56('0x4e')](handleError(_0x37deee,null));};exports[_0xdb56('0xa4')]=function(_0x13401f,_0x52e4fb,_0x4e72e5){return db[_0xdb56('0x33')]['find']({'where':{'id':_0x13401f['params']['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x52e4fb,null))[_0xdb56('0x2b')](function(_0x2bf3c0){if(_0x2bf3c0){return _0x2bf3c0[_0xdb56('0xa4')](_0x13401f['query'][_0xdb56('0x63')])['then'](function(){if(_[_0xdb56('0x66')](_0x13401f['query'][_0xdb56('0x63')])){for(var _0x2f5fe8=0x0;_0x2f5fe8<_0x13401f[_0xdb56('0x3a')][_0xdb56('0x63')][_0xdb56('0x3f')];_0x2f5fe8+=0x1){socket[_0xdb56('0xa3')](_0xdb56('0xa5'),{'UserId':Number(_0x13401f[_0xdb56('0x3a')][_0xdb56('0x63')][_0x2f5fe8]),'CmListId':Number(_0x13401f[_0xdb56('0x4f')]['id'])});}}else{socket[_0xdb56('0xa3')](_0xdb56('0xa5'),{'UserId':Number(_0x13401f[_0xdb56('0x3a')][_0xdb56('0x63')]),'CmListId':Number(_0x13401f['params']['id'])});}});}})[_0xdb56('0x2b')](respondWithStatusCode(_0x52e4fb,null))[_0xdb56('0x4e')](handleError(_0x52e4fb,null));};exports[_0xdb56('0xa6')]=function(_0x2daf05,_0x434d4b,_0x5311b1){var _0x2531a7={};var _0x3d4bb9={};var _0xbe217b;var _0x30c410;return db[_0xdb56('0x33')][_0xdb56('0x93')]({'where':{'id':_0x2daf05[_0xdb56('0x4f')]['id']}})['then'](handleEntityNotFound(_0x434d4b,null))[_0xdb56('0x2b')](function(_0x540e20){if(_0x540e20){_0xbe217b=_0x540e20;_0x3d4bb9[_0xdb56('0x38')]=_[_0xdb56('0x50')](db[_0xdb56('0xa7')][_0xdb56('0x34')]);_0x3d4bb9[_0xdb56('0x3a')]=_['keys'](_0x2daf05[_0xdb56('0x3a')]);_0x3d4bb9['filters']=_['intersection'](_0x3d4bb9[_0xdb56('0x38')],_0x3d4bb9[_0xdb56('0x3a')]);_0x2531a7[_0xdb56('0x3c')]=_[_0xdb56('0x3d')](_0x3d4bb9[_0xdb56('0x38')],qs[_0xdb56('0x3e')](_0x2daf05[_0xdb56('0x3a')][_0xdb56('0x3e')]));_0x2531a7[_0xdb56('0x3c')]=_0x2531a7['attributes'][_0xdb56('0x3f')]?_0x2531a7[_0xdb56('0x3c')]:_0x3d4bb9[_0xdb56('0x38')];_0x2531a7['order']=qs[_0xdb56('0x43')](_0x2daf05[_0xdb56('0x3a')][_0xdb56('0x43')]);_0x2531a7['where']=qs[_0xdb56('0x3b')](_[_0xdb56('0x45')](_0x2daf05[_0xdb56('0x3a')],_0x3d4bb9[_0xdb56('0x3b')]));if(_0x2daf05[_0xdb56('0x3a')][_0xdb56('0x46')]){_0x2531a7[_0xdb56('0x44')]=_[_0xdb56('0x47')](_0x2531a7[_0xdb56('0x44')],{'$or':_[_0xdb56('0x39')](_0x2531a7[_0xdb56('0x3c')],function(_0xa0e35b){var _0x5191c0={};_0x5191c0[_0xa0e35b]={'$like':'%'+_0x2daf05[_0xdb56('0x3a')][_0xdb56('0x46')]+'%'};return _0x5191c0;})});}_0x2531a7=_[_0xdb56('0x47')]({},_0x2531a7,_0x2daf05['options']);return _0xbe217b['getAgents'](_0x2531a7);}})[_0xdb56('0x2b')](function(_0x594e4f){if(_0x594e4f){_0x30c410=_0x594e4f['length'];if(!_0x2daf05[_0xdb56('0x3a')][_0xdb56('0x40')](_0xdb56('0x41'))){_0x2531a7[_0xdb56('0x42')]=qs['limit'](_0x2daf05[_0xdb56('0x3a')]['limit']);_0x2531a7[_0xdb56('0x23')]=qs[_0xdb56('0x23')](_0x2daf05[_0xdb56('0x3a')]['offset']);}return _0xbe217b[_0xdb56('0xa6')](_0x2531a7);}})[_0xdb56('0x2b')](function(_0x41c9b7){if(_0x41c9b7){return _0x41c9b7?{'count':_0x30c410,'rows':_0x41c9b7}:null;}})[_0xdb56('0x2b')](respondWithResult(_0x434d4b,null))[_0xdb56('0x4e')](handleError(_0x434d4b,null));};function handleQuery(_0x233a1c){logger[_0xdb56('0xa8')](_0x233a1c);return db['sequelize'][_0xdb56('0x3a')](_0x233a1c)[_0xdb56('0xa2')](function(_0xf0a52a){csv_results['push'](_0xf0a52a);})[_0xdb56('0x4e')](function(_0x57d1bc){logger[_0xdb56('0x5b')](_0x57d1bc[_0xdb56('0x6e')]);});} \ No newline at end of file +var _0xc2c2=['pick','filter','merge','options','where','CmList','includeAll','include','findAll','show','params','rawAttributes','catch','create','body','user','role','Lists','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','describe','addDisposition','ListId','Disposition','getDispositions','findOne','length','removeDispositions','ids','addContacts','tags','isArray','join','push','each','CmContact','omit','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CustomFields','cf_%d','getContactsCsv','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','format','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','getCustomFields','CmCustomField','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','./cmList.socket','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xc2c2,0x65));var _0x2c2c=function(_0x4e1aeb,_0xe2beca){_0x4e1aeb=_0x4e1aeb-0x0;var _0x442a96=_0xc2c2[_0x4e1aeb];return _0x442a96;};'use strict';var emlformat=require(_0x2c2c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c2c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2c2c('0x2'));var BPromise=require(_0x2c2c('0x3'));var Mustache=require(_0x2c2c('0x4'));var util=require(_0x2c2c('0x5'));var path=require(_0x2c2c('0x6'));var sox=require(_0x2c2c('0x7'));var csv=require(_0x2c2c('0x8'));var ejs=require(_0x2c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x2c2c('0xa'));var _=require(_0x2c2c('0xb'));var squel=require('squel');var crypto=require(_0x2c2c('0xc'));var jsforce=require(_0x2c2c('0xd'));var deskjs=require(_0x2c2c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2c2c('0xf'));var Papa=require(_0x2c2c('0x10'));var Redis=require(_0x2c2c('0x11'));var authService=require(_0x2c2c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2c2c('0x13'));var hardwareService=require(_0x2c2c('0x14'));var logger=require(_0x2c2c('0x15'))('api');var utils=require(_0x2c2c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2c2c('0x17'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x2c2c('0x18')]=_[_0x2c2c('0x19')](config[_0x2c2c('0x18')],{'host':_0x2c2c('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c2c('0x18')]));require(_0x2c2c('0x1b'))['register'](socket);function respondWithStatusCode(_0x14d1ce,_0x16307e){_0x16307e=_0x16307e||0xcc;return function(_0x19ede2){if(_0x19ede2){return _0x14d1ce['sendStatus'](_0x16307e);}return _0x14d1ce[_0x2c2c('0x1c')](_0x16307e)[_0x2c2c('0x1d')]();};}function respondWithResult(_0x28dc6c,_0x253dc6){_0x253dc6=_0x253dc6||0xc8;return function(_0x30f9b9){if(_0x30f9b9){return _0x28dc6c['status'](_0x253dc6)[_0x2c2c('0x1e')](_0x30f9b9);}};}function respondWithFilteredResult(_0x537d54,_0x4d890f){return function(_0x563ab7){if(_0x563ab7){var _0x71d85e=typeof _0x4d890f[_0x2c2c('0x1f')]===_0x2c2c('0x20')&&typeof _0x4d890f['limit']===_0x2c2c('0x20');var _0x235eed=_0x563ab7[_0x2c2c('0x21')];var _0x524bcf=_0x71d85e?0x0:_0x4d890f[_0x2c2c('0x1f')];var _0xbbc929=_0x71d85e?_0x563ab7[_0x2c2c('0x21')]:_0x4d890f['offset']+_0x4d890f[_0x2c2c('0x22')];var _0x4183ea;if(_0xbbc929>=_0x235eed){_0xbbc929=_0x235eed;_0x4183ea=0xc8;}else{_0x4183ea=0xce;}_0x537d54[_0x2c2c('0x1c')](_0x4183ea);return _0x537d54[_0x2c2c('0x23')](_0x2c2c('0x24'),_0x524bcf+'-'+_0xbbc929+'/'+_0x235eed)[_0x2c2c('0x1e')](_0x563ab7);}return null;};}function patchUpdates(_0x3e2eae){return function(_0x5bcf37){try{jsonpatch[_0x2c2c('0x25')](_0x5bcf37,_0x3e2eae,!![]);}catch(_0x15f4fc){return BPromise['reject'](_0x15f4fc);}return _0x5bcf37[_0x2c2c('0x26')]();};}function saveUpdates(_0x39d418,_0x983d71){return function(_0x55217f){if(_0x55217f){return _0x55217f[_0x2c2c('0x27')](_0x39d418)[_0x2c2c('0x28')](function(_0x1f2d41){return _0x1f2d41;});}return null;};}function removeEntity(_0x227984,_0x382e95){return function(_0x1afd4f){if(_0x1afd4f){return _0x1afd4f['destroy']()[_0x2c2c('0x28')](function(){var _0x28d998=_0x1afd4f[_0x2c2c('0x29')]({'plain':!![]});var _0x239c39='Lists';return db[_0x2c2c('0x2a')]['destroy']({'where':{'type':_0x239c39,'resourceId':_0x28d998['id']}})[_0x2c2c('0x28')](function(){return _0x1afd4f;});})[_0x2c2c('0x28')](function(){_0x227984[_0x2c2c('0x1c')](0xcc)[_0x2c2c('0x1d')]();});}};}function handleEntityNotFound(_0x52b898,_0x3ed130){return function(_0x50b5bb){if(!_0x50b5bb){_0x52b898[_0x2c2c('0x2b')](0x194);}return _0x50b5bb;};}function handleError(_0x3d3b7f,_0x5b920e){_0x5b920e=_0x5b920e||0x1f4;return function(_0x28f234){logger[_0x2c2c('0x2c')](_0x28f234[_0x2c2c('0x2d')]);if(_0x28f234[_0x2c2c('0x2e')]){delete _0x28f234['name'];}_0x3d3b7f[_0x2c2c('0x1c')](_0x5b920e)[_0x2c2c('0x2f')](_0x28f234);};}exports[_0x2c2c('0x30')]=function(_0x1394ae,_0x392654){var _0x12a553={},_0x203141={},_0x193c55={'count':0x0,'rows':[]};var _0x24bb71=_[_0x2c2c('0x31')](db['CmList']['rawAttributes'],function(_0x4d151b){return{'name':_0x4d151b[_0x2c2c('0x32')],'type':_0x4d151b[_0x2c2c('0x33')][_0x2c2c('0x34')]};});_0x203141['model']=_[_0x2c2c('0x31')](_0x24bb71,'name');_0x203141[_0x2c2c('0x35')]=_[_0x2c2c('0x36')](_0x1394ae[_0x2c2c('0x35')]);_0x203141[_0x2c2c('0x37')]=_[_0x2c2c('0x38')](_0x203141[_0x2c2c('0x39')],_0x203141[_0x2c2c('0x35')]);_0x12a553['attributes']=_[_0x2c2c('0x38')](_0x203141['model'],qs[_0x2c2c('0x3a')](_0x1394ae[_0x2c2c('0x35')]['fields']));_0x12a553[_0x2c2c('0x3b')]=_0x12a553[_0x2c2c('0x3b')]['length']?_0x12a553['attributes']:_0x203141[_0x2c2c('0x39')];if(!_0x1394ae[_0x2c2c('0x35')][_0x2c2c('0x3c')](_0x2c2c('0x3d'))){_0x12a553['limit']=qs[_0x2c2c('0x22')](_0x1394ae[_0x2c2c('0x35')][_0x2c2c('0x22')]);_0x12a553[_0x2c2c('0x1f')]=qs[_0x2c2c('0x1f')](_0x1394ae['query'][_0x2c2c('0x1f')]);}_0x12a553[_0x2c2c('0x3e')]=qs[_0x2c2c('0x3f')](_0x1394ae['query'][_0x2c2c('0x3f')]);_0x12a553['where']=qs[_0x2c2c('0x37')](_[_0x2c2c('0x40')](_0x1394ae['query'],_0x203141[_0x2c2c('0x37')]),_0x24bb71);if(_0x1394ae[_0x2c2c('0x35')][_0x2c2c('0x41')]){_0x12a553['where']=_[_0x2c2c('0x42')](_0x12a553['where'],{'$or':_[_0x2c2c('0x31')](_0x24bb71,function(_0x579e1b){if(_0x579e1b[_0x2c2c('0x33')]!=='VIRTUAL'){var _0x31b0f9={};_0x31b0f9[_0x579e1b[_0x2c2c('0x2e')]]={'$like':'%'+_0x1394ae[_0x2c2c('0x35')][_0x2c2c('0x41')]+'%'};return _0x31b0f9;}})});}_0x12a553=_[_0x2c2c('0x42')]({},_0x12a553,_0x1394ae[_0x2c2c('0x43')]);var _0x53f78b={'where':_0x12a553[_0x2c2c('0x44')]};return db[_0x2c2c('0x45')]['count'](_0x53f78b)['then'](function(_0x7d5cca){_0x193c55[_0x2c2c('0x21')]=_0x7d5cca;if(_0x1394ae[_0x2c2c('0x35')][_0x2c2c('0x46')]){_0x12a553[_0x2c2c('0x47')]=[{'all':!![]}];}return db[_0x2c2c('0x45')][_0x2c2c('0x48')](_0x12a553);})[_0x2c2c('0x28')](function(_0x4a3b2e){_0x193c55['rows']=_0x4a3b2e;return _0x193c55;})['then'](respondWithFilteredResult(_0x392654,_0x12a553))['catch'](handleError(_0x392654,null));};exports[_0x2c2c('0x49')]=function(_0x5518d1,_0x5f4a1c){var _0x10ed32={'raw':![],'where':{'id':_0x5518d1[_0x2c2c('0x4a')]['id']}},_0x524cac={};_0x524cac[_0x2c2c('0x39')]=_[_0x2c2c('0x36')](db[_0x2c2c('0x45')][_0x2c2c('0x4b')]);_0x524cac[_0x2c2c('0x35')]=_[_0x2c2c('0x36')](_0x5518d1['query']);_0x524cac[_0x2c2c('0x37')]=_[_0x2c2c('0x38')](_0x524cac['model'],_0x524cac['query']);_0x10ed32[_0x2c2c('0x3b')]=_[_0x2c2c('0x38')](_0x524cac[_0x2c2c('0x39')],qs[_0x2c2c('0x3a')](_0x5518d1[_0x2c2c('0x35')]['fields']));_0x10ed32[_0x2c2c('0x3b')]=_0x10ed32[_0x2c2c('0x3b')]['length']?_0x10ed32[_0x2c2c('0x3b')]:_0x524cac[_0x2c2c('0x39')];if(_0x5518d1[_0x2c2c('0x35')][_0x2c2c('0x46')]){_0x10ed32['include']=[{'all':!![]}];}_0x10ed32=_['merge']({},_0x10ed32,_0x5518d1['options']);return db[_0x2c2c('0x45')]['find'](_0x10ed32)['then'](handleEntityNotFound(_0x5f4a1c,null))[_0x2c2c('0x28')](respondWithResult(_0x5f4a1c,null))[_0x2c2c('0x4c')](handleError(_0x5f4a1c,null));};exports['create']=function(_0x2fa555,_0x13f63f){return db['CmList'][_0x2c2c('0x4d')](_0x2fa555[_0x2c2c('0x4e')],{})[_0x2c2c('0x28')](function(_0x32151b){var _0x44ec1a=_0x2fa555[_0x2c2c('0x4f')][_0x2c2c('0x29')]({'plain':!![]});if(!_0x44ec1a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44ec1a[_0x2c2c('0x50')]==='user'){var _0x17b7ae=_0x32151b[_0x2c2c('0x29')]({'plain':!![]});var _0x2a849d=_0x2c2c('0x51');return db['UserProfileSection']['find']({'where':{'name':_0x2a849d,'userProfileId':_0x44ec1a[_0x2c2c('0x52')]},'raw':!![]})[_0x2c2c('0x28')](function(_0x2835d9){if(_0x2835d9&&_0x2835d9[_0x2c2c('0x53')]===0x0){return db[_0x2c2c('0x2a')]['create']({'name':_0x17b7ae[_0x2c2c('0x2e')],'resourceId':_0x17b7ae['id'],'type':_0x2835d9[_0x2c2c('0x2e')],'sectionId':_0x2835d9['id']},{})[_0x2c2c('0x28')](function(){return _0x32151b;});}else{return _0x32151b;}})[_0x2c2c('0x4c')](function(_0x3776de){logger[_0x2c2c('0x2c')](_0x2c2c('0x54'),_0x3776de);throw _0x3776de;});}return _0x32151b;})[_0x2c2c('0x28')](respondWithResult(_0x13f63f,0xc9))[_0x2c2c('0x4c')](handleError(_0x13f63f,null));};exports[_0x2c2c('0x27')]=function(_0x27189a,_0x3fa293){if(_0x27189a[_0x2c2c('0x4e')]['id']){delete _0x27189a['body']['id'];}return db[_0x2c2c('0x45')][_0x2c2c('0x55')]({'where':{'id':_0x27189a[_0x2c2c('0x4a')]['id']}})[_0x2c2c('0x28')](handleEntityNotFound(_0x3fa293,null))[_0x2c2c('0x28')](saveUpdates(_0x27189a['body'],null))[_0x2c2c('0x28')](respondWithResult(_0x3fa293,null))[_0x2c2c('0x4c')](handleError(_0x3fa293,null));};exports[_0x2c2c('0x56')]=function(_0x1b2960,_0x8dfd20){return db[_0x2c2c('0x45')][_0x2c2c('0x55')]({'where':{'id':_0x1b2960[_0x2c2c('0x4a')]['id']}})[_0x2c2c('0x28')](handleEntityNotFound(_0x8dfd20,null))['then'](removeEntity(_0x8dfd20,null))[_0x2c2c('0x4c')](handleError(_0x8dfd20,null));};exports[_0x2c2c('0x57')]=function(_0xcee7af,_0x28b543){return db[_0x2c2c('0x45')][_0x2c2c('0x57')]()[_0x2c2c('0x28')](respondWithResult(_0x28b543,null))[_0x2c2c('0x4c')](handleError(_0x28b543,null));};exports[_0x2c2c('0x58')]=function(_0x2054f7,_0xed57e,_0x272003){if(_0x2054f7[_0x2c2c('0x4e')]['id']){delete _0x2054f7[_0x2c2c('0x4e')]['id'];}return db[_0x2c2c('0x45')][_0x2c2c('0x55')]({'where':{'id':_0x2054f7[_0x2c2c('0x4a')]['id']}})[_0x2c2c('0x28')](handleEntityNotFound(_0xed57e,null))['then'](function(_0x120364){if(_0x120364){_0x2054f7[_0x2c2c('0x4e')][_0x2c2c('0x59')]=_0x120364['id'];return db[_0x2c2c('0x5a')][_0x2c2c('0x4d')](_0x2054f7[_0x2c2c('0x4e')]);}})[_0x2c2c('0x28')](respondWithResult(_0xed57e,null))[_0x2c2c('0x4c')](handleError(_0xed57e,null));};exports[_0x2c2c('0x5b')]=function(_0x45a51a,_0x495e14,_0x45fffc){var _0x5452e0={'raw':![],'where':{}};var _0x224ca4={};var _0x3faa04={'count':0x0,'rows':[]};return db[_0x2c2c('0x45')][_0x2c2c('0x5c')]({'where':{'id':_0x45a51a[_0x2c2c('0x4a')]['id']}})[_0x2c2c('0x28')](handleEntityNotFound(_0x495e14,null))[_0x2c2c('0x28')](function(_0x1df946){if(_0x1df946){_0x224ca4[_0x2c2c('0x39')]=_[_0x2c2c('0x36')](db[_0x2c2c('0x5a')]['rawAttributes']);_0x224ca4[_0x2c2c('0x35')]=_[_0x2c2c('0x36')](_0x45a51a[_0x2c2c('0x35')]);_0x224ca4[_0x2c2c('0x37')]=_[_0x2c2c('0x38')](_0x224ca4[_0x2c2c('0x39')],_0x224ca4[_0x2c2c('0x35')]);_0x5452e0[_0x2c2c('0x3b')]=_['intersection'](_0x224ca4[_0x2c2c('0x39')],qs[_0x2c2c('0x3a')](_0x45a51a[_0x2c2c('0x35')]['fields']));_0x5452e0[_0x2c2c('0x3b')]=_0x5452e0['attributes'][_0x2c2c('0x5d')]?_0x5452e0[_0x2c2c('0x3b')]:_0x224ca4[_0x2c2c('0x39')];if(!_0x45a51a[_0x2c2c('0x35')][_0x2c2c('0x3c')](_0x2c2c('0x3d'))){_0x5452e0[_0x2c2c('0x22')]=qs[_0x2c2c('0x22')](_0x45a51a[_0x2c2c('0x35')]['limit']);_0x5452e0['offset']=qs[_0x2c2c('0x1f')](_0x45a51a[_0x2c2c('0x35')]['offset']);}_0x5452e0[_0x2c2c('0x3e')]=qs['sort'](_0x45a51a[_0x2c2c('0x35')][_0x2c2c('0x3f')]);_0x5452e0['where']=qs[_0x2c2c('0x37')](_[_0x2c2c('0x40')](_0x45a51a[_0x2c2c('0x35')],_0x224ca4[_0x2c2c('0x37')]));_0x5452e0[_0x2c2c('0x44')][_0x2c2c('0x59')]=_0x1df946['id'];if(_0x45a51a[_0x2c2c('0x35')][_0x2c2c('0x41')]){_0x5452e0[_0x2c2c('0x44')]=_['merge'](_0x5452e0['where'],{'$or':_[_0x2c2c('0x31')](_0x5452e0['attributes'],function(_0x3d7feb){var _0x3753b4={};_0x3753b4[_0x3d7feb]={'$like':'%'+_0x45a51a[_0x2c2c('0x35')][_0x2c2c('0x41')]+'%'};return _0x3753b4;})});}_0x5452e0=_['merge']({},_0x5452e0,_0x45a51a[_0x2c2c('0x43')]);return db[_0x2c2c('0x5a')][_0x2c2c('0x21')]({'where':_0x5452e0['where']})[_0x2c2c('0x28')](function(_0x221d19){_0x3faa04['count']=_0x221d19;if(_0x45a51a[_0x2c2c('0x35')][_0x2c2c('0x46')]){_0x5452e0['include']=[{'all':!![]}];}return db[_0x2c2c('0x5a')][_0x2c2c('0x48')](_0x5452e0);})['then'](function(_0xaaac32){_0x3faa04['rows']=_0xaaac32;return _0x3faa04;});}})[_0x2c2c('0x28')](respondWithFilteredResult(_0x495e14,_0x5452e0))['catch'](handleError(_0x495e14,null));};exports[_0x2c2c('0x5e')]=function(_0x46039f,_0x3523fd,_0x5e1d1b){return db['CmList'][_0x2c2c('0x55')]({'where':{'id':_0x46039f[_0x2c2c('0x4a')]['id']}})[_0x2c2c('0x28')](handleEntityNotFound(_0x3523fd,null))[_0x2c2c('0x28')](function(_0xa7549e){if(_0xa7549e){return _0xa7549e[_0x2c2c('0x5e')](_0x46039f['query'][_0x2c2c('0x5f')]);}})[_0x2c2c('0x28')](respondWithStatusCode(_0x3523fd,null))['catch'](handleError(_0x3523fd,null));};exports[_0x2c2c('0x60')]=function(_0x3f49bf,_0x3d0984,_0x44bd07){return db[_0x2c2c('0x45')][_0x2c2c('0x55')]({'where':{'id':_0x3f49bf[_0x2c2c('0x4a')]['id']}})[_0x2c2c('0x28')](handleEntityNotFound(_0x3d0984,null))[_0x2c2c('0x28')](function(_0x53b65f){if(_0x53b65f){var _0x4f681f=[];var _0x4f06c4={'success':[],'errors':[]};return db['CmContact']['describe']()[_0x2c2c('0x28')](function(_0x6db115){if(_0x3f49bf[_0x2c2c('0x4e')][_0x2c2c('0x61')]&&_[_0x2c2c('0x62')](_0x3f49bf[_0x2c2c('0x4e')][_0x2c2c('0x61')])){if(_0x3f49bf[_0x2c2c('0x4e')][_0x2c2c('0x61')][_0x2c2c('0x5d')]){_0x3f49bf[_0x2c2c('0x4e')]['tags']=_0x3f49bf[_0x2c2c('0x4e')][_0x2c2c('0x61')][_0x2c2c('0x63')](';')+';';}else{_0x3f49bf[_0x2c2c('0x4e')][_0x2c2c('0x61')]=null;}}else{_0x3f49bf[_0x2c2c('0x4e')][_0x2c2c('0x61')]=null;}if(_0x3f49bf[_0x2c2c('0x4e')]&&_[_0x2c2c('0x62')](_0x3f49bf[_0x2c2c('0x4e')])){for(var _0x2f4015=0x0;_0x2f4015<_0x3f49bf[_0x2c2c('0x4e')][_0x2c2c('0x5d')];_0x2f4015+=0x1){_0x3f49bf[_0x2c2c('0x4e')][_0x2f4015]['ListId']=_0x3f49bf['params']['id'];_0x4f681f[_0x2c2c('0x64')](_0x3f49bf[_0x2c2c('0x4e')][_0x2f4015]);}return BPromise[_0x2c2c('0x65')](_0x4f681f,function(_0x52dd2e){return db[_0x2c2c('0x66')]['create'](_[_0x2c2c('0x67')](_0x52dd2e,[_0x2c2c('0x5f'),'id'])||{},{'fields':_[_0x2c2c('0x36')](_0x6db115),'raw':!![]})[_0x2c2c('0x28')](function(_0x43d355){_0x4f06c4[_0x2c2c('0x68')][_0x2c2c('0x64')](_0x43d355[_0x2c2c('0x69')]);})[_0x2c2c('0x4c')](function(_0x211092){_0x4f06c4['errors'][_0x2c2c('0x64')]({'data':_0x52dd2e,'error':_0x211092[_0x2c2c('0x6a')]});});})['then'](function(_0x3eb282){return _0x4f06c4;})[_0x2c2c('0x4c')](function(_0xaf68ea){return _0xaf68ea;});}else{_0x3d0984[_0x2c2c('0x1c')](0x190)[_0x2c2c('0x1e')]({'message':_0x2c2c('0x6b')});}});}})['then'](respondWithResult(_0x3d0984,null))[_0x2c2c('0x4c')](handleError(_0x3d0984,null));};exports[_0x2c2c('0x6c')]=function(_0x2f301e,_0xed0de0,_0x8f8484){var _0x7e113f;return db['CmList']['find']({'where':{'id':_0x2f301e['params']['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x2c2c('0x28')](handleEntityNotFound(_0xed0de0,null))[_0x2c2c('0x28')](function(_0x18bbf9){if(_0x18bbf9){_0x7e113f=_0x18bbf9;return db[_0x2c2c('0x66')][_0x2c2c('0x4b')];}})[_0x2c2c('0x28')](function(_0x44be40){if(_0x44be40){var _0x13c944={};var _0xb27446={};_0xb27446[_0x2c2c('0x39')]=_['concat'](_[_0x2c2c('0x36')](_0x44be40),_['map'](_0x7e113f[_0x2c2c('0x6d')],function(_0x37281c){return util['format'](_0x2c2c('0x6e'),_0x37281c['id']);}));_0xb27446[_0x2c2c('0x35')]=_[_0x2c2c('0x36')](_0x2f301e[_0x2c2c('0x35')]);_0xb27446[_0x2c2c('0x37')]=_[_0x2c2c('0x38')](_0xb27446[_0x2c2c('0x39')],_0xb27446[_0x2c2c('0x35')]);_0x13c944['attributes']=_[_0x2c2c('0x38')](_0xb27446[_0x2c2c('0x39')],qs[_0x2c2c('0x3a')](_0x2f301e[_0x2c2c('0x35')][_0x2c2c('0x3a')]));_0x13c944[_0x2c2c('0x3b')]=_0x13c944[_0x2c2c('0x3b')]['length']?_0x13c944[_0x2c2c('0x3b')]:_0xb27446[_0x2c2c('0x39')];if(!_0x2f301e['query'][_0x2c2c('0x3c')](_0x2c2c('0x3d'))){_0x13c944['limit']=qs['limit'](_0x2f301e['query'][_0x2c2c('0x22')]);_0x13c944['offset']=qs[_0x2c2c('0x1f')](_0x2f301e[_0x2c2c('0x35')][_0x2c2c('0x1f')]);}_0x13c944[_0x2c2c('0x3e')]=qs[_0x2c2c('0x3f')](_0x2f301e['query'][_0x2c2c('0x3f')]);_0x13c944['where']=qs['filters'](_['pick'](_0x2f301e[_0x2c2c('0x35')],_0xb27446[_0x2c2c('0x37')]));_0x13c944['raw']=!![];if(_0x2f301e['query']['filter']){_0x13c944['where']=_['merge'](_0x13c944[_0x2c2c('0x44')],{'$or':_[_0x2c2c('0x31')](_0x13c944['attributes'],function(_0x12c29f){var _0x1705a2={};_0x1705a2[_0x12c29f]={'$like':'%'+_0x2f301e[_0x2c2c('0x35')][_0x2c2c('0x41')]+'%'};return _0x1705a2;})});}_0x13c944=_['merge']({},_0x13c944,_0x2f301e[_0x2c2c('0x43')]);return _0x7e113f[_0x2c2c('0x6c')](_0x13c944);}})[_0x2c2c('0x28')](respondWithResult(_0xed0de0,null))[_0x2c2c('0x4c')](handleError(_0xed0de0,null));};exports[_0x2c2c('0x6f')]=function(_0x5b31db,_0x19a0d6,_0x474a85){var _0x57b995;var _0x5a16b1;var _0x11fb74;var _0x480315=_0x5b31db[_0x2c2c('0x4a')]['id'];csv_results=[];return db[_0x2c2c('0x70')][_0x2c2c('0x48')]({'attributes':['id','name'],'raw':!![],'order':[_0x2c2c('0x71')]})[_0x2c2c('0x28')](function(_0x318aaa){_0x57b995=_0x318aaa;var _0x13014c=_[_0x2c2c('0x36')](db['CmContact'][_0x2c2c('0x4b')]);return db['CmCustomField'][_0x2c2c('0x48')]({'raw':!![],'attributes':['id',_0x2c2c('0x72')]})[_0x2c2c('0x28')](function(_0x3dd7c2){_0x5a16b1=_0x3dd7c2;var _0x4a685a=squel[_0x2c2c('0x73')]()[_0x2c2c('0x3a')](_0x13014c)[_0x2c2c('0x74')](_0x2c2c('0x75'),'c')[_0x2c2c('0x44')](_0x2c2c('0x76'),_0x480315)[_0x2c2c('0x44')](_0x2c2c('0x77'))[_0x2c2c('0x78')]();for(var _0x46a575=0x0;_0x46a575<_0x5a16b1[_0x2c2c('0x5d')];_0x46a575++){_0x4a685a[_0x2c2c('0x79')](_0x2c2c('0x7a')+_0x5a16b1[_0x46a575]['id'],'customField_'+_0x5a16b1[_0x46a575]['alias']);}for(var _0x46a575=0x0;_0x46a575<_0x57b995[_0x2c2c('0x5d')];_0x46a575++){_0x4a685a[_0x2c2c('0x79')](squel[_0x2c2c('0x73')]()[_0x2c2c('0x79')]('item')[_0x2c2c('0x74')](_0x2c2c('0x7b'))[_0x2c2c('0x44')](_0x2c2c('0x7c'),_0x57b995[_0x46a575]['id'])[_0x2c2c('0x44')]('CmContactId\x20=\x20c.id'),_0x2c2c('0x7d')+_0x57b995[_0x46a575][_0x2c2c('0x2e')]);_0x4a685a[_0x2c2c('0x79')](squel['select']()['field'](_0x2c2c('0x7e'))[_0x2c2c('0x74')](_0x2c2c('0x7b'))[_0x2c2c('0x44')](_0x2c2c('0x7c'),_0x57b995[_0x46a575]['id'])[_0x2c2c('0x44')](_0x2c2c('0x7f')),_0x2c2c('0x80')+_0x57b995[_0x46a575]['name']);}var _0x4237b3=[];_0x4237b3[_0x2c2c('0x64')](_0x4a685a[_0x2c2c('0x81')]());BPromise[_0x2c2c('0x65')](_0x4237b3,handleQuery)[_0x2c2c('0x28')](function(_0x4cbed0){handleQuery(_0x4a685a[_0x2c2c('0x81')]());var _0x5c709d=csv_results[0x0];if(!_['isEmpty'](_0x5c709d)){var _0x4b992b=toCsv(_0x5c709d);var _0x1a76f9=Date[_0x2c2c('0x82')]();fs[_0x2c2c('0x83')](util['format'](_0x2c2c('0x84'),_0x480315,_0x1a76f9),_0x4b992b);_0x19a0d6[_0x2c2c('0x85')]('Content-disposition',_0x2c2c('0x86')+util[_0x2c2c('0x87')](_0x2c2c('0x88'),_0x480315,_0x1a76f9));_0x19a0d6[_0x2c2c('0x85')](_0x2c2c('0x89'),_0x2c2c('0x8a'));return _0x19a0d6[_0x2c2c('0x8b')](util[_0x2c2c('0x87')](_0x2c2c('0x84'),_0x480315,_0x1a76f9));}else{return _0x19a0d6['sendStatus'](0xcc);}});});});};exports[_0x2c2c('0x8c')]=function(_0x1c464c,_0x1fba8f,_0x2f2c82){var _0x4a5775;delete _0x1c464c['body']['id'];return db[_0x2c2c('0x45')]['findOne']({'where':{'id':_0x1c464c['params']['id']}})['then'](handleEntityNotFound(_0x1fba8f,null))[_0x2c2c('0x28')](function(_0x583546){if(_0x583546){return db[_0x2c2c('0x8d')][_0x2c2c('0x8e')](function(_0x30a6fe){return db['CmCustomField']['create'](_0x1c464c[_0x2c2c('0x4e')],{'transaction':_0x30a6fe})[_0x2c2c('0x28')](function(_0x5d97e0){_0x4a5775=_0x5d97e0;return _0x583546[_0x2c2c('0x8f')](_0x5d97e0,{'transaction':_0x30a6fe});})['then'](function(){var _0x5acbf3={'type':db['Sequelize'][_0x2c2c('0x90')],'transaction':_0x30a6fe};switch(_0x1c464c[_0x2c2c('0x4e')]['type']){case _0x2c2c('0x91'):_0x5acbf3[_0x2c2c('0x33')]=db[_0x2c2c('0x92')][_0x2c2c('0x90')];break;case _0x2c2c('0x93'):_0x5acbf3[_0x2c2c('0x33')]=db[_0x2c2c('0x92')][_0x2c2c('0x94')];break;case _0x2c2c('0x95'):_0x5acbf3[_0x2c2c('0x33')]=db[_0x2c2c('0x92')][_0x2c2c('0x96')];_0x5acbf3[_0x2c2c('0x97')]=![];break;default:}return db[_0x2c2c('0x8d')][_0x2c2c('0x98')][_0x2c2c('0x99')](_0x2c2c('0x75'),util[_0x2c2c('0x87')]('cf_%s',_0x4a5775['id']),_0x5acbf3);})[_0x2c2c('0x28')](function(){return _0x4a5775;});});}})['then'](respondWithResult(_0x1fba8f,null))[_0x2c2c('0x4c')](handleError(_0x1fba8f,null));};exports[_0x2c2c('0x9a')]=function(_0x5191c7,_0x81a8df,_0x7487a6){var _0x1eb846={};var _0x180d68={};var _0x341557;var _0x31fe82;return db['CmList'][_0x2c2c('0x5c')]({'where':{'id':_0x5191c7[_0x2c2c('0x4a')]['id']}})[_0x2c2c('0x28')](handleEntityNotFound(_0x81a8df,null))[_0x2c2c('0x28')](function(_0xbddc88){if(_0xbddc88){_0x341557=_0xbddc88;_0x180d68[_0x2c2c('0x39')]=_[_0x2c2c('0x36')](db['CmCustomField'][_0x2c2c('0x4b')]);_0x180d68[_0x2c2c('0x35')]=_[_0x2c2c('0x36')](_0x5191c7[_0x2c2c('0x35')]);_0x180d68[_0x2c2c('0x37')]=_[_0x2c2c('0x38')](_0x180d68[_0x2c2c('0x39')],_0x180d68[_0x2c2c('0x35')]);_0x1eb846[_0x2c2c('0x3b')]=_[_0x2c2c('0x38')](_0x180d68[_0x2c2c('0x39')],qs[_0x2c2c('0x3a')](_0x5191c7[_0x2c2c('0x35')][_0x2c2c('0x3a')]));_0x1eb846['attributes']=_0x1eb846[_0x2c2c('0x3b')][_0x2c2c('0x5d')]?_0x1eb846[_0x2c2c('0x3b')]:_0x180d68[_0x2c2c('0x39')];_0x1eb846[_0x2c2c('0x3e')]=qs[_0x2c2c('0x3f')](_0x5191c7[_0x2c2c('0x35')]['sort']);_0x1eb846[_0x2c2c('0x44')]=qs[_0x2c2c('0x37')](_[_0x2c2c('0x40')](_0x5191c7['query'],_0x180d68[_0x2c2c('0x37')]));_0x1eb846['where']=_['merge'](_0x1eb846[_0x2c2c('0x44')],{'$or':[{'ListId':_0xbddc88['id']},{'ListId':null}]});if(_0x5191c7[_0x2c2c('0x35')][_0x2c2c('0x41')]){_0x1eb846[_0x2c2c('0x44')]=_[_0x2c2c('0x42')](_0x1eb846[_0x2c2c('0x44')],{'$or':_[_0x2c2c('0x31')](_0x1eb846['attributes'],function(_0x13aa13){var _0x36f1aa={};_0x36f1aa[_0x13aa13]={'$like':'%'+_0x5191c7['query'][_0x2c2c('0x41')]+'%'};return _0x36f1aa;})});}_0x1eb846=_[_0x2c2c('0x42')]({},_0x1eb846,_0x5191c7[_0x2c2c('0x43')]);return db[_0x2c2c('0x9b')][_0x2c2c('0x9c')](_0x1eb846);}})['then'](respondWithResult(_0x81a8df,null))[_0x2c2c('0x4c')](handleError(_0x81a8df,null));};exports['getGlobalCustomFields']=function(_0x8b3497,_0x4889d3){return db[_0x2c2c('0x9b')]['findAndCountAll']({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x4889d3,null))['then'](function(_0x399722){return _0x399722;})[_0x2c2c('0x28')](respondWithResult(_0x4889d3,null))[_0x2c2c('0x4c')](handleError(_0x4889d3,null));};exports[_0x2c2c('0x9d')]=function(_0x538566,_0x28f87f,_0x538212){return db[_0x2c2c('0x45')]['find']({'where':{'id':_0x538566[_0x2c2c('0x4a')]['id']}})[_0x2c2c('0x28')](handleEntityNotFound(_0x28f87f,null))['then'](function(_0x35b468){if(_0x35b468){return _0x35b468[_0x2c2c('0x9d')](_0x538566[_0x2c2c('0x4e')][_0x2c2c('0x5f')],_[_0x2c2c('0x67')](_0x538566[_0x2c2c('0x4e')],['ids','id'])||{})[_0x2c2c('0x9e')](function(_0x5e2346){for(var _0x1090d2=0x0;_0x1090d2<_0x538566[_0x2c2c('0x4e')]['ids'][_0x2c2c('0x5d')];_0x1090d2+=0x1){socket[_0x2c2c('0x9f')](_0x2c2c('0xa0'),{'UserId':Number(_0x538566[_0x2c2c('0x4e')][_0x2c2c('0x5f')][_0x1090d2]),'CmListId':Number(_0x538566[_0x2c2c('0x4a')]['id'])});}return _0x5e2346;});}})[_0x2c2c('0x28')](respondWithResult(_0x28f87f,null))[_0x2c2c('0x4c')](handleError(_0x28f87f,null));};exports[_0x2c2c('0xa1')]=function(_0xe0070e,_0x353c13,_0x405258){return db['CmList'][_0x2c2c('0x55')]({'where':{'id':_0xe0070e[_0x2c2c('0x4a')]['id']}})[_0x2c2c('0x28')](handleEntityNotFound(_0x353c13,null))[_0x2c2c('0x28')](function(_0x2d2712){if(_0x2d2712){return _0x2d2712['removeAgents'](_0xe0070e[_0x2c2c('0x35')][_0x2c2c('0x5f')])[_0x2c2c('0x28')](function(){if(_[_0x2c2c('0x62')](_0xe0070e[_0x2c2c('0x35')][_0x2c2c('0x5f')])){for(var _0x69464=0x0;_0x69464<_0xe0070e['query'][_0x2c2c('0x5f')]['length'];_0x69464+=0x1){socket[_0x2c2c('0x9f')](_0x2c2c('0xa2'),{'UserId':Number(_0xe0070e[_0x2c2c('0x35')]['ids'][_0x69464]),'CmListId':Number(_0xe0070e[_0x2c2c('0x4a')]['id'])});}}else{socket[_0x2c2c('0x9f')](_0x2c2c('0xa2'),{'UserId':Number(_0xe0070e['query'][_0x2c2c('0x5f')]),'CmListId':Number(_0xe0070e[_0x2c2c('0x4a')]['id'])});}});}})[_0x2c2c('0x28')](respondWithStatusCode(_0x353c13,null))['catch'](handleError(_0x353c13,null));};exports[_0x2c2c('0xa3')]=function(_0x35f415,_0x338c21,_0x252aab){var _0xb2c0b7={};var _0x1dff00={};var _0x35ff9e;var _0x19370e;return db[_0x2c2c('0x45')][_0x2c2c('0x5c')]({'where':{'id':_0x35f415[_0x2c2c('0x4a')]['id']}})[_0x2c2c('0x28')](handleEntityNotFound(_0x338c21,null))[_0x2c2c('0x28')](function(_0x12c774){if(_0x12c774){_0x35ff9e=_0x12c774;_0x1dff00['model']=_['keys'](db['User']['rawAttributes']);_0x1dff00[_0x2c2c('0x35')]=_[_0x2c2c('0x36')](_0x35f415[_0x2c2c('0x35')]);_0x1dff00[_0x2c2c('0x37')]=_[_0x2c2c('0x38')](_0x1dff00[_0x2c2c('0x39')],_0x1dff00[_0x2c2c('0x35')]);_0xb2c0b7['attributes']=_['intersection'](_0x1dff00[_0x2c2c('0x39')],qs['fields'](_0x35f415[_0x2c2c('0x35')][_0x2c2c('0x3a')]));_0xb2c0b7[_0x2c2c('0x3b')]=_0xb2c0b7[_0x2c2c('0x3b')][_0x2c2c('0x5d')]?_0xb2c0b7[_0x2c2c('0x3b')]:_0x1dff00[_0x2c2c('0x39')];_0xb2c0b7[_0x2c2c('0x3e')]=qs[_0x2c2c('0x3f')](_0x35f415['query'][_0x2c2c('0x3f')]);_0xb2c0b7[_0x2c2c('0x44')]=qs[_0x2c2c('0x37')](_[_0x2c2c('0x40')](_0x35f415[_0x2c2c('0x35')],_0x1dff00[_0x2c2c('0x37')]));if(_0x35f415['query'][_0x2c2c('0x41')]){_0xb2c0b7['where']=_['merge'](_0xb2c0b7['where'],{'$or':_[_0x2c2c('0x31')](_0xb2c0b7[_0x2c2c('0x3b')],function(_0x4d79bc){var _0x3ce733={};_0x3ce733[_0x4d79bc]={'$like':'%'+_0x35f415[_0x2c2c('0x35')][_0x2c2c('0x41')]+'%'};return _0x3ce733;})});}_0xb2c0b7=_[_0x2c2c('0x42')]({},_0xb2c0b7,_0x35f415['options']);return _0x35ff9e['getAgents'](_0xb2c0b7);}})[_0x2c2c('0x28')](function(_0x5da018){if(_0x5da018){_0x19370e=_0x5da018[_0x2c2c('0x5d')];if(!_0x35f415[_0x2c2c('0x35')][_0x2c2c('0x3c')](_0x2c2c('0x3d'))){_0xb2c0b7[_0x2c2c('0x22')]=qs['limit'](_0x35f415[_0x2c2c('0x35')][_0x2c2c('0x22')]);_0xb2c0b7[_0x2c2c('0x1f')]=qs[_0x2c2c('0x1f')](_0x35f415[_0x2c2c('0x35')][_0x2c2c('0x1f')]);}return _0x35ff9e[_0x2c2c('0xa3')](_0xb2c0b7);}})[_0x2c2c('0x28')](function(_0x201c01){if(_0x201c01){return _0x201c01?{'count':_0x19370e,'rows':_0x201c01}:null;}})[_0x2c2c('0x28')](respondWithResult(_0x338c21,null))[_0x2c2c('0x4c')](handleError(_0x338c21,null));};function handleQuery(_0x3254b8){logger[_0x2c2c('0xa4')](_0x3254b8);return db['sequelize'][_0x2c2c('0x35')](_0x3254b8)[_0x2c2c('0x9e')](function(_0x20c57c){csv_results[_0x2c2c('0x64')](_0x20c57c);})[_0x2c2c('0x4c')](function(_0x409031){logger[_0x2c2c('0x2c')](_0x409031[_0x2c2c('0x6a')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index c723cc4..3174c95 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 _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x55ca,0x126));var _0xa55c=function(_0x5842c3,_0x56bd74){_0x5842c3=_0x5842c3-0x0;var _0x44bf8c=_0x55ca[_0x5842c3];return _0x44bf8c;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x4c032f,_0x4e744e){_0x4c032f=_0x4c032f-0x0;var _0x533dac=_0x3e74[_0x4c032f];return _0x533dac;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 0aa76ca..630ec28 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 _0xa75b=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','api','moment','bluebird'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0xa75b,0x170));var _0xba75=function(_0x5423fe,_0x92f405){_0x5423fe=_0x5423fe-0x0;var _0x5339cb=_0xa75b[_0x5423fe];return _0x5339cb;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba75('0x1'));var moment=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var rp=require(_0xba75('0x4'));var fs=require('fs');var path=require(_0xba75('0x5'));var rimraf=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var attributes=require(_0xba75('0x8'));module[_0xba75('0x9')]=function(_0x41afc9,_0x2baa28){return _0x41afc9[_0xba75('0xa')](_0xba75('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbec5=['request-promise','path','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','api','moment','bluebird'];(function(_0x3668e2,_0x1e66ae){var _0x345bd7=function(_0x2e7f22){while(--_0x2e7f22){_0x3668e2['push'](_0x3668e2['shift']());}};_0x345bd7(++_0x1e66ae);}(_0xbec5,0xe5));var _0x5bec=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xbec5[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('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 b747471..a02b37c 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 _0x111e=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','request\x20sent','debug','error','code','message','CmList,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x12e13a,_0x3f8461){var _0xf4cf3c=function(_0x54012f){while(--_0x54012f){_0x12e13a['push'](_0x12e13a['shift']());}};_0xf4cf3c(++_0x3f8461);}(_0x111e,0x17e));var _0xe111=function(_0xcde75b,_0x1dfbbd){_0xcde75b=_0xcde75b-0x0;var _0x2dd868=_0x111e[_0xcde75b];return _0x2dd868;};'use strict';var _=require(_0xe111('0x0'));var util=require(_0xe111('0x1'));var moment=require(_0xe111('0x2'));var BPromise=require(_0xe111('0x3'));var rs=require(_0xe111('0x4'));var fs=require('fs');var Redis=require(_0xe111('0x5'));var db=require(_0xe111('0x6'))['db'];var utils=require(_0xe111('0x7'));var logger=require('../../config/logger')(_0xe111('0x8'));var config=require(_0xe111('0x9'));var jayson=require(_0xe111('0xa'));var client=jayson[_0xe111('0xb')][_0xe111('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe111('0xd')],{'host':_0xe111('0xe'),'port':0x18eb});var socket=require(_0xe111('0xf'))(new Redis(config['redis']));require(_0xe111('0x10'))[_0xe111('0x11')](socket);function respondWithRpcPromise(_0x306451,_0xa585ce,_0x20585c){return new BPromise(function(_0x422211,_0x49978b){return client[_0xe111('0x12')](_0x306451,_0x20585c)[_0xe111('0x13')](function(_0x25f429){logger[_0xe111('0x14')]('CmList,\x20%s,\x20%s',_0xa585ce,_0xe111('0x15'));logger[_0xe111('0x16')]('CmList,\x20%s,\x20%s,\x20%s',_0xa585ce,_0xe111('0x15'),JSON['stringify'](_0x25f429));if(_0x25f429[_0xe111('0x17')]){if(_0x25f429['error'][_0xe111('0x18')]===0x1f4){logger[_0xe111('0x17')]('CmList,\x20%s,\x20%s',_0xa585ce,_0x25f429[_0xe111('0x17')][_0xe111('0x19')]);return _0x49978b(_0x25f429[_0xe111('0x17')][_0xe111('0x19')]);}logger[_0xe111('0x17')](_0xe111('0x1a'),_0xa585ce,_0x25f429[_0xe111('0x17')][_0xe111('0x19')]);return _0x422211(_0x25f429[_0xe111('0x17')][_0xe111('0x19')]);}else{logger[_0xe111('0x14')](_0xe111('0x1a'),_0xa585ce,_0xe111('0x15'));_0x422211(_0x25f429[_0xe111('0x1b')][_0xe111('0x19')]);}})['catch'](function(_0x3e9011){logger[_0xe111('0x17')](_0xe111('0x1a'),_0xa585ce,_0x3e9011);_0x49978b(_0x3e9011);});});} \ No newline at end of file +var _0xbbdf=['localhost','socket.io-emitter','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x57086f,_0x2bbedc){var _0x187e86=function(_0x11ca1e){while(--_0x11ca1e){_0x57086f['push'](_0x57086f['shift']());}};_0x187e86(++_0x2bbedc);}(_0xbbdf,0x18d));var _0xfbbd=function(_0x3e6f7d,_0x4f6b24){_0x3e6f7d=_0x3e6f7d-0x0;var _0x7821ef=_0xbbdf[_0x3e6f7d];return _0x7821ef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfbbd('0x0'));var BPromise=require('bluebird');var rs=require(_0xfbbd('0x1'));var fs=require('fs');var Redis=require(_0xfbbd('0x2'));var db=require(_0xfbbd('0x3'))['db'];var utils=require(_0xfbbd('0x4'));var logger=require(_0xfbbd('0x5'))(_0xfbbd('0x6'));var config=require(_0xfbbd('0x7'));var jayson=require(_0xfbbd('0x8'));var client=jayson['client'][_0xfbbd('0x9')]({'port':0x232a});config[_0xfbbd('0xa')]=_['defaults'](config[_0xfbbd('0xa')],{'host':_0xfbbd('0xb'),'port':0x18eb});var socket=require(_0xfbbd('0xc'))(new Redis(config[_0xfbbd('0xa')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x19f60c,_0x5b05c4,_0x394d66){return new BPromise(function(_0x2a5262,_0x453e66){return client[_0xfbbd('0xd')](_0x19f60c,_0x394d66)[_0xfbbd('0xe')](function(_0x3c9407){logger[_0xfbbd('0xf')]('CmList,\x20%s,\x20%s',_0x5b05c4,_0xfbbd('0x10'));logger[_0xfbbd('0x11')](_0xfbbd('0x12'),_0x5b05c4,_0xfbbd('0x10'),JSON[_0xfbbd('0x13')](_0x3c9407));if(_0x3c9407[_0xfbbd('0x14')]){if(_0x3c9407[_0xfbbd('0x14')]['code']===0x1f4){logger[_0xfbbd('0x14')](_0xfbbd('0x15'),_0x5b05c4,_0x3c9407[_0xfbbd('0x14')][_0xfbbd('0x16')]);return _0x453e66(_0x3c9407[_0xfbbd('0x14')][_0xfbbd('0x16')]);}logger[_0xfbbd('0x14')](_0xfbbd('0x15'),_0x5b05c4,_0x3c9407['error']['message']);return _0x2a5262(_0x3c9407['error']['message']);}else{logger[_0xfbbd('0xf')](_0xfbbd('0x15'),_0x5b05c4,_0xfbbd('0x10'));_0x2a5262(_0x3c9407[_0xfbbd('0x17')][_0xfbbd('0x16')]);}})['catch'](function(_0x23735a){logger[_0xfbbd('0x14')](_0xfbbd('0x15'),_0x5b05c4,_0x23735a);_0x453e66(_0x23735a);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 304bdb0..d8c1aef 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 _0x756b=['save','remove','update','length','cmList:','./cmList.events'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x756b,0x137));var _0xb756=function(_0x43cd3f,_0x5b1d58){_0x43cd3f=_0x43cd3f-0x0;var _0x2be696=_0x756b[_0x43cd3f];return _0x2be696;};'use strict';var CmListEvents=require(_0xb756('0x0'));var events=[_0xb756('0x1'),_0xb756('0x2'),_0xb756('0x3')];function createListener(_0x284835,_0x494ec0){return function(_0x374293){_0x494ec0['emit'](_0x284835,_0x374293);};}function removeListener(_0x20c2ec,_0x1d00db){return function(){CmListEvents['removeListener'](_0x20c2ec,_0x1d00db);};}exports['register']=function(_0xdf2c21){for(var _0x4038c6=0x0,_0x318c1b=events[_0xb756('0x4')];_0x4038c6<_0x318c1b;_0x4038c6++){var _0x595489=events[_0x4038c6];var _0x401975=createListener(_0xb756('0x5')+_0x595489,_0xdf2c21);CmListEvents['on'](_0x595489,_0x401975);}}; \ No newline at end of file +var _0xb2de=['register','length','cmList:','./cmList.events','remove','update','emit'];(function(_0x1db831,_0x42b7b5){var _0x39ba56=function(_0x2c2dd3){while(--_0x2c2dd3){_0x1db831['push'](_0x1db831['shift']());}};_0x39ba56(++_0x42b7b5);}(_0xb2de,0x130));var _0xeb2d=function(_0x4523f2,_0x5128f5){_0x4523f2=_0x4523f2-0x0;var _0x5314e1=_0xb2de[_0x4523f2];return _0x5314e1;};'use strict';var CmListEvents=require(_0xeb2d('0x0'));var events=['save',_0xeb2d('0x1'),_0xeb2d('0x2')];function createListener(_0x5346ec,_0x511a78){return function(_0x24702){_0x511a78[_0xeb2d('0x3')](_0x5346ec,_0x24702);};}function removeListener(_0x374fe6,_0xef62e2){return function(){CmListEvents['removeListener'](_0x374fe6,_0xef62e2);};}exports[_0xeb2d('0x4')]=function(_0x4a5e73){for(var _0x818216=0x0,_0x196ba4=events[_0xeb2d('0x5')];_0x818216<_0x196ba4;_0x818216++){var _0x3e4b55=events[_0x818216];var _0x2613ea=createListener(_0xeb2d('0x6')+_0x3e4b55,_0x4a5e73);CmListEvents['on'](_0x3e4b55,_0x2613ea);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 5058395..24afa4c 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 _0xed95=['/:id/contacts','/:id/fields','getCustomFields','getAgents','create','post','addDisposition','addContacts','addCustomField','/:id/users','addAgents','put','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmList.controller','get','index','isAuthenticated','describe','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions'];(function(_0x50aac6,_0x4a5be0){var _0x420596=function(_0x483459){while(--_0x483459){_0x50aac6['push'](_0x50aac6['shift']());}};_0x420596(++_0x4a5be0);}(_0xed95,0x1d0));var _0x5ed9=function(_0x4b1e9d,_0x1ce1cd){_0x4b1e9d=_0x4b1e9d-0x0;var _0x14ebbf=_0xed95[_0x4b1e9d];return _0x14ebbf;};'use strict';var multer=require(_0x5ed9('0x0'));var util=require(_0x5ed9('0x1'));var path=require(_0x5ed9('0x2'));var timeout=require(_0x5ed9('0x3'));var express=require('express');var router=express[_0x5ed9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ed9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5ed9('0x6'));var controller=require(_0x5ed9('0x7'));router[_0x5ed9('0x8')]('/',auth['isAuthenticated'](),controller[_0x5ed9('0x9')]);router[_0x5ed9('0x8')]('/describe',auth[_0x5ed9('0xa')](),controller[_0x5ed9('0xb')]);router[_0x5ed9('0x8')](_0x5ed9('0xc'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0xd')]);router['get'](_0x5ed9('0xe'),auth[_0x5ed9('0xa')](),controller['show']);router[_0x5ed9('0x8')](_0x5ed9('0xf'),auth[_0x5ed9('0xa')](),controller['getDispositions']);router['get'](_0x5ed9('0x10'),auth[_0x5ed9('0xa')](),controller['getContacts']);router[_0x5ed9('0x8')]('/:id/contacts/csv',auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x5ed9('0x8')](_0x5ed9('0x11'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x12')]);router[_0x5ed9('0x8')]('/:id/users',auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x13')]);router['post']('/',auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x14')]);router[_0x5ed9('0x15')](_0x5ed9('0xf'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x16')]);router[_0x5ed9('0x15')]('/:id/contacts',auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x17')]);router[_0x5ed9('0x15')](_0x5ed9('0x11'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x18')]);router['post'](_0x5ed9('0x19'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x1a')]);router[_0x5ed9('0x1b')](_0x5ed9('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x5ed9('0x1c')](_0x5ed9('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x5ed9('0x1c')](_0x5ed9('0xf'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x1d')]);router[_0x5ed9('0x1c')](_0x5ed9('0x19'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x1e')]);module[_0x5ed9('0x1f')]=router; \ No newline at end of file +var _0x7dbe=['destroy','/:id/dispositions','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','getGlobalCustomFields','/:id','show','getDispositions','/:id/contacts','getContacts','getContactsCsv','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','/:id/fields','addCustomField','put','delete'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0x7dbe,0x16d));var _0xe7db=function(_0x1cfcd3,_0x240189){_0x1cfcd3=_0x1cfcd3-0x0;var _0x5b8344=_0x7dbe[_0x1cfcd3];return _0x5b8344;};'use strict';var multer=require(_0xe7db('0x0'));var util=require('util');var path=require(_0xe7db('0x1'));var timeout=require(_0xe7db('0x2'));var express=require(_0xe7db('0x3'));var router=express[_0xe7db('0x4')]();var fs_extra=require(_0xe7db('0x5'));var auth=require(_0xe7db('0x6'));var interaction=require(_0xe7db('0x7'));var config=require(_0xe7db('0x8'));var controller=require('./cmList.controller');router[_0xe7db('0x9')]('/',auth[_0xe7db('0xa')](),controller[_0xe7db('0xb')]);router['get']('/describe',auth[_0xe7db('0xa')](),controller[_0xe7db('0xc')]);router[_0xe7db('0x9')]('/global_fields',auth[_0xe7db('0xa')](),controller[_0xe7db('0xd')]);router[_0xe7db('0x9')](_0xe7db('0xe'),auth['isAuthenticated'](),controller[_0xe7db('0xf')]);router[_0xe7db('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe7db('0x10')]);router[_0xe7db('0x9')](_0xe7db('0x11'),auth[_0xe7db('0xa')](),controller[_0xe7db('0x12')]);router[_0xe7db('0x9')]('/:id/contacts/csv',auth[_0xe7db('0xa')](),controller[_0xe7db('0x13')]);router['get']('/:id/fields',auth[_0xe7db('0xa')](),controller[_0xe7db('0x14')]);router['get'](_0xe7db('0x15'),auth[_0xe7db('0xa')](),controller[_0xe7db('0x16')]);router[_0xe7db('0x17')]('/',auth[_0xe7db('0xa')](),controller[_0xe7db('0x18')]);router[_0xe7db('0x17')]('/:id/dispositions',auth[_0xe7db('0xa')](),controller[_0xe7db('0x19')]);router['post'](_0xe7db('0x11'),auth[_0xe7db('0xa')](),controller[_0xe7db('0x1a')]);router[_0xe7db('0x17')](_0xe7db('0x1b'),auth[_0xe7db('0xa')](),controller[_0xe7db('0x1c')]);router['post'](_0xe7db('0x15'),auth[_0xe7db('0xa')](),controller['addAgents']);router[_0xe7db('0x1d')](_0xe7db('0xe'),auth[_0xe7db('0xa')](),controller['update']);router[_0xe7db('0x1e')](_0xe7db('0xe'),auth['isAuthenticated'](),controller[_0xe7db('0x1f')]);router[_0xe7db('0x1e')](_0xe7db('0x20'),auth[_0xe7db('0xa')](),controller[_0xe7db('0x21')]);router[_0xe7db('0x1e')](_0xe7db('0x15'),auth[_0xe7db('0xa')](),controller[_0xe7db('0x22')]);module[_0xe7db('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index ec3af0d..5082286 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 _0xa4ca=['STRING','sequelize','exports','field'];(function(_0x456be1,_0x248c6e){var _0x43fa66=function(_0x8c0df9){while(--_0x8c0df9){_0x456be1['push'](_0x456be1['shift']());}};_0x43fa66(++_0x248c6e);}(_0xa4ca,0x125));var _0xaa4c=function(_0x203f80,_0x3c390b){_0x203f80=_0x203f80-0x0;var _0x134c89=_0xa4ca[_0x203f80];return _0x134c89;};'use strict';var Sequelize=require(_0xaa4c('0x0'));module[_0xaa4c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2b0b97){return this['getDataValue'](_0xaa4c('0x2'));}},'field':{'type':Sequelize[_0xaa4c('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xaa4c('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xaa4c('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x7e39=['getDataValue','field','STRING','sequelize','exports'];(function(_0x60695e,_0x36a6db){var _0xad577d=function(_0x243e2a){while(--_0x243e2a){_0x60695e['push'](_0x60695e['shift']());}};_0xad577d(++_0x36a6db);}(_0x7e39,0xe4));var _0x97e3=function(_0x581fe1,_0xba5f1e){_0x581fe1=_0x581fe1-0x0;var _0x248a27=_0x7e39[_0x581fe1];return _0x248a27;};'use strict';var Sequelize=require(_0x97e3('0x0'));module[_0x97e3('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2e99f6){return this[_0x97e3('0x2')](_0x97e3('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x97e3('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 19defcc..b9bd6b2 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x2baae9,_0x316d5f){var _0x4be17e=function(_0x3f78cf){while(--_0x3f78cf){_0x2baae9['push'](_0x2baae9['shift']());}};_0x4be17e(++_0x316d5f);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x3bea38,_0x31a4fc){var _0x393b7c=function(_0x3748e6){while(--_0x3748e6){_0x3bea38['push'](_0x3bea38['shift']());}};_0x393b7c(++_0x31a4fc);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 03444c6..66fd254 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 _0x2bcf=['rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','path'];(function(_0x35a83e,_0x694cb1){var _0x718c68=function(_0x21edfa){while(--_0x21edfa){_0x35a83e['push'](_0x35a83e['shift']());}};_0x718c68(++_0x694cb1);}(_0x2bcf,0x13f));var _0xf2bc=function(_0x45138b,_0xec2bd6){_0x45138b=_0x45138b-0x0;var _0x398884=_0x2bcf[_0x45138b];return _0x398884;};'use strict';var _=require(_0xf2bc('0x0'));var util=require(_0xf2bc('0x1'));var logger=require(_0xf2bc('0x2'))(_0xf2bc('0x3'));var moment=require(_0xf2bc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2bc('0x5'));var rimraf=require(_0xf2bc('0x6'));var config=require(_0xf2bc('0x7'));var attributes=require(_0xf2bc('0x8'));module[_0xf2bc('0x9')]=function(_0x2867f8,_0x79d7b3){return _0x2867f8[_0xf2bc('0xa')](_0xf2bc('0xb'),attributes,{'tableName':_0xf2bc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2e9=['./condition.attributes','exports','define','tools_conditions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x80ebef,_0x2c37af){var _0x1740bb=function(_0x1a3d5c){while(--_0x1a3d5c){_0x80ebef['push'](_0x80ebef['shift']());}};_0x1740bb(++_0x2c37af);}(_0xf2e9,0x1e4));var _0x9f2e=function(_0x223c45,_0xc41986){_0x223c45=_0x223c45-0x0;var _0x2bb546=_0xf2e9[_0x223c45];return _0x2bb546;};'use strict';var _=require(_0x9f2e('0x0'));var util=require(_0x9f2e('0x1'));var logger=require(_0x9f2e('0x2'))('api');var moment=require(_0x9f2e('0x3'));var BPromise=require(_0x9f2e('0x4'));var rp=require(_0x9f2e('0x5'));var fs=require('fs');var path=require(_0x9f2e('0x6'));var rimraf=require('rimraf');var config=require(_0x9f2e('0x7'));var attributes=require(_0x9f2e('0x8'));module[_0x9f2e('0x9')]=function(_0x213061,_0x5812d2){return _0x213061[_0x9f2e('0xa')]('Condition',attributes,{'tableName':_0x9f2e('0xb'),'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 9131da4..33428b3 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 _0xa71f=['message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Condition,\x20%s,\x20%s'];(function(_0x14304e,_0x509ce1){var _0x308abd=function(_0x2ba84a){while(--_0x2ba84a){_0x14304e['push'](_0x14304e['shift']());}};_0x308abd(++_0x509ce1);}(_0xa71f,0x1b8));var _0xfa71=function(_0x1da808,_0x3e244e){_0x1da808=_0x1da808-0x0;var _0x16335d=_0xa71f[_0x1da808];return _0x16335d;};'use strict';var _=require(_0xfa71('0x0'));var util=require('util');var moment=require(_0xfa71('0x1'));var BPromise=require(_0xfa71('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa71('0x3'));var db=require(_0xfa71('0x4'))['db'];var utils=require(_0xfa71('0x5'));var logger=require(_0xfa71('0x6'))(_0xfa71('0x7'));var config=require(_0xfa71('0x8'));var jayson=require(_0xfa71('0x9'));var client=jayson[_0xfa71('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x551630,_0x5dc4fa,_0x24f7ed){return new BPromise(function(_0x2bdf99,_0x2b58f3){return client[_0xfa71('0xb')](_0x551630,_0x24f7ed)[_0xfa71('0xc')](function(_0x3e941){logger[_0xfa71('0xd')]('Condition,\x20%s,\x20%s',_0x5dc4fa,'request\x20sent');logger[_0xfa71('0xe')](_0xfa71('0xf'),_0x5dc4fa,_0xfa71('0x10'),JSON[_0xfa71('0x11')](_0x3e941));if(_0x3e941[_0xfa71('0x12')]){if(_0x3e941[_0xfa71('0x12')]['code']===0x1f4){logger[_0xfa71('0x12')](_0xfa71('0x13'),_0x5dc4fa,_0x3e941[_0xfa71('0x12')][_0xfa71('0x14')]);return _0x2b58f3(_0x3e941[_0xfa71('0x12')]['message']);}logger[_0xfa71('0x12')](_0xfa71('0x13'),_0x5dc4fa,_0x3e941[_0xfa71('0x12')][_0xfa71('0x14')]);return _0x2bdf99(_0x3e941[_0xfa71('0x12')][_0xfa71('0x14')]);}else{logger[_0xfa71('0xd')](_0xfa71('0x13'),_0x5dc4fa,_0xfa71('0x10'));_0x2bdf99(_0x3e941[_0xfa71('0x15')][_0xfa71('0x14')]);}})[_0xfa71('0x16')](function(_0x130bd7){logger['error'](_0xfa71('0x13'),_0x5dc4fa,_0x130bd7);_0x2b58f3(_0x130bd7);});});} \ No newline at end of file +var _0xc854=['stringify','error','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xc854,0x98));var _0x4c85=function(_0x476bcd,_0x2f6582){_0x476bcd=_0x476bcd-0x0;var _0x47b60f=_0xc854[_0x476bcd];return _0x47b60f;};'use strict';var _=require(_0x4c85('0x0'));var util=require('util');var moment=require(_0x4c85('0x1'));var BPromise=require(_0x4c85('0x2'));var rs=require(_0x4c85('0x3'));var fs=require('fs');var Redis=require(_0x4c85('0x4'));var db=require(_0x4c85('0x5'))['db'];var utils=require(_0x4c85('0x6'));var logger=require('../../config/logger')(_0x4c85('0x7'));var config=require(_0x4c85('0x8'));var jayson=require(_0x4c85('0x9'));var client=jayson[_0x4c85('0xa')][_0x4c85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45cd35,_0x2b0146,_0x22cfc1){return new BPromise(function(_0x3128d8,_0x4fddb8){return client[_0x4c85('0xc')](_0x45cd35,_0x22cfc1)['then'](function(_0x1780b3){logger['info'](_0x4c85('0xd'),_0x2b0146,_0x4c85('0xe'));logger['debug'](_0x4c85('0xf'),_0x2b0146,_0x4c85('0xe'),JSON[_0x4c85('0x10')](_0x1780b3));if(_0x1780b3[_0x4c85('0x11')]){if(_0x1780b3[_0x4c85('0x11')]['code']===0x1f4){logger[_0x4c85('0x11')]('Condition,\x20%s,\x20%s',_0x2b0146,_0x1780b3[_0x4c85('0x11')][_0x4c85('0x12')]);return _0x4fddb8(_0x1780b3[_0x4c85('0x11')][_0x4c85('0x12')]);}logger[_0x4c85('0x11')]('Condition,\x20%s,\x20%s',_0x2b0146,_0x1780b3[_0x4c85('0x11')][_0x4c85('0x12')]);return _0x3128d8(_0x1780b3['error'][_0x4c85('0x12')]);}else{logger[_0x4c85('0x13')](_0x4c85('0xd'),_0x2b0146,'request\x20sent');_0x3128d8(_0x1780b3[_0x4c85('0x14')][_0x4c85('0x12')]);}})['catch'](function(_0x2c6144){logger[_0x4c85('0x11')]('Condition,\x20%s,\x20%s',_0x2b0146,_0x2c6144);_0x4fddb8(_0x2c6144);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 4285b81..84bbf74 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 _0x7a96=['Router','fs-extra','../../components/auth/service','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x36794c,_0xbdcf10){var _0x55ee17=function(_0x4b3a0d){while(--_0x4b3a0d){_0x36794c['push'](_0x36794c['shift']());}};_0x55ee17(++_0xbdcf10);}(_0x7a96,0xb3));var _0x67a9=function(_0x4452a1,_0x1d50fa){_0x4452a1=_0x4452a1-0x0;var _0x2e5604=_0x7a96[_0x4452a1];return _0x2e5604;};'use strict';var multer=require('multer');var util=require(_0x67a9('0x0'));var path=require('path');var timeout=require(_0x67a9('0x1'));var express=require(_0x67a9('0x2'));var router=express[_0x67a9('0x3')]();var fs_extra=require(_0x67a9('0x4'));var auth=require(_0x67a9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x67a9('0x6'));router[_0x67a9('0x7')](_0x67a9('0x8'),auth[_0x67a9('0x9')](),controller[_0x67a9('0xa')]);router[_0x67a9('0xb')]('/:id',auth[_0x67a9('0x9')](),controller[_0x67a9('0xc')]);module[_0x67a9('0xd')]=router; \ No newline at end of file +var _0xb8c8=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete'];(function(_0x162d88,_0x55d07a){var _0x4a0e8b=function(_0x170588){while(--_0x170588){_0x162d88['push'](_0x162d88['shift']());}};_0x4a0e8b(++_0x55d07a);}(_0xb8c8,0x72));var _0x8b8c=function(_0x34b71d,_0xa22af8){_0x34b71d=_0x34b71d-0x0;var _0x5a6ad6=_0xb8c8[_0x34b71d];return _0x5a6ad6;};'use strict';var multer=require('multer');var util=require(_0x8b8c('0x0'));var path=require(_0x8b8c('0x1'));var timeout=require(_0x8b8c('0x2'));var express=require(_0x8b8c('0x3'));var router=express[_0x8b8c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8b8c('0x5'));var interaction=require(_0x8b8c('0x6'));var config=require(_0x8b8c('0x7'));var controller=require(_0x8b8c('0x8'));router[_0x8b8c('0x9')](_0x8b8c('0xa'),auth[_0x8b8c('0xb')](),controller[_0x8b8c('0xc')]);router[_0x8b8c('0xd')](_0x8b8c('0xa'),auth[_0x8b8c('0xb')](),controller[_0x8b8c('0xe')]);module[_0x8b8c('0xf')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 076bebe..2831b31 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf637=['name','INTEGER','sequelize','exports','STRING'];(function(_0x4635d7,_0x22c150){var _0x12e7a3=function(_0x48c708){while(--_0x48c708){_0x4635d7['push'](_0x4635d7['shift']());}};_0x12e7a3(++_0x22c150);}(_0xf637,0x179));var _0x7f63=function(_0x2438b6,_0x842fd7){_0x2438b6=_0x2438b6-0x0;var _0x30bc8d=_0xf637[_0x2438b6];return _0x30bc8d;};'use strict';var Sequelize=require(_0x7f63('0x0'));module[_0x7f63('0x1')]={'name':{'type':Sequelize[_0x7f63('0x2')],'allowNull':![],'unique':_0x7f63('0x3')},'OrderBy':{'type':Sequelize[_0x7f63('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xe234=['name','INTEGER','sequelize','exports','STRING'];(function(_0x407a4d,_0x3b0e10){var _0x5a2aef=function(_0x34f9af){while(--_0x34f9af){_0x407a4d['push'](_0x407a4d['shift']());}};_0x5a2aef(++_0x3b0e10);}(_0xe234,0x1bf));var _0x4e23=function(_0x281195,_0x52fa80){_0x281195=_0x281195-0x0;var _0x5b8e4b=_0xe234[_0x281195];return _0x5b8e4b;};'use strict';var Sequelize=require(_0x4e23('0x0'));module[_0x4e23('0x1')]={'name':{'type':Sequelize[_0x4e23('0x2')],'allowNull':![],'unique':_0x4e23('0x3')},'OrderBy':{'type':Sequelize[_0x4e23('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x4e23('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 10e12a2..898ac7e 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4f4=['json','apply','reject','save','update','then','get','ContactItemTypes','UserProfileResource','destroy','end','sendStatus','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ContactItemType','includeAll','show','include','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range'];(function(_0x4cccdc,_0xe16b38){var _0x50364d=function(_0x1be7ac){while(--_0x1be7ac){_0x4cccdc['push'](_0x4cccdc['shift']());}};_0x50364d(++_0xe16b38);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x4f75e7,_0x2651cb){_0x4f75e7=_0x4f75e7-0x0;var _0x546307=_0xf4f4[_0x4f75e7];return _0x546307;};'use strict';var emlformat=require(_0x4f4f('0x0'));var rimraf=require(_0x4f4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f4f('0x2'));var rp=require(_0x4f4f('0x3'));var moment=require(_0x4f4f('0x4'));var BPromise=require(_0x4f4f('0x5'));var Mustache=require(_0x4f4f('0x6'));var util=require('util');var path=require(_0x4f4f('0x7'));var sox=require('sox');var csv=require(_0x4f4f('0x8'));var ejs=require(_0x4f4f('0x9'));var fs=require('fs');var fs_extra=require(_0x4f4f('0xa'));var _=require(_0x4f4f('0xb'));var squel=require(_0x4f4f('0xc'));var crypto=require(_0x4f4f('0xd'));var jsforce=require(_0x4f4f('0xe'));var deskjs=require(_0x4f4f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4f4f('0x10'));var Papa=require(_0x4f4f('0x11'));var Redis=require(_0x4f4f('0x12'));var authService=require(_0x4f4f('0x13'));var qs=require(_0x4f4f('0x14'));var as=require(_0x4f4f('0x15'));var hardwareService=require(_0x4f4f('0x16'));var logger=require(_0x4f4f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4f4f('0x18'));var licenseUtil=require(_0x4f4f('0x19'));var db=require(_0x4f4f('0x1a'))['db'];function respondWithStatusCode(_0x1b54b0,_0x282031){_0x282031=_0x282031||0xcc;return function(_0x1d7575){if(_0x1d7575){return _0x1b54b0['sendStatus'](_0x282031);}return _0x1b54b0[_0x4f4f('0x1b')](_0x282031)['end']();};}function respondWithResult(_0x216ba8,_0xe7c2d5){_0xe7c2d5=_0xe7c2d5||0xc8;return function(_0x3e16e9){if(_0x3e16e9){return _0x216ba8[_0x4f4f('0x1b')](_0xe7c2d5)['json'](_0x3e16e9);}};}function respondWithFilteredResult(_0x19f2fd,_0x4c68f4){return function(_0x47ab66){if(_0x47ab66){var _0x58de77=typeof _0x4c68f4[_0x4f4f('0x1c')]===_0x4f4f('0x1d')&&typeof _0x4c68f4[_0x4f4f('0x1e')]===_0x4f4f('0x1d');var _0x2d5e5d=_0x47ab66[_0x4f4f('0x1f')];var _0x1245c4=_0x58de77?0x0:_0x4c68f4[_0x4f4f('0x1c')];var _0x929a0b=_0x58de77?_0x47ab66[_0x4f4f('0x1f')]:_0x4c68f4[_0x4f4f('0x1c')]+_0x4c68f4[_0x4f4f('0x1e')];var _0x499277;if(_0x929a0b>=_0x2d5e5d){_0x929a0b=_0x2d5e5d;_0x499277=0xc8;}else{_0x499277=0xce;}_0x19f2fd[_0x4f4f('0x1b')](_0x499277);return _0x19f2fd[_0x4f4f('0x20')](_0x4f4f('0x21'),_0x1245c4+'-'+_0x929a0b+'/'+_0x2d5e5d)[_0x4f4f('0x22')](_0x47ab66);}return null;};}function patchUpdates(_0x302a79){return function(_0x460b4d){try{jsonpatch[_0x4f4f('0x23')](_0x460b4d,_0x302a79,!![]);}catch(_0x3e33d5){return BPromise[_0x4f4f('0x24')](_0x3e33d5);}return _0x460b4d[_0x4f4f('0x25')]();};}function saveUpdates(_0x469a1d,_0x17832f){return function(_0x17984d){if(_0x17984d){return _0x17984d[_0x4f4f('0x26')](_0x469a1d)['then'](function(_0x4f7261){return _0x4f7261;});}return null;};}function removeEntity(_0x525529,_0x272125){return function(_0x43e661){if(_0x43e661){return _0x43e661['destroy']()[_0x4f4f('0x27')](function(){var _0x15859c=_0x43e661[_0x4f4f('0x28')]({'plain':!![]});var _0x2ec92a=_0x4f4f('0x29');return db[_0x4f4f('0x2a')][_0x4f4f('0x2b')]({'where':{'type':_0x2ec92a,'resourceId':_0x15859c['id']}})['then'](function(){return _0x43e661;});})[_0x4f4f('0x27')](function(){_0x525529[_0x4f4f('0x1b')](0xcc)[_0x4f4f('0x2c')]();});}};}function handleEntityNotFound(_0x15c79c,_0x18e864){return function(_0x4ad33d){if(!_0x4ad33d){_0x15c79c[_0x4f4f('0x2d')](0x194);}return _0x4ad33d;};}function handleError(_0xaf3de1,_0x7180f8){_0x7180f8=_0x7180f8||0x1f4;return function(_0x5deda9){logger['error'](_0x5deda9['stack']);if(_0x5deda9[_0x4f4f('0x2e')]){delete _0x5deda9['name'];}_0xaf3de1[_0x4f4f('0x1b')](_0x7180f8)[_0x4f4f('0x2f')](_0x5deda9);};}exports[_0x4f4f('0x30')]=function(_0x5eb7c9,_0x460546){var _0x1b6f53={},_0x5dd5a3={},_0x413b71={'count':0x0,'rows':[]};var _0x1a551a=_[_0x4f4f('0x31')](db['ContactItemType'][_0x4f4f('0x32')],function(_0x343c75){return{'name':_0x343c75['fieldName'],'type':_0x343c75['type'][_0x4f4f('0x33')]};});_0x5dd5a3[_0x4f4f('0x34')]=_[_0x4f4f('0x31')](_0x1a551a,_0x4f4f('0x2e'));_0x5dd5a3[_0x4f4f('0x35')]=_[_0x4f4f('0x36')](_0x5eb7c9[_0x4f4f('0x35')]);_0x5dd5a3[_0x4f4f('0x37')]=_[_0x4f4f('0x38')](_0x5dd5a3[_0x4f4f('0x34')],_0x5dd5a3['query']);_0x1b6f53['attributes']=_[_0x4f4f('0x38')](_0x5dd5a3['model'],qs[_0x4f4f('0x39')](_0x5eb7c9[_0x4f4f('0x35')][_0x4f4f('0x39')]));_0x1b6f53[_0x4f4f('0x3a')]=_0x1b6f53[_0x4f4f('0x3a')][_0x4f4f('0x3b')]?_0x1b6f53[_0x4f4f('0x3a')]:_0x5dd5a3[_0x4f4f('0x34')];if(!_0x5eb7c9[_0x4f4f('0x35')][_0x4f4f('0x3c')](_0x4f4f('0x3d'))){_0x1b6f53[_0x4f4f('0x1e')]=qs['limit'](_0x5eb7c9[_0x4f4f('0x35')][_0x4f4f('0x1e')]);_0x1b6f53[_0x4f4f('0x1c')]=qs[_0x4f4f('0x1c')](_0x5eb7c9[_0x4f4f('0x35')][_0x4f4f('0x1c')]);}_0x1b6f53[_0x4f4f('0x3e')]=qs[_0x4f4f('0x3f')](_0x5eb7c9[_0x4f4f('0x35')]['sort']);_0x1b6f53[_0x4f4f('0x40')]=qs[_0x4f4f('0x37')](_[_0x4f4f('0x41')](_0x5eb7c9['query'],_0x5dd5a3['filters']),_0x1a551a);if(_0x5eb7c9[_0x4f4f('0x35')][_0x4f4f('0x42')]){_0x1b6f53[_0x4f4f('0x40')]=_[_0x4f4f('0x43')](_0x1b6f53[_0x4f4f('0x40')],{'$or':_[_0x4f4f('0x31')](_0x1a551a,function(_0x1c012d){if(_0x1c012d[_0x4f4f('0x44')]!==_0x4f4f('0x45')){var _0x455aa0={};_0x455aa0[_0x1c012d[_0x4f4f('0x2e')]]={'$like':'%'+_0x5eb7c9[_0x4f4f('0x35')]['filter']+'%'};return _0x455aa0;}})});}_0x1b6f53=_[_0x4f4f('0x43')]({},_0x1b6f53,_0x5eb7c9[_0x4f4f('0x46')]);var _0x306ee7={'where':_0x1b6f53[_0x4f4f('0x40')]};return db[_0x4f4f('0x47')]['count'](_0x306ee7)['then'](function(_0x134710){_0x413b71[_0x4f4f('0x1f')]=_0x134710;if(_0x5eb7c9[_0x4f4f('0x35')][_0x4f4f('0x48')]){_0x1b6f53['include']=[{'all':!![]}];}return db[_0x4f4f('0x47')]['findAll'](_0x1b6f53);})[_0x4f4f('0x27')](function(_0x5a7c94){_0x413b71['rows']=_0x5a7c94;return _0x413b71;})[_0x4f4f('0x27')](respondWithFilteredResult(_0x460546,_0x1b6f53))['catch'](handleError(_0x460546,null));};exports[_0x4f4f('0x49')]=function(_0x2af7a7,_0x5e1c20){var _0x220df1={'raw':!![],'where':{'id':_0x2af7a7['params']['id']}},_0x2d8ff6={};_0x2d8ff6[_0x4f4f('0x34')]=_[_0x4f4f('0x36')](db[_0x4f4f('0x47')][_0x4f4f('0x32')]);_0x2d8ff6[_0x4f4f('0x35')]=_[_0x4f4f('0x36')](_0x2af7a7[_0x4f4f('0x35')]);_0x2d8ff6[_0x4f4f('0x37')]=_[_0x4f4f('0x38')](_0x2d8ff6[_0x4f4f('0x34')],_0x2d8ff6[_0x4f4f('0x35')]);_0x220df1[_0x4f4f('0x3a')]=_[_0x4f4f('0x38')](_0x2d8ff6[_0x4f4f('0x34')],qs[_0x4f4f('0x39')](_0x2af7a7['query'][_0x4f4f('0x39')]));_0x220df1['attributes']=_0x220df1['attributes'][_0x4f4f('0x3b')]?_0x220df1[_0x4f4f('0x3a')]:_0x2d8ff6['model'];if(_0x2af7a7[_0x4f4f('0x35')][_0x4f4f('0x48')]){_0x220df1[_0x4f4f('0x4a')]=[{'all':!![]}];}_0x220df1=_[_0x4f4f('0x43')]({},_0x220df1,_0x2af7a7[_0x4f4f('0x46')]);return db['ContactItemType'][_0x4f4f('0x4b')](_0x220df1)[_0x4f4f('0x27')](handleEntityNotFound(_0x5e1c20,null))[_0x4f4f('0x27')](respondWithResult(_0x5e1c20,null))[_0x4f4f('0x4c')](handleError(_0x5e1c20,null));};exports[_0x4f4f('0x4d')]=function(_0x433787,_0x29314b){return db[_0x4f4f('0x47')][_0x4f4f('0x4d')](_0x433787['body'],{})[_0x4f4f('0x27')](function(_0xd3b763){var _0x4b33a5=_0x433787['user']['get']({'plain':!![]});if(!_0x4b33a5)throw new Error(_0x4f4f('0x4e'));if(_0x4b33a5[_0x4f4f('0x4f')]===_0x4f4f('0x50')){var _0x5c5077=_0xd3b763[_0x4f4f('0x28')]({'plain':!![]});var _0x5db92e=_0x4f4f('0x29');return db[_0x4f4f('0x51')][_0x4f4f('0x4b')]({'where':{'name':_0x5db92e,'userProfileId':_0x4b33a5[_0x4f4f('0x52')]},'raw':!![]})[_0x4f4f('0x27')](function(_0x1d0867){if(_0x1d0867&&_0x1d0867[_0x4f4f('0x53')]===0x0){return db[_0x4f4f('0x2a')][_0x4f4f('0x4d')]({'name':_0x5c5077['name'],'resourceId':_0x5c5077['id'],'type':_0x1d0867['name'],'sectionId':_0x1d0867['id']},{})[_0x4f4f('0x27')](function(){return _0xd3b763;});}else{return _0xd3b763;}})[_0x4f4f('0x4c')](function(_0x4c04eb){logger['error'](_0x4f4f('0x54'),_0x4c04eb);throw _0x4c04eb;});}return _0xd3b763;})[_0x4f4f('0x27')](respondWithResult(_0x29314b,0xc9))[_0x4f4f('0x4c')](handleError(_0x29314b,null));};exports['update']=function(_0x4a7622,_0x27c7fc){if(_0x4a7622[_0x4f4f('0x55')]['id']){delete _0x4a7622[_0x4f4f('0x55')]['id'];}return db[_0x4f4f('0x47')][_0x4f4f('0x4b')]({'where':{'id':_0x4a7622[_0x4f4f('0x56')]['id']}})[_0x4f4f('0x27')](handleEntityNotFound(_0x27c7fc,null))[_0x4f4f('0x27')](saveUpdates(_0x4a7622[_0x4f4f('0x55')],null))[_0x4f4f('0x27')](respondWithResult(_0x27c7fc,null))[_0x4f4f('0x4c')](handleError(_0x27c7fc,null));};exports['destroy']=function(_0x585c06,_0x376aea){return db[_0x4f4f('0x47')][_0x4f4f('0x4b')]({'where':{'id':_0x585c06[_0x4f4f('0x56')]['id']}})['then'](handleEntityNotFound(_0x376aea,null))[_0x4f4f('0x27')](db['CmContactHasItem'][_0x4f4f('0x26')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x585c06[_0x4f4f('0x56')]['id']}}))[_0x4f4f('0x27')](removeEntity(_0x376aea,null))['catch'](handleError(_0x376aea,null));}; \ No newline at end of file +var _0x8952=['name','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','ContactItemTypes','UserProfileResource','stack'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x8952,0x17e));var _0x2895=function(_0x2f1ea8,_0x15cfed){_0x2f1ea8=_0x2f1ea8-0x0;var _0x295de0=_0x8952[_0x2f1ea8];return _0x295de0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2895('0x0'));var zipdir=require(_0x2895('0x1'));var jsonpatch=require(_0x2895('0x2'));var rp=require(_0x2895('0x3'));var moment=require(_0x2895('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2895('0x5'));var util=require(_0x2895('0x6'));var path=require(_0x2895('0x7'));var sox=require('sox');var csv=require(_0x2895('0x8'));var ejs=require(_0x2895('0x9'));var fs=require('fs');var fs_extra=require(_0x2895('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x8'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2895('0x11'));var utils=require(_0x2895('0x12'));var config=require(_0x2895('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2895('0x14'))['db'];function respondWithStatusCode(_0x3924be,_0x4b1342){_0x4b1342=_0x4b1342||0xcc;return function(_0x32574c){if(_0x32574c){return _0x3924be[_0x2895('0x15')](_0x4b1342);}return _0x3924be['status'](_0x4b1342)['end']();};}function respondWithResult(_0x1d1493,_0x2ca2ac){_0x2ca2ac=_0x2ca2ac||0xc8;return function(_0x5777a0){if(_0x5777a0){return _0x1d1493[_0x2895('0x16')](_0x2ca2ac)[_0x2895('0x17')](_0x5777a0);}};}function respondWithFilteredResult(_0x27b50e,_0x1ae013){return function(_0x1d3659){if(_0x1d3659){var _0x2627e6=typeof _0x1ae013[_0x2895('0x18')]===_0x2895('0x19')&&typeof _0x1ae013[_0x2895('0x1a')]===_0x2895('0x19');var _0x10a1bf=_0x1d3659[_0x2895('0x1b')];var _0xbf8b63=_0x2627e6?0x0:_0x1ae013[_0x2895('0x18')];var _0x155124=_0x2627e6?_0x1d3659[_0x2895('0x1b')]:_0x1ae013[_0x2895('0x18')]+_0x1ae013[_0x2895('0x1a')];var _0x5a8eab;if(_0x155124>=_0x10a1bf){_0x155124=_0x10a1bf;_0x5a8eab=0xc8;}else{_0x5a8eab=0xce;}_0x27b50e['status'](_0x5a8eab);return _0x27b50e['set'](_0x2895('0x1c'),_0xbf8b63+'-'+_0x155124+'/'+_0x10a1bf)[_0x2895('0x17')](_0x1d3659);}return null;};}function patchUpdates(_0x3ec4da){return function(_0x593e47){try{jsonpatch[_0x2895('0x1d')](_0x593e47,_0x3ec4da,!![]);}catch(_0x190b79){return BPromise[_0x2895('0x1e')](_0x190b79);}return _0x593e47[_0x2895('0x1f')]();};}function saveUpdates(_0x8b75e0,_0x5dbbfe){return function(_0x30c6c3){if(_0x30c6c3){return _0x30c6c3[_0x2895('0x20')](_0x8b75e0)['then'](function(_0x142e58){return _0x142e58;});}return null;};}function removeEntity(_0x384357,_0x6f8ad4){return function(_0x511286){if(_0x511286){return _0x511286['destroy']()[_0x2895('0x21')](function(){var _0x4569b5=_0x511286[_0x2895('0x22')]({'plain':!![]});var _0x4a21cf=_0x2895('0x23');return db[_0x2895('0x24')]['destroy']({'where':{'type':_0x4a21cf,'resourceId':_0x4569b5['id']}})[_0x2895('0x21')](function(){return _0x511286;});})[_0x2895('0x21')](function(){_0x384357[_0x2895('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x320661,_0x30f491){return function(_0x5eedfc){if(!_0x5eedfc){_0x320661[_0x2895('0x15')](0x194);}return _0x5eedfc;};}function handleError(_0x501898,_0x5d70f5){_0x5d70f5=_0x5d70f5||0x1f4;return function(_0x18a935){logger['error'](_0x18a935[_0x2895('0x25')]);if(_0x18a935[_0x2895('0x26')]){delete _0x18a935['name'];}_0x501898['status'](_0x5d70f5)[_0x2895('0x27')](_0x18a935);};}exports[_0x2895('0x28')]=function(_0x190e07,_0x14e343){var _0x14d150={},_0xa61689={},_0x34e110={'count':0x0,'rows':[]};var _0x546514=_[_0x2895('0x29')](db[_0x2895('0x2a')][_0x2895('0x2b')],function(_0x5546eb){return{'name':_0x5546eb[_0x2895('0x2c')],'type':_0x5546eb[_0x2895('0x2d')][_0x2895('0x2e')]};});_0xa61689[_0x2895('0x2f')]=_['map'](_0x546514,_0x2895('0x26'));_0xa61689[_0x2895('0x30')]=_[_0x2895('0x31')](_0x190e07[_0x2895('0x30')]);_0xa61689[_0x2895('0x32')]=_['intersection'](_0xa61689['model'],_0xa61689[_0x2895('0x30')]);_0x14d150[_0x2895('0x33')]=_['intersection'](_0xa61689[_0x2895('0x2f')],qs['fields'](_0x190e07[_0x2895('0x30')][_0x2895('0x34')]));_0x14d150['attributes']=_0x14d150[_0x2895('0x33')]['length']?_0x14d150[_0x2895('0x33')]:_0xa61689['model'];if(!_0x190e07['query'][_0x2895('0x35')](_0x2895('0x36'))){_0x14d150[_0x2895('0x1a')]=qs['limit'](_0x190e07[_0x2895('0x30')][_0x2895('0x1a')]);_0x14d150[_0x2895('0x18')]=qs[_0x2895('0x18')](_0x190e07[_0x2895('0x30')][_0x2895('0x18')]);}_0x14d150[_0x2895('0x37')]=qs[_0x2895('0x38')](_0x190e07[_0x2895('0x30')][_0x2895('0x38')]);_0x14d150['where']=qs[_0x2895('0x32')](_[_0x2895('0x39')](_0x190e07[_0x2895('0x30')],_0xa61689[_0x2895('0x32')]),_0x546514);if(_0x190e07[_0x2895('0x30')][_0x2895('0x3a')]){_0x14d150[_0x2895('0x3b')]=_['merge'](_0x14d150['where'],{'$or':_[_0x2895('0x29')](_0x546514,function(_0x29dc63){if(_0x29dc63[_0x2895('0x2d')]!==_0x2895('0x3c')){var _0x21bf07={};_0x21bf07[_0x29dc63[_0x2895('0x26')]]={'$like':'%'+_0x190e07['query']['filter']+'%'};return _0x21bf07;}})});}_0x14d150=_[_0x2895('0x3d')]({},_0x14d150,_0x190e07[_0x2895('0x3e')]);var _0x5ce598={'where':_0x14d150['where']};return db[_0x2895('0x2a')][_0x2895('0x1b')](_0x5ce598)[_0x2895('0x21')](function(_0x28967f){_0x34e110[_0x2895('0x1b')]=_0x28967f;if(_0x190e07[_0x2895('0x30')]['includeAll']){_0x14d150[_0x2895('0x3f')]=[{'all':!![]}];}return db[_0x2895('0x2a')][_0x2895('0x40')](_0x14d150);})[_0x2895('0x21')](function(_0x4af6d6){_0x34e110[_0x2895('0x41')]=_0x4af6d6;return _0x34e110;})[_0x2895('0x21')](respondWithFilteredResult(_0x14e343,_0x14d150))[_0x2895('0x42')](handleError(_0x14e343,null));};exports[_0x2895('0x43')]=function(_0x564983,_0x4ef9fe){var _0x46580f={'raw':!![],'where':{'id':_0x564983[_0x2895('0x44')]['id']}},_0x19ce85={};_0x19ce85[_0x2895('0x2f')]=_[_0x2895('0x31')](db['ContactItemType']['rawAttributes']);_0x19ce85[_0x2895('0x30')]=_[_0x2895('0x31')](_0x564983[_0x2895('0x30')]);_0x19ce85[_0x2895('0x32')]=_[_0x2895('0x45')](_0x19ce85[_0x2895('0x2f')],_0x19ce85[_0x2895('0x30')]);_0x46580f['attributes']=_[_0x2895('0x45')](_0x19ce85[_0x2895('0x2f')],qs[_0x2895('0x34')](_0x564983[_0x2895('0x30')][_0x2895('0x34')]));_0x46580f[_0x2895('0x33')]=_0x46580f[_0x2895('0x33')][_0x2895('0x46')]?_0x46580f['attributes']:_0x19ce85[_0x2895('0x2f')];if(_0x564983[_0x2895('0x30')][_0x2895('0x47')]){_0x46580f['include']=[{'all':!![]}];}_0x46580f=_[_0x2895('0x3d')]({},_0x46580f,_0x564983[_0x2895('0x3e')]);return db['ContactItemType'][_0x2895('0x48')](_0x46580f)[_0x2895('0x21')](handleEntityNotFound(_0x4ef9fe,null))[_0x2895('0x21')](respondWithResult(_0x4ef9fe,null))[_0x2895('0x42')](handleError(_0x4ef9fe,null));};exports[_0x2895('0x49')]=function(_0x3cc331,_0x11e53a){return db['ContactItemType'][_0x2895('0x49')](_0x3cc331[_0x2895('0x4a')],{})['then'](function(_0x4e1d47){var _0x574839=_0x3cc331[_0x2895('0x4b')][_0x2895('0x22')]({'plain':!![]});if(!_0x574839)throw new Error(_0x2895('0x4c'));if(_0x574839[_0x2895('0x4d')]===_0x2895('0x4b')){var _0x3c5261=_0x4e1d47[_0x2895('0x22')]({'plain':!![]});var _0x7df911=_0x2895('0x23');return db[_0x2895('0x4e')][_0x2895('0x48')]({'where':{'name':_0x7df911,'userProfileId':_0x574839[_0x2895('0x4f')]},'raw':!![]})[_0x2895('0x21')](function(_0x1481f5){if(_0x1481f5&&_0x1481f5[_0x2895('0x50')]===0x0){return db[_0x2895('0x24')][_0x2895('0x49')]({'name':_0x3c5261[_0x2895('0x26')],'resourceId':_0x3c5261['id'],'type':_0x1481f5[_0x2895('0x26')],'sectionId':_0x1481f5['id']},{})[_0x2895('0x21')](function(){return _0x4e1d47;});}else{return _0x4e1d47;}})[_0x2895('0x42')](function(_0x90ed5d){logger[_0x2895('0x51')](_0x2895('0x52'),_0x90ed5d);throw _0x90ed5d;});}return _0x4e1d47;})[_0x2895('0x21')](respondWithResult(_0x11e53a,0xc9))[_0x2895('0x42')](handleError(_0x11e53a,null));};exports[_0x2895('0x20')]=function(_0x290ed7,_0xc9e24e){if(_0x290ed7[_0x2895('0x4a')]['id']){delete _0x290ed7[_0x2895('0x4a')]['id'];}return db['ContactItemType'][_0x2895('0x48')]({'where':{'id':_0x290ed7[_0x2895('0x44')]['id']}})[_0x2895('0x21')](handleEntityNotFound(_0xc9e24e,null))[_0x2895('0x21')](saveUpdates(_0x290ed7[_0x2895('0x4a')],null))[_0x2895('0x21')](respondWithResult(_0xc9e24e,null))['catch'](handleError(_0xc9e24e,null));};exports[_0x2895('0x53')]=function(_0x5579b3,_0xc31867){return db[_0x2895('0x2a')][_0x2895('0x48')]({'where':{'id':_0x5579b3[_0x2895('0x44')]['id']}})[_0x2895('0x21')](handleEntityNotFound(_0xc31867,null))['then'](db['CmContactHasItem'][_0x2895('0x20')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x5579b3[_0x2895('0x44')]['id']}}))[_0x2895('0x21')](removeEntity(_0xc31867,null))['catch'](handleError(_0xc31867,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index aa0fd93..930b025 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x550e=['moment','bluebird','path','rimraf','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api'];(function(_0x56ebbf,_0xf0e613){var _0x43926e=function(_0x41356a){while(--_0x41356a){_0x56ebbf['push'](_0x56ebbf['shift']());}};_0x43926e(++_0xf0e613);}(_0x550e,0xd8));var _0xe550=function(_0x393685,_0x506ace){_0x393685=_0x393685-0x0;var _0x49f8e5=_0x550e[_0x393685];return _0x49f8e5;};'use strict';var _=require(_0xe550('0x0'));var util=require(_0xe550('0x1'));var logger=require(_0xe550('0x2'))(_0xe550('0x3'));var moment=require(_0xe550('0x4'));var BPromise=require(_0xe550('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe550('0x6'));var rimraf=require(_0xe550('0x7'));var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module['exports']=function(_0x1ac443,_0x3f463f){return _0x1ac443[_0xe550('0x8')](_0xe550('0x9'),attributes,{'tableName':_0xe550('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00bc=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ContactItemType','tools_contact_item_types'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00bc,0x8f));var _0xc00b=function(_0x567583,_0x5401c1){_0x567583=_0x567583-0x0;var _0x4c5901=_0x00bc[_0x567583];return _0x4c5901;};'use strict';var _=require(_0xc00b('0x0'));var util=require(_0xc00b('0x1'));var logger=require(_0xc00b('0x2'))(_0xc00b('0x3'));var moment=require(_0xc00b('0x4'));var BPromise=require(_0xc00b('0x5'));var rp=require(_0xc00b('0x6'));var fs=require('fs');var path=require(_0xc00b('0x7'));var rimraf=require(_0xc00b('0x8'));var config=require(_0xc00b('0x9'));var attributes=require('./contactItemType.attributes');module[_0xc00b('0xa')]=function(_0x181f2d,_0x4f30e7){return _0x181f2d['define'](_0xc00b('0xb'),attributes,{'tableName':_0xc00b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index daa176c..6cc608c 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0219=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','ContactItemType,\x20%s,\x20%s','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x43c5ca,_0x508eb4){var _0x4356b2=function(_0x16aa4a){while(--_0x16aa4a){_0x43c5ca['push'](_0x43c5ca['shift']());}};_0x4356b2(++_0x508eb4);}(_0x0219,0x15a));var _0x9021=function(_0x45e3c7,_0xdaafdb){_0x45e3c7=_0x45e3c7-0x0;var _0x21a2ce=_0x0219[_0x45e3c7];return _0x21a2ce;};'use strict';var _=require(_0x9021('0x0'));var util=require(_0x9021('0x1'));var moment=require(_0x9021('0x2'));var BPromise=require(_0x9021('0x3'));var rs=require(_0x9021('0x4'));var fs=require('fs');var Redis=require(_0x9021('0x5'));var db=require(_0x9021('0x6'))['db'];var utils=require(_0x9021('0x7'));var logger=require('../../config/logger')(_0x9021('0x8'));var config=require('../../config/environment');var jayson=require(_0x9021('0x9'));var client=jayson[_0x9021('0xa')][_0x9021('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16e5c0,_0x10b904,_0x3d8a0f){return new BPromise(function(_0x1d17fc,_0x20d8a6){return client[_0x9021('0xc')](_0x16e5c0,_0x3d8a0f)['then'](function(_0xe58432){logger[_0x9021('0xd')](_0x9021('0xe'),_0x10b904,'request\x20sent');logger['debug'](_0x9021('0xf'),_0x10b904,_0x9021('0x10'),JSON[_0x9021('0x11')](_0xe58432));if(_0xe58432[_0x9021('0x12')]){if(_0xe58432[_0x9021('0x12')][_0x9021('0x13')]===0x1f4){logger[_0x9021('0x12')]('ContactItemType,\x20%s,\x20%s',_0x10b904,_0xe58432[_0x9021('0x12')]['message']);return _0x20d8a6(_0xe58432[_0x9021('0x12')][_0x9021('0x14')]);}logger[_0x9021('0x12')](_0x9021('0xe'),_0x10b904,_0xe58432[_0x9021('0x12')]['message']);return _0x1d17fc(_0xe58432['error'][_0x9021('0x14')]);}else{logger[_0x9021('0xd')](_0x9021('0xe'),_0x10b904,_0x9021('0x10'));_0x1d17fc(_0xe58432[_0x9021('0x15')][_0x9021('0x14')]);}})[_0x9021('0x16')](function(_0x2eae88){logger['error'](_0x9021('0xe'),_0x10b904,_0x2eae88);_0x20d8a6(_0x2eae88);});});} \ No newline at end of file +var _0xebea=['message','result','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x392d98,_0x28eda5){var _0x3406c5=function(_0x3c43da){while(--_0x3c43da){_0x392d98['push'](_0x392d98['shift']());}};_0x3406c5(++_0x28eda5);}(_0xebea,0xec));var _0xaebe=function(_0x5c7241,_0x206be3){_0x5c7241=_0x5c7241-0x0;var _0xbcd3cc=_0xebea[_0x5c7241];return _0xbcd3cc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xaebe('0x0'));var rs=require(_0xaebe('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaebe('0x2'));var logger=require(_0xaebe('0x3'))('rpc');var config=require(_0xaebe('0x4'));var jayson=require(_0xaebe('0x5'));var client=jayson[_0xaebe('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x424ac5,_0x1067a8,_0x3716c8){return new BPromise(function(_0x8cc13b,_0x102829){return client[_0xaebe('0x7')](_0x424ac5,_0x3716c8)[_0xaebe('0x8')](function(_0x482992){logger[_0xaebe('0x9')](_0xaebe('0xa'),_0x1067a8,'request\x20sent');logger['debug'](_0xaebe('0xb'),_0x1067a8,_0xaebe('0xc'),JSON[_0xaebe('0xd')](_0x482992));if(_0x482992[_0xaebe('0xe')]){if(_0x482992[_0xaebe('0xe')][_0xaebe('0xf')]===0x1f4){logger['error'](_0xaebe('0xa'),_0x1067a8,_0x482992['error'][_0xaebe('0x10')]);return _0x102829(_0x482992['error'][_0xaebe('0x10')]);}logger['error'](_0xaebe('0xa'),_0x1067a8,_0x482992['error']['message']);return _0x8cc13b(_0x482992[_0xaebe('0xe')][_0xaebe('0x10')]);}else{logger[_0xaebe('0x9')](_0xaebe('0xa'),_0x1067a8,'request\x20sent');_0x8cc13b(_0x482992[_0xaebe('0x11')]['message']);}})['catch'](function(_0x521971){logger['error'](_0xaebe('0xa'),_0x1067a8,_0x521971);_0x102829(_0x521971);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 324e45d..2769ef7 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5526=['fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x1691ae,_0x17bdc1){var _0x4d8511=function(_0x35b521){while(--_0x35b521){_0x1691ae['push'](_0x1691ae['shift']());}};_0x4d8511(++_0x17bdc1);}(_0x5526,0x17c));var _0x6552=function(_0x435348,_0x617493){_0x435348=_0x435348-0x0;var _0x35d479=_0x5526[_0x435348];return _0x35d479;};'use strict';var multer=require('multer');var util=require(_0x6552('0x0'));var path=require(_0x6552('0x1'));var timeout=require(_0x6552('0x2'));var express=require(_0x6552('0x3'));var router=express['Router']();var fs_extra=require(_0x6552('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6552('0x5'));var config=require('../../config/environment');var controller=require('./contactItemType.controller');router[_0x6552('0x6')]('/',auth[_0x6552('0x7')](),controller['index']);router[_0x6552('0x6')](_0x6552('0x8'),auth[_0x6552('0x7')](),controller[_0x6552('0x9')]);router[_0x6552('0xa')]('/',auth['isAuthenticated'](),controller[_0x6552('0xb')]);router[_0x6552('0xc')]('/:id',auth[_0x6552('0x7')](),controller[_0x6552('0xd')]);router['delete'](_0x6552('0x8'),auth['isAuthenticated'](),controller[_0x6552('0xe')]);module[_0x6552('0xf')]=router; \ No newline at end of file +var _0x9867=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','/:id','show','create','put','delete','multer'];(function(_0x118d61,_0x2410d8){var _0x45c03c=function(_0x988f18){while(--_0x988f18){_0x118d61['push'](_0x118d61['shift']());}};_0x45c03c(++_0x2410d8);}(_0x9867,0xed));var _0x7986=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9867[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x7986('0x0'));var util=require('util');var path=require(_0x7986('0x1'));var timeout=require(_0x7986('0x2'));var express=require(_0x7986('0x3'));var router=express[_0x7986('0x4')]();var fs_extra=require(_0x7986('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7986('0x6'));var config=require('../../config/environment');var controller=require('./contactItemType.controller');router['get']('/',auth[_0x7986('0x7')](),controller[_0x7986('0x8')]);router['get'](_0x7986('0x9'),auth[_0x7986('0x7')](),controller[_0x7986('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7986('0xb')]);router[_0x7986('0xc')](_0x7986('0x9'),auth[_0x7986('0x7')](),controller['update']);router[_0x7986('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 89ed99e..30c895d 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(_0x13db9d,_0x5aff8c){var _0x418575=function(_0x457704){while(--_0x457704){_0x13db9d['push'](_0x13db9d['shift']());}};_0x418575(++_0x5aff8c);}(_0x2032,0xd9));var _0x2203=function(_0x4f3d9c,_0x231309){_0x4f3d9c=_0x4f3d9c-0x0;var _0x5d88ff=_0x2032[_0x4f3d9c];return _0x5d88ff;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe706=['STRING','sequelize','exports'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xe706,0xa3));var _0x6e70=function(_0x495c53,_0x5dd58b){_0x495c53=_0x495c53-0x0;var _0x20abe0=_0xe706[_0x495c53];return _0x20abe0;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index ce9dc9b..cd8b489 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 _0x6e06=['../../config/license/util','defaults','redis','localhost','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','CustomDashboards','error','stack','name','send','index','map','Dashboard','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','rawAttributes','keys','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','createdAt','updatedAt','omit','user','autoAssociation','params','iframe','attrUrl','attrs','custom','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','getItems','DashboardItem','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x50e59d,_0x1e83be){var _0x1adddc=function(_0xfceb19){while(--_0xfceb19){_0x50e59d['push'](_0x50e59d['shift']());}};_0x1adddc(++_0x1e83be);}(_0x6e06,0x15d));var _0x66e0=function(_0x50b985,_0x1d0004){_0x50b985=_0x50b985-0x0;var _0x5a5902=_0x6e06[_0x50b985];return _0x5a5902;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x66e0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66e0('0x1'));var rp=require('request-promise');var moment=require(_0x66e0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x66e0('0x3'));var util=require(_0x66e0('0x4'));var path=require(_0x66e0('0x5'));var sox=require(_0x66e0('0x6'));var csv=require(_0x66e0('0x7'));var ejs=require(_0x66e0('0x8'));var fs=require('fs');var fs_extra=require(_0x66e0('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x66e0('0xa'));var jsforce=require(_0x66e0('0xb'));var deskjs=require(_0x66e0('0xc'));var toCsv=require(_0x66e0('0x7'));var querystring=require(_0x66e0('0xd'));var Papa=require(_0x66e0('0xe'));var Redis=require(_0x66e0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x66e0('0x10'));var as=require(_0x66e0('0x11'));var hardwareService=require(_0x66e0('0x12'));var logger=require(_0x66e0('0x13'))(_0x66e0('0x14'));var utils=require(_0x66e0('0x15'));var config=require(_0x66e0('0x16'));var licenseUtil=require(_0x66e0('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x66e0('0x18')](config[_0x66e0('0x19')],{'host':_0x66e0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x66e0('0x1b')](socket);function respondWithStatusCode(_0x5dcf12,_0x5b668d){_0x5b668d=_0x5b668d||0xcc;return function(_0x211c18){if(_0x211c18){return _0x5dcf12[_0x66e0('0x1c')](_0x5b668d);}return _0x5dcf12[_0x66e0('0x1d')](_0x5b668d)['end']();};}function respondWithResult(_0x44d3f5,_0x2674e6){_0x2674e6=_0x2674e6||0xc8;return function(_0x42849b){if(_0x42849b){return _0x44d3f5[_0x66e0('0x1d')](_0x2674e6)[_0x66e0('0x1e')](_0x42849b);}};}function respondWithFilteredResult(_0x4fdbdb,_0xb1fba9){return function(_0x2d5f7f){if(_0x2d5f7f){var _0x4e6520=typeof _0xb1fba9['offset']===_0x66e0('0x1f')&&typeof _0xb1fba9[_0x66e0('0x20')]===_0x66e0('0x1f');var _0x1c9cee=_0x2d5f7f[_0x66e0('0x21')];var _0x2cdc5f=_0x4e6520?0x0:_0xb1fba9['offset'];var _0x44618c=_0x4e6520?_0x2d5f7f[_0x66e0('0x21')]:_0xb1fba9[_0x66e0('0x22')]+_0xb1fba9[_0x66e0('0x20')];var _0x244972;if(_0x44618c>=_0x1c9cee){_0x44618c=_0x1c9cee;_0x244972=0xc8;}else{_0x244972=0xce;}_0x4fdbdb['status'](_0x244972);return _0x4fdbdb[_0x66e0('0x23')](_0x66e0('0x24'),_0x2cdc5f+'-'+_0x44618c+'/'+_0x1c9cee)[_0x66e0('0x1e')](_0x2d5f7f);}return null;};}function patchUpdates(_0x4fb388){return function(_0x2978b7){try{jsonpatch[_0x66e0('0x25')](_0x2978b7,_0x4fb388,!![]);}catch(_0x1b6baf){return BPromise['reject'](_0x1b6baf);}return _0x2978b7[_0x66e0('0x26')]();};}function saveUpdates(_0x31e92c,_0x1d90ae){return function(_0x28c34){if(_0x28c34){return _0x28c34[_0x66e0('0x27')](_0x31e92c)[_0x66e0('0x28')](function(_0x55ff26){return _0x55ff26;});}return null;};}function removeEntity(_0x3b2af9,_0x222384){return function(_0x322c61){if(_0x322c61){return _0x322c61[_0x66e0('0x29')]()[_0x66e0('0x28')](function(){var _0x5adc67=_0x322c61['get']({'plain':!![]});var _0x34c691=_0x66e0('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x34c691,'resourceId':_0x5adc67['id']}})[_0x66e0('0x28')](function(){return _0x322c61;});})[_0x66e0('0x28')](function(){_0x3b2af9[_0x66e0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10568a,_0x21fb6a){return function(_0x114003){if(!_0x114003){_0x10568a[_0x66e0('0x1c')](0x194);}return _0x114003;};}function handleError(_0x2c345e,_0x3973d5){_0x3973d5=_0x3973d5||0x1f4;return function(_0x4d5a05){logger[_0x66e0('0x2b')](_0x4d5a05[_0x66e0('0x2c')]);if(_0x4d5a05[_0x66e0('0x2d')]){delete _0x4d5a05['name'];}_0x2c345e[_0x66e0('0x1d')](_0x3973d5)[_0x66e0('0x2e')](_0x4d5a05);};}exports[_0x66e0('0x2f')]=function(_0x3d44a2,_0x215383){var _0x8bb537={},_0x24c2ae={},_0x2db84c={'count':0x0,'rows':[]};var _0xfe8137=_[_0x66e0('0x30')](db[_0x66e0('0x31')]['rawAttributes'],function(_0x5e9dbe){return{'name':_0x5e9dbe[_0x66e0('0x32')],'type':_0x5e9dbe[_0x66e0('0x33')][_0x66e0('0x34')]};});_0x24c2ae[_0x66e0('0x35')]=_['map'](_0xfe8137,_0x66e0('0x2d'));_0x24c2ae[_0x66e0('0x36')]=_['keys'](_0x3d44a2[_0x66e0('0x36')]);_0x24c2ae[_0x66e0('0x37')]=_[_0x66e0('0x38')](_0x24c2ae[_0x66e0('0x35')],_0x24c2ae[_0x66e0('0x36')]);_0x8bb537[_0x66e0('0x39')]=_[_0x66e0('0x38')](_0x24c2ae[_0x66e0('0x35')],qs[_0x66e0('0x3a')](_0x3d44a2['query'][_0x66e0('0x3a')]));_0x8bb537[_0x66e0('0x39')]=_0x8bb537['attributes'][_0x66e0('0x3b')]?_0x8bb537[_0x66e0('0x39')]:_0x24c2ae[_0x66e0('0x35')];if(!_0x3d44a2[_0x66e0('0x36')][_0x66e0('0x3c')](_0x66e0('0x3d'))){_0x8bb537['limit']=qs[_0x66e0('0x20')](_0x3d44a2[_0x66e0('0x36')][_0x66e0('0x20')]);_0x8bb537[_0x66e0('0x22')]=qs[_0x66e0('0x22')](_0x3d44a2[_0x66e0('0x36')][_0x66e0('0x22')]);}_0x8bb537[_0x66e0('0x3e')]=qs[_0x66e0('0x3f')](_0x3d44a2['query'][_0x66e0('0x3f')]);_0x8bb537['where']=qs[_0x66e0('0x37')](_[_0x66e0('0x40')](_0x3d44a2[_0x66e0('0x36')],_0x24c2ae[_0x66e0('0x37')]),_0xfe8137);if(_0x3d44a2[_0x66e0('0x36')][_0x66e0('0x41')]){_0x8bb537[_0x66e0('0x42')]=_[_0x66e0('0x43')](_0x8bb537['where'],{'$or':_['map'](_0xfe8137,function(_0x34b955){if(_0x34b955[_0x66e0('0x33')]!==_0x66e0('0x44')){var _0x2bbf76={};_0x2bbf76[_0x34b955['name']]={'$like':'%'+_0x3d44a2[_0x66e0('0x36')][_0x66e0('0x41')]+'%'};return _0x2bbf76;}})});}_0x8bb537=_[_0x66e0('0x43')]({},_0x8bb537,_0x3d44a2['options']);var _0x2e0b93={'where':_0x8bb537[_0x66e0('0x42')]};return db['Dashboard'][_0x66e0('0x21')](_0x2e0b93)['then'](function(_0x5727f0){_0x2db84c[_0x66e0('0x21')]=_0x5727f0;if(_0x3d44a2[_0x66e0('0x36')][_0x66e0('0x45')]){_0x8bb537[_0x66e0('0x46')]=[{'all':!![]}];}return db[_0x66e0('0x31')]['findAll'](_0x8bb537);})[_0x66e0('0x28')](function(_0x45924c){_0x2db84c[_0x66e0('0x47')]=_0x45924c;return _0x2db84c;})[_0x66e0('0x28')](respondWithFilteredResult(_0x215383,_0x8bb537))[_0x66e0('0x48')](handleError(_0x215383,null));};exports['show']=function(_0x12d921,_0x2c345a){var _0xe4d50a={'raw':![],'where':{'id':_0x12d921['params']['id']}},_0x5ddeff={};_0x5ddeff[_0x66e0('0x35')]=_['keys'](db[_0x66e0('0x31')][_0x66e0('0x49')]);_0x5ddeff[_0x66e0('0x36')]=_[_0x66e0('0x4a')](_0x12d921[_0x66e0('0x36')]);_0x5ddeff['filters']=_['intersection'](_0x5ddeff[_0x66e0('0x35')],_0x5ddeff[_0x66e0('0x36')]);_0xe4d50a[_0x66e0('0x39')]=_['intersection'](_0x5ddeff[_0x66e0('0x35')],qs[_0x66e0('0x3a')](_0x12d921['query'][_0x66e0('0x3a')]));_0xe4d50a['attributes']=_0xe4d50a[_0x66e0('0x39')][_0x66e0('0x3b')]?_0xe4d50a[_0x66e0('0x39')]:_0x5ddeff[_0x66e0('0x35')];if(_0x12d921[_0x66e0('0x36')][_0x66e0('0x45')]){_0xe4d50a[_0x66e0('0x46')]=[{'all':!![]}];}_0xe4d50a=_[_0x66e0('0x43')]({},_0xe4d50a,_0x12d921['options']);return db[_0x66e0('0x31')][_0x66e0('0x4b')](_0xe4d50a)[_0x66e0('0x28')](handleEntityNotFound(_0x2c345a,null))[_0x66e0('0x28')](respondWithResult(_0x2c345a,null))[_0x66e0('0x48')](handleError(_0x2c345a,null));};exports[_0x66e0('0x4c')]=function(_0xa2b3be,_0x478d36){return db[_0x66e0('0x31')][_0x66e0('0x4c')](_0xa2b3be[_0x66e0('0x4d')],{})[_0x66e0('0x28')](function(_0x146423){var _0x2fbffb=_0xa2b3be['user'][_0x66e0('0x4e')]({'plain':!![]});if(!_0x2fbffb)throw new Error(_0x66e0('0x4f'));if(_0x2fbffb[_0x66e0('0x50')]==='user'){var _0x306bee=_0x146423[_0x66e0('0x4e')]({'plain':!![]});var _0x871e96=_0x66e0('0x2a');return db[_0x66e0('0x51')][_0x66e0('0x4b')]({'where':{'name':_0x871e96,'userProfileId':_0x2fbffb['userProfileId']},'raw':!![]})['then'](function(_0x4fd665){if(_0x4fd665&&_0x4fd665['autoAssociation']===0x0){return db[_0x66e0('0x52')][_0x66e0('0x4c')]({'name':_0x306bee[_0x66e0('0x2d')],'resourceId':_0x306bee['id'],'type':_0x4fd665[_0x66e0('0x2d')],'sectionId':_0x4fd665['id']},{})[_0x66e0('0x28')](function(){return _0x146423;});}else{return _0x146423;}})['catch'](function(_0x11c619){logger[_0x66e0('0x2b')](_0x66e0('0x53'),_0x11c619);throw _0x11c619;});}return _0x146423;})['then'](respondWithResult(_0x478d36,0xc9))[_0x66e0('0x48')](handleError(_0x478d36,null));};exports[_0x66e0('0x54')]=function(_0x2b17cd,_0x40425a){var _0x3ab520={'where':{'id':_0x2b17cd['params']['id']}},_0x3c8c71={};_0x3c8c71[_0x66e0('0x35')]=_['keys'](db[_0x66e0('0x31')][_0x66e0('0x49')]);_0x3ab520['attributes']=_[_0x66e0('0x38')](_0x3c8c71[_0x66e0('0x35')],qs['fields'](_0x2b17cd[_0x66e0('0x36')]['fields']));_0x3ab520['attributes']=_0x3ab520['attributes'][_0x66e0('0x3b')]?_0x3ab520[_0x66e0('0x39')]:_0x3c8c71[_0x66e0('0x35')];if(_0x2b17cd['query'][_0x66e0('0x45')]){_0x3ab520[_0x66e0('0x46')]=[{'all':!![]}];}_0x3ab520=_[_0x66e0('0x43')]({},_0x3ab520,_0x2b17cd[_0x66e0('0x55')]);return db[_0x66e0('0x31')]['find'](_0x3ab520)['then'](handleEntityNotFound(_0x40425a,null))[_0x66e0('0x28')](function(_0x4df93c){if(_0x4df93c){var _0x2e9781=_0x4df93c[_0x66e0('0x4e')]({'plain':!![]});_0x2e9781=qs['omit'](_0x2e9781,['id',_0x66e0('0x56'),_0x66e0('0x57')]);_0x2b17cd[_0x66e0('0x4d')]=_[_0x66e0('0x58')](_0x2b17cd[_0x66e0('0x4d')],['id',_0x66e0('0x56'),'updatedAt']);return db[_0x66e0('0x31')][_0x66e0('0x4c')](_[_0x66e0('0x43')](_0x2e9781,_0x2b17cd[_0x66e0('0x4d')]),{'include':_0x2b17cd[_0x66e0('0x36')][_0x66e0('0x45')]?[{'all':!![]}]:undefined})[_0x66e0('0x28')](function(_0x226d0c){var _0x161964=_0x2b17cd['user'][_0x66e0('0x4e')]({'plain':!![]});if(!_0x161964)throw new Error(_0x66e0('0x4f'));if(_0x161964['role']===_0x66e0('0x59')){var _0x525471=_0x226d0c[_0x66e0('0x4e')]({'plain':!![]});var _0x20794e=_0x66e0('0x2a');return db[_0x66e0('0x51')][_0x66e0('0x4b')]({'where':{'name':_0x20794e,'userProfileId':_0x161964['userProfileId']},'raw':!![]})[_0x66e0('0x28')](function(_0x54ad0b){if(_0x54ad0b&&_0x54ad0b[_0x66e0('0x5a')]===0x0){return db[_0x66e0('0x52')][_0x66e0('0x4c')]({'name':_0x525471[_0x66e0('0x2d')],'resourceId':_0x525471['id'],'type':_0x54ad0b['name'],'sectionId':_0x54ad0b['id']},{})[_0x66e0('0x28')](function(){return _0x226d0c;});}else{return _0x226d0c;}})[_0x66e0('0x48')](function(_0x1e416f){logger[_0x66e0('0x2b')](_0x66e0('0x53'),_0x1e416f);throw _0x1e416f;});}return _0x226d0c;});}})[_0x66e0('0x28')](respondWithResult(_0x40425a,0xc9))[_0x66e0('0x48')](handleError(_0x40425a,null));};exports[_0x66e0('0x27')]=function(_0xba9b2,_0x5549e8){if(_0xba9b2['body']['id']){delete _0xba9b2['body']['id'];}return db['Dashboard'][_0x66e0('0x4b')]({'where':{'id':_0xba9b2[_0x66e0('0x5b')]['id']}})[_0x66e0('0x28')](handleEntityNotFound(_0x5549e8,null))['then'](saveUpdates(_0xba9b2[_0x66e0('0x4d')],null))['then'](respondWithResult(_0x5549e8,null))[_0x66e0('0x48')](handleError(_0x5549e8,null));};exports[_0x66e0('0x29')]=function(_0x12927c,_0x5223aa){return db['Dashboard'][_0x66e0('0x4b')]({'where':{'id':_0x12927c['params']['id']}})[_0x66e0('0x28')](handleEntityNotFound(_0x5223aa,null))[_0x66e0('0x28')](removeEntity(_0x5223aa,null))[_0x66e0('0x48')](handleError(_0x5223aa,null));};function widgetAttributes(_0x7751d0){try{switch(_0x7751d0[_0x66e0('0x33')]){case _0x66e0('0x5c'):return[{'name':_0x66e0('0x5d'),'value':_0x7751d0[_0x66e0('0x5d')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x0]?_0x7751d0[_0x66e0('0x5e')][0x0]['value']:undefined)||'https://'}];case _0x66e0('0x5f'):return[{'name':_0x66e0('0x60'),'value':_0x7751d0['attrPath']||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x0]?_0x7751d0[_0x66e0('0x5e')][0x0]['value']:undefined)||''}];case _0x66e0('0x61'):return[{'name':_0x66e0('0x62'),'value':_0x7751d0[_0x66e0('0x62')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x0]?_0x7751d0['attrs'][0x0][_0x66e0('0x63')]:undefined)||_0x66e0('0x64')},{'name':'attrTimezone','value':_0x7751d0['attrTimezone']||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x1]?_0x7751d0['attrs'][0x1][_0x66e0('0x63')]:undefined)||'0.00'},{'name':_0x66e0('0x65'),'value':_0x7751d0['attrFontSize']||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0['attrs'][0x2]?_0x7751d0[_0x66e0('0x5e')][0x2]['value']:undefined)||0xc}];case _0x66e0('0x66'):return[{'name':_0x66e0('0x67'),'value':_0x7751d0[_0x66e0('0x67')]||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x0]?_0x7751d0[_0x66e0('0x5e')][0x0][_0x66e0('0x63')]:undefined)||_0x66e0('0x68')},{'name':_0x66e0('0x69'),'value':_0x7751d0['attrVoiceQueues']||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x1]?_0x7751d0[_0x66e0('0x5e')][0x1][_0x66e0('0x63')]:undefined)||[]},{'name':_0x66e0('0x65'),'value':_0x7751d0[_0x66e0('0x65')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x2]?_0x7751d0[_0x66e0('0x5e')][0x2]['value']:undefined)||0x14},{'name':_0x66e0('0x6a'),'value':_0x7751d0[_0x66e0('0x6a')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x3]?_0x7751d0[_0x66e0('0x5e')][0x3][_0x66e0('0x63')]:undefined)||_0x66e0('0x6b')},{'name':_0x66e0('0x6c'),'value':_0x7751d0[_0x66e0('0x6c')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x4]?_0x7751d0[_0x66e0('0x5e')][0x4][_0x66e0('0x63')]:undefined)||''},{'name':_0x66e0('0x6d'),'value':_0x7751d0[_0x66e0('0x6d')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x5]?_0x7751d0[_0x66e0('0x5e')][0x5][_0x66e0('0x63')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x7751d0[_0x66e0('0x6e')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x6]?_0x7751d0[_0x66e0('0x5e')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x7751d0[_0x66e0('0x6f')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x7]?_0x7751d0[_0x66e0('0x5e')][0x7][_0x66e0('0x63')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x7751d0[_0x66e0('0x70')]||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x8]?_0x7751d0[_0x66e0('0x5e')][0x8][_0x66e0('0x63')]:undefined)||''},{'name':'attrChatWebsites','value':_0x7751d0[_0x66e0('0x71')]||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x9]?_0x7751d0[_0x66e0('0x5e')][0x9]['value']:undefined)||''}];case _0x66e0('0x72'):case'pie-chart':return[{'name':_0x66e0('0x73'),'value':_0x7751d0[_0x66e0('0x73')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0['attrs'][0x0]?_0x7751d0[_0x66e0('0x5e')][0x0][_0x66e0('0x63')]:undefined)||_0x66e0('0x68')},{'name':'attrSerie2','value':_0x7751d0['attrSerie2']||(_0x7751d0['attrs']&&_0x7751d0['attrs'][0x1]?_0x7751d0['attrs'][0x1]['value']:undefined)||null},{'name':_0x66e0('0x74'),'value':_0x7751d0[_0x66e0('0x74')]||(_0x7751d0['attrs']&&_0x7751d0['attrs'][0x2]?_0x7751d0['attrs'][0x2][_0x66e0('0x63')]:undefined)||null},{'name':_0x66e0('0x69'),'value':_0x7751d0['attrVoiceQueues']||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x3]?_0x7751d0[_0x66e0('0x5e')][0x3][_0x66e0('0x63')]:undefined)||[]},{'name':_0x66e0('0x6a'),'value':_0x7751d0[_0x66e0('0x6a')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0['attrs'][0x4]?_0x7751d0[_0x66e0('0x5e')][0x4][_0x66e0('0x63')]:undefined)||_0x66e0('0x6b')},{'name':_0x66e0('0x6c'),'value':_0x7751d0[_0x66e0('0x6c')]||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x5]?_0x7751d0[_0x66e0('0x5e')][0x5][_0x66e0('0x63')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x7751d0[_0x66e0('0x6d')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x6]?_0x7751d0[_0x66e0('0x5e')][0x6][_0x66e0('0x63')]:undefined)||''},{'name':_0x66e0('0x6e'),'value':_0x7751d0[_0x66e0('0x6e')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0['attrs'][0x7]?_0x7751d0[_0x66e0('0x5e')][0x7][_0x66e0('0x63')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x7751d0['attrOpenchannelAccounts']||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x8]?_0x7751d0[_0x66e0('0x5e')][0x8][_0x66e0('0x63')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x7751d0['attrWhatsappAccounts']||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x9]?_0x7751d0['attrs'][0x9]['value']:undefined)||''},{'name':_0x66e0('0x71'),'value':_0x7751d0[_0x66e0('0x71')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0xa]?_0x7751d0['attrs'][0xa][_0x66e0('0x63')]:undefined)||''}];case _0x66e0('0x75'):return[{'name':_0x66e0('0x76'),'type':_0x7751d0[_0x66e0('0x77')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x0]?_0x7751d0['attrs'][0x0][_0x66e0('0x33')]:undefined)||null,'value':_0x7751d0[_0x66e0('0x76')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x0]?_0x7751d0[_0x66e0('0x5e')][0x0][_0x66e0('0x63')]:undefined)||null},{'name':_0x66e0('0x78'),'value':_0x7751d0[_0x66e0('0x78')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x1]?_0x7751d0[_0x66e0('0x5e')][0x1][_0x66e0('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x468c4f){logger[_0x66e0('0x2b')](_0x66e0('0x79'),JSON['stringify'](_0x468c4f));return[];}}exports['addItem']=function(_0x186217,_0x7fbfec,_0x42dbdb){if(_0x186217[_0x66e0('0x4d')]['id']){delete _0x186217['body']['id'];}return db[_0x66e0('0x31')][_0x66e0('0x4b')]({'where':{'id':_0x186217['params']['id']}})[_0x66e0('0x28')](handleEntityNotFound(_0x7fbfec,null))[_0x66e0('0x28')](function(_0x553c7a){if(_0x553c7a){_0x186217[_0x66e0('0x4d')]['DashboardId']=_0x553c7a['id'];_0x186217['body'][_0x66e0('0x5e')]=widgetAttributes(_0x186217[_0x66e0('0x4d')]);return db['DashboardItem'][_0x66e0('0x4c')](_0x186217['body']);}})['then'](respondWithResult(_0x7fbfec,null))[_0x66e0('0x48')](handleError(_0x7fbfec,null));};exports[_0x66e0('0x7a')]=function(_0xc6adcf,_0x1dbf82,_0x54dd1e){var _0xfd4cdc={};var _0x263fde={};var _0x4f7858;var _0x32a60d;return db[_0x66e0('0x31')]['findOne']({'where':{'id':_0xc6adcf[_0x66e0('0x5b')]['id']}})[_0x66e0('0x28')](handleEntityNotFound(_0x1dbf82,null))[_0x66e0('0x28')](function(_0x5e3d2c){if(_0x5e3d2c){_0x4f7858=_0x5e3d2c;_0x263fde[_0x66e0('0x35')]=_[_0x66e0('0x4a')](db[_0x66e0('0x7b')]['rawAttributes']);_0x263fde['query']=_[_0x66e0('0x4a')](_0xc6adcf['query']);_0x263fde['filters']=_['intersection'](_0x263fde[_0x66e0('0x35')],_0x263fde['query']);_0xfd4cdc['attributes']=_[_0x66e0('0x38')](_0x263fde[_0x66e0('0x35')],qs[_0x66e0('0x3a')](_0xc6adcf[_0x66e0('0x36')][_0x66e0('0x3a')]));_0xfd4cdc[_0x66e0('0x39')]=_0xfd4cdc[_0x66e0('0x39')]['length']?_0xfd4cdc[_0x66e0('0x39')]:_0x263fde['model'];_0xfd4cdc[_0x66e0('0x3e')]=qs[_0x66e0('0x3f')](_0xc6adcf[_0x66e0('0x36')][_0x66e0('0x3f')]);_0xfd4cdc[_0x66e0('0x42')]=qs[_0x66e0('0x37')](_['pick'](_0xc6adcf[_0x66e0('0x36')],_0x263fde[_0x66e0('0x37')]));if(_0xc6adcf['query'][_0x66e0('0x41')]){_0xfd4cdc[_0x66e0('0x42')]=_[_0x66e0('0x43')](_0xfd4cdc['where'],{'$or':_[_0x66e0('0x30')](_0xfd4cdc[_0x66e0('0x39')],function(_0x2ed432){var _0x312890={};_0x312890[_0x2ed432]={'$like':'%'+_0xc6adcf[_0x66e0('0x36')][_0x66e0('0x41')]+'%'};return _0x312890;})});}_0xfd4cdc=_['merge']({},_0xfd4cdc,_0xc6adcf[_0x66e0('0x55')]);return _0x4f7858[_0x66e0('0x7a')](_0xfd4cdc);}})[_0x66e0('0x28')](function(_0x342594){if(_0x342594){_0x32a60d=_0x342594[_0x66e0('0x3b')];if(!_0xc6adcf['query']['hasOwnProperty']('nolimit')){_0xfd4cdc[_0x66e0('0x20')]=qs[_0x66e0('0x20')](_0xc6adcf[_0x66e0('0x36')][_0x66e0('0x20')]);_0xfd4cdc[_0x66e0('0x22')]=qs[_0x66e0('0x22')](_0xc6adcf[_0x66e0('0x36')][_0x66e0('0x22')]);}return _0x4f7858['getItems'](_0xfd4cdc);}})[_0x66e0('0x28')](function(_0x4f64b9){if(_0x4f64b9){return _0x4f64b9?{'count':_0x32a60d,'rows':_0x4f64b9}:null;}})[_0x66e0('0x28')](respondWithResult(_0x1dbf82,null))[_0x66e0('0x48')](handleError(_0x1dbf82,null));}; \ No newline at end of file +var _0x2eee=['request-promise','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboard.socket','register','status','json','offset','limit','undefined','count','set','reject','save','update','then','get','UserProfileResource','end','name','send','index','map','Dashboard','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','length','nolimit','sort','where','merge','options','includeAll','findAll','params','keys','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CustomDashboards','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','destroy','iframe','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','attrChannel','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrVoiceQueues','voice','attrFaxAccounts','web-report','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','pick','filter','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x20ac4d,_0x2596bd){var _0x195526=function(_0x461f99){while(--_0x461f99){_0x20ac4d['push'](_0x20ac4d['shift']());}};_0x195526(++_0x2596bd);}(_0x2eee,0x16a));var _0xe2ee=function(_0x1d128e,_0x2c87de){_0x1d128e=_0x1d128e-0x0;var _0x3d5236=_0x2eee[_0x1d128e];return _0x3d5236;};'use strict';var emlformat=require(_0xe2ee('0x0'));var rimraf=require(_0xe2ee('0x1'));var zipdir=require(_0xe2ee('0x2'));var jsonpatch=require(_0xe2ee('0x3'));var rp=require(_0xe2ee('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe2ee('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe2ee('0x6'));var csv=require(_0xe2ee('0x7'));var ejs=require(_0xe2ee('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe2ee('0x9'));var squel=require('squel');var crypto=require(_0xe2ee('0xa'));var jsforce=require(_0xe2ee('0xb'));var deskjs=require(_0xe2ee('0xc'));var toCsv=require(_0xe2ee('0x7'));var querystring=require(_0xe2ee('0xd'));var Papa=require(_0xe2ee('0xe'));var Redis=require(_0xe2ee('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe2ee('0x10'));var utils=require(_0xe2ee('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xe2ee('0x12'));var db=require(_0xe2ee('0x13'))['db'];config[_0xe2ee('0x14')]=_[_0xe2ee('0x15')](config[_0xe2ee('0x14')],{'host':_0xe2ee('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe2ee('0x14')]));require(_0xe2ee('0x17'))[_0xe2ee('0x18')](socket);function respondWithStatusCode(_0x3136ef,_0x2ecfc6){_0x2ecfc6=_0x2ecfc6||0xcc;return function(_0xc00d66){if(_0xc00d66){return _0x3136ef['sendStatus'](_0x2ecfc6);}return _0x3136ef[_0xe2ee('0x19')](_0x2ecfc6)['end']();};}function respondWithResult(_0xddd4c,_0x343667){_0x343667=_0x343667||0xc8;return function(_0x3b45b5){if(_0x3b45b5){return _0xddd4c['status'](_0x343667)[_0xe2ee('0x1a')](_0x3b45b5);}};}function respondWithFilteredResult(_0x3d7993,_0x47d904){return function(_0x281066){if(_0x281066){var _0x2fe13f=typeof _0x47d904[_0xe2ee('0x1b')]==='undefined'&&typeof _0x47d904[_0xe2ee('0x1c')]===_0xe2ee('0x1d');var _0x599244=_0x281066['count'];var _0x1b703b=_0x2fe13f?0x0:_0x47d904[_0xe2ee('0x1b')];var _0x5044c3=_0x2fe13f?_0x281066[_0xe2ee('0x1e')]:_0x47d904[_0xe2ee('0x1b')]+_0x47d904[_0xe2ee('0x1c')];var _0x1657e6;if(_0x5044c3>=_0x599244){_0x5044c3=_0x599244;_0x1657e6=0xc8;}else{_0x1657e6=0xce;}_0x3d7993[_0xe2ee('0x19')](_0x1657e6);return _0x3d7993[_0xe2ee('0x1f')]('Content-Range',_0x1b703b+'-'+_0x5044c3+'/'+_0x599244)[_0xe2ee('0x1a')](_0x281066);}return null;};}function patchUpdates(_0x5d0afe){return function(_0xd23d40){try{jsonpatch['apply'](_0xd23d40,_0x5d0afe,!![]);}catch(_0x575e94){return BPromise[_0xe2ee('0x20')](_0x575e94);}return _0xd23d40[_0xe2ee('0x21')]();};}function saveUpdates(_0x59353b,_0x2f4bcc){return function(_0x422d8a){if(_0x422d8a){return _0x422d8a[_0xe2ee('0x22')](_0x59353b)[_0xe2ee('0x23')](function(_0x5a4d34){return _0x5a4d34;});}return null;};}function removeEntity(_0x1a8507,_0x23dc1d){return function(_0x4d91cf){if(_0x4d91cf){return _0x4d91cf['destroy']()['then'](function(){var _0x34da74=_0x4d91cf[_0xe2ee('0x24')]({'plain':!![]});var _0x467ffc='CustomDashboards';return db[_0xe2ee('0x25')]['destroy']({'where':{'type':_0x467ffc,'resourceId':_0x34da74['id']}})['then'](function(){return _0x4d91cf;});})[_0xe2ee('0x23')](function(){_0x1a8507[_0xe2ee('0x19')](0xcc)[_0xe2ee('0x26')]();});}};}function handleEntityNotFound(_0x3d4bcb,_0x33da81){return function(_0x36af7e){if(!_0x36af7e){_0x3d4bcb['sendStatus'](0x194);}return _0x36af7e;};}function handleError(_0x38c008,_0x8a99bb){_0x8a99bb=_0x8a99bb||0x1f4;return function(_0x54e1bc){logger['error'](_0x54e1bc['stack']);if(_0x54e1bc['name']){delete _0x54e1bc[_0xe2ee('0x27')];}_0x38c008[_0xe2ee('0x19')](_0x8a99bb)[_0xe2ee('0x28')](_0x54e1bc);};}exports[_0xe2ee('0x29')]=function(_0x1dd07c,_0x2060b0){var _0x258c13={},_0x33ecf4={},_0x1810dc={'count':0x0,'rows':[]};var _0xd06242=_[_0xe2ee('0x2a')](db[_0xe2ee('0x2b')][_0xe2ee('0x2c')],function(_0x129c5e){return{'name':_0x129c5e[_0xe2ee('0x2d')],'type':_0x129c5e[_0xe2ee('0x2e')]['key']};});_0x33ecf4[_0xe2ee('0x2f')]=_[_0xe2ee('0x2a')](_0xd06242,_0xe2ee('0x27'));_0x33ecf4['query']=_['keys'](_0x1dd07c['query']);_0x33ecf4[_0xe2ee('0x30')]=_[_0xe2ee('0x31')](_0x33ecf4['model'],_0x33ecf4[_0xe2ee('0x32')]);_0x258c13[_0xe2ee('0x33')]=_[_0xe2ee('0x31')](_0x33ecf4[_0xe2ee('0x2f')],qs[_0xe2ee('0x34')](_0x1dd07c[_0xe2ee('0x32')]['fields']));_0x258c13[_0xe2ee('0x33')]=_0x258c13[_0xe2ee('0x33')][_0xe2ee('0x35')]?_0x258c13[_0xe2ee('0x33')]:_0x33ecf4['model'];if(!_0x1dd07c[_0xe2ee('0x32')]['hasOwnProperty'](_0xe2ee('0x36'))){_0x258c13['limit']=qs[_0xe2ee('0x1c')](_0x1dd07c[_0xe2ee('0x32')][_0xe2ee('0x1c')]);_0x258c13['offset']=qs[_0xe2ee('0x1b')](_0x1dd07c[_0xe2ee('0x32')]['offset']);}_0x258c13['order']=qs[_0xe2ee('0x37')](_0x1dd07c[_0xe2ee('0x32')][_0xe2ee('0x37')]);_0x258c13[_0xe2ee('0x38')]=qs[_0xe2ee('0x30')](_['pick'](_0x1dd07c[_0xe2ee('0x32')],_0x33ecf4[_0xe2ee('0x30')]),_0xd06242);if(_0x1dd07c[_0xe2ee('0x32')]['filter']){_0x258c13[_0xe2ee('0x38')]=_[_0xe2ee('0x39')](_0x258c13[_0xe2ee('0x38')],{'$or':_[_0xe2ee('0x2a')](_0xd06242,function(_0x4bb160){if(_0x4bb160[_0xe2ee('0x2e')]!=='VIRTUAL'){var _0x575933={};_0x575933[_0x4bb160[_0xe2ee('0x27')]]={'$like':'%'+_0x1dd07c[_0xe2ee('0x32')]['filter']+'%'};return _0x575933;}})});}_0x258c13=_[_0xe2ee('0x39')]({},_0x258c13,_0x1dd07c[_0xe2ee('0x3a')]);var _0x52483a={'where':_0x258c13['where']};return db[_0xe2ee('0x2b')][_0xe2ee('0x1e')](_0x52483a)[_0xe2ee('0x23')](function(_0x569193){_0x1810dc[_0xe2ee('0x1e')]=_0x569193;if(_0x1dd07c[_0xe2ee('0x32')][_0xe2ee('0x3b')]){_0x258c13['include']=[{'all':!![]}];}return db[_0xe2ee('0x2b')][_0xe2ee('0x3c')](_0x258c13);})['then'](function(_0x2e134a){_0x1810dc['rows']=_0x2e134a;return _0x1810dc;})[_0xe2ee('0x23')](respondWithFilteredResult(_0x2060b0,_0x258c13))['catch'](handleError(_0x2060b0,null));};exports['show']=function(_0x14b5a6,_0xe8a19){var _0x4642fd={'raw':![],'where':{'id':_0x14b5a6[_0xe2ee('0x3d')]['id']}},_0x24571c={};_0x24571c[_0xe2ee('0x2f')]=_[_0xe2ee('0x3e')](db[_0xe2ee('0x2b')][_0xe2ee('0x2c')]);_0x24571c[_0xe2ee('0x32')]=_[_0xe2ee('0x3e')](_0x14b5a6[_0xe2ee('0x32')]);_0x24571c[_0xe2ee('0x30')]=_[_0xe2ee('0x31')](_0x24571c[_0xe2ee('0x2f')],_0x24571c[_0xe2ee('0x32')]);_0x4642fd[_0xe2ee('0x33')]=_[_0xe2ee('0x31')](_0x24571c['model'],qs[_0xe2ee('0x34')](_0x14b5a6[_0xe2ee('0x32')]['fields']));_0x4642fd[_0xe2ee('0x33')]=_0x4642fd[_0xe2ee('0x33')][_0xe2ee('0x35')]?_0x4642fd[_0xe2ee('0x33')]:_0x24571c[_0xe2ee('0x2f')];if(_0x14b5a6[_0xe2ee('0x32')][_0xe2ee('0x3b')]){_0x4642fd[_0xe2ee('0x3f')]=[{'all':!![]}];}_0x4642fd=_[_0xe2ee('0x39')]({},_0x4642fd,_0x14b5a6[_0xe2ee('0x3a')]);return db[_0xe2ee('0x2b')][_0xe2ee('0x40')](_0x4642fd)[_0xe2ee('0x23')](handleEntityNotFound(_0xe8a19,null))[_0xe2ee('0x23')](respondWithResult(_0xe8a19,null))[_0xe2ee('0x41')](handleError(_0xe8a19,null));};exports[_0xe2ee('0x42')]=function(_0x3b25d7,_0x24842c){return db[_0xe2ee('0x2b')][_0xe2ee('0x42')](_0x3b25d7[_0xe2ee('0x43')],{})['then'](function(_0x373de3){var _0x33621c=_0x3b25d7['user'][_0xe2ee('0x24')]({'plain':!![]});if(!_0x33621c)throw new Error(_0xe2ee('0x44'));if(_0x33621c[_0xe2ee('0x45')]===_0xe2ee('0x46')){var _0x490f64=_0x373de3[_0xe2ee('0x24')]({'plain':!![]});var _0x514063=_0xe2ee('0x47');return db[_0xe2ee('0x48')][_0xe2ee('0x40')]({'where':{'name':_0x514063,'userProfileId':_0x33621c['userProfileId']},'raw':!![]})['then'](function(_0x2fdf8c){if(_0x2fdf8c&&_0x2fdf8c[_0xe2ee('0x49')]===0x0){return db[_0xe2ee('0x25')][_0xe2ee('0x42')]({'name':_0x490f64[_0xe2ee('0x27')],'resourceId':_0x490f64['id'],'type':_0x2fdf8c['name'],'sectionId':_0x2fdf8c['id']},{})['then'](function(){return _0x373de3;});}else{return _0x373de3;}})[_0xe2ee('0x41')](function(_0x47455f){logger['error'](_0xe2ee('0x4a'),_0x47455f);throw _0x47455f;});}return _0x373de3;})['then'](respondWithResult(_0x24842c,0xc9))[_0xe2ee('0x41')](handleError(_0x24842c,null));};exports[_0xe2ee('0x4b')]=function(_0x205278,_0x3756c7){var _0x459917={'where':{'id':_0x205278[_0xe2ee('0x3d')]['id']}},_0x1852d6={};_0x1852d6['model']=_[_0xe2ee('0x3e')](db['Dashboard'][_0xe2ee('0x2c')]);_0x459917['attributes']=_['intersection'](_0x1852d6[_0xe2ee('0x2f')],qs[_0xe2ee('0x34')](_0x205278[_0xe2ee('0x32')][_0xe2ee('0x34')]));_0x459917[_0xe2ee('0x33')]=_0x459917[_0xe2ee('0x33')][_0xe2ee('0x35')]?_0x459917[_0xe2ee('0x33')]:_0x1852d6[_0xe2ee('0x2f')];if(_0x205278['query']['includeAll']){_0x459917[_0xe2ee('0x3f')]=[{'all':!![]}];}_0x459917=_[_0xe2ee('0x39')]({},_0x459917,_0x205278[_0xe2ee('0x3a')]);return db[_0xe2ee('0x2b')]['find'](_0x459917)[_0xe2ee('0x23')](handleEntityNotFound(_0x3756c7,null))['then'](function(_0x2ea633){if(_0x2ea633){var _0x3c92ff=_0x2ea633[_0xe2ee('0x24')]({'plain':!![]});_0x3c92ff=qs[_0xe2ee('0x4c')](_0x3c92ff,['id',_0xe2ee('0x4d'),_0xe2ee('0x4e')]);_0x205278[_0xe2ee('0x43')]=_['omit'](_0x205278['body'],['id',_0xe2ee('0x4d'),_0xe2ee('0x4e')]);return db['Dashboard'][_0xe2ee('0x42')](_[_0xe2ee('0x39')](_0x3c92ff,_0x205278[_0xe2ee('0x43')]),{'include':_0x205278[_0xe2ee('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0xe2ee('0x23')](function(_0x269d1d){var _0x24c1a0=_0x205278[_0xe2ee('0x46')][_0xe2ee('0x24')]({'plain':!![]});if(!_0x24c1a0)throw new Error(_0xe2ee('0x44'));if(_0x24c1a0[_0xe2ee('0x45')]===_0xe2ee('0x46')){var _0x2ec8c8=_0x269d1d[_0xe2ee('0x24')]({'plain':!![]});var _0x5bc761=_0xe2ee('0x47');return db['UserProfileSection'][_0xe2ee('0x40')]({'where':{'name':_0x5bc761,'userProfileId':_0x24c1a0[_0xe2ee('0x4f')]},'raw':!![]})['then'](function(_0x1b0dec){if(_0x1b0dec&&_0x1b0dec[_0xe2ee('0x49')]===0x0){return db[_0xe2ee('0x25')][_0xe2ee('0x42')]({'name':_0x2ec8c8[_0xe2ee('0x27')],'resourceId':_0x2ec8c8['id'],'type':_0x1b0dec[_0xe2ee('0x27')],'sectionId':_0x1b0dec['id']},{})[_0xe2ee('0x23')](function(){return _0x269d1d;});}else{return _0x269d1d;}})[_0xe2ee('0x41')](function(_0x44508d){logger['error'](_0xe2ee('0x4a'),_0x44508d);throw _0x44508d;});}return _0x269d1d;});}})['then'](respondWithResult(_0x3756c7,0xc9))[_0xe2ee('0x41')](handleError(_0x3756c7,null));};exports[_0xe2ee('0x22')]=function(_0x434db5,_0x28dccc){if(_0x434db5[_0xe2ee('0x43')]['id']){delete _0x434db5[_0xe2ee('0x43')]['id'];}return db[_0xe2ee('0x2b')][_0xe2ee('0x40')]({'where':{'id':_0x434db5[_0xe2ee('0x3d')]['id']}})[_0xe2ee('0x23')](handleEntityNotFound(_0x28dccc,null))[_0xe2ee('0x23')](saveUpdates(_0x434db5[_0xe2ee('0x43')],null))[_0xe2ee('0x23')](respondWithResult(_0x28dccc,null))[_0xe2ee('0x41')](handleError(_0x28dccc,null));};exports[_0xe2ee('0x50')]=function(_0xa02ddf,_0x139eea){return db[_0xe2ee('0x2b')][_0xe2ee('0x40')]({'where':{'id':_0xa02ddf[_0xe2ee('0x3d')]['id']}})[_0xe2ee('0x23')](handleEntityNotFound(_0x139eea,null))['then'](removeEntity(_0x139eea,null))[_0xe2ee('0x41')](handleError(_0x139eea,null));};function widgetAttributes(_0x446d17){try{switch(_0x446d17[_0xe2ee('0x2e')]){case _0xe2ee('0x51'):return[{'name':'attrUrl','value':_0x446d17['attrUrl']||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x0]?_0x446d17[_0xe2ee('0x52')][0x0][_0xe2ee('0x53')]:undefined)||_0xe2ee('0x54')}];case _0xe2ee('0x55'):return[{'name':_0xe2ee('0x56'),'value':_0x446d17[_0xe2ee('0x56')]||(_0x446d17['attrs']&&_0x446d17[_0xe2ee('0x52')][0x0]?_0x446d17['attrs'][0x0][_0xe2ee('0x53')]:undefined)||''}];case _0xe2ee('0x57'):return[{'name':_0xe2ee('0x58'),'value':_0x446d17[_0xe2ee('0x58')]||(_0x446d17['attrs']&&_0x446d17[_0xe2ee('0x52')][0x0]?_0x446d17['attrs'][0x0][_0xe2ee('0x53')]:undefined)||_0xe2ee('0x59')},{'name':'attrTimezone','value':_0x446d17['attrTimezone']||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x1]?_0x446d17[_0xe2ee('0x52')][0x1]['value']:undefined)||_0xe2ee('0x5a')},{'name':_0xe2ee('0x5b'),'value':_0x446d17[_0xe2ee('0x5b')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x2]?_0x446d17[_0xe2ee('0x52')][0x2][_0xe2ee('0x53')]:undefined)||0xc}];case _0xe2ee('0x5c'):return[{'name':_0xe2ee('0x5d'),'value':_0x446d17[_0xe2ee('0x5d')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x0]?_0x446d17[_0xe2ee('0x52')][0x0][_0xe2ee('0x53')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x446d17['attrVoiceQueues']||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x1]?_0x446d17[_0xe2ee('0x52')][0x1][_0xe2ee('0x53')]:undefined)||[]},{'name':'attrFontSize','value':_0x446d17['attrFontSize']||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17['attrs'][0x2]?_0x446d17[_0xe2ee('0x52')][0x2][_0xe2ee('0x53')]:undefined)||0x14},{'name':_0xe2ee('0x5e'),'value':_0x446d17[_0xe2ee('0x5e')]||(_0x446d17['attrs']&&_0x446d17['attrs'][0x3]?_0x446d17[_0xe2ee('0x52')][0x3][_0xe2ee('0x53')]:undefined)||'voice'},{'name':_0xe2ee('0x5f'),'value':_0x446d17[_0xe2ee('0x5f')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x4]?_0x446d17[_0xe2ee('0x52')][0x4][_0xe2ee('0x53')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x446d17['attrFaxAccounts']||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x5]?_0x446d17['attrs'][0x5][_0xe2ee('0x53')]:undefined)||''},{'name':_0xe2ee('0x60'),'value':_0x446d17[_0xe2ee('0x60')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x6]?_0x446d17[_0xe2ee('0x52')][0x6][_0xe2ee('0x53')]:undefined)||''},{'name':_0xe2ee('0x61'),'value':_0x446d17[_0xe2ee('0x61')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x7]?_0x446d17[_0xe2ee('0x52')][0x7][_0xe2ee('0x53')]:undefined)||''},{'name':_0xe2ee('0x62'),'value':_0x446d17[_0xe2ee('0x62')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x8]?_0x446d17[_0xe2ee('0x52')][0x8][_0xe2ee('0x53')]:undefined)||''},{'name':_0xe2ee('0x63'),'value':_0x446d17['attrChatWebsites']||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x9]?_0x446d17[_0xe2ee('0x52')][0x9][_0xe2ee('0x53')]:undefined)||''}];case _0xe2ee('0x64'):case _0xe2ee('0x65'):return[{'name':_0xe2ee('0x66'),'value':_0x446d17[_0xe2ee('0x66')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x0]?_0x446d17[_0xe2ee('0x52')][0x0][_0xe2ee('0x53')]:undefined)||_0xe2ee('0x67')},{'name':_0xe2ee('0x68'),'value':_0x446d17[_0xe2ee('0x68')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17['attrs'][0x1]?_0x446d17[_0xe2ee('0x52')][0x1][_0xe2ee('0x53')]:undefined)||null},{'name':_0xe2ee('0x69'),'value':_0x446d17['attrSerie3']||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x2]?_0x446d17[_0xe2ee('0x52')][0x2][_0xe2ee('0x53')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x446d17[_0xe2ee('0x6a')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x3]?_0x446d17['attrs'][0x3][_0xe2ee('0x53')]:undefined)||[]},{'name':'attrChannel','value':_0x446d17['attrChannel']||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x4]?_0x446d17['attrs'][0x4]['value']:undefined)||_0xe2ee('0x6b')},{'name':_0xe2ee('0x5f'),'value':_0x446d17[_0xe2ee('0x5f')]||(_0x446d17['attrs']&&_0x446d17[_0xe2ee('0x52')][0x5]?_0x446d17[_0xe2ee('0x52')][0x5][_0xe2ee('0x53')]:undefined)||''},{'name':_0xe2ee('0x6c'),'value':_0x446d17[_0xe2ee('0x6c')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x6]?_0x446d17[_0xe2ee('0x52')][0x6]['value']:undefined)||''},{'name':_0xe2ee('0x60'),'value':_0x446d17[_0xe2ee('0x60')]||(_0x446d17['attrs']&&_0x446d17[_0xe2ee('0x52')][0x7]?_0x446d17['attrs'][0x7][_0xe2ee('0x53')]:undefined)||''},{'name':_0xe2ee('0x61'),'value':_0x446d17[_0xe2ee('0x61')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x8]?_0x446d17[_0xe2ee('0x52')][0x8][_0xe2ee('0x53')]:undefined)||''},{'name':_0xe2ee('0x62'),'value':_0x446d17['attrWhatsappAccounts']||(_0x446d17['attrs']&&_0x446d17[_0xe2ee('0x52')][0x9]?_0x446d17[_0xe2ee('0x52')][0x9]['value']:undefined)||''},{'name':_0xe2ee('0x63'),'value':_0x446d17[_0xe2ee('0x63')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0xa]?_0x446d17['attrs'][0xa]['value']:undefined)||''}];case _0xe2ee('0x6d'):return[{'name':'attrReport','type':_0x446d17[_0xe2ee('0x6e')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x0]?_0x446d17[_0xe2ee('0x52')][0x0]['type']:undefined)||null,'value':_0x446d17['attrReport']||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x0]?_0x446d17[_0xe2ee('0x52')][0x0][_0xe2ee('0x53')]:undefined)||null},{'name':_0xe2ee('0x6f'),'value':_0x446d17[_0xe2ee('0x6f')]||(_0x446d17[_0xe2ee('0x52')]&&_0x446d17[_0xe2ee('0x52')][0x1]?_0x446d17[_0xe2ee('0x52')][0x1][_0xe2ee('0x53')]:undefined)||0x0}];default:return[];}}catch(_0x129858){logger[_0xe2ee('0x70')](_0xe2ee('0x71'),JSON[_0xe2ee('0x72')](_0x129858));return[];}}exports[_0xe2ee('0x73')]=function(_0x33bfb8,_0x5544d6,_0x54de06){if(_0x33bfb8['body']['id']){delete _0x33bfb8['body']['id'];}return db[_0xe2ee('0x2b')][_0xe2ee('0x40')]({'where':{'id':_0x33bfb8[_0xe2ee('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5544d6,null))[_0xe2ee('0x23')](function(_0x3a9ad2){if(_0x3a9ad2){_0x33bfb8[_0xe2ee('0x43')][_0xe2ee('0x74')]=_0x3a9ad2['id'];_0x33bfb8[_0xe2ee('0x43')][_0xe2ee('0x52')]=widgetAttributes(_0x33bfb8['body']);return db[_0xe2ee('0x75')][_0xe2ee('0x42')](_0x33bfb8[_0xe2ee('0x43')]);}})[_0xe2ee('0x23')](respondWithResult(_0x5544d6,null))[_0xe2ee('0x41')](handleError(_0x5544d6,null));};exports[_0xe2ee('0x76')]=function(_0x5b4670,_0x4886c9,_0x120d96){var _0x2f3c74={};var _0x3f5c74={};var _0x23be28;var _0x4dba03;return db[_0xe2ee('0x2b')][_0xe2ee('0x77')]({'where':{'id':_0x5b4670[_0xe2ee('0x3d')]['id']}})[_0xe2ee('0x23')](handleEntityNotFound(_0x4886c9,null))[_0xe2ee('0x23')](function(_0x20361c){if(_0x20361c){_0x23be28=_0x20361c;_0x3f5c74[_0xe2ee('0x2f')]=_[_0xe2ee('0x3e')](db[_0xe2ee('0x75')]['rawAttributes']);_0x3f5c74[_0xe2ee('0x32')]=_[_0xe2ee('0x3e')](_0x5b4670['query']);_0x3f5c74['filters']=_[_0xe2ee('0x31')](_0x3f5c74['model'],_0x3f5c74['query']);_0x2f3c74[_0xe2ee('0x33')]=_[_0xe2ee('0x31')](_0x3f5c74[_0xe2ee('0x2f')],qs['fields'](_0x5b4670['query'][_0xe2ee('0x34')]));_0x2f3c74['attributes']=_0x2f3c74[_0xe2ee('0x33')]['length']?_0x2f3c74['attributes']:_0x3f5c74[_0xe2ee('0x2f')];_0x2f3c74['order']=qs[_0xe2ee('0x37')](_0x5b4670[_0xe2ee('0x32')]['sort']);_0x2f3c74['where']=qs[_0xe2ee('0x30')](_[_0xe2ee('0x78')](_0x5b4670['query'],_0x3f5c74[_0xe2ee('0x30')]));if(_0x5b4670['query'][_0xe2ee('0x79')]){_0x2f3c74[_0xe2ee('0x38')]=_[_0xe2ee('0x39')](_0x2f3c74[_0xe2ee('0x38')],{'$or':_[_0xe2ee('0x2a')](_0x2f3c74[_0xe2ee('0x33')],function(_0x4e1327){var _0x3155de={};_0x3155de[_0x4e1327]={'$like':'%'+_0x5b4670['query'][_0xe2ee('0x79')]+'%'};return _0x3155de;})});}_0x2f3c74=_[_0xe2ee('0x39')]({},_0x2f3c74,_0x5b4670[_0xe2ee('0x3a')]);return _0x23be28['getItems'](_0x2f3c74);}})[_0xe2ee('0x23')](function(_0x4d99fb){if(_0x4d99fb){_0x4dba03=_0x4d99fb[_0xe2ee('0x35')];if(!_0x5b4670[_0xe2ee('0x32')]['hasOwnProperty'](_0xe2ee('0x36'))){_0x2f3c74['limit']=qs['limit'](_0x5b4670[_0xe2ee('0x32')][_0xe2ee('0x1c')]);_0x2f3c74[_0xe2ee('0x1b')]=qs[_0xe2ee('0x1b')](_0x5b4670[_0xe2ee('0x32')][_0xe2ee('0x1b')]);}return _0x23be28[_0xe2ee('0x76')](_0x2f3c74);}})['then'](function(_0x4be679){if(_0x4be679){return _0x4be679?{'count':_0x4dba03,'rows':_0x4be679}:null;}})[_0xe2ee('0x23')](respondWithResult(_0x4886c9,null))['catch'](handleError(_0x4886c9,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index cc4abfc..9da34da 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 _0xdde0=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdde0,0xbe));var _0x0dde=function(_0xf64595,_0x3bcfe7){_0xf64595=_0xf64595-0x0;var _0x54e02b=_0xdde0[_0xf64595];return _0x54e02b;};'use strict';var EventEmitter=require(_0x0dde('0x0'));var Dashboard=require(_0x0dde('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0dde('0x2'),'afterUpdate':_0x0dde('0x3'),'afterDestroy':_0x0dde('0x4')};function emitEvent(_0x22ea0d){return function(_0x3d0b4b,_0x4fbd83,_0x25ede3){DashboardEvents[_0x0dde('0x5')](_0x22ea0d+':'+_0x3d0b4b['id'],_0x3d0b4b);DashboardEvents['emit'](_0x22ea0d,_0x3d0b4b);_0x25ede3(null);};}for(var e in events){if(events[_0x0dde('0x6')](e)){var event=events[e];Dashboard[_0x0dde('0x7')](e,emitEvent(event));}}module[_0x0dde('0x8')]=DashboardEvents; \ No newline at end of file +var _0x69a0=['events','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x595a36,_0x20549a){var _0x19f148=function(_0x4ffb12){while(--_0x4ffb12){_0x595a36['push'](_0x595a36['shift']());}};_0x19f148(++_0x20549a);}(_0x69a0,0x181));var _0x069a=function(_0x712b17,_0x496f21){_0x712b17=_0x712b17-0x0;var _0x7502d2=_0x69a0[_0x712b17];return _0x7502d2;};'use strict';var EventEmitter=require(_0x069a('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x069a('0x1'),'afterUpdate':_0x069a('0x2'),'afterDestroy':_0x069a('0x3')};function emitEvent(_0x2cde9f){return function(_0x39c93d,_0x51cf04,_0x5422a3){DashboardEvents[_0x069a('0x4')](_0x2cde9f+':'+_0x39c93d['id'],_0x39c93d);DashboardEvents[_0x069a('0x4')](_0x2cde9f,_0x39c93d);_0x5422a3(null);};}for(var e in events){if(events[_0x069a('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x069a('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 8ca69d7..e3d9600 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 _0xbe5b=['exports','define','Dashboard','dashboards','lodash','util','api','rimraf','../../config/environment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xbe5b,0x199));var _0xbbe5=function(_0x22f50f,_0x197663){_0x22f50f=_0x22f50f-0x0;var _0x1ea403=_0xbe5b[_0x22f50f];return _0x1ea403;};'use strict';var _=require(_0xbbe5('0x0'));var util=require(_0xbbe5('0x1'));var logger=require('../../config/logger')(_0xbbe5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbbe5('0x3'));var config=require(_0xbbe5('0x4'));var attributes=require('./dashboard.attributes');module[_0xbbe5('0x5')]=function(_0x189288,_0x476d5b){return _0x189288[_0xbbe5('0x6')](_0xbbe5('0x7'),attributes,{'tableName':_0xbbe5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71a4=['path','rimraf','./dashboard.attributes','exports','define','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x71a4,0x14f));var _0x471a=function(_0x22cb8a,_0x388854){_0x22cb8a=_0x22cb8a-0x0;var _0x2e654c=_0x71a4[_0x22cb8a];return _0x2e654c;};'use strict';var _=require(_0x471a('0x0'));var util=require('util');var logger=require(_0x471a('0x1'))(_0x471a('0x2'));var moment=require('moment');var BPromise=require(_0x471a('0x3'));var rp=require(_0x471a('0x4'));var fs=require('fs');var path=require(_0x471a('0x5'));var rimraf=require(_0x471a('0x6'));var config=require('../../config/environment');var attributes=require(_0x471a('0x7'));module[_0x471a('0x8')]=function(_0x5d9acb,_0x1e1314){return _0x5d9acb[_0x471a('0x9')]('Dashboard',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 ad8b888..e49d000 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 _0x7bed=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent','debug','stringify','error','Dashboard,\x20%s,\x20%s'];(function(_0x170f9d,_0xba5fad){var _0x44d5f5=function(_0x1a165f){while(--_0x1a165f){_0x170f9d['push'](_0x170f9d['shift']());}};_0x44d5f5(++_0xba5fad);}(_0x7bed,0x1e8));var _0xd7be=function(_0x3c498f,_0x1a9eef){_0x3c498f=_0x3c498f-0x0;var _0x2104b8=_0x7bed[_0x3c498f];return _0x2104b8;};'use strict';var _=require(_0xd7be('0x0'));var util=require(_0xd7be('0x1'));var moment=require(_0xd7be('0x2'));var BPromise=require(_0xd7be('0x3'));var rs=require(_0xd7be('0x4'));var fs=require('fs');var Redis=require(_0xd7be('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd7be('0x6'));var logger=require('../../config/logger')(_0xd7be('0x7'));var config=require(_0xd7be('0x8'));var jayson=require(_0xd7be('0x9'));var client=jayson[_0xd7be('0xa')]['http']({'port':0x232a});config[_0xd7be('0xb')]=_[_0xd7be('0xc')](config[_0xd7be('0xb')],{'host':_0xd7be('0xd'),'port':0x18eb});var socket=require(_0xd7be('0xe'))(new Redis(config[_0xd7be('0xb')]));require(_0xd7be('0xf'))[_0xd7be('0x10')](socket);function respondWithRpcPromise(_0x5f3721,_0x14ed2e,_0x47ef98){return new BPromise(function(_0x4d7af0,_0x55f8ab){return client[_0xd7be('0x11')](_0x5f3721,_0x47ef98)[_0xd7be('0x12')](function(_0x486eec){logger[_0xd7be('0x13')]('Dashboard,\x20%s,\x20%s',_0x14ed2e,_0xd7be('0x14'));logger[_0xd7be('0x15')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x14ed2e,_0xd7be('0x14'),JSON[_0xd7be('0x16')](_0x486eec));if(_0x486eec[_0xd7be('0x17')]){if(_0x486eec[_0xd7be('0x17')]['code']===0x1f4){logger['error'](_0xd7be('0x18'),_0x14ed2e,_0x486eec[_0xd7be('0x17')]['message']);return _0x55f8ab(_0x486eec[_0xd7be('0x17')][_0xd7be('0x19')]);}logger[_0xd7be('0x17')](_0xd7be('0x18'),_0x14ed2e,_0x486eec[_0xd7be('0x17')]['message']);return _0x4d7af0(_0x486eec[_0xd7be('0x17')]['message']);}else{logger[_0xd7be('0x13')]('Dashboard,\x20%s,\x20%s',_0x14ed2e,_0xd7be('0x14'));_0x4d7af0(_0x486eec['result'][_0xd7be('0x19')]);}})[_0xd7be('0x1a')](function(_0x46cfbd){logger[_0xd7be('0x17')](_0xd7be('0x18'),_0x14ed2e,_0x46cfbd);_0x55f8ab(_0x46cfbd);});});} \ No newline at end of file +var _0xe981=['defaults','localhost','register','request','then','Dashboard,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis'];(function(_0x44eeb9,_0x1a5603){var _0x38738f=function(_0x1a4096){while(--_0x1a4096){_0x44eeb9['push'](_0x44eeb9['shift']());}};_0x38738f(++_0x1a5603);}(_0xe981,0x77));var _0x1e98=function(_0x21ecc8,_0x2bdead){_0x21ecc8=_0x21ecc8-0x0;var _0x510c1d=_0xe981[_0x21ecc8];return _0x510c1d;};'use strict';var _=require(_0x1e98('0x0'));var util=require(_0x1e98('0x1'));var moment=require(_0x1e98('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e98('0x3'));var fs=require('fs');var Redis=require(_0x1e98('0x4'));var db=require(_0x1e98('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e98('0x6'))('rpc');var config=require(_0x1e98('0x7'));var jayson=require(_0x1e98('0x8'));var client=jayson['client'][_0x1e98('0x9')]({'port':0x232a});config[_0x1e98('0xa')]=_[_0x1e98('0xb')](config[_0x1e98('0xa')],{'host':_0x1e98('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1e98('0xa')]));require('./dashboard.socket')[_0x1e98('0xd')](socket);function respondWithRpcPromise(_0x9b4690,_0x337b59,_0x1bc647){return new BPromise(function(_0x165077,_0xb5167f){return client[_0x1e98('0xe')](_0x9b4690,_0x1bc647)[_0x1e98('0xf')](function(_0x45b1a7){logger['info'](_0x1e98('0x10'),_0x337b59,'request\x20sent');logger[_0x1e98('0x11')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x337b59,_0x1e98('0x12'),JSON[_0x1e98('0x13')](_0x45b1a7));if(_0x45b1a7[_0x1e98('0x14')]){if(_0x45b1a7['error'][_0x1e98('0x15')]===0x1f4){logger[_0x1e98('0x14')](_0x1e98('0x10'),_0x337b59,_0x45b1a7[_0x1e98('0x14')][_0x1e98('0x16')]);return _0xb5167f(_0x45b1a7['error'][_0x1e98('0x16')]);}logger[_0x1e98('0x14')](_0x1e98('0x10'),_0x337b59,_0x45b1a7['error']['message']);return _0x165077(_0x45b1a7[_0x1e98('0x14')][_0x1e98('0x16')]);}else{logger[_0x1e98('0x17')](_0x1e98('0x10'),_0x337b59,_0x1e98('0x12'));_0x165077(_0x45b1a7[_0x1e98('0x18')][_0x1e98('0x16')]);}})[_0x1e98('0x19')](function(_0x54d11f){logger[_0x1e98('0x14')]('Dashboard,\x20%s,\x20%s',_0x337b59,_0x54d11f);_0xb5167f(_0x54d11f);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index c0d036d..575ad74 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 _0xee41=['./dashboard.events','save','remove','update','emit','removeListener','register','length','dashboard:'];(function(_0x1a9a57,_0x446618){var _0xa67b6=function(_0x3cfc43){while(--_0x3cfc43){_0x1a9a57['push'](_0x1a9a57['shift']());}};_0xa67b6(++_0x446618);}(_0xee41,0x14d));var _0x1ee4=function(_0x20713e,_0x44f710){_0x20713e=_0x20713e-0x0;var _0x7d998b=_0xee41[_0x20713e];return _0x7d998b;};'use strict';var DashboardEvents=require(_0x1ee4('0x0'));var events=[_0x1ee4('0x1'),_0x1ee4('0x2'),_0x1ee4('0x3')];function createListener(_0x314a16,_0x38b3d7){return function(_0x28a044){_0x38b3d7[_0x1ee4('0x4')](_0x314a16,_0x28a044);};}function removeListener(_0x3e08e6,_0x30930d){return function(){DashboardEvents[_0x1ee4('0x5')](_0x3e08e6,_0x30930d);};}exports[_0x1ee4('0x6')]=function(_0x30e2a3){for(var _0x585083=0x0,_0x144fa2=events[_0x1ee4('0x7')];_0x585083<_0x144fa2;_0x585083++){var _0x1380a2=events[_0x585083];var _0x12884f=createListener(_0x1ee4('0x8')+_0x1380a2,_0x30e2a3);DashboardEvents['on'](_0x1380a2,_0x12884f);}}; \ No newline at end of file +var _0x5e18=['removeListener','register','length','remove','update','emit'];(function(_0xb8127e,_0x14e348){var _0x47603a=function(_0x206126){while(--_0x206126){_0xb8127e['push'](_0xb8127e['shift']());}};_0x47603a(++_0x14e348);}(_0x5e18,0x81));var _0x85e1=function(_0x55c7ae,_0x1cb265){_0x55c7ae=_0x55c7ae-0x0;var _0x3b459d=_0x5e18[_0x55c7ae];return _0x3b459d;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0x85e1('0x0'),_0x85e1('0x1')];function createListener(_0x1e8973,_0x15a9d8){return function(_0x481f69){_0x15a9d8[_0x85e1('0x2')](_0x1e8973,_0x481f69);};}function removeListener(_0x466598,_0x3652e3){return function(){DashboardEvents[_0x85e1('0x3')](_0x466598,_0x3652e3);};}exports[_0x85e1('0x4')]=function(_0x63baa0){for(var _0x1c2c8e=0x0,_0xfdac87=events[_0x85e1('0x5')];_0x1c2c8e<_0xfdac87;_0x1c2c8e++){var _0x30529f=events[_0x1c2c8e];var _0x2721ec=createListener('dashboard:'+_0x30529f,_0x63baa0);DashboardEvents['on'](_0x30529f,_0x2721ec);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index c54d5d8..2f8e857 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 _0x3a27=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/items','getItems','post','create','clone','addItem','put','/:id','update','destroy','exports','multer','path'];(function(_0x2acbd3,_0x4ce7c2){var _0x1b989c=function(_0x40f587){while(--_0x40f587){_0x2acbd3['push'](_0x2acbd3['shift']());}};_0x1b989c(++_0x4ce7c2);}(_0x3a27,0xbb));var _0x73a2=function(_0x14dde7,_0x42d323){_0x14dde7=_0x14dde7-0x0;var _0x38d45c=_0x3a27[_0x14dde7];return _0x38d45c;};'use strict';var multer=require(_0x73a2('0x0'));var util=require('util');var path=require(_0x73a2('0x1'));var timeout=require(_0x73a2('0x2'));var express=require(_0x73a2('0x3'));var router=express[_0x73a2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x73a2('0x5'));var interaction=require(_0x73a2('0x6'));var config=require(_0x73a2('0x7'));var controller=require('./dashboard.controller');router[_0x73a2('0x8')]('/',auth[_0x73a2('0x9')](),controller['index']);router[_0x73a2('0x8')]('/:id',auth[_0x73a2('0x9')](),controller['show']);router['get'](_0x73a2('0xa'),auth[_0x73a2('0x9')](),controller[_0x73a2('0xb')]);router[_0x73a2('0xc')]('/',auth[_0x73a2('0x9')](),controller[_0x73a2('0xd')]);router[_0x73a2('0xc')]('/:id/clone',auth[_0x73a2('0x9')](),controller[_0x73a2('0xe')]);router['post'](_0x73a2('0xa'),auth[_0x73a2('0x9')](),controller[_0x73a2('0xf')]);router[_0x73a2('0x10')](_0x73a2('0x11'),auth[_0x73a2('0x9')](),controller[_0x73a2('0x12')]);router['delete'](_0x73a2('0x11'),auth[_0x73a2('0x9')](),controller[_0x73a2('0x13')]);module[_0x73a2('0x14')]=router; \ No newline at end of file +var _0x93b0=['post','create','clone','addItem','put','update','destroy','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','get','/:id','show','/:id/items'];(function(_0x704b0a,_0xc8f6b1){var _0xe3d01d=function(_0x737d1a){while(--_0x737d1a){_0x704b0a['push'](_0x704b0a['shift']());}};_0xe3d01d(++_0xc8f6b1);}(_0x93b0,0x196));var _0x093b=function(_0x375507,_0xe514c3){_0x375507=_0x375507-0x0;var _0x372b94=_0x93b0[_0x375507];return _0x372b94;};'use strict';var multer=require('multer');var util=require(_0x093b('0x0'));var path=require('path');var timeout=require(_0x093b('0x1'));var express=require('express');var router=express[_0x093b('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x093b('0x3'));var config=require(_0x093b('0x4'));var controller=require(_0x093b('0x5'));router['get']('/',auth[_0x093b('0x6')](),controller[_0x093b('0x7')]);router[_0x093b('0x8')](_0x093b('0x9'),auth[_0x093b('0x6')](),controller[_0x093b('0xa')]);router[_0x093b('0x8')](_0x093b('0xb'),auth['isAuthenticated'](),controller['getItems']);router[_0x093b('0xc')]('/',auth['isAuthenticated'](),controller[_0x093b('0xd')]);router[_0x093b('0xc')]('/:id/clone',auth['isAuthenticated'](),controller[_0x093b('0xe')]);router[_0x093b('0xc')](_0x093b('0xb'),auth[_0x093b('0x6')](),controller[_0x093b('0xf')]);router[_0x093b('0x10')](_0x093b('0x9'),auth[_0x093b('0x6')](),controller[_0x093b('0x11')]);router['delete'](_0x093b('0x9'),auth['isAuthenticated'](),controller[_0x093b('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index d53bedc..3d32e5f 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 _0xda19=['TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','squel','lodash','STRING'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0xda19,0xd5));var _0x9da1=function(_0x191b42,_0x3a45a0){_0x191b42=_0x191b42-0x0;var _0x1f0ba4=_0xda19[_0x191b42];return _0x1f0ba4;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x9da1('0x0'));var _=require(_0x9da1('0x1'));module['exports']={'title':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x9da1('0x3')]('long'),'get':function(){try{return JSON[_0x9da1('0x4')](this[_0x9da1('0x5')](_0x9da1('0x6')));}catch(_0x470043){return[];}},'set':function(_0x156faf){try{this[_0x9da1('0x7')](_0x9da1('0x6'),JSON[_0x9da1('0x8')](_0x156faf));}catch(_0x1c24e6){this[_0x9da1('0x7')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x9da1('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x9da1('0x9')]},'background':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![],'defaultValue':_0x9da1('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![],'defaultValue':_0x9da1('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x9da1('0x2')]},'titleFontSize':{'type':Sequelize[_0x9da1('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0x5fab=['STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel','exports'];(function(_0x42e933,_0xd6a806){var _0x36aefb=function(_0x21dca1){while(--_0x21dca1){_0x42e933['push'](_0x42e933['shift']());}};_0x36aefb(++_0xd6a806);}(_0x5fab,0x177));var _0xb5fa=function(_0x5e61b0,_0x5ee5b9){_0x5e61b0=_0x5e61b0-0x0;var _0x59116b=_0x5fab[_0x5e61b0];return _0x59116b;};'use strict';var Sequelize=require(_0xb5fa('0x0'));var squel=require(_0xb5fa('0x1'));var _=require('lodash');module[_0xb5fa('0x2')]={'title':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb5fa('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb5fa('0x4')](_0xb5fa('0x5')),'get':function(){try{return JSON[_0xb5fa('0x6')](this[_0xb5fa('0x7')](_0xb5fa('0x8')));}catch(_0x10361d){return[];}},'set':function(_0x44df89){try{this['setDataValue']('attrs',JSON[_0xb5fa('0x9')](_0x44df89));}catch(_0x1aec3e){this[_0xb5fa('0xa')]('attrs',JSON[_0xb5fa('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb5fa('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb5fa('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![],'defaultValue':_0xb5fa('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![],'defaultValue':_0xb5fa('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb5fa('0x3')]},'titleFontSize':{'type':Sequelize[_0xb5fa('0xb')],'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 b908a1a..5299a99 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 _0x39e6=['name','send','show','keys','DashboardItem','rawAttributes','filters','intersection','model','attributes','fields','query','length','includeAll','include','merge','options','catch','find','type','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','error','stringify','body','create','params','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy'];(function(_0xbdb0ac,_0x19e5cc){var _0x5833b7=function(_0x219700){while(--_0x219700){_0xbdb0ac['push'](_0xbdb0ac['shift']());}};_0x5833b7(++_0x19e5cc);}(_0x39e6,0x9e));var _0x639e=function(_0x1de999,_0x48ccf3){_0x1de999=_0x1de999-0x0;var _0xb96468=_0x39e6[_0x1de999];return _0xb96468;};'use strict';var emlformat=require(_0x639e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x639e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x639e('0x2'));var BPromise=require(_0x639e('0x3'));var Mustache=require('mustache');var util=require(_0x639e('0x4'));var path=require(_0x639e('0x5'));var sox=require(_0x639e('0x6'));var csv=require(_0x639e('0x7'));var ejs=require(_0x639e('0x8'));var fs=require('fs');var fs_extra=require(_0x639e('0x9'));var _=require(_0x639e('0xa'));var squel=require(_0x639e('0xb'));var crypto=require(_0x639e('0xc'));var jsforce=require(_0x639e('0xd'));var deskjs=require(_0x639e('0xe'));var toCsv=require(_0x639e('0x7'));var querystring=require(_0x639e('0xf'));var Papa=require(_0x639e('0x10'));var Redis=require(_0x639e('0x11'));var authService=require(_0x639e('0x12'));var qs=require(_0x639e('0x13'));var as=require(_0x639e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x639e('0x15'));var utils=require(_0x639e('0x16'));var config=require(_0x639e('0x17'));var licenseUtil=require(_0x639e('0x18'));var db=require(_0x639e('0x19'))['db'];config[_0x639e('0x1a')]=_[_0x639e('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x639e('0x1c'))(new Redis(config[_0x639e('0x1a')]));require(_0x639e('0x1d'))[_0x639e('0x1e')](socket);function respondWithStatusCode(_0x37b8e2,_0x1c9feb){_0x1c9feb=_0x1c9feb||0xcc;return function(_0x55728e){if(_0x55728e){return _0x37b8e2[_0x639e('0x1f')](_0x1c9feb);}return _0x37b8e2[_0x639e('0x20')](_0x1c9feb)[_0x639e('0x21')]();};}function respondWithResult(_0x4077c5,_0x4fa3fa){_0x4fa3fa=_0x4fa3fa||0xc8;return function(_0x6dd912){if(_0x6dd912){return _0x4077c5['status'](_0x4fa3fa)[_0x639e('0x22')](_0x6dd912);}};}function respondWithFilteredResult(_0x3932a8,_0x391957){return function(_0x20b76f){if(_0x20b76f){var _0x36b75a=typeof _0x391957[_0x639e('0x23')]==='undefined'&&typeof _0x391957[_0x639e('0x24')]===_0x639e('0x25');var _0x36f71d=_0x20b76f[_0x639e('0x26')];var _0x59f772=_0x36b75a?0x0:_0x391957[_0x639e('0x23')];var _0xdf47a5=_0x36b75a?_0x20b76f[_0x639e('0x26')]:_0x391957[_0x639e('0x23')]+_0x391957[_0x639e('0x24')];var _0x50de77;if(_0xdf47a5>=_0x36f71d){_0xdf47a5=_0x36f71d;_0x50de77=0xc8;}else{_0x50de77=0xce;}_0x3932a8[_0x639e('0x20')](_0x50de77);return _0x3932a8[_0x639e('0x27')]('Content-Range',_0x59f772+'-'+_0xdf47a5+'/'+_0x36f71d)[_0x639e('0x22')](_0x20b76f);}return null;};}function patchUpdates(_0x48dce7){return function(_0x574fd8){try{jsonpatch[_0x639e('0x28')](_0x574fd8,_0x48dce7,!![]);}catch(_0x3813f6){return BPromise[_0x639e('0x29')](_0x3813f6);}return _0x574fd8[_0x639e('0x2a')]();};}function saveUpdates(_0x211fcb,_0x5da797){return function(_0x2b699c){if(_0x2b699c){return _0x2b699c[_0x639e('0x2b')](_0x211fcb)[_0x639e('0x2c')](function(_0x2da264){return _0x2da264;});}return null;};}function removeEntity(_0x2df4d1,_0x5f27f6){return function(_0x381554){if(_0x381554){return _0x381554[_0x639e('0x2d')]()[_0x639e('0x2c')](function(){_0x2df4d1[_0x639e('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ae3b7,_0x282d87){return function(_0x13ef2b){if(!_0x13ef2b){_0x2ae3b7['sendStatus'](0x194);}return _0x13ef2b;};}function handleError(_0xefbf1c,_0x56145c){_0x56145c=_0x56145c||0x1f4;return function(_0x38ce3a){logger['error'](_0x38ce3a['stack']);if(_0x38ce3a[_0x639e('0x2e')]){delete _0x38ce3a[_0x639e('0x2e')];}_0xefbf1c[_0x639e('0x20')](_0x56145c)[_0x639e('0x2f')](_0x38ce3a);};}exports[_0x639e('0x30')]=function(_0xefc97b,_0x5797da){var _0x213b7e={'raw':![],'where':{'id':_0xefc97b['params']['id']}},_0x2bfb5e={};_0x2bfb5e['model']=_[_0x639e('0x31')](db[_0x639e('0x32')][_0x639e('0x33')]);_0x2bfb5e['query']=_[_0x639e('0x31')](_0xefc97b['query']);_0x2bfb5e[_0x639e('0x34')]=_[_0x639e('0x35')](_0x2bfb5e[_0x639e('0x36')],_0x2bfb5e['query']);_0x213b7e[_0x639e('0x37')]=_['intersection'](_0x2bfb5e[_0x639e('0x36')],qs[_0x639e('0x38')](_0xefc97b[_0x639e('0x39')]['fields']));_0x213b7e[_0x639e('0x37')]=_0x213b7e[_0x639e('0x37')][_0x639e('0x3a')]?_0x213b7e['attributes']:_0x2bfb5e[_0x639e('0x36')];if(_0xefc97b['query'][_0x639e('0x3b')]){_0x213b7e[_0x639e('0x3c')]=[{'all':!![]}];}_0x213b7e=_[_0x639e('0x3d')]({},_0x213b7e,_0xefc97b[_0x639e('0x3e')]);return db[_0x639e('0x32')]['find'](_0x213b7e)[_0x639e('0x2c')](handleEntityNotFound(_0x5797da,null))[_0x639e('0x2c')](respondWithResult(_0x5797da,null))[_0x639e('0x3f')](handleError(_0x5797da,null));};exports[_0x639e('0x2d')]=function(_0x4b8a3e,_0x2a30aa){return db[_0x639e('0x32')][_0x639e('0x40')]({'where':{'id':_0x4b8a3e['params']['id']}})[_0x639e('0x2c')](handleEntityNotFound(_0x2a30aa,null))['then'](removeEntity(_0x2a30aa,null))[_0x639e('0x3f')](handleError(_0x2a30aa,null));};function widgetAttributes(_0x22c393){try{switch(_0x22c393[_0x639e('0x41')]){case _0x639e('0x42'):return[{'name':_0x639e('0x43'),'value':_0x22c393[_0x639e('0x43')]||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0x0]?_0x22c393[_0x639e('0x44')][0x0]['value']:undefined)||_0x639e('0x45')}];case'custom':return[{'name':_0x639e('0x46'),'value':_0x22c393[_0x639e('0x46')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x0]?_0x22c393[_0x639e('0x44')][0x0][_0x639e('0x47')]:undefined)||''}];case _0x639e('0x48'):return[{'name':_0x639e('0x49'),'value':_0x22c393['attrHourFormat']||(_0x22c393['attrs']&&_0x22c393['attrs'][0x0]?_0x22c393['attrs'][0x0][_0x639e('0x47')]:undefined)||_0x639e('0x4a')},{'name':'attrTimezone','value':_0x22c393[_0x639e('0x4b')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x1]?_0x22c393['attrs'][0x1][_0x639e('0x47')]:undefined)||_0x639e('0x4c')},{'name':_0x639e('0x4d'),'value':_0x22c393[_0x639e('0x4d')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x2]?_0x22c393[_0x639e('0x44')][0x2][_0x639e('0x47')]:undefined)||0xc}];case _0x639e('0x4e'):return[{'name':'attrMetric','value':_0x22c393[_0x639e('0x4f')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x0]?_0x22c393[_0x639e('0x44')][0x0][_0x639e('0x47')]:undefined)||_0x639e('0x50')},{'name':'attrVoiceQueues','value':_0x22c393[_0x639e('0x51')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x1]?_0x22c393[_0x639e('0x44')][0x1][_0x639e('0x47')]:undefined)||[]},{'name':_0x639e('0x4d'),'value':_0x22c393[_0x639e('0x4d')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x2]?_0x22c393[_0x639e('0x44')][0x2][_0x639e('0x47')]:undefined)||0x14},{'name':_0x639e('0x52'),'value':_0x22c393['attrChannel']||(_0x22c393[_0x639e('0x44')]&&_0x22c393['attrs'][0x3]?_0x22c393['attrs'][0x3][_0x639e('0x47')]:undefined)||_0x639e('0x53')},{'name':_0x639e('0x54'),'value':_0x22c393[_0x639e('0x54')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393['attrs'][0x4]?_0x22c393[_0x639e('0x44')][0x4][_0x639e('0x47')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x22c393[_0x639e('0x55')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x5]?_0x22c393['attrs'][0x5][_0x639e('0x47')]:undefined)||''},{'name':_0x639e('0x56'),'value':_0x22c393[_0x639e('0x56')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393['attrs'][0x6]?_0x22c393[_0x639e('0x44')][0x6]['value']:undefined)||''},{'name':_0x639e('0x57'),'value':_0x22c393['attrOpenchannelAccounts']||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x7]?_0x22c393[_0x639e('0x44')][0x7][_0x639e('0x47')]:undefined)||''},{'name':_0x639e('0x58'),'value':_0x22c393['attrWhatsappAccounts']||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x8]?_0x22c393[_0x639e('0x44')][0x8]['value']:undefined)||''},{'name':_0x639e('0x59'),'value':_0x22c393[_0x639e('0x59')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x9]?_0x22c393['attrs'][0x9][_0x639e('0x47')]:undefined)||''}];case'multibar-chart':case _0x639e('0x5a'):return[{'name':_0x639e('0x5b'),'value':_0x22c393[_0x639e('0x5b')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393['attrs'][0x0]?_0x22c393[_0x639e('0x44')][0x0]['value']:undefined)||'total'},{'name':_0x639e('0x5c'),'value':_0x22c393[_0x639e('0x5c')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x1]?_0x22c393['attrs'][0x1][_0x639e('0x47')]:undefined)||null},{'name':_0x639e('0x5d'),'value':_0x22c393[_0x639e('0x5d')]||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0x2]?_0x22c393[_0x639e('0x44')][0x2][_0x639e('0x47')]:undefined)||null},{'name':_0x639e('0x51'),'value':_0x22c393[_0x639e('0x51')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x3]?_0x22c393['attrs'][0x3][_0x639e('0x47')]:undefined)||[]},{'name':_0x639e('0x52'),'value':_0x22c393[_0x639e('0x52')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393['attrs'][0x4]?_0x22c393[_0x639e('0x44')][0x4][_0x639e('0x47')]:undefined)||_0x639e('0x53')},{'name':'attrEmailAccounts','value':_0x22c393['attrEmailAccounts']||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0x5]?_0x22c393[_0x639e('0x44')][0x5]['value']:undefined)||''},{'name':_0x639e('0x55'),'value':_0x22c393[_0x639e('0x55')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x6]?_0x22c393[_0x639e('0x44')][0x6][_0x639e('0x47')]:undefined)||''},{'name':_0x639e('0x56'),'value':_0x22c393[_0x639e('0x56')]||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0x7]?_0x22c393[_0x639e('0x44')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x22c393[_0x639e('0x57')]||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0x8]?_0x22c393[_0x639e('0x44')][0x8][_0x639e('0x47')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x22c393[_0x639e('0x58')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x9]?_0x22c393[_0x639e('0x44')][0x9]['value']:undefined)||''},{'name':_0x639e('0x59'),'value':_0x22c393[_0x639e('0x59')]||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0xa]?_0x22c393[_0x639e('0x44')][0xa][_0x639e('0x47')]:undefined)||''}];case _0x639e('0x5e'):return[{'name':_0x639e('0x5f'),'type':_0x22c393['reportType']||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x0]?_0x22c393[_0x639e('0x44')][0x0][_0x639e('0x41')]:undefined)||null,'value':_0x22c393[_0x639e('0x5f')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x0]?_0x22c393[_0x639e('0x44')][0x0][_0x639e('0x47')]:undefined)||null},{'name':_0x639e('0x60'),'value':_0x22c393['attrRefresh']||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0x1]?_0x22c393[_0x639e('0x44')][0x1][_0x639e('0x47')]:undefined)||0x0}];default:return[];}}catch(_0x3ef322){logger[_0x639e('0x61')]('widgetAttributes:\x20%s',JSON[_0x639e('0x62')](_0x3ef322));return[];}}exports['create']=function(_0x6106a1,_0x174758){if(_0x6106a1[_0x639e('0x63')]){_0x6106a1['body']['attrs']=widgetAttributes(_0x6106a1[_0x639e('0x63')]);}return db[_0x639e('0x32')][_0x639e('0x64')](_0x6106a1['body'],{})['then'](respondWithResult(_0x174758,0xc9))[_0x639e('0x3f')](handleError(_0x174758,null));};exports[_0x639e('0x2b')]=function(_0x5e29fb,_0x5b6313){if(_0x5e29fb[_0x639e('0x63')]['id']){delete _0x5e29fb[_0x639e('0x63')]['id'];}_0x5e29fb[_0x639e('0x63')]['attrs']=widgetAttributes(_0x5e29fb[_0x639e('0x63')]);return db[_0x639e('0x32')][_0x639e('0x40')]({'where':{'id':_0x5e29fb[_0x639e('0x65')]['id']}})['then'](handleEntityNotFound(_0x5b6313,null))[_0x639e('0x2c')](saveUpdates(_0x5e29fb[_0x639e('0x63')],null))[_0x639e('0x2c')](respondWithResult(_0x5b6313,null))[_0x639e('0x3f')](handleError(_0x5b6313,null));}; \ No newline at end of file +var _0xa46e=['options','destroy','catch','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','type','attrRefresh','widgetAttributes:\x20%s','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','apply','reject','update','then','error','stack','name','send','show','DashboardItem','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge'];(function(_0x4b6599,_0x4461f9){var _0x599ccd=function(_0x2689a3){while(--_0x2689a3){_0x4b6599['push'](_0x4b6599['shift']());}};_0x599ccd(++_0x4461f9);}(_0xa46e,0x8a));var _0xea46=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xa46e[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require(_0xea46('0x0'));var rimraf=require(_0xea46('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea46('0x2'));var rp=require(_0xea46('0x3'));var moment=require(_0xea46('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xea46('0x5'));var util=require('util');var path=require(_0xea46('0x6'));var sox=require('sox');var csv=require(_0xea46('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea46('0x8'));var _=require(_0xea46('0x9'));var squel=require('squel');var crypto=require(_0xea46('0xa'));var jsforce=require(_0xea46('0xb'));var deskjs=require(_0xea46('0xc'));var toCsv=require(_0xea46('0x7'));var querystring=require(_0xea46('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xea46('0xe'));var as=require(_0xea46('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea46('0x10'))(_0xea46('0x11'));var utils=require(_0xea46('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xea46('0x13'));var db=require(_0xea46('0x14'))['db'];config['redis']=_[_0xea46('0x15')](config[_0xea46('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xea46('0x17'))(new Redis(config['redis']));require(_0xea46('0x18'))[_0xea46('0x19')](socket);function respondWithStatusCode(_0x6c4bc4,_0x40bb42){_0x40bb42=_0x40bb42||0xcc;return function(_0xc76198){if(_0xc76198){return _0x6c4bc4[_0xea46('0x1a')](_0x40bb42);}return _0x6c4bc4[_0xea46('0x1b')](_0x40bb42)[_0xea46('0x1c')]();};}function respondWithResult(_0x176ad2,_0x59e1ea){_0x59e1ea=_0x59e1ea||0xc8;return function(_0x2fa2f9){if(_0x2fa2f9){return _0x176ad2[_0xea46('0x1b')](_0x59e1ea)[_0xea46('0x1d')](_0x2fa2f9);}};}function respondWithFilteredResult(_0x59f28e,_0x58b4da){return function(_0x19d5c1){if(_0x19d5c1){var _0x3f463d=typeof _0x58b4da['offset']==='undefined'&&typeof _0x58b4da[_0xea46('0x1e')]===_0xea46('0x1f');var _0x4ff93d=_0x19d5c1[_0xea46('0x20')];var _0x16ae38=_0x3f463d?0x0:_0x58b4da[_0xea46('0x21')];var _0x18ccea=_0x3f463d?_0x19d5c1['count']:_0x58b4da[_0xea46('0x21')]+_0x58b4da['limit'];var _0x515e32;if(_0x18ccea>=_0x4ff93d){_0x18ccea=_0x4ff93d;_0x515e32=0xc8;}else{_0x515e32=0xce;}_0x59f28e[_0xea46('0x1b')](_0x515e32);return _0x59f28e['set']('Content-Range',_0x16ae38+'-'+_0x18ccea+'/'+_0x4ff93d)['json'](_0x19d5c1);}return null;};}function patchUpdates(_0x3b25fe){return function(_0x36f982){try{jsonpatch[_0xea46('0x22')](_0x36f982,_0x3b25fe,!![]);}catch(_0x5beb44){return BPromise[_0xea46('0x23')](_0x5beb44);}return _0x36f982['save']();};}function saveUpdates(_0x12e688,_0x2008b0){return function(_0x528eae){if(_0x528eae){return _0x528eae[_0xea46('0x24')](_0x12e688)['then'](function(_0x2b3a8f){return _0x2b3a8f;});}return null;};}function removeEntity(_0x114bf9,_0xd4cf78){return function(_0x4bf494){if(_0x4bf494){return _0x4bf494['destroy']()[_0xea46('0x25')](function(){_0x114bf9[_0xea46('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b3928,_0x4999b0){return function(_0x11129d){if(!_0x11129d){_0x3b3928['sendStatus'](0x194);}return _0x11129d;};}function handleError(_0x158ecd,_0x28472f){_0x28472f=_0x28472f||0x1f4;return function(_0x6710ae){logger[_0xea46('0x26')](_0x6710ae[_0xea46('0x27')]);if(_0x6710ae[_0xea46('0x28')]){delete _0x6710ae['name'];}_0x158ecd[_0xea46('0x1b')](_0x28472f)[_0xea46('0x29')](_0x6710ae);};}exports[_0xea46('0x2a')]=function(_0x5e0e35,_0x3e7856){var _0x3cdf96={'raw':![],'where':{'id':_0x5e0e35['params']['id']}},_0x38d631={};_0x38d631['model']=_['keys'](db[_0xea46('0x2b')][_0xea46('0x2c')]);_0x38d631[_0xea46('0x2d')]=_[_0xea46('0x2e')](_0x5e0e35[_0xea46('0x2d')]);_0x38d631[_0xea46('0x2f')]=_[_0xea46('0x30')](_0x38d631[_0xea46('0x31')],_0x38d631[_0xea46('0x2d')]);_0x3cdf96[_0xea46('0x32')]=_[_0xea46('0x30')](_0x38d631['model'],qs[_0xea46('0x33')](_0x5e0e35[_0xea46('0x2d')][_0xea46('0x33')]));_0x3cdf96[_0xea46('0x32')]=_0x3cdf96[_0xea46('0x32')][_0xea46('0x34')]?_0x3cdf96[_0xea46('0x32')]:_0x38d631['model'];if(_0x5e0e35[_0xea46('0x2d')][_0xea46('0x35')]){_0x3cdf96[_0xea46('0x36')]=[{'all':!![]}];}_0x3cdf96=_[_0xea46('0x37')]({},_0x3cdf96,_0x5e0e35[_0xea46('0x38')]);return db['DashboardItem']['find'](_0x3cdf96)[_0xea46('0x25')](handleEntityNotFound(_0x3e7856,null))[_0xea46('0x25')](respondWithResult(_0x3e7856,null))['catch'](handleError(_0x3e7856,null));};exports[_0xea46('0x39')]=function(_0x2de735,_0x123aae){return db[_0xea46('0x2b')]['find']({'where':{'id':_0x2de735['params']['id']}})[_0xea46('0x25')](handleEntityNotFound(_0x123aae,null))['then'](removeEntity(_0x123aae,null))[_0xea46('0x3a')](handleError(_0x123aae,null));};function widgetAttributes(_0xdec374){try{switch(_0xdec374['type']){case _0xea46('0x3b'):return[{'name':_0xea46('0x3c'),'value':_0xdec374['attrUrl']||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x0]?_0xdec374['attrs'][0x0][_0xea46('0x3e')]:undefined)||_0xea46('0x3f')}];case _0xea46('0x40'):return[{'name':_0xea46('0x41'),'value':_0xdec374['attrPath']||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x0]?_0xdec374[_0xea46('0x3d')][0x0][_0xea46('0x3e')]:undefined)||''}];case _0xea46('0x42'):return[{'name':'attrHourFormat','value':_0xdec374[_0xea46('0x43')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374['attrs'][0x0]?_0xdec374[_0xea46('0x3d')][0x0][_0xea46('0x3e')]:undefined)||_0xea46('0x44')},{'name':_0xea46('0x45'),'value':_0xdec374['attrTimezone']||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x1]?_0xdec374[_0xea46('0x3d')][0x1]['value']:undefined)||_0xea46('0x46')},{'name':_0xea46('0x47'),'value':_0xdec374[_0xea46('0x47')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x2]?_0xdec374[_0xea46('0x3d')][0x2][_0xea46('0x3e')]:undefined)||0xc}];case _0xea46('0x48'):return[{'name':_0xea46('0x49'),'value':_0xdec374[_0xea46('0x49')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x0]?_0xdec374[_0xea46('0x3d')][0x0][_0xea46('0x3e')]:undefined)||_0xea46('0x4a')},{'name':'attrVoiceQueues','value':_0xdec374['attrVoiceQueues']||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x1]?_0xdec374[_0xea46('0x3d')][0x1][_0xea46('0x3e')]:undefined)||[]},{'name':'attrFontSize','value':_0xdec374['attrFontSize']||(_0xdec374['attrs']&&_0xdec374[_0xea46('0x3d')][0x2]?_0xdec374[_0xea46('0x3d')][0x2]['value']:undefined)||0x14},{'name':_0xea46('0x4b'),'value':_0xdec374[_0xea46('0x4b')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x3]?_0xdec374[_0xea46('0x3d')][0x3]['value']:undefined)||_0xea46('0x4c')},{'name':'attrEmailAccounts','value':_0xdec374[_0xea46('0x4d')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x4]?_0xdec374[_0xea46('0x3d')][0x4][_0xea46('0x3e')]:undefined)||''},{'name':_0xea46('0x4e'),'value':_0xdec374[_0xea46('0x4e')]||(_0xdec374['attrs']&&_0xdec374[_0xea46('0x3d')][0x5]?_0xdec374[_0xea46('0x3d')][0x5]['value']:undefined)||''},{'name':_0xea46('0x4f'),'value':_0xdec374[_0xea46('0x4f')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374['attrs'][0x6]?_0xdec374['attrs'][0x6][_0xea46('0x3e')]:undefined)||''},{'name':_0xea46('0x50'),'value':_0xdec374[_0xea46('0x50')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x7]?_0xdec374[_0xea46('0x3d')][0x7][_0xea46('0x3e')]:undefined)||''},{'name':_0xea46('0x51'),'value':_0xdec374[_0xea46('0x51')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374['attrs'][0x8]?_0xdec374[_0xea46('0x3d')][0x8]['value']:undefined)||''},{'name':_0xea46('0x52'),'value':_0xdec374[_0xea46('0x52')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374['attrs'][0x9]?_0xdec374[_0xea46('0x3d')][0x9][_0xea46('0x3e')]:undefined)||''}];case _0xea46('0x53'):case _0xea46('0x54'):return[{'name':'attrSerie1','value':_0xdec374['attrSerie1']||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x0]?_0xdec374['attrs'][0x0][_0xea46('0x3e')]:undefined)||'total'},{'name':_0xea46('0x55'),'value':_0xdec374[_0xea46('0x55')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x1]?_0xdec374[_0xea46('0x3d')][0x1][_0xea46('0x3e')]:undefined)||null},{'name':_0xea46('0x56'),'value':_0xdec374['attrSerie3']||(_0xdec374['attrs']&&_0xdec374[_0xea46('0x3d')][0x2]?_0xdec374['attrs'][0x2][_0xea46('0x3e')]:undefined)||null},{'name':_0xea46('0x57'),'value':_0xdec374[_0xea46('0x57')]||(_0xdec374['attrs']&&_0xdec374[_0xea46('0x3d')][0x3]?_0xdec374['attrs'][0x3][_0xea46('0x3e')]:undefined)||[]},{'name':_0xea46('0x4b'),'value':_0xdec374['attrChannel']||(_0xdec374['attrs']&&_0xdec374[_0xea46('0x3d')][0x4]?_0xdec374[_0xea46('0x3d')][0x4][_0xea46('0x3e')]:undefined)||'voice'},{'name':_0xea46('0x4d'),'value':_0xdec374['attrEmailAccounts']||(_0xdec374[_0xea46('0x3d')]&&_0xdec374['attrs'][0x5]?_0xdec374[_0xea46('0x3d')][0x5][_0xea46('0x3e')]:undefined)||''},{'name':_0xea46('0x4e'),'value':_0xdec374[_0xea46('0x4e')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374['attrs'][0x6]?_0xdec374[_0xea46('0x3d')][0x6][_0xea46('0x3e')]:undefined)||''},{'name':_0xea46('0x4f'),'value':_0xdec374['attrSmsAccounts']||(_0xdec374['attrs']&&_0xdec374[_0xea46('0x3d')][0x7]?_0xdec374[_0xea46('0x3d')][0x7][_0xea46('0x3e')]:undefined)||''},{'name':_0xea46('0x50'),'value':_0xdec374[_0xea46('0x50')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x8]?_0xdec374[_0xea46('0x3d')][0x8][_0xea46('0x3e')]:undefined)||''},{'name':_0xea46('0x51'),'value':_0xdec374[_0xea46('0x51')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x9]?_0xdec374[_0xea46('0x3d')][0x9][_0xea46('0x3e')]:undefined)||''},{'name':'attrChatWebsites','value':_0xdec374[_0xea46('0x52')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0xa]?_0xdec374[_0xea46('0x3d')][0xa]['value']:undefined)||''}];case _0xea46('0x58'):return[{'name':_0xea46('0x59'),'type':_0xdec374['reportType']||(_0xdec374[_0xea46('0x3d')]&&_0xdec374[_0xea46('0x3d')][0x0]?_0xdec374['attrs'][0x0][_0xea46('0x5a')]:undefined)||null,'value':_0xdec374[_0xea46('0x59')]||(_0xdec374[_0xea46('0x3d')]&&_0xdec374['attrs'][0x0]?_0xdec374[_0xea46('0x3d')][0x0][_0xea46('0x3e')]:undefined)||null},{'name':_0xea46('0x5b'),'value':_0xdec374['attrRefresh']||(_0xdec374['attrs']&&_0xdec374['attrs'][0x1]?_0xdec374[_0xea46('0x3d')][0x1][_0xea46('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x450d40){logger[_0xea46('0x26')](_0xea46('0x5c'),JSON['stringify'](_0x450d40));return[];}}exports[_0xea46('0x5d')]=function(_0x5ae93a,_0x29a58a){if(_0x5ae93a[_0xea46('0x5e')]){_0x5ae93a[_0xea46('0x5e')]['attrs']=widgetAttributes(_0x5ae93a['body']);}return db[_0xea46('0x2b')][_0xea46('0x5d')](_0x5ae93a['body'],{})[_0xea46('0x25')](respondWithResult(_0x29a58a,0xc9))[_0xea46('0x3a')](handleError(_0x29a58a,null));};exports[_0xea46('0x24')]=function(_0x3eab07,_0x2992b4){if(_0x3eab07['body']['id']){delete _0x3eab07[_0xea46('0x5e')]['id'];}_0x3eab07[_0xea46('0x5e')][_0xea46('0x3d')]=widgetAttributes(_0x3eab07[_0xea46('0x5e')]);return db[_0xea46('0x2b')][_0xea46('0x5f')]({'where':{'id':_0x3eab07[_0xea46('0x60')]['id']}})[_0xea46('0x25')](handleEntityNotFound(_0x2992b4,null))['then'](saveUpdates(_0x3eab07[_0xea46('0x5e')],null))[_0xea46('0x25')](respondWithResult(_0x2992b4,null))[_0xea46('0x3a')](handleError(_0x2992b4,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index f6cd57d..7ee016e 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 _0xe2bc=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem'];(function(_0x5e98ad,_0x38ac34){var _0x51535b=function(_0x49e571){while(--_0x49e571){_0x5e98ad['push'](_0x5e98ad['shift']());}};_0x51535b(++_0x38ac34);}(_0xe2bc,0x15d));var _0xce2b=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xe2bc[_0x368fb9];return _0x4892fb;};'use strict';var EventEmitter=require(_0xce2b('0x0'));var DashboardItem=require(_0xce2b('0x1'))['db'][_0xce2b('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xce2b('0x3')](0x0);var events={'afterCreate':_0xce2b('0x4'),'afterUpdate':_0xce2b('0x5'),'afterDestroy':_0xce2b('0x6')};function emitEvent(_0x568c12){return function(_0x25fe89,_0x5a06a1,_0x36ae46){DashboardItemEvents[_0xce2b('0x7')](_0x568c12+':'+_0x25fe89['id'],_0x25fe89);DashboardItemEvents[_0xce2b('0x7')](_0x568c12,_0x25fe89);_0x36ae46(null);};}for(var e in events){if(events[_0xce2b('0x8')](e)){var event=events[e];DashboardItem[_0xce2b('0x9')](e,emitEvent(event));}}module[_0xce2b('0xa')]=DashboardItemEvents; \ No newline at end of file +var _0x2414=['update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0x2414,0xc2));var _0x4241=function(_0x368046,_0x8d6728){_0x368046=_0x368046-0x0;var _0x3b1622=_0x2414[_0x368046];return _0x3b1622;};'use strict';var EventEmitter=require(_0x4241('0x0'));var DashboardItem=require(_0x4241('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x4241('0x2')](0x0);var events={'afterCreate':_0x4241('0x3'),'afterUpdate':_0x4241('0x4'),'afterDestroy':_0x4241('0x5')};function emitEvent(_0x4f44ab){return function(_0x29869a,_0x553239,_0x4b0fc3){DashboardItemEvents['emit'](_0x4f44ab+':'+_0x29869a['id'],_0x29869a);DashboardItemEvents[_0x4241('0x6')](_0x4f44ab,_0x29869a);_0x4b0fc3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x4241('0x7')](e,emitEvent(event));}}module[_0x4241('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index ec22658..15d3a8a 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 _0xe345=['define','DashboardItem','dashboard_items','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe345,0x99));var _0x5e34=function(_0x197115,_0x14d69a){_0x197115=_0x197115-0x0;var _0x19d830=_0xe345[_0x197115];return _0x19d830;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5e34('0x0'))('api');var moment=require(_0x5e34('0x1'));var BPromise=require(_0x5e34('0x2'));var rp=require(_0x5e34('0x3'));var fs=require('fs');var path=require(_0x5e34('0x4'));var rimraf=require('rimraf');var config=require(_0x5e34('0x5'));var attributes=require('./dashboardItem.attributes');module[_0x5e34('0x6')]=function(_0x5ae480,_0x1243b4){return _0x5ae480[_0x5e34('0x7')](_0x5e34('0x8'),attributes,{'tableName':_0x5e34('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f71=['DashboardItem','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define'];(function(_0x32fb8d,_0x567a64){var _0x37cf13=function(_0x28bf81){while(--_0x28bf81){_0x32fb8d['push'](_0x32fb8d['shift']());}};_0x37cf13(++_0x567a64);}(_0x1f71,0xaa));var _0x11f7=function(_0x5de6ba,_0x8afe0f){_0x5de6ba=_0x5de6ba-0x0;var _0x2623f9=_0x1f71[_0x5de6ba];return _0x2623f9;};'use strict';var _=require('lodash');var util=require(_0x11f7('0x0'));var logger=require(_0x11f7('0x1'))(_0x11f7('0x2'));var moment=require(_0x11f7('0x3'));var BPromise=require(_0x11f7('0x4'));var rp=require(_0x11f7('0x5'));var fs=require('fs');var path=require(_0x11f7('0x6'));var rimraf=require(_0x11f7('0x7'));var config=require(_0x11f7('0x8'));var attributes=require(_0x11f7('0x9'));module[_0x11f7('0xa')]=function(_0x5110aa,_0x48f717){return _0x5110aa[_0x11f7('0xb')](_0x11f7('0xc'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 44145d6..ccb58d6 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 _0xa27c=['request','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','DashboardItem,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xa27c,0xac));var _0xca27=function(_0x1b6cf3,_0x2320c5){_0x1b6cf3=_0x1b6cf3-0x0;var _0x84a135=_0xa27c[_0x1b6cf3];return _0x84a135;};'use strict';var _=require(_0xca27('0x0'));var util=require(_0xca27('0x1'));var moment=require('moment');var BPromise=require(_0xca27('0x2'));var rs=require(_0xca27('0x3'));var fs=require('fs');var Redis=require(_0xca27('0x4'));var db=require(_0xca27('0x5'))['db'];var utils=require(_0xca27('0x6'));var logger=require('../../config/logger')(_0xca27('0x7'));var config=require(_0xca27('0x8'));var jayson=require(_0xca27('0x9'));var client=jayson[_0xca27('0xa')][_0xca27('0xb')]({'port':0x232a});config[_0xca27('0xc')]=_['defaults'](config[_0xca27('0xc')],{'host':_0xca27('0xd'),'port':0x18eb});var socket=require(_0xca27('0xe'))(new Redis(config[_0xca27('0xc')]));require(_0xca27('0xf'))[_0xca27('0x10')](socket);function respondWithRpcPromise(_0x11c7bc,_0x26de17,_0x4e684c){return new BPromise(function(_0x296083,_0x1a4043){return client[_0xca27('0x11')](_0x11c7bc,_0x4e684c)[_0xca27('0x12')](function(_0x2b1c11){logger[_0xca27('0x13')]('DashboardItem,\x20%s,\x20%s',_0x26de17,_0xca27('0x14'));logger[_0xca27('0x15')](_0xca27('0x16'),_0x26de17,_0xca27('0x14'),JSON['stringify'](_0x2b1c11));if(_0x2b1c11[_0xca27('0x17')]){if(_0x2b1c11[_0xca27('0x17')]['code']===0x1f4){logger[_0xca27('0x17')](_0xca27('0x18'),_0x26de17,_0x2b1c11[_0xca27('0x17')][_0xca27('0x19')]);return _0x1a4043(_0x2b1c11[_0xca27('0x17')][_0xca27('0x19')]);}logger['error'](_0xca27('0x18'),_0x26de17,_0x2b1c11[_0xca27('0x17')][_0xca27('0x19')]);return _0x296083(_0x2b1c11[_0xca27('0x17')]['message']);}else{logger['info'](_0xca27('0x18'),_0x26de17,_0xca27('0x14'));_0x296083(_0x2b1c11[_0xca27('0x1a')]['message']);}})['catch'](function(_0x87eb95){logger[_0xca27('0x17')](_0xca27('0x18'),_0x26de17,_0x87eb95);_0x1a4043(_0x87eb95);});});} \ No newline at end of file +var _0x4af7=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x4af7,0xdf));var _0x74af=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0x4af7[_0x3792e6];return _0x441e44;};'use strict';var _=require('lodash');var util=require(_0x74af('0x0'));var moment=require(_0x74af('0x1'));var BPromise=require(_0x74af('0x2'));var rs=require(_0x74af('0x3'));var fs=require('fs');var Redis=require(_0x74af('0x4'));var db=require(_0x74af('0x5'))['db'];var utils=require(_0x74af('0x6'));var logger=require(_0x74af('0x7'))(_0x74af('0x8'));var config=require(_0x74af('0x9'));var jayson=require(_0x74af('0xa'));var client=jayson[_0x74af('0xb')][_0x74af('0xc')]({'port':0x232a});config['redis']=_[_0x74af('0xd')](config[_0x74af('0xe')],{'host':_0x74af('0xf'),'port':0x18eb});var socket=require(_0x74af('0x10'))(new Redis(config[_0x74af('0xe')]));require('./dashboardItem.socket')[_0x74af('0x11')](socket);function respondWithRpcPromise(_0x4cfe76,_0x107315,_0x1be0c9){return new BPromise(function(_0x2d2e91,_0x5f4136){return client['request'](_0x4cfe76,_0x1be0c9)['then'](function(_0x29d80e){logger[_0x74af('0x12')](_0x74af('0x13'),_0x107315,_0x74af('0x14'));logger[_0x74af('0x15')](_0x74af('0x16'),_0x107315,_0x74af('0x14'),JSON[_0x74af('0x17')](_0x29d80e));if(_0x29d80e[_0x74af('0x18')]){if(_0x29d80e[_0x74af('0x18')]['code']===0x1f4){logger[_0x74af('0x18')]('DashboardItem,\x20%s,\x20%s',_0x107315,_0x29d80e['error'][_0x74af('0x19')]);return _0x5f4136(_0x29d80e[_0x74af('0x18')][_0x74af('0x19')]);}logger[_0x74af('0x18')](_0x74af('0x13'),_0x107315,_0x29d80e['error']['message']);return _0x2d2e91(_0x29d80e[_0x74af('0x18')][_0x74af('0x19')]);}else{logger[_0x74af('0x12')](_0x74af('0x13'),_0x107315,_0x74af('0x14'));_0x2d2e91(_0x29d80e[_0x74af('0x1a')][_0x74af('0x19')]);}})[_0x74af('0x1b')](function(_0x1a6068){logger['error']('DashboardItem,\x20%s,\x20%s',_0x107315,_0x1a6068);_0x5f4136(_0x1a6068);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 1c379d7..181b97f 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 _0xcf65=['emit','removeListener','./dashboardItem.events','save','remove','update'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xcf65,0x18e));var _0x5cf6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcf65[_0x3ab51d];return _0x29a04e;};'use strict';var DashboardItemEvents=require(_0x5cf6('0x0'));var events=[_0x5cf6('0x1'),_0x5cf6('0x2'),_0x5cf6('0x3')];function createListener(_0x1c2339,_0x383d59){return function(_0xbf488d){_0x383d59[_0x5cf6('0x4')](_0x1c2339,_0xbf488d);};}function removeListener(_0x4ee70d,_0x1f8875){return function(){DashboardItemEvents[_0x5cf6('0x5')](_0x4ee70d,_0x1f8875);};}exports['register']=function(_0x4c5525){for(var _0xccfcae=0x0,_0x1a0d9c=events['length'];_0xccfcae<_0x1a0d9c;_0xccfcae++){var _0x428d31=events[_0xccfcae];var _0x8000bf=createListener('dashboardItem:'+_0x428d31,_0x4c5525);DashboardItemEvents['on'](_0x428d31,_0x8000bf);}}; \ No newline at end of file +var _0x09ee=['update','emit','removeListener','length','./dashboardItem.events','save'];(function(_0x566512,_0x1c3dcf){var _0x4afe69=function(_0x4e19f4){while(--_0x4e19f4){_0x566512['push'](_0x566512['shift']());}};_0x4afe69(++_0x1c3dcf);}(_0x09ee,0x1ea));var _0xe09e=function(_0x25d4b1,_0x4e896d){_0x25d4b1=_0x25d4b1-0x0;var _0x2d51a5=_0x09ee[_0x25d4b1];return _0x2d51a5;};'use strict';var DashboardItemEvents=require(_0xe09e('0x0'));var events=[_0xe09e('0x1'),'remove',_0xe09e('0x2')];function createListener(_0x2d9910,_0x304c47){return function(_0x531608){_0x304c47[_0xe09e('0x3')](_0x2d9910,_0x531608);};}function removeListener(_0x497220,_0x4516a8){return function(){DashboardItemEvents[_0xe09e('0x4')](_0x497220,_0x4516a8);};}exports['register']=function(_0x521580){for(var _0x56b265=0x0,_0x4f13d7=events[_0xe09e('0x5')];_0x56b265<_0x4f13d7;_0x56b265++){var _0xd8f7d2=events[_0x56b265];var _0x5094f9=createListener('dashboardItem:'+_0xd8f7d2,_0x521580);DashboardItemEvents['on'](_0xd8f7d2,_0x5094f9);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index cc2fd90..04b241b 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 _0x7a0b=['../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x580c74,_0x5ecfe6){var _0xda011e=function(_0x32e84a){while(--_0x32e84a){_0x580c74['push'](_0x580c74['shift']());}};_0xda011e(++_0x5ecfe6);}(_0x7a0b,0x1da));var _0xb7a0=function(_0x493cc4,_0x2c8e67){_0x493cc4=_0x493cc4-0x0;var _0x539fb1=_0x7a0b[_0x493cc4];return _0x539fb1;};'use strict';var multer=require(_0xb7a0('0x0'));var util=require(_0xb7a0('0x1'));var path=require(_0xb7a0('0x2'));var timeout=require(_0xb7a0('0x3'));var express=require(_0xb7a0('0x4'));var router=express[_0xb7a0('0x5')]();var fs_extra=require(_0xb7a0('0x6'));var auth=require(_0xb7a0('0x7'));var interaction=require(_0xb7a0('0x8'));var config=require(_0xb7a0('0x9'));var controller=require(_0xb7a0('0xa'));router[_0xb7a0('0xb')]('/:id',auth[_0xb7a0('0xc')](),controller[_0xb7a0('0xd')]);router[_0xb7a0('0xe')]('/',auth[_0xb7a0('0xc')](),controller[_0xb7a0('0xf')]);router[_0xb7a0('0x10')](_0xb7a0('0x11'),auth[_0xb7a0('0xc')](),controller[_0xb7a0('0x12')]);router[_0xb7a0('0x13')](_0xb7a0('0x11'),auth[_0xb7a0('0xc')](),controller[_0xb7a0('0x14')]);module['exports']=router; \ No newline at end of file +var _0x0b22=['fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','show','isAuthenticated','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x174568,_0x5612ca){var _0x50cf63=function(_0x1cf80b){while(--_0x1cf80b){_0x174568['push'](_0x174568['shift']());}};_0x50cf63(++_0x5612ca);}(_0x0b22,0x83));var _0x20b2=function(_0x11fbb6,_0x46109e){_0x11fbb6=_0x11fbb6-0x0;var _0x5b19b1=_0x0b22[_0x11fbb6];return _0x5b19b1;};'use strict';var multer=require(_0x20b2('0x0'));var util=require(_0x20b2('0x1'));var path=require(_0x20b2('0x2'));var timeout=require(_0x20b2('0x3'));var express=require('express');var router=express[_0x20b2('0x4')]();var fs_extra=require(_0x20b2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x20b2('0x6'));var config=require(_0x20b2('0x7'));var controller=require(_0x20b2('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x20b2('0x9')]);router['post']('/',auth[_0x20b2('0xa')](),controller[_0x20b2('0xb')]);router[_0x20b2('0xc')](_0x20b2('0xd'),auth[_0x20b2('0xa')](),controller[_0x20b2('0xe')]);router[_0x20b2('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x20b2('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 9c86c22..4ed8402 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 _0xe0ba=['sequelize','exports','STRING','ENUM','first','second','third'];(function(_0x1daf2c,_0x42c1cc){var _0x4eeaf3=function(_0x2e6aae){while(--_0x2e6aae){_0x1daf2c['push'](_0x1daf2c['shift']());}};_0x4eeaf3(++_0x42c1cc);}(_0xe0ba,0x126));var _0xae0b=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xe0ba[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require(_0xae0b('0x0'));module[_0xae0b('0x1')]={'name':{'type':Sequelize[_0xae0b('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xae0b('0x3')](_0xae0b('0x4'),_0xae0b('0x5'),_0xae0b('0x6')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9376=['first','third','exports','STRING','ENUM'];(function(_0x23292a,_0x1e08ea){var _0x4564f2=function(_0x1ae201){while(--_0x1ae201){_0x23292a['push'](_0x23292a['shift']());}};_0x4564f2(++_0x1e08ea);}(_0x9376,0x6b));var _0x6937=function(_0x461eb9,_0xce4607){_0x461eb9=_0x461eb9-0x0;var _0x26edc4=_0x9376[_0x461eb9];return _0x26edc4;};'use strict';var Sequelize=require('sequelize');module[_0x6937('0x0')]={'name':{'type':Sequelize[_0x6937('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x6937('0x2')](_0x6937('0x3'),'second',_0x6937('0x4')),'allowNull':![],'defaultValue':_0x6937('0x3')},'description':{'type':Sequelize[_0x6937('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 56a33a5..a00b550 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 _0x64e4=['sendStatus','error','name','send','index','map','Disposition','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource'];(function(_0x1fc4e2,_0x493c3b){var _0x2ba184=function(_0x58e64f){while(--_0x58e64f){_0x1fc4e2['push'](_0x1fc4e2['shift']());}};_0x2ba184(++_0x493c3b);}(_0x64e4,0x135));var _0x464e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64e4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x464e('0x0'));var rimraf=require(_0x464e('0x1'));var zipdir=require(_0x464e('0x2'));var jsonpatch=require(_0x464e('0x3'));var rp=require(_0x464e('0x4'));var moment=require(_0x464e('0x5'));var BPromise=require(_0x464e('0x6'));var Mustache=require(_0x464e('0x7'));var util=require(_0x464e('0x8'));var path=require(_0x464e('0x9'));var sox=require('sox');var csv=require(_0x464e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x464e('0xb'));var squel=require('squel');var crypto=require(_0x464e('0xc'));var jsforce=require(_0x464e('0xd'));var deskjs=require(_0x464e('0xe'));var toCsv=require(_0x464e('0xa'));var querystring=require(_0x464e('0xf'));var Papa=require(_0x464e('0x10'));var Redis=require(_0x464e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x464e('0x12'));var as=require(_0x464e('0x13'));var hardwareService=require(_0x464e('0x14'));var logger=require(_0x464e('0x15'))(_0x464e('0x16'));var utils=require('../../config/utils');var config=require(_0x464e('0x17'));var licenseUtil=require(_0x464e('0x18'));var db=require(_0x464e('0x19'))['db'];function respondWithStatusCode(_0x1b8734,_0x25524b){_0x25524b=_0x25524b||0xcc;return function(_0x468ed5){if(_0x468ed5){return _0x1b8734['sendStatus'](_0x25524b);}return _0x1b8734[_0x464e('0x1a')](_0x25524b)[_0x464e('0x1b')]();};}function respondWithResult(_0x166c62,_0x1354ed){_0x1354ed=_0x1354ed||0xc8;return function(_0x3fbfc2){if(_0x3fbfc2){return _0x166c62[_0x464e('0x1a')](_0x1354ed)[_0x464e('0x1c')](_0x3fbfc2);}};}function respondWithFilteredResult(_0x42c12c,_0x52052e){return function(_0x187b8d){if(_0x187b8d){var _0x134ab4=typeof _0x52052e['offset']===_0x464e('0x1d')&&typeof _0x52052e[_0x464e('0x1e')]===_0x464e('0x1d');var _0x1b382d=_0x187b8d[_0x464e('0x1f')];var _0x3806e4=_0x134ab4?0x0:_0x52052e[_0x464e('0x20')];var _0x3f8f1d=_0x134ab4?_0x187b8d[_0x464e('0x1f')]:_0x52052e[_0x464e('0x20')]+_0x52052e[_0x464e('0x1e')];var _0x1d33ce;if(_0x3f8f1d>=_0x1b382d){_0x3f8f1d=_0x1b382d;_0x1d33ce=0xc8;}else{_0x1d33ce=0xce;}_0x42c12c[_0x464e('0x1a')](_0x1d33ce);return _0x42c12c[_0x464e('0x21')](_0x464e('0x22'),_0x3806e4+'-'+_0x3f8f1d+'/'+_0x1b382d)[_0x464e('0x1c')](_0x187b8d);}return null;};}function patchUpdates(_0x1d00c3){return function(_0x3dccd4){try{jsonpatch[_0x464e('0x23')](_0x3dccd4,_0x1d00c3,!![]);}catch(_0x4bb040){return BPromise[_0x464e('0x24')](_0x4bb040);}return _0x3dccd4[_0x464e('0x25')]();};}function saveUpdates(_0x2f362b,_0x8f6c40){return function(_0x44e732){if(_0x44e732){return _0x44e732[_0x464e('0x26')](_0x2f362b)[_0x464e('0x27')](function(_0x53a0e9){return _0x53a0e9;});}return null;};}function removeEntity(_0x401e34,_0x13e71a){return function(_0x18a394){if(_0x18a394){return _0x18a394[_0x464e('0x28')]()['then'](function(){var _0xa7ecd1=_0x18a394[_0x464e('0x29')]({'plain':!![]});var _0x1bfd40='Dispositions';return db[_0x464e('0x2a')]['destroy']({'where':{'type':_0x1bfd40,'resourceId':_0xa7ecd1['id']}})[_0x464e('0x27')](function(){return _0x18a394;});})[_0x464e('0x27')](function(){_0x401e34['status'](0xcc)[_0x464e('0x1b')]();});}};}function handleEntityNotFound(_0x207636,_0x5677a9){return function(_0x50a241){if(!_0x50a241){_0x207636[_0x464e('0x2b')](0x194);}return _0x50a241;};}function handleError(_0x1ea6d9,_0x28c9fb){_0x28c9fb=_0x28c9fb||0x1f4;return function(_0x78c4a7){logger[_0x464e('0x2c')](_0x78c4a7['stack']);if(_0x78c4a7[_0x464e('0x2d')]){delete _0x78c4a7['name'];}_0x1ea6d9[_0x464e('0x1a')](_0x28c9fb)[_0x464e('0x2e')](_0x78c4a7);};}exports[_0x464e('0x2f')]=function(_0x45bc0f,_0x1fc87c){var _0x14d1bf={},_0x122185={},_0x38cdba={'count':0x0,'rows':[]};var _0x1c1d7d=_[_0x464e('0x30')](db[_0x464e('0x31')][_0x464e('0x32')],function(_0x1ef6ae){return{'name':_0x1ef6ae['fieldName'],'type':_0x1ef6ae[_0x464e('0x33')][_0x464e('0x34')]};});_0x122185[_0x464e('0x35')]=_[_0x464e('0x30')](_0x1c1d7d,_0x464e('0x2d'));_0x122185['query']=_[_0x464e('0x36')](_0x45bc0f[_0x464e('0x37')]);_0x122185[_0x464e('0x38')]=_[_0x464e('0x39')](_0x122185['model'],_0x122185[_0x464e('0x37')]);_0x14d1bf[_0x464e('0x3a')]=_['intersection'](_0x122185[_0x464e('0x35')],qs[_0x464e('0x3b')](_0x45bc0f['query']['fields']));_0x14d1bf[_0x464e('0x3a')]=_0x14d1bf[_0x464e('0x3a')][_0x464e('0x3c')]?_0x14d1bf[_0x464e('0x3a')]:_0x122185[_0x464e('0x35')];if(!_0x45bc0f['query'][_0x464e('0x3d')]('nolimit')){_0x14d1bf[_0x464e('0x1e')]=qs[_0x464e('0x1e')](_0x45bc0f[_0x464e('0x37')][_0x464e('0x1e')]);_0x14d1bf[_0x464e('0x20')]=qs[_0x464e('0x20')](_0x45bc0f[_0x464e('0x37')][_0x464e('0x20')]);}_0x14d1bf[_0x464e('0x3e')]=qs[_0x464e('0x3f')](_0x45bc0f[_0x464e('0x37')][_0x464e('0x3f')]);_0x14d1bf[_0x464e('0x40')]=qs[_0x464e('0x38')](_[_0x464e('0x41')](_0x45bc0f[_0x464e('0x37')],_0x122185['filters']),_0x1c1d7d);if(_0x45bc0f[_0x464e('0x37')][_0x464e('0x42')]){_0x14d1bf['where']=_['merge'](_0x14d1bf[_0x464e('0x40')],{'$or':_['map'](_0x1c1d7d,function(_0x4d7db9){if(_0x4d7db9[_0x464e('0x33')]!==_0x464e('0x43')){var _0x3909d5={};_0x3909d5[_0x4d7db9[_0x464e('0x2d')]]={'$like':'%'+_0x45bc0f[_0x464e('0x37')][_0x464e('0x42')]+'%'};return _0x3909d5;}})});}_0x14d1bf=_[_0x464e('0x44')]({},_0x14d1bf,_0x45bc0f[_0x464e('0x45')]);var _0x144b2a={'where':_0x14d1bf[_0x464e('0x40')]};return db[_0x464e('0x31')][_0x464e('0x1f')](_0x144b2a)[_0x464e('0x27')](function(_0x3837d1){_0x38cdba['count']=_0x3837d1;if(_0x45bc0f['query'][_0x464e('0x46')]){_0x14d1bf[_0x464e('0x47')]=[{'all':!![]}];}return db[_0x464e('0x31')][_0x464e('0x48')](_0x14d1bf);})[_0x464e('0x27')](function(_0x21b7e2){_0x38cdba[_0x464e('0x49')]=_0x21b7e2;return _0x38cdba;})[_0x464e('0x27')](respondWithFilteredResult(_0x1fc87c,_0x14d1bf))[_0x464e('0x4a')](handleError(_0x1fc87c,null));};exports[_0x464e('0x4b')]=function(_0x4e4065,_0x40e7e7){var _0x4f74e3={'raw':!![],'where':{'id':_0x4e4065[_0x464e('0x4c')]['id']}},_0x2b726e={};_0x2b726e[_0x464e('0x35')]=_['keys'](db[_0x464e('0x31')][_0x464e('0x32')]);_0x2b726e[_0x464e('0x37')]=_[_0x464e('0x36')](_0x4e4065[_0x464e('0x37')]);_0x2b726e[_0x464e('0x38')]=_[_0x464e('0x39')](_0x2b726e[_0x464e('0x35')],_0x2b726e['query']);_0x4f74e3['attributes']=_[_0x464e('0x39')](_0x2b726e['model'],qs['fields'](_0x4e4065[_0x464e('0x37')][_0x464e('0x3b')]));_0x4f74e3[_0x464e('0x3a')]=_0x4f74e3[_0x464e('0x3a')][_0x464e('0x3c')]?_0x4f74e3[_0x464e('0x3a')]:_0x2b726e[_0x464e('0x35')];if(_0x4e4065[_0x464e('0x37')][_0x464e('0x46')]){_0x4f74e3['include']=[{'all':!![]}];}_0x4f74e3=_[_0x464e('0x44')]({},_0x4f74e3,_0x4e4065['options']);return db[_0x464e('0x31')][_0x464e('0x4d')](_0x4f74e3)[_0x464e('0x27')](handleEntityNotFound(_0x40e7e7,null))[_0x464e('0x27')](respondWithResult(_0x40e7e7,null))[_0x464e('0x4a')](handleError(_0x40e7e7,null));};exports[_0x464e('0x4e')]=function(_0x565d42,_0x544cb6){return db[_0x464e('0x31')][_0x464e('0x4e')](_0x565d42['body'],{})[_0x464e('0x27')](function(_0x2ef1f3){var _0xbc01a0=_0x565d42[_0x464e('0x4f')][_0x464e('0x29')]({'plain':!![]});if(!_0xbc01a0)throw new Error(_0x464e('0x50'));if(_0xbc01a0[_0x464e('0x51')]==='user'){var _0x1f06fb=_0x2ef1f3[_0x464e('0x29')]({'plain':!![]});var _0x3a632b=_0x464e('0x52');return db[_0x464e('0x53')][_0x464e('0x4d')]({'where':{'name':_0x3a632b,'userProfileId':_0xbc01a0[_0x464e('0x54')]},'raw':!![]})[_0x464e('0x27')](function(_0x1ebd2e){if(_0x1ebd2e&&_0x1ebd2e[_0x464e('0x55')]===0x0){return db['UserProfileResource'][_0x464e('0x4e')]({'name':_0x1f06fb[_0x464e('0x2d')],'resourceId':_0x1f06fb['id'],'type':_0x1ebd2e['name'],'sectionId':_0x1ebd2e['id']},{})[_0x464e('0x27')](function(){return _0x2ef1f3;});}else{return _0x2ef1f3;}})[_0x464e('0x4a')](function(_0x5a729f){logger[_0x464e('0x2c')](_0x464e('0x56'),_0x5a729f);throw _0x5a729f;});}return _0x2ef1f3;})[_0x464e('0x27')](respondWithResult(_0x544cb6,0xc9))[_0x464e('0x4a')](handleError(_0x544cb6,null));};exports[_0x464e('0x26')]=function(_0x3421d7,_0x57108f){if(_0x3421d7[_0x464e('0x57')]['id']){delete _0x3421d7['body']['id'];}return db['Disposition'][_0x464e('0x4d')]({'where':{'id':_0x3421d7[_0x464e('0x4c')]['id']}})[_0x464e('0x27')](handleEntityNotFound(_0x57108f,null))['then'](saveUpdates(_0x3421d7[_0x464e('0x57')],null))[_0x464e('0x27')](respondWithResult(_0x57108f,null))['catch'](handleError(_0x57108f,null));};exports[_0x464e('0x28')]=function(_0xb0298e,_0x453f18){return db[_0x464e('0x31')]['find']({'where':{'id':_0xb0298e[_0x464e('0x4c')]['id']}})[_0x464e('0x27')](handleEntityNotFound(_0x453f18,null))['then'](removeEntity(_0x453f18,null))[_0x464e('0x4a')](handleError(_0x453f18,null));}; \ No newline at end of file +var _0xf2f7=['zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Dispositions','UserProfileResource','error','name','send','map','Disposition','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','length','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xf2f7,0xa3));var _0x7f2f=function(_0x5018c4,_0x370082){_0x5018c4=_0x5018c4-0x0;var _0x2f2ecc=_0xf2f7[_0x5018c4];return _0x2f2ecc;};'use strict';var emlformat=require(_0x7f2f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7f2f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7f2f('0x2'));var BPromise=require(_0x7f2f('0x3'));var Mustache=require(_0x7f2f('0x4'));var util=require(_0x7f2f('0x5'));var path=require(_0x7f2f('0x6'));var sox=require(_0x7f2f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f2f('0x8'));var _=require(_0x7f2f('0x9'));var squel=require(_0x7f2f('0xa'));var crypto=require('crypto');var jsforce=require(_0x7f2f('0xb'));var deskjs=require(_0x7f2f('0xc'));var toCsv=require(_0x7f2f('0xd'));var querystring=require(_0x7f2f('0xe'));var Papa=require('papaparse');var Redis=require(_0x7f2f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7f2f('0x10'));var as=require(_0x7f2f('0x11'));var hardwareService=require(_0x7f2f('0x12'));var logger=require('../../config/logger')(_0x7f2f('0x13'));var utils=require(_0x7f2f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7f2f('0x15'));var db=require(_0x7f2f('0x16'))['db'];function respondWithStatusCode(_0x56e266,_0x34c24e){_0x34c24e=_0x34c24e||0xcc;return function(_0x4fca23){if(_0x4fca23){return _0x56e266[_0x7f2f('0x17')](_0x34c24e);}return _0x56e266[_0x7f2f('0x18')](_0x34c24e)[_0x7f2f('0x19')]();};}function respondWithResult(_0x1f6552,_0x2b0be5){_0x2b0be5=_0x2b0be5||0xc8;return function(_0x2cf126){if(_0x2cf126){return _0x1f6552[_0x7f2f('0x18')](_0x2b0be5)[_0x7f2f('0x1a')](_0x2cf126);}};}function respondWithFilteredResult(_0x2edb2c,_0x5aa33c){return function(_0x4a14f5){if(_0x4a14f5){var _0x264999=typeof _0x5aa33c[_0x7f2f('0x1b')]===_0x7f2f('0x1c')&&typeof _0x5aa33c[_0x7f2f('0x1d')]==='undefined';var _0x1aea47=_0x4a14f5[_0x7f2f('0x1e')];var _0x3a77a4=_0x264999?0x0:_0x5aa33c[_0x7f2f('0x1b')];var _0x21462e=_0x264999?_0x4a14f5[_0x7f2f('0x1e')]:_0x5aa33c[_0x7f2f('0x1b')]+_0x5aa33c['limit'];var _0xd6187e;if(_0x21462e>=_0x1aea47){_0x21462e=_0x1aea47;_0xd6187e=0xc8;}else{_0xd6187e=0xce;}_0x2edb2c[_0x7f2f('0x18')](_0xd6187e);return _0x2edb2c[_0x7f2f('0x1f')]('Content-Range',_0x3a77a4+'-'+_0x21462e+'/'+_0x1aea47)[_0x7f2f('0x1a')](_0x4a14f5);}return null;};}function patchUpdates(_0x1ca790){return function(_0x462154){try{jsonpatch[_0x7f2f('0x20')](_0x462154,_0x1ca790,!![]);}catch(_0x335876){return BPromise['reject'](_0x335876);}return _0x462154[_0x7f2f('0x21')]();};}function saveUpdates(_0x295aad,_0x13d5a3){return function(_0x49025f){if(_0x49025f){return _0x49025f[_0x7f2f('0x22')](_0x295aad)[_0x7f2f('0x23')](function(_0x5250f2){return _0x5250f2;});}return null;};}function removeEntity(_0x20710d,_0x5e428b){return function(_0x1c046d){if(_0x1c046d){return _0x1c046d[_0x7f2f('0x24')]()[_0x7f2f('0x23')](function(){var _0x26ae2c=_0x1c046d[_0x7f2f('0x25')]({'plain':!![]});var _0x2a0ae1=_0x7f2f('0x26');return db[_0x7f2f('0x27')]['destroy']({'where':{'type':_0x2a0ae1,'resourceId':_0x26ae2c['id']}})[_0x7f2f('0x23')](function(){return _0x1c046d;});})[_0x7f2f('0x23')](function(){_0x20710d[_0x7f2f('0x18')](0xcc)[_0x7f2f('0x19')]();});}};}function handleEntityNotFound(_0x2ee922,_0x25f89b){return function(_0x412b9a){if(!_0x412b9a){_0x2ee922[_0x7f2f('0x17')](0x194);}return _0x412b9a;};}function handleError(_0x1d4380,_0x58c4df){_0x58c4df=_0x58c4df||0x1f4;return function(_0x259451){logger[_0x7f2f('0x28')](_0x259451['stack']);if(_0x259451[_0x7f2f('0x29')]){delete _0x259451[_0x7f2f('0x29')];}_0x1d4380[_0x7f2f('0x18')](_0x58c4df)[_0x7f2f('0x2a')](_0x259451);};}exports['index']=function(_0x1adf9d,_0x37b4c8){var _0x5b6f0c={},_0x442395={},_0x12c139={'count':0x0,'rows':[]};var _0x21d779=_[_0x7f2f('0x2b')](db[_0x7f2f('0x2c')][_0x7f2f('0x2d')],function(_0x52459a){return{'name':_0x52459a[_0x7f2f('0x2e')],'type':_0x52459a['type'][_0x7f2f('0x2f')]};});_0x442395[_0x7f2f('0x30')]=_[_0x7f2f('0x2b')](_0x21d779,_0x7f2f('0x29'));_0x442395[_0x7f2f('0x31')]=_[_0x7f2f('0x32')](_0x1adf9d['query']);_0x442395['filters']=_[_0x7f2f('0x33')](_0x442395[_0x7f2f('0x30')],_0x442395['query']);_0x5b6f0c[_0x7f2f('0x34')]=_[_0x7f2f('0x33')](_0x442395['model'],qs['fields'](_0x1adf9d['query'][_0x7f2f('0x35')]));_0x5b6f0c[_0x7f2f('0x34')]=_0x5b6f0c[_0x7f2f('0x34')]['length']?_0x5b6f0c['attributes']:_0x442395[_0x7f2f('0x30')];if(!_0x1adf9d[_0x7f2f('0x31')]['hasOwnProperty'](_0x7f2f('0x36'))){_0x5b6f0c[_0x7f2f('0x1d')]=qs[_0x7f2f('0x1d')](_0x1adf9d[_0x7f2f('0x31')][_0x7f2f('0x1d')]);_0x5b6f0c[_0x7f2f('0x1b')]=qs[_0x7f2f('0x1b')](_0x1adf9d[_0x7f2f('0x31')][_0x7f2f('0x1b')]);}_0x5b6f0c[_0x7f2f('0x37')]=qs['sort'](_0x1adf9d[_0x7f2f('0x31')][_0x7f2f('0x38')]);_0x5b6f0c['where']=qs[_0x7f2f('0x39')](_[_0x7f2f('0x3a')](_0x1adf9d[_0x7f2f('0x31')],_0x442395[_0x7f2f('0x39')]),_0x21d779);if(_0x1adf9d[_0x7f2f('0x31')][_0x7f2f('0x3b')]){_0x5b6f0c['where']=_['merge'](_0x5b6f0c[_0x7f2f('0x3c')],{'$or':_[_0x7f2f('0x2b')](_0x21d779,function(_0x201226){if(_0x201226['type']!==_0x7f2f('0x3d')){var _0x4a1855={};_0x4a1855[_0x201226[_0x7f2f('0x29')]]={'$like':'%'+_0x1adf9d['query'][_0x7f2f('0x3b')]+'%'};return _0x4a1855;}})});}_0x5b6f0c=_[_0x7f2f('0x3e')]({},_0x5b6f0c,_0x1adf9d[_0x7f2f('0x3f')]);var _0x18217f={'where':_0x5b6f0c[_0x7f2f('0x3c')]};return db['Disposition'][_0x7f2f('0x1e')](_0x18217f)['then'](function(_0x204a7d){_0x12c139[_0x7f2f('0x1e')]=_0x204a7d;if(_0x1adf9d[_0x7f2f('0x31')][_0x7f2f('0x40')]){_0x5b6f0c[_0x7f2f('0x41')]=[{'all':!![]}];}return db[_0x7f2f('0x2c')][_0x7f2f('0x42')](_0x5b6f0c);})[_0x7f2f('0x23')](function(_0x3dbcf4){_0x12c139[_0x7f2f('0x43')]=_0x3dbcf4;return _0x12c139;})[_0x7f2f('0x23')](respondWithFilteredResult(_0x37b4c8,_0x5b6f0c))['catch'](handleError(_0x37b4c8,null));};exports[_0x7f2f('0x44')]=function(_0x42eaf0,_0x31337e){var _0xc4bee0={'raw':!![],'where':{'id':_0x42eaf0['params']['id']}},_0x204020={};_0x204020[_0x7f2f('0x30')]=_[_0x7f2f('0x32')](db[_0x7f2f('0x2c')]['rawAttributes']);_0x204020[_0x7f2f('0x31')]=_[_0x7f2f('0x32')](_0x42eaf0['query']);_0x204020[_0x7f2f('0x39')]=_[_0x7f2f('0x33')](_0x204020[_0x7f2f('0x30')],_0x204020['query']);_0xc4bee0['attributes']=_[_0x7f2f('0x33')](_0x204020[_0x7f2f('0x30')],qs[_0x7f2f('0x35')](_0x42eaf0['query'][_0x7f2f('0x35')]));_0xc4bee0[_0x7f2f('0x34')]=_0xc4bee0[_0x7f2f('0x34')][_0x7f2f('0x45')]?_0xc4bee0[_0x7f2f('0x34')]:_0x204020[_0x7f2f('0x30')];if(_0x42eaf0[_0x7f2f('0x31')][_0x7f2f('0x40')]){_0xc4bee0[_0x7f2f('0x41')]=[{'all':!![]}];}_0xc4bee0=_[_0x7f2f('0x3e')]({},_0xc4bee0,_0x42eaf0['options']);return db[_0x7f2f('0x2c')][_0x7f2f('0x46')](_0xc4bee0)['then'](handleEntityNotFound(_0x31337e,null))[_0x7f2f('0x23')](respondWithResult(_0x31337e,null))[_0x7f2f('0x47')](handleError(_0x31337e,null));};exports[_0x7f2f('0x48')]=function(_0x155453,_0x5eae7e){return db[_0x7f2f('0x2c')]['create'](_0x155453['body'],{})[_0x7f2f('0x23')](function(_0x4de409){var _0x29efce=_0x155453['user'][_0x7f2f('0x25')]({'plain':!![]});if(!_0x29efce)throw new Error(_0x7f2f('0x49'));if(_0x29efce[_0x7f2f('0x4a')]===_0x7f2f('0x4b')){var _0x12537a=_0x4de409[_0x7f2f('0x25')]({'plain':!![]});var _0x11ef5e=_0x7f2f('0x26');return db[_0x7f2f('0x4c')][_0x7f2f('0x46')]({'where':{'name':_0x11ef5e,'userProfileId':_0x29efce[_0x7f2f('0x4d')]},'raw':!![]})[_0x7f2f('0x23')](function(_0x15d725){if(_0x15d725&&_0x15d725[_0x7f2f('0x4e')]===0x0){return db[_0x7f2f('0x27')][_0x7f2f('0x48')]({'name':_0x12537a[_0x7f2f('0x29')],'resourceId':_0x12537a['id'],'type':_0x15d725[_0x7f2f('0x29')],'sectionId':_0x15d725['id']},{})['then'](function(){return _0x4de409;});}else{return _0x4de409;}})[_0x7f2f('0x47')](function(_0x3cf50c){logger['error'](_0x7f2f('0x4f'),_0x3cf50c);throw _0x3cf50c;});}return _0x4de409;})[_0x7f2f('0x23')](respondWithResult(_0x5eae7e,0xc9))[_0x7f2f('0x47')](handleError(_0x5eae7e,null));};exports[_0x7f2f('0x22')]=function(_0x5b9f44,_0x478ff0){if(_0x5b9f44[_0x7f2f('0x50')]['id']){delete _0x5b9f44[_0x7f2f('0x50')]['id'];}return db[_0x7f2f('0x2c')][_0x7f2f('0x46')]({'where':{'id':_0x5b9f44[_0x7f2f('0x51')]['id']}})[_0x7f2f('0x23')](handleEntityNotFound(_0x478ff0,null))[_0x7f2f('0x23')](saveUpdates(_0x5b9f44['body'],null))['then'](respondWithResult(_0x478ff0,null))['catch'](handleError(_0x478ff0,null));};exports[_0x7f2f('0x24')]=function(_0x61a033,_0x3d1715){return db[_0x7f2f('0x2c')][_0x7f2f('0x46')]({'where':{'id':_0x61a033[_0x7f2f('0x51')]['id']}})[_0x7f2f('0x23')](handleEntityNotFound(_0x3d1715,null))[_0x7f2f('0x23')](removeEntity(_0x3d1715,null))['catch'](handleError(_0x3d1715,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 3f241ef..7e9ee77 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 _0xed3d=['../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','MailAccountId','name_fax','FaxAccountId','name_whatsapp','WhatsappAccountId','api','moment','bluebird','request-promise','path'];(function(_0x3e429d,_0x125d0d){var _0x167cf1=function(_0x44d496){while(--_0x44d496){_0x3e429d['push'](_0x3e429d['shift']());}};_0x167cf1(++_0x125d0d);}(_0xed3d,0x1e9));var _0xded3=function(_0x326c4a,_0x454deb){_0x326c4a=_0x326c4a-0x0;var _0x4b489d=_0xed3d[_0x326c4a];return _0x4b489d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xded3('0x0'));var moment=require(_0xded3('0x1'));var BPromise=require(_0xded3('0x2'));var rp=require(_0xded3('0x3'));var fs=require('fs');var path=require(_0xded3('0x4'));var rimraf=require('rimraf');var config=require(_0xded3('0x5'));var attributes=require(_0xded3('0x6'));module[_0xded3('0x7')]=function(_0x2c4d0f,_0x57f634){return _0x2c4d0f[_0xded3('0x8')]('Disposition',attributes,{'tableName':_0xded3('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xded3('0xa'),'fields':[_0xded3('0xb'),_0xded3('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0xded3('0xb'),_0xded3('0xd')]},{'unique':!![],'name':'name_mail','fields':[_0xded3('0xb'),_0xded3('0xe')]},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':_0xded3('0xf'),'fields':['name',_0xded3('0x10')]},{'unique':!![],'name':'name_openchannel','fields':[_0xded3('0xb'),'OpenchannelAccountId']},{'unique':!![],'name':_0xded3('0x11'),'fields':[_0xded3('0xb'),_0xded3('0x12')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b3f=['name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','WhatsappAccountId','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','ListId'];(function(_0x58977a,_0x2bddec){var _0x1162b4=function(_0x5602de){while(--_0x5602de){_0x58977a['push'](_0x58977a['shift']());}};_0x1162b4(++_0x2bddec);}(_0x5b3f,0x194));var _0xf5b3=function(_0x25e21c,_0x447bde){_0x25e21c=_0x25e21c-0x0;var _0x410b02=_0x5b3f[_0x25e21c];return _0x410b02;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf5b3('0x0'));var moment=require(_0xf5b3('0x1'));var BPromise=require(_0xf5b3('0x2'));var rp=require(_0xf5b3('0x3'));var fs=require('fs');var path=require(_0xf5b3('0x4'));var rimraf=require(_0xf5b3('0x5'));var config=require(_0xf5b3('0x6'));var attributes=require(_0xf5b3('0x7'));module[_0xf5b3('0x8')]=function(_0x1163be,_0x19b527){return _0x1163be['define'](_0xf5b3('0x9'),attributes,{'tableName':_0xf5b3('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xf5b3('0xb'),'fields':[_0xf5b3('0xc'),_0xf5b3('0xd')]},{'unique':!![],'name':_0xf5b3('0xe'),'fields':[_0xf5b3('0xc'),_0xf5b3('0xf')]},{'unique':!![],'name':'name_mail','fields':['name',_0xf5b3('0x10')]},{'unique':!![],'name':_0xf5b3('0x11'),'fields':[_0xf5b3('0xc'),_0xf5b3('0x12')]},{'unique':!![],'name':'name_fax','fields':[_0xf5b3('0xc'),_0xf5b3('0x13')]},{'unique':!![],'name':_0xf5b3('0x14'),'fields':[_0xf5b3('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0xf5b3('0xc'),_0xf5b3('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 4f3fd53..e3c0de5 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(_0x52cba7,_0x570581){var _0x10d534=function(_0x103607){while(--_0x103607){_0x52cba7['push'](_0x52cba7['shift']());}};_0x10d534(++_0x570581);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0xbce1f5,_0x3d2457){var _0x4a6612=function(_0x2a383a){while(--_0x2a383a){_0xbce1f5['push'](_0xbce1f5['shift']());}};_0x4a6612(++_0x3d2457);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 94f6366..aff2f4c 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 _0xb14c=['/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','get','isAuthenticated'];(function(_0x2d6e66,_0x3de933){var _0x42af90=function(_0x1cf6df){while(--_0x1cf6df){_0x2d6e66['push'](_0x2d6e66['shift']());}};_0x42af90(++_0x3de933);}(_0xb14c,0xac));var _0xcb14=function(_0x3b0866,_0x454edd){_0x3b0866=_0x3b0866-0x0;var _0x323008=_0xb14c[_0x3b0866];return _0x323008;};'use strict';var multer=require(_0xcb14('0x0'));var util=require(_0xcb14('0x1'));var path=require(_0xcb14('0x2'));var timeout=require(_0xcb14('0x3'));var express=require(_0xcb14('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcb14('0x5'));var controller=require('./disposition.controller');router[_0xcb14('0x6')]('/',auth[_0xcb14('0x7')](),controller['index']);router[_0xcb14('0x6')](_0xcb14('0x8'),auth[_0xcb14('0x7')](),controller[_0xcb14('0x9')]);router[_0xcb14('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcb14('0xb')](_0xcb14('0x8'),auth[_0xcb14('0x7')](),controller['update']);router[_0xcb14('0xc')](_0xcb14('0x8'),auth[_0xcb14('0x7')](),controller[_0xcb14('0xd')]);module[_0xcb14('0xe')]=router; \ No newline at end of file +var _0x3723=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','index','get','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports'];(function(_0x3bd4de,_0x19cfc6){var _0x515c2b=function(_0x1bc4a5){while(--_0x1bc4a5){_0x3bd4de['push'](_0x3bd4de['shift']());}};_0x515c2b(++_0x19cfc6);}(_0x3723,0x93));var _0x3372=function(_0x47f52d,_0x53784e){_0x47f52d=_0x47f52d-0x0;var _0x251387=_0x3723[_0x47f52d];return _0x251387;};'use strict';var multer=require(_0x3372('0x0'));var util=require(_0x3372('0x1'));var path=require('path');var timeout=require(_0x3372('0x2'));var express=require('express');var router=express[_0x3372('0x3')]();var fs_extra=require(_0x3372('0x4'));var auth=require(_0x3372('0x5'));var interaction=require(_0x3372('0x6'));var config=require(_0x3372('0x7'));var controller=require(_0x3372('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3372('0x9')]);router[_0x3372('0xa')](_0x3372('0xb'),auth['isAuthenticated'](),controller[_0x3372('0xc')]);router[_0x3372('0xd')]('/',auth[_0x3372('0xe')](),controller[_0x3372('0xf')]);router[_0x3372('0x10')]('/:id',auth[_0x3372('0xe')](),controller[_0x3372('0x11')]);router[_0x3372('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3372('0x13')]);module[_0x3372('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 6c9cfa9..bd03f3f 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 _0xef17=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','14400','4800','9600','12000','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x4c8833,_0x14e755){var _0x30df54=function(_0x197811){while(--_0x197811){_0x4c8833['push'](_0x4c8833['shift']());}};_0x30df54(++_0x14e755);}(_0xef17,0x136));var _0x7ef1=function(_0x48a37e,_0x2be620){_0x48a37e=_0x48a37e-0x0;var _0x1a94c3=_0xef17[_0x48a37e];return _0x1a94c3;};'use strict';var Sequelize=require(_0x7ef1('0x0'));module[_0x7ef1('0x1')]={'name':{'type':Sequelize[_0x7ef1('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7ef1('0x2')]},'ecm':{'type':Sequelize[_0x7ef1('0x3')](_0x7ef1('0x4'),'no'),'defaultValue':_0x7ef1('0x4')},'headerinfo':{'type':Sequelize[_0x7ef1('0x2')],'defaultValue':_0x7ef1('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x7ef1('0x6')},'minrate':{'type':Sequelize['ENUM'](_0x7ef1('0x7'),'4800',_0x7ef1('0x8'),'9600','12000',_0x7ef1('0x9')),'defaultValue':_0x7ef1('0xa')},'maxrate':{'type':Sequelize['ENUM'](_0x7ef1('0x7'),_0x7ef1('0xa'),_0x7ef1('0x8'),_0x7ef1('0xb'),_0x7ef1('0xc'),_0x7ef1('0x9')),'defaultValue':_0x7ef1('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x7ef1('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x7ef1('0xd'),'IAX',_0x7ef1('0xe'),_0x7ef1('0xf')),'defaultValue':_0x7ef1('0xd')},'key':{'type':Sequelize[_0x7ef1('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7ef1('0x10')],'defaultValue':function(){return _0x7ef1('0x11');}},'notificationSound':{'type':Sequelize[_0x7ef1('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7ef1('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7ef1('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7ef1('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7ef1('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7ef1('0x14'),'set':function(_0x4da0fa){if(!_0x4da0fa)this[_0x7ef1('0x15')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x4da0fa);}}}; \ No newline at end of file +var _0xe2bc=['14400','9600','v17,v27,v29','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','12000'];(function(_0x3a2c09,_0x1a6d10){var _0x94a0dd=function(_0x2593e8){while(--_0x2593e8){_0x3a2c09['push'](_0x3a2c09['shift']());}};_0x94a0dd(++_0x1a6d10);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xe2bc[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require(_0xce2b('0x0'));module['exports']={'name':{'type':Sequelize[_0xce2b('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xce2b('0x2')](_0xce2b('0x3'),'no'),'defaultValue':_0xce2b('0x3')},'headerinfo':{'type':Sequelize[_0xce2b('0x1')],'defaultValue':_0xce2b('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xce2b('0x5')},'minrate':{'type':Sequelize[_0xce2b('0x2')](_0xce2b('0x6'),_0xce2b('0x7'),_0xce2b('0x8'),'9600',_0xce2b('0x9'),_0xce2b('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xce2b('0x2')](_0xce2b('0x6'),_0xce2b('0x7'),_0xce2b('0x8'),_0xce2b('0xb'),_0xce2b('0x9'),_0xce2b('0xa')),'defaultValue':_0xce2b('0xa')},'modem':{'type':Sequelize[_0xce2b('0x1')],'defaultValue':_0xce2b('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xce2b('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xce2b('0x2')](_0xce2b('0xd'),_0xce2b('0xe'),_0xce2b('0xf'),_0xce2b('0x10')),'defaultValue':_0xce2b('0xd')},'key':{'type':Sequelize[_0xce2b('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xce2b('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xce2b('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xce2b('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xce2b('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xce2b('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xce2b('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xce2b('0x12')],'defaultValue':![],'comment':_0xce2b('0x14'),'set':function(_0x8bf420){if(!_0x8bf420)this[_0xce2b('0x15')](_0xce2b('0x16'),null);this[_0xce2b('0x15')](_0xce2b('0x17'),_0x8bf420);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index f4c0e65..a4b42b7 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 _0x219c=['Messages','dataValues','SendFax','SendFaxRpc,\x20%s','spread','userFaxAccount:save','removeAgents','isArray','emit','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','set','apply','save','update','destroy','get','UserProfileResource','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','show','params','Pause','include','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','find','userProfileId','autoAssociation','body','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','ids','getInteractions','User','fullname','internal','Tag','Tags','color','tag','findAll','addApplications','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','findById','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','ContactId'];(function(_0x2559d0,_0x18ca47){var _0x4d1f87=function(_0x22ef0e){while(--_0x22ef0e){_0x2559d0['push'](_0x2559d0['shift']());}};_0x4d1f87(++_0x18ca47);}(_0x219c,0x19c));var _0xc219=function(_0x139ae4,_0x49e764){_0x139ae4=_0x139ae4-0x0;var _0x4a9d3b=_0x219c[_0x139ae4];return _0x4a9d3b;};'use strict';var emlformat=require(_0xc219('0x0'));var rimraf=require(_0xc219('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc219('0x2'));var rp=require(_0xc219('0x3'));var moment=require(_0xc219('0x4'));var BPromise=require(_0xc219('0x5'));var Mustache=require('mustache');var util=require(_0xc219('0x6'));var path=require(_0xc219('0x7'));var sox=require(_0xc219('0x8'));var csv=require(_0xc219('0x9'));var ejs=require(_0xc219('0xa'));var fs=require('fs');var fs_extra=require(_0xc219('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc219('0xc'));var jsforce=require(_0xc219('0xd'));var deskjs=require(_0xc219('0xe'));var toCsv=require(_0xc219('0x9'));var querystring=require(_0xc219('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc219('0x10'));var qs=require(_0xc219('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc219('0x12'))(_0xc219('0x13'));var utils=require('../../config/utils');var config=require(_0xc219('0x14'));var licenseUtil=require(_0xc219('0x15'));var db=require(_0xc219('0x16'))['db'];config[_0xc219('0x17')]=_[_0xc219('0x18')](config['redis'],{'host':_0xc219('0x19'),'port':0x18eb});var socket=require(_0xc219('0x1a'))(new Redis(config[_0xc219('0x17')]));require(_0xc219('0x1b'))['register'](socket);var jayson=require(_0xc219('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xc219('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b3dbb,_0x10856f,_0x3150d1,_0x139e89){return new BPromise(function(_0x418c3f,_0x421cc1){var _0x3f2304=_0x139e89||client;return _0x3f2304[_0xc219('0x1e')](_0x2b3dbb,_0x3150d1)[_0xc219('0x1f')](function(_0x745fea){logger['info'](_0xc219('0x20'),_0x10856f,_0xc219('0x21'));logger[_0xc219('0x22')](_0xc219('0x23'),_0x10856f,_0xc219('0x21'),JSON[_0xc219('0x24')](_0x745fea));if(_0x745fea[_0xc219('0x25')]){if(_0x745fea[_0xc219('0x25')][_0xc219('0x26')]===0x1f4){logger[_0xc219('0x25')](_0xc219('0x20'),_0x10856f,_0x745fea[_0xc219('0x25')][_0xc219('0x27')]);return _0x421cc1(_0x745fea[_0xc219('0x25')][_0xc219('0x27')]);}logger['error'](_0xc219('0x20'),_0x10856f,_0x745fea[_0xc219('0x25')][_0xc219('0x27')]);return _0x418c3f(_0x745fea[_0xc219('0x25')][_0xc219('0x27')]);}else{logger[_0xc219('0x28')]('FaxAccount,\x20%s,\x20%s',_0x10856f,_0xc219('0x21'));_0x418c3f(_0x745fea[_0xc219('0x29')][_0xc219('0x27')]);}})['catch'](function(_0x3f7862){logger[_0xc219('0x25')](_0xc219('0x20'),_0x10856f,_0x3f7862);_0x421cc1(_0x3f7862);});});}function respondWithStatusCode(_0x451638,_0x330370){_0x330370=_0x330370||0xcc;return function(_0x10a027){if(_0x10a027){return _0x451638[_0xc219('0x2a')](_0x330370);}return _0x451638[_0xc219('0x2b')](_0x330370)[_0xc219('0x2c')]();};}function respondWithResult(_0x553aa9,_0xe50c11){_0xe50c11=_0xe50c11||0xc8;return function(_0x26c845){if(_0x26c845){return _0x553aa9['status'](_0xe50c11)[_0xc219('0x2d')](_0x26c845);}};}function respondWithFilteredResult(_0x1377dc,_0x467155){return function(_0x22d661){if(_0x22d661){var _0x265acf=typeof _0x467155[_0xc219('0x2e')]==='undefined'&&typeof _0x467155[_0xc219('0x2f')]==='undefined';var _0x2693d9=_0x22d661['count'];var _0x49cb06=_0x265acf?0x0:_0x467155[_0xc219('0x2e')];var _0xd06abe=_0x265acf?_0x22d661['count']:_0x467155[_0xc219('0x2e')]+_0x467155[_0xc219('0x2f')];var _0x447a11;if(_0xd06abe>=_0x2693d9){_0xd06abe=_0x2693d9;_0x447a11=0xc8;}else{_0x447a11=0xce;}_0x1377dc['status'](_0x447a11);return _0x1377dc[_0xc219('0x30')]('Content-Range',_0x49cb06+'-'+_0xd06abe+'/'+_0x2693d9)[_0xc219('0x2d')](_0x22d661);}return null;};}function patchUpdates(_0x16723f){return function(_0x48fb84){try{jsonpatch[_0xc219('0x31')](_0x48fb84,_0x16723f,!![]);}catch(_0x4a46d0){return BPromise['reject'](_0x4a46d0);}return _0x48fb84[_0xc219('0x32')]();};}function saveUpdates(_0x60f6c7,_0x5ee40c){return function(_0x31e923){if(_0x31e923){return _0x31e923[_0xc219('0x33')](_0x60f6c7)[_0xc219('0x1f')](function(_0x178036){return _0x178036;});}return null;};}function removeEntity(_0x59183a,_0x10fe2f){return function(_0x1e8613){if(_0x1e8613){return _0x1e8613[_0xc219('0x34')]()[_0xc219('0x1f')](function(){var _0x7dd6fe=_0x1e8613[_0xc219('0x35')]({'plain':!![]});var _0x7e02a8='FaxAccounts';return db[_0xc219('0x36')][_0xc219('0x34')]({'where':{'type':_0x7e02a8,'resourceId':_0x7dd6fe['id']}})[_0xc219('0x1f')](function(){return _0x1e8613;});})[_0xc219('0x1f')](function(){_0x59183a[_0xc219('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x415348,_0x2fe816){return function(_0x11446b){if(!_0x11446b){_0x415348[_0xc219('0x2a')](0x194);}return _0x11446b;};}function handleError(_0x4b88fe,_0x32d36a){_0x32d36a=_0x32d36a||0x1f4;return function(_0x21fa63){logger[_0xc219('0x25')](_0x21fa63['stack']);if(_0x21fa63[_0xc219('0x37')]){delete _0x21fa63[_0xc219('0x37')];}_0x4b88fe[_0xc219('0x2b')](_0x32d36a)[_0xc219('0x38')](_0x21fa63);};}exports[_0xc219('0x39')]=function(_0x199b16,_0x10bfec){var _0x32e025={'include':[{'model':db['Pause'],'as':_0xc219('0x3a')}]},_0x273520={},_0x586ad0={'count':0x0,'rows':[]};var _0x4234df=_[_0xc219('0x3b')](db[_0xc219('0x3c')][_0xc219('0x3d')],function(_0x35f8ba){return{'name':_0x35f8ba['fieldName'],'type':_0x35f8ba[_0xc219('0x3e')][_0xc219('0x3f')]};});_0x273520[_0xc219('0x40')]=_[_0xc219('0x3b')](_0x4234df,_0xc219('0x37'));_0x273520[_0xc219('0x41')]=_[_0xc219('0x42')](_0x199b16[_0xc219('0x41')]);_0x273520['filters']=_[_0xc219('0x43')](_0x273520[_0xc219('0x40')],_0x273520[_0xc219('0x41')]);_0x32e025[_0xc219('0x44')]=_[_0xc219('0x43')](_0x273520['model'],qs[_0xc219('0x45')](_0x199b16[_0xc219('0x41')][_0xc219('0x45')]));_0x32e025[_0xc219('0x44')]=_0x32e025['attributes'][_0xc219('0x46')]?_0x32e025[_0xc219('0x44')]:_0x273520[_0xc219('0x40')];if(!_0x199b16[_0xc219('0x41')][_0xc219('0x47')](_0xc219('0x48'))){_0x32e025[_0xc219('0x2f')]=qs[_0xc219('0x2f')](_0x199b16[_0xc219('0x41')][_0xc219('0x2f')]);_0x32e025[_0xc219('0x2e')]=qs['offset'](_0x199b16[_0xc219('0x41')]['offset']);}_0x32e025[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0x199b16[_0xc219('0x41')][_0xc219('0x4a')]);_0x32e025[_0xc219('0x4b')]=qs[_0xc219('0x4c')](_[_0xc219('0x4d')](_0x199b16[_0xc219('0x41')],_0x273520['filters']),_0x4234df);if(_0x199b16[_0xc219('0x41')][_0xc219('0x4e')]){_0x32e025['where']=_[_0xc219('0x4f')](_0x32e025['where'],{'$or':_[_0xc219('0x3b')](_0x4234df,function(_0x23aa00){if(_0x23aa00[_0xc219('0x3e')]!==_0xc219('0x50')){var _0x516ba5={};_0x516ba5[_0x23aa00[_0xc219('0x37')]]={'$like':'%'+_0x199b16['query']['filter']+'%'};return _0x516ba5;}})});}_0x32e025=_['merge']({},_0x32e025,_0x199b16[_0xc219('0x51')]);var _0x141c9d={'where':_0x32e025[_0xc219('0x4b')]};return db['FaxAccount'][_0xc219('0x52')](_0x141c9d)['then'](function(_0x4af2c3){_0x586ad0[_0xc219('0x52')]=_0x4af2c3;if(_0x199b16['query'][_0xc219('0x53')]){_0x32e025['include']=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x32e025);})[_0xc219('0x1f')](function(_0x297346){_0x586ad0[_0xc219('0x54')]=_0x297346;return _0x586ad0;})[_0xc219('0x1f')](respondWithFilteredResult(_0x10bfec,_0x32e025))['catch'](handleError(_0x10bfec,null));};exports[_0xc219('0x55')]=function(_0x1f6fe8,_0x21d39a){var _0x1ec7cb={'raw':![],'where':{'id':_0x1f6fe8[_0xc219('0x56')]['id']},'include':[{'model':db[_0xc219('0x57')],'as':'mandatoryDispositionPause'}]},_0x41f5b7={};_0x41f5b7['model']=_[_0xc219('0x42')](db[_0xc219('0x3c')][_0xc219('0x3d')]);_0x41f5b7[_0xc219('0x41')]=_['keys'](_0x1f6fe8[_0xc219('0x41')]);_0x41f5b7['filters']=_[_0xc219('0x43')](_0x41f5b7[_0xc219('0x40')],_0x41f5b7[_0xc219('0x41')]);_0x1ec7cb[_0xc219('0x44')]=_[_0xc219('0x43')](_0x41f5b7[_0xc219('0x40')],qs[_0xc219('0x45')](_0x1f6fe8['query'][_0xc219('0x45')]));_0x1ec7cb[_0xc219('0x44')]=_0x1ec7cb[_0xc219('0x44')][_0xc219('0x46')]?_0x1ec7cb[_0xc219('0x44')]:_0x41f5b7[_0xc219('0x40')];if(_0x1f6fe8[_0xc219('0x41')][_0xc219('0x53')]){_0x1ec7cb[_0xc219('0x58')]=[{'all':!![]}];}_0x1ec7cb=_[_0xc219('0x4f')]({},_0x1ec7cb,_0x1f6fe8[_0xc219('0x51')]);return db['FaxAccount']['find'](_0x1ec7cb)[_0xc219('0x1f')](handleEntityNotFound(_0x21d39a,null))[_0xc219('0x1f')](respondWithResult(_0x21d39a,null))[_0xc219('0x59')](handleError(_0x21d39a,null));};exports['create']=function(_0x5ee076,_0x151586){return db[_0xc219('0x3c')][_0xc219('0x5a')](_0x5ee076['body'],{})['then'](function(_0x4b7d9b){var _0x514034=_0x5ee076[_0xc219('0x5b')][_0xc219('0x35')]({'plain':!![]});if(!_0x514034)throw new Error(_0xc219('0x5c'));if(_0x514034[_0xc219('0x5d')]===_0xc219('0x5b')){var _0x347086=_0x4b7d9b[_0xc219('0x35')]({'plain':!![]});var _0x23218a=_0xc219('0x5e');return db[_0xc219('0x5f')][_0xc219('0x60')]({'where':{'name':_0x23218a,'userProfileId':_0x514034[_0xc219('0x61')]},'raw':!![]})[_0xc219('0x1f')](function(_0x3c5ace){if(_0x3c5ace&&_0x3c5ace[_0xc219('0x62')]===0x0){return db[_0xc219('0x36')][_0xc219('0x5a')]({'name':_0x347086[_0xc219('0x37')],'resourceId':_0x347086['id'],'type':_0x3c5ace[_0xc219('0x37')],'sectionId':_0x3c5ace['id']},{})[_0xc219('0x1f')](function(){return _0x4b7d9b;});}else{return _0x4b7d9b;}})[_0xc219('0x59')](function(_0x1c0edf){logger[_0xc219('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c0edf);throw _0x1c0edf;});}return _0x4b7d9b;})[_0xc219('0x1f')](respondWithResult(_0x151586,0xc9))['catch'](handleError(_0x151586,null));};exports[_0xc219('0x33')]=function(_0x305bee,_0x35532e){if(_0x305bee[_0xc219('0x63')]['id']){delete _0x305bee[_0xc219('0x63')]['id'];}return db[_0xc219('0x3c')][_0xc219('0x60')]({'where':{'id':_0x305bee['params']['id']},'include':[{'model':db[_0xc219('0x57')],'as':_0xc219('0x3a')}]})[_0xc219('0x1f')](handleEntityNotFound(_0x35532e,null))[_0xc219('0x1f')](saveUpdates(_0x305bee['body'],null))['then'](respondWithResult(_0x35532e,null))[_0xc219('0x59')](handleError(_0x35532e,null));};exports[_0xc219('0x34')]=function(_0x4cf1ce,_0xc0983c){return db[_0xc219('0x3c')]['find']({'where':{'id':_0x4cf1ce[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0xc0983c,null))[_0xc219('0x1f')](removeEntity(_0xc0983c,null))[_0xc219('0x59')](handleError(_0xc0983c,null));};exports['describe']=function(_0x49a3bf,_0x14c09f){return db['FaxAccount'][_0xc219('0x64')]()['then'](respondWithResult(_0x14c09f,null))[_0xc219('0x59')](handleError(_0x14c09f,null));};exports[_0xc219('0x65')]=function(_0x31d640,_0x212e6c,_0x30e29a){if(_0x31d640[_0xc219('0x63')]['id']){delete _0x31d640[_0xc219('0x63')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x31d640[_0xc219('0x56')]['id']}})['then'](handleEntityNotFound(_0x212e6c,null))[_0xc219('0x1f')](function(_0x2ca4b8){if(_0x2ca4b8){_0x31d640[_0xc219('0x63')][_0xc219('0x66')]=_0x2ca4b8['id'];return db['Disposition'][_0xc219('0x5a')](_0x31d640[_0xc219('0x63')]);}})[_0xc219('0x1f')](respondWithResult(_0x212e6c,null))[_0xc219('0x59')](handleError(_0x212e6c,null));};exports[_0xc219('0x67')]=function(_0xb83924,_0x1b9751,_0x3ef9ec){var _0x2a80be={'raw':![],'where':{}};var _0x22cf97={};var _0x3cb9d2={'count':0x0,'rows':[]};return db[_0xc219('0x3c')][_0xc219('0x68')]({'where':{'id':_0xb83924[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x1b9751,null))[_0xc219('0x1f')](function(_0x4698d1){if(_0x4698d1){_0x22cf97[_0xc219('0x40')]=_['keys'](db['Disposition']['rawAttributes']);_0x22cf97[_0xc219('0x41')]=_[_0xc219('0x42')](_0xb83924[_0xc219('0x41')]);_0x22cf97[_0xc219('0x4c')]=_['intersection'](_0x22cf97[_0xc219('0x40')],_0x22cf97[_0xc219('0x41')]);_0x2a80be[_0xc219('0x44')]=_[_0xc219('0x43')](_0x22cf97['model'],qs[_0xc219('0x45')](_0xb83924[_0xc219('0x41')][_0xc219('0x45')]));_0x2a80be[_0xc219('0x44')]=_0x2a80be['attributes'][_0xc219('0x46')]?_0x2a80be[_0xc219('0x44')]:_0x22cf97[_0xc219('0x40')];if(!_0xb83924['query']['hasOwnProperty'](_0xc219('0x48'))){_0x2a80be[_0xc219('0x2f')]=qs[_0xc219('0x2f')](_0xb83924[_0xc219('0x41')][_0xc219('0x2f')]);_0x2a80be['offset']=qs['offset'](_0xb83924[_0xc219('0x41')][_0xc219('0x2e')]);}_0x2a80be[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0xb83924[_0xc219('0x41')][_0xc219('0x4a')]);_0x2a80be['where']=qs[_0xc219('0x4c')](_['pick'](_0xb83924['query'],_0x22cf97['filters']));_0x2a80be['where'][_0xc219('0x66')]=_0x4698d1['id'];if(_0xb83924[_0xc219('0x41')][_0xc219('0x4e')]){_0x2a80be['where']=_[_0xc219('0x4f')](_0x2a80be['where'],{'$or':_[_0xc219('0x3b')](_0x2a80be['attributes'],function(_0x42efd6){var _0x5451b7={};_0x5451b7[_0x42efd6]={'$like':'%'+_0xb83924['query'][_0xc219('0x4e')]+'%'};return _0x5451b7;})});}_0x2a80be=_[_0xc219('0x4f')]({},_0x2a80be,_0xb83924[_0xc219('0x51')]);return db[_0xc219('0x69')]['count']({'where':_0x2a80be[_0xc219('0x4b')]})['then'](function(_0x209c0c){_0x3cb9d2[_0xc219('0x52')]=_0x209c0c;if(_0xb83924[_0xc219('0x41')][_0xc219('0x53')]){_0x2a80be['include']=[{'all':!![]}];}return db[_0xc219('0x69')]['findAll'](_0x2a80be);})['then'](function(_0x1012d5){_0x3cb9d2[_0xc219('0x54')]=_0x1012d5;return _0x3cb9d2;});}})[_0xc219('0x1f')](respondWithFilteredResult(_0x1b9751,_0x2a80be))[_0xc219('0x59')](handleError(_0x1b9751,null));};exports[_0xc219('0x6a')]=function(_0x1630c2,_0x46698f,_0x2629d6){return db['FaxAccount'][_0xc219('0x60')]({'where':{'id':_0x1630c2[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x46698f,null))[_0xc219('0x1f')](function(_0x4fbb13){if(_0x4fbb13){return _0x4fbb13['removeDispositions'](_0x1630c2[_0xc219('0x41')]['ids']);}})[_0xc219('0x1f')](respondWithStatusCode(_0x46698f,null))[_0xc219('0x59')](handleError(_0x46698f,null));};exports[_0xc219('0x6b')]=function(_0xb95efc,_0xd6ea93,_0x3b0a34){if(_0xb95efc[_0xc219('0x63')]['id']){delete _0xb95efc[_0xc219('0x63')]['id'];}return db[_0xc219('0x3c')]['find']({'where':{'id':_0xb95efc['params']['id']}})['then'](handleEntityNotFound(_0xd6ea93,null))[_0xc219('0x1f')](function(_0x12d2d8){if(_0x12d2d8){_0xb95efc['body'][_0xc219('0x66')]=_0x12d2d8['id'];return db[_0xc219('0x6c')][_0xc219('0x5a')](_0xb95efc[_0xc219('0x63')]);}})[_0xc219('0x1f')](respondWithResult(_0xd6ea93,null))['catch'](handleError(_0xd6ea93,null));};exports[_0xc219('0x6d')]=function(_0x1ac949,_0x1b6881,_0x57a6db){var _0x496657={'raw':![],'where':{}};var _0x4a392f={};var _0x193857={'count':0x0,'rows':[]};return db[_0xc219('0x3c')][_0xc219('0x68')]({'where':{'id':_0x1ac949['params']['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x1b6881,null))[_0xc219('0x1f')](function(_0x4860b8){if(_0x4860b8){_0x4a392f['model']=_[_0xc219('0x42')](db['CannedAnswer'][_0xc219('0x3d')]);_0x4a392f['query']=_[_0xc219('0x42')](_0x1ac949[_0xc219('0x41')]);_0x4a392f[_0xc219('0x4c')]=_[_0xc219('0x43')](_0x4a392f[_0xc219('0x40')],_0x4a392f[_0xc219('0x41')]);_0x496657['attributes']=_[_0xc219('0x43')](_0x4a392f[_0xc219('0x40')],qs[_0xc219('0x45')](_0x1ac949[_0xc219('0x41')][_0xc219('0x45')]));_0x496657[_0xc219('0x44')]=_0x496657[_0xc219('0x44')][_0xc219('0x46')]?_0x496657[_0xc219('0x44')]:_0x4a392f['model'];if(!_0x1ac949[_0xc219('0x41')][_0xc219('0x47')](_0xc219('0x48'))){_0x496657[_0xc219('0x2f')]=qs['limit'](_0x1ac949[_0xc219('0x41')][_0xc219('0x2f')]);_0x496657[_0xc219('0x2e')]=qs['offset'](_0x1ac949[_0xc219('0x41')][_0xc219('0x2e')]);}_0x496657[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0x1ac949['query'][_0xc219('0x4a')]);_0x496657[_0xc219('0x4b')]=qs[_0xc219('0x4c')](_[_0xc219('0x4d')](_0x1ac949[_0xc219('0x41')],_0x4a392f['filters']));_0x496657[_0xc219('0x4b')][_0xc219('0x66')]=_0x4860b8['id'];if(_0x1ac949[_0xc219('0x41')][_0xc219('0x4e')]){_0x496657[_0xc219('0x4b')]=_[_0xc219('0x4f')](_0x496657[_0xc219('0x4b')],{'$or':_['map'](_0x496657[_0xc219('0x44')],function(_0x131ac1){var _0x4ea0f0={};_0x4ea0f0[_0x131ac1]={'$like':'%'+_0x1ac949['query']['filter']+'%'};return _0x4ea0f0;})});}_0x496657=_[_0xc219('0x4f')]({},_0x496657,_0x1ac949[_0xc219('0x51')]);return db[_0xc219('0x6c')][_0xc219('0x52')]({'where':_0x496657[_0xc219('0x4b')]})['then'](function(_0xb96699){_0x193857['count']=_0xb96699;if(_0x1ac949[_0xc219('0x41')][_0xc219('0x53')]){_0x496657['include']=[{'all':!![]}];}return db[_0xc219('0x6c')]['findAll'](_0x496657);})['then'](function(_0x2055da){_0x193857[_0xc219('0x54')]=_0x2055da;return _0x193857;});}})[_0xc219('0x1f')](respondWithFilteredResult(_0x1b6881,_0x496657))['catch'](handleError(_0x1b6881,null));};exports[_0xc219('0x6e')]=function(_0x1fb191,_0x36ff64,_0x5f463b){return db[_0xc219('0x3c')][_0xc219('0x60')]({'where':{'id':_0x1fb191['params']['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x36ff64,null))['then'](function(_0x5d4b4a){if(_0x5d4b4a){return _0x5d4b4a[_0xc219('0x6e')](_0x1fb191[_0xc219('0x41')]['ids']);}})[_0xc219('0x1f')](respondWithStatusCode(_0x36ff64,null))[_0xc219('0x59')](handleError(_0x36ff64,null));};exports['addInteraction']=function(_0x155723,_0x46b485,_0x917f98){return db[_0xc219('0x6f')][_0xc219('0x60')]({'where':{'id':_0x155723[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x46b485,null))[_0xc219('0x1f')](function(_0x230a27){if(_0x230a27){return _0x230a27[_0xc219('0x70')](_0x155723[_0xc219('0x63')]['ids'],_[_0xc219('0x71')](_0x155723[_0xc219('0x63')],[_0xc219('0x72'),'id'])||{});}})['then'](respondWithResult(_0x46b485,null))['catch'](handleError(_0x46b485,null));};exports[_0xc219('0x73')]=function(_0x3640b0,_0x340bb9,_0x235b5e){var _0x125a4a={'raw':![],'where':{}};var _0x177a7d={};var _0x17fc42={'count':0x0,'rows':[]};return db['FaxAccount'][_0xc219('0x68')]({'where':{'id':_0x3640b0[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x340bb9,null))[_0xc219('0x1f')](function(_0x1a6562){if(_0x1a6562){_0x177a7d['model']=_[_0xc219('0x42')](db[_0xc219('0x6f')]['rawAttributes']);_0x177a7d[_0xc219('0x41')]=_[_0xc219('0x42')](_0x3640b0[_0xc219('0x41')]);_0x177a7d['filters']=_[_0xc219('0x43')](_0x177a7d['model'],_0x177a7d[_0xc219('0x41')]);_0x125a4a[_0xc219('0x44')]=_[_0xc219('0x43')](_0x177a7d['model'],qs['fields'](_0x3640b0['query'][_0xc219('0x45')]));_0x125a4a[_0xc219('0x44')]=_0x125a4a[_0xc219('0x44')][_0xc219('0x46')]?_0x125a4a['attributes']:_0x177a7d[_0xc219('0x40')];if(!_0x3640b0[_0xc219('0x41')][_0xc219('0x47')](_0xc219('0x48'))){_0x125a4a[_0xc219('0x2f')]=qs[_0xc219('0x2f')](_0x3640b0[_0xc219('0x41')][_0xc219('0x2f')]);_0x125a4a[_0xc219('0x2e')]=qs['offset'](_0x3640b0[_0xc219('0x41')][_0xc219('0x2e')]);}_0x125a4a[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0x3640b0[_0xc219('0x41')][_0xc219('0x4a')]);_0x125a4a[_0xc219('0x4b')]=qs[_0xc219('0x4c')](_[_0xc219('0x4d')](_0x3640b0[_0xc219('0x41')],_0x177a7d['filters']));_0x125a4a[_0xc219('0x4b')]['FaxAccountId']=_0x1a6562['id'];if(_0x3640b0[_0xc219('0x41')][_0xc219('0x4e')]){_0x125a4a[_0xc219('0x4b')]=_[_0xc219('0x4f')](_0x125a4a[_0xc219('0x4b')],{'$or':_[_0xc219('0x3b')](_0x125a4a[_0xc219('0x44')],function(_0x1af0ed){var _0x109567={};_0x109567[_0x1af0ed]={'$like':'%'+_0x3640b0[_0xc219('0x41')]['filter']+'%'};return _0x109567;})});}_0x125a4a=_[_0xc219('0x4f')]({},_0x125a4a,_0x3640b0[_0xc219('0x51')]);return db[_0xc219('0x6f')]['count']({'where':_0x125a4a[_0xc219('0x4b')]})[_0xc219('0x1f')](function(_0x452779){_0x17fc42[_0xc219('0x52')]=_0x452779;if(_0x3640b0[_0xc219('0x41')]['includeAll']){_0x125a4a[_0xc219('0x58')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xc219('0x74')],'as':'Owner','attributes':[_0xc219('0x37'),_0xc219('0x75'),_0xc219('0x76')],'required':![]},{'model':db[_0xc219('0x77')],'as':_0xc219('0x78'),'attributes':['id',_0xc219('0x37'),_0xc219('0x79')],'where':_0x3640b0[_0xc219('0x41')]['tag']?{'id':_0x3640b0[_0xc219('0x41')][_0xc219('0x7a')]}:undefined,'required':_0x3640b0[_0xc219('0x41')][_0xc219('0x7a')]?!![]:![]}];}return db[_0xc219('0x6f')][_0xc219('0x7b')](_0x125a4a);})[_0xc219('0x1f')](function(_0x18a769){_0x17fc42[_0xc219('0x54')]=_0x18a769;return _0x17fc42;});}})['then'](respondWithFilteredResult(_0x340bb9,_0x125a4a))[_0xc219('0x59')](handleError(_0x340bb9,null));};exports[_0xc219('0x7c')]=function(_0x5254cb,_0x56250c){var _0x2de6dc=_0x5254cb['params']['id'];var _0x4ba5c8=_0x5254cb[_0xc219('0x63')];var _0x5ad99a=0xc8;var _0x1efdc3=null;return db[_0xc219('0x7d')]['transaction']({'isolationLevel':db[_0xc219('0x7d')][_0xc219('0x7e')][_0xc219('0x7f')]['READ_COMMITTED']},function(_0x42ce55){return db['FaxAccount']['findOne']({'where':{'id':_0x2de6dc},'transaction':_0x42ce55})[_0xc219('0x1f')](function(_0x29a169){if(_0x29a169){return db[_0xc219('0x80')][_0xc219('0x34')]({'where':{'FaxAccountId':_0x2de6dc},'transaction':_0x42ce55})[_0xc219('0x1f')](function(){var _0x356a17=_[_0xc219('0x3b')](_0x4ba5c8,function(_0x114f65){_0x114f65['FaxAccountId']=_0x2de6dc;return _0x114f65;});return db[_0xc219('0x80')][_0xc219('0x81')](_0x356a17,{'transaction':_0x42ce55});});}else{_0x5ad99a=0x194;_0x1efdc3=[];}});})['then'](function(){if(_0x5ad99a!==0x194){return db[_0xc219('0x80')][_0xc219('0x82')]({'where':{'FaxAccountId':_0x2de6dc},'order':_0xc219('0x83')})[_0xc219('0x1f')](function(_0x3b32c0){_0x1efdc3=_0x3b32c0;});}})['catch'](function(_0x215f4e){_0x5ad99a=0x1f4;logger['error'](_0x215f4e['stack']);if(_0x215f4e['name']){delete _0x215f4e['name'];}_0x1efdc3=_0x215f4e;})[_0xc219('0x84')](function(){if(_0x1efdc3===null){_0x56250c[_0xc219('0x2a')](_0x5ad99a);}else{if(_0x5ad99a===0x1f4){_0x56250c[_0xc219('0x2b')](_0x5ad99a)['send'](_0x1efdc3);}else{_0x56250c['status'](_0x5ad99a)['json'](_0x1efdc3);}}});};exports[_0xc219('0x85')]=function(_0x3db914,_0x2fa065,_0x102920){var _0x2e2599={};var _0x3cac19={};var _0x21d652;var _0x427fac;return db['FaxAccount'][_0xc219('0x68')]({'where':{'id':_0x3db914[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x2fa065,null))[_0xc219('0x1f')](function(_0x9d8450){if(_0x9d8450){_0x21d652=_0x9d8450;_0x3cac19[_0xc219('0x40')]=_[_0xc219('0x42')](db['FaxApplication'][_0xc219('0x3d')]);_0x3cac19[_0xc219('0x41')]=_[_0xc219('0x42')](_0x3db914[_0xc219('0x41')]);_0x3cac19[_0xc219('0x4c')]=_[_0xc219('0x43')](_0x3cac19[_0xc219('0x40')],_0x3cac19['query']);_0x2e2599['attributes']=_['intersection'](_0x3cac19['model'],qs['fields'](_0x3db914[_0xc219('0x41')][_0xc219('0x45')]));_0x2e2599[_0xc219('0x44')]=_0x2e2599[_0xc219('0x44')]['length']?_0x2e2599[_0xc219('0x44')]:_0x3cac19['model'];_0x2e2599[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0x3db914[_0xc219('0x41')][_0xc219('0x4a')]);_0x2e2599[_0xc219('0x4b')]=qs[_0xc219('0x4c')](_['pick'](_0x3db914[_0xc219('0x41')],_0x3cac19[_0xc219('0x4c')]));if(_0x3db914[_0xc219('0x41')][_0xc219('0x4e')]){_0x2e2599['where']=_[_0xc219('0x4f')](_0x2e2599[_0xc219('0x4b')],{'$or':_['map'](_0x2e2599[_0xc219('0x44')],function(_0x28024d){var _0x36afea={};_0x36afea[_0x28024d]={'$like':'%'+_0x3db914[_0xc219('0x41')][_0xc219('0x4e')]+'%'};return _0x36afea;})});}_0x2e2599=_[_0xc219('0x4f')]({},_0x2e2599,_0x3db914[_0xc219('0x51')]);return _0x21d652[_0xc219('0x85')](_0x2e2599);}})['then'](function(_0x195cdd){if(_0x195cdd){_0x427fac=_0x195cdd['length'];if(!_0x3db914[_0xc219('0x41')]['hasOwnProperty'](_0xc219('0x48'))){_0x2e2599[_0xc219('0x2f')]=qs['limit'](_0x3db914[_0xc219('0x41')][_0xc219('0x2f')]);_0x2e2599[_0xc219('0x2e')]=qs['offset'](_0x3db914[_0xc219('0x41')][_0xc219('0x2e')]);}return _0x21d652[_0xc219('0x85')](_0x2e2599);}})[_0xc219('0x1f')](function(_0x1d073c){if(_0x1d073c){return _0x1d073c?{'count':_0x427fac,'rows':_0x1d073c}:null;}})[_0xc219('0x1f')](respondWithResult(_0x2fa065,null))[_0xc219('0x59')](handleError(_0x2fa065,null));};function Extension(_0x40ed2b,_0x59b2a7,_0x14203b,_0x581480){this[_0xc219('0x86')]=_0xc219('0x87');this[_0xc219('0x88')]=_0x40ed2b[_0xc219('0x89')];this[_0xc219('0x8a')]=_0x581480;this[_0xc219('0x3e')]='system';this[_0xc219('0x8b')]=_0xc219('0x8c');this[_0xc219('0x66')]=_0x40ed2b['id'];this[_0xc219('0x83')]=_0x59b2a7;this['appdata']=_0x14203b;}function createExtensionsReciveFax(_0x217202){var _0x5abc7f=0x1;var _0x3913ad=[];_0x3913ad[_0xc219('0x8d')](new Extension(_0x217202,_0x5abc7f,'',_0xc219('0x8e')));_0x5abc7f+=0x1;_0x3913ad[_0xc219('0x8d')](new Extension(_0x217202,_0x5abc7f,_0xc219('0x8f'),_0xc219('0x90')));_0x5abc7f+=0x1;for(var _0x38f8c0 in _0x217202){if(_0x217202[_0xc219('0x47')](_0x38f8c0)&&(_0x38f8c0===_0xc219('0x91')||_0x38f8c0===_0xc219('0x89')||_0x38f8c0===_0xc219('0x92')||_0x38f8c0===_0xc219('0x93')||_0x38f8c0===_0xc219('0x94')||_0x38f8c0===_0xc219('0x95')||_0x38f8c0===_0xc219('0x96')||_0x38f8c0===_0xc219('0x97')||_0x38f8c0===_0xc219('0x98'))){_0x3913ad[_0xc219('0x8d')](new Extension(_0x217202,_0x5abc7f,_0xc219('0x99')+_0x38f8c0+')='+_0x217202[_0x38f8c0],_0xc219('0x90')));_0x5abc7f+=0x1;}}_0x3913ad[_0xc219('0x8d')](new Extension(_0x217202,_0x5abc7f,'6',_0xc219('0x9a')));_0x5abc7f+=0x1;_0x3913ad[_0xc219('0x8d')](new Extension(_0x217202,_0x5abc7f,'/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d',_0xc219('0x9b')));_0x5abc7f=0x0;return _0x3913ad;}exports[_0xc219('0x9c')]=function(_0x273387,_0xea307b,_0x5d67d0){var _0xc50aa1;return db['sequelize']['transaction'](function(_0x1f9408){return db[_0xc219('0x3c')]['create'](_0x273387[_0xc219('0x63')],{'transaction':_0x1f9408})['then'](function(_0x20f633){_0xc50aa1=_0x20f633[_0xc219('0x35')]({'plain':!![]});return db[_0xc219('0x9d')]['bulkCreate'](createExtensionsReciveFax(_0xc50aa1),{'transaction':_0x1f9408});});})[_0xc219('0x1f')](function(){return _0xc50aa1;})[_0xc219('0x1f')](respondWithResult(_0xea307b,null))[_0xc219('0x59')](handleError(_0xea307b,null));};exports['updateAccountApplications']=function(_0x5178b8,_0x2ae0d7,_0x39e768){var _0x943a61;return db[_0xc219('0x7d')]['transaction'](function(_0x1f9731){return db[_0xc219('0x3c')][_0xc219('0x33')](_0x5178b8['body'],{'where':{'id':_0x5178b8[_0xc219('0x63')]['id']},'transaction':_0x1f9731})[_0xc219('0x1f')](function(_0x443047){return db[_0xc219('0x9d')]['destroy']({'where':{'FaxAccountId':_0x5178b8['body']['id']},'transaction':_0x1f9731})[_0xc219('0x1f')](function(_0x38ede9){return db[_0xc219('0x9d')][_0xc219('0x81')](createExtensionsReciveFax(_[_0xc219('0x71')](_0x5178b8[_0xc219('0x63')],[_0xc219('0x9e'),_0xc219('0x3f'),_0xc219('0x9f'),_0xc219('0xa0'),_0xc219('0xa1'),'ListId'])),{'transaction':_0x1f9731});});});})[_0xc219('0x1f')](function(){return db[_0xc219('0x3c')][_0xc219('0xa2')](_0x5178b8[_0xc219('0x63')]['id']);})[_0xc219('0x1f')](respondWithResult(_0x2ae0d7,null))[_0xc219('0x59')](handleError(_0x2ae0d7,null));};exports[_0xc219('0xa3')]=function(_0x2e6d58,_0x12416e,_0x4248d5){var _0x4c4ae2={'raw':!![],'where':{}};var _0x297900={};var _0x33ffa3={'count':0x0,'rows':[]};return db[_0xc219('0x3c')][_0xc219('0x68')]({'where':{'id':_0x2e6d58[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x12416e,null))[_0xc219('0x1f')](function(_0x2a9e0f){if(_0x2a9e0f){_0x297900[_0xc219('0x40')]=_[_0xc219('0x42')](db['FaxMessage'][_0xc219('0x3d')]);_0x297900[_0xc219('0x41')]=_[_0xc219('0x42')](_0x2e6d58['query']);_0x297900[_0xc219('0x4c')]=_[_0xc219('0x43')](_0x297900[_0xc219('0x40')],_0x297900['query']);_0x4c4ae2[_0xc219('0x44')]=_['intersection'](_0x297900[_0xc219('0x40')],qs[_0xc219('0x45')](_0x2e6d58[_0xc219('0x41')]['fields']));_0x4c4ae2[_0xc219('0x44')]=_0x4c4ae2['attributes'][_0xc219('0x46')]?_0x4c4ae2[_0xc219('0x44')]:_0x297900['model'];if(!_0x2e6d58['query'][_0xc219('0x47')](_0xc219('0x48'))){_0x4c4ae2[_0xc219('0x2f')]=qs[_0xc219('0x2f')](_0x2e6d58[_0xc219('0x41')][_0xc219('0x2f')]);_0x4c4ae2[_0xc219('0x2e')]=qs[_0xc219('0x2e')](_0x2e6d58[_0xc219('0x41')]['offset']);}_0x4c4ae2[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0x2e6d58[_0xc219('0x41')]['sort']);_0x4c4ae2[_0xc219('0x4b')]=qs[_0xc219('0x4c')](_[_0xc219('0x4d')](_0x2e6d58['query'],_0x297900[_0xc219('0x4c')]));_0x4c4ae2['where']['FaxAccountId']=_0x2a9e0f['id'];if(_0x2e6d58['query']['filter']){_0x4c4ae2['where']=_[_0xc219('0x4f')](_0x4c4ae2[_0xc219('0x4b')],{'$or':_[_0xc219('0x3b')](_0x4c4ae2[_0xc219('0x44')],function(_0x3a6771){var _0x2833dc={};_0x2833dc[_0x3a6771]={'$like':'%'+_0x2e6d58['query'][_0xc219('0x4e')]+'%'};return _0x2833dc;})});}if(_0x2e6d58[_0xc219('0x41')][_0xc219('0xa4')]){var _0x3a1b00=_0x2e6d58[_0xc219('0x41')]['$gte'][_0xc219('0xa5')](',');var _0xa825c7={};_0xa825c7[_0x3a1b00[0x0]]={'$gte':moment(_0x3a1b00[0x1])['format'](_0xc219('0xa6'))};_0x4c4ae2[_0xc219('0x4b')]=_[_0xc219('0x4f')](_0x4c4ae2['where'],_0xa825c7);}_0x4c4ae2=_[_0xc219('0x4f')]({},_0x4c4ae2,_0x2e6d58[_0xc219('0x51')]);return db[_0xc219('0xa7')][_0xc219('0x52')]({'where':_0x4c4ae2[_0xc219('0x4b')]})[_0xc219('0x1f')](function(_0x30663a){_0x33ffa3[_0xc219('0x52')]=_0x30663a;if(_0x2e6d58[_0xc219('0x41')][_0xc219('0x53')]){_0x4c4ae2['include']=[{'all':!![]}];}return db[_0xc219('0xa7')][_0xc219('0x7b')](_0x4c4ae2);})[_0xc219('0x1f')](function(_0x3ab6b2){_0x33ffa3[_0xc219('0x54')]=_0x3ab6b2;return _0x33ffa3;});}})[_0xc219('0x1f')](respondWithFilteredResult(_0x12416e,_0x4c4ae2))[_0xc219('0x59')](handleError(_0x12416e,null));};exports['send']=function(_0x4f6cf6,_0x1bc5b1,_0x32ad99){var _0x2d0876,_0x219b0d={},_0x84cee9;if(_0x4f6cf6[_0xc219('0x63')]['to']){_0x84cee9=_0x4f6cf6['body']['to'][0x0];}return db[_0xc219('0x3c')][_0xc219('0x60')]({'where':{'id':_0x4f6cf6[_0xc219('0x56')]['id']},'include':[{'model':db[_0xc219('0xa8')],'as':_0xc219('0xa9'),'include':[{'model':db[_0xc219('0xaa')],'as':_0xc219('0xab'),'where':{'fax':_0x84cee9},'limit':0x1,'order':[[_0xc219('0xa0'),_0xc219('0xac')]]}]}]})[_0xc219('0x1f')](handleEntityNotFound(_0x1bc5b1,null))[_0xc219('0x1f')](function(_0x6bd34a){_0x2d0876=_0x6bd34a;if(_0x4f6cf6[_0xc219('0x63')]['attachments']&&_0x4f6cf6['body']['attachments'][_0xc219('0x46')]){for(var _0x3d5062=0x0;_0x3d5062<_0x4f6cf6['body']['attachments'][_0xc219('0x46')];_0x3d5062+=0x1){_0x4f6cf6['body'][_0xc219('0xad')][_0x3d5062]={'filename':_0x4f6cf6[_0xc219('0x63')]['attachments'][_0x3d5062]['name'],'id':_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][_0x3d5062]['id'],'path':path[_0xc219('0xae')](config[_0xc219('0xaf')],_0xc219('0xb0'),_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][_0x3d5062][_0xc219('0xb1')])};}}return respondWithRpcPromise(_0xc219('0xb2'),_0xc219('0xb2'),{'FaxAccountId':_[_0xc219('0xb3')](_0x4f6cf6['params']['id'])?undefined:_0x4f6cf6[_0xc219('0x56')]['id'],'path':_[_0xc219('0xb3')](_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][0x0][_0xc219('0x7')])?undefined:_0x4f6cf6['body']['attachments'][0x0][_0xc219('0x7')],'fax':_[_0xc219('0xb3')](_0x4f6cf6['body']['to'][0x0])?undefined:_0x4f6cf6[_0xc219('0x63')]['to'][0x0]},client9002);})['then'](function(){if(_0x2d0876){if(_[_0xc219('0xb3')](_0x4f6cf6[_0xc219('0x63')][_0xc219('0xb4')])){_0x4f6cf6['body'][_0xc219('0xb4')]=util[_0xc219('0xb5')](_0xc219('0xb6'),_0x2d0876[_0xc219('0x37')],_0x2d0876[_0xc219('0xb7')]);}if(_0x2d0876[_0xc219('0xa9')]){if(_0x2d0876[_0xc219('0xa9')]['Contacts'][_0xc219('0x46')]){return _0x2d0876[_0xc219('0xa9')][_0xc219('0xab')][0x0];}else{return db[_0xc219('0xaa')][_0xc219('0x5a')](_[_0xc219('0x18')](_0x4f6cf6[_0xc219('0x63')],{'firstName':_0x4f6cf6['body']['to'][0x0],'phone':_0x4f6cf6[_0xc219('0x63')]['to'][0x0],'fax':_0x4f6cf6['body']['to'][0x0],'ListId':_0x2d0876[_0xc219('0xb8')]}));}}else{throw new Error(_0xc219('0xb9'));}}else{throw new Error(_0xc219('0xba'));}})['then'](function(_0x4d7ec6){if(_0x4d7ec6){return db[_0xc219('0x6f')][_0xc219('0x60')]({'where':{'ContactId':_0x4d7ec6['id'],'closed':![],'FaxAccountId':_0x2d0876['id']}})[_0xc219('0x1f')](function(_0x23e9e8){if(_0x23e9e8){return[_0x23e9e8,![]];}return db[_0xc219('0x6f')][_0xc219('0x5a')]({'UserId':_0x4f6cf6[_0xc219('0x5b')]['id'],'ContactId':_0x4d7ec6['id'],'FaxAccountId':_0x2d0876['id'],'fax':_0x4f6cf6[_0xc219('0x63')]['to'][0x0],'firstMsgDirection':_0xc219('0xbb'),'Messages':[_['merge'](_0x4f6cf6[_0xc219('0x63')],{'read':![],'body':_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][0x0][_0xc219('0xbc')],'FaxAccountId':_0x2d0876['id'],'UserId':_0x4f6cf6[_0xc219('0x5b')]['id'],'ContactId':_0x4d7ec6['id'],'AttachmentId':_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0xc219('0x1f')](function(_0x2accef){return[_0x2accef,!![]];});});}else{throw new Error(_0xc219('0xbd'));}})['spread'](function(_0x5e3952,_0x1c85ab){if(_0x1c85ab){return _0x5e3952;}return db[_0xc219('0xa7')][_0xc219('0x5a')]({'direction':_0xc219('0xbb'),'read':![],'body':_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][0x0]['filename'],'FaxAccountId':_0x2d0876['id'],'FaxInteractionId':_0x5e3952['id'],'UserId':_0x4f6cf6[_0xc219('0x5b')]['id'],'ContactId':_0x5e3952[_0xc219('0xbe')],'AttachmentId':_0x4f6cf6[_0xc219('0x63')]['attachments'][0x0]['id']})[_0xc219('0x1f')](function(_0x310948){_0x5e3952['dataValues'][_0xc219('0xbf')]=[];_0x5e3952[_0xc219('0xc0')][_0xc219('0xbf')][_0xc219('0x8d')](_0x310948['dataValues']);return _0x5e3952;});})['then'](function(_0x371bc8){respondWithRpcPromise(_0xc219('0xc1'),_0xc219('0xc1'),{'FaxAccountId':_[_0xc219('0xb3')](_0x4f6cf6[_0xc219('0x56')]['id'])?undefined:_0x4f6cf6[_0xc219('0x56')]['id'],'path':_[_0xc219('0xb3')](_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][0x0][_0xc219('0x7')])?undefined:_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][0x0][_0xc219('0x7')],'fax':_[_0xc219('0xb3')](_0x4f6cf6[_0xc219('0x63')]['to'][0x0])?undefined:_0x4f6cf6['body']['to'][0x0],'AttachmentId':_0x4f6cf6[_0xc219('0x63')]['attachments'][0x0]['id']},client9002)[_0xc219('0x1f')](function(_0x14e13c){logger[_0xc219('0x28')](_0xc219('0xc2'),_0x14e13c);})[_0xc219('0x59')](function(_0x4e4406){logger[_0xc219('0x28')](_0xc219('0xc2'),_0x4e4406);});return _0x371bc8;})[_0xc219('0x1f')](respondWithResult(_0x1bc5b1,null))[_0xc219('0x59')](handleError(_0x1bc5b1,null));};exports['addAgents']=function(_0x200cb1,_0x5ccc3e,_0x30f745){return db[_0xc219('0x3c')][_0xc219('0x60')]({'where':{'id':_0x200cb1[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x5ccc3e,null))[_0xc219('0x1f')](function(_0x32d13e){if(_0x32d13e){return _0x32d13e['addAgents'](_0x200cb1[_0xc219('0x63')][_0xc219('0x72')],_[_0xc219('0x71')](_0x200cb1['body'],['ids','id'])||{})[_0xc219('0xc3')](function(_0xa80a9c){for(var _0x4290a9=0x0;_0x4290a9<_0x200cb1[_0xc219('0x63')][_0xc219('0x72')]['length'];_0x4290a9+=0x1){socket['emit'](_0xc219('0xc4'),{'UserId':Number(_0x200cb1['body'][_0xc219('0x72')][_0x4290a9]),'FaxAccountId':Number(_0x200cb1[_0xc219('0x56')]['id'])});}return _0xa80a9c;});}})[_0xc219('0x1f')](respondWithResult(_0x5ccc3e,null))[_0xc219('0x59')](handleError(_0x5ccc3e,null));};exports[_0xc219('0xc5')]=function(_0x4482a2,_0x53d123,_0x36575a){return db['FaxAccount']['find']({'where':{'id':_0x4482a2[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x53d123,null))['then'](function(_0x2d8518){if(_0x2d8518){return _0x2d8518[_0xc219('0xc5')](_0x4482a2[_0xc219('0x41')][_0xc219('0x72')])[_0xc219('0x1f')](function(){if(_[_0xc219('0xc6')](_0x4482a2[_0xc219('0x41')][_0xc219('0x72')])){for(var _0x4db85e=0x0;_0x4db85e<_0x4482a2['query']['ids'][_0xc219('0x46')];_0x4db85e+=0x1){socket[_0xc219('0xc7')]('userFaxAccount:remove',{'UserId':Number(_0x4482a2[_0xc219('0x41')][_0xc219('0x72')][_0x4db85e]),'FaxAccountId':Number(_0x4482a2['params']['id'])});}}else{socket[_0xc219('0xc7')]('userFaxAccount:remove',{'UserId':Number(_0x4482a2[_0xc219('0x41')]['ids']),'FaxAccountId':Number(_0x4482a2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x53d123,null))['catch'](handleError(_0x53d123,null));};exports[_0xc219('0xc8')]=function(_0x230649,_0x4b4f69,_0x4fc42c){var _0x13bef2={};var _0x9a6975={};var _0x1b0d97;var _0x2ffe45;return db['FaxAccount'][_0xc219('0x68')]({'where':{'id':_0x230649[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x4b4f69,null))[_0xc219('0x1f')](function(_0xce9061){if(_0xce9061){_0x1b0d97=_0xce9061;_0x9a6975['model']=_[_0xc219('0x42')](db['User']['rawAttributes']);_0x9a6975[_0xc219('0x41')]=_[_0xc219('0x42')](_0x230649[_0xc219('0x41')]);_0x9a6975[_0xc219('0x4c')]=_[_0xc219('0x43')](_0x9a6975[_0xc219('0x40')],_0x9a6975[_0xc219('0x41')]);_0x13bef2[_0xc219('0x44')]=_[_0xc219('0x43')](_0x9a6975[_0xc219('0x40')],qs[_0xc219('0x45')](_0x230649[_0xc219('0x41')][_0xc219('0x45')]));_0x13bef2[_0xc219('0x44')]=_0x13bef2[_0xc219('0x44')][_0xc219('0x46')]?_0x13bef2[_0xc219('0x44')]:_0x9a6975['model'];_0x13bef2[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0x230649['query'][_0xc219('0x4a')]);_0x13bef2[_0xc219('0x4b')]=qs[_0xc219('0x4c')](_['pick'](_0x230649[_0xc219('0x41')],_0x9a6975[_0xc219('0x4c')]));if(_0x230649[_0xc219('0x41')]['filter']){_0x13bef2[_0xc219('0x4b')]=_[_0xc219('0x4f')](_0x13bef2[_0xc219('0x4b')],{'$or':_['map'](_0x13bef2['attributes'],function(_0xade20){var _0xa265fa={};_0xa265fa[_0xade20]={'$like':'%'+_0x230649[_0xc219('0x41')][_0xc219('0x4e')]+'%'};return _0xa265fa;})});}_0x13bef2=_[_0xc219('0x4f')]({},_0x13bef2,_0x230649[_0xc219('0x51')]);return _0x1b0d97[_0xc219('0xc8')](_0x13bef2);}})[_0xc219('0x1f')](function(_0x32792c){if(_0x32792c){_0x2ffe45=_0x32792c['length'];if(!_0x230649['query'][_0xc219('0x47')](_0xc219('0x48'))){_0x13bef2[_0xc219('0x2f')]=qs[_0xc219('0x2f')](_0x230649[_0xc219('0x41')]['limit']);_0x13bef2[_0xc219('0x2e')]=qs[_0xc219('0x2e')](_0x230649[_0xc219('0x41')][_0xc219('0x2e')]);}return _0x1b0d97['getAgents'](_0x13bef2);}})[_0xc219('0x1f')](function(_0x12126d){if(_0x12126d){return _0x12126d?{'count':_0x2ffe45,'rows':_0x12126d}:null;}})[_0xc219('0x1f')](respondWithResult(_0x4b4f69,null))[_0xc219('0x59')](handleError(_0x4b4f69,null));}; \ No newline at end of file +var _0xd5a0=['body','user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','FaxAccountId','Disposition','getDispositions','pick','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','FaxApplication','bulkCreate','findAndCountAll','priority','finally','sendStatus','getApplications','context','from-voip-provider','exten','app','system','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','maxrate','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','Send\x20Fax\x20failed','filename','spread','ContactId','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','FaxAccount,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','filter','include','findAll','rows','show','length','includeAll','find','create'];(function(_0x1d29c5,_0x2b5e20){var _0x2ce65b=function(_0x5f4a2c){while(--_0x5f4a2c){_0x1d29c5['push'](_0x1d29c5['shift']());}};_0x2ce65b(++_0x2b5e20);}(_0xd5a0,0x134));var _0x0d5a=function(_0x2b2244,_0x20010a){_0x2b2244=_0x2b2244-0x0;var _0x1723e8=_0xd5a0[_0x2b2244];return _0x1723e8;};'use strict';var emlformat=require(_0x0d5a('0x0'));var rimraf=require(_0x0d5a('0x1'));var zipdir=require(_0x0d5a('0x2'));var jsonpatch=require(_0x0d5a('0x3'));var rp=require(_0x0d5a('0x4'));var moment=require('moment');var BPromise=require(_0x0d5a('0x5'));var Mustache=require('mustache');var util=require(_0x0d5a('0x6'));var path=require(_0x0d5a('0x7'));var sox=require(_0x0d5a('0x8'));var csv=require(_0x0d5a('0x9'));var ejs=require(_0x0d5a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d5a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0d5a('0xc'));var deskjs=require(_0x0d5a('0xd'));var toCsv=require(_0x0d5a('0x9'));var querystring=require(_0x0d5a('0xe'));var Papa=require(_0x0d5a('0xf'));var Redis=require(_0x0d5a('0x10'));var authService=require(_0x0d5a('0x11'));var qs=require(_0x0d5a('0x12'));var as=require(_0x0d5a('0x13'));var hardwareService=require(_0x0d5a('0x14'));var logger=require('../../config/logger')(_0x0d5a('0x15'));var utils=require(_0x0d5a('0x16'));var config=require(_0x0d5a('0x17'));var licenseUtil=require(_0x0d5a('0x18'));var db=require(_0x0d5a('0x19'))['db'];config[_0x0d5a('0x1a')]=_[_0x0d5a('0x1b')](config['redis'],{'host':_0x0d5a('0x1c'),'port':0x18eb});var socket=require(_0x0d5a('0x1d'))(new Redis(config['redis']));require(_0x0d5a('0x1e'))[_0x0d5a('0x1f')](socket);var jayson=require(_0x0d5a('0x20'));var client=jayson[_0x0d5a('0x21')][_0x0d5a('0x22')]({'port':0x232c});var client9002=jayson[_0x0d5a('0x21')][_0x0d5a('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x384a77,_0x220f9a,_0xfc6f3f,_0x48f1ab){return new BPromise(function(_0x659f72,_0x4a46c9){var _0x351f20=_0x48f1ab||client;return _0x351f20[_0x0d5a('0x23')](_0x384a77,_0xfc6f3f)[_0x0d5a('0x24')](function(_0x5d1c61){logger[_0x0d5a('0x25')]('FaxAccount,\x20%s,\x20%s',_0x220f9a,_0x0d5a('0x26'));logger[_0x0d5a('0x27')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x220f9a,_0x0d5a('0x26'),JSON[_0x0d5a('0x28')](_0x5d1c61));if(_0x5d1c61['error']){if(_0x5d1c61['error']['code']===0x1f4){logger[_0x0d5a('0x29')](_0x0d5a('0x2a'),_0x220f9a,_0x5d1c61['error'][_0x0d5a('0x2b')]);return _0x4a46c9(_0x5d1c61[_0x0d5a('0x29')]['message']);}logger[_0x0d5a('0x29')](_0x0d5a('0x2a'),_0x220f9a,_0x5d1c61[_0x0d5a('0x29')][_0x0d5a('0x2b')]);return _0x659f72(_0x5d1c61[_0x0d5a('0x29')][_0x0d5a('0x2b')]);}else{logger[_0x0d5a('0x25')](_0x0d5a('0x2a'),_0x220f9a,_0x0d5a('0x26'));_0x659f72(_0x5d1c61[_0x0d5a('0x2c')][_0x0d5a('0x2b')]);}})[_0x0d5a('0x2d')](function(_0x2db50e){logger[_0x0d5a('0x29')](_0x0d5a('0x2a'),_0x220f9a,_0x2db50e);_0x4a46c9(_0x2db50e);});});}function respondWithStatusCode(_0x586d6f,_0x2233f4){_0x2233f4=_0x2233f4||0xcc;return function(_0x76790){if(_0x76790){return _0x586d6f['sendStatus'](_0x2233f4);}return _0x586d6f[_0x0d5a('0x2e')](_0x2233f4)[_0x0d5a('0x2f')]();};}function respondWithResult(_0x1f18be,_0x5a74d6){_0x5a74d6=_0x5a74d6||0xc8;return function(_0x37d190){if(_0x37d190){return _0x1f18be[_0x0d5a('0x2e')](_0x5a74d6)[_0x0d5a('0x30')](_0x37d190);}};}function respondWithFilteredResult(_0x4292a1,_0x563e53){return function(_0x5da487){if(_0x5da487){var _0x17ba49=typeof _0x563e53[_0x0d5a('0x31')]===_0x0d5a('0x32')&&typeof _0x563e53[_0x0d5a('0x33')]===_0x0d5a('0x32');var _0x4badd7=_0x5da487[_0x0d5a('0x34')];var _0x2c5903=_0x17ba49?0x0:_0x563e53[_0x0d5a('0x31')];var _0x3b379f=_0x17ba49?_0x5da487[_0x0d5a('0x34')]:_0x563e53[_0x0d5a('0x31')]+_0x563e53[_0x0d5a('0x33')];var _0xa10da4;if(_0x3b379f>=_0x4badd7){_0x3b379f=_0x4badd7;_0xa10da4=0xc8;}else{_0xa10da4=0xce;}_0x4292a1['status'](_0xa10da4);return _0x4292a1[_0x0d5a('0x35')](_0x0d5a('0x36'),_0x2c5903+'-'+_0x3b379f+'/'+_0x4badd7)['json'](_0x5da487);}return null;};}function patchUpdates(_0x2c9053){return function(_0x3da715){try{jsonpatch[_0x0d5a('0x37')](_0x3da715,_0x2c9053,!![]);}catch(_0x578289){return BPromise[_0x0d5a('0x38')](_0x578289);}return _0x3da715['save']();};}function saveUpdates(_0x2738fd,_0x2def21){return function(_0x25aa3c){if(_0x25aa3c){return _0x25aa3c[_0x0d5a('0x39')](_0x2738fd)[_0x0d5a('0x24')](function(_0x228255){return _0x228255;});}return null;};}function removeEntity(_0x435bca,_0x34794c){return function(_0x3f4255){if(_0x3f4255){return _0x3f4255[_0x0d5a('0x3a')]()[_0x0d5a('0x24')](function(){var _0xe3b422=_0x3f4255[_0x0d5a('0x3b')]({'plain':!![]});var _0xbf0a8c=_0x0d5a('0x3c');return db[_0x0d5a('0x3d')][_0x0d5a('0x3a')]({'where':{'type':_0xbf0a8c,'resourceId':_0xe3b422['id']}})[_0x0d5a('0x24')](function(){return _0x3f4255;});})[_0x0d5a('0x24')](function(){_0x435bca[_0x0d5a('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4888e5,_0x3ac18c){return function(_0x43e201){if(!_0x43e201){_0x4888e5['sendStatus'](0x194);}return _0x43e201;};}function handleError(_0x180f56,_0x4853a8){_0x4853a8=_0x4853a8||0x1f4;return function(_0x325de2){logger['error'](_0x325de2[_0x0d5a('0x3e')]);if(_0x325de2['name']){delete _0x325de2[_0x0d5a('0x3f')];}_0x180f56['status'](_0x4853a8)[_0x0d5a('0x40')](_0x325de2);};}exports[_0x0d5a('0x41')]=function(_0x291508,_0x4f7bf7){var _0x53eee1={'include':[{'model':db[_0x0d5a('0x42')],'as':_0x0d5a('0x43')}]},_0x5c136b={},_0x591fe3={'count':0x0,'rows':[]};var _0x298e63=_['map'](db[_0x0d5a('0x44')][_0x0d5a('0x45')],function(_0x213129){return{'name':_0x213129[_0x0d5a('0x46')],'type':_0x213129['type'][_0x0d5a('0x47')]};});_0x5c136b[_0x0d5a('0x48')]=_[_0x0d5a('0x49')](_0x298e63,'name');_0x5c136b[_0x0d5a('0x4a')]=_[_0x0d5a('0x4b')](_0x291508[_0x0d5a('0x4a')]);_0x5c136b['filters']=_[_0x0d5a('0x4c')](_0x5c136b[_0x0d5a('0x48')],_0x5c136b[_0x0d5a('0x4a')]);_0x53eee1[_0x0d5a('0x4d')]=_[_0x0d5a('0x4c')](_0x5c136b[_0x0d5a('0x48')],qs[_0x0d5a('0x4e')](_0x291508[_0x0d5a('0x4a')][_0x0d5a('0x4e')]));_0x53eee1['attributes']=_0x53eee1[_0x0d5a('0x4d')]['length']?_0x53eee1['attributes']:_0x5c136b[_0x0d5a('0x48')];if(!_0x291508[_0x0d5a('0x4a')][_0x0d5a('0x4f')](_0x0d5a('0x50'))){_0x53eee1[_0x0d5a('0x33')]=qs[_0x0d5a('0x33')](_0x291508[_0x0d5a('0x4a')][_0x0d5a('0x33')]);_0x53eee1[_0x0d5a('0x31')]=qs[_0x0d5a('0x31')](_0x291508[_0x0d5a('0x4a')]['offset']);}_0x53eee1[_0x0d5a('0x51')]=qs[_0x0d5a('0x52')](_0x291508['query'][_0x0d5a('0x52')]);_0x53eee1[_0x0d5a('0x53')]=qs[_0x0d5a('0x54')](_['pick'](_0x291508['query'],_0x5c136b[_0x0d5a('0x54')]),_0x298e63);if(_0x291508[_0x0d5a('0x4a')]['filter']){_0x53eee1[_0x0d5a('0x53')]=_[_0x0d5a('0x55')](_0x53eee1[_0x0d5a('0x53')],{'$or':_[_0x0d5a('0x49')](_0x298e63,function(_0x1786c6){if(_0x1786c6[_0x0d5a('0x56')]!=='VIRTUAL'){var _0xc56cfe={};_0xc56cfe[_0x1786c6[_0x0d5a('0x3f')]]={'$like':'%'+_0x291508[_0x0d5a('0x4a')][_0x0d5a('0x57')]+'%'};return _0xc56cfe;}})});}_0x53eee1=_[_0x0d5a('0x55')]({},_0x53eee1,_0x291508['options']);var _0x4cacfc={'where':_0x53eee1['where']};return db['FaxAccount'][_0x0d5a('0x34')](_0x4cacfc)[_0x0d5a('0x24')](function(_0x2d69a4){_0x591fe3[_0x0d5a('0x34')]=_0x2d69a4;if(_0x291508[_0x0d5a('0x4a')]['includeAll']){_0x53eee1[_0x0d5a('0x58')]=[{'all':!![]}];}return db[_0x0d5a('0x44')][_0x0d5a('0x59')](_0x53eee1);})[_0x0d5a('0x24')](function(_0x335366){_0x591fe3[_0x0d5a('0x5a')]=_0x335366;return _0x591fe3;})[_0x0d5a('0x24')](respondWithFilteredResult(_0x4f7bf7,_0x53eee1))['catch'](handleError(_0x4f7bf7,null));};exports[_0x0d5a('0x5b')]=function(_0x32e8f7,_0x45764a){var _0x454c17={'raw':![],'where':{'id':_0x32e8f7['params']['id']},'include':[{'model':db[_0x0d5a('0x42')],'as':_0x0d5a('0x43')}]},_0x4b6894={};_0x4b6894[_0x0d5a('0x48')]=_[_0x0d5a('0x4b')](db[_0x0d5a('0x44')]['rawAttributes']);_0x4b6894['query']=_[_0x0d5a('0x4b')](_0x32e8f7[_0x0d5a('0x4a')]);_0x4b6894[_0x0d5a('0x54')]=_[_0x0d5a('0x4c')](_0x4b6894[_0x0d5a('0x48')],_0x4b6894['query']);_0x454c17[_0x0d5a('0x4d')]=_[_0x0d5a('0x4c')](_0x4b6894[_0x0d5a('0x48')],qs[_0x0d5a('0x4e')](_0x32e8f7[_0x0d5a('0x4a')]['fields']));_0x454c17['attributes']=_0x454c17['attributes'][_0x0d5a('0x5c')]?_0x454c17['attributes']:_0x4b6894[_0x0d5a('0x48')];if(_0x32e8f7[_0x0d5a('0x4a')][_0x0d5a('0x5d')]){_0x454c17['include']=[{'all':!![]}];}_0x454c17=_['merge']({},_0x454c17,_0x32e8f7['options']);return db[_0x0d5a('0x44')][_0x0d5a('0x5e')](_0x454c17)[_0x0d5a('0x24')](handleEntityNotFound(_0x45764a,null))[_0x0d5a('0x24')](respondWithResult(_0x45764a,null))[_0x0d5a('0x2d')](handleError(_0x45764a,null));};exports[_0x0d5a('0x5f')]=function(_0x30aa81,_0x33be7f){return db[_0x0d5a('0x44')][_0x0d5a('0x5f')](_0x30aa81[_0x0d5a('0x60')],{})[_0x0d5a('0x24')](function(_0x5447ad){var _0x5a38f3=_0x30aa81[_0x0d5a('0x61')]['get']({'plain':!![]});if(!_0x5a38f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a38f3[_0x0d5a('0x62')]===_0x0d5a('0x61')){var _0x83ee2=_0x5447ad[_0x0d5a('0x3b')]({'plain':!![]});var _0xadaf75=_0x0d5a('0x3c');return db[_0x0d5a('0x63')]['find']({'where':{'name':_0xadaf75,'userProfileId':_0x5a38f3[_0x0d5a('0x64')]},'raw':!![]})[_0x0d5a('0x24')](function(_0x4529de){if(_0x4529de&&_0x4529de[_0x0d5a('0x65')]===0x0){return db[_0x0d5a('0x3d')][_0x0d5a('0x5f')]({'name':_0x83ee2[_0x0d5a('0x3f')],'resourceId':_0x83ee2['id'],'type':_0x4529de['name'],'sectionId':_0x4529de['id']},{})[_0x0d5a('0x24')](function(){return _0x5447ad;});}else{return _0x5447ad;}})['catch'](function(_0x39df18){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39df18);throw _0x39df18;});}return _0x5447ad;})[_0x0d5a('0x24')](respondWithResult(_0x33be7f,0xc9))[_0x0d5a('0x2d')](handleError(_0x33be7f,null));};exports[_0x0d5a('0x39')]=function(_0x4804a7,_0x4db376){if(_0x4804a7['body']['id']){delete _0x4804a7[_0x0d5a('0x60')]['id'];}return db[_0x0d5a('0x44')]['find']({'where':{'id':_0x4804a7['params']['id']},'include':[{'model':db[_0x0d5a('0x42')],'as':_0x0d5a('0x43')}]})[_0x0d5a('0x24')](handleEntityNotFound(_0x4db376,null))[_0x0d5a('0x24')](saveUpdates(_0x4804a7[_0x0d5a('0x60')],null))[_0x0d5a('0x24')](respondWithResult(_0x4db376,null))[_0x0d5a('0x2d')](handleError(_0x4db376,null));};exports[_0x0d5a('0x3a')]=function(_0x1e7010,_0x2f60b7){return db[_0x0d5a('0x44')][_0x0d5a('0x5e')]({'where':{'id':_0x1e7010[_0x0d5a('0x66')]['id']}})[_0x0d5a('0x24')](handleEntityNotFound(_0x2f60b7,null))[_0x0d5a('0x24')](removeEntity(_0x2f60b7,null))[_0x0d5a('0x2d')](handleError(_0x2f60b7,null));};exports['describe']=function(_0x193113,_0x2caa1e){return db[_0x0d5a('0x44')][_0x0d5a('0x67')]()[_0x0d5a('0x24')](respondWithResult(_0x2caa1e,null))[_0x0d5a('0x2d')](handleError(_0x2caa1e,null));};exports['addDisposition']=function(_0x26324b,_0x348a48,_0x166a43){if(_0x26324b[_0x0d5a('0x60')]['id']){delete _0x26324b[_0x0d5a('0x60')]['id'];}return db['FaxAccount'][_0x0d5a('0x5e')]({'where':{'id':_0x26324b[_0x0d5a('0x66')]['id']}})[_0x0d5a('0x24')](handleEntityNotFound(_0x348a48,null))['then'](function(_0x11d859){if(_0x11d859){_0x26324b[_0x0d5a('0x60')][_0x0d5a('0x68')]=_0x11d859['id'];return db[_0x0d5a('0x69')][_0x0d5a('0x5f')](_0x26324b[_0x0d5a('0x60')]);}})[_0x0d5a('0x24')](respondWithResult(_0x348a48,null))[_0x0d5a('0x2d')](handleError(_0x348a48,null));};exports[_0x0d5a('0x6a')]=function(_0x3530ef,_0x35be00,_0x203866){var _0x503d2f={'raw':![],'where':{}};var _0x184b68={};var _0x4a93e6={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3530ef[_0x0d5a('0x66')]['id']}})['then'](handleEntityNotFound(_0x35be00,null))['then'](function(_0x5ed40b){if(_0x5ed40b){_0x184b68['model']=_['keys'](db[_0x0d5a('0x69')][_0x0d5a('0x45')]);_0x184b68['query']=_[_0x0d5a('0x4b')](_0x3530ef[_0x0d5a('0x4a')]);_0x184b68[_0x0d5a('0x54')]=_[_0x0d5a('0x4c')](_0x184b68[_0x0d5a('0x48')],_0x184b68[_0x0d5a('0x4a')]);_0x503d2f[_0x0d5a('0x4d')]=_[_0x0d5a('0x4c')](_0x184b68['model'],qs[_0x0d5a('0x4e')](_0x3530ef[_0x0d5a('0x4a')][_0x0d5a('0x4e')]));_0x503d2f['attributes']=_0x503d2f[_0x0d5a('0x4d')][_0x0d5a('0x5c')]?_0x503d2f[_0x0d5a('0x4d')]:_0x184b68[_0x0d5a('0x48')];if(!_0x3530ef[_0x0d5a('0x4a')]['hasOwnProperty'](_0x0d5a('0x50'))){_0x503d2f[_0x0d5a('0x33')]=qs[_0x0d5a('0x33')](_0x3530ef[_0x0d5a('0x4a')][_0x0d5a('0x33')]);_0x503d2f['offset']=qs[_0x0d5a('0x31')](_0x3530ef[_0x0d5a('0x4a')][_0x0d5a('0x31')]);}_0x503d2f[_0x0d5a('0x51')]=qs[_0x0d5a('0x52')](_0x3530ef[_0x0d5a('0x4a')][_0x0d5a('0x52')]);_0x503d2f[_0x0d5a('0x53')]=qs['filters'](_[_0x0d5a('0x6b')](_0x3530ef['query'],_0x184b68['filters']));_0x503d2f[_0x0d5a('0x53')][_0x0d5a('0x68')]=_0x5ed40b['id'];if(_0x3530ef[_0x0d5a('0x4a')]['filter']){_0x503d2f['where']=_[_0x0d5a('0x55')](_0x503d2f[_0x0d5a('0x53')],{'$or':_['map'](_0x503d2f[_0x0d5a('0x4d')],function(_0x4de895){var _0x49b7a6={};_0x49b7a6[_0x4de895]={'$like':'%'+_0x3530ef[_0x0d5a('0x4a')][_0x0d5a('0x57')]+'%'};return _0x49b7a6;})});}_0x503d2f=_[_0x0d5a('0x55')]({},_0x503d2f,_0x3530ef[_0x0d5a('0x6c')]);return db['Disposition']['count']({'where':_0x503d2f['where']})[_0x0d5a('0x24')](function(_0x32b242){_0x4a93e6[_0x0d5a('0x34')]=_0x32b242;if(_0x3530ef[_0x0d5a('0x4a')][_0x0d5a('0x5d')]){_0x503d2f['include']=[{'all':!![]}];}return db[_0x0d5a('0x69')][_0x0d5a('0x59')](_0x503d2f);})[_0x0d5a('0x24')](function(_0xfcb837){_0x4a93e6[_0x0d5a('0x5a')]=_0xfcb837;return _0x4a93e6;});}})[_0x0d5a('0x24')](respondWithFilteredResult(_0x35be00,_0x503d2f))[_0x0d5a('0x2d')](handleError(_0x35be00,null));};exports['removeDispositions']=function(_0x1fb32d,_0x252914,_0x3db3a4){return db[_0x0d5a('0x44')][_0x0d5a('0x5e')]({'where':{'id':_0x1fb32d[_0x0d5a('0x66')]['id']}})[_0x0d5a('0x24')](handleEntityNotFound(_0x252914,null))[_0x0d5a('0x24')](function(_0x13603b){if(_0x13603b){return _0x13603b[_0x0d5a('0x6d')](_0x1fb32d['query'][_0x0d5a('0x6e')]);}})[_0x0d5a('0x24')](respondWithStatusCode(_0x252914,null))[_0x0d5a('0x2d')](handleError(_0x252914,null));};exports[_0x0d5a('0x6f')]=function(_0x2b1790,_0x4855d3,_0x89867e){if(_0x2b1790['body']['id']){delete _0x2b1790[_0x0d5a('0x60')]['id'];}return db[_0x0d5a('0x44')][_0x0d5a('0x5e')]({'where':{'id':_0x2b1790['params']['id']}})[_0x0d5a('0x24')](handleEntityNotFound(_0x4855d3,null))[_0x0d5a('0x24')](function(_0x1436eb){if(_0x1436eb){_0x2b1790['body'][_0x0d5a('0x68')]=_0x1436eb['id'];return db[_0x0d5a('0x70')]['create'](_0x2b1790[_0x0d5a('0x60')]);}})['then'](respondWithResult(_0x4855d3,null))[_0x0d5a('0x2d')](handleError(_0x4855d3,null));};exports[_0x0d5a('0x71')]=function(_0x52cd0f,_0x14783f,_0x1dac5c){var _0x40aba3={'raw':![],'where':{}};var _0x18728a={};var _0x2a748a={'count':0x0,'rows':[]};return db[_0x0d5a('0x44')]['findOne']({'where':{'id':_0x52cd0f['params']['id']}})[_0x0d5a('0x24')](handleEntityNotFound(_0x14783f,null))[_0x0d5a('0x24')](function(_0x13359e){if(_0x13359e){_0x18728a[_0x0d5a('0x48')]=_[_0x0d5a('0x4b')](db['CannedAnswer']['rawAttributes']);_0x18728a[_0x0d5a('0x4a')]=_[_0x0d5a('0x4b')](_0x52cd0f['query']);_0x18728a[_0x0d5a('0x54')]=_[_0x0d5a('0x4c')](_0x18728a[_0x0d5a('0x48')],_0x18728a[_0x0d5a('0x4a')]);_0x40aba3['attributes']=_['intersection'](_0x18728a['model'],qs[_0x0d5a('0x4e')](_0x52cd0f[_0x0d5a('0x4a')][_0x0d5a('0x4e')]));_0x40aba3[_0x0d5a('0x4d')]=_0x40aba3['attributes'][_0x0d5a('0x5c')]?_0x40aba3[_0x0d5a('0x4d')]:_0x18728a['model'];if(!_0x52cd0f[_0x0d5a('0x4a')][_0x0d5a('0x4f')](_0x0d5a('0x50'))){_0x40aba3[_0x0d5a('0x33')]=qs[_0x0d5a('0x33')](_0x52cd0f['query'][_0x0d5a('0x33')]);_0x40aba3[_0x0d5a('0x31')]=qs[_0x0d5a('0x31')](_0x52cd0f[_0x0d5a('0x4a')][_0x0d5a('0x31')]);}_0x40aba3[_0x0d5a('0x51')]=qs[_0x0d5a('0x52')](_0x52cd0f[_0x0d5a('0x4a')][_0x0d5a('0x52')]);_0x40aba3[_0x0d5a('0x53')]=qs[_0x0d5a('0x54')](_['pick'](_0x52cd0f[_0x0d5a('0x4a')],_0x18728a['filters']));_0x40aba3['where'][_0x0d5a('0x68')]=_0x13359e['id'];if(_0x52cd0f['query'][_0x0d5a('0x57')]){_0x40aba3[_0x0d5a('0x53')]=_[_0x0d5a('0x55')](_0x40aba3[_0x0d5a('0x53')],{'$or':_[_0x0d5a('0x49')](_0x40aba3[_0x0d5a('0x4d')],function(_0x59c643){var _0x3978d8={};_0x3978d8[_0x59c643]={'$like':'%'+_0x52cd0f[_0x0d5a('0x4a')][_0x0d5a('0x57')]+'%'};return _0x3978d8;})});}_0x40aba3=_[_0x0d5a('0x55')]({},_0x40aba3,_0x52cd0f[_0x0d5a('0x6c')]);return db[_0x0d5a('0x70')][_0x0d5a('0x34')]({'where':_0x40aba3[_0x0d5a('0x53')]})[_0x0d5a('0x24')](function(_0xd743c9){_0x2a748a[_0x0d5a('0x34')]=_0xd743c9;if(_0x52cd0f['query'][_0x0d5a('0x5d')]){_0x40aba3['include']=[{'all':!![]}];}return db[_0x0d5a('0x70')]['findAll'](_0x40aba3);})[_0x0d5a('0x24')](function(_0x3d42cc){_0x2a748a[_0x0d5a('0x5a')]=_0x3d42cc;return _0x2a748a;});}})[_0x0d5a('0x24')](respondWithFilteredResult(_0x14783f,_0x40aba3))['catch'](handleError(_0x14783f,null));};exports[_0x0d5a('0x72')]=function(_0x3d8d1b,_0x22b443,_0x1f04fa){return db[_0x0d5a('0x44')]['find']({'where':{'id':_0x3d8d1b[_0x0d5a('0x66')]['id']}})['then'](handleEntityNotFound(_0x22b443,null))['then'](function(_0x569877){if(_0x569877){return _0x569877[_0x0d5a('0x72')](_0x3d8d1b[_0x0d5a('0x4a')][_0x0d5a('0x6e')]);}})[_0x0d5a('0x24')](respondWithStatusCode(_0x22b443,null))[_0x0d5a('0x2d')](handleError(_0x22b443,null));};exports[_0x0d5a('0x73')]=function(_0x11af2c,_0xd7f6e1,_0x27eea7){return db['FaxInteraction']['find']({'where':{'id':_0x11af2c[_0x0d5a('0x66')]['id']}})[_0x0d5a('0x24')](handleEntityNotFound(_0xd7f6e1,null))[_0x0d5a('0x24')](function(_0x6bc5e4){if(_0x6bc5e4){return _0x6bc5e4[_0x0d5a('0x73')](_0x11af2c[_0x0d5a('0x60')][_0x0d5a('0x6e')],_[_0x0d5a('0x74')](_0x11af2c['body'],[_0x0d5a('0x6e'),'id'])||{});}})['then'](respondWithResult(_0xd7f6e1,null))['catch'](handleError(_0xd7f6e1,null));};exports[_0x0d5a('0x75')]=function(_0x1517a4,_0x4cdc24,_0x14ffd7){var _0x213371={'raw':![],'where':{}};var _0x26a368={};var _0x4216ab={'count':0x0,'rows':[]};return db[_0x0d5a('0x44')]['findOne']({'where':{'id':_0x1517a4[_0x0d5a('0x66')]['id']}})[_0x0d5a('0x24')](handleEntityNotFound(_0x4cdc24,null))[_0x0d5a('0x24')](function(_0x387cf6){if(_0x387cf6){_0x26a368[_0x0d5a('0x48')]=_['keys'](db[_0x0d5a('0x76')][_0x0d5a('0x45')]);_0x26a368['query']=_[_0x0d5a('0x4b')](_0x1517a4['query']);_0x26a368[_0x0d5a('0x54')]=_['intersection'](_0x26a368[_0x0d5a('0x48')],_0x26a368['query']);_0x213371[_0x0d5a('0x4d')]=_[_0x0d5a('0x4c')](_0x26a368[_0x0d5a('0x48')],qs[_0x0d5a('0x4e')](_0x1517a4[_0x0d5a('0x4a')][_0x0d5a('0x4e')]));_0x213371[_0x0d5a('0x4d')]=_0x213371[_0x0d5a('0x4d')][_0x0d5a('0x5c')]?_0x213371[_0x0d5a('0x4d')]:_0x26a368[_0x0d5a('0x48')];if(!_0x1517a4[_0x0d5a('0x4a')][_0x0d5a('0x4f')]('nolimit')){_0x213371['limit']=qs[_0x0d5a('0x33')](_0x1517a4[_0x0d5a('0x4a')][_0x0d5a('0x33')]);_0x213371[_0x0d5a('0x31')]=qs[_0x0d5a('0x31')](_0x1517a4[_0x0d5a('0x4a')][_0x0d5a('0x31')]);}_0x213371['order']=qs['sort'](_0x1517a4['query'][_0x0d5a('0x52')]);_0x213371['where']=qs['filters'](_[_0x0d5a('0x6b')](_0x1517a4['query'],_0x26a368[_0x0d5a('0x54')]));_0x213371[_0x0d5a('0x53')][_0x0d5a('0x68')]=_0x387cf6['id'];if(_0x1517a4[_0x0d5a('0x4a')][_0x0d5a('0x57')]){_0x213371[_0x0d5a('0x53')]=_[_0x0d5a('0x55')](_0x213371[_0x0d5a('0x53')],{'$or':_[_0x0d5a('0x49')](_0x213371[_0x0d5a('0x4d')],function(_0x45a872){var _0x5c7e42={};_0x5c7e42[_0x45a872]={'$like':'%'+_0x1517a4['query'][_0x0d5a('0x57')]+'%'};return _0x5c7e42;})});}_0x213371=_[_0x0d5a('0x55')]({},_0x213371,_0x1517a4[_0x0d5a('0x6c')]);return db[_0x0d5a('0x76')]['count']({'where':_0x213371[_0x0d5a('0x53')]})[_0x0d5a('0x24')](function(_0x20ef2f){_0x4216ab[_0x0d5a('0x34')]=_0x20ef2f;if(_0x1517a4[_0x0d5a('0x4a')][_0x0d5a('0x5d')]){_0x213371[_0x0d5a('0x58')]=[{'model':db[_0x0d5a('0x77')],'as':_0x0d5a('0x78'),'required':![]},{'model':db[_0x0d5a('0x79')],'as':_0x0d5a('0x7a'),'attributes':[_0x0d5a('0x3f'),_0x0d5a('0x7b'),_0x0d5a('0x7c')],'required':![]},{'model':db[_0x0d5a('0x7d')],'as':_0x0d5a('0x7e'),'attributes':['id',_0x0d5a('0x3f'),'color'],'where':_0x1517a4[_0x0d5a('0x4a')][_0x0d5a('0x7f')]?{'id':_0x1517a4[_0x0d5a('0x4a')][_0x0d5a('0x7f')]}:undefined,'required':_0x1517a4[_0x0d5a('0x4a')][_0x0d5a('0x7f')]?!![]:![]}];}return db[_0x0d5a('0x76')]['findAll'](_0x213371);})['then'](function(_0x432873){_0x4216ab[_0x0d5a('0x5a')]=_0x432873;return _0x4216ab;});}})[_0x0d5a('0x24')](respondWithFilteredResult(_0x4cdc24,_0x213371))[_0x0d5a('0x2d')](handleError(_0x4cdc24,null));};exports[_0x0d5a('0x80')]=function(_0x433042,_0x3a9605){var _0x8c8c97=_0x433042[_0x0d5a('0x66')]['id'];var _0x53793b=_0x433042['body'];var _0xc4babc=0xc8;var _0x73d878=null;return db[_0x0d5a('0x81')][_0x0d5a('0x82')]({'isolationLevel':db[_0x0d5a('0x81')][_0x0d5a('0x83')][_0x0d5a('0x84')][_0x0d5a('0x85')]},function(_0x1772d3){return db[_0x0d5a('0x44')][_0x0d5a('0x86')]({'where':{'id':_0x8c8c97},'transaction':_0x1772d3})[_0x0d5a('0x24')](function(_0x47033b){if(_0x47033b){return db[_0x0d5a('0x87')][_0x0d5a('0x3a')]({'where':{'FaxAccountId':_0x8c8c97},'transaction':_0x1772d3})['then'](function(){var _0x55d7dd=_[_0x0d5a('0x49')](_0x53793b,function(_0x57b912){_0x57b912[_0x0d5a('0x68')]=_0x8c8c97;return _0x57b912;});return db['FaxApplication'][_0x0d5a('0x88')](_0x55d7dd,{'transaction':_0x1772d3});});}else{_0xc4babc=0x194;_0x73d878=[];}});})['then'](function(){if(_0xc4babc!==0x194){return db[_0x0d5a('0x87')][_0x0d5a('0x89')]({'where':{'FaxAccountId':_0x8c8c97},'order':_0x0d5a('0x8a')})[_0x0d5a('0x24')](function(_0x1e81b6){_0x73d878=_0x1e81b6;});}})[_0x0d5a('0x2d')](function(_0x3c042f){_0xc4babc=0x1f4;logger['error'](_0x3c042f[_0x0d5a('0x3e')]);if(_0x3c042f['name']){delete _0x3c042f[_0x0d5a('0x3f')];}_0x73d878=_0x3c042f;})[_0x0d5a('0x8b')](function(){if(_0x73d878===null){_0x3a9605[_0x0d5a('0x8c')](_0xc4babc);}else{if(_0xc4babc===0x1f4){_0x3a9605[_0x0d5a('0x2e')](_0xc4babc)[_0x0d5a('0x40')](_0x73d878);}else{_0x3a9605[_0x0d5a('0x2e')](_0xc4babc)[_0x0d5a('0x30')](_0x73d878);}}});};exports[_0x0d5a('0x8d')]=function(_0x47ea22,_0x4aabaf,_0x463045){var _0x3e9718={};var _0x661a9f={};var _0x2d4329;var _0x3ff4f8;return db[_0x0d5a('0x44')][_0x0d5a('0x86')]({'where':{'id':_0x47ea22[_0x0d5a('0x66')]['id']}})[_0x0d5a('0x24')](handleEntityNotFound(_0x4aabaf,null))['then'](function(_0x4feeaf){if(_0x4feeaf){_0x2d4329=_0x4feeaf;_0x661a9f[_0x0d5a('0x48')]=_[_0x0d5a('0x4b')](db[_0x0d5a('0x87')][_0x0d5a('0x45')]);_0x661a9f[_0x0d5a('0x4a')]=_[_0x0d5a('0x4b')](_0x47ea22[_0x0d5a('0x4a')]);_0x661a9f[_0x0d5a('0x54')]=_[_0x0d5a('0x4c')](_0x661a9f[_0x0d5a('0x48')],_0x661a9f[_0x0d5a('0x4a')]);_0x3e9718['attributes']=_[_0x0d5a('0x4c')](_0x661a9f[_0x0d5a('0x48')],qs[_0x0d5a('0x4e')](_0x47ea22[_0x0d5a('0x4a')][_0x0d5a('0x4e')]));_0x3e9718['attributes']=_0x3e9718[_0x0d5a('0x4d')][_0x0d5a('0x5c')]?_0x3e9718['attributes']:_0x661a9f[_0x0d5a('0x48')];_0x3e9718[_0x0d5a('0x51')]=qs[_0x0d5a('0x52')](_0x47ea22[_0x0d5a('0x4a')][_0x0d5a('0x52')]);_0x3e9718[_0x0d5a('0x53')]=qs['filters'](_[_0x0d5a('0x6b')](_0x47ea22[_0x0d5a('0x4a')],_0x661a9f[_0x0d5a('0x54')]));if(_0x47ea22[_0x0d5a('0x4a')][_0x0d5a('0x57')]){_0x3e9718[_0x0d5a('0x53')]=_[_0x0d5a('0x55')](_0x3e9718[_0x0d5a('0x53')],{'$or':_[_0x0d5a('0x49')](_0x3e9718[_0x0d5a('0x4d')],function(_0x1db2cd){var _0x16f1a5={};_0x16f1a5[_0x1db2cd]={'$like':'%'+_0x47ea22[_0x0d5a('0x4a')]['filter']+'%'};return _0x16f1a5;})});}_0x3e9718=_[_0x0d5a('0x55')]({},_0x3e9718,_0x47ea22[_0x0d5a('0x6c')]);return _0x2d4329[_0x0d5a('0x8d')](_0x3e9718);}})[_0x0d5a('0x24')](function(_0x4bbf7e){if(_0x4bbf7e){_0x3ff4f8=_0x4bbf7e[_0x0d5a('0x5c')];if(!_0x47ea22[_0x0d5a('0x4a')][_0x0d5a('0x4f')](_0x0d5a('0x50'))){_0x3e9718['limit']=qs['limit'](_0x47ea22[_0x0d5a('0x4a')]['limit']);_0x3e9718[_0x0d5a('0x31')]=qs['offset'](_0x47ea22[_0x0d5a('0x4a')]['offset']);}return _0x2d4329[_0x0d5a('0x8d')](_0x3e9718);}})[_0x0d5a('0x24')](function(_0x598df8){if(_0x598df8){return _0x598df8?{'count':_0x3ff4f8,'rows':_0x598df8}:null;}})[_0x0d5a('0x24')](respondWithResult(_0x4aabaf,null))[_0x0d5a('0x2d')](handleError(_0x4aabaf,null));};function Extension(_0x5b9eb7,_0x54da05,_0x5a3c5a,_0x574e55){this[_0x0d5a('0x8e')]=_0x0d5a('0x8f');this[_0x0d5a('0x90')]=_0x5b9eb7['localstationid'];this[_0x0d5a('0x91')]=_0x574e55;this['type']=_0x0d5a('0x92');this['description']=_0x0d5a('0x93');this[_0x0d5a('0x68')]=_0x5b9eb7['id'];this[_0x0d5a('0x8a')]=_0x54da05;this[_0x0d5a('0x94')]=_0x5a3c5a;}function createExtensionsReciveFax(_0x1738b0){var _0x2a9a66=0x1;var _0x41ba02=[];_0x41ba02['push'](new Extension(_0x1738b0,_0x2a9a66,'','Answer'));_0x2a9a66+=0x1;_0x41ba02[_0x0d5a('0x95')](new Extension(_0x1738b0,_0x2a9a66,_0x0d5a('0x96'),_0x0d5a('0x97')));_0x2a9a66+=0x1;for(var _0x3c1a9f in _0x1738b0){if(_0x1738b0[_0x0d5a('0x4f')](_0x3c1a9f)&&(_0x3c1a9f===_0x0d5a('0x98')||_0x3c1a9f===_0x0d5a('0x99')||_0x3c1a9f===_0x0d5a('0x9a')||_0x3c1a9f==='faxdetect'||_0x3c1a9f==='headerinfo'||_0x3c1a9f===_0x0d5a('0x9b')||_0x3c1a9f===_0x0d5a('0x9c')||_0x3c1a9f===_0x0d5a('0x9d')||_0x3c1a9f===_0x0d5a('0x9e'))){_0x41ba02[_0x0d5a('0x95')](new Extension(_0x1738b0,_0x2a9a66,_0x0d5a('0x9f')+_0x3c1a9f+')='+_0x1738b0[_0x3c1a9f],_0x0d5a('0x97')));_0x2a9a66+=0x1;}}_0x41ba02[_0x0d5a('0x95')](new Extension(_0x1738b0,_0x2a9a66,'6','Wait'));_0x2a9a66+=0x1;_0x41ba02['push'](new Extension(_0x1738b0,_0x2a9a66,_0x0d5a('0xa0'),_0x0d5a('0xa1')));_0x2a9a66=0x0;return _0x41ba02;}exports['addAccountApplications']=function(_0x1a0ccd,_0x52a88a,_0x2ac357){var _0x99c6c6;return db['sequelize'][_0x0d5a('0x82')](function(_0x447f64){return db[_0x0d5a('0x44')]['create'](_0x1a0ccd[_0x0d5a('0x60')],{'transaction':_0x447f64})[_0x0d5a('0x24')](function(_0x39a061){_0x99c6c6=_0x39a061[_0x0d5a('0x3b')]({'plain':!![]});return db[_0x0d5a('0xa2')]['bulkCreate'](createExtensionsReciveFax(_0x99c6c6),{'transaction':_0x447f64});});})[_0x0d5a('0x24')](function(){return _0x99c6c6;})[_0x0d5a('0x24')](respondWithResult(_0x52a88a,null))['catch'](handleError(_0x52a88a,null));};exports['updateAccountApplications']=function(_0x21a0c7,_0x2f888f,_0x4e5c5c){var _0x4a8431;return db['sequelize'][_0x0d5a('0x82')](function(_0x1f7434){return db[_0x0d5a('0x44')][_0x0d5a('0x39')](_0x21a0c7[_0x0d5a('0x60')],{'where':{'id':_0x21a0c7['body']['id']},'transaction':_0x1f7434})[_0x0d5a('0x24')](function(_0x59d594){return db[_0x0d5a('0xa2')]['destroy']({'where':{'FaxAccountId':_0x21a0c7[_0x0d5a('0x60')]['id']},'transaction':_0x1f7434})[_0x0d5a('0x24')](function(_0x56c308){return db[_0x0d5a('0xa2')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x21a0c7[_0x0d5a('0x60')],[_0x0d5a('0xa3'),_0x0d5a('0x47'),_0x0d5a('0xa4'),_0x0d5a('0xa5'),_0x0d5a('0xa6'),_0x0d5a('0xa7')])),{'transaction':_0x1f7434});});});})[_0x0d5a('0x24')](function(){return db[_0x0d5a('0x44')]['findById'](_0x21a0c7[_0x0d5a('0x60')]['id']);})['then'](respondWithResult(_0x2f888f,null))[_0x0d5a('0x2d')](handleError(_0x2f888f,null));};exports[_0x0d5a('0xa8')]=function(_0x4ff0e7,_0x32086c,_0x457128){var _0x32924b={'raw':!![],'where':{}};var _0x2beef8={};var _0x32c66e={'count':0x0,'rows':[]};return db['FaxAccount'][_0x0d5a('0x86')]({'where':{'id':_0x4ff0e7['params']['id']}})[_0x0d5a('0x24')](handleEntityNotFound(_0x32086c,null))[_0x0d5a('0x24')](function(_0x154768){if(_0x154768){_0x2beef8[_0x0d5a('0x48')]=_[_0x0d5a('0x4b')](db[_0x0d5a('0xa9')][_0x0d5a('0x45')]);_0x2beef8[_0x0d5a('0x4a')]=_[_0x0d5a('0x4b')](_0x4ff0e7['query']);_0x2beef8[_0x0d5a('0x54')]=_[_0x0d5a('0x4c')](_0x2beef8[_0x0d5a('0x48')],_0x2beef8[_0x0d5a('0x4a')]);_0x32924b[_0x0d5a('0x4d')]=_[_0x0d5a('0x4c')](_0x2beef8[_0x0d5a('0x48')],qs[_0x0d5a('0x4e')](_0x4ff0e7[_0x0d5a('0x4a')][_0x0d5a('0x4e')]));_0x32924b[_0x0d5a('0x4d')]=_0x32924b[_0x0d5a('0x4d')][_0x0d5a('0x5c')]?_0x32924b[_0x0d5a('0x4d')]:_0x2beef8[_0x0d5a('0x48')];if(!_0x4ff0e7['query']['hasOwnProperty'](_0x0d5a('0x50'))){_0x32924b[_0x0d5a('0x33')]=qs['limit'](_0x4ff0e7[_0x0d5a('0x4a')]['limit']);_0x32924b[_0x0d5a('0x31')]=qs['offset'](_0x4ff0e7[_0x0d5a('0x4a')][_0x0d5a('0x31')]);}_0x32924b[_0x0d5a('0x51')]=qs[_0x0d5a('0x52')](_0x4ff0e7[_0x0d5a('0x4a')][_0x0d5a('0x52')]);_0x32924b[_0x0d5a('0x53')]=qs[_0x0d5a('0x54')](_['pick'](_0x4ff0e7['query'],_0x2beef8[_0x0d5a('0x54')]));_0x32924b['where']['FaxAccountId']=_0x154768['id'];if(_0x4ff0e7['query']['filter']){_0x32924b['where']=_['merge'](_0x32924b['where'],{'$or':_[_0x0d5a('0x49')](_0x32924b[_0x0d5a('0x4d')],function(_0x36ba2c){var _0x57ebed={};_0x57ebed[_0x36ba2c]={'$like':'%'+_0x4ff0e7[_0x0d5a('0x4a')]['filter']+'%'};return _0x57ebed;})});}if(_0x4ff0e7[_0x0d5a('0x4a')][_0x0d5a('0xaa')]){var _0x1a666a=_0x4ff0e7[_0x0d5a('0x4a')]['$gte'][_0x0d5a('0xab')](',');var _0x9e1546={};_0x9e1546[_0x1a666a[0x0]]={'$gte':moment(_0x1a666a[0x1])['format'](_0x0d5a('0xac'))};_0x32924b[_0x0d5a('0x53')]=_[_0x0d5a('0x55')](_0x32924b[_0x0d5a('0x53')],_0x9e1546);}_0x32924b=_['merge']({},_0x32924b,_0x4ff0e7['options']);return db[_0x0d5a('0xa9')][_0x0d5a('0x34')]({'where':_0x32924b[_0x0d5a('0x53')]})['then'](function(_0x72dbad){_0x32c66e['count']=_0x72dbad;if(_0x4ff0e7['query'][_0x0d5a('0x5d')]){_0x32924b[_0x0d5a('0x58')]=[{'all':!![]}];}return db[_0x0d5a('0xa9')][_0x0d5a('0x59')](_0x32924b);})[_0x0d5a('0x24')](function(_0x322381){_0x32c66e[_0x0d5a('0x5a')]=_0x322381;return _0x32c66e;});}})[_0x0d5a('0x24')](respondWithFilteredResult(_0x32086c,_0x32924b))[_0x0d5a('0x2d')](handleError(_0x32086c,null));};exports[_0x0d5a('0x40')]=function(_0x21039c,_0x9b2ed9,_0x5ead7b){var _0x4f8d53,_0x1228cb={},_0x5d10a8;if(_0x21039c[_0x0d5a('0x60')]['to']){_0x5d10a8=_0x21039c[_0x0d5a('0x60')]['to'][0x0];}return db[_0x0d5a('0x44')][_0x0d5a('0x5e')]({'where':{'id':_0x21039c[_0x0d5a('0x66')]['id']},'include':[{'model':db[_0x0d5a('0xad')],'as':_0x0d5a('0xae'),'include':[{'model':db[_0x0d5a('0x77')],'as':_0x0d5a('0xaf'),'where':{'fax':_0x5d10a8},'limit':0x1,'order':[[_0x0d5a('0xa5'),_0x0d5a('0xb0')]]}]}]})[_0x0d5a('0x24')](handleEntityNotFound(_0x9b2ed9,null))['then'](function(_0x3748ca){_0x4f8d53=_0x3748ca;if(_0x21039c[_0x0d5a('0x60')]['attachments']&&_0x21039c[_0x0d5a('0x60')][_0x0d5a('0xb1')][_0x0d5a('0x5c')]){for(var _0x201946=0x0;_0x201946<_0x21039c[_0x0d5a('0x60')][_0x0d5a('0xb1')]['length'];_0x201946+=0x1){_0x21039c['body'][_0x0d5a('0xb1')][_0x201946]={'filename':_0x21039c['body'][_0x0d5a('0xb1')][_0x201946]['name'],'id':_0x21039c['body'][_0x0d5a('0xb1')][_0x201946]['id'],'path':path[_0x0d5a('0xb2')](config[_0x0d5a('0xb3')],_0x0d5a('0xb4'),_0x21039c['body']['attachments'][_0x201946][_0x0d5a('0xb5')])};}}return respondWithRpcPromise(_0x0d5a('0xb6'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x21039c[_0x0d5a('0x66')]['id'])?undefined:_0x21039c[_0x0d5a('0x66')]['id'],'path':_[_0x0d5a('0xb7')](_0x21039c['body'][_0x0d5a('0xb1')][0x0][_0x0d5a('0x7')])?undefined:_0x21039c[_0x0d5a('0x60')][_0x0d5a('0xb1')][0x0][_0x0d5a('0x7')],'fax':_[_0x0d5a('0xb7')](_0x21039c[_0x0d5a('0x60')]['to'][0x0])?undefined:_0x21039c[_0x0d5a('0x60')]['to'][0x0]},client9002);})['then'](function(){if(_0x4f8d53){if(_[_0x0d5a('0xb7')](_0x21039c[_0x0d5a('0x60')][_0x0d5a('0xb8')])){_0x21039c['body'][_0x0d5a('0xb8')]=util[_0x0d5a('0xb9')](_0x0d5a('0xba'),_0x4f8d53[_0x0d5a('0x3f')],_0x4f8d53[_0x0d5a('0xbb')]);}if(_0x4f8d53[_0x0d5a('0xae')]){if(_0x4f8d53['List'][_0x0d5a('0xaf')]['length']){return _0x4f8d53[_0x0d5a('0xae')][_0x0d5a('0xaf')][0x0];}else{return db['CmContact']['create'](_[_0x0d5a('0x1b')](_0x21039c['body'],{'firstName':_0x21039c[_0x0d5a('0x60')]['to'][0x0],'phone':_0x21039c[_0x0d5a('0x60')]['to'][0x0],'fax':_0x21039c[_0x0d5a('0x60')]['to'][0x0],'ListId':_0x4f8d53['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x0d5a('0xbc'));}})['then'](function(_0x27f1c8){if(_0x27f1c8){return db['FaxInteraction'][_0x0d5a('0x5e')]({'where':{'ContactId':_0x27f1c8['id'],'closed':![],'FaxAccountId':_0x4f8d53['id']}})[_0x0d5a('0x24')](function(_0x26756e){if(_0x26756e){return[_0x26756e,![]];}return db['FaxInteraction'][_0x0d5a('0x5f')]({'UserId':_0x21039c[_0x0d5a('0x61')]['id'],'ContactId':_0x27f1c8['id'],'FaxAccountId':_0x4f8d53['id'],'fax':_0x21039c['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x0d5a('0x55')](_0x21039c[_0x0d5a('0x60')],{'read':![],'body':_0x21039c[_0x0d5a('0x60')][_0x0d5a('0xb1')][0x0][_0x0d5a('0xbd')],'FaxAccountId':_0x4f8d53['id'],'UserId':_0x21039c[_0x0d5a('0x61')]['id'],'ContactId':_0x27f1c8['id'],'AttachmentId':_0x21039c[_0x0d5a('0x60')][_0x0d5a('0xb1')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0x0d5a('0x24')](function(_0x3a6336){return[_0x3a6336,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0d5a('0xbe')](function(_0x4e4efa,_0x5556db){if(_0x5556db){return _0x4e4efa;}return db[_0x0d5a('0xa9')][_0x0d5a('0x5f')]({'direction':'out','read':![],'body':_0x21039c[_0x0d5a('0x60')][_0x0d5a('0xb1')][0x0][_0x0d5a('0xbd')],'FaxAccountId':_0x4f8d53['id'],'FaxInteractionId':_0x4e4efa['id'],'UserId':_0x21039c[_0x0d5a('0x61')]['id'],'ContactId':_0x4e4efa[_0x0d5a('0xbf')],'AttachmentId':_0x21039c['body'][_0x0d5a('0xb1')][0x0]['id']})[_0x0d5a('0x24')](function(_0x462b11){_0x4e4efa['dataValues'][_0x0d5a('0xc0')]=[];_0x4e4efa['dataValues']['Messages'][_0x0d5a('0x95')](_0x462b11[_0x0d5a('0xc1')]);return _0x4e4efa;});})[_0x0d5a('0x24')](function(_0x59e3d7){respondWithRpcPromise(_0x0d5a('0xc2'),_0x0d5a('0xc2'),{'FaxAccountId':_[_0x0d5a('0xb7')](_0x21039c[_0x0d5a('0x66')]['id'])?undefined:_0x21039c[_0x0d5a('0x66')]['id'],'path':_[_0x0d5a('0xb7')](_0x21039c[_0x0d5a('0x60')][_0x0d5a('0xb1')][0x0][_0x0d5a('0x7')])?undefined:_0x21039c[_0x0d5a('0x60')][_0x0d5a('0xb1')][0x0][_0x0d5a('0x7')],'fax':_[_0x0d5a('0xb7')](_0x21039c[_0x0d5a('0x60')]['to'][0x0])?undefined:_0x21039c['body']['to'][0x0],'AttachmentId':_0x21039c[_0x0d5a('0x60')][_0x0d5a('0xb1')][0x0]['id']},client9002)[_0x0d5a('0x24')](function(_0x547f5b){logger[_0x0d5a('0x25')](_0x0d5a('0xc3'),_0x547f5b);})['catch'](function(_0x4a685b){logger[_0x0d5a('0x25')]('SendFaxRpc,\x20%s',_0x4a685b);});return _0x59e3d7;})[_0x0d5a('0x24')](respondWithResult(_0x9b2ed9,null))['catch'](handleError(_0x9b2ed9,null));};exports[_0x0d5a('0xc4')]=function(_0x59d89e,_0x286811,_0x4a6b3f){return db[_0x0d5a('0x44')][_0x0d5a('0x5e')]({'where':{'id':_0x59d89e[_0x0d5a('0x66')]['id']}})['then'](handleEntityNotFound(_0x286811,null))[_0x0d5a('0x24')](function(_0x1ef51a){if(_0x1ef51a){return _0x1ef51a[_0x0d5a('0xc4')](_0x59d89e[_0x0d5a('0x60')][_0x0d5a('0x6e')],_[_0x0d5a('0x74')](_0x59d89e[_0x0d5a('0x60')],[_0x0d5a('0x6e'),'id'])||{})[_0x0d5a('0xbe')](function(_0x43744c){for(var _0x536be4=0x0;_0x536be4<_0x59d89e[_0x0d5a('0x60')][_0x0d5a('0x6e')][_0x0d5a('0x5c')];_0x536be4+=0x1){socket[_0x0d5a('0xc5')](_0x0d5a('0xc6'),{'UserId':Number(_0x59d89e[_0x0d5a('0x60')]['ids'][_0x536be4]),'FaxAccountId':Number(_0x59d89e[_0x0d5a('0x66')]['id'])});}return _0x43744c;});}})[_0x0d5a('0x24')](respondWithResult(_0x286811,null))[_0x0d5a('0x2d')](handleError(_0x286811,null));};exports[_0x0d5a('0xc7')]=function(_0x312b03,_0x24ee9c,_0x1a71ba){return db[_0x0d5a('0x44')][_0x0d5a('0x5e')]({'where':{'id':_0x312b03[_0x0d5a('0x66')]['id']}})[_0x0d5a('0x24')](handleEntityNotFound(_0x24ee9c,null))['then'](function(_0xf13617){if(_0xf13617){return _0xf13617[_0x0d5a('0xc7')](_0x312b03[_0x0d5a('0x4a')][_0x0d5a('0x6e')])['then'](function(){if(_['isArray'](_0x312b03['query'][_0x0d5a('0x6e')])){for(var _0x19dd25=0x0;_0x19dd25<_0x312b03[_0x0d5a('0x4a')][_0x0d5a('0x6e')]['length'];_0x19dd25+=0x1){socket[_0x0d5a('0xc5')](_0x0d5a('0xc8'),{'UserId':Number(_0x312b03[_0x0d5a('0x4a')]['ids'][_0x19dd25]),'FaxAccountId':Number(_0x312b03[_0x0d5a('0x66')]['id'])});}}else{socket[_0x0d5a('0xc5')](_0x0d5a('0xc8'),{'UserId':Number(_0x312b03[_0x0d5a('0x4a')][_0x0d5a('0x6e')]),'FaxAccountId':Number(_0x312b03[_0x0d5a('0x66')]['id'])});}});}})[_0x0d5a('0x24')](respondWithStatusCode(_0x24ee9c,null))[_0x0d5a('0x2d')](handleError(_0x24ee9c,null));};exports[_0x0d5a('0xc9')]=function(_0x1f4e70,_0x98cab5,_0x5c8ca9){var _0x3e5a26={};var _0x1029a0={};var _0x498b82;var _0x15a3bf;return db[_0x0d5a('0x44')][_0x0d5a('0x86')]({'where':{'id':_0x1f4e70[_0x0d5a('0x66')]['id']}})[_0x0d5a('0x24')](handleEntityNotFound(_0x98cab5,null))['then'](function(_0x5250b6){if(_0x5250b6){_0x498b82=_0x5250b6;_0x1029a0[_0x0d5a('0x48')]=_[_0x0d5a('0x4b')](db['User'][_0x0d5a('0x45')]);_0x1029a0[_0x0d5a('0x4a')]=_[_0x0d5a('0x4b')](_0x1f4e70[_0x0d5a('0x4a')]);_0x1029a0[_0x0d5a('0x54')]=_[_0x0d5a('0x4c')](_0x1029a0[_0x0d5a('0x48')],_0x1029a0[_0x0d5a('0x4a')]);_0x3e5a26[_0x0d5a('0x4d')]=_[_0x0d5a('0x4c')](_0x1029a0['model'],qs[_0x0d5a('0x4e')](_0x1f4e70['query'][_0x0d5a('0x4e')]));_0x3e5a26['attributes']=_0x3e5a26[_0x0d5a('0x4d')][_0x0d5a('0x5c')]?_0x3e5a26[_0x0d5a('0x4d')]:_0x1029a0[_0x0d5a('0x48')];_0x3e5a26[_0x0d5a('0x51')]=qs[_0x0d5a('0x52')](_0x1f4e70[_0x0d5a('0x4a')][_0x0d5a('0x52')]);_0x3e5a26['where']=qs[_0x0d5a('0x54')](_['pick'](_0x1f4e70['query'],_0x1029a0[_0x0d5a('0x54')]));if(_0x1f4e70['query'][_0x0d5a('0x57')]){_0x3e5a26[_0x0d5a('0x53')]=_[_0x0d5a('0x55')](_0x3e5a26[_0x0d5a('0x53')],{'$or':_[_0x0d5a('0x49')](_0x3e5a26['attributes'],function(_0x2887b1){var _0x172d05={};_0x172d05[_0x2887b1]={'$like':'%'+_0x1f4e70[_0x0d5a('0x4a')]['filter']+'%'};return _0x172d05;})});}_0x3e5a26=_['merge']({},_0x3e5a26,_0x1f4e70[_0x0d5a('0x6c')]);return _0x498b82[_0x0d5a('0xc9')](_0x3e5a26);}})[_0x0d5a('0x24')](function(_0xff0504){if(_0xff0504){_0x15a3bf=_0xff0504[_0x0d5a('0x5c')];if(!_0x1f4e70[_0x0d5a('0x4a')][_0x0d5a('0x4f')](_0x0d5a('0x50'))){_0x3e5a26['limit']=qs[_0x0d5a('0x33')](_0x1f4e70[_0x0d5a('0x4a')][_0x0d5a('0x33')]);_0x3e5a26['offset']=qs[_0x0d5a('0x31')](_0x1f4e70[_0x0d5a('0x4a')][_0x0d5a('0x31')]);}return _0x498b82[_0x0d5a('0xc9')](_0x3e5a26);}})[_0x0d5a('0x24')](function(_0x58e163){if(_0x58e163){return _0x58e163?{'count':_0x15a3bf,'rows':_0x58e163}:null;}})[_0x0d5a('0x24')](respondWithResult(_0x98cab5,null))[_0x0d5a('0x2d')](handleError(_0x98cab5,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index adc57db..1c4ddac 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 _0xfb65=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit'];(function(_0x12ad6b,_0x14558e){var _0x37bc97=function(_0xc34ab2){while(--_0xc34ab2){_0x12ad6b['push'](_0x12ad6b['shift']());}};_0x37bc97(++_0x14558e);}(_0xfb65,0xb7));var _0x5fb6=function(_0x1e6cf1,_0x40c6d8){_0x1e6cf1=_0x1e6cf1-0x0;var _0x527676=_0xfb65[_0x1e6cf1];return _0x527676;};'use strict';var EventEmitter=require(_0x5fb6('0x0'));var FaxAccount=require(_0x5fb6('0x1'))['db'][_0x5fb6('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x5fb6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5fb6('0x4'),'afterDestroy':_0x5fb6('0x5')};function emitEvent(_0x575a5d){return function(_0x4134fd,_0x2efaca,_0x47711b){FaxAccountEvents[_0x5fb6('0x6')](_0x575a5d+':'+_0x4134fd['id'],_0x4134fd);FaxAccountEvents[_0x5fb6('0x6')](_0x575a5d,_0x4134fd);_0x47711b(null);};}for(var e in events){if(events[_0x5fb6('0x7')](e)){var event=events[e];FaxAccount[_0x5fb6('0x8')](e,emitEvent(event));}}module[_0x5fb6('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0xaedd=['events','../../mysqldb','FaxAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x32c3fc,_0x225a38){var _0x42f556=function(_0x5119f6){while(--_0x5119f6){_0x32c3fc['push'](_0x32c3fc['shift']());}};_0x42f556(++_0x225a38);}(_0xaedd,0x1b0));var _0xdaed=function(_0x48eed9,_0x595ecf){_0x48eed9=_0x48eed9-0x0;var _0x5aae01=_0xaedd[_0x48eed9];return _0x5aae01;};'use strict';var EventEmitter=require(_0xdaed('0x0'));var FaxAccount=require(_0xdaed('0x1'))['db'][_0xdaed('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdaed('0x3'),'afterUpdate':_0xdaed('0x4'),'afterDestroy':_0xdaed('0x5')};function emitEvent(_0x1ebd97){return function(_0x177c30,_0x12b783,_0x3dce5f){FaxAccountEvents[_0xdaed('0x6')](_0x1ebd97+':'+_0x177c30['id'],_0x177c30);FaxAccountEvents[_0xdaed('0x6')](_0x1ebd97,_0x177c30);_0x3dce5f(null);};}for(var e in events){if(events[_0xdaed('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 3dc0355..8fc1c76 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 _0x052b=['moment','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','exports','define','fax_accounts','lodash','util','../../config/logger','api'];(function(_0xe539f9,_0x228f3b){var _0x9d8ab6=function(_0x1a8b0b){while(--_0x1a8b0b){_0xe539f9['push'](_0xe539f9['shift']());}};_0x9d8ab6(++_0x228f3b);}(_0x052b,0x18f));var _0xb052=function(_0x26c962,_0x5cc892){_0x26c962=_0x26c962-0x0;var _0x57a373=_0x052b[_0x26c962];return _0x57a373;};'use strict';var _=require(_0xb052('0x0'));var util=require(_0xb052('0x1'));var logger=require(_0xb052('0x2'))(_0xb052('0x3'));var moment=require(_0xb052('0x4'));var BPromise=require(_0xb052('0x5'));var rp=require(_0xb052('0x6'));var fs=require('fs');var path=require(_0xb052('0x7'));var rimraf=require('rimraf');var config=require(_0xb052('0x8'));var attributes=require(_0xb052('0x9'));module[_0xb052('0xa')]=function(_0x1b593a,_0x994c65){return _0x1b593a[_0xb052('0xb')]('FaxAccount',attributes,{'tableName':_0xb052('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd622=['lodash','util','../../config/logger','api','request-promise','rimraf','exports','define','fax_accounts'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd622,0x90));var _0x2d62=function(_0x577cb3,_0x3526f6){_0x577cb3=_0x577cb3-0x0;var _0x9e28f6=_0xd622[_0x577cb3];return _0x9e28f6;};'use strict';var _=require(_0x2d62('0x0'));var util=require(_0x2d62('0x1'));var logger=require(_0x2d62('0x2'))(_0x2d62('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d62('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d62('0x5'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0x2d62('0x6')]=function(_0x4fc8e5,_0x424e61){return _0x4fc8e5[_0x2d62('0x7')]('FaxAccount',attributes,{'tableName':_0x2d62('0x8'),'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 8019a24..7e1a43e 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 _0x6399=['no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','List','Contacts','Applications','get','applications','orderBy','priority','asc','length','create','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','created','interaction','ContactId','AttachmentId','UserId','User','name','waitForTheAssignedAgent','*,*,*,*','FaxQueue','unshift','queue','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','attributes','limit','include','map','model','body','fax','CmContact','describe','ValidationError'];(function(_0x29d4b5,_0x1913e2){var _0x3fbb01=function(_0x8b0a41){while(--_0x8b0a41){_0x29d4b5['push'](_0x29d4b5['shift']());}};_0x3fbb01(++_0x1913e2);}(_0x6399,0x1f2));var _0x9639=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x6399[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x9639('0x0'));var util=require(_0x9639('0x1'));var moment=require('moment');var BPromise=require(_0x9639('0x2'));var rs=require(_0x9639('0x3'));var fs=require('fs');var Redis=require(_0x9639('0x4'));var db=require(_0x9639('0x5'))['db'];var utils=require(_0x9639('0x6'));var logger=require(_0x9639('0x7'))('rpc');var config=require(_0x9639('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9639('0x9')]['http']({'port':0x232c});config[_0x9639('0xa')]=_[_0x9639('0xb')](config['redis'],{'host':_0x9639('0xc'),'port':0x18eb});var socket=require(_0x9639('0xd'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x9639('0xe')](socket);function respondWithRpcPromise(_0x3e1735,_0x2cf239,_0x24af27){return new BPromise(function(_0x160c7d,_0x3a095f){return client[_0x9639('0xf')](_0x3e1735,_0x24af27)[_0x9639('0x10')](function(_0x23bb23){logger[_0x9639('0x11')](_0x9639('0x12'),_0x2cf239,_0x9639('0x13'));logger[_0x9639('0x14')](_0x9639('0x15'),_0x2cf239,_0x9639('0x13'),JSON[_0x9639('0x16')](_0x23bb23));if(_0x23bb23['error']){if(_0x23bb23[_0x9639('0x17')][_0x9639('0x18')]===0x1f4){logger['error'](_0x9639('0x12'),_0x2cf239,_0x23bb23[_0x9639('0x17')]['message']);return _0x3a095f(_0x23bb23['error'][_0x9639('0x19')]);}logger[_0x9639('0x17')]('FaxAccount,\x20%s,\x20%s',_0x2cf239,_0x23bb23['error'][_0x9639('0x19')]);return _0x160c7d(_0x23bb23[_0x9639('0x17')]['message']);}else{logger[_0x9639('0x11')](_0x9639('0x12'),_0x2cf239,'request\x20sent');_0x160c7d(_0x23bb23[_0x9639('0x1a')][_0x9639('0x19')]);}})[_0x9639('0x1b')](function(_0x48dec){logger[_0x9639('0x17')](_0x9639('0x12'),_0x2cf239,_0x48dec);_0x3a095f(_0x48dec);});});}exports[_0x9639('0x1c')]=function(_0x19df71){var _0x37a0e9=this;return new Promise(function(_0x311598,_0x345277){return db['FaxAccount'][_0x9639('0x1d')]({'raw':_0x19df71[_0x9639('0x1e')]?_0x19df71[_0x9639('0x1e')][_0x9639('0x1f')]===undefined?!![]:![]:!![],'where':_0x19df71[_0x9639('0x1e')]?_0x19df71['options']['where']||null:null,'attributes':_0x19df71[_0x9639('0x1e')]?_0x19df71[_0x9639('0x1e')][_0x9639('0x20')]||null:null,'limit':_0x19df71[_0x9639('0x1e')]?_0x19df71['options'][_0x9639('0x21')]||null:null,'include':_0x19df71['options']?_0x19df71[_0x9639('0x1e')][_0x9639('0x22')]?_[_0x9639('0x23')](_0x19df71[_0x9639('0x1e')][_0x9639('0x22')],function(_0x4f47bd){return{'model':db[_0x4f47bd[_0x9639('0x24')]],'as':_0x4f47bd['as'],'attributes':_0x4f47bd[_0x9639('0x20')],'include':_0x4f47bd[_0x9639('0x22')]?_[_0x9639('0x23')](_0x4f47bd['include'],function(_0x155a8a){return{'model':db[_0x155a8a['model']],'as':_0x155a8a['as'],'attributes':_0x155a8a['attributes'],'include':_0x155a8a['include']?_['map'](_0x155a8a[_0x9639('0x22')],function(_0x358590){return{'model':db[_0x358590['model']],'as':_0x358590['as'],'attributes':_0x358590[_0x9639('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9639('0x10')](function(_0x123abb){logger['info'](_0x9639('0x1c'),_0x19df71);logger['debug'](_0x9639('0x1c'),_0x19df71,JSON[_0x9639('0x16')](_0x123abb));_0x311598(_0x123abb);})[_0x9639('0x1b')](function(_0x507666){logger[_0x9639('0x17')](_0x9639('0x1c'),_0x507666[_0x9639('0x19')],_0x19df71);_0x345277(_0x37a0e9[_0x9639('0x17')](0x1f4,_0x507666[_0x9639('0x19')]));});});};exports['NotifyFaxAccount']=function(_0xd4d423,_0x37afd2,_0x50838f){var _0x1b25ba=this;return new Promise(function(_0x189d98,_0x48c924){var _0x5ebf1d={'body':_0xd4d423[_0x9639('0x25')],'channel':_0x9639('0x26')};var _0x565720=[];var _0x314240=[];var _0x43cee9={};return db[_0x9639('0x27')][_0x9639('0x28')]()[_0x9639('0x10')](function(_0x5e6d0a){if(!_0x5e6d0a){throw new db['Sequelize'][(_0x9639('0x29'))](_0x9639('0x2a'));}_0x565720=_[_0x9639('0x2b')](_['keys'](_0x5e6d0a),[_0x9639('0x2c'),_0x9639('0x2d')]);_0x314240=_[_0x9639('0x2b')](_['keys'](_0x5e6d0a),[_0x9639('0x2c'),_0x9639('0x2d'),_0x9639('0x2e'),_0x9639('0x2f')]);if(_0xd4d423[_0x9639('0x25')]['id']){delete _0xd4d423[_0x9639('0x25')]['id'];}if(_[_0x9639('0x30')](_0xd4d423[_0x9639('0x25')][_0x9639('0x31')])){throw new db[(_0x9639('0x32'))][(_0x9639('0x29'))](_0x9639('0x33'));}if(_[_0x9639('0x30')](_0xd4d423['body'][_0x9639('0x25')])||_0xd4d423['body'][_0x9639('0x25')]===''){throw new db[(_0x9639('0x32'))][(_0x9639('0x29'))](_0x9639('0x34'));}if(_[_0x9639('0x30')](_0xd4d423['body'][_0x9639('0x35')])){throw new db[(_0x9639('0x32'))][(_0x9639('0x29'))](_0x9639('0x36')+_0x314240);}if(!_['includes'](_0x314240,_0xd4d423[_0x9639('0x25')][_0x9639('0x35')])){throw new db['Sequelize'][(_0x9639('0x29'))](_0x9639('0x37')+_0x314240);}_0x43cee9[_0xd4d423[_0x9639('0x25')][_0x9639('0x35')]]=_0xd4d423[_0x9639('0x25')][_0x9639('0x31')];})[_0x9639('0x10')](function(){return db[_0x9639('0x38')][_0x9639('0x39')]({'where':{'id':_0xd4d423[_0x9639('0x3a')]['id']},'include':[{'model':db[_0x9639('0x3b')],'as':_0x9639('0x3c'),'include':[{'model':db['CmContact'],'as':_0x9639('0x3d'),'where':_0x43cee9,'limit':0x1,'order':[[_0x9639('0x2d'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0x9639('0x3e')}]});})[_0x9639('0x10')](function(_0x41fc12){if(_0x41fc12&&_0x41fc12[_0x9639('0x3c')]){var _0x5def3a=_0x41fc12[_0x9639('0x3f')]({'plain':!![]});_0x5ebf1d[_0x9639('0x3a')]=_0x5def3a;_0x5ebf1d['applications']=_0x5def3a[_0x9639('0x3e')];_0x5ebf1d['list']=_0x5def3a[_0x9639('0x3c')];_0x5ebf1d[_0x9639('0x40')]=_[_0x9639('0x41')](_0x5ebf1d[_0x9639('0x40')],[_0x9639('0x42')],[_0x9639('0x43')]);if(_0x5ebf1d[_0x9639('0x3a')][_0x9639('0x3e')]){delete _0x5ebf1d[_0x9639('0x3a')][_0x9639('0x3e')];}if(_0x5ebf1d[_0x9639('0x3a')][_0x9639('0x3c')]&&_0x5ebf1d['account']['List'][_0x9639('0x3d')][_0x9639('0x44')]){return _0x5ebf1d[_0x9639('0x3a')][_0x9639('0x3c')]['Contacts'][0x0];}var _0x43b5dd=_['defaults'](_0xd4d423['body'],{'firstName':_0xd4d423[_0x9639('0x25')][_0x9639('0x31')],'ListId':_0x5def3a['ListId']});_0x43b5dd[_0xd4d423[_0x9639('0x25')]['mapKey']]=_0xd4d423[_0x9639('0x25')][_0x9639('0x31')];return db['CmContact'][_0x9639('0x45')](_0x43b5dd,{'fields':_0x565720,'raw':!![]});}})['then'](function(_0x183e1d){_0x5ebf1d['contact']=_0x183e1d;if(_0x183e1d){var _0x538cb9={'ContactId':_0x183e1d['id'],'FaxAccountId':_0xd4d423[_0x9639('0x3a')]['id'],'fax':_0x183e1d[_0x9639('0x26')]};return db[_0x9639('0x46')]['find']({'where':{'ContactId':_0x183e1d['id'],'closed':![],'FaxAccountId':_0xd4d423[_0x9639('0x3a')]['id']}})[_0x9639('0x10')](function(_0x3d3edd){if(_0x3d3edd){return[_0x3d3edd,![]];}return db[_0x9639('0x46')][_0x9639('0x45')](_0x538cb9)[_0x9639('0x10')](function(_0x896b15){return[_0x896b15,!![]];});});}else{throw new Error(_0x9639('0x47'));}})['spread'](function(_0x1cfb15,_0x4e6120){var _0x4f5522=_0x1cfb15['get']({'plain':!![]});if(_0x4e6120){if(_0x5ebf1d[_0x9639('0x3a')][_0x9639('0x48')]){_0x5ebf1d[_0x9639('0x40')][_0x9639('0x49')]({'id':0x0,'priority':_0x5ebf1d[_0x9639('0x40')][_0x9639('0x44')]+0x1,'app':_0x9639('0x4a'),'appdata':_0x9639('0x4b'),'interval':'*,*,*,*'});}_0x4f5522['created']=!![];}else{_0x4f5522[_0x9639('0x4c')]=![];}_0x5ebf1d[_0x9639('0x4d')]=_0x4f5522;return db['FaxMessage'][_0x9639('0x45')]({'body':_0xd4d423[_0x9639('0x25')][_0x9639('0x25')],'FaxAccountId':_0xd4d423[_0x9639('0x3a')]['id'],'FaxInteractionId':_0x1cfb15['id'],'direction':'in','ContactId':_0x1cfb15[_0x9639('0x4e')],'AttachmentId':_0xd4d423[_0x9639('0x25')][_0x9639('0x4f')]});})[_0x9639('0x10')](function(_0x2b0ee4){_0x5ebf1d[_0x9639('0x19')]=_0x2b0ee4;if(!_0x5ebf1d[_0x9639('0x4d')][_0x9639('0x50')])return;return db[_0x9639('0x51')][_0x9639('0x39')]({'attributes':['id','name'],'where':{'id':_0x5ebf1d[_0x9639('0x4d')][_0x9639('0x50')]}});})[_0x9639('0x10')](function(_0x181c07){if(_0x181c07){_0x5ebf1d['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x181c07[_0x9639('0x52')]+','+(_0x5ebf1d[_0x9639('0x3a')][_0x9639('0x53')]||0xa),'interval':_0x9639('0x54')});}if(!_0x5ebf1d[_0x9639('0x4d')]['queueId'])return;return db[_0x9639('0x55')][_0x9639('0x39')]({'attributes':['id','name'],'where':{'id':_0x5ebf1d[_0x9639('0x4d')]['queueId']}});})[_0x9639('0x10')](function(_0x45ea7d){if(_0x45ea7d){_0x5ebf1d[_0x9639('0x40')][_0x9639('0x56')]({'id':0x0,'priority':0x1,'app':_0x9639('0x57'),'appdata':_0x45ea7d[_0x9639('0x52')]+','+(_0x5ebf1d[_0x9639('0x3a')]['waitForTheAssignedQueue']||0x12c),'interval':_0x9639('0x54')});}return respondWithRpcPromise(_0x9639('0x58'),_0x9639('0x59'),_0x5ebf1d);})['then'](function(_0x5e0608){_0x189d98(_0x5e0608);})[_0x9639('0x1b')](function(_0x1498c7){_0x48c924(_0x1b25ba['error'](0x1f4,_0x1498c7[_0x9639('0x19')]));});});}; \ No newline at end of file +var _0x009d=['model','attributes','then','catch','body','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','list','applications','priority','asc','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','unmanaged','*,*,*,*','interaction','FaxMessage','AttachmentId','UserId','User','name','unshift','waitForTheAssignedAgent','queueId','FaxQueue','find','queue','waitForTheAssignedQueue','Start','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFaxAccount','findAll','raw','options','where','include','map'];(function(_0x28e919,_0x145939){var _0x692b7e=function(_0x1514ae){while(--_0x1514ae){_0x28e919['push'](_0x28e919['shift']());}};_0x692b7e(++_0x145939);}(_0x009d,0xe7));var _0xd009=function(_0x61dd1a,_0x359293){_0x61dd1a=_0x61dd1a-0x0;var _0x5a24c3=_0x009d[_0x61dd1a];return _0x5a24c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd009('0x0'));var BPromise=require(_0xd009('0x1'));var rs=require(_0xd009('0x2'));var fs=require('fs');var Redis=require(_0xd009('0x3'));var db=require(_0xd009('0x4'))['db'];var utils=require(_0xd009('0x5'));var logger=require(_0xd009('0x6'))(_0xd009('0x7'));var config=require('../../config/environment');var jayson=require(_0xd009('0x8'));var client=jayson[_0xd009('0x9')][_0xd009('0xa')]({'port':0x232c});config[_0xd009('0xb')]=_[_0xd009('0xc')](config['redis'],{'host':_0xd009('0xd'),'port':0x18eb});var socket=require(_0xd009('0xe'))(new Redis(config[_0xd009('0xb')]));require(_0xd009('0xf'))['register'](socket);function respondWithRpcPromise(_0x4c12e5,_0x49b325,_0x617d19){return new BPromise(function(_0xa74985,_0x3c81a9){return client[_0xd009('0x10')](_0x4c12e5,_0x617d19)['then'](function(_0x4e0bc9){logger[_0xd009('0x11')](_0xd009('0x12'),_0x49b325,_0xd009('0x13'));logger[_0xd009('0x14')](_0xd009('0x15'),_0x49b325,_0xd009('0x13'),JSON['stringify'](_0x4e0bc9));if(_0x4e0bc9[_0xd009('0x16')]){if(_0x4e0bc9[_0xd009('0x16')][_0xd009('0x17')]===0x1f4){logger[_0xd009('0x16')](_0xd009('0x12'),_0x49b325,_0x4e0bc9[_0xd009('0x16')][_0xd009('0x18')]);return _0x3c81a9(_0x4e0bc9[_0xd009('0x16')][_0xd009('0x18')]);}logger[_0xd009('0x16')](_0xd009('0x12'),_0x49b325,_0x4e0bc9['error'][_0xd009('0x18')]);return _0xa74985(_0x4e0bc9[_0xd009('0x16')][_0xd009('0x18')]);}else{logger['info'](_0xd009('0x12'),_0x49b325,_0xd009('0x13'));_0xa74985(_0x4e0bc9[_0xd009('0x19')]['message']);}})['catch'](function(_0x248c38){logger['error'](_0xd009('0x12'),_0x49b325,_0x248c38);_0x3c81a9(_0x248c38);});});}exports[_0xd009('0x1a')]=function(_0x5d06f9){var _0x11ab4c=this;return new Promise(function(_0x1e0506,_0x30d364){return db['FaxAccount'][_0xd009('0x1b')]({'raw':_0x5d06f9['options']?_0x5d06f9['options'][_0xd009('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d06f9[_0xd009('0x1d')]?_0x5d06f9['options'][_0xd009('0x1e')]||null:null,'attributes':_0x5d06f9[_0xd009('0x1d')]?_0x5d06f9[_0xd009('0x1d')]['attributes']||null:null,'limit':_0x5d06f9[_0xd009('0x1d')]?_0x5d06f9[_0xd009('0x1d')]['limit']||null:null,'include':_0x5d06f9[_0xd009('0x1d')]?_0x5d06f9['options'][_0xd009('0x1f')]?_[_0xd009('0x20')](_0x5d06f9[_0xd009('0x1d')][_0xd009('0x1f')],function(_0x96f3d1){return{'model':db[_0x96f3d1[_0xd009('0x21')]],'as':_0x96f3d1['as'],'attributes':_0x96f3d1[_0xd009('0x22')],'include':_0x96f3d1['include']?_[_0xd009('0x20')](_0x96f3d1[_0xd009('0x1f')],function(_0xf8a635){return{'model':db[_0xf8a635[_0xd009('0x21')]],'as':_0xf8a635['as'],'attributes':_0xf8a635['attributes'],'include':_0xf8a635[_0xd009('0x1f')]?_[_0xd009('0x20')](_0xf8a635['include'],function(_0x3b6955){return{'model':db[_0x3b6955[_0xd009('0x21')]],'as':_0x3b6955['as'],'attributes':_0x3b6955['attributes']};}):[]};}):[]};}):[]:[]})[_0xd009('0x23')](function(_0x2e66b1){logger['info'](_0xd009('0x1a'),_0x5d06f9);logger[_0xd009('0x14')](_0xd009('0x1a'),_0x5d06f9,JSON['stringify'](_0x2e66b1));_0x1e0506(_0x2e66b1);})[_0xd009('0x24')](function(_0x48f93d){logger['error'](_0xd009('0x1a'),_0x48f93d['message'],_0x5d06f9);_0x30d364(_0x11ab4c[_0xd009('0x16')](0x1f4,_0x48f93d[_0xd009('0x18')]));});});};exports['NotifyFaxAccount']=function(_0x5003a2,_0x3a6d37,_0x1b490e){var _0xabbf21=this;return new Promise(function(_0x1c51ad,_0x2da920){var _0x2a5289={'body':_0x5003a2[_0xd009('0x25')],'channel':_0xd009('0x26')};var _0x50e9af=[];var _0x147605=[];var _0x5d8d53={};return db[_0xd009('0x27')][_0xd009('0x28')]()[_0xd009('0x23')](function(_0x1819d3){if(!_0x1819d3){throw new db[(_0xd009('0x29'))][(_0xd009('0x2a'))]('no\x20available\x20attributes');}_0x50e9af=_[_0xd009('0x2b')](_[_0xd009('0x2c')](_0x1819d3),[_0xd009('0x2d'),_0xd009('0x2e')]);_0x147605=_[_0xd009('0x2b')](_['keys'](_0x1819d3),[_0xd009('0x2d'),_0xd009('0x2e'),_0xd009('0x2f'),'ListId']);if(_0x5003a2[_0xd009('0x25')]['id']){delete _0x5003a2['body']['id'];}if(_[_0xd009('0x30')](_0x5003a2['body'][_0xd009('0x31')])){throw new db[(_0xd009('0x29'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xd009('0x30')](_0x5003a2[_0xd009('0x25')]['body'])||_0x5003a2[_0xd009('0x25')][_0xd009('0x25')]===''){throw new db['Sequelize'][(_0xd009('0x2a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x5003a2[_0xd009('0x25')][_0xd009('0x32')])){throw new db[(_0xd009('0x29'))]['ValidationError'](_0xd009('0x33')+_0x147605);}if(!_[_0xd009('0x34')](_0x147605,_0x5003a2[_0xd009('0x25')][_0xd009('0x32')])){throw new db[(_0xd009('0x29'))][(_0xd009('0x2a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x147605);}_0x5d8d53[_0x5003a2[_0xd009('0x25')][_0xd009('0x32')]]=_0x5003a2[_0xd009('0x25')][_0xd009('0x31')];})[_0xd009('0x23')](function(){return db['FaxAccount']['find']({'where':{'id':_0x5003a2[_0xd009('0x35')]['id']},'include':[{'model':db[_0xd009('0x36')],'as':_0xd009('0x37'),'include':[{'model':db['CmContact'],'as':_0xd009('0x38'),'where':_0x5d8d53,'limit':0x1,'order':[[_0xd009('0x2e'),_0xd009('0x39')]]}]},{'model':db[_0xd009('0x3a')],'as':_0xd009('0x3b')}]});})['then'](function(_0x4fb925){if(_0x4fb925&&_0x4fb925[_0xd009('0x37')]){var _0xdd9333=_0x4fb925[_0xd009('0x3c')]({'plain':!![]});_0x2a5289[_0xd009('0x35')]=_0xdd9333;_0x2a5289['applications']=_0xdd9333[_0xd009('0x3b')];_0x2a5289[_0xd009('0x3d')]=_0xdd9333[_0xd009('0x37')];_0x2a5289[_0xd009('0x3e')]=_['orderBy'](_0x2a5289[_0xd009('0x3e')],[_0xd009('0x3f')],[_0xd009('0x40')]);if(_0x2a5289['account'][_0xd009('0x3b')]){delete _0x2a5289['account'][_0xd009('0x3b')];}if(_0x2a5289[_0xd009('0x35')]['List']&&_0x2a5289[_0xd009('0x35')][_0xd009('0x37')][_0xd009('0x38')][_0xd009('0x41')]){return _0x2a5289['account'][_0xd009('0x37')][_0xd009('0x38')][0x0];}var _0x552334=_['defaults'](_0x5003a2[_0xd009('0x25')],{'firstName':_0x5003a2[_0xd009('0x25')]['from'],'ListId':_0xdd9333[_0xd009('0x42')]});_0x552334[_0x5003a2[_0xd009('0x25')]['mapKey']]=_0x5003a2[_0xd009('0x25')]['from'];return db['CmContact'][_0xd009('0x43')](_0x552334,{'fields':_0x50e9af,'raw':!![]});}})['then'](function(_0x5dbd0c){_0x2a5289[_0xd009('0x44')]=_0x5dbd0c;if(_0x5dbd0c){var _0x2d70cf={'ContactId':_0x5dbd0c['id'],'FaxAccountId':_0x5003a2[_0xd009('0x35')]['id'],'fax':_0x5dbd0c[_0xd009('0x26')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x5dbd0c['id'],'closed':![],'FaxAccountId':_0x5003a2[_0xd009('0x35')]['id']}})['then'](function(_0x1300bb){if(_0x1300bb){return[_0x1300bb,![]];}return db[_0xd009('0x45')][_0xd009('0x43')](_0x2d70cf)[_0xd009('0x23')](function(_0x3de744){return[_0x3de744,!![]];});});}else{throw new Error(_0xd009('0x46'));}})['spread'](function(_0x533964,_0x5b4d57){var _0x498bd7=_0x533964['get']({'plain':!![]});if(_0x5b4d57){if(_0x2a5289[_0xd009('0x35')][_0xd009('0x47')]){_0x2a5289[_0xd009('0x3e')]['push']({'id':0x0,'priority':_0x2a5289[_0xd009('0x3e')][_0xd009('0x41')]+0x1,'app':'close','appdata':_0xd009('0x48'),'interval':_0xd009('0x49')});}_0x498bd7['created']=!![];}else{_0x498bd7['created']=![];}_0x2a5289[_0xd009('0x4a')]=_0x498bd7;return db[_0xd009('0x4b')][_0xd009('0x43')]({'body':_0x5003a2[_0xd009('0x25')]['body'],'FaxAccountId':_0x5003a2['account']['id'],'FaxInteractionId':_0x533964['id'],'direction':'in','ContactId':_0x533964['ContactId'],'AttachmentId':_0x5003a2['body'][_0xd009('0x4c')]});})[_0xd009('0x23')](function(_0x10b3ab){_0x2a5289[_0xd009('0x18')]=_0x10b3ab;if(!_0x2a5289['interaction'][_0xd009('0x4d')])return;return db[_0xd009('0x4e')]['find']({'attributes':['id',_0xd009('0x4f')],'where':{'id':_0x2a5289[_0xd009('0x4a')][_0xd009('0x4d')]}});})['then'](function(_0xefeb14){if(_0xefeb14){_0x2a5289[_0xd009('0x3e')][_0xd009('0x50')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xefeb14['name']+','+(_0x2a5289['account'][_0xd009('0x51')]||0xa),'interval':_0xd009('0x49')});}if(!_0x2a5289['interaction'][_0xd009('0x52')])return;return db[_0xd009('0x53')][_0xd009('0x54')]({'attributes':['id','name'],'where':{'id':_0x2a5289[_0xd009('0x4a')]['queueId']}});})[_0xd009('0x23')](function(_0x3a81d2){if(_0x3a81d2){_0x2a5289['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0xd009('0x55'),'appdata':_0x3a81d2['name']+','+(_0x2a5289[_0xd009('0x35')][_0xd009('0x56')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xd009('0x57'),'startRouting',_0x2a5289);})[_0xd009('0x23')](function(_0x46772d){_0x1c51ad(_0x46772d);})[_0xd009('0x24')](function(_0x69883a){_0x2da920(_0xabbf21[_0xd009('0x16')](0x1f4,_0x69883a[_0xd009('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 7a00e5d..a80c080 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 _0x799b=['./faxAccount.events','remove','update','emit','removeListener','register','length','faxAccount:'];(function(_0x149e7f,_0x336baf){var _0x3222aa=function(_0x930e54){while(--_0x930e54){_0x149e7f['push'](_0x149e7f['shift']());}};_0x3222aa(++_0x336baf);}(_0x799b,0xa0));var _0xb799=function(_0x32a42c,_0x5bffda){_0x32a42c=_0x32a42c-0x0;var _0x272fc9=_0x799b[_0x32a42c];return _0x272fc9;};'use strict';var FaxAccountEvents=require(_0xb799('0x0'));var events=['save',_0xb799('0x1'),_0xb799('0x2')];function createListener(_0x1012e4,_0x75f956){return function(_0x26cc19){_0x75f956[_0xb799('0x3')](_0x1012e4,_0x26cc19);};}function removeListener(_0x48eecd,_0x1d8d65){return function(){FaxAccountEvents[_0xb799('0x4')](_0x48eecd,_0x1d8d65);};}exports[_0xb799('0x5')]=function(_0x4a68bc){for(var _0x1ed5be=0x0,_0x1270e7=events[_0xb799('0x6')];_0x1ed5be<_0x1270e7;_0x1ed5be++){var _0x505c63=events[_0x1ed5be];var _0x4072a2=createListener(_0xb799('0x7')+_0x505c63,_0x4a68bc);FaxAccountEvents['on'](_0x505c63,_0x4072a2);}}; \ No newline at end of file +var _0xc950=['update','emit','removeListener','register','faxAccount:','save'];(function(_0x1e6f18,_0x21de4b){var _0x257148=function(_0x3e58ef){while(--_0x3e58ef){_0x1e6f18['push'](_0x1e6f18['shift']());}};_0x257148(++_0x21de4b);}(_0xc950,0x77));var _0x0c95=function(_0x248834,_0x847c54){_0x248834=_0x248834-0x0;var _0x5bb52b=_0xc950[_0x248834];return _0x5bb52b;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x0c95('0x0'),'remove',_0x0c95('0x1')];function createListener(_0x1204e5,_0x241e0f){return function(_0x5a0892){_0x241e0f[_0x0c95('0x2')](_0x1204e5,_0x5a0892);};}function removeListener(_0x1b69f5,_0x5e28cc){return function(){FaxAccountEvents[_0x0c95('0x3')](_0x1b69f5,_0x5e28cc);};}exports[_0x0c95('0x4')]=function(_0x423a3c){for(var _0x54f3db=0x0,_0x110564=events['length'];_0x54f3db<_0x110564;_0x54f3db++){var _0x2b4585=events[_0x54f3db];var _0x21c59f=createListener(_0x0c95('0x5')+_0x2b4585,_0x423a3c);FaxAccountEvents['on'](_0x2b4585,_0x21c59f);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 2eb50c2..d23054d 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 _0x4dd5=['addDisposition','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','connect-timeout','express','Router','../../components/auth/service','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','getApplications','/:id/users','getAgents','post','create'];(function(_0x236dbd,_0x77c61d){var _0x5fae80=function(_0x1c9729){while(--_0x1c9729){_0x236dbd['push'](_0x236dbd['shift']());}};_0x5fae80(++_0x77c61d);}(_0x4dd5,0xce));var _0x54dd=function(_0x19d9b7,_0x5dc707){_0x19d9b7=_0x19d9b7-0x0;var _0x1f77ab=_0x4dd5[_0x19d9b7];return _0x1f77ab;};'use strict';var multer=require('multer');var util=require(_0x54dd('0x0'));var path=require('path');var timeout=require(_0x54dd('0x1'));var express=require(_0x54dd('0x2'));var router=express[_0x54dd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x54dd('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0x54dd('0x5')]('/',auth['isAuthenticated'](),controller[_0x54dd('0x6')]);router[_0x54dd('0x5')](_0x54dd('0x7'),auth['isAuthenticated'](),controller[_0x54dd('0x8')]);router[_0x54dd('0x5')](_0x54dd('0x9'),auth[_0x54dd('0xa')](),controller[_0x54dd('0xb')]);router['get'](_0x54dd('0xc'),auth[_0x54dd('0xa')](),controller[_0x54dd('0xd')]);router[_0x54dd('0x5')](_0x54dd('0xe'),auth[_0x54dd('0xa')](),controller[_0x54dd('0xf')]);router[_0x54dd('0x5')]('/:id/interactions',auth[_0x54dd('0xa')](),controller[_0x54dd('0x10')]);router[_0x54dd('0x5')]('/:id/applications',auth[_0x54dd('0xa')](),controller[_0x54dd('0x11')]);router[_0x54dd('0x5')]('/:id/messages',auth[_0x54dd('0xa')](),controller['getMessages']);router[_0x54dd('0x5')](_0x54dd('0x12'),auth[_0x54dd('0xa')](),controller[_0x54dd('0x13')]);router[_0x54dd('0x14')]('/',auth[_0x54dd('0xa')](),controller[_0x54dd('0x15')]);router['post'](_0x54dd('0xc'),auth[_0x54dd('0xa')](),controller[_0x54dd('0x16')]);router[_0x54dd('0x14')](_0x54dd('0xe'),auth[_0x54dd('0xa')](),controller[_0x54dd('0x17')]);router[_0x54dd('0x14')]('/:id/interactions',auth[_0x54dd('0xa')](),controller[_0x54dd('0x18')]);router[_0x54dd('0x14')]('/:id/applications',auth['isAuthenticated'](),controller[_0x54dd('0x19')]);router[_0x54dd('0x14')]('/addaccountapplications',auth['isAuthenticated'](),controller[_0x54dd('0x1a')]);router['post'](_0x54dd('0x1b'),auth[_0x54dd('0xa')](),controller['updateAccountApplications']);router['post'](_0x54dd('0x1c'),auth[_0x54dd('0xa')](),controller[_0x54dd('0x1d')]);router[_0x54dd('0x14')](_0x54dd('0x12'),auth['isAuthenticated'](),controller[_0x54dd('0x1e')]);router[_0x54dd('0x1f')]('/:id',auth[_0x54dd('0xa')](),controller[_0x54dd('0x20')]);router[_0x54dd('0x21')](_0x54dd('0x9'),auth['isAuthenticated'](),controller['destroy']);router[_0x54dd('0x21')](_0x54dd('0xc'),auth['isAuthenticated'](),controller[_0x54dd('0x22')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x54dd('0x23')]);router[_0x54dd('0x21')](_0x54dd('0x12'),auth[_0x54dd('0xa')](),controller[_0x54dd('0x24')]);module[_0x54dd('0x25')]=router; \ No newline at end of file +var _0x86d3=['getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/applications','getApplications','getMessages','/:id/users','getAgents','create','post','addAnswer','/:id/interactions','addInteraction','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions'];(function(_0x378a69,_0x9d790){var _0x4dcc55=function(_0x522b28){while(--_0x522b28){_0x378a69['push'](_0x378a69['shift']());}};_0x4dcc55(++_0x9d790);}(_0x86d3,0x6c));var _0x386d=function(_0x5d4ca7,_0x19113b){_0x5d4ca7=_0x5d4ca7-0x0;var _0x3efc03=_0x86d3[_0x5d4ca7];return _0x3efc03;};'use strict';var multer=require(_0x386d('0x0'));var util=require('util');var path=require(_0x386d('0x1'));var timeout=require(_0x386d('0x2'));var express=require(_0x386d('0x3'));var router=express[_0x386d('0x4')]();var fs_extra=require(_0x386d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x386d('0x6'));var config=require('../../config/environment');var controller=require(_0x386d('0x7'));router[_0x386d('0x8')]('/',auth[_0x386d('0x9')](),controller[_0x386d('0xa')]);router[_0x386d('0x8')]('/describe',auth[_0x386d('0x9')](),controller[_0x386d('0xb')]);router[_0x386d('0x8')](_0x386d('0xc'),auth['isAuthenticated'](),controller[_0x386d('0xd')]);router[_0x386d('0x8')](_0x386d('0xe'),auth[_0x386d('0x9')](),controller[_0x386d('0xf')]);router[_0x386d('0x8')](_0x386d('0x10'),auth[_0x386d('0x9')](),controller[_0x386d('0x11')]);router[_0x386d('0x8')]('/:id/interactions',auth[_0x386d('0x9')](),controller[_0x386d('0x12')]);router[_0x386d('0x8')](_0x386d('0x13'),auth[_0x386d('0x9')](),controller[_0x386d('0x14')]);router['get']('/:id/messages',auth[_0x386d('0x9')](),controller[_0x386d('0x15')]);router['get'](_0x386d('0x16'),auth[_0x386d('0x9')](),controller[_0x386d('0x17')]);router['post']('/',auth[_0x386d('0x9')](),controller[_0x386d('0x18')]);router[_0x386d('0x19')](_0x386d('0xe'),auth[_0x386d('0x9')](),controller['addDisposition']);router[_0x386d('0x19')](_0x386d('0x10'),auth[_0x386d('0x9')](),controller[_0x386d('0x1a')]);router[_0x386d('0x19')](_0x386d('0x1b'),auth[_0x386d('0x9')](),controller[_0x386d('0x1c')]);router[_0x386d('0x19')](_0x386d('0x13'),auth[_0x386d('0x9')](),controller['addApplications']);router[_0x386d('0x19')](_0x386d('0x1d'),auth['isAuthenticated'](),controller[_0x386d('0x1e')]);router[_0x386d('0x19')](_0x386d('0x1f'),auth[_0x386d('0x9')](),controller[_0x386d('0x20')]);router[_0x386d('0x19')](_0x386d('0x21'),auth[_0x386d('0x9')](),controller['send']);router['post'](_0x386d('0x16'),auth[_0x386d('0x9')](),controller[_0x386d('0x22')]);router[_0x386d('0x23')](_0x386d('0xc'),auth[_0x386d('0x9')](),controller[_0x386d('0x24')]);router[_0x386d('0x25')](_0x386d('0xc'),auth[_0x386d('0x9')](),controller['destroy']);router[_0x386d('0x25')](_0x386d('0xe'),auth['isAuthenticated'](),controller[_0x386d('0x26')]);router[_0x386d('0x25')]('/:id/canned_answers',auth[_0x386d('0x9')](),controller[_0x386d('0x27')]);router[_0x386d('0x25')](_0x386d('0x16'),auth[_0x386d('0x9')](),controller[_0x386d('0x28')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index e3bc72b..74f02cf 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 _0x0a83=['INTEGER','STRING','sequelize'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x0a83,0x101));var _0x30a8=function(_0x3ab353,_0x5d5283){_0x3ab353=_0x3ab353-0x0;var _0x1e2285=_0x0a83[_0x3ab353];return _0x1e2285;};'use strict';var Sequelize=require(_0x30a8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x30a8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x30a8('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x30a8('0x2')]},'interval':{'type':Sequelize[_0x30a8('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xa20e=['INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x109f62,_0x2a1093){var _0x2ac0cc=function(_0x2cf0da){while(--_0x2cf0da){_0x109f62['push'](_0x109f62['shift']());}};_0x2ac0cc(++_0x2a1093);}(_0xa20e,0x81));var _0xea20=function(_0x1dc539,_0x3658b8){_0x1dc539=_0x1dc539-0x0;var _0x1b7ffd=_0xa20e[_0x1dc539];return _0x1b7ffd;};'use strict';var Sequelize=require(_0xea20('0x0'));module['exports']={'priority':{'type':Sequelize[_0xea20('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xea20('0x2')],'allowNull':![],'defaultValue':_0xea20('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xea20('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xea20('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index c0a026f..158ee83 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 _0x1f75=['offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FaxApplication','includeAll','include','rows','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json'];(function(_0x362a64,_0x2d92b6){var _0x422477=function(_0x29f90b){while(--_0x29f90b){_0x362a64['push'](_0x362a64['shift']());}};_0x422477(++_0x2d92b6);}(_0x1f75,0x1c0));var _0x51f7=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x1f75[_0x5a79e2];return _0x266c45;};'use strict';var emlformat=require(_0x51f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x51f7('0x1'));var jsonpatch=require(_0x51f7('0x2'));var rp=require(_0x51f7('0x3'));var moment=require(_0x51f7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x51f7('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x51f7('0x6'));var ejs=require(_0x51f7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x51f7('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x51f7('0x6'));var querystring=require('querystring');var Papa=require(_0x51f7('0x9'));var Redis=require('ioredis');var authService=require(_0x51f7('0xa'));var qs=require(_0x51f7('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51f7('0xc'));var logger=require(_0x51f7('0xd'))(_0x51f7('0xe'));var utils=require('../../config/utils');var config=require(_0x51f7('0xf'));var licenseUtil=require(_0x51f7('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35d045,_0x42a8cf){_0x42a8cf=_0x42a8cf||0xcc;return function(_0x37d3f1){if(_0x37d3f1){return _0x35d045[_0x51f7('0x11')](_0x42a8cf);}return _0x35d045[_0x51f7('0x12')](_0x42a8cf)[_0x51f7('0x13')]();};}function respondWithResult(_0x4eaf99,_0x5eab94){_0x5eab94=_0x5eab94||0xc8;return function(_0x449d59){if(_0x449d59){return _0x4eaf99[_0x51f7('0x12')](_0x5eab94)[_0x51f7('0x14')](_0x449d59);}};}function respondWithFilteredResult(_0x165b31,_0x3394ce){return function(_0xa89791){if(_0xa89791){var _0x1882f1=typeof _0x3394ce[_0x51f7('0x15')]===_0x51f7('0x16')&&typeof _0x3394ce[_0x51f7('0x17')]===_0x51f7('0x16');var _0x7ef3ed=_0xa89791['count'];var _0x4f61d8=_0x1882f1?0x0:_0x3394ce['offset'];var _0x523aaa=_0x1882f1?_0xa89791[_0x51f7('0x18')]:_0x3394ce[_0x51f7('0x15')]+_0x3394ce[_0x51f7('0x17')];var _0x2df446;if(_0x523aaa>=_0x7ef3ed){_0x523aaa=_0x7ef3ed;_0x2df446=0xc8;}else{_0x2df446=0xce;}_0x165b31[_0x51f7('0x12')](_0x2df446);return _0x165b31['set'](_0x51f7('0x19'),_0x4f61d8+'-'+_0x523aaa+'/'+_0x7ef3ed)['json'](_0xa89791);}return null;};}function patchUpdates(_0x4f3834){return function(_0x43fae9){try{jsonpatch['apply'](_0x43fae9,_0x4f3834,!![]);}catch(_0x3a3f4c){return BPromise[_0x51f7('0x1a')](_0x3a3f4c);}return _0x43fae9[_0x51f7('0x1b')]();};}function saveUpdates(_0x2d45f9,_0x1e276e){return function(_0x272fe3){if(_0x272fe3){return _0x272fe3[_0x51f7('0x1c')](_0x2d45f9)[_0x51f7('0x1d')](function(_0x166615){return _0x166615;});}return null;};}function removeEntity(_0x4ed998,_0xda0098){return function(_0xc071b4){if(_0xc071b4){return _0xc071b4[_0x51f7('0x1e')]()[_0x51f7('0x1d')](function(){_0x4ed998[_0x51f7('0x12')](0xcc)[_0x51f7('0x13')]();});}};}function handleEntityNotFound(_0x5a3f04,_0x5114a3){return function(_0x85ae26){if(!_0x85ae26){_0x5a3f04[_0x51f7('0x11')](0x194);}return _0x85ae26;};}function handleError(_0x13e324,_0x347250){_0x347250=_0x347250||0x1f4;return function(_0x1d7dbf){logger[_0x51f7('0x1f')](_0x1d7dbf[_0x51f7('0x20')]);if(_0x1d7dbf[_0x51f7('0x21')]){delete _0x1d7dbf[_0x51f7('0x21')];}_0x13e324[_0x51f7('0x12')](_0x347250)[_0x51f7('0x22')](_0x1d7dbf);};}exports[_0x51f7('0x23')]=function(_0x2025b9,_0x1bca66){var _0x2bb865={},_0x2d4ade={},_0x5bfe99={'count':0x0,'rows':[]};var _0x183d8e=_['map'](db['FaxApplication'][_0x51f7('0x24')],function(_0x175f2a){return{'name':_0x175f2a[_0x51f7('0x25')],'type':_0x175f2a[_0x51f7('0x26')][_0x51f7('0x27')]};});_0x2d4ade[_0x51f7('0x28')]=_[_0x51f7('0x29')](_0x183d8e,_0x51f7('0x21'));_0x2d4ade['query']=_[_0x51f7('0x2a')](_0x2025b9['query']);_0x2d4ade[_0x51f7('0x2b')]=_[_0x51f7('0x2c')](_0x2d4ade[_0x51f7('0x28')],_0x2d4ade[_0x51f7('0x2d')]);_0x2bb865[_0x51f7('0x2e')]=_['intersection'](_0x2d4ade[_0x51f7('0x28')],qs[_0x51f7('0x2f')](_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x2f')]));_0x2bb865[_0x51f7('0x2e')]=_0x2bb865['attributes']['length']?_0x2bb865['attributes']:_0x2d4ade['model'];if(!_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x30')](_0x51f7('0x31'))){_0x2bb865[_0x51f7('0x17')]=qs[_0x51f7('0x17')](_0x2025b9['query'][_0x51f7('0x17')]);_0x2bb865['offset']=qs[_0x51f7('0x15')](_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x15')]);}_0x2bb865[_0x51f7('0x32')]=qs['sort'](_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x33')]);_0x2bb865[_0x51f7('0x34')]=qs[_0x51f7('0x2b')](_['pick'](_0x2025b9['query'],_0x2d4ade[_0x51f7('0x2b')]),_0x183d8e);if(_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x35')]){_0x2bb865[_0x51f7('0x34')]=_[_0x51f7('0x36')](_0x2bb865[_0x51f7('0x34')],{'$or':_[_0x51f7('0x29')](_0x183d8e,function(_0x59a509){if(_0x59a509[_0x51f7('0x26')]!==_0x51f7('0x37')){var _0x9dec6d={};_0x9dec6d[_0x59a509[_0x51f7('0x21')]]={'$like':'%'+_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x35')]+'%'};return _0x9dec6d;}})});}_0x2bb865=_['merge']({},_0x2bb865,_0x2025b9[_0x51f7('0x38')]);var _0x53b8c9={'where':_0x2bb865[_0x51f7('0x34')]};return db[_0x51f7('0x39')][_0x51f7('0x18')](_0x53b8c9)[_0x51f7('0x1d')](function(_0x2dec4f){_0x5bfe99[_0x51f7('0x18')]=_0x2dec4f;if(_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x3a')]){_0x2bb865[_0x51f7('0x3b')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x2bb865);})[_0x51f7('0x1d')](function(_0x569c6c){_0x5bfe99[_0x51f7('0x3c')]=_0x569c6c;return _0x5bfe99;})[_0x51f7('0x1d')](respondWithFilteredResult(_0x1bca66,_0x2bb865))[_0x51f7('0x3d')](handleError(_0x1bca66,null));};exports[_0x51f7('0x3e')]=function(_0x19d4e5,_0xf7749f){var _0x46b265={'raw':!![],'where':{'id':_0x19d4e5['params']['id']}},_0x55c9f4={};_0x55c9f4[_0x51f7('0x28')]=_['keys'](db['FaxApplication'][_0x51f7('0x24')]);_0x55c9f4[_0x51f7('0x2d')]=_[_0x51f7('0x2a')](_0x19d4e5[_0x51f7('0x2d')]);_0x55c9f4['filters']=_[_0x51f7('0x2c')](_0x55c9f4[_0x51f7('0x28')],_0x55c9f4[_0x51f7('0x2d')]);_0x46b265[_0x51f7('0x2e')]=_[_0x51f7('0x2c')](_0x55c9f4[_0x51f7('0x28')],qs['fields'](_0x19d4e5['query']['fields']));_0x46b265[_0x51f7('0x2e')]=_0x46b265[_0x51f7('0x2e')]['length']?_0x46b265[_0x51f7('0x2e')]:_0x55c9f4['model'];if(_0x19d4e5[_0x51f7('0x2d')][_0x51f7('0x3a')]){_0x46b265[_0x51f7('0x3b')]=[{'all':!![]}];}_0x46b265=_[_0x51f7('0x36')]({},_0x46b265,_0x19d4e5['options']);return db[_0x51f7('0x39')][_0x51f7('0x3f')](_0x46b265)[_0x51f7('0x1d')](handleEntityNotFound(_0xf7749f,null))[_0x51f7('0x1d')](respondWithResult(_0xf7749f,null))[_0x51f7('0x3d')](handleError(_0xf7749f,null));};exports[_0x51f7('0x40')]=function(_0x359127,_0x233c1e){return db[_0x51f7('0x39')][_0x51f7('0x40')](_0x359127[_0x51f7('0x41')],{})[_0x51f7('0x1d')](respondWithResult(_0x233c1e,0xc9))[_0x51f7('0x3d')](handleError(_0x233c1e,null));};exports[_0x51f7('0x1c')]=function(_0x36bd42,_0x2bf2df){if(_0x36bd42[_0x51f7('0x41')]['id']){delete _0x36bd42[_0x51f7('0x41')]['id'];}return db[_0x51f7('0x39')][_0x51f7('0x3f')]({'where':{'id':_0x36bd42['params']['id']}})[_0x51f7('0x1d')](handleEntityNotFound(_0x2bf2df,null))['then'](saveUpdates(_0x36bd42[_0x51f7('0x41')],null))[_0x51f7('0x1d')](respondWithResult(_0x2bf2df,null))[_0x51f7('0x3d')](handleError(_0x2bf2df,null));};exports[_0x51f7('0x1e')]=function(_0x3da471,_0x29c47a){return db['FaxApplication'][_0x51f7('0x3f')]({'where':{'id':_0x3da471[_0x51f7('0x42')]['id']}})[_0x51f7('0x1d')](handleEntityNotFound(_0x29c47a,null))[_0x51f7('0x1d')](removeEntity(_0x29c47a,null))['catch'](handleError(_0x29c47a,null));}; \ No newline at end of file +var _0xd486=['includeAll','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','error','stack','name','FaxApplication','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','catch','params'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd486,0xe3));var _0x6d48=function(_0x2f6532,_0xe411e4){_0x2f6532=_0x2f6532-0x0;var _0x34de94=_0xd486[_0x2f6532];return _0x34de94;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d48('0x0'));var zipdir=require(_0x6d48('0x1'));var jsonpatch=require(_0x6d48('0x2'));var rp=require(_0x6d48('0x3'));var moment=require(_0x6d48('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6d48('0x5'));var util=require(_0x6d48('0x6'));var path=require(_0x6d48('0x7'));var sox=require(_0x6d48('0x8'));var csv=require(_0x6d48('0x9'));var ejs=require(_0x6d48('0xa'));var fs=require('fs');var fs_extra=require(_0x6d48('0xb'));var _=require(_0x6d48('0xc'));var squel=require(_0x6d48('0xd'));var crypto=require(_0x6d48('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6d48('0xf'));var toCsv=require(_0x6d48('0x9'));var querystring=require(_0x6d48('0x10'));var Papa=require(_0x6d48('0x11'));var Redis=require(_0x6d48('0x12'));var authService=require(_0x6d48('0x13'));var qs=require(_0x6d48('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d48('0x15'));var logger=require(_0x6d48('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x6d48('0x17'));var licenseUtil=require(_0x6d48('0x18'));var db=require(_0x6d48('0x19'))['db'];function respondWithStatusCode(_0x33f36b,_0x908273){_0x908273=_0x908273||0xcc;return function(_0x43f0a3){if(_0x43f0a3){return _0x33f36b[_0x6d48('0x1a')](_0x908273);}return _0x33f36b[_0x6d48('0x1b')](_0x908273)[_0x6d48('0x1c')]();};}function respondWithResult(_0x945c4b,_0x1494af){_0x1494af=_0x1494af||0xc8;return function(_0x4e9a87){if(_0x4e9a87){return _0x945c4b[_0x6d48('0x1b')](_0x1494af)[_0x6d48('0x1d')](_0x4e9a87);}};}function respondWithFilteredResult(_0x274fc8,_0x385176){return function(_0x496efd){if(_0x496efd){var _0x2d8179=typeof _0x385176[_0x6d48('0x1e')]===_0x6d48('0x1f')&&typeof _0x385176[_0x6d48('0x20')]===_0x6d48('0x1f');var _0x2fb010=_0x496efd[_0x6d48('0x21')];var _0x1af00f=_0x2d8179?0x0:_0x385176[_0x6d48('0x1e')];var _0x33bf5f=_0x2d8179?_0x496efd[_0x6d48('0x21')]:_0x385176['offset']+_0x385176['limit'];var _0x25fedf;if(_0x33bf5f>=_0x2fb010){_0x33bf5f=_0x2fb010;_0x25fedf=0xc8;}else{_0x25fedf=0xce;}_0x274fc8[_0x6d48('0x1b')](_0x25fedf);return _0x274fc8['set'](_0x6d48('0x22'),_0x1af00f+'-'+_0x33bf5f+'/'+_0x2fb010)[_0x6d48('0x1d')](_0x496efd);}return null;};}function patchUpdates(_0x24f38f){return function(_0x572ea9){try{jsonpatch['apply'](_0x572ea9,_0x24f38f,!![]);}catch(_0x14b4c1){return BPromise[_0x6d48('0x23')](_0x14b4c1);}return _0x572ea9[_0x6d48('0x24')]();};}function saveUpdates(_0x2a9b75,_0xaebc63){return function(_0x2ee1b4){if(_0x2ee1b4){return _0x2ee1b4[_0x6d48('0x25')](_0x2a9b75)['then'](function(_0x114cd1){return _0x114cd1;});}return null;};}function removeEntity(_0x2aebdf,_0x1f1c32){return function(_0x32178e){if(_0x32178e){return _0x32178e[_0x6d48('0x26')]()[_0x6d48('0x27')](function(){_0x2aebdf[_0x6d48('0x1b')](0xcc)[_0x6d48('0x1c')]();});}};}function handleEntityNotFound(_0x4a7f89,_0x24a411){return function(_0x148133){if(!_0x148133){_0x4a7f89['sendStatus'](0x194);}return _0x148133;};}function handleError(_0x5e0d5e,_0x11724f){_0x11724f=_0x11724f||0x1f4;return function(_0x9d6db8){logger[_0x6d48('0x28')](_0x9d6db8[_0x6d48('0x29')]);if(_0x9d6db8['name']){delete _0x9d6db8[_0x6d48('0x2a')];}_0x5e0d5e[_0x6d48('0x1b')](_0x11724f)['send'](_0x9d6db8);};}exports['index']=function(_0x774028,_0x59bc23){var _0x23b9ec={},_0x3f83f8={},_0x2e3942={'count':0x0,'rows':[]};var _0x54938b=_['map'](db[_0x6d48('0x2b')][_0x6d48('0x2c')],function(_0x3c5a30){return{'name':_0x3c5a30['fieldName'],'type':_0x3c5a30[_0x6d48('0x2d')][_0x6d48('0x2e')]};});_0x3f83f8[_0x6d48('0x2f')]=_[_0x6d48('0x30')](_0x54938b,_0x6d48('0x2a'));_0x3f83f8[_0x6d48('0x31')]=_[_0x6d48('0x32')](_0x774028['query']);_0x3f83f8['filters']=_[_0x6d48('0x33')](_0x3f83f8[_0x6d48('0x2f')],_0x3f83f8['query']);_0x23b9ec[_0x6d48('0x34')]=_[_0x6d48('0x33')](_0x3f83f8[_0x6d48('0x2f')],qs[_0x6d48('0x35')](_0x774028[_0x6d48('0x31')][_0x6d48('0x35')]));_0x23b9ec[_0x6d48('0x34')]=_0x23b9ec[_0x6d48('0x34')][_0x6d48('0x36')]?_0x23b9ec[_0x6d48('0x34')]:_0x3f83f8['model'];if(!_0x774028[_0x6d48('0x31')][_0x6d48('0x37')](_0x6d48('0x38'))){_0x23b9ec[_0x6d48('0x20')]=qs[_0x6d48('0x20')](_0x774028['query']['limit']);_0x23b9ec[_0x6d48('0x1e')]=qs[_0x6d48('0x1e')](_0x774028[_0x6d48('0x31')][_0x6d48('0x1e')]);}_0x23b9ec[_0x6d48('0x39')]=qs[_0x6d48('0x3a')](_0x774028[_0x6d48('0x31')][_0x6d48('0x3a')]);_0x23b9ec[_0x6d48('0x3b')]=qs[_0x6d48('0x3c')](_[_0x6d48('0x3d')](_0x774028[_0x6d48('0x31')],_0x3f83f8[_0x6d48('0x3c')]),_0x54938b);if(_0x774028['query'][_0x6d48('0x3e')]){_0x23b9ec['where']=_[_0x6d48('0x3f')](_0x23b9ec[_0x6d48('0x3b')],{'$or':_[_0x6d48('0x30')](_0x54938b,function(_0x8e5e72){if(_0x8e5e72[_0x6d48('0x2d')]!==_0x6d48('0x40')){var _0x53457e={};_0x53457e[_0x8e5e72[_0x6d48('0x2a')]]={'$like':'%'+_0x774028['query'][_0x6d48('0x3e')]+'%'};return _0x53457e;}})});}_0x23b9ec=_[_0x6d48('0x3f')]({},_0x23b9ec,_0x774028[_0x6d48('0x41')]);var _0x4be0ae={'where':_0x23b9ec[_0x6d48('0x3b')]};return db[_0x6d48('0x2b')][_0x6d48('0x21')](_0x4be0ae)[_0x6d48('0x27')](function(_0x290196){_0x2e3942[_0x6d48('0x21')]=_0x290196;if(_0x774028[_0x6d48('0x31')]['includeAll']){_0x23b9ec['include']=[{'all':!![]}];}return db[_0x6d48('0x2b')]['findAll'](_0x23b9ec);})[_0x6d48('0x27')](function(_0x2c3eb7){_0x2e3942[_0x6d48('0x42')]=_0x2c3eb7;return _0x2e3942;})['then'](respondWithFilteredResult(_0x59bc23,_0x23b9ec))[_0x6d48('0x43')](handleError(_0x59bc23,null));};exports['show']=function(_0x3fc029,_0x3405c1){var _0x3597b7={'raw':!![],'where':{'id':_0x3fc029[_0x6d48('0x44')]['id']}},_0x1af63a={};_0x1af63a[_0x6d48('0x2f')]=_[_0x6d48('0x32')](db[_0x6d48('0x2b')][_0x6d48('0x2c')]);_0x1af63a['query']=_[_0x6d48('0x32')](_0x3fc029[_0x6d48('0x31')]);_0x1af63a[_0x6d48('0x3c')]=_[_0x6d48('0x33')](_0x1af63a['model'],_0x1af63a[_0x6d48('0x31')]);_0x3597b7[_0x6d48('0x34')]=_[_0x6d48('0x33')](_0x1af63a['model'],qs[_0x6d48('0x35')](_0x3fc029[_0x6d48('0x31')]['fields']));_0x3597b7[_0x6d48('0x34')]=_0x3597b7['attributes'][_0x6d48('0x36')]?_0x3597b7[_0x6d48('0x34')]:_0x1af63a['model'];if(_0x3fc029[_0x6d48('0x31')][_0x6d48('0x45')]){_0x3597b7[_0x6d48('0x46')]=[{'all':!![]}];}_0x3597b7=_[_0x6d48('0x3f')]({},_0x3597b7,_0x3fc029[_0x6d48('0x41')]);return db[_0x6d48('0x2b')][_0x6d48('0x47')](_0x3597b7)[_0x6d48('0x27')](handleEntityNotFound(_0x3405c1,null))[_0x6d48('0x27')](respondWithResult(_0x3405c1,null))[_0x6d48('0x43')](handleError(_0x3405c1,null));};exports[_0x6d48('0x48')]=function(_0x785ed6,_0x1061c8){return db[_0x6d48('0x2b')][_0x6d48('0x48')](_0x785ed6[_0x6d48('0x49')],{})[_0x6d48('0x27')](respondWithResult(_0x1061c8,0xc9))[_0x6d48('0x43')](handleError(_0x1061c8,null));};exports[_0x6d48('0x25')]=function(_0x3201a7,_0x329865){if(_0x3201a7[_0x6d48('0x49')]['id']){delete _0x3201a7[_0x6d48('0x49')]['id'];}return db[_0x6d48('0x2b')][_0x6d48('0x47')]({'where':{'id':_0x3201a7[_0x6d48('0x44')]['id']}})[_0x6d48('0x27')](handleEntityNotFound(_0x329865,null))[_0x6d48('0x27')](saveUpdates(_0x3201a7[_0x6d48('0x49')],null))[_0x6d48('0x27')](respondWithResult(_0x329865,null))[_0x6d48('0x43')](handleError(_0x329865,null));};exports[_0x6d48('0x26')]=function(_0x2176e4,_0x38a6b7){return db['FaxApplication'][_0x6d48('0x47')]({'where':{'id':_0x2176e4[_0x6d48('0x44')]['id']}})[_0x6d48('0x27')](handleEntityNotFound(_0x38a6b7,null))[_0x6d48('0x27')](removeEntity(_0x38a6b7,null))[_0x6d48('0x43')](handleError(_0x38a6b7,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 75f95a1..344f243 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 _0x1334=['request-promise','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x24e1f7,_0x33a7a3){var _0xfd60c=function(_0x8ce237){while(--_0x8ce237){_0x24e1f7['push'](_0x24e1f7['shift']());}};_0xfd60c(++_0x33a7a3);}(_0x1334,0xea));var _0x4133=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x1334[_0x31b5a5];return _0x364cc9;};'use strict';var _=require(_0x4133('0x0'));var util=require(_0x4133('0x1'));var logger=require(_0x4133('0x2'))(_0x4133('0x3'));var moment=require(_0x4133('0x4'));var BPromise=require(_0x4133('0x5'));var rp=require(_0x4133('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4133('0x7'));module[_0x4133('0x8')]=function(_0x874548,_0x2ca04c){return _0x874548[_0x4133('0x9')](_0x4133('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4133('0xb')});}; \ No newline at end of file +var _0x9dce=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./faxApplication.attributes','exports','FaxApplication','fax_applications'];(function(_0x28664f,_0x466414){var _0x373276=function(_0x48a5fe){while(--_0x48a5fe){_0x28664f['push'](_0x28664f['shift']());}};_0x373276(++_0x466414);}(_0x9dce,0x1b4));var _0xe9dc=function(_0x48215c,_0x507b27){_0x48215c=_0x48215c-0x0;var _0x47d590=_0x9dce[_0x48215c];return _0x47d590;};'use strict';var _=require(_0xe9dc('0x0'));var util=require(_0xe9dc('0x1'));var logger=require(_0xe9dc('0x2'))(_0xe9dc('0x3'));var moment=require(_0xe9dc('0x4'));var BPromise=require(_0xe9dc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9dc('0x6'));var rimraf=require(_0xe9dc('0x7'));var config=require('../../config/environment');var attributes=require(_0xe9dc('0x8'));module[_0xe9dc('0x9')]=function(_0x53de87,_0x354dc3){return _0x53de87['define'](_0xe9dc('0xa'),attributes,{'tableName':_0xe9dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe9dc('0xc'),'collate':_0xe9dc('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index f67bc1c..99cf103 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 _0x5570=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','limit'];(function(_0x495f2b,_0x253ab3){var _0x12fa6e=function(_0xbb4b3b){while(--_0xbb4b3b){_0x495f2b['push'](_0x495f2b['shift']());}};_0x12fa6e(++_0x253ab3);}(_0x5570,0x122));var _0x0557=function(_0x118d39,_0x43be87){_0x118d39=_0x118d39-0x0;var _0x47958b=_0x5570[_0x118d39];return _0x47958b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0557('0x0'));var BPromise=require(_0x0557('0x1'));var rs=require(_0x0557('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0557('0x3'))['db'];var utils=require(_0x0557('0x4'));var logger=require('../../config/logger')(_0x0557('0x5'));var config=require(_0x0557('0x6'));var jayson=require(_0x0557('0x7'));var client=jayson[_0x0557('0x8')][_0x0557('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17bd51,_0x168641,_0x3afc9d){return new BPromise(function(_0x13b56e,_0x28a84a){return client['request'](_0x17bd51,_0x3afc9d)[_0x0557('0xa')](function(_0x50e0e9){logger[_0x0557('0xb')](_0x0557('0xc'),_0x168641,'request\x20sent');logger[_0x0557('0xd')](_0x0557('0xe'),_0x168641,_0x0557('0xf'),JSON[_0x0557('0x10')](_0x50e0e9));if(_0x50e0e9[_0x0557('0x11')]){if(_0x50e0e9[_0x0557('0x11')][_0x0557('0x12')]===0x1f4){logger[_0x0557('0x11')]('FaxApplication,\x20%s,\x20%s',_0x168641,_0x50e0e9[_0x0557('0x11')][_0x0557('0x13')]);return _0x28a84a(_0x50e0e9[_0x0557('0x11')]['message']);}logger[_0x0557('0x11')](_0x0557('0xc'),_0x168641,_0x50e0e9[_0x0557('0x11')][_0x0557('0x13')]);return _0x13b56e(_0x50e0e9[_0x0557('0x11')]['message']);}else{logger[_0x0557('0xb')]('FaxApplication,\x20%s,\x20%s',_0x168641,_0x0557('0xf'));_0x13b56e(_0x50e0e9[_0x0557('0x14')][_0x0557('0x13')]);}})[_0x0557('0x15')](function(_0xdc727a){logger['error'](_0x0557('0xc'),_0x168641,_0xdc727a);_0x28a84a(_0xdc727a);});});}exports[_0x0557('0x16')]=function(_0x2dff77){var _0x24c4ec=this;return new Promise(function(_0x5a1e34,_0xfb871){return db[_0x0557('0x17')][_0x0557('0x18')](_0x2dff77[_0x0557('0x19')],{'raw':_0x2dff77[_0x0557('0x1a')]?_0x2dff77[_0x0557('0x1a')][_0x0557('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dff77[_0x0557('0x1a')]?_0x2dff77[_0x0557('0x1a')]['where']||null:null,'attributes':_0x2dff77[_0x0557('0x1a')]?_0x2dff77[_0x0557('0x1a')]['attributes']||null:null,'limit':_0x2dff77[_0x0557('0x1a')]?_0x2dff77['options'][_0x0557('0x1c')]||null:null})['then'](function(_0x4b1290){logger[_0x0557('0xb')](_0x0557('0x16'),_0x2dff77);logger[_0x0557('0xd')](_0x0557('0x16'),_0x2dff77,JSON[_0x0557('0x10')](_0x4b1290));_0x5a1e34(_0x4b1290);})[_0x0557('0x15')](function(_0x4ee9f9){logger[_0x0557('0x11')]('UpdateFaxApplication',_0x4ee9f9['message'],_0x2dff77);_0xfb871(_0x24c4ec[_0x0557('0x11')](0x1f4,_0x4ee9f9[_0x0557('0x13')]));});});}; \ No newline at end of file +var _0xad01=['message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xad01,0x1d4));var _0x1ad0=function(_0x5b3e86,_0x1bdd3a){_0x5b3e86=_0x5b3e86-0x0;var _0x5170f6=_0xad01[_0x5b3e86];return _0x5170f6;};'use strict';var _=require(_0x1ad0('0x0'));var util=require(_0x1ad0('0x1'));var moment=require(_0x1ad0('0x2'));var BPromise=require(_0x1ad0('0x3'));var rs=require(_0x1ad0('0x4'));var fs=require('fs');var Redis=require(_0x1ad0('0x5'));var db=require(_0x1ad0('0x6'))['db'];var utils=require(_0x1ad0('0x7'));var logger=require(_0x1ad0('0x8'))(_0x1ad0('0x9'));var config=require(_0x1ad0('0xa'));var jayson=require(_0x1ad0('0xb'));var client=jayson[_0x1ad0('0xc')][_0x1ad0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x44d58a,_0x739f1d,_0x36e65c){return new BPromise(function(_0x5b22cc,_0x3eb18f){return client[_0x1ad0('0xe')](_0x44d58a,_0x36e65c)[_0x1ad0('0xf')](function(_0x1b6ba1){logger[_0x1ad0('0x10')](_0x1ad0('0x11'),_0x739f1d,_0x1ad0('0x12'));logger[_0x1ad0('0x13')](_0x1ad0('0x14'),_0x739f1d,_0x1ad0('0x12'),JSON['stringify'](_0x1b6ba1));if(_0x1b6ba1[_0x1ad0('0x15')]){if(_0x1b6ba1[_0x1ad0('0x15')]['code']===0x1f4){logger[_0x1ad0('0x15')](_0x1ad0('0x11'),_0x739f1d,_0x1b6ba1[_0x1ad0('0x15')]['message']);return _0x3eb18f(_0x1b6ba1[_0x1ad0('0x15')][_0x1ad0('0x16')]);}logger[_0x1ad0('0x15')](_0x1ad0('0x11'),_0x739f1d,_0x1b6ba1[_0x1ad0('0x15')][_0x1ad0('0x16')]);return _0x5b22cc(_0x1b6ba1[_0x1ad0('0x15')][_0x1ad0('0x16')]);}else{logger['info'](_0x1ad0('0x11'),_0x739f1d,_0x1ad0('0x12'));_0x5b22cc(_0x1b6ba1[_0x1ad0('0x17')][_0x1ad0('0x16')]);}})[_0x1ad0('0x18')](function(_0x926432){logger['error'](_0x1ad0('0x11'),_0x739f1d,_0x926432);_0x3eb18f(_0x926432);});});}exports[_0x1ad0('0x19')]=function(_0x59433e){var _0x4cf3cc=this;return new Promise(function(_0x2f9387,_0x206680){return db[_0x1ad0('0x1a')][_0x1ad0('0x1b')](_0x59433e[_0x1ad0('0x1c')],{'raw':_0x59433e[_0x1ad0('0x1d')]?_0x59433e[_0x1ad0('0x1d')][_0x1ad0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59433e[_0x1ad0('0x1d')]?_0x59433e[_0x1ad0('0x1d')][_0x1ad0('0x1f')]||null:null,'attributes':_0x59433e[_0x1ad0('0x1d')]?_0x59433e[_0x1ad0('0x1d')][_0x1ad0('0x20')]||null:null,'limit':_0x59433e[_0x1ad0('0x1d')]?_0x59433e[_0x1ad0('0x1d')][_0x1ad0('0x21')]||null:null})[_0x1ad0('0xf')](function(_0x3f9ffe){logger[_0x1ad0('0x10')](_0x1ad0('0x19'),_0x59433e);logger[_0x1ad0('0x13')](_0x1ad0('0x19'),_0x59433e,JSON[_0x1ad0('0x22')](_0x3f9ffe));_0x2f9387(_0x3f9ffe);})['catch'](function(_0x2f83fc){logger[_0x1ad0('0x15')](_0x1ad0('0x19'),_0x2f83fc[_0x1ad0('0x16')],_0x59433e);_0x206680(_0x4cf3cc[_0x1ad0('0x15')](0x1f4,_0x2f83fc['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 05ba8ba..2e42dfc 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 _0x4024=['express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','update','destroy','exports','multer','util','connect-timeout'];(function(_0x5b9b18,_0x533abf){var _0x141000=function(_0x294e79){while(--_0x294e79){_0x5b9b18['push'](_0x5b9b18['shift']());}};_0x141000(++_0x533abf);}(_0x4024,0x89));var _0x4402=function(_0x43d118,_0x10baf8){_0x43d118=_0x43d118-0x0;var _0x38adbd=_0x4024[_0x43d118];return _0x38adbd;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./faxApplication.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/:id',auth[_0x4402('0x7')](),controller['show']);router['post']('/',auth[_0x4402('0x7')](),controller['create']);router['put'](_0x4402('0xa'),auth['isAuthenticated'](),controller[_0x4402('0xb')]);router['delete'](_0x4402('0xa'),auth['isAuthenticated'](),controller[_0x4402('0xc')]);module[_0x4402('0xd')]=router; \ No newline at end of file +var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','/:id'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0x4fc2,0x111));var _0x24fc=function(_0x245c42,_0x1953e7){_0x245c42=_0x245c42-0x0;var _0x243649=_0x4fc2[_0x245c42];return _0x243649;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index d56dd0a..e016c97 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 _0xa6b0=['sequelize','exports','STRING','DATE','ENUM','out','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x43296a,_0x3fcef1){_0x43296a=_0x43296a-0x0;var _0x41f157=_0xa6b0[_0x43296a];return _0x41f157;};'use strict';var Sequelize=require(_0x0a6b('0x0'));module[_0x0a6b('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0a6b('0x2')]},'secondDisposition':{'type':Sequelize[_0x0a6b('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0a6b('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0a6b('0x3')]},'fax':{'type':Sequelize[_0x0a6b('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x0a6b('0x4')]('in',_0x0a6b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0a6b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0a6b('0x4')]('in',_0x0a6b('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x0a6b('0x6')]}}; \ No newline at end of file +var _0x1a85=['STRING','out','ENUM','INTEGER','BOOLEAN','DATE'];(function(_0x44bae0,_0x283b70){var _0x1ba0c7=function(_0x418f9f){while(--_0x418f9f){_0x44bae0['push'](_0x44bae0['shift']());}};_0x1ba0c7(++_0x283b70);}(_0x1a85,0x178));var _0x51a8=function(_0x1865d4,_0x569a81){_0x1865d4=_0x1865d4-0x0;var _0x1f0e1c=_0x1a85[_0x1865d4];return _0x1f0e1c;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x51a8('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x51a8('0x1')]},'disposition':{'type':Sequelize[_0x51a8('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x51a8('0x2')]},'read1stAt':{'type':Sequelize[_0x51a8('0x1')]},'fax':{'type':Sequelize[_0x51a8('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x51a8('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x51a8('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x51a8('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index c011889..4d9758e 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 _0x78ed=['setTags','spread','color','faxInteractionTags:save','removeTags','download','toString','join','root','server','files','attachments','Attachment','Messages','createdAt','mkdirSync','basename','existsSync','createReadStream','resolve','log','err','rimraf','zip-dir','moment','bluebird','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','update','then','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','findAll','fax','query','user','catch','show','params','keys','filters','attributes','intersection','model','fields','length','includeAll','merge','find','create','body','destroy','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','order','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','addTags'];(function(_0xe1d939,_0x3f3939){var _0x5d9e2d=function(_0x238219){while(--_0x238219){_0xe1d939['push'](_0xe1d939['shift']());}};_0x5d9e2d(++_0x3f3939);}(_0x78ed,0x1ae));var _0xd78e=function(_0x51e8c4,_0x32f7a2){_0x51e8c4=_0x51e8c4-0x0;var _0x1d5b6f=_0x78ed[_0x51e8c4];return _0x1d5b6f;};'use strict';var rimraf=require(_0xd78e('0x0'));var zipdir=require(_0xd78e('0x1'));var moment=require(_0xd78e('0x2'));var BPromise=require(_0xd78e('0x3'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0xd78e('0x4'));var Redis=require(_0xd78e('0x5'));var interaction=require(_0xd78e('0x6'));var qs=require(_0xd78e('0x7'));var logger=require(_0xd78e('0x8'))(_0xd78e('0x9'));var config=require('../../config/environment');var db=require(_0xd78e('0xa'))['db'];config[_0xd78e('0xb')]=_[_0xd78e('0xc')](config[_0xd78e('0xb')],{'host':_0xd78e('0xd'),'port':0x18eb});var socket=require(_0xd78e('0xe'))(new Redis(config[_0xd78e('0xb')]));require('./faxInteraction.socket')[_0xd78e('0xf')](socket);function respondWithStatusCode(_0x13e323,_0x226ba4){_0x226ba4=_0x226ba4||0xcc;return function(_0x5b882b){if(_0x5b882b){return _0x13e323[_0xd78e('0x10')](_0x226ba4);}return _0x13e323['status'](_0x226ba4)[_0xd78e('0x11')]();};}function respondWithResult(_0xe7881d,_0x2ded14){_0x2ded14=_0x2ded14||0xc8;return function(_0x543b74){if(_0x543b74){return _0xe7881d[_0xd78e('0x12')](_0x2ded14)['json'](_0x543b74);}};}function respondWithFilteredResult(_0x2cde0c,_0x386873){return function(_0x5a4a21){if(_0x5a4a21){var _0x495ec9=typeof _0x386873[_0xd78e('0x13')]===_0xd78e('0x14')&&typeof _0x386873['limit']===_0xd78e('0x14');var _0x25411f=_0x5a4a21[_0xd78e('0x15')];var _0x588ee4=_0x495ec9?0x0:_0x386873[_0xd78e('0x13')];var _0x2f4162=_0x495ec9?_0x5a4a21[_0xd78e('0x15')]:_0x386873[_0xd78e('0x13')]+_0x386873[_0xd78e('0x16')];var _0x13132a;if(_0x2f4162>=_0x25411f){_0x2f4162=_0x25411f;_0x13132a=0xc8;}else{_0x13132a=0xce;}_0x2cde0c[_0xd78e('0x12')](_0x13132a);return _0x2cde0c[_0xd78e('0x17')](_0xd78e('0x18'),_0x588ee4+'-'+_0x2f4162+'/'+_0x25411f)['json'](_0x5a4a21);}return null;};}function saveUpdates(_0x575ac9){return function(_0x35480b){if(_0x35480b){return _0x35480b[_0xd78e('0x19')](_0x575ac9)['then'](function(_0x4bcc0e){return _0x4bcc0e;});}return null;};}function removeEntity(_0xfbe3a6){return function(_0x587505){if(_0x587505){return _0x587505['destroy']()[_0xd78e('0x1a')](function(){_0xfbe3a6[_0xd78e('0x12')](0xcc)[_0xd78e('0x11')]();});}};}function handleEntityNotFound(_0x3bdf1a){return function(_0x192ed5){if(!_0x192ed5){_0x3bdf1a['sendStatus'](0x194);}return _0x192ed5;};}function handleError(_0x1028d6,_0x2fad43){_0x2fad43=_0x2fad43||0x1f4;return function(_0x2f107e){logger[_0xd78e('0x1b')](_0x2f107e[_0xd78e('0x1c')]);if(_0x2f107e[_0xd78e('0x1d')]){delete _0x2f107e[_0xd78e('0x1d')];}_0x1028d6[_0xd78e('0x12')](_0x2fad43)[_0xd78e('0x1e')](_0x2f107e);};}exports[_0xd78e('0x1f')]=function(_0x57c75f,_0x2b134c){var _0x26db2a={};var _0x1cf49f=_[_0xd78e('0x20')](db[_0xd78e('0x21')][_0xd78e('0x22')],function(_0x2ed050){return{'name':_0x2ed050[_0xd78e('0x23')],'type':_0x2ed050[_0xd78e('0x24')][_0xd78e('0x25')]};});_0x26db2a=qs['getOptions'](_0x1cf49f,_0x57c75f);return interaction[_0xd78e('0x26')](_0xd78e('0x27'),_0x57c75f[_0xd78e('0x28')],_0x57c75f[_0xd78e('0x29')],_0x26db2a,_0x1cf49f)[_0xd78e('0x1a')](respondWithFilteredResult(_0x2b134c,_0x26db2a))[_0xd78e('0x2a')](handleError(_0x2b134c,null));};exports[_0xd78e('0x2b')]=function(_0x371bb8,_0x24655f){var _0x12640a={'raw':![],'where':{'id':_0x371bb8[_0xd78e('0x2c')]['id']}},_0x262d91={};_0x262d91['model']=_[_0xd78e('0x2d')](db['FaxInteraction'][_0xd78e('0x22')]);_0x262d91[_0xd78e('0x28')]=_['keys'](_0x371bb8[_0xd78e('0x28')]);_0x262d91[_0xd78e('0x2e')]=_['intersection'](_0x262d91['model'],_0x262d91[_0xd78e('0x28')]);_0x12640a[_0xd78e('0x2f')]=_[_0xd78e('0x30')](_0x262d91[_0xd78e('0x31')],qs['fields'](_0x371bb8[_0xd78e('0x28')][_0xd78e('0x32')]));_0x12640a[_0xd78e('0x2f')]=_0x12640a[_0xd78e('0x2f')][_0xd78e('0x33')]?_0x12640a[_0xd78e('0x2f')]:_0x262d91['model'];if(_0x371bb8[_0xd78e('0x28')][_0xd78e('0x34')]){_0x12640a['include']=[{'all':!![]}];}_0x12640a=_[_0xd78e('0x35')]({},_0x12640a,_0x371bb8['options']);return db[_0xd78e('0x21')][_0xd78e('0x36')](_0x12640a)['then'](handleEntityNotFound(_0x24655f,null))['then'](respondWithResult(_0x24655f,null))[_0xd78e('0x2a')](handleError(_0x24655f,null));};exports[_0xd78e('0x37')]=function(_0x5e4197,_0x301993){return db['FaxInteraction'][_0xd78e('0x37')](_0x5e4197['body'],{})[_0xd78e('0x1a')](respondWithResult(_0x301993,0xc9))[_0xd78e('0x2a')](handleError(_0x301993,null));};exports['update']=function(_0x3ec19a,_0xcc1e0b){if(_0x3ec19a['body']['id']){delete _0x3ec19a[_0xd78e('0x38')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x3ec19a['params']['id']}})[_0xd78e('0x1a')](handleEntityNotFound(_0xcc1e0b,null))[_0xd78e('0x1a')](saveUpdates(_0x3ec19a['body'],null))[_0xd78e('0x1a')](respondWithResult(_0xcc1e0b,null))[_0xd78e('0x2a')](handleError(_0xcc1e0b,null));};exports[_0xd78e('0x39')]=function(_0x5ad494,_0x271479){return db[_0xd78e('0x21')]['find']({'where':{'id':_0x5ad494[_0xd78e('0x2c')]['id']}})[_0xd78e('0x1a')](handleEntityNotFound(_0x271479,null))[_0xd78e('0x1a')](removeEntity(_0x271479,null))['catch'](handleError(_0x271479,null));};exports[_0xd78e('0x3a')]=function(_0x20e850,_0x5ec4d8){return db['FaxInteraction']['describe']()[_0xd78e('0x1a')](respondWithResult(_0x5ec4d8,null))[_0xd78e('0x2a')](handleError(_0x5ec4d8,null));};exports[_0xd78e('0x3b')]=function(_0x4febaf,_0x3ddfc4){return db[_0xd78e('0x3c')]['find']({'where':{'id':_0x4febaf[_0xd78e('0x2c')]['id']}})[_0xd78e('0x1a')](handleEntityNotFound(_0x3ddfc4,null))[_0xd78e('0x1a')](function(_0xdb6084){if(_0xdb6084){return _0xdb6084[_0xd78e('0x3b')](_0x4febaf['body']['ids'],_[_0xd78e('0x3d')](_0x4febaf[_0xd78e('0x38')],[_0xd78e('0x3e'),'id'])||{});}})[_0xd78e('0x1a')](respondWithResult(_0x3ddfc4,null))[_0xd78e('0x2a')](handleError(_0x3ddfc4,null));};exports[_0xd78e('0x3f')]=function(_0x231170,_0x2457ff){var _0x35f4d4={'raw':![],'where':{}};var _0x4bfffb={};var _0x3fad19={'count':0x0,'rows':[]};return db[_0xd78e('0x21')][_0xd78e('0x40')]({'where':{'id':_0x231170[_0xd78e('0x2c')]['id']}})[_0xd78e('0x1a')](handleEntityNotFound(_0x2457ff,null))['then'](function(_0x383ba0){if(_0x383ba0){_0x4bfffb[_0xd78e('0x31')]=_['keys'](db[_0xd78e('0x3c')]['rawAttributes']);_0x4bfffb[_0xd78e('0x28')]=_['keys'](_0x231170[_0xd78e('0x28')]);_0x4bfffb[_0xd78e('0x2e')]=_[_0xd78e('0x30')](_0x4bfffb[_0xd78e('0x31')],_0x4bfffb[_0xd78e('0x28')]);_0x35f4d4[_0xd78e('0x2f')]=_['intersection'](_0x4bfffb['model'],qs[_0xd78e('0x32')](_0x231170[_0xd78e('0x28')]['fields']));_0x35f4d4[_0xd78e('0x2f')]=_0x35f4d4[_0xd78e('0x2f')][_0xd78e('0x33')]?_0x35f4d4[_0xd78e('0x2f')]:_0x4bfffb[_0xd78e('0x31')];if(!_0x231170[_0xd78e('0x28')][_0xd78e('0x41')](_0xd78e('0x42'))){_0x35f4d4[_0xd78e('0x16')]=qs[_0xd78e('0x16')](_0x231170['query']['limit']);_0x35f4d4['offset']=qs[_0xd78e('0x13')](_0x231170['query'][_0xd78e('0x13')]);}_0x35f4d4[_0xd78e('0x43')]=qs['sort'](_0x231170['query']['sort']);_0x35f4d4[_0xd78e('0x44')]=qs[_0xd78e('0x2e')](_[_0xd78e('0x45')](_0x231170[_0xd78e('0x28')],_0x4bfffb['filters']));_0x35f4d4[_0xd78e('0x44')][_0xd78e('0x46')]=_0x383ba0['id'];if(_0x231170[_0xd78e('0x28')][_0xd78e('0x47')]){_0x35f4d4[_0xd78e('0x44')]=_[_0xd78e('0x35')](_0x35f4d4['where'],{'$or':_[_0xd78e('0x20')](_0x35f4d4[_0xd78e('0x2f')],function(_0x51f3a1){var _0x1d403b={};_0x1d403b[_0x51f3a1]={'$like':'%'+_0x231170[_0xd78e('0x28')]['filter']+'%'};return _0x1d403b;})});}if(_0x231170[_0xd78e('0x28')]['$gte']){var _0xd006e7=_0x231170['query'][_0xd78e('0x48')][_0xd78e('0x49')](',');var _0x436a8d={};_0x436a8d[_0xd006e7[0x0]]={'$gte':moment(_0xd006e7[0x1])[_0xd78e('0x4a')](_0xd78e('0x4b'))};_0x35f4d4[_0xd78e('0x44')]=_['merge'](_0x35f4d4[_0xd78e('0x44')],_0x436a8d);}_0x35f4d4=_[_0xd78e('0x35')]({},_0x35f4d4,_0x231170[_0xd78e('0x4c')]);return db[_0xd78e('0x3c')][_0xd78e('0x15')]({'where':_0x35f4d4[_0xd78e('0x44')]})['then'](function(_0x3176a0){_0x3fad19['count']=_0x3176a0;if(_0x231170[_0xd78e('0x28')][_0xd78e('0x34')]){_0x35f4d4[_0xd78e('0x4d')]=[{'all':!![]}];}return db[_0xd78e('0x3c')]['findAll'](_0x35f4d4);})[_0xd78e('0x1a')](function(_0x13521e){_0x3fad19[_0xd78e('0x4e')]=_0x13521e;return _0x3fad19;});}})[_0xd78e('0x1a')](respondWithFilteredResult(_0x2457ff,_0x35f4d4))[_0xd78e('0x2a')](handleError(_0x2457ff,null));};exports[_0xd78e('0x4f')]=function(_0x4d2e34,_0x6a82ee){return db[_0xd78e('0x21')][_0xd78e('0x36')]({'where':{'id':_0x4d2e34['params']['id']}})[_0xd78e('0x1a')](handleEntityNotFound(_0x6a82ee,null))[_0xd78e('0x1a')](function(_0x446d68){if(_0x446d68){return _0x446d68[_0xd78e('0x50')](_0x4d2e34[_0xd78e('0x38')][_0xd78e('0x3e')],_[_0xd78e('0x3d')](_0x4d2e34[_0xd78e('0x38')],[_0xd78e('0x3e'),'id'])||{})[_0xd78e('0x51')](function(){return db['Tag'][_0xd78e('0x26')]({'attributes':['id',_0xd78e('0x1d'),_0xd78e('0x52')],'where':{'id':_0x4d2e34['body']['ids']}});})[_0xd78e('0x1a')](function(_0x2116c1){socket['emit'](_0xd78e('0x53'),{'id':Number(_0x4d2e34[_0xd78e('0x2c')]['id']),'tags':_0x2116c1||[]});return{'id':Number(_0x4d2e34['params']['id']),'tags':_0x2116c1||[]};});}})[_0xd78e('0x1a')](respondWithResult(_0x6a82ee,null))[_0xd78e('0x2a')](handleError(_0x6a82ee,null));};exports[_0xd78e('0x54')]=function(_0x102323,_0x2773d6){return db['FaxInteraction'][_0xd78e('0x36')]({'where':{'id':_0x102323[_0xd78e('0x2c')]['id']}})[_0xd78e('0x1a')](handleEntityNotFound(_0x2773d6,null))[_0xd78e('0x1a')](function(_0x1821f4){if(_0x1821f4){return _0x1821f4[_0xd78e('0x54')](_0x102323[_0xd78e('0x28')]['ids']);}})['then'](respondWithStatusCode(_0x2773d6,null))[_0xd78e('0x2a')](handleError(_0x2773d6,null));};exports[_0xd78e('0x55')]=function(_0x2fabee,_0x2faeda){var _0x202042=moment()['unix']()[_0xd78e('0x56')]();var _0x5554b9=path[_0xd78e('0x57')](config[_0xd78e('0x58')],_0xd78e('0x59'),'files','tmp');var _0x263b4d=path[_0xd78e('0x57')](config[_0xd78e('0x58')],_0xd78e('0x59'),_0xd78e('0x5a'),_0xd78e('0x5b'));var _0x596310=path['join'](_0x5554b9,_0x202042);var _0x4a9da6=util[_0xd78e('0x4a')]('transcript-%d-%s.zip',_0x2fabee[_0xd78e('0x2c')]['id'],_0x202042);var _0xa8a1e3=path[_0xd78e('0x57')](_0x5554b9,_0x4a9da6);var _0x2945a8=[];_0x2945a8['push']({'model':db[_0xd78e('0x5c')],'as':'Attachment','raw':!![]});var _0x129268=[{'model':db['FaxMessage'],'as':_0xd78e('0x5d'),'attributes':['id',_0xd78e('0x38'),_0xd78e('0x5e')],'include':_0x2945a8}];return db['FaxInteraction']['find']({'where':{'id':_0x2fabee[_0xd78e('0x2c')]['id']},'include':_0x129268})[_0xd78e('0x1a')](handleEntityNotFound(_0x2faeda,null))[_0xd78e('0x1a')](function(_0x4673e0){if(_0x4673e0&&_0x4673e0[_0xd78e('0x5d')]){var _0x5365e5=_0x4673e0['get']({'plain':!![]});fs[_0xd78e('0x5f')](_0x596310);for(var _0x2eadc3=0x0;_0x2eadc3<_0x5365e5[_0xd78e('0x5d')]['length'];_0x2eadc3++){var _0x47bb5b=_0x5365e5[_0xd78e('0x5d')][_0x2eadc3][_0xd78e('0x5c')];if(_0x47bb5b){var _0x10f7c0=path[_0xd78e('0x57')](_0x263b4d,_0x47bb5b[_0xd78e('0x60')]);if(fs[_0xd78e('0x61')](_0x10f7c0)){fs[_0xd78e('0x62')](_0x10f7c0)['pipe'](fs['createWriteStream'](path[_0xd78e('0x57')](_0x596310,_0x47bb5b[_0xd78e('0x60')])));}}}return BPromise[_0xd78e('0x63')]()['then'](function(){return new BPromise(function(_0x41ef2b,_0x5ea59e){zipdir(_0x596310,{'saveTo':_0xa8a1e3},function(_0x12f77b,_0x2937e7){if(_0x12f77b)return _0x5ea59e(_0x12f77b);return _0x41ef2b(_0x2937e7);});})[_0xd78e('0x1a')](function(){return new BPromise(function(_0x7625e0,_0x24084e){rimraf(_0x596310,function(_0x5d2ac9){if(_0x5d2ac9)_0x24084e(_0x5d2ac9);return _0x7625e0();});});})[_0xd78e('0x1a')](function(){return _0x2faeda[_0xd78e('0x55')](_0xa8a1e3,_0x4a9da6,function(_0x2d3304){if(_0x2d3304){console[_0xd78e('0x64')](_0xd78e('0x65'),_0x2d3304);}else{fs['unlinkSync'](_0xa8a1e3);}});});});}else{return _0x2faeda[_0xd78e('0x10')](0xc8);}})[_0xd78e('0x2a')](handleError(_0x2faeda,null));}; \ No newline at end of file +var _0xe7c6=['error','name','index','map','FaxInteraction','rawAttributes','type','getOptions','findAll','fax','query','user','catch','show','params','model','keys','filters','intersection','fields','attributes','include','merge','options','find','create','body','addMessage','FaxMessage','ids','getMessages','findOne','length','nolimit','order','sort','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','includeAll','rows','omit','spread','Tag','color','removeTags','toString','join','root','tmp','server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','pipe','createWriteStream','download','unlinkSync','rimraf','moment','bluebird','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','set','Content-Range','update','then','destroy','end'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xe7c6,0x165));var _0x6e7c=function(_0x469b5f,_0x6a5f79){_0x469b5f=_0x469b5f-0x0;var _0x2b7913=_0xe7c6[_0x469b5f];return _0x2b7913;};'use strict';var rimraf=require(_0x6e7c('0x0'));var zipdir=require('zip-dir');var moment=require(_0x6e7c('0x1'));var BPromise=require(_0x6e7c('0x2'));var util=require('util');var path=require(_0x6e7c('0x3'));var fs=require('fs');var _=require(_0x6e7c('0x4'));var Redis=require(_0x6e7c('0x5'));var interaction=require(_0x6e7c('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x6e7c('0x7'))(_0x6e7c('0x8'));var config=require(_0x6e7c('0x9'));var db=require('../../mysqldb')['db'];config[_0x6e7c('0xa')]=_[_0x6e7c('0xb')](config['redis'],{'host':_0x6e7c('0xc'),'port':0x18eb});var socket=require(_0x6e7c('0xd'))(new Redis(config[_0x6e7c('0xa')]));require('./faxInteraction.socket')[_0x6e7c('0xe')](socket);function respondWithStatusCode(_0x3c010b,_0x1470e6){_0x1470e6=_0x1470e6||0xcc;return function(_0x530e38){if(_0x530e38){return _0x3c010b[_0x6e7c('0xf')](_0x1470e6);}return _0x3c010b[_0x6e7c('0x10')](_0x1470e6)['end']();};}function respondWithResult(_0x5ae0b0,_0x54b7e6){_0x54b7e6=_0x54b7e6||0xc8;return function(_0x359520){if(_0x359520){return _0x5ae0b0[_0x6e7c('0x10')](_0x54b7e6)[_0x6e7c('0x11')](_0x359520);}};}function respondWithFilteredResult(_0x2d15eb,_0x2b90a5){return function(_0x1a29d0){if(_0x1a29d0){var _0x37c926=typeof _0x2b90a5[_0x6e7c('0x12')]===_0x6e7c('0x13')&&typeof _0x2b90a5[_0x6e7c('0x14')]===_0x6e7c('0x13');var _0x57c076=_0x1a29d0['count'];var _0x5a04e7=_0x37c926?0x0:_0x2b90a5[_0x6e7c('0x12')];var _0x41ac1b=_0x37c926?_0x1a29d0['count']:_0x2b90a5[_0x6e7c('0x12')]+_0x2b90a5[_0x6e7c('0x14')];var _0x5a7999;if(_0x41ac1b>=_0x57c076){_0x41ac1b=_0x57c076;_0x5a7999=0xc8;}else{_0x5a7999=0xce;}_0x2d15eb[_0x6e7c('0x10')](_0x5a7999);return _0x2d15eb[_0x6e7c('0x15')](_0x6e7c('0x16'),_0x5a04e7+'-'+_0x41ac1b+'/'+_0x57c076)['json'](_0x1a29d0);}return null;};}function saveUpdates(_0x472f8d){return function(_0x147495){if(_0x147495){return _0x147495[_0x6e7c('0x17')](_0x472f8d)[_0x6e7c('0x18')](function(_0xd9f397){return _0xd9f397;});}return null;};}function removeEntity(_0x13efc5){return function(_0x133ac9){if(_0x133ac9){return _0x133ac9[_0x6e7c('0x19')]()[_0x6e7c('0x18')](function(){_0x13efc5[_0x6e7c('0x10')](0xcc)[_0x6e7c('0x1a')]();});}};}function handleEntityNotFound(_0x2fb009){return function(_0xb74915){if(!_0xb74915){_0x2fb009[_0x6e7c('0xf')](0x194);}return _0xb74915;};}function handleError(_0x4621af,_0x5c6d12){_0x5c6d12=_0x5c6d12||0x1f4;return function(_0x397787){logger[_0x6e7c('0x1b')](_0x397787['stack']);if(_0x397787['name']){delete _0x397787[_0x6e7c('0x1c')];}_0x4621af['status'](_0x5c6d12)['send'](_0x397787);};}exports[_0x6e7c('0x1d')]=function(_0x4af53a,_0x4f00e5){var _0x125837={};var _0x42abea=_[_0x6e7c('0x1e')](db[_0x6e7c('0x1f')][_0x6e7c('0x20')],function(_0x585e7c){return{'name':_0x585e7c['fieldName'],'type':_0x585e7c[_0x6e7c('0x21')]['key']};});_0x125837=qs[_0x6e7c('0x22')](_0x42abea,_0x4af53a);return interaction[_0x6e7c('0x23')](_0x6e7c('0x24'),_0x4af53a[_0x6e7c('0x25')],_0x4af53a[_0x6e7c('0x26')],_0x125837,_0x42abea)[_0x6e7c('0x18')](respondWithFilteredResult(_0x4f00e5,_0x125837))[_0x6e7c('0x27')](handleError(_0x4f00e5,null));};exports[_0x6e7c('0x28')]=function(_0x1059ca,_0x5096b5){var _0x46c536={'raw':![],'where':{'id':_0x1059ca[_0x6e7c('0x29')]['id']}},_0x36c8a2={};_0x36c8a2[_0x6e7c('0x2a')]=_[_0x6e7c('0x2b')](db[_0x6e7c('0x1f')][_0x6e7c('0x20')]);_0x36c8a2[_0x6e7c('0x25')]=_[_0x6e7c('0x2b')](_0x1059ca[_0x6e7c('0x25')]);_0x36c8a2[_0x6e7c('0x2c')]=_[_0x6e7c('0x2d')](_0x36c8a2[_0x6e7c('0x2a')],_0x36c8a2['query']);_0x46c536['attributes']=_[_0x6e7c('0x2d')](_0x36c8a2['model'],qs['fields'](_0x1059ca[_0x6e7c('0x25')][_0x6e7c('0x2e')]));_0x46c536[_0x6e7c('0x2f')]=_0x46c536[_0x6e7c('0x2f')]['length']?_0x46c536['attributes']:_0x36c8a2['model'];if(_0x1059ca[_0x6e7c('0x25')]['includeAll']){_0x46c536[_0x6e7c('0x30')]=[{'all':!![]}];}_0x46c536=_[_0x6e7c('0x31')]({},_0x46c536,_0x1059ca[_0x6e7c('0x32')]);return db[_0x6e7c('0x1f')][_0x6e7c('0x33')](_0x46c536)['then'](handleEntityNotFound(_0x5096b5,null))[_0x6e7c('0x18')](respondWithResult(_0x5096b5,null))[_0x6e7c('0x27')](handleError(_0x5096b5,null));};exports[_0x6e7c('0x34')]=function(_0x5e502b,_0x23b59b){return db[_0x6e7c('0x1f')][_0x6e7c('0x34')](_0x5e502b[_0x6e7c('0x35')],{})[_0x6e7c('0x18')](respondWithResult(_0x23b59b,0xc9))[_0x6e7c('0x27')](handleError(_0x23b59b,null));};exports['update']=function(_0x4ed12b,_0x5d401e){if(_0x4ed12b[_0x6e7c('0x35')]['id']){delete _0x4ed12b[_0x6e7c('0x35')]['id'];}return db[_0x6e7c('0x1f')][_0x6e7c('0x33')]({'where':{'id':_0x4ed12b[_0x6e7c('0x29')]['id']}})[_0x6e7c('0x18')](handleEntityNotFound(_0x5d401e,null))[_0x6e7c('0x18')](saveUpdates(_0x4ed12b[_0x6e7c('0x35')],null))[_0x6e7c('0x18')](respondWithResult(_0x5d401e,null))[_0x6e7c('0x27')](handleError(_0x5d401e,null));};exports['destroy']=function(_0x2f951b,_0x279c5b){return db[_0x6e7c('0x1f')][_0x6e7c('0x33')]({'where':{'id':_0x2f951b[_0x6e7c('0x29')]['id']}})['then'](handleEntityNotFound(_0x279c5b,null))[_0x6e7c('0x18')](removeEntity(_0x279c5b,null))[_0x6e7c('0x27')](handleError(_0x279c5b,null));};exports['describe']=function(_0x495003,_0x509021){return db[_0x6e7c('0x1f')]['describe']()['then'](respondWithResult(_0x509021,null))['catch'](handleError(_0x509021,null));};exports[_0x6e7c('0x36')]=function(_0x463f50,_0x401bb3){return db[_0x6e7c('0x37')][_0x6e7c('0x33')]({'where':{'id':_0x463f50[_0x6e7c('0x29')]['id']}})['then'](handleEntityNotFound(_0x401bb3,null))[_0x6e7c('0x18')](function(_0x2eb491){if(_0x2eb491){return _0x2eb491[_0x6e7c('0x36')](_0x463f50[_0x6e7c('0x35')][_0x6e7c('0x38')],_['omit'](_0x463f50[_0x6e7c('0x35')],[_0x6e7c('0x38'),'id'])||{});}})[_0x6e7c('0x18')](respondWithResult(_0x401bb3,null))[_0x6e7c('0x27')](handleError(_0x401bb3,null));};exports[_0x6e7c('0x39')]=function(_0x1b9355,_0x2d9bd0){var _0x40cbdc={'raw':![],'where':{}};var _0x1cb8ce={};var _0x344da7={'count':0x0,'rows':[]};return db[_0x6e7c('0x1f')][_0x6e7c('0x3a')]({'where':{'id':_0x1b9355['params']['id']}})[_0x6e7c('0x18')](handleEntityNotFound(_0x2d9bd0,null))[_0x6e7c('0x18')](function(_0x325648){if(_0x325648){_0x1cb8ce['model']=_[_0x6e7c('0x2b')](db[_0x6e7c('0x37')][_0x6e7c('0x20')]);_0x1cb8ce[_0x6e7c('0x25')]=_[_0x6e7c('0x2b')](_0x1b9355[_0x6e7c('0x25')]);_0x1cb8ce[_0x6e7c('0x2c')]=_[_0x6e7c('0x2d')](_0x1cb8ce['model'],_0x1cb8ce[_0x6e7c('0x25')]);_0x40cbdc[_0x6e7c('0x2f')]=_['intersection'](_0x1cb8ce[_0x6e7c('0x2a')],qs['fields'](_0x1b9355[_0x6e7c('0x25')][_0x6e7c('0x2e')]));_0x40cbdc['attributes']=_0x40cbdc['attributes'][_0x6e7c('0x3b')]?_0x40cbdc[_0x6e7c('0x2f')]:_0x1cb8ce[_0x6e7c('0x2a')];if(!_0x1b9355[_0x6e7c('0x25')]['hasOwnProperty'](_0x6e7c('0x3c'))){_0x40cbdc['limit']=qs[_0x6e7c('0x14')](_0x1b9355[_0x6e7c('0x25')]['limit']);_0x40cbdc[_0x6e7c('0x12')]=qs[_0x6e7c('0x12')](_0x1b9355['query'][_0x6e7c('0x12')]);}_0x40cbdc[_0x6e7c('0x3d')]=qs[_0x6e7c('0x3e')](_0x1b9355['query'][_0x6e7c('0x3e')]);_0x40cbdc[_0x6e7c('0x3f')]=qs[_0x6e7c('0x2c')](_['pick'](_0x1b9355[_0x6e7c('0x25')],_0x1cb8ce[_0x6e7c('0x2c')]));_0x40cbdc[_0x6e7c('0x3f')]['FaxInteractionId']=_0x325648['id'];if(_0x1b9355['query'][_0x6e7c('0x40')]){_0x40cbdc[_0x6e7c('0x3f')]=_[_0x6e7c('0x31')](_0x40cbdc[_0x6e7c('0x3f')],{'$or':_[_0x6e7c('0x1e')](_0x40cbdc[_0x6e7c('0x2f')],function(_0x5adaa4){var _0x4b34fc={};_0x4b34fc[_0x5adaa4]={'$like':'%'+_0x1b9355[_0x6e7c('0x25')]['filter']+'%'};return _0x4b34fc;})});}if(_0x1b9355[_0x6e7c('0x25')][_0x6e7c('0x41')]){var _0x30ca19=_0x1b9355[_0x6e7c('0x25')][_0x6e7c('0x41')][_0x6e7c('0x42')](',');var _0x471def={};_0x471def[_0x30ca19[0x0]]={'$gte':moment(_0x30ca19[0x1])[_0x6e7c('0x43')](_0x6e7c('0x44'))};_0x40cbdc['where']=_[_0x6e7c('0x31')](_0x40cbdc[_0x6e7c('0x3f')],_0x471def);}_0x40cbdc=_['merge']({},_0x40cbdc,_0x1b9355[_0x6e7c('0x32')]);return db[_0x6e7c('0x37')][_0x6e7c('0x45')]({'where':_0x40cbdc[_0x6e7c('0x3f')]})['then'](function(_0x22a030){_0x344da7[_0x6e7c('0x45')]=_0x22a030;if(_0x1b9355[_0x6e7c('0x25')][_0x6e7c('0x46')]){_0x40cbdc['include']=[{'all':!![]}];}return db[_0x6e7c('0x37')][_0x6e7c('0x23')](_0x40cbdc);})['then'](function(_0x4d8efe){_0x344da7[_0x6e7c('0x47')]=_0x4d8efe;return _0x344da7;});}})[_0x6e7c('0x18')](respondWithFilteredResult(_0x2d9bd0,_0x40cbdc))[_0x6e7c('0x27')](handleError(_0x2d9bd0,null));};exports['addTags']=function(_0xeeac4c,_0x124fd1){return db[_0x6e7c('0x1f')][_0x6e7c('0x33')]({'where':{'id':_0xeeac4c[_0x6e7c('0x29')]['id']}})[_0x6e7c('0x18')](handleEntityNotFound(_0x124fd1,null))[_0x6e7c('0x18')](function(_0xe5f205){if(_0xe5f205){return _0xe5f205['setTags'](_0xeeac4c['body'][_0x6e7c('0x38')],_[_0x6e7c('0x48')](_0xeeac4c[_0x6e7c('0x35')],[_0x6e7c('0x38'),'id'])||{})[_0x6e7c('0x49')](function(){return db[_0x6e7c('0x4a')][_0x6e7c('0x23')]({'attributes':['id',_0x6e7c('0x1c'),_0x6e7c('0x4b')],'where':{'id':_0xeeac4c[_0x6e7c('0x35')][_0x6e7c('0x38')]}});})[_0x6e7c('0x18')](function(_0x488c8f){socket['emit']('faxInteractionTags:save',{'id':Number(_0xeeac4c[_0x6e7c('0x29')]['id']),'tags':_0x488c8f||[]});return{'id':Number(_0xeeac4c[_0x6e7c('0x29')]['id']),'tags':_0x488c8f||[]};});}})[_0x6e7c('0x18')](respondWithResult(_0x124fd1,null))[_0x6e7c('0x27')](handleError(_0x124fd1,null));};exports[_0x6e7c('0x4c')]=function(_0x603fc9,_0x59b0de){return db[_0x6e7c('0x1f')]['find']({'where':{'id':_0x603fc9[_0x6e7c('0x29')]['id']}})[_0x6e7c('0x18')](handleEntityNotFound(_0x59b0de,null))[_0x6e7c('0x18')](function(_0x2838f0){if(_0x2838f0){return _0x2838f0['removeTags'](_0x603fc9[_0x6e7c('0x25')][_0x6e7c('0x38')]);}})[_0x6e7c('0x18')](respondWithStatusCode(_0x59b0de,null))[_0x6e7c('0x27')](handleError(_0x59b0de,null));};exports['download']=function(_0x11085c,_0x5dc269){var _0x3ebdb5=moment()['unix']()[_0x6e7c('0x4d')]();var _0x162ef6=path[_0x6e7c('0x4e')](config[_0x6e7c('0x4f')],'server','files',_0x6e7c('0x50'));var _0x137cba=path[_0x6e7c('0x4e')](config[_0x6e7c('0x4f')],_0x6e7c('0x51'),_0x6e7c('0x52'),_0x6e7c('0x53'));var _0x59cd2f=path[_0x6e7c('0x4e')](_0x162ef6,_0x3ebdb5);var _0x44d7ee=util[_0x6e7c('0x43')](_0x6e7c('0x54'),_0x11085c[_0x6e7c('0x29')]['id'],_0x3ebdb5);var _0x1d74d1=path[_0x6e7c('0x4e')](_0x162ef6,_0x44d7ee);var _0x3aec98=[];_0x3aec98['push']({'model':db[_0x6e7c('0x55')],'as':_0x6e7c('0x55'),'raw':!![]});var _0x3bee4b=[{'model':db[_0x6e7c('0x37')],'as':_0x6e7c('0x56'),'attributes':['id','body',_0x6e7c('0x57')],'include':_0x3aec98}];return db[_0x6e7c('0x1f')][_0x6e7c('0x33')]({'where':{'id':_0x11085c[_0x6e7c('0x29')]['id']},'include':_0x3bee4b})[_0x6e7c('0x18')](handleEntityNotFound(_0x5dc269,null))[_0x6e7c('0x18')](function(_0x266e1f){if(_0x266e1f&&_0x266e1f[_0x6e7c('0x56')]){var _0x17ada4=_0x266e1f[_0x6e7c('0x58')]({'plain':!![]});fs[_0x6e7c('0x59')](_0x59cd2f);for(var _0x2723c3=0x0;_0x2723c3<_0x17ada4[_0x6e7c('0x56')][_0x6e7c('0x3b')];_0x2723c3++){var _0x55bf0e=_0x17ada4[_0x6e7c('0x56')][_0x2723c3][_0x6e7c('0x55')];if(_0x55bf0e){var _0x318020=path['join'](_0x137cba,_0x55bf0e[_0x6e7c('0x5a')]);if(fs[_0x6e7c('0x5b')](_0x318020)){fs['createReadStream'](_0x318020)[_0x6e7c('0x5c')](fs[_0x6e7c('0x5d')](path[_0x6e7c('0x4e')](_0x59cd2f,_0x55bf0e[_0x6e7c('0x5a')])));}}}return BPromise['resolve']()[_0x6e7c('0x18')](function(){return new BPromise(function(_0x1aefc6,_0x400390){zipdir(_0x59cd2f,{'saveTo':_0x1d74d1},function(_0x3263b8,_0x442044){if(_0x3263b8)return _0x400390(_0x3263b8);return _0x1aefc6(_0x442044);});})['then'](function(){return new BPromise(function(_0x1a72f3,_0x331fd9){rimraf(_0x59cd2f,function(_0x194c2b){if(_0x194c2b)_0x331fd9(_0x194c2b);return _0x1a72f3();});});})[_0x6e7c('0x18')](function(){return _0x5dc269[_0x6e7c('0x5e')](_0x1d74d1,_0x44d7ee,function(_0x3c887e){if(_0x3c887e){console['log']('err',_0x3c887e);}else{fs[_0x6e7c('0x5f')](_0x1d74d1);}});});});}else{return _0x5dc269[_0x6e7c('0xf')](0xc8);}})[_0x6e7c('0x27')](handleError(_0x5dc269,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index a356a50..8cc7ef3 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 _0xf99d=['emit','catch','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','setDataValue','map','then','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf99d,0xb4));var _0xdf99=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xf99d[_0x5f09c5];return _0x426ad9;};'use strict';var EventEmitter=require(_0xdf99('0x0'));var FaxInteraction=require(_0xdf99('0x1'))['db'][_0xdf99('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0xdf99('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xdf99('0x4')](0x0);var events={'afterCreate':_0xdf99('0x5'),'afterUpdate':_0xdf99('0x6'),'afterDestroy':_0xdf99('0x7')};function emitEvent(_0xc4d10a){return function(_0x584521,_0x380588,_0x462b40){_0x584521['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x5a9825){_0x584521[_0xdf99('0x8')]('Users',_0x5a9825[_0xdf99('0x9')](function(_0x4fde12){return{'id':_0x4fde12['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x584521['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdf99('0xa')](function(_0x28e3ff){_0x584521[_0xdf99('0x8')]('unreadMessages',_0x28e3ff[_0xdf99('0xb')]);FaxInteractionEvents[_0xdf99('0xc')](_0xc4d10a+':'+_0x584521['id'],_0x584521);FaxInteractionEvents[_0xdf99('0xc')](_0xc4d10a,_0x584521);_0x462b40(null);})[_0xdf99('0xd')](_0x462b40(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xdf99('0xe')](e,emitEvent(event));}}module[_0xdf99('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x6f2c=['FaxInteraction','FaxMessage','setMaxListeners','save','update','getUsers','Users','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6f2c,0xfd));var _0xc6f2=function(_0x15d3d9,_0x199fff){_0x15d3d9=_0x15d3d9-0x0;var _0x2bd364=_0x6f2c[_0x15d3d9];return _0x2bd364;};'use strict';var EventEmitter=require(_0xc6f2('0x0'));var FaxInteraction=require(_0xc6f2('0x1'))['db'][_0xc6f2('0x2')];var FaxMessage=require(_0xc6f2('0x1'))['db'][_0xc6f2('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc6f2('0x4')](0x0);var events={'afterCreate':_0xc6f2('0x5'),'afterUpdate':_0xc6f2('0x6'),'afterDestroy':'remove'};function emitEvent(_0x1d10cb){return function(_0x321428,_0x481dc9,_0x397c52){_0x321428[_0xc6f2('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x41f6c8){_0x321428['setDataValue'](_0xc6f2('0x8'),_0x41f6c8['map'](function(_0x8c427d){return{'id':_0x8c427d['id']};}));return FaxMessage[_0xc6f2('0x9')]({'where':{'FaxInteractionId':_0x321428['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5390ab){_0x321428[_0xc6f2('0xa')](_0xc6f2('0xb'),_0x5390ab[_0xc6f2('0xc')]);FaxInteractionEvents['emit'](_0x1d10cb+':'+_0x321428['id'],_0x321428);FaxInteractionEvents[_0xc6f2('0xd')](_0x1d10cb,_0x321428);_0x397c52(null);})[_0xc6f2('0xe')](_0x397c52(null));};}for(var e in events){if(events[_0xc6f2('0xf')](e)){var event=events[e];FaxInteraction[_0xc6f2('0x10')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 94a39bf..ceba5f2 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 _0x1f2e=['../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x1f2e,0x82));var _0xe1f2=function(_0x634186,_0x2a0d26){_0x634186=_0x634186-0x0;var _0x1de1d8=_0x1f2e[_0x634186];return _0x1de1d8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe1f2('0x0'))(_0xe1f2('0x1'));var moment=require(_0xe1f2('0x2'));var BPromise=require(_0xe1f2('0x3'));var rp=require(_0xe1f2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1f2('0x5'));var config=require(_0xe1f2('0x6'));var attributes=require(_0xe1f2('0x7'));module[_0xe1f2('0x8')]=function(_0xae6dc7,_0x41bd1a){return _0xae6dc7[_0xe1f2('0x9')](_0xe1f2('0xa'),attributes,{'tableName':_0xe1f2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b08c4,_0x9ec46a,_0x44ba1d){if(_0x1b08c4[_0xe1f2('0xc')](_0xe1f2('0xd'))){_0x1b08c4[_0xe1f2('0xe')]=moment()[_0xe1f2('0xf')](_0xe1f2('0x10'));}_0x44ba1d(null,_0x1b08c4);}}});}; \ No newline at end of file +var _0xb44f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x219bdc,_0x2db0d9){var _0x2abdb6=function(_0x409467){while(--_0x409467){_0x219bdc['push'](_0x219bdc['shift']());}};_0x2abdb6(++_0x2db0d9);}(_0xb44f,0x165));var _0xfb44=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb44f[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xfb44('0x0'));var util=require(_0xfb44('0x1'));var logger=require(_0xfb44('0x2'))(_0xfb44('0x3'));var moment=require(_0xfb44('0x4'));var BPromise=require(_0xfb44('0x5'));var rp=require(_0xfb44('0x6'));var fs=require('fs');var path=require(_0xfb44('0x7'));var rimraf=require(_0xfb44('0x8'));var config=require(_0xfb44('0x9'));var attributes=require(_0xfb44('0xa'));module['exports']=function(_0xb881c7,_0x5a6795){return _0xb881c7[_0xfb44('0xb')](_0xfb44('0xc'),attributes,{'tableName':_0xfb44('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x264728,_0x25d44a,_0xba7ed7){if(_0x264728[_0xfb44('0xe')](_0xfb44('0xf'))){_0x264728[_0xfb44('0x10')]=moment()[_0xfb44('0x11')](_0xfb44('0x12'));}_0xba7ed7(null,_0x264728);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 1519ae9..3a28c97 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 _0x2d37=['omit','spread','AddTags','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','raw','options','where','attributes','limit','stringify','AddTagsToFaxInteraction','addTags','ids'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x2d37,0x1c6));var _0x72d3=function(_0x2ba56c,_0x20bece){_0x2ba56c=_0x2ba56c-0x0;var _0x44f9ba=_0x2d37[_0x2ba56c];return _0x44f9ba;};'use strict';var _=require('lodash');var util=require(_0x72d3('0x0'));var moment=require('moment');var BPromise=require(_0x72d3('0x1'));var rs=require(_0x72d3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d3('0x3'))['db'];var utils=require(_0x72d3('0x4'));var logger=require(_0x72d3('0x5'))(_0x72d3('0x6'));var config=require(_0x72d3('0x7'));var jayson=require(_0x72d3('0x8'));var client=jayson[_0x72d3('0x9')]['http']({'port':0x232a});config[_0x72d3('0xa')]=_[_0x72d3('0xb')](config[_0x72d3('0xa')],{'host':_0x72d3('0xc'),'port':0x18eb});var socket=require(_0x72d3('0xd'))(new Redis(config[_0x72d3('0xa')]));require(_0x72d3('0xe'))['register'](socket);function respondWithRpcPromise(_0x494bcd,_0x1279cc,_0x2bd356){return new BPromise(function(_0x2b0a0b,_0x47ded5){return client['request'](_0x494bcd,_0x2bd356)[_0x72d3('0xf')](function(_0x3e05be){logger[_0x72d3('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x1279cc,_0x72d3('0x11'));logger[_0x72d3('0x12')](_0x72d3('0x13'),_0x1279cc,_0x72d3('0x11'),JSON['stringify'](_0x3e05be));if(_0x3e05be[_0x72d3('0x14')]){if(_0x3e05be[_0x72d3('0x14')][_0x72d3('0x15')]===0x1f4){logger[_0x72d3('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x1279cc,_0x3e05be[_0x72d3('0x14')][_0x72d3('0x16')]);return _0x47ded5(_0x3e05be[_0x72d3('0x14')]['message']);}logger[_0x72d3('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x1279cc,_0x3e05be[_0x72d3('0x14')][_0x72d3('0x16')]);return _0x2b0a0b(_0x3e05be[_0x72d3('0x14')]['message']);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x1279cc,_0x72d3('0x11'));_0x2b0a0b(_0x3e05be[_0x72d3('0x17')][_0x72d3('0x16')]);}})[_0x72d3('0x18')](function(_0x3f2753){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x1279cc,_0x3f2753);_0x47ded5(_0x3f2753);});});}exports[_0x72d3('0x19')]=function(_0x27e4e3){var _0x49f31c=this;return new Promise(function(_0x4138d3,_0x1bffd9){return db[_0x72d3('0x1a')][_0x72d3('0x1b')](_0x27e4e3[_0x72d3('0x1c')],{'raw':_0x27e4e3['options']?_0x27e4e3['options'][_0x72d3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27e4e3[_0x72d3('0x1e')]?_0x27e4e3['options'][_0x72d3('0x1f')]||null:null,'attributes':_0x27e4e3[_0x72d3('0x1e')]?_0x27e4e3[_0x72d3('0x1e')][_0x72d3('0x20')]||null:null,'limit':_0x27e4e3[_0x72d3('0x1e')]?_0x27e4e3[_0x72d3('0x1e')][_0x72d3('0x21')]||null:null})[_0x72d3('0xf')](function(_0x59a0e5){logger[_0x72d3('0x10')](_0x72d3('0x19'),_0x27e4e3);logger[_0x72d3('0x12')]('UpdateFaxInteraction',_0x27e4e3,JSON[_0x72d3('0x22')](_0x59a0e5));_0x4138d3(_0x59a0e5);})[_0x72d3('0x18')](function(_0x52c1bb){logger[_0x72d3('0x14')]('UpdateFaxInteraction',_0x52c1bb[_0x72d3('0x16')],_0x27e4e3);_0x1bffd9(_0x49f31c[_0x72d3('0x14')](0x1f4,_0x52c1bb[_0x72d3('0x16')]));});});};exports[_0x72d3('0x23')]=function(_0x41b545){return new Promise(function(_0x31a648,_0x2f8637){return db[_0x72d3('0x1a')]['find']({'where':_0x41b545['options']?_0x41b545['options'][_0x72d3('0x1f')]||null:null})[_0x72d3('0xf')](function(_0x296f63){if(_0x296f63){return _0x296f63[_0x72d3('0x24')](_0x41b545['body'][_0x72d3('0x25')],_[_0x72d3('0x26')](_0x41b545[_0x72d3('0x1c')],[_0x72d3('0x25'),'id'])||{});}})[_0x72d3('0x27')](function(_0x2616a6){logger[_0x72d3('0x10')](_0x72d3('0x28'),_0x41b545);logger[_0x72d3('0x12')]('AddTags',_0x41b545,JSON[_0x72d3('0x22')](_0x2616a6));_0x31a648(_0x2616a6);})[_0x72d3('0x18')](function(_0x540266){logger[_0x72d3('0x14')]('AddTags',_0x540266[_0x72d3('0x16')],_0x41b545);_0x2f8637(_this['error'](0x1f4,_0x540266[_0x72d3('0x16')]));});});}; \ No newline at end of file +var _0xe8a3=['info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','FaxInteraction','update','body','options','where','attributes','limit','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','addTags','ids','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','request','then'];(function(_0x2cde51,_0x41b85c){var _0x37177e=function(_0x5a68f4){while(--_0x5a68f4){_0x2cde51['push'](_0x2cde51['shift']());}};_0x37177e(++_0x41b85c);}(_0xe8a3,0x156));var _0x3e8a=function(_0x5b0208,_0x58666d){_0x5b0208=_0x5b0208-0x0;var _0x5800b4=_0xe8a3[_0x5b0208];return _0x5800b4;};'use strict';var _=require(_0x3e8a('0x0'));var util=require(_0x3e8a('0x1'));var moment=require('moment');var BPromise=require(_0x3e8a('0x2'));var rs=require(_0x3e8a('0x3'));var fs=require('fs');var Redis=require(_0x3e8a('0x4'));var db=require(_0x3e8a('0x5'))['db'];var utils=require(_0x3e8a('0x6'));var logger=require(_0x3e8a('0x7'))('rpc');var config=require(_0x3e8a('0x8'));var jayson=require(_0x3e8a('0x9'));var client=jayson[_0x3e8a('0xa')]['http']({'port':0x232a});config['redis']=_[_0x3e8a('0xb')](config[_0x3e8a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e8a('0xd'))(new Redis(config['redis']));require(_0x3e8a('0xe'))[_0x3e8a('0xf')](socket);function respondWithRpcPromise(_0x2c4ecb,_0x4febe8,_0x575222){return new BPromise(function(_0x3f670f,_0x1a0ab3){return client[_0x3e8a('0x10')](_0x2c4ecb,_0x575222)[_0x3e8a('0x11')](function(_0x4cd2e5){logger[_0x3e8a('0x12')](_0x3e8a('0x13'),_0x4febe8,_0x3e8a('0x14'));logger[_0x3e8a('0x15')](_0x3e8a('0x16'),_0x4febe8,_0x3e8a('0x14'),JSON['stringify'](_0x4cd2e5));if(_0x4cd2e5[_0x3e8a('0x17')]){if(_0x4cd2e5[_0x3e8a('0x17')][_0x3e8a('0x18')]===0x1f4){logger[_0x3e8a('0x17')](_0x3e8a('0x13'),_0x4febe8,_0x4cd2e5[_0x3e8a('0x17')][_0x3e8a('0x19')]);return _0x1a0ab3(_0x4cd2e5[_0x3e8a('0x17')][_0x3e8a('0x19')]);}logger[_0x3e8a('0x17')](_0x3e8a('0x13'),_0x4febe8,_0x4cd2e5[_0x3e8a('0x17')][_0x3e8a('0x19')]);return _0x3f670f(_0x4cd2e5[_0x3e8a('0x17')]['message']);}else{logger[_0x3e8a('0x12')](_0x3e8a('0x13'),_0x4febe8,_0x3e8a('0x14'));_0x3f670f(_0x4cd2e5['result']['message']);}})[_0x3e8a('0x1a')](function(_0x267e43){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x4febe8,_0x267e43);_0x1a0ab3(_0x267e43);});});}exports['UpdateFaxInteraction']=function(_0x43b8e4){var _0x221886=this;return new Promise(function(_0x566521,_0x113ddd){return db[_0x3e8a('0x1b')][_0x3e8a('0x1c')](_0x43b8e4[_0x3e8a('0x1d')],{'raw':_0x43b8e4[_0x3e8a('0x1e')]?_0x43b8e4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43b8e4[_0x3e8a('0x1e')]?_0x43b8e4['options'][_0x3e8a('0x1f')]||null:null,'attributes':_0x43b8e4[_0x3e8a('0x1e')]?_0x43b8e4[_0x3e8a('0x1e')][_0x3e8a('0x20')]||null:null,'limit':_0x43b8e4[_0x3e8a('0x1e')]?_0x43b8e4[_0x3e8a('0x1e')][_0x3e8a('0x21')]||null:null})[_0x3e8a('0x11')](function(_0x1f960a){logger[_0x3e8a('0x12')](_0x3e8a('0x22'),_0x43b8e4);logger['debug'](_0x3e8a('0x22'),_0x43b8e4,JSON[_0x3e8a('0x23')](_0x1f960a));_0x566521(_0x1f960a);})['catch'](function(_0x8abd06){logger['error'](_0x3e8a('0x22'),_0x8abd06[_0x3e8a('0x19')],_0x43b8e4);_0x113ddd(_0x221886[_0x3e8a('0x17')](0x1f4,_0x8abd06['message']));});});};exports[_0x3e8a('0x24')]=function(_0x494b80){return new Promise(function(_0x501f5b,_0x151c28){return db[_0x3e8a('0x1b')]['find']({'where':_0x494b80['options']?_0x494b80[_0x3e8a('0x1e')][_0x3e8a('0x1f')]||null:null})[_0x3e8a('0x11')](function(_0x138591){if(_0x138591){return _0x138591[_0x3e8a('0x25')](_0x494b80['body'][_0x3e8a('0x26')],_['omit'](_0x494b80[_0x3e8a('0x1d')],[_0x3e8a('0x26'),'id'])||{});}})['spread'](function(_0x40b864){logger[_0x3e8a('0x12')](_0x3e8a('0x27'),_0x494b80);logger[_0x3e8a('0x15')]('AddTags',_0x494b80,JSON['stringify'](_0x40b864));_0x501f5b(_0x40b864);})[_0x3e8a('0x1a')](function(_0x545bd1){logger[_0x3e8a('0x17')]('AddTags',_0x545bd1['message'],_0x494b80);_0x151c28(_this[_0x3e8a('0x17')](0x1f4,_0x545bd1[_0x3e8a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index d485f47..b9d3ec0 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 _0x0468=['./faxInteraction.events','emit','removeListener','register','length','faxInteraction:'];(function(_0xca3904,_0x24fc67){var _0x5d9605=function(_0x40dedf){while(--_0x40dedf){_0xca3904['push'](_0xca3904['shift']());}};_0x5d9605(++_0x24fc67);}(_0x0468,0x1f2));var _0x8046=function(_0x3bbf06,_0x82f292){_0x3bbf06=_0x3bbf06-0x0;var _0x1dcfbb=_0x0468[_0x3bbf06];return _0x1dcfbb;};'use strict';var FaxInteractionEvents=require(_0x8046('0x0'));var events=['save','remove','update'];function createListener(_0x417694,_0x69c572){return function(_0x2c1c44){_0x69c572[_0x8046('0x1')](_0x417694,_0x2c1c44);};}function removeListener(_0xd24cef,_0x4d790c){return function(){FaxInteractionEvents[_0x8046('0x2')](_0xd24cef,_0x4d790c);};}exports[_0x8046('0x3')]=function(_0x153ab3){for(var _0x320932=0x0,_0x83e5f4=events[_0x8046('0x4')];_0x320932<_0x83e5f4;_0x320932++){var _0xd8924a=events[_0x320932];var _0x249186=createListener(_0x8046('0x5')+_0xd8924a,_0x153ab3);FaxInteractionEvents['on'](_0xd8924a,_0x249186);}}; \ No newline at end of file +var _0x4e0d=['emit','removeListener','register','faxInteraction:','./faxInteraction.events','remove','update'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x4e0d,0x18c));var _0xd4e0=function(_0x17972d,_0x39c4dc){_0x17972d=_0x17972d-0x0;var _0x2c6a2c=_0x4e0d[_0x17972d];return _0x2c6a2c;};'use strict';var FaxInteractionEvents=require(_0xd4e0('0x0'));var events=['save',_0xd4e0('0x1'),_0xd4e0('0x2')];function createListener(_0x29b0b6,_0x16bb64){return function(_0x308b63){_0x16bb64[_0xd4e0('0x3')](_0x29b0b6,_0x308b63);};}function removeListener(_0x110000,_0x233c3f){return function(){FaxInteractionEvents[_0xd4e0('0x4')](_0x110000,_0x233c3f);};}exports[_0xd4e0('0x5')]=function(_0xe59e92){for(var _0x55e23f=0x0,_0x3451f0=events['length'];_0x55e23f<_0x3451f0;_0x55e23f++){var _0x44d689=events[_0x55e23f];var _0x29707b=createListener(_0xd4e0('0x6')+_0x44d689,_0xe59e92);FaxInteractionEvents['on'](_0x44d689,_0x29707b);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index c4d33d0..c4b8f59 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 _0x8d84=['fax','addTags','faxinteraction:update','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked'];(function(_0x52c4d3,_0x1027e0){var _0x25da6f=function(_0x11b2b3){while(--_0x11b2b3){_0x52c4d3['push'](_0x52c4d3['shift']());}};_0x25da6f(++_0x1027e0);}(_0x8d84,0x64));var _0x48d8=function(_0x1fa4ae,_0x275d5b){_0x1fa4ae=_0x1fa4ae-0x0;var _0x32eda0=_0x8d84[_0x1fa4ae];return _0x32eda0;};'use strict';var multer=require(_0x48d8('0x0'));var util=require(_0x48d8('0x1'));var path=require(_0x48d8('0x2'));var timeout=require(_0x48d8('0x3'));var express=require(_0x48d8('0x4'));var router=express[_0x48d8('0x5')]();var fs_extra=require(_0x48d8('0x6'));var auth=require(_0x48d8('0x7'));var interaction=require(_0x48d8('0x8'));var config=require(_0x48d8('0x9'));var controller=require(_0x48d8('0xa'));router[_0x48d8('0xb')]('/',auth[_0x48d8('0xc')](),controller[_0x48d8('0xd')]);router['get']('/describe',auth[_0x48d8('0xc')](),controller[_0x48d8('0xe')]);router[_0x48d8('0xb')](_0x48d8('0xf'),auth[_0x48d8('0xc')](),controller['show']);router[_0x48d8('0xb')](_0x48d8('0x10'),auth['isAuthenticated'](),controller[_0x48d8('0x11')]);router[_0x48d8('0xb')](_0x48d8('0x12'),auth[_0x48d8('0xc')](),controller['download']);router[_0x48d8('0x13')]('/',auth[_0x48d8('0xc')](),controller[_0x48d8('0x14')]);router[_0x48d8('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x48d8('0x15')]);router[_0x48d8('0x13')](_0x48d8('0x16'),auth[_0x48d8('0xc')](),interaction[_0x48d8('0x17')](_0x48d8('0x18'),'faxinteraction:addtags'),controller[_0x48d8('0x19')]);router['put'](_0x48d8('0xf'),auth[_0x48d8('0xc')](),interaction[_0x48d8('0x17')](_0x48d8('0x18'),_0x48d8('0x1a')),controller['update']);router['delete'](_0x48d8('0xf'),auth[_0x48d8('0xc')](),interaction[_0x48d8('0x17')](_0x48d8('0x18'),_0x48d8('0x1b')),controller[_0x48d8('0x1c')]);router['delete'](_0x48d8('0x16'),auth[_0x48d8('0xc')](),controller[_0x48d8('0x1d')]);module[_0x48d8('0x1e')]=router; \ No newline at end of file +var _0x0e99=['faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','delete'];(function(_0x528bc4,_0x1d24bf){var _0x2e9d1d=function(_0x6d8ae7){while(--_0x6d8ae7){_0x528bc4['push'](_0x528bc4['shift']());}};_0x2e9d1d(++_0x1d24bf);}(_0x0e99,0xeb));var _0x90e9=function(_0x2fc026,_0xdc4f7a){_0x2fc026=_0x2fc026-0x0;var _0x34d056=_0x0e99[_0x2fc026];return _0x34d056;};'use strict';var multer=require(_0x90e9('0x0'));var util=require(_0x90e9('0x1'));var path=require(_0x90e9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x90e9('0x3')]();var fs_extra=require(_0x90e9('0x4'));var auth=require(_0x90e9('0x5'));var interaction=require(_0x90e9('0x6'));var config=require(_0x90e9('0x7'));var controller=require(_0x90e9('0x8'));router[_0x90e9('0x9')]('/',auth[_0x90e9('0xa')](),controller[_0x90e9('0xb')]);router[_0x90e9('0x9')](_0x90e9('0xc'),auth[_0x90e9('0xa')](),controller['describe']);router[_0x90e9('0x9')](_0x90e9('0xd'),auth[_0x90e9('0xa')](),controller[_0x90e9('0xe')]);router[_0x90e9('0x9')](_0x90e9('0xf'),auth[_0x90e9('0xa')](),controller[_0x90e9('0x10')]);router[_0x90e9('0x9')]('/:id/download',auth[_0x90e9('0xa')](),controller[_0x90e9('0x11')]);router[_0x90e9('0x12')]('/',auth[_0x90e9('0xa')](),controller[_0x90e9('0x13')]);router[_0x90e9('0x12')](_0x90e9('0xf'),auth['isAuthenticated'](),controller[_0x90e9('0x14')]);router[_0x90e9('0x12')](_0x90e9('0x15'),auth[_0x90e9('0xa')](),interaction[_0x90e9('0x16')]('fax',_0x90e9('0x17')),controller[_0x90e9('0x18')]);router[_0x90e9('0x19')](_0x90e9('0xd'),auth[_0x90e9('0xa')](),interaction[_0x90e9('0x16')](_0x90e9('0x1a'),_0x90e9('0x1b')),controller['update']);router[_0x90e9('0x1c')](_0x90e9('0xd'),auth['isAuthenticated'](),interaction[_0x90e9('0x16')]('fax',_0x90e9('0x1d')),controller[_0x90e9('0x1e')]);router[_0x90e9('0x1c')](_0x90e9('0x15'),auth[_0x90e9('0xa')](),controller[_0x90e9('0x1f')]);module[_0x90e9('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 738e6ea..425035e 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 _0xb66c=['DATE','sequelize','TEXT','BOOLEAN','ENUM','out'];(function(_0x4cf3ee,_0x322ca5){var _0x347bb4=function(_0x1d9fe0){while(--_0x1d9fe0){_0x4cf3ee['push'](_0x4cf3ee['shift']());}};_0x347bb4(++_0x322ca5);}(_0xb66c,0x175));var _0xcb66=function(_0x299d8a,_0x35ccee){_0x299d8a=_0x299d8a-0x0;var _0x1375c9=_0xb66c[_0x299d8a];return _0x1375c9;};'use strict';var Sequelize=require(_0xcb66('0x0'));module['exports']={'body':{'type':Sequelize[_0xcb66('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xcb66('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcb66('0x3')]('in',_0xcb66('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xcb66('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xcb66('0x5')]}}; \ No newline at end of file +var _0x1948=['BOOLEAN','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x272e74,_0x46ee11){var _0x354449=function(_0x2e05a9){while(--_0x2e05a9){_0x272e74['push'](_0x272e74['shift']());}};_0x354449(++_0x46ee11);}(_0x1948,0x145));var _0x8194=function(_0x1bd7d9,_0x107fc7){_0x1bd7d9=_0x1bd7d9-0x0;var _0x539255=_0x1948[_0x1bd7d9];return _0x539255;};'use strict';var Sequelize=require(_0x8194('0x0'));module[_0x8194('0x1')]={'body':{'type':Sequelize[_0x8194('0x2')](_0x8194('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8194('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8194('0x5')),'defaultValue':_0x8194('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8194('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8194('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index ff566f4..c431564 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 _0x7d92=['query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','show','params','find','update','body','describe','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteractionId','isNil','read1stAt','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','email','EventManager','rejectmessage','create','CmContact','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','files','Attachment','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','destroy','end','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model'];(function(_0xe17fa4,_0x5e9a7d){var _0x51c079=function(_0x4b8a81){while(--_0x4b8a81){_0xe17fa4['push'](_0xe17fa4['shift']());}};_0x51c079(++_0x5e9a7d);}(_0x7d92,0x17b));var _0x27d9=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x7d92[_0x3f0b30];return _0x2748a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27d9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x27d9('0x1'));var moment=require(_0x27d9('0x2'));var BPromise=require(_0x27d9('0x3'));var Mustache=require(_0x27d9('0x4'));var util=require(_0x27d9('0x5'));var path=require(_0x27d9('0x6'));var sox=require(_0x27d9('0x7'));var csv=require(_0x27d9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27d9('0x9'));var _=require(_0x27d9('0xa'));var squel=require(_0x27d9('0xb'));var crypto=require(_0x27d9('0xc'));var jsforce=require(_0x27d9('0xd'));var deskjs=require(_0x27d9('0xe'));var toCsv=require(_0x27d9('0x8'));var querystring=require(_0x27d9('0xf'));var Papa=require(_0x27d9('0x10'));var Redis=require(_0x27d9('0x11'));var authService=require(_0x27d9('0x12'));var qs=require(_0x27d9('0x13'));var as=require(_0x27d9('0x14'));var hardwareService=require(_0x27d9('0x15'));var logger=require(_0x27d9('0x16'))(_0x27d9('0x17'));var utils=require(_0x27d9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x27d9('0x19'));var db=require(_0x27d9('0x1a'))['db'];config[_0x27d9('0x1b')]=_['defaults'](config['redis'],{'host':_0x27d9('0x1c'),'port':0x18eb});var socket=require(_0x27d9('0x1d'))(new Redis(config[_0x27d9('0x1b')]));require(_0x27d9('0x1e'))[_0x27d9('0x1f')](socket);var jayson=require(_0x27d9('0x20'));var client=jayson[_0x27d9('0x21')][_0x27d9('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x27d9('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x3f1471,_0x5498c0,_0x520ed5,_0xab901b){return new BPromise(function(_0x39701b,_0x1190d9){var _0x1adaf0=_0xab901b||client;return _0x1adaf0[_0x27d9('0x23')](_0x3f1471,_0x520ed5)[_0x27d9('0x24')](function(_0x4e3c8d){logger[_0x27d9('0x25')]('FaxMessage,\x20%s,\x20%s',_0x5498c0,_0x27d9('0x26'));logger[_0x27d9('0x27')](_0x27d9('0x28'),_0x5498c0,_0x27d9('0x26'),JSON[_0x27d9('0x29')](_0x4e3c8d));if(_0x4e3c8d[_0x27d9('0x2a')]){if(_0x4e3c8d['error'][_0x27d9('0x2b')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x5498c0,_0x4e3c8d[_0x27d9('0x2a')][_0x27d9('0x2c')]);return _0x1190d9(_0x4e3c8d[_0x27d9('0x2a')]['message']);}logger[_0x27d9('0x2a')](_0x27d9('0x2d'),_0x5498c0,_0x4e3c8d[_0x27d9('0x2a')][_0x27d9('0x2c')]);return _0x39701b(_0x4e3c8d[_0x27d9('0x2a')]['message']);}else{logger[_0x27d9('0x25')]('FaxMessage,\x20%s,\x20%s',_0x5498c0,_0x27d9('0x26'));_0x39701b(_0x4e3c8d[_0x27d9('0x2e')][_0x27d9('0x2c')]);}})[_0x27d9('0x2f')](function(_0x336dd6){logger[_0x27d9('0x2a')](_0x27d9('0x2d'),_0x5498c0,_0x336dd6);_0x1190d9(_0x336dd6);});});}function respondWithStatusCode(_0xe85871,_0x18edbc){_0x18edbc=_0x18edbc||0xcc;return function(_0x421321){if(_0x421321){return _0xe85871[_0x27d9('0x30')](_0x18edbc);}return _0xe85871[_0x27d9('0x31')](_0x18edbc)['end']();};}function respondWithResult(_0x30bee8,_0x44e0b0){_0x44e0b0=_0x44e0b0||0xc8;return function(_0x29dda5){if(_0x29dda5){return _0x30bee8[_0x27d9('0x31')](_0x44e0b0)[_0x27d9('0x32')](_0x29dda5);}};}function respondWithFilteredResult(_0x2db3d9,_0x425791){return function(_0x54d9ea){if(_0x54d9ea){var _0x5f17ed=typeof _0x425791[_0x27d9('0x33')]===_0x27d9('0x34')&&typeof _0x425791[_0x27d9('0x35')]===_0x27d9('0x34');var _0x3ecc46=_0x54d9ea['count'];var _0x1f6295=_0x5f17ed?0x0:_0x425791[_0x27d9('0x33')];var _0x5a5974=_0x5f17ed?_0x54d9ea['count']:_0x425791['offset']+_0x425791[_0x27d9('0x35')];var _0x390bec;if(_0x5a5974>=_0x3ecc46){_0x5a5974=_0x3ecc46;_0x390bec=0xc8;}else{_0x390bec=0xce;}_0x2db3d9[_0x27d9('0x31')](_0x390bec);return _0x2db3d9[_0x27d9('0x36')]('Content-Range',_0x1f6295+'-'+_0x5a5974+'/'+_0x3ecc46)[_0x27d9('0x32')](_0x54d9ea);}return null;};}function patchUpdates(_0x2f1671){return function(_0x1f2b87){try{jsonpatch[_0x27d9('0x37')](_0x1f2b87,_0x2f1671,!![]);}catch(_0x4c85fb){return BPromise[_0x27d9('0x38')](_0x4c85fb);}return _0x1f2b87[_0x27d9('0x39')]();};}function saveUpdates(_0x4c4144,_0x53ceb3){return function(_0x37d805){if(_0x37d805){return _0x37d805['update'](_0x4c4144)['then'](function(_0x3b1596){return _0x3b1596;});}return null;};}function removeEntity(_0x5477d2,_0x187e12){return function(_0x388781){if(_0x388781){return _0x388781[_0x27d9('0x3a')]()[_0x27d9('0x24')](function(){_0x5477d2['status'](0xcc)[_0x27d9('0x3b')]();});}};}function handleEntityNotFound(_0x5a2013,_0x28b1e6){return function(_0x46bea9){if(!_0x46bea9){_0x5a2013[_0x27d9('0x30')](0x194);}return _0x46bea9;};}function handleError(_0x403cc0,_0x3e2df4){_0x3e2df4=_0x3e2df4||0x1f4;return function(_0x1702d4){logger[_0x27d9('0x2a')](_0x1702d4[_0x27d9('0x3c')]);if(_0x1702d4[_0x27d9('0x3d')]){delete _0x1702d4[_0x27d9('0x3d')];}_0x403cc0[_0x27d9('0x31')](_0x3e2df4)[_0x27d9('0x3e')](_0x1702d4);};}exports[_0x27d9('0x3f')]=function(_0x545e30,_0x3c96b7){var _0xaf520a={},_0x2697b0={},_0x23d088={'count':0x0,'rows':[]};var _0x19d0a6=_[_0x27d9('0x40')](db[_0x27d9('0x41')][_0x27d9('0x42')],function(_0x545d8b){return{'name':_0x545d8b[_0x27d9('0x43')],'type':_0x545d8b[_0x27d9('0x44')][_0x27d9('0x45')]};});_0x2697b0[_0x27d9('0x46')]=_['map'](_0x19d0a6,_0x27d9('0x3d'));_0x2697b0[_0x27d9('0x47')]=_[_0x27d9('0x48')](_0x545e30[_0x27d9('0x47')]);_0x2697b0[_0x27d9('0x49')]=_[_0x27d9('0x4a')](_0x2697b0[_0x27d9('0x46')],_0x2697b0[_0x27d9('0x47')]);_0xaf520a['attributes']=_[_0x27d9('0x4a')](_0x2697b0['model'],qs[_0x27d9('0x4b')](_0x545e30[_0x27d9('0x47')]['fields']));_0xaf520a[_0x27d9('0x4c')]=_0xaf520a['attributes'][_0x27d9('0x4d')]?_0xaf520a['attributes']:_0x2697b0[_0x27d9('0x46')];if(!_0x545e30['query']['hasOwnProperty'](_0x27d9('0x4e'))){_0xaf520a[_0x27d9('0x35')]=qs['limit'](_0x545e30[_0x27d9('0x47')][_0x27d9('0x35')]);_0xaf520a[_0x27d9('0x33')]=qs[_0x27d9('0x33')](_0x545e30['query']['offset']);}_0xaf520a['order']=qs[_0x27d9('0x4f')](_0x545e30[_0x27d9('0x47')]['sort']);_0xaf520a[_0x27d9('0x50')]=qs[_0x27d9('0x49')](_['pick'](_0x545e30[_0x27d9('0x47')],_0x2697b0[_0x27d9('0x49')]),_0x19d0a6);if(_0x545e30[_0x27d9('0x47')][_0x27d9('0x51')]){_0xaf520a[_0x27d9('0x50')]=_[_0x27d9('0x52')](_0xaf520a[_0x27d9('0x50')],{'$or':_[_0x27d9('0x40')](_0x19d0a6,function(_0x4708dc){if(_0x4708dc['type']!==_0x27d9('0x53')){var _0x21b40={};_0x21b40[_0x4708dc[_0x27d9('0x3d')]]={'$like':'%'+_0x545e30[_0x27d9('0x47')][_0x27d9('0x51')]+'%'};return _0x21b40;}})});}_0xaf520a=_[_0x27d9('0x52')]({},_0xaf520a,_0x545e30[_0x27d9('0x54')]);var _0x2a0eae={'where':_0xaf520a[_0x27d9('0x50')]};return db[_0x27d9('0x41')][_0x27d9('0x55')](_0x2a0eae)[_0x27d9('0x24')](function(_0x100c28){_0x23d088[_0x27d9('0x55')]=_0x100c28;if(_0x545e30[_0x27d9('0x47')][_0x27d9('0x56')]){_0xaf520a[_0x27d9('0x57')]=[{'all':!![]}];}return db[_0x27d9('0x41')]['findAll'](_0xaf520a);})[_0x27d9('0x24')](function(_0x59dc9e){_0x23d088['rows']=_0x59dc9e;return _0x23d088;})[_0x27d9('0x24')](respondWithFilteredResult(_0x3c96b7,_0xaf520a))[_0x27d9('0x2f')](handleError(_0x3c96b7,null));};exports[_0x27d9('0x58')]=function(_0x581683,_0x416ee1){var _0x44d112={'raw':!![],'where':{'id':_0x581683[_0x27d9('0x59')]['id']}},_0x191d11={};_0x191d11[_0x27d9('0x46')]=_[_0x27d9('0x48')](db[_0x27d9('0x41')][_0x27d9('0x42')]);_0x191d11[_0x27d9('0x47')]=_[_0x27d9('0x48')](_0x581683[_0x27d9('0x47')]);_0x191d11['filters']=_[_0x27d9('0x4a')](_0x191d11[_0x27d9('0x46')],_0x191d11[_0x27d9('0x47')]);_0x44d112['attributes']=_[_0x27d9('0x4a')](_0x191d11[_0x27d9('0x46')],qs[_0x27d9('0x4b')](_0x581683['query'][_0x27d9('0x4b')]));_0x44d112[_0x27d9('0x4c')]=_0x44d112[_0x27d9('0x4c')][_0x27d9('0x4d')]?_0x44d112['attributes']:_0x191d11['model'];if(_0x581683[_0x27d9('0x47')][_0x27d9('0x56')]){_0x44d112[_0x27d9('0x57')]=[{'all':!![]}];}_0x44d112=_[_0x27d9('0x52')]({},_0x44d112,_0x581683['options']);return db[_0x27d9('0x41')][_0x27d9('0x5a')](_0x44d112)[_0x27d9('0x24')](handleEntityNotFound(_0x416ee1,null))['then'](respondWithResult(_0x416ee1,null))['catch'](handleError(_0x416ee1,null));};exports[_0x27d9('0x5b')]=function(_0x4e594a,_0xa8e2b){if(_0x4e594a[_0x27d9('0x5c')]['id']){delete _0x4e594a['body']['id'];}return db['FaxMessage'][_0x27d9('0x5a')]({'where':{'id':_0x4e594a['params']['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0xa8e2b,null))[_0x27d9('0x24')](saveUpdates(_0x4e594a[_0x27d9('0x5c')],null))['then'](respondWithResult(_0xa8e2b,null))[_0x27d9('0x2f')](handleError(_0xa8e2b,null));};exports[_0x27d9('0x3a')]=function(_0x73b6fc,_0x4909e4){return db[_0x27d9('0x41')][_0x27d9('0x5a')]({'where':{'id':_0x73b6fc['params']['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x4909e4,null))[_0x27d9('0x24')](removeEntity(_0x4909e4,null))['catch'](handleError(_0x4909e4,null));};exports[_0x27d9('0x5d')]=function(_0x55f574,_0x3ff606){return db['FaxMessage'][_0x27d9('0x5d')]()[_0x27d9('0x24')](respondWithResult(_0x3ff606,null))[_0x27d9('0x2f')](handleError(_0x3ff606,null));};var interaction_log=require(_0x27d9('0x16'))(_0x27d9('0x5e'));exports['accept']=function(_0x9ba91,_0x2098a9,_0x58e743){var _0x41bbcc={'agent':{},'channel':_0x27d9('0x5f')};if(_0x9ba91[_0x27d9('0x5c')]['id']){delete _0x9ba91['body']['id'];}_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x60')]=!![];_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x61')]=moment()[_0x27d9('0x62')](_0x27d9('0x63'));_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x64')]=_0x9ba91[_0x27d9('0x5c')]['UserId']||_0x9ba91['user']['id'];_0x41bbcc[_0x27d9('0x65')]['id']=_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x64')];return db['FaxMessage'][_0x27d9('0x5a')]({'where':{'id':_0x9ba91[_0x27d9('0x59')]['id'],'UserId':null}})[_0x27d9('0x24')](handleEntityNotFound(_0x2098a9,null))[_0x27d9('0x24')](saveUpdates(_0x9ba91[_0x27d9('0x5c')],null))[_0x27d9('0x24')](function(_0x4e9abc){if(_0x4e9abc){_0x41bbcc[_0x27d9('0x2c')]=_0x4e9abc[_0x27d9('0x66')]({'plain':!![]});return db['FaxInteraction'][_0x27d9('0x5a')]({'where':{'id':_0x4e9abc[_0x27d9('0x67')]}});}return null;})[_0x27d9('0x24')](handleEntityNotFound(_0x2098a9,null))['then'](function(_0x25d6b4){if(_0x25d6b4){return _0x25d6b4[_0x27d9('0x5b')]({'UserId':_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x64')],'read1stAt':_[_0x27d9('0x68')](_0x25d6b4[_0x27d9('0x69')])?moment()[_0x27d9('0x62')](_0x27d9('0x63')):undefined});}return null;})['then'](function(_0x519535){if(_0x519535){_0x41bbcc[_0x27d9('0x6a')]=_0x519535['get']({'plain':!![]});interaction_log[_0x27d9('0x25')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x9ba91[_0x27d9('0x6b')]['id'],_0x9ba91[_0x27d9('0x6b')][_0x27d9('0x3d')],_0x9ba91['user'][_0x27d9('0x6c')],_0x41bbcc['interaction']['id'],_0x9ba91[_0x27d9('0x5c')]?JSON['stringify'](_0x9ba91[_0x27d9('0x5c')]):_0x27d9('0x6d'));return respondWithRpcPromise(_0x27d9('0x6e'),_0x27d9('0x6f'),_0x41bbcc);}return null;})['then'](function(_0x11fd76){var _0x1da80c=_0x27d9('0x70')+_0x11fd76[_0x27d9('0x2c')][_0x27d9('0x71')];return db[_0x27d9('0x72')][_0x27d9('0x47')](_0x1da80c,{'type':db['Sequelize'][_0x27d9('0x73')][_0x27d9('0x74')],'raw':!![]})[_0x27d9('0x24')](function(_0x548ae5){return _0x548ae5;});})['then'](function(_0x59c33a){if(_0x59c33a){_0x41bbcc[_0x27d9('0x2c')][_0x27d9('0x75')]=_0x59c33a[0x0];if(!_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x64')])return;return db[_0x27d9('0x76')][_0x27d9('0x5a')]({'where':{'id':_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x64')],'role':_0x27d9('0x65')},'attributes':['id',_0x27d9('0x3d'),_0x27d9('0x77'),'email',_0x27d9('0x78')],'raw':!![]});}return null;})[_0x27d9('0x24')](function(_0x128b0c){if(!_0x128b0c)return null;_0x41bbcc[_0x27d9('0x2c')]['agent']=_0x128b0c;return _0x41bbcc;})[_0x27d9('0x24')](function(_0x4053ba){if(_0x4053ba){if(_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x79')]){_0x41bbcc[_0x27d9('0x2c')][_0x27d9('0x7a')]=util['format'](_0x27d9('0x7b'),_0x9ba91['user'][_0x27d9('0x3d')]);_0x41bbcc[_0x27d9('0x2c')][_0x27d9('0x7c')]=_0x41bbcc[_0x27d9('0x7c')];_0x41bbcc[_0x27d9('0x2c')][_0x27d9('0x7d')]=_0x41bbcc['channel'];_0x41bbcc[_0x27d9('0x2c')][_0x27d9('0x7e')]=_0x27d9('0x7f');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x27d9('0x80'),'message':_0x41bbcc['message']},client9002)[_0x27d9('0x24')](function(){return _0x41bbcc;});}return _0x41bbcc;}return null;})['then'](respondWithResult(_0x2098a9,null))[_0x27d9('0x2f')](handleError(_0x2098a9,null));};var interaction_log=require(_0x27d9('0x16'))(_0x27d9('0x5e'));exports['reject']=function(_0x549171,_0x31303b,_0xfa0b36){var _0x52b351={'agent':{},'channel':'fax'};if(_0x549171[_0x27d9('0x5c')]['id']){delete _0x549171[_0x27d9('0x5c')]['id'];}_0x549171[_0x27d9('0x5c')][_0x27d9('0x64')]=_0x549171['body'][_0x27d9('0x64')]||_0x549171[_0x27d9('0x6b')]['id'];_0x52b351[_0x27d9('0x65')]['id']=_0x549171['body'][_0x27d9('0x64')];return db[_0x27d9('0x41')][_0x27d9('0x5a')]({'where':{'id':_0x549171[_0x27d9('0x59')]['id'],'UserId':null}})[_0x27d9('0x24')](handleEntityNotFound(_0x31303b,null))[_0x27d9('0x24')](function(_0x1a2b10){if(_0x1a2b10){_0x52b351[_0x27d9('0x2c')]=_0x1a2b10[_0x27d9('0x66')]({'plain':!![]});return db[_0x27d9('0x81')]['find']({'where':{'id':_0x1a2b10[_0x27d9('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x31303b,null))[_0x27d9('0x24')](function(_0x137e5a){if(_0x137e5a){_0x52b351['interaction']=_0x137e5a[_0x27d9('0x66')]({'plain':!![]});interaction_log[_0x27d9('0x25')](_0x27d9('0x82'),_0x549171[_0x27d9('0x6b')]['id'],_0x549171[_0x27d9('0x6b')][_0x27d9('0x3d')],_0x549171[_0x27d9('0x6b')][_0x27d9('0x6c')],_0x52b351['interaction']['id'],_0x549171[_0x27d9('0x5c')]?JSON[_0x27d9('0x29')](_0x549171[_0x27d9('0x5c')]):_0x27d9('0x6d'));return respondWithRpcPromise(_0x27d9('0x83'),_0x27d9('0x84'),_0x52b351);}return null;})[_0x27d9('0x24')](function(_0x56edcd){var _0x37c4a1=_0x27d9('0x70')+_0x56edcd[_0x27d9('0x2c')][_0x27d9('0x71')];return db['sequelize'][_0x27d9('0x47')](_0x37c4a1,{'type':db[_0x27d9('0x85')][_0x27d9('0x73')][_0x27d9('0x74')],'raw':!![]})[_0x27d9('0x24')](function(_0x1f9a30){return _0x1f9a30;});})[_0x27d9('0x24')](function(_0x320edd){if(_0x320edd){_0x52b351[_0x27d9('0x2c')][_0x27d9('0x75')]=_0x320edd[0x0];if(!_0x549171[_0x27d9('0x5c')][_0x27d9('0x64')])return;return db['User'][_0x27d9('0x5a')]({'where':{'id':_0x549171[_0x27d9('0x5c')][_0x27d9('0x64')],'role':_0x27d9('0x65')},'attributes':['id','name','fullname',_0x27d9('0x86'),_0x27d9('0x78')],'raw':!![]});}return null;})['then'](function(_0xade99b){if(!_0xade99b)return null;_0x52b351[_0x27d9('0x2c')]['agent']=_0xade99b;return _0x52b351;})['then'](function(_0x5eeac1){if(_0x5eeac1){_0x5eeac1['message'][_0x27d9('0x7a')]=util[_0x27d9('0x62')](_0x27d9('0x7b'),_0x549171[_0x27d9('0x6b')]['name']);_0x5eeac1['message']['channel']=_0x52b351[_0x27d9('0x7c')];_0x5eeac1['message']['motionChannel']=_0x52b351[_0x27d9('0x7c')];_0x5eeac1[_0x27d9('0x2c')][_0x27d9('0x7e')]='reject';respondWithRpcPromise(_0x27d9('0x87'),'EventManager',{'event':_0x27d9('0x88'),'message':_0x5eeac1[_0x27d9('0x2c')]},client9002);return _0x52b351;}return null;})['then'](respondWithResult(_0x31303b,null))[_0x27d9('0x2f')](handleError(_0x31303b,null));};exports[_0x27d9('0x89')]=function(_0x4378ca,_0x1827aa){var _0x33290b;return db[_0x27d9('0x41')][_0x27d9('0x89')](_0x4378ca[_0x27d9('0x5c')],{})[_0x27d9('0x24')](function(_0x4c6262){_0x33290b=_0x4c6262;return db[_0x27d9('0x8a')][_0x27d9('0x8b')]({'where':{'id':_0x33290b[_0x27d9('0x71')]}});})['then'](function(_0x58255b){if(_[_0x27d9('0x68')](_0x58255b)){return;}else{_0x33290b[_0x27d9('0x5f')]=_0x58255b['fax'];return db['Attachment'][_0x27d9('0x8b')]({'where':{'id':_0x33290b['AttachmentId']}});}})[_0x27d9('0x24')](function(_0x217a2a){return respondWithRpcPromise(_0x27d9('0x8c'),_0x27d9('0x8c'),{'FaxAccountId':_[_0x27d9('0x68')](_0x4378ca['body'])?undefined:_0x4378ca[_0x27d9('0x5c')][_0x27d9('0x8d')],'path':_[_0x27d9('0x68')](_0x217a2a)?undefined:util[_0x27d9('0x62')](_0x27d9('0x8e'),_0x217a2a[_0x27d9('0x8f')]),'fax':_[_0x27d9('0x68')](_0x33290b[_0x27d9('0x5f')])?undefined:_0x33290b['fax'],'AttachmentId':_0x33290b[_0x27d9('0x90')]},client9002);})[_0x27d9('0x24')](respondWithResult(_0x1827aa,0xc9))[_0x27d9('0x2f')](handleError(_0x1827aa,null));};exports[_0x27d9('0x91')]=function(_0x168079,_0x1e912){var _0x585d38=path[_0x27d9('0x92')](config[_0x27d9('0x93')],'server',_0x27d9('0x94'),'attachments');return db['FaxMessage']['find']({'where':{'id':_0x168079[_0x27d9('0x59')]['id']},'include':[{'model':db[_0x27d9('0x95')],'as':_0x27d9('0x95')}]})[_0x27d9('0x24')](handleEntityNotFound(_0x1e912,null))[_0x27d9('0x24')](function(_0x598206){if(_0x598206){return _0x1e912[_0x27d9('0x91')](path[_0x27d9('0x92')](_0x585d38,_0x598206[_0x27d9('0x95')]['basename']));}})[_0x27d9('0x2f')](handleError(_0x1e912,null));}; \ No newline at end of file +var _0x1ce2=['end','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','map','FaxMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','body','find','params','describe','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','fullname','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','role','RejectMessage','rejectMessage','Sequelize','contact','email','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','attachments','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','result','sendStatus'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1ce2,0xef));var _0x21ce=function(_0x1a15b5,_0x46454c){_0x1a15b5=_0x1a15b5-0x0;var _0x598928=_0x1ce2[_0x1a15b5];return _0x598928;};'use strict';var emlformat=require(_0x21ce('0x0'));var rimraf=require(_0x21ce('0x1'));var zipdir=require(_0x21ce('0x2'));var jsonpatch=require(_0x21ce('0x3'));var rp=require('request-promise');var moment=require(_0x21ce('0x4'));var BPromise=require(_0x21ce('0x5'));var Mustache=require(_0x21ce('0x6'));var util=require('util');var path=require(_0x21ce('0x7'));var sox=require(_0x21ce('0x8'));var csv=require(_0x21ce('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x21ce('0xa'));var _=require(_0x21ce('0xb'));var squel=require(_0x21ce('0xc'));var crypto=require('crypto');var jsforce=require(_0x21ce('0xd'));var deskjs=require(_0x21ce('0xe'));var toCsv=require('to-csv');var querystring=require(_0x21ce('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x21ce('0x10'));var qs=require(_0x21ce('0x11'));var as=require(_0x21ce('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x21ce('0x13'))(_0x21ce('0x14'));var utils=require(_0x21ce('0x15'));var config=require(_0x21ce('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x21ce('0x17')]=_[_0x21ce('0x18')](config[_0x21ce('0x17')],{'host':_0x21ce('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x21ce('0x17')]));require(_0x21ce('0x1a'))[_0x21ce('0x1b')](socket);var jayson=require(_0x21ce('0x1c'));var client=jayson[_0x21ce('0x1d')][_0x21ce('0x1e')]({'port':0x232c});var client9002=jayson[_0x21ce('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f9106,_0x1c353c,_0x502712,_0x39118d){return new BPromise(function(_0x52ad0c,_0x35622c){var _0x2afd93=_0x39118d||client;return _0x2afd93['request'](_0x1f9106,_0x502712)[_0x21ce('0x1f')](function(_0x4f735a){logger[_0x21ce('0x20')]('FaxMessage,\x20%s,\x20%s',_0x1c353c,_0x21ce('0x21'));logger[_0x21ce('0x22')](_0x21ce('0x23'),_0x1c353c,_0x21ce('0x21'),JSON[_0x21ce('0x24')](_0x4f735a));if(_0x4f735a[_0x21ce('0x25')]){if(_0x4f735a[_0x21ce('0x25')][_0x21ce('0x26')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1c353c,_0x4f735a[_0x21ce('0x25')][_0x21ce('0x27')]);return _0x35622c(_0x4f735a[_0x21ce('0x25')][_0x21ce('0x27')]);}logger[_0x21ce('0x25')](_0x21ce('0x28'),_0x1c353c,_0x4f735a[_0x21ce('0x25')][_0x21ce('0x27')]);return _0x52ad0c(_0x4f735a[_0x21ce('0x25')][_0x21ce('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x1c353c,'request\x20sent');_0x52ad0c(_0x4f735a[_0x21ce('0x29')][_0x21ce('0x27')]);}})['catch'](function(_0x2a48f1){logger[_0x21ce('0x25')](_0x21ce('0x28'),_0x1c353c,_0x2a48f1);_0x35622c(_0x2a48f1);});});}function respondWithStatusCode(_0x5db4b8,_0x2bc97a){_0x2bc97a=_0x2bc97a||0xcc;return function(_0x25e424){if(_0x25e424){return _0x5db4b8[_0x21ce('0x2a')](_0x2bc97a);}return _0x5db4b8['status'](_0x2bc97a)[_0x21ce('0x2b')]();};}function respondWithResult(_0x5d105d,_0xc99fa1){_0xc99fa1=_0xc99fa1||0xc8;return function(_0x2c2113){if(_0x2c2113){return _0x5d105d[_0x21ce('0x2c')](_0xc99fa1)['json'](_0x2c2113);}};}function respondWithFilteredResult(_0xb5b3e4,_0xed6497){return function(_0x3798ab){if(_0x3798ab){var _0x5359af=typeof _0xed6497[_0x21ce('0x2d')]===_0x21ce('0x2e')&&typeof _0xed6497[_0x21ce('0x2f')]===_0x21ce('0x2e');var _0x4a9fb0=_0x3798ab[_0x21ce('0x30')];var _0x18afb8=_0x5359af?0x0:_0xed6497[_0x21ce('0x2d')];var _0x2cf575=_0x5359af?_0x3798ab['count']:_0xed6497[_0x21ce('0x2d')]+_0xed6497[_0x21ce('0x2f')];var _0x4ad506;if(_0x2cf575>=_0x4a9fb0){_0x2cf575=_0x4a9fb0;_0x4ad506=0xc8;}else{_0x4ad506=0xce;}_0xb5b3e4[_0x21ce('0x2c')](_0x4ad506);return _0xb5b3e4[_0x21ce('0x31')](_0x21ce('0x32'),_0x18afb8+'-'+_0x2cf575+'/'+_0x4a9fb0)['json'](_0x3798ab);}return null;};}function patchUpdates(_0x275a7a){return function(_0x536d81){try{jsonpatch['apply'](_0x536d81,_0x275a7a,!![]);}catch(_0x527f23){return BPromise[_0x21ce('0x33')](_0x527f23);}return _0x536d81[_0x21ce('0x34')]();};}function saveUpdates(_0x303b9e,_0x171299){return function(_0x1fb2b1){if(_0x1fb2b1){return _0x1fb2b1[_0x21ce('0x35')](_0x303b9e)[_0x21ce('0x1f')](function(_0x2362e9){return _0x2362e9;});}return null;};}function removeEntity(_0x1803b6,_0x1b454e){return function(_0x306452){if(_0x306452){return _0x306452[_0x21ce('0x36')]()[_0x21ce('0x1f')](function(){_0x1803b6[_0x21ce('0x2c')](0xcc)[_0x21ce('0x2b')]();});}};}function handleEntityNotFound(_0x4dd523,_0x5d5b99){return function(_0x1f55c3){if(!_0x1f55c3){_0x4dd523[_0x21ce('0x2a')](0x194);}return _0x1f55c3;};}function handleError(_0x506635,_0xfb6307){_0xfb6307=_0xfb6307||0x1f4;return function(_0x1618c5){logger[_0x21ce('0x25')](_0x1618c5[_0x21ce('0x37')]);if(_0x1618c5['name']){delete _0x1618c5[_0x21ce('0x38')];}_0x506635['status'](_0xfb6307)['send'](_0x1618c5);};}exports['index']=function(_0x39fa32,_0x59b5c9){var _0x49fc1e={},_0x143542={},_0x455b2e={'count':0x0,'rows':[]};var _0x1e6ccf=_[_0x21ce('0x39')](db[_0x21ce('0x3a')][_0x21ce('0x3b')],function(_0x27ea4e){return{'name':_0x27ea4e[_0x21ce('0x3c')],'type':_0x27ea4e['type'][_0x21ce('0x3d')]};});_0x143542[_0x21ce('0x3e')]=_['map'](_0x1e6ccf,_0x21ce('0x38'));_0x143542[_0x21ce('0x3f')]=_[_0x21ce('0x40')](_0x39fa32[_0x21ce('0x3f')]);_0x143542[_0x21ce('0x41')]=_[_0x21ce('0x42')](_0x143542[_0x21ce('0x3e')],_0x143542[_0x21ce('0x3f')]);_0x49fc1e['attributes']=_[_0x21ce('0x42')](_0x143542[_0x21ce('0x3e')],qs[_0x21ce('0x43')](_0x39fa32[_0x21ce('0x3f')]['fields']));_0x49fc1e[_0x21ce('0x44')]=_0x49fc1e['attributes'][_0x21ce('0x45')]?_0x49fc1e[_0x21ce('0x44')]:_0x143542[_0x21ce('0x3e')];if(!_0x39fa32[_0x21ce('0x3f')]['hasOwnProperty'](_0x21ce('0x46'))){_0x49fc1e[_0x21ce('0x2f')]=qs['limit'](_0x39fa32[_0x21ce('0x3f')][_0x21ce('0x2f')]);_0x49fc1e[_0x21ce('0x2d')]=qs[_0x21ce('0x2d')](_0x39fa32['query'][_0x21ce('0x2d')]);}_0x49fc1e[_0x21ce('0x47')]=qs['sort'](_0x39fa32[_0x21ce('0x3f')][_0x21ce('0x48')]);_0x49fc1e[_0x21ce('0x49')]=qs[_0x21ce('0x41')](_[_0x21ce('0x4a')](_0x39fa32[_0x21ce('0x3f')],_0x143542[_0x21ce('0x41')]),_0x1e6ccf);if(_0x39fa32[_0x21ce('0x3f')][_0x21ce('0x4b')]){_0x49fc1e[_0x21ce('0x49')]=_[_0x21ce('0x4c')](_0x49fc1e[_0x21ce('0x49')],{'$or':_[_0x21ce('0x39')](_0x1e6ccf,function(_0x42e35a){if(_0x42e35a[_0x21ce('0x4d')]!==_0x21ce('0x4e')){var _0x1416fa={};_0x1416fa[_0x42e35a[_0x21ce('0x38')]]={'$like':'%'+_0x39fa32['query']['filter']+'%'};return _0x1416fa;}})});}_0x49fc1e=_['merge']({},_0x49fc1e,_0x39fa32[_0x21ce('0x4f')]);var _0x5824ed={'where':_0x49fc1e[_0x21ce('0x49')]};return db[_0x21ce('0x3a')][_0x21ce('0x30')](_0x5824ed)[_0x21ce('0x1f')](function(_0x48faa9){_0x455b2e[_0x21ce('0x30')]=_0x48faa9;if(_0x39fa32['query'][_0x21ce('0x50')]){_0x49fc1e[_0x21ce('0x51')]=[{'all':!![]}];}return db[_0x21ce('0x3a')]['findAll'](_0x49fc1e);})[_0x21ce('0x1f')](function(_0x2e24cd){_0x455b2e['rows']=_0x2e24cd;return _0x455b2e;})[_0x21ce('0x1f')](respondWithFilteredResult(_0x59b5c9,_0x49fc1e))[_0x21ce('0x52')](handleError(_0x59b5c9,null));};exports['show']=function(_0x2e9016,_0x5da6b2){var _0x588b78={'raw':!![],'where':{'id':_0x2e9016['params']['id']}},_0x5b502d={};_0x5b502d['model']=_['keys'](db['FaxMessage'][_0x21ce('0x3b')]);_0x5b502d[_0x21ce('0x3f')]=_[_0x21ce('0x40')](_0x2e9016[_0x21ce('0x3f')]);_0x5b502d[_0x21ce('0x41')]=_[_0x21ce('0x42')](_0x5b502d['model'],_0x5b502d[_0x21ce('0x3f')]);_0x588b78[_0x21ce('0x44')]=_[_0x21ce('0x42')](_0x5b502d[_0x21ce('0x3e')],qs[_0x21ce('0x43')](_0x2e9016[_0x21ce('0x3f')][_0x21ce('0x43')]));_0x588b78['attributes']=_0x588b78[_0x21ce('0x44')][_0x21ce('0x45')]?_0x588b78['attributes']:_0x5b502d[_0x21ce('0x3e')];if(_0x2e9016['query']['includeAll']){_0x588b78[_0x21ce('0x51')]=[{'all':!![]}];}_0x588b78=_[_0x21ce('0x4c')]({},_0x588b78,_0x2e9016['options']);return db[_0x21ce('0x3a')]['find'](_0x588b78)[_0x21ce('0x1f')](handleEntityNotFound(_0x5da6b2,null))[_0x21ce('0x1f')](respondWithResult(_0x5da6b2,null))['catch'](handleError(_0x5da6b2,null));};exports['update']=function(_0x45a801,_0x27ff2a){if(_0x45a801[_0x21ce('0x53')]['id']){delete _0x45a801[_0x21ce('0x53')]['id'];}return db['FaxMessage'][_0x21ce('0x54')]({'where':{'id':_0x45a801[_0x21ce('0x55')]['id']}})[_0x21ce('0x1f')](handleEntityNotFound(_0x27ff2a,null))[_0x21ce('0x1f')](saveUpdates(_0x45a801[_0x21ce('0x53')],null))[_0x21ce('0x1f')](respondWithResult(_0x27ff2a,null))[_0x21ce('0x52')](handleError(_0x27ff2a,null));};exports['destroy']=function(_0x473b1d,_0x51c363){return db[_0x21ce('0x3a')][_0x21ce('0x54')]({'where':{'id':_0x473b1d['params']['id']}})['then'](handleEntityNotFound(_0x51c363,null))[_0x21ce('0x1f')](removeEntity(_0x51c363,null))['catch'](handleError(_0x51c363,null));};exports[_0x21ce('0x56')]=function(_0x544a08,_0xeb8db){return db[_0x21ce('0x3a')]['describe']()[_0x21ce('0x1f')](respondWithResult(_0xeb8db,null))[_0x21ce('0x52')](handleError(_0xeb8db,null));};var interaction_log=require(_0x21ce('0x13'))(_0x21ce('0x57'));exports['accept']=function(_0x4a469e,_0xaa101d,_0x2312f9){var _0x31da65={'agent':{},'channel':_0x21ce('0x58')};if(_0x4a469e[_0x21ce('0x53')]['id']){delete _0x4a469e[_0x21ce('0x53')]['id'];}_0x4a469e[_0x21ce('0x53')][_0x21ce('0x59')]=!![];_0x4a469e[_0x21ce('0x53')][_0x21ce('0x5a')]=moment()[_0x21ce('0x5b')](_0x21ce('0x5c'));_0x4a469e[_0x21ce('0x53')][_0x21ce('0x5d')]=_0x4a469e['body'][_0x21ce('0x5d')]||_0x4a469e[_0x21ce('0x5e')]['id'];_0x31da65[_0x21ce('0x5f')]['id']=_0x4a469e['body']['UserId'];return db[_0x21ce('0x3a')][_0x21ce('0x54')]({'where':{'id':_0x4a469e[_0x21ce('0x55')]['id'],'UserId':null}})[_0x21ce('0x1f')](handleEntityNotFound(_0xaa101d,null))[_0x21ce('0x1f')](saveUpdates(_0x4a469e[_0x21ce('0x53')],null))[_0x21ce('0x1f')](function(_0x2143c3){if(_0x2143c3){_0x31da65[_0x21ce('0x27')]=_0x2143c3[_0x21ce('0x60')]({'plain':!![]});return db[_0x21ce('0x61')][_0x21ce('0x54')]({'where':{'id':_0x2143c3['FaxInteractionId']}});}return null;})[_0x21ce('0x1f')](handleEntityNotFound(_0xaa101d,null))[_0x21ce('0x1f')](function(_0x15ef06){if(_0x15ef06){return _0x15ef06[_0x21ce('0x35')]({'UserId':_0x4a469e[_0x21ce('0x53')][_0x21ce('0x5d')],'read1stAt':_[_0x21ce('0x62')](_0x15ef06[_0x21ce('0x63')])?moment()[_0x21ce('0x5b')](_0x21ce('0x5c')):undefined});}return null;})['then'](function(_0x44dbb5){if(_0x44dbb5){_0x31da65['interaction']=_0x44dbb5[_0x21ce('0x60')]({'plain':!![]});interaction_log['info'](_0x21ce('0x64'),_0x4a469e[_0x21ce('0x5e')]['id'],_0x4a469e[_0x21ce('0x5e')][_0x21ce('0x38')],_0x4a469e[_0x21ce('0x5e')]['role'],_0x31da65[_0x21ce('0x65')]['id'],_0x4a469e[_0x21ce('0x53')]?JSON[_0x21ce('0x24')](_0x4a469e[_0x21ce('0x53')]):_0x21ce('0x66'));return respondWithRpcPromise(_0x21ce('0x67'),_0x21ce('0x68'),_0x31da65);}return null;})['then'](function(_0x137637){var _0xf4bca0=_0x21ce('0x69')+_0x137637[_0x21ce('0x27')][_0x21ce('0x6a')];return db[_0x21ce('0x6b')][_0x21ce('0x3f')](_0xf4bca0,{'type':db['Sequelize'][_0x21ce('0x6c')][_0x21ce('0x6d')],'raw':!![]})['then'](function(_0x30c2c2){return _0x30c2c2;});})[_0x21ce('0x1f')](function(_0x591c73){if(_0x591c73){_0x31da65[_0x21ce('0x27')]['contact']=_0x591c73[0x0];if(!_0x4a469e[_0x21ce('0x53')]['UserId'])return;return db[_0x21ce('0x6e')][_0x21ce('0x54')]({'where':{'id':_0x4a469e[_0x21ce('0x53')][_0x21ce('0x5d')],'role':_0x21ce('0x5f')},'attributes':['id',_0x21ce('0x38'),_0x21ce('0x6f'),'email',_0x21ce('0x70')],'raw':!![]});}return null;})['then'](function(_0x378b00){if(!_0x378b00)return null;_0x31da65['message'][_0x21ce('0x5f')]=_0x378b00;return _0x31da65;})[_0x21ce('0x1f')](function(_0x54677c){if(_0x54677c){if(_0x4a469e[_0x21ce('0x53')][_0x21ce('0x71')]){_0x31da65[_0x21ce('0x27')][_0x21ce('0x72')]=util[_0x21ce('0x5b')](_0x21ce('0x73'),_0x4a469e[_0x21ce('0x5e')][_0x21ce('0x38')]);_0x31da65[_0x21ce('0x27')][_0x21ce('0x74')]=_0x31da65[_0x21ce('0x74')];_0x31da65[_0x21ce('0x27')]['motionChannel']=_0x31da65['channel'];_0x31da65[_0x21ce('0x27')][_0x21ce('0x75')]=_0x21ce('0x76');return respondWithRpcPromise(_0x21ce('0x77'),_0x21ce('0x77'),{'event':_0x21ce('0x78'),'message':_0x31da65[_0x21ce('0x27')]},client9002)[_0x21ce('0x1f')](function(){return _0x31da65;});}return _0x31da65;}return null;})[_0x21ce('0x1f')](respondWithResult(_0xaa101d,null))[_0x21ce('0x52')](handleError(_0xaa101d,null));};var interaction_log=require(_0x21ce('0x13'))('fax-interactions');exports[_0x21ce('0x33')]=function(_0x356714,_0x3ff62b,_0x11d59f){var _0x432589={'agent':{},'channel':_0x21ce('0x58')};if(_0x356714['body']['id']){delete _0x356714['body']['id'];}_0x356714[_0x21ce('0x53')][_0x21ce('0x5d')]=_0x356714[_0x21ce('0x53')][_0x21ce('0x5d')]||_0x356714[_0x21ce('0x5e')]['id'];_0x432589[_0x21ce('0x5f')]['id']=_0x356714[_0x21ce('0x53')][_0x21ce('0x5d')];return db['FaxMessage'][_0x21ce('0x54')]({'where':{'id':_0x356714[_0x21ce('0x55')]['id'],'UserId':null}})[_0x21ce('0x1f')](handleEntityNotFound(_0x3ff62b,null))[_0x21ce('0x1f')](function(_0x1ac323){if(_0x1ac323){_0x432589[_0x21ce('0x27')]=_0x1ac323[_0x21ce('0x60')]({'plain':!![]});return db[_0x21ce('0x61')][_0x21ce('0x54')]({'where':{'id':_0x1ac323['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3ff62b,null))[_0x21ce('0x1f')](function(_0x24f011){if(_0x24f011){_0x432589[_0x21ce('0x65')]=_0x24f011[_0x21ce('0x60')]({'plain':!![]});interaction_log[_0x21ce('0x20')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x356714['user']['id'],_0x356714[_0x21ce('0x5e')]['name'],_0x356714['user'][_0x21ce('0x79')],_0x432589[_0x21ce('0x65')]['id'],_0x356714['body']?JSON[_0x21ce('0x24')](_0x356714['body']):_0x21ce('0x66'));return respondWithRpcPromise(_0x21ce('0x7a'),_0x21ce('0x7b'),_0x432589);}return null;})[_0x21ce('0x1f')](function(_0x585add){var _0x1c8fda=_0x21ce('0x69')+_0x585add['message'][_0x21ce('0x6a')];return db['sequelize'][_0x21ce('0x3f')](_0x1c8fda,{'type':db[_0x21ce('0x7c')][_0x21ce('0x6c')][_0x21ce('0x6d')],'raw':!![]})['then'](function(_0x54b3f9){return _0x54b3f9;});})[_0x21ce('0x1f')](function(_0x522473){if(_0x522473){_0x432589[_0x21ce('0x27')][_0x21ce('0x7d')]=_0x522473[0x0];if(!_0x356714[_0x21ce('0x53')]['UserId'])return;return db[_0x21ce('0x6e')][_0x21ce('0x54')]({'where':{'id':_0x356714['body'][_0x21ce('0x5d')],'role':_0x21ce('0x5f')},'attributes':['id',_0x21ce('0x38'),_0x21ce('0x6f'),_0x21ce('0x7e'),_0x21ce('0x70')],'raw':!![]});}return null;})[_0x21ce('0x1f')](function(_0x5ce7ac){if(!_0x5ce7ac)return null;_0x432589[_0x21ce('0x27')][_0x21ce('0x5f')]=_0x5ce7ac;return _0x432589;})['then'](function(_0x7fe6ae){if(_0x7fe6ae){_0x7fe6ae['message'][_0x21ce('0x72')]=util[_0x21ce('0x5b')](_0x21ce('0x73'),_0x356714[_0x21ce('0x5e')][_0x21ce('0x38')]);_0x7fe6ae[_0x21ce('0x27')][_0x21ce('0x74')]=_0x432589[_0x21ce('0x74')];_0x7fe6ae[_0x21ce('0x27')]['motionChannel']=_0x432589['channel'];_0x7fe6ae['message'][_0x21ce('0x75')]=_0x21ce('0x33');respondWithRpcPromise(_0x21ce('0x77'),_0x21ce('0x77'),{'event':_0x21ce('0x7f'),'message':_0x7fe6ae[_0x21ce('0x27')]},client9002);return _0x432589;}return null;})['then'](respondWithResult(_0x3ff62b,null))[_0x21ce('0x52')](handleError(_0x3ff62b,null));};exports['create']=function(_0x161b42,_0x158dc8){var _0x502a5f;return db['FaxMessage'][_0x21ce('0x80')](_0x161b42['body'],{})[_0x21ce('0x1f')](function(_0x13f3fb){_0x502a5f=_0x13f3fb;return db['CmContact'][_0x21ce('0x81')]({'where':{'id':_0x502a5f[_0x21ce('0x6a')]}});})['then'](function(_0xee9d26){if(_[_0x21ce('0x62')](_0xee9d26)){return;}else{_0x502a5f['fax']=_0xee9d26[_0x21ce('0x58')];return db[_0x21ce('0x82')][_0x21ce('0x81')]({'where':{'id':_0x502a5f[_0x21ce('0x83')]}});}})[_0x21ce('0x1f')](function(_0x5b8f77){return respondWithRpcPromise(_0x21ce('0x84'),'SendFax',{'FaxAccountId':_[_0x21ce('0x62')](_0x161b42[_0x21ce('0x53')])?undefined:_0x161b42[_0x21ce('0x53')][_0x21ce('0x85')],'path':_[_0x21ce('0x62')](_0x5b8f77)?undefined:util[_0x21ce('0x5b')](_0x21ce('0x86'),_0x5b8f77[_0x21ce('0x87')]),'fax':_[_0x21ce('0x62')](_0x502a5f[_0x21ce('0x58')])?undefined:_0x502a5f[_0x21ce('0x58')],'AttachmentId':_0x502a5f[_0x21ce('0x83')]},client9002);})[_0x21ce('0x1f')](respondWithResult(_0x158dc8,0xc9))[_0x21ce('0x52')](handleError(_0x158dc8,null));};exports[_0x21ce('0x88')]=function(_0x347459,_0x11fa5a){var _0x5404b4=path[_0x21ce('0x89')](config[_0x21ce('0x8a')],_0x21ce('0x8b'),'files',_0x21ce('0x8c'));return db[_0x21ce('0x3a')][_0x21ce('0x54')]({'where':{'id':_0x347459[_0x21ce('0x55')]['id']},'include':[{'model':db[_0x21ce('0x82')],'as':_0x21ce('0x82')}]})[_0x21ce('0x1f')](handleEntityNotFound(_0x11fa5a,null))[_0x21ce('0x1f')](function(_0x12158c){if(_0x12158c){return _0x11fa5a[_0x21ce('0x88')](path[_0x21ce('0x89')](_0x5404b4,_0x12158c[_0x21ce('0x82')][_0x21ce('0x87')]));}})[_0x21ce('0x52')](handleError(_0x11fa5a,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index fb96990..2f38a9f 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 _0xe6e9=['../../mysqldb','FaxMessage','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xe6e9,0x182));var _0x9e6e=function(_0x305426,_0x363673){_0x305426=_0x305426-0x0;var _0x4ed3aa=_0xe6e9[_0x305426];return _0x4ed3aa;};'use strict';var EventEmitter=require(_0x9e6e('0x0'));var FaxMessage=require(_0x9e6e('0x1'))['db'][_0x9e6e('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e6e('0x3'),'afterUpdate':_0x9e6e('0x4'),'afterDestroy':_0x9e6e('0x5')};function emitEvent(_0x3313dc){return function(_0x1f6d79,_0x5f4c0b,_0x1f64e8){FaxMessageEvents[_0x9e6e('0x6')](_0x3313dc+':'+_0x1f6d79['id'],_0x1f6d79);FaxMessageEvents[_0x9e6e('0x6')](_0x3313dc,_0x1f6d79);_0x1f64e8(null);};}for(var e in events){if(events[_0x9e6e('0x7')](e)){var event=events[e];FaxMessage[_0x9e6e('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x7eff=['hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','setMaxListeners','update','remove','emit'];(function(_0x4bdda3,_0x25f960){var _0x3f8722=function(_0x341120){while(--_0x341120){_0x4bdda3['push'](_0x4bdda3['shift']());}};_0x3f8722(++_0x25f960);}(_0x7eff,0x162));var _0xf7ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7eff[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xf7ef('0x0'))['db'][_0xf7ef('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xf7ef('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf7ef('0x3'),'afterDestroy':_0xf7ef('0x4')};function emitEvent(_0xc0c7ba){return function(_0x4db614,_0x58a651,_0x4a4573){FaxMessageEvents[_0xf7ef('0x5')](_0xc0c7ba+':'+_0x4db614['id'],_0x4db614);FaxMessageEvents[_0xf7ef('0x5')](_0xc0c7ba,_0x4db614);_0x4a4573(null);};}for(var e in events){if(events[_0xf7ef('0x6')](e)){var event=events[e];FaxMessage[_0xf7ef('0x7')](e,emitEvent(event));}}module[_0xf7ef('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index cf12d95..275f1f3 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 _0x7962=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','FaxInteraction','findOne','then','update','catch','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1be24d,_0x16f4a5){var _0x688208=function(_0x420a72){while(--_0x420a72){_0x1be24d['push'](_0x1be24d['shift']());}};_0x688208(++_0x16f4a5);}(_0x7962,0xa2));var _0x2796=function(_0x1123cf,_0x26a612){_0x1123cf=_0x1123cf-0x0;var _0x15182d=_0x7962[_0x1123cf];return _0x15182d;};'use strict';var _=require(_0x2796('0x0'));var util=require(_0x2796('0x1'));var logger=require(_0x2796('0x2'))(_0x2796('0x3'));var moment=require(_0x2796('0x4'));var BPromise=require('bluebird');var rp=require(_0x2796('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2796('0x6'));var config=require(_0x2796('0x7'));var attributes=require(_0x2796('0x8'));module[_0x2796('0x9')]=function(_0x500f9e,_0x2001a6){return _0x500f9e['define'](_0x2796('0xa'),attributes,{'tableName':_0x2796('0xb'),'paranoid':![],'indexes':[{'name':_0x2796('0xc'),'fields':[_0x2796('0xd')],'type':_0x2796('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x257b54,_0x24e20c,_0xa03b60){var _0x33d826=_0x500f9e[_0x2796('0xf')];var _0x32b9d8=_0x257b54['get']({'plain':!![]});if(_0x32b9d8['direction']['toLowerCase']()==='in'||_0x32b9d8[_0x2796('0x10')][_0x2796('0x11')]()===_0x2796('0x12')&&!_0x32b9d8[_0x2796('0x13')]&&!_['isNil'](_0x32b9d8['UserId'])){_0x33d826[_0x2796('0x14')][_0x2796('0x15')]({'where':{'id':_0x32b9d8['FaxInteractionId']}})[_0x2796('0x16')](function(_0x830b98){if(_0x830b98){_0x830b98[_0x2796('0x17')]({'lastMsgAt':_0x32b9d8['createdAt'],'lastMsgDirection':_0x32b9d8[_0x2796('0x10')][_0x2796('0x11')]()});}})[_0x2796('0x18')](function(_0x3fa2c1){console['error'](_0x3fa2c1);});}_0xa03b60();}},'charset':_0x2796('0x19'),'collate':_0x2796('0x1a')});}; \ No newline at end of file +var _0x19d3=['FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch','error','utf8mb4','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define'];(function(_0x35e524,_0x2cf819){var _0x20fd13=function(_0x436e9e){while(--_0x436e9e){_0x35e524['push'](_0x35e524['shift']());}};_0x20fd13(++_0x2cf819);}(_0x19d3,0x12b));var _0x319d=function(_0x12c89f,_0x261261){_0x12c89f=_0x12c89f-0x0;var _0x47080f=_0x19d3[_0x12c89f];return _0x47080f;};'use strict';var _=require('lodash');var util=require(_0x319d('0x0'));var logger=require(_0x319d('0x1'))(_0x319d('0x2'));var moment=require('moment');var BPromise=require(_0x319d('0x3'));var rp=require(_0x319d('0x4'));var fs=require('fs');var path=require(_0x319d('0x5'));var rimraf=require(_0x319d('0x6'));var config=require(_0x319d('0x7'));var attributes=require(_0x319d('0x8'));module[_0x319d('0x9')]=function(_0x5c2268,_0x8c4d40){return _0x5c2268[_0x319d('0xa')](_0x319d('0xb'),attributes,{'tableName':_0x319d('0xc'),'paranoid':![],'indexes':[{'name':_0x319d('0xd'),'fields':[_0x319d('0xe')],'type':_0x319d('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x95acd7,_0x34052b,_0x122c83){var _0x3c990d=_0x5c2268['models'];var _0x25a3d5=_0x95acd7[_0x319d('0x10')]({'plain':!![]});if(_0x25a3d5[_0x319d('0x11')][_0x319d('0x12')]()==='in'||_0x25a3d5[_0x319d('0x11')]['toLowerCase']()===_0x319d('0x13')&&!_0x25a3d5[_0x319d('0x14')]&&!_[_0x319d('0x15')](_0x25a3d5[_0x319d('0x16')])){_0x3c990d[_0x319d('0x17')][_0x319d('0x18')]({'where':{'id':_0x25a3d5[_0x319d('0x19')]}})['then'](function(_0x23410b){if(_0x23410b){_0x23410b[_0x319d('0x1a')]({'lastMsgAt':_0x25a3d5[_0x319d('0x1b')],'lastMsgDirection':_0x25a3d5[_0x319d('0x11')][_0x319d('0x12')]()});}})[_0x319d('0x1c')](function(_0x5dde9b){console[_0x319d('0x1d')](_0x5dde9b);});}_0x122c83();}},'charset':_0x319d('0x1e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 03e535b..2d4c0a7 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 _0xb903=['options','raw','then','stringify','UpdateFaxMessage','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','FaxMessage','create','body'];(function(_0xdde858,_0xd01b73){var _0x400131=function(_0x42ebd9){while(--_0x42ebd9){_0xdde858['push'](_0xdde858['shift']());}};_0x400131(++_0xd01b73);}(_0xb903,0x185));var _0x3b90=function(_0x3ca93c,_0x35947c){_0x3ca93c=_0x3ca93c-0x0;var _0x3fbe83=_0xb903[_0x3ca93c];return _0x3fbe83;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3b90('0xc')],{'host':_0x3b90('0xd'),'port':0x18eb});var socket=require(_0x3b90('0xe'))(new Redis(config[_0x3b90('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x52401e,_0x51f916,_0x56261b){return new BPromise(function(_0x55db3f,_0x336913){return client[_0x3b90('0xf')](_0x52401e,_0x56261b)['then'](function(_0x30c49c){logger[_0x3b90('0x10')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x3b90('0x11'));logger[_0x3b90('0x12')](_0x3b90('0x13'),_0x51f916,'request\x20sent',JSON['stringify'](_0x30c49c));if(_0x30c49c[_0x3b90('0x14')]){if(_0x30c49c['error']['code']===0x1f4){logger[_0x3b90('0x14')](_0x3b90('0x15'),_0x51f916,_0x30c49c['error']['message']);return _0x336913(_0x30c49c[_0x3b90('0x14')][_0x3b90('0x16')]);}logger[_0x3b90('0x14')](_0x3b90('0x15'),_0x51f916,_0x30c49c[_0x3b90('0x14')]['message']);return _0x55db3f(_0x30c49c['error'][_0x3b90('0x16')]);}else{logger[_0x3b90('0x10')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x3b90('0x11'));_0x55db3f(_0x30c49c[_0x3b90('0x17')][_0x3b90('0x16')]);}})[_0x3b90('0x18')](function(_0x4f388b){logger[_0x3b90('0x14')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x4f388b);_0x336913(_0x4f388b);});});}exports[_0x3b90('0x19')]=function(_0x231690){var _0x535894=this;return new Promise(function(_0x39ae7c,_0x12e1cf){return db[_0x3b90('0x1a')][_0x3b90('0x1b')](_0x231690[_0x3b90('0x1c')],{'raw':_0x231690[_0x3b90('0x1d')]?_0x231690[_0x3b90('0x1d')][_0x3b90('0x1e')]===undefined?!![]:![]:!![]})[_0x3b90('0x1f')](function(_0x3e5bb8){logger['info'](_0x3b90('0x19'),_0x231690);logger[_0x3b90('0x12')](_0x3b90('0x19'),_0x231690,JSON[_0x3b90('0x20')](_0x3e5bb8));_0x39ae7c(_0x3e5bb8);})[_0x3b90('0x18')](function(_0x93b8e7){logger['error']('CreateFaxMessage',_0x93b8e7[_0x3b90('0x16')],_0x231690);_0x12e1cf(_0x535894[_0x3b90('0x14')](0x1f4,_0x93b8e7[_0x3b90('0x16')]));});});};exports[_0x3b90('0x21')]=function(_0x583523){var _0x414462=this;return new Promise(function(_0x2936d7,_0x1787d1){return db['FaxMessage'][_0x3b90('0x22')](_0x583523[_0x3b90('0x1c')],{'raw':_0x583523[_0x3b90('0x1d')]?_0x583523[_0x3b90('0x1d')][_0x3b90('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x583523[_0x3b90('0x1d')]?_0x583523['options'][_0x3b90('0x23')]||null:null,'attributes':_0x583523['options']?_0x583523[_0x3b90('0x1d')][_0x3b90('0x24')]||null:null,'limit':_0x583523[_0x3b90('0x1d')]?_0x583523[_0x3b90('0x1d')][_0x3b90('0x25')]||null:null})[_0x3b90('0x1f')](function(_0x290283){logger[_0x3b90('0x10')]('UpdateFaxMessage',_0x583523);logger['debug'](_0x3b90('0x21'),_0x583523,JSON[_0x3b90('0x20')](_0x290283));_0x2936d7(_0x290283);})[_0x3b90('0x18')](function(_0x1c2e84){logger['error']('UpdateFaxMessage',_0x1c2e84[_0x3b90('0x16')],_0x583523);_0x1787d1(_0x414462[_0x3b90('0x14')](0x1f4,_0x1c2e84[_0x3b90('0x16')]));});});}; \ No newline at end of file +var _0x6aa7=['redis','defaults','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','create','options','raw','catch','update','body','attributes','limit','UpdateFaxMessage','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x3e5932,_0x400ca5){var _0x2e66fa=function(_0x106ba0){while(--_0x106ba0){_0x3e5932['push'](_0x3e5932['shift']());}};_0x2e66fa(++_0x400ca5);}(_0x6aa7,0x178));var _0x76aa=function(_0x2cb08a,_0x508735){_0x2cb08a=_0x2cb08a-0x0;var _0x1a9a20=_0x6aa7[_0x2cb08a];return _0x1a9a20;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});config[_0x76aa('0x9')]=_[_0x76aa('0xa')](config[_0x76aa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0xb'))(new Redis(config[_0x76aa('0x9')]));require(_0x76aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xcd99aa,_0x25856d,_0x41643a){return new BPromise(function(_0x16cb50,_0x37f1ab){return client[_0x76aa('0xd')](_0xcd99aa,_0x41643a)[_0x76aa('0xe')](function(_0x8dc35c){logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,'request\x20sent');logger[_0x76aa('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x25856d,_0x76aa('0x12'),JSON[_0x76aa('0x13')](_0x8dc35c));if(_0x8dc35c[_0x76aa('0x14')]){if(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x25856d,_0x8dc35c[_0x76aa('0x14')]['message']);return _0x37f1ab(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x16')]);}logger['error'](_0x76aa('0x10'),_0x25856d,_0x8dc35c['error'][_0x76aa('0x16')]);return _0x16cb50(_0x8dc35c['error'][_0x76aa('0x16')]);}else{logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,_0x76aa('0x12'));_0x16cb50(_0x8dc35c[_0x76aa('0x17')][_0x76aa('0x16')]);}})['catch'](function(_0x5d6202){logger[_0x76aa('0x14')](_0x76aa('0x10'),_0x25856d,_0x5d6202);_0x37f1ab(_0x5d6202);});});}exports[_0x76aa('0x18')]=function(_0x15b931){var _0x15109b=this;return new Promise(function(_0x191560,_0x19af92){return db[_0x76aa('0x19')][_0x76aa('0x1a')](_0x15b931['body'],{'raw':_0x15b931[_0x76aa('0x1b')]?_0x15b931[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x41463a){logger[_0x76aa('0xf')](_0x76aa('0x18'),_0x15b931);logger[_0x76aa('0x11')](_0x76aa('0x18'),_0x15b931,JSON[_0x76aa('0x13')](_0x41463a));_0x191560(_0x41463a);})[_0x76aa('0x1d')](function(_0x3363b3){logger[_0x76aa('0x14')](_0x76aa('0x18'),_0x3363b3[_0x76aa('0x16')],_0x15b931);_0x19af92(_0x15109b[_0x76aa('0x14')](0x1f4,_0x3363b3[_0x76aa('0x16')]));});});};exports['UpdateFaxMessage']=function(_0xb5e8a9){var _0x1d6d15=this;return new Promise(function(_0x25c614,_0x2e7ab4){return db[_0x76aa('0x19')][_0x76aa('0x1e')](_0xb5e8a9[_0x76aa('0x1f')],{'raw':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb5e8a9['options']?_0xb5e8a9[_0x76aa('0x1b')]['where']||null:null,'attributes':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x20')]||null:null,'limit':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x21')]||null:null})[_0x76aa('0xe')](function(_0x3827ec){logger[_0x76aa('0xf')](_0x76aa('0x22'),_0xb5e8a9);logger['debug'](_0x76aa('0x22'),_0xb5e8a9,JSON[_0x76aa('0x13')](_0x3827ec));_0x25c614(_0x3827ec);})[_0x76aa('0x1d')](function(_0x928ccf){logger[_0x76aa('0x14')](_0x76aa('0x22'),_0x928ccf[_0x76aa('0x16')],_0xb5e8a9);_0x2e7ab4(_0x1d6d15['error'](0x1f4,_0x928ccf[_0x76aa('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 09ac418..18847f8 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 _0x307b=['update','emit','removeListener','register','length','faxMessage:','save','remove'];(function(_0x1f2a4c,_0x289773){var _0xe3c234=function(_0x201b8e){while(--_0x201b8e){_0x1f2a4c['push'](_0x1f2a4c['shift']());}};_0xe3c234(++_0x289773);}(_0x307b,0xc6));var _0xb307=function(_0x4b2c0e,_0x45c630){_0x4b2c0e=_0x4b2c0e-0x0;var _0x3ffc1b=_0x307b[_0x4b2c0e];return _0x3ffc1b;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xb307('0x0'),_0xb307('0x1'),_0xb307('0x2')];function createListener(_0x4f1687,_0x4bad29){return function(_0x4c9f4d){_0x4bad29[_0xb307('0x3')](_0x4f1687,_0x4c9f4d);};}function removeListener(_0x161a30,_0x586817){return function(){FaxMessageEvents[_0xb307('0x4')](_0x161a30,_0x586817);};}exports[_0xb307('0x5')]=function(_0xec63ce){for(var _0x4f23ad=0x0,_0x1d9b37=events[_0xb307('0x6')];_0x4f23ad<_0x1d9b37;_0x4f23ad++){var _0x14c658=events[_0x4f23ad];var _0x45d6d8=createListener(_0xb307('0x7')+_0x14c658,_0xec63ce);FaxMessageEvents['on'](_0x14c658,_0x45d6d8);}}; \ No newline at end of file +var _0x0de7=['update','emit','register','length','faxMessage:','./faxMessage.events','save'];(function(_0x411584,_0x1a94d4){var _0xce2649=function(_0x3f0b60){while(--_0x3f0b60){_0x411584['push'](_0x411584['shift']());}};_0xce2649(++_0x1a94d4);}(_0x0de7,0x171));var _0x70de=function(_0x1c4834,_0x1daccf){_0x1c4834=_0x1c4834-0x0;var _0x140214=_0x0de7[_0x1c4834];return _0x140214;};'use strict';var FaxMessageEvents=require(_0x70de('0x0'));var events=[_0x70de('0x1'),'remove',_0x70de('0x2')];function createListener(_0x18580a,_0x445197){return function(_0xb6309a){_0x445197[_0x70de('0x3')](_0x18580a,_0xb6309a);};}function removeListener(_0x2d3bcd,_0x22b0bc){return function(){FaxMessageEvents['removeListener'](_0x2d3bcd,_0x22b0bc);};}exports[_0x70de('0x4')]=function(_0x4dd630){for(var _0x1cc471=0x0,_0x2cc33e=events[_0x70de('0x5')];_0x1cc471<_0x2cc33e;_0x1cc471++){var _0x23fc54=events[_0x1cc471];var _0x5453b9=createListener(_0x70de('0x6')+_0x23fc54,_0x4dd630);FaxMessageEvents['on'](_0x23fc54,_0x5453b9);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 6e78539..5b02636 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9a7=['faxmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','post','tracked'];(function(_0x3630a7,_0x5a7d68){var _0x300b97=function(_0x1a4255){while(--_0x1a4255){_0x3630a7['push'](_0x3630a7['shift']());}};_0x300b97(++_0x5a7d68);}(_0xb9a7,0x112));var _0x7b9a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xb9a7[_0x36c5b0];return _0xf19333;};'use strict';var multer=require('multer');var util=require(_0x7b9a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b9a('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x7b9a('0x2'));var interaction=require(_0x7b9a('0x3'));var config=require(_0x7b9a('0x4'));var controller=require(_0x7b9a('0x5'));router[_0x7b9a('0x6')]('/',auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x8')]);router[_0x7b9a('0x6')](_0x7b9a('0x9'),auth[_0x7b9a('0x7')](),controller['describe']);router[_0x7b9a('0x6')](_0x7b9a('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7b9a('0xb'),auth[_0x7b9a('0x7')](),controller['download']);router[_0x7b9a('0xc')]('/',auth['isAuthenticated'](),interaction[_0x7b9a('0xd')]('fax',_0x7b9a('0xe')),controller[_0x7b9a('0xf')]);router[_0x7b9a('0x10')]('/:id',auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x11')]);router['put'](_0x7b9a('0x12'),auth[_0x7b9a('0x7')](),controller['accept']);router[_0x7b9a('0x10')](_0x7b9a('0x13'),auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x14')]);router[_0x7b9a('0x15')](_0x7b9a('0xa'),auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x16')]);module[_0x7b9a('0x17')]=router; \ No newline at end of file +var _0x9c00=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','/describe','isAuthenticated','describe','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','multer','util','express','Router'];(function(_0x4a0eae,_0x356d96){var _0x1e43fd=function(_0x172d54){while(--_0x172d54){_0x4a0eae['push'](_0x4a0eae['shift']());}};_0x1e43fd(++_0x356d96);}(_0x9c00,0x1a0));var _0x09c0=function(_0x504f4c,_0x1aedf0){_0x504f4c=_0x504f4c-0x0;var _0x3e7570=_0x9c00[_0x504f4c];return _0x3e7570;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x09c0('0x4'));var interaction=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var controller=require(_0x09c0('0x7'));router[_0x09c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c0('0x8')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xb')]);router[_0x09c0('0x8')]('/:id',auth[_0x09c0('0xa')](),controller[_0x09c0('0xc')]);router[_0x09c0('0x8')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xe')]);router[_0x09c0('0xf')]('/',auth[_0x09c0('0xa')](),interaction[_0x09c0('0x10')](_0x09c0('0x11'),_0x09c0('0x12')),controller[_0x09c0('0x13')]);router[_0x09c0('0x14')](_0x09c0('0x15'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x16')]);router[_0x09c0('0x14')](_0x09c0('0x17'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x18')]);router[_0x09c0('0x14')](_0x09c0('0x19'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x1a')]);router[_0x09c0('0x1b')](_0x09c0('0x15'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index be63ad1..d5d723a 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 _0x9de8=['ENUM','rrmemory','beepall','sequelize','STRING','name','INTEGER'];(function(_0x49ca95,_0x50c62b){var _0x4699f9=function(_0x5a27a0){while(--_0x5a27a0){_0x49ca95['push'](_0x49ca95['shift']());}};_0x4699f9(++_0x50c62b);}(_0x9de8,0x88));var _0x89de=function(_0x43b0db,_0x2ac059){_0x43b0db=_0x43b0db-0x0;var _0x34fa79=_0x9de8[_0x43b0db];return _0x34fa79;};'use strict';var Sequelize=require(_0x89de('0x0'));module['exports']={'name':{'type':Sequelize[_0x89de('0x1')],'unique':_0x89de('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x89de('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x89de('0x4')](_0x89de('0x5'),_0x89de('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf946=['exports','STRING','name','beepall','roundrobin','INTEGER','sequelize'];(function(_0x5f08a6,_0x400121){var _0x5d0641=function(_0x304467){while(--_0x304467){_0x5f08a6['push'](_0x5f08a6['shift']());}};_0x5d0641(++_0x400121);}(_0xf946,0x14f));var _0x6f94=function(_0x223889,_0x52eb10){_0x223889=_0x223889-0x0;var _0x7b59ae=_0xf946[_0x223889];return _0x7b59ae;};'use strict';var Sequelize=require(_0x6f94('0x0'));module[_0x6f94('0x1')]={'name':{'type':Sequelize[_0x6f94('0x2')],'unique':_0x6f94('0x3'),'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']('rrmemory',_0x6f94('0x4'),_0x6f94('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x6f94('0x6')],'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 e890c12..143906c 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 _0xa0a1=['lodash','squel','ioredis','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','json','destroy','get','FaxQueues','then','end','error','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','getOptions','where','include','findAll','rows','catch','show','params','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','update','describe','findOne','UserFaxQueue','hasOwnProperty','nolimit','sort','filter','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','faxPause','updatedAt','getTeams','Team','order','pick','addTeams','ids','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','userFaxQueue:save','select','field','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','compact','removeTeams','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','getAgents','bluebird'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x2c2174,_0x1f123c){_0x2c2174=_0x2c2174-0x0;var _0x530d3c=_0xa0a1[_0x2c2174];return _0x530d3c;};'use strict';var BPromise=require(_0x1a0a('0x0'));var util=require('util');var _=require(_0x1a0a('0x1'));var squel=require(_0x1a0a('0x2'));var Redis=require(_0x1a0a('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x1a0a('0x4'));var config=require(_0x1a0a('0x5'));var db=require('../../mysqldb')['db'];config[_0x1a0a('0x6')]=_[_0x1a0a('0x7')](config['redis'],{'host':_0x1a0a('0x8'),'port':0x18eb});var socket=require(_0x1a0a('0x9'))(new Redis(config[_0x1a0a('0x6')]));require(_0x1a0a('0xa'))[_0x1a0a('0xb')](socket);function respondWithStatusCode(_0x48d604,_0x2e5bec){_0x2e5bec=_0x2e5bec||0xcc;return function(_0x3c57b5){if(_0x3c57b5){return _0x48d604[_0x1a0a('0xc')](_0x2e5bec);}return _0x48d604['status'](_0x2e5bec)['end']();};}function respondWithResult(_0x53a060,_0x42277a){_0x42277a=_0x42277a||0xc8;return function(_0xf92e83){if(_0xf92e83){return _0x53a060[_0x1a0a('0xd')](_0x42277a)['json'](_0xf92e83);}};}function respondWithFilteredResult(_0x1d8bda,_0x4a0eda){return function(_0x280df2){if(_0x280df2){var _0x111e90=typeof _0x4a0eda[_0x1a0a('0xe')]===_0x1a0a('0xf')&&typeof _0x4a0eda[_0x1a0a('0x10')]===_0x1a0a('0xf');var _0x3f34d2=_0x280df2['count'];var _0x88d191=_0x111e90?0x0:_0x4a0eda[_0x1a0a('0xe')];var _0x3c531c=_0x111e90?_0x280df2[_0x1a0a('0x11')]:_0x4a0eda[_0x1a0a('0xe')]+_0x4a0eda['limit'];var _0x16b8c9;if(_0x3c531c>=_0x3f34d2){_0x3c531c=_0x3f34d2;_0x16b8c9=0xc8;}else{_0x16b8c9=0xce;}_0x1d8bda[_0x1a0a('0xd')](_0x16b8c9);return _0x1d8bda[_0x1a0a('0x12')]('Content-Range',_0x88d191+'-'+_0x3c531c+'/'+_0x3f34d2)[_0x1a0a('0x13')](_0x280df2);}return null;};}function saveUpdates(_0x57c942){return function(_0x20d307){if(_0x20d307){return _0x20d307['update'](_0x57c942)['then'](function(_0x3a988c){return _0x3a988c;});}return null;};}function removeEntity(_0x2a66b8){return function(_0x307fdc){if(_0x307fdc){return _0x307fdc[_0x1a0a('0x14')]()['then'](function(){var _0x56b8a5=_0x307fdc[_0x1a0a('0x15')]({'plain':!![]});var _0x40903a=_0x1a0a('0x16');return db['UserProfileResource'][_0x1a0a('0x14')]({'where':{'type':_0x40903a,'resourceId':_0x56b8a5['id']}})[_0x1a0a('0x17')](function(){return _0x307fdc;});})['then'](function(){_0x2a66b8[_0x1a0a('0xd')](0xcc)[_0x1a0a('0x18')]();});}};}function handleEntityNotFound(_0x316ae3){return function(_0x53e569){if(!_0x53e569){_0x316ae3[_0x1a0a('0xc')](0x194);}return _0x53e569;};}function handleError(_0xc33284,_0x1f4083){_0x1f4083=_0x1f4083||0x1f4;return function(_0x54e64e){logger[_0x1a0a('0x19')](_0x54e64e['stack']);if(_0x54e64e[_0x1a0a('0x1a')]){delete _0x54e64e[_0x1a0a('0x1a')];}_0xc33284[_0x1a0a('0xd')](_0x1f4083)[_0x1a0a('0x1b')](_0x54e64e);};}exports[_0x1a0a('0x1c')]=function(_0x578995,_0x1e2b28){var _0x8e4151={};var _0x561407={'count':0x0,'rows':[]};var _0x4cf939=_[_0x1a0a('0x1d')](db[_0x1a0a('0x1e')][_0x1a0a('0x1f')],function(_0x365ab5){return{'name':_0x365ab5[_0x1a0a('0x20')],'type':_0x365ab5[_0x1a0a('0x21')][_0x1a0a('0x22')]};});_0x8e4151=qs[_0x1a0a('0x23')](_0x4cf939,_0x578995);var _0x28b7e6={'where':_0x8e4151[_0x1a0a('0x24')]};return db[_0x1a0a('0x1e')][_0x1a0a('0x11')](_0x28b7e6)[_0x1a0a('0x17')](function(_0x385f2b){_0x561407[_0x1a0a('0x11')]=_0x385f2b;_0x8e4151[_0x1a0a('0x25')]=qs[_0x1a0a('0x25')](_0x578995['query']);return db[_0x1a0a('0x1e')][_0x1a0a('0x26')](_0x8e4151);})[_0x1a0a('0x17')](function(_0x39fb79){_0x561407[_0x1a0a('0x27')]=_0x39fb79;return _0x561407;})[_0x1a0a('0x17')](respondWithFilteredResult(_0x1e2b28,_0x8e4151))[_0x1a0a('0x28')](handleError(_0x1e2b28,null));};exports[_0x1a0a('0x29')]=function(_0x16a862,_0x2554c7){var _0x5de7a4={'raw':!![],'where':{'id':_0x16a862[_0x1a0a('0x2a')]['id']}},_0x2f72f4={};_0x2f72f4['model']=_[_0x1a0a('0x2b')](db['FaxQueue']['rawAttributes']);_0x2f72f4[_0x1a0a('0x2c')]=_[_0x1a0a('0x2b')](_0x16a862['query']);_0x2f72f4[_0x1a0a('0x2d')]=_[_0x1a0a('0x2e')](_0x2f72f4[_0x1a0a('0x2f')],_0x2f72f4['query']);_0x5de7a4[_0x1a0a('0x30')]=_[_0x1a0a('0x2e')](_0x2f72f4['model'],qs[_0x1a0a('0x31')](_0x16a862[_0x1a0a('0x2c')]['fields']));_0x5de7a4[_0x1a0a('0x30')]=_0x5de7a4[_0x1a0a('0x30')][_0x1a0a('0x32')]?_0x5de7a4[_0x1a0a('0x30')]:_0x2f72f4['model'];if(_0x16a862[_0x1a0a('0x2c')][_0x1a0a('0x33')]){_0x5de7a4[_0x1a0a('0x25')]=[{'all':!![]}];}_0x5de7a4=_[_0x1a0a('0x34')]({},_0x5de7a4,_0x16a862[_0x1a0a('0x35')]);return db[_0x1a0a('0x1e')][_0x1a0a('0x36')](_0x5de7a4)[_0x1a0a('0x17')](handleEntityNotFound(_0x2554c7,null))[_0x1a0a('0x17')](respondWithResult(_0x2554c7,null))['catch'](handleError(_0x2554c7,null));};exports['create']=function(_0x5bbbde,_0x50e4d7){return db[_0x1a0a('0x1e')]['create'](_0x5bbbde[_0x1a0a('0x37')],{})[_0x1a0a('0x17')](function(_0x57605a){var _0x5f586c=_0x5bbbde[_0x1a0a('0x38')][_0x1a0a('0x15')]({'plain':!![]});if(!_0x5f586c)throw new Error(_0x1a0a('0x39'));if(_0x5f586c[_0x1a0a('0x3a')]==='user'){var _0x250dd5=_0x57605a['get']({'plain':!![]});var _0x5aff39='FaxQueues';return db[_0x1a0a('0x3b')][_0x1a0a('0x36')]({'where':{'name':_0x5aff39,'userProfileId':_0x5f586c['userProfileId']},'raw':!![]})[_0x1a0a('0x17')](function(_0x2dcda5){if(_0x2dcda5&&_0x2dcda5['autoAssociation']===0x0){return db['UserProfileResource'][_0x1a0a('0x3c')]({'name':_0x250dd5[_0x1a0a('0x1a')],'resourceId':_0x250dd5['id'],'type':_0x2dcda5['name'],'sectionId':_0x2dcda5['id']},{})[_0x1a0a('0x17')](function(){return _0x57605a;});}else{return _0x57605a;}})[_0x1a0a('0x28')](function(_0x56cfd6){logger[_0x1a0a('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56cfd6);throw _0x56cfd6;});}return _0x57605a;})[_0x1a0a('0x17')](respondWithResult(_0x50e4d7,0xc9))['catch'](handleError(_0x50e4d7,null));};exports[_0x1a0a('0x3d')]=function(_0x7b6e14,_0x3466f6){if(_0x7b6e14[_0x1a0a('0x37')]['id']){delete _0x7b6e14['body']['id'];}return db[_0x1a0a('0x1e')][_0x1a0a('0x36')]({'where':{'id':_0x7b6e14[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x3466f6,null))['then'](saveUpdates(_0x7b6e14[_0x1a0a('0x37')],null))[_0x1a0a('0x17')](respondWithResult(_0x3466f6,null))['catch'](handleError(_0x3466f6,null));};exports[_0x1a0a('0x14')]=function(_0xfba0d,_0x89f654){return db[_0x1a0a('0x1e')][_0x1a0a('0x36')]({'where':{'id':_0xfba0d[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x89f654,null))[_0x1a0a('0x17')](removeEntity(_0x89f654,null))[_0x1a0a('0x28')](handleError(_0x89f654,null));};exports[_0x1a0a('0x3e')]=function(_0x5b07f0,_0x35c133){return db[_0x1a0a('0x1e')]['describe']()['then'](respondWithResult(_0x35c133,null))['catch'](handleError(_0x35c133,null));};exports['getMembers']=function(_0x455f57,_0x190bf9){var _0x48711d={'raw':!![],'where':{}},_0x5a591c={},_0x599d6e;return db[_0x1a0a('0x1e')][_0x1a0a('0x3f')]({'where':{'id':_0x455f57[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x190bf9,null))[_0x1a0a('0x17')](function(_0x167a5e){if(_0x167a5e){_0x599d6e=_0x167a5e[_0x1a0a('0x15')]({'plain':!![]});_0x5a591c[_0x1a0a('0x2f')]=_[_0x1a0a('0x2b')](db[_0x1a0a('0x40')][_0x1a0a('0x1f')]);_0x5a591c[_0x1a0a('0x2c')]=_[_0x1a0a('0x2b')](_0x455f57['query']);_0x5a591c[_0x1a0a('0x2d')]=_[_0x1a0a('0x2e')](_0x5a591c[_0x1a0a('0x2f')],_0x5a591c['query']);_0x48711d[_0x1a0a('0x30')]=_[_0x1a0a('0x2e')](_0x5a591c['model'],qs[_0x1a0a('0x31')](_0x455f57[_0x1a0a('0x2c')]['fields']));_0x48711d['attributes']=_0x48711d[_0x1a0a('0x30')]['length']?_0x48711d['attributes']:_0x5a591c[_0x1a0a('0x2f')];if(!_0x455f57['query'][_0x1a0a('0x41')](_0x1a0a('0x42'))){_0x48711d[_0x1a0a('0x10')]=qs[_0x1a0a('0x10')](_0x455f57[_0x1a0a('0x2c')][_0x1a0a('0x10')]);_0x48711d[_0x1a0a('0xe')]=qs[_0x1a0a('0xe')](_0x455f57[_0x1a0a('0x2c')][_0x1a0a('0xe')]);}_0x48711d['order']=qs[_0x1a0a('0x43')](_0x455f57['query'][_0x1a0a('0x43')]);_0x48711d[_0x1a0a('0x24')]=qs['filters'](_['pick'](_0x455f57[_0x1a0a('0x2c')],_0x5a591c[_0x1a0a('0x2d')]));_0x48711d['where']['FaxQueueId']=_0x167a5e['id'];if(_0x455f57[_0x1a0a('0x2c')]['filter']){_0x48711d[_0x1a0a('0x24')]=_[_0x1a0a('0x34')](_0x48711d['where'],{'$or':_[_0x1a0a('0x1d')](_0x48711d['attributes'],function(_0x243a40){var _0x405d56={};_0x405d56[_0x243a40]={'$like':'%'+_0x455f57['query'][_0x1a0a('0x44')]+'%'};return _0x405d56;})});}_0x48711d=_[_0x1a0a('0x34')]({},_0x48711d,_0x455f57[_0x1a0a('0x35')]);return db['UserFaxQueue'][_0x1a0a('0x26')](_0x48711d);}})[_0x1a0a('0x17')](function(_0x526502){if(_0x526502){return db['User'][_0x1a0a('0x45')]({'where':{'id':_[_0x1a0a('0x1d')](_0x526502,_0x1a0a('0x46')),'role':_0x1a0a('0x47')},'attributes':['id','name','faxPause','updatedAt',_0x1a0a('0x48')]});}})['then'](function(_0x10fd71){if(_0x10fd71){return{'count':_0x10fd71[_0x1a0a('0x11')],'rows':_[_0x1a0a('0x1d')](_0x10fd71[_0x1a0a('0x27')],function(_0x5f6b88){return{'membername':_0x5f6b88[_0x1a0a('0x1a')],'UserId':_0x5f6b88['id'],'queue_name':_0x599d6e[_0x1a0a('0x1a')],'FaxQueueId':_0x599d6e['id'],'interface':util[_0x1a0a('0x49')](_0x1a0a('0x4a'),_0x1a0a('0x4b'),_0x5f6b88[_0x1a0a('0x1a')]),'penalty':0x0,'paused':_0x5f6b88[_0x1a0a('0x4c')],'createdAt':_0x5f6b88[_0x1a0a('0x48')],'updatedAt':_0x5f6b88[_0x1a0a('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1a0a('0x17')](respondWithFilteredResult(_0x190bf9,_0x48711d))['catch'](handleError(_0x190bf9,null));};exports[_0x1a0a('0x4e')]=function(_0x26cb74,_0x388653){var _0x12c628={};var _0x581fcf={};var _0x21ae34;var _0x235e0e;return db[_0x1a0a('0x1e')][_0x1a0a('0x3f')]({'where':{'id':_0x26cb74[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x388653,null))[_0x1a0a('0x17')](function(_0x52cd1a){if(_0x52cd1a){_0x21ae34=_0x52cd1a;_0x581fcf[_0x1a0a('0x2f')]=_[_0x1a0a('0x2b')](db[_0x1a0a('0x4f')]['rawAttributes']);_0x581fcf[_0x1a0a('0x2c')]=_['keys'](_0x26cb74[_0x1a0a('0x2c')]);_0x581fcf['filters']=_[_0x1a0a('0x2e')](_0x581fcf[_0x1a0a('0x2f')],_0x581fcf[_0x1a0a('0x2c')]);_0x12c628[_0x1a0a('0x30')]=_[_0x1a0a('0x2e')](_0x581fcf['model'],qs[_0x1a0a('0x31')](_0x26cb74[_0x1a0a('0x2c')][_0x1a0a('0x31')]));_0x12c628[_0x1a0a('0x30')]=_0x12c628[_0x1a0a('0x30')][_0x1a0a('0x32')]?_0x12c628[_0x1a0a('0x30')]:_0x581fcf['model'];_0x12c628[_0x1a0a('0x50')]=qs[_0x1a0a('0x43')](_0x26cb74[_0x1a0a('0x2c')]['sort']);_0x12c628['where']=qs[_0x1a0a('0x2d')](_[_0x1a0a('0x51')](_0x26cb74[_0x1a0a('0x2c')],_0x581fcf[_0x1a0a('0x2d')]));if(_0x26cb74[_0x1a0a('0x2c')]['filter']){_0x12c628[_0x1a0a('0x24')]=_[_0x1a0a('0x34')](_0x12c628[_0x1a0a('0x24')],{'$or':_['map'](_0x12c628[_0x1a0a('0x30')],function(_0x95759e){var _0x3ca482={};_0x3ca482[_0x95759e]={'$like':'%'+_0x26cb74[_0x1a0a('0x2c')][_0x1a0a('0x44')]+'%'};return _0x3ca482;})});}_0x12c628=_[_0x1a0a('0x34')]({},_0x12c628,_0x26cb74[_0x1a0a('0x35')]);return _0x21ae34['getTeams'](_0x12c628);}})[_0x1a0a('0x17')](function(_0x239262){if(_0x239262){_0x235e0e=_0x239262[_0x1a0a('0x32')];if(!_0x26cb74['query'][_0x1a0a('0x41')](_0x1a0a('0x42'))){_0x12c628[_0x1a0a('0x10')]=qs[_0x1a0a('0x10')](_0x26cb74[_0x1a0a('0x2c')][_0x1a0a('0x10')]);_0x12c628[_0x1a0a('0xe')]=qs['offset'](_0x26cb74[_0x1a0a('0x2c')][_0x1a0a('0xe')]);}return _0x21ae34[_0x1a0a('0x4e')](_0x12c628);}})[_0x1a0a('0x17')](function(_0x465309){if(_0x465309){return _0x465309?{'count':_0x235e0e,'rows':_0x465309}:null;}})[_0x1a0a('0x17')](respondWithResult(_0x388653,null))[_0x1a0a('0x28')](handleError(_0x388653,null));};exports[_0x1a0a('0x52')]=function(_0x90f5ab,_0x51a1a9){var _0xc4e6f6=_0x90f5ab[_0x1a0a('0x37')][_0x1a0a('0x53')];return db[_0x1a0a('0x4f')][_0x1a0a('0x26')]({'where':{'id':_0xc4e6f6},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1a0a('0x54'),'attributes':['id',_0x1a0a('0x1a'),_0x1a0a('0x55'),_0x1a0a('0x56'),_0x1a0a('0x57')],'raw':!![]}]})[_0x1a0a('0x17')](function(_0x5bc782){if(_0x5bc782){var _0x51e1df=_['flatMap'](_0x5bc782,function(_0x149e3a){var _0xf8f874=_0x149e3a[_0x1a0a('0x15')]({'plain':!![]});return _0xf8f874['Agents'];});return db[_0x1a0a('0x1e')][_0x1a0a('0x36')]({'where':{'id':_0x90f5ab[_0x1a0a('0x2a')]['id']}})['then'](function(_0x138c4b){return db[_0x1a0a('0x58')]['transaction'](function(_0x279130){return _0x138c4b['addTeams'](_0xc4e6f6,{'transaction':_0x279130})['then'](function(){return BPromise[_0x1a0a('0x59')](_0x51e1df,function(_0x189c9f){return db[_0x1a0a('0x40')][_0x1a0a('0x5a')]({'where':{'UserId':_0x189c9f['id'],'FaxQueueId':_0x90f5ab[_0x1a0a('0x2a')]['id']},'transaction':_0x279130});});})[_0x1a0a('0x17')](function(){_0x51e1df[_0x1a0a('0x5b')](function(_0x2b35cf){socket['emit'](_0x1a0a('0x5c'),{'UserId':_0x2b35cf['id'],'FaxQueueId':_0x138c4b['id']});});});});});}})[_0x1a0a('0x17')](respondWithStatusCode(_0x51a1a9,null))[_0x1a0a('0x28')](handleError(_0x51a1a9,null));};exports['removeTeams']=function(_0x3a3c87,_0x4514d8){return db[_0x1a0a('0x4f')][_0x1a0a('0x26')]({'where':{'id':_0x3a3c87['query'][_0x1a0a('0x53')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1a0a('0x54'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4514d8,null))['then'](function(_0x17071b){var _0x1dee5d=_[_0x1a0a('0x1d')](_0x17071b,'id');var _0x5c6dcf=[];var _0x190000=[];var _0x20c6a9=squel[_0x1a0a('0x5d')]();_0x20c6a9[_0x1a0a('0x5e')]('tq.TeamId')[_0x1a0a('0x5f')](_0x1a0a('0x60'),'tq')[_0x1a0a('0x61')]('user_has_teams','ut',_0x1a0a('0x62'))[_0x1a0a('0x24')](_0x1a0a('0x63'),_0x3a3c87[_0x1a0a('0x2a')]['id']);for(var _0x2070d9=0x0;_0x2070d9<_0x17071b[_0x1a0a('0x32')];_0x2070d9+=0x1){let _0x31237a=_0x17071b[_0x2070d9];for(var _0x5b0d5f=0x0;_0x5b0d5f<_0x31237a[_0x1a0a('0x54')]['length'];_0x5b0d5f+=0x1){let _0x3a0525=_0x31237a[_0x1a0a('0x54')][_0x5b0d5f];var _0x5c21d2=_0x20c6a9['clone']();_0x5c21d2['where'](_0x1a0a('0x64'),_0x3a0525['id']);_0x190000['push'](db[_0x1a0a('0x58')][_0x1a0a('0x2c')](_0x5c21d2[_0x1a0a('0x65')](),{'type':db['sequelize']['QueryTypes'][_0x1a0a('0x66')]})[_0x1a0a('0x17')](function(_0x58aae1){if(_0x58aae1['length']===0x1){return _0x3a0525['id'];}else{var _0x32fbc5=_[_0x1a0a('0x67')](_[_0x1a0a('0x1d')](_0x58aae1,_0x1a0a('0x68')),function(_0x3ca218){return _[_0x1a0a('0x69')](_0x1dee5d,_0x3ca218);});if(_0x32fbc5){return _0x3a0525['id'];}}}));}}return BPromise['all'](_0x190000)[_0x1a0a('0x17')](function(_0xf2bdec){_0x5c6dcf=_(_0x5c6dcf)['union'](_0xf2bdec)[_0x1a0a('0x6a')]()['value']();return db[_0x1a0a('0x1e')]['find']({'where':{'id':_0x3a3c87['params']['id']}})['then'](function(_0x3767ef){return db['sequelize']['transaction'](function(_0x477bb6){return _0x3767ef[_0x1a0a('0x6b')](_0x3a3c87['query'][_0x1a0a('0x53')],{'transaction':_0x477bb6})[_0x1a0a('0x17')](function(){if(!_[_0x1a0a('0x6c')](_0x5c6dcf)){return _0x3767ef[_0x1a0a('0x6d')](_0x5c6dcf,{'transaction':_0x477bb6});}})['then'](function(){_0x5c6dcf[_0x1a0a('0x5b')](function(_0x552617){socket[_0x1a0a('0x6e')](_0x1a0a('0x6f'),{'UserId':_0x552617,'FaxQueueId':_0x3767ef['id']});});});});});});})[_0x1a0a('0x17')](respondWithStatusCode(_0x4514d8,null))['catch'](handleError(_0x4514d8,null));};exports['addAgents']=function(_0x18e50a,_0x208509){return db[_0x1a0a('0x1e')][_0x1a0a('0x36')]({'where':{'id':_0x18e50a[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x208509,null))[_0x1a0a('0x17')](function(_0x92a816){if(_0x92a816){return _0x92a816[_0x1a0a('0x70')](_0x18e50a[_0x1a0a('0x37')][_0x1a0a('0x53')],_[_0x1a0a('0x71')](_0x18e50a[_0x1a0a('0x37')],[_0x1a0a('0x53'),'id'])||{})[_0x1a0a('0x72')](function(_0xe28625){for(var _0x3b8bb7=0x0;_0x3b8bb7<_0x18e50a[_0x1a0a('0x37')][_0x1a0a('0x53')][_0x1a0a('0x32')];_0x3b8bb7+=0x1){socket[_0x1a0a('0x6e')](_0x1a0a('0x5c'),{'UserId':Number(_0x18e50a['body'][_0x1a0a('0x53')][_0x3b8bb7]),'FaxQueueId':Number(_0x18e50a['params']['id'])});}return _0xe28625;});}})[_0x1a0a('0x17')](respondWithResult(_0x208509,null))['catch'](handleError(_0x208509,null));};exports[_0x1a0a('0x6d')]=function(_0x36eb72,_0x4cdbf1){return db['FaxQueue'][_0x1a0a('0x36')]({'where':{'id':_0x36eb72[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x4cdbf1,null))['then'](function(_0x4a18dc){if(_0x4a18dc){return _0x4a18dc[_0x1a0a('0x6d')](_0x36eb72[_0x1a0a('0x2c')][_0x1a0a('0x53')])[_0x1a0a('0x17')](function(){if(_['isArray'](_0x36eb72[_0x1a0a('0x2c')][_0x1a0a('0x53')])){for(var _0x12e46f=0x0;_0x12e46f<_0x36eb72[_0x1a0a('0x2c')][_0x1a0a('0x53')][_0x1a0a('0x32')];_0x12e46f+=0x1){socket[_0x1a0a('0x6e')](_0x1a0a('0x6f'),{'UserId':Number(_0x36eb72[_0x1a0a('0x2c')][_0x1a0a('0x53')][_0x12e46f]),'FaxQueueId':Number(_0x36eb72[_0x1a0a('0x2a')]['id'])});}}else{socket[_0x1a0a('0x6e')](_0x1a0a('0x6f'),{'UserId':Number(_0x36eb72[_0x1a0a('0x2c')][_0x1a0a('0x53')]),'FaxQueueId':Number(_0x36eb72[_0x1a0a('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x4cdbf1,null))['catch'](handleError(_0x4cdbf1,null));};exports[_0x1a0a('0x73')]=function(_0x1b76fe,_0x5dbe62){var _0x1ac840={};var _0x1da6d3={};var _0x14785e;var _0x202c58;return db[_0x1a0a('0x1e')]['findOne']({'where':{'id':_0x1b76fe[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x5dbe62,null))[_0x1a0a('0x17')](function(_0x8ac572){if(_0x8ac572){_0x14785e=_0x8ac572;_0x1da6d3[_0x1a0a('0x2f')]=_['keys'](db['User'][_0x1a0a('0x1f')]);_0x1da6d3[_0x1a0a('0x2c')]=_[_0x1a0a('0x2b')](_0x1b76fe['query']);_0x1da6d3['filters']=_[_0x1a0a('0x2e')](_0x1da6d3[_0x1a0a('0x2f')],_0x1da6d3[_0x1a0a('0x2c')]);_0x1ac840[_0x1a0a('0x30')]=_[_0x1a0a('0x2e')](_0x1da6d3[_0x1a0a('0x2f')],qs[_0x1a0a('0x31')](_0x1b76fe[_0x1a0a('0x2c')][_0x1a0a('0x31')]));_0x1ac840[_0x1a0a('0x30')]=_0x1ac840[_0x1a0a('0x30')]['length']?_0x1ac840['attributes']:_0x1da6d3['model'];_0x1ac840[_0x1a0a('0x50')]=qs[_0x1a0a('0x43')](_0x1b76fe[_0x1a0a('0x2c')][_0x1a0a('0x43')]);_0x1ac840[_0x1a0a('0x24')]=qs['filters'](_[_0x1a0a('0x51')](_0x1b76fe[_0x1a0a('0x2c')],_0x1da6d3['filters']));if(_0x1b76fe[_0x1a0a('0x2c')][_0x1a0a('0x44')]){_0x1ac840[_0x1a0a('0x24')]=_[_0x1a0a('0x34')](_0x1ac840[_0x1a0a('0x24')],{'$or':_[_0x1a0a('0x1d')](_0x1ac840[_0x1a0a('0x30')],function(_0x5d777a){var _0x543d97={};_0x543d97[_0x5d777a]={'$like':'%'+_0x1b76fe[_0x1a0a('0x2c')][_0x1a0a('0x44')]+'%'};return _0x543d97;})});}_0x1ac840=_['merge']({},_0x1ac840,_0x1b76fe[_0x1a0a('0x35')]);return _0x14785e[_0x1a0a('0x73')](_0x1ac840);}})[_0x1a0a('0x17')](function(_0xf0a069){if(_0xf0a069){_0x202c58=_0xf0a069[_0x1a0a('0x32')];if(!_0x1b76fe[_0x1a0a('0x2c')]['hasOwnProperty'](_0x1a0a('0x42'))){_0x1ac840[_0x1a0a('0x10')]=qs['limit'](_0x1b76fe[_0x1a0a('0x2c')][_0x1a0a('0x10')]);_0x1ac840[_0x1a0a('0xe')]=qs[_0x1a0a('0xe')](_0x1b76fe[_0x1a0a('0x2c')][_0x1a0a('0xe')]);}return _0x14785e[_0x1a0a('0x73')](_0x1ac840);}})[_0x1a0a('0x17')](function(_0x23ee2d){if(_0x23ee2d){return _0x23ee2d?{'count':_0x202c58,'rows':_0x23ee2d}:null;}})[_0x1a0a('0x17')](respondWithResult(_0x5dbe62,null))[_0x1a0a('0x28')](handleError(_0x5dbe62,null));}; \ No newline at end of file +var _0x1261=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserFaxQueue','hasOwnProperty','nolimit','order','pick','FaxQueueId','filter','merge','findAll','findAndCountAll','agent','faxPause','createdAt','rows','format','%s/%s','SIP','updatedAt','getTeams','Team','sort','addTeams','ids','User','voicePause','interface','flatMap','transaction','each','forEach','userFaxQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userFaxQueue:remove','addAgents','omit','spread','emit','removeAgents','isArray','findOne','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','offset','undefined','limit','count','Content-Range','json','update','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','error','name','index','map','FaxQueue','fieldName','type','where','include','catch','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','options','find','create','user','role','UserProfileSection','userProfileId'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x1261,0x144));var _0x1126=function(_0x218756,_0x419c39){_0x218756=_0x218756-0x0;var _0x1b90ec=_0x1261[_0x218756];return _0x1b90ec;};'use strict';var BPromise=require('bluebird');var util=require(_0x1126('0x0'));var _=require(_0x1126('0x1'));var squel=require(_0x1126('0x2'));var Redis=require(_0x1126('0x3'));var qs=require(_0x1126('0x4'));var logger=require(_0x1126('0x5'))(_0x1126('0x6'));var config=require(_0x1126('0x7'));var db=require(_0x1126('0x8'))['db'];config[_0x1126('0x9')]=_['defaults'](config['redis'],{'host':_0x1126('0xa'),'port':0x18eb});var socket=require(_0x1126('0xb'))(new Redis(config['redis']));require(_0x1126('0xc'))[_0x1126('0xd')](socket);function respondWithStatusCode(_0x245be9,_0x3abb0b){_0x3abb0b=_0x3abb0b||0xcc;return function(_0x2d9033){if(_0x2d9033){return _0x245be9['sendStatus'](_0x3abb0b);}return _0x245be9[_0x1126('0xe')](_0x3abb0b)[_0x1126('0xf')]();};}function respondWithResult(_0x167ef1,_0x5e72e2){_0x5e72e2=_0x5e72e2||0xc8;return function(_0x34571c){if(_0x34571c){return _0x167ef1['status'](_0x5e72e2)['json'](_0x34571c);}};}function respondWithFilteredResult(_0x15c071,_0x561b93){return function(_0x15e89b){if(_0x15e89b){var _0x1b364a=typeof _0x561b93[_0x1126('0x10')]===_0x1126('0x11')&&typeof _0x561b93[_0x1126('0x12')]===_0x1126('0x11');var _0xd8ca42=_0x15e89b[_0x1126('0x13')];var _0x43850b=_0x1b364a?0x0:_0x561b93['offset'];var _0x5de9a7=_0x1b364a?_0x15e89b[_0x1126('0x13')]:_0x561b93[_0x1126('0x10')]+_0x561b93[_0x1126('0x12')];var _0x4be0c6;if(_0x5de9a7>=_0xd8ca42){_0x5de9a7=_0xd8ca42;_0x4be0c6=0xc8;}else{_0x4be0c6=0xce;}_0x15c071[_0x1126('0xe')](_0x4be0c6);return _0x15c071['set'](_0x1126('0x14'),_0x43850b+'-'+_0x5de9a7+'/'+_0xd8ca42)[_0x1126('0x15')](_0x15e89b);}return null;};}function saveUpdates(_0x257b5f){return function(_0x4e1c97){if(_0x4e1c97){return _0x4e1c97[_0x1126('0x16')](_0x257b5f)[_0x1126('0x17')](function(_0x4a7b49){return _0x4a7b49;});}return null;};}function removeEntity(_0x4d2b38){return function(_0x22ae0b){if(_0x22ae0b){return _0x22ae0b[_0x1126('0x18')]()['then'](function(){var _0x548359=_0x22ae0b[_0x1126('0x19')]({'plain':!![]});var _0x58b109=_0x1126('0x1a');return db[_0x1126('0x1b')][_0x1126('0x18')]({'where':{'type':_0x58b109,'resourceId':_0x548359['id']}})['then'](function(){return _0x22ae0b;});})[_0x1126('0x17')](function(){_0x4d2b38['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30f6b3){return function(_0x3a9bed){if(!_0x3a9bed){_0x30f6b3[_0x1126('0x1c')](0x194);}return _0x3a9bed;};}function handleError(_0x36d254,_0x526ca1){_0x526ca1=_0x526ca1||0x1f4;return function(_0x29ab60){logger[_0x1126('0x1d')](_0x29ab60['stack']);if(_0x29ab60[_0x1126('0x1e')]){delete _0x29ab60['name'];}_0x36d254['status'](_0x526ca1)['send'](_0x29ab60);};}exports[_0x1126('0x1f')]=function(_0x15bcc3,_0x329914){var _0x34bcf1={};var _0x566c09={'count':0x0,'rows':[]};var _0x1b07a7=_[_0x1126('0x20')](db[_0x1126('0x21')]['rawAttributes'],function(_0x35eec3){return{'name':_0x35eec3[_0x1126('0x22')],'type':_0x35eec3[_0x1126('0x23')]['key']};});_0x34bcf1=qs['getOptions'](_0x1b07a7,_0x15bcc3);var _0xeb7d89={'where':_0x34bcf1[_0x1126('0x24')]};return db['FaxQueue'][_0x1126('0x13')](_0xeb7d89)[_0x1126('0x17')](function(_0x4a334a){_0x566c09[_0x1126('0x13')]=_0x4a334a;_0x34bcf1['include']=qs[_0x1126('0x25')](_0x15bcc3['query']);return db[_0x1126('0x21')]['findAll'](_0x34bcf1);})[_0x1126('0x17')](function(_0x5f2611){_0x566c09['rows']=_0x5f2611;return _0x566c09;})['then'](respondWithFilteredResult(_0x329914,_0x34bcf1))[_0x1126('0x26')](handleError(_0x329914,null));};exports[_0x1126('0x27')]=function(_0x1cef48,_0x5b8bea){var _0x2a3055={'raw':!![],'where':{'id':_0x1cef48['params']['id']}},_0x226afb={};_0x226afb[_0x1126('0x28')]=_[_0x1126('0x29')](db[_0x1126('0x21')][_0x1126('0x2a')]);_0x226afb['query']=_['keys'](_0x1cef48[_0x1126('0x2b')]);_0x226afb[_0x1126('0x2c')]=_[_0x1126('0x2d')](_0x226afb[_0x1126('0x28')],_0x226afb['query']);_0x2a3055[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x226afb[_0x1126('0x28')],qs[_0x1126('0x2f')](_0x1cef48[_0x1126('0x2b')]['fields']));_0x2a3055[_0x1126('0x2e')]=_0x2a3055[_0x1126('0x2e')][_0x1126('0x30')]?_0x2a3055[_0x1126('0x2e')]:_0x226afb['model'];if(_0x1cef48['query'][_0x1126('0x31')]){_0x2a3055[_0x1126('0x25')]=[{'all':!![]}];}_0x2a3055=_['merge']({},_0x2a3055,_0x1cef48[_0x1126('0x32')]);return db[_0x1126('0x21')][_0x1126('0x33')](_0x2a3055)['then'](handleEntityNotFound(_0x5b8bea,null))['then'](respondWithResult(_0x5b8bea,null))[_0x1126('0x26')](handleError(_0x5b8bea,null));};exports[_0x1126('0x34')]=function(_0x3aa08f,_0x156554){return db['FaxQueue'][_0x1126('0x34')](_0x3aa08f['body'],{})[_0x1126('0x17')](function(_0x20e43a){var _0xfa96e0=_0x3aa08f[_0x1126('0x35')][_0x1126('0x19')]({'plain':!![]});if(!_0xfa96e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfa96e0[_0x1126('0x36')]===_0x1126('0x35')){var _0x2939a9=_0x20e43a[_0x1126('0x19')]({'plain':!![]});var _0x3469a2=_0x1126('0x1a');return db[_0x1126('0x37')]['find']({'where':{'name':_0x3469a2,'userProfileId':_0xfa96e0[_0x1126('0x38')]},'raw':!![]})[_0x1126('0x17')](function(_0x227a6b){if(_0x227a6b&&_0x227a6b[_0x1126('0x39')]===0x0){return db[_0x1126('0x1b')]['create']({'name':_0x2939a9['name'],'resourceId':_0x2939a9['id'],'type':_0x227a6b[_0x1126('0x1e')],'sectionId':_0x227a6b['id']},{})[_0x1126('0x17')](function(){return _0x20e43a;});}else{return _0x20e43a;}})[_0x1126('0x26')](function(_0x21c38e){logger[_0x1126('0x1d')](_0x1126('0x3a'),_0x21c38e);throw _0x21c38e;});}return _0x20e43a;})['then'](respondWithResult(_0x156554,0xc9))['catch'](handleError(_0x156554,null));};exports['update']=function(_0xb8054e,_0x5d4194){if(_0xb8054e[_0x1126('0x3b')]['id']){delete _0xb8054e[_0x1126('0x3b')]['id'];}return db[_0x1126('0x21')][_0x1126('0x33')]({'where':{'id':_0xb8054e['params']['id']}})['then'](handleEntityNotFound(_0x5d4194,null))[_0x1126('0x17')](saveUpdates(_0xb8054e[_0x1126('0x3b')],null))[_0x1126('0x17')](respondWithResult(_0x5d4194,null))['catch'](handleError(_0x5d4194,null));};exports[_0x1126('0x18')]=function(_0x5f35fa,_0x3a5f20){return db['FaxQueue'][_0x1126('0x33')]({'where':{'id':_0x5f35fa[_0x1126('0x3c')]['id']}})[_0x1126('0x17')](handleEntityNotFound(_0x3a5f20,null))['then'](removeEntity(_0x3a5f20,null))[_0x1126('0x26')](handleError(_0x3a5f20,null));};exports[_0x1126('0x3d')]=function(_0xf8ec5f,_0x48c694){return db['FaxQueue']['describe']()[_0x1126('0x17')](respondWithResult(_0x48c694,null))['catch'](handleError(_0x48c694,null));};exports[_0x1126('0x3e')]=function(_0x507568,_0x2f45b9){var _0x323499={'raw':!![],'where':{}},_0x146066={},_0x120de1;return db[_0x1126('0x21')]['findOne']({'where':{'id':_0x507568[_0x1126('0x3c')]['id']}})[_0x1126('0x17')](handleEntityNotFound(_0x2f45b9,null))['then'](function(_0x1a15f8){if(_0x1a15f8){_0x120de1=_0x1a15f8[_0x1126('0x19')]({'plain':!![]});_0x146066['model']=_[_0x1126('0x29')](db[_0x1126('0x3f')]['rawAttributes']);_0x146066[_0x1126('0x2b')]=_[_0x1126('0x29')](_0x507568[_0x1126('0x2b')]);_0x146066['filters']=_[_0x1126('0x2d')](_0x146066[_0x1126('0x28')],_0x146066[_0x1126('0x2b')]);_0x323499[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x146066[_0x1126('0x28')],qs[_0x1126('0x2f')](_0x507568[_0x1126('0x2b')]['fields']));_0x323499[_0x1126('0x2e')]=_0x323499['attributes'][_0x1126('0x30')]?_0x323499[_0x1126('0x2e')]:_0x146066['model'];if(!_0x507568['query'][_0x1126('0x40')](_0x1126('0x41'))){_0x323499[_0x1126('0x12')]=qs['limit'](_0x507568[_0x1126('0x2b')][_0x1126('0x12')]);_0x323499[_0x1126('0x10')]=qs[_0x1126('0x10')](_0x507568['query'][_0x1126('0x10')]);}_0x323499[_0x1126('0x42')]=qs['sort'](_0x507568['query']['sort']);_0x323499['where']=qs[_0x1126('0x2c')](_[_0x1126('0x43')](_0x507568['query'],_0x146066[_0x1126('0x2c')]));_0x323499[_0x1126('0x24')][_0x1126('0x44')]=_0x1a15f8['id'];if(_0x507568[_0x1126('0x2b')][_0x1126('0x45')]){_0x323499['where']=_[_0x1126('0x46')](_0x323499[_0x1126('0x24')],{'$or':_['map'](_0x323499[_0x1126('0x2e')],function(_0x476aca){var _0xcc9499={};_0xcc9499[_0x476aca]={'$like':'%'+_0x507568[_0x1126('0x2b')][_0x1126('0x45')]+'%'};return _0xcc9499;})});}_0x323499=_['merge']({},_0x323499,_0x507568[_0x1126('0x32')]);return db['UserFaxQueue'][_0x1126('0x47')](_0x323499);}})[_0x1126('0x17')](function(_0x33c971){if(_0x33c971){return db['User'][_0x1126('0x48')]({'where':{'id':_[_0x1126('0x20')](_0x33c971,'UserId'),'role':_0x1126('0x49')},'attributes':['id',_0x1126('0x1e'),_0x1126('0x4a'),'updatedAt',_0x1126('0x4b')]});}})[_0x1126('0x17')](function(_0x22ab18){if(_0x22ab18){return{'count':_0x22ab18[_0x1126('0x13')],'rows':_[_0x1126('0x20')](_0x22ab18[_0x1126('0x4c')],function(_0x30c848){return{'membername':_0x30c848[_0x1126('0x1e')],'UserId':_0x30c848['id'],'queue_name':_0x120de1['name'],'FaxQueueId':_0x120de1['id'],'interface':util[_0x1126('0x4d')](_0x1126('0x4e'),_0x1126('0x4f'),_0x30c848[_0x1126('0x1e')]),'penalty':0x0,'paused':_0x30c848[_0x1126('0x4a')],'createdAt':_0x30c848['createdAt'],'updatedAt':_0x30c848[_0x1126('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1126('0x17')](respondWithFilteredResult(_0x2f45b9,_0x323499))['catch'](handleError(_0x2f45b9,null));};exports[_0x1126('0x51')]=function(_0x5246aa,_0x272274){var _0x10ff91={};var _0x478806={};var _0x3062d6;var _0x21d4ef;return db[_0x1126('0x21')]['findOne']({'where':{'id':_0x5246aa[_0x1126('0x3c')]['id']}})['then'](handleEntityNotFound(_0x272274,null))['then'](function(_0xbdc58){if(_0xbdc58){_0x3062d6=_0xbdc58;_0x478806[_0x1126('0x28')]=_[_0x1126('0x29')](db[_0x1126('0x52')][_0x1126('0x2a')]);_0x478806[_0x1126('0x2b')]=_[_0x1126('0x29')](_0x5246aa['query']);_0x478806[_0x1126('0x2c')]=_[_0x1126('0x2d')](_0x478806[_0x1126('0x28')],_0x478806[_0x1126('0x2b')]);_0x10ff91[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x478806['model'],qs['fields'](_0x5246aa[_0x1126('0x2b')][_0x1126('0x2f')]));_0x10ff91['attributes']=_0x10ff91['attributes']['length']?_0x10ff91['attributes']:_0x478806[_0x1126('0x28')];_0x10ff91[_0x1126('0x42')]=qs[_0x1126('0x53')](_0x5246aa['query'][_0x1126('0x53')]);_0x10ff91[_0x1126('0x24')]=qs[_0x1126('0x2c')](_[_0x1126('0x43')](_0x5246aa[_0x1126('0x2b')],_0x478806[_0x1126('0x2c')]));if(_0x5246aa[_0x1126('0x2b')]['filter']){_0x10ff91[_0x1126('0x24')]=_[_0x1126('0x46')](_0x10ff91[_0x1126('0x24')],{'$or':_[_0x1126('0x20')](_0x10ff91[_0x1126('0x2e')],function(_0x56c003){var _0x5d758d={};_0x5d758d[_0x56c003]={'$like':'%'+_0x5246aa[_0x1126('0x2b')][_0x1126('0x45')]+'%'};return _0x5d758d;})});}_0x10ff91=_['merge']({},_0x10ff91,_0x5246aa[_0x1126('0x32')]);return _0x3062d6[_0x1126('0x51')](_0x10ff91);}})[_0x1126('0x17')](function(_0x6a41c0){if(_0x6a41c0){_0x21d4ef=_0x6a41c0[_0x1126('0x30')];if(!_0x5246aa[_0x1126('0x2b')][_0x1126('0x40')](_0x1126('0x41'))){_0x10ff91[_0x1126('0x12')]=qs[_0x1126('0x12')](_0x5246aa[_0x1126('0x2b')][_0x1126('0x12')]);_0x10ff91[_0x1126('0x10')]=qs['offset'](_0x5246aa[_0x1126('0x2b')][_0x1126('0x10')]);}return _0x3062d6[_0x1126('0x51')](_0x10ff91);}})['then'](function(_0x484881){if(_0x484881){return _0x484881?{'count':_0x21d4ef,'rows':_0x484881}:null;}})[_0x1126('0x17')](respondWithResult(_0x272274,null))[_0x1126('0x26')](handleError(_0x272274,null));};exports[_0x1126('0x54')]=function(_0x3bfeb8,_0x51929e){var _0x590ee9=_0x3bfeb8['body'][_0x1126('0x55')];return db[_0x1126('0x52')][_0x1126('0x47')]({'where':{'id':_0x590ee9},'attributes':['id'],'include':[{'model':db[_0x1126('0x56')],'as':'Agents','attributes':['id',_0x1126('0x1e'),'online',_0x1126('0x57'),_0x1126('0x58')],'raw':!![]}]})[_0x1126('0x17')](function(_0xe8bda7){if(_0xe8bda7){var _0x3263cf=_[_0x1126('0x59')](_0xe8bda7,function(_0x9a61b1){var _0x5f5a36=_0x9a61b1[_0x1126('0x19')]({'plain':!![]});return _0x5f5a36['Agents'];});return db[_0x1126('0x21')][_0x1126('0x33')]({'where':{'id':_0x3bfeb8['params']['id']}})[_0x1126('0x17')](function(_0x372fbe){return db['sequelize'][_0x1126('0x5a')](function(_0x1442ab){return _0x372fbe['addTeams'](_0x590ee9,{'transaction':_0x1442ab})['then'](function(){return BPromise[_0x1126('0x5b')](_0x3263cf,function(_0xa27290){return db[_0x1126('0x3f')]['findOrCreate']({'where':{'UserId':_0xa27290['id'],'FaxQueueId':_0x3bfeb8['params']['id']},'transaction':_0x1442ab});});})['then'](function(){_0x3263cf[_0x1126('0x5c')](function(_0x4e5b01){socket['emit'](_0x1126('0x5d'),{'UserId':_0x4e5b01['id'],'FaxQueueId':_0x372fbe['id']});});});});});}})['then'](respondWithStatusCode(_0x51929e,null))[_0x1126('0x26')](handleError(_0x51929e,null));};exports[_0x1126('0x5e')]=function(_0x51ccdc,_0x133075){return db[_0x1126('0x52')][_0x1126('0x47')]({'where':{'id':_0x51ccdc[_0x1126('0x2b')][_0x1126('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1126('0x5f'),'attributes':['id'],'raw':!![]}]})[_0x1126('0x17')](handleEntityNotFound(_0x133075,null))['then'](function(_0xd182b1){var _0x2d6fcf=_[_0x1126('0x20')](_0xd182b1,'id');var _0x2af2d0=[];var _0x2598a7=[];var _0x2cf3b9=squel[_0x1126('0x60')]();_0x2cf3b9[_0x1126('0x61')](_0x1126('0x62'))[_0x1126('0x63')](_0x1126('0x64'),'tq')[_0x1126('0x65')](_0x1126('0x66'),'ut',_0x1126('0x67'))[_0x1126('0x24')](_0x1126('0x68'),_0x51ccdc['params']['id']);for(var _0x31cfb5=0x0;_0x31cfb5<_0xd182b1[_0x1126('0x30')];_0x31cfb5+=0x1){let _0x33cccf=_0xd182b1[_0x31cfb5];for(var _0x1483f4=0x0;_0x1483f4<_0x33cccf[_0x1126('0x5f')]['length'];_0x1483f4+=0x1){let _0xd11e1f=_0x33cccf['Agents'][_0x1483f4];var _0x5bdb30=_0x2cf3b9[_0x1126('0x69')]();_0x5bdb30[_0x1126('0x24')]('ut.UserId\x20=\x20?',_0xd11e1f['id']);_0x2598a7['push'](db[_0x1126('0x6a')][_0x1126('0x2b')](_0x5bdb30[_0x1126('0x6b')](),{'type':db[_0x1126('0x6a')][_0x1126('0x6c')][_0x1126('0x6d')]})[_0x1126('0x17')](function(_0x35a9a4){if(_0x35a9a4[_0x1126('0x30')]===0x1){return _0xd11e1f['id'];}else{var _0x5644ea=_[_0x1126('0x6e')](_[_0x1126('0x20')](_0x35a9a4,_0x1126('0x6f')),function(_0xc69f7c){return _[_0x1126('0x70')](_0x2d6fcf,_0xc69f7c);});if(_0x5644ea){return _0xd11e1f['id'];}}}));}}return BPromise[_0x1126('0x71')](_0x2598a7)['then'](function(_0xadea7b){_0x2af2d0=_(_0x2af2d0)[_0x1126('0x72')](_0xadea7b)[_0x1126('0x73')]()[_0x1126('0x74')]();return db[_0x1126('0x21')][_0x1126('0x33')]({'where':{'id':_0x51ccdc[_0x1126('0x3c')]['id']}})[_0x1126('0x17')](function(_0x38eac6){return db[_0x1126('0x6a')]['transaction'](function(_0x50238d){return _0x38eac6[_0x1126('0x5e')](_0x51ccdc['query'][_0x1126('0x55')],{'transaction':_0x50238d})['then'](function(){if(!_[_0x1126('0x75')](_0x2af2d0)){return _0x38eac6['removeAgents'](_0x2af2d0,{'transaction':_0x50238d});}})[_0x1126('0x17')](function(){_0x2af2d0['forEach'](function(_0x5c5044){socket['emit'](_0x1126('0x76'),{'UserId':_0x5c5044,'FaxQueueId':_0x38eac6['id']});});});});});});})[_0x1126('0x17')](respondWithStatusCode(_0x133075,null))['catch'](handleError(_0x133075,null));};exports['addAgents']=function(_0x44325d,_0xe2f82d){return db[_0x1126('0x21')]['find']({'where':{'id':_0x44325d['params']['id']}})[_0x1126('0x17')](handleEntityNotFound(_0xe2f82d,null))['then'](function(_0x41679a){if(_0x41679a){return _0x41679a[_0x1126('0x77')](_0x44325d[_0x1126('0x3b')][_0x1126('0x55')],_[_0x1126('0x78')](_0x44325d['body'],['ids','id'])||{})[_0x1126('0x79')](function(_0xd808db){for(var _0xfc9fb4=0x0;_0xfc9fb4<_0x44325d[_0x1126('0x3b')][_0x1126('0x55')][_0x1126('0x30')];_0xfc9fb4+=0x1){socket[_0x1126('0x7a')](_0x1126('0x5d'),{'UserId':Number(_0x44325d[_0x1126('0x3b')][_0x1126('0x55')][_0xfc9fb4]),'FaxQueueId':Number(_0x44325d[_0x1126('0x3c')]['id'])});}return _0xd808db;});}})['then'](respondWithResult(_0xe2f82d,null))[_0x1126('0x26')](handleError(_0xe2f82d,null));};exports['removeAgents']=function(_0x99eb4e,_0x4ec8b9){return db[_0x1126('0x21')][_0x1126('0x33')]({'where':{'id':_0x99eb4e[_0x1126('0x3c')]['id']}})[_0x1126('0x17')](handleEntityNotFound(_0x4ec8b9,null))['then'](function(_0x429183){if(_0x429183){return _0x429183[_0x1126('0x7b')](_0x99eb4e['query']['ids'])[_0x1126('0x17')](function(){if(_[_0x1126('0x7c')](_0x99eb4e[_0x1126('0x2b')]['ids'])){for(var _0x8e044c=0x0;_0x8e044c<_0x99eb4e['query'][_0x1126('0x55')][_0x1126('0x30')];_0x8e044c+=0x1){socket['emit'](_0x1126('0x76'),{'UserId':Number(_0x99eb4e[_0x1126('0x2b')][_0x1126('0x55')][_0x8e044c]),'FaxQueueId':Number(_0x99eb4e[_0x1126('0x3c')]['id'])});}}else{socket[_0x1126('0x7a')]('userFaxQueue:remove',{'UserId':Number(_0x99eb4e[_0x1126('0x2b')][_0x1126('0x55')]),'FaxQueueId':Number(_0x99eb4e[_0x1126('0x3c')]['id'])});}});}})['then'](respondWithStatusCode(_0x4ec8b9,null))['catch'](handleError(_0x4ec8b9,null));};exports['getAgents']=function(_0x9d7607,_0x463051){var _0x1a7c9b={};var _0x2a1b22={};var _0x4fcca3;var _0x101553;return db[_0x1126('0x21')][_0x1126('0x7d')]({'where':{'id':_0x9d7607[_0x1126('0x3c')]['id']}})[_0x1126('0x17')](handleEntityNotFound(_0x463051,null))['then'](function(_0x1d5379){if(_0x1d5379){_0x4fcca3=_0x1d5379;_0x2a1b22[_0x1126('0x28')]=_['keys'](db[_0x1126('0x56')]['rawAttributes']);_0x2a1b22['query']=_[_0x1126('0x29')](_0x9d7607['query']);_0x2a1b22[_0x1126('0x2c')]=_[_0x1126('0x2d')](_0x2a1b22[_0x1126('0x28')],_0x2a1b22[_0x1126('0x2b')]);_0x1a7c9b[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x2a1b22[_0x1126('0x28')],qs[_0x1126('0x2f')](_0x9d7607[_0x1126('0x2b')]['fields']));_0x1a7c9b[_0x1126('0x2e')]=_0x1a7c9b[_0x1126('0x2e')][_0x1126('0x30')]?_0x1a7c9b[_0x1126('0x2e')]:_0x2a1b22['model'];_0x1a7c9b[_0x1126('0x42')]=qs[_0x1126('0x53')](_0x9d7607[_0x1126('0x2b')][_0x1126('0x53')]);_0x1a7c9b['where']=qs['filters'](_['pick'](_0x9d7607[_0x1126('0x2b')],_0x2a1b22['filters']));if(_0x9d7607[_0x1126('0x2b')][_0x1126('0x45')]){_0x1a7c9b['where']=_['merge'](_0x1a7c9b[_0x1126('0x24')],{'$or':_[_0x1126('0x20')](_0x1a7c9b['attributes'],function(_0x1e4172){var _0x1f9a7c={};_0x1f9a7c[_0x1e4172]={'$like':'%'+_0x9d7607['query'][_0x1126('0x45')]+'%'};return _0x1f9a7c;})});}_0x1a7c9b=_['merge']({},_0x1a7c9b,_0x9d7607[_0x1126('0x32')]);return _0x4fcca3[_0x1126('0x7e')](_0x1a7c9b);}})[_0x1126('0x17')](function(_0x4b65d8){if(_0x4b65d8){_0x101553=_0x4b65d8[_0x1126('0x30')];if(!_0x9d7607[_0x1126('0x2b')][_0x1126('0x40')](_0x1126('0x41'))){_0x1a7c9b[_0x1126('0x12')]=qs[_0x1126('0x12')](_0x9d7607[_0x1126('0x2b')][_0x1126('0x12')]);_0x1a7c9b[_0x1126('0x10')]=qs[_0x1126('0x10')](_0x9d7607[_0x1126('0x2b')][_0x1126('0x10')]);}return _0x4fcca3[_0x1126('0x7e')](_0x1a7c9b);}})[_0x1126('0x17')](function(_0x12ffa5){if(_0x12ffa5){return _0x12ffa5?{'count':_0x101553,'rows':_0x12ffa5}:null;}})[_0x1126('0x17')](respondWithResult(_0x463051,null))[_0x1126('0x26')](handleError(_0x463051,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 1f6618f..1d8ac8b 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 _0xd705=['hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4151e5,_0x2b12c3){var _0x18f4ab=function(_0x3c3dc1){while(--_0x3c3dc1){_0x4151e5['push'](_0x4151e5['shift']());}};_0x18f4ab(++_0x2b12c3);}(_0xd705,0xf4));var _0x5d70=function(_0x51b3cf,_0x1929ca){_0x51b3cf=_0x51b3cf-0x0;var _0x5217ed=_0xd705[_0x51b3cf];return _0x5217ed;};'use strict';var EventEmitter=require(_0x5d70('0x0'));var FaxQueue=require(_0x5d70('0x1'))['db'][_0x5d70('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5d70('0x3')](0x0);var events={'afterCreate':_0x5d70('0x4'),'afterUpdate':_0x5d70('0x5'),'afterDestroy':_0x5d70('0x6')};function emitEvent(_0x4434b3){return function(_0x1e1938,_0x530147,_0x1fa66f){FaxQueueEvents[_0x5d70('0x7')](_0x4434b3+':'+_0x1e1938['id'],_0x1e1938);FaxQueueEvents[_0x5d70('0x7')](_0x4434b3,_0x1e1938);_0x1fa66f(null);};}for(var e in events){if(events[_0x5d70('0x8')](e)){var event=events[e];FaxQueue[_0x5d70('0x9')](e,emitEvent(event));}}module[_0x5d70('0xa')]=FaxQueueEvents; \ No newline at end of file +var _0xca0d=['save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xca0d,0x16e));var _0xdca0=function(_0xdb27e3,_0x449e77){_0xdb27e3=_0xdb27e3-0x0;var _0x140963=_0xca0d[_0xdb27e3];return _0x140963;};'use strict';var EventEmitter=require(_0xdca0('0x0'));var FaxQueue=require(_0xdca0('0x1'))['db'][_0xdca0('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xdca0('0x3')](0x0);var events={'afterCreate':_0xdca0('0x4'),'afterUpdate':_0xdca0('0x5'),'afterDestroy':_0xdca0('0x6')};function emitEvent(_0x4ca8cb){return function(_0x6bc72c,_0x4b609a,_0x1cbd6){FaxQueueEvents['emit'](_0x4ca8cb+':'+_0x6bc72c['id'],_0x6bc72c);FaxQueueEvents['emit'](_0x4ca8cb,_0x6bc72c);_0x1cbd6(null);};}for(var e in events){if(events[_0xdca0('0x7')](e)){var event=events[e];FaxQueue[_0xdca0('0x8')](e,emitEvent(event));}}module[_0xdca0('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 2daec9c..852148f 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 _0xf0f0=['exports','FaxQueue','fax_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes'];(function(_0x4f1369,_0x4c595c){var _0xcd26a4=function(_0x1a8515){while(--_0x1a8515){_0x4f1369['push'](_0x4f1369['shift']());}};_0xcd26a4(++_0x4c595c);}(_0xf0f0,0x13b));var _0x0f0f=function(_0x479e24,_0x463bc3){_0x479e24=_0x479e24-0x0;var _0x1ad525=_0xf0f0[_0x479e24];return _0x1ad525;};'use strict';var _=require(_0x0f0f('0x0'));var util=require(_0x0f0f('0x1'));var logger=require('../../config/logger')(_0x0f0f('0x2'));var moment=require(_0x0f0f('0x3'));var BPromise=require(_0x0f0f('0x4'));var rp=require(_0x0f0f('0x5'));var fs=require('fs');var path=require(_0x0f0f('0x6'));var rimraf=require(_0x0f0f('0x7'));var config=require(_0x0f0f('0x8'));var attributes=require(_0x0f0f('0x9'));module[_0x0f0f('0xa')]=function(_0x22cff4,_0x50fc2f){return _0x22cff4['define'](_0x0f0f('0xb'),attributes,{'tableName':_0x0f0f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e47=['exports','define','fax_queues','lodash','api','bluebird','path','../../config/environment','./faxQueue.attributes'];(function(_0x455177,_0x5aad52){var _0x152c9d=function(_0x2e12a4){while(--_0x2e12a4){_0x455177['push'](_0x455177['shift']());}};_0x152c9d(++_0x5aad52);}(_0x8e47,0xed));var _0x78e4=function(_0x656222,_0x158bdc){_0x656222=_0x656222-0x0;var _0x20790b=_0x8e47[_0x656222];return _0x20790b;};'use strict';var _=require(_0x78e4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x78e4('0x1'));var moment=require('moment');var BPromise=require(_0x78e4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x78e4('0x3'));var rimraf=require('rimraf');var config=require(_0x78e4('0x4'));var attributes=require(_0x78e4('0x5'));module[_0x78e4('0x6')]=function(_0x4a12a1,_0x17e8fe){return _0x4a12a1[_0x78e4('0x7')]('FaxQueue',attributes,{'tableName':_0x78e4('0x8'),'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 e1071fe..433a7c9 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 _0xd00b=['../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','include','map','model','ShowFaxQueue','find','lodash','util','../../mysqldb','../../config/utils'];(function(_0x15f471,_0x264503){var _0x152728=function(_0x3d0303){while(--_0x3d0303){_0x15f471['push'](_0x15f471['shift']());}};_0x152728(++_0x264503);}(_0xd00b,0x1b4));var _0xbd00=function(_0x4aa17d,_0x4ae1c3){_0x4aa17d=_0x4aa17d-0x0;var _0x22fce0=_0xd00b[_0x4aa17d];return _0x22fce0;};'use strict';var _=require(_0xbd00('0x0'));var util=require(_0xbd00('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd00('0x2'))['db'];var utils=require(_0xbd00('0x3'));var logger=require(_0xbd00('0x4'))('rpc');var config=require(_0xbd00('0x5'));var jayson=require(_0xbd00('0x6'));var client=jayson[_0xbd00('0x7')][_0xbd00('0x8')]({'port':0x232a});config['redis']=_[_0xbd00('0x9')](config[_0xbd00('0xa')],{'host':_0xbd00('0xb'),'port':0x18eb});var socket=require(_0xbd00('0xc'))(new Redis(config[_0xbd00('0xa')]));require(_0xbd00('0xd'))[_0xbd00('0xe')](socket);function respondWithRpcPromise(_0x2bf360,_0x1403f1,_0x235056){return new BPromise(function(_0x277a11,_0x25d278){return client[_0xbd00('0xf')](_0x2bf360,_0x235056)[_0xbd00('0x10')](function(_0x4e93c7){logger[_0xbd00('0x11')]('FaxQueue,\x20%s,\x20%s',_0x1403f1,_0xbd00('0x12'));logger[_0xbd00('0x13')](_0xbd00('0x14'),_0x1403f1,'request\x20sent',JSON[_0xbd00('0x15')](_0x4e93c7));if(_0x4e93c7['error']){if(_0x4e93c7[_0xbd00('0x16')][_0xbd00('0x17')]===0x1f4){logger[_0xbd00('0x16')](_0xbd00('0x18'),_0x1403f1,_0x4e93c7[_0xbd00('0x16')]['message']);return _0x25d278(_0x4e93c7['error'][_0xbd00('0x19')]);}logger[_0xbd00('0x16')](_0xbd00('0x18'),_0x1403f1,_0x4e93c7[_0xbd00('0x16')][_0xbd00('0x19')]);return _0x277a11(_0x4e93c7[_0xbd00('0x16')]['message']);}else{logger[_0xbd00('0x11')](_0xbd00('0x18'),_0x1403f1,_0xbd00('0x12'));_0x277a11(_0x4e93c7[_0xbd00('0x1a')]['message']);}})[_0xbd00('0x1b')](function(_0xfcf7e5){logger['error'](_0xbd00('0x18'),_0x1403f1,_0xfcf7e5);_0x25d278(_0xfcf7e5);});});}exports[_0xbd00('0x1c')]=function(_0x4cba38){var _0x2c65e7=this;return new Promise(function(_0x59cf9e,_0x2f61c8){return db[_0xbd00('0x1d')][_0xbd00('0x1e')]({'raw':_0x4cba38[_0xbd00('0x1f')]?_0x4cba38['options'][_0xbd00('0x20')]===undefined?!![]:![]:!![],'where':_0x4cba38['options']?_0x4cba38['options'][_0xbd00('0x21')]||null:null,'attributes':_0x4cba38[_0xbd00('0x1f')]?_0x4cba38[_0xbd00('0x1f')][_0xbd00('0x22')]||null:null,'limit':_0x4cba38[_0xbd00('0x1f')]?_0x4cba38[_0xbd00('0x1f')]['limit']||null:null,'include':_0x4cba38['options']?_0x4cba38[_0xbd00('0x1f')][_0xbd00('0x23')]?_[_0xbd00('0x24')](_0x4cba38[_0xbd00('0x1f')][_0xbd00('0x23')],function(_0x47c8e2){return{'model':db[_0x47c8e2[_0xbd00('0x25')]],'as':_0x47c8e2['as'],'attributes':_0x47c8e2[_0xbd00('0x22')],'include':_0x47c8e2[_0xbd00('0x23')]?_[_0xbd00('0x24')](_0x47c8e2['include'],function(_0x29a113){return{'model':db[_0x29a113['model']],'as':_0x29a113['as'],'attributes':_0x29a113[_0xbd00('0x22')],'include':_0x29a113[_0xbd00('0x23')]?_['map'](_0x29a113['include'],function(_0x2de5b4){return{'model':db[_0x2de5b4[_0xbd00('0x25')]],'as':_0x2de5b4['as'],'attributes':_0x2de5b4[_0xbd00('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbd00('0x10')](function(_0x5d04db){logger['info'](_0xbd00('0x1c'),_0x4cba38);logger[_0xbd00('0x13')]('GetFaxQueue',_0x4cba38,JSON['stringify'](_0x5d04db));_0x59cf9e(_0x5d04db);})['catch'](function(_0xe199f7){logger['error'](_0xbd00('0x1c'),_0xe199f7['message'],_0x4cba38);_0x2f61c8(_0x2c65e7[_0xbd00('0x16')](0x1f4,_0xe199f7[_0xbd00('0x19')]));});});};exports[_0xbd00('0x26')]=function(_0x1571fe){var _0x401423=this;return new Promise(function(_0x279fb4,_0x19585a){return db[_0xbd00('0x1d')][_0xbd00('0x27')]({'raw':_0x1571fe[_0xbd00('0x1f')]?_0x1571fe[_0xbd00('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1571fe['options']?_0x1571fe['options'][_0xbd00('0x21')]||null:null,'attributes':_0x1571fe[_0xbd00('0x1f')]?_0x1571fe[_0xbd00('0x1f')][_0xbd00('0x22')]||null:null,'include':_0x1571fe[_0xbd00('0x1f')]?_0x1571fe[_0xbd00('0x1f')][_0xbd00('0x23')]?_['map'](_0x1571fe[_0xbd00('0x1f')][_0xbd00('0x23')],function(_0x516f2f){return{'model':db[_0x516f2f['model']],'as':_0x516f2f['as'],'attributes':_0x516f2f[_0xbd00('0x22')],'include':_0x516f2f['include']?_[_0xbd00('0x24')](_0x516f2f[_0xbd00('0x23')],function(_0x3e5170){return{'model':db[_0x3e5170['model']],'as':_0x3e5170['as'],'attributes':_0x3e5170['attributes'],'include':_0x3e5170['include']?_['map'](_0x3e5170[_0xbd00('0x23')],function(_0x35d4e4){return{'model':db[_0x35d4e4[_0xbd00('0x25')]],'as':_0x35d4e4['as'],'attributes':_0x35d4e4[_0xbd00('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbd00('0x10')](function(_0x358ba3){logger['info'](_0xbd00('0x26'),_0x1571fe);logger[_0xbd00('0x13')]('ShowFaxQueue',_0x1571fe,JSON['stringify'](_0x358ba3));_0x279fb4(_0x358ba3);})[_0xbd00('0x1b')](function(_0x44b22f){logger[_0xbd00('0x16')](_0xbd00('0x26'),_0x44b22f[_0xbd00('0x19')],_0x1571fe);_0x19585a(_0x401423[_0xbd00('0x16')](0x1f4,_0x44b22f['message']));});});}; \ No newline at end of file +var _0x3ae8=['model','attributes','debug','catch','FaxQueue','raw','ShowFaxQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','request','then','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetFaxQueue','findAll','options','where','limit','include','map'];(function(_0x3b2369,_0x4c68b9){var _0x5a1367=function(_0x58ddcf){while(--_0x58ddcf){_0x3b2369['push'](_0x3b2369['shift']());}};_0x5a1367(++_0x4c68b9);}(_0x3ae8,0x1cf));var _0x83ae=function(_0x67c3be,_0x4db79c){_0x67c3be=_0x67c3be-0x0;var _0xba13e5=_0x3ae8[_0x67c3be];return _0xba13e5;};'use strict';var _=require('lodash');var util=require(_0x83ae('0x0'));var moment=require(_0x83ae('0x1'));var BPromise=require(_0x83ae('0x2'));var rs=require(_0x83ae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83ae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x83ae('0x5'))(_0x83ae('0x6'));var config=require(_0x83ae('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x83ae('0x8')]['http']({'port':0x232a});config['redis']=_[_0x83ae('0x9')](config[_0x83ae('0xa')],{'host':_0x83ae('0xb'),'port':0x18eb});var socket=require(_0x83ae('0xc'))(new Redis(config[_0x83ae('0xa')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x202980,_0x358b86,_0x37a84e){return new BPromise(function(_0x921ce0,_0x11bcc4){return client[_0x83ae('0xd')](_0x202980,_0x37a84e)[_0x83ae('0xe')](function(_0x4aba43){logger[_0x83ae('0xf')](_0x83ae('0x10'),_0x358b86,'request\x20sent');logger['debug'](_0x83ae('0x11'),_0x358b86,_0x83ae('0x12'),JSON[_0x83ae('0x13')](_0x4aba43));if(_0x4aba43[_0x83ae('0x14')]){if(_0x4aba43['error'][_0x83ae('0x15')]===0x1f4){logger[_0x83ae('0x14')]('FaxQueue,\x20%s,\x20%s',_0x358b86,_0x4aba43['error']['message']);return _0x11bcc4(_0x4aba43[_0x83ae('0x14')][_0x83ae('0x16')]);}logger[_0x83ae('0x14')](_0x83ae('0x10'),_0x358b86,_0x4aba43['error']['message']);return _0x921ce0(_0x4aba43[_0x83ae('0x14')][_0x83ae('0x16')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x358b86,_0x83ae('0x12'));_0x921ce0(_0x4aba43[_0x83ae('0x17')][_0x83ae('0x16')]);}})['catch'](function(_0x1480e0){logger[_0x83ae('0x14')](_0x83ae('0x10'),_0x358b86,_0x1480e0);_0x11bcc4(_0x1480e0);});});}exports[_0x83ae('0x18')]=function(_0x977503){var _0x54e122=this;return new Promise(function(_0xae1af5,_0x299394){return db['FaxQueue'][_0x83ae('0x19')]({'raw':_0x977503[_0x83ae('0x1a')]?_0x977503[_0x83ae('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x977503[_0x83ae('0x1a')]?_0x977503[_0x83ae('0x1a')][_0x83ae('0x1b')]||null:null,'attributes':_0x977503[_0x83ae('0x1a')]?_0x977503[_0x83ae('0x1a')]['attributes']||null:null,'limit':_0x977503['options']?_0x977503['options'][_0x83ae('0x1c')]||null:null,'include':_0x977503[_0x83ae('0x1a')]?_0x977503[_0x83ae('0x1a')][_0x83ae('0x1d')]?_[_0x83ae('0x1e')](_0x977503[_0x83ae('0x1a')][_0x83ae('0x1d')],function(_0x257a9d){return{'model':db[_0x257a9d[_0x83ae('0x1f')]],'as':_0x257a9d['as'],'attributes':_0x257a9d[_0x83ae('0x20')],'include':_0x257a9d[_0x83ae('0x1d')]?_[_0x83ae('0x1e')](_0x257a9d[_0x83ae('0x1d')],function(_0x37d3e5){return{'model':db[_0x37d3e5[_0x83ae('0x1f')]],'as':_0x37d3e5['as'],'attributes':_0x37d3e5['attributes'],'include':_0x37d3e5[_0x83ae('0x1d')]?_[_0x83ae('0x1e')](_0x37d3e5[_0x83ae('0x1d')],function(_0x136657){return{'model':db[_0x136657[_0x83ae('0x1f')]],'as':_0x136657['as'],'attributes':_0x136657[_0x83ae('0x20')]};}):[]};}):[]};}):[]:[]})[_0x83ae('0xe')](function(_0x2e9394){logger[_0x83ae('0xf')](_0x83ae('0x18'),_0x977503);logger[_0x83ae('0x21')]('GetFaxQueue',_0x977503,JSON['stringify'](_0x2e9394));_0xae1af5(_0x2e9394);})[_0x83ae('0x22')](function(_0x39a4dc){logger[_0x83ae('0x14')](_0x83ae('0x18'),_0x39a4dc[_0x83ae('0x16')],_0x977503);_0x299394(_0x54e122[_0x83ae('0x14')](0x1f4,_0x39a4dc['message']));});});};exports['ShowFaxQueue']=function(_0xe607e){var _0x1d82dc=this;return new Promise(function(_0x3b89dc,_0x56acb7){return db[_0x83ae('0x23')]['find']({'raw':_0xe607e[_0x83ae('0x1a')]?_0xe607e[_0x83ae('0x1a')][_0x83ae('0x24')]===undefined?!![]:![]:!![],'where':_0xe607e[_0x83ae('0x1a')]?_0xe607e[_0x83ae('0x1a')][_0x83ae('0x1b')]||null:null,'attributes':_0xe607e[_0x83ae('0x1a')]?_0xe607e['options'][_0x83ae('0x20')]||null:null,'include':_0xe607e[_0x83ae('0x1a')]?_0xe607e[_0x83ae('0x1a')][_0x83ae('0x1d')]?_[_0x83ae('0x1e')](_0xe607e[_0x83ae('0x1a')]['include'],function(_0x3601aa){return{'model':db[_0x3601aa['model']],'as':_0x3601aa['as'],'attributes':_0x3601aa[_0x83ae('0x20')],'include':_0x3601aa[_0x83ae('0x1d')]?_['map'](_0x3601aa[_0x83ae('0x1d')],function(_0x2aa2b6){return{'model':db[_0x2aa2b6[_0x83ae('0x1f')]],'as':_0x2aa2b6['as'],'attributes':_0x2aa2b6[_0x83ae('0x20')],'include':_0x2aa2b6[_0x83ae('0x1d')]?_[_0x83ae('0x1e')](_0x2aa2b6[_0x83ae('0x1d')],function(_0x47f591){return{'model':db[_0x47f591[_0x83ae('0x1f')]],'as':_0x47f591['as'],'attributes':_0x47f591[_0x83ae('0x20')]};}):[]};}):[]};}):[]:[]})[_0x83ae('0xe')](function(_0x4a5999){logger['info']('ShowFaxQueue',_0xe607e);logger[_0x83ae('0x21')](_0x83ae('0x25'),_0xe607e,JSON[_0x83ae('0x13')](_0x4a5999));_0x3b89dc(_0x4a5999);})[_0x83ae('0x22')](function(_0x4c437b){logger['error']('ShowFaxQueue',_0x4c437b[_0x83ae('0x16')],_0xe607e);_0x56acb7(_0x1d82dc[_0x83ae('0x14')](0x1f4,_0x4c437b[_0x83ae('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 67b1c28..04ead79 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 _0x873a=['length','faxQueue:','./faxQueue.events','save','remove','emit','removeListener','register'];(function(_0x33bcc2,_0x644e4){var _0x400614=function(_0x2e1497){while(--_0x2e1497){_0x33bcc2['push'](_0x33bcc2['shift']());}};_0x400614(++_0x644e4);}(_0x873a,0x1c2));var _0xa873=function(_0x2634c4,_0x19a43c){_0x2634c4=_0x2634c4-0x0;var _0xaa1212=_0x873a[_0x2634c4];return _0xaa1212;};'use strict';var FaxQueueEvents=require(_0xa873('0x0'));var events=[_0xa873('0x1'),_0xa873('0x2'),'update'];function createListener(_0x1de6be,_0x5733ee){return function(_0x52c086){_0x5733ee[_0xa873('0x3')](_0x1de6be,_0x52c086);};}function removeListener(_0x46971d,_0x5a0d23){return function(){FaxQueueEvents[_0xa873('0x4')](_0x46971d,_0x5a0d23);};}exports[_0xa873('0x5')]=function(_0x5c0d74){for(var _0x370b8a=0x0,_0x56f262=events[_0xa873('0x6')];_0x370b8a<_0x56f262;_0x370b8a++){var _0x43247f=events[_0x370b8a];var _0x265c05=createListener(_0xa873('0x7')+_0x43247f,_0x5c0d74);FaxQueueEvents['on'](_0x43247f,_0x265c05);}}; \ No newline at end of file +var _0x8ead=['emit','removeListener','length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x13a61d,_0x184e7b){var _0x5b2fff=function(_0x1d2b3a){while(--_0x1d2b3a){_0x13a61d['push'](_0x13a61d['shift']());}};_0x5b2fff(++_0x184e7b);}(_0x8ead,0xc4));var _0xd8ea=function(_0x48361c,_0x1fd25f){_0x48361c=_0x48361c-0x0;var _0x5a1928=_0x8ead[_0x48361c];return _0x5a1928;};'use strict';var FaxQueueEvents=require(_0xd8ea('0x0'));var events=[_0xd8ea('0x1'),_0xd8ea('0x2'),_0xd8ea('0x3')];function createListener(_0x3500a0,_0x1ccbf7){return function(_0x198711){_0x1ccbf7[_0xd8ea('0x4')](_0x3500a0,_0x198711);};}function removeListener(_0x41dfd3,_0x112e3f){return function(){FaxQueueEvents[_0xd8ea('0x5')](_0x41dfd3,_0x112e3f);};}exports['register']=function(_0x29d31b){for(var _0x2f7e0b=0x0,_0x53bf4a=events[_0xd8ea('0x6')];_0x2f7e0b<_0x53bf4a;_0x2f7e0b++){var _0x176374=events[_0x2f7e0b];var _0x228355=createListener(_0xd8ea('0x7')+_0x176374,_0x29d31b);FaxQueueEvents['on'](_0x176374,_0x228355);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 96705e9..724cce5 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 _0x7046=['../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','/:id','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3fb8d4,_0x50915d){var _0xa05e7c=function(_0x5d8557){while(--_0x5d8557){_0x3fb8d4['push'](_0x3fb8d4['shift']());}};_0xa05e7c(++_0x50915d);}(_0x7046,0x144));var _0x6704=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7046[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var fs_extra=require(_0x6704('0x5'));var auth=require(_0x6704('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6704('0x7'));var controller=require(_0x6704('0x8'));router[_0x6704('0x9')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0xb')]);router['get'](_0x6704('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x6704('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6704('0xd')]);router[_0x6704('0x9')](_0x6704('0xe'),auth[_0x6704('0xa')](),controller[_0x6704('0xf')]);router[_0x6704('0x9')](_0x6704('0x10'),auth[_0x6704('0xa')](),controller['getTeams']);router[_0x6704('0x9')](_0x6704('0x11'),auth['isAuthenticated'](),controller[_0x6704('0x12')]);router[_0x6704('0x13')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0x14')]);router[_0x6704('0x13')](_0x6704('0x10'),auth[_0x6704('0xa')](),controller[_0x6704('0x15')]);router[_0x6704('0x13')]('/:id/users',auth[_0x6704('0xa')](),controller[_0x6704('0x16')]);router[_0x6704('0x17')]('/:id',auth[_0x6704('0xa')](),controller[_0x6704('0x18')]);router[_0x6704('0x19')](_0x6704('0x1a'),auth[_0x6704('0xa')](),controller['destroy']);router[_0x6704('0x19')](_0x6704('0x10'),auth[_0x6704('0xa')](),controller[_0x6704('0x1b')]);router[_0x6704('0x19')]('/:id/users',auth[_0x6704('0xa')](),controller[_0x6704('0x1c')]);module[_0x6704('0x1d')]=router; \ No newline at end of file +var _0x0424=['addTeams','addAgents','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','create','post'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x0424,0x159));var _0x4042=function(_0x4084eb,_0x30c6ad){_0x4084eb=_0x4084eb-0x0;var _0x4c1f1c=_0x0424[_0x4084eb];return _0x4c1f1c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4042('0x0'));var timeout=require(_0x4042('0x1'));var express=require(_0x4042('0x2'));var router=express[_0x4042('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4042('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4042('0x5'));router[_0x4042('0x6')]('/',auth[_0x4042('0x7')](),controller[_0x4042('0x8')]);router[_0x4042('0x6')](_0x4042('0x9'),auth[_0x4042('0x7')](),controller['describe']);router['get'](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xb')]);router['get'](_0x4042('0xc'),auth[_0x4042('0x7')](),controller[_0x4042('0xd')]);router[_0x4042('0x6')](_0x4042('0xe'),auth[_0x4042('0x7')](),controller[_0x4042('0xf')]);router[_0x4042('0x6')]('/:id/users',auth[_0x4042('0x7')](),controller[_0x4042('0x10')]);router['post']('/',auth[_0x4042('0x7')](),controller[_0x4042('0x11')]);router[_0x4042('0x12')](_0x4042('0xe'),auth[_0x4042('0x7')](),controller[_0x4042('0x13')]);router[_0x4042('0x12')]('/:id/users',auth[_0x4042('0x7')](),controller[_0x4042('0x14')]);router['put'](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0x15')]);router[_0x4042('0x16')](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0x17')]);router[_0x4042('0x16')](_0x4042('0xe'),auth['isAuthenticated'](),controller[_0x4042('0x18')]);router['delete'](_0x4042('0x19'),auth['isAuthenticated'](),controller[_0x4042('0x1a')]);module[_0x4042('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 011e840..fd74fe1 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 _0xef39=['STRING','DATE','sequelize','exports'];(function(_0x583e53,_0x5a2e76){var _0x4ca938=function(_0x42ecfe){while(--_0x42ecfe){_0x583e53['push'](_0x583e53['shift']());}};_0x4ca938(++_0x5a2e76);}(_0xef39,0x92));var _0x9ef3=function(_0x46ace3,_0x14f9a9){_0x46ace3=_0x46ace3-0x0;var _0x41e033=_0xef39[_0x46ace3];return _0x41e033;};'use strict';var moment=require('moment');var Sequelize=require(_0x9ef3('0x0'));module[_0x9ef3('0x1')]={'uniqueid':{'type':Sequelize[_0x9ef3('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9ef3('0x2')]},'joinAt':{'type':Sequelize[_0x9ef3('0x3')]},'leaveAt':{'type':Sequelize[_0x9ef3('0x3')]},'acceptAt':{'type':Sequelize[_0x9ef3('0x3')]},'exitAt':{'type':Sequelize[_0x9ef3('0x3')]},'reason':{'type':Sequelize[_0x9ef3('0x2')]}}; \ No newline at end of file +var _0xbaa6=['exports','STRING','DATE','sequelize'];(function(_0x460ab5,_0x436933){var _0x16c379=function(_0xd80f74){while(--_0xd80f74){_0x460ab5['push'](_0x460ab5['shift']());}};_0x16c379(++_0x436933);}(_0xbaa6,0xef));var _0x6baa=function(_0x2211d4,_0x592254){_0x2211d4=_0x2211d4-0x0;var _0x565b56=_0xbaa6[_0x2211d4];return _0x565b56;};'use strict';var moment=require('moment');var Sequelize=require(_0x6baa('0x0'));module[_0x6baa('0x1')]={'uniqueid':{'type':Sequelize[_0x6baa('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6baa('0x2')]},'joinAt':{'type':Sequelize[_0x6baa('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x6baa('0x3')]},'exitAt':{'type':Sequelize[_0x6baa('0x3')]},'reason':{'type':Sequelize[_0x6baa('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index c21f637..857f1a0 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 _0x2a41=['to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','stack','name','index','map','FaxQueueReport','type','key','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js'];(function(_0x1512b2,_0x2c481e){var _0x230433=function(_0x5672a8){while(--_0x5672a8){_0x1512b2['push'](_0x1512b2['shift']());}};_0x230433(++_0x2c481e);}(_0x2a41,0x126));var _0x12a4=function(_0x4a9bdd,_0x5098f5){_0x4a9bdd=_0x4a9bdd-0x0;var _0x1ba3a4=_0x2a41[_0x4a9bdd];return _0x1ba3a4;};'use strict';var emlformat=require(_0x12a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x12a4('0x1'));var jsonpatch=require(_0x12a4('0x2'));var rp=require(_0x12a4('0x3'));var moment=require(_0x12a4('0x4'));var BPromise=require(_0x12a4('0x5'));var Mustache=require(_0x12a4('0x6'));var util=require(_0x12a4('0x7'));var path=require(_0x12a4('0x8'));var sox=require(_0x12a4('0x9'));var csv=require('to-csv');var ejs=require(_0x12a4('0xa'));var fs=require('fs');var fs_extra=require(_0x12a4('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x12a4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x12a4('0xd'));var toCsv=require(_0x12a4('0xe'));var querystring=require(_0x12a4('0xf'));var Papa=require(_0x12a4('0x10'));var Redis=require(_0x12a4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x12a4('0x12'));var as=require(_0x12a4('0x13'));var hardwareService=require(_0x12a4('0x14'));var logger=require(_0x12a4('0x15'))(_0x12a4('0x16'));var utils=require(_0x12a4('0x17'));var config=require(_0x12a4('0x18'));var licenseUtil=require(_0x12a4('0x19'));var db=require(_0x12a4('0x1a'))['db'];function respondWithStatusCode(_0x197554,_0x28059a){_0x28059a=_0x28059a||0xcc;return function(_0x2c939e){if(_0x2c939e){return _0x197554['sendStatus'](_0x28059a);}return _0x197554[_0x12a4('0x1b')](_0x28059a)[_0x12a4('0x1c')]();};}function respondWithResult(_0x1af5f8,_0x22cfde){_0x22cfde=_0x22cfde||0xc8;return function(_0x2b6e72){if(_0x2b6e72){return _0x1af5f8['status'](_0x22cfde)['json'](_0x2b6e72);}};}function respondWithFilteredResult(_0x257d27,_0x2ccfce){return function(_0x2428ba){if(_0x2428ba){var _0x1cce66=typeof _0x2ccfce['offset']===_0x12a4('0x1d')&&typeof _0x2ccfce[_0x12a4('0x1e')]===_0x12a4('0x1d');var _0x25d54f=_0x2428ba[_0x12a4('0x1f')];var _0xe274e1=_0x1cce66?0x0:_0x2ccfce['offset'];var _0x1a6bbe=_0x1cce66?_0x2428ba[_0x12a4('0x1f')]:_0x2ccfce[_0x12a4('0x20')]+_0x2ccfce['limit'];var _0x569763;if(_0x1a6bbe>=_0x25d54f){_0x1a6bbe=_0x25d54f;_0x569763=0xc8;}else{_0x569763=0xce;}_0x257d27[_0x12a4('0x1b')](_0x569763);return _0x257d27[_0x12a4('0x21')](_0x12a4('0x22'),_0xe274e1+'-'+_0x1a6bbe+'/'+_0x25d54f)[_0x12a4('0x23')](_0x2428ba);}return null;};}function patchUpdates(_0x1a35d3){return function(_0x5c92e8){try{jsonpatch[_0x12a4('0x24')](_0x5c92e8,_0x1a35d3,!![]);}catch(_0x5617d6){return BPromise[_0x12a4('0x25')](_0x5617d6);}return _0x5c92e8[_0x12a4('0x26')]();};}function saveUpdates(_0x40bf8e,_0x475939){return function(_0x17a4cc){if(_0x17a4cc){return _0x17a4cc['update'](_0x40bf8e)[_0x12a4('0x27')](function(_0x188930){return _0x188930;});}return null;};}function removeEntity(_0x35e966,_0x1c4255){return function(_0x499b22){if(_0x499b22){return _0x499b22[_0x12a4('0x28')]()[_0x12a4('0x27')](function(){_0x35e966[_0x12a4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x395749,_0x2f3cae){return function(_0x5950fe){if(!_0x5950fe){_0x395749[_0x12a4('0x29')](0x194);}return _0x5950fe;};}function handleError(_0xcb5f1f,_0x4f1c77){_0x4f1c77=_0x4f1c77||0x1f4;return function(_0x5e952f){logger['error'](_0x5e952f[_0x12a4('0x2a')]);if(_0x5e952f[_0x12a4('0x2b')]){delete _0x5e952f[_0x12a4('0x2b')];}_0xcb5f1f[_0x12a4('0x1b')](_0x4f1c77)['send'](_0x5e952f);};}exports[_0x12a4('0x2c')]=function(_0x56c3da,_0x1979d1){var _0x3c5584={},_0x377466={},_0x15adb7={'count':0x0,'rows':[]};var _0x56df0f=_[_0x12a4('0x2d')](db[_0x12a4('0x2e')]['rawAttributes'],function(_0x283668){return{'name':_0x283668['fieldName'],'type':_0x283668[_0x12a4('0x2f')][_0x12a4('0x30')]};});_0x377466['model']=_[_0x12a4('0x2d')](_0x56df0f,_0x12a4('0x2b'));_0x377466[_0x12a4('0x31')]=_['keys'](_0x56c3da[_0x12a4('0x31')]);_0x377466['filters']=_[_0x12a4('0x32')](_0x377466[_0x12a4('0x33')],_0x377466[_0x12a4('0x31')]);_0x3c5584[_0x12a4('0x34')]=_[_0x12a4('0x32')](_0x377466[_0x12a4('0x33')],qs['fields'](_0x56c3da[_0x12a4('0x31')][_0x12a4('0x35')]));_0x3c5584[_0x12a4('0x34')]=_0x3c5584['attributes']['length']?_0x3c5584[_0x12a4('0x34')]:_0x377466['model'];if(!_0x56c3da[_0x12a4('0x31')][_0x12a4('0x36')]('nolimit')){_0x3c5584[_0x12a4('0x1e')]=qs[_0x12a4('0x1e')](_0x56c3da[_0x12a4('0x31')][_0x12a4('0x1e')]);_0x3c5584['offset']=qs[_0x12a4('0x20')](_0x56c3da[_0x12a4('0x31')][_0x12a4('0x20')]);}_0x3c5584[_0x12a4('0x37')]=qs[_0x12a4('0x38')](_0x56c3da['query']['sort']);_0x3c5584[_0x12a4('0x39')]=qs['filters'](_[_0x12a4('0x3a')](_0x56c3da[_0x12a4('0x31')],_0x377466[_0x12a4('0x3b')]),_0x56df0f);if(_0x56c3da[_0x12a4('0x31')][_0x12a4('0x3c')]){_0x3c5584[_0x12a4('0x39')]=_[_0x12a4('0x3d')](_0x3c5584[_0x12a4('0x39')],{'$or':_[_0x12a4('0x2d')](_0x56df0f,function(_0x31e9bb){if(_0x31e9bb['type']!=='VIRTUAL'){var _0x4bba08={};_0x4bba08[_0x31e9bb[_0x12a4('0x2b')]]={'$like':'%'+_0x56c3da[_0x12a4('0x31')]['filter']+'%'};return _0x4bba08;}})});}_0x3c5584=_[_0x12a4('0x3d')]({},_0x3c5584,_0x56c3da[_0x12a4('0x3e')]);var _0x487d89={'where':_0x3c5584[_0x12a4('0x39')]};return db[_0x12a4('0x2e')][_0x12a4('0x1f')](_0x487d89)[_0x12a4('0x27')](function(_0x22f6c1){_0x15adb7[_0x12a4('0x1f')]=_0x22f6c1;if(_0x56c3da['query'][_0x12a4('0x3f')]){_0x3c5584['include']=[{'all':!![]}];}return db[_0x12a4('0x2e')][_0x12a4('0x40')](_0x3c5584);})[_0x12a4('0x27')](function(_0x2826fb){_0x15adb7[_0x12a4('0x41')]=_0x2826fb;return _0x15adb7;})['then'](respondWithFilteredResult(_0x1979d1,_0x3c5584))[_0x12a4('0x42')](handleError(_0x1979d1,null));};exports[_0x12a4('0x43')]=function(_0x201755,_0x8a1643){var _0x466df1={'raw':!![],'where':{'id':_0x201755[_0x12a4('0x44')]['id']}},_0xf2751e={};_0xf2751e['model']=_[_0x12a4('0x45')](db[_0x12a4('0x2e')][_0x12a4('0x46')]);_0xf2751e[_0x12a4('0x31')]=_[_0x12a4('0x45')](_0x201755[_0x12a4('0x31')]);_0xf2751e[_0x12a4('0x3b')]=_[_0x12a4('0x32')](_0xf2751e[_0x12a4('0x33')],_0xf2751e[_0x12a4('0x31')]);_0x466df1[_0x12a4('0x34')]=_['intersection'](_0xf2751e[_0x12a4('0x33')],qs[_0x12a4('0x35')](_0x201755[_0x12a4('0x31')]['fields']));_0x466df1['attributes']=_0x466df1[_0x12a4('0x34')][_0x12a4('0x47')]?_0x466df1[_0x12a4('0x34')]:_0xf2751e['model'];if(_0x201755[_0x12a4('0x31')][_0x12a4('0x3f')]){_0x466df1[_0x12a4('0x48')]=[{'all':!![]}];}_0x466df1=_[_0x12a4('0x3d')]({},_0x466df1,_0x201755['options']);return db['FaxQueueReport']['find'](_0x466df1)['then'](handleEntityNotFound(_0x8a1643,null))[_0x12a4('0x27')](respondWithResult(_0x8a1643,null))[_0x12a4('0x42')](handleError(_0x8a1643,null));};exports[_0x12a4('0x49')]=function(_0x1568b8,_0x4348ba){return db['FaxQueueReport'][_0x12a4('0x49')](_0x1568b8[_0x12a4('0x4a')],{})[_0x12a4('0x27')](respondWithResult(_0x4348ba,0xc9))['catch'](handleError(_0x4348ba,null));};exports['update']=function(_0x41516b,_0x11ef07){if(_0x41516b['body']['id']){delete _0x41516b['body']['id'];}return db['FaxQueueReport'][_0x12a4('0x4b')]({'where':{'id':_0x41516b[_0x12a4('0x44')]['id']}})[_0x12a4('0x27')](handleEntityNotFound(_0x11ef07,null))['then'](saveUpdates(_0x41516b[_0x12a4('0x4a')],null))[_0x12a4('0x27')](respondWithResult(_0x11ef07,null))['catch'](handleError(_0x11ef07,null));};exports[_0x12a4('0x28')]=function(_0x10f12e,_0x29598b){return db[_0x12a4('0x2e')][_0x12a4('0x4b')]({'where':{'id':_0x10f12e[_0x12a4('0x44')]['id']}})['then'](handleEntityNotFound(_0x29598b,null))[_0x12a4('0x27')](removeEntity(_0x29598b,null))['catch'](handleError(_0x29598b,null));};exports[_0x12a4('0x4c')]=function(_0x30eabd,_0x86f964){return db[_0x12a4('0x2e')][_0x12a4('0x4c')]()[_0x12a4('0x27')](respondWithResult(_0x86f964,null))[_0x12a4('0x42')](handleError(_0x86f964,null));}; \ No newline at end of file +var _0xae7b=['save','update','then','sendStatus','error','stack','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject'];(function(_0x1d8d19,_0x118a50){var _0x22a336=function(_0xe3a3c4){while(--_0xe3a3c4){_0x1d8d19['push'](_0x1d8d19['shift']());}};_0x22a336(++_0x118a50);}(_0xae7b,0xbe));var _0xbae7=function(_0x3217d3,_0xf66fcf){_0x3217d3=_0x3217d3-0x0;var _0x260f43=_0xae7b[_0x3217d3];return _0x260f43;};'use strict';var emlformat=require(_0xbae7('0x0'));var rimraf=require(_0xbae7('0x1'));var zipdir=require(_0xbae7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbae7('0x3'));var BPromise=require(_0xbae7('0x4'));var Mustache=require(_0xbae7('0x5'));var util=require(_0xbae7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbae7('0x7'));var ejs=require(_0xbae7('0x8'));var fs=require('fs');var fs_extra=require(_0xbae7('0x9'));var _=require('lodash');var squel=require(_0xbae7('0xa'));var crypto=require('crypto');var jsforce=require(_0xbae7('0xb'));var deskjs=require(_0xbae7('0xc'));var toCsv=require(_0xbae7('0x7'));var querystring=require('querystring');var Papa=require(_0xbae7('0xd'));var Redis=require('ioredis');var authService=require(_0xbae7('0xe'));var qs=require(_0xbae7('0xf'));var as=require(_0xbae7('0x10'));var hardwareService=require(_0xbae7('0x11'));var logger=require('../../config/logger')(_0xbae7('0x12'));var utils=require(_0xbae7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbae7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d17ae,_0x4090a1){_0x4090a1=_0x4090a1||0xcc;return function(_0x5b1abe){if(_0x5b1abe){return _0x3d17ae['sendStatus'](_0x4090a1);}return _0x3d17ae[_0xbae7('0x15')](_0x4090a1)[_0xbae7('0x16')]();};}function respondWithResult(_0x43e4ca,_0x25d1a){_0x25d1a=_0x25d1a||0xc8;return function(_0x4cc0a9){if(_0x4cc0a9){return _0x43e4ca[_0xbae7('0x15')](_0x25d1a)['json'](_0x4cc0a9);}};}function respondWithFilteredResult(_0x5aae99,_0x249669){return function(_0xb272c4){if(_0xb272c4){var _0x1b9ee1=typeof _0x249669[_0xbae7('0x17')]===_0xbae7('0x18')&&typeof _0x249669[_0xbae7('0x19')]==='undefined';var _0x1b2949=_0xb272c4[_0xbae7('0x1a')];var _0x99d88=_0x1b9ee1?0x0:_0x249669[_0xbae7('0x17')];var _0x1fc9fb=_0x1b9ee1?_0xb272c4['count']:_0x249669['offset']+_0x249669['limit'];var _0xa9ed79;if(_0x1fc9fb>=_0x1b2949){_0x1fc9fb=_0x1b2949;_0xa9ed79=0xc8;}else{_0xa9ed79=0xce;}_0x5aae99[_0xbae7('0x15')](_0xa9ed79);return _0x5aae99[_0xbae7('0x1b')](_0xbae7('0x1c'),_0x99d88+'-'+_0x1fc9fb+'/'+_0x1b2949)[_0xbae7('0x1d')](_0xb272c4);}return null;};}function patchUpdates(_0x519980){return function(_0xd87dc2){try{jsonpatch[_0xbae7('0x1e')](_0xd87dc2,_0x519980,!![]);}catch(_0x34a82b){return BPromise[_0xbae7('0x1f')](_0x34a82b);}return _0xd87dc2[_0xbae7('0x20')]();};}function saveUpdates(_0x502f06,_0x32d772){return function(_0x3e4569){if(_0x3e4569){return _0x3e4569[_0xbae7('0x21')](_0x502f06)[_0xbae7('0x22')](function(_0xb5d7f3){return _0xb5d7f3;});}return null;};}function removeEntity(_0x384ea6,_0x32f8eb){return function(_0x5c0245){if(_0x5c0245){return _0x5c0245['destroy']()[_0xbae7('0x22')](function(){_0x384ea6[_0xbae7('0x15')](0xcc)[_0xbae7('0x16')]();});}};}function handleEntityNotFound(_0x375df5,_0x61170a){return function(_0x3e003d){if(!_0x3e003d){_0x375df5[_0xbae7('0x23')](0x194);}return _0x3e003d;};}function handleError(_0x1b5caa,_0x1399bc){_0x1399bc=_0x1399bc||0x1f4;return function(_0x3e104e){logger[_0xbae7('0x24')](_0x3e104e[_0xbae7('0x25')]);if(_0x3e104e['name']){delete _0x3e104e['name'];}_0x1b5caa['status'](_0x1399bc)[_0xbae7('0x26')](_0x3e104e);};}exports[_0xbae7('0x27')]=function(_0x203848,_0x12dd23){var _0x12797a={},_0x2d8202={},_0x47e12b={'count':0x0,'rows':[]};var _0x5d702f=_[_0xbae7('0x28')](db[_0xbae7('0x29')][_0xbae7('0x2a')],function(_0x258c08){return{'name':_0x258c08[_0xbae7('0x2b')],'type':_0x258c08[_0xbae7('0x2c')]['key']};});_0x2d8202[_0xbae7('0x2d')]=_[_0xbae7('0x28')](_0x5d702f,_0xbae7('0x2e'));_0x2d8202[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x203848[_0xbae7('0x2f')]);_0x2d8202[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x2d8202[_0xbae7('0x2d')],_0x2d8202[_0xbae7('0x2f')]);_0x12797a[_0xbae7('0x33')]=_[_0xbae7('0x32')](_0x2d8202['model'],qs[_0xbae7('0x34')](_0x203848[_0xbae7('0x2f')][_0xbae7('0x34')]));_0x12797a['attributes']=_0x12797a[_0xbae7('0x33')][_0xbae7('0x35')]?_0x12797a['attributes']:_0x2d8202[_0xbae7('0x2d')];if(!_0x203848[_0xbae7('0x2f')][_0xbae7('0x36')](_0xbae7('0x37'))){_0x12797a[_0xbae7('0x19')]=qs[_0xbae7('0x19')](_0x203848[_0xbae7('0x2f')][_0xbae7('0x19')]);_0x12797a[_0xbae7('0x17')]=qs['offset'](_0x203848['query'][_0xbae7('0x17')]);}_0x12797a[_0xbae7('0x38')]=qs['sort'](_0x203848[_0xbae7('0x2f')][_0xbae7('0x39')]);_0x12797a[_0xbae7('0x3a')]=qs[_0xbae7('0x31')](_[_0xbae7('0x3b')](_0x203848[_0xbae7('0x2f')],_0x2d8202[_0xbae7('0x31')]),_0x5d702f);if(_0x203848[_0xbae7('0x2f')]['filter']){_0x12797a['where']=_[_0xbae7('0x3c')](_0x12797a['where'],{'$or':_[_0xbae7('0x28')](_0x5d702f,function(_0x59e90b){if(_0x59e90b[_0xbae7('0x2c')]!==_0xbae7('0x3d')){var _0x1fdb4f={};_0x1fdb4f[_0x59e90b[_0xbae7('0x2e')]]={'$like':'%'+_0x203848[_0xbae7('0x2f')][_0xbae7('0x3e')]+'%'};return _0x1fdb4f;}})});}_0x12797a=_['merge']({},_0x12797a,_0x203848[_0xbae7('0x3f')]);var _0x4fa0ba={'where':_0x12797a['where']};return db[_0xbae7('0x29')][_0xbae7('0x1a')](_0x4fa0ba)[_0xbae7('0x22')](function(_0xc1c69e){_0x47e12b[_0xbae7('0x1a')]=_0xc1c69e;if(_0x203848['query'][_0xbae7('0x40')]){_0x12797a[_0xbae7('0x41')]=[{'all':!![]}];}return db[_0xbae7('0x29')][_0xbae7('0x42')](_0x12797a);})[_0xbae7('0x22')](function(_0x5047b0){_0x47e12b[_0xbae7('0x43')]=_0x5047b0;return _0x47e12b;})['then'](respondWithFilteredResult(_0x12dd23,_0x12797a))[_0xbae7('0x44')](handleError(_0x12dd23,null));};exports[_0xbae7('0x45')]=function(_0x3647a8,_0x472686){var _0x1895ef={'raw':!![],'where':{'id':_0x3647a8[_0xbae7('0x46')]['id']}},_0x57f345={};_0x57f345[_0xbae7('0x2d')]=_[_0xbae7('0x30')](db[_0xbae7('0x29')][_0xbae7('0x2a')]);_0x57f345[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x3647a8['query']);_0x57f345[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x57f345[_0xbae7('0x2d')],_0x57f345[_0xbae7('0x2f')]);_0x1895ef[_0xbae7('0x33')]=_[_0xbae7('0x32')](_0x57f345['model'],qs['fields'](_0x3647a8[_0xbae7('0x2f')][_0xbae7('0x34')]));_0x1895ef['attributes']=_0x1895ef[_0xbae7('0x33')][_0xbae7('0x35')]?_0x1895ef[_0xbae7('0x33')]:_0x57f345[_0xbae7('0x2d')];if(_0x3647a8[_0xbae7('0x2f')]['includeAll']){_0x1895ef[_0xbae7('0x41')]=[{'all':!![]}];}_0x1895ef=_[_0xbae7('0x3c')]({},_0x1895ef,_0x3647a8[_0xbae7('0x3f')]);return db[_0xbae7('0x29')]['find'](_0x1895ef)[_0xbae7('0x22')](handleEntityNotFound(_0x472686,null))[_0xbae7('0x22')](respondWithResult(_0x472686,null))[_0xbae7('0x44')](handleError(_0x472686,null));};exports[_0xbae7('0x47')]=function(_0x50b52b,_0x11722e){return db[_0xbae7('0x29')][_0xbae7('0x47')](_0x50b52b[_0xbae7('0x48')],{})['then'](respondWithResult(_0x11722e,0xc9))[_0xbae7('0x44')](handleError(_0x11722e,null));};exports[_0xbae7('0x21')]=function(_0xb6df1f,_0x363b7b){if(_0xb6df1f[_0xbae7('0x48')]['id']){delete _0xb6df1f['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0xb6df1f[_0xbae7('0x46')]['id']}})[_0xbae7('0x22')](handleEntityNotFound(_0x363b7b,null))[_0xbae7('0x22')](saveUpdates(_0xb6df1f[_0xbae7('0x48')],null))[_0xbae7('0x22')](respondWithResult(_0x363b7b,null))['catch'](handleError(_0x363b7b,null));};exports['destroy']=function(_0x1bb00a,_0x46f0a9){return db[_0xbae7('0x29')]['find']({'where':{'id':_0x1bb00a[_0xbae7('0x46')]['id']}})[_0xbae7('0x22')](handleEntityNotFound(_0x46f0a9,null))[_0xbae7('0x22')](removeEntity(_0x46f0a9,null))[_0xbae7('0x44')](handleError(_0x46f0a9,null));};exports[_0xbae7('0x49')]=function(_0x4cf377,_0x2ccd2c){return db['FaxQueueReport'][_0xbae7('0x49')]()[_0xbae7('0x22')](respondWithResult(_0x2ccd2c,null))[_0xbae7('0x44')](handleError(_0x2ccd2c,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 3fdf072..60c0fb5 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x814b,0x1a2));var _0xb814=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x814b[_0x2a56ad];return _0x425175;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x57beec,_0x35b2f6){var _0x144124=function(_0x3e8dcf){while(--_0x3e8dcf){_0x57beec['push'](_0x57beec['shift']());}};_0x144124(++_0x35b2f6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'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 diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index f0bb528..508ac9b 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 _0x1b6d=['request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','attributes','limit','then','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s'];(function(_0x3f01a6,_0x3e2160){var _0xd76373=function(_0x560574){while(--_0x560574){_0x3f01a6['push'](_0x3f01a6['shift']());}};_0xd76373(++_0x3e2160);}(_0x1b6d,0x180));var _0xd1b6=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x1b6d[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xd1b6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd1b6('0x1'));var fs=require('fs');var Redis=require(_0xd1b6('0x2'));var db=require(_0xd1b6('0x3'))['db'];var utils=require(_0xd1b6('0x4'));var logger=require(_0xd1b6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd1b6('0x6'));var client=jayson[_0xd1b6('0x7')][_0xd1b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x197788,_0x18ca03,_0x4dfb1a){return new BPromise(function(_0x8560c,_0x4ed2e7){return client[_0xd1b6('0x9')](_0x197788,_0x4dfb1a)['then'](function(_0x144f27){logger[_0xd1b6('0xa')](_0xd1b6('0xb'),_0x18ca03,_0xd1b6('0xc'));logger[_0xd1b6('0xd')](_0xd1b6('0xe'),_0x18ca03,'request\x20sent',JSON[_0xd1b6('0xf')](_0x144f27));if(_0x144f27['error']){if(_0x144f27[_0xd1b6('0x10')][_0xd1b6('0x11')]===0x1f4){logger['error'](_0xd1b6('0xb'),_0x18ca03,_0x144f27[_0xd1b6('0x10')][_0xd1b6('0x12')]);return _0x4ed2e7(_0x144f27[_0xd1b6('0x10')][_0xd1b6('0x12')]);}logger[_0xd1b6('0x10')](_0xd1b6('0xb'),_0x18ca03,_0x144f27[_0xd1b6('0x10')][_0xd1b6('0x12')]);return _0x8560c(_0x144f27['error'][_0xd1b6('0x12')]);}else{logger['info'](_0xd1b6('0xb'),_0x18ca03,_0xd1b6('0xc'));_0x8560c(_0x144f27[_0xd1b6('0x13')]['message']);}})[_0xd1b6('0x14')](function(_0x577da3){logger[_0xd1b6('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x18ca03,_0x577da3);_0x4ed2e7(_0x577da3);});});}exports[_0xd1b6('0x15')]=function(_0x253721){var _0x1bf1de=this;return new Promise(function(_0x525e5c,_0x559118){return db[_0xd1b6('0x16')][_0xd1b6('0x17')](_0x253721[_0xd1b6('0x18')],{'raw':_0x253721['options']?_0x253721[_0xd1b6('0x19')][_0xd1b6('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xf4d47){logger[_0xd1b6('0xa')](_0xd1b6('0x15'),_0x253721);logger[_0xd1b6('0xd')](_0xd1b6('0x15'),_0x253721,JSON['stringify'](_0xf4d47));_0x525e5c(_0xf4d47);})[_0xd1b6('0x14')](function(_0x2d4be8){logger[_0xd1b6('0x10')]('CreateFaxQueueReport',_0x2d4be8[_0xd1b6('0x12')],_0x253721);_0x559118(_0x1bf1de[_0xd1b6('0x10')](0x1f4,_0x2d4be8['message']));});});};exports[_0xd1b6('0x1b')]=function(_0x353bef){var _0x40e5cf=this;return new Promise(function(_0x510ee2,_0x80f4eb){return db['FaxQueueReport'][_0xd1b6('0x1c')](_0x353bef[_0xd1b6('0x18')],{'raw':_0x353bef[_0xd1b6('0x19')]?_0x353bef[_0xd1b6('0x19')][_0xd1b6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x353bef['options']?_0x353bef[_0xd1b6('0x19')][_0xd1b6('0x1d')]||null:null,'attributes':_0x353bef[_0xd1b6('0x19')]?_0x353bef[_0xd1b6('0x19')][_0xd1b6('0x1e')]||null:null,'limit':_0x353bef[_0xd1b6('0x19')]?_0x353bef[_0xd1b6('0x19')][_0xd1b6('0x1f')]||null:null})[_0xd1b6('0x20')](function(_0xc013cf){logger[_0xd1b6('0xa')](_0xd1b6('0x1b'),_0x353bef);logger[_0xd1b6('0xd')](_0xd1b6('0x1b'),_0x353bef,JSON[_0xd1b6('0xf')](_0xc013cf));_0x510ee2(_0xc013cf);})['catch'](function(_0x2630dc){logger['error'](_0xd1b6('0x1b'),_0x2630dc['message'],_0x353bef);_0x80f4eb(_0x40e5cf[_0xd1b6('0x10')](0x1f4,_0x2630dc[_0xd1b6('0x12')]));});});}; \ No newline at end of file +var _0xa0d9=['CreateFaxQueueReport','FaxQueueReport','body','options','raw','debug','UpdateFaxQueueReport','update','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x160e2d,_0x112014){var _0x3ac407=function(_0x543b37){while(--_0x543b37){_0x160e2d['push'](_0x160e2d['shift']());}};_0x3ac407(++_0x112014);}(_0xa0d9,0xb0));var _0x9a0d=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0xa0d9[_0x318840];return _0x223da4;};'use strict';var _=require(_0x9a0d('0x0'));var util=require('util');var moment=require(_0x9a0d('0x1'));var BPromise=require(_0x9a0d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a0d('0x3'));var db=require(_0x9a0d('0x4'))['db'];var utils=require(_0x9a0d('0x5'));var logger=require(_0x9a0d('0x6'))(_0x9a0d('0x7'));var config=require(_0x9a0d('0x8'));var jayson=require(_0x9a0d('0x9'));var client=jayson['client'][_0x9a0d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25c7bd,_0x5b3f2b,_0x314cfa){return new BPromise(function(_0x5b0e22,_0x3de65c){return client[_0x9a0d('0xb')](_0x25c7bd,_0x314cfa)[_0x9a0d('0xc')](function(_0xb873f0){logger[_0x9a0d('0xd')](_0x9a0d('0xe'),_0x5b3f2b,_0x9a0d('0xf'));logger['debug'](_0x9a0d('0x10'),_0x5b3f2b,'request\x20sent',JSON[_0x9a0d('0x11')](_0xb873f0));if(_0xb873f0[_0x9a0d('0x12')]){if(_0xb873f0['error'][_0x9a0d('0x13')]===0x1f4){logger[_0x9a0d('0x12')](_0x9a0d('0xe'),_0x5b3f2b,_0xb873f0['error'][_0x9a0d('0x14')]);return _0x3de65c(_0xb873f0[_0x9a0d('0x12')]['message']);}logger[_0x9a0d('0x12')](_0x9a0d('0xe'),_0x5b3f2b,_0xb873f0[_0x9a0d('0x12')][_0x9a0d('0x14')]);return _0x5b0e22(_0xb873f0['error'][_0x9a0d('0x14')]);}else{logger[_0x9a0d('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x5b3f2b,'request\x20sent');_0x5b0e22(_0xb873f0[_0x9a0d('0x15')][_0x9a0d('0x14')]);}})['catch'](function(_0x2344d0){logger[_0x9a0d('0x12')](_0x9a0d('0xe'),_0x5b3f2b,_0x2344d0);_0x3de65c(_0x2344d0);});});}exports[_0x9a0d('0x16')]=function(_0x1ada47){var _0x4dbf90=this;return new Promise(function(_0xd7e10d,_0x29736e){return db[_0x9a0d('0x17')]['create'](_0x1ada47[_0x9a0d('0x18')],{'raw':_0x1ada47[_0x9a0d('0x19')]?_0x1ada47[_0x9a0d('0x19')][_0x9a0d('0x1a')]===undefined?!![]:![]:!![]})[_0x9a0d('0xc')](function(_0x30ea10){logger['info'](_0x9a0d('0x16'),_0x1ada47);logger[_0x9a0d('0x1b')]('CreateFaxQueueReport',_0x1ada47,JSON['stringify'](_0x30ea10));_0xd7e10d(_0x30ea10);})['catch'](function(_0x2b5584){logger[_0x9a0d('0x12')](_0x9a0d('0x16'),_0x2b5584['message'],_0x1ada47);_0x29736e(_0x4dbf90[_0x9a0d('0x12')](0x1f4,_0x2b5584[_0x9a0d('0x14')]));});});};exports[_0x9a0d('0x1c')]=function(_0x59bb63){var _0x587cff=this;return new Promise(function(_0x5d8451,_0x33e73e){return db[_0x9a0d('0x17')][_0x9a0d('0x1d')](_0x59bb63[_0x9a0d('0x18')],{'raw':_0x59bb63[_0x9a0d('0x19')]?_0x59bb63[_0x9a0d('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59bb63[_0x9a0d('0x19')]?_0x59bb63[_0x9a0d('0x19')][_0x9a0d('0x1e')]||null:null,'attributes':_0x59bb63[_0x9a0d('0x19')]?_0x59bb63[_0x9a0d('0x19')][_0x9a0d('0x1f')]||null:null,'limit':_0x59bb63[_0x9a0d('0x19')]?_0x59bb63['options'][_0x9a0d('0x20')]||null:null})[_0x9a0d('0xc')](function(_0x10358b){logger[_0x9a0d('0xd')](_0x9a0d('0x1c'),_0x59bb63);logger[_0x9a0d('0x1b')](_0x9a0d('0x1c'),_0x59bb63,JSON['stringify'](_0x10358b));_0x5d8451(_0x10358b);})['catch'](function(_0xa7f4c1){logger[_0x9a0d('0x12')](_0x9a0d('0x1c'),_0xa7f4c1[_0x9a0d('0x14')],_0x59bb63);_0x33e73e(_0x587cff[_0x9a0d('0x12')](0x1f4,_0xa7f4c1['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 7b53bfe..4e083c2 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 _0x968c=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','index','/describe','get','/:id','isAuthenticated','show','put','update'];(function(_0x746240,_0x364a2d){var _0x43a1d5=function(_0x1c10c6){while(--_0x1c10c6){_0x746240['push'](_0x746240['shift']());}};_0x43a1d5(++_0x364a2d);}(_0x968c,0x7b));var _0xc968=function(_0x408adb,_0x20ddda){_0x408adb=_0x408adb-0x0;var _0x3d1358=_0x968c[_0x408adb];return _0x3d1358;};'use strict';var multer=require(_0xc968('0x0'));var util=require(_0xc968('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc968('0x2'));var router=express[_0xc968('0x3')]();var fs_extra=require(_0xc968('0x4'));var auth=require(_0xc968('0x5'));var interaction=require(_0xc968('0x6'));var config=require(_0xc968('0x7'));var controller=require(_0xc968('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc968('0x9')]);router['get'](_0xc968('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xc968('0xb')](_0xc968('0xc'),auth[_0xc968('0xd')](),controller[_0xc968('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc968('0xf')]('/:id',auth[_0xc968('0xd')](),controller[_0xc968('0x10')]);router[_0xc968('0x11')](_0xc968('0xc'),auth[_0xc968('0xd')](),controller[_0xc968('0x12')]);module[_0xc968('0x13')]=router; \ No newline at end of file +var _0x9ad2=['../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a8315,_0x9ef47d){var _0x5cc037=function(_0x4fe62e){while(--_0x4fe62e){_0x5a8315['push'](_0x5a8315['shift']());}};_0x5cc037(++_0x9ef47d);}(_0x9ad2,0xcb));var _0x29ad=function(_0x457234,_0x24b725){_0x457234=_0x457234-0x0;var _0x2dc041=_0x9ad2[_0x457234];return _0x2dc041;};'use strict';var multer=require('multer');var util=require(_0x29ad('0x0'));var path=require('path');var timeout=require(_0x29ad('0x1'));var express=require(_0x29ad('0x2'));var router=express[_0x29ad('0x3')]();var fs_extra=require(_0x29ad('0x4'));var auth=require(_0x29ad('0x5'));var interaction=require(_0x29ad('0x6'));var config=require(_0x29ad('0x7'));var controller=require(_0x29ad('0x8'));router[_0x29ad('0x9')]('/',auth['isAuthenticated'](),controller[_0x29ad('0xa')]);router[_0x29ad('0x9')](_0x29ad('0xb'),auth[_0x29ad('0xc')](),controller[_0x29ad('0xd')]);router['get']('/:id',auth[_0x29ad('0xc')](),controller['show']);router['post']('/',auth[_0x29ad('0xc')](),controller[_0x29ad('0xe')]);router[_0x29ad('0xf')](_0x29ad('0x10'),auth['isAuthenticated'](),controller[_0x29ad('0x11')]);router[_0x29ad('0x12')](_0x29ad('0x10'),auth[_0x29ad('0xc')](),controller[_0x29ad('0x13')]);module[_0x29ad('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index c6450ca..193f1f9 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x861e16,_0x5eed3c){_0x861e16=_0x861e16-0x0;var _0x42a4bf=_0xb43b[_0x861e16];return _0x42a4bf;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4691b4,_0x3c34f4){var _0x135c4b=function(_0x35533b){while(--_0x35533b){_0x4691b4['push'](_0x4691b4['shift']());}};_0x135c4b(++_0x3c34f4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0xcb91[_0x26fc81];return _0x9feece;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index f5c5dce..5fe61e8 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 _0xf7d3=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','FaxTransferReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','options','includeAll','include','findAll','catch','fields','merge','create','body','find','params','destroy','describe','eml-format'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf7d3,0xef));var _0x3f7d=function(_0xe5c436,_0x3f3b8b){_0xe5c436=_0xe5c436-0x0;var _0x2d29ca=_0xf7d3[_0xe5c436];return _0x2d29ca;};'use strict';var emlformat=require(_0x3f7d('0x0'));var rimraf=require(_0x3f7d('0x1'));var zipdir=require(_0x3f7d('0x2'));var jsonpatch=require(_0x3f7d('0x3'));var rp=require(_0x3f7d('0x4'));var moment=require(_0x3f7d('0x5'));var BPromise=require(_0x3f7d('0x6'));var Mustache=require('mustache');var util=require(_0x3f7d('0x7'));var path=require('path');var sox=require(_0x3f7d('0x8'));var csv=require(_0x3f7d('0x9'));var ejs=require(_0x3f7d('0xa'));var fs=require('fs');var fs_extra=require(_0x3f7d('0xb'));var _=require(_0x3f7d('0xc'));var squel=require(_0x3f7d('0xd'));var crypto=require(_0x3f7d('0xe'));var jsforce=require(_0x3f7d('0xf'));var deskjs=require(_0x3f7d('0x10'));var toCsv=require(_0x3f7d('0x9'));var querystring=require(_0x3f7d('0x11'));var Papa=require(_0x3f7d('0x12'));var Redis=require(_0x3f7d('0x13'));var authService=require(_0x3f7d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3f7d('0x15'));var hardwareService=require(_0x3f7d('0x16'));var logger=require(_0x3f7d('0x17'))(_0x3f7d('0x18'));var utils=require(_0x3f7d('0x19'));var config=require(_0x3f7d('0x1a'));var licenseUtil=require(_0x3f7d('0x1b'));var db=require(_0x3f7d('0x1c'))['db'];function respondWithStatusCode(_0x33253e,_0x26dbb3){_0x26dbb3=_0x26dbb3||0xcc;return function(_0x432094){if(_0x432094){return _0x33253e[_0x3f7d('0x1d')](_0x26dbb3);}return _0x33253e[_0x3f7d('0x1e')](_0x26dbb3)[_0x3f7d('0x1f')]();};}function respondWithResult(_0x9ef2a0,_0x4fb2a2){_0x4fb2a2=_0x4fb2a2||0xc8;return function(_0x116008){if(_0x116008){return _0x9ef2a0['status'](_0x4fb2a2)[_0x3f7d('0x20')](_0x116008);}};}function respondWithFilteredResult(_0x53c69a,_0x2136e2){return function(_0x2e6ff9){if(_0x2e6ff9){var _0x5c7bd5=typeof _0x2136e2[_0x3f7d('0x21')]===_0x3f7d('0x22')&&typeof _0x2136e2[_0x3f7d('0x23')]===_0x3f7d('0x22');var _0xc97d50=_0x2e6ff9[_0x3f7d('0x24')];var _0x3f3324=_0x5c7bd5?0x0:_0x2136e2[_0x3f7d('0x21')];var _0x499c6b=_0x5c7bd5?_0x2e6ff9[_0x3f7d('0x24')]:_0x2136e2[_0x3f7d('0x21')]+_0x2136e2[_0x3f7d('0x23')];var _0x18ea06;if(_0x499c6b>=_0xc97d50){_0x499c6b=_0xc97d50;_0x18ea06=0xc8;}else{_0x18ea06=0xce;}_0x53c69a['status'](_0x18ea06);return _0x53c69a[_0x3f7d('0x25')](_0x3f7d('0x26'),_0x3f3324+'-'+_0x499c6b+'/'+_0xc97d50)['json'](_0x2e6ff9);}return null;};}function patchUpdates(_0x3f0dc4){return function(_0x320a63){try{jsonpatch[_0x3f7d('0x27')](_0x320a63,_0x3f0dc4,!![]);}catch(_0x4cca75){return BPromise[_0x3f7d('0x28')](_0x4cca75);}return _0x320a63[_0x3f7d('0x29')]();};}function saveUpdates(_0x46e55,_0x1d1613){return function(_0x1c1b3c){if(_0x1c1b3c){return _0x1c1b3c[_0x3f7d('0x2a')](_0x46e55)[_0x3f7d('0x2b')](function(_0x30381b){return _0x30381b;});}return null;};}function removeEntity(_0x1460c2,_0x955b3c){return function(_0x5ce9e3){if(_0x5ce9e3){return _0x5ce9e3['destroy']()[_0x3f7d('0x2b')](function(){_0x1460c2[_0x3f7d('0x1e')](0xcc)[_0x3f7d('0x1f')]();});}};}function handleEntityNotFound(_0x52ea58,_0x26af12){return function(_0x395fd0){if(!_0x395fd0){_0x52ea58['sendStatus'](0x194);}return _0x395fd0;};}function handleError(_0x2a671f,_0x27e907){_0x27e907=_0x27e907||0x1f4;return function(_0x14d006){logger[_0x3f7d('0x2c')](_0x14d006[_0x3f7d('0x2d')]);if(_0x14d006[_0x3f7d('0x2e')]){delete _0x14d006[_0x3f7d('0x2e')];}_0x2a671f['status'](_0x27e907)[_0x3f7d('0x2f')](_0x14d006);};}exports[_0x3f7d('0x30')]=function(_0x5adb69,_0x4b625c){var _0x78ea90={},_0x2c46ab={},_0x119cc6={'count':0x0,'rows':[]};var _0x36c6c6=_['map'](db[_0x3f7d('0x31')][_0x3f7d('0x32')],function(_0x42f1ac){return{'name':_0x42f1ac[_0x3f7d('0x33')],'type':_0x42f1ac[_0x3f7d('0x34')]['key']};});_0x2c46ab[_0x3f7d('0x35')]=_[_0x3f7d('0x36')](_0x36c6c6,_0x3f7d('0x2e'));_0x2c46ab[_0x3f7d('0x37')]=_[_0x3f7d('0x38')](_0x5adb69[_0x3f7d('0x37')]);_0x2c46ab[_0x3f7d('0x39')]=_[_0x3f7d('0x3a')](_0x2c46ab['model'],_0x2c46ab[_0x3f7d('0x37')]);_0x78ea90[_0x3f7d('0x3b')]=_[_0x3f7d('0x3a')](_0x2c46ab['model'],qs['fields'](_0x5adb69['query']['fields']));_0x78ea90[_0x3f7d('0x3b')]=_0x78ea90[_0x3f7d('0x3b')][_0x3f7d('0x3c')]?_0x78ea90['attributes']:_0x2c46ab[_0x3f7d('0x35')];if(!_0x5adb69[_0x3f7d('0x37')][_0x3f7d('0x3d')]('nolimit')){_0x78ea90[_0x3f7d('0x23')]=qs['limit'](_0x5adb69['query'][_0x3f7d('0x23')]);_0x78ea90[_0x3f7d('0x21')]=qs[_0x3f7d('0x21')](_0x5adb69['query'][_0x3f7d('0x21')]);}_0x78ea90[_0x3f7d('0x3e')]=qs[_0x3f7d('0x3f')](_0x5adb69[_0x3f7d('0x37')]['sort']);_0x78ea90['where']=qs['filters'](_[_0x3f7d('0x40')](_0x5adb69[_0x3f7d('0x37')],_0x2c46ab[_0x3f7d('0x39')]),_0x36c6c6);if(_0x5adb69['query']['filter']){_0x78ea90[_0x3f7d('0x41')]=_['merge'](_0x78ea90[_0x3f7d('0x41')],{'$or':_[_0x3f7d('0x36')](_0x36c6c6,function(_0x554100){if(_0x554100['type']!==_0x3f7d('0x42')){var _0x55c0f8={};_0x55c0f8[_0x554100['name']]={'$like':'%'+_0x5adb69['query']['filter']+'%'};return _0x55c0f8;}})});}_0x78ea90=_['merge']({},_0x78ea90,_0x5adb69[_0x3f7d('0x43')]);var _0xcad9fb={'where':_0x78ea90[_0x3f7d('0x41')]};return db[_0x3f7d('0x31')]['count'](_0xcad9fb)[_0x3f7d('0x2b')](function(_0x49da00){_0x119cc6[_0x3f7d('0x24')]=_0x49da00;if(_0x5adb69['query'][_0x3f7d('0x44')]){_0x78ea90[_0x3f7d('0x45')]=[{'all':!![]}];}return db[_0x3f7d('0x31')][_0x3f7d('0x46')](_0x78ea90);})[_0x3f7d('0x2b')](function(_0xad614f){_0x119cc6['rows']=_0xad614f;return _0x119cc6;})['then'](respondWithFilteredResult(_0x4b625c,_0x78ea90))[_0x3f7d('0x47')](handleError(_0x4b625c,null));};exports['show']=function(_0x22b691,_0x43dd6e){var _0x492c44={'raw':!![],'where':{'id':_0x22b691['params']['id']}},_0x322d19={};_0x322d19[_0x3f7d('0x35')]=_[_0x3f7d('0x38')](db[_0x3f7d('0x31')][_0x3f7d('0x32')]);_0x322d19[_0x3f7d('0x37')]=_[_0x3f7d('0x38')](_0x22b691[_0x3f7d('0x37')]);_0x322d19['filters']=_[_0x3f7d('0x3a')](_0x322d19[_0x3f7d('0x35')],_0x322d19[_0x3f7d('0x37')]);_0x492c44[_0x3f7d('0x3b')]=_[_0x3f7d('0x3a')](_0x322d19[_0x3f7d('0x35')],qs['fields'](_0x22b691[_0x3f7d('0x37')][_0x3f7d('0x48')]));_0x492c44[_0x3f7d('0x3b')]=_0x492c44[_0x3f7d('0x3b')][_0x3f7d('0x3c')]?_0x492c44['attributes']:_0x322d19[_0x3f7d('0x35')];if(_0x22b691['query'][_0x3f7d('0x44')]){_0x492c44[_0x3f7d('0x45')]=[{'all':!![]}];}_0x492c44=_[_0x3f7d('0x49')]({},_0x492c44,_0x22b691[_0x3f7d('0x43')]);return db[_0x3f7d('0x31')]['find'](_0x492c44)[_0x3f7d('0x2b')](handleEntityNotFound(_0x43dd6e,null))['then'](respondWithResult(_0x43dd6e,null))['catch'](handleError(_0x43dd6e,null));};exports[_0x3f7d('0x4a')]=function(_0x2fbd5f,_0x449446){return db['FaxTransferReport']['create'](_0x2fbd5f[_0x3f7d('0x4b')],{})[_0x3f7d('0x2b')](respondWithResult(_0x449446,0xc9))[_0x3f7d('0x47')](handleError(_0x449446,null));};exports['update']=function(_0x513c66,_0xeeabe9){if(_0x513c66['body']['id']){delete _0x513c66[_0x3f7d('0x4b')]['id'];}return db[_0x3f7d('0x31')][_0x3f7d('0x4c')]({'where':{'id':_0x513c66[_0x3f7d('0x4d')]['id']}})[_0x3f7d('0x2b')](handleEntityNotFound(_0xeeabe9,null))[_0x3f7d('0x2b')](saveUpdates(_0x513c66['body'],null))[_0x3f7d('0x2b')](respondWithResult(_0xeeabe9,null))[_0x3f7d('0x47')](handleError(_0xeeabe9,null));};exports[_0x3f7d('0x4e')]=function(_0x3a5cb8,_0xbae6b5){return db[_0x3f7d('0x31')][_0x3f7d('0x4c')]({'where':{'id':_0x3a5cb8[_0x3f7d('0x4d')]['id']}})[_0x3f7d('0x2b')](handleEntityNotFound(_0xbae6b5,null))['then'](removeEntity(_0xbae6b5,null))[_0x3f7d('0x47')](handleError(_0xbae6b5,null));};exports[_0x3f7d('0x4f')]=function(_0xab0a70,_0x57b98e){return db[_0x3f7d('0x31')][_0x3f7d('0x4f')]()[_0x3f7d('0x2b')](respondWithResult(_0x57b98e,null))[_0x3f7d('0x47')](handleError(_0x57b98e,null));}; \ No newline at end of file +var _0xd8a8=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','FaxTransferReport','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8a8,0x1ac));var _0x8d8a=function(_0x5e2954,_0x21a728){_0x5e2954=_0x5e2954-0x0;var _0x3d1d5d=_0xd8a8[_0x5e2954];return _0x3d1d5d;};'use strict';var emlformat=require(_0x8d8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d8a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8d8a('0x2'));var BPromise=require(_0x8d8a('0x3'));var Mustache=require(_0x8d8a('0x4'));var util=require(_0x8d8a('0x5'));var path=require(_0x8d8a('0x6'));var sox=require(_0x8d8a('0x7'));var csv=require(_0x8d8a('0x8'));var ejs=require(_0x8d8a('0x9'));var fs=require('fs');var fs_extra=require(_0x8d8a('0xa'));var _=require('lodash');var squel=require(_0x8d8a('0xb'));var crypto=require(_0x8d8a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8d8a('0xd'));var Papa=require(_0x8d8a('0xe'));var Redis=require(_0x8d8a('0xf'));var authService=require(_0x8d8a('0x10'));var qs=require(_0x8d8a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d8a('0x12'));var logger=require(_0x8d8a('0x13'))('api');var utils=require(_0x8d8a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8d8a('0x15'));var db=require(_0x8d8a('0x16'))['db'];function respondWithStatusCode(_0x3eb8b1,_0x1aab2e){_0x1aab2e=_0x1aab2e||0xcc;return function(_0x506eb8){if(_0x506eb8){return _0x3eb8b1[_0x8d8a('0x17')](_0x1aab2e);}return _0x3eb8b1[_0x8d8a('0x18')](_0x1aab2e)['end']();};}function respondWithResult(_0x194422,_0x3f9875){_0x3f9875=_0x3f9875||0xc8;return function(_0xd5e6d3){if(_0xd5e6d3){return _0x194422[_0x8d8a('0x18')](_0x3f9875)['json'](_0xd5e6d3);}};}function respondWithFilteredResult(_0x11aaf0,_0x116cb7){return function(_0x155cc0){if(_0x155cc0){var _0xee0ca=typeof _0x116cb7[_0x8d8a('0x19')]===_0x8d8a('0x1a')&&typeof _0x116cb7[_0x8d8a('0x1b')]===_0x8d8a('0x1a');var _0x3fc3ce=_0x155cc0[_0x8d8a('0x1c')];var _0x4ea4ce=_0xee0ca?0x0:_0x116cb7[_0x8d8a('0x19')];var _0x4c9844=_0xee0ca?_0x155cc0[_0x8d8a('0x1c')]:_0x116cb7[_0x8d8a('0x19')]+_0x116cb7[_0x8d8a('0x1b')];var _0x309cc3;if(_0x4c9844>=_0x3fc3ce){_0x4c9844=_0x3fc3ce;_0x309cc3=0xc8;}else{_0x309cc3=0xce;}_0x11aaf0[_0x8d8a('0x18')](_0x309cc3);return _0x11aaf0[_0x8d8a('0x1d')](_0x8d8a('0x1e'),_0x4ea4ce+'-'+_0x4c9844+'/'+_0x3fc3ce)['json'](_0x155cc0);}return null;};}function patchUpdates(_0x222446){return function(_0x369451){try{jsonpatch[_0x8d8a('0x1f')](_0x369451,_0x222446,!![]);}catch(_0x49d572){return BPromise[_0x8d8a('0x20')](_0x49d572);}return _0x369451[_0x8d8a('0x21')]();};}function saveUpdates(_0x9a11c8,_0x24109c){return function(_0x24e09c){if(_0x24e09c){return _0x24e09c[_0x8d8a('0x22')](_0x9a11c8)['then'](function(_0xf05ef3){return _0xf05ef3;});}return null;};}function removeEntity(_0x562387,_0x24554e){return function(_0x412b67){if(_0x412b67){return _0x412b67[_0x8d8a('0x23')]()['then'](function(){_0x562387[_0x8d8a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5301c9,_0x2a1964){return function(_0x4a1441){if(!_0x4a1441){_0x5301c9[_0x8d8a('0x17')](0x194);}return _0x4a1441;};}function handleError(_0x9c8fb3,_0x42c20a){_0x42c20a=_0x42c20a||0x1f4;return function(_0x55b5b4){logger['error'](_0x55b5b4[_0x8d8a('0x24')]);if(_0x55b5b4[_0x8d8a('0x25')]){delete _0x55b5b4['name'];}_0x9c8fb3[_0x8d8a('0x18')](_0x42c20a)['send'](_0x55b5b4);};}exports[_0x8d8a('0x26')]=function(_0x2b671c,_0x2b986b){var _0x4226ba={},_0x2088b4={},_0x385fad={'count':0x0,'rows':[]};var _0x5d4c97=_[_0x8d8a('0x27')](db[_0x8d8a('0x28')]['rawAttributes'],function(_0x4d92c4){return{'name':_0x4d92c4[_0x8d8a('0x29')],'type':_0x4d92c4[_0x8d8a('0x2a')][_0x8d8a('0x2b')]};});_0x2088b4[_0x8d8a('0x2c')]=_[_0x8d8a('0x27')](_0x5d4c97,_0x8d8a('0x25'));_0x2088b4['query']=_[_0x8d8a('0x2d')](_0x2b671c[_0x8d8a('0x2e')]);_0x2088b4['filters']=_[_0x8d8a('0x2f')](_0x2088b4[_0x8d8a('0x2c')],_0x2088b4[_0x8d8a('0x2e')]);_0x4226ba[_0x8d8a('0x30')]=_[_0x8d8a('0x2f')](_0x2088b4['model'],qs[_0x8d8a('0x31')](_0x2b671c[_0x8d8a('0x2e')][_0x8d8a('0x31')]));_0x4226ba[_0x8d8a('0x30')]=_0x4226ba[_0x8d8a('0x30')][_0x8d8a('0x32')]?_0x4226ba[_0x8d8a('0x30')]:_0x2088b4[_0x8d8a('0x2c')];if(!_0x2b671c[_0x8d8a('0x2e')][_0x8d8a('0x33')](_0x8d8a('0x34'))){_0x4226ba[_0x8d8a('0x1b')]=qs['limit'](_0x2b671c[_0x8d8a('0x2e')][_0x8d8a('0x1b')]);_0x4226ba[_0x8d8a('0x19')]=qs['offset'](_0x2b671c[_0x8d8a('0x2e')][_0x8d8a('0x19')]);}_0x4226ba[_0x8d8a('0x35')]=qs[_0x8d8a('0x36')](_0x2b671c[_0x8d8a('0x2e')][_0x8d8a('0x36')]);_0x4226ba[_0x8d8a('0x37')]=qs['filters'](_[_0x8d8a('0x38')](_0x2b671c[_0x8d8a('0x2e')],_0x2088b4[_0x8d8a('0x39')]),_0x5d4c97);if(_0x2b671c['query'][_0x8d8a('0x3a')]){_0x4226ba[_0x8d8a('0x37')]=_[_0x8d8a('0x3b')](_0x4226ba[_0x8d8a('0x37')],{'$or':_[_0x8d8a('0x27')](_0x5d4c97,function(_0x26cb72){if(_0x26cb72[_0x8d8a('0x2a')]!=='VIRTUAL'){var _0x1859e0={};_0x1859e0[_0x26cb72[_0x8d8a('0x25')]]={'$like':'%'+_0x2b671c[_0x8d8a('0x2e')][_0x8d8a('0x3a')]+'%'};return _0x1859e0;}})});}_0x4226ba=_[_0x8d8a('0x3b')]({},_0x4226ba,_0x2b671c['options']);var _0x7cdc28={'where':_0x4226ba[_0x8d8a('0x37')]};return db[_0x8d8a('0x28')]['count'](_0x7cdc28)[_0x8d8a('0x3c')](function(_0x5e27b6){_0x385fad[_0x8d8a('0x1c')]=_0x5e27b6;if(_0x2b671c[_0x8d8a('0x2e')][_0x8d8a('0x3d')]){_0x4226ba[_0x8d8a('0x3e')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x8d8a('0x3f')](_0x4226ba);})[_0x8d8a('0x3c')](function(_0x982007){_0x385fad[_0x8d8a('0x40')]=_0x982007;return _0x385fad;})[_0x8d8a('0x3c')](respondWithFilteredResult(_0x2b986b,_0x4226ba))[_0x8d8a('0x41')](handleError(_0x2b986b,null));};exports[_0x8d8a('0x42')]=function(_0x50b1d1,_0x5c834e){var _0x4edfeb={'raw':!![],'where':{'id':_0x50b1d1[_0x8d8a('0x43')]['id']}},_0x41dbf9={};_0x41dbf9['model']=_[_0x8d8a('0x2d')](db[_0x8d8a('0x28')][_0x8d8a('0x44')]);_0x41dbf9[_0x8d8a('0x2e')]=_[_0x8d8a('0x2d')](_0x50b1d1['query']);_0x41dbf9[_0x8d8a('0x39')]=_[_0x8d8a('0x2f')](_0x41dbf9['model'],_0x41dbf9['query']);_0x4edfeb[_0x8d8a('0x30')]=_['intersection'](_0x41dbf9[_0x8d8a('0x2c')],qs[_0x8d8a('0x31')](_0x50b1d1['query']['fields']));_0x4edfeb['attributes']=_0x4edfeb['attributes'][_0x8d8a('0x32')]?_0x4edfeb[_0x8d8a('0x30')]:_0x41dbf9['model'];if(_0x50b1d1[_0x8d8a('0x2e')]['includeAll']){_0x4edfeb['include']=[{'all':!![]}];}_0x4edfeb=_[_0x8d8a('0x3b')]({},_0x4edfeb,_0x50b1d1[_0x8d8a('0x45')]);return db[_0x8d8a('0x28')][_0x8d8a('0x46')](_0x4edfeb)[_0x8d8a('0x3c')](handleEntityNotFound(_0x5c834e,null))[_0x8d8a('0x3c')](respondWithResult(_0x5c834e,null))['catch'](handleError(_0x5c834e,null));};exports[_0x8d8a('0x47')]=function(_0x5a3e74,_0x206f18){return db[_0x8d8a('0x28')][_0x8d8a('0x47')](_0x5a3e74[_0x8d8a('0x48')],{})[_0x8d8a('0x3c')](respondWithResult(_0x206f18,0xc9))['catch'](handleError(_0x206f18,null));};exports['update']=function(_0x173b73,_0x23cf17){if(_0x173b73[_0x8d8a('0x48')]['id']){delete _0x173b73[_0x8d8a('0x48')]['id'];}return db[_0x8d8a('0x28')][_0x8d8a('0x46')]({'where':{'id':_0x173b73[_0x8d8a('0x43')]['id']}})[_0x8d8a('0x3c')](handleEntityNotFound(_0x23cf17,null))[_0x8d8a('0x3c')](saveUpdates(_0x173b73[_0x8d8a('0x48')],null))[_0x8d8a('0x3c')](respondWithResult(_0x23cf17,null))['catch'](handleError(_0x23cf17,null));};exports[_0x8d8a('0x23')]=function(_0x5a72d4,_0x44331e){return db[_0x8d8a('0x28')][_0x8d8a('0x46')]({'where':{'id':_0x5a72d4[_0x8d8a('0x43')]['id']}})[_0x8d8a('0x3c')](handleEntityNotFound(_0x44331e,null))[_0x8d8a('0x3c')](removeEntity(_0x44331e,null))[_0x8d8a('0x41')](handleError(_0x44331e,null));};exports[_0x8d8a('0x49')]=function(_0x2a2f3c,_0x1806df){return db[_0x8d8a('0x28')][_0x8d8a('0x49')]()[_0x8d8a('0x3c')](respondWithResult(_0x1806df,null))['catch'](handleError(_0x1806df,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 042f987..2957123 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 _0xb6a2=['define','FaxTransferReport','report_fax_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x232cc3,_0x5940a0){var _0x1d008c=function(_0x5d163e){while(--_0x5d163e){_0x232cc3['push'](_0x232cc3['shift']());}};_0x1d008c(++_0x5940a0);}(_0xb6a2,0x170));var _0x2b6a=function(_0x542fdf,_0x318d3b){_0x542fdf=_0x542fdf-0x0;var _0x4d6666=_0xb6a2[_0x542fdf];return _0x4d6666;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2b6a('0x0'))(_0x2b6a('0x1'));var moment=require(_0x2b6a('0x2'));var BPromise=require(_0x2b6a('0x3'));var rp=require(_0x2b6a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b6a('0x5'));var config=require(_0x2b6a('0x6'));var attributes=require(_0x2b6a('0x7'));module[_0x2b6a('0x8')]=function(_0x1eabc2,_0x4867ed){return _0x1eabc2[_0x2b6a('0x9')](_0x2b6a('0xa'),attributes,{'tableName':_0x2b6a('0xb'),'paranoid':![],'indexes':[{'name':_0x2b6a('0xc'),'fields':[_0x2b6a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f2c=['report_fax_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x5f2c,0x80));var _0xc5f2=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5f2c[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xc5f2('0x0'));var util=require(_0xc5f2('0x1'));var logger=require(_0xc5f2('0x2'))('api');var moment=require(_0xc5f2('0x3'));var BPromise=require(_0xc5f2('0x4'));var rp=require(_0xc5f2('0x5'));var fs=require('fs');var path=require(_0xc5f2('0x6'));var rimraf=require(_0xc5f2('0x7'));var config=require(_0xc5f2('0x8'));var attributes=require(_0xc5f2('0x9'));module[_0xc5f2('0xa')]=function(_0x545dd1,_0x2ac200){return _0x545dd1[_0xc5f2('0xb')]('FaxTransferReport',attributes,{'tableName':_0xc5f2('0xc'),'paranoid':![],'indexes':[{'name':_0xc5f2('0xd'),'fields':[_0xc5f2('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 34565bc..807d649 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 _0x9095=['then','info','request\x20sent','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9095,0x173));var _0x5909=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x9095[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x5909('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5909('0x1'));var rs=require(_0x5909('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5909('0x3'))['db'];var utils=require(_0x5909('0x4'));var logger=require(_0x5909('0x5'))(_0x5909('0x6'));var config=require('../../config/environment');var jayson=require(_0x5909('0x7'));var client=jayson[_0x5909('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x78bac8,_0x40c180,_0x3b9767){return new BPromise(function(_0x2ffb0a,_0x167f6e){return client['request'](_0x78bac8,_0x3b9767)[_0x5909('0x9')](function(_0x44473f){logger[_0x5909('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x40c180,_0x5909('0xb'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x40c180,'request\x20sent',JSON[_0x5909('0xc')](_0x44473f));if(_0x44473f[_0x5909('0xd')]){if(_0x44473f['error'][_0x5909('0xe')]===0x1f4){logger[_0x5909('0xd')](_0x5909('0xf'),_0x40c180,_0x44473f[_0x5909('0xd')][_0x5909('0x10')]);return _0x167f6e(_0x44473f[_0x5909('0xd')][_0x5909('0x10')]);}logger['error'](_0x5909('0xf'),_0x40c180,_0x44473f[_0x5909('0xd')][_0x5909('0x10')]);return _0x2ffb0a(_0x44473f[_0x5909('0xd')][_0x5909('0x10')]);}else{logger['info'](_0x5909('0xf'),_0x40c180,_0x5909('0xb'));_0x2ffb0a(_0x44473f[_0x5909('0x11')][_0x5909('0x10')]);}})[_0x5909('0x12')](function(_0x1c1012){logger[_0x5909('0xd')](_0x5909('0xf'),_0x40c180,_0x1c1012);_0x167f6e(_0x1c1012);});});} \ No newline at end of file +var _0xbe82=['result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','FaxTransferReport,\x20%s,\x20%s','message','info'];(function(_0x4a8a7e,_0x42b731){var _0x44b299=function(_0x59884d){while(--_0x59884d){_0x4a8a7e['push'](_0x4a8a7e['shift']());}};_0x44b299(++_0x42b731);}(_0xbe82,0xf2));var _0x2be8=function(_0x1066d5,_0x3db0f7){_0x1066d5=_0x1066d5-0x0;var _0x5127dd=_0xbe82[_0x1066d5];return _0x5127dd;};'use strict';var _=require(_0x2be8('0x0'));var util=require(_0x2be8('0x1'));var moment=require('moment');var BPromise=require(_0x2be8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2be8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2be8('0x4'))(_0x2be8('0x5'));var config=require(_0x2be8('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2be8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c55c0,_0x8ed6b2,_0x493311){return new BPromise(function(_0x58c489,_0x44aba0){return client[_0x2be8('0x8')](_0x3c55c0,_0x493311)[_0x2be8('0x9')](function(_0x21b5ee){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x8ed6b2,_0x2be8('0xa'));logger[_0x2be8('0xb')](_0x2be8('0xc'),_0x8ed6b2,_0x2be8('0xa'),JSON[_0x2be8('0xd')](_0x21b5ee));if(_0x21b5ee[_0x2be8('0xe')]){if(_0x21b5ee[_0x2be8('0xe')]['code']===0x1f4){logger[_0x2be8('0xe')](_0x2be8('0xf'),_0x8ed6b2,_0x21b5ee['error'][_0x2be8('0x10')]);return _0x44aba0(_0x21b5ee['error'][_0x2be8('0x10')]);}logger['error'](_0x2be8('0xf'),_0x8ed6b2,_0x21b5ee[_0x2be8('0xe')][_0x2be8('0x10')]);return _0x58c489(_0x21b5ee[_0x2be8('0xe')][_0x2be8('0x10')]);}else{logger[_0x2be8('0x11')](_0x2be8('0xf'),_0x8ed6b2,_0x2be8('0xa'));_0x58c489(_0x21b5ee[_0x2be8('0x12')]['message']);}})[_0x2be8('0x13')](function(_0x4d216a){logger[_0x2be8('0xe')](_0x2be8('0xf'),_0x8ed6b2,_0x4d216a);_0x44aba0(_0x4d216a);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 473e109..aa67b57 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 _0x5b83=['get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','exports','multer','util','connect-timeout','express','Router','../../config/environment'];(function(_0x2f5dad,_0x4313ad){var _0x38e02d=function(_0x44833a){while(--_0x44833a){_0x2f5dad['push'](_0x2f5dad['shift']());}};_0x38e02d(++_0x4313ad);}(_0x5b83,0x1d6));var _0x35b8=function(_0x23bafb,_0x19ec56){_0x23bafb=_0x23bafb-0x0;var _0x3ee101=_0x5b83[_0x23bafb];return _0x3ee101;};'use strict';var multer=require(_0x35b8('0x0'));var util=require(_0x35b8('0x1'));var path=require('path');var timeout=require(_0x35b8('0x2'));var express=require(_0x35b8('0x3'));var router=express[_0x35b8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x35b8('0x5'));var controller=require('./faxTransferReport.controller');router[_0x35b8('0x6')]('/',auth[_0x35b8('0x7')](),controller['index']);router[_0x35b8('0x6')](_0x35b8('0x8'),auth[_0x35b8('0x7')](),controller[_0x35b8('0x9')]);router['get']('/:id',auth[_0x35b8('0x7')](),controller[_0x35b8('0xa')]);router[_0x35b8('0xb')]('/',auth[_0x35b8('0x7')](),controller[_0x35b8('0xc')]);router[_0x35b8('0xd')](_0x35b8('0xe'),auth[_0x35b8('0x7')](),controller[_0x35b8('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x35b8('0x10')]=router; \ No newline at end of file +var _0x8360=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','exports'];(function(_0x83560f,_0x3d005f){var _0x5d4a9f=function(_0x3530d1){while(--_0x3530d1){_0x83560f['push'](_0x83560f['shift']());}};_0x5d4a9f(++_0x3d005f);}(_0x8360,0x118));var _0x0836=function(_0x5c53b3,_0x5d8125){_0x5c53b3=_0x5c53b3-0x0;var _0x2a6d9f=_0x8360[_0x5c53b3];return _0x2a6d9f;};'use strict';var multer=require(_0x0836('0x0'));var util=require('util');var path=require(_0x0836('0x1'));var timeout=require(_0x0836('0x2'));var express=require(_0x0836('0x3'));var router=express[_0x0836('0x4')]();var fs_extra=require(_0x0836('0x5'));var auth=require(_0x0836('0x6'));var interaction=require(_0x0836('0x7'));var config=require('../../config/environment');var controller=require(_0x0836('0x8'));router[_0x0836('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0836('0x9')](_0x0836('0xa'),auth[_0x0836('0xb')](),controller[_0x0836('0xc')]);router[_0x0836('0x9')](_0x0836('0xd'),auth[_0x0836('0xb')](),controller[_0x0836('0xe')]);router[_0x0836('0xf')]('/',auth[_0x0836('0xb')](),controller['create']);router[_0x0836('0x10')](_0x0836('0xd'),auth[_0x0836('0xb')](),controller[_0x0836('0x11')]);router[_0x0836('0x12')](_0x0836('0xd'),auth[_0x0836('0xb')](),controller['destroy']);module[_0x0836('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index c283557..0b52fc9 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 _0x9f91=['../../config/environment','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service'];(function(_0x1b5f5b,_0x275f16){var _0x195b74=function(_0x621d32){while(--_0x621d32){_0x1b5f5b['push'](_0x1b5f5b['shift']());}};_0x195b74(++_0x275f16);}(_0x9f91,0x14c));var _0x19f9=function(_0x238830,_0x545f75){_0x238830=_0x238830-0x0;var _0x5917f0=_0x9f91[_0x238830];return _0x5917f0;};'use strict';var multer=require('multer');var util=require(_0x19f9('0x0'));var path=require(_0x19f9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x19f9('0x2'));var auth=require(_0x19f9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x19f9('0x4'));var controller=require('./intDeskAccount.controller');router[_0x19f9('0x5')]('/',auth['isAuthenticated'](),controller[_0x19f9('0x6')]);router[_0x19f9('0x5')]('/:id',auth[_0x19f9('0x7')](),controller[_0x19f9('0x8')]);router[_0x19f9('0x5')](_0x19f9('0x9'),auth[_0x19f9('0x7')](),controller[_0x19f9('0xa')]);router[_0x19f9('0x5')](_0x19f9('0xb'),auth['isAuthenticated'](),controller[_0x19f9('0xc')]);router['post']('/',auth[_0x19f9('0x7')](),controller[_0x19f9('0xd')]);router[_0x19f9('0xe')](_0x19f9('0x9'),auth[_0x19f9('0x7')](),controller['addConfiguration']);router[_0x19f9('0xf')](_0x19f9('0x10'),auth[_0x19f9('0x7')](),controller[_0x19f9('0x11')]);router[_0x19f9('0x12')]('/:id',auth[_0x19f9('0x7')](),controller[_0x19f9('0x13')]);module[_0x19f9('0x14')]=router; \ No newline at end of file +var _0xb600=['/:id/fields','post','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x1ffbf7,_0x5424c5){var _0x320460=function(_0x42011a){while(--_0x42011a){_0x1ffbf7['push'](_0x1ffbf7['shift']());}};_0x320460(++_0x5424c5);}(_0xb600,0xee));var _0x0b60=function(_0x5f0869,_0x2b643c){_0x5f0869=_0x5f0869-0x0;var _0x5c5ef2=_0xb600[_0x5f0869];return _0x5c5ef2;};'use strict';var multer=require(_0x0b60('0x0'));var util=require('util');var path=require(_0x0b60('0x1'));var timeout=require(_0x0b60('0x2'));var express=require('express');var router=express[_0x0b60('0x3')]();var fs_extra=require(_0x0b60('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0b60('0x5'));var config=require('../../config/environment');var controller=require(_0x0b60('0x6'));router[_0x0b60('0x7')]('/',auth[_0x0b60('0x8')](),controller[_0x0b60('0x9')]);router[_0x0b60('0x7')](_0x0b60('0xa'),auth[_0x0b60('0x8')](),controller[_0x0b60('0xb')]);router[_0x0b60('0x7')](_0x0b60('0xc'),auth['isAuthenticated'](),controller[_0x0b60('0xd')]);router['get'](_0x0b60('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x0b60('0xf')]('/',auth[_0x0b60('0x8')](),controller[_0x0b60('0x10')]);router[_0x0b60('0xf')](_0x0b60('0xc'),auth[_0x0b60('0x8')](),controller['addConfiguration']);router[_0x0b60('0x11')](_0x0b60('0xa'),auth[_0x0b60('0x8')](),controller['update']);router[_0x0b60('0x12')](_0x0b60('0xa'),auth[_0x0b60('0x8')](),controller[_0x0b60('0x13')]);module[_0x0b60('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 2f95db1..d74e74f 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 _0x41c2=['exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x1c8d5a,_0x176836){var _0x1517c0=function(_0xc0b05a){while(--_0xc0b05a){_0x1c8d5a['push'](_0x1c8d5a['shift']());}};_0x1517c0(++_0x176836);}(_0x41c2,0x1c2));var _0x241c=function(_0x456768,_0x372afa){_0x456768=_0x456768-0x0;var _0x139fa1=_0x41c2[_0x456768];return _0x139fa1;};'use strict';var Sequelize=require('sequelize');module[_0x241c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x241c('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x241c('0x1')]},'authType':{'type':Sequelize[_0x241c('0x2')](_0x241c('0x3')),'defaultValue':_0x241c('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x241c('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x241c('0x1')]},'tokenSecret':{'type':Sequelize[_0x241c('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x241c('0x4'),_0x241c('0x5')),'defaultValue':_0x241c('0x4')}}; \ No newline at end of file +var _0x770a=['integrationTab','sequelize','exports','STRING','ENUM','basic','newTab'];(function(_0x1aa617,_0x23271a){var _0x38653c=function(_0x1f17be){while(--_0x1f17be){_0x1aa617['push'](_0x1aa617['shift']());}};_0x38653c(++_0x23271a);}(_0x770a,0x19e));var _0xa770=function(_0x4fc478,_0x56ac36){_0x4fc478=_0x4fc478-0x0;var _0x24d2e9=_0x770a[_0x4fc478];return _0x24d2e9;};'use strict';var Sequelize=require(_0xa770('0x0'));module[_0xa770('0x1')]={'name':{'type':Sequelize[_0xa770('0x2')]},'description':{'type':Sequelize[_0xa770('0x2')]},'username':{'type':Sequelize[_0xa770('0x2')]},'remoteUri':{'type':Sequelize[_0xa770('0x2')]},'authType':{'type':Sequelize[_0xa770('0x3')](_0xa770('0x4')),'defaultValue':_0xa770('0x4')},'password':{'type':Sequelize[_0xa770('0x2')]},'consumerKey':{'type':Sequelize[_0xa770('0x2')]},'consumerSecret':{'type':Sequelize[_0xa770('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xa770('0x2')]},'serverUrl':{'type':Sequelize[_0xa770('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa770('0x3')]('integrationTab',_0xa770('0x5')),'defaultValue':_0xa770('0x6')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index b3a1600..a48f9ca 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 _0x545f=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','DeskAccount','findAll','rows','show','params','rawAttributes','length','includeAll','catch','create','body','find','getConfigurations','DeskConfiguration','findOne','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','DeskField','priority','remoteUri','authType','username','password','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','application/json','basic','headers','Basic\x20%s','toString','concat','_embedded','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','map','key','model','query','keys','filters','attributes','intersection'];(function(_0x4a5a5d,_0x146aa6){var _0xea850d=function(_0x11583b){while(--_0x11583b){_0x4a5a5d['push'](_0x4a5a5d['shift']());}};_0xea850d(++_0x146aa6);}(_0x545f,0xac));var _0xf545=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x545f[_0x30faec];return _0x29484f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf545('0x0'));var zipdir=require(_0xf545('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf545('0x2'));var BPromise=require(_0xf545('0x3'));var Mustache=require(_0xf545('0x4'));var util=require(_0xf545('0x5'));var path=require(_0xf545('0x6'));var sox=require(_0xf545('0x7'));var csv=require(_0xf545('0x8'));var ejs=require(_0xf545('0x9'));var fs=require('fs');var fs_extra=require(_0xf545('0xa'));var _=require(_0xf545('0xb'));var squel=require(_0xf545('0xc'));var crypto=require(_0xf545('0xd'));var jsforce=require(_0xf545('0xe'));var deskjs=require(_0xf545('0xf'));var toCsv=require(_0xf545('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf545('0x10'));var authService=require(_0xf545('0x11'));var qs=require(_0xf545('0x12'));var as=require(_0xf545('0x13'));var hardwareService=require(_0xf545('0x14'));var logger=require(_0xf545('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf545('0x16'));var licenseUtil=require(_0xf545('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x14bee0,_0x179f8b){_0x179f8b=_0x179f8b||0xcc;return function(_0x5d73c2){if(_0x5d73c2){return _0x14bee0[_0xf545('0x18')](_0x179f8b);}return _0x14bee0[_0xf545('0x19')](_0x179f8b)[_0xf545('0x1a')]();};}function respondWithResult(_0x272a32,_0x1b64b7){_0x1b64b7=_0x1b64b7||0xc8;return function(_0x324e7d){if(_0x324e7d){return _0x272a32[_0xf545('0x19')](_0x1b64b7)[_0xf545('0x1b')](_0x324e7d);}};}function respondWithFilteredResult(_0x26a34a,_0x578e92){return function(_0x23ac57){if(_0x23ac57){var _0x21fedb=typeof _0x578e92[_0xf545('0x1c')]==='undefined'&&typeof _0x578e92[_0xf545('0x1d')]===_0xf545('0x1e');var _0x2bb17a=_0x23ac57[_0xf545('0x1f')];var _0x1a5d9b=_0x21fedb?0x0:_0x578e92[_0xf545('0x1c')];var _0x1fed33=_0x21fedb?_0x23ac57[_0xf545('0x1f')]:_0x578e92[_0xf545('0x1c')]+_0x578e92[_0xf545('0x1d')];var _0x4ac2c5;if(_0x1fed33>=_0x2bb17a){_0x1fed33=_0x2bb17a;_0x4ac2c5=0xc8;}else{_0x4ac2c5=0xce;}_0x26a34a['status'](_0x4ac2c5);return _0x26a34a[_0xf545('0x20')](_0xf545('0x21'),_0x1a5d9b+'-'+_0x1fed33+'/'+_0x2bb17a)['json'](_0x23ac57);}return null;};}function patchUpdates(_0x33be58){return function(_0xdff66b){try{jsonpatch[_0xf545('0x22')](_0xdff66b,_0x33be58,!![]);}catch(_0x39d6f5){return BPromise['reject'](_0x39d6f5);}return _0xdff66b[_0xf545('0x23')]();};}function saveUpdates(_0x14185d,_0x2b0003){return function(_0x4b4253){if(_0x4b4253){return _0x4b4253[_0xf545('0x24')](_0x14185d)[_0xf545('0x25')](function(_0x166b16){return _0x166b16;});}return null;};}function removeEntity(_0x86a2a2,_0x54c007){return function(_0x56a2f6){if(_0x56a2f6){return _0x56a2f6[_0xf545('0x26')]()['then'](function(){_0x86a2a2[_0xf545('0x19')](0xcc)[_0xf545('0x1a')]();});}};}function handleEntityNotFound(_0x545576,_0x124451){return function(_0x1320b0){if(!_0x1320b0){_0x545576[_0xf545('0x18')](0x194);}return _0x1320b0;};}function handleError(_0x9358ea,_0x1802c1){_0x1802c1=_0x1802c1||0x1f4;return function(_0x3a0345){logger[_0xf545('0x27')](_0x3a0345['stack']);if(_0x3a0345['name']){delete _0x3a0345[_0xf545('0x28')];}_0x9358ea[_0xf545('0x19')](_0x1802c1)[_0xf545('0x29')](_0x3a0345);};}exports['index']=function(_0x53801c,_0x281ea8){var _0x3d8002={},_0xc3ebd7={},_0x5414cf={'count':0x0,'rows':[]};var _0x1405eb=_[_0xf545('0x2a')](db['DeskAccount']['rawAttributes'],function(_0x2f9861){return{'name':_0x2f9861['fieldName'],'type':_0x2f9861['type'][_0xf545('0x2b')]};});_0xc3ebd7[_0xf545('0x2c')]=_['map'](_0x1405eb,'name');_0xc3ebd7[_0xf545('0x2d')]=_[_0xf545('0x2e')](_0x53801c[_0xf545('0x2d')]);_0xc3ebd7[_0xf545('0x2f')]=_['intersection'](_0xc3ebd7[_0xf545('0x2c')],_0xc3ebd7['query']);_0x3d8002[_0xf545('0x30')]=_[_0xf545('0x31')](_0xc3ebd7[_0xf545('0x2c')],qs[_0xf545('0x32')](_0x53801c[_0xf545('0x2d')][_0xf545('0x32')]));_0x3d8002['attributes']=_0x3d8002['attributes']['length']?_0x3d8002[_0xf545('0x30')]:_0xc3ebd7[_0xf545('0x2c')];if(!_0x53801c[_0xf545('0x2d')][_0xf545('0x33')](_0xf545('0x34'))){_0x3d8002[_0xf545('0x1d')]=qs[_0xf545('0x1d')](_0x53801c['query']['limit']);_0x3d8002['offset']=qs[_0xf545('0x1c')](_0x53801c[_0xf545('0x2d')][_0xf545('0x1c')]);}_0x3d8002[_0xf545('0x35')]=qs['sort'](_0x53801c[_0xf545('0x2d')][_0xf545('0x36')]);_0x3d8002[_0xf545('0x37')]=qs['filters'](_[_0xf545('0x38')](_0x53801c[_0xf545('0x2d')],_0xc3ebd7[_0xf545('0x2f')]),_0x1405eb);if(_0x53801c['query'][_0xf545('0x39')]){_0x3d8002[_0xf545('0x37')]=_[_0xf545('0x3a')](_0x3d8002[_0xf545('0x37')],{'$or':_[_0xf545('0x2a')](_0x1405eb,function(_0x2adee5){if(_0x2adee5['type']!==_0xf545('0x3b')){var _0x45afb2={};_0x45afb2[_0x2adee5[_0xf545('0x28')]]={'$like':'%'+_0x53801c[_0xf545('0x2d')][_0xf545('0x39')]+'%'};return _0x45afb2;}})});}_0x3d8002=_[_0xf545('0x3a')]({},_0x3d8002,_0x53801c[_0xf545('0x3c')]);var _0x3c72f9={'where':_0x3d8002[_0xf545('0x37')]};return db['DeskAccount'][_0xf545('0x1f')](_0x3c72f9)['then'](function(_0x16a209){_0x5414cf[_0xf545('0x1f')]=_0x16a209;if(_0x53801c['query']['includeAll']){_0x3d8002[_0xf545('0x3d')]=[{'all':!![]}];}return db[_0xf545('0x3e')][_0xf545('0x3f')](_0x3d8002);})[_0xf545('0x25')](function(_0x2045bd){_0x5414cf[_0xf545('0x40')]=_0x2045bd;return _0x5414cf;})[_0xf545('0x25')](respondWithFilteredResult(_0x281ea8,_0x3d8002))['catch'](handleError(_0x281ea8,null));};exports[_0xf545('0x41')]=function(_0x501ba4,_0x5d9119){var _0xc788b8={'raw':![],'where':{'id':_0x501ba4[_0xf545('0x42')]['id']}},_0x5d62e3={};_0x5d62e3[_0xf545('0x2c')]=_[_0xf545('0x2e')](db['DeskAccount'][_0xf545('0x43')]);_0x5d62e3[_0xf545('0x2d')]=_['keys'](_0x501ba4['query']);_0x5d62e3[_0xf545('0x2f')]=_['intersection'](_0x5d62e3[_0xf545('0x2c')],_0x5d62e3[_0xf545('0x2d')]);_0xc788b8['attributes']=_[_0xf545('0x31')](_0x5d62e3[_0xf545('0x2c')],qs[_0xf545('0x32')](_0x501ba4[_0xf545('0x2d')][_0xf545('0x32')]));_0xc788b8[_0xf545('0x30')]=_0xc788b8[_0xf545('0x30')][_0xf545('0x44')]?_0xc788b8[_0xf545('0x30')]:_0x5d62e3[_0xf545('0x2c')];if(_0x501ba4[_0xf545('0x2d')][_0xf545('0x45')]){_0xc788b8['include']=[{'all':!![]}];}_0xc788b8=_[_0xf545('0x3a')]({},_0xc788b8,_0x501ba4['options']);return db['DeskAccount']['find'](_0xc788b8)[_0xf545('0x25')](handleEntityNotFound(_0x5d9119,null))[_0xf545('0x25')](respondWithResult(_0x5d9119,null))[_0xf545('0x46')](handleError(_0x5d9119,null));};exports[_0xf545('0x47')]=function(_0x27f388,_0x251193){return db[_0xf545('0x3e')]['create'](_0x27f388[_0xf545('0x48')],{})['then'](respondWithResult(_0x251193,0xc9))[_0xf545('0x46')](handleError(_0x251193,null));};exports[_0xf545('0x24')]=function(_0x483b4a,_0x488f95){if(_0x483b4a['body']['id']){delete _0x483b4a[_0xf545('0x48')]['id'];}return db[_0xf545('0x3e')][_0xf545('0x49')]({'where':{'id':_0x483b4a[_0xf545('0x42')]['id']}})[_0xf545('0x25')](handleEntityNotFound(_0x488f95,null))[_0xf545('0x25')](saveUpdates(_0x483b4a[_0xf545('0x48')],null))[_0xf545('0x25')](respondWithResult(_0x488f95,null))[_0xf545('0x46')](handleError(_0x488f95,null));};exports[_0xf545('0x26')]=function(_0x1fa6f5,_0x5120dd){return db['DeskAccount']['find']({'where':{'id':_0x1fa6f5['params']['id']}})[_0xf545('0x25')](handleEntityNotFound(_0x5120dd,null))[_0xf545('0x25')](removeEntity(_0x5120dd,null))[_0xf545('0x46')](handleError(_0x5120dd,null));};exports[_0xf545('0x4a')]=function(_0x2c5118,_0x40aac1,_0x3b7b54){var _0x33f71d={};var _0x3bf6e7={};var _0x275ff5;var _0xc2af2c;return db[_0xf545('0x3e')]['findOne']({'where':{'id':_0x2c5118[_0xf545('0x42')]['id']}})[_0xf545('0x25')](handleEntityNotFound(_0x40aac1,null))[_0xf545('0x25')](function(_0x4e62aa){if(_0x4e62aa){_0x275ff5=_0x4e62aa;_0x3bf6e7['model']=_['keys'](db[_0xf545('0x4b')]['rawAttributes']);_0x3bf6e7['query']=_[_0xf545('0x2e')](_0x2c5118['query']);_0x3bf6e7[_0xf545('0x2f')]=_[_0xf545('0x31')](_0x3bf6e7[_0xf545('0x2c')],_0x3bf6e7[_0xf545('0x2d')]);_0x33f71d['attributes']=_[_0xf545('0x31')](_0x3bf6e7['model'],qs[_0xf545('0x32')](_0x2c5118[_0xf545('0x2d')]['fields']));_0x33f71d[_0xf545('0x30')]=_0x33f71d['attributes'][_0xf545('0x44')]?_0x33f71d['attributes']:_0x3bf6e7[_0xf545('0x2c')];_0x33f71d['order']=qs[_0xf545('0x36')](_0x2c5118[_0xf545('0x2d')][_0xf545('0x36')]);_0x33f71d['where']=qs['filters'](_[_0xf545('0x38')](_0x2c5118[_0xf545('0x2d')],_0x3bf6e7[_0xf545('0x2f')]));if(_0x2c5118[_0xf545('0x2d')][_0xf545('0x39')]){_0x33f71d['where']=_[_0xf545('0x3a')](_0x33f71d[_0xf545('0x37')],{'$or':_[_0xf545('0x2a')](_0x33f71d[_0xf545('0x30')],function(_0x41e1c){var _0x3397a4={};_0x3397a4[_0x41e1c]={'$like':'%'+_0x2c5118[_0xf545('0x2d')][_0xf545('0x39')]+'%'};return _0x3397a4;})});}_0x33f71d=_[_0xf545('0x3a')]({},_0x33f71d,_0x2c5118[_0xf545('0x3c')]);return _0x275ff5[_0xf545('0x4a')](_0x33f71d);}})[_0xf545('0x25')](function(_0x8aae49){if(_0x8aae49){_0xc2af2c=_0x8aae49[_0xf545('0x44')];if(!_0x2c5118['query']['hasOwnProperty'](_0xf545('0x34'))){_0x33f71d[_0xf545('0x1d')]=qs[_0xf545('0x1d')](_0x2c5118[_0xf545('0x2d')][_0xf545('0x1d')]);_0x33f71d[_0xf545('0x1c')]=qs[_0xf545('0x1c')](_0x2c5118[_0xf545('0x2d')][_0xf545('0x1c')]);}return _0x275ff5[_0xf545('0x4a')](_0x33f71d);}})[_0xf545('0x25')](function(_0x3e3307){if(_0x3e3307){return _0x3e3307?{'count':_0xc2af2c,'rows':_0x3e3307}:null;}})[_0xf545('0x25')](respondWithResult(_0x40aac1,null))['catch'](handleError(_0x40aac1,null));};exports['addConfiguration']=function(_0x100a71,_0x3215b2,_0x27c039){if(_0x100a71[_0xf545('0x48')]['id']){delete _0x100a71['body']['id'];}return db[_0xf545('0x3e')][_0xf545('0x4c')]({'where':{'id':_0x100a71[_0xf545('0x42')]['id']}})[_0xf545('0x25')](handleEntityNotFound(_0x3215b2,null))[_0xf545('0x25')](function(_0x286cd7){if(_0x286cd7){_0x100a71[_0xf545('0x48')]['AccountId']=_0x286cd7['id'];_0x100a71[_0xf545('0x48')][_0xf545('0x4d')]=integrations[_0xf545('0x4e')](_0x100a71['body'][_0xf545('0x4f')],_0x100a71[_0xf545('0x48')][_0xf545('0x50')]);_0x100a71[_0xf545('0x48')][_0xf545('0x51')]=integrations[_0xf545('0x52')](_0x100a71['body'][_0xf545('0x4f')],_0x100a71[_0xf545('0x48')][_0xf545('0x50')]);return db[_0xf545('0x4b')]['create'](_0x100a71[_0xf545('0x48')],{'include':[{'model':db[_0xf545('0x53')],'as':_0xf545('0x4d')},{'model':db[_0xf545('0x53')],'as':_0xf545('0x51')}]});}return null;})[_0xf545('0x25')](respondWithResult(_0x3215b2,null))[_0xf545('0x46')](handleError(_0x3215b2,null));};exports['getFields']=function(_0x2ebc81,_0x5a4d4a,_0x5c5d22){var _0x1ab75f=[{'name':_0xf545('0x54'),'label':_0xf545('0x54'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0xe08298='';return db['DeskAccount'][_0xf545('0x4c')]({'where':{'id':_0x2ebc81['params']['id']},'attributes':['id',_0xf545('0x55'),_0xf545('0x56'),_0xf545('0x57'),_0xf545('0x58'),'consumerKey',_0xf545('0x59'),_0xf545('0x5a'),_0xf545('0x5b')]})['then'](handleEntityNotFound(_0x5a4d4a,null))[_0xf545('0x25')](function(_0x52f631){if(_0x52f631){_0xe08298=_0x52f631[_0xf545('0x55')];var _0x1a03cc=_0xe08298[_0xf545('0x5c')](-0x1);if(_0x1a03cc==='/'){_0xe08298=_0xe08298[_0xf545('0x5d')](0x0,_0xe08298[_0xf545('0x5e')](_0x1a03cc));}var _0x223d75={'method':_0xf545('0x5f'),'uri':util[_0xf545('0x60')]('%s/custom_fields',_0xe08298),'headers':{'Content-Type':_0xf545('0x61'),'Accept':'application/json'},'json':!![]};if(_0x52f631[_0xf545('0x56')]===_0xf545('0x62')){_0x223d75[_0xf545('0x63')]['Authorization']=util['format'](_0xf545('0x64'),new Buffer(util['format']('%s:%s',_0x52f631[_0xf545('0x57')],_0x52f631[_0xf545('0x58')]))[_0xf545('0x65')]('base64'));}return rp(_0x223d75)[_0xf545('0x25')](function(_0x20c4d1){return _0x1ab75f[_0xf545('0x66')](_[_0xf545('0x2a')](_0x20c4d1[_0xf545('0x67')]['entries'],function(_0xd99de4){return{'id':_0xd99de4[_0xf545('0x28')],'name':_0xd99de4[_0xf545('0x28')],'type':_0xd99de4[_0xf545('0x50')],'active':_0xd99de4[_0xf545('0x68')],'label':_0xd99de4[_0xf545('0x69')],'custom':!![]};}));});}})['then'](function(_0x59270b){return{'count':_0x59270b[_0xf545('0x44')],'rows':_0x59270b};})[_0xf545('0x25')](respondWithResult(_0x5a4d4a,null))[_0xf545('0x46')](function(_0xe336fd){var _0x10796f=_0x2ebc81[_0xf545('0x2d')][_0xf545('0x6a')]?0x1f4:_0xe336fd[_0xf545('0x6b')]||0x1f4;logger[_0xf545('0x27')](_0xf545('0x6c'),_0xf545('0x6d'),_0x10796f,JSON['stringify'](_0xe336fd));delete _0xe336fd['name'];if(_0x10796f===0x191){_0x10796f=0x190;}_0x5a4d4a['status'](_0x10796f)[_0xf545('0x29')](_0x2ebc81[_0xf545('0x2d')]['test']?{'message':_0xf545('0x6e'),'statusCode':_0xe336fd[_0xf545('0x6b')]}:_0xe336fd);});}; \ No newline at end of file +var _0x53be=['format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','error','stack','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','keys','options','find','create','body','getConfigurations','DeskConfiguration','pick','addConfiguration','findOne','channel','getDescriptions','DeskField','Subjects','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','tokenSecret','slice','substring','GET'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0x53be,0xee));var _0xe53b=function(_0x5034e6,_0x4906ac){_0x5034e6=_0x5034e6-0x0;var _0x56263b=_0x53be[_0x5034e6];return _0x56263b;};'use strict';var emlformat=require(_0xe53b('0x0'));var rimraf=require(_0xe53b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe53b('0x2'));var rp=require(_0xe53b('0x3'));var moment=require(_0xe53b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe53b('0x5'));var util=require(_0xe53b('0x6'));var path=require(_0xe53b('0x7'));var sox=require(_0xe53b('0x8'));var csv=require(_0xe53b('0x9'));var ejs=require(_0xe53b('0xa'));var fs=require('fs');var fs_extra=require(_0xe53b('0xb'));var _=require('lodash');var squel=require(_0xe53b('0xc'));var crypto=require(_0xe53b('0xd'));var jsforce=require(_0xe53b('0xe'));var deskjs=require(_0xe53b('0xf'));var toCsv=require(_0xe53b('0x9'));var querystring=require('querystring');var Papa=require(_0xe53b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe53b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe53b('0x12'))(_0xe53b('0x13'));var utils=require('../../config/utils');var config=require(_0xe53b('0x14'));var licenseUtil=require(_0xe53b('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1553f9,_0x3a2e3e){_0x3a2e3e=_0x3a2e3e||0xcc;return function(_0x314fd1){if(_0x314fd1){return _0x1553f9[_0xe53b('0x16')](_0x3a2e3e);}return _0x1553f9['status'](_0x3a2e3e)[_0xe53b('0x17')]();};}function respondWithResult(_0x2d71d6,_0x52ad98){_0x52ad98=_0x52ad98||0xc8;return function(_0x227ba7){if(_0x227ba7){return _0x2d71d6[_0xe53b('0x18')](_0x52ad98)[_0xe53b('0x19')](_0x227ba7);}};}function respondWithFilteredResult(_0x57cf76,_0x789f27){return function(_0x31955d){if(_0x31955d){var _0x49b79c=typeof _0x789f27[_0xe53b('0x1a')]===_0xe53b('0x1b')&&typeof _0x789f27[_0xe53b('0x1c')]==='undefined';var _0x1ad47a=_0x31955d[_0xe53b('0x1d')];var _0x2da60a=_0x49b79c?0x0:_0x789f27[_0xe53b('0x1a')];var _0x417b10=_0x49b79c?_0x31955d[_0xe53b('0x1d')]:_0x789f27['offset']+_0x789f27[_0xe53b('0x1c')];var _0xc026bd;if(_0x417b10>=_0x1ad47a){_0x417b10=_0x1ad47a;_0xc026bd=0xc8;}else{_0xc026bd=0xce;}_0x57cf76[_0xe53b('0x18')](_0xc026bd);return _0x57cf76['set'](_0xe53b('0x1e'),_0x2da60a+'-'+_0x417b10+'/'+_0x1ad47a)[_0xe53b('0x19')](_0x31955d);}return null;};}function patchUpdates(_0x20fa77){return function(_0x4c07b4){try{jsonpatch['apply'](_0x4c07b4,_0x20fa77,!![]);}catch(_0x1f20cd){return BPromise['reject'](_0x1f20cd);}return _0x4c07b4[_0xe53b('0x1f')]();};}function saveUpdates(_0x16701c,_0x32b271){return function(_0xa05ce6){if(_0xa05ce6){return _0xa05ce6[_0xe53b('0x20')](_0x16701c)['then'](function(_0x40e03d){return _0x40e03d;});}return null;};}function removeEntity(_0x26ba5d,_0x270245){return function(_0x3976af){if(_0x3976af){return _0x3976af[_0xe53b('0x21')]()[_0xe53b('0x22')](function(){_0x26ba5d[_0xe53b('0x18')](0xcc)[_0xe53b('0x17')]();});}};}function handleEntityNotFound(_0x36f537,_0x3b5a92){return function(_0x1acce1){if(!_0x1acce1){_0x36f537[_0xe53b('0x16')](0x194);}return _0x1acce1;};}function handleError(_0x55c9cf,_0x40cdcd){_0x40cdcd=_0x40cdcd||0x1f4;return function(_0x26c9e3){logger[_0xe53b('0x23')](_0x26c9e3[_0xe53b('0x24')]);if(_0x26c9e3['name']){delete _0x26c9e3['name'];}_0x55c9cf[_0xe53b('0x18')](_0x40cdcd)[_0xe53b('0x25')](_0x26c9e3);};}exports[_0xe53b('0x26')]=function(_0x319004,_0x478227){var _0x24a534={},_0x42582d={},_0x3882ac={'count':0x0,'rows':[]};var _0x44444b=_[_0xe53b('0x27')](db[_0xe53b('0x28')][_0xe53b('0x29')],function(_0x2c6ca5){return{'name':_0x2c6ca5[_0xe53b('0x2a')],'type':_0x2c6ca5[_0xe53b('0x2b')][_0xe53b('0x2c')]};});_0x42582d[_0xe53b('0x2d')]=_[_0xe53b('0x27')](_0x44444b,_0xe53b('0x2e'));_0x42582d['query']=_['keys'](_0x319004[_0xe53b('0x2f')]);_0x42582d[_0xe53b('0x30')]=_[_0xe53b('0x31')](_0x42582d[_0xe53b('0x2d')],_0x42582d[_0xe53b('0x2f')]);_0x24a534[_0xe53b('0x32')]=_['intersection'](_0x42582d[_0xe53b('0x2d')],qs[_0xe53b('0x33')](_0x319004[_0xe53b('0x2f')][_0xe53b('0x33')]));_0x24a534[_0xe53b('0x32')]=_0x24a534['attributes'][_0xe53b('0x34')]?_0x24a534[_0xe53b('0x32')]:_0x42582d['model'];if(!_0x319004[_0xe53b('0x2f')][_0xe53b('0x35')]('nolimit')){_0x24a534['limit']=qs[_0xe53b('0x1c')](_0x319004[_0xe53b('0x2f')][_0xe53b('0x1c')]);_0x24a534[_0xe53b('0x1a')]=qs[_0xe53b('0x1a')](_0x319004[_0xe53b('0x2f')][_0xe53b('0x1a')]);}_0x24a534[_0xe53b('0x36')]=qs[_0xe53b('0x37')](_0x319004['query']['sort']);_0x24a534[_0xe53b('0x38')]=qs[_0xe53b('0x30')](_['pick'](_0x319004[_0xe53b('0x2f')],_0x42582d[_0xe53b('0x30')]),_0x44444b);if(_0x319004[_0xe53b('0x2f')]['filter']){_0x24a534['where']=_[_0xe53b('0x39')](_0x24a534[_0xe53b('0x38')],{'$or':_[_0xe53b('0x27')](_0x44444b,function(_0x7e76f3){if(_0x7e76f3[_0xe53b('0x2b')]!==_0xe53b('0x3a')){var _0x5626e0={};_0x5626e0[_0x7e76f3[_0xe53b('0x2e')]]={'$like':'%'+_0x319004[_0xe53b('0x2f')][_0xe53b('0x3b')]+'%'};return _0x5626e0;}})});}_0x24a534=_[_0xe53b('0x39')]({},_0x24a534,_0x319004['options']);var _0x2c38b4={'where':_0x24a534[_0xe53b('0x38')]};return db[_0xe53b('0x28')]['count'](_0x2c38b4)[_0xe53b('0x22')](function(_0x1e697d){_0x3882ac[_0xe53b('0x1d')]=_0x1e697d;if(_0x319004[_0xe53b('0x2f')][_0xe53b('0x3c')]){_0x24a534[_0xe53b('0x3d')]=[{'all':!![]}];}return db[_0xe53b('0x28')]['findAll'](_0x24a534);})[_0xe53b('0x22')](function(_0x414ff9){_0x3882ac[_0xe53b('0x3e')]=_0x414ff9;return _0x3882ac;})[_0xe53b('0x22')](respondWithFilteredResult(_0x478227,_0x24a534))[_0xe53b('0x3f')](handleError(_0x478227,null));};exports[_0xe53b('0x40')]=function(_0x4052b3,_0x2d8c5e){var _0x1658a2={'raw':![],'where':{'id':_0x4052b3[_0xe53b('0x41')]['id']}},_0x115492={};_0x115492[_0xe53b('0x2d')]=_[_0xe53b('0x42')](db['DeskAccount'][_0xe53b('0x29')]);_0x115492[_0xe53b('0x2f')]=_[_0xe53b('0x42')](_0x4052b3[_0xe53b('0x2f')]);_0x115492[_0xe53b('0x30')]=_[_0xe53b('0x31')](_0x115492[_0xe53b('0x2d')],_0x115492[_0xe53b('0x2f')]);_0x1658a2['attributes']=_['intersection'](_0x115492['model'],qs['fields'](_0x4052b3['query'][_0xe53b('0x33')]));_0x1658a2[_0xe53b('0x32')]=_0x1658a2[_0xe53b('0x32')][_0xe53b('0x34')]?_0x1658a2[_0xe53b('0x32')]:_0x115492['model'];if(_0x4052b3[_0xe53b('0x2f')][_0xe53b('0x3c')]){_0x1658a2[_0xe53b('0x3d')]=[{'all':!![]}];}_0x1658a2=_[_0xe53b('0x39')]({},_0x1658a2,_0x4052b3[_0xe53b('0x43')]);return db['DeskAccount'][_0xe53b('0x44')](_0x1658a2)[_0xe53b('0x22')](handleEntityNotFound(_0x2d8c5e,null))[_0xe53b('0x22')](respondWithResult(_0x2d8c5e,null))['catch'](handleError(_0x2d8c5e,null));};exports[_0xe53b('0x45')]=function(_0x5debc0,_0x357276){return db[_0xe53b('0x28')][_0xe53b('0x45')](_0x5debc0[_0xe53b('0x46')],{})['then'](respondWithResult(_0x357276,0xc9))[_0xe53b('0x3f')](handleError(_0x357276,null));};exports[_0xe53b('0x20')]=function(_0xf9c9e4,_0x333777){if(_0xf9c9e4[_0xe53b('0x46')]['id']){delete _0xf9c9e4[_0xe53b('0x46')]['id'];}return db[_0xe53b('0x28')]['find']({'where':{'id':_0xf9c9e4[_0xe53b('0x41')]['id']}})[_0xe53b('0x22')](handleEntityNotFound(_0x333777,null))[_0xe53b('0x22')](saveUpdates(_0xf9c9e4[_0xe53b('0x46')],null))[_0xe53b('0x22')](respondWithResult(_0x333777,null))[_0xe53b('0x3f')](handleError(_0x333777,null));};exports[_0xe53b('0x21')]=function(_0x4a96e1,_0x223ef7){return db[_0xe53b('0x28')][_0xe53b('0x44')]({'where':{'id':_0x4a96e1[_0xe53b('0x41')]['id']}})[_0xe53b('0x22')](handleEntityNotFound(_0x223ef7,null))[_0xe53b('0x22')](removeEntity(_0x223ef7,null))[_0xe53b('0x3f')](handleError(_0x223ef7,null));};exports[_0xe53b('0x47')]=function(_0x3c58f2,_0x1d5b7e,_0x336ae5){var _0x1b9f8c={};var _0x3f15c6={};var _0x2e8c2b;var _0x4cb33d;return db[_0xe53b('0x28')]['findOne']({'where':{'id':_0x3c58f2[_0xe53b('0x41')]['id']}})[_0xe53b('0x22')](handleEntityNotFound(_0x1d5b7e,null))[_0xe53b('0x22')](function(_0x1a64f9){if(_0x1a64f9){_0x2e8c2b=_0x1a64f9;_0x3f15c6[_0xe53b('0x2d')]=_[_0xe53b('0x42')](db[_0xe53b('0x48')]['rawAttributes']);_0x3f15c6['query']=_['keys'](_0x3c58f2[_0xe53b('0x2f')]);_0x3f15c6[_0xe53b('0x30')]=_[_0xe53b('0x31')](_0x3f15c6['model'],_0x3f15c6[_0xe53b('0x2f')]);_0x1b9f8c['attributes']=_['intersection'](_0x3f15c6[_0xe53b('0x2d')],qs[_0xe53b('0x33')](_0x3c58f2[_0xe53b('0x2f')]['fields']));_0x1b9f8c['attributes']=_0x1b9f8c[_0xe53b('0x32')]['length']?_0x1b9f8c[_0xe53b('0x32')]:_0x3f15c6[_0xe53b('0x2d')];_0x1b9f8c['order']=qs[_0xe53b('0x37')](_0x3c58f2[_0xe53b('0x2f')][_0xe53b('0x37')]);_0x1b9f8c['where']=qs[_0xe53b('0x30')](_[_0xe53b('0x49')](_0x3c58f2[_0xe53b('0x2f')],_0x3f15c6['filters']));if(_0x3c58f2[_0xe53b('0x2f')][_0xe53b('0x3b')]){_0x1b9f8c[_0xe53b('0x38')]=_[_0xe53b('0x39')](_0x1b9f8c[_0xe53b('0x38')],{'$or':_[_0xe53b('0x27')](_0x1b9f8c[_0xe53b('0x32')],function(_0x2c4396){var _0x152e10={};_0x152e10[_0x2c4396]={'$like':'%'+_0x3c58f2[_0xe53b('0x2f')][_0xe53b('0x3b')]+'%'};return _0x152e10;})});}_0x1b9f8c=_[_0xe53b('0x39')]({},_0x1b9f8c,_0x3c58f2[_0xe53b('0x43')]);return _0x2e8c2b[_0xe53b('0x47')](_0x1b9f8c);}})[_0xe53b('0x22')](function(_0x5eda47){if(_0x5eda47){_0x4cb33d=_0x5eda47[_0xe53b('0x34')];if(!_0x3c58f2[_0xe53b('0x2f')][_0xe53b('0x35')]('nolimit')){_0x1b9f8c[_0xe53b('0x1c')]=qs['limit'](_0x3c58f2[_0xe53b('0x2f')][_0xe53b('0x1c')]);_0x1b9f8c[_0xe53b('0x1a')]=qs[_0xe53b('0x1a')](_0x3c58f2[_0xe53b('0x2f')][_0xe53b('0x1a')]);}return _0x2e8c2b['getConfigurations'](_0x1b9f8c);}})[_0xe53b('0x22')](function(_0x42a6f8){if(_0x42a6f8){return _0x42a6f8?{'count':_0x4cb33d,'rows':_0x42a6f8}:null;}})[_0xe53b('0x22')](respondWithResult(_0x1d5b7e,null))[_0xe53b('0x3f')](handleError(_0x1d5b7e,null));};exports[_0xe53b('0x4a')]=function(_0x1a19f2,_0x2cabb0,_0x29e075){if(_0x1a19f2['body']['id']){delete _0x1a19f2[_0xe53b('0x46')]['id'];}return db[_0xe53b('0x28')][_0xe53b('0x4b')]({'where':{'id':_0x1a19f2[_0xe53b('0x41')]['id']}})[_0xe53b('0x22')](handleEntityNotFound(_0x2cabb0,null))[_0xe53b('0x22')](function(_0x530cab){if(_0x530cab){_0x1a19f2[_0xe53b('0x46')]['AccountId']=_0x530cab['id'];_0x1a19f2[_0xe53b('0x46')]['Subjects']=integrations['getSubjects'](_0x1a19f2[_0xe53b('0x46')][_0xe53b('0x4c')],_0x1a19f2[_0xe53b('0x46')][_0xe53b('0x2b')]);_0x1a19f2['body']['Descriptions']=integrations[_0xe53b('0x4d')](_0x1a19f2['body'][_0xe53b('0x4c')],_0x1a19f2[_0xe53b('0x46')][_0xe53b('0x2b')]);return db[_0xe53b('0x48')][_0xe53b('0x45')](_0x1a19f2[_0xe53b('0x46')],{'include':[{'model':db[_0xe53b('0x4e')],'as':_0xe53b('0x4f')},{'model':db[_0xe53b('0x4e')],'as':_0xe53b('0x50')}]});}return null;})['then'](respondWithResult(_0x2cabb0,null))['catch'](handleError(_0x2cabb0,null));};exports[_0xe53b('0x51')]=function(_0x6e7b27,_0x5d3990,_0x1ca85d){var _0x238445=[{'name':_0xe53b('0x52'),'label':_0xe53b('0x52'),'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 _0x58cb7a='';return db[_0xe53b('0x28')][_0xe53b('0x4b')]({'where':{'id':_0x6e7b27[_0xe53b('0x41')]['id']},'attributes':['id',_0xe53b('0x53'),_0xe53b('0x54'),_0xe53b('0x55'),_0xe53b('0x56'),_0xe53b('0x57'),'consumerSecret','token',_0xe53b('0x58')]})[_0xe53b('0x22')](handleEntityNotFound(_0x5d3990,null))[_0xe53b('0x22')](function(_0x44c781){if(_0x44c781){_0x58cb7a=_0x44c781[_0xe53b('0x53')];var _0x3d2b94=_0x58cb7a[_0xe53b('0x59')](-0x1);if(_0x3d2b94==='/'){_0x58cb7a=_0x58cb7a[_0xe53b('0x5a')](0x0,_0x58cb7a['lastIndexOf'](_0x3d2b94));}var _0x4e16eb={'method':_0xe53b('0x5b'),'uri':util[_0xe53b('0x5c')](_0xe53b('0x5d'),_0x58cb7a),'headers':{'Content-Type':_0xe53b('0x5e'),'Accept':_0xe53b('0x5e')},'json':!![]};if(_0x44c781[_0xe53b('0x54')]===_0xe53b('0x5f')){_0x4e16eb['headers'][_0xe53b('0x60')]=util['format'](_0xe53b('0x61'),new Buffer(util['format'](_0xe53b('0x62'),_0x44c781[_0xe53b('0x55')],_0x44c781[_0xe53b('0x56')]))[_0xe53b('0x63')](_0xe53b('0x64')));}return rp(_0x4e16eb)[_0xe53b('0x22')](function(_0x5b1815){return _0x238445[_0xe53b('0x65')](_['map'](_0x5b1815[_0xe53b('0x66')][_0xe53b('0x67')],function(_0x2a9f14){return{'id':_0x2a9f14['name'],'name':_0x2a9f14[_0xe53b('0x2e')],'type':_0x2a9f14[_0xe53b('0x2b')],'active':_0x2a9f14[_0xe53b('0x68')],'label':_0x2a9f14[_0xe53b('0x69')],'custom':!![]};}));});}})['then'](function(_0x5b0e23){return{'count':_0x5b0e23[_0xe53b('0x34')],'rows':_0x5b0e23};})[_0xe53b('0x22')](respondWithResult(_0x5d3990,null))[_0xe53b('0x3f')](function(_0x48b24d){var _0x2ee8b7=_0x6e7b27[_0xe53b('0x2f')][_0xe53b('0x6a')]?0x1f4:_0x48b24d[_0xe53b('0x6b')]||0x1f4;logger[_0xe53b('0x23')](_0xe53b('0x6c'),_0xe53b('0x51'),_0x2ee8b7,JSON[_0xe53b('0x6d')](_0x48b24d));delete _0x48b24d[_0xe53b('0x2e')];if(_0x2ee8b7===0x191){_0x2ee8b7=0x190;}_0x5d3990['status'](_0x2ee8b7)[_0xe53b('0x25')](_0x6e7b27[_0xe53b('0x2f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x48b24d[_0xe53b('0x6b')]}:_0x48b24d);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index d788de5..65a091d 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 _0xc00e=['define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x7589ab,_0x5ad429){var _0x56d958=function(_0x330a50){while(--_0x330a50){_0x7589ab['push'](_0x7589ab['shift']());}};_0x56d958(++_0x5ad429);}(_0xc00e,0x19b));var _0xec00=function(_0x5decca,_0x3543b4){_0x5decca=_0x5decca-0x0;var _0x54e3d0=_0xc00e[_0x5decca];return _0x54e3d0;};'use strict';var _=require(_0xec00('0x0'));var util=require(_0xec00('0x1'));var logger=require(_0xec00('0x2'))(_0xec00('0x3'));var moment=require(_0xec00('0x4'));var BPromise=require(_0xec00('0x5'));var rp=require(_0xec00('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec00('0x7'));var config=require(_0xec00('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x43dbb7,_0x5a50f8){return _0x43dbb7[_0xec00('0x9')](_0xec00('0xa'),attributes,{'tableName':_0xec00('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9112=['../../config/environment','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x53a6c9,_0x46ef32){var _0x1fd158=function(_0x144f96){while(--_0x144f96){_0x53a6c9['push'](_0x53a6c9['shift']());}};_0x1fd158(++_0x46ef32);}(_0x9112,0x155));var _0x2911=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9112[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2911('0x0'));var util=require(_0x2911('0x1'));var logger=require(_0x2911('0x2'))('api');var moment=require(_0x2911('0x3'));var BPromise=require('bluebird');var rp=require(_0x2911('0x4'));var fs=require('fs');var path=require(_0x2911('0x5'));var rimraf=require(_0x2911('0x6'));var config=require(_0x2911('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x2911('0x8')]=function(_0x50f16a,_0x26ce20){return _0x50f16a[_0x2911('0x9')](_0x2911('0xa'),attributes,{'tableName':_0x2911('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 529ecfd..6fd2bc2 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 _0xa98f=['../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','options','raw','where','attributes','limit','include','map','model','then','ShowDeskAccount','lodash','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa98f,0x1c9));var _0xfa98=function(_0x337bee,_0x53cbca){_0x337bee=_0x337bee-0x0;var _0x24c37d=_0xa98f[_0x337bee];return _0x24c37d;};'use strict';var _=require(_0xfa98('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfa98('0x1'));var rs=require(_0xfa98('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa98('0x3'))['db'];var utils=require(_0xfa98('0x4'));var logger=require(_0xfa98('0x5'))(_0xfa98('0x6'));var config=require(_0xfa98('0x7'));var jayson=require(_0xfa98('0x8'));var client=jayson['client'][_0xfa98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4875a2,_0x5a462d,_0x863df0){return new BPromise(function(_0x571924,_0x29056d){return client['request'](_0x4875a2,_0x863df0)['then'](function(_0x21a97b){logger[_0xfa98('0xa')]('DeskAccount,\x20%s,\x20%s',_0x5a462d,_0xfa98('0xb'));logger[_0xfa98('0xc')](_0xfa98('0xd'),_0x5a462d,_0xfa98('0xb'),JSON[_0xfa98('0xe')](_0x21a97b));if(_0x21a97b['error']){if(_0x21a97b[_0xfa98('0xf')][_0xfa98('0x10')]===0x1f4){logger[_0xfa98('0xf')](_0xfa98('0x11'),_0x5a462d,_0x21a97b[_0xfa98('0xf')][_0xfa98('0x12')]);return _0x29056d(_0x21a97b[_0xfa98('0xf')]['message']);}logger[_0xfa98('0xf')](_0xfa98('0x11'),_0x5a462d,_0x21a97b[_0xfa98('0xf')]['message']);return _0x571924(_0x21a97b[_0xfa98('0xf')][_0xfa98('0x12')]);}else{logger[_0xfa98('0xa')](_0xfa98('0x11'),_0x5a462d,'request\x20sent');_0x571924(_0x21a97b[_0xfa98('0x13')]['message']);}})[_0xfa98('0x14')](function(_0x28b9bb){logger[_0xfa98('0xf')](_0xfa98('0x11'),_0x5a462d,_0x28b9bb);_0x29056d(_0x28b9bb);});});}exports[_0xfa98('0x15')]=function(_0x54963d){var _0x55f8e9=this;return new Promise(function(_0x2fac2c,_0x1f5fe9){return db[_0xfa98('0x16')]['findAll']({'raw':_0x54963d[_0xfa98('0x17')]?_0x54963d[_0xfa98('0x17')][_0xfa98('0x18')]===undefined?!![]:![]:!![],'where':_0x54963d[_0xfa98('0x17')]?_0x54963d[_0xfa98('0x17')][_0xfa98('0x19')]||null:null,'attributes':_0x54963d[_0xfa98('0x17')]?_0x54963d[_0xfa98('0x17')][_0xfa98('0x1a')]||null:null,'limit':_0x54963d[_0xfa98('0x17')]?_0x54963d[_0xfa98('0x17')][_0xfa98('0x1b')]||null:null,'include':_0x54963d[_0xfa98('0x17')]?_0x54963d[_0xfa98('0x17')][_0xfa98('0x1c')]?_[_0xfa98('0x1d')](_0x54963d['options'][_0xfa98('0x1c')],function(_0x332127){return{'model':db[_0x332127[_0xfa98('0x1e')]],'as':_0x332127['as'],'attributes':_0x332127[_0xfa98('0x1a')],'include':_0x332127[_0xfa98('0x1c')]?_['map'](_0x332127[_0xfa98('0x1c')],function(_0x1b4d4f){return{'model':db[_0x1b4d4f[_0xfa98('0x1e')]],'as':_0x1b4d4f['as'],'attributes':_0x1b4d4f[_0xfa98('0x1a')],'include':_0x1b4d4f[_0xfa98('0x1c')]?_[_0xfa98('0x1d')](_0x1b4d4f['include'],function(_0x4f4d45){return{'model':db[_0x4f4d45[_0xfa98('0x1e')]],'as':_0x4f4d45['as'],'attributes':_0x4f4d45[_0xfa98('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfa98('0x1f')](function(_0x44d6a2){logger[_0xfa98('0xa')](_0xfa98('0x15'),_0x54963d);logger['debug'](_0xfa98('0x15'),_0x54963d,JSON[_0xfa98('0xe')](_0x44d6a2));_0x2fac2c(_0x44d6a2);})['catch'](function(_0xc734d5){logger['error']('GetDeskAccount',_0xc734d5[_0xfa98('0x12')],_0x54963d);_0x1f5fe9(_0x55f8e9[_0xfa98('0xf')](0x1f4,_0xc734d5[_0xfa98('0x12')]));});});};exports[_0xfa98('0x20')]=function(_0x3f5db3){var _0x28e57a=this;return new Promise(function(_0x50ecae,_0x1b358b){return db[_0xfa98('0x16')]['find']({'raw':_0x3f5db3[_0xfa98('0x17')]?_0x3f5db3[_0xfa98('0x17')][_0xfa98('0x18')]===undefined?!![]:![]:!![],'where':_0x3f5db3['options']?_0x3f5db3[_0xfa98('0x17')][_0xfa98('0x19')]||null:null,'attributes':_0x3f5db3[_0xfa98('0x17')]?_0x3f5db3[_0xfa98('0x17')][_0xfa98('0x1a')]||null:null,'include':_0x3f5db3[_0xfa98('0x17')]?_0x3f5db3[_0xfa98('0x17')][_0xfa98('0x1c')]?_[_0xfa98('0x1d')](_0x3f5db3[_0xfa98('0x17')][_0xfa98('0x1c')],function(_0x1e3a0d){return{'model':db[_0x1e3a0d[_0xfa98('0x1e')]],'as':_0x1e3a0d['as'],'attributes':_0x1e3a0d[_0xfa98('0x1a')],'include':_0x1e3a0d[_0xfa98('0x1c')]?_[_0xfa98('0x1d')](_0x1e3a0d[_0xfa98('0x1c')],function(_0x377bab){return{'model':db[_0x377bab['model']],'as':_0x377bab['as'],'attributes':_0x377bab['attributes'],'include':_0x377bab[_0xfa98('0x1c')]?_[_0xfa98('0x1d')](_0x377bab[_0xfa98('0x1c')],function(_0x1e77de){return{'model':db[_0x1e77de['model']],'as':_0x1e77de['as'],'attributes':_0x1e77de[_0xfa98('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfa98('0x1f')](function(_0x33815d){logger['info']('ShowDeskAccount',_0x3f5db3);logger['debug'](_0xfa98('0x20'),_0x3f5db3,JSON[_0xfa98('0xe')](_0x33815d));_0x50ecae(_0x33815d);})[_0xfa98('0x14')](function(_0x2ff98f){logger[_0xfa98('0xf')](_0xfa98('0x20'),_0x2ff98f['message'],_0x3f5db3);_0x1b358b(_0x28e57a[_0xfa98('0xf')](0x1f4,_0x2ff98f['message']));});});}; \ No newline at end of file +var _0x3b83=['jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','GetDeskAccount','ShowDeskAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0x3b83,0x118));var _0x33b8=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3b83[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x33b8('0x0'));var util=require('util');var moment=require(_0x33b8('0x1'));var BPromise=require(_0x33b8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x33b8('0x3'));var db=require(_0x33b8('0x4'))['db'];var utils=require(_0x33b8('0x5'));var logger=require(_0x33b8('0x6'))('rpc');var config=require(_0x33b8('0x7'));var jayson=require(_0x33b8('0x8'));var client=jayson[_0x33b8('0x9')][_0x33b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47f82a,_0x139092,_0x439f22){return new BPromise(function(_0x216f80,_0x6c36d0){return client[_0x33b8('0xb')](_0x47f82a,_0x439f22)['then'](function(_0x294b2e){logger[_0x33b8('0xc')](_0x33b8('0xd'),_0x139092,_0x33b8('0xe'));logger[_0x33b8('0xf')](_0x33b8('0x10'),_0x139092,_0x33b8('0xe'),JSON[_0x33b8('0x11')](_0x294b2e));if(_0x294b2e['error']){if(_0x294b2e[_0x33b8('0x12')][_0x33b8('0x13')]===0x1f4){logger[_0x33b8('0x12')](_0x33b8('0xd'),_0x139092,_0x294b2e[_0x33b8('0x12')]['message']);return _0x6c36d0(_0x294b2e[_0x33b8('0x12')][_0x33b8('0x14')]);}logger['error'](_0x33b8('0xd'),_0x139092,_0x294b2e['error'][_0x33b8('0x14')]);return _0x216f80(_0x294b2e[_0x33b8('0x12')][_0x33b8('0x14')]);}else{logger[_0x33b8('0xc')](_0x33b8('0xd'),_0x139092,'request\x20sent');_0x216f80(_0x294b2e[_0x33b8('0x15')][_0x33b8('0x14')]);}})[_0x33b8('0x16')](function(_0x4c10a5){logger[_0x33b8('0x12')](_0x33b8('0xd'),_0x139092,_0x4c10a5);_0x6c36d0(_0x4c10a5);});});}exports['GetDeskAccount']=function(_0x1d3b54){var _0x25fd62=this;return new Promise(function(_0x411bf6,_0x43c762){return db[_0x33b8('0x17')][_0x33b8('0x18')]({'raw':_0x1d3b54[_0x33b8('0x19')]?_0x1d3b54['options'][_0x33b8('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d3b54[_0x33b8('0x19')]?_0x1d3b54['options'][_0x33b8('0x1b')]||null:null,'attributes':_0x1d3b54[_0x33b8('0x19')]?_0x1d3b54[_0x33b8('0x19')][_0x33b8('0x1c')]||null:null,'limit':_0x1d3b54['options']?_0x1d3b54[_0x33b8('0x19')][_0x33b8('0x1d')]||null:null,'include':_0x1d3b54[_0x33b8('0x19')]?_0x1d3b54[_0x33b8('0x19')][_0x33b8('0x1e')]?_['map'](_0x1d3b54['options'][_0x33b8('0x1e')],function(_0x2f6a32){return{'model':db[_0x2f6a32[_0x33b8('0x1f')]],'as':_0x2f6a32['as'],'attributes':_0x2f6a32[_0x33b8('0x1c')],'include':_0x2f6a32[_0x33b8('0x1e')]?_['map'](_0x2f6a32[_0x33b8('0x1e')],function(_0xf1e993){return{'model':db[_0xf1e993[_0x33b8('0x1f')]],'as':_0xf1e993['as'],'attributes':_0xf1e993[_0x33b8('0x1c')],'include':_0xf1e993[_0x33b8('0x1e')]?_[_0x33b8('0x20')](_0xf1e993[_0x33b8('0x1e')],function(_0x599b8b){return{'model':db[_0x599b8b[_0x33b8('0x1f')]],'as':_0x599b8b['as'],'attributes':_0x599b8b[_0x33b8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x33b8('0x21')](function(_0x13ffc8){logger[_0x33b8('0xc')](_0x33b8('0x22'),_0x1d3b54);logger['debug'](_0x33b8('0x22'),_0x1d3b54,JSON[_0x33b8('0x11')](_0x13ffc8));_0x411bf6(_0x13ffc8);})[_0x33b8('0x16')](function(_0x5e8065){logger[_0x33b8('0x12')](_0x33b8('0x22'),_0x5e8065['message'],_0x1d3b54);_0x43c762(_0x25fd62['error'](0x1f4,_0x5e8065['message']));});});};exports[_0x33b8('0x23')]=function(_0x1aa5ae){var _0x43efbb=this;return new Promise(function(_0x26338f,_0x24ef68){return db[_0x33b8('0x17')]['find']({'raw':_0x1aa5ae['options']?_0x1aa5ae[_0x33b8('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1aa5ae[_0x33b8('0x19')]?_0x1aa5ae[_0x33b8('0x19')][_0x33b8('0x1b')]||null:null,'attributes':_0x1aa5ae[_0x33b8('0x19')]?_0x1aa5ae['options']['attributes']||null:null,'include':_0x1aa5ae[_0x33b8('0x19')]?_0x1aa5ae[_0x33b8('0x19')][_0x33b8('0x1e')]?_[_0x33b8('0x20')](_0x1aa5ae['options'][_0x33b8('0x1e')],function(_0x537927){return{'model':db[_0x537927[_0x33b8('0x1f')]],'as':_0x537927['as'],'attributes':_0x537927[_0x33b8('0x1c')],'include':_0x537927['include']?_[_0x33b8('0x20')](_0x537927[_0x33b8('0x1e')],function(_0x21c67c){return{'model':db[_0x21c67c[_0x33b8('0x1f')]],'as':_0x21c67c['as'],'attributes':_0x21c67c[_0x33b8('0x1c')],'include':_0x21c67c['include']?_[_0x33b8('0x20')](_0x21c67c['include'],function(_0x15c3e2){return{'model':db[_0x15c3e2['model']],'as':_0x15c3e2['as'],'attributes':_0x15c3e2[_0x33b8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x33b8('0x21')](function(_0x1c18fc){logger[_0x33b8('0xc')](_0x33b8('0x23'),_0x1aa5ae);logger[_0x33b8('0xf')](_0x33b8('0x23'),_0x1aa5ae,JSON[_0x33b8('0x11')](_0x1c18fc));_0x26338f(_0x1c18fc);})[_0x33b8('0x16')](function(_0x20cf92){logger['error'](_0x33b8('0x23'),_0x20cf92[_0x33b8('0x14')],_0x1aa5ae);_0x24ef68(_0x43efbb['error'](0x1f4,_0x20cf92[_0x33b8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index d52dbbc..bfd7232 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 _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x105e3e,_0x4cb667){var _0x5b0125=function(_0x877866){while(--_0x877866){_0x105e3e['push'](_0x105e3e['shift']());}};_0x5b0125(++_0x4cb667);}(_0x55ca,0x126));var _0xa55c=function(_0x2610db,_0x454344){_0x2610db=_0x2610db-0x0;var _0x5d4d96=_0x55ca[_0x2610db];return _0x5d4d96;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x5dc0fc,_0x27e07e){var _0x124aee=function(_0x31e2ae){while(--_0x31e2ae){_0x5dc0fc['push'](_0x5dc0fc['shift']());}};_0x124aee(++_0x27e07e);}(_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/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',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/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index b540530..9cfd633 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 _0x3545=['exports','STRING','sequelize'];(function(_0x295e40,_0x373e2f){var _0x20b246=function(_0x5dcd00){while(--_0x5dcd00){_0x295e40['push'](_0x295e40['shift']());}};_0x20b246(++_0x373e2f);}(_0x3545,0xef));var _0x5354=function(_0x1bc41f,_0x2e6cd7){_0x1bc41f=_0x1bc41f-0x0;var _0x1f7025=_0x3545[_0x1bc41f];return _0x1f7025;};'use strict';var Sequelize=require(_0x5354('0x0'));module[_0x5354('0x1')]={'name':{'type':Sequelize[_0x5354('0x2')]},'description':{'type':Sequelize[_0x5354('0x2')]}}; \ No newline at end of file +var _0x10e1=['sequelize','STRING'];(function(_0x1a2354,_0x595fb0){var _0x2c37ac=function(_0x1b61ef){while(--_0x1b61ef){_0x1a2354['push'](_0x1a2354['shift']());}};_0x2c37ac(++_0x595fb0);}(_0x10e1,0xce));var _0x110e=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x10e1[_0x35da42];return _0x370035;};'use strict';var Sequelize=require(_0x110e('0x0'));module['exports']={'name':{'type':Sequelize[_0x110e('0x1')]},'description':{'type':Sequelize[_0x110e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index ae278eb..7f75b32 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 _0xdc81=['count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','DeskConfiguration','rawAttributes','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','intersection','create','body','find','getFields','DeskField','pick','getSubjects','getDescriptions','findOne','setTags','ids','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined'];(function(_0x50d17b,_0x17cc5e){var _0x35038b=function(_0x24c078){while(--_0x24c078){_0x50d17b['push'](_0x50d17b['shift']());}};_0x35038b(++_0x17cc5e);}(_0xdc81,0x82));var _0x1dc8=function(_0x161ee3,_0x5a680f){_0x161ee3=_0x161ee3-0x0;var _0x49f8f6=_0xdc81[_0x161ee3];return _0x49f8f6;};'use strict';var emlformat=require(_0x1dc8('0x0'));var rimraf=require(_0x1dc8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1dc8('0x2'));var BPromise=require(_0x1dc8('0x3'));var Mustache=require(_0x1dc8('0x4'));var util=require(_0x1dc8('0x5'));var path=require('path');var sox=require(_0x1dc8('0x6'));var csv=require(_0x1dc8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1dc8('0x8'));var _=require(_0x1dc8('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1dc8('0xa'));var deskjs=require(_0x1dc8('0xb'));var toCsv=require(_0x1dc8('0x7'));var querystring=require(_0x1dc8('0xc'));var Papa=require('papaparse');var Redis=require(_0x1dc8('0xd'));var authService=require(_0x1dc8('0xe'));var qs=require(_0x1dc8('0xf'));var as=require(_0x1dc8('0x10'));var hardwareService=require(_0x1dc8('0x11'));var logger=require(_0x1dc8('0x12'))(_0x1dc8('0x13'));var utils=require(_0x1dc8('0x14'));var config=require(_0x1dc8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1dc8('0x16'))['db'];function respondWithStatusCode(_0x563c8b,_0x5c0e43){_0x5c0e43=_0x5c0e43||0xcc;return function(_0x1d1533){if(_0x1d1533){return _0x563c8b[_0x1dc8('0x17')](_0x5c0e43);}return _0x563c8b['status'](_0x5c0e43)[_0x1dc8('0x18')]();};}function respondWithResult(_0x309271,_0x529d44){_0x529d44=_0x529d44||0xc8;return function(_0x4e22c8){if(_0x4e22c8){return _0x309271[_0x1dc8('0x19')](_0x529d44)[_0x1dc8('0x1a')](_0x4e22c8);}};}function respondWithFilteredResult(_0x160e6f,_0x29e049){return function(_0x2c3cde){if(_0x2c3cde){var _0x2eacfc=typeof _0x29e049[_0x1dc8('0x1b')]==='undefined'&&typeof _0x29e049[_0x1dc8('0x1c')]===_0x1dc8('0x1d');var _0x3891ee=_0x2c3cde[_0x1dc8('0x1e')];var _0x2799d7=_0x2eacfc?0x0:_0x29e049[_0x1dc8('0x1b')];var _0x551ca8=_0x2eacfc?_0x2c3cde[_0x1dc8('0x1e')]:_0x29e049[_0x1dc8('0x1b')]+_0x29e049['limit'];var _0x41a59b;if(_0x551ca8>=_0x3891ee){_0x551ca8=_0x3891ee;_0x41a59b=0xc8;}else{_0x41a59b=0xce;}_0x160e6f[_0x1dc8('0x19')](_0x41a59b);return _0x160e6f[_0x1dc8('0x1f')](_0x1dc8('0x20'),_0x2799d7+'-'+_0x551ca8+'/'+_0x3891ee)[_0x1dc8('0x1a')](_0x2c3cde);}return null;};}function patchUpdates(_0x4cb7d5){return function(_0x54bd7d){try{jsonpatch[_0x1dc8('0x21')](_0x54bd7d,_0x4cb7d5,!![]);}catch(_0x345f49){return BPromise[_0x1dc8('0x22')](_0x345f49);}return _0x54bd7d['save']();};}function saveUpdates(_0x31ff17,_0x3112bd){return function(_0x5e1abe){if(_0x5e1abe){return _0x5e1abe['update'](_0x31ff17)[_0x1dc8('0x23')](function(_0x43e94a){return _0x43e94a;});}return null;};}function removeEntity(_0x3e7f56,_0x2a2dd9){return function(_0x299ad5){if(_0x299ad5){return _0x299ad5[_0x1dc8('0x24')]()[_0x1dc8('0x23')](function(){_0x3e7f56[_0x1dc8('0x19')](0xcc)[_0x1dc8('0x18')]();});}};}function handleEntityNotFound(_0x23ed94,_0x12938f){return function(_0x342d63){if(!_0x342d63){_0x23ed94[_0x1dc8('0x17')](0x194);}return _0x342d63;};}function handleError(_0x3d2b8f,_0x6f459e){_0x6f459e=_0x6f459e||0x1f4;return function(_0x501add){logger['error'](_0x501add[_0x1dc8('0x25')]);if(_0x501add[_0x1dc8('0x26')]){delete _0x501add[_0x1dc8('0x26')];}_0x3d2b8f[_0x1dc8('0x19')](_0x6f459e)[_0x1dc8('0x27')](_0x501add);};}exports[_0x1dc8('0x28')]=function(_0x4bfdac,_0x4a1ca3){var _0x5b8b4e={},_0x17c045={},_0x5c5587={'count':0x0,'rows':[]};var _0x4e441a=_[_0x1dc8('0x29')](db[_0x1dc8('0x2a')][_0x1dc8('0x2b')],function(_0x5a4904){return{'name':_0x5a4904['fieldName'],'type':_0x5a4904[_0x1dc8('0x2c')][_0x1dc8('0x2d')]};});_0x17c045[_0x1dc8('0x2e')]=_[_0x1dc8('0x29')](_0x4e441a,_0x1dc8('0x26'));_0x17c045[_0x1dc8('0x2f')]=_[_0x1dc8('0x30')](_0x4bfdac[_0x1dc8('0x2f')]);_0x17c045['filters']=_['intersection'](_0x17c045[_0x1dc8('0x2e')],_0x17c045[_0x1dc8('0x2f')]);_0x5b8b4e[_0x1dc8('0x31')]=_['intersection'](_0x17c045['model'],qs[_0x1dc8('0x32')](_0x4bfdac[_0x1dc8('0x2f')]['fields']));_0x5b8b4e[_0x1dc8('0x31')]=_0x5b8b4e[_0x1dc8('0x31')][_0x1dc8('0x33')]?_0x5b8b4e['attributes']:_0x17c045[_0x1dc8('0x2e')];if(!_0x4bfdac['query'][_0x1dc8('0x34')](_0x1dc8('0x35'))){_0x5b8b4e[_0x1dc8('0x1c')]=qs[_0x1dc8('0x1c')](_0x4bfdac['query'][_0x1dc8('0x1c')]);_0x5b8b4e[_0x1dc8('0x1b')]=qs[_0x1dc8('0x1b')](_0x4bfdac[_0x1dc8('0x2f')]['offset']);}_0x5b8b4e[_0x1dc8('0x36')]=qs['sort'](_0x4bfdac['query'][_0x1dc8('0x37')]);_0x5b8b4e[_0x1dc8('0x38')]=qs[_0x1dc8('0x39')](_['pick'](_0x4bfdac[_0x1dc8('0x2f')],_0x17c045[_0x1dc8('0x39')]),_0x4e441a);if(_0x4bfdac[_0x1dc8('0x2f')]['filter']){_0x5b8b4e[_0x1dc8('0x38')]=_[_0x1dc8('0x3a')](_0x5b8b4e[_0x1dc8('0x38')],{'$or':_[_0x1dc8('0x29')](_0x4e441a,function(_0x3666de){if(_0x3666de['type']!==_0x1dc8('0x3b')){var _0x328dcd={};_0x328dcd[_0x3666de[_0x1dc8('0x26')]]={'$like':'%'+_0x4bfdac['query'][_0x1dc8('0x3c')]+'%'};return _0x328dcd;}})});}_0x5b8b4e=_[_0x1dc8('0x3a')]({},_0x5b8b4e,_0x4bfdac[_0x1dc8('0x3d')]);var _0x2ee16e={'where':_0x5b8b4e[_0x1dc8('0x38')]};return db['DeskConfiguration'][_0x1dc8('0x1e')](_0x2ee16e)[_0x1dc8('0x23')](function(_0x275833){_0x5c5587[_0x1dc8('0x1e')]=_0x275833;if(_0x4bfdac['query'][_0x1dc8('0x3e')]){_0x5b8b4e[_0x1dc8('0x3f')]=[{'all':!![]}];}return db[_0x1dc8('0x2a')][_0x1dc8('0x40')](_0x5b8b4e);})[_0x1dc8('0x23')](function(_0x1624c2){_0x5c5587[_0x1dc8('0x41')]=_0x1624c2;return _0x5c5587;})['then'](respondWithFilteredResult(_0x4a1ca3,_0x5b8b4e))[_0x1dc8('0x42')](handleError(_0x4a1ca3,null));};exports['show']=function(_0x2c83d6,_0x40d19b){var _0xfb1bf9={'raw':![],'where':{'id':_0x2c83d6[_0x1dc8('0x43')]['id']}},_0x117420={};_0x117420[_0x1dc8('0x2e')]=_[_0x1dc8('0x30')](db['DeskConfiguration'][_0x1dc8('0x2b')]);_0x117420[_0x1dc8('0x2f')]=_['keys'](_0x2c83d6[_0x1dc8('0x2f')]);_0x117420['filters']=_[_0x1dc8('0x44')](_0x117420[_0x1dc8('0x2e')],_0x117420['query']);_0xfb1bf9[_0x1dc8('0x31')]=_[_0x1dc8('0x44')](_0x117420['model'],qs['fields'](_0x2c83d6[_0x1dc8('0x2f')][_0x1dc8('0x32')]));_0xfb1bf9[_0x1dc8('0x31')]=_0xfb1bf9[_0x1dc8('0x31')]['length']?_0xfb1bf9[_0x1dc8('0x31')]:_0x117420[_0x1dc8('0x2e')];if(_0x2c83d6['query'][_0x1dc8('0x3e')]){_0xfb1bf9['include']=[{'all':!![]}];}_0xfb1bf9=_[_0x1dc8('0x3a')]({},_0xfb1bf9,_0x2c83d6[_0x1dc8('0x3d')]);return db[_0x1dc8('0x2a')]['find'](_0xfb1bf9)[_0x1dc8('0x23')](handleEntityNotFound(_0x40d19b,null))[_0x1dc8('0x23')](respondWithResult(_0x40d19b,null))[_0x1dc8('0x42')](handleError(_0x40d19b,null));};exports[_0x1dc8('0x45')]=function(_0x3e953f,_0x5a73ea){return db[_0x1dc8('0x2a')][_0x1dc8('0x45')](_0x3e953f[_0x1dc8('0x46')],{})[_0x1dc8('0x23')](respondWithResult(_0x5a73ea,0xc9))[_0x1dc8('0x42')](handleError(_0x5a73ea,null));};exports['update']=function(_0x2e6bd0,_0x175d07){if(_0x2e6bd0[_0x1dc8('0x46')]['id']){delete _0x2e6bd0[_0x1dc8('0x46')]['id'];}return db[_0x1dc8('0x2a')]['find']({'where':{'id':_0x2e6bd0[_0x1dc8('0x43')]['id']}})[_0x1dc8('0x23')](handleEntityNotFound(_0x175d07,null))['then'](saveUpdates(_0x2e6bd0[_0x1dc8('0x46')],null))[_0x1dc8('0x23')](respondWithResult(_0x175d07,null))['catch'](handleError(_0x175d07,null));};exports['destroy']=function(_0x135390,_0x4c5007){return db['DeskConfiguration'][_0x1dc8('0x47')]({'where':{'id':_0x135390[_0x1dc8('0x43')]['id']}})[_0x1dc8('0x23')](handleEntityNotFound(_0x4c5007,null))['then'](removeEntity(_0x4c5007,null))[_0x1dc8('0x42')](handleError(_0x4c5007,null));};exports[_0x1dc8('0x48')]=function(_0x2b3d30,_0x3984aa,_0x2b68f6){var _0x52d29a={};var _0x23745f={};var _0x12528f;var _0xbfc5b2;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2b3d30['params']['id']}})[_0x1dc8('0x23')](handleEntityNotFound(_0x3984aa,null))['then'](function(_0xd68c95){if(_0xd68c95){_0x12528f=_0xd68c95;_0x23745f[_0x1dc8('0x2e')]=_[_0x1dc8('0x30')](db[_0x1dc8('0x49')][_0x1dc8('0x2b')]);_0x23745f['query']=_[_0x1dc8('0x30')](_0x2b3d30['query']);_0x23745f[_0x1dc8('0x39')]=_[_0x1dc8('0x44')](_0x23745f['model'],_0x23745f[_0x1dc8('0x2f')]);_0x52d29a[_0x1dc8('0x31')]=_[_0x1dc8('0x44')](_0x23745f[_0x1dc8('0x2e')],qs[_0x1dc8('0x32')](_0x2b3d30['query']['fields']));_0x52d29a[_0x1dc8('0x31')]=_0x52d29a[_0x1dc8('0x31')][_0x1dc8('0x33')]?_0x52d29a[_0x1dc8('0x31')]:_0x23745f[_0x1dc8('0x2e')];_0x52d29a['order']=qs[_0x1dc8('0x37')](_0x2b3d30['query'][_0x1dc8('0x37')]);_0x52d29a[_0x1dc8('0x38')]=qs[_0x1dc8('0x39')](_[_0x1dc8('0x4a')](_0x2b3d30['query'],_0x23745f[_0x1dc8('0x39')]));if(_0x2b3d30['query']['filter']){_0x52d29a['where']=_['merge'](_0x52d29a[_0x1dc8('0x38')],{'$or':_[_0x1dc8('0x29')](_0x52d29a[_0x1dc8('0x31')],function(_0x5688a2){var _0x1d1ac6={};_0x1d1ac6[_0x5688a2]={'$like':'%'+_0x2b3d30[_0x1dc8('0x2f')]['filter']+'%'};return _0x1d1ac6;})});}_0x52d29a=_[_0x1dc8('0x3a')]({},_0x52d29a,_0x2b3d30['options']);return _0x12528f[_0x1dc8('0x48')](_0x52d29a);}})[_0x1dc8('0x23')](function(_0x2cd22c){if(_0x2cd22c){_0xbfc5b2=_0x2cd22c[_0x1dc8('0x33')];if(!_0x2b3d30['query'][_0x1dc8('0x34')](_0x1dc8('0x35'))){_0x52d29a[_0x1dc8('0x1c')]=qs[_0x1dc8('0x1c')](_0x2b3d30[_0x1dc8('0x2f')][_0x1dc8('0x1c')]);_0x52d29a[_0x1dc8('0x1b')]=qs['offset'](_0x2b3d30[_0x1dc8('0x2f')][_0x1dc8('0x1b')]);}return _0x12528f[_0x1dc8('0x48')](_0x52d29a);}})['then'](function(_0x13ed6a){if(_0x13ed6a){return _0x13ed6a?{'count':_0xbfc5b2,'rows':_0x13ed6a}:null;}})['then'](respondWithResult(_0x3984aa,null))[_0x1dc8('0x42')](handleError(_0x3984aa,null));};exports['getSubjects']=function(_0x13f4dc,_0x238bd5,_0x603de1){var _0x165772={};var _0x3dca08={};var _0x567317;var _0x3785ab;return db[_0x1dc8('0x2a')]['findOne']({'where':{'id':_0x13f4dc[_0x1dc8('0x43')]['id']}})['then'](handleEntityNotFound(_0x238bd5,null))[_0x1dc8('0x23')](function(_0x1d215f){if(_0x1d215f){_0x567317=_0x1d215f;_0x3dca08[_0x1dc8('0x2e')]=_[_0x1dc8('0x30')](db[_0x1dc8('0x49')][_0x1dc8('0x2b')]);_0x3dca08[_0x1dc8('0x2f')]=_['keys'](_0x13f4dc[_0x1dc8('0x2f')]);_0x3dca08[_0x1dc8('0x39')]=_['intersection'](_0x3dca08[_0x1dc8('0x2e')],_0x3dca08[_0x1dc8('0x2f')]);_0x165772[_0x1dc8('0x31')]=_['intersection'](_0x3dca08[_0x1dc8('0x2e')],qs[_0x1dc8('0x32')](_0x13f4dc[_0x1dc8('0x2f')][_0x1dc8('0x32')]));_0x165772['attributes']=_0x165772[_0x1dc8('0x31')]['length']?_0x165772['attributes']:_0x3dca08[_0x1dc8('0x2e')];_0x165772[_0x1dc8('0x36')]=qs[_0x1dc8('0x37')](_0x13f4dc[_0x1dc8('0x2f')][_0x1dc8('0x37')]);_0x165772[_0x1dc8('0x38')]=qs[_0x1dc8('0x39')](_[_0x1dc8('0x4a')](_0x13f4dc[_0x1dc8('0x2f')],_0x3dca08[_0x1dc8('0x39')]));if(_0x13f4dc['query'][_0x1dc8('0x3c')]){_0x165772[_0x1dc8('0x38')]=_[_0x1dc8('0x3a')](_0x165772[_0x1dc8('0x38')],{'$or':_[_0x1dc8('0x29')](_0x165772[_0x1dc8('0x31')],function(_0x50de1c){var _0x5e05ed={};_0x5e05ed[_0x50de1c]={'$like':'%'+_0x13f4dc[_0x1dc8('0x2f')][_0x1dc8('0x3c')]+'%'};return _0x5e05ed;})});}_0x165772=_['merge']({},_0x165772,_0x13f4dc[_0x1dc8('0x3d')]);return _0x567317['getSubjects'](_0x165772);}})[_0x1dc8('0x23')](function(_0x2d5929){if(_0x2d5929){_0x3785ab=_0x2d5929[_0x1dc8('0x33')];if(!_0x13f4dc['query'][_0x1dc8('0x34')](_0x1dc8('0x35'))){_0x165772['limit']=qs[_0x1dc8('0x1c')](_0x13f4dc[_0x1dc8('0x2f')]['limit']);_0x165772[_0x1dc8('0x1b')]=qs[_0x1dc8('0x1b')](_0x13f4dc['query'][_0x1dc8('0x1b')]);}return _0x567317[_0x1dc8('0x4b')](_0x165772);}})[_0x1dc8('0x23')](function(_0x2b7a90){if(_0x2b7a90){return _0x2b7a90?{'count':_0x3785ab,'rows':_0x2b7a90}:null;}})[_0x1dc8('0x23')](respondWithResult(_0x238bd5,null))[_0x1dc8('0x42')](handleError(_0x238bd5,null));};exports[_0x1dc8('0x4c')]=function(_0x865fd8,_0x53ed2a,_0x3d8226){var _0x2b9a09={};var _0x56e9c4={};var _0x428e38;var _0x4aa194;return db[_0x1dc8('0x2a')][_0x1dc8('0x4d')]({'where':{'id':_0x865fd8[_0x1dc8('0x43')]['id']}})[_0x1dc8('0x23')](handleEntityNotFound(_0x53ed2a,null))['then'](function(_0x20f90c){if(_0x20f90c){_0x428e38=_0x20f90c;_0x56e9c4[_0x1dc8('0x2e')]=_[_0x1dc8('0x30')](db[_0x1dc8('0x49')]['rawAttributes']);_0x56e9c4[_0x1dc8('0x2f')]=_[_0x1dc8('0x30')](_0x865fd8[_0x1dc8('0x2f')]);_0x56e9c4['filters']=_[_0x1dc8('0x44')](_0x56e9c4['model'],_0x56e9c4[_0x1dc8('0x2f')]);_0x2b9a09[_0x1dc8('0x31')]=_['intersection'](_0x56e9c4[_0x1dc8('0x2e')],qs[_0x1dc8('0x32')](_0x865fd8['query'][_0x1dc8('0x32')]));_0x2b9a09[_0x1dc8('0x31')]=_0x2b9a09[_0x1dc8('0x31')][_0x1dc8('0x33')]?_0x2b9a09[_0x1dc8('0x31')]:_0x56e9c4[_0x1dc8('0x2e')];_0x2b9a09['order']=qs[_0x1dc8('0x37')](_0x865fd8[_0x1dc8('0x2f')]['sort']);_0x2b9a09[_0x1dc8('0x38')]=qs[_0x1dc8('0x39')](_[_0x1dc8('0x4a')](_0x865fd8[_0x1dc8('0x2f')],_0x56e9c4['filters']));if(_0x865fd8[_0x1dc8('0x2f')]['filter']){_0x2b9a09[_0x1dc8('0x38')]=_['merge'](_0x2b9a09[_0x1dc8('0x38')],{'$or':_[_0x1dc8('0x29')](_0x2b9a09[_0x1dc8('0x31')],function(_0x261498){var _0x36cc83={};_0x36cc83[_0x261498]={'$like':'%'+_0x865fd8[_0x1dc8('0x2f')][_0x1dc8('0x3c')]+'%'};return _0x36cc83;})});}_0x2b9a09=_[_0x1dc8('0x3a')]({},_0x2b9a09,_0x865fd8[_0x1dc8('0x3d')]);return _0x428e38[_0x1dc8('0x4c')](_0x2b9a09);}})[_0x1dc8('0x23')](function(_0x1a9a6a){if(_0x1a9a6a){_0x4aa194=_0x1a9a6a['length'];if(!_0x865fd8[_0x1dc8('0x2f')][_0x1dc8('0x34')](_0x1dc8('0x35'))){_0x2b9a09[_0x1dc8('0x1c')]=qs[_0x1dc8('0x1c')](_0x865fd8['query'][_0x1dc8('0x1c')]);_0x2b9a09[_0x1dc8('0x1b')]=qs[_0x1dc8('0x1b')](_0x865fd8[_0x1dc8('0x2f')][_0x1dc8('0x1b')]);}return _0x428e38[_0x1dc8('0x4c')](_0x2b9a09);}})[_0x1dc8('0x23')](function(_0x47da32){if(_0x47da32){return _0x47da32?{'count':_0x4aa194,'rows':_0x47da32}:null;}})[_0x1dc8('0x23')](respondWithResult(_0x53ed2a,null))[_0x1dc8('0x42')](handleError(_0x53ed2a,null));};exports['getTags']=function(_0x4a2e4a,_0x5d17f0,_0x4d663c){var _0x589193={};var _0x149e5f={};var _0x3f0552;var _0x172f31;return db[_0x1dc8('0x2a')]['findOne']({'where':{'id':_0x4a2e4a[_0x1dc8('0x43')]['id']}})[_0x1dc8('0x23')](handleEntityNotFound(_0x5d17f0,null))[_0x1dc8('0x23')](function(_0x4e5260){if(_0x4e5260){_0x3f0552=_0x4e5260;_0x149e5f[_0x1dc8('0x2e')]=_[_0x1dc8('0x30')](db['Tag']['rawAttributes']);_0x149e5f[_0x1dc8('0x2f')]=_[_0x1dc8('0x30')](_0x4a2e4a[_0x1dc8('0x2f')]);_0x149e5f[_0x1dc8('0x39')]=_[_0x1dc8('0x44')](_0x149e5f['model'],_0x149e5f[_0x1dc8('0x2f')]);_0x589193[_0x1dc8('0x31')]=_[_0x1dc8('0x44')](_0x149e5f[_0x1dc8('0x2e')],qs[_0x1dc8('0x32')](_0x4a2e4a[_0x1dc8('0x2f')][_0x1dc8('0x32')]));_0x589193['attributes']=_0x589193[_0x1dc8('0x31')][_0x1dc8('0x33')]?_0x589193[_0x1dc8('0x31')]:_0x149e5f[_0x1dc8('0x2e')];_0x589193[_0x1dc8('0x36')]=qs['sort'](_0x4a2e4a[_0x1dc8('0x2f')][_0x1dc8('0x37')]);_0x589193[_0x1dc8('0x38')]=qs[_0x1dc8('0x39')](_[_0x1dc8('0x4a')](_0x4a2e4a['query'],_0x149e5f['filters']));if(_0x4a2e4a['query'][_0x1dc8('0x3c')]){_0x589193[_0x1dc8('0x38')]=_['merge'](_0x589193['where'],{'$or':_[_0x1dc8('0x29')](_0x589193[_0x1dc8('0x31')],function(_0x32c51b){var _0x1e1c0e={};_0x1e1c0e[_0x32c51b]={'$like':'%'+_0x4a2e4a['query']['filter']+'%'};return _0x1e1c0e;})});}_0x589193=_[_0x1dc8('0x3a')]({},_0x589193,_0x4a2e4a['options']);return _0x3f0552['getTags'](_0x589193);}})[_0x1dc8('0x23')](function(_0x1dd885){if(_0x1dd885){_0x172f31=_0x1dd885[_0x1dc8('0x33')];if(!_0x4a2e4a[_0x1dc8('0x2f')]['hasOwnProperty'](_0x1dc8('0x35'))){_0x589193[_0x1dc8('0x1c')]=qs[_0x1dc8('0x1c')](_0x4a2e4a[_0x1dc8('0x2f')]['limit']);_0x589193['offset']=qs[_0x1dc8('0x1b')](_0x4a2e4a['query']['offset']);}return _0x3f0552['getTags'](_0x589193);}})['then'](function(_0x36dfc1){if(_0x36dfc1){return _0x36dfc1?{'count':_0x172f31,'rows':_0x36dfc1}:null;}})['then'](respondWithResult(_0x5d17f0,null))[_0x1dc8('0x42')](handleError(_0x5d17f0,null));};exports[_0x1dc8('0x4e')]=function(_0x2dd385,_0x3ed9d8,_0x5f044b){if(_0x2dd385[_0x1dc8('0x46')]['id']){delete _0x2dd385[_0x1dc8('0x46')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x2dd385[_0x1dc8('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ed9d8,null))[_0x1dc8('0x23')](function(_0x1a90cc){if(_0x1a90cc){return _0x1a90cc[_0x1dc8('0x4e')](_0x2dd385[_0x1dc8('0x46')][_0x1dc8('0x4f')]||[]);}return null;})[_0x1dc8('0x23')](respondWithResult(_0x3ed9d8,null))[_0x1dc8('0x42')](handleError(_0x3ed9d8,null));}; \ No newline at end of file +var _0x8d95=['nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','destroy','getFields','findOne','DeskField','order','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x46dc84,_0x13a4cf){var _0x484246=function(_0x2d8ff8){while(--_0x2d8ff8){_0x46dc84['push'](_0x46dc84['shift']());}};_0x484246(++_0x13a4cf);}(_0x8d95,0x75));var _0x58d9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8d95[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x58d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x58d9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x58d9('0x2'));var moment=require('moment');var BPromise=require(_0x58d9('0x3'));var Mustache=require(_0x58d9('0x4'));var util=require(_0x58d9('0x5'));var path=require(_0x58d9('0x6'));var sox=require('sox');var csv=require(_0x58d9('0x7'));var ejs=require(_0x58d9('0x8'));var fs=require('fs');var fs_extra=require(_0x58d9('0x9'));var _=require(_0x58d9('0xa'));var squel=require(_0x58d9('0xb'));var crypto=require(_0x58d9('0xc'));var jsforce=require(_0x58d9('0xd'));var deskjs=require(_0x58d9('0xe'));var toCsv=require(_0x58d9('0x7'));var querystring=require(_0x58d9('0xf'));var Papa=require(_0x58d9('0x10'));var Redis=require(_0x58d9('0x11'));var authService=require(_0x58d9('0x12'));var qs=require(_0x58d9('0x13'));var as=require(_0x58d9('0x14'));var hardwareService=require(_0x58d9('0x15'));var logger=require(_0x58d9('0x16'))(_0x58d9('0x17'));var utils=require(_0x58d9('0x18'));var config=require(_0x58d9('0x19'));var licenseUtil=require(_0x58d9('0x1a'));var db=require(_0x58d9('0x1b'))['db'];function respondWithStatusCode(_0xcf9417,_0x2aaf78){_0x2aaf78=_0x2aaf78||0xcc;return function(_0x38dc9d){if(_0x38dc9d){return _0xcf9417[_0x58d9('0x1c')](_0x2aaf78);}return _0xcf9417[_0x58d9('0x1d')](_0x2aaf78)[_0x58d9('0x1e')]();};}function respondWithResult(_0x2b4719,_0xea5314){_0xea5314=_0xea5314||0xc8;return function(_0x4ab679){if(_0x4ab679){return _0x2b4719[_0x58d9('0x1d')](_0xea5314)[_0x58d9('0x1f')](_0x4ab679);}};}function respondWithFilteredResult(_0x3064a2,_0x45efa5){return function(_0xd6a839){if(_0xd6a839){var _0x1897f4=typeof _0x45efa5[_0x58d9('0x20')]===_0x58d9('0x21')&&typeof _0x45efa5['limit']==='undefined';var _0x43839a=_0xd6a839[_0x58d9('0x22')];var _0x54161e=_0x1897f4?0x0:_0x45efa5[_0x58d9('0x20')];var _0x3cfd03=_0x1897f4?_0xd6a839[_0x58d9('0x22')]:_0x45efa5[_0x58d9('0x20')]+_0x45efa5[_0x58d9('0x23')];var _0x592a87;if(_0x3cfd03>=_0x43839a){_0x3cfd03=_0x43839a;_0x592a87=0xc8;}else{_0x592a87=0xce;}_0x3064a2[_0x58d9('0x1d')](_0x592a87);return _0x3064a2['set'](_0x58d9('0x24'),_0x54161e+'-'+_0x3cfd03+'/'+_0x43839a)[_0x58d9('0x1f')](_0xd6a839);}return null;};}function patchUpdates(_0x5334aa){return function(_0x721487){try{jsonpatch[_0x58d9('0x25')](_0x721487,_0x5334aa,!![]);}catch(_0x4a914a){return BPromise['reject'](_0x4a914a);}return _0x721487[_0x58d9('0x26')]();};}function saveUpdates(_0x3110a6,_0x19e10a){return function(_0x360839){if(_0x360839){return _0x360839[_0x58d9('0x27')](_0x3110a6)['then'](function(_0xacb7af){return _0xacb7af;});}return null;};}function removeEntity(_0x431bbc,_0xa02aaa){return function(_0x54c0d1){if(_0x54c0d1){return _0x54c0d1['destroy']()[_0x58d9('0x28')](function(){_0x431bbc['status'](0xcc)[_0x58d9('0x1e')]();});}};}function handleEntityNotFound(_0x2ede81,_0x4225d3){return function(_0x416efd){if(!_0x416efd){_0x2ede81['sendStatus'](0x194);}return _0x416efd;};}function handleError(_0x1f4482,_0x2961ed){_0x2961ed=_0x2961ed||0x1f4;return function(_0x213914){logger[_0x58d9('0x29')](_0x213914[_0x58d9('0x2a')]);if(_0x213914[_0x58d9('0x2b')]){delete _0x213914[_0x58d9('0x2b')];}_0x1f4482[_0x58d9('0x1d')](_0x2961ed)[_0x58d9('0x2c')](_0x213914);};}exports[_0x58d9('0x2d')]=function(_0x48f64f,_0x5dde3c){var _0x3f3cb2={},_0x1e8acd={},_0x3ae063={'count':0x0,'rows':[]};var _0x3c7755=_[_0x58d9('0x2e')](db[_0x58d9('0x2f')][_0x58d9('0x30')],function(_0x18f4a4){return{'name':_0x18f4a4[_0x58d9('0x31')],'type':_0x18f4a4[_0x58d9('0x32')]['key']};});_0x1e8acd[_0x58d9('0x33')]=_[_0x58d9('0x2e')](_0x3c7755,_0x58d9('0x2b'));_0x1e8acd[_0x58d9('0x34')]=_[_0x58d9('0x35')](_0x48f64f[_0x58d9('0x34')]);_0x1e8acd[_0x58d9('0x36')]=_[_0x58d9('0x37')](_0x1e8acd[_0x58d9('0x33')],_0x1e8acd[_0x58d9('0x34')]);_0x3f3cb2[_0x58d9('0x38')]=_[_0x58d9('0x37')](_0x1e8acd[_0x58d9('0x33')],qs[_0x58d9('0x39')](_0x48f64f[_0x58d9('0x34')][_0x58d9('0x39')]));_0x3f3cb2[_0x58d9('0x38')]=_0x3f3cb2[_0x58d9('0x38')]['length']?_0x3f3cb2[_0x58d9('0x38')]:_0x1e8acd['model'];if(!_0x48f64f[_0x58d9('0x34')][_0x58d9('0x3a')](_0x58d9('0x3b'))){_0x3f3cb2[_0x58d9('0x23')]=qs[_0x58d9('0x23')](_0x48f64f['query'][_0x58d9('0x23')]);_0x3f3cb2[_0x58d9('0x20')]=qs[_0x58d9('0x20')](_0x48f64f[_0x58d9('0x34')][_0x58d9('0x20')]);}_0x3f3cb2['order']=qs[_0x58d9('0x3c')](_0x48f64f['query'][_0x58d9('0x3c')]);_0x3f3cb2[_0x58d9('0x3d')]=qs[_0x58d9('0x36')](_[_0x58d9('0x3e')](_0x48f64f[_0x58d9('0x34')],_0x1e8acd[_0x58d9('0x36')]),_0x3c7755);if(_0x48f64f[_0x58d9('0x34')][_0x58d9('0x3f')]){_0x3f3cb2[_0x58d9('0x3d')]=_[_0x58d9('0x40')](_0x3f3cb2['where'],{'$or':_[_0x58d9('0x2e')](_0x3c7755,function(_0x23c88d){if(_0x23c88d['type']!==_0x58d9('0x41')){var _0x5edf8b={};_0x5edf8b[_0x23c88d['name']]={'$like':'%'+_0x48f64f[_0x58d9('0x34')][_0x58d9('0x3f')]+'%'};return _0x5edf8b;}})});}_0x3f3cb2=_[_0x58d9('0x40')]({},_0x3f3cb2,_0x48f64f['options']);var _0x27eade={'where':_0x3f3cb2['where']};return db['DeskConfiguration']['count'](_0x27eade)[_0x58d9('0x28')](function(_0x5db89e){_0x3ae063['count']=_0x5db89e;if(_0x48f64f[_0x58d9('0x34')][_0x58d9('0x42')]){_0x3f3cb2[_0x58d9('0x43')]=[{'all':!![]}];}return db[_0x58d9('0x2f')][_0x58d9('0x44')](_0x3f3cb2);})['then'](function(_0x26fd2a){_0x3ae063[_0x58d9('0x45')]=_0x26fd2a;return _0x3ae063;})['then'](respondWithFilteredResult(_0x5dde3c,_0x3f3cb2))[_0x58d9('0x46')](handleError(_0x5dde3c,null));};exports['show']=function(_0x58bceb,_0x508758){var _0x21eba0={'raw':![],'where':{'id':_0x58bceb[_0x58d9('0x47')]['id']}},_0x464ed5={};_0x464ed5[_0x58d9('0x33')]=_[_0x58d9('0x35')](db['DeskConfiguration'][_0x58d9('0x30')]);_0x464ed5['query']=_[_0x58d9('0x35')](_0x58bceb[_0x58d9('0x34')]);_0x464ed5['filters']=_[_0x58d9('0x37')](_0x464ed5['model'],_0x464ed5[_0x58d9('0x34')]);_0x21eba0[_0x58d9('0x38')]=_[_0x58d9('0x37')](_0x464ed5['model'],qs[_0x58d9('0x39')](_0x58bceb['query'][_0x58d9('0x39')]));_0x21eba0[_0x58d9('0x38')]=_0x21eba0[_0x58d9('0x38')][_0x58d9('0x48')]?_0x21eba0['attributes']:_0x464ed5[_0x58d9('0x33')];if(_0x58bceb[_0x58d9('0x34')][_0x58d9('0x42')]){_0x21eba0[_0x58d9('0x43')]=[{'all':!![]}];}_0x21eba0=_['merge']({},_0x21eba0,_0x58bceb[_0x58d9('0x49')]);return db[_0x58d9('0x2f')][_0x58d9('0x4a')](_0x21eba0)['then'](handleEntityNotFound(_0x508758,null))[_0x58d9('0x28')](respondWithResult(_0x508758,null))['catch'](handleError(_0x508758,null));};exports[_0x58d9('0x4b')]=function(_0x1b822f,_0x20fe1b){return db[_0x58d9('0x2f')]['create'](_0x1b822f[_0x58d9('0x4c')],{})['then'](respondWithResult(_0x20fe1b,0xc9))[_0x58d9('0x46')](handleError(_0x20fe1b,null));};exports[_0x58d9('0x27')]=function(_0x474d79,_0x3d0b76){if(_0x474d79[_0x58d9('0x4c')]['id']){delete _0x474d79[_0x58d9('0x4c')]['id'];}return db[_0x58d9('0x2f')][_0x58d9('0x4a')]({'where':{'id':_0x474d79[_0x58d9('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d0b76,null))['then'](saveUpdates(_0x474d79[_0x58d9('0x4c')],null))['then'](respondWithResult(_0x3d0b76,null))[_0x58d9('0x46')](handleError(_0x3d0b76,null));};exports[_0x58d9('0x4d')]=function(_0x1e46f8,_0x5b4c2b){return db[_0x58d9('0x2f')][_0x58d9('0x4a')]({'where':{'id':_0x1e46f8[_0x58d9('0x47')]['id']}})[_0x58d9('0x28')](handleEntityNotFound(_0x5b4c2b,null))['then'](removeEntity(_0x5b4c2b,null))['catch'](handleError(_0x5b4c2b,null));};exports[_0x58d9('0x4e')]=function(_0xba909f,_0x33e9fc,_0x323bd7){var _0x2966c2={};var _0x3e89ab={};var _0x30ec80;var _0x22722b;return db[_0x58d9('0x2f')][_0x58d9('0x4f')]({'where':{'id':_0xba909f[_0x58d9('0x47')]['id']}})[_0x58d9('0x28')](handleEntityNotFound(_0x33e9fc,null))[_0x58d9('0x28')](function(_0x26efe7){if(_0x26efe7){_0x30ec80=_0x26efe7;_0x3e89ab[_0x58d9('0x33')]=_[_0x58d9('0x35')](db[_0x58d9('0x50')][_0x58d9('0x30')]);_0x3e89ab['query']=_[_0x58d9('0x35')](_0xba909f[_0x58d9('0x34')]);_0x3e89ab['filters']=_[_0x58d9('0x37')](_0x3e89ab['model'],_0x3e89ab[_0x58d9('0x34')]);_0x2966c2[_0x58d9('0x38')]=_[_0x58d9('0x37')](_0x3e89ab[_0x58d9('0x33')],qs[_0x58d9('0x39')](_0xba909f['query'][_0x58d9('0x39')]));_0x2966c2[_0x58d9('0x38')]=_0x2966c2[_0x58d9('0x38')][_0x58d9('0x48')]?_0x2966c2[_0x58d9('0x38')]:_0x3e89ab[_0x58d9('0x33')];_0x2966c2[_0x58d9('0x51')]=qs['sort'](_0xba909f['query'][_0x58d9('0x3c')]);_0x2966c2[_0x58d9('0x3d')]=qs['filters'](_[_0x58d9('0x3e')](_0xba909f[_0x58d9('0x34')],_0x3e89ab[_0x58d9('0x36')]));if(_0xba909f[_0x58d9('0x34')][_0x58d9('0x3f')]){_0x2966c2['where']=_['merge'](_0x2966c2['where'],{'$or':_[_0x58d9('0x2e')](_0x2966c2['attributes'],function(_0x2e4962){var _0x20f4a8={};_0x20f4a8[_0x2e4962]={'$like':'%'+_0xba909f[_0x58d9('0x34')]['filter']+'%'};return _0x20f4a8;})});}_0x2966c2=_[_0x58d9('0x40')]({},_0x2966c2,_0xba909f['options']);return _0x30ec80[_0x58d9('0x4e')](_0x2966c2);}})[_0x58d9('0x28')](function(_0x5bb950){if(_0x5bb950){_0x22722b=_0x5bb950[_0x58d9('0x48')];if(!_0xba909f[_0x58d9('0x34')]['hasOwnProperty'](_0x58d9('0x3b'))){_0x2966c2[_0x58d9('0x23')]=qs[_0x58d9('0x23')](_0xba909f[_0x58d9('0x34')]['limit']);_0x2966c2['offset']=qs[_0x58d9('0x20')](_0xba909f[_0x58d9('0x34')][_0x58d9('0x20')]);}return _0x30ec80[_0x58d9('0x4e')](_0x2966c2);}})[_0x58d9('0x28')](function(_0x45c400){if(_0x45c400){return _0x45c400?{'count':_0x22722b,'rows':_0x45c400}:null;}})[_0x58d9('0x28')](respondWithResult(_0x33e9fc,null))[_0x58d9('0x46')](handleError(_0x33e9fc,null));};exports[_0x58d9('0x52')]=function(_0x394b78,_0x15c9c2,_0x5dd5fd){var _0x28e45a={};var _0x44166b={};var _0x5ac125;var _0x59bfae;return db['DeskConfiguration']['findOne']({'where':{'id':_0x394b78[_0x58d9('0x47')]['id']}})['then'](handleEntityNotFound(_0x15c9c2,null))['then'](function(_0x42338c){if(_0x42338c){_0x5ac125=_0x42338c;_0x44166b[_0x58d9('0x33')]=_[_0x58d9('0x35')](db[_0x58d9('0x50')][_0x58d9('0x30')]);_0x44166b[_0x58d9('0x34')]=_[_0x58d9('0x35')](_0x394b78['query']);_0x44166b[_0x58d9('0x36')]=_['intersection'](_0x44166b[_0x58d9('0x33')],_0x44166b['query']);_0x28e45a['attributes']=_['intersection'](_0x44166b['model'],qs[_0x58d9('0x39')](_0x394b78[_0x58d9('0x34')][_0x58d9('0x39')]));_0x28e45a[_0x58d9('0x38')]=_0x28e45a[_0x58d9('0x38')][_0x58d9('0x48')]?_0x28e45a['attributes']:_0x44166b['model'];_0x28e45a[_0x58d9('0x51')]=qs[_0x58d9('0x3c')](_0x394b78[_0x58d9('0x34')][_0x58d9('0x3c')]);_0x28e45a['where']=qs[_0x58d9('0x36')](_['pick'](_0x394b78[_0x58d9('0x34')],_0x44166b[_0x58d9('0x36')]));if(_0x394b78[_0x58d9('0x34')][_0x58d9('0x3f')]){_0x28e45a[_0x58d9('0x3d')]=_['merge'](_0x28e45a[_0x58d9('0x3d')],{'$or':_[_0x58d9('0x2e')](_0x28e45a[_0x58d9('0x38')],function(_0x4e57bd){var _0x14ecea={};_0x14ecea[_0x4e57bd]={'$like':'%'+_0x394b78[_0x58d9('0x34')][_0x58d9('0x3f')]+'%'};return _0x14ecea;})});}_0x28e45a=_[_0x58d9('0x40')]({},_0x28e45a,_0x394b78[_0x58d9('0x49')]);return _0x5ac125['getSubjects'](_0x28e45a);}})[_0x58d9('0x28')](function(_0x5e3cee){if(_0x5e3cee){_0x59bfae=_0x5e3cee['length'];if(!_0x394b78[_0x58d9('0x34')]['hasOwnProperty'](_0x58d9('0x3b'))){_0x28e45a[_0x58d9('0x23')]=qs[_0x58d9('0x23')](_0x394b78[_0x58d9('0x34')][_0x58d9('0x23')]);_0x28e45a[_0x58d9('0x20')]=qs[_0x58d9('0x20')](_0x394b78['query'][_0x58d9('0x20')]);}return _0x5ac125[_0x58d9('0x52')](_0x28e45a);}})['then'](function(_0x492703){if(_0x492703){return _0x492703?{'count':_0x59bfae,'rows':_0x492703}:null;}})[_0x58d9('0x28')](respondWithResult(_0x15c9c2,null))['catch'](handleError(_0x15c9c2,null));};exports['getDescriptions']=function(_0x497f2e,_0x285068,_0x1c50be){var _0x23a968={};var _0x5637f2={};var _0x2f07f5;var _0x449549;return db['DeskConfiguration'][_0x58d9('0x4f')]({'where':{'id':_0x497f2e[_0x58d9('0x47')]['id']}})['then'](handleEntityNotFound(_0x285068,null))['then'](function(_0x37a179){if(_0x37a179){_0x2f07f5=_0x37a179;_0x5637f2[_0x58d9('0x33')]=_[_0x58d9('0x35')](db[_0x58d9('0x50')][_0x58d9('0x30')]);_0x5637f2['query']=_[_0x58d9('0x35')](_0x497f2e[_0x58d9('0x34')]);_0x5637f2['filters']=_['intersection'](_0x5637f2['model'],_0x5637f2[_0x58d9('0x34')]);_0x23a968[_0x58d9('0x38')]=_[_0x58d9('0x37')](_0x5637f2['model'],qs['fields'](_0x497f2e[_0x58d9('0x34')]['fields']));_0x23a968[_0x58d9('0x38')]=_0x23a968[_0x58d9('0x38')][_0x58d9('0x48')]?_0x23a968[_0x58d9('0x38')]:_0x5637f2[_0x58d9('0x33')];_0x23a968[_0x58d9('0x51')]=qs[_0x58d9('0x3c')](_0x497f2e[_0x58d9('0x34')][_0x58d9('0x3c')]);_0x23a968[_0x58d9('0x3d')]=qs[_0x58d9('0x36')](_[_0x58d9('0x3e')](_0x497f2e[_0x58d9('0x34')],_0x5637f2[_0x58d9('0x36')]));if(_0x497f2e[_0x58d9('0x34')][_0x58d9('0x3f')]){_0x23a968[_0x58d9('0x3d')]=_[_0x58d9('0x40')](_0x23a968['where'],{'$or':_['map'](_0x23a968[_0x58d9('0x38')],function(_0x108d03){var _0x229263={};_0x229263[_0x108d03]={'$like':'%'+_0x497f2e[_0x58d9('0x34')][_0x58d9('0x3f')]+'%'};return _0x229263;})});}_0x23a968=_[_0x58d9('0x40')]({},_0x23a968,_0x497f2e[_0x58d9('0x49')]);return _0x2f07f5['getDescriptions'](_0x23a968);}})['then'](function(_0x3b588a){if(_0x3b588a){_0x449549=_0x3b588a[_0x58d9('0x48')];if(!_0x497f2e[_0x58d9('0x34')][_0x58d9('0x3a')](_0x58d9('0x3b'))){_0x23a968[_0x58d9('0x23')]=qs[_0x58d9('0x23')](_0x497f2e[_0x58d9('0x34')]['limit']);_0x23a968[_0x58d9('0x20')]=qs[_0x58d9('0x20')](_0x497f2e[_0x58d9('0x34')][_0x58d9('0x20')]);}return _0x2f07f5[_0x58d9('0x53')](_0x23a968);}})[_0x58d9('0x28')](function(_0x3464a2){if(_0x3464a2){return _0x3464a2?{'count':_0x449549,'rows':_0x3464a2}:null;}})['then'](respondWithResult(_0x285068,null))['catch'](handleError(_0x285068,null));};exports['getTags']=function(_0xd84f6b,_0x1e613a,_0x568bfb){var _0x47f2cf={};var _0x154b48={};var _0x2085c5;var _0x5291ff;return db[_0x58d9('0x2f')][_0x58d9('0x4f')]({'where':{'id':_0xd84f6b[_0x58d9('0x47')]['id']}})[_0x58d9('0x28')](handleEntityNotFound(_0x1e613a,null))[_0x58d9('0x28')](function(_0x2212fa){if(_0x2212fa){_0x2085c5=_0x2212fa;_0x154b48[_0x58d9('0x33')]=_[_0x58d9('0x35')](db[_0x58d9('0x54')][_0x58d9('0x30')]);_0x154b48['query']=_[_0x58d9('0x35')](_0xd84f6b[_0x58d9('0x34')]);_0x154b48[_0x58d9('0x36')]=_[_0x58d9('0x37')](_0x154b48[_0x58d9('0x33')],_0x154b48[_0x58d9('0x34')]);_0x47f2cf[_0x58d9('0x38')]=_['intersection'](_0x154b48[_0x58d9('0x33')],qs[_0x58d9('0x39')](_0xd84f6b['query'][_0x58d9('0x39')]));_0x47f2cf[_0x58d9('0x38')]=_0x47f2cf[_0x58d9('0x38')][_0x58d9('0x48')]?_0x47f2cf[_0x58d9('0x38')]:_0x154b48['model'];_0x47f2cf[_0x58d9('0x51')]=qs[_0x58d9('0x3c')](_0xd84f6b[_0x58d9('0x34')][_0x58d9('0x3c')]);_0x47f2cf['where']=qs['filters'](_[_0x58d9('0x3e')](_0xd84f6b[_0x58d9('0x34')],_0x154b48[_0x58d9('0x36')]));if(_0xd84f6b[_0x58d9('0x34')][_0x58d9('0x3f')]){_0x47f2cf[_0x58d9('0x3d')]=_[_0x58d9('0x40')](_0x47f2cf[_0x58d9('0x3d')],{'$or':_['map'](_0x47f2cf[_0x58d9('0x38')],function(_0x192f21){var _0x297f3d={};_0x297f3d[_0x192f21]={'$like':'%'+_0xd84f6b[_0x58d9('0x34')]['filter']+'%'};return _0x297f3d;})});}_0x47f2cf=_[_0x58d9('0x40')]({},_0x47f2cf,_0xd84f6b['options']);return _0x2085c5['getTags'](_0x47f2cf);}})[_0x58d9('0x28')](function(_0x62d396){if(_0x62d396){_0x5291ff=_0x62d396[_0x58d9('0x48')];if(!_0xd84f6b['query'][_0x58d9('0x3a')](_0x58d9('0x3b'))){_0x47f2cf['limit']=qs[_0x58d9('0x23')](_0xd84f6b['query'][_0x58d9('0x23')]);_0x47f2cf[_0x58d9('0x20')]=qs[_0x58d9('0x20')](_0xd84f6b[_0x58d9('0x34')][_0x58d9('0x20')]);}return _0x2085c5[_0x58d9('0x55')](_0x47f2cf);}})['then'](function(_0x5c3568){if(_0x5c3568){return _0x5c3568?{'count':_0x5291ff,'rows':_0x5c3568}:null;}})['then'](respondWithResult(_0x1e613a,null))[_0x58d9('0x46')](handleError(_0x1e613a,null));};exports[_0x58d9('0x56')]=function(_0x12a4ff,_0x56d26e,_0x5a2219){if(_0x12a4ff[_0x58d9('0x4c')]['id']){delete _0x12a4ff[_0x58d9('0x4c')]['id'];}return db[_0x58d9('0x2f')]['findOne']({'where':{'id':_0x12a4ff['params']['id']}})[_0x58d9('0x28')](handleEntityNotFound(_0x56d26e,null))[_0x58d9('0x28')](function(_0x4cece8){if(_0x4cece8){return _0x4cece8[_0x58d9('0x56')](_0x12a4ff['body'][_0x58d9('0x57')]||[]);}return null;})[_0x58d9('0x28')](respondWithResult(_0x56d26e,null))['catch'](handleError(_0x56d26e,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index e90dcd2..e2ecd36 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 _0xc2c0=['bluebird','request-promise','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x1f9e4a,_0x17dc30){var _0x40a822=function(_0x4f4705){while(--_0x4f4705){_0x1f9e4a['push'](_0x1f9e4a['shift']());}};_0x40a822(++_0x17dc30);}(_0xc2c0,0x13a));var _0x0c2c=function(_0x8e7772,_0x9d77b0){_0x8e7772=_0x8e7772-0x0;var _0x408200=_0xc2c0[_0x8e7772];return _0x408200;};'use strict';var _=require(_0x0c2c('0x0'));var util=require(_0x0c2c('0x1'));var logger=require(_0x0c2c('0x2'))(_0x0c2c('0x3'));var moment=require(_0x0c2c('0x4'));var BPromise=require(_0x0c2c('0x5'));var rp=require(_0x0c2c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0c2c('0x7'));module[_0x0c2c('0x8')]=function(_0x34271a,_0x491259){return _0x34271a['define'](_0x0c2c('0x9'),attributes,{'tableName':_0x0c2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b72=['../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x1af629,_0x302204){var _0x2ef351=function(_0xfb4359){while(--_0xfb4359){_0x1af629['push'](_0x1af629['shift']());}};_0x2ef351(++_0x302204);}(_0x6b72,0x19d));var _0x26b7=function(_0x24860b,_0x1ac118){_0x24860b=_0x24860b-0x0;var _0x2894e3=_0x6b72[_0x24860b];return _0x2894e3;};'use strict';var _=require(_0x26b7('0x0'));var util=require('util');var logger=require(_0x26b7('0x1'))(_0x26b7('0x2'));var moment=require('moment');var BPromise=require(_0x26b7('0x3'));var rp=require(_0x26b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x26b7('0x5'));var attributes=require(_0x26b7('0x6'));module[_0x26b7('0x7')]=function(_0x5bf038,_0x26ac11){return _0x5bf038[_0x26b7('0x8')](_0x26b7('0x9'),attributes,{'tableName':_0x26b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 86af7c0..0de5f29 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 _0x5480=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','ioredis','../../config/utils'];(function(_0x47cd62,_0x19bbf3){var _0x7923b9=function(_0x420f48){while(--_0x420f48){_0x47cd62['push'](_0x47cd62['shift']());}};_0x7923b9(++_0x19bbf3);}(_0x5480,0x18a));var _0x0548=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x5480[_0x1e2080];return _0x260111;};'use strict';var _=require(_0x0548('0x0'));var util=require(_0x0548('0x1'));var moment=require(_0x0548('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0548('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0548('0x4'));var logger=require(_0x0548('0x5'))('rpc');var config=require(_0x0548('0x6'));var jayson=require(_0x0548('0x7'));var client=jayson[_0x0548('0x8')][_0x0548('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d4401,_0x50c631,_0x48d43d){return new BPromise(function(_0xf69224,_0x5678e3){return client[_0x0548('0xa')](_0x3d4401,_0x48d43d)[_0x0548('0xb')](function(_0x105bb5){logger['info'](_0x0548('0xc'),_0x50c631,_0x0548('0xd'));logger[_0x0548('0xe')](_0x0548('0xf'),_0x50c631,_0x0548('0xd'),JSON[_0x0548('0x10')](_0x105bb5));if(_0x105bb5['error']){if(_0x105bb5[_0x0548('0x11')][_0x0548('0x12')]===0x1f4){logger[_0x0548('0x11')](_0x0548('0xc'),_0x50c631,_0x105bb5[_0x0548('0x11')]['message']);return _0x5678e3(_0x105bb5['error'][_0x0548('0x13')]);}logger[_0x0548('0x11')](_0x0548('0xc'),_0x50c631,_0x105bb5[_0x0548('0x11')][_0x0548('0x13')]);return _0xf69224(_0x105bb5[_0x0548('0x11')][_0x0548('0x13')]);}else{logger[_0x0548('0x14')](_0x0548('0xc'),_0x50c631,'request\x20sent');_0xf69224(_0x105bb5['result'][_0x0548('0x13')]);}})['catch'](function(_0x44d306){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x50c631,_0x44d306);_0x5678e3(_0x44d306);});});} \ No newline at end of file +var _0x7d33=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x5872cd,_0x2616cc){var _0x3a470d=function(_0xfde6ca){while(--_0xfde6ca){_0x5872cd['push'](_0x5872cd['shift']());}};_0x3a470d(++_0x2616cc);}(_0x7d33,0x1cc));var _0x37d3=function(_0x2a4da6,_0x5e7f66){_0x2a4da6=_0x2a4da6-0x0;var _0x21f384=_0x7d33[_0x2a4da6];return _0x21f384;};'use strict';var _=require(_0x37d3('0x0'));var util=require(_0x37d3('0x1'));var moment=require(_0x37d3('0x2'));var BPromise=require(_0x37d3('0x3'));var rs=require(_0x37d3('0x4'));var fs=require('fs');var Redis=require(_0x37d3('0x5'));var db=require(_0x37d3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x37d3('0x7'))('rpc');var config=require(_0x37d3('0x8'));var jayson=require(_0x37d3('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x553025,_0x2eda0e,_0x3c5713){return new BPromise(function(_0x4b756c,_0x364107){return client['request'](_0x553025,_0x3c5713)[_0x37d3('0xa')](function(_0x479734){logger[_0x37d3('0xb')](_0x37d3('0xc'),_0x2eda0e,'request\x20sent');logger[_0x37d3('0xd')](_0x37d3('0xe'),_0x2eda0e,_0x37d3('0xf'),JSON[_0x37d3('0x10')](_0x479734));if(_0x479734[_0x37d3('0x11')]){if(_0x479734['error'][_0x37d3('0x12')]===0x1f4){logger[_0x37d3('0x11')](_0x37d3('0xc'),_0x2eda0e,_0x479734[_0x37d3('0x11')]['message']);return _0x364107(_0x479734[_0x37d3('0x11')][_0x37d3('0x13')]);}logger[_0x37d3('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x2eda0e,_0x479734[_0x37d3('0x11')]['message']);return _0x4b756c(_0x479734[_0x37d3('0x11')]['message']);}else{logger[_0x37d3('0xb')](_0x37d3('0xc'),_0x2eda0e,_0x37d3('0xf'));_0x4b756c(_0x479734[_0x37d3('0x14')]['message']);}})[_0x37d3('0x15')](function(_0x3dcff8){logger[_0x37d3('0x11')](_0x37d3('0xc'),_0x2eda0e,_0x3dcff8);_0x364107(_0x3dcff8);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 3573e44..daba032 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 _0xda28=['../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xda28,0xfd));var _0x8da2=function(_0x25f71b,_0x290fb2){_0x25f71b=_0x25f71b-0x0;var _0x44f60a=_0xda28[_0x25f71b];return _0x44f60a;};'use strict';var multer=require(_0x8da2('0x0'));var util=require(_0x8da2('0x1'));var path=require(_0x8da2('0x2'));var timeout=require(_0x8da2('0x3'));var express=require(_0x8da2('0x4'));var router=express['Router']();var fs_extra=require(_0x8da2('0x5'));var auth=require(_0x8da2('0x6'));var interaction=require(_0x8da2('0x7'));var config=require(_0x8da2('0x8'));var controller=require(_0x8da2('0x9'));router[_0x8da2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8da2('0xb')]);router['get'](_0x8da2('0xc'),auth[_0x8da2('0xd')](),controller['show']);router[_0x8da2('0xe')]('/',auth['isAuthenticated'](),controller[_0x8da2('0xf')]);router[_0x8da2('0x10')](_0x8da2('0xc'),auth[_0x8da2('0xd')](),controller['update']);router[_0x8da2('0x11')]('/:id',auth[_0x8da2('0xd')](),controller[_0x8da2('0x12')]);module[_0x8da2('0x13')]=router; \ No newline at end of file +var _0x6072=['destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x6072,0x17b));var _0x2607=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x6072[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x2607('0x0'));var util=require(_0x2607('0x1'));var path=require(_0x2607('0x2'));var timeout=require(_0x2607('0x3'));var express=require(_0x2607('0x4'));var router=express[_0x2607('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2607('0x6'));var controller=require('./intDeskField.controller');router[_0x2607('0x7')]('/',auth[_0x2607('0x8')](),controller[_0x2607('0x9')]);router['get']('/:id',auth[_0x2607('0x8')](),controller[_0x2607('0xa')]);router[_0x2607('0xb')]('/',auth[_0x2607('0x8')](),controller[_0x2607('0xc')]);router[_0x2607('0xd')](_0x2607('0xe'),auth[_0x2607('0x8')](),controller[_0x2607('0xf')]);router[_0x2607('0x10')](_0x2607('0xe'),auth[_0x2607('0x8')](),controller[_0x2607('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 9ac1d86..806b93f 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 _0x059f=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0x059f,0xb6));var _0xf059=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x059f[_0x13b392];return _0x39db24;};'use strict';var Sequelize=require(_0xf059('0x0'));module[_0xf059('0x1')]={'type':{'type':Sequelize[_0xf059('0x2')](_0xf059('0x3'),_0xf059('0x4'),_0xf059('0x5'),_0xf059('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xf059('0x7')]},'key':{'type':Sequelize[_0xf059('0x7')]},'keyType':{'type':Sequelize[_0xf059('0x2')](_0xf059('0x3'),_0xf059('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf059('0x7')]},'nameField':{'type':Sequelize[_0xf059('0x7')]},'customField':{'type':Sequelize[_0xf059('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa192=['sequelize','exports','variable','keyValue','picklist','STRING','ENUM','customVariable','BOOLEAN'];(function(_0x9d03f0,_0x1641f8){var _0x1f3bd8=function(_0x511bbf){while(--_0x511bbf){_0x9d03f0['push'](_0x9d03f0['shift']());}};_0x1f3bd8(++_0x1641f8);}(_0xa192,0x1cb));var _0x2a19=function(_0x4a2e24,_0x3ead9a){_0x4a2e24=_0x4a2e24-0x0;var _0x5ea8d7=_0xa192[_0x4a2e24];return _0x5ea8d7;};'use strict';var Sequelize=require(_0x2a19('0x0'));module[_0x2a19('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x2a19('0x2'),'customVariable',_0x2a19('0x3'),_0x2a19('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2a19('0x5')]},'key':{'type':Sequelize[_0x2a19('0x5')]},'keyType':{'type':Sequelize[_0x2a19('0x6')]('string',_0x2a19('0x2'),_0x2a19('0x7'))},'keyContent':{'type':Sequelize[_0x2a19('0x5')]},'idField':{'type':Sequelize[_0x2a19('0x5')]},'nameField':{'type':Sequelize[_0x2a19('0x5')]},'customField':{'type':Sequelize[_0x2a19('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2a19('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index d403259..b922d6a 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 _0x046b=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','stack','name','send','index','map','DeskField','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','type','options','includeAll','include','findAll','rows','catch','show','keys','merge','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0x046b,0x1ba));var _0xb046=function(_0x2f22d6,_0x531948){_0x2f22d6=_0x2f22d6-0x0;var _0x44bc1f=_0x046b[_0x2f22d6];return _0x44bc1f;};'use strict';var emlformat=require(_0xb046('0x0'));var rimraf=require(_0xb046('0x1'));var zipdir=require(_0xb046('0x2'));var jsonpatch=require(_0xb046('0x3'));var rp=require('request-promise');var moment=require(_0xb046('0x4'));var BPromise=require(_0xb046('0x5'));var Mustache=require('mustache');var util=require(_0xb046('0x6'));var path=require(_0xb046('0x7'));var sox=require(_0xb046('0x8'));var csv=require(_0xb046('0x9'));var ejs=require(_0xb046('0xa'));var fs=require('fs');var fs_extra=require(_0xb046('0xb'));var _=require(_0xb046('0xc'));var squel=require(_0xb046('0xd'));var crypto=require(_0xb046('0xe'));var jsforce=require(_0xb046('0xf'));var deskjs=require(_0xb046('0x10'));var toCsv=require(_0xb046('0x9'));var querystring=require(_0xb046('0x11'));var Papa=require('papaparse');var Redis=require(_0xb046('0x12'));var authService=require(_0xb046('0x13'));var qs=require(_0xb046('0x14'));var as=require(_0xb046('0x15'));var hardwareService=require(_0xb046('0x16'));var logger=require('../../config/logger')(_0xb046('0x17'));var utils=require(_0xb046('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb046('0x19'))['db'];function respondWithStatusCode(_0x9fda4b,_0x2ff4f3){_0x2ff4f3=_0x2ff4f3||0xcc;return function(_0x178ebf){if(_0x178ebf){return _0x9fda4b[_0xb046('0x1a')](_0x2ff4f3);}return _0x9fda4b[_0xb046('0x1b')](_0x2ff4f3)[_0xb046('0x1c')]();};}function respondWithResult(_0x1d97b0,_0x36e91f){_0x36e91f=_0x36e91f||0xc8;return function(_0x26fb6f){if(_0x26fb6f){return _0x1d97b0['status'](_0x36e91f)[_0xb046('0x1d')](_0x26fb6f);}};}function respondWithFilteredResult(_0x3a8109,_0x4fd90c){return function(_0x2b0d1e){if(_0x2b0d1e){var _0x5e54c6=typeof _0x4fd90c[_0xb046('0x1e')]===_0xb046('0x1f')&&typeof _0x4fd90c[_0xb046('0x20')]===_0xb046('0x1f');var _0x658dab=_0x2b0d1e[_0xb046('0x21')];var _0x52241f=_0x5e54c6?0x0:_0x4fd90c['offset'];var _0x17bbb0=_0x5e54c6?_0x2b0d1e[_0xb046('0x21')]:_0x4fd90c[_0xb046('0x1e')]+_0x4fd90c['limit'];var _0x541283;if(_0x17bbb0>=_0x658dab){_0x17bbb0=_0x658dab;_0x541283=0xc8;}else{_0x541283=0xce;}_0x3a8109[_0xb046('0x1b')](_0x541283);return _0x3a8109['set'](_0xb046('0x22'),_0x52241f+'-'+_0x17bbb0+'/'+_0x658dab)['json'](_0x2b0d1e);}return null;};}function patchUpdates(_0x9456ce){return function(_0x3e9a1f){try{jsonpatch[_0xb046('0x23')](_0x3e9a1f,_0x9456ce,!![]);}catch(_0x324dba){return BPromise['reject'](_0x324dba);}return _0x3e9a1f['save']();};}function saveUpdates(_0x505294,_0x2dbdde){return function(_0x2b676){if(_0x2b676){return _0x2b676[_0xb046('0x24')](_0x505294)[_0xb046('0x25')](function(_0xc3c99a){return _0xc3c99a;});}return null;};}function removeEntity(_0x433526,_0x51c65d){return function(_0x2750f8){if(_0x2750f8){return _0x2750f8['destroy']()['then'](function(){_0x433526[_0xb046('0x1b')](0xcc)[_0xb046('0x1c')]();});}};}function handleEntityNotFound(_0x1c3638,_0x3779ae){return function(_0xf1d1bd){if(!_0xf1d1bd){_0x1c3638[_0xb046('0x1a')](0x194);}return _0xf1d1bd;};}function handleError(_0x1dc546,_0x3d9d5){_0x3d9d5=_0x3d9d5||0x1f4;return function(_0x5ac704){logger['error'](_0x5ac704[_0xb046('0x26')]);if(_0x5ac704['name']){delete _0x5ac704[_0xb046('0x27')];}_0x1dc546[_0xb046('0x1b')](_0x3d9d5)[_0xb046('0x28')](_0x5ac704);};}exports[_0xb046('0x29')]=function(_0x1f7306,_0x39f817){var _0x180f77={},_0x333dbe={},_0x19ca88={'count':0x0,'rows':[]};var _0x1f75d0=_[_0xb046('0x2a')](db[_0xb046('0x2b')][_0xb046('0x2c')],function(_0x56272d){return{'name':_0x56272d[_0xb046('0x2d')],'type':_0x56272d['type'][_0xb046('0x2e')]};});_0x333dbe[_0xb046('0x2f')]=_[_0xb046('0x2a')](_0x1f75d0,_0xb046('0x27'));_0x333dbe[_0xb046('0x30')]=_['keys'](_0x1f7306['query']);_0x333dbe[_0xb046('0x31')]=_[_0xb046('0x32')](_0x333dbe[_0xb046('0x2f')],_0x333dbe[_0xb046('0x30')]);_0x180f77['attributes']=_[_0xb046('0x32')](_0x333dbe[_0xb046('0x2f')],qs[_0xb046('0x33')](_0x1f7306['query'][_0xb046('0x33')]));_0x180f77[_0xb046('0x34')]=_0x180f77[_0xb046('0x34')][_0xb046('0x35')]?_0x180f77[_0xb046('0x34')]:_0x333dbe[_0xb046('0x2f')];if(!_0x1f7306['query']['hasOwnProperty'](_0xb046('0x36'))){_0x180f77[_0xb046('0x20')]=qs[_0xb046('0x20')](_0x1f7306[_0xb046('0x30')][_0xb046('0x20')]);_0x180f77['offset']=qs[_0xb046('0x1e')](_0x1f7306['query'][_0xb046('0x1e')]);}_0x180f77[_0xb046('0x37')]=qs[_0xb046('0x38')](_0x1f7306[_0xb046('0x30')][_0xb046('0x38')]);_0x180f77[_0xb046('0x39')]=qs[_0xb046('0x31')](_[_0xb046('0x3a')](_0x1f7306['query'],_0x333dbe[_0xb046('0x31')]),_0x1f75d0);if(_0x1f7306[_0xb046('0x30')][_0xb046('0x3b')]){_0x180f77['where']=_['merge'](_0x180f77['where'],{'$or':_['map'](_0x1f75d0,function(_0x3a72c5){if(_0x3a72c5[_0xb046('0x3c')]!=='VIRTUAL'){var _0x39dab1={};_0x39dab1[_0x3a72c5[_0xb046('0x27')]]={'$like':'%'+_0x1f7306[_0xb046('0x30')][_0xb046('0x3b')]+'%'};return _0x39dab1;}})});}_0x180f77=_['merge']({},_0x180f77,_0x1f7306[_0xb046('0x3d')]);var _0x4bca39={'where':_0x180f77[_0xb046('0x39')]};return db[_0xb046('0x2b')][_0xb046('0x21')](_0x4bca39)[_0xb046('0x25')](function(_0x225af1){_0x19ca88[_0xb046('0x21')]=_0x225af1;if(_0x1f7306[_0xb046('0x30')][_0xb046('0x3e')]){_0x180f77[_0xb046('0x3f')]=[{'all':!![]}];}return db[_0xb046('0x2b')][_0xb046('0x40')](_0x180f77);})[_0xb046('0x25')](function(_0x88825){_0x19ca88[_0xb046('0x41')]=_0x88825;return _0x19ca88;})['then'](respondWithFilteredResult(_0x39f817,_0x180f77))[_0xb046('0x42')](handleError(_0x39f817,null));};exports[_0xb046('0x43')]=function(_0x13e798,_0x3deb8a){var _0x11633e={'raw':!![],'where':{'id':_0x13e798['params']['id']}},_0x1c4cfd={};_0x1c4cfd['model']=_[_0xb046('0x44')](db[_0xb046('0x2b')][_0xb046('0x2c')]);_0x1c4cfd[_0xb046('0x30')]=_[_0xb046('0x44')](_0x13e798[_0xb046('0x30')]);_0x1c4cfd[_0xb046('0x31')]=_['intersection'](_0x1c4cfd[_0xb046('0x2f')],_0x1c4cfd[_0xb046('0x30')]);_0x11633e['attributes']=_[_0xb046('0x32')](_0x1c4cfd[_0xb046('0x2f')],qs['fields'](_0x13e798[_0xb046('0x30')]['fields']));_0x11633e[_0xb046('0x34')]=_0x11633e[_0xb046('0x34')][_0xb046('0x35')]?_0x11633e['attributes']:_0x1c4cfd[_0xb046('0x2f')];if(_0x13e798[_0xb046('0x30')][_0xb046('0x3e')]){_0x11633e[_0xb046('0x3f')]=[{'all':!![]}];}_0x11633e=_[_0xb046('0x45')]({},_0x11633e,_0x13e798['options']);return db['DeskField']['find'](_0x11633e)[_0xb046('0x25')](handleEntityNotFound(_0x3deb8a,null))[_0xb046('0x25')](respondWithResult(_0x3deb8a,null))[_0xb046('0x42')](handleError(_0x3deb8a,null));};exports[_0xb046('0x46')]=function(_0x144e13,_0xdea490){return db['DeskField'][_0xb046('0x46')](_0x144e13[_0xb046('0x47')],{})[_0xb046('0x25')](respondWithResult(_0xdea490,0xc9))[_0xb046('0x42')](handleError(_0xdea490,null));};exports[_0xb046('0x24')]=function(_0x34030a,_0x377c71){if(_0x34030a[_0xb046('0x47')]['id']){delete _0x34030a['body']['id'];}return db[_0xb046('0x2b')][_0xb046('0x48')]({'where':{'id':_0x34030a[_0xb046('0x49')]['id']}})[_0xb046('0x25')](handleEntityNotFound(_0x377c71,null))[_0xb046('0x25')](saveUpdates(_0x34030a['body'],null))[_0xb046('0x25')](respondWithResult(_0x377c71,null))['catch'](handleError(_0x377c71,null));};exports[_0xb046('0x4a')]=function(_0x1c8636,_0xe65d66){return db[_0xb046('0x2b')]['find']({'where':{'id':_0x1c8636[_0xb046('0x49')]['id']}})[_0xb046('0x25')](handleEntityNotFound(_0xe65d66,null))[_0xb046('0x25')](removeEntity(_0xe65d66,null))['catch'](handleError(_0xe65d66,null));}; \ No newline at end of file +var _0x02b6=['stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error'];(function(_0x5dcee2,_0x378390){var _0xcba165=function(_0x34f6b6){while(--_0x34f6b6){_0x5dcee2['push'](_0x5dcee2['shift']());}};_0xcba165(++_0x378390);}(_0x02b6,0xfe));var _0x602b=function(_0x410dff,_0x41c493){_0x410dff=_0x410dff-0x0;var _0x2aabcc=_0x02b6[_0x410dff];return _0x2aabcc;};'use strict';var emlformat=require(_0x602b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x602b('0x1'));var jsonpatch=require(_0x602b('0x2'));var rp=require(_0x602b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x602b('0x4'));var util=require(_0x602b('0x5'));var path=require(_0x602b('0x6'));var sox=require(_0x602b('0x7'));var csv=require('to-csv');var ejs=require(_0x602b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x602b('0x9'));var squel=require(_0x602b('0xa'));var crypto=require(_0x602b('0xb'));var jsforce=require(_0x602b('0xc'));var deskjs=require(_0x602b('0xd'));var toCsv=require(_0x602b('0xe'));var querystring=require(_0x602b('0xf'));var Papa=require(_0x602b('0x10'));var Redis=require(_0x602b('0x11'));var authService=require(_0x602b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x602b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x602b('0x14'));var utils=require('../../config/utils');var config=require(_0x602b('0x15'));var licenseUtil=require(_0x602b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e7882,_0x41cd15){_0x41cd15=_0x41cd15||0xcc;return function(_0x135847){if(_0x135847){return _0x1e7882['sendStatus'](_0x41cd15);}return _0x1e7882[_0x602b('0x17')](_0x41cd15)[_0x602b('0x18')]();};}function respondWithResult(_0x2c7f9a,_0x3742f1){_0x3742f1=_0x3742f1||0xc8;return function(_0x27eb0a){if(_0x27eb0a){return _0x2c7f9a[_0x602b('0x17')](_0x3742f1)[_0x602b('0x19')](_0x27eb0a);}};}function respondWithFilteredResult(_0x5035b6,_0x505efc){return function(_0xc4711d){if(_0xc4711d){var _0x41f957=typeof _0x505efc[_0x602b('0x1a')]===_0x602b('0x1b')&&typeof _0x505efc[_0x602b('0x1c')]===_0x602b('0x1b');var _0x416f64=_0xc4711d[_0x602b('0x1d')];var _0x46758d=_0x41f957?0x0:_0x505efc['offset'];var _0x48d992=_0x41f957?_0xc4711d[_0x602b('0x1d')]:_0x505efc[_0x602b('0x1a')]+_0x505efc['limit'];var _0x3c991c;if(_0x48d992>=_0x416f64){_0x48d992=_0x416f64;_0x3c991c=0xc8;}else{_0x3c991c=0xce;}_0x5035b6['status'](_0x3c991c);return _0x5035b6['set'](_0x602b('0x1e'),_0x46758d+'-'+_0x48d992+'/'+_0x416f64)['json'](_0xc4711d);}return null;};}function patchUpdates(_0x28eadf){return function(_0x5e0d15){try{jsonpatch[_0x602b('0x1f')](_0x5e0d15,_0x28eadf,!![]);}catch(_0x36cd1b){return BPromise[_0x602b('0x20')](_0x36cd1b);}return _0x5e0d15['save']();};}function saveUpdates(_0x258e11,_0x1264c8){return function(_0x580b66){if(_0x580b66){return _0x580b66[_0x602b('0x21')](_0x258e11)[_0x602b('0x22')](function(_0x2c59f3){return _0x2c59f3;});}return null;};}function removeEntity(_0x1943a0,_0x8510cf){return function(_0xb3beff){if(_0xb3beff){return _0xb3beff[_0x602b('0x23')]()[_0x602b('0x22')](function(){_0x1943a0[_0x602b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43acc3,_0x427bf1){return function(_0x5ce51b){if(!_0x5ce51b){_0x43acc3[_0x602b('0x24')](0x194);}return _0x5ce51b;};}function handleError(_0x469bd9,_0x50e64e){_0x50e64e=_0x50e64e||0x1f4;return function(_0x11dfd5){logger[_0x602b('0x25')](_0x11dfd5[_0x602b('0x26')]);if(_0x11dfd5[_0x602b('0x27')]){delete _0x11dfd5[_0x602b('0x27')];}_0x469bd9[_0x602b('0x17')](_0x50e64e)[_0x602b('0x28')](_0x11dfd5);};}exports[_0x602b('0x29')]=function(_0x3e82bc,_0x1fc94f){var _0x433ad0={},_0x529fa8={},_0x23a7f4={'count':0x0,'rows':[]};var _0x582ccc=_[_0x602b('0x2a')](db[_0x602b('0x2b')][_0x602b('0x2c')],function(_0x3b951b){return{'name':_0x3b951b[_0x602b('0x2d')],'type':_0x3b951b[_0x602b('0x2e')][_0x602b('0x2f')]};});_0x529fa8[_0x602b('0x30')]=_[_0x602b('0x2a')](_0x582ccc,_0x602b('0x27'));_0x529fa8[_0x602b('0x31')]=_['keys'](_0x3e82bc['query']);_0x529fa8[_0x602b('0x32')]=_[_0x602b('0x33')](_0x529fa8[_0x602b('0x30')],_0x529fa8[_0x602b('0x31')]);_0x433ad0['attributes']=_[_0x602b('0x33')](_0x529fa8[_0x602b('0x30')],qs[_0x602b('0x34')](_0x3e82bc['query'][_0x602b('0x34')]));_0x433ad0[_0x602b('0x35')]=_0x433ad0[_0x602b('0x35')][_0x602b('0x36')]?_0x433ad0['attributes']:_0x529fa8[_0x602b('0x30')];if(!_0x3e82bc['query'][_0x602b('0x37')](_0x602b('0x38'))){_0x433ad0[_0x602b('0x1c')]=qs[_0x602b('0x1c')](_0x3e82bc[_0x602b('0x31')][_0x602b('0x1c')]);_0x433ad0['offset']=qs[_0x602b('0x1a')](_0x3e82bc[_0x602b('0x31')][_0x602b('0x1a')]);}_0x433ad0['order']=qs[_0x602b('0x39')](_0x3e82bc['query'][_0x602b('0x39')]);_0x433ad0[_0x602b('0x3a')]=qs['filters'](_['pick'](_0x3e82bc['query'],_0x529fa8[_0x602b('0x32')]),_0x582ccc);if(_0x3e82bc[_0x602b('0x31')][_0x602b('0x3b')]){_0x433ad0[_0x602b('0x3a')]=_[_0x602b('0x3c')](_0x433ad0[_0x602b('0x3a')],{'$or':_[_0x602b('0x2a')](_0x582ccc,function(_0x1ca1e5){if(_0x1ca1e5[_0x602b('0x2e')]!=='VIRTUAL'){var _0x31bb71={};_0x31bb71[_0x1ca1e5[_0x602b('0x27')]]={'$like':'%'+_0x3e82bc[_0x602b('0x31')]['filter']+'%'};return _0x31bb71;}})});}_0x433ad0=_[_0x602b('0x3c')]({},_0x433ad0,_0x3e82bc[_0x602b('0x3d')]);var _0x10529a={'where':_0x433ad0['where']};return db[_0x602b('0x2b')][_0x602b('0x1d')](_0x10529a)[_0x602b('0x22')](function(_0x19376a){_0x23a7f4[_0x602b('0x1d')]=_0x19376a;if(_0x3e82bc['query'][_0x602b('0x3e')]){_0x433ad0[_0x602b('0x3f')]=[{'all':!![]}];}return db['DeskField'][_0x602b('0x40')](_0x433ad0);})[_0x602b('0x22')](function(_0x3888f6){_0x23a7f4[_0x602b('0x41')]=_0x3888f6;return _0x23a7f4;})['then'](respondWithFilteredResult(_0x1fc94f,_0x433ad0))['catch'](handleError(_0x1fc94f,null));};exports[_0x602b('0x42')]=function(_0x521cfd,_0x4a68d4){var _0x2ab1cf={'raw':!![],'where':{'id':_0x521cfd[_0x602b('0x43')]['id']}},_0x4bc46a={};_0x4bc46a[_0x602b('0x30')]=_[_0x602b('0x44')](db['DeskField'][_0x602b('0x2c')]);_0x4bc46a['query']=_['keys'](_0x521cfd[_0x602b('0x31')]);_0x4bc46a[_0x602b('0x32')]=_[_0x602b('0x33')](_0x4bc46a[_0x602b('0x30')],_0x4bc46a[_0x602b('0x31')]);_0x2ab1cf[_0x602b('0x35')]=_[_0x602b('0x33')](_0x4bc46a[_0x602b('0x30')],qs[_0x602b('0x34')](_0x521cfd[_0x602b('0x31')][_0x602b('0x34')]));_0x2ab1cf['attributes']=_0x2ab1cf[_0x602b('0x35')][_0x602b('0x36')]?_0x2ab1cf[_0x602b('0x35')]:_0x4bc46a['model'];if(_0x521cfd[_0x602b('0x31')][_0x602b('0x3e')]){_0x2ab1cf['include']=[{'all':!![]}];}_0x2ab1cf=_[_0x602b('0x3c')]({},_0x2ab1cf,_0x521cfd['options']);return db[_0x602b('0x2b')][_0x602b('0x45')](_0x2ab1cf)[_0x602b('0x22')](handleEntityNotFound(_0x4a68d4,null))[_0x602b('0x22')](respondWithResult(_0x4a68d4,null))[_0x602b('0x46')](handleError(_0x4a68d4,null));};exports[_0x602b('0x47')]=function(_0xec0931,_0x2fb9ad){return db[_0x602b('0x2b')][_0x602b('0x47')](_0xec0931[_0x602b('0x48')],{})[_0x602b('0x22')](respondWithResult(_0x2fb9ad,0xc9))['catch'](handleError(_0x2fb9ad,null));};exports['update']=function(_0x528837,_0x33b838){if(_0x528837[_0x602b('0x48')]['id']){delete _0x528837[_0x602b('0x48')]['id'];}return db[_0x602b('0x2b')][_0x602b('0x45')]({'where':{'id':_0x528837[_0x602b('0x43')]['id']}})[_0x602b('0x22')](handleEntityNotFound(_0x33b838,null))[_0x602b('0x22')](saveUpdates(_0x528837['body'],null))[_0x602b('0x22')](respondWithResult(_0x33b838,null))['catch'](handleError(_0x33b838,null));};exports[_0x602b('0x23')]=function(_0x1f72b0,_0x52677b){return db[_0x602b('0x2b')]['find']({'where':{'id':_0x1f72b0[_0x602b('0x43')]['id']}})[_0x602b('0x22')](handleEntityNotFound(_0x52677b,null))[_0x602b('0x22')](removeEntity(_0x52677b,null))[_0x602b('0x46')](handleError(_0x52677b,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 117ebc2..eebafe3 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 _0x56a0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','int_desk_fields','lodash','util'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x56a0,0x196));var _0x056a=function(_0x469a2d,_0x53bcbe){_0x469a2d=_0x469a2d-0x0;var _0x148147=_0x56a0[_0x469a2d];return _0x148147;};'use strict';var _=require(_0x056a('0x0'));var util=require(_0x056a('0x1'));var logger=require(_0x056a('0x2'))(_0x056a('0x3'));var moment=require(_0x056a('0x4'));var BPromise=require(_0x056a('0x5'));var rp=require(_0x056a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x056a('0x7'));var config=require(_0x056a('0x8'));var attributes=require('./intDeskField.attributes');module[_0x056a('0x9')]=function(_0x334510,_0x308416){return _0x334510[_0x056a('0xa')]('DeskField',attributes,{'tableName':_0x056a('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1fbe=['FieldId','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','define','idField'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0x1fbe,0x173));var _0xe1fb=function(_0x1455f3,_0x2eba86){_0x1455f3=_0x1455f3-0x0;var _0x2a2534=_0x1fbe[_0x1455f3];return _0x2a2534;};'use strict';var _=require('lodash');var util=require(_0xe1fb('0x0'));var logger=require(_0xe1fb('0x1'))('api');var moment=require(_0xe1fb('0x2'));var BPromise=require(_0xe1fb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1fb('0x4'));var rimraf=require(_0xe1fb('0x5'));var config=require(_0xe1fb('0x6'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x2058a3,_0x2b7bbe){return _0x2058a3[_0xe1fb('0x7')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xe1fb('0x8'),_0xe1fb('0x9')],'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 3438923..703b6e7 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 _0xfc3b=['code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','request','info','debug','request\x20sent','error'];(function(_0x5367f0,_0xd61082){var _0x335690=function(_0x1bc975){while(--_0x1bc975){_0x5367f0['push'](_0x5367f0['shift']());}};_0x335690(++_0xd61082);}(_0xfc3b,0x15b));var _0xbfc3=function(_0x114cd6,_0x242848){_0x114cd6=_0x114cd6-0x0;var _0x5c8e65=_0xfc3b[_0x114cd6];return _0x5c8e65;};'use strict';var _=require(_0xbfc3('0x0'));var util=require(_0xbfc3('0x1'));var moment=require(_0xbfc3('0x2'));var BPromise=require(_0xbfc3('0x3'));var rs=require(_0xbfc3('0x4'));var fs=require('fs');var Redis=require(_0xbfc3('0x5'));var db=require(_0xbfc3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfc3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbfc3('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x57a7e6,_0x43cb87,_0x199e41){return new BPromise(function(_0x2c01bb,_0x2295e7){return client[_0xbfc3('0x9')](_0x57a7e6,_0x199e41)['then'](function(_0x5c5ef2){logger[_0xbfc3('0xa')]('DeskField,\x20%s,\x20%s',_0x43cb87,'request\x20sent');logger[_0xbfc3('0xb')]('DeskField,\x20%s,\x20%s,\x20%s',_0x43cb87,_0xbfc3('0xc'),JSON['stringify'](_0x5c5ef2));if(_0x5c5ef2[_0xbfc3('0xd')]){if(_0x5c5ef2[_0xbfc3('0xd')][_0xbfc3('0xe')]===0x1f4){logger[_0xbfc3('0xd')](_0xbfc3('0xf'),_0x43cb87,_0x5c5ef2['error']['message']);return _0x2295e7(_0x5c5ef2['error'][_0xbfc3('0x10')]);}logger[_0xbfc3('0xd')](_0xbfc3('0xf'),_0x43cb87,_0x5c5ef2[_0xbfc3('0xd')][_0xbfc3('0x10')]);return _0x2c01bb(_0x5c5ef2[_0xbfc3('0xd')][_0xbfc3('0x10')]);}else{logger[_0xbfc3('0xa')](_0xbfc3('0xf'),_0x43cb87,_0xbfc3('0xc'));_0x2c01bb(_0x5c5ef2[_0xbfc3('0x11')][_0xbfc3('0x10')]);}})[_0xbfc3('0x12')](function(_0x38c17a){logger[_0xbfc3('0xd')](_0xbfc3('0xf'),_0x43cb87,_0x38c17a);_0x2295e7(_0x38c17a);});});} \ No newline at end of file +var _0x3bea=['DeskField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3bea,0x1ed));var _0xa3be=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x3bea[_0x5f3f88];return _0xd08119;};'use strict';var _=require('lodash');var util=require(_0xa3be('0x0'));var moment=require(_0xa3be('0x1'));var BPromise=require(_0xa3be('0x2'));var rs=require(_0xa3be('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa3be('0x4'))['db'];var utils=require(_0xa3be('0x5'));var logger=require(_0xa3be('0x6'))(_0xa3be('0x7'));var config=require(_0xa3be('0x8'));var jayson=require(_0xa3be('0x9'));var client=jayson['client'][_0xa3be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e9333,_0x2876e5,_0x5dceb3){return new BPromise(function(_0x489f94,_0x12f466){return client[_0xa3be('0xb')](_0x5e9333,_0x5dceb3)['then'](function(_0x56633b){logger[_0xa3be('0xc')](_0xa3be('0xd'),_0x2876e5,'request\x20sent');logger[_0xa3be('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x2876e5,'request\x20sent',JSON[_0xa3be('0xf')](_0x56633b));if(_0x56633b[_0xa3be('0x10')]){if(_0x56633b['error'][_0xa3be('0x11')]===0x1f4){logger['error'](_0xa3be('0xd'),_0x2876e5,_0x56633b['error']['message']);return _0x12f466(_0x56633b[_0xa3be('0x10')][_0xa3be('0x12')]);}logger[_0xa3be('0x10')]('DeskField,\x20%s,\x20%s',_0x2876e5,_0x56633b['error']['message']);return _0x489f94(_0x56633b[_0xa3be('0x10')][_0xa3be('0x12')]);}else{logger[_0xa3be('0xc')]('DeskField,\x20%s,\x20%s',_0x2876e5,_0xa3be('0x13'));_0x489f94(_0x56633b[_0xa3be('0x14')]['message']);}})[_0xa3be('0x15')](function(_0x3e5e50){logger[_0xa3be('0x10')]('DeskField,\x20%s,\x20%s',_0x2876e5,_0x3e5e50);_0x12f466(_0x3e5e50);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 2a29be2..e10fdd6 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 _0x7037=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update'];(function(_0x3938bd,_0x248cc2){var _0x4a7fba=function(_0x283e10){while(--_0x283e10){_0x3938bd['push'](_0x3938bd['shift']());}};_0x4a7fba(++_0x248cc2);}(_0x7037,0x1cb));var _0x7703=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7037[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x7703('0x0'));var util=require(_0x7703('0x1'));var path=require(_0x7703('0x2'));var timeout=require(_0x7703('0x3'));var express=require('express');var router=express[_0x7703('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7703('0x5'));var interaction=require(_0x7703('0x6'));var config=require('../../config/environment');var controller=require(_0x7703('0x7'));router[_0x7703('0x8')]('/',auth['isAuthenticated'](),controller[_0x7703('0x9')]);router[_0x7703('0x8')](_0x7703('0xa'),auth[_0x7703('0xb')](),controller[_0x7703('0xc')]);router[_0x7703('0x8')]('/:id/configurations',auth[_0x7703('0xb')](),controller['getConfigurations']);router[_0x7703('0x8')](_0x7703('0xd'),auth[_0x7703('0xb')](),controller[_0x7703('0xe')]);router[_0x7703('0xf')]('/',auth[_0x7703('0xb')](),controller[_0x7703('0x10')]);router['post'](_0x7703('0x11'),auth['isAuthenticated'](),controller[_0x7703('0x12')]);router[_0x7703('0x13')](_0x7703('0xa'),auth[_0x7703('0xb')](),controller[_0x7703('0x14')]);router[_0x7703('0x15')](_0x7703('0xa'),auth[_0x7703('0xb')](),controller[_0x7703('0x16')]);module[_0x7703('0x17')]=router; \ No newline at end of file +var _0x1d9f=['/:id','show','/:id/configurations','get','post','addConfiguration','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','./intDynamics365Account.controller','isAuthenticated','index'];(function(_0x38f82d,_0x4d8fe1){var _0x195a93=function(_0x5c8979){while(--_0x5c8979){_0x38f82d['push'](_0x38f82d['shift']());}};_0x195a93(++_0x4d8fe1);}(_0x1d9f,0x1b2));var _0xf1d9=function(_0x3d8350,_0x2b6922){_0x3d8350=_0x3d8350-0x0;var _0xb6c4a7=_0x1d9f[_0x3d8350];return _0xb6c4a7;};'use strict';var multer=require(_0xf1d9('0x0'));var util=require('util');var path=require(_0xf1d9('0x1'));var timeout=require('connect-timeout');var express=require(_0xf1d9('0x2'));var router=express['Router']();var fs_extra=require(_0xf1d9('0x3'));var auth=require(_0xf1d9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf1d9('0x5'));router['get']('/',auth[_0xf1d9('0x6')](),controller[_0xf1d9('0x7')]);router['get'](_0xf1d9('0x8'),auth['isAuthenticated'](),controller[_0xf1d9('0x9')]);router['get'](_0xf1d9('0xa'),auth[_0xf1d9('0x6')](),controller['getConfigurations']);router[_0xf1d9('0xb')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xf1d9('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xf1d9('0xa'),auth['isAuthenticated'](),controller[_0xf1d9('0xd')]);router['put'](_0xf1d9('0x8'),auth[_0xf1d9('0x6')](),controller['update']);router[_0xf1d9('0xe')](_0xf1d9('0x8'),auth['isAuthenticated'](),controller[_0xf1d9('0xf')]);module[_0xf1d9('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index f065db7..4f16f38 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 _0xa7be=['BOOLEAN','sequelize','exports','STRING'];(function(_0x280e38,_0x53f78d){var _0x45e18b=function(_0x47df45){while(--_0x47df45){_0x280e38['push'](_0x280e38['shift']());}};_0x45e18b(++_0x53f78d);}(_0xa7be,0xfd));var _0xea7b=function(_0xabed97,_0x16077c){_0xabed97=_0xabed97-0x0;var _0x3111cd=_0xa7be[_0xabed97];return _0x3111cd;};'use strict';var Sequelize=require(_0xea7b('0x0'));module[_0xea7b('0x1')]={'name':{'type':Sequelize[_0xea7b('0x2')]},'username':{'type':Sequelize[_0xea7b('0x2')]},'password':{'type':Sequelize[_0xea7b('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xea7b('0x2')]},'clientSecret':{'type':Sequelize[_0xea7b('0x2')]},'serverUrl':{'type':Sequelize[_0xea7b('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xea7b('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5b20=['exports','STRING','sequelize'];(function(_0x155054,_0x2cc0af){var _0x3947fb=function(_0x38794d){while(--_0x38794d){_0x155054['push'](_0x155054['shift']());}};_0x3947fb(++_0x2cc0af);}(_0x5b20,0x86));var _0x05b2=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5b20[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x05b2('0x0'));module[_0x05b2('0x1')]={'name':{'type':Sequelize[_0x05b2('0x2')]},'username':{'type':Sequelize[_0x05b2('0x2')]},'password':{'type':Sequelize[_0x05b2('0x2')]},'remoteUri':{'type':Sequelize[_0x05b2('0x2')]},'tenantId':{'type':Sequelize[_0x05b2('0x2')]},'clientId':{'type':Sequelize[_0x05b2('0x2')]},'clientSecret':{'type':Sequelize[_0x05b2('0x2')]},'serverUrl':{'type':Sequelize[_0x05b2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x05b2('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 209d5fe..49b2107 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 _0x45c0=['createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','escalatedon','exchangerate','followupby','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statuscode','ticketnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','findOne','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','stack','test','Wrong\x20credentials','EntityDefinitions(',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','set','Content-Range','update','then','destroy','end','error','name','send','index','map','Dynamics365Account','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','getConfigurations','Dynamics365Configuration','AccountId','Subjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','description','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame'];(function(_0x40f419,_0x593974){var _0x72491a=function(_0x5d5a9e){while(--_0x5d5a9e){_0x40f419['push'](_0x40f419['shift']());}};_0x72491a(++_0x593974);}(_0x45c0,0x67));var _0x045c=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x45c0[_0x13e741];return _0x3f8bb3;};'use strict';var rp=require('request-promise');var util=require(_0x045c('0x0'));var _=require(_0x045c('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var db=require(_0x045c('0x2'))['db'];var integrations=require(_0x045c('0x3'));function respondWithResult(_0x3b9996,_0xe806d3){_0xe806d3=_0xe806d3||0xc8;return function(_0x4ec612){if(_0x4ec612){return _0x3b9996[_0x045c('0x4')](_0xe806d3)[_0x045c('0x5')](_0x4ec612);}};}function respondWithFilteredResult(_0x3344e5,_0x181ef7){return function(_0x3da4fa){if(_0x3da4fa){var _0x5cd284=typeof _0x181ef7[_0x045c('0x6')]===_0x045c('0x7')&&typeof _0x181ef7['limit']===_0x045c('0x7');var _0x3094e2=_0x3da4fa[_0x045c('0x8')];var _0x57e591=_0x5cd284?0x0:_0x181ef7[_0x045c('0x6')];var _0x2114ca=_0x5cd284?_0x3da4fa[_0x045c('0x8')]:_0x181ef7['offset']+_0x181ef7['limit'];var _0x1497af;if(_0x2114ca>=_0x3094e2){_0x2114ca=_0x3094e2;_0x1497af=0xc8;}else{_0x1497af=0xce;}_0x3344e5[_0x045c('0x4')](_0x1497af);return _0x3344e5[_0x045c('0x9')](_0x045c('0xa'),_0x57e591+'-'+_0x2114ca+'/'+_0x3094e2)[_0x045c('0x5')](_0x3da4fa);}return null;};}function saveUpdates(_0x28eba6){return function(_0x2cf18b){if(_0x2cf18b){return _0x2cf18b[_0x045c('0xb')](_0x28eba6)[_0x045c('0xc')](function(_0x303038){return _0x303038;});}return null;};}function removeEntity(_0x4712cf){return function(_0x570617){if(_0x570617){return _0x570617[_0x045c('0xd')]()[_0x045c('0xc')](function(){_0x4712cf[_0x045c('0x4')](0xcc)[_0x045c('0xe')]();});}};}function handleEntityNotFound(_0xb25c7c){return function(_0x22dfd9){if(!_0x22dfd9){_0xb25c7c['sendStatus'](0x194);}return _0x22dfd9;};}function handleError(_0x4c7f3f,_0x518a10){_0x518a10=_0x518a10||0x1f4;return function(_0x5afd85){logger[_0x045c('0xf')](_0x5afd85['stack']);if(_0x5afd85[_0x045c('0x10')]){delete _0x5afd85[_0x045c('0x10')];}_0x4c7f3f[_0x045c('0x4')](_0x518a10)[_0x045c('0x11')](_0x5afd85);};}exports[_0x045c('0x12')]=function(_0x3eb05a,_0x31ba89){var _0x50b949={},_0xe4e71c={},_0x1149b3={'count':0x0,'rows':[]};var _0x1fc539=_[_0x045c('0x13')](db[_0x045c('0x14')]['rawAttributes'],function(_0x1cd958){return{'name':_0x1cd958[_0x045c('0x15')],'type':_0x1cd958[_0x045c('0x16')]['key']};});_0xe4e71c[_0x045c('0x17')]=_[_0x045c('0x13')](_0x1fc539,_0x045c('0x10'));_0xe4e71c['query']=_[_0x045c('0x18')](_0x3eb05a[_0x045c('0x19')]);_0xe4e71c[_0x045c('0x1a')]=_[_0x045c('0x1b')](_0xe4e71c[_0x045c('0x17')],_0xe4e71c[_0x045c('0x19')]);_0x50b949[_0x045c('0x1c')]=_[_0x045c('0x1b')](_0xe4e71c['model'],qs[_0x045c('0x1d')](_0x3eb05a[_0x045c('0x19')][_0x045c('0x1d')]));_0x50b949[_0x045c('0x1c')]=_0x50b949[_0x045c('0x1c')][_0x045c('0x1e')]?_0x50b949[_0x045c('0x1c')]:_0xe4e71c[_0x045c('0x17')];if(!_0x3eb05a[_0x045c('0x19')][_0x045c('0x1f')](_0x045c('0x20'))){_0x50b949[_0x045c('0x21')]=qs[_0x045c('0x21')](_0x3eb05a[_0x045c('0x19')][_0x045c('0x21')]);_0x50b949[_0x045c('0x6')]=qs[_0x045c('0x6')](_0x3eb05a[_0x045c('0x19')][_0x045c('0x6')]);}_0x50b949['order']=qs['sort'](_0x3eb05a[_0x045c('0x19')][_0x045c('0x22')]);_0x50b949[_0x045c('0x23')]=qs[_0x045c('0x1a')](_[_0x045c('0x24')](_0x3eb05a[_0x045c('0x19')],_0xe4e71c[_0x045c('0x1a')]),_0x1fc539);if(_0x3eb05a[_0x045c('0x19')][_0x045c('0x25')]){_0x50b949[_0x045c('0x23')]=_[_0x045c('0x26')](_0x50b949[_0x045c('0x23')],{'$or':_[_0x045c('0x13')](_0x1fc539,function(_0x157a34){if(_0x157a34[_0x045c('0x16')]!=='VIRTUAL'){var _0x47e209={};_0x47e209[_0x157a34['name']]={'$like':'%'+_0x3eb05a[_0x045c('0x19')]['filter']+'%'};return _0x47e209;}})});}_0x50b949=_[_0x045c('0x26')]({},_0x50b949,_0x3eb05a['options']);var _0x294ee0={'where':_0x50b949[_0x045c('0x23')]};return db[_0x045c('0x14')]['count'](_0x294ee0)[_0x045c('0xc')](function(_0x55a456){_0x1149b3[_0x045c('0x8')]=_0x55a456;if(_0x3eb05a[_0x045c('0x19')][_0x045c('0x27')]){_0x50b949[_0x045c('0x28')]=[{'all':!![]}];}return db[_0x045c('0x14')][_0x045c('0x29')](_0x50b949);})[_0x045c('0xc')](function(_0xc0ea45){_0x1149b3[_0x045c('0x2a')]=_0xc0ea45;return _0x1149b3;})[_0x045c('0xc')](respondWithFilteredResult(_0x31ba89,_0x50b949))['catch'](handleError(_0x31ba89,null));};exports[_0x045c('0x2b')]=function(_0x34852b,_0x3eb7f4){var _0x3d1c55={'raw':![],'where':{'id':_0x34852b[_0x045c('0x2c')]['id']}},_0xd8bdf9={};_0xd8bdf9[_0x045c('0x17')]=_['keys'](db[_0x045c('0x14')][_0x045c('0x2d')]);_0xd8bdf9[_0x045c('0x19')]=_[_0x045c('0x18')](_0x34852b[_0x045c('0x19')]);_0xd8bdf9[_0x045c('0x1a')]=_[_0x045c('0x1b')](_0xd8bdf9['model'],_0xd8bdf9[_0x045c('0x19')]);_0x3d1c55[_0x045c('0x1c')]=_[_0x045c('0x1b')](_0xd8bdf9['model'],qs['fields'](_0x34852b[_0x045c('0x19')][_0x045c('0x1d')]));_0x3d1c55[_0x045c('0x1c')]=_0x3d1c55['attributes'][_0x045c('0x1e')]?_0x3d1c55[_0x045c('0x1c')]:_0xd8bdf9[_0x045c('0x17')];if(_0x34852b['query'][_0x045c('0x27')]){_0x3d1c55[_0x045c('0x28')]=[{'all':!![]}];}_0x3d1c55=_[_0x045c('0x26')]({},_0x3d1c55,_0x34852b[_0x045c('0x2e')]);return db[_0x045c('0x14')][_0x045c('0x2f')](_0x3d1c55)[_0x045c('0xc')](handleEntityNotFound(_0x3eb7f4,null))['then'](respondWithResult(_0x3eb7f4,null))[_0x045c('0x30')](handleError(_0x3eb7f4,null));};exports[_0x045c('0x31')]=function(_0x26936f,_0x4ef749){return db[_0x045c('0x14')][_0x045c('0x31')](_0x26936f[_0x045c('0x32')],{})[_0x045c('0xc')](respondWithResult(_0x4ef749,0xc9))[_0x045c('0x30')](handleError(_0x4ef749,null));};exports[_0x045c('0xb')]=function(_0x5526a6,_0x40e6ed){if(_0x5526a6[_0x045c('0x32')]['id']){delete _0x5526a6[_0x045c('0x32')]['id'];}return db[_0x045c('0x14')][_0x045c('0x2f')]({'where':{'id':_0x5526a6['params']['id']}})['then'](handleEntityNotFound(_0x40e6ed,null))[_0x045c('0xc')](saveUpdates(_0x5526a6['body'],null))[_0x045c('0xc')](respondWithResult(_0x40e6ed,null))[_0x045c('0x30')](handleError(_0x40e6ed,null));};exports['destroy']=function(_0x3a155f,_0x356e7d){return db[_0x045c('0x14')][_0x045c('0x2f')]({'where':{'id':_0x3a155f['params']['id']}})[_0x045c('0xc')](handleEntityNotFound(_0x356e7d,null))[_0x045c('0xc')](removeEntity(_0x356e7d,null))[_0x045c('0x30')](handleError(_0x356e7d,null));};exports[_0x045c('0x33')]=function(_0x4eb2c8,_0x29c91f){var _0xd74efd={};var _0xa15e4a={};var _0x36d079;var _0x318731;return db[_0x045c('0x14')]['findOne']({'where':{'id':_0x4eb2c8[_0x045c('0x2c')]['id']}})[_0x045c('0xc')](handleEntityNotFound(_0x29c91f,null))[_0x045c('0xc')](function(_0x35c635){if(_0x35c635){_0x36d079=_0x35c635;_0xa15e4a[_0x045c('0x17')]=_[_0x045c('0x18')](db[_0x045c('0x34')][_0x045c('0x2d')]);_0xa15e4a['query']=_['keys'](_0x4eb2c8['query']);_0xa15e4a['filters']=_[_0x045c('0x1b')](_0xa15e4a[_0x045c('0x17')],_0xa15e4a[_0x045c('0x19')]);_0xd74efd[_0x045c('0x1c')]=_[_0x045c('0x1b')](_0xa15e4a[_0x045c('0x17')],qs[_0x045c('0x1d')](_0x4eb2c8[_0x045c('0x19')][_0x045c('0x1d')]));_0xd74efd[_0x045c('0x1c')]=_0xd74efd['attributes'][_0x045c('0x1e')]?_0xd74efd[_0x045c('0x1c')]:_0xa15e4a[_0x045c('0x17')];_0xd74efd['order']=qs[_0x045c('0x22')](_0x4eb2c8['query'][_0x045c('0x22')]);_0xd74efd[_0x045c('0x23')]=qs[_0x045c('0x1a')](_[_0x045c('0x24')](_0x4eb2c8[_0x045c('0x19')],_0xa15e4a['filters']));if(_0x4eb2c8['query'][_0x045c('0x25')]){_0xd74efd['where']=_[_0x045c('0x26')](_0xd74efd['where'],{'$or':_['map'](_0xd74efd['attributes'],function(_0x42a8ec){var _0x3ffd06={};_0x3ffd06[_0x42a8ec]={'$like':'%'+_0x4eb2c8[_0x045c('0x19')]['filter']+'%'};return _0x3ffd06;})});}_0xd74efd=_[_0x045c('0x26')]({},_0xd74efd,_0x4eb2c8[_0x045c('0x2e')]);return _0x36d079[_0x045c('0x33')](_0xd74efd);}})['then'](function(_0x1ed23d){if(_0x1ed23d){_0x318731=_0x1ed23d[_0x045c('0x1e')];if(!_0x4eb2c8[_0x045c('0x19')][_0x045c('0x1f')](_0x045c('0x20'))){_0xd74efd[_0x045c('0x21')]=qs[_0x045c('0x21')](_0x4eb2c8[_0x045c('0x19')][_0x045c('0x21')]);_0xd74efd['offset']=qs[_0x045c('0x6')](_0x4eb2c8[_0x045c('0x19')][_0x045c('0x6')]);}return _0x36d079[_0x045c('0x33')](_0xd74efd);}})[_0x045c('0xc')](function(_0x2b8e92){if(_0x2b8e92){return _0x2b8e92?{'count':_0x318731,'rows':_0x2b8e92}:null;}})['then'](respondWithResult(_0x29c91f,null))[_0x045c('0x30')](handleError(_0x29c91f,null));};exports['addConfiguration']=function(_0x3e7be7,_0x24ae00){if(_0x3e7be7[_0x045c('0x32')]['id']){delete _0x3e7be7[_0x045c('0x32')]['id'];}return db[_0x045c('0x14')]['findOne']({'where':{'id':_0x3e7be7[_0x045c('0x2c')]['id']}})['then'](handleEntityNotFound(_0x24ae00,null))[_0x045c('0xc')](function(_0x6da7c9){if(_0x6da7c9){_0x3e7be7[_0x045c('0x32')][_0x045c('0x35')]=_0x6da7c9['id'];_0x3e7be7[_0x045c('0x32')][_0x045c('0x36')]=integrations['getSubjects'](_0x3e7be7['body'][_0x045c('0x37')],_0x3e7be7['body']['type']);_0x3e7be7[_0x045c('0x32')]['Descriptions']=integrations[_0x045c('0x38')](_0x3e7be7['body'][_0x045c('0x37')],_0x3e7be7[_0x045c('0x32')][_0x045c('0x16')]);return db[_0x045c('0x34')][_0x045c('0x31')](_0x3e7be7[_0x045c('0x32')],{'include':[{'model':db[_0x045c('0x39')],'as':_0x045c('0x36')},{'model':db['Dynamics365Field'],'as':_0x045c('0x3a')}]});}return null;})[_0x045c('0xc')](respondWithResult(_0x24ae00,null))[_0x045c('0x30')](handleError(_0x24ae00,null));};function sanitizeRemoteUri(_0x301e8d){var _0x4f5d4e=_0x301e8d[_0x045c('0x3b')](-0x1);if(_0x4f5d4e==='/')return _0x301e8d[_0x045c('0x3c')](0x0,_0x301e8d[_0x045c('0x3d')](_0x4f5d4e));return _0x301e8d;}function getWebApiUrl(_0x41af50){return util[_0x045c('0x3e')](_0x045c('0x3f'),_0x41af50);}exports[_0x045c('0x40')]=function(_0x399f58,_0x5b98d3){var _0x20c0a4=_0x399f58['query'][_0x045c('0x41')];var _0x418fb5=_0x20c0a4===_0x045c('0x42')?'Incident':'PhoneCall';var _0x3379b4='';var _0x52067b='';var _0x33aa3c='';var _0x5988f5='';var _0x3ccf05='';var _0x5255fb='';var _0x590b31='';var _0x2ca2a4='';var _0x5295e7=['title',_0x045c('0x43'),'customerid','ownerid',_0x045c('0x44'),_0x045c('0x45'),_0x045c('0x46'),_0x045c('0x47'),_0x045c('0x48'),_0x045c('0x49')];var _0x415c78=[_0x045c('0x4a'),_0x045c('0x4b'),_0x045c('0x4c'),_0x045c('0x4d'),'contactidname','contactidyominame',_0x045c('0x4e'),_0x045c('0x4f'),_0x045c('0x50'),'createdbyexternalpartyyominame',_0x045c('0x51'),_0x045c('0x52'),_0x045c('0x53'),_0x045c('0x54'),_0x045c('0x55'),_0x045c('0x56'),_0x045c('0x57'),_0x045c('0x58'),_0x045c('0x59'),'entitlementidname',_0x045c('0x5a'),'entityimage_url',_0x045c('0x5b'),_0x045c('0x5c'),'firstresponsebykpiidname',_0x045c('0x5d'),'importsequencenumber',_0x045c('0x5e'),_0x045c('0x5f'),'lastonholdtime',_0x045c('0x60'),_0x045c('0x61'),'modifiedbyexternalpartyyominame',_0x045c('0x62'),_0x045c('0x63'),_0x045c('0x64'),_0x045c('0x65'),'modifiedonbehalfbyyominame',_0x045c('0x66'),'msdyn_iotalertname','numberofchildincidents',_0x045c('0x67'),_0x045c('0x68'),_0x045c('0x69'),'owneridtype',_0x045c('0x6a'),_0x045c('0x6b'),_0x045c('0x6c'),_0x045c('0x6d'),_0x045c('0x6e'),_0x045c('0x6f'),_0x045c('0x70'),_0x045c('0x71'),_0x045c('0x72'),_0x045c('0x73'),_0x045c('0x74'),_0x045c('0x75'),_0x045c('0x76'),_0x045c('0x77'),'slaname','socialprofileidname','statecode',_0x045c('0x78'),'subjectidname',_0x045c('0x79'),'timezoneruleversionnumber','transactioncurrencyidname',_0x045c('0x7a'),_0x045c('0x7b'),_0x045c('0x7c')];var _0x3a00d9=_0x5295e7[_0x045c('0x7d')](_0x415c78);return db[_0x045c('0x14')][_0x045c('0x7e')]({'where':{'id':_0x399f58['params']['id']},'attributes':['id',_0x045c('0x7f'),_0x045c('0x80'),_0x045c('0x81'),_0x045c('0x82'),_0x045c('0x83'),_0x045c('0x84'),_0x045c('0x85')],'include':[{'model':db['CloudProvider'],'as':_0x045c('0x86'),'attributes':['id',_0x045c('0x87'),_0x045c('0x88')]}]})[_0x045c('0xc')](handleEntityNotFound(_0x5b98d3,null))[_0x045c('0xc')](function(_0x2dda4a){if(_0x2dda4a){if(_0x2dda4a[_0x045c('0x85')]){_0x2dda4a[_0x045c('0x89')]=_0x2dda4a[_0x045c('0x86')]['data5'];_0x2ca2a4=sanitizeRemoteUri(_0x2dda4a[_0x045c('0x86')][_0x045c('0x88')]);_0x590b31=getWebApiUrl(_0x2ca2a4);return _0x2dda4a;}_0x2ca2a4=sanitizeRemoteUri(_0x2dda4a[_0x045c('0x81')]);_0x590b31=getWebApiUrl(_0x2ca2a4);var _0x4d97f8={'method':_0x045c('0x8a'),'uri':_0x045c('0x8b')+_0x2dda4a[_0x045c('0x82')]+_0x045c('0x8c'),'form':{'client_id':_0x2dda4a['clientId'],'resource':_0x2ca2a4,'username':_0x2dda4a[_0x045c('0x7f')],'password':_0x2dda4a[_0x045c('0x80')],'grant_type':'password','client_secret':_0x2dda4a[_0x045c('0x84')]},'json':!![]};return rp(_0x4d97f8);}})[_0x045c('0xc')](function(_0x19da0a){_0x5255fb=_0x19da0a[_0x045c('0x89')];var _0xd0ccfd={'method':_0x045c('0x8d'),'uri':encodeURI(_0x590b31+_0x045c('0x8e')+_0x418fb5+'\x27'),'headers':{'Authorization':_0x045c('0x8f')+_0x5255fb,'If-None-Match':null,'OData-Version':_0x045c('0x90')},'json':!![]};return rp(_0xd0ccfd);})[_0x045c('0xc')](function(_0xec6fee){var _0x43d5a2=_0xec6fee[_0x045c('0x91')][0x0];var _0x4a6d41=_0x43d5a2[_0x045c('0x92')];var _0x193d02={'method':_0x045c('0x8d'),'uri':_0x590b31+'EntityDefinitions('+_0x4a6d41+_0x045c('0x93'),'headers':{'Authorization':_0x045c('0x8f')+_0x5255fb,'If-None-Match':null,'OData-Version':_0x045c('0x90')},'json':!![]};return rp(_0x193d02);})[_0x045c('0xc')](function(_0x4e986f){_0x3379b4=_0x4e986f;_0x52067b=_0x3379b4['Attributes'];_0x52067b=_['remove'](_0x52067b,function(_0x50b831){return!_0x3a00d9[_0x045c('0x94')](_0x50b831[_0x045c('0x95')]);});var _0x3d30eb=[];var _0x4905b7=[];_0x52067b[_0x045c('0x96')](function(_0x44db7e){if(_0x44db7e[_0x045c('0x97')]){var _0x7c9f7e=_0x44db7e[_0x045c('0x97')][_0x045c('0x3c')](_0x44db7e['@odata.type'][_0x045c('0x3d')]('.')+0x1);if(_0x7c9f7e===_0x045c('0x98')){_0x3d30eb[_0x045c('0x99')](getSelectList(_0x590b31,_0x20c0a4,_0x4905b7,_0x3379b4[_0x045c('0x92')],_0x44db7e[_0x045c('0x92')],_0x5255fb));}}});return Promise[_0x045c('0x9a')](_0x3d30eb);})[_0x045c('0xc')](function(_0x48d031){_0x33aa3c=_0x48d031[0x0];var _0x488712=[];var _0x5509cd=[];_0x52067b[_0x045c('0x96')](function(_0x5dcc1f){if(!_[_0x045c('0x9b')](_0x5dcc1f[_0x045c('0x97')])){var _0x48bfc7=_0x5dcc1f[_0x045c('0x97')][_0x045c('0x3c')](_0x5dcc1f[_0x045c('0x97')][_0x045c('0x3d')]('.')+0x1);if(_0x48bfc7===_0x045c('0x9c')){_0x488712[_0x045c('0x99')](getBooleanList(_0x590b31,_0x20c0a4,_0x5509cd,_0x3379b4[_0x045c('0x92')],_0x5dcc1f[_0x045c('0x92')],_0x5255fb));}}});return Promise[_0x045c('0x9a')](_0x488712);})[_0x045c('0xc')](function(_0x3da99c){_0x5988f5=_0x3da99c[0x0];var _0xd80788=[];var _0x5e40b6=[];_0x52067b[_0x045c('0x96')](function(_0x359b8e){if(_0x359b8e[_0x045c('0x97')]){var _0x220dc1=_0x359b8e[_0x045c('0x97')][_0x045c('0x3c')](_0x359b8e[_0x045c('0x97')]['lastIndexOf']('.')+0x1);if(_0x220dc1===_0x045c('0x9d')||_0x220dc1===_0x045c('0x9e')||_0x220dc1===_0x045c('0x9f')||_0x220dc1===_0x045c('0xa0')||_0x220dc1===_0x045c('0xa1')||_0x220dc1==='DateTimeAttributeMetadata'||_0x220dc1===_0x045c('0xa2')||_0x220dc1===_0x045c('0xa3')||_0x220dc1===_0x045c('0xa4')||_0x220dc1===_0x045c('0xa5')){_0xd80788['push'](getInputList(_0x590b31,_0x20c0a4,_0x220dc1,_0x5e40b6,_0x3379b4[_0x045c('0x92')],_0x359b8e['MetadataId'],_0x5255fb));}}});return Promise[_0x045c('0x9a')](_0xd80788);})[_0x045c('0xc')](function(_0x4ad51e){_0x3ccf05=_0x4ad51e[0x0];var _0x6baf30=_0x33aa3c[_0x045c('0x7d')](_0x5988f5)['concat'](_0x3ccf05);var _0x59c975={'count':_0x6baf30[_0x045c('0x1e')],'rows':_0x6baf30};return _0x59c975;})[_0x045c('0xc')](respondWithResult(_0x5b98d3,null))[_0x045c('0x30')](function(_0x385fdb){var _0xebd404=_0x399f58[_0x045c('0x19')]['test']?0x1f4:_0x385fdb[_0x045c('0xa6')]||0x1f4;logger[_0x045c('0xf')](_0x385fdb[_0x045c('0xa7')]);delete _0x385fdb[_0x045c('0x10')];if(_0xebd404===0x191){_0xebd404=0x190;}_0x5b98d3[_0x045c('0x4')](_0xebd404)[_0x045c('0x11')](_0x399f58[_0x045c('0x19')][_0x045c('0xa8')]?{'message':_0x045c('0xa9'),'statusCode':_0x385fdb['statusCode']}:_0x385fdb);});};function getSelectList(_0x5ee003,_0x6af993,_0x41bbfb,_0xefd923,_0x4e4aef,_0x476e6c){var _0x10fba8={'method':'GET','uri':_0x5ee003+_0x045c('0xaa')+_0xefd923+_0x045c('0xab')+_0x4e4aef+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x045c('0xac'),'headers':{'Authorization':_0x045c('0x8f')+_0x476e6c,'If-None-Match':null,'OData-Version':_0x045c('0x90')},'json':!![]};return rp(_0x10fba8)['then'](function(_0x3f8837){var _0x3d9371=[];var _0x2752d1=_0x3f8837[_0x045c('0xad')][_0x045c('0xae')];_0x2752d1[_0x045c('0x96')](function(_0x292349){_0x3d9371[_0x045c('0x99')]({'name':_0x292349[_0x045c('0xaf')][_0x045c('0xb0')][_0x045c('0xaf')],'value':String(_0x292349[_0x045c('0xb1')])});});var _0x21ce6b={'id':_0x6af993+'_'+_0x3f8837[_0x045c('0x95')],'name':_0x3f8837['DisplayName'][_0x045c('0xb0')]['Label'],'custom':![],'options':_0x3d9371};_0x41bbfb[_0x045c('0x99')](_0x21ce6b);return _0x41bbfb;});}function getBooleanList(_0x1a54ed,_0x3828cd,_0x2a5a7f,_0x3e95b3,_0x5b5212,_0x5eb67e){var _0x14af0b={'method':_0x045c('0x8d'),'uri':_0x1a54ed+'EntityDefinitions('+_0x3e95b3+')/Attributes('+_0x5b5212+_0x045c('0xb2'),'headers':{'Authorization':_0x045c('0x8f')+_0x5eb67e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x14af0b)[_0x045c('0xc')](function(_0x105060){var _0x41d56a=[];_0x41d56a[_0x045c('0x99')]({'name':_0x105060['OptionSet'][_0x045c('0xb3')][_0x045c('0xaf')]['UserLocalizedLabel'][_0x045c('0xaf')],'value':_0x045c('0xb4')},{'name':_0x105060[_0x045c('0xad')][_0x045c('0xb5')][_0x045c('0xaf')][_0x045c('0xb0')]['Label'],'value':_0x045c('0xb6')});var _0x180e8a={'id':_0x3828cd+'_'+_0x105060[_0x045c('0x95')],'name':_0x105060[_0x045c('0xb7')][_0x045c('0xb0')][_0x045c('0xaf')],'custom':![],'options':_0x41d56a};_0x2a5a7f['push'](_0x180e8a);return _0x2a5a7f;});}function getInputList(_0x1795ef,_0x27704c,_0x4b01f1,_0x170844,_0x1674a2,_0x49ae6b,_0x21dc23){var _0x49faa0={'method':_0x045c('0x8d'),'uri':_0x1795ef+_0x045c('0xaa')+_0x1674a2+')/Attributes('+_0x49ae6b+_0x045c('0xb8')+_0x4b01f1+_0x045c('0xb9'),'headers':{'Authorization':_0x045c('0x8f')+_0x21dc23,'If-None-Match':null,'OData-Version':_0x045c('0x90')},'json':!![]};return rp(_0x49faa0)[_0x045c('0xc')](function(_0x105b7c){var _0x2294e4={'id':_0x27704c+'_'+_0x105b7c[_0x045c('0x95')],'name':_0x105b7c['DisplayName'][_0x045c('0xb0')]?_0x105b7c[_0x045c('0xb7')][_0x045c('0xb0')][_0x045c('0xaf')]:_0x105b7c[_0x045c('0x95')],'custom':![],'options':[]};_0x170844[_0x045c('0x99')](_0x2294e4);return _0x170844;});} \ No newline at end of file +var _0xabe7=['statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','username','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','FalseOption','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../config/logger','api','../../mysqldb','status','json','offset','undefined','count','limit','set','destroy','then','end','error','send','Dynamics365Account','type','key','model','map','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','options','find','create','body','update','params','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','slice','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','Incident','title','description','customerid','ownerid','caseorigincode','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','statecode'];(function(_0x18b0a1,_0x535aac){var _0x55005a=function(_0xf42695){while(--_0xf42695){_0x18b0a1['push'](_0x18b0a1['shift']());}};_0x55005a(++_0x535aac);}(_0xabe7,0x1b0));var _0x7abe=function(_0x2f43db,_0x109ab9){_0x2f43db=_0x2f43db-0x0;var _0x1bfd87=_0xabe7[_0x2f43db];return _0x1bfd87;};'use strict';var rp=require(_0x7abe('0x0'));var util=require(_0x7abe('0x1'));var _=require(_0x7abe('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x7abe('0x3'))(_0x7abe('0x4'));var db=require(_0x7abe('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x2aee9b,_0x40b4c1){_0x40b4c1=_0x40b4c1||0xc8;return function(_0x589d0c){if(_0x589d0c){return _0x2aee9b[_0x7abe('0x6')](_0x40b4c1)[_0x7abe('0x7')](_0x589d0c);}};}function respondWithFilteredResult(_0x56d6ae,_0xa1afbe){return function(_0x1f3ebc){if(_0x1f3ebc){var _0x2fb3ad=typeof _0xa1afbe[_0x7abe('0x8')]==='undefined'&&typeof _0xa1afbe['limit']===_0x7abe('0x9');var _0x139d57=_0x1f3ebc[_0x7abe('0xa')];var _0x9e9619=_0x2fb3ad?0x0:_0xa1afbe[_0x7abe('0x8')];var _0x33389b=_0x2fb3ad?_0x1f3ebc['count']:_0xa1afbe['offset']+_0xa1afbe[_0x7abe('0xb')];var _0x51f4ad;if(_0x33389b>=_0x139d57){_0x33389b=_0x139d57;_0x51f4ad=0xc8;}else{_0x51f4ad=0xce;}_0x56d6ae[_0x7abe('0x6')](_0x51f4ad);return _0x56d6ae[_0x7abe('0xc')]('Content-Range',_0x9e9619+'-'+_0x33389b+'/'+_0x139d57)[_0x7abe('0x7')](_0x1f3ebc);}return null;};}function saveUpdates(_0x1852aa){return function(_0x52b4fe){if(_0x52b4fe){return _0x52b4fe['update'](_0x1852aa)['then'](function(_0x3ffde2){return _0x3ffde2;});}return null;};}function removeEntity(_0x4ae3f0){return function(_0x2b7f07){if(_0x2b7f07){return _0x2b7f07[_0x7abe('0xd')]()[_0x7abe('0xe')](function(){_0x4ae3f0[_0x7abe('0x6')](0xcc)[_0x7abe('0xf')]();});}};}function handleEntityNotFound(_0xcd4c2c){return function(_0x4e0d20){if(!_0x4e0d20){_0xcd4c2c['sendStatus'](0x194);}return _0x4e0d20;};}function handleError(_0x467052,_0x4a6cbf){_0x4a6cbf=_0x4a6cbf||0x1f4;return function(_0x35929f){logger[_0x7abe('0x10')](_0x35929f['stack']);if(_0x35929f['name']){delete _0x35929f['name'];}_0x467052['status'](_0x4a6cbf)[_0x7abe('0x11')](_0x35929f);};}exports['index']=function(_0x324d6f,_0x17b180){var _0x28041b={},_0x4519e6={},_0xe86293={'count':0x0,'rows':[]};var _0x3b37c0=_['map'](db[_0x7abe('0x12')]['rawAttributes'],function(_0x185018){return{'name':_0x185018['fieldName'],'type':_0x185018[_0x7abe('0x13')][_0x7abe('0x14')]};});_0x4519e6[_0x7abe('0x15')]=_[_0x7abe('0x16')](_0x3b37c0,_0x7abe('0x17'));_0x4519e6[_0x7abe('0x18')]=_['keys'](_0x324d6f[_0x7abe('0x18')]);_0x4519e6[_0x7abe('0x19')]=_['intersection'](_0x4519e6[_0x7abe('0x15')],_0x4519e6[_0x7abe('0x18')]);_0x28041b[_0x7abe('0x1a')]=_[_0x7abe('0x1b')](_0x4519e6[_0x7abe('0x15')],qs[_0x7abe('0x1c')](_0x324d6f[_0x7abe('0x18')][_0x7abe('0x1c')]));_0x28041b['attributes']=_0x28041b['attributes'][_0x7abe('0x1d')]?_0x28041b['attributes']:_0x4519e6['model'];if(!_0x324d6f['query'][_0x7abe('0x1e')](_0x7abe('0x1f'))){_0x28041b[_0x7abe('0xb')]=qs[_0x7abe('0xb')](_0x324d6f[_0x7abe('0x18')][_0x7abe('0xb')]);_0x28041b[_0x7abe('0x8')]=qs[_0x7abe('0x8')](_0x324d6f[_0x7abe('0x18')][_0x7abe('0x8')]);}_0x28041b[_0x7abe('0x20')]=qs[_0x7abe('0x21')](_0x324d6f[_0x7abe('0x18')][_0x7abe('0x21')]);_0x28041b[_0x7abe('0x22')]=qs[_0x7abe('0x19')](_[_0x7abe('0x23')](_0x324d6f['query'],_0x4519e6[_0x7abe('0x19')]),_0x3b37c0);if(_0x324d6f[_0x7abe('0x18')][_0x7abe('0x24')]){_0x28041b[_0x7abe('0x22')]=_[_0x7abe('0x25')](_0x28041b[_0x7abe('0x22')],{'$or':_[_0x7abe('0x16')](_0x3b37c0,function(_0x326786){if(_0x326786[_0x7abe('0x13')]!==_0x7abe('0x26')){var _0x111549={};_0x111549[_0x326786[_0x7abe('0x17')]]={'$like':'%'+_0x324d6f[_0x7abe('0x18')][_0x7abe('0x24')]+'%'};return _0x111549;}})});}_0x28041b=_[_0x7abe('0x25')]({},_0x28041b,_0x324d6f['options']);var _0xbbf06b={'where':_0x28041b[_0x7abe('0x22')]};return db['Dynamics365Account'][_0x7abe('0xa')](_0xbbf06b)[_0x7abe('0xe')](function(_0x122807){_0xe86293[_0x7abe('0xa')]=_0x122807;if(_0x324d6f['query'][_0x7abe('0x27')]){_0x28041b[_0x7abe('0x28')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x7abe('0x29')](_0x28041b);})[_0x7abe('0xe')](function(_0x1a6ab0){_0xe86293[_0x7abe('0x2a')]=_0x1a6ab0;return _0xe86293;})[_0x7abe('0xe')](respondWithFilteredResult(_0x17b180,_0x28041b))[_0x7abe('0x2b')](handleError(_0x17b180,null));};exports[_0x7abe('0x2c')]=function(_0x102e01,_0x2f447a){var _0x13ab7c={'raw':![],'where':{'id':_0x102e01['params']['id']}},_0x383a3d={};_0x383a3d[_0x7abe('0x15')]=_['keys'](db[_0x7abe('0x12')][_0x7abe('0x2d')]);_0x383a3d[_0x7abe('0x18')]=_[_0x7abe('0x2e')](_0x102e01[_0x7abe('0x18')]);_0x383a3d[_0x7abe('0x19')]=_[_0x7abe('0x1b')](_0x383a3d['model'],_0x383a3d[_0x7abe('0x18')]);_0x13ab7c['attributes']=_[_0x7abe('0x1b')](_0x383a3d[_0x7abe('0x15')],qs[_0x7abe('0x1c')](_0x102e01[_0x7abe('0x18')][_0x7abe('0x1c')]));_0x13ab7c['attributes']=_0x13ab7c[_0x7abe('0x1a')][_0x7abe('0x1d')]?_0x13ab7c[_0x7abe('0x1a')]:_0x383a3d[_0x7abe('0x15')];if(_0x102e01[_0x7abe('0x18')]['includeAll']){_0x13ab7c[_0x7abe('0x28')]=[{'all':!![]}];}_0x13ab7c=_[_0x7abe('0x25')]({},_0x13ab7c,_0x102e01[_0x7abe('0x2f')]);return db[_0x7abe('0x12')][_0x7abe('0x30')](_0x13ab7c)[_0x7abe('0xe')](handleEntityNotFound(_0x2f447a,null))[_0x7abe('0xe')](respondWithResult(_0x2f447a,null))[_0x7abe('0x2b')](handleError(_0x2f447a,null));};exports[_0x7abe('0x31')]=function(_0x85f7fe,_0x3a1e74){return db[_0x7abe('0x12')][_0x7abe('0x31')](_0x85f7fe[_0x7abe('0x32')],{})['then'](respondWithResult(_0x3a1e74,0xc9))[_0x7abe('0x2b')](handleError(_0x3a1e74,null));};exports[_0x7abe('0x33')]=function(_0xacf804,_0x4f4f92){if(_0xacf804['body']['id']){delete _0xacf804[_0x7abe('0x32')]['id'];}return db['Dynamics365Account'][_0x7abe('0x30')]({'where':{'id':_0xacf804[_0x7abe('0x34')]['id']}})[_0x7abe('0xe')](handleEntityNotFound(_0x4f4f92,null))[_0x7abe('0xe')](saveUpdates(_0xacf804[_0x7abe('0x32')],null))[_0x7abe('0xe')](respondWithResult(_0x4f4f92,null))[_0x7abe('0x2b')](handleError(_0x4f4f92,null));};exports['destroy']=function(_0x4916bc,_0x455677){return db['Dynamics365Account']['find']({'where':{'id':_0x4916bc[_0x7abe('0x34')]['id']}})[_0x7abe('0xe')](handleEntityNotFound(_0x455677,null))[_0x7abe('0xe')](removeEntity(_0x455677,null))[_0x7abe('0x2b')](handleError(_0x455677,null));};exports[_0x7abe('0x35')]=function(_0x1b6424,_0x42a882){var _0x2d9281={};var _0x34d14e={};var _0x535e7d;var _0x269723;return db[_0x7abe('0x12')][_0x7abe('0x36')]({'where':{'id':_0x1b6424[_0x7abe('0x34')]['id']}})[_0x7abe('0xe')](handleEntityNotFound(_0x42a882,null))[_0x7abe('0xe')](function(_0x4e9ea2){if(_0x4e9ea2){_0x535e7d=_0x4e9ea2;_0x34d14e[_0x7abe('0x15')]=_[_0x7abe('0x2e')](db['Dynamics365Configuration'][_0x7abe('0x2d')]);_0x34d14e[_0x7abe('0x18')]=_[_0x7abe('0x2e')](_0x1b6424[_0x7abe('0x18')]);_0x34d14e[_0x7abe('0x19')]=_['intersection'](_0x34d14e[_0x7abe('0x15')],_0x34d14e[_0x7abe('0x18')]);_0x2d9281[_0x7abe('0x1a')]=_[_0x7abe('0x1b')](_0x34d14e[_0x7abe('0x15')],qs[_0x7abe('0x1c')](_0x1b6424[_0x7abe('0x18')][_0x7abe('0x1c')]));_0x2d9281[_0x7abe('0x1a')]=_0x2d9281['attributes'][_0x7abe('0x1d')]?_0x2d9281[_0x7abe('0x1a')]:_0x34d14e[_0x7abe('0x15')];_0x2d9281[_0x7abe('0x20')]=qs[_0x7abe('0x21')](_0x1b6424['query'][_0x7abe('0x21')]);_0x2d9281[_0x7abe('0x22')]=qs[_0x7abe('0x19')](_[_0x7abe('0x23')](_0x1b6424[_0x7abe('0x18')],_0x34d14e['filters']));if(_0x1b6424[_0x7abe('0x18')][_0x7abe('0x24')]){_0x2d9281[_0x7abe('0x22')]=_[_0x7abe('0x25')](_0x2d9281[_0x7abe('0x22')],{'$or':_[_0x7abe('0x16')](_0x2d9281['attributes'],function(_0x49698e){var _0x2835b3={};_0x2835b3[_0x49698e]={'$like':'%'+_0x1b6424['query'][_0x7abe('0x24')]+'%'};return _0x2835b3;})});}_0x2d9281=_['merge']({},_0x2d9281,_0x1b6424['options']);return _0x535e7d[_0x7abe('0x35')](_0x2d9281);}})[_0x7abe('0xe')](function(_0x2df076){if(_0x2df076){_0x269723=_0x2df076[_0x7abe('0x1d')];if(!_0x1b6424['query']['hasOwnProperty'](_0x7abe('0x1f'))){_0x2d9281[_0x7abe('0xb')]=qs[_0x7abe('0xb')](_0x1b6424[_0x7abe('0x18')][_0x7abe('0xb')]);_0x2d9281['offset']=qs['offset'](_0x1b6424[_0x7abe('0x18')][_0x7abe('0x8')]);}return _0x535e7d['getConfigurations'](_0x2d9281);}})[_0x7abe('0xe')](function(_0x4f8d68){if(_0x4f8d68){return _0x4f8d68?{'count':_0x269723,'rows':_0x4f8d68}:null;}})['then'](respondWithResult(_0x42a882,null))[_0x7abe('0x2b')](handleError(_0x42a882,null));};exports[_0x7abe('0x37')]=function(_0x58baa9,_0x75c2a8){if(_0x58baa9['body']['id']){delete _0x58baa9['body']['id'];}return db[_0x7abe('0x12')]['findOne']({'where':{'id':_0x58baa9['params']['id']}})[_0x7abe('0xe')](handleEntityNotFound(_0x75c2a8,null))[_0x7abe('0xe')](function(_0x182cb9){if(_0x182cb9){_0x58baa9[_0x7abe('0x32')][_0x7abe('0x38')]=_0x182cb9['id'];_0x58baa9['body'][_0x7abe('0x39')]=integrations[_0x7abe('0x3a')](_0x58baa9[_0x7abe('0x32')][_0x7abe('0x3b')],_0x58baa9[_0x7abe('0x32')][_0x7abe('0x13')]);_0x58baa9[_0x7abe('0x32')][_0x7abe('0x3c')]=integrations['getDescriptions'](_0x58baa9[_0x7abe('0x32')][_0x7abe('0x3b')],_0x58baa9['body'][_0x7abe('0x13')]);return db['Dynamics365Configuration'][_0x7abe('0x31')](_0x58baa9[_0x7abe('0x32')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0x7abe('0x3d')],'as':_0x7abe('0x3c')}]});}return null;})[_0x7abe('0xe')](respondWithResult(_0x75c2a8,null))[_0x7abe('0x2b')](handleError(_0x75c2a8,null));};function sanitizeRemoteUri(_0x39217c){var _0x17eab2=_0x39217c[_0x7abe('0x3e')](-0x1);if(_0x17eab2==='/')return _0x39217c['substring'](0x0,_0x39217c[_0x7abe('0x3f')](_0x17eab2));return _0x39217c;}function getWebApiUrl(_0x42bda8){return util['format'](_0x7abe('0x40'),_0x42bda8);}exports[_0x7abe('0x41')]=function(_0x20f7bd,_0x5b5aea){var _0x4c6d5d=_0x20f7bd[_0x7abe('0x18')][_0x7abe('0x42')];var _0x4af73c=_0x4c6d5d==='incident'?_0x7abe('0x43'):'PhoneCall';var _0x23629f='';var _0x5b38c5='';var _0x4b8f99='';var _0x2bbb18='';var _0x10283b='';var _0x25d24a='';var _0x56c16a='';var _0x113625='';var _0x34e3ff=[_0x7abe('0x44'),_0x7abe('0x45'),_0x7abe('0x46'),_0x7abe('0x47'),_0x7abe('0x48'),'subject',_0x7abe('0x49'),'regardingobjectid',_0x7abe('0x4a'),_0x7abe('0x4b')];var _0x1ab51d=[_0x7abe('0x4c'),_0x7abe('0x4d'),_0x7abe('0x4e'),_0x7abe('0x4f'),_0x7abe('0x50'),_0x7abe('0x51'),'contractdetailidname',_0x7abe('0x52'),'createdbyexternalpartyname',_0x7abe('0x53'),'createdbyname',_0x7abe('0x54'),_0x7abe('0x55'),_0x7abe('0x56'),_0x7abe('0x57'),_0x7abe('0x58'),_0x7abe('0x59'),'customeridyominame','emailaddress',_0x7abe('0x5a'),'entityimage_timestamp',_0x7abe('0x5b'),_0x7abe('0x5c'),_0x7abe('0x5d'),_0x7abe('0x5e'),_0x7abe('0x5f'),_0x7abe('0x60'),'influencescore',_0x7abe('0x61'),_0x7abe('0x62'),_0x7abe('0x63'),_0x7abe('0x64'),'modifiedbyexternalpartyyominame',_0x7abe('0x65'),_0x7abe('0x66'),'modifiedon',_0x7abe('0x67'),'modifiedonbehalfbyyominame',_0x7abe('0x68'),_0x7abe('0x69'),_0x7abe('0x6a'),_0x7abe('0x6b'),_0x7abe('0x6c'),_0x7abe('0x6d'),'owneridtype',_0x7abe('0x6e'),_0x7abe('0x6f'),'primarycontactidname',_0x7abe('0x70'),_0x7abe('0x71'),_0x7abe('0x72'),_0x7abe('0x73'),_0x7abe('0x74'),_0x7abe('0x75'),_0x7abe('0x76'),_0x7abe('0x77'),_0x7abe('0x78'),_0x7abe('0x79'),'slainvokedidname','slaname','socialprofileidname',_0x7abe('0x7a'),_0x7abe('0x7b'),_0x7abe('0x7c'),_0x7abe('0x7d'),_0x7abe('0x7e'),'transactioncurrencyidname','traversedpath',_0x7abe('0x7f'),_0x7abe('0x80')];var _0xc10dc2=_0x34e3ff['concat'](_0x1ab51d);return db[_0x7abe('0x12')][_0x7abe('0x36')]({'where':{'id':_0x20f7bd[_0x7abe('0x34')]['id']},'attributes':['id',_0x7abe('0x81'),'password',_0x7abe('0x82'),_0x7abe('0x83'),_0x7abe('0x84'),_0x7abe('0x85'),_0x7abe('0x86')],'include':[{'model':db['CloudProvider'],'as':_0x7abe('0x87'),'attributes':['id',_0x7abe('0x88'),_0x7abe('0x89')]}]})['then'](handleEntityNotFound(_0x5b5aea,null))['then'](function(_0x318645){if(_0x318645){if(_0x318645[_0x7abe('0x86')]){_0x318645[_0x7abe('0x8a')]=_0x318645[_0x7abe('0x87')][_0x7abe('0x88')];_0x113625=sanitizeRemoteUri(_0x318645[_0x7abe('0x87')][_0x7abe('0x89')]);_0x56c16a=getWebApiUrl(_0x113625);return _0x318645;}_0x113625=sanitizeRemoteUri(_0x318645['remoteUri']);_0x56c16a=getWebApiUrl(_0x113625);var _0x1266fc={'method':_0x7abe('0x8b'),'uri':_0x7abe('0x8c')+_0x318645[_0x7abe('0x83')]+'/oauth2/token','form':{'client_id':_0x318645['clientId'],'resource':_0x113625,'username':_0x318645['username'],'password':_0x318645[_0x7abe('0x8d')],'grant_type':'password','client_secret':_0x318645[_0x7abe('0x85')]},'json':!![]};return rp(_0x1266fc);}})[_0x7abe('0xe')](function(_0x404369){_0x25d24a=_0x404369['access_token'];var _0x587768={'method':_0x7abe('0x8e'),'uri':encodeURI(_0x56c16a+_0x7abe('0x8f')+_0x4af73c+'\x27'),'headers':{'Authorization':_0x7abe('0x90')+_0x25d24a,'If-None-Match':null,'OData-Version':_0x7abe('0x91')},'json':!![]};return rp(_0x587768);})[_0x7abe('0xe')](function(_0x27931f){var _0x216d40=_0x27931f[_0x7abe('0x92')][0x0];var _0xed6354=_0x216d40[_0x7abe('0x93')];var _0x4342ec={'method':_0x7abe('0x8e'),'uri':_0x56c16a+'EntityDefinitions('+_0xed6354+_0x7abe('0x94'),'headers':{'Authorization':_0x7abe('0x90')+_0x25d24a,'If-None-Match':null,'OData-Version':_0x7abe('0x91')},'json':!![]};return rp(_0x4342ec);})[_0x7abe('0xe')](function(_0x540c66){_0x23629f=_0x540c66;_0x5b38c5=_0x23629f[_0x7abe('0x95')];_0x5b38c5=_[_0x7abe('0x96')](_0x5b38c5,function(_0x4735fa){return!_0xc10dc2[_0x7abe('0x97')](_0x4735fa[_0x7abe('0x98')]);});var _0x2f87ef=[];var _0x1f710f=[];_0x5b38c5[_0x7abe('0x99')](function(_0x1370f5){if(_0x1370f5[_0x7abe('0x9a')]){var _0x56768e=_0x1370f5['@odata.type'][_0x7abe('0x9b')](_0x1370f5[_0x7abe('0x9a')]['lastIndexOf']('.')+0x1);if(_0x56768e===_0x7abe('0x9c')){_0x2f87ef[_0x7abe('0x9d')](getSelectList(_0x56c16a,_0x4c6d5d,_0x1f710f,_0x23629f['MetadataId'],_0x1370f5[_0x7abe('0x93')],_0x25d24a));}}});return Promise[_0x7abe('0x9e')](_0x2f87ef);})[_0x7abe('0xe')](function(_0xb32277){_0x4b8f99=_0xb32277[0x0];var _0x288320=[];var _0x3e2d95=[];_0x5b38c5[_0x7abe('0x99')](function(_0x158480){if(!_[_0x7abe('0x9f')](_0x158480['@odata.type'])){var _0xfe45c1=_0x158480[_0x7abe('0x9a')][_0x7abe('0x9b')](_0x158480['@odata.type'][_0x7abe('0x3f')]('.')+0x1);if(_0xfe45c1==='BooleanAttributeMetadata'){_0x288320['push'](getBooleanList(_0x56c16a,_0x4c6d5d,_0x3e2d95,_0x23629f[_0x7abe('0x93')],_0x158480[_0x7abe('0x93')],_0x25d24a));}}});return Promise[_0x7abe('0x9e')](_0x288320);})[_0x7abe('0xe')](function(_0x11c54f){_0x2bbb18=_0x11c54f[0x0];var _0x5a3f10=[];var _0x523f77=[];_0x5b38c5['forEach'](function(_0x5420d4){if(_0x5420d4['@odata.type']){var _0x2bf4c6=_0x5420d4['@odata.type'][_0x7abe('0x9b')](_0x5420d4[_0x7abe('0x9a')][_0x7abe('0x3f')]('.')+0x1);if(_0x2bf4c6===_0x7abe('0xa0')||_0x2bf4c6===_0x7abe('0xa1')||_0x2bf4c6===_0x7abe('0xa2')||_0x2bf4c6===_0x7abe('0xa3')||_0x2bf4c6===_0x7abe('0xa4')||_0x2bf4c6===_0x7abe('0xa5')||_0x2bf4c6===_0x7abe('0xa6')||_0x2bf4c6===_0x7abe('0xa7')||_0x2bf4c6===_0x7abe('0xa8')||_0x2bf4c6===_0x7abe('0xa9')){_0x5a3f10[_0x7abe('0x9d')](getInputList(_0x56c16a,_0x4c6d5d,_0x2bf4c6,_0x523f77,_0x23629f[_0x7abe('0x93')],_0x5420d4[_0x7abe('0x93')],_0x25d24a));}}});return Promise[_0x7abe('0x9e')](_0x5a3f10);})[_0x7abe('0xe')](function(_0x51a2f9){_0x10283b=_0x51a2f9[0x0];var _0xe033c0=_0x4b8f99[_0x7abe('0xaa')](_0x2bbb18)[_0x7abe('0xaa')](_0x10283b);var _0x238769={'count':_0xe033c0[_0x7abe('0x1d')],'rows':_0xe033c0};return _0x238769;})[_0x7abe('0xe')](respondWithResult(_0x5b5aea,null))[_0x7abe('0x2b')](function(_0xdbeec7){var _0x4fadd7=_0x20f7bd['query'][_0x7abe('0xab')]?0x1f4:_0xdbeec7[_0x7abe('0xac')]||0x1f4;logger[_0x7abe('0x10')](_0xdbeec7['stack']);delete _0xdbeec7['name'];if(_0x4fadd7===0x191){_0x4fadd7=0x190;}_0x5b5aea['status'](_0x4fadd7)[_0x7abe('0x11')](_0x20f7bd[_0x7abe('0x18')]['test']?{'message':'Wrong\x20credentials','statusCode':_0xdbeec7[_0x7abe('0xac')]}:_0xdbeec7);});};function getSelectList(_0x1c7a3e,_0x576a74,_0x23dbe8,_0x1fb95d,_0x341ce1,_0x525c9a){var _0x3150d8={'method':'GET','uri':_0x1c7a3e+_0x7abe('0xad')+_0x1fb95d+_0x7abe('0xae')+_0x341ce1+_0x7abe('0xaf')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x7abe('0x90')+_0x525c9a,'If-None-Match':null,'OData-Version':_0x7abe('0x91')},'json':!![]};return rp(_0x3150d8)['then'](function(_0x3a3cfd){var _0x4f199b=[];var _0x2b6447=_0x3a3cfd[_0x7abe('0xb0')]['Options'];_0x2b6447[_0x7abe('0x99')](function(_0x297a3f){_0x4f199b['push']({'name':_0x297a3f[_0x7abe('0xb1')][_0x7abe('0xb2')][_0x7abe('0xb1')],'value':String(_0x297a3f[_0x7abe('0xb3')])});});var _0x4d2add={'id':_0x576a74+'_'+_0x3a3cfd[_0x7abe('0x98')],'name':_0x3a3cfd[_0x7abe('0xb4')][_0x7abe('0xb2')][_0x7abe('0xb1')],'custom':![],'options':_0x4f199b};_0x23dbe8[_0x7abe('0x9d')](_0x4d2add);return _0x23dbe8;});}function getBooleanList(_0x473298,_0x44fbf2,_0xb4945d,_0x5f3881,_0x45fb7b,_0x544b3f){var _0x59d593={'method':_0x7abe('0x8e'),'uri':_0x473298+'EntityDefinitions('+_0x5f3881+_0x7abe('0xae')+_0x45fb7b+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x544b3f,'If-None-Match':null,'OData-Version':_0x7abe('0x91')},'json':!![]};return rp(_0x59d593)['then'](function(_0x337cc9){var _0x5eec0d=[];_0x5eec0d['push']({'name':_0x337cc9[_0x7abe('0xb0')][_0x7abe('0xb5')][_0x7abe('0xb1')]['UserLocalizedLabel'][_0x7abe('0xb1')],'value':_0x7abe('0xb6')},{'name':_0x337cc9[_0x7abe('0xb0')][_0x7abe('0xb7')][_0x7abe('0xb1')]['UserLocalizedLabel']['Label'],'value':'false'});var _0x37dd7f={'id':_0x44fbf2+'_'+_0x337cc9[_0x7abe('0x98')],'name':_0x337cc9[_0x7abe('0xb4')]['UserLocalizedLabel'][_0x7abe('0xb1')],'custom':![],'options':_0x5eec0d};_0xb4945d[_0x7abe('0x9d')](_0x37dd7f);return _0xb4945d;});}function getInputList(_0x5a9ba3,_0x495abd,_0x3c0f39,_0x5bd1b9,_0x523916,_0x40d21e,_0x199c67){var _0x4c1ccf={'method':_0x7abe('0x8e'),'uri':_0x5a9ba3+_0x7abe('0xad')+_0x523916+_0x7abe('0xae')+_0x40d21e+')/Microsoft.Dynamics.CRM.'+_0x3c0f39+_0x7abe('0xb8'),'headers':{'Authorization':_0x7abe('0x90')+_0x199c67,'If-None-Match':null,'OData-Version':_0x7abe('0x91')},'json':!![]};return rp(_0x4c1ccf)[_0x7abe('0xe')](function(_0x86717f){var _0x2350bf={'id':_0x495abd+'_'+_0x86717f[_0x7abe('0x98')],'name':_0x86717f[_0x7abe('0xb4')][_0x7abe('0xb2')]?_0x86717f[_0x7abe('0xb4')][_0x7abe('0xb2')]['Label']:_0x86717f[_0x7abe('0x98')],'custom':![],'options':[]};_0x5bd1b9[_0x7abe('0x9d')](_0x2350bf);return _0x5bd1b9;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 313d835..0abe42c 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(_0x2528dc,_0x2613ee){var _0xbd7056=function(_0x594bed){while(--_0x594bed){_0x2528dc['push'](_0x2528dc['shift']());}};_0xbd7056(++_0x2613ee);}(_0xe706,0xa3));var _0x6e70=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0xe706[_0x41bdd4];return _0x5c03a6;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x13af87,_0x72d7e8){var _0x437c3a=function(_0x1a9657){while(--_0x1a9657){_0x13af87['push'](_0x13af87['shift']());}};_0x437c3a(++_0x72d7e8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 401204b..6d70dd3 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 _0xe4fa=['Dynamics365Account,\x20%s,\x20%s','catch','Dynamics365Account','findAll','options','where','attributes','limit','include','model','map','then','debug','GetDynamics365Account','raw','ShowDynamics365Account','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x58c506,_0x7d5d36){var _0x4c3d9a=function(_0x32fd80){while(--_0x32fd80){_0x58c506['push'](_0x58c506['shift']());}};_0x4c3d9a(++_0x7d5d36);}(_0xe4fa,0x130));var _0xae4f=function(_0x741cc1,_0x5de395){_0x741cc1=_0x741cc1-0x0;var _0x5ab7a5=_0xe4fa[_0x741cc1];return _0x5ab7a5;};'use strict';var _=require('lodash');var util=require(_0xae4f('0x0'));var moment=require('moment');var BPromise=require(_0xae4f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae4f('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xae4f('0x3'))(_0xae4f('0x4'));var config=require(_0xae4f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xae4f('0x6')][_0xae4f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14a50d,_0x482ac6,_0x353c0f){return new BPromise(function(_0x4827ac,_0x1476a4){return client[_0xae4f('0x8')](_0x14a50d,_0x353c0f)['then'](function(_0x495737){logger[_0xae4f('0x9')]('Dynamics365Account,\x20%s,\x20%s',_0x482ac6,_0xae4f('0xa'));logger['debug'](_0xae4f('0xb'),_0x482ac6,_0xae4f('0xa'),JSON[_0xae4f('0xc')](_0x495737));if(_0x495737[_0xae4f('0xd')]){if(_0x495737['error'][_0xae4f('0xe')]===0x1f4){logger[_0xae4f('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x482ac6,_0x495737[_0xae4f('0xd')][_0xae4f('0xf')]);return _0x1476a4(_0x495737['error'][_0xae4f('0xf')]);}logger[_0xae4f('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x482ac6,_0x495737[_0xae4f('0xd')]['message']);return _0x4827ac(_0x495737[_0xae4f('0xd')][_0xae4f('0xf')]);}else{logger[_0xae4f('0x9')](_0xae4f('0x10'),_0x482ac6,_0xae4f('0xa'));_0x4827ac(_0x495737['result'][_0xae4f('0xf')]);}})[_0xae4f('0x11')](function(_0x450ca2){logger[_0xae4f('0xd')](_0xae4f('0x10'),_0x482ac6,_0x450ca2);_0x1476a4(_0x450ca2);});});}exports['GetDynamics365Account']=function(_0x3d1417){var _0x57e6a9=this;return new Promise(function(_0x357e67,_0x18b7a0){return db[_0xae4f('0x12')][_0xae4f('0x13')]({'raw':_0x3d1417[_0xae4f('0x14')]?_0x3d1417[_0xae4f('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3d1417[_0xae4f('0x14')]?_0x3d1417['options'][_0xae4f('0x15')]||null:null,'attributes':_0x3d1417[_0xae4f('0x14')]?_0x3d1417[_0xae4f('0x14')][_0xae4f('0x16')]||null:null,'limit':_0x3d1417[_0xae4f('0x14')]?_0x3d1417[_0xae4f('0x14')][_0xae4f('0x17')]||null:null,'include':_0x3d1417['options']?_0x3d1417[_0xae4f('0x14')]['include']?_['map'](_0x3d1417[_0xae4f('0x14')][_0xae4f('0x18')],function(_0x2f38dc){return{'model':db[_0x2f38dc[_0xae4f('0x19')]],'as':_0x2f38dc['as'],'attributes':_0x2f38dc[_0xae4f('0x16')],'include':_0x2f38dc['include']?_[_0xae4f('0x1a')](_0x2f38dc[_0xae4f('0x18')],function(_0x51b9cf){return{'model':db[_0x51b9cf[_0xae4f('0x19')]],'as':_0x51b9cf['as'],'attributes':_0x51b9cf[_0xae4f('0x16')],'include':_0x51b9cf[_0xae4f('0x18')]?_[_0xae4f('0x1a')](_0x51b9cf[_0xae4f('0x18')],function(_0x3fc969){return{'model':db[_0x3fc969['model']],'as':_0x3fc969['as'],'attributes':_0x3fc969[_0xae4f('0x16')]};}):[]};}):[]};}):[]:[]})[_0xae4f('0x1b')](function(_0x4ad703){logger['info']('GetDynamics365Account',_0x3d1417);logger[_0xae4f('0x1c')]('GetDynamics365Account',_0x3d1417,JSON[_0xae4f('0xc')](_0x4ad703));_0x357e67(_0x4ad703);})[_0xae4f('0x11')](function(_0x3da3fc){logger[_0xae4f('0xd')](_0xae4f('0x1d'),_0x3da3fc[_0xae4f('0xf')],_0x3d1417);_0x18b7a0(_0x57e6a9[_0xae4f('0xd')](0x1f4,_0x3da3fc[_0xae4f('0xf')]));});});};exports['ShowDynamics365Account']=function(_0xe5c071){var _0x6912ef=this;return new Promise(function(_0x268d54,_0x1975a3){return db[_0xae4f('0x12')]['find']({'raw':_0xe5c071[_0xae4f('0x14')]?_0xe5c071[_0xae4f('0x14')][_0xae4f('0x1e')]===undefined?!![]:![]:!![],'where':_0xe5c071[_0xae4f('0x14')]?_0xe5c071[_0xae4f('0x14')][_0xae4f('0x15')]||null:null,'attributes':_0xe5c071['options']?_0xe5c071[_0xae4f('0x14')]['attributes']||null:null,'include':_0xe5c071[_0xae4f('0x14')]?_0xe5c071[_0xae4f('0x14')][_0xae4f('0x18')]?_['map'](_0xe5c071[_0xae4f('0x14')][_0xae4f('0x18')],function(_0x1cb788){return{'model':db[_0x1cb788[_0xae4f('0x19')]],'as':_0x1cb788['as'],'attributes':_0x1cb788['attributes'],'include':_0x1cb788[_0xae4f('0x18')]?_[_0xae4f('0x1a')](_0x1cb788[_0xae4f('0x18')],function(_0x15c0fc){return{'model':db[_0x15c0fc[_0xae4f('0x19')]],'as':_0x15c0fc['as'],'attributes':_0x15c0fc[_0xae4f('0x16')],'include':_0x15c0fc[_0xae4f('0x18')]?_['map'](_0x15c0fc[_0xae4f('0x18')],function(_0x1f3f60){return{'model':db[_0x1f3f60[_0xae4f('0x19')]],'as':_0x1f3f60['as'],'attributes':_0x1f3f60[_0xae4f('0x16')]};}):[]};}):[]};}):[]:[]})[_0xae4f('0x1b')](function(_0x5d8211){logger[_0xae4f('0x9')](_0xae4f('0x1f'),_0xe5c071);logger[_0xae4f('0x1c')](_0xae4f('0x1f'),_0xe5c071,JSON[_0xae4f('0xc')](_0x5d8211));_0x268d54(_0x5d8211);})['catch'](function(_0x3b4864){logger[_0xae4f('0xd')](_0xae4f('0x1f'),_0x3b4864[_0xae4f('0xf')],_0xe5c071);_0x1975a3(_0x6912ef[_0xae4f('0xd')](0x1f4,_0x3b4864[_0xae4f('0xf')]));});});}; \ No newline at end of file +var _0x1744=['include','map','attributes','model','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','code','message','error','info','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','limit'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1744,0x186));var _0x4174=function(_0x30a855,_0x18d680){_0x30a855=_0x30a855-0x0;var _0x342c97=_0x1744[_0x30a855];return _0x342c97;};'use strict';var _=require(_0x4174('0x0'));var util=require(_0x4174('0x1'));var moment=require(_0x4174('0x2'));var BPromise=require(_0x4174('0x3'));var rs=require(_0x4174('0x4'));var fs=require('fs');var Redis=require(_0x4174('0x5'));var db=require(_0x4174('0x6'))['db'];var utils=require(_0x4174('0x7'));var logger=require(_0x4174('0x8'))(_0x4174('0x9'));var config=require(_0x4174('0xa'));var jayson=require(_0x4174('0xb'));var client=jayson['client'][_0x4174('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2205c0,_0x38b806,_0xcdbe29){return new BPromise(function(_0x41c8cf,_0x49635f){return client['request'](_0x2205c0,_0xcdbe29)[_0x4174('0xd')](function(_0x4a5fde){logger['info'](_0x4174('0xe'),_0x38b806,_0x4174('0xf'));logger[_0x4174('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x38b806,_0x4174('0xf'),JSON[_0x4174('0x11')](_0x4a5fde));if(_0x4a5fde['error']){if(_0x4a5fde['error'][_0x4174('0x12')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x38b806,_0x4a5fde['error'][_0x4174('0x13')]);return _0x49635f(_0x4a5fde[_0x4174('0x14')][_0x4174('0x13')]);}logger[_0x4174('0x14')](_0x4174('0xe'),_0x38b806,_0x4a5fde['error'][_0x4174('0x13')]);return _0x41c8cf(_0x4a5fde[_0x4174('0x14')][_0x4174('0x13')]);}else{logger[_0x4174('0x15')](_0x4174('0xe'),_0x38b806,'request\x20sent');_0x41c8cf(_0x4a5fde[_0x4174('0x16')][_0x4174('0x13')]);}})[_0x4174('0x17')](function(_0x36b900){logger[_0x4174('0x14')](_0x4174('0xe'),_0x38b806,_0x36b900);_0x49635f(_0x36b900);});});}exports[_0x4174('0x18')]=function(_0x4f5ef4){var _0x5d32d2=this;return new Promise(function(_0x58580f,_0x464820){return db[_0x4174('0x19')]['findAll']({'raw':_0x4f5ef4[_0x4174('0x1a')]?_0x4f5ef4[_0x4174('0x1a')][_0x4174('0x1b')]===undefined?!![]:![]:!![],'where':_0x4f5ef4['options']?_0x4f5ef4[_0x4174('0x1a')][_0x4174('0x1c')]||null:null,'attributes':_0x4f5ef4[_0x4174('0x1a')]?_0x4f5ef4[_0x4174('0x1a')]['attributes']||null:null,'limit':_0x4f5ef4[_0x4174('0x1a')]?_0x4f5ef4[_0x4174('0x1a')][_0x4174('0x1d')]||null:null,'include':_0x4f5ef4[_0x4174('0x1a')]?_0x4f5ef4[_0x4174('0x1a')][_0x4174('0x1e')]?_[_0x4174('0x1f')](_0x4f5ef4['options'][_0x4174('0x1e')],function(_0x407619){return{'model':db[_0x407619['model']],'as':_0x407619['as'],'attributes':_0x407619[_0x4174('0x20')],'include':_0x407619[_0x4174('0x1e')]?_[_0x4174('0x1f')](_0x407619[_0x4174('0x1e')],function(_0x52b898){return{'model':db[_0x52b898[_0x4174('0x21')]],'as':_0x52b898['as'],'attributes':_0x52b898[_0x4174('0x20')],'include':_0x52b898[_0x4174('0x1e')]?_['map'](_0x52b898[_0x4174('0x1e')],function(_0x47b33e){return{'model':db[_0x47b33e[_0x4174('0x21')]],'as':_0x47b33e['as'],'attributes':_0x47b33e[_0x4174('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4174('0xd')](function(_0x134d61){logger['info']('GetDynamics365Account',_0x4f5ef4);logger['debug'](_0x4174('0x18'),_0x4f5ef4,JSON[_0x4174('0x11')](_0x134d61));_0x58580f(_0x134d61);})[_0x4174('0x17')](function(_0x1034e1){logger[_0x4174('0x14')](_0x4174('0x18'),_0x1034e1[_0x4174('0x13')],_0x4f5ef4);_0x464820(_0x5d32d2['error'](0x1f4,_0x1034e1[_0x4174('0x13')]));});});};exports[_0x4174('0x22')]=function(_0x5be830){var _0x3dffa4=this;return new Promise(function(_0xe26c09,_0x42f8dd){return db[_0x4174('0x19')]['find']({'raw':_0x5be830[_0x4174('0x1a')]?_0x5be830[_0x4174('0x1a')][_0x4174('0x1b')]===undefined?!![]:![]:!![],'where':_0x5be830[_0x4174('0x1a')]?_0x5be830[_0x4174('0x1a')][_0x4174('0x1c')]||null:null,'attributes':_0x5be830[_0x4174('0x1a')]?_0x5be830[_0x4174('0x1a')][_0x4174('0x20')]||null:null,'include':_0x5be830[_0x4174('0x1a')]?_0x5be830[_0x4174('0x1a')][_0x4174('0x1e')]?_[_0x4174('0x1f')](_0x5be830[_0x4174('0x1a')][_0x4174('0x1e')],function(_0x2b5801){return{'model':db[_0x2b5801['model']],'as':_0x2b5801['as'],'attributes':_0x2b5801[_0x4174('0x20')],'include':_0x2b5801[_0x4174('0x1e')]?_[_0x4174('0x1f')](_0x2b5801['include'],function(_0xbd972f){return{'model':db[_0xbd972f[_0x4174('0x21')]],'as':_0xbd972f['as'],'attributes':_0xbd972f['attributes'],'include':_0xbd972f[_0x4174('0x1e')]?_[_0x4174('0x1f')](_0xbd972f['include'],function(_0x2d54be){return{'model':db[_0x2d54be[_0x4174('0x21')]],'as':_0x2d54be['as'],'attributes':_0x2d54be[_0x4174('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4174('0xd')](function(_0x29683f){logger[_0x4174('0x15')](_0x4174('0x22'),_0x5be830);logger[_0x4174('0x10')](_0x4174('0x22'),_0x5be830,JSON[_0x4174('0x11')](_0x29683f));_0xe26c09(_0x29683f);})['catch'](function(_0x9ea526){logger['error'](_0x4174('0x22'),_0x9ea526['message'],_0x5be830);_0x42f8dd(_0x3dffa4[_0x4174('0x14')](0x1f4,_0x9ea526['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 415653b..7ebd29e 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 _0x0f8e=['getSubjects','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id/fields','getFields'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0f8e,0x7a));var _0xe0f8=function(_0x46b01f,_0x43dc27){_0x46b01f=_0x46b01f-0x0;var _0x5b091a=_0x0f8e[_0x46b01f];return _0x5b091a;};'use strict';var multer=require('multer');var util=require(_0xe0f8('0x0'));var path=require(_0xe0f8('0x1'));var timeout=require(_0xe0f8('0x2'));var express=require(_0xe0f8('0x3'));var router=express['Router']();var fs_extra=require(_0xe0f8('0x4'));var auth=require(_0xe0f8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0xe0f8('0x6')]('/',auth[_0xe0f8('0x7')](),controller[_0xe0f8('0x8')]);router[_0xe0f8('0x6')]('/:id',auth[_0xe0f8('0x7')](),controller['show']);router[_0xe0f8('0x6')](_0xe0f8('0x9'),auth[_0xe0f8('0x7')](),controller[_0xe0f8('0xa')]);router[_0xe0f8('0x6')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xe0f8('0xb')]);router['get']('/:id/descriptions',auth[_0xe0f8('0x7')](),controller['getDescriptions']);router[_0xe0f8('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe0f8('0xd')](_0xe0f8('0xe'),auth[_0xe0f8('0x7')](),controller[_0xe0f8('0xf')]);router[_0xe0f8('0x10')](_0xe0f8('0xe'),auth['isAuthenticated'](),controller[_0xe0f8('0x11')]);module[_0xe0f8('0x12')]=router; \ No newline at end of file +var _0xd958=['multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','create','put','update','destroy','exports'];(function(_0x50bbc9,_0x5de4da){var _0x21f10f=function(_0x64158f){while(--_0x64158f){_0x50bbc9['push'](_0x50bbc9['shift']());}};_0x21f10f(++_0x5de4da);}(_0xd958,0xb8));var _0x8d95=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xd958[_0x56916d];return _0x2b7f1f;};'use strict';var multer=require(_0x8d95('0x0'));var util=require(_0x8d95('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8d95('0x2'));var router=express['Router']();var fs_extra=require(_0x8d95('0x3'));var auth=require(_0x8d95('0x4'));var interaction=require(_0x8d95('0x5'));var config=require(_0x8d95('0x6'));var controller=require(_0x8d95('0x7'));router[_0x8d95('0x8')]('/',auth[_0x8d95('0x9')](),controller[_0x8d95('0xa')]);router['get'](_0x8d95('0xb'),auth[_0x8d95('0x9')](),controller[_0x8d95('0xc')]);router[_0x8d95('0x8')](_0x8d95('0xd'),auth['isAuthenticated'](),controller[_0x8d95('0xe')]);router[_0x8d95('0x8')](_0x8d95('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x8d95('0x8')](_0x8d95('0x10'),auth[_0x8d95('0x9')](),controller['getDescriptions']);router[_0x8d95('0x11')]('/',auth['isAuthenticated'](),controller[_0x8d95('0x12')]);router[_0x8d95('0x13')]('/:id',auth[_0x8d95('0x9')](),controller[_0x8d95('0x14')]);router['delete'](_0x8d95('0xb'),auth[_0x8d95('0x9')](),controller[_0x8d95('0x15')]);module[_0x8d95('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index dc53875..1f5c0a8 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 _0x6dc9=['ENUM','incident','contact','BOOLEAN','sequelize','exports','STRING'];(function(_0x50d56a,_0x579da1){var _0x8e28a5=function(_0x37a9e0){while(--_0x37a9e0){_0x50d56a['push'](_0x50d56a['shift']());}};_0x8e28a5(++_0x579da1);}(_0x6dc9,0x74));var _0x96dc=function(_0x2926db,_0x1f6561){_0x2926db=_0x2926db-0x0;var _0x1f025d=_0x6dc9[_0x2926db];return _0x1f025d;};'use strict';var Sequelize=require(_0x96dc('0x0'));module[_0x96dc('0x1')]={'name':{'type':Sequelize[_0x96dc('0x2')]},'description':{'type':Sequelize[_0x96dc('0x2')]},'ticketType':{'type':Sequelize[_0x96dc('0x3')](_0x96dc('0x4'),'phonecall'),'defaultValue':_0x96dc('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x96dc('0x5'),'nothing'),'defaultValue':_0x96dc('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x96dc('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x96dc('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xbc27=['contact','nothing','sequelize','exports','STRING','ENUM','incident'];(function(_0x2bae7f,_0x3389f6){var _0x490416=function(_0x3b2037){while(--_0x3b2037){_0x2bae7f['push'](_0x2bae7f['shift']());}};_0x490416(++_0x3389f6);}(_0xbc27,0x1e5));var _0x7bc2=function(_0x5956d3,_0xa90224){_0x5956d3=_0x5956d3-0x0;var _0x58c9d2=_0xbc27[_0x5956d3];return _0x58c9d2;};'use strict';var Sequelize=require(_0x7bc2('0x0'));module[_0x7bc2('0x1')]={'name':{'type':Sequelize[_0x7bc2('0x2')]},'description':{'type':Sequelize[_0x7bc2('0x2')]},'ticketType':{'type':Sequelize[_0x7bc2('0x3')](_0x7bc2('0x4'),'phonecall'),'defaultValue':_0x7bc2('0x4')},'moduleCreate':{'type':Sequelize[_0x7bc2('0x3')](_0x7bc2('0x5'),_0x7bc2('0x6')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 56b87ae..6f3c7e5 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 _0x5468=['body','find','getFields','findOne','order','pick','getSubjects','Dynamics365Field','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','sendStatus','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','Dynamics365Configuration','includeAll','findAll','rows','catch','show','params','include','create','update'];(function(_0x2328de,_0x5bdc11){var _0x45dfa5=function(_0x4cc259){while(--_0x4cc259){_0x2328de['push'](_0x2328de['shift']());}};_0x45dfa5(++_0x5bdc11);}(_0x5468,0xf8));var _0x8546=function(_0xa79dc4,_0x5cb28a){_0xa79dc4=_0xa79dc4-0x0;var _0x170a44=_0x5468[_0xa79dc4];return _0x170a44;};'use strict';var emlformat=require(_0x8546('0x0'));var rimraf=require(_0x8546('0x1'));var zipdir=require(_0x8546('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8546('0x3'));var moment=require(_0x8546('0x4'));var BPromise=require(_0x8546('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8546('0x6'));var sox=require(_0x8546('0x7'));var csv=require(_0x8546('0x8'));var ejs=require(_0x8546('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8546('0xa'));var squel=require(_0x8546('0xb'));var crypto=require(_0x8546('0xc'));var jsforce=require(_0x8546('0xd'));var deskjs=require(_0x8546('0xe'));var toCsv=require(_0x8546('0x8'));var querystring=require(_0x8546('0xf'));var Papa=require(_0x8546('0x10'));var Redis=require(_0x8546('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8546('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8546('0x13'));var logger=require(_0x8546('0x14'))(_0x8546('0x15'));var utils=require(_0x8546('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8546('0x17'));var db=require(_0x8546('0x18'))['db'];function respondWithStatusCode(_0x2f589b,_0x50e7a4){_0x50e7a4=_0x50e7a4||0xcc;return function(_0x3c6d37){if(_0x3c6d37){return _0x2f589b['sendStatus'](_0x50e7a4);}return _0x2f589b[_0x8546('0x19')](_0x50e7a4)[_0x8546('0x1a')]();};}function respondWithResult(_0x5dbe63,_0xcf4a47){_0xcf4a47=_0xcf4a47||0xc8;return function(_0x1537d5){if(_0x1537d5){return _0x5dbe63[_0x8546('0x19')](_0xcf4a47)[_0x8546('0x1b')](_0x1537d5);}};}function respondWithFilteredResult(_0x45befa,_0x448a96){return function(_0x45ff1d){if(_0x45ff1d){var _0x1851a2=typeof _0x448a96[_0x8546('0x1c')]==='undefined'&&typeof _0x448a96[_0x8546('0x1d')]===_0x8546('0x1e');var _0x38174d=_0x45ff1d[_0x8546('0x1f')];var _0x22161c=_0x1851a2?0x0:_0x448a96[_0x8546('0x1c')];var _0x13e634=_0x1851a2?_0x45ff1d['count']:_0x448a96[_0x8546('0x1c')]+_0x448a96[_0x8546('0x1d')];var _0x3ffed8;if(_0x13e634>=_0x38174d){_0x13e634=_0x38174d;_0x3ffed8=0xc8;}else{_0x3ffed8=0xce;}_0x45befa[_0x8546('0x19')](_0x3ffed8);return _0x45befa['set'](_0x8546('0x20'),_0x22161c+'-'+_0x13e634+'/'+_0x38174d)[_0x8546('0x1b')](_0x45ff1d);}return null;};}function patchUpdates(_0x315f04){return function(_0x52c76c){try{jsonpatch[_0x8546('0x21')](_0x52c76c,_0x315f04,!![]);}catch(_0x856874){return BPromise[_0x8546('0x22')](_0x856874);}return _0x52c76c[_0x8546('0x23')]();};}function saveUpdates(_0x3e7ea6,_0x2653c2){return function(_0x16cb6e){if(_0x16cb6e){return _0x16cb6e['update'](_0x3e7ea6)[_0x8546('0x24')](function(_0x3d79c7){return _0x3d79c7;});}return null;};}function removeEntity(_0x6affba,_0x4c43f6){return function(_0x385f77){if(_0x385f77){return _0x385f77[_0x8546('0x25')]()[_0x8546('0x24')](function(){_0x6affba[_0x8546('0x19')](0xcc)[_0x8546('0x1a')]();});}};}function handleEntityNotFound(_0x3f342f,_0x95ca91){return function(_0x95903f){if(!_0x95903f){_0x3f342f[_0x8546('0x26')](0x194);}return _0x95903f;};}function handleError(_0x3d7463,_0x5272f3){_0x5272f3=_0x5272f3||0x1f4;return function(_0x117eee){logger['error'](_0x117eee['stack']);if(_0x117eee[_0x8546('0x27')]){delete _0x117eee['name'];}_0x3d7463['status'](_0x5272f3)[_0x8546('0x28')](_0x117eee);};}exports[_0x8546('0x29')]=function(_0x427f19,_0x4e8e42){var _0x4c413f={},_0x119a9a={},_0x41929d={'count':0x0,'rows':[]};var _0x3fb2d4=_[_0x8546('0x2a')](db['Dynamics365Configuration'][_0x8546('0x2b')],function(_0x89972e){return{'name':_0x89972e['fieldName'],'type':_0x89972e[_0x8546('0x2c')][_0x8546('0x2d')]};});_0x119a9a['model']=_[_0x8546('0x2a')](_0x3fb2d4,_0x8546('0x27'));_0x119a9a[_0x8546('0x2e')]=_[_0x8546('0x2f')](_0x427f19[_0x8546('0x2e')]);_0x119a9a[_0x8546('0x30')]=_[_0x8546('0x31')](_0x119a9a[_0x8546('0x32')],_0x119a9a['query']);_0x4c413f['attributes']=_[_0x8546('0x31')](_0x119a9a[_0x8546('0x32')],qs[_0x8546('0x33')](_0x427f19[_0x8546('0x2e')][_0x8546('0x33')]));_0x4c413f['attributes']=_0x4c413f[_0x8546('0x34')][_0x8546('0x35')]?_0x4c413f[_0x8546('0x34')]:_0x119a9a[_0x8546('0x32')];if(!_0x427f19['query'][_0x8546('0x36')](_0x8546('0x37'))){_0x4c413f['limit']=qs[_0x8546('0x1d')](_0x427f19['query'][_0x8546('0x1d')]);_0x4c413f[_0x8546('0x1c')]=qs[_0x8546('0x1c')](_0x427f19['query']['offset']);}_0x4c413f['order']=qs[_0x8546('0x38')](_0x427f19[_0x8546('0x2e')][_0x8546('0x38')]);_0x4c413f[_0x8546('0x39')]=qs[_0x8546('0x30')](_['pick'](_0x427f19[_0x8546('0x2e')],_0x119a9a[_0x8546('0x30')]),_0x3fb2d4);if(_0x427f19[_0x8546('0x2e')][_0x8546('0x3a')]){_0x4c413f['where']=_['merge'](_0x4c413f[_0x8546('0x39')],{'$or':_[_0x8546('0x2a')](_0x3fb2d4,function(_0x12d2c5){if(_0x12d2c5[_0x8546('0x2c')]!==_0x8546('0x3b')){var _0x516e4e={};_0x516e4e[_0x12d2c5['name']]={'$like':'%'+_0x427f19[_0x8546('0x2e')][_0x8546('0x3a')]+'%'};return _0x516e4e;}})});}_0x4c413f=_[_0x8546('0x3c')]({},_0x4c413f,_0x427f19[_0x8546('0x3d')]);var _0x2d2625={'where':_0x4c413f[_0x8546('0x39')]};return db[_0x8546('0x3e')][_0x8546('0x1f')](_0x2d2625)[_0x8546('0x24')](function(_0x506b8f){_0x41929d[_0x8546('0x1f')]=_0x506b8f;if(_0x427f19[_0x8546('0x2e')][_0x8546('0x3f')]){_0x4c413f['include']=[{'all':!![]}];}return db[_0x8546('0x3e')][_0x8546('0x40')](_0x4c413f);})[_0x8546('0x24')](function(_0x3966a4){_0x41929d[_0x8546('0x41')]=_0x3966a4;return _0x41929d;})[_0x8546('0x24')](respondWithFilteredResult(_0x4e8e42,_0x4c413f))[_0x8546('0x42')](handleError(_0x4e8e42,null));};exports[_0x8546('0x43')]=function(_0x22f7ae,_0x452cf7){var _0x30c418={'raw':![],'where':{'id':_0x22f7ae[_0x8546('0x44')]['id']}},_0x52ad2d={};_0x52ad2d[_0x8546('0x32')]=_[_0x8546('0x2f')](db[_0x8546('0x3e')]['rawAttributes']);_0x52ad2d[_0x8546('0x2e')]=_['keys'](_0x22f7ae['query']);_0x52ad2d['filters']=_[_0x8546('0x31')](_0x52ad2d[_0x8546('0x32')],_0x52ad2d[_0x8546('0x2e')]);_0x30c418['attributes']=_['intersection'](_0x52ad2d[_0x8546('0x32')],qs[_0x8546('0x33')](_0x22f7ae[_0x8546('0x2e')]['fields']));_0x30c418[_0x8546('0x34')]=_0x30c418['attributes']['length']?_0x30c418[_0x8546('0x34')]:_0x52ad2d[_0x8546('0x32')];if(_0x22f7ae['query']['includeAll']){_0x30c418[_0x8546('0x45')]=[{'all':!![]}];}_0x30c418=_[_0x8546('0x3c')]({},_0x30c418,_0x22f7ae[_0x8546('0x3d')]);return db[_0x8546('0x3e')]['find'](_0x30c418)['then'](handleEntityNotFound(_0x452cf7,null))['then'](respondWithResult(_0x452cf7,null))[_0x8546('0x42')](handleError(_0x452cf7,null));};exports[_0x8546('0x46')]=function(_0x489bfc,_0x3be861){return db['Dynamics365Configuration'][_0x8546('0x46')](_0x489bfc['body'],{})['then'](respondWithResult(_0x3be861,0xc9))[_0x8546('0x42')](handleError(_0x3be861,null));};exports[_0x8546('0x47')]=function(_0x370399,_0x5b5ec3){if(_0x370399[_0x8546('0x48')]['id']){delete _0x370399['body']['id'];}return db[_0x8546('0x3e')]['find']({'where':{'id':_0x370399[_0x8546('0x44')]['id']}})[_0x8546('0x24')](handleEntityNotFound(_0x5b5ec3,null))[_0x8546('0x24')](saveUpdates(_0x370399['body'],null))[_0x8546('0x24')](respondWithResult(_0x5b5ec3,null))[_0x8546('0x42')](handleError(_0x5b5ec3,null));};exports[_0x8546('0x25')]=function(_0x1a7bc3,_0x47e679){return db[_0x8546('0x3e')][_0x8546('0x49')]({'where':{'id':_0x1a7bc3[_0x8546('0x44')]['id']}})[_0x8546('0x24')](handleEntityNotFound(_0x47e679,null))['then'](removeEntity(_0x47e679,null))[_0x8546('0x42')](handleError(_0x47e679,null));};exports[_0x8546('0x4a')]=function(_0x39366c,_0x5bfd69,_0x4e5412){var _0x5547e2={};var _0xa5ac2={};var _0x12cfaa;var _0x15fb2f;return db['Dynamics365Configuration'][_0x8546('0x4b')]({'where':{'id':_0x39366c[_0x8546('0x44')]['id']}})['then'](handleEntityNotFound(_0x5bfd69,null))[_0x8546('0x24')](function(_0x87475d){if(_0x87475d){_0x12cfaa=_0x87475d;_0xa5ac2[_0x8546('0x32')]=_[_0x8546('0x2f')](db['Dynamics365Field'][_0x8546('0x2b')]);_0xa5ac2[_0x8546('0x2e')]=_[_0x8546('0x2f')](_0x39366c[_0x8546('0x2e')]);_0xa5ac2[_0x8546('0x30')]=_['intersection'](_0xa5ac2[_0x8546('0x32')],_0xa5ac2[_0x8546('0x2e')]);_0x5547e2[_0x8546('0x34')]=_['intersection'](_0xa5ac2['model'],qs[_0x8546('0x33')](_0x39366c[_0x8546('0x2e')][_0x8546('0x33')]));_0x5547e2[_0x8546('0x34')]=_0x5547e2[_0x8546('0x34')][_0x8546('0x35')]?_0x5547e2['attributes']:_0xa5ac2['model'];_0x5547e2[_0x8546('0x4c')]=qs[_0x8546('0x38')](_0x39366c['query'][_0x8546('0x38')]);_0x5547e2['where']=qs[_0x8546('0x30')](_[_0x8546('0x4d')](_0x39366c[_0x8546('0x2e')],_0xa5ac2[_0x8546('0x30')]));if(_0x39366c['query'][_0x8546('0x3a')]){_0x5547e2[_0x8546('0x39')]=_[_0x8546('0x3c')](_0x5547e2['where'],{'$or':_[_0x8546('0x2a')](_0x5547e2['attributes'],function(_0x109344){var _0x7ed259={};_0x7ed259[_0x109344]={'$like':'%'+_0x39366c['query'][_0x8546('0x3a')]+'%'};return _0x7ed259;})});}_0x5547e2=_[_0x8546('0x3c')]({},_0x5547e2,_0x39366c[_0x8546('0x3d')]);return _0x12cfaa[_0x8546('0x4a')](_0x5547e2);}})[_0x8546('0x24')](function(_0x54408b){if(_0x54408b){_0x15fb2f=_0x54408b[_0x8546('0x35')];if(!_0x39366c[_0x8546('0x2e')][_0x8546('0x36')](_0x8546('0x37'))){_0x5547e2[_0x8546('0x1d')]=qs['limit'](_0x39366c['query'][_0x8546('0x1d')]);_0x5547e2[_0x8546('0x1c')]=qs[_0x8546('0x1c')](_0x39366c['query'][_0x8546('0x1c')]);}return _0x12cfaa['getFields'](_0x5547e2);}})[_0x8546('0x24')](function(_0x2305e6){if(_0x2305e6){return _0x2305e6?{'count':_0x15fb2f,'rows':_0x2305e6}:null;}})['then'](respondWithResult(_0x5bfd69,null))[_0x8546('0x42')](handleError(_0x5bfd69,null));};exports[_0x8546('0x4e')]=function(_0x30e62c,_0x3e9653,_0x12d374){var _0x447db3={};var _0x15e6e1={};var _0x28ef80;var _0xa9284e;return db[_0x8546('0x3e')][_0x8546('0x4b')]({'where':{'id':_0x30e62c['params']['id']}})[_0x8546('0x24')](handleEntityNotFound(_0x3e9653,null))[_0x8546('0x24')](function(_0xe494c3){if(_0xe494c3){_0x28ef80=_0xe494c3;_0x15e6e1[_0x8546('0x32')]=_[_0x8546('0x2f')](db[_0x8546('0x4f')][_0x8546('0x2b')]);_0x15e6e1[_0x8546('0x2e')]=_['keys'](_0x30e62c[_0x8546('0x2e')]);_0x15e6e1['filters']=_[_0x8546('0x31')](_0x15e6e1[_0x8546('0x32')],_0x15e6e1[_0x8546('0x2e')]);_0x447db3[_0x8546('0x34')]=_[_0x8546('0x31')](_0x15e6e1[_0x8546('0x32')],qs['fields'](_0x30e62c[_0x8546('0x2e')][_0x8546('0x33')]));_0x447db3[_0x8546('0x34')]=_0x447db3[_0x8546('0x34')][_0x8546('0x35')]?_0x447db3[_0x8546('0x34')]:_0x15e6e1[_0x8546('0x32')];_0x447db3[_0x8546('0x4c')]=qs['sort'](_0x30e62c[_0x8546('0x2e')][_0x8546('0x38')]);_0x447db3[_0x8546('0x39')]=qs['filters'](_[_0x8546('0x4d')](_0x30e62c[_0x8546('0x2e')],_0x15e6e1['filters']));if(_0x30e62c[_0x8546('0x2e')]['filter']){_0x447db3[_0x8546('0x39')]=_[_0x8546('0x3c')](_0x447db3[_0x8546('0x39')],{'$or':_[_0x8546('0x2a')](_0x447db3[_0x8546('0x34')],function(_0x5d8b0e){var _0x28fb9a={};_0x28fb9a[_0x5d8b0e]={'$like':'%'+_0x30e62c['query']['filter']+'%'};return _0x28fb9a;})});}_0x447db3=_[_0x8546('0x3c')]({},_0x447db3,_0x30e62c[_0x8546('0x3d')]);return _0x28ef80['getSubjects'](_0x447db3);}})['then'](function(_0x3865ef){if(_0x3865ef){_0xa9284e=_0x3865ef[_0x8546('0x35')];if(!_0x30e62c[_0x8546('0x2e')][_0x8546('0x36')](_0x8546('0x37'))){_0x447db3[_0x8546('0x1d')]=qs[_0x8546('0x1d')](_0x30e62c[_0x8546('0x2e')][_0x8546('0x1d')]);_0x447db3[_0x8546('0x1c')]=qs[_0x8546('0x1c')](_0x30e62c[_0x8546('0x2e')][_0x8546('0x1c')]);}return _0x28ef80[_0x8546('0x4e')](_0x447db3);}})[_0x8546('0x24')](function(_0x58a7bb){if(_0x58a7bb){return _0x58a7bb?{'count':_0xa9284e,'rows':_0x58a7bb}:null;}})[_0x8546('0x24')](respondWithResult(_0x3e9653,null))['catch'](handleError(_0x3e9653,null));};exports['getDescriptions']=function(_0x2f80f1,_0x22d1a1,_0x291711){var _0x55607d={};var _0x4a40c3={};var _0x42e235;var _0x316c99;return db[_0x8546('0x3e')][_0x8546('0x4b')]({'where':{'id':_0x2f80f1['params']['id']}})[_0x8546('0x24')](handleEntityNotFound(_0x22d1a1,null))[_0x8546('0x24')](function(_0x1f1b06){if(_0x1f1b06){_0x42e235=_0x1f1b06;_0x4a40c3[_0x8546('0x32')]=_[_0x8546('0x2f')](db[_0x8546('0x4f')][_0x8546('0x2b')]);_0x4a40c3['query']=_[_0x8546('0x2f')](_0x2f80f1[_0x8546('0x2e')]);_0x4a40c3[_0x8546('0x30')]=_['intersection'](_0x4a40c3[_0x8546('0x32')],_0x4a40c3[_0x8546('0x2e')]);_0x55607d[_0x8546('0x34')]=_['intersection'](_0x4a40c3[_0x8546('0x32')],qs['fields'](_0x2f80f1[_0x8546('0x2e')]['fields']));_0x55607d[_0x8546('0x34')]=_0x55607d['attributes'][_0x8546('0x35')]?_0x55607d[_0x8546('0x34')]:_0x4a40c3[_0x8546('0x32')];_0x55607d[_0x8546('0x4c')]=qs[_0x8546('0x38')](_0x2f80f1[_0x8546('0x2e')][_0x8546('0x38')]);_0x55607d[_0x8546('0x39')]=qs['filters'](_[_0x8546('0x4d')](_0x2f80f1[_0x8546('0x2e')],_0x4a40c3['filters']));if(_0x2f80f1['query'][_0x8546('0x3a')]){_0x55607d[_0x8546('0x39')]=_[_0x8546('0x3c')](_0x55607d[_0x8546('0x39')],{'$or':_[_0x8546('0x2a')](_0x55607d[_0x8546('0x34')],function(_0x24bd3c){var _0x6088a9={};_0x6088a9[_0x24bd3c]={'$like':'%'+_0x2f80f1[_0x8546('0x2e')]['filter']+'%'};return _0x6088a9;})});}_0x55607d=_[_0x8546('0x3c')]({},_0x55607d,_0x2f80f1[_0x8546('0x3d')]);return _0x42e235['getDescriptions'](_0x55607d);}})[_0x8546('0x24')](function(_0x5d3d0f){if(_0x5d3d0f){_0x316c99=_0x5d3d0f[_0x8546('0x35')];if(!_0x2f80f1['query']['hasOwnProperty'](_0x8546('0x37'))){_0x55607d[_0x8546('0x1d')]=qs[_0x8546('0x1d')](_0x2f80f1[_0x8546('0x2e')][_0x8546('0x1d')]);_0x55607d[_0x8546('0x1c')]=qs[_0x8546('0x1c')](_0x2f80f1[_0x8546('0x2e')]['offset']);}return _0x42e235['getDescriptions'](_0x55607d);}})[_0x8546('0x24')](function(_0x416bc6){if(_0x416bc6){return _0x416bc6?{'count':_0x316c99,'rows':_0x416bc6}:null;}})[_0x8546('0x24')](respondWithResult(_0x22d1a1,null))['catch'](handleError(_0x22d1a1,null));}; \ No newline at end of file +var _0xb075=['update','then','error','stack','name','index','map','Dynamics365Configuration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb075,0x7a));var _0x5b07=function(_0x308a3b,_0x436f9a){_0x308a3b=_0x308a3b-0x0;var _0x1264c3=_0xb075[_0x308a3b];return _0x1264c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b07('0x0'));var zipdir=require(_0x5b07('0x1'));var jsonpatch=require(_0x5b07('0x2'));var rp=require(_0x5b07('0x3'));var moment=require('moment');var BPromise=require(_0x5b07('0x4'));var Mustache=require(_0x5b07('0x5'));var util=require('util');var path=require(_0x5b07('0x6'));var sox=require('sox');var csv=require(_0x5b07('0x7'));var ejs=require(_0x5b07('0x8'));var fs=require('fs');var fs_extra=require(_0x5b07('0x9'));var _=require(_0x5b07('0xa'));var squel=require('squel');var crypto=require(_0x5b07('0xb'));var jsforce=require(_0x5b07('0xc'));var deskjs=require(_0x5b07('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5b07('0xe'));var Redis=require(_0x5b07('0xf'));var authService=require(_0x5b07('0x10'));var qs=require(_0x5b07('0x11'));var as=require(_0x5b07('0x12'));var hardwareService=require(_0x5b07('0x13'));var logger=require(_0x5b07('0x14'))(_0x5b07('0x15'));var utils=require(_0x5b07('0x16'));var config=require(_0x5b07('0x17'));var licenseUtil=require(_0x5b07('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d41d0,_0x17ad95){_0x17ad95=_0x17ad95||0xcc;return function(_0xaa22f7){if(_0xaa22f7){return _0x1d41d0[_0x5b07('0x19')](_0x17ad95);}return _0x1d41d0[_0x5b07('0x1a')](_0x17ad95)[_0x5b07('0x1b')]();};}function respondWithResult(_0x400c25,_0x276510){_0x276510=_0x276510||0xc8;return function(_0x11e212){if(_0x11e212){return _0x400c25[_0x5b07('0x1a')](_0x276510)['json'](_0x11e212);}};}function respondWithFilteredResult(_0x2e345c,_0x48bc0f){return function(_0x23df48){if(_0x23df48){var _0x2b30cb=typeof _0x48bc0f[_0x5b07('0x1c')]===_0x5b07('0x1d')&&typeof _0x48bc0f[_0x5b07('0x1e')]===_0x5b07('0x1d');var _0xb55dbb=_0x23df48[_0x5b07('0x1f')];var _0x32beb8=_0x2b30cb?0x0:_0x48bc0f[_0x5b07('0x1c')];var _0x125277=_0x2b30cb?_0x23df48['count']:_0x48bc0f[_0x5b07('0x1c')]+_0x48bc0f['limit'];var _0x530fca;if(_0x125277>=_0xb55dbb){_0x125277=_0xb55dbb;_0x530fca=0xc8;}else{_0x530fca=0xce;}_0x2e345c['status'](_0x530fca);return _0x2e345c['set'](_0x5b07('0x20'),_0x32beb8+'-'+_0x125277+'/'+_0xb55dbb)[_0x5b07('0x21')](_0x23df48);}return null;};}function patchUpdates(_0x38f449){return function(_0x218f46){try{jsonpatch[_0x5b07('0x22')](_0x218f46,_0x38f449,!![]);}catch(_0x1945b0){return BPromise['reject'](_0x1945b0);}return _0x218f46[_0x5b07('0x23')]();};}function saveUpdates(_0x3aa48a,_0x1e5648){return function(_0x1090f6){if(_0x1090f6){return _0x1090f6[_0x5b07('0x24')](_0x3aa48a)[_0x5b07('0x25')](function(_0x3a8c99){return _0x3a8c99;});}return null;};}function removeEntity(_0x5c05a0,_0x3a1625){return function(_0x113a11){if(_0x113a11){return _0x113a11['destroy']()[_0x5b07('0x25')](function(){_0x5c05a0[_0x5b07('0x1a')](0xcc)[_0x5b07('0x1b')]();});}};}function handleEntityNotFound(_0x4eccf9,_0x6e5122){return function(_0x4fd67f){if(!_0x4fd67f){_0x4eccf9['sendStatus'](0x194);}return _0x4fd67f;};}function handleError(_0xc14be2,_0x34bfb5){_0x34bfb5=_0x34bfb5||0x1f4;return function(_0x554504){logger[_0x5b07('0x26')](_0x554504[_0x5b07('0x27')]);if(_0x554504[_0x5b07('0x28')]){delete _0x554504[_0x5b07('0x28')];}_0xc14be2[_0x5b07('0x1a')](_0x34bfb5)['send'](_0x554504);};}exports[_0x5b07('0x29')]=function(_0xea6071,_0x8ef4ed){var _0x5addab={},_0x110645={},_0x20b789={'count':0x0,'rows':[]};var _0x4ebbb1=_[_0x5b07('0x2a')](db[_0x5b07('0x2b')][_0x5b07('0x2c')],function(_0x9ac178){return{'name':_0x9ac178['fieldName'],'type':_0x9ac178[_0x5b07('0x2d')][_0x5b07('0x2e')]};});_0x110645[_0x5b07('0x2f')]=_[_0x5b07('0x2a')](_0x4ebbb1,_0x5b07('0x28'));_0x110645[_0x5b07('0x30')]=_['keys'](_0xea6071[_0x5b07('0x30')]);_0x110645[_0x5b07('0x31')]=_[_0x5b07('0x32')](_0x110645[_0x5b07('0x2f')],_0x110645[_0x5b07('0x30')]);_0x5addab[_0x5b07('0x33')]=_[_0x5b07('0x32')](_0x110645[_0x5b07('0x2f')],qs[_0x5b07('0x34')](_0xea6071[_0x5b07('0x30')][_0x5b07('0x34')]));_0x5addab['attributes']=_0x5addab['attributes'][_0x5b07('0x35')]?_0x5addab[_0x5b07('0x33')]:_0x110645[_0x5b07('0x2f')];if(!_0xea6071[_0x5b07('0x30')][_0x5b07('0x36')](_0x5b07('0x37'))){_0x5addab[_0x5b07('0x1e')]=qs[_0x5b07('0x1e')](_0xea6071[_0x5b07('0x30')][_0x5b07('0x1e')]);_0x5addab['offset']=qs[_0x5b07('0x1c')](_0xea6071[_0x5b07('0x30')][_0x5b07('0x1c')]);}_0x5addab[_0x5b07('0x38')]=qs[_0x5b07('0x39')](_0xea6071['query']['sort']);_0x5addab[_0x5b07('0x3a')]=qs[_0x5b07('0x31')](_[_0x5b07('0x3b')](_0xea6071[_0x5b07('0x30')],_0x110645[_0x5b07('0x31')]),_0x4ebbb1);if(_0xea6071[_0x5b07('0x30')]['filter']){_0x5addab[_0x5b07('0x3a')]=_[_0x5b07('0x3c')](_0x5addab[_0x5b07('0x3a')],{'$or':_['map'](_0x4ebbb1,function(_0x29f0f4){if(_0x29f0f4[_0x5b07('0x2d')]!==_0x5b07('0x3d')){var _0x268d6e={};_0x268d6e[_0x29f0f4[_0x5b07('0x28')]]={'$like':'%'+_0xea6071[_0x5b07('0x30')][_0x5b07('0x3e')]+'%'};return _0x268d6e;}})});}_0x5addab=_[_0x5b07('0x3c')]({},_0x5addab,_0xea6071[_0x5b07('0x3f')]);var _0x8ed836={'where':_0x5addab['where']};return db[_0x5b07('0x2b')]['count'](_0x8ed836)[_0x5b07('0x25')](function(_0x516982){_0x20b789[_0x5b07('0x1f')]=_0x516982;if(_0xea6071[_0x5b07('0x30')][_0x5b07('0x40')]){_0x5addab[_0x5b07('0x41')]=[{'all':!![]}];}return db[_0x5b07('0x2b')][_0x5b07('0x42')](_0x5addab);})['then'](function(_0x132d7f){_0x20b789['rows']=_0x132d7f;return _0x20b789;})[_0x5b07('0x25')](respondWithFilteredResult(_0x8ef4ed,_0x5addab))['catch'](handleError(_0x8ef4ed,null));};exports[_0x5b07('0x43')]=function(_0x25c682,_0x3d59eb){var _0x5e299f={'raw':![],'where':{'id':_0x25c682[_0x5b07('0x44')]['id']}},_0x1c7473={};_0x1c7473[_0x5b07('0x2f')]=_[_0x5b07('0x45')](db[_0x5b07('0x2b')][_0x5b07('0x2c')]);_0x1c7473[_0x5b07('0x30')]=_[_0x5b07('0x45')](_0x25c682[_0x5b07('0x30')]);_0x1c7473[_0x5b07('0x31')]=_[_0x5b07('0x32')](_0x1c7473[_0x5b07('0x2f')],_0x1c7473[_0x5b07('0x30')]);_0x5e299f['attributes']=_['intersection'](_0x1c7473['model'],qs[_0x5b07('0x34')](_0x25c682[_0x5b07('0x30')][_0x5b07('0x34')]));_0x5e299f[_0x5b07('0x33')]=_0x5e299f[_0x5b07('0x33')][_0x5b07('0x35')]?_0x5e299f[_0x5b07('0x33')]:_0x1c7473[_0x5b07('0x2f')];if(_0x25c682[_0x5b07('0x30')][_0x5b07('0x40')]){_0x5e299f['include']=[{'all':!![]}];}_0x5e299f=_[_0x5b07('0x3c')]({},_0x5e299f,_0x25c682[_0x5b07('0x3f')]);return db[_0x5b07('0x2b')][_0x5b07('0x46')](_0x5e299f)['then'](handleEntityNotFound(_0x3d59eb,null))[_0x5b07('0x25')](respondWithResult(_0x3d59eb,null))[_0x5b07('0x47')](handleError(_0x3d59eb,null));};exports[_0x5b07('0x48')]=function(_0x28974a,_0x464c30){return db['Dynamics365Configuration'][_0x5b07('0x48')](_0x28974a[_0x5b07('0x49')],{})[_0x5b07('0x25')](respondWithResult(_0x464c30,0xc9))['catch'](handleError(_0x464c30,null));};exports['update']=function(_0x56eda2,_0x36dc50){if(_0x56eda2[_0x5b07('0x49')]['id']){delete _0x56eda2[_0x5b07('0x49')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x56eda2[_0x5b07('0x44')]['id']}})[_0x5b07('0x25')](handleEntityNotFound(_0x36dc50,null))[_0x5b07('0x25')](saveUpdates(_0x56eda2['body'],null))[_0x5b07('0x25')](respondWithResult(_0x36dc50,null))[_0x5b07('0x47')](handleError(_0x36dc50,null));};exports['destroy']=function(_0x513881,_0x1614f4){return db['Dynamics365Configuration'][_0x5b07('0x46')]({'where':{'id':_0x513881[_0x5b07('0x44')]['id']}})[_0x5b07('0x25')](handleEntityNotFound(_0x1614f4,null))['then'](removeEntity(_0x1614f4,null))['catch'](handleError(_0x1614f4,null));};exports['getFields']=function(_0x5704b6,_0x3dc416,_0x2ea3a3){var _0xa1aad5={};var _0xa303b5={};var _0x19e1b9;var _0xc66638;return db[_0x5b07('0x2b')][_0x5b07('0x4a')]({'where':{'id':_0x5704b6[_0x5b07('0x44')]['id']}})['then'](handleEntityNotFound(_0x3dc416,null))['then'](function(_0x1b3d75){if(_0x1b3d75){_0x19e1b9=_0x1b3d75;_0xa303b5[_0x5b07('0x2f')]=_[_0x5b07('0x45')](db[_0x5b07('0x4b')][_0x5b07('0x2c')]);_0xa303b5[_0x5b07('0x30')]=_[_0x5b07('0x45')](_0x5704b6[_0x5b07('0x30')]);_0xa303b5[_0x5b07('0x31')]=_['intersection'](_0xa303b5['model'],_0xa303b5['query']);_0xa1aad5[_0x5b07('0x33')]=_[_0x5b07('0x32')](_0xa303b5[_0x5b07('0x2f')],qs[_0x5b07('0x34')](_0x5704b6[_0x5b07('0x30')]['fields']));_0xa1aad5[_0x5b07('0x33')]=_0xa1aad5[_0x5b07('0x33')][_0x5b07('0x35')]?_0xa1aad5['attributes']:_0xa303b5[_0x5b07('0x2f')];_0xa1aad5[_0x5b07('0x38')]=qs['sort'](_0x5704b6[_0x5b07('0x30')][_0x5b07('0x39')]);_0xa1aad5[_0x5b07('0x3a')]=qs[_0x5b07('0x31')](_[_0x5b07('0x3b')](_0x5704b6['query'],_0xa303b5[_0x5b07('0x31')]));if(_0x5704b6[_0x5b07('0x30')][_0x5b07('0x3e')]){_0xa1aad5[_0x5b07('0x3a')]=_[_0x5b07('0x3c')](_0xa1aad5[_0x5b07('0x3a')],{'$or':_[_0x5b07('0x2a')](_0xa1aad5['attributes'],function(_0x23d94f){var _0x5eecfb={};_0x5eecfb[_0x23d94f]={'$like':'%'+_0x5704b6[_0x5b07('0x30')][_0x5b07('0x3e')]+'%'};return _0x5eecfb;})});}_0xa1aad5=_[_0x5b07('0x3c')]({},_0xa1aad5,_0x5704b6[_0x5b07('0x3f')]);return _0x19e1b9['getFields'](_0xa1aad5);}})[_0x5b07('0x25')](function(_0x28e842){if(_0x28e842){_0xc66638=_0x28e842[_0x5b07('0x35')];if(!_0x5704b6['query']['hasOwnProperty'](_0x5b07('0x37'))){_0xa1aad5[_0x5b07('0x1e')]=qs[_0x5b07('0x1e')](_0x5704b6['query']['limit']);_0xa1aad5[_0x5b07('0x1c')]=qs['offset'](_0x5704b6[_0x5b07('0x30')][_0x5b07('0x1c')]);}return _0x19e1b9[_0x5b07('0x4c')](_0xa1aad5);}})[_0x5b07('0x25')](function(_0x4db64c){if(_0x4db64c){return _0x4db64c?{'count':_0xc66638,'rows':_0x4db64c}:null;}})[_0x5b07('0x25')](respondWithResult(_0x3dc416,null))[_0x5b07('0x47')](handleError(_0x3dc416,null));};exports[_0x5b07('0x4d')]=function(_0x4aba66,_0x5cda3d,_0x427719){var _0x421989={};var _0x4e86ce={};var _0x3b97e0;var _0x2ea55d;return db['Dynamics365Configuration'][_0x5b07('0x4a')]({'where':{'id':_0x4aba66['params']['id']}})[_0x5b07('0x25')](handleEntityNotFound(_0x5cda3d,null))[_0x5b07('0x25')](function(_0x4337a3){if(_0x4337a3){_0x3b97e0=_0x4337a3;_0x4e86ce[_0x5b07('0x2f')]=_[_0x5b07('0x45')](db[_0x5b07('0x4b')][_0x5b07('0x2c')]);_0x4e86ce[_0x5b07('0x30')]=_[_0x5b07('0x45')](_0x4aba66['query']);_0x4e86ce[_0x5b07('0x31')]=_[_0x5b07('0x32')](_0x4e86ce[_0x5b07('0x2f')],_0x4e86ce['query']);_0x421989[_0x5b07('0x33')]=_['intersection'](_0x4e86ce[_0x5b07('0x2f')],qs[_0x5b07('0x34')](_0x4aba66[_0x5b07('0x30')][_0x5b07('0x34')]));_0x421989[_0x5b07('0x33')]=_0x421989['attributes'][_0x5b07('0x35')]?_0x421989[_0x5b07('0x33')]:_0x4e86ce[_0x5b07('0x2f')];_0x421989[_0x5b07('0x38')]=qs['sort'](_0x4aba66['query']['sort']);_0x421989[_0x5b07('0x3a')]=qs[_0x5b07('0x31')](_[_0x5b07('0x3b')](_0x4aba66[_0x5b07('0x30')],_0x4e86ce['filters']));if(_0x4aba66[_0x5b07('0x30')]['filter']){_0x421989[_0x5b07('0x3a')]=_[_0x5b07('0x3c')](_0x421989[_0x5b07('0x3a')],{'$or':_[_0x5b07('0x2a')](_0x421989['attributes'],function(_0x21a2f9){var _0x32e701={};_0x32e701[_0x21a2f9]={'$like':'%'+_0x4aba66['query'][_0x5b07('0x3e')]+'%'};return _0x32e701;})});}_0x421989=_['merge']({},_0x421989,_0x4aba66[_0x5b07('0x3f')]);return _0x3b97e0[_0x5b07('0x4d')](_0x421989);}})['then'](function(_0x2e23b9){if(_0x2e23b9){_0x2ea55d=_0x2e23b9[_0x5b07('0x35')];if(!_0x4aba66['query'][_0x5b07('0x36')]('nolimit')){_0x421989[_0x5b07('0x1e')]=qs[_0x5b07('0x1e')](_0x4aba66[_0x5b07('0x30')][_0x5b07('0x1e')]);_0x421989[_0x5b07('0x1c')]=qs[_0x5b07('0x1c')](_0x4aba66[_0x5b07('0x30')]['offset']);}return _0x3b97e0[_0x5b07('0x4d')](_0x421989);}})[_0x5b07('0x25')](function(_0x1e9228){if(_0x1e9228){return _0x1e9228?{'count':_0x2ea55d,'rows':_0x1e9228}:null;}})[_0x5b07('0x25')](respondWithResult(_0x5cda3d,null))['catch'](handleError(_0x5cda3d,null));};exports['getDescriptions']=function(_0x124501,_0x4caaad,_0x49b6f5){var _0x365666={};var _0x3058ee={};var _0x25210a;var _0x29e159;return db[_0x5b07('0x2b')]['findOne']({'where':{'id':_0x124501['params']['id']}})[_0x5b07('0x25')](handleEntityNotFound(_0x4caaad,null))['then'](function(_0x10040e){if(_0x10040e){_0x25210a=_0x10040e;_0x3058ee[_0x5b07('0x2f')]=_[_0x5b07('0x45')](db['Dynamics365Field']['rawAttributes']);_0x3058ee['query']=_['keys'](_0x124501[_0x5b07('0x30')]);_0x3058ee['filters']=_[_0x5b07('0x32')](_0x3058ee[_0x5b07('0x2f')],_0x3058ee[_0x5b07('0x30')]);_0x365666[_0x5b07('0x33')]=_[_0x5b07('0x32')](_0x3058ee[_0x5b07('0x2f')],qs[_0x5b07('0x34')](_0x124501['query'][_0x5b07('0x34')]));_0x365666[_0x5b07('0x33')]=_0x365666[_0x5b07('0x33')][_0x5b07('0x35')]?_0x365666['attributes']:_0x3058ee[_0x5b07('0x2f')];_0x365666[_0x5b07('0x38')]=qs[_0x5b07('0x39')](_0x124501[_0x5b07('0x30')][_0x5b07('0x39')]);_0x365666['where']=qs['filters'](_[_0x5b07('0x3b')](_0x124501['query'],_0x3058ee['filters']));if(_0x124501[_0x5b07('0x30')][_0x5b07('0x3e')]){_0x365666['where']=_[_0x5b07('0x3c')](_0x365666[_0x5b07('0x3a')],{'$or':_['map'](_0x365666[_0x5b07('0x33')],function(_0x21e105){var _0x13f8ec={};_0x13f8ec[_0x21e105]={'$like':'%'+_0x124501['query'][_0x5b07('0x3e')]+'%'};return _0x13f8ec;})});}_0x365666=_[_0x5b07('0x3c')]({},_0x365666,_0x124501[_0x5b07('0x3f')]);return _0x25210a[_0x5b07('0x4e')](_0x365666);}})[_0x5b07('0x25')](function(_0x2071e1){if(_0x2071e1){_0x29e159=_0x2071e1['length'];if(!_0x124501[_0x5b07('0x30')][_0x5b07('0x36')](_0x5b07('0x37'))){_0x365666[_0x5b07('0x1e')]=qs[_0x5b07('0x1e')](_0x124501['query'][_0x5b07('0x1e')]);_0x365666[_0x5b07('0x1c')]=qs[_0x5b07('0x1c')](_0x124501[_0x5b07('0x30')][_0x5b07('0x1c')]);}return _0x25210a[_0x5b07('0x4e')](_0x365666);}})['then'](function(_0x3c1666){if(_0x3c1666){return _0x3c1666?{'count':_0x29e159,'rows':_0x3c1666}:null;}})['then'](respondWithResult(_0x4caaad,null))[_0x5b07('0x47')](handleError(_0x4caaad,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index e4dac18..ff0881b 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x55e4dd,_0x349afe){var _0x12709d=function(_0x5a9428){while(--_0x5a9428){_0x55e4dd['push'](_0x55e4dd['shift']());}};_0x12709d(++_0x349afe);}(_0xedd9,0xfc));var _0x9edd=function(_0x176d4a,_0x3f14e0){_0x176d4a=_0x176d4a-0x0;var _0x44b481=_0xedd9[_0x176d4a];return _0x44b481;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x3c30fb,_0xbb4669){var _0x24df0c=function(_0x582b1b){while(--_0x582b1b){_0x3c30fb['push'](_0x3c30fb['shift']());}};_0x24df0c(++_0xbb4669);}(_0x00bb,0x1d8));var _0xb00b=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x00bb[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index bde1845..7f39675 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 _0x7bf3=['request','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0x7bf3,0x172));var _0x37bf=function(_0x32f25b,_0x49494a){_0x32f25b=_0x32f25b-0x0;var _0x4549b8=_0x7bf3[_0x32f25b];return _0x4549b8;};'use strict';var _=require(_0x37bf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x37bf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37bf('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x37bf('0x3'));var logger=require(_0x37bf('0x4'))(_0x37bf('0x5'));var config=require(_0x37bf('0x6'));var jayson=require(_0x37bf('0x7'));var client=jayson[_0x37bf('0x8')][_0x37bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x437b24,_0x5d0c82,_0x291189){return new BPromise(function(_0x33401a,_0x29273b){return client[_0x37bf('0xa')](_0x437b24,_0x291189)['then'](function(_0xb8f22e){logger['info'](_0x37bf('0xb'),_0x5d0c82,'request\x20sent');logger[_0x37bf('0xc')](_0x37bf('0xd'),_0x5d0c82,'request\x20sent',JSON['stringify'](_0xb8f22e));if(_0xb8f22e[_0x37bf('0xe')]){if(_0xb8f22e[_0x37bf('0xe')][_0x37bf('0xf')]===0x1f4){logger['error'](_0x37bf('0xb'),_0x5d0c82,_0xb8f22e[_0x37bf('0xe')][_0x37bf('0x10')]);return _0x29273b(_0xb8f22e[_0x37bf('0xe')][_0x37bf('0x10')]);}logger[_0x37bf('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5d0c82,_0xb8f22e[_0x37bf('0xe')][_0x37bf('0x10')]);return _0x33401a(_0xb8f22e[_0x37bf('0xe')][_0x37bf('0x10')]);}else{logger['info'](_0x37bf('0xb'),_0x5d0c82,_0x37bf('0x11'));_0x33401a(_0xb8f22e['result'][_0x37bf('0x10')]);}})[_0x37bf('0x12')](function(_0x51c6d5){logger[_0x37bf('0xe')](_0x37bf('0xb'),_0x5d0c82,_0x51c6d5);_0x29273b(_0x51c6d5);});});} \ No newline at end of file +var _0x71a8=['info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x21fa8b,_0x1bd525){var _0x1e2f90=function(_0x5b70c9){while(--_0x5b70c9){_0x21fa8b['push'](_0x21fa8b['shift']());}};_0x1e2f90(++_0x1bd525);}(_0x71a8,0x12a));var _0x871a=function(_0x3e4b33,_0x3eebc){_0x3e4b33=_0x3e4b33-0x0;var _0xd7abc9=_0x71a8[_0x3e4b33];return _0xd7abc9;};'use strict';var _=require(_0x871a('0x0'));var util=require(_0x871a('0x1'));var moment=require(_0x871a('0x2'));var BPromise=require(_0x871a('0x3'));var rs=require(_0x871a('0x4'));var fs=require('fs');var Redis=require(_0x871a('0x5'));var db=require(_0x871a('0x6'))['db'];var utils=require(_0x871a('0x7'));var logger=require(_0x871a('0x8'))(_0x871a('0x9'));var config=require(_0x871a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x871a('0xb')][_0x871a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35f89e,_0x4ddcd0,_0x5da471){return new BPromise(function(_0x3b1d49,_0x176f16){return client['request'](_0x35f89e,_0x5da471)[_0x871a('0xd')](function(_0x4d1fb9){logger[_0x871a('0xe')](_0x871a('0xf'),_0x4ddcd0,_0x871a('0x10'));logger[_0x871a('0x11')](_0x871a('0x12'),_0x4ddcd0,_0x871a('0x10'),JSON[_0x871a('0x13')](_0x4d1fb9));if(_0x4d1fb9[_0x871a('0x14')]){if(_0x4d1fb9[_0x871a('0x14')][_0x871a('0x15')]===0x1f4){logger[_0x871a('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4ddcd0,_0x4d1fb9[_0x871a('0x14')]['message']);return _0x176f16(_0x4d1fb9[_0x871a('0x14')][_0x871a('0x16')]);}logger[_0x871a('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4ddcd0,_0x4d1fb9[_0x871a('0x14')][_0x871a('0x16')]);return _0x3b1d49(_0x4d1fb9['error'][_0x871a('0x16')]);}else{logger['info'](_0x871a('0xf'),_0x4ddcd0,_0x871a('0x10'));_0x3b1d49(_0x4d1fb9[_0x871a('0x17')][_0x871a('0x16')]);}})['catch'](function(_0x5c1fd2){logger[_0x871a('0x14')](_0x871a('0xf'),_0x4ddcd0,_0x5c1fd2);_0x176f16(_0x5c1fd2);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 49fb458..3dac20f 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 _0x900f=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put','update','exports','util','path','connect-timeout','Router'];(function(_0x454233,_0x4f592c){var _0x16dfbc=function(_0x4eeb40){while(--_0x4eeb40){_0x454233['push'](_0x454233['shift']());}};_0x16dfbc(++_0x4f592c);}(_0x900f,0x1be));var _0xf900=function(_0x5e895f,_0x3167d7){_0x5e895f=_0x5e895f-0x0;var _0x1a6d33=_0x900f[_0x5e895f];return _0x1a6d33;};'use strict';var multer=require('multer');var util=require(_0xf900('0x0'));var path=require(_0xf900('0x1'));var timeout=require(_0xf900('0x2'));var express=require('express');var router=express[_0xf900('0x3')]();var fs_extra=require(_0xf900('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf900('0x5'));var config=require(_0xf900('0x6'));var controller=require('./intDynamics365Field.controller');router[_0xf900('0x7')]('/',auth[_0xf900('0x8')](),controller['index']);router[_0xf900('0x7')](_0xf900('0x9'),auth[_0xf900('0x8')](),controller[_0xf900('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf900('0xb')]);router[_0xf900('0xc')](_0xf900('0x9'),auth[_0xf900('0x8')](),controller[_0xf900('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf900('0xe')]=router; \ No newline at end of file +var _0x1c47=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x4c22f4,_0x2e8e99){var _0x46fb86=function(_0x164429){while(--_0x164429){_0x4c22f4['push'](_0x4c22f4['shift']());}};_0x46fb86(++_0x2e8e99);}(_0x1c47,0x1a7));var _0x71c4=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x1c47[_0x2aa0e7];return _0x1472c0;};'use strict';var multer=require(_0x71c4('0x0'));var util=require(_0x71c4('0x1'));var path=require(_0x71c4('0x2'));var timeout=require(_0x71c4('0x3'));var express=require(_0x71c4('0x4'));var router=express[_0x71c4('0x5')]();var fs_extra=require(_0x71c4('0x6'));var auth=require(_0x71c4('0x7'));var interaction=require(_0x71c4('0x8'));var config=require(_0x71c4('0x9'));var controller=require(_0x71c4('0xa'));router[_0x71c4('0xb')]('/',auth[_0x71c4('0xc')](),controller[_0x71c4('0xd')]);router['get'](_0x71c4('0xe'),auth[_0x71c4('0xc')](),controller[_0x71c4('0xf')]);router[_0x71c4('0x10')]('/',auth['isAuthenticated'](),controller[_0x71c4('0x11')]);router[_0x71c4('0x12')]('/:id',auth[_0x71c4('0xc')](),controller['update']);router[_0x71c4('0x13')](_0x71c4('0xe'),auth[_0x71c4('0xc')](),controller[_0x71c4('0x14')]);module[_0x71c4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 2da838f..bd0ba9a 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 _0x8f8a=['STRING','ENUM','BOOLEAN','sequelize','exports','string','customVariable','picklist'];(function(_0x5e98c,_0x34edbe){var _0x42d75f=function(_0x85ce9b){while(--_0x85ce9b){_0x5e98c['push'](_0x5e98c['shift']());}};_0x42d75f(++_0x34edbe);}(_0x8f8a,0x163));var _0xa8f8=function(_0x1a6830,_0x44b168){_0x1a6830=_0x1a6830-0x0;var _0x3c96ba=_0x8f8a[_0x1a6830];return _0x3c96ba;};'use strict';var Sequelize=require(_0xa8f8('0x0'));module[_0xa8f8('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa8f8('0x2'),'variable',_0xa8f8('0x3'),'keyValue',_0xa8f8('0x4')),'defaultValue':_0xa8f8('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa8f8('0x5')]},'keyType':{'type':Sequelize[_0xa8f8('0x6')]('string','variable',_0xa8f8('0x3'))},'keyContent':{'type':Sequelize[_0xa8f8('0x5')]},'idField':{'type':Sequelize[_0xa8f8('0x5')]},'nameField':{'type':Sequelize[_0xa8f8('0x5')]},'customField':{'type':Sequelize[_0xa8f8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa8f8('0x5')]}}; \ No newline at end of file +var _0xf6a6=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable','sequelize'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0xf6a6,0x116));var _0x6f6a=function(_0x95c7e1,_0x515b5a){_0x95c7e1=_0x95c7e1-0x0;var _0x280472=_0xf6a6[_0x95c7e1];return _0x280472;};'use strict';var Sequelize=require(_0x6f6a('0x0'));module[_0x6f6a('0x1')]={'type':{'type':Sequelize[_0x6f6a('0x2')](_0x6f6a('0x3'),'variable',_0x6f6a('0x4'),_0x6f6a('0x5'),_0x6f6a('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6f6a('0x7')]},'key':{'type':Sequelize[_0x6f6a('0x7')]},'keyType':{'type':Sequelize[_0x6f6a('0x2')](_0x6f6a('0x3'),_0x6f6a('0x8'),_0x6f6a('0x4'))},'keyContent':{'type':Sequelize[_0x6f6a('0x7')]},'idField':{'type':Sequelize[_0x6f6a('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6f6a('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 04b2bad..342ab48 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 _0xb869=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','Dynamics365Field','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','fields','find','catch','create','body','params'];(function(_0x1e73cf,_0x50f647){var _0x22494b=function(_0x3c14c8){while(--_0x3c14c8){_0x1e73cf['push'](_0x1e73cf['shift']());}};_0x22494b(++_0x50f647);}(_0xb869,0xde));var _0x9b86=function(_0x2f571f,_0x469ab6){_0x2f571f=_0x2f571f-0x0;var _0x807af7=_0xb869[_0x2f571f];return _0x807af7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9b86('0x0'));var jsonpatch=require(_0x9b86('0x1'));var rp=require(_0x9b86('0x2'));var moment=require('moment');var BPromise=require(_0x9b86('0x3'));var Mustache=require(_0x9b86('0x4'));var util=require(_0x9b86('0x5'));var path=require(_0x9b86('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9b86('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b86('0x8'));var squel=require(_0x9b86('0x9'));var crypto=require(_0x9b86('0xa'));var jsforce=require(_0x9b86('0xb'));var deskjs=require(_0x9b86('0xc'));var toCsv=require(_0x9b86('0xd'));var querystring=require(_0x9b86('0xe'));var Papa=require(_0x9b86('0xf'));var Redis=require('ioredis');var authService=require(_0x9b86('0x10'));var qs=require(_0x9b86('0x11'));var as=require(_0x9b86('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9b86('0x13'));var utils=require('../../config/utils');var config=require(_0x9b86('0x14'));var licenseUtil=require(_0x9b86('0x15'));var db=require(_0x9b86('0x16'))['db'];function respondWithStatusCode(_0x1b0b5c,_0x5c0114){_0x5c0114=_0x5c0114||0xcc;return function(_0x2f3742){if(_0x2f3742){return _0x1b0b5c[_0x9b86('0x17')](_0x5c0114);}return _0x1b0b5c['status'](_0x5c0114)[_0x9b86('0x18')]();};}function respondWithResult(_0x28d3fa,_0x58a566){_0x58a566=_0x58a566||0xc8;return function(_0x209996){if(_0x209996){return _0x28d3fa['status'](_0x58a566)[_0x9b86('0x19')](_0x209996);}};}function respondWithFilteredResult(_0x58eca1,_0x5722cd){return function(_0x1271e6){if(_0x1271e6){var _0x141be4=typeof _0x5722cd[_0x9b86('0x1a')]===_0x9b86('0x1b')&&typeof _0x5722cd[_0x9b86('0x1c')]==='undefined';var _0x59c783=_0x1271e6[_0x9b86('0x1d')];var _0x1dd0f8=_0x141be4?0x0:_0x5722cd['offset'];var _0x254c27=_0x141be4?_0x1271e6[_0x9b86('0x1d')]:_0x5722cd[_0x9b86('0x1a')]+_0x5722cd[_0x9b86('0x1c')];var _0x5e5393;if(_0x254c27>=_0x59c783){_0x254c27=_0x59c783;_0x5e5393=0xc8;}else{_0x5e5393=0xce;}_0x58eca1[_0x9b86('0x1e')](_0x5e5393);return _0x58eca1[_0x9b86('0x1f')](_0x9b86('0x20'),_0x1dd0f8+'-'+_0x254c27+'/'+_0x59c783)['json'](_0x1271e6);}return null;};}function patchUpdates(_0x56f738){return function(_0x47b82c){try{jsonpatch[_0x9b86('0x21')](_0x47b82c,_0x56f738,!![]);}catch(_0x2c18cd){return BPromise[_0x9b86('0x22')](_0x2c18cd);}return _0x47b82c[_0x9b86('0x23')]();};}function saveUpdates(_0x13d046,_0x4ed7bb){return function(_0x652a7b){if(_0x652a7b){return _0x652a7b[_0x9b86('0x24')](_0x13d046)[_0x9b86('0x25')](function(_0x4e9944){return _0x4e9944;});}return null;};}function removeEntity(_0x36e1a4,_0x2cc7ee){return function(_0xd9970a){if(_0xd9970a){return _0xd9970a[_0x9b86('0x26')]()[_0x9b86('0x25')](function(){_0x36e1a4[_0x9b86('0x1e')](0xcc)[_0x9b86('0x18')]();});}};}function handleEntityNotFound(_0xa6e561,_0x5b66ea){return function(_0x148fe5){if(!_0x148fe5){_0xa6e561[_0x9b86('0x17')](0x194);}return _0x148fe5;};}function handleError(_0x59da99,_0x5dad15){_0x5dad15=_0x5dad15||0x1f4;return function(_0x13916f){logger[_0x9b86('0x27')](_0x13916f[_0x9b86('0x28')]);if(_0x13916f[_0x9b86('0x29')]){delete _0x13916f[_0x9b86('0x29')];}_0x59da99['status'](_0x5dad15)['send'](_0x13916f);};}exports[_0x9b86('0x2a')]=function(_0x2f050b,_0x1d45e5){var _0xbbaa37={},_0x5921a3={},_0x1aa1fb={'count':0x0,'rows':[]};var _0x2f4a9f=_[_0x9b86('0x2b')](db[_0x9b86('0x2c')][_0x9b86('0x2d')],function(_0x143636){return{'name':_0x143636['fieldName'],'type':_0x143636[_0x9b86('0x2e')]['key']};});_0x5921a3[_0x9b86('0x2f')]=_[_0x9b86('0x2b')](_0x2f4a9f,'name');_0x5921a3[_0x9b86('0x30')]=_[_0x9b86('0x31')](_0x2f050b[_0x9b86('0x30')]);_0x5921a3[_0x9b86('0x32')]=_[_0x9b86('0x33')](_0x5921a3[_0x9b86('0x2f')],_0x5921a3[_0x9b86('0x30')]);_0xbbaa37[_0x9b86('0x34')]=_[_0x9b86('0x33')](_0x5921a3[_0x9b86('0x2f')],qs['fields'](_0x2f050b[_0x9b86('0x30')]['fields']));_0xbbaa37['attributes']=_0xbbaa37[_0x9b86('0x34')][_0x9b86('0x35')]?_0xbbaa37[_0x9b86('0x34')]:_0x5921a3[_0x9b86('0x2f')];if(!_0x2f050b[_0x9b86('0x30')][_0x9b86('0x36')](_0x9b86('0x37'))){_0xbbaa37[_0x9b86('0x1c')]=qs['limit'](_0x2f050b[_0x9b86('0x30')][_0x9b86('0x1c')]);_0xbbaa37[_0x9b86('0x1a')]=qs[_0x9b86('0x1a')](_0x2f050b[_0x9b86('0x30')][_0x9b86('0x1a')]);}_0xbbaa37[_0x9b86('0x38')]=qs[_0x9b86('0x39')](_0x2f050b[_0x9b86('0x30')]['sort']);_0xbbaa37['where']=qs[_0x9b86('0x32')](_['pick'](_0x2f050b[_0x9b86('0x30')],_0x5921a3[_0x9b86('0x32')]),_0x2f4a9f);if(_0x2f050b[_0x9b86('0x30')][_0x9b86('0x3a')]){_0xbbaa37[_0x9b86('0x3b')]=_[_0x9b86('0x3c')](_0xbbaa37[_0x9b86('0x3b')],{'$or':_['map'](_0x2f4a9f,function(_0x15b79a){if(_0x15b79a[_0x9b86('0x2e')]!==_0x9b86('0x3d')){var _0x4e93be={};_0x4e93be[_0x15b79a[_0x9b86('0x29')]]={'$like':'%'+_0x2f050b[_0x9b86('0x30')][_0x9b86('0x3a')]+'%'};return _0x4e93be;}})});}_0xbbaa37=_['merge']({},_0xbbaa37,_0x2f050b[_0x9b86('0x3e')]);var _0x2a330f={'where':_0xbbaa37[_0x9b86('0x3b')]};return db['Dynamics365Field'][_0x9b86('0x1d')](_0x2a330f)['then'](function(_0x2098a3){_0x1aa1fb[_0x9b86('0x1d')]=_0x2098a3;if(_0x2f050b[_0x9b86('0x30')][_0x9b86('0x3f')]){_0xbbaa37[_0x9b86('0x40')]=[{'all':!![]}];}return db[_0x9b86('0x2c')][_0x9b86('0x41')](_0xbbaa37);})[_0x9b86('0x25')](function(_0x3e3260){_0x1aa1fb[_0x9b86('0x42')]=_0x3e3260;return _0x1aa1fb;})[_0x9b86('0x25')](respondWithFilteredResult(_0x1d45e5,_0xbbaa37))['catch'](handleError(_0x1d45e5,null));};exports[_0x9b86('0x43')]=function(_0x108b48,_0x3e9f08){var _0x31d172={'raw':!![],'where':{'id':_0x108b48['params']['id']}},_0x3b2dba={};_0x3b2dba[_0x9b86('0x2f')]=_[_0x9b86('0x31')](db['Dynamics365Field'][_0x9b86('0x2d')]);_0x3b2dba[_0x9b86('0x30')]=_[_0x9b86('0x31')](_0x108b48['query']);_0x3b2dba['filters']=_[_0x9b86('0x33')](_0x3b2dba['model'],_0x3b2dba[_0x9b86('0x30')]);_0x31d172[_0x9b86('0x34')]=_['intersection'](_0x3b2dba[_0x9b86('0x2f')],qs[_0x9b86('0x44')](_0x108b48['query'][_0x9b86('0x44')]));_0x31d172['attributes']=_0x31d172[_0x9b86('0x34')][_0x9b86('0x35')]?_0x31d172['attributes']:_0x3b2dba['model'];if(_0x108b48[_0x9b86('0x30')][_0x9b86('0x3f')]){_0x31d172['include']=[{'all':!![]}];}_0x31d172=_[_0x9b86('0x3c')]({},_0x31d172,_0x108b48[_0x9b86('0x3e')]);return db['Dynamics365Field'][_0x9b86('0x45')](_0x31d172)[_0x9b86('0x25')](handleEntityNotFound(_0x3e9f08,null))['then'](respondWithResult(_0x3e9f08,null))[_0x9b86('0x46')](handleError(_0x3e9f08,null));};exports[_0x9b86('0x47')]=function(_0x588814,_0x52686a){return db[_0x9b86('0x2c')][_0x9b86('0x47')](_0x588814[_0x9b86('0x48')],{})[_0x9b86('0x25')](respondWithResult(_0x52686a,0xc9))[_0x9b86('0x46')](handleError(_0x52686a,null));};exports['update']=function(_0x5ce3b4,_0x223548){if(_0x5ce3b4[_0x9b86('0x48')]['id']){delete _0x5ce3b4[_0x9b86('0x48')]['id'];}return db[_0x9b86('0x2c')][_0x9b86('0x45')]({'where':{'id':_0x5ce3b4[_0x9b86('0x49')]['id']}})['then'](handleEntityNotFound(_0x223548,null))[_0x9b86('0x25')](saveUpdates(_0x5ce3b4[_0x9b86('0x48')],null))[_0x9b86('0x25')](respondWithResult(_0x223548,null))[_0x9b86('0x46')](handleError(_0x223548,null));};exports[_0x9b86('0x26')]=function(_0x3a76ab,_0x305ea9){return db[_0x9b86('0x2c')][_0x9b86('0x45')]({'where':{'id':_0x3a76ab[_0x9b86('0x49')]['id']}})[_0x9b86('0x25')](handleEntityNotFound(_0x305ea9,null))[_0x9b86('0x25')](removeEntity(_0x305ea9,null))['catch'](handleError(_0x305ea9,null));}; \ No newline at end of file +var _0x6ef9=['../../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','limit','Content-Range','apply','update','then','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','Dynamics365Field','count','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','querystring','ioredis'];(function(_0x36fe46,_0x40010c){var _0x4d2e9c=function(_0x2dfa20){while(--_0x2dfa20){_0x36fe46['push'](_0x36fe46['shift']());}};_0x4d2e9c(++_0x40010c);}(_0x6ef9,0x1e2));var _0x96ef=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x6ef9[_0x174ef5];return _0x1cc379;};'use strict';var emlformat=require(_0x96ef('0x0'));var rimraf=require(_0x96ef('0x1'));var zipdir=require(_0x96ef('0x2'));var jsonpatch=require(_0x96ef('0x3'));var rp=require(_0x96ef('0x4'));var moment=require('moment');var BPromise=require(_0x96ef('0x5'));var Mustache=require(_0x96ef('0x6'));var util=require(_0x96ef('0x7'));var path=require(_0x96ef('0x8'));var sox=require(_0x96ef('0x9'));var csv=require(_0x96ef('0xa'));var ejs=require(_0x96ef('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x96ef('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x96ef('0xd'));var Papa=require('papaparse');var Redis=require(_0x96ef('0xe'));var authService=require(_0x96ef('0xf'));var qs=require(_0x96ef('0x10'));var as=require(_0x96ef('0x11'));var hardwareService=require(_0x96ef('0x12'));var logger=require(_0x96ef('0x13'))(_0x96ef('0x14'));var utils=require(_0x96ef('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x96ef('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b5a7e,_0x32c75b){_0x32c75b=_0x32c75b||0xcc;return function(_0x5185b5){if(_0x5185b5){return _0x2b5a7e[_0x96ef('0x17')](_0x32c75b);}return _0x2b5a7e[_0x96ef('0x18')](_0x32c75b)[_0x96ef('0x19')]();};}function respondWithResult(_0x16bbcf,_0x342837){_0x342837=_0x342837||0xc8;return function(_0x2b12c2){if(_0x2b12c2){return _0x16bbcf['status'](_0x342837)[_0x96ef('0x1a')](_0x2b12c2);}};}function respondWithFilteredResult(_0xb0e9e5,_0x409308){return function(_0x10ddd7){if(_0x10ddd7){var _0x4c88ac=typeof _0x409308[_0x96ef('0x1b')]==='undefined'&&typeof _0x409308[_0x96ef('0x1c')]==='undefined';var _0x1f6c7c=_0x10ddd7['count'];var _0x45372b=_0x4c88ac?0x0:_0x409308['offset'];var _0x39b516=_0x4c88ac?_0x10ddd7['count']:_0x409308[_0x96ef('0x1b')]+_0x409308['limit'];var _0x467ee4;if(_0x39b516>=_0x1f6c7c){_0x39b516=_0x1f6c7c;_0x467ee4=0xc8;}else{_0x467ee4=0xce;}_0xb0e9e5[_0x96ef('0x18')](_0x467ee4);return _0xb0e9e5['set'](_0x96ef('0x1d'),_0x45372b+'-'+_0x39b516+'/'+_0x1f6c7c)[_0x96ef('0x1a')](_0x10ddd7);}return null;};}function patchUpdates(_0x579abc){return function(_0xb8c89e){try{jsonpatch[_0x96ef('0x1e')](_0xb8c89e,_0x579abc,!![]);}catch(_0x5d4960){return BPromise['reject'](_0x5d4960);}return _0xb8c89e['save']();};}function saveUpdates(_0x4c3d96,_0x36e8d1){return function(_0x3677e0){if(_0x3677e0){return _0x3677e0[_0x96ef('0x1f')](_0x4c3d96)[_0x96ef('0x20')](function(_0x36deb7){return _0x36deb7;});}return null;};}function removeEntity(_0x215748,_0x2a8d2c){return function(_0x2714a4){if(_0x2714a4){return _0x2714a4['destroy']()[_0x96ef('0x20')](function(){_0x215748[_0x96ef('0x18')](0xcc)[_0x96ef('0x19')]();});}};}function handleEntityNotFound(_0x206b3e,_0x4e39f8){return function(_0x47aaac){if(!_0x47aaac){_0x206b3e[_0x96ef('0x17')](0x194);}return _0x47aaac;};}function handleError(_0x1e7d79,_0x35e117){_0x35e117=_0x35e117||0x1f4;return function(_0x48fccd){logger[_0x96ef('0x21')](_0x48fccd['stack']);if(_0x48fccd[_0x96ef('0x22')]){delete _0x48fccd[_0x96ef('0x22')];}_0x1e7d79[_0x96ef('0x18')](_0x35e117)[_0x96ef('0x23')](_0x48fccd);};}exports[_0x96ef('0x24')]=function(_0x1db38b,_0x3939ea){var _0x2c036f={},_0x303897={},_0x368fe4={'count':0x0,'rows':[]};var _0x1d2322=_[_0x96ef('0x25')](db['Dynamics365Field']['rawAttributes'],function(_0xa2f312){return{'name':_0xa2f312[_0x96ef('0x26')],'type':_0xa2f312[_0x96ef('0x27')][_0x96ef('0x28')]};});_0x303897[_0x96ef('0x29')]=_[_0x96ef('0x25')](_0x1d2322,_0x96ef('0x22'));_0x303897[_0x96ef('0x2a')]=_[_0x96ef('0x2b')](_0x1db38b['query']);_0x303897[_0x96ef('0x2c')]=_[_0x96ef('0x2d')](_0x303897[_0x96ef('0x29')],_0x303897['query']);_0x2c036f[_0x96ef('0x2e')]=_['intersection'](_0x303897[_0x96ef('0x29')],qs[_0x96ef('0x2f')](_0x1db38b[_0x96ef('0x2a')]['fields']));_0x2c036f[_0x96ef('0x2e')]=_0x2c036f[_0x96ef('0x2e')]['length']?_0x2c036f[_0x96ef('0x2e')]:_0x303897['model'];if(!_0x1db38b[_0x96ef('0x2a')][_0x96ef('0x30')](_0x96ef('0x31'))){_0x2c036f[_0x96ef('0x1c')]=qs['limit'](_0x1db38b[_0x96ef('0x2a')][_0x96ef('0x1c')]);_0x2c036f[_0x96ef('0x1b')]=qs[_0x96ef('0x1b')](_0x1db38b[_0x96ef('0x2a')][_0x96ef('0x1b')]);}_0x2c036f['order']=qs[_0x96ef('0x32')](_0x1db38b['query']['sort']);_0x2c036f[_0x96ef('0x33')]=qs[_0x96ef('0x2c')](_[_0x96ef('0x34')](_0x1db38b[_0x96ef('0x2a')],_0x303897['filters']),_0x1d2322);if(_0x1db38b[_0x96ef('0x2a')]['filter']){_0x2c036f[_0x96ef('0x33')]=_[_0x96ef('0x35')](_0x2c036f['where'],{'$or':_[_0x96ef('0x25')](_0x1d2322,function(_0x18865e){if(_0x18865e[_0x96ef('0x27')]!==_0x96ef('0x36')){var _0x819a={};_0x819a[_0x18865e['name']]={'$like':'%'+_0x1db38b[_0x96ef('0x2a')][_0x96ef('0x37')]+'%'};return _0x819a;}})});}_0x2c036f=_['merge']({},_0x2c036f,_0x1db38b['options']);var _0x30cda8={'where':_0x2c036f[_0x96ef('0x33')]};return db[_0x96ef('0x38')][_0x96ef('0x39')](_0x30cda8)['then'](function(_0x222b40){_0x368fe4[_0x96ef('0x39')]=_0x222b40;if(_0x1db38b['query'][_0x96ef('0x3a')]){_0x2c036f['include']=[{'all':!![]}];}return db[_0x96ef('0x38')][_0x96ef('0x3b')](_0x2c036f);})['then'](function(_0x1cd9e7){_0x368fe4[_0x96ef('0x3c')]=_0x1cd9e7;return _0x368fe4;})['then'](respondWithFilteredResult(_0x3939ea,_0x2c036f))[_0x96ef('0x3d')](handleError(_0x3939ea,null));};exports[_0x96ef('0x3e')]=function(_0x29802d,_0x367b7c){var _0x5ded89={'raw':!![],'where':{'id':_0x29802d[_0x96ef('0x3f')]['id']}},_0x310cb3={};_0x310cb3[_0x96ef('0x29')]=_[_0x96ef('0x2b')](db[_0x96ef('0x38')]['rawAttributes']);_0x310cb3[_0x96ef('0x2a')]=_[_0x96ef('0x2b')](_0x29802d['query']);_0x310cb3[_0x96ef('0x2c')]=_['intersection'](_0x310cb3[_0x96ef('0x29')],_0x310cb3['query']);_0x5ded89[_0x96ef('0x2e')]=_['intersection'](_0x310cb3[_0x96ef('0x29')],qs[_0x96ef('0x2f')](_0x29802d['query'][_0x96ef('0x2f')]));_0x5ded89[_0x96ef('0x2e')]=_0x5ded89['attributes'][_0x96ef('0x40')]?_0x5ded89[_0x96ef('0x2e')]:_0x310cb3[_0x96ef('0x29')];if(_0x29802d[_0x96ef('0x2a')]['includeAll']){_0x5ded89[_0x96ef('0x41')]=[{'all':!![]}];}_0x5ded89=_[_0x96ef('0x35')]({},_0x5ded89,_0x29802d[_0x96ef('0x42')]);return db['Dynamics365Field'][_0x96ef('0x43')](_0x5ded89)['then'](handleEntityNotFound(_0x367b7c,null))[_0x96ef('0x20')](respondWithResult(_0x367b7c,null))['catch'](handleError(_0x367b7c,null));};exports[_0x96ef('0x44')]=function(_0x5c2872,_0x5669b5){return db[_0x96ef('0x38')]['create'](_0x5c2872[_0x96ef('0x45')],{})[_0x96ef('0x20')](respondWithResult(_0x5669b5,0xc9))[_0x96ef('0x3d')](handleError(_0x5669b5,null));};exports[_0x96ef('0x1f')]=function(_0x395d17,_0x4c26d7){if(_0x395d17['body']['id']){delete _0x395d17[_0x96ef('0x45')]['id'];}return db['Dynamics365Field'][_0x96ef('0x43')]({'where':{'id':_0x395d17[_0x96ef('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4c26d7,null))['then'](saveUpdates(_0x395d17[_0x96ef('0x45')],null))['then'](respondWithResult(_0x4c26d7,null))['catch'](handleError(_0x4c26d7,null));};exports[_0x96ef('0x46')]=function(_0x2fa038,_0x45d9e9){return db['Dynamics365Field'][_0x96ef('0x43')]({'where':{'id':_0x2fa038[_0x96ef('0x3f')]['id']}})[_0x96ef('0x20')](handleEntityNotFound(_0x45d9e9,null))[_0x96ef('0x20')](removeEntity(_0x45d9e9,null))[_0x96ef('0x3d')](handleError(_0x45d9e9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index db77c62..94ec6a7 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 _0x9717=['idField','FieldId','util','api','moment','request-promise','rimraf','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x521094,_0x491f3c){var _0x4433c7=function(_0x10c47d){while(--_0x10c47d){_0x521094['push'](_0x521094['shift']());}};_0x4433c7(++_0x491f3c);}(_0x9717,0xab));var _0x7971=function(_0x1f12ac,_0x4f7b54){_0x1f12ac=_0x1f12ac-0x0;var _0x1ef13b=_0x9717[_0x1f12ac];return _0x1ef13b;};'use strict';var _=require('lodash');var util=require(_0x7971('0x0'));var logger=require('../../config/logger')(_0x7971('0x1'));var moment=require(_0x7971('0x2'));var BPromise=require('bluebird');var rp=require(_0x7971('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7971('0x4'));var config=require(_0x7971('0x5'));var attributes=require('./intDynamics365Field.attributes');module[_0x7971('0x6')]=function(_0x4f62d3,_0x44bb86){return _0x4f62d3[_0x7971('0x7')](_0x7971('0x8'),attributes,{'tableName':_0x7971('0x9'),'paranoid':![],'indexes':[{'name':_0x7971('0xa'),'fields':[_0x7971('0xb'),_0x7971('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf4fe=['dynamics365_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Field'];(function(_0x26c0ac,_0xdfccf5){var _0xa40b0d=function(_0x470e54){while(--_0x470e54){_0x26c0ac['push'](_0x26c0ac['shift']());}};_0xa40b0d(++_0xdfccf5);}(_0xf4fe,0x13b));var _0xef4f=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xf4fe[_0x3b5250];return _0xc844a1;};'use strict';var _=require('lodash');var util=require(_0xef4f('0x0'));var logger=require(_0xef4f('0x1'))(_0xef4f('0x2'));var moment=require(_0xef4f('0x3'));var BPromise=require('bluebird');var rp=require(_0xef4f('0x4'));var fs=require('fs');var path=require(_0xef4f('0x5'));var rimraf=require(_0xef4f('0x6'));var config=require(_0xef4f('0x7'));var attributes=require('./intDynamics365Field.attributes');module[_0xef4f('0x8')]=function(_0x589928,_0x1114fa){return _0x589928['define'](_0xef4f('0x9'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xef4f('0xa'),'fields':[_0xef4f('0xb'),_0xef4f('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 1da2dd6..6960802 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 _0xfe72=['request','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','Dynamics365Field,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3f52d9,_0x1d748c){var _0x21e01f=function(_0x22e584){while(--_0x22e584){_0x3f52d9['push'](_0x3f52d9['shift']());}};_0x21e01f(++_0x1d748c);}(_0xfe72,0x1ef));var _0x2fe7=function(_0x581a41,_0x5dd178){_0x581a41=_0x581a41-0x0;var _0x4e5b98=_0xfe72[_0x581a41];return _0x4e5b98;};'use strict';var _=require(_0x2fe7('0x0'));var util=require(_0x2fe7('0x1'));var moment=require(_0x2fe7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fe7('0x3'));var db=require(_0x2fe7('0x4'))['db'];var utils=require(_0x2fe7('0x5'));var logger=require(_0x2fe7('0x6'))(_0x2fe7('0x7'));var config=require(_0x2fe7('0x8'));var jayson=require(_0x2fe7('0x9'));var client=jayson[_0x2fe7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54058c,_0x4bbeba,_0x55eb6f){return new BPromise(function(_0x1e79fe,_0x38ae49){return client[_0x2fe7('0xb')](_0x54058c,_0x55eb6f)[_0x2fe7('0xc')](function(_0xbcbe80){logger[_0x2fe7('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x4bbeba,_0x2fe7('0xe'));logger[_0x2fe7('0xf')](_0x2fe7('0x10'),_0x4bbeba,_0x2fe7('0xe'),JSON[_0x2fe7('0x11')](_0xbcbe80));if(_0xbcbe80[_0x2fe7('0x12')]){if(_0xbcbe80['error']['code']===0x1f4){logger[_0x2fe7('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x4bbeba,_0xbcbe80[_0x2fe7('0x12')][_0x2fe7('0x13')]);return _0x38ae49(_0xbcbe80[_0x2fe7('0x12')][_0x2fe7('0x13')]);}logger['error'](_0x2fe7('0x14'),_0x4bbeba,_0xbcbe80[_0x2fe7('0x12')][_0x2fe7('0x13')]);return _0x1e79fe(_0xbcbe80[_0x2fe7('0x12')]['message']);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x4bbeba,_0x2fe7('0xe'));_0x1e79fe(_0xbcbe80[_0x2fe7('0x15')][_0x2fe7('0x13')]);}})[_0x2fe7('0x16')](function(_0x1e9051){logger[_0x2fe7('0x12')](_0x2fe7('0x14'),_0x4bbeba,_0x1e9051);_0x38ae49(_0x1e9051);});});} \ No newline at end of file +var _0x1aec=['client','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x19dc15,_0xbe75a3){var _0x2d87d5=function(_0x5471dd){while(--_0x5471dd){_0x19dc15['push'](_0x19dc15['shift']());}};_0x2d87d5(++_0xbe75a3);}(_0x1aec,0x9b));var _0xc1ae=function(_0x443bc8,_0x5d5853){_0x443bc8=_0x443bc8-0x0;var _0x3db156=_0x1aec[_0x443bc8];return _0x3db156;};'use strict';var _=require(_0xc1ae('0x0'));var util=require('util');var moment=require(_0xc1ae('0x1'));var BPromise=require(_0xc1ae('0x2'));var rs=require(_0xc1ae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1ae('0x4'))['db'];var utils=require(_0xc1ae('0x5'));var logger=require('../../config/logger')(_0xc1ae('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc1ae('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3557ab,_0x2d34c1,_0x1a5782){return new BPromise(function(_0x4f6823,_0x5ec10){return client['request'](_0x3557ab,_0x1a5782)[_0xc1ae('0x8')](function(_0x2b1691){logger[_0xc1ae('0x9')](_0xc1ae('0xa'),_0x2d34c1,_0xc1ae('0xb'));logger['debug'](_0xc1ae('0xc'),_0x2d34c1,'request\x20sent',JSON[_0xc1ae('0xd')](_0x2b1691));if(_0x2b1691['error']){if(_0x2b1691[_0xc1ae('0xe')]['code']===0x1f4){logger[_0xc1ae('0xe')](_0xc1ae('0xa'),_0x2d34c1,_0x2b1691[_0xc1ae('0xe')][_0xc1ae('0xf')]);return _0x5ec10(_0x2b1691[_0xc1ae('0xe')]['message']);}logger[_0xc1ae('0xe')](_0xc1ae('0xa'),_0x2d34c1,_0x2b1691['error']['message']);return _0x4f6823(_0x2b1691[_0xc1ae('0xe')][_0xc1ae('0xf')]);}else{logger[_0xc1ae('0x9')](_0xc1ae('0xa'),_0x2d34c1,'request\x20sent');_0x4f6823(_0x2b1691[_0xc1ae('0x10')][_0xc1ae('0xf')]);}})[_0xc1ae('0x11')](function(_0x469f61){logger[_0xc1ae('0xe')](_0xc1ae('0xa'),_0x2d34c1,_0x469f61);_0x5ec10(_0x469f61);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 8ec4b3b..829f725 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 _0x6ac6=['getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x429df0,_0x3e2ca2){var _0x4bc7ba=function(_0x59aba6){while(--_0x59aba6){_0x429df0['push'](_0x429df0['shift']());}};_0x4bc7ba(++_0x3e2ca2);}(_0x6ac6,0x1df));var _0x66ac=function(_0x4004d9,_0x526735){_0x4004d9=_0x4004d9-0x0;var _0xad9b76=_0x6ac6[_0x4004d9];return _0xad9b76;};'use strict';var multer=require(_0x66ac('0x0'));var util=require(_0x66ac('0x1'));var path=require(_0x66ac('0x2'));var timeout=require(_0x66ac('0x3'));var express=require('express');var router=express[_0x66ac('0x4')]();var fs_extra=require(_0x66ac('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x66ac('0x6'));var config=require(_0x66ac('0x7'));var controller=require(_0x66ac('0x8'));router[_0x66ac('0x9')]('/',auth['isAuthenticated'](),controller[_0x66ac('0xa')]);router[_0x66ac('0x9')](_0x66ac('0xb'),auth[_0x66ac('0xc')](),controller[_0x66ac('0xd')]);router[_0x66ac('0x9')](_0x66ac('0xe'),auth[_0x66ac('0xc')](),controller[_0x66ac('0xf')]);router[_0x66ac('0x9')](_0x66ac('0x10'),auth[_0x66ac('0xc')](),controller[_0x66ac('0x11')]);router[_0x66ac('0x12')]('/',auth[_0x66ac('0xc')](),controller[_0x66ac('0x13')]);router[_0x66ac('0x12')](_0x66ac('0xe'),auth['isAuthenticated'](),controller[_0x66ac('0x14')]);router[_0x66ac('0x15')]('/:id',auth[_0x66ac('0xc')](),controller[_0x66ac('0x16')]);router[_0x66ac('0x17')]('/:id',auth[_0x66ac('0xc')](),controller[_0x66ac('0x18')]);module[_0x66ac('0x19')]=router; \ No newline at end of file +var _0x19c0=['destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','/:id/fields','post','addConfiguration','put','update'];(function(_0x485d77,_0x5bada2){var _0x301190=function(_0x333bf6){while(--_0x333bf6){_0x485d77['push'](_0x485d77['shift']());}};_0x301190(++_0x5bada2);}(_0x19c0,0x1e1));var _0x019c=function(_0x31114f,_0x37e33e){_0x31114f=_0x31114f-0x0;var _0x5144b5=_0x19c0[_0x31114f];return _0x5144b5;};'use strict';var multer=require(_0x019c('0x0'));var util=require(_0x019c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x019c('0x2'));var router=express[_0x019c('0x3')]();var fs_extra=require(_0x019c('0x4'));var auth=require(_0x019c('0x5'));var interaction=require(_0x019c('0x6'));var config=require(_0x019c('0x7'));var controller=require(_0x019c('0x8'));router['get']('/',auth[_0x019c('0x9')](),controller[_0x019c('0xa')]);router[_0x019c('0xb')](_0x019c('0xc'),auth[_0x019c('0x9')](),controller['show']);router[_0x019c('0xb')](_0x019c('0xd'),auth[_0x019c('0x9')](),controller['getConfigurations']);router[_0x019c('0xb')](_0x019c('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x019c('0xf')](_0x019c('0xd'),auth['isAuthenticated'](),controller[_0x019c('0x10')]);router[_0x019c('0x11')](_0x019c('0xc'),auth[_0x019c('0x9')](),controller[_0x019c('0x12')]);router['delete'](_0x019c('0xc'),auth[_0x019c('0x9')](),controller[_0x019c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index ed714c6..caae050 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 _0x958a=['sequelize','exports','STRING','username'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x958a,0x128));var _0xa958=function(_0x309dc4,_0x5ba667){_0x309dc4=_0x309dc4-0x0;var _0x44e28c=_0x958a[_0x309dc4];return _0x44e28c;};'use strict';var Sequelize=require(_0xa958('0x0'));module[_0xa958('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa958('0x2')]},'username':{'type':Sequelize[_0xa958('0x2')],'unique':_0xa958('0x3')},'apiKey':{'type':Sequelize[_0xa958('0x2')]},'remoteUri':{'type':Sequelize[_0xa958('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xa958('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x958a=['sequelize','exports','STRING','username'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x958a,0x128));var _0xa958=function(_0x10d53f,_0x3e0294){_0x10d53f=_0x10d53f-0x0;var _0xa8be82=_0x958a[_0x10d53f];return _0xa8be82;};'use strict';var Sequelize=require(_0xa958('0x0'));module[_0xa958('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa958('0x2')]},'username':{'type':Sequelize[_0xa958('0x2')],'unique':_0xa958('0x3')},'apiKey':{'type':Sequelize[_0xa958('0x2')]},'remoteUri':{'type':Sequelize[_0xa958('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xa958('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 15ba70a..8e8bec2 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 _0xf53d=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','catch','create','body','find','findOne','FreshdeskConfiguration','order','pick','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','format','Basic\x20%s','toString','base64','requester','subject','agent','description','group','source','ticket_type','company','default','custom_text','custom_dropdown','label','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query'];(function(_0x8fbdd8,_0x4bb2cf){var _0x2c5199=function(_0x5a0a58){while(--_0x5a0a58){_0x8fbdd8['push'](_0x8fbdd8['shift']());}};_0x2c5199(++_0x4bb2cf);}(_0xf53d,0x199));var _0xdf53=function(_0x369314,_0x2def82){_0x369314=_0x369314-0x0;var _0x8c75c3=_0xf53d[_0x369314];return _0x8c75c3;};'use strict';var emlformat=require(_0xdf53('0x0'));var rimraf=require(_0xdf53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf53('0x2'));var rp=require(_0xdf53('0x3'));var moment=require(_0xdf53('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf53('0x5'));var util=require('util');var path=require(_0xdf53('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdf53('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdf53('0x8'));var squel=require(_0xdf53('0x9'));var crypto=require(_0xdf53('0xa'));var jsforce=require(_0xdf53('0xb'));var deskjs=require(_0xdf53('0xc'));var toCsv=require(_0xdf53('0xd'));var querystring=require(_0xdf53('0xe'));var Papa=require(_0xdf53('0xf'));var Redis=require('ioredis');var authService=require(_0xdf53('0x10'));var qs=require(_0xdf53('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf53('0x12'));var logger=require('../../config/logger')(_0xdf53('0x13'));var utils=require(_0xdf53('0x14'));var config=require(_0xdf53('0x15'));var licenseUtil=require(_0xdf53('0x16'));var db=require(_0xdf53('0x17'))['db'];var integrations=require(_0xdf53('0x18'));function respondWithStatusCode(_0x4c1eee,_0x4082e3){_0x4082e3=_0x4082e3||0xcc;return function(_0x5d5447){if(_0x5d5447){return _0x4c1eee['sendStatus'](_0x4082e3);}return _0x4c1eee['status'](_0x4082e3)[_0xdf53('0x19')]();};}function respondWithResult(_0x25f7c3,_0x1cca6c){_0x1cca6c=_0x1cca6c||0xc8;return function(_0x5a5b4b){if(_0x5a5b4b){return _0x25f7c3[_0xdf53('0x1a')](_0x1cca6c)[_0xdf53('0x1b')](_0x5a5b4b);}};}function respondWithFilteredResult(_0x2476ee,_0x174b19){return function(_0x22deb2){if(_0x22deb2){var _0x413151=typeof _0x174b19[_0xdf53('0x1c')]===_0xdf53('0x1d')&&typeof _0x174b19[_0xdf53('0x1e')]===_0xdf53('0x1d');var _0x24f9b2=_0x22deb2[_0xdf53('0x1f')];var _0x47b4b3=_0x413151?0x0:_0x174b19[_0xdf53('0x1c')];var _0x577cfb=_0x413151?_0x22deb2[_0xdf53('0x1f')]:_0x174b19[_0xdf53('0x1c')]+_0x174b19[_0xdf53('0x1e')];var _0x49f568;if(_0x577cfb>=_0x24f9b2){_0x577cfb=_0x24f9b2;_0x49f568=0xc8;}else{_0x49f568=0xce;}_0x2476ee[_0xdf53('0x1a')](_0x49f568);return _0x2476ee[_0xdf53('0x20')](_0xdf53('0x21'),_0x47b4b3+'-'+_0x577cfb+'/'+_0x24f9b2)['json'](_0x22deb2);}return null;};}function patchUpdates(_0x4a381b){return function(_0x54ccca){try{jsonpatch['apply'](_0x54ccca,_0x4a381b,!![]);}catch(_0x311155){return BPromise['reject'](_0x311155);}return _0x54ccca[_0xdf53('0x22')]();};}function saveUpdates(_0x21cc09,_0x213703){return function(_0x193b74){if(_0x193b74){return _0x193b74[_0xdf53('0x23')](_0x21cc09)[_0xdf53('0x24')](function(_0x433622){return _0x433622;});}return null;};}function removeEntity(_0x5b0303,_0x3fa668){return function(_0x344936){if(_0x344936){return _0x344936[_0xdf53('0x25')]()[_0xdf53('0x24')](function(){_0x5b0303['status'](0xcc)[_0xdf53('0x19')]();});}};}function handleEntityNotFound(_0x311792,_0x4127c5){return function(_0x42a64e){if(!_0x42a64e){_0x311792[_0xdf53('0x26')](0x194);}return _0x42a64e;};}function handleError(_0x116136,_0x305de7){_0x305de7=_0x305de7||0x1f4;return function(_0x1d94dc){logger[_0xdf53('0x27')](_0x1d94dc[_0xdf53('0x28')]);if(_0x1d94dc[_0xdf53('0x29')]){delete _0x1d94dc[_0xdf53('0x29')];}_0x116136[_0xdf53('0x1a')](_0x305de7)[_0xdf53('0x2a')](_0x1d94dc);};}exports[_0xdf53('0x2b')]=function(_0x5abbc2,_0x1687d1){var _0x5b2877={},_0x4e9056={},_0x210e3f={'count':0x0,'rows':[]};var _0x2526fa=_[_0xdf53('0x2c')](db[_0xdf53('0x2d')][_0xdf53('0x2e')],function(_0x3e8363){return{'name':_0x3e8363[_0xdf53('0x2f')],'type':_0x3e8363[_0xdf53('0x30')]['key']};});_0x4e9056[_0xdf53('0x31')]=_[_0xdf53('0x2c')](_0x2526fa,_0xdf53('0x29'));_0x4e9056[_0xdf53('0x32')]=_[_0xdf53('0x33')](_0x5abbc2[_0xdf53('0x32')]);_0x4e9056[_0xdf53('0x34')]=_[_0xdf53('0x35')](_0x4e9056[_0xdf53('0x31')],_0x4e9056[_0xdf53('0x32')]);_0x5b2877[_0xdf53('0x36')]=_[_0xdf53('0x35')](_0x4e9056[_0xdf53('0x31')],qs[_0xdf53('0x37')](_0x5abbc2['query'][_0xdf53('0x37')]));_0x5b2877['attributes']=_0x5b2877[_0xdf53('0x36')][_0xdf53('0x38')]?_0x5b2877['attributes']:_0x4e9056[_0xdf53('0x31')];if(!_0x5abbc2['query'][_0xdf53('0x39')]('nolimit')){_0x5b2877[_0xdf53('0x1e')]=qs[_0xdf53('0x1e')](_0x5abbc2[_0xdf53('0x32')]['limit']);_0x5b2877[_0xdf53('0x1c')]=qs['offset'](_0x5abbc2['query'][_0xdf53('0x1c')]);}_0x5b2877['order']=qs['sort'](_0x5abbc2[_0xdf53('0x32')][_0xdf53('0x3a')]);_0x5b2877[_0xdf53('0x3b')]=qs[_0xdf53('0x34')](_['pick'](_0x5abbc2[_0xdf53('0x32')],_0x4e9056['filters']),_0x2526fa);if(_0x5abbc2[_0xdf53('0x32')]['filter']){_0x5b2877[_0xdf53('0x3b')]=_[_0xdf53('0x3c')](_0x5b2877['where'],{'$or':_[_0xdf53('0x2c')](_0x2526fa,function(_0x34d786){if(_0x34d786[_0xdf53('0x30')]!==_0xdf53('0x3d')){var _0x925287={};_0x925287[_0x34d786[_0xdf53('0x29')]]={'$like':'%'+_0x5abbc2[_0xdf53('0x32')][_0xdf53('0x3e')]+'%'};return _0x925287;}})});}_0x5b2877=_[_0xdf53('0x3c')]({},_0x5b2877,_0x5abbc2[_0xdf53('0x3f')]);var _0x26d446={'where':_0x5b2877[_0xdf53('0x3b')]};return db['FreshdeskAccount'][_0xdf53('0x1f')](_0x26d446)[_0xdf53('0x24')](function(_0xbb1a54){_0x210e3f[_0xdf53('0x1f')]=_0xbb1a54;if(_0x5abbc2[_0xdf53('0x32')][_0xdf53('0x40')]){_0x5b2877[_0xdf53('0x41')]=[{'all':!![]}];}return db[_0xdf53('0x2d')]['findAll'](_0x5b2877);})['then'](function(_0x3bdcf4){_0x210e3f[_0xdf53('0x42')]=_0x3bdcf4;return _0x210e3f;})['then'](respondWithFilteredResult(_0x1687d1,_0x5b2877))['catch'](handleError(_0x1687d1,null));};exports[_0xdf53('0x43')]=function(_0x2f4b27,_0x5a02f4){var _0x296362={'raw':![],'where':{'id':_0x2f4b27[_0xdf53('0x44')]['id']}},_0x3ce562={};_0x3ce562[_0xdf53('0x31')]=_['keys'](db[_0xdf53('0x2d')][_0xdf53('0x2e')]);_0x3ce562[_0xdf53('0x32')]=_[_0xdf53('0x33')](_0x2f4b27[_0xdf53('0x32')]);_0x3ce562[_0xdf53('0x34')]=_['intersection'](_0x3ce562['model'],_0x3ce562[_0xdf53('0x32')]);_0x296362['attributes']=_['intersection'](_0x3ce562[_0xdf53('0x31')],qs[_0xdf53('0x37')](_0x2f4b27['query'][_0xdf53('0x37')]));_0x296362[_0xdf53('0x36')]=_0x296362[_0xdf53('0x36')][_0xdf53('0x38')]?_0x296362['attributes']:_0x3ce562[_0xdf53('0x31')];if(_0x2f4b27[_0xdf53('0x32')][_0xdf53('0x40')]){_0x296362['include']=[{'all':!![]}];}_0x296362=_[_0xdf53('0x3c')]({},_0x296362,_0x2f4b27[_0xdf53('0x3f')]);return db['FreshdeskAccount']['find'](_0x296362)['then'](handleEntityNotFound(_0x5a02f4,null))[_0xdf53('0x24')](respondWithResult(_0x5a02f4,null))[_0xdf53('0x45')](handleError(_0x5a02f4,null));};exports[_0xdf53('0x46')]=function(_0x98fe02,_0x205d7d){return db[_0xdf53('0x2d')][_0xdf53('0x46')](_0x98fe02['body'],{})['then'](respondWithResult(_0x205d7d,0xc9))[_0xdf53('0x45')](handleError(_0x205d7d,null));};exports[_0xdf53('0x23')]=function(_0x11e94c,_0x2e5a8d){if(_0x11e94c[_0xdf53('0x47')]['id']){delete _0x11e94c[_0xdf53('0x47')]['id'];}return db[_0xdf53('0x2d')][_0xdf53('0x48')]({'where':{'id':_0x11e94c[_0xdf53('0x44')]['id']}})[_0xdf53('0x24')](handleEntityNotFound(_0x2e5a8d,null))[_0xdf53('0x24')](saveUpdates(_0x11e94c[_0xdf53('0x47')],null))[_0xdf53('0x24')](respondWithResult(_0x2e5a8d,null))[_0xdf53('0x45')](handleError(_0x2e5a8d,null));};exports[_0xdf53('0x25')]=function(_0x35805e,_0x3371b5){return db[_0xdf53('0x2d')][_0xdf53('0x48')]({'where':{'id':_0x35805e['params']['id']}})[_0xdf53('0x24')](handleEntityNotFound(_0x3371b5,null))[_0xdf53('0x24')](removeEntity(_0x3371b5,null))[_0xdf53('0x45')](handleError(_0x3371b5,null));};exports['getConfigurations']=function(_0x135a37,_0x21ddfc,_0x5981bb){var _0x2b12c5={};var _0x4ce1eb={};var _0x13dc35;var _0x33853b;return db['FreshdeskAccount'][_0xdf53('0x49')]({'where':{'id':_0x135a37[_0xdf53('0x44')]['id']}})[_0xdf53('0x24')](handleEntityNotFound(_0x21ddfc,null))[_0xdf53('0x24')](function(_0x1cbef5){if(_0x1cbef5){_0x13dc35=_0x1cbef5;_0x4ce1eb[_0xdf53('0x31')]=_[_0xdf53('0x33')](db[_0xdf53('0x4a')]['rawAttributes']);_0x4ce1eb['query']=_[_0xdf53('0x33')](_0x135a37[_0xdf53('0x32')]);_0x4ce1eb[_0xdf53('0x34')]=_[_0xdf53('0x35')](_0x4ce1eb[_0xdf53('0x31')],_0x4ce1eb['query']);_0x2b12c5['attributes']=_['intersection'](_0x4ce1eb[_0xdf53('0x31')],qs['fields'](_0x135a37[_0xdf53('0x32')][_0xdf53('0x37')]));_0x2b12c5[_0xdf53('0x36')]=_0x2b12c5[_0xdf53('0x36')][_0xdf53('0x38')]?_0x2b12c5[_0xdf53('0x36')]:_0x4ce1eb[_0xdf53('0x31')];_0x2b12c5[_0xdf53('0x4b')]=qs[_0xdf53('0x3a')](_0x135a37[_0xdf53('0x32')][_0xdf53('0x3a')]);_0x2b12c5[_0xdf53('0x3b')]=qs[_0xdf53('0x34')](_[_0xdf53('0x4c')](_0x135a37['query'],_0x4ce1eb[_0xdf53('0x34')]));if(_0x135a37[_0xdf53('0x32')]['filter']){_0x2b12c5[_0xdf53('0x3b')]=_[_0xdf53('0x3c')](_0x2b12c5[_0xdf53('0x3b')],{'$or':_['map'](_0x2b12c5[_0xdf53('0x36')],function(_0x3e7cc0){var _0x1bfaf5={};_0x1bfaf5[_0x3e7cc0]={'$like':'%'+_0x135a37[_0xdf53('0x32')][_0xdf53('0x3e')]+'%'};return _0x1bfaf5;})});}_0x2b12c5=_[_0xdf53('0x3c')]({},_0x2b12c5,_0x135a37[_0xdf53('0x3f')]);return _0x13dc35[_0xdf53('0x4d')](_0x2b12c5);}})['then'](function(_0x46e5ca){if(_0x46e5ca){_0x33853b=_0x46e5ca[_0xdf53('0x38')];if(!_0x135a37[_0xdf53('0x32')][_0xdf53('0x39')](_0xdf53('0x4e'))){_0x2b12c5[_0xdf53('0x1e')]=qs['limit'](_0x135a37['query'][_0xdf53('0x1e')]);_0x2b12c5[_0xdf53('0x1c')]=qs['offset'](_0x135a37[_0xdf53('0x32')][_0xdf53('0x1c')]);}return _0x13dc35[_0xdf53('0x4d')](_0x2b12c5);}})['then'](function(_0x4dc662){if(_0x4dc662){return _0x4dc662?{'count':_0x33853b,'rows':_0x4dc662}:null;}})[_0xdf53('0x24')](respondWithResult(_0x21ddfc,null))[_0xdf53('0x45')](handleError(_0x21ddfc,null));};exports[_0xdf53('0x4f')]=function(_0x5c078a,_0x1c4da3,_0x59bb8e){if(_0x5c078a[_0xdf53('0x47')]['id']){delete _0x5c078a[_0xdf53('0x47')]['id'];}return db[_0xdf53('0x2d')]['findOne']({'where':{'id':_0x5c078a['params']['id']}})[_0xdf53('0x24')](handleEntityNotFound(_0x1c4da3,null))['then'](function(_0x25ff8b){if(_0x25ff8b){_0x5c078a['body']['AccountId']=_0x25ff8b['id'];_0x5c078a['body'][_0xdf53('0x50')]=integrations[_0xdf53('0x51')](_0x5c078a[_0xdf53('0x47')][_0xdf53('0x52')],_0x5c078a['body'][_0xdf53('0x30')]);_0x5c078a[_0xdf53('0x47')][_0xdf53('0x53')]=integrations[_0xdf53('0x54')](_0x5c078a[_0xdf53('0x47')][_0xdf53('0x52')],_0x5c078a[_0xdf53('0x47')][_0xdf53('0x30')]);return db['FreshdeskConfiguration']['create'](_0x5c078a[_0xdf53('0x47')],{'include':[{'model':db['FreshdeskField'],'as':_0xdf53('0x50')},{'model':db[_0xdf53('0x55')],'as':_0xdf53('0x53')}]});}return null;})[_0xdf53('0x24')](respondWithResult(_0x1c4da3,null))[_0xdf53('0x45')](handleError(_0x1c4da3,null));};exports[_0xdf53('0x56')]=function(_0x1476cf,_0x20595c,_0x32cbd7){var _0x46ef2e='';return db[_0xdf53('0x2d')][_0xdf53('0x49')]({'where':{'id':_0x1476cf['params']['id']},'attributes':['id',_0xdf53('0x57'),_0xdf53('0x58')]})['then'](handleEntityNotFound(_0x20595c,null))[_0xdf53('0x24')](function(_0x20c7f0){if(_0x20c7f0){_0x46ef2e=_0x20c7f0[_0xdf53('0x57')];var _0x5f39f2=_0x46ef2e[_0xdf53('0x59')](-0x1);if(_0x5f39f2==='/'){_0x46ef2e=_0x46ef2e[_0xdf53('0x5a')](0x0,_0x46ef2e[_0xdf53('0x5b')](_0x5f39f2));}return rp({'method':'GET','uri':util[_0xdf53('0x5c')]('%s/%s',_0x46ef2e,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xdf53('0x5c')](_0xdf53('0x5d'),new Buffer(util['format']('%s:X',_0x20c7f0[_0xdf53('0x58')]))[_0xdf53('0x5e')](_0xdf53('0x5f')))},'json':!![]});}})[_0xdf53('0x24')](function(_0x235631){if(_0x235631){var _0x57cfa7=[_0xdf53('0x60'),_0xdf53('0x61'),_0xdf53('0x62'),_0xdf53('0x63'),_0xdf53('0x1a'),'priority',_0xdf53('0x64'),_0xdf53('0x65'),_0xdf53('0x66'),_0xdf53('0x64'),_0xdf53('0x67')];_['remove'](_0x235631,function(_0x58ee2c){return _0x57cfa7['includes'](_0x58ee2c[_0xdf53('0x29')])||!_0x58ee2c[_0xdf53('0x68')]&&_0x58ee2c[_0xdf53('0x30')]!==_0xdf53('0x69')&&_0x58ee2c['type']!==_0xdf53('0x6a');});return{'count':_0x235631[_0xdf53('0x38')],'rows':_[_0xdf53('0x2c')](_0x235631,function(_0x1092ce){return{'id':_0x1092ce[_0xdf53('0x29')],'name':_0x1092ce[_0xdf53('0x6b')],'custom':!_0x1092ce[_0xdf53('0x68')],'options':_0x1092ce[_0xdf53('0x6c')]?_['map'](_0x1092ce[_0xdf53('0x6c')],function(_0x57d973){return{'name':_[_0xdf53('0x6d')](_0x57d973),'value':_0x57d973};}):[]};})};}})[_0xdf53('0x24')](respondWithResult(_0x20595c,null))['catch'](function(_0x17be25){var _0x4187ec=_0x1476cf['query'][_0xdf53('0x6e')]?0x1f4:_0x17be25['statusCode']||0x1f4;logger[_0xdf53('0x27')](_0xdf53('0x6f'),_0xdf53('0x56'),_0x4187ec,JSON[_0xdf53('0x70')](_0x17be25));delete _0x17be25[_0xdf53('0x29')];if(_0x4187ec===0x191){_0x4187ec=0x190;}_0x20595c[_0xdf53('0x1a')](_0x4187ec)[_0xdf53('0x2a')](_0x1476cf['query'][_0xdf53('0x6e')]?{'message':_0xdf53('0x71'),'statusCode':_0x17be25[_0xdf53('0x72')]}:_0x17be25);});}; \ No newline at end of file +var _0xaa1b=['query','keys','intersection','attributes','fields','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','include','FreshdeskAccount','findAll','rows','catch','show','params','length','includeAll','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','addConfiguration','Subjects','getDescriptions','channel','FreshdeskField','Descriptions','getFields','apiKey','remoteUri','slice','GET','%s/%s','api/v2/ticket_fields','Basic\x20%s','format','%s:X','toString','requester','subject','agent','priority','group','ticket_type','company','remove','default','custom_dropdown','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','model'];(function(_0x397c8d,_0xf0a1a4){var _0x1c5b0a=function(_0x4585d8){while(--_0x4585d8){_0x397c8d['push'](_0x397c8d['shift']());}};_0x1c5b0a(++_0xf0a1a4);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xbaa1('0x0'));var rimraf=require(_0xbaa1('0x1'));var zipdir=require(_0xbaa1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbaa1('0x3'));var moment=require('moment');var BPromise=require(_0xbaa1('0x4'));var Mustache=require(_0xbaa1('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbaa1('0x6'));var ejs=require(_0xbaa1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbaa1('0x8'));var squel=require('squel');var crypto=require(_0xbaa1('0x9'));var jsforce=require(_0xbaa1('0xa'));var deskjs=require(_0xbaa1('0xb'));var toCsv=require(_0xbaa1('0x6'));var querystring=require(_0xbaa1('0xc'));var Papa=require(_0xbaa1('0xd'));var Redis=require('ioredis');var authService=require(_0xbaa1('0xe'));var qs=require(_0xbaa1('0xf'));var as=require(_0xbaa1('0x10'));var hardwareService=require(_0xbaa1('0x11'));var logger=require(_0xbaa1('0x12'))(_0xbaa1('0x13'));var utils=require(_0xbaa1('0x14'));var config=require(_0xbaa1('0x15'));var licenseUtil=require(_0xbaa1('0x16'));var db=require(_0xbaa1('0x17'))['db'];var integrations=require(_0xbaa1('0x18'));function respondWithStatusCode(_0x1376c6,_0x5064a4){_0x5064a4=_0x5064a4||0xcc;return function(_0x592a07){if(_0x592a07){return _0x1376c6['sendStatus'](_0x5064a4);}return _0x1376c6['status'](_0x5064a4)[_0xbaa1('0x19')]();};}function respondWithResult(_0x388cfd,_0x3bfbcc){_0x3bfbcc=_0x3bfbcc||0xc8;return function(_0x26c1f5){if(_0x26c1f5){return _0x388cfd[_0xbaa1('0x1a')](_0x3bfbcc)[_0xbaa1('0x1b')](_0x26c1f5);}};}function respondWithFilteredResult(_0x30f191,_0xdbaa8b){return function(_0x35a3fd){if(_0x35a3fd){var _0x2a0c0b=typeof _0xdbaa8b[_0xbaa1('0x1c')]===_0xbaa1('0x1d')&&typeof _0xdbaa8b[_0xbaa1('0x1e')]===_0xbaa1('0x1d');var _0xa9883f=_0x35a3fd[_0xbaa1('0x1f')];var _0x305481=_0x2a0c0b?0x0:_0xdbaa8b[_0xbaa1('0x1c')];var _0x302cd3=_0x2a0c0b?_0x35a3fd['count']:_0xdbaa8b[_0xbaa1('0x1c')]+_0xdbaa8b[_0xbaa1('0x1e')];var _0x20d75f;if(_0x302cd3>=_0xa9883f){_0x302cd3=_0xa9883f;_0x20d75f=0xc8;}else{_0x20d75f=0xce;}_0x30f191[_0xbaa1('0x1a')](_0x20d75f);return _0x30f191[_0xbaa1('0x20')](_0xbaa1('0x21'),_0x305481+'-'+_0x302cd3+'/'+_0xa9883f)['json'](_0x35a3fd);}return null;};}function patchUpdates(_0x1c587c){return function(_0x451255){try{jsonpatch[_0xbaa1('0x22')](_0x451255,_0x1c587c,!![]);}catch(_0x365810){return BPromise[_0xbaa1('0x23')](_0x365810);}return _0x451255['save']();};}function saveUpdates(_0x4e4a0c,_0x2b01ec){return function(_0x24427a){if(_0x24427a){return _0x24427a[_0xbaa1('0x24')](_0x4e4a0c)[_0xbaa1('0x25')](function(_0x117079){return _0x117079;});}return null;};}function removeEntity(_0x113bbd,_0x4806e7){return function(_0x243eeb){if(_0x243eeb){return _0x243eeb[_0xbaa1('0x26')]()[_0xbaa1('0x25')](function(){_0x113bbd[_0xbaa1('0x1a')](0xcc)[_0xbaa1('0x19')]();});}};}function handleEntityNotFound(_0x2a56ad,_0x39e3ce){return function(_0x2d208e){if(!_0x2d208e){_0x2a56ad[_0xbaa1('0x27')](0x194);}return _0x2d208e;};}function handleError(_0x58d85d,_0x2b80a4){_0x2b80a4=_0x2b80a4||0x1f4;return function(_0x29298c){logger[_0xbaa1('0x28')](_0x29298c[_0xbaa1('0x29')]);if(_0x29298c[_0xbaa1('0x2a')]){delete _0x29298c[_0xbaa1('0x2a')];}_0x58d85d['status'](_0x2b80a4)['send'](_0x29298c);};}exports[_0xbaa1('0x2b')]=function(_0x1e1869,_0x270759){var _0x48cbc0={},_0xf3ff18={},_0x45c184={'count':0x0,'rows':[]};var _0x4f3e27=_[_0xbaa1('0x2c')](db['FreshdeskAccount'][_0xbaa1('0x2d')],function(_0x3670bd){return{'name':_0x3670bd[_0xbaa1('0x2e')],'type':_0x3670bd['type']['key']};});_0xf3ff18[_0xbaa1('0x2f')]=_[_0xbaa1('0x2c')](_0x4f3e27,_0xbaa1('0x2a'));_0xf3ff18[_0xbaa1('0x30')]=_[_0xbaa1('0x31')](_0x1e1869[_0xbaa1('0x30')]);_0xf3ff18['filters']=_[_0xbaa1('0x32')](_0xf3ff18[_0xbaa1('0x2f')],_0xf3ff18[_0xbaa1('0x30')]);_0x48cbc0[_0xbaa1('0x33')]=_['intersection'](_0xf3ff18[_0xbaa1('0x2f')],qs['fields'](_0x1e1869[_0xbaa1('0x30')][_0xbaa1('0x34')]));_0x48cbc0[_0xbaa1('0x33')]=_0x48cbc0[_0xbaa1('0x33')]['length']?_0x48cbc0[_0xbaa1('0x33')]:_0xf3ff18[_0xbaa1('0x2f')];if(!_0x1e1869[_0xbaa1('0x30')]['hasOwnProperty'](_0xbaa1('0x35'))){_0x48cbc0[_0xbaa1('0x1e')]=qs['limit'](_0x1e1869[_0xbaa1('0x30')][_0xbaa1('0x1e')]);_0x48cbc0[_0xbaa1('0x1c')]=qs['offset'](_0x1e1869[_0xbaa1('0x30')]['offset']);}_0x48cbc0['order']=qs[_0xbaa1('0x36')](_0x1e1869['query'][_0xbaa1('0x36')]);_0x48cbc0[_0xbaa1('0x37')]=qs[_0xbaa1('0x38')](_['pick'](_0x1e1869[_0xbaa1('0x30')],_0xf3ff18[_0xbaa1('0x38')]),_0x4f3e27);if(_0x1e1869['query'][_0xbaa1('0x39')]){_0x48cbc0[_0xbaa1('0x37')]=_[_0xbaa1('0x3a')](_0x48cbc0[_0xbaa1('0x37')],{'$or':_[_0xbaa1('0x2c')](_0x4f3e27,function(_0x35b873){if(_0x35b873[_0xbaa1('0x3b')]!==_0xbaa1('0x3c')){var _0x47c998={};_0x47c998[_0x35b873[_0xbaa1('0x2a')]]={'$like':'%'+_0x1e1869['query'][_0xbaa1('0x39')]+'%'};return _0x47c998;}})});}_0x48cbc0=_[_0xbaa1('0x3a')]({},_0x48cbc0,_0x1e1869[_0xbaa1('0x3d')]);var _0x4c1bfe={'where':_0x48cbc0[_0xbaa1('0x37')]};return db['FreshdeskAccount']['count'](_0x4c1bfe)[_0xbaa1('0x25')](function(_0x5245a9){_0x45c184[_0xbaa1('0x1f')]=_0x5245a9;if(_0x1e1869['query']['includeAll']){_0x48cbc0[_0xbaa1('0x3e')]=[{'all':!![]}];}return db[_0xbaa1('0x3f')][_0xbaa1('0x40')](_0x48cbc0);})[_0xbaa1('0x25')](function(_0x2c0984){_0x45c184[_0xbaa1('0x41')]=_0x2c0984;return _0x45c184;})[_0xbaa1('0x25')](respondWithFilteredResult(_0x270759,_0x48cbc0))[_0xbaa1('0x42')](handleError(_0x270759,null));};exports[_0xbaa1('0x43')]=function(_0x36b72b,_0x148792){var _0xc59188={'raw':![],'where':{'id':_0x36b72b[_0xbaa1('0x44')]['id']}},_0x163605={};_0x163605['model']=_['keys'](db[_0xbaa1('0x3f')][_0xbaa1('0x2d')]);_0x163605[_0xbaa1('0x30')]=_[_0xbaa1('0x31')](_0x36b72b[_0xbaa1('0x30')]);_0x163605[_0xbaa1('0x38')]=_[_0xbaa1('0x32')](_0x163605[_0xbaa1('0x2f')],_0x163605['query']);_0xc59188[_0xbaa1('0x33')]=_[_0xbaa1('0x32')](_0x163605[_0xbaa1('0x2f')],qs[_0xbaa1('0x34')](_0x36b72b[_0xbaa1('0x30')][_0xbaa1('0x34')]));_0xc59188['attributes']=_0xc59188['attributes'][_0xbaa1('0x45')]?_0xc59188['attributes']:_0x163605[_0xbaa1('0x2f')];if(_0x36b72b[_0xbaa1('0x30')][_0xbaa1('0x46')]){_0xc59188['include']=[{'all':!![]}];}_0xc59188=_[_0xbaa1('0x3a')]({},_0xc59188,_0x36b72b[_0xbaa1('0x3d')]);return db[_0xbaa1('0x3f')][_0xbaa1('0x47')](_0xc59188)[_0xbaa1('0x25')](handleEntityNotFound(_0x148792,null))['then'](respondWithResult(_0x148792,null))['catch'](handleError(_0x148792,null));};exports[_0xbaa1('0x48')]=function(_0x2627ae,_0x3bad61){return db[_0xbaa1('0x3f')][_0xbaa1('0x48')](_0x2627ae[_0xbaa1('0x49')],{})[_0xbaa1('0x25')](respondWithResult(_0x3bad61,0xc9))[_0xbaa1('0x42')](handleError(_0x3bad61,null));};exports[_0xbaa1('0x24')]=function(_0x19c7f5,_0x471173){if(_0x19c7f5['body']['id']){delete _0x19c7f5[_0xbaa1('0x49')]['id'];}return db[_0xbaa1('0x3f')][_0xbaa1('0x47')]({'where':{'id':_0x19c7f5[_0xbaa1('0x44')]['id']}})[_0xbaa1('0x25')](handleEntityNotFound(_0x471173,null))[_0xbaa1('0x25')](saveUpdates(_0x19c7f5[_0xbaa1('0x49')],null))['then'](respondWithResult(_0x471173,null))[_0xbaa1('0x42')](handleError(_0x471173,null));};exports[_0xbaa1('0x26')]=function(_0x56aeda,_0x18e207){return db[_0xbaa1('0x3f')][_0xbaa1('0x47')]({'where':{'id':_0x56aeda[_0xbaa1('0x44')]['id']}})['then'](handleEntityNotFound(_0x18e207,null))[_0xbaa1('0x25')](removeEntity(_0x18e207,null))['catch'](handleError(_0x18e207,null));};exports[_0xbaa1('0x4a')]=function(_0x166e2a,_0x5afdab,_0x1410bb){var _0x4dbb48={};var _0x42e38e={};var _0x109b08;var _0x176ce2;return db[_0xbaa1('0x3f')][_0xbaa1('0x4b')]({'where':{'id':_0x166e2a[_0xbaa1('0x44')]['id']}})[_0xbaa1('0x25')](handleEntityNotFound(_0x5afdab,null))[_0xbaa1('0x25')](function(_0x5018e2){if(_0x5018e2){_0x109b08=_0x5018e2;_0x42e38e[_0xbaa1('0x2f')]=_[_0xbaa1('0x31')](db[_0xbaa1('0x4c')][_0xbaa1('0x2d')]);_0x42e38e[_0xbaa1('0x30')]=_[_0xbaa1('0x31')](_0x166e2a[_0xbaa1('0x30')]);_0x42e38e['filters']=_['intersection'](_0x42e38e[_0xbaa1('0x2f')],_0x42e38e[_0xbaa1('0x30')]);_0x4dbb48['attributes']=_[_0xbaa1('0x32')](_0x42e38e[_0xbaa1('0x2f')],qs[_0xbaa1('0x34')](_0x166e2a['query'][_0xbaa1('0x34')]));_0x4dbb48[_0xbaa1('0x33')]=_0x4dbb48[_0xbaa1('0x33')][_0xbaa1('0x45')]?_0x4dbb48[_0xbaa1('0x33')]:_0x42e38e[_0xbaa1('0x2f')];_0x4dbb48['order']=qs[_0xbaa1('0x36')](_0x166e2a[_0xbaa1('0x30')]['sort']);_0x4dbb48['where']=qs[_0xbaa1('0x38')](_['pick'](_0x166e2a[_0xbaa1('0x30')],_0x42e38e[_0xbaa1('0x38')]));if(_0x166e2a[_0xbaa1('0x30')]['filter']){_0x4dbb48[_0xbaa1('0x37')]=_[_0xbaa1('0x3a')](_0x4dbb48[_0xbaa1('0x37')],{'$or':_[_0xbaa1('0x2c')](_0x4dbb48['attributes'],function(_0x20b61f){var _0x206dd6={};_0x206dd6[_0x20b61f]={'$like':'%'+_0x166e2a[_0xbaa1('0x30')][_0xbaa1('0x39')]+'%'};return _0x206dd6;})});}_0x4dbb48=_[_0xbaa1('0x3a')]({},_0x4dbb48,_0x166e2a[_0xbaa1('0x3d')]);return _0x109b08[_0xbaa1('0x4a')](_0x4dbb48);}})[_0xbaa1('0x25')](function(_0x2200e0){if(_0x2200e0){_0x176ce2=_0x2200e0[_0xbaa1('0x45')];if(!_0x166e2a[_0xbaa1('0x30')][_0xbaa1('0x4d')](_0xbaa1('0x35'))){_0x4dbb48['limit']=qs[_0xbaa1('0x1e')](_0x166e2a[_0xbaa1('0x30')][_0xbaa1('0x1e')]);_0x4dbb48['offset']=qs[_0xbaa1('0x1c')](_0x166e2a[_0xbaa1('0x30')][_0xbaa1('0x1c')]);}return _0x109b08[_0xbaa1('0x4a')](_0x4dbb48);}})[_0xbaa1('0x25')](function(_0x3fb861){if(_0x3fb861){return _0x3fb861?{'count':_0x176ce2,'rows':_0x3fb861}:null;}})[_0xbaa1('0x25')](respondWithResult(_0x5afdab,null))[_0xbaa1('0x42')](handleError(_0x5afdab,null));};exports[_0xbaa1('0x4e')]=function(_0x415535,_0x3b16da,_0x2bdcaa){if(_0x415535[_0xbaa1('0x49')]['id']){delete _0x415535['body']['id'];}return db['FreshdeskAccount'][_0xbaa1('0x4b')]({'where':{'id':_0x415535[_0xbaa1('0x44')]['id']}})[_0xbaa1('0x25')](handleEntityNotFound(_0x3b16da,null))[_0xbaa1('0x25')](function(_0x296d32){if(_0x296d32){_0x415535[_0xbaa1('0x49')]['AccountId']=_0x296d32['id'];_0x415535[_0xbaa1('0x49')][_0xbaa1('0x4f')]=integrations['getSubjects'](_0x415535['body']['channel'],_0x415535[_0xbaa1('0x49')]['type']);_0x415535[_0xbaa1('0x49')]['Descriptions']=integrations[_0xbaa1('0x50')](_0x415535[_0xbaa1('0x49')][_0xbaa1('0x51')],_0x415535[_0xbaa1('0x49')]['type']);return db[_0xbaa1('0x4c')]['create'](_0x415535[_0xbaa1('0x49')],{'include':[{'model':db[_0xbaa1('0x52')],'as':_0xbaa1('0x4f')},{'model':db[_0xbaa1('0x52')],'as':_0xbaa1('0x53')}]});}return null;})[_0xbaa1('0x25')](respondWithResult(_0x3b16da,null))['catch'](handleError(_0x3b16da,null));};exports[_0xbaa1('0x54')]=function(_0x5c1e78,_0x438bd6,_0xa9a5f4){var _0x48a591='';return db['FreshdeskAccount'][_0xbaa1('0x4b')]({'where':{'id':_0x5c1e78[_0xbaa1('0x44')]['id']},'attributes':['id','remoteUri',_0xbaa1('0x55')]})['then'](handleEntityNotFound(_0x438bd6,null))['then'](function(_0x363c2b){if(_0x363c2b){_0x48a591=_0x363c2b[_0xbaa1('0x56')];var _0x13cb7b=_0x48a591[_0xbaa1('0x57')](-0x1);if(_0x13cb7b==='/'){_0x48a591=_0x48a591['substring'](0x0,_0x48a591['lastIndexOf'](_0x13cb7b));}return rp({'method':_0xbaa1('0x58'),'uri':util['format'](_0xbaa1('0x59'),_0x48a591,_0xbaa1('0x5a')),'headers':{'Authorization':util['format'](_0xbaa1('0x5b'),new Buffer(util[_0xbaa1('0x5c')](_0xbaa1('0x5d'),_0x363c2b[_0xbaa1('0x55')]))[_0xbaa1('0x5e')]('base64'))},'json':!![]});}})[_0xbaa1('0x25')](function(_0x57455d){if(_0x57455d){var _0xb98816=[_0xbaa1('0x5f'),_0xbaa1('0x60'),_0xbaa1('0x61'),'description',_0xbaa1('0x1a'),_0xbaa1('0x62'),_0xbaa1('0x63'),'source',_0xbaa1('0x64'),_0xbaa1('0x63'),_0xbaa1('0x65')];_[_0xbaa1('0x66')](_0x57455d,function(_0x18b948){return _0xb98816['includes'](_0x18b948['name'])||!_0x18b948[_0xbaa1('0x67')]&&_0x18b948[_0xbaa1('0x3b')]!=='custom_text'&&_0x18b948[_0xbaa1('0x3b')]!==_0xbaa1('0x68');});return{'count':_0x57455d['length'],'rows':_['map'](_0x57455d,function(_0x1ff633){return{'id':_0x1ff633[_0xbaa1('0x2a')],'name':_0x1ff633['label'],'custom':!_0x1ff633[_0xbaa1('0x67')],'options':_0x1ff633[_0xbaa1('0x69')]?_['map'](_0x1ff633['choices'],function(_0x154f8e){return{'name':_[_0xbaa1('0x6a')](_0x154f8e),'value':_0x154f8e};}):[]};})};}})[_0xbaa1('0x25')](respondWithResult(_0x438bd6,null))[_0xbaa1('0x42')](function(_0xea66ab){var _0x41acc3=_0x5c1e78['query']['test']?0x1f4:_0xea66ab['statusCode']||0x1f4;logger[_0xbaa1('0x28')](_0xbaa1('0x6b'),_0xbaa1('0x54'),_0x41acc3,JSON[_0xbaa1('0x6c')](_0xea66ab));delete _0xea66ab[_0xbaa1('0x2a')];if(_0x41acc3===0x191){_0x41acc3=0x190;}_0x438bd6['status'](_0x41acc3)[_0xbaa1('0x6d')](_0x5c1e78[_0xbaa1('0x30')][_0xbaa1('0x6e')]?{'message':_0xbaa1('0x6f'),'statusCode':_0xea66ab[_0xbaa1('0x70')]}:_0xea66ab);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 16e673d..fba1c07 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 _0x5a6f=['rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','lodash','../../config/logger','api','request-promise'];(function(_0x933b98,_0xa0fc6a){var _0x5cd1f9=function(_0x20e030){while(--_0x20e030){_0x933b98['push'](_0x933b98['shift']());}};_0x5cd1f9(++_0xa0fc6a);}(_0x5a6f,0x94));var _0xf5a6=function(_0x10b4d3,_0x12e69b){_0x10b4d3=_0x10b4d3-0x0;var _0x12615b=_0x5a6f[_0x10b4d3];return _0x12615b;};'use strict';var _=require(_0xf5a6('0x0'));var util=require('util');var logger=require(_0xf5a6('0x1'))(_0xf5a6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf5a6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5a6('0x4'));var config=require('../../config/environment');var attributes=require(_0xf5a6('0x5'));var integrations=require(_0xf5a6('0x6'));module[_0xf5a6('0x7')]=function(_0x22ec0a,_0x466848){return _0x22ec0a['define']('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef88=['path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xef88,0x8a));var _0x8ef8=function(_0x142a02,_0x1a6523){_0x142a02=_0x142a02-0x0;var _0x59a00f=_0xef88[_0x142a02];return _0x59a00f;};'use strict';var _=require(_0x8ef8('0x0'));var util=require('util');var logger=require(_0x8ef8('0x1'))(_0x8ef8('0x2'));var moment=require(_0x8ef8('0x3'));var BPromise=require(_0x8ef8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ef8('0x5'));var rimraf=require('rimraf');var config=require(_0x8ef8('0x6'));var attributes=require(_0x8ef8('0x7'));var integrations=require(_0x8ef8('0x8'));module[_0x8ef8('0x9')]=function(_0x15adb4,_0x5a53d3){return _0x15adb4[_0x8ef8('0xa')](_0x8ef8('0xb'),attributes,{'tableName':_0x8ef8('0xc'),'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 144f5c1..82ba99f 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 _0x4a2e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','limit','include','map','model','debug','ShowFreshdeskAccount','find','lodash'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x4a2e,0x87));var _0xe4a2=function(_0x20ba6d,_0x256177){_0x20ba6d=_0x20ba6d-0x0;var _0x338188=_0x4a2e[_0x20ba6d];return _0x338188;};'use strict';var _=require(_0xe4a2('0x0'));var util=require(_0xe4a2('0x1'));var moment=require(_0xe4a2('0x2'));var BPromise=require(_0xe4a2('0x3'));var rs=require(_0xe4a2('0x4'));var fs=require('fs');var Redis=require(_0xe4a2('0x5'));var db=require(_0xe4a2('0x6'))['db'];var utils=require(_0xe4a2('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe4a2('0x8')][_0xe4a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59887b,_0x3e95a7,_0x19c5d9){return new BPromise(function(_0x48eca6,_0x2b6e83){return client[_0xe4a2('0xa')](_0x59887b,_0x19c5d9)[_0xe4a2('0xb')](function(_0x24d4fd){logger[_0xe4a2('0xc')](_0xe4a2('0xd'),_0x3e95a7,_0xe4a2('0xe'));logger['debug'](_0xe4a2('0xf'),_0x3e95a7,'request\x20sent',JSON[_0xe4a2('0x10')](_0x24d4fd));if(_0x24d4fd[_0xe4a2('0x11')]){if(_0x24d4fd['error']['code']===0x1f4){logger['error'](_0xe4a2('0xd'),_0x3e95a7,_0x24d4fd[_0xe4a2('0x11')]['message']);return _0x2b6e83(_0x24d4fd[_0xe4a2('0x11')][_0xe4a2('0x12')]);}logger[_0xe4a2('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x3e95a7,_0x24d4fd[_0xe4a2('0x11')]['message']);return _0x48eca6(_0x24d4fd['error']['message']);}else{logger[_0xe4a2('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x3e95a7,_0xe4a2('0xe'));_0x48eca6(_0x24d4fd[_0xe4a2('0x13')][_0xe4a2('0x12')]);}})[_0xe4a2('0x14')](function(_0x3e3601){logger[_0xe4a2('0x11')](_0xe4a2('0xd'),_0x3e95a7,_0x3e3601);_0x2b6e83(_0x3e3601);});});}exports[_0xe4a2('0x15')]=function(_0x47d8b0){var _0x40f6bb=this;return new Promise(function(_0x20ab53,_0x942195){return db[_0xe4a2('0x16')]['findAll']({'raw':_0x47d8b0[_0xe4a2('0x17')]?_0x47d8b0[_0xe4a2('0x17')][_0xe4a2('0x18')]===undefined?!![]:![]:!![],'where':_0x47d8b0[_0xe4a2('0x17')]?_0x47d8b0[_0xe4a2('0x17')][_0xe4a2('0x19')]||null:null,'attributes':_0x47d8b0['options']?_0x47d8b0['options'][_0xe4a2('0x1a')]||null:null,'limit':_0x47d8b0['options']?_0x47d8b0[_0xe4a2('0x17')][_0xe4a2('0x1b')]||null:null,'include':_0x47d8b0[_0xe4a2('0x17')]?_0x47d8b0['options'][_0xe4a2('0x1c')]?_[_0xe4a2('0x1d')](_0x47d8b0[_0xe4a2('0x17')][_0xe4a2('0x1c')],function(_0x4ed5c0){return{'model':db[_0x4ed5c0[_0xe4a2('0x1e')]],'as':_0x4ed5c0['as'],'attributes':_0x4ed5c0[_0xe4a2('0x1a')],'include':_0x4ed5c0[_0xe4a2('0x1c')]?_[_0xe4a2('0x1d')](_0x4ed5c0[_0xe4a2('0x1c')],function(_0x40635f){return{'model':db[_0x40635f[_0xe4a2('0x1e')]],'as':_0x40635f['as'],'attributes':_0x40635f[_0xe4a2('0x1a')],'include':_0x40635f['include']?_[_0xe4a2('0x1d')](_0x40635f[_0xe4a2('0x1c')],function(_0x23995d){return{'model':db[_0x23995d[_0xe4a2('0x1e')]],'as':_0x23995d['as'],'attributes':_0x23995d[_0xe4a2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe4a2('0xb')](function(_0x51bbf4){logger[_0xe4a2('0xc')](_0xe4a2('0x15'),_0x47d8b0);logger[_0xe4a2('0x1f')](_0xe4a2('0x15'),_0x47d8b0,JSON[_0xe4a2('0x10')](_0x51bbf4));_0x20ab53(_0x51bbf4);})['catch'](function(_0x4f2d1e){logger[_0xe4a2('0x11')]('GetFreshdeskAccount',_0x4f2d1e['message'],_0x47d8b0);_0x942195(_0x40f6bb['error'](0x1f4,_0x4f2d1e[_0xe4a2('0x12')]));});});};exports[_0xe4a2('0x20')]=function(_0x28b06c){var _0x4f22fe=this;return new Promise(function(_0x380772,_0x22d185){return db[_0xe4a2('0x16')][_0xe4a2('0x21')]({'raw':_0x28b06c['options']?_0x28b06c[_0xe4a2('0x17')][_0xe4a2('0x18')]===undefined?!![]:![]:!![],'where':_0x28b06c[_0xe4a2('0x17')]?_0x28b06c[_0xe4a2('0x17')][_0xe4a2('0x19')]||null:null,'attributes':_0x28b06c[_0xe4a2('0x17')]?_0x28b06c['options'][_0xe4a2('0x1a')]||null:null,'include':_0x28b06c[_0xe4a2('0x17')]?_0x28b06c[_0xe4a2('0x17')]['include']?_['map'](_0x28b06c[_0xe4a2('0x17')][_0xe4a2('0x1c')],function(_0x42c2e7){return{'model':db[_0x42c2e7['model']],'as':_0x42c2e7['as'],'attributes':_0x42c2e7[_0xe4a2('0x1a')],'include':_0x42c2e7[_0xe4a2('0x1c')]?_[_0xe4a2('0x1d')](_0x42c2e7[_0xe4a2('0x1c')],function(_0x3a8f99){return{'model':db[_0x3a8f99[_0xe4a2('0x1e')]],'as':_0x3a8f99['as'],'attributes':_0x3a8f99['attributes'],'include':_0x3a8f99[_0xe4a2('0x1c')]?_[_0xe4a2('0x1d')](_0x3a8f99[_0xe4a2('0x1c')],function(_0x11b893){return{'model':db[_0x11b893[_0xe4a2('0x1e')]],'as':_0x11b893['as'],'attributes':_0x11b893['attributes']};}):[]};}):[]};}):[]:[]})[_0xe4a2('0xb')](function(_0x37db6c){logger[_0xe4a2('0xc')](_0xe4a2('0x20'),_0x28b06c);logger['debug']('ShowFreshdeskAccount',_0x28b06c,JSON[_0xe4a2('0x10')](_0x37db6c));_0x380772(_0x37db6c);})[_0xe4a2('0x14')](function(_0x4b134c){logger[_0xe4a2('0x11')](_0xe4a2('0x20'),_0x4b134c[_0xe4a2('0x12')],_0x28b06c);_0x22d185(_0x4f22fe['error'](0x1f4,_0x4b134c[_0xe4a2('0x12')]));});});}; \ No newline at end of file +var _0x77e3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','model','map','find','raw','ShowFreshdeskAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x13e1b1,_0x130fdd){var _0x4a77af=function(_0x5dfc30){while(--_0x5dfc30){_0x13e1b1['push'](_0x13e1b1['shift']());}};_0x4a77af(++_0x130fdd);}(_0x77e3,0x1db));var _0x377e=function(_0x3a4e6a,_0x38d800){_0x3a4e6a=_0x3a4e6a-0x0;var _0x5dc014=_0x77e3[_0x3a4e6a];return _0x5dc014;};'use strict';var _=require(_0x377e('0x0'));var util=require('util');var moment=require(_0x377e('0x1'));var BPromise=require(_0x377e('0x2'));var rs=require(_0x377e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x377e('0x4'))['db'];var utils=require(_0x377e('0x5'));var logger=require(_0x377e('0x6'))(_0x377e('0x7'));var config=require(_0x377e('0x8'));var jayson=require(_0x377e('0x9'));var client=jayson[_0x377e('0xa')][_0x377e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x394c3b,_0x1f28aa,_0x357a8e){return new BPromise(function(_0x57236b,_0x264912){return client[_0x377e('0xc')](_0x394c3b,_0x357a8e)[_0x377e('0xd')](function(_0x37753c){logger[_0x377e('0xe')](_0x377e('0xf'),_0x1f28aa,_0x377e('0x10'));logger[_0x377e('0x11')](_0x377e('0x12'),_0x1f28aa,_0x377e('0x10'),JSON[_0x377e('0x13')](_0x37753c));if(_0x37753c[_0x377e('0x14')]){if(_0x37753c[_0x377e('0x14')][_0x377e('0x15')]===0x1f4){logger[_0x377e('0x14')](_0x377e('0xf'),_0x1f28aa,_0x37753c['error'][_0x377e('0x16')]);return _0x264912(_0x37753c[_0x377e('0x14')][_0x377e('0x16')]);}logger[_0x377e('0x14')](_0x377e('0xf'),_0x1f28aa,_0x37753c['error'][_0x377e('0x16')]);return _0x57236b(_0x37753c[_0x377e('0x14')][_0x377e('0x16')]);}else{logger[_0x377e('0xe')](_0x377e('0xf'),_0x1f28aa,'request\x20sent');_0x57236b(_0x37753c['result'][_0x377e('0x16')]);}})[_0x377e('0x17')](function(_0x45681c){logger[_0x377e('0x14')](_0x377e('0xf'),_0x1f28aa,_0x45681c);_0x264912(_0x45681c);});});}exports[_0x377e('0x18')]=function(_0x49e33c){var _0x272eed=this;return new Promise(function(_0x2a06cd,_0x3c8f9b){return db[_0x377e('0x19')][_0x377e('0x1a')]({'raw':_0x49e33c[_0x377e('0x1b')]?_0x49e33c[_0x377e('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x49e33c[_0x377e('0x1b')]?_0x49e33c[_0x377e('0x1b')][_0x377e('0x1c')]||null:null,'attributes':_0x49e33c[_0x377e('0x1b')]?_0x49e33c['options'][_0x377e('0x1d')]||null:null,'limit':_0x49e33c[_0x377e('0x1b')]?_0x49e33c[_0x377e('0x1b')][_0x377e('0x1e')]||null:null,'include':_0x49e33c[_0x377e('0x1b')]?_0x49e33c[_0x377e('0x1b')][_0x377e('0x1f')]?_['map'](_0x49e33c['options'][_0x377e('0x1f')],function(_0x18b186){return{'model':db[_0x18b186[_0x377e('0x20')]],'as':_0x18b186['as'],'attributes':_0x18b186['attributes'],'include':_0x18b186[_0x377e('0x1f')]?_[_0x377e('0x21')](_0x18b186['include'],function(_0x208643){return{'model':db[_0x208643[_0x377e('0x20')]],'as':_0x208643['as'],'attributes':_0x208643[_0x377e('0x1d')],'include':_0x208643[_0x377e('0x1f')]?_[_0x377e('0x21')](_0x208643[_0x377e('0x1f')],function(_0x11bd68){return{'model':db[_0x11bd68[_0x377e('0x20')]],'as':_0x11bd68['as'],'attributes':_0x11bd68['attributes']};}):[]};}):[]};}):[]:[]})[_0x377e('0xd')](function(_0x3146d4){logger[_0x377e('0xe')](_0x377e('0x18'),_0x49e33c);logger['debug'](_0x377e('0x18'),_0x49e33c,JSON[_0x377e('0x13')](_0x3146d4));_0x2a06cd(_0x3146d4);})[_0x377e('0x17')](function(_0x2b75d7){logger['error'](_0x377e('0x18'),_0x2b75d7[_0x377e('0x16')],_0x49e33c);_0x3c8f9b(_0x272eed[_0x377e('0x14')](0x1f4,_0x2b75d7['message']));});});};exports['ShowFreshdeskAccount']=function(_0x32914f){var _0x42ac34=this;return new Promise(function(_0x45fa35,_0xe530a8){return db[_0x377e('0x19')][_0x377e('0x22')]({'raw':_0x32914f[_0x377e('0x1b')]?_0x32914f[_0x377e('0x1b')][_0x377e('0x23')]===undefined?!![]:![]:!![],'where':_0x32914f['options']?_0x32914f[_0x377e('0x1b')][_0x377e('0x1c')]||null:null,'attributes':_0x32914f['options']?_0x32914f[_0x377e('0x1b')][_0x377e('0x1d')]||null:null,'include':_0x32914f[_0x377e('0x1b')]?_0x32914f[_0x377e('0x1b')]['include']?_[_0x377e('0x21')](_0x32914f[_0x377e('0x1b')]['include'],function(_0x258e16){return{'model':db[_0x258e16[_0x377e('0x20')]],'as':_0x258e16['as'],'attributes':_0x258e16[_0x377e('0x1d')],'include':_0x258e16[_0x377e('0x1f')]?_['map'](_0x258e16['include'],function(_0x55c0a0){return{'model':db[_0x55c0a0[_0x377e('0x20')]],'as':_0x55c0a0['as'],'attributes':_0x55c0a0[_0x377e('0x1d')],'include':_0x55c0a0[_0x377e('0x1f')]?_['map'](_0x55c0a0[_0x377e('0x1f')],function(_0x585ae2){return{'model':db[_0x585ae2[_0x377e('0x20')]],'as':_0x585ae2['as'],'attributes':_0x585ae2['attributes']};}):[]};}):[]};}):[]:[]})[_0x377e('0xd')](function(_0xf34096){logger['info'](_0x377e('0x24'),_0x32914f);logger[_0x377e('0x11')](_0x377e('0x24'),_0x32914f,JSON['stringify'](_0xf34096));_0x45fa35(_0xf34096);})[_0x377e('0x17')](function(_0x333e75){logger['error'](_0x377e('0x24'),_0x333e75[_0x377e('0x16')],_0x32914f);_0xe530a8(_0x42ac34['error'](0x1f4,_0x333e75['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index a6c892c..27cf6af 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 _0x1c87=['index','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1c87,0x125));var _0x71c8=function(_0x1b662a,_0x52cbd7){_0x1b662a=_0x1b662a-0x0;var _0x1e5118=_0x1c87[_0x1b662a];return _0x1e5118;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x71c8('0x0'));var express=require(_0x71c8('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x71c8('0x2'));var interaction=require(_0x71c8('0x3'));var config=require(_0x71c8('0x4'));var controller=require(_0x71c8('0x5'));router[_0x71c8('0x6')]('/',auth['isAuthenticated'](),controller[_0x71c8('0x7')]);router[_0x71c8('0x6')](_0x71c8('0x8'),auth[_0x71c8('0x9')](),controller[_0x71c8('0xa')]);router[_0x71c8('0x6')](_0x71c8('0xb'),auth[_0x71c8('0x9')](),controller[_0x71c8('0xc')]);router['get']('/:id/subjects',auth[_0x71c8('0x9')](),controller[_0x71c8('0xd')]);router[_0x71c8('0x6')](_0x71c8('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x71c8('0x9')](),controller[_0x71c8('0xf')]);router[_0x71c8('0x10')]('/',auth[_0x71c8('0x9')](),controller[_0x71c8('0x11')]);router['post'](_0x71c8('0x12'),auth[_0x71c8('0x9')](),controller[_0x71c8('0x13')]);router[_0x71c8('0x14')]('/:id',auth[_0x71c8('0x9')](),controller[_0x71c8('0x15')]);router[_0x71c8('0x16')](_0x71c8('0x8'),auth['isAuthenticated'](),controller[_0x71c8('0x17')]);module[_0x71c8('0x18')]=router; \ No newline at end of file +var _0xee87=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x49c3ce,_0x565806){var _0x5be1af=function(_0x13061b){while(--_0x13061b){_0x49c3ce['push'](_0x49c3ce['shift']());}};_0x5be1af(++_0x565806);}(_0xee87,0x153));var _0x7ee8=function(_0x1e6e65,_0x26096b){_0x1e6e65=_0x1e6e65-0x0;var _0x558033=_0xee87[_0x1e6e65];return _0x558033;};'use strict';var multer=require('multer');var util=require(_0x7ee8('0x0'));var path=require(_0x7ee8('0x1'));var timeout=require(_0x7ee8('0x2'));var express=require(_0x7ee8('0x3'));var router=express[_0x7ee8('0x4')]();var fs_extra=require(_0x7ee8('0x5'));var auth=require(_0x7ee8('0x6'));var interaction=require(_0x7ee8('0x7'));var config=require(_0x7ee8('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x7ee8('0x9')]('/',auth[_0x7ee8('0xa')](),controller['index']);router[_0x7ee8('0x9')](_0x7ee8('0xb'),auth[_0x7ee8('0xa')](),controller[_0x7ee8('0xc')]);router[_0x7ee8('0x9')](_0x7ee8('0xd'),auth[_0x7ee8('0xa')](),controller[_0x7ee8('0xe')]);router[_0x7ee8('0x9')]('/:id/subjects',auth[_0x7ee8('0xa')](),controller[_0x7ee8('0xf')]);router['get'](_0x7ee8('0x10'),auth[_0x7ee8('0xa')](),controller[_0x7ee8('0x11')]);router[_0x7ee8('0x9')](_0x7ee8('0x12'),auth[_0x7ee8('0xa')](),controller['getTags']);router[_0x7ee8('0x13')]('/',auth[_0x7ee8('0xa')](),controller[_0x7ee8('0x14')]);router[_0x7ee8('0x13')](_0x7ee8('0x12'),auth[_0x7ee8('0xa')](),controller['setTags']);router[_0x7ee8('0x15')](_0x7ee8('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7ee8('0xb'),auth[_0x7ee8('0xa')](),controller['destroy']);module[_0x7ee8('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index e74965d..38f6b67 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 _0x003a=['sequelize','exports'];(function(_0x4b4aa6,_0x22d61c){var _0x27dae1=function(_0x56b3ba){while(--_0x56b3ba){_0x4b4aa6['push'](_0x4b4aa6['shift']());}};_0x27dae1(++_0x22d61c);}(_0x003a,0x148));var _0xa003=function(_0x1f0067,_0x47dfbb){_0x1f0067=_0x1f0067-0x0;var _0x329ec3=_0x003a[_0x1f0067];return _0x329ec3;};'use strict';var Sequelize=require(_0xa003('0x0'));module[_0xa003('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x48a9=['STRING','sequelize','exports'];(function(_0x3ee7ea,_0x34c32f){var _0x3259e0=function(_0x45bad4){while(--_0x45bad4){_0x3ee7ea['push'](_0x3ee7ea['shift']());}};_0x3259e0(++_0x34c32f);}(_0x48a9,0x91));var _0x948a=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x48a9[_0x381589];return _0x2a075d;};'use strict';var Sequelize=require(_0x948a('0x0'));module[_0x948a('0x1')]={'name':{'type':Sequelize[_0x948a('0x2')]},'description':{'type':Sequelize[_0x948a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 9e7640d..7bf911c 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 _0x7ca7=['json','offset','undefined','limit','count','Content-Range','save','then','destroy','error','stack','name','index','FreshdeskConfiguration','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','order','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x32bb6b,_0x1a5fbe){var _0x58dcb4=function(_0x402ee2){while(--_0x402ee2){_0x32bb6b['push'](_0x32bb6b['shift']());}};_0x58dcb4(++_0x1a5fbe);}(_0x7ca7,0x1e5));var _0x77ca=function(_0x17bb31,_0x2fc6f8){_0x17bb31=_0x17bb31-0x0;var _0x505c71=_0x7ca7[_0x17bb31];return _0x505c71;};'use strict';var emlformat=require(_0x77ca('0x0'));var rimraf=require(_0x77ca('0x1'));var zipdir=require(_0x77ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x77ca('0x3'));var moment=require(_0x77ca('0x4'));var BPromise=require(_0x77ca('0x5'));var Mustache=require(_0x77ca('0x6'));var util=require(_0x77ca('0x7'));var path=require(_0x77ca('0x8'));var sox=require(_0x77ca('0x9'));var csv=require(_0x77ca('0xa'));var ejs=require(_0x77ca('0xb'));var fs=require('fs');var fs_extra=require(_0x77ca('0xc'));var _=require(_0x77ca('0xd'));var squel=require(_0x77ca('0xe'));var crypto=require(_0x77ca('0xf'));var jsforce=require(_0x77ca('0x10'));var deskjs=require(_0x77ca('0x11'));var toCsv=require('to-csv');var querystring=require(_0x77ca('0x12'));var Papa=require(_0x77ca('0x13'));var Redis=require('ioredis');var authService=require(_0x77ca('0x14'));var qs=require(_0x77ca('0x15'));var as=require(_0x77ca('0x16'));var hardwareService=require(_0x77ca('0x17'));var logger=require(_0x77ca('0x18'))('api');var utils=require(_0x77ca('0x19'));var config=require(_0x77ca('0x1a'));var licenseUtil=require(_0x77ca('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d9ff9,_0x410c22){_0x410c22=_0x410c22||0xcc;return function(_0x5b9a84){if(_0x5b9a84){return _0x5d9ff9[_0x77ca('0x1c')](_0x410c22);}return _0x5d9ff9[_0x77ca('0x1d')](_0x410c22)[_0x77ca('0x1e')]();};}function respondWithResult(_0x3c031b,_0x36e6e9){_0x36e6e9=_0x36e6e9||0xc8;return function(_0x196352){if(_0x196352){return _0x3c031b[_0x77ca('0x1d')](_0x36e6e9)[_0x77ca('0x1f')](_0x196352);}};}function respondWithFilteredResult(_0x42ec86,_0x19ffed){return function(_0x5205f4){if(_0x5205f4){var _0x55dfe7=typeof _0x19ffed[_0x77ca('0x20')]===_0x77ca('0x21')&&typeof _0x19ffed[_0x77ca('0x22')]==='undefined';var _0x246e75=_0x5205f4[_0x77ca('0x23')];var _0x50df96=_0x55dfe7?0x0:_0x19ffed['offset'];var _0x2366de=_0x55dfe7?_0x5205f4[_0x77ca('0x23')]:_0x19ffed[_0x77ca('0x20')]+_0x19ffed[_0x77ca('0x22')];var _0x12deaf;if(_0x2366de>=_0x246e75){_0x2366de=_0x246e75;_0x12deaf=0xc8;}else{_0x12deaf=0xce;}_0x42ec86[_0x77ca('0x1d')](_0x12deaf);return _0x42ec86['set'](_0x77ca('0x24'),_0x50df96+'-'+_0x2366de+'/'+_0x246e75)['json'](_0x5205f4);}return null;};}function patchUpdates(_0x278386){return function(_0x302e81){try{jsonpatch['apply'](_0x302e81,_0x278386,!![]);}catch(_0x3d29dd){return BPromise['reject'](_0x3d29dd);}return _0x302e81[_0x77ca('0x25')]();};}function saveUpdates(_0x29b634,_0xa72622){return function(_0x368746){if(_0x368746){return _0x368746['update'](_0x29b634)[_0x77ca('0x26')](function(_0x1a71af){return _0x1a71af;});}return null;};}function removeEntity(_0x3403fc,_0xe9c22e){return function(_0x6ebce1){if(_0x6ebce1){return _0x6ebce1[_0x77ca('0x27')]()['then'](function(){_0x3403fc[_0x77ca('0x1d')](0xcc)[_0x77ca('0x1e')]();});}};}function handleEntityNotFound(_0x32a4b8,_0x5eb459){return function(_0x39b564){if(!_0x39b564){_0x32a4b8[_0x77ca('0x1c')](0x194);}return _0x39b564;};}function handleError(_0x320a64,_0x7cc2d6){_0x7cc2d6=_0x7cc2d6||0x1f4;return function(_0x549182){logger[_0x77ca('0x28')](_0x549182[_0x77ca('0x29')]);if(_0x549182[_0x77ca('0x2a')]){delete _0x549182['name'];}_0x320a64[_0x77ca('0x1d')](_0x7cc2d6)['send'](_0x549182);};}exports[_0x77ca('0x2b')]=function(_0x50d198,_0x58e90c){var _0x1f0574={},_0x5ef00c={},_0x161274={'count':0x0,'rows':[]};var _0x2278c6=_['map'](db[_0x77ca('0x2c')][_0x77ca('0x2d')],function(_0x19aa65){return{'name':_0x19aa65[_0x77ca('0x2e')],'type':_0x19aa65[_0x77ca('0x2f')]['key']};});_0x5ef00c['model']=_[_0x77ca('0x30')](_0x2278c6,_0x77ca('0x2a'));_0x5ef00c['query']=_[_0x77ca('0x31')](_0x50d198[_0x77ca('0x32')]);_0x5ef00c[_0x77ca('0x33')]=_[_0x77ca('0x34')](_0x5ef00c[_0x77ca('0x35')],_0x5ef00c['query']);_0x1f0574['attributes']=_[_0x77ca('0x34')](_0x5ef00c[_0x77ca('0x35')],qs[_0x77ca('0x36')](_0x50d198[_0x77ca('0x32')][_0x77ca('0x36')]));_0x1f0574[_0x77ca('0x37')]=_0x1f0574[_0x77ca('0x37')]['length']?_0x1f0574['attributes']:_0x5ef00c['model'];if(!_0x50d198['query'][_0x77ca('0x38')](_0x77ca('0x39'))){_0x1f0574[_0x77ca('0x22')]=qs[_0x77ca('0x22')](_0x50d198['query'][_0x77ca('0x22')]);_0x1f0574['offset']=qs['offset'](_0x50d198[_0x77ca('0x32')]['offset']);}_0x1f0574['order']=qs[_0x77ca('0x3a')](_0x50d198[_0x77ca('0x32')]['sort']);_0x1f0574[_0x77ca('0x3b')]=qs[_0x77ca('0x33')](_[_0x77ca('0x3c')](_0x50d198[_0x77ca('0x32')],_0x5ef00c[_0x77ca('0x33')]),_0x2278c6);if(_0x50d198[_0x77ca('0x32')][_0x77ca('0x3d')]){_0x1f0574[_0x77ca('0x3b')]=_['merge'](_0x1f0574[_0x77ca('0x3b')],{'$or':_['map'](_0x2278c6,function(_0x3cd9df){if(_0x3cd9df[_0x77ca('0x2f')]!==_0x77ca('0x3e')){var _0x1b5462={};_0x1b5462[_0x3cd9df[_0x77ca('0x2a')]]={'$like':'%'+_0x50d198[_0x77ca('0x32')][_0x77ca('0x3d')]+'%'};return _0x1b5462;}})});}_0x1f0574=_[_0x77ca('0x3f')]({},_0x1f0574,_0x50d198[_0x77ca('0x40')]);var _0x5f2c8f={'where':_0x1f0574[_0x77ca('0x3b')]};return db[_0x77ca('0x2c')][_0x77ca('0x23')](_0x5f2c8f)['then'](function(_0x12b713){_0x161274['count']=_0x12b713;if(_0x50d198[_0x77ca('0x32')][_0x77ca('0x41')]){_0x1f0574[_0x77ca('0x42')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x77ca('0x43')](_0x1f0574);})[_0x77ca('0x26')](function(_0x16eb9d){_0x161274[_0x77ca('0x44')]=_0x16eb9d;return _0x161274;})['then'](respondWithFilteredResult(_0x58e90c,_0x1f0574))[_0x77ca('0x45')](handleError(_0x58e90c,null));};exports[_0x77ca('0x46')]=function(_0x5403b1,_0x2f7d72){var _0x6d80da={'raw':![],'where':{'id':_0x5403b1[_0x77ca('0x47')]['id']}},_0x317088={};_0x317088[_0x77ca('0x35')]=_[_0x77ca('0x31')](db['FreshdeskConfiguration'][_0x77ca('0x2d')]);_0x317088['query']=_[_0x77ca('0x31')](_0x5403b1['query']);_0x317088[_0x77ca('0x33')]=_[_0x77ca('0x34')](_0x317088['model'],_0x317088[_0x77ca('0x32')]);_0x6d80da[_0x77ca('0x37')]=_[_0x77ca('0x34')](_0x317088[_0x77ca('0x35')],qs[_0x77ca('0x36')](_0x5403b1['query'][_0x77ca('0x36')]));_0x6d80da[_0x77ca('0x37')]=_0x6d80da['attributes'][_0x77ca('0x48')]?_0x6d80da['attributes']:_0x317088[_0x77ca('0x35')];if(_0x5403b1[_0x77ca('0x32')][_0x77ca('0x41')]){_0x6d80da[_0x77ca('0x42')]=[{'all':!![]}];}_0x6d80da=_['merge']({},_0x6d80da,_0x5403b1[_0x77ca('0x40')]);return db['FreshdeskConfiguration'][_0x77ca('0x49')](_0x6d80da)['then'](handleEntityNotFound(_0x2f7d72,null))[_0x77ca('0x26')](respondWithResult(_0x2f7d72,null))[_0x77ca('0x45')](handleError(_0x2f7d72,null));};exports[_0x77ca('0x4a')]=function(_0x291ab9,_0x1b3bf7){return db[_0x77ca('0x2c')][_0x77ca('0x4a')](_0x291ab9[_0x77ca('0x4b')],{})[_0x77ca('0x26')](respondWithResult(_0x1b3bf7,0xc9))[_0x77ca('0x45')](handleError(_0x1b3bf7,null));};exports[_0x77ca('0x4c')]=function(_0x96503b,_0x9816d2){if(_0x96503b[_0x77ca('0x4b')]['id']){delete _0x96503b['body']['id'];}return db['FreshdeskConfiguration'][_0x77ca('0x49')]({'where':{'id':_0x96503b['params']['id']}})[_0x77ca('0x26')](handleEntityNotFound(_0x9816d2,null))[_0x77ca('0x26')](saveUpdates(_0x96503b[_0x77ca('0x4b')],null))[_0x77ca('0x26')](respondWithResult(_0x9816d2,null))['catch'](handleError(_0x9816d2,null));};exports['destroy']=function(_0x33570e,_0x182dbc){return db[_0x77ca('0x2c')][_0x77ca('0x49')]({'where':{'id':_0x33570e[_0x77ca('0x47')]['id']}})[_0x77ca('0x26')](handleEntityNotFound(_0x182dbc,null))[_0x77ca('0x26')](removeEntity(_0x182dbc,null))[_0x77ca('0x45')](handleError(_0x182dbc,null));};exports[_0x77ca('0x4d')]=function(_0x5dbe7b,_0x1222ee,_0x23bcd4){var _0x2a550a={};var _0x1de1d2={};var _0x5ed002;var _0x1135a9;return db[_0x77ca('0x2c')][_0x77ca('0x4e')]({'where':{'id':_0x5dbe7b[_0x77ca('0x47')]['id']}})[_0x77ca('0x26')](handleEntityNotFound(_0x1222ee,null))['then'](function(_0x4adc4e){if(_0x4adc4e){_0x5ed002=_0x4adc4e;_0x1de1d2[_0x77ca('0x35')]=_[_0x77ca('0x31')](db[_0x77ca('0x4f')][_0x77ca('0x2d')]);_0x1de1d2[_0x77ca('0x32')]=_[_0x77ca('0x31')](_0x5dbe7b[_0x77ca('0x32')]);_0x1de1d2['filters']=_['intersection'](_0x1de1d2['model'],_0x1de1d2['query']);_0x2a550a['attributes']=_[_0x77ca('0x34')](_0x1de1d2[_0x77ca('0x35')],qs[_0x77ca('0x36')](_0x5dbe7b[_0x77ca('0x32')][_0x77ca('0x36')]));_0x2a550a['attributes']=_0x2a550a['attributes'][_0x77ca('0x48')]?_0x2a550a[_0x77ca('0x37')]:_0x1de1d2[_0x77ca('0x35')];_0x2a550a['order']=qs[_0x77ca('0x3a')](_0x5dbe7b[_0x77ca('0x32')][_0x77ca('0x3a')]);_0x2a550a[_0x77ca('0x3b')]=qs[_0x77ca('0x33')](_[_0x77ca('0x3c')](_0x5dbe7b[_0x77ca('0x32')],_0x1de1d2[_0x77ca('0x33')]));if(_0x5dbe7b[_0x77ca('0x32')][_0x77ca('0x3d')]){_0x2a550a[_0x77ca('0x3b')]=_[_0x77ca('0x3f')](_0x2a550a['where'],{'$or':_[_0x77ca('0x30')](_0x2a550a['attributes'],function(_0x4b66e1){var _0xf4508f={};_0xf4508f[_0x4b66e1]={'$like':'%'+_0x5dbe7b['query'][_0x77ca('0x3d')]+'%'};return _0xf4508f;})});}_0x2a550a=_[_0x77ca('0x3f')]({},_0x2a550a,_0x5dbe7b[_0x77ca('0x40')]);return _0x5ed002[_0x77ca('0x4d')](_0x2a550a);}})[_0x77ca('0x26')](function(_0x71d3d7){if(_0x71d3d7){_0x1135a9=_0x71d3d7[_0x77ca('0x48')];if(!_0x5dbe7b['query'][_0x77ca('0x38')]('nolimit')){_0x2a550a[_0x77ca('0x22')]=qs[_0x77ca('0x22')](_0x5dbe7b[_0x77ca('0x32')][_0x77ca('0x22')]);_0x2a550a[_0x77ca('0x20')]=qs[_0x77ca('0x20')](_0x5dbe7b['query'][_0x77ca('0x20')]);}return _0x5ed002['getFields'](_0x2a550a);}})[_0x77ca('0x26')](function(_0x17e00b){if(_0x17e00b){return _0x17e00b?{'count':_0x1135a9,'rows':_0x17e00b}:null;}})[_0x77ca('0x26')](respondWithResult(_0x1222ee,null))[_0x77ca('0x45')](handleError(_0x1222ee,null));};exports[_0x77ca('0x50')]=function(_0x5d3e27,_0x37d65b,_0x195991){var _0x2fb516={};var _0x40fa24={};var _0x1cb9d9;var _0xc674f0;return db[_0x77ca('0x2c')][_0x77ca('0x4e')]({'where':{'id':_0x5d3e27[_0x77ca('0x47')]['id']}})['then'](handleEntityNotFound(_0x37d65b,null))[_0x77ca('0x26')](function(_0x12b7e8){if(_0x12b7e8){_0x1cb9d9=_0x12b7e8;_0x40fa24[_0x77ca('0x35')]=_[_0x77ca('0x31')](db['FreshdeskField'][_0x77ca('0x2d')]);_0x40fa24[_0x77ca('0x32')]=_[_0x77ca('0x31')](_0x5d3e27['query']);_0x40fa24[_0x77ca('0x33')]=_[_0x77ca('0x34')](_0x40fa24[_0x77ca('0x35')],_0x40fa24[_0x77ca('0x32')]);_0x2fb516[_0x77ca('0x37')]=_[_0x77ca('0x34')](_0x40fa24[_0x77ca('0x35')],qs[_0x77ca('0x36')](_0x5d3e27['query'][_0x77ca('0x36')]));_0x2fb516['attributes']=_0x2fb516[_0x77ca('0x37')][_0x77ca('0x48')]?_0x2fb516[_0x77ca('0x37')]:_0x40fa24[_0x77ca('0x35')];_0x2fb516['order']=qs[_0x77ca('0x3a')](_0x5d3e27[_0x77ca('0x32')][_0x77ca('0x3a')]);_0x2fb516['where']=qs[_0x77ca('0x33')](_[_0x77ca('0x3c')](_0x5d3e27[_0x77ca('0x32')],_0x40fa24['filters']));if(_0x5d3e27[_0x77ca('0x32')]['filter']){_0x2fb516[_0x77ca('0x3b')]=_[_0x77ca('0x3f')](_0x2fb516[_0x77ca('0x3b')],{'$or':_[_0x77ca('0x30')](_0x2fb516[_0x77ca('0x37')],function(_0x558ad7){var _0x171874={};_0x171874[_0x558ad7]={'$like':'%'+_0x5d3e27[_0x77ca('0x32')]['filter']+'%'};return _0x171874;})});}_0x2fb516=_['merge']({},_0x2fb516,_0x5d3e27[_0x77ca('0x40')]);return _0x1cb9d9['getSubjects'](_0x2fb516);}})[_0x77ca('0x26')](function(_0x5a577b){if(_0x5a577b){_0xc674f0=_0x5a577b[_0x77ca('0x48')];if(!_0x5d3e27[_0x77ca('0x32')][_0x77ca('0x38')](_0x77ca('0x39'))){_0x2fb516[_0x77ca('0x22')]=qs[_0x77ca('0x22')](_0x5d3e27[_0x77ca('0x32')]['limit']);_0x2fb516[_0x77ca('0x20')]=qs['offset'](_0x5d3e27[_0x77ca('0x32')][_0x77ca('0x20')]);}return _0x1cb9d9[_0x77ca('0x50')](_0x2fb516);}})[_0x77ca('0x26')](function(_0x324cc1){if(_0x324cc1){return _0x324cc1?{'count':_0xc674f0,'rows':_0x324cc1}:null;}})['then'](respondWithResult(_0x37d65b,null))['catch'](handleError(_0x37d65b,null));};exports[_0x77ca('0x51')]=function(_0x3ac8cb,_0x1070c9,_0xfbc3b2){var _0x2b11d5={};var _0x5738a0={};var _0x42f14a;var _0xc27240;return db[_0x77ca('0x2c')][_0x77ca('0x4e')]({'where':{'id':_0x3ac8cb[_0x77ca('0x47')]['id']}})[_0x77ca('0x26')](handleEntityNotFound(_0x1070c9,null))[_0x77ca('0x26')](function(_0x2300d2){if(_0x2300d2){_0x42f14a=_0x2300d2;_0x5738a0[_0x77ca('0x35')]=_[_0x77ca('0x31')](db[_0x77ca('0x4f')][_0x77ca('0x2d')]);_0x5738a0[_0x77ca('0x32')]=_[_0x77ca('0x31')](_0x3ac8cb[_0x77ca('0x32')]);_0x5738a0['filters']=_[_0x77ca('0x34')](_0x5738a0['model'],_0x5738a0[_0x77ca('0x32')]);_0x2b11d5['attributes']=_[_0x77ca('0x34')](_0x5738a0['model'],qs['fields'](_0x3ac8cb['query'][_0x77ca('0x36')]));_0x2b11d5[_0x77ca('0x37')]=_0x2b11d5[_0x77ca('0x37')]['length']?_0x2b11d5[_0x77ca('0x37')]:_0x5738a0[_0x77ca('0x35')];_0x2b11d5['order']=qs['sort'](_0x3ac8cb['query'][_0x77ca('0x3a')]);_0x2b11d5[_0x77ca('0x3b')]=qs['filters'](_[_0x77ca('0x3c')](_0x3ac8cb[_0x77ca('0x32')],_0x5738a0[_0x77ca('0x33')]));if(_0x3ac8cb[_0x77ca('0x32')][_0x77ca('0x3d')]){_0x2b11d5['where']=_[_0x77ca('0x3f')](_0x2b11d5['where'],{'$or':_['map'](_0x2b11d5[_0x77ca('0x37')],function(_0x55f0df){var _0xdcf06f={};_0xdcf06f[_0x55f0df]={'$like':'%'+_0x3ac8cb[_0x77ca('0x32')][_0x77ca('0x3d')]+'%'};return _0xdcf06f;})});}_0x2b11d5=_['merge']({},_0x2b11d5,_0x3ac8cb[_0x77ca('0x40')]);return _0x42f14a[_0x77ca('0x51')](_0x2b11d5);}})[_0x77ca('0x26')](function(_0x40a4de){if(_0x40a4de){_0xc27240=_0x40a4de['length'];if(!_0x3ac8cb['query'][_0x77ca('0x38')](_0x77ca('0x39'))){_0x2b11d5[_0x77ca('0x22')]=qs[_0x77ca('0x22')](_0x3ac8cb[_0x77ca('0x32')][_0x77ca('0x22')]);_0x2b11d5[_0x77ca('0x20')]=qs[_0x77ca('0x20')](_0x3ac8cb[_0x77ca('0x32')][_0x77ca('0x20')]);}return _0x42f14a[_0x77ca('0x51')](_0x2b11d5);}})['then'](function(_0x18f26c){if(_0x18f26c){return _0x18f26c?{'count':_0xc27240,'rows':_0x18f26c}:null;}})[_0x77ca('0x26')](respondWithResult(_0x1070c9,null))[_0x77ca('0x45')](handleError(_0x1070c9,null));};exports[_0x77ca('0x52')]=function(_0x5cb820,_0x3e53b8,_0x1c3a36){var _0x2f7988={};var _0x2f4059={};var _0x3b5e26;var _0x4255c1;return db['FreshdeskConfiguration'][_0x77ca('0x4e')]({'where':{'id':_0x5cb820[_0x77ca('0x47')]['id']}})[_0x77ca('0x26')](handleEntityNotFound(_0x3e53b8,null))['then'](function(_0x57d2ec){if(_0x57d2ec){_0x3b5e26=_0x57d2ec;_0x2f4059[_0x77ca('0x35')]=_[_0x77ca('0x31')](db['Tag']['rawAttributes']);_0x2f4059[_0x77ca('0x32')]=_[_0x77ca('0x31')](_0x5cb820[_0x77ca('0x32')]);_0x2f4059[_0x77ca('0x33')]=_[_0x77ca('0x34')](_0x2f4059[_0x77ca('0x35')],_0x2f4059[_0x77ca('0x32')]);_0x2f7988[_0x77ca('0x37')]=_['intersection'](_0x2f4059[_0x77ca('0x35')],qs[_0x77ca('0x36')](_0x5cb820[_0x77ca('0x32')][_0x77ca('0x36')]));_0x2f7988[_0x77ca('0x37')]=_0x2f7988[_0x77ca('0x37')]['length']?_0x2f7988[_0x77ca('0x37')]:_0x2f4059[_0x77ca('0x35')];_0x2f7988[_0x77ca('0x53')]=qs[_0x77ca('0x3a')](_0x5cb820[_0x77ca('0x32')]['sort']);_0x2f7988[_0x77ca('0x3b')]=qs[_0x77ca('0x33')](_[_0x77ca('0x3c')](_0x5cb820['query'],_0x2f4059[_0x77ca('0x33')]));if(_0x5cb820[_0x77ca('0x32')]['filter']){_0x2f7988[_0x77ca('0x3b')]=_['merge'](_0x2f7988[_0x77ca('0x3b')],{'$or':_[_0x77ca('0x30')](_0x2f7988['attributes'],function(_0x45e963){var _0x34ced8={};_0x34ced8[_0x45e963]={'$like':'%'+_0x5cb820[_0x77ca('0x32')][_0x77ca('0x3d')]+'%'};return _0x34ced8;})});}_0x2f7988=_[_0x77ca('0x3f')]({},_0x2f7988,_0x5cb820[_0x77ca('0x40')]);return _0x3b5e26['getTags'](_0x2f7988);}})[_0x77ca('0x26')](function(_0x1e8573){if(_0x1e8573){_0x4255c1=_0x1e8573[_0x77ca('0x48')];if(!_0x5cb820['query'][_0x77ca('0x38')](_0x77ca('0x39'))){_0x2f7988[_0x77ca('0x22')]=qs[_0x77ca('0x22')](_0x5cb820[_0x77ca('0x32')][_0x77ca('0x22')]);_0x2f7988[_0x77ca('0x20')]=qs['offset'](_0x5cb820[_0x77ca('0x32')][_0x77ca('0x20')]);}return _0x3b5e26['getTags'](_0x2f7988);}})[_0x77ca('0x26')](function(_0x5944d1){if(_0x5944d1){return _0x5944d1?{'count':_0x4255c1,'rows':_0x5944d1}:null;}})[_0x77ca('0x26')](respondWithResult(_0x3e53b8,null))[_0x77ca('0x45')](handleError(_0x3e53b8,null));};exports[_0x77ca('0x54')]=function(_0x12887c,_0x114bb5,_0x572ea9){if(_0x12887c['body']['id']){delete _0x12887c[_0x77ca('0x4b')]['id'];}return db[_0x77ca('0x2c')]['findOne']({'where':{'id':_0x12887c[_0x77ca('0x47')]['id']}})['then'](handleEntityNotFound(_0x114bb5,null))[_0x77ca('0x26')](function(_0x3f09f8){if(_0x3f09f8){return _0x3f09f8[_0x77ca('0x54')](_0x12887c['body'][_0x77ca('0x55')]||[]);}return null;})[_0x77ca('0x26')](respondWithResult(_0x114bb5,null))['catch'](handleError(_0x114bb5,null));}; \ No newline at end of file +var _0x6eae=['attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','FreshdeskConfiguration','findAll','rows','catch','show','params','rawAttributes','include','create','body','update','find','destroy','getFields','hasOwnProperty','findOne','getSubjects','getDescriptions','FreshdeskField','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','then','end','name','send','index','map','fieldName','type','key','model','query','keys','filters'];(function(_0x34c1bb,_0x20dcfd){var _0x41d5be=function(_0x4b6265){while(--_0x4b6265){_0x34c1bb['push'](_0x34c1bb['shift']());}};_0x41d5be(++_0x20dcfd);}(_0x6eae,0x1cd));var _0xe6ea=function(_0x182c21,_0x418063){_0x182c21=_0x182c21-0x0;var _0x40e1df=_0x6eae[_0x182c21];return _0x40e1df;};'use strict';var emlformat=require(_0xe6ea('0x0'));var rimraf=require(_0xe6ea('0x1'));var zipdir=require(_0xe6ea('0x2'));var jsonpatch=require(_0xe6ea('0x3'));var rp=require(_0xe6ea('0x4'));var moment=require(_0xe6ea('0x5'));var BPromise=require(_0xe6ea('0x6'));var Mustache=require(_0xe6ea('0x7'));var util=require(_0xe6ea('0x8'));var path=require(_0xe6ea('0x9'));var sox=require(_0xe6ea('0xa'));var csv=require(_0xe6ea('0xb'));var ejs=require(_0xe6ea('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe6ea('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe6ea('0xe'));var deskjs=require(_0xe6ea('0xf'));var toCsv=require(_0xe6ea('0xb'));var querystring=require(_0xe6ea('0x10'));var Papa=require(_0xe6ea('0x11'));var Redis=require('ioredis');var authService=require(_0xe6ea('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe6ea('0x13'));var hardwareService=require(_0xe6ea('0x14'));var logger=require(_0xe6ea('0x15'))(_0xe6ea('0x16'));var utils=require(_0xe6ea('0x17'));var config=require(_0xe6ea('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6ea('0x19'))['db'];function respondWithStatusCode(_0x4dafc1,_0xeb6889){_0xeb6889=_0xeb6889||0xcc;return function(_0x30b152){if(_0x30b152){return _0x4dafc1[_0xe6ea('0x1a')](_0xeb6889);}return _0x4dafc1[_0xe6ea('0x1b')](_0xeb6889)['end']();};}function respondWithResult(_0x4cbc53,_0x5abd3f){_0x5abd3f=_0x5abd3f||0xc8;return function(_0x42feb0){if(_0x42feb0){return _0x4cbc53[_0xe6ea('0x1b')](_0x5abd3f)['json'](_0x42feb0);}};}function respondWithFilteredResult(_0x5f2416,_0x56c8eb){return function(_0x46c7ef){if(_0x46c7ef){var _0x264044=typeof _0x56c8eb[_0xe6ea('0x1c')]===_0xe6ea('0x1d')&&typeof _0x56c8eb[_0xe6ea('0x1e')]===_0xe6ea('0x1d');var _0x5e8dca=_0x46c7ef[_0xe6ea('0x1f')];var _0x416704=_0x264044?0x0:_0x56c8eb[_0xe6ea('0x1c')];var _0x422f54=_0x264044?_0x46c7ef[_0xe6ea('0x1f')]:_0x56c8eb[_0xe6ea('0x1c')]+_0x56c8eb['limit'];var _0x5c8e60;if(_0x422f54>=_0x5e8dca){_0x422f54=_0x5e8dca;_0x5c8e60=0xc8;}else{_0x5c8e60=0xce;}_0x5f2416[_0xe6ea('0x1b')](_0x5c8e60);return _0x5f2416[_0xe6ea('0x20')](_0xe6ea('0x21'),_0x416704+'-'+_0x422f54+'/'+_0x5e8dca)[_0xe6ea('0x22')](_0x46c7ef);}return null;};}function patchUpdates(_0x1cba7e){return function(_0x3bd121){try{jsonpatch['apply'](_0x3bd121,_0x1cba7e,!![]);}catch(_0x1b9721){return BPromise[_0xe6ea('0x23')](_0x1b9721);}return _0x3bd121['save']();};}function saveUpdates(_0x2a6083,_0x5000e4){return function(_0xa7a76){if(_0xa7a76){return _0xa7a76['update'](_0x2a6083)[_0xe6ea('0x24')](function(_0x18a825){return _0x18a825;});}return null;};}function removeEntity(_0x22a16a,_0x2f6a20){return function(_0x57ddce){if(_0x57ddce){return _0x57ddce['destroy']()[_0xe6ea('0x24')](function(){_0x22a16a[_0xe6ea('0x1b')](0xcc)[_0xe6ea('0x25')]();});}};}function handleEntityNotFound(_0x3c17ba,_0x104d9f){return function(_0x49ceb8){if(!_0x49ceb8){_0x3c17ba[_0xe6ea('0x1a')](0x194);}return _0x49ceb8;};}function handleError(_0x55fa23,_0x2136ba){_0x2136ba=_0x2136ba||0x1f4;return function(_0x4702fe){logger['error'](_0x4702fe['stack']);if(_0x4702fe['name']){delete _0x4702fe[_0xe6ea('0x26')];}_0x55fa23[_0xe6ea('0x1b')](_0x2136ba)[_0xe6ea('0x27')](_0x4702fe);};}exports[_0xe6ea('0x28')]=function(_0x3a14c6,_0x5b70d8){var _0x5093ea={},_0x257ca4={},_0x3281a6={'count':0x0,'rows':[]};var _0x167a71=_[_0xe6ea('0x29')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x21d5e0){return{'name':_0x21d5e0[_0xe6ea('0x2a')],'type':_0x21d5e0[_0xe6ea('0x2b')][_0xe6ea('0x2c')]};});_0x257ca4[_0xe6ea('0x2d')]=_[_0xe6ea('0x29')](_0x167a71,_0xe6ea('0x26'));_0x257ca4[_0xe6ea('0x2e')]=_[_0xe6ea('0x2f')](_0x3a14c6[_0xe6ea('0x2e')]);_0x257ca4[_0xe6ea('0x30')]=_['intersection'](_0x257ca4[_0xe6ea('0x2d')],_0x257ca4[_0xe6ea('0x2e')]);_0x5093ea[_0xe6ea('0x31')]=_[_0xe6ea('0x32')](_0x257ca4[_0xe6ea('0x2d')],qs[_0xe6ea('0x33')](_0x3a14c6[_0xe6ea('0x2e')][_0xe6ea('0x33')]));_0x5093ea[_0xe6ea('0x31')]=_0x5093ea[_0xe6ea('0x31')][_0xe6ea('0x34')]?_0x5093ea[_0xe6ea('0x31')]:_0x257ca4['model'];if(!_0x3a14c6[_0xe6ea('0x2e')]['hasOwnProperty'](_0xe6ea('0x35'))){_0x5093ea[_0xe6ea('0x1e')]=qs[_0xe6ea('0x1e')](_0x3a14c6[_0xe6ea('0x2e')][_0xe6ea('0x1e')]);_0x5093ea[_0xe6ea('0x1c')]=qs[_0xe6ea('0x1c')](_0x3a14c6[_0xe6ea('0x2e')][_0xe6ea('0x1c')]);}_0x5093ea[_0xe6ea('0x36')]=qs['sort'](_0x3a14c6['query'][_0xe6ea('0x37')]);_0x5093ea[_0xe6ea('0x38')]=qs[_0xe6ea('0x30')](_[_0xe6ea('0x39')](_0x3a14c6[_0xe6ea('0x2e')],_0x257ca4[_0xe6ea('0x30')]),_0x167a71);if(_0x3a14c6[_0xe6ea('0x2e')][_0xe6ea('0x3a')]){_0x5093ea[_0xe6ea('0x38')]=_[_0xe6ea('0x3b')](_0x5093ea[_0xe6ea('0x38')],{'$or':_[_0xe6ea('0x29')](_0x167a71,function(_0xee94f1){if(_0xee94f1[_0xe6ea('0x2b')]!=='VIRTUAL'){var _0xab5ecd={};_0xab5ecd[_0xee94f1[_0xe6ea('0x26')]]={'$like':'%'+_0x3a14c6['query']['filter']+'%'};return _0xab5ecd;}})});}_0x5093ea=_[_0xe6ea('0x3b')]({},_0x5093ea,_0x3a14c6[_0xe6ea('0x3c')]);var _0x2ffacc={'where':_0x5093ea['where']};return db['FreshdeskConfiguration'][_0xe6ea('0x1f')](_0x2ffacc)[_0xe6ea('0x24')](function(_0x331b92){_0x3281a6[_0xe6ea('0x1f')]=_0x331b92;if(_0x3a14c6['query'][_0xe6ea('0x3d')]){_0x5093ea['include']=[{'all':!![]}];}return db[_0xe6ea('0x3e')][_0xe6ea('0x3f')](_0x5093ea);})['then'](function(_0xb3b53c){_0x3281a6[_0xe6ea('0x40')]=_0xb3b53c;return _0x3281a6;})[_0xe6ea('0x24')](respondWithFilteredResult(_0x5b70d8,_0x5093ea))[_0xe6ea('0x41')](handleError(_0x5b70d8,null));};exports[_0xe6ea('0x42')]=function(_0x2e191d,_0xc6f53){var _0x2bf225={'raw':![],'where':{'id':_0x2e191d[_0xe6ea('0x43')]['id']}},_0x5263ae={};_0x5263ae[_0xe6ea('0x2d')]=_['keys'](db[_0xe6ea('0x3e')][_0xe6ea('0x44')]);_0x5263ae['query']=_[_0xe6ea('0x2f')](_0x2e191d[_0xe6ea('0x2e')]);_0x5263ae[_0xe6ea('0x30')]=_[_0xe6ea('0x32')](_0x5263ae[_0xe6ea('0x2d')],_0x5263ae[_0xe6ea('0x2e')]);_0x2bf225[_0xe6ea('0x31')]=_[_0xe6ea('0x32')](_0x5263ae['model'],qs[_0xe6ea('0x33')](_0x2e191d[_0xe6ea('0x2e')][_0xe6ea('0x33')]));_0x2bf225['attributes']=_0x2bf225[_0xe6ea('0x31')]['length']?_0x2bf225['attributes']:_0x5263ae[_0xe6ea('0x2d')];if(_0x2e191d[_0xe6ea('0x2e')][_0xe6ea('0x3d')]){_0x2bf225[_0xe6ea('0x45')]=[{'all':!![]}];}_0x2bf225=_['merge']({},_0x2bf225,_0x2e191d['options']);return db[_0xe6ea('0x3e')]['find'](_0x2bf225)[_0xe6ea('0x24')](handleEntityNotFound(_0xc6f53,null))[_0xe6ea('0x24')](respondWithResult(_0xc6f53,null))['catch'](handleError(_0xc6f53,null));};exports[_0xe6ea('0x46')]=function(_0x5c6126,_0x521440){return db[_0xe6ea('0x3e')]['create'](_0x5c6126[_0xe6ea('0x47')],{})[_0xe6ea('0x24')](respondWithResult(_0x521440,0xc9))[_0xe6ea('0x41')](handleError(_0x521440,null));};exports[_0xe6ea('0x48')]=function(_0x370842,_0x21587e){if(_0x370842[_0xe6ea('0x47')]['id']){delete _0x370842['body']['id'];}return db[_0xe6ea('0x3e')][_0xe6ea('0x49')]({'where':{'id':_0x370842[_0xe6ea('0x43')]['id']}})[_0xe6ea('0x24')](handleEntityNotFound(_0x21587e,null))[_0xe6ea('0x24')](saveUpdates(_0x370842[_0xe6ea('0x47')],null))[_0xe6ea('0x24')](respondWithResult(_0x21587e,null))['catch'](handleError(_0x21587e,null));};exports[_0xe6ea('0x4a')]=function(_0x4d42a2,_0x14e125){return db[_0xe6ea('0x3e')][_0xe6ea('0x49')]({'where':{'id':_0x4d42a2['params']['id']}})[_0xe6ea('0x24')](handleEntityNotFound(_0x14e125,null))[_0xe6ea('0x24')](removeEntity(_0x14e125,null))[_0xe6ea('0x41')](handleError(_0x14e125,null));};exports[_0xe6ea('0x4b')]=function(_0x3ae4cd,_0x649029,_0x102258){var _0x57f9c0={};var _0x4c777d={};var _0x53e5b4;var _0x3fd23f;return db[_0xe6ea('0x3e')]['findOne']({'where':{'id':_0x3ae4cd['params']['id']}})['then'](handleEntityNotFound(_0x649029,null))['then'](function(_0x5ce147){if(_0x5ce147){_0x53e5b4=_0x5ce147;_0x4c777d[_0xe6ea('0x2d')]=_[_0xe6ea('0x2f')](db['FreshdeskField'][_0xe6ea('0x44')]);_0x4c777d[_0xe6ea('0x2e')]=_[_0xe6ea('0x2f')](_0x3ae4cd[_0xe6ea('0x2e')]);_0x4c777d[_0xe6ea('0x30')]=_[_0xe6ea('0x32')](_0x4c777d[_0xe6ea('0x2d')],_0x4c777d[_0xe6ea('0x2e')]);_0x57f9c0[_0xe6ea('0x31')]=_[_0xe6ea('0x32')](_0x4c777d['model'],qs[_0xe6ea('0x33')](_0x3ae4cd['query'][_0xe6ea('0x33')]));_0x57f9c0[_0xe6ea('0x31')]=_0x57f9c0[_0xe6ea('0x31')][_0xe6ea('0x34')]?_0x57f9c0[_0xe6ea('0x31')]:_0x4c777d[_0xe6ea('0x2d')];_0x57f9c0[_0xe6ea('0x36')]=qs[_0xe6ea('0x37')](_0x3ae4cd[_0xe6ea('0x2e')]['sort']);_0x57f9c0[_0xe6ea('0x38')]=qs[_0xe6ea('0x30')](_[_0xe6ea('0x39')](_0x3ae4cd['query'],_0x4c777d['filters']));if(_0x3ae4cd[_0xe6ea('0x2e')][_0xe6ea('0x3a')]){_0x57f9c0['where']=_['merge'](_0x57f9c0[_0xe6ea('0x38')],{'$or':_[_0xe6ea('0x29')](_0x57f9c0[_0xe6ea('0x31')],function(_0x504b61){var _0x17c4ac={};_0x17c4ac[_0x504b61]={'$like':'%'+_0x3ae4cd['query'][_0xe6ea('0x3a')]+'%'};return _0x17c4ac;})});}_0x57f9c0=_[_0xe6ea('0x3b')]({},_0x57f9c0,_0x3ae4cd['options']);return _0x53e5b4[_0xe6ea('0x4b')](_0x57f9c0);}})[_0xe6ea('0x24')](function(_0x2dd98d){if(_0x2dd98d){_0x3fd23f=_0x2dd98d[_0xe6ea('0x34')];if(!_0x3ae4cd[_0xe6ea('0x2e')][_0xe6ea('0x4c')]('nolimit')){_0x57f9c0[_0xe6ea('0x1e')]=qs[_0xe6ea('0x1e')](_0x3ae4cd[_0xe6ea('0x2e')]['limit']);_0x57f9c0[_0xe6ea('0x1c')]=qs['offset'](_0x3ae4cd[_0xe6ea('0x2e')][_0xe6ea('0x1c')]);}return _0x53e5b4['getFields'](_0x57f9c0);}})[_0xe6ea('0x24')](function(_0x4926d7){if(_0x4926d7){return _0x4926d7?{'count':_0x3fd23f,'rows':_0x4926d7}:null;}})[_0xe6ea('0x24')](respondWithResult(_0x649029,null))['catch'](handleError(_0x649029,null));};exports['getSubjects']=function(_0x5ec637,_0x15fcfc,_0x390ab1){var _0x44a61d={};var _0xbb00bb={};var _0x39cfb6;var _0x3a5c6b;return db[_0xe6ea('0x3e')][_0xe6ea('0x4d')]({'where':{'id':_0x5ec637[_0xe6ea('0x43')]['id']}})['then'](handleEntityNotFound(_0x15fcfc,null))['then'](function(_0x1eb6f5){if(_0x1eb6f5){_0x39cfb6=_0x1eb6f5;_0xbb00bb['model']=_[_0xe6ea('0x2f')](db['FreshdeskField'][_0xe6ea('0x44')]);_0xbb00bb['query']=_['keys'](_0x5ec637['query']);_0xbb00bb[_0xe6ea('0x30')]=_['intersection'](_0xbb00bb[_0xe6ea('0x2d')],_0xbb00bb[_0xe6ea('0x2e')]);_0x44a61d[_0xe6ea('0x31')]=_[_0xe6ea('0x32')](_0xbb00bb[_0xe6ea('0x2d')],qs[_0xe6ea('0x33')](_0x5ec637[_0xe6ea('0x2e')][_0xe6ea('0x33')]));_0x44a61d[_0xe6ea('0x31')]=_0x44a61d['attributes'][_0xe6ea('0x34')]?_0x44a61d[_0xe6ea('0x31')]:_0xbb00bb[_0xe6ea('0x2d')];_0x44a61d['order']=qs['sort'](_0x5ec637[_0xe6ea('0x2e')][_0xe6ea('0x37')]);_0x44a61d[_0xe6ea('0x38')]=qs[_0xe6ea('0x30')](_[_0xe6ea('0x39')](_0x5ec637[_0xe6ea('0x2e')],_0xbb00bb[_0xe6ea('0x30')]));if(_0x5ec637['query'][_0xe6ea('0x3a')]){_0x44a61d[_0xe6ea('0x38')]=_[_0xe6ea('0x3b')](_0x44a61d[_0xe6ea('0x38')],{'$or':_['map'](_0x44a61d[_0xe6ea('0x31')],function(_0x29b53c){var _0x5e5ed7={};_0x5e5ed7[_0x29b53c]={'$like':'%'+_0x5ec637[_0xe6ea('0x2e')][_0xe6ea('0x3a')]+'%'};return _0x5e5ed7;})});}_0x44a61d=_[_0xe6ea('0x3b')]({},_0x44a61d,_0x5ec637[_0xe6ea('0x3c')]);return _0x39cfb6[_0xe6ea('0x4e')](_0x44a61d);}})[_0xe6ea('0x24')](function(_0x4772c2){if(_0x4772c2){_0x3a5c6b=_0x4772c2[_0xe6ea('0x34')];if(!_0x5ec637[_0xe6ea('0x2e')][_0xe6ea('0x4c')](_0xe6ea('0x35'))){_0x44a61d[_0xe6ea('0x1e')]=qs[_0xe6ea('0x1e')](_0x5ec637[_0xe6ea('0x2e')][_0xe6ea('0x1e')]);_0x44a61d[_0xe6ea('0x1c')]=qs[_0xe6ea('0x1c')](_0x5ec637[_0xe6ea('0x2e')]['offset']);}return _0x39cfb6[_0xe6ea('0x4e')](_0x44a61d);}})[_0xe6ea('0x24')](function(_0x5e303b){if(_0x5e303b){return _0x5e303b?{'count':_0x3a5c6b,'rows':_0x5e303b}:null;}})[_0xe6ea('0x24')](respondWithResult(_0x15fcfc,null))[_0xe6ea('0x41')](handleError(_0x15fcfc,null));};exports[_0xe6ea('0x4f')]=function(_0x2bbf03,_0x58fe71,_0x44cd13){var _0x5b4a85={};var _0x4fecf7={};var _0x4f41a9;var _0x2d37a8;return db[_0xe6ea('0x3e')][_0xe6ea('0x4d')]({'where':{'id':_0x2bbf03[_0xe6ea('0x43')]['id']}})[_0xe6ea('0x24')](handleEntityNotFound(_0x58fe71,null))[_0xe6ea('0x24')](function(_0x34dd7f){if(_0x34dd7f){_0x4f41a9=_0x34dd7f;_0x4fecf7[_0xe6ea('0x2d')]=_[_0xe6ea('0x2f')](db[_0xe6ea('0x50')][_0xe6ea('0x44')]);_0x4fecf7[_0xe6ea('0x2e')]=_[_0xe6ea('0x2f')](_0x2bbf03['query']);_0x4fecf7[_0xe6ea('0x30')]=_['intersection'](_0x4fecf7['model'],_0x4fecf7[_0xe6ea('0x2e')]);_0x5b4a85[_0xe6ea('0x31')]=_['intersection'](_0x4fecf7[_0xe6ea('0x2d')],qs[_0xe6ea('0x33')](_0x2bbf03[_0xe6ea('0x2e')][_0xe6ea('0x33')]));_0x5b4a85[_0xe6ea('0x31')]=_0x5b4a85['attributes']['length']?_0x5b4a85['attributes']:_0x4fecf7[_0xe6ea('0x2d')];_0x5b4a85['order']=qs['sort'](_0x2bbf03[_0xe6ea('0x2e')][_0xe6ea('0x37')]);_0x5b4a85[_0xe6ea('0x38')]=qs[_0xe6ea('0x30')](_[_0xe6ea('0x39')](_0x2bbf03[_0xe6ea('0x2e')],_0x4fecf7[_0xe6ea('0x30')]));if(_0x2bbf03[_0xe6ea('0x2e')][_0xe6ea('0x3a')]){_0x5b4a85[_0xe6ea('0x38')]=_[_0xe6ea('0x3b')](_0x5b4a85[_0xe6ea('0x38')],{'$or':_[_0xe6ea('0x29')](_0x5b4a85[_0xe6ea('0x31')],function(_0xf0a0bb){var _0x10191d={};_0x10191d[_0xf0a0bb]={'$like':'%'+_0x2bbf03['query']['filter']+'%'};return _0x10191d;})});}_0x5b4a85=_['merge']({},_0x5b4a85,_0x2bbf03[_0xe6ea('0x3c')]);return _0x4f41a9[_0xe6ea('0x4f')](_0x5b4a85);}})[_0xe6ea('0x24')](function(_0x40e7e4){if(_0x40e7e4){_0x2d37a8=_0x40e7e4[_0xe6ea('0x34')];if(!_0x2bbf03[_0xe6ea('0x2e')][_0xe6ea('0x4c')](_0xe6ea('0x35'))){_0x5b4a85[_0xe6ea('0x1e')]=qs['limit'](_0x2bbf03[_0xe6ea('0x2e')][_0xe6ea('0x1e')]);_0x5b4a85[_0xe6ea('0x1c')]=qs[_0xe6ea('0x1c')](_0x2bbf03[_0xe6ea('0x2e')][_0xe6ea('0x1c')]);}return _0x4f41a9[_0xe6ea('0x4f')](_0x5b4a85);}})[_0xe6ea('0x24')](function(_0x3140bc){if(_0x3140bc){return _0x3140bc?{'count':_0x2d37a8,'rows':_0x3140bc}:null;}})[_0xe6ea('0x24')](respondWithResult(_0x58fe71,null))[_0xe6ea('0x41')](handleError(_0x58fe71,null));};exports[_0xe6ea('0x51')]=function(_0x32db43,_0x19d4a7,_0x2c48f6){var _0x449718={};var _0x3ad60f={};var _0x473052;var _0x3727b0;return db[_0xe6ea('0x3e')][_0xe6ea('0x4d')]({'where':{'id':_0x32db43['params']['id']}})['then'](handleEntityNotFound(_0x19d4a7,null))[_0xe6ea('0x24')](function(_0x37d5b2){if(_0x37d5b2){_0x473052=_0x37d5b2;_0x3ad60f['model']=_[_0xe6ea('0x2f')](db[_0xe6ea('0x52')]['rawAttributes']);_0x3ad60f['query']=_['keys'](_0x32db43[_0xe6ea('0x2e')]);_0x3ad60f['filters']=_[_0xe6ea('0x32')](_0x3ad60f[_0xe6ea('0x2d')],_0x3ad60f[_0xe6ea('0x2e')]);_0x449718[_0xe6ea('0x31')]=_[_0xe6ea('0x32')](_0x3ad60f['model'],qs[_0xe6ea('0x33')](_0x32db43[_0xe6ea('0x2e')][_0xe6ea('0x33')]));_0x449718[_0xe6ea('0x31')]=_0x449718[_0xe6ea('0x31')][_0xe6ea('0x34')]?_0x449718[_0xe6ea('0x31')]:_0x3ad60f['model'];_0x449718[_0xe6ea('0x36')]=qs[_0xe6ea('0x37')](_0x32db43[_0xe6ea('0x2e')][_0xe6ea('0x37')]);_0x449718[_0xe6ea('0x38')]=qs[_0xe6ea('0x30')](_[_0xe6ea('0x39')](_0x32db43['query'],_0x3ad60f[_0xe6ea('0x30')]));if(_0x32db43[_0xe6ea('0x2e')][_0xe6ea('0x3a')]){_0x449718[_0xe6ea('0x38')]=_[_0xe6ea('0x3b')](_0x449718[_0xe6ea('0x38')],{'$or':_['map'](_0x449718['attributes'],function(_0x532cf8){var _0x4a4521={};_0x4a4521[_0x532cf8]={'$like':'%'+_0x32db43[_0xe6ea('0x2e')][_0xe6ea('0x3a')]+'%'};return _0x4a4521;})});}_0x449718=_[_0xe6ea('0x3b')]({},_0x449718,_0x32db43[_0xe6ea('0x3c')]);return _0x473052[_0xe6ea('0x51')](_0x449718);}})[_0xe6ea('0x24')](function(_0x12e315){if(_0x12e315){_0x3727b0=_0x12e315[_0xe6ea('0x34')];if(!_0x32db43[_0xe6ea('0x2e')]['hasOwnProperty'](_0xe6ea('0x35'))){_0x449718['limit']=qs[_0xe6ea('0x1e')](_0x32db43[_0xe6ea('0x2e')][_0xe6ea('0x1e')]);_0x449718[_0xe6ea('0x1c')]=qs[_0xe6ea('0x1c')](_0x32db43[_0xe6ea('0x2e')][_0xe6ea('0x1c')]);}return _0x473052[_0xe6ea('0x51')](_0x449718);}})['then'](function(_0x48c8b8){if(_0x48c8b8){return _0x48c8b8?{'count':_0x3727b0,'rows':_0x48c8b8}:null;}})[_0xe6ea('0x24')](respondWithResult(_0x19d4a7,null))[_0xe6ea('0x41')](handleError(_0x19d4a7,null));};exports[_0xe6ea('0x53')]=function(_0x228983,_0x2c8611,_0x480b0d){if(_0x228983['body']['id']){delete _0x228983[_0xe6ea('0x47')]['id'];}return db[_0xe6ea('0x3e')][_0xe6ea('0x4d')]({'where':{'id':_0x228983['params']['id']}})[_0xe6ea('0x24')](handleEntityNotFound(_0x2c8611,null))[_0xe6ea('0x24')](function(_0x1bc617){if(_0x1bc617){return _0x1bc617[_0xe6ea('0x53')](_0x228983[_0xe6ea('0x47')][_0xe6ea('0x54')]||[]);}return null;})['then'](respondWithResult(_0x2c8611,null))[_0xe6ea('0x41')](handleError(_0x2c8611,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index f012732..b1a066e 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 _0x35f0=['rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3c03f1,_0x433551){var _0x257e41=function(_0xd63edf){while(--_0xd63edf){_0x3c03f1['push'](_0x3c03f1['shift']());}};_0x257e41(++_0x433551);}(_0x35f0,0x148));var _0x035f=function(_0x728f69,_0x4f899b){_0x728f69=_0x728f69-0x0;var _0x2e6e14=_0x35f0[_0x728f69];return _0x2e6e14;};'use strict';var _=require(_0x035f('0x0'));var util=require(_0x035f('0x1'));var logger=require(_0x035f('0x2'))(_0x035f('0x3'));var moment=require(_0x035f('0x4'));var BPromise=require(_0x035f('0x5'));var rp=require(_0x035f('0x6'));var fs=require('fs');var path=require(_0x035f('0x7'));var rimraf=require(_0x035f('0x8'));var config=require('../../config/environment');var attributes=require(_0x035f('0x9'));module[_0x035f('0xa')]=function(_0x35544e,_0x4138c3){return _0x35544e[_0x035f('0xb')](_0x035f('0xc'),attributes,{'tableName':_0x035f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba65=['rimraf','define','FreshdeskConfiguration','lodash','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba65,0x12c));var _0x5ba6=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0xba65[_0x1f3aec];return _0x409f0d;};'use strict';var _=require(_0x5ba6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5ba6('0x1'));var moment=require(_0x5ba6('0x2'));var BPromise=require(_0x5ba6('0x3'));var rp=require(_0x5ba6('0x4'));var fs=require('fs');var path=require(_0x5ba6('0x5'));var rimraf=require(_0x5ba6('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x38228f,_0x30c0bb){return _0x38228f[_0x5ba6('0x7')](_0x5ba6('0x8'),attributes,{'tableName':'int_freshdesk_configurations','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 52dea82..5ea44e7 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 _0x361d=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash'];(function(_0x19147d,_0x2d2c03){var _0x5c3b7d=function(_0x3516b5){while(--_0x3516b5){_0x19147d['push'](_0x19147d['shift']());}};_0x5c3b7d(++_0x2d2c03);}(_0x361d,0x1a1));var _0xd361=function(_0x5d45d9,_0x1b00bf){_0x5d45d9=_0x5d45d9-0x0;var _0x1615d3=_0x361d[_0x5d45d9];return _0x1615d3;};'use strict';var _=require(_0xd361('0x0'));var util=require(_0xd361('0x1'));var moment=require(_0xd361('0x2'));var BPromise=require(_0xd361('0x3'));var rs=require(_0xd361('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd361('0x5'))['db'];var utils=require(_0xd361('0x6'));var logger=require(_0xd361('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd361('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8986,_0x381461,_0x3fa0d4){return new BPromise(function(_0x20b9c1,_0x265177){return client[_0xd361('0x9')](_0x5a8986,_0x3fa0d4)[_0xd361('0xa')](function(_0x583a49){logger[_0xd361('0xb')](_0xd361('0xc'),_0x381461,_0xd361('0xd'));logger['debug'](_0xd361('0xe'),_0x381461,_0xd361('0xd'),JSON[_0xd361('0xf')](_0x583a49));if(_0x583a49[_0xd361('0x10')]){if(_0x583a49[_0xd361('0x10')]['code']===0x1f4){logger[_0xd361('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x381461,_0x583a49[_0xd361('0x10')][_0xd361('0x11')]);return _0x265177(_0x583a49[_0xd361('0x10')]['message']);}logger[_0xd361('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x381461,_0x583a49['error'][_0xd361('0x11')]);return _0x20b9c1(_0x583a49['error']['message']);}else{logger[_0xd361('0xb')](_0xd361('0xc'),_0x381461,_0xd361('0xd'));_0x20b9c1(_0x583a49['result'][_0xd361('0x11')]);}})[_0xd361('0x12')](function(_0xc5859b){logger['error'](_0xd361('0xc'),_0x381461,_0xc5859b);_0x265177(_0xc5859b);});});} \ No newline at end of file +var _0x1bfe=['FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','http','request','then'];(function(_0x37a195,_0x5ca479){var _0x44940c=function(_0x51aa5d){while(--_0x51aa5d){_0x37a195['push'](_0x37a195['shift']());}};_0x44940c(++_0x5ca479);}(_0x1bfe,0x1ca));var _0xe1bf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x1bfe[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0xe1bf('0x0'));var moment=require(_0xe1bf('0x1'));var BPromise=require(_0xe1bf('0x2'));var rs=require(_0xe1bf('0x3'));var fs=require('fs');var Redis=require(_0xe1bf('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe1bf('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe1bf('0x6'));var client=jayson['client'][_0xe1bf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e9cbe,_0x23e9c1,_0x3f07bd){return new BPromise(function(_0x2382e5,_0x37c2a3){return client[_0xe1bf('0x8')](_0x5e9cbe,_0x3f07bd)[_0xe1bf('0x9')](function(_0x2afaa4){logger['info'](_0xe1bf('0xa'),_0x23e9c1,'request\x20sent');logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x23e9c1,_0xe1bf('0xb'),JSON[_0xe1bf('0xc')](_0x2afaa4));if(_0x2afaa4[_0xe1bf('0xd')]){if(_0x2afaa4['error'][_0xe1bf('0xe')]===0x1f4){logger[_0xe1bf('0xd')](_0xe1bf('0xa'),_0x23e9c1,_0x2afaa4[_0xe1bf('0xd')][_0xe1bf('0xf')]);return _0x37c2a3(_0x2afaa4[_0xe1bf('0xd')][_0xe1bf('0xf')]);}logger[_0xe1bf('0xd')](_0xe1bf('0xa'),_0x23e9c1,_0x2afaa4[_0xe1bf('0xd')][_0xe1bf('0xf')]);return _0x2382e5(_0x2afaa4[_0xe1bf('0xd')][_0xe1bf('0xf')]);}else{logger[_0xe1bf('0x10')](_0xe1bf('0xa'),_0x23e9c1,_0xe1bf('0xb'));_0x2382e5(_0x2afaa4[_0xe1bf('0x11')][_0xe1bf('0xf')]);}})['catch'](function(_0x4c8672){logger[_0xe1bf('0xd')](_0xe1bf('0xa'),_0x23e9c1,_0x4c8672);_0x37c2a3(_0x4c8672);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index c1ab5aa..f0b2265 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 _0xdc66=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','show','create','put','/:id','update','destroy','multer','util','path'];(function(_0x1648d5,_0x1cb383){var _0x5b70c3=function(_0x565d8f){while(--_0x565d8f){_0x1648d5['push'](_0x1648d5['shift']());}};_0x5b70c3(++_0x1cb383);}(_0xdc66,0x189));var _0x6dc6=function(_0xbd2356,_0x441dc9){_0xbd2356=_0xbd2356-0x0;var _0xf0b100=_0xdc66[_0xbd2356];return _0xf0b100;};'use strict';var multer=require(_0x6dc6('0x0'));var util=require(_0x6dc6('0x1'));var path=require(_0x6dc6('0x2'));var timeout=require(_0x6dc6('0x3'));var express=require(_0x6dc6('0x4'));var router=express[_0x6dc6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6dc6('0x6'));var interaction=require(_0x6dc6('0x7'));var config=require('../../config/environment');var controller=require(_0x6dc6('0x8'));router[_0x6dc6('0x9')]('/',auth[_0x6dc6('0xa')](),controller[_0x6dc6('0xb')]);router[_0x6dc6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6dc6('0xc')]);router['post']('/',auth[_0x6dc6('0xa')](),controller[_0x6dc6('0xd')]);router[_0x6dc6('0xe')](_0x6dc6('0xf'),auth[_0x6dc6('0xa')](),controller[_0x6dc6('0x10')]);router['delete']('/:id',auth[_0x6dc6('0xa')](),controller[_0x6dc6('0x11')]);module['exports']=router; \ No newline at end of file +var _0xbf63=['update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','index','/:id','isAuthenticated','post'];(function(_0x247652,_0x3f7a79){var _0x8f7b9c=function(_0x3d6297){while(--_0x3d6297){_0x247652['push'](_0x247652['shift']());}};_0x8f7b9c(++_0x3f7a79);}(_0xbf63,0x17a));var _0x3bf6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xbf63[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x3bf6('0x0'));var util=require('util');var path=require(_0x3bf6('0x1'));var timeout=require('connect-timeout');var express=require(_0x3bf6('0x2'));var router=express['Router']();var fs_extra=require(_0x3bf6('0x3'));var auth=require(_0x3bf6('0x4'));var interaction=require(_0x3bf6('0x5'));var config=require(_0x3bf6('0x6'));var controller=require(_0x3bf6('0x7'));router[_0x3bf6('0x8')]('/',auth['isAuthenticated'](),controller[_0x3bf6('0x9')]);router[_0x3bf6('0x8')](_0x3bf6('0xa'),auth[_0x3bf6('0xb')](),controller['show']);router[_0x3bf6('0xc')]('/',auth[_0x3bf6('0xb')](),controller['create']);router['put'](_0x3bf6('0xa'),auth['isAuthenticated'](),controller[_0x3bf6('0xd')]);router[_0x3bf6('0xe')](_0x3bf6('0xa'),auth[_0x3bf6('0xb')](),controller[_0x3bf6('0xf')]);module[_0x3bf6('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 9d8793e..d7df3c6 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 _0x5bb7=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x4d8af3,_0x4199cc){var _0x118102=function(_0x28191e){while(--_0x28191e){_0x4d8af3['push'](_0x4d8af3['shift']());}};_0x118102(++_0x4199cc);}(_0x5bb7,0xd1));var _0x75bb=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x5bb7[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require(_0x75bb('0x0'));module[_0x75bb('0x1')]={'type':{'type':Sequelize[_0x75bb('0x2')](_0x75bb('0x3'),_0x75bb('0x4'),_0x75bb('0x5'),'keyValue',_0x75bb('0x6')),'defaultValue':_0x75bb('0x3')},'content':{'type':Sequelize[_0x75bb('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x75bb('0x2')](_0x75bb('0x3'),_0x75bb('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x75bb('0x7')]},'idField':{'type':Sequelize[_0x75bb('0x7')]},'nameField':{'type':Sequelize[_0x75bb('0x7')]},'customField':{'type':Sequelize[_0x75bb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x75bb('0x7')]}}; \ No newline at end of file +var _0xe1b2=['string','customVariable','STRING','sequelize','ENUM'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0xe1b2,0x10c));var _0x2e1b=function(_0x56858d,_0x32daf8){_0x56858d=_0x56858d-0x0;var _0x144553=_0xe1b2[_0x56858d];return _0x144553;};'use strict';var Sequelize=require(_0x2e1b('0x0'));module['exports']={'type':{'type':Sequelize[_0x2e1b('0x1')](_0x2e1b('0x2'),'variable',_0x2e1b('0x3'),'keyValue','picklist'),'defaultValue':_0x2e1b('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2e1b('0x4')]},'keyType':{'type':Sequelize[_0x2e1b('0x1')](_0x2e1b('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x2e1b('0x4')]},'idField':{'type':Sequelize[_0x2e1b('0x4')]},'nameField':{'type':Sequelize[_0x2e1b('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2e1b('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 03ef44b..405f7a2 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 _0x5b02=['length','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','error','name','map','FreshdeskField','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys'];(function(_0x93818d,_0x5f4782){var _0x4daf9b=function(_0x3a55d9){while(--_0x3a55d9){_0x93818d['push'](_0x93818d['shift']());}};_0x4daf9b(++_0x5f4782);}(_0x5b02,0xe9));var _0x25b0=function(_0x4a858a,_0x3e55da){_0x4a858a=_0x4a858a-0x0;var _0x189647=_0x5b02[_0x4a858a];return _0x189647;};'use strict';var emlformat=require(_0x25b0('0x0'));var rimraf=require(_0x25b0('0x1'));var zipdir=require(_0x25b0('0x2'));var jsonpatch=require(_0x25b0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x25b0('0x4'));var Mustache=require('mustache');var util=require(_0x25b0('0x5'));var path=require(_0x25b0('0x6'));var sox=require(_0x25b0('0x7'));var csv=require(_0x25b0('0x8'));var ejs=require(_0x25b0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25b0('0xa'));var squel=require(_0x25b0('0xb'));var crypto=require('crypto');var jsforce=require(_0x25b0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x25b0('0xd'));var Papa=require(_0x25b0('0xe'));var Redis=require(_0x25b0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b0('0x10'));var as=require(_0x25b0('0x11'));var hardwareService=require(_0x25b0('0x12'));var logger=require(_0x25b0('0x13'))(_0x25b0('0x14'));var utils=require(_0x25b0('0x15'));var config=require(_0x25b0('0x16'));var licenseUtil=require(_0x25b0('0x17'));var db=require(_0x25b0('0x18'))['db'];function respondWithStatusCode(_0x1d3178,_0x184452){_0x184452=_0x184452||0xcc;return function(_0x26a34f){if(_0x26a34f){return _0x1d3178[_0x25b0('0x19')](_0x184452);}return _0x1d3178[_0x25b0('0x1a')](_0x184452)[_0x25b0('0x1b')]();};}function respondWithResult(_0x42cc07,_0x293203){_0x293203=_0x293203||0xc8;return function(_0x211658){if(_0x211658){return _0x42cc07[_0x25b0('0x1a')](_0x293203)[_0x25b0('0x1c')](_0x211658);}};}function respondWithFilteredResult(_0x40071c,_0x5ac18d){return function(_0x51542b){if(_0x51542b){var _0xfe1ea6=typeof _0x5ac18d['offset']===_0x25b0('0x1d')&&typeof _0x5ac18d[_0x25b0('0x1e')]===_0x25b0('0x1d');var _0x3267b9=_0x51542b['count'];var _0x1d850f=_0xfe1ea6?0x0:_0x5ac18d[_0x25b0('0x1f')];var _0x20762e=_0xfe1ea6?_0x51542b[_0x25b0('0x20')]:_0x5ac18d[_0x25b0('0x1f')]+_0x5ac18d[_0x25b0('0x1e')];var _0x54f458;if(_0x20762e>=_0x3267b9){_0x20762e=_0x3267b9;_0x54f458=0xc8;}else{_0x54f458=0xce;}_0x40071c[_0x25b0('0x1a')](_0x54f458);return _0x40071c[_0x25b0('0x21')](_0x25b0('0x22'),_0x1d850f+'-'+_0x20762e+'/'+_0x3267b9)[_0x25b0('0x1c')](_0x51542b);}return null;};}function patchUpdates(_0x1dc691){return function(_0xea4162){try{jsonpatch[_0x25b0('0x23')](_0xea4162,_0x1dc691,!![]);}catch(_0x19599b){return BPromise[_0x25b0('0x24')](_0x19599b);}return _0xea4162[_0x25b0('0x25')]();};}function saveUpdates(_0x2b2eda,_0x3ce1da){return function(_0x5cb746){if(_0x5cb746){return _0x5cb746[_0x25b0('0x26')](_0x2b2eda)[_0x25b0('0x27')](function(_0x517ec5){return _0x517ec5;});}return null;};}function removeEntity(_0x2d7c17,_0x2023d8){return function(_0x3546f0){if(_0x3546f0){return _0x3546f0['destroy']()['then'](function(){_0x2d7c17['status'](0xcc)[_0x25b0('0x1b')]();});}};}function handleEntityNotFound(_0x433085,_0x99bd3a){return function(_0x24f847){if(!_0x24f847){_0x433085[_0x25b0('0x19')](0x194);}return _0x24f847;};}function handleError(_0x23b396,_0x40268a){_0x40268a=_0x40268a||0x1f4;return function(_0x75ce7a){logger[_0x25b0('0x28')](_0x75ce7a['stack']);if(_0x75ce7a[_0x25b0('0x29')]){delete _0x75ce7a[_0x25b0('0x29')];}_0x23b396['status'](_0x40268a)['send'](_0x75ce7a);};}exports['index']=function(_0x1a6212,_0x3f0a54){var _0x251fad={},_0x105129={},_0x214377={'count':0x0,'rows':[]};var _0x3285ae=_[_0x25b0('0x2a')](db[_0x25b0('0x2b')][_0x25b0('0x2c')],function(_0x285a2b){return{'name':_0x285a2b[_0x25b0('0x2d')],'type':_0x285a2b[_0x25b0('0x2e')][_0x25b0('0x2f')]};});_0x105129['model']=_['map'](_0x3285ae,_0x25b0('0x29'));_0x105129['query']=_['keys'](_0x1a6212[_0x25b0('0x30')]);_0x105129[_0x25b0('0x31')]=_[_0x25b0('0x32')](_0x105129[_0x25b0('0x33')],_0x105129[_0x25b0('0x30')]);_0x251fad['attributes']=_[_0x25b0('0x32')](_0x105129[_0x25b0('0x33')],qs['fields'](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x34')]));_0x251fad['attributes']=_0x251fad[_0x25b0('0x35')]['length']?_0x251fad[_0x25b0('0x35')]:_0x105129[_0x25b0('0x33')];if(!_0x1a6212[_0x25b0('0x30')][_0x25b0('0x36')](_0x25b0('0x37'))){_0x251fad[_0x25b0('0x1e')]=qs[_0x25b0('0x1e')](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x1e')]);_0x251fad['offset']=qs[_0x25b0('0x1f')](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x1f')]);}_0x251fad[_0x25b0('0x38')]=qs[_0x25b0('0x39')](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x39')]);_0x251fad[_0x25b0('0x3a')]=qs[_0x25b0('0x31')](_[_0x25b0('0x3b')](_0x1a6212['query'],_0x105129[_0x25b0('0x31')]),_0x3285ae);if(_0x1a6212[_0x25b0('0x30')][_0x25b0('0x3c')]){_0x251fad['where']=_[_0x25b0('0x3d')](_0x251fad[_0x25b0('0x3a')],{'$or':_[_0x25b0('0x2a')](_0x3285ae,function(_0x43e140){if(_0x43e140[_0x25b0('0x2e')]!==_0x25b0('0x3e')){var _0x28f1cd={};_0x28f1cd[_0x43e140[_0x25b0('0x29')]]={'$like':'%'+_0x1a6212['query']['filter']+'%'};return _0x28f1cd;}})});}_0x251fad=_[_0x25b0('0x3d')]({},_0x251fad,_0x1a6212[_0x25b0('0x3f')]);var _0x3f4ae0={'where':_0x251fad['where']};return db[_0x25b0('0x2b')]['count'](_0x3f4ae0)[_0x25b0('0x27')](function(_0x39617a){_0x214377[_0x25b0('0x20')]=_0x39617a;if(_0x1a6212[_0x25b0('0x30')][_0x25b0('0x40')]){_0x251fad['include']=[{'all':!![]}];}return db[_0x25b0('0x2b')][_0x25b0('0x41')](_0x251fad);})[_0x25b0('0x27')](function(_0x376d8a){_0x214377[_0x25b0('0x42')]=_0x376d8a;return _0x214377;})['then'](respondWithFilteredResult(_0x3f0a54,_0x251fad))[_0x25b0('0x43')](handleError(_0x3f0a54,null));};exports[_0x25b0('0x44')]=function(_0x3d1262,_0x44c400){var _0x35fc00={'raw':!![],'where':{'id':_0x3d1262[_0x25b0('0x45')]['id']}},_0x1adf8d={};_0x1adf8d[_0x25b0('0x33')]=_[_0x25b0('0x46')](db[_0x25b0('0x2b')][_0x25b0('0x2c')]);_0x1adf8d['query']=_[_0x25b0('0x46')](_0x3d1262['query']);_0x1adf8d[_0x25b0('0x31')]=_[_0x25b0('0x32')](_0x1adf8d[_0x25b0('0x33')],_0x1adf8d[_0x25b0('0x30')]);_0x35fc00['attributes']=_[_0x25b0('0x32')](_0x1adf8d[_0x25b0('0x33')],qs[_0x25b0('0x34')](_0x3d1262['query'][_0x25b0('0x34')]));_0x35fc00[_0x25b0('0x35')]=_0x35fc00[_0x25b0('0x35')][_0x25b0('0x47')]?_0x35fc00[_0x25b0('0x35')]:_0x1adf8d[_0x25b0('0x33')];if(_0x3d1262[_0x25b0('0x30')]['includeAll']){_0x35fc00[_0x25b0('0x48')]=[{'all':!![]}];}_0x35fc00=_[_0x25b0('0x3d')]({},_0x35fc00,_0x3d1262[_0x25b0('0x3f')]);return db['FreshdeskField'][_0x25b0('0x49')](_0x35fc00)[_0x25b0('0x27')](handleEntityNotFound(_0x44c400,null))[_0x25b0('0x27')](respondWithResult(_0x44c400,null))[_0x25b0('0x43')](handleError(_0x44c400,null));};exports[_0x25b0('0x4a')]=function(_0x568d83,_0x1e8a8d){return db[_0x25b0('0x2b')][_0x25b0('0x4a')](_0x568d83['body'],{})[_0x25b0('0x27')](respondWithResult(_0x1e8a8d,0xc9))[_0x25b0('0x43')](handleError(_0x1e8a8d,null));};exports[_0x25b0('0x26')]=function(_0x1d6d55,_0x29165e){if(_0x1d6d55[_0x25b0('0x4b')]['id']){delete _0x1d6d55['body']['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x1d6d55[_0x25b0('0x45')]['id']}})['then'](handleEntityNotFound(_0x29165e,null))['then'](saveUpdates(_0x1d6d55[_0x25b0('0x4b')],null))['then'](respondWithResult(_0x29165e,null))[_0x25b0('0x43')](handleError(_0x29165e,null));};exports['destroy']=function(_0x4fc22d,_0x394e52){return db[_0x25b0('0x2b')][_0x25b0('0x49')]({'where':{'id':_0x4fc22d[_0x25b0('0x45')]['id']}})[_0x25b0('0x27')](handleEntityNotFound(_0x394e52,null))[_0x25b0('0x27')](removeEntity(_0x394e52,null))[_0x25b0('0x43')](handleError(_0x394e52,null));}; \ No newline at end of file +var _0xac4a=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshdeskField','type','key','model','query','filters','intersection','attributes','fields'];(function(_0x5a1cc9,_0x28f54d){var _0x471761=function(_0xda51c0){while(--_0xda51c0){_0x5a1cc9['push'](_0x5a1cc9['shift']());}};_0x471761(++_0x28f54d);}(_0xac4a,0x13f));var _0xaac4=function(_0x26f774,_0x2a1c93){_0x26f774=_0x26f774-0x0;var _0x1ac75c=_0xac4a[_0x26f774];return _0x1ac75c;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={},_0x16b33c={},_0xda10b6={'count':0x0,'rows':[]};var _0xb76ccc=_[_0xaac4('0x29')](db[_0xaac4('0x2a')]['rawAttributes'],function(_0xcf6c1){return{'name':_0xcf6c1['fieldName'],'type':_0xcf6c1[_0xaac4('0x2b')][_0xaac4('0x2c')]};});_0x16b33c[_0xaac4('0x2d')]=_[_0xaac4('0x29')](_0xb76ccc,'name');_0x16b33c['query']=_['keys'](_0x386c9b[_0xaac4('0x2e')]);_0x16b33c[_0xaac4('0x2f')]=_[_0xaac4('0x30')](_0x16b33c[_0xaac4('0x2d')],_0x16b33c[_0xaac4('0x2e')]);_0x316445[_0xaac4('0x31')]=_[_0xaac4('0x30')](_0x16b33c[_0xaac4('0x2d')],qs[_0xaac4('0x32')](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x32')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x33')]?_0x316445[_0xaac4('0x31')]:_0x16b33c['model'];if(!_0x386c9b['query'][_0xaac4('0x34')](_0xaac4('0x35'))){_0x316445[_0xaac4('0x1a')]=qs['limit'](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x1a')]);_0x316445[_0xaac4('0x18')]=qs[_0xaac4('0x18')](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x18')]);}_0x316445[_0xaac4('0x36')]=qs['sort'](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x37')]);_0x316445[_0xaac4('0x38')]=qs['filters'](_[_0xaac4('0x39')](_0x386c9b['query'],_0x16b33c['filters']),_0xb76ccc);if(_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x3a')]){_0x316445[_0xaac4('0x38')]=_['merge'](_0x316445['where'],{'$or':_[_0xaac4('0x29')](_0xb76ccc,function(_0x33cc4){if(_0x33cc4[_0xaac4('0x2b')]!==_0xaac4('0x3b')){var _0x2b65b1={};_0x2b65b1[_0x33cc4[_0xaac4('0x26')]]={'$like':'%'+_0x386c9b['query']['filter']+'%'};return _0x2b65b1;}})});}_0x316445=_[_0xaac4('0x3c')]({},_0x316445,_0x386c9b[_0xaac4('0x3d')]);var _0x5371b4={'where':_0x316445[_0xaac4('0x38')]};return db[_0xaac4('0x2a')][_0xaac4('0x1b')](_0x5371b4)['then'](function(_0x74a1c){_0xda10b6[_0xaac4('0x1b')]=_0x74a1c;if(_0x386c9b[_0xaac4('0x2e')]['includeAll']){_0x316445[_0xaac4('0x3e')]=[{'all':!![]}];}return db[_0xaac4('0x2a')][_0xaac4('0x3f')](_0x316445);})[_0xaac4('0x23')](function(_0x51e59d){_0xda10b6[_0xaac4('0x40')]=_0x51e59d;return _0xda10b6;})['then'](respondWithFilteredResult(_0x4d0f5f,_0x316445))['catch'](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x41')]=function(_0x31e240,_0x27df36){var _0x40c007={'raw':!![],'where':{'id':_0x31e240[_0xaac4('0x42')]['id']}},_0x43bc12={};_0x43bc12[_0xaac4('0x2d')]=_[_0xaac4('0x43')](db['FreshdeskField'][_0xaac4('0x44')]);_0x43bc12[_0xaac4('0x2e')]=_[_0xaac4('0x43')](_0x31e240[_0xaac4('0x2e')]);_0x43bc12['filters']=_[_0xaac4('0x30')](_0x43bc12[_0xaac4('0x2d')],_0x43bc12[_0xaac4('0x2e')]);_0x40c007['attributes']=_[_0xaac4('0x30')](_0x43bc12[_0xaac4('0x2d')],qs[_0xaac4('0x32')](_0x31e240[_0xaac4('0x2e')]['fields']));_0x40c007[_0xaac4('0x31')]=_0x40c007[_0xaac4('0x31')][_0xaac4('0x33')]?_0x40c007['attributes']:_0x43bc12[_0xaac4('0x2d')];if(_0x31e240[_0xaac4('0x2e')][_0xaac4('0x45')]){_0x40c007[_0xaac4('0x3e')]=[{'all':!![]}];}_0x40c007=_[_0xaac4('0x3c')]({},_0x40c007,_0x31e240[_0xaac4('0x3d')]);return db[_0xaac4('0x2a')][_0xaac4('0x46')](_0x40c007)[_0xaac4('0x23')](handleEntityNotFound(_0x27df36,null))['then'](respondWithResult(_0x27df36,null))[_0xaac4('0x47')](handleError(_0x27df36,null));};exports[_0xaac4('0x48')]=function(_0x27425a,_0x360420){return db[_0xaac4('0x2a')]['create'](_0x27425a['body'],{})[_0xaac4('0x23')](respondWithResult(_0x360420,0xc9))[_0xaac4('0x47')](handleError(_0x360420,null));};exports[_0xaac4('0x21')]=function(_0x16c7f4,_0x5f33ea){if(_0x16c7f4[_0xaac4('0x49')]['id']){delete _0x16c7f4['body']['id'];}return db[_0xaac4('0x2a')][_0xaac4('0x46')]({'where':{'id':_0x16c7f4['params']['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x5f33ea,null))[_0xaac4('0x23')](saveUpdates(_0x16c7f4[_0xaac4('0x49')],null))['then'](respondWithResult(_0x5f33ea,null))['catch'](handleError(_0x5f33ea,null));};exports[_0xaac4('0x22')]=function(_0x2c1751,_0x22dda7){return db[_0xaac4('0x2a')][_0xaac4('0x46')]({'where':{'id':_0x2c1751[_0xaac4('0x42')]['id']}})['then'](handleEntityNotFound(_0x22dda7,null))[_0xaac4('0x23')](removeEntity(_0x22dda7,null))[_0xaac4('0x47')](handleError(_0x22dda7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index feca45d..a143305 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 _0x3cbc=['FieldId','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./intFreshdeskField.attributes','define','freshdesk_unique_index','idField'];(function(_0x11e41a,_0x538c92){var _0x1cd093=function(_0x511af9){while(--_0x511af9){_0x11e41a['push'](_0x11e41a['shift']());}};_0x1cd093(++_0x538c92);}(_0x3cbc,0x151));var _0xc3cb=function(_0x663880,_0x180fb0){_0x663880=_0x663880-0x0;var _0x318aee=_0x3cbc[_0x663880];return _0x318aee;};'use strict';var _=require(_0xc3cb('0x0'));var util=require(_0xc3cb('0x1'));var logger=require('../../config/logger')(_0xc3cb('0x2'));var moment=require(_0xc3cb('0x3'));var BPromise=require(_0xc3cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc3cb('0x5'));var config=require(_0xc3cb('0x6'));var attributes=require(_0xc3cb('0x7'));module['exports']=function(_0x13aef5,_0x452f75){return _0x13aef5[_0xc3cb('0x8')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xc3cb('0x9'),'fields':[_0xc3cb('0xa'),_0xc3cb('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0cd6=['idField','FieldId','lodash','util','api','moment','request-promise','path','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index'];(function(_0x5b8be5,_0x482729){var _0x2915dd=function(_0x38b908){while(--_0x38b908){_0x5b8be5['push'](_0x5b8be5['shift']());}};_0x2915dd(++_0x482729);}(_0x0cd6,0x113));var _0x60cd=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0x0cd6[_0x4df6f9];return _0x4b1a73;};'use strict';var _=require(_0x60cd('0x0'));var util=require(_0x60cd('0x1'));var logger=require('../../config/logger')(_0x60cd('0x2'));var moment=require(_0x60cd('0x3'));var BPromise=require('bluebird');var rp=require(_0x60cd('0x4'));var fs=require('fs');var path=require(_0x60cd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x60cd('0x6'));module[_0x60cd('0x7')]=function(_0x22f155,_0x4e3293){return _0x22f155[_0x60cd('0x8')]('FreshdeskField',attributes,{'tableName':_0x60cd('0x9'),'paranoid':![],'indexes':[{'name':_0x60cd('0xa'),'fields':[_0x60cd('0xb'),_0x60cd('0xc')],'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 75d6ca2..e41cc84 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 _0xc5db=['FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xc5db,0x141));var _0xbc5d=function(_0x4be871,_0x23375d){_0x4be871=_0x4be871-0x0;var _0xb7be3d=_0xc5db[_0x4be871];return _0xb7be3d;};'use strict';var _=require(_0xbc5d('0x0'));var util=require(_0xbc5d('0x1'));var moment=require(_0xbc5d('0x2'));var BPromise=require(_0xbc5d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc5d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbc5d('0x5'));var config=require(_0xbc5d('0x6'));var jayson=require(_0xbc5d('0x7'));var client=jayson[_0xbc5d('0x8')][_0xbc5d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18de95,_0x55175a,_0x5f1024){return new BPromise(function(_0x2596f4,_0x15df9f){return client[_0xbc5d('0xa')](_0x18de95,_0x5f1024)[_0xbc5d('0xb')](function(_0x376e05){logger[_0xbc5d('0xc')](_0xbc5d('0xd'),_0x55175a,'request\x20sent');logger[_0xbc5d('0xe')](_0xbc5d('0xf'),_0x55175a,'request\x20sent',JSON[_0xbc5d('0x10')](_0x376e05));if(_0x376e05[_0xbc5d('0x11')]){if(_0x376e05['error'][_0xbc5d('0x12')]===0x1f4){logger[_0xbc5d('0x11')](_0xbc5d('0xd'),_0x55175a,_0x376e05[_0xbc5d('0x11')][_0xbc5d('0x13')]);return _0x15df9f(_0x376e05['error'][_0xbc5d('0x13')]);}logger[_0xbc5d('0x11')](_0xbc5d('0xd'),_0x55175a,_0x376e05[_0xbc5d('0x11')][_0xbc5d('0x13')]);return _0x2596f4(_0x376e05[_0xbc5d('0x11')][_0xbc5d('0x13')]);}else{logger['info'](_0xbc5d('0xd'),_0x55175a,'request\x20sent');_0x2596f4(_0x376e05[_0xbc5d('0x14')][_0xbc5d('0x13')]);}})['catch'](function(_0x3fcdca){logger[_0xbc5d('0x11')](_0xbc5d('0xd'),_0x55175a,_0x3fcdca);_0x15df9f(_0x3fcdca);});});} \ No newline at end of file +var _0x7834=['then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x33a61a,_0x106e32){var _0x7c2dfd=function(_0x2f0acc){while(--_0x2f0acc){_0x33a61a['push'](_0x33a61a['shift']());}};_0x7c2dfd(++_0x106e32);}(_0x7834,0x13f));var _0x4783=function(_0x3a398f,_0x166681){_0x3a398f=_0x3a398f-0x0;var _0x24e696=_0x7834[_0x3a398f];return _0x24e696;};'use strict';var _=require(_0x4783('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4783('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4783('0x2'));var db=require(_0x4783('0x3'))['db'];var utils=require(_0x4783('0x4'));var logger=require(_0x4783('0x5'))(_0x4783('0x6'));var config=require(_0x4783('0x7'));var jayson=require(_0x4783('0x8'));var client=jayson['client'][_0x4783('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf8c030,_0x518da8,_0x2dcf46){return new BPromise(function(_0x16c83e,_0x36c0a7){return client[_0x4783('0xa')](_0xf8c030,_0x2dcf46)[_0x4783('0xb')](function(_0x1f8b29){logger['info'](_0x4783('0xc'),_0x518da8,_0x4783('0xd'));logger[_0x4783('0xe')](_0x4783('0xf'),_0x518da8,_0x4783('0xd'),JSON[_0x4783('0x10')](_0x1f8b29));if(_0x1f8b29[_0x4783('0x11')]){if(_0x1f8b29['error']['code']===0x1f4){logger[_0x4783('0x11')](_0x4783('0xc'),_0x518da8,_0x1f8b29['error'][_0x4783('0x12')]);return _0x36c0a7(_0x1f8b29['error'][_0x4783('0x12')]);}logger[_0x4783('0x11')](_0x4783('0xc'),_0x518da8,_0x1f8b29[_0x4783('0x11')][_0x4783('0x12')]);return _0x16c83e(_0x1f8b29['error'][_0x4783('0x12')]);}else{logger[_0x4783('0x13')](_0x4783('0xc'),_0x518da8,_0x4783('0xd'));_0x16c83e(_0x1f8b29[_0x4783('0x14')][_0x4783('0x12')]);}})[_0x4783('0x15')](function(_0x40dbcf){logger[_0x4783('0x11')](_0x4783('0xc'),_0x518da8,_0x40dbcf);_0x36c0a7(_0x40dbcf);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index dc03267..2188ad1 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 _0x7334=['put','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x2a3baf,_0x1da476){var _0x558fbc=function(_0x891327){while(--_0x891327){_0x2a3baf['push'](_0x2a3baf['shift']());}};_0x558fbc(++_0x1da476);}(_0x7334,0x184));var _0x4733=function(_0x147a5c,_0x24b09b){_0x147a5c=_0x147a5c-0x0;var _0x5f0dfd=_0x7334[_0x147a5c];return _0x5f0dfd;};'use strict';var multer=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var path=require(_0x4733('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4733('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4733('0x4'));var interaction=require(_0x4733('0x5'));var config=require(_0x4733('0x6'));var controller=require(_0x4733('0x7'));router[_0x4733('0x8')]('/',auth[_0x4733('0x9')](),controller[_0x4733('0xa')]);router[_0x4733('0x8')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0xc')]);router[_0x4733('0x8')](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0xe')]);router[_0x4733('0x8')](_0x4733('0xf'),auth['isAuthenticated'](),controller[_0x4733('0x10')]);router[_0x4733('0x11')]('/',auth['isAuthenticated'](),controller[_0x4733('0x12')]);router['post'](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0x13')]);router[_0x4733('0x14')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0x15')]);router['delete'](_0x4733('0xb'),auth['isAuthenticated'](),controller[_0x4733('0x16')]);module[_0x4733('0x17')]=router; \ No newline at end of file +var _0xbee3=['isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x49ad9b,_0xb3914b){var _0x27bee3=function(_0x221da7){while(--_0x221da7){_0x49ad9b['push'](_0x49ad9b['shift']());}};_0x27bee3(++_0xb3914b);}(_0xbee3,0xd5));var _0x3bee=function(_0x503a92,_0x435784){_0x503a92=_0x503a92-0x0;var _0x29214b=_0xbee3[_0x503a92];return _0x29214b;};'use strict';var multer=require('multer');var util=require(_0x3bee('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3bee('0x1'));var router=express[_0x3bee('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3bee('0x3'));var interaction=require(_0x3bee('0x4'));var config=require(_0x3bee('0x5'));var controller=require('./intFreshsalesAccount.controller');router[_0x3bee('0x6')]('/',auth[_0x3bee('0x7')](),controller['index']);router[_0x3bee('0x6')](_0x3bee('0x8'),auth[_0x3bee('0x7')](),controller[_0x3bee('0x9')]);router[_0x3bee('0x6')](_0x3bee('0xa'),auth[_0x3bee('0x7')](),controller['getConfigurations']);router[_0x3bee('0x6')](_0x3bee('0xb'),auth[_0x3bee('0x7')](),controller[_0x3bee('0xc')]);router[_0x3bee('0xd')]('/',auth[_0x3bee('0x7')](),controller['create']);router[_0x3bee('0xd')]('/:id/configurations',auth[_0x3bee('0x7')](),controller[_0x3bee('0xe')]);router[_0x3bee('0xf')](_0x3bee('0x8'),auth[_0x3bee('0x7')](),controller[_0x3bee('0x10')]);router[_0x3bee('0x11')]('/:id',auth[_0x3bee('0x7')](),controller[_0x3bee('0x12')]);module[_0x3bee('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index ac0a445..48cfc75 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 _0x4325=['exports','STRING','username','remoteUri','sequelize'];(function(_0x47e397,_0x2b5f29){var _0x459950=function(_0x43f7f9){while(--_0x43f7f9){_0x47e397['push'](_0x47e397['shift']());}};_0x459950(++_0x2b5f29);}(_0x4325,0x1da));var _0x5432=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4325[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x5432('0x0'));module[_0x5432('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5432('0x2')]},'username':{'type':Sequelize[_0x5432('0x2')],'unique':_0x5432('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x5432('0x4')},'serverUrl':{'type':Sequelize[_0x5432('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xef0f=['sequelize','STRING','remoteUri'];(function(_0x48d2e0,_0x1120a6){var _0x16d3d3=function(_0x4797a5){while(--_0x4797a5){_0x48d2e0['push'](_0x48d2e0['shift']());}};_0x16d3d3(++_0x1120a6);}(_0xef0f,0x168));var _0xfef0=function(_0x7b203c,_0x4db126){_0x7b203c=_0x7b203c-0x0;var _0x26098b=_0xef0f[_0x7b203c];return _0x26098b;};'use strict';var Sequelize=require(_0xfef0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfef0('0x1')]},'description':{'type':Sequelize[_0xfef0('0x1')]},'username':{'type':Sequelize[_0xfef0('0x1')],'unique':'username'},'apiKey':{'type':Sequelize[_0xfef0('0x1')]},'remoteUri':{'type':Sequelize[_0xfef0('0x1')],'unique':_0xfef0('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 7135959..e4520b3 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 _0xcaff=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','FreshsalesAccount','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','find','create','body','params','getConfigurations','filter','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','findOne','username','remoteUri','substring','lastIndexOf','format','Token\x20token=','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x400672,_0x243a7e){var _0x27ed65=function(_0x350ca9){while(--_0x350ca9){_0x400672['push'](_0x400672['shift']());}};_0x27ed65(++_0x243a7e);}(_0xcaff,0x1bc));var _0xfcaf=function(_0x55ee68,_0x318f37){_0x55ee68=_0x55ee68-0x0;var _0x2da246=_0xcaff[_0x55ee68];return _0x2da246;};'use strict';var emlformat=require(_0xfcaf('0x0'));var rimraf=require(_0xfcaf('0x1'));var zipdir=require(_0xfcaf('0x2'));var jsonpatch=require(_0xfcaf('0x3'));var rp=require('request-promise');var moment=require(_0xfcaf('0x4'));var BPromise=require(_0xfcaf('0x5'));var Mustache=require(_0xfcaf('0x6'));var util=require(_0xfcaf('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfcaf('0x8'));var ejs=require(_0xfcaf('0x9'));var fs=require('fs');var fs_extra=require(_0xfcaf('0xa'));var _=require(_0xfcaf('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfcaf('0xc'));var Papa=require('papaparse');var Redis=require(_0xfcaf('0xd'));var authService=require(_0xfcaf('0xe'));var qs=require(_0xfcaf('0xf'));var as=require(_0xfcaf('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcaf('0x11'))(_0xfcaf('0x12'));var utils=require('../../config/utils');var config=require(_0xfcaf('0x13'));var licenseUtil=require(_0xfcaf('0x14'));var db=require(_0xfcaf('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2e913a,_0x37979b){_0x37979b=_0x37979b||0xcc;return function(_0x45602d){if(_0x45602d){return _0x2e913a[_0xfcaf('0x16')](_0x37979b);}return _0x2e913a[_0xfcaf('0x17')](_0x37979b)[_0xfcaf('0x18')]();};}function respondWithResult(_0x3dde49,_0xa7fb13){_0xa7fb13=_0xa7fb13||0xc8;return function(_0x2dc281){if(_0x2dc281){return _0x3dde49['status'](_0xa7fb13)[_0xfcaf('0x19')](_0x2dc281);}};}function respondWithFilteredResult(_0x4a9aa4,_0x3fbcf1){return function(_0x4a941d){if(_0x4a941d){var _0x2c2932=typeof _0x3fbcf1[_0xfcaf('0x1a')]===_0xfcaf('0x1b')&&typeof _0x3fbcf1['limit']===_0xfcaf('0x1b');var _0x2c123c=_0x4a941d[_0xfcaf('0x1c')];var _0x37c4de=_0x2c2932?0x0:_0x3fbcf1['offset'];var _0x5ced6b=_0x2c2932?_0x4a941d['count']:_0x3fbcf1[_0xfcaf('0x1a')]+_0x3fbcf1[_0xfcaf('0x1d')];var _0xcc9297;if(_0x5ced6b>=_0x2c123c){_0x5ced6b=_0x2c123c;_0xcc9297=0xc8;}else{_0xcc9297=0xce;}_0x4a9aa4['status'](_0xcc9297);return _0x4a9aa4[_0xfcaf('0x1e')](_0xfcaf('0x1f'),_0x37c4de+'-'+_0x5ced6b+'/'+_0x2c123c)[_0xfcaf('0x19')](_0x4a941d);}return null;};}function patchUpdates(_0x19abc2){return function(_0x49e503){try{jsonpatch[_0xfcaf('0x20')](_0x49e503,_0x19abc2,!![]);}catch(_0xce828){return BPromise[_0xfcaf('0x21')](_0xce828);}return _0x49e503[_0xfcaf('0x22')]();};}function saveUpdates(_0x1f54d2,_0xad6f6e){return function(_0x28d458){if(_0x28d458){return _0x28d458[_0xfcaf('0x23')](_0x1f54d2)['then'](function(_0x5d6bb8){return _0x5d6bb8;});}return null;};}function removeEntity(_0x268e71,_0x10fb3d){return function(_0x2ced89){if(_0x2ced89){return _0x2ced89[_0xfcaf('0x24')]()['then'](function(){_0x268e71[_0xfcaf('0x17')](0xcc)[_0xfcaf('0x18')]();});}};}function handleEntityNotFound(_0x436555,_0x420774){return function(_0x5b3a0c){if(!_0x5b3a0c){_0x436555[_0xfcaf('0x16')](0x194);}return _0x5b3a0c;};}function handleError(_0x535e01,_0x41300d){_0x41300d=_0x41300d||0x1f4;return function(_0x134f6b){logger['error'](_0x134f6b['stack']);if(_0x134f6b[_0xfcaf('0x25')]){delete _0x134f6b[_0xfcaf('0x25')];}_0x535e01[_0xfcaf('0x17')](_0x41300d)[_0xfcaf('0x26')](_0x134f6b);};}exports[_0xfcaf('0x27')]=function(_0x42c792,_0x36eb13){var _0x344289={},_0x586bc6={},_0x121c15={'count':0x0,'rows':[]};var _0x1cc8af=_['map'](db[_0xfcaf('0x28')][_0xfcaf('0x29')],function(_0xefec4a){return{'name':_0xefec4a['fieldName'],'type':_0xefec4a[_0xfcaf('0x2a')][_0xfcaf('0x2b')]};});_0x586bc6[_0xfcaf('0x2c')]=_[_0xfcaf('0x2d')](_0x1cc8af,_0xfcaf('0x25'));_0x586bc6['query']=_[_0xfcaf('0x2e')](_0x42c792[_0xfcaf('0x2f')]);_0x586bc6[_0xfcaf('0x30')]=_[_0xfcaf('0x31')](_0x586bc6[_0xfcaf('0x2c')],_0x586bc6[_0xfcaf('0x2f')]);_0x344289[_0xfcaf('0x32')]=_[_0xfcaf('0x31')](_0x586bc6[_0xfcaf('0x2c')],qs[_0xfcaf('0x33')](_0x42c792[_0xfcaf('0x2f')][_0xfcaf('0x33')]));_0x344289['attributes']=_0x344289[_0xfcaf('0x32')][_0xfcaf('0x34')]?_0x344289['attributes']:_0x586bc6[_0xfcaf('0x2c')];if(!_0x42c792[_0xfcaf('0x2f')][_0xfcaf('0x35')](_0xfcaf('0x36'))){_0x344289[_0xfcaf('0x1d')]=qs[_0xfcaf('0x1d')](_0x42c792['query']['limit']);_0x344289[_0xfcaf('0x1a')]=qs[_0xfcaf('0x1a')](_0x42c792[_0xfcaf('0x2f')]['offset']);}_0x344289[_0xfcaf('0x37')]=qs['sort'](_0x42c792[_0xfcaf('0x2f')][_0xfcaf('0x38')]);_0x344289[_0xfcaf('0x39')]=qs[_0xfcaf('0x30')](_[_0xfcaf('0x3a')](_0x42c792[_0xfcaf('0x2f')],_0x586bc6[_0xfcaf('0x30')]),_0x1cc8af);if(_0x42c792[_0xfcaf('0x2f')]['filter']){_0x344289[_0xfcaf('0x39')]=_['merge'](_0x344289[_0xfcaf('0x39')],{'$or':_[_0xfcaf('0x2d')](_0x1cc8af,function(_0x33352c){if(_0x33352c[_0xfcaf('0x2a')]!==_0xfcaf('0x3b')){var _0x1072f6={};_0x1072f6[_0x33352c[_0xfcaf('0x25')]]={'$like':'%'+_0x42c792['query']['filter']+'%'};return _0x1072f6;}})});}_0x344289=_[_0xfcaf('0x3c')]({},_0x344289,_0x42c792[_0xfcaf('0x3d')]);var _0x157733={'where':_0x344289['where']};return db[_0xfcaf('0x28')][_0xfcaf('0x1c')](_0x157733)[_0xfcaf('0x3e')](function(_0x2f65e5){_0x121c15[_0xfcaf('0x1c')]=_0x2f65e5;if(_0x42c792[_0xfcaf('0x2f')][_0xfcaf('0x3f')]){_0x344289[_0xfcaf('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xfcaf('0x41')](_0x344289);})[_0xfcaf('0x3e')](function(_0x3dc8cc){_0x121c15[_0xfcaf('0x42')]=_0x3dc8cc;return _0x121c15;})[_0xfcaf('0x3e')](respondWithFilteredResult(_0x36eb13,_0x344289))[_0xfcaf('0x43')](handleError(_0x36eb13,null));};exports['show']=function(_0x77d251,_0x4b1311){var _0x85cd72={'raw':![],'where':{'id':_0x77d251['params']['id']}},_0x1afa2c={};_0x1afa2c[_0xfcaf('0x2c')]=_['keys'](db[_0xfcaf('0x28')][_0xfcaf('0x29')]);_0x1afa2c['query']=_['keys'](_0x77d251['query']);_0x1afa2c[_0xfcaf('0x30')]=_['intersection'](_0x1afa2c['model'],_0x1afa2c[_0xfcaf('0x2f')]);_0x85cd72['attributes']=_[_0xfcaf('0x31')](_0x1afa2c[_0xfcaf('0x2c')],qs[_0xfcaf('0x33')](_0x77d251['query'][_0xfcaf('0x33')]));_0x85cd72[_0xfcaf('0x32')]=_0x85cd72['attributes'][_0xfcaf('0x34')]?_0x85cd72[_0xfcaf('0x32')]:_0x1afa2c[_0xfcaf('0x2c')];if(_0x77d251[_0xfcaf('0x2f')][_0xfcaf('0x3f')]){_0x85cd72[_0xfcaf('0x40')]=[{'all':!![]}];}_0x85cd72=_[_0xfcaf('0x3c')]({},_0x85cd72,_0x77d251[_0xfcaf('0x3d')]);return db[_0xfcaf('0x28')][_0xfcaf('0x44')](_0x85cd72)['then'](handleEntityNotFound(_0x4b1311,null))[_0xfcaf('0x3e')](respondWithResult(_0x4b1311,null))['catch'](handleError(_0x4b1311,null));};exports[_0xfcaf('0x45')]=function(_0x76fd40,_0x3d1983){return db['FreshsalesAccount'][_0xfcaf('0x45')](_0x76fd40[_0xfcaf('0x46')],{})[_0xfcaf('0x3e')](respondWithResult(_0x3d1983,0xc9))[_0xfcaf('0x43')](handleError(_0x3d1983,null));};exports[_0xfcaf('0x23')]=function(_0x2ea91b,_0x8ed726){if(_0x2ea91b[_0xfcaf('0x46')]['id']){delete _0x2ea91b[_0xfcaf('0x46')]['id'];}return db['FreshsalesAccount'][_0xfcaf('0x44')]({'where':{'id':_0x2ea91b['params']['id']}})[_0xfcaf('0x3e')](handleEntityNotFound(_0x8ed726,null))[_0xfcaf('0x3e')](saveUpdates(_0x2ea91b[_0xfcaf('0x46')],null))[_0xfcaf('0x3e')](respondWithResult(_0x8ed726,null))[_0xfcaf('0x43')](handleError(_0x8ed726,null));};exports[_0xfcaf('0x24')]=function(_0x3a400d,_0x37370a){return db[_0xfcaf('0x28')]['find']({'where':{'id':_0x3a400d[_0xfcaf('0x47')]['id']}})[_0xfcaf('0x3e')](handleEntityNotFound(_0x37370a,null))['then'](removeEntity(_0x37370a,null))['catch'](handleError(_0x37370a,null));};exports[_0xfcaf('0x48')]=function(_0x4d5727,_0x4e57bf,_0x482d1b){var _0x1243ab={};var _0x28b6d8={};var _0x24130b;var _0x4a750b;return db[_0xfcaf('0x28')]['findOne']({'where':{'id':_0x4d5727[_0xfcaf('0x47')]['id']}})[_0xfcaf('0x3e')](handleEntityNotFound(_0x4e57bf,null))[_0xfcaf('0x3e')](function(_0x25b7cc){if(_0x25b7cc){_0x24130b=_0x25b7cc;_0x28b6d8[_0xfcaf('0x2c')]=_[_0xfcaf('0x2e')](db['FreshsalesConfiguration'][_0xfcaf('0x29')]);_0x28b6d8[_0xfcaf('0x2f')]=_['keys'](_0x4d5727[_0xfcaf('0x2f')]);_0x28b6d8[_0xfcaf('0x30')]=_[_0xfcaf('0x31')](_0x28b6d8[_0xfcaf('0x2c')],_0x28b6d8[_0xfcaf('0x2f')]);_0x1243ab[_0xfcaf('0x32')]=_['intersection'](_0x28b6d8['model'],qs['fields'](_0x4d5727['query'][_0xfcaf('0x33')]));_0x1243ab['attributes']=_0x1243ab['attributes']['length']?_0x1243ab[_0xfcaf('0x32')]:_0x28b6d8[_0xfcaf('0x2c')];_0x1243ab[_0xfcaf('0x37')]=qs[_0xfcaf('0x38')](_0x4d5727['query']['sort']);_0x1243ab[_0xfcaf('0x39')]=qs[_0xfcaf('0x30')](_[_0xfcaf('0x3a')](_0x4d5727[_0xfcaf('0x2f')],_0x28b6d8[_0xfcaf('0x30')]));if(_0x4d5727[_0xfcaf('0x2f')][_0xfcaf('0x49')]){_0x1243ab[_0xfcaf('0x39')]=_['merge'](_0x1243ab[_0xfcaf('0x39')],{'$or':_[_0xfcaf('0x2d')](_0x1243ab[_0xfcaf('0x32')],function(_0x1bc7bb){var _0x3786b7={};_0x3786b7[_0x1bc7bb]={'$like':'%'+_0x4d5727[_0xfcaf('0x2f')][_0xfcaf('0x49')]+'%'};return _0x3786b7;})});}_0x1243ab=_[_0xfcaf('0x3c')]({},_0x1243ab,_0x4d5727[_0xfcaf('0x3d')]);return _0x24130b['getConfigurations'](_0x1243ab);}})['then'](function(_0x557405){if(_0x557405){_0x4a750b=_0x557405[_0xfcaf('0x34')];if(!_0x4d5727['query'][_0xfcaf('0x35')](_0xfcaf('0x36'))){_0x1243ab['limit']=qs[_0xfcaf('0x1d')](_0x4d5727[_0xfcaf('0x2f')][_0xfcaf('0x1d')]);_0x1243ab[_0xfcaf('0x1a')]=qs[_0xfcaf('0x1a')](_0x4d5727['query'][_0xfcaf('0x1a')]);}return _0x24130b['getConfigurations'](_0x1243ab);}})[_0xfcaf('0x3e')](function(_0xe11362){if(_0xe11362){return _0xe11362?{'count':_0x4a750b,'rows':_0xe11362}:null;}})['then'](respondWithResult(_0x4e57bf,null))[_0xfcaf('0x43')](handleError(_0x4e57bf,null));};exports['addConfiguration']=function(_0x1f4937,_0x3058d7,_0x3ca40a){if(_0x1f4937[_0xfcaf('0x46')]['id']){delete _0x1f4937[_0xfcaf('0x46')]['id'];}return db[_0xfcaf('0x28')]['findOne']({'where':{'id':_0x1f4937[_0xfcaf('0x47')]['id']}})[_0xfcaf('0x3e')](handleEntityNotFound(_0x3058d7,null))[_0xfcaf('0x3e')](function(_0x5d5d5e){if(_0x5d5d5e){_0x1f4937[_0xfcaf('0x46')][_0xfcaf('0x4a')]=_0x5d5d5e['id'];_0x1f4937[_0xfcaf('0x46')][_0xfcaf('0x4b')]=integrations[_0xfcaf('0x4c')](_0x1f4937['body'][_0xfcaf('0x4d')],_0x1f4937[_0xfcaf('0x46')][_0xfcaf('0x2a')]);_0x1f4937[_0xfcaf('0x46')][_0xfcaf('0x4e')]=integrations[_0xfcaf('0x4f')](_0x1f4937[_0xfcaf('0x46')]['channel'],_0x1f4937[_0xfcaf('0x46')][_0xfcaf('0x2a')]);return db['FreshsalesConfiguration'][_0xfcaf('0x45')](_0x1f4937['body'],{'include':[{'model':db[_0xfcaf('0x50')],'as':'Subjects'},{'model':db[_0xfcaf('0x50')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3058d7,null))[_0xfcaf('0x43')](handleError(_0x3058d7,null));};exports['getFields']=function(_0x38805d,_0x3255a4,_0x4438a4){var _0x344cd6='';var _0xc367a4='';return db['FreshsalesAccount'][_0xfcaf('0x51')]({'where':{'id':_0x38805d['params']['id']},'attributes':['id',_0xfcaf('0x52'),_0xfcaf('0x53'),'apiKey']})[_0xfcaf('0x3e')](handleEntityNotFound(_0x3255a4,null))['then'](function(_0x339b03){if(_0x339b03){_0xc367a4=_0x339b03[_0xfcaf('0x52')];_0x344cd6=_0x339b03[_0xfcaf('0x53')];var _0x57d507=_0x339b03['remoteUri']['slice'](-0x1);if(_0x57d507==='/'){_0x344cd6=_0x344cd6[_0xfcaf('0x54')](0x0,_0x344cd6[_0xfcaf('0x55')](_0x57d507));}return rp({'method':'GET','uri':util[_0xfcaf('0x56')]('%s%s',_0x344cd6,'/api/selector/owners'),'headers':{'Authorization':_0xfcaf('0x57')+_0x339b03['apiKey']},'json':!![]});}})['then'](function(_0x15b40c){if(_0x15b40c){var _0x1a873e=_0x15b40c['users'];var _0x4833ab=![];var _0x139535=null;for(_0x139535=0x0;_0x139535<_0x1a873e[_0xfcaf('0x34')];_0x139535++){if(_0x1a873e[_0x139535]['email']===_0xc367a4){_0x4833ab=!![];}}if(_0x4833ab){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xfcaf('0x3e')](respondWithResult(_0x3255a4,null))['catch'](function(_0x1d8f01){var _0x5a2314=_0x38805d[_0xfcaf('0x2f')][_0xfcaf('0x58')]?0x1f4:_0x1d8f01[_0xfcaf('0x59')]||0x1f4;logger['error'](_0xfcaf('0x5a'),'getFields',_0x5a2314,JSON[_0xfcaf('0x5b')](_0x1d8f01));delete _0x1d8f01[_0xfcaf('0x25')];if(_0x5a2314===0x191){_0x5a2314=0x190;}_0x3255a4[_0xfcaf('0x17')](_0x5a2314)['send'](_0x38805d[_0xfcaf('0x2f')][_0xfcaf('0x58')]?{'message':_0xfcaf('0x5c'),'statusCode':_0x1d8f01[_0xfcaf('0x59')]}:_0x1d8f01);});}; \ No newline at end of file +var _0x1c44=['status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','FreshsalesAccount','catch','keys','fields','options','find','create','body','params','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s%s','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration'];(function(_0x530dcf,_0x1bcf32){var _0x23c1bb=function(_0x5d9300){while(--_0x5d9300){_0x530dcf['push'](_0x530dcf['shift']());}};_0x23c1bb(++_0x1bcf32);}(_0x1c44,0x10e));var _0x41c4=function(_0x4f3555,_0x40a06f){_0x4f3555=_0x4f3555-0x0;var _0x1c2142=_0x1c44[_0x4f3555];return _0x1c2142;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x41c4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x41c4('0x1'));var rp=require(_0x41c4('0x2'));var moment=require(_0x41c4('0x3'));var BPromise=require(_0x41c4('0x4'));var Mustache=require(_0x41c4('0x5'));var util=require(_0x41c4('0x6'));var path=require(_0x41c4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x41c4('0x8'));var fs=require('fs');var fs_extra=require(_0x41c4('0x9'));var _=require('lodash');var squel=require(_0x41c4('0xa'));var crypto=require('crypto');var jsforce=require(_0x41c4('0xb'));var deskjs=require(_0x41c4('0xc'));var toCsv=require(_0x41c4('0xd'));var querystring=require(_0x41c4('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x41c4('0xf'));var qs=require(_0x41c4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x41c4('0x11'))(_0x41c4('0x12'));var utils=require(_0x41c4('0x13'));var config=require(_0x41c4('0x14'));var licenseUtil=require(_0x41c4('0x15'));var db=require(_0x41c4('0x16'))['db'];var integrations=require(_0x41c4('0x17'));function respondWithStatusCode(_0x5144cd,_0x5c35a2){_0x5c35a2=_0x5c35a2||0xcc;return function(_0x25642c){if(_0x25642c){return _0x5144cd['sendStatus'](_0x5c35a2);}return _0x5144cd[_0x41c4('0x18')](_0x5c35a2)['end']();};}function respondWithResult(_0x3f1dae,_0x2f8cd1){_0x2f8cd1=_0x2f8cd1||0xc8;return function(_0x203a5f){if(_0x203a5f){return _0x3f1dae[_0x41c4('0x18')](_0x2f8cd1)[_0x41c4('0x19')](_0x203a5f);}};}function respondWithFilteredResult(_0x240033,_0x4eafa6){return function(_0x11ef1e){if(_0x11ef1e){var _0x5f79e5=typeof _0x4eafa6[_0x41c4('0x1a')]===_0x41c4('0x1b')&&typeof _0x4eafa6[_0x41c4('0x1c')]==='undefined';var _0x3c0b62=_0x11ef1e[_0x41c4('0x1d')];var _0x43d1f9=_0x5f79e5?0x0:_0x4eafa6[_0x41c4('0x1a')];var _0x110ecb=_0x5f79e5?_0x11ef1e[_0x41c4('0x1d')]:_0x4eafa6[_0x41c4('0x1a')]+_0x4eafa6[_0x41c4('0x1c')];var _0x4aca1a;if(_0x110ecb>=_0x3c0b62){_0x110ecb=_0x3c0b62;_0x4aca1a=0xc8;}else{_0x4aca1a=0xce;}_0x240033[_0x41c4('0x18')](_0x4aca1a);return _0x240033[_0x41c4('0x1e')](_0x41c4('0x1f'),_0x43d1f9+'-'+_0x110ecb+'/'+_0x3c0b62)[_0x41c4('0x19')](_0x11ef1e);}return null;};}function patchUpdates(_0xb24e){return function(_0x21734b){try{jsonpatch['apply'](_0x21734b,_0xb24e,!![]);}catch(_0x1b11c5){return BPromise[_0x41c4('0x20')](_0x1b11c5);}return _0x21734b[_0x41c4('0x21')]();};}function saveUpdates(_0x36cb6e,_0x1f6851){return function(_0x49a78e){if(_0x49a78e){return _0x49a78e['update'](_0x36cb6e)[_0x41c4('0x22')](function(_0x4daa78){return _0x4daa78;});}return null;};}function removeEntity(_0x58eea0,_0x5d27ec){return function(_0x18772a){if(_0x18772a){return _0x18772a[_0x41c4('0x23')]()[_0x41c4('0x22')](function(){_0x58eea0[_0x41c4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e117f,_0x146312){return function(_0x93a581){if(!_0x93a581){_0x2e117f['sendStatus'](0x194);}return _0x93a581;};}function handleError(_0x190b0f,_0x2cb280){_0x2cb280=_0x2cb280||0x1f4;return function(_0x5dc122){logger[_0x41c4('0x24')](_0x5dc122[_0x41c4('0x25')]);if(_0x5dc122[_0x41c4('0x26')]){delete _0x5dc122['name'];}_0x190b0f[_0x41c4('0x18')](_0x2cb280)[_0x41c4('0x27')](_0x5dc122);};}exports['index']=function(_0x8c1000,_0xe4a990){var _0xbdb298={},_0x1e2ffd={},_0x5ccd66={'count':0x0,'rows':[]};var _0x4415c7=_[_0x41c4('0x28')](db['FreshsalesAccount'][_0x41c4('0x29')],function(_0x4acfbd){return{'name':_0x4acfbd[_0x41c4('0x2a')],'type':_0x4acfbd[_0x41c4('0x2b')]['key']};});_0x1e2ffd[_0x41c4('0x2c')]=_['map'](_0x4415c7,_0x41c4('0x26'));_0x1e2ffd[_0x41c4('0x2d')]=_['keys'](_0x8c1000['query']);_0x1e2ffd['filters']=_[_0x41c4('0x2e')](_0x1e2ffd[_0x41c4('0x2c')],_0x1e2ffd[_0x41c4('0x2d')]);_0xbdb298[_0x41c4('0x2f')]=_[_0x41c4('0x2e')](_0x1e2ffd[_0x41c4('0x2c')],qs['fields'](_0x8c1000[_0x41c4('0x2d')]['fields']));_0xbdb298[_0x41c4('0x2f')]=_0xbdb298[_0x41c4('0x2f')][_0x41c4('0x30')]?_0xbdb298[_0x41c4('0x2f')]:_0x1e2ffd[_0x41c4('0x2c')];if(!_0x8c1000[_0x41c4('0x2d')][_0x41c4('0x31')](_0x41c4('0x32'))){_0xbdb298[_0x41c4('0x1c')]=qs['limit'](_0x8c1000[_0x41c4('0x2d')][_0x41c4('0x1c')]);_0xbdb298['offset']=qs['offset'](_0x8c1000[_0x41c4('0x2d')][_0x41c4('0x1a')]);}_0xbdb298[_0x41c4('0x33')]=qs[_0x41c4('0x34')](_0x8c1000[_0x41c4('0x2d')]['sort']);_0xbdb298[_0x41c4('0x35')]=qs[_0x41c4('0x36')](_[_0x41c4('0x37')](_0x8c1000[_0x41c4('0x2d')],_0x1e2ffd[_0x41c4('0x36')]),_0x4415c7);if(_0x8c1000['query'][_0x41c4('0x38')]){_0xbdb298['where']=_[_0x41c4('0x39')](_0xbdb298[_0x41c4('0x35')],{'$or':_['map'](_0x4415c7,function(_0x39511c){if(_0x39511c[_0x41c4('0x2b')]!==_0x41c4('0x3a')){var _0x139423={};_0x139423[_0x39511c[_0x41c4('0x26')]]={'$like':'%'+_0x8c1000['query'][_0x41c4('0x38')]+'%'};return _0x139423;}})});}_0xbdb298=_[_0x41c4('0x39')]({},_0xbdb298,_0x8c1000['options']);var _0x44bb35={'where':_0xbdb298[_0x41c4('0x35')]};return db['FreshsalesAccount']['count'](_0x44bb35)[_0x41c4('0x22')](function(_0x1b540f){_0x5ccd66[_0x41c4('0x1d')]=_0x1b540f;if(_0x8c1000[_0x41c4('0x2d')][_0x41c4('0x3b')]){_0xbdb298[_0x41c4('0x3c')]=[{'all':!![]}];}return db[_0x41c4('0x3d')]['findAll'](_0xbdb298);})[_0x41c4('0x22')](function(_0x4b218c){_0x5ccd66['rows']=_0x4b218c;return _0x5ccd66;})[_0x41c4('0x22')](respondWithFilteredResult(_0xe4a990,_0xbdb298))[_0x41c4('0x3e')](handleError(_0xe4a990,null));};exports['show']=function(_0x5d6819,_0x450955){var _0x5612c1={'raw':![],'where':{'id':_0x5d6819['params']['id']}},_0x1ddfb6={};_0x1ddfb6['model']=_['keys'](db['FreshsalesAccount'][_0x41c4('0x29')]);_0x1ddfb6[_0x41c4('0x2d')]=_[_0x41c4('0x3f')](_0x5d6819[_0x41c4('0x2d')]);_0x1ddfb6['filters']=_[_0x41c4('0x2e')](_0x1ddfb6[_0x41c4('0x2c')],_0x1ddfb6[_0x41c4('0x2d')]);_0x5612c1[_0x41c4('0x2f')]=_[_0x41c4('0x2e')](_0x1ddfb6[_0x41c4('0x2c')],qs[_0x41c4('0x40')](_0x5d6819[_0x41c4('0x2d')][_0x41c4('0x40')]));_0x5612c1['attributes']=_0x5612c1[_0x41c4('0x2f')][_0x41c4('0x30')]?_0x5612c1['attributes']:_0x1ddfb6[_0x41c4('0x2c')];if(_0x5d6819[_0x41c4('0x2d')]['includeAll']){_0x5612c1[_0x41c4('0x3c')]=[{'all':!![]}];}_0x5612c1=_[_0x41c4('0x39')]({},_0x5612c1,_0x5d6819[_0x41c4('0x41')]);return db[_0x41c4('0x3d')][_0x41c4('0x42')](_0x5612c1)[_0x41c4('0x22')](handleEntityNotFound(_0x450955,null))[_0x41c4('0x22')](respondWithResult(_0x450955,null))[_0x41c4('0x3e')](handleError(_0x450955,null));};exports[_0x41c4('0x43')]=function(_0x51f952,_0x49ccab){return db[_0x41c4('0x3d')][_0x41c4('0x43')](_0x51f952['body'],{})[_0x41c4('0x22')](respondWithResult(_0x49ccab,0xc9))['catch'](handleError(_0x49ccab,null));};exports['update']=function(_0x491956,_0x37f23b){if(_0x491956[_0x41c4('0x44')]['id']){delete _0x491956[_0x41c4('0x44')]['id'];}return db[_0x41c4('0x3d')][_0x41c4('0x42')]({'where':{'id':_0x491956[_0x41c4('0x45')]['id']}})[_0x41c4('0x22')](handleEntityNotFound(_0x37f23b,null))['then'](saveUpdates(_0x491956['body'],null))[_0x41c4('0x22')](respondWithResult(_0x37f23b,null))['catch'](handleError(_0x37f23b,null));};exports[_0x41c4('0x23')]=function(_0xc783d7,_0x67ab96){return db['FreshsalesAccount'][_0x41c4('0x42')]({'where':{'id':_0xc783d7['params']['id']}})['then'](handleEntityNotFound(_0x67ab96,null))[_0x41c4('0x22')](removeEntity(_0x67ab96,null))[_0x41c4('0x3e')](handleError(_0x67ab96,null));};exports[_0x41c4('0x46')]=function(_0x237639,_0x22b494,_0x3d3bdb){var _0x13315e={};var _0xf29c1e={};var _0x122d35;var _0x2c95dd;return db[_0x41c4('0x3d')][_0x41c4('0x47')]({'where':{'id':_0x237639[_0x41c4('0x45')]['id']}})['then'](handleEntityNotFound(_0x22b494,null))['then'](function(_0x1dd293){if(_0x1dd293){_0x122d35=_0x1dd293;_0xf29c1e[_0x41c4('0x2c')]=_[_0x41c4('0x3f')](db['FreshsalesConfiguration'][_0x41c4('0x29')]);_0xf29c1e['query']=_[_0x41c4('0x3f')](_0x237639[_0x41c4('0x2d')]);_0xf29c1e[_0x41c4('0x36')]=_['intersection'](_0xf29c1e[_0x41c4('0x2c')],_0xf29c1e[_0x41c4('0x2d')]);_0x13315e['attributes']=_[_0x41c4('0x2e')](_0xf29c1e[_0x41c4('0x2c')],qs[_0x41c4('0x40')](_0x237639[_0x41c4('0x2d')][_0x41c4('0x40')]));_0x13315e[_0x41c4('0x2f')]=_0x13315e[_0x41c4('0x2f')][_0x41c4('0x30')]?_0x13315e[_0x41c4('0x2f')]:_0xf29c1e[_0x41c4('0x2c')];_0x13315e[_0x41c4('0x33')]=qs['sort'](_0x237639['query'][_0x41c4('0x34')]);_0x13315e[_0x41c4('0x35')]=qs[_0x41c4('0x36')](_[_0x41c4('0x37')](_0x237639[_0x41c4('0x2d')],_0xf29c1e[_0x41c4('0x36')]));if(_0x237639[_0x41c4('0x2d')][_0x41c4('0x38')]){_0x13315e[_0x41c4('0x35')]=_[_0x41c4('0x39')](_0x13315e['where'],{'$or':_[_0x41c4('0x28')](_0x13315e[_0x41c4('0x2f')],function(_0x1220f0){var _0x58bee7={};_0x58bee7[_0x1220f0]={'$like':'%'+_0x237639[_0x41c4('0x2d')][_0x41c4('0x38')]+'%'};return _0x58bee7;})});}_0x13315e=_['merge']({},_0x13315e,_0x237639[_0x41c4('0x41')]);return _0x122d35[_0x41c4('0x46')](_0x13315e);}})[_0x41c4('0x22')](function(_0x278bf1){if(_0x278bf1){_0x2c95dd=_0x278bf1['length'];if(!_0x237639['query']['hasOwnProperty'](_0x41c4('0x32'))){_0x13315e[_0x41c4('0x1c')]=qs['limit'](_0x237639[_0x41c4('0x2d')][_0x41c4('0x1c')]);_0x13315e['offset']=qs[_0x41c4('0x1a')](_0x237639[_0x41c4('0x2d')]['offset']);}return _0x122d35[_0x41c4('0x46')](_0x13315e);}})[_0x41c4('0x22')](function(_0x596a3a){if(_0x596a3a){return _0x596a3a?{'count':_0x2c95dd,'rows':_0x596a3a}:null;}})[_0x41c4('0x22')](respondWithResult(_0x22b494,null))[_0x41c4('0x3e')](handleError(_0x22b494,null));};exports[_0x41c4('0x48')]=function(_0x57768d,_0x3a30b6,_0x3ca9e2){if(_0x57768d[_0x41c4('0x44')]['id']){delete _0x57768d['body']['id'];}return db['FreshsalesAccount'][_0x41c4('0x47')]({'where':{'id':_0x57768d[_0x41c4('0x45')]['id']}})[_0x41c4('0x22')](handleEntityNotFound(_0x3a30b6,null))[_0x41c4('0x22')](function(_0x1ea695){if(_0x1ea695){_0x57768d['body'][_0x41c4('0x49')]=_0x1ea695['id'];_0x57768d['body'][_0x41c4('0x4a')]=integrations[_0x41c4('0x4b')](_0x57768d[_0x41c4('0x44')][_0x41c4('0x4c')],_0x57768d[_0x41c4('0x44')][_0x41c4('0x2b')]);_0x57768d[_0x41c4('0x44')][_0x41c4('0x4d')]=integrations[_0x41c4('0x4e')](_0x57768d[_0x41c4('0x44')]['channel'],_0x57768d[_0x41c4('0x44')][_0x41c4('0x2b')]);return db[_0x41c4('0x4f')][_0x41c4('0x43')](_0x57768d[_0x41c4('0x44')],{'include':[{'model':db[_0x41c4('0x50')],'as':'Subjects'},{'model':db[_0x41c4('0x50')],'as':_0x41c4('0x4d')}]});}return null;})[_0x41c4('0x22')](respondWithResult(_0x3a30b6,null))[_0x41c4('0x3e')](handleError(_0x3a30b6,null));};exports[_0x41c4('0x51')]=function(_0x2ab6ef,_0x1edb5a,_0x33a98a){var _0x501ff6='';var _0x2d4717='';return db['FreshsalesAccount'][_0x41c4('0x47')]({'where':{'id':_0x2ab6ef[_0x41c4('0x45')]['id']},'attributes':['id',_0x41c4('0x52'),_0x41c4('0x53'),_0x41c4('0x54')]})[_0x41c4('0x22')](handleEntityNotFound(_0x1edb5a,null))[_0x41c4('0x22')](function(_0x45054e){if(_0x45054e){_0x2d4717=_0x45054e['username'];_0x501ff6=_0x45054e[_0x41c4('0x53')];var _0x33327c=_0x45054e[_0x41c4('0x53')][_0x41c4('0x55')](-0x1);if(_0x33327c==='/'){_0x501ff6=_0x501ff6[_0x41c4('0x56')](0x0,_0x501ff6[_0x41c4('0x57')](_0x33327c));}return rp({'method':_0x41c4('0x58'),'uri':util['format'](_0x41c4('0x59'),_0x501ff6,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x45054e['apiKey']},'json':!![]});}})['then'](function(_0x16d455){if(_0x16d455){var _0x383d36=_0x16d455[_0x41c4('0x5a')];var _0x1ff6cc=![];var _0x31a14c=null;for(_0x31a14c=0x0;_0x31a14c<_0x383d36[_0x41c4('0x30')];_0x31a14c++){if(_0x383d36[_0x31a14c][_0x41c4('0x5b')]===_0x2d4717){_0x1ff6cc=!![];}}if(_0x1ff6cc){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x41c4('0x5c')});}}})['then'](respondWithResult(_0x1edb5a,null))[_0x41c4('0x3e')](function(_0x3ec3e0){var _0x378469=_0x2ab6ef['query'][_0x41c4('0x5d')]?0x1f4:_0x3ec3e0[_0x41c4('0x5e')]||0x1f4;logger[_0x41c4('0x24')](_0x41c4('0x5f'),_0x41c4('0x51'),_0x378469,JSON[_0x41c4('0x60')](_0x3ec3e0));delete _0x3ec3e0[_0x41c4('0x26')];if(_0x378469===0x191){_0x378469=0x190;}_0x1edb5a[_0x41c4('0x18')](_0x378469)[_0x41c4('0x27')](_0x2ab6ef[_0x41c4('0x2d')]['test']?{'message':_0x41c4('0x61'),'statusCode':_0x3ec3e0[_0x41c4('0x5e')]}:_0x3ec3e0);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 053a271..2a7c264 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 _0x5430=['../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x5430,0x10c));var _0x0543=function(_0x4e1670,_0x18122c){_0x4e1670=_0x4e1670-0x0;var _0x560bf6=_0x5430[_0x4e1670];return _0x560bf6;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var logger=require(_0x0543('0x2'))(_0x0543('0x3'));var moment=require(_0x0543('0x4'));var BPromise=require(_0x0543('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0543('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x0543('0x7'));module[_0x0543('0x8')]=function(_0x9754ba,_0x319568){return _0x9754ba[_0x0543('0x9')]('FreshsalesAccount',attributes,{'tableName':_0x0543('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa46e=['api','moment','bluebird','path','../../config/environment','../../components/integrations/configuration','FreshsalesAccount','int_freshsales_accounts','lodash','util'];(function(_0x22c9a7,_0xe80a90){var _0x549b24=function(_0x2eb1df){while(--_0x2eb1df){_0x22c9a7['push'](_0x22c9a7['shift']());}};_0x549b24(++_0xe80a90);}(_0xa46e,0x8a));var _0xea46=function(_0x1e6b59,_0x5eca5d){_0x1e6b59=_0x1e6b59-0x0;var _0x40d7c5=_0xa46e[_0x1e6b59];return _0x40d7c5;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var logger=require('../../config/logger')(_0xea46('0x2'));var moment=require(_0xea46('0x3'));var BPromise=require(_0xea46('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea46('0x5'));var rimraf=require('rimraf');var config=require(_0xea46('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0xea46('0x7'));module['exports']=function(_0x10bee5,_0x3dc26f){return _0x10bee5['define'](_0xea46('0x8'),attributes,{'tableName':_0xea46('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 2c3c74e..1235160 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 _0x9f0e=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','limit','include','map','model','attributes','ShowFreshsalesAccount','find','where','lodash','util'];(function(_0x565b93,_0x12c8b8){var _0x84c5ec=function(_0x30327a){while(--_0x30327a){_0x565b93['push'](_0x565b93['shift']());}};_0x84c5ec(++_0x12c8b8);}(_0x9f0e,0x116));var _0xe9f0=function(_0x155a5a,_0x3668f2){_0x155a5a=_0x155a5a-0x0;var _0x473736=_0x9f0e[_0x155a5a];return _0x473736;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});}exports[_0xe9f0('0x16')]=function(_0x2ab12b){var _0x3da237=this;return new Promise(function(_0x59bf5a,_0x15a33b){return db[_0xe9f0('0x17')][_0xe9f0('0x18')]({'raw':_0x2ab12b['options']?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')]['where']||null:null,'attributes':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')]['attributes']||null:null,'limit':_0x2ab12b['options']?_0x2ab12b['options'][_0xe9f0('0x1b')]||null:null,'include':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1c')]?_[_0xe9f0('0x1d')](_0x2ab12b['options'][_0xe9f0('0x1c')],function(_0x38b7ee){return{'model':db[_0x38b7ee[_0xe9f0('0x1e')]],'as':_0x38b7ee['as'],'attributes':_0x38b7ee[_0xe9f0('0x1f')],'include':_0x38b7ee[_0xe9f0('0x1c')]?_[_0xe9f0('0x1d')](_0x38b7ee[_0xe9f0('0x1c')],function(_0x1321bb){return{'model':db[_0x1321bb[_0xe9f0('0x1e')]],'as':_0x1321bb['as'],'attributes':_0x1321bb[_0xe9f0('0x1f')],'include':_0x1321bb['include']?_[_0xe9f0('0x1d')](_0x1321bb[_0xe9f0('0x1c')],function(_0x2ddfba){return{'model':db[_0x2ddfba[_0xe9f0('0x1e')]],'as':_0x2ddfba['as'],'attributes':_0x2ddfba['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9f0('0xb')](function(_0x2613fd){logger[_0xe9f0('0xc')](_0xe9f0('0x16'),_0x2ab12b);logger[_0xe9f0('0xf')]('GetFreshsalesAccount',_0x2ab12b,JSON[_0xe9f0('0x11')](_0x2613fd));_0x59bf5a(_0x2613fd);})[_0xe9f0('0x15')](function(_0x44fb5b){logger[_0xe9f0('0x12')](_0xe9f0('0x16'),_0x44fb5b[_0xe9f0('0x13')],_0x2ab12b);_0x15a33b(_0x3da237[_0xe9f0('0x12')](0x1f4,_0x44fb5b[_0xe9f0('0x13')]));});});};exports[_0xe9f0('0x20')]=function(_0x3dbe49){var _0x22806c=this;return new Promise(function(_0x617ad3,_0x445ad0){return db[_0xe9f0('0x17')][_0xe9f0('0x21')]({'raw':_0x3dbe49[_0xe9f0('0x19')]?_0x3dbe49[_0xe9f0('0x19')][_0xe9f0('0x1a')]===undefined?!![]:![]:!![],'where':_0x3dbe49[_0xe9f0('0x19')]?_0x3dbe49[_0xe9f0('0x19')][_0xe9f0('0x22')]||null:null,'attributes':_0x3dbe49[_0xe9f0('0x19')]?_0x3dbe49[_0xe9f0('0x19')][_0xe9f0('0x1f')]||null:null,'include':_0x3dbe49['options']?_0x3dbe49['options']['include']?_[_0xe9f0('0x1d')](_0x3dbe49['options'][_0xe9f0('0x1c')],function(_0xc5fa13){return{'model':db[_0xc5fa13['model']],'as':_0xc5fa13['as'],'attributes':_0xc5fa13[_0xe9f0('0x1f')],'include':_0xc5fa13['include']?_['map'](_0xc5fa13['include'],function(_0x165440){return{'model':db[_0x165440[_0xe9f0('0x1e')]],'as':_0x165440['as'],'attributes':_0x165440['attributes'],'include':_0x165440[_0xe9f0('0x1c')]?_[_0xe9f0('0x1d')](_0x165440[_0xe9f0('0x1c')],function(_0x4d4186){return{'model':db[_0x4d4186['model']],'as':_0x4d4186['as'],'attributes':_0x4d4186[_0xe9f0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe9f0('0xb')](function(_0x1917c8){logger['info'](_0xe9f0('0x20'),_0x3dbe49);logger[_0xe9f0('0xf')](_0xe9f0('0x20'),_0x3dbe49,JSON[_0xe9f0('0x11')](_0x1917c8));_0x617ad3(_0x1917c8);})[_0xe9f0('0x15')](function(_0x552ec2){logger[_0xe9f0('0x12')](_0xe9f0('0x20'),_0x552ec2[_0xe9f0('0x13')],_0x3dbe49);_0x445ad0(_0x22806c['error'](0x1f4,_0x552ec2[_0xe9f0('0x13')]));});});}; \ No newline at end of file +var _0x4e2e=['limit','map','include','model','GetFreshsalesAccount','find','ShowFreshsalesAccount','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','FreshsalesAccount','findAll','options','raw','where','attributes'];(function(_0x51bb29,_0x26c04f){var _0x1f5b84=function(_0x25c262){while(--_0x25c262){_0x51bb29['push'](_0x51bb29['shift']());}};_0x1f5b84(++_0x26c04f);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x3615a8,_0x48be49){_0x3615a8=_0x3615a8-0x0;var _0x32f2b1=_0x4e2e[_0x3615a8];return _0x32f2b1;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b1c6,_0x1c4e64,_0x125338){return new BPromise(function(_0x956c75,_0x27304b){return client[_0xe4e2('0xb')](_0x36b1c6,_0x125338)[_0xe4e2('0xc')](function(_0x4912da){logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));logger['debug'](_0xe4e2('0x10'),_0x1c4e64,_0xe4e2('0xf'),JSON[_0xe4e2('0x11')](_0x4912da));if(_0x4912da[_0xe4e2('0x12')]){if(_0x4912da[_0xe4e2('0x12')]['code']===0x1f4){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x27304b(_0x4912da['error'][_0xe4e2('0x13')]);}logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x956c75(_0x4912da['error']['message']);}else{logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));_0x956c75(_0x4912da[_0xe4e2('0x14')][_0xe4e2('0x13')]);}})['catch'](function(_0x754778){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x754778);_0x27304b(_0x754778);});});}exports['GetFreshsalesAccount']=function(_0x196f16){var _0x54c80b=this;return new Promise(function(_0x1d5e9d,_0x3f313b){return db[_0xe4e2('0x15')][_0xe4e2('0x16')]({'raw':_0x196f16[_0xe4e2('0x17')]?_0x196f16[_0xe4e2('0x17')][_0xe4e2('0x18')]===undefined?!![]:![]:!![],'where':_0x196f16[_0xe4e2('0x17')]?_0x196f16[_0xe4e2('0x17')][_0xe4e2('0x19')]||null:null,'attributes':_0x196f16['options']?_0x196f16[_0xe4e2('0x17')][_0xe4e2('0x1a')]||null:null,'limit':_0x196f16[_0xe4e2('0x17')]?_0x196f16[_0xe4e2('0x17')][_0xe4e2('0x1b')]||null:null,'include':_0x196f16[_0xe4e2('0x17')]?_0x196f16[_0xe4e2('0x17')]['include']?_[_0xe4e2('0x1c')](_0x196f16[_0xe4e2('0x17')][_0xe4e2('0x1d')],function(_0x5373c0){return{'model':db[_0x5373c0[_0xe4e2('0x1e')]],'as':_0x5373c0['as'],'attributes':_0x5373c0[_0xe4e2('0x1a')],'include':_0x5373c0['include']?_[_0xe4e2('0x1c')](_0x5373c0[_0xe4e2('0x1d')],function(_0x29143c){return{'model':db[_0x29143c[_0xe4e2('0x1e')]],'as':_0x29143c['as'],'attributes':_0x29143c[_0xe4e2('0x1a')],'include':_0x29143c['include']?_[_0xe4e2('0x1c')](_0x29143c[_0xe4e2('0x1d')],function(_0x1f6d1f){return{'model':db[_0x1f6d1f['model']],'as':_0x1f6d1f['as'],'attributes':_0x1f6d1f[_0xe4e2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe4e2('0xc')](function(_0x31f651){logger['info'](_0xe4e2('0x1f'),_0x196f16);logger['debug'](_0xe4e2('0x1f'),_0x196f16,JSON[_0xe4e2('0x11')](_0x31f651));_0x1d5e9d(_0x31f651);})['catch'](function(_0x46926a){logger[_0xe4e2('0x12')](_0xe4e2('0x1f'),_0x46926a[_0xe4e2('0x13')],_0x196f16);_0x3f313b(_0x54c80b[_0xe4e2('0x12')](0x1f4,_0x46926a['message']));});});};exports['ShowFreshsalesAccount']=function(_0x2cb235){var _0x2fe075=this;return new Promise(function(_0x12848d,_0x26fb97){return db[_0xe4e2('0x15')][_0xe4e2('0x20')]({'raw':_0x2cb235[_0xe4e2('0x17')]?_0x2cb235[_0xe4e2('0x17')][_0xe4e2('0x18')]===undefined?!![]:![]:!![],'where':_0x2cb235[_0xe4e2('0x17')]?_0x2cb235[_0xe4e2('0x17')][_0xe4e2('0x19')]||null:null,'attributes':_0x2cb235['options']?_0x2cb235[_0xe4e2('0x17')][_0xe4e2('0x1a')]||null:null,'include':_0x2cb235[_0xe4e2('0x17')]?_0x2cb235[_0xe4e2('0x17')][_0xe4e2('0x1d')]?_[_0xe4e2('0x1c')](_0x2cb235['options'][_0xe4e2('0x1d')],function(_0x286714){return{'model':db[_0x286714[_0xe4e2('0x1e')]],'as':_0x286714['as'],'attributes':_0x286714[_0xe4e2('0x1a')],'include':_0x286714[_0xe4e2('0x1d')]?_[_0xe4e2('0x1c')](_0x286714[_0xe4e2('0x1d')],function(_0x36a26d){return{'model':db[_0x36a26d[_0xe4e2('0x1e')]],'as':_0x36a26d['as'],'attributes':_0x36a26d[_0xe4e2('0x1a')],'include':_0x36a26d[_0xe4e2('0x1d')]?_['map'](_0x36a26d[_0xe4e2('0x1d')],function(_0x4d3c5e){return{'model':db[_0x4d3c5e[_0xe4e2('0x1e')]],'as':_0x4d3c5e['as'],'attributes':_0x4d3c5e[_0xe4e2('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4194bd){logger[_0xe4e2('0xd')](_0xe4e2('0x21'),_0x2cb235);logger[_0xe4e2('0x22')]('ShowFreshsalesAccount',_0x2cb235,JSON[_0xe4e2('0x11')](_0x4194bd));_0x12848d(_0x4194bd);})['catch'](function(_0x2164d2){logger['error'](_0xe4e2('0x21'),_0x2164d2[_0xe4e2('0x13')],_0x2cb235);_0x26fb97(_0x2fe075[_0xe4e2('0x12')](0x1f4,_0x2164d2['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 8bd46fd..93aa339 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 _0x0fea=['create','put','update','exports','multer','util','path','connect-timeout','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getFields'];(function(_0x381379,_0x3f3b86){var _0x3e1063=function(_0x4c282d){while(--_0x4c282d){_0x381379['push'](_0x381379['shift']());}};_0x3e1063(++_0x3f3b86);}(_0x0fea,0x15a));var _0xa0fe=function(_0x5de818,_0x7c4485){_0x5de818=_0x5de818-0x0;var _0x345670=_0x0fea[_0x5de818];return _0x345670;};'use strict';var multer=require(_0xa0fe('0x0'));var util=require(_0xa0fe('0x1'));var path=require(_0xa0fe('0x2'));var timeout=require(_0xa0fe('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa0fe('0x4'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xa0fe('0x5')]('/',auth['isAuthenticated'](),controller[_0xa0fe('0x6')]);router['get'](_0xa0fe('0x7'),auth[_0xa0fe('0x8')](),controller[_0xa0fe('0x9')]);router[_0xa0fe('0x5')](_0xa0fe('0xa'),auth[_0xa0fe('0x8')](),controller[_0xa0fe('0xb')]);router[_0xa0fe('0x5')](_0xa0fe('0xc'),auth[_0xa0fe('0x8')](),controller['getDescriptions']);router[_0xa0fe('0x5')]('/:id/fields',auth[_0xa0fe('0x8')](),controller[_0xa0fe('0xd')]);router['post']('/',auth[_0xa0fe('0x8')](),controller[_0xa0fe('0xe')]);router[_0xa0fe('0xf')](_0xa0fe('0x7'),auth[_0xa0fe('0x8')](),controller[_0xa0fe('0x10')]);router['delete'](_0xa0fe('0x7'),auth[_0xa0fe('0x8')](),controller['destroy']);module[_0xa0fe('0x11')]=router; \ No newline at end of file +var _0x3b21=['delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/subjects','getDescriptions','post','create','put'];(function(_0x2c7313,_0x17ee3d){var _0x472869=function(_0x7e4c8c){while(--_0x7e4c8c){_0x2c7313['push'](_0x2c7313['shift']());}};_0x472869(++_0x17ee3d);}(_0x3b21,0x1a7));var _0x13b2=function(_0xe70b6e,_0x3788cc){_0xe70b6e=_0xe70b6e-0x0;var _0x488caa=_0x3b21[_0xe70b6e];return _0x488caa;};'use strict';var multer=require(_0x13b2('0x0'));var util=require(_0x13b2('0x1'));var path=require(_0x13b2('0x2'));var timeout=require(_0x13b2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x13b2('0x4'));var interaction=require(_0x13b2('0x5'));var config=require(_0x13b2('0x6'));var controller=require(_0x13b2('0x7'));router['get']('/',auth[_0x13b2('0x8')](),controller[_0x13b2('0x9')]);router[_0x13b2('0xa')](_0x13b2('0xb'),auth[_0x13b2('0x8')](),controller[_0x13b2('0xc')]);router[_0x13b2('0xa')](_0x13b2('0xd'),auth[_0x13b2('0x8')](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x13b2('0xe')]);router[_0x13b2('0xa')]('/:id/fields',auth[_0x13b2('0x8')](),controller['getFields']);router[_0x13b2('0xf')]('/',auth[_0x13b2('0x8')](),controller[_0x13b2('0x10')]);router[_0x13b2('0x11')](_0x13b2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x13b2('0x12')](_0x13b2('0xb'),auth[_0x13b2('0x8')](),controller[_0x13b2('0x13')]);module[_0x13b2('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index a732516..a5c25a6 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 _0x37ef=['sequelize','exports','STRING'];(function(_0x3da934,_0x4839d1){var _0x531b08=function(_0x51985f){while(--_0x51985f){_0x3da934['push'](_0x3da934['shift']());}};_0x531b08(++_0x4839d1);}(_0x37ef,0x141));var _0xf37e=function(_0x5143ed,_0x25b2e2){_0x5143ed=_0x5143ed-0x0;var _0x5dc173=_0x37ef[_0x5143ed];return _0x5dc173;};'use strict';var Sequelize=require(_0xf37e('0x0'));module[_0xf37e('0x1')]={'name':{'type':Sequelize[_0xf37e('0x2')]},'description':{'type':Sequelize[_0xf37e('0x2')]}}; \ No newline at end of file +var _0xa9ba=['exports','STRING'];(function(_0x1aa289,_0x47d758){var _0xb7f13f=function(_0x8a8db3){while(--_0x8a8db3){_0x1aa289['push'](_0x1aa289['shift']());}};_0xb7f13f(++_0x47d758);}(_0xa9ba,0xc8));var _0xaa9b=function(_0x1e6e4e,_0x40312c){_0x1e6e4e=_0x1e6e4e-0x0;var _0x329d98=_0xa9ba[_0x1e6e4e];return _0x329d98;};'use strict';var Sequelize=require('sequelize');module[_0xaa9b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaa9b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index c06df1e..dc2ae25 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 _0xc6ff=['status','limit','undefined','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','count','includeAll','include','rows','params','rawAttributes','find','create','body','catch','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','mustache','path','sox','ejs','fs-extra','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end'];(function(_0x1c8dc3,_0x54d286){var _0x5a8672=function(_0x4bbb9b){while(--_0x4bbb9b){_0x1c8dc3['push'](_0x1c8dc3['shift']());}};_0x5a8672(++_0x54d286);}(_0xc6ff,0x85));var _0xfc6f=function(_0x4f4ef3,_0x914480){_0x4f4ef3=_0x4f4ef3-0x0;var _0x176439=_0xc6ff[_0x4f4ef3];return _0x176439;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfc6f('0x0'));var zipdir=require(_0xfc6f('0x1'));var jsonpatch=require(_0xfc6f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfc6f('0x3'));var util=require('util');var path=require(_0xfc6f('0x4'));var sox=require(_0xfc6f('0x5'));var csv=require('to-csv');var ejs=require(_0xfc6f('0x6'));var fs=require('fs');var fs_extra=require(_0xfc6f('0x7'));var _=require(_0xfc6f('0x8'));var squel=require(_0xfc6f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfc6f('0xa'));var querystring=require(_0xfc6f('0xb'));var Papa=require(_0xfc6f('0xc'));var Redis=require(_0xfc6f('0xd'));var authService=require(_0xfc6f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfc6f('0xf'));var hardwareService=require(_0xfc6f('0x10'));var logger=require(_0xfc6f('0x11'))('api');var utils=require(_0xfc6f('0x12'));var config=require(_0xfc6f('0x13'));var licenseUtil=require(_0xfc6f('0x14'));var db=require(_0xfc6f('0x15'))['db'];function respondWithStatusCode(_0xcad48d,_0x1fb83e){_0x1fb83e=_0x1fb83e||0xcc;return function(_0x17f0c3){if(_0x17f0c3){return _0xcad48d['sendStatus'](_0x1fb83e);}return _0xcad48d['status'](_0x1fb83e)[_0xfc6f('0x16')]();};}function respondWithResult(_0x2024b3,_0x383cc3){_0x383cc3=_0x383cc3||0xc8;return function(_0x1663df){if(_0x1663df){return _0x2024b3[_0xfc6f('0x17')](_0x383cc3)['json'](_0x1663df);}};}function respondWithFilteredResult(_0x233a6f,_0x472bf6){return function(_0x41955a){if(_0x41955a){var _0x38121c=typeof _0x472bf6['offset']==='undefined'&&typeof _0x472bf6[_0xfc6f('0x18')]===_0xfc6f('0x19');var _0x184862=_0x41955a['count'];var _0x518c5b=_0x38121c?0x0:_0x472bf6['offset'];var _0x239cdc=_0x38121c?_0x41955a['count']:_0x472bf6[_0xfc6f('0x1a')]+_0x472bf6[_0xfc6f('0x18')];var _0x106fe1;if(_0x239cdc>=_0x184862){_0x239cdc=_0x184862;_0x106fe1=0xc8;}else{_0x106fe1=0xce;}_0x233a6f[_0xfc6f('0x17')](_0x106fe1);return _0x233a6f[_0xfc6f('0x1b')](_0xfc6f('0x1c'),_0x518c5b+'-'+_0x239cdc+'/'+_0x184862)[_0xfc6f('0x1d')](_0x41955a);}return null;};}function patchUpdates(_0xa9ee2b){return function(_0x1b512a){try{jsonpatch[_0xfc6f('0x1e')](_0x1b512a,_0xa9ee2b,!![]);}catch(_0x2ac1cc){return BPromise[_0xfc6f('0x1f')](_0x2ac1cc);}return _0x1b512a[_0xfc6f('0x20')]();};}function saveUpdates(_0x3ef917,_0xaa7a2f){return function(_0x172bc5){if(_0x172bc5){return _0x172bc5['update'](_0x3ef917)[_0xfc6f('0x21')](function(_0x1bd3d1){return _0x1bd3d1;});}return null;};}function removeEntity(_0x18b91b,_0x550456){return function(_0x2017d3){if(_0x2017d3){return _0x2017d3[_0xfc6f('0x22')]()['then'](function(){_0x18b91b[_0xfc6f('0x17')](0xcc)[_0xfc6f('0x16')]();});}};}function handleEntityNotFound(_0x354ab1,_0x7e36d0){return function(_0x1b04eb){if(!_0x1b04eb){_0x354ab1['sendStatus'](0x194);}return _0x1b04eb;};}function handleError(_0x1fe205,_0x29a385){_0x29a385=_0x29a385||0x1f4;return function(_0x224ff3){logger[_0xfc6f('0x23')](_0x224ff3[_0xfc6f('0x24')]);if(_0x224ff3['name']){delete _0x224ff3[_0xfc6f('0x25')];}_0x1fe205['status'](_0x29a385)[_0xfc6f('0x26')](_0x224ff3);};}exports[_0xfc6f('0x27')]=function(_0x20db7a,_0x36bc9f){var _0x5a06bc={},_0x46908c={},_0xdce2be={'count':0x0,'rows':[]};var _0x370f25=_['map'](db[_0xfc6f('0x28')]['rawAttributes'],function(_0x462d1a){return{'name':_0x462d1a[_0xfc6f('0x29')],'type':_0x462d1a[_0xfc6f('0x2a')][_0xfc6f('0x2b')]};});_0x46908c[_0xfc6f('0x2c')]=_[_0xfc6f('0x2d')](_0x370f25,'name');_0x46908c[_0xfc6f('0x2e')]=_[_0xfc6f('0x2f')](_0x20db7a['query']);_0x46908c[_0xfc6f('0x30')]=_[_0xfc6f('0x31')](_0x46908c[_0xfc6f('0x2c')],_0x46908c[_0xfc6f('0x2e')]);_0x5a06bc[_0xfc6f('0x32')]=_[_0xfc6f('0x31')](_0x46908c[_0xfc6f('0x2c')],qs[_0xfc6f('0x33')](_0x20db7a[_0xfc6f('0x2e')]['fields']));_0x5a06bc[_0xfc6f('0x32')]=_0x5a06bc[_0xfc6f('0x32')][_0xfc6f('0x34')]?_0x5a06bc[_0xfc6f('0x32')]:_0x46908c[_0xfc6f('0x2c')];if(!_0x20db7a['query'][_0xfc6f('0x35')](_0xfc6f('0x36'))){_0x5a06bc[_0xfc6f('0x18')]=qs[_0xfc6f('0x18')](_0x20db7a[_0xfc6f('0x2e')][_0xfc6f('0x18')]);_0x5a06bc['offset']=qs[_0xfc6f('0x1a')](_0x20db7a[_0xfc6f('0x2e')][_0xfc6f('0x1a')]);}_0x5a06bc[_0xfc6f('0x37')]=qs[_0xfc6f('0x38')](_0x20db7a[_0xfc6f('0x2e')][_0xfc6f('0x38')]);_0x5a06bc['where']=qs['filters'](_[_0xfc6f('0x39')](_0x20db7a[_0xfc6f('0x2e')],_0x46908c[_0xfc6f('0x30')]),_0x370f25);if(_0x20db7a['query']['filter']){_0x5a06bc[_0xfc6f('0x3a')]=_[_0xfc6f('0x3b')](_0x5a06bc[_0xfc6f('0x3a')],{'$or':_[_0xfc6f('0x2d')](_0x370f25,function(_0x3f32de){if(_0x3f32de[_0xfc6f('0x2a')]!==_0xfc6f('0x3c')){var _0x26ee15={};_0x26ee15[_0x3f32de[_0xfc6f('0x25')]]={'$like':'%'+_0x20db7a[_0xfc6f('0x2e')][_0xfc6f('0x3d')]+'%'};return _0x26ee15;}})});}_0x5a06bc=_[_0xfc6f('0x3b')]({},_0x5a06bc,_0x20db7a[_0xfc6f('0x3e')]);var _0x2ddc65={'where':_0x5a06bc[_0xfc6f('0x3a')]};return db[_0xfc6f('0x28')][_0xfc6f('0x3f')](_0x2ddc65)[_0xfc6f('0x21')](function(_0x29881e){_0xdce2be[_0xfc6f('0x3f')]=_0x29881e;if(_0x20db7a[_0xfc6f('0x2e')][_0xfc6f('0x40')]){_0x5a06bc[_0xfc6f('0x41')]=[{'all':!![]}];}return db[_0xfc6f('0x28')]['findAll'](_0x5a06bc);})[_0xfc6f('0x21')](function(_0x22049c){_0xdce2be[_0xfc6f('0x42')]=_0x22049c;return _0xdce2be;})[_0xfc6f('0x21')](respondWithFilteredResult(_0x36bc9f,_0x5a06bc))['catch'](handleError(_0x36bc9f,null));};exports['show']=function(_0x1a81a1,_0x3128ff){var _0x55dfa0={'raw':![],'where':{'id':_0x1a81a1[_0xfc6f('0x43')]['id']}},_0x4dde09={};_0x4dde09['model']=_[_0xfc6f('0x2f')](db[_0xfc6f('0x28')][_0xfc6f('0x44')]);_0x4dde09[_0xfc6f('0x2e')]=_[_0xfc6f('0x2f')](_0x1a81a1['query']);_0x4dde09[_0xfc6f('0x30')]=_[_0xfc6f('0x31')](_0x4dde09['model'],_0x4dde09[_0xfc6f('0x2e')]);_0x55dfa0[_0xfc6f('0x32')]=_['intersection'](_0x4dde09[_0xfc6f('0x2c')],qs[_0xfc6f('0x33')](_0x1a81a1[_0xfc6f('0x2e')]['fields']));_0x55dfa0[_0xfc6f('0x32')]=_0x55dfa0[_0xfc6f('0x32')][_0xfc6f('0x34')]?_0x55dfa0[_0xfc6f('0x32')]:_0x4dde09[_0xfc6f('0x2c')];if(_0x1a81a1[_0xfc6f('0x2e')][_0xfc6f('0x40')]){_0x55dfa0[_0xfc6f('0x41')]=[{'all':!![]}];}_0x55dfa0=_[_0xfc6f('0x3b')]({},_0x55dfa0,_0x1a81a1[_0xfc6f('0x3e')]);return db[_0xfc6f('0x28')][_0xfc6f('0x45')](_0x55dfa0)[_0xfc6f('0x21')](handleEntityNotFound(_0x3128ff,null))[_0xfc6f('0x21')](respondWithResult(_0x3128ff,null))['catch'](handleError(_0x3128ff,null));};exports['create']=function(_0x2f397c,_0x3e54cc){return db[_0xfc6f('0x28')][_0xfc6f('0x46')](_0x2f397c[_0xfc6f('0x47')],{})[_0xfc6f('0x21')](respondWithResult(_0x3e54cc,0xc9))[_0xfc6f('0x48')](handleError(_0x3e54cc,null));};exports['update']=function(_0x31af57,_0x35c2ef){if(_0x31af57[_0xfc6f('0x47')]['id']){delete _0x31af57[_0xfc6f('0x47')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x31af57[_0xfc6f('0x43')]['id']}})['then'](handleEntityNotFound(_0x35c2ef,null))[_0xfc6f('0x21')](saveUpdates(_0x31af57[_0xfc6f('0x47')],null))['then'](respondWithResult(_0x35c2ef,null))['catch'](handleError(_0x35c2ef,null));};exports[_0xfc6f('0x22')]=function(_0x58fc42,_0x1b9a25){return db['FreshsalesConfiguration'][_0xfc6f('0x45')]({'where':{'id':_0x58fc42[_0xfc6f('0x43')]['id']}})[_0xfc6f('0x21')](handleEntityNotFound(_0x1b9a25,null))[_0xfc6f('0x21')](removeEntity(_0x1b9a25,null))['catch'](handleError(_0x1b9a25,null));};exports[_0xfc6f('0x49')]=function(_0x25ea0a,_0x4e2b49,_0x4e0cbe){var _0x7b36f9={};var _0x11b40d={};var _0x54c96f;var _0x9cb5de;return db[_0xfc6f('0x28')][_0xfc6f('0x4a')]({'where':{'id':_0x25ea0a[_0xfc6f('0x43')]['id']}})[_0xfc6f('0x21')](handleEntityNotFound(_0x4e2b49,null))[_0xfc6f('0x21')](function(_0x4feac5){if(_0x4feac5){_0x54c96f=_0x4feac5;_0x11b40d[_0xfc6f('0x2c')]=_[_0xfc6f('0x2f')](db[_0xfc6f('0x4b')][_0xfc6f('0x44')]);_0x11b40d[_0xfc6f('0x2e')]=_['keys'](_0x25ea0a['query']);_0x11b40d[_0xfc6f('0x30')]=_[_0xfc6f('0x31')](_0x11b40d[_0xfc6f('0x2c')],_0x11b40d['query']);_0x7b36f9['attributes']=_['intersection'](_0x11b40d[_0xfc6f('0x2c')],qs[_0xfc6f('0x33')](_0x25ea0a['query'][_0xfc6f('0x33')]));_0x7b36f9[_0xfc6f('0x32')]=_0x7b36f9['attributes']['length']?_0x7b36f9['attributes']:_0x11b40d['model'];_0x7b36f9[_0xfc6f('0x37')]=qs[_0xfc6f('0x38')](_0x25ea0a['query'][_0xfc6f('0x38')]);_0x7b36f9[_0xfc6f('0x3a')]=qs[_0xfc6f('0x30')](_['pick'](_0x25ea0a['query'],_0x11b40d[_0xfc6f('0x30')]));if(_0x25ea0a[_0xfc6f('0x2e')][_0xfc6f('0x3d')]){_0x7b36f9[_0xfc6f('0x3a')]=_[_0xfc6f('0x3b')](_0x7b36f9[_0xfc6f('0x3a')],{'$or':_[_0xfc6f('0x2d')](_0x7b36f9[_0xfc6f('0x32')],function(_0x2bdc8f){var _0x580f77={};_0x580f77[_0x2bdc8f]={'$like':'%'+_0x25ea0a[_0xfc6f('0x2e')][_0xfc6f('0x3d')]+'%'};return _0x580f77;})});}_0x7b36f9=_[_0xfc6f('0x3b')]({},_0x7b36f9,_0x25ea0a[_0xfc6f('0x3e')]);return _0x54c96f['getSubjects'](_0x7b36f9);}})[_0xfc6f('0x21')](function(_0x54c06b){if(_0x54c06b){_0x9cb5de=_0x54c06b[_0xfc6f('0x34')];if(!_0x25ea0a[_0xfc6f('0x2e')][_0xfc6f('0x35')]('nolimit')){_0x7b36f9['limit']=qs[_0xfc6f('0x18')](_0x25ea0a[_0xfc6f('0x2e')][_0xfc6f('0x18')]);_0x7b36f9[_0xfc6f('0x1a')]=qs[_0xfc6f('0x1a')](_0x25ea0a[_0xfc6f('0x2e')][_0xfc6f('0x1a')]);}return _0x54c96f['getSubjects'](_0x7b36f9);}})[_0xfc6f('0x21')](function(_0x1c9ec8){if(_0x1c9ec8){return _0x1c9ec8?{'count':_0x9cb5de,'rows':_0x1c9ec8}:null;}})['then'](respondWithResult(_0x4e2b49,null))[_0xfc6f('0x48')](handleError(_0x4e2b49,null));};exports[_0xfc6f('0x4c')]=function(_0x184b99,_0x3de5c1,_0x24393c){var _0x29cf3b={};var _0x455e9c={};var _0x3f249b;var _0x22cad7;return db[_0xfc6f('0x28')]['findOne']({'where':{'id':_0x184b99[_0xfc6f('0x43')]['id']}})['then'](handleEntityNotFound(_0x3de5c1,null))[_0xfc6f('0x21')](function(_0xd4126e){if(_0xd4126e){_0x3f249b=_0xd4126e;_0x455e9c[_0xfc6f('0x2c')]=_[_0xfc6f('0x2f')](db[_0xfc6f('0x4b')]['rawAttributes']);_0x455e9c['query']=_[_0xfc6f('0x2f')](_0x184b99['query']);_0x455e9c[_0xfc6f('0x30')]=_[_0xfc6f('0x31')](_0x455e9c['model'],_0x455e9c['query']);_0x29cf3b[_0xfc6f('0x32')]=_['intersection'](_0x455e9c[_0xfc6f('0x2c')],qs['fields'](_0x184b99[_0xfc6f('0x2e')][_0xfc6f('0x33')]));_0x29cf3b['attributes']=_0x29cf3b['attributes'][_0xfc6f('0x34')]?_0x29cf3b[_0xfc6f('0x32')]:_0x455e9c['model'];_0x29cf3b[_0xfc6f('0x37')]=qs[_0xfc6f('0x38')](_0x184b99[_0xfc6f('0x2e')]['sort']);_0x29cf3b[_0xfc6f('0x3a')]=qs[_0xfc6f('0x30')](_[_0xfc6f('0x39')](_0x184b99['query'],_0x455e9c[_0xfc6f('0x30')]));if(_0x184b99[_0xfc6f('0x2e')][_0xfc6f('0x3d')]){_0x29cf3b[_0xfc6f('0x3a')]=_['merge'](_0x29cf3b[_0xfc6f('0x3a')],{'$or':_['map'](_0x29cf3b[_0xfc6f('0x32')],function(_0x567df3){var _0x2ec38b={};_0x2ec38b[_0x567df3]={'$like':'%'+_0x184b99['query'][_0xfc6f('0x3d')]+'%'};return _0x2ec38b;})});}_0x29cf3b=_[_0xfc6f('0x3b')]({},_0x29cf3b,_0x184b99['options']);return _0x3f249b[_0xfc6f('0x4c')](_0x29cf3b);}})[_0xfc6f('0x21')](function(_0x281a38){if(_0x281a38){_0x22cad7=_0x281a38[_0xfc6f('0x34')];if(!_0x184b99[_0xfc6f('0x2e')][_0xfc6f('0x35')](_0xfc6f('0x36'))){_0x29cf3b[_0xfc6f('0x18')]=qs[_0xfc6f('0x18')](_0x184b99[_0xfc6f('0x2e')][_0xfc6f('0x18')]);_0x29cf3b[_0xfc6f('0x1a')]=qs['offset'](_0x184b99[_0xfc6f('0x2e')]['offset']);}return _0x3f249b[_0xfc6f('0x4c')](_0x29cf3b);}})[_0xfc6f('0x21')](function(_0x40f85e){if(_0x40f85e){return _0x40f85e?{'count':_0x22cad7,'rows':_0x40f85e}:null;}})[_0xfc6f('0x21')](respondWithResult(_0x3de5c1,null))[_0xfc6f('0x48')](handleError(_0x3de5c1,null));};exports[_0xfc6f('0x4d')]=function(_0x113c02,_0x585efc,_0x1b84e7){var _0xd1ebdb={};var _0x3e11f2={};var _0x4fb1e3;var _0x197eab;return db['FreshsalesConfiguration'][_0xfc6f('0x4a')]({'where':{'id':_0x113c02[_0xfc6f('0x43')]['id']}})[_0xfc6f('0x21')](handleEntityNotFound(_0x585efc,null))[_0xfc6f('0x21')](function(_0x1e1de1){if(_0x1e1de1){_0x4fb1e3=_0x1e1de1;_0x3e11f2['model']=_[_0xfc6f('0x2f')](db['FreshsalesField'][_0xfc6f('0x44')]);_0x3e11f2[_0xfc6f('0x2e')]=_[_0xfc6f('0x2f')](_0x113c02[_0xfc6f('0x2e')]);_0x3e11f2[_0xfc6f('0x30')]=_[_0xfc6f('0x31')](_0x3e11f2[_0xfc6f('0x2c')],_0x3e11f2[_0xfc6f('0x2e')]);_0xd1ebdb['attributes']=_[_0xfc6f('0x31')](_0x3e11f2['model'],qs[_0xfc6f('0x33')](_0x113c02[_0xfc6f('0x2e')][_0xfc6f('0x33')]));_0xd1ebdb[_0xfc6f('0x32')]=_0xd1ebdb[_0xfc6f('0x32')][_0xfc6f('0x34')]?_0xd1ebdb[_0xfc6f('0x32')]:_0x3e11f2[_0xfc6f('0x2c')];_0xd1ebdb[_0xfc6f('0x37')]=qs['sort'](_0x113c02[_0xfc6f('0x2e')][_0xfc6f('0x38')]);_0xd1ebdb['where']=qs['filters'](_[_0xfc6f('0x39')](_0x113c02['query'],_0x3e11f2[_0xfc6f('0x30')]));if(_0x113c02[_0xfc6f('0x2e')]['filter']){_0xd1ebdb[_0xfc6f('0x3a')]=_[_0xfc6f('0x3b')](_0xd1ebdb[_0xfc6f('0x3a')],{'$or':_['map'](_0xd1ebdb['attributes'],function(_0x3c0ab4){var _0x2f2011={};_0x2f2011[_0x3c0ab4]={'$like':'%'+_0x113c02[_0xfc6f('0x2e')]['filter']+'%'};return _0x2f2011;})});}_0xd1ebdb=_[_0xfc6f('0x3b')]({},_0xd1ebdb,_0x113c02[_0xfc6f('0x3e')]);return _0x4fb1e3[_0xfc6f('0x4d')](_0xd1ebdb);}})[_0xfc6f('0x21')](function(_0x21f858){if(_0x21f858){_0x197eab=_0x21f858[_0xfc6f('0x34')];if(!_0x113c02[_0xfc6f('0x2e')][_0xfc6f('0x35')](_0xfc6f('0x36'))){_0xd1ebdb[_0xfc6f('0x18')]=qs[_0xfc6f('0x18')](_0x113c02[_0xfc6f('0x2e')]['limit']);_0xd1ebdb[_0xfc6f('0x1a')]=qs['offset'](_0x113c02[_0xfc6f('0x2e')][_0xfc6f('0x1a')]);}return _0x4fb1e3[_0xfc6f('0x4d')](_0xd1ebdb);}})[_0xfc6f('0x21')](function(_0x326980){if(_0x326980){return _0x326980?{'count':_0x197eab,'rows':_0x326980}:null;}})[_0xfc6f('0x21')](respondWithResult(_0x585efc,null))[_0xfc6f('0x48')](handleError(_0x585efc,null));}; \ No newline at end of file +var _0x9c14=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','end','status','undefined','limit','count','offset','set','apply','save','update','then','destroy','error','stack','name','send','map','FreshsalesConfiguration','fieldName','type','key','model','keys','query','attributes','fields','hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','rawAttributes','intersection','find','create','body','getSubjects','params','FreshsalesField','length','options','nolimit','getDescriptions','pick','findOne','getFields','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x21de6b,_0x20165c){var _0x15784f=function(_0x3d8997){while(--_0x3d8997){_0x21de6b['push'](_0x21de6b['shift']());}};_0x15784f(++_0x20165c);}(_0x9c14,0x187));var _0x49c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c14[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x49c1('0x0'));var rimraf=require(_0x49c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x49c1('0x2'));var rp=require(_0x49c1('0x3'));var moment=require(_0x49c1('0x4'));var BPromise=require(_0x49c1('0x5'));var Mustache=require(_0x49c1('0x6'));var util=require(_0x49c1('0x7'));var path=require(_0x49c1('0x8'));var sox=require(_0x49c1('0x9'));var csv=require(_0x49c1('0xa'));var ejs=require(_0x49c1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x49c1('0xc'));var squel=require('squel');var crypto=require(_0x49c1('0xd'));var jsforce=require(_0x49c1('0xe'));var deskjs=require(_0x49c1('0xf'));var toCsv=require(_0x49c1('0xa'));var querystring=require(_0x49c1('0x10'));var Papa=require(_0x49c1('0x11'));var Redis=require(_0x49c1('0x12'));var authService=require(_0x49c1('0x13'));var qs=require(_0x49c1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49c1('0x15'));var logger=require('../../config/logger')(_0x49c1('0x16'));var utils=require(_0x49c1('0x17'));var config=require(_0x49c1('0x18'));var licenseUtil=require(_0x49c1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f4036,_0x282462){_0x282462=_0x282462||0xcc;return function(_0x17d39d){if(_0x17d39d){return _0x3f4036['sendStatus'](_0x282462);}return _0x3f4036['status'](_0x282462)[_0x49c1('0x1a')]();};}function respondWithResult(_0x1c39f8,_0x2524c9){_0x2524c9=_0x2524c9||0xc8;return function(_0x778cb1){if(_0x778cb1){return _0x1c39f8[_0x49c1('0x1b')](_0x2524c9)['json'](_0x778cb1);}};}function respondWithFilteredResult(_0xf859e8,_0x5c12d0){return function(_0xd792b7){if(_0xd792b7){var _0x3902ff=typeof _0x5c12d0['offset']===_0x49c1('0x1c')&&typeof _0x5c12d0[_0x49c1('0x1d')]===_0x49c1('0x1c');var _0x59e457=_0xd792b7[_0x49c1('0x1e')];var _0x3f5bd5=_0x3902ff?0x0:_0x5c12d0[_0x49c1('0x1f')];var _0x130824=_0x3902ff?_0xd792b7[_0x49c1('0x1e')]:_0x5c12d0['offset']+_0x5c12d0['limit'];var _0x1f75dd;if(_0x130824>=_0x59e457){_0x130824=_0x59e457;_0x1f75dd=0xc8;}else{_0x1f75dd=0xce;}_0xf859e8[_0x49c1('0x1b')](_0x1f75dd);return _0xf859e8[_0x49c1('0x20')]('Content-Range',_0x3f5bd5+'-'+_0x130824+'/'+_0x59e457)['json'](_0xd792b7);}return null;};}function patchUpdates(_0x46c3bd){return function(_0x3d84db){try{jsonpatch[_0x49c1('0x21')](_0x3d84db,_0x46c3bd,!![]);}catch(_0x3a4b44){return BPromise['reject'](_0x3a4b44);}return _0x3d84db[_0x49c1('0x22')]();};}function saveUpdates(_0x34d2e8,_0x1a8e9f){return function(_0x253867){if(_0x253867){return _0x253867[_0x49c1('0x23')](_0x34d2e8)[_0x49c1('0x24')](function(_0x43a8b6){return _0x43a8b6;});}return null;};}function removeEntity(_0xa9d3de,_0x223d69){return function(_0x4f3873){if(_0x4f3873){return _0x4f3873[_0x49c1('0x25')]()[_0x49c1('0x24')](function(){_0xa9d3de[_0x49c1('0x1b')](0xcc)[_0x49c1('0x1a')]();});}};}function handleEntityNotFound(_0x5843b7,_0x5f3cf7){return function(_0x43a7e2){if(!_0x43a7e2){_0x5843b7['sendStatus'](0x194);}return _0x43a7e2;};}function handleError(_0xb9f9f0,_0x58a76d){_0x58a76d=_0x58a76d||0x1f4;return function(_0x325dff){logger[_0x49c1('0x26')](_0x325dff[_0x49c1('0x27')]);if(_0x325dff[_0x49c1('0x28')]){delete _0x325dff[_0x49c1('0x28')];}_0xb9f9f0['status'](_0x58a76d)[_0x49c1('0x29')](_0x325dff);};}exports['index']=function(_0x306628,_0x52bd5c){var _0x22840b={},_0x4d3916={},_0x7a3397={'count':0x0,'rows':[]};var _0x30b22c=_[_0x49c1('0x2a')](db[_0x49c1('0x2b')]['rawAttributes'],function(_0x5be855){return{'name':_0x5be855[_0x49c1('0x2c')],'type':_0x5be855[_0x49c1('0x2d')][_0x49c1('0x2e')]};});_0x4d3916[_0x49c1('0x2f')]=_[_0x49c1('0x2a')](_0x30b22c,'name');_0x4d3916['query']=_[_0x49c1('0x30')](_0x306628[_0x49c1('0x31')]);_0x4d3916['filters']=_['intersection'](_0x4d3916[_0x49c1('0x2f')],_0x4d3916[_0x49c1('0x31')]);_0x22840b[_0x49c1('0x32')]=_['intersection'](_0x4d3916[_0x49c1('0x2f')],qs[_0x49c1('0x33')](_0x306628['query'][_0x49c1('0x33')]));_0x22840b[_0x49c1('0x32')]=_0x22840b[_0x49c1('0x32')]['length']?_0x22840b['attributes']:_0x4d3916[_0x49c1('0x2f')];if(!_0x306628[_0x49c1('0x31')][_0x49c1('0x34')]('nolimit')){_0x22840b[_0x49c1('0x1d')]=qs[_0x49c1('0x1d')](_0x306628[_0x49c1('0x31')][_0x49c1('0x1d')]);_0x22840b['offset']=qs[_0x49c1('0x1f')](_0x306628['query']['offset']);}_0x22840b[_0x49c1('0x35')]=qs[_0x49c1('0x36')](_0x306628['query'][_0x49c1('0x36')]);_0x22840b['where']=qs[_0x49c1('0x37')](_['pick'](_0x306628[_0x49c1('0x31')],_0x4d3916[_0x49c1('0x37')]),_0x30b22c);if(_0x306628['query'][_0x49c1('0x38')]){_0x22840b[_0x49c1('0x39')]=_[_0x49c1('0x3a')](_0x22840b[_0x49c1('0x39')],{'$or':_[_0x49c1('0x2a')](_0x30b22c,function(_0x3ebbfa){if(_0x3ebbfa[_0x49c1('0x2d')]!==_0x49c1('0x3b')){var _0x548185={};_0x548185[_0x3ebbfa[_0x49c1('0x28')]]={'$like':'%'+_0x306628[_0x49c1('0x31')][_0x49c1('0x38')]+'%'};return _0x548185;}})});}_0x22840b=_[_0x49c1('0x3a')]({},_0x22840b,_0x306628['options']);var _0x9d0bcc={'where':_0x22840b['where']};return db['FreshsalesConfiguration'][_0x49c1('0x1e')](_0x9d0bcc)['then'](function(_0x5670f0){_0x7a3397[_0x49c1('0x1e')]=_0x5670f0;if(_0x306628[_0x49c1('0x31')][_0x49c1('0x3c')]){_0x22840b[_0x49c1('0x3d')]=[{'all':!![]}];}return db[_0x49c1('0x2b')][_0x49c1('0x3e')](_0x22840b);})[_0x49c1('0x24')](function(_0x56c729){_0x7a3397['rows']=_0x56c729;return _0x7a3397;})[_0x49c1('0x24')](respondWithFilteredResult(_0x52bd5c,_0x22840b))[_0x49c1('0x3f')](handleError(_0x52bd5c,null));};exports['show']=function(_0x5cc9ac,_0x17cd73){var _0x3422cf={'raw':![],'where':{'id':_0x5cc9ac['params']['id']}},_0x5e1927={};_0x5e1927['model']=_['keys'](db[_0x49c1('0x2b')][_0x49c1('0x40')]);_0x5e1927[_0x49c1('0x31')]=_[_0x49c1('0x30')](_0x5cc9ac['query']);_0x5e1927['filters']=_[_0x49c1('0x41')](_0x5e1927[_0x49c1('0x2f')],_0x5e1927['query']);_0x3422cf['attributes']=_['intersection'](_0x5e1927[_0x49c1('0x2f')],qs[_0x49c1('0x33')](_0x5cc9ac[_0x49c1('0x31')][_0x49c1('0x33')]));_0x3422cf[_0x49c1('0x32')]=_0x3422cf['attributes']['length']?_0x3422cf[_0x49c1('0x32')]:_0x5e1927[_0x49c1('0x2f')];if(_0x5cc9ac['query'][_0x49c1('0x3c')]){_0x3422cf[_0x49c1('0x3d')]=[{'all':!![]}];}_0x3422cf=_[_0x49c1('0x3a')]({},_0x3422cf,_0x5cc9ac['options']);return db[_0x49c1('0x2b')][_0x49c1('0x42')](_0x3422cf)[_0x49c1('0x24')](handleEntityNotFound(_0x17cd73,null))['then'](respondWithResult(_0x17cd73,null))[_0x49c1('0x3f')](handleError(_0x17cd73,null));};exports[_0x49c1('0x43')]=function(_0x142be2,_0x428bc5){return db[_0x49c1('0x2b')][_0x49c1('0x43')](_0x142be2[_0x49c1('0x44')],{})[_0x49c1('0x24')](respondWithResult(_0x428bc5,0xc9))[_0x49c1('0x3f')](handleError(_0x428bc5,null));};exports['update']=function(_0x27544d,_0x20bc91){if(_0x27544d[_0x49c1('0x44')]['id']){delete _0x27544d['body']['id'];}return db[_0x49c1('0x2b')][_0x49c1('0x42')]({'where':{'id':_0x27544d['params']['id']}})[_0x49c1('0x24')](handleEntityNotFound(_0x20bc91,null))[_0x49c1('0x24')](saveUpdates(_0x27544d['body'],null))['then'](respondWithResult(_0x20bc91,null))['catch'](handleError(_0x20bc91,null));};exports['destroy']=function(_0x354dc4,_0x5e5260){return db[_0x49c1('0x2b')]['find']({'where':{'id':_0x354dc4['params']['id']}})[_0x49c1('0x24')](handleEntityNotFound(_0x5e5260,null))[_0x49c1('0x24')](removeEntity(_0x5e5260,null))['catch'](handleError(_0x5e5260,null));};exports[_0x49c1('0x45')]=function(_0x2b7c80,_0x2d579b,_0x3db79e){var _0x94ceb9={};var _0xd10653={};var _0x524f89;var _0x241454;return db[_0x49c1('0x2b')]['findOne']({'where':{'id':_0x2b7c80[_0x49c1('0x46')]['id']}})[_0x49c1('0x24')](handleEntityNotFound(_0x2d579b,null))[_0x49c1('0x24')](function(_0x190070){if(_0x190070){_0x524f89=_0x190070;_0xd10653[_0x49c1('0x2f')]=_[_0x49c1('0x30')](db[_0x49c1('0x47')]['rawAttributes']);_0xd10653['query']=_[_0x49c1('0x30')](_0x2b7c80['query']);_0xd10653[_0x49c1('0x37')]=_[_0x49c1('0x41')](_0xd10653['model'],_0xd10653[_0x49c1('0x31')]);_0x94ceb9[_0x49c1('0x32')]=_[_0x49c1('0x41')](_0xd10653[_0x49c1('0x2f')],qs[_0x49c1('0x33')](_0x2b7c80[_0x49c1('0x31')][_0x49c1('0x33')]));_0x94ceb9[_0x49c1('0x32')]=_0x94ceb9[_0x49c1('0x32')][_0x49c1('0x48')]?_0x94ceb9[_0x49c1('0x32')]:_0xd10653[_0x49c1('0x2f')];_0x94ceb9[_0x49c1('0x35')]=qs[_0x49c1('0x36')](_0x2b7c80['query'][_0x49c1('0x36')]);_0x94ceb9[_0x49c1('0x39')]=qs[_0x49c1('0x37')](_['pick'](_0x2b7c80['query'],_0xd10653[_0x49c1('0x37')]));if(_0x2b7c80[_0x49c1('0x31')][_0x49c1('0x38')]){_0x94ceb9['where']=_[_0x49c1('0x3a')](_0x94ceb9[_0x49c1('0x39')],{'$or':_[_0x49c1('0x2a')](_0x94ceb9[_0x49c1('0x32')],function(_0x45b2c5){var _0x1a1c2d={};_0x1a1c2d[_0x45b2c5]={'$like':'%'+_0x2b7c80['query'][_0x49c1('0x38')]+'%'};return _0x1a1c2d;})});}_0x94ceb9=_['merge']({},_0x94ceb9,_0x2b7c80[_0x49c1('0x49')]);return _0x524f89[_0x49c1('0x45')](_0x94ceb9);}})['then'](function(_0x4c8670){if(_0x4c8670){_0x241454=_0x4c8670[_0x49c1('0x48')];if(!_0x2b7c80[_0x49c1('0x31')][_0x49c1('0x34')](_0x49c1('0x4a'))){_0x94ceb9['limit']=qs['limit'](_0x2b7c80['query'][_0x49c1('0x1d')]);_0x94ceb9['offset']=qs['offset'](_0x2b7c80[_0x49c1('0x31')][_0x49c1('0x1f')]);}return _0x524f89['getSubjects'](_0x94ceb9);}})['then'](function(_0xa8d076){if(_0xa8d076){return _0xa8d076?{'count':_0x241454,'rows':_0xa8d076}:null;}})[_0x49c1('0x24')](respondWithResult(_0x2d579b,null))[_0x49c1('0x3f')](handleError(_0x2d579b,null));};exports[_0x49c1('0x4b')]=function(_0x4f57c5,_0x58b08c,_0x456d0f){var _0x57ec0={};var _0x519ba7={};var _0x213aa9;var _0x528c2b;return db[_0x49c1('0x2b')]['findOne']({'where':{'id':_0x4f57c5['params']['id']}})[_0x49c1('0x24')](handleEntityNotFound(_0x58b08c,null))[_0x49c1('0x24')](function(_0x2d06f4){if(_0x2d06f4){_0x213aa9=_0x2d06f4;_0x519ba7['model']=_['keys'](db[_0x49c1('0x47')][_0x49c1('0x40')]);_0x519ba7['query']=_[_0x49c1('0x30')](_0x4f57c5['query']);_0x519ba7[_0x49c1('0x37')]=_[_0x49c1('0x41')](_0x519ba7[_0x49c1('0x2f')],_0x519ba7[_0x49c1('0x31')]);_0x57ec0[_0x49c1('0x32')]=_['intersection'](_0x519ba7[_0x49c1('0x2f')],qs['fields'](_0x4f57c5[_0x49c1('0x31')][_0x49c1('0x33')]));_0x57ec0['attributes']=_0x57ec0['attributes'][_0x49c1('0x48')]?_0x57ec0['attributes']:_0x519ba7[_0x49c1('0x2f')];_0x57ec0[_0x49c1('0x35')]=qs[_0x49c1('0x36')](_0x4f57c5[_0x49c1('0x31')]['sort']);_0x57ec0[_0x49c1('0x39')]=qs['filters'](_[_0x49c1('0x4c')](_0x4f57c5[_0x49c1('0x31')],_0x519ba7[_0x49c1('0x37')]));if(_0x4f57c5[_0x49c1('0x31')][_0x49c1('0x38')]){_0x57ec0[_0x49c1('0x39')]=_[_0x49c1('0x3a')](_0x57ec0['where'],{'$or':_[_0x49c1('0x2a')](_0x57ec0[_0x49c1('0x32')],function(_0x571666){var _0x4fad8d={};_0x4fad8d[_0x571666]={'$like':'%'+_0x4f57c5[_0x49c1('0x31')][_0x49c1('0x38')]+'%'};return _0x4fad8d;})});}_0x57ec0=_[_0x49c1('0x3a')]({},_0x57ec0,_0x4f57c5['options']);return _0x213aa9[_0x49c1('0x4b')](_0x57ec0);}})[_0x49c1('0x24')](function(_0x59bc1a){if(_0x59bc1a){_0x528c2b=_0x59bc1a[_0x49c1('0x48')];if(!_0x4f57c5[_0x49c1('0x31')]['hasOwnProperty'](_0x49c1('0x4a'))){_0x57ec0[_0x49c1('0x1d')]=qs[_0x49c1('0x1d')](_0x4f57c5[_0x49c1('0x31')]['limit']);_0x57ec0[_0x49c1('0x1f')]=qs[_0x49c1('0x1f')](_0x4f57c5[_0x49c1('0x31')]['offset']);}return _0x213aa9[_0x49c1('0x4b')](_0x57ec0);}})[_0x49c1('0x24')](function(_0x226977){if(_0x226977){return _0x226977?{'count':_0x528c2b,'rows':_0x226977}:null;}})[_0x49c1('0x24')](respondWithResult(_0x58b08c,null))[_0x49c1('0x3f')](handleError(_0x58b08c,null));};exports['getFields']=function(_0x40b25b,_0xf6d593,_0x4c1f13){var _0x4f7e42={};var _0x39e7fb={};var _0x2d272d;var _0x751bfd;return db['FreshsalesConfiguration'][_0x49c1('0x4d')]({'where':{'id':_0x40b25b[_0x49c1('0x46')]['id']}})['then'](handleEntityNotFound(_0xf6d593,null))['then'](function(_0x3c4dbe){if(_0x3c4dbe){_0x2d272d=_0x3c4dbe;_0x39e7fb[_0x49c1('0x2f')]=_[_0x49c1('0x30')](db[_0x49c1('0x47')]['rawAttributes']);_0x39e7fb[_0x49c1('0x31')]=_[_0x49c1('0x30')](_0x40b25b[_0x49c1('0x31')]);_0x39e7fb[_0x49c1('0x37')]=_[_0x49c1('0x41')](_0x39e7fb[_0x49c1('0x2f')],_0x39e7fb['query']);_0x4f7e42['attributes']=_[_0x49c1('0x41')](_0x39e7fb[_0x49c1('0x2f')],qs[_0x49c1('0x33')](_0x40b25b['query'][_0x49c1('0x33')]));_0x4f7e42[_0x49c1('0x32')]=_0x4f7e42['attributes'][_0x49c1('0x48')]?_0x4f7e42[_0x49c1('0x32')]:_0x39e7fb['model'];_0x4f7e42['order']=qs['sort'](_0x40b25b[_0x49c1('0x31')]['sort']);_0x4f7e42[_0x49c1('0x39')]=qs[_0x49c1('0x37')](_[_0x49c1('0x4c')](_0x40b25b[_0x49c1('0x31')],_0x39e7fb[_0x49c1('0x37')]));if(_0x40b25b[_0x49c1('0x31')]['filter']){_0x4f7e42[_0x49c1('0x39')]=_[_0x49c1('0x3a')](_0x4f7e42[_0x49c1('0x39')],{'$or':_[_0x49c1('0x2a')](_0x4f7e42[_0x49c1('0x32')],function(_0x275e4b){var _0x44d382={};_0x44d382[_0x275e4b]={'$like':'%'+_0x40b25b[_0x49c1('0x31')][_0x49c1('0x38')]+'%'};return _0x44d382;})});}_0x4f7e42=_['merge']({},_0x4f7e42,_0x40b25b['options']);return _0x2d272d[_0x49c1('0x4e')](_0x4f7e42);}})[_0x49c1('0x24')](function(_0x4d37d1){if(_0x4d37d1){_0x751bfd=_0x4d37d1[_0x49c1('0x48')];if(!_0x40b25b[_0x49c1('0x31')][_0x49c1('0x34')]('nolimit')){_0x4f7e42[_0x49c1('0x1d')]=qs[_0x49c1('0x1d')](_0x40b25b[_0x49c1('0x31')][_0x49c1('0x1d')]);_0x4f7e42['offset']=qs[_0x49c1('0x1f')](_0x40b25b[_0x49c1('0x31')][_0x49c1('0x1f')]);}return _0x2d272d[_0x49c1('0x4e')](_0x4f7e42);}})[_0x49c1('0x24')](function(_0x1de49f){if(_0x1de49f){return _0x1de49f?{'count':_0x751bfd,'rows':_0x1de49f}:null;}})['then'](respondWithResult(_0xf6d593,null))['catch'](handleError(_0xf6d593,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index cc0e40d..7a58346 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 _0xfddb=['../../config/logger','moment','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','util'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0xfddb,0x137));var _0xbfdd=function(_0x3b8f15,_0x356ff5){_0x3b8f15=_0x3b8f15-0x0;var _0x2ab6d3=_0xfddb[_0x3b8f15];return _0x2ab6d3;};'use strict';var _=require('lodash');var util=require(_0xbfdd('0x0'));var logger=require(_0xbfdd('0x1'))('api');var moment=require(_0xbfdd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfdd('0x3'));var rimraf=require('rimraf');var config=require(_0xbfdd('0x4'));var attributes=require(_0xbfdd('0x5'));module[_0xbfdd('0x6')]=function(_0x226d6e,_0x34a215){return _0x226d6e[_0xbfdd('0x7')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9346=['../../config/logger','moment','bluebird','request-promise','path','rimraf','define','FreshsalesConfiguration','lodash','util'];(function(_0xdaf4dc,_0x31396a){var _0x27da25=function(_0x4957c4){while(--_0x4957c4){_0xdaf4dc['push'](_0xdaf4dc['shift']());}};_0x27da25(++_0x31396a);}(_0x9346,0x1e8));var _0x6934=function(_0x80f606,_0x3acb4){_0x80f606=_0x80f606-0x0;var _0x1b9f0b=_0x9346[_0x80f606];return _0x1b9f0b;};'use strict';var _=require(_0x6934('0x0'));var util=require(_0x6934('0x1'));var logger=require(_0x6934('0x2'))('api');var moment=require(_0x6934('0x3'));var BPromise=require(_0x6934('0x4'));var rp=require(_0x6934('0x5'));var fs=require('fs');var path=require(_0x6934('0x6'));var rimraf=require(_0x6934('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x57c511,_0x430859){return _0x57c511[_0x6934('0x8')](_0x6934('0x9'),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 4abf138..6ce0fd6 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 _0x5c7b=['request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x549f68,_0x4d0f05){var _0x48f24c=function(_0x304f7e){while(--_0x304f7e){_0x549f68['push'](_0x549f68['shift']());}};_0x48f24c(++_0x4d0f05);}(_0x5c7b,0x195));var _0xb5c7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5c7b[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xb5c7('0x0'));var util=require(_0xb5c7('0x1'));var moment=require(_0xb5c7('0x2'));var BPromise=require(_0xb5c7('0x3'));var rs=require(_0xb5c7('0x4'));var fs=require('fs');var Redis=require(_0xb5c7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb5c7('0x6'))('rpc');var config=require(_0xb5c7('0x7'));var jayson=require(_0xb5c7('0x8'));var client=jayson[_0xb5c7('0x9')][_0xb5c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb0b1d5,_0x4d10a2,_0x3c348e){return new BPromise(function(_0x6a4450,_0x3c581c){return client['request'](_0xb0b1d5,_0x3c348e)[_0xb5c7('0xb')](function(_0x504e41){logger[_0xb5c7('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4d10a2,_0xb5c7('0xd'));logger[_0xb5c7('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x4d10a2,'request\x20sent',JSON['stringify'](_0x504e41));if(_0x504e41['error']){if(_0x504e41['error']['code']===0x1f4){logger['error'](_0xb5c7('0xf'),_0x4d10a2,_0x504e41[_0xb5c7('0x10')][_0xb5c7('0x11')]);return _0x3c581c(_0x504e41[_0xb5c7('0x10')][_0xb5c7('0x11')]);}logger['error'](_0xb5c7('0xf'),_0x4d10a2,_0x504e41[_0xb5c7('0x10')][_0xb5c7('0x11')]);return _0x6a4450(_0x504e41[_0xb5c7('0x10')][_0xb5c7('0x11')]);}else{logger['info'](_0xb5c7('0xf'),_0x4d10a2,_0xb5c7('0xd'));_0x6a4450(_0x504e41[_0xb5c7('0x12')][_0xb5c7('0x11')]);}})['catch'](function(_0x16c730){logger[_0xb5c7('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4d10a2,_0x16c730);_0x3c581c(_0x16c730);});});} \ No newline at end of file +var _0x518b=['request','then','info','request\x20sent','debug','stringify','error','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5a5942,_0x10d206){var _0x471a1b=function(_0x20ff6e){while(--_0x20ff6e){_0x5a5942['push'](_0x5a5942['shift']());}};_0x471a1b(++_0x10d206);}(_0x518b,0x13f));var _0xb518=function(_0x157c40,_0x2b514b){_0x157c40=_0x157c40-0x0;var _0x5cbb3b=_0x518b[_0x157c40];return _0x5cbb3b;};'use strict';var _=require(_0xb518('0x0'));var util=require('util');var moment=require(_0xb518('0x1'));var BPromise=require(_0xb518('0x2'));var rs=require(_0xb518('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb518('0x4'))['db'];var utils=require(_0xb518('0x5'));var logger=require(_0xb518('0x6'))(_0xb518('0x7'));var config=require(_0xb518('0x8'));var jayson=require(_0xb518('0x9'));var client=jayson[_0xb518('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42ce76,_0x1c4924,_0x57b302){return new BPromise(function(_0x3a9402,_0x369f2e){return client[_0xb518('0xb')](_0x42ce76,_0x57b302)[_0xb518('0xc')](function(_0x10004d){logger[_0xb518('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1c4924,_0xb518('0xe'));logger[_0xb518('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x1c4924,_0xb518('0xe'),JSON[_0xb518('0x10')](_0x10004d));if(_0x10004d[_0xb518('0x11')]){if(_0x10004d[_0xb518('0x11')]['code']===0x1f4){logger[_0xb518('0x11')](_0xb518('0x12'),_0x1c4924,_0x10004d[_0xb518('0x11')]['message']);return _0x369f2e(_0x10004d[_0xb518('0x11')][_0xb518('0x13')]);}logger[_0xb518('0x11')](_0xb518('0x12'),_0x1c4924,_0x10004d[_0xb518('0x11')][_0xb518('0x13')]);return _0x3a9402(_0x10004d[_0xb518('0x11')][_0xb518('0x13')]);}else{logger[_0xb518('0xd')](_0xb518('0x12'),_0x1c4924,_0xb518('0xe'));_0x3a9402(_0x10004d[_0xb518('0x14')][_0xb518('0x13')]);}})[_0xb518('0x15')](function(_0x239743){logger[_0xb518('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1c4924,_0x239743);_0x369f2e(_0x239743);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index a0c9be1..3b86f25 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 _0x3c7b=['connect-timeout','express','../../config/environment','./intFreshsalesField.controller','isAuthenticated','get','/:id','show','post','create','update','delete','destroy','multer','util','path'];(function(_0x325e5c,_0x5ef377){var _0x2ca2bd=function(_0x421f56){while(--_0x421f56){_0x325e5c['push'](_0x325e5c['shift']());}};_0x2ca2bd(++_0x5ef377);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x21c05e,_0x524887){_0x21c05e=_0x21c05e-0x0;var _0x83757e=_0x3c7b[_0x21c05e];return _0x83757e;};'use strict';var multer=require(_0xb3c7('0x0'));var util=require(_0xb3c7('0x1'));var path=require(_0xb3c7('0x2'));var timeout=require(_0xb3c7('0x3'));var express=require(_0xb3c7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb3c7('0x5'));var controller=require(_0xb3c7('0x6'));router['get']('/',auth[_0xb3c7('0x7')](),controller['index']);router[_0xb3c7('0x8')](_0xb3c7('0x9'),auth[_0xb3c7('0x7')](),controller[_0xb3c7('0xa')]);router[_0xb3c7('0xb')]('/',auth['isAuthenticated'](),controller[_0xb3c7('0xc')]);router['put'](_0xb3c7('0x9'),auth[_0xb3c7('0x7')](),controller[_0xb3c7('0xd')]);router[_0xb3c7('0xe')]('/:id',auth[_0xb3c7('0x7')](),controller[_0xb3c7('0xf')]);module['exports']=router; \ No newline at end of file +var _0x7a72=['express','fs-extra','../../components/interaction/service','./intFreshsalesField.controller','isAuthenticated','index','post','create','put','update','delete','destroy','util','path'];(function(_0x3fe365,_0xc79b13){var _0x19ff1b=function(_0x271c1a){while(--_0x271c1a){_0x3fe365['push'](_0x3fe365['shift']());}};_0x19ff1b(++_0xc79b13);}(_0x7a72,0x1be));var _0x27a7=function(_0x30f4e2,_0x286bf6){_0x30f4e2=_0x30f4e2-0x0;var _0x4fdb6a=_0x7a72[_0x30f4e2];return _0x4fdb6a;};'use strict';var multer=require('multer');var util=require(_0x27a7('0x0'));var path=require(_0x27a7('0x1'));var timeout=require('connect-timeout');var express=require(_0x27a7('0x2'));var router=express['Router']();var fs_extra=require(_0x27a7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x27a7('0x4'));var config=require('../../config/environment');var controller=require(_0x27a7('0x5'));router['get']('/',auth[_0x27a7('0x6')](),controller[_0x27a7('0x7')]);router['get']('/:id',auth[_0x27a7('0x6')](),controller['show']);router[_0x27a7('0x8')]('/',auth[_0x27a7('0x6')](),controller[_0x27a7('0x9')]);router[_0x27a7('0xa')]('/:id',auth[_0x27a7('0x6')](),controller[_0x27a7('0xb')]);router[_0x27a7('0xc')]('/:id',auth[_0x27a7('0x6')](),controller[_0x27a7('0xd')]);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 bc9291c..996ffc1 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 _0x4ee6=['exports','ENUM','string','variable','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x463697,_0xccfdc4){var _0x33cfe1=function(_0x5c74ec){while(--_0x5c74ec){_0x463697['push'](_0x463697['shift']());}};_0x33cfe1(++_0xccfdc4);}(_0x4ee6,0x170));var _0x64ee=function(_0x4fff24,_0x57ac4d){_0x4fff24=_0x4fff24-0x0;var _0x1ad8bc=_0x4ee6[_0x4fff24];return _0x1ad8bc;};'use strict';var Sequelize=require(_0x64ee('0x0'));module[_0x64ee('0x1')]={'type':{'type':Sequelize[_0x64ee('0x2')](_0x64ee('0x3'),_0x64ee('0x4'),'customVariable','keyValue',_0x64ee('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x64ee('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x64ee('0x2')](_0x64ee('0x3'),'variable',_0x64ee('0x7'))},'keyContent':{'type':Sequelize[_0x64ee('0x6')]},'idField':{'type':Sequelize[_0x64ee('0x6')]},'nameField':{'type':Sequelize[_0x64ee('0x6')]},'customField':{'type':Sequelize[_0x64ee('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x64ee('0x6')]}}; \ No newline at end of file +var _0x2710=['sequelize','exports','ENUM','string','picklist','STRING','variable','BOOLEAN'];(function(_0x575a50,_0x133475){var _0x3fdcb8=function(_0x2eef72){while(--_0x2eef72){_0x575a50['push'](_0x575a50['shift']());}};_0x3fdcb8(++_0x133475);}(_0x2710,0x180));var _0x0271=function(_0x298500,_0x10e07f){_0x298500=_0x298500-0x0;var _0x2d45bc=_0x2710[_0x298500];return _0x2d45bc;};'use strict';var Sequelize=require(_0x0271('0x0'));module[_0x0271('0x1')]={'type':{'type':Sequelize[_0x0271('0x2')](_0x0271('0x3'),'variable','customVariable','keyValue',_0x0271('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0271('0x5')]},'keyType':{'type':Sequelize[_0x0271('0x2')](_0x0271('0x3'),_0x0271('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x0271('0x5')]},'idField':{'type':Sequelize[_0x0271('0x5')]},'nameField':{'type':Sequelize[_0x0271('0x5')]},'customField':{'type':Sequelize[_0x0271('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0271('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index ab99fcc..a3f108d 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 _0x26e6=['offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','options','find','create','body','destroy','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','end','status','undefined','limit','count'];(function(_0xa61084,_0x522c19){var _0x225e68=function(_0x44e796){while(--_0x44e796){_0xa61084['push'](_0xa61084['shift']());}};_0x225e68(++_0x522c19);}(_0x26e6,0x76));var _0x626e=function(_0x419550,_0x15cdf1){_0x419550=_0x419550-0x0;var _0x55f9ef=_0x26e6[_0x419550];return _0x55f9ef;};'use strict';var emlformat=require(_0x626e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x626e('0x1'));var rp=require('request-promise');var moment=require(_0x626e('0x2'));var BPromise=require(_0x626e('0x3'));var Mustache=require(_0x626e('0x4'));var util=require(_0x626e('0x5'));var path=require(_0x626e('0x6'));var sox=require(_0x626e('0x7'));var csv=require(_0x626e('0x8'));var ejs=require(_0x626e('0x9'));var fs=require('fs');var fs_extra=require(_0x626e('0xa'));var _=require(_0x626e('0xb'));var squel=require('squel');var crypto=require(_0x626e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x626e('0xd'));var toCsv=require(_0x626e('0x8'));var querystring=require(_0x626e('0xe'));var Papa=require(_0x626e('0xf'));var Redis=require(_0x626e('0x10'));var authService=require(_0x626e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x626e('0x12'));var hardwareService=require(_0x626e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x626e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x626e('0x15'))['db'];function respondWithStatusCode(_0x5d67d9,_0xf16247){_0xf16247=_0xf16247||0xcc;return function(_0x3d8764){if(_0x3d8764){return _0x5d67d9[_0x626e('0x16')](_0xf16247);}return _0x5d67d9['status'](_0xf16247)[_0x626e('0x17')]();};}function respondWithResult(_0x4a434a,_0x1742c6){_0x1742c6=_0x1742c6||0xc8;return function(_0x309c5e){if(_0x309c5e){return _0x4a434a[_0x626e('0x18')](_0x1742c6)['json'](_0x309c5e);}};}function respondWithFilteredResult(_0x2d9c69,_0x4b8a24){return function(_0x422a66){if(_0x422a66){var _0x5561ca=typeof _0x4b8a24['offset']===_0x626e('0x19')&&typeof _0x4b8a24[_0x626e('0x1a')]===_0x626e('0x19');var _0x31724a=_0x422a66[_0x626e('0x1b')];var _0x6b525e=_0x5561ca?0x0:_0x4b8a24['offset'];var _0x142df1=_0x5561ca?_0x422a66[_0x626e('0x1b')]:_0x4b8a24[_0x626e('0x1c')]+_0x4b8a24['limit'];var _0x31c750;if(_0x142df1>=_0x31724a){_0x142df1=_0x31724a;_0x31c750=0xc8;}else{_0x31c750=0xce;}_0x2d9c69[_0x626e('0x18')](_0x31c750);return _0x2d9c69[_0x626e('0x1d')](_0x626e('0x1e'),_0x6b525e+'-'+_0x142df1+'/'+_0x31724a)[_0x626e('0x1f')](_0x422a66);}return null;};}function patchUpdates(_0x2f4d6b){return function(_0x537754){try{jsonpatch[_0x626e('0x20')](_0x537754,_0x2f4d6b,!![]);}catch(_0x43035a){return BPromise[_0x626e('0x21')](_0x43035a);}return _0x537754[_0x626e('0x22')]();};}function saveUpdates(_0x390be9,_0x251bcd){return function(_0x3fe085){if(_0x3fe085){return _0x3fe085[_0x626e('0x23')](_0x390be9)[_0x626e('0x24')](function(_0x2ba9a7){return _0x2ba9a7;});}return null;};}function removeEntity(_0x50ca77,_0x239dc3){return function(_0x57a4f8){if(_0x57a4f8){return _0x57a4f8['destroy']()['then'](function(){_0x50ca77[_0x626e('0x18')](0xcc)[_0x626e('0x17')]();});}};}function handleEntityNotFound(_0x1490e3,_0x50998c){return function(_0x115f7e){if(!_0x115f7e){_0x1490e3[_0x626e('0x16')](0x194);}return _0x115f7e;};}function handleError(_0x3ce201,_0x28e92e){_0x28e92e=_0x28e92e||0x1f4;return function(_0x261857){logger[_0x626e('0x25')](_0x261857[_0x626e('0x26')]);if(_0x261857[_0x626e('0x27')]){delete _0x261857[_0x626e('0x27')];}_0x3ce201[_0x626e('0x18')](_0x28e92e)[_0x626e('0x28')](_0x261857);};}exports[_0x626e('0x29')]=function(_0x5da051,_0x1fb7d5){var _0x3253fd={},_0x2f8153={},_0x466532={'count':0x0,'rows':[]};var _0x192956=_[_0x626e('0x2a')](db[_0x626e('0x2b')][_0x626e('0x2c')],function(_0x2ca431){return{'name':_0x2ca431[_0x626e('0x2d')],'type':_0x2ca431[_0x626e('0x2e')]['key']};});_0x2f8153[_0x626e('0x2f')]=_[_0x626e('0x2a')](_0x192956,_0x626e('0x27'));_0x2f8153[_0x626e('0x30')]=_[_0x626e('0x31')](_0x5da051[_0x626e('0x30')]);_0x2f8153[_0x626e('0x32')]=_[_0x626e('0x33')](_0x2f8153[_0x626e('0x2f')],_0x2f8153['query']);_0x3253fd[_0x626e('0x34')]=_[_0x626e('0x33')](_0x2f8153[_0x626e('0x2f')],qs[_0x626e('0x35')](_0x5da051[_0x626e('0x30')]['fields']));_0x3253fd[_0x626e('0x34')]=_0x3253fd[_0x626e('0x34')][_0x626e('0x36')]?_0x3253fd[_0x626e('0x34')]:_0x2f8153[_0x626e('0x2f')];if(!_0x5da051[_0x626e('0x30')][_0x626e('0x37')](_0x626e('0x38'))){_0x3253fd[_0x626e('0x1a')]=qs[_0x626e('0x1a')](_0x5da051[_0x626e('0x30')][_0x626e('0x1a')]);_0x3253fd[_0x626e('0x1c')]=qs['offset'](_0x5da051['query']['offset']);}_0x3253fd['order']=qs[_0x626e('0x39')](_0x5da051[_0x626e('0x30')][_0x626e('0x39')]);_0x3253fd[_0x626e('0x3a')]=qs[_0x626e('0x32')](_[_0x626e('0x3b')](_0x5da051[_0x626e('0x30')],_0x2f8153[_0x626e('0x32')]),_0x192956);if(_0x5da051[_0x626e('0x30')]['filter']){_0x3253fd[_0x626e('0x3a')]=_['merge'](_0x3253fd[_0x626e('0x3a')],{'$or':_[_0x626e('0x2a')](_0x192956,function(_0x532690){if(_0x532690[_0x626e('0x2e')]!=='VIRTUAL'){var _0x469acf={};_0x469acf[_0x532690[_0x626e('0x27')]]={'$like':'%'+_0x5da051[_0x626e('0x30')][_0x626e('0x3c')]+'%'};return _0x469acf;}})});}_0x3253fd=_[_0x626e('0x3d')]({},_0x3253fd,_0x5da051['options']);var _0x492659={'where':_0x3253fd['where']};return db[_0x626e('0x2b')][_0x626e('0x1b')](_0x492659)[_0x626e('0x24')](function(_0x31a173){_0x466532[_0x626e('0x1b')]=_0x31a173;if(_0x5da051[_0x626e('0x30')][_0x626e('0x3e')]){_0x3253fd['include']=[{'all':!![]}];}return db[_0x626e('0x2b')][_0x626e('0x3f')](_0x3253fd);})[_0x626e('0x24')](function(_0x1c428e){_0x466532[_0x626e('0x40')]=_0x1c428e;return _0x466532;})[_0x626e('0x24')](respondWithFilteredResult(_0x1fb7d5,_0x3253fd))[_0x626e('0x41')](handleError(_0x1fb7d5,null));};exports[_0x626e('0x42')]=function(_0x5d76d7,_0x19dccd){var _0x2ea638={'raw':!![],'where':{'id':_0x5d76d7[_0x626e('0x43')]['id']}},_0x72c562={};_0x72c562['model']=_[_0x626e('0x31')](db[_0x626e('0x2b')][_0x626e('0x2c')]);_0x72c562[_0x626e('0x30')]=_[_0x626e('0x31')](_0x5d76d7['query']);_0x72c562['filters']=_[_0x626e('0x33')](_0x72c562[_0x626e('0x2f')],_0x72c562[_0x626e('0x30')]);_0x2ea638[_0x626e('0x34')]=_[_0x626e('0x33')](_0x72c562[_0x626e('0x2f')],qs[_0x626e('0x35')](_0x5d76d7[_0x626e('0x30')][_0x626e('0x35')]));_0x2ea638[_0x626e('0x34')]=_0x2ea638[_0x626e('0x34')]['length']?_0x2ea638[_0x626e('0x34')]:_0x72c562[_0x626e('0x2f')];if(_0x5d76d7['query'][_0x626e('0x3e')]){_0x2ea638['include']=[{'all':!![]}];}_0x2ea638=_[_0x626e('0x3d')]({},_0x2ea638,_0x5d76d7[_0x626e('0x44')]);return db[_0x626e('0x2b')][_0x626e('0x45')](_0x2ea638)[_0x626e('0x24')](handleEntityNotFound(_0x19dccd,null))[_0x626e('0x24')](respondWithResult(_0x19dccd,null))[_0x626e('0x41')](handleError(_0x19dccd,null));};exports[_0x626e('0x46')]=function(_0x4a8e5f,_0x54964c){return db['FreshsalesField'][_0x626e('0x46')](_0x4a8e5f['body'],{})[_0x626e('0x24')](respondWithResult(_0x54964c,0xc9))['catch'](handleError(_0x54964c,null));};exports[_0x626e('0x23')]=function(_0x57821e,_0x2ae741){if(_0x57821e[_0x626e('0x47')]['id']){delete _0x57821e['body']['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x57821e[_0x626e('0x43')]['id']}})[_0x626e('0x24')](handleEntityNotFound(_0x2ae741,null))[_0x626e('0x24')](saveUpdates(_0x57821e[_0x626e('0x47')],null))[_0x626e('0x24')](respondWithResult(_0x2ae741,null))[_0x626e('0x41')](handleError(_0x2ae741,null));};exports[_0x626e('0x48')]=function(_0x11c893,_0x32d7e0){return db['FreshsalesField'][_0x626e('0x45')]({'where':{'id':_0x11c893['params']['id']}})[_0x626e('0x24')](handleEntityNotFound(_0x32d7e0,null))[_0x626e('0x24')](removeEntity(_0x32d7e0,null))[_0x626e('0x41')](handleError(_0x32d7e0,null));}; \ No newline at end of file +var _0xc564=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','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','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x201931,_0x492475){var _0x24c01b=function(_0x2c5518){while(--_0x2c5518){_0x201931['push'](_0x201931['shift']());}};_0x24c01b(++_0x492475);}(_0xc564,0x1f1));var _0x4c56=function(_0x35c63c,_0x48a331){_0x35c63c=_0x35c63c-0x0;var _0x2a4434=_0xc564[_0x35c63c];return _0x2a4434;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c56('0x0'));var zipdir=require(_0x4c56('0x1'));var jsonpatch=require(_0x4c56('0x2'));var rp=require(_0x4c56('0x3'));var moment=require(_0x4c56('0x4'));var BPromise=require(_0x4c56('0x5'));var Mustache=require(_0x4c56('0x6'));var util=require(_0x4c56('0x7'));var path=require(_0x4c56('0x8'));var sox=require(_0x4c56('0x9'));var csv=require(_0x4c56('0xa'));var ejs=require(_0x4c56('0xb'));var fs=require('fs');var fs_extra=require(_0x4c56('0xc'));var _=require('lodash');var squel=require(_0x4c56('0xd'));var crypto=require(_0x4c56('0xe'));var jsforce=require(_0x4c56('0xf'));var deskjs=require(_0x4c56('0x10'));var toCsv=require(_0x4c56('0xa'));var querystring=require(_0x4c56('0x11'));var Papa=require(_0x4c56('0x12'));var Redis=require(_0x4c56('0x13'));var authService=require(_0x4c56('0x14'));var qs=require(_0x4c56('0x15'));var as=require(_0x4c56('0x16'));var hardwareService=require(_0x4c56('0x17'));var logger=require(_0x4c56('0x18'))(_0x4c56('0x19'));var utils=require('../../config/utils');var config=require(_0x4c56('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c56('0x1b'))['db'];function respondWithStatusCode(_0x3935ae,_0x39707e){_0x39707e=_0x39707e||0xcc;return function(_0x152002){if(_0x152002){return _0x3935ae[_0x4c56('0x1c')](_0x39707e);}return _0x3935ae[_0x4c56('0x1d')](_0x39707e)[_0x4c56('0x1e')]();};}function respondWithResult(_0x2a70aa,_0x362443){_0x362443=_0x362443||0xc8;return function(_0x6eeec9){if(_0x6eeec9){return _0x2a70aa['status'](_0x362443)[_0x4c56('0x1f')](_0x6eeec9);}};}function respondWithFilteredResult(_0x3e0635,_0x4446a9){return function(_0xc7d34b){if(_0xc7d34b){var _0x240f3b=typeof _0x4446a9['offset']==='undefined'&&typeof _0x4446a9[_0x4c56('0x20')]===_0x4c56('0x21');var _0x236a36=_0xc7d34b[_0x4c56('0x22')];var _0x2e0bc7=_0x240f3b?0x0:_0x4446a9[_0x4c56('0x23')];var _0x5255ab=_0x240f3b?_0xc7d34b[_0x4c56('0x22')]:_0x4446a9[_0x4c56('0x23')]+_0x4446a9[_0x4c56('0x20')];var _0x2ad2cf;if(_0x5255ab>=_0x236a36){_0x5255ab=_0x236a36;_0x2ad2cf=0xc8;}else{_0x2ad2cf=0xce;}_0x3e0635[_0x4c56('0x1d')](_0x2ad2cf);return _0x3e0635[_0x4c56('0x24')](_0x4c56('0x25'),_0x2e0bc7+'-'+_0x5255ab+'/'+_0x236a36)[_0x4c56('0x1f')](_0xc7d34b);}return null;};}function patchUpdates(_0x392865){return function(_0x22f423){try{jsonpatch[_0x4c56('0x26')](_0x22f423,_0x392865,!![]);}catch(_0xbd8236){return BPromise['reject'](_0xbd8236);}return _0x22f423['save']();};}function saveUpdates(_0x570189,_0x664c09){return function(_0x5f5e09){if(_0x5f5e09){return _0x5f5e09[_0x4c56('0x27')](_0x570189)[_0x4c56('0x28')](function(_0x121f3b){return _0x121f3b;});}return null;};}function removeEntity(_0x2d9fe5,_0x3a3aa3){return function(_0x316f27){if(_0x316f27){return _0x316f27[_0x4c56('0x29')]()[_0x4c56('0x28')](function(){_0x2d9fe5[_0x4c56('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bb962,_0x351d93){return function(_0x2ca12e){if(!_0x2ca12e){_0x5bb962[_0x4c56('0x1c')](0x194);}return _0x2ca12e;};}function handleError(_0x61398e,_0x3965e8){_0x3965e8=_0x3965e8||0x1f4;return function(_0x47bce3){logger[_0x4c56('0x2a')](_0x47bce3[_0x4c56('0x2b')]);if(_0x47bce3[_0x4c56('0x2c')]){delete _0x47bce3[_0x4c56('0x2c')];}_0x61398e[_0x4c56('0x1d')](_0x3965e8)[_0x4c56('0x2d')](_0x47bce3);};}exports[_0x4c56('0x2e')]=function(_0xdbf5af,_0x12657d){var _0x5031e0={},_0x561794={},_0x4ad3f2={'count':0x0,'rows':[]};var _0x44f82b=_[_0x4c56('0x2f')](db[_0x4c56('0x30')][_0x4c56('0x31')],function(_0x2dedf3){return{'name':_0x2dedf3[_0x4c56('0x32')],'type':_0x2dedf3[_0x4c56('0x33')][_0x4c56('0x34')]};});_0x561794[_0x4c56('0x35')]=_[_0x4c56('0x2f')](_0x44f82b,'name');_0x561794[_0x4c56('0x36')]=_[_0x4c56('0x37')](_0xdbf5af['query']);_0x561794[_0x4c56('0x38')]=_[_0x4c56('0x39')](_0x561794['model'],_0x561794[_0x4c56('0x36')]);_0x5031e0[_0x4c56('0x3a')]=_['intersection'](_0x561794[_0x4c56('0x35')],qs[_0x4c56('0x3b')](_0xdbf5af[_0x4c56('0x36')]['fields']));_0x5031e0[_0x4c56('0x3a')]=_0x5031e0[_0x4c56('0x3a')][_0x4c56('0x3c')]?_0x5031e0[_0x4c56('0x3a')]:_0x561794[_0x4c56('0x35')];if(!_0xdbf5af[_0x4c56('0x36')][_0x4c56('0x3d')]('nolimit')){_0x5031e0['limit']=qs['limit'](_0xdbf5af[_0x4c56('0x36')][_0x4c56('0x20')]);_0x5031e0[_0x4c56('0x23')]=qs[_0x4c56('0x23')](_0xdbf5af['query'][_0x4c56('0x23')]);}_0x5031e0[_0x4c56('0x3e')]=qs[_0x4c56('0x3f')](_0xdbf5af['query'][_0x4c56('0x3f')]);_0x5031e0['where']=qs[_0x4c56('0x38')](_[_0x4c56('0x40')](_0xdbf5af['query'],_0x561794[_0x4c56('0x38')]),_0x44f82b);if(_0xdbf5af['query'][_0x4c56('0x41')]){_0x5031e0[_0x4c56('0x42')]=_[_0x4c56('0x43')](_0x5031e0['where'],{'$or':_[_0x4c56('0x2f')](_0x44f82b,function(_0x4d7fc2){if(_0x4d7fc2[_0x4c56('0x33')]!=='VIRTUAL'){var _0x4450c7={};_0x4450c7[_0x4d7fc2[_0x4c56('0x2c')]]={'$like':'%'+_0xdbf5af[_0x4c56('0x36')][_0x4c56('0x41')]+'%'};return _0x4450c7;}})});}_0x5031e0=_[_0x4c56('0x43')]({},_0x5031e0,_0xdbf5af[_0x4c56('0x44')]);var _0x37e89c={'where':_0x5031e0[_0x4c56('0x42')]};return db[_0x4c56('0x30')][_0x4c56('0x22')](_0x37e89c)['then'](function(_0x2439f8){_0x4ad3f2['count']=_0x2439f8;if(_0xdbf5af[_0x4c56('0x36')][_0x4c56('0x45')]){_0x5031e0[_0x4c56('0x46')]=[{'all':!![]}];}return db['FreshsalesField'][_0x4c56('0x47')](_0x5031e0);})['then'](function(_0x24377e){_0x4ad3f2[_0x4c56('0x48')]=_0x24377e;return _0x4ad3f2;})[_0x4c56('0x28')](respondWithFilteredResult(_0x12657d,_0x5031e0))[_0x4c56('0x49')](handleError(_0x12657d,null));};exports[_0x4c56('0x4a')]=function(_0x5efe5a,_0x567c60){var _0x31891b={'raw':!![],'where':{'id':_0x5efe5a['params']['id']}},_0x2326fd={};_0x2326fd['model']=_['keys'](db[_0x4c56('0x30')]['rawAttributes']);_0x2326fd['query']=_[_0x4c56('0x37')](_0x5efe5a[_0x4c56('0x36')]);_0x2326fd[_0x4c56('0x38')]=_[_0x4c56('0x39')](_0x2326fd[_0x4c56('0x35')],_0x2326fd['query']);_0x31891b[_0x4c56('0x3a')]=_[_0x4c56('0x39')](_0x2326fd[_0x4c56('0x35')],qs[_0x4c56('0x3b')](_0x5efe5a[_0x4c56('0x36')]['fields']));_0x31891b['attributes']=_0x31891b[_0x4c56('0x3a')][_0x4c56('0x3c')]?_0x31891b['attributes']:_0x2326fd[_0x4c56('0x35')];if(_0x5efe5a['query'][_0x4c56('0x45')]){_0x31891b['include']=[{'all':!![]}];}_0x31891b=_[_0x4c56('0x43')]({},_0x31891b,_0x5efe5a[_0x4c56('0x44')]);return db[_0x4c56('0x30')][_0x4c56('0x4b')](_0x31891b)[_0x4c56('0x28')](handleEntityNotFound(_0x567c60,null))[_0x4c56('0x28')](respondWithResult(_0x567c60,null))[_0x4c56('0x49')](handleError(_0x567c60,null));};exports[_0x4c56('0x4c')]=function(_0xecdec6,_0x20150f){return db[_0x4c56('0x30')][_0x4c56('0x4c')](_0xecdec6[_0x4c56('0x4d')],{})[_0x4c56('0x28')](respondWithResult(_0x20150f,0xc9))['catch'](handleError(_0x20150f,null));};exports[_0x4c56('0x27')]=function(_0x10563b,_0x472cce){if(_0x10563b[_0x4c56('0x4d')]['id']){delete _0x10563b[_0x4c56('0x4d')]['id'];}return db['FreshsalesField'][_0x4c56('0x4b')]({'where':{'id':_0x10563b[_0x4c56('0x4e')]['id']}})[_0x4c56('0x28')](handleEntityNotFound(_0x472cce,null))[_0x4c56('0x28')](saveUpdates(_0x10563b['body'],null))['then'](respondWithResult(_0x472cce,null))[_0x4c56('0x49')](handleError(_0x472cce,null));};exports[_0x4c56('0x29')]=function(_0x51f53b,_0x5f13e7){return db[_0x4c56('0x30')]['find']({'where':{'id':_0x51f53b['params']['id']}})[_0x4c56('0x28')](handleEntityNotFound(_0x5f13e7,null))[_0x4c56('0x28')](removeEntity(_0x5f13e7,null))['catch'](handleError(_0x5f13e7,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 74e3bb6..ab1abcd 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 _0xfa4d=['int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','api','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField'];(function(_0x1e3cc5,_0x409b67){var _0x51792e=function(_0x40ad46){while(--_0x40ad46){_0x1e3cc5['push'](_0x1e3cc5['shift']());}};_0x51792e(++_0x409b67);}(_0xfa4d,0x90));var _0xdfa4=function(_0x5808f5,_0x59d9a2){_0x5808f5=_0x5808f5-0x0;var _0xdbb21c=_0xfa4d[_0x5808f5];return _0xdbb21c;};'use strict';var _=require(_0xdfa4('0x0'));var util=require(_0xdfa4('0x1'));var logger=require('../../config/logger')(_0xdfa4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfa4('0x3'));var rimraf=require(_0xdfa4('0x4'));var config=require(_0xdfa4('0x5'));var attributes=require(_0xdfa4('0x6'));module[_0xdfa4('0x7')]=function(_0x383a02,_0x3e1c11){return _0x383a02[_0xdfa4('0x8')](_0xdfa4('0x9'),attributes,{'tableName':_0xdfa4('0xa'),'paranoid':![],'indexes':[{'name':_0xdfa4('0xb'),'fields':[_0xdfa4('0xc'),_0xdfa4('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c8d=['FieldId','util','../../config/logger','api','moment','bluebird','./intFreshsalesField.attributes','exports','define','int_freshsales_fields','freshsales_unique_index','idField'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x0c8d,0x79));var _0xd0c8=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x0c8d[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require('lodash');var util=require(_0xd0c8('0x0'));var logger=require(_0xd0c8('0x1'))(_0xd0c8('0x2'));var moment=require(_0xd0c8('0x3'));var BPromise=require(_0xd0c8('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(_0xd0c8('0x5'));module[_0xd0c8('0x6')]=function(_0xa4eeb2,_0x50484d){return _0xa4eeb2[_0xd0c8('0x7')]('FreshsalesField',attributes,{'tableName':_0xd0c8('0x8'),'paranoid':![],'indexes':[{'name':_0xd0c8('0x9'),'fields':[_0xd0c8('0xa'),_0xd0c8('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 1a6e556..0b8ad02 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 _0x90b1=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xf3ea9e,_0x4a5ee7){var _0x4fc403=function(_0x420e00){while(--_0x420e00){_0xf3ea9e['push'](_0xf3ea9e['shift']());}};_0x4fc403(++_0x4a5ee7);}(_0x90b1,0x1bb));var _0x190b=function(_0x525798,_0x77a707){_0x525798=_0x525798-0x0;var _0x57da9a=_0x90b1[_0x525798];return _0x57da9a;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});} \ No newline at end of file +var _0x2bd8=['info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x138751,_0x3f0d0e){var _0x123c59=function(_0x3e5200){while(--_0x3e5200){_0x138751['push'](_0x138751['shift']());}};_0x123c59(++_0x3f0d0e);}(_0x2bd8,0x130));var _0x82bd=function(_0xdd0c2b,_0x59a728){_0xdd0c2b=_0xdd0c2b-0x0;var _0x594f98=_0x2bd8[_0xdd0c2b];return _0x594f98;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var moment=require(_0x82bd('0x1'));var BPromise=require(_0x82bd('0x2'));var rs=require(_0x82bd('0x3'));var fs=require('fs');var Redis=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];var utils=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('rpc');var config=require(_0x82bd('0x8'));var jayson=require(_0x82bd('0x9'));var client=jayson[_0x82bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){return client[_0x82bd('0xb')](_0x19dbb1,_0x226f60)['then'](function(_0x4a9b2c){logger['info'](_0x82bd('0xc'),_0x77d7a9,'request\x20sent');logger['debug'](_0x82bd('0xd'),_0x77d7a9,'request\x20sent',JSON['stringify'](_0x4a9b2c));if(_0x4a9b2c[_0x82bd('0xe')]){if(_0x4a9b2c[_0x82bd('0xe')]['code']===0x1f4){logger[_0x82bd('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x4a9b2c[_0x82bd('0xe')]['message']);return _0x4dc3a6(_0x4a9b2c[_0x82bd('0xe')][_0x82bd('0xf')]);}logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x4a9b2c['error'][_0x82bd('0xf')]);return _0x1f7463(_0x4a9b2c[_0x82bd('0xe')]['message']);}else{logger[_0x82bd('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x82bd('0x11'));_0x1f7463(_0x4a9b2c[_0x82bd('0x12')][_0x82bd('0xf')]);}})[_0x82bd('0x13')](function(_0x209081){logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x209081);_0x4dc3a6(_0x209081);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index e883ae2..229056a 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(_0x3b9a5f,_0x2dc970){var _0x156136=function(_0x51b752){while(--_0x51b752){_0x3b9a5f['push'](_0x3b9a5f['shift']());}};_0x156136(++_0x2dc970);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x4dba4d,_0x17d11f){var _0x2c11a6=function(_0x1b6d9c){while(--_0x1b6d9c){_0x4dba4d['push'](_0x4dba4d['shift']());}};_0x2c11a6(++_0x17d11f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 8202b6e..f783244 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 _0x1399=['STRING','username','integrationTab','newTab','sequelize','exports'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0x1399,0x16c));var _0x9139=function(_0x79e316,_0x38e778){_0x79e316=_0x79e316-0x0;var _0xb8b436=_0x1399[_0x79e316];return _0xb8b436;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9139('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x9139('0x3')},'remoteUri':{'type':Sequelize[_0x9139('0x2')]},'password':{'type':Sequelize[_0x9139('0x2')]},'clientId':{'type':Sequelize[_0x9139('0x2')]},'clientSecret':{'type':Sequelize[_0x9139('0x2')]},'securityToken':{'type':Sequelize[_0x9139('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9139('0x4'),_0x9139('0x5')),'defaultValue':_0x9139('0x4')}}; \ No newline at end of file +var _0x7a02=['username','ENUM','integrationTab','newTab','exports','STRING'];(function(_0x2e0ffa,_0x451f12){var _0x24d627=function(_0x4d0f09){while(--_0x4d0f09){_0x2e0ffa['push'](_0x2e0ffa['shift']());}};_0x24d627(++_0x451f12);}(_0x7a02,0x1ba));var _0x27a0=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x7a02[_0x3e44fa];return _0x2a0aba;};'use strict';var Sequelize=require('sequelize');module[_0x27a0('0x0')]={'name':{'type':Sequelize[_0x27a0('0x1')]},'description':{'type':Sequelize[_0x27a0('0x1')]},'username':{'type':Sequelize[_0x27a0('0x1')],'unique':_0x27a0('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x27a0('0x1')]},'clientId':{'type':Sequelize[_0x27a0('0x1')]},'clientSecret':{'type':Sequelize[_0x27a0('0x1')]},'securityToken':{'type':Sequelize[_0x27a0('0x1')]},'serverUrl':{'type':Sequelize[_0x27a0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x27a0('0x3')](_0x27a0('0x4'),_0x27a0('0x5')),'defaultValue':_0x27a0('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 6fc7a0d..e794c2b 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 _0x2efb=['remove','includes','label','custom','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','count','limit','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SalesforceAccount','catch','params','includeAll','include','body','find','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','AccountId','channel','Descriptions','getDescriptions','create','SalesforceField','getFields','remoteUri','clientId','username','securityToken','slice','substring','Connection','clientSecret','login','password','concat','ticketType','sobject','ActivityDate','IsReminderSet','string','int','picklist','boolean','email','phone'];(function(_0x2e1471,_0x145d83){var _0x197364=function(_0x42f5b3){while(--_0x42f5b3){_0x2e1471['push'](_0x2e1471['shift']());}};_0x197364(++_0x145d83);}(_0x2efb,0x170));var _0xb2ef=function(_0x5c8209,_0x4ab695){_0x5c8209=_0x5c8209-0x0;var _0x2e2122=_0x2efb[_0x5c8209];return _0x2e2122;};'use strict';var emlformat=require(_0xb2ef('0x0'));var rimraf=require(_0xb2ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2ef('0x2'));var rp=require(_0xb2ef('0x3'));var moment=require(_0xb2ef('0x4'));var BPromise=require(_0xb2ef('0x5'));var Mustache=require(_0xb2ef('0x6'));var util=require(_0xb2ef('0x7'));var path=require(_0xb2ef('0x8'));var sox=require(_0xb2ef('0x9'));var csv=require(_0xb2ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb2ef('0xb'));var _=require(_0xb2ef('0xc'));var squel=require(_0xb2ef('0xd'));var crypto=require(_0xb2ef('0xe'));var jsforce=require(_0xb2ef('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb2ef('0xa'));var querystring=require(_0xb2ef('0x10'));var Papa=require(_0xb2ef('0x11'));var Redis=require('ioredis');var authService=require(_0xb2ef('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb2ef('0x13'));var hardwareService=require(_0xb2ef('0x14'));var logger=require(_0xb2ef('0x15'))(_0xb2ef('0x16'));var utils=require(_0xb2ef('0x17'));var config=require(_0xb2ef('0x18'));var licenseUtil=require(_0xb2ef('0x19'));var db=require(_0xb2ef('0x1a'))['db'];var integrations=require(_0xb2ef('0x1b'));function respondWithStatusCode(_0x2a625c,_0x2b4250){_0x2b4250=_0x2b4250||0xcc;return function(_0x445281){if(_0x445281){return _0x2a625c[_0xb2ef('0x1c')](_0x2b4250);}return _0x2a625c[_0xb2ef('0x1d')](_0x2b4250)['end']();};}function respondWithResult(_0x5bb8c6,_0x55e385){_0x55e385=_0x55e385||0xc8;return function(_0x21ec34){if(_0x21ec34){return _0x5bb8c6[_0xb2ef('0x1d')](_0x55e385)[_0xb2ef('0x1e')](_0x21ec34);}};}function respondWithFilteredResult(_0xedb52,_0x292dde){return function(_0x8ff73c){if(_0x8ff73c){var _0x170e3d=typeof _0x292dde[_0xb2ef('0x1f')]==='undefined'&&typeof _0x292dde['limit']==='undefined';var _0x55c846=_0x8ff73c[_0xb2ef('0x20')];var _0xb9f08c=_0x170e3d?0x0:_0x292dde[_0xb2ef('0x1f')];var _0x436e17=_0x170e3d?_0x8ff73c[_0xb2ef('0x20')]:_0x292dde[_0xb2ef('0x1f')]+_0x292dde[_0xb2ef('0x21')];var _0x2f3afe;if(_0x436e17>=_0x55c846){_0x436e17=_0x55c846;_0x2f3afe=0xc8;}else{_0x2f3afe=0xce;}_0xedb52['status'](_0x2f3afe);return _0xedb52['set']('Content-Range',_0xb9f08c+'-'+_0x436e17+'/'+_0x55c846)['json'](_0x8ff73c);}return null;};}function patchUpdates(_0x308d08){return function(_0x18ba1b){try{jsonpatch['apply'](_0x18ba1b,_0x308d08,!![]);}catch(_0x33cbed){return BPromise[_0xb2ef('0x22')](_0x33cbed);}return _0x18ba1b[_0xb2ef('0x23')]();};}function saveUpdates(_0x386f14,_0x202101){return function(_0x434b71){if(_0x434b71){return _0x434b71[_0xb2ef('0x24')](_0x386f14)['then'](function(_0x2b5700){return _0x2b5700;});}return null;};}function removeEntity(_0x1ffa33,_0x5b8c47){return function(_0x39fe73){if(_0x39fe73){return _0x39fe73[_0xb2ef('0x25')]()[_0xb2ef('0x26')](function(){_0x1ffa33[_0xb2ef('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x525b11,_0x48c303){return function(_0x3cf854){if(!_0x3cf854){_0x525b11[_0xb2ef('0x1c')](0x194);}return _0x3cf854;};}function handleError(_0x352549,_0x525674){_0x525674=_0x525674||0x1f4;return function(_0x5cac90){logger[_0xb2ef('0x27')](_0x5cac90[_0xb2ef('0x28')]);if(_0x5cac90['name']){delete _0x5cac90[_0xb2ef('0x29')];}_0x352549['status'](_0x525674)[_0xb2ef('0x2a')](_0x5cac90);};}exports[_0xb2ef('0x2b')]=function(_0x4c4408,_0x4c1164){var _0x100717={},_0x14ced4={},_0x26e59f={'count':0x0,'rows':[]};var _0x383d2f=_[_0xb2ef('0x2c')](db['SalesforceAccount'][_0xb2ef('0x2d')],function(_0x21f182){return{'name':_0x21f182[_0xb2ef('0x2e')],'type':_0x21f182[_0xb2ef('0x2f')]['key']};});_0x14ced4[_0xb2ef('0x30')]=_[_0xb2ef('0x2c')](_0x383d2f,_0xb2ef('0x29'));_0x14ced4[_0xb2ef('0x31')]=_[_0xb2ef('0x32')](_0x4c4408[_0xb2ef('0x31')]);_0x14ced4[_0xb2ef('0x33')]=_[_0xb2ef('0x34')](_0x14ced4[_0xb2ef('0x30')],_0x14ced4[_0xb2ef('0x31')]);_0x100717['attributes']=_[_0xb2ef('0x34')](_0x14ced4['model'],qs[_0xb2ef('0x35')](_0x4c4408['query'][_0xb2ef('0x35')]));_0x100717[_0xb2ef('0x36')]=_0x100717[_0xb2ef('0x36')][_0xb2ef('0x37')]?_0x100717[_0xb2ef('0x36')]:_0x14ced4[_0xb2ef('0x30')];if(!_0x4c4408['query'][_0xb2ef('0x38')](_0xb2ef('0x39'))){_0x100717[_0xb2ef('0x21')]=qs['limit'](_0x4c4408[_0xb2ef('0x31')][_0xb2ef('0x21')]);_0x100717[_0xb2ef('0x1f')]=qs['offset'](_0x4c4408[_0xb2ef('0x31')][_0xb2ef('0x1f')]);}_0x100717[_0xb2ef('0x3a')]=qs[_0xb2ef('0x3b')](_0x4c4408[_0xb2ef('0x31')]['sort']);_0x100717[_0xb2ef('0x3c')]=qs['filters'](_[_0xb2ef('0x3d')](_0x4c4408[_0xb2ef('0x31')],_0x14ced4[_0xb2ef('0x33')]),_0x383d2f);if(_0x4c4408[_0xb2ef('0x31')][_0xb2ef('0x3e')]){_0x100717[_0xb2ef('0x3c')]=_[_0xb2ef('0x3f')](_0x100717['where'],{'$or':_['map'](_0x383d2f,function(_0x2489ea){if(_0x2489ea[_0xb2ef('0x2f')]!=='VIRTUAL'){var _0x1c246b={};_0x1c246b[_0x2489ea[_0xb2ef('0x29')]]={'$like':'%'+_0x4c4408[_0xb2ef('0x31')][_0xb2ef('0x3e')]+'%'};return _0x1c246b;}})});}_0x100717=_['merge']({},_0x100717,_0x4c4408[_0xb2ef('0x40')]);var _0x1f09a6={'where':_0x100717['where']};return db['SalesforceAccount'][_0xb2ef('0x20')](_0x1f09a6)['then'](function(_0x5bb938){_0x26e59f[_0xb2ef('0x20')]=_0x5bb938;if(_0x4c4408[_0xb2ef('0x31')]['includeAll']){_0x100717['include']=[{'all':!![]}];}return db[_0xb2ef('0x41')]['findAll'](_0x100717);})[_0xb2ef('0x26')](function(_0x501ae7){_0x26e59f['rows']=_0x501ae7;return _0x26e59f;})[_0xb2ef('0x26')](respondWithFilteredResult(_0x4c1164,_0x100717))[_0xb2ef('0x42')](handleError(_0x4c1164,null));};exports['show']=function(_0x3b7f42,_0x4f2ae8){var _0x4f4b1c={'raw':![],'where':{'id':_0x3b7f42[_0xb2ef('0x43')]['id']}},_0x3effdc={};_0x3effdc['model']=_[_0xb2ef('0x32')](db['SalesforceAccount'][_0xb2ef('0x2d')]);_0x3effdc['query']=_[_0xb2ef('0x32')](_0x3b7f42['query']);_0x3effdc[_0xb2ef('0x33')]=_[_0xb2ef('0x34')](_0x3effdc[_0xb2ef('0x30')],_0x3effdc[_0xb2ef('0x31')]);_0x4f4b1c['attributes']=_['intersection'](_0x3effdc[_0xb2ef('0x30')],qs[_0xb2ef('0x35')](_0x3b7f42['query'][_0xb2ef('0x35')]));_0x4f4b1c[_0xb2ef('0x36')]=_0x4f4b1c[_0xb2ef('0x36')][_0xb2ef('0x37')]?_0x4f4b1c[_0xb2ef('0x36')]:_0x3effdc[_0xb2ef('0x30')];if(_0x3b7f42['query'][_0xb2ef('0x44')]){_0x4f4b1c[_0xb2ef('0x45')]=[{'all':!![]}];}_0x4f4b1c=_[_0xb2ef('0x3f')]({},_0x4f4b1c,_0x3b7f42[_0xb2ef('0x40')]);return db[_0xb2ef('0x41')]['find'](_0x4f4b1c)[_0xb2ef('0x26')](handleEntityNotFound(_0x4f2ae8,null))[_0xb2ef('0x26')](respondWithResult(_0x4f2ae8,null))[_0xb2ef('0x42')](handleError(_0x4f2ae8,null));};exports['create']=function(_0x381a94,_0x3a752e){return db[_0xb2ef('0x41')]['create'](_0x381a94['body'],{})[_0xb2ef('0x26')](respondWithResult(_0x3a752e,0xc9))[_0xb2ef('0x42')](handleError(_0x3a752e,null));};exports['update']=function(_0x20a8a5,_0x1c18ef){if(_0x20a8a5[_0xb2ef('0x46')]['id']){delete _0x20a8a5[_0xb2ef('0x46')]['id'];}return db['SalesforceAccount'][_0xb2ef('0x47')]({'where':{'id':_0x20a8a5['params']['id']}})[_0xb2ef('0x26')](handleEntityNotFound(_0x1c18ef,null))[_0xb2ef('0x26')](saveUpdates(_0x20a8a5['body'],null))[_0xb2ef('0x26')](respondWithResult(_0x1c18ef,null))['catch'](handleError(_0x1c18ef,null));};exports['destroy']=function(_0x2b9873,_0x361803){return db[_0xb2ef('0x41')][_0xb2ef('0x47')]({'where':{'id':_0x2b9873['params']['id']}})['then'](handleEntityNotFound(_0x361803,null))[_0xb2ef('0x26')](removeEntity(_0x361803,null))[_0xb2ef('0x42')](handleError(_0x361803,null));};exports[_0xb2ef('0x48')]=function(_0x521ceb,_0x1eaa26,_0x1f213d){var _0xd994ff={};var _0x546228={};var _0x4cbf54;var _0xcd0181;return db[_0xb2ef('0x41')]['findOne']({'where':{'id':_0x521ceb[_0xb2ef('0x43')]['id']}})[_0xb2ef('0x26')](handleEntityNotFound(_0x1eaa26,null))[_0xb2ef('0x26')](function(_0x520396){if(_0x520396){_0x4cbf54=_0x520396;_0x546228[_0xb2ef('0x30')]=_['keys'](db[_0xb2ef('0x49')][_0xb2ef('0x2d')]);_0x546228[_0xb2ef('0x31')]=_['keys'](_0x521ceb['query']);_0x546228['filters']=_['intersection'](_0x546228['model'],_0x546228[_0xb2ef('0x31')]);_0xd994ff[_0xb2ef('0x36')]=_[_0xb2ef('0x34')](_0x546228[_0xb2ef('0x30')],qs[_0xb2ef('0x35')](_0x521ceb[_0xb2ef('0x31')][_0xb2ef('0x35')]));_0xd994ff[_0xb2ef('0x36')]=_0xd994ff[_0xb2ef('0x36')][_0xb2ef('0x37')]?_0xd994ff[_0xb2ef('0x36')]:_0x546228[_0xb2ef('0x30')];_0xd994ff[_0xb2ef('0x3a')]=qs[_0xb2ef('0x3b')](_0x521ceb[_0xb2ef('0x31')][_0xb2ef('0x3b')]);_0xd994ff[_0xb2ef('0x3c')]=qs[_0xb2ef('0x33')](_[_0xb2ef('0x3d')](_0x521ceb[_0xb2ef('0x31')],_0x546228['filters']));if(_0x521ceb[_0xb2ef('0x31')][_0xb2ef('0x3e')]){_0xd994ff[_0xb2ef('0x3c')]=_[_0xb2ef('0x3f')](_0xd994ff[_0xb2ef('0x3c')],{'$or':_['map'](_0xd994ff[_0xb2ef('0x36')],function(_0x315ace){var _0x529d6f={};_0x529d6f[_0x315ace]={'$like':'%'+_0x521ceb[_0xb2ef('0x31')][_0xb2ef('0x3e')]+'%'};return _0x529d6f;})});}_0xd994ff=_[_0xb2ef('0x3f')]({},_0xd994ff,_0x521ceb[_0xb2ef('0x40')]);return _0x4cbf54[_0xb2ef('0x48')](_0xd994ff);}})[_0xb2ef('0x26')](function(_0x550eaf){if(_0x550eaf){_0xcd0181=_0x550eaf[_0xb2ef('0x37')];if(!_0x521ceb['query'][_0xb2ef('0x38')](_0xb2ef('0x39'))){_0xd994ff[_0xb2ef('0x21')]=qs['limit'](_0x521ceb[_0xb2ef('0x31')][_0xb2ef('0x21')]);_0xd994ff[_0xb2ef('0x1f')]=qs[_0xb2ef('0x1f')](_0x521ceb[_0xb2ef('0x31')][_0xb2ef('0x1f')]);}return _0x4cbf54[_0xb2ef('0x48')](_0xd994ff);}})[_0xb2ef('0x26')](function(_0x3dd43d){if(_0x3dd43d){return _0x3dd43d?{'count':_0xcd0181,'rows':_0x3dd43d}:null;}})[_0xb2ef('0x26')](respondWithResult(_0x1eaa26,null))[_0xb2ef('0x42')](handleError(_0x1eaa26,null));};exports[_0xb2ef('0x4a')]=function(_0xa79ee7,_0x5ebfac,_0x58e57d){if(_0xa79ee7['body']['id']){delete _0xa79ee7[_0xb2ef('0x46')]['id'];}return db[_0xb2ef('0x41')][_0xb2ef('0x4b')]({'where':{'id':_0xa79ee7[_0xb2ef('0x43')]['id']}})[_0xb2ef('0x26')](handleEntityNotFound(_0x5ebfac,null))['then'](function(_0x33fc0d){if(_0x33fc0d){_0xa79ee7[_0xb2ef('0x46')][_0xb2ef('0x4c')]=_0x33fc0d['id'];_0xa79ee7[_0xb2ef('0x46')]['Subjects']=integrations['getSubjects'](_0xa79ee7[_0xb2ef('0x46')][_0xb2ef('0x4d')],_0xa79ee7['body'][_0xb2ef('0x2f')]);_0xa79ee7[_0xb2ef('0x46')][_0xb2ef('0x4e')]=integrations[_0xb2ef('0x4f')](_0xa79ee7[_0xb2ef('0x46')][_0xb2ef('0x4d')],_0xa79ee7['body'][_0xb2ef('0x2f')]);return db[_0xb2ef('0x49')][_0xb2ef('0x50')](_0xa79ee7['body'],{'include':[{'model':db[_0xb2ef('0x51')],'as':'Subjects'},{'model':db[_0xb2ef('0x51')],'as':_0xb2ef('0x4e')}]});}return null;})[_0xb2ef('0x26')](respondWithResult(_0x5ebfac,null))[_0xb2ef('0x42')](handleError(_0x5ebfac,null));};exports[_0xb2ef('0x52')]=function(_0x1c6cd8,_0x58d86a,_0x2b524b){var _0x5ec3c2;var _0x5c83b1='';var _0x91f570='Task';return db[_0xb2ef('0x41')][_0xb2ef('0x4b')]({'where':{'id':_0x1c6cd8[_0xb2ef('0x43')]['id']},'attributes':['id',_0xb2ef('0x53'),_0xb2ef('0x54'),'clientSecret',_0xb2ef('0x55'),'password',_0xb2ef('0x56')]})[_0xb2ef('0x26')](handleEntityNotFound(_0x58d86a,null))[_0xb2ef('0x26')](function(_0x3faced){if(_0x3faced){_0x5c83b1=_0x3faced[_0xb2ef('0x53')];var _0x4a1dc6=_0x5c83b1[_0xb2ef('0x57')](-0x1);if(_0x4a1dc6==='/'){_0x5c83b1=_0x5c83b1[_0xb2ef('0x58')](0x0,_0x5c83b1['lastIndexOf'](_0x4a1dc6));}_0x5ec3c2=new jsforce[(_0xb2ef('0x59'))]({'oauth2':{'loginUrl':_0x5c83b1,'clientId':_0x3faced['clientId'],'clientSecret':_0x3faced[_0xb2ef('0x5a')]}});return _0x5ec3c2[_0xb2ef('0x5b')](_0x3faced[_0xb2ef('0x55')],_0x3faced[_0xb2ef('0x5c')][_0xb2ef('0x5d')](_0x3faced[_0xb2ef('0x56')]));}})[_0xb2ef('0x26')](function(_0x594cd3){if(_0x594cd3){if(!_['isNil'](_0x1c6cd8[_0xb2ef('0x31')][_0xb2ef('0x5e')])){_0x91f570=_0x1c6cd8[_0xb2ef('0x31')][_0xb2ef('0x5e')];}return _0x5ec3c2[_0xb2ef('0x5f')](_0x91f570)['describe']();}})[_0xb2ef('0x26')](function(_0x2612b7){var _0x27b2ba=['OwnerId',_0xb2ef('0x60'),_0xb2ef('0x61'),'IsRecurrence','Subject','Description'];var _0x35eefd=[_0xb2ef('0x62'),_0xb2ef('0x63'),_0xb2ef('0x64'),_0xb2ef('0x65'),_0xb2ef('0x66'),'textarea',_0xb2ef('0x67')];if(_0x2612b7){_[_0xb2ef('0x68')](_0x2612b7['fields'],function(_0x132265){return _0x27b2ba[_0xb2ef('0x69')](_0x132265[_0xb2ef('0x29')])||!_0x35eefd['includes'](_0x132265[_0xb2ef('0x2f')]);});return{'count':_0x2612b7[_0xb2ef('0x35')][_0xb2ef('0x37')],'rows':_['map'](_0x2612b7['fields'],function(_0x1b4890){return{'id':_0x1b4890[_0xb2ef('0x29')],'name':_0x1b4890[_0xb2ef('0x6a')],'custom':_0x1b4890[_0xb2ef('0x6b')],'options':_0x1b4890[_0xb2ef('0x6c')]['length']>0x0?_['map'](_0x1b4890[_0xb2ef('0x6c')],function(_0x395e5b){return{'name':_0x395e5b[_0xb2ef('0x6a')],'value':_0x395e5b[_0xb2ef('0x6d')]};}):_0x1b4890['type']==_0xb2ef('0x65')?[{'name':_0xb2ef('0x6e'),'value':_0xb2ef('0x6f')},{'name':_0xb2ef('0x70'),'value':_0xb2ef('0x71')}]:[]};})};}})[_0xb2ef('0x26')](respondWithResult(_0x58d86a,null))[_0xb2ef('0x42')](function(_0x6993df){var _0x360258=_0x1c6cd8[_0xb2ef('0x31')][_0xb2ef('0x72')]?0x1f4:_0x6993df[_0xb2ef('0x73')]||0x1f4;logger[_0xb2ef('0x27')](_0xb2ef('0x74'),_0xb2ef('0x52'),_0x360258,JSON[_0xb2ef('0x75')](_0x6993df));delete _0x6993df[_0xb2ef('0x29')];if(_0x360258===0x191){_0x360258=0x190;}_0x58d86a[_0xb2ef('0x1d')](_0x360258)['send'](_0x1c6cd8[_0xb2ef('0x31')][_0xb2ef('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x6993df[_0xb2ef('0x73')]}:_0x6993df);});}; \ No newline at end of file +var _0x8667=['login','concat','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','int','boolean','email','textarea','phone','remove','label','custom','picklistValues','value','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','count','limit','status','Content-Range','reject','update','then','error','stack','name','index','SalesforceAccount','rawAttributes','type','key','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','include','find','create','body','destroy','findOne','SalesforceConfiguration','map','nolimit','getConfigurations','addConfiguration','channel','Descriptions','getDescriptions','SalesforceField','Subjects','Task','clientId','username','password','securityToken','remoteUri','slice','substring','lastIndexOf','Connection','clientSecret'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8667,0x9c));var _0x7866=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8667[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x7866('0x0'));var rimraf=require(_0x7866('0x1'));var zipdir=require(_0x7866('0x2'));var jsonpatch=require(_0x7866('0x3'));var rp=require(_0x7866('0x4'));var moment=require(_0x7866('0x5'));var BPromise=require(_0x7866('0x6'));var Mustache=require(_0x7866('0x7'));var util=require(_0x7866('0x8'));var path=require(_0x7866('0x9'));var sox=require(_0x7866('0xa'));var csv=require(_0x7866('0xb'));var ejs=require(_0x7866('0xc'));var fs=require('fs');var fs_extra=require(_0x7866('0xd'));var _=require('lodash');var squel=require(_0x7866('0xe'));var crypto=require(_0x7866('0xf'));var jsforce=require(_0x7866('0x10'));var deskjs=require(_0x7866('0x11'));var toCsv=require('to-csv');var querystring=require(_0x7866('0x12'));var Papa=require(_0x7866('0x13'));var Redis=require(_0x7866('0x14'));var authService=require(_0x7866('0x15'));var qs=require(_0x7866('0x16'));var as=require(_0x7866('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7866('0x18'))(_0x7866('0x19'));var utils=require(_0x7866('0x1a'));var config=require(_0x7866('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x7866('0x1c'))['db'];var integrations=require(_0x7866('0x1d'));function respondWithStatusCode(_0x31f2f9,_0x46d345){_0x46d345=_0x46d345||0xcc;return function(_0x3ce641){if(_0x3ce641){return _0x31f2f9[_0x7866('0x1e')](_0x46d345);}return _0x31f2f9['status'](_0x46d345)[_0x7866('0x1f')]();};}function respondWithResult(_0x56d633,_0x136e20){_0x136e20=_0x136e20||0xc8;return function(_0x321d3f){if(_0x321d3f){return _0x56d633['status'](_0x136e20)[_0x7866('0x20')](_0x321d3f);}};}function respondWithFilteredResult(_0x27fde6,_0x47cb3c){return function(_0x2f2397){if(_0x2f2397){var _0xda2fc2=typeof _0x47cb3c[_0x7866('0x21')]==='undefined'&&typeof _0x47cb3c['limit']==='undefined';var _0x3b9789=_0x2f2397[_0x7866('0x22')];var _0x57cd0b=_0xda2fc2?0x0:_0x47cb3c[_0x7866('0x21')];var _0x5a5f3d=_0xda2fc2?_0x2f2397['count']:_0x47cb3c[_0x7866('0x21')]+_0x47cb3c[_0x7866('0x23')];var _0x2d403c;if(_0x5a5f3d>=_0x3b9789){_0x5a5f3d=_0x3b9789;_0x2d403c=0xc8;}else{_0x2d403c=0xce;}_0x27fde6[_0x7866('0x24')](_0x2d403c);return _0x27fde6['set'](_0x7866('0x25'),_0x57cd0b+'-'+_0x5a5f3d+'/'+_0x3b9789)['json'](_0x2f2397);}return null;};}function patchUpdates(_0x266e55){return function(_0x11ac2b){try{jsonpatch['apply'](_0x11ac2b,_0x266e55,!![]);}catch(_0x56fc29){return BPromise[_0x7866('0x26')](_0x56fc29);}return _0x11ac2b['save']();};}function saveUpdates(_0xc0be6c,_0x21404b){return function(_0x860a7a){if(_0x860a7a){return _0x860a7a[_0x7866('0x27')](_0xc0be6c)[_0x7866('0x28')](function(_0x3d6a62){return _0x3d6a62;});}return null;};}function removeEntity(_0x135b77,_0x3a27bb){return function(_0x335ffb){if(_0x335ffb){return _0x335ffb['destroy']()[_0x7866('0x28')](function(){_0x135b77['status'](0xcc)[_0x7866('0x1f')]();});}};}function handleEntityNotFound(_0x59d443,_0x24ab3f){return function(_0x46db69){if(!_0x46db69){_0x59d443[_0x7866('0x1e')](0x194);}return _0x46db69;};}function handleError(_0x503735,_0x568653){_0x568653=_0x568653||0x1f4;return function(_0xd6b56e){logger[_0x7866('0x29')](_0xd6b56e[_0x7866('0x2a')]);if(_0xd6b56e[_0x7866('0x2b')]){delete _0xd6b56e[_0x7866('0x2b')];}_0x503735[_0x7866('0x24')](_0x568653)['send'](_0xd6b56e);};}exports[_0x7866('0x2c')]=function(_0x424598,_0x3c067c){var _0x29c43d={},_0x630f87={},_0x3c0513={'count':0x0,'rows':[]};var _0x302e35=_['map'](db[_0x7866('0x2d')][_0x7866('0x2e')],function(_0x25c196){return{'name':_0x25c196['fieldName'],'type':_0x25c196[_0x7866('0x2f')][_0x7866('0x30')]};});_0x630f87['model']=_['map'](_0x302e35,_0x7866('0x2b'));_0x630f87['query']=_['keys'](_0x424598['query']);_0x630f87[_0x7866('0x31')]=_[_0x7866('0x32')](_0x630f87[_0x7866('0x33')],_0x630f87[_0x7866('0x34')]);_0x29c43d[_0x7866('0x35')]=_[_0x7866('0x32')](_0x630f87[_0x7866('0x33')],qs['fields'](_0x424598['query'][_0x7866('0x36')]));_0x29c43d[_0x7866('0x35')]=_0x29c43d[_0x7866('0x35')][_0x7866('0x37')]?_0x29c43d[_0x7866('0x35')]:_0x630f87[_0x7866('0x33')];if(!_0x424598[_0x7866('0x34')][_0x7866('0x38')]('nolimit')){_0x29c43d[_0x7866('0x23')]=qs[_0x7866('0x23')](_0x424598[_0x7866('0x34')]['limit']);_0x29c43d[_0x7866('0x21')]=qs[_0x7866('0x21')](_0x424598[_0x7866('0x34')]['offset']);}_0x29c43d[_0x7866('0x39')]=qs['sort'](_0x424598[_0x7866('0x34')][_0x7866('0x3a')]);_0x29c43d['where']=qs[_0x7866('0x31')](_[_0x7866('0x3b')](_0x424598[_0x7866('0x34')],_0x630f87[_0x7866('0x31')]),_0x302e35);if(_0x424598['query'][_0x7866('0x3c')]){_0x29c43d[_0x7866('0x3d')]=_[_0x7866('0x3e')](_0x29c43d[_0x7866('0x3d')],{'$or':_['map'](_0x302e35,function(_0x14e8e3){if(_0x14e8e3[_0x7866('0x2f')]!==_0x7866('0x3f')){var _0x590f10={};_0x590f10[_0x14e8e3['name']]={'$like':'%'+_0x424598[_0x7866('0x34')][_0x7866('0x3c')]+'%'};return _0x590f10;}})});}_0x29c43d=_[_0x7866('0x3e')]({},_0x29c43d,_0x424598[_0x7866('0x40')]);var _0x516fca={'where':_0x29c43d['where']};return db[_0x7866('0x2d')][_0x7866('0x22')](_0x516fca)[_0x7866('0x28')](function(_0x13dfb4){_0x3c0513[_0x7866('0x22')]=_0x13dfb4;if(_0x424598['query'][_0x7866('0x41')]){_0x29c43d['include']=[{'all':!![]}];}return db[_0x7866('0x2d')][_0x7866('0x42')](_0x29c43d);})[_0x7866('0x28')](function(_0x732b77){_0x3c0513[_0x7866('0x43')]=_0x732b77;return _0x3c0513;})[_0x7866('0x28')](respondWithFilteredResult(_0x3c067c,_0x29c43d))[_0x7866('0x44')](handleError(_0x3c067c,null));};exports['show']=function(_0x1fb023,_0x8ef241){var _0x186306={'raw':![],'where':{'id':_0x1fb023[_0x7866('0x45')]['id']}},_0x3ee61b={};_0x3ee61b[_0x7866('0x33')]=_[_0x7866('0x46')](db[_0x7866('0x2d')][_0x7866('0x2e')]);_0x3ee61b[_0x7866('0x34')]=_[_0x7866('0x46')](_0x1fb023[_0x7866('0x34')]);_0x3ee61b[_0x7866('0x31')]=_[_0x7866('0x32')](_0x3ee61b[_0x7866('0x33')],_0x3ee61b[_0x7866('0x34')]);_0x186306[_0x7866('0x35')]=_['intersection'](_0x3ee61b[_0x7866('0x33')],qs[_0x7866('0x36')](_0x1fb023[_0x7866('0x34')][_0x7866('0x36')]));_0x186306[_0x7866('0x35')]=_0x186306['attributes'][_0x7866('0x37')]?_0x186306['attributes']:_0x3ee61b[_0x7866('0x33')];if(_0x1fb023[_0x7866('0x34')][_0x7866('0x41')]){_0x186306[_0x7866('0x47')]=[{'all':!![]}];}_0x186306=_[_0x7866('0x3e')]({},_0x186306,_0x1fb023['options']);return db[_0x7866('0x2d')][_0x7866('0x48')](_0x186306)[_0x7866('0x28')](handleEntityNotFound(_0x8ef241,null))[_0x7866('0x28')](respondWithResult(_0x8ef241,null))['catch'](handleError(_0x8ef241,null));};exports[_0x7866('0x49')]=function(_0x534430,_0x12ca24){return db['SalesforceAccount'][_0x7866('0x49')](_0x534430[_0x7866('0x4a')],{})[_0x7866('0x28')](respondWithResult(_0x12ca24,0xc9))[_0x7866('0x44')](handleError(_0x12ca24,null));};exports['update']=function(_0x476506,_0x265169){if(_0x476506[_0x7866('0x4a')]['id']){delete _0x476506[_0x7866('0x4a')]['id'];}return db[_0x7866('0x2d')]['find']({'where':{'id':_0x476506[_0x7866('0x45')]['id']}})[_0x7866('0x28')](handleEntityNotFound(_0x265169,null))[_0x7866('0x28')](saveUpdates(_0x476506[_0x7866('0x4a')],null))[_0x7866('0x28')](respondWithResult(_0x265169,null))[_0x7866('0x44')](handleError(_0x265169,null));};exports[_0x7866('0x4b')]=function(_0xfdb5,_0x3407dc){return db[_0x7866('0x2d')][_0x7866('0x48')]({'where':{'id':_0xfdb5[_0x7866('0x45')]['id']}})[_0x7866('0x28')](handleEntityNotFound(_0x3407dc,null))[_0x7866('0x28')](removeEntity(_0x3407dc,null))[_0x7866('0x44')](handleError(_0x3407dc,null));};exports['getConfigurations']=function(_0x59d892,_0x1c9779,_0x55dff3){var _0x5c4572={};var _0x2203cf={};var _0x49c82c;var _0x19de57;return db[_0x7866('0x2d')][_0x7866('0x4c')]({'where':{'id':_0x59d892[_0x7866('0x45')]['id']}})[_0x7866('0x28')](handleEntityNotFound(_0x1c9779,null))[_0x7866('0x28')](function(_0x1649fc){if(_0x1649fc){_0x49c82c=_0x1649fc;_0x2203cf[_0x7866('0x33')]=_['keys'](db[_0x7866('0x4d')][_0x7866('0x2e')]);_0x2203cf[_0x7866('0x34')]=_['keys'](_0x59d892[_0x7866('0x34')]);_0x2203cf['filters']=_[_0x7866('0x32')](_0x2203cf[_0x7866('0x33')],_0x2203cf[_0x7866('0x34')]);_0x5c4572[_0x7866('0x35')]=_[_0x7866('0x32')](_0x2203cf[_0x7866('0x33')],qs[_0x7866('0x36')](_0x59d892[_0x7866('0x34')][_0x7866('0x36')]));_0x5c4572[_0x7866('0x35')]=_0x5c4572[_0x7866('0x35')][_0x7866('0x37')]?_0x5c4572[_0x7866('0x35')]:_0x2203cf['model'];_0x5c4572['order']=qs['sort'](_0x59d892[_0x7866('0x34')][_0x7866('0x3a')]);_0x5c4572[_0x7866('0x3d')]=qs[_0x7866('0x31')](_[_0x7866('0x3b')](_0x59d892[_0x7866('0x34')],_0x2203cf[_0x7866('0x31')]));if(_0x59d892[_0x7866('0x34')]['filter']){_0x5c4572[_0x7866('0x3d')]=_[_0x7866('0x3e')](_0x5c4572[_0x7866('0x3d')],{'$or':_[_0x7866('0x4e')](_0x5c4572[_0x7866('0x35')],function(_0x12efbb){var _0x2bac83={};_0x2bac83[_0x12efbb]={'$like':'%'+_0x59d892[_0x7866('0x34')]['filter']+'%'};return _0x2bac83;})});}_0x5c4572=_[_0x7866('0x3e')]({},_0x5c4572,_0x59d892[_0x7866('0x40')]);return _0x49c82c['getConfigurations'](_0x5c4572);}})[_0x7866('0x28')](function(_0xcce455){if(_0xcce455){_0x19de57=_0xcce455[_0x7866('0x37')];if(!_0x59d892[_0x7866('0x34')][_0x7866('0x38')](_0x7866('0x4f'))){_0x5c4572[_0x7866('0x23')]=qs['limit'](_0x59d892[_0x7866('0x34')][_0x7866('0x23')]);_0x5c4572[_0x7866('0x21')]=qs[_0x7866('0x21')](_0x59d892['query'][_0x7866('0x21')]);}return _0x49c82c[_0x7866('0x50')](_0x5c4572);}})[_0x7866('0x28')](function(_0x92df6a){if(_0x92df6a){return _0x92df6a?{'count':_0x19de57,'rows':_0x92df6a}:null;}})['then'](respondWithResult(_0x1c9779,null))[_0x7866('0x44')](handleError(_0x1c9779,null));};exports[_0x7866('0x51')]=function(_0x46a345,_0xa6d4b6,_0x2f568f){if(_0x46a345[_0x7866('0x4a')]['id']){delete _0x46a345['body']['id'];}return db[_0x7866('0x2d')][_0x7866('0x4c')]({'where':{'id':_0x46a345[_0x7866('0x45')]['id']}})[_0x7866('0x28')](handleEntityNotFound(_0xa6d4b6,null))['then'](function(_0xbb6398){if(_0xbb6398){_0x46a345['body']['AccountId']=_0xbb6398['id'];_0x46a345['body']['Subjects']=integrations['getSubjects'](_0x46a345['body'][_0x7866('0x52')],_0x46a345[_0x7866('0x4a')][_0x7866('0x2f')]);_0x46a345[_0x7866('0x4a')][_0x7866('0x53')]=integrations[_0x7866('0x54')](_0x46a345[_0x7866('0x4a')][_0x7866('0x52')],_0x46a345[_0x7866('0x4a')]['type']);return db['SalesforceConfiguration'][_0x7866('0x49')](_0x46a345[_0x7866('0x4a')],{'include':[{'model':db[_0x7866('0x55')],'as':_0x7866('0x56')},{'model':db['SalesforceField'],'as':_0x7866('0x53')}]});}return null;})[_0x7866('0x28')](respondWithResult(_0xa6d4b6,null))[_0x7866('0x44')](handleError(_0xa6d4b6,null));};exports['getFields']=function(_0x329eca,_0x5e99d3,_0xfbf6d2){var _0x423346;var _0x40a57e='';var _0x4d6c2a=_0x7866('0x57');return db[_0x7866('0x2d')][_0x7866('0x4c')]({'where':{'id':_0x329eca[_0x7866('0x45')]['id']},'attributes':['id','remoteUri',_0x7866('0x58'),'clientSecret',_0x7866('0x59'),_0x7866('0x5a'),_0x7866('0x5b')]})[_0x7866('0x28')](handleEntityNotFound(_0x5e99d3,null))[_0x7866('0x28')](function(_0x5d7b33){if(_0x5d7b33){_0x40a57e=_0x5d7b33[_0x7866('0x5c')];var _0x3cf99e=_0x40a57e[_0x7866('0x5d')](-0x1);if(_0x3cf99e==='/'){_0x40a57e=_0x40a57e[_0x7866('0x5e')](0x0,_0x40a57e[_0x7866('0x5f')](_0x3cf99e));}_0x423346=new jsforce[(_0x7866('0x60'))]({'oauth2':{'loginUrl':_0x40a57e,'clientId':_0x5d7b33['clientId'],'clientSecret':_0x5d7b33[_0x7866('0x61')]}});return _0x423346[_0x7866('0x62')](_0x5d7b33[_0x7866('0x59')],_0x5d7b33[_0x7866('0x5a')][_0x7866('0x63')](_0x5d7b33[_0x7866('0x5b')]));}})[_0x7866('0x28')](function(_0x2fe9aa){if(_0x2fe9aa){if(!_['isNil'](_0x329eca[_0x7866('0x34')]['ticketType'])){_0x4d6c2a=_0x329eca['query'][_0x7866('0x64')];}return _0x423346[_0x7866('0x65')](_0x4d6c2a)[_0x7866('0x66')]();}})['then'](function(_0x2fc073){var _0x8728ee=[_0x7866('0x67'),_0x7866('0x68'),'IsReminderSet',_0x7866('0x69'),_0x7866('0x6a'),_0x7866('0x6b')];var _0x1f3a15=['string',_0x7866('0x6c'),'picklist',_0x7866('0x6d'),_0x7866('0x6e'),_0x7866('0x6f'),_0x7866('0x70')];if(_0x2fc073){_[_0x7866('0x71')](_0x2fc073[_0x7866('0x36')],function(_0x22e6a1){return _0x8728ee['includes'](_0x22e6a1['name'])||!_0x1f3a15['includes'](_0x22e6a1[_0x7866('0x2f')]);});return{'count':_0x2fc073[_0x7866('0x36')][_0x7866('0x37')],'rows':_[_0x7866('0x4e')](_0x2fc073[_0x7866('0x36')],function(_0x50ae64){return{'id':_0x50ae64[_0x7866('0x2b')],'name':_0x50ae64[_0x7866('0x72')],'custom':_0x50ae64[_0x7866('0x73')],'options':_0x50ae64[_0x7866('0x74')][_0x7866('0x37')]>0x0?_[_0x7866('0x4e')](_0x50ae64[_0x7866('0x74')],function(_0x108dd2){return{'name':_0x108dd2[_0x7866('0x72')],'value':_0x108dd2[_0x7866('0x75')]};}):_0x50ae64[_0x7866('0x2f')]==_0x7866('0x6d')?[{'name':_0x7866('0x76'),'value':_0x7866('0x77')},{'name':'False','value':_0x7866('0x78')}]:[]};})};}})[_0x7866('0x28')](respondWithResult(_0x5e99d3,null))[_0x7866('0x44')](function(_0x32fbee){var _0x5cbaca=_0x329eca[_0x7866('0x34')][_0x7866('0x79')]?0x1f4:_0x32fbee[_0x7866('0x7a')]||0x1f4;logger[_0x7866('0x29')](_0x7866('0x7b'),_0x7866('0x7c'),_0x5cbaca,JSON[_0x7866('0x7d')](_0x32fbee));delete _0x32fbee[_0x7866('0x2b')];if(_0x5cbaca===0x191){_0x5cbaca=0x190;}_0x5e99d3[_0x7866('0x24')](_0x5cbaca)[_0x7866('0x7e')](_0x329eca[_0x7866('0x34')][_0x7866('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x32fbee[_0x7866('0x7a')]}:_0x32fbee);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 7939a15..0d97dd2 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 _0x8bfc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts','util','../../config/logger'];(function(_0x4e6845,_0x4fb0d9){var _0x1ce690=function(_0x110d04){while(--_0x110d04){_0x4e6845['push'](_0x4e6845['shift']());}};_0x1ce690(++_0x4fb0d9);}(_0x8bfc,0x9a));var _0xc8bf=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x8bfc[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require('lodash');var util=require(_0xc8bf('0x0'));var logger=require(_0xc8bf('0x1'))('api');var moment=require(_0xc8bf('0x2'));var BPromise=require(_0xc8bf('0x3'));var rp=require(_0xc8bf('0x4'));var fs=require('fs');var path=require(_0xc8bf('0x5'));var rimraf=require(_0xc8bf('0x6'));var config=require(_0xc8bf('0x7'));var attributes=require(_0xc8bf('0x8'));var integrations=require(_0xc8bf('0x9'));module[_0xc8bf('0xa')]=function(_0x4066a6,_0x5a3abb){return _0x4066a6[_0xc8bf('0xb')]('SalesforceAccount',attributes,{'tableName':_0xc8bf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x422f=['api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','util'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x422f,0x1c7));var _0xf422=function(_0x3cdd7a,_0x266f22){_0x3cdd7a=_0x3cdd7a-0x0;var _0xca7994=_0x422f[_0x3cdd7a];return _0xca7994;};'use strict';var _=require('lodash');var util=require(_0xf422('0x0'));var logger=require('../../config/logger')(_0xf422('0x1'));var moment=require(_0xf422('0x2'));var BPromise=require('bluebird');var rp=require(_0xf422('0x3'));var fs=require('fs');var path=require(_0xf422('0x4'));var rimraf=require(_0xf422('0x5'));var config=require(_0xf422('0x6'));var attributes=require(_0xf422('0x7'));var integrations=require(_0xf422('0x8'));module[_0xf422('0x9')]=function(_0x13ed91,_0x350b2d){return _0x13ed91['define'](_0xf422('0xa'),attributes,{'tableName':_0xf422('0xb'),'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 0f2fd64..08da91d 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 _0x452c=['limit','include','map','model','attributes','ShowSalesforceAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where'];(function(_0x53cc0a,_0x30848e){var _0x58044c=function(_0x5ac32a){while(--_0x5ac32a){_0x53cc0a['push'](_0x53cc0a['shift']());}};_0x58044c(++_0x30848e);}(_0x452c,0x9b));var _0xc452=function(_0x586f1f,_0x13d57a){_0x586f1f=_0x586f1f-0x0;var _0xbfece6=_0x452c[_0x586f1f];return _0xbfece6;};'use strict';var _=require('lodash');var util=require(_0xc452('0x0'));var moment=require(_0xc452('0x1'));var BPromise=require(_0xc452('0x2'));var rs=require(_0xc452('0x3'));var fs=require('fs');var Redis=require(_0xc452('0x4'));var db=require(_0xc452('0x5'))['db'];var utils=require(_0xc452('0x6'));var logger=require(_0xc452('0x7'))(_0xc452('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc452('0x9')][_0xc452('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ad385,_0x5bff0f,_0xb2c6e1){return new BPromise(function(_0x1d9ebc,_0x5ae6c5){return client[_0xc452('0xb')](_0x4ad385,_0xb2c6e1)[_0xc452('0xc')](function(_0x4870ee){logger[_0xc452('0xd')](_0xc452('0xe'),_0x5bff0f,_0xc452('0xf'));logger[_0xc452('0x10')](_0xc452('0x11'),_0x5bff0f,_0xc452('0xf'),JSON[_0xc452('0x12')](_0x4870ee));if(_0x4870ee[_0xc452('0x13')]){if(_0x4870ee['error'][_0xc452('0x14')]===0x1f4){logger['error'](_0xc452('0xe'),_0x5bff0f,_0x4870ee['error'][_0xc452('0x15')]);return _0x5ae6c5(_0x4870ee[_0xc452('0x13')][_0xc452('0x15')]);}logger[_0xc452('0x13')](_0xc452('0xe'),_0x5bff0f,_0x4870ee[_0xc452('0x13')][_0xc452('0x15')]);return _0x1d9ebc(_0x4870ee[_0xc452('0x13')]['message']);}else{logger['info'](_0xc452('0xe'),_0x5bff0f,_0xc452('0xf'));_0x1d9ebc(_0x4870ee[_0xc452('0x16')][_0xc452('0x15')]);}})[_0xc452('0x17')](function(_0x3aa243){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x5bff0f,_0x3aa243);_0x5ae6c5(_0x3aa243);});});}exports[_0xc452('0x18')]=function(_0x3fa350){var _0xf3f6b9=this;return new Promise(function(_0x30c6c3,_0xeab522){return db[_0xc452('0x19')][_0xc452('0x1a')]({'raw':_0x3fa350[_0xc452('0x1b')]?_0x3fa350['options'][_0xc452('0x1c')]===undefined?!![]:![]:!![],'where':_0x3fa350[_0xc452('0x1b')]?_0x3fa350[_0xc452('0x1b')][_0xc452('0x1d')]||null:null,'attributes':_0x3fa350['options']?_0x3fa350[_0xc452('0x1b')]['attributes']||null:null,'limit':_0x3fa350[_0xc452('0x1b')]?_0x3fa350[_0xc452('0x1b')][_0xc452('0x1e')]||null:null,'include':_0x3fa350[_0xc452('0x1b')]?_0x3fa350[_0xc452('0x1b')][_0xc452('0x1f')]?_[_0xc452('0x20')](_0x3fa350[_0xc452('0x1b')][_0xc452('0x1f')],function(_0x1ef7c5){return{'model':db[_0x1ef7c5[_0xc452('0x21')]],'as':_0x1ef7c5['as'],'attributes':_0x1ef7c5[_0xc452('0x22')],'include':_0x1ef7c5[_0xc452('0x1f')]?_[_0xc452('0x20')](_0x1ef7c5['include'],function(_0x397115){return{'model':db[_0x397115['model']],'as':_0x397115['as'],'attributes':_0x397115['attributes'],'include':_0x397115[_0xc452('0x1f')]?_[_0xc452('0x20')](_0x397115[_0xc452('0x1f')],function(_0x107695){return{'model':db[_0x107695[_0xc452('0x21')]],'as':_0x107695['as'],'attributes':_0x107695[_0xc452('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ee2c3){logger[_0xc452('0xd')](_0xc452('0x18'),_0x3fa350);logger['debug'](_0xc452('0x18'),_0x3fa350,JSON[_0xc452('0x12')](_0x2ee2c3));_0x30c6c3(_0x2ee2c3);})[_0xc452('0x17')](function(_0x44a225){logger[_0xc452('0x13')](_0xc452('0x18'),_0x44a225[_0xc452('0x15')],_0x3fa350);_0xeab522(_0xf3f6b9[_0xc452('0x13')](0x1f4,_0x44a225[_0xc452('0x15')]));});});};exports[_0xc452('0x23')]=function(_0x2aeb85){var _0x417684=this;return new Promise(function(_0x2d2f67,_0x5c900c){return db['SalesforceAccount'][_0xc452('0x24')]({'raw':_0x2aeb85[_0xc452('0x1b')]?_0x2aeb85[_0xc452('0x1b')][_0xc452('0x1c')]===undefined?!![]:![]:!![],'where':_0x2aeb85[_0xc452('0x1b')]?_0x2aeb85[_0xc452('0x1b')][_0xc452('0x1d')]||null:null,'attributes':_0x2aeb85['options']?_0x2aeb85[_0xc452('0x1b')][_0xc452('0x22')]||null:null,'include':_0x2aeb85[_0xc452('0x1b')]?_0x2aeb85['options'][_0xc452('0x1f')]?_[_0xc452('0x20')](_0x2aeb85[_0xc452('0x1b')]['include'],function(_0x8fffa4){return{'model':db[_0x8fffa4[_0xc452('0x21')]],'as':_0x8fffa4['as'],'attributes':_0x8fffa4[_0xc452('0x22')],'include':_0x8fffa4[_0xc452('0x1f')]?_['map'](_0x8fffa4['include'],function(_0xe0258){return{'model':db[_0xe0258[_0xc452('0x21')]],'as':_0xe0258['as'],'attributes':_0xe0258[_0xc452('0x22')],'include':_0xe0258['include']?_[_0xc452('0x20')](_0xe0258[_0xc452('0x1f')],function(_0x1adaca){return{'model':db[_0x1adaca[_0xc452('0x21')]],'as':_0x1adaca['as'],'attributes':_0x1adaca['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x550130){logger[_0xc452('0xd')](_0xc452('0x23'),_0x2aeb85);logger[_0xc452('0x10')](_0xc452('0x23'),_0x2aeb85,JSON[_0xc452('0x12')](_0x550130));_0x2d2f67(_0x550130);})[_0xc452('0x17')](function(_0x171e02){logger[_0xc452('0x13')]('ShowSalesforceAccount',_0x171e02[_0xc452('0x15')],_0x2aeb85);_0x5c900c(_0x417684[_0xc452('0x13')](0x1f4,_0x171e02[_0xc452('0x15')]));});});}; \ No newline at end of file +var _0xcac5=['error','code','SalesforceAccount,\x20%s,\x20%s','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','include','model','attributes','map','debug','ShowSalesforceAccount','find','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2f7db8,_0x319992){var _0x346884=function(_0x2efe96){while(--_0x2efe96){_0x2f7db8['push'](_0x2f7db8['shift']());}};_0x346884(++_0x319992);}(_0xcac5,0xb8));var _0x5cac=function(_0x1a1e39,_0x34f250){_0x1a1e39=_0x1a1e39-0x0;var _0x10bf4c=_0xcac5[_0x1a1e39];return _0x10bf4c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5cac('0x0'));var BPromise=require(_0x5cac('0x1'));var rs=require(_0x5cac('0x2'));var fs=require('fs');var Redis=require(_0x5cac('0x3'));var db=require(_0x5cac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5cac('0x5'))(_0x5cac('0x6'));var config=require(_0x5cac('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5cac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa9b8fd,_0x527440,_0x28da66){return new BPromise(function(_0x59860c,_0x549c43){return client['request'](_0xa9b8fd,_0x28da66)[_0x5cac('0x9')](function(_0x2f4330){logger[_0x5cac('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x527440,_0x5cac('0xb'));logger['debug'](_0x5cac('0xc'),_0x527440,_0x5cac('0xb'),JSON[_0x5cac('0xd')](_0x2f4330));if(_0x2f4330[_0x5cac('0xe')]){if(_0x2f4330['error'][_0x5cac('0xf')]===0x1f4){logger[_0x5cac('0xe')](_0x5cac('0x10'),_0x527440,_0x2f4330[_0x5cac('0xe')][_0x5cac('0x11')]);return _0x549c43(_0x2f4330['error'][_0x5cac('0x11')]);}logger['error'](_0x5cac('0x10'),_0x527440,_0x2f4330[_0x5cac('0xe')]['message']);return _0x59860c(_0x2f4330[_0x5cac('0xe')]['message']);}else{logger['info'](_0x5cac('0x10'),_0x527440,_0x5cac('0xb'));_0x59860c(_0x2f4330['result'][_0x5cac('0x11')]);}})[_0x5cac('0x12')](function(_0xcdd4b4){logger[_0x5cac('0xe')](_0x5cac('0x10'),_0x527440,_0xcdd4b4);_0x549c43(_0xcdd4b4);});});}exports[_0x5cac('0x13')]=function(_0x356e37){var _0x393efd=this;return new Promise(function(_0x2db33f,_0x4ec457){return db[_0x5cac('0x14')][_0x5cac('0x15')]({'raw':_0x356e37['options']?_0x356e37[_0x5cac('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x356e37[_0x5cac('0x16')]?_0x356e37[_0x5cac('0x16')][_0x5cac('0x17')]||null:null,'attributes':_0x356e37['options']?_0x356e37[_0x5cac('0x16')]['attributes']||null:null,'limit':_0x356e37[_0x5cac('0x16')]?_0x356e37[_0x5cac('0x16')][_0x5cac('0x18')]||null:null,'include':_0x356e37[_0x5cac('0x16')]?_0x356e37[_0x5cac('0x16')][_0x5cac('0x19')]?_['map'](_0x356e37['options'][_0x5cac('0x19')],function(_0x47e58c){return{'model':db[_0x47e58c[_0x5cac('0x1a')]],'as':_0x47e58c['as'],'attributes':_0x47e58c[_0x5cac('0x1b')],'include':_0x47e58c[_0x5cac('0x19')]?_[_0x5cac('0x1c')](_0x47e58c[_0x5cac('0x19')],function(_0x230000){return{'model':db[_0x230000['model']],'as':_0x230000['as'],'attributes':_0x230000[_0x5cac('0x1b')],'include':_0x230000['include']?_[_0x5cac('0x1c')](_0x230000[_0x5cac('0x19')],function(_0x23207d){return{'model':db[_0x23207d[_0x5cac('0x1a')]],'as':_0x23207d['as'],'attributes':_0x23207d[_0x5cac('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5cac('0x9')](function(_0x5bfba4){logger[_0x5cac('0xa')](_0x5cac('0x13'),_0x356e37);logger[_0x5cac('0x1d')]('GetSalesforceAccount',_0x356e37,JSON[_0x5cac('0xd')](_0x5bfba4));_0x2db33f(_0x5bfba4);})[_0x5cac('0x12')](function(_0xc4924c){logger[_0x5cac('0xe')]('GetSalesforceAccount',_0xc4924c[_0x5cac('0x11')],_0x356e37);_0x4ec457(_0x393efd[_0x5cac('0xe')](0x1f4,_0xc4924c[_0x5cac('0x11')]));});});};exports[_0x5cac('0x1e')]=function(_0x572d91){var _0x316615=this;return new Promise(function(_0x2d1bb6,_0x1508a0){return db[_0x5cac('0x14')][_0x5cac('0x1f')]({'raw':_0x572d91[_0x5cac('0x16')]?_0x572d91[_0x5cac('0x16')][_0x5cac('0x20')]===undefined?!![]:![]:!![],'where':_0x572d91[_0x5cac('0x16')]?_0x572d91[_0x5cac('0x16')][_0x5cac('0x17')]||null:null,'attributes':_0x572d91[_0x5cac('0x16')]?_0x572d91[_0x5cac('0x16')][_0x5cac('0x1b')]||null:null,'include':_0x572d91[_0x5cac('0x16')]?_0x572d91[_0x5cac('0x16')]['include']?_['map'](_0x572d91[_0x5cac('0x16')][_0x5cac('0x19')],function(_0x443137){return{'model':db[_0x443137[_0x5cac('0x1a')]],'as':_0x443137['as'],'attributes':_0x443137[_0x5cac('0x1b')],'include':_0x443137[_0x5cac('0x19')]?_[_0x5cac('0x1c')](_0x443137['include'],function(_0x542c36){return{'model':db[_0x542c36[_0x5cac('0x1a')]],'as':_0x542c36['as'],'attributes':_0x542c36[_0x5cac('0x1b')],'include':_0x542c36[_0x5cac('0x19')]?_['map'](_0x542c36['include'],function(_0x3a440d){return{'model':db[_0x3a440d[_0x5cac('0x1a')]],'as':_0x3a440d['as'],'attributes':_0x3a440d[_0x5cac('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5cac('0x9')](function(_0x48bd39){logger['info'](_0x5cac('0x1e'),_0x572d91);logger['debug'](_0x5cac('0x1e'),_0x572d91,JSON[_0x5cac('0xd')](_0x48bd39));_0x2d1bb6(_0x48bd39);})[_0x5cac('0x12')](function(_0x2eaf4b){logger['error'](_0x5cac('0x1e'),_0x2eaf4b[_0x5cac('0x11')],_0x572d91);_0x1508a0(_0x316615['error'](0x1f4,_0x2eaf4b[_0x5cac('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 4ac9513..7d7ebe5 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x3ec045,_0x443f6e){var _0x58f1bf=function(_0x598f09){while(--_0x598f09){_0x3ec045['push'](_0x3ec045['shift']());}};_0x58f1bf(++_0x443f6e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5f66[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x5bcb4e,_0x43c0e0){var _0x22259f=function(_0x5d9b8e){while(--_0x5d9b8e){_0x5bcb4e['push'](_0x5bcb4e['shift']());}};_0x22259f(++_0x43c0e0);}(_0xadb5,0xad));var _0x5adb=function(_0x4a4f29,_0x954505){_0x4a4f29=_0x4a4f29-0x0;var _0x40bb8c=_0xadb5[_0x4a4f29];return _0x40bb8c;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 3db7f78..accbfbf 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 _0x7890=['sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact','nothing','lead','account'];(function(_0x5dedb6,_0x1543dd){var _0x3ec0c6=function(_0x2d4ad2){while(--_0x2d4ad2){_0x5dedb6['push'](_0x5dedb6['shift']());}};_0x3ec0c6(++_0x1543dd);}(_0x7890,0x1c3));var _0x0789=function(_0x8fb1bc,_0x51028a){_0x8fb1bc=_0x8fb1bc-0x0;var _0x27490c=_0x7890[_0x8fb1bc];return _0x27490c;};'use strict';var Sequelize=require(_0x0789('0x0'));module[_0x0789('0x1')]={'name':{'type':Sequelize[_0x0789('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x0789('0x3')](_0x0789('0x4'),_0x0789('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x0789('0x6'),_0x0789('0x7'),'lead','account_contact_lead','account'),'defaultValue':_0x0789('0x6')},'moduleCreate':{'type':Sequelize[_0x0789('0x3')](_0x0789('0x8'),_0x0789('0x7'),_0x0789('0x9'),_0x0789('0xa')),'defaultValue':_0x0789('0x9')},'leadId':{'type':Sequelize[_0x0789('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x0789('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xeb43=['exports','STRING','ENUM','Task','lead','account_contact_lead','contact_lead','nothing','account','sequelize'];(function(_0x9170b0,_0x5803b4){var _0x4fc1c9=function(_0xcf15b1){while(--_0xcf15b1){_0x9170b0['push'](_0x9170b0['shift']());}};_0x4fc1c9(++_0x5803b4);}(_0xeb43,0x149));var _0x3eb4=function(_0x27031e,_0x1eb8cd){_0x27031e=_0x27031e-0x0;var _0xfd46b3=_0xeb43[_0x27031e];return _0xfd46b3;};'use strict';var Sequelize=require(_0x3eb4('0x0'));module[_0x3eb4('0x1')]={'name':{'type':Sequelize[_0x3eb4('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x3eb4('0x3')]('Task','Case'),'defaultValue':_0x3eb4('0x4')},'moduleSearch':{'type':Sequelize[_0x3eb4('0x3')]('contact_lead','contact',_0x3eb4('0x5'),_0x3eb4('0x6'),'account'),'defaultValue':_0x3eb4('0x7')},'moduleCreate':{'type':Sequelize['ENUM'](_0x3eb4('0x8'),'contact',_0x3eb4('0x5'),_0x3eb4('0x9')),'defaultValue':_0x3eb4('0x5')},'leadId':{'type':Sequelize[_0x3eb4('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x3eb4('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x3eb4('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index f8281a5..cedb22a 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 _0xa232=['SalesforceConfiguration','includeAll','include','then','rows','catch','show','params','keys','create','body','find','getFields','findOne','getSubjects','SalesforceField','getDescriptions','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options'];(function(_0x3b3414,_0xb8c1d3){var _0x47d3f6=function(_0x381088){while(--_0x381088){_0x3b3414['push'](_0x3b3414['shift']());}};_0x47d3f6(++_0xb8c1d3);}(_0xa232,0x141));var _0x2a23=function(_0x356485,_0x20d89b){_0x356485=_0x356485-0x0;var _0x480c5a=_0xa232[_0x356485];return _0x480c5a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2a23('0x0'));var rp=require(_0x2a23('0x1'));var moment=require(_0x2a23('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2a23('0x3'));var util=require(_0x2a23('0x4'));var path=require('path');var sox=require(_0x2a23('0x5'));var csv=require(_0x2a23('0x6'));var ejs=require(_0x2a23('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2a23('0x8'));var crypto=require(_0x2a23('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2a23('0xa'));var Papa=require(_0x2a23('0xb'));var Redis=require(_0x2a23('0xc'));var authService=require(_0x2a23('0xd'));var qs=require(_0x2a23('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a23('0xf'));var logger=require(_0x2a23('0x10'))('api');var utils=require(_0x2a23('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x2a23('0x12'));var db=require(_0x2a23('0x13'))['db'];function respondWithStatusCode(_0x137750,_0x2efaff){_0x2efaff=_0x2efaff||0xcc;return function(_0x968630){if(_0x968630){return _0x137750['sendStatus'](_0x2efaff);}return _0x137750[_0x2a23('0x14')](_0x2efaff)['end']();};}function respondWithResult(_0x5a8030,_0x14aec1){_0x14aec1=_0x14aec1||0xc8;return function(_0x2d440e){if(_0x2d440e){return _0x5a8030['status'](_0x14aec1)['json'](_0x2d440e);}};}function respondWithFilteredResult(_0xf695db,_0x10d33b){return function(_0x2f6d6b){if(_0x2f6d6b){var _0x57815b=typeof _0x10d33b[_0x2a23('0x15')]===_0x2a23('0x16')&&typeof _0x10d33b[_0x2a23('0x17')]===_0x2a23('0x16');var _0x328dd1=_0x2f6d6b['count'];var _0x3fd212=_0x57815b?0x0:_0x10d33b[_0x2a23('0x15')];var _0x4594e9=_0x57815b?_0x2f6d6b[_0x2a23('0x18')]:_0x10d33b[_0x2a23('0x15')]+_0x10d33b[_0x2a23('0x17')];var _0x5b6ba4;if(_0x4594e9>=_0x328dd1){_0x4594e9=_0x328dd1;_0x5b6ba4=0xc8;}else{_0x5b6ba4=0xce;}_0xf695db[_0x2a23('0x14')](_0x5b6ba4);return _0xf695db[_0x2a23('0x19')](_0x2a23('0x1a'),_0x3fd212+'-'+_0x4594e9+'/'+_0x328dd1)['json'](_0x2f6d6b);}return null;};}function patchUpdates(_0x2cd4f3){return function(_0x54d5e2){try{jsonpatch[_0x2a23('0x1b')](_0x54d5e2,_0x2cd4f3,!![]);}catch(_0x172e9c){return BPromise['reject'](_0x172e9c);}return _0x54d5e2[_0x2a23('0x1c')]();};}function saveUpdates(_0x16cf08,_0x2d2166){return function(_0x2cbcb8){if(_0x2cbcb8){return _0x2cbcb8[_0x2a23('0x1d')](_0x16cf08)['then'](function(_0x445aab){return _0x445aab;});}return null;};}function removeEntity(_0x15a555,_0x429281){return function(_0x4cef42){if(_0x4cef42){return _0x4cef42[_0x2a23('0x1e')]()['then'](function(){_0x15a555[_0x2a23('0x14')](0xcc)[_0x2a23('0x1f')]();});}};}function handleEntityNotFound(_0x136f77,_0x259550){return function(_0x49e95b){if(!_0x49e95b){_0x136f77['sendStatus'](0x194);}return _0x49e95b;};}function handleError(_0x28fc45,_0x2226b8){_0x2226b8=_0x2226b8||0x1f4;return function(_0x49394c){logger[_0x2a23('0x20')](_0x49394c[_0x2a23('0x21')]);if(_0x49394c[_0x2a23('0x22')]){delete _0x49394c[_0x2a23('0x22')];}_0x28fc45['status'](_0x2226b8)[_0x2a23('0x23')](_0x49394c);};}exports[_0x2a23('0x24')]=function(_0x2cbfbe,_0x3700e2){var _0x54ad77={},_0x1831c2={},_0x19d28a={'count':0x0,'rows':[]};var _0x2f4a86=_['map'](db['SalesforceConfiguration'][_0x2a23('0x25')],function(_0x525f88){return{'name':_0x525f88[_0x2a23('0x26')],'type':_0x525f88['type'][_0x2a23('0x27')]};});_0x1831c2[_0x2a23('0x28')]=_[_0x2a23('0x29')](_0x2f4a86,_0x2a23('0x22'));_0x1831c2['query']=_['keys'](_0x2cbfbe['query']);_0x1831c2[_0x2a23('0x2a')]=_[_0x2a23('0x2b')](_0x1831c2[_0x2a23('0x28')],_0x1831c2[_0x2a23('0x2c')]);_0x54ad77[_0x2a23('0x2d')]=_[_0x2a23('0x2b')](_0x1831c2[_0x2a23('0x28')],qs[_0x2a23('0x2e')](_0x2cbfbe[_0x2a23('0x2c')][_0x2a23('0x2e')]));_0x54ad77[_0x2a23('0x2d')]=_0x54ad77[_0x2a23('0x2d')][_0x2a23('0x2f')]?_0x54ad77['attributes']:_0x1831c2[_0x2a23('0x28')];if(!_0x2cbfbe[_0x2a23('0x2c')][_0x2a23('0x30')](_0x2a23('0x31'))){_0x54ad77[_0x2a23('0x17')]=qs['limit'](_0x2cbfbe[_0x2a23('0x2c')][_0x2a23('0x17')]);_0x54ad77[_0x2a23('0x15')]=qs['offset'](_0x2cbfbe['query'][_0x2a23('0x15')]);}_0x54ad77[_0x2a23('0x32')]=qs[_0x2a23('0x33')](_0x2cbfbe[_0x2a23('0x2c')]['sort']);_0x54ad77[_0x2a23('0x34')]=qs[_0x2a23('0x2a')](_[_0x2a23('0x35')](_0x2cbfbe[_0x2a23('0x2c')],_0x1831c2[_0x2a23('0x2a')]),_0x2f4a86);if(_0x2cbfbe['query'][_0x2a23('0x36')]){_0x54ad77[_0x2a23('0x34')]=_[_0x2a23('0x37')](_0x54ad77[_0x2a23('0x34')],{'$or':_[_0x2a23('0x29')](_0x2f4a86,function(_0x269c37){if(_0x269c37[_0x2a23('0x38')]!==_0x2a23('0x39')){var _0x125039={};_0x125039[_0x269c37[_0x2a23('0x22')]]={'$like':'%'+_0x2cbfbe[_0x2a23('0x2c')][_0x2a23('0x36')]+'%'};return _0x125039;}})});}_0x54ad77=_[_0x2a23('0x37')]({},_0x54ad77,_0x2cbfbe[_0x2a23('0x3a')]);var _0xaa3bd4={'where':_0x54ad77[_0x2a23('0x34')]};return db[_0x2a23('0x3b')][_0x2a23('0x18')](_0xaa3bd4)['then'](function(_0x3e00f7){_0x19d28a[_0x2a23('0x18')]=_0x3e00f7;if(_0x2cbfbe['query'][_0x2a23('0x3c')]){_0x54ad77[_0x2a23('0x3d')]=[{'all':!![]}];}return db[_0x2a23('0x3b')]['findAll'](_0x54ad77);})[_0x2a23('0x3e')](function(_0x22a0f8){_0x19d28a[_0x2a23('0x3f')]=_0x22a0f8;return _0x19d28a;})[_0x2a23('0x3e')](respondWithFilteredResult(_0x3700e2,_0x54ad77))[_0x2a23('0x40')](handleError(_0x3700e2,null));};exports[_0x2a23('0x41')]=function(_0x5b30f0,_0x118848){var _0x5901c9={'raw':![],'where':{'id':_0x5b30f0[_0x2a23('0x42')]['id']}},_0x2cb6b3={};_0x2cb6b3[_0x2a23('0x28')]=_['keys'](db[_0x2a23('0x3b')][_0x2a23('0x25')]);_0x2cb6b3[_0x2a23('0x2c')]=_[_0x2a23('0x43')](_0x5b30f0[_0x2a23('0x2c')]);_0x2cb6b3[_0x2a23('0x2a')]=_['intersection'](_0x2cb6b3[_0x2a23('0x28')],_0x2cb6b3['query']);_0x5901c9[_0x2a23('0x2d')]=_['intersection'](_0x2cb6b3[_0x2a23('0x28')],qs[_0x2a23('0x2e')](_0x5b30f0[_0x2a23('0x2c')][_0x2a23('0x2e')]));_0x5901c9[_0x2a23('0x2d')]=_0x5901c9['attributes'][_0x2a23('0x2f')]?_0x5901c9[_0x2a23('0x2d')]:_0x2cb6b3[_0x2a23('0x28')];if(_0x5b30f0[_0x2a23('0x2c')][_0x2a23('0x3c')]){_0x5901c9['include']=[{'all':!![]}];}_0x5901c9=_[_0x2a23('0x37')]({},_0x5901c9,_0x5b30f0[_0x2a23('0x3a')]);return db[_0x2a23('0x3b')]['find'](_0x5901c9)[_0x2a23('0x3e')](handleEntityNotFound(_0x118848,null))[_0x2a23('0x3e')](respondWithResult(_0x118848,null))[_0x2a23('0x40')](handleError(_0x118848,null));};exports[_0x2a23('0x44')]=function(_0x1a709d,_0x3a17a2){return db[_0x2a23('0x3b')]['create'](_0x1a709d[_0x2a23('0x45')],{})[_0x2a23('0x3e')](respondWithResult(_0x3a17a2,0xc9))[_0x2a23('0x40')](handleError(_0x3a17a2,null));};exports[_0x2a23('0x1d')]=function(_0x563e5f,_0x387262){if(_0x563e5f[_0x2a23('0x45')]['id']){delete _0x563e5f[_0x2a23('0x45')]['id'];}return db[_0x2a23('0x3b')][_0x2a23('0x46')]({'where':{'id':_0x563e5f['params']['id']}})[_0x2a23('0x3e')](handleEntityNotFound(_0x387262,null))[_0x2a23('0x3e')](saveUpdates(_0x563e5f[_0x2a23('0x45')],null))[_0x2a23('0x3e')](respondWithResult(_0x387262,null))['catch'](handleError(_0x387262,null));};exports['destroy']=function(_0x426d1f,_0x5528db){return db['SalesforceConfiguration']['find']({'where':{'id':_0x426d1f['params']['id']}})['then'](handleEntityNotFound(_0x5528db,null))[_0x2a23('0x3e')](removeEntity(_0x5528db,null))[_0x2a23('0x40')](handleError(_0x5528db,null));};exports[_0x2a23('0x47')]=function(_0x4de5f8,_0x12a1eb,_0x50a3db){var _0x1c2c88={};var _0xeea0ad={};var _0x3431aa;var _0x40e0ca;return db[_0x2a23('0x3b')][_0x2a23('0x48')]({'where':{'id':_0x4de5f8[_0x2a23('0x42')]['id']}})[_0x2a23('0x3e')](handleEntityNotFound(_0x12a1eb,null))[_0x2a23('0x3e')](function(_0x2b3886){if(_0x2b3886){_0x3431aa=_0x2b3886;_0xeea0ad[_0x2a23('0x28')]=_['keys'](db['SalesforceField']['rawAttributes']);_0xeea0ad[_0x2a23('0x2c')]=_[_0x2a23('0x43')](_0x4de5f8[_0x2a23('0x2c')]);_0xeea0ad[_0x2a23('0x2a')]=_[_0x2a23('0x2b')](_0xeea0ad[_0x2a23('0x28')],_0xeea0ad['query']);_0x1c2c88[_0x2a23('0x2d')]=_[_0x2a23('0x2b')](_0xeea0ad[_0x2a23('0x28')],qs[_0x2a23('0x2e')](_0x4de5f8[_0x2a23('0x2c')][_0x2a23('0x2e')]));_0x1c2c88[_0x2a23('0x2d')]=_0x1c2c88[_0x2a23('0x2d')][_0x2a23('0x2f')]?_0x1c2c88['attributes']:_0xeea0ad[_0x2a23('0x28')];_0x1c2c88[_0x2a23('0x32')]=qs[_0x2a23('0x33')](_0x4de5f8[_0x2a23('0x2c')]['sort']);_0x1c2c88[_0x2a23('0x34')]=qs[_0x2a23('0x2a')](_['pick'](_0x4de5f8[_0x2a23('0x2c')],_0xeea0ad[_0x2a23('0x2a')]));if(_0x4de5f8['query'][_0x2a23('0x36')]){_0x1c2c88['where']=_[_0x2a23('0x37')](_0x1c2c88[_0x2a23('0x34')],{'$or':_[_0x2a23('0x29')](_0x1c2c88['attributes'],function(_0x55df95){var _0x35630a={};_0x35630a[_0x55df95]={'$like':'%'+_0x4de5f8['query']['filter']+'%'};return _0x35630a;})});}_0x1c2c88=_['merge']({},_0x1c2c88,_0x4de5f8['options']);return _0x3431aa[_0x2a23('0x47')](_0x1c2c88);}})[_0x2a23('0x3e')](function(_0x4b48a3){if(_0x4b48a3){_0x40e0ca=_0x4b48a3[_0x2a23('0x2f')];if(!_0x4de5f8[_0x2a23('0x2c')][_0x2a23('0x30')](_0x2a23('0x31'))){_0x1c2c88[_0x2a23('0x17')]=qs[_0x2a23('0x17')](_0x4de5f8[_0x2a23('0x2c')][_0x2a23('0x17')]);_0x1c2c88[_0x2a23('0x15')]=qs['offset'](_0x4de5f8[_0x2a23('0x2c')]['offset']);}return _0x3431aa[_0x2a23('0x47')](_0x1c2c88);}})['then'](function(_0x2cf1e1){if(_0x2cf1e1){return _0x2cf1e1?{'count':_0x40e0ca,'rows':_0x2cf1e1}:null;}})[_0x2a23('0x3e')](respondWithResult(_0x12a1eb,null))[_0x2a23('0x40')](handleError(_0x12a1eb,null));};exports[_0x2a23('0x49')]=function(_0x1fb596,_0x2e7278,_0x31ebfb){var _0x419152={};var _0x5b0a36={};var _0x4c3d52;var _0x3a5f6f;return db[_0x2a23('0x3b')][_0x2a23('0x48')]({'where':{'id':_0x1fb596[_0x2a23('0x42')]['id']}})[_0x2a23('0x3e')](handleEntityNotFound(_0x2e7278,null))[_0x2a23('0x3e')](function(_0x437356){if(_0x437356){_0x4c3d52=_0x437356;_0x5b0a36[_0x2a23('0x28')]=_['keys'](db[_0x2a23('0x4a')][_0x2a23('0x25')]);_0x5b0a36[_0x2a23('0x2c')]=_[_0x2a23('0x43')](_0x1fb596['query']);_0x5b0a36[_0x2a23('0x2a')]=_['intersection'](_0x5b0a36[_0x2a23('0x28')],_0x5b0a36[_0x2a23('0x2c')]);_0x419152['attributes']=_[_0x2a23('0x2b')](_0x5b0a36['model'],qs[_0x2a23('0x2e')](_0x1fb596[_0x2a23('0x2c')][_0x2a23('0x2e')]));_0x419152['attributes']=_0x419152[_0x2a23('0x2d')]['length']?_0x419152[_0x2a23('0x2d')]:_0x5b0a36[_0x2a23('0x28')];_0x419152[_0x2a23('0x32')]=qs['sort'](_0x1fb596['query']['sort']);_0x419152['where']=qs[_0x2a23('0x2a')](_[_0x2a23('0x35')](_0x1fb596['query'],_0x5b0a36[_0x2a23('0x2a')]));if(_0x1fb596[_0x2a23('0x2c')][_0x2a23('0x36')]){_0x419152[_0x2a23('0x34')]=_[_0x2a23('0x37')](_0x419152[_0x2a23('0x34')],{'$or':_[_0x2a23('0x29')](_0x419152[_0x2a23('0x2d')],function(_0x548733){var _0x4f6cf9={};_0x4f6cf9[_0x548733]={'$like':'%'+_0x1fb596[_0x2a23('0x2c')][_0x2a23('0x36')]+'%'};return _0x4f6cf9;})});}_0x419152=_[_0x2a23('0x37')]({},_0x419152,_0x1fb596[_0x2a23('0x3a')]);return _0x4c3d52[_0x2a23('0x49')](_0x419152);}})[_0x2a23('0x3e')](function(_0x4d8399){if(_0x4d8399){_0x3a5f6f=_0x4d8399[_0x2a23('0x2f')];if(!_0x1fb596[_0x2a23('0x2c')][_0x2a23('0x30')](_0x2a23('0x31'))){_0x419152[_0x2a23('0x17')]=qs[_0x2a23('0x17')](_0x1fb596['query'][_0x2a23('0x17')]);_0x419152[_0x2a23('0x15')]=qs['offset'](_0x1fb596[_0x2a23('0x2c')][_0x2a23('0x15')]);}return _0x4c3d52['getSubjects'](_0x419152);}})[_0x2a23('0x3e')](function(_0x213c59){if(_0x213c59){return _0x213c59?{'count':_0x3a5f6f,'rows':_0x213c59}:null;}})[_0x2a23('0x3e')](respondWithResult(_0x2e7278,null))[_0x2a23('0x40')](handleError(_0x2e7278,null));};exports[_0x2a23('0x4b')]=function(_0xb13168,_0x25fbbc,_0x4d376f){var _0x54f8ae={};var _0x309b0d={};var _0x39209b;var _0x2e5e27;return db[_0x2a23('0x3b')][_0x2a23('0x48')]({'where':{'id':_0xb13168['params']['id']}})[_0x2a23('0x3e')](handleEntityNotFound(_0x25fbbc,null))[_0x2a23('0x3e')](function(_0x40cc31){if(_0x40cc31){_0x39209b=_0x40cc31;_0x309b0d[_0x2a23('0x28')]=_[_0x2a23('0x43')](db[_0x2a23('0x4a')][_0x2a23('0x25')]);_0x309b0d[_0x2a23('0x2c')]=_[_0x2a23('0x43')](_0xb13168['query']);_0x309b0d[_0x2a23('0x2a')]=_[_0x2a23('0x2b')](_0x309b0d['model'],_0x309b0d[_0x2a23('0x2c')]);_0x54f8ae['attributes']=_[_0x2a23('0x2b')](_0x309b0d['model'],qs[_0x2a23('0x2e')](_0xb13168[_0x2a23('0x2c')]['fields']));_0x54f8ae[_0x2a23('0x2d')]=_0x54f8ae[_0x2a23('0x2d')][_0x2a23('0x2f')]?_0x54f8ae[_0x2a23('0x2d')]:_0x309b0d[_0x2a23('0x28')];_0x54f8ae[_0x2a23('0x32')]=qs['sort'](_0xb13168[_0x2a23('0x2c')][_0x2a23('0x33')]);_0x54f8ae[_0x2a23('0x34')]=qs[_0x2a23('0x2a')](_[_0x2a23('0x35')](_0xb13168[_0x2a23('0x2c')],_0x309b0d['filters']));if(_0xb13168[_0x2a23('0x2c')][_0x2a23('0x36')]){_0x54f8ae[_0x2a23('0x34')]=_[_0x2a23('0x37')](_0x54f8ae[_0x2a23('0x34')],{'$or':_[_0x2a23('0x29')](_0x54f8ae['attributes'],function(_0x50b66a){var _0x31b33c={};_0x31b33c[_0x50b66a]={'$like':'%'+_0xb13168[_0x2a23('0x2c')][_0x2a23('0x36')]+'%'};return _0x31b33c;})});}_0x54f8ae=_[_0x2a23('0x37')]({},_0x54f8ae,_0xb13168[_0x2a23('0x3a')]);return _0x39209b[_0x2a23('0x4b')](_0x54f8ae);}})['then'](function(_0x78d7ac){if(_0x78d7ac){_0x2e5e27=_0x78d7ac['length'];if(!_0xb13168[_0x2a23('0x2c')][_0x2a23('0x30')]('nolimit')){_0x54f8ae[_0x2a23('0x17')]=qs[_0x2a23('0x17')](_0xb13168[_0x2a23('0x2c')][_0x2a23('0x17')]);_0x54f8ae[_0x2a23('0x15')]=qs[_0x2a23('0x15')](_0xb13168[_0x2a23('0x2c')][_0x2a23('0x15')]);}return _0x39209b['getDescriptions'](_0x54f8ae);}})['then'](function(_0x4ac7b6){if(_0x4ac7b6){return _0x4ac7b6?{'count':_0x2e5e27,'rows':_0x4ac7b6}:null;}})['then'](respondWithResult(_0x25fbbc,null))[_0x2a23('0x40')](handleError(_0x25fbbc,null));}; \ No newline at end of file +var _0x7c06=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','name','index','SalesforceConfiguration','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','where','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','SalesforceField','nolimit','getSubjects','order','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x223486,_0x3435de){var _0x445716=function(_0x3b4915){while(--_0x3b4915){_0x223486['push'](_0x223486['shift']());}};_0x445716(++_0x3435de);}(_0x7c06,0x8e));var _0x67c0=function(_0x1ef235,_0x31ef2d){_0x1ef235=_0x1ef235-0x0;var _0xd29c7e=_0x7c06[_0x1ef235];return _0xd29c7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x67c0('0x0'));var zipdir=require(_0x67c0('0x1'));var jsonpatch=require(_0x67c0('0x2'));var rp=require('request-promise');var moment=require(_0x67c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x67c0('0x4'));var util=require(_0x67c0('0x5'));var path=require('path');var sox=require(_0x67c0('0x6'));var csv=require(_0x67c0('0x7'));var ejs=require(_0x67c0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x67c0('0x9'));var squel=require(_0x67c0('0xa'));var crypto=require(_0x67c0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x67c0('0xc'));var toCsv=require(_0x67c0('0x7'));var querystring=require(_0x67c0('0xd'));var Papa=require(_0x67c0('0xe'));var Redis=require('ioredis');var authService=require(_0x67c0('0xf'));var qs=require(_0x67c0('0x10'));var as=require(_0x67c0('0x11'));var hardwareService=require(_0x67c0('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x67c0('0x13'));var config=require(_0x67c0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x67c0('0x15'))['db'];function respondWithStatusCode(_0x57c22e,_0x23d332){_0x23d332=_0x23d332||0xcc;return function(_0x47144d){if(_0x47144d){return _0x57c22e[_0x67c0('0x16')](_0x23d332);}return _0x57c22e['status'](_0x23d332)[_0x67c0('0x17')]();};}function respondWithResult(_0x252bd1,_0x1338dd){_0x1338dd=_0x1338dd||0xc8;return function(_0x929585){if(_0x929585){return _0x252bd1[_0x67c0('0x18')](_0x1338dd)[_0x67c0('0x19')](_0x929585);}};}function respondWithFilteredResult(_0x37bc40,_0xa9bd7a){return function(_0x3e7436){if(_0x3e7436){var _0x5057b5=typeof _0xa9bd7a[_0x67c0('0x1a')]===_0x67c0('0x1b')&&typeof _0xa9bd7a[_0x67c0('0x1c')]===_0x67c0('0x1b');var _0x229935=_0x3e7436['count'];var _0x328a9f=_0x5057b5?0x0:_0xa9bd7a[_0x67c0('0x1a')];var _0x4a42c7=_0x5057b5?_0x3e7436[_0x67c0('0x1d')]:_0xa9bd7a['offset']+_0xa9bd7a[_0x67c0('0x1c')];var _0x155bae;if(_0x4a42c7>=_0x229935){_0x4a42c7=_0x229935;_0x155bae=0xc8;}else{_0x155bae=0xce;}_0x37bc40['status'](_0x155bae);return _0x37bc40[_0x67c0('0x1e')]('Content-Range',_0x328a9f+'-'+_0x4a42c7+'/'+_0x229935)[_0x67c0('0x19')](_0x3e7436);}return null;};}function patchUpdates(_0x28fd1d){return function(_0x57c09c){try{jsonpatch[_0x67c0('0x1f')](_0x57c09c,_0x28fd1d,!![]);}catch(_0x467ef2){return BPromise[_0x67c0('0x20')](_0x467ef2);}return _0x57c09c['save']();};}function saveUpdates(_0x37b149,_0x10f955){return function(_0x37ad9d){if(_0x37ad9d){return _0x37ad9d[_0x67c0('0x21')](_0x37b149)[_0x67c0('0x22')](function(_0x526d85){return _0x526d85;});}return null;};}function removeEntity(_0x56952d,_0x27e8ea){return function(_0x41e598){if(_0x41e598){return _0x41e598[_0x67c0('0x23')]()['then'](function(){_0x56952d['status'](0xcc)[_0x67c0('0x17')]();});}};}function handleEntityNotFound(_0x38859e,_0x4344c7){return function(_0x2cdf1d){if(!_0x2cdf1d){_0x38859e[_0x67c0('0x16')](0x194);}return _0x2cdf1d;};}function handleError(_0xc92c7c,_0x3fa58a){_0x3fa58a=_0x3fa58a||0x1f4;return function(_0x5a7dcd){logger['error'](_0x5a7dcd['stack']);if(_0x5a7dcd[_0x67c0('0x24')]){delete _0x5a7dcd[_0x67c0('0x24')];}_0xc92c7c[_0x67c0('0x18')](_0x3fa58a)['send'](_0x5a7dcd);};}exports[_0x67c0('0x25')]=function(_0x2d76a1,_0x183e71){var _0x5e9174={},_0x35e167={},_0x5d4b50={'count':0x0,'rows':[]};var _0x40455d=_['map'](db[_0x67c0('0x26')][_0x67c0('0x27')],function(_0x32a454){return{'name':_0x32a454[_0x67c0('0x28')],'type':_0x32a454['type'][_0x67c0('0x29')]};});_0x35e167['model']=_['map'](_0x40455d,_0x67c0('0x24'));_0x35e167[_0x67c0('0x2a')]=_[_0x67c0('0x2b')](_0x2d76a1['query']);_0x35e167[_0x67c0('0x2c')]=_['intersection'](_0x35e167[_0x67c0('0x2d')],_0x35e167[_0x67c0('0x2a')]);_0x5e9174[_0x67c0('0x2e')]=_[_0x67c0('0x2f')](_0x35e167[_0x67c0('0x2d')],qs['fields'](_0x2d76a1['query'][_0x67c0('0x30')]));_0x5e9174['attributes']=_0x5e9174[_0x67c0('0x2e')][_0x67c0('0x31')]?_0x5e9174['attributes']:_0x35e167[_0x67c0('0x2d')];if(!_0x2d76a1[_0x67c0('0x2a')][_0x67c0('0x32')]('nolimit')){_0x5e9174[_0x67c0('0x1c')]=qs[_0x67c0('0x1c')](_0x2d76a1[_0x67c0('0x2a')][_0x67c0('0x1c')]);_0x5e9174[_0x67c0('0x1a')]=qs[_0x67c0('0x1a')](_0x2d76a1['query'][_0x67c0('0x1a')]);}_0x5e9174['order']=qs[_0x67c0('0x33')](_0x2d76a1[_0x67c0('0x2a')]['sort']);_0x5e9174['where']=qs[_0x67c0('0x2c')](_[_0x67c0('0x34')](_0x2d76a1[_0x67c0('0x2a')],_0x35e167[_0x67c0('0x2c')]),_0x40455d);if(_0x2d76a1[_0x67c0('0x2a')][_0x67c0('0x35')]){_0x5e9174[_0x67c0('0x36')]=_[_0x67c0('0x37')](_0x5e9174[_0x67c0('0x36')],{'$or':_[_0x67c0('0x38')](_0x40455d,function(_0x1da0e1){if(_0x1da0e1[_0x67c0('0x39')]!==_0x67c0('0x3a')){var _0x576709={};_0x576709[_0x1da0e1[_0x67c0('0x24')]]={'$like':'%'+_0x2d76a1['query'][_0x67c0('0x35')]+'%'};return _0x576709;}})});}_0x5e9174=_['merge']({},_0x5e9174,_0x2d76a1[_0x67c0('0x3b')]);var _0x1314e6={'where':_0x5e9174['where']};return db['SalesforceConfiguration'][_0x67c0('0x1d')](_0x1314e6)[_0x67c0('0x22')](function(_0x2b7d9a){_0x5d4b50[_0x67c0('0x1d')]=_0x2b7d9a;if(_0x2d76a1[_0x67c0('0x2a')][_0x67c0('0x3c')]){_0x5e9174[_0x67c0('0x3d')]=[{'all':!![]}];}return db[_0x67c0('0x26')][_0x67c0('0x3e')](_0x5e9174);})[_0x67c0('0x22')](function(_0x446147){_0x5d4b50[_0x67c0('0x3f')]=_0x446147;return _0x5d4b50;})[_0x67c0('0x22')](respondWithFilteredResult(_0x183e71,_0x5e9174))[_0x67c0('0x40')](handleError(_0x183e71,null));};exports[_0x67c0('0x41')]=function(_0x87ccf9,_0x5074f0){var _0x14d5e9={'raw':![],'where':{'id':_0x87ccf9[_0x67c0('0x42')]['id']}},_0x4f3e9e={};_0x4f3e9e[_0x67c0('0x2d')]=_['keys'](db['SalesforceConfiguration'][_0x67c0('0x27')]);_0x4f3e9e[_0x67c0('0x2a')]=_[_0x67c0('0x2b')](_0x87ccf9['query']);_0x4f3e9e[_0x67c0('0x2c')]=_[_0x67c0('0x2f')](_0x4f3e9e['model'],_0x4f3e9e['query']);_0x14d5e9['attributes']=_[_0x67c0('0x2f')](_0x4f3e9e[_0x67c0('0x2d')],qs[_0x67c0('0x30')](_0x87ccf9['query']['fields']));_0x14d5e9[_0x67c0('0x2e')]=_0x14d5e9[_0x67c0('0x2e')][_0x67c0('0x31')]?_0x14d5e9[_0x67c0('0x2e')]:_0x4f3e9e[_0x67c0('0x2d')];if(_0x87ccf9[_0x67c0('0x2a')][_0x67c0('0x3c')]){_0x14d5e9[_0x67c0('0x3d')]=[{'all':!![]}];}_0x14d5e9=_[_0x67c0('0x37')]({},_0x14d5e9,_0x87ccf9[_0x67c0('0x3b')]);return db['SalesforceConfiguration'][_0x67c0('0x43')](_0x14d5e9)['then'](handleEntityNotFound(_0x5074f0,null))['then'](respondWithResult(_0x5074f0,null))[_0x67c0('0x40')](handleError(_0x5074f0,null));};exports[_0x67c0('0x44')]=function(_0x32d1b1,_0xd022d7){return db['SalesforceConfiguration'][_0x67c0('0x44')](_0x32d1b1['body'],{})['then'](respondWithResult(_0xd022d7,0xc9))[_0x67c0('0x40')](handleError(_0xd022d7,null));};exports[_0x67c0('0x21')]=function(_0xab0f2c,_0x11037f){if(_0xab0f2c[_0x67c0('0x45')]['id']){delete _0xab0f2c[_0x67c0('0x45')]['id'];}return db[_0x67c0('0x26')][_0x67c0('0x43')]({'where':{'id':_0xab0f2c[_0x67c0('0x42')]['id']}})['then'](handleEntityNotFound(_0x11037f,null))[_0x67c0('0x22')](saveUpdates(_0xab0f2c[_0x67c0('0x45')],null))[_0x67c0('0x22')](respondWithResult(_0x11037f,null))['catch'](handleError(_0x11037f,null));};exports[_0x67c0('0x23')]=function(_0x1e9aad,_0x1dd7e7){return db[_0x67c0('0x26')][_0x67c0('0x43')]({'where':{'id':_0x1e9aad['params']['id']}})[_0x67c0('0x22')](handleEntityNotFound(_0x1dd7e7,null))['then'](removeEntity(_0x1dd7e7,null))[_0x67c0('0x40')](handleError(_0x1dd7e7,null));};exports[_0x67c0('0x46')]=function(_0x4e2775,_0x296319,_0x3e23d8){var _0x66fdbe={};var _0x42a5a0={};var _0x3c21c7;var _0x143f1a;return db['SalesforceConfiguration'][_0x67c0('0x47')]({'where':{'id':_0x4e2775['params']['id']}})[_0x67c0('0x22')](handleEntityNotFound(_0x296319,null))[_0x67c0('0x22')](function(_0x41413d){if(_0x41413d){_0x3c21c7=_0x41413d;_0x42a5a0[_0x67c0('0x2d')]=_[_0x67c0('0x2b')](db[_0x67c0('0x48')][_0x67c0('0x27')]);_0x42a5a0[_0x67c0('0x2a')]=_[_0x67c0('0x2b')](_0x4e2775['query']);_0x42a5a0[_0x67c0('0x2c')]=_[_0x67c0('0x2f')](_0x42a5a0[_0x67c0('0x2d')],_0x42a5a0['query']);_0x66fdbe[_0x67c0('0x2e')]=_[_0x67c0('0x2f')](_0x42a5a0[_0x67c0('0x2d')],qs[_0x67c0('0x30')](_0x4e2775['query'][_0x67c0('0x30')]));_0x66fdbe['attributes']=_0x66fdbe[_0x67c0('0x2e')][_0x67c0('0x31')]?_0x66fdbe[_0x67c0('0x2e')]:_0x42a5a0[_0x67c0('0x2d')];_0x66fdbe['order']=qs['sort'](_0x4e2775[_0x67c0('0x2a')][_0x67c0('0x33')]);_0x66fdbe[_0x67c0('0x36')]=qs[_0x67c0('0x2c')](_[_0x67c0('0x34')](_0x4e2775[_0x67c0('0x2a')],_0x42a5a0[_0x67c0('0x2c')]));if(_0x4e2775[_0x67c0('0x2a')]['filter']){_0x66fdbe[_0x67c0('0x36')]=_[_0x67c0('0x37')](_0x66fdbe[_0x67c0('0x36')],{'$or':_[_0x67c0('0x38')](_0x66fdbe[_0x67c0('0x2e')],function(_0x11a063){var _0x499ad0={};_0x499ad0[_0x11a063]={'$like':'%'+_0x4e2775['query']['filter']+'%'};return _0x499ad0;})});}_0x66fdbe=_[_0x67c0('0x37')]({},_0x66fdbe,_0x4e2775[_0x67c0('0x3b')]);return _0x3c21c7['getFields'](_0x66fdbe);}})['then'](function(_0xee86d0){if(_0xee86d0){_0x143f1a=_0xee86d0['length'];if(!_0x4e2775['query'][_0x67c0('0x32')](_0x67c0('0x49'))){_0x66fdbe['limit']=qs['limit'](_0x4e2775[_0x67c0('0x2a')][_0x67c0('0x1c')]);_0x66fdbe[_0x67c0('0x1a')]=qs['offset'](_0x4e2775[_0x67c0('0x2a')]['offset']);}return _0x3c21c7['getFields'](_0x66fdbe);}})[_0x67c0('0x22')](function(_0x5bfc36){if(_0x5bfc36){return _0x5bfc36?{'count':_0x143f1a,'rows':_0x5bfc36}:null;}})[_0x67c0('0x22')](respondWithResult(_0x296319,null))[_0x67c0('0x40')](handleError(_0x296319,null));};exports[_0x67c0('0x4a')]=function(_0x3773e0,_0x55e2fe,_0x3b2d39){var _0x20d306={};var _0x588d8c={};var _0x2938e;var _0x81f651;return db['SalesforceConfiguration'][_0x67c0('0x47')]({'where':{'id':_0x3773e0['params']['id']}})['then'](handleEntityNotFound(_0x55e2fe,null))[_0x67c0('0x22')](function(_0x2553bc){if(_0x2553bc){_0x2938e=_0x2553bc;_0x588d8c[_0x67c0('0x2d')]=_[_0x67c0('0x2b')](db['SalesforceField']['rawAttributes']);_0x588d8c[_0x67c0('0x2a')]=_[_0x67c0('0x2b')](_0x3773e0[_0x67c0('0x2a')]);_0x588d8c[_0x67c0('0x2c')]=_[_0x67c0('0x2f')](_0x588d8c[_0x67c0('0x2d')],_0x588d8c[_0x67c0('0x2a')]);_0x20d306[_0x67c0('0x2e')]=_[_0x67c0('0x2f')](_0x588d8c['model'],qs[_0x67c0('0x30')](_0x3773e0[_0x67c0('0x2a')]['fields']));_0x20d306[_0x67c0('0x2e')]=_0x20d306['attributes'][_0x67c0('0x31')]?_0x20d306[_0x67c0('0x2e')]:_0x588d8c[_0x67c0('0x2d')];_0x20d306[_0x67c0('0x4b')]=qs[_0x67c0('0x33')](_0x3773e0[_0x67c0('0x2a')][_0x67c0('0x33')]);_0x20d306['where']=qs[_0x67c0('0x2c')](_[_0x67c0('0x34')](_0x3773e0[_0x67c0('0x2a')],_0x588d8c[_0x67c0('0x2c')]));if(_0x3773e0['query']['filter']){_0x20d306[_0x67c0('0x36')]=_[_0x67c0('0x37')](_0x20d306[_0x67c0('0x36')],{'$or':_['map'](_0x20d306[_0x67c0('0x2e')],function(_0x49f923){var _0x60685e={};_0x60685e[_0x49f923]={'$like':'%'+_0x3773e0[_0x67c0('0x2a')][_0x67c0('0x35')]+'%'};return _0x60685e;})});}_0x20d306=_[_0x67c0('0x37')]({},_0x20d306,_0x3773e0[_0x67c0('0x3b')]);return _0x2938e[_0x67c0('0x4a')](_0x20d306);}})[_0x67c0('0x22')](function(_0x563244){if(_0x563244){_0x81f651=_0x563244[_0x67c0('0x31')];if(!_0x3773e0[_0x67c0('0x2a')]['hasOwnProperty'](_0x67c0('0x49'))){_0x20d306[_0x67c0('0x1c')]=qs[_0x67c0('0x1c')](_0x3773e0[_0x67c0('0x2a')][_0x67c0('0x1c')]);_0x20d306[_0x67c0('0x1a')]=qs[_0x67c0('0x1a')](_0x3773e0[_0x67c0('0x2a')][_0x67c0('0x1a')]);}return _0x2938e[_0x67c0('0x4a')](_0x20d306);}})[_0x67c0('0x22')](function(_0x51a9dc){if(_0x51a9dc){return _0x51a9dc?{'count':_0x81f651,'rows':_0x51a9dc}:null;}})['then'](respondWithResult(_0x55e2fe,null))[_0x67c0('0x40')](handleError(_0x55e2fe,null));};exports[_0x67c0('0x4c')]=function(_0x127e1e,_0x130ff5,_0x2cda4d){var _0x435b1e={};var _0x3e1c9e={};var _0xd2f74e;var _0x44401d;return db[_0x67c0('0x26')][_0x67c0('0x47')]({'where':{'id':_0x127e1e['params']['id']}})[_0x67c0('0x22')](handleEntityNotFound(_0x130ff5,null))[_0x67c0('0x22')](function(_0x51784c){if(_0x51784c){_0xd2f74e=_0x51784c;_0x3e1c9e[_0x67c0('0x2d')]=_[_0x67c0('0x2b')](db['SalesforceField'][_0x67c0('0x27')]);_0x3e1c9e[_0x67c0('0x2a')]=_['keys'](_0x127e1e[_0x67c0('0x2a')]);_0x3e1c9e[_0x67c0('0x2c')]=_['intersection'](_0x3e1c9e[_0x67c0('0x2d')],_0x3e1c9e[_0x67c0('0x2a')]);_0x435b1e['attributes']=_[_0x67c0('0x2f')](_0x3e1c9e[_0x67c0('0x2d')],qs[_0x67c0('0x30')](_0x127e1e[_0x67c0('0x2a')][_0x67c0('0x30')]));_0x435b1e[_0x67c0('0x2e')]=_0x435b1e[_0x67c0('0x2e')][_0x67c0('0x31')]?_0x435b1e[_0x67c0('0x2e')]:_0x3e1c9e['model'];_0x435b1e[_0x67c0('0x4b')]=qs['sort'](_0x127e1e['query'][_0x67c0('0x33')]);_0x435b1e[_0x67c0('0x36')]=qs[_0x67c0('0x2c')](_[_0x67c0('0x34')](_0x127e1e[_0x67c0('0x2a')],_0x3e1c9e[_0x67c0('0x2c')]));if(_0x127e1e[_0x67c0('0x2a')]['filter']){_0x435b1e[_0x67c0('0x36')]=_[_0x67c0('0x37')](_0x435b1e[_0x67c0('0x36')],{'$or':_['map'](_0x435b1e[_0x67c0('0x2e')],function(_0x4d40ab){var _0x7a964f={};_0x7a964f[_0x4d40ab]={'$like':'%'+_0x127e1e['query'][_0x67c0('0x35')]+'%'};return _0x7a964f;})});}_0x435b1e=_[_0x67c0('0x37')]({},_0x435b1e,_0x127e1e['options']);return _0xd2f74e[_0x67c0('0x4c')](_0x435b1e);}})[_0x67c0('0x22')](function(_0x19d5af){if(_0x19d5af){_0x44401d=_0x19d5af[_0x67c0('0x31')];if(!_0x127e1e[_0x67c0('0x2a')][_0x67c0('0x32')]('nolimit')){_0x435b1e[_0x67c0('0x1c')]=qs['limit'](_0x127e1e[_0x67c0('0x2a')]['limit']);_0x435b1e['offset']=qs['offset'](_0x127e1e['query']['offset']);}return _0xd2f74e[_0x67c0('0x4c')](_0x435b1e);}})[_0x67c0('0x22')](function(_0x1346a4){if(_0x1346a4){return _0x1346a4?{'count':_0x44401d,'rows':_0x1346a4}:null;}})[_0x67c0('0x22')](respondWithResult(_0x130ff5,null))['catch'](handleError(_0x130ff5,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 4a7f280..96f579c 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 _0x94f7=['../../config/logger','moment','bluebird','path','rimraf','./intSalesforceConfiguration.attributes','define','int_salesforce_configurations','lodash'];(function(_0x410cb2,_0x3c0870){var _0x356c8b=function(_0x311b6e){while(--_0x311b6e){_0x410cb2['push'](_0x410cb2['shift']());}};_0x356c8b(++_0x3c0870);}(_0x94f7,0xe0));var _0x794f=function(_0x34445b,_0x13dbe8){_0x34445b=_0x34445b-0x0;var _0x5ec527=_0x94f7[_0x34445b];return _0x5ec527;};'use strict';var _=require(_0x794f('0x0'));var util=require('util');var logger=require(_0x794f('0x1'))('api');var moment=require(_0x794f('0x2'));var BPromise=require(_0x794f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x794f('0x4'));var rimraf=require(_0x794f('0x5'));var config=require('../../config/environment');var attributes=require(_0x794f('0x6'));module['exports']=function(_0x256619,_0x378e85){return _0x256619[_0x794f('0x7')]('SalesforceConfiguration',attributes,{'tableName':_0x794f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x146d=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports'];(function(_0x56138f,_0x1e9ebb){var _0x1acaf7=function(_0x48690d){while(--_0x48690d){_0x56138f['push'](_0x56138f['shift']());}};_0x1acaf7(++_0x1e9ebb);}(_0x146d,0xb0));var _0xd146=function(_0x362c1f,_0x4fccd9){_0x362c1f=_0x362c1f-0x0;var _0x32bd2a=_0x146d[_0x362c1f];return _0x32bd2a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd146('0x0'))('api');var moment=require(_0xd146('0x1'));var BPromise=require('bluebird');var rp=require(_0xd146('0x2'));var fs=require('fs');var path=require(_0xd146('0x3'));var rimraf=require(_0xd146('0x4'));var config=require(_0xd146('0x5'));var attributes=require(_0xd146('0x6'));module[_0xd146('0x7')]=function(_0x374728,_0x1c3fc4){return _0x374728['define']('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','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 10d7f38..f6ef47e 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 _0xdb4c=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','code','error','message','result','catch'];(function(_0x562b8e,_0x321a12){var _0x145918=function(_0x4a4971){while(--_0x4a4971){_0x562b8e['push'](_0x562b8e['shift']());}};_0x145918(++_0x321a12);}(_0xdb4c,0xfc));var _0xcdb4=function(_0x1a2c98,_0x912cc2){_0x1a2c98=_0x1a2c98-0x0;var _0x514c05=_0xdb4c[_0x1a2c98];return _0x514c05;};'use strict';var _=require(_0xcdb4('0x0'));var util=require(_0xcdb4('0x1'));var moment=require(_0xcdb4('0x2'));var BPromise=require(_0xcdb4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdb4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdb4('0x5'));var logger=require(_0xcdb4('0x6'))('rpc');var config=require(_0xcdb4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcdb4('0x8')][_0xcdb4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc123bb,_0x436f20,_0x224e17){return new BPromise(function(_0x353b5e,_0x245368){return client[_0xcdb4('0xa')](_0xc123bb,_0x224e17)[_0xcdb4('0xb')](function(_0x2c4462){logger[_0xcdb4('0xc')](_0xcdb4('0xd'),_0x436f20,'request\x20sent');logger[_0xcdb4('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x436f20,_0xcdb4('0xf'),JSON['stringify'](_0x2c4462));if(_0x2c4462['error']){if(_0x2c4462['error'][_0xcdb4('0x10')]===0x1f4){logger['error'](_0xcdb4('0xd'),_0x436f20,_0x2c4462[_0xcdb4('0x11')]['message']);return _0x245368(_0x2c4462['error'][_0xcdb4('0x12')]);}logger[_0xcdb4('0x11')](_0xcdb4('0xd'),_0x436f20,_0x2c4462[_0xcdb4('0x11')][_0xcdb4('0x12')]);return _0x353b5e(_0x2c4462[_0xcdb4('0x11')]['message']);}else{logger[_0xcdb4('0xc')](_0xcdb4('0xd'),_0x436f20,_0xcdb4('0xf'));_0x353b5e(_0x2c4462[_0xcdb4('0x13')][_0xcdb4('0x12')]);}})[_0xcdb4('0x14')](function(_0x38c6b2){logger[_0xcdb4('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x436f20,_0x38c6b2);_0x245368(_0x38c6b2);});});} \ No newline at end of file +var _0xbd03=['then','info','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request'];(function(_0x4d85e9,_0x3f5068){var _0x4bdb18=function(_0x400b3b){while(--_0x400b3b){_0x4d85e9['push'](_0x4d85e9['shift']());}};_0x4bdb18(++_0x3f5068);}(_0xbd03,0x159));var _0x3bd0=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xbd03[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x3bd0('0x0'));var util=require(_0x3bd0('0x1'));var moment=require(_0x3bd0('0x2'));var BPromise=require(_0x3bd0('0x3'));var rs=require(_0x3bd0('0x4'));var fs=require('fs');var Redis=require(_0x3bd0('0x5'));var db=require(_0x3bd0('0x6'))['db'];var utils=require(_0x3bd0('0x7'));var logger=require('../../config/logger')(_0x3bd0('0x8'));var config=require('../../config/environment');var jayson=require(_0x3bd0('0x9'));var client=jayson['client'][_0x3bd0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x157f88,_0x3c8d9a,_0x5d59ff){return new BPromise(function(_0x5b3046,_0x241071){return client[_0x3bd0('0xb')](_0x157f88,_0x5d59ff)[_0x3bd0('0xc')](function(_0x4307a2){logger[_0x3bd0('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3c8d9a,'request\x20sent');logger['debug'](_0x3bd0('0xe'),_0x3c8d9a,_0x3bd0('0xf'),JSON[_0x3bd0('0x10')](_0x4307a2));if(_0x4307a2[_0x3bd0('0x11')]){if(_0x4307a2[_0x3bd0('0x11')][_0x3bd0('0x12')]===0x1f4){logger[_0x3bd0('0x11')](_0x3bd0('0x13'),_0x3c8d9a,_0x4307a2[_0x3bd0('0x11')][_0x3bd0('0x14')]);return _0x241071(_0x4307a2[_0x3bd0('0x11')]['message']);}logger['error'](_0x3bd0('0x13'),_0x3c8d9a,_0x4307a2['error'][_0x3bd0('0x14')]);return _0x5b3046(_0x4307a2[_0x3bd0('0x11')]['message']);}else{logger['info'](_0x3bd0('0x13'),_0x3c8d9a,_0x3bd0('0xf'));_0x5b3046(_0x4307a2['result']['message']);}})['catch'](function(_0x9d6ab9){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x3c8d9a,_0x9d6ab9);_0x241071(_0x9d6ab9);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index eaa2d4b..957a5c0 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 _0x4978=['exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./intSalesforceField.controller','get','/:id','isAuthenticated','post','create','put','update','destroy'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4978,0xf1));var _0x8497=function(_0x51a6af,_0x219d20){_0x51a6af=_0x51a6af-0x0;var _0x190e2c=_0x4978[_0x51a6af];return _0x190e2c;};'use strict';var multer=require(_0x8497('0x0'));var util=require(_0x8497('0x1'));var path=require('path');var timeout=require(_0x8497('0x2'));var express=require(_0x8497('0x3'));var router=express['Router']();var fs_extra=require(_0x8497('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8497('0x5'));var config=require('../../config/environment');var controller=require(_0x8497('0x6'));router[_0x8497('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8497('0x7')](_0x8497('0x8'),auth[_0x8497('0x9')](),controller['show']);router[_0x8497('0xa')]('/',auth[_0x8497('0x9')](),controller[_0x8497('0xb')]);router[_0x8497('0xc')](_0x8497('0x8'),auth['isAuthenticated'](),controller[_0x8497('0xd')]);router['delete'](_0x8497('0x8'),auth[_0x8497('0x9')](),controller[_0x8497('0xe')]);module[_0x8497('0xf')]=router; \ No newline at end of file +var _0xdebe=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','isAuthenticated','index','/:id','post','update','destroy','exports','multer','path'];(function(_0x31c515,_0x3e3481){var _0x251b49=function(_0x58a1de){while(--_0x58a1de){_0x31c515['push'](_0x31c515['shift']());}};_0x251b49(++_0x3e3481);}(_0xdebe,0x12a));var _0xedeb=function(_0x1df255,_0x50993a){_0x1df255=_0x1df255-0x0;var _0x48be64=_0xdebe[_0x1df255];return _0x48be64;};'use strict';var multer=require(_0xedeb('0x0'));var util=require('util');var path=require(_0xedeb('0x1'));var timeout=require(_0xedeb('0x2'));var express=require(_0xedeb('0x3'));var router=express[_0xedeb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xedeb('0x5'));var interaction=require(_0xedeb('0x6'));var config=require('../../config/environment');var controller=require(_0xedeb('0x7'));router['get']('/',auth[_0xedeb('0x8')](),controller[_0xedeb('0x9')]);router['get'](_0xedeb('0xa'),auth[_0xedeb('0x8')](),controller['show']);router[_0xedeb('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xedeb('0xa'),auth['isAuthenticated'](),controller[_0xedeb('0xc')]);router['delete'](_0xedeb('0xa'),auth[_0xedeb('0x8')](),controller[_0xedeb('0xd')]);module[_0xedeb('0xe')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index b7dede8..a976f5d 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 _0x7db4=['exports','string','variable','customVariable','keyValue','STRING','ENUM'];(function(_0x1ee351,_0x54261b){var _0x245aaf=function(_0x3e4b65){while(--_0x3e4b65){_0x1ee351['push'](_0x1ee351['shift']());}};_0x245aaf(++_0x54261b);}(_0x7db4,0xa1));var _0x47db=function(_0x5f3446,_0x41bdb8){_0x5f3446=_0x5f3446-0x0;var _0x575c3f=_0x7db4[_0x5f3446];return _0x575c3f;};'use strict';var Sequelize=require('sequelize');module[_0x47db('0x0')]={'type':{'type':Sequelize['ENUM'](_0x47db('0x1'),_0x47db('0x2'),_0x47db('0x3'),_0x47db('0x4'),'picklist'),'defaultValue':_0x47db('0x1')},'content':{'type':Sequelize[_0x47db('0x5')]},'key':{'type':Sequelize[_0x47db('0x5')]},'keyType':{'type':Sequelize[_0x47db('0x6')](_0x47db('0x1'),_0x47db('0x2'),_0x47db('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x47db('0x5')]},'variableName':{'type':Sequelize[_0x47db('0x5')]}}; \ No newline at end of file +var _0x295f=['variable','sequelize','exports','ENUM','string','customVariable','picklist','STRING'];(function(_0xb090ff,_0x44905d){var _0xa933e8=function(_0x25ddc2){while(--_0x25ddc2){_0xb090ff['push'](_0xb090ff['shift']());}};_0xa933e8(++_0x44905d);}(_0x295f,0x1f1));var _0xf295=function(_0x505e9f,_0x2b75b5){_0x505e9f=_0x505e9f-0x0;var _0x28dd6d=_0x295f[_0x505e9f];return _0x28dd6d;};'use strict';var Sequelize=require(_0xf295('0x0'));module[_0xf295('0x1')]={'type':{'type':Sequelize[_0xf295('0x2')](_0xf295('0x3'),'variable',_0xf295('0x4'),'keyValue',_0xf295('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf295('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf295('0x2')]('string',_0xf295('0x7'),_0xf295('0x4'))},'keyContent':{'type':Sequelize[_0xf295('0x6')]},'idField':{'type':Sequelize[_0xf295('0x6')]},'variableName':{'type':Sequelize[_0xf295('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 4d00213..9b255a6 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 _0x88a6=['attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x5d6ff9,_0x379ad8){var _0xb483db=function(_0x251840){while(--_0x251840){_0x5d6ff9['push'](_0x5d6ff9['shift']());}};_0xb483db(++_0x379ad8);}(_0x88a6,0xad));var _0x688a=function(_0x3738ad,_0x4e25ae){_0x3738ad=_0x3738ad-0x0;var _0x253a25=_0x88a6[_0x3738ad];return _0x253a25;};'use strict';var emlformat=require(_0x688a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x688a('0x1'));var jsonpatch=require(_0x688a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x688a('0x3'));var Mustache=require(_0x688a('0x4'));var util=require(_0x688a('0x5'));var path=require(_0x688a('0x6'));var sox=require(_0x688a('0x7'));var csv=require(_0x688a('0x8'));var ejs=require(_0x688a('0x9'));var fs=require('fs');var fs_extra=require(_0x688a('0xa'));var _=require(_0x688a('0xb'));var squel=require(_0x688a('0xc'));var crypto=require('crypto');var jsforce=require(_0x688a('0xd'));var deskjs=require(_0x688a('0xe'));var toCsv=require(_0x688a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x688a('0xf'));var authService=require(_0x688a('0x10'));var qs=require(_0x688a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x688a('0x12'));var logger=require(_0x688a('0x13'))(_0x688a('0x14'));var utils=require(_0x688a('0x15'));var config=require(_0x688a('0x16'));var licenseUtil=require(_0x688a('0x17'));var db=require(_0x688a('0x18'))['db'];function respondWithStatusCode(_0x43e9b5,_0x2430b9){_0x2430b9=_0x2430b9||0xcc;return function(_0x5bd7e1){if(_0x5bd7e1){return _0x43e9b5[_0x688a('0x19')](_0x2430b9);}return _0x43e9b5['status'](_0x2430b9)[_0x688a('0x1a')]();};}function respondWithResult(_0xaaf804,_0x35cd04){_0x35cd04=_0x35cd04||0xc8;return function(_0x562795){if(_0x562795){return _0xaaf804[_0x688a('0x1b')](_0x35cd04)[_0x688a('0x1c')](_0x562795);}};}function respondWithFilteredResult(_0x54571e,_0x4b7249){return function(_0x58023c){if(_0x58023c){var _0x24849e=typeof _0x4b7249[_0x688a('0x1d')]===_0x688a('0x1e')&&typeof _0x4b7249[_0x688a('0x1f')]===_0x688a('0x1e');var _0x3c6c98=_0x58023c['count'];var _0x613cd2=_0x24849e?0x0:_0x4b7249[_0x688a('0x1d')];var _0x54d73f=_0x24849e?_0x58023c[_0x688a('0x20')]:_0x4b7249['offset']+_0x4b7249[_0x688a('0x1f')];var _0x1e0041;if(_0x54d73f>=_0x3c6c98){_0x54d73f=_0x3c6c98;_0x1e0041=0xc8;}else{_0x1e0041=0xce;}_0x54571e[_0x688a('0x1b')](_0x1e0041);return _0x54571e[_0x688a('0x21')](_0x688a('0x22'),_0x613cd2+'-'+_0x54d73f+'/'+_0x3c6c98)[_0x688a('0x1c')](_0x58023c);}return null;};}function patchUpdates(_0x141ef3){return function(_0x18fef6){try{jsonpatch[_0x688a('0x23')](_0x18fef6,_0x141ef3,!![]);}catch(_0x2d8a10){return BPromise[_0x688a('0x24')](_0x2d8a10);}return _0x18fef6['save']();};}function saveUpdates(_0x55bdfb,_0x277433){return function(_0x924a34){if(_0x924a34){return _0x924a34[_0x688a('0x25')](_0x55bdfb)['then'](function(_0x2adde5){return _0x2adde5;});}return null;};}function removeEntity(_0x1b4fe9,_0xed51dc){return function(_0x580798){if(_0x580798){return _0x580798[_0x688a('0x26')]()[_0x688a('0x27')](function(){_0x1b4fe9['status'](0xcc)[_0x688a('0x1a')]();});}};}function handleEntityNotFound(_0x55f2a0,_0x1534a9){return function(_0x1f4661){if(!_0x1f4661){_0x55f2a0[_0x688a('0x19')](0x194);}return _0x1f4661;};}function handleError(_0x1af1a1,_0x573631){_0x573631=_0x573631||0x1f4;return function(_0x3c5379){logger[_0x688a('0x28')](_0x3c5379['stack']);if(_0x3c5379[_0x688a('0x29')]){delete _0x3c5379[_0x688a('0x29')];}_0x1af1a1['status'](_0x573631)[_0x688a('0x2a')](_0x3c5379);};}exports[_0x688a('0x2b')]=function(_0x206ae3,_0x5004fd){var _0x274768={},_0x4b4108={},_0x14fbbf={'count':0x0,'rows':[]};var _0x517a2e=_[_0x688a('0x2c')](db[_0x688a('0x2d')][_0x688a('0x2e')],function(_0x1a5eca){return{'name':_0x1a5eca[_0x688a('0x2f')],'type':_0x1a5eca[_0x688a('0x30')][_0x688a('0x31')]};});_0x4b4108[_0x688a('0x32')]=_[_0x688a('0x2c')](_0x517a2e,'name');_0x4b4108[_0x688a('0x33')]=_[_0x688a('0x34')](_0x206ae3[_0x688a('0x33')]);_0x4b4108[_0x688a('0x35')]=_[_0x688a('0x36')](_0x4b4108['model'],_0x4b4108['query']);_0x274768[_0x688a('0x37')]=_[_0x688a('0x36')](_0x4b4108['model'],qs[_0x688a('0x38')](_0x206ae3[_0x688a('0x33')][_0x688a('0x38')]));_0x274768[_0x688a('0x37')]=_0x274768[_0x688a('0x37')][_0x688a('0x39')]?_0x274768['attributes']:_0x4b4108[_0x688a('0x32')];if(!_0x206ae3['query'][_0x688a('0x3a')]('nolimit')){_0x274768[_0x688a('0x1f')]=qs[_0x688a('0x1f')](_0x206ae3[_0x688a('0x33')]['limit']);_0x274768[_0x688a('0x1d')]=qs[_0x688a('0x1d')](_0x206ae3[_0x688a('0x33')][_0x688a('0x1d')]);}_0x274768[_0x688a('0x3b')]=qs[_0x688a('0x3c')](_0x206ae3[_0x688a('0x33')]['sort']);_0x274768['where']=qs[_0x688a('0x35')](_[_0x688a('0x3d')](_0x206ae3['query'],_0x4b4108[_0x688a('0x35')]),_0x517a2e);if(_0x206ae3[_0x688a('0x33')][_0x688a('0x3e')]){_0x274768[_0x688a('0x3f')]=_['merge'](_0x274768['where'],{'$or':_['map'](_0x517a2e,function(_0x171739){if(_0x171739['type']!=='VIRTUAL'){var _0x24e415={};_0x24e415[_0x171739[_0x688a('0x29')]]={'$like':'%'+_0x206ae3[_0x688a('0x33')]['filter']+'%'};return _0x24e415;}})});}_0x274768=_[_0x688a('0x40')]({},_0x274768,_0x206ae3[_0x688a('0x41')]);var _0x495f91={'where':_0x274768['where']};return db[_0x688a('0x2d')][_0x688a('0x20')](_0x495f91)[_0x688a('0x27')](function(_0x41cbb0){_0x14fbbf[_0x688a('0x20')]=_0x41cbb0;if(_0x206ae3['query'][_0x688a('0x42')]){_0x274768[_0x688a('0x43')]=[{'all':!![]}];}return db[_0x688a('0x2d')][_0x688a('0x44')](_0x274768);})[_0x688a('0x27')](function(_0x51a832){_0x14fbbf[_0x688a('0x45')]=_0x51a832;return _0x14fbbf;})['then'](respondWithFilteredResult(_0x5004fd,_0x274768))['catch'](handleError(_0x5004fd,null));};exports[_0x688a('0x46')]=function(_0x519e25,_0xeae444){var _0x4a0cf6={'raw':!![],'where':{'id':_0x519e25[_0x688a('0x47')]['id']}},_0x58784a={};_0x58784a[_0x688a('0x32')]=_[_0x688a('0x34')](db[_0x688a('0x2d')][_0x688a('0x2e')]);_0x58784a['query']=_[_0x688a('0x34')](_0x519e25[_0x688a('0x33')]);_0x58784a[_0x688a('0x35')]=_[_0x688a('0x36')](_0x58784a[_0x688a('0x32')],_0x58784a[_0x688a('0x33')]);_0x4a0cf6[_0x688a('0x37')]=_[_0x688a('0x36')](_0x58784a[_0x688a('0x32')],qs[_0x688a('0x38')](_0x519e25[_0x688a('0x33')][_0x688a('0x38')]));_0x4a0cf6[_0x688a('0x37')]=_0x4a0cf6['attributes'][_0x688a('0x39')]?_0x4a0cf6[_0x688a('0x37')]:_0x58784a[_0x688a('0x32')];if(_0x519e25['query'][_0x688a('0x42')]){_0x4a0cf6[_0x688a('0x43')]=[{'all':!![]}];}_0x4a0cf6=_[_0x688a('0x40')]({},_0x4a0cf6,_0x519e25[_0x688a('0x41')]);return db[_0x688a('0x2d')][_0x688a('0x48')](_0x4a0cf6)['then'](handleEntityNotFound(_0xeae444,null))[_0x688a('0x27')](respondWithResult(_0xeae444,null))['catch'](handleError(_0xeae444,null));};exports['create']=function(_0x496ee5,_0x47e6f1){return db[_0x688a('0x2d')][_0x688a('0x49')](_0x496ee5[_0x688a('0x4a')],{})['then'](respondWithResult(_0x47e6f1,0xc9))[_0x688a('0x4b')](handleError(_0x47e6f1,null));};exports[_0x688a('0x25')]=function(_0x296e85,_0x17a04e){if(_0x296e85['body']['id']){delete _0x296e85['body']['id'];}return db[_0x688a('0x2d')][_0x688a('0x48')]({'where':{'id':_0x296e85[_0x688a('0x47')]['id']}})[_0x688a('0x27')](handleEntityNotFound(_0x17a04e,null))['then'](saveUpdates(_0x296e85[_0x688a('0x4a')],null))['then'](respondWithResult(_0x17a04e,null))[_0x688a('0x4b')](handleError(_0x17a04e,null));};exports['destroy']=function(_0x2a2dec,_0x53848f){return db['SalesforceField'][_0x688a('0x48')]({'where':{'id':_0x2a2dec[_0x688a('0x47')]['id']}})[_0x688a('0x27')](handleEntityNotFound(_0x53848f,null))[_0x688a('0x27')](removeEntity(_0x53848f,null))[_0x688a('0x4b')](handleError(_0x53848f,null));}; \ No newline at end of file +var _0x9319=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','count','offset','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','nolimit','limit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','SalesforceField','findAll','rows','catch','show','include','create','body','find','params','destroy','rimraf','zip-dir','moment','bluebird','mustache','path','ejs'];(function(_0x3b43aa,_0x54ad1c){var _0x34cca=function(_0x273896){while(--_0x273896){_0x3b43aa['push'](_0x3b43aa['shift']());}};_0x34cca(++_0x54ad1c);}(_0x9319,0x87));var _0x9931=function(_0x49e303,_0xf20de2){_0x49e303=_0x49e303-0x0;var _0x788961=_0x9319[_0x49e303];return _0x788961;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9931('0x0'));var zipdir=require(_0x9931('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9931('0x2'));var BPromise=require(_0x9931('0x3'));var Mustache=require(_0x9931('0x4'));var util=require('util');var path=require(_0x9931('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9931('0x6'));var fs=require('fs');var fs_extra=require(_0x9931('0x7'));var _=require(_0x9931('0x8'));var squel=require(_0x9931('0x9'));var crypto=require(_0x9931('0xa'));var jsforce=require(_0x9931('0xb'));var deskjs=require(_0x9931('0xc'));var toCsv=require(_0x9931('0xd'));var querystring=require(_0x9931('0xe'));var Papa=require(_0x9931('0xf'));var Redis=require(_0x9931('0x10'));var authService=require(_0x9931('0x11'));var qs=require(_0x9931('0x12'));var as=require(_0x9931('0x13'));var hardwareService=require(_0x9931('0x14'));var logger=require(_0x9931('0x15'))('api');var utils=require(_0x9931('0x16'));var config=require(_0x9931('0x17'));var licenseUtil=require(_0x9931('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x444ed3,_0x3d0026){_0x3d0026=_0x3d0026||0xcc;return function(_0x550b84){if(_0x550b84){return _0x444ed3['sendStatus'](_0x3d0026);}return _0x444ed3[_0x9931('0x19')](_0x3d0026)[_0x9931('0x1a')]();};}function respondWithResult(_0x8d9baa,_0x1280d8){_0x1280d8=_0x1280d8||0xc8;return function(_0x549bad){if(_0x549bad){return _0x8d9baa[_0x9931('0x19')](_0x1280d8)['json'](_0x549bad);}};}function respondWithFilteredResult(_0x33c38c,_0x5593fb){return function(_0x346ba2){if(_0x346ba2){var _0x49ee80=typeof _0x5593fb['offset']==='undefined'&&typeof _0x5593fb['limit']===_0x9931('0x1b');var _0x12d508=_0x346ba2[_0x9931('0x1c')];var _0x5ca5c5=_0x49ee80?0x0:_0x5593fb['offset'];var _0x35db31=_0x49ee80?_0x346ba2[_0x9931('0x1c')]:_0x5593fb[_0x9931('0x1d')]+_0x5593fb['limit'];var _0x1945d6;if(_0x35db31>=_0x12d508){_0x35db31=_0x12d508;_0x1945d6=0xc8;}else{_0x1945d6=0xce;}_0x33c38c['status'](_0x1945d6);return _0x33c38c['set']('Content-Range',_0x5ca5c5+'-'+_0x35db31+'/'+_0x12d508)['json'](_0x346ba2);}return null;};}function patchUpdates(_0x473ca8){return function(_0x26beb4){try{jsonpatch['apply'](_0x26beb4,_0x473ca8,!![]);}catch(_0xa41b9f){return BPromise[_0x9931('0x1e')](_0xa41b9f);}return _0x26beb4[_0x9931('0x1f')]();};}function saveUpdates(_0x31954e,_0x1e9bcd){return function(_0x17066c){if(_0x17066c){return _0x17066c[_0x9931('0x20')](_0x31954e)[_0x9931('0x21')](function(_0x2c601b){return _0x2c601b;});}return null;};}function removeEntity(_0x5719ab,_0x2e4f2b){return function(_0x360eb8){if(_0x360eb8){return _0x360eb8['destroy']()['then'](function(){_0x5719ab['status'](0xcc)[_0x9931('0x1a')]();});}};}function handleEntityNotFound(_0x768db4,_0x2ed7d0){return function(_0x22b7f){if(!_0x22b7f){_0x768db4['sendStatus'](0x194);}return _0x22b7f;};}function handleError(_0x269c4d,_0x4a57b8){_0x4a57b8=_0x4a57b8||0x1f4;return function(_0x507b73){logger[_0x9931('0x22')](_0x507b73[_0x9931('0x23')]);if(_0x507b73[_0x9931('0x24')]){delete _0x507b73['name'];}_0x269c4d[_0x9931('0x19')](_0x4a57b8)[_0x9931('0x25')](_0x507b73);};}exports[_0x9931('0x26')]=function(_0x38857b,_0x18c4ae){var _0x494517={},_0x39d13a={},_0x26eded={'count':0x0,'rows':[]};var _0x18f427=_[_0x9931('0x27')](db['SalesforceField'][_0x9931('0x28')],function(_0x2743c9){return{'name':_0x2743c9[_0x9931('0x29')],'type':_0x2743c9[_0x9931('0x2a')]['key']};});_0x39d13a[_0x9931('0x2b')]=_['map'](_0x18f427,_0x9931('0x24'));_0x39d13a[_0x9931('0x2c')]=_[_0x9931('0x2d')](_0x38857b['query']);_0x39d13a['filters']=_['intersection'](_0x39d13a[_0x9931('0x2b')],_0x39d13a[_0x9931('0x2c')]);_0x494517[_0x9931('0x2e')]=_[_0x9931('0x2f')](_0x39d13a['model'],qs['fields'](_0x38857b[_0x9931('0x2c')][_0x9931('0x30')]));_0x494517[_0x9931('0x2e')]=_0x494517[_0x9931('0x2e')][_0x9931('0x31')]?_0x494517[_0x9931('0x2e')]:_0x39d13a[_0x9931('0x2b')];if(!_0x38857b['query']['hasOwnProperty'](_0x9931('0x32'))){_0x494517[_0x9931('0x33')]=qs['limit'](_0x38857b[_0x9931('0x2c')][_0x9931('0x33')]);_0x494517[_0x9931('0x1d')]=qs[_0x9931('0x1d')](_0x38857b[_0x9931('0x2c')][_0x9931('0x1d')]);}_0x494517['order']=qs[_0x9931('0x34')](_0x38857b[_0x9931('0x2c')]['sort']);_0x494517[_0x9931('0x35')]=qs[_0x9931('0x36')](_['pick'](_0x38857b[_0x9931('0x2c')],_0x39d13a[_0x9931('0x36')]),_0x18f427);if(_0x38857b[_0x9931('0x2c')][_0x9931('0x37')]){_0x494517[_0x9931('0x35')]=_[_0x9931('0x38')](_0x494517[_0x9931('0x35')],{'$or':_[_0x9931('0x27')](_0x18f427,function(_0xbf39c){if(_0xbf39c[_0x9931('0x2a')]!==_0x9931('0x39')){var _0xb989b0={};_0xb989b0[_0xbf39c['name']]={'$like':'%'+_0x38857b[_0x9931('0x2c')][_0x9931('0x37')]+'%'};return _0xb989b0;}})});}_0x494517=_[_0x9931('0x38')]({},_0x494517,_0x38857b[_0x9931('0x3a')]);var _0x94f28={'where':_0x494517[_0x9931('0x35')]};return db['SalesforceField'][_0x9931('0x1c')](_0x94f28)[_0x9931('0x21')](function(_0x1666c4){_0x26eded[_0x9931('0x1c')]=_0x1666c4;if(_0x38857b[_0x9931('0x2c')][_0x9931('0x3b')]){_0x494517['include']=[{'all':!![]}];}return db[_0x9931('0x3c')][_0x9931('0x3d')](_0x494517);})[_0x9931('0x21')](function(_0x4fcdc6){_0x26eded[_0x9931('0x3e')]=_0x4fcdc6;return _0x26eded;})['then'](respondWithFilteredResult(_0x18c4ae,_0x494517))[_0x9931('0x3f')](handleError(_0x18c4ae,null));};exports[_0x9931('0x40')]=function(_0x27d745,_0x21fb45){var _0x3e81aa={'raw':!![],'where':{'id':_0x27d745['params']['id']}},_0x49fe46={};_0x49fe46[_0x9931('0x2b')]=_[_0x9931('0x2d')](db[_0x9931('0x3c')][_0x9931('0x28')]);_0x49fe46[_0x9931('0x2c')]=_[_0x9931('0x2d')](_0x27d745[_0x9931('0x2c')]);_0x49fe46['filters']=_['intersection'](_0x49fe46['model'],_0x49fe46['query']);_0x3e81aa[_0x9931('0x2e')]=_['intersection'](_0x49fe46['model'],qs[_0x9931('0x30')](_0x27d745[_0x9931('0x2c')][_0x9931('0x30')]));_0x3e81aa[_0x9931('0x2e')]=_0x3e81aa[_0x9931('0x2e')][_0x9931('0x31')]?_0x3e81aa[_0x9931('0x2e')]:_0x49fe46[_0x9931('0x2b')];if(_0x27d745[_0x9931('0x2c')]['includeAll']){_0x3e81aa[_0x9931('0x41')]=[{'all':!![]}];}_0x3e81aa=_[_0x9931('0x38')]({},_0x3e81aa,_0x27d745[_0x9931('0x3a')]);return db[_0x9931('0x3c')]['find'](_0x3e81aa)['then'](handleEntityNotFound(_0x21fb45,null))[_0x9931('0x21')](respondWithResult(_0x21fb45,null))['catch'](handleError(_0x21fb45,null));};exports[_0x9931('0x42')]=function(_0x43b492,_0x30b469){return db[_0x9931('0x3c')]['create'](_0x43b492['body'],{})[_0x9931('0x21')](respondWithResult(_0x30b469,0xc9))[_0x9931('0x3f')](handleError(_0x30b469,null));};exports['update']=function(_0x4c5529,_0x48c8c3){if(_0x4c5529[_0x9931('0x43')]['id']){delete _0x4c5529[_0x9931('0x43')]['id'];}return db[_0x9931('0x3c')][_0x9931('0x44')]({'where':{'id':_0x4c5529[_0x9931('0x45')]['id']}})['then'](handleEntityNotFound(_0x48c8c3,null))['then'](saveUpdates(_0x4c5529['body'],null))[_0x9931('0x21')](respondWithResult(_0x48c8c3,null))[_0x9931('0x3f')](handleError(_0x48c8c3,null));};exports[_0x9931('0x46')]=function(_0x42a6e5,_0x5b25a0){return db[_0x9931('0x3c')][_0x9931('0x44')]({'where':{'id':_0x42a6e5[_0x9931('0x45')]['id']}})[_0x9931('0x21')](handleEntityNotFound(_0x5b25a0,null))['then'](removeEntity(_0x5b25a0,null))[_0x9931('0x3f')](handleError(_0x5b25a0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index db0a247..7e3bed2 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 _0xc030=['SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','util','api','request-promise','path','rimraf','./intSalesforceField.attributes','exports'];(function(_0x5874e8,_0x483eb2){var _0x5e7bc1=function(_0x41a675){while(--_0x41a675){_0x5874e8['push'](_0x5874e8['shift']());}};_0x5e7bc1(++_0x483eb2);}(_0xc030,0x130));var _0x0c03=function(_0x18ab18,_0x40b0e9){_0x18ab18=_0x18ab18-0x0;var _0x305236=_0xc030[_0x18ab18];return _0x305236;};'use strict';var _=require(_0x0c03('0x0'));var util=require(_0x0c03('0x1'));var logger=require('../../config/logger')(_0x0c03('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0c03('0x3'));var fs=require('fs');var path=require(_0x0c03('0x4'));var rimraf=require(_0x0c03('0x5'));var config=require('../../config/environment');var attributes=require(_0x0c03('0x6'));module[_0x0c03('0x7')]=function(_0x339245,_0x13eb09){return _0x339245['define'](_0x0c03('0x8'),attributes,{'tableName':_0x0c03('0x9'),'paranoid':![],'indexes':[{'name':_0x0c03('0xa'),'fields':['idField',_0x0c03('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b80=['exports','define','SalesforceField','int_salesforce_fields','idField','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes'];(function(_0x46cb21,_0x482f03){var _0x6dc6dc=function(_0x56e557){while(--_0x56e557){_0x46cb21['push'](_0x46cb21['shift']());}};_0x6dc6dc(++_0x482f03);}(_0x7b80,0x101));var _0x07b8=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7b80[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x07b8('0x0'));var util=require(_0x07b8('0x1'));var logger=require(_0x07b8('0x2'))(_0x07b8('0x3'));var moment=require('moment');var BPromise=require(_0x07b8('0x4'));var rp=require(_0x07b8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07b8('0x6'));var config=require(_0x07b8('0x7'));var attributes=require(_0x07b8('0x8'));module[_0x07b8('0x9')]=function(_0x38be58,_0x192137){return _0x38be58[_0x07b8('0xa')](_0x07b8('0xb'),attributes,{'tableName':_0x07b8('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x07b8('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 86b3885..d261a1e 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 _0xa539=['request','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','SalesforceField,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x1aa5eb,_0x4efec4){var _0x45f0fa=function(_0x35e7d4){while(--_0x35e7d4){_0x1aa5eb['push'](_0x1aa5eb['shift']());}};_0x45f0fa(++_0x4efec4);}(_0xa539,0xbf));var _0x9a53=function(_0x10d751,_0x119ebf){_0x10d751=_0x10d751-0x0;var _0x1569a0=_0xa539[_0x10d751];return _0x1569a0;};'use strict';var _=require('lodash');var util=require(_0x9a53('0x0'));var moment=require('moment');var BPromise=require(_0x9a53('0x1'));var rs=require(_0x9a53('0x2'));var fs=require('fs');var Redis=require(_0x9a53('0x3'));var db=require(_0x9a53('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a53('0x5'))(_0x9a53('0x6'));var config=require('../../config/environment');var jayson=require(_0x9a53('0x7'));var client=jayson[_0x9a53('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf2559d,_0x17ddd3,_0x306b36){return new BPromise(function(_0x322506,_0xd5dd61){return client[_0x9a53('0x9')](_0xf2559d,_0x306b36)[_0x9a53('0xa')](function(_0x2ae608){logger[_0x9a53('0xb')]('SalesforceField,\x20%s,\x20%s',_0x17ddd3,_0x9a53('0xc'));logger[_0x9a53('0xd')](_0x9a53('0xe'),_0x17ddd3,_0x9a53('0xc'),JSON['stringify'](_0x2ae608));if(_0x2ae608['error']){if(_0x2ae608[_0x9a53('0xf')]['code']===0x1f4){logger[_0x9a53('0xf')](_0x9a53('0x10'),_0x17ddd3,_0x2ae608[_0x9a53('0xf')][_0x9a53('0x11')]);return _0xd5dd61(_0x2ae608[_0x9a53('0xf')][_0x9a53('0x11')]);}logger[_0x9a53('0xf')](_0x9a53('0x10'),_0x17ddd3,_0x2ae608[_0x9a53('0xf')][_0x9a53('0x11')]);return _0x322506(_0x2ae608[_0x9a53('0xf')][_0x9a53('0x11')]);}else{logger[_0x9a53('0xb')](_0x9a53('0x10'),_0x17ddd3,_0x9a53('0xc'));_0x322506(_0x2ae608[_0x9a53('0x12')][_0x9a53('0x11')]);}})[_0x9a53('0x13')](function(_0x2f9094){logger[_0x9a53('0xf')](_0x9a53('0x10'),_0x17ddd3,_0x2f9094);_0xd5dd61(_0x2f9094);});});} \ No newline at end of file +var _0xe48c=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','SalesforceField,\x20%s,\x20%s','result','lodash','util','moment','bluebird','ioredis'];(function(_0x19c0bf,_0x515da2){var _0x123304=function(_0x3f7c4e){while(--_0x3f7c4e){_0x19c0bf['push'](_0x19c0bf['shift']());}};_0x123304(++_0x515da2);}(_0xe48c,0x10c));var _0xce48=function(_0x7ecb7b,_0x126a14){_0x7ecb7b=_0x7ecb7b-0x0;var _0x1df3b8=_0xe48c[_0x7ecb7b];return _0x1df3b8;};'use strict';var _=require(_0xce48('0x0'));var util=require(_0xce48('0x1'));var moment=require(_0xce48('0x2'));var BPromise=require(_0xce48('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce48('0x4'));var db=require(_0xce48('0x5'))['db'];var utils=require(_0xce48('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xce48('0x7'));var jayson=require(_0xce48('0x8'));var client=jayson[_0xce48('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x267f0f,_0x529305,_0x12bc11){return new BPromise(function(_0x567e78,_0x2905c0){return client[_0xce48('0xa')](_0x267f0f,_0x12bc11)[_0xce48('0xb')](function(_0x1ab771){logger[_0xce48('0xc')]('SalesforceField,\x20%s,\x20%s',_0x529305,_0xce48('0xd'));logger[_0xce48('0xe')](_0xce48('0xf'),_0x529305,'request\x20sent',JSON['stringify'](_0x1ab771));if(_0x1ab771[_0xce48('0x10')]){if(_0x1ab771[_0xce48('0x10')][_0xce48('0x11')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x529305,_0x1ab771[_0xce48('0x10')][_0xce48('0x12')]);return _0x2905c0(_0x1ab771['error']['message']);}logger[_0xce48('0x10')]('SalesforceField,\x20%s,\x20%s',_0x529305,_0x1ab771[_0xce48('0x10')]['message']);return _0x567e78(_0x1ab771[_0xce48('0x10')][_0xce48('0x12')]);}else{logger[_0xce48('0xc')](_0xce48('0x13'),_0x529305,_0xce48('0xd'));_0x567e78(_0x1ab771[_0xce48('0x14')][_0xce48('0x12')]);}})['catch'](function(_0x427ff1){logger[_0xce48('0x10')](_0xce48('0x13'),_0x529305,_0x427ff1);_0x2905c0(_0x427ff1);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index b24e33b..e031670 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 _0x5ab4=['getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x5f4b88,_0x531217){var _0xe41785=function(_0x55dea5){while(--_0x55dea5){_0x5f4b88['push'](_0x5f4b88['shift']());}};_0xe41785(++_0x531217);}(_0x5ab4,0x9f));var _0x45ab=function(_0x4b882f,_0x232627){_0x4b882f=_0x4b882f-0x0;var _0x457ebf=_0x5ab4[_0x4b882f];return _0x457ebf;};'use strict';var multer=require(_0x45ab('0x0'));var util=require(_0x45ab('0x1'));var path=require(_0x45ab('0x2'));var timeout=require(_0x45ab('0x3'));var express=require(_0x45ab('0x4'));var router=express['Router']();var fs_extra=require(_0x45ab('0x5'));var auth=require(_0x45ab('0x6'));var interaction=require(_0x45ab('0x7'));var config=require(_0x45ab('0x8'));var controller=require(_0x45ab('0x9'));router[_0x45ab('0xa')]('/',auth['isAuthenticated'](),controller[_0x45ab('0xb')]);router[_0x45ab('0xa')](_0x45ab('0xc'),auth[_0x45ab('0xd')](),controller[_0x45ab('0xe')]);router[_0x45ab('0xa')](_0x45ab('0xf'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x10')]);router[_0x45ab('0xa')](_0x45ab('0x11'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x12')]);router['post']('/',auth[_0x45ab('0xd')](),controller[_0x45ab('0x13')]);router[_0x45ab('0x14')](_0x45ab('0xf'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x15')]);router[_0x45ab('0x16')](_0x45ab('0xc'),auth[_0x45ab('0xd')](),controller['update']);router['delete'](_0x45ab('0xc'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x17')]);module[_0x45ab('0x18')]=router; \ No newline at end of file +var _0x0711=['destroy','util','path','express','Router','fs-extra','../../components/auth/service','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update'];(function(_0x4e4f67,_0x57dc0b){var _0x193c53=function(_0x401912){while(--_0x401912){_0x4e4f67['push'](_0x4e4f67['shift']());}};_0x193c53(++_0x57dc0b);}(_0x0711,0x1e5));var _0x1071=function(_0x2e90a8,_0x12065a){_0x2e90a8=_0x2e90a8-0x0;var _0x51d24b=_0x0711[_0x2e90a8];return _0x51d24b;};'use strict';var multer=require('multer');var util=require(_0x1071('0x0'));var path=require(_0x1071('0x1'));var timeout=require('connect-timeout');var express=require(_0x1071('0x2'));var router=express[_0x1071('0x3')]();var fs_extra=require(_0x1071('0x4'));var auth=require(_0x1071('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1071('0x6'));router[_0x1071('0x7')]('/',auth['isAuthenticated'](),controller[_0x1071('0x8')]);router[_0x1071('0x7')](_0x1071('0x9'),auth[_0x1071('0xa')](),controller[_0x1071('0xb')]);router['get'](_0x1071('0xc'),auth[_0x1071('0xa')](),controller[_0x1071('0xd')]);router[_0x1071('0x7')](_0x1071('0xe'),auth[_0x1071('0xa')](),controller[_0x1071('0xf')]);router['post']('/',auth[_0x1071('0xa')](),controller[_0x1071('0x10')]);router[_0x1071('0x11')](_0x1071('0xc'),auth[_0x1071('0xa')](),controller[_0x1071('0x12')]);router[_0x1071('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x1071('0x14')]);router['delete'](_0x1071('0x9'),auth[_0x1071('0xa')](),controller[_0x1071('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index dcd810a..8408fb3 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 _0x5153=['exports','STRING','username','remoteUri','sequelize'];(function(_0x33b40c,_0x38e315){var _0x3fd36f=function(_0x10f41c){while(--_0x10f41c){_0x33b40c['push'](_0x33b40c['shift']());}};_0x3fd36f(++_0x38e315);}(_0x5153,0x13a));var _0x3515=function(_0x5c7620,_0x3a6b04){_0x5c7620=_0x5c7620-0x0;var _0x8dd881=_0x5153[_0x5c7620];return _0x8dd881;};'use strict';var Sequelize=require(_0x3515('0x0'));module[_0x3515('0x1')]={'name':{'type':Sequelize[_0x3515('0x2')]},'description':{'type':Sequelize[_0x3515('0x2')]},'username':{'type':Sequelize[_0x3515('0x2')],'unique':_0x3515('0x3')},'password':{'type':Sequelize[_0x3515('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3515('0x2')],'unique':_0x3515('0x4')},'serverUrl':{'type':Sequelize[_0x3515('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x673b=['username','sequelize','exports','STRING'];(function(_0x30a999,_0x2864a5){var _0x24630e=function(_0x228640){while(--_0x228640){_0x30a999['push'](_0x30a999['shift']());}};_0x24630e(++_0x2864a5);}(_0x673b,0x165));var _0xb673=function(_0x58fc2b,_0x368286){_0x58fc2b=_0x58fc2b-0x0;var _0x3937ce=_0x673b[_0x58fc2b];return _0x3937ce;};'use strict';var Sequelize=require(_0xb673('0x0'));module[_0xb673('0x1')]={'name':{'type':Sequelize[_0xb673('0x2')]},'description':{'type':Sequelize[_0xb673('0x2')]},'username':{'type':Sequelize[_0xb673('0x2')],'unique':_0xb673('0x3')},'password':{'type':Sequelize[_0xb673('0x2')]},'email':{'type':Sequelize[_0xb673('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xb673('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 101fb6c..641da49 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 _0x287b=['knowledge','subcategory','close_code','notify','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','user_input','sys_created_on','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','caller_id','approval_set','short_description','correlation_display','delivery_task','assignment_group','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','serverUrl','remoteUri','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','remove','includes','internalType','label','push','all','assign','TCL:\x20_object','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','True','true','False','false','inactive','value','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','ServicenowAccount','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','pick','merge','where','filter','include','findAll','rows','show','keys','includeAll','options','find','catch','create','body','params','destroy','getConfigurations','findOne','order','sort','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','hold_reason'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x287b,0x67));var _0xb287=function(_0x39ff5c,_0x3de001){_0x39ff5c=_0x39ff5c-0x0;var _0x1eba54=_0x287b[_0x39ff5c];return _0x1eba54;};'use strict';var emlformat=require(_0xb287('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb287('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb287('0x2'));var moment=require(_0xb287('0x3'));var BPromise=require(_0xb287('0x4'));var Mustache=require(_0xb287('0x5'));var util=require(_0xb287('0x6'));var path=require(_0xb287('0x7'));var sox=require('sox');var csv=require(_0xb287('0x8'));var ejs=require(_0xb287('0x9'));var fs=require('fs');var fs_extra=require(_0xb287('0xa'));var _=require(_0xb287('0xb'));var squel=require('squel');var crypto=require(_0xb287('0xc'));var jsforce=require(_0xb287('0xd'));var deskjs=require(_0xb287('0xe'));var toCsv=require(_0xb287('0x8'));var querystring=require(_0xb287('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb287('0x10'));var qs=require(_0xb287('0x11'));var as=require(_0xb287('0x12'));var hardwareService=require(_0xb287('0x13'));var logger=require(_0xb287('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb287('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb287('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1f49eb,_0x41c9f3){_0x41c9f3=_0x41c9f3||0xcc;return function(_0x537f6b){if(_0x537f6b){return _0x1f49eb['sendStatus'](_0x41c9f3);}return _0x1f49eb[_0xb287('0x17')](_0x41c9f3)[_0xb287('0x18')]();};}function respondWithResult(_0x4c1feb,_0x562b50){_0x562b50=_0x562b50||0xc8;return function(_0x58e499){if(_0x58e499){return _0x4c1feb[_0xb287('0x17')](_0x562b50)[_0xb287('0x19')](_0x58e499);}};}function respondWithFilteredResult(_0x37e621,_0x369d6c){return function(_0x361f89){if(_0x361f89){var _0x35124d=typeof _0x369d6c[_0xb287('0x1a')]===_0xb287('0x1b')&&typeof _0x369d6c['limit']===_0xb287('0x1b');var _0x5516fb=_0x361f89[_0xb287('0x1c')];var _0xe18708=_0x35124d?0x0:_0x369d6c[_0xb287('0x1a')];var _0x21a856=_0x35124d?_0x361f89['count']:_0x369d6c['offset']+_0x369d6c[_0xb287('0x1d')];var _0x5da7b7;if(_0x21a856>=_0x5516fb){_0x21a856=_0x5516fb;_0x5da7b7=0xc8;}else{_0x5da7b7=0xce;}_0x37e621['status'](_0x5da7b7);return _0x37e621[_0xb287('0x1e')](_0xb287('0x1f'),_0xe18708+'-'+_0x21a856+'/'+_0x5516fb)[_0xb287('0x19')](_0x361f89);}return null;};}function patchUpdates(_0x353c71){return function(_0x30f3fd){try{jsonpatch[_0xb287('0x20')](_0x30f3fd,_0x353c71,!![]);}catch(_0x355967){return BPromise[_0xb287('0x21')](_0x355967);}return _0x30f3fd[_0xb287('0x22')]();};}function saveUpdates(_0x309923,_0x534a84){return function(_0x31ff70){if(_0x31ff70){return _0x31ff70['update'](_0x309923)[_0xb287('0x23')](function(_0x391a88){return _0x391a88;});}return null;};}function removeEntity(_0x5becaf,_0x14825e){return function(_0x2a2f50){if(_0x2a2f50){return _0x2a2f50['destroy']()[_0xb287('0x23')](function(){_0x5becaf['status'](0xcc)[_0xb287('0x18')]();});}};}function handleEntityNotFound(_0x1a2d1a,_0x542343){return function(_0x3c6cdc){if(!_0x3c6cdc){_0x1a2d1a[_0xb287('0x24')](0x194);}return _0x3c6cdc;};}function handleError(_0x35a4c5,_0x506061){_0x506061=_0x506061||0x1f4;return function(_0x40f70b){logger[_0xb287('0x25')](_0x40f70b[_0xb287('0x26')]);if(_0x40f70b['name']){delete _0x40f70b[_0xb287('0x27')];}_0x35a4c5[_0xb287('0x17')](_0x506061)[_0xb287('0x28')](_0x40f70b);};}exports[_0xb287('0x29')]=function(_0x265c26,_0xb5522d){var _0x1f3319={},_0x31ee85={},_0x288720={'count':0x0,'rows':[]};var _0x36cd03=_['map'](db[_0xb287('0x2a')][_0xb287('0x2b')],function(_0xfab991){return{'name':_0xfab991['fieldName'],'type':_0xfab991[_0xb287('0x2c')]['key']};});_0x31ee85[_0xb287('0x2d')]=_[_0xb287('0x2e')](_0x36cd03,'name');_0x31ee85[_0xb287('0x2f')]=_['keys'](_0x265c26[_0xb287('0x2f')]);_0x31ee85[_0xb287('0x30')]=_[_0xb287('0x31')](_0x31ee85['model'],_0x31ee85[_0xb287('0x2f')]);_0x1f3319[_0xb287('0x32')]=_[_0xb287('0x31')](_0x31ee85['model'],qs[_0xb287('0x33')](_0x265c26[_0xb287('0x2f')][_0xb287('0x33')]));_0x1f3319['attributes']=_0x1f3319[_0xb287('0x32')][_0xb287('0x34')]?_0x1f3319['attributes']:_0x31ee85[_0xb287('0x2d')];if(!_0x265c26['query'][_0xb287('0x35')](_0xb287('0x36'))){_0x1f3319[_0xb287('0x1d')]=qs[_0xb287('0x1d')](_0x265c26['query'][_0xb287('0x1d')]);_0x1f3319['offset']=qs[_0xb287('0x1a')](_0x265c26[_0xb287('0x2f')][_0xb287('0x1a')]);}_0x1f3319['order']=qs['sort'](_0x265c26[_0xb287('0x2f')]['sort']);_0x1f3319['where']=qs[_0xb287('0x30')](_[_0xb287('0x37')](_0x265c26['query'],_0x31ee85['filters']),_0x36cd03);if(_0x265c26[_0xb287('0x2f')]['filter']){_0x1f3319['where']=_[_0xb287('0x38')](_0x1f3319[_0xb287('0x39')],{'$or':_['map'](_0x36cd03,function(_0x22f605){if(_0x22f605[_0xb287('0x2c')]!=='VIRTUAL'){var _0x450303={};_0x450303[_0x22f605['name']]={'$like':'%'+_0x265c26[_0xb287('0x2f')][_0xb287('0x3a')]+'%'};return _0x450303;}})});}_0x1f3319=_[_0xb287('0x38')]({},_0x1f3319,_0x265c26['options']);var _0x182847={'where':_0x1f3319[_0xb287('0x39')]};return db[_0xb287('0x2a')][_0xb287('0x1c')](_0x182847)[_0xb287('0x23')](function(_0x2bf292){_0x288720[_0xb287('0x1c')]=_0x2bf292;if(_0x265c26[_0xb287('0x2f')]['includeAll']){_0x1f3319[_0xb287('0x3b')]=[{'all':!![]}];}return db[_0xb287('0x2a')][_0xb287('0x3c')](_0x1f3319);})['then'](function(_0x391731){_0x288720[_0xb287('0x3d')]=_0x391731;return _0x288720;})[_0xb287('0x23')](respondWithFilteredResult(_0xb5522d,_0x1f3319))['catch'](handleError(_0xb5522d,null));};exports[_0xb287('0x3e')]=function(_0x42a74b,_0x1b837e){var _0x273f39={'raw':![],'where':{'id':_0x42a74b['params']['id']}},_0x3af7e6={};_0x3af7e6['model']=_[_0xb287('0x3f')](db[_0xb287('0x2a')]['rawAttributes']);_0x3af7e6[_0xb287('0x2f')]=_[_0xb287('0x3f')](_0x42a74b[_0xb287('0x2f')]);_0x3af7e6['filters']=_[_0xb287('0x31')](_0x3af7e6[_0xb287('0x2d')],_0x3af7e6['query']);_0x273f39['attributes']=_[_0xb287('0x31')](_0x3af7e6[_0xb287('0x2d')],qs['fields'](_0x42a74b['query']['fields']));_0x273f39[_0xb287('0x32')]=_0x273f39['attributes'][_0xb287('0x34')]?_0x273f39['attributes']:_0x3af7e6[_0xb287('0x2d')];if(_0x42a74b['query'][_0xb287('0x40')]){_0x273f39[_0xb287('0x3b')]=[{'all':!![]}];}_0x273f39=_['merge']({},_0x273f39,_0x42a74b[_0xb287('0x41')]);return db[_0xb287('0x2a')][_0xb287('0x42')](_0x273f39)['then'](handleEntityNotFound(_0x1b837e,null))[_0xb287('0x23')](respondWithResult(_0x1b837e,null))[_0xb287('0x43')](handleError(_0x1b837e,null));};exports[_0xb287('0x44')]=function(_0x3235ad,_0x54b6de){return db[_0xb287('0x2a')][_0xb287('0x44')](_0x3235ad[_0xb287('0x45')],{})['then'](respondWithResult(_0x54b6de,0xc9))[_0xb287('0x43')](handleError(_0x54b6de,null));};exports['update']=function(_0x5e6014,_0xb1171c){if(_0x5e6014[_0xb287('0x45')]['id']){delete _0x5e6014[_0xb287('0x45')]['id'];}return db[_0xb287('0x2a')][_0xb287('0x42')]({'where':{'id':_0x5e6014[_0xb287('0x46')]['id']}})[_0xb287('0x23')](handleEntityNotFound(_0xb1171c,null))[_0xb287('0x23')](saveUpdates(_0x5e6014[_0xb287('0x45')],null))[_0xb287('0x23')](respondWithResult(_0xb1171c,null))[_0xb287('0x43')](handleError(_0xb1171c,null));};exports[_0xb287('0x47')]=function(_0x1592e2,_0x5cab98){return db['ServicenowAccount']['find']({'where':{'id':_0x1592e2[_0xb287('0x46')]['id']}})[_0xb287('0x23')](handleEntityNotFound(_0x5cab98,null))[_0xb287('0x23')](removeEntity(_0x5cab98,null))[_0xb287('0x43')](handleError(_0x5cab98,null));};exports[_0xb287('0x48')]=function(_0x5a772b,_0x2366fd,_0x787b40){var _0x2549d4={};var _0x23d862={};var _0x177881;var _0x1ee507;return db[_0xb287('0x2a')][_0xb287('0x49')]({'where':{'id':_0x5a772b['params']['id']}})[_0xb287('0x23')](handleEntityNotFound(_0x2366fd,null))[_0xb287('0x23')](function(_0x1bf1f1){if(_0x1bf1f1){_0x177881=_0x1bf1f1;_0x23d862[_0xb287('0x2d')]=_['keys'](db['ServicenowConfiguration'][_0xb287('0x2b')]);_0x23d862[_0xb287('0x2f')]=_[_0xb287('0x3f')](_0x5a772b[_0xb287('0x2f')]);_0x23d862['filters']=_['intersection'](_0x23d862[_0xb287('0x2d')],_0x23d862[_0xb287('0x2f')]);_0x2549d4[_0xb287('0x32')]=_[_0xb287('0x31')](_0x23d862[_0xb287('0x2d')],qs[_0xb287('0x33')](_0x5a772b[_0xb287('0x2f')][_0xb287('0x33')]));_0x2549d4[_0xb287('0x32')]=_0x2549d4[_0xb287('0x32')][_0xb287('0x34')]?_0x2549d4[_0xb287('0x32')]:_0x23d862[_0xb287('0x2d')];_0x2549d4[_0xb287('0x4a')]=qs[_0xb287('0x4b')](_0x5a772b[_0xb287('0x2f')][_0xb287('0x4b')]);_0x2549d4['where']=qs[_0xb287('0x30')](_[_0xb287('0x37')](_0x5a772b[_0xb287('0x2f')],_0x23d862[_0xb287('0x30')]));if(_0x5a772b[_0xb287('0x2f')]['filter']){_0x2549d4[_0xb287('0x39')]=_[_0xb287('0x38')](_0x2549d4[_0xb287('0x39')],{'$or':_[_0xb287('0x2e')](_0x2549d4[_0xb287('0x32')],function(_0x31e65f){var _0x49a589={};_0x49a589[_0x31e65f]={'$like':'%'+_0x5a772b[_0xb287('0x2f')][_0xb287('0x3a')]+'%'};return _0x49a589;})});}_0x2549d4=_[_0xb287('0x38')]({},_0x2549d4,_0x5a772b[_0xb287('0x41')]);return _0x177881['getConfigurations'](_0x2549d4);}})['then'](function(_0x559f81){if(_0x559f81){_0x1ee507=_0x559f81[_0xb287('0x34')];if(!_0x5a772b[_0xb287('0x2f')]['hasOwnProperty'](_0xb287('0x36'))){_0x2549d4[_0xb287('0x1d')]=qs[_0xb287('0x1d')](_0x5a772b[_0xb287('0x2f')]['limit']);_0x2549d4[_0xb287('0x1a')]=qs[_0xb287('0x1a')](_0x5a772b['query'][_0xb287('0x1a')]);}return _0x177881[_0xb287('0x48')](_0x2549d4);}})[_0xb287('0x23')](function(_0x2301c7){if(_0x2301c7){return _0x2301c7?{'count':_0x1ee507,'rows':_0x2301c7}:null;}})['then'](respondWithResult(_0x2366fd,null))['catch'](handleError(_0x2366fd,null));};exports[_0xb287('0x4c')]=function(_0x4d67c6,_0x53f29c,_0x889f6e){if(_0x4d67c6['body']['id']){delete _0x4d67c6[_0xb287('0x45')]['id'];}return db[_0xb287('0x2a')]['findOne']({'where':{'id':_0x4d67c6[_0xb287('0x46')]['id']}})[_0xb287('0x23')](handleEntityNotFound(_0x53f29c,null))['then'](function(_0x4d7b43){if(_0x4d7b43){_0x4d67c6['body'][_0xb287('0x4d')]=_0x4d7b43['id'];_0x4d67c6['body'][_0xb287('0x4e')]=integrations[_0xb287('0x4f')](_0x4d67c6[_0xb287('0x45')][_0xb287('0x50')],_0x4d67c6[_0xb287('0x45')][_0xb287('0x2c')]);_0x4d67c6['body'][_0xb287('0x51')]=integrations[_0xb287('0x52')](_0x4d67c6['body'][_0xb287('0x50')],_0x4d67c6[_0xb287('0x45')][_0xb287('0x2c')]);return db[_0xb287('0x53')][_0xb287('0x44')](_0x4d67c6[_0xb287('0x45')],{'include':[{'model':db[_0xb287('0x54')],'as':_0xb287('0x4e')},{'model':db[_0xb287('0x54')],'as':_0xb287('0x51')}]});}return null;})[_0xb287('0x23')](respondWithResult(_0x53f29c,null))[_0xb287('0x43')](handleError(_0x53f29c,null));};exports[_0xb287('0x55')]=function(_0x4f95b8,_0x1fee4c,_0x3748dd){var _0xc80ea4=['made_sla',_0xb287('0x56'),_0xb287('0x57'),_0xb287('0x58'),_0xb287('0x59'),_0xb287('0x5a'),'incident_state',_0xb287('0x5b'),_0xb287('0x5c')];var _0x4f9c40=[_0xb287('0x5d'),_0xb287('0x5e'),_0xb287('0x5f'),_0xb287('0x60'),_0xb287('0x61'),_0xb287('0x62'),_0xb287('0x63'),_0xb287('0x56'),_0xb287('0x64'),_0xb287('0x65'),'resolved_by',_0xb287('0x66'),'opened_by',_0xb287('0x67'),_0xb287('0x68'),'sys_domain',_0xb287('0x69'),'sys_created_by',_0xb287('0x57'),_0xb287('0x4a'),_0xb287('0x6a'),_0xb287('0x6b'),_0xb287('0x6c'),_0xb287('0x6d'),_0xb287('0x6e'),_0xb287('0x6f'),_0xb287('0x70'),_0xb287('0x71'),_0xb287('0x72'),_0xb287('0x73'),_0xb287('0x74'),_0xb287('0x75'),_0xb287('0x76'),_0xb287('0x77'),_0xb287('0x78'),_0xb287('0x79'),'work_end',_0xb287('0x7a'),'resolved_at',_0xb287('0x7b'),_0xb287('0x7c'),_0xb287('0x58'),'work_notes',_0xb287('0x7d'),_0xb287('0x59'),_0xb287('0x7e'),_0xb287('0x7f'),'work_start',_0xb287('0x80'),'business_stc',_0xb287('0x81'),'description',_0xb287('0x82'),_0xb287('0x5a'),_0xb287('0x83'),_0xb287('0x84'),_0xb287('0x85'),_0xb287('0x86'),'parent_incident',_0xb287('0x87'),_0xb287('0x88'),'reopened_by',_0xb287('0x89'),_0xb287('0x8a'),_0xb287('0x8b'),_0xb287('0x8c'),_0xb287('0x8d'),_0xb287('0x8e'),_0xb287('0x8f'),'severity',_0xb287('0x90'),_0xb287('0x91'),_0xb287('0x92'),_0xb287('0x93'),'due_date','sys_mod_count',_0xb287('0x94'),_0xb287('0x95'),_0xb287('0x96'),_0xb287('0x97'),_0xb287('0x98'),_0xb287('0x99'),_0xb287('0x5c')];var _0x515c6e='';var _0x3cca3b='';var _0x46c241=[];var _0x3dbb9b='';var _0x81fbe8='';var _0x289aa3=[];var _0x596e80='';var _0x5e4639='';var _0x4bc37b={};var _0x504ae6='';return db['ServicenowAccount'][_0xb287('0x49')]({'where':{'id':_0x4f95b8[_0xb287('0x46')]['id']},'attributes':['id',_0xb287('0x9a'),_0xb287('0x9b'),'email','remoteUri',_0xb287('0x9c')]})[_0xb287('0x23')](handleEntityNotFound(_0x1fee4c,null))['then'](function(_0x13ffaa){if(_0x13ffaa){_0x504ae6=_0x13ffaa[_0xb287('0x9d')];var _0x37b682=_0x504ae6['slice'](-0x1);if(_0x37b682==='/'){_0x504ae6=_0x504ae6[_0xb287('0x9e')](0x0,_0x504ae6[_0xb287('0x9f')](_0x37b682));}_0x5e4639=util['format'](_0xb287('0xa0'),_0x504ae6);_0x596e80=util[_0xb287('0xa1')](_0xb287('0xa2'),_0x504ae6);_0x4bc37b={'user':_0x13ffaa[_0xb287('0x9a')],'pass':_0x13ffaa[_0xb287('0x9b')]};var _0x4792e2={'method':_0xb287('0xa3'),'uri':_0x5e4639+_0xb287('0xa4'),'auth':_0x4bc37b,'json':!![]};return rp(_0x4792e2);}})[_0xb287('0x23')](function(_0xc90c38){if(_0xc90c38[_0xb287('0xa5')][_0xb287('0x34')]>0x0){_0x515c6e=_0xc90c38['result'];}console['log'](_0xb287('0xa6'),_0x515c6e);_0x289aa3=[];_0x3cca3b=Object['assign']([],_0x515c6e);_[_0xb287('0xa7')](_0x3cca3b,function(_0x5b461b){return!_0xc80ea4[_0xb287('0xa8')](_0x5b461b[_0xb287('0x27')]);});_0x3cca3b['forEach'](function(_0xcd8166){var _0x4d1075=createFieldObject(_0x596e80,_0x4bc37b,_0xcd8166[_0xb287('0xa9')],_0xcd8166[_0xb287('0x27')],_0xcd8166[_0xb287('0xaa')],![]);_0x289aa3[_0xb287('0xab')](_0x4d1075);});return Promise[_0xb287('0xac')](_0x289aa3);})['then'](function(_0x53d2ff){_0x46c241=_0x53d2ff;_0x3dbb9b=Object[_0xb287('0xad')]([],_0x515c6e);console['log'](_0xb287('0xae'),_0x515c6e);_[_0xb287('0xa7')](_0x3dbb9b,function(_0xe3c463){return _0x4f9c40[_0xb287('0xa8')](_0xe3c463[_0xb287('0x27')]);});console[_0xb287('0xaf')](_0xb287('0xb0'),_0x3dbb9b);_0x289aa3=[];_0x3dbb9b[_0xb287('0xb1')](function(_0x5edbb3){var _0x4214b6=createFieldObject(_0x596e80,_0x4bc37b,_0x5edbb3[_0xb287('0xa9')],_0x5edbb3[_0xb287('0x27')],_0x5edbb3['label'],!![]);_0x289aa3['push'](_0x4214b6);});return Promise[_0xb287('0xac')](_0x289aa3);})[_0xb287('0x23')](function(_0x11a820){_0x81fbe8=_0x11a820;var _0x411b8d=_0x46c241[_0xb287('0xb2')](_0x81fbe8);return{'count':_0x411b8d[_0xb287('0x34')],'rows':_0x411b8d};})[_0xb287('0x23')](respondWithResult(_0x1fee4c,null))['catch'](function(_0x2ecb5c){console[_0xb287('0xaf')](_0xb287('0xb3')+_0x2ecb5c);var _0x2a76ab=_0x4f95b8[_0xb287('0x2f')][_0xb287('0xb4')]?0x1f4:_0x2ecb5c['statusCode']||0x1f4;logger[_0xb287('0x25')](_0x2ecb5c[_0xb287('0x26')]);delete _0x2ecb5c[_0xb287('0x27')];if(_0x2a76ab===0x191){_0x2a76ab=0x190;}_0x1fee4c[_0xb287('0x17')](_0x2a76ab)[_0xb287('0x28')](_0x4f95b8[_0xb287('0x2f')]['test']?{'message':_0xb287('0xb5'),'statusCode':_0x2ecb5c[_0xb287('0xb6')]}:_0x2ecb5c);});};function createFieldObject(_0x2df9f5,_0x4b8cf7,_0x1fd021,_0x40b5cf,_0x512532,_0x4a510d){return new Promise(function(_0x5b5ea1,_0x146131){var _0x3a6fa2={'id':_0x40b5cf,'name':_0x512532,'custom':_0x4a510d};if(_0x1fd021===_0xb287('0xb7')){_0x3a6fa2[_0xb287('0x41')]=[{'name':_0xb287('0xb8'),'value':_0xb287('0xb9')},{'name':_0xb287('0xba'),'value':_0xb287('0xbb')}];_0x5b5ea1(_0x3a6fa2);}else{var _0xb45a93={'method':_0xb287('0xa3'),'uri':_0x2df9f5+'sys_choice?sysparm_query=name=incident^element='+_0x40b5cf,'auth':_0x4b8cf7,'json':!![]};return rp(_0xb45a93)['then'](function(_0x2a89ef){var _0x3587ff=[];if(_0x2a89ef[_0xb287('0xa5')][_0xb287('0x34')]>0x0){_0x2a89ef['result']['forEach'](function(_0x35ab53){if(_0x35ab53[_0xb287('0xbc')]===_0xb287('0xbb')){var _0x363445={'name':_0x35ab53[_0xb287('0xaa')],'value':_0x35ab53[_0xb287('0xbd')]};_0x3587ff[_0xb287('0xab')](_0x363445);}});}_0x3a6fa2[_0xb287('0x41')]=_0x3587ff;if(_0x3a6fa2[_0xb287('0x41')][_0xb287('0x34')]>0x0){_0x5b5ea1(_0x3a6fa2);}else{if(_0x4a510d==![]){_0x5b5ea1();}else{_0x5b5ea1(_0x3a6fa2);}}});}});} \ No newline at end of file +var _0xeb90=['close_notes','follow_up','sys_id','contact_type','problem_id','company','reassignment_count','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','username','password','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','internalType','label','push','all','TCL:\x20_object','remove','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','ServiceNow\x20error:\x20','test','statusCode','stack','Wrong\x20credentials','true','False','false','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','map','ServicenowAccount','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','type','ServicenowField','Subjects','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','sys_updated_on','child_incidents','approval_history','number','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','business_service','sys_domain_path','rfc','time_worked','expected_start','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list'];(function(_0x3a218d,_0x340ffa){var _0x23580d=function(_0x2c4dbb){while(--_0x2c4dbb){_0x3a218d['push'](_0x3a218d['shift']());}};_0x23580d(++_0x340ffa);}(_0xeb90,0xe2));var _0x0eb9=function(_0x4da846,_0xd39f6b){_0x4da846=_0x4da846-0x0;var _0x41d5ac=_0xeb90[_0x4da846];return _0x41d5ac;};'use strict';var emlformat=require(_0x0eb9('0x0'));var rimraf=require(_0x0eb9('0x1'));var zipdir=require(_0x0eb9('0x2'));var jsonpatch=require(_0x0eb9('0x3'));var rp=require(_0x0eb9('0x4'));var moment=require(_0x0eb9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0eb9('0x6'));var util=require(_0x0eb9('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0eb9('0x8'));var ejs=require(_0x0eb9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0eb9('0xa'));var squel=require('squel');var crypto=require(_0x0eb9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0eb9('0xc'));var toCsv=require(_0x0eb9('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0eb9('0xd'));var qs=require(_0x0eb9('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0eb9('0xf'));var logger=require(_0x0eb9('0x10'))(_0x0eb9('0x11'));var utils=require('../../config/utils');var config=require(_0x0eb9('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x0eb9('0x13'))['db'];var integrations=require(_0x0eb9('0x14'));function respondWithStatusCode(_0x5a4be9,_0x5eb706){_0x5eb706=_0x5eb706||0xcc;return function(_0x9846b0){if(_0x9846b0){return _0x5a4be9[_0x0eb9('0x15')](_0x5eb706);}return _0x5a4be9[_0x0eb9('0x16')](_0x5eb706)[_0x0eb9('0x17')]();};}function respondWithResult(_0x361864,_0x17a265){_0x17a265=_0x17a265||0xc8;return function(_0xd74521){if(_0xd74521){return _0x361864[_0x0eb9('0x16')](_0x17a265)[_0x0eb9('0x18')](_0xd74521);}};}function respondWithFilteredResult(_0x80d5ae,_0x34bbed){return function(_0x24fb81){if(_0x24fb81){var _0x141a89=typeof _0x34bbed[_0x0eb9('0x19')]===_0x0eb9('0x1a')&&typeof _0x34bbed[_0x0eb9('0x1b')]==='undefined';var _0x1400a3=_0x24fb81[_0x0eb9('0x1c')];var _0xdd7add=_0x141a89?0x0:_0x34bbed[_0x0eb9('0x19')];var _0x4f3603=_0x141a89?_0x24fb81['count']:_0x34bbed[_0x0eb9('0x19')]+_0x34bbed[_0x0eb9('0x1b')];var _0x5c42c0;if(_0x4f3603>=_0x1400a3){_0x4f3603=_0x1400a3;_0x5c42c0=0xc8;}else{_0x5c42c0=0xce;}_0x80d5ae[_0x0eb9('0x16')](_0x5c42c0);return _0x80d5ae[_0x0eb9('0x1d')]('Content-Range',_0xdd7add+'-'+_0x4f3603+'/'+_0x1400a3)[_0x0eb9('0x18')](_0x24fb81);}return null;};}function patchUpdates(_0x3f075c){return function(_0x4ca348){try{jsonpatch[_0x0eb9('0x1e')](_0x4ca348,_0x3f075c,!![]);}catch(_0xce67b){return BPromise[_0x0eb9('0x1f')](_0xce67b);}return _0x4ca348['save']();};}function saveUpdates(_0xd379db,_0x5714b8){return function(_0x345b07){if(_0x345b07){return _0x345b07['update'](_0xd379db)[_0x0eb9('0x20')](function(_0x5d9053){return _0x5d9053;});}return null;};}function removeEntity(_0xaf99ac,_0x76c1e9){return function(_0x1e90e9){if(_0x1e90e9){return _0x1e90e9[_0x0eb9('0x21')]()[_0x0eb9('0x20')](function(){_0xaf99ac[_0x0eb9('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x95a994,_0x446b0f){return function(_0x34da14){if(!_0x34da14){_0x95a994[_0x0eb9('0x15')](0x194);}return _0x34da14;};}function handleError(_0x2fd228,_0x1e8612){_0x1e8612=_0x1e8612||0x1f4;return function(_0x2c9c65){logger[_0x0eb9('0x22')](_0x2c9c65['stack']);if(_0x2c9c65[_0x0eb9('0x23')]){delete _0x2c9c65[_0x0eb9('0x23')];}_0x2fd228[_0x0eb9('0x16')](_0x1e8612)[_0x0eb9('0x24')](_0x2c9c65);};}exports['index']=function(_0xe520cf,_0x1d6845){var _0x4042ea={},_0x1f9522={},_0x4306c2={'count':0x0,'rows':[]};var _0x5ebb9a=_[_0x0eb9('0x25')](db[_0x0eb9('0x26')][_0x0eb9('0x27')],function(_0xd24341){return{'name':_0xd24341[_0x0eb9('0x28')],'type':_0xd24341['type'][_0x0eb9('0x29')]};});_0x1f9522['model']=_[_0x0eb9('0x25')](_0x5ebb9a,_0x0eb9('0x23'));_0x1f9522[_0x0eb9('0x2a')]=_[_0x0eb9('0x2b')](_0xe520cf['query']);_0x1f9522['filters']=_[_0x0eb9('0x2c')](_0x1f9522[_0x0eb9('0x2d')],_0x1f9522[_0x0eb9('0x2a')]);_0x4042ea[_0x0eb9('0x2e')]=_[_0x0eb9('0x2c')](_0x1f9522[_0x0eb9('0x2d')],qs['fields'](_0xe520cf[_0x0eb9('0x2a')][_0x0eb9('0x2f')]));_0x4042ea[_0x0eb9('0x2e')]=_0x4042ea['attributes'][_0x0eb9('0x30')]?_0x4042ea[_0x0eb9('0x2e')]:_0x1f9522[_0x0eb9('0x2d')];if(!_0xe520cf['query']['hasOwnProperty'](_0x0eb9('0x31'))){_0x4042ea['limit']=qs[_0x0eb9('0x1b')](_0xe520cf[_0x0eb9('0x2a')][_0x0eb9('0x1b')]);_0x4042ea[_0x0eb9('0x19')]=qs[_0x0eb9('0x19')](_0xe520cf[_0x0eb9('0x2a')]['offset']);}_0x4042ea[_0x0eb9('0x32')]=qs[_0x0eb9('0x33')](_0xe520cf[_0x0eb9('0x2a')][_0x0eb9('0x33')]);_0x4042ea[_0x0eb9('0x34')]=qs[_0x0eb9('0x35')](_[_0x0eb9('0x36')](_0xe520cf[_0x0eb9('0x2a')],_0x1f9522['filters']),_0x5ebb9a);if(_0xe520cf[_0x0eb9('0x2a')][_0x0eb9('0x37')]){_0x4042ea[_0x0eb9('0x34')]=_['merge'](_0x4042ea[_0x0eb9('0x34')],{'$or':_['map'](_0x5ebb9a,function(_0x15b9aa){if(_0x15b9aa['type']!==_0x0eb9('0x38')){var _0x3fa0f1={};_0x3fa0f1[_0x15b9aa[_0x0eb9('0x23')]]={'$like':'%'+_0xe520cf[_0x0eb9('0x2a')][_0x0eb9('0x37')]+'%'};return _0x3fa0f1;}})});}_0x4042ea=_[_0x0eb9('0x39')]({},_0x4042ea,_0xe520cf[_0x0eb9('0x3a')]);var _0x55a865={'where':_0x4042ea['where']};return db['ServicenowAccount'][_0x0eb9('0x1c')](_0x55a865)[_0x0eb9('0x20')](function(_0x130bdf){_0x4306c2[_0x0eb9('0x1c')]=_0x130bdf;if(_0xe520cf['query'][_0x0eb9('0x3b')]){_0x4042ea['include']=[{'all':!![]}];}return db[_0x0eb9('0x26')][_0x0eb9('0x3c')](_0x4042ea);})[_0x0eb9('0x20')](function(_0x4fbde9){_0x4306c2[_0x0eb9('0x3d')]=_0x4fbde9;return _0x4306c2;})[_0x0eb9('0x20')](respondWithFilteredResult(_0x1d6845,_0x4042ea))[_0x0eb9('0x3e')](handleError(_0x1d6845,null));};exports[_0x0eb9('0x3f')]=function(_0x5665f1,_0x2367bd){var _0x193c54={'raw':![],'where':{'id':_0x5665f1['params']['id']}},_0x375282={};_0x375282[_0x0eb9('0x2d')]=_[_0x0eb9('0x2b')](db[_0x0eb9('0x26')]['rawAttributes']);_0x375282[_0x0eb9('0x2a')]=_[_0x0eb9('0x2b')](_0x5665f1['query']);_0x375282[_0x0eb9('0x35')]=_[_0x0eb9('0x2c')](_0x375282['model'],_0x375282[_0x0eb9('0x2a')]);_0x193c54[_0x0eb9('0x2e')]=_['intersection'](_0x375282['model'],qs['fields'](_0x5665f1[_0x0eb9('0x2a')][_0x0eb9('0x2f')]));_0x193c54[_0x0eb9('0x2e')]=_0x193c54['attributes']['length']?_0x193c54[_0x0eb9('0x2e')]:_0x375282[_0x0eb9('0x2d')];if(_0x5665f1[_0x0eb9('0x2a')][_0x0eb9('0x3b')]){_0x193c54[_0x0eb9('0x40')]=[{'all':!![]}];}_0x193c54=_[_0x0eb9('0x39')]({},_0x193c54,_0x5665f1[_0x0eb9('0x3a')]);return db[_0x0eb9('0x26')][_0x0eb9('0x41')](_0x193c54)[_0x0eb9('0x20')](handleEntityNotFound(_0x2367bd,null))['then'](respondWithResult(_0x2367bd,null))[_0x0eb9('0x3e')](handleError(_0x2367bd,null));};exports[_0x0eb9('0x42')]=function(_0x42537b,_0x2231c3){return db[_0x0eb9('0x26')][_0x0eb9('0x42')](_0x42537b[_0x0eb9('0x43')],{})[_0x0eb9('0x20')](respondWithResult(_0x2231c3,0xc9))[_0x0eb9('0x3e')](handleError(_0x2231c3,null));};exports['update']=function(_0x5199fa,_0xa5251){if(_0x5199fa['body']['id']){delete _0x5199fa['body']['id'];}return db[_0x0eb9('0x26')]['find']({'where':{'id':_0x5199fa[_0x0eb9('0x44')]['id']}})[_0x0eb9('0x20')](handleEntityNotFound(_0xa5251,null))['then'](saveUpdates(_0x5199fa[_0x0eb9('0x43')],null))['then'](respondWithResult(_0xa5251,null))[_0x0eb9('0x3e')](handleError(_0xa5251,null));};exports['destroy']=function(_0x2297bf,_0x5aeadb){return db[_0x0eb9('0x26')]['find']({'where':{'id':_0x2297bf['params']['id']}})[_0x0eb9('0x20')](handleEntityNotFound(_0x5aeadb,null))['then'](removeEntity(_0x5aeadb,null))[_0x0eb9('0x3e')](handleError(_0x5aeadb,null));};exports[_0x0eb9('0x45')]=function(_0x3b18a5,_0x81e957,_0x45e68d){var _0x43ca8a={};var _0x12733e={};var _0x1ea65c;var _0x15780e;return db['ServicenowAccount'][_0x0eb9('0x46')]({'where':{'id':_0x3b18a5[_0x0eb9('0x44')]['id']}})[_0x0eb9('0x20')](handleEntityNotFound(_0x81e957,null))[_0x0eb9('0x20')](function(_0x22db7f){if(_0x22db7f){_0x1ea65c=_0x22db7f;_0x12733e[_0x0eb9('0x2d')]=_[_0x0eb9('0x2b')](db[_0x0eb9('0x47')][_0x0eb9('0x27')]);_0x12733e[_0x0eb9('0x2a')]=_[_0x0eb9('0x2b')](_0x3b18a5[_0x0eb9('0x2a')]);_0x12733e[_0x0eb9('0x35')]=_['intersection'](_0x12733e[_0x0eb9('0x2d')],_0x12733e[_0x0eb9('0x2a')]);_0x43ca8a[_0x0eb9('0x2e')]=_[_0x0eb9('0x2c')](_0x12733e['model'],qs[_0x0eb9('0x2f')](_0x3b18a5[_0x0eb9('0x2a')]['fields']));_0x43ca8a[_0x0eb9('0x2e')]=_0x43ca8a[_0x0eb9('0x2e')][_0x0eb9('0x30')]?_0x43ca8a['attributes']:_0x12733e[_0x0eb9('0x2d')];_0x43ca8a['order']=qs[_0x0eb9('0x33')](_0x3b18a5[_0x0eb9('0x2a')][_0x0eb9('0x33')]);_0x43ca8a[_0x0eb9('0x34')]=qs[_0x0eb9('0x35')](_[_0x0eb9('0x36')](_0x3b18a5[_0x0eb9('0x2a')],_0x12733e[_0x0eb9('0x35')]));if(_0x3b18a5[_0x0eb9('0x2a')]['filter']){_0x43ca8a[_0x0eb9('0x34')]=_[_0x0eb9('0x39')](_0x43ca8a[_0x0eb9('0x34')],{'$or':_[_0x0eb9('0x25')](_0x43ca8a[_0x0eb9('0x2e')],function(_0x539665){var _0x4cc520={};_0x4cc520[_0x539665]={'$like':'%'+_0x3b18a5[_0x0eb9('0x2a')][_0x0eb9('0x37')]+'%'};return _0x4cc520;})});}_0x43ca8a=_['merge']({},_0x43ca8a,_0x3b18a5[_0x0eb9('0x3a')]);return _0x1ea65c[_0x0eb9('0x45')](_0x43ca8a);}})[_0x0eb9('0x20')](function(_0x11d212){if(_0x11d212){_0x15780e=_0x11d212[_0x0eb9('0x30')];if(!_0x3b18a5['query'][_0x0eb9('0x48')]('nolimit')){_0x43ca8a['limit']=qs[_0x0eb9('0x1b')](_0x3b18a5[_0x0eb9('0x2a')][_0x0eb9('0x1b')]);_0x43ca8a[_0x0eb9('0x19')]=qs[_0x0eb9('0x19')](_0x3b18a5[_0x0eb9('0x2a')][_0x0eb9('0x19')]);}return _0x1ea65c['getConfigurations'](_0x43ca8a);}})[_0x0eb9('0x20')](function(_0x2cb3ae){if(_0x2cb3ae){return _0x2cb3ae?{'count':_0x15780e,'rows':_0x2cb3ae}:null;}})['then'](respondWithResult(_0x81e957,null))['catch'](handleError(_0x81e957,null));};exports[_0x0eb9('0x49')]=function(_0x42b005,_0xc4d637,_0x296f0e){if(_0x42b005[_0x0eb9('0x43')]['id']){delete _0x42b005['body']['id'];}return db[_0x0eb9('0x26')][_0x0eb9('0x46')]({'where':{'id':_0x42b005[_0x0eb9('0x44')]['id']}})[_0x0eb9('0x20')](handleEntityNotFound(_0xc4d637,null))[_0x0eb9('0x20')](function(_0x28e31c){if(_0x28e31c){_0x42b005[_0x0eb9('0x43')][_0x0eb9('0x4a')]=_0x28e31c['id'];_0x42b005['body']['Subjects']=integrations[_0x0eb9('0x4b')](_0x42b005[_0x0eb9('0x43')][_0x0eb9('0x4c')],_0x42b005[_0x0eb9('0x43')][_0x0eb9('0x4d')]);_0x42b005[_0x0eb9('0x43')]['Descriptions']=integrations['getDescriptions'](_0x42b005[_0x0eb9('0x43')]['channel'],_0x42b005[_0x0eb9('0x43')][_0x0eb9('0x4d')]);return db[_0x0eb9('0x47')][_0x0eb9('0x42')](_0x42b005['body'],{'include':[{'model':db[_0x0eb9('0x4e')],'as':_0x0eb9('0x4f')},{'model':db[_0x0eb9('0x4e')],'as':'Descriptions'}]});}return null;})[_0x0eb9('0x20')](respondWithResult(_0xc4d637,null))[_0x0eb9('0x3e')](handleError(_0xc4d637,null));};exports['getFields']=function(_0x45cbbe,_0x301a1c,_0x275ece){var _0x39fa60=[_0x0eb9('0x50'),_0x0eb9('0x51'),_0x0eb9('0x52'),_0x0eb9('0x53'),_0x0eb9('0x54'),_0x0eb9('0x55'),_0x0eb9('0x56'),_0x0eb9('0x57'),_0x0eb9('0x58')];var _0x6b0789=[_0x0eb9('0x59'),_0x0eb9('0x50'),_0x0eb9('0x5a'),'watch_list','upon_reject',_0x0eb9('0x5b'),_0x0eb9('0x5c'),'hold_reason',_0x0eb9('0x5d'),_0x0eb9('0x5e'),'resolved_by','sys_updated_by',_0x0eb9('0x5f'),_0x0eb9('0x60'),_0x0eb9('0x61'),_0x0eb9('0x62'),_0x0eb9('0x63'),_0x0eb9('0x64'),_0x0eb9('0x52'),'order',_0x0eb9('0x65'),_0x0eb9('0x66'),'cmdb_ci',_0x0eb9('0x67'),_0x0eb9('0x68'),_0x0eb9('0x69'),'work_notes_list',_0x0eb9('0x6a'),'priority',_0x0eb9('0x6b'),_0x0eb9('0x6c'),_0x0eb9('0x6d'),_0x0eb9('0x6e'),'opened_at',_0x0eb9('0x6f'),'group_list',_0x0eb9('0x70'),_0x0eb9('0x71'),_0x0eb9('0x72'),_0x0eb9('0x73'),_0x0eb9('0x74'),_0x0eb9('0x53'),_0x0eb9('0x75'),_0x0eb9('0x76'),'close_code',_0x0eb9('0x77'),'delivery_task',_0x0eb9('0x78'),_0x0eb9('0x79'),_0x0eb9('0x7a'),_0x0eb9('0x7b'),'description','calendar_duration',_0x0eb9('0x55'),'sys_class_name',_0x0eb9('0x7c'),'closed_by',_0x0eb9('0x7d'),'parent_incident',_0x0eb9('0x7e'),_0x0eb9('0x7f'),'reopened_by','incident_state','urgency',_0x0eb9('0x80'),_0x0eb9('0x81'),_0x0eb9('0x82'),'activity_due',_0x0eb9('0x83'),_0x0eb9('0x57'),_0x0eb9('0x84'),_0x0eb9('0x85'),_0x0eb9('0x86'),_0x0eb9('0x87'),_0x0eb9('0x88'),_0x0eb9('0x89'),_0x0eb9('0x8a'),_0x0eb9('0x8b'),'escalation',_0x0eb9('0x8c'),_0x0eb9('0x8d'),'location',_0x0eb9('0x58')];var _0x4987fd='';var _0x216601='';var _0x30e38a=[];var _0x5b8e7f='';var _0x4e6ec4='';var _0x154477=[];var _0x3d57a8='';var _0x411024='';var _0x5f5bd1={};var _0xe577e1='';return db[_0x0eb9('0x26')][_0x0eb9('0x46')]({'where':{'id':_0x45cbbe[_0x0eb9('0x44')]['id']},'attributes':['id',_0x0eb9('0x8e'),_0x0eb9('0x8f'),'email',_0x0eb9('0x90'),'serverUrl']})[_0x0eb9('0x20')](handleEntityNotFound(_0x301a1c,null))[_0x0eb9('0x20')](function(_0x5074f1){if(_0x5074f1){_0xe577e1=_0x5074f1[_0x0eb9('0x90')];var _0x122d0c=_0xe577e1[_0x0eb9('0x91')](-0x1);if(_0x122d0c==='/'){_0xe577e1=_0xe577e1[_0x0eb9('0x92')](0x0,_0xe577e1[_0x0eb9('0x93')](_0x122d0c));}_0x411024=util[_0x0eb9('0x94')]('%s/api/now/doc/table/schema/',_0xe577e1);_0x3d57a8=util[_0x0eb9('0x94')](_0x0eb9('0x95'),_0xe577e1);_0x5f5bd1={'user':_0x5074f1[_0x0eb9('0x8e')],'pass':_0x5074f1['password']};var _0x400651={'method':_0x0eb9('0x96'),'uri':_0x411024+_0x0eb9('0x97'),'auth':_0x5f5bd1,'json':!![]};return rp(_0x400651);}})[_0x0eb9('0x20')](function(_0x4a882c){if(_0x4a882c[_0x0eb9('0x98')][_0x0eb9('0x30')]>0x0){_0x4987fd=_0x4a882c[_0x0eb9('0x98')];}console[_0x0eb9('0x99')](_0x0eb9('0x9a'),_0x4987fd);_0x154477=[];_0x216601=Object[_0x0eb9('0x9b')]([],_0x4987fd);_['remove'](_0x216601,function(_0x46dcd7){return!_0x39fa60['includes'](_0x46dcd7[_0x0eb9('0x23')]);});_0x216601['forEach'](function(_0x9b0065){var _0x3bbb64=createFieldObject(_0x3d57a8,_0x5f5bd1,_0x9b0065[_0x0eb9('0x9c')],_0x9b0065[_0x0eb9('0x23')],_0x9b0065[_0x0eb9('0x9d')],![]);_0x154477[_0x0eb9('0x9e')](_0x3bbb64);});return Promise[_0x0eb9('0x9f')](_0x154477);})[_0x0eb9('0x20')](function(_0x3ed734){_0x30e38a=_0x3ed734;_0x5b8e7f=Object[_0x0eb9('0x9b')]([],_0x4987fd);console['log'](_0x0eb9('0xa0'),_0x4987fd);_[_0x0eb9('0xa1')](_0x5b8e7f,function(_0x151eb0){return _0x6b0789[_0x0eb9('0xa2')](_0x151eb0[_0x0eb9('0x23')]);});console['log'](_0x0eb9('0xa3'),_0x5b8e7f);_0x154477=[];_0x5b8e7f[_0x0eb9('0xa4')](function(_0x48d0fd){var _0x50574d=createFieldObject(_0x3d57a8,_0x5f5bd1,_0x48d0fd[_0x0eb9('0x9c')],_0x48d0fd[_0x0eb9('0x23')],_0x48d0fd['label'],!![]);_0x154477[_0x0eb9('0x9e')](_0x50574d);});return Promise[_0x0eb9('0x9f')](_0x154477);})[_0x0eb9('0x20')](function(_0x3a74bf){_0x4e6ec4=_0x3a74bf;var _0x48f2db=_0x30e38a['concat'](_0x4e6ec4);return{'count':_0x48f2db[_0x0eb9('0x30')],'rows':_0x48f2db};})['then'](respondWithResult(_0x301a1c,null))[_0x0eb9('0x3e')](function(_0x3623b5){console['log'](_0x0eb9('0xa5')+_0x3623b5);var _0x1c7918=_0x45cbbe[_0x0eb9('0x2a')][_0x0eb9('0xa6')]?0x1f4:_0x3623b5[_0x0eb9('0xa7')]||0x1f4;logger[_0x0eb9('0x22')](_0x3623b5[_0x0eb9('0xa8')]);delete _0x3623b5[_0x0eb9('0x23')];if(_0x1c7918===0x191){_0x1c7918=0x190;}_0x301a1c[_0x0eb9('0x16')](_0x1c7918)[_0x0eb9('0x24')](_0x45cbbe[_0x0eb9('0x2a')][_0x0eb9('0xa6')]?{'message':_0x0eb9('0xa9'),'statusCode':_0x3623b5[_0x0eb9('0xa7')]}:_0x3623b5);});};function createFieldObject(_0x246e17,_0x355667,_0x352872,_0x2cb731,_0x25ef48,_0x370a4f){return new Promise(function(_0x11ae87,_0x3c70bb){var _0x3385ce={'id':_0x2cb731,'name':_0x25ef48,'custom':_0x370a4f};if(_0x352872==='boolean'){_0x3385ce[_0x0eb9('0x3a')]=[{'name':'True','value':_0x0eb9('0xaa')},{'name':_0x0eb9('0xab'),'value':_0x0eb9('0xac')}];_0x11ae87(_0x3385ce);}else{var _0x431e6d={'method':_0x0eb9('0x96'),'uri':_0x246e17+'sys_choice?sysparm_query=name=incident^element='+_0x2cb731,'auth':_0x355667,'json':!![]};return rp(_0x431e6d)[_0x0eb9('0x20')](function(_0x4e7961){var _0x1134ac=[];if(_0x4e7961[_0x0eb9('0x98')]['length']>0x0){_0x4e7961[_0x0eb9('0x98')][_0x0eb9('0xa4')](function(_0x3a4075){if(_0x3a4075[_0x0eb9('0xad')]==='false'){var _0x171e09={'name':_0x3a4075[_0x0eb9('0x9d')],'value':_0x3a4075[_0x0eb9('0xae')]};_0x1134ac[_0x0eb9('0x9e')](_0x171e09);}});}_0x3385ce[_0x0eb9('0x3a')]=_0x1134ac;if(_0x3385ce[_0x0eb9('0x3a')][_0x0eb9('0x30')]>0x0){_0x11ae87(_0x3385ce);}else{if(_0x370a4f==![]){_0x11ae87();}else{_0x11ae87(_0x3385ce);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 863a08e..9a704e8 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 _0xbd51=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5f583d,_0x208fa0){var _0x365c60=function(_0x25b389){while(--_0x25b389){_0x5f583d['push'](_0x5f583d['shift']());}};_0x365c60(++_0x208fa0);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x5ddd17,_0x4b73ab){_0x5ddd17=_0x5ddd17-0x0;var _0x8335a8=_0xbd51[_0x5ddd17];return _0x8335a8;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));var integrations=require(_0x1bd5('0x6'));module[_0x1bd5('0x7')]=function(_0x59ddfb,_0x29abea){return _0x59ddfb[_0x1bd5('0x8')](_0x1bd5('0x9'),attributes,{'tableName':_0x1bd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeff8=['rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','int_servicenow_accounts','lodash','util','api','moment','bluebird','path'];(function(_0x14ed2c,_0x2931af){var _0x3e2b64=function(_0x2d0b73){while(--_0x2d0b73){_0x14ed2c['push'](_0x14ed2c['shift']());}};_0x3e2b64(++_0x2931af);}(_0xeff8,0x186));var _0x8eff=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xeff8[_0x55abd9];return _0x3e5669;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8eff('0x9')]=function(_0xb54063,_0x3409bc){return _0xb54063[_0x8eff('0xa')]('ServicenowAccount',attributes,{'tableName':_0x8eff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 91d305e..0895425 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 _0x1469=['ServicenowAccount','findAll','options','raw','where','include','model','attributes','map','debug','ShowServicenowAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetServicenowAccount'];(function(_0x5bfe22,_0x1a397a){var _0x51002f=function(_0x48b7eb){while(--_0x48b7eb){_0x5bfe22['push'](_0x5bfe22['shift']());}};_0x51002f(++_0x1a397a);}(_0x1469,0x16a));var _0x9146=function(_0x4ec1aa,_0x157f94){_0x4ec1aa=_0x4ec1aa-0x0;var _0x491788=_0x1469[_0x4ec1aa];return _0x491788;};'use strict';var _=require(_0x9146('0x0'));var util=require(_0x9146('0x1'));var moment=require(_0x9146('0x2'));var BPromise=require(_0x9146('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9146('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9146('0x5'));var logger=require(_0x9146('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9146('0x7'));var client=jayson[_0x9146('0x8')][_0x9146('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31400e,_0x1b905b,_0x5d4735){return new BPromise(function(_0xceeb50,_0x49e3c2){return client[_0x9146('0xa')](_0x31400e,_0x5d4735)[_0x9146('0xb')](function(_0x31babc){logger[_0x9146('0xc')](_0x9146('0xd'),_0x1b905b,'request\x20sent');logger['debug'](_0x9146('0xe'),_0x1b905b,_0x9146('0xf'),JSON[_0x9146('0x10')](_0x31babc));if(_0x31babc[_0x9146('0x11')]){if(_0x31babc['error'][_0x9146('0x12')]===0x1f4){logger[_0x9146('0x11')](_0x9146('0xd'),_0x1b905b,_0x31babc['error'][_0x9146('0x13')]);return _0x49e3c2(_0x31babc[_0x9146('0x11')][_0x9146('0x13')]);}logger[_0x9146('0x11')](_0x9146('0xd'),_0x1b905b,_0x31babc[_0x9146('0x11')][_0x9146('0x13')]);return _0xceeb50(_0x31babc['error'][_0x9146('0x13')]);}else{logger[_0x9146('0xc')](_0x9146('0xd'),_0x1b905b,_0x9146('0xf'));_0xceeb50(_0x31babc[_0x9146('0x14')][_0x9146('0x13')]);}})[_0x9146('0x15')](function(_0x3d0da5){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1b905b,_0x3d0da5);_0x49e3c2(_0x3d0da5);});});}exports[_0x9146('0x16')]=function(_0x562dea){var _0x1be622=this;return new Promise(function(_0x4d96c0,_0x3a77d3){return db[_0x9146('0x17')][_0x9146('0x18')]({'raw':_0x562dea[_0x9146('0x19')]?_0x562dea[_0x9146('0x19')][_0x9146('0x1a')]===undefined?!![]:![]:!![],'where':_0x562dea[_0x9146('0x19')]?_0x562dea[_0x9146('0x19')][_0x9146('0x1b')]||null:null,'attributes':_0x562dea['options']?_0x562dea[_0x9146('0x19')]['attributes']||null:null,'limit':_0x562dea[_0x9146('0x19')]?_0x562dea['options']['limit']||null:null,'include':_0x562dea[_0x9146('0x19')]?_0x562dea[_0x9146('0x19')][_0x9146('0x1c')]?_['map'](_0x562dea['options']['include'],function(_0x41030d){return{'model':db[_0x41030d[_0x9146('0x1d')]],'as':_0x41030d['as'],'attributes':_0x41030d[_0x9146('0x1e')],'include':_0x41030d[_0x9146('0x1c')]?_['map'](_0x41030d[_0x9146('0x1c')],function(_0x2b18f4){return{'model':db[_0x2b18f4[_0x9146('0x1d')]],'as':_0x2b18f4['as'],'attributes':_0x2b18f4[_0x9146('0x1e')],'include':_0x2b18f4['include']?_[_0x9146('0x1f')](_0x2b18f4[_0x9146('0x1c')],function(_0x4dbace){return{'model':db[_0x4dbace[_0x9146('0x1d')]],'as':_0x4dbace['as'],'attributes':_0x4dbace[_0x9146('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f9aaa){logger[_0x9146('0xc')](_0x9146('0x16'),_0x562dea);logger[_0x9146('0x20')](_0x9146('0x16'),_0x562dea,JSON[_0x9146('0x10')](_0x3f9aaa));_0x4d96c0(_0x3f9aaa);})[_0x9146('0x15')](function(_0x126379){logger[_0x9146('0x11')](_0x9146('0x16'),_0x126379[_0x9146('0x13')],_0x562dea);_0x3a77d3(_0x1be622[_0x9146('0x11')](0x1f4,_0x126379[_0x9146('0x13')]));});});};exports[_0x9146('0x21')]=function(_0x41e68d){var _0x50e983=this;return new Promise(function(_0x1fafaf,_0xd57ef){return db[_0x9146('0x17')][_0x9146('0x22')]({'raw':_0x41e68d[_0x9146('0x19')]?_0x41e68d[_0x9146('0x19')][_0x9146('0x1a')]===undefined?!![]:![]:!![],'where':_0x41e68d[_0x9146('0x19')]?_0x41e68d[_0x9146('0x19')][_0x9146('0x1b')]||null:null,'attributes':_0x41e68d[_0x9146('0x19')]?_0x41e68d['options'][_0x9146('0x1e')]||null:null,'include':_0x41e68d[_0x9146('0x19')]?_0x41e68d[_0x9146('0x19')][_0x9146('0x1c')]?_[_0x9146('0x1f')](_0x41e68d[_0x9146('0x19')][_0x9146('0x1c')],function(_0x4a4f13){return{'model':db[_0x4a4f13[_0x9146('0x1d')]],'as':_0x4a4f13['as'],'attributes':_0x4a4f13[_0x9146('0x1e')],'include':_0x4a4f13[_0x9146('0x1c')]?_['map'](_0x4a4f13[_0x9146('0x1c')],function(_0xb0d751){return{'model':db[_0xb0d751[_0x9146('0x1d')]],'as':_0xb0d751['as'],'attributes':_0xb0d751[_0x9146('0x1e')],'include':_0xb0d751[_0x9146('0x1c')]?_[_0x9146('0x1f')](_0xb0d751['include'],function(_0x1cc134){return{'model':db[_0x1cc134[_0x9146('0x1d')]],'as':_0x1cc134['as'],'attributes':_0x1cc134[_0x9146('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9146('0xb')](function(_0x4b0741){logger[_0x9146('0xc')](_0x9146('0x21'),_0x41e68d);logger[_0x9146('0x20')](_0x9146('0x21'),_0x41e68d,JSON[_0x9146('0x10')](_0x4b0741));_0x1fafaf(_0x4b0741);})[_0x9146('0x15')](function(_0x2693ae){logger['error'](_0x9146('0x21'),_0x2693ae[_0x9146('0x13')],_0x41e68d);_0xd57ef(_0x50e983['error'](0x1f4,_0x2693ae[_0x9146('0x13')]));});});}; \ No newline at end of file +var _0xb3ee=['ServicenowAccount','findAll','options','raw','attributes','limit','include','map','then','debug','ShowServicenowAccount','find','where','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetServicenowAccount'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb3ee,0x18f));var _0xeb3e=function(_0x363118,_0x21ffa7){_0x363118=_0x363118-0x0;var _0x138773=_0xb3ee[_0x363118];return _0x138773;};'use strict';var _=require('lodash');var util=require(_0xeb3e('0x0'));var moment=require(_0xeb3e('0x1'));var BPromise=require(_0xeb3e('0x2'));var rs=require(_0xeb3e('0x3'));var fs=require('fs');var Redis=require(_0xeb3e('0x4'));var db=require(_0xeb3e('0x5'))['db'];var utils=require(_0xeb3e('0x6'));var logger=require(_0xeb3e('0x7'))(_0xeb3e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeb3e('0x9')][_0xeb3e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44d7f1,_0x53ae4c,_0x4e0f61){return new BPromise(function(_0x5599b3,_0x12e6f4){return client['request'](_0x44d7f1,_0x4e0f61)['then'](function(_0x3b42b8){logger[_0xeb3e('0xb')](_0xeb3e('0xc'),_0x53ae4c,_0xeb3e('0xd'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x53ae4c,_0xeb3e('0xd'),JSON[_0xeb3e('0xe')](_0x3b42b8));if(_0x3b42b8['error']){if(_0x3b42b8[_0xeb3e('0xf')][_0xeb3e('0x10')]===0x1f4){logger[_0xeb3e('0xf')](_0xeb3e('0xc'),_0x53ae4c,_0x3b42b8[_0xeb3e('0xf')]['message']);return _0x12e6f4(_0x3b42b8[_0xeb3e('0xf')]['message']);}logger[_0xeb3e('0xf')](_0xeb3e('0xc'),_0x53ae4c,_0x3b42b8[_0xeb3e('0xf')][_0xeb3e('0x11')]);return _0x5599b3(_0x3b42b8['error']['message']);}else{logger['info'](_0xeb3e('0xc'),_0x53ae4c,_0xeb3e('0xd'));_0x5599b3(_0x3b42b8[_0xeb3e('0x12')][_0xeb3e('0x11')]);}})[_0xeb3e('0x13')](function(_0x195cec){logger[_0xeb3e('0xf')](_0xeb3e('0xc'),_0x53ae4c,_0x195cec);_0x12e6f4(_0x195cec);});});}exports[_0xeb3e('0x14')]=function(_0x21db15){var _0x36d61c=this;return new Promise(function(_0x6bf386,_0x18c561){return db[_0xeb3e('0x15')][_0xeb3e('0x16')]({'raw':_0x21db15['options']?_0x21db15[_0xeb3e('0x17')][_0xeb3e('0x18')]===undefined?!![]:![]:!![],'where':_0x21db15[_0xeb3e('0x17')]?_0x21db15['options']['where']||null:null,'attributes':_0x21db15['options']?_0x21db15[_0xeb3e('0x17')][_0xeb3e('0x19')]||null:null,'limit':_0x21db15['options']?_0x21db15['options'][_0xeb3e('0x1a')]||null:null,'include':_0x21db15[_0xeb3e('0x17')]?_0x21db15['options'][_0xeb3e('0x1b')]?_['map'](_0x21db15['options']['include'],function(_0x20bafa){return{'model':db[_0x20bafa['model']],'as':_0x20bafa['as'],'attributes':_0x20bafa[_0xeb3e('0x19')],'include':_0x20bafa[_0xeb3e('0x1b')]?_[_0xeb3e('0x1c')](_0x20bafa[_0xeb3e('0x1b')],function(_0x2da7b3){return{'model':db[_0x2da7b3['model']],'as':_0x2da7b3['as'],'attributes':_0x2da7b3['attributes'],'include':_0x2da7b3['include']?_[_0xeb3e('0x1c')](_0x2da7b3[_0xeb3e('0x1b')],function(_0x5444ef){return{'model':db[_0x5444ef['model']],'as':_0x5444ef['as'],'attributes':_0x5444ef[_0xeb3e('0x19')]};}):[]};}):[]};}):[]:[]})[_0xeb3e('0x1d')](function(_0x22c4bb){logger[_0xeb3e('0xb')](_0xeb3e('0x14'),_0x21db15);logger[_0xeb3e('0x1e')](_0xeb3e('0x14'),_0x21db15,JSON[_0xeb3e('0xe')](_0x22c4bb));_0x6bf386(_0x22c4bb);})[_0xeb3e('0x13')](function(_0x561785){logger[_0xeb3e('0xf')](_0xeb3e('0x14'),_0x561785[_0xeb3e('0x11')],_0x21db15);_0x18c561(_0x36d61c['error'](0x1f4,_0x561785[_0xeb3e('0x11')]));});});};exports[_0xeb3e('0x1f')]=function(_0x487e1b){var _0x4778e6=this;return new Promise(function(_0x425753,_0x4287a3){return db[_0xeb3e('0x15')][_0xeb3e('0x20')]({'raw':_0x487e1b[_0xeb3e('0x17')]?_0x487e1b[_0xeb3e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x487e1b[_0xeb3e('0x17')]?_0x487e1b[_0xeb3e('0x17')][_0xeb3e('0x21')]||null:null,'attributes':_0x487e1b[_0xeb3e('0x17')]?_0x487e1b[_0xeb3e('0x17')][_0xeb3e('0x19')]||null:null,'include':_0x487e1b[_0xeb3e('0x17')]?_0x487e1b['options'][_0xeb3e('0x1b')]?_['map'](_0x487e1b[_0xeb3e('0x17')]['include'],function(_0x2ee09c){return{'model':db[_0x2ee09c[_0xeb3e('0x22')]],'as':_0x2ee09c['as'],'attributes':_0x2ee09c['attributes'],'include':_0x2ee09c[_0xeb3e('0x1b')]?_['map'](_0x2ee09c[_0xeb3e('0x1b')],function(_0x106995){return{'model':db[_0x106995['model']],'as':_0x106995['as'],'attributes':_0x106995[_0xeb3e('0x19')],'include':_0x106995['include']?_[_0xeb3e('0x1c')](_0x106995[_0xeb3e('0x1b')],function(_0x17fb6c){return{'model':db[_0x17fb6c[_0xeb3e('0x22')]],'as':_0x17fb6c['as'],'attributes':_0x17fb6c[_0xeb3e('0x19')]};}):[]};}):[]};}):[]:[]})[_0xeb3e('0x1d')](function(_0x6c76fe){logger['info'](_0xeb3e('0x1f'),_0x487e1b);logger[_0xeb3e('0x1e')](_0xeb3e('0x1f'),_0x487e1b,JSON['stringify'](_0x6c76fe));_0x425753(_0x6c76fe);})[_0xeb3e('0x13')](function(_0x3a7eb1){logger[_0xeb3e('0xf')](_0xeb3e('0x1f'),_0x3a7eb1['message'],_0x487e1b);_0x4287a3(_0x4778e6['error'](0x1f4,_0x3a7eb1[_0xeb3e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index c580a7f..6505d69 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 _0x615c=['/:id/descriptions','getDescriptions','post','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/subjects','getSubjects'];(function(_0x3ffdac,_0x1cec56){var _0x2ca852=function(_0x1eac32){while(--_0x1eac32){_0x3ffdac['push'](_0x3ffdac['shift']());}};_0x2ca852(++_0x1cec56);}(_0x615c,0x1d5));var _0xc615=function(_0x1a2877,_0x4b2963){_0x1a2877=_0x1a2877-0x0;var _0xe5dbce=_0x615c[_0x1a2877];return _0xe5dbce;};'use strict';var multer=require('multer');var util=require(_0xc615('0x0'));var path=require(_0xc615('0x1'));var timeout=require(_0xc615('0x2'));var express=require(_0xc615('0x3'));var router=express[_0xc615('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc615('0x5'));var interaction=require(_0xc615('0x6'));var config=require(_0xc615('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0xc615('0x8')]('/',auth['isAuthenticated'](),controller[_0xc615('0x9')]);router[_0xc615('0x8')]('/:id',auth[_0xc615('0xa')](),controller[_0xc615('0xb')]);router[_0xc615('0x8')]('/:id/fields',auth[_0xc615('0xa')](),controller['getFields']);router[_0xc615('0x8')](_0xc615('0xc'),auth[_0xc615('0xa')](),controller[_0xc615('0xd')]);router['get'](_0xc615('0xe'),auth['isAuthenticated'](),controller[_0xc615('0xf')]);router[_0xc615('0x10')]('/',auth[_0xc615('0xa')](),controller['create']);router['put'](_0xc615('0x11'),auth[_0xc615('0xa')](),controller[_0xc615('0x12')]);router[_0xc615('0x13')]('/:id',auth[_0xc615('0xa')](),controller[_0xc615('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb64f=['create','/:id','delete','multer','path','connect-timeout','express','Router','fs-extra','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x3a52cc,_0x57bac2){var _0x2b757c=function(_0x5ecac1){while(--_0x5ecac1){_0x3a52cc['push'](_0x3a52cc['shift']());}};_0x2b757c(++_0x57bac2);}(_0xb64f,0x1f1));var _0xfb64=function(_0x57b3df,_0x445081){_0x57b3df=_0x57b3df-0x0;var _0x206656=_0xb64f[_0x57b3df];return _0x206656;};'use strict';var multer=require(_0xfb64('0x0'));var util=require('util');var path=require(_0xfb64('0x1'));var timeout=require(_0xfb64('0x2'));var express=require(_0xfb64('0x3'));var router=express[_0xfb64('0x4')]();var fs_extra=require(_0xfb64('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfb64('0x6'));router['get']('/',auth[_0xfb64('0x7')](),controller[_0xfb64('0x8')]);router[_0xfb64('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfb64('0x9')](_0xfb64('0xa'),auth['isAuthenticated'](),controller[_0xfb64('0xb')]);router[_0xfb64('0x9')]('/:id/subjects',auth[_0xfb64('0x7')](),controller[_0xfb64('0xc')]);router['get'](_0xfb64('0xd'),auth[_0xfb64('0x7')](),controller[_0xfb64('0xe')]);router[_0xfb64('0xf')]('/',auth['isAuthenticated'](),controller[_0xfb64('0x10')]);router['put'](_0xfb64('0x11'),auth[_0xfb64('0x7')](),controller['update']);router[_0xfb64('0x12')](_0xfb64('0x11'),auth[_0xfb64('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index ee23f7e..bbd7230 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 _0xc2c6=['STRING','sequelize'];(function(_0x151f07,_0x417419){var _0x289cbb=function(_0x3cb566){while(--_0x3cb566){_0x151f07['push'](_0x151f07['shift']());}};_0x289cbb(++_0x417419);}(_0xc2c6,0xfd));var _0x6c2c=function(_0x5bdd93,_0x208ccb){_0x5bdd93=_0x5bdd93-0x0;var _0x2caf5e=_0xc2c6[_0x5bdd93];return _0x2caf5e;};'use strict';var Sequelize=require(_0x6c2c('0x0'));module['exports']={'name':{'type':Sequelize[_0x6c2c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5886=['sequelize','exports','STRING'];(function(_0x2d3dd7,_0x450f67){var _0x5b37ab=function(_0x288f0a){while(--_0x288f0a){_0x2d3dd7['push'](_0x2d3dd7['shift']());}};_0x5b37ab(++_0x450f67);}(_0x5886,0x7e));var _0x6588=function(_0x34fc2d,_0x644677){_0x34fc2d=_0x34fc2d-0x0;var _0x735da9=_0x5886[_0x34fc2d];return _0x735da9;};'use strict';var Sequelize=require(_0x6588('0x0'));module[_0x6588('0x1')]={'name':{'type':Sequelize[_0x6588('0x2')]},'description':{'type':Sequelize[_0x6588('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 837f855..9a42b00 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 _0x1247=['where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','update','getFields','ServicenowField','getSubjects','nolimit','getDescriptions','findOne','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','save','then','destroy','error','name','index','map','ServicenowConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort'];(function(_0x25a11b,_0x5783db){var _0x173342=function(_0x155f47){while(--_0x155f47){_0x25a11b['push'](_0x25a11b['shift']());}};_0x173342(++_0x5783db);}(_0x1247,0x64));var _0x7124=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0x1247[_0x246115];return _0x385878;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7124('0x0'));var zipdir=require(_0x7124('0x1'));var jsonpatch=require(_0x7124('0x2'));var rp=require('request-promise');var moment=require(_0x7124('0x3'));var BPromise=require(_0x7124('0x4'));var Mustache=require('mustache');var util=require(_0x7124('0x5'));var path=require(_0x7124('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7124('0x7'));var fs=require('fs');var fs_extra=require(_0x7124('0x8'));var _=require(_0x7124('0x9'));var squel=require(_0x7124('0xa'));var crypto=require(_0x7124('0xb'));var jsforce=require(_0x7124('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7124('0xd'));var Papa=require(_0x7124('0xe'));var Redis=require(_0x7124('0xf'));var authService=require(_0x7124('0x10'));var qs=require(_0x7124('0x11'));var as=require(_0x7124('0x12'));var hardwareService=require(_0x7124('0x13'));var logger=require(_0x7124('0x14'))('api');var utils=require(_0x7124('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7124('0x16'));var db=require(_0x7124('0x17'))['db'];function respondWithStatusCode(_0x300328,_0x5d136d){_0x5d136d=_0x5d136d||0xcc;return function(_0x5956f6){if(_0x5956f6){return _0x300328[_0x7124('0x18')](_0x5d136d);}return _0x300328[_0x7124('0x19')](_0x5d136d)[_0x7124('0x1a')]();};}function respondWithResult(_0x1a839c,_0x44ecd3){_0x44ecd3=_0x44ecd3||0xc8;return function(_0x44b5df){if(_0x44b5df){return _0x1a839c[_0x7124('0x19')](_0x44ecd3)[_0x7124('0x1b')](_0x44b5df);}};}function respondWithFilteredResult(_0x22833e,_0x7b3c8a){return function(_0x1c086c){if(_0x1c086c){var _0x19ff5b=typeof _0x7b3c8a['offset']==='undefined'&&typeof _0x7b3c8a[_0x7124('0x1c')]===_0x7124('0x1d');var _0x2b4063=_0x1c086c['count'];var _0x53a74b=_0x19ff5b?0x0:_0x7b3c8a[_0x7124('0x1e')];var _0x30565e=_0x19ff5b?_0x1c086c[_0x7124('0x1f')]:_0x7b3c8a[_0x7124('0x1e')]+_0x7b3c8a['limit'];var _0x462684;if(_0x30565e>=_0x2b4063){_0x30565e=_0x2b4063;_0x462684=0xc8;}else{_0x462684=0xce;}_0x22833e['status'](_0x462684);return _0x22833e['set'](_0x7124('0x20'),_0x53a74b+'-'+_0x30565e+'/'+_0x2b4063)['json'](_0x1c086c);}return null;};}function patchUpdates(_0x471a41){return function(_0x3f0c2f){try{jsonpatch[_0x7124('0x21')](_0x3f0c2f,_0x471a41,!![]);}catch(_0x56ef41){return BPromise['reject'](_0x56ef41);}return _0x3f0c2f[_0x7124('0x22')]();};}function saveUpdates(_0x45305e,_0x5dc820){return function(_0x5f3f57){if(_0x5f3f57){return _0x5f3f57['update'](_0x45305e)[_0x7124('0x23')](function(_0x11b3f3){return _0x11b3f3;});}return null;};}function removeEntity(_0x478802,_0x46e0de){return function(_0x408dfc){if(_0x408dfc){return _0x408dfc[_0x7124('0x24')]()[_0x7124('0x23')](function(){_0x478802[_0x7124('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fcf10,_0x42f431){return function(_0x341e33){if(!_0x341e33){_0x3fcf10['sendStatus'](0x194);}return _0x341e33;};}function handleError(_0x33dce5,_0x26c056){_0x26c056=_0x26c056||0x1f4;return function(_0xbc9461){logger[_0x7124('0x25')](_0xbc9461['stack']);if(_0xbc9461[_0x7124('0x26')]){delete _0xbc9461[_0x7124('0x26')];}_0x33dce5[_0x7124('0x19')](_0x26c056)['send'](_0xbc9461);};}exports[_0x7124('0x27')]=function(_0x40576a,_0x4ae0d6){var _0xe70dfa={},_0x183050={},_0x348670={'count':0x0,'rows':[]};var _0x10727f=_[_0x7124('0x28')](db[_0x7124('0x29')][_0x7124('0x2a')],function(_0x13b513){return{'name':_0x13b513['fieldName'],'type':_0x13b513[_0x7124('0x2b')][_0x7124('0x2c')]};});_0x183050[_0x7124('0x2d')]=_[_0x7124('0x28')](_0x10727f,_0x7124('0x26'));_0x183050[_0x7124('0x2e')]=_[_0x7124('0x2f')](_0x40576a[_0x7124('0x2e')]);_0x183050['filters']=_[_0x7124('0x30')](_0x183050[_0x7124('0x2d')],_0x183050[_0x7124('0x2e')]);_0xe70dfa[_0x7124('0x31')]=_[_0x7124('0x30')](_0x183050[_0x7124('0x2d')],qs[_0x7124('0x32')](_0x40576a[_0x7124('0x2e')]['fields']));_0xe70dfa[_0x7124('0x31')]=_0xe70dfa['attributes']['length']?_0xe70dfa[_0x7124('0x31')]:_0x183050[_0x7124('0x2d')];if(!_0x40576a['query'][_0x7124('0x33')]('nolimit')){_0xe70dfa[_0x7124('0x1c')]=qs[_0x7124('0x1c')](_0x40576a[_0x7124('0x2e')]['limit']);_0xe70dfa[_0x7124('0x1e')]=qs[_0x7124('0x1e')](_0x40576a[_0x7124('0x2e')][_0x7124('0x1e')]);}_0xe70dfa[_0x7124('0x34')]=qs[_0x7124('0x35')](_0x40576a[_0x7124('0x2e')][_0x7124('0x35')]);_0xe70dfa[_0x7124('0x36')]=qs[_0x7124('0x37')](_[_0x7124('0x38')](_0x40576a['query'],_0x183050[_0x7124('0x37')]),_0x10727f);if(_0x40576a['query'][_0x7124('0x39')]){_0xe70dfa[_0x7124('0x36')]=_[_0x7124('0x3a')](_0xe70dfa[_0x7124('0x36')],{'$or':_[_0x7124('0x28')](_0x10727f,function(_0x156c7){if(_0x156c7['type']!=='VIRTUAL'){var _0x492900={};_0x492900[_0x156c7[_0x7124('0x26')]]={'$like':'%'+_0x40576a[_0x7124('0x2e')][_0x7124('0x39')]+'%'};return _0x492900;}})});}_0xe70dfa=_['merge']({},_0xe70dfa,_0x40576a['options']);var _0x51d98d={'where':_0xe70dfa[_0x7124('0x36')]};return db[_0x7124('0x29')][_0x7124('0x1f')](_0x51d98d)[_0x7124('0x23')](function(_0x1acfb6){_0x348670[_0x7124('0x1f')]=_0x1acfb6;if(_0x40576a[_0x7124('0x2e')][_0x7124('0x3b')]){_0xe70dfa[_0x7124('0x3c')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x7124('0x3d')](_0xe70dfa);})[_0x7124('0x23')](function(_0x572212){_0x348670[_0x7124('0x3e')]=_0x572212;return _0x348670;})['then'](respondWithFilteredResult(_0x4ae0d6,_0xe70dfa))[_0x7124('0x3f')](handleError(_0x4ae0d6,null));};exports[_0x7124('0x40')]=function(_0x5ceb77,_0x2044e2){var _0x4233e0={'raw':![],'where':{'id':_0x5ceb77[_0x7124('0x41')]['id']}},_0x56f533={};_0x56f533[_0x7124('0x2d')]=_[_0x7124('0x2f')](db['ServicenowConfiguration'][_0x7124('0x2a')]);_0x56f533[_0x7124('0x2e')]=_[_0x7124('0x2f')](_0x5ceb77['query']);_0x56f533['filters']=_['intersection'](_0x56f533['model'],_0x56f533[_0x7124('0x2e')]);_0x4233e0[_0x7124('0x31')]=_['intersection'](_0x56f533[_0x7124('0x2d')],qs['fields'](_0x5ceb77[_0x7124('0x2e')][_0x7124('0x32')]));_0x4233e0[_0x7124('0x31')]=_0x4233e0[_0x7124('0x31')][_0x7124('0x42')]?_0x4233e0[_0x7124('0x31')]:_0x56f533[_0x7124('0x2d')];if(_0x5ceb77['query']['includeAll']){_0x4233e0[_0x7124('0x3c')]=[{'all':!![]}];}_0x4233e0=_[_0x7124('0x3a')]({},_0x4233e0,_0x5ceb77[_0x7124('0x43')]);return db[_0x7124('0x29')]['find'](_0x4233e0)[_0x7124('0x23')](handleEntityNotFound(_0x2044e2,null))['then'](respondWithResult(_0x2044e2,null))[_0x7124('0x3f')](handleError(_0x2044e2,null));};exports['create']=function(_0x5046be,_0xdc784c){return db[_0x7124('0x29')][_0x7124('0x44')](_0x5046be[_0x7124('0x45')],{})['then'](respondWithResult(_0xdc784c,0xc9))[_0x7124('0x3f')](handleError(_0xdc784c,null));};exports[_0x7124('0x46')]=function(_0x551ca3,_0x4da6ac){if(_0x551ca3[_0x7124('0x45')]['id']){delete _0x551ca3[_0x7124('0x45')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x551ca3[_0x7124('0x41')]['id']}})[_0x7124('0x23')](handleEntityNotFound(_0x4da6ac,null))[_0x7124('0x23')](saveUpdates(_0x551ca3[_0x7124('0x45')],null))['then'](respondWithResult(_0x4da6ac,null))[_0x7124('0x3f')](handleError(_0x4da6ac,null));};exports[_0x7124('0x24')]=function(_0x2d1449,_0x4a04ac){return db[_0x7124('0x29')]['find']({'where':{'id':_0x2d1449['params']['id']}})['then'](handleEntityNotFound(_0x4a04ac,null))[_0x7124('0x23')](removeEntity(_0x4a04ac,null))[_0x7124('0x3f')](handleError(_0x4a04ac,null));};exports[_0x7124('0x47')]=function(_0x5f1e92,_0x5e47b2,_0x2991e8){var _0x5b4c72={};var _0x11ba0e={};var _0x3a5162;var _0x166280;return db[_0x7124('0x29')]['findOne']({'where':{'id':_0x5f1e92[_0x7124('0x41')]['id']}})[_0x7124('0x23')](handleEntityNotFound(_0x5e47b2,null))[_0x7124('0x23')](function(_0x41386c){if(_0x41386c){_0x3a5162=_0x41386c;_0x11ba0e[_0x7124('0x2d')]=_['keys'](db[_0x7124('0x48')]['rawAttributes']);_0x11ba0e[_0x7124('0x2e')]=_['keys'](_0x5f1e92['query']);_0x11ba0e[_0x7124('0x37')]=_['intersection'](_0x11ba0e[_0x7124('0x2d')],_0x11ba0e[_0x7124('0x2e')]);_0x5b4c72[_0x7124('0x31')]=_[_0x7124('0x30')](_0x11ba0e['model'],qs[_0x7124('0x32')](_0x5f1e92[_0x7124('0x2e')][_0x7124('0x32')]));_0x5b4c72[_0x7124('0x31')]=_0x5b4c72[_0x7124('0x31')][_0x7124('0x42')]?_0x5b4c72[_0x7124('0x31')]:_0x11ba0e['model'];_0x5b4c72[_0x7124('0x34')]=qs[_0x7124('0x35')](_0x5f1e92[_0x7124('0x2e')][_0x7124('0x35')]);_0x5b4c72[_0x7124('0x36')]=qs[_0x7124('0x37')](_[_0x7124('0x38')](_0x5f1e92[_0x7124('0x2e')],_0x11ba0e[_0x7124('0x37')]));if(_0x5f1e92[_0x7124('0x2e')][_0x7124('0x39')]){_0x5b4c72[_0x7124('0x36')]=_[_0x7124('0x3a')](_0x5b4c72[_0x7124('0x36')],{'$or':_['map'](_0x5b4c72[_0x7124('0x31')],function(_0x51ded4){var _0x4129d1={};_0x4129d1[_0x51ded4]={'$like':'%'+_0x5f1e92[_0x7124('0x2e')][_0x7124('0x39')]+'%'};return _0x4129d1;})});}_0x5b4c72=_[_0x7124('0x3a')]({},_0x5b4c72,_0x5f1e92[_0x7124('0x43')]);return _0x3a5162[_0x7124('0x47')](_0x5b4c72);}})[_0x7124('0x23')](function(_0xc2f72e){if(_0xc2f72e){_0x166280=_0xc2f72e[_0x7124('0x42')];if(!_0x5f1e92[_0x7124('0x2e')][_0x7124('0x33')]('nolimit')){_0x5b4c72[_0x7124('0x1c')]=qs['limit'](_0x5f1e92['query'][_0x7124('0x1c')]);_0x5b4c72[_0x7124('0x1e')]=qs[_0x7124('0x1e')](_0x5f1e92[_0x7124('0x2e')][_0x7124('0x1e')]);}return _0x3a5162[_0x7124('0x47')](_0x5b4c72);}})['then'](function(_0x571860){if(_0x571860){return _0x571860?{'count':_0x166280,'rows':_0x571860}:null;}})[_0x7124('0x23')](respondWithResult(_0x5e47b2,null))[_0x7124('0x3f')](handleError(_0x5e47b2,null));};exports[_0x7124('0x49')]=function(_0x4993a2,_0x2f6c4f,_0x57572c){var _0x536bdf={};var _0x4ec2f7={};var _0xc0c9f8;var _0x3b146d;return db[_0x7124('0x29')]['findOne']({'where':{'id':_0x4993a2[_0x7124('0x41')]['id']}})[_0x7124('0x23')](handleEntityNotFound(_0x2f6c4f,null))[_0x7124('0x23')](function(_0x57ee73){if(_0x57ee73){_0xc0c9f8=_0x57ee73;_0x4ec2f7[_0x7124('0x2d')]=_[_0x7124('0x2f')](db[_0x7124('0x48')][_0x7124('0x2a')]);_0x4ec2f7[_0x7124('0x2e')]=_['keys'](_0x4993a2[_0x7124('0x2e')]);_0x4ec2f7[_0x7124('0x37')]=_[_0x7124('0x30')](_0x4ec2f7[_0x7124('0x2d')],_0x4ec2f7['query']);_0x536bdf[_0x7124('0x31')]=_[_0x7124('0x30')](_0x4ec2f7[_0x7124('0x2d')],qs['fields'](_0x4993a2[_0x7124('0x2e')][_0x7124('0x32')]));_0x536bdf[_0x7124('0x31')]=_0x536bdf[_0x7124('0x31')]['length']?_0x536bdf['attributes']:_0x4ec2f7[_0x7124('0x2d')];_0x536bdf['order']=qs[_0x7124('0x35')](_0x4993a2['query'][_0x7124('0x35')]);_0x536bdf[_0x7124('0x36')]=qs[_0x7124('0x37')](_['pick'](_0x4993a2[_0x7124('0x2e')],_0x4ec2f7[_0x7124('0x37')]));if(_0x4993a2[_0x7124('0x2e')][_0x7124('0x39')]){_0x536bdf[_0x7124('0x36')]=_[_0x7124('0x3a')](_0x536bdf['where'],{'$or':_[_0x7124('0x28')](_0x536bdf['attributes'],function(_0x12fe55){var _0x372f51={};_0x372f51[_0x12fe55]={'$like':'%'+_0x4993a2[_0x7124('0x2e')][_0x7124('0x39')]+'%'};return _0x372f51;})});}_0x536bdf=_['merge']({},_0x536bdf,_0x4993a2[_0x7124('0x43')]);return _0xc0c9f8[_0x7124('0x49')](_0x536bdf);}})[_0x7124('0x23')](function(_0x157dd5){if(_0x157dd5){_0x3b146d=_0x157dd5[_0x7124('0x42')];if(!_0x4993a2[_0x7124('0x2e')]['hasOwnProperty'](_0x7124('0x4a'))){_0x536bdf['limit']=qs['limit'](_0x4993a2[_0x7124('0x2e')][_0x7124('0x1c')]);_0x536bdf[_0x7124('0x1e')]=qs['offset'](_0x4993a2[_0x7124('0x2e')][_0x7124('0x1e')]);}return _0xc0c9f8[_0x7124('0x49')](_0x536bdf);}})['then'](function(_0xc27a32){if(_0xc27a32){return _0xc27a32?{'count':_0x3b146d,'rows':_0xc27a32}:null;}})[_0x7124('0x23')](respondWithResult(_0x2f6c4f,null))['catch'](handleError(_0x2f6c4f,null));};exports[_0x7124('0x4b')]=function(_0x4718b6,_0x242241,_0x5d61b9){var _0x66bced={};var _0x53568b={};var _0x143863;var _0x2f87bb;return db[_0x7124('0x29')][_0x7124('0x4c')]({'where':{'id':_0x4718b6[_0x7124('0x41')]['id']}})[_0x7124('0x23')](handleEntityNotFound(_0x242241,null))[_0x7124('0x23')](function(_0xf23ba6){if(_0xf23ba6){_0x143863=_0xf23ba6;_0x53568b[_0x7124('0x2d')]=_['keys'](db[_0x7124('0x48')][_0x7124('0x2a')]);_0x53568b[_0x7124('0x2e')]=_['keys'](_0x4718b6[_0x7124('0x2e')]);_0x53568b[_0x7124('0x37')]=_[_0x7124('0x30')](_0x53568b[_0x7124('0x2d')],_0x53568b[_0x7124('0x2e')]);_0x66bced[_0x7124('0x31')]=_[_0x7124('0x30')](_0x53568b[_0x7124('0x2d')],qs[_0x7124('0x32')](_0x4718b6[_0x7124('0x2e')]['fields']));_0x66bced[_0x7124('0x31')]=_0x66bced[_0x7124('0x31')][_0x7124('0x42')]?_0x66bced[_0x7124('0x31')]:_0x53568b[_0x7124('0x2d')];_0x66bced['order']=qs[_0x7124('0x35')](_0x4718b6[_0x7124('0x2e')][_0x7124('0x35')]);_0x66bced['where']=qs[_0x7124('0x37')](_[_0x7124('0x38')](_0x4718b6[_0x7124('0x2e')],_0x53568b['filters']));if(_0x4718b6['query'][_0x7124('0x39')]){_0x66bced[_0x7124('0x36')]=_[_0x7124('0x3a')](_0x66bced[_0x7124('0x36')],{'$or':_['map'](_0x66bced[_0x7124('0x31')],function(_0x5ab5b6){var _0x1f7447={};_0x1f7447[_0x5ab5b6]={'$like':'%'+_0x4718b6[_0x7124('0x2e')][_0x7124('0x39')]+'%'};return _0x1f7447;})});}_0x66bced=_[_0x7124('0x3a')]({},_0x66bced,_0x4718b6[_0x7124('0x43')]);return _0x143863['getDescriptions'](_0x66bced);}})[_0x7124('0x23')](function(_0x50e58d){if(_0x50e58d){_0x2f87bb=_0x50e58d['length'];if(!_0x4718b6[_0x7124('0x2e')][_0x7124('0x33')](_0x7124('0x4a'))){_0x66bced[_0x7124('0x1c')]=qs['limit'](_0x4718b6[_0x7124('0x2e')][_0x7124('0x1c')]);_0x66bced[_0x7124('0x1e')]=qs[_0x7124('0x1e')](_0x4718b6[_0x7124('0x2e')][_0x7124('0x1e')]);}return _0x143863[_0x7124('0x4b')](_0x66bced);}})[_0x7124('0x23')](function(_0x4bd3e6){if(_0x4bd3e6){return _0x4bd3e6?{'count':_0x2f87bb,'rows':_0x4bd3e6}:null;}})[_0x7124('0x23')](respondWithResult(_0x242241,null))[_0x7124('0x3f')](handleError(_0x242241,null));}; \ No newline at end of file +var _0x9442=['undefined','count','limit','set','json','apply','reject','save','update','then','destroy','stack','name','index','map','ServicenowConfiguration','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','getFields','ServicenowField','order','hasOwnProperty','getSubjects','findOne','getDescriptions','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9442,0x16f));var _0x2944=function(_0x1e3f14,_0x18c586){_0x1e3f14=_0x1e3f14-0x0;var _0x60e5b5=_0x9442[_0x1e3f14];return _0x60e5b5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2944('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2944('0x1'));var moment=require(_0x2944('0x2'));var BPromise=require(_0x2944('0x3'));var Mustache=require(_0x2944('0x4'));var util=require('util');var path=require(_0x2944('0x5'));var sox=require(_0x2944('0x6'));var csv=require(_0x2944('0x7'));var ejs=require(_0x2944('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2944('0x9'));var squel=require(_0x2944('0xa'));var crypto=require(_0x2944('0xb'));var jsforce=require(_0x2944('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2944('0x7'));var querystring=require(_0x2944('0xd'));var Papa=require('papaparse');var Redis=require(_0x2944('0xe'));var authService=require(_0x2944('0xf'));var qs=require(_0x2944('0x10'));var as=require(_0x2944('0x11'));var hardwareService=require(_0x2944('0x12'));var logger=require(_0x2944('0x13'))(_0x2944('0x14'));var utils=require(_0x2944('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2944('0x16'));var db=require(_0x2944('0x17'))['db'];function respondWithStatusCode(_0x3f3e12,_0x42b81e){_0x42b81e=_0x42b81e||0xcc;return function(_0x4c0b44){if(_0x4c0b44){return _0x3f3e12[_0x2944('0x18')](_0x42b81e);}return _0x3f3e12[_0x2944('0x19')](_0x42b81e)[_0x2944('0x1a')]();};}function respondWithResult(_0x23d28f,_0x57bcb9){_0x57bcb9=_0x57bcb9||0xc8;return function(_0x1ce2a2){if(_0x1ce2a2){return _0x23d28f[_0x2944('0x19')](_0x57bcb9)['json'](_0x1ce2a2);}};}function respondWithFilteredResult(_0x238640,_0x252daf){return function(_0x276303){if(_0x276303){var _0x310ec5=typeof _0x252daf[_0x2944('0x1b')]===_0x2944('0x1c')&&typeof _0x252daf['limit']==='undefined';var _0xa163d5=_0x276303[_0x2944('0x1d')];var _0x3d0356=_0x310ec5?0x0:_0x252daf[_0x2944('0x1b')];var _0x4ec0ae=_0x310ec5?_0x276303[_0x2944('0x1d')]:_0x252daf['offset']+_0x252daf[_0x2944('0x1e')];var _0x2f12ed;if(_0x4ec0ae>=_0xa163d5){_0x4ec0ae=_0xa163d5;_0x2f12ed=0xc8;}else{_0x2f12ed=0xce;}_0x238640[_0x2944('0x19')](_0x2f12ed);return _0x238640[_0x2944('0x1f')]('Content-Range',_0x3d0356+'-'+_0x4ec0ae+'/'+_0xa163d5)[_0x2944('0x20')](_0x276303);}return null;};}function patchUpdates(_0x121544){return function(_0x2448e7){try{jsonpatch[_0x2944('0x21')](_0x2448e7,_0x121544,!![]);}catch(_0x295d6b){return BPromise[_0x2944('0x22')](_0x295d6b);}return _0x2448e7[_0x2944('0x23')]();};}function saveUpdates(_0x2dc263,_0x57f4b0){return function(_0x2d1e9e){if(_0x2d1e9e){return _0x2d1e9e[_0x2944('0x24')](_0x2dc263)[_0x2944('0x25')](function(_0x31c2ce){return _0x31c2ce;});}return null;};}function removeEntity(_0x49f536,_0xb9353e){return function(_0x29b325){if(_0x29b325){return _0x29b325[_0x2944('0x26')]()[_0x2944('0x25')](function(){_0x49f536[_0x2944('0x19')](0xcc)[_0x2944('0x1a')]();});}};}function handleEntityNotFound(_0x3a11a8,_0x59c94e){return function(_0x38da2d){if(!_0x38da2d){_0x3a11a8[_0x2944('0x18')](0x194);}return _0x38da2d;};}function handleError(_0x101d22,_0x328513){_0x328513=_0x328513||0x1f4;return function(_0x2495f9){logger['error'](_0x2495f9[_0x2944('0x27')]);if(_0x2495f9[_0x2944('0x28')]){delete _0x2495f9['name'];}_0x101d22[_0x2944('0x19')](_0x328513)['send'](_0x2495f9);};}exports[_0x2944('0x29')]=function(_0x337a14,_0x26d6b9){var _0x2e60bc={},_0x3957d1={},_0xd0724e={'count':0x0,'rows':[]};var _0x5b3dea=_[_0x2944('0x2a')](db[_0x2944('0x2b')][_0x2944('0x2c')],function(_0x2496ab){return{'name':_0x2496ab['fieldName'],'type':_0x2496ab['type'][_0x2944('0x2d')]};});_0x3957d1['model']=_[_0x2944('0x2a')](_0x5b3dea,_0x2944('0x28'));_0x3957d1['query']=_['keys'](_0x337a14[_0x2944('0x2e')]);_0x3957d1[_0x2944('0x2f')]=_[_0x2944('0x30')](_0x3957d1[_0x2944('0x31')],_0x3957d1[_0x2944('0x2e')]);_0x2e60bc[_0x2944('0x32')]=_[_0x2944('0x30')](_0x3957d1[_0x2944('0x31')],qs[_0x2944('0x33')](_0x337a14[_0x2944('0x2e')]['fields']));_0x2e60bc[_0x2944('0x32')]=_0x2e60bc[_0x2944('0x32')][_0x2944('0x34')]?_0x2e60bc[_0x2944('0x32')]:_0x3957d1[_0x2944('0x31')];if(!_0x337a14[_0x2944('0x2e')]['hasOwnProperty'](_0x2944('0x35'))){_0x2e60bc[_0x2944('0x1e')]=qs['limit'](_0x337a14[_0x2944('0x2e')][_0x2944('0x1e')]);_0x2e60bc[_0x2944('0x1b')]=qs[_0x2944('0x1b')](_0x337a14['query'][_0x2944('0x1b')]);}_0x2e60bc['order']=qs[_0x2944('0x36')](_0x337a14[_0x2944('0x2e')][_0x2944('0x36')]);_0x2e60bc[_0x2944('0x37')]=qs[_0x2944('0x2f')](_[_0x2944('0x38')](_0x337a14[_0x2944('0x2e')],_0x3957d1[_0x2944('0x2f')]),_0x5b3dea);if(_0x337a14[_0x2944('0x2e')][_0x2944('0x39')]){_0x2e60bc[_0x2944('0x37')]=_[_0x2944('0x3a')](_0x2e60bc['where'],{'$or':_[_0x2944('0x2a')](_0x5b3dea,function(_0x9d5474){if(_0x9d5474[_0x2944('0x3b')]!==_0x2944('0x3c')){var _0x5376f3={};_0x5376f3[_0x9d5474[_0x2944('0x28')]]={'$like':'%'+_0x337a14[_0x2944('0x2e')][_0x2944('0x39')]+'%'};return _0x5376f3;}})});}_0x2e60bc=_[_0x2944('0x3a')]({},_0x2e60bc,_0x337a14[_0x2944('0x3d')]);var _0x17644b={'where':_0x2e60bc[_0x2944('0x37')]};return db['ServicenowConfiguration'][_0x2944('0x1d')](_0x17644b)[_0x2944('0x25')](function(_0x6e6d3){_0xd0724e[_0x2944('0x1d')]=_0x6e6d3;if(_0x337a14[_0x2944('0x2e')][_0x2944('0x3e')]){_0x2e60bc[_0x2944('0x3f')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x2944('0x40')](_0x2e60bc);})[_0x2944('0x25')](function(_0x952cad){_0xd0724e[_0x2944('0x41')]=_0x952cad;return _0xd0724e;})[_0x2944('0x25')](respondWithFilteredResult(_0x26d6b9,_0x2e60bc))[_0x2944('0x42')](handleError(_0x26d6b9,null));};exports['show']=function(_0x4b4f78,_0x3d6fe1){var _0x2a14ed={'raw':![],'where':{'id':_0x4b4f78[_0x2944('0x43')]['id']}},_0x394328={};_0x394328[_0x2944('0x31')]=_[_0x2944('0x44')](db[_0x2944('0x2b')][_0x2944('0x2c')]);_0x394328['query']=_['keys'](_0x4b4f78[_0x2944('0x2e')]);_0x394328[_0x2944('0x2f')]=_[_0x2944('0x30')](_0x394328['model'],_0x394328[_0x2944('0x2e')]);_0x2a14ed[_0x2944('0x32')]=_['intersection'](_0x394328[_0x2944('0x31')],qs[_0x2944('0x33')](_0x4b4f78[_0x2944('0x2e')][_0x2944('0x33')]));_0x2a14ed[_0x2944('0x32')]=_0x2a14ed[_0x2944('0x32')][_0x2944('0x34')]?_0x2a14ed['attributes']:_0x394328[_0x2944('0x31')];if(_0x4b4f78[_0x2944('0x2e')]['includeAll']){_0x2a14ed[_0x2944('0x3f')]=[{'all':!![]}];}_0x2a14ed=_['merge']({},_0x2a14ed,_0x4b4f78[_0x2944('0x3d')]);return db[_0x2944('0x2b')][_0x2944('0x45')](_0x2a14ed)[_0x2944('0x25')](handleEntityNotFound(_0x3d6fe1,null))[_0x2944('0x25')](respondWithResult(_0x3d6fe1,null))['catch'](handleError(_0x3d6fe1,null));};exports['create']=function(_0x276d78,_0x33c211){return db['ServicenowConfiguration'][_0x2944('0x46')](_0x276d78['body'],{})[_0x2944('0x25')](respondWithResult(_0x33c211,0xc9))['catch'](handleError(_0x33c211,null));};exports[_0x2944('0x24')]=function(_0x59070c,_0x385b91){if(_0x59070c[_0x2944('0x47')]['id']){delete _0x59070c[_0x2944('0x47')]['id'];}return db[_0x2944('0x2b')][_0x2944('0x45')]({'where':{'id':_0x59070c[_0x2944('0x43')]['id']}})[_0x2944('0x25')](handleEntityNotFound(_0x385b91,null))['then'](saveUpdates(_0x59070c[_0x2944('0x47')],null))[_0x2944('0x25')](respondWithResult(_0x385b91,null))['catch'](handleError(_0x385b91,null));};exports['destroy']=function(_0x2ad5ac,_0x43bd21){return db[_0x2944('0x2b')]['find']({'where':{'id':_0x2ad5ac[_0x2944('0x43')]['id']}})['then'](handleEntityNotFound(_0x43bd21,null))[_0x2944('0x25')](removeEntity(_0x43bd21,null))['catch'](handleError(_0x43bd21,null));};exports[_0x2944('0x48')]=function(_0x5ea0fc,_0x1fcf5c,_0x528a07){var _0x517cbc={};var _0x449b7d={};var _0x494e39;var _0x4caaf8;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x5ea0fc['params']['id']}})['then'](handleEntityNotFound(_0x1fcf5c,null))[_0x2944('0x25')](function(_0x91f9b4){if(_0x91f9b4){_0x494e39=_0x91f9b4;_0x449b7d[_0x2944('0x31')]=_['keys'](db[_0x2944('0x49')][_0x2944('0x2c')]);_0x449b7d[_0x2944('0x2e')]=_['keys'](_0x5ea0fc[_0x2944('0x2e')]);_0x449b7d[_0x2944('0x2f')]=_['intersection'](_0x449b7d[_0x2944('0x31')],_0x449b7d[_0x2944('0x2e')]);_0x517cbc[_0x2944('0x32')]=_['intersection'](_0x449b7d[_0x2944('0x31')],qs[_0x2944('0x33')](_0x5ea0fc[_0x2944('0x2e')]['fields']));_0x517cbc[_0x2944('0x32')]=_0x517cbc[_0x2944('0x32')]['length']?_0x517cbc['attributes']:_0x449b7d[_0x2944('0x31')];_0x517cbc[_0x2944('0x4a')]=qs[_0x2944('0x36')](_0x5ea0fc['query'][_0x2944('0x36')]);_0x517cbc[_0x2944('0x37')]=qs[_0x2944('0x2f')](_[_0x2944('0x38')](_0x5ea0fc['query'],_0x449b7d['filters']));if(_0x5ea0fc[_0x2944('0x2e')][_0x2944('0x39')]){_0x517cbc['where']=_[_0x2944('0x3a')](_0x517cbc[_0x2944('0x37')],{'$or':_[_0x2944('0x2a')](_0x517cbc[_0x2944('0x32')],function(_0x36700b){var _0x23a372={};_0x23a372[_0x36700b]={'$like':'%'+_0x5ea0fc[_0x2944('0x2e')][_0x2944('0x39')]+'%'};return _0x23a372;})});}_0x517cbc=_[_0x2944('0x3a')]({},_0x517cbc,_0x5ea0fc[_0x2944('0x3d')]);return _0x494e39[_0x2944('0x48')](_0x517cbc);}})[_0x2944('0x25')](function(_0x373fea){if(_0x373fea){_0x4caaf8=_0x373fea[_0x2944('0x34')];if(!_0x5ea0fc[_0x2944('0x2e')][_0x2944('0x4b')](_0x2944('0x35'))){_0x517cbc[_0x2944('0x1e')]=qs[_0x2944('0x1e')](_0x5ea0fc[_0x2944('0x2e')][_0x2944('0x1e')]);_0x517cbc['offset']=qs[_0x2944('0x1b')](_0x5ea0fc[_0x2944('0x2e')][_0x2944('0x1b')]);}return _0x494e39[_0x2944('0x48')](_0x517cbc);}})[_0x2944('0x25')](function(_0x4f4a2b){if(_0x4f4a2b){return _0x4f4a2b?{'count':_0x4caaf8,'rows':_0x4f4a2b}:null;}})[_0x2944('0x25')](respondWithResult(_0x1fcf5c,null))[_0x2944('0x42')](handleError(_0x1fcf5c,null));};exports[_0x2944('0x4c')]=function(_0xdde9a8,_0x568060,_0x328eb1){var _0x421da8={};var _0x4c40dd={};var _0x32057f;var _0xea9e43;return db['ServicenowConfiguration'][_0x2944('0x4d')]({'where':{'id':_0xdde9a8[_0x2944('0x43')]['id']}})[_0x2944('0x25')](handleEntityNotFound(_0x568060,null))[_0x2944('0x25')](function(_0x5e2e55){if(_0x5e2e55){_0x32057f=_0x5e2e55;_0x4c40dd[_0x2944('0x31')]=_[_0x2944('0x44')](db[_0x2944('0x49')][_0x2944('0x2c')]);_0x4c40dd[_0x2944('0x2e')]=_[_0x2944('0x44')](_0xdde9a8[_0x2944('0x2e')]);_0x4c40dd[_0x2944('0x2f')]=_[_0x2944('0x30')](_0x4c40dd['model'],_0x4c40dd[_0x2944('0x2e')]);_0x421da8['attributes']=_['intersection'](_0x4c40dd[_0x2944('0x31')],qs[_0x2944('0x33')](_0xdde9a8[_0x2944('0x2e')][_0x2944('0x33')]));_0x421da8[_0x2944('0x32')]=_0x421da8[_0x2944('0x32')][_0x2944('0x34')]?_0x421da8[_0x2944('0x32')]:_0x4c40dd[_0x2944('0x31')];_0x421da8[_0x2944('0x4a')]=qs[_0x2944('0x36')](_0xdde9a8[_0x2944('0x2e')][_0x2944('0x36')]);_0x421da8[_0x2944('0x37')]=qs[_0x2944('0x2f')](_[_0x2944('0x38')](_0xdde9a8[_0x2944('0x2e')],_0x4c40dd[_0x2944('0x2f')]));if(_0xdde9a8[_0x2944('0x2e')][_0x2944('0x39')]){_0x421da8[_0x2944('0x37')]=_['merge'](_0x421da8[_0x2944('0x37')],{'$or':_[_0x2944('0x2a')](_0x421da8[_0x2944('0x32')],function(_0x253cc2){var _0x4ad51e={};_0x4ad51e[_0x253cc2]={'$like':'%'+_0xdde9a8[_0x2944('0x2e')][_0x2944('0x39')]+'%'};return _0x4ad51e;})});}_0x421da8=_['merge']({},_0x421da8,_0xdde9a8[_0x2944('0x3d')]);return _0x32057f[_0x2944('0x4c')](_0x421da8);}})[_0x2944('0x25')](function(_0x372029){if(_0x372029){_0xea9e43=_0x372029[_0x2944('0x34')];if(!_0xdde9a8['query'][_0x2944('0x4b')]('nolimit')){_0x421da8[_0x2944('0x1e')]=qs['limit'](_0xdde9a8['query'][_0x2944('0x1e')]);_0x421da8[_0x2944('0x1b')]=qs['offset'](_0xdde9a8[_0x2944('0x2e')][_0x2944('0x1b')]);}return _0x32057f['getSubjects'](_0x421da8);}})[_0x2944('0x25')](function(_0x344e26){if(_0x344e26){return _0x344e26?{'count':_0xea9e43,'rows':_0x344e26}:null;}})[_0x2944('0x25')](respondWithResult(_0x568060,null))[_0x2944('0x42')](handleError(_0x568060,null));};exports[_0x2944('0x4e')]=function(_0x1363d0,_0x5c4593,_0x3d7cdd){var _0x293e01={};var _0x13b5a0={};var _0x50a17a;var _0x48b9ef;return db[_0x2944('0x2b')][_0x2944('0x4d')]({'where':{'id':_0x1363d0[_0x2944('0x43')]['id']}})[_0x2944('0x25')](handleEntityNotFound(_0x5c4593,null))['then'](function(_0x39274c){if(_0x39274c){_0x50a17a=_0x39274c;_0x13b5a0[_0x2944('0x31')]=_['keys'](db[_0x2944('0x49')][_0x2944('0x2c')]);_0x13b5a0[_0x2944('0x2e')]=_['keys'](_0x1363d0['query']);_0x13b5a0[_0x2944('0x2f')]=_['intersection'](_0x13b5a0[_0x2944('0x31')],_0x13b5a0[_0x2944('0x2e')]);_0x293e01[_0x2944('0x32')]=_[_0x2944('0x30')](_0x13b5a0[_0x2944('0x31')],qs['fields'](_0x1363d0[_0x2944('0x2e')][_0x2944('0x33')]));_0x293e01[_0x2944('0x32')]=_0x293e01['attributes']['length']?_0x293e01[_0x2944('0x32')]:_0x13b5a0[_0x2944('0x31')];_0x293e01['order']=qs[_0x2944('0x36')](_0x1363d0[_0x2944('0x2e')][_0x2944('0x36')]);_0x293e01[_0x2944('0x37')]=qs[_0x2944('0x2f')](_[_0x2944('0x38')](_0x1363d0['query'],_0x13b5a0[_0x2944('0x2f')]));if(_0x1363d0[_0x2944('0x2e')][_0x2944('0x39')]){_0x293e01[_0x2944('0x37')]=_['merge'](_0x293e01[_0x2944('0x37')],{'$or':_[_0x2944('0x2a')](_0x293e01[_0x2944('0x32')],function(_0x746c90){var _0xbc2cf9={};_0xbc2cf9[_0x746c90]={'$like':'%'+_0x1363d0[_0x2944('0x2e')]['filter']+'%'};return _0xbc2cf9;})});}_0x293e01=_[_0x2944('0x3a')]({},_0x293e01,_0x1363d0['options']);return _0x50a17a[_0x2944('0x4e')](_0x293e01);}})[_0x2944('0x25')](function(_0x40ef3b){if(_0x40ef3b){_0x48b9ef=_0x40ef3b[_0x2944('0x34')];if(!_0x1363d0[_0x2944('0x2e')][_0x2944('0x4b')](_0x2944('0x35'))){_0x293e01[_0x2944('0x1e')]=qs[_0x2944('0x1e')](_0x1363d0[_0x2944('0x2e')][_0x2944('0x1e')]);_0x293e01[_0x2944('0x1b')]=qs['offset'](_0x1363d0[_0x2944('0x2e')][_0x2944('0x1b')]);}return _0x50a17a[_0x2944('0x4e')](_0x293e01);}})[_0x2944('0x25')](function(_0x320bba){if(_0x320bba){return _0x320bba?{'count':_0x48b9ef,'rows':_0x320bba}:null;}})[_0x2944('0x25')](respondWithResult(_0x5c4593,null))[_0x2944('0x42')](handleError(_0x5c4593,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 7014c3d..1f67242 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 _0x6f75=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ce3bc,_0x3530af){var _0x31100b=function(_0x2a2f46){while(--_0x2a2f46){_0x3ce3bc['push'](_0x3ce3bc['shift']());}};_0x31100b(++_0x3530af);}(_0x6f75,0x71));var _0x56f7=function(_0x965fe2,_0x1da855){_0x965fe2=_0x965fe2-0x0;var _0x3f0c23=_0x6f75[_0x965fe2];return _0x3f0c23;};'use strict';var _=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var logger=require(_0x56f7('0x2'))(_0x56f7('0x3'));var moment=require(_0x56f7('0x4'));var BPromise=require(_0x56f7('0x5'));var rp=require(_0x56f7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x56f7('0x7'));var config=require(_0x56f7('0x8'));var attributes=require(_0x56f7('0x9'));module['exports']=function(_0x4d0f0c,_0x5da455){return _0x4d0f0c[_0x56f7('0xa')](_0x56f7('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71f4=['api','moment','bluebird','request-promise','rimraf','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','../../config/logger'];(function(_0x37d3c5,_0x66369b){var _0x183aea=function(_0x22b104){while(--_0x22b104){_0x37d3c5['push'](_0x37d3c5['shift']());}};_0x183aea(++_0x66369b);}(_0x71f4,0xf9));var _0x471f=function(_0x58b18b,_0xfc4d44){_0x58b18b=_0x58b18b-0x0;var _0x39eb08=_0x71f4[_0x58b18b];return _0x39eb08;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x471f('0x0'))(_0x471f('0x1'));var moment=require(_0x471f('0x2'));var BPromise=require(_0x471f('0x3'));var rp=require(_0x471f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x471f('0x5'));var config=require('../../config/environment');var attributes=require(_0x471f('0x6'));module['exports']=function(_0x1d0101,_0x3bdf82){return _0x1d0101[_0x471f('0x7')](_0x471f('0x8'),attributes,{'tableName':_0x471f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index bca3420..9241f9d 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 _0x5309=['../../config/environment','jayson/promise','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x22cb00,_0x479e8c){var _0x5f39b3=function(_0x390d1c){while(--_0x390d1c){_0x22cb00['push'](_0x22cb00['shift']());}};_0x5f39b3(++_0x479e8c);}(_0x5309,0x125));var _0x9530=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x5309[_0x5037ab];return _0x512adb;};'use strict';var _=require('lodash');var util=require(_0x9530('0x0'));var moment=require(_0x9530('0x1'));var BPromise=require(_0x9530('0x2'));var rs=require(_0x9530('0x3'));var fs=require('fs');var Redis=require(_0x9530('0x4'));var db=require(_0x9530('0x5'))['db'];var utils=require(_0x9530('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9530('0x7'));var jayson=require(_0x9530('0x8'));var client=jayson['client'][_0x9530('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x145080,_0x294cbc,_0x225239){return new BPromise(function(_0x486b18,_0x30fe42){return client['request'](_0x145080,_0x225239)[_0x9530('0xa')](function(_0x127f20){logger[_0x9530('0xb')](_0x9530('0xc'),_0x294cbc,_0x9530('0xd'));logger['debug'](_0x9530('0xe'),_0x294cbc,_0x9530('0xd'),JSON[_0x9530('0xf')](_0x127f20));if(_0x127f20['error']){if(_0x127f20[_0x9530('0x10')]['code']===0x1f4){logger[_0x9530('0x10')](_0x9530('0xc'),_0x294cbc,_0x127f20[_0x9530('0x10')]['message']);return _0x30fe42(_0x127f20[_0x9530('0x10')][_0x9530('0x11')]);}logger[_0x9530('0x10')](_0x9530('0xc'),_0x294cbc,_0x127f20[_0x9530('0x10')][_0x9530('0x11')]);return _0x486b18(_0x127f20[_0x9530('0x10')][_0x9530('0x11')]);}else{logger['info'](_0x9530('0xc'),_0x294cbc,_0x9530('0xd'));_0x486b18(_0x127f20[_0x9530('0x12')]['message']);}})[_0x9530('0x13')](function(_0x29ec4d){logger[_0x9530('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x294cbc,_0x29ec4d);_0x30fe42(_0x29ec4d);});});} \ No newline at end of file +var _0xdc35=['request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x2aba0e,_0x1872be){var _0x3f277e=function(_0x15df31){while(--_0x15df31){_0x2aba0e['push'](_0x2aba0e['shift']());}};_0x3f277e(++_0x1872be);}(_0xdc35,0xd3));var _0x5dc3=function(_0x5f4509,_0x77407e){_0x5f4509=_0x5f4509-0x0;var _0x482774=_0xdc35[_0x5f4509];return _0x482774;};'use strict';var _=require(_0x5dc3('0x0'));var util=require(_0x5dc3('0x1'));var moment=require(_0x5dc3('0x2'));var BPromise=require(_0x5dc3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dc3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dc3('0x5'));var logger=require(_0x5dc3('0x6'))('rpc');var config=require(_0x5dc3('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5dc3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x328037,_0x4cb453,_0xada89c){return new BPromise(function(_0x1c8e0f,_0x400ffe){return client[_0x5dc3('0x9')](_0x328037,_0xada89c)[_0x5dc3('0xa')](function(_0x57c9a4){logger[_0x5dc3('0xb')](_0x5dc3('0xc'),_0x4cb453,'request\x20sent');logger[_0x5dc3('0xd')](_0x5dc3('0xe'),_0x4cb453,_0x5dc3('0xf'),JSON[_0x5dc3('0x10')](_0x57c9a4));if(_0x57c9a4['error']){if(_0x57c9a4[_0x5dc3('0x11')][_0x5dc3('0x12')]===0x1f4){logger[_0x5dc3('0x11')](_0x5dc3('0xc'),_0x4cb453,_0x57c9a4[_0x5dc3('0x11')][_0x5dc3('0x13')]);return _0x400ffe(_0x57c9a4[_0x5dc3('0x11')]['message']);}logger['error'](_0x5dc3('0xc'),_0x4cb453,_0x57c9a4[_0x5dc3('0x11')][_0x5dc3('0x13')]);return _0x1c8e0f(_0x57c9a4[_0x5dc3('0x11')]['message']);}else{logger[_0x5dc3('0xb')](_0x5dc3('0xc'),_0x4cb453,_0x5dc3('0xf'));_0x1c8e0f(_0x57c9a4[_0x5dc3('0x14')][_0x5dc3('0x13')]);}})[_0x5dc3('0x15')](function(_0x2b9552){logger['error'](_0x5dc3('0xc'),_0x4cb453,_0x2b9552);_0x400ffe(_0x2b9552);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 59a1e88..17d3bde 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 _0x5ac7=['update','delete','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','show','post','put'];(function(_0x383948,_0x3f66bb){var _0x34ce80=function(_0x1e6046){while(--_0x1e6046){_0x383948['push'](_0x383948['shift']());}};_0x34ce80(++_0x3f66bb);}(_0x5ac7,0x130));var _0x75ac=function(_0x30bdf4,_0x3e3d28){_0x30bdf4=_0x30bdf4-0x0;var _0x2789d8=_0x5ac7[_0x30bdf4];return _0x2789d8;};'use strict';var multer=require(_0x75ac('0x0'));var util=require(_0x75ac('0x1'));var path=require(_0x75ac('0x2'));var timeout=require(_0x75ac('0x3'));var express=require('express');var router=express[_0x75ac('0x4')]();var fs_extra=require(_0x75ac('0x5'));var auth=require(_0x75ac('0x6'));var interaction=require(_0x75ac('0x7'));var config=require(_0x75ac('0x8'));var controller=require(_0x75ac('0x9'));router['get']('/',auth[_0x75ac('0xa')](),controller[_0x75ac('0xb')]);router[_0x75ac('0xc')]('/:id',auth[_0x75ac('0xa')](),controller[_0x75ac('0xd')]);router[_0x75ac('0xe')]('/',auth[_0x75ac('0xa')](),controller['create']);router[_0x75ac('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x75ac('0x10')]);router[_0x75ac('0x11')](_0x75ac('0x12'),auth[_0x75ac('0xa')](),controller['destroy']);module[_0x75ac('0x13')]=router; \ No newline at end of file +var _0xe333=['index','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated'];(function(_0x393500,_0x1037af){var _0x120d3b=function(_0x17234e){while(--_0x17234e){_0x393500['push'](_0x393500['shift']());}};_0x120d3b(++_0x1037af);}(_0xe333,0xc5));var _0x3e33=function(_0x548177,_0x32bfc5){_0x548177=_0x548177-0x0;var _0x431a7a=_0xe333[_0x548177];return _0x431a7a;};'use strict';var multer=require(_0x3e33('0x0'));var util=require(_0x3e33('0x1'));var path=require(_0x3e33('0x2'));var timeout=require(_0x3e33('0x3'));var express=require(_0x3e33('0x4'));var router=express[_0x3e33('0x5')]();var fs_extra=require(_0x3e33('0x6'));var auth=require(_0x3e33('0x7'));var interaction=require(_0x3e33('0x8'));var config=require(_0x3e33('0x9'));var controller=require(_0x3e33('0xa'));router[_0x3e33('0xb')]('/',auth[_0x3e33('0xc')](),controller[_0x3e33('0xd')]);router[_0x3e33('0xb')](_0x3e33('0xe'),auth[_0x3e33('0xc')](),controller[_0x3e33('0xf')]);router[_0x3e33('0x10')]('/',auth[_0x3e33('0xc')](),controller[_0x3e33('0x11')]);router[_0x3e33('0x12')](_0x3e33('0xe'),auth[_0x3e33('0xc')](),controller[_0x3e33('0x13')]);router['delete']('/:id',auth[_0x3e33('0xc')](),controller['destroy']);module[_0x3e33('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 8e97752..61fe15a 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 _0xa742=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xa742,0x106));var _0x2a74=function(_0x9ab2ee,_0x2dbbda){_0x9ab2ee=_0x9ab2ee-0x0;var _0x7aeb79=_0xa742[_0x9ab2ee];return _0x7aeb79;};'use strict';var Sequelize=require(_0x2a74('0x0'));module[_0x2a74('0x1')]={'type':{'type':Sequelize[_0x2a74('0x2')](_0x2a74('0x3'),_0x2a74('0x4'),_0x2a74('0x5'),_0x2a74('0x6'),_0x2a74('0x7')),'defaultValue':_0x2a74('0x3')},'content':{'type':Sequelize[_0x2a74('0x8')]},'key':{'type':Sequelize[_0x2a74('0x8')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x2a74('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2a74('0x8')]},'nameField':{'type':Sequelize[_0x2a74('0x8')]},'customField':{'type':Sequelize[_0x2a74('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcc71=['STRING','ENUM','sequelize','exports','string','variable','customVariable','picklist'];(function(_0x1ef547,_0x31bfdb){var _0x1d697b=function(_0x57fbdc){while(--_0x57fbdc){_0x1ef547['push'](_0x1ef547['shift']());}};_0x1d697b(++_0x31bfdb);}(_0xcc71,0x1f2));var _0x1cc7=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xcc71[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x1cc7('0x0'));module[_0x1cc7('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1cc7('0x2'),_0x1cc7('0x3'),_0x1cc7('0x4'),'keyValue',_0x1cc7('0x5')),'defaultValue':_0x1cc7('0x2')},'content':{'type':Sequelize[_0x1cc7('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1cc7('0x7')](_0x1cc7('0x2'),_0x1cc7('0x3'),_0x1cc7('0x4'))},'keyContent':{'type':Sequelize[_0x1cc7('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1cc7('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1cc7('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 1263aa8..bc64065 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 _0x178b=['reject','update','then','destroy','end','error','stack','name','send','index','ServicenowField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x178b,0x152));var _0xb178=function(_0x230078,_0x40e1b4){_0x230078=_0x230078-0x0;var _0x379ab7=_0x178b[_0x230078];return _0x379ab7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb178('0x0'));var zipdir=require(_0xb178('0x1'));var jsonpatch=require(_0xb178('0x2'));var rp=require(_0xb178('0x3'));var moment=require(_0xb178('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb178('0x5'));var util=require(_0xb178('0x6'));var path=require(_0xb178('0x7'));var sox=require(_0xb178('0x8'));var csv=require(_0xb178('0x9'));var ejs=require(_0xb178('0xa'));var fs=require('fs');var fs_extra=require(_0xb178('0xb'));var _=require(_0xb178('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb178('0xd'));var toCsv=require(_0xb178('0x9'));var querystring=require(_0xb178('0xe'));var Papa=require(_0xb178('0xf'));var Redis=require(_0xb178('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb178('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb178('0x12'));var logger=require(_0xb178('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb178('0x14'));var db=require(_0xb178('0x15'))['db'];function respondWithStatusCode(_0x244b6a,_0x29f90b){_0x29f90b=_0x29f90b||0xcc;return function(_0xeee7fd){if(_0xeee7fd){return _0x244b6a[_0xb178('0x16')](_0x29f90b);}return _0x244b6a[_0xb178('0x17')](_0x29f90b)['end']();};}function respondWithResult(_0x1841f9,_0x2c5cef){_0x2c5cef=_0x2c5cef||0xc8;return function(_0x104e12){if(_0x104e12){return _0x1841f9[_0xb178('0x17')](_0x2c5cef)[_0xb178('0x18')](_0x104e12);}};}function respondWithFilteredResult(_0x2dc42c,_0x354193){return function(_0x2f4f81){if(_0x2f4f81){var _0x535a1e=typeof _0x354193[_0xb178('0x19')]===_0xb178('0x1a')&&typeof _0x354193[_0xb178('0x1b')]===_0xb178('0x1a');var _0x2262d5=_0x2f4f81[_0xb178('0x1c')];var _0x257d8b=_0x535a1e?0x0:_0x354193['offset'];var _0x13c106=_0x535a1e?_0x2f4f81[_0xb178('0x1c')]:_0x354193[_0xb178('0x19')]+_0x354193[_0xb178('0x1b')];var _0x296c49;if(_0x13c106>=_0x2262d5){_0x13c106=_0x2262d5;_0x296c49=0xc8;}else{_0x296c49=0xce;}_0x2dc42c['status'](_0x296c49);return _0x2dc42c[_0xb178('0x1d')](_0xb178('0x1e'),_0x257d8b+'-'+_0x13c106+'/'+_0x2262d5)[_0xb178('0x18')](_0x2f4f81);}return null;};}function patchUpdates(_0x40dcda){return function(_0x3fdcf2){try{jsonpatch[_0xb178('0x1f')](_0x3fdcf2,_0x40dcda,!![]);}catch(_0xb9482a){return BPromise[_0xb178('0x20')](_0xb9482a);}return _0x3fdcf2['save']();};}function saveUpdates(_0x57f830,_0x5aeb56){return function(_0x3c5ce0){if(_0x3c5ce0){return _0x3c5ce0[_0xb178('0x21')](_0x57f830)[_0xb178('0x22')](function(_0x1eae8a){return _0x1eae8a;});}return null;};}function removeEntity(_0x83d93f,_0x4ea95a){return function(_0x1c4d19){if(_0x1c4d19){return _0x1c4d19[_0xb178('0x23')]()[_0xb178('0x22')](function(){_0x83d93f['status'](0xcc)[_0xb178('0x24')]();});}};}function handleEntityNotFound(_0x45bbfe,_0x3b1f68){return function(_0x1e0eaa){if(!_0x1e0eaa){_0x45bbfe[_0xb178('0x16')](0x194);}return _0x1e0eaa;};}function handleError(_0x538763,_0xd68c20){_0xd68c20=_0xd68c20||0x1f4;return function(_0x2eea6a){logger[_0xb178('0x25')](_0x2eea6a[_0xb178('0x26')]);if(_0x2eea6a[_0xb178('0x27')]){delete _0x2eea6a[_0xb178('0x27')];}_0x538763[_0xb178('0x17')](_0xd68c20)[_0xb178('0x28')](_0x2eea6a);};}exports[_0xb178('0x29')]=function(_0x165568,_0x208596){var _0x195e19={},_0x421828={},_0x38d746={'count':0x0,'rows':[]};var _0x20a424=_['map'](db[_0xb178('0x2a')][_0xb178('0x2b')],function(_0x399045){return{'name':_0x399045['fieldName'],'type':_0x399045[_0xb178('0x2c')][_0xb178('0x2d')]};});_0x421828[_0xb178('0x2e')]=_['map'](_0x20a424,'name');_0x421828[_0xb178('0x2f')]=_[_0xb178('0x30')](_0x165568['query']);_0x421828[_0xb178('0x31')]=_[_0xb178('0x32')](_0x421828[_0xb178('0x2e')],_0x421828[_0xb178('0x2f')]);_0x195e19[_0xb178('0x33')]=_[_0xb178('0x32')](_0x421828['model'],qs['fields'](_0x165568[_0xb178('0x2f')][_0xb178('0x34')]));_0x195e19[_0xb178('0x33')]=_0x195e19[_0xb178('0x33')][_0xb178('0x35')]?_0x195e19['attributes']:_0x421828[_0xb178('0x2e')];if(!_0x165568[_0xb178('0x2f')][_0xb178('0x36')](_0xb178('0x37'))){_0x195e19[_0xb178('0x1b')]=qs[_0xb178('0x1b')](_0x165568[_0xb178('0x2f')][_0xb178('0x1b')]);_0x195e19[_0xb178('0x19')]=qs[_0xb178('0x19')](_0x165568['query'][_0xb178('0x19')]);}_0x195e19[_0xb178('0x38')]=qs[_0xb178('0x39')](_0x165568[_0xb178('0x2f')][_0xb178('0x39')]);_0x195e19[_0xb178('0x3a')]=qs['filters'](_[_0xb178('0x3b')](_0x165568['query'],_0x421828[_0xb178('0x31')]),_0x20a424);if(_0x165568[_0xb178('0x2f')][_0xb178('0x3c')]){_0x195e19[_0xb178('0x3a')]=_[_0xb178('0x3d')](_0x195e19[_0xb178('0x3a')],{'$or':_[_0xb178('0x3e')](_0x20a424,function(_0x349752){if(_0x349752[_0xb178('0x2c')]!==_0xb178('0x3f')){var _0x53fcca={};_0x53fcca[_0x349752[_0xb178('0x27')]]={'$like':'%'+_0x165568['query'][_0xb178('0x3c')]+'%'};return _0x53fcca;}})});}_0x195e19=_[_0xb178('0x3d')]({},_0x195e19,_0x165568[_0xb178('0x40')]);var _0x57ceb4={'where':_0x195e19[_0xb178('0x3a')]};return db[_0xb178('0x2a')][_0xb178('0x1c')](_0x57ceb4)[_0xb178('0x22')](function(_0x5aeaed){_0x38d746[_0xb178('0x1c')]=_0x5aeaed;if(_0x165568[_0xb178('0x2f')][_0xb178('0x41')]){_0x195e19['include']=[{'all':!![]}];}return db[_0xb178('0x2a')][_0xb178('0x42')](_0x195e19);})['then'](function(_0x5d88b4){_0x38d746['rows']=_0x5d88b4;return _0x38d746;})[_0xb178('0x22')](respondWithFilteredResult(_0x208596,_0x195e19))[_0xb178('0x43')](handleError(_0x208596,null));};exports[_0xb178('0x44')]=function(_0xe15fc6,_0x40374f){var _0x209828={'raw':!![],'where':{'id':_0xe15fc6[_0xb178('0x45')]['id']}},_0x23768d={};_0x23768d[_0xb178('0x2e')]=_[_0xb178('0x30')](db['ServicenowField'][_0xb178('0x2b')]);_0x23768d[_0xb178('0x2f')]=_['keys'](_0xe15fc6[_0xb178('0x2f')]);_0x23768d['filters']=_[_0xb178('0x32')](_0x23768d['model'],_0x23768d[_0xb178('0x2f')]);_0x209828[_0xb178('0x33')]=_[_0xb178('0x32')](_0x23768d[_0xb178('0x2e')],qs[_0xb178('0x34')](_0xe15fc6['query']['fields']));_0x209828[_0xb178('0x33')]=_0x209828[_0xb178('0x33')][_0xb178('0x35')]?_0x209828[_0xb178('0x33')]:_0x23768d[_0xb178('0x2e')];if(_0xe15fc6['query'][_0xb178('0x41')]){_0x209828[_0xb178('0x46')]=[{'all':!![]}];}_0x209828=_[_0xb178('0x3d')]({},_0x209828,_0xe15fc6[_0xb178('0x40')]);return db['ServicenowField']['find'](_0x209828)[_0xb178('0x22')](handleEntityNotFound(_0x40374f,null))[_0xb178('0x22')](respondWithResult(_0x40374f,null))['catch'](handleError(_0x40374f,null));};exports[_0xb178('0x47')]=function(_0x36e01a,_0x5c9314){return db[_0xb178('0x2a')][_0xb178('0x47')](_0x36e01a[_0xb178('0x48')],{})['then'](respondWithResult(_0x5c9314,0xc9))[_0xb178('0x43')](handleError(_0x5c9314,null));};exports[_0xb178('0x21')]=function(_0x307edf,_0x191014){if(_0x307edf[_0xb178('0x48')]['id']){delete _0x307edf[_0xb178('0x48')]['id'];}return db[_0xb178('0x2a')][_0xb178('0x49')]({'where':{'id':_0x307edf[_0xb178('0x45')]['id']}})[_0xb178('0x22')](handleEntityNotFound(_0x191014,null))[_0xb178('0x22')](saveUpdates(_0x307edf[_0xb178('0x48')],null))[_0xb178('0x22')](respondWithResult(_0x191014,null))[_0xb178('0x43')](handleError(_0x191014,null));};exports[_0xb178('0x23')]=function(_0x21024a,_0x4411f0){return db[_0xb178('0x2a')][_0xb178('0x49')]({'where':{'id':_0x21024a[_0xb178('0x45')]['id']}})[_0xb178('0x22')](handleEntityNotFound(_0x4411f0,null))['then'](removeEntity(_0x4411f0,null))['catch'](handleError(_0x4411f0,null));}; \ No newline at end of file +var _0xfa1f=['save','update','then','destroy','end','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','create','body','catch','find','params','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply'];(function(_0x258018,_0x3a14e0){var _0x58dc64=function(_0x4ee777){while(--_0x4ee777){_0x258018['push'](_0x258018['shift']());}};_0x58dc64(++_0x3a14e0);}(_0xfa1f,0x11b));var _0xffa1=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xfa1f[_0x28d18d];return _0x470640;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xffa1('0x0'));var jsonpatch=require(_0xffa1('0x1'));var rp=require(_0xffa1('0x2'));var moment=require('moment');var BPromise=require(_0xffa1('0x3'));var Mustache=require(_0xffa1('0x4'));var util=require(_0xffa1('0x5'));var path=require(_0xffa1('0x6'));var sox=require(_0xffa1('0x7'));var csv=require(_0xffa1('0x8'));var ejs=require(_0xffa1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffa1('0xa'));var squel=require(_0xffa1('0xb'));var crypto=require(_0xffa1('0xc'));var jsforce=require(_0xffa1('0xd'));var deskjs=require(_0xffa1('0xe'));var toCsv=require(_0xffa1('0x8'));var querystring=require(_0xffa1('0xf'));var Papa=require(_0xffa1('0x10'));var Redis=require(_0xffa1('0x11'));var authService=require(_0xffa1('0x12'));var qs=require(_0xffa1('0x13'));var as=require(_0xffa1('0x14'));var hardwareService=require(_0xffa1('0x15'));var logger=require(_0xffa1('0x16'))(_0xffa1('0x17'));var utils=require(_0xffa1('0x18'));var config=require(_0xffa1('0x19'));var licenseUtil=require(_0xffa1('0x1a'));var db=require(_0xffa1('0x1b'))['db'];function respondWithStatusCode(_0x3c9ceb,_0x520fca){_0x520fca=_0x520fca||0xcc;return function(_0x5d221c){if(_0x5d221c){return _0x3c9ceb[_0xffa1('0x1c')](_0x520fca);}return _0x3c9ceb[_0xffa1('0x1d')](_0x520fca)['end']();};}function respondWithResult(_0x290c4c,_0x503c2c){_0x503c2c=_0x503c2c||0xc8;return function(_0x4a757b){if(_0x4a757b){return _0x290c4c[_0xffa1('0x1d')](_0x503c2c)[_0xffa1('0x1e')](_0x4a757b);}};}function respondWithFilteredResult(_0x11eddc,_0x5a1065){return function(_0x3394c4){if(_0x3394c4){var _0x5686ef=typeof _0x5a1065[_0xffa1('0x1f')]===_0xffa1('0x20')&&typeof _0x5a1065[_0xffa1('0x21')]===_0xffa1('0x20');var _0x6d4826=_0x3394c4[_0xffa1('0x22')];var _0x27bcd5=_0x5686ef?0x0:_0x5a1065['offset'];var _0x2d80ae=_0x5686ef?_0x3394c4[_0xffa1('0x22')]:_0x5a1065[_0xffa1('0x1f')]+_0x5a1065[_0xffa1('0x21')];var _0x59a091;if(_0x2d80ae>=_0x6d4826){_0x2d80ae=_0x6d4826;_0x59a091=0xc8;}else{_0x59a091=0xce;}_0x11eddc[_0xffa1('0x1d')](_0x59a091);return _0x11eddc[_0xffa1('0x23')]('Content-Range',_0x27bcd5+'-'+_0x2d80ae+'/'+_0x6d4826)[_0xffa1('0x1e')](_0x3394c4);}return null;};}function patchUpdates(_0x59556e){return function(_0x2deb8c){try{jsonpatch[_0xffa1('0x24')](_0x2deb8c,_0x59556e,!![]);}catch(_0x5d02f6){return BPromise['reject'](_0x5d02f6);}return _0x2deb8c[_0xffa1('0x25')]();};}function saveUpdates(_0x37dce3,_0x3c37e8){return function(_0x5b24bd){if(_0x5b24bd){return _0x5b24bd[_0xffa1('0x26')](_0x37dce3)[_0xffa1('0x27')](function(_0x2b7467){return _0x2b7467;});}return null;};}function removeEntity(_0x1a55cc,_0xdd5ab8){return function(_0x21e6b0){if(_0x21e6b0){return _0x21e6b0[_0xffa1('0x28')]()[_0xffa1('0x27')](function(){_0x1a55cc[_0xffa1('0x1d')](0xcc)[_0xffa1('0x29')]();});}};}function handleEntityNotFound(_0x1f6f4c,_0x47b1f6){return function(_0xe72ea4){if(!_0xe72ea4){_0x1f6f4c['sendStatus'](0x194);}return _0xe72ea4;};}function handleError(_0x2c9872,_0x4c1de9){_0x4c1de9=_0x4c1de9||0x1f4;return function(_0x281c62){logger[_0xffa1('0x2a')](_0x281c62[_0xffa1('0x2b')]);if(_0x281c62['name']){delete _0x281c62[_0xffa1('0x2c')];}_0x2c9872['status'](_0x4c1de9)[_0xffa1('0x2d')](_0x281c62);};}exports[_0xffa1('0x2e')]=function(_0x5e3722,_0x149868){var _0x6809b7={},_0x55dfc4={},_0x149b5d={'count':0x0,'rows':[]};var _0x1dd202=_[_0xffa1('0x2f')](db[_0xffa1('0x30')][_0xffa1('0x31')],function(_0x4eb1cc){return{'name':_0x4eb1cc[_0xffa1('0x32')],'type':_0x4eb1cc[_0xffa1('0x33')][_0xffa1('0x34')]};});_0x55dfc4[_0xffa1('0x35')]=_[_0xffa1('0x2f')](_0x1dd202,_0xffa1('0x2c'));_0x55dfc4[_0xffa1('0x36')]=_[_0xffa1('0x37')](_0x5e3722[_0xffa1('0x36')]);_0x55dfc4[_0xffa1('0x38')]=_[_0xffa1('0x39')](_0x55dfc4[_0xffa1('0x35')],_0x55dfc4['query']);_0x6809b7[_0xffa1('0x3a')]=_[_0xffa1('0x39')](_0x55dfc4[_0xffa1('0x35')],qs[_0xffa1('0x3b')](_0x5e3722[_0xffa1('0x36')][_0xffa1('0x3b')]));_0x6809b7[_0xffa1('0x3a')]=_0x6809b7['attributes'][_0xffa1('0x3c')]?_0x6809b7[_0xffa1('0x3a')]:_0x55dfc4[_0xffa1('0x35')];if(!_0x5e3722[_0xffa1('0x36')][_0xffa1('0x3d')](_0xffa1('0x3e'))){_0x6809b7['limit']=qs[_0xffa1('0x21')](_0x5e3722['query'][_0xffa1('0x21')]);_0x6809b7[_0xffa1('0x1f')]=qs['offset'](_0x5e3722[_0xffa1('0x36')][_0xffa1('0x1f')]);}_0x6809b7[_0xffa1('0x3f')]=qs[_0xffa1('0x40')](_0x5e3722[_0xffa1('0x36')][_0xffa1('0x40')]);_0x6809b7[_0xffa1('0x41')]=qs[_0xffa1('0x38')](_['pick'](_0x5e3722['query'],_0x55dfc4[_0xffa1('0x38')]),_0x1dd202);if(_0x5e3722[_0xffa1('0x36')][_0xffa1('0x42')]){_0x6809b7['where']=_[_0xffa1('0x43')](_0x6809b7[_0xffa1('0x41')],{'$or':_['map'](_0x1dd202,function(_0x1c4335){if(_0x1c4335[_0xffa1('0x33')]!==_0xffa1('0x44')){var _0x572a26={};_0x572a26[_0x1c4335[_0xffa1('0x2c')]]={'$like':'%'+_0x5e3722[_0xffa1('0x36')]['filter']+'%'};return _0x572a26;}})});}_0x6809b7=_[_0xffa1('0x43')]({},_0x6809b7,_0x5e3722[_0xffa1('0x45')]);var _0x421060={'where':_0x6809b7[_0xffa1('0x41')]};return db['ServicenowField'][_0xffa1('0x22')](_0x421060)['then'](function(_0x41eed4){_0x149b5d['count']=_0x41eed4;if(_0x5e3722[_0xffa1('0x36')][_0xffa1('0x46')]){_0x6809b7[_0xffa1('0x47')]=[{'all':!![]}];}return db['ServicenowField'][_0xffa1('0x48')](_0x6809b7);})[_0xffa1('0x27')](function(_0xf6ee21){_0x149b5d[_0xffa1('0x49')]=_0xf6ee21;return _0x149b5d;})[_0xffa1('0x27')](respondWithFilteredResult(_0x149868,_0x6809b7))['catch'](handleError(_0x149868,null));};exports[_0xffa1('0x4a')]=function(_0x918494,_0x5cf83f){var _0x11ec32={'raw':!![],'where':{'id':_0x918494['params']['id']}},_0x72a588={};_0x72a588[_0xffa1('0x35')]=_[_0xffa1('0x37')](db[_0xffa1('0x30')]['rawAttributes']);_0x72a588[_0xffa1('0x36')]=_['keys'](_0x918494[_0xffa1('0x36')]);_0x72a588[_0xffa1('0x38')]=_[_0xffa1('0x39')](_0x72a588['model'],_0x72a588['query']);_0x11ec32[_0xffa1('0x3a')]=_[_0xffa1('0x39')](_0x72a588['model'],qs[_0xffa1('0x3b')](_0x918494[_0xffa1('0x36')]['fields']));_0x11ec32[_0xffa1('0x3a')]=_0x11ec32[_0xffa1('0x3a')][_0xffa1('0x3c')]?_0x11ec32[_0xffa1('0x3a')]:_0x72a588[_0xffa1('0x35')];if(_0x918494[_0xffa1('0x36')][_0xffa1('0x46')]){_0x11ec32['include']=[{'all':!![]}];}_0x11ec32=_[_0xffa1('0x43')]({},_0x11ec32,_0x918494['options']);return db[_0xffa1('0x30')]['find'](_0x11ec32)['then'](handleEntityNotFound(_0x5cf83f,null))[_0xffa1('0x27')](respondWithResult(_0x5cf83f,null))['catch'](handleError(_0x5cf83f,null));};exports[_0xffa1('0x4b')]=function(_0x4be4e1,_0x253d94){return db[_0xffa1('0x30')][_0xffa1('0x4b')](_0x4be4e1[_0xffa1('0x4c')],{})['then'](respondWithResult(_0x253d94,0xc9))[_0xffa1('0x4d')](handleError(_0x253d94,null));};exports['update']=function(_0x184733,_0x52286d){if(_0x184733['body']['id']){delete _0x184733[_0xffa1('0x4c')]['id'];}return db[_0xffa1('0x30')][_0xffa1('0x4e')]({'where':{'id':_0x184733['params']['id']}})['then'](handleEntityNotFound(_0x52286d,null))['then'](saveUpdates(_0x184733[_0xffa1('0x4c')],null))[_0xffa1('0x27')](respondWithResult(_0x52286d,null))[_0xffa1('0x4d')](handleError(_0x52286d,null));};exports[_0xffa1('0x28')]=function(_0x1d295d,_0x4ae1db){return db[_0xffa1('0x30')][_0xffa1('0x4e')]({'where':{'id':_0x1d295d[_0xffa1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4ae1db,null))[_0xffa1('0x27')](removeEntity(_0x4ae1db,null))['catch'](handleError(_0x4ae1db,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 5091ac6..1fbfd76 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 _0xee6a=['bluebird','request-promise','path','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','api','moment'];(function(_0x26d344,_0x3acdf1){var _0x540fb5=function(_0x419379){while(--_0x419379){_0x26d344['push'](_0x26d344['shift']());}};_0x540fb5(++_0x3acdf1);}(_0xee6a,0xfc));var _0xaee6=function(_0x3d0669,_0x1c5ed0){_0x3d0669=_0x3d0669-0x0;var _0x461e13=_0xee6a[_0x3d0669];return _0x461e13;};'use strict';var _=require(_0xaee6('0x0'));var util=require(_0xaee6('0x1'));var logger=require('../../config/logger')(_0xaee6('0x2'));var moment=require(_0xaee6('0x3'));var BPromise=require(_0xaee6('0x4'));var rp=require(_0xaee6('0x5'));var fs=require('fs');var path=require(_0xaee6('0x6'));var rimraf=require('rimraf');var config=require(_0xaee6('0x7'));var attributes=require(_0xaee6('0x8'));module[_0xaee6('0x9')]=function(_0x514353,_0x2707b9){return _0x514353[_0xaee6('0xa')](_0xaee6('0xb'),attributes,{'tableName':_0xaee6('0xc'),'paranoid':![],'indexes':[{'name':_0xaee6('0xd'),'fields':[_0xaee6('0xe'),_0xaee6('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7cea=['int_servicenow_fields','servicenow_unique_index','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define'];(function(_0x301a91,_0xa1c4bc){var _0x514520=function(_0x3980b8){while(--_0x3980b8){_0x301a91['push'](_0x301a91['shift']());}};_0x514520(++_0xa1c4bc);}(_0x7cea,0x1b4));var _0xa7ce=function(_0x277c19,_0x2cd867){_0x277c19=_0x277c19-0x0;var _0x2bb0fd=_0x7cea[_0x277c19];return _0x2bb0fd;};'use strict';var _=require(_0xa7ce('0x0'));var util=require(_0xa7ce('0x1'));var logger=require(_0xa7ce('0x2'))(_0xa7ce('0x3'));var moment=require('moment');var BPromise=require(_0xa7ce('0x4'));var rp=require(_0xa7ce('0x5'));var fs=require('fs');var path=require(_0xa7ce('0x6'));var rimraf=require(_0xa7ce('0x7'));var config=require(_0xa7ce('0x8'));var attributes=require(_0xa7ce('0x9'));module[_0xa7ce('0xa')]=function(_0x591ae8,_0x2d37bf){return _0x591ae8[_0xa7ce('0xb')]('ServicenowField',attributes,{'tableName':_0xa7ce('0xc'),'paranoid':![],'indexes':[{'name':_0xa7ce('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index e3fd28e..8384154 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 _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4838a1,_0x130213){var _0x4f330f=function(_0x341fe1){while(--_0x341fe1){_0x4838a1['push'](_0x4838a1['shift']());}};_0x4f330f(++_0x130213);}(_0xe706,0xa3));var _0x6e70=function(_0x40ddc0,_0x41c082){_0x40ddc0=_0x40ddc0-0x0;var _0x1aebf1=_0xe706[_0x40ddc0];return _0x1aebf1;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3778e3,_0x590fc1){var _0x37cd38=function(_0x4f6793){while(--_0x4f6793){_0x3778e3['push'](_0x3778e3['shift']());}};_0x37cd38(++_0x590fc1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 5e26f59..f1fbc63 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3b4e42,_0x408f98){var _0x5a7256=function(_0x4ceb6c){while(--_0x4ceb6c){_0x3b4e42['push'](_0x3b4e42['shift']());}};_0x5a7256(++_0x408f98);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +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(_0x90165e,_0x4159b5){var _0x3da33c=function(_0x50dfcb){while(--_0x50dfcb){_0x90165e['push'](_0x90165e['shift']());}};_0x3da33c(++_0x4159b5);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index c53358b..a3ececb 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(_0x25a352,_0x512487){var _0xd724f8=function(_0x37ece1){while(--_0x37ece1){_0x25a352['push'](_0x25a352['shift']());}};_0xd724f8(++_0x512487);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0xc1e586,_0x29b5dc){var _0x90b89b=function(_0x22c356){while(--_0x22c356){_0xc1e586['push'](_0xc1e586['shift']());}};_0x90b89b(++_0x29b5dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'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 339986d..0578716 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 _0xbc53=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','SugarcrmAccount','findAll','rows','catch','params','includeAll','include','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','SugarcrmField','assigned_user_id','created_by','date_start','duration_hours','parent_id','parent_type','parent_name','username','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','JSON','Calls','values','module_fields','remove','includes','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0xdde6fb,_0x1b1884){var _0xe8042e=function(_0xee7f43){while(--_0xee7f43){_0xdde6fb['push'](_0xdde6fb['shift']());}};_0xe8042e(++_0x1b1884);}(_0xbc53,0x1e9));var _0x3bc5=function(_0x41c31c,_0x1eeab2){_0x41c31c=_0x41c31c-0x0;var _0x1cd99c=_0xbc53[_0x41c31c];return _0x1cd99c;};'use strict';var emlformat=require(_0x3bc5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bc5('0x1'));var jsonpatch=require(_0x3bc5('0x2'));var rp=require('request-promise');var moment=require(_0x3bc5('0x3'));var BPromise=require(_0x3bc5('0x4'));var Mustache=require(_0x3bc5('0x5'));var util=require('util');var path=require(_0x3bc5('0x6'));var sox=require(_0x3bc5('0x7'));var csv=require(_0x3bc5('0x8'));var ejs=require(_0x3bc5('0x9'));var fs=require('fs');var fs_extra=require(_0x3bc5('0xa'));var _=require(_0x3bc5('0xb'));var squel=require(_0x3bc5('0xc'));var crypto=require(_0x3bc5('0xd'));var jsforce=require(_0x3bc5('0xe'));var deskjs=require(_0x3bc5('0xf'));var toCsv=require(_0x3bc5('0x8'));var querystring=require(_0x3bc5('0x10'));var Papa=require(_0x3bc5('0x11'));var Redis=require(_0x3bc5('0x12'));var authService=require(_0x3bc5('0x13'));var qs=require(_0x3bc5('0x14'));var as=require(_0x3bc5('0x15'));var hardwareService=require(_0x3bc5('0x16'));var logger=require(_0x3bc5('0x17'))(_0x3bc5('0x18'));var utils=require(_0x3bc5('0x19'));var config=require(_0x3bc5('0x1a'));var licenseUtil=require(_0x3bc5('0x1b'));var db=require(_0x3bc5('0x1c'))['db'];var integrations=require(_0x3bc5('0x1d'));function respondWithStatusCode(_0x2593a0,_0x577d5b){_0x577d5b=_0x577d5b||0xcc;return function(_0x116970){if(_0x116970){return _0x2593a0[_0x3bc5('0x1e')](_0x577d5b);}return _0x2593a0['status'](_0x577d5b)[_0x3bc5('0x1f')]();};}function respondWithResult(_0x2f1c9a,_0x4138bf){_0x4138bf=_0x4138bf||0xc8;return function(_0x6eb78b){if(_0x6eb78b){return _0x2f1c9a[_0x3bc5('0x20')](_0x4138bf)[_0x3bc5('0x21')](_0x6eb78b);}};}function respondWithFilteredResult(_0x4b217f,_0x4cf590){return function(_0x174778){if(_0x174778){var _0xc337e2=typeof _0x4cf590['offset']==='undefined'&&typeof _0x4cf590[_0x3bc5('0x22')]===_0x3bc5('0x23');var _0x55a474=_0x174778[_0x3bc5('0x24')];var _0x4c4e70=_0xc337e2?0x0:_0x4cf590[_0x3bc5('0x25')];var _0x384fd8=_0xc337e2?_0x174778[_0x3bc5('0x24')]:_0x4cf590[_0x3bc5('0x25')]+_0x4cf590[_0x3bc5('0x22')];var _0x5331a0;if(_0x384fd8>=_0x55a474){_0x384fd8=_0x55a474;_0x5331a0=0xc8;}else{_0x5331a0=0xce;}_0x4b217f[_0x3bc5('0x20')](_0x5331a0);return _0x4b217f['set'](_0x3bc5('0x26'),_0x4c4e70+'-'+_0x384fd8+'/'+_0x55a474)['json'](_0x174778);}return null;};}function patchUpdates(_0x3a98c){return function(_0x2b0342){try{jsonpatch[_0x3bc5('0x27')](_0x2b0342,_0x3a98c,!![]);}catch(_0x39a5cb){return BPromise[_0x3bc5('0x28')](_0x39a5cb);}return _0x2b0342[_0x3bc5('0x29')]();};}function saveUpdates(_0x368ccc,_0x39e713){return function(_0x3c2267){if(_0x3c2267){return _0x3c2267[_0x3bc5('0x2a')](_0x368ccc)[_0x3bc5('0x2b')](function(_0x1ba5f1){return _0x1ba5f1;});}return null;};}function removeEntity(_0xfa21db,_0x22670c){return function(_0x5e7b15){if(_0x5e7b15){return _0x5e7b15[_0x3bc5('0x2c')]()[_0x3bc5('0x2b')](function(){_0xfa21db[_0x3bc5('0x20')](0xcc)[_0x3bc5('0x1f')]();});}};}function handleEntityNotFound(_0x3ffa31,_0x307332){return function(_0xd0ac8e){if(!_0xd0ac8e){_0x3ffa31[_0x3bc5('0x1e')](0x194);}return _0xd0ac8e;};}function handleError(_0x3994e1,_0x4391b4){_0x4391b4=_0x4391b4||0x1f4;return function(_0x47de68){logger[_0x3bc5('0x2d')](_0x47de68[_0x3bc5('0x2e')]);if(_0x47de68[_0x3bc5('0x2f')]){delete _0x47de68[_0x3bc5('0x2f')];}_0x3994e1['status'](_0x4391b4)[_0x3bc5('0x30')](_0x47de68);};}exports[_0x3bc5('0x31')]=function(_0x57292f,_0x2dc359){var _0x3f7c1c={},_0x569b52={},_0x349a06={'count':0x0,'rows':[]};var _0x388e04=_[_0x3bc5('0x32')](db['SugarcrmAccount'][_0x3bc5('0x33')],function(_0x47ee13){return{'name':_0x47ee13[_0x3bc5('0x34')],'type':_0x47ee13[_0x3bc5('0x35')][_0x3bc5('0x36')]};});_0x569b52['model']=_[_0x3bc5('0x32')](_0x388e04,_0x3bc5('0x2f'));_0x569b52[_0x3bc5('0x37')]=_[_0x3bc5('0x38')](_0x57292f[_0x3bc5('0x37')]);_0x569b52[_0x3bc5('0x39')]=_[_0x3bc5('0x3a')](_0x569b52['model'],_0x569b52[_0x3bc5('0x37')]);_0x3f7c1c[_0x3bc5('0x3b')]=_[_0x3bc5('0x3a')](_0x569b52['model'],qs[_0x3bc5('0x3c')](_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x3c')]));_0x3f7c1c[_0x3bc5('0x3b')]=_0x3f7c1c[_0x3bc5('0x3b')][_0x3bc5('0x3d')]?_0x3f7c1c[_0x3bc5('0x3b')]:_0x569b52[_0x3bc5('0x3e')];if(!_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x3f')](_0x3bc5('0x40'))){_0x3f7c1c[_0x3bc5('0x22')]=qs['limit'](_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x22')]);_0x3f7c1c[_0x3bc5('0x25')]=qs[_0x3bc5('0x25')](_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x25')]);}_0x3f7c1c['order']=qs[_0x3bc5('0x41')](_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x41')]);_0x3f7c1c[_0x3bc5('0x42')]=qs[_0x3bc5('0x39')](_[_0x3bc5('0x43')](_0x57292f[_0x3bc5('0x37')],_0x569b52[_0x3bc5('0x39')]),_0x388e04);if(_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x44')]){_0x3f7c1c[_0x3bc5('0x42')]=_['merge'](_0x3f7c1c[_0x3bc5('0x42')],{'$or':_[_0x3bc5('0x32')](_0x388e04,function(_0x375077){if(_0x375077[_0x3bc5('0x35')]!==_0x3bc5('0x45')){var _0x3921bb={};_0x3921bb[_0x375077[_0x3bc5('0x2f')]]={'$like':'%'+_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x44')]+'%'};return _0x3921bb;}})});}_0x3f7c1c=_[_0x3bc5('0x46')]({},_0x3f7c1c,_0x57292f[_0x3bc5('0x47')]);var _0x10646b={'where':_0x3f7c1c[_0x3bc5('0x42')]};return db[_0x3bc5('0x48')]['count'](_0x10646b)['then'](function(_0x17f36c){_0x349a06['count']=_0x17f36c;if(_0x57292f[_0x3bc5('0x37')]['includeAll']){_0x3f7c1c['include']=[{'all':!![]}];}return db[_0x3bc5('0x48')][_0x3bc5('0x49')](_0x3f7c1c);})[_0x3bc5('0x2b')](function(_0x4da526){_0x349a06[_0x3bc5('0x4a')]=_0x4da526;return _0x349a06;})[_0x3bc5('0x2b')](respondWithFilteredResult(_0x2dc359,_0x3f7c1c))[_0x3bc5('0x4b')](handleError(_0x2dc359,null));};exports['show']=function(_0x5697dd,_0x1ddd5c){var _0x3c73fc={'raw':![],'where':{'id':_0x5697dd[_0x3bc5('0x4c')]['id']}},_0x2c5f91={};_0x2c5f91[_0x3bc5('0x3e')]=_[_0x3bc5('0x38')](db[_0x3bc5('0x48')][_0x3bc5('0x33')]);_0x2c5f91[_0x3bc5('0x37')]=_[_0x3bc5('0x38')](_0x5697dd[_0x3bc5('0x37')]);_0x2c5f91['filters']=_['intersection'](_0x2c5f91[_0x3bc5('0x3e')],_0x2c5f91['query']);_0x3c73fc['attributes']=_[_0x3bc5('0x3a')](_0x2c5f91[_0x3bc5('0x3e')],qs[_0x3bc5('0x3c')](_0x5697dd['query'][_0x3bc5('0x3c')]));_0x3c73fc['attributes']=_0x3c73fc[_0x3bc5('0x3b')]['length']?_0x3c73fc['attributes']:_0x2c5f91['model'];if(_0x5697dd['query'][_0x3bc5('0x4d')]){_0x3c73fc[_0x3bc5('0x4e')]=[{'all':!![]}];}_0x3c73fc=_[_0x3bc5('0x46')]({},_0x3c73fc,_0x5697dd[_0x3bc5('0x47')]);return db['SugarcrmAccount'][_0x3bc5('0x4f')](_0x3c73fc)[_0x3bc5('0x2b')](handleEntityNotFound(_0x1ddd5c,null))['then'](respondWithResult(_0x1ddd5c,null))[_0x3bc5('0x4b')](handleError(_0x1ddd5c,null));};exports[_0x3bc5('0x50')]=function(_0x540459,_0x3ba7d7){return db[_0x3bc5('0x48')][_0x3bc5('0x50')](_0x540459[_0x3bc5('0x51')],{})['then'](respondWithResult(_0x3ba7d7,0xc9))[_0x3bc5('0x4b')](handleError(_0x3ba7d7,null));};exports[_0x3bc5('0x2a')]=function(_0x30ec9f,_0x1158c8){if(_0x30ec9f[_0x3bc5('0x51')]['id']){delete _0x30ec9f[_0x3bc5('0x51')]['id'];}return db[_0x3bc5('0x48')][_0x3bc5('0x4f')]({'where':{'id':_0x30ec9f[_0x3bc5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1158c8,null))['then'](saveUpdates(_0x30ec9f[_0x3bc5('0x51')],null))['then'](respondWithResult(_0x1158c8,null))[_0x3bc5('0x4b')](handleError(_0x1158c8,null));};exports[_0x3bc5('0x2c')]=function(_0xcb3ddc,_0x4d224c){return db[_0x3bc5('0x48')]['find']({'where':{'id':_0xcb3ddc['params']['id']}})[_0x3bc5('0x2b')](handleEntityNotFound(_0x4d224c,null))[_0x3bc5('0x2b')](removeEntity(_0x4d224c,null))['catch'](handleError(_0x4d224c,null));};exports[_0x3bc5('0x52')]=function(_0x52a1a7,_0x5c9c33,_0x5dd2fd){var _0x46d531={};var _0x3be12e={};var _0x442cd9;var _0x322c57;return db[_0x3bc5('0x48')][_0x3bc5('0x53')]({'where':{'id':_0x52a1a7['params']['id']}})[_0x3bc5('0x2b')](handleEntityNotFound(_0x5c9c33,null))['then'](function(_0x1019e4){if(_0x1019e4){_0x442cd9=_0x1019e4;_0x3be12e[_0x3bc5('0x3e')]=_[_0x3bc5('0x38')](db[_0x3bc5('0x54')][_0x3bc5('0x33')]);_0x3be12e['query']=_[_0x3bc5('0x38')](_0x52a1a7[_0x3bc5('0x37')]);_0x3be12e['filters']=_[_0x3bc5('0x3a')](_0x3be12e[_0x3bc5('0x3e')],_0x3be12e[_0x3bc5('0x37')]);_0x46d531[_0x3bc5('0x3b')]=_[_0x3bc5('0x3a')](_0x3be12e['model'],qs[_0x3bc5('0x3c')](_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x3c')]));_0x46d531['attributes']=_0x46d531[_0x3bc5('0x3b')][_0x3bc5('0x3d')]?_0x46d531[_0x3bc5('0x3b')]:_0x3be12e[_0x3bc5('0x3e')];_0x46d531[_0x3bc5('0x55')]=qs[_0x3bc5('0x41')](_0x52a1a7[_0x3bc5('0x37')]['sort']);_0x46d531['where']=qs[_0x3bc5('0x39')](_[_0x3bc5('0x43')](_0x52a1a7[_0x3bc5('0x37')],_0x3be12e['filters']));if(_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x44')]){_0x46d531[_0x3bc5('0x42')]=_[_0x3bc5('0x46')](_0x46d531['where'],{'$or':_[_0x3bc5('0x32')](_0x46d531['attributes'],function(_0x28bf2a){var _0x119f90={};_0x119f90[_0x28bf2a]={'$like':'%'+_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x44')]+'%'};return _0x119f90;})});}_0x46d531=_[_0x3bc5('0x46')]({},_0x46d531,_0x52a1a7[_0x3bc5('0x47')]);return _0x442cd9[_0x3bc5('0x52')](_0x46d531);}})[_0x3bc5('0x2b')](function(_0x2e1aae){if(_0x2e1aae){_0x322c57=_0x2e1aae[_0x3bc5('0x3d')];if(!_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x3f')](_0x3bc5('0x40'))){_0x46d531[_0x3bc5('0x22')]=qs[_0x3bc5('0x22')](_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x22')]);_0x46d531['offset']=qs[_0x3bc5('0x25')](_0x52a1a7[_0x3bc5('0x37')]['offset']);}return _0x442cd9[_0x3bc5('0x52')](_0x46d531);}})[_0x3bc5('0x2b')](function(_0x260607){if(_0x260607){return _0x260607?{'count':_0x322c57,'rows':_0x260607}:null;}})['then'](respondWithResult(_0x5c9c33,null))[_0x3bc5('0x4b')](handleError(_0x5c9c33,null));};exports[_0x3bc5('0x56')]=function(_0x5af418,_0xc49cba,_0x568b94){if(_0x5af418['body']['id']){delete _0x5af418[_0x3bc5('0x51')]['id'];}return db[_0x3bc5('0x48')]['findOne']({'where':{'id':_0x5af418[_0x3bc5('0x4c')]['id']}})[_0x3bc5('0x2b')](handleEntityNotFound(_0xc49cba,null))['then'](function(_0x228199){if(_0x228199){_0x5af418[_0x3bc5('0x51')]['AccountId']=_0x228199['id'];_0x5af418['body'][_0x3bc5('0x57')]=integrations[_0x3bc5('0x58')](_0x5af418[_0x3bc5('0x51')][_0x3bc5('0x59')],_0x5af418[_0x3bc5('0x51')]['type']);_0x5af418['body'][_0x3bc5('0x5a')]=integrations['getDescriptions'](_0x5af418['body']['channel'],_0x5af418[_0x3bc5('0x51')][_0x3bc5('0x35')]);return db[_0x3bc5('0x54')][_0x3bc5('0x50')](_0x5af418['body'],{'include':[{'model':db[_0x3bc5('0x5b')],'as':_0x3bc5('0x57')},{'model':db[_0x3bc5('0x5b')],'as':_0x3bc5('0x5a')}]});}return null;})['then'](respondWithResult(_0xc49cba,null))[_0x3bc5('0x4b')](handleError(_0xc49cba,null));};exports['getFields']=function(_0x1bbaca,_0x4afc42,_0x15d40b){var _0x1372a2='';var _0x26bd08=['id','name',_0x3bc5('0x5c'),_0x3bc5('0x5d'),'description',_0x3bc5('0x5e'),_0x3bc5('0x5f'),'duration_minutes',_0x3bc5('0x60'),_0x3bc5('0x61'),_0x3bc5('0x62'),'direction'];return db[_0x3bc5('0x48')][_0x3bc5('0x53')]({'where':{'id':_0x1bbaca[_0x3bc5('0x4c')]['id']},'attributes':['id',_0x3bc5('0x63'),'password',_0x3bc5('0x64')]})[_0x3bc5('0x2b')](handleEntityNotFound(_0x4afc42,null))[_0x3bc5('0x2b')](function(_0x569cdd){if(_0x569cdd){_0x1372a2=_0x569cdd['remoteUri'];var _0x1d91ab=_0x1372a2[_0x3bc5('0x65')](-0x1);if(_0x1d91ab==='/'){_0x1372a2=_0x1372a2[_0x3bc5('0x66')](0x0,_0x1372a2[_0x3bc5('0x67')](_0x1d91ab));}return rp({'method':_0x3bc5('0x68'),'uri':util[_0x3bc5('0x69')](_0x3bc5('0x6a'),_0x1372a2,_0x3bc5('0x6b')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3bc5('0x6c')]({'user_auth':{'user_name':_0x569cdd[_0x3bc5('0x63')],'password':_0x569cdd[_0x3bc5('0x6d')],'encryption':_0x3bc5('0x6e')},'application':_0x3bc5('0x6f')})}});}})[_0x3bc5('0x2b')](function(_0x5ae350){if(_0x5ae350&&_0x5ae350[_0x3bc5('0x2f')]!=='Invalid\x20Login'&&_0x5ae350['name']!==_0x3bc5('0x70')){return rp({'method':_0x3bc5('0x68'),'uri':util[_0x3bc5('0x69')](_0x3bc5('0x6a'),_0x1372a2,_0x3bc5('0x6b')),'json':!![],'form':{'method':_0x3bc5('0x71'),'input_type':_0x3bc5('0x72'),'response_type':_0x3bc5('0x72'),'rest_data':JSON[_0x3bc5('0x6c')]({'session':_0x5ae350['id'],'module_name':_0x3bc5('0x73')})}})[_0x3bc5('0x2b')](function(_0x1f728c){if(_0x1f728c){var _0x1e6db7=_[_0x3bc5('0x74')](_0x1f728c[_0x3bc5('0x75')]);_[_0x3bc5('0x76')](_0x1e6db7,function(_0x5a2bf4){return _0x26bd08[_0x3bc5('0x77')](_0x5a2bf4[_0x3bc5('0x2f')]);});return{'count':_0x1e6db7[_0x3bc5('0x3d')],'rows':_[_0x3bc5('0x32')](_0x1e6db7,function(_0x3c3948){return{'id':_0x3c3948['name'],'name':_0x3c3948['label'],'custom':_[_0x3bc5('0x78')](_0x3c3948[_0x3bc5('0x2f')],'_c')?!![]:![],'options':_0x3c3948['options']?_[_0x3bc5('0x32')](_[_0x3bc5('0x74')](_0x3c3948[_0x3bc5('0x47')]),function(_0x4e9995){return{'name':_0x4e9995[_0x3bc5('0x79')],'value':_0x4e9995[_0x3bc5('0x2f')]};}):[]};})};}})[_0x3bc5('0x2b')](respondWithResult(_0x4afc42,null))[_0x3bc5('0x4b')](function(_0x13d701){var _0x340314=_0x1bbaca[_0x3bc5('0x37')][_0x3bc5('0x7a')]?0x1f4:_0x13d701['statusCode']||0x1f4;logger['error'](_0x3bc5('0x7b'),_0x3bc5('0x7c'),_0x340314,JSON[_0x3bc5('0x6c')](_0x13d701));delete _0x13d701['name'];if(_0x340314===0x191){_0x340314=0x190;}_0x4afc42['status'](_0x340314)[_0x3bc5('0x30')](_0x1bbaca[_0x3bc5('0x37')][_0x3bc5('0x7a')]?{'message':_0x3bc5('0x7d'),'statusCode':_0x13d701[_0x3bc5('0x7e')]}:_0x13d701);});}else{var _0x40b3c3=0x1f4;_0x4afc42[_0x3bc5('0x20')](_0x40b3c3)[_0x3bc5('0x30')]({'message':_0x3bc5('0x7d'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x8060=['reject','save','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','SugarcrmConfiguration','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','Subjects','description','duration_hours','duration_minutes','parent_type','parent_name','direction','username','slice','substring','lastIndexOf','format','%s%s','login','JSON','stringify','password','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','/service/v4_1/rest.php','get_module_fields','values','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range'];(function(_0x5429ed,_0x55887b){var _0x358a5d=function(_0x131f41){while(--_0x131f41){_0x5429ed['push'](_0x5429ed['shift']());}};_0x358a5d(++_0x55887b);}(_0x8060,0x1c4));var _0x0806=function(_0x3011b7,_0x56b4b0){_0x3011b7=_0x3011b7-0x0;var _0x304ca2=_0x8060[_0x3011b7];return _0x304ca2;};'use strict';var emlformat=require(_0x0806('0x0'));var rimraf=require(_0x0806('0x1'));var zipdir=require(_0x0806('0x2'));var jsonpatch=require(_0x0806('0x3'));var rp=require(_0x0806('0x4'));var moment=require(_0x0806('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0806('0x6'));var path=require(_0x0806('0x7'));var sox=require('sox');var csv=require(_0x0806('0x8'));var ejs=require(_0x0806('0x9'));var fs=require('fs');var fs_extra=require(_0x0806('0xa'));var _=require('lodash');var squel=require(_0x0806('0xb'));var crypto=require(_0x0806('0xc'));var jsforce=require(_0x0806('0xd'));var deskjs=require(_0x0806('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0806('0xf'));var Redis=require(_0x0806('0x10'));var authService=require(_0x0806('0x11'));var qs=require(_0x0806('0x12'));var as=require(_0x0806('0x13'));var hardwareService=require(_0x0806('0x14'));var logger=require(_0x0806('0x15'))(_0x0806('0x16'));var utils=require(_0x0806('0x17'));var config=require(_0x0806('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x0806('0x19'));function respondWithStatusCode(_0x264343,_0x31820b){_0x31820b=_0x31820b||0xcc;return function(_0x263efc){if(_0x263efc){return _0x264343[_0x0806('0x1a')](_0x31820b);}return _0x264343[_0x0806('0x1b')](_0x31820b)[_0x0806('0x1c')]();};}function respondWithResult(_0xcae5e8,_0x2df995){_0x2df995=_0x2df995||0xc8;return function(_0x295c9b){if(_0x295c9b){return _0xcae5e8['status'](_0x2df995)[_0x0806('0x1d')](_0x295c9b);}};}function respondWithFilteredResult(_0x2cc423,_0x2ebdcd){return function(_0x40a689){if(_0x40a689){var _0x29d607=typeof _0x2ebdcd['offset']==='undefined'&&typeof _0x2ebdcd['limit']===_0x0806('0x1e');var _0x324efc=_0x40a689[_0x0806('0x1f')];var _0x38c78e=_0x29d607?0x0:_0x2ebdcd[_0x0806('0x20')];var _0x485aac=_0x29d607?_0x40a689['count']:_0x2ebdcd[_0x0806('0x20')]+_0x2ebdcd[_0x0806('0x21')];var _0x2b15c9;if(_0x485aac>=_0x324efc){_0x485aac=_0x324efc;_0x2b15c9=0xc8;}else{_0x2b15c9=0xce;}_0x2cc423[_0x0806('0x1b')](_0x2b15c9);return _0x2cc423[_0x0806('0x22')](_0x0806('0x23'),_0x38c78e+'-'+_0x485aac+'/'+_0x324efc)[_0x0806('0x1d')](_0x40a689);}return null;};}function patchUpdates(_0x16c2d8){return function(_0x1b851f){try{jsonpatch['apply'](_0x1b851f,_0x16c2d8,!![]);}catch(_0x1b0df7){return BPromise[_0x0806('0x24')](_0x1b0df7);}return _0x1b851f[_0x0806('0x25')]();};}function saveUpdates(_0x5a7ffe,_0x4376c9){return function(_0x4fcb11){if(_0x4fcb11){return _0x4fcb11['update'](_0x5a7ffe)[_0x0806('0x26')](function(_0x5a6c59){return _0x5a6c59;});}return null;};}function removeEntity(_0xb625b0,_0x4378e8){return function(_0x1af40e){if(_0x1af40e){return _0x1af40e[_0x0806('0x27')]()['then'](function(){_0xb625b0['status'](0xcc)[_0x0806('0x1c')]();});}};}function handleEntityNotFound(_0xe52344,_0x95df04){return function(_0xad45ec){if(!_0xad45ec){_0xe52344[_0x0806('0x1a')](0x194);}return _0xad45ec;};}function handleError(_0x4de97e,_0x3b8a28){_0x3b8a28=_0x3b8a28||0x1f4;return function(_0x116fa8){logger[_0x0806('0x28')](_0x116fa8[_0x0806('0x29')]);if(_0x116fa8[_0x0806('0x2a')]){delete _0x116fa8['name'];}_0x4de97e[_0x0806('0x1b')](_0x3b8a28)[_0x0806('0x2b')](_0x116fa8);};}exports[_0x0806('0x2c')]=function(_0x131cf5,_0x5da1a7){var _0x170eb1={},_0x1b8c45={},_0x268c40={'count':0x0,'rows':[]};var _0x16594a=_[_0x0806('0x2d')](db[_0x0806('0x2e')][_0x0806('0x2f')],function(_0x29bda8){return{'name':_0x29bda8[_0x0806('0x30')],'type':_0x29bda8[_0x0806('0x31')][_0x0806('0x32')]};});_0x1b8c45[_0x0806('0x33')]=_[_0x0806('0x2d')](_0x16594a,_0x0806('0x2a'));_0x1b8c45[_0x0806('0x34')]=_['keys'](_0x131cf5['query']);_0x1b8c45['filters']=_['intersection'](_0x1b8c45[_0x0806('0x33')],_0x1b8c45['query']);_0x170eb1[_0x0806('0x35')]=_[_0x0806('0x36')](_0x1b8c45[_0x0806('0x33')],qs['fields'](_0x131cf5[_0x0806('0x34')][_0x0806('0x37')]));_0x170eb1[_0x0806('0x35')]=_0x170eb1['attributes'][_0x0806('0x38')]?_0x170eb1[_0x0806('0x35')]:_0x1b8c45[_0x0806('0x33')];if(!_0x131cf5[_0x0806('0x34')]['hasOwnProperty'](_0x0806('0x39'))){_0x170eb1[_0x0806('0x21')]=qs[_0x0806('0x21')](_0x131cf5[_0x0806('0x34')][_0x0806('0x21')]);_0x170eb1[_0x0806('0x20')]=qs[_0x0806('0x20')](_0x131cf5['query']['offset']);}_0x170eb1[_0x0806('0x3a')]=qs[_0x0806('0x3b')](_0x131cf5[_0x0806('0x34')][_0x0806('0x3b')]);_0x170eb1[_0x0806('0x3c')]=qs[_0x0806('0x3d')](_[_0x0806('0x3e')](_0x131cf5[_0x0806('0x34')],_0x1b8c45[_0x0806('0x3d')]),_0x16594a);if(_0x131cf5[_0x0806('0x34')]['filter']){_0x170eb1[_0x0806('0x3c')]=_[_0x0806('0x3f')](_0x170eb1[_0x0806('0x3c')],{'$or':_['map'](_0x16594a,function(_0x548bd5){if(_0x548bd5[_0x0806('0x31')]!==_0x0806('0x40')){var _0x2e0083={};_0x2e0083[_0x548bd5[_0x0806('0x2a')]]={'$like':'%'+_0x131cf5[_0x0806('0x34')][_0x0806('0x41')]+'%'};return _0x2e0083;}})});}_0x170eb1=_[_0x0806('0x3f')]({},_0x170eb1,_0x131cf5[_0x0806('0x42')]);var _0x5455a9={'where':_0x170eb1[_0x0806('0x3c')]};return db['SugarcrmAccount'][_0x0806('0x1f')](_0x5455a9)[_0x0806('0x26')](function(_0x4cb50d){_0x268c40[_0x0806('0x1f')]=_0x4cb50d;if(_0x131cf5['query'][_0x0806('0x43')]){_0x170eb1[_0x0806('0x44')]=[{'all':!![]}];}return db[_0x0806('0x2e')][_0x0806('0x45')](_0x170eb1);})[_0x0806('0x26')](function(_0x23e3c9){_0x268c40['rows']=_0x23e3c9;return _0x268c40;})[_0x0806('0x26')](respondWithFilteredResult(_0x5da1a7,_0x170eb1))[_0x0806('0x46')](handleError(_0x5da1a7,null));};exports[_0x0806('0x47')]=function(_0x340e10,_0x402c6b){var _0xe7d9fb={'raw':![],'where':{'id':_0x340e10[_0x0806('0x48')]['id']}},_0x445ca0={};_0x445ca0[_0x0806('0x33')]=_[_0x0806('0x49')](db[_0x0806('0x2e')][_0x0806('0x2f')]);_0x445ca0[_0x0806('0x34')]=_['keys'](_0x340e10['query']);_0x445ca0[_0x0806('0x3d')]=_[_0x0806('0x36')](_0x445ca0['model'],_0x445ca0[_0x0806('0x34')]);_0xe7d9fb[_0x0806('0x35')]=_[_0x0806('0x36')](_0x445ca0[_0x0806('0x33')],qs['fields'](_0x340e10[_0x0806('0x34')][_0x0806('0x37')]));_0xe7d9fb[_0x0806('0x35')]=_0xe7d9fb[_0x0806('0x35')][_0x0806('0x38')]?_0xe7d9fb['attributes']:_0x445ca0[_0x0806('0x33')];if(_0x340e10['query'][_0x0806('0x43')]){_0xe7d9fb[_0x0806('0x44')]=[{'all':!![]}];}_0xe7d9fb=_[_0x0806('0x3f')]({},_0xe7d9fb,_0x340e10[_0x0806('0x42')]);return db[_0x0806('0x2e')][_0x0806('0x4a')](_0xe7d9fb)[_0x0806('0x26')](handleEntityNotFound(_0x402c6b,null))[_0x0806('0x26')](respondWithResult(_0x402c6b,null))[_0x0806('0x46')](handleError(_0x402c6b,null));};exports[_0x0806('0x4b')]=function(_0x3f028d,_0x2e1f69){return db[_0x0806('0x2e')][_0x0806('0x4b')](_0x3f028d[_0x0806('0x4c')],{})['then'](respondWithResult(_0x2e1f69,0xc9))[_0x0806('0x46')](handleError(_0x2e1f69,null));};exports['update']=function(_0x3323af,_0x160373){if(_0x3323af['body']['id']){delete _0x3323af[_0x0806('0x4c')]['id'];}return db['SugarcrmAccount'][_0x0806('0x4a')]({'where':{'id':_0x3323af[_0x0806('0x48')]['id']}})['then'](handleEntityNotFound(_0x160373,null))[_0x0806('0x26')](saveUpdates(_0x3323af[_0x0806('0x4c')],null))[_0x0806('0x26')](respondWithResult(_0x160373,null))[_0x0806('0x46')](handleError(_0x160373,null));};exports['destroy']=function(_0x301494,_0x196903){return db[_0x0806('0x2e')]['find']({'where':{'id':_0x301494[_0x0806('0x48')]['id']}})['then'](handleEntityNotFound(_0x196903,null))['then'](removeEntity(_0x196903,null))[_0x0806('0x46')](handleError(_0x196903,null));};exports['getConfigurations']=function(_0x171781,_0x5101b9,_0xd5a5b2){var _0x17f51d={};var _0x3bcc9a={};var _0x11a1b7;var _0x5bfd25;return db[_0x0806('0x2e')]['findOne']({'where':{'id':_0x171781['params']['id']}})[_0x0806('0x26')](handleEntityNotFound(_0x5101b9,null))[_0x0806('0x26')](function(_0x11077d){if(_0x11077d){_0x11a1b7=_0x11077d;_0x3bcc9a['model']=_[_0x0806('0x49')](db[_0x0806('0x4d')][_0x0806('0x2f')]);_0x3bcc9a['query']=_[_0x0806('0x49')](_0x171781[_0x0806('0x34')]);_0x3bcc9a['filters']=_[_0x0806('0x36')](_0x3bcc9a['model'],_0x3bcc9a['query']);_0x17f51d[_0x0806('0x35')]=_['intersection'](_0x3bcc9a[_0x0806('0x33')],qs[_0x0806('0x37')](_0x171781[_0x0806('0x34')][_0x0806('0x37')]));_0x17f51d['attributes']=_0x17f51d[_0x0806('0x35')]['length']?_0x17f51d[_0x0806('0x35')]:_0x3bcc9a[_0x0806('0x33')];_0x17f51d[_0x0806('0x3a')]=qs['sort'](_0x171781['query']['sort']);_0x17f51d[_0x0806('0x3c')]=qs[_0x0806('0x3d')](_['pick'](_0x171781['query'],_0x3bcc9a[_0x0806('0x3d')]));if(_0x171781[_0x0806('0x34')]['filter']){_0x17f51d[_0x0806('0x3c')]=_['merge'](_0x17f51d[_0x0806('0x3c')],{'$or':_[_0x0806('0x2d')](_0x17f51d[_0x0806('0x35')],function(_0x380423){var _0x380e28={};_0x380e28[_0x380423]={'$like':'%'+_0x171781[_0x0806('0x34')][_0x0806('0x41')]+'%'};return _0x380e28;})});}_0x17f51d=_['merge']({},_0x17f51d,_0x171781[_0x0806('0x42')]);return _0x11a1b7[_0x0806('0x4e')](_0x17f51d);}})[_0x0806('0x26')](function(_0x1141b3){if(_0x1141b3){_0x5bfd25=_0x1141b3['length'];if(!_0x171781[_0x0806('0x34')][_0x0806('0x4f')]('nolimit')){_0x17f51d[_0x0806('0x21')]=qs[_0x0806('0x21')](_0x171781['query'][_0x0806('0x21')]);_0x17f51d['offset']=qs[_0x0806('0x20')](_0x171781[_0x0806('0x34')]['offset']);}return _0x11a1b7[_0x0806('0x4e')](_0x17f51d);}})['then'](function(_0x53b5eb){if(_0x53b5eb){return _0x53b5eb?{'count':_0x5bfd25,'rows':_0x53b5eb}:null;}})[_0x0806('0x26')](respondWithResult(_0x5101b9,null))['catch'](handleError(_0x5101b9,null));};exports[_0x0806('0x50')]=function(_0x35c00c,_0xd1c597,_0x21d50b){if(_0x35c00c[_0x0806('0x4c')]['id']){delete _0x35c00c[_0x0806('0x4c')]['id'];}return db[_0x0806('0x2e')][_0x0806('0x51')]({'where':{'id':_0x35c00c[_0x0806('0x48')]['id']}})[_0x0806('0x26')](handleEntityNotFound(_0xd1c597,null))[_0x0806('0x26')](function(_0x49a801){if(_0x49a801){_0x35c00c['body'][_0x0806('0x52')]=_0x49a801['id'];_0x35c00c['body']['Subjects']=integrations[_0x0806('0x53')](_0x35c00c[_0x0806('0x4c')][_0x0806('0x54')],_0x35c00c[_0x0806('0x4c')][_0x0806('0x31')]);_0x35c00c[_0x0806('0x4c')][_0x0806('0x55')]=integrations[_0x0806('0x56')](_0x35c00c[_0x0806('0x4c')][_0x0806('0x54')],_0x35c00c[_0x0806('0x4c')][_0x0806('0x31')]);return db['SugarcrmConfiguration'][_0x0806('0x4b')](_0x35c00c[_0x0806('0x4c')],{'include':[{'model':db[_0x0806('0x57')],'as':_0x0806('0x58')},{'model':db[_0x0806('0x57')],'as':_0x0806('0x55')}]});}return null;})['then'](respondWithResult(_0xd1c597,null))[_0x0806('0x46')](handleError(_0xd1c597,null));};exports['getFields']=function(_0xee6cc7,_0x2982a3,_0x1462c7){var _0x356eac='';var _0x5efe5c=['id',_0x0806('0x2a'),'assigned_user_id','created_by',_0x0806('0x59'),'date_start',_0x0806('0x5a'),_0x0806('0x5b'),'parent_id',_0x0806('0x5c'),_0x0806('0x5d'),_0x0806('0x5e')];return db[_0x0806('0x2e')][_0x0806('0x51')]({'where':{'id':_0xee6cc7['params']['id']},'attributes':['id',_0x0806('0x5f'),'password','remoteUri']})[_0x0806('0x26')](handleEntityNotFound(_0x2982a3,null))[_0x0806('0x26')](function(_0x2149cc){if(_0x2149cc){_0x356eac=_0x2149cc['remoteUri'];var _0x2f5ef1=_0x356eac[_0x0806('0x60')](-0x1);if(_0x2f5ef1==='/'){_0x356eac=_0x356eac[_0x0806('0x61')](0x0,_0x356eac[_0x0806('0x62')](_0x2f5ef1));}return rp({'method':'POST','uri':util[_0x0806('0x63')](_0x0806('0x64'),_0x356eac,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x0806('0x65'),'input_type':_0x0806('0x66'),'response_type':_0x0806('0x66'),'rest_data':JSON[_0x0806('0x67')]({'user_auth':{'user_name':_0x2149cc['username'],'password':_0x2149cc[_0x0806('0x68')],'encryption':'PLAIN'},'application':_0x0806('0x69')})}});}})[_0x0806('0x26')](function(_0x245c8b){if(_0x245c8b&&_0x245c8b[_0x0806('0x2a')]!==_0x0806('0x6a')&&_0x245c8b['name']!==_0x0806('0x6b')){return rp({'method':_0x0806('0x6c'),'uri':util['format']('%s%s',_0x356eac,_0x0806('0x6d')),'json':!![],'form':{'method':_0x0806('0x6e'),'input_type':_0x0806('0x66'),'response_type':_0x0806('0x66'),'rest_data':JSON[_0x0806('0x67')]({'session':_0x245c8b['id'],'module_name':'Calls'})}})[_0x0806('0x26')](function(_0x4a71ab){if(_0x4a71ab){var _0x2f0df3=_[_0x0806('0x6f')](_0x4a71ab['module_fields']);_[_0x0806('0x70')](_0x2f0df3,function(_0xcdf6f7){return _0x5efe5c[_0x0806('0x71')](_0xcdf6f7[_0x0806('0x2a')]);});return{'count':_0x2f0df3[_0x0806('0x38')],'rows':_[_0x0806('0x2d')](_0x2f0df3,function(_0x24f456){return{'id':_0x24f456[_0x0806('0x2a')],'name':_0x24f456[_0x0806('0x72')],'custom':_[_0x0806('0x73')](_0x24f456[_0x0806('0x2a')],'_c')?!![]:![],'options':_0x24f456[_0x0806('0x42')]?_[_0x0806('0x2d')](_[_0x0806('0x6f')](_0x24f456[_0x0806('0x42')]),function(_0x432886){return{'name':_0x432886[_0x0806('0x74')],'value':_0x432886['name']};}):[]};})};}})['then'](respondWithResult(_0x2982a3,null))['catch'](function(_0x725a3f){var _0x2f462d=_0xee6cc7['query'][_0x0806('0x75')]?0x1f4:_0x725a3f[_0x0806('0x76')]||0x1f4;logger[_0x0806('0x28')](_0x0806('0x77'),_0x0806('0x78'),_0x2f462d,JSON[_0x0806('0x67')](_0x725a3f));delete _0x725a3f[_0x0806('0x2a')];if(_0x2f462d===0x191){_0x2f462d=0x190;}_0x2982a3['status'](_0x2f462d)[_0x0806('0x2b')](_0xee6cc7[_0x0806('0x34')]['test']?{'message':_0x0806('0x79'),'statusCode':_0x725a3f['statusCode']}:_0x725a3f);});}else{var _0x4f50f6=0x1f4;_0x2982a3['status'](_0x4f50f6)[_0x0806('0x2b')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 344006b..c554386 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 _0x4365=['int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x30cd1e,_0x21f3e6){var _0x8d8dc7=function(_0x353499){while(--_0x353499){_0x30cd1e['push'](_0x30cd1e['shift']());}};_0x8d8dc7(++_0x21f3e6);}(_0x4365,0x143));var _0x5436=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0x4365[_0x1460f6];return _0x46ce94;};'use strict';var _=require(_0x5436('0x0'));var util=require(_0x5436('0x1'));var logger=require('../../config/logger')(_0x5436('0x2'));var moment=require(_0x5436('0x3'));var BPromise=require(_0x5436('0x4'));var rp=require(_0x5436('0x5'));var fs=require('fs');var path=require(_0x5436('0x6'));var rimraf=require(_0x5436('0x7'));var config=require(_0x5436('0x8'));var attributes=require(_0x5436('0x9'));var integrations=require(_0x5436('0xa'));module[_0x5436('0xb')]=function(_0x3ec009,_0x15f92f){return _0x3ec009[_0x5436('0xc')]('SugarcrmAccount',attributes,{'tableName':_0x5436('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe53d=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','SugarcrmAccount'];(function(_0x59047c,_0x17f4ba){var _0x1db6cb=function(_0x33aa6e){while(--_0x33aa6e){_0x59047c['push'](_0x59047c['shift']());}};_0x1db6cb(++_0x17f4ba);}(_0xe53d,0x1a7));var _0xde53=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xe53d[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xde53('0x0'))(_0xde53('0x1'));var moment=require(_0xde53('0x2'));var BPromise=require(_0xde53('0x3'));var rp=require(_0xde53('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde53('0x5'));var config=require(_0xde53('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xde53('0x7'));module['exports']=function(_0x10d74c,_0x438695){return _0x10d74c['define'](_0xde53('0x8'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 7cbace4..c56922c 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 _0x6c00=['findAll','options','raw','where','attributes','limit','map','model','include','then','GetSugarcrmAccount','ShowSugarcrmAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','SugarcrmAccount'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x6c00,0x135));var _0x06c0=function(_0x2665a3,_0x3bac99){_0x2665a3=_0x2665a3-0x0;var _0x586de6=_0x6c00[_0x2665a3];return _0x586de6;};'use strict';var _=require('lodash');var util=require(_0x06c0('0x0'));var moment=require(_0x06c0('0x1'));var BPromise=require(_0x06c0('0x2'));var rs=require(_0x06c0('0x3'));var fs=require('fs');var Redis=require(_0x06c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x06c0('0x5'))(_0x06c0('0x6'));var config=require(_0x06c0('0x7'));var jayson=require(_0x06c0('0x8'));var client=jayson[_0x06c0('0x9')][_0x06c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3281e1,_0x20c88e,_0x3c0632){return new BPromise(function(_0x7232b4,_0x53388d){return client[_0x06c0('0xb')](_0x3281e1,_0x3c0632)['then'](function(_0x4cc5d6){logger[_0x06c0('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x20c88e,_0x06c0('0xd'));logger[_0x06c0('0xe')](_0x06c0('0xf'),_0x20c88e,_0x06c0('0xd'),JSON[_0x06c0('0x10')](_0x4cc5d6));if(_0x4cc5d6['error']){if(_0x4cc5d6[_0x06c0('0x11')][_0x06c0('0x12')]===0x1f4){logger[_0x06c0('0x11')](_0x06c0('0x13'),_0x20c88e,_0x4cc5d6[_0x06c0('0x11')][_0x06c0('0x14')]);return _0x53388d(_0x4cc5d6[_0x06c0('0x11')][_0x06c0('0x14')]);}logger['error'](_0x06c0('0x13'),_0x20c88e,_0x4cc5d6[_0x06c0('0x11')]['message']);return _0x7232b4(_0x4cc5d6['error'][_0x06c0('0x14')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x20c88e,_0x06c0('0xd'));_0x7232b4(_0x4cc5d6[_0x06c0('0x15')][_0x06c0('0x14')]);}})[_0x06c0('0x16')](function(_0x4b8987){logger['error'](_0x06c0('0x13'),_0x20c88e,_0x4b8987);_0x53388d(_0x4b8987);});});}exports['GetSugarcrmAccount']=function(_0x7e08b2){var _0x3ad484=this;return new Promise(function(_0x1a13a1,_0x3c9bee){return db[_0x06c0('0x17')][_0x06c0('0x18')]({'raw':_0x7e08b2[_0x06c0('0x19')]?_0x7e08b2[_0x06c0('0x19')][_0x06c0('0x1a')]===undefined?!![]:![]:!![],'where':_0x7e08b2[_0x06c0('0x19')]?_0x7e08b2[_0x06c0('0x19')][_0x06c0('0x1b')]||null:null,'attributes':_0x7e08b2['options']?_0x7e08b2['options'][_0x06c0('0x1c')]||null:null,'limit':_0x7e08b2['options']?_0x7e08b2[_0x06c0('0x19')][_0x06c0('0x1d')]||null:null,'include':_0x7e08b2[_0x06c0('0x19')]?_0x7e08b2['options']['include']?_[_0x06c0('0x1e')](_0x7e08b2['options']['include'],function(_0x15da84){return{'model':db[_0x15da84[_0x06c0('0x1f')]],'as':_0x15da84['as'],'attributes':_0x15da84['attributes'],'include':_0x15da84['include']?_[_0x06c0('0x1e')](_0x15da84['include'],function(_0x3aa0e1){return{'model':db[_0x3aa0e1[_0x06c0('0x1f')]],'as':_0x3aa0e1['as'],'attributes':_0x3aa0e1[_0x06c0('0x1c')],'include':_0x3aa0e1[_0x06c0('0x20')]?_['map'](_0x3aa0e1[_0x06c0('0x20')],function(_0x39cc60){return{'model':db[_0x39cc60['model']],'as':_0x39cc60['as'],'attributes':_0x39cc60['attributes']};}):[]};}):[]};}):[]:[]})[_0x06c0('0x21')](function(_0x3fe164){logger[_0x06c0('0xc')](_0x06c0('0x22'),_0x7e08b2);logger[_0x06c0('0xe')](_0x06c0('0x22'),_0x7e08b2,JSON[_0x06c0('0x10')](_0x3fe164));_0x1a13a1(_0x3fe164);})[_0x06c0('0x16')](function(_0x17a874){logger['error']('GetSugarcrmAccount',_0x17a874[_0x06c0('0x14')],_0x7e08b2);_0x3c9bee(_0x3ad484[_0x06c0('0x11')](0x1f4,_0x17a874[_0x06c0('0x14')]));});});};exports[_0x06c0('0x23')]=function(_0x58aca8){var _0x141aa9=this;return new Promise(function(_0x49062a,_0x1a4f7c){return db[_0x06c0('0x17')][_0x06c0('0x24')]({'raw':_0x58aca8[_0x06c0('0x19')]?_0x58aca8['options'][_0x06c0('0x1a')]===undefined?!![]:![]:!![],'where':_0x58aca8[_0x06c0('0x19')]?_0x58aca8[_0x06c0('0x19')][_0x06c0('0x1b')]||null:null,'attributes':_0x58aca8[_0x06c0('0x19')]?_0x58aca8[_0x06c0('0x19')]['attributes']||null:null,'include':_0x58aca8['options']?_0x58aca8[_0x06c0('0x19')][_0x06c0('0x20')]?_[_0x06c0('0x1e')](_0x58aca8[_0x06c0('0x19')]['include'],function(_0x26a00e){return{'model':db[_0x26a00e[_0x06c0('0x1f')]],'as':_0x26a00e['as'],'attributes':_0x26a00e[_0x06c0('0x1c')],'include':_0x26a00e[_0x06c0('0x20')]?_[_0x06c0('0x1e')](_0x26a00e[_0x06c0('0x20')],function(_0x2028cb){return{'model':db[_0x2028cb['model']],'as':_0x2028cb['as'],'attributes':_0x2028cb['attributes'],'include':_0x2028cb['include']?_[_0x06c0('0x1e')](_0x2028cb[_0x06c0('0x20')],function(_0x5655ba){return{'model':db[_0x5655ba[_0x06c0('0x1f')]],'as':_0x5655ba['as'],'attributes':_0x5655ba['attributes']};}):[]};}):[]};}):[]:[]})[_0x06c0('0x21')](function(_0x29fea0){logger['info'](_0x06c0('0x23'),_0x58aca8);logger[_0x06c0('0xe')](_0x06c0('0x23'),_0x58aca8,JSON[_0x06c0('0x10')](_0x29fea0));_0x49062a(_0x29fea0);})[_0x06c0('0x16')](function(_0x1333c8){logger[_0x06c0('0x11')]('ShowSugarcrmAccount',_0x1333c8[_0x06c0('0x14')],_0x58aca8);_0x1a4f7c(_0x141aa9[_0x06c0('0x11')](0x1f4,_0x1333c8[_0x06c0('0x14')]));});});}; \ No newline at end of file +var _0xa7c9=['where','attributes','include','model','map','stringify','catch','ShowSugarcrmAccount','find','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','GetSugarcrmAccount','SugarcrmAccount','options','raw'];(function(_0x35a224,_0x25b03e){var _0x4777ac=function(_0x1c369b){while(--_0x1c369b){_0x35a224['push'](_0x35a224['shift']());}};_0x4777ac(++_0x25b03e);}(_0xa7c9,0x149));var _0x9a7c=function(_0x1005e0,_0x50938e){_0x1005e0=_0x1005e0-0x0;var _0x2e5178=_0xa7c9[_0x1005e0];return _0x2e5178;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9a7c('0x0'));var fs=require('fs');var Redis=require(_0x9a7c('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a7c('0x2'));var logger=require(_0x9a7c('0x3'))(_0x9a7c('0x4'));var config=require(_0x9a7c('0x5'));var jayson=require(_0x9a7c('0x6'));var client=jayson[_0x9a7c('0x7')][_0x9a7c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x204e64,_0x4ad6b7,_0x5aec8f){return new BPromise(function(_0x558221,_0x59064a){return client[_0x9a7c('0x9')](_0x204e64,_0x5aec8f)[_0x9a7c('0xa')](function(_0x4fd93f){logger[_0x9a7c('0xb')](_0x9a7c('0xc'),_0x4ad6b7,_0x9a7c('0xd'));logger[_0x9a7c('0xe')](_0x9a7c('0xf'),_0x4ad6b7,'request\x20sent',JSON['stringify'](_0x4fd93f));if(_0x4fd93f[_0x9a7c('0x10')]){if(_0x4fd93f[_0x9a7c('0x10')][_0x9a7c('0x11')]===0x1f4){logger[_0x9a7c('0x10')](_0x9a7c('0xc'),_0x4ad6b7,_0x4fd93f[_0x9a7c('0x10')][_0x9a7c('0x12')]);return _0x59064a(_0x4fd93f[_0x9a7c('0x10')][_0x9a7c('0x12')]);}logger[_0x9a7c('0x10')](_0x9a7c('0xc'),_0x4ad6b7,_0x4fd93f['error'][_0x9a7c('0x12')]);return _0x558221(_0x4fd93f[_0x9a7c('0x10')]['message']);}else{logger[_0x9a7c('0xb')](_0x9a7c('0xc'),_0x4ad6b7,'request\x20sent');_0x558221(_0x4fd93f['result'][_0x9a7c('0x12')]);}})['catch'](function(_0x450eca){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x4ad6b7,_0x450eca);_0x59064a(_0x450eca);});});}exports[_0x9a7c('0x13')]=function(_0x1bbc50){var _0x432770=this;return new Promise(function(_0x453185,_0x3a1c94){return db[_0x9a7c('0x14')]['findAll']({'raw':_0x1bbc50[_0x9a7c('0x15')]?_0x1bbc50[_0x9a7c('0x15')][_0x9a7c('0x16')]===undefined?!![]:![]:!![],'where':_0x1bbc50[_0x9a7c('0x15')]?_0x1bbc50['options'][_0x9a7c('0x17')]||null:null,'attributes':_0x1bbc50[_0x9a7c('0x15')]?_0x1bbc50[_0x9a7c('0x15')][_0x9a7c('0x18')]||null:null,'limit':_0x1bbc50[_0x9a7c('0x15')]?_0x1bbc50[_0x9a7c('0x15')]['limit']||null:null,'include':_0x1bbc50[_0x9a7c('0x15')]?_0x1bbc50[_0x9a7c('0x15')][_0x9a7c('0x19')]?_['map'](_0x1bbc50[_0x9a7c('0x15')][_0x9a7c('0x19')],function(_0x260b4f){return{'model':db[_0x260b4f[_0x9a7c('0x1a')]],'as':_0x260b4f['as'],'attributes':_0x260b4f[_0x9a7c('0x18')],'include':_0x260b4f[_0x9a7c('0x19')]?_[_0x9a7c('0x1b')](_0x260b4f[_0x9a7c('0x19')],function(_0x21a3e8){return{'model':db[_0x21a3e8[_0x9a7c('0x1a')]],'as':_0x21a3e8['as'],'attributes':_0x21a3e8[_0x9a7c('0x18')],'include':_0x21a3e8[_0x9a7c('0x19')]?_[_0x9a7c('0x1b')](_0x21a3e8[_0x9a7c('0x19')],function(_0x5726d6){return{'model':db[_0x5726d6['model']],'as':_0x5726d6['as'],'attributes':_0x5726d6[_0x9a7c('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9a7c('0xa')](function(_0x199ede){logger[_0x9a7c('0xb')]('GetSugarcrmAccount',_0x1bbc50);logger[_0x9a7c('0xe')](_0x9a7c('0x13'),_0x1bbc50,JSON[_0x9a7c('0x1c')](_0x199ede));_0x453185(_0x199ede);})[_0x9a7c('0x1d')](function(_0x505bdc){logger['error'](_0x9a7c('0x13'),_0x505bdc['message'],_0x1bbc50);_0x3a1c94(_0x432770['error'](0x1f4,_0x505bdc[_0x9a7c('0x12')]));});});};exports[_0x9a7c('0x1e')]=function(_0x4fab82){var _0x389c18=this;return new Promise(function(_0x5f0caf,_0x5efd08){return db[_0x9a7c('0x14')][_0x9a7c('0x1f')]({'raw':_0x4fab82[_0x9a7c('0x15')]?_0x4fab82[_0x9a7c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4fab82[_0x9a7c('0x15')]?_0x4fab82[_0x9a7c('0x15')][_0x9a7c('0x17')]||null:null,'attributes':_0x4fab82[_0x9a7c('0x15')]?_0x4fab82[_0x9a7c('0x15')][_0x9a7c('0x18')]||null:null,'include':_0x4fab82[_0x9a7c('0x15')]?_0x4fab82[_0x9a7c('0x15')][_0x9a7c('0x19')]?_['map'](_0x4fab82[_0x9a7c('0x15')][_0x9a7c('0x19')],function(_0x4496a8){return{'model':db[_0x4496a8['model']],'as':_0x4496a8['as'],'attributes':_0x4496a8['attributes'],'include':_0x4496a8[_0x9a7c('0x19')]?_[_0x9a7c('0x1b')](_0x4496a8[_0x9a7c('0x19')],function(_0x47721e){return{'model':db[_0x47721e[_0x9a7c('0x1a')]],'as':_0x47721e['as'],'attributes':_0x47721e[_0x9a7c('0x18')],'include':_0x47721e[_0x9a7c('0x19')]?_[_0x9a7c('0x1b')](_0x47721e[_0x9a7c('0x19')],function(_0x45d403){return{'model':db[_0x45d403[_0x9a7c('0x1a')]],'as':_0x45d403['as'],'attributes':_0x45d403['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4af88a){logger[_0x9a7c('0xb')](_0x9a7c('0x1e'),_0x4fab82);logger[_0x9a7c('0xe')](_0x9a7c('0x1e'),_0x4fab82,JSON[_0x9a7c('0x1c')](_0x4af88a));_0x5f0caf(_0x4af88a);})['catch'](function(_0x327dd7){logger[_0x9a7c('0x10')](_0x9a7c('0x1e'),_0x327dd7[_0x9a7c('0x12')],_0x4fab82);_0x5efd08(_0x389c18[_0x9a7c('0x10')](0x1f4,_0x327dd7[_0x9a7c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 13759fd..dca6c18 100644 --- a/server/api/intSugarcrmConfiguration/index.js +++ b/server/api/intSugarcrmConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3521=['getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects'];(function(_0x848da6,_0x1d1701){var _0x1c4a38=function(_0xa17960){while(--_0xa17960){_0x848da6['push'](_0x848da6['shift']());}};_0x1c4a38(++_0x1d1701);}(_0x3521,0x129));var _0x1352=function(_0x3c4087,_0x5c764b){_0x3c4087=_0x3c4087-0x0;var _0x23ad1f=_0x3521[_0x3c4087];return _0x23ad1f;};'use strict';var multer=require(_0x1352('0x0'));var util=require('util');var path=require(_0x1352('0x1'));var timeout=require(_0x1352('0x2'));var express=require(_0x1352('0x3'));var router=express[_0x1352('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1352('0x5'));var config=require(_0x1352('0x6'));var controller=require(_0x1352('0x7'));router['get']('/',auth[_0x1352('0x8')](),controller[_0x1352('0x9')]);router[_0x1352('0xa')](_0x1352('0xb'),auth[_0x1352('0x8')](),controller['show']);router[_0x1352('0xa')](_0x1352('0xc'),auth['isAuthenticated'](),controller[_0x1352('0xd')]);router[_0x1352('0xa')](_0x1352('0xe'),auth['isAuthenticated'](),controller[_0x1352('0xf')]);router[_0x1352('0xa')](_0x1352('0x10'),auth[_0x1352('0x8')](),controller[_0x1352('0x11')]);router[_0x1352('0x12')]('/',auth['isAuthenticated'](),controller[_0x1352('0x13')]);router[_0x1352('0x14')](_0x1352('0xb'),auth[_0x1352('0x8')](),controller[_0x1352('0x15')]);router[_0x1352('0x16')](_0x1352('0xb'),auth[_0x1352('0x8')](),controller[_0x1352('0x17')]);module['exports']=router; \ No newline at end of file +var _0xc489=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc489,0x13b));var _0x9c48=function(_0x3fa5e7,_0x2ca1fb){_0x3fa5e7=_0x3fa5e7-0x0;var _0x12cc9e=_0xc489[_0x3fa5e7];return _0x12cc9e;};'use strict';var multer=require(_0x9c48('0x0'));var util=require(_0x9c48('0x1'));var path=require('path');var timeout=require(_0x9c48('0x2'));var express=require(_0x9c48('0x3'));var router=express[_0x9c48('0x4')]();var fs_extra=require(_0x9c48('0x5'));var auth=require(_0x9c48('0x6'));var interaction=require(_0x9c48('0x7'));var config=require('../../config/environment');var controller=require(_0x9c48('0x8'));router[_0x9c48('0x9')]('/',auth[_0x9c48('0xa')](),controller[_0x9c48('0xb')]);router[_0x9c48('0x9')]('/:id',auth[_0x9c48('0xa')](),controller[_0x9c48('0xc')]);router['get'](_0x9c48('0xd'),auth[_0x9c48('0xa')](),controller[_0x9c48('0xe')]);router[_0x9c48('0x9')]('/:id/subjects',auth[_0x9c48('0xa')](),controller[_0x9c48('0xf')]);router[_0x9c48('0x9')](_0x9c48('0x10'),auth[_0x9c48('0xa')](),controller[_0x9c48('0x11')]);router[_0x9c48('0x12')]('/',auth[_0x9c48('0xa')](),controller['create']);router[_0x9c48('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x9c48('0x14')]);router[_0x9c48('0x15')]('/:id',auth[_0x9c48('0xa')](),controller[_0x9c48('0x16')]);module[_0x9c48('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 11868f2..d12f5c4 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 _0x9177=['STRING','sequelize','exports'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x9177,0x157));var _0x7917=function(_0x4ee9cd,_0xd375b0){_0x4ee9cd=_0x4ee9cd-0x0;var _0x328a5b=_0x9177[_0x4ee9cd];return _0x328a5b;};'use strict';var Sequelize=require(_0x7917('0x0'));module[_0x7917('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7917('0x2')]}}; \ No newline at end of file +var _0x73c2=['STRING','sequelize','exports'];(function(_0x3621a8,_0x39de12){var _0x213f8d=function(_0x33309f){while(--_0x33309f){_0x3621a8['push'](_0x3621a8['shift']());}};_0x213f8d(++_0x39de12);}(_0x73c2,0x76));var _0x273c=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x73c2[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x273c('0x0'));module[_0x273c('0x1')]={'name':{'type':Sequelize[_0x273c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 33881f0..802cde4 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 _0x4d1d=['order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','body','findOne','SugarcrmField','hasOwnProperty','getSubjects'];(function(_0x3d2d6f,_0x368872){var _0x5c0022=function(_0x408819){while(--_0x408819){_0x3d2d6f['push'](_0x3d2d6f['shift']());}};_0x5c0022(++_0x368872);}(_0x4d1d,0xf2));var _0xd4d1=function(_0x24c56d,_0x588f4f){_0x24c56d=_0x24c56d-0x0;var _0x4073d1=_0x4d1d[_0x24c56d];return _0x4073d1;};'use strict';var emlformat=require(_0xd4d1('0x0'));var rimraf=require(_0xd4d1('0x1'));var zipdir=require(_0xd4d1('0x2'));var jsonpatch=require(_0xd4d1('0x3'));var rp=require(_0xd4d1('0x4'));var moment=require(_0xd4d1('0x5'));var BPromise=require(_0xd4d1('0x6'));var Mustache=require(_0xd4d1('0x7'));var util=require(_0xd4d1('0x8'));var path=require('path');var sox=require(_0xd4d1('0x9'));var csv=require(_0xd4d1('0xa'));var ejs=require(_0xd4d1('0xb'));var fs=require('fs');var fs_extra=require(_0xd4d1('0xc'));var _=require(_0xd4d1('0xd'));var squel=require(_0xd4d1('0xe'));var crypto=require(_0xd4d1('0xf'));var jsforce=require(_0xd4d1('0x10'));var deskjs=require(_0xd4d1('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd4d1('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd4d1('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4d1('0x14'));var logger=require(_0xd4d1('0x15'))(_0xd4d1('0x16'));var utils=require(_0xd4d1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd4d1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x256c4e,_0x1c9a31){_0x1c9a31=_0x1c9a31||0xcc;return function(_0x428c5f){if(_0x428c5f){return _0x256c4e[_0xd4d1('0x19')](_0x1c9a31);}return _0x256c4e['status'](_0x1c9a31)[_0xd4d1('0x1a')]();};}function respondWithResult(_0x339855,_0xdb29b){_0xdb29b=_0xdb29b||0xc8;return function(_0x1e0a1c){if(_0x1e0a1c){return _0x339855[_0xd4d1('0x1b')](_0xdb29b)[_0xd4d1('0x1c')](_0x1e0a1c);}};}function respondWithFilteredResult(_0x4b4838,_0x183df8){return function(_0xa20f80){if(_0xa20f80){var _0x1c4aaa=typeof _0x183df8[_0xd4d1('0x1d')]===_0xd4d1('0x1e')&&typeof _0x183df8['limit']===_0xd4d1('0x1e');var _0x5f75e0=_0xa20f80[_0xd4d1('0x1f')];var _0x5ac0ac=_0x1c4aaa?0x0:_0x183df8[_0xd4d1('0x1d')];var _0x17215b=_0x1c4aaa?_0xa20f80[_0xd4d1('0x1f')]:_0x183df8[_0xd4d1('0x1d')]+_0x183df8[_0xd4d1('0x20')];var _0x4e2123;if(_0x17215b>=_0x5f75e0){_0x17215b=_0x5f75e0;_0x4e2123=0xc8;}else{_0x4e2123=0xce;}_0x4b4838[_0xd4d1('0x1b')](_0x4e2123);return _0x4b4838[_0xd4d1('0x21')](_0xd4d1('0x22'),_0x5ac0ac+'-'+_0x17215b+'/'+_0x5f75e0)['json'](_0xa20f80);}return null;};}function patchUpdates(_0x3fcd63){return function(_0x2ea332){try{jsonpatch[_0xd4d1('0x23')](_0x2ea332,_0x3fcd63,!![]);}catch(_0x40f9f2){return BPromise['reject'](_0x40f9f2);}return _0x2ea332[_0xd4d1('0x24')]();};}function saveUpdates(_0x199b0a,_0x28f464){return function(_0x42f032){if(_0x42f032){return _0x42f032[_0xd4d1('0x25')](_0x199b0a)['then'](function(_0x561b42){return _0x561b42;});}return null;};}function removeEntity(_0x484c4d,_0x2784cd){return function(_0x113088){if(_0x113088){return _0x113088[_0xd4d1('0x26')]()[_0xd4d1('0x27')](function(){_0x484c4d[_0xd4d1('0x1b')](0xcc)[_0xd4d1('0x1a')]();});}};}function handleEntityNotFound(_0x391796,_0x46a76e){return function(_0x1fb002){if(!_0x1fb002){_0x391796[_0xd4d1('0x19')](0x194);}return _0x1fb002;};}function handleError(_0x8274de,_0x663255){_0x663255=_0x663255||0x1f4;return function(_0xd388b3){logger['error'](_0xd388b3['stack']);if(_0xd388b3['name']){delete _0xd388b3['name'];}_0x8274de['status'](_0x663255)[_0xd4d1('0x28')](_0xd388b3);};}exports[_0xd4d1('0x29')]=function(_0x3e53ae,_0x3fc696){var _0x1789c4={},_0xcf59ff={},_0x199789={'count':0x0,'rows':[]};var _0x1368ab=_[_0xd4d1('0x2a')](db[_0xd4d1('0x2b')][_0xd4d1('0x2c')],function(_0x8fb3fc){return{'name':_0x8fb3fc[_0xd4d1('0x2d')],'type':_0x8fb3fc[_0xd4d1('0x2e')][_0xd4d1('0x2f')]};});_0xcf59ff[_0xd4d1('0x30')]=_['map'](_0x1368ab,_0xd4d1('0x31'));_0xcf59ff['query']=_['keys'](_0x3e53ae[_0xd4d1('0x32')]);_0xcf59ff[_0xd4d1('0x33')]=_['intersection'](_0xcf59ff['model'],_0xcf59ff[_0xd4d1('0x32')]);_0x1789c4[_0xd4d1('0x34')]=_['intersection'](_0xcf59ff[_0xd4d1('0x30')],qs['fields'](_0x3e53ae['query'][_0xd4d1('0x35')]));_0x1789c4[_0xd4d1('0x34')]=_0x1789c4[_0xd4d1('0x34')][_0xd4d1('0x36')]?_0x1789c4[_0xd4d1('0x34')]:_0xcf59ff[_0xd4d1('0x30')];if(!_0x3e53ae['query']['hasOwnProperty'](_0xd4d1('0x37'))){_0x1789c4['limit']=qs['limit'](_0x3e53ae['query'][_0xd4d1('0x20')]);_0x1789c4[_0xd4d1('0x1d')]=qs[_0xd4d1('0x1d')](_0x3e53ae[_0xd4d1('0x32')]['offset']);}_0x1789c4['order']=qs[_0xd4d1('0x38')](_0x3e53ae[_0xd4d1('0x32')]['sort']);_0x1789c4[_0xd4d1('0x39')]=qs[_0xd4d1('0x33')](_[_0xd4d1('0x3a')](_0x3e53ae[_0xd4d1('0x32')],_0xcf59ff[_0xd4d1('0x33')]),_0x1368ab);if(_0x3e53ae[_0xd4d1('0x32')][_0xd4d1('0x3b')]){_0x1789c4[_0xd4d1('0x39')]=_[_0xd4d1('0x3c')](_0x1789c4['where'],{'$or':_[_0xd4d1('0x2a')](_0x1368ab,function(_0x29de24){if(_0x29de24[_0xd4d1('0x2e')]!=='VIRTUAL'){var _0x1ff4d1={};_0x1ff4d1[_0x29de24[_0xd4d1('0x31')]]={'$like':'%'+_0x3e53ae[_0xd4d1('0x32')][_0xd4d1('0x3b')]+'%'};return _0x1ff4d1;}})});}_0x1789c4=_[_0xd4d1('0x3c')]({},_0x1789c4,_0x3e53ae[_0xd4d1('0x3d')]);var _0x102b4a={'where':_0x1789c4[_0xd4d1('0x39')]};return db['SugarcrmConfiguration'][_0xd4d1('0x1f')](_0x102b4a)[_0xd4d1('0x27')](function(_0xfde094){_0x199789[_0xd4d1('0x1f')]=_0xfde094;if(_0x3e53ae[_0xd4d1('0x32')][_0xd4d1('0x3e')]){_0x1789c4[_0xd4d1('0x3f')]=[{'all':!![]}];}return db[_0xd4d1('0x2b')][_0xd4d1('0x40')](_0x1789c4);})['then'](function(_0x49ddcc){_0x199789[_0xd4d1('0x41')]=_0x49ddcc;return _0x199789;})['then'](respondWithFilteredResult(_0x3fc696,_0x1789c4))[_0xd4d1('0x42')](handleError(_0x3fc696,null));};exports[_0xd4d1('0x43')]=function(_0x44380f,_0x2b4043){var _0x5aa6bd={'raw':![],'where':{'id':_0x44380f[_0xd4d1('0x44')]['id']}},_0x31a0df={};_0x31a0df[_0xd4d1('0x30')]=_[_0xd4d1('0x45')](db[_0xd4d1('0x2b')][_0xd4d1('0x2c')]);_0x31a0df[_0xd4d1('0x32')]=_[_0xd4d1('0x45')](_0x44380f[_0xd4d1('0x32')]);_0x31a0df[_0xd4d1('0x33')]=_[_0xd4d1('0x46')](_0x31a0df[_0xd4d1('0x30')],_0x31a0df[_0xd4d1('0x32')]);_0x5aa6bd['attributes']=_['intersection'](_0x31a0df['model'],qs['fields'](_0x44380f[_0xd4d1('0x32')][_0xd4d1('0x35')]));_0x5aa6bd['attributes']=_0x5aa6bd['attributes'][_0xd4d1('0x36')]?_0x5aa6bd[_0xd4d1('0x34')]:_0x31a0df[_0xd4d1('0x30')];if(_0x44380f[_0xd4d1('0x32')][_0xd4d1('0x3e')]){_0x5aa6bd[_0xd4d1('0x3f')]=[{'all':!![]}];}_0x5aa6bd=_[_0xd4d1('0x3c')]({},_0x5aa6bd,_0x44380f['options']);return db[_0xd4d1('0x2b')][_0xd4d1('0x47')](_0x5aa6bd)[_0xd4d1('0x27')](handleEntityNotFound(_0x2b4043,null))['then'](respondWithResult(_0x2b4043,null))[_0xd4d1('0x42')](handleError(_0x2b4043,null));};exports[_0xd4d1('0x48')]=function(_0x21a23d,_0xe11057){return db[_0xd4d1('0x2b')][_0xd4d1('0x48')](_0x21a23d[_0xd4d1('0x49')],{})[_0xd4d1('0x27')](respondWithResult(_0xe11057,0xc9))['catch'](handleError(_0xe11057,null));};exports[_0xd4d1('0x25')]=function(_0x36a9bb,_0x5be233){if(_0x36a9bb[_0xd4d1('0x49')]['id']){delete _0x36a9bb[_0xd4d1('0x49')]['id'];}return db['SugarcrmConfiguration'][_0xd4d1('0x47')]({'where':{'id':_0x36a9bb['params']['id']}})[_0xd4d1('0x27')](handleEntityNotFound(_0x5be233,null))['then'](saveUpdates(_0x36a9bb[_0xd4d1('0x49')],null))['then'](respondWithResult(_0x5be233,null))[_0xd4d1('0x42')](handleError(_0x5be233,null));};exports[_0xd4d1('0x26')]=function(_0x3effb0,_0x2eaf10){return db['SugarcrmConfiguration'][_0xd4d1('0x47')]({'where':{'id':_0x3effb0[_0xd4d1('0x44')]['id']}})['then'](handleEntityNotFound(_0x2eaf10,null))[_0xd4d1('0x27')](removeEntity(_0x2eaf10,null))[_0xd4d1('0x42')](handleError(_0x2eaf10,null));};exports['getFields']=function(_0x1a3702,_0x5c3007,_0x1f05a3){var _0x4b2962={};var _0x3a0f70={};var _0x50b8bf;var _0x5c22d6;return db[_0xd4d1('0x2b')][_0xd4d1('0x4a')]({'where':{'id':_0x1a3702[_0xd4d1('0x44')]['id']}})[_0xd4d1('0x27')](handleEntityNotFound(_0x5c3007,null))[_0xd4d1('0x27')](function(_0x212908){if(_0x212908){_0x50b8bf=_0x212908;_0x3a0f70[_0xd4d1('0x30')]=_['keys'](db[_0xd4d1('0x4b')][_0xd4d1('0x2c')]);_0x3a0f70[_0xd4d1('0x32')]=_['keys'](_0x1a3702[_0xd4d1('0x32')]);_0x3a0f70[_0xd4d1('0x33')]=_['intersection'](_0x3a0f70[_0xd4d1('0x30')],_0x3a0f70['query']);_0x4b2962['attributes']=_['intersection'](_0x3a0f70['model'],qs[_0xd4d1('0x35')](_0x1a3702[_0xd4d1('0x32')][_0xd4d1('0x35')]));_0x4b2962[_0xd4d1('0x34')]=_0x4b2962[_0xd4d1('0x34')][_0xd4d1('0x36')]?_0x4b2962[_0xd4d1('0x34')]:_0x3a0f70[_0xd4d1('0x30')];_0x4b2962['order']=qs['sort'](_0x1a3702[_0xd4d1('0x32')][_0xd4d1('0x38')]);_0x4b2962[_0xd4d1('0x39')]=qs['filters'](_[_0xd4d1('0x3a')](_0x1a3702['query'],_0x3a0f70['filters']));if(_0x1a3702[_0xd4d1('0x32')][_0xd4d1('0x3b')]){_0x4b2962['where']=_[_0xd4d1('0x3c')](_0x4b2962['where'],{'$or':_[_0xd4d1('0x2a')](_0x4b2962['attributes'],function(_0x18a99e){var _0x19d2f7={};_0x19d2f7[_0x18a99e]={'$like':'%'+_0x1a3702[_0xd4d1('0x32')]['filter']+'%'};return _0x19d2f7;})});}_0x4b2962=_['merge']({},_0x4b2962,_0x1a3702[_0xd4d1('0x3d')]);return _0x50b8bf['getFields'](_0x4b2962);}})[_0xd4d1('0x27')](function(_0x43046e){if(_0x43046e){_0x5c22d6=_0x43046e[_0xd4d1('0x36')];if(!_0x1a3702[_0xd4d1('0x32')][_0xd4d1('0x4c')](_0xd4d1('0x37'))){_0x4b2962[_0xd4d1('0x20')]=qs['limit'](_0x1a3702[_0xd4d1('0x32')][_0xd4d1('0x20')]);_0x4b2962[_0xd4d1('0x1d')]=qs[_0xd4d1('0x1d')](_0x1a3702['query'][_0xd4d1('0x1d')]);}return _0x50b8bf['getFields'](_0x4b2962);}})[_0xd4d1('0x27')](function(_0x3b979b){if(_0x3b979b){return _0x3b979b?{'count':_0x5c22d6,'rows':_0x3b979b}:null;}})[_0xd4d1('0x27')](respondWithResult(_0x5c3007,null))[_0xd4d1('0x42')](handleError(_0x5c3007,null));};exports[_0xd4d1('0x4d')]=function(_0x5d4f5f,_0x41e5c7,_0x3d470e){var _0x4c4fb6={};var _0x1a8ad0={};var _0x580300;var _0xba8044;return db[_0xd4d1('0x2b')][_0xd4d1('0x4a')]({'where':{'id':_0x5d4f5f[_0xd4d1('0x44')]['id']}})[_0xd4d1('0x27')](handleEntityNotFound(_0x41e5c7,null))[_0xd4d1('0x27')](function(_0x7cad34){if(_0x7cad34){_0x580300=_0x7cad34;_0x1a8ad0['model']=_[_0xd4d1('0x45')](db[_0xd4d1('0x4b')]['rawAttributes']);_0x1a8ad0[_0xd4d1('0x32')]=_[_0xd4d1('0x45')](_0x5d4f5f[_0xd4d1('0x32')]);_0x1a8ad0[_0xd4d1('0x33')]=_[_0xd4d1('0x46')](_0x1a8ad0['model'],_0x1a8ad0['query']);_0x4c4fb6[_0xd4d1('0x34')]=_[_0xd4d1('0x46')](_0x1a8ad0['model'],qs['fields'](_0x5d4f5f[_0xd4d1('0x32')][_0xd4d1('0x35')]));_0x4c4fb6[_0xd4d1('0x34')]=_0x4c4fb6[_0xd4d1('0x34')]['length']?_0x4c4fb6[_0xd4d1('0x34')]:_0x1a8ad0['model'];_0x4c4fb6[_0xd4d1('0x4e')]=qs[_0xd4d1('0x38')](_0x5d4f5f[_0xd4d1('0x32')][_0xd4d1('0x38')]);_0x4c4fb6[_0xd4d1('0x39')]=qs[_0xd4d1('0x33')](_['pick'](_0x5d4f5f[_0xd4d1('0x32')],_0x1a8ad0[_0xd4d1('0x33')]));if(_0x5d4f5f[_0xd4d1('0x32')][_0xd4d1('0x3b')]){_0x4c4fb6['where']=_[_0xd4d1('0x3c')](_0x4c4fb6['where'],{'$or':_['map'](_0x4c4fb6['attributes'],function(_0x49d46c){var _0x2daa3a={};_0x2daa3a[_0x49d46c]={'$like':'%'+_0x5d4f5f[_0xd4d1('0x32')][_0xd4d1('0x3b')]+'%'};return _0x2daa3a;})});}_0x4c4fb6=_[_0xd4d1('0x3c')]({},_0x4c4fb6,_0x5d4f5f[_0xd4d1('0x3d')]);return _0x580300[_0xd4d1('0x4d')](_0x4c4fb6);}})[_0xd4d1('0x27')](function(_0x41713d){if(_0x41713d){_0xba8044=_0x41713d[_0xd4d1('0x36')];if(!_0x5d4f5f[_0xd4d1('0x32')]['hasOwnProperty'](_0xd4d1('0x37'))){_0x4c4fb6[_0xd4d1('0x20')]=qs[_0xd4d1('0x20')](_0x5d4f5f[_0xd4d1('0x32')][_0xd4d1('0x20')]);_0x4c4fb6[_0xd4d1('0x1d')]=qs[_0xd4d1('0x1d')](_0x5d4f5f['query']['offset']);}return _0x580300[_0xd4d1('0x4d')](_0x4c4fb6);}})[_0xd4d1('0x27')](function(_0x2f3da6){if(_0x2f3da6){return _0x2f3da6?{'count':_0xba8044,'rows':_0x2f3da6}:null;}})[_0xd4d1('0x27')](respondWithResult(_0x41e5c7,null))[_0xd4d1('0x42')](handleError(_0x41e5c7,null));};exports[_0xd4d1('0x4f')]=function(_0x320218,_0x134f44,_0x2522cb){var _0x5d496c={};var _0x3dd9e2={};var _0x4df316;var _0x496f84;return db[_0xd4d1('0x2b')]['findOne']({'where':{'id':_0x320218['params']['id']}})['then'](handleEntityNotFound(_0x134f44,null))[_0xd4d1('0x27')](function(_0xed2287){if(_0xed2287){_0x4df316=_0xed2287;_0x3dd9e2['model']=_[_0xd4d1('0x45')](db[_0xd4d1('0x4b')]['rawAttributes']);_0x3dd9e2[_0xd4d1('0x32')]=_[_0xd4d1('0x45')](_0x320218[_0xd4d1('0x32')]);_0x3dd9e2[_0xd4d1('0x33')]=_[_0xd4d1('0x46')](_0x3dd9e2[_0xd4d1('0x30')],_0x3dd9e2[_0xd4d1('0x32')]);_0x5d496c['attributes']=_[_0xd4d1('0x46')](_0x3dd9e2['model'],qs['fields'](_0x320218[_0xd4d1('0x32')][_0xd4d1('0x35')]));_0x5d496c[_0xd4d1('0x34')]=_0x5d496c[_0xd4d1('0x34')][_0xd4d1('0x36')]?_0x5d496c[_0xd4d1('0x34')]:_0x3dd9e2['model'];_0x5d496c['order']=qs[_0xd4d1('0x38')](_0x320218['query']['sort']);_0x5d496c['where']=qs[_0xd4d1('0x33')](_[_0xd4d1('0x3a')](_0x320218[_0xd4d1('0x32')],_0x3dd9e2[_0xd4d1('0x33')]));if(_0x320218[_0xd4d1('0x32')][_0xd4d1('0x3b')]){_0x5d496c[_0xd4d1('0x39')]=_[_0xd4d1('0x3c')](_0x5d496c[_0xd4d1('0x39')],{'$or':_[_0xd4d1('0x2a')](_0x5d496c[_0xd4d1('0x34')],function(_0x5c145d){var _0x385477={};_0x385477[_0x5c145d]={'$like':'%'+_0x320218[_0xd4d1('0x32')][_0xd4d1('0x3b')]+'%'};return _0x385477;})});}_0x5d496c=_[_0xd4d1('0x3c')]({},_0x5d496c,_0x320218['options']);return _0x4df316[_0xd4d1('0x4f')](_0x5d496c);}})[_0xd4d1('0x27')](function(_0x284fd2){if(_0x284fd2){_0x496f84=_0x284fd2[_0xd4d1('0x36')];if(!_0x320218[_0xd4d1('0x32')]['hasOwnProperty']('nolimit')){_0x5d496c['limit']=qs[_0xd4d1('0x20')](_0x320218[_0xd4d1('0x32')][_0xd4d1('0x20')]);_0x5d496c[_0xd4d1('0x1d')]=qs[_0xd4d1('0x1d')](_0x320218[_0xd4d1('0x32')][_0xd4d1('0x1d')]);}return _0x4df316[_0xd4d1('0x4f')](_0x5d496c);}})[_0xd4d1('0x27')](function(_0x52bec6){if(_0x52bec6){return _0x52bec6?{'count':_0x496f84,'rows':_0x52bec6}:null;}})[_0xd4d1('0x27')](respondWithResult(_0x134f44,null))['catch'](handleError(_0x134f44,null));}; \ No newline at end of file +var _0x450b=['filters','intersection','query','attributes','fields','length','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getFields','findOne','order','hasOwnProperty','getSubjects','SugarcrmField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','map','SugarcrmConfiguration','rawAttributes','type','key','model','keys'];(function(_0x3e8236,_0x256e68){var _0x11f052=function(_0x4335f1){while(--_0x4335f1){_0x3e8236['push'](_0x3e8236['shift']());}};_0x11f052(++_0x256e68);}(_0x450b,0x6e));var _0xb450=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x450b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb450('0x0'));var rimraf=require(_0xb450('0x1'));var zipdir=require(_0xb450('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb450('0x3'));var moment=require(_0xb450('0x4'));var BPromise=require(_0xb450('0x5'));var Mustache=require('mustache');var util=require(_0xb450('0x6'));var path=require(_0xb450('0x7'));var sox=require(_0xb450('0x8'));var csv=require(_0xb450('0x9'));var ejs=require(_0xb450('0xa'));var fs=require('fs');var fs_extra=require(_0xb450('0xb'));var _=require(_0xb450('0xc'));var squel=require(_0xb450('0xd'));var crypto=require(_0xb450('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb450('0xf'));var toCsv=require(_0xb450('0x9'));var querystring=require(_0xb450('0x10'));var Papa=require(_0xb450('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb450('0x12'));var as=require(_0xb450('0x13'));var hardwareService=require(_0xb450('0x14'));var logger=require(_0xb450('0x15'))(_0xb450('0x16'));var utils=require(_0xb450('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb450('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1303ae,_0x2711af){_0x2711af=_0x2711af||0xcc;return function(_0x495e19){if(_0x495e19){return _0x1303ae[_0xb450('0x19')](_0x2711af);}return _0x1303ae['status'](_0x2711af)['end']();};}function respondWithResult(_0x5eefd4,_0x48900f){_0x48900f=_0x48900f||0xc8;return function(_0x1d52d6){if(_0x1d52d6){return _0x5eefd4[_0xb450('0x1a')](_0x48900f)['json'](_0x1d52d6);}};}function respondWithFilteredResult(_0x36b882,_0x505cd9){return function(_0x7e9c93){if(_0x7e9c93){var _0x36ede4=typeof _0x505cd9[_0xb450('0x1b')]===_0xb450('0x1c')&&typeof _0x505cd9['limit']===_0xb450('0x1c');var _0x46f25a=_0x7e9c93[_0xb450('0x1d')];var _0x1309c0=_0x36ede4?0x0:_0x505cd9[_0xb450('0x1b')];var _0x25cc20=_0x36ede4?_0x7e9c93['count']:_0x505cd9['offset']+_0x505cd9[_0xb450('0x1e')];var _0xdb6bba;if(_0x25cc20>=_0x46f25a){_0x25cc20=_0x46f25a;_0xdb6bba=0xc8;}else{_0xdb6bba=0xce;}_0x36b882[_0xb450('0x1a')](_0xdb6bba);return _0x36b882['set'](_0xb450('0x1f'),_0x1309c0+'-'+_0x25cc20+'/'+_0x46f25a)[_0xb450('0x20')](_0x7e9c93);}return null;};}function patchUpdates(_0x5eaffe){return function(_0x474a65){try{jsonpatch[_0xb450('0x21')](_0x474a65,_0x5eaffe,!![]);}catch(_0x191192){return BPromise[_0xb450('0x22')](_0x191192);}return _0x474a65[_0xb450('0x23')]();};}function saveUpdates(_0x2e4960,_0x2dff3c){return function(_0x2d4c78){if(_0x2d4c78){return _0x2d4c78[_0xb450('0x24')](_0x2e4960)[_0xb450('0x25')](function(_0x1d6d2e){return _0x1d6d2e;});}return null;};}function removeEntity(_0x36d095,_0x43f68e){return function(_0x1698ce){if(_0x1698ce){return _0x1698ce[_0xb450('0x26')]()[_0xb450('0x25')](function(){_0x36d095[_0xb450('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc016c7,_0x392828){return function(_0x4db799){if(!_0x4db799){_0xc016c7[_0xb450('0x19')](0x194);}return _0x4db799;};}function handleError(_0x28205a,_0x24c0b7){_0x24c0b7=_0x24c0b7||0x1f4;return function(_0x454c9b){logger['error'](_0x454c9b[_0xb450('0x27')]);if(_0x454c9b[_0xb450('0x28')]){delete _0x454c9b[_0xb450('0x28')];}_0x28205a['status'](_0x24c0b7)['send'](_0x454c9b);};}exports['index']=function(_0x3fe768,_0x3c8c85){var _0xae5397={},_0x4ed754={},_0x5566cf={'count':0x0,'rows':[]};var _0x3c310e=_[_0xb450('0x29')](db[_0xb450('0x2a')][_0xb450('0x2b')],function(_0x2a0b84){return{'name':_0x2a0b84['fieldName'],'type':_0x2a0b84[_0xb450('0x2c')][_0xb450('0x2d')]};});_0x4ed754[_0xb450('0x2e')]=_[_0xb450('0x29')](_0x3c310e,'name');_0x4ed754['query']=_[_0xb450('0x2f')](_0x3fe768['query']);_0x4ed754[_0xb450('0x30')]=_[_0xb450('0x31')](_0x4ed754[_0xb450('0x2e')],_0x4ed754[_0xb450('0x32')]);_0xae5397[_0xb450('0x33')]=_[_0xb450('0x31')](_0x4ed754[_0xb450('0x2e')],qs['fields'](_0x3fe768[_0xb450('0x32')][_0xb450('0x34')]));_0xae5397[_0xb450('0x33')]=_0xae5397[_0xb450('0x33')][_0xb450('0x35')]?_0xae5397[_0xb450('0x33')]:_0x4ed754[_0xb450('0x2e')];if(!_0x3fe768['query']['hasOwnProperty'](_0xb450('0x36'))){_0xae5397[_0xb450('0x1e')]=qs[_0xb450('0x1e')](_0x3fe768[_0xb450('0x32')]['limit']);_0xae5397['offset']=qs[_0xb450('0x1b')](_0x3fe768[_0xb450('0x32')][_0xb450('0x1b')]);}_0xae5397['order']=qs[_0xb450('0x37')](_0x3fe768['query']['sort']);_0xae5397['where']=qs[_0xb450('0x30')](_[_0xb450('0x38')](_0x3fe768[_0xb450('0x32')],_0x4ed754['filters']),_0x3c310e);if(_0x3fe768[_0xb450('0x32')][_0xb450('0x39')]){_0xae5397['where']=_[_0xb450('0x3a')](_0xae5397[_0xb450('0x3b')],{'$or':_['map'](_0x3c310e,function(_0x567597){if(_0x567597['type']!==_0xb450('0x3c')){var _0x2d48ee={};_0x2d48ee[_0x567597[_0xb450('0x28')]]={'$like':'%'+_0x3fe768[_0xb450('0x32')][_0xb450('0x39')]+'%'};return _0x2d48ee;}})});}_0xae5397=_[_0xb450('0x3a')]({},_0xae5397,_0x3fe768[_0xb450('0x3d')]);var _0x407fbf={'where':_0xae5397[_0xb450('0x3b')]};return db[_0xb450('0x2a')][_0xb450('0x1d')](_0x407fbf)[_0xb450('0x25')](function(_0x4179ba){_0x5566cf[_0xb450('0x1d')]=_0x4179ba;if(_0x3fe768[_0xb450('0x32')]['includeAll']){_0xae5397[_0xb450('0x3e')]=[{'all':!![]}];}return db[_0xb450('0x2a')][_0xb450('0x3f')](_0xae5397);})[_0xb450('0x25')](function(_0x16340c){_0x5566cf[_0xb450('0x40')]=_0x16340c;return _0x5566cf;})[_0xb450('0x25')](respondWithFilteredResult(_0x3c8c85,_0xae5397))[_0xb450('0x41')](handleError(_0x3c8c85,null));};exports[_0xb450('0x42')]=function(_0x3ea92a,_0x140f3f){var _0x4d55f6={'raw':![],'where':{'id':_0x3ea92a[_0xb450('0x43')]['id']}},_0x50e8aa={};_0x50e8aa[_0xb450('0x2e')]=_[_0xb450('0x2f')](db[_0xb450('0x2a')][_0xb450('0x2b')]);_0x50e8aa[_0xb450('0x32')]=_[_0xb450('0x2f')](_0x3ea92a['query']);_0x50e8aa['filters']=_[_0xb450('0x31')](_0x50e8aa['model'],_0x50e8aa[_0xb450('0x32')]);_0x4d55f6[_0xb450('0x33')]=_['intersection'](_0x50e8aa[_0xb450('0x2e')],qs[_0xb450('0x34')](_0x3ea92a['query'][_0xb450('0x34')]));_0x4d55f6[_0xb450('0x33')]=_0x4d55f6[_0xb450('0x33')][_0xb450('0x35')]?_0x4d55f6[_0xb450('0x33')]:_0x50e8aa[_0xb450('0x2e')];if(_0x3ea92a[_0xb450('0x32')][_0xb450('0x44')]){_0x4d55f6[_0xb450('0x3e')]=[{'all':!![]}];}_0x4d55f6=_[_0xb450('0x3a')]({},_0x4d55f6,_0x3ea92a[_0xb450('0x3d')]);return db['SugarcrmConfiguration'][_0xb450('0x45')](_0x4d55f6)[_0xb450('0x25')](handleEntityNotFound(_0x140f3f,null))['then'](respondWithResult(_0x140f3f,null))[_0xb450('0x41')](handleError(_0x140f3f,null));};exports[_0xb450('0x46')]=function(_0x3cccaa,_0x3690ff){return db[_0xb450('0x2a')][_0xb450('0x46')](_0x3cccaa[_0xb450('0x47')],{})[_0xb450('0x25')](respondWithResult(_0x3690ff,0xc9))['catch'](handleError(_0x3690ff,null));};exports[_0xb450('0x24')]=function(_0x16149f,_0x2a7f50){if(_0x16149f[_0xb450('0x47')]['id']){delete _0x16149f[_0xb450('0x47')]['id'];}return db[_0xb450('0x2a')][_0xb450('0x45')]({'where':{'id':_0x16149f[_0xb450('0x43')]['id']}})['then'](handleEntityNotFound(_0x2a7f50,null))[_0xb450('0x25')](saveUpdates(_0x16149f[_0xb450('0x47')],null))[_0xb450('0x25')](respondWithResult(_0x2a7f50,null))[_0xb450('0x41')](handleError(_0x2a7f50,null));};exports[_0xb450('0x26')]=function(_0x5885ad,_0x398aab){return db[_0xb450('0x2a')][_0xb450('0x45')]({'where':{'id':_0x5885ad['params']['id']}})[_0xb450('0x25')](handleEntityNotFound(_0x398aab,null))['then'](removeEntity(_0x398aab,null))[_0xb450('0x41')](handleError(_0x398aab,null));};exports[_0xb450('0x48')]=function(_0x12152c,_0x320385,_0x569877){var _0x53b7d6={};var _0x3f6e27={};var _0xfe0ca5;var _0x4dc0ff;return db[_0xb450('0x2a')][_0xb450('0x49')]({'where':{'id':_0x12152c[_0xb450('0x43')]['id']}})[_0xb450('0x25')](handleEntityNotFound(_0x320385,null))[_0xb450('0x25')](function(_0x326824){if(_0x326824){_0xfe0ca5=_0x326824;_0x3f6e27[_0xb450('0x2e')]=_[_0xb450('0x2f')](db['SugarcrmField'][_0xb450('0x2b')]);_0x3f6e27['query']=_[_0xb450('0x2f')](_0x12152c[_0xb450('0x32')]);_0x3f6e27['filters']=_['intersection'](_0x3f6e27['model'],_0x3f6e27[_0xb450('0x32')]);_0x53b7d6[_0xb450('0x33')]=_[_0xb450('0x31')](_0x3f6e27['model'],qs['fields'](_0x12152c[_0xb450('0x32')][_0xb450('0x34')]));_0x53b7d6['attributes']=_0x53b7d6[_0xb450('0x33')][_0xb450('0x35')]?_0x53b7d6[_0xb450('0x33')]:_0x3f6e27[_0xb450('0x2e')];_0x53b7d6[_0xb450('0x4a')]=qs[_0xb450('0x37')](_0x12152c[_0xb450('0x32')]['sort']);_0x53b7d6['where']=qs[_0xb450('0x30')](_[_0xb450('0x38')](_0x12152c[_0xb450('0x32')],_0x3f6e27[_0xb450('0x30')]));if(_0x12152c[_0xb450('0x32')]['filter']){_0x53b7d6['where']=_[_0xb450('0x3a')](_0x53b7d6['where'],{'$or':_['map'](_0x53b7d6['attributes'],function(_0x706612){var _0x2d713d={};_0x2d713d[_0x706612]={'$like':'%'+_0x12152c[_0xb450('0x32')][_0xb450('0x39')]+'%'};return _0x2d713d;})});}_0x53b7d6=_[_0xb450('0x3a')]({},_0x53b7d6,_0x12152c[_0xb450('0x3d')]);return _0xfe0ca5[_0xb450('0x48')](_0x53b7d6);}})[_0xb450('0x25')](function(_0x3438c4){if(_0x3438c4){_0x4dc0ff=_0x3438c4[_0xb450('0x35')];if(!_0x12152c[_0xb450('0x32')][_0xb450('0x4b')]('nolimit')){_0x53b7d6[_0xb450('0x1e')]=qs['limit'](_0x12152c[_0xb450('0x32')]['limit']);_0x53b7d6[_0xb450('0x1b')]=qs[_0xb450('0x1b')](_0x12152c[_0xb450('0x32')][_0xb450('0x1b')]);}return _0xfe0ca5[_0xb450('0x48')](_0x53b7d6);}})[_0xb450('0x25')](function(_0x38caa4){if(_0x38caa4){return _0x38caa4?{'count':_0x4dc0ff,'rows':_0x38caa4}:null;}})['then'](respondWithResult(_0x320385,null))[_0xb450('0x41')](handleError(_0x320385,null));};exports[_0xb450('0x4c')]=function(_0x44052b,_0x270739,_0x4a0051){var _0x545ff5={};var _0x6adbfc={};var _0x178e80;var _0x21cfe1;return db[_0xb450('0x2a')][_0xb450('0x49')]({'where':{'id':_0x44052b[_0xb450('0x43')]['id']}})[_0xb450('0x25')](handleEntityNotFound(_0x270739,null))[_0xb450('0x25')](function(_0x4e4d8c){if(_0x4e4d8c){_0x178e80=_0x4e4d8c;_0x6adbfc[_0xb450('0x2e')]=_[_0xb450('0x2f')](db[_0xb450('0x4d')][_0xb450('0x2b')]);_0x6adbfc[_0xb450('0x32')]=_[_0xb450('0x2f')](_0x44052b[_0xb450('0x32')]);_0x6adbfc['filters']=_[_0xb450('0x31')](_0x6adbfc[_0xb450('0x2e')],_0x6adbfc[_0xb450('0x32')]);_0x545ff5[_0xb450('0x33')]=_[_0xb450('0x31')](_0x6adbfc[_0xb450('0x2e')],qs[_0xb450('0x34')](_0x44052b[_0xb450('0x32')][_0xb450('0x34')]));_0x545ff5[_0xb450('0x33')]=_0x545ff5['attributes']['length']?_0x545ff5['attributes']:_0x6adbfc[_0xb450('0x2e')];_0x545ff5[_0xb450('0x4a')]=qs['sort'](_0x44052b[_0xb450('0x32')]['sort']);_0x545ff5[_0xb450('0x3b')]=qs[_0xb450('0x30')](_[_0xb450('0x38')](_0x44052b[_0xb450('0x32')],_0x6adbfc[_0xb450('0x30')]));if(_0x44052b['query'][_0xb450('0x39')]){_0x545ff5['where']=_['merge'](_0x545ff5['where'],{'$or':_['map'](_0x545ff5['attributes'],function(_0xb6e49a){var _0x587130={};_0x587130[_0xb6e49a]={'$like':'%'+_0x44052b['query'][_0xb450('0x39')]+'%'};return _0x587130;})});}_0x545ff5=_[_0xb450('0x3a')]({},_0x545ff5,_0x44052b[_0xb450('0x3d')]);return _0x178e80[_0xb450('0x4c')](_0x545ff5);}})[_0xb450('0x25')](function(_0x2868c2){if(_0x2868c2){_0x21cfe1=_0x2868c2[_0xb450('0x35')];if(!_0x44052b['query'][_0xb450('0x4b')](_0xb450('0x36'))){_0x545ff5[_0xb450('0x1e')]=qs['limit'](_0x44052b[_0xb450('0x32')]['limit']);_0x545ff5[_0xb450('0x1b')]=qs[_0xb450('0x1b')](_0x44052b[_0xb450('0x32')][_0xb450('0x1b')]);}return _0x178e80[_0xb450('0x4c')](_0x545ff5);}})[_0xb450('0x25')](function(_0x537257){if(_0x537257){return _0x537257?{'count':_0x21cfe1,'rows':_0x537257}:null;}})[_0xb450('0x25')](respondWithResult(_0x270739,null))[_0xb450('0x41')](handleError(_0x270739,null));};exports[_0xb450('0x4e')]=function(_0x15c22a,_0x46a5f9,_0x760a99){var _0x297b97={};var _0x13d4b1={};var _0x507c88;var _0x1809a5;return db[_0xb450('0x2a')][_0xb450('0x49')]({'where':{'id':_0x15c22a['params']['id']}})[_0xb450('0x25')](handleEntityNotFound(_0x46a5f9,null))[_0xb450('0x25')](function(_0x2f9080){if(_0x2f9080){_0x507c88=_0x2f9080;_0x13d4b1[_0xb450('0x2e')]=_[_0xb450('0x2f')](db[_0xb450('0x4d')][_0xb450('0x2b')]);_0x13d4b1[_0xb450('0x32')]=_[_0xb450('0x2f')](_0x15c22a['query']);_0x13d4b1[_0xb450('0x30')]=_['intersection'](_0x13d4b1[_0xb450('0x2e')],_0x13d4b1[_0xb450('0x32')]);_0x297b97['attributes']=_[_0xb450('0x31')](_0x13d4b1[_0xb450('0x2e')],qs[_0xb450('0x34')](_0x15c22a[_0xb450('0x32')][_0xb450('0x34')]));_0x297b97[_0xb450('0x33')]=_0x297b97[_0xb450('0x33')][_0xb450('0x35')]?_0x297b97[_0xb450('0x33')]:_0x13d4b1[_0xb450('0x2e')];_0x297b97[_0xb450('0x4a')]=qs['sort'](_0x15c22a[_0xb450('0x32')]['sort']);_0x297b97[_0xb450('0x3b')]=qs[_0xb450('0x30')](_[_0xb450('0x38')](_0x15c22a[_0xb450('0x32')],_0x13d4b1[_0xb450('0x30')]));if(_0x15c22a['query'][_0xb450('0x39')]){_0x297b97[_0xb450('0x3b')]=_['merge'](_0x297b97[_0xb450('0x3b')],{'$or':_['map'](_0x297b97[_0xb450('0x33')],function(_0x57cb99){var _0x14065e={};_0x14065e[_0x57cb99]={'$like':'%'+_0x15c22a[_0xb450('0x32')][_0xb450('0x39')]+'%'};return _0x14065e;})});}_0x297b97=_['merge']({},_0x297b97,_0x15c22a[_0xb450('0x3d')]);return _0x507c88[_0xb450('0x4e')](_0x297b97);}})[_0xb450('0x25')](function(_0x12fb37){if(_0x12fb37){_0x1809a5=_0x12fb37[_0xb450('0x35')];if(!_0x15c22a[_0xb450('0x32')][_0xb450('0x4b')](_0xb450('0x36'))){_0x297b97['limit']=qs[_0xb450('0x1e')](_0x15c22a[_0xb450('0x32')][_0xb450('0x1e')]);_0x297b97[_0xb450('0x1b')]=qs[_0xb450('0x1b')](_0x15c22a['query'][_0xb450('0x1b')]);}return _0x507c88[_0xb450('0x4e')](_0x297b97);}})[_0xb450('0x25')](function(_0x34e147){if(_0x34e147){return _0x34e147?{'count':_0x1809a5,'rows':_0x34e147}:null;}})['then'](respondWithResult(_0x46a5f9,null))['catch'](handleError(_0x46a5f9,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index bbe2524..2016be0 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 _0x5114=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','util','moment','bluebird','path'];(function(_0x37384e,_0x3de460){var _0x5cb6e8=function(_0x1fa168){while(--_0x1fa168){_0x37384e['push'](_0x37384e['shift']());}};_0x5cb6e8(++_0x3de460);}(_0x5114,0x10a));var _0x4511=function(_0x15e142,_0x576549){_0x15e142=_0x15e142-0x0;var _0x1645c9=_0x5114[_0x15e142];return _0x1645c9;};'use strict';var _=require('lodash');var util=require(_0x4511('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4511('0x1'));var BPromise=require(_0x4511('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4511('0x3'));var rimraf=require(_0x4511('0x4'));var config=require(_0x4511('0x5'));var attributes=require(_0x4511('0x6'));module[_0x4511('0x7')]=function(_0x4c5687,_0x64089d){return _0x4c5687[_0x4511('0x8')](_0x4511('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81c9=['request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x53314b,_0x1c00cd){var _0x52bac0=function(_0x3816a5){while(--_0x3816a5){_0x53314b['push'](_0x53314b['shift']());}};_0x52bac0(++_0x1c00cd);}(_0x81c9,0x180));var _0x981c=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x81c9[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x981c('0x0'));var util=require(_0x981c('0x1'));var logger=require(_0x981c('0x2'))(_0x981c('0x3'));var moment=require(_0x981c('0x4'));var BPromise=require(_0x981c('0x5'));var rp=require(_0x981c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x981c('0x7'));var config=require(_0x981c('0x8'));var attributes=require(_0x981c('0x9'));module[_0x981c('0xa')]=function(_0x54b942,_0x1592c5){return _0x54b942[_0x981c('0xb')]('SugarcrmConfiguration',attributes,{'tableName':_0x981c('0xc'),'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 e5bf90a..6affedc 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 _0x4b01=['stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x56b14a,_0x3e35c3){var _0x39456f=function(_0x1cf63f){while(--_0x1cf63f){_0x56b14a['push'](_0x56b14a['shift']());}};_0x39456f(++_0x3e35c3);}(_0x4b01,0x149));var _0x14b0=function(_0x5647ec,_0x30c499){_0x5647ec=_0x5647ec-0x0;var _0x411bcd=_0x4b01[_0x5647ec];return _0x411bcd;};'use strict';var _=require('lodash');var util=require(_0x14b0('0x0'));var moment=require('moment');var BPromise=require(_0x14b0('0x1'));var rs=require(_0x14b0('0x2'));var fs=require('fs');var Redis=require(_0x14b0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x14b0('0x4'));var logger=require(_0x14b0('0x5'))(_0x14b0('0x6'));var config=require(_0x14b0('0x7'));var jayson=require(_0x14b0('0x8'));var client=jayson[_0x14b0('0x9')][_0x14b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb30146,_0x10a777,_0x267c07){return new BPromise(function(_0x42c040,_0x40ab8e){return client[_0x14b0('0xb')](_0xb30146,_0x267c07)['then'](function(_0x426c7e){logger[_0x14b0('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x10a777,_0x14b0('0xd'));logger[_0x14b0('0xe')](_0x14b0('0xf'),_0x10a777,_0x14b0('0xd'),JSON[_0x14b0('0x10')](_0x426c7e));if(_0x426c7e[_0x14b0('0x11')]){if(_0x426c7e[_0x14b0('0x11')][_0x14b0('0x12')]===0x1f4){logger[_0x14b0('0x11')](_0x14b0('0x13'),_0x10a777,_0x426c7e['error'][_0x14b0('0x14')]);return _0x40ab8e(_0x426c7e['error'][_0x14b0('0x14')]);}logger[_0x14b0('0x11')](_0x14b0('0x13'),_0x10a777,_0x426c7e[_0x14b0('0x11')][_0x14b0('0x14')]);return _0x42c040(_0x426c7e[_0x14b0('0x11')]['message']);}else{logger[_0x14b0('0xc')](_0x14b0('0x13'),_0x10a777,_0x14b0('0xd'));_0x42c040(_0x426c7e[_0x14b0('0x15')][_0x14b0('0x14')]);}})[_0x14b0('0x16')](function(_0x309699){logger[_0x14b0('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x10a777,_0x309699);_0x40ab8e(_0x309699);});});} \ No newline at end of file +var _0x2065=['rpc','../../config/environment','jayson/promise','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0x2065,0x72));var _0x5206=function(_0xa76851,_0x554094){_0xa76851=_0xa76851-0x0;var _0x20041c=_0x2065[_0xa76851];return _0x20041c;};'use strict';var _=require(_0x5206('0x0'));var util=require(_0x5206('0x1'));var moment=require(_0x5206('0x2'));var BPromise=require('bluebird');var rs=require(_0x5206('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5206('0x4'))['db'];var utils=require(_0x5206('0x5'));var logger=require('../../config/logger')(_0x5206('0x6'));var config=require(_0x5206('0x7'));var jayson=require(_0x5206('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7407,_0x156e5b,_0x3651e8){return new BPromise(function(_0x25ae8f,_0x414ef3){return client[_0x5206('0x9')](_0x1d7407,_0x3651e8)['then'](function(_0x34c52c){logger[_0x5206('0xa')](_0x5206('0xb'),_0x156e5b,_0x5206('0xc'));logger[_0x5206('0xd')](_0x5206('0xe'),_0x156e5b,_0x5206('0xc'),JSON[_0x5206('0xf')](_0x34c52c));if(_0x34c52c['error']){if(_0x34c52c[_0x5206('0x10')][_0x5206('0x11')]===0x1f4){logger[_0x5206('0x10')](_0x5206('0xb'),_0x156e5b,_0x34c52c[_0x5206('0x10')][_0x5206('0x12')]);return _0x414ef3(_0x34c52c[_0x5206('0x10')][_0x5206('0x12')]);}logger[_0x5206('0x10')](_0x5206('0xb'),_0x156e5b,_0x34c52c['error'][_0x5206('0x12')]);return _0x25ae8f(_0x34c52c[_0x5206('0x10')][_0x5206('0x12')]);}else{logger[_0x5206('0xa')](_0x5206('0xb'),_0x156e5b,_0x5206('0xc'));_0x25ae8f(_0x34c52c['result']['message']);}})[_0x5206('0x13')](function(_0x35df30){logger[_0x5206('0x10')](_0x5206('0xb'),_0x156e5b,_0x35df30);_0x414ef3(_0x35df30);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index d993db0..e7b68c3 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 _0xaba0=['multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','create','update','destroy','exports'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xaba0,0x176));var _0x0aba=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xaba0[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x0aba('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0aba('0x1'));var router=express[_0x0aba('0x2')]();var fs_extra=require(_0x0aba('0x3'));var auth=require(_0x0aba('0x4'));var interaction=require(_0x0aba('0x5'));var config=require(_0x0aba('0x6'));var controller=require(_0x0aba('0x7'));router[_0x0aba('0x8')]('/',auth[_0x0aba('0x9')](),controller[_0x0aba('0xa')]);router[_0x0aba('0x8')](_0x0aba('0xb'),auth[_0x0aba('0x9')](),controller['show']);router[_0x0aba('0xc')]('/',auth[_0x0aba('0x9')](),controller[_0x0aba('0xd')]);router['put'](_0x0aba('0xb'),auth[_0x0aba('0x9')](),controller[_0x0aba('0xe')]);router['delete']('/:id',auth[_0x0aba('0x9')](),controller[_0x0aba('0xf')]);module[_0x0aba('0x10')]=router; \ No newline at end of file +var _0xf70d=['update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','post','put','/:id'];(function(_0x175e5b,_0x4133a3){var _0x11d039=function(_0x3a7b97){while(--_0x3a7b97){_0x175e5b['push'](_0x175e5b['shift']());}};_0x11d039(++_0x4133a3);}(_0xf70d,0x146));var _0xdf70=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xf70d[_0x1992f1];return _0x413dfe;};'use strict';var multer=require(_0xdf70('0x0'));var util=require(_0xdf70('0x1'));var path=require('path');var timeout=require(_0xdf70('0x2'));var express=require(_0xdf70('0x3'));var router=express[_0xdf70('0x4')]();var fs_extra=require(_0xdf70('0x5'));var auth=require(_0xdf70('0x6'));var interaction=require(_0xdf70('0x7'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0xdf70('0x8')]('/',auth['isAuthenticated'](),controller[_0xdf70('0x9')]);router['get']('/:id',auth[_0xdf70('0xa')](),controller['show']);router[_0xdf70('0xb')]('/',auth[_0xdf70('0xa')](),controller['create']);router[_0xdf70('0xc')](_0xdf70('0xd'),auth[_0xdf70('0xa')](),controller[_0xdf70('0xe')]);router[_0xdf70('0xf')](_0xdf70('0xd'),auth[_0xdf70('0xa')](),controller[_0xdf70('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index d89b472..d3254c7 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 _0x2faa=['exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','sequelize'];(function(_0x591e0c,_0x37e294){var _0x317424=function(_0x1c8c58){while(--_0x1c8c58){_0x591e0c['push'](_0x591e0c['shift']());}};_0x317424(++_0x37e294);}(_0x2faa,0xd7));var _0xa2fa=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2faa[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xa2fa('0x0'));module[_0xa2fa('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa2fa('0x2'),_0xa2fa('0x3'),_0xa2fa('0x4'),_0xa2fa('0x5'),_0xa2fa('0x6')),'defaultValue':_0xa2fa('0x2')},'content':{'type':Sequelize[_0xa2fa('0x7')]},'key':{'type':Sequelize[_0xa2fa('0x7')]},'keyType':{'type':Sequelize[_0xa2fa('0x8')](_0xa2fa('0x2'),_0xa2fa('0x3'),_0xa2fa('0x4'))},'keyContent':{'type':Sequelize[_0xa2fa('0x7')]},'idField':{'type':Sequelize[_0xa2fa('0x7')]},'nameField':{'type':Sequelize[_0xa2fa('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa2fa('0x7')]}}; \ No newline at end of file +var _0xe3a6=['string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','picklist'];(function(_0xc8a11,_0x347a33){var _0x55a500=function(_0x288d05){while(--_0x288d05){_0xc8a11['push'](_0xc8a11['shift']());}};_0x55a500(++_0x347a33);}(_0xe3a6,0xc1));var _0x6e3a=function(_0x456a0b,_0x149c9d){_0x456a0b=_0x456a0b-0x0;var _0x31446d=_0xe3a6[_0x456a0b];return _0x31446d;};'use strict';var Sequelize=require(_0x6e3a('0x0'));module[_0x6e3a('0x1')]={'type':{'type':Sequelize[_0x6e3a('0x2')]('string','variable',_0x6e3a('0x3'),'keyValue',_0x6e3a('0x4')),'defaultValue':_0x6e3a('0x5')},'content':{'type':Sequelize[_0x6e3a('0x6')]},'key':{'type':Sequelize[_0x6e3a('0x6')]},'keyType':{'type':Sequelize[_0x6e3a('0x2')](_0x6e3a('0x5'),_0x6e3a('0x7'),_0x6e3a('0x3'))},'keyContent':{'type':Sequelize[_0x6e3a('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6e3a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6e3a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index d449fcf..1173d50 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 _0x6082=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','includeAll','include','rows','catch','show','find','create','body','update','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6082,0x15e));var _0x2608=function(_0x3d8522,_0x1448b0){_0x3d8522=_0x3d8522-0x0;var _0xcc6260=_0x6082[_0x3d8522];return _0xcc6260;};'use strict';var emlformat=require(_0x2608('0x0'));var rimraf=require(_0x2608('0x1'));var zipdir=require(_0x2608('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2608('0x3'));var moment=require(_0x2608('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2608('0x5'));var util=require(_0x2608('0x6'));var path=require(_0x2608('0x7'));var sox=require(_0x2608('0x8'));var csv=require('to-csv');var ejs=require(_0x2608('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2608('0xa'));var squel=require(_0x2608('0xb'));var crypto=require(_0x2608('0xc'));var jsforce=require(_0x2608('0xd'));var deskjs=require(_0x2608('0xe'));var toCsv=require(_0x2608('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2608('0x10'));var authService=require(_0x2608('0x11'));var qs=require(_0x2608('0x12'));var as=require(_0x2608('0x13'));var hardwareService=require(_0x2608('0x14'));var logger=require(_0x2608('0x15'))(_0x2608('0x16'));var utils=require(_0x2608('0x17'));var config=require(_0x2608('0x18'));var licenseUtil=require(_0x2608('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54a34c,_0x5c062e){_0x5c062e=_0x5c062e||0xcc;return function(_0x47a5f6){if(_0x47a5f6){return _0x54a34c[_0x2608('0x1a')](_0x5c062e);}return _0x54a34c[_0x2608('0x1b')](_0x5c062e)[_0x2608('0x1c')]();};}function respondWithResult(_0x221c14,_0x4dfd8f){_0x4dfd8f=_0x4dfd8f||0xc8;return function(_0x2a9817){if(_0x2a9817){return _0x221c14[_0x2608('0x1b')](_0x4dfd8f)[_0x2608('0x1d')](_0x2a9817);}};}function respondWithFilteredResult(_0x46e9b8,_0x7d307){return function(_0x4781dd){if(_0x4781dd){var _0xcdff9c=typeof _0x7d307[_0x2608('0x1e')]==='undefined'&&typeof _0x7d307[_0x2608('0x1f')]===_0x2608('0x20');var _0x2fe2d3=_0x4781dd[_0x2608('0x21')];var _0x17c1ca=_0xcdff9c?0x0:_0x7d307[_0x2608('0x1e')];var _0xfed0b3=_0xcdff9c?_0x4781dd[_0x2608('0x21')]:_0x7d307[_0x2608('0x1e')]+_0x7d307['limit'];var _0x4c76fe;if(_0xfed0b3>=_0x2fe2d3){_0xfed0b3=_0x2fe2d3;_0x4c76fe=0xc8;}else{_0x4c76fe=0xce;}_0x46e9b8[_0x2608('0x1b')](_0x4c76fe);return _0x46e9b8[_0x2608('0x22')](_0x2608('0x23'),_0x17c1ca+'-'+_0xfed0b3+'/'+_0x2fe2d3)[_0x2608('0x1d')](_0x4781dd);}return null;};}function patchUpdates(_0x17fc49){return function(_0x3f986c){try{jsonpatch[_0x2608('0x24')](_0x3f986c,_0x17fc49,!![]);}catch(_0x3c5721){return BPromise['reject'](_0x3c5721);}return _0x3f986c[_0x2608('0x25')]();};}function saveUpdates(_0x55da75,_0xbb8ec9){return function(_0x24214d){if(_0x24214d){return _0x24214d['update'](_0x55da75)[_0x2608('0x26')](function(_0x1b72c1){return _0x1b72c1;});}return null;};}function removeEntity(_0x3eea8e,_0x1201d1){return function(_0x28cfb3){if(_0x28cfb3){return _0x28cfb3[_0x2608('0x27')]()[_0x2608('0x26')](function(){_0x3eea8e['status'](0xcc)[_0x2608('0x1c')]();});}};}function handleEntityNotFound(_0x1e84ac,_0x4793af){return function(_0x34b48e){if(!_0x34b48e){_0x1e84ac['sendStatus'](0x194);}return _0x34b48e;};}function handleError(_0x215e6a,_0x5e8942){_0x5e8942=_0x5e8942||0x1f4;return function(_0x4580d1){logger[_0x2608('0x28')](_0x4580d1[_0x2608('0x29')]);if(_0x4580d1[_0x2608('0x2a')]){delete _0x4580d1['name'];}_0x215e6a[_0x2608('0x1b')](_0x5e8942)['send'](_0x4580d1);};}exports[_0x2608('0x2b')]=function(_0x1de2e4,_0x4a763e){var _0x471523={},_0x350c86={},_0x1e74bd={'count':0x0,'rows':[]};var _0x17b2f7=_[_0x2608('0x2c')](db[_0x2608('0x2d')][_0x2608('0x2e')],function(_0x2e93bd){return{'name':_0x2e93bd[_0x2608('0x2f')],'type':_0x2e93bd[_0x2608('0x30')]['key']};});_0x350c86[_0x2608('0x31')]=_[_0x2608('0x2c')](_0x17b2f7,_0x2608('0x2a'));_0x350c86['query']=_[_0x2608('0x32')](_0x1de2e4[_0x2608('0x33')]);_0x350c86[_0x2608('0x34')]=_[_0x2608('0x35')](_0x350c86['model'],_0x350c86[_0x2608('0x33')]);_0x471523[_0x2608('0x36')]=_[_0x2608('0x35')](_0x350c86[_0x2608('0x31')],qs['fields'](_0x1de2e4[_0x2608('0x33')][_0x2608('0x37')]));_0x471523[_0x2608('0x36')]=_0x471523['attributes'][_0x2608('0x38')]?_0x471523[_0x2608('0x36')]:_0x350c86[_0x2608('0x31')];if(!_0x1de2e4[_0x2608('0x33')][_0x2608('0x39')]('nolimit')){_0x471523[_0x2608('0x1f')]=qs['limit'](_0x1de2e4['query'][_0x2608('0x1f')]);_0x471523['offset']=qs[_0x2608('0x1e')](_0x1de2e4['query'][_0x2608('0x1e')]);}_0x471523[_0x2608('0x3a')]=qs['sort'](_0x1de2e4[_0x2608('0x33')][_0x2608('0x3b')]);_0x471523['where']=qs[_0x2608('0x34')](_[_0x2608('0x3c')](_0x1de2e4[_0x2608('0x33')],_0x350c86[_0x2608('0x34')]),_0x17b2f7);if(_0x1de2e4[_0x2608('0x33')]['filter']){_0x471523[_0x2608('0x3d')]=_[_0x2608('0x3e')](_0x471523[_0x2608('0x3d')],{'$or':_[_0x2608('0x2c')](_0x17b2f7,function(_0x48b0f7){if(_0x48b0f7[_0x2608('0x30')]!==_0x2608('0x3f')){var _0x250e1c={};_0x250e1c[_0x48b0f7[_0x2608('0x2a')]]={'$like':'%'+_0x1de2e4[_0x2608('0x33')]['filter']+'%'};return _0x250e1c;}})});}_0x471523=_['merge']({},_0x471523,_0x1de2e4['options']);var _0x59d0e3={'where':_0x471523[_0x2608('0x3d')]};return db[_0x2608('0x2d')][_0x2608('0x21')](_0x59d0e3)[_0x2608('0x26')](function(_0x14babd){_0x1e74bd[_0x2608('0x21')]=_0x14babd;if(_0x1de2e4[_0x2608('0x33')][_0x2608('0x40')]){_0x471523[_0x2608('0x41')]=[{'all':!![]}];}return db[_0x2608('0x2d')]['findAll'](_0x471523);})[_0x2608('0x26')](function(_0x474d61){_0x1e74bd[_0x2608('0x42')]=_0x474d61;return _0x1e74bd;})[_0x2608('0x26')](respondWithFilteredResult(_0x4a763e,_0x471523))[_0x2608('0x43')](handleError(_0x4a763e,null));};exports[_0x2608('0x44')]=function(_0x320f75,_0x4ff673){var _0x245e66={'raw':!![],'where':{'id':_0x320f75['params']['id']}},_0x565b3d={};_0x565b3d[_0x2608('0x31')]=_[_0x2608('0x32')](db[_0x2608('0x2d')]['rawAttributes']);_0x565b3d[_0x2608('0x33')]=_[_0x2608('0x32')](_0x320f75[_0x2608('0x33')]);_0x565b3d[_0x2608('0x34')]=_[_0x2608('0x35')](_0x565b3d[_0x2608('0x31')],_0x565b3d[_0x2608('0x33')]);_0x245e66[_0x2608('0x36')]=_[_0x2608('0x35')](_0x565b3d[_0x2608('0x31')],qs[_0x2608('0x37')](_0x320f75[_0x2608('0x33')]['fields']));_0x245e66['attributes']=_0x245e66['attributes'][_0x2608('0x38')]?_0x245e66['attributes']:_0x565b3d[_0x2608('0x31')];if(_0x320f75[_0x2608('0x33')][_0x2608('0x40')]){_0x245e66[_0x2608('0x41')]=[{'all':!![]}];}_0x245e66=_[_0x2608('0x3e')]({},_0x245e66,_0x320f75['options']);return db['SugarcrmField'][_0x2608('0x45')](_0x245e66)[_0x2608('0x26')](handleEntityNotFound(_0x4ff673,null))[_0x2608('0x26')](respondWithResult(_0x4ff673,null))['catch'](handleError(_0x4ff673,null));};exports[_0x2608('0x46')]=function(_0x936403,_0x5ac904){return db['SugarcrmField']['create'](_0x936403[_0x2608('0x47')],{})['then'](respondWithResult(_0x5ac904,0xc9))['catch'](handleError(_0x5ac904,null));};exports[_0x2608('0x48')]=function(_0x459935,_0x46637d){if(_0x459935['body']['id']){delete _0x459935['body']['id'];}return db[_0x2608('0x2d')]['find']({'where':{'id':_0x459935['params']['id']}})[_0x2608('0x26')](handleEntityNotFound(_0x46637d,null))[_0x2608('0x26')](saveUpdates(_0x459935['body'],null))['then'](respondWithResult(_0x46637d,null))[_0x2608('0x43')](handleError(_0x46637d,null));};exports[_0x2608('0x27')]=function(_0x4bcfaa,_0x46b4cd){return db[_0x2608('0x2d')][_0x2608('0x45')]({'where':{'id':_0x4bcfaa[_0x2608('0x49')]['id']}})[_0x2608('0x26')](handleEntityNotFound(_0x46b4cd,null))['then'](removeEntity(_0x46b4cd,null))[_0x2608('0x43')](handleError(_0x46b4cd,null));}; \ No newline at end of file +var _0x7421=['filters','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x47e2ba,_0xea89fa){var _0x408321=function(_0xa1a808){while(--_0xa1a808){_0x47e2ba['push'](_0x47e2ba['shift']());}};_0x408321(++_0xea89fa);}(_0x7421,0x141));var _0x1742=function(_0x254764,_0x51f312){_0x254764=_0x254764-0x0;var _0x25057f=_0x7421[_0x254764];return _0x25057f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1742('0x0'));var zipdir=require(_0x1742('0x1'));var jsonpatch=require(_0x1742('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1742('0x3'));var Mustache=require(_0x1742('0x4'));var util=require(_0x1742('0x5'));var path=require(_0x1742('0x6'));var sox=require('sox');var csv=require(_0x1742('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1742('0x8'));var _=require(_0x1742('0x9'));var squel=require(_0x1742('0xa'));var crypto=require(_0x1742('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1742('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1742('0xd'));var Papa=require(_0x1742('0xe'));var Redis=require('ioredis');var authService=require(_0x1742('0xf'));var qs=require(_0x1742('0x10'));var as=require(_0x1742('0x11'));var hardwareService=require(_0x1742('0x12'));var logger=require(_0x1742('0x13'))(_0x1742('0x14'));var utils=require(_0x1742('0x15'));var config=require(_0x1742('0x16'));var licenseUtil=require(_0x1742('0x17'));var db=require(_0x1742('0x18'))['db'];function respondWithStatusCode(_0x1dbb95,_0x127065){_0x127065=_0x127065||0xcc;return function(_0x2db326){if(_0x2db326){return _0x1dbb95[_0x1742('0x19')](_0x127065);}return _0x1dbb95['status'](_0x127065)[_0x1742('0x1a')]();};}function respondWithResult(_0xb2a42e,_0x3a1b18){_0x3a1b18=_0x3a1b18||0xc8;return function(_0x20d96e){if(_0x20d96e){return _0xb2a42e[_0x1742('0x1b')](_0x3a1b18)[_0x1742('0x1c')](_0x20d96e);}};}function respondWithFilteredResult(_0x139ed1,_0x57b1c9){return function(_0x306e2f){if(_0x306e2f){var _0x3de76a=typeof _0x57b1c9[_0x1742('0x1d')]===_0x1742('0x1e')&&typeof _0x57b1c9[_0x1742('0x1f')]===_0x1742('0x1e');var _0x3729a5=_0x306e2f[_0x1742('0x20')];var _0x1c6490=_0x3de76a?0x0:_0x57b1c9['offset'];var _0x7d1fe7=_0x3de76a?_0x306e2f[_0x1742('0x20')]:_0x57b1c9[_0x1742('0x1d')]+_0x57b1c9[_0x1742('0x1f')];var _0x6f5a18;if(_0x7d1fe7>=_0x3729a5){_0x7d1fe7=_0x3729a5;_0x6f5a18=0xc8;}else{_0x6f5a18=0xce;}_0x139ed1['status'](_0x6f5a18);return _0x139ed1['set'](_0x1742('0x21'),_0x1c6490+'-'+_0x7d1fe7+'/'+_0x3729a5)[_0x1742('0x1c')](_0x306e2f);}return null;};}function patchUpdates(_0xf8cff0){return function(_0xe28271){try{jsonpatch[_0x1742('0x22')](_0xe28271,_0xf8cff0,!![]);}catch(_0x3c2907){return BPromise[_0x1742('0x23')](_0x3c2907);}return _0xe28271['save']();};}function saveUpdates(_0x522e29,_0x4035f9){return function(_0x1fc1bc){if(_0x1fc1bc){return _0x1fc1bc[_0x1742('0x24')](_0x522e29)[_0x1742('0x25')](function(_0x558796){return _0x558796;});}return null;};}function removeEntity(_0x279356,_0x773760){return function(_0x447141){if(_0x447141){return _0x447141[_0x1742('0x26')]()['then'](function(){_0x279356[_0x1742('0x1b')](0xcc)[_0x1742('0x1a')]();});}};}function handleEntityNotFound(_0x2a2db8,_0x2c6631){return function(_0x41fb48){if(!_0x41fb48){_0x2a2db8[_0x1742('0x19')](0x194);}return _0x41fb48;};}function handleError(_0x921970,_0x290837){_0x290837=_0x290837||0x1f4;return function(_0x1e695e){logger[_0x1742('0x27')](_0x1e695e[_0x1742('0x28')]);if(_0x1e695e[_0x1742('0x29')]){delete _0x1e695e[_0x1742('0x29')];}_0x921970['status'](_0x290837)[_0x1742('0x2a')](_0x1e695e);};}exports[_0x1742('0x2b')]=function(_0x186590,_0x437e26){var _0x278520={},_0x2a9967={},_0x325f47={'count':0x0,'rows':[]};var _0x35b6b4=_[_0x1742('0x2c')](db[_0x1742('0x2d')]['rawAttributes'],function(_0x552255){return{'name':_0x552255[_0x1742('0x2e')],'type':_0x552255[_0x1742('0x2f')][_0x1742('0x30')]};});_0x2a9967[_0x1742('0x31')]=_['map'](_0x35b6b4,'name');_0x2a9967[_0x1742('0x32')]=_[_0x1742('0x33')](_0x186590[_0x1742('0x32')]);_0x2a9967['filters']=_[_0x1742('0x34')](_0x2a9967['model'],_0x2a9967[_0x1742('0x32')]);_0x278520[_0x1742('0x35')]=_[_0x1742('0x34')](_0x2a9967[_0x1742('0x31')],qs[_0x1742('0x36')](_0x186590[_0x1742('0x32')]['fields']));_0x278520[_0x1742('0x35')]=_0x278520[_0x1742('0x35')][_0x1742('0x37')]?_0x278520[_0x1742('0x35')]:_0x2a9967[_0x1742('0x31')];if(!_0x186590[_0x1742('0x32')][_0x1742('0x38')](_0x1742('0x39'))){_0x278520[_0x1742('0x1f')]=qs[_0x1742('0x1f')](_0x186590[_0x1742('0x32')][_0x1742('0x1f')]);_0x278520[_0x1742('0x1d')]=qs[_0x1742('0x1d')](_0x186590['query'][_0x1742('0x1d')]);}_0x278520['order']=qs['sort'](_0x186590[_0x1742('0x32')][_0x1742('0x3a')]);_0x278520['where']=qs[_0x1742('0x3b')](_[_0x1742('0x3c')](_0x186590[_0x1742('0x32')],_0x2a9967[_0x1742('0x3b')]),_0x35b6b4);if(_0x186590[_0x1742('0x32')]['filter']){_0x278520[_0x1742('0x3d')]=_[_0x1742('0x3e')](_0x278520[_0x1742('0x3d')],{'$or':_[_0x1742('0x2c')](_0x35b6b4,function(_0x3c535f){if(_0x3c535f[_0x1742('0x2f')]!==_0x1742('0x3f')){var _0x9f68bc={};_0x9f68bc[_0x3c535f['name']]={'$like':'%'+_0x186590['query'][_0x1742('0x40')]+'%'};return _0x9f68bc;}})});}_0x278520=_[_0x1742('0x3e')]({},_0x278520,_0x186590['options']);var _0x383eaf={'where':_0x278520['where']};return db[_0x1742('0x2d')][_0x1742('0x20')](_0x383eaf)[_0x1742('0x25')](function(_0x9f69a6){_0x325f47['count']=_0x9f69a6;if(_0x186590[_0x1742('0x32')][_0x1742('0x41')]){_0x278520[_0x1742('0x42')]=[{'all':!![]}];}return db['SugarcrmField'][_0x1742('0x43')](_0x278520);})[_0x1742('0x25')](function(_0x494969){_0x325f47[_0x1742('0x44')]=_0x494969;return _0x325f47;})[_0x1742('0x25')](respondWithFilteredResult(_0x437e26,_0x278520))[_0x1742('0x45')](handleError(_0x437e26,null));};exports[_0x1742('0x46')]=function(_0x15c7a7,_0x11442e){var _0xb29ffb={'raw':!![],'where':{'id':_0x15c7a7[_0x1742('0x47')]['id']}},_0xcbd4c8={};_0xcbd4c8[_0x1742('0x31')]=_[_0x1742('0x33')](db[_0x1742('0x2d')]['rawAttributes']);_0xcbd4c8[_0x1742('0x32')]=_[_0x1742('0x33')](_0x15c7a7['query']);_0xcbd4c8[_0x1742('0x3b')]=_[_0x1742('0x34')](_0xcbd4c8[_0x1742('0x31')],_0xcbd4c8[_0x1742('0x32')]);_0xb29ffb['attributes']=_[_0x1742('0x34')](_0xcbd4c8[_0x1742('0x31')],qs[_0x1742('0x36')](_0x15c7a7[_0x1742('0x32')][_0x1742('0x36')]));_0xb29ffb[_0x1742('0x35')]=_0xb29ffb[_0x1742('0x35')][_0x1742('0x37')]?_0xb29ffb['attributes']:_0xcbd4c8[_0x1742('0x31')];if(_0x15c7a7[_0x1742('0x32')]['includeAll']){_0xb29ffb['include']=[{'all':!![]}];}_0xb29ffb=_[_0x1742('0x3e')]({},_0xb29ffb,_0x15c7a7[_0x1742('0x48')]);return db['SugarcrmField'][_0x1742('0x49')](_0xb29ffb)[_0x1742('0x25')](handleEntityNotFound(_0x11442e,null))[_0x1742('0x25')](respondWithResult(_0x11442e,null))[_0x1742('0x45')](handleError(_0x11442e,null));};exports[_0x1742('0x4a')]=function(_0x2c7e75,_0x20d327){return db[_0x1742('0x2d')][_0x1742('0x4a')](_0x2c7e75[_0x1742('0x4b')],{})[_0x1742('0x25')](respondWithResult(_0x20d327,0xc9))[_0x1742('0x45')](handleError(_0x20d327,null));};exports['update']=function(_0x182fb2,_0x5e20f2){if(_0x182fb2[_0x1742('0x4b')]['id']){delete _0x182fb2['body']['id'];}return db['SugarcrmField'][_0x1742('0x49')]({'where':{'id':_0x182fb2[_0x1742('0x47')]['id']}})[_0x1742('0x25')](handleEntityNotFound(_0x5e20f2,null))[_0x1742('0x25')](saveUpdates(_0x182fb2['body'],null))[_0x1742('0x25')](respondWithResult(_0x5e20f2,null))['catch'](handleError(_0x5e20f2,null));};exports[_0x1742('0x26')]=function(_0x538b8c,_0x11dfc7){return db[_0x1742('0x2d')][_0x1742('0x49')]({'where':{'id':_0x538b8c[_0x1742('0x47')]['id']}})[_0x1742('0x25')](handleEntityNotFound(_0x11dfc7,null))[_0x1742('0x25')](removeEntity(_0x11dfc7,null))[_0x1742('0x45')](handleError(_0x11dfc7,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index bf66ac7..79ab098 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 _0xc627=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField'];(function(_0x2cd1f6,_0x3aa2f1){var _0x18b273=function(_0x59f863){while(--_0x59f863){_0x2cd1f6['push'](_0x2cd1f6['shift']());}};_0x18b273(++_0x3aa2f1);}(_0xc627,0xb6));var _0x7c62=function(_0x2607e3,_0x765ab6){_0x2607e3=_0x2607e3-0x0;var _0x398355=_0xc627[_0x2607e3];return _0x398355;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7c62('0x0'))(_0x7c62('0x1'));var moment=require(_0x7c62('0x2'));var BPromise=require(_0x7c62('0x3'));var rp=require(_0x7c62('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c62('0x5'));var config=require(_0x7c62('0x6'));var attributes=require(_0x7c62('0x7'));module[_0x7c62('0x8')]=function(_0x30f702,_0x733feb){return _0x30f702[_0x7c62('0x9')](_0x7c62('0xa'),attributes,{'tableName':_0x7c62('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x7c62('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x424c=['../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x424c,0xe9));var _0xc424=function(_0x4fd171,_0x55079e){_0x4fd171=_0x4fd171-0x0;var _0x513dde=_0x424c[_0x4fd171];return _0x513dde;};'use strict';var _=require('lodash');var util=require(_0xc424('0x0'));var logger=require(_0xc424('0x1'))(_0xc424('0x2'));var moment=require(_0xc424('0x3'));var BPromise=require('bluebird');var rp=require(_0xc424('0x4'));var fs=require('fs');var path=require(_0xc424('0x5'));var rimraf=require(_0xc424('0x6'));var config=require(_0xc424('0x7'));var attributes=require(_0xc424('0x8'));module[_0xc424('0x9')]=function(_0x1a8def,_0x4d2f11){return _0x1a8def[_0xc424('0xa')](_0xc424('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xc424('0xc'),'fields':[_0xc424('0xd'),_0xc424('0xe')],'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 2536f28..44c2fdf 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 _0xe0e9=['http','request','then','info','request\x20sent','error','code','SugarcrmField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x1502c2,_0x6e62f){var _0x29fdbc=function(_0x51f27d){while(--_0x51f27d){_0x1502c2['push'](_0x1502c2['shift']());}};_0x29fdbc(++_0x6e62f);}(_0xe0e9,0x101));var _0x9e0e=function(_0x51d0a9,_0x18972d){_0x51d0a9=_0x51d0a9-0x0;var _0x3ebb70=_0xe0e9[_0x51d0a9];return _0x3ebb70;};'use strict';var _=require(_0x9e0e('0x0'));var util=require(_0x9e0e('0x1'));var moment=require('moment');var BPromise=require(_0x9e0e('0x2'));var rs=require(_0x9e0e('0x3'));var fs=require('fs');var Redis=require(_0x9e0e('0x4'));var db=require(_0x9e0e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e0e('0x6'));var config=require(_0x9e0e('0x7'));var jayson=require(_0x9e0e('0x8'));var client=jayson['client'][_0x9e0e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x362b7a,_0x3d7cae,_0x11d4f1){return new BPromise(function(_0x2441b3,_0x3bedea){return client[_0x9e0e('0xa')](_0x362b7a,_0x11d4f1)[_0x9e0e('0xb')](function(_0x4f6bec){logger[_0x9e0e('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x3d7cae,_0x9e0e('0xd'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x3d7cae,_0x9e0e('0xd'),JSON['stringify'](_0x4f6bec));if(_0x4f6bec[_0x9e0e('0xe')]){if(_0x4f6bec[_0x9e0e('0xe')][_0x9e0e('0xf')]===0x1f4){logger[_0x9e0e('0xe')](_0x9e0e('0x10'),_0x3d7cae,_0x4f6bec['error'][_0x9e0e('0x11')]);return _0x3bedea(_0x4f6bec[_0x9e0e('0xe')][_0x9e0e('0x11')]);}logger['error'](_0x9e0e('0x10'),_0x3d7cae,_0x4f6bec[_0x9e0e('0xe')][_0x9e0e('0x11')]);return _0x2441b3(_0x4f6bec[_0x9e0e('0xe')][_0x9e0e('0x11')]);}else{logger['info'](_0x9e0e('0x10'),_0x3d7cae,'request\x20sent');_0x2441b3(_0x4f6bec['result'][_0x9e0e('0x11')]);}})[_0x9e0e('0x12')](function(_0x517602){logger[_0x9e0e('0xe')](_0x9e0e('0x10'),_0x3d7cae,_0x517602);_0x3bedea(_0x517602);});});} \ No newline at end of file +var _0xa781=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x551cf0,_0x2775b6){var _0x275310=function(_0x309dfd){while(--_0x309dfd){_0x551cf0['push'](_0x551cf0['shift']());}};_0x275310(++_0x2775b6);}(_0xa781,0xbd));var _0x1a78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa781[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1a78('0x0'));var moment=require(_0x1a78('0x1'));var BPromise=require(_0x1a78('0x2'));var rs=require(_0x1a78('0x3'));var fs=require('fs');var Redis=require(_0x1a78('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a78('0x5'));var logger=require(_0x1a78('0x6'))(_0x1a78('0x7'));var config=require(_0x1a78('0x8'));var jayson=require(_0x1a78('0x9'));var client=jayson['client'][_0x1a78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44517b,_0x2af04b,_0x471449){return new BPromise(function(_0x515353,_0x55cb9e){return client[_0x1a78('0xb')](_0x44517b,_0x471449)['then'](function(_0x5e4bff){logger[_0x1a78('0xc')](_0x1a78('0xd'),_0x2af04b,_0x1a78('0xe'));logger[_0x1a78('0xf')](_0x1a78('0x10'),_0x2af04b,_0x1a78('0xe'),JSON['stringify'](_0x5e4bff));if(_0x5e4bff['error']){if(_0x5e4bff[_0x1a78('0x11')]['code']===0x1f4){logger[_0x1a78('0x11')](_0x1a78('0xd'),_0x2af04b,_0x5e4bff[_0x1a78('0x11')][_0x1a78('0x12')]);return _0x55cb9e(_0x5e4bff[_0x1a78('0x11')][_0x1a78('0x12')]);}logger[_0x1a78('0x11')](_0x1a78('0xd'),_0x2af04b,_0x5e4bff[_0x1a78('0x11')][_0x1a78('0x12')]);return _0x515353(_0x5e4bff['error']['message']);}else{logger[_0x1a78('0xc')](_0x1a78('0xd'),_0x2af04b,_0x1a78('0xe'));_0x515353(_0x5e4bff[_0x1a78('0x13')]['message']);}})[_0x1a78('0x14')](function(_0x126088){logger['error'](_0x1a78('0xd'),_0x2af04b,_0x126088);_0x55cb9e(_0x126088);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 8d0b338..6b12f78 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 _0xe198=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get'];(function(_0x3b2333,_0x15d8d7){var _0x1f9826=function(_0xedc744){while(--_0xedc744){_0x3b2333['push'](_0x3b2333['shift']());}};_0x1f9826(++_0x15d8d7);}(_0xe198,0x6f));var _0x8e19=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xe198[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0x8e19('0x0'));var util=require(_0x8e19('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8e19('0x2'));var router=express[_0x8e19('0x3')]();var fs_extra=require(_0x8e19('0x4'));var auth=require(_0x8e19('0x5'));var interaction=require(_0x8e19('0x6'));var config=require('../../config/environment');var controller=require(_0x8e19('0x7'));router[_0x8e19('0x8')]('/',auth[_0x8e19('0x9')](),controller[_0x8e19('0xa')]);router[_0x8e19('0x8')](_0x8e19('0xb'),auth[_0x8e19('0x9')](),controller[_0x8e19('0xc')]);router[_0x8e19('0x8')](_0x8e19('0xd'),auth[_0x8e19('0x9')](),controller[_0x8e19('0xe')]);router[_0x8e19('0x8')]('/:id/fields',auth[_0x8e19('0x9')](),controller[_0x8e19('0xf')]);router[_0x8e19('0x10')]('/',auth[_0x8e19('0x9')](),controller[_0x8e19('0x11')]);router[_0x8e19('0x10')](_0x8e19('0xd'),auth[_0x8e19('0x9')](),controller['addConfiguration']);router['put'](_0x8e19('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8e19('0x12')](_0x8e19('0xb'),auth[_0x8e19('0x9')](),controller[_0x8e19('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1cbb=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0x1cbb,0x18f));var _0xb1cb=function(_0x20eba2,_0x51809c){_0x20eba2=_0x20eba2-0x0;var _0x503fd7=_0x1cbb[_0x20eba2];return _0x503fd7;};'use strict';var multer=require(_0xb1cb('0x0'));var util=require(_0xb1cb('0x1'));var path=require('path');var timeout=require(_0xb1cb('0x2'));var express=require(_0xb1cb('0x3'));var router=express[_0xb1cb('0x4')]();var fs_extra=require(_0xb1cb('0x5'));var auth=require(_0xb1cb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb1cb('0x7'));var controller=require(_0xb1cb('0x8'));router[_0xb1cb('0x9')]('/',auth[_0xb1cb('0xa')](),controller[_0xb1cb('0xb')]);router[_0xb1cb('0x9')](_0xb1cb('0xc'),auth[_0xb1cb('0xa')](),controller['show']);router['get'](_0xb1cb('0xd'),auth[_0xb1cb('0xa')](),controller[_0xb1cb('0xe')]);router[_0xb1cb('0x9')](_0xb1cb('0xf'),auth[_0xb1cb('0xa')](),controller[_0xb1cb('0x10')]);router[_0xb1cb('0x11')]('/',auth[_0xb1cb('0xa')](),controller[_0xb1cb('0x12')]);router[_0xb1cb('0x11')]('/:id/configurations',auth[_0xb1cb('0xa')](),controller[_0xb1cb('0x13')]);router[_0xb1cb('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xb1cb('0x15')]);router[_0xb1cb('0x16')](_0xb1cb('0xc'),auth[_0xb1cb('0xa')](),controller[_0xb1cb('0x17')]);module[_0xb1cb('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 158555e..4230046 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 _0xaaf5=['HelpDesk','sequelize','exports','STRING'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0xaaf5,0x165));var _0x5aaf=function(_0x10f5db,_0x1ec8be){_0x10f5db=_0x10f5db-0x0;var _0x12e69a=_0xaaf5[_0x10f5db];return _0x12e69a;};'use strict';var Sequelize=require(_0x5aaf('0x0'));module[_0x5aaf('0x1')]={'name':{'type':Sequelize[_0x5aaf('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5aaf('0x2')]},'username':{'type':Sequelize[_0x5aaf('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x5aaf('0x2')],'allowNull':![],'defaultValue':_0x5aaf('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x5aaf('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xcf88=['sequelize','exports','STRING','HelpDesk'];(function(_0x231a78,_0x7fe9aa){var _0x1e7b26=function(_0x21e244){while(--_0x21e244){_0x231a78['push'](_0x231a78['shift']());}};_0x1e7b26(++_0x7fe9aa);}(_0xcf88,0x1a0));var _0x8cf8=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xcf88[_0x1caf6a];return _0x1bf493;};'use strict';var Sequelize=require(_0x8cf8('0x0'));module[_0x8cf8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8cf8('0x2')]},'username':{'type':Sequelize[_0x8cf8('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8cf8('0x2')],'allowNull':![],'defaultValue':_0x8cf8('0x3')},'remoteUri':{'type':Sequelize[_0x8cf8('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8cf8('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8cf8('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 3a8d08a..918d8d2 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 _0x3a55=['nolimit','order','sort','where','filters','filter','merge','type','options','include','VtigerAccount','findAll','rows','catch','includeAll','find','create','body','params','getConfigurations','VtigerConfiguration','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','VtigerField','Descriptions','md5','getFields','username','description','moduleName','serverUrl','accessKey','slice','lastIndexOf','format','getchallenge','success','login','token','GET','describe','result','sessionName','autogenerated','reference','owner','remove','includes','editable','false','picklist','picklistValues','label','log','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3a55,0x134));var _0x53a5=function(_0xacdb96,_0x123d81){_0xacdb96=_0xacdb96-0x0;var _0xcf4183=_0x3a55[_0xacdb96];return _0xcf4183;};'use strict';var emlformat=require(_0x53a5('0x0'));var rimraf=require(_0x53a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53a5('0x2'));var rp=require(_0x53a5('0x3'));var moment=require(_0x53a5('0x4'));var BPromise=require(_0x53a5('0x5'));var Mustache=require(_0x53a5('0x6'));var util=require('util');var path=require(_0x53a5('0x7'));var sox=require(_0x53a5('0x8'));var csv=require(_0x53a5('0x9'));var ejs=require(_0x53a5('0xa'));var fs=require('fs');var fs_extra=require(_0x53a5('0xb'));var _=require(_0x53a5('0xc'));var squel=require(_0x53a5('0xd'));var crypto=require(_0x53a5('0xe'));var jsforce=require(_0x53a5('0xf'));var deskjs=require(_0x53a5('0x10'));var toCsv=require(_0x53a5('0x9'));var querystring=require(_0x53a5('0x11'));var Papa=require(_0x53a5('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x53a5('0x13'));var hardwareService=require(_0x53a5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x53a5('0x15'));var config=require(_0x53a5('0x16'));var licenseUtil=require(_0x53a5('0x17'));var db=require(_0x53a5('0x18'))['db'];var integrations=require(_0x53a5('0x19'));function respondWithStatusCode(_0x1787e2,_0x594d3b){_0x594d3b=_0x594d3b||0xcc;return function(_0xa6340d){if(_0xa6340d){return _0x1787e2['sendStatus'](_0x594d3b);}return _0x1787e2[_0x53a5('0x1a')](_0x594d3b)[_0x53a5('0x1b')]();};}function respondWithResult(_0x108c4b,_0x50cd6e){_0x50cd6e=_0x50cd6e||0xc8;return function(_0x399ca8){if(_0x399ca8){return _0x108c4b[_0x53a5('0x1a')](_0x50cd6e)[_0x53a5('0x1c')](_0x399ca8);}};}function respondWithFilteredResult(_0x39ad46,_0x1307ad){return function(_0x3f0a7e){if(_0x3f0a7e){var _0x299a5a=typeof _0x1307ad[_0x53a5('0x1d')]==='undefined'&&typeof _0x1307ad[_0x53a5('0x1e')]===_0x53a5('0x1f');var _0x4b3efa=_0x3f0a7e['count'];var _0x41f14c=_0x299a5a?0x0:_0x1307ad[_0x53a5('0x1d')];var _0x6958e6=_0x299a5a?_0x3f0a7e[_0x53a5('0x20')]:_0x1307ad[_0x53a5('0x1d')]+_0x1307ad['limit'];var _0x21127d;if(_0x6958e6>=_0x4b3efa){_0x6958e6=_0x4b3efa;_0x21127d=0xc8;}else{_0x21127d=0xce;}_0x39ad46[_0x53a5('0x1a')](_0x21127d);return _0x39ad46[_0x53a5('0x21')]('Content-Range',_0x41f14c+'-'+_0x6958e6+'/'+_0x4b3efa)[_0x53a5('0x1c')](_0x3f0a7e);}return null;};}function patchUpdates(_0x1f159e){return function(_0x1fd172){try{jsonpatch[_0x53a5('0x22')](_0x1fd172,_0x1f159e,!![]);}catch(_0x5754f1){return BPromise[_0x53a5('0x23')](_0x5754f1);}return _0x1fd172[_0x53a5('0x24')]();};}function saveUpdates(_0x212b9a,_0x2ea5c5){return function(_0x53ef01){if(_0x53ef01){return _0x53ef01[_0x53a5('0x25')](_0x212b9a)[_0x53a5('0x26')](function(_0x533b5f){return _0x533b5f;});}return null;};}function removeEntity(_0xe68862,_0x44b8c0){return function(_0x571321){if(_0x571321){return _0x571321[_0x53a5('0x27')]()['then'](function(){_0xe68862[_0x53a5('0x1a')](0xcc)[_0x53a5('0x1b')]();});}};}function handleEntityNotFound(_0x4496fb,_0xa80551){return function(_0x5754e0){if(!_0x5754e0){_0x4496fb[_0x53a5('0x28')](0x194);}return _0x5754e0;};}function handleError(_0x39a054,_0x1e7b90){_0x1e7b90=_0x1e7b90||0x1f4;return function(_0x4d5ea1){logger[_0x53a5('0x29')](_0x4d5ea1[_0x53a5('0x2a')]);if(_0x4d5ea1[_0x53a5('0x2b')]){delete _0x4d5ea1[_0x53a5('0x2b')];}_0x39a054[_0x53a5('0x1a')](_0x1e7b90)[_0x53a5('0x2c')](_0x4d5ea1);};}exports[_0x53a5('0x2d')]=function(_0x1fb6f2,_0x26dc5a){var _0x5901f4={},_0x342816={},_0x1b8f79={'count':0x0,'rows':[]};var _0x1291fc=_[_0x53a5('0x2e')](db['VtigerAccount'][_0x53a5('0x2f')],function(_0x2b1191){return{'name':_0x2b1191[_0x53a5('0x30')],'type':_0x2b1191['type'][_0x53a5('0x31')]};});_0x342816[_0x53a5('0x32')]=_['map'](_0x1291fc,_0x53a5('0x2b'));_0x342816[_0x53a5('0x33')]=_[_0x53a5('0x34')](_0x1fb6f2[_0x53a5('0x33')]);_0x342816['filters']=_[_0x53a5('0x35')](_0x342816[_0x53a5('0x32')],_0x342816[_0x53a5('0x33')]);_0x5901f4[_0x53a5('0x36')]=_[_0x53a5('0x35')](_0x342816[_0x53a5('0x32')],qs['fields'](_0x1fb6f2[_0x53a5('0x33')][_0x53a5('0x37')]));_0x5901f4[_0x53a5('0x36')]=_0x5901f4['attributes'][_0x53a5('0x38')]?_0x5901f4[_0x53a5('0x36')]:_0x342816[_0x53a5('0x32')];if(!_0x1fb6f2['query'][_0x53a5('0x39')](_0x53a5('0x3a'))){_0x5901f4['limit']=qs[_0x53a5('0x1e')](_0x1fb6f2[_0x53a5('0x33')][_0x53a5('0x1e')]);_0x5901f4[_0x53a5('0x1d')]=qs['offset'](_0x1fb6f2[_0x53a5('0x33')][_0x53a5('0x1d')]);}_0x5901f4[_0x53a5('0x3b')]=qs['sort'](_0x1fb6f2[_0x53a5('0x33')][_0x53a5('0x3c')]);_0x5901f4[_0x53a5('0x3d')]=qs['filters'](_['pick'](_0x1fb6f2[_0x53a5('0x33')],_0x342816[_0x53a5('0x3e')]),_0x1291fc);if(_0x1fb6f2[_0x53a5('0x33')][_0x53a5('0x3f')]){_0x5901f4[_0x53a5('0x3d')]=_[_0x53a5('0x40')](_0x5901f4[_0x53a5('0x3d')],{'$or':_[_0x53a5('0x2e')](_0x1291fc,function(_0x38afa0){if(_0x38afa0[_0x53a5('0x41')]!=='VIRTUAL'){var _0x27dae1={};_0x27dae1[_0x38afa0[_0x53a5('0x2b')]]={'$like':'%'+_0x1fb6f2[_0x53a5('0x33')][_0x53a5('0x3f')]+'%'};return _0x27dae1;}})});}_0x5901f4=_[_0x53a5('0x40')]({},_0x5901f4,_0x1fb6f2[_0x53a5('0x42')]);var _0x40d301={'where':_0x5901f4[_0x53a5('0x3d')]};return db['VtigerAccount']['count'](_0x40d301)[_0x53a5('0x26')](function(_0x27192a){_0x1b8f79[_0x53a5('0x20')]=_0x27192a;if(_0x1fb6f2[_0x53a5('0x33')]['includeAll']){_0x5901f4[_0x53a5('0x43')]=[{'all':!![]}];}return db[_0x53a5('0x44')][_0x53a5('0x45')](_0x5901f4);})[_0x53a5('0x26')](function(_0x2e6599){_0x1b8f79[_0x53a5('0x46')]=_0x2e6599;return _0x1b8f79;})['then'](respondWithFilteredResult(_0x26dc5a,_0x5901f4))[_0x53a5('0x47')](handleError(_0x26dc5a,null));};exports['show']=function(_0x5ce435,_0x105753){var _0x45a553={'raw':![],'where':{'id':_0x5ce435['params']['id']}},_0x1d5329={};_0x1d5329[_0x53a5('0x32')]=_[_0x53a5('0x34')](db[_0x53a5('0x44')][_0x53a5('0x2f')]);_0x1d5329[_0x53a5('0x33')]=_['keys'](_0x5ce435[_0x53a5('0x33')]);_0x1d5329['filters']=_[_0x53a5('0x35')](_0x1d5329['model'],_0x1d5329[_0x53a5('0x33')]);_0x45a553['attributes']=_[_0x53a5('0x35')](_0x1d5329['model'],qs['fields'](_0x5ce435[_0x53a5('0x33')]['fields']));_0x45a553[_0x53a5('0x36')]=_0x45a553[_0x53a5('0x36')][_0x53a5('0x38')]?_0x45a553[_0x53a5('0x36')]:_0x1d5329[_0x53a5('0x32')];if(_0x5ce435[_0x53a5('0x33')][_0x53a5('0x48')]){_0x45a553[_0x53a5('0x43')]=[{'all':!![]}];}_0x45a553=_[_0x53a5('0x40')]({},_0x45a553,_0x5ce435[_0x53a5('0x42')]);return db['VtigerAccount'][_0x53a5('0x49')](_0x45a553)[_0x53a5('0x26')](handleEntityNotFound(_0x105753,null))['then'](respondWithResult(_0x105753,null))[_0x53a5('0x47')](handleError(_0x105753,null));};exports[_0x53a5('0x4a')]=function(_0x25c8cd,_0x48231e){return db[_0x53a5('0x44')][_0x53a5('0x4a')](_0x25c8cd[_0x53a5('0x4b')],{})['then'](respondWithResult(_0x48231e,0xc9))[_0x53a5('0x47')](handleError(_0x48231e,null));};exports[_0x53a5('0x25')]=function(_0x1d75bd,_0x4e0f5d){if(_0x1d75bd[_0x53a5('0x4b')]['id']){delete _0x1d75bd[_0x53a5('0x4b')]['id'];}return db[_0x53a5('0x44')][_0x53a5('0x49')]({'where':{'id':_0x1d75bd[_0x53a5('0x4c')]['id']}})[_0x53a5('0x26')](handleEntityNotFound(_0x4e0f5d,null))['then'](saveUpdates(_0x1d75bd[_0x53a5('0x4b')],null))[_0x53a5('0x26')](respondWithResult(_0x4e0f5d,null))['catch'](handleError(_0x4e0f5d,null));};exports['destroy']=function(_0x148d44,_0x4501a5){return db[_0x53a5('0x44')][_0x53a5('0x49')]({'where':{'id':_0x148d44['params']['id']}})[_0x53a5('0x26')](handleEntityNotFound(_0x4501a5,null))[_0x53a5('0x26')](removeEntity(_0x4501a5,null))[_0x53a5('0x47')](handleError(_0x4501a5,null));};exports[_0x53a5('0x4d')]=function(_0x3f7b9f,_0x11eeae,_0x2807ec){var _0x5e01fd={};var _0x154ef1={};var _0x5eb423;var _0x2ba099;return db[_0x53a5('0x44')]['findOne']({'where':{'id':_0x3f7b9f[_0x53a5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x11eeae,null))[_0x53a5('0x26')](function(_0xa308ba){if(_0xa308ba){_0x5eb423=_0xa308ba;_0x154ef1[_0x53a5('0x32')]=_[_0x53a5('0x34')](db[_0x53a5('0x4e')][_0x53a5('0x2f')]);_0x154ef1['query']=_[_0x53a5('0x34')](_0x3f7b9f[_0x53a5('0x33')]);_0x154ef1[_0x53a5('0x3e')]=_['intersection'](_0x154ef1[_0x53a5('0x32')],_0x154ef1[_0x53a5('0x33')]);_0x5e01fd[_0x53a5('0x36')]=_[_0x53a5('0x35')](_0x154ef1[_0x53a5('0x32')],qs[_0x53a5('0x37')](_0x3f7b9f[_0x53a5('0x33')][_0x53a5('0x37')]));_0x5e01fd['attributes']=_0x5e01fd[_0x53a5('0x36')][_0x53a5('0x38')]?_0x5e01fd['attributes']:_0x154ef1[_0x53a5('0x32')];_0x5e01fd[_0x53a5('0x3b')]=qs[_0x53a5('0x3c')](_0x3f7b9f['query'][_0x53a5('0x3c')]);_0x5e01fd[_0x53a5('0x3d')]=qs['filters'](_[_0x53a5('0x4f')](_0x3f7b9f['query'],_0x154ef1['filters']));if(_0x3f7b9f[_0x53a5('0x33')]['filter']){_0x5e01fd[_0x53a5('0x3d')]=_['merge'](_0x5e01fd['where'],{'$or':_[_0x53a5('0x2e')](_0x5e01fd[_0x53a5('0x36')],function(_0x5665bc){var _0x25074f={};_0x25074f[_0x5665bc]={'$like':'%'+_0x3f7b9f[_0x53a5('0x33')][_0x53a5('0x3f')]+'%'};return _0x25074f;})});}_0x5e01fd=_[_0x53a5('0x40')]({},_0x5e01fd,_0x3f7b9f['options']);return _0x5eb423[_0x53a5('0x4d')](_0x5e01fd);}})[_0x53a5('0x26')](function(_0x1d9a92){if(_0x1d9a92){_0x2ba099=_0x1d9a92[_0x53a5('0x38')];if(!_0x3f7b9f[_0x53a5('0x33')]['hasOwnProperty'](_0x53a5('0x3a'))){_0x5e01fd[_0x53a5('0x1e')]=qs['limit'](_0x3f7b9f[_0x53a5('0x33')][_0x53a5('0x1e')]);_0x5e01fd['offset']=qs[_0x53a5('0x1d')](_0x3f7b9f[_0x53a5('0x33')][_0x53a5('0x1d')]);}return _0x5eb423['getConfigurations'](_0x5e01fd);}})[_0x53a5('0x26')](function(_0xb5d9a5){if(_0xb5d9a5){return _0xb5d9a5?{'count':_0x2ba099,'rows':_0xb5d9a5}:null;}})[_0x53a5('0x26')](respondWithResult(_0x11eeae,null))[_0x53a5('0x47')](handleError(_0x11eeae,null));};exports[_0x53a5('0x50')]=function(_0x5d3889,_0x1ffc13,_0x50ab9a){if(_0x5d3889[_0x53a5('0x4b')]['id']){delete _0x5d3889[_0x53a5('0x4b')]['id'];}return db[_0x53a5('0x44')][_0x53a5('0x51')]({'where':{'id':_0x5d3889[_0x53a5('0x4c')]['id']}})[_0x53a5('0x26')](handleEntityNotFound(_0x1ffc13,null))[_0x53a5('0x26')](function(_0x1e1014){if(_0x1e1014){_0x5d3889[_0x53a5('0x4b')][_0x53a5('0x52')]=_0x1e1014['id'];_0x5d3889[_0x53a5('0x4b')][_0x53a5('0x53')]=integrations[_0x53a5('0x54')](_0x5d3889[_0x53a5('0x4b')][_0x53a5('0x55')],_0x5d3889[_0x53a5('0x4b')][_0x53a5('0x41')]);_0x5d3889[_0x53a5('0x4b')]['Descriptions']=integrations['getDescriptions'](_0x5d3889['body'][_0x53a5('0x55')],_0x5d3889[_0x53a5('0x4b')][_0x53a5('0x41')]);return db[_0x53a5('0x4e')][_0x53a5('0x4a')](_0x5d3889[_0x53a5('0x4b')],{'include':[{'model':db[_0x53a5('0x56')],'as':_0x53a5('0x53')},{'model':db[_0x53a5('0x56')],'as':_0x53a5('0x57')}]});}return null;})['then'](respondWithResult(_0x1ffc13,null))['catch'](handleError(_0x1ffc13,null));};var md5=require(_0x53a5('0x58'));exports[_0x53a5('0x59')]=function(_0x3ab8b9,_0x50f099,_0x2bc682){var _0x35a14f=null;var _0x3b83c2=null;var _0x45454f=null;var _0x1fce0a=null;var _0x5f39a3='';return db[_0x53a5('0x44')][_0x53a5('0x51')]({'where':{'id':_0x3ab8b9[_0x53a5('0x4c')]['id']},'attributes':['id',_0x53a5('0x2b'),_0x53a5('0x5a'),_0x53a5('0x5b'),_0x53a5('0x5c'),'remoteUri',_0x53a5('0x5d'),_0x53a5('0x5e')]})[_0x53a5('0x26')](handleEntityNotFound(_0x50f099,null))['then'](function(_0x34f039){if(_0x34f039){_0x35a14f=_0x34f039[_0x53a5('0x5a')];_0x3b83c2=_0x34f039['accessKey'];_0x45454f=_0x34f039[_0x53a5('0x5c')];_0x5f39a3=_0x34f039['remoteUri'];var _0x55569e=_0x5f39a3[_0x53a5('0x5f')](-0x1);if(_0x55569e==='/'){_0x5f39a3=_0x5f39a3['substring'](0x0,_0x5f39a3[_0x53a5('0x60')](_0x55569e));}_0x1fce0a=util[_0x53a5('0x61')]('%s/webservice.php',_0x5f39a3);var _0x2ebdda={'method':'GET','uri':_0x1fce0a,'qs':{'operation':_0x53a5('0x62'),'username':_0x34f039[_0x53a5('0x5a')]},'json':!![]};return rp(_0x2ebdda);}})[_0x53a5('0x26')](function(_0x58204c){if(_0x58204c[_0x53a5('0x63')]){var _0x273a49={'method':'POST','uri':_0x1fce0a,'form':{'operation':_0x53a5('0x64'),'username':_0x35a14f,'accessKey':md5(_0x58204c['result'][_0x53a5('0x65')]+_0x3b83c2)},'json':!![]};return rp(_0x273a49);}})['then'](function(_0x56b734){if(_0x56b734[_0x53a5('0x63')]){var _0x1c6e0b={'method':_0x53a5('0x66'),'uri':_0x1fce0a,'qs':{'operation':_0x53a5('0x67'),'username':_0x35a14f,'sessionName':_0x56b734[_0x53a5('0x68')][_0x53a5('0x69')],'elementType':_0x45454f},'json':!![]};return rp(_0x1c6e0b);}})['then'](function(_0x4a266e){if(_0x4a266e[_0x53a5('0x63')]){var _0xef11dd=[_0x53a5('0x6a'),_0x53a5('0x6b'),_0x53a5('0x6c')];_[_0x53a5('0x6d')](_0x4a266e[_0x53a5('0x68')][_0x53a5('0x37')],function(_0x2bb59c){return _0xef11dd[_0x53a5('0x6e')](_0x2bb59c[_0x53a5('0x41')]['name']);});_[_0x53a5('0x6d')](_0x4a266e[_0x53a5('0x68')][_0x53a5('0x37')],function(_0x4a5607){return _0x4a5607[_0x53a5('0x6f')]===_0x53a5('0x70');});return{'count':_0x4a266e[_0x53a5('0x68')]['fields'][_0x53a5('0x38')],'rows':_[_0x53a5('0x2e')](_0x4a266e[_0x53a5('0x68')]['fields'],function(_0x82a202){return{'id':_0x82a202[_0x53a5('0x2b')],'name':_0x82a202['label'],'custom':_['startsWith'](_0x82a202[_0x53a5('0x2b')],'cf_')?!![]:![],'options':_0x82a202[_0x53a5('0x41')][_0x53a5('0x2b')]===_0x53a5('0x71')&&_0x82a202[_0x53a5('0x41')][_0x53a5('0x72')][_0x53a5('0x38')]>0x0?_[_0x53a5('0x2e')](_0x82a202[_0x53a5('0x41')][_0x53a5('0x72')],function(_0x334c11){return{'name':_0x334c11[_0x53a5('0x73')],'value':_0x334c11['value']};}):[]};})};}})[_0x53a5('0x26')](respondWithResult(_0x50f099,null))[_0x53a5('0x47')](function(_0x31bbd4){console[_0x53a5('0x74')](_0x53a5('0x75')+_0x31bbd4);var _0x30aab=_0x3ab8b9[_0x53a5('0x33')][_0x53a5('0x76')]?0x1f4:_0x31bbd4[_0x53a5('0x77')]||0x1f4;logger[_0x53a5('0x29')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x30aab,JSON[_0x53a5('0x78')](_0x31bbd4));delete _0x31bbd4[_0x53a5('0x2b')];if(_0x30aab===0x191){_0x30aab=0x190;}_0x50f099[_0x53a5('0x1a')](_0x30aab)[_0x53a5('0x2c')](_0x3ab8b9[_0x53a5('0x33')][_0x53a5('0x76')]?{'message':_0x53a5('0x79'),'statusCode':_0x31bbd4['statusCode']}:_0x31bbd4);});}; \ No newline at end of file +var _0x1b65=['nolimit','order','sort','where','pick','filters','filter','merge','type','options','VtigerAccount','includeAll','findAll','rows','catch','params','keys','intersection','length','include','find','create','update','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','description','moduleName','remoteUri','serverUrl','accessKey','substring','%s/webservice.php','GET','getchallenge','username','POST','login','result','token','success','sessionName','autogenerated','owner','remove','includes','editable','false','label','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','key','map','query','model','fields','attributes','hasOwnProperty'];(function(_0x527605,_0x38aa5a){var _0x46ff7e=function(_0x23d8d0){while(--_0x23d8d0){_0x527605['push'](_0x527605['shift']());}};_0x46ff7e(++_0x38aa5a);}(_0x1b65,0x13c));var _0x51b6=function(_0x44feaf,_0x46068f){_0x44feaf=_0x44feaf-0x0;var _0x19ea54=_0x1b65[_0x44feaf];return _0x19ea54;};'use strict';var emlformat=require(_0x51b6('0x0'));var rimraf=require(_0x51b6('0x1'));var zipdir=require(_0x51b6('0x2'));var jsonpatch=require(_0x51b6('0x3'));var rp=require('request-promise');var moment=require(_0x51b6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x51b6('0x5'));var util=require(_0x51b6('0x6'));var path=require(_0x51b6('0x7'));var sox=require(_0x51b6('0x8'));var csv=require(_0x51b6('0x9'));var ejs=require(_0x51b6('0xa'));var fs=require('fs');var fs_extra=require(_0x51b6('0xb'));var _=require(_0x51b6('0xc'));var squel=require(_0x51b6('0xd'));var crypto=require(_0x51b6('0xe'));var jsforce=require(_0x51b6('0xf'));var deskjs=require(_0x51b6('0x10'));var toCsv=require(_0x51b6('0x9'));var querystring=require(_0x51b6('0x11'));var Papa=require('papaparse');var Redis=require(_0x51b6('0x12'));var authService=require(_0x51b6('0x13'));var qs=require(_0x51b6('0x14'));var as=require(_0x51b6('0x15'));var hardwareService=require(_0x51b6('0x16'));var logger=require(_0x51b6('0x17'))(_0x51b6('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x51b6('0x19'))['db'];var integrations=require(_0x51b6('0x1a'));function respondWithStatusCode(_0x287855,_0x371d3e){_0x371d3e=_0x371d3e||0xcc;return function(_0x132b4f){if(_0x132b4f){return _0x287855[_0x51b6('0x1b')](_0x371d3e);}return _0x287855[_0x51b6('0x1c')](_0x371d3e)['end']();};}function respondWithResult(_0x4fdb01,_0x27d602){_0x27d602=_0x27d602||0xc8;return function(_0x3c0b37){if(_0x3c0b37){return _0x4fdb01[_0x51b6('0x1c')](_0x27d602)[_0x51b6('0x1d')](_0x3c0b37);}};}function respondWithFilteredResult(_0x301e31,_0x3e090f){return function(_0x3a590c){if(_0x3a590c){var _0x1b575b=typeof _0x3e090f['offset']===_0x51b6('0x1e')&&typeof _0x3e090f[_0x51b6('0x1f')]===_0x51b6('0x1e');var _0x5ecacd=_0x3a590c[_0x51b6('0x20')];var _0x49a34b=_0x1b575b?0x0:_0x3e090f[_0x51b6('0x21')];var _0x5a1224=_0x1b575b?_0x3a590c['count']:_0x3e090f['offset']+_0x3e090f['limit'];var _0x41f942;if(_0x5a1224>=_0x5ecacd){_0x5a1224=_0x5ecacd;_0x41f942=0xc8;}else{_0x41f942=0xce;}_0x301e31['status'](_0x41f942);return _0x301e31[_0x51b6('0x22')](_0x51b6('0x23'),_0x49a34b+'-'+_0x5a1224+'/'+_0x5ecacd)[_0x51b6('0x1d')](_0x3a590c);}return null;};}function patchUpdates(_0x3d668f){return function(_0x501fe9){try{jsonpatch[_0x51b6('0x24')](_0x501fe9,_0x3d668f,!![]);}catch(_0x4e30d2){return BPromise[_0x51b6('0x25')](_0x4e30d2);}return _0x501fe9[_0x51b6('0x26')]();};}function saveUpdates(_0x24c52c,_0xa7f867){return function(_0x47fe02){if(_0x47fe02){return _0x47fe02['update'](_0x24c52c)[_0x51b6('0x27')](function(_0x190088){return _0x190088;});}return null;};}function removeEntity(_0xee1205,_0x37183a){return function(_0x195a51){if(_0x195a51){return _0x195a51[_0x51b6('0x28')]()['then'](function(){_0xee1205[_0x51b6('0x1c')](0xcc)[_0x51b6('0x29')]();});}};}function handleEntityNotFound(_0x1bb7af,_0x421358){return function(_0x57e22b){if(!_0x57e22b){_0x1bb7af['sendStatus'](0x194);}return _0x57e22b;};}function handleError(_0x3b1e6a,_0x4b5295){_0x4b5295=_0x4b5295||0x1f4;return function(_0x3db4e4){logger[_0x51b6('0x2a')](_0x3db4e4[_0x51b6('0x2b')]);if(_0x3db4e4[_0x51b6('0x2c')]){delete _0x3db4e4['name'];}_0x3b1e6a['status'](_0x4b5295)[_0x51b6('0x2d')](_0x3db4e4);};}exports[_0x51b6('0x2e')]=function(_0xc6eaa2,_0x42d0ff){var _0x4bbcc2={},_0x3b8c2b={},_0x52fd92={'count':0x0,'rows':[]};var _0x2515c2=_['map'](db['VtigerAccount'][_0x51b6('0x2f')],function(_0xb78509){return{'name':_0xb78509[_0x51b6('0x30')],'type':_0xb78509['type'][_0x51b6('0x31')]};});_0x3b8c2b['model']=_[_0x51b6('0x32')](_0x2515c2,'name');_0x3b8c2b[_0x51b6('0x33')]=_['keys'](_0xc6eaa2['query']);_0x3b8c2b['filters']=_['intersection'](_0x3b8c2b[_0x51b6('0x34')],_0x3b8c2b[_0x51b6('0x33')]);_0x4bbcc2['attributes']=_['intersection'](_0x3b8c2b['model'],qs[_0x51b6('0x35')](_0xc6eaa2['query']['fields']));_0x4bbcc2[_0x51b6('0x36')]=_0x4bbcc2[_0x51b6('0x36')]['length']?_0x4bbcc2['attributes']:_0x3b8c2b[_0x51b6('0x34')];if(!_0xc6eaa2[_0x51b6('0x33')][_0x51b6('0x37')](_0x51b6('0x38'))){_0x4bbcc2['limit']=qs[_0x51b6('0x1f')](_0xc6eaa2[_0x51b6('0x33')][_0x51b6('0x1f')]);_0x4bbcc2[_0x51b6('0x21')]=qs[_0x51b6('0x21')](_0xc6eaa2['query']['offset']);}_0x4bbcc2[_0x51b6('0x39')]=qs[_0x51b6('0x3a')](_0xc6eaa2['query'][_0x51b6('0x3a')]);_0x4bbcc2[_0x51b6('0x3b')]=qs['filters'](_[_0x51b6('0x3c')](_0xc6eaa2[_0x51b6('0x33')],_0x3b8c2b[_0x51b6('0x3d')]),_0x2515c2);if(_0xc6eaa2[_0x51b6('0x33')][_0x51b6('0x3e')]){_0x4bbcc2[_0x51b6('0x3b')]=_[_0x51b6('0x3f')](_0x4bbcc2[_0x51b6('0x3b')],{'$or':_[_0x51b6('0x32')](_0x2515c2,function(_0x482c33){if(_0x482c33[_0x51b6('0x40')]!=='VIRTUAL'){var _0x3f06ee={};_0x3f06ee[_0x482c33[_0x51b6('0x2c')]]={'$like':'%'+_0xc6eaa2[_0x51b6('0x33')][_0x51b6('0x3e')]+'%'};return _0x3f06ee;}})});}_0x4bbcc2=_[_0x51b6('0x3f')]({},_0x4bbcc2,_0xc6eaa2[_0x51b6('0x41')]);var _0x25c55={'where':_0x4bbcc2[_0x51b6('0x3b')]};return db[_0x51b6('0x42')][_0x51b6('0x20')](_0x25c55)['then'](function(_0x55cdbd){_0x52fd92['count']=_0x55cdbd;if(_0xc6eaa2['query'][_0x51b6('0x43')]){_0x4bbcc2['include']=[{'all':!![]}];}return db[_0x51b6('0x42')][_0x51b6('0x44')](_0x4bbcc2);})[_0x51b6('0x27')](function(_0x232b98){_0x52fd92[_0x51b6('0x45')]=_0x232b98;return _0x52fd92;})[_0x51b6('0x27')](respondWithFilteredResult(_0x42d0ff,_0x4bbcc2))[_0x51b6('0x46')](handleError(_0x42d0ff,null));};exports['show']=function(_0x1eddbf,_0x3169bf){var _0x5a7738={'raw':![],'where':{'id':_0x1eddbf[_0x51b6('0x47')]['id']}},_0x5bad00={};_0x5bad00['model']=_[_0x51b6('0x48')](db['VtigerAccount'][_0x51b6('0x2f')]);_0x5bad00[_0x51b6('0x33')]=_[_0x51b6('0x48')](_0x1eddbf['query']);_0x5bad00[_0x51b6('0x3d')]=_[_0x51b6('0x49')](_0x5bad00[_0x51b6('0x34')],_0x5bad00[_0x51b6('0x33')]);_0x5a7738[_0x51b6('0x36')]=_[_0x51b6('0x49')](_0x5bad00[_0x51b6('0x34')],qs[_0x51b6('0x35')](_0x1eddbf[_0x51b6('0x33')]['fields']));_0x5a7738[_0x51b6('0x36')]=_0x5a7738[_0x51b6('0x36')][_0x51b6('0x4a')]?_0x5a7738[_0x51b6('0x36')]:_0x5bad00[_0x51b6('0x34')];if(_0x1eddbf['query'][_0x51b6('0x43')]){_0x5a7738[_0x51b6('0x4b')]=[{'all':!![]}];}_0x5a7738=_[_0x51b6('0x3f')]({},_0x5a7738,_0x1eddbf[_0x51b6('0x41')]);return db['VtigerAccount'][_0x51b6('0x4c')](_0x5a7738)[_0x51b6('0x27')](handleEntityNotFound(_0x3169bf,null))[_0x51b6('0x27')](respondWithResult(_0x3169bf,null))[_0x51b6('0x46')](handleError(_0x3169bf,null));};exports[_0x51b6('0x4d')]=function(_0x4038c9,_0xbeca00){return db[_0x51b6('0x42')]['create'](_0x4038c9['body'],{})[_0x51b6('0x27')](respondWithResult(_0xbeca00,0xc9))[_0x51b6('0x46')](handleError(_0xbeca00,null));};exports[_0x51b6('0x4e')]=function(_0x10b20a,_0x9c3e45){if(_0x10b20a['body']['id']){delete _0x10b20a[_0x51b6('0x4f')]['id'];}return db[_0x51b6('0x42')][_0x51b6('0x4c')]({'where':{'id':_0x10b20a[_0x51b6('0x47')]['id']}})[_0x51b6('0x27')](handleEntityNotFound(_0x9c3e45,null))['then'](saveUpdates(_0x10b20a[_0x51b6('0x4f')],null))['then'](respondWithResult(_0x9c3e45,null))['catch'](handleError(_0x9c3e45,null));};exports['destroy']=function(_0x121008,_0x40ebec){return db[_0x51b6('0x42')]['find']({'where':{'id':_0x121008[_0x51b6('0x47')]['id']}})[_0x51b6('0x27')](handleEntityNotFound(_0x40ebec,null))['then'](removeEntity(_0x40ebec,null))[_0x51b6('0x46')](handleError(_0x40ebec,null));};exports[_0x51b6('0x50')]=function(_0x113b94,_0x32897b,_0x3815c7){var _0x4f6e38={};var _0x5e46cd={};var _0x97ee17;var _0x2c1071;return db['VtigerAccount'][_0x51b6('0x51')]({'where':{'id':_0x113b94[_0x51b6('0x47')]['id']}})[_0x51b6('0x27')](handleEntityNotFound(_0x32897b,null))[_0x51b6('0x27')](function(_0x3df672){if(_0x3df672){_0x97ee17=_0x3df672;_0x5e46cd['model']=_['keys'](db[_0x51b6('0x52')]['rawAttributes']);_0x5e46cd[_0x51b6('0x33')]=_[_0x51b6('0x48')](_0x113b94[_0x51b6('0x33')]);_0x5e46cd['filters']=_[_0x51b6('0x49')](_0x5e46cd[_0x51b6('0x34')],_0x5e46cd['query']);_0x4f6e38[_0x51b6('0x36')]=_[_0x51b6('0x49')](_0x5e46cd[_0x51b6('0x34')],qs[_0x51b6('0x35')](_0x113b94[_0x51b6('0x33')][_0x51b6('0x35')]));_0x4f6e38[_0x51b6('0x36')]=_0x4f6e38[_0x51b6('0x36')][_0x51b6('0x4a')]?_0x4f6e38['attributes']:_0x5e46cd[_0x51b6('0x34')];_0x4f6e38[_0x51b6('0x39')]=qs[_0x51b6('0x3a')](_0x113b94[_0x51b6('0x33')][_0x51b6('0x3a')]);_0x4f6e38['where']=qs[_0x51b6('0x3d')](_[_0x51b6('0x3c')](_0x113b94[_0x51b6('0x33')],_0x5e46cd['filters']));if(_0x113b94[_0x51b6('0x33')]['filter']){_0x4f6e38[_0x51b6('0x3b')]=_[_0x51b6('0x3f')](_0x4f6e38[_0x51b6('0x3b')],{'$or':_[_0x51b6('0x32')](_0x4f6e38[_0x51b6('0x36')],function(_0xf8fe2f){var _0x58d3d8={};_0x58d3d8[_0xf8fe2f]={'$like':'%'+_0x113b94[_0x51b6('0x33')][_0x51b6('0x3e')]+'%'};return _0x58d3d8;})});}_0x4f6e38=_[_0x51b6('0x3f')]({},_0x4f6e38,_0x113b94[_0x51b6('0x41')]);return _0x97ee17[_0x51b6('0x50')](_0x4f6e38);}})[_0x51b6('0x27')](function(_0x485117){if(_0x485117){_0x2c1071=_0x485117[_0x51b6('0x4a')];if(!_0x113b94[_0x51b6('0x33')][_0x51b6('0x37')]('nolimit')){_0x4f6e38[_0x51b6('0x1f')]=qs[_0x51b6('0x1f')](_0x113b94['query'][_0x51b6('0x1f')]);_0x4f6e38[_0x51b6('0x21')]=qs['offset'](_0x113b94[_0x51b6('0x33')][_0x51b6('0x21')]);}return _0x97ee17[_0x51b6('0x50')](_0x4f6e38);}})[_0x51b6('0x27')](function(_0x2ac972){if(_0x2ac972){return _0x2ac972?{'count':_0x2c1071,'rows':_0x2ac972}:null;}})[_0x51b6('0x27')](respondWithResult(_0x32897b,null))[_0x51b6('0x46')](handleError(_0x32897b,null));};exports[_0x51b6('0x53')]=function(_0x59f888,_0x362817,_0x3d0796){if(_0x59f888[_0x51b6('0x4f')]['id']){delete _0x59f888[_0x51b6('0x4f')]['id'];}return db[_0x51b6('0x42')][_0x51b6('0x51')]({'where':{'id':_0x59f888[_0x51b6('0x47')]['id']}})[_0x51b6('0x27')](handleEntityNotFound(_0x362817,null))['then'](function(_0x4e56c4){if(_0x4e56c4){_0x59f888[_0x51b6('0x4f')]['AccountId']=_0x4e56c4['id'];_0x59f888[_0x51b6('0x4f')][_0x51b6('0x54')]=integrations[_0x51b6('0x55')](_0x59f888[_0x51b6('0x4f')][_0x51b6('0x56')],_0x59f888[_0x51b6('0x4f')][_0x51b6('0x40')]);_0x59f888[_0x51b6('0x4f')][_0x51b6('0x57')]=integrations[_0x51b6('0x58')](_0x59f888[_0x51b6('0x4f')]['channel'],_0x59f888[_0x51b6('0x4f')][_0x51b6('0x40')]);return db['VtigerConfiguration'][_0x51b6('0x4d')](_0x59f888[_0x51b6('0x4f')],{'include':[{'model':db[_0x51b6('0x59')],'as':_0x51b6('0x54')},{'model':db[_0x51b6('0x59')],'as':_0x51b6('0x57')}]});}return null;})[_0x51b6('0x27')](respondWithResult(_0x362817,null))[_0x51b6('0x46')](handleError(_0x362817,null));};var md5=require(_0x51b6('0x5a'));exports[_0x51b6('0x5b')]=function(_0x5c28ba,_0x1f9fc5,_0x56b731){var _0x5df9e6=null;var _0x3c52cc=null;var _0x1ab81c=null;var _0xe7965f=null;var _0x115fd3='';return db['VtigerAccount'][_0x51b6('0x51')]({'where':{'id':_0x5c28ba['params']['id']},'attributes':['id',_0x51b6('0x2c'),'username',_0x51b6('0x5c'),_0x51b6('0x5d'),_0x51b6('0x5e'),_0x51b6('0x5f'),_0x51b6('0x60')]})[_0x51b6('0x27')](handleEntityNotFound(_0x1f9fc5,null))[_0x51b6('0x27')](function(_0xc896ee){if(_0xc896ee){_0x5df9e6=_0xc896ee['username'];_0x3c52cc=_0xc896ee[_0x51b6('0x60')];_0x1ab81c=_0xc896ee['moduleName'];_0x115fd3=_0xc896ee[_0x51b6('0x5e')];var _0x73fea4=_0x115fd3['slice'](-0x1);if(_0x73fea4==='/'){_0x115fd3=_0x115fd3[_0x51b6('0x61')](0x0,_0x115fd3['lastIndexOf'](_0x73fea4));}_0xe7965f=util['format'](_0x51b6('0x62'),_0x115fd3);var _0x4dd253={'method':_0x51b6('0x63'),'uri':_0xe7965f,'qs':{'operation':_0x51b6('0x64'),'username':_0xc896ee[_0x51b6('0x65')]},'json':!![]};return rp(_0x4dd253);}})['then'](function(_0x3d83a2){if(_0x3d83a2['success']){var _0x467fee={'method':_0x51b6('0x66'),'uri':_0xe7965f,'form':{'operation':_0x51b6('0x67'),'username':_0x5df9e6,'accessKey':md5(_0x3d83a2[_0x51b6('0x68')][_0x51b6('0x69')]+_0x3c52cc)},'json':!![]};return rp(_0x467fee);}})['then'](function(_0x58fb1b){if(_0x58fb1b[_0x51b6('0x6a')]){var _0x577302={'method':_0x51b6('0x63'),'uri':_0xe7965f,'qs':{'operation':'describe','username':_0x5df9e6,'sessionName':_0x58fb1b[_0x51b6('0x68')][_0x51b6('0x6b')],'elementType':_0x1ab81c},'json':!![]};return rp(_0x577302);}})['then'](function(_0x46c501){if(_0x46c501[_0x51b6('0x6a')]){var _0x5034e8=[_0x51b6('0x6c'),'reference',_0x51b6('0x6d')];_[_0x51b6('0x6e')](_0x46c501[_0x51b6('0x68')][_0x51b6('0x35')],function(_0x40741e){return _0x5034e8[_0x51b6('0x6f')](_0x40741e[_0x51b6('0x40')][_0x51b6('0x2c')]);});_[_0x51b6('0x6e')](_0x46c501['result'][_0x51b6('0x35')],function(_0x4b85f1){return _0x4b85f1[_0x51b6('0x70')]===_0x51b6('0x71');});return{'count':_0x46c501[_0x51b6('0x68')]['fields'][_0x51b6('0x4a')],'rows':_['map'](_0x46c501[_0x51b6('0x68')][_0x51b6('0x35')],function(_0x257199){return{'id':_0x257199[_0x51b6('0x2c')],'name':_0x257199[_0x51b6('0x72')],'custom':_['startsWith'](_0x257199[_0x51b6('0x2c')],_0x51b6('0x73'))?!![]:![],'options':_0x257199[_0x51b6('0x40')][_0x51b6('0x2c')]===_0x51b6('0x74')&&_0x257199[_0x51b6('0x40')][_0x51b6('0x75')][_0x51b6('0x4a')]>0x0?_[_0x51b6('0x32')](_0x257199[_0x51b6('0x40')][_0x51b6('0x75')],function(_0x497841){return{'name':_0x497841[_0x51b6('0x72')],'value':_0x497841['value']};}):[]};})};}})['then'](respondWithResult(_0x1f9fc5,null))['catch'](function(_0x22ca03){console[_0x51b6('0x76')](_0x51b6('0x77')+_0x22ca03);var _0xba58af=_0x5c28ba['query'][_0x51b6('0x78')]?0x1f4:_0x22ca03[_0x51b6('0x79')]||0x1f4;logger[_0x51b6('0x2a')](_0x51b6('0x7a'),_0x51b6('0x5b'),_0xba58af,JSON['stringify'](_0x22ca03));delete _0x22ca03[_0x51b6('0x2c')];if(_0xba58af===0x191){_0xba58af=0x190;}_0x1f9fc5['status'](_0xba58af)[_0x51b6('0x2d')](_0x5c28ba[_0x51b6('0x33')][_0x51b6('0x78')]?{'message':_0x51b6('0x7b'),'statusCode':_0x22ca03[_0x51b6('0x79')]}:_0x22ca03);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 0e8bff2..14143b9 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 _0x98e3=['exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98e3,0xc8));var _0x398e=function(_0x26b0e9,_0x24aed4){_0x26b0e9=_0x26b0e9-0x0;var _0x17294c=_0x98e3[_0x26b0e9];return _0x17294c;};'use strict';var _=require(_0x398e('0x0'));var util=require(_0x398e('0x1'));var logger=require(_0x398e('0x2'))(_0x398e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x398e('0x4'));var fs=require('fs');var path=require(_0x398e('0x5'));var rimraf=require(_0x398e('0x6'));var config=require(_0x398e('0x7'));var attributes=require(_0x398e('0x8'));var integrations=require(_0x398e('0x9'));module[_0x398e('0xa')]=function(_0x41995c,_0x4a9651){return _0x41995c[_0x398e('0xb')](_0x398e('0xc'),attributes,{'tableName':_0x398e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9eba=['./intVtigerAccount.attributes','VtigerAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9eba,0xb2));var _0xa9eb=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9eba[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xa9eb('0x0'));var util=require(_0xa9eb('0x1'));var logger=require(_0xa9eb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa9eb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9eb('0x4'));var rimraf=require(_0xa9eb('0x5'));var config=require('../../config/environment');var attributes=require(_0xa9eb('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xefb197,_0x3ad53c){return _0xefb197['define'](_0xa9eb('0x7'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index b167086..df996d7 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js +++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c7c=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','limit','include','map','model','attributes','ShowVtigerAccount','raw','lodash','util','moment','bluebird'];(function(_0x552fc5,_0x54972e){var _0x3ae584=function(_0x4fa784){while(--_0x4fa784){_0x552fc5['push'](_0x552fc5['shift']());}};_0x3ae584(++_0x54972e);}(_0x1c7c,0x164));var _0xc1c7=function(_0x6c546c,_0x2725e3){_0x6c546c=_0x6c546c-0x0;var _0x155a8b=_0x1c7c[_0x6c546c];return _0x155a8b;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var moment=require(_0xc1c7('0x2'));var BPromise=require(_0xc1c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1c7('0x5'));var logger=require(_0xc1c7('0x6'))(_0xc1c7('0x7'));var config=require(_0xc1c7('0x8'));var jayson=require(_0xc1c7('0x9'));var client=jayson[_0xc1c7('0xa')][_0xc1c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x419138,_0xce5bcd,_0x3b3e9c){return new BPromise(function(_0x434a35,_0x11c7ef){return client[_0xc1c7('0xc')](_0x419138,_0x3b3e9c)[_0xc1c7('0xd')](function(_0x339649){logger[_0xc1c7('0xe')](_0xc1c7('0xf'),_0xce5bcd,'request\x20sent');logger[_0xc1c7('0x10')](_0xc1c7('0x11'),_0xce5bcd,'request\x20sent',JSON[_0xc1c7('0x12')](_0x339649));if(_0x339649[_0xc1c7('0x13')]){if(_0x339649[_0xc1c7('0x13')]['code']===0x1f4){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x11c7ef(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x434a35(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}else{logger['info'](_0xc1c7('0xf'),_0xce5bcd,_0xc1c7('0x15'));_0x434a35(_0x339649[_0xc1c7('0x16')]['message']);}})[_0xc1c7('0x17')](function(_0x3939c1){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x3939c1);_0x11c7ef(_0x3939c1);});});}exports[_0xc1c7('0x18')]=function(_0xb42702){var _0x21758a=this;return new Promise(function(_0x2e93e5,_0x5d44e9){return db[_0xc1c7('0x19')][_0xc1c7('0x1a')]({'raw':_0xb42702[_0xc1c7('0x1b')]?_0xb42702[_0xc1c7('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xb42702[_0xc1c7('0x1b')]?_0xb42702['options'][_0xc1c7('0x1c')]||null:null,'attributes':_0xb42702[_0xc1c7('0x1b')]?_0xb42702['options']['attributes']||null:null,'limit':_0xb42702[_0xc1c7('0x1b')]?_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1d')]||null:null,'include':_0xb42702['options']?_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1e')],function(_0x3a2483){return{'model':db[_0x3a2483[_0xc1c7('0x20')]],'as':_0x3a2483['as'],'attributes':_0x3a2483[_0xc1c7('0x21')],'include':_0x3a2483[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x3a2483[_0xc1c7('0x1e')],function(_0x363fbc){return{'model':db[_0x363fbc[_0xc1c7('0x20')]],'as':_0x363fbc['as'],'attributes':_0x363fbc[_0xc1c7('0x21')],'include':_0x363fbc[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x363fbc['include'],function(_0xf0ab9c){return{'model':db[_0xf0ab9c[_0xc1c7('0x20')]],'as':_0xf0ab9c['as'],'attributes':_0xf0ab9c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x352f24){logger['info']('GetVtigerAccount',_0xb42702);logger[_0xc1c7('0x10')](_0xc1c7('0x18'),_0xb42702,JSON[_0xc1c7('0x12')](_0x352f24));_0x2e93e5(_0x352f24);})[_0xc1c7('0x17')](function(_0x461360){logger['error']('GetVtigerAccount',_0x461360[_0xc1c7('0x14')],_0xb42702);_0x5d44e9(_0x21758a[_0xc1c7('0x13')](0x1f4,_0x461360[_0xc1c7('0x14')]));});});};exports[_0xc1c7('0x22')]=function(_0x2e35f1){var _0x4968b0=this;return new Promise(function(_0x50042f,_0x125920){return db[_0xc1c7('0x19')]['find']({'raw':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x23')]===undefined?!![]:![]:!![],'where':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1c')]||null:null,'attributes':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1['options'][_0xc1c7('0x21')]||null:null,'include':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1e')],function(_0xef703f){return{'model':db[_0xef703f[_0xc1c7('0x20')]],'as':_0xef703f['as'],'attributes':_0xef703f['attributes'],'include':_0xef703f['include']?_[_0xc1c7('0x1f')](_0xef703f[_0xc1c7('0x1e')],function(_0x263900){return{'model':db[_0x263900[_0xc1c7('0x20')]],'as':_0x263900['as'],'attributes':_0x263900[_0xc1c7('0x21')],'include':_0x263900[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x263900[_0xc1c7('0x1e')],function(_0x3bd3b0){return{'model':db[_0x3bd3b0[_0xc1c7('0x20')]],'as':_0x3bd3b0['as'],'attributes':_0x3bd3b0[_0xc1c7('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc1c7('0xd')](function(_0x154476){logger[_0xc1c7('0xe')](_0xc1c7('0x22'),_0x2e35f1);logger[_0xc1c7('0x10')](_0xc1c7('0x22'),_0x2e35f1,JSON[_0xc1c7('0x12')](_0x154476));_0x50042f(_0x154476);})[_0xc1c7('0x17')](function(_0x239a91){logger[_0xc1c7('0x13')]('ShowVtigerAccount',_0x239a91['message'],_0x2e35f1);_0x125920(_0x4968b0['error'](0x1f4,_0x239a91[_0xc1c7('0x14')]));});});}; \ No newline at end of file +var _0x6b20=['../../config/environment','jayson/promise','client','http','request','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','map','attributes','include','model','then','debug','stringify','catch','ShowVtigerAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x6b20,0xd1));var _0x06b2=function(_0x1fb236,_0x6764f8){_0x1fb236=_0x1fb236-0x0;var _0x1ebb7b=_0x6b20[_0x1fb236];return _0x1ebb7b;};'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')]('VtigerAccount,\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')]({'raw':_0x594b48['options']?_0x594b48[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![],'where':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x19')]||null:null,'attributes':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')]['attributes']||null:null,'limit':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x1a')]||null:null,'include':_0x594b48[_0x06b2('0x17')]?_0x594b48['options']['include']?_[_0x06b2('0x1b')](_0x594b48[_0x06b2('0x17')]['include'],function(_0x39659f){return{'model':db[_0x39659f['model']],'as':_0x39659f['as'],'attributes':_0x39659f[_0x06b2('0x1c')],'include':_0x39659f[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x39659f['include'],function(_0x4382ce){return{'model':db[_0x4382ce[_0x06b2('0x1e')]],'as':_0x4382ce['as'],'attributes':_0x4382ce[_0x06b2('0x1c')],'include':_0x4382ce[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x4382ce['include'],function(_0xbb00ea){return{'model':db[_0xbb00ea[_0x06b2('0x1e')]],'as':_0xbb00ea['as'],'attributes':_0xbb00ea[_0x06b2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x1f')](function(_0x1976ac){logger[_0x06b2('0x12')]('GetVtigerAccount',_0x594b48);logger[_0x06b2('0x20')](_0x06b2('0x14'),_0x594b48,JSON[_0x06b2('0x21')](_0x1976ac));_0x192270(_0x1976ac);})[_0x06b2('0x22')](function(_0x1f02d8){logger[_0x06b2('0xf')](_0x06b2('0x14'),_0x1f02d8['message'],_0x594b48);_0x1b4ab0(_0x4c9cae[_0x06b2('0xf')](0x1f4,_0x1f02d8[_0x06b2('0x11')]));});});};exports[_0x06b2('0x23')]=function(_0x15a78b){var _0x1cc725=this;return new Promise(function(_0x37d391,_0x401551){return db[_0x06b2('0x15')]['find']({'raw':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![],'where':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x19')]||null:null,'attributes':_0x15a78b[_0x06b2('0x17')]?_0x15a78b['options']['attributes']||null:null,'include':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x1d')]?_['map'](_0x15a78b[_0x06b2('0x17')][_0x06b2('0x1d')],function(_0x37bfb5){return{'model':db[_0x37bfb5[_0x06b2('0x1e')]],'as':_0x37bfb5['as'],'attributes':_0x37bfb5[_0x06b2('0x1c')],'include':_0x37bfb5[_0x06b2('0x1d')]?_['map'](_0x37bfb5[_0x06b2('0x1d')],function(_0x1e66f1){return{'model':db[_0x1e66f1[_0x06b2('0x1e')]],'as':_0x1e66f1['as'],'attributes':_0x1e66f1['attributes'],'include':_0x1e66f1[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x1e66f1['include'],function(_0x45ea67){return{'model':db[_0x45ea67[_0x06b2('0x1e')]],'as':_0x45ea67['as'],'attributes':_0x45ea67[_0x06b2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x1f')](function(_0x2e49df){logger[_0x06b2('0x12')](_0x06b2('0x23'),_0x15a78b);logger[_0x06b2('0x20')](_0x06b2('0x23'),_0x15a78b,JSON[_0x06b2('0x21')](_0x2e49df));_0x37d391(_0x2e49df);})[_0x06b2('0x22')](function(_0x1cc7b6){logger['error'](_0x06b2('0x23'),_0x1cc7b6['message'],_0x15a78b);_0x401551(_0x1cc725['error'](0x1f4,_0x1cc7b6[_0x06b2('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 31e8190..144c79f 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 _0x85f3=['index','show','get','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','destroy','exports','util','path','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x85f3,0xcb));var _0x385f=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x85f3[_0x487b0c];return _0x1adbdc;};'use strict';var multer=require('multer');var util=require(_0x385f('0x0'));var path=require(_0x385f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x385f('0x2'));var auth=require(_0x385f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x385f('0x4'));var controller=require(_0x385f('0x5'));router['get']('/',auth[_0x385f('0x6')](),controller[_0x385f('0x7')]);router['get']('/:id',auth[_0x385f('0x6')](),controller[_0x385f('0x8')]);router[_0x385f('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x385f('0xa')]);router[_0x385f('0x9')](_0x385f('0xb'),auth['isAuthenticated'](),controller[_0x385f('0xc')]);router[_0x385f('0x9')](_0x385f('0xd'),auth[_0x385f('0x6')](),controller[_0x385f('0xe')]);router[_0x385f('0xf')]('/',auth[_0x385f('0x6')](),controller['create']);router[_0x385f('0x10')](_0x385f('0x11'),auth[_0x385f('0x6')](),controller[_0x385f('0x12')]);router['delete'](_0x385f('0x11'),auth['isAuthenticated'](),controller[_0x385f('0x13')]);module[_0x385f('0x14')]=router; \ No newline at end of file +var _0x7d7a=['/:id/fields','getFields','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x7d7a,0xe2));var _0xa7d7=function(_0x1e83e4,_0x392ed0){_0x1e83e4=_0x1e83e4-0x0;var _0x33c64b=_0x7d7a[_0x1e83e4];return _0x33c64b;};'use strict';var multer=require(_0xa7d7('0x0'));var util=require(_0xa7d7('0x1'));var path=require('path');var timeout=require(_0xa7d7('0x2'));var express=require(_0xa7d7('0x3'));var router=express[_0xa7d7('0x4')]();var fs_extra=require(_0xa7d7('0x5'));var auth=require(_0xa7d7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa7d7('0x7'));var controller=require(_0xa7d7('0x8'));router[_0xa7d7('0x9')]('/',auth[_0xa7d7('0xa')](),controller[_0xa7d7('0xb')]);router[_0xa7d7('0x9')](_0xa7d7('0xc'),auth[_0xa7d7('0xa')](),controller[_0xa7d7('0xd')]);router['get'](_0xa7d7('0xe'),auth[_0xa7d7('0xa')](),controller[_0xa7d7('0xf')]);router[_0xa7d7('0x9')]('/:id/subjects',auth[_0xa7d7('0xa')](),controller['getSubjects']);router[_0xa7d7('0x9')]('/:id/descriptions',auth[_0xa7d7('0xa')](),controller[_0xa7d7('0x10')]);router[_0xa7d7('0x11')]('/',auth[_0xa7d7('0xa')](),controller[_0xa7d7('0x12')]);router[_0xa7d7('0x13')](_0xa7d7('0xc'),auth[_0xa7d7('0xa')](),controller[_0xa7d7('0x14')]);router[_0xa7d7('0x15')]('/:id',auth[_0xa7d7('0xa')](),controller[_0xa7d7('0x16')]);module[_0xa7d7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 829e7ff..c1959e0 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 _0x436d=['STRING','exports'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x436d,0x1cb));var _0xd436=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x436d[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xd436('0x0')]={'name':{'type':Sequelize[_0xd436('0x1')]},'description':{'type':Sequelize[_0xd436('0x1')]}}; \ No newline at end of file +var _0x9028=['STRING','sequelize','exports'];(function(_0x2529a5,_0x30ecd3){var _0x2f4f59=function(_0x312d9a){while(--_0x312d9a){_0x2529a5['push'](_0x2529a5['shift']());}};_0x2f4f59(++_0x30ecd3);}(_0x9028,0x76));var _0x8902=function(_0x3f7e0b,_0x2aa770){_0x3f7e0b=_0x3f7e0b-0x0;var _0x1edf3a=_0x9028[_0x3f7e0b];return _0x1edf3a;};'use strict';var Sequelize=require(_0x8902('0x0'));module[_0x8902('0x1')]={'name':{'type':Sequelize[_0x8902('0x2')]},'description':{'type':Sequelize[_0x8902('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index fb621d7..0087b1a 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 _0x8f94=['desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filter','VIRTUAL','options','include','rows','includeAll','merge','find','catch','create','body','params','getFields','findOne','VtigerField','filters','order','pick','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0x8f94,0xd7));var _0x48f9=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x8f94[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x48f9('0x0'));var rimraf=require(_0x48f9('0x1'));var zipdir=require(_0x48f9('0x2'));var jsonpatch=require(_0x48f9('0x3'));var rp=require(_0x48f9('0x4'));var moment=require('moment');var BPromise=require(_0x48f9('0x5'));var Mustache=require(_0x48f9('0x6'));var util=require('util');var path=require(_0x48f9('0x7'));var sox=require('sox');var csv=require(_0x48f9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48f9('0x9'));var _=require(_0x48f9('0xa'));var squel=require('squel');var crypto=require(_0x48f9('0xb'));var jsforce=require(_0x48f9('0xc'));var deskjs=require(_0x48f9('0xd'));var toCsv=require(_0x48f9('0x8'));var querystring=require(_0x48f9('0xe'));var Papa=require('papaparse');var Redis=require(_0x48f9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x48f9('0x10'));var as=require(_0x48f9('0x11'));var hardwareService=require(_0x48f9('0x12'));var logger=require('../../config/logger')(_0x48f9('0x13'));var utils=require(_0x48f9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x48f9('0x15'));var db=require(_0x48f9('0x16'))['db'];function respondWithStatusCode(_0xe9eceb,_0x5249c3){_0x5249c3=_0x5249c3||0xcc;return function(_0x28d8e9){if(_0x28d8e9){return _0xe9eceb[_0x48f9('0x17')](_0x5249c3);}return _0xe9eceb['status'](_0x5249c3)[_0x48f9('0x18')]();};}function respondWithResult(_0x3c54b4,_0x38365f){_0x38365f=_0x38365f||0xc8;return function(_0x490574){if(_0x490574){return _0x3c54b4[_0x48f9('0x19')](_0x38365f)['json'](_0x490574);}};}function respondWithFilteredResult(_0x2838e1,_0x6a644d){return function(_0x2ee180){if(_0x2ee180){var _0x1b2ff8=typeof _0x6a644d[_0x48f9('0x1a')]===_0x48f9('0x1b')&&typeof _0x6a644d[_0x48f9('0x1c')]===_0x48f9('0x1b');var _0x1ef0b3=_0x2ee180['count'];var _0x57ba3e=_0x1b2ff8?0x0:_0x6a644d[_0x48f9('0x1a')];var _0x1854ca=_0x1b2ff8?_0x2ee180[_0x48f9('0x1d')]:_0x6a644d[_0x48f9('0x1a')]+_0x6a644d[_0x48f9('0x1c')];var _0x14f663;if(_0x1854ca>=_0x1ef0b3){_0x1854ca=_0x1ef0b3;_0x14f663=0xc8;}else{_0x14f663=0xce;}_0x2838e1[_0x48f9('0x19')](_0x14f663);return _0x2838e1[_0x48f9('0x1e')](_0x48f9('0x1f'),_0x57ba3e+'-'+_0x1854ca+'/'+_0x1ef0b3)['json'](_0x2ee180);}return null;};}function patchUpdates(_0x1fc14a){return function(_0x2591ec){try{jsonpatch['apply'](_0x2591ec,_0x1fc14a,!![]);}catch(_0x3ad38c){return BPromise[_0x48f9('0x20')](_0x3ad38c);}return _0x2591ec[_0x48f9('0x21')]();};}function saveUpdates(_0x4ac795,_0x143eea){return function(_0x14562b){if(_0x14562b){return _0x14562b[_0x48f9('0x22')](_0x4ac795)[_0x48f9('0x23')](function(_0x1f71b9){return _0x1f71b9;});}return null;};}function removeEntity(_0x472655,_0x202375){return function(_0x37b104){if(_0x37b104){return _0x37b104[_0x48f9('0x24')]()['then'](function(){_0x472655[_0x48f9('0x19')](0xcc)[_0x48f9('0x18')]();});}};}function handleEntityNotFound(_0x614329,_0x1ecaad){return function(_0x22b283){if(!_0x22b283){_0x614329[_0x48f9('0x17')](0x194);}return _0x22b283;};}function handleError(_0x199693,_0x1b8d33){_0x1b8d33=_0x1b8d33||0x1f4;return function(_0x75c557){logger[_0x48f9('0x25')](_0x75c557['stack']);if(_0x75c557['name']){delete _0x75c557[_0x48f9('0x26')];}_0x199693[_0x48f9('0x19')](_0x1b8d33)[_0x48f9('0x27')](_0x75c557);};}exports['index']=function(_0x25c510,_0x1efc5e){var _0x20ebc4={},_0x2f6d62={},_0x1f6e24={'count':0x0,'rows':[]};var _0x30d436=_[_0x48f9('0x28')](db[_0x48f9('0x29')][_0x48f9('0x2a')],function(_0x3ab05f){return{'name':_0x3ab05f[_0x48f9('0x2b')],'type':_0x3ab05f[_0x48f9('0x2c')]['key']};});_0x2f6d62[_0x48f9('0x2d')]=_[_0x48f9('0x28')](_0x30d436,_0x48f9('0x26'));_0x2f6d62['query']=_[_0x48f9('0x2e')](_0x25c510[_0x48f9('0x2f')]);_0x2f6d62['filters']=_[_0x48f9('0x30')](_0x2f6d62[_0x48f9('0x2d')],_0x2f6d62[_0x48f9('0x2f')]);_0x20ebc4[_0x48f9('0x31')]=_['intersection'](_0x2f6d62['model'],qs[_0x48f9('0x32')](_0x25c510[_0x48f9('0x2f')]['fields']));_0x20ebc4[_0x48f9('0x31')]=_0x20ebc4[_0x48f9('0x31')][_0x48f9('0x33')]?_0x20ebc4[_0x48f9('0x31')]:_0x2f6d62[_0x48f9('0x2d')];if(!_0x25c510['query']['hasOwnProperty'](_0x48f9('0x34'))){_0x20ebc4[_0x48f9('0x1c')]=qs[_0x48f9('0x1c')](_0x25c510[_0x48f9('0x2f')][_0x48f9('0x1c')]);_0x20ebc4[_0x48f9('0x1a')]=qs[_0x48f9('0x1a')](_0x25c510['query']['offset']);}_0x20ebc4['order']=qs[_0x48f9('0x35')](_0x25c510['query'][_0x48f9('0x35')]);_0x20ebc4[_0x48f9('0x36')]=qs['filters'](_['pick'](_0x25c510[_0x48f9('0x2f')],_0x2f6d62['filters']),_0x30d436);if(_0x25c510['query'][_0x48f9('0x37')]){_0x20ebc4['where']=_['merge'](_0x20ebc4[_0x48f9('0x36')],{'$or':_['map'](_0x30d436,function(_0x51d9f1){if(_0x51d9f1[_0x48f9('0x2c')]!==_0x48f9('0x38')){var _0x260a57={};_0x260a57[_0x51d9f1[_0x48f9('0x26')]]={'$like':'%'+_0x25c510[_0x48f9('0x2f')][_0x48f9('0x37')]+'%'};return _0x260a57;}})});}_0x20ebc4=_['merge']({},_0x20ebc4,_0x25c510[_0x48f9('0x39')]);var _0x14f883={'where':_0x20ebc4[_0x48f9('0x36')]};return db[_0x48f9('0x29')]['count'](_0x14f883)[_0x48f9('0x23')](function(_0x263145){_0x1f6e24[_0x48f9('0x1d')]=_0x263145;if(_0x25c510[_0x48f9('0x2f')]['includeAll']){_0x20ebc4[_0x48f9('0x3a')]=[{'all':!![]}];}return db[_0x48f9('0x29')]['findAll'](_0x20ebc4);})[_0x48f9('0x23')](function(_0x2a9497){_0x1f6e24[_0x48f9('0x3b')]=_0x2a9497;return _0x1f6e24;})[_0x48f9('0x23')](respondWithFilteredResult(_0x1efc5e,_0x20ebc4))['catch'](handleError(_0x1efc5e,null));};exports['show']=function(_0x361b8e,_0x4ee4af){var _0x5da42f={'raw':![],'where':{'id':_0x361b8e['params']['id']}},_0x3d3f10={};_0x3d3f10[_0x48f9('0x2d')]=_['keys'](db[_0x48f9('0x29')][_0x48f9('0x2a')]);_0x3d3f10[_0x48f9('0x2f')]=_[_0x48f9('0x2e')](_0x361b8e[_0x48f9('0x2f')]);_0x3d3f10['filters']=_[_0x48f9('0x30')](_0x3d3f10['model'],_0x3d3f10[_0x48f9('0x2f')]);_0x5da42f[_0x48f9('0x31')]=_[_0x48f9('0x30')](_0x3d3f10[_0x48f9('0x2d')],qs[_0x48f9('0x32')](_0x361b8e[_0x48f9('0x2f')][_0x48f9('0x32')]));_0x5da42f[_0x48f9('0x31')]=_0x5da42f['attributes'][_0x48f9('0x33')]?_0x5da42f[_0x48f9('0x31')]:_0x3d3f10[_0x48f9('0x2d')];if(_0x361b8e['query'][_0x48f9('0x3c')]){_0x5da42f[_0x48f9('0x3a')]=[{'all':!![]}];}_0x5da42f=_[_0x48f9('0x3d')]({},_0x5da42f,_0x361b8e[_0x48f9('0x39')]);return db['VtigerConfiguration'][_0x48f9('0x3e')](_0x5da42f)['then'](handleEntityNotFound(_0x4ee4af,null))[_0x48f9('0x23')](respondWithResult(_0x4ee4af,null))[_0x48f9('0x3f')](handleError(_0x4ee4af,null));};exports[_0x48f9('0x40')]=function(_0x5bb4f9,_0xedf61a){return db[_0x48f9('0x29')]['create'](_0x5bb4f9[_0x48f9('0x41')],{})['then'](respondWithResult(_0xedf61a,0xc9))[_0x48f9('0x3f')](handleError(_0xedf61a,null));};exports[_0x48f9('0x22')]=function(_0x22f3fd,_0x5897ba){if(_0x22f3fd[_0x48f9('0x41')]['id']){delete _0x22f3fd[_0x48f9('0x41')]['id'];}return db[_0x48f9('0x29')][_0x48f9('0x3e')]({'where':{'id':_0x22f3fd[_0x48f9('0x42')]['id']}})[_0x48f9('0x23')](handleEntityNotFound(_0x5897ba,null))[_0x48f9('0x23')](saveUpdates(_0x22f3fd['body'],null))[_0x48f9('0x23')](respondWithResult(_0x5897ba,null))[_0x48f9('0x3f')](handleError(_0x5897ba,null));};exports['destroy']=function(_0x4082e6,_0x5022c0){return db[_0x48f9('0x29')][_0x48f9('0x3e')]({'where':{'id':_0x4082e6[_0x48f9('0x42')]['id']}})[_0x48f9('0x23')](handleEntityNotFound(_0x5022c0,null))[_0x48f9('0x23')](removeEntity(_0x5022c0,null))[_0x48f9('0x3f')](handleError(_0x5022c0,null));};exports[_0x48f9('0x43')]=function(_0x3b5862,_0x45ec71,_0x5d345d){var _0x387e09={};var _0x3b64af={};var _0x271eaa;var _0x3b364a;return db[_0x48f9('0x29')][_0x48f9('0x44')]({'where':{'id':_0x3b5862[_0x48f9('0x42')]['id']}})[_0x48f9('0x23')](handleEntityNotFound(_0x45ec71,null))[_0x48f9('0x23')](function(_0x10553b){if(_0x10553b){_0x271eaa=_0x10553b;_0x3b64af[_0x48f9('0x2d')]=_[_0x48f9('0x2e')](db[_0x48f9('0x45')][_0x48f9('0x2a')]);_0x3b64af[_0x48f9('0x2f')]=_[_0x48f9('0x2e')](_0x3b5862[_0x48f9('0x2f')]);_0x3b64af[_0x48f9('0x46')]=_[_0x48f9('0x30')](_0x3b64af[_0x48f9('0x2d')],_0x3b64af[_0x48f9('0x2f')]);_0x387e09[_0x48f9('0x31')]=_['intersection'](_0x3b64af[_0x48f9('0x2d')],qs[_0x48f9('0x32')](_0x3b5862[_0x48f9('0x2f')][_0x48f9('0x32')]));_0x387e09['attributes']=_0x387e09['attributes'][_0x48f9('0x33')]?_0x387e09[_0x48f9('0x31')]:_0x3b64af[_0x48f9('0x2d')];_0x387e09[_0x48f9('0x47')]=qs[_0x48f9('0x35')](_0x3b5862[_0x48f9('0x2f')][_0x48f9('0x35')]);_0x387e09[_0x48f9('0x36')]=qs[_0x48f9('0x46')](_[_0x48f9('0x48')](_0x3b5862['query'],_0x3b64af[_0x48f9('0x46')]));if(_0x3b5862[_0x48f9('0x2f')]['filter']){_0x387e09[_0x48f9('0x36')]=_[_0x48f9('0x3d')](_0x387e09[_0x48f9('0x36')],{'$or':_[_0x48f9('0x28')](_0x387e09[_0x48f9('0x31')],function(_0x4e3c8f){var _0x274d5f={};_0x274d5f[_0x4e3c8f]={'$like':'%'+_0x3b5862[_0x48f9('0x2f')][_0x48f9('0x37')]+'%'};return _0x274d5f;})});}_0x387e09=_[_0x48f9('0x3d')]({},_0x387e09,_0x3b5862['options']);return _0x271eaa[_0x48f9('0x43')](_0x387e09);}})[_0x48f9('0x23')](function(_0x36d964){if(_0x36d964){_0x3b364a=_0x36d964[_0x48f9('0x33')];if(!_0x3b5862[_0x48f9('0x2f')]['hasOwnProperty'](_0x48f9('0x34'))){_0x387e09[_0x48f9('0x1c')]=qs[_0x48f9('0x1c')](_0x3b5862['query'][_0x48f9('0x1c')]);_0x387e09['offset']=qs[_0x48f9('0x1a')](_0x3b5862[_0x48f9('0x2f')][_0x48f9('0x1a')]);}return _0x271eaa[_0x48f9('0x43')](_0x387e09);}})['then'](function(_0xdf1e4){if(_0xdf1e4){return _0xdf1e4?{'count':_0x3b364a,'rows':_0xdf1e4}:null;}})[_0x48f9('0x23')](respondWithResult(_0x45ec71,null))['catch'](handleError(_0x45ec71,null));};exports[_0x48f9('0x49')]=function(_0x3b6fb5,_0x435c08,_0x3583c5){var _0xa287b7={};var _0x53d233={};var _0x463656;var _0x48a66b;return db[_0x48f9('0x29')][_0x48f9('0x44')]({'where':{'id':_0x3b6fb5['params']['id']}})[_0x48f9('0x23')](handleEntityNotFound(_0x435c08,null))[_0x48f9('0x23')](function(_0x58569c){if(_0x58569c){_0x463656=_0x58569c;_0x53d233['model']=_[_0x48f9('0x2e')](db['VtigerField']['rawAttributes']);_0x53d233['query']=_['keys'](_0x3b6fb5[_0x48f9('0x2f')]);_0x53d233[_0x48f9('0x46')]=_['intersection'](_0x53d233[_0x48f9('0x2d')],_0x53d233['query']);_0xa287b7[_0x48f9('0x31')]=_[_0x48f9('0x30')](_0x53d233['model'],qs[_0x48f9('0x32')](_0x3b6fb5['query'][_0x48f9('0x32')]));_0xa287b7['attributes']=_0xa287b7[_0x48f9('0x31')][_0x48f9('0x33')]?_0xa287b7[_0x48f9('0x31')]:_0x53d233[_0x48f9('0x2d')];_0xa287b7['order']=qs[_0x48f9('0x35')](_0x3b6fb5[_0x48f9('0x2f')][_0x48f9('0x35')]);_0xa287b7['where']=qs['filters'](_['pick'](_0x3b6fb5[_0x48f9('0x2f')],_0x53d233['filters']));if(_0x3b6fb5['query'][_0x48f9('0x37')]){_0xa287b7[_0x48f9('0x36')]=_[_0x48f9('0x3d')](_0xa287b7[_0x48f9('0x36')],{'$or':_[_0x48f9('0x28')](_0xa287b7['attributes'],function(_0x5e1278){var _0x478674={};_0x478674[_0x5e1278]={'$like':'%'+_0x3b6fb5[_0x48f9('0x2f')][_0x48f9('0x37')]+'%'};return _0x478674;})});}_0xa287b7=_['merge']({},_0xa287b7,_0x3b6fb5[_0x48f9('0x39')]);return _0x463656['getSubjects'](_0xa287b7);}})[_0x48f9('0x23')](function(_0x3d9b68){if(_0x3d9b68){_0x48a66b=_0x3d9b68[_0x48f9('0x33')];if(!_0x3b6fb5[_0x48f9('0x2f')][_0x48f9('0x4a')](_0x48f9('0x34'))){_0xa287b7['limit']=qs['limit'](_0x3b6fb5['query']['limit']);_0xa287b7['offset']=qs[_0x48f9('0x1a')](_0x3b6fb5[_0x48f9('0x2f')][_0x48f9('0x1a')]);}return _0x463656[_0x48f9('0x49')](_0xa287b7);}})['then'](function(_0x5b8252){if(_0x5b8252){return _0x5b8252?{'count':_0x48a66b,'rows':_0x5b8252}:null;}})[_0x48f9('0x23')](respondWithResult(_0x435c08,null))[_0x48f9('0x3f')](handleError(_0x435c08,null));};exports[_0x48f9('0x4b')]=function(_0x1347be,_0x1df5be,_0x536190){var _0x580ddf={};var _0x1707d1={};var _0x55e1cc;var _0xea29;return db['VtigerConfiguration'][_0x48f9('0x44')]({'where':{'id':_0x1347be[_0x48f9('0x42')]['id']}})[_0x48f9('0x23')](handleEntityNotFound(_0x1df5be,null))[_0x48f9('0x23')](function(_0x375d4d){if(_0x375d4d){_0x55e1cc=_0x375d4d;_0x1707d1['model']=_[_0x48f9('0x2e')](db[_0x48f9('0x45')][_0x48f9('0x2a')]);_0x1707d1[_0x48f9('0x2f')]=_[_0x48f9('0x2e')](_0x1347be['query']);_0x1707d1[_0x48f9('0x46')]=_['intersection'](_0x1707d1[_0x48f9('0x2d')],_0x1707d1[_0x48f9('0x2f')]);_0x580ddf['attributes']=_[_0x48f9('0x30')](_0x1707d1[_0x48f9('0x2d')],qs['fields'](_0x1347be[_0x48f9('0x2f')][_0x48f9('0x32')]));_0x580ddf[_0x48f9('0x31')]=_0x580ddf[_0x48f9('0x31')]['length']?_0x580ddf['attributes']:_0x1707d1['model'];_0x580ddf[_0x48f9('0x47')]=qs[_0x48f9('0x35')](_0x1347be[_0x48f9('0x2f')][_0x48f9('0x35')]);_0x580ddf[_0x48f9('0x36')]=qs['filters'](_['pick'](_0x1347be['query'],_0x1707d1['filters']));if(_0x1347be[_0x48f9('0x2f')][_0x48f9('0x37')]){_0x580ddf[_0x48f9('0x36')]=_[_0x48f9('0x3d')](_0x580ddf[_0x48f9('0x36')],{'$or':_['map'](_0x580ddf[_0x48f9('0x31')],function(_0x1dc39f){var _0x3d1aaa={};_0x3d1aaa[_0x1dc39f]={'$like':'%'+_0x1347be['query'][_0x48f9('0x37')]+'%'};return _0x3d1aaa;})});}_0x580ddf=_[_0x48f9('0x3d')]({},_0x580ddf,_0x1347be[_0x48f9('0x39')]);return _0x55e1cc[_0x48f9('0x4b')](_0x580ddf);}})['then'](function(_0x59ea75){if(_0x59ea75){_0xea29=_0x59ea75[_0x48f9('0x33')];if(!_0x1347be[_0x48f9('0x2f')]['hasOwnProperty'](_0x48f9('0x34'))){_0x580ddf[_0x48f9('0x1c')]=qs['limit'](_0x1347be[_0x48f9('0x2f')]['limit']);_0x580ddf[_0x48f9('0x1a')]=qs[_0x48f9('0x1a')](_0x1347be[_0x48f9('0x2f')]['offset']);}return _0x55e1cc[_0x48f9('0x4b')](_0x580ddf);}})[_0x48f9('0x23')](function(_0x174507){if(_0x174507){return _0x174507?{'count':_0xea29,'rows':_0x174507}:null;}})[_0x48f9('0x23')](respondWithResult(_0x1df5be,null))[_0x48f9('0x3f')](handleError(_0x1df5be,null));}; \ No newline at end of file +var _0x235a=['getSubjects','getDescriptions','VtigerField','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','order','options'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x235a,0x1ef));var _0xa235=function(_0x55e266,_0x40eded){_0x55e266=_0x55e266-0x0;var _0x1702d6=_0x235a[_0x55e266];return _0x1702d6;};'use strict';var emlformat=require(_0xa235('0x0'));var rimraf=require(_0xa235('0x1'));var zipdir=require(_0xa235('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa235('0x3'));var moment=require('moment');var BPromise=require(_0xa235('0x4'));var Mustache=require(_0xa235('0x5'));var util=require(_0xa235('0x6'));var path=require(_0xa235('0x7'));var sox=require(_0xa235('0x8'));var csv=require(_0xa235('0x9'));var ejs=require(_0xa235('0xa'));var fs=require('fs');var fs_extra=require(_0xa235('0xb'));var _=require('lodash');var squel=require(_0xa235('0xc'));var crypto=require(_0xa235('0xd'));var jsforce=require(_0xa235('0xe'));var deskjs=require(_0xa235('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa235('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa235('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa235('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa235('0x13'));var config=require(_0xa235('0x14'));var licenseUtil=require(_0xa235('0x15'));var db=require(_0xa235('0x16'))['db'];function respondWithStatusCode(_0x5330db,_0x5510ff){_0x5510ff=_0x5510ff||0xcc;return function(_0x47aad7){if(_0x47aad7){return _0x5330db[_0xa235('0x17')](_0x5510ff);}return _0x5330db[_0xa235('0x18')](_0x5510ff)[_0xa235('0x19')]();};}function respondWithResult(_0x3bf6fc,_0x36b4b1){_0x36b4b1=_0x36b4b1||0xc8;return function(_0x44ea6a){if(_0x44ea6a){return _0x3bf6fc[_0xa235('0x18')](_0x36b4b1)[_0xa235('0x1a')](_0x44ea6a);}};}function respondWithFilteredResult(_0x1369de,_0x4aceee){return function(_0x352463){if(_0x352463){var _0x20cd67=typeof _0x4aceee[_0xa235('0x1b')]===_0xa235('0x1c')&&typeof _0x4aceee[_0xa235('0x1d')]===_0xa235('0x1c');var _0x5c6e95=_0x352463['count'];var _0x446ea2=_0x20cd67?0x0:_0x4aceee[_0xa235('0x1b')];var _0x2b3769=_0x20cd67?_0x352463['count']:_0x4aceee[_0xa235('0x1b')]+_0x4aceee[_0xa235('0x1d')];var _0x3ca514;if(_0x2b3769>=_0x5c6e95){_0x2b3769=_0x5c6e95;_0x3ca514=0xc8;}else{_0x3ca514=0xce;}_0x1369de[_0xa235('0x18')](_0x3ca514);return _0x1369de[_0xa235('0x1e')](_0xa235('0x1f'),_0x446ea2+'-'+_0x2b3769+'/'+_0x5c6e95)[_0xa235('0x1a')](_0x352463);}return null;};}function patchUpdates(_0x483771){return function(_0x5a3bea){try{jsonpatch[_0xa235('0x20')](_0x5a3bea,_0x483771,!![]);}catch(_0x21940f){return BPromise[_0xa235('0x21')](_0x21940f);}return _0x5a3bea[_0xa235('0x22')]();};}function saveUpdates(_0x2e38e,_0x3deeea){return function(_0x3d9f70){if(_0x3d9f70){return _0x3d9f70[_0xa235('0x23')](_0x2e38e)[_0xa235('0x24')](function(_0x216083){return _0x216083;});}return null;};}function removeEntity(_0x3219f1,_0x20292c){return function(_0xee45e1){if(_0xee45e1){return _0xee45e1[_0xa235('0x25')]()[_0xa235('0x24')](function(){_0x3219f1[_0xa235('0x18')](0xcc)[_0xa235('0x19')]();});}};}function handleEntityNotFound(_0x13c868,_0x976c9f){return function(_0x1cb892){if(!_0x1cb892){_0x13c868[_0xa235('0x17')](0x194);}return _0x1cb892;};}function handleError(_0x57f591,_0xe1176c){_0xe1176c=_0xe1176c||0x1f4;return function(_0x533b15){logger[_0xa235('0x26')](_0x533b15['stack']);if(_0x533b15[_0xa235('0x27')]){delete _0x533b15[_0xa235('0x27')];}_0x57f591[_0xa235('0x18')](_0xe1176c)[_0xa235('0x28')](_0x533b15);};}exports[_0xa235('0x29')]=function(_0x5d811a,_0x2585c7){var _0x612f2={},_0x55a21e={},_0x4b33ef={'count':0x0,'rows':[]};var _0x502df9=_['map'](db[_0xa235('0x2a')][_0xa235('0x2b')],function(_0x2d8073){return{'name':_0x2d8073[_0xa235('0x2c')],'type':_0x2d8073[_0xa235('0x2d')][_0xa235('0x2e')]};});_0x55a21e[_0xa235('0x2f')]=_['map'](_0x502df9,'name');_0x55a21e[_0xa235('0x30')]=_[_0xa235('0x31')](_0x5d811a['query']);_0x55a21e[_0xa235('0x32')]=_[_0xa235('0x33')](_0x55a21e[_0xa235('0x2f')],_0x55a21e[_0xa235('0x30')]);_0x612f2[_0xa235('0x34')]=_[_0xa235('0x33')](_0x55a21e[_0xa235('0x2f')],qs[_0xa235('0x35')](_0x5d811a['query'][_0xa235('0x35')]));_0x612f2['attributes']=_0x612f2[_0xa235('0x34')][_0xa235('0x36')]?_0x612f2[_0xa235('0x34')]:_0x55a21e[_0xa235('0x2f')];if(!_0x5d811a[_0xa235('0x30')][_0xa235('0x37')](_0xa235('0x38'))){_0x612f2[_0xa235('0x1d')]=qs[_0xa235('0x1d')](_0x5d811a[_0xa235('0x30')][_0xa235('0x1d')]);_0x612f2[_0xa235('0x1b')]=qs[_0xa235('0x1b')](_0x5d811a['query']['offset']);}_0x612f2['order']=qs[_0xa235('0x39')](_0x5d811a['query'][_0xa235('0x39')]);_0x612f2[_0xa235('0x3a')]=qs[_0xa235('0x32')](_[_0xa235('0x3b')](_0x5d811a[_0xa235('0x30')],_0x55a21e[_0xa235('0x32')]),_0x502df9);if(_0x5d811a[_0xa235('0x30')]['filter']){_0x612f2[_0xa235('0x3a')]=_[_0xa235('0x3c')](_0x612f2['where'],{'$or':_[_0xa235('0x3d')](_0x502df9,function(_0x3fa927){if(_0x3fa927[_0xa235('0x2d')]!==_0xa235('0x3e')){var _0x45cc55={};_0x45cc55[_0x3fa927[_0xa235('0x27')]]={'$like':'%'+_0x5d811a[_0xa235('0x30')][_0xa235('0x3f')]+'%'};return _0x45cc55;}})});}_0x612f2=_[_0xa235('0x3c')]({},_0x612f2,_0x5d811a['options']);var _0x28c259={'where':_0x612f2[_0xa235('0x3a')]};return db[_0xa235('0x2a')][_0xa235('0x40')](_0x28c259)[_0xa235('0x24')](function(_0x542755){_0x4b33ef[_0xa235('0x40')]=_0x542755;if(_0x5d811a[_0xa235('0x30')][_0xa235('0x41')]){_0x612f2[_0xa235('0x42')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xa235('0x43')](_0x612f2);})[_0xa235('0x24')](function(_0x47801f){_0x4b33ef[_0xa235('0x44')]=_0x47801f;return _0x4b33ef;})[_0xa235('0x24')](respondWithFilteredResult(_0x2585c7,_0x612f2))[_0xa235('0x45')](handleError(_0x2585c7,null));};exports[_0xa235('0x46')]=function(_0x5c203c,_0x333ed8){var _0x4748d8={'raw':![],'where':{'id':_0x5c203c[_0xa235('0x47')]['id']}},_0x1e90a9={};_0x1e90a9[_0xa235('0x2f')]=_['keys'](db[_0xa235('0x2a')][_0xa235('0x2b')]);_0x1e90a9[_0xa235('0x30')]=_[_0xa235('0x31')](_0x5c203c[_0xa235('0x30')]);_0x1e90a9['filters']=_[_0xa235('0x33')](_0x1e90a9[_0xa235('0x2f')],_0x1e90a9[_0xa235('0x30')]);_0x4748d8[_0xa235('0x34')]=_[_0xa235('0x33')](_0x1e90a9[_0xa235('0x2f')],qs[_0xa235('0x35')](_0x5c203c[_0xa235('0x30')]['fields']));_0x4748d8[_0xa235('0x34')]=_0x4748d8[_0xa235('0x34')][_0xa235('0x36')]?_0x4748d8[_0xa235('0x34')]:_0x1e90a9[_0xa235('0x2f')];if(_0x5c203c[_0xa235('0x30')][_0xa235('0x41')]){_0x4748d8[_0xa235('0x42')]=[{'all':!![]}];}_0x4748d8=_[_0xa235('0x3c')]({},_0x4748d8,_0x5c203c['options']);return db[_0xa235('0x2a')][_0xa235('0x48')](_0x4748d8)[_0xa235('0x24')](handleEntityNotFound(_0x333ed8,null))[_0xa235('0x24')](respondWithResult(_0x333ed8,null))[_0xa235('0x45')](handleError(_0x333ed8,null));};exports['create']=function(_0x22f11c,_0x11b5e7){return db['VtigerConfiguration'][_0xa235('0x49')](_0x22f11c[_0xa235('0x4a')],{})[_0xa235('0x24')](respondWithResult(_0x11b5e7,0xc9))[_0xa235('0x45')](handleError(_0x11b5e7,null));};exports['update']=function(_0x16d9e8,_0x4909e9){if(_0x16d9e8[_0xa235('0x4a')]['id']){delete _0x16d9e8[_0xa235('0x4a')]['id'];}return db['VtigerConfiguration'][_0xa235('0x48')]({'where':{'id':_0x16d9e8[_0xa235('0x47')]['id']}})[_0xa235('0x24')](handleEntityNotFound(_0x4909e9,null))[_0xa235('0x24')](saveUpdates(_0x16d9e8[_0xa235('0x4a')],null))[_0xa235('0x24')](respondWithResult(_0x4909e9,null))[_0xa235('0x45')](handleError(_0x4909e9,null));};exports[_0xa235('0x25')]=function(_0x5ab614,_0x5033dc){return db['VtigerConfiguration'][_0xa235('0x48')]({'where':{'id':_0x5ab614[_0xa235('0x47')]['id']}})[_0xa235('0x24')](handleEntityNotFound(_0x5033dc,null))[_0xa235('0x24')](removeEntity(_0x5033dc,null))['catch'](handleError(_0x5033dc,null));};exports[_0xa235('0x4b')]=function(_0x5e4a80,_0x1d9ce8,_0x419092){var _0x4571fb={};var _0x1c9f2b={};var _0x54edb0;var _0x5041f5;return db['VtigerConfiguration'][_0xa235('0x4c')]({'where':{'id':_0x5e4a80[_0xa235('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d9ce8,null))[_0xa235('0x24')](function(_0xba2cd0){if(_0xba2cd0){_0x54edb0=_0xba2cd0;_0x1c9f2b[_0xa235('0x2f')]=_[_0xa235('0x31')](db['VtigerField']['rawAttributes']);_0x1c9f2b['query']=_[_0xa235('0x31')](_0x5e4a80[_0xa235('0x30')]);_0x1c9f2b['filters']=_['intersection'](_0x1c9f2b[_0xa235('0x2f')],_0x1c9f2b['query']);_0x4571fb['attributes']=_[_0xa235('0x33')](_0x1c9f2b[_0xa235('0x2f')],qs[_0xa235('0x35')](_0x5e4a80[_0xa235('0x30')]['fields']));_0x4571fb[_0xa235('0x34')]=_0x4571fb[_0xa235('0x34')][_0xa235('0x36')]?_0x4571fb[_0xa235('0x34')]:_0x1c9f2b[_0xa235('0x2f')];_0x4571fb[_0xa235('0x4d')]=qs[_0xa235('0x39')](_0x5e4a80[_0xa235('0x30')][_0xa235('0x39')]);_0x4571fb[_0xa235('0x3a')]=qs['filters'](_[_0xa235('0x3b')](_0x5e4a80[_0xa235('0x30')],_0x1c9f2b[_0xa235('0x32')]));if(_0x5e4a80[_0xa235('0x30')][_0xa235('0x3f')]){_0x4571fb['where']=_[_0xa235('0x3c')](_0x4571fb[_0xa235('0x3a')],{'$or':_['map'](_0x4571fb[_0xa235('0x34')],function(_0xe80ed0){var _0x479861={};_0x479861[_0xe80ed0]={'$like':'%'+_0x5e4a80['query']['filter']+'%'};return _0x479861;})});}_0x4571fb=_[_0xa235('0x3c')]({},_0x4571fb,_0x5e4a80[_0xa235('0x4e')]);return _0x54edb0['getFields'](_0x4571fb);}})[_0xa235('0x24')](function(_0x4e1d6a){if(_0x4e1d6a){_0x5041f5=_0x4e1d6a['length'];if(!_0x5e4a80[_0xa235('0x30')]['hasOwnProperty'](_0xa235('0x38'))){_0x4571fb[_0xa235('0x1d')]=qs[_0xa235('0x1d')](_0x5e4a80[_0xa235('0x30')][_0xa235('0x1d')]);_0x4571fb[_0xa235('0x1b')]=qs[_0xa235('0x1b')](_0x5e4a80[_0xa235('0x30')][_0xa235('0x1b')]);}return _0x54edb0[_0xa235('0x4b')](_0x4571fb);}})[_0xa235('0x24')](function(_0x17cb61){if(_0x17cb61){return _0x17cb61?{'count':_0x5041f5,'rows':_0x17cb61}:null;}})[_0xa235('0x24')](respondWithResult(_0x1d9ce8,null))[_0xa235('0x45')](handleError(_0x1d9ce8,null));};exports[_0xa235('0x4f')]=function(_0xcec82,_0x4576c8,_0x5dbc35){var _0xbd740e={};var _0xe9cc76={};var _0x8ead7;var _0x5c0c12;return db['VtigerConfiguration'][_0xa235('0x4c')]({'where':{'id':_0xcec82[_0xa235('0x47')]['id']}})[_0xa235('0x24')](handleEntityNotFound(_0x4576c8,null))['then'](function(_0xf68018){if(_0xf68018){_0x8ead7=_0xf68018;_0xe9cc76['model']=_[_0xa235('0x31')](db['VtigerField']['rawAttributes']);_0xe9cc76[_0xa235('0x30')]=_['keys'](_0xcec82['query']);_0xe9cc76['filters']=_['intersection'](_0xe9cc76['model'],_0xe9cc76[_0xa235('0x30')]);_0xbd740e[_0xa235('0x34')]=_[_0xa235('0x33')](_0xe9cc76['model'],qs[_0xa235('0x35')](_0xcec82[_0xa235('0x30')][_0xa235('0x35')]));_0xbd740e[_0xa235('0x34')]=_0xbd740e[_0xa235('0x34')]['length']?_0xbd740e[_0xa235('0x34')]:_0xe9cc76[_0xa235('0x2f')];_0xbd740e[_0xa235('0x4d')]=qs[_0xa235('0x39')](_0xcec82[_0xa235('0x30')][_0xa235('0x39')]);_0xbd740e[_0xa235('0x3a')]=qs['filters'](_['pick'](_0xcec82[_0xa235('0x30')],_0xe9cc76[_0xa235('0x32')]));if(_0xcec82[_0xa235('0x30')]['filter']){_0xbd740e[_0xa235('0x3a')]=_['merge'](_0xbd740e[_0xa235('0x3a')],{'$or':_[_0xa235('0x3d')](_0xbd740e['attributes'],function(_0x21cfac){var _0x450ade={};_0x450ade[_0x21cfac]={'$like':'%'+_0xcec82[_0xa235('0x30')][_0xa235('0x3f')]+'%'};return _0x450ade;})});}_0xbd740e=_[_0xa235('0x3c')]({},_0xbd740e,_0xcec82[_0xa235('0x4e')]);return _0x8ead7['getSubjects'](_0xbd740e);}})[_0xa235('0x24')](function(_0x35b07b){if(_0x35b07b){_0x5c0c12=_0x35b07b[_0xa235('0x36')];if(!_0xcec82[_0xa235('0x30')][_0xa235('0x37')]('nolimit')){_0xbd740e[_0xa235('0x1d')]=qs[_0xa235('0x1d')](_0xcec82[_0xa235('0x30')][_0xa235('0x1d')]);_0xbd740e[_0xa235('0x1b')]=qs['offset'](_0xcec82[_0xa235('0x30')][_0xa235('0x1b')]);}return _0x8ead7[_0xa235('0x4f')](_0xbd740e);}})[_0xa235('0x24')](function(_0x3620bb){if(_0x3620bb){return _0x3620bb?{'count':_0x5c0c12,'rows':_0x3620bb}:null;}})[_0xa235('0x24')](respondWithResult(_0x4576c8,null))['catch'](handleError(_0x4576c8,null));};exports[_0xa235('0x50')]=function(_0x1e3c0f,_0x4b7b04,_0x15ff8a){var _0x4f3b5b={};var _0x1bd86e={};var _0x33ad4b;var _0x5603e8;return db[_0xa235('0x2a')]['findOne']({'where':{'id':_0x1e3c0f['params']['id']}})[_0xa235('0x24')](handleEntityNotFound(_0x4b7b04,null))[_0xa235('0x24')](function(_0x415029){if(_0x415029){_0x33ad4b=_0x415029;_0x1bd86e[_0xa235('0x2f')]=_[_0xa235('0x31')](db[_0xa235('0x51')][_0xa235('0x2b')]);_0x1bd86e[_0xa235('0x30')]=_[_0xa235('0x31')](_0x1e3c0f['query']);_0x1bd86e[_0xa235('0x32')]=_['intersection'](_0x1bd86e[_0xa235('0x2f')],_0x1bd86e[_0xa235('0x30')]);_0x4f3b5b[_0xa235('0x34')]=_['intersection'](_0x1bd86e[_0xa235('0x2f')],qs[_0xa235('0x35')](_0x1e3c0f[_0xa235('0x30')][_0xa235('0x35')]));_0x4f3b5b['attributes']=_0x4f3b5b['attributes'][_0xa235('0x36')]?_0x4f3b5b['attributes']:_0x1bd86e[_0xa235('0x2f')];_0x4f3b5b[_0xa235('0x4d')]=qs[_0xa235('0x39')](_0x1e3c0f['query'][_0xa235('0x39')]);_0x4f3b5b[_0xa235('0x3a')]=qs[_0xa235('0x32')](_[_0xa235('0x3b')](_0x1e3c0f[_0xa235('0x30')],_0x1bd86e[_0xa235('0x32')]));if(_0x1e3c0f['query'][_0xa235('0x3f')]){_0x4f3b5b[_0xa235('0x3a')]=_[_0xa235('0x3c')](_0x4f3b5b[_0xa235('0x3a')],{'$or':_[_0xa235('0x3d')](_0x4f3b5b[_0xa235('0x34')],function(_0x1a702a){var _0x14a129={};_0x14a129[_0x1a702a]={'$like':'%'+_0x1e3c0f['query']['filter']+'%'};return _0x14a129;})});}_0x4f3b5b=_[_0xa235('0x3c')]({},_0x4f3b5b,_0x1e3c0f[_0xa235('0x4e')]);return _0x33ad4b[_0xa235('0x50')](_0x4f3b5b);}})[_0xa235('0x24')](function(_0x4cecb9){if(_0x4cecb9){_0x5603e8=_0x4cecb9[_0xa235('0x36')];if(!_0x1e3c0f[_0xa235('0x30')][_0xa235('0x37')](_0xa235('0x38'))){_0x4f3b5b['limit']=qs[_0xa235('0x1d')](_0x1e3c0f[_0xa235('0x30')][_0xa235('0x1d')]);_0x4f3b5b[_0xa235('0x1b')]=qs[_0xa235('0x1b')](_0x1e3c0f[_0xa235('0x30')][_0xa235('0x1b')]);}return _0x33ad4b[_0xa235('0x50')](_0x4f3b5b);}})[_0xa235('0x24')](function(_0x4d1e2a){if(_0x4d1e2a){return _0x4d1e2a?{'count':_0x5603e8,'rows':_0x4d1e2a}:null;}})[_0xa235('0x24')](respondWithResult(_0x4b7b04,null))['catch'](handleError(_0x4b7b04,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 390b825..a63923f 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 _0xe985=['bluebird','request-promise','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x4bbe38,_0x3f1c79){var _0x2880a8=function(_0x152729){while(--_0x152729){_0x4bbe38['push'](_0x4bbe38['shift']());}};_0x2880a8(++_0x3f1c79);}(_0xe985,0x13f));var _0x5e98=function(_0x3f994d,_0x249d72){_0x3f994d=_0x3f994d-0x0;var _0x5309b4=_0xe985[_0x3f994d];return _0x5309b4;};'use strict';var _=require(_0x5e98('0x0'));var util=require(_0x5e98('0x1'));var logger=require(_0x5e98('0x2'))(_0x5e98('0x3'));var moment=require(_0x5e98('0x4'));var BPromise=require(_0x5e98('0x5'));var rp=require(_0x5e98('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e98('0x7'));var attributes=require(_0x5e98('0x8'));module[_0x5e98('0x9')]=function(_0xfa3a12,_0x332821){return _0xfa3a12[_0x5e98('0xa')](_0x5e98('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d2b=['../../config/logger','api','request-promise','path','../../config/environment','exports','VtigerConfiguration','int_vtiger_configurations','lodash','util'];(function(_0x57efaa,_0x1d0a41){var _0x3c7ecb=function(_0x103ad4){while(--_0x103ad4){_0x57efaa['push'](_0x57efaa['shift']());}};_0x3c7ecb(++_0x1d0a41);}(_0x8d2b,0x1d4));var _0xb8d2=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x8d2b[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0xb8d2('0x0'));var util=require(_0xb8d2('0x1'));var logger=require(_0xb8d2('0x2'))(_0xb8d2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb8d2('0x4'));var fs=require('fs');var path=require(_0xb8d2('0x5'));var rimraf=require('rimraf');var config=require(_0xb8d2('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xb8d2('0x7')]=function(_0xc0f6a9,_0x1ee62c){return _0xc0f6a9['define'](_0xb8d2('0x8'),attributes,{'tableName':_0xb8d2('0x9'),'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 8a3587a..d6279cb 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 _0x2277=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash'];(function(_0x5192d2,_0x3519f3){var _0x22b581=function(_0x3f815d){while(--_0x3f815d){_0x5192d2['push'](_0x5192d2['shift']());}};_0x22b581(++_0x3519f3);}(_0x2277,0x11c));var _0x7227=function(_0x5b7230,_0x1c7124){_0x5b7230=_0x5b7230-0x0;var _0x32dd0f=_0x2277[_0x5b7230];return _0x32dd0f;};'use strict';var _=require(_0x7227('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7227('0x1'));var rs=require(_0x7227('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7227('0x3'))['db'];var utils=require(_0x7227('0x4'));var logger=require(_0x7227('0x5'))(_0x7227('0x6'));var config=require(_0x7227('0x7'));var jayson=require(_0x7227('0x8'));var client=jayson[_0x7227('0x9')][_0x7227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54e444,_0x23662c,_0x444dc9){return new BPromise(function(_0x18acbd,_0x29e60f){return client['request'](_0x54e444,_0x444dc9)['then'](function(_0x2696ee){logger[_0x7227('0xb')](_0x7227('0xc'),_0x23662c,_0x7227('0xd'));logger[_0x7227('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x23662c,_0x7227('0xd'),JSON['stringify'](_0x2696ee));if(_0x2696ee[_0x7227('0xf')]){if(_0x2696ee[_0x7227('0xf')][_0x7227('0x10')]===0x1f4){logger['error'](_0x7227('0xc'),_0x23662c,_0x2696ee['error'][_0x7227('0x11')]);return _0x29e60f(_0x2696ee['error'][_0x7227('0x11')]);}logger[_0x7227('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x23662c,_0x2696ee['error']['message']);return _0x18acbd(_0x2696ee[_0x7227('0xf')][_0x7227('0x11')]);}else{logger[_0x7227('0xb')](_0x7227('0xc'),_0x23662c,_0x7227('0xd'));_0x18acbd(_0x2696ee[_0x7227('0x12')][_0x7227('0x11')]);}})['catch'](function(_0x5188fe){logger[_0x7227('0xf')](_0x7227('0xc'),_0x23662c,_0x5188fe);_0x29e60f(_0x5188fe);});});} \ No newline at end of file +var _0xaf2b=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xfcd9a1,_0x58bd96){var _0x2aa0b2=function(_0x48aa8a){while(--_0x48aa8a){_0xfcd9a1['push'](_0xfcd9a1['shift']());}};_0x2aa0b2(++_0x58bd96);}(_0xaf2b,0xb0));var _0xbaf2=function(_0x52b754,_0x12c404){_0x52b754=_0x52b754-0x0;var _0x58205d=_0xaf2b[_0x52b754];return _0x58205d;};'use strict';var _=require('lodash');var util=require(_0xbaf2('0x0'));var moment=require('moment');var BPromise=require(_0xbaf2('0x1'));var rs=require(_0xbaf2('0x2'));var fs=require('fs');var Redis=require(_0xbaf2('0x3'));var db=require(_0xbaf2('0x4'))['db'];var utils=require(_0xbaf2('0x5'));var logger=require(_0xbaf2('0x6'))(_0xbaf2('0x7'));var config=require(_0xbaf2('0x8'));var jayson=require(_0xbaf2('0x9'));var client=jayson[_0xbaf2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x100cdc,_0x181746,_0x5e76d9){return new BPromise(function(_0x25324e,_0x5738da){return client['request'](_0x100cdc,_0x5e76d9)['then'](function(_0x1d2f8d){logger[_0xbaf2('0xb')](_0xbaf2('0xc'),_0x181746,_0xbaf2('0xd'));logger[_0xbaf2('0xe')](_0xbaf2('0xf'),_0x181746,_0xbaf2('0xd'),JSON[_0xbaf2('0x10')](_0x1d2f8d));if(_0x1d2f8d[_0xbaf2('0x11')]){if(_0x1d2f8d[_0xbaf2('0x11')][_0xbaf2('0x12')]===0x1f4){logger[_0xbaf2('0x11')](_0xbaf2('0xc'),_0x181746,_0x1d2f8d['error']['message']);return _0x5738da(_0x1d2f8d[_0xbaf2('0x11')][_0xbaf2('0x13')]);}logger[_0xbaf2('0x11')](_0xbaf2('0xc'),_0x181746,_0x1d2f8d['error'][_0xbaf2('0x13')]);return _0x25324e(_0x1d2f8d['error'][_0xbaf2('0x13')]);}else{logger[_0xbaf2('0xb')](_0xbaf2('0xc'),_0x181746,'request\x20sent');_0x25324e(_0x1d2f8d[_0xbaf2('0x14')][_0xbaf2('0x13')]);}})[_0xbaf2('0x15')](function(_0x92466){logger['error'](_0xbaf2('0xc'),_0x181746,_0x92466);_0x5738da(_0x92466);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index c18e99d..b2e7c86 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 _0xe47e=['./intVtigerField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x58693c,_0x17b3b6){var _0x307b24=function(_0x8afd69){while(--_0x8afd69){_0x58693c['push'](_0x58693c['shift']());}};_0x307b24(++_0x17b3b6);}(_0xe47e,0x12c));var _0xee47=function(_0x57928b,_0x29a111){_0x57928b=_0x57928b-0x0;var _0x49aad6=_0xe47e[_0x57928b];return _0x49aad6;};'use strict';var multer=require(_0xee47('0x0'));var util=require(_0xee47('0x1'));var path=require(_0xee47('0x2'));var timeout=require(_0xee47('0x3'));var express=require(_0xee47('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xee47('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xee47('0x6'));router[_0xee47('0x7')]('/',auth[_0xee47('0x8')](),controller[_0xee47('0x9')]);router[_0xee47('0x7')](_0xee47('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xee47('0xb')]('/',auth[_0xee47('0x8')](),controller[_0xee47('0xc')]);router[_0xee47('0xd')]('/:id',auth[_0xee47('0x8')](),controller[_0xee47('0xe')]);router[_0xee47('0xf')]('/:id',auth[_0xee47('0x8')](),controller[_0xee47('0x10')]);module[_0xee47('0x11')]=router; \ No newline at end of file +var _0x86bd=['show','post','create','put','update','delete','destroy','path','Router','fs-extra','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x462b8c,_0x44e2e1){var _0x494032=function(_0x2d7dc4){while(--_0x2d7dc4){_0x462b8c['push'](_0x462b8c['shift']());}};_0x494032(++_0x44e2e1);}(_0x86bd,0x1ba));var _0xd86b=function(_0x207e60,_0x1f823b){_0x207e60=_0x207e60-0x0;var _0x3f692b=_0x86bd[_0x207e60];return _0x3f692b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd86b('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd86b('0x1')]();var fs_extra=require(_0xd86b('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd86b('0x3'));var controller=require('./intVtigerField.controller');router['get']('/',auth[_0xd86b('0x4')](),controller[_0xd86b('0x5')]);router[_0xd86b('0x6')](_0xd86b('0x7'),auth[_0xd86b('0x4')](),controller[_0xd86b('0x8')]);router[_0xd86b('0x9')]('/',auth['isAuthenticated'](),controller[_0xd86b('0xa')]);router[_0xd86b('0xb')](_0xd86b('0x7'),auth[_0xd86b('0x4')](),controller[_0xd86b('0xc')]);router[_0xd86b('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xd86b('0xe')]);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 1094850..e7be85e 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 _0x6203=['ENUM','variable','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x25a029,_0x112d74){var _0xbc159c=function(_0x11203d){while(--_0x11203d){_0x25a029['push'](_0x25a029['shift']());}};_0xbc159c(++_0x112d74);}(_0x6203,0x7c));var _0x3620=function(_0x46d821,_0x138b43){_0x46d821=_0x46d821-0x0;var _0x4a39db=_0x6203[_0x46d821];return _0x4a39db;};'use strict';var Sequelize=require(_0x3620('0x0'));module[_0x3620('0x1')]={'type':{'type':Sequelize[_0x3620('0x2')]('string',_0x3620('0x3'),'customVariable','keyValue','picklist'),'defaultValue':_0x3620('0x4')},'content':{'type':Sequelize[_0x3620('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3620('0x2')](_0x3620('0x4'),_0x3620('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3620('0x5')]},'nameField':{'type':Sequelize[_0x3620('0x5')]},'customField':{'type':Sequelize[_0x3620('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3620('0x5')]}}; \ No newline at end of file +var _0x14d7=['string','customVariable','picklist','STRING','variable','sequelize','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x14d7,0x19b));var _0x714d=function(_0x501732,_0x53aaa0){_0x501732=_0x501732-0x0;var _0x588ae8=_0x14d7[_0x501732];return _0x588ae8;};'use strict';var Sequelize=require(_0x714d('0x0'));module['exports']={'type':{'type':Sequelize[_0x714d('0x1')](_0x714d('0x2'),'variable',_0x714d('0x3'),'keyValue',_0x714d('0x4')),'defaultValue':_0x714d('0x2')},'content':{'type':Sequelize[_0x714d('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x714d('0x2'),_0x714d('0x6'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x714d('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x714d('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 513d3d0..93fb04e 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 _0x3cd6=['name','send','index','map','VtigerField','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','update','then','error'];(function(_0x3cf150,_0x178cb5){var _0x931f8b=function(_0x40a693){while(--_0x40a693){_0x3cf150['push'](_0x3cf150['shift']());}};_0x931f8b(++_0x178cb5);}(_0x3cd6,0x6a));var _0x63cd=function(_0x17daa1,_0x231464){_0x17daa1=_0x17daa1-0x0;var _0x2512ed=_0x3cd6[_0x17daa1];return _0x2512ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x63cd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x63cd('0x1'));var rp=require(_0x63cd('0x2'));var moment=require(_0x63cd('0x3'));var BPromise=require(_0x63cd('0x4'));var Mustache=require(_0x63cd('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x63cd('0x6'));var ejs=require(_0x63cd('0x7'));var fs=require('fs');var fs_extra=require(_0x63cd('0x8'));var _=require(_0x63cd('0x9'));var squel=require(_0x63cd('0xa'));var crypto=require(_0x63cd('0xb'));var jsforce=require(_0x63cd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x63cd('0x6'));var querystring=require(_0x63cd('0xd'));var Papa=require(_0x63cd('0xe'));var Redis=require(_0x63cd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x63cd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63cd('0x11'));var logger=require(_0x63cd('0x12'))('api');var utils=require(_0x63cd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x63cd('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dba08,_0x552a63){_0x552a63=_0x552a63||0xcc;return function(_0x35c758){if(_0x35c758){return _0x3dba08[_0x63cd('0x15')](_0x552a63);}return _0x3dba08[_0x63cd('0x16')](_0x552a63)[_0x63cd('0x17')]();};}function respondWithResult(_0x223183,_0x29fccd){_0x29fccd=_0x29fccd||0xc8;return function(_0x28b33a){if(_0x28b33a){return _0x223183[_0x63cd('0x16')](_0x29fccd)[_0x63cd('0x18')](_0x28b33a);}};}function respondWithFilteredResult(_0x2bfad3,_0x34202c){return function(_0x1cc623){if(_0x1cc623){var _0x3f5ec1=typeof _0x34202c['offset']===_0x63cd('0x19')&&typeof _0x34202c['limit']===_0x63cd('0x19');var _0xbea63=_0x1cc623['count'];var _0x544ce8=_0x3f5ec1?0x0:_0x34202c[_0x63cd('0x1a')];var _0x3ad851=_0x3f5ec1?_0x1cc623[_0x63cd('0x1b')]:_0x34202c[_0x63cd('0x1a')]+_0x34202c[_0x63cd('0x1c')];var _0x1d17de;if(_0x3ad851>=_0xbea63){_0x3ad851=_0xbea63;_0x1d17de=0xc8;}else{_0x1d17de=0xce;}_0x2bfad3[_0x63cd('0x16')](_0x1d17de);return _0x2bfad3[_0x63cd('0x1d')](_0x63cd('0x1e'),_0x544ce8+'-'+_0x3ad851+'/'+_0xbea63)['json'](_0x1cc623);}return null;};}function patchUpdates(_0x50bf9f){return function(_0x493e57){try{jsonpatch[_0x63cd('0x1f')](_0x493e57,_0x50bf9f,!![]);}catch(_0x26467f){return BPromise[_0x63cd('0x20')](_0x26467f);}return _0x493e57['save']();};}function saveUpdates(_0x2c3f1c,_0x34c6f6){return function(_0x3eb2ef){if(_0x3eb2ef){return _0x3eb2ef[_0x63cd('0x21')](_0x2c3f1c)[_0x63cd('0x22')](function(_0x3b7099){return _0x3b7099;});}return null;};}function removeEntity(_0x2fc5c3,_0x438ff5){return function(_0x36cb81){if(_0x36cb81){return _0x36cb81['destroy']()[_0x63cd('0x22')](function(){_0x2fc5c3[_0x63cd('0x16')](0xcc)[_0x63cd('0x17')]();});}};}function handleEntityNotFound(_0x566fce,_0x3a3659){return function(_0x1875af){if(!_0x1875af){_0x566fce[_0x63cd('0x15')](0x194);}return _0x1875af;};}function handleError(_0x41050d,_0x31bf28){_0x31bf28=_0x31bf28||0x1f4;return function(_0xc91d4b){logger[_0x63cd('0x23')](_0xc91d4b['stack']);if(_0xc91d4b['name']){delete _0xc91d4b[_0x63cd('0x24')];}_0x41050d[_0x63cd('0x16')](_0x31bf28)[_0x63cd('0x25')](_0xc91d4b);};}exports[_0x63cd('0x26')]=function(_0x15e5d3,_0x33ba55){var _0x2da3f8={},_0x232569={},_0xef05ac={'count':0x0,'rows':[]};var _0x4ba8b7=_[_0x63cd('0x27')](db[_0x63cd('0x28')][_0x63cd('0x29')],function(_0x471989){return{'name':_0x471989[_0x63cd('0x2a')],'type':_0x471989[_0x63cd('0x2b')]['key']};});_0x232569['model']=_[_0x63cd('0x27')](_0x4ba8b7,_0x63cd('0x24'));_0x232569[_0x63cd('0x2c')]=_[_0x63cd('0x2d')](_0x15e5d3[_0x63cd('0x2c')]);_0x232569[_0x63cd('0x2e')]=_[_0x63cd('0x2f')](_0x232569[_0x63cd('0x30')],_0x232569[_0x63cd('0x2c')]);_0x2da3f8['attributes']=_[_0x63cd('0x2f')](_0x232569[_0x63cd('0x30')],qs[_0x63cd('0x31')](_0x15e5d3[_0x63cd('0x2c')][_0x63cd('0x31')]));_0x2da3f8[_0x63cd('0x32')]=_0x2da3f8[_0x63cd('0x32')][_0x63cd('0x33')]?_0x2da3f8['attributes']:_0x232569[_0x63cd('0x30')];if(!_0x15e5d3[_0x63cd('0x2c')][_0x63cd('0x34')]('nolimit')){_0x2da3f8[_0x63cd('0x1c')]=qs[_0x63cd('0x1c')](_0x15e5d3['query'][_0x63cd('0x1c')]);_0x2da3f8[_0x63cd('0x1a')]=qs['offset'](_0x15e5d3[_0x63cd('0x2c')][_0x63cd('0x1a')]);}_0x2da3f8['order']=qs[_0x63cd('0x35')](_0x15e5d3[_0x63cd('0x2c')][_0x63cd('0x35')]);_0x2da3f8['where']=qs[_0x63cd('0x2e')](_[_0x63cd('0x36')](_0x15e5d3['query'],_0x232569[_0x63cd('0x2e')]),_0x4ba8b7);if(_0x15e5d3[_0x63cd('0x2c')][_0x63cd('0x37')]){_0x2da3f8[_0x63cd('0x38')]=_['merge'](_0x2da3f8[_0x63cd('0x38')],{'$or':_['map'](_0x4ba8b7,function(_0x26feb9){if(_0x26feb9['type']!==_0x63cd('0x39')){var _0x52a482={};_0x52a482[_0x26feb9[_0x63cd('0x24')]]={'$like':'%'+_0x15e5d3[_0x63cd('0x2c')][_0x63cd('0x37')]+'%'};return _0x52a482;}})});}_0x2da3f8=_['merge']({},_0x2da3f8,_0x15e5d3[_0x63cd('0x3a')]);var _0xf8370f={'where':_0x2da3f8['where']};return db[_0x63cd('0x28')]['count'](_0xf8370f)[_0x63cd('0x22')](function(_0xb13e25){_0xef05ac[_0x63cd('0x1b')]=_0xb13e25;if(_0x15e5d3['query'][_0x63cd('0x3b')]){_0x2da3f8['include']=[{'all':!![]}];}return db[_0x63cd('0x28')][_0x63cd('0x3c')](_0x2da3f8);})[_0x63cd('0x22')](function(_0xae797f){_0xef05ac[_0x63cd('0x3d')]=_0xae797f;return _0xef05ac;})[_0x63cd('0x22')](respondWithFilteredResult(_0x33ba55,_0x2da3f8))[_0x63cd('0x3e')](handleError(_0x33ba55,null));};exports[_0x63cd('0x3f')]=function(_0x2b750a,_0x39fe4b){var _0x3475bb={'raw':!![],'where':{'id':_0x2b750a[_0x63cd('0x40')]['id']}},_0x38c7b5={};_0x38c7b5['model']=_[_0x63cd('0x2d')](db['VtigerField'][_0x63cd('0x29')]);_0x38c7b5[_0x63cd('0x2c')]=_[_0x63cd('0x2d')](_0x2b750a[_0x63cd('0x2c')]);_0x38c7b5[_0x63cd('0x2e')]=_[_0x63cd('0x2f')](_0x38c7b5[_0x63cd('0x30')],_0x38c7b5['query']);_0x3475bb[_0x63cd('0x32')]=_[_0x63cd('0x2f')](_0x38c7b5[_0x63cd('0x30')],qs[_0x63cd('0x31')](_0x2b750a[_0x63cd('0x2c')]['fields']));_0x3475bb[_0x63cd('0x32')]=_0x3475bb[_0x63cd('0x32')]['length']?_0x3475bb['attributes']:_0x38c7b5[_0x63cd('0x30')];if(_0x2b750a[_0x63cd('0x2c')][_0x63cd('0x3b')]){_0x3475bb[_0x63cd('0x41')]=[{'all':!![]}];}_0x3475bb=_[_0x63cd('0x42')]({},_0x3475bb,_0x2b750a[_0x63cd('0x3a')]);return db[_0x63cd('0x28')][_0x63cd('0x43')](_0x3475bb)[_0x63cd('0x22')](handleEntityNotFound(_0x39fe4b,null))['then'](respondWithResult(_0x39fe4b,null))[_0x63cd('0x3e')](handleError(_0x39fe4b,null));};exports[_0x63cd('0x44')]=function(_0x4300ac,_0xa92966){return db[_0x63cd('0x28')][_0x63cd('0x44')](_0x4300ac[_0x63cd('0x45')],{})[_0x63cd('0x22')](respondWithResult(_0xa92966,0xc9))['catch'](handleError(_0xa92966,null));};exports[_0x63cd('0x21')]=function(_0x3fbb86,_0x4a6cfc){if(_0x3fbb86[_0x63cd('0x45')]['id']){delete _0x3fbb86[_0x63cd('0x45')]['id'];}return db[_0x63cd('0x28')][_0x63cd('0x43')]({'where':{'id':_0x3fbb86[_0x63cd('0x40')]['id']}})['then'](handleEntityNotFound(_0x4a6cfc,null))[_0x63cd('0x22')](saveUpdates(_0x3fbb86[_0x63cd('0x45')],null))[_0x63cd('0x22')](respondWithResult(_0x4a6cfc,null))['catch'](handleError(_0x4a6cfc,null));};exports[_0x63cd('0x46')]=function(_0x547c47,_0x276c8f){return db[_0x63cd('0x28')]['find']({'where':{'id':_0x547c47['params']['id']}})[_0x63cd('0x22')](handleEntityNotFound(_0x276c8f,null))[_0x63cd('0x22')](removeEntity(_0x276c8f,null))[_0x63cd('0x3e')](handleError(_0x276c8f,null));}; \ No newline at end of file +var _0xf26a=['sort','where','pick','filter','VIRTUAL','options','then','count','includeAll','include','rows','catch','show','params','rawAttributes','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','end','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','index','VtigerField','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf26a,0x1c3));var _0xaf26=function(_0x402468,_0x349609){_0x402468=_0x402468-0x0;var _0x28ab22=_0xf26a[_0x402468];return _0x28ab22;};'use strict';var emlformat=require(_0xaf26('0x0'));var rimraf=require(_0xaf26('0x1'));var zipdir=require(_0xaf26('0x2'));var jsonpatch=require(_0xaf26('0x3'));var rp=require(_0xaf26('0x4'));var moment=require('moment');var BPromise=require(_0xaf26('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaf26('0x6'));var sox=require(_0xaf26('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf26('0x8'));var _=require(_0xaf26('0x9'));var squel=require(_0xaf26('0xa'));var crypto=require('crypto');var jsforce=require(_0xaf26('0xb'));var deskjs=require(_0xaf26('0xc'));var toCsv=require(_0xaf26('0xd'));var querystring=require(_0xaf26('0xe'));var Papa=require('papaparse');var Redis=require(_0xaf26('0xf'));var authService=require(_0xaf26('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaf26('0x11'));var hardwareService=require(_0xaf26('0x12'));var logger=require(_0xaf26('0x13'))(_0xaf26('0x14'));var utils=require('../../config/utils');var config=require(_0xaf26('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b9412,_0x2c319d){_0x2c319d=_0x2c319d||0xcc;return function(_0x455526){if(_0x455526){return _0x1b9412['sendStatus'](_0x2c319d);}return _0x1b9412['status'](_0x2c319d)[_0xaf26('0x16')]();};}function respondWithResult(_0x36379f,_0x4034a9){_0x4034a9=_0x4034a9||0xc8;return function(_0x472339){if(_0x472339){return _0x36379f[_0xaf26('0x17')](_0x4034a9)['json'](_0x472339);}};}function respondWithFilteredResult(_0x3d4d98,_0x4cc429){return function(_0x18a13e){if(_0x18a13e){var _0x5dd09d=typeof _0x4cc429[_0xaf26('0x18')]===_0xaf26('0x19')&&typeof _0x4cc429['limit']===_0xaf26('0x19');var _0x3a967a=_0x18a13e['count'];var _0x3d162f=_0x5dd09d?0x0:_0x4cc429['offset'];var _0x5bf964=_0x5dd09d?_0x18a13e['count']:_0x4cc429[_0xaf26('0x18')]+_0x4cc429[_0xaf26('0x1a')];var _0x5da584;if(_0x5bf964>=_0x3a967a){_0x5bf964=_0x3a967a;_0x5da584=0xc8;}else{_0x5da584=0xce;}_0x3d4d98[_0xaf26('0x17')](_0x5da584);return _0x3d4d98[_0xaf26('0x1b')](_0xaf26('0x1c'),_0x3d162f+'-'+_0x5bf964+'/'+_0x3a967a)[_0xaf26('0x1d')](_0x18a13e);}return null;};}function patchUpdates(_0x40a515){return function(_0x2b23ae){try{jsonpatch[_0xaf26('0x1e')](_0x2b23ae,_0x40a515,!![]);}catch(_0xb04e9e){return BPromise[_0xaf26('0x1f')](_0xb04e9e);}return _0x2b23ae[_0xaf26('0x20')]();};}function saveUpdates(_0x37f434,_0x2c3eff){return function(_0x348a77){if(_0x348a77){return _0x348a77[_0xaf26('0x21')](_0x37f434)['then'](function(_0x255a00){return _0x255a00;});}return null;};}function removeEntity(_0x2db159,_0x2f2757){return function(_0x10b4be){if(_0x10b4be){return _0x10b4be[_0xaf26('0x22')]()['then'](function(){_0x2db159[_0xaf26('0x17')](0xcc)[_0xaf26('0x16')]();});}};}function handleEntityNotFound(_0x1a5718,_0x1a0093){return function(_0xfc859d){if(!_0xfc859d){_0x1a5718['sendStatus'](0x194);}return _0xfc859d;};}function handleError(_0xcce368,_0x18a84d){_0x18a84d=_0x18a84d||0x1f4;return function(_0x490d1e){logger[_0xaf26('0x23')](_0x490d1e[_0xaf26('0x24')]);if(_0x490d1e[_0xaf26('0x25')]){delete _0x490d1e[_0xaf26('0x25')];}_0xcce368[_0xaf26('0x17')](_0x18a84d)['send'](_0x490d1e);};}exports[_0xaf26('0x26')]=function(_0x56f424,_0x58ae99){var _0x332199={},_0x5c0083={},_0x3e07b5={'count':0x0,'rows':[]};var _0x38c5de=_['map'](db[_0xaf26('0x27')]['rawAttributes'],function(_0x3fd9d3){return{'name':_0x3fd9d3[_0xaf26('0x28')],'type':_0x3fd9d3[_0xaf26('0x29')][_0xaf26('0x2a')]};});_0x5c0083[_0xaf26('0x2b')]=_[_0xaf26('0x2c')](_0x38c5de,'name');_0x5c0083[_0xaf26('0x2d')]=_[_0xaf26('0x2e')](_0x56f424[_0xaf26('0x2d')]);_0x5c0083[_0xaf26('0x2f')]=_[_0xaf26('0x30')](_0x5c0083[_0xaf26('0x2b')],_0x5c0083[_0xaf26('0x2d')]);_0x332199[_0xaf26('0x31')]=_['intersection'](_0x5c0083[_0xaf26('0x2b')],qs[_0xaf26('0x32')](_0x56f424[_0xaf26('0x2d')][_0xaf26('0x32')]));_0x332199[_0xaf26('0x31')]=_0x332199[_0xaf26('0x31')][_0xaf26('0x33')]?_0x332199['attributes']:_0x5c0083[_0xaf26('0x2b')];if(!_0x56f424[_0xaf26('0x2d')][_0xaf26('0x34')]('nolimit')){_0x332199[_0xaf26('0x1a')]=qs[_0xaf26('0x1a')](_0x56f424[_0xaf26('0x2d')]['limit']);_0x332199[_0xaf26('0x18')]=qs[_0xaf26('0x18')](_0x56f424[_0xaf26('0x2d')]['offset']);}_0x332199['order']=qs[_0xaf26('0x35')](_0x56f424[_0xaf26('0x2d')]['sort']);_0x332199[_0xaf26('0x36')]=qs[_0xaf26('0x2f')](_[_0xaf26('0x37')](_0x56f424[_0xaf26('0x2d')],_0x5c0083['filters']),_0x38c5de);if(_0x56f424[_0xaf26('0x2d')][_0xaf26('0x38')]){_0x332199[_0xaf26('0x36')]=_['merge'](_0x332199[_0xaf26('0x36')],{'$or':_['map'](_0x38c5de,function(_0x24f30c){if(_0x24f30c[_0xaf26('0x29')]!==_0xaf26('0x39')){var _0x5f5b4f={};_0x5f5b4f[_0x24f30c[_0xaf26('0x25')]]={'$like':'%'+_0x56f424[_0xaf26('0x2d')][_0xaf26('0x38')]+'%'};return _0x5f5b4f;}})});}_0x332199=_['merge']({},_0x332199,_0x56f424[_0xaf26('0x3a')]);var _0x28e8c5={'where':_0x332199['where']};return db[_0xaf26('0x27')]['count'](_0x28e8c5)[_0xaf26('0x3b')](function(_0x4750d3){_0x3e07b5[_0xaf26('0x3c')]=_0x4750d3;if(_0x56f424[_0xaf26('0x2d')][_0xaf26('0x3d')]){_0x332199[_0xaf26('0x3e')]=[{'all':!![]}];}return db[_0xaf26('0x27')]['findAll'](_0x332199);})[_0xaf26('0x3b')](function(_0x18aa3d){_0x3e07b5[_0xaf26('0x3f')]=_0x18aa3d;return _0x3e07b5;})[_0xaf26('0x3b')](respondWithFilteredResult(_0x58ae99,_0x332199))[_0xaf26('0x40')](handleError(_0x58ae99,null));};exports[_0xaf26('0x41')]=function(_0x466cb7,_0x527b9b){var _0x186628={'raw':!![],'where':{'id':_0x466cb7[_0xaf26('0x42')]['id']}},_0x530b69={};_0x530b69[_0xaf26('0x2b')]=_['keys'](db['VtigerField'][_0xaf26('0x43')]);_0x530b69[_0xaf26('0x2d')]=_['keys'](_0x466cb7['query']);_0x530b69['filters']=_[_0xaf26('0x30')](_0x530b69[_0xaf26('0x2b')],_0x530b69[_0xaf26('0x2d')]);_0x186628[_0xaf26('0x31')]=_[_0xaf26('0x30')](_0x530b69[_0xaf26('0x2b')],qs[_0xaf26('0x32')](_0x466cb7[_0xaf26('0x2d')]['fields']));_0x186628[_0xaf26('0x31')]=_0x186628[_0xaf26('0x31')][_0xaf26('0x33')]?_0x186628['attributes']:_0x530b69[_0xaf26('0x2b')];if(_0x466cb7['query'][_0xaf26('0x3d')]){_0x186628['include']=[{'all':!![]}];}_0x186628=_[_0xaf26('0x44')]({},_0x186628,_0x466cb7[_0xaf26('0x3a')]);return db[_0xaf26('0x27')][_0xaf26('0x45')](_0x186628)[_0xaf26('0x3b')](handleEntityNotFound(_0x527b9b,null))[_0xaf26('0x3b')](respondWithResult(_0x527b9b,null))[_0xaf26('0x40')](handleError(_0x527b9b,null));};exports[_0xaf26('0x46')]=function(_0x5c6296,_0x21314b){return db[_0xaf26('0x27')][_0xaf26('0x46')](_0x5c6296[_0xaf26('0x47')],{})[_0xaf26('0x3b')](respondWithResult(_0x21314b,0xc9))[_0xaf26('0x40')](handleError(_0x21314b,null));};exports['update']=function(_0x238d45,_0x5b5ad8){if(_0x238d45[_0xaf26('0x47')]['id']){delete _0x238d45['body']['id'];}return db[_0xaf26('0x27')]['find']({'where':{'id':_0x238d45[_0xaf26('0x42')]['id']}})[_0xaf26('0x3b')](handleEntityNotFound(_0x5b5ad8,null))['then'](saveUpdates(_0x238d45[_0xaf26('0x47')],null))['then'](respondWithResult(_0x5b5ad8,null))[_0xaf26('0x40')](handleError(_0x5b5ad8,null));};exports[_0xaf26('0x22')]=function(_0x5c843e,_0x111da3){return db[_0xaf26('0x27')][_0xaf26('0x45')]({'where':{'id':_0x5c843e[_0xaf26('0x42')]['id']}})[_0xaf26('0x3b')](handleEntityNotFound(_0x111da3,null))[_0xaf26('0x3b')](removeEntity(_0x111da3,null))[_0xaf26('0x40')](handleError(_0x111da3,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 6055db4..a7b1e25 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 _0x7b54=['VtigerField','vtiger_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x7b54,0x120));var _0x47b5=function(_0x3aaf97,_0x4fa2e8){_0x3aaf97=_0x3aaf97-0x0;var _0xeba75e=_0x7b54[_0x3aaf97];return _0xeba75e;};'use strict';var _=require(_0x47b5('0x0'));var util=require('util');var logger=require(_0x47b5('0x1'))(_0x47b5('0x2'));var moment=require(_0x47b5('0x3'));var BPromise=require(_0x47b5('0x4'));var rp=require(_0x47b5('0x5'));var fs=require('fs');var path=require(_0x47b5('0x6'));var rimraf=require(_0x47b5('0x7'));var config=require(_0x47b5('0x8'));var attributes=require(_0x47b5('0x9'));module[_0x47b5('0xa')]=function(_0x230559,_0x35c121){return _0x230559[_0x47b5('0xb')](_0x47b5('0xc'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x47b5('0xd'),'fields':[_0x47b5('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x601a=['api','moment','request-promise','path','rimraf','../../config/environment','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x349f55,_0x4ff929){var _0x379881=function(_0x38890a){while(--_0x38890a){_0x349f55['push'](_0x349f55['shift']());}};_0x379881(++_0x4ff929);}(_0x601a,0x14e));var _0xa601=function(_0x20ee38,_0x2611cc){_0x20ee38=_0x20ee38-0x0;var _0x4e9173=_0x601a[_0x20ee38];return _0x4e9173;};'use strict';var _=require('lodash');var util=require(_0xa601('0x0'));var logger=require(_0xa601('0x1'))(_0xa601('0x2'));var moment=require(_0xa601('0x3'));var BPromise=require('bluebird');var rp=require(_0xa601('0x4'));var fs=require('fs');var path=require(_0xa601('0x5'));var rimraf=require(_0xa601('0x6'));var config=require(_0xa601('0x7'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x5557a3,_0x29655b){return _0x5557a3[_0xa601('0x8')](_0xa601('0x9'),attributes,{'tableName':_0xa601('0xa'),'paranoid':![],'indexes':[{'name':_0xa601('0xb'),'fields':[_0xa601('0xc'),_0xa601('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 8da0b12..caa06d1 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 _0xe3f8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2dcd8c,_0x4e0c89){var _0x215012=function(_0x37405c){while(--_0x37405c){_0x2dcd8c['push'](_0x2dcd8c['shift']());}};_0x215012(++_0x4e0c89);}(_0xe3f8,0x127));var _0x8e3f=function(_0x470eee,_0x4af3e1){_0x470eee=_0x470eee-0x0;var _0x5a65da=_0xe3f8[_0x470eee];return _0x5a65da;};'use strict';var _=require(_0x8e3f('0x0'));var util=require(_0x8e3f('0x1'));var moment=require(_0x8e3f('0x2'));var BPromise=require(_0x8e3f('0x3'));var rs=require(_0x8e3f('0x4'));var fs=require('fs');var Redis=require(_0x8e3f('0x5'));var db=require(_0x8e3f('0x6'))['db'];var utils=require(_0x8e3f('0x7'));var logger=require(_0x8e3f('0x8'))(_0x8e3f('0x9'));var config=require(_0x8e3f('0xa'));var jayson=require(_0x8e3f('0xb'));var client=jayson[_0x8e3f('0xc')][_0x8e3f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4de78d,_0x4ee58d,_0x495c82){return new BPromise(function(_0x11ffc1,_0x165a34){return client[_0x8e3f('0xe')](_0x4de78d,_0x495c82)[_0x8e3f('0xf')](function(_0x11f2dd){logger[_0x8e3f('0x10')](_0x8e3f('0x11'),_0x4ee58d,_0x8e3f('0x12'));logger['debug'](_0x8e3f('0x13'),_0x4ee58d,_0x8e3f('0x12'),JSON['stringify'](_0x11f2dd));if(_0x11f2dd['error']){if(_0x11f2dd[_0x8e3f('0x14')][_0x8e3f('0x15')]===0x1f4){logger[_0x8e3f('0x14')](_0x8e3f('0x11'),_0x4ee58d,_0x11f2dd[_0x8e3f('0x14')][_0x8e3f('0x16')]);return _0x165a34(_0x11f2dd[_0x8e3f('0x14')][_0x8e3f('0x16')]);}logger[_0x8e3f('0x14')]('VtigerField,\x20%s,\x20%s',_0x4ee58d,_0x11f2dd[_0x8e3f('0x14')][_0x8e3f('0x16')]);return _0x11ffc1(_0x11f2dd['error']['message']);}else{logger['info'](_0x8e3f('0x11'),_0x4ee58d,_0x8e3f('0x12'));_0x11ffc1(_0x11f2dd[_0x8e3f('0x17')][_0x8e3f('0x16')]);}})[_0x8e3f('0x18')](function(_0xda7935){logger[_0x8e3f('0x14')](_0x8e3f('0x11'),_0x4ee58d,_0xda7935);_0x165a34(_0xda7935);});});} \ No newline at end of file +var _0xc8eb=['VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc8eb,0xa5));var _0xbc8e=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0xc8eb[_0x5c6244];return _0x5800ce;};'use strict';var _=require(_0xbc8e('0x0'));var util=require(_0xbc8e('0x1'));var moment=require(_0xbc8e('0x2'));var BPromise=require(_0xbc8e('0x3'));var rs=require(_0xbc8e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc8e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbc8e('0x6'));var jayson=require(_0xbc8e('0x7'));var client=jayson[_0xbc8e('0x8')][_0xbc8e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17f15d,_0x1d92af,_0x1e4130){return new BPromise(function(_0x4805db,_0x143727){return client[_0xbc8e('0xa')](_0x17f15d,_0x1e4130)[_0xbc8e('0xb')](function(_0x3cc88c){logger['info'](_0xbc8e('0xc'),_0x1d92af,_0xbc8e('0xd'));logger[_0xbc8e('0xe')](_0xbc8e('0xf'),_0x1d92af,_0xbc8e('0xd'),JSON[_0xbc8e('0x10')](_0x3cc88c));if(_0x3cc88c[_0xbc8e('0x11')]){if(_0x3cc88c[_0xbc8e('0x11')][_0xbc8e('0x12')]===0x1f4){logger['error'](_0xbc8e('0xc'),_0x1d92af,_0x3cc88c[_0xbc8e('0x11')][_0xbc8e('0x13')]);return _0x143727(_0x3cc88c['error']['message']);}logger[_0xbc8e('0x11')](_0xbc8e('0xc'),_0x1d92af,_0x3cc88c[_0xbc8e('0x11')][_0xbc8e('0x13')]);return _0x4805db(_0x3cc88c[_0xbc8e('0x11')]['message']);}else{logger['info'](_0xbc8e('0xc'),_0x1d92af,_0xbc8e('0xd'));_0x4805db(_0x3cc88c['result'][_0xbc8e('0x13')]);}})['catch'](function(_0x1f8fe5){logger[_0xbc8e('0x11')]('VtigerField,\x20%s,\x20%s',_0x1d92af,_0x1f8fe5);_0x143727(_0x1f8fe5);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index c78b904..22c9400 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 _0x71f1=['multer','util','connect-timeout','express','../../config/environment','./intZendeskAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','create','post','put','update','destroy','exports'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x71f1,0xea));var _0x171f=function(_0x4a3f10,_0x3373f1){_0x4a3f10=_0x4a3f10-0x0;var _0x1bcf08=_0x71f1[_0x4a3f10];return _0x1bcf08;};'use strict';var multer=require(_0x171f('0x0'));var util=require(_0x171f('0x1'));var path=require('path');var timeout=require(_0x171f('0x2'));var express=require(_0x171f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x171f('0x4'));var controller=require(_0x171f('0x5'));router[_0x171f('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x171f('0x6')](_0x171f('0x7'),auth[_0x171f('0x8')](),controller[_0x171f('0x9')]);router[_0x171f('0x6')](_0x171f('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x171f('0x6')](_0x171f('0xb'),auth[_0x171f('0x8')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x171f('0xc')]);router[_0x171f('0xd')](_0x171f('0xa'),auth[_0x171f('0x8')](),controller['addConfiguration']);router[_0x171f('0xe')]('/:id',auth[_0x171f('0x8')](),controller[_0x171f('0xf')]);router['delete'](_0x171f('0x7'),auth[_0x171f('0x8')](),controller[_0x171f('0x10')]);module[_0x171f('0x11')]=router; \ No newline at end of file +var _0x4c0c=['create','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields'];(function(_0x18dc18,_0x31849a){var _0x2c2752=function(_0x39e430){while(--_0x39e430){_0x18dc18['push'](_0x18dc18['shift']());}};_0x2c2752(++_0x31849a);}(_0x4c0c,0xef));var _0xc4c0=function(_0x1d457e,_0x22f9a9){_0x1d457e=_0x1d457e-0x0;var _0x332b9d=_0x4c0c[_0x1d457e];return _0x332b9d;};'use strict';var multer=require(_0xc4c0('0x0'));var util=require(_0xc4c0('0x1'));var path=require('path');var timeout=require(_0xc4c0('0x2'));var express=require('express');var router=express[_0xc4c0('0x3')]();var fs_extra=require(_0xc4c0('0x4'));var auth=require(_0xc4c0('0x5'));var interaction=require(_0xc4c0('0x6'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0xc4c0('0x7')]('/',auth[_0xc4c0('0x8')](),controller['index']);router['get'](_0xc4c0('0x9'),auth[_0xc4c0('0x8')](),controller[_0xc4c0('0xa')]);router[_0xc4c0('0x7')]('/:id/configurations',auth[_0xc4c0('0x8')](),controller[_0xc4c0('0xb')]);router['get'](_0xc4c0('0xc'),auth[_0xc4c0('0x8')](),controller[_0xc4c0('0xd')]);router['post']('/',auth[_0xc4c0('0x8')](),controller[_0xc4c0('0xe')]);router[_0xc4c0('0xf')](_0xc4c0('0x10'),auth['isAuthenticated'](),controller[_0xc4c0('0x11')]);router[_0xc4c0('0x12')]('/:id',auth[_0xc4c0('0x8')](),controller[_0xc4c0('0x13')]);router[_0xc4c0('0x14')](_0xc4c0('0x9'),auth[_0xc4c0('0x8')](),controller[_0xc4c0('0x15')]);module[_0xc4c0('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 44bb7fd..0b1f758 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 _0x96f2=['integrationTab','newTab','sequelize','STRING','ENUM','password'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x96f2,0xb0));var _0x296f=function(_0x4086d2,_0x31cfc8){_0x4086d2=_0x4086d2-0x0;var _0x2c0932=_0x96f2[_0x4086d2];return _0x2c0932;};'use strict';var Sequelize=require(_0x296f('0x0'));module['exports']={'name':{'type':Sequelize[_0x296f('0x1')]},'description':{'type':Sequelize[_0x296f('0x1')]},'username':{'type':Sequelize[_0x296f('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x296f('0x1')]},'token':{'type':Sequelize[_0x296f('0x1')]},'remoteUri':{'type':Sequelize[_0x296f('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x296f('0x2')](_0x296f('0x3'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x296f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x296f('0x2')](_0x296f('0x4'),_0x296f('0x5')),'defaultValue':_0x296f('0x4')}}; \ No newline at end of file +var _0x61f1=['username','remoteUri','password','token','ENUM','newTab','integrationTab','exports','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x61f1,0x18a));var _0x161f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x61f1[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x161f('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x161f('0x1')]},'username':{'type':Sequelize[_0x161f('0x1')],'unique':_0x161f('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x161f('0x1')],'unique':_0x161f('0x3')},'authType':{'type':Sequelize['ENUM'](_0x161f('0x4'),_0x161f('0x5')),'defaultValue':_0x161f('0x4')},'serverUrl':{'type':Sequelize[_0x161f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x161f('0x6')]('integrationTab',_0x161f('0x7')),'defaultValue':_0x161f('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 0f7213d..77725c4 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 _0x878f=['username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','toString','headers','%s/token:%s','base64','Sequelize','ValidationError','subject','description','group','assignee','includes','position','title','system_field_options','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','error','name','send','index','ZendeskAccount','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','filters','catch','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','Subjects'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x878f,0x173));var _0xf878=function(_0x3625dc,_0x529523){_0x3625dc=_0x3625dc-0x0;var _0x25201f=_0x878f[_0x3625dc];return _0x25201f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf878('0x0'));var zipdir=require(_0xf878('0x1'));var jsonpatch=require(_0xf878('0x2'));var rp=require(_0xf878('0x3'));var moment=require(_0xf878('0x4'));var BPromise=require(_0xf878('0x5'));var Mustache=require(_0xf878('0x6'));var util=require(_0xf878('0x7'));var path=require(_0xf878('0x8'));var sox=require(_0xf878('0x9'));var csv=require(_0xf878('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf878('0xb'));var squel=require(_0xf878('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf878('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf878('0xd'));var authService=require(_0xf878('0xe'));var qs=require(_0xf878('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf878('0x10'));var logger=require(_0xf878('0x11'))('api');var utils=require(_0xf878('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf878('0x13'));var db=require(_0xf878('0x14'))['db'];var integrations=require(_0xf878('0x15'));function respondWithStatusCode(_0x596fb5,_0x1ce004){_0x1ce004=_0x1ce004||0xcc;return function(_0x38eddf){if(_0x38eddf){return _0x596fb5[_0xf878('0x16')](_0x1ce004);}return _0x596fb5['status'](_0x1ce004)[_0xf878('0x17')]();};}function respondWithResult(_0x3902f7,_0x119e9e){_0x119e9e=_0x119e9e||0xc8;return function(_0x492260){if(_0x492260){return _0x3902f7['status'](_0x119e9e)[_0xf878('0x18')](_0x492260);}};}function respondWithFilteredResult(_0x35ff2d,_0x31d888){return function(_0x6dbeca){if(_0x6dbeca){var _0x44aacc=typeof _0x31d888[_0xf878('0x19')]===_0xf878('0x1a')&&typeof _0x31d888[_0xf878('0x1b')]===_0xf878('0x1a');var _0x3a55f3=_0x6dbeca[_0xf878('0x1c')];var _0x47a91a=_0x44aacc?0x0:_0x31d888[_0xf878('0x19')];var _0x34ae59=_0x44aacc?_0x6dbeca[_0xf878('0x1c')]:_0x31d888[_0xf878('0x19')]+_0x31d888[_0xf878('0x1b')];var _0x237d15;if(_0x34ae59>=_0x3a55f3){_0x34ae59=_0x3a55f3;_0x237d15=0xc8;}else{_0x237d15=0xce;}_0x35ff2d[_0xf878('0x1d')](_0x237d15);return _0x35ff2d['set'](_0xf878('0x1e'),_0x47a91a+'-'+_0x34ae59+'/'+_0x3a55f3)[_0xf878('0x18')](_0x6dbeca);}return null;};}function patchUpdates(_0x250f85){return function(_0x59efcb){try{jsonpatch[_0xf878('0x1f')](_0x59efcb,_0x250f85,!![]);}catch(_0x23590c){return BPromise[_0xf878('0x20')](_0x23590c);}return _0x59efcb[_0xf878('0x21')]();};}function saveUpdates(_0x22d884,_0x442450){return function(_0x1cbc92){if(_0x1cbc92){return _0x1cbc92[_0xf878('0x22')](_0x22d884)[_0xf878('0x23')](function(_0x1a6506){return _0x1a6506;});}return null;};}function removeEntity(_0x45e61f,_0x566995){return function(_0x2ac38b){if(_0x2ac38b){return _0x2ac38b['destroy']()[_0xf878('0x23')](function(){_0x45e61f[_0xf878('0x1d')](0xcc)[_0xf878('0x17')]();});}};}function handleEntityNotFound(_0x280036,_0x20449e){return function(_0x5ebaa0){if(!_0x5ebaa0){_0x280036['sendStatus'](0x194);}return _0x5ebaa0;};}function handleError(_0x59ba7b,_0x242926){_0x242926=_0x242926||0x1f4;return function(_0x3baba4){logger[_0xf878('0x24')](_0x3baba4['stack']);if(_0x3baba4[_0xf878('0x25')]){delete _0x3baba4[_0xf878('0x25')];}_0x59ba7b[_0xf878('0x1d')](_0x242926)[_0xf878('0x26')](_0x3baba4);};}exports[_0xf878('0x27')]=function(_0x5aff46,_0x502322){var _0x9a127d={},_0x5d9c97={},_0x4a0286={'count':0x0,'rows':[]};var _0x31e2e1=_['map'](db[_0xf878('0x28')]['rawAttributes'],function(_0x2c61c1){return{'name':_0x2c61c1['fieldName'],'type':_0x2c61c1[_0xf878('0x29')]['key']};});_0x5d9c97[_0xf878('0x2a')]=_[_0xf878('0x2b')](_0x31e2e1,_0xf878('0x25'));_0x5d9c97[_0xf878('0x2c')]=_[_0xf878('0x2d')](_0x5aff46[_0xf878('0x2c')]);_0x5d9c97['filters']=_[_0xf878('0x2e')](_0x5d9c97[_0xf878('0x2a')],_0x5d9c97[_0xf878('0x2c')]);_0x9a127d[_0xf878('0x2f')]=_[_0xf878('0x2e')](_0x5d9c97['model'],qs[_0xf878('0x30')](_0x5aff46[_0xf878('0x2c')]['fields']));_0x9a127d[_0xf878('0x2f')]=_0x9a127d[_0xf878('0x2f')][_0xf878('0x31')]?_0x9a127d[_0xf878('0x2f')]:_0x5d9c97[_0xf878('0x2a')];if(!_0x5aff46['query'][_0xf878('0x32')](_0xf878('0x33'))){_0x9a127d[_0xf878('0x1b')]=qs[_0xf878('0x1b')](_0x5aff46['query'][_0xf878('0x1b')]);_0x9a127d['offset']=qs['offset'](_0x5aff46[_0xf878('0x2c')][_0xf878('0x19')]);}_0x9a127d[_0xf878('0x34')]=qs[_0xf878('0x35')](_0x5aff46[_0xf878('0x2c')]['sort']);_0x9a127d[_0xf878('0x36')]=qs['filters'](_[_0xf878('0x37')](_0x5aff46[_0xf878('0x2c')],_0x5d9c97['filters']),_0x31e2e1);if(_0x5aff46[_0xf878('0x2c')][_0xf878('0x38')]){_0x9a127d['where']=_[_0xf878('0x39')](_0x9a127d[_0xf878('0x36')],{'$or':_['map'](_0x31e2e1,function(_0x4129c2){if(_0x4129c2[_0xf878('0x29')]!==_0xf878('0x3a')){var _0xc8eb91={};_0xc8eb91[_0x4129c2[_0xf878('0x25')]]={'$like':'%'+_0x5aff46[_0xf878('0x2c')][_0xf878('0x38')]+'%'};return _0xc8eb91;}})});}_0x9a127d=_['merge']({},_0x9a127d,_0x5aff46[_0xf878('0x3b')]);var _0x14340d={'where':_0x9a127d['where']};return db[_0xf878('0x28')]['count'](_0x14340d)['then'](function(_0x2ec109){_0x4a0286[_0xf878('0x1c')]=_0x2ec109;if(_0x5aff46[_0xf878('0x2c')][_0xf878('0x3c')]){_0x9a127d[_0xf878('0x3d')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xf878('0x3e')](_0x9a127d);})['then'](function(_0xb09736){_0x4a0286[_0xf878('0x3f')]=_0xb09736;return _0x4a0286;})['then'](respondWithFilteredResult(_0x502322,_0x9a127d))['catch'](handleError(_0x502322,null));};exports[_0xf878('0x40')]=function(_0x2a66c1,_0x13fcd3){var _0x2f6ee5={'raw':![],'where':{'id':_0x2a66c1[_0xf878('0x41')]['id']}},_0x5d6e03={};_0x5d6e03[_0xf878('0x2a')]=_[_0xf878('0x2d')](db[_0xf878('0x28')]['rawAttributes']);_0x5d6e03[_0xf878('0x2c')]=_[_0xf878('0x2d')](_0x2a66c1[_0xf878('0x2c')]);_0x5d6e03[_0xf878('0x42')]=_[_0xf878('0x2e')](_0x5d6e03[_0xf878('0x2a')],_0x5d6e03['query']);_0x2f6ee5[_0xf878('0x2f')]=_[_0xf878('0x2e')](_0x5d6e03[_0xf878('0x2a')],qs[_0xf878('0x30')](_0x2a66c1[_0xf878('0x2c')]['fields']));_0x2f6ee5[_0xf878('0x2f')]=_0x2f6ee5[_0xf878('0x2f')][_0xf878('0x31')]?_0x2f6ee5[_0xf878('0x2f')]:_0x5d6e03['model'];if(_0x2a66c1[_0xf878('0x2c')][_0xf878('0x3c')]){_0x2f6ee5[_0xf878('0x3d')]=[{'all':!![]}];}_0x2f6ee5=_['merge']({},_0x2f6ee5,_0x2a66c1['options']);return db[_0xf878('0x28')]['find'](_0x2f6ee5)['then'](handleEntityNotFound(_0x13fcd3,null))['then'](respondWithResult(_0x13fcd3,null))[_0xf878('0x43')](handleError(_0x13fcd3,null));};exports['create']=function(_0x156fdb,_0x450a10){return db[_0xf878('0x28')][_0xf878('0x44')](_0x156fdb[_0xf878('0x45')],{})[_0xf878('0x23')](respondWithResult(_0x450a10,0xc9))[_0xf878('0x43')](handleError(_0x450a10,null));};exports['update']=function(_0xb0bf4c,_0x361ac8){if(_0xb0bf4c[_0xf878('0x45')]['id']){delete _0xb0bf4c[_0xf878('0x45')]['id'];}return db[_0xf878('0x28')]['find']({'where':{'id':_0xb0bf4c['params']['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x361ac8,null))[_0xf878('0x23')](saveUpdates(_0xb0bf4c['body'],null))[_0xf878('0x23')](respondWithResult(_0x361ac8,null))['catch'](handleError(_0x361ac8,null));};exports[_0xf878('0x46')]=function(_0x31adde,_0x379912){return db[_0xf878('0x28')]['find']({'where':{'id':_0x31adde[_0xf878('0x41')]['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x379912,null))[_0xf878('0x23')](removeEntity(_0x379912,null))['catch'](handleError(_0x379912,null));};exports[_0xf878('0x47')]=function(_0x30df05,_0x1d3427,_0x28c393){var _0x53e3c3={};var _0x112f2a={};var _0x181f09;var _0x3f9fce;return db['ZendeskAccount'][_0xf878('0x48')]({'where':{'id':_0x30df05[_0xf878('0x41')]['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x1d3427,null))[_0xf878('0x23')](function(_0x5118f4){if(_0x5118f4){_0x181f09=_0x5118f4;_0x112f2a['model']=_['keys'](db[_0xf878('0x49')]['rawAttributes']);_0x112f2a['query']=_['keys'](_0x30df05[_0xf878('0x2c')]);_0x112f2a[_0xf878('0x42')]=_['intersection'](_0x112f2a[_0xf878('0x2a')],_0x112f2a[_0xf878('0x2c')]);_0x53e3c3[_0xf878('0x2f')]=_['intersection'](_0x112f2a['model'],qs[_0xf878('0x30')](_0x30df05['query'][_0xf878('0x30')]));_0x53e3c3[_0xf878('0x2f')]=_0x53e3c3[_0xf878('0x2f')][_0xf878('0x31')]?_0x53e3c3[_0xf878('0x2f')]:_0x112f2a[_0xf878('0x2a')];_0x53e3c3['order']=qs[_0xf878('0x35')](_0x30df05[_0xf878('0x2c')]['sort']);_0x53e3c3[_0xf878('0x36')]=qs[_0xf878('0x42')](_[_0xf878('0x37')](_0x30df05[_0xf878('0x2c')],_0x112f2a[_0xf878('0x42')]));if(_0x30df05[_0xf878('0x2c')][_0xf878('0x38')]){_0x53e3c3['where']=_[_0xf878('0x39')](_0x53e3c3[_0xf878('0x36')],{'$or':_[_0xf878('0x2b')](_0x53e3c3['attributes'],function(_0x392242){var _0x560e0b={};_0x560e0b[_0x392242]={'$like':'%'+_0x30df05[_0xf878('0x2c')][_0xf878('0x38')]+'%'};return _0x560e0b;})});}_0x53e3c3=_[_0xf878('0x39')]({},_0x53e3c3,_0x30df05[_0xf878('0x3b')]);return _0x181f09[_0xf878('0x47')](_0x53e3c3);}})[_0xf878('0x23')](function(_0x1141dd){if(_0x1141dd){_0x3f9fce=_0x1141dd[_0xf878('0x31')];if(!_0x30df05[_0xf878('0x2c')][_0xf878('0x32')]('nolimit')){_0x53e3c3['limit']=qs['limit'](_0x30df05[_0xf878('0x2c')]['limit']);_0x53e3c3[_0xf878('0x19')]=qs[_0xf878('0x19')](_0x30df05['query']['offset']);}return _0x181f09[_0xf878('0x47')](_0x53e3c3);}})[_0xf878('0x23')](function(_0x3340c1){if(_0x3340c1){return _0x3340c1?{'count':_0x3f9fce,'rows':_0x3340c1}:null;}})[_0xf878('0x23')](respondWithResult(_0x1d3427,null))[_0xf878('0x43')](handleError(_0x1d3427,null));};exports[_0xf878('0x4a')]=function(_0x3e78fc,_0x302258,_0x1602ed){if(_0x3e78fc[_0xf878('0x45')]['id']){delete _0x3e78fc[_0xf878('0x45')]['id'];}return db[_0xf878('0x28')][_0xf878('0x48')]({'where':{'id':_0x3e78fc[_0xf878('0x41')]['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x302258,null))[_0xf878('0x23')](function(_0x1254dd){if(_0x1254dd){_0x3e78fc[_0xf878('0x45')]['AccountId']=_0x1254dd['id'];_0x3e78fc[_0xf878('0x45')]['Subjects']=integrations[_0xf878('0x4b')](_0x3e78fc[_0xf878('0x45')][_0xf878('0x4c')],_0x3e78fc[_0xf878('0x45')][_0xf878('0x29')]);_0x3e78fc[_0xf878('0x45')][_0xf878('0x4d')]=integrations[_0xf878('0x4e')](_0x3e78fc[_0xf878('0x45')]['channel'],_0x3e78fc[_0xf878('0x45')][_0xf878('0x29')]);return db[_0xf878('0x49')][_0xf878('0x44')](_0x3e78fc['body'],{'include':[{'model':db[_0xf878('0x4f')],'as':_0xf878('0x50')},{'model':db[_0xf878('0x4f')],'as':_0xf878('0x4d')}]});}return null;})[_0xf878('0x23')](respondWithResult(_0x302258,null))['catch'](handleError(_0x302258,null));};exports['getFields']=function(_0x453644,_0x1b0230,_0x193f6c){var _0x251613='';return db[_0xf878('0x28')][_0xf878('0x48')]({'where':{'id':_0x453644[_0xf878('0x41')]['id']},'attributes':['id',_0xf878('0x51'),_0xf878('0x52'),_0xf878('0x53'),_0xf878('0x54'),_0xf878('0x55')]})[_0xf878('0x23')](handleEntityNotFound(_0x1b0230,null))[_0xf878('0x23')](function(_0x3bfd00){if(_0x3bfd00){_0x251613=_0x3bfd00[_0xf878('0x55')];var _0x153069=_0x251613['slice'](-0x1);if(_0x153069==='/'){_0x251613=_0x251613[_0xf878('0x56')](0x0,_0x251613[_0xf878('0x57')](_0x153069));}var _0x288235={'method':_0xf878('0x58'),'uri':util[_0xf878('0x59')](_0xf878('0x5a'),_0x251613,_0xf878('0x5b')),'json':!![]};switch(_0x3bfd00[_0xf878('0x54')]){case _0xf878('0x52'):_0x288235['headers']={'Authorization':util[_0xf878('0x59')](_0xf878('0x5c'),new Buffer(util[_0xf878('0x59')](_0xf878('0x5d'),_0x3bfd00[_0xf878('0x51')],_0x3bfd00[_0xf878('0x52')]))[_0xf878('0x5e')]('base64'))};break;case'token':_0x288235[_0xf878('0x5f')]={'Authorization':util['format'](_0xf878('0x5c'),new Buffer(util[_0xf878('0x59')](_0xf878('0x60'),_0x3bfd00[_0xf878('0x51')],_0x3bfd00['token']))[_0xf878('0x5e')](_0xf878('0x61')))};break;default:throw new db[(_0xf878('0x62'))][(_0xf878('0x63'))]('Unknown\x20authentication\x20type');}return rp(_0x288235);}})[_0xf878('0x23')](function(_0x565e8c){if(_0x565e8c){var _0x21537f=[_0xf878('0x64'),_0xf878('0x65'),_0xf878('0x66'),_0xf878('0x67')];_['remove'](_0x565e8c[_0xf878('0x5b')],function(_0x21c5d1){return _0x21537f[_0xf878('0x68')](_0x21c5d1[_0xf878('0x29')]);});return{'count':_0x565e8c['ticket_fields'][_0xf878('0x31')],'rows':_['map'](_0x565e8c[_0xf878('0x5b')],function(_0x107456){return{'id':_0x107456['id'],'name':_0x107456[_0xf878('0x69')]>0x7?_0x107456[_0xf878('0x6a')]:_0x107456[_0xf878('0x29')],'custom':_0x107456[_0xf878('0x69')]>0x7?!![]:![],'options':_0x107456[_0xf878('0x6b')]?_0x107456[_0xf878('0x6b')]:_0x107456['custom_field_options']?_0x107456['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x1b0230,null))[_0xf878('0x43')](function(_0x1a9af7){var _0x497b7a=_0x453644['query'][_0xf878('0x6c')]?0x1f4:_0x1a9af7['statusCode']||0x1f4;logger[_0xf878('0x24')](_0xf878('0x6d'),_0xf878('0x6e'),_0x497b7a,JSON[_0xf878('0x6f')](_0x1a9af7));delete _0x1a9af7[_0xf878('0x25')];if(_0x497b7a===0x191){_0x497b7a=0x190;}_0x1b0230[_0xf878('0x1d')](_0x497b7a)[_0xf878('0x26')](_0x453644[_0xf878('0x2c')][_0xf878('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x1a9af7[_0xf878('0x70')]}:_0x1a9af7);});}; \ No newline at end of file +var _0xe706=['getConfigurations','findOne','ZendeskConfiguration','pick','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','channel','ZendeskField','getFields','username','token','authType','remoteUri','slice','substring','GET','format','password','headers','Basic\x20%s','base64','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','remove','includes','ticket_fields','title','position','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','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','../../components/integrations/configuration','sendStatus','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','ZendeskAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','findAll','rows','show','includeAll','include','find','create','body','catch','params'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0xe706,0xa3));var _0x6e70=function(_0x59cf8a,_0x163bb9){_0x59cf8a=_0x59cf8a-0x0;var _0x22dde8=_0xe706[_0x59cf8a];return _0x22dde8;};'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'];var integrations=require(_0x6e70('0x1d'));function respondWithStatusCode(_0x3b38f3,_0x310eb7){_0x310eb7=_0x310eb7||0xcc;return function(_0xa1eb74){if(_0xa1eb74){return _0x3b38f3[_0x6e70('0x1e')](_0x310eb7);}return _0x3b38f3['status'](_0x310eb7)['end']();};}function respondWithResult(_0x48bc72,_0x257e81){_0x257e81=_0x257e81||0xc8;return function(_0x5a37a6){if(_0x5a37a6){return _0x48bc72['status'](_0x257e81)[_0x6e70('0x1f')](_0x5a37a6);}};}function respondWithFilteredResult(_0x22c50c,_0x5d9263){return function(_0x24f3ac){if(_0x24f3ac){var _0x5c3fe7=typeof _0x5d9263[_0x6e70('0x20')]===_0x6e70('0x21')&&typeof _0x5d9263['limit']==='undefined';var _0x3bd572=_0x24f3ac['count'];var _0x28a21f=_0x5c3fe7?0x0:_0x5d9263[_0x6e70('0x20')];var _0x53acdc=_0x5c3fe7?_0x24f3ac['count']:_0x5d9263[_0x6e70('0x20')]+_0x5d9263[_0x6e70('0x22')];var _0x2368eb;if(_0x53acdc>=_0x3bd572){_0x53acdc=_0x3bd572;_0x2368eb=0xc8;}else{_0x2368eb=0xce;}_0x22c50c[_0x6e70('0x23')](_0x2368eb);return _0x22c50c[_0x6e70('0x24')](_0x6e70('0x25'),_0x28a21f+'-'+_0x53acdc+'/'+_0x3bd572)[_0x6e70('0x1f')](_0x24f3ac);}return null;};}function patchUpdates(_0x44a49f){return function(_0x29326f){try{jsonpatch[_0x6e70('0x26')](_0x29326f,_0x44a49f,!![]);}catch(_0x4a0cfe){return BPromise[_0x6e70('0x27')](_0x4a0cfe);}return _0x29326f[_0x6e70('0x28')]();};}function saveUpdates(_0x27b294,_0x502b2d){return function(_0x3ccd87){if(_0x3ccd87){return _0x3ccd87[_0x6e70('0x29')](_0x27b294)[_0x6e70('0x2a')](function(_0x50da2c){return _0x50da2c;});}return null;};}function removeEntity(_0x10fc91,_0x538b9c){return function(_0x50aec2){if(_0x50aec2){return _0x50aec2['destroy']()[_0x6e70('0x2a')](function(){_0x10fc91[_0x6e70('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ecdf1,_0x1196ed){return function(_0x5f268f){if(!_0x5f268f){_0x3ecdf1[_0x6e70('0x1e')](0x194);}return _0x5f268f;};}function handleError(_0x67fb43,_0x2bb231){_0x2bb231=_0x2bb231||0x1f4;return function(_0x4a67ac){logger['error'](_0x4a67ac[_0x6e70('0x2b')]);if(_0x4a67ac[_0x6e70('0x2c')]){delete _0x4a67ac[_0x6e70('0x2c')];}_0x67fb43[_0x6e70('0x23')](_0x2bb231)[_0x6e70('0x2d')](_0x4a67ac);};}exports['index']=function(_0x1952ea,_0x406f29){var _0xecf336={},_0x2864a0={},_0x396a67={'count':0x0,'rows':[]};var _0x20a225=_[_0x6e70('0x2e')](db[_0x6e70('0x2f')][_0x6e70('0x30')],function(_0x3a5d30){return{'name':_0x3a5d30['fieldName'],'type':_0x3a5d30[_0x6e70('0x31')]['key']};});_0x2864a0[_0x6e70('0x32')]=_['map'](_0x20a225,_0x6e70('0x2c'));_0x2864a0[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x1952ea['query']);_0x2864a0[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x2864a0['model'],_0x2864a0[_0x6e70('0x33')]);_0xecf336[_0x6e70('0x37')]=_['intersection'](_0x2864a0[_0x6e70('0x32')],qs[_0x6e70('0x38')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x38')]));_0xecf336[_0x6e70('0x37')]=_0xecf336[_0x6e70('0x37')][_0x6e70('0x39')]?_0xecf336[_0x6e70('0x37')]:_0x2864a0[_0x6e70('0x32')];if(!_0x1952ea[_0x6e70('0x33')]['hasOwnProperty'](_0x6e70('0x3a'))){_0xecf336['limit']=qs[_0x6e70('0x22')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x22')]);_0xecf336[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x20')]);}_0xecf336[_0x6e70('0x3b')]=qs[_0x6e70('0x3c')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3c')]);_0xecf336[_0x6e70('0x3d')]=qs[_0x6e70('0x35')](_['pick'](_0x1952ea['query'],_0x2864a0['filters']),_0x20a225);if(_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3e')]){_0xecf336[_0x6e70('0x3d')]=_[_0x6e70('0x3f')](_0xecf336[_0x6e70('0x3d')],{'$or':_[_0x6e70('0x2e')](_0x20a225,function(_0x572a71){if(_0x572a71[_0x6e70('0x31')]!==_0x6e70('0x40')){var _0x1c5cde={};_0x1c5cde[_0x572a71[_0x6e70('0x2c')]]={'$like':'%'+_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3e')]+'%'};return _0x1c5cde;}})});}_0xecf336=_[_0x6e70('0x3f')]({},_0xecf336,_0x1952ea[_0x6e70('0x41')]);var _0x5be100={'where':_0xecf336[_0x6e70('0x3d')]};return db[_0x6e70('0x2f')][_0x6e70('0x42')](_0x5be100)[_0x6e70('0x2a')](function(_0x201da9){_0x396a67[_0x6e70('0x42')]=_0x201da9;if(_0x1952ea[_0x6e70('0x33')]['includeAll']){_0xecf336['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x6e70('0x43')](_0xecf336);})[_0x6e70('0x2a')](function(_0x83847b){_0x396a67[_0x6e70('0x44')]=_0x83847b;return _0x396a67;})[_0x6e70('0x2a')](respondWithFilteredResult(_0x406f29,_0xecf336))['catch'](handleError(_0x406f29,null));};exports[_0x6e70('0x45')]=function(_0x2a58d7,_0x2a2aca){var _0x52b197={'raw':![],'where':{'id':_0x2a58d7['params']['id']}},_0x544ad0={};_0x544ad0[_0x6e70('0x32')]=_['keys'](db[_0x6e70('0x2f')][_0x6e70('0x30')]);_0x544ad0[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x2a58d7['query']);_0x544ad0[_0x6e70('0x35')]=_['intersection'](_0x544ad0[_0x6e70('0x32')],_0x544ad0[_0x6e70('0x33')]);_0x52b197[_0x6e70('0x37')]=_[_0x6e70('0x36')](_0x544ad0['model'],qs[_0x6e70('0x38')](_0x2a58d7[_0x6e70('0x33')][_0x6e70('0x38')]));_0x52b197[_0x6e70('0x37')]=_0x52b197[_0x6e70('0x37')][_0x6e70('0x39')]?_0x52b197[_0x6e70('0x37')]:_0x544ad0['model'];if(_0x2a58d7[_0x6e70('0x33')][_0x6e70('0x46')]){_0x52b197[_0x6e70('0x47')]=[{'all':!![]}];}_0x52b197=_[_0x6e70('0x3f')]({},_0x52b197,_0x2a58d7[_0x6e70('0x41')]);return db[_0x6e70('0x2f')][_0x6e70('0x48')](_0x52b197)['then'](handleEntityNotFound(_0x2a2aca,null))[_0x6e70('0x2a')](respondWithResult(_0x2a2aca,null))['catch'](handleError(_0x2a2aca,null));};exports[_0x6e70('0x49')]=function(_0x3836e4,_0x4b351e){return db['ZendeskAccount'][_0x6e70('0x49')](_0x3836e4[_0x6e70('0x4a')],{})[_0x6e70('0x2a')](respondWithResult(_0x4b351e,0xc9))['catch'](handleError(_0x4b351e,null));};exports['update']=function(_0x238ebb,_0x11ac3d){if(_0x238ebb[_0x6e70('0x4a')]['id']){delete _0x238ebb[_0x6e70('0x4a')]['id'];}return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x238ebb['params']['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x11ac3d,null))[_0x6e70('0x2a')](saveUpdates(_0x238ebb[_0x6e70('0x4a')],null))[_0x6e70('0x2a')](respondWithResult(_0x11ac3d,null))[_0x6e70('0x4b')](handleError(_0x11ac3d,null));};exports['destroy']=function(_0x4ae901,_0x2c5538){return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x4ae901[_0x6e70('0x4c')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x2c5538,null))['then'](removeEntity(_0x2c5538,null))[_0x6e70('0x4b')](handleError(_0x2c5538,null));};exports[_0x6e70('0x4d')]=function(_0x1fa320,_0x23ebfb,_0x3aba34){var _0x4a111a={};var _0x1142cd={};var _0x1dd242;var _0x2c20d3;return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x1fa320[_0x6e70('0x4c')]['id']}})['then'](handleEntityNotFound(_0x23ebfb,null))[_0x6e70('0x2a')](function(_0x8d425d){if(_0x8d425d){_0x1dd242=_0x8d425d;_0x1142cd['model']=_[_0x6e70('0x34')](db[_0x6e70('0x4f')]['rawAttributes']);_0x1142cd[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x1fa320[_0x6e70('0x33')]);_0x1142cd[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x1142cd['model'],_0x1142cd[_0x6e70('0x33')]);_0x4a111a[_0x6e70('0x37')]=_[_0x6e70('0x36')](_0x1142cd[_0x6e70('0x32')],qs[_0x6e70('0x38')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x38')]));_0x4a111a[_0x6e70('0x37')]=_0x4a111a[_0x6e70('0x37')][_0x6e70('0x39')]?_0x4a111a[_0x6e70('0x37')]:_0x1142cd[_0x6e70('0x32')];_0x4a111a[_0x6e70('0x3b')]=qs[_0x6e70('0x3c')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x3c')]);_0x4a111a[_0x6e70('0x3d')]=qs[_0x6e70('0x35')](_[_0x6e70('0x50')](_0x1fa320[_0x6e70('0x33')],_0x1142cd['filters']));if(_0x1fa320[_0x6e70('0x33')][_0x6e70('0x3e')]){_0x4a111a[_0x6e70('0x3d')]=_[_0x6e70('0x3f')](_0x4a111a[_0x6e70('0x3d')],{'$or':_[_0x6e70('0x2e')](_0x4a111a['attributes'],function(_0x42bd85){var _0x6cabf0={};_0x6cabf0[_0x42bd85]={'$like':'%'+_0x1fa320['query'][_0x6e70('0x3e')]+'%'};return _0x6cabf0;})});}_0x4a111a=_[_0x6e70('0x3f')]({},_0x4a111a,_0x1fa320[_0x6e70('0x41')]);return _0x1dd242['getConfigurations'](_0x4a111a);}})['then'](function(_0x2f9be4){if(_0x2f9be4){_0x2c20d3=_0x2f9be4[_0x6e70('0x39')];if(!_0x1fa320[_0x6e70('0x33')][_0x6e70('0x51')](_0x6e70('0x3a'))){_0x4a111a[_0x6e70('0x22')]=qs[_0x6e70('0x22')](_0x1fa320['query']['limit']);_0x4a111a[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x20')]);}return _0x1dd242['getConfigurations'](_0x4a111a);}})['then'](function(_0x2e972b){if(_0x2e972b){return _0x2e972b?{'count':_0x2c20d3,'rows':_0x2e972b}:null;}})[_0x6e70('0x2a')](respondWithResult(_0x23ebfb,null))['catch'](handleError(_0x23ebfb,null));};exports['addConfiguration']=function(_0x355708,_0x47fbed,_0x2a8fb7){if(_0x355708[_0x6e70('0x4a')]['id']){delete _0x355708[_0x6e70('0x4a')]['id'];}return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x355708[_0x6e70('0x4c')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x47fbed,null))[_0x6e70('0x2a')](function(_0x570115){if(_0x570115){_0x355708[_0x6e70('0x4a')][_0x6e70('0x52')]=_0x570115['id'];_0x355708[_0x6e70('0x4a')][_0x6e70('0x53')]=integrations[_0x6e70('0x54')](_0x355708['body']['channel'],_0x355708['body'][_0x6e70('0x31')]);_0x355708[_0x6e70('0x4a')][_0x6e70('0x55')]=integrations['getDescriptions'](_0x355708['body'][_0x6e70('0x56')],_0x355708[_0x6e70('0x4a')][_0x6e70('0x31')]);return db[_0x6e70('0x4f')][_0x6e70('0x49')](_0x355708[_0x6e70('0x4a')],{'include':[{'model':db['ZendeskField'],'as':_0x6e70('0x53')},{'model':db[_0x6e70('0x57')],'as':_0x6e70('0x55')}]});}return null;})[_0x6e70('0x2a')](respondWithResult(_0x47fbed,null))['catch'](handleError(_0x47fbed,null));};exports[_0x6e70('0x58')]=function(_0x531097,_0x5b4046,_0x30487b){var _0x3249a5='';return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x531097[_0x6e70('0x4c')]['id']},'attributes':['id',_0x6e70('0x59'),'password',_0x6e70('0x5a'),_0x6e70('0x5b'),_0x6e70('0x5c')]})[_0x6e70('0x2a')](handleEntityNotFound(_0x5b4046,null))[_0x6e70('0x2a')](function(_0x13c092){if(_0x13c092){_0x3249a5=_0x13c092[_0x6e70('0x5c')];var _0xd9b4a9=_0x3249a5[_0x6e70('0x5d')](-0x1);if(_0xd9b4a9==='/'){_0x3249a5=_0x3249a5[_0x6e70('0x5e')](0x0,_0x3249a5['lastIndexOf'](_0xd9b4a9));}var _0x44c877={'method':_0x6e70('0x5f'),'uri':util[_0x6e70('0x60')]('%s/%s',_0x3249a5,'ticket_fields'),'json':!![]};switch(_0x13c092[_0x6e70('0x5b')]){case _0x6e70('0x61'):_0x44c877[_0x6e70('0x62')]={'Authorization':util[_0x6e70('0x60')](_0x6e70('0x63'),new Buffer(util['format']('%s:%s',_0x13c092[_0x6e70('0x59')],_0x13c092[_0x6e70('0x61')]))['toString'](_0x6e70('0x64')))};break;case _0x6e70('0x5a'):_0x44c877[_0x6e70('0x62')]={'Authorization':util[_0x6e70('0x60')](_0x6e70('0x63'),new Buffer(util[_0x6e70('0x60')](_0x6e70('0x65'),_0x13c092[_0x6e70('0x59')],_0x13c092[_0x6e70('0x5a')]))[_0x6e70('0x66')](_0x6e70('0x64')))};break;default:throw new db[(_0x6e70('0x67'))][(_0x6e70('0x68'))](_0x6e70('0x69'));}return rp(_0x44c877);}})['then'](function(_0x5b3cb0){if(_0x5b3cb0){var _0x39ed95=['subject',_0x6e70('0x6a'),'group','assignee'];_[_0x6e70('0x6b')](_0x5b3cb0['ticket_fields'],function(_0x576069){return _0x39ed95[_0x6e70('0x6c')](_0x576069[_0x6e70('0x31')]);});return{'count':_0x5b3cb0[_0x6e70('0x6d')]['length'],'rows':_['map'](_0x5b3cb0['ticket_fields'],function(_0x3e7be7){return{'id':_0x3e7be7['id'],'name':_0x3e7be7['position']>0x7?_0x3e7be7[_0x6e70('0x6e')]:_0x3e7be7[_0x6e70('0x31')],'custom':_0x3e7be7[_0x6e70('0x6f')]>0x7?!![]:![],'options':_0x3e7be7[_0x6e70('0x70')]?_0x3e7be7[_0x6e70('0x70')]:_0x3e7be7[_0x6e70('0x71')]?_0x3e7be7[_0x6e70('0x71')]:[]};})};}})['then'](respondWithResult(_0x5b4046,null))[_0x6e70('0x4b')](function(_0x2493b0){var _0xb649a6=_0x531097['query'][_0x6e70('0x72')]?0x1f4:_0x2493b0[_0x6e70('0x73')]||0x1f4;logger[_0x6e70('0x74')](_0x6e70('0x75'),_0x6e70('0x58'),_0xb649a6,JSON[_0x6e70('0x76')](_0x2493b0));delete _0x2493b0[_0x6e70('0x2c')];if(_0xb649a6===0x191){_0xb649a6=0x190;}_0x5b4046[_0x6e70('0x23')](_0xb649a6)[_0x6e70('0x2d')](_0x531097['query'][_0x6e70('0x72')]?{'message':_0x6e70('0x77'),'statusCode':_0x2493b0['statusCode']}:_0x2493b0);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 2ef3419..62cf0e0 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 _0x9ad1=['../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3fd724,_0x197795){var _0x4cbcc3=function(_0x3d5a23){while(--_0x3d5a23){_0x3fd724['push'](_0x3fd724['shift']());}};_0x4cbcc3(++_0x197795);}(_0x9ad1,0x13a));var _0x19ad=function(_0x461cbc,_0x2e6552){_0x461cbc=_0x461cbc-0x0;var _0x33d98a=_0x9ad1[_0x461cbc];return _0x33d98a;};'use strict';var _=require(_0x19ad('0x0'));var util=require(_0x19ad('0x1'));var logger=require(_0x19ad('0x2'))('api');var moment=require(_0x19ad('0x3'));var BPromise=require(_0x19ad('0x4'));var rp=require(_0x19ad('0x5'));var fs=require('fs');var path=require(_0x19ad('0x6'));var rimraf=require(_0x19ad('0x7'));var config=require(_0x19ad('0x8'));var attributes=require(_0x19ad('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x19ad('0xa')]=function(_0x1cdafc,_0x2bb4b8){return _0x1cdafc[_0x19ad('0xb')](_0x19ad('0xc'),attributes,{'tableName':_0x19ad('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc359=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts'];(function(_0x6cb2e4,_0x513971){var _0x2ece1f=function(_0x7619d4){while(--_0x7619d4){_0x6cb2e4['push'](_0x6cb2e4['shift']());}};_0x2ece1f(++_0x513971);}(_0xc359,0xa8));var _0x9c35=function(_0x349915,_0x124261){_0x349915=_0x349915-0x0;var _0x8be4f3=_0xc359[_0x349915];return _0x8be4f3;};'use strict';var _=require(_0x9c35('0x0'));var util=require(_0x9c35('0x1'));var logger=require(_0x9c35('0x2'))(_0x9c35('0x3'));var moment=require('moment');var BPromise=require(_0x9c35('0x4'));var rp=require(_0x9c35('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c35('0x6'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x9c35('0x7'));module[_0x9c35('0x8')]=function(_0x52d4ee,_0x3cb389){return _0x52d4ee[_0x9c35('0x9')](_0x9c35('0xa'),attributes,{'tableName':_0x9c35('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 3b2ddb9..821472f 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 _0x20ae=['limit','include','map','model','ShowZendeskAccount','find','then','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetZendeskAccount','ZendeskAccount','options','where','attributes'];(function(_0x408eb1,_0x46e892){var _0x554531=function(_0x3063a9){while(--_0x3063a9){_0x408eb1['push'](_0x408eb1['shift']());}};_0x554531(++_0x46e892);}(_0x20ae,0x120));var _0xe20a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x20ae[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xe20a('0x0'));var util=require(_0xe20a('0x1'));var moment=require('moment');var BPromise=require(_0xe20a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe20a('0x3'));var db=require(_0xe20a('0x4'))['db'];var utils=require(_0xe20a('0x5'));var logger=require(_0xe20a('0x6'))(_0xe20a('0x7'));var config=require(_0xe20a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe20a('0x9')][_0xe20a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x518a98,_0x7cb0d7,_0x992662){return new BPromise(function(_0x4545e2,_0x21c7f0){return client[_0xe20a('0xb')](_0x518a98,_0x992662)['then'](function(_0x247d65){logger['info'](_0xe20a('0xc'),_0x7cb0d7,_0xe20a('0xd'));logger[_0xe20a('0xe')](_0xe20a('0xf'),_0x7cb0d7,'request\x20sent',JSON[_0xe20a('0x10')](_0x247d65));if(_0x247d65[_0xe20a('0x11')]){if(_0x247d65[_0xe20a('0x11')][_0xe20a('0x12')]===0x1f4){logger[_0xe20a('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x7cb0d7,_0x247d65[_0xe20a('0x11')][_0xe20a('0x13')]);return _0x21c7f0(_0x247d65['error'][_0xe20a('0x13')]);}logger[_0xe20a('0x11')](_0xe20a('0xc'),_0x7cb0d7,_0x247d65[_0xe20a('0x11')]['message']);return _0x4545e2(_0x247d65[_0xe20a('0x11')][_0xe20a('0x13')]);}else{logger[_0xe20a('0x14')](_0xe20a('0xc'),_0x7cb0d7,'request\x20sent');_0x4545e2(_0x247d65[_0xe20a('0x15')][_0xe20a('0x13')]);}})['catch'](function(_0xc9b3e0){logger[_0xe20a('0x11')](_0xe20a('0xc'),_0x7cb0d7,_0xc9b3e0);_0x21c7f0(_0xc9b3e0);});});}exports[_0xe20a('0x16')]=function(_0xd342a){var _0x5f4335=this;return new Promise(function(_0x2890b3,_0x5164fc){return db[_0xe20a('0x17')]['findAll']({'raw':_0xd342a[_0xe20a('0x18')]?_0xd342a[_0xe20a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xd342a[_0xe20a('0x18')]?_0xd342a[_0xe20a('0x18')][_0xe20a('0x19')]||null:null,'attributes':_0xd342a['options']?_0xd342a[_0xe20a('0x18')][_0xe20a('0x1a')]||null:null,'limit':_0xd342a[_0xe20a('0x18')]?_0xd342a[_0xe20a('0x18')][_0xe20a('0x1b')]||null:null,'include':_0xd342a[_0xe20a('0x18')]?_0xd342a[_0xe20a('0x18')][_0xe20a('0x1c')]?_[_0xe20a('0x1d')](_0xd342a[_0xe20a('0x18')][_0xe20a('0x1c')],function(_0x102933){return{'model':db[_0x102933[_0xe20a('0x1e')]],'as':_0x102933['as'],'attributes':_0x102933['attributes'],'include':_0x102933['include']?_[_0xe20a('0x1d')](_0x102933[_0xe20a('0x1c')],function(_0x49f41f){return{'model':db[_0x49f41f[_0xe20a('0x1e')]],'as':_0x49f41f['as'],'attributes':_0x49f41f[_0xe20a('0x1a')],'include':_0x49f41f[_0xe20a('0x1c')]?_['map'](_0x49f41f[_0xe20a('0x1c')],function(_0x450b86){return{'model':db[_0x450b86[_0xe20a('0x1e')]],'as':_0x450b86['as'],'attributes':_0x450b86['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2de7ad){logger[_0xe20a('0x14')](_0xe20a('0x16'),_0xd342a);logger['debug'](_0xe20a('0x16'),_0xd342a,JSON['stringify'](_0x2de7ad));_0x2890b3(_0x2de7ad);})['catch'](function(_0x16bfe3){logger[_0xe20a('0x11')](_0xe20a('0x16'),_0x16bfe3['message'],_0xd342a);_0x5164fc(_0x5f4335[_0xe20a('0x11')](0x1f4,_0x16bfe3[_0xe20a('0x13')]));});});};exports[_0xe20a('0x1f')]=function(_0x3eddfd){var _0x274fa3=this;return new Promise(function(_0x4df811,_0x2be362){return db[_0xe20a('0x17')][_0xe20a('0x20')]({'raw':_0x3eddfd[_0xe20a('0x18')]?_0x3eddfd['options']['raw']===undefined?!![]:![]:!![],'where':_0x3eddfd[_0xe20a('0x18')]?_0x3eddfd[_0xe20a('0x18')][_0xe20a('0x19')]||null:null,'attributes':_0x3eddfd[_0xe20a('0x18')]?_0x3eddfd[_0xe20a('0x18')][_0xe20a('0x1a')]||null:null,'include':_0x3eddfd[_0xe20a('0x18')]?_0x3eddfd[_0xe20a('0x18')][_0xe20a('0x1c')]?_[_0xe20a('0x1d')](_0x3eddfd[_0xe20a('0x18')][_0xe20a('0x1c')],function(_0x3d6a83){return{'model':db[_0x3d6a83[_0xe20a('0x1e')]],'as':_0x3d6a83['as'],'attributes':_0x3d6a83[_0xe20a('0x1a')],'include':_0x3d6a83[_0xe20a('0x1c')]?_[_0xe20a('0x1d')](_0x3d6a83[_0xe20a('0x1c')],function(_0x58a78a){return{'model':db[_0x58a78a[_0xe20a('0x1e')]],'as':_0x58a78a['as'],'attributes':_0x58a78a[_0xe20a('0x1a')],'include':_0x58a78a[_0xe20a('0x1c')]?_['map'](_0x58a78a['include'],function(_0x3fe789){return{'model':db[_0x3fe789[_0xe20a('0x1e')]],'as':_0x3fe789['as'],'attributes':_0x3fe789['attributes']};}):[]};}):[]};}):[]:[]})[_0xe20a('0x21')](function(_0x76ce1f){logger[_0xe20a('0x14')](_0xe20a('0x1f'),_0x3eddfd);logger[_0xe20a('0xe')](_0xe20a('0x1f'),_0x3eddfd,JSON[_0xe20a('0x10')](_0x76ce1f));_0x4df811(_0x76ce1f);})[_0xe20a('0x22')](function(_0x185cb7){logger[_0xe20a('0x11')]('ShowZendeskAccount',_0x185cb7[_0xe20a('0x13')],_0x3eddfd);_0x2be362(_0x274fa3['error'](0x1f4,_0x185cb7[_0xe20a('0x13')]));});});}; \ No newline at end of file +var _0x63f1=['../../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','findAll','options','raw','where','attributes','limit','map','include','model','ShowZendeskAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x873744,_0x2c8dbb){var _0x3361ac=function(_0x28f444){while(--_0x28f444){_0x873744['push'](_0x873744['shift']());}};_0x3361ac(++_0x2c8dbb);}(_0x63f1,0x1da));var _0x163f=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x63f1[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x163f('0x0'));var util=require(_0x163f('0x1'));var moment=require('moment');var BPromise=require(_0x163f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x163f('0x3'));var db=require(_0x163f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x163f('0x5'))(_0x163f('0x6'));var config=require(_0x163f('0x7'));var jayson=require(_0x163f('0x8'));var client=jayson[_0x163f('0x9')][_0x163f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30b27b,_0x366f8f,_0x59813b){return new BPromise(function(_0x11c52b,_0x1eeef8){return client[_0x163f('0xb')](_0x30b27b,_0x59813b)[_0x163f('0xc')](function(_0x58a03d){logger[_0x163f('0xd')](_0x163f('0xe'),_0x366f8f,_0x163f('0xf'));logger[_0x163f('0x10')](_0x163f('0x11'),_0x366f8f,'request\x20sent',JSON[_0x163f('0x12')](_0x58a03d));if(_0x58a03d[_0x163f('0x13')]){if(_0x58a03d['error'][_0x163f('0x14')]===0x1f4){logger[_0x163f('0x13')](_0x163f('0xe'),_0x366f8f,_0x58a03d[_0x163f('0x13')]['message']);return _0x1eeef8(_0x58a03d[_0x163f('0x13')][_0x163f('0x15')]);}logger[_0x163f('0x13')](_0x163f('0xe'),_0x366f8f,_0x58a03d[_0x163f('0x13')][_0x163f('0x15')]);return _0x11c52b(_0x58a03d[_0x163f('0x13')][_0x163f('0x15')]);}else{logger[_0x163f('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x366f8f,_0x163f('0xf'));_0x11c52b(_0x58a03d[_0x163f('0x16')][_0x163f('0x15')]);}})[_0x163f('0x17')](function(_0x325b9b){logger['error'](_0x163f('0xe'),_0x366f8f,_0x325b9b);_0x1eeef8(_0x325b9b);});});}exports[_0x163f('0x18')]=function(_0x558191){var _0xc28657=this;return new Promise(function(_0x44e0e3,_0x393bd1){return db[_0x163f('0x19')][_0x163f('0x1a')]({'raw':_0x558191[_0x163f('0x1b')]?_0x558191['options'][_0x163f('0x1c')]===undefined?!![]:![]:!![],'where':_0x558191[_0x163f('0x1b')]?_0x558191['options'][_0x163f('0x1d')]||null:null,'attributes':_0x558191['options']?_0x558191[_0x163f('0x1b')][_0x163f('0x1e')]||null:null,'limit':_0x558191[_0x163f('0x1b')]?_0x558191[_0x163f('0x1b')][_0x163f('0x1f')]||null:null,'include':_0x558191[_0x163f('0x1b')]?_0x558191[_0x163f('0x1b')]['include']?_[_0x163f('0x20')](_0x558191['options']['include'],function(_0x371c22){return{'model':db[_0x371c22['model']],'as':_0x371c22['as'],'attributes':_0x371c22[_0x163f('0x1e')],'include':_0x371c22[_0x163f('0x21')]?_[_0x163f('0x20')](_0x371c22[_0x163f('0x21')],function(_0x380124){return{'model':db[_0x380124[_0x163f('0x22')]],'as':_0x380124['as'],'attributes':_0x380124[_0x163f('0x1e')],'include':_0x380124[_0x163f('0x21')]?_[_0x163f('0x20')](_0x380124['include'],function(_0xf03f21){return{'model':db[_0xf03f21[_0x163f('0x22')]],'as':_0xf03f21['as'],'attributes':_0xf03f21[_0x163f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35e6e9){logger[_0x163f('0xd')](_0x163f('0x18'),_0x558191);logger[_0x163f('0x10')](_0x163f('0x18'),_0x558191,JSON[_0x163f('0x12')](_0x35e6e9));_0x44e0e3(_0x35e6e9);})[_0x163f('0x17')](function(_0x45e7f9){logger['error']('GetZendeskAccount',_0x45e7f9[_0x163f('0x15')],_0x558191);_0x393bd1(_0xc28657[_0x163f('0x13')](0x1f4,_0x45e7f9[_0x163f('0x15')]));});});};exports[_0x163f('0x23')]=function(_0x55f05c){var _0x424975=this;return new Promise(function(_0x3f8f07,_0x39a314){return db[_0x163f('0x19')][_0x163f('0x24')]({'raw':_0x55f05c[_0x163f('0x1b')]?_0x55f05c[_0x163f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x55f05c[_0x163f('0x1b')]?_0x55f05c[_0x163f('0x1b')]['where']||null:null,'attributes':_0x55f05c['options']?_0x55f05c[_0x163f('0x1b')][_0x163f('0x1e')]||null:null,'include':_0x55f05c[_0x163f('0x1b')]?_0x55f05c[_0x163f('0x1b')]['include']?_[_0x163f('0x20')](_0x55f05c[_0x163f('0x1b')][_0x163f('0x21')],function(_0x2fd658){return{'model':db[_0x2fd658[_0x163f('0x22')]],'as':_0x2fd658['as'],'attributes':_0x2fd658['attributes'],'include':_0x2fd658[_0x163f('0x21')]?_['map'](_0x2fd658[_0x163f('0x21')],function(_0x1bdfa7){return{'model':db[_0x1bdfa7['model']],'as':_0x1bdfa7['as'],'attributes':_0x1bdfa7[_0x163f('0x1e')],'include':_0x1bdfa7[_0x163f('0x21')]?_['map'](_0x1bdfa7[_0x163f('0x21')],function(_0x47914c){return{'model':db[_0x47914c['model']],'as':_0x47914c['as'],'attributes':_0x47914c[_0x163f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x163f('0xc')](function(_0x144b59){logger[_0x163f('0xd')](_0x163f('0x23'),_0x55f05c);logger[_0x163f('0x10')](_0x163f('0x23'),_0x55f05c,JSON[_0x163f('0x12')](_0x144b59));_0x3f8f07(_0x144b59);})[_0x163f('0x17')](function(_0x3374d1){logger[_0x163f('0x13')]('ShowZendeskAccount',_0x3374d1[_0x163f('0x15')],_0x55f05c);_0x39a314(_0x424975['error'](0x1f4,_0x3374d1[_0x163f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index e09659a..37a3123 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 _0xb7e7=['delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','put','update'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xb7e7,0x121));var _0x7b7e=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xb7e7[_0x164eca];return _0x2ce562;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x8')](_0x7b7e('0x12'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router['post']('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x7b7e('0x15')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7b7e('0x18')]);module[_0x7b7e('0x19')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x30750d,_0x1739db){var _0x158dbc=function(_0x3e993d){while(--_0x3e993d){_0x30750d['push'](_0x30750d['shift']());}};_0x158dbc(++_0x1739db);}(_0xda3f,0xec));var _0xfda3=function(_0x2f71b4,_0x4db8dd){_0x2f71b4=_0x2f71b4-0x0;var _0x165442=_0xda3f[_0x2f71b4];return _0x165442;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index ed54ca6..37344f8 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 _0x1a31=['STRING'];(function(_0x15b66d,_0x314999){var _0x134140=function(_0x2c928a){while(--_0x2c928a){_0x15b66d['push'](_0x15b66d['shift']());}};_0x134140(++_0x314999);}(_0x1a31,0x1d4));var _0x11a3=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x1a31[_0x39c734];return _0xb2a2f9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x11a3('0x0')]},'description':{'type':Sequelize[_0x11a3('0x0')]}}; \ No newline at end of file +var _0x45eb=['STRING','sequelize','exports'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x45eb,0x130));var _0xb45e=function(_0x5547a2,_0x542329){_0x5547a2=_0x5547a2-0x0;var _0xee1b5c=_0x45eb[_0x5547a2];return _0xee1b5c;};'use strict';var Sequelize=require(_0xb45e('0x0'));module[_0xb45e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb45e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index bb61657..73868ce 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 _0x4966=['to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','end','name','send','index','ZendeskConfiguration','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','destroy','getFields','findOne','getSubjects','ZendeskField','getDescriptions','Tag','getTags','setTags','ids','eml-format','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x2e298f,_0x5933e6){var _0x5ed7d7=function(_0x140dbe){while(--_0x140dbe){_0x2e298f['push'](_0x2e298f['shift']());}};_0x5ed7d7(++_0x5933e6);}(_0x4966,0x92));var _0x6496=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0x4966[_0x3e6d5d];return _0x238923;};'use strict';var emlformat=require(_0x6496('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6496('0x1'));var BPromise=require(_0x6496('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6496('0x3'));var sox=require(_0x6496('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6496('0x5'));var _=require(_0x6496('0x6'));var squel=require(_0x6496('0x7'));var crypto=require(_0x6496('0x8'));var jsforce=require(_0x6496('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x6496('0xa'));var querystring=require(_0x6496('0xb'));var Papa=require(_0x6496('0xc'));var Redis=require('ioredis');var authService=require(_0x6496('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x6496('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6496('0xf'));var utils=require(_0x6496('0x10'));var config=require(_0x6496('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25a9fb,_0x2dfc07){_0x2dfc07=_0x2dfc07||0xcc;return function(_0x56adcd){if(_0x56adcd){return _0x25a9fb[_0x6496('0x12')](_0x2dfc07);}return _0x25a9fb[_0x6496('0x13')](_0x2dfc07)['end']();};}function respondWithResult(_0x164626,_0xffbe74){_0xffbe74=_0xffbe74||0xc8;return function(_0x5813c7){if(_0x5813c7){return _0x164626[_0x6496('0x13')](_0xffbe74)[_0x6496('0x14')](_0x5813c7);}};}function respondWithFilteredResult(_0x5ea60c,_0x4e4030){return function(_0x47c013){if(_0x47c013){var _0x1e2a3c=typeof _0x4e4030['offset']===_0x6496('0x15')&&typeof _0x4e4030[_0x6496('0x16')]===_0x6496('0x15');var _0x2b7eae=_0x47c013[_0x6496('0x17')];var _0x4441a5=_0x1e2a3c?0x0:_0x4e4030['offset'];var _0x22e032=_0x1e2a3c?_0x47c013['count']:_0x4e4030[_0x6496('0x18')]+_0x4e4030['limit'];var _0x4c12f2;if(_0x22e032>=_0x2b7eae){_0x22e032=_0x2b7eae;_0x4c12f2=0xc8;}else{_0x4c12f2=0xce;}_0x5ea60c[_0x6496('0x13')](_0x4c12f2);return _0x5ea60c['set'](_0x6496('0x19'),_0x4441a5+'-'+_0x22e032+'/'+_0x2b7eae)[_0x6496('0x14')](_0x47c013);}return null;};}function patchUpdates(_0x1e15ca){return function(_0x425dba){try{jsonpatch[_0x6496('0x1a')](_0x425dba,_0x1e15ca,!![]);}catch(_0xc4ee3f){return BPromise[_0x6496('0x1b')](_0xc4ee3f);}return _0x425dba[_0x6496('0x1c')]();};}function saveUpdates(_0x4d3095,_0x2fc672){return function(_0x371a2b){if(_0x371a2b){return _0x371a2b[_0x6496('0x1d')](_0x4d3095)[_0x6496('0x1e')](function(_0x5c33fd){return _0x5c33fd;});}return null;};}function removeEntity(_0x110a66,_0x23dfc4){return function(_0x27dd20){if(_0x27dd20){return _0x27dd20['destroy']()[_0x6496('0x1e')](function(){_0x110a66[_0x6496('0x13')](0xcc)[_0x6496('0x1f')]();});}};}function handleEntityNotFound(_0x4879f1,_0x18c1a9){return function(_0x4593ef){if(!_0x4593ef){_0x4879f1['sendStatus'](0x194);}return _0x4593ef;};}function handleError(_0x213104,_0x27f2c1){_0x27f2c1=_0x27f2c1||0x1f4;return function(_0xc5c9b3){logger['error'](_0xc5c9b3['stack']);if(_0xc5c9b3[_0x6496('0x20')]){delete _0xc5c9b3[_0x6496('0x20')];}_0x213104[_0x6496('0x13')](_0x27f2c1)[_0x6496('0x21')](_0xc5c9b3);};}exports[_0x6496('0x22')]=function(_0x447a83,_0xdeb78){var _0x195559={},_0xb932ff={},_0x5ab02b={'count':0x0,'rows':[]};var _0x1c5b8a=_['map'](db[_0x6496('0x23')]['rawAttributes'],function(_0x1bf049){return{'name':_0x1bf049['fieldName'],'type':_0x1bf049[_0x6496('0x24')][_0x6496('0x25')]};});_0xb932ff[_0x6496('0x26')]=_[_0x6496('0x27')](_0x1c5b8a,'name');_0xb932ff['query']=_[_0x6496('0x28')](_0x447a83[_0x6496('0x29')]);_0xb932ff[_0x6496('0x2a')]=_[_0x6496('0x2b')](_0xb932ff[_0x6496('0x26')],_0xb932ff['query']);_0x195559['attributes']=_[_0x6496('0x2b')](_0xb932ff[_0x6496('0x26')],qs[_0x6496('0x2c')](_0x447a83[_0x6496('0x29')][_0x6496('0x2c')]));_0x195559[_0x6496('0x2d')]=_0x195559[_0x6496('0x2d')]['length']?_0x195559['attributes']:_0xb932ff[_0x6496('0x26')];if(!_0x447a83['query'][_0x6496('0x2e')](_0x6496('0x2f'))){_0x195559[_0x6496('0x16')]=qs[_0x6496('0x16')](_0x447a83['query'][_0x6496('0x16')]);_0x195559[_0x6496('0x18')]=qs['offset'](_0x447a83[_0x6496('0x29')][_0x6496('0x18')]);}_0x195559[_0x6496('0x30')]=qs[_0x6496('0x31')](_0x447a83[_0x6496('0x29')]['sort']);_0x195559[_0x6496('0x32')]=qs[_0x6496('0x2a')](_[_0x6496('0x33')](_0x447a83[_0x6496('0x29')],_0xb932ff[_0x6496('0x2a')]),_0x1c5b8a);if(_0x447a83[_0x6496('0x29')][_0x6496('0x34')]){_0x195559[_0x6496('0x32')]=_[_0x6496('0x35')](_0x195559['where'],{'$or':_[_0x6496('0x27')](_0x1c5b8a,function(_0x3b2428){if(_0x3b2428[_0x6496('0x24')]!==_0x6496('0x36')){var _0x2202bd={};_0x2202bd[_0x3b2428[_0x6496('0x20')]]={'$like':'%'+_0x447a83[_0x6496('0x29')][_0x6496('0x34')]+'%'};return _0x2202bd;}})});}_0x195559=_[_0x6496('0x35')]({},_0x195559,_0x447a83[_0x6496('0x37')]);var _0x3d5c50={'where':_0x195559['where']};return db[_0x6496('0x23')][_0x6496('0x17')](_0x3d5c50)[_0x6496('0x1e')](function(_0x1cfdb1){_0x5ab02b[_0x6496('0x17')]=_0x1cfdb1;if(_0x447a83[_0x6496('0x29')][_0x6496('0x38')]){_0x195559[_0x6496('0x39')]=[{'all':!![]}];}return db[_0x6496('0x23')][_0x6496('0x3a')](_0x195559);})['then'](function(_0x49c5c4){_0x5ab02b[_0x6496('0x3b')]=_0x49c5c4;return _0x5ab02b;})[_0x6496('0x1e')](respondWithFilteredResult(_0xdeb78,_0x195559))[_0x6496('0x3c')](handleError(_0xdeb78,null));};exports[_0x6496('0x3d')]=function(_0x343b07,_0x2b5b54){var _0x4cc14d={'raw':![],'where':{'id':_0x343b07['params']['id']}},_0x579336={};_0x579336[_0x6496('0x26')]=_['keys'](db[_0x6496('0x23')][_0x6496('0x3e')]);_0x579336[_0x6496('0x29')]=_[_0x6496('0x28')](_0x343b07[_0x6496('0x29')]);_0x579336[_0x6496('0x2a')]=_[_0x6496('0x2b')](_0x579336['model'],_0x579336['query']);_0x4cc14d[_0x6496('0x2d')]=_['intersection'](_0x579336['model'],qs[_0x6496('0x2c')](_0x343b07[_0x6496('0x29')][_0x6496('0x2c')]));_0x4cc14d[_0x6496('0x2d')]=_0x4cc14d['attributes'][_0x6496('0x3f')]?_0x4cc14d[_0x6496('0x2d')]:_0x579336[_0x6496('0x26')];if(_0x343b07[_0x6496('0x29')][_0x6496('0x38')]){_0x4cc14d[_0x6496('0x39')]=[{'all':!![]}];}_0x4cc14d=_['merge']({},_0x4cc14d,_0x343b07['options']);return db[_0x6496('0x23')][_0x6496('0x40')](_0x4cc14d)[_0x6496('0x1e')](handleEntityNotFound(_0x2b5b54,null))[_0x6496('0x1e')](respondWithResult(_0x2b5b54,null))[_0x6496('0x3c')](handleError(_0x2b5b54,null));};exports[_0x6496('0x41')]=function(_0x566cc4,_0x2db2f6){return db['ZendeskConfiguration']['create'](_0x566cc4[_0x6496('0x42')],{})['then'](respondWithResult(_0x2db2f6,0xc9))[_0x6496('0x3c')](handleError(_0x2db2f6,null));};exports[_0x6496('0x1d')]=function(_0x3f1d15,_0x19ee10){if(_0x3f1d15['body']['id']){delete _0x3f1d15['body']['id'];}return db[_0x6496('0x23')][_0x6496('0x40')]({'where':{'id':_0x3f1d15[_0x6496('0x43')]['id']}})[_0x6496('0x1e')](handleEntityNotFound(_0x19ee10,null))[_0x6496('0x1e')](saveUpdates(_0x3f1d15['body'],null))[_0x6496('0x1e')](respondWithResult(_0x19ee10,null))[_0x6496('0x3c')](handleError(_0x19ee10,null));};exports[_0x6496('0x44')]=function(_0x86042e,_0x51b389){return db[_0x6496('0x23')][_0x6496('0x40')]({'where':{'id':_0x86042e['params']['id']}})['then'](handleEntityNotFound(_0x51b389,null))[_0x6496('0x1e')](removeEntity(_0x51b389,null))[_0x6496('0x3c')](handleError(_0x51b389,null));};exports[_0x6496('0x45')]=function(_0x2633d5,_0x472f93,_0x29a1bd){var _0x141c7b={};var _0x3c46fe={};var _0x836b14;var _0x3c50ba;return db[_0x6496('0x23')][_0x6496('0x46')]({'where':{'id':_0x2633d5[_0x6496('0x43')]['id']}})[_0x6496('0x1e')](handleEntityNotFound(_0x472f93,null))[_0x6496('0x1e')](function(_0x3af207){if(_0x3af207){_0x836b14=_0x3af207;_0x3c46fe['model']=_[_0x6496('0x28')](db['ZendeskField'][_0x6496('0x3e')]);_0x3c46fe[_0x6496('0x29')]=_[_0x6496('0x28')](_0x2633d5['query']);_0x3c46fe[_0x6496('0x2a')]=_[_0x6496('0x2b')](_0x3c46fe['model'],_0x3c46fe[_0x6496('0x29')]);_0x141c7b['attributes']=_[_0x6496('0x2b')](_0x3c46fe['model'],qs[_0x6496('0x2c')](_0x2633d5[_0x6496('0x29')][_0x6496('0x2c')]));_0x141c7b[_0x6496('0x2d')]=_0x141c7b[_0x6496('0x2d')][_0x6496('0x3f')]?_0x141c7b['attributes']:_0x3c46fe['model'];_0x141c7b[_0x6496('0x30')]=qs[_0x6496('0x31')](_0x2633d5[_0x6496('0x29')][_0x6496('0x31')]);_0x141c7b[_0x6496('0x32')]=qs['filters'](_[_0x6496('0x33')](_0x2633d5[_0x6496('0x29')],_0x3c46fe[_0x6496('0x2a')]));if(_0x2633d5[_0x6496('0x29')][_0x6496('0x34')]){_0x141c7b[_0x6496('0x32')]=_[_0x6496('0x35')](_0x141c7b['where'],{'$or':_['map'](_0x141c7b['attributes'],function(_0x437883){var _0xc7a806={};_0xc7a806[_0x437883]={'$like':'%'+_0x2633d5[_0x6496('0x29')][_0x6496('0x34')]+'%'};return _0xc7a806;})});}_0x141c7b=_[_0x6496('0x35')]({},_0x141c7b,_0x2633d5['options']);return _0x836b14[_0x6496('0x45')](_0x141c7b);}})[_0x6496('0x1e')](function(_0x3a2755){if(_0x3a2755){_0x3c50ba=_0x3a2755[_0x6496('0x3f')];if(!_0x2633d5[_0x6496('0x29')][_0x6496('0x2e')](_0x6496('0x2f'))){_0x141c7b['limit']=qs[_0x6496('0x16')](_0x2633d5[_0x6496('0x29')][_0x6496('0x16')]);_0x141c7b[_0x6496('0x18')]=qs[_0x6496('0x18')](_0x2633d5['query'][_0x6496('0x18')]);}return _0x836b14['getFields'](_0x141c7b);}})['then'](function(_0x54fa58){if(_0x54fa58){return _0x54fa58?{'count':_0x3c50ba,'rows':_0x54fa58}:null;}})[_0x6496('0x1e')](respondWithResult(_0x472f93,null))['catch'](handleError(_0x472f93,null));};exports[_0x6496('0x47')]=function(_0x1f65ac,_0x3249df,_0x536083){var _0x519447={};var _0x2e2a44={};var _0x5663c9;var _0x1791af;return db[_0x6496('0x23')]['findOne']({'where':{'id':_0x1f65ac[_0x6496('0x43')]['id']}})[_0x6496('0x1e')](handleEntityNotFound(_0x3249df,null))[_0x6496('0x1e')](function(_0x1376fe){if(_0x1376fe){_0x5663c9=_0x1376fe;_0x2e2a44[_0x6496('0x26')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x2e2a44[_0x6496('0x29')]=_['keys'](_0x1f65ac[_0x6496('0x29')]);_0x2e2a44[_0x6496('0x2a')]=_['intersection'](_0x2e2a44[_0x6496('0x26')],_0x2e2a44[_0x6496('0x29')]);_0x519447[_0x6496('0x2d')]=_[_0x6496('0x2b')](_0x2e2a44[_0x6496('0x26')],qs[_0x6496('0x2c')](_0x1f65ac[_0x6496('0x29')][_0x6496('0x2c')]));_0x519447[_0x6496('0x2d')]=_0x519447[_0x6496('0x2d')][_0x6496('0x3f')]?_0x519447[_0x6496('0x2d')]:_0x2e2a44['model'];_0x519447[_0x6496('0x30')]=qs['sort'](_0x1f65ac[_0x6496('0x29')]['sort']);_0x519447[_0x6496('0x32')]=qs['filters'](_[_0x6496('0x33')](_0x1f65ac[_0x6496('0x29')],_0x2e2a44[_0x6496('0x2a')]));if(_0x1f65ac[_0x6496('0x29')][_0x6496('0x34')]){_0x519447[_0x6496('0x32')]=_['merge'](_0x519447[_0x6496('0x32')],{'$or':_['map'](_0x519447[_0x6496('0x2d')],function(_0x1b4e80){var _0x57a1ff={};_0x57a1ff[_0x1b4e80]={'$like':'%'+_0x1f65ac['query'][_0x6496('0x34')]+'%'};return _0x57a1ff;})});}_0x519447=_[_0x6496('0x35')]({},_0x519447,_0x1f65ac[_0x6496('0x37')]);return _0x5663c9[_0x6496('0x47')](_0x519447);}})[_0x6496('0x1e')](function(_0x40eca7){if(_0x40eca7){_0x1791af=_0x40eca7[_0x6496('0x3f')];if(!_0x1f65ac[_0x6496('0x29')][_0x6496('0x2e')]('nolimit')){_0x519447[_0x6496('0x16')]=qs[_0x6496('0x16')](_0x1f65ac['query']['limit']);_0x519447[_0x6496('0x18')]=qs[_0x6496('0x18')](_0x1f65ac[_0x6496('0x29')][_0x6496('0x18')]);}return _0x5663c9[_0x6496('0x47')](_0x519447);}})[_0x6496('0x1e')](function(_0x161cb8){if(_0x161cb8){return _0x161cb8?{'count':_0x1791af,'rows':_0x161cb8}:null;}})[_0x6496('0x1e')](respondWithResult(_0x3249df,null))['catch'](handleError(_0x3249df,null));};exports['getDescriptions']=function(_0x3ce8ce,_0x464896,_0x34e104){var _0xfdaa6a={};var _0xabccf0={};var _0x2cf964;var _0x15265e;return db[_0x6496('0x23')][_0x6496('0x46')]({'where':{'id':_0x3ce8ce['params']['id']}})[_0x6496('0x1e')](handleEntityNotFound(_0x464896,null))[_0x6496('0x1e')](function(_0x1571cf){if(_0x1571cf){_0x2cf964=_0x1571cf;_0xabccf0[_0x6496('0x26')]=_[_0x6496('0x28')](db[_0x6496('0x48')][_0x6496('0x3e')]);_0xabccf0[_0x6496('0x29')]=_[_0x6496('0x28')](_0x3ce8ce[_0x6496('0x29')]);_0xabccf0[_0x6496('0x2a')]=_['intersection'](_0xabccf0[_0x6496('0x26')],_0xabccf0[_0x6496('0x29')]);_0xfdaa6a[_0x6496('0x2d')]=_[_0x6496('0x2b')](_0xabccf0['model'],qs[_0x6496('0x2c')](_0x3ce8ce[_0x6496('0x29')]['fields']));_0xfdaa6a[_0x6496('0x2d')]=_0xfdaa6a[_0x6496('0x2d')]['length']?_0xfdaa6a[_0x6496('0x2d')]:_0xabccf0['model'];_0xfdaa6a['order']=qs[_0x6496('0x31')](_0x3ce8ce[_0x6496('0x29')][_0x6496('0x31')]);_0xfdaa6a['where']=qs[_0x6496('0x2a')](_[_0x6496('0x33')](_0x3ce8ce[_0x6496('0x29')],_0xabccf0[_0x6496('0x2a')]));if(_0x3ce8ce[_0x6496('0x29')]['filter']){_0xfdaa6a['where']=_[_0x6496('0x35')](_0xfdaa6a[_0x6496('0x32')],{'$or':_['map'](_0xfdaa6a[_0x6496('0x2d')],function(_0x276f9e){var _0x24dd4b={};_0x24dd4b[_0x276f9e]={'$like':'%'+_0x3ce8ce[_0x6496('0x29')][_0x6496('0x34')]+'%'};return _0x24dd4b;})});}_0xfdaa6a=_[_0x6496('0x35')]({},_0xfdaa6a,_0x3ce8ce['options']);return _0x2cf964['getDescriptions'](_0xfdaa6a);}})[_0x6496('0x1e')](function(_0x101088){if(_0x101088){_0x15265e=_0x101088[_0x6496('0x3f')];if(!_0x3ce8ce[_0x6496('0x29')][_0x6496('0x2e')](_0x6496('0x2f'))){_0xfdaa6a[_0x6496('0x16')]=qs[_0x6496('0x16')](_0x3ce8ce[_0x6496('0x29')][_0x6496('0x16')]);_0xfdaa6a[_0x6496('0x18')]=qs['offset'](_0x3ce8ce[_0x6496('0x29')][_0x6496('0x18')]);}return _0x2cf964[_0x6496('0x49')](_0xfdaa6a);}})[_0x6496('0x1e')](function(_0x32ede5){if(_0x32ede5){return _0x32ede5?{'count':_0x15265e,'rows':_0x32ede5}:null;}})[_0x6496('0x1e')](respondWithResult(_0x464896,null))['catch'](handleError(_0x464896,null));};exports['getTags']=function(_0x7a94a9,_0x1dca90,_0x5e3f3b){var _0x4b52c5={};var _0x5367f9={};var _0x5d41ea;var _0x46bf8d;return db[_0x6496('0x23')][_0x6496('0x46')]({'where':{'id':_0x7a94a9[_0x6496('0x43')]['id']}})[_0x6496('0x1e')](handleEntityNotFound(_0x1dca90,null))[_0x6496('0x1e')](function(_0x4ca7d2){if(_0x4ca7d2){_0x5d41ea=_0x4ca7d2;_0x5367f9[_0x6496('0x26')]=_[_0x6496('0x28')](db[_0x6496('0x4a')][_0x6496('0x3e')]);_0x5367f9[_0x6496('0x29')]=_[_0x6496('0x28')](_0x7a94a9[_0x6496('0x29')]);_0x5367f9[_0x6496('0x2a')]=_['intersection'](_0x5367f9[_0x6496('0x26')],_0x5367f9['query']);_0x4b52c5[_0x6496('0x2d')]=_[_0x6496('0x2b')](_0x5367f9[_0x6496('0x26')],qs[_0x6496('0x2c')](_0x7a94a9[_0x6496('0x29')][_0x6496('0x2c')]));_0x4b52c5[_0x6496('0x2d')]=_0x4b52c5[_0x6496('0x2d')][_0x6496('0x3f')]?_0x4b52c5[_0x6496('0x2d')]:_0x5367f9[_0x6496('0x26')];_0x4b52c5[_0x6496('0x30')]=qs['sort'](_0x7a94a9[_0x6496('0x29')][_0x6496('0x31')]);_0x4b52c5['where']=qs[_0x6496('0x2a')](_['pick'](_0x7a94a9[_0x6496('0x29')],_0x5367f9[_0x6496('0x2a')]));if(_0x7a94a9[_0x6496('0x29')][_0x6496('0x34')]){_0x4b52c5[_0x6496('0x32')]=_['merge'](_0x4b52c5[_0x6496('0x32')],{'$or':_[_0x6496('0x27')](_0x4b52c5[_0x6496('0x2d')],function(_0x506f9f){var _0x3c50be={};_0x3c50be[_0x506f9f]={'$like':'%'+_0x7a94a9[_0x6496('0x29')][_0x6496('0x34')]+'%'};return _0x3c50be;})});}_0x4b52c5=_[_0x6496('0x35')]({},_0x4b52c5,_0x7a94a9[_0x6496('0x37')]);return _0x5d41ea[_0x6496('0x4b')](_0x4b52c5);}})[_0x6496('0x1e')](function(_0xc7218b){if(_0xc7218b){_0x46bf8d=_0xc7218b['length'];if(!_0x7a94a9[_0x6496('0x29')]['hasOwnProperty']('nolimit')){_0x4b52c5[_0x6496('0x16')]=qs[_0x6496('0x16')](_0x7a94a9['query'][_0x6496('0x16')]);_0x4b52c5[_0x6496('0x18')]=qs[_0x6496('0x18')](_0x7a94a9[_0x6496('0x29')][_0x6496('0x18')]);}return _0x5d41ea['getTags'](_0x4b52c5);}})[_0x6496('0x1e')](function(_0x337db4){if(_0x337db4){return _0x337db4?{'count':_0x46bf8d,'rows':_0x337db4}:null;}})[_0x6496('0x1e')](respondWithResult(_0x1dca90,null))[_0x6496('0x3c')](handleError(_0x1dca90,null));};exports[_0x6496('0x4c')]=function(_0x1afb5d,_0x35fc86,_0x20222f){if(_0x1afb5d[_0x6496('0x42')]['id']){delete _0x1afb5d[_0x6496('0x42')]['id'];}return db[_0x6496('0x23')][_0x6496('0x46')]({'where':{'id':_0x1afb5d[_0x6496('0x43')]['id']}})['then'](handleEntityNotFound(_0x35fc86,null))['then'](function(_0x158cdd){if(_0x158cdd){return _0x158cdd['setTags'](_0x1afb5d[_0x6496('0x42')][_0x6496('0x4d')]||[]);}return null;})[_0x6496('0x1e')](respondWithResult(_0x35fc86,null))['catch'](handleError(_0x35fc86,null));}; \ No newline at end of file +var _0x0f2a=['VIRTUAL','merge','options','includeAll','findAll','rows','show','include','find','create','body','params','catch','getFields','findOne','ZendeskField','order','getSubjects','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x292521,_0x54c77f){var _0x5ed66e=function(_0x20d73d){while(--_0x20d73d){_0x292521['push'](_0x292521['shift']());}};_0x5ed66e(++_0x54c77f);}(_0x0f2a,0x118));var _0xa0f2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0f2a[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xa0f2('0x0'));var rimraf=require(_0xa0f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa0f2('0x2'));var rp=require(_0xa0f2('0x3'));var moment=require(_0xa0f2('0x4'));var BPromise=require(_0xa0f2('0x5'));var Mustache=require('mustache');var util=require(_0xa0f2('0x6'));var path=require('path');var sox=require(_0xa0f2('0x7'));var csv=require(_0xa0f2('0x8'));var ejs=require(_0xa0f2('0x9'));var fs=require('fs');var fs_extra=require(_0xa0f2('0xa'));var _=require(_0xa0f2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa0f2('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa0f2('0xd'));var Papa=require(_0xa0f2('0xe'));var Redis=require(_0xa0f2('0xf'));var authService=require(_0xa0f2('0x10'));var qs=require(_0xa0f2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0f2('0x12'));var logger=require('../../config/logger')(_0xa0f2('0x13'));var utils=require(_0xa0f2('0x14'));var config=require(_0xa0f2('0x15'));var licenseUtil=require(_0xa0f2('0x16'));var db=require(_0xa0f2('0x17'))['db'];function respondWithStatusCode(_0x1b419e,_0x5b12a2){_0x5b12a2=_0x5b12a2||0xcc;return function(_0x1e21e8){if(_0x1e21e8){return _0x1b419e[_0xa0f2('0x18')](_0x5b12a2);}return _0x1b419e[_0xa0f2('0x19')](_0x5b12a2)[_0xa0f2('0x1a')]();};}function respondWithResult(_0x4289a0,_0x3922f2){_0x3922f2=_0x3922f2||0xc8;return function(_0x1106ac){if(_0x1106ac){return _0x4289a0[_0xa0f2('0x19')](_0x3922f2)[_0xa0f2('0x1b')](_0x1106ac);}};}function respondWithFilteredResult(_0x4f4a69,_0x4ddcf7){return function(_0xeb9326){if(_0xeb9326){var _0x5590f1=typeof _0x4ddcf7[_0xa0f2('0x1c')]===_0xa0f2('0x1d')&&typeof _0x4ddcf7[_0xa0f2('0x1e')]==='undefined';var _0x3ea73f=_0xeb9326[_0xa0f2('0x1f')];var _0x5e5a1b=_0x5590f1?0x0:_0x4ddcf7[_0xa0f2('0x1c')];var _0xf0fba0=_0x5590f1?_0xeb9326[_0xa0f2('0x1f')]:_0x4ddcf7[_0xa0f2('0x1c')]+_0x4ddcf7[_0xa0f2('0x1e')];var _0x35cb31;if(_0xf0fba0>=_0x3ea73f){_0xf0fba0=_0x3ea73f;_0x35cb31=0xc8;}else{_0x35cb31=0xce;}_0x4f4a69['status'](_0x35cb31);return _0x4f4a69[_0xa0f2('0x20')](_0xa0f2('0x21'),_0x5e5a1b+'-'+_0xf0fba0+'/'+_0x3ea73f)[_0xa0f2('0x1b')](_0xeb9326);}return null;};}function patchUpdates(_0x4666fa){return function(_0x46ecd5){try{jsonpatch[_0xa0f2('0x22')](_0x46ecd5,_0x4666fa,!![]);}catch(_0x49410a){return BPromise[_0xa0f2('0x23')](_0x49410a);}return _0x46ecd5[_0xa0f2('0x24')]();};}function saveUpdates(_0x331a71,_0x43edb2){return function(_0x52e943){if(_0x52e943){return _0x52e943[_0xa0f2('0x25')](_0x331a71)[_0xa0f2('0x26')](function(_0x1bdad3){return _0x1bdad3;});}return null;};}function removeEntity(_0x47e514,_0x37d65b){return function(_0x56b495){if(_0x56b495){return _0x56b495[_0xa0f2('0x27')]()[_0xa0f2('0x26')](function(){_0x47e514[_0xa0f2('0x19')](0xcc)[_0xa0f2('0x1a')]();});}};}function handleEntityNotFound(_0x52449f,_0xd13470){return function(_0x52ba03){if(!_0x52ba03){_0x52449f['sendStatus'](0x194);}return _0x52ba03;};}function handleError(_0x15e429,_0x1a5f69){_0x1a5f69=_0x1a5f69||0x1f4;return function(_0x40428b){logger[_0xa0f2('0x28')](_0x40428b[_0xa0f2('0x29')]);if(_0x40428b['name']){delete _0x40428b['name'];}_0x15e429[_0xa0f2('0x19')](_0x1a5f69)['send'](_0x40428b);};}exports[_0xa0f2('0x2a')]=function(_0x519afb,_0x27fd5f){var _0x52fb4c={},_0x52b091={},_0x1af2d8={'count':0x0,'rows':[]};var _0x56687a=_[_0xa0f2('0x2b')](db[_0xa0f2('0x2c')][_0xa0f2('0x2d')],function(_0x4cf04a){return{'name':_0x4cf04a[_0xa0f2('0x2e')],'type':_0x4cf04a[_0xa0f2('0x2f')][_0xa0f2('0x30')]};});_0x52b091['model']=_[_0xa0f2('0x2b')](_0x56687a,_0xa0f2('0x31'));_0x52b091[_0xa0f2('0x32')]=_[_0xa0f2('0x33')](_0x519afb['query']);_0x52b091[_0xa0f2('0x34')]=_[_0xa0f2('0x35')](_0x52b091['model'],_0x52b091['query']);_0x52fb4c[_0xa0f2('0x36')]=_[_0xa0f2('0x35')](_0x52b091['model'],qs['fields'](_0x519afb[_0xa0f2('0x32')][_0xa0f2('0x37')]));_0x52fb4c[_0xa0f2('0x36')]=_0x52fb4c[_0xa0f2('0x36')][_0xa0f2('0x38')]?_0x52fb4c[_0xa0f2('0x36')]:_0x52b091[_0xa0f2('0x39')];if(!_0x519afb[_0xa0f2('0x32')][_0xa0f2('0x3a')](_0xa0f2('0x3b'))){_0x52fb4c[_0xa0f2('0x1e')]=qs[_0xa0f2('0x1e')](_0x519afb[_0xa0f2('0x32')][_0xa0f2('0x1e')]);_0x52fb4c[_0xa0f2('0x1c')]=qs['offset'](_0x519afb['query'][_0xa0f2('0x1c')]);}_0x52fb4c['order']=qs['sort'](_0x519afb['query'][_0xa0f2('0x3c')]);_0x52fb4c[_0xa0f2('0x3d')]=qs[_0xa0f2('0x34')](_[_0xa0f2('0x3e')](_0x519afb[_0xa0f2('0x32')],_0x52b091['filters']),_0x56687a);if(_0x519afb['query'][_0xa0f2('0x3f')]){_0x52fb4c['where']=_['merge'](_0x52fb4c['where'],{'$or':_[_0xa0f2('0x2b')](_0x56687a,function(_0x44fd32){if(_0x44fd32[_0xa0f2('0x2f')]!==_0xa0f2('0x40')){var _0x52b49d={};_0x52b49d[_0x44fd32[_0xa0f2('0x31')]]={'$like':'%'+_0x519afb['query'][_0xa0f2('0x3f')]+'%'};return _0x52b49d;}})});}_0x52fb4c=_[_0xa0f2('0x41')]({},_0x52fb4c,_0x519afb[_0xa0f2('0x42')]);var _0x49c8bc={'where':_0x52fb4c[_0xa0f2('0x3d')]};return db[_0xa0f2('0x2c')][_0xa0f2('0x1f')](_0x49c8bc)[_0xa0f2('0x26')](function(_0x363e09){_0x1af2d8[_0xa0f2('0x1f')]=_0x363e09;if(_0x519afb['query'][_0xa0f2('0x43')]){_0x52fb4c['include']=[{'all':!![]}];}return db[_0xa0f2('0x2c')][_0xa0f2('0x44')](_0x52fb4c);})[_0xa0f2('0x26')](function(_0x4d9fb4){_0x1af2d8[_0xa0f2('0x45')]=_0x4d9fb4;return _0x1af2d8;})[_0xa0f2('0x26')](respondWithFilteredResult(_0x27fd5f,_0x52fb4c))['catch'](handleError(_0x27fd5f,null));};exports[_0xa0f2('0x46')]=function(_0x38817a,_0x56a215){var _0x483b93={'raw':![],'where':{'id':_0x38817a['params']['id']}},_0x6384e3={};_0x6384e3[_0xa0f2('0x39')]=_[_0xa0f2('0x33')](db[_0xa0f2('0x2c')][_0xa0f2('0x2d')]);_0x6384e3[_0xa0f2('0x32')]=_[_0xa0f2('0x33')](_0x38817a[_0xa0f2('0x32')]);_0x6384e3[_0xa0f2('0x34')]=_[_0xa0f2('0x35')](_0x6384e3[_0xa0f2('0x39')],_0x6384e3[_0xa0f2('0x32')]);_0x483b93['attributes']=_[_0xa0f2('0x35')](_0x6384e3['model'],qs[_0xa0f2('0x37')](_0x38817a[_0xa0f2('0x32')][_0xa0f2('0x37')]));_0x483b93[_0xa0f2('0x36')]=_0x483b93['attributes'][_0xa0f2('0x38')]?_0x483b93[_0xa0f2('0x36')]:_0x6384e3[_0xa0f2('0x39')];if(_0x38817a[_0xa0f2('0x32')][_0xa0f2('0x43')]){_0x483b93[_0xa0f2('0x47')]=[{'all':!![]}];}_0x483b93=_['merge']({},_0x483b93,_0x38817a[_0xa0f2('0x42')]);return db[_0xa0f2('0x2c')][_0xa0f2('0x48')](_0x483b93)['then'](handleEntityNotFound(_0x56a215,null))[_0xa0f2('0x26')](respondWithResult(_0x56a215,null))['catch'](handleError(_0x56a215,null));};exports[_0xa0f2('0x49')]=function(_0x5acccd,_0x58713a){return db[_0xa0f2('0x2c')][_0xa0f2('0x49')](_0x5acccd[_0xa0f2('0x4a')],{})[_0xa0f2('0x26')](respondWithResult(_0x58713a,0xc9))['catch'](handleError(_0x58713a,null));};exports[_0xa0f2('0x25')]=function(_0x2a8116,_0x45c95a){if(_0x2a8116[_0xa0f2('0x4a')]['id']){delete _0x2a8116['body']['id'];}return db[_0xa0f2('0x2c')]['find']({'where':{'id':_0x2a8116[_0xa0f2('0x4b')]['id']}})[_0xa0f2('0x26')](handleEntityNotFound(_0x45c95a,null))['then'](saveUpdates(_0x2a8116[_0xa0f2('0x4a')],null))['then'](respondWithResult(_0x45c95a,null))[_0xa0f2('0x4c')](handleError(_0x45c95a,null));};exports[_0xa0f2('0x27')]=function(_0x2d3f8a,_0x127a90){return db['ZendeskConfiguration']['find']({'where':{'id':_0x2d3f8a['params']['id']}})['then'](handleEntityNotFound(_0x127a90,null))['then'](removeEntity(_0x127a90,null))[_0xa0f2('0x4c')](handleError(_0x127a90,null));};exports[_0xa0f2('0x4d')]=function(_0x12d7da,_0x245423,_0x38db9d){var _0x2dc601={};var _0x4cc5c0={};var _0x7d4e74;var _0x34a835;return db['ZendeskConfiguration'][_0xa0f2('0x4e')]({'where':{'id':_0x12d7da[_0xa0f2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x245423,null))[_0xa0f2('0x26')](function(_0x2ba49b){if(_0x2ba49b){_0x7d4e74=_0x2ba49b;_0x4cc5c0[_0xa0f2('0x39')]=_[_0xa0f2('0x33')](db[_0xa0f2('0x4f')][_0xa0f2('0x2d')]);_0x4cc5c0[_0xa0f2('0x32')]=_[_0xa0f2('0x33')](_0x12d7da['query']);_0x4cc5c0['filters']=_[_0xa0f2('0x35')](_0x4cc5c0[_0xa0f2('0x39')],_0x4cc5c0[_0xa0f2('0x32')]);_0x2dc601['attributes']=_[_0xa0f2('0x35')](_0x4cc5c0['model'],qs[_0xa0f2('0x37')](_0x12d7da[_0xa0f2('0x32')][_0xa0f2('0x37')]));_0x2dc601[_0xa0f2('0x36')]=_0x2dc601[_0xa0f2('0x36')][_0xa0f2('0x38')]?_0x2dc601[_0xa0f2('0x36')]:_0x4cc5c0['model'];_0x2dc601[_0xa0f2('0x50')]=qs['sort'](_0x12d7da['query'][_0xa0f2('0x3c')]);_0x2dc601[_0xa0f2('0x3d')]=qs[_0xa0f2('0x34')](_[_0xa0f2('0x3e')](_0x12d7da[_0xa0f2('0x32')],_0x4cc5c0['filters']));if(_0x12d7da[_0xa0f2('0x32')][_0xa0f2('0x3f')]){_0x2dc601[_0xa0f2('0x3d')]=_['merge'](_0x2dc601['where'],{'$or':_[_0xa0f2('0x2b')](_0x2dc601[_0xa0f2('0x36')],function(_0x3900f3){var _0x4b9e85={};_0x4b9e85[_0x3900f3]={'$like':'%'+_0x12d7da[_0xa0f2('0x32')][_0xa0f2('0x3f')]+'%'};return _0x4b9e85;})});}_0x2dc601=_[_0xa0f2('0x41')]({},_0x2dc601,_0x12d7da['options']);return _0x7d4e74[_0xa0f2('0x4d')](_0x2dc601);}})['then'](function(_0x417d12){if(_0x417d12){_0x34a835=_0x417d12[_0xa0f2('0x38')];if(!_0x12d7da[_0xa0f2('0x32')]['hasOwnProperty'](_0xa0f2('0x3b'))){_0x2dc601[_0xa0f2('0x1e')]=qs['limit'](_0x12d7da[_0xa0f2('0x32')]['limit']);_0x2dc601['offset']=qs[_0xa0f2('0x1c')](_0x12d7da[_0xa0f2('0x32')][_0xa0f2('0x1c')]);}return _0x7d4e74[_0xa0f2('0x4d')](_0x2dc601);}})[_0xa0f2('0x26')](function(_0x5b4dae){if(_0x5b4dae){return _0x5b4dae?{'count':_0x34a835,'rows':_0x5b4dae}:null;}})['then'](respondWithResult(_0x245423,null))[_0xa0f2('0x4c')](handleError(_0x245423,null));};exports[_0xa0f2('0x51')]=function(_0x3f5818,_0x50e0fb,_0x37796b){var _0x536628={};var _0xe2716c={};var _0x488075;var _0xb86c11;return db[_0xa0f2('0x2c')][_0xa0f2('0x4e')]({'where':{'id':_0x3f5818[_0xa0f2('0x4b')]['id']}})[_0xa0f2('0x26')](handleEntityNotFound(_0x50e0fb,null))['then'](function(_0x14034d){if(_0x14034d){_0x488075=_0x14034d;_0xe2716c[_0xa0f2('0x39')]=_['keys'](db[_0xa0f2('0x4f')][_0xa0f2('0x2d')]);_0xe2716c[_0xa0f2('0x32')]=_['keys'](_0x3f5818[_0xa0f2('0x32')]);_0xe2716c[_0xa0f2('0x34')]=_[_0xa0f2('0x35')](_0xe2716c['model'],_0xe2716c[_0xa0f2('0x32')]);_0x536628[_0xa0f2('0x36')]=_['intersection'](_0xe2716c['model'],qs[_0xa0f2('0x37')](_0x3f5818[_0xa0f2('0x32')][_0xa0f2('0x37')]));_0x536628[_0xa0f2('0x36')]=_0x536628[_0xa0f2('0x36')]['length']?_0x536628['attributes']:_0xe2716c[_0xa0f2('0x39')];_0x536628[_0xa0f2('0x50')]=qs[_0xa0f2('0x3c')](_0x3f5818[_0xa0f2('0x32')][_0xa0f2('0x3c')]);_0x536628[_0xa0f2('0x3d')]=qs[_0xa0f2('0x34')](_[_0xa0f2('0x3e')](_0x3f5818[_0xa0f2('0x32')],_0xe2716c[_0xa0f2('0x34')]));if(_0x3f5818[_0xa0f2('0x32')]['filter']){_0x536628[_0xa0f2('0x3d')]=_['merge'](_0x536628[_0xa0f2('0x3d')],{'$or':_['map'](_0x536628[_0xa0f2('0x36')],function(_0x1a97db){var _0x478a37={};_0x478a37[_0x1a97db]={'$like':'%'+_0x3f5818['query'][_0xa0f2('0x3f')]+'%'};return _0x478a37;})});}_0x536628=_[_0xa0f2('0x41')]({},_0x536628,_0x3f5818[_0xa0f2('0x42')]);return _0x488075['getSubjects'](_0x536628);}})[_0xa0f2('0x26')](function(_0x5e8277){if(_0x5e8277){_0xb86c11=_0x5e8277[_0xa0f2('0x38')];if(!_0x3f5818[_0xa0f2('0x32')][_0xa0f2('0x3a')]('nolimit')){_0x536628['limit']=qs[_0xa0f2('0x1e')](_0x3f5818[_0xa0f2('0x32')][_0xa0f2('0x1e')]);_0x536628[_0xa0f2('0x1c')]=qs[_0xa0f2('0x1c')](_0x3f5818['query'][_0xa0f2('0x1c')]);}return _0x488075[_0xa0f2('0x51')](_0x536628);}})[_0xa0f2('0x26')](function(_0x5a7759){if(_0x5a7759){return _0x5a7759?{'count':_0xb86c11,'rows':_0x5a7759}:null;}})[_0xa0f2('0x26')](respondWithResult(_0x50e0fb,null))[_0xa0f2('0x4c')](handleError(_0x50e0fb,null));};exports['getDescriptions']=function(_0x397c87,_0x114843,_0x3c5681){var _0x13bc1a={};var _0xd83bc5={};var _0x1458b6;var _0x5ab96c;return db[_0xa0f2('0x2c')][_0xa0f2('0x4e')]({'where':{'id':_0x397c87[_0xa0f2('0x4b')]['id']}})[_0xa0f2('0x26')](handleEntityNotFound(_0x114843,null))[_0xa0f2('0x26')](function(_0x3e0ab3){if(_0x3e0ab3){_0x1458b6=_0x3e0ab3;_0xd83bc5[_0xa0f2('0x39')]=_[_0xa0f2('0x33')](db[_0xa0f2('0x4f')][_0xa0f2('0x2d')]);_0xd83bc5[_0xa0f2('0x32')]=_['keys'](_0x397c87['query']);_0xd83bc5[_0xa0f2('0x34')]=_[_0xa0f2('0x35')](_0xd83bc5[_0xa0f2('0x39')],_0xd83bc5[_0xa0f2('0x32')]);_0x13bc1a[_0xa0f2('0x36')]=_[_0xa0f2('0x35')](_0xd83bc5['model'],qs[_0xa0f2('0x37')](_0x397c87[_0xa0f2('0x32')]['fields']));_0x13bc1a['attributes']=_0x13bc1a[_0xa0f2('0x36')][_0xa0f2('0x38')]?_0x13bc1a[_0xa0f2('0x36')]:_0xd83bc5['model'];_0x13bc1a[_0xa0f2('0x50')]=qs['sort'](_0x397c87[_0xa0f2('0x32')][_0xa0f2('0x3c')]);_0x13bc1a[_0xa0f2('0x3d')]=qs[_0xa0f2('0x34')](_['pick'](_0x397c87[_0xa0f2('0x32')],_0xd83bc5[_0xa0f2('0x34')]));if(_0x397c87[_0xa0f2('0x32')][_0xa0f2('0x3f')]){_0x13bc1a[_0xa0f2('0x3d')]=_[_0xa0f2('0x41')](_0x13bc1a['where'],{'$or':_[_0xa0f2('0x2b')](_0x13bc1a['attributes'],function(_0x1d1b8c){var _0x53f0d3={};_0x53f0d3[_0x1d1b8c]={'$like':'%'+_0x397c87['query'][_0xa0f2('0x3f')]+'%'};return _0x53f0d3;})});}_0x13bc1a=_['merge']({},_0x13bc1a,_0x397c87[_0xa0f2('0x42')]);return _0x1458b6['getDescriptions'](_0x13bc1a);}})[_0xa0f2('0x26')](function(_0x518378){if(_0x518378){_0x5ab96c=_0x518378[_0xa0f2('0x38')];if(!_0x397c87['query'][_0xa0f2('0x3a')](_0xa0f2('0x3b'))){_0x13bc1a['limit']=qs[_0xa0f2('0x1e')](_0x397c87[_0xa0f2('0x32')][_0xa0f2('0x1e')]);_0x13bc1a[_0xa0f2('0x1c')]=qs[_0xa0f2('0x1c')](_0x397c87[_0xa0f2('0x32')]['offset']);}return _0x1458b6['getDescriptions'](_0x13bc1a);}})[_0xa0f2('0x26')](function(_0x5235d8){if(_0x5235d8){return _0x5235d8?{'count':_0x5ab96c,'rows':_0x5235d8}:null;}})[_0xa0f2('0x26')](respondWithResult(_0x114843,null))['catch'](handleError(_0x114843,null));};exports[_0xa0f2('0x52')]=function(_0x3bd266,_0xa7a450,_0x888b87){var _0x3c4cab={};var _0x28b3d5={};var _0x50bb87;var _0x3dbbc7;return db['ZendeskConfiguration'][_0xa0f2('0x4e')]({'where':{'id':_0x3bd266[_0xa0f2('0x4b')]['id']}})['then'](handleEntityNotFound(_0xa7a450,null))[_0xa0f2('0x26')](function(_0x139d22){if(_0x139d22){_0x50bb87=_0x139d22;_0x28b3d5[_0xa0f2('0x39')]=_[_0xa0f2('0x33')](db[_0xa0f2('0x53')][_0xa0f2('0x2d')]);_0x28b3d5[_0xa0f2('0x32')]=_[_0xa0f2('0x33')](_0x3bd266[_0xa0f2('0x32')]);_0x28b3d5[_0xa0f2('0x34')]=_[_0xa0f2('0x35')](_0x28b3d5[_0xa0f2('0x39')],_0x28b3d5[_0xa0f2('0x32')]);_0x3c4cab[_0xa0f2('0x36')]=_['intersection'](_0x28b3d5[_0xa0f2('0x39')],qs[_0xa0f2('0x37')](_0x3bd266[_0xa0f2('0x32')][_0xa0f2('0x37')]));_0x3c4cab[_0xa0f2('0x36')]=_0x3c4cab[_0xa0f2('0x36')][_0xa0f2('0x38')]?_0x3c4cab[_0xa0f2('0x36')]:_0x28b3d5['model'];_0x3c4cab[_0xa0f2('0x50')]=qs['sort'](_0x3bd266[_0xa0f2('0x32')]['sort']);_0x3c4cab['where']=qs[_0xa0f2('0x34')](_[_0xa0f2('0x3e')](_0x3bd266[_0xa0f2('0x32')],_0x28b3d5[_0xa0f2('0x34')]));if(_0x3bd266[_0xa0f2('0x32')][_0xa0f2('0x3f')]){_0x3c4cab[_0xa0f2('0x3d')]=_[_0xa0f2('0x41')](_0x3c4cab[_0xa0f2('0x3d')],{'$or':_['map'](_0x3c4cab['attributes'],function(_0x2d2d70){var _0x2c3126={};_0x2c3126[_0x2d2d70]={'$like':'%'+_0x3bd266[_0xa0f2('0x32')]['filter']+'%'};return _0x2c3126;})});}_0x3c4cab=_[_0xa0f2('0x41')]({},_0x3c4cab,_0x3bd266[_0xa0f2('0x42')]);return _0x50bb87[_0xa0f2('0x52')](_0x3c4cab);}})[_0xa0f2('0x26')](function(_0x7b7f2e){if(_0x7b7f2e){_0x3dbbc7=_0x7b7f2e[_0xa0f2('0x38')];if(!_0x3bd266['query'][_0xa0f2('0x3a')](_0xa0f2('0x3b'))){_0x3c4cab['limit']=qs[_0xa0f2('0x1e')](_0x3bd266['query']['limit']);_0x3c4cab['offset']=qs['offset'](_0x3bd266[_0xa0f2('0x32')][_0xa0f2('0x1c')]);}return _0x50bb87[_0xa0f2('0x52')](_0x3c4cab);}})[_0xa0f2('0x26')](function(_0x3a4f8c){if(_0x3a4f8c){return _0x3a4f8c?{'count':_0x3dbbc7,'rows':_0x3a4f8c}:null;}})[_0xa0f2('0x26')](respondWithResult(_0xa7a450,null))['catch'](handleError(_0xa7a450,null));};exports['setTags']=function(_0x3431ed,_0x59c6b4,_0x364f95){if(_0x3431ed['body']['id']){delete _0x3431ed[_0xa0f2('0x4a')]['id'];}return db[_0xa0f2('0x2c')][_0xa0f2('0x4e')]({'where':{'id':_0x3431ed[_0xa0f2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x59c6b4,null))['then'](function(_0x20c946){if(_0x20c946){return _0x20c946[_0xa0f2('0x54')](_0x3431ed[_0xa0f2('0x4a')][_0xa0f2('0x55')]||[]);}return null;})[_0xa0f2('0x26')](respondWithResult(_0x59c6b4,null))['catch'](handleError(_0x59c6b4,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index f29e71e..1e76a2e 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(_0x4004e4,_0x257d4a){var _0x2bcdaf=function(_0x2dc1bd){while(--_0x2dc1bd){_0x4004e4['push'](_0x4004e4['shift']());}};_0x2bcdaf(++_0x257d4a);}(_0x6cb4,0xff));var _0x46cb=function(_0x498399,_0x14ba6b){_0x498399=_0x498399-0x0;var _0x3f6c7b=_0x6cb4[_0x498399];return _0x3f6c7b;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var logger=require(_0x46cb('0x2'))(_0x46cb('0x3'));var moment=require(_0x46cb('0x4'));var BPromise=require(_0x46cb('0x5'));var rp=require(_0x46cb('0x6'));var fs=require('fs');var path=require(_0x46cb('0x7'));var rimraf=require(_0x46cb('0x8'));var config=require('../../config/environment');var attributes=require(_0x46cb('0x9'));module['exports']=function(_0x3d9d3c,_0x4d9f1d){return _0x3d9d3c[_0x46cb('0xa')](_0x46cb('0xb'),attributes,{'tableName':_0x46cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0598=['ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','request-promise','path','exports'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x0598,0x92));var _0x8059=function(_0x18f3b9,_0xdf4bd8){_0x18f3b9=_0x18f3b9-0x0;var _0x460e53=_0x0598[_0x18f3b9];return _0x460e53;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var logger=require('../../config/logger')(_0x8059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8059('0x3'));var fs=require('fs');var path=require(_0x8059('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0x8059('0x5')]=function(_0xa7d7c1,_0x512c0f){return _0xa7d7c1['define'](_0x8059('0x6'),attributes,{'tableName':_0x8059('0x7'),'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 63ca4f5..76bc610 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 _0x3277=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ZendeskConfiguration,\x20%s,\x20%s','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x194acc,_0x16a88a){var _0x2b7aab=function(_0x52944f){while(--_0x52944f){_0x194acc['push'](_0x194acc['shift']());}};_0x2b7aab(++_0x16a88a);}(_0x3277,0x16a));var _0x7327=function(_0x295ae4,_0x3838ce){_0x295ae4=_0x295ae4-0x0;var _0x12437b=_0x3277[_0x295ae4];return _0x12437b;};'use strict';var _=require('lodash');var util=require(_0x7327('0x0'));var moment=require(_0x7327('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7327('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7327('0x3'));var logger=require(_0x7327('0x4'))(_0x7327('0x5'));var config=require(_0x7327('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7327('0x7')][_0x7327('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4123c5,_0x16a9e5,_0x30ab66){return new BPromise(function(_0x24f5a7,_0x5098fa){return client[_0x7327('0x9')](_0x4123c5,_0x30ab66)[_0x7327('0xa')](function(_0x59d75d){logger[_0x7327('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x16a9e5,_0x7327('0xc'));logger[_0x7327('0xd')](_0x7327('0xe'),_0x16a9e5,'request\x20sent',JSON[_0x7327('0xf')](_0x59d75d));if(_0x59d75d[_0x7327('0x10')]){if(_0x59d75d['error'][_0x7327('0x11')]===0x1f4){logger[_0x7327('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x16a9e5,_0x59d75d[_0x7327('0x10')][_0x7327('0x12')]);return _0x5098fa(_0x59d75d[_0x7327('0x10')][_0x7327('0x12')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x16a9e5,_0x59d75d['error'][_0x7327('0x12')]);return _0x24f5a7(_0x59d75d[_0x7327('0x10')][_0x7327('0x12')]);}else{logger[_0x7327('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x16a9e5,'request\x20sent');_0x24f5a7(_0x59d75d[_0x7327('0x13')][_0x7327('0x12')]);}})[_0x7327('0x14')](function(_0x25ca17){logger['error'](_0x7327('0x15'),_0x16a9e5,_0x25ca17);_0x5098fa(_0x25ca17);});});} \ No newline at end of file +var _0xb24b=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x136f86,_0x2b6a1e){var _0x3b8353=function(_0x181ca9){while(--_0x181ca9){_0x136f86['push'](_0x136f86['shift']());}};_0x3b8353(++_0x2b6a1e);}(_0xb24b,0x157));var _0xbb24=function(_0x48bf2a,_0x5e4c34){_0x48bf2a=_0x48bf2a-0x0;var _0x5385b8=_0xb24b[_0x48bf2a];return _0x5385b8;};'use strict';var _=require(_0xbb24('0x0'));var util=require(_0xbb24('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbb24('0x2'));var fs=require('fs');var Redis=require(_0xbb24('0x3'));var db=require(_0xbb24('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb24('0x5'))(_0xbb24('0x6'));var config=require(_0xbb24('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbb24('0x8')][_0xbb24('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a1ed1,_0x2171fe,_0x12efb4){return new BPromise(function(_0x302979,_0x34c8ea){return client['request'](_0x2a1ed1,_0x12efb4)[_0xbb24('0xa')](function(_0x234f77){logger[_0xbb24('0xb')](_0xbb24('0xc'),_0x2171fe,_0xbb24('0xd'));logger[_0xbb24('0xe')](_0xbb24('0xf'),_0x2171fe,_0xbb24('0xd'),JSON[_0xbb24('0x10')](_0x234f77));if(_0x234f77['error']){if(_0x234f77['error'][_0xbb24('0x11')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x2171fe,_0x234f77['error'][_0xbb24('0x12')]);return _0x34c8ea(_0x234f77[_0xbb24('0x13')][_0xbb24('0x12')]);}logger['error'](_0xbb24('0xc'),_0x2171fe,_0x234f77[_0xbb24('0x13')][_0xbb24('0x12')]);return _0x302979(_0x234f77[_0xbb24('0x13')][_0xbb24('0x12')]);}else{logger['info'](_0xbb24('0xc'),_0x2171fe,_0xbb24('0xd'));_0x302979(_0x234f77['result'][_0xbb24('0x12')]);}})[_0xbb24('0x14')](function(_0x4543ec){logger['error'](_0xbb24('0xc'),_0x2171fe,_0x4543ec);_0x34c8ea(_0x4543ec);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index b1316b8..826a5fd 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 _0x8a65=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','index','/:id','isAuthenticated','show','create','put'];(function(_0x3e4dca,_0x4541b3){var _0x3d3e08=function(_0x2f9d03){while(--_0x2f9d03){_0x3e4dca['push'](_0x3e4dca['shift']());}};_0x3d3e08(++_0x4541b3);}(_0x8a65,0x1b2));var _0x58a6=function(_0x86337d,_0x2b57c3){_0x86337d=_0x86337d-0x0;var _0x22b2c6=_0x8a65[_0x86337d];return _0x22b2c6;};'use strict';var multer=require(_0x58a6('0x0'));var util=require(_0x58a6('0x1'));var path=require(_0x58a6('0x2'));var timeout=require(_0x58a6('0x3'));var express=require('express');var router=express[_0x58a6('0x4')]();var fs_extra=require(_0x58a6('0x5'));var auth=require(_0x58a6('0x6'));var interaction=require(_0x58a6('0x7'));var config=require(_0x58a6('0x8'));var controller=require(_0x58a6('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x58a6('0xa')]);router['get'](_0x58a6('0xb'),auth[_0x58a6('0xc')](),controller[_0x58a6('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x58a6('0xe')]);router[_0x58a6('0xf')]('/:id',auth[_0x58a6('0xc')](),controller['update']);router[_0x58a6('0x10')]('/:id',auth[_0x58a6('0xc')](),controller['destroy']);module[_0x58a6('0x11')]=router; \ No newline at end of file +var _0xf12e=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','post','create'];(function(_0xe66069,_0xa9cbc1){var _0x3b6e86=function(_0x12370c){while(--_0x12370c){_0xe66069['push'](_0xe66069['shift']());}};_0x3b6e86(++_0xa9cbc1);}(_0xf12e,0x1eb));var _0xef12=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0xf12e[_0x46361e];return _0x14e302;};'use strict';var multer=require(_0xef12('0x0'));var util=require(_0xef12('0x1'));var path=require(_0xef12('0x2'));var timeout=require(_0xef12('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xef12('0x4'));var auth=require(_0xef12('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router[_0xef12('0x6')]('/',auth[_0xef12('0x7')](),controller[_0xef12('0x8')]);router['get'](_0xef12('0x9'),auth[_0xef12('0x7')](),controller[_0xef12('0xa')]);router[_0xef12('0xb')]('/',auth[_0xef12('0x7')](),controller[_0xef12('0xc')]);router[_0xef12('0xd')](_0xef12('0x9'),auth['isAuthenticated'](),controller[_0xef12('0xe')]);router[_0xef12('0xf')](_0xef12('0x9'),auth['isAuthenticated'](),controller[_0xef12('0x10')]);module[_0xef12('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 93e8d4b..a8802f7 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 _0x974c=['variable','keyValue','picklist','STRING','string','BOOLEAN','sequelize','exports','ENUM'];(function(_0x55cf16,_0x1ca391){var _0x1e85b6=function(_0x139b91){while(--_0x139b91){_0x55cf16['push'](_0x55cf16['shift']());}};_0x1e85b6(++_0x1ca391);}(_0x974c,0xf9));var _0xc974=function(_0x305dc2,_0x81cbe0){_0x305dc2=_0x305dc2-0x0;var _0x5c1c2e=_0x974c[_0x305dc2];return _0x5c1c2e;};'use strict';var Sequelize=require(_0xc974('0x0'));module[_0xc974('0x1')]={'type':{'type':Sequelize[_0xc974('0x2')]('string',_0xc974('0x3'),'customVariable',_0xc974('0x4'),_0xc974('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc974('0x6')]},'key':{'type':Sequelize[_0xc974('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xc974('0x7'),_0xc974('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xc974('0x6')]},'idField':{'type':Sequelize[_0xc974('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc974('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0d60=['customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x2ae16b,_0x109f84){var _0x4a3b3b=function(_0x82cd92){while(--_0x82cd92){_0x2ae16b['push'](_0x2ae16b['shift']());}};_0x4a3b3b(++_0x109f84);}(_0x0d60,0xf2));var _0x00d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d60[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x00d6('0x0'));module[_0x00d6('0x1')]={'type':{'type':Sequelize[_0x00d6('0x2')](_0x00d6('0x3'),_0x00d6('0x4'),'customVariable',_0x00d6('0x5'),_0x00d6('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x00d6('0x7')]},'key':{'type':Sequelize[_0x00d6('0x7')]},'keyType':{'type':Sequelize[_0x00d6('0x2')](_0x00d6('0x3'),_0x00d6('0x4'),_0x00d6('0x8'))},'keyContent':{'type':Sequelize[_0x00d6('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x00d6('0x7')]},'customField':{'type':Sequelize[_0x00d6('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x00d6('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 5530fdb..c91181f 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 _0xfde6=['ZendeskField','rawAttributes','fieldName','type','key','model','map','keys','query','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','intersection','find','create','body','update','params','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send'];(function(_0x53276c,_0x6a1efe){var _0x4b2bcb=function(_0xdfa108){while(--_0xdfa108){_0x53276c['push'](_0x53276c['shift']());}};_0x4b2bcb(++_0x6a1efe);}(_0xfde6,0x19f));var _0x6fde=function(_0x12c005,_0x398274){_0x12c005=_0x12c005-0x0;var _0x3edc45=_0xfde6[_0x12c005];return _0x3edc45;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6fde('0x0'));var rp=require('request-promise');var moment=require(_0x6fde('0x1'));var BPromise=require(_0x6fde('0x2'));var Mustache=require(_0x6fde('0x3'));var util=require(_0x6fde('0x4'));var path=require(_0x6fde('0x5'));var sox=require(_0x6fde('0x6'));var csv=require(_0x6fde('0x7'));var ejs=require(_0x6fde('0x8'));var fs=require('fs');var fs_extra=require(_0x6fde('0x9'));var _=require(_0x6fde('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6fde('0xb'));var deskjs=require(_0x6fde('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6fde('0xd'));var Papa=require(_0x6fde('0xe'));var Redis=require('ioredis');var authService=require(_0x6fde('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6fde('0x10'));var hardwareService=require(_0x6fde('0x11'));var logger=require(_0x6fde('0x12'))(_0x6fde('0x13'));var utils=require(_0x6fde('0x14'));var config=require(_0x6fde('0x15'));var licenseUtil=require(_0x6fde('0x16'));var db=require(_0x6fde('0x17'))['db'];function respondWithStatusCode(_0x203649,_0x1db44c){_0x1db44c=_0x1db44c||0xcc;return function(_0x1cf5ad){if(_0x1cf5ad){return _0x203649[_0x6fde('0x18')](_0x1db44c);}return _0x203649[_0x6fde('0x19')](_0x1db44c)[_0x6fde('0x1a')]();};}function respondWithResult(_0x262423,_0x8d82f0){_0x8d82f0=_0x8d82f0||0xc8;return function(_0x4f3b8b){if(_0x4f3b8b){return _0x262423['status'](_0x8d82f0)[_0x6fde('0x1b')](_0x4f3b8b);}};}function respondWithFilteredResult(_0x500f7d,_0x4ec874){return function(_0x518914){if(_0x518914){var _0x1a0e6d=typeof _0x4ec874['offset']===_0x6fde('0x1c')&&typeof _0x4ec874['limit']===_0x6fde('0x1c');var _0x385956=_0x518914[_0x6fde('0x1d')];var _0x4ab384=_0x1a0e6d?0x0:_0x4ec874['offset'];var _0x4319cd=_0x1a0e6d?_0x518914[_0x6fde('0x1d')]:_0x4ec874['offset']+_0x4ec874[_0x6fde('0x1e')];var _0x3e89ec;if(_0x4319cd>=_0x385956){_0x4319cd=_0x385956;_0x3e89ec=0xc8;}else{_0x3e89ec=0xce;}_0x500f7d[_0x6fde('0x19')](_0x3e89ec);return _0x500f7d[_0x6fde('0x1f')](_0x6fde('0x20'),_0x4ab384+'-'+_0x4319cd+'/'+_0x385956)[_0x6fde('0x1b')](_0x518914);}return null;};}function patchUpdates(_0x303268){return function(_0x2f98fe){try{jsonpatch[_0x6fde('0x21')](_0x2f98fe,_0x303268,!![]);}catch(_0x8390f2){return BPromise[_0x6fde('0x22')](_0x8390f2);}return _0x2f98fe[_0x6fde('0x23')]();};}function saveUpdates(_0xb0fd20,_0x35955d){return function(_0x3139ba){if(_0x3139ba){return _0x3139ba['update'](_0xb0fd20)[_0x6fde('0x24')](function(_0x3949dc){return _0x3949dc;});}return null;};}function removeEntity(_0x40e988,_0x169c78){return function(_0x572b1e){if(_0x572b1e){return _0x572b1e[_0x6fde('0x25')]()[_0x6fde('0x24')](function(){_0x40e988[_0x6fde('0x19')](0xcc)[_0x6fde('0x1a')]();});}};}function handleEntityNotFound(_0x5ad904,_0x30823f){return function(_0x9ac67b){if(!_0x9ac67b){_0x5ad904[_0x6fde('0x18')](0x194);}return _0x9ac67b;};}function handleError(_0x3d48c8,_0x5c5d38){_0x5c5d38=_0x5c5d38||0x1f4;return function(_0x217b29){logger[_0x6fde('0x26')](_0x217b29['stack']);if(_0x217b29[_0x6fde('0x27')]){delete _0x217b29[_0x6fde('0x27')];}_0x3d48c8['status'](_0x5c5d38)[_0x6fde('0x28')](_0x217b29);};}exports['index']=function(_0x3eafe2,_0x29be11){var _0x2f2b0b={},_0x185ac7={},_0x58b8f2={'count':0x0,'rows':[]};var _0x2f2afa=_['map'](db[_0x6fde('0x29')][_0x6fde('0x2a')],function(_0x4abacc){return{'name':_0x4abacc[_0x6fde('0x2b')],'type':_0x4abacc[_0x6fde('0x2c')][_0x6fde('0x2d')]};});_0x185ac7[_0x6fde('0x2e')]=_[_0x6fde('0x2f')](_0x2f2afa,_0x6fde('0x27'));_0x185ac7['query']=_[_0x6fde('0x30')](_0x3eafe2[_0x6fde('0x31')]);_0x185ac7['filters']=_['intersection'](_0x185ac7[_0x6fde('0x2e')],_0x185ac7['query']);_0x2f2b0b[_0x6fde('0x32')]=_['intersection'](_0x185ac7[_0x6fde('0x2e')],qs[_0x6fde('0x33')](_0x3eafe2[_0x6fde('0x31')][_0x6fde('0x33')]));_0x2f2b0b[_0x6fde('0x32')]=_0x2f2b0b['attributes'][_0x6fde('0x34')]?_0x2f2b0b[_0x6fde('0x32')]:_0x185ac7[_0x6fde('0x2e')];if(!_0x3eafe2['query'][_0x6fde('0x35')](_0x6fde('0x36'))){_0x2f2b0b[_0x6fde('0x1e')]=qs['limit'](_0x3eafe2[_0x6fde('0x31')][_0x6fde('0x1e')]);_0x2f2b0b[_0x6fde('0x37')]=qs['offset'](_0x3eafe2[_0x6fde('0x31')]['offset']);}_0x2f2b0b[_0x6fde('0x38')]=qs[_0x6fde('0x39')](_0x3eafe2[_0x6fde('0x31')][_0x6fde('0x39')]);_0x2f2b0b[_0x6fde('0x3a')]=qs[_0x6fde('0x3b')](_[_0x6fde('0x3c')](_0x3eafe2[_0x6fde('0x31')],_0x185ac7['filters']),_0x2f2afa);if(_0x3eafe2['query'][_0x6fde('0x3d')]){_0x2f2b0b[_0x6fde('0x3a')]=_['merge'](_0x2f2b0b[_0x6fde('0x3a')],{'$or':_['map'](_0x2f2afa,function(_0x47447d){if(_0x47447d[_0x6fde('0x2c')]!==_0x6fde('0x3e')){var _0x5a66a2={};_0x5a66a2[_0x47447d[_0x6fde('0x27')]]={'$like':'%'+_0x3eafe2[_0x6fde('0x31')][_0x6fde('0x3d')]+'%'};return _0x5a66a2;}})});}_0x2f2b0b=_[_0x6fde('0x3f')]({},_0x2f2b0b,_0x3eafe2[_0x6fde('0x40')]);var _0x3eca02={'where':_0x2f2b0b[_0x6fde('0x3a')]};return db[_0x6fde('0x29')]['count'](_0x3eca02)['then'](function(_0x25990e){_0x58b8f2[_0x6fde('0x1d')]=_0x25990e;if(_0x3eafe2[_0x6fde('0x31')][_0x6fde('0x41')]){_0x2f2b0b[_0x6fde('0x42')]=[{'all':!![]}];}return db[_0x6fde('0x29')]['findAll'](_0x2f2b0b);})[_0x6fde('0x24')](function(_0x3f6fd4){_0x58b8f2[_0x6fde('0x43')]=_0x3f6fd4;return _0x58b8f2;})[_0x6fde('0x24')](respondWithFilteredResult(_0x29be11,_0x2f2b0b))[_0x6fde('0x44')](handleError(_0x29be11,null));};exports[_0x6fde('0x45')]=function(_0x329fc8,_0x2b2a5a){var _0x52d0c2={'raw':!![],'where':{'id':_0x329fc8['params']['id']}},_0x38c7aa={};_0x38c7aa[_0x6fde('0x2e')]=_['keys'](db[_0x6fde('0x29')][_0x6fde('0x2a')]);_0x38c7aa['query']=_[_0x6fde('0x30')](_0x329fc8[_0x6fde('0x31')]);_0x38c7aa[_0x6fde('0x3b')]=_[_0x6fde('0x46')](_0x38c7aa[_0x6fde('0x2e')],_0x38c7aa[_0x6fde('0x31')]);_0x52d0c2['attributes']=_['intersection'](_0x38c7aa[_0x6fde('0x2e')],qs['fields'](_0x329fc8[_0x6fde('0x31')][_0x6fde('0x33')]));_0x52d0c2[_0x6fde('0x32')]=_0x52d0c2[_0x6fde('0x32')][_0x6fde('0x34')]?_0x52d0c2[_0x6fde('0x32')]:_0x38c7aa[_0x6fde('0x2e')];if(_0x329fc8[_0x6fde('0x31')][_0x6fde('0x41')]){_0x52d0c2[_0x6fde('0x42')]=[{'all':!![]}];}_0x52d0c2=_[_0x6fde('0x3f')]({},_0x52d0c2,_0x329fc8['options']);return db[_0x6fde('0x29')][_0x6fde('0x47')](_0x52d0c2)[_0x6fde('0x24')](handleEntityNotFound(_0x2b2a5a,null))['then'](respondWithResult(_0x2b2a5a,null))[_0x6fde('0x44')](handleError(_0x2b2a5a,null));};exports[_0x6fde('0x48')]=function(_0x26de38,_0x485359){return db[_0x6fde('0x29')][_0x6fde('0x48')](_0x26de38[_0x6fde('0x49')],{})['then'](respondWithResult(_0x485359,0xc9))[_0x6fde('0x44')](handleError(_0x485359,null));};exports[_0x6fde('0x4a')]=function(_0x10a66b,_0x5189f9){if(_0x10a66b['body']['id']){delete _0x10a66b['body']['id'];}return db[_0x6fde('0x29')][_0x6fde('0x47')]({'where':{'id':_0x10a66b[_0x6fde('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5189f9,null))[_0x6fde('0x24')](saveUpdates(_0x10a66b[_0x6fde('0x49')],null))['then'](respondWithResult(_0x5189f9,null))[_0x6fde('0x44')](handleError(_0x5189f9,null));};exports['destroy']=function(_0x3c98b6,_0x11b394){return db[_0x6fde('0x29')][_0x6fde('0x47')]({'where':{'id':_0x3c98b6[_0x6fde('0x4b')]['id']}})['then'](handleEntityNotFound(_0x11b394,null))[_0x6fde('0x24')](removeEntity(_0x11b394,null))[_0x6fde('0x44')](handleError(_0x11b394,null));}; \ No newline at end of file +var _0x49e9=['status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','ZendeskField','rawAttributes','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x949e('0x0'));var rimraf=require(_0x949e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x949e('0x2'));var rp=require(_0x949e('0x3'));var moment=require(_0x949e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x949e('0x5'));var path=require('path');var sox=require(_0x949e('0x6'));var csv=require(_0x949e('0x7'));var ejs=require(_0x949e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x949e('0x9'));var squel=require(_0x949e('0xa'));var crypto=require(_0x949e('0xb'));var jsforce=require(_0x949e('0xc'));var deskjs=require(_0x949e('0xd'));var toCsv=require(_0x949e('0x7'));var querystring=require(_0x949e('0xe'));var Papa=require('papaparse');var Redis=require(_0x949e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x949e('0x10'));var as=require(_0x949e('0x11'));var hardwareService=require(_0x949e('0x12'));var logger=require('../../config/logger')(_0x949e('0x13'));var utils=require(_0x949e('0x14'));var config=require(_0x949e('0x15'));var licenseUtil=require(_0x949e('0x16'));var db=require(_0x949e('0x17'))['db'];function respondWithStatusCode(_0x253d5e,_0x1871a5){_0x1871a5=_0x1871a5||0xcc;return function(_0x17d1f3){if(_0x17d1f3){return _0x253d5e[_0x949e('0x18')](_0x1871a5);}return _0x253d5e[_0x949e('0x19')](_0x1871a5)[_0x949e('0x1a')]();};}function respondWithResult(_0x7a8954,_0x3e0e54){_0x3e0e54=_0x3e0e54||0xc8;return function(_0x7f8be2){if(_0x7f8be2){return _0x7a8954[_0x949e('0x19')](_0x3e0e54)['json'](_0x7f8be2);}};}function respondWithFilteredResult(_0x257981,_0x3d81cd){return function(_0x587bff){if(_0x587bff){var _0xf1f41a=typeof _0x3d81cd['offset']===_0x949e('0x1b')&&typeof _0x3d81cd[_0x949e('0x1c')]==='undefined';var _0x37fd96=_0x587bff[_0x949e('0x1d')];var _0x43498d=_0xf1f41a?0x0:_0x3d81cd[_0x949e('0x1e')];var _0x20333c=_0xf1f41a?_0x587bff['count']:_0x3d81cd[_0x949e('0x1e')]+_0x3d81cd[_0x949e('0x1c')];var _0x476fa8;if(_0x20333c>=_0x37fd96){_0x20333c=_0x37fd96;_0x476fa8=0xc8;}else{_0x476fa8=0xce;}_0x257981[_0x949e('0x19')](_0x476fa8);return _0x257981[_0x949e('0x1f')](_0x949e('0x20'),_0x43498d+'-'+_0x20333c+'/'+_0x37fd96)[_0x949e('0x21')](_0x587bff);}return null;};}function patchUpdates(_0x2f21bd){return function(_0x104740){try{jsonpatch[_0x949e('0x22')](_0x104740,_0x2f21bd,!![]);}catch(_0x23fc20){return BPromise[_0x949e('0x23')](_0x23fc20);}return _0x104740[_0x949e('0x24')]();};}function saveUpdates(_0x1927ab,_0x199d53){return function(_0x2e81f2){if(_0x2e81f2){return _0x2e81f2['update'](_0x1927ab)[_0x949e('0x25')](function(_0x44ffb4){return _0x44ffb4;});}return null;};}function removeEntity(_0x5572ae,_0x48a1d1){return function(_0x23b38e){if(_0x23b38e){return _0x23b38e[_0x949e('0x26')]()[_0x949e('0x25')](function(){_0x5572ae[_0x949e('0x19')](0xcc)[_0x949e('0x1a')]();});}};}function handleEntityNotFound(_0x1185b3,_0x29e07b){return function(_0x255b11){if(!_0x255b11){_0x1185b3[_0x949e('0x18')](0x194);}return _0x255b11;};}function handleError(_0x20258c,_0x5dcc46){_0x5dcc46=_0x5dcc46||0x1f4;return function(_0x212224){logger[_0x949e('0x27')](_0x212224['stack']);if(_0x212224[_0x949e('0x28')]){delete _0x212224[_0x949e('0x28')];}_0x20258c['status'](_0x5dcc46)[_0x949e('0x29')](_0x212224);};}exports[_0x949e('0x2a')]=function(_0x5b9f28,_0x1867d9){var _0x5b2b0b={},_0x5e6e34={},_0x4e169d={'count':0x0,'rows':[]};var _0x54ad5d=_['map'](db[_0x949e('0x2b')][_0x949e('0x2c')],function(_0x3051ec){return{'name':_0x3051ec['fieldName'],'type':_0x3051ec['type']['key']};});_0x5e6e34['model']=_[_0x949e('0x2d')](_0x54ad5d,_0x949e('0x28'));_0x5e6e34[_0x949e('0x2e')]=_[_0x949e('0x2f')](_0x5b9f28['query']);_0x5e6e34[_0x949e('0x30')]=_[_0x949e('0x31')](_0x5e6e34[_0x949e('0x32')],_0x5e6e34['query']);_0x5b2b0b[_0x949e('0x33')]=_[_0x949e('0x31')](_0x5e6e34[_0x949e('0x32')],qs['fields'](_0x5b9f28['query'][_0x949e('0x34')]));_0x5b2b0b[_0x949e('0x33')]=_0x5b2b0b[_0x949e('0x33')][_0x949e('0x35')]?_0x5b2b0b['attributes']:_0x5e6e34[_0x949e('0x32')];if(!_0x5b9f28[_0x949e('0x2e')][_0x949e('0x36')](_0x949e('0x37'))){_0x5b2b0b[_0x949e('0x1c')]=qs[_0x949e('0x1c')](_0x5b9f28[_0x949e('0x2e')][_0x949e('0x1c')]);_0x5b2b0b['offset']=qs['offset'](_0x5b9f28[_0x949e('0x2e')]['offset']);}_0x5b2b0b['order']=qs[_0x949e('0x38')](_0x5b9f28[_0x949e('0x2e')][_0x949e('0x38')]);_0x5b2b0b[_0x949e('0x39')]=qs[_0x949e('0x30')](_[_0x949e('0x3a')](_0x5b9f28[_0x949e('0x2e')],_0x5e6e34[_0x949e('0x30')]),_0x54ad5d);if(_0x5b9f28[_0x949e('0x2e')][_0x949e('0x3b')]){_0x5b2b0b[_0x949e('0x39')]=_[_0x949e('0x3c')](_0x5b2b0b[_0x949e('0x39')],{'$or':_[_0x949e('0x2d')](_0x54ad5d,function(_0x26ad2b){if(_0x26ad2b[_0x949e('0x3d')]!==_0x949e('0x3e')){var _0x498fa3={};_0x498fa3[_0x26ad2b[_0x949e('0x28')]]={'$like':'%'+_0x5b9f28['query'][_0x949e('0x3b')]+'%'};return _0x498fa3;}})});}_0x5b2b0b=_[_0x949e('0x3c')]({},_0x5b2b0b,_0x5b9f28['options']);var _0x5084dc={'where':_0x5b2b0b['where']};return db[_0x949e('0x2b')][_0x949e('0x1d')](_0x5084dc)['then'](function(_0x59c024){_0x4e169d['count']=_0x59c024;if(_0x5b9f28[_0x949e('0x2e')][_0x949e('0x3f')]){_0x5b2b0b['include']=[{'all':!![]}];}return db[_0x949e('0x2b')][_0x949e('0x40')](_0x5b2b0b);})['then'](function(_0x3a1bc7){_0x4e169d[_0x949e('0x41')]=_0x3a1bc7;return _0x4e169d;})[_0x949e('0x25')](respondWithFilteredResult(_0x1867d9,_0x5b2b0b))[_0x949e('0x42')](handleError(_0x1867d9,null));};exports['show']=function(_0x58b34b,_0x2bca69){var _0x590aa7={'raw':!![],'where':{'id':_0x58b34b[_0x949e('0x43')]['id']}},_0x7201da={};_0x7201da[_0x949e('0x32')]=_[_0x949e('0x2f')](db[_0x949e('0x2b')]['rawAttributes']);_0x7201da['query']=_[_0x949e('0x2f')](_0x58b34b['query']);_0x7201da[_0x949e('0x30')]=_[_0x949e('0x31')](_0x7201da[_0x949e('0x32')],_0x7201da[_0x949e('0x2e')]);_0x590aa7[_0x949e('0x33')]=_[_0x949e('0x31')](_0x7201da['model'],qs['fields'](_0x58b34b[_0x949e('0x2e')][_0x949e('0x34')]));_0x590aa7[_0x949e('0x33')]=_0x590aa7[_0x949e('0x33')][_0x949e('0x35')]?_0x590aa7['attributes']:_0x7201da[_0x949e('0x32')];if(_0x58b34b[_0x949e('0x2e')]['includeAll']){_0x590aa7[_0x949e('0x44')]=[{'all':!![]}];}_0x590aa7=_[_0x949e('0x3c')]({},_0x590aa7,_0x58b34b[_0x949e('0x45')]);return db[_0x949e('0x2b')][_0x949e('0x46')](_0x590aa7)[_0x949e('0x25')](handleEntityNotFound(_0x2bca69,null))[_0x949e('0x25')](respondWithResult(_0x2bca69,null))[_0x949e('0x42')](handleError(_0x2bca69,null));};exports[_0x949e('0x47')]=function(_0x4913f5,_0x1599ea){return db['ZendeskField'][_0x949e('0x47')](_0x4913f5[_0x949e('0x48')],{})['then'](respondWithResult(_0x1599ea,0xc9))[_0x949e('0x42')](handleError(_0x1599ea,null));};exports[_0x949e('0x49')]=function(_0x121355,_0x2e2b6a){if(_0x121355[_0x949e('0x48')]['id']){delete _0x121355[_0x949e('0x48')]['id'];}return db[_0x949e('0x2b')][_0x949e('0x46')]({'where':{'id':_0x121355['params']['id']}})[_0x949e('0x25')](handleEntityNotFound(_0x2e2b6a,null))[_0x949e('0x25')](saveUpdates(_0x121355[_0x949e('0x48')],null))[_0x949e('0x25')](respondWithResult(_0x2e2b6a,null))[_0x949e('0x42')](handleError(_0x2e2b6a,null));};exports['destroy']=function(_0x5f23b2,_0x46a4fe){return db[_0x949e('0x2b')]['find']({'where':{'id':_0x5f23b2[_0x949e('0x43')]['id']}})[_0x949e('0x25')](handleEntityNotFound(_0x46a4fe,null))[_0x949e('0x25')](removeEntity(_0x46a4fe,null))[_0x949e('0x42')](handleError(_0x46a4fe,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 8bcea99..f0cfc15 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 _0x021e=['zendesk_unique_index','idField','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','ZendeskField','int_zendesk_fields'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x021e,0xf9));var _0xe021=function(_0x21a7c3,_0x135dd1){_0x21a7c3=_0x21a7c3-0x0;var _0x5a6d36=_0x021e[_0x21a7c3];return _0x5a6d36;};'use strict';var _=require('lodash');var util=require(_0xe021('0x0'));var logger=require(_0xe021('0x1'))(_0xe021('0x2'));var moment=require(_0xe021('0x3'));var BPromise=require(_0xe021('0x4'));var rp=require(_0xe021('0x5'));var fs=require('fs');var path=require(_0xe021('0x6'));var rimraf=require(_0xe021('0x7'));var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module[_0xe021('0x8')]=function(_0x2d2889,_0x3f9103){return _0x2d2889['define'](_0xe021('0x9'),attributes,{'tableName':_0xe021('0xa'),'paranoid':![],'indexes':[{'name':_0xe021('0xb'),'fields':[_0xe021('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdeeb=['exports','zendesk_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xdeeb,0x121));var _0xbdee=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0xdeeb[_0xbb9dbf];return _0x30223c;};'use strict';var _=require(_0xbdee('0x0'));var util=require(_0xbdee('0x1'));var logger=require(_0xbdee('0x2'))(_0xbdee('0x3'));var moment=require(_0xbdee('0x4'));var BPromise=require(_0xbdee('0x5'));var rp=require(_0xbdee('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbdee('0x7'));var config=require(_0xbdee('0x8'));var attributes=require(_0xbdee('0x9'));module[_0xbdee('0xa')]=function(_0x307d71,_0x1af9c6){return _0x307d71['define']('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xbdee('0xb'),'fields':[_0xbdee('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index f7a3227..043a8f6 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 _0x6123=['request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x12c250,_0x326ae8){var _0x5eb220=function(_0x4484d0){while(--_0x4484d0){_0x12c250['push'](_0x12c250['shift']());}};_0x5eb220(++_0x326ae8);}(_0x6123,0x101));var _0x3612=function(_0x2cf224,_0x2f2384){_0x2cf224=_0x2cf224-0x0;var _0x5765bd=_0x6123[_0x2cf224];return _0x5765bd;};'use strict';var _=require('lodash');var util=require(_0x3612('0x0'));var moment=require(_0x3612('0x1'));var BPromise=require(_0x3612('0x2'));var rs=require(_0x3612('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3612('0x4'));var logger=require(_0x3612('0x5'))(_0x3612('0x6'));var config=require(_0x3612('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3612('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a0b2f,_0x841d4d,_0x16df13){return new BPromise(function(_0xb1fe96,_0x18d786){return client[_0x3612('0x9')](_0x5a0b2f,_0x16df13)['then'](function(_0x2f5f5a){logger[_0x3612('0xa')](_0x3612('0xb'),_0x841d4d,_0x3612('0xc'));logger['debug'](_0x3612('0xd'),_0x841d4d,'request\x20sent',JSON[_0x3612('0xe')](_0x2f5f5a));if(_0x2f5f5a['error']){if(_0x2f5f5a[_0x3612('0xf')][_0x3612('0x10')]===0x1f4){logger[_0x3612('0xf')](_0x3612('0xb'),_0x841d4d,_0x2f5f5a['error'][_0x3612('0x11')]);return _0x18d786(_0x2f5f5a[_0x3612('0xf')][_0x3612('0x11')]);}logger[_0x3612('0xf')]('ZendeskField,\x20%s,\x20%s',_0x841d4d,_0x2f5f5a[_0x3612('0xf')][_0x3612('0x11')]);return _0xb1fe96(_0x2f5f5a[_0x3612('0xf')][_0x3612('0x11')]);}else{logger[_0x3612('0xa')](_0x3612('0xb'),_0x841d4d,'request\x20sent');_0xb1fe96(_0x2f5f5a[_0x3612('0x12')]['message']);}})['catch'](function(_0x578702){logger['error'](_0x3612('0xb'),_0x841d4d,_0x578702);_0x18d786(_0x578702);});});} \ No newline at end of file +var _0xe591=['bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment'];(function(_0x185ae5,_0x5a0094){var _0x35d6f7=function(_0x1e718a){while(--_0x1e718a){_0x185ae5['push'](_0x185ae5['shift']());}};_0x35d6f7(++_0x5a0094);}(_0xe591,0xf9));var _0x1e59=function(_0x4c1acc,_0x251090){_0x4c1acc=_0x4c1acc-0x0;var _0x4847ee=_0xe591[_0x4c1acc];return _0x4847ee;};'use strict';var _=require(_0x1e59('0x0'));var util=require(_0x1e59('0x1'));var moment=require(_0x1e59('0x2'));var BPromise=require(_0x1e59('0x3'));var rs=require(_0x1e59('0x4'));var fs=require('fs');var Redis=require(_0x1e59('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1e59('0x6'));var config=require(_0x1e59('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1e59('0x8')][_0x1e59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412b07,_0x3eabe8,_0x28cbd7){return new BPromise(function(_0x70f772,_0x3f952b){return client[_0x1e59('0xa')](_0x412b07,_0x28cbd7)[_0x1e59('0xb')](function(_0x34719f){logger[_0x1e59('0xc')](_0x1e59('0xd'),_0x3eabe8,_0x1e59('0xe'));logger[_0x1e59('0xf')](_0x1e59('0x10'),_0x3eabe8,'request\x20sent',JSON['stringify'](_0x34719f));if(_0x34719f[_0x1e59('0x11')]){if(_0x34719f['error']['code']===0x1f4){logger[_0x1e59('0x11')](_0x1e59('0xd'),_0x3eabe8,_0x34719f[_0x1e59('0x11')]['message']);return _0x3f952b(_0x34719f[_0x1e59('0x11')][_0x1e59('0x12')]);}logger[_0x1e59('0x11')]('ZendeskField,\x20%s,\x20%s',_0x3eabe8,_0x34719f['error'][_0x1e59('0x12')]);return _0x70f772(_0x34719f['error'][_0x1e59('0x12')]);}else{logger[_0x1e59('0xc')](_0x1e59('0xd'),_0x3eabe8,_0x1e59('0xe'));_0x70f772(_0x34719f[_0x1e59('0x13')][_0x1e59('0x12')]);}})[_0x1e59('0x14')](function(_0x4e4835){logger[_0x1e59('0x11')](_0x1e59('0xd'),_0x3eabe8,_0x4e4835);_0x3f952b(_0x4e4835);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 4af0fdd..28e8ea2 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 _0x5959=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post'];(function(_0x27ef8c,_0x5a3640){var _0x1abe1f=function(_0x57db3e){while(--_0x57db3e){_0x27ef8c['push'](_0x27ef8c['shift']());}};_0x1abe1f(++_0x5a3640);}(_0x5959,0x95));var _0x9595=function(_0x31300c,_0x2823e1){_0x31300c=_0x31300c-0x0;var _0x462408=_0x5959[_0x31300c];return _0x462408;};'use strict';var multer=require(_0x9595('0x0'));var util=require(_0x9595('0x1'));var path=require(_0x9595('0x2'));var timeout=require(_0x9595('0x3'));var express=require(_0x9595('0x4'));var router=express[_0x9595('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9595('0x6'));var interaction=require(_0x9595('0x7'));var config=require(_0x9595('0x8'));var controller=require(_0x9595('0x9'));router[_0x9595('0xa')]('/',auth[_0x9595('0xb')](),controller[_0x9595('0xc')]);router[_0x9595('0xa')](_0x9595('0xd'),auth[_0x9595('0xb')](),controller[_0x9595('0xe')]);router['get'](_0x9595('0xf'),auth[_0x9595('0xb')](),controller['getConfigurations']);router[_0x9595('0xa')](_0x9595('0x10'),auth[_0x9595('0xb')](),controller[_0x9595('0x11')]);router[_0x9595('0x12')]('/',auth[_0x9595('0xb')](),controller[_0x9595('0x13')]);router[_0x9595('0x12')](_0x9595('0xf'),auth[_0x9595('0xb')](),controller['addConfiguration']);router['put'](_0x9595('0xd'),auth['isAuthenticated'](),controller[_0x9595('0x14')]);router[_0x9595('0x15')](_0x9595('0xd'),auth[_0x9595('0xb')](),controller[_0x9595('0x16')]);module[_0x9595('0x17')]=router; \ No newline at end of file +var _0x287d=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x514530,_0x2c1fb4){var _0x4fc816=function(_0x28993f){while(--_0x28993f){_0x514530['push'](_0x514530['shift']());}};_0x4fc816(++_0x2c1fb4);}(_0x287d,0x83));var _0xd287=function(_0x8962d6,_0x503ed6){_0x8962d6=_0x8962d6-0x0;var _0x566f25=_0x287d[_0x8962d6];return _0x566f25;};'use strict';var multer=require('multer');var util=require(_0xd287('0x0'));var path=require('path');var timeout=require(_0xd287('0x1'));var express=require(_0xd287('0x2'));var router=express['Router']();var fs_extra=require(_0xd287('0x3'));var auth=require(_0xd287('0x4'));var interaction=require(_0xd287('0x5'));var config=require(_0xd287('0x6'));var controller=require(_0xd287('0x7'));router[_0xd287('0x8')]('/',auth[_0xd287('0x9')](),controller[_0xd287('0xa')]);router[_0xd287('0x8')](_0xd287('0xb'),auth[_0xd287('0x9')](),controller[_0xd287('0xc')]);router[_0xd287('0x8')](_0xd287('0xd'),auth[_0xd287('0x9')](),controller[_0xd287('0xe')]);router['get'](_0xd287('0xf'),auth[_0xd287('0x9')](),controller[_0xd287('0x10')]);router[_0xd287('0x11')]('/',auth[_0xd287('0x9')](),controller['create']);router['post'](_0xd287('0xd'),auth['isAuthenticated'](),controller[_0xd287('0x12')]);router[_0xd287('0x13')](_0xd287('0xb'),auth[_0xd287('0x9')](),controller[_0xd287('0x14')]);router[_0xd287('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xd287('0x16')]);module[_0xd287('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 49f540e..81cee0e 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 _0x84ab=['sequelize','exports','STRING'];(function(_0x3e05f1,_0x218b08){var _0x12e740=function(_0x40a7a8){while(--_0x40a7a8){_0x3e05f1['push'](_0x3e05f1['shift']());}};_0x12e740(++_0x218b08);}(_0x84ab,0x12f));var _0xb84a=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x84ab[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'name':{'type':Sequelize[_0xb84a('0x2')]},'description':{'type':Sequelize[_0xb84a('0x2')]},'host':{'type':Sequelize[_0xb84a('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb84a('0x2')]},'clientSecret':{'type':Sequelize[_0xb84a('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0xb84a('0x2')]},'refreshToken':{'type':Sequelize[_0xb84a('0x2')]}}; \ No newline at end of file +var _0xda55=['STRING','sequelize','exports'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xda55,0x6d));var _0x5da5=function(_0x23b2b4,_0x1af875){_0x23b2b4=_0x23b2b4-0x0;var _0x4918ae=_0xda55[_0x23b2b4];return _0x4918ae;};'use strict';var Sequelize=require(_0x5da5('0x0'));module[_0x5da5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x5da5('0x2')]},'zone':{'type':Sequelize[_0x5da5('0x2')]},'clientId':{'type':Sequelize[_0x5da5('0x2')]},'clientSecret':{'type':Sequelize[_0x5da5('0x2')]},'serverUrl':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x5da5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 325f5aa..5c864b6 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 _0x2682=['to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','findOne','ZohoConfiguration','pick','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','refreshToken','clientSecret','access_token','getFields','clientId','serverUrl','code','zoho.eu','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','error','message','Owner','WhoId','Call_Duration','Call_Result','remove','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2571d8,_0x5c090f){var _0x2253b9=function(_0x2ecf76){while(--_0x2ecf76){_0x2571d8['push'](_0x2571d8['shift']());}};_0x2253b9(++_0x5c090f);}(_0x2682,0x169));var _0x2268=function(_0x3c78b3,_0x389ae1){_0x3c78b3=_0x3c78b3-0x0;var _0x549d46=_0x2682[_0x3c78b3];return _0x549d46;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2268('0x0'));var jsonpatch=require(_0x2268('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2268('0x2'));var Mustache=require(_0x2268('0x3'));var util=require(_0x2268('0x4'));var path=require(_0x2268('0x5'));var sox=require(_0x2268('0x6'));var csv=require('to-csv');var ejs=require(_0x2268('0x7'));var fs=require('fs');var fs_extra=require(_0x2268('0x8'));var _=require(_0x2268('0x9'));var squel=require(_0x2268('0xa'));var crypto=require(_0x2268('0xb'));var jsforce=require(_0x2268('0xc'));var deskjs=require(_0x2268('0xd'));var toCsv=require(_0x2268('0xe'));var querystring=require(_0x2268('0xf'));var Papa=require(_0x2268('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2268('0x11'));var as=require(_0x2268('0x12'));var hardwareService=require(_0x2268('0x13'));var logger=require('../../config/logger')(_0x2268('0x14'));var utils=require('../../config/utils');var config=require(_0x2268('0x15'));var licenseUtil=require(_0x2268('0x16'));var db=require(_0x2268('0x17'))['db'];var integrations=require(_0x2268('0x18'));function respondWithStatusCode(_0x1bb9fe,_0x4555b4){_0x4555b4=_0x4555b4||0xcc;return function(_0x1222fd){if(_0x1222fd){return _0x1bb9fe['sendStatus'](_0x4555b4);}return _0x1bb9fe[_0x2268('0x19')](_0x4555b4)[_0x2268('0x1a')]();};}function respondWithResult(_0x108c3d,_0x5b17a2){_0x5b17a2=_0x5b17a2||0xc8;return function(_0x2188c4){if(_0x2188c4){return _0x108c3d[_0x2268('0x19')](_0x5b17a2)[_0x2268('0x1b')](_0x2188c4);}};}function respondWithFilteredResult(_0x2c19ba,_0x37f99a){return function(_0x33f2bd){if(_0x33f2bd){var _0x590989=typeof _0x37f99a[_0x2268('0x1c')]===_0x2268('0x1d')&&typeof _0x37f99a[_0x2268('0x1e')]===_0x2268('0x1d');var _0x2c9afd=_0x33f2bd[_0x2268('0x1f')];var _0x468a15=_0x590989?0x0:_0x37f99a[_0x2268('0x1c')];var _0x3f6f40=_0x590989?_0x33f2bd[_0x2268('0x1f')]:_0x37f99a['offset']+_0x37f99a[_0x2268('0x1e')];var _0x423ffb;if(_0x3f6f40>=_0x2c9afd){_0x3f6f40=_0x2c9afd;_0x423ffb=0xc8;}else{_0x423ffb=0xce;}_0x2c19ba[_0x2268('0x19')](_0x423ffb);return _0x2c19ba['set'](_0x2268('0x20'),_0x468a15+'-'+_0x3f6f40+'/'+_0x2c9afd)[_0x2268('0x1b')](_0x33f2bd);}return null;};}function patchUpdates(_0x1c4ebb){return function(_0x1264ca){try{jsonpatch[_0x2268('0x21')](_0x1264ca,_0x1c4ebb,!![]);}catch(_0x331a55){return BPromise[_0x2268('0x22')](_0x331a55);}return _0x1264ca[_0x2268('0x23')]();};}function saveUpdates(_0x224a28,_0x24c457){return function(_0x5790a7){if(_0x5790a7){return _0x5790a7[_0x2268('0x24')](_0x224a28)[_0x2268('0x25')](function(_0x1aa5db){return _0x1aa5db;});}return null;};}function removeEntity(_0x2603d8,_0x4564ed){return function(_0x1f2f97){if(_0x1f2f97){return _0x1f2f97['destroy']()[_0x2268('0x25')](function(){_0x2603d8[_0x2268('0x19')](0xcc)[_0x2268('0x1a')]();});}};}function handleEntityNotFound(_0x1c01d5,_0x10f599){return function(_0x11ea3f){if(!_0x11ea3f){_0x1c01d5['sendStatus'](0x194);}return _0x11ea3f;};}function handleError(_0x2c0171,_0x21d682){_0x21d682=_0x21d682||0x1f4;return function(_0x664e57){logger['error'](_0x664e57['stack']);if(_0x664e57['name']){delete _0x664e57[_0x2268('0x26')];}_0x2c0171[_0x2268('0x19')](_0x21d682)[_0x2268('0x27')](_0x664e57);};}exports[_0x2268('0x28')]=function(_0x14f692,_0x5557f0){var _0x3d350f={},_0x18d366={},_0x4fe6ba={'count':0x0,'rows':[]};var _0x4373fc=_[_0x2268('0x29')](db[_0x2268('0x2a')][_0x2268('0x2b')],function(_0x1fc746){return{'name':_0x1fc746[_0x2268('0x2c')],'type':_0x1fc746[_0x2268('0x2d')]['key']};});_0x18d366['model']=_['map'](_0x4373fc,_0x2268('0x26'));_0x18d366[_0x2268('0x2e')]=_[_0x2268('0x2f')](_0x14f692[_0x2268('0x2e')]);_0x18d366[_0x2268('0x30')]=_[_0x2268('0x31')](_0x18d366['model'],_0x18d366['query']);_0x3d350f[_0x2268('0x32')]=_[_0x2268('0x31')](_0x18d366[_0x2268('0x33')],qs[_0x2268('0x34')](_0x14f692['query'][_0x2268('0x34')]));_0x3d350f[_0x2268('0x32')]=_0x3d350f[_0x2268('0x32')]['length']?_0x3d350f[_0x2268('0x32')]:_0x18d366['model'];if(!_0x14f692['query'][_0x2268('0x35')]('nolimit')){_0x3d350f[_0x2268('0x1e')]=qs[_0x2268('0x1e')](_0x14f692[_0x2268('0x2e')][_0x2268('0x1e')]);_0x3d350f[_0x2268('0x1c')]=qs[_0x2268('0x1c')](_0x14f692['query']['offset']);}_0x3d350f[_0x2268('0x36')]=qs[_0x2268('0x37')](_0x14f692['query'][_0x2268('0x37')]);_0x3d350f[_0x2268('0x38')]=qs['filters'](_['pick'](_0x14f692[_0x2268('0x2e')],_0x18d366[_0x2268('0x30')]),_0x4373fc);if(_0x14f692['query'][_0x2268('0x39')]){_0x3d350f[_0x2268('0x38')]=_[_0x2268('0x3a')](_0x3d350f[_0x2268('0x38')],{'$or':_[_0x2268('0x29')](_0x4373fc,function(_0x23aff8){if(_0x23aff8[_0x2268('0x2d')]!==_0x2268('0x3b')){var _0x2a66b2={};_0x2a66b2[_0x23aff8[_0x2268('0x26')]]={'$like':'%'+_0x14f692[_0x2268('0x2e')][_0x2268('0x39')]+'%'};return _0x2a66b2;}})});}_0x3d350f=_[_0x2268('0x3a')]({},_0x3d350f,_0x14f692[_0x2268('0x3c')]);var _0x314331={'where':_0x3d350f['where']};return db['ZohoAccount'][_0x2268('0x1f')](_0x314331)['then'](function(_0xca9065){_0x4fe6ba[_0x2268('0x1f')]=_0xca9065;if(_0x14f692['query'][_0x2268('0x3d')]){_0x3d350f[_0x2268('0x3e')]=[{'all':!![]}];}return db[_0x2268('0x2a')][_0x2268('0x3f')](_0x3d350f);})[_0x2268('0x25')](function(_0x18d102){_0x4fe6ba[_0x2268('0x40')]=_0x18d102;return _0x4fe6ba;})['then'](respondWithFilteredResult(_0x5557f0,_0x3d350f))[_0x2268('0x41')](handleError(_0x5557f0,null));};exports[_0x2268('0x42')]=function(_0x18fca6,_0x5a05d5){var _0x4a2261={'raw':![],'where':{'id':_0x18fca6[_0x2268('0x43')]['id']}},_0x1a9a34={};_0x1a9a34[_0x2268('0x33')]=_[_0x2268('0x2f')](db[_0x2268('0x2a')][_0x2268('0x2b')]);_0x1a9a34['query']=_[_0x2268('0x2f')](_0x18fca6['query']);_0x1a9a34[_0x2268('0x30')]=_['intersection'](_0x1a9a34[_0x2268('0x33')],_0x1a9a34[_0x2268('0x2e')]);_0x4a2261[_0x2268('0x32')]=_['intersection'](_0x1a9a34['model'],qs[_0x2268('0x34')](_0x18fca6[_0x2268('0x2e')][_0x2268('0x34')]));_0x4a2261[_0x2268('0x32')]=_0x4a2261[_0x2268('0x32')][_0x2268('0x44')]?_0x4a2261[_0x2268('0x32')]:_0x1a9a34[_0x2268('0x33')];if(_0x18fca6[_0x2268('0x2e')][_0x2268('0x3d')]){_0x4a2261[_0x2268('0x3e')]=[{'all':!![]}];}_0x4a2261=_[_0x2268('0x3a')]({},_0x4a2261,_0x18fca6[_0x2268('0x3c')]);return db['ZohoAccount'][_0x2268('0x45')](_0x4a2261)[_0x2268('0x25')](handleEntityNotFound(_0x5a05d5,null))[_0x2268('0x25')](respondWithResult(_0x5a05d5,null))[_0x2268('0x41')](handleError(_0x5a05d5,null));};exports[_0x2268('0x46')]=function(_0x52e50d,_0x2ccb2c){return db[_0x2268('0x2a')][_0x2268('0x46')](_0x52e50d[_0x2268('0x47')],{})[_0x2268('0x25')](respondWithResult(_0x2ccb2c,0xc9))['catch'](handleError(_0x2ccb2c,null));};exports[_0x2268('0x24')]=function(_0x3d54da,_0x39134a){if(_0x3d54da[_0x2268('0x47')]['id']){delete _0x3d54da['body']['id'];}return db[_0x2268('0x2a')][_0x2268('0x45')]({'where':{'id':_0x3d54da[_0x2268('0x43')]['id']}})['then'](handleEntityNotFound(_0x39134a,null))['then'](saveUpdates(_0x3d54da['body'],null))[_0x2268('0x25')](respondWithResult(_0x39134a,null))['catch'](handleError(_0x39134a,null));};exports['destroy']=function(_0x579ae5,_0x517fe1){return db[_0x2268('0x2a')][_0x2268('0x45')]({'where':{'id':_0x579ae5[_0x2268('0x43')]['id']}})['then'](handleEntityNotFound(_0x517fe1,null))['then'](removeEntity(_0x517fe1,null))[_0x2268('0x41')](handleError(_0x517fe1,null));};exports['getConfigurations']=function(_0x3f20ba,_0x4e7178,_0x53d73d){var _0x584749={};var _0x31139e={};var _0x26d60f;var _0x56762d;return db['ZohoAccount'][_0x2268('0x48')]({'where':{'id':_0x3f20ba[_0x2268('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e7178,null))['then'](function(_0x19c0f4){if(_0x19c0f4){_0x26d60f=_0x19c0f4;_0x31139e[_0x2268('0x33')]=_[_0x2268('0x2f')](db[_0x2268('0x49')]['rawAttributes']);_0x31139e[_0x2268('0x2e')]=_['keys'](_0x3f20ba[_0x2268('0x2e')]);_0x31139e['filters']=_['intersection'](_0x31139e[_0x2268('0x33')],_0x31139e[_0x2268('0x2e')]);_0x584749[_0x2268('0x32')]=_[_0x2268('0x31')](_0x31139e[_0x2268('0x33')],qs[_0x2268('0x34')](_0x3f20ba[_0x2268('0x2e')][_0x2268('0x34')]));_0x584749['attributes']=_0x584749[_0x2268('0x32')][_0x2268('0x44')]?_0x584749['attributes']:_0x31139e['model'];_0x584749['order']=qs['sort'](_0x3f20ba['query']['sort']);_0x584749[_0x2268('0x38')]=qs[_0x2268('0x30')](_[_0x2268('0x4a')](_0x3f20ba[_0x2268('0x2e')],_0x31139e['filters']));if(_0x3f20ba[_0x2268('0x2e')][_0x2268('0x39')]){_0x584749['where']=_[_0x2268('0x3a')](_0x584749['where'],{'$or':_[_0x2268('0x29')](_0x584749[_0x2268('0x32')],function(_0x3ae4ab){var _0x4fef0f={};_0x4fef0f[_0x3ae4ab]={'$like':'%'+_0x3f20ba[_0x2268('0x2e')][_0x2268('0x39')]+'%'};return _0x4fef0f;})});}_0x584749=_[_0x2268('0x3a')]({},_0x584749,_0x3f20ba[_0x2268('0x3c')]);return _0x26d60f[_0x2268('0x4b')](_0x584749);}})[_0x2268('0x25')](function(_0x4711cc){if(_0x4711cc){_0x56762d=_0x4711cc[_0x2268('0x44')];if(!_0x3f20ba[_0x2268('0x2e')]['hasOwnProperty'](_0x2268('0x4c'))){_0x584749[_0x2268('0x1e')]=qs[_0x2268('0x1e')](_0x3f20ba[_0x2268('0x2e')]['limit']);_0x584749[_0x2268('0x1c')]=qs[_0x2268('0x1c')](_0x3f20ba['query'][_0x2268('0x1c')]);}return _0x26d60f['getConfigurations'](_0x584749);}})[_0x2268('0x25')](function(_0x4e7a87){if(_0x4e7a87){return _0x4e7a87?{'count':_0x56762d,'rows':_0x4e7a87}:null;}})['then'](respondWithResult(_0x4e7178,null))['catch'](handleError(_0x4e7178,null));};exports[_0x2268('0x4d')]=function(_0x4978a3,_0x51414b,_0x453dd6){if(_0x4978a3[_0x2268('0x47')]['id']){delete _0x4978a3[_0x2268('0x47')]['id'];}return db[_0x2268('0x2a')][_0x2268('0x48')]({'where':{'id':_0x4978a3[_0x2268('0x43')]['id']}})[_0x2268('0x25')](handleEntityNotFound(_0x51414b,null))['then'](function(_0x26d6dc){if(_0x26d6dc){_0x4978a3[_0x2268('0x47')][_0x2268('0x4e')]=_0x26d6dc['id'];_0x4978a3[_0x2268('0x47')][_0x2268('0x4f')]=integrations[_0x2268('0x50')](_0x4978a3['body'][_0x2268('0x51')],_0x4978a3['body'][_0x2268('0x2d')]);_0x4978a3[_0x2268('0x47')][_0x2268('0x52')]=integrations[_0x2268('0x53')](_0x4978a3[_0x2268('0x47')][_0x2268('0x51')],_0x4978a3[_0x2268('0x47')][_0x2268('0x2d')]);return db[_0x2268('0x49')][_0x2268('0x46')](_0x4978a3['body'],{'include':[{'model':db[_0x2268('0x54')],'as':_0x2268('0x4f')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0x2268('0x25')](respondWithResult(_0x51414b,null))[_0x2268('0x41')](handleError(_0x51414b,null));};function getAccessToken(_0x399087){return new Promise(function(_0x26d8e4,_0x53aa0e){var _0x5d7021;switch(_0x399087[_0x2268('0x55')]){case'US':_0x5d7021='https://accounts.zoho.com';break;case'AU':_0x5d7021=_0x2268('0x56');break;case'EU':_0x5d7021='https://accounts.zoho.eu';break;case'IN':_0x5d7021=_0x2268('0x57');break;case'CN':_0x5d7021=_0x2268('0x58');break;default:_0x5d7021=_0x2268('0x59');break;}var _0x3ba0a4={'method':_0x2268('0x5a'),'uri':_0x5d7021+'/oauth/v2/token','qs':{'refresh_token':_0x399087[_0x2268('0x5b')],'client_id':_0x399087['clientId'],'client_secret':_0x399087[_0x2268('0x5c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3ba0a4)[_0x2268('0x25')](function(_0x492cde){if(_0x492cde[_0x2268('0x5d')]){_0x26d8e4(_0x492cde[_0x2268('0x5d')]);}else{_0x53aa0e('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x2268('0x41')](function(_0x138e30){_0x53aa0e(_0x138e30);});});}exports[_0x2268('0x5e')]=function(_0x4c83b6,_0x546fce,_0x56bf33){var _0xe8cc70,_0x4dbf91,_0x4ae52d,_0x5545a6,_0x4711b4;return db[_0x2268('0x2a')][_0x2268('0x48')]({'where':{'id':_0x4c83b6[_0x2268('0x43')]['id']},'attributes':['id','host',_0x2268('0x55'),_0x2268('0x5f'),_0x2268('0x5c'),_0x2268('0x60'),_0x2268('0x61'),'refreshToken']})[_0x2268('0x25')](handleEntityNotFound(_0x546fce,null))[_0x2268('0x25')](function(_0x2c8044){_0x4711b4=_0x2c8044;_0xe8cc70=_0x4711b4['host'];_0x4dbf91=_0xe8cc70===_0x2268('0x62')?'eu':'com';_0x4ae52d=_0x4711b4[_0x2268('0x60')];var _0x5a2090=_0x4ae52d[_0x2268('0x63')](-0x1);if(_0x5a2090==='/'||_0x5a2090==='\x5c'||_0x5a2090===':'){_0x4ae52d=_0x4ae52d['substring'](0x0,_0x4ae52d[_0x2268('0x64')](_0x5a2090));}if(!_0x4711b4[_0x2268('0x5b')]){throw new Error(_0x2268('0x65'));}return getAccessToken(_0x4711b4);})[_0x2268('0x25')](function(_0x166724){if(_0x166724){return rp({'method':_0x2268('0x66'),'uri':util[_0x2268('0x67')](_0x2268('0x68'),_0x4dbf91),'qs':{'module':'Calls'},'headers':{'Authorization':_0x2268('0x69')+_0x166724},'json':!![]});}})[_0x2268('0x25')](function(_0x1b68b8){if(_0x1b68b8){if(_0x1b68b8[_0x2268('0x6a')]&&_0x1b68b8[_0x2268('0x6a')][_0x2268('0x6b')]){throw new Error(_0x1b68b8[_0x2268('0x6a')]['error'][_0x2268('0x6c')]);}var _0x46202d=[];var _0x3b1922=[];var _0x1398c0=[_0x2268('0x6d'),'Subject','Description',_0x2268('0x6e'),_0x2268('0x6f'),_0x2268('0x70'),'Call_Start_Time','Call_Type'];_0x3b1922=_[_0x2268('0x71')](_0x1b68b8[_0x2268('0x34')],function(_0x3ebb2c){return _0x1398c0['includes'](_0x3ebb2c[_0x2268('0x72')]);});for(var _0x1bed84=0x0;_0x1bed84<_0x3b1922[_0x2268('0x44')];_0x1bed84++){if(_0x3b1922[_0x1bed84]['system_mandatory']===![]){_0x46202d[_0x2268('0x73')]({'id':_0x3b1922[_0x1bed84]['id'],'name':_0x3b1922[_0x1bed84][_0x2268('0x74')],'custom':_0x3b1922[_0x1bed84][_0x2268('0x75')],'options':_0x3b1922[_0x1bed84][_0x2268('0x76')]===_0x2268('0x77')&&_0x3b1922[_0x1bed84][_0x2268('0x78')]['length']>-0x1?_['map'](_0x3b1922[_0x1bed84]['pick_list_values'],function(_0x289bc7){return{'name':_0x289bc7,'value':_0x289bc7};}):[]});}}return{'count':_0x46202d[_0x2268('0x44')],'rows':_0x46202d};}else{return{'count':0x0,'rows':[]};}})[_0x2268('0x25')](respondWithResult(_0x546fce,null))[_0x2268('0x41')](function(_0x6e1f7){var _0x35e150=_0x4c83b6[_0x2268('0x2e')][_0x2268('0x79')]?0x1f4:_0x6e1f7[_0x2268('0x7a')]||0x1f4;logger[_0x2268('0x6b')](_0x2268('0x7b'),_0x2268('0x5e'),_0x35e150,JSON[_0x2268('0x7c')](_0x6e1f7));delete _0x6e1f7[_0x2268('0x26')];if(_0x35e150===0x191){_0x35e150=0x190;}_0x546fce[_0x2268('0x19')](_0x35e150)[_0x2268('0x27')](_0x4c83b6['query'][_0x2268('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x6e1f7[_0x2268('0x7a')]}:_0x6e1f7);});}; \ No newline at end of file +var _0x8212=['Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','includeAll','find','catch','create','body','params','findOne','pick','getConfigurations','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','refresh_token','access_token','getFields','clientSecret','serverUrl','code','host','zoho.eu','com','slice','substring','refreshToken','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x8212,0x196));var _0x2821=function(_0x2a7710,_0x414a10){_0x2a7710=_0x2a7710-0x0;var _0x1a59e3=_0x8212[_0x2a7710];return _0x1a59e3;};'use strict';var emlformat=require(_0x2821('0x0'));var rimraf=require(_0x2821('0x1'));var zipdir=require(_0x2821('0x2'));var jsonpatch=require(_0x2821('0x3'));var rp=require('request-promise');var moment=require(_0x2821('0x4'));var BPromise=require(_0x2821('0x5'));var Mustache=require('mustache');var util=require(_0x2821('0x6'));var path=require(_0x2821('0x7'));var sox=require(_0x2821('0x8'));var csv=require(_0x2821('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2821('0xa'));var _=require(_0x2821('0xb'));var squel=require(_0x2821('0xc'));var crypto=require(_0x2821('0xd'));var jsforce=require(_0x2821('0xe'));var deskjs=require(_0x2821('0xf'));var toCsv=require(_0x2821('0x9'));var querystring=require(_0x2821('0x10'));var Papa=require('papaparse');var Redis=require(_0x2821('0x11'));var authService=require(_0x2821('0x12'));var qs=require(_0x2821('0x13'));var as=require(_0x2821('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2821('0x15'));var utils=require(_0x2821('0x16'));var config=require(_0x2821('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2821('0x18'))['db'];var integrations=require(_0x2821('0x19'));function respondWithStatusCode(_0xc4b862,_0x142408){_0x142408=_0x142408||0xcc;return function(_0x5b2bc0){if(_0x5b2bc0){return _0xc4b862['sendStatus'](_0x142408);}return _0xc4b862[_0x2821('0x1a')](_0x142408)[_0x2821('0x1b')]();};}function respondWithResult(_0x545e4c,_0x44c624){_0x44c624=_0x44c624||0xc8;return function(_0x356f63){if(_0x356f63){return _0x545e4c[_0x2821('0x1a')](_0x44c624)['json'](_0x356f63);}};}function respondWithFilteredResult(_0x80b29,_0x47e890){return function(_0x4a72c9){if(_0x4a72c9){var _0x48d4bc=typeof _0x47e890[_0x2821('0x1c')]===_0x2821('0x1d')&&typeof _0x47e890[_0x2821('0x1e')]===_0x2821('0x1d');var _0x27e70e=_0x4a72c9[_0x2821('0x1f')];var _0x25b7f0=_0x48d4bc?0x0:_0x47e890['offset'];var _0x1e9a93=_0x48d4bc?_0x4a72c9[_0x2821('0x1f')]:_0x47e890[_0x2821('0x1c')]+_0x47e890[_0x2821('0x1e')];var _0x26b808;if(_0x1e9a93>=_0x27e70e){_0x1e9a93=_0x27e70e;_0x26b808=0xc8;}else{_0x26b808=0xce;}_0x80b29[_0x2821('0x1a')](_0x26b808);return _0x80b29[_0x2821('0x20')](_0x2821('0x21'),_0x25b7f0+'-'+_0x1e9a93+'/'+_0x27e70e)[_0x2821('0x22')](_0x4a72c9);}return null;};}function patchUpdates(_0x43e936){return function(_0x2ddf01){try{jsonpatch[_0x2821('0x23')](_0x2ddf01,_0x43e936,!![]);}catch(_0x13e90f){return BPromise[_0x2821('0x24')](_0x13e90f);}return _0x2ddf01[_0x2821('0x25')]();};}function saveUpdates(_0x2af02a,_0x59d2d1){return function(_0xcf5d66){if(_0xcf5d66){return _0xcf5d66[_0x2821('0x26')](_0x2af02a)[_0x2821('0x27')](function(_0x13994e){return _0x13994e;});}return null;};}function removeEntity(_0x32bdd6,_0x1f0d0c){return function(_0x5160d1){if(_0x5160d1){return _0x5160d1[_0x2821('0x28')]()[_0x2821('0x27')](function(){_0x32bdd6[_0x2821('0x1a')](0xcc)[_0x2821('0x1b')]();});}};}function handleEntityNotFound(_0x4ecffa,_0x5a9636){return function(_0x530145){if(!_0x530145){_0x4ecffa[_0x2821('0x29')](0x194);}return _0x530145;};}function handleError(_0x1ea339,_0x8799d6){_0x8799d6=_0x8799d6||0x1f4;return function(_0x5a803a){logger[_0x2821('0x2a')](_0x5a803a[_0x2821('0x2b')]);if(_0x5a803a[_0x2821('0x2c')]){delete _0x5a803a[_0x2821('0x2c')];}_0x1ea339[_0x2821('0x1a')](_0x8799d6)[_0x2821('0x2d')](_0x5a803a);};}exports[_0x2821('0x2e')]=function(_0x44c386,_0x5a41b0){var _0xfe314e={},_0x53a6c0={},_0x2b4d38={'count':0x0,'rows':[]};var _0x5caf28=_[_0x2821('0x2f')](db[_0x2821('0x30')][_0x2821('0x31')],function(_0x311a88){return{'name':_0x311a88[_0x2821('0x32')],'type':_0x311a88[_0x2821('0x33')]['key']};});_0x53a6c0[_0x2821('0x34')]=_[_0x2821('0x2f')](_0x5caf28,_0x2821('0x2c'));_0x53a6c0[_0x2821('0x35')]=_[_0x2821('0x36')](_0x44c386['query']);_0x53a6c0[_0x2821('0x37')]=_['intersection'](_0x53a6c0[_0x2821('0x34')],_0x53a6c0[_0x2821('0x35')]);_0xfe314e[_0x2821('0x38')]=_[_0x2821('0x39')](_0x53a6c0[_0x2821('0x34')],qs[_0x2821('0x3a')](_0x44c386[_0x2821('0x35')][_0x2821('0x3a')]));_0xfe314e['attributes']=_0xfe314e[_0x2821('0x38')][_0x2821('0x3b')]?_0xfe314e[_0x2821('0x38')]:_0x53a6c0[_0x2821('0x34')];if(!_0x44c386[_0x2821('0x35')]['hasOwnProperty'](_0x2821('0x3c'))){_0xfe314e[_0x2821('0x1e')]=qs[_0x2821('0x1e')](_0x44c386[_0x2821('0x35')][_0x2821('0x1e')]);_0xfe314e[_0x2821('0x1c')]=qs['offset'](_0x44c386[_0x2821('0x35')][_0x2821('0x1c')]);}_0xfe314e[_0x2821('0x3d')]=qs[_0x2821('0x3e')](_0x44c386[_0x2821('0x35')][_0x2821('0x3e')]);_0xfe314e[_0x2821('0x3f')]=qs[_0x2821('0x37')](_['pick'](_0x44c386[_0x2821('0x35')],_0x53a6c0[_0x2821('0x37')]),_0x5caf28);if(_0x44c386['query'][_0x2821('0x40')]){_0xfe314e['where']=_[_0x2821('0x41')](_0xfe314e[_0x2821('0x3f')],{'$or':_['map'](_0x5caf28,function(_0x494231){if(_0x494231[_0x2821('0x33')]!=='VIRTUAL'){var _0x308742={};_0x308742[_0x494231['name']]={'$like':'%'+_0x44c386['query']['filter']+'%'};return _0x308742;}})});}_0xfe314e=_[_0x2821('0x41')]({},_0xfe314e,_0x44c386[_0x2821('0x42')]);var _0xf4f51c={'where':_0xfe314e['where']};return db[_0x2821('0x30')][_0x2821('0x1f')](_0xf4f51c)[_0x2821('0x27')](function(_0x36b6ad){_0x2b4d38['count']=_0x36b6ad;if(_0x44c386[_0x2821('0x35')]['includeAll']){_0xfe314e[_0x2821('0x43')]=[{'all':!![]}];}return db[_0x2821('0x30')][_0x2821('0x44')](_0xfe314e);})[_0x2821('0x27')](function(_0xcefd3f){_0x2b4d38[_0x2821('0x45')]=_0xcefd3f;return _0x2b4d38;})[_0x2821('0x27')](respondWithFilteredResult(_0x5a41b0,_0xfe314e))['catch'](handleError(_0x5a41b0,null));};exports['show']=function(_0x5b18ca,_0xcdd1de){var _0x285979={'raw':![],'where':{'id':_0x5b18ca['params']['id']}},_0x49e7cb={};_0x49e7cb['model']=_[_0x2821('0x36')](db[_0x2821('0x30')][_0x2821('0x31')]);_0x49e7cb[_0x2821('0x35')]=_['keys'](_0x5b18ca['query']);_0x49e7cb[_0x2821('0x37')]=_['intersection'](_0x49e7cb[_0x2821('0x34')],_0x49e7cb['query']);_0x285979['attributes']=_[_0x2821('0x39')](_0x49e7cb[_0x2821('0x34')],qs['fields'](_0x5b18ca[_0x2821('0x35')][_0x2821('0x3a')]));_0x285979[_0x2821('0x38')]=_0x285979[_0x2821('0x38')][_0x2821('0x3b')]?_0x285979[_0x2821('0x38')]:_0x49e7cb[_0x2821('0x34')];if(_0x5b18ca[_0x2821('0x35')][_0x2821('0x46')]){_0x285979[_0x2821('0x43')]=[{'all':!![]}];}_0x285979=_[_0x2821('0x41')]({},_0x285979,_0x5b18ca[_0x2821('0x42')]);return db[_0x2821('0x30')][_0x2821('0x47')](_0x285979)['then'](handleEntityNotFound(_0xcdd1de,null))['then'](respondWithResult(_0xcdd1de,null))[_0x2821('0x48')](handleError(_0xcdd1de,null));};exports[_0x2821('0x49')]=function(_0x2bf20e,_0x5bde57){return db[_0x2821('0x30')][_0x2821('0x49')](_0x2bf20e['body'],{})['then'](respondWithResult(_0x5bde57,0xc9))[_0x2821('0x48')](handleError(_0x5bde57,null));};exports['update']=function(_0x289ad0,_0x18d34d){if(_0x289ad0['body']['id']){delete _0x289ad0[_0x2821('0x4a')]['id'];}return db[_0x2821('0x30')][_0x2821('0x47')]({'where':{'id':_0x289ad0['params']['id']}})[_0x2821('0x27')](handleEntityNotFound(_0x18d34d,null))[_0x2821('0x27')](saveUpdates(_0x289ad0['body'],null))[_0x2821('0x27')](respondWithResult(_0x18d34d,null))['catch'](handleError(_0x18d34d,null));};exports[_0x2821('0x28')]=function(_0x25c01f,_0x511b81){return db[_0x2821('0x30')]['find']({'where':{'id':_0x25c01f[_0x2821('0x4b')]['id']}})[_0x2821('0x27')](handleEntityNotFound(_0x511b81,null))[_0x2821('0x27')](removeEntity(_0x511b81,null))[_0x2821('0x48')](handleError(_0x511b81,null));};exports['getConfigurations']=function(_0x36da18,_0x1a6704,_0x498110){var _0x3eff8a={};var _0xeb5f57={};var _0x4f6572;var _0x135d9e;return db[_0x2821('0x30')][_0x2821('0x4c')]({'where':{'id':_0x36da18[_0x2821('0x4b')]['id']}})[_0x2821('0x27')](handleEntityNotFound(_0x1a6704,null))[_0x2821('0x27')](function(_0x6d0197){if(_0x6d0197){_0x4f6572=_0x6d0197;_0xeb5f57[_0x2821('0x34')]=_[_0x2821('0x36')](db['ZohoConfiguration'][_0x2821('0x31')]);_0xeb5f57[_0x2821('0x35')]=_[_0x2821('0x36')](_0x36da18['query']);_0xeb5f57[_0x2821('0x37')]=_[_0x2821('0x39')](_0xeb5f57[_0x2821('0x34')],_0xeb5f57[_0x2821('0x35')]);_0x3eff8a['attributes']=_[_0x2821('0x39')](_0xeb5f57[_0x2821('0x34')],qs[_0x2821('0x3a')](_0x36da18['query'][_0x2821('0x3a')]));_0x3eff8a[_0x2821('0x38')]=_0x3eff8a[_0x2821('0x38')][_0x2821('0x3b')]?_0x3eff8a[_0x2821('0x38')]:_0xeb5f57[_0x2821('0x34')];_0x3eff8a[_0x2821('0x3d')]=qs[_0x2821('0x3e')](_0x36da18[_0x2821('0x35')][_0x2821('0x3e')]);_0x3eff8a[_0x2821('0x3f')]=qs[_0x2821('0x37')](_[_0x2821('0x4d')](_0x36da18[_0x2821('0x35')],_0xeb5f57['filters']));if(_0x36da18[_0x2821('0x35')][_0x2821('0x40')]){_0x3eff8a[_0x2821('0x3f')]=_[_0x2821('0x41')](_0x3eff8a['where'],{'$or':_[_0x2821('0x2f')](_0x3eff8a[_0x2821('0x38')],function(_0x5018f0){var _0x5cb81e={};_0x5cb81e[_0x5018f0]={'$like':'%'+_0x36da18[_0x2821('0x35')]['filter']+'%'};return _0x5cb81e;})});}_0x3eff8a=_['merge']({},_0x3eff8a,_0x36da18[_0x2821('0x42')]);return _0x4f6572[_0x2821('0x4e')](_0x3eff8a);}})[_0x2821('0x27')](function(_0x3cc019){if(_0x3cc019){_0x135d9e=_0x3cc019[_0x2821('0x3b')];if(!_0x36da18[_0x2821('0x35')]['hasOwnProperty']('nolimit')){_0x3eff8a[_0x2821('0x1e')]=qs[_0x2821('0x1e')](_0x36da18['query']['limit']);_0x3eff8a[_0x2821('0x1c')]=qs[_0x2821('0x1c')](_0x36da18[_0x2821('0x35')][_0x2821('0x1c')]);}return _0x4f6572[_0x2821('0x4e')](_0x3eff8a);}})[_0x2821('0x27')](function(_0x2f2cbf){if(_0x2f2cbf){return _0x2f2cbf?{'count':_0x135d9e,'rows':_0x2f2cbf}:null;}})[_0x2821('0x27')](respondWithResult(_0x1a6704,null))[_0x2821('0x48')](handleError(_0x1a6704,null));};exports['addConfiguration']=function(_0x1e5d43,_0x1c4a7b,_0x3d932a){if(_0x1e5d43[_0x2821('0x4a')]['id']){delete _0x1e5d43[_0x2821('0x4a')]['id'];}return db[_0x2821('0x30')][_0x2821('0x4c')]({'where':{'id':_0x1e5d43[_0x2821('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1c4a7b,null))[_0x2821('0x27')](function(_0x33c447){if(_0x33c447){_0x1e5d43[_0x2821('0x4a')]['AccountId']=_0x33c447['id'];_0x1e5d43[_0x2821('0x4a')][_0x2821('0x4f')]=integrations[_0x2821('0x50')](_0x1e5d43[_0x2821('0x4a')][_0x2821('0x51')],_0x1e5d43[_0x2821('0x4a')]['type']);_0x1e5d43[_0x2821('0x4a')][_0x2821('0x52')]=integrations[_0x2821('0x53')](_0x1e5d43[_0x2821('0x4a')][_0x2821('0x51')],_0x1e5d43['body'][_0x2821('0x33')]);return db['ZohoConfiguration']['create'](_0x1e5d43[_0x2821('0x4a')],{'include':[{'model':db[_0x2821('0x54')],'as':_0x2821('0x4f')},{'model':db[_0x2821('0x54')],'as':_0x2821('0x52')}]});}return null;})['then'](respondWithResult(_0x1c4a7b,null))[_0x2821('0x48')](handleError(_0x1c4a7b,null));};function getAccessToken(_0x3dfd7b){return new Promise(function(_0x23aeba,_0x4ec2ca){var _0x5f5607;switch(_0x3dfd7b[_0x2821('0x55')]){case'US':_0x5f5607=_0x2821('0x56');break;case'AU':_0x5f5607=_0x2821('0x57');break;case'EU':_0x5f5607=_0x2821('0x58');break;case'IN':_0x5f5607=_0x2821('0x59');break;case'CN':_0x5f5607=_0x2821('0x5a');break;default:_0x5f5607=_0x2821('0x58');break;}var _0x57df34={'method':_0x2821('0x5b'),'uri':_0x5f5607+_0x2821('0x5c'),'qs':{'refresh_token':_0x3dfd7b['refreshToken'],'client_id':_0x3dfd7b[_0x2821('0x5d')],'client_secret':_0x3dfd7b['clientSecret'],'grant_type':_0x2821('0x5e')},'json':!![]};return rp(_0x57df34)[_0x2821('0x27')](function(_0x2a935b){if(_0x2a935b[_0x2821('0x5f')]){_0x23aeba(_0x2a935b[_0x2821('0x5f')]);}else{_0x4ec2ca('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x2821('0x48')](function(_0x6c4edc){_0x4ec2ca(_0x6c4edc);});});}exports[_0x2821('0x60')]=function(_0x1b7f20,_0x416ca0,_0x695c12){var _0x280971,_0x46d533,_0x5c25f3,_0x56c0dc,_0xa9adee;return db[_0x2821('0x30')]['findOne']({'where':{'id':_0x1b7f20[_0x2821('0x4b')]['id']},'attributes':['id','host',_0x2821('0x55'),_0x2821('0x5d'),_0x2821('0x61'),_0x2821('0x62'),_0x2821('0x63'),'refreshToken']})[_0x2821('0x27')](handleEntityNotFound(_0x416ca0,null))['then'](function(_0x45454e){_0xa9adee=_0x45454e;_0x280971=_0xa9adee[_0x2821('0x64')];_0x46d533=_0x280971===_0x2821('0x65')?'eu':_0x2821('0x66');_0x5c25f3=_0xa9adee[_0x2821('0x62')];var _0x4cde37=_0x5c25f3[_0x2821('0x67')](-0x1);if(_0x4cde37==='/'||_0x4cde37==='\x5c'||_0x4cde37===':'){_0x5c25f3=_0x5c25f3[_0x2821('0x68')](0x0,_0x5c25f3['lastIndexOf'](_0x4cde37));}if(!_0xa9adee[_0x2821('0x69')]){throw new Error(_0x2821('0x6a'));}return getAccessToken(_0xa9adee);})[_0x2821('0x27')](function(_0x5c4cd1){if(_0x5c4cd1){return rp({'method':'GET','uri':util[_0x2821('0x6b')](_0x2821('0x6c'),_0x46d533),'qs':{'module':_0x2821('0x6d')},'headers':{'Authorization':_0x2821('0x6e')+_0x5c4cd1},'json':!![]});}})['then'](function(_0x13855c){if(_0x13855c){if(_0x13855c[_0x2821('0x6f')]&&_0x13855c[_0x2821('0x6f')][_0x2821('0x2a')]){throw new Error(_0x13855c['response'][_0x2821('0x2a')][_0x2821('0x70')]);}var _0x1cb7a8=[];var _0x3886b1=[];var _0x4e5d67=['Owner',_0x2821('0x71'),_0x2821('0x72'),_0x2821('0x73'),_0x2821('0x74'),_0x2821('0x75'),_0x2821('0x76'),_0x2821('0x77')];_0x3886b1=_['remove'](_0x13855c[_0x2821('0x3a')],function(_0x2c128a){return _0x4e5d67[_0x2821('0x78')](_0x2c128a[_0x2821('0x79')]);});for(var _0x587a2a=0x0;_0x587a2a<_0x3886b1[_0x2821('0x3b')];_0x587a2a++){if(_0x3886b1[_0x587a2a][_0x2821('0x7a')]===![]){_0x1cb7a8['push']({'id':_0x3886b1[_0x587a2a]['id'],'name':_0x3886b1[_0x587a2a]['display_label'],'custom':_0x3886b1[_0x587a2a][_0x2821('0x7b')],'options':_0x3886b1[_0x587a2a][_0x2821('0x7c')]===_0x2821('0x7d')&&_0x3886b1[_0x587a2a][_0x2821('0x7e')][_0x2821('0x3b')]>-0x1?_[_0x2821('0x2f')](_0x3886b1[_0x587a2a][_0x2821('0x7e')],function(_0x34257b){return{'name':_0x34257b,'value':_0x34257b};}):[]});}}return{'count':_0x1cb7a8[_0x2821('0x3b')],'rows':_0x1cb7a8};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x416ca0,null))['catch'](function(_0x41e16d){var _0x1f9ea7=_0x1b7f20[_0x2821('0x35')]['test']?0x1f4:_0x41e16d[_0x2821('0x7f')]||0x1f4;logger[_0x2821('0x2a')](_0x2821('0x80'),_0x2821('0x60'),_0x1f9ea7,JSON['stringify'](_0x41e16d));delete _0x41e16d[_0x2821('0x2c')];if(_0x1f9ea7===0x191){_0x1f9ea7=0x190;}_0x416ca0[_0x2821('0x1a')](_0x1f9ea7)['send'](_0x1b7f20['query'][_0x2821('0x81')]?{'message':'Wrong\x20credentials','statusCode':_0x41e16d[_0x2821('0x7f')]}:_0x41e16d);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 7df2742..9cc7c30 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 _0x670c=['https://accounts.zoho.com.au','https://accounts.zoho.com.cn','refreshToken','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../components/integrations/configuration','exports','changed','serverUrl','clientId','code','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','zone','host','slice'];(function(_0x3d8340,_0x35b64d){var _0x29c5f3=function(_0x3772d9){while(--_0x3772d9){_0x3d8340['push'](_0x3d8340['shift']());}};_0x29c5f3(++_0x35b64d);}(_0x670c,0x1bb));var _0xc670=function(_0x530181,_0x385879){_0x530181=_0x530181-0x0;var _0x500548=_0x670c[_0x530181];return _0x500548;};'use strict';var _=require(_0xc670('0x0'));var util=require(_0xc670('0x1'));var logger=require(_0xc670('0x2'))(_0xc670('0x3'));var moment=require(_0xc670('0x4'));var BPromise=require('bluebird');var rp=require(_0xc670('0x5'));var fs=require('fs');var path=require(_0xc670('0x6'));var rimraf=require(_0xc670('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xc670('0x8'));module[_0xc670('0x9')]=function(_0x2dbf06,_0x2e9b89){return _0x2dbf06['define']('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x543649,_0x41bf7f,_0x470c6f){if(_0x543649[_0xc670('0xa')]('zone')||_0x543649[_0xc670('0xa')](_0xc670('0xb'))||_0x543649[_0xc670('0xa')](_0xc670('0xc'))||_0x543649[_0xc670('0xa')]('clientSecret')||_0x543649[_0xc670('0xa')](_0xc670('0xd'))||_0x543649['changed']('host')){var _0x43a42a,_0x370c95;_0x43a42a=_0x543649[_0xc670('0xb')];var _0x3aa36a=_0x43a42a['slice'](-0x1);if(_0x3aa36a==='/'||_0x3aa36a==='\x5c'||_0x3aa36a===':'){_0x43a42a=_0x43a42a[_0xc670('0xe')](0x0,_0x43a42a[_0xc670('0xf')](_0x3aa36a));}switch(_0x543649['zone']){case'US':_0x370c95=_0xc670('0x10');break;case'AU':_0x370c95='https://accounts.zoho.com.au';break;case'IN':_0x370c95=_0xc670('0x11');break;case'CN':_0x370c95='https://accounts.zoho.com.cn';break;default:_0x370c95=_0xc670('0x12');break;}var _0x7fabc6={'method':_0xc670('0x13'),'uri':_0x370c95+_0xc670('0x14'),'form':{'grant_type':_0xc670('0x15'),'client_id':_0x543649[_0xc670('0xc')],'client_secret':_0x543649[_0xc670('0x16')],'redirect_uri':_0x543649[_0xc670('0xb')],'code':_0x543649[_0xc670('0xd')]},'headers':{'Content-Type':_0xc670('0x17')}};return rp(_0x7fabc6)[_0xc670('0x18')](function(_0x5975ad){var _0x5e11a1=JSON[_0xc670('0x19')](_0x5975ad);if(_0x5e11a1[_0xc670('0x1a')]){_0x543649['refreshToken']=_0x5e11a1[_0xc670('0x1a')];logger[_0xc670('0x1b')](util[_0xc670('0x1c')](_0xc670('0x1d'),_0x543649[_0xc670('0x1e')],_0x543649['id']));}else{logger[_0xc670('0x1f')](util['format'](_0xc670('0x20'),_0x543649[_0xc670('0x1e')],_0x543649['id']),util['inspect'](_0x5e11a1,{'showHidden':![],'depth':null}));}return _0x470c6f(null,_0x41bf7f);})['catch'](function(_0xfd6457){logger[_0xc670('0x1f')](util[_0xc670('0x1c')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x543649['name'],_0x543649['id']),util[_0xc670('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x470c6f(_0xfd6457);});}else{return _0x470c6f(null,_0x41bf7f);}},'beforeUpdate':function(_0x15c29d,_0x359156,_0x598672){if(_0x15c29d[_0xc670('0xa')](_0xc670('0x22'))||_0x15c29d['changed'](_0xc670('0xb'))||_0x15c29d[_0xc670('0xa')](_0xc670('0xc'))||_0x15c29d[_0xc670('0xa')](_0xc670('0x16'))||_0x15c29d[_0xc670('0xa')]('code')||_0x15c29d[_0xc670('0xa')](_0xc670('0x23'))){var _0x2460ba,_0x226dde;_0x2460ba=_0x15c29d[_0xc670('0xb')];var _0x1514c2=_0x2460ba[_0xc670('0x24')](-0x1);if(_0x1514c2==='/'||_0x1514c2==='\x5c'||_0x1514c2===':'){_0x2460ba=_0x2460ba[_0xc670('0xe')](0x0,_0x2460ba[_0xc670('0xf')](_0x1514c2));}switch(_0x15c29d[_0xc670('0x22')]){case'US':_0x226dde=_0xc670('0x10');break;case'AU':_0x226dde=_0xc670('0x25');break;case'IN':_0x226dde=_0xc670('0x11');break;case'CN':_0x226dde=_0xc670('0x26');break;default:_0x226dde='https://accounts.zoho.eu';break;}var _0x115da4={'method':_0xc670('0x13'),'uri':_0x226dde+'/oauth/v2/token','form':{'grant_type':_0xc670('0x15'),'client_id':_0x15c29d[_0xc670('0xc')],'client_secret':_0x15c29d[_0xc670('0x16')],'redirect_uri':_0x15c29d[_0xc670('0xb')],'code':_0x15c29d[_0xc670('0xd')]},'headers':{'Content-Type':_0xc670('0x17')}};return rp(_0x115da4)[_0xc670('0x18')](function(_0x5d3fef){var _0x21c45b=JSON[_0xc670('0x19')](_0x5d3fef);if(_0x21c45b[_0xc670('0x1a')]){_0x15c29d[_0xc670('0x27')]=_0x21c45b[_0xc670('0x1a')];logger[_0xc670('0x1b')](util[_0xc670('0x1c')](_0xc670('0x1d'),_0x15c29d['name'],_0x15c29d['id']));}else{logger[_0xc670('0x1f')](util[_0xc670('0x1c')](_0xc670('0x20'),_0x15c29d[_0xc670('0x1e')],_0x15c29d['id']),util[_0xc670('0x21')](_0x21c45b,{'showHidden':![],'depth':null}));}return _0x598672(null,_0x359156);})['catch'](function(_0x1ac4d7){logger['error'](util[_0xc670('0x1c')](_0xc670('0x20'),_0x15c29d[_0xc670('0x1e')],_0x15c29d['id']),util[_0xc670('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x598672(_0x1ac4d7);});}else{return _0x598672(null,_0x359156);}}}});}; \ No newline at end of file +var _0x6716=['define','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','application/x-www-form-urlencoded','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','substring','lastIndexOf','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','then','refreshToken','catch','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports'];(function(_0x149863,_0x567189){var _0x2d28bc=function(_0x4a5fe1){while(--_0x4a5fe1){_0x149863['push'](_0x149863['shift']());}};_0x2d28bc(++_0x567189);}(_0x6716,0xfd));var _0x6671=function(_0x741b9a,_0x44c670){_0x741b9a=_0x741b9a-0x0;var _0x4bf212=_0x6716[_0x741b9a];return _0x4bf212;};'use strict';var _=require(_0x6671('0x0'));var util=require(_0x6671('0x1'));var logger=require('../../config/logger')(_0x6671('0x2'));var moment=require(_0x6671('0x3'));var BPromise=require(_0x6671('0x4'));var rp=require(_0x6671('0x5'));var fs=require('fs');var path=require(_0x6671('0x6'));var rimraf=require(_0x6671('0x7'));var config=require(_0x6671('0x8'));var attributes=require(_0x6671('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x6671('0xa')]=function(_0x4a804e,_0x114397){return _0x4a804e[_0x6671('0xb')]('ZohoAccount',attributes,{'tableName':_0x6671('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x29cdc2,_0x3a6360,_0x3846e1){if(_0x29cdc2[_0x6671('0xd')](_0x6671('0xe'))||_0x29cdc2[_0x6671('0xd')](_0x6671('0xf'))||_0x29cdc2[_0x6671('0xd')](_0x6671('0x10'))||_0x29cdc2[_0x6671('0xd')](_0x6671('0x11'))||_0x29cdc2[_0x6671('0xd')](_0x6671('0x12'))||_0x29cdc2[_0x6671('0xd')](_0x6671('0x13'))){var _0xa8506,_0x3e8789;_0xa8506=_0x29cdc2[_0x6671('0xf')];var _0x5bf20e=_0xa8506[_0x6671('0x14')](-0x1);if(_0x5bf20e==='/'||_0x5bf20e==='\x5c'||_0x5bf20e===':'){_0xa8506=_0xa8506['substring'](0x0,_0xa8506['lastIndexOf'](_0x5bf20e));}switch(_0x29cdc2[_0x6671('0xe')]){case'US':_0x3e8789=_0x6671('0x15');break;case'AU':_0x3e8789=_0x6671('0x16');break;case'IN':_0x3e8789=_0x6671('0x17');break;case'CN':_0x3e8789=_0x6671('0x18');break;default:_0x3e8789='https://accounts.zoho.eu';break;}var _0x5138eb={'method':_0x6671('0x19'),'uri':_0x3e8789+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x29cdc2['clientId'],'client_secret':_0x29cdc2[_0x6671('0x11')],'redirect_uri':_0x29cdc2[_0x6671('0xf')],'code':_0x29cdc2['code']},'headers':{'Content-Type':_0x6671('0x1a')}};return rp(_0x5138eb)['then'](function(_0xc1d1af){var _0x30963e=JSON[_0x6671('0x1b')](_0xc1d1af);if(_0x30963e['refresh_token']){_0x29cdc2['refreshToken']=_0x30963e[_0x6671('0x1c')];logger[_0x6671('0x1d')](util[_0x6671('0x1e')](_0x6671('0x1f'),_0x29cdc2['name'],_0x29cdc2['id']));}else{logger[_0x6671('0x20')](util[_0x6671('0x1e')](_0x6671('0x21'),_0x29cdc2[_0x6671('0x22')],_0x29cdc2['id']),util[_0x6671('0x23')](_0x30963e,{'showHidden':![],'depth':null}));}return _0x3846e1(null,_0x3a6360);})['catch'](function(_0x3226c1){logger['error'](util[_0x6671('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x29cdc2[_0x6671('0x22')],_0x29cdc2['id']),util[_0x6671('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x3846e1(_0x3226c1);});}else{return _0x3846e1(null,_0x3a6360);}},'beforeUpdate':function(_0x757012,_0x3cff2e,_0x5e262b){if(_0x757012[_0x6671('0xd')](_0x6671('0xe'))||_0x757012[_0x6671('0xd')]('serverUrl')||_0x757012['changed'](_0x6671('0x10'))||_0x757012[_0x6671('0xd')](_0x6671('0x11'))||_0x757012[_0x6671('0xd')](_0x6671('0x12'))||_0x757012[_0x6671('0xd')](_0x6671('0x13'))){var _0x27ae0c,_0x29e607;_0x27ae0c=_0x757012[_0x6671('0xf')];var _0xc5352b=_0x27ae0c[_0x6671('0x14')](-0x1);if(_0xc5352b==='/'||_0xc5352b==='\x5c'||_0xc5352b===':'){_0x27ae0c=_0x27ae0c[_0x6671('0x24')](0x0,_0x27ae0c[_0x6671('0x25')](_0xc5352b));}switch(_0x757012[_0x6671('0xe')]){case'US':_0x29e607='https://accounts.zoho.com';break;case'AU':_0x29e607=_0x6671('0x16');break;case'IN':_0x29e607='https://accounts.zoho.in';break;case'CN':_0x29e607=_0x6671('0x18');break;default:_0x29e607=_0x6671('0x26');break;}var _0x27e7ab={'method':_0x6671('0x19'),'uri':_0x29e607+_0x6671('0x27'),'form':{'grant_type':_0x6671('0x28'),'client_id':_0x757012[_0x6671('0x10')],'client_secret':_0x757012[_0x6671('0x11')],'redirect_uri':_0x757012[_0x6671('0xf')],'code':_0x757012[_0x6671('0x12')]},'headers':{'Content-Type':_0x6671('0x1a')}};return rp(_0x27e7ab)[_0x6671('0x29')](function(_0xe10aa){var _0x16b18f=JSON[_0x6671('0x1b')](_0xe10aa);if(_0x16b18f[_0x6671('0x1c')]){_0x757012[_0x6671('0x2a')]=_0x16b18f[_0x6671('0x1c')];logger[_0x6671('0x1d')](util[_0x6671('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x757012['name'],_0x757012['id']));}else{logger['error'](util['format'](_0x6671('0x21'),_0x757012[_0x6671('0x22')],_0x757012['id']),util[_0x6671('0x23')](_0x16b18f,{'showHidden':![],'depth':null}));}return _0x5e262b(null,_0x3cff2e);})[_0x6671('0x2b')](function(_0x242818){logger['error'](util[_0x6671('0x1e')](_0x6671('0x21'),_0x757012['name'],_0x757012['id']),util[_0x6671('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x5e262b(_0x242818);});}else{return _0x5e262b(null,_0x3cff2e);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index d336822..5471532 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 _0xccef=['http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','include','map','model','attributes','find','where','then','ShowZohoAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x30a27a,_0x1b32e4){var _0x5e2955=function(_0x5f226a){while(--_0x5f226a){_0x30a27a['push'](_0x30a27a['shift']());}};_0x5e2955(++_0x1b32e4);}(_0xccef,0x1d4));var _0xfcce=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xccef[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xfcce('0x0'));var moment=require('moment');var BPromise=require(_0xfcce('0x1'));var rs=require(_0xfcce('0x2'));var fs=require('fs');var Redis=require(_0xfcce('0x3'));var db=require(_0xfcce('0x4'))['db'];var utils=require(_0xfcce('0x5'));var logger=require(_0xfcce('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfcce('0x7'));var client=jayson['client'][_0xfcce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd71971,_0x12d091,_0x4598c1){return new BPromise(function(_0x117bc3,_0x380c2c){return client[_0xfcce('0x9')](_0xd71971,_0x4598c1)['then'](function(_0x382ea5){logger[_0xfcce('0xa')](_0xfcce('0xb'),_0x12d091,_0xfcce('0xc'));logger[_0xfcce('0xd')](_0xfcce('0xe'),_0x12d091,_0xfcce('0xc'),JSON[_0xfcce('0xf')](_0x382ea5));if(_0x382ea5[_0xfcce('0x10')]){if(_0x382ea5[_0xfcce('0x10')][_0xfcce('0x11')]===0x1f4){logger['error'](_0xfcce('0xb'),_0x12d091,_0x382ea5[_0xfcce('0x10')][_0xfcce('0x12')]);return _0x380c2c(_0x382ea5[_0xfcce('0x10')]['message']);}logger[_0xfcce('0x10')](_0xfcce('0xb'),_0x12d091,_0x382ea5['error']['message']);return _0x117bc3(_0x382ea5[_0xfcce('0x10')][_0xfcce('0x12')]);}else{logger[_0xfcce('0xa')](_0xfcce('0xb'),_0x12d091,_0xfcce('0xc'));_0x117bc3(_0x382ea5[_0xfcce('0x13')][_0xfcce('0x12')]);}})[_0xfcce('0x14')](function(_0x2d7611){logger[_0xfcce('0x10')](_0xfcce('0xb'),_0x12d091,_0x2d7611);_0x380c2c(_0x2d7611);});});}exports[_0xfcce('0x15')]=function(_0x40f6e4){var _0x60cee0=this;return new Promise(function(_0x3a8854,_0x33f5e2){return db[_0xfcce('0x16')][_0xfcce('0x17')]({'raw':_0x40f6e4[_0xfcce('0x18')]?_0x40f6e4[_0xfcce('0x18')][_0xfcce('0x19')]===undefined?!![]:![]:!![],'where':_0x40f6e4[_0xfcce('0x18')]?_0x40f6e4[_0xfcce('0x18')]['where']||null:null,'attributes':_0x40f6e4['options']?_0x40f6e4[_0xfcce('0x18')]['attributes']||null:null,'limit':_0x40f6e4[_0xfcce('0x18')]?_0x40f6e4[_0xfcce('0x18')]['limit']||null:null,'include':_0x40f6e4[_0xfcce('0x18')]?_0x40f6e4[_0xfcce('0x18')][_0xfcce('0x1a')]?_[_0xfcce('0x1b')](_0x40f6e4[_0xfcce('0x18')][_0xfcce('0x1a')],function(_0x52f3c8){return{'model':db[_0x52f3c8[_0xfcce('0x1c')]],'as':_0x52f3c8['as'],'attributes':_0x52f3c8[_0xfcce('0x1d')],'include':_0x52f3c8[_0xfcce('0x1a')]?_[_0xfcce('0x1b')](_0x52f3c8['include'],function(_0x4ca849){return{'model':db[_0x4ca849[_0xfcce('0x1c')]],'as':_0x4ca849['as'],'attributes':_0x4ca849[_0xfcce('0x1d')],'include':_0x4ca849[_0xfcce('0x1a')]?_[_0xfcce('0x1b')](_0x4ca849['include'],function(_0x428a4e){return{'model':db[_0x428a4e[_0xfcce('0x1c')]],'as':_0x428a4e['as'],'attributes':_0x428a4e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x413adf){logger[_0xfcce('0xa')](_0xfcce('0x15'),_0x40f6e4);logger[_0xfcce('0xd')](_0xfcce('0x15'),_0x40f6e4,JSON[_0xfcce('0xf')](_0x413adf));_0x3a8854(_0x413adf);})[_0xfcce('0x14')](function(_0x3b7592){logger[_0xfcce('0x10')](_0xfcce('0x15'),_0x3b7592['message'],_0x40f6e4);_0x33f5e2(_0x60cee0[_0xfcce('0x10')](0x1f4,_0x3b7592['message']));});});};exports['ShowZohoAccount']=function(_0x1aaddd){var _0x46d99c=this;return new Promise(function(_0x43dc0a,_0x40c460){return db[_0xfcce('0x16')][_0xfcce('0x1e')]({'raw':_0x1aaddd[_0xfcce('0x18')]?_0x1aaddd[_0xfcce('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1aaddd[_0xfcce('0x18')]?_0x1aaddd[_0xfcce('0x18')][_0xfcce('0x1f')]||null:null,'attributes':_0x1aaddd[_0xfcce('0x18')]?_0x1aaddd[_0xfcce('0x18')][_0xfcce('0x1d')]||null:null,'include':_0x1aaddd[_0xfcce('0x18')]?_0x1aaddd[_0xfcce('0x18')][_0xfcce('0x1a')]?_[_0xfcce('0x1b')](_0x1aaddd[_0xfcce('0x18')][_0xfcce('0x1a')],function(_0xb6015b){return{'model':db[_0xb6015b[_0xfcce('0x1c')]],'as':_0xb6015b['as'],'attributes':_0xb6015b['attributes'],'include':_0xb6015b[_0xfcce('0x1a')]?_['map'](_0xb6015b[_0xfcce('0x1a')],function(_0x278411){return{'model':db[_0x278411[_0xfcce('0x1c')]],'as':_0x278411['as'],'attributes':_0x278411[_0xfcce('0x1d')],'include':_0x278411[_0xfcce('0x1a')]?_[_0xfcce('0x1b')](_0x278411[_0xfcce('0x1a')],function(_0x3b4efd){return{'model':db[_0x3b4efd[_0xfcce('0x1c')]],'as':_0x3b4efd['as'],'attributes':_0x3b4efd[_0xfcce('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfcce('0x20')](function(_0x12e4fc){logger[_0xfcce('0xa')](_0xfcce('0x21'),_0x1aaddd);logger[_0xfcce('0xd')](_0xfcce('0x21'),_0x1aaddd,JSON['stringify'](_0x12e4fc));_0x43dc0a(_0x12e4fc);})[_0xfcce('0x14')](function(_0x1edf08){logger['error'](_0xfcce('0x21'),_0x1edf08['message'],_0x1aaddd);_0x40c460(_0x46d99c[_0xfcce('0x10')](0x1f4,_0x1edf08[_0xfcce('0x12')]));});});}; \ No newline at end of file +var _0x0954=['ZohoAccount','options','raw','attributes','limit','include','map','model','then','find','ShowZohoAccount','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetZohoAccount'];(function(_0x1d8fa1,_0x18d00f){var _0x528467=function(_0x259e18){while(--_0x259e18){_0x1d8fa1['push'](_0x1d8fa1['shift']());}};_0x528467(++_0x18d00f);}(_0x0954,0x135));var _0x4095=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x0954[_0x454165];return _0x56db53;};'use strict';var _=require(_0x4095('0x0'));var util=require('util');var moment=require(_0x4095('0x1'));var BPromise=require(_0x4095('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4095('0x3'));var db=require(_0x4095('0x4'))['db'];var utils=require(_0x4095('0x5'));var logger=require(_0x4095('0x6'))(_0x4095('0x7'));var config=require(_0x4095('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14b440,_0x352c8f,_0x1cf027){return new BPromise(function(_0x1440af,_0x24adfd){return client[_0x4095('0x9')](_0x14b440,_0x1cf027)['then'](function(_0x158dc7){logger[_0x4095('0xa')](_0x4095('0xb'),_0x352c8f,'request\x20sent');logger[_0x4095('0xc')](_0x4095('0xd'),_0x352c8f,_0x4095('0xe'),JSON['stringify'](_0x158dc7));if(_0x158dc7[_0x4095('0xf')]){if(_0x158dc7['error'][_0x4095('0x10')]===0x1f4){logger['error'](_0x4095('0xb'),_0x352c8f,_0x158dc7[_0x4095('0xf')][_0x4095('0x11')]);return _0x24adfd(_0x158dc7['error']['message']);}logger[_0x4095('0xf')](_0x4095('0xb'),_0x352c8f,_0x158dc7[_0x4095('0xf')][_0x4095('0x11')]);return _0x1440af(_0x158dc7['error']['message']);}else{logger[_0x4095('0xa')](_0x4095('0xb'),_0x352c8f,_0x4095('0xe'));_0x1440af(_0x158dc7[_0x4095('0x12')][_0x4095('0x11')]);}})[_0x4095('0x13')](function(_0x50c8c0){logger['error'](_0x4095('0xb'),_0x352c8f,_0x50c8c0);_0x24adfd(_0x50c8c0);});});}exports[_0x4095('0x14')]=function(_0x47ebf5){var _0x52d4d1=this;return new Promise(function(_0x5c3503,_0x59e95b){return db[_0x4095('0x15')]['findAll']({'raw':_0x47ebf5[_0x4095('0x16')]?_0x47ebf5[_0x4095('0x16')][_0x4095('0x17')]===undefined?!![]:![]:!![],'where':_0x47ebf5[_0x4095('0x16')]?_0x47ebf5['options']['where']||null:null,'attributes':_0x47ebf5[_0x4095('0x16')]?_0x47ebf5[_0x4095('0x16')][_0x4095('0x18')]||null:null,'limit':_0x47ebf5[_0x4095('0x16')]?_0x47ebf5[_0x4095('0x16')][_0x4095('0x19')]||null:null,'include':_0x47ebf5[_0x4095('0x16')]?_0x47ebf5[_0x4095('0x16')][_0x4095('0x1a')]?_[_0x4095('0x1b')](_0x47ebf5[_0x4095('0x16')][_0x4095('0x1a')],function(_0x440631){return{'model':db[_0x440631[_0x4095('0x1c')]],'as':_0x440631['as'],'attributes':_0x440631['attributes'],'include':_0x440631['include']?_[_0x4095('0x1b')](_0x440631[_0x4095('0x1a')],function(_0x26604f){return{'model':db[_0x26604f['model']],'as':_0x26604f['as'],'attributes':_0x26604f['attributes'],'include':_0x26604f[_0x4095('0x1a')]?_[_0x4095('0x1b')](_0x26604f[_0x4095('0x1a')],function(_0xbe5842){return{'model':db[_0xbe5842[_0x4095('0x1c')]],'as':_0xbe5842['as'],'attributes':_0xbe5842['attributes']};}):[]};}):[]};}):[]:[]})[_0x4095('0x1d')](function(_0xf87fd4){logger[_0x4095('0xa')](_0x4095('0x14'),_0x47ebf5);logger['debug'](_0x4095('0x14'),_0x47ebf5,JSON['stringify'](_0xf87fd4));_0x5c3503(_0xf87fd4);})['catch'](function(_0x199b7d){logger[_0x4095('0xf')](_0x4095('0x14'),_0x199b7d[_0x4095('0x11')],_0x47ebf5);_0x59e95b(_0x52d4d1['error'](0x1f4,_0x199b7d[_0x4095('0x11')]));});});};exports['ShowZohoAccount']=function(_0x347df8){var _0x3f2516=this;return new Promise(function(_0x4eb0ab,_0x3c49c0){return db[_0x4095('0x15')][_0x4095('0x1e')]({'raw':_0x347df8[_0x4095('0x16')]?_0x347df8[_0x4095('0x16')][_0x4095('0x17')]===undefined?!![]:![]:!![],'where':_0x347df8[_0x4095('0x16')]?_0x347df8[_0x4095('0x16')]['where']||null:null,'attributes':_0x347df8[_0x4095('0x16')]?_0x347df8['options'][_0x4095('0x18')]||null:null,'include':_0x347df8[_0x4095('0x16')]?_0x347df8['options'][_0x4095('0x1a')]?_[_0x4095('0x1b')](_0x347df8[_0x4095('0x16')][_0x4095('0x1a')],function(_0x31834d){return{'model':db[_0x31834d[_0x4095('0x1c')]],'as':_0x31834d['as'],'attributes':_0x31834d[_0x4095('0x18')],'include':_0x31834d[_0x4095('0x1a')]?_[_0x4095('0x1b')](_0x31834d['include'],function(_0x336e22){return{'model':db[_0x336e22[_0x4095('0x1c')]],'as':_0x336e22['as'],'attributes':_0x336e22['attributes'],'include':_0x336e22[_0x4095('0x1a')]?_['map'](_0x336e22['include'],function(_0x27dceb){return{'model':db[_0x27dceb[_0x4095('0x1c')]],'as':_0x27dceb['as'],'attributes':_0x27dceb[_0x4095('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53b9e8){logger[_0x4095('0xa')](_0x4095('0x1f'),_0x347df8);logger[_0x4095('0xc')]('ShowZohoAccount',_0x347df8,JSON[_0x4095('0x20')](_0x53b9e8));_0x4eb0ab(_0x53b9e8);})[_0x4095('0x13')](function(_0x1375e7){logger[_0x4095('0xf')](_0x4095('0x1f'),_0x1375e7[_0x4095('0x11')],_0x347df8);_0x3c49c0(_0x3f2516[_0x4095('0xf')](0x1f4,_0x1375e7[_0x4095('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 9ece274..e727567 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 _0xe652=['put','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/descriptions','post'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xe652,0xa5));var _0x2e65=function(_0x13a03a,_0x32da43){_0x13a03a=_0x13a03a-0x0;var _0x3ca2e5=_0xe652[_0x13a03a];return _0x3ca2e5;};'use strict';var multer=require('multer');var util=require(_0x2e65('0x0'));var path=require(_0x2e65('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2e65('0x2')]();var fs_extra=require(_0x2e65('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2e65('0x4'));var config=require(_0x2e65('0x5'));var controller=require(_0x2e65('0x6'));router[_0x2e65('0x7')]('/',auth[_0x2e65('0x8')](),controller[_0x2e65('0x9')]);router[_0x2e65('0x7')](_0x2e65('0xa'),auth[_0x2e65('0x8')](),controller[_0x2e65('0xb')]);router[_0x2e65('0x7')](_0x2e65('0xc'),auth[_0x2e65('0x8')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x2e65('0x8')](),controller['getSubjects']);router[_0x2e65('0x7')](_0x2e65('0xd'),auth[_0x2e65('0x8')](),controller['getDescriptions']);router[_0x2e65('0xe')]('/',auth[_0x2e65('0x8')](),controller['create']);router[_0x2e65('0xf')](_0x2e65('0xa'),auth[_0x2e65('0x8')](),controller[_0x2e65('0x10')]);router[_0x2e65('0x11')](_0x2e65('0xa'),auth['isAuthenticated'](),controller[_0x2e65('0x12')]);module[_0x2e65('0x13')]=router; \ No newline at end of file +var _0x388d=['../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0xc91599,_0x55e145){var _0x2aca1a=function(_0x3b37fe){while(--_0x3b37fe){_0xc91599['push'](_0xc91599['shift']());}};_0x2aca1a(++_0x55e145);}(_0x388d,0x118));var _0xd388=function(_0x1f3711,_0x159451){_0x1f3711=_0x1f3711-0x0;var _0x31c319=_0x388d[_0x1f3711];return _0x31c319;};'use strict';var multer=require(_0xd388('0x0'));var util=require(_0xd388('0x1'));var path=require('path');var timeout=require(_0xd388('0x2'));var express=require(_0xd388('0x3'));var router=express[_0xd388('0x4')]();var fs_extra=require(_0xd388('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd388('0x6'));var config=require(_0xd388('0x7'));var controller=require(_0xd388('0x8'));router[_0xd388('0x9')]('/',auth[_0xd388('0xa')](),controller[_0xd388('0xb')]);router[_0xd388('0x9')](_0xd388('0xc'),auth['isAuthenticated'](),controller[_0xd388('0xd')]);router[_0xd388('0x9')](_0xd388('0xe'),auth['isAuthenticated'](),controller[_0xd388('0xf')]);router[_0xd388('0x9')](_0xd388('0x10'),auth[_0xd388('0xa')](),controller[_0xd388('0x11')]);router[_0xd388('0x9')](_0xd388('0x12'),auth[_0xd388('0xa')](),controller[_0xd388('0x13')]);router[_0xd388('0x14')]('/',auth['isAuthenticated'](),controller[_0xd388('0x15')]);router[_0xd388('0x16')](_0xd388('0xc'),auth[_0xd388('0xa')](),controller[_0xd388('0x17')]);router['delete'](_0xd388('0xc'),auth[_0xd388('0xa')](),controller[_0xd388('0x18')]);module[_0xd388('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index fb733ff..34caae4 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 _0x00e1=['contact_lead','exports','STRING','ENUM','lead','contact','nothing'];(function(_0x27b7e2,_0x5a5962){var _0x569227=function(_0x3e1a27){while(--_0x3e1a27){_0x27b7e2['push'](_0x27b7e2['shift']());}};_0x569227(++_0x5a5962);}(_0x00e1,0x151));var _0x100e=function(_0x4f4bfd,_0x5ecb17){_0x4f4bfd=_0x4f4bfd-0x0;var _0x1a4e94=_0x00e1[_0x4f4bfd];return _0x1a4e94;};'use strict';var Sequelize=require('sequelize');module[_0x100e('0x0')]={'name':{'type':Sequelize[_0x100e('0x1')]},'moduleCreate':{'type':Sequelize[_0x100e('0x2')](_0x100e('0x3'),_0x100e('0x4'),_0x100e('0x5')),'defaultValue':_0x100e('0x3')},'moduleSearch':{'type':Sequelize[_0x100e('0x2')](_0x100e('0x6'),_0x100e('0x4'),_0x100e('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x100e('0x1')]}}; \ No newline at end of file +var _0xffa6=['ENUM','lead','contact','nothing','contact_lead','sequelize','exports','STRING'];(function(_0x43ab8a,_0x155d29){var _0xa752cd=function(_0x3de0d3){while(--_0x3de0d3){_0x43ab8a['push'](_0x43ab8a['shift']());}};_0xa752cd(++_0x155d29);}(_0xffa6,0x1a5));var _0x6ffa=function(_0x123ad5,_0x436c06){_0x123ad5=_0x123ad5-0x0;var _0x4d1bef=_0xffa6[_0x123ad5];return _0x4d1bef;};'use strict';var Sequelize=require(_0x6ffa('0x0'));module[_0x6ffa('0x1')]={'name':{'type':Sequelize[_0x6ffa('0x2')]},'moduleCreate':{'type':Sequelize[_0x6ffa('0x3')](_0x6ffa('0x4'),_0x6ffa('0x5'),_0x6ffa('0x6')),'defaultValue':_0x6ffa('0x4')},'moduleSearch':{'type':Sequelize[_0x6ffa('0x3')](_0x6ffa('0x7'),_0x6ffa('0x5'),_0x6ffa('0x4')),'defaultValue':_0x6ffa('0x7')},'description':{'type':Sequelize[_0x6ffa('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index ea25736..1ca633e 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 _0x94b5=['params','rawAttributes','filters','options','find','catch','create','update','body','findOne','ZohoField','order','pick','getFields','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','save','then','destroy','sendStatus','error','stack','name','send','map','ZohoConfiguration','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','show'];(function(_0x5c02be,_0x1a222c){var _0x3f487f=function(_0x9e562c){while(--_0x9e562c){_0x5c02be['push'](_0x5c02be['shift']());}};_0x3f487f(++_0x1a222c);}(_0x94b5,0x15c));var _0x594b=function(_0x1ff790,_0x55f1ea){_0x1ff790=_0x1ff790-0x0;var _0x3a2557=_0x94b5[_0x1ff790];return _0x3a2557;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x594b('0x0'));var jsonpatch=require(_0x594b('0x1'));var rp=require(_0x594b('0x2'));var moment=require(_0x594b('0x3'));var BPromise=require(_0x594b('0x4'));var Mustache=require(_0x594b('0x5'));var util=require(_0x594b('0x6'));var path=require(_0x594b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x594b('0x8'));var fs=require('fs');var fs_extra=require(_0x594b('0x9'));var _=require(_0x594b('0xa'));var squel=require(_0x594b('0xb'));var crypto=require('crypto');var jsforce=require(_0x594b('0xc'));var deskjs=require(_0x594b('0xd'));var toCsv=require(_0x594b('0xe'));var querystring=require(_0x594b('0xf'));var Papa=require(_0x594b('0x10'));var Redis=require('ioredis');var authService=require(_0x594b('0x11'));var qs=require(_0x594b('0x12'));var as=require(_0x594b('0x13'));var hardwareService=require(_0x594b('0x14'));var logger=require(_0x594b('0x15'))(_0x594b('0x16'));var utils=require(_0x594b('0x17'));var config=require(_0x594b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x594b('0x19'))['db'];function respondWithStatusCode(_0x57d555,_0x5744fe){_0x5744fe=_0x5744fe||0xcc;return function(_0x324f61){if(_0x324f61){return _0x57d555['sendStatus'](_0x5744fe);}return _0x57d555[_0x594b('0x1a')](_0x5744fe)[_0x594b('0x1b')]();};}function respondWithResult(_0x51041e,_0x51e4f5){_0x51e4f5=_0x51e4f5||0xc8;return function(_0x11192b){if(_0x11192b){return _0x51041e[_0x594b('0x1a')](_0x51e4f5)[_0x594b('0x1c')](_0x11192b);}};}function respondWithFilteredResult(_0x3a2d56,_0x242f0e){return function(_0x439ade){if(_0x439ade){var _0x534793=typeof _0x242f0e[_0x594b('0x1d')]===_0x594b('0x1e')&&typeof _0x242f0e[_0x594b('0x1f')]===_0x594b('0x1e');var _0x3d43bc=_0x439ade['count'];var _0x3af037=_0x534793?0x0:_0x242f0e[_0x594b('0x1d')];var _0x322e38=_0x534793?_0x439ade['count']:_0x242f0e['offset']+_0x242f0e[_0x594b('0x1f')];var _0x263904;if(_0x322e38>=_0x3d43bc){_0x322e38=_0x3d43bc;_0x263904=0xc8;}else{_0x263904=0xce;}_0x3a2d56['status'](_0x263904);return _0x3a2d56[_0x594b('0x20')]('Content-Range',_0x3af037+'-'+_0x322e38+'/'+_0x3d43bc)['json'](_0x439ade);}return null;};}function patchUpdates(_0x55c4d0){return function(_0x343961){try{jsonpatch[_0x594b('0x21')](_0x343961,_0x55c4d0,!![]);}catch(_0x2f4366){return BPromise['reject'](_0x2f4366);}return _0x343961[_0x594b('0x22')]();};}function saveUpdates(_0x122787,_0x3e3789){return function(_0x4e30ac){if(_0x4e30ac){return _0x4e30ac['update'](_0x122787)[_0x594b('0x23')](function(_0x549a18){return _0x549a18;});}return null;};}function removeEntity(_0x4f6a0c,_0x3d85e1){return function(_0x41632c){if(_0x41632c){return _0x41632c[_0x594b('0x24')]()[_0x594b('0x23')](function(){_0x4f6a0c[_0x594b('0x1a')](0xcc)[_0x594b('0x1b')]();});}};}function handleEntityNotFound(_0x4dcc6f,_0x5101c4){return function(_0x576bd6){if(!_0x576bd6){_0x4dcc6f[_0x594b('0x25')](0x194);}return _0x576bd6;};}function handleError(_0x6c080,_0x11d35b){_0x11d35b=_0x11d35b||0x1f4;return function(_0x13cdd8){logger[_0x594b('0x26')](_0x13cdd8[_0x594b('0x27')]);if(_0x13cdd8[_0x594b('0x28')]){delete _0x13cdd8['name'];}_0x6c080[_0x594b('0x1a')](_0x11d35b)[_0x594b('0x29')](_0x13cdd8);};}exports['index']=function(_0x53bffb,_0x3618ee){var _0x3125ec={},_0x5b13d5={},_0x1303f4={'count':0x0,'rows':[]};var _0x295950=_[_0x594b('0x2a')](db[_0x594b('0x2b')]['rawAttributes'],function(_0x4b8e50){return{'name':_0x4b8e50[_0x594b('0x2c')],'type':_0x4b8e50[_0x594b('0x2d')][_0x594b('0x2e')]};});_0x5b13d5['model']=_[_0x594b('0x2a')](_0x295950,_0x594b('0x28'));_0x5b13d5[_0x594b('0x2f')]=_[_0x594b('0x30')](_0x53bffb[_0x594b('0x2f')]);_0x5b13d5['filters']=_[_0x594b('0x31')](_0x5b13d5['model'],_0x5b13d5[_0x594b('0x2f')]);_0x3125ec[_0x594b('0x32')]=_[_0x594b('0x31')](_0x5b13d5[_0x594b('0x33')],qs[_0x594b('0x34')](_0x53bffb[_0x594b('0x2f')][_0x594b('0x34')]));_0x3125ec[_0x594b('0x32')]=_0x3125ec['attributes'][_0x594b('0x35')]?_0x3125ec[_0x594b('0x32')]:_0x5b13d5[_0x594b('0x33')];if(!_0x53bffb[_0x594b('0x2f')][_0x594b('0x36')](_0x594b('0x37'))){_0x3125ec[_0x594b('0x1f')]=qs[_0x594b('0x1f')](_0x53bffb[_0x594b('0x2f')]['limit']);_0x3125ec[_0x594b('0x1d')]=qs['offset'](_0x53bffb[_0x594b('0x2f')][_0x594b('0x1d')]);}_0x3125ec['order']=qs[_0x594b('0x38')](_0x53bffb[_0x594b('0x2f')][_0x594b('0x38')]);_0x3125ec[_0x594b('0x39')]=qs['filters'](_['pick'](_0x53bffb[_0x594b('0x2f')],_0x5b13d5['filters']),_0x295950);if(_0x53bffb[_0x594b('0x2f')][_0x594b('0x3a')]){_0x3125ec['where']=_[_0x594b('0x3b')](_0x3125ec[_0x594b('0x39')],{'$or':_[_0x594b('0x2a')](_0x295950,function(_0x222ec3){if(_0x222ec3[_0x594b('0x2d')]!==_0x594b('0x3c')){var _0x441200={};_0x441200[_0x222ec3[_0x594b('0x28')]]={'$like':'%'+_0x53bffb[_0x594b('0x2f')][_0x594b('0x3a')]+'%'};return _0x441200;}})});}_0x3125ec=_[_0x594b('0x3b')]({},_0x3125ec,_0x53bffb['options']);var _0x4e150a={'where':_0x3125ec[_0x594b('0x39')]};return db[_0x594b('0x2b')][_0x594b('0x3d')](_0x4e150a)[_0x594b('0x23')](function(_0x3aa1b5){_0x1303f4['count']=_0x3aa1b5;if(_0x53bffb[_0x594b('0x2f')][_0x594b('0x3e')]){_0x3125ec[_0x594b('0x3f')]=[{'all':!![]}];}return db[_0x594b('0x2b')][_0x594b('0x40')](_0x3125ec);})[_0x594b('0x23')](function(_0x3513f8){_0x1303f4[_0x594b('0x41')]=_0x3513f8;return _0x1303f4;})[_0x594b('0x23')](respondWithFilteredResult(_0x3618ee,_0x3125ec))['catch'](handleError(_0x3618ee,null));};exports[_0x594b('0x42')]=function(_0x347b69,_0x46aae8){var _0x576ba7={'raw':![],'where':{'id':_0x347b69[_0x594b('0x43')]['id']}},_0x3fef0e={};_0x3fef0e[_0x594b('0x33')]=_[_0x594b('0x30')](db[_0x594b('0x2b')][_0x594b('0x44')]);_0x3fef0e[_0x594b('0x2f')]=_[_0x594b('0x30')](_0x347b69[_0x594b('0x2f')]);_0x3fef0e[_0x594b('0x45')]=_[_0x594b('0x31')](_0x3fef0e[_0x594b('0x33')],_0x3fef0e['query']);_0x576ba7[_0x594b('0x32')]=_[_0x594b('0x31')](_0x3fef0e[_0x594b('0x33')],qs[_0x594b('0x34')](_0x347b69['query'][_0x594b('0x34')]));_0x576ba7[_0x594b('0x32')]=_0x576ba7[_0x594b('0x32')][_0x594b('0x35')]?_0x576ba7['attributes']:_0x3fef0e['model'];if(_0x347b69['query']['includeAll']){_0x576ba7['include']=[{'all':!![]}];}_0x576ba7=_[_0x594b('0x3b')]({},_0x576ba7,_0x347b69[_0x594b('0x46')]);return db[_0x594b('0x2b')][_0x594b('0x47')](_0x576ba7)['then'](handleEntityNotFound(_0x46aae8,null))[_0x594b('0x23')](respondWithResult(_0x46aae8,null))[_0x594b('0x48')](handleError(_0x46aae8,null));};exports[_0x594b('0x49')]=function(_0x3fc956,_0x41c2ee){return db[_0x594b('0x2b')]['create'](_0x3fc956['body'],{})[_0x594b('0x23')](respondWithResult(_0x41c2ee,0xc9))['catch'](handleError(_0x41c2ee,null));};exports[_0x594b('0x4a')]=function(_0x1c03f4,_0x1ec35f){if(_0x1c03f4[_0x594b('0x4b')]['id']){delete _0x1c03f4[_0x594b('0x4b')]['id'];}return db['ZohoConfiguration'][_0x594b('0x47')]({'where':{'id':_0x1c03f4[_0x594b('0x43')]['id']}})[_0x594b('0x23')](handleEntityNotFound(_0x1ec35f,null))[_0x594b('0x23')](saveUpdates(_0x1c03f4[_0x594b('0x4b')],null))[_0x594b('0x23')](respondWithResult(_0x1ec35f,null))[_0x594b('0x48')](handleError(_0x1ec35f,null));};exports[_0x594b('0x24')]=function(_0xdf613c,_0x30dff2){return db[_0x594b('0x2b')][_0x594b('0x47')]({'where':{'id':_0xdf613c['params']['id']}})['then'](handleEntityNotFound(_0x30dff2,null))[_0x594b('0x23')](removeEntity(_0x30dff2,null))[_0x594b('0x48')](handleError(_0x30dff2,null));};exports['getFields']=function(_0x2e607c,_0x2f2865,_0x1c05b8){var _0x444f45={};var _0x4c92f9={};var _0x428c82;var _0x4842c9;return db[_0x594b('0x2b')][_0x594b('0x4c')]({'where':{'id':_0x2e607c[_0x594b('0x43')]['id']}})[_0x594b('0x23')](handleEntityNotFound(_0x2f2865,null))[_0x594b('0x23')](function(_0xa91bc6){if(_0xa91bc6){_0x428c82=_0xa91bc6;_0x4c92f9[_0x594b('0x33')]=_[_0x594b('0x30')](db[_0x594b('0x4d')][_0x594b('0x44')]);_0x4c92f9[_0x594b('0x2f')]=_[_0x594b('0x30')](_0x2e607c[_0x594b('0x2f')]);_0x4c92f9[_0x594b('0x45')]=_[_0x594b('0x31')](_0x4c92f9[_0x594b('0x33')],_0x4c92f9['query']);_0x444f45[_0x594b('0x32')]=_['intersection'](_0x4c92f9['model'],qs[_0x594b('0x34')](_0x2e607c['query'][_0x594b('0x34')]));_0x444f45[_0x594b('0x32')]=_0x444f45[_0x594b('0x32')][_0x594b('0x35')]?_0x444f45[_0x594b('0x32')]:_0x4c92f9[_0x594b('0x33')];_0x444f45[_0x594b('0x4e')]=qs[_0x594b('0x38')](_0x2e607c[_0x594b('0x2f')][_0x594b('0x38')]);_0x444f45[_0x594b('0x39')]=qs[_0x594b('0x45')](_[_0x594b('0x4f')](_0x2e607c[_0x594b('0x2f')],_0x4c92f9[_0x594b('0x45')]));if(_0x2e607c[_0x594b('0x2f')]['filter']){_0x444f45[_0x594b('0x39')]=_[_0x594b('0x3b')](_0x444f45[_0x594b('0x39')],{'$or':_[_0x594b('0x2a')](_0x444f45[_0x594b('0x32')],function(_0x3587ce){var _0x2bd6d3={};_0x2bd6d3[_0x3587ce]={'$like':'%'+_0x2e607c[_0x594b('0x2f')][_0x594b('0x3a')]+'%'};return _0x2bd6d3;})});}_0x444f45=_[_0x594b('0x3b')]({},_0x444f45,_0x2e607c[_0x594b('0x46')]);return _0x428c82[_0x594b('0x50')](_0x444f45);}})[_0x594b('0x23')](function(_0x540fb6){if(_0x540fb6){_0x4842c9=_0x540fb6[_0x594b('0x35')];if(!_0x2e607c[_0x594b('0x2f')][_0x594b('0x36')](_0x594b('0x37'))){_0x444f45[_0x594b('0x1f')]=qs['limit'](_0x2e607c[_0x594b('0x2f')][_0x594b('0x1f')]);_0x444f45['offset']=qs[_0x594b('0x1d')](_0x2e607c[_0x594b('0x2f')][_0x594b('0x1d')]);}return _0x428c82[_0x594b('0x50')](_0x444f45);}})['then'](function(_0x37e4fa){if(_0x37e4fa){return _0x37e4fa?{'count':_0x4842c9,'rows':_0x37e4fa}:null;}})[_0x594b('0x23')](respondWithResult(_0x2f2865,null))[_0x594b('0x48')](handleError(_0x2f2865,null));};exports['getSubjects']=function(_0x46b5b5,_0x3472d8,_0x174592){var _0x13b7f9={};var _0x3e51c9={};var _0x4e48c6;var _0x27e5d2;return db[_0x594b('0x2b')][_0x594b('0x4c')]({'where':{'id':_0x46b5b5[_0x594b('0x43')]['id']}})[_0x594b('0x23')](handleEntityNotFound(_0x3472d8,null))[_0x594b('0x23')](function(_0xf3e522){if(_0xf3e522){_0x4e48c6=_0xf3e522;_0x3e51c9[_0x594b('0x33')]=_[_0x594b('0x30')](db[_0x594b('0x4d')]['rawAttributes']);_0x3e51c9[_0x594b('0x2f')]=_['keys'](_0x46b5b5['query']);_0x3e51c9[_0x594b('0x45')]=_['intersection'](_0x3e51c9[_0x594b('0x33')],_0x3e51c9['query']);_0x13b7f9['attributes']=_['intersection'](_0x3e51c9[_0x594b('0x33')],qs[_0x594b('0x34')](_0x46b5b5[_0x594b('0x2f')][_0x594b('0x34')]));_0x13b7f9[_0x594b('0x32')]=_0x13b7f9[_0x594b('0x32')][_0x594b('0x35')]?_0x13b7f9['attributes']:_0x3e51c9['model'];_0x13b7f9['order']=qs[_0x594b('0x38')](_0x46b5b5['query']['sort']);_0x13b7f9[_0x594b('0x39')]=qs[_0x594b('0x45')](_[_0x594b('0x4f')](_0x46b5b5[_0x594b('0x2f')],_0x3e51c9[_0x594b('0x45')]));if(_0x46b5b5['query'][_0x594b('0x3a')]){_0x13b7f9['where']=_[_0x594b('0x3b')](_0x13b7f9[_0x594b('0x39')],{'$or':_[_0x594b('0x2a')](_0x13b7f9['attributes'],function(_0x568d61){var _0x187c89={};_0x187c89[_0x568d61]={'$like':'%'+_0x46b5b5[_0x594b('0x2f')][_0x594b('0x3a')]+'%'};return _0x187c89;})});}_0x13b7f9=_[_0x594b('0x3b')]({},_0x13b7f9,_0x46b5b5[_0x594b('0x46')]);return _0x4e48c6[_0x594b('0x51')](_0x13b7f9);}})[_0x594b('0x23')](function(_0x576347){if(_0x576347){_0x27e5d2=_0x576347[_0x594b('0x35')];if(!_0x46b5b5[_0x594b('0x2f')][_0x594b('0x36')]('nolimit')){_0x13b7f9[_0x594b('0x1f')]=qs[_0x594b('0x1f')](_0x46b5b5[_0x594b('0x2f')][_0x594b('0x1f')]);_0x13b7f9[_0x594b('0x1d')]=qs[_0x594b('0x1d')](_0x46b5b5[_0x594b('0x2f')][_0x594b('0x1d')]);}return _0x4e48c6[_0x594b('0x51')](_0x13b7f9);}})[_0x594b('0x23')](function(_0x5e80f5){if(_0x5e80f5){return _0x5e80f5?{'count':_0x27e5d2,'rows':_0x5e80f5}:null;}})[_0x594b('0x23')](respondWithResult(_0x3472d8,null))[_0x594b('0x48')](handleError(_0x3472d8,null));};exports[_0x594b('0x52')]=function(_0x3a4ab8,_0x243167,_0x362310){var _0x1cd267={};var _0x2b5d5e={};var _0x5a1fe1;var _0x27f6b6;return db[_0x594b('0x2b')]['findOne']({'where':{'id':_0x3a4ab8[_0x594b('0x43')]['id']}})[_0x594b('0x23')](handleEntityNotFound(_0x243167,null))[_0x594b('0x23')](function(_0x580c86){if(_0x580c86){_0x5a1fe1=_0x580c86;_0x2b5d5e['model']=_['keys'](db['ZohoField'][_0x594b('0x44')]);_0x2b5d5e[_0x594b('0x2f')]=_[_0x594b('0x30')](_0x3a4ab8[_0x594b('0x2f')]);_0x2b5d5e['filters']=_[_0x594b('0x31')](_0x2b5d5e[_0x594b('0x33')],_0x2b5d5e[_0x594b('0x2f')]);_0x1cd267[_0x594b('0x32')]=_['intersection'](_0x2b5d5e['model'],qs[_0x594b('0x34')](_0x3a4ab8[_0x594b('0x2f')][_0x594b('0x34')]));_0x1cd267[_0x594b('0x32')]=_0x1cd267[_0x594b('0x32')][_0x594b('0x35')]?_0x1cd267[_0x594b('0x32')]:_0x2b5d5e[_0x594b('0x33')];_0x1cd267[_0x594b('0x4e')]=qs[_0x594b('0x38')](_0x3a4ab8[_0x594b('0x2f')][_0x594b('0x38')]);_0x1cd267['where']=qs[_0x594b('0x45')](_[_0x594b('0x4f')](_0x3a4ab8[_0x594b('0x2f')],_0x2b5d5e[_0x594b('0x45')]));if(_0x3a4ab8[_0x594b('0x2f')][_0x594b('0x3a')]){_0x1cd267[_0x594b('0x39')]=_[_0x594b('0x3b')](_0x1cd267['where'],{'$or':_[_0x594b('0x2a')](_0x1cd267[_0x594b('0x32')],function(_0x72246d){var _0x29945c={};_0x29945c[_0x72246d]={'$like':'%'+_0x3a4ab8[_0x594b('0x2f')][_0x594b('0x3a')]+'%'};return _0x29945c;})});}_0x1cd267=_['merge']({},_0x1cd267,_0x3a4ab8[_0x594b('0x46')]);return _0x5a1fe1['getDescriptions'](_0x1cd267);}})['then'](function(_0x5cfc02){if(_0x5cfc02){_0x27f6b6=_0x5cfc02[_0x594b('0x35')];if(!_0x3a4ab8[_0x594b('0x2f')][_0x594b('0x36')]('nolimit')){_0x1cd267[_0x594b('0x1f')]=qs[_0x594b('0x1f')](_0x3a4ab8[_0x594b('0x2f')]['limit']);_0x1cd267[_0x594b('0x1d')]=qs['offset'](_0x3a4ab8[_0x594b('0x2f')][_0x594b('0x1d')]);}return _0x5a1fe1['getDescriptions'](_0x1cd267);}})[_0x594b('0x23')](function(_0x12fbf5){if(_0x12fbf5){return _0x12fbf5?{'count':_0x27f6b6,'rows':_0x12fbf5}:null;}})[_0x594b('0x23')](respondWithResult(_0x243167,null))['catch'](handleError(_0x243167,null));}; \ No newline at end of file +var _0xf450=['show','params','rawAttributes','length','include','create','body','find','destroy','getFields','findOne','ZohoField','pick','options','nolimit','getSubjects','getDescriptions','hasOwnProperty','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','stack','send','index','map','ZohoConfiguration','fieldName','key','keys','query','filters','intersection','model','fields','attributes','order','sort','where','filter','merge','type','name','includeAll','rows','catch'];(function(_0x598a18,_0x24fffc){var _0x5b8cf0=function(_0x78cf1d){while(--_0x78cf1d){_0x598a18['push'](_0x598a18['shift']());}};_0x5b8cf0(++_0x24fffc);}(_0xf450,0x1f2));var _0x0f45=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xf450[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x0f45('0x0'));var rimraf=require(_0x0f45('0x1'));var zipdir=require(_0x0f45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0f45('0x3'));var BPromise=require(_0x0f45('0x4'));var Mustache=require('mustache');var util=require(_0x0f45('0x5'));var path=require('path');var sox=require(_0x0f45('0x6'));var csv=require(_0x0f45('0x7'));var ejs=require(_0x0f45('0x8'));var fs=require('fs');var fs_extra=require(_0x0f45('0x9'));var _=require(_0x0f45('0xa'));var squel=require(_0x0f45('0xb'));var crypto=require('crypto');var jsforce=require(_0x0f45('0xc'));var deskjs=require(_0x0f45('0xd'));var toCsv=require(_0x0f45('0x7'));var querystring=require(_0x0f45('0xe'));var Papa=require('papaparse');var Redis=require(_0x0f45('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0f45('0x10'));var as=require(_0x0f45('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f45('0x12'))(_0x0f45('0x13'));var utils=require('../../config/utils');var config=require(_0x0f45('0x14'));var licenseUtil=require(_0x0f45('0x15'));var db=require(_0x0f45('0x16'))['db'];function respondWithStatusCode(_0x3341c7,_0x58a9ca){_0x58a9ca=_0x58a9ca||0xcc;return function(_0x131b77){if(_0x131b77){return _0x3341c7[_0x0f45('0x17')](_0x58a9ca);}return _0x3341c7[_0x0f45('0x18')](_0x58a9ca)[_0x0f45('0x19')]();};}function respondWithResult(_0xf1d73,_0x14a16a){_0x14a16a=_0x14a16a||0xc8;return function(_0x27157c){if(_0x27157c){return _0xf1d73[_0x0f45('0x18')](_0x14a16a)[_0x0f45('0x1a')](_0x27157c);}};}function respondWithFilteredResult(_0x2db016,_0x520dd8){return function(_0x270139){if(_0x270139){var _0x5948bb=typeof _0x520dd8[_0x0f45('0x1b')]===_0x0f45('0x1c')&&typeof _0x520dd8['limit']===_0x0f45('0x1c');var _0x31a97c=_0x270139[_0x0f45('0x1d')];var _0x56b208=_0x5948bb?0x0:_0x520dd8[_0x0f45('0x1b')];var _0x4fe5c7=_0x5948bb?_0x270139[_0x0f45('0x1d')]:_0x520dd8[_0x0f45('0x1b')]+_0x520dd8[_0x0f45('0x1e')];var _0x3d6dd7;if(_0x4fe5c7>=_0x31a97c){_0x4fe5c7=_0x31a97c;_0x3d6dd7=0xc8;}else{_0x3d6dd7=0xce;}_0x2db016[_0x0f45('0x18')](_0x3d6dd7);return _0x2db016[_0x0f45('0x1f')](_0x0f45('0x20'),_0x56b208+'-'+_0x4fe5c7+'/'+_0x31a97c)['json'](_0x270139);}return null;};}function patchUpdates(_0x14fbb0){return function(_0x454c83){try{jsonpatch[_0x0f45('0x21')](_0x454c83,_0x14fbb0,!![]);}catch(_0x31d686){return BPromise[_0x0f45('0x22')](_0x31d686);}return _0x454c83['save']();};}function saveUpdates(_0xf1dd40,_0x48d740){return function(_0x4ed0c8){if(_0x4ed0c8){return _0x4ed0c8[_0x0f45('0x23')](_0xf1dd40)[_0x0f45('0x24')](function(_0x29747e){return _0x29747e;});}return null;};}function removeEntity(_0xa0e60f,_0x1881e1){return function(_0x26470a){if(_0x26470a){return _0x26470a['destroy']()['then'](function(){_0xa0e60f[_0x0f45('0x18')](0xcc)[_0x0f45('0x19')]();});}};}function handleEntityNotFound(_0x32e94d,_0x59151f){return function(_0x51bbca){if(!_0x51bbca){_0x32e94d[_0x0f45('0x17')](0x194);}return _0x51bbca;};}function handleError(_0x421d80,_0x4481e7){_0x4481e7=_0x4481e7||0x1f4;return function(_0x49b696){logger[_0x0f45('0x25')](_0x49b696[_0x0f45('0x26')]);if(_0x49b696['name']){delete _0x49b696['name'];}_0x421d80['status'](_0x4481e7)[_0x0f45('0x27')](_0x49b696);};}exports[_0x0f45('0x28')]=function(_0x16fdd5,_0x5cad32){var _0x40a0c5={},_0x5620d2={},_0x50f3a7={'count':0x0,'rows':[]};var _0x4524c6=_[_0x0f45('0x29')](db[_0x0f45('0x2a')]['rawAttributes'],function(_0x4fd292){return{'name':_0x4fd292[_0x0f45('0x2b')],'type':_0x4fd292['type'][_0x0f45('0x2c')]};});_0x5620d2['model']=_[_0x0f45('0x29')](_0x4524c6,'name');_0x5620d2['query']=_[_0x0f45('0x2d')](_0x16fdd5[_0x0f45('0x2e')]);_0x5620d2[_0x0f45('0x2f')]=_[_0x0f45('0x30')](_0x5620d2[_0x0f45('0x31')],_0x5620d2['query']);_0x40a0c5['attributes']=_[_0x0f45('0x30')](_0x5620d2[_0x0f45('0x31')],qs[_0x0f45('0x32')](_0x16fdd5[_0x0f45('0x2e')]['fields']));_0x40a0c5[_0x0f45('0x33')]=_0x40a0c5[_0x0f45('0x33')]['length']?_0x40a0c5[_0x0f45('0x33')]:_0x5620d2[_0x0f45('0x31')];if(!_0x16fdd5[_0x0f45('0x2e')]['hasOwnProperty']('nolimit')){_0x40a0c5[_0x0f45('0x1e')]=qs[_0x0f45('0x1e')](_0x16fdd5[_0x0f45('0x2e')]['limit']);_0x40a0c5[_0x0f45('0x1b')]=qs[_0x0f45('0x1b')](_0x16fdd5[_0x0f45('0x2e')][_0x0f45('0x1b')]);}_0x40a0c5[_0x0f45('0x34')]=qs[_0x0f45('0x35')](_0x16fdd5['query'][_0x0f45('0x35')]);_0x40a0c5[_0x0f45('0x36')]=qs[_0x0f45('0x2f')](_['pick'](_0x16fdd5['query'],_0x5620d2[_0x0f45('0x2f')]),_0x4524c6);if(_0x16fdd5['query'][_0x0f45('0x37')]){_0x40a0c5['where']=_[_0x0f45('0x38')](_0x40a0c5[_0x0f45('0x36')],{'$or':_[_0x0f45('0x29')](_0x4524c6,function(_0x12909e){if(_0x12909e[_0x0f45('0x39')]!=='VIRTUAL'){var _0x3a852b={};_0x3a852b[_0x12909e[_0x0f45('0x3a')]]={'$like':'%'+_0x16fdd5[_0x0f45('0x2e')][_0x0f45('0x37')]+'%'};return _0x3a852b;}})});}_0x40a0c5=_[_0x0f45('0x38')]({},_0x40a0c5,_0x16fdd5['options']);var _0x42379b={'where':_0x40a0c5[_0x0f45('0x36')]};return db[_0x0f45('0x2a')][_0x0f45('0x1d')](_0x42379b)[_0x0f45('0x24')](function(_0xeb23fb){_0x50f3a7[_0x0f45('0x1d')]=_0xeb23fb;if(_0x16fdd5[_0x0f45('0x2e')][_0x0f45('0x3b')]){_0x40a0c5['include']=[{'all':!![]}];}return db[_0x0f45('0x2a')]['findAll'](_0x40a0c5);})[_0x0f45('0x24')](function(_0x2e2bb9){_0x50f3a7[_0x0f45('0x3c')]=_0x2e2bb9;return _0x50f3a7;})[_0x0f45('0x24')](respondWithFilteredResult(_0x5cad32,_0x40a0c5))[_0x0f45('0x3d')](handleError(_0x5cad32,null));};exports[_0x0f45('0x3e')]=function(_0x1235a7,_0x29fe53){var _0x1e6505={'raw':![],'where':{'id':_0x1235a7[_0x0f45('0x3f')]['id']}},_0x321e84={};_0x321e84['model']=_[_0x0f45('0x2d')](db[_0x0f45('0x2a')][_0x0f45('0x40')]);_0x321e84['query']=_[_0x0f45('0x2d')](_0x1235a7[_0x0f45('0x2e')]);_0x321e84[_0x0f45('0x2f')]=_[_0x0f45('0x30')](_0x321e84[_0x0f45('0x31')],_0x321e84['query']);_0x1e6505[_0x0f45('0x33')]=_[_0x0f45('0x30')](_0x321e84[_0x0f45('0x31')],qs[_0x0f45('0x32')](_0x1235a7[_0x0f45('0x2e')][_0x0f45('0x32')]));_0x1e6505['attributes']=_0x1e6505['attributes'][_0x0f45('0x41')]?_0x1e6505['attributes']:_0x321e84[_0x0f45('0x31')];if(_0x1235a7[_0x0f45('0x2e')][_0x0f45('0x3b')]){_0x1e6505[_0x0f45('0x42')]=[{'all':!![]}];}_0x1e6505=_[_0x0f45('0x38')]({},_0x1e6505,_0x1235a7['options']);return db[_0x0f45('0x2a')]['find'](_0x1e6505)[_0x0f45('0x24')](handleEntityNotFound(_0x29fe53,null))[_0x0f45('0x24')](respondWithResult(_0x29fe53,null))[_0x0f45('0x3d')](handleError(_0x29fe53,null));};exports[_0x0f45('0x43')]=function(_0x5adbe8,_0x1fd0e9){return db[_0x0f45('0x2a')][_0x0f45('0x43')](_0x5adbe8[_0x0f45('0x44')],{})['then'](respondWithResult(_0x1fd0e9,0xc9))[_0x0f45('0x3d')](handleError(_0x1fd0e9,null));};exports['update']=function(_0x2796db,_0x5c549c){if(_0x2796db[_0x0f45('0x44')]['id']){delete _0x2796db[_0x0f45('0x44')]['id'];}return db['ZohoConfiguration'][_0x0f45('0x45')]({'where':{'id':_0x2796db[_0x0f45('0x3f')]['id']}})[_0x0f45('0x24')](handleEntityNotFound(_0x5c549c,null))[_0x0f45('0x24')](saveUpdates(_0x2796db[_0x0f45('0x44')],null))[_0x0f45('0x24')](respondWithResult(_0x5c549c,null))[_0x0f45('0x3d')](handleError(_0x5c549c,null));};exports[_0x0f45('0x46')]=function(_0x33c76a,_0xd46ed6){return db['ZohoConfiguration'][_0x0f45('0x45')]({'where':{'id':_0x33c76a[_0x0f45('0x3f')]['id']}})[_0x0f45('0x24')](handleEntityNotFound(_0xd46ed6,null))['then'](removeEntity(_0xd46ed6,null))[_0x0f45('0x3d')](handleError(_0xd46ed6,null));};exports[_0x0f45('0x47')]=function(_0x25c1e3,_0xb2c7f6,_0x4af527){var _0x23cd9e={};var _0x56fbcd={};var _0x3c1246;var _0x348d15;return db[_0x0f45('0x2a')][_0x0f45('0x48')]({'where':{'id':_0x25c1e3[_0x0f45('0x3f')]['id']}})['then'](handleEntityNotFound(_0xb2c7f6,null))['then'](function(_0x4a646c){if(_0x4a646c){_0x3c1246=_0x4a646c;_0x56fbcd['model']=_[_0x0f45('0x2d')](db[_0x0f45('0x49')]['rawAttributes']);_0x56fbcd[_0x0f45('0x2e')]=_[_0x0f45('0x2d')](_0x25c1e3['query']);_0x56fbcd[_0x0f45('0x2f')]=_[_0x0f45('0x30')](_0x56fbcd[_0x0f45('0x31')],_0x56fbcd[_0x0f45('0x2e')]);_0x23cd9e['attributes']=_[_0x0f45('0x30')](_0x56fbcd[_0x0f45('0x31')],qs[_0x0f45('0x32')](_0x25c1e3[_0x0f45('0x2e')]['fields']));_0x23cd9e['attributes']=_0x23cd9e[_0x0f45('0x33')][_0x0f45('0x41')]?_0x23cd9e[_0x0f45('0x33')]:_0x56fbcd['model'];_0x23cd9e[_0x0f45('0x34')]=qs['sort'](_0x25c1e3[_0x0f45('0x2e')][_0x0f45('0x35')]);_0x23cd9e['where']=qs['filters'](_[_0x0f45('0x4a')](_0x25c1e3['query'],_0x56fbcd['filters']));if(_0x25c1e3['query'][_0x0f45('0x37')]){_0x23cd9e[_0x0f45('0x36')]=_['merge'](_0x23cd9e[_0x0f45('0x36')],{'$or':_[_0x0f45('0x29')](_0x23cd9e[_0x0f45('0x33')],function(_0x1c617e){var _0x5aa2a6={};_0x5aa2a6[_0x1c617e]={'$like':'%'+_0x25c1e3['query']['filter']+'%'};return _0x5aa2a6;})});}_0x23cd9e=_[_0x0f45('0x38')]({},_0x23cd9e,_0x25c1e3[_0x0f45('0x4b')]);return _0x3c1246[_0x0f45('0x47')](_0x23cd9e);}})['then'](function(_0x57bd2d){if(_0x57bd2d){_0x348d15=_0x57bd2d[_0x0f45('0x41')];if(!_0x25c1e3['query']['hasOwnProperty'](_0x0f45('0x4c'))){_0x23cd9e[_0x0f45('0x1e')]=qs[_0x0f45('0x1e')](_0x25c1e3[_0x0f45('0x2e')][_0x0f45('0x1e')]);_0x23cd9e['offset']=qs['offset'](_0x25c1e3[_0x0f45('0x2e')]['offset']);}return _0x3c1246[_0x0f45('0x47')](_0x23cd9e);}})[_0x0f45('0x24')](function(_0x7de2c5){if(_0x7de2c5){return _0x7de2c5?{'count':_0x348d15,'rows':_0x7de2c5}:null;}})[_0x0f45('0x24')](respondWithResult(_0xb2c7f6,null))[_0x0f45('0x3d')](handleError(_0xb2c7f6,null));};exports['getSubjects']=function(_0x315a33,_0x577978,_0x1d3f26){var _0x178a4b={};var _0x4e94b5={};var _0x10e775;var _0xdb6d4b;return db[_0x0f45('0x2a')][_0x0f45('0x48')]({'where':{'id':_0x315a33[_0x0f45('0x3f')]['id']}})[_0x0f45('0x24')](handleEntityNotFound(_0x577978,null))[_0x0f45('0x24')](function(_0x167075){if(_0x167075){_0x10e775=_0x167075;_0x4e94b5[_0x0f45('0x31')]=_[_0x0f45('0x2d')](db[_0x0f45('0x49')][_0x0f45('0x40')]);_0x4e94b5[_0x0f45('0x2e')]=_[_0x0f45('0x2d')](_0x315a33[_0x0f45('0x2e')]);_0x4e94b5[_0x0f45('0x2f')]=_[_0x0f45('0x30')](_0x4e94b5[_0x0f45('0x31')],_0x4e94b5[_0x0f45('0x2e')]);_0x178a4b[_0x0f45('0x33')]=_['intersection'](_0x4e94b5[_0x0f45('0x31')],qs[_0x0f45('0x32')](_0x315a33[_0x0f45('0x2e')]['fields']));_0x178a4b[_0x0f45('0x33')]=_0x178a4b[_0x0f45('0x33')][_0x0f45('0x41')]?_0x178a4b[_0x0f45('0x33')]:_0x4e94b5[_0x0f45('0x31')];_0x178a4b[_0x0f45('0x34')]=qs[_0x0f45('0x35')](_0x315a33[_0x0f45('0x2e')][_0x0f45('0x35')]);_0x178a4b[_0x0f45('0x36')]=qs['filters'](_[_0x0f45('0x4a')](_0x315a33['query'],_0x4e94b5[_0x0f45('0x2f')]));if(_0x315a33['query'][_0x0f45('0x37')]){_0x178a4b[_0x0f45('0x36')]=_[_0x0f45('0x38')](_0x178a4b['where'],{'$or':_['map'](_0x178a4b[_0x0f45('0x33')],function(_0x4099fe){var _0x53b647={};_0x53b647[_0x4099fe]={'$like':'%'+_0x315a33[_0x0f45('0x2e')][_0x0f45('0x37')]+'%'};return _0x53b647;})});}_0x178a4b=_[_0x0f45('0x38')]({},_0x178a4b,_0x315a33[_0x0f45('0x4b')]);return _0x10e775[_0x0f45('0x4d')](_0x178a4b);}})[_0x0f45('0x24')](function(_0x21056a){if(_0x21056a){_0xdb6d4b=_0x21056a[_0x0f45('0x41')];if(!_0x315a33[_0x0f45('0x2e')]['hasOwnProperty'](_0x0f45('0x4c'))){_0x178a4b[_0x0f45('0x1e')]=qs[_0x0f45('0x1e')](_0x315a33[_0x0f45('0x2e')][_0x0f45('0x1e')]);_0x178a4b[_0x0f45('0x1b')]=qs['offset'](_0x315a33[_0x0f45('0x2e')][_0x0f45('0x1b')]);}return _0x10e775[_0x0f45('0x4d')](_0x178a4b);}})[_0x0f45('0x24')](function(_0x2e72a8){if(_0x2e72a8){return _0x2e72a8?{'count':_0xdb6d4b,'rows':_0x2e72a8}:null;}})['then'](respondWithResult(_0x577978,null))[_0x0f45('0x3d')](handleError(_0x577978,null));};exports['getDescriptions']=function(_0x257cf1,_0x1c4c71,_0x1c05e4){var _0x569083={};var _0x519623={};var _0xb1b4eb;var _0x343444;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x257cf1['params']['id']}})['then'](handleEntityNotFound(_0x1c4c71,null))[_0x0f45('0x24')](function(_0x49da8f){if(_0x49da8f){_0xb1b4eb=_0x49da8f;_0x519623['model']=_[_0x0f45('0x2d')](db[_0x0f45('0x49')]['rawAttributes']);_0x519623[_0x0f45('0x2e')]=_[_0x0f45('0x2d')](_0x257cf1['query']);_0x519623[_0x0f45('0x2f')]=_[_0x0f45('0x30')](_0x519623[_0x0f45('0x31')],_0x519623['query']);_0x569083[_0x0f45('0x33')]=_[_0x0f45('0x30')](_0x519623[_0x0f45('0x31')],qs[_0x0f45('0x32')](_0x257cf1[_0x0f45('0x2e')][_0x0f45('0x32')]));_0x569083[_0x0f45('0x33')]=_0x569083[_0x0f45('0x33')][_0x0f45('0x41')]?_0x569083[_0x0f45('0x33')]:_0x519623['model'];_0x569083[_0x0f45('0x34')]=qs[_0x0f45('0x35')](_0x257cf1[_0x0f45('0x2e')][_0x0f45('0x35')]);_0x569083[_0x0f45('0x36')]=qs['filters'](_['pick'](_0x257cf1[_0x0f45('0x2e')],_0x519623[_0x0f45('0x2f')]));if(_0x257cf1['query'][_0x0f45('0x37')]){_0x569083[_0x0f45('0x36')]=_[_0x0f45('0x38')](_0x569083[_0x0f45('0x36')],{'$or':_[_0x0f45('0x29')](_0x569083[_0x0f45('0x33')],function(_0x45fe46){var _0x4d623c={};_0x4d623c[_0x45fe46]={'$like':'%'+_0x257cf1['query'][_0x0f45('0x37')]+'%'};return _0x4d623c;})});}_0x569083=_[_0x0f45('0x38')]({},_0x569083,_0x257cf1[_0x0f45('0x4b')]);return _0xb1b4eb[_0x0f45('0x4e')](_0x569083);}})['then'](function(_0x2c9513){if(_0x2c9513){_0x343444=_0x2c9513['length'];if(!_0x257cf1[_0x0f45('0x2e')][_0x0f45('0x4f')]('nolimit')){_0x569083[_0x0f45('0x1e')]=qs[_0x0f45('0x1e')](_0x257cf1[_0x0f45('0x2e')][_0x0f45('0x1e')]);_0x569083[_0x0f45('0x1b')]=qs[_0x0f45('0x1b')](_0x257cf1[_0x0f45('0x2e')]['offset']);}return _0xb1b4eb[_0x0f45('0x4e')](_0x569083);}})[_0x0f45('0x24')](function(_0x18ed40){if(_0x18ed40){return _0x18ed40?{'count':_0x343444,'rows':_0x18ed40}:null;}})[_0x0f45('0x24')](respondWithResult(_0x1c4c71,null))['catch'](handleError(_0x1c4c71,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index eaac4c1..b07cda1 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 _0x1cca=['exports','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','moment','bluebird','path','rimraf','./intZohoConfiguration.attributes'];(function(_0x315c6e,_0x51d5ad){var _0x2169f4=function(_0x31f998){while(--_0x31f998){_0x315c6e['push'](_0x315c6e['shift']());}};_0x2169f4(++_0x51d5ad);}(_0x1cca,0x164));var _0xa1cc=function(_0x50feb9,_0xebd89d){_0x50feb9=_0x50feb9-0x0;var _0x1a3d37=_0x1cca[_0x50feb9];return _0x1a3d37;};'use strict';var _=require('lodash');var util=require(_0xa1cc('0x0'));var logger=require(_0xa1cc('0x1'))('api');var moment=require(_0xa1cc('0x2'));var BPromise=require(_0xa1cc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1cc('0x4'));var rimraf=require(_0xa1cc('0x5'));var config=require('../../config/environment');var attributes=require(_0xa1cc('0x6'));module[_0xa1cc('0x7')]=function(_0x4e5416,_0x5a675e){return _0x4e5416[_0xa1cc('0x8')](_0xa1cc('0x9'),attributes,{'tableName':_0xa1cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6ce=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x7a3d2e,_0x4eab95){var _0x395dbc=function(_0x334431){while(--_0x334431){_0x7a3d2e['push'](_0x7a3d2e['shift']());}};_0x395dbc(++_0x4eab95);}(_0xe6ce,0x133));var _0xee6c=function(_0xa3cfdb,_0x3b181c){_0xa3cfdb=_0xa3cfdb-0x0;var _0x55a06b=_0xe6ce[_0xa3cfdb];return _0x55a06b;};'use strict';var _=require(_0xee6c('0x0'));var util=require(_0xee6c('0x1'));var logger=require('../../config/logger')(_0xee6c('0x2'));var moment=require(_0xee6c('0x3'));var BPromise=require(_0xee6c('0x4'));var rp=require(_0xee6c('0x5'));var fs=require('fs');var path=require(_0xee6c('0x6'));var rimraf=require(_0xee6c('0x7'));var config=require(_0xee6c('0x8'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x26a175,_0x1bdebd){return _0x26a175['define'](_0xee6c('0x9'),attributes,{'tableName':_0xee6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index b8c2568..49ee183 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 _0x045b=['http','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZohoConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x4616b8,_0x1d196e){var _0x276802=function(_0x44c644){while(--_0x44c644){_0x4616b8['push'](_0x4616b8['shift']());}};_0x276802(++_0x1d196e);}(_0x045b,0x7d));var _0xb045=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0x045b[_0x43a5c7];return _0x3b12a2;};'use strict';var _=require(_0xb045('0x0'));var util=require(_0xb045('0x1'));var moment=require(_0xb045('0x2'));var BPromise=require('bluebird');var rs=require(_0xb045('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb045('0x4'))['db'];var utils=require(_0xb045('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb045('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb045('0x7')][_0xb045('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c93ed,_0x15266a,_0x46d25e){return new BPromise(function(_0x56e878,_0x3d0ff4){return client['request'](_0x2c93ed,_0x46d25e)['then'](function(_0x5eea18){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x15266a,'request\x20sent');logger[_0xb045('0x9')](_0xb045('0xa'),_0x15266a,_0xb045('0xb'),JSON['stringify'](_0x5eea18));if(_0x5eea18['error']){if(_0x5eea18[_0xb045('0xc')][_0xb045('0xd')]===0x1f4){logger[_0xb045('0xc')](_0xb045('0xe'),_0x15266a,_0x5eea18[_0xb045('0xc')]['message']);return _0x3d0ff4(_0x5eea18[_0xb045('0xc')]['message']);}logger[_0xb045('0xc')](_0xb045('0xe'),_0x15266a,_0x5eea18[_0xb045('0xc')][_0xb045('0xf')]);return _0x56e878(_0x5eea18[_0xb045('0xc')][_0xb045('0xf')]);}else{logger[_0xb045('0x10')](_0xb045('0xe'),_0x15266a,_0xb045('0xb'));_0x56e878(_0x5eea18[_0xb045('0x11')]['message']);}})[_0xb045('0x12')](function(_0x489c2f){logger[_0xb045('0xc')](_0xb045('0xe'),_0x15266a,_0x489c2f);_0x3d0ff4(_0x489c2f);});});} \ No newline at end of file +var _0x6602=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird'];(function(_0x26a906,_0x3d135c){var _0x495575=function(_0x2365af){while(--_0x2365af){_0x26a906['push'](_0x26a906['shift']());}};_0x495575(++_0x3d135c);}(_0x6602,0x177));var _0x2660=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x6602[_0x17406a];return _0x1501ff;};'use strict';var _=require(_0x2660('0x0'));var util=require(_0x2660('0x1'));var moment=require('moment');var BPromise=require(_0x2660('0x2'));var rs=require(_0x2660('0x3'));var fs=require('fs');var Redis=require(_0x2660('0x4'));var db=require(_0x2660('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2660('0x6'))('rpc');var config=require(_0x2660('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2660('0x8')][_0x2660('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19095f,_0x25fb91,_0x4cabe3){return new BPromise(function(_0x7d00fb,_0x57d817){return client[_0x2660('0xa')](_0x19095f,_0x4cabe3)[_0x2660('0xb')](function(_0x5444e9){logger[_0x2660('0xc')](_0x2660('0xd'),_0x25fb91,'request\x20sent');logger[_0x2660('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x25fb91,_0x2660('0xf'),JSON[_0x2660('0x10')](_0x5444e9));if(_0x5444e9['error']){if(_0x5444e9[_0x2660('0x11')]['code']===0x1f4){logger[_0x2660('0x11')](_0x2660('0xd'),_0x25fb91,_0x5444e9[_0x2660('0x11')][_0x2660('0x12')]);return _0x57d817(_0x5444e9[_0x2660('0x11')][_0x2660('0x12')]);}logger[_0x2660('0x11')](_0x2660('0xd'),_0x25fb91,_0x5444e9[_0x2660('0x11')][_0x2660('0x12')]);return _0x7d00fb(_0x5444e9['error'][_0x2660('0x12')]);}else{logger[_0x2660('0xc')](_0x2660('0xd'),_0x25fb91,_0x2660('0xf'));_0x7d00fb(_0x5444e9[_0x2660('0x13')][_0x2660('0x12')]);}})[_0x2660('0x14')](function(_0x58d519){logger[_0x2660('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x25fb91,_0x58d519);_0x57d817(_0x58d519);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index a9aba80..a841036 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 _0x4e31=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','/:id','isAuthenticated','post','create','update'];(function(_0x1133fc,_0x324619){var _0x320a68=function(_0x542cba){while(--_0x542cba){_0x1133fc['push'](_0x1133fc['shift']());}};_0x320a68(++_0x324619);}(_0x4e31,0x1f0));var _0x14e3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4e31[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x14e3('0x0'));var util=require(_0x14e3('0x1'));var path=require(_0x14e3('0x2'));var timeout=require(_0x14e3('0x3'));var express=require(_0x14e3('0x4'));var router=express[_0x14e3('0x5')]();var fs_extra=require(_0x14e3('0x6'));var auth=require(_0x14e3('0x7'));var interaction=require(_0x14e3('0x8'));var config=require(_0x14e3('0x9'));var controller=require(_0x14e3('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x14e3('0xb')](_0x14e3('0xc'),auth[_0x14e3('0xd')](),controller['show']);router[_0x14e3('0xe')]('/',auth[_0x14e3('0xd')](),controller[_0x14e3('0xf')]);router['put']('/:id',auth[_0x14e3('0xd')](),controller[_0x14e3('0x10')]);router[_0x14e3('0x11')](_0x14e3('0xc'),auth[_0x14e3('0xd')](),controller['destroy']);module[_0x14e3('0x12')]=router; \ No newline at end of file +var _0x4098=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoField.controller','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports'];(function(_0x58db3f,_0x5c159d){var _0x2a415d=function(_0xcdc916){while(--_0xcdc916){_0x58db3f['push'](_0x58db3f['shift']());}};_0x2a415d(++_0x5c159d);}(_0x4098,0x1c2));var _0x8409=function(_0x2e44b1,_0x15c45e){_0x2e44b1=_0x2e44b1-0x0;var _0x2ebb86=_0x4098[_0x2e44b1];return _0x2ebb86;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8409('0x0'));var express=require(_0x8409('0x1'));var router=express[_0x8409('0x2')]();var fs_extra=require(_0x8409('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8409('0x4'));var config=require('../../config/environment');var controller=require(_0x8409('0x5'));router['get']('/',auth[_0x8409('0x6')](),controller[_0x8409('0x7')]);router['get'](_0x8409('0x8'),auth[_0x8409('0x6')](),controller['show']);router[_0x8409('0x9')]('/',auth[_0x8409('0x6')](),controller[_0x8409('0xa')]);router[_0x8409('0xb')]('/:id',auth[_0x8409('0x6')](),controller['update']);router[_0x8409('0xc')](_0x8409('0x8'),auth[_0x8409('0x6')](),controller[_0x8409('0xd')]);module[_0x8409('0xe')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index c4b415b..324e2ce 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 _0x3984=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1bc852,_0x1a00ca){var _0x10194f=function(_0x4ac89e){while(--_0x4ac89e){_0x1bc852['push'](_0x1bc852['shift']());}};_0x10194f(++_0x1a00ca);}(_0x3984,0x156));var _0x4398=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0x3984[_0x59616b];return _0x5c4523;};'use strict';var Sequelize=require(_0x4398('0x0'));module[_0x4398('0x1')]={'type':{'type':Sequelize[_0x4398('0x2')](_0x4398('0x3'),_0x4398('0x4'),_0x4398('0x5'),_0x4398('0x6'),_0x4398('0x7')),'defaultValue':_0x4398('0x3')},'content':{'type':Sequelize[_0x4398('0x8')]},'key':{'type':Sequelize[_0x4398('0x8')]},'keyType':{'type':Sequelize[_0x4398('0x2')](_0x4398('0x3'),_0x4398('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x4398('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4398('0x8')]}}; \ No newline at end of file +var _0xa585=['ENUM','customVariable','picklist','STRING','BOOLEAN','exports'];(function(_0x2fbd0e,_0x1e69d5){var _0x45af2f=function(_0x1b2c6c){while(--_0x1b2c6c){_0x2fbd0e['push'](_0x2fbd0e['shift']());}};_0x45af2f(++_0x1e69d5);}(_0xa585,0x77));var _0x5a58=function(_0x223552,_0x27dcaf){_0x223552=_0x223552-0x0;var _0x5117c3=_0xa585[_0x223552];return _0x5117c3;};'use strict';var Sequelize=require('sequelize');module[_0x5a58('0x0')]={'type':{'type':Sequelize[_0x5a58('0x1')]('string','variable',_0x5a58('0x2'),'keyValue',_0x5a58('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5a58('0x4')]},'key':{'type':Sequelize[_0x5a58('0x4')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x5a58('0x4')]},'idField':{'type':Sequelize[_0x5a58('0x4')]},'nameField':{'type':Sequelize[_0x5a58('0x4')]},'customField':{'type':Sequelize[_0x5a58('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5a58('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 079e0cc..474fbea 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 _0x62c9=['merge','type','VIRTUAL','options','includeAll','include','ZohoField','findAll','rows','catch','params','keys','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0xbf68fe,_0x35e7ce){var _0x4e2f3e=function(_0x124bd5){while(--_0x124bd5){_0xbf68fe['push'](_0xbf68fe['shift']());}};_0x4e2f3e(++_0x35e7ce);}(_0x62c9,0x133));var _0x962c=function(_0x5cb93e,_0x28f49d){_0x5cb93e=_0x5cb93e-0x0;var _0x108071=_0x62c9[_0x5cb93e];return _0x108071;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x962c('0x0'));var zipdir=require(_0x962c('0x1'));var jsonpatch=require(_0x962c('0x2'));var rp=require(_0x962c('0x3'));var moment=require('moment');var BPromise=require(_0x962c('0x4'));var Mustache=require(_0x962c('0x5'));var util=require(_0x962c('0x6'));var path=require(_0x962c('0x7'));var sox=require(_0x962c('0x8'));var csv=require('to-csv');var ejs=require(_0x962c('0x9'));var fs=require('fs');var fs_extra=require(_0x962c('0xa'));var _=require('lodash');var squel=require(_0x962c('0xb'));var crypto=require(_0x962c('0xc'));var jsforce=require(_0x962c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x962c('0xe'));var querystring=require(_0x962c('0xf'));var Papa=require(_0x962c('0x10'));var Redis=require('ioredis');var authService=require(_0x962c('0x11'));var qs=require(_0x962c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x962c('0x13'))(_0x962c('0x14'));var utils=require(_0x962c('0x15'));var config=require(_0x962c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x962c('0x17'))['db'];function respondWithStatusCode(_0x91b851,_0x186f43){_0x186f43=_0x186f43||0xcc;return function(_0x1042c5){if(_0x1042c5){return _0x91b851['sendStatus'](_0x186f43);}return _0x91b851[_0x962c('0x18')](_0x186f43)['end']();};}function respondWithResult(_0xcd49f1,_0x55560f){_0x55560f=_0x55560f||0xc8;return function(_0x691ca6){if(_0x691ca6){return _0xcd49f1[_0x962c('0x18')](_0x55560f)[_0x962c('0x19')](_0x691ca6);}};}function respondWithFilteredResult(_0x34c66b,_0x15ce32){return function(_0x1c348c){if(_0x1c348c){var _0x34debc=typeof _0x15ce32['offset']===_0x962c('0x1a')&&typeof _0x15ce32[_0x962c('0x1b')]===_0x962c('0x1a');var _0x4bd7e3=_0x1c348c[_0x962c('0x1c')];var _0x2c456a=_0x34debc?0x0:_0x15ce32[_0x962c('0x1d')];var _0x222844=_0x34debc?_0x1c348c[_0x962c('0x1c')]:_0x15ce32[_0x962c('0x1d')]+_0x15ce32[_0x962c('0x1b')];var _0x3c30b1;if(_0x222844>=_0x4bd7e3){_0x222844=_0x4bd7e3;_0x3c30b1=0xc8;}else{_0x3c30b1=0xce;}_0x34c66b[_0x962c('0x18')](_0x3c30b1);return _0x34c66b[_0x962c('0x1e')]('Content-Range',_0x2c456a+'-'+_0x222844+'/'+_0x4bd7e3)[_0x962c('0x19')](_0x1c348c);}return null;};}function patchUpdates(_0x4d1077){return function(_0x1c357e){try{jsonpatch[_0x962c('0x1f')](_0x1c357e,_0x4d1077,!![]);}catch(_0x5659d1){return BPromise[_0x962c('0x20')](_0x5659d1);}return _0x1c357e[_0x962c('0x21')]();};}function saveUpdates(_0x214dea,_0x1468c8){return function(_0x28de96){if(_0x28de96){return _0x28de96[_0x962c('0x22')](_0x214dea)[_0x962c('0x23')](function(_0x2ab590){return _0x2ab590;});}return null;};}function removeEntity(_0x1d5feb,_0x2a3517){return function(_0x5ed178){if(_0x5ed178){return _0x5ed178[_0x962c('0x24')]()[_0x962c('0x23')](function(){_0x1d5feb[_0x962c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bc1d2,_0x6ccede){return function(_0x36e4a4){if(!_0x36e4a4){_0x2bc1d2['sendStatus'](0x194);}return _0x36e4a4;};}function handleError(_0x27f100,_0x5d06c9){_0x5d06c9=_0x5d06c9||0x1f4;return function(_0x214826){logger[_0x962c('0x25')](_0x214826[_0x962c('0x26')]);if(_0x214826['name']){delete _0x214826[_0x962c('0x27')];}_0x27f100['status'](_0x5d06c9)[_0x962c('0x28')](_0x214826);};}exports[_0x962c('0x29')]=function(_0x4c4c2b,_0x4cc28e){var _0x483b52={},_0x2d218b={},_0x49aff0={'count':0x0,'rows':[]};var _0x4117bd=_[_0x962c('0x2a')](db['ZohoField'][_0x962c('0x2b')],function(_0xa85485){return{'name':_0xa85485['fieldName'],'type':_0xa85485['type'][_0x962c('0x2c')]};});_0x2d218b['model']=_[_0x962c('0x2a')](_0x4117bd,_0x962c('0x27'));_0x2d218b[_0x962c('0x2d')]=_['keys'](_0x4c4c2b[_0x962c('0x2d')]);_0x2d218b[_0x962c('0x2e')]=_[_0x962c('0x2f')](_0x2d218b[_0x962c('0x30')],_0x2d218b[_0x962c('0x2d')]);_0x483b52[_0x962c('0x31')]=_[_0x962c('0x2f')](_0x2d218b[_0x962c('0x30')],qs[_0x962c('0x32')](_0x4c4c2b['query']['fields']));_0x483b52[_0x962c('0x31')]=_0x483b52[_0x962c('0x31')][_0x962c('0x33')]?_0x483b52[_0x962c('0x31')]:_0x2d218b[_0x962c('0x30')];if(!_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x34')]('nolimit')){_0x483b52[_0x962c('0x1b')]=qs[_0x962c('0x1b')](_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x1b')]);_0x483b52[_0x962c('0x1d')]=qs[_0x962c('0x1d')](_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x1d')]);}_0x483b52[_0x962c('0x35')]=qs[_0x962c('0x36')](_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x36')]);_0x483b52[_0x962c('0x37')]=qs[_0x962c('0x2e')](_[_0x962c('0x38')](_0x4c4c2b['query'],_0x2d218b['filters']),_0x4117bd);if(_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x39')]){_0x483b52[_0x962c('0x37')]=_[_0x962c('0x3a')](_0x483b52[_0x962c('0x37')],{'$or':_['map'](_0x4117bd,function(_0x412b09){if(_0x412b09[_0x962c('0x3b')]!==_0x962c('0x3c')){var _0x1f633e={};_0x1f633e[_0x412b09[_0x962c('0x27')]]={'$like':'%'+_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x39')]+'%'};return _0x1f633e;}})});}_0x483b52=_[_0x962c('0x3a')]({},_0x483b52,_0x4c4c2b[_0x962c('0x3d')]);var _0x512253={'where':_0x483b52[_0x962c('0x37')]};return db['ZohoField'][_0x962c('0x1c')](_0x512253)[_0x962c('0x23')](function(_0x37f63f){_0x49aff0[_0x962c('0x1c')]=_0x37f63f;if(_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x3e')]){_0x483b52[_0x962c('0x3f')]=[{'all':!![]}];}return db[_0x962c('0x40')][_0x962c('0x41')](_0x483b52);})[_0x962c('0x23')](function(_0x314597){_0x49aff0[_0x962c('0x42')]=_0x314597;return _0x49aff0;})[_0x962c('0x23')](respondWithFilteredResult(_0x4cc28e,_0x483b52))[_0x962c('0x43')](handleError(_0x4cc28e,null));};exports['show']=function(_0x3a797b,_0x594576){var _0x48a0db={'raw':!![],'where':{'id':_0x3a797b[_0x962c('0x44')]['id']}},_0x241f56={};_0x241f56[_0x962c('0x30')]=_[_0x962c('0x45')](db[_0x962c('0x40')][_0x962c('0x2b')]);_0x241f56[_0x962c('0x2d')]=_[_0x962c('0x45')](_0x3a797b[_0x962c('0x2d')]);_0x241f56['filters']=_['intersection'](_0x241f56[_0x962c('0x30')],_0x241f56[_0x962c('0x2d')]);_0x48a0db[_0x962c('0x31')]=_[_0x962c('0x2f')](_0x241f56[_0x962c('0x30')],qs['fields'](_0x3a797b[_0x962c('0x2d')][_0x962c('0x32')]));_0x48a0db[_0x962c('0x31')]=_0x48a0db['attributes'][_0x962c('0x33')]?_0x48a0db[_0x962c('0x31')]:_0x241f56[_0x962c('0x30')];if(_0x3a797b['query'][_0x962c('0x3e')]){_0x48a0db['include']=[{'all':!![]}];}_0x48a0db=_[_0x962c('0x3a')]({},_0x48a0db,_0x3a797b[_0x962c('0x3d')]);return db[_0x962c('0x40')]['find'](_0x48a0db)[_0x962c('0x23')](handleEntityNotFound(_0x594576,null))[_0x962c('0x23')](respondWithResult(_0x594576,null))[_0x962c('0x43')](handleError(_0x594576,null));};exports[_0x962c('0x46')]=function(_0x5846bd,_0x2cfa59){return db[_0x962c('0x40')][_0x962c('0x46')](_0x5846bd[_0x962c('0x47')],{})['then'](respondWithResult(_0x2cfa59,0xc9))[_0x962c('0x43')](handleError(_0x2cfa59,null));};exports['update']=function(_0x2291ca,_0x480cc2){if(_0x2291ca[_0x962c('0x47')]['id']){delete _0x2291ca[_0x962c('0x47')]['id'];}return db[_0x962c('0x40')][_0x962c('0x48')]({'where':{'id':_0x2291ca['params']['id']}})[_0x962c('0x23')](handleEntityNotFound(_0x480cc2,null))['then'](saveUpdates(_0x2291ca[_0x962c('0x47')],null))[_0x962c('0x23')](respondWithResult(_0x480cc2,null))['catch'](handleError(_0x480cc2,null));};exports[_0x962c('0x24')]=function(_0x24f256,_0x3a1a15){return db['ZohoField'][_0x962c('0x48')]({'where':{'id':_0x24f256[_0x962c('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a1a15,null))[_0x962c('0x23')](removeEntity(_0x3a1a15,null))[_0x962c('0x43')](handleError(_0x3a1a15,null));}; \ No newline at end of file +var _0x8747=['hasOwnProperty','nolimit','order','sort','filter','where','merge','map','options','ZohoField','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes'];(function(_0xb24fad,_0xd58756){var _0x173226=function(_0x33b4d6){while(--_0x33b4d6){_0xb24fad['push'](_0xb24fad['shift']());}};_0x173226(++_0xd58756);}(_0x8747,0xab));var _0x7874=function(_0x4b9c29,_0x46c107){_0x4b9c29=_0x4b9c29-0x0;var _0xfacb34=_0x8747[_0x4b9c29];return _0xfacb34;};'use strict';var emlformat=require(_0x7874('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7874('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7874('0x2'));var moment=require(_0x7874('0x3'));var BPromise=require(_0x7874('0x4'));var Mustache=require(_0x7874('0x5'));var util=require(_0x7874('0x6'));var path=require(_0x7874('0x7'));var sox=require(_0x7874('0x8'));var csv=require('to-csv');var ejs=require(_0x7874('0x9'));var fs=require('fs');var fs_extra=require(_0x7874('0xa'));var _=require(_0x7874('0xb'));var squel=require(_0x7874('0xc'));var crypto=require(_0x7874('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7874('0xe'));var toCsv=require(_0x7874('0xf'));var querystring=require(_0x7874('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7874('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7874('0x12'));var hardwareService=require(_0x7874('0x13'));var logger=require(_0x7874('0x14'))(_0x7874('0x15'));var utils=require(_0x7874('0x16'));var config=require(_0x7874('0x17'));var licenseUtil=require(_0x7874('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54b095,_0x3993ca){_0x3993ca=_0x3993ca||0xcc;return function(_0x26a13d){if(_0x26a13d){return _0x54b095[_0x7874('0x19')](_0x3993ca);}return _0x54b095[_0x7874('0x1a')](_0x3993ca)[_0x7874('0x1b')]();};}function respondWithResult(_0x27485a,_0x7270b){_0x7270b=_0x7270b||0xc8;return function(_0x1f495d){if(_0x1f495d){return _0x27485a['status'](_0x7270b)[_0x7874('0x1c')](_0x1f495d);}};}function respondWithFilteredResult(_0x54a8ac,_0x55c050){return function(_0x8908b2){if(_0x8908b2){var _0x7ebfef=typeof _0x55c050['offset']===_0x7874('0x1d')&&typeof _0x55c050[_0x7874('0x1e')]===_0x7874('0x1d');var _0x137842=_0x8908b2['count'];var _0x284d4a=_0x7ebfef?0x0:_0x55c050[_0x7874('0x1f')];var _0x74b34=_0x7ebfef?_0x8908b2[_0x7874('0x20')]:_0x55c050[_0x7874('0x1f')]+_0x55c050[_0x7874('0x1e')];var _0x1397b3;if(_0x74b34>=_0x137842){_0x74b34=_0x137842;_0x1397b3=0xc8;}else{_0x1397b3=0xce;}_0x54a8ac[_0x7874('0x1a')](_0x1397b3);return _0x54a8ac['set'](_0x7874('0x21'),_0x284d4a+'-'+_0x74b34+'/'+_0x137842)[_0x7874('0x1c')](_0x8908b2);}return null;};}function patchUpdates(_0x2c4229){return function(_0x5bd7b3){try{jsonpatch[_0x7874('0x22')](_0x5bd7b3,_0x2c4229,!![]);}catch(_0x2cc510){return BPromise[_0x7874('0x23')](_0x2cc510);}return _0x5bd7b3['save']();};}function saveUpdates(_0x158860,_0x42bacc){return function(_0x53238b){if(_0x53238b){return _0x53238b[_0x7874('0x24')](_0x158860)['then'](function(_0xbcceb){return _0xbcceb;});}return null;};}function removeEntity(_0x4223e7,_0x5dad45){return function(_0x5eb82c){if(_0x5eb82c){return _0x5eb82c[_0x7874('0x25')]()[_0x7874('0x26')](function(){_0x4223e7[_0x7874('0x1a')](0xcc)[_0x7874('0x1b')]();});}};}function handleEntityNotFound(_0x10ad9f,_0x37be21){return function(_0x321f05){if(!_0x321f05){_0x10ad9f['sendStatus'](0x194);}return _0x321f05;};}function handleError(_0x5cf375,_0x3e359e){_0x3e359e=_0x3e359e||0x1f4;return function(_0x1eb494){logger[_0x7874('0x27')](_0x1eb494[_0x7874('0x28')]);if(_0x1eb494[_0x7874('0x29')]){delete _0x1eb494['name'];}_0x5cf375[_0x7874('0x1a')](_0x3e359e)[_0x7874('0x2a')](_0x1eb494);};}exports[_0x7874('0x2b')]=function(_0x4ecec2,_0x3957a4){var _0x33f244={},_0x452887={},_0x216204={'count':0x0,'rows':[]};var _0x2f7d48=_['map'](db['ZohoField'][_0x7874('0x2c')],function(_0x14681e){return{'name':_0x14681e[_0x7874('0x2d')],'type':_0x14681e[_0x7874('0x2e')][_0x7874('0x2f')]};});_0x452887['model']=_['map'](_0x2f7d48,'name');_0x452887[_0x7874('0x30')]=_['keys'](_0x4ecec2['query']);_0x452887[_0x7874('0x31')]=_['intersection'](_0x452887[_0x7874('0x32')],_0x452887['query']);_0x33f244['attributes']=_[_0x7874('0x33')](_0x452887[_0x7874('0x32')],qs['fields'](_0x4ecec2['query'][_0x7874('0x34')]));_0x33f244[_0x7874('0x35')]=_0x33f244[_0x7874('0x35')]['length']?_0x33f244[_0x7874('0x35')]:_0x452887[_0x7874('0x32')];if(!_0x4ecec2[_0x7874('0x30')][_0x7874('0x36')](_0x7874('0x37'))){_0x33f244[_0x7874('0x1e')]=qs[_0x7874('0x1e')](_0x4ecec2[_0x7874('0x30')][_0x7874('0x1e')]);_0x33f244['offset']=qs['offset'](_0x4ecec2[_0x7874('0x30')][_0x7874('0x1f')]);}_0x33f244[_0x7874('0x38')]=qs[_0x7874('0x39')](_0x4ecec2[_0x7874('0x30')][_0x7874('0x39')]);_0x33f244['where']=qs[_0x7874('0x31')](_['pick'](_0x4ecec2['query'],_0x452887[_0x7874('0x31')]),_0x2f7d48);if(_0x4ecec2['query'][_0x7874('0x3a')]){_0x33f244[_0x7874('0x3b')]=_[_0x7874('0x3c')](_0x33f244[_0x7874('0x3b')],{'$or':_[_0x7874('0x3d')](_0x2f7d48,function(_0x28274e){if(_0x28274e[_0x7874('0x2e')]!=='VIRTUAL'){var _0x5bd7a1={};_0x5bd7a1[_0x28274e[_0x7874('0x29')]]={'$like':'%'+_0x4ecec2[_0x7874('0x30')][_0x7874('0x3a')]+'%'};return _0x5bd7a1;}})});}_0x33f244=_[_0x7874('0x3c')]({},_0x33f244,_0x4ecec2[_0x7874('0x3e')]);var _0x25e6c7={'where':_0x33f244[_0x7874('0x3b')]};return db[_0x7874('0x3f')][_0x7874('0x20')](_0x25e6c7)[_0x7874('0x26')](function(_0x5676cf){_0x216204['count']=_0x5676cf;if(_0x4ecec2[_0x7874('0x30')][_0x7874('0x40')]){_0x33f244[_0x7874('0x41')]=[{'all':!![]}];}return db['ZohoField'][_0x7874('0x42')](_0x33f244);})[_0x7874('0x26')](function(_0x1a8db6){_0x216204[_0x7874('0x43')]=_0x1a8db6;return _0x216204;})[_0x7874('0x26')](respondWithFilteredResult(_0x3957a4,_0x33f244))[_0x7874('0x44')](handleError(_0x3957a4,null));};exports[_0x7874('0x45')]=function(_0x48bf38,_0xb76ad9){var _0x8dc916={'raw':!![],'where':{'id':_0x48bf38[_0x7874('0x46')]['id']}},_0x43f96d={};_0x43f96d[_0x7874('0x32')]=_['keys'](db['ZohoField'][_0x7874('0x2c')]);_0x43f96d[_0x7874('0x30')]=_[_0x7874('0x47')](_0x48bf38[_0x7874('0x30')]);_0x43f96d[_0x7874('0x31')]=_[_0x7874('0x33')](_0x43f96d[_0x7874('0x32')],_0x43f96d[_0x7874('0x30')]);_0x8dc916[_0x7874('0x35')]=_[_0x7874('0x33')](_0x43f96d[_0x7874('0x32')],qs[_0x7874('0x34')](_0x48bf38[_0x7874('0x30')][_0x7874('0x34')]));_0x8dc916[_0x7874('0x35')]=_0x8dc916['attributes']['length']?_0x8dc916[_0x7874('0x35')]:_0x43f96d[_0x7874('0x32')];if(_0x48bf38[_0x7874('0x30')][_0x7874('0x40')]){_0x8dc916['include']=[{'all':!![]}];}_0x8dc916=_['merge']({},_0x8dc916,_0x48bf38[_0x7874('0x3e')]);return db[_0x7874('0x3f')][_0x7874('0x48')](_0x8dc916)[_0x7874('0x26')](handleEntityNotFound(_0xb76ad9,null))[_0x7874('0x26')](respondWithResult(_0xb76ad9,null))[_0x7874('0x44')](handleError(_0xb76ad9,null));};exports[_0x7874('0x49')]=function(_0x4f998d,_0x494f2b){return db['ZohoField'][_0x7874('0x49')](_0x4f998d['body'],{})[_0x7874('0x26')](respondWithResult(_0x494f2b,0xc9))[_0x7874('0x44')](handleError(_0x494f2b,null));};exports[_0x7874('0x24')]=function(_0x12b975,_0x4c4c2c){if(_0x12b975['body']['id']){delete _0x12b975[_0x7874('0x4a')]['id'];}return db['ZohoField'][_0x7874('0x48')]({'where':{'id':_0x12b975[_0x7874('0x46')]['id']}})['then'](handleEntityNotFound(_0x4c4c2c,null))[_0x7874('0x26')](saveUpdates(_0x12b975[_0x7874('0x4a')],null))[_0x7874('0x26')](respondWithResult(_0x4c4c2c,null))['catch'](handleError(_0x4c4c2c,null));};exports[_0x7874('0x25')]=function(_0x8c3591,_0x463c6e){return db[_0x7874('0x3f')][_0x7874('0x48')]({'where':{'id':_0x8c3591[_0x7874('0x46')]['id']}})[_0x7874('0x26')](handleEntityNotFound(_0x463c6e,null))[_0x7874('0x26')](removeEntity(_0x463c6e,null))[_0x7874('0x44')](handleError(_0x463c6e,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 940bc34..5435b32 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 _0x7046=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','exports','ZohoField','idField'];(function(_0x16dfae,_0x27dfcd){var _0x4dbda6=function(_0x1e551c){while(--_0x1e551c){_0x16dfae['push'](_0x16dfae['shift']());}};_0x4dbda6(++_0x27dfcd);}(_0x7046,0x144));var _0x6704=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7046[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var logger=require(_0x6704('0x2'))(_0x6704('0x3'));var moment=require('moment');var BPromise=require(_0x6704('0x4'));var rp=require(_0x6704('0x5'));var fs=require('fs');var path=require(_0x6704('0x6'));var rimraf=require('rimraf');var config=require(_0x6704('0x7'));var attributes=require(_0x6704('0x8'));module[_0x6704('0x9')]=function(_0x626a14,_0x2917be){return _0x626a14['define'](_0x6704('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x6704('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbff5=['request-promise','rimraf','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x849d79,_0x3131a7){var _0x4a0ffe=function(_0x342b59){while(--_0x342b59){_0x849d79['push'](_0x849d79['shift']());}};_0x4a0ffe(++_0x3131a7);}(_0xbff5,0x1bc));var _0x5bff=function(_0x20a9cc,_0x2b14d3){_0x20a9cc=_0x20a9cc-0x0;var _0x109f91=_0xbff5[_0x20a9cc];return _0x109f91;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var logger=require(_0x5bff('0x2'))(_0x5bff('0x3'));var moment=require(_0x5bff('0x4'));var BPromise=require(_0x5bff('0x5'));var rp=require(_0x5bff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bff('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x5bff('0x8')]=function(_0x1d8650,_0x151add){return _0x1d8650[_0x5bff('0x9')](_0x5bff('0xa'),attributes,{'tableName':_0x5bff('0xb'),'paranoid':![],'indexes':[{'name':_0x5bff('0xc'),'fields':[_0x5bff('0xd'),_0x5bff('0xe')],'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 19f3620..95d95bf 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 _0x6b07=['request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x37b4af,_0x43c63b){var _0x30043a=function(_0x3b926c){while(--_0x3b926c){_0x37b4af['push'](_0x37b4af['shift']());}};_0x30043a(++_0x43c63b);}(_0x6b07,0x1f0));var _0x76b0=function(_0x342e2c,_0x25c0d6){_0x342e2c=_0x342e2c-0x0;var _0x38e0ef=_0x6b07[_0x342e2c];return _0x38e0ef;};'use strict';var _=require(_0x76b0('0x0'));var util=require(_0x76b0('0x1'));var moment=require(_0x76b0('0x2'));var BPromise=require(_0x76b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76b0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x76b0('0x5'))(_0x76b0('0x6'));var config=require(_0x76b0('0x7'));var jayson=require(_0x76b0('0x8'));var client=jayson[_0x76b0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4632e9,_0x5bedbc,_0x298542){return new BPromise(function(_0x4dafa8,_0x2d726e){return client[_0x76b0('0xa')](_0x4632e9,_0x298542)[_0x76b0('0xb')](function(_0x3ebf2c){logger[_0x76b0('0xc')](_0x76b0('0xd'),_0x5bedbc,'request\x20sent');logger[_0x76b0('0xe')](_0x76b0('0xf'),_0x5bedbc,_0x76b0('0x10'),JSON[_0x76b0('0x11')](_0x3ebf2c));if(_0x3ebf2c['error']){if(_0x3ebf2c[_0x76b0('0x12')][_0x76b0('0x13')]===0x1f4){logger[_0x76b0('0x12')](_0x76b0('0xd'),_0x5bedbc,_0x3ebf2c[_0x76b0('0x12')][_0x76b0('0x14')]);return _0x2d726e(_0x3ebf2c[_0x76b0('0x12')]['message']);}logger[_0x76b0('0x12')](_0x76b0('0xd'),_0x5bedbc,_0x3ebf2c['error'][_0x76b0('0x14')]);return _0x4dafa8(_0x3ebf2c[_0x76b0('0x12')][_0x76b0('0x14')]);}else{logger[_0x76b0('0xc')](_0x76b0('0xd'),_0x5bedbc,_0x76b0('0x10'));_0x4dafa8(_0x3ebf2c['result'][_0x76b0('0x14')]);}})[_0x76b0('0x15')](function(_0x54aec3){logger['error'](_0x76b0('0xd'),_0x5bedbc,_0x54aec3);_0x2d726e(_0x54aec3);});});} \ No newline at end of file +var _0xa4f3=['ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x32efdc,_0x30732f){var _0x2710d3=function(_0x52bc79){while(--_0x52bc79){_0x32efdc['push'](_0x32efdc['shift']());}};_0x2710d3(++_0x30732f);}(_0xa4f3,0x1d4));var _0x3a4f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xa4f3[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3a4f('0x0'));var BPromise=require(_0x3a4f('0x1'));var rs=require(_0x3a4f('0x2'));var fs=require('fs');var Redis=require(_0x3a4f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3a4f('0x4'))(_0x3a4f('0x5'));var config=require('../../config/environment');var jayson=require(_0x3a4f('0x6'));var client=jayson[_0x3a4f('0x7')][_0x3a4f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e6f7d,_0x2eb88d,_0x5c62d1){return new BPromise(function(_0x4e8c21,_0x474971){return client[_0x3a4f('0x9')](_0x1e6f7d,_0x5c62d1)[_0x3a4f('0xa')](function(_0x2f28d8){logger[_0x3a4f('0xb')](_0x3a4f('0xc'),_0x2eb88d,_0x3a4f('0xd'));logger[_0x3a4f('0xe')](_0x3a4f('0xf'),_0x2eb88d,_0x3a4f('0xd'),JSON['stringify'](_0x2f28d8));if(_0x2f28d8[_0x3a4f('0x10')]){if(_0x2f28d8[_0x3a4f('0x10')]['code']===0x1f4){logger['error'](_0x3a4f('0xc'),_0x2eb88d,_0x2f28d8[_0x3a4f('0x10')][_0x3a4f('0x11')]);return _0x474971(_0x2f28d8[_0x3a4f('0x10')][_0x3a4f('0x11')]);}logger[_0x3a4f('0x10')](_0x3a4f('0xc'),_0x2eb88d,_0x2f28d8[_0x3a4f('0x10')][_0x3a4f('0x11')]);return _0x4e8c21(_0x2f28d8[_0x3a4f('0x10')]['message']);}else{logger[_0x3a4f('0xb')](_0x3a4f('0xc'),_0x2eb88d,_0x3a4f('0xd'));_0x4e8c21(_0x2f28d8[_0x3a4f('0x12')]['message']);}})[_0x3a4f('0x13')](function(_0x24ff70){logger[_0x3a4f('0x10')](_0x3a4f('0xc'),_0x2eb88d,_0x24ff70);_0x474971(_0x24ff70);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 3603a4d..4933fec 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2ac043,_0x2db262){var _0x3a905f=function(_0x203983){while(--_0x203983){_0x2ac043['push'](_0x2ac043['shift']());}};_0x3a905f(++_0x2db262);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1c05b5,_0x43a447){var _0x137eac=function(_0x56d257){while(--_0x56d257){_0x1c05b5['push'](_0x1c05b5['shift']());}};_0x137eac(++_0x43a447);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 2dc5833..ee44641 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 _0x4e0a=['exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize'];(function(_0x388c38,_0x1aa19d){var _0x5c126e=function(_0x10b9cb){while(--_0x10b9cb){_0x388c38['push'](_0x388c38['shift']());}};_0x5c126e(++_0x1aa19d);}(_0x4e0a,0x127));var _0xa4e0=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0x4e0a[_0x316904];return _0xfa9a21;};'use strict';var Sequelize=require(_0xa4e0('0x0'));module[_0xa4e0('0x1')]={'name':{'type':Sequelize[_0xa4e0('0x2')],'allowNull':![],'unique':_0xa4e0('0x3')},'version':{'type':Sequelize[_0xa4e0('0x2')],'allowNull':![],'unique':_0xa4e0('0x3')},'main':{'type':Sequelize[_0xa4e0('0x2')],'defaultValue':_0xa4e0('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xa4e0('0x2')]},'type':{'type':Sequelize[_0xa4e0('0x2')]},'size':{'type':Sequelize[_0xa4e0('0x5')]},'active':{'type':Sequelize[_0xa4e0('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xa4e0('0x2')]},'logo':{'type':Sequelize[_0xa4e0('0x2')]},'state':{'type':Sequelize[_0xa4e0('0x2')],'unique':_0xa4e0('0x7')},'description':{'type':Sequelize[_0xa4e0('0x2')]},'title':{'type':Sequelize[_0xa4e0('0x2')]},'remoteUri':{'type':Sequelize[_0xa4e0('0x2')]},'link':{'type':Sequelize[_0xa4e0('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x88c8=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','app.js'];(function(_0x196ce1,_0x46e836){var _0x360a64=function(_0x3f339f){while(--_0x3f339f){_0x196ce1['push'](_0x196ce1['shift']());}};_0x360a64(++_0x46e836);}(_0x88c8,0x7a));var _0x888c=function(_0x17ebc0,_0x457512){_0x17ebc0=_0x17ebc0-0x0;var _0x204b7b=_0x88c8[_0x17ebc0];return _0x204b7b;};'use strict';var Sequelize=require(_0x888c('0x0'));module[_0x888c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x888c('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x888c('0x3')},'filename':{'type':Sequelize[_0x888c('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x888c('0x2')]},'size':{'type':Sequelize[_0x888c('0x4')]},'active':{'type':Sequelize[_0x888c('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x888c('0x2')]},'logo':{'type':Sequelize[_0x888c('0x2')]},'state':{'type':Sequelize[_0x888c('0x2')],'unique':_0x888c('0x6')},'description':{'type':Sequelize[_0x888c('0x2')]},'title':{'type':Sequelize[_0x888c('0x2')]},'remoteUri':{'type':Sequelize[_0x888c('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 86fcc9c..d5478ac 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 _0x4c60=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','Integration','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4c60,0xc1));var _0x04c6=function(_0x55c2f3,_0x5110d2){_0x55c2f3=_0x55c2f3-0x0;var _0x2359e2=_0x4c60[_0x55c2f3];return _0x2359e2;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['Integration'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['Integration'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['Integration'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['Integration'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['Integration'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));}; \ No newline at end of file +var _0xfcf0=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','model','map','keys','query','filters'];(function(_0x320122,_0x84bb24){var _0x51484b=function(_0x2467f9){while(--_0x2467f9){_0x320122['push'](_0x320122['shift']());}};_0x51484b(++_0x84bb24);}(_0xfcf0,0x138));var _0x0fcf=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xfcf0[_0x1abb09];return _0xea1c07;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 934fc01..1ebec89 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 _0xe3db=['api','bluebird','path','exports','define','Integration','integrations','util','../../config/logger'];(function(_0x4adc4e,_0x39da2c){var _0x4d171e=function(_0x256aed){while(--_0x256aed){_0x4adc4e['push'](_0x4adc4e['shift']());}};_0x4d171e(++_0x39da2c);}(_0xe3db,0x181));var _0xbe3d=function(_0x1c3230,_0x47fdfa){_0x1c3230=_0x1c3230-0x0;var _0x492a7d=_0xe3db[_0x1c3230];return _0x492a7d;};'use strict';var _=require('lodash');var util=require(_0xbe3d('0x0'));var logger=require(_0xbe3d('0x1'))(_0xbe3d('0x2'));var moment=require('moment');var BPromise=require(_0xbe3d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe3d('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0xbe3d('0x5')]=function(_0x180d65,_0x5470a6){return _0x180d65[_0xbe3d('0x6')](_0xbe3d('0x7'),attributes,{'tableName':_0xbe3d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6869=['../../config/logger','api','moment','request-promise','path','../../config/environment','./integration.attributes','exports','Integration','integrations','util'];(function(_0x11b1b3,_0xf3cc69){var _0x437029=function(_0x40499a){while(--_0x40499a){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x437029(++_0xf3cc69);}(_0x6869,0xdb));var _0x9686=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6869[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x9686('0x0'));var logger=require(_0x9686('0x1'))(_0x9686('0x2'));var moment=require(_0x9686('0x3'));var BPromise=require('bluebird');var rp=require(_0x9686('0x4'));var fs=require('fs');var path=require(_0x9686('0x5'));var rimraf=require('rimraf');var config=require(_0x9686('0x6'));var attributes=require(_0x9686('0x7'));module[_0x9686('0x8')]=function(_0x45d3cd,_0xa9a43){return _0x45d3cd['define'](_0x9686('0x9'),attributes,{'tableName':_0x9686('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 0c34a18..e8075e5 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 _0x896e=['Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4734d8,_0x479950){var _0x3b1120=function(_0x4a5d1c){while(--_0x4a5d1c){_0x4734d8['push'](_0x4734d8['shift']());}};_0x3b1120(++_0x479950);}(_0x896e,0x1e9));var _0xe896=function(_0x2b863f,_0x4d5183){_0x2b863f=_0x2b863f-0x0;var _0x1380f9=_0x896e[_0x2b863f];return _0x1380f9;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('Integration,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('Integration,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});} \ No newline at end of file +var _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','Integration,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x154584,_0x421e12){var _0x969074=function(_0x17303b){while(--_0x17303b){_0x154584['push'](_0x154584['shift']());}};_0x969074(++_0x421e12);}(_0x14a0,0x8e));var _0x014a=function(_0x4b4574,_0xa5e1ca){_0x4b4574=_0x4b4574-0x0;var _0xa3e8e2=_0x14a0[_0x4b4574];return _0xa3e8e2;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('Integration,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('Integration,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('Integration,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index f3ae76e..139c782 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 _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x4373fe,_0x3c3c6e){var _0x4d6e86=function(_0x19caad){while(--_0x19caad){_0x4373fe['push'](_0x4373fe['shift']());}};_0x4d6e86(++_0x3c3c6e);}(_0xba34,0x119));var _0x4ba3=function(_0x10b52c,_0x2fd309){_0x10b52c=_0x10b52c-0x0;var _0x43ba57=_0xba34[_0x10b52c];return _0x43ba57;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xc'),auth['isAuthenticated'](),controller[_0x4ba3('0x11')]);router[_0x4ba3('0x12')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('0x13')]=router; \ No newline at end of file +var _0x896e=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x896e,0x1e9));var _0xe896=function(_0x360a12,_0x5d5831){_0x360a12=_0x360a12-0x0;var _0x24fa39=_0x896e[_0x360a12];return _0x24fa39;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['post']('/',auth[_0xe896('0xe')](),controller['create']);router[_0xe896('0x12')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x13')]);router[_0xe896('0x14')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);module[_0xe896('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index fefea7b..edaf9c3 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 _0x9028=['INTEGER','BOOLEAN','TEXT','SENT','FAILED','sequelize','exports','STRING','DATE'];(function(_0x552cf8,_0x493a58){var _0x5b0eca=function(_0xbc6b6d){while(--_0xbc6b6d){_0x552cf8['push'](_0x552cf8['shift']());}};_0x5b0eca(++_0x493a58);}(_0x9028,0x12e));var _0x8902=function(_0x32bed3,_0x33c35b){_0x32bed3=_0x32bed3-0x0;var _0x508d32=_0x9028[_0x32bed3];return _0x508d32;};'use strict';var Sequelize=require(_0x8902('0x0'));module[_0x8902('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x8902('0x2')]},'exitStatus':{'type':Sequelize[_0x8902('0x2')]},'ticketId':{'type':Sequelize[_0x8902('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x8902('0x2')]},'uniqueid':{'type':Sequelize[_0x8902('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8902('0x2')]},'queue':{'type':Sequelize[_0x8902('0x2')]},'interface':{'type':Sequelize[_0x8902('0x2')]},'membername':{'type':Sequelize[_0x8902('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8902('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x8902('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8902('0x3')]},'talktime':{'type':Sequelize[_0x8902('0x4')]},'agentacw':{'type':Sequelize[_0x8902('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8902('0x4')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x8902('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x8902('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x8902('0x2')]},'channel':{'type':Sequelize[_0x8902('0x2')]},'channelstate':{'type':Sequelize[_0x8902('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x8902('0x2')]},'connectedlinename':{'type':Sequelize[_0x8902('0x2')]},'language':{'type':Sequelize[_0x8902('0x2')]},'accountcode':{'type':Sequelize[_0x8902('0x2')]},'context':{'type':Sequelize[_0x8902('0x2')]},'exten':{'type':Sequelize[_0x8902('0x2')]},'priority':{'type':Sequelize[_0x8902('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x8902('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x8902('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x8902('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8902('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8902('0x2')]},'destaccountcode':{'type':Sequelize[_0x8902('0x2')]},'destcontext':{'type':Sequelize[_0x8902('0x2')]},'destexten':{'type':Sequelize[_0x8902('0x2')]},'destpriority':{'type':Sequelize[_0x8902('0x2')]},'destuniqueid':{'type':Sequelize[_0x8902('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x8902('0x2')]},'subject':{'type':Sequelize[_0x8902('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x8902('0x2')]},'cc':{'type':Sequelize[_0x8902('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x8902('0x6')]},'text':{'type':Sequelize[_0x8902('0x6')]},'status':{'type':Sequelize['ENUM'](_0x8902('0x7'),'SENDING','RECEIVED',_0x8902('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x8902('0x2')]},'projectId':{'type':Sequelize[_0x8902('0x4')]}}; \ No newline at end of file +var _0x2259=['TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x1cb33f,_0x4462ad){var _0x3264b2=function(_0x5f0e84){while(--_0x5f0e84){_0x1cb33f['push'](_0x1cb33f['shift']());}};_0x3264b2(++_0x4462ad);}(_0x2259,0x7e));var _0x9225=function(_0x1905ed,_0x1ce40c){_0x1905ed=_0x1905ed-0x0;var _0x689c6c=_0x2259[_0x1905ed];return _0x689c6c;};'use strict';var Sequelize=require(_0x9225('0x0'));module[_0x9225('0x1')]={'integration':{'type':Sequelize[_0x9225('0x2')]},'eventChannel':{'type':Sequelize[_0x9225('0x2')]},'exitStatus':{'type':Sequelize[_0x9225('0x2')]},'ticketId':{'type':Sequelize[_0x9225('0x2')]},'integrationId':{'type':Sequelize[_0x9225('0x3')]},'contacts':{'type':Sequelize[_0x9225('0x2')]},'uniqueid':{'type':Sequelize[_0x9225('0x2')]},'calleridnum':{'type':Sequelize[_0x9225('0x2')]},'calleridname':{'type':Sequelize[_0x9225('0x2')]},'queue':{'type':Sequelize[_0x9225('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9225('0x2')]},'agentcalledAt':{'type':Sequelize[_0x9225('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x9225('0x3')]},'agentcomplete':{'type':Sequelize[_0x9225('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x9225('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x9225('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x9225('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x9225('0x4')]},'agentdump':{'type':Sequelize[_0x9225('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x9225('0x2')]},'channel':{'type':Sequelize[_0x9225('0x2')]},'channelstate':{'type':Sequelize[_0x9225('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x9225('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9225('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9225('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9225('0x2')]},'destchannel':{'type':Sequelize[_0x9225('0x2')]},'destchannelstate':{'type':Sequelize[_0x9225('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x9225('0x2')]},'destcalleridname':{'type':Sequelize[_0x9225('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9225('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x9225('0x2')]},'destcontext':{'type':Sequelize[_0x9225('0x2')]},'destexten':{'type':Sequelize[_0x9225('0x2')]},'destpriority':{'type':Sequelize[_0x9225('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x9225('0x2')]},'inReplyTo':{'type':Sequelize[_0x9225('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x9225('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x9225('0x2')]},'attachment':{'type':Sequelize[_0x9225('0x6')]},'html':{'type':Sequelize[_0x9225('0x6')]},'text':{'type':Sequelize[_0x9225('0x6')]},'status':{'type':Sequelize[_0x9225('0x7')](_0x9225('0x8'),_0x9225('0x9'),_0x9225('0xa'),_0x9225('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x9225('0x2')]},'appdata':{'type':Sequelize[_0x9225('0x2')]},'projectId':{'type':Sequelize[_0x9225('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index fcb7bfd..cd4da68 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 _0xfb96=['name','send','index','map','IntegrationReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','rows','catch','show','params','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0xfb96,0x74));var _0x6fb9=function(_0x11b76d,_0xbbebb8){_0x11b76d=_0x11b76d-0x0;var _0x567ac3=_0xfb96[_0x11b76d];return _0x567ac3;};'use strict';var emlformat=require(_0x6fb9('0x0'));var rimraf=require(_0x6fb9('0x1'));var zipdir=require(_0x6fb9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6fb9('0x3'));var moment=require(_0x6fb9('0x4'));var BPromise=require(_0x6fb9('0x5'));var Mustache=require(_0x6fb9('0x6'));var util=require(_0x6fb9('0x7'));var path=require(_0x6fb9('0x8'));var sox=require(_0x6fb9('0x9'));var csv=require(_0x6fb9('0xa'));var ejs=require(_0x6fb9('0xb'));var fs=require('fs');var fs_extra=require(_0x6fb9('0xc'));var _=require(_0x6fb9('0xd'));var squel=require(_0x6fb9('0xe'));var crypto=require(_0x6fb9('0xf'));var jsforce=require(_0x6fb9('0x10'));var deskjs=require(_0x6fb9('0x11'));var toCsv=require('to-csv');var querystring=require(_0x6fb9('0x12'));var Papa=require(_0x6fb9('0x13'));var Redis=require(_0x6fb9('0x14'));var authService=require(_0x6fb9('0x15'));var qs=require(_0x6fb9('0x16'));var as=require(_0x6fb9('0x17'));var hardwareService=require(_0x6fb9('0x18'));var logger=require(_0x6fb9('0x19'))('api');var utils=require(_0x6fb9('0x1a'));var config=require(_0x6fb9('0x1b'));var licenseUtil=require(_0x6fb9('0x1c'));var db=require(_0x6fb9('0x1d'))['db'];function respondWithStatusCode(_0x223575,_0x358c22){_0x358c22=_0x358c22||0xcc;return function(_0x4ebb02){if(_0x4ebb02){return _0x223575['sendStatus'](_0x358c22);}return _0x223575['status'](_0x358c22)[_0x6fb9('0x1e')]();};}function respondWithResult(_0xd3b4bd,_0x4352e5){_0x4352e5=_0x4352e5||0xc8;return function(_0x4a03e9){if(_0x4a03e9){return _0xd3b4bd[_0x6fb9('0x1f')](_0x4352e5)[_0x6fb9('0x20')](_0x4a03e9);}};}function respondWithFilteredResult(_0x16041d,_0x169cda){return function(_0x1e3af9){if(_0x1e3af9){var _0x39b87b=typeof _0x169cda[_0x6fb9('0x21')]===_0x6fb9('0x22')&&typeof _0x169cda[_0x6fb9('0x23')]===_0x6fb9('0x22');var _0x10e90b=_0x1e3af9['count'];var _0x49ffe3=_0x39b87b?0x0:_0x169cda[_0x6fb9('0x21')];var _0x428624=_0x39b87b?_0x1e3af9[_0x6fb9('0x24')]:_0x169cda[_0x6fb9('0x21')]+_0x169cda['limit'];var _0x145b2e;if(_0x428624>=_0x10e90b){_0x428624=_0x10e90b;_0x145b2e=0xc8;}else{_0x145b2e=0xce;}_0x16041d[_0x6fb9('0x1f')](_0x145b2e);return _0x16041d[_0x6fb9('0x25')]('Content-Range',_0x49ffe3+'-'+_0x428624+'/'+_0x10e90b)[_0x6fb9('0x20')](_0x1e3af9);}return null;};}function patchUpdates(_0x44dc8e){return function(_0x353139){try{jsonpatch[_0x6fb9('0x26')](_0x353139,_0x44dc8e,!![]);}catch(_0x2c45ad){return BPromise[_0x6fb9('0x27')](_0x2c45ad);}return _0x353139[_0x6fb9('0x28')]();};}function saveUpdates(_0x1c8db5,_0x40b58c){return function(_0x489121){if(_0x489121){return _0x489121[_0x6fb9('0x29')](_0x1c8db5)[_0x6fb9('0x2a')](function(_0x48c899){return _0x48c899;});}return null;};}function removeEntity(_0x10cb77,_0x4dc6da){return function(_0x223915){if(_0x223915){return _0x223915[_0x6fb9('0x2b')]()[_0x6fb9('0x2a')](function(){_0x10cb77[_0x6fb9('0x1f')](0xcc)[_0x6fb9('0x1e')]();});}};}function handleEntityNotFound(_0x849cb9,_0x4e30c0){return function(_0x1ad71b){if(!_0x1ad71b){_0x849cb9[_0x6fb9('0x2c')](0x194);}return _0x1ad71b;};}function handleError(_0x22f279,_0x3b1c00){_0x3b1c00=_0x3b1c00||0x1f4;return function(_0x4c054b){logger[_0x6fb9('0x2d')](_0x4c054b['stack']);if(_0x4c054b[_0x6fb9('0x2e')]){delete _0x4c054b[_0x6fb9('0x2e')];}_0x22f279[_0x6fb9('0x1f')](_0x3b1c00)[_0x6fb9('0x2f')](_0x4c054b);};}exports[_0x6fb9('0x30')]=function(_0x4bceed,_0x18aac2){var _0x5d89f4={},_0xaf11ed={},_0x12e586={'count':0x0,'rows':[]};var _0x551796=_[_0x6fb9('0x31')](db[_0x6fb9('0x32')][_0x6fb9('0x33')],function(_0xc9f6dc){return{'name':_0xc9f6dc['fieldName'],'type':_0xc9f6dc['type'][_0x6fb9('0x34')]};});_0xaf11ed[_0x6fb9('0x35')]=_[_0x6fb9('0x31')](_0x551796,_0x6fb9('0x2e'));_0xaf11ed[_0x6fb9('0x36')]=_[_0x6fb9('0x37')](_0x4bceed[_0x6fb9('0x36')]);_0xaf11ed[_0x6fb9('0x38')]=_[_0x6fb9('0x39')](_0xaf11ed['model'],_0xaf11ed[_0x6fb9('0x36')]);_0x5d89f4['attributes']=_[_0x6fb9('0x39')](_0xaf11ed[_0x6fb9('0x35')],qs[_0x6fb9('0x3a')](_0x4bceed['query'][_0x6fb9('0x3a')]));_0x5d89f4['attributes']=_0x5d89f4[_0x6fb9('0x3b')][_0x6fb9('0x3c')]?_0x5d89f4['attributes']:_0xaf11ed[_0x6fb9('0x35')];if(!_0x4bceed[_0x6fb9('0x36')][_0x6fb9('0x3d')](_0x6fb9('0x3e'))){_0x5d89f4[_0x6fb9('0x23')]=qs[_0x6fb9('0x23')](_0x4bceed['query']['limit']);_0x5d89f4['offset']=qs[_0x6fb9('0x21')](_0x4bceed['query'][_0x6fb9('0x21')]);}_0x5d89f4[_0x6fb9('0x3f')]=qs['sort'](_0x4bceed[_0x6fb9('0x36')]['sort']);_0x5d89f4[_0x6fb9('0x40')]=qs[_0x6fb9('0x38')](_[_0x6fb9('0x41')](_0x4bceed[_0x6fb9('0x36')],_0xaf11ed[_0x6fb9('0x38')]),_0x551796);if(_0x4bceed[_0x6fb9('0x36')]['filter']){_0x5d89f4[_0x6fb9('0x40')]=_[_0x6fb9('0x42')](_0x5d89f4['where'],{'$or':_[_0x6fb9('0x31')](_0x551796,function(_0x461df7){if(_0x461df7[_0x6fb9('0x43')]!==_0x6fb9('0x44')){var _0x131d9c={};_0x131d9c[_0x461df7['name']]={'$like':'%'+_0x4bceed[_0x6fb9('0x36')][_0x6fb9('0x45')]+'%'};return _0x131d9c;}})});}_0x5d89f4=_['merge']({},_0x5d89f4,_0x4bceed[_0x6fb9('0x46')]);var _0x49ae79={'where':_0x5d89f4[_0x6fb9('0x40')]};return db[_0x6fb9('0x32')][_0x6fb9('0x24')](_0x49ae79)[_0x6fb9('0x2a')](function(_0xbd5cee){_0x12e586['count']=_0xbd5cee;if(_0x4bceed['query']['includeAll']){_0x5d89f4['include']=[{'all':!![]}];}return db[_0x6fb9('0x32')]['findAll'](_0x5d89f4);})['then'](function(_0x1ea287){_0x12e586[_0x6fb9('0x47')]=_0x1ea287;return _0x12e586;})[_0x6fb9('0x2a')](respondWithFilteredResult(_0x18aac2,_0x5d89f4))[_0x6fb9('0x48')](handleError(_0x18aac2,null));};exports[_0x6fb9('0x49')]=function(_0x511fe1,_0x550543){var _0x280e55={'raw':![],'where':{'id':_0x511fe1[_0x6fb9('0x4a')]['id']}},_0x52a919={};_0x52a919[_0x6fb9('0x35')]=_[_0x6fb9('0x37')](db[_0x6fb9('0x32')][_0x6fb9('0x33')]);_0x52a919[_0x6fb9('0x36')]=_[_0x6fb9('0x37')](_0x511fe1['query']);_0x52a919[_0x6fb9('0x38')]=_['intersection'](_0x52a919[_0x6fb9('0x35')],_0x52a919['query']);_0x280e55[_0x6fb9('0x3b')]=_[_0x6fb9('0x39')](_0x52a919[_0x6fb9('0x35')],qs['fields'](_0x511fe1[_0x6fb9('0x36')][_0x6fb9('0x3a')]));_0x280e55['attributes']=_0x280e55[_0x6fb9('0x3b')]['length']?_0x280e55[_0x6fb9('0x3b')]:_0x52a919[_0x6fb9('0x35')];if(_0x511fe1['query'][_0x6fb9('0x4b')]){_0x280e55[_0x6fb9('0x4c')]=[{'all':!![]}];}_0x280e55=_[_0x6fb9('0x42')]({},_0x280e55,_0x511fe1[_0x6fb9('0x46')]);return db[_0x6fb9('0x32')][_0x6fb9('0x4d')](_0x280e55)[_0x6fb9('0x2a')](handleEntityNotFound(_0x550543,null))['then'](respondWithResult(_0x550543,null))[_0x6fb9('0x48')](handleError(_0x550543,null));};exports[_0x6fb9('0x4e')]=function(_0x2a8aaf,_0x19700d){return db['IntegrationReport']['create'](_0x2a8aaf[_0x6fb9('0x4f')],{})[_0x6fb9('0x2a')](respondWithResult(_0x19700d,0xc9))['catch'](handleError(_0x19700d,null));};exports[_0x6fb9('0x29')]=function(_0x205069,_0x4351e0){if(_0x205069[_0x6fb9('0x4f')]['id']){delete _0x205069[_0x6fb9('0x4f')]['id'];}return db[_0x6fb9('0x32')][_0x6fb9('0x4d')]({'where':{'id':_0x205069[_0x6fb9('0x4a')]['id']}})[_0x6fb9('0x2a')](handleEntityNotFound(_0x4351e0,null))[_0x6fb9('0x2a')](saveUpdates(_0x205069[_0x6fb9('0x4f')],null))['then'](respondWithResult(_0x4351e0,null))[_0x6fb9('0x48')](handleError(_0x4351e0,null));};exports[_0x6fb9('0x2b')]=function(_0x57bc14,_0x28d6f7){return db[_0x6fb9('0x32')][_0x6fb9('0x4d')]({'where':{'id':_0x57bc14[_0x6fb9('0x4a')]['id']}})[_0x6fb9('0x2a')](handleEntityNotFound(_0x28d6f7,null))[_0x6fb9('0x2a')](removeEntity(_0x28d6f7,null))['catch'](handleError(_0x28d6f7,null));};exports[_0x6fb9('0x50')]=function(_0x51705b,_0x29894a){return db[_0x6fb9('0x32')][_0x6fb9('0x50')]()[_0x6fb9('0x2a')](respondWithResult(_0x29894a,null))[_0x6fb9('0x48')](handleError(_0x29894a,null));}; \ No newline at end of file +var _0xd9b9=['map','IntegrationReport','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','offset','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','Content-Range','apply','reject','then','destroy','sendStatus','error','name','send'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0xd9b9,0x199));var _0x9d9b=function(_0x26cf00,_0xe38bed){_0x26cf00=_0x26cf00-0x0;var _0x1a7384=_0xd9b9[_0x26cf00];return _0x1a7384;};'use strict';var emlformat=require(_0x9d9b('0x0'));var rimraf=require(_0x9d9b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d9b('0x2'));var rp=require(_0x9d9b('0x3'));var moment=require('moment');var BPromise=require(_0x9d9b('0x4'));var Mustache=require(_0x9d9b('0x5'));var util=require(_0x9d9b('0x6'));var path=require(_0x9d9b('0x7'));var sox=require(_0x9d9b('0x8'));var csv=require(_0x9d9b('0x9'));var ejs=require(_0x9d9b('0xa'));var fs=require('fs');var fs_extra=require(_0x9d9b('0xb'));var _=require(_0x9d9b('0xc'));var squel=require(_0x9d9b('0xd'));var crypto=require(_0x9d9b('0xe'));var jsforce=require(_0x9d9b('0xf'));var deskjs=require(_0x9d9b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9d9b('0x11'));var Redis=require(_0x9d9b('0x12'));var authService=require(_0x9d9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9d9b('0x14'));var hardwareService=require(_0x9d9b('0x15'));var logger=require(_0x9d9b('0x16'))('api');var utils=require(_0x9d9b('0x17'));var config=require(_0x9d9b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d9b('0x19'))['db'];function respondWithStatusCode(_0x54d301,_0xa72159){_0xa72159=_0xa72159||0xcc;return function(_0x398814){if(_0x398814){return _0x54d301['sendStatus'](_0xa72159);}return _0x54d301[_0x9d9b('0x1a')](_0xa72159)[_0x9d9b('0x1b')]();};}function respondWithResult(_0x5955ef,_0x19c1a4){_0x19c1a4=_0x19c1a4||0xc8;return function(_0xb1582c){if(_0xb1582c){return _0x5955ef['status'](_0x19c1a4)[_0x9d9b('0x1c')](_0xb1582c);}};}function respondWithFilteredResult(_0x47dafe,_0x4db89a){return function(_0x113c24){if(_0x113c24){var _0x35faff=typeof _0x4db89a['offset']===_0x9d9b('0x1d')&&typeof _0x4db89a[_0x9d9b('0x1e')]===_0x9d9b('0x1d');var _0x1ac511=_0x113c24['count'];var _0x4bb1fe=_0x35faff?0x0:_0x4db89a['offset'];var _0x579ed6=_0x35faff?_0x113c24[_0x9d9b('0x1f')]:_0x4db89a['offset']+_0x4db89a[_0x9d9b('0x1e')];var _0x362b7d;if(_0x579ed6>=_0x1ac511){_0x579ed6=_0x1ac511;_0x362b7d=0xc8;}else{_0x362b7d=0xce;}_0x47dafe[_0x9d9b('0x1a')](_0x362b7d);return _0x47dafe['set'](_0x9d9b('0x20'),_0x4bb1fe+'-'+_0x579ed6+'/'+_0x1ac511)[_0x9d9b('0x1c')](_0x113c24);}return null;};}function patchUpdates(_0x2d689c){return function(_0x4a1015){try{jsonpatch[_0x9d9b('0x21')](_0x4a1015,_0x2d689c,!![]);}catch(_0xc07ded){return BPromise[_0x9d9b('0x22')](_0xc07ded);}return _0x4a1015['save']();};}function saveUpdates(_0x105cb0,_0x2de773){return function(_0x49fd2b){if(_0x49fd2b){return _0x49fd2b['update'](_0x105cb0)[_0x9d9b('0x23')](function(_0x14f812){return _0x14f812;});}return null;};}function removeEntity(_0x395b76,_0x4efe8e){return function(_0x4370c7){if(_0x4370c7){return _0x4370c7[_0x9d9b('0x24')]()[_0x9d9b('0x23')](function(){_0x395b76[_0x9d9b('0x1a')](0xcc)[_0x9d9b('0x1b')]();});}};}function handleEntityNotFound(_0x40e631,_0x9a1343){return function(_0x392928){if(!_0x392928){_0x40e631[_0x9d9b('0x25')](0x194);}return _0x392928;};}function handleError(_0x2b23dd,_0x187381){_0x187381=_0x187381||0x1f4;return function(_0x2df8fa){logger[_0x9d9b('0x26')](_0x2df8fa['stack']);if(_0x2df8fa['name']){delete _0x2df8fa[_0x9d9b('0x27')];}_0x2b23dd[_0x9d9b('0x1a')](_0x187381)[_0x9d9b('0x28')](_0x2df8fa);};}exports['index']=function(_0x2f3336,_0x1cf726){var _0x2039d7={},_0x8b579={},_0x40a69f={'count':0x0,'rows':[]};var _0x3f18c4=_[_0x9d9b('0x29')](db[_0x9d9b('0x2a')]['rawAttributes'],function(_0x477410){return{'name':_0x477410[_0x9d9b('0x2b')],'type':_0x477410['type'][_0x9d9b('0x2c')]};});_0x8b579[_0x9d9b('0x2d')]=_['map'](_0x3f18c4,_0x9d9b('0x27'));_0x8b579[_0x9d9b('0x2e')]=_[_0x9d9b('0x2f')](_0x2f3336[_0x9d9b('0x2e')]);_0x8b579['filters']=_[_0x9d9b('0x30')](_0x8b579[_0x9d9b('0x2d')],_0x8b579[_0x9d9b('0x2e')]);_0x2039d7[_0x9d9b('0x31')]=_[_0x9d9b('0x30')](_0x8b579[_0x9d9b('0x2d')],qs[_0x9d9b('0x32')](_0x2f3336[_0x9d9b('0x2e')][_0x9d9b('0x32')]));_0x2039d7[_0x9d9b('0x31')]=_0x2039d7['attributes'][_0x9d9b('0x33')]?_0x2039d7['attributes']:_0x8b579['model'];if(!_0x2f3336[_0x9d9b('0x2e')]['hasOwnProperty'](_0x9d9b('0x34'))){_0x2039d7['limit']=qs[_0x9d9b('0x1e')](_0x2f3336[_0x9d9b('0x2e')][_0x9d9b('0x1e')]);_0x2039d7[_0x9d9b('0x35')]=qs[_0x9d9b('0x35')](_0x2f3336['query'][_0x9d9b('0x35')]);}_0x2039d7[_0x9d9b('0x36')]=qs[_0x9d9b('0x37')](_0x2f3336[_0x9d9b('0x2e')][_0x9d9b('0x37')]);_0x2039d7[_0x9d9b('0x38')]=qs[_0x9d9b('0x39')](_[_0x9d9b('0x3a')](_0x2f3336[_0x9d9b('0x2e')],_0x8b579[_0x9d9b('0x39')]),_0x3f18c4);if(_0x2f3336[_0x9d9b('0x2e')]['filter']){_0x2039d7[_0x9d9b('0x38')]=_[_0x9d9b('0x3b')](_0x2039d7[_0x9d9b('0x38')],{'$or':_['map'](_0x3f18c4,function(_0x30a51d){if(_0x30a51d[_0x9d9b('0x3c')]!==_0x9d9b('0x3d')){var _0x53d1f8={};_0x53d1f8[_0x30a51d[_0x9d9b('0x27')]]={'$like':'%'+_0x2f3336[_0x9d9b('0x2e')][_0x9d9b('0x3e')]+'%'};return _0x53d1f8;}})});}_0x2039d7=_[_0x9d9b('0x3b')]({},_0x2039d7,_0x2f3336[_0x9d9b('0x3f')]);var _0x279e01={'where':_0x2039d7[_0x9d9b('0x38')]};return db[_0x9d9b('0x2a')]['count'](_0x279e01)['then'](function(_0x450ba3){_0x40a69f[_0x9d9b('0x1f')]=_0x450ba3;if(_0x2f3336['query'][_0x9d9b('0x40')]){_0x2039d7['include']=[{'all':!![]}];}return db[_0x9d9b('0x2a')][_0x9d9b('0x41')](_0x2039d7);})[_0x9d9b('0x23')](function(_0x40eb7b){_0x40a69f[_0x9d9b('0x42')]=_0x40eb7b;return _0x40a69f;})[_0x9d9b('0x23')](respondWithFilteredResult(_0x1cf726,_0x2039d7))[_0x9d9b('0x43')](handleError(_0x1cf726,null));};exports[_0x9d9b('0x44')]=function(_0x4f088c,_0x5a71e6){var _0x2bcb21={'raw':![],'where':{'id':_0x4f088c[_0x9d9b('0x45')]['id']}},_0x3c44bf={};_0x3c44bf[_0x9d9b('0x2d')]=_[_0x9d9b('0x2f')](db['IntegrationReport']['rawAttributes']);_0x3c44bf[_0x9d9b('0x2e')]=_[_0x9d9b('0x2f')](_0x4f088c[_0x9d9b('0x2e')]);_0x3c44bf[_0x9d9b('0x39')]=_[_0x9d9b('0x30')](_0x3c44bf[_0x9d9b('0x2d')],_0x3c44bf[_0x9d9b('0x2e')]);_0x2bcb21['attributes']=_['intersection'](_0x3c44bf[_0x9d9b('0x2d')],qs['fields'](_0x4f088c['query']['fields']));_0x2bcb21[_0x9d9b('0x31')]=_0x2bcb21[_0x9d9b('0x31')]['length']?_0x2bcb21[_0x9d9b('0x31')]:_0x3c44bf[_0x9d9b('0x2d')];if(_0x4f088c[_0x9d9b('0x2e')][_0x9d9b('0x40')]){_0x2bcb21[_0x9d9b('0x46')]=[{'all':!![]}];}_0x2bcb21=_[_0x9d9b('0x3b')]({},_0x2bcb21,_0x4f088c['options']);return db[_0x9d9b('0x2a')][_0x9d9b('0x47')](_0x2bcb21)['then'](handleEntityNotFound(_0x5a71e6,null))[_0x9d9b('0x23')](respondWithResult(_0x5a71e6,null))[_0x9d9b('0x43')](handleError(_0x5a71e6,null));};exports[_0x9d9b('0x48')]=function(_0xaeef1b,_0x5f60e3){return db[_0x9d9b('0x2a')]['create'](_0xaeef1b[_0x9d9b('0x49')],{})[_0x9d9b('0x23')](respondWithResult(_0x5f60e3,0xc9))[_0x9d9b('0x43')](handleError(_0x5f60e3,null));};exports['update']=function(_0x332954,_0x285957){if(_0x332954[_0x9d9b('0x49')]['id']){delete _0x332954[_0x9d9b('0x49')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x332954['params']['id']}})['then'](handleEntityNotFound(_0x285957,null))[_0x9d9b('0x23')](saveUpdates(_0x332954[_0x9d9b('0x49')],null))['then'](respondWithResult(_0x285957,null))[_0x9d9b('0x43')](handleError(_0x285957,null));};exports[_0x9d9b('0x24')]=function(_0x3f723e,_0x460a9b){return db[_0x9d9b('0x2a')]['find']({'where':{'id':_0x3f723e['params']['id']}})[_0x9d9b('0x23')](handleEntityNotFound(_0x460a9b,null))[_0x9d9b('0x23')](removeEntity(_0x460a9b,null))[_0x9d9b('0x43')](handleError(_0x460a9b,null));};exports[_0x9d9b('0x4a')]=function(_0x1fed17,_0x322c45){return db[_0x9d9b('0x2a')][_0x9d9b('0x4a')]()[_0x9d9b('0x23')](respondWithResult(_0x322c45,null))[_0x9d9b('0x43')](handleError(_0x322c45,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index adc41dc..26f128b 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 _0x3bf0=['path','rimraf','../../config/environment','./integrationReport.attributes','IntegrationReport','report_integration','lodash','../../config/logger','api','moment'];(function(_0x36aa05,_0x3117cc){var _0x293263=function(_0x1bdc70){while(--_0x1bdc70){_0x36aa05['push'](_0x36aa05['shift']());}};_0x293263(++_0x3117cc);}(_0x3bf0,0x196));var _0x03bf=function(_0xd9ec20,_0x340647){_0xd9ec20=_0xd9ec20-0x0;var _0x68f0f7=_0x3bf0[_0xd9ec20];return _0x68f0f7;};'use strict';var _=require(_0x03bf('0x0'));var util=require('util');var logger=require(_0x03bf('0x1'))(_0x03bf('0x2'));var moment=require(_0x03bf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x03bf('0x4'));var rimraf=require(_0x03bf('0x5'));var config=require(_0x03bf('0x6'));var attributes=require(_0x03bf('0x7'));module['exports']=function(_0xf18b2a,_0x301769){return _0xf18b2a['define'](_0x03bf('0x8'),attributes,{'tableName':_0x03bf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa97c=['bluebird','path','rimraf','../../config/environment','./integrationReport.attributes','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment'];(function(_0x2c3eca,_0x39afa4){var _0x53860d=function(_0x2ad3cd){while(--_0x2ad3cd){_0x2c3eca['push'](_0x2c3eca['shift']());}};_0x53860d(++_0x39afa4);}(_0xa97c,0x16f));var _0xca97=function(_0x5b1560,_0x2d66cc){_0x5b1560=_0x5b1560-0x0;var _0x10aec5=_0xa97c[_0x5b1560];return _0x10aec5;};'use strict';var _=require(_0xca97('0x0'));var util=require(_0xca97('0x1'));var logger=require(_0xca97('0x2'))(_0xca97('0x3'));var moment=require(_0xca97('0x4'));var BPromise=require(_0xca97('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca97('0x6'));var rimraf=require(_0xca97('0x7'));var config=require(_0xca97('0x8'));var attributes=require(_0xca97('0x9'));module['exports']=function(_0x4942e6,_0x4ac9cb){return _0x4942e6['define'](_0xca97('0xa'),attributes,{'tableName':_0xca97('0xb'),'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 fc0c311..66c2334 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 _0x814b=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x814b,0x1a2));var _0xb814=function(_0x3b2c6f,_0xa9f35c){_0x3b2c6f=_0x3b2c6f-0x0;var _0x22e219=_0x814b[_0x3b2c6f];return _0x22e219;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x3299d1,_0x545733){var _0x44356e=function(_0x52fd77){while(--_0x52fd77){_0x3299d1['push'](_0x3299d1['shift']());}};_0x44356e(++_0x545733);}(_0x524e,0x15e));var _0xe524=function(_0x1811ac,_0x431267){_0x1811ac=_0x1811ac-0x0;var _0x2f3f20=_0x524e[_0x1811ac];return _0x2f3f20;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 4bfc609..c14367f 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 _0x6bfc=['addInterval','addIntervals','put','update','delete','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','post','create'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6bfc,0x159));var _0xc6bf=function(_0x49d0df,_0x4ad27e){_0x49d0df=_0x49d0df-0x0;var _0x328a94=_0x6bfc[_0x49d0df];return _0x328a94;};'use strict';var multer=require('multer');var util=require(_0xc6bf('0x0'));var path=require(_0xc6bf('0x1'));var timeout=require(_0xc6bf('0x2'));var express=require('express');var router=express[_0xc6bf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc6bf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6bf('0x5'));var controller=require(_0xc6bf('0x6'));router[_0xc6bf('0x7')]('/',auth['isAuthenticated'](),controller[_0xc6bf('0x8')]);router[_0xc6bf('0x7')](_0xc6bf('0x9'),auth[_0xc6bf('0xa')](),controller[_0xc6bf('0xb')]);router[_0xc6bf('0x7')](_0xc6bf('0xc'),auth[_0xc6bf('0xa')](),controller['getIntervals']);router[_0xc6bf('0xd')]('/',auth[_0xc6bf('0xa')](),controller[_0xc6bf('0xe')]);router[_0xc6bf('0xd')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0xc6bf('0xf')]);router[_0xc6bf('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0xc6bf('0x10')]);router[_0xc6bf('0x11')]('/:id',auth[_0xc6bf('0xa')](),controller[_0xc6bf('0x12')]);router[_0xc6bf('0x13')](_0xc6bf('0x9'),auth[_0xc6bf('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe437=['get','index','/:id','isAuthenticated','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller'];(function(_0x44968c,_0x232496){var _0x17f020=function(_0x1e8ded){while(--_0x1e8ded){_0x44968c['push'](_0x44968c['shift']());}};_0x17f020(++_0x232496);}(_0xe437,0x69));var _0x7e43=function(_0x588b1f,_0x4f2d01){_0x588b1f=_0x588b1f-0x0;var _0x3d9ce6=_0xe437[_0x588b1f];return _0x3d9ce6;};'use strict';var multer=require(_0x7e43('0x0'));var util=require(_0x7e43('0x1'));var path=require(_0x7e43('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e43('0x3'));var router=express[_0x7e43('0x4')]();var fs_extra=require(_0x7e43('0x5'));var auth=require(_0x7e43('0x6'));var interaction=require(_0x7e43('0x7'));var config=require(_0x7e43('0x8'));var controller=require(_0x7e43('0x9'));router[_0x7e43('0xa')]('/',auth['isAuthenticated'](),controller[_0x7e43('0xb')]);router[_0x7e43('0xa')](_0x7e43('0xc'),auth[_0x7e43('0xd')](),controller['show']);router[_0x7e43('0xa')](_0x7e43('0xe'),auth[_0x7e43('0xd')](),controller[_0x7e43('0xf')]);router[_0x7e43('0x10')]('/',auth[_0x7e43('0xd')](),controller[_0x7e43('0x11')]);router['post'](_0x7e43('0xe'),auth[_0x7e43('0xd')](),controller[_0x7e43('0x12')]);router[_0x7e43('0x10')](_0x7e43('0x13'),auth[_0x7e43('0xd')](),controller[_0x7e43('0x14')]);router[_0x7e43('0x15')]('/:id',auth[_0x7e43('0xd')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7e43('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 647a713..87142a5 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 _0x6f4c=['STRING','exports'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0x6f4c,0x1d5));var _0xc6f4=function(_0x379dd5,_0x4b040c){_0x379dd5=_0x379dd5-0x0;var _0xc68134=_0x6f4c[_0x379dd5];return _0xc68134;};'use strict';var Sequelize=require('sequelize');module[_0xc6f4('0x0')]={'name':{'type':Sequelize[_0xc6f4('0x1')]},'description':{'type':Sequelize[_0xc6f4('0x1')]},'interval':{'type':Sequelize[_0xc6f4('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x25c4=['exports','STRING','sequelize'];(function(_0x5cc9ae,_0x116739){var _0xef9aa1=function(_0x403b0c){while(--_0x403b0c){_0x5cc9ae['push'](_0x5cc9ae['shift']());}};_0xef9aa1(++_0x116739);}(_0x25c4,0x77));var _0x425c=function(_0x23eb8c,_0x5618e8){_0x23eb8c=_0x23eb8c-0x0;var _0x4978ba=_0x25c4[_0x23eb8c];return _0x4978ba;};'use strict';var Sequelize=require(_0x425c('0x0'));module[_0x425c('0x1')]={'name':{'type':Sequelize[_0x425c('0x2')]},'description':{'type':Sequelize[_0x425c('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 312cce8..c4a9419 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 _0x9145=['set','apply','destroy','then','get','Intervals','UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','IntervalId','order','pick','getIntervals','nolimit','findOne','transaction','bulkCreate','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','limit','count'];(function(_0x20e0d9,_0x157105){var _0x2a39b3=function(_0x595e22){while(--_0x595e22){_0x20e0d9['push'](_0x20e0d9['shift']());}};_0x2a39b3(++_0x157105);}(_0x9145,0xe9));var _0x5914=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9145[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5914('0x0'));var jsonpatch=require(_0x5914('0x1'));var rp=require(_0x5914('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5914('0x3'));var path=require(_0x5914('0x4'));var sox=require(_0x5914('0x5'));var csv=require(_0x5914('0x6'));var ejs=require(_0x5914('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5914('0x8'));var squel=require(_0x5914('0x9'));var crypto=require('crypto');var jsforce=require(_0x5914('0xa'));var deskjs=require(_0x5914('0xb'));var toCsv=require(_0x5914('0x6'));var querystring=require('querystring');var Papa=require(_0x5914('0xc'));var Redis=require(_0x5914('0xd'));var authService=require(_0x5914('0xe'));var qs=require(_0x5914('0xf'));var as=require(_0x5914('0x10'));var hardwareService=require(_0x5914('0x11'));var logger=require('../../config/logger')(_0x5914('0x12'));var utils=require(_0x5914('0x13'));var config=require(_0x5914('0x14'));var licenseUtil=require(_0x5914('0x15'));var db=require(_0x5914('0x16'))['db'];var extensions=require(_0x5914('0x17'));function respondWithStatusCode(_0x25499b,_0xdcfaca){_0xdcfaca=_0xdcfaca||0xcc;return function(_0x4ab5da){if(_0x4ab5da){return _0x25499b[_0x5914('0x18')](_0xdcfaca);}return _0x25499b['status'](_0xdcfaca)[_0x5914('0x19')]();};}function respondWithResult(_0x3d21c1,_0x407386){_0x407386=_0x407386||0xc8;return function(_0x3d93ec){if(_0x3d93ec){return _0x3d21c1[_0x5914('0x1a')](_0x407386)[_0x5914('0x1b')](_0x3d93ec);}};}function respondWithFilteredResult(_0x4a60df,_0x47c37a){return function(_0x256c2f){if(_0x256c2f){var _0x35d464=typeof _0x47c37a[_0x5914('0x1c')]==='undefined'&&typeof _0x47c37a[_0x5914('0x1d')]==='undefined';var _0x287a1f=_0x256c2f[_0x5914('0x1e')];var _0xa9aa51=_0x35d464?0x0:_0x47c37a[_0x5914('0x1c')];var _0x23d521=_0x35d464?_0x256c2f[_0x5914('0x1e')]:_0x47c37a[_0x5914('0x1c')]+_0x47c37a['limit'];var _0x4792d0;if(_0x23d521>=_0x287a1f){_0x23d521=_0x287a1f;_0x4792d0=0xc8;}else{_0x4792d0=0xce;}_0x4a60df[_0x5914('0x1a')](_0x4792d0);return _0x4a60df[_0x5914('0x1f')]('Content-Range',_0xa9aa51+'-'+_0x23d521+'/'+_0x287a1f)[_0x5914('0x1b')](_0x256c2f);}return null;};}function patchUpdates(_0x594951){return function(_0x17a24c){try{jsonpatch[_0x5914('0x20')](_0x17a24c,_0x594951,!![]);}catch(_0x1a48a7){return BPromise['reject'](_0x1a48a7);}return _0x17a24c['save']();};}function saveUpdates(_0x57d9e7,_0x16dc21){return function(_0x1da247){if(_0x1da247){return _0x1da247['update'](_0x57d9e7)['then'](function(_0x1a226e){return _0x1a226e;});}return null;};}function removeEntity(_0x5a3db1,_0x5d2b71){return function(_0x261193){if(_0x261193){return _0x261193[_0x5914('0x21')]()[_0x5914('0x22')](function(){var _0x2fcfed=_0x261193[_0x5914('0x23')]({'plain':!![]});var _0x5f2782=_0x5914('0x24');return db[_0x5914('0x25')][_0x5914('0x21')]({'where':{'type':_0x5f2782,'resourceId':_0x2fcfed['id']}})['then'](function(){return _0x261193;});})[_0x5914('0x22')](function(){_0x5a3db1[_0x5914('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x266bb6,_0x5ce015){return function(_0x186a89){if(!_0x186a89){_0x266bb6[_0x5914('0x18')](0x194);}return _0x186a89;};}function handleError(_0x354e15,_0x5438be){_0x5438be=_0x5438be||0x1f4;return function(_0x323bbc){logger[_0x5914('0x26')](_0x323bbc[_0x5914('0x27')]);if(_0x323bbc[_0x5914('0x28')]){delete _0x323bbc[_0x5914('0x28')];}_0x354e15[_0x5914('0x1a')](_0x5438be)[_0x5914('0x29')](_0x323bbc);};}exports[_0x5914('0x2a')]=function(_0x48928c,_0x19eae0){var _0x3b3530={},_0xcff3ac={},_0x1c98cc={'count':0x0,'rows':[]};var _0xb9c33=_[_0x5914('0x2b')](db[_0x5914('0x2c')][_0x5914('0x2d')],function(_0x4b55a8){return{'name':_0x4b55a8[_0x5914('0x2e')],'type':_0x4b55a8[_0x5914('0x2f')]['key']};});_0xcff3ac['model']=_[_0x5914('0x2b')](_0xb9c33,'name');_0xcff3ac[_0x5914('0x30')]=_[_0x5914('0x31')](_0x48928c[_0x5914('0x30')]);_0xcff3ac['filters']=_['intersection'](_0xcff3ac[_0x5914('0x32')],_0xcff3ac[_0x5914('0x30')]);_0x3b3530[_0x5914('0x33')]=_[_0x5914('0x34')](_0xcff3ac['model'],qs[_0x5914('0x35')](_0x48928c[_0x5914('0x30')][_0x5914('0x35')]));_0x3b3530[_0x5914('0x33')]=_0x3b3530[_0x5914('0x33')][_0x5914('0x36')]?_0x3b3530[_0x5914('0x33')]:_0xcff3ac[_0x5914('0x32')];if(!_0x48928c[_0x5914('0x30')][_0x5914('0x37')]('nolimit')){_0x3b3530['limit']=qs[_0x5914('0x1d')](_0x48928c[_0x5914('0x30')][_0x5914('0x1d')]);_0x3b3530[_0x5914('0x1c')]=qs[_0x5914('0x1c')](_0x48928c['query'][_0x5914('0x1c')]);}_0x3b3530['order']=qs[_0x5914('0x38')](_0x48928c['query']['sort']);_0x3b3530[_0x5914('0x39')]=qs[_0x5914('0x3a')](_['pick'](_0x48928c[_0x5914('0x30')],_0xcff3ac[_0x5914('0x3a')]),_0xb9c33);if(_0x48928c[_0x5914('0x30')]['filter']){_0x3b3530['where']=_[_0x5914('0x3b')](_0x3b3530[_0x5914('0x39')],{'$or':_[_0x5914('0x2b')](_0xb9c33,function(_0x42befd){if(_0x42befd['type']!==_0x5914('0x3c')){var _0x3dedfc={};_0x3dedfc[_0x42befd['name']]={'$like':'%'+_0x48928c[_0x5914('0x30')][_0x5914('0x3d')]+'%'};return _0x3dedfc;}})});}_0x3b3530=_[_0x5914('0x3b')]({},_0x3b3530,_0x48928c['options']);var _0x3ce814={'where':_0x3b3530[_0x5914('0x39')]};return db['Interval'][_0x5914('0x1e')](_0x3ce814)[_0x5914('0x22')](function(_0x3b2192){_0x1c98cc['count']=_0x3b2192;if(_0x48928c[_0x5914('0x30')][_0x5914('0x3e')]){_0x3b3530[_0x5914('0x3f')]=[{'all':!![]}];}return db[_0x5914('0x2c')][_0x5914('0x40')](_0x3b3530);})[_0x5914('0x22')](function(_0x261ad6){_0x1c98cc[_0x5914('0x41')]=_0x261ad6;return _0x1c98cc;})[_0x5914('0x22')](respondWithFilteredResult(_0x19eae0,_0x3b3530))[_0x5914('0x42')](handleError(_0x19eae0,null));};exports[_0x5914('0x43')]=function(_0x112c99,_0x5483e4){var _0x2342da={'raw':!![],'where':{'id':_0x112c99[_0x5914('0x44')]['id']}},_0x2f8e87={};_0x2f8e87[_0x5914('0x32')]=_['keys'](db['Interval']['rawAttributes']);_0x2f8e87[_0x5914('0x30')]=_[_0x5914('0x31')](_0x112c99[_0x5914('0x30')]);_0x2f8e87[_0x5914('0x3a')]=_[_0x5914('0x34')](_0x2f8e87[_0x5914('0x32')],_0x2f8e87[_0x5914('0x30')]);_0x2342da[_0x5914('0x33')]=_[_0x5914('0x34')](_0x2f8e87['model'],qs[_0x5914('0x35')](_0x112c99[_0x5914('0x30')][_0x5914('0x35')]));_0x2342da[_0x5914('0x33')]=_0x2342da[_0x5914('0x33')]['length']?_0x2342da[_0x5914('0x33')]:_0x2f8e87[_0x5914('0x32')];if(_0x112c99[_0x5914('0x30')][_0x5914('0x3e')]){_0x2342da[_0x5914('0x3f')]=[{'all':!![]}];}_0x2342da=_['merge']({},_0x2342da,_0x112c99[_0x5914('0x45')]);return db['Interval']['find'](_0x2342da)[_0x5914('0x22')](handleEntityNotFound(_0x5483e4,null))[_0x5914('0x22')](respondWithResult(_0x5483e4,null))[_0x5914('0x42')](handleError(_0x5483e4,null));};exports[_0x5914('0x46')]=function(_0x3d3b5e,_0x49c36f){return db[_0x5914('0x2c')][_0x5914('0x46')](_0x3d3b5e['body'],{})[_0x5914('0x22')](function(_0x15b213){var _0x5f0a94=_0x3d3b5e[_0x5914('0x47')][_0x5914('0x23')]({'plain':!![]});if(!_0x5f0a94)throw new Error(_0x5914('0x48'));if(_0x5f0a94[_0x5914('0x49')]===_0x5914('0x47')){var _0x52005d=_0x15b213[_0x5914('0x23')]({'plain':!![]});var _0xd9153c='Intervals';return db['UserProfileSection'][_0x5914('0x4a')]({'where':{'name':_0xd9153c,'userProfileId':_0x5f0a94[_0x5914('0x4b')]},'raw':!![]})[_0x5914('0x22')](function(_0x269dc7){if(_0x269dc7&&_0x269dc7['autoAssociation']===0x0){return db['UserProfileResource'][_0x5914('0x46')]({'name':_0x52005d[_0x5914('0x28')],'resourceId':_0x52005d['id'],'type':_0x269dc7[_0x5914('0x28')],'sectionId':_0x269dc7['id']},{})[_0x5914('0x22')](function(){return _0x15b213;});}else{return _0x15b213;}})[_0x5914('0x42')](function(_0x15b13b){logger[_0x5914('0x26')](_0x5914('0x4c'),_0x15b13b);throw _0x15b13b;});}return _0x15b213;})[_0x5914('0x22')](respondWithResult(_0x49c36f,0xc9))['catch'](handleError(_0x49c36f,null));};exports[_0x5914('0x4d')]=function(_0x7d6f25,_0x26f9c3){if(_0x7d6f25['body']['id']){delete _0x7d6f25[_0x5914('0x4e')]['id'];}return db[_0x5914('0x2c')][_0x5914('0x4a')]({'where':{'id':_0x7d6f25[_0x5914('0x44')]['id']}})[_0x5914('0x22')](handleEntityNotFound(_0x26f9c3,null))[_0x5914('0x22')](saveUpdates(_0x7d6f25[_0x5914('0x4e')],null))[_0x5914('0x22')](respondWithResult(_0x26f9c3,null))[_0x5914('0x42')](handleError(_0x26f9c3,null));};exports['destroy']=function(_0x34e6ef,_0xbde8ed){return db['Interval']['find']({'where':{'id':_0x34e6ef[_0x5914('0x44')]['id']}})[_0x5914('0x22')](handleEntityNotFound(_0xbde8ed,null))[_0x5914('0x22')](removeEntity(_0xbde8ed,null))['catch'](handleError(_0xbde8ed,null));};exports[_0x5914('0x4f')]=function(_0x163376,_0x504aca,_0x3629f5){if(_0x163376[_0x5914('0x4e')]['id']){delete _0x163376[_0x5914('0x4e')]['id'];}return db['Interval'][_0x5914('0x4a')]({'where':{'id':_0x163376['params']['id']}})[_0x5914('0x22')](handleEntityNotFound(_0x504aca,null))[_0x5914('0x22')](function(_0x1ef294){if(_0x1ef294){_0x163376['body'][_0x5914('0x50')]=_0x1ef294['id'];return db['Interval'][_0x5914('0x46')](_0x163376[_0x5914('0x4e')]);}})[_0x5914('0x22')](respondWithResult(_0x504aca,null))[_0x5914('0x42')](handleError(_0x504aca,null));};exports['getIntervals']=function(_0x5f31c3,_0x32b15c,_0x429ce1){var _0x288638={};var _0x4ba7a9={};var _0x4d6517;var _0x5c71e0;return db['Interval']['findOne']({'where':{'id':_0x5f31c3[_0x5914('0x44')]['id']}})[_0x5914('0x22')](handleEntityNotFound(_0x32b15c,null))[_0x5914('0x22')](function(_0xb9c494){if(_0xb9c494){_0x4d6517=_0xb9c494;_0x4ba7a9[_0x5914('0x32')]=_[_0x5914('0x31')](db[_0x5914('0x2c')][_0x5914('0x2d')]);_0x4ba7a9[_0x5914('0x30')]=_[_0x5914('0x31')](_0x5f31c3[_0x5914('0x30')]);_0x4ba7a9['filters']=_[_0x5914('0x34')](_0x4ba7a9[_0x5914('0x32')],_0x4ba7a9[_0x5914('0x30')]);_0x288638[_0x5914('0x33')]=_[_0x5914('0x34')](_0x4ba7a9[_0x5914('0x32')],qs['fields'](_0x5f31c3['query']['fields']));_0x288638[_0x5914('0x33')]=_0x288638[_0x5914('0x33')]['length']?_0x288638['attributes']:_0x4ba7a9['model'];_0x288638[_0x5914('0x51')]=qs[_0x5914('0x38')](_0x5f31c3[_0x5914('0x30')][_0x5914('0x38')]);_0x288638[_0x5914('0x39')]=qs[_0x5914('0x3a')](_[_0x5914('0x52')](_0x5f31c3[_0x5914('0x30')],_0x4ba7a9[_0x5914('0x3a')]));if(_0x5f31c3[_0x5914('0x30')][_0x5914('0x3d')]){_0x288638[_0x5914('0x39')]=_[_0x5914('0x3b')](_0x288638[_0x5914('0x39')],{'$or':_[_0x5914('0x2b')](_0x288638[_0x5914('0x33')],function(_0xde8768){var _0x11b02e={};_0x11b02e[_0xde8768]={'$like':'%'+_0x5f31c3[_0x5914('0x30')][_0x5914('0x3d')]+'%'};return _0x11b02e;})});}_0x288638=_[_0x5914('0x3b')]({},_0x288638,_0x5f31c3[_0x5914('0x45')]);return _0x4d6517[_0x5914('0x53')](_0x288638);}})[_0x5914('0x22')](function(_0x1e2b96){if(_0x1e2b96){_0x5c71e0=_0x1e2b96[_0x5914('0x36')];if(!_0x5f31c3[_0x5914('0x30')]['hasOwnProperty'](_0x5914('0x54'))){_0x288638['limit']=qs[_0x5914('0x1d')](_0x5f31c3['query'][_0x5914('0x1d')]);_0x288638[_0x5914('0x1c')]=qs[_0x5914('0x1c')](_0x5f31c3[_0x5914('0x30')][_0x5914('0x1c')]);}return _0x4d6517[_0x5914('0x53')](_0x288638);}})[_0x5914('0x22')](function(_0x1c8e4f){if(_0x1c8e4f){return _0x1c8e4f?{'count':_0x5c71e0,'rows':_0x1c8e4f}:null;}})[_0x5914('0x22')](respondWithResult(_0x32b15c,null))[_0x5914('0x42')](handleError(_0x32b15c,null));};exports['addIntervals']=function(_0x3e65eb,_0x2e54fd,_0x18900c){return db[_0x5914('0x2c')][_0x5914('0x55')]({'where':{'id':_0x3e65eb[_0x5914('0x44')]['id']}})[_0x5914('0x22')](handleEntityNotFound(_0x2e54fd,null))[_0x5914('0x22')](function(_0x34792f){if(_0x34792f){return db['sequelize'][_0x5914('0x56')](function(_0x59fe2f){return db[_0x5914('0x2c')][_0x5914('0x21')]({'where':{'IntervalId':_0x3e65eb[_0x5914('0x44')]['id']},'transaction':_0x59fe2f})['then'](function(_0x3e4aad){var _0x58e802=_[_0x5914('0x2b')](_0x3e65eb[_0x5914('0x4e')],function(_0x2ea38a){delete _0x2ea38a['id'];_0x2ea38a['IntervalId']=_0x3e65eb['params']['id'];return _0x2ea38a;});return db[_0x5914('0x2c')][_0x5914('0x57')](_0x58e802,{'transaction':_0x59fe2f});});})['then'](function(){return db['Interval'][_0x5914('0x40')]({'where':{'IntervalId':_0x3e65eb[_0x5914('0x44')]['id']}});});}})['then'](respondWithResult(_0x2e54fd,null))[_0x5914('0x42')](handleError(_0x2e54fd,null));}; \ No newline at end of file +var _0x3a08=['querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','json','undefined','limit','offset','status','set','Content-Range','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','map','type','key','keys','query','filters','intersection','attributes','fields','model','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','Interval','count','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','findOne','nolimit','addIntervals','sequelize','transaction','bulkCreate','eml-format','zip-dir','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x54b0ac,_0x2d5d51){var _0x436c50=function(_0x3e0f77){while(--_0x3e0f77){_0x54b0ac['push'](_0x54b0ac['shift']());}};_0x436c50(++_0x2d5d51);}(_0x3a08,0x150));var _0x83a0=function(_0x418539,_0x4d5f1d){_0x418539=_0x418539-0x0;var _0x4a8607=_0x3a08[_0x418539];return _0x4a8607;};'use strict';var emlformat=require(_0x83a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x83a0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x83a0('0x2'));var path=require(_0x83a0('0x3'));var sox=require(_0x83a0('0x4'));var csv=require(_0x83a0('0x5'));var ejs=require(_0x83a0('0x6'));var fs=require('fs');var fs_extra=require(_0x83a0('0x7'));var _=require(_0x83a0('0x8'));var squel=require('squel');var crypto=require(_0x83a0('0x9'));var jsforce=require(_0x83a0('0xa'));var deskjs=require(_0x83a0('0xb'));var toCsv=require('to-csv');var querystring=require(_0x83a0('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x83a0('0xd'));var as=require(_0x83a0('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x83a0('0xf'))(_0x83a0('0x10'));var utils=require(_0x83a0('0x11'));var config=require(_0x83a0('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x83a0('0x13'))['db'];var extensions=require(_0x83a0('0x14'));function respondWithStatusCode(_0x2d4614,_0x1425eb){_0x1425eb=_0x1425eb||0xcc;return function(_0x240a1f){if(_0x240a1f){return _0x2d4614[_0x83a0('0x15')](_0x1425eb);}return _0x2d4614['status'](_0x1425eb)[_0x83a0('0x16')]();};}function respondWithResult(_0x21e49f,_0x119f19){_0x119f19=_0x119f19||0xc8;return function(_0x977aa5){if(_0x977aa5){return _0x21e49f['status'](_0x119f19)[_0x83a0('0x17')](_0x977aa5);}};}function respondWithFilteredResult(_0x813f49,_0x3d8f0e){return function(_0x6386b1){if(_0x6386b1){var _0x477d73=typeof _0x3d8f0e['offset']===_0x83a0('0x18')&&typeof _0x3d8f0e[_0x83a0('0x19')]===_0x83a0('0x18');var _0x16cc1a=_0x6386b1['count'];var _0x1b3fbc=_0x477d73?0x0:_0x3d8f0e[_0x83a0('0x1a')];var _0x45b32a=_0x477d73?_0x6386b1['count']:_0x3d8f0e['offset']+_0x3d8f0e[_0x83a0('0x19')];var _0x5d2c20;if(_0x45b32a>=_0x16cc1a){_0x45b32a=_0x16cc1a;_0x5d2c20=0xc8;}else{_0x5d2c20=0xce;}_0x813f49[_0x83a0('0x1b')](_0x5d2c20);return _0x813f49[_0x83a0('0x1c')](_0x83a0('0x1d'),_0x1b3fbc+'-'+_0x45b32a+'/'+_0x16cc1a)[_0x83a0('0x17')](_0x6386b1);}return null;};}function patchUpdates(_0x321113){return function(_0x448aa8){try{jsonpatch['apply'](_0x448aa8,_0x321113,!![]);}catch(_0x186a19){return BPromise[_0x83a0('0x1e')](_0x186a19);}return _0x448aa8[_0x83a0('0x1f')]();};}function saveUpdates(_0x4fd209,_0x2f9699){return function(_0x29f630){if(_0x29f630){return _0x29f630[_0x83a0('0x20')](_0x4fd209)[_0x83a0('0x21')](function(_0x5070e0){return _0x5070e0;});}return null;};}function removeEntity(_0x59604d,_0x2f47b9){return function(_0x1651dd){if(_0x1651dd){return _0x1651dd[_0x83a0('0x22')]()[_0x83a0('0x21')](function(){var _0x3203d4=_0x1651dd[_0x83a0('0x23')]({'plain':!![]});var _0x2e8571=_0x83a0('0x24');return db[_0x83a0('0x25')][_0x83a0('0x22')]({'where':{'type':_0x2e8571,'resourceId':_0x3203d4['id']}})[_0x83a0('0x21')](function(){return _0x1651dd;});})[_0x83a0('0x21')](function(){_0x59604d[_0x83a0('0x1b')](0xcc)[_0x83a0('0x16')]();});}};}function handleEntityNotFound(_0x9254cc,_0x8acccd){return function(_0xfc0fb4){if(!_0xfc0fb4){_0x9254cc[_0x83a0('0x15')](0x194);}return _0xfc0fb4;};}function handleError(_0x4b5029,_0x5277d9){_0x5277d9=_0x5277d9||0x1f4;return function(_0x378689){logger[_0x83a0('0x26')](_0x378689[_0x83a0('0x27')]);if(_0x378689['name']){delete _0x378689[_0x83a0('0x28')];}_0x4b5029[_0x83a0('0x1b')](_0x5277d9)[_0x83a0('0x29')](_0x378689);};}exports[_0x83a0('0x2a')]=function(_0x3384da,_0x10fb8f){var _0x4cc0e8={},_0x2df564={},_0x234547={'count':0x0,'rows':[]};var _0x4b0750=_[_0x83a0('0x2b')](db['Interval']['rawAttributes'],function(_0x57b984){return{'name':_0x57b984['fieldName'],'type':_0x57b984[_0x83a0('0x2c')][_0x83a0('0x2d')]};});_0x2df564['model']=_[_0x83a0('0x2b')](_0x4b0750,_0x83a0('0x28'));_0x2df564['query']=_[_0x83a0('0x2e')](_0x3384da[_0x83a0('0x2f')]);_0x2df564[_0x83a0('0x30')]=_[_0x83a0('0x31')](_0x2df564['model'],_0x2df564['query']);_0x4cc0e8[_0x83a0('0x32')]=_[_0x83a0('0x31')](_0x2df564['model'],qs[_0x83a0('0x33')](_0x3384da['query'][_0x83a0('0x33')]));_0x4cc0e8[_0x83a0('0x32')]=_0x4cc0e8[_0x83a0('0x32')]['length']?_0x4cc0e8['attributes']:_0x2df564[_0x83a0('0x34')];if(!_0x3384da['query'][_0x83a0('0x35')]('nolimit')){_0x4cc0e8[_0x83a0('0x19')]=qs[_0x83a0('0x19')](_0x3384da[_0x83a0('0x2f')][_0x83a0('0x19')]);_0x4cc0e8[_0x83a0('0x1a')]=qs[_0x83a0('0x1a')](_0x3384da['query'][_0x83a0('0x1a')]);}_0x4cc0e8[_0x83a0('0x36')]=qs[_0x83a0('0x37')](_0x3384da[_0x83a0('0x2f')][_0x83a0('0x37')]);_0x4cc0e8['where']=qs['filters'](_[_0x83a0('0x38')](_0x3384da[_0x83a0('0x2f')],_0x2df564[_0x83a0('0x30')]),_0x4b0750);if(_0x3384da['query'][_0x83a0('0x39')]){_0x4cc0e8['where']=_['merge'](_0x4cc0e8[_0x83a0('0x3a')],{'$or':_['map'](_0x4b0750,function(_0x233c9a){if(_0x233c9a['type']!==_0x83a0('0x3b')){var _0x1dec77={};_0x1dec77[_0x233c9a[_0x83a0('0x28')]]={'$like':'%'+_0x3384da[_0x83a0('0x2f')][_0x83a0('0x39')]+'%'};return _0x1dec77;}})});}_0x4cc0e8=_[_0x83a0('0x3c')]({},_0x4cc0e8,_0x3384da[_0x83a0('0x3d')]);var _0x1d88ef={'where':_0x4cc0e8[_0x83a0('0x3a')]};return db[_0x83a0('0x3e')][_0x83a0('0x3f')](_0x1d88ef)[_0x83a0('0x21')](function(_0x62c1d5){_0x234547[_0x83a0('0x3f')]=_0x62c1d5;if(_0x3384da[_0x83a0('0x2f')][_0x83a0('0x40')]){_0x4cc0e8[_0x83a0('0x41')]=[{'all':!![]}];}return db[_0x83a0('0x3e')][_0x83a0('0x42')](_0x4cc0e8);})[_0x83a0('0x21')](function(_0x574cdb){_0x234547['rows']=_0x574cdb;return _0x234547;})['then'](respondWithFilteredResult(_0x10fb8f,_0x4cc0e8))[_0x83a0('0x43')](handleError(_0x10fb8f,null));};exports[_0x83a0('0x44')]=function(_0x2b7846,_0x90b4ef){var _0x3824e4={'raw':!![],'where':{'id':_0x2b7846[_0x83a0('0x45')]['id']}},_0x34b416={};_0x34b416[_0x83a0('0x34')]=_[_0x83a0('0x2e')](db['Interval'][_0x83a0('0x46')]);_0x34b416['query']=_[_0x83a0('0x2e')](_0x2b7846[_0x83a0('0x2f')]);_0x34b416[_0x83a0('0x30')]=_[_0x83a0('0x31')](_0x34b416['model'],_0x34b416[_0x83a0('0x2f')]);_0x3824e4[_0x83a0('0x32')]=_[_0x83a0('0x31')](_0x34b416[_0x83a0('0x34')],qs[_0x83a0('0x33')](_0x2b7846[_0x83a0('0x2f')][_0x83a0('0x33')]));_0x3824e4[_0x83a0('0x32')]=_0x3824e4[_0x83a0('0x32')][_0x83a0('0x47')]?_0x3824e4[_0x83a0('0x32')]:_0x34b416[_0x83a0('0x34')];if(_0x2b7846[_0x83a0('0x2f')][_0x83a0('0x40')]){_0x3824e4[_0x83a0('0x41')]=[{'all':!![]}];}_0x3824e4=_[_0x83a0('0x3c')]({},_0x3824e4,_0x2b7846[_0x83a0('0x3d')]);return db[_0x83a0('0x3e')][_0x83a0('0x48')](_0x3824e4)['then'](handleEntityNotFound(_0x90b4ef,null))[_0x83a0('0x21')](respondWithResult(_0x90b4ef,null))[_0x83a0('0x43')](handleError(_0x90b4ef,null));};exports[_0x83a0('0x49')]=function(_0x4453f8,_0x4e29d5){return db[_0x83a0('0x3e')][_0x83a0('0x49')](_0x4453f8[_0x83a0('0x4a')],{})['then'](function(_0x24b2f7){var _0x96df0f=_0x4453f8[_0x83a0('0x4b')]['get']({'plain':!![]});if(!_0x96df0f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x96df0f[_0x83a0('0x4c')]===_0x83a0('0x4b')){var _0x2bf71e=_0x24b2f7[_0x83a0('0x23')]({'plain':!![]});var _0x1ab01e=_0x83a0('0x24');return db[_0x83a0('0x4d')][_0x83a0('0x48')]({'where':{'name':_0x1ab01e,'userProfileId':_0x96df0f['userProfileId']},'raw':!![]})[_0x83a0('0x21')](function(_0xea66e){if(_0xea66e&&_0xea66e['autoAssociation']===0x0){return db[_0x83a0('0x25')][_0x83a0('0x49')]({'name':_0x2bf71e[_0x83a0('0x28')],'resourceId':_0x2bf71e['id'],'type':_0xea66e[_0x83a0('0x28')],'sectionId':_0xea66e['id']},{})[_0x83a0('0x21')](function(){return _0x24b2f7;});}else{return _0x24b2f7;}})[_0x83a0('0x43')](function(_0x3bb565){logger[_0x83a0('0x26')](_0x83a0('0x4e'),_0x3bb565);throw _0x3bb565;});}return _0x24b2f7;})[_0x83a0('0x21')](respondWithResult(_0x4e29d5,0xc9))[_0x83a0('0x43')](handleError(_0x4e29d5,null));};exports['update']=function(_0x231617,_0x3220cf){if(_0x231617[_0x83a0('0x4a')]['id']){delete _0x231617['body']['id'];}return db['Interval']['find']({'where':{'id':_0x231617[_0x83a0('0x45')]['id']}})['then'](handleEntityNotFound(_0x3220cf,null))['then'](saveUpdates(_0x231617[_0x83a0('0x4a')],null))['then'](respondWithResult(_0x3220cf,null))[_0x83a0('0x43')](handleError(_0x3220cf,null));};exports['destroy']=function(_0x5318d4,_0x4de8ea){return db[_0x83a0('0x3e')][_0x83a0('0x48')]({'where':{'id':_0x5318d4[_0x83a0('0x45')]['id']}})[_0x83a0('0x21')](handleEntityNotFound(_0x4de8ea,null))[_0x83a0('0x21')](removeEntity(_0x4de8ea,null))['catch'](handleError(_0x4de8ea,null));};exports[_0x83a0('0x4f')]=function(_0x4f4238,_0x256ffa,_0x4a6784){if(_0x4f4238[_0x83a0('0x4a')]['id']){delete _0x4f4238['body']['id'];}return db[_0x83a0('0x3e')]['find']({'where':{'id':_0x4f4238['params']['id']}})[_0x83a0('0x21')](handleEntityNotFound(_0x256ffa,null))['then'](function(_0x52ef41){if(_0x52ef41){_0x4f4238[_0x83a0('0x4a')][_0x83a0('0x50')]=_0x52ef41['id'];return db[_0x83a0('0x3e')]['create'](_0x4f4238[_0x83a0('0x4a')]);}})[_0x83a0('0x21')](respondWithResult(_0x256ffa,null))['catch'](handleError(_0x256ffa,null));};exports['getIntervals']=function(_0x1c5f61,_0x101d2f,_0xe7438f){var _0x13f3e1={};var _0x147a1e={};var _0x3b1c84;var _0x392205;return db[_0x83a0('0x3e')][_0x83a0('0x51')]({'where':{'id':_0x1c5f61['params']['id']}})['then'](handleEntityNotFound(_0x101d2f,null))[_0x83a0('0x21')](function(_0x30d79f){if(_0x30d79f){_0x3b1c84=_0x30d79f;_0x147a1e[_0x83a0('0x34')]=_[_0x83a0('0x2e')](db[_0x83a0('0x3e')][_0x83a0('0x46')]);_0x147a1e['query']=_[_0x83a0('0x2e')](_0x1c5f61[_0x83a0('0x2f')]);_0x147a1e[_0x83a0('0x30')]=_[_0x83a0('0x31')](_0x147a1e['model'],_0x147a1e[_0x83a0('0x2f')]);_0x13f3e1[_0x83a0('0x32')]=_[_0x83a0('0x31')](_0x147a1e[_0x83a0('0x34')],qs[_0x83a0('0x33')](_0x1c5f61[_0x83a0('0x2f')][_0x83a0('0x33')]));_0x13f3e1[_0x83a0('0x32')]=_0x13f3e1['attributes']['length']?_0x13f3e1[_0x83a0('0x32')]:_0x147a1e[_0x83a0('0x34')];_0x13f3e1[_0x83a0('0x36')]=qs['sort'](_0x1c5f61[_0x83a0('0x2f')][_0x83a0('0x37')]);_0x13f3e1[_0x83a0('0x3a')]=qs[_0x83a0('0x30')](_[_0x83a0('0x38')](_0x1c5f61[_0x83a0('0x2f')],_0x147a1e[_0x83a0('0x30')]));if(_0x1c5f61['query'][_0x83a0('0x39')]){_0x13f3e1[_0x83a0('0x3a')]=_['merge'](_0x13f3e1[_0x83a0('0x3a')],{'$or':_[_0x83a0('0x2b')](_0x13f3e1['attributes'],function(_0x37415d){var _0x2dc676={};_0x2dc676[_0x37415d]={'$like':'%'+_0x1c5f61[_0x83a0('0x2f')][_0x83a0('0x39')]+'%'};return _0x2dc676;})});}_0x13f3e1=_['merge']({},_0x13f3e1,_0x1c5f61[_0x83a0('0x3d')]);return _0x3b1c84['getIntervals'](_0x13f3e1);}})[_0x83a0('0x21')](function(_0x1dd8ee){if(_0x1dd8ee){_0x392205=_0x1dd8ee['length'];if(!_0x1c5f61[_0x83a0('0x2f')][_0x83a0('0x35')](_0x83a0('0x52'))){_0x13f3e1['limit']=qs[_0x83a0('0x19')](_0x1c5f61[_0x83a0('0x2f')][_0x83a0('0x19')]);_0x13f3e1[_0x83a0('0x1a')]=qs[_0x83a0('0x1a')](_0x1c5f61[_0x83a0('0x2f')]['offset']);}return _0x3b1c84['getIntervals'](_0x13f3e1);}})['then'](function(_0x3cc512){if(_0x3cc512){return _0x3cc512?{'count':_0x392205,'rows':_0x3cc512}:null;}})[_0x83a0('0x21')](respondWithResult(_0x101d2f,null))['catch'](handleError(_0x101d2f,null));};exports[_0x83a0('0x53')]=function(_0x4d3b2,_0x34da69,_0x1a03f9){return db[_0x83a0('0x3e')][_0x83a0('0x51')]({'where':{'id':_0x4d3b2[_0x83a0('0x45')]['id']}})[_0x83a0('0x21')](handleEntityNotFound(_0x34da69,null))[_0x83a0('0x21')](function(_0xa631d7){if(_0xa631d7){return db[_0x83a0('0x54')][_0x83a0('0x55')](function(_0x211327){return db[_0x83a0('0x3e')]['destroy']({'where':{'IntervalId':_0x4d3b2[_0x83a0('0x45')]['id']},'transaction':_0x211327})[_0x83a0('0x21')](function(_0x1c9ed8){var _0x54f7a3=_[_0x83a0('0x2b')](_0x4d3b2['body'],function(_0x1abae3){delete _0x1abae3['id'];_0x1abae3[_0x83a0('0x50')]=_0x4d3b2[_0x83a0('0x45')]['id'];return _0x1abae3;});return db[_0x83a0('0x3e')][_0x83a0('0x56')](_0x54f7a3,{'transaction':_0x211327});});})['then'](function(){return db[_0x83a0('0x3e')][_0x83a0('0x42')]({'where':{'IntervalId':_0x4d3b2[_0x83a0('0x45')]['id']}});});}})[_0x83a0('0x21')](respondWithResult(_0x34da69,null))[_0x83a0('0x43')](handleError(_0x34da69,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 0824c87..a4aca9c 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 _0xe6fe=['../../utils/iftime','exports','Interval','tools_intervals','rewrite','interval','getIntervals','all','map','ifTime','then','reduce','./interval.attributes'];(function(_0x4cafa7,_0x5a979b){var _0x216344=function(_0x5e6667){while(--_0x5e6667){_0x4cafa7['push'](_0x4cafa7['shift']());}};_0x216344(++_0x5a979b);}(_0xe6fe,0xe9));var _0xee6f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe6fe[_0x14add3];return _0x4a174f;};'use strict';var attributes=require(_0xee6f('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0xee6f('0x1'))['iftime'];module[_0xee6f('0x2')]=function(_0x47f23b){return _0x47f23b['define'](_0xee6f('0x3'),attributes,{'tableName':_0xee6f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x586f62){extensions[_0xee6f('0x5')](_0x47f23b,_0x586f62);},'afterBulkCreate':function(_0x381de0,_0x2505cc,_0x1476eb){_0x1476eb();extensions[_0xee6f('0x5')](_0x47f23b,_0x381de0[0x0]);},'afterUpdate':function(_0x42b122){extensions[_0xee6f('0x5')](_0x47f23b,_0x42b122);},'afterDestroy':function(_0x2c422b){extensions[_0xee6f('0x5')](_0x47f23b,_0x2c422b);}},'instanceMethods':{'ifTime':function(_0x287818=undefined,_0x3b3a6f=new Date()){if(typeof this[_0xee6f('0x6')]==='string'){return iftime(this[_0xee6f('0x6')],_0x287818,_0x3b3a6f);}else{return this[_0xee6f('0x7')]()['then'](function(_0x1ef08f){return Promise[_0xee6f('0x8')](_0x1ef08f[_0xee6f('0x9')](function(_0x51d5b5){return _0x51d5b5[_0xee6f('0xa')](_0x287818,_0x3b3a6f);}));})[_0xee6f('0xb')](function(_0x5829bc){return _0x5829bc[_0xee6f('0xc')](function(_0x42561a,_0x4b6aa0){return _0x42561a||_0x4b6aa0;},![]);});}}}});}; \ No newline at end of file +var _0x24a4=['all','ifTime','reduce','./interval.attributes','iftime','exports','define','Interval','tools_intervals','rewrite','string','getIntervals','then'];(function(_0x49fa04,_0x380fe4){var _0x32a3dc=function(_0x40cfaf){while(--_0x40cfaf){_0x49fa04['push'](_0x49fa04['shift']());}};_0x32a3dc(++_0x380fe4);}(_0x24a4,0x196));var _0x424a=function(_0x2fb875,_0x5d8f06){_0x2fb875=_0x2fb875-0x0;var _0x29726c=_0x24a4[_0x2fb875];return _0x29726c;};'use strict';var attributes=require(_0x424a('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require('../../utils/iftime')[_0x424a('0x1')];module[_0x424a('0x2')]=function(_0x2d803e){return _0x2d803e[_0x424a('0x3')](_0x424a('0x4'),attributes,{'tableName':_0x424a('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2747ae){extensions[_0x424a('0x6')](_0x2d803e,_0x2747ae);},'afterBulkCreate':function(_0x297456,_0x463c40,_0x851189){_0x851189();extensions[_0x424a('0x6')](_0x2d803e,_0x297456[0x0]);},'afterUpdate':function(_0x406993){extensions['rewrite'](_0x2d803e,_0x406993);},'afterDestroy':function(_0x524964){extensions[_0x424a('0x6')](_0x2d803e,_0x524964);}},'instanceMethods':{'ifTime':function(_0x279114=undefined,_0x12d2a2=new Date()){if(typeof this['interval']===_0x424a('0x7')){return iftime(this['interval'],_0x279114,_0x12d2a2);}else{return this[_0x424a('0x8')]()[_0x424a('0x9')](function(_0x4b245d){return Promise[_0x424a('0xa')](_0x4b245d['map'](function(_0x2d2bcd){return _0x2d2bcd[_0x424a('0xb')](_0x279114,_0x12d2a2);}));})[_0x424a('0x9')](function(_0x1ef88d){return _0x1ef88d[_0x424a('0xc')](function(_0xd90044,_0x3152da){return _0xd90044||_0x3152da;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 47851e2..9ef256e 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 _0x4dbf=['IntervalIftime:\x20timezone\x20=\x20%s','Iftime','lodash','util','rpc','findAll','options','raw','where','limit','include','map','model','attributes','then','info','GetInterval','catch','message','error','find','ShowInterval','debug','stringify','Interval','all','reduce','format','name','join','findById','ifTime','IntervalIftime','isArray','intervals','string','timezone','length'];(function(_0xaed1fc,_0x4c74c2){var _0x1d5200=function(_0x875a59){while(--_0x875a59){_0xaed1fc['push'](_0xaed1fc['shift']());}};_0x1d5200(++_0x4c74c2);}(_0x4dbf,0x1ca));var _0xf4db=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x4dbf[_0x5d6e30];return _0x3d3f3b;};'use strict';var _=require(_0xf4db('0x0'));var util=require(_0xf4db('0x1'));var db=require('../../mysqldb')['db'];var iftime=require('../../utils/iftime')['iftime'];var logger=require('../../config/logger')(_0xf4db('0x2'));exports['GetInterval']=function(_0x42fc5e){var _0x1b75f4=this;return new Promise(function(_0x2bcb75,_0x1761d0){return db['Interval'][_0xf4db('0x3')]({'raw':_0x42fc5e[_0xf4db('0x4')]?_0x42fc5e[_0xf4db('0x4')][_0xf4db('0x5')]===undefined?!![]:![]:!![],'where':_0x42fc5e['options']?_0x42fc5e[_0xf4db('0x4')][_0xf4db('0x6')]||null:null,'attributes':_0x42fc5e[_0xf4db('0x4')]?_0x42fc5e[_0xf4db('0x4')]['attributes']||null:null,'limit':_0x42fc5e['options']?_0x42fc5e[_0xf4db('0x4')][_0xf4db('0x7')]||null:null,'include':_0x42fc5e['options']?_0x42fc5e[_0xf4db('0x4')][_0xf4db('0x8')]?_[_0xf4db('0x9')](_0x42fc5e[_0xf4db('0x4')]['include'],function(_0x1cc19b){return{'model':db[_0x1cc19b[_0xf4db('0xa')]],'as':_0x1cc19b['as'],'attributes':_0x1cc19b[_0xf4db('0xb')],'include':_0x1cc19b[_0xf4db('0x8')]?_['map'](_0x1cc19b['include'],function(_0x5eff94){return{'model':db[_0x5eff94[_0xf4db('0xa')]],'as':_0x5eff94['as'],'attributes':_0x5eff94[_0xf4db('0xb')],'include':_0x5eff94['include']?_[_0xf4db('0x9')](_0x5eff94[_0xf4db('0x8')],function(_0x29986a){return{'model':db[_0x29986a[_0xf4db('0xa')]],'as':_0x29986a['as'],'attributes':_0x29986a[_0xf4db('0xb')]};}):[]};}):[]};}):[]:[]})[_0xf4db('0xc')](function(_0x28c719){logger[_0xf4db('0xd')](_0xf4db('0xe'),_0x42fc5e);logger['debug'](_0xf4db('0xe'),_0x42fc5e,JSON['stringify'](_0x28c719));_0x2bcb75(_0x28c719);})[_0xf4db('0xf')](function(_0x3ac028){logger['error'](_0xf4db('0xe'),_0x3ac028[_0xf4db('0x10')],_0x42fc5e);_0x1761d0(_0x1b75f4[_0xf4db('0x11')](0x1f4,_0x3ac028[_0xf4db('0x10')]));});});};exports['ShowInterval']=function(_0x25965a){var _0x4054b9=this;return new Promise(function(_0x2e2a97,_0xb06103){return db['Interval'][_0xf4db('0x12')]({'raw':_0x25965a[_0xf4db('0x4')]?_0x25965a[_0xf4db('0x4')]['raw']===undefined?!![]:![]:!![],'where':_0x25965a['options']?_0x25965a[_0xf4db('0x4')][_0xf4db('0x6')]||null:null,'attributes':_0x25965a[_0xf4db('0x4')]?_0x25965a['options'][_0xf4db('0xb')]||null:null,'include':_0x25965a[_0xf4db('0x4')]?_0x25965a['options'][_0xf4db('0x8')]?_[_0xf4db('0x9')](_0x25965a[_0xf4db('0x4')][_0xf4db('0x8')],function(_0x216f90){return{'model':db[_0x216f90[_0xf4db('0xa')]],'as':_0x216f90['as'],'attributes':_0x216f90[_0xf4db('0xb')],'include':_0x216f90[_0xf4db('0x8')]?_[_0xf4db('0x9')](_0x216f90[_0xf4db('0x8')],function(_0x5ac453){return{'model':db[_0x5ac453[_0xf4db('0xa')]],'as':_0x5ac453['as'],'attributes':_0x5ac453[_0xf4db('0xb')],'include':_0x5ac453[_0xf4db('0x8')]?_[_0xf4db('0x9')](_0x5ac453[_0xf4db('0x8')],function(_0x2105c8){return{'model':db[_0x2105c8['model']],'as':_0x2105c8['as'],'attributes':_0x2105c8[_0xf4db('0xb')]};}):[]};}):[]};}):[]:[]})[_0xf4db('0xc')](function(_0x4e5671){logger['info'](_0xf4db('0x13'),_0x25965a);logger[_0xf4db('0x14')](_0xf4db('0x13'),_0x25965a,JSON[_0xf4db('0x15')](_0x4e5671));_0x2e2a97(_0x4e5671);})['catch'](function(_0x1b7f15){logger['error'](_0xf4db('0x13'),_0x1b7f15[_0xf4db('0x10')],_0x25965a);_0xb06103(_0x4054b9[_0xf4db('0x11')](0x1f4,_0x1b7f15[_0xf4db('0x10')]));});});};function checkArrayOfIntervals(_0x4b7d7b,_0x3e8b27){var _0x5794bb=[];return db[_0xf4db('0x16')][_0xf4db('0x3')]({'where':{'id':_0x4b7d7b}})[_0xf4db('0xc')](function(_0x17bd88){_0x5794bb=_0x17bd88;return Promise[_0xf4db('0x17')](_0x5794bb[_0xf4db('0x9')](function(_0x528a28){return _0x528a28['ifTime'](_0x3e8b27);}));})['then'](function(_0x45a6fe){var _0x106b7f=_0x45a6fe[_0xf4db('0x18')](function(_0x2be1c6,_0x1872f6){return _0x2be1c6||_0x1872f6;},![]);logger[_0xf4db('0xd')](util[_0xf4db('0x19')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x5794bb[_0xf4db('0x9')](function(_0x35df91){return _0x35df91[_0xf4db('0x1a')];})[_0xf4db('0x1b')](',\x20'),_0x5794bb[_0xf4db('0x9')](function(_0x253080){return _0x253080['id'];})[_0xf4db('0x1b')](',\x20')));return _0x106b7f;});}function checkSingleInterval(_0x4f8b84,_0x1a2f7f){return db[_0xf4db('0x16')][_0xf4db('0x1c')](_0x4f8b84)[_0xf4db('0xc')](function(_0x36ba58){if(_0x36ba58){logger['info'](util['format']('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x36ba58['name'],_0x36ba58['id']));return _0x36ba58[_0xf4db('0x1d')](_0x1a2f7f);}});}exports[_0xf4db('0x1e')]=function(_0x325cc2){var _0xad5282=_0x325cc2['intervalIds'];var _0x3a334b=Array[_0xf4db('0x1f')](_0x325cc2['intervals'])?_0x325cc2[_0xf4db('0x20')]:typeof _0x325cc2[_0xf4db('0x20')]===_0xf4db('0x21')?[_0x325cc2[_0xf4db('0x20')]]:[];var _0xa50e70=_0x325cc2[_0xf4db('0x22')]||undefined;var _0x2b154e=![];if(_0x3a334b[_0xf4db('0x23')]){logger['info'](util[_0xf4db('0x19')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x3a334b['join'](';\x20')));}if(_0xa50e70){logger[_0xf4db('0xd')](util[_0xf4db('0x19')](_0xf4db('0x24'),_0xa50e70));}logger[_0xf4db('0x14')](_0xf4db('0x25'),_0x2b154e);logger['silly'](_0xf4db('0x1e'),_0x325cc2);return Promise['resolve']()[_0xf4db('0xc')](function(){if(Array[_0xf4db('0x1f')](_0xad5282)){return checkArrayOfIntervals(_0xad5282,_0xa50e70);}else if(_0xad5282){return checkSingleInterval(_0xad5282,_0xa50e70);}})[_0xf4db('0xc')](function(_0x2064e0){var _0x27b9ff=_0x3a334b['reduce'](function(_0x2f2885,_0x4aac45){return _0x2f2885||iftime(_0x4aac45,_0xa50e70);},![]);_0x2b154e=_0x2064e0||_0x27b9ff;return _0x2b154e;})[_0xf4db('0xf')](function(_0x46e856){logger[_0xf4db('0x11')](_0xf4db('0x1e'),_0x325cc2,_0x46e856);throw this[_0xf4db('0x11')](0x1f4,_0x46e856[_0xf4db('0x10')]);});}; \ No newline at end of file +var _0xdd8e=['silly','IntervalIftime','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','findAll','options','where','attributes','map','include','model','then','info','debug','stringify','catch','message','error','Interval','find','raw','ShowInterval','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20timezone\x20=\x20%s'];(function(_0x4c2f17,_0x5c6821){var _0x20919e=function(_0x31eef7){while(--_0x31eef7){_0x4c2f17['push'](_0x4c2f17['shift']());}};_0x20919e(++_0x5c6821);}(_0xdd8e,0x12f));var _0xedd8=function(_0x793963,_0x2e73bb){_0x793963=_0x793963-0x0;var _0x394063=_0xdd8e[_0x793963];return _0x394063;};'use strict';var _=require('lodash');var util=require(_0xedd8('0x0'));var db=require(_0xedd8('0x1'))['db'];var iftime=require(_0xedd8('0x2'))[_0xedd8('0x3')];var logger=require(_0xedd8('0x4'))(_0xedd8('0x5'));exports[_0xedd8('0x6')]=function(_0x892fc3){var _0x36d7f3=this;return new Promise(function(_0x41a8a6,_0x555be1){return db['Interval'][_0xedd8('0x7')]({'raw':_0x892fc3['options']?_0x892fc3[_0xedd8('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x892fc3[_0xedd8('0x8')]?_0x892fc3[_0xedd8('0x8')][_0xedd8('0x9')]||null:null,'attributes':_0x892fc3[_0xedd8('0x8')]?_0x892fc3[_0xedd8('0x8')][_0xedd8('0xa')]||null:null,'limit':_0x892fc3[_0xedd8('0x8')]?_0x892fc3[_0xedd8('0x8')]['limit']||null:null,'include':_0x892fc3['options']?_0x892fc3[_0xedd8('0x8')]['include']?_[_0xedd8('0xb')](_0x892fc3[_0xedd8('0x8')][_0xedd8('0xc')],function(_0xbb0e2d){return{'model':db[_0xbb0e2d[_0xedd8('0xd')]],'as':_0xbb0e2d['as'],'attributes':_0xbb0e2d[_0xedd8('0xa')],'include':_0xbb0e2d[_0xedd8('0xc')]?_['map'](_0xbb0e2d[_0xedd8('0xc')],function(_0x5f4a51){return{'model':db[_0x5f4a51[_0xedd8('0xd')]],'as':_0x5f4a51['as'],'attributes':_0x5f4a51[_0xedd8('0xa')],'include':_0x5f4a51['include']?_['map'](_0x5f4a51[_0xedd8('0xc')],function(_0x5993d9){return{'model':db[_0x5993d9[_0xedd8('0xd')]],'as':_0x5993d9['as'],'attributes':_0x5993d9['attributes']};}):[]};}):[]};}):[]:[]})[_0xedd8('0xe')](function(_0x1701b7){logger[_0xedd8('0xf')]('GetInterval',_0x892fc3);logger[_0xedd8('0x10')](_0xedd8('0x6'),_0x892fc3,JSON[_0xedd8('0x11')](_0x1701b7));_0x41a8a6(_0x1701b7);})[_0xedd8('0x12')](function(_0x3dcd15){logger['error'](_0xedd8('0x6'),_0x3dcd15[_0xedd8('0x13')],_0x892fc3);_0x555be1(_0x36d7f3[_0xedd8('0x14')](0x1f4,_0x3dcd15[_0xedd8('0x13')]));});});};exports['ShowInterval']=function(_0x42290c){var _0x582e8e=this;return new Promise(function(_0x4e932e,_0xbf2b5d){return db[_0xedd8('0x15')][_0xedd8('0x16')]({'raw':_0x42290c['options']?_0x42290c['options'][_0xedd8('0x17')]===undefined?!![]:![]:!![],'where':_0x42290c[_0xedd8('0x8')]?_0x42290c[_0xedd8('0x8')][_0xedd8('0x9')]||null:null,'attributes':_0x42290c[_0xedd8('0x8')]?_0x42290c[_0xedd8('0x8')][_0xedd8('0xa')]||null:null,'include':_0x42290c['options']?_0x42290c[_0xedd8('0x8')][_0xedd8('0xc')]?_[_0xedd8('0xb')](_0x42290c['options'][_0xedd8('0xc')],function(_0x4dbf87){return{'model':db[_0x4dbf87[_0xedd8('0xd')]],'as':_0x4dbf87['as'],'attributes':_0x4dbf87['attributes'],'include':_0x4dbf87[_0xedd8('0xc')]?_[_0xedd8('0xb')](_0x4dbf87[_0xedd8('0xc')],function(_0x404428){return{'model':db[_0x404428['model']],'as':_0x404428['as'],'attributes':_0x404428[_0xedd8('0xa')],'include':_0x404428[_0xedd8('0xc')]?_[_0xedd8('0xb')](_0x404428[_0xedd8('0xc')],function(_0x55024b){return{'model':db[_0x55024b[_0xedd8('0xd')]],'as':_0x55024b['as'],'attributes':_0x55024b[_0xedd8('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbabcb7){logger[_0xedd8('0xf')](_0xedd8('0x18'),_0x42290c);logger['debug'](_0xedd8('0x18'),_0x42290c,JSON[_0xedd8('0x11')](_0xbabcb7));_0x4e932e(_0xbabcb7);})['catch'](function(_0x51bd63){logger[_0xedd8('0x14')](_0xedd8('0x18'),_0x51bd63['message'],_0x42290c);_0xbf2b5d(_0x582e8e[_0xedd8('0x14')](0x1f4,_0x51bd63[_0xedd8('0x13')]));});});};function checkArrayOfIntervals(_0xb1bf3c,_0x3fbbea){var _0x20d284=[];return db[_0xedd8('0x15')]['findAll']({'where':{'id':_0xb1bf3c}})[_0xedd8('0xe')](function(_0xbf57c0){_0x20d284=_0xbf57c0;return Promise[_0xedd8('0x19')](_0x20d284[_0xedd8('0xb')](function(_0x4b3205){return _0x4b3205[_0xedd8('0x1a')](_0x3fbbea);}));})[_0xedd8('0xe')](function(_0x14d518){var _0x806dfb=_0x14d518[_0xedd8('0x1b')](function(_0x4dd462,_0x3cde10){return _0x4dd462||_0x3cde10;},![]);logger[_0xedd8('0xf')](util[_0xedd8('0x1c')](_0xedd8('0x1d'),_0x20d284[_0xedd8('0xb')](function(_0x3f8512){return _0x3f8512['name'];})['join'](',\x20'),_0x20d284['map'](function(_0x3c196e){return _0x3c196e['id'];})[_0xedd8('0x1e')](',\x20')));return _0x806dfb;});}function checkSingleInterval(_0x562d31,_0x89e113){return db['Interval'][_0xedd8('0x1f')](_0x562d31)[_0xedd8('0xe')](function(_0x1d6864){if(_0x1d6864){logger[_0xedd8('0xf')](util[_0xedd8('0x1c')](_0xedd8('0x20'),_0x1d6864[_0xedd8('0x21')],_0x1d6864['id']));return _0x1d6864[_0xedd8('0x1a')](_0x89e113);}});}exports['IntervalIftime']=function(_0x21b148){var _0x3fb408=_0x21b148[_0xedd8('0x22')];var _0x2924a4=Array[_0xedd8('0x23')](_0x21b148['intervals'])?_0x21b148['intervals']:typeof _0x21b148[_0xedd8('0x24')]===_0xedd8('0x25')?[_0x21b148[_0xedd8('0x24')]]:[];var _0x2267ac=_0x21b148[_0xedd8('0x26')]||undefined;var _0x36ebf2=![];if(_0x2924a4[_0xedd8('0x27')]){logger['info'](util['format']('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x2924a4['join'](';\x20')));}if(_0x2267ac){logger[_0xedd8('0xf')](util['format'](_0xedd8('0x28'),_0x2267ac));}logger[_0xedd8('0x10')]('Iftime',_0x36ebf2);logger[_0xedd8('0x29')](_0xedd8('0x2a'),_0x21b148);return Promise['resolve']()[_0xedd8('0xe')](function(){if(Array[_0xedd8('0x23')](_0x3fb408)){return checkArrayOfIntervals(_0x3fb408,_0x2267ac);}else if(_0x3fb408){return checkSingleInterval(_0x3fb408,_0x2267ac);}})['then'](function(_0x1c1555){var _0x49a414=_0x2924a4[_0xedd8('0x1b')](function(_0x574a75,_0x2aca9d){return _0x574a75||iftime(_0x2aca9d,_0x2267ac);},![]);_0x36ebf2=_0x1c1555||_0x49a414;return _0x36ebf2;})[_0xedd8('0x12')](function(_0x232a7d){logger[_0xedd8('0x14')](_0xedd8('0x2a'),_0x21b148,_0x232a7d);throw this[_0xedd8('0x14')](0x1f4,_0x232a7d[_0xedd8('0x13')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index a2af03f..5378510 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 _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x43dfff,_0x4e34b7){var _0x4d6c50=function(_0x2a2709){while(--_0x2a2709){_0x43dfff['push'](_0x43dfff['shift']());}};_0x4d6c50(++_0x4e34b7);}(_0xdb28,0x106));var _0x8db2=function(_0x1f9bf1,_0x1db9a8){_0x1f9bf1=_0x1f9bf1-0x0;var _0x323970=_0xdb28[_0x1f9bf1];return _0x323970;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x598e0e,_0x3607d3){var _0x11318c=function(_0x9bf61b){while(--_0x9bf61b){_0x598e0e['push'](_0x598e0e['shift']());}};_0x11318c(++_0x3607d3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x54942b,_0x21e4a3){_0x54942b=_0x54942b-0x0;var _0xa3f376=_0x5f2f[_0x54942b];return _0xa3f376;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index cb5ae4d..b474471 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 _0xc59d=['write','openIssue','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','3eAmWpBVP0','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','email','customfield_11501','oldToken','fields','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira'];(function(_0x482046,_0xdfe37f){var _0x423e95=function(_0x587ba2){while(--_0x587ba2){_0x482046['push'](_0x482046['shift']());}};_0x423e95(++_0xdfe37f);}(_0xc59d,0x181));var _0xdc59=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc59d[_0x19e35c];return _0x3e1fe8;};'use strict';var BPromise=require(_0xdc59('0x0'));var https=require(_0xdc59('0x1'));var logger=require(_0xdc59('0x2'))('api');var USERNAME='support';var PASSWORD=_0xdc59('0x3');function openIssue(_0x562a91,_0x884947){var _0x1f7aea={'fields':{'project':{'key':_0x562a91['key']||'MOTGUI'},'summary':(_0x562a91[_0xdc59('0x4')]||_0xdc59('0x5'))+_0xdc59('0x6')+_0x562a91['ip'],'description':_0x562a91[_0xdc59('0x7')]||JSON[_0xdc59('0x8')](_0x562a91),'issuetype':{'name':_0x562a91[_0xdc59('0x9')]||_0xdc59('0xa')}}};_0x1f7aea['fields']['customfield_11500']=_0x562a91[_0xdc59('0xb')];_0x1f7aea['fields'][_0xdc59('0xc')]=_0x562a91[_0xdc59('0xd')];_0x1f7aea[_0xdc59('0xe')][_0xdc59('0xf')]=_0x562a91[_0xdc59('0x10')];_0x1f7aea[_0xdc59('0xe')][_0xdc59('0x11')]=_0x562a91[_0xdc59('0x12')];_0x1f7aea[_0xdc59('0xe')][_0xdc59('0x13')]=_0x562a91[_0xdc59('0x14')];_0x1f7aea[_0xdc59('0xe')]['customfield_10102']=_0x562a91['ip'];var _0x5d16fb={'host':_0xdc59('0x15'),'port':0x1bb,'path':_0xdc59('0x16'),'method':_0xdc59('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0xdc59('0x18'),'Authorization':_0xdc59('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xdc59('0x1a')]('base64')}};var _0x4c972e=JSON['stringify'](_0x1f7aea);var _0x5055a3=https['request'](_0x5d16fb,function(_0x3af242){_0x3af242[_0xdc59('0x1b')](_0xdc59('0x1c'));var _0x4fdd36='';_0x3af242['on'](_0xdc59('0x1d'),function(_0x533a03){_0x4fdd36+=_0x533a03;});_0x3af242['on'](_0xdc59('0x1e'),function(){if(_0x884947){return _0x884947[_0xdc59('0x1f')](_0x3af242[_0xdc59('0x20')])[_0xdc59('0x21')](JSON[_0xdc59('0x22')](_0x4fdd36));}});});_0x5055a3['on'](_0xdc59('0x23'),function(_0x5e8489){if(_0x884947){return _0x884947['status'](0x1f4)['json']({'errors':[{'message':_0xdc59('0x24'),'type':_0xdc59('0x25')}]});}});_0x5055a3[_0xdc59('0x26')](_0x4c972e);_0x5055a3[_0xdc59('0x1e')]();}exports[_0xdc59('0x27')]=openIssue;exports[_0xdc59('0x28')]=function(_0x6cac49,_0x299a97){_0x6cac49['body']['ip']=_0x6cac49[_0xdc59('0x29')][_0xdc59('0x2a')]||_0x6cac49[_0xdc59('0x2b')][_0xdc59('0x2c')]||_0x6cac49[_0xdc59('0x2d')]['remoteAddress']||_0x6cac49[_0xdc59('0x2b')][_0xdc59('0x2d')][_0xdc59('0x2c')];return openIssue(_0x6cac49[_0xdc59('0x2e')],_0x299a97);}; \ No newline at end of file +var _0x601f=['statusCode','parse','error','status','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','x-forwarded-for','socket','remoteAddress','connection','bluebird','https','../../config/logger','support','MOTGUI','Report','description','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','reason','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','request','setEncoding','data','end'];(function(_0x1929e3,_0x1a49c0){var _0x20914c=function(_0x272a15){while(--_0x272a15){_0x1929e3['push'](_0x1929e3['shift']());}};_0x20914c(++_0x1a49c0);}(_0x601f,0xe6));var _0xf601=function(_0x18dc83,_0x462295){_0x18dc83=_0x18dc83-0x0;var _0x8236a2=_0x601f[_0x18dc83];return _0x8236a2;};'use strict';var BPromise=require(_0xf601('0x0'));var https=require(_0xf601('0x1'));var logger=require(_0xf601('0x2'))('api');var USERNAME=_0xf601('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x2d684f,_0x3f82bc){var _0x2a7974={'fields':{'project':{'key':_0x2d684f['key']||_0xf601('0x4')},'summary':(_0x2d684f['summary']||_0xf601('0x5'))+'\x20from\x20'+_0x2d684f['ip'],'description':_0x2d684f[_0xf601('0x6')]||JSON[_0xf601('0x7')](_0x2d684f),'issuetype':{'name':_0x2d684f[_0xf601('0x8')]||_0xf601('0x9')}}};_0x2a7974[_0xf601('0xa')]['customfield_11500']=_0x2d684f[_0xf601('0xb')];_0x2a7974[_0xf601('0xa')][_0xf601('0xc')]=_0x2d684f[_0xf601('0xd')];_0x2a7974['fields'][_0xf601('0xe')]=_0x2d684f[_0xf601('0xf')];_0x2a7974[_0xf601('0xa')][_0xf601('0x10')]=_0x2d684f['name'];_0x2a7974[_0xf601('0xa')]['customfield_11504']=_0x2d684f[_0xf601('0x11')];_0x2a7974[_0xf601('0xa')]['customfield_10102']=_0x2d684f['ip'];var _0x1a8519={'host':_0xf601('0x12'),'port':0x1bb,'path':_0xf601('0x13'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xf601('0x14'),'Authorization':_0xf601('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0xf601('0x16')](_0xf601('0x17'))}};var _0x20a0f4=JSON[_0xf601('0x7')](_0x2a7974);var _0x2d2e79=https[_0xf601('0x18')](_0x1a8519,function(_0x3d0c47){_0x3d0c47[_0xf601('0x19')]('utf8');var _0x116117='';_0x3d0c47['on'](_0xf601('0x1a'),function(_0x3ceea9){_0x116117+=_0x3ceea9;});_0x3d0c47['on'](_0xf601('0x1b'),function(){if(_0x3f82bc){return _0x3f82bc['status'](_0x3d0c47[_0xf601('0x1c')])['json'](JSON[_0xf601('0x1d')](_0x116117));}});});_0x2d2e79['on'](_0xf601('0x1e'),function(_0xf9b5ce){if(_0x3f82bc){return _0x3f82bc[_0xf601('0x1f')](0x1f4)[_0xf601('0x20')]({'errors':[{'message':_0xf601('0x21'),'type':'api.jira'}]});}});_0x2d2e79[_0xf601('0x22')](_0x20a0f4);_0x2d2e79['end']();}exports[_0xf601('0x23')]=openIssue;exports[_0xf601('0x24')]=function(_0x2357bc,_0x44aa14){_0x2357bc[_0xf601('0x25')]['ip']=_0x2357bc[_0xf601('0x26')][_0xf601('0x27')]||_0x2357bc['connection']['remoteAddress']||_0x2357bc[_0xf601('0x28')][_0xf601('0x29')]||_0x2357bc[_0xf601('0x2a')][_0xf601('0x28')]['remoteAddress'];return openIssue(_0x2357bc[_0xf601('0x25')],_0x44aa14);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index b04037a..ca540fc 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 _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x2b7bba,_0x3eae73){var _0x1eaa8c=function(_0x4cfe4e){while(--_0x4cfe4e){_0x2b7bba['push'](_0x2b7bba['shift']());}};_0x1eaa8c(++_0x3eae73);}(_0xe706,0xa3));var _0x6e70=function(_0x348860,_0x4531f6){_0x348860=_0x348860-0x0;var _0x2fc2ad=_0xe706[_0x348860];return _0x2fc2ad;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0x878f=['./jscriptyAnswerReport.controller','get','/describe','/:id','post','isAuthenticated','create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1c3b41,_0x50f776){var _0x41e3fe=function(_0x512069){while(--_0x512069){_0x1c3b41['push'](_0x1c3b41['shift']());}};_0x41e3fe(++_0x50f776);}(_0x878f,0x173));var _0xf878=function(_0xf268ff,_0x35ba50){_0xf268ff=_0xf268ff-0x0;var _0x28a89a=_0x878f[_0xf268ff];return _0x28a89a;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf878('0xd')]('/',auth[_0xf878('0xe')](),controller[_0xf878('0xf')]);router['put'](_0xf878('0xc'),auth[_0xf878('0xe')](),controller['update']);router[_0xf878('0x10')]('/:id',auth[_0xf878('0xe')](),controller[_0xf878('0x11')]);module[_0xf878('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index f40ac46..c039f45 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(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x106091,_0x1cf5ce){_0x106091=_0x106091-0x0;var _0x451a0a=_0x7a54[_0x106091];return _0x451a0a;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x52028d,_0x12037d){_0x52028d=_0x52028d-0x0;var _0x81d586=_0x7a54[_0x52028d];return _0x81d586;};'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 63f9b9a..8a99cce 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 _0x24ca=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','then','error','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','name','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','update','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0xb20f7f,_0x272ba3){var _0x5b0eb6=function(_0x260377){while(--_0x260377){_0xb20f7f['push'](_0xb20f7f['shift']());}};_0x5b0eb6(++_0x272ba3);}(_0x24ca,0x8c));var _0xa24c=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0x24ca[_0x1acc2d];return _0xabfa6d;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa24c('0x1'));var rp=require('request-promise');var moment=require(_0xa24c('0x2'));var BPromise=require(_0xa24c('0x3'));var Mustache=require(_0xa24c('0x4'));var util=require('util');var path=require(_0xa24c('0x5'));var sox=require(_0xa24c('0x6'));var csv=require(_0xa24c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa24c('0x8'));var crypto=require(_0xa24c('0x9'));var jsforce=require(_0xa24c('0xa'));var deskjs=require(_0xa24c('0xb'));var toCsv=require(_0xa24c('0x7'));var querystring=require(_0xa24c('0xc'));var Papa=require('papaparse');var Redis=require(_0xa24c('0xd'));var authService=require(_0xa24c('0xe'));var qs=require(_0xa24c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa24c('0x10'))(_0xa24c('0x11'));var utils=require(_0xa24c('0x12'));var config=require(_0xa24c('0x13'));var licenseUtil=require(_0xa24c('0x14'));var db=require(_0xa24c('0x15'))['db'];function respondWithStatusCode(_0x566313,_0x5bb631){_0x5bb631=_0x5bb631||0xcc;return function(_0x4907f6){if(_0x4907f6){return _0x566313[_0xa24c('0x16')](_0x5bb631);}return _0x566313[_0xa24c('0x17')](_0x5bb631)[_0xa24c('0x18')]();};}function respondWithResult(_0x9fe9e3,_0x4351a8){_0x4351a8=_0x4351a8||0xc8;return function(_0x4971af){if(_0x4971af){return _0x9fe9e3[_0xa24c('0x17')](_0x4351a8)['json'](_0x4971af);}};}function respondWithFilteredResult(_0x493bcb,_0x588acf){return function(_0x2e8dc9){if(_0x2e8dc9){var _0x2a4270=typeof _0x588acf[_0xa24c('0x19')]===_0xa24c('0x1a')&&typeof _0x588acf[_0xa24c('0x1b')]===_0xa24c('0x1a');var _0x2197da=_0x2e8dc9[_0xa24c('0x1c')];var _0x14f0aa=_0x2a4270?0x0:_0x588acf[_0xa24c('0x19')];var _0x1970fc=_0x2a4270?_0x2e8dc9[_0xa24c('0x1c')]:_0x588acf[_0xa24c('0x19')]+_0x588acf[_0xa24c('0x1b')];var _0x5276b6;if(_0x1970fc>=_0x2197da){_0x1970fc=_0x2197da;_0x5276b6=0xc8;}else{_0x5276b6=0xce;}_0x493bcb[_0xa24c('0x17')](_0x5276b6);return _0x493bcb['set'](_0xa24c('0x1d'),_0x14f0aa+'-'+_0x1970fc+'/'+_0x2197da)[_0xa24c('0x1e')](_0x2e8dc9);}return null;};}function patchUpdates(_0x8c3949){return function(_0x37e20e){try{jsonpatch[_0xa24c('0x1f')](_0x37e20e,_0x8c3949,!![]);}catch(_0x416dea){return BPromise[_0xa24c('0x20')](_0x416dea);}return _0x37e20e[_0xa24c('0x21')]();};}function saveUpdates(_0xba710,_0x2ec5ad){return function(_0x2b471a){if(_0x2b471a){return _0x2b471a['update'](_0xba710)['then'](function(_0x10fa25){return _0x10fa25;});}return null;};}function removeEntity(_0xdd32a8,_0x316a68){return function(_0x1a04ff){if(_0x1a04ff){return _0x1a04ff[_0xa24c('0x22')]()[_0xa24c('0x23')](function(){_0xdd32a8[_0xa24c('0x17')](0xcc)[_0xa24c('0x18')]();});}};}function handleEntityNotFound(_0x304d6c,_0x4dc3dc){return function(_0x2290e1){if(!_0x2290e1){_0x304d6c['sendStatus'](0x194);}return _0x2290e1;};}function handleError(_0x1f347b,_0x256fbc){_0x256fbc=_0x256fbc||0x1f4;return function(_0x471421){logger[_0xa24c('0x24')](_0x471421['stack']);if(_0x471421['name']){delete _0x471421['name'];}_0x1f347b['status'](_0x256fbc)[_0xa24c('0x25')](_0x471421);};}exports[_0xa24c('0x26')]=function(_0xab6197,_0x1cdee4){var _0x37cbd3={},_0x5361d4={},_0x5c8113={'count':0x0,'rows':[]};var _0x33c208=_[_0xa24c('0x27')](db[_0xa24c('0x28')][_0xa24c('0x29')],function(_0x4566dc){return{'name':_0x4566dc[_0xa24c('0x2a')],'type':_0x4566dc[_0xa24c('0x2b')][_0xa24c('0x2c')]};});_0x5361d4[_0xa24c('0x2d')]=_[_0xa24c('0x27')](_0x33c208,'name');_0x5361d4[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0xab6197['query']);_0x5361d4[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],_0x5361d4[_0xa24c('0x2e')]);_0x37cbd3[_0xa24c('0x32')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x33')]));_0x37cbd3['attributes']=_0x37cbd3['attributes']['length']?_0x37cbd3[_0xa24c('0x32')]:_0x5361d4['model'];if(!_0xab6197[_0xa24c('0x2e')][_0xa24c('0x34')](_0xa24c('0x35'))){_0x37cbd3['limit']=qs[_0xa24c('0x1b')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x1b')]);_0x37cbd3['offset']=qs[_0xa24c('0x19')](_0xab6197[_0xa24c('0x2e')]['offset']);}_0x37cbd3[_0xa24c('0x36')]=qs[_0xa24c('0x37')](_0xab6197[_0xa24c('0x2e')]['sort']);_0x37cbd3[_0xa24c('0x38')]=qs[_0xa24c('0x30')](_[_0xa24c('0x39')](_0xab6197[_0xa24c('0x2e')],_0x5361d4[_0xa24c('0x30')]),_0x33c208);if(_0xab6197['query'][_0xa24c('0x3a')]){_0x37cbd3[_0xa24c('0x38')]=_['merge'](_0x37cbd3[_0xa24c('0x38')],{'$or':_[_0xa24c('0x27')](_0x33c208,function(_0x2417d9){if(_0x2417d9['type']!=='VIRTUAL'){var _0x1f7535={};_0x1f7535[_0x2417d9[_0xa24c('0x3b')]]={'$like':'%'+_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3a')]+'%'};return _0x1f7535;}})});}_0x37cbd3=_[_0xa24c('0x3c')]({},_0x37cbd3,_0xab6197[_0xa24c('0x3d')]);var _0x54ea40={'where':_0x37cbd3[_0xa24c('0x38')]};return db[_0xa24c('0x28')][_0xa24c('0x1c')](_0x54ea40)[_0xa24c('0x23')](function(_0x5f3cd4){_0x5c8113[_0xa24c('0x1c')]=_0x5f3cd4;if(_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x37cbd3[_0xa24c('0x3f')]=[{'all':!![]}];}return db[_0xa24c('0x28')][_0xa24c('0x40')](_0x37cbd3);})[_0xa24c('0x23')](function(_0x54939b){_0x5c8113['rows']=_0x54939b;return _0x5c8113;})[_0xa24c('0x23')](respondWithFilteredResult(_0x1cdee4,_0x37cbd3))['catch'](handleError(_0x1cdee4,null));};exports[_0xa24c('0x41')]=function(_0x4fae76,_0x32e151){var _0x214627={'raw':!![],'where':{'id':_0x4fae76[_0xa24c('0x42')]['id']}},_0x37372d={};_0x37372d[_0xa24c('0x2d')]=_[_0xa24c('0x2f')](db[_0xa24c('0x28')][_0xa24c('0x29')]);_0x37372d[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0x4fae76[_0xa24c('0x2e')]);_0x37372d[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x37372d[_0xa24c('0x2d')],_0x37372d[_0xa24c('0x2e')]);_0x214627[_0xa24c('0x32')]=_['intersection'](_0x37372d[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0x4fae76[_0xa24c('0x2e')]['fields']));_0x214627[_0xa24c('0x32')]=_0x214627[_0xa24c('0x32')][_0xa24c('0x43')]?_0x214627[_0xa24c('0x32')]:_0x37372d['model'];if(_0x4fae76[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x214627[_0xa24c('0x3f')]=[{'all':!![]}];}_0x214627=_[_0xa24c('0x3c')]({},_0x214627,_0x4fae76[_0xa24c('0x3d')]);return db[_0xa24c('0x28')][_0xa24c('0x44')](_0x214627)[_0xa24c('0x23')](handleEntityNotFound(_0x32e151,null))[_0xa24c('0x23')](respondWithResult(_0x32e151,null))[_0xa24c('0x45')](handleError(_0x32e151,null));};exports[_0xa24c('0x46')]=function(_0xeac74f,_0x261c41){return db['JscriptyAnswerReport'][_0xa24c('0x46')](_0xeac74f['body'],{})[_0xa24c('0x23')](respondWithResult(_0x261c41,0xc9))[_0xa24c('0x45')](handleError(_0x261c41,null));};exports[_0xa24c('0x47')]=function(_0x1641b8,_0xd4761e){if(_0x1641b8[_0xa24c('0x48')]['id']){delete _0x1641b8[_0xa24c('0x48')]['id'];}return db[_0xa24c('0x28')][_0xa24c('0x44')]({'where':{'id':_0x1641b8[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0xd4761e,null))[_0xa24c('0x23')](saveUpdates(_0x1641b8[_0xa24c('0x48')],null))['then'](respondWithResult(_0xd4761e,null))[_0xa24c('0x45')](handleError(_0xd4761e,null));};exports[_0xa24c('0x22')]=function(_0x3875fb,_0x456181){return db['JscriptyAnswerReport'][_0xa24c('0x44')]({'where':{'id':_0x3875fb[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0x456181,null))['then'](removeEntity(_0x456181,null))['catch'](handleError(_0x456181,null));};exports[_0xa24c('0x49')]=function(_0x1c8980,_0x4992ee){return db[_0xa24c('0x28')][_0xa24c('0x49')]()['then'](respondWithResult(_0x4992ee,null))[_0xa24c('0x45')](handleError(_0x4992ee,null));}; \ No newline at end of file +var _0x4317=['../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','reject','save','update','then','destroy','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','show','params','catch','create','body','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4317,0x7c));var _0x7431=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4317[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7431('0x0'));var zipdir=require(_0x7431('0x1'));var jsonpatch=require(_0x7431('0x2'));var rp=require('request-promise');var moment=require(_0x7431('0x3'));var BPromise=require(_0x7431('0x4'));var Mustache=require(_0x7431('0x5'));var util=require(_0x7431('0x6'));var path=require(_0x7431('0x7'));var sox=require(_0x7431('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7431('0x9'));var _=require(_0x7431('0xa'));var squel=require(_0x7431('0xb'));var crypto=require(_0x7431('0xc'));var jsforce=require(_0x7431('0xd'));var deskjs=require(_0x7431('0xe'));var toCsv=require(_0x7431('0xf'));var querystring=require(_0x7431('0x10'));var Papa=require(_0x7431('0x11'));var Redis=require(_0x7431('0x12'));var authService=require(_0x7431('0x13'));var qs=require(_0x7431('0x14'));var as=require(_0x7431('0x15'));var hardwareService=require(_0x7431('0x16'));var logger=require(_0x7431('0x17'))(_0x7431('0x18'));var utils=require(_0x7431('0x19'));var config=require(_0x7431('0x1a'));var licenseUtil=require(_0x7431('0x1b'));var db=require(_0x7431('0x1c'))['db'];function respondWithStatusCode(_0x3d3367,_0x367915){_0x367915=_0x367915||0xcc;return function(_0x4421d6){if(_0x4421d6){return _0x3d3367[_0x7431('0x1d')](_0x367915);}return _0x3d3367['status'](_0x367915)[_0x7431('0x1e')]();};}function respondWithResult(_0x1b13cc,_0x90e5eb){_0x90e5eb=_0x90e5eb||0xc8;return function(_0x4adbe4){if(_0x4adbe4){return _0x1b13cc[_0x7431('0x1f')](_0x90e5eb)[_0x7431('0x20')](_0x4adbe4);}};}function respondWithFilteredResult(_0x14bf18,_0x541904){return function(_0xc08396){if(_0xc08396){var _0x4bf072=typeof _0x541904['offset']==='undefined'&&typeof _0x541904[_0x7431('0x21')]===_0x7431('0x22');var _0x2fe0df=_0xc08396[_0x7431('0x23')];var _0x4a7048=_0x4bf072?0x0:_0x541904['offset'];var _0x167238=_0x4bf072?_0xc08396[_0x7431('0x23')]:_0x541904[_0x7431('0x24')]+_0x541904[_0x7431('0x21')];var _0x1e7fdf;if(_0x167238>=_0x2fe0df){_0x167238=_0x2fe0df;_0x1e7fdf=0xc8;}else{_0x1e7fdf=0xce;}_0x14bf18[_0x7431('0x1f')](_0x1e7fdf);return _0x14bf18['set']('Content-Range',_0x4a7048+'-'+_0x167238+'/'+_0x2fe0df)['json'](_0xc08396);}return null;};}function patchUpdates(_0x354e0c){return function(_0x901aa2){try{jsonpatch['apply'](_0x901aa2,_0x354e0c,!![]);}catch(_0x3cb70e){return BPromise[_0x7431('0x25')](_0x3cb70e);}return _0x901aa2[_0x7431('0x26')]();};}function saveUpdates(_0x51c7a7,_0x12c4cf){return function(_0xcbc861){if(_0xcbc861){return _0xcbc861[_0x7431('0x27')](_0x51c7a7)[_0x7431('0x28')](function(_0x49a64b){return _0x49a64b;});}return null;};}function removeEntity(_0x2e9fe7,_0x1688f6){return function(_0x4570b8){if(_0x4570b8){return _0x4570b8[_0x7431('0x29')]()[_0x7431('0x28')](function(){_0x2e9fe7[_0x7431('0x1f')](0xcc)[_0x7431('0x1e')]();});}};}function handleEntityNotFound(_0x183e53,_0x18e40c){return function(_0x9afb30){if(!_0x9afb30){_0x183e53[_0x7431('0x1d')](0x194);}return _0x9afb30;};}function handleError(_0x46e460,_0x551f92){_0x551f92=_0x551f92||0x1f4;return function(_0x43116e){logger['error'](_0x43116e['stack']);if(_0x43116e[_0x7431('0x2a')]){delete _0x43116e[_0x7431('0x2a')];}_0x46e460['status'](_0x551f92)[_0x7431('0x2b')](_0x43116e);};}exports[_0x7431('0x2c')]=function(_0xb1ac3,_0x2701e2){var _0x30e63f={},_0x24f91c={},_0xb184c={'count':0x0,'rows':[]};var _0x26a1be=_[_0x7431('0x2d')](db[_0x7431('0x2e')][_0x7431('0x2f')],function(_0xa63228){return{'name':_0xa63228['fieldName'],'type':_0xa63228[_0x7431('0x30')][_0x7431('0x31')]};});_0x24f91c[_0x7431('0x32')]=_[_0x7431('0x2d')](_0x26a1be,'name');_0x24f91c[_0x7431('0x33')]=_[_0x7431('0x34')](_0xb1ac3[_0x7431('0x33')]);_0x24f91c['filters']=_['intersection'](_0x24f91c[_0x7431('0x32')],_0x24f91c['query']);_0x30e63f['attributes']=_[_0x7431('0x35')](_0x24f91c['model'],qs[_0x7431('0x36')](_0xb1ac3[_0x7431('0x33')]['fields']));_0x30e63f[_0x7431('0x37')]=_0x30e63f[_0x7431('0x37')]['length']?_0x30e63f[_0x7431('0x37')]:_0x24f91c[_0x7431('0x32')];if(!_0xb1ac3[_0x7431('0x33')][_0x7431('0x38')](_0x7431('0x39'))){_0x30e63f['limit']=qs[_0x7431('0x21')](_0xb1ac3['query'][_0x7431('0x21')]);_0x30e63f[_0x7431('0x24')]=qs[_0x7431('0x24')](_0xb1ac3[_0x7431('0x33')][_0x7431('0x24')]);}_0x30e63f[_0x7431('0x3a')]=qs[_0x7431('0x3b')](_0xb1ac3[_0x7431('0x33')][_0x7431('0x3b')]);_0x30e63f[_0x7431('0x3c')]=qs[_0x7431('0x3d')](_[_0x7431('0x3e')](_0xb1ac3[_0x7431('0x33')],_0x24f91c[_0x7431('0x3d')]),_0x26a1be);if(_0xb1ac3[_0x7431('0x33')][_0x7431('0x3f')]){_0x30e63f[_0x7431('0x3c')]=_['merge'](_0x30e63f['where'],{'$or':_[_0x7431('0x2d')](_0x26a1be,function(_0x1c557c){if(_0x1c557c['type']!=='VIRTUAL'){var _0x1cb05a={};_0x1cb05a[_0x1c557c[_0x7431('0x2a')]]={'$like':'%'+_0xb1ac3[_0x7431('0x33')][_0x7431('0x3f')]+'%'};return _0x1cb05a;}})});}_0x30e63f=_[_0x7431('0x40')]({},_0x30e63f,_0xb1ac3[_0x7431('0x41')]);var _0x4e8db2={'where':_0x30e63f['where']};return db[_0x7431('0x2e')][_0x7431('0x23')](_0x4e8db2)[_0x7431('0x28')](function(_0x53dba5){_0xb184c['count']=_0x53dba5;if(_0xb1ac3[_0x7431('0x33')][_0x7431('0x42')]){_0x30e63f[_0x7431('0x43')]=[{'all':!![]}];}return db[_0x7431('0x2e')]['findAll'](_0x30e63f);})[_0x7431('0x28')](function(_0x540a5d){_0xb184c[_0x7431('0x44')]=_0x540a5d;return _0xb184c;})[_0x7431('0x28')](respondWithFilteredResult(_0x2701e2,_0x30e63f))['catch'](handleError(_0x2701e2,null));};exports[_0x7431('0x45')]=function(_0x150431,_0x32589c){var _0x50e648={'raw':!![],'where':{'id':_0x150431[_0x7431('0x46')]['id']}},_0x100c83={};_0x100c83['model']=_[_0x7431('0x34')](db[_0x7431('0x2e')][_0x7431('0x2f')]);_0x100c83[_0x7431('0x33')]=_['keys'](_0x150431[_0x7431('0x33')]);_0x100c83['filters']=_['intersection'](_0x100c83[_0x7431('0x32')],_0x100c83[_0x7431('0x33')]);_0x50e648[_0x7431('0x37')]=_['intersection'](_0x100c83['model'],qs[_0x7431('0x36')](_0x150431[_0x7431('0x33')]['fields']));_0x50e648[_0x7431('0x37')]=_0x50e648[_0x7431('0x37')]['length']?_0x50e648['attributes']:_0x100c83[_0x7431('0x32')];if(_0x150431['query'][_0x7431('0x42')]){_0x50e648[_0x7431('0x43')]=[{'all':!![]}];}_0x50e648=_[_0x7431('0x40')]({},_0x50e648,_0x150431['options']);return db[_0x7431('0x2e')]['find'](_0x50e648)[_0x7431('0x28')](handleEntityNotFound(_0x32589c,null))[_0x7431('0x28')](respondWithResult(_0x32589c,null))[_0x7431('0x47')](handleError(_0x32589c,null));};exports[_0x7431('0x48')]=function(_0x4006a6,_0x4f1092){return db['JscriptyAnswerReport'][_0x7431('0x48')](_0x4006a6[_0x7431('0x49')],{})[_0x7431('0x28')](respondWithResult(_0x4f1092,0xc9))[_0x7431('0x47')](handleError(_0x4f1092,null));};exports[_0x7431('0x27')]=function(_0xd66659,_0x6f7b4){if(_0xd66659['body']['id']){delete _0xd66659[_0x7431('0x49')]['id'];}return db[_0x7431('0x2e')][_0x7431('0x4a')]({'where':{'id':_0xd66659[_0x7431('0x46')]['id']}})[_0x7431('0x28')](handleEntityNotFound(_0x6f7b4,null))['then'](saveUpdates(_0xd66659[_0x7431('0x49')],null))['then'](respondWithResult(_0x6f7b4,null))['catch'](handleError(_0x6f7b4,null));};exports[_0x7431('0x29')]=function(_0x11dfb7,_0x2e6d44){return db[_0x7431('0x2e')][_0x7431('0x4a')]({'where':{'id':_0x11dfb7[_0x7431('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e6d44,null))[_0x7431('0x28')](removeEntity(_0x2e6d44,null))[_0x7431('0x47')](handleError(_0x2e6d44,null));};exports['describe']=function(_0x30ddfe,_0x12cae0){return db[_0x7431('0x2e')][_0x7431('0x4b')]()['then'](respondWithResult(_0x12cae0,null))[_0x7431('0x47')](handleError(_0x12cae0,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index eed2fe5..a08f62c 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 _0x6963=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport'];(function(_0x5b639e,_0x21f44e){var _0x3c0a69=function(_0x268c69){while(--_0x268c69){_0x5b639e['push'](_0x5b639e['shift']());}};_0x3c0a69(++_0x21f44e);}(_0x6963,0x134));var _0x3696=function(_0x23cde1,_0x37b470){_0x23cde1=_0x23cde1-0x0;var _0x193f06=_0x6963[_0x23cde1];return _0x193f06;};'use strict';var _=require(_0x3696('0x0'));var util=require(_0x3696('0x1'));var logger=require(_0x3696('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3696('0x3'));var rp=require(_0x3696('0x4'));var fs=require('fs');var path=require(_0x3696('0x5'));var rimraf=require(_0x3696('0x6'));var config=require(_0x3696('0x7'));var attributes=require(_0x3696('0x8'));module[_0x3696('0x9')]=function(_0x5a9868,_0x2b73ff){return _0x5a9868['define'](_0x3696('0xa'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2ca=['request-promise','define','JscriptyAnswerReport','lodash','util','../../config/logger','api','bluebird'];(function(_0x40f90c,_0x22245e){var _0x192c8d=function(_0x120cd1){while(--_0x120cd1){_0x40f90c['push'](_0x40f90c['shift']());}};_0x192c8d(++_0x22245e);}(_0xb2ca,0xe3));var _0xab2c=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xb2ca[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0xab2c('0x0'));var util=require(_0xab2c('0x1'));var logger=require(_0xab2c('0x2'))(_0xab2c('0x3'));var moment=require('moment');var BPromise=require(_0xab2c('0x4'));var rp=require(_0xab2c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x2607ce,_0x404515){return _0x2607ce[_0xab2c('0x6')](_0xab2c('0x7'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 7d88eb6..9227c2a 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 _0xac4c=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x368a4d,_0x4c3718){var _0x29c15d=function(_0x19f61a){while(--_0x19f61a){_0x368a4d['push'](_0x368a4d['shift']());}};_0x29c15d(++_0x4c3718);}(_0xac4c,0x181));var _0xcac4=function(_0x4bcc04,_0x5dee98){_0x4bcc04=_0x4bcc04-0x0;var _0x1ad976=_0xac4c[_0x4bcc04];return _0x1ad976;};'use strict';var _=require(_0xcac4('0x0'));var util=require(_0xcac4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcac4('0x2'));var fs=require('fs');var Redis=require(_0xcac4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcac4('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xcac4('0x5'));var jayson=require(_0xcac4('0x6'));var client=jayson[_0xcac4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa3b011,_0x5de3c0,_0x39000d){return new BPromise(function(_0x283b79,_0x369a72){return client[_0xcac4('0x8')](_0xa3b011,_0x39000d)[_0xcac4('0x9')](function(_0x18a7fe){logger[_0xcac4('0xa')](_0xcac4('0xb'),_0x5de3c0,'request\x20sent');logger[_0xcac4('0xc')](_0xcac4('0xd'),_0x5de3c0,_0xcac4('0xe'),JSON[_0xcac4('0xf')](_0x18a7fe));if(_0x18a7fe[_0xcac4('0x10')]){if(_0x18a7fe[_0xcac4('0x10')][_0xcac4('0x11')]===0x1f4){logger[_0xcac4('0x10')](_0xcac4('0xb'),_0x5de3c0,_0x18a7fe[_0xcac4('0x10')][_0xcac4('0x12')]);return _0x369a72(_0x18a7fe[_0xcac4('0x10')][_0xcac4('0x12')]);}logger[_0xcac4('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5de3c0,_0x18a7fe[_0xcac4('0x10')][_0xcac4('0x12')]);return _0x283b79(_0x18a7fe[_0xcac4('0x10')][_0xcac4('0x12')]);}else{logger[_0xcac4('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5de3c0,'request\x20sent');_0x283b79(_0x18a7fe[_0xcac4('0x13')][_0xcac4('0x12')]);}})[_0xcac4('0x14')](function(_0xb781be){logger[_0xcac4('0x10')](_0xcac4('0xb'),_0x5de3c0,_0xb781be);_0x369a72(_0xb781be);});});} \ No newline at end of file +var _0x0e5d=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring'];(function(_0x3d2d6f,_0x368872){var _0x5c0022=function(_0x408819){while(--_0x408819){_0x3d2d6f['push'](_0x3d2d6f['shift']());}};_0x5c0022(++_0x368872);}(_0x0e5d,0xac));var _0xd0e5=function(_0x3419d6,_0x56955b){_0x3419d6=_0x3419d6-0x0;var _0x41a64d=_0x0e5d[_0x3419d6];return _0x41a64d;};'use strict';var _=require('lodash');var util=require(_0xd0e5('0x0'));var moment=require(_0xd0e5('0x1'));var BPromise=require(_0xd0e5('0x2'));var rs=require(_0xd0e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0e5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0e5('0x5'))(_0xd0e5('0x6'));var config=require(_0xd0e5('0x7'));var jayson=require(_0xd0e5('0x8'));var client=jayson[_0xd0e5('0x9')][_0xd0e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46a558,_0x200db6,_0x51d019){return new BPromise(function(_0x28ac25,_0x423548){return client[_0xd0e5('0xb')](_0x46a558,_0x51d019)[_0xd0e5('0xc')](function(_0x19c09d){logger[_0xd0e5('0xd')](_0xd0e5('0xe'),_0x200db6,_0xd0e5('0xf'));logger[_0xd0e5('0x10')](_0xd0e5('0x11'),_0x200db6,'request\x20sent',JSON['stringify'](_0x19c09d));if(_0x19c09d[_0xd0e5('0x12')]){if(_0x19c09d[_0xd0e5('0x12')][_0xd0e5('0x13')]===0x1f4){logger[_0xd0e5('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x200db6,_0x19c09d[_0xd0e5('0x12')][_0xd0e5('0x14')]);return _0x423548(_0x19c09d[_0xd0e5('0x12')][_0xd0e5('0x14')]);}logger[_0xd0e5('0x12')](_0xd0e5('0xe'),_0x200db6,_0x19c09d['error']['message']);return _0x28ac25(_0x19c09d[_0xd0e5('0x12')][_0xd0e5('0x14')]);}else{logger[_0xd0e5('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x200db6,'request\x20sent');_0x28ac25(_0x19c09d['result'][_0xd0e5('0x14')]);}})[_0xd0e5('0x15')](function(_0x2e2b1c){logger[_0xd0e5('0x12')](_0xd0e5('0xe'),_0x200db6,_0x2e2b1c);_0x423548(_0x2e2b1c);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 06a6b66..52f8408 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 _0xae4c=['index','/:id','/:id/sessions','getAnswers','/:id/summary','post','create','clone','put','update','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated'];(function(_0x1cc98a,_0x2d152f){var _0x37209d=function(_0xf7cd61){while(--_0xf7cd61){_0x1cc98a['push'](_0x1cc98a['shift']());}};_0x37209d(++_0x2d152f);}(_0xae4c,0x19a));var _0xcae4=function(_0x2f9c17,_0x103d10){_0x2f9c17=_0x2f9c17-0x0;var _0x43d8a5=_0xae4c[_0x2f9c17];return _0x43d8a5;};'use strict';var multer=require(_0xcae4('0x0'));var util=require(_0xcae4('0x1'));var path=require(_0xcae4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcae4('0x3')]();var fs_extra=require(_0xcae4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcae4('0x5'));var config=require(_0xcae4('0x6'));var controller=require(_0xcae4('0x7'));router[_0xcae4('0x8')]('/',auth[_0xcae4('0x9')](),controller[_0xcae4('0xa')]);router[_0xcae4('0x8')](_0xcae4('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xcae4('0x8')](_0xcae4('0xc'),auth['isAuthenticated'](),controller['getSessions']);router['get']('/:id/answers',auth[_0xcae4('0x9')](),controller[_0xcae4('0xd')]);router[_0xcae4('0x8')](_0xcae4('0xe'),auth[_0xcae4('0x9')](),timeout('30s'),controller['getSummary']);router[_0xcae4('0xf')]('/',auth[_0xcae4('0x9')](),controller[_0xcae4('0x10')]);router[_0xcae4('0xf')]('/:id/clone',auth[_0xcae4('0x9')](),controller[_0xcae4('0x11')]);router[_0xcae4('0x12')](_0xcae4('0xb'),auth[_0xcae4('0x9')](),controller[_0xcae4('0x13')]);router['delete']('/:id',auth[_0xcae4('0x9')](),controller['destroy']);module[_0xcae4('0x14')]=router; \ No newline at end of file +var _0xc5be=['./jscriptyProject.controller','get','isAuthenticated','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','/:id/clone','clone','update','delete','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xc5be,0x84));var _0xec5b=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xc5be[_0x3740fe];return _0x55492b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xec5b('0x0'));var router=express[_0xec5b('0x1')]();var fs_extra=require(_0xec5b('0x2'));var auth=require(_0xec5b('0x3'));var interaction=require(_0xec5b('0x4'));var config=require(_0xec5b('0x5'));var controller=require(_0xec5b('0x6'));router[_0xec5b('0x7')]('/',auth[_0xec5b('0x8')](),controller['index']);router[_0xec5b('0x7')](_0xec5b('0x9'),auth[_0xec5b('0x8')](),controller[_0xec5b('0xa')]);router[_0xec5b('0x7')](_0xec5b('0xb'),auth[_0xec5b('0x8')](),controller[_0xec5b('0xc')]);router['get'](_0xec5b('0xd'),auth[_0xec5b('0x8')](),controller[_0xec5b('0xe')]);router[_0xec5b('0x7')](_0xec5b('0xf'),auth[_0xec5b('0x8')](),timeout('30s'),controller[_0xec5b('0x10')]);router['post']('/',auth[_0xec5b('0x8')](),controller['create']);router['post'](_0xec5b('0x11'),auth['isAuthenticated'](),controller[_0xec5b('0x12')]);router['put'](_0xec5b('0x9'),auth[_0xec5b('0x8')](),controller[_0xec5b('0x13')]);router[_0xec5b('0x14')](_0xec5b('0x9'),auth['isAuthenticated'](),controller[_0xec5b('0x15')]);module[_0xec5b('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 5cc949a..e59eb55 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 _0xeb4c=['isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','STRING','name','long','isObjectLike','setDataValue','formData','stringify'];(function(_0x242d68,_0xbc7e2){var _0x10c936=function(_0x4c05c7){while(--_0x4c05c7){_0x242d68['push'](_0x242d68['shift']());}};_0x10c936(++_0xbc7e2);}(_0xeb4c,0x1b7));var _0xceb4=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xeb4c[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xceb4('0x0'));var _=require(_0xceb4('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0xceb4('0x2')],'unique':_0xceb4('0x3')},'description':{'type':Sequelize[_0xceb4('0x2')]},'formData':{'type':Sequelize['TEXT'](_0xceb4('0x4')),'set':function(_0x592fee){if(_[_0xceb4('0x5')](_0x592fee)){this[_0xceb4('0x6')](_0xceb4('0x7'),JSON[_0xceb4('0x8')](_0x592fee));}else if(_[_0xceb4('0x9')](_0x592fee)){this[_0xceb4('0x6')]('formData',_0x592fee);}else{this[_0xceb4('0x6')](_0xceb4('0x7'),util[_0xceb4('0xa')](_0xceb4('0xb'),this[_0xceb4('0xc')](_0xceb4('0x3'))||'',this[_0xceb4('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xceb4('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xceb4('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0xd79e=['STRING','TEXT','isObjectLike','setDataValue','isString','formData','format','getDataValue','description','util','exports','name'];(function(_0x1dd72a,_0x1c1206){var _0x37deec=function(_0x8935e4){while(--_0x8935e4){_0x1dd72a['push'](_0x1dd72a['shift']());}};_0x37deec(++_0x1c1206);}(_0xd79e,0x141));var _0xed79=function(_0x5e8bfa,_0x1e83d1){_0x5e8bfa=_0x5e8bfa-0x0;var _0x10b312=_0xd79e[_0x5e8bfa];return _0x10b312;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0xed79('0x0'));module[_0xed79('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xed79('0x2')},'description':{'type':Sequelize[_0xed79('0x3')]},'formData':{'type':Sequelize[_0xed79('0x4')]('long'),'set':function(_0x58bf3b){if(_[_0xed79('0x5')](_0x58bf3b)){this[_0xed79('0x6')]('formData',JSON['stringify'](_0x58bf3b));}else if(_[_0xed79('0x7')](_0x58bf3b)){this[_0xed79('0x6')]('formData',_0x58bf3b);}else{this[_0xed79('0x6')](_0xed79('0x8'),util[_0xed79('0x9')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xed79('0xa')](_0xed79('0x2'))||'',this['getDataValue'](_0xed79('0xb'))||''));}}},'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 5c6c9b5..ffee40c 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 _0xb5fa=['push','now','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Projects','destroy','stack','name','send','fieldName','type','key','model','map','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','JscriptyProject','include','findAll','rows','catch','show','keys','rawAttributes','fields','length','includeAll','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','user','UserProfileSection','getSessions','findOne','ProjectId','JscriptySessionReport','JscriptyAnswerReport','order','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','answer'];(function(_0x5e94d4,_0x446746){var _0x320854=function(_0xf9824b){while(--_0xf9824b){_0x5e94d4['push'](_0x5e94d4['shift']());}};_0x320854(++_0x446746);}(_0xb5fa,0xf8));var _0xab5f=function(_0x2b91f7,_0x2d2010){_0x2b91f7=_0x2b91f7-0x0;var _0x470dd4=_0xb5fa[_0x2b91f7];return _0x470dd4;};'use strict';var emlformat=require(_0xab5f('0x0'));var rimraf=require(_0xab5f('0x1'));var zipdir=require(_0xab5f('0x2'));var jsonpatch=require(_0xab5f('0x3'));var rp=require(_0xab5f('0x4'));var moment=require(_0xab5f('0x5'));var BPromise=require(_0xab5f('0x6'));var Mustache=require(_0xab5f('0x7'));var util=require(_0xab5f('0x8'));var path=require(_0xab5f('0x9'));var sox=require(_0xab5f('0xa'));var csv=require(_0xab5f('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xab5f('0xc'));var crypto=require(_0xab5f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xab5f('0xe'));var toCsv=require(_0xab5f('0xb'));var querystring=require(_0xab5f('0xf'));var Papa=require(_0xab5f('0x10'));var Redis=require(_0xab5f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xab5f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab5f('0x13'));var logger=require('../../config/logger')(_0xab5f('0x14'));var utils=require(_0xab5f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d9f16,_0x32fca3){_0x32fca3=_0x32fca3||0xcc;return function(_0x56d072){if(_0x56d072){return _0x3d9f16[_0xab5f('0x16')](_0x32fca3);}return _0x3d9f16[_0xab5f('0x17')](_0x32fca3)[_0xab5f('0x18')]();};}function respondWithResult(_0x318335,_0x410269){_0x410269=_0x410269||0xc8;return function(_0x4101ee){if(_0x4101ee){return _0x318335[_0xab5f('0x17')](_0x410269)[_0xab5f('0x19')](_0x4101ee);}};}function respondWithFilteredResult(_0x32def2,_0x45bbf6){return function(_0x2dcfb7){if(_0x2dcfb7){var _0x30089f=typeof _0x45bbf6[_0xab5f('0x1a')]===_0xab5f('0x1b')&&typeof _0x45bbf6[_0xab5f('0x1c')]===_0xab5f('0x1b');var _0xecd649=_0x2dcfb7[_0xab5f('0x1d')];var _0x4aca7d=_0x30089f?0x0:_0x45bbf6[_0xab5f('0x1a')];var _0x4da25e=_0x30089f?_0x2dcfb7[_0xab5f('0x1d')]:_0x45bbf6[_0xab5f('0x1a')]+_0x45bbf6[_0xab5f('0x1c')];var _0x1d6c2b;if(_0x4da25e>=_0xecd649){_0x4da25e=_0xecd649;_0x1d6c2b=0xc8;}else{_0x1d6c2b=0xce;}_0x32def2['status'](_0x1d6c2b);return _0x32def2[_0xab5f('0x1e')](_0xab5f('0x1f'),_0x4aca7d+'-'+_0x4da25e+'/'+_0xecd649)[_0xab5f('0x19')](_0x2dcfb7);}return null;};}function patchUpdates(_0x1bc5ae){return function(_0x34aa5e){try{jsonpatch[_0xab5f('0x20')](_0x34aa5e,_0x1bc5ae,!![]);}catch(_0x58cfa4){return BPromise[_0xab5f('0x21')](_0x58cfa4);}return _0x34aa5e[_0xab5f('0x22')]();};}function saveUpdates(_0x41a2af,_0x5377dd){return function(_0xb47124){if(_0xb47124){return _0xb47124[_0xab5f('0x23')](_0x41a2af)[_0xab5f('0x24')](function(_0x237704){return _0x237704;});}return null;};}function removeEntity(_0x297dff,_0x823c5){return function(_0x4b3127){if(_0x4b3127){return _0x4b3127['destroy']()[_0xab5f('0x24')](function(){var _0x3f3bae=_0x4b3127[_0xab5f('0x25')]({'plain':!![]});var _0x39bf0f=_0xab5f('0x26');return db['UserProfileResource'][_0xab5f('0x27')]({'where':{'type':_0x39bf0f,'resourceId':_0x3f3bae['id']}})[_0xab5f('0x24')](function(){return _0x4b3127;});})['then'](function(){_0x297dff[_0xab5f('0x17')](0xcc)[_0xab5f('0x18')]();});}};}function handleEntityNotFound(_0x56e074,_0x391fec){return function(_0x4fee82){if(!_0x4fee82){_0x56e074[_0xab5f('0x16')](0x194);}return _0x4fee82;};}function handleError(_0x2c0a1a,_0x1e1fa9){_0x1e1fa9=_0x1e1fa9||0x1f4;return function(_0x239229){logger['error'](_0x239229[_0xab5f('0x28')]);if(_0x239229[_0xab5f('0x29')]){delete _0x239229[_0xab5f('0x29')];}_0x2c0a1a[_0xab5f('0x17')](_0x1e1fa9)[_0xab5f('0x2a')](_0x239229);};}exports['index']=function(_0x5c6229,_0x7f5308){var _0x464287={},_0x290df8={},_0x274951={'count':0x0,'rows':[]};var _0x4bd729=_['map'](db['JscriptyProject']['rawAttributes'],function(_0x494c4b){return{'name':_0x494c4b[_0xab5f('0x2b')],'type':_0x494c4b[_0xab5f('0x2c')][_0xab5f('0x2d')]};});_0x290df8[_0xab5f('0x2e')]=_[_0xab5f('0x2f')](_0x4bd729,_0xab5f('0x29'));_0x290df8[_0xab5f('0x30')]=_['keys'](_0x5c6229[_0xab5f('0x30')]);_0x290df8[_0xab5f('0x31')]=_[_0xab5f('0x32')](_0x290df8[_0xab5f('0x2e')],_0x290df8[_0xab5f('0x30')]);_0x464287[_0xab5f('0x33')]=_['intersection'](_0x290df8[_0xab5f('0x2e')],qs['fields'](_0x5c6229[_0xab5f('0x30')]['fields']));_0x464287['attributes']=_0x464287['attributes']['length']?_0x464287[_0xab5f('0x33')]:_0x290df8['model'];if(!_0x5c6229[_0xab5f('0x30')][_0xab5f('0x34')](_0xab5f('0x35'))){_0x464287[_0xab5f('0x1c')]=qs[_0xab5f('0x1c')](_0x5c6229[_0xab5f('0x30')][_0xab5f('0x1c')]);_0x464287[_0xab5f('0x1a')]=qs[_0xab5f('0x1a')](_0x5c6229['query'][_0xab5f('0x1a')]);}_0x464287['order']=qs[_0xab5f('0x36')](_0x5c6229[_0xab5f('0x30')][_0xab5f('0x36')]);_0x464287['where']=qs[_0xab5f('0x31')](_[_0xab5f('0x37')](_0x5c6229[_0xab5f('0x30')],_0x290df8[_0xab5f('0x31')]),_0x4bd729);if(_0x5c6229[_0xab5f('0x30')][_0xab5f('0x38')]){_0x464287[_0xab5f('0x39')]=_['merge'](_0x464287[_0xab5f('0x39')],{'$or':_[_0xab5f('0x2f')](_0x4bd729,function(_0x6298c4){if(_0x6298c4[_0xab5f('0x2c')]!==_0xab5f('0x3a')){var _0x141a34={};_0x141a34[_0x6298c4[_0xab5f('0x29')]]={'$like':'%'+_0x5c6229[_0xab5f('0x30')]['filter']+'%'};return _0x141a34;}})});}_0x464287=_['merge']({},_0x464287,_0x5c6229[_0xab5f('0x3b')]);var _0x384cbf={'where':_0x464287['where']};return db[_0xab5f('0x3c')]['count'](_0x384cbf)[_0xab5f('0x24')](function(_0x71490a){_0x274951['count']=_0x71490a;if(_0x5c6229[_0xab5f('0x30')]['includeAll']){_0x464287[_0xab5f('0x3d')]=[{'all':!![]}];}return db[_0xab5f('0x3c')][_0xab5f('0x3e')](_0x464287);})[_0xab5f('0x24')](function(_0x2da96f){_0x274951[_0xab5f('0x3f')]=_0x2da96f;return _0x274951;})['then'](respondWithFilteredResult(_0x7f5308,_0x464287))[_0xab5f('0x40')](handleError(_0x7f5308,null));};exports[_0xab5f('0x41')]=function(_0x22249a,_0x2e81c6){var _0x366c5d={'raw':![],'where':{'id':_0x22249a['params']['id']}},_0x358e13={};_0x358e13[_0xab5f('0x2e')]=_[_0xab5f('0x42')](db['JscriptyProject'][_0xab5f('0x43')]);_0x358e13['query']=_[_0xab5f('0x42')](_0x22249a[_0xab5f('0x30')]);_0x358e13['filters']=_[_0xab5f('0x32')](_0x358e13[_0xab5f('0x2e')],_0x358e13[_0xab5f('0x30')]);_0x366c5d[_0xab5f('0x33')]=_[_0xab5f('0x32')](_0x358e13[_0xab5f('0x2e')],qs[_0xab5f('0x44')](_0x22249a[_0xab5f('0x30')]['fields']));_0x366c5d[_0xab5f('0x33')]=_0x366c5d[_0xab5f('0x33')][_0xab5f('0x45')]?_0x366c5d['attributes']:_0x358e13[_0xab5f('0x2e')];if(_0x22249a[_0xab5f('0x30')][_0xab5f('0x46')]){_0x366c5d[_0xab5f('0x3d')]=[{'all':!![]}];}_0x366c5d=_[_0xab5f('0x47')]({},_0x366c5d,_0x22249a[_0xab5f('0x3b')]);return db[_0xab5f('0x3c')][_0xab5f('0x48')](_0x366c5d)[_0xab5f('0x24')](handleEntityNotFound(_0x2e81c6,null))[_0xab5f('0x24')](respondWithResult(_0x2e81c6,null))[_0xab5f('0x40')](handleError(_0x2e81c6,null));};exports[_0xab5f('0x49')]=function(_0x4502ee,_0x28a126){return db['JscriptyProject'][_0xab5f('0x49')](_0x4502ee[_0xab5f('0x4a')],{})[_0xab5f('0x24')](function(_0x2456d0){var _0x8c6acb=_0x4502ee['user']['get']({'plain':!![]});if(!_0x8c6acb)throw new Error(_0xab5f('0x4b'));if(_0x8c6acb[_0xab5f('0x4c')]==='user'){var _0x409c61=_0x2456d0[_0xab5f('0x25')]({'plain':!![]});var _0x85fd96=_0xab5f('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x85fd96,'userProfileId':_0x8c6acb[_0xab5f('0x4d')]},'raw':!![]})[_0xab5f('0x24')](function(_0x5869b1){if(_0x5869b1&&_0x5869b1[_0xab5f('0x4e')]===0x0){return db[_0xab5f('0x4f')]['create']({'name':_0x409c61['name'],'resourceId':_0x409c61['id'],'type':_0x5869b1[_0xab5f('0x29')],'sectionId':_0x5869b1['id']},{})['then'](function(){return _0x2456d0;});}else{return _0x2456d0;}})[_0xab5f('0x40')](function(_0x49a507){logger[_0xab5f('0x50')](_0xab5f('0x51'),_0x49a507);throw _0x49a507;});}return _0x2456d0;})[_0xab5f('0x24')](respondWithResult(_0x28a126,0xc9))[_0xab5f('0x40')](handleError(_0x28a126,null));};exports[_0xab5f('0x52')]=function(_0x81a92e,_0x149a86){var _0x454932={'where':{'id':_0x81a92e[_0xab5f('0x53')]['id']}},_0x4c5f73={};_0x4c5f73['model']=_['keys'](db[_0xab5f('0x3c')]['rawAttributes']);_0x454932[_0xab5f('0x33')]=_[_0xab5f('0x32')](_0x4c5f73[_0xab5f('0x2e')],qs[_0xab5f('0x44')](_0x81a92e[_0xab5f('0x30')][_0xab5f('0x44')]));_0x454932[_0xab5f('0x33')]=_0x454932[_0xab5f('0x33')][_0xab5f('0x45')]?_0x454932['attributes']:_0x4c5f73[_0xab5f('0x2e')];if(_0x81a92e[_0xab5f('0x30')][_0xab5f('0x46')]){_0x454932[_0xab5f('0x3d')]=[{'all':!![]}];}_0x454932=_['merge']({},_0x454932,_0x81a92e[_0xab5f('0x3b')]);return db[_0xab5f('0x3c')][_0xab5f('0x48')](_0x454932)[_0xab5f('0x24')](handleEntityNotFound(_0x149a86,null))[_0xab5f('0x24')](function(_0x4cee7a){if(_0x4cee7a){var _0x95788d=_0x4cee7a[_0xab5f('0x25')]({'plain':!![]});_0x95788d=qs['omit'](_0x95788d,['id',_0xab5f('0x54'),_0xab5f('0x55')]);_0x81a92e[_0xab5f('0x4a')]=_[_0xab5f('0x56')](_0x81a92e[_0xab5f('0x4a')],['id',_0xab5f('0x54'),_0xab5f('0x55')]);return db['JscriptyProject'][_0xab5f('0x49')](_[_0xab5f('0x47')](_0x95788d,_0x81a92e[_0xab5f('0x4a')]),{'include':_0x81a92e[_0xab5f('0x30')][_0xab5f('0x46')]?[{'all':!![]}]:undefined})[_0xab5f('0x24')](function(_0x5650b2){var _0x549c4a=_0x81a92e[_0xab5f('0x57')][_0xab5f('0x25')]({'plain':!![]});if(!_0x549c4a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x549c4a[_0xab5f('0x4c')]===_0xab5f('0x57')){var _0x4efbc4=_0x5650b2[_0xab5f('0x25')]({'plain':!![]});var _0x8e054=_0xab5f('0x26');return db[_0xab5f('0x58')]['find']({'where':{'name':_0x8e054,'userProfileId':_0x549c4a['userProfileId']},'raw':!![]})[_0xab5f('0x24')](function(_0x449fb3){if(_0x449fb3&&_0x449fb3[_0xab5f('0x4e')]===0x0){return db['UserProfileResource'][_0xab5f('0x49')]({'name':_0x4efbc4[_0xab5f('0x29')],'resourceId':_0x4efbc4['id'],'type':_0x449fb3['name'],'sectionId':_0x449fb3['id']},{})[_0xab5f('0x24')](function(){return _0x5650b2;});}else{return _0x5650b2;}})[_0xab5f('0x40')](function(_0x30911c){logger[_0xab5f('0x50')](_0xab5f('0x51'),_0x30911c);throw _0x30911c;});}return _0x5650b2;});}})[_0xab5f('0x24')](respondWithResult(_0x149a86,0xc9))[_0xab5f('0x40')](handleError(_0x149a86,null));};exports[_0xab5f('0x23')]=function(_0x30506e,_0x465c2e){if(_0x30506e[_0xab5f('0x4a')]['id']){delete _0x30506e['body']['id'];}return db[_0xab5f('0x3c')][_0xab5f('0x48')]({'where':{'id':_0x30506e[_0xab5f('0x53')]['id']}})[_0xab5f('0x24')](handleEntityNotFound(_0x465c2e,null))['then'](saveUpdates(_0x30506e[_0xab5f('0x4a')],null))[_0xab5f('0x24')](respondWithResult(_0x465c2e,null))['catch'](handleError(_0x465c2e,null));};exports[_0xab5f('0x27')]=function(_0x185f8a,_0x4893b9){return db['JscriptyProject'][_0xab5f('0x48')]({'where':{'id':_0x185f8a[_0xab5f('0x53')]['id']}})[_0xab5f('0x24')](handleEntityNotFound(_0x4893b9,null))[_0xab5f('0x24')](removeEntity(_0x4893b9,null))[_0xab5f('0x40')](handleError(_0x4893b9,null));};exports[_0xab5f('0x59')]=function(_0x2acbaf,_0x2026da,_0x58442f){var _0xfa3b29={'raw':!![],'where':{}};var _0x10b5d4={};var _0x36b3bc={'count':0x0,'rows':[]};return db[_0xab5f('0x3c')][_0xab5f('0x5a')]({'where':{'id':_0x2acbaf[_0xab5f('0x53')]['id']}})[_0xab5f('0x24')](handleEntityNotFound(_0x2026da,null))[_0xab5f('0x24')](function(_0x1939ab){if(_0x1939ab){_0x10b5d4[_0xab5f('0x2e')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x10b5d4[_0xab5f('0x30')]=_['keys'](_0x2acbaf[_0xab5f('0x30')]);_0x10b5d4[_0xab5f('0x31')]=_['intersection'](_0x10b5d4['model'],_0x10b5d4[_0xab5f('0x30')]);_0xfa3b29[_0xab5f('0x33')]=_[_0xab5f('0x32')](_0x10b5d4['model'],qs[_0xab5f('0x44')](_0x2acbaf[_0xab5f('0x30')][_0xab5f('0x44')]));_0xfa3b29[_0xab5f('0x33')]=_0xfa3b29[_0xab5f('0x33')][_0xab5f('0x45')]?_0xfa3b29[_0xab5f('0x33')]:_0x10b5d4[_0xab5f('0x2e')];if(!_0x2acbaf[_0xab5f('0x30')][_0xab5f('0x34')]('nolimit')){_0xfa3b29['limit']=qs[_0xab5f('0x1c')](_0x2acbaf['query'][_0xab5f('0x1c')]);_0xfa3b29['offset']=qs[_0xab5f('0x1a')](_0x2acbaf[_0xab5f('0x30')]['offset']);}_0xfa3b29['order']=qs[_0xab5f('0x36')](_0x2acbaf[_0xab5f('0x30')][_0xab5f('0x36')]);_0xfa3b29[_0xab5f('0x39')]=qs[_0xab5f('0x31')](_[_0xab5f('0x37')](_0x2acbaf[_0xab5f('0x30')],_0x10b5d4['filters']));_0xfa3b29['where'][_0xab5f('0x5b')]=_0x1939ab['id'];if(_0x2acbaf['query'][_0xab5f('0x38')]){_0xfa3b29[_0xab5f('0x39')]=_['merge'](_0xfa3b29[_0xab5f('0x39')],{'$or':_[_0xab5f('0x2f')](_0xfa3b29[_0xab5f('0x33')],function(_0x4ff35f){var _0x4f5881={};_0x4f5881[_0x4ff35f]={'$like':'%'+_0x2acbaf[_0xab5f('0x30')][_0xab5f('0x38')]+'%'};return _0x4f5881;})});}_0xfa3b29=_['merge']({},_0xfa3b29,_0x2acbaf['options']);return db[_0xab5f('0x5c')][_0xab5f('0x1d')]({'where':_0xfa3b29[_0xab5f('0x39')]})[_0xab5f('0x24')](function(_0x12430f){_0x36b3bc[_0xab5f('0x1d')]=_0x12430f;if(_0x2acbaf[_0xab5f('0x30')]['includeAll']){_0xfa3b29[_0xab5f('0x3d')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xab5f('0x3e')](_0xfa3b29);})[_0xab5f('0x24')](function(_0x192803){_0x36b3bc[_0xab5f('0x3f')]=_0x192803;return _0x36b3bc;});}})[_0xab5f('0x24')](respondWithFilteredResult(_0x2026da,_0xfa3b29))[_0xab5f('0x40')](handleError(_0x2026da,null));};exports['getAnswers']=function(_0x36bc47,_0x12f94e,_0x12756c){var _0x9c9b9={'raw':!![],'where':{}};var _0x309735={};var _0x13b2e7={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xab5f('0x5a')]({'where':{'id':_0x36bc47[_0xab5f('0x53')]['id']}})[_0xab5f('0x24')](handleEntityNotFound(_0x12f94e,null))[_0xab5f('0x24')](function(_0x4ae277){if(_0x4ae277){_0x309735['model']=_[_0xab5f('0x42')](db[_0xab5f('0x5d')][_0xab5f('0x43')]);_0x309735[_0xab5f('0x30')]=_[_0xab5f('0x42')](_0x36bc47['query']);_0x309735[_0xab5f('0x31')]=_['intersection'](_0x309735[_0xab5f('0x2e')],_0x309735['query']);_0x9c9b9[_0xab5f('0x33')]=_['intersection'](_0x309735[_0xab5f('0x2e')],qs[_0xab5f('0x44')](_0x36bc47[_0xab5f('0x30')][_0xab5f('0x44')]));_0x9c9b9[_0xab5f('0x33')]=_0x9c9b9[_0xab5f('0x33')][_0xab5f('0x45')]?_0x9c9b9[_0xab5f('0x33')]:_0x309735[_0xab5f('0x2e')];if(!_0x36bc47[_0xab5f('0x30')][_0xab5f('0x34')](_0xab5f('0x35'))){_0x9c9b9[_0xab5f('0x1c')]=qs[_0xab5f('0x1c')](_0x36bc47[_0xab5f('0x30')]['limit']);_0x9c9b9[_0xab5f('0x1a')]=qs['offset'](_0x36bc47[_0xab5f('0x30')]['offset']);}_0x9c9b9[_0xab5f('0x5e')]=qs[_0xab5f('0x36')](_0x36bc47[_0xab5f('0x30')][_0xab5f('0x36')]);_0x9c9b9['where']=qs[_0xab5f('0x31')](_['pick'](_0x36bc47['query'],_0x309735['filters']));_0x9c9b9['where'][_0xab5f('0x5b')]=_0x4ae277['id'];if(_0x36bc47[_0xab5f('0x30')][_0xab5f('0x38')]){_0x9c9b9[_0xab5f('0x39')]=_[_0xab5f('0x47')](_0x9c9b9[_0xab5f('0x39')],{'$or':_['map'](_0x9c9b9[_0xab5f('0x33')],function(_0x402a45){var _0x3b332b={};_0x3b332b[_0x402a45]={'$like':'%'+_0x36bc47['query'][_0xab5f('0x38')]+'%'};return _0x3b332b;})});}_0x9c9b9=_[_0xab5f('0x47')]({},_0x9c9b9,_0x36bc47[_0xab5f('0x3b')]);return db[_0xab5f('0x5d')][_0xab5f('0x1d')]({'where':_0x9c9b9['where']})[_0xab5f('0x24')](function(_0x291d86){_0x13b2e7['count']=_0x291d86;if(_0x36bc47[_0xab5f('0x30')][_0xab5f('0x46')]){_0x9c9b9['include']=[{'all':!![]}];}return db[_0xab5f('0x5d')][_0xab5f('0x3e')](_0x9c9b9);})[_0xab5f('0x24')](function(_0x52d479){_0x13b2e7['rows']=_0x52d479;return _0x13b2e7;});}})[_0xab5f('0x24')](respondWithFilteredResult(_0x12f94e,_0x9c9b9))[_0xab5f('0x40')](handleError(_0x12f94e,null));};function char(_0x23276f){return _0xab5f('0x5f')===typeof _0x23276f?String['fromCharCode'][_0xab5f('0x20')](null,arguments):_0x23276f;}function needsEncapsulation(_0x5d3b1b){return!!_0x5d3b1b&&(_0x5d3b1b[_0xab5f('0x60')]()[_0xab5f('0x61')](char(0xd))>=0x0||_0x5d3b1b[_0xab5f('0x60')]()[_0xab5f('0x61')](char(0xa))>=0x0||_0x5d3b1b[_0xab5f('0x60')]()[_0xab5f('0x61')](char(0x2c))>=0x0||_0x5d3b1b[_0xab5f('0x60')]()[_0xab5f('0x61')](char(0x22))>=0x0);}function encapsulate(_0x30f432){var _0x1bd586=char(0x22),_0xf1566f='\x5c'+char(0x22),_0xc78dc4=_0x30f432[_0xab5f('0x60')]()[_0xab5f('0x62')](new RegExp(_0x1bd586,'g'),_0xf1566f);return _0x1bd586+_0xc78dc4+_0x1bd586;}exports[_0xab5f('0x63')]=function(_0x32d501,_0x17c9e9,_0x50872f){var _0x28cf22,_0x543e59;var _0x296e87={'where':{'ProjectId':_0x32d501[_0xab5f('0x53')]['id']}};if(_0x32d501['query'][_0xab5f('0x64')]){_0x296e87[_0xab5f('0x39')][_0xab5f('0x65')]=JSON[_0xab5f('0x66')](_0x32d501[_0xab5f('0x30')][_0xab5f('0x64')]);}return db[_0xab5f('0x5c')][_0xab5f('0x3e')](_0x296e87)[_0xab5f('0x24')](handleEntityNotFound(_0x17c9e9,null))[_0xab5f('0x24')](function(_0x12ed24){if(_0x12ed24){_0x28cf22=_0x12ed24;return db[_0xab5f('0x67')][_0xab5f('0x3e')]({'where':{'SessionId':{'$in':_[_0xab5f('0x2f')](_0x28cf22,'id')},'ProjectId':_0x32d501[_0xab5f('0x53')]['id']},'order':_0xab5f('0x68')});}})[_0xab5f('0x24')](handleEntityNotFound(_0x17c9e9,null))[_0xab5f('0x24')](function(_0x6f9d2f){if(_0x6f9d2f){_0x543e59=_0x6f9d2f;var _0x2b1977={};for(var _0x4ff6a9=0x0,_0x5b2035=_0x543e59[_0xab5f('0x45')];_0x4ff6a9<_0x5b2035;_0x4ff6a9++){if(!_0x2b1977[_0xab5f('0x34')](_0x543e59[_0x4ff6a9][_0xab5f('0x69')])){_0x2b1977[_0x543e59[_0x4ff6a9]['questionId']]=needsEncapsulation(_0x543e59[_0x4ff6a9][_0xab5f('0x6a')])?encapsulate(_0x543e59[_0x4ff6a9][_0xab5f('0x6a')]):_0x543e59[_0x4ff6a9][_0xab5f('0x6a')];}}var _0x12e073=[],_0x6f1db9={};for(var _0x5a0d88=0x0,_0x5c16d6=_0x28cf22[_0xab5f('0x45')];_0x5a0d88<_0x5c16d6;_0x5a0d88++){_0x6f1db9={'ProjectId':_0x32d501[_0xab5f('0x53')]['id'],'SessionId':_0x28cf22[_0x5a0d88]['id'],'StartTime':moment(_0x28cf22[_0x5a0d88]['starttime'])['format'](_0xab5f('0x6b'))};for(var _0x3a8573=0x0,_0x3c7e04=_0x543e59[_0xab5f('0x45')];_0x3a8573<_0x3c7e04;_0x3a8573++){if(_0x543e59[_0x3a8573]['SessionId']==_0x28cf22[_0x5a0d88]['id']&&_0x2b1977[_0xab5f('0x34')](_0x543e59[_0x3a8573]['questionId'])){_0x6f1db9[_0x2b1977[_0x543e59[_0x3a8573][_0xab5f('0x69')]]]=_0x543e59[_0x3a8573][_0xab5f('0x6c')];}}for(var _0x21d746 in _0x2b1977){if(!_0x6f1db9[_0xab5f('0x34')](_0x2b1977[_0x21d746])){_0x6f1db9[_0x2b1977[_0x21d746]]=null;}}_0x12e073[_0xab5f('0x6d')](_0x6f1db9);}return _0x12e073;}})[_0xab5f('0x24')](function(_0x1028bc){if(!_['isEmpty'](_0x1028bc)){var _0x1baab8=toCsv(_0x1028bc);var _0x1284d0=Date[_0xab5f('0x6e')]();fs['writeFileSync'](util[_0xab5f('0x6f')](_0xab5f('0x70'),_0x32d501[_0xab5f('0x53')]['id'],_0x1284d0),_0x1baab8);_0x17c9e9[_0xab5f('0x71')](_0xab5f('0x72'),_0xab5f('0x73')+util[_0xab5f('0x6f')]('Jscripty_Project_%d_Summary_%s.csv',_0x32d501[_0xab5f('0x53')]['id'],_0x1284d0));_0x17c9e9[_0xab5f('0x71')](_0xab5f('0x74'),_0xab5f('0x75'));return _0x17c9e9[_0xab5f('0x76')](util[_0xab5f('0x6f')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x32d501['params']['id'],_0x1284d0));}else{return _0x17c9e9[_0xab5f('0x16')](0xcc);}})[_0xab5f('0x40')](handleError(_0x17c9e9,null));}; \ No newline at end of file +var _0x29b1=['Jscripty_Project_%d_Summary_%s.csv','text/csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','JscriptyProject','fieldName','type','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','createdAt','updatedAt','Projects','UserProfileSection','getSessions','nolimit','order','pick','ProjectId','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','findAll','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename='];(function(_0x140221,_0x4a519d){var _0x45580f=function(_0x5214fe){while(--_0x5214fe){_0x140221['push'](_0x140221['shift']());}};_0x45580f(++_0x4a519d);}(_0x29b1,0x16d));var _0x129b=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x29b1[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x129b('0x0'));var rimraf=require(_0x129b('0x1'));var zipdir=require(_0x129b('0x2'));var jsonpatch=require(_0x129b('0x3'));var rp=require(_0x129b('0x4'));var moment=require('moment');var BPromise=require(_0x129b('0x5'));var Mustache=require(_0x129b('0x6'));var util=require(_0x129b('0x7'));var path=require(_0x129b('0x8'));var sox=require(_0x129b('0x9'));var csv=require(_0x129b('0xa'));var ejs=require(_0x129b('0xb'));var fs=require('fs');var fs_extra=require(_0x129b('0xc'));var _=require('lodash');var squel=require(_0x129b('0xd'));var crypto=require('crypto');var jsforce=require(_0x129b('0xe'));var deskjs=require(_0x129b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x129b('0x10'));var Papa=require(_0x129b('0x11'));var Redis=require('ioredis');var authService=require(_0x129b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x129b('0x13'));var hardwareService=require(_0x129b('0x14'));var logger=require(_0x129b('0x15'))('api');var utils=require(_0x129b('0x16'));var config=require(_0x129b('0x17'));var licenseUtil=require(_0x129b('0x18'));var db=require(_0x129b('0x19'))['db'];function respondWithStatusCode(_0x4d5fbd,_0x5767b5){_0x5767b5=_0x5767b5||0xcc;return function(_0x4cc6ee){if(_0x4cc6ee){return _0x4d5fbd[_0x129b('0x1a')](_0x5767b5);}return _0x4d5fbd['status'](_0x5767b5)[_0x129b('0x1b')]();};}function respondWithResult(_0x3e7b83,_0x17255b){_0x17255b=_0x17255b||0xc8;return function(_0x52137c){if(_0x52137c){return _0x3e7b83[_0x129b('0x1c')](_0x17255b)['json'](_0x52137c);}};}function respondWithFilteredResult(_0x160d17,_0xafc5b9){return function(_0x17fff2){if(_0x17fff2){var _0x50d62b=typeof _0xafc5b9[_0x129b('0x1d')]===_0x129b('0x1e')&&typeof _0xafc5b9[_0x129b('0x1f')]===_0x129b('0x1e');var _0x30785a=_0x17fff2[_0x129b('0x20')];var _0x135b42=_0x50d62b?0x0:_0xafc5b9[_0x129b('0x1d')];var _0x299bb5=_0x50d62b?_0x17fff2[_0x129b('0x20')]:_0xafc5b9[_0x129b('0x1d')]+_0xafc5b9[_0x129b('0x1f')];var _0x4ec534;if(_0x299bb5>=_0x30785a){_0x299bb5=_0x30785a;_0x4ec534=0xc8;}else{_0x4ec534=0xce;}_0x160d17[_0x129b('0x1c')](_0x4ec534);return _0x160d17[_0x129b('0x21')](_0x129b('0x22'),_0x135b42+'-'+_0x299bb5+'/'+_0x30785a)[_0x129b('0x23')](_0x17fff2);}return null;};}function patchUpdates(_0x2dcaa1){return function(_0x252a69){try{jsonpatch[_0x129b('0x24')](_0x252a69,_0x2dcaa1,!![]);}catch(_0x229473){return BPromise[_0x129b('0x25')](_0x229473);}return _0x252a69[_0x129b('0x26')]();};}function saveUpdates(_0x1cae1a,_0x19b23b){return function(_0x491624){if(_0x491624){return _0x491624[_0x129b('0x27')](_0x1cae1a)[_0x129b('0x28')](function(_0x8f270d){return _0x8f270d;});}return null;};}function removeEntity(_0x1206c9,_0x4d4b76){return function(_0x4fedcd){if(_0x4fedcd){return _0x4fedcd[_0x129b('0x29')]()['then'](function(){var _0x30ffe4=_0x4fedcd[_0x129b('0x2a')]({'plain':!![]});var _0x4c733d='Projects';return db[_0x129b('0x2b')][_0x129b('0x29')]({'where':{'type':_0x4c733d,'resourceId':_0x30ffe4['id']}})[_0x129b('0x28')](function(){return _0x4fedcd;});})[_0x129b('0x28')](function(){_0x1206c9[_0x129b('0x1c')](0xcc)[_0x129b('0x1b')]();});}};}function handleEntityNotFound(_0x42d623,_0x3fec4b){return function(_0x4aaa74){if(!_0x4aaa74){_0x42d623[_0x129b('0x1a')](0x194);}return _0x4aaa74;};}function handleError(_0x28b8d8,_0x57a47d){_0x57a47d=_0x57a47d||0x1f4;return function(_0x3a852a){logger['error'](_0x3a852a[_0x129b('0x2c')]);if(_0x3a852a['name']){delete _0x3a852a[_0x129b('0x2d')];}_0x28b8d8[_0x129b('0x1c')](_0x57a47d)[_0x129b('0x2e')](_0x3a852a);};}exports[_0x129b('0x2f')]=function(_0x917382,_0x1aed6e){var _0x296461={},_0x2906ef={},_0x371e89={'count':0x0,'rows':[]};var _0x501e01=_[_0x129b('0x30')](db[_0x129b('0x31')]['rawAttributes'],function(_0x1bf137){return{'name':_0x1bf137[_0x129b('0x32')],'type':_0x1bf137[_0x129b('0x33')]['key']};});_0x2906ef[_0x129b('0x34')]=_[_0x129b('0x30')](_0x501e01,'name');_0x2906ef['query']=_[_0x129b('0x35')](_0x917382['query']);_0x2906ef[_0x129b('0x36')]=_['intersection'](_0x2906ef[_0x129b('0x34')],_0x2906ef[_0x129b('0x37')]);_0x296461['attributes']=_[_0x129b('0x38')](_0x2906ef[_0x129b('0x34')],qs[_0x129b('0x39')](_0x917382['query'][_0x129b('0x39')]));_0x296461[_0x129b('0x3a')]=_0x296461[_0x129b('0x3a')][_0x129b('0x3b')]?_0x296461['attributes']:_0x2906ef['model'];if(!_0x917382[_0x129b('0x37')][_0x129b('0x3c')]('nolimit')){_0x296461[_0x129b('0x1f')]=qs[_0x129b('0x1f')](_0x917382[_0x129b('0x37')]['limit']);_0x296461['offset']=qs[_0x129b('0x1d')](_0x917382[_0x129b('0x37')][_0x129b('0x1d')]);}_0x296461['order']=qs[_0x129b('0x3d')](_0x917382[_0x129b('0x37')]['sort']);_0x296461[_0x129b('0x3e')]=qs[_0x129b('0x36')](_['pick'](_0x917382['query'],_0x2906ef[_0x129b('0x36')]),_0x501e01);if(_0x917382[_0x129b('0x37')][_0x129b('0x3f')]){_0x296461[_0x129b('0x3e')]=_[_0x129b('0x40')](_0x296461[_0x129b('0x3e')],{'$or':_[_0x129b('0x30')](_0x501e01,function(_0x5700b3){if(_0x5700b3['type']!==_0x129b('0x41')){var _0x5592c5={};_0x5592c5[_0x5700b3[_0x129b('0x2d')]]={'$like':'%'+_0x917382[_0x129b('0x37')][_0x129b('0x3f')]+'%'};return _0x5592c5;}})});}_0x296461=_[_0x129b('0x40')]({},_0x296461,_0x917382[_0x129b('0x42')]);var _0x9ce04c={'where':_0x296461['where']};return db['JscriptyProject'][_0x129b('0x20')](_0x9ce04c)['then'](function(_0x252b55){_0x371e89[_0x129b('0x20')]=_0x252b55;if(_0x917382[_0x129b('0x37')][_0x129b('0x43')]){_0x296461['include']=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x296461);})[_0x129b('0x28')](function(_0x4bbd59){_0x371e89[_0x129b('0x44')]=_0x4bbd59;return _0x371e89;})['then'](respondWithFilteredResult(_0x1aed6e,_0x296461))[_0x129b('0x45')](handleError(_0x1aed6e,null));};exports['show']=function(_0x18aed9,_0x334d87){var _0x10fcd4={'raw':![],'where':{'id':_0x18aed9[_0x129b('0x46')]['id']}},_0x3e24b3={};_0x3e24b3[_0x129b('0x34')]=_['keys'](db['JscriptyProject']['rawAttributes']);_0x3e24b3[_0x129b('0x37')]=_[_0x129b('0x35')](_0x18aed9[_0x129b('0x37')]);_0x3e24b3['filters']=_['intersection'](_0x3e24b3[_0x129b('0x34')],_0x3e24b3[_0x129b('0x37')]);_0x10fcd4[_0x129b('0x3a')]=_[_0x129b('0x38')](_0x3e24b3[_0x129b('0x34')],qs[_0x129b('0x39')](_0x18aed9['query'][_0x129b('0x39')]));_0x10fcd4[_0x129b('0x3a')]=_0x10fcd4['attributes'][_0x129b('0x3b')]?_0x10fcd4[_0x129b('0x3a')]:_0x3e24b3[_0x129b('0x34')];if(_0x18aed9[_0x129b('0x37')][_0x129b('0x43')]){_0x10fcd4[_0x129b('0x47')]=[{'all':!![]}];}_0x10fcd4=_[_0x129b('0x40')]({},_0x10fcd4,_0x18aed9[_0x129b('0x42')]);return db[_0x129b('0x31')][_0x129b('0x48')](_0x10fcd4)[_0x129b('0x28')](handleEntityNotFound(_0x334d87,null))[_0x129b('0x28')](respondWithResult(_0x334d87,null))[_0x129b('0x45')](handleError(_0x334d87,null));};exports[_0x129b('0x49')]=function(_0x11a582,_0x2c2f02){return db[_0x129b('0x31')][_0x129b('0x49')](_0x11a582[_0x129b('0x4a')],{})[_0x129b('0x28')](function(_0x4872fc){var _0xb1e56e=_0x11a582[_0x129b('0x4b')][_0x129b('0x2a')]({'plain':!![]});if(!_0xb1e56e)throw new Error(_0x129b('0x4c'));if(_0xb1e56e['role']==='user'){var _0xc0a915=_0x4872fc[_0x129b('0x2a')]({'plain':!![]});var _0x11e5dd='Projects';return db['UserProfileSection'][_0x129b('0x48')]({'where':{'name':_0x11e5dd,'userProfileId':_0xb1e56e[_0x129b('0x4d')]},'raw':!![]})['then'](function(_0x2cdfd4){if(_0x2cdfd4&&_0x2cdfd4[_0x129b('0x4e')]===0x0){return db[_0x129b('0x2b')]['create']({'name':_0xc0a915[_0x129b('0x2d')],'resourceId':_0xc0a915['id'],'type':_0x2cdfd4[_0x129b('0x2d')],'sectionId':_0x2cdfd4['id']},{})[_0x129b('0x28')](function(){return _0x4872fc;});}else{return _0x4872fc;}})[_0x129b('0x45')](function(_0x49bda0){logger['error'](_0x129b('0x4f'),_0x49bda0);throw _0x49bda0;});}return _0x4872fc;})[_0x129b('0x28')](respondWithResult(_0x2c2f02,0xc9))[_0x129b('0x45')](handleError(_0x2c2f02,null));};exports[_0x129b('0x50')]=function(_0x345c7f,_0x4975d3){var _0x9c750={'where':{'id':_0x345c7f[_0x129b('0x46')]['id']}},_0xe8f471={};_0xe8f471[_0x129b('0x34')]=_[_0x129b('0x35')](db[_0x129b('0x31')][_0x129b('0x51')]);_0x9c750[_0x129b('0x3a')]=_[_0x129b('0x38')](_0xe8f471[_0x129b('0x34')],qs[_0x129b('0x39')](_0x345c7f[_0x129b('0x37')][_0x129b('0x39')]));_0x9c750[_0x129b('0x3a')]=_0x9c750[_0x129b('0x3a')][_0x129b('0x3b')]?_0x9c750[_0x129b('0x3a')]:_0xe8f471['model'];if(_0x345c7f[_0x129b('0x37')][_0x129b('0x43')]){_0x9c750[_0x129b('0x47')]=[{'all':!![]}];}_0x9c750=_[_0x129b('0x40')]({},_0x9c750,_0x345c7f[_0x129b('0x42')]);return db[_0x129b('0x31')][_0x129b('0x48')](_0x9c750)[_0x129b('0x28')](handleEntityNotFound(_0x4975d3,null))['then'](function(_0x2ad88c){if(_0x2ad88c){var _0x5937f5=_0x2ad88c[_0x129b('0x2a')]({'plain':!![]});_0x5937f5=qs['omit'](_0x5937f5,['id','createdAt','updatedAt']);_0x345c7f[_0x129b('0x4a')]=_['omit'](_0x345c7f[_0x129b('0x4a')],['id',_0x129b('0x52'),_0x129b('0x53')]);return db[_0x129b('0x31')][_0x129b('0x49')](_[_0x129b('0x40')](_0x5937f5,_0x345c7f[_0x129b('0x4a')]),{'include':_0x345c7f[_0x129b('0x37')][_0x129b('0x43')]?[{'all':!![]}]:undefined})[_0x129b('0x28')](function(_0x4809ec){var _0x2fc87e=_0x345c7f[_0x129b('0x4b')][_0x129b('0x2a')]({'plain':!![]});if(!_0x2fc87e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fc87e['role']===_0x129b('0x4b')){var _0x46ce56=_0x4809ec[_0x129b('0x2a')]({'plain':!![]});var _0x3a7df3=_0x129b('0x54');return db[_0x129b('0x55')]['find']({'where':{'name':_0x3a7df3,'userProfileId':_0x2fc87e[_0x129b('0x4d')]},'raw':!![]})[_0x129b('0x28')](function(_0x36ed65){if(_0x36ed65&&_0x36ed65[_0x129b('0x4e')]===0x0){return db['UserProfileResource'][_0x129b('0x49')]({'name':_0x46ce56[_0x129b('0x2d')],'resourceId':_0x46ce56['id'],'type':_0x36ed65[_0x129b('0x2d')],'sectionId':_0x36ed65['id']},{})[_0x129b('0x28')](function(){return _0x4809ec;});}else{return _0x4809ec;}})[_0x129b('0x45')](function(_0x20545d){logger['error'](_0x129b('0x4f'),_0x20545d);throw _0x20545d;});}return _0x4809ec;});}})['then'](respondWithResult(_0x4975d3,0xc9))[_0x129b('0x45')](handleError(_0x4975d3,null));};exports['update']=function(_0x10f7f1,_0x37a6eb){if(_0x10f7f1[_0x129b('0x4a')]['id']){delete _0x10f7f1['body']['id'];}return db[_0x129b('0x31')][_0x129b('0x48')]({'where':{'id':_0x10f7f1[_0x129b('0x46')]['id']}})['then'](handleEntityNotFound(_0x37a6eb,null))['then'](saveUpdates(_0x10f7f1[_0x129b('0x4a')],null))[_0x129b('0x28')](respondWithResult(_0x37a6eb,null))['catch'](handleError(_0x37a6eb,null));};exports[_0x129b('0x29')]=function(_0x193e96,_0x3cd85a){return db['JscriptyProject'][_0x129b('0x48')]({'where':{'id':_0x193e96[_0x129b('0x46')]['id']}})[_0x129b('0x28')](handleEntityNotFound(_0x3cd85a,null))['then'](removeEntity(_0x3cd85a,null))[_0x129b('0x45')](handleError(_0x3cd85a,null));};exports[_0x129b('0x56')]=function(_0x42ab53,_0xbc6310,_0x236dc5){var _0x5dd781={'raw':!![],'where':{}};var _0x32cce1={};var _0x516f88={'count':0x0,'rows':[]};return db[_0x129b('0x31')]['findOne']({'where':{'id':_0x42ab53[_0x129b('0x46')]['id']}})[_0x129b('0x28')](handleEntityNotFound(_0xbc6310,null))[_0x129b('0x28')](function(_0xa93c86){if(_0xa93c86){_0x32cce1['model']=_['keys'](db['JscriptySessionReport'][_0x129b('0x51')]);_0x32cce1[_0x129b('0x37')]=_[_0x129b('0x35')](_0x42ab53['query']);_0x32cce1[_0x129b('0x36')]=_[_0x129b('0x38')](_0x32cce1[_0x129b('0x34')],_0x32cce1[_0x129b('0x37')]);_0x5dd781[_0x129b('0x3a')]=_[_0x129b('0x38')](_0x32cce1[_0x129b('0x34')],qs['fields'](_0x42ab53['query'][_0x129b('0x39')]));_0x5dd781[_0x129b('0x3a')]=_0x5dd781['attributes'][_0x129b('0x3b')]?_0x5dd781[_0x129b('0x3a')]:_0x32cce1[_0x129b('0x34')];if(!_0x42ab53[_0x129b('0x37')][_0x129b('0x3c')](_0x129b('0x57'))){_0x5dd781[_0x129b('0x1f')]=qs[_0x129b('0x1f')](_0x42ab53['query']['limit']);_0x5dd781[_0x129b('0x1d')]=qs['offset'](_0x42ab53[_0x129b('0x37')]['offset']);}_0x5dd781[_0x129b('0x58')]=qs[_0x129b('0x3d')](_0x42ab53[_0x129b('0x37')][_0x129b('0x3d')]);_0x5dd781[_0x129b('0x3e')]=qs[_0x129b('0x36')](_[_0x129b('0x59')](_0x42ab53[_0x129b('0x37')],_0x32cce1['filters']));_0x5dd781[_0x129b('0x3e')][_0x129b('0x5a')]=_0xa93c86['id'];if(_0x42ab53[_0x129b('0x37')][_0x129b('0x3f')]){_0x5dd781[_0x129b('0x3e')]=_['merge'](_0x5dd781['where'],{'$or':_['map'](_0x5dd781[_0x129b('0x3a')],function(_0x240a21){var _0x1e753d={};_0x1e753d[_0x240a21]={'$like':'%'+_0x42ab53[_0x129b('0x37')][_0x129b('0x3f')]+'%'};return _0x1e753d;})});}_0x5dd781=_[_0x129b('0x40')]({},_0x5dd781,_0x42ab53[_0x129b('0x42')]);return db[_0x129b('0x5b')][_0x129b('0x20')]({'where':_0x5dd781[_0x129b('0x3e')]})[_0x129b('0x28')](function(_0x2778c8){_0x516f88['count']=_0x2778c8;if(_0x42ab53['query'][_0x129b('0x43')]){_0x5dd781['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x5dd781);})[_0x129b('0x28')](function(_0x248d36){_0x516f88['rows']=_0x248d36;return _0x516f88;});}})[_0x129b('0x28')](respondWithFilteredResult(_0xbc6310,_0x5dd781))[_0x129b('0x45')](handleError(_0xbc6310,null));};exports[_0x129b('0x5c')]=function(_0x2e6b85,_0x407202,_0x349aef){var _0x3fee1c={'raw':!![],'where':{}};var _0x4aa98e={};var _0x2c1024={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x129b('0x5d')]({'where':{'id':_0x2e6b85[_0x129b('0x46')]['id']}})['then'](handleEntityNotFound(_0x407202,null))[_0x129b('0x28')](function(_0x43f508){if(_0x43f508){_0x4aa98e[_0x129b('0x34')]=_[_0x129b('0x35')](db[_0x129b('0x5e')][_0x129b('0x51')]);_0x4aa98e['query']=_[_0x129b('0x35')](_0x2e6b85[_0x129b('0x37')]);_0x4aa98e[_0x129b('0x36')]=_['intersection'](_0x4aa98e[_0x129b('0x34')],_0x4aa98e['query']);_0x3fee1c[_0x129b('0x3a')]=_[_0x129b('0x38')](_0x4aa98e[_0x129b('0x34')],qs[_0x129b('0x39')](_0x2e6b85['query'][_0x129b('0x39')]));_0x3fee1c[_0x129b('0x3a')]=_0x3fee1c[_0x129b('0x3a')][_0x129b('0x3b')]?_0x3fee1c[_0x129b('0x3a')]:_0x4aa98e[_0x129b('0x34')];if(!_0x2e6b85[_0x129b('0x37')][_0x129b('0x3c')]('nolimit')){_0x3fee1c[_0x129b('0x1f')]=qs['limit'](_0x2e6b85[_0x129b('0x37')][_0x129b('0x1f')]);_0x3fee1c['offset']=qs[_0x129b('0x1d')](_0x2e6b85[_0x129b('0x37')][_0x129b('0x1d')]);}_0x3fee1c[_0x129b('0x58')]=qs[_0x129b('0x3d')](_0x2e6b85[_0x129b('0x37')][_0x129b('0x3d')]);_0x3fee1c[_0x129b('0x3e')]=qs[_0x129b('0x36')](_[_0x129b('0x59')](_0x2e6b85[_0x129b('0x37')],_0x4aa98e[_0x129b('0x36')]));_0x3fee1c[_0x129b('0x3e')][_0x129b('0x5a')]=_0x43f508['id'];if(_0x2e6b85[_0x129b('0x37')][_0x129b('0x3f')]){_0x3fee1c[_0x129b('0x3e')]=_[_0x129b('0x40')](_0x3fee1c['where'],{'$or':_[_0x129b('0x30')](_0x3fee1c['attributes'],function(_0x49c53c){var _0x14cfef={};_0x14cfef[_0x49c53c]={'$like':'%'+_0x2e6b85[_0x129b('0x37')][_0x129b('0x3f')]+'%'};return _0x14cfef;})});}_0x3fee1c=_[_0x129b('0x40')]({},_0x3fee1c,_0x2e6b85[_0x129b('0x42')]);return db[_0x129b('0x5e')][_0x129b('0x20')]({'where':_0x3fee1c[_0x129b('0x3e')]})[_0x129b('0x28')](function(_0x52e635){_0x2c1024[_0x129b('0x20')]=_0x52e635;if(_0x2e6b85[_0x129b('0x37')]['includeAll']){_0x3fee1c[_0x129b('0x47')]=[{'all':!![]}];}return db[_0x129b('0x5e')][_0x129b('0x5f')](_0x3fee1c);})[_0x129b('0x28')](function(_0x2afd6d){_0x2c1024[_0x129b('0x44')]=_0x2afd6d;return _0x2c1024;});}})['then'](respondWithFilteredResult(_0x407202,_0x3fee1c))['catch'](handleError(_0x407202,null));};function char(_0x31fdc1){return _0x129b('0x60')===typeof _0x31fdc1?String[_0x129b('0x61')]['apply'](null,arguments):_0x31fdc1;}function needsEncapsulation(_0x5ea572){return!!_0x5ea572&&(_0x5ea572['toString']()[_0x129b('0x62')](char(0xd))>=0x0||_0x5ea572[_0x129b('0x63')]()[_0x129b('0x62')](char(0xa))>=0x0||_0x5ea572[_0x129b('0x63')]()[_0x129b('0x62')](char(0x2c))>=0x0||_0x5ea572[_0x129b('0x63')]()[_0x129b('0x62')](char(0x22))>=0x0);}function encapsulate(_0x279906){var _0x583eba=char(0x22),_0x2123ee='\x5c'+char(0x22),_0x114160=_0x279906[_0x129b('0x63')]()[_0x129b('0x64')](new RegExp(_0x583eba,'g'),_0x2123ee);return _0x583eba+_0x114160+_0x583eba;}exports[_0x129b('0x65')]=function(_0x26df44,_0x5155ac,_0x5a90d1){var _0xd0e13f,_0x4c013d;var _0x11c19c={'where':{'ProjectId':_0x26df44['params']['id']}};if(_0x26df44[_0x129b('0x37')][_0x129b('0x66')]){_0x11c19c[_0x129b('0x3e')][_0x129b('0x67')]=JSON[_0x129b('0x68')](_0x26df44[_0x129b('0x37')]['startTime']);}return db['JscriptySessionReport'][_0x129b('0x5f')](_0x11c19c)[_0x129b('0x28')](handleEntityNotFound(_0x5155ac,null))[_0x129b('0x28')](function(_0x440498){if(_0x440498){_0xd0e13f=_0x440498;return db[_0x129b('0x69')][_0x129b('0x5f')]({'where':{'SessionId':{'$in':_[_0x129b('0x30')](_0xd0e13f,'id')},'ProjectId':_0x26df44[_0x129b('0x46')]['id']},'order':_0x129b('0x6a')});}})[_0x129b('0x28')](handleEntityNotFound(_0x5155ac,null))['then'](function(_0x3f52bc){if(_0x3f52bc){_0x4c013d=_0x3f52bc;var _0x73e128={};for(var _0xe061f6=0x0,_0x4353b2=_0x4c013d['length'];_0xe061f6<_0x4353b2;_0xe061f6++){if(!_0x73e128['hasOwnProperty'](_0x4c013d[_0xe061f6][_0x129b('0x6b')])){_0x73e128[_0x4c013d[_0xe061f6]['questionId']]=needsEncapsulation(_0x4c013d[_0xe061f6][_0x129b('0x6c')])?encapsulate(_0x4c013d[_0xe061f6][_0x129b('0x6c')]):_0x4c013d[_0xe061f6][_0x129b('0x6c')];}}var _0x5e2f0c=[],_0x234f64={};for(var _0x53cc45=0x0,_0x2fc4dc=_0xd0e13f[_0x129b('0x3b')];_0x53cc45<_0x2fc4dc;_0x53cc45++){_0x234f64={'ProjectId':_0x26df44[_0x129b('0x46')]['id'],'SessionId':_0xd0e13f[_0x53cc45]['id'],'StartTime':moment(_0xd0e13f[_0x53cc45][_0x129b('0x67')])[_0x129b('0x6d')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x27bdcf=0x0,_0x133012=_0x4c013d[_0x129b('0x3b')];_0x27bdcf<_0x133012;_0x27bdcf++){if(_0x4c013d[_0x27bdcf][_0x129b('0x6e')]==_0xd0e13f[_0x53cc45]['id']&&_0x73e128['hasOwnProperty'](_0x4c013d[_0x27bdcf][_0x129b('0x6b')])){_0x234f64[_0x73e128[_0x4c013d[_0x27bdcf]['questionId']]]=_0x4c013d[_0x27bdcf][_0x129b('0x6f')];}}for(var _0x4544a8 in _0x73e128){if(!_0x234f64[_0x129b('0x3c')](_0x73e128[_0x4544a8])){_0x234f64[_0x73e128[_0x4544a8]]=null;}}_0x5e2f0c[_0x129b('0x70')](_0x234f64);}return _0x5e2f0c;}})[_0x129b('0x28')](function(_0x16ce2f){if(!_[_0x129b('0x71')](_0x16ce2f)){var _0x183aa5=toCsv(_0x16ce2f);var _0x34b095=Date[_0x129b('0x72')]();fs['writeFileSync'](util[_0x129b('0x6d')](_0x129b('0x73'),_0x26df44[_0x129b('0x46')]['id'],_0x34b095),_0x183aa5);_0x5155ac[_0x129b('0x74')](_0x129b('0x75'),_0x129b('0x76')+util[_0x129b('0x6d')](_0x129b('0x77'),_0x26df44[_0x129b('0x46')]['id'],_0x34b095));_0x5155ac[_0x129b('0x74')]('Content-type',_0x129b('0x78'));return _0x5155ac['download'](util['format'](_0x129b('0x73'),_0x26df44[_0x129b('0x46')]['id'],_0x34b095));}else{return _0x5155ac[_0x129b('0x1a')](0xcc);}})[_0x129b('0x45')](handleError(_0x5155ac,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 1055ff0..eaeb6ee 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 _0xa049=['path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','api','moment','bluebird','request-promise'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa049,0x1db));var _0x9a04=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0xa049[_0x18b344];return _0x5ef6bb;};'use strict';var _=require(_0x9a04('0x0'));var util=require(_0x9a04('0x1'));var logger=require('../../config/logger')(_0x9a04('0x2'));var moment=require(_0x9a04('0x3'));var BPromise=require(_0x9a04('0x4'));var rp=require(_0x9a04('0x5'));var fs=require('fs');var path=require(_0x9a04('0x6'));var rimraf=require(_0x9a04('0x7'));var config=require(_0x9a04('0x8'));var attributes=require(_0x9a04('0x9'));module[_0x9a04('0xa')]=function(_0x570be2,_0x3cacca){return _0x570be2[_0x9a04('0xb')]('JscriptyProject',attributes,{'tableName':_0x9a04('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc01b=['exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xc01b,0x74));var _0xbc01=function(_0x18b0e9,_0x59039e){_0x18b0e9=_0x18b0e9-0x0;var _0x5b2e91=_0xc01b[_0x18b0e9];return _0x5b2e91;};'use strict';var _=require(_0xbc01('0x0'));var util=require(_0xbc01('0x1'));var logger=require(_0xbc01('0x2'))(_0xbc01('0x3'));var moment=require(_0xbc01('0x4'));var BPromise=require(_0xbc01('0x5'));var rp=require(_0xbc01('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc01('0x7'));var config=require(_0xbc01('0x8'));var attributes=require(_0xbc01('0x9'));module[_0xbc01('0xa')]=function(_0x279549,_0xdfa6b6){return _0x279549[_0xbc01('0xb')](_0xbc01('0xc'),attributes,{'tableName':_0xbc01('0xd'),'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 e56bac2..8408443 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 _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3b2262,_0x36c269){var _0xb85f96=function(_0x3892f3){while(--_0x3892f3){_0x3b2262['push'](_0x3b2262['shift']());}};_0xb85f96(++_0x36c269);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x37b22c,_0x5abaae){var _0x3bd41f=function(_0x2b06ba){while(--_0x2b06ba){_0x37b22c['push'](_0x37b22c['shift']());}};_0x3bd41f(++_0x5abaae);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index c9ece55..85c8524 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 _0x0993=['describe','/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated'];(function(_0x481c9e,_0x1e6dd9){var _0x1127ff=function(_0x2301c8){while(--_0x2301c8){_0x481c9e['push'](_0x481c9e['shift']());}};_0x1127ff(++_0x1e6dd9);}(_0x0993,0x12e));var _0x3099=function(_0x27573e,_0x29d585){_0x27573e=_0x27573e-0x0;var _0x1d62f8=_0x0993[_0x27573e];return _0x1d62f8;};'use strict';var multer=require(_0x3099('0x0'));var util=require(_0x3099('0x1'));var path=require('path');var timeout=require(_0x3099('0x2'));var express=require(_0x3099('0x3'));var router=express[_0x3099('0x4')]();var fs_extra=require(_0x3099('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3099('0x6'));var config=require(_0x3099('0x7'));var controller=require(_0x3099('0x8'));router[_0x3099('0x9')]('/',auth['isAuthenticated'](),controller[_0x3099('0xa')]);router[_0x3099('0x9')](_0x3099('0xb'),auth[_0x3099('0xc')](),controller[_0x3099('0xd')]);router['get'](_0x3099('0xe'),auth['isAuthenticated'](),controller[_0x3099('0xf')]);router['post']('/',auth[_0x3099('0xc')](),controller[_0x3099('0x10')]);router[_0x3099('0x11')](_0x3099('0xe'),auth[_0x3099('0xc')](),controller[_0x3099('0x12')]);router[_0x3099('0x13')](_0x3099('0xe'),auth[_0x3099('0xc')](),controller[_0x3099('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc420=['fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','path','connect-timeout','Router'];(function(_0x4c218f,_0x4fd09a){var _0x35b441=function(_0x99403){while(--_0x99403){_0x4c218f['push'](_0x4c218f['shift']());}};_0x35b441(++_0x4fd09a);}(_0xc420,0x9f));var _0x0c42=function(_0xd3e39e,_0x84e46f){_0xd3e39e=_0xd3e39e-0x0;var _0x1f9d75=_0xc420[_0xd3e39e];return _0x1f9d75;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0c42('0x0'));var timeout=require(_0x0c42('0x1'));var express=require('express');var router=express[_0x0c42('0x2')]();var fs_extra=require(_0x0c42('0x3'));var auth=require(_0x0c42('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0c42('0x5'));var controller=require(_0x0c42('0x6'));router[_0x0c42('0x7')]('/',auth[_0x0c42('0x8')](),controller[_0x0c42('0x9')]);router[_0x0c42('0x7')](_0x0c42('0xa'),auth['isAuthenticated'](),controller[_0x0c42('0xb')]);router[_0x0c42('0x7')](_0x0c42('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x0c42('0xd')]('/',auth[_0x0c42('0x8')](),controller[_0x0c42('0xe')]);router[_0x0c42('0xf')](_0x0c42('0xc'),auth[_0x0c42('0x8')](),controller[_0x0c42('0x10')]);router[_0x0c42('0x11')](_0x0c42('0xc'),auth[_0x0c42('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 90818be..7da51ac 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(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7a54,0x106));var _0x47a5=function(_0x35bb4d,_0x2bb602){_0x35bb4d=_0x35bb4d-0x0;var _0x92ba28=_0x7a54[_0x35bb4d];return _0x92ba28;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7a54,0x106));var _0x47a5=function(_0x813c1f,_0x5243e7){_0x813c1f=_0x813c1f-0x0;var _0x2c1d89=_0x7a54[_0x813c1f];return _0x2c1d89;};'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 dc44d77..fe1db9c 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 _0xe684=['save','update','destroy','then','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','catch','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x457cea,_0x406b93){var _0x28929f=function(_0xed7f1){while(--_0xed7f1){_0x457cea['push'](_0x457cea['shift']());}};_0x28929f(++_0x406b93);}(_0xe684,0x77));var _0x4e68=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xe684[_0x1ae5ab];return _0x1ce001;};'use strict';var emlformat=require(_0x4e68('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e68('0x1'));var jsonpatch=require(_0x4e68('0x2'));var rp=require(_0x4e68('0x3'));var moment=require(_0x4e68('0x4'));var BPromise=require(_0x4e68('0x5'));var Mustache=require(_0x4e68('0x6'));var util=require(_0x4e68('0x7'));var path=require(_0x4e68('0x8'));var sox=require(_0x4e68('0x9'));var csv=require(_0x4e68('0xa'));var ejs=require(_0x4e68('0xb'));var fs=require('fs');var fs_extra=require(_0x4e68('0xc'));var _=require('lodash');var squel=require(_0x4e68('0xd'));var crypto=require('crypto');var jsforce=require(_0x4e68('0xe'));var deskjs=require(_0x4e68('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4e68('0x10'));var Papa=require(_0x4e68('0x11'));var Redis=require('ioredis');var authService=require(_0x4e68('0x12'));var qs=require(_0x4e68('0x13'));var as=require(_0x4e68('0x14'));var hardwareService=require(_0x4e68('0x15'));var logger=require(_0x4e68('0x16'))('api');var utils=require(_0x4e68('0x17'));var config=require(_0x4e68('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4e68('0x19'))['db'];function respondWithStatusCode(_0x4239e2,_0x2dead9){_0x2dead9=_0x2dead9||0xcc;return function(_0x213c5e){if(_0x213c5e){return _0x4239e2[_0x4e68('0x1a')](_0x2dead9);}return _0x4239e2['status'](_0x2dead9)[_0x4e68('0x1b')]();};}function respondWithResult(_0x504356,_0x4d7346){_0x4d7346=_0x4d7346||0xc8;return function(_0x190b02){if(_0x190b02){return _0x504356[_0x4e68('0x1c')](_0x4d7346)[_0x4e68('0x1d')](_0x190b02);}};}function respondWithFilteredResult(_0x14462c,_0x13be50){return function(_0x1fc69b){if(_0x1fc69b){var _0x5b2256=typeof _0x13be50[_0x4e68('0x1e')]===_0x4e68('0x1f')&&typeof _0x13be50[_0x4e68('0x20')]===_0x4e68('0x1f');var _0x9d8848=_0x1fc69b[_0x4e68('0x21')];var _0x10e965=_0x5b2256?0x0:_0x13be50[_0x4e68('0x1e')];var _0x3494f4=_0x5b2256?_0x1fc69b['count']:_0x13be50['offset']+_0x13be50[_0x4e68('0x20')];var _0x1568b2;if(_0x3494f4>=_0x9d8848){_0x3494f4=_0x9d8848;_0x1568b2=0xc8;}else{_0x1568b2=0xce;}_0x14462c['status'](_0x1568b2);return _0x14462c[_0x4e68('0x22')](_0x4e68('0x23'),_0x10e965+'-'+_0x3494f4+'/'+_0x9d8848)['json'](_0x1fc69b);}return null;};}function patchUpdates(_0x22f8c2){return function(_0x409761){try{jsonpatch[_0x4e68('0x24')](_0x409761,_0x22f8c2,!![]);}catch(_0x1fe706){return BPromise['reject'](_0x1fe706);}return _0x409761[_0x4e68('0x25')]();};}function saveUpdates(_0x2ee600,_0x12d121){return function(_0x2615c7){if(_0x2615c7){return _0x2615c7[_0x4e68('0x26')](_0x2ee600)['then'](function(_0x505886){return _0x505886;});}return null;};}function removeEntity(_0xe921c9,_0x49d7e){return function(_0x51f893){if(_0x51f893){return _0x51f893[_0x4e68('0x27')]()[_0x4e68('0x28')](function(){_0xe921c9[_0x4e68('0x1c')](0xcc)[_0x4e68('0x1b')]();});}};}function handleEntityNotFound(_0x3188e5,_0x53237f){return function(_0x49367a){if(!_0x49367a){_0x3188e5[_0x4e68('0x1a')](0x194);}return _0x49367a;};}function handleError(_0x44afcc,_0x4695e4){_0x4695e4=_0x4695e4||0x1f4;return function(_0x11ec76){logger[_0x4e68('0x29')](_0x11ec76[_0x4e68('0x2a')]);if(_0x11ec76['name']){delete _0x11ec76[_0x4e68('0x2b')];}_0x44afcc[_0x4e68('0x1c')](_0x4695e4)['send'](_0x11ec76);};}exports[_0x4e68('0x2c')]=function(_0x54b0b5,_0x59d19f){var _0x22634a={},_0x2dd932={},_0x28fba7={'count':0x0,'rows':[]};var _0x5bf1db=_[_0x4e68('0x2d')](db[_0x4e68('0x2e')][_0x4e68('0x2f')],function(_0x2159c6){return{'name':_0x2159c6['fieldName'],'type':_0x2159c6[_0x4e68('0x30')][_0x4e68('0x31')]};});_0x2dd932[_0x4e68('0x32')]=_[_0x4e68('0x2d')](_0x5bf1db,_0x4e68('0x2b'));_0x2dd932[_0x4e68('0x33')]=_[_0x4e68('0x34')](_0x54b0b5[_0x4e68('0x33')]);_0x2dd932[_0x4e68('0x35')]=_['intersection'](_0x2dd932['model'],_0x2dd932[_0x4e68('0x33')]);_0x22634a['attributes']=_['intersection'](_0x2dd932['model'],qs[_0x4e68('0x36')](_0x54b0b5[_0x4e68('0x33')][_0x4e68('0x36')]));_0x22634a['attributes']=_0x22634a[_0x4e68('0x37')][_0x4e68('0x38')]?_0x22634a[_0x4e68('0x37')]:_0x2dd932[_0x4e68('0x32')];if(!_0x54b0b5['query'][_0x4e68('0x39')](_0x4e68('0x3a'))){_0x22634a[_0x4e68('0x20')]=qs[_0x4e68('0x20')](_0x54b0b5[_0x4e68('0x33')]['limit']);_0x22634a[_0x4e68('0x1e')]=qs[_0x4e68('0x1e')](_0x54b0b5['query'][_0x4e68('0x1e')]);}_0x22634a[_0x4e68('0x3b')]=qs[_0x4e68('0x3c')](_0x54b0b5[_0x4e68('0x33')][_0x4e68('0x3c')]);_0x22634a[_0x4e68('0x3d')]=qs[_0x4e68('0x35')](_[_0x4e68('0x3e')](_0x54b0b5['query'],_0x2dd932[_0x4e68('0x35')]),_0x5bf1db);if(_0x54b0b5[_0x4e68('0x33')][_0x4e68('0x3f')]){_0x22634a[_0x4e68('0x3d')]=_[_0x4e68('0x40')](_0x22634a[_0x4e68('0x3d')],{'$or':_[_0x4e68('0x2d')](_0x5bf1db,function(_0xcf4f23){if(_0xcf4f23[_0x4e68('0x30')]!==_0x4e68('0x41')){var _0x82f2b2={};_0x82f2b2[_0xcf4f23[_0x4e68('0x2b')]]={'$like':'%'+_0x54b0b5['query'][_0x4e68('0x3f')]+'%'};return _0x82f2b2;}})});}_0x22634a=_[_0x4e68('0x40')]({},_0x22634a,_0x54b0b5[_0x4e68('0x42')]);var _0xb0db6e={'where':_0x22634a[_0x4e68('0x3d')]};return db[_0x4e68('0x2e')][_0x4e68('0x21')](_0xb0db6e)['then'](function(_0x225100){_0x28fba7[_0x4e68('0x21')]=_0x225100;if(_0x54b0b5[_0x4e68('0x33')][_0x4e68('0x43')]){_0x22634a[_0x4e68('0x44')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x4e68('0x45')](_0x22634a);})[_0x4e68('0x28')](function(_0x3f5bb8){_0x28fba7[_0x4e68('0x46')]=_0x3f5bb8;return _0x28fba7;})[_0x4e68('0x28')](respondWithFilteredResult(_0x59d19f,_0x22634a))['catch'](handleError(_0x59d19f,null));};exports[_0x4e68('0x47')]=function(_0x27790d,_0x22ca1a){var _0x89c8ed={'raw':!![],'where':{'id':_0x27790d[_0x4e68('0x48')]['id']}},_0x29d829={};_0x29d829[_0x4e68('0x32')]=_[_0x4e68('0x34')](db[_0x4e68('0x2e')][_0x4e68('0x2f')]);_0x29d829[_0x4e68('0x33')]=_['keys'](_0x27790d[_0x4e68('0x33')]);_0x29d829[_0x4e68('0x35')]=_[_0x4e68('0x49')](_0x29d829[_0x4e68('0x32')],_0x29d829[_0x4e68('0x33')]);_0x89c8ed[_0x4e68('0x37')]=_[_0x4e68('0x49')](_0x29d829['model'],qs[_0x4e68('0x36')](_0x27790d[_0x4e68('0x33')][_0x4e68('0x36')]));_0x89c8ed[_0x4e68('0x37')]=_0x89c8ed[_0x4e68('0x37')][_0x4e68('0x38')]?_0x89c8ed[_0x4e68('0x37')]:_0x29d829[_0x4e68('0x32')];if(_0x27790d[_0x4e68('0x33')]['includeAll']){_0x89c8ed[_0x4e68('0x44')]=[{'all':!![]}];}_0x89c8ed=_[_0x4e68('0x40')]({},_0x89c8ed,_0x27790d[_0x4e68('0x42')]);return db[_0x4e68('0x2e')]['find'](_0x89c8ed)[_0x4e68('0x28')](handleEntityNotFound(_0x22ca1a,null))[_0x4e68('0x28')](respondWithResult(_0x22ca1a,null))[_0x4e68('0x4a')](handleError(_0x22ca1a,null));};exports['create']=function(_0x965303,_0x1235d4){return db[_0x4e68('0x2e')]['create'](_0x965303[_0x4e68('0x4b')],{})[_0x4e68('0x28')](respondWithResult(_0x1235d4,0xc9))[_0x4e68('0x4a')](handleError(_0x1235d4,null));};exports[_0x4e68('0x26')]=function(_0x3185cf,_0x595c11){if(_0x3185cf[_0x4e68('0x4b')]['id']){delete _0x3185cf[_0x4e68('0x4b')]['id'];}return db[_0x4e68('0x2e')][_0x4e68('0x4c')]({'where':{'id':_0x3185cf[_0x4e68('0x48')]['id']}})[_0x4e68('0x28')](handleEntityNotFound(_0x595c11,null))['then'](saveUpdates(_0x3185cf['body'],null))[_0x4e68('0x28')](respondWithResult(_0x595c11,null))[_0x4e68('0x4a')](handleError(_0x595c11,null));};exports[_0x4e68('0x27')]=function(_0xb91c31,_0x3f0a9d){return db[_0x4e68('0x2e')]['find']({'where':{'id':_0xb91c31[_0x4e68('0x48')]['id']}})[_0x4e68('0x28')](handleEntityNotFound(_0x3f0a9d,null))[_0x4e68('0x28')](removeEntity(_0x3f0a9d,null))[_0x4e68('0x4a')](handleError(_0x3f0a9d,null));};exports[_0x4e68('0x4d')]=function(_0x2ae8c7,_0x2d3309){return db[_0x4e68('0x2e')][_0x4e68('0x4d')]()['then'](respondWithResult(_0x2d3309,null))['catch'](handleError(_0x2d3309,null));}; \ No newline at end of file +var _0x89cc=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','set','apply','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','keys','includeAll','options','find','create','body','eml-format'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x89cc,0x171));var _0xc89c=function(_0x5dbf25,_0x2ebeca){_0x5dbf25=_0x5dbf25-0x0;var _0x420ae2=_0x89cc[_0x5dbf25];return _0x420ae2;};'use strict';var emlformat=require(_0xc89c('0x0'));var rimraf=require(_0xc89c('0x1'));var zipdir=require(_0xc89c('0x2'));var jsonpatch=require(_0xc89c('0x3'));var rp=require(_0xc89c('0x4'));var moment=require(_0xc89c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc89c('0x6'));var util=require(_0xc89c('0x7'));var path=require('path');var sox=require(_0xc89c('0x8'));var csv=require(_0xc89c('0x9'));var ejs=require(_0xc89c('0xa'));var fs=require('fs');var fs_extra=require(_0xc89c('0xb'));var _=require('lodash');var squel=require(_0xc89c('0xc'));var crypto=require('crypto');var jsforce=require(_0xc89c('0xd'));var deskjs=require(_0xc89c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc89c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc89c('0x10'));var qs=require(_0xc89c('0x11'));var as=require(_0xc89c('0x12'));var hardwareService=require(_0xc89c('0x13'));var logger=require(_0xc89c('0x14'))(_0xc89c('0x15'));var utils=require('../../config/utils');var config=require(_0xc89c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc89c('0x17'))['db'];function respondWithStatusCode(_0x58c4b1,_0x5c065e){_0x5c065e=_0x5c065e||0xcc;return function(_0x53ac57){if(_0x53ac57){return _0x58c4b1['sendStatus'](_0x5c065e);}return _0x58c4b1[_0xc89c('0x18')](_0x5c065e)[_0xc89c('0x19')]();};}function respondWithResult(_0x519fad,_0x12003f){_0x12003f=_0x12003f||0xc8;return function(_0x123567){if(_0x123567){return _0x519fad['status'](_0x12003f)[_0xc89c('0x1a')](_0x123567);}};}function respondWithFilteredResult(_0x41acd5,_0x1d17d2){return function(_0x5c986f){if(_0x5c986f){var _0x496121=typeof _0x1d17d2[_0xc89c('0x1b')]===_0xc89c('0x1c')&&typeof _0x1d17d2['limit']===_0xc89c('0x1c');var _0x104cfd=_0x5c986f[_0xc89c('0x1d')];var _0x2bd939=_0x496121?0x0:_0x1d17d2[_0xc89c('0x1b')];var _0x35e681=_0x496121?_0x5c986f[_0xc89c('0x1d')]:_0x1d17d2[_0xc89c('0x1b')]+_0x1d17d2['limit'];var _0x3e0bae;if(_0x35e681>=_0x104cfd){_0x35e681=_0x104cfd;_0x3e0bae=0xc8;}else{_0x3e0bae=0xce;}_0x41acd5[_0xc89c('0x18')](_0x3e0bae);return _0x41acd5[_0xc89c('0x1e')]('Content-Range',_0x2bd939+'-'+_0x35e681+'/'+_0x104cfd)['json'](_0x5c986f);}return null;};}function patchUpdates(_0x3ee5e1){return function(_0x3d0780){try{jsonpatch[_0xc89c('0x1f')](_0x3d0780,_0x3ee5e1,!![]);}catch(_0x47d63b){return BPromise['reject'](_0x47d63b);}return _0x3d0780[_0xc89c('0x20')]();};}function saveUpdates(_0x4edf8e,_0x508624){return function(_0x21e522){if(_0x21e522){return _0x21e522[_0xc89c('0x21')](_0x4edf8e)['then'](function(_0x1235d8){return _0x1235d8;});}return null;};}function removeEntity(_0x416a3f,_0x8b4802){return function(_0x2510ac){if(_0x2510ac){return _0x2510ac[_0xc89c('0x22')]()[_0xc89c('0x23')](function(){_0x416a3f[_0xc89c('0x18')](0xcc)[_0xc89c('0x19')]();});}};}function handleEntityNotFound(_0x13780c,_0x9c89f9){return function(_0x1c7362){if(!_0x1c7362){_0x13780c[_0xc89c('0x24')](0x194);}return _0x1c7362;};}function handleError(_0x2c6fcf,_0x3d1e8c){_0x3d1e8c=_0x3d1e8c||0x1f4;return function(_0x42f401){logger[_0xc89c('0x25')](_0x42f401[_0xc89c('0x26')]);if(_0x42f401[_0xc89c('0x27')]){delete _0x42f401['name'];}_0x2c6fcf[_0xc89c('0x18')](_0x3d1e8c)[_0xc89c('0x28')](_0x42f401);};}exports[_0xc89c('0x29')]=function(_0x4c0bb8,_0x12bf7d){var _0x39861f={},_0x1e7c12={},_0x5417bd={'count':0x0,'rows':[]};var _0x53dddd=_[_0xc89c('0x2a')](db[_0xc89c('0x2b')][_0xc89c('0x2c')],function(_0x1e0e5e){return{'name':_0x1e0e5e[_0xc89c('0x2d')],'type':_0x1e0e5e[_0xc89c('0x2e')][_0xc89c('0x2f')]};});_0x1e7c12[_0xc89c('0x30')]=_['map'](_0x53dddd,_0xc89c('0x27'));_0x1e7c12[_0xc89c('0x31')]=_['keys'](_0x4c0bb8[_0xc89c('0x31')]);_0x1e7c12[_0xc89c('0x32')]=_[_0xc89c('0x33')](_0x1e7c12[_0xc89c('0x30')],_0x1e7c12[_0xc89c('0x31')]);_0x39861f[_0xc89c('0x34')]=_[_0xc89c('0x33')](_0x1e7c12[_0xc89c('0x30')],qs[_0xc89c('0x35')](_0x4c0bb8[_0xc89c('0x31')][_0xc89c('0x35')]));_0x39861f[_0xc89c('0x34')]=_0x39861f[_0xc89c('0x34')][_0xc89c('0x36')]?_0x39861f[_0xc89c('0x34')]:_0x1e7c12['model'];if(!_0x4c0bb8[_0xc89c('0x31')][_0xc89c('0x37')]('nolimit')){_0x39861f['limit']=qs[_0xc89c('0x38')](_0x4c0bb8[_0xc89c('0x31')]['limit']);_0x39861f[_0xc89c('0x1b')]=qs[_0xc89c('0x1b')](_0x4c0bb8['query'][_0xc89c('0x1b')]);}_0x39861f[_0xc89c('0x39')]=qs['sort'](_0x4c0bb8[_0xc89c('0x31')]['sort']);_0x39861f[_0xc89c('0x3a')]=qs[_0xc89c('0x32')](_[_0xc89c('0x3b')](_0x4c0bb8[_0xc89c('0x31')],_0x1e7c12[_0xc89c('0x32')]),_0x53dddd);if(_0x4c0bb8[_0xc89c('0x31')][_0xc89c('0x3c')]){_0x39861f[_0xc89c('0x3a')]=_[_0xc89c('0x3d')](_0x39861f[_0xc89c('0x3a')],{'$or':_[_0xc89c('0x2a')](_0x53dddd,function(_0x51b98c){if(_0x51b98c[_0xc89c('0x2e')]!==_0xc89c('0x3e')){var _0x14ba02={};_0x14ba02[_0x51b98c['name']]={'$like':'%'+_0x4c0bb8[_0xc89c('0x31')][_0xc89c('0x3c')]+'%'};return _0x14ba02;}})});}_0x39861f=_[_0xc89c('0x3d')]({},_0x39861f,_0x4c0bb8['options']);var _0x3c2f88={'where':_0x39861f[_0xc89c('0x3a')]};return db['JscriptyQuestionReport']['count'](_0x3c2f88)['then'](function(_0x23c6ce){_0x5417bd[_0xc89c('0x1d')]=_0x23c6ce;if(_0x4c0bb8['query']['includeAll']){_0x39861f[_0xc89c('0x3f')]=[{'all':!![]}];}return db[_0xc89c('0x2b')][_0xc89c('0x40')](_0x39861f);})[_0xc89c('0x23')](function(_0x3efa85){_0x5417bd['rows']=_0x3efa85;return _0x5417bd;})[_0xc89c('0x23')](respondWithFilteredResult(_0x12bf7d,_0x39861f))[_0xc89c('0x41')](handleError(_0x12bf7d,null));};exports[_0xc89c('0x42')]=function(_0x470fdd,_0x4c9ac6){var _0xba069f={'raw':!![],'where':{'id':_0x470fdd[_0xc89c('0x43')]['id']}},_0x200563={};_0x200563[_0xc89c('0x30')]=_[_0xc89c('0x44')](db['JscriptyQuestionReport'][_0xc89c('0x2c')]);_0x200563[_0xc89c('0x31')]=_['keys'](_0x470fdd[_0xc89c('0x31')]);_0x200563[_0xc89c('0x32')]=_['intersection'](_0x200563[_0xc89c('0x30')],_0x200563[_0xc89c('0x31')]);_0xba069f['attributes']=_[_0xc89c('0x33')](_0x200563[_0xc89c('0x30')],qs[_0xc89c('0x35')](_0x470fdd['query'][_0xc89c('0x35')]));_0xba069f[_0xc89c('0x34')]=_0xba069f[_0xc89c('0x34')][_0xc89c('0x36')]?_0xba069f[_0xc89c('0x34')]:_0x200563[_0xc89c('0x30')];if(_0x470fdd[_0xc89c('0x31')][_0xc89c('0x45')]){_0xba069f[_0xc89c('0x3f')]=[{'all':!![]}];}_0xba069f=_[_0xc89c('0x3d')]({},_0xba069f,_0x470fdd[_0xc89c('0x46')]);return db[_0xc89c('0x2b')][_0xc89c('0x47')](_0xba069f)[_0xc89c('0x23')](handleEntityNotFound(_0x4c9ac6,null))[_0xc89c('0x23')](respondWithResult(_0x4c9ac6,null))[_0xc89c('0x41')](handleError(_0x4c9ac6,null));};exports[_0xc89c('0x48')]=function(_0x849827,_0x64d3c2){return db[_0xc89c('0x2b')][_0xc89c('0x48')](_0x849827['body'],{})['then'](respondWithResult(_0x64d3c2,0xc9))[_0xc89c('0x41')](handleError(_0x64d3c2,null));};exports[_0xc89c('0x21')]=function(_0x584bd7,_0x19bfff){if(_0x584bd7[_0xc89c('0x49')]['id']){delete _0x584bd7['body']['id'];}return db[_0xc89c('0x2b')]['find']({'where':{'id':_0x584bd7[_0xc89c('0x43')]['id']}})[_0xc89c('0x23')](handleEntityNotFound(_0x19bfff,null))['then'](saveUpdates(_0x584bd7[_0xc89c('0x49')],null))[_0xc89c('0x23')](respondWithResult(_0x19bfff,null))[_0xc89c('0x41')](handleError(_0x19bfff,null));};exports['destroy']=function(_0x530c0a,_0x421c22){return db[_0xc89c('0x2b')][_0xc89c('0x47')]({'where':{'id':_0x530c0a[_0xc89c('0x43')]['id']}})['then'](handleEntityNotFound(_0x421c22,null))[_0xc89c('0x23')](removeEntity(_0x421c22,null))[_0xc89c('0x41')](handleError(_0x421c22,null));};exports['describe']=function(_0x33898e,_0x12f013){return db[_0xc89c('0x2b')]['describe']()[_0xc89c('0x23')](respondWithResult(_0x12f013,null))['catch'](handleError(_0x12f013,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 273524d..e22f83d 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 _0x6a12=['path','rimraf','./jscriptyQuestionReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xb06354,_0x464d11){var _0x44da6c=function(_0x1c900f){while(--_0x1c900f){_0xb06354['push'](_0xb06354['shift']());}};_0x44da6c(++_0x464d11);}(_0x6a12,0x191));var _0x26a1=function(_0x266dea,_0x3e301c){_0x266dea=_0x266dea-0x0;var _0xb87eb4=_0x6a12[_0x266dea];return _0xb87eb4;};'use strict';var _=require(_0x26a1('0x0'));var util=require(_0x26a1('0x1'));var logger=require(_0x26a1('0x2'))(_0x26a1('0x3'));var moment=require(_0x26a1('0x4'));var BPromise=require(_0x26a1('0x5'));var rp=require(_0x26a1('0x6'));var fs=require('fs');var path=require(_0x26a1('0x7'));var rimraf=require(_0x26a1('0x8'));var config=require('../../config/environment');var attributes=require(_0x26a1('0x9'));module[_0x26a1('0xa')]=function(_0x27fefe,_0x4d6b69){return _0x27fefe[_0x26a1('0xb')]('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb232=['../../config/logger','api','moment','bluebird','request-promise','path','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util'];(function(_0x2e6669,_0x4bfc50){var _0x232f89=function(_0x285826){while(--_0x285826){_0x2e6669['push'](_0x2e6669['shift']());}};_0x232f89(++_0x4bfc50);}(_0xb232,0xe8));var _0x2b23=function(_0x2b0f81,_0x3917f0){_0x2b0f81=_0x2b0f81-0x0;var _0x5ce74c=_0xb232[_0x2b0f81];return _0x5ce74c;};'use strict';var _=require(_0x2b23('0x0'));var util=require(_0x2b23('0x1'));var logger=require(_0x2b23('0x2'))(_0x2b23('0x3'));var moment=require(_0x2b23('0x4'));var BPromise=require(_0x2b23('0x5'));var rp=require(_0x2b23('0x6'));var fs=require('fs');var path=require(_0x2b23('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2b23('0x8'));module[_0x2b23('0x9')]=function(_0x46c4a4,_0x291f42){return _0x46c4a4[_0x2b23('0xa')](_0x2b23('0xb'),attributes,{'tableName':_0x2b23('0xc'),'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 3fa6aaf..c28839d 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 _0xd5d1=['moment','bluebird','../../mysqldb','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4d5672,_0x4517e7){var _0x4a7aec=function(_0x29cd05){while(--_0x29cd05){_0x4d5672['push'](_0x4d5672['shift']());}};_0x4a7aec(++_0x4517e7);}(_0xd5d1,0xb3));var _0x1d5d=function(_0x2586a2,_0x69eb21){_0x2586a2=_0x2586a2-0x0;var _0x4a29bf=_0xd5d1[_0x2586a2];return _0x4a29bf;};'use strict';var _=require(_0x1d5d('0x0'));var util=require('util');var moment=require(_0x1d5d('0x1'));var BPromise=require(_0x1d5d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d5d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1d5d('0x4')][_0x1d5d('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x37be62,_0x3ae709,_0x3ebb0e){return new BPromise(function(_0x2cf284,_0x3fa0e8){return client['request'](_0x37be62,_0x3ebb0e)[_0x1d5d('0x6')](function(_0x1224ea){logger[_0x1d5d('0x7')](_0x1d5d('0x8'),_0x3ae709,_0x1d5d('0x9'));logger[_0x1d5d('0xa')](_0x1d5d('0xb'),_0x3ae709,_0x1d5d('0x9'),JSON[_0x1d5d('0xc')](_0x1224ea));if(_0x1224ea[_0x1d5d('0xd')]){if(_0x1224ea[_0x1d5d('0xd')][_0x1d5d('0xe')]===0x1f4){logger[_0x1d5d('0xd')](_0x1d5d('0x8'),_0x3ae709,_0x1224ea[_0x1d5d('0xd')]['message']);return _0x3fa0e8(_0x1224ea['error'][_0x1d5d('0xf')]);}logger['error'](_0x1d5d('0x8'),_0x3ae709,_0x1224ea[_0x1d5d('0xd')]['message']);return _0x2cf284(_0x1224ea[_0x1d5d('0xd')]['message']);}else{logger[_0x1d5d('0x7')](_0x1d5d('0x8'),_0x3ae709,_0x1d5d('0x9'));_0x2cf284(_0x1224ea[_0x1d5d('0x10')][_0x1d5d('0xf')]);}})[_0x1d5d('0x11')](function(_0x56e2a9){logger[_0x1d5d('0xd')](_0x1d5d('0x8'),_0x3ae709,_0x56e2a9);_0x3fa0e8(_0x56e2a9);});});} \ No newline at end of file +var _0x5eb2=['error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x48fb8f,_0x4176ee){var _0x4fc89d=function(_0x6118cf){while(--_0x6118cf){_0x48fb8f['push'](_0x48fb8f['shift']());}};_0x4fc89d(++_0x4176ee);}(_0x5eb2,0x1a9));var _0x25eb=function(_0x5d7747,_0x55c074){_0x5d7747=_0x5d7747-0x0;var _0x291142=_0x5eb2[_0x5d7747];return _0x291142;};'use strict';var _=require(_0x25eb('0x0'));var util=require(_0x25eb('0x1'));var moment=require(_0x25eb('0x2'));var BPromise=require('bluebird');var rs=require(_0x25eb('0x3'));var fs=require('fs');var Redis=require(_0x25eb('0x4'));var db=require(_0x25eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x25eb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x25eb('0x7')][_0x25eb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x196261,_0x1c1536,_0x3aac54){return new BPromise(function(_0x5ea51b,_0x5552fb){return client[_0x25eb('0x9')](_0x196261,_0x3aac54)[_0x25eb('0xa')](function(_0x29dc35){logger['info'](_0x25eb('0xb'),_0x1c1536,_0x25eb('0xc'));logger[_0x25eb('0xd')](_0x25eb('0xe'),_0x1c1536,_0x25eb('0xc'),JSON[_0x25eb('0xf')](_0x29dc35));if(_0x29dc35[_0x25eb('0x10')]){if(_0x29dc35['error'][_0x25eb('0x11')]===0x1f4){logger[_0x25eb('0x10')](_0x25eb('0xb'),_0x1c1536,_0x29dc35['error']['message']);return _0x5552fb(_0x29dc35[_0x25eb('0x10')][_0x25eb('0x12')]);}logger[_0x25eb('0x10')](_0x25eb('0xb'),_0x1c1536,_0x29dc35['error'][_0x25eb('0x12')]);return _0x5ea51b(_0x29dc35[_0x25eb('0x10')]['message']);}else{logger[_0x25eb('0x13')](_0x25eb('0xb'),_0x1c1536,_0x25eb('0xc'));_0x5ea51b(_0x29dc35['result'][_0x25eb('0x12')]);}})[_0x25eb('0x14')](function(_0x26ec78){logger[_0x25eb('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1c1536,_0x26ec78);_0x5552fb(_0x26ec78);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 8ade1fb..544f06d 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 _0x3d09=['/:id/questions','getQuestions','post','create','delete','/:id','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','show'];(function(_0x5b001c,_0x5b7d68){var _0x583268=function(_0x4cbaf7){while(--_0x4cbaf7){_0x5b001c['push'](_0x5b001c['shift']());}};_0x583268(++_0x5b7d68);}(_0x3d09,0x111));var _0x93d0=function(_0x3bc0b1,_0x2032ee){_0x3bc0b1=_0x3bc0b1-0x0;var _0x2a4557=_0x3d09[_0x3bc0b1];return _0x2a4557;};'use strict';var multer=require('multer');var util=require(_0x93d0('0x0'));var path=require('path');var timeout=require(_0x93d0('0x1'));var express=require(_0x93d0('0x2'));var router=express['Router']();var fs_extra=require(_0x93d0('0x3'));var auth=require(_0x93d0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x93d0('0x5'));var controller=require(_0x93d0('0x6'));router[_0x93d0('0x7')]('/',auth[_0x93d0('0x8')](),controller[_0x93d0('0x9')]);router[_0x93d0('0x7')](_0x93d0('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x93d0('0x7')]('/:id',auth[_0x93d0('0x8')](),controller[_0x93d0('0xb')]);router[_0x93d0('0x7')](_0x93d0('0xc'),auth[_0x93d0('0x8')](),controller[_0x93d0('0xd')]);router[_0x93d0('0xe')]('/',auth[_0x93d0('0x8')](),controller[_0x93d0('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x93d0('0x10')](_0x93d0('0x11'),auth[_0x93d0('0x8')](),controller[_0x93d0('0x12')]);module['exports']=router; \ No newline at end of file +var _0x078b=['post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/questions','getQuestions'];(function(_0x2e3a0b,_0x5aa03a){var _0x19c7f0=function(_0x2d285e){while(--_0x2d285e){_0x2e3a0b['push'](_0x2e3a0b['shift']());}};_0x19c7f0(++_0x5aa03a);}(_0x078b,0xdd));var _0xb078=function(_0x22cd17,_0x15326){_0x22cd17=_0x22cd17-0x0;var _0x3af242=_0x078b[_0x22cd17];return _0x3af242;};'use strict';var multer=require(_0xb078('0x0'));var util=require(_0xb078('0x1'));var path=require(_0xb078('0x2'));var timeout=require(_0xb078('0x3'));var express=require(_0xb078('0x4'));var router=express[_0xb078('0x5')]();var fs_extra=require(_0xb078('0x6'));var auth=require(_0xb078('0x7'));var interaction=require(_0xb078('0x8'));var config=require(_0xb078('0x9'));var controller=require(_0xb078('0xa'));router[_0xb078('0xb')]('/',auth[_0xb078('0xc')](),controller[_0xb078('0xd')]);router['get'](_0xb078('0xe'),auth[_0xb078('0xc')](),controller['describe']);router[_0xb078('0xb')](_0xb078('0xf'),auth[_0xb078('0xc')](),controller[_0xb078('0x10')]);router['get'](_0xb078('0x11'),auth['isAuthenticated'](),controller[_0xb078('0x12')]);router[_0xb078('0x13')]('/',auth[_0xb078('0xc')](),controller[_0xb078('0x14')]);router[_0xb078('0x15')]('/:id',auth[_0xb078('0xc')](),controller[_0xb078('0x16')]);router['delete'](_0xb078('0xf'),auth[_0xb078('0xc')](),controller[_0xb078('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index aa6c56e..dd87896 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 _0x5c25=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','exports','setDataValue','starttime'];(function(_0x1a0457,_0x63d0af){var _0x51c138=function(_0x1a9eaa){while(--_0x1a9eaa){_0x1a0457['push'](_0x1a0457['shift']());}};_0x51c138(++_0x63d0af);}(_0x5c25,0xf9));var _0x55c2=function(_0x11fa3c,_0x484687){_0x11fa3c=_0x11fa3c-0x0;var _0x4bbed3=_0x5c25[_0x11fa3c];return _0x4bbed3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x55c2('0x0')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x2aaeec){this[_0x55c2('0x1')](_0x55c2('0x2'),_0x2aaeec);this[_0x55c2('0x1')](_0x55c2('0x3'),moment()[_0x55c2('0x4')](_0x55c2('0x5')));}},'endtime':{'type':Sequelize[_0x55c2('0x6')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x55c2('0x7')]},'queue':{'type':Sequelize[_0x55c2('0x7')]},'uniqueid':{'type':Sequelize[_0x55c2('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x55c2('0x7')]},'completed':{'type':Sequelize[_0x55c2('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x38b8=['DATE','STRING','BOOLEAN','sequelize','setDataValue','starttime','endtime','format'];(function(_0x34b62a,_0x2d8b8a){var _0x585ad9=function(_0xcfce2){while(--_0xcfce2){_0x34b62a['push'](_0x34b62a['shift']());}};_0x585ad9(++_0x2d8b8a);}(_0x38b8,0x7b));var _0x838b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x38b8[_0xa464c9];return _0x3d73c4;};'use strict';var moment=require('moment');var Sequelize=require(_0x838b('0x0'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x28ef6b){this[_0x838b('0x1')](_0x838b('0x2'),_0x28ef6b);this[_0x838b('0x1')](_0x838b('0x3'),moment()[_0x838b('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x838b('0x5')]},'membername':{'type':Sequelize[_0x838b('0x6')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x838b('0x6')]},'uniqueid':{'type':Sequelize[_0x838b('0x6')]},'calleridname':{'type':Sequelize[_0x838b('0x6')]},'calleridnum':{'type':Sequelize[_0x838b('0x6')]},'completed':{'type':Sequelize[_0x838b('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 8e52e25..1bb60c9 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 _0xbb29=['send','index','map','JscriptySessionReport','rawAttributes','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','describe','getQuestions','findOne','SessionId','JscriptyQuestionReport','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x1f7e2b,_0x32d930){var _0x2c88c9=function(_0x379d1c){while(--_0x379d1c){_0x1f7e2b['push'](_0x1f7e2b['shift']());}};_0x2c88c9(++_0x32d930);}(_0xbb29,0x118));var _0x9bb2=function(_0x168f75,_0x47c9c9){_0x168f75=_0x168f75-0x0;var _0x231bc9=_0xbb29[_0x168f75];return _0x231bc9;};'use strict';var emlformat=require(_0x9bb2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9bb2('0x1'));var rp=require(_0x9bb2('0x2'));var moment=require(_0x9bb2('0x3'));var BPromise=require(_0x9bb2('0x4'));var Mustache=require(_0x9bb2('0x5'));var util=require(_0x9bb2('0x6'));var path=require(_0x9bb2('0x7'));var sox=require('sox');var csv=require(_0x9bb2('0x8'));var ejs=require(_0x9bb2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9bb2('0xa'));var squel=require(_0x9bb2('0xb'));var crypto=require(_0x9bb2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9bb2('0xd'));var toCsv=require(_0x9bb2('0x8'));var querystring=require(_0x9bb2('0xe'));var Papa=require(_0x9bb2('0xf'));var Redis=require('ioredis');var authService=require(_0x9bb2('0x10'));var qs=require(_0x9bb2('0x11'));var as=require(_0x9bb2('0x12'));var hardwareService=require(_0x9bb2('0x13'));var logger=require('../../config/logger')(_0x9bb2('0x14'));var utils=require('../../config/utils');var config=require(_0x9bb2('0x15'));var licenseUtil=require(_0x9bb2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x141e2c,_0x24266c){_0x24266c=_0x24266c||0xcc;return function(_0x42e674){if(_0x42e674){return _0x141e2c[_0x9bb2('0x17')](_0x24266c);}return _0x141e2c[_0x9bb2('0x18')](_0x24266c)[_0x9bb2('0x19')]();};}function respondWithResult(_0x4244ab,_0x56bcd9){_0x56bcd9=_0x56bcd9||0xc8;return function(_0x530f7d){if(_0x530f7d){return _0x4244ab[_0x9bb2('0x18')](_0x56bcd9)[_0x9bb2('0x1a')](_0x530f7d);}};}function respondWithFilteredResult(_0x2bef78,_0x1b3835){return function(_0x117048){if(_0x117048){var _0x527e6b=typeof _0x1b3835['offset']==='undefined'&&typeof _0x1b3835[_0x9bb2('0x1b')]===_0x9bb2('0x1c');var _0x59b39f=_0x117048['count'];var _0x2ff960=_0x527e6b?0x0:_0x1b3835['offset'];var _0x21a7dd=_0x527e6b?_0x117048[_0x9bb2('0x1d')]:_0x1b3835['offset']+_0x1b3835[_0x9bb2('0x1b')];var _0x44eacb;if(_0x21a7dd>=_0x59b39f){_0x21a7dd=_0x59b39f;_0x44eacb=0xc8;}else{_0x44eacb=0xce;}_0x2bef78[_0x9bb2('0x18')](_0x44eacb);return _0x2bef78[_0x9bb2('0x1e')]('Content-Range',_0x2ff960+'-'+_0x21a7dd+'/'+_0x59b39f)['json'](_0x117048);}return null;};}function patchUpdates(_0x46b480){return function(_0x26f096){try{jsonpatch[_0x9bb2('0x1f')](_0x26f096,_0x46b480,!![]);}catch(_0x262cae){return BPromise[_0x9bb2('0x20')](_0x262cae);}return _0x26f096[_0x9bb2('0x21')]();};}function saveUpdates(_0x1587a1,_0x3254cf){return function(_0x531d2a){if(_0x531d2a){return _0x531d2a[_0x9bb2('0x22')](_0x1587a1)[_0x9bb2('0x23')](function(_0x568dbd){return _0x568dbd;});}return null;};}function removeEntity(_0x2408cb,_0x55a6a6){return function(_0x377f4f){if(_0x377f4f){return _0x377f4f[_0x9bb2('0x24')]()[_0x9bb2('0x23')](function(){_0x2408cb['status'](0xcc)[_0x9bb2('0x19')]();});}};}function handleEntityNotFound(_0x98fef5,_0x1159c8){return function(_0x223df4){if(!_0x223df4){_0x98fef5[_0x9bb2('0x17')](0x194);}return _0x223df4;};}function handleError(_0x3ec8cb,_0x20c14a){_0x20c14a=_0x20c14a||0x1f4;return function(_0x55ed6e){logger[_0x9bb2('0x25')](_0x55ed6e[_0x9bb2('0x26')]);if(_0x55ed6e[_0x9bb2('0x27')]){delete _0x55ed6e['name'];}_0x3ec8cb['status'](_0x20c14a)[_0x9bb2('0x28')](_0x55ed6e);};}exports[_0x9bb2('0x29')]=function(_0x2fc6d1,_0x2b1f2d){var _0x136697={},_0x1db99b={},_0x158f00={'count':0x0,'rows':[]};var _0x40e595=_[_0x9bb2('0x2a')](db[_0x9bb2('0x2b')][_0x9bb2('0x2c')],function(_0x292344){return{'name':_0x292344['fieldName'],'type':_0x292344[_0x9bb2('0x2d')]['key']};});_0x1db99b['model']=_[_0x9bb2('0x2a')](_0x40e595,_0x9bb2('0x27'));_0x1db99b[_0x9bb2('0x2e')]=_['keys'](_0x2fc6d1[_0x9bb2('0x2e')]);_0x1db99b['filters']=_[_0x9bb2('0x2f')](_0x1db99b[_0x9bb2('0x30')],_0x1db99b[_0x9bb2('0x2e')]);_0x136697[_0x9bb2('0x31')]=_[_0x9bb2('0x2f')](_0x1db99b[_0x9bb2('0x30')],qs[_0x9bb2('0x32')](_0x2fc6d1[_0x9bb2('0x2e')][_0x9bb2('0x32')]));_0x136697[_0x9bb2('0x31')]=_0x136697['attributes'][_0x9bb2('0x33')]?_0x136697[_0x9bb2('0x31')]:_0x1db99b[_0x9bb2('0x30')];if(!_0x2fc6d1['query'][_0x9bb2('0x34')](_0x9bb2('0x35'))){_0x136697[_0x9bb2('0x1b')]=qs['limit'](_0x2fc6d1[_0x9bb2('0x2e')][_0x9bb2('0x1b')]);_0x136697[_0x9bb2('0x36')]=qs['offset'](_0x2fc6d1[_0x9bb2('0x2e')]['offset']);}_0x136697[_0x9bb2('0x37')]=qs[_0x9bb2('0x38')](_0x2fc6d1['query']['sort']);_0x136697[_0x9bb2('0x39')]=qs['filters'](_[_0x9bb2('0x3a')](_0x2fc6d1[_0x9bb2('0x2e')],_0x1db99b[_0x9bb2('0x3b')]),_0x40e595);if(_0x2fc6d1['query'][_0x9bb2('0x3c')]){_0x136697[_0x9bb2('0x39')]=_[_0x9bb2('0x3d')](_0x136697[_0x9bb2('0x39')],{'$or':_[_0x9bb2('0x2a')](_0x40e595,function(_0x14f60e){if(_0x14f60e['type']!==_0x9bb2('0x3e')){var _0x17ec30={};_0x17ec30[_0x14f60e['name']]={'$like':'%'+_0x2fc6d1[_0x9bb2('0x2e')][_0x9bb2('0x3c')]+'%'};return _0x17ec30;}})});}_0x136697=_[_0x9bb2('0x3d')]({},_0x136697,_0x2fc6d1[_0x9bb2('0x3f')]);var _0x2266bb={'where':_0x136697['where']};return db[_0x9bb2('0x2b')][_0x9bb2('0x1d')](_0x2266bb)[_0x9bb2('0x23')](function(_0x4fd1d1){_0x158f00[_0x9bb2('0x1d')]=_0x4fd1d1;if(_0x2fc6d1[_0x9bb2('0x2e')][_0x9bb2('0x40')]){_0x136697['include']=[{'all':!![]}];}return db[_0x9bb2('0x2b')][_0x9bb2('0x41')](_0x136697);})['then'](function(_0x57710f){_0x158f00[_0x9bb2('0x42')]=_0x57710f;return _0x158f00;})[_0x9bb2('0x23')](respondWithFilteredResult(_0x2b1f2d,_0x136697))['catch'](handleError(_0x2b1f2d,null));};exports[_0x9bb2('0x43')]=function(_0x283716,_0x1802b8){var _0x209881={'raw':!![],'where':{'id':_0x283716[_0x9bb2('0x44')]['id']}},_0x577886={};_0x577886[_0x9bb2('0x30')]=_[_0x9bb2('0x45')](db[_0x9bb2('0x2b')][_0x9bb2('0x2c')]);_0x577886['query']=_[_0x9bb2('0x45')](_0x283716['query']);_0x577886['filters']=_[_0x9bb2('0x2f')](_0x577886['model'],_0x577886['query']);_0x209881[_0x9bb2('0x31')]=_[_0x9bb2('0x2f')](_0x577886[_0x9bb2('0x30')],qs['fields'](_0x283716[_0x9bb2('0x2e')][_0x9bb2('0x32')]));_0x209881[_0x9bb2('0x31')]=_0x209881[_0x9bb2('0x31')]['length']?_0x209881[_0x9bb2('0x31')]:_0x577886[_0x9bb2('0x30')];if(_0x283716['query'][_0x9bb2('0x40')]){_0x209881[_0x9bb2('0x46')]=[{'all':!![]}];}_0x209881=_[_0x9bb2('0x3d')]({},_0x209881,_0x283716['options']);return db[_0x9bb2('0x2b')][_0x9bb2('0x47')](_0x209881)[_0x9bb2('0x23')](handleEntityNotFound(_0x1802b8,null))[_0x9bb2('0x23')](respondWithResult(_0x1802b8,null))[_0x9bb2('0x48')](handleError(_0x1802b8,null));};exports[_0x9bb2('0x49')]=function(_0x1dfe11,_0x3f42ee){return db['JscriptySessionReport']['create'](_0x1dfe11['body'],{})[_0x9bb2('0x23')](respondWithResult(_0x3f42ee,0xc9))[_0x9bb2('0x48')](handleError(_0x3f42ee,null));};exports['update']=function(_0x34524e,_0x4d6e45){if(_0x34524e[_0x9bb2('0x4a')]['id']){delete _0x34524e[_0x9bb2('0x4a')]['id'];}return db['JscriptySessionReport'][_0x9bb2('0x47')]({'where':{'id':_0x34524e[_0x9bb2('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d6e45,null))[_0x9bb2('0x23')](saveUpdates(_0x34524e['body'],null))[_0x9bb2('0x23')](respondWithResult(_0x4d6e45,null))[_0x9bb2('0x48')](handleError(_0x4d6e45,null));};exports[_0x9bb2('0x24')]=function(_0x4b6cc8,_0x17f994){return db['JscriptySessionReport']['find']({'where':{'id':_0x4b6cc8[_0x9bb2('0x44')]['id']}})[_0x9bb2('0x23')](handleEntityNotFound(_0x17f994,null))['then'](removeEntity(_0x17f994,null))[_0x9bb2('0x48')](handleError(_0x17f994,null));};exports[_0x9bb2('0x4b')]=function(_0xa9b88b,_0x2ffde6){return db[_0x9bb2('0x2b')]['describe']()[_0x9bb2('0x23')](respondWithResult(_0x2ffde6,null))[_0x9bb2('0x48')](handleError(_0x2ffde6,null));};exports[_0x9bb2('0x4c')]=function(_0x1ff5fd,_0x52f3ca,_0x20494e){var _0xebbc97={'raw':!![],'where':{}};var _0xc95601={};var _0x2ace43={'count':0x0,'rows':[]};return db[_0x9bb2('0x2b')][_0x9bb2('0x4d')]({'where':{'id':_0x1ff5fd['params']['id']}})[_0x9bb2('0x23')](handleEntityNotFound(_0x52f3ca,null))['then'](function(_0x4b1a5c){if(_0x4b1a5c){_0xc95601['model']=_[_0x9bb2('0x45')](db['JscriptyQuestionReport'][_0x9bb2('0x2c')]);_0xc95601[_0x9bb2('0x2e')]=_[_0x9bb2('0x45')](_0x1ff5fd[_0x9bb2('0x2e')]);_0xc95601[_0x9bb2('0x3b')]=_[_0x9bb2('0x2f')](_0xc95601[_0x9bb2('0x30')],_0xc95601[_0x9bb2('0x2e')]);_0xebbc97[_0x9bb2('0x31')]=_[_0x9bb2('0x2f')](_0xc95601['model'],qs['fields'](_0x1ff5fd[_0x9bb2('0x2e')]['fields']));_0xebbc97[_0x9bb2('0x31')]=_0xebbc97['attributes']['length']?_0xebbc97[_0x9bb2('0x31')]:_0xc95601[_0x9bb2('0x30')];if(!_0x1ff5fd[_0x9bb2('0x2e')]['hasOwnProperty']('nolimit')){_0xebbc97[_0x9bb2('0x1b')]=qs['limit'](_0x1ff5fd['query'][_0x9bb2('0x1b')]);_0xebbc97[_0x9bb2('0x36')]=qs[_0x9bb2('0x36')](_0x1ff5fd[_0x9bb2('0x2e')]['offset']);}_0xebbc97[_0x9bb2('0x37')]=qs[_0x9bb2('0x38')](_0x1ff5fd[_0x9bb2('0x2e')][_0x9bb2('0x38')]);_0xebbc97[_0x9bb2('0x39')]=qs[_0x9bb2('0x3b')](_[_0x9bb2('0x3a')](_0x1ff5fd[_0x9bb2('0x2e')],_0xc95601['filters']));_0xebbc97[_0x9bb2('0x39')][_0x9bb2('0x4e')]=_0x4b1a5c['id'];if(_0x1ff5fd['query'][_0x9bb2('0x3c')]){_0xebbc97[_0x9bb2('0x39')]=_[_0x9bb2('0x3d')](_0xebbc97[_0x9bb2('0x39')],{'$or':_[_0x9bb2('0x2a')](_0xebbc97[_0x9bb2('0x31')],function(_0xc4f0f1){var _0x2137f0={};_0x2137f0[_0xc4f0f1]={'$like':'%'+_0x1ff5fd[_0x9bb2('0x2e')][_0x9bb2('0x3c')]+'%'};return _0x2137f0;})});}_0xebbc97=_[_0x9bb2('0x3d')]({},_0xebbc97,_0x1ff5fd[_0x9bb2('0x3f')]);return db[_0x9bb2('0x4f')][_0x9bb2('0x1d')]({'where':_0xebbc97['where']})[_0x9bb2('0x23')](function(_0x423f3e){_0x2ace43[_0x9bb2('0x1d')]=_0x423f3e;if(_0x1ff5fd[_0x9bb2('0x2e')][_0x9bb2('0x40')]){_0xebbc97[_0x9bb2('0x46')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0xebbc97);})[_0x9bb2('0x23')](function(_0x55d751){_0x2ace43[_0x9bb2('0x42')]=_0x55d751;return _0x2ace43;});}})[_0x9bb2('0x23')](respondWithFilteredResult(_0x52f3ca,_0xebbc97))[_0x9bb2('0x48')](handleError(_0x52f3ca,null));}; \ No newline at end of file +var _0x0cbd=['where','filters','merge','type','VIRTUAL','filter','options','JscriptySessionReport','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','destroy','describe','getQuestions','order','SessionId','JscriptyQuestionReport','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','map','rawAttributes','fieldName','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x1443b7,_0x4a4f1e){var _0x510498=function(_0x4e248c){while(--_0x4e248c){_0x1443b7['push'](_0x1443b7['shift']());}};_0x510498(++_0x4a4f1e);}(_0x0cbd,0xfd));var _0xd0cb=function(_0x257b9b,_0x38fca0){_0x257b9b=_0x257b9b-0x0;var _0x98c435=_0x0cbd[_0x257b9b];return _0x98c435;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0cb('0x0'));var zipdir=require(_0xd0cb('0x1'));var jsonpatch=require(_0xd0cb('0x2'));var rp=require(_0xd0cb('0x3'));var moment=require('moment');var BPromise=require(_0xd0cb('0x4'));var Mustache=require(_0xd0cb('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd0cb('0x6'));var fs=require('fs');var fs_extra=require(_0xd0cb('0x7'));var _=require(_0xd0cb('0x8'));var squel=require(_0xd0cb('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd0cb('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd0cb('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xd0cb('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0cb('0xd'));var logger=require(_0xd0cb('0xe'))(_0xd0cb('0xf'));var utils=require(_0xd0cb('0x10'));var config=require(_0xd0cb('0x11'));var licenseUtil=require(_0xd0cb('0x12'));var db=require(_0xd0cb('0x13'))['db'];function respondWithStatusCode(_0x4e8b2f,_0x414d4b){_0x414d4b=_0x414d4b||0xcc;return function(_0x3532c3){if(_0x3532c3){return _0x4e8b2f[_0xd0cb('0x14')](_0x414d4b);}return _0x4e8b2f['status'](_0x414d4b)['end']();};}function respondWithResult(_0x34689,_0xf3ccf6){_0xf3ccf6=_0xf3ccf6||0xc8;return function(_0x35361e){if(_0x35361e){return _0x34689['status'](_0xf3ccf6)[_0xd0cb('0x15')](_0x35361e);}};}function respondWithFilteredResult(_0x1d6782,_0x4019d5){return function(_0x10e5dd){if(_0x10e5dd){var _0x55ddf7=typeof _0x4019d5[_0xd0cb('0x16')]===_0xd0cb('0x17')&&typeof _0x4019d5['limit']===_0xd0cb('0x17');var _0x16b626=_0x10e5dd[_0xd0cb('0x18')];var _0x57fc65=_0x55ddf7?0x0:_0x4019d5[_0xd0cb('0x16')];var _0x2e2f17=_0x55ddf7?_0x10e5dd[_0xd0cb('0x18')]:_0x4019d5[_0xd0cb('0x16')]+_0x4019d5[_0xd0cb('0x19')];var _0x5b85e0;if(_0x2e2f17>=_0x16b626){_0x2e2f17=_0x16b626;_0x5b85e0=0xc8;}else{_0x5b85e0=0xce;}_0x1d6782[_0xd0cb('0x1a')](_0x5b85e0);return _0x1d6782['set'](_0xd0cb('0x1b'),_0x57fc65+'-'+_0x2e2f17+'/'+_0x16b626)[_0xd0cb('0x15')](_0x10e5dd);}return null;};}function patchUpdates(_0x4e4342){return function(_0x1c1314){try{jsonpatch[_0xd0cb('0x1c')](_0x1c1314,_0x4e4342,!![]);}catch(_0x53660b){return BPromise[_0xd0cb('0x1d')](_0x53660b);}return _0x1c1314[_0xd0cb('0x1e')]();};}function saveUpdates(_0x31e183,_0x5ae7dc){return function(_0xc9a209){if(_0xc9a209){return _0xc9a209[_0xd0cb('0x1f')](_0x31e183)[_0xd0cb('0x20')](function(_0x4aba22){return _0x4aba22;});}return null;};}function removeEntity(_0x182e2d,_0x9974f3){return function(_0xe9ab1c){if(_0xe9ab1c){return _0xe9ab1c['destroy']()['then'](function(){_0x182e2d['status'](0xcc)[_0xd0cb('0x21')]();});}};}function handleEntityNotFound(_0x595471,_0x5eeb31){return function(_0x4dd3dd){if(!_0x4dd3dd){_0x595471['sendStatus'](0x194);}return _0x4dd3dd;};}function handleError(_0x3a6b13,_0x54d216){_0x54d216=_0x54d216||0x1f4;return function(_0xdb6935){logger['error'](_0xdb6935[_0xd0cb('0x22')]);if(_0xdb6935['name']){delete _0xdb6935[_0xd0cb('0x23')];}_0x3a6b13[_0xd0cb('0x1a')](_0x54d216)[_0xd0cb('0x24')](_0xdb6935);};}exports[_0xd0cb('0x25')]=function(_0x26b6d5,_0x2f5ed1){var _0x4a9b8c={},_0xfb4d18={},_0x30af7e={'count':0x0,'rows':[]};var _0x504348=_[_0xd0cb('0x26')](db['JscriptySessionReport'][_0xd0cb('0x27')],function(_0xf0609c){return{'name':_0xf0609c[_0xd0cb('0x28')],'type':_0xf0609c['type'][_0xd0cb('0x29')]};});_0xfb4d18['model']=_['map'](_0x504348,_0xd0cb('0x23'));_0xfb4d18['query']=_['keys'](_0x26b6d5[_0xd0cb('0x2a')]);_0xfb4d18['filters']=_['intersection'](_0xfb4d18[_0xd0cb('0x2b')],_0xfb4d18[_0xd0cb('0x2a')]);_0x4a9b8c[_0xd0cb('0x2c')]=_[_0xd0cb('0x2d')](_0xfb4d18[_0xd0cb('0x2b')],qs[_0xd0cb('0x2e')](_0x26b6d5[_0xd0cb('0x2a')][_0xd0cb('0x2e')]));_0x4a9b8c[_0xd0cb('0x2c')]=_0x4a9b8c[_0xd0cb('0x2c')][_0xd0cb('0x2f')]?_0x4a9b8c['attributes']:_0xfb4d18['model'];if(!_0x26b6d5[_0xd0cb('0x2a')][_0xd0cb('0x30')](_0xd0cb('0x31'))){_0x4a9b8c[_0xd0cb('0x19')]=qs[_0xd0cb('0x19')](_0x26b6d5[_0xd0cb('0x2a')][_0xd0cb('0x19')]);_0x4a9b8c[_0xd0cb('0x16')]=qs['offset'](_0x26b6d5[_0xd0cb('0x2a')][_0xd0cb('0x16')]);}_0x4a9b8c['order']=qs[_0xd0cb('0x32')](_0x26b6d5[_0xd0cb('0x2a')][_0xd0cb('0x32')]);_0x4a9b8c[_0xd0cb('0x33')]=qs['filters'](_['pick'](_0x26b6d5[_0xd0cb('0x2a')],_0xfb4d18[_0xd0cb('0x34')]),_0x504348);if(_0x26b6d5[_0xd0cb('0x2a')]['filter']){_0x4a9b8c[_0xd0cb('0x33')]=_[_0xd0cb('0x35')](_0x4a9b8c['where'],{'$or':_[_0xd0cb('0x26')](_0x504348,function(_0x1b79d5){if(_0x1b79d5[_0xd0cb('0x36')]!==_0xd0cb('0x37')){var _0x388263={};_0x388263[_0x1b79d5[_0xd0cb('0x23')]]={'$like':'%'+_0x26b6d5[_0xd0cb('0x2a')][_0xd0cb('0x38')]+'%'};return _0x388263;}})});}_0x4a9b8c=_[_0xd0cb('0x35')]({},_0x4a9b8c,_0x26b6d5[_0xd0cb('0x39')]);var _0x5a894d={'where':_0x4a9b8c[_0xd0cb('0x33')]};return db[_0xd0cb('0x3a')]['count'](_0x5a894d)['then'](function(_0x479c7b){_0x30af7e[_0xd0cb('0x18')]=_0x479c7b;if(_0x26b6d5['query'][_0xd0cb('0x3b')]){_0x4a9b8c[_0xd0cb('0x3c')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xd0cb('0x3d')](_0x4a9b8c);})[_0xd0cb('0x20')](function(_0x1f2497){_0x30af7e[_0xd0cb('0x3e')]=_0x1f2497;return _0x30af7e;})[_0xd0cb('0x20')](respondWithFilteredResult(_0x2f5ed1,_0x4a9b8c))['catch'](handleError(_0x2f5ed1,null));};exports[_0xd0cb('0x3f')]=function(_0x54eacc,_0x43f885){var _0x5b3442={'raw':!![],'where':{'id':_0x54eacc[_0xd0cb('0x40')]['id']}},_0x319654={};_0x319654[_0xd0cb('0x2b')]=_[_0xd0cb('0x41')](db['JscriptySessionReport'][_0xd0cb('0x27')]);_0x319654[_0xd0cb('0x2a')]=_[_0xd0cb('0x41')](_0x54eacc[_0xd0cb('0x2a')]);_0x319654[_0xd0cb('0x34')]=_['intersection'](_0x319654[_0xd0cb('0x2b')],_0x319654['query']);_0x5b3442[_0xd0cb('0x2c')]=_[_0xd0cb('0x2d')](_0x319654['model'],qs[_0xd0cb('0x2e')](_0x54eacc[_0xd0cb('0x2a')][_0xd0cb('0x2e')]));_0x5b3442[_0xd0cb('0x2c')]=_0x5b3442[_0xd0cb('0x2c')][_0xd0cb('0x2f')]?_0x5b3442[_0xd0cb('0x2c')]:_0x319654['model'];if(_0x54eacc['query'][_0xd0cb('0x3b')]){_0x5b3442[_0xd0cb('0x3c')]=[{'all':!![]}];}_0x5b3442=_[_0xd0cb('0x35')]({},_0x5b3442,_0x54eacc[_0xd0cb('0x39')]);return db['JscriptySessionReport']['find'](_0x5b3442)[_0xd0cb('0x20')](handleEntityNotFound(_0x43f885,null))[_0xd0cb('0x20')](respondWithResult(_0x43f885,null))[_0xd0cb('0x42')](handleError(_0x43f885,null));};exports['create']=function(_0x416b23,_0x2f0bef){return db['JscriptySessionReport'][_0xd0cb('0x43')](_0x416b23[_0xd0cb('0x44')],{})[_0xd0cb('0x20')](respondWithResult(_0x2f0bef,0xc9))[_0xd0cb('0x42')](handleError(_0x2f0bef,null));};exports[_0xd0cb('0x1f')]=function(_0x4c5e4a,_0x1f4299){if(_0x4c5e4a[_0xd0cb('0x44')]['id']){delete _0x4c5e4a[_0xd0cb('0x44')]['id'];}return db[_0xd0cb('0x3a')][_0xd0cb('0x45')]({'where':{'id':_0x4c5e4a['params']['id']}})[_0xd0cb('0x20')](handleEntityNotFound(_0x1f4299,null))['then'](saveUpdates(_0x4c5e4a[_0xd0cb('0x44')],null))[_0xd0cb('0x20')](respondWithResult(_0x1f4299,null))[_0xd0cb('0x42')](handleError(_0x1f4299,null));};exports[_0xd0cb('0x46')]=function(_0x2382fe,_0x5ed6e9){return db['JscriptySessionReport'][_0xd0cb('0x45')]({'where':{'id':_0x2382fe['params']['id']}})['then'](handleEntityNotFound(_0x5ed6e9,null))[_0xd0cb('0x20')](removeEntity(_0x5ed6e9,null))[_0xd0cb('0x42')](handleError(_0x5ed6e9,null));};exports[_0xd0cb('0x47')]=function(_0x3b7504,_0x2a1e9d){return db[_0xd0cb('0x3a')][_0xd0cb('0x47')]()[_0xd0cb('0x20')](respondWithResult(_0x2a1e9d,null))[_0xd0cb('0x42')](handleError(_0x2a1e9d,null));};exports[_0xd0cb('0x48')]=function(_0x2e5a97,_0x48ee5d,_0x198f34){var _0x28ff3f={'raw':!![],'where':{}};var _0x347066={};var _0x1fce14={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x2e5a97['params']['id']}})['then'](handleEntityNotFound(_0x48ee5d,null))['then'](function(_0x4370fa){if(_0x4370fa){_0x347066[_0xd0cb('0x2b')]=_[_0xd0cb('0x41')](db['JscriptyQuestionReport'][_0xd0cb('0x27')]);_0x347066[_0xd0cb('0x2a')]=_[_0xd0cb('0x41')](_0x2e5a97[_0xd0cb('0x2a')]);_0x347066['filters']=_[_0xd0cb('0x2d')](_0x347066[_0xd0cb('0x2b')],_0x347066[_0xd0cb('0x2a')]);_0x28ff3f[_0xd0cb('0x2c')]=_[_0xd0cb('0x2d')](_0x347066['model'],qs['fields'](_0x2e5a97[_0xd0cb('0x2a')][_0xd0cb('0x2e')]));_0x28ff3f[_0xd0cb('0x2c')]=_0x28ff3f['attributes']['length']?_0x28ff3f[_0xd0cb('0x2c')]:_0x347066['model'];if(!_0x2e5a97['query'][_0xd0cb('0x30')](_0xd0cb('0x31'))){_0x28ff3f['limit']=qs['limit'](_0x2e5a97['query'][_0xd0cb('0x19')]);_0x28ff3f[_0xd0cb('0x16')]=qs[_0xd0cb('0x16')](_0x2e5a97[_0xd0cb('0x2a')]['offset']);}_0x28ff3f[_0xd0cb('0x49')]=qs[_0xd0cb('0x32')](_0x2e5a97[_0xd0cb('0x2a')][_0xd0cb('0x32')]);_0x28ff3f[_0xd0cb('0x33')]=qs[_0xd0cb('0x34')](_['pick'](_0x2e5a97['query'],_0x347066[_0xd0cb('0x34')]));_0x28ff3f[_0xd0cb('0x33')][_0xd0cb('0x4a')]=_0x4370fa['id'];if(_0x2e5a97[_0xd0cb('0x2a')]['filter']){_0x28ff3f[_0xd0cb('0x33')]=_[_0xd0cb('0x35')](_0x28ff3f['where'],{'$or':_[_0xd0cb('0x26')](_0x28ff3f['attributes'],function(_0x23f667){var _0x162ce4={};_0x162ce4[_0x23f667]={'$like':'%'+_0x2e5a97[_0xd0cb('0x2a')]['filter']+'%'};return _0x162ce4;})});}_0x28ff3f=_[_0xd0cb('0x35')]({},_0x28ff3f,_0x2e5a97[_0xd0cb('0x39')]);return db[_0xd0cb('0x4b')][_0xd0cb('0x18')]({'where':_0x28ff3f['where']})['then'](function(_0x571af4){_0x1fce14['count']=_0x571af4;if(_0x2e5a97[_0xd0cb('0x2a')]['includeAll']){_0x28ff3f[_0xd0cb('0x3c')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xd0cb('0x3d')](_0x28ff3f);})[_0xd0cb('0x20')](function(_0x55db11){_0x1fce14[_0xd0cb('0x3e')]=_0x55db11;return _0x1fce14;});}})['then'](respondWithFilteredResult(_0x48ee5d,_0x28ff3f))[_0xd0cb('0x42')](handleError(_0x48ee5d,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 3025137..3177c5d 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 _0x2675=['lodash','moment','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0x2675,0x75));var _0x5267=function(_0x36917c,_0xae4682){_0x36917c=_0x36917c-0x0;var _0x1ee4d8=_0x2675[_0x36917c];return _0x1ee4d8;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));module[_0x5267('0x6')]=function(_0x4bd042,_0x10f92c){return _0x4bd042[_0x5267('0x7')](_0x5267('0x8'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6050=['../../config/environment','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x26c990,_0x1fcb9b){var _0x43c665=function(_0x5c98a3){while(--_0x5c98a3){_0x26c990['push'](_0x26c990['shift']());}};_0x43c665(++_0x1fcb9b);}(_0x6050,0x196));var _0x0605=function(_0x57a79c,_0xf5c699){_0x57a79c=_0x57a79c-0x0;var _0x487d40=_0x6050[_0x57a79c];return _0x487d40;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 8c16dc1..7fbf2f0 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 _0x1883=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1400e3,_0x24bcc6){var _0x3d285b=function(_0x6bc469){while(--_0x6bc469){_0x1400e3['push'](_0x1400e3['shift']());}};_0x3d285b(++_0x24bcc6);}(_0x1883,0xab));var _0x3188=function(_0x3efdc1,_0x5c2418){_0x3efdc1=_0x3efdc1-0x0;var _0x17f380=_0x1883[_0x3efdc1];return _0x17f380;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});} \ No newline at end of file +var _0x7b84=['jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x13c71f,_0x89f89c){var _0x5dad1d=function(_0x5e3226){while(--_0x5e3226){_0x13c71f['push'](_0x13c71f['shift']());}};_0x5dad1d(++_0x89f89c);}(_0x7b84,0x17c));var _0x47b8=function(_0x5a600a,_0x49306f){_0x5a600a=_0x5a600a-0x0;var _0x2393cd=_0x7b84[_0x5a600a];return _0x2393cd;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('JscriptySessionReport,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 3025d2b..84956fd 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 _0xaf5a=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xaf5a,0x130));var _0xaaf5=function(_0x27a0a9,_0x1e7dd1){_0x27a0a9=_0x27a0a9-0x0;var _0x11cb3b=_0xaf5a[_0x27a0a9];return _0x11cb3b;};'use strict';var multer=require('multer');var util=require(_0xaaf5('0x0'));var path=require(_0xaaf5('0x1'));var timeout=require(_0xaaf5('0x2'));var express=require(_0xaaf5('0x3'));var router=express[_0xaaf5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaaf5('0x5'));var config=require(_0xaaf5('0x6'));var controller=require(_0xaaf5('0x7'));router[_0xaaf5('0x8')]('/',controller[_0xaaf5('0x9')]);router[_0xaaf5('0xa')](_0xaaf5('0xb'),auth[_0xaaf5('0xc')](),controller[_0xaaf5('0xd')]);router[_0xaaf5('0x8')](_0xaaf5('0xe'),auth[_0xaaf5('0xc')](),controller[_0xaaf5('0xf')]);module['exports']=router; \ No newline at end of file +var _0xe063=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','put','/:id','update','isAuthenticated','express'];(function(_0x3b1846,_0x4c8a47){var _0x5e2afd=function(_0x371d38){while(--_0x371d38){_0x3b1846['push'](_0x3b1846['shift']());}};_0x5e2afd(++_0x4c8a47);}(_0xe063,0xdb));var _0x3e06=function(_0x232593,_0xfa0e86){_0x232593=_0x232593-0x0;var _0x33c73e=_0xe063[_0x232593];return _0x33c73e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3e06('0x0'));var router=express[_0x3e06('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x3e06('0x2'));var interaction=require(_0x3e06('0x3'));var config=require(_0x3e06('0x4'));var controller=require('./license.controller');router['get']('/',controller[_0x3e06('0x5')]);router[_0x3e06('0x6')](_0x3e06('0x7'),auth['isAuthenticated'](),controller[_0x3e06('0x8')]);router['get']('/download_log_file',auth[_0x3e06('0x9')](),controller['downloadLogFile']);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 a4306a1..6c10e90 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 _0x8356=['sequelize','exports','STRING','INTEGER'];(function(_0x4108e9,_0x58da63){var _0x369cc4=function(_0x527bfd){while(--_0x527bfd){_0x4108e9['push'](_0x4108e9['shift']());}};_0x369cc4(++_0x58da63);}(_0x8356,0xe4));var _0x6835=function(_0x11026e,_0x164422){_0x11026e=_0x11026e-0x0;var _0x334d99=_0x8356[_0x11026e];return _0x334d99;};'use strict';var Sequelize=require(_0x6835('0x0'));module[_0x6835('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x6835('0x2')]},'data2':{'type':Sequelize[_0x6835('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x6835('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4fb0=['INTEGER','sequelize','TEXT','STRING'];(function(_0x1e3cf9,_0x1fd35a){var _0x461065=function(_0x504e08){while(--_0x504e08){_0x1e3cf9['push'](_0x1e3cf9['shift']());}};_0x461065(++_0x1fd35a);}(_0x4fb0,0x185));var _0x04fb=function(_0x235a2e,_0x1c1081){_0x235a2e=_0x235a2e-0x0;var _0x3e50af=_0x4fb0[_0x235a2e];return _0x3e50af;};'use strict';var Sequelize=require(_0x04fb('0x0'));module['exports']={'license':{'type':Sequelize[_0x04fb('0x1')]},'data1':{'type':Sequelize[_0x04fb('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x04fb('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 a28cfdf..e8a811e 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 _0xb26c=['undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','merge','options','getLicense','catch','body','find','params','get','checkLicense','demo','downloadLogFile','join','/var','log','xcally','Content-disposition','attachment;\x20filename=','set','Content-Type','download','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','end','offset'];(function(_0x480e6d,_0x716219){var _0x5cd9cc=function(_0x20727e){while(--_0x20727e){_0x480e6d['push'](_0x480e6d['shift']());}};_0x5cd9cc(++_0x716219);}(_0xb26c,0x72));var _0xcb26=function(_0x3827fd,_0x2a5a28){_0x3827fd=_0x3827fd-0x0;var _0x3d5239=_0xb26c[_0x3827fd];return _0x3d5239;};'use strict';var emlformat=require(_0xcb26('0x0'));var rimraf=require(_0xcb26('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcb26('0x2'));var moment=require('moment');var BPromise=require(_0xcb26('0x3'));var Mustache=require('mustache');var util=require(_0xcb26('0x4'));var path=require('path');var sox=require(_0xcb26('0x5'));var csv=require(_0xcb26('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb26('0x7'));var _=require(_0xcb26('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcb26('0x9'));var toCsv=require(_0xcb26('0x6'));var querystring=require('querystring');var Papa=require(_0xcb26('0xa'));var Redis=require(_0xcb26('0xb'));var authService=require(_0xcb26('0xc'));var qs=require(_0xcb26('0xd'));var as=require(_0xcb26('0xe'));var hardwareService=require(_0xcb26('0xf'));var logger=require(_0xcb26('0x10'))(_0xcb26('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcb26('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243d97,_0x5a3542){_0x5a3542=_0x5a3542||0xcc;return function(_0x5652e3){if(_0x5652e3){return _0x243d97[_0xcb26('0x13')](_0x5a3542);}return _0x243d97['status'](_0x5a3542)[_0xcb26('0x14')]();};}function respondWithResult(_0x4457ea,_0x4b7732){_0x4b7732=_0x4b7732||0xc8;return function(_0x129d35){if(_0x129d35){return _0x4457ea['status'](_0x4b7732)['json'](_0x129d35);}};}function respondWithFilteredResult(_0xe56c24,_0x1b6409){return function(_0x50c369){if(_0x50c369){var _0x2c162f=typeof _0x1b6409[_0xcb26('0x15')]===_0xcb26('0x16')&&typeof _0x1b6409[_0xcb26('0x17')]===_0xcb26('0x16');var _0x39f96c=_0x50c369[_0xcb26('0x18')];var _0x463eda=_0x2c162f?0x0:_0x1b6409[_0xcb26('0x15')];var _0x432fe6=_0x2c162f?_0x50c369[_0xcb26('0x18')]:_0x1b6409['offset']+_0x1b6409['limit'];var _0x2c0edd;if(_0x432fe6>=_0x39f96c){_0x432fe6=_0x39f96c;_0x2c0edd=0xc8;}else{_0x2c0edd=0xce;}_0xe56c24[_0xcb26('0x19')](_0x2c0edd);return _0xe56c24['set'](_0xcb26('0x1a'),_0x463eda+'-'+_0x432fe6+'/'+_0x39f96c)[_0xcb26('0x1b')](_0x50c369);}return null;};}function patchUpdates(_0x57cdd1){return function(_0x533c1c){try{jsonpatch[_0xcb26('0x1c')](_0x533c1c,_0x57cdd1,!![]);}catch(_0x2c4c82){return BPromise[_0xcb26('0x1d')](_0x2c4c82);}return _0x533c1c[_0xcb26('0x1e')]();};}function saveUpdates(_0x10035e,_0xccc66c){return function(_0x43d861){if(_0x43d861){return _0x43d861[_0xcb26('0x1f')](_0x10035e)[_0xcb26('0x20')](function(_0x5ab1ab){return _0x5ab1ab;});}return null;};}function removeEntity(_0x251ab4,_0x35eb9a){return function(_0x347277){if(_0x347277){return _0x347277[_0xcb26('0x21')]()[_0xcb26('0x20')](function(){_0x251ab4[_0xcb26('0x19')](0xcc)[_0xcb26('0x14')]();});}};}function handleEntityNotFound(_0x5a9b63,_0x4cb944){return function(_0x288098){if(!_0x288098){_0x5a9b63[_0xcb26('0x13')](0x194);}return _0x288098;};}function handleError(_0x2cf653,_0x407484){_0x407484=_0x407484||0x1f4;return function(_0x4919ca){logger[_0xcb26('0x22')](_0x4919ca[_0xcb26('0x23')]);if(_0x4919ca['name']){delete _0x4919ca[_0xcb26('0x24')];}_0x2cf653['status'](_0x407484)[_0xcb26('0x25')](_0x4919ca);};}var utilLicense=require(_0xcb26('0x12'));exports[_0xcb26('0x26')]=function(_0x54f42f,_0x39eeb8){var _0x12e8fe={'raw':!![],'where':{'id':0x1}},_0x43a5aa={};_0x43a5aa[_0xcb26('0x27')]=_[_0xcb26('0x28')](db[_0xcb26('0x29')][_0xcb26('0x2a')]);_0x43a5aa[_0xcb26('0x2b')]=_[_0xcb26('0x28')](_0x54f42f[_0xcb26('0x2b')]);_0x43a5aa[_0xcb26('0x2c')]=_[_0xcb26('0x2d')](_0x43a5aa['model'],_0x43a5aa[_0xcb26('0x2b')]);_0x12e8fe['attributes']=_[_0xcb26('0x2d')](_0x43a5aa['model'],qs[_0xcb26('0x2e')](_0x54f42f[_0xcb26('0x2b')][_0xcb26('0x2e')]));_0x12e8fe[_0xcb26('0x2f')]=_0x12e8fe[_0xcb26('0x2f')]['length']?_0x12e8fe['attributes']:_0x43a5aa['model'];_0x12e8fe=_[_0xcb26('0x30')]({},_0x12e8fe,_0x54f42f[_0xcb26('0x31')]);return utilLicense[_0xcb26('0x32')](_0x12e8fe)['then'](respondWithResult(_0x39eeb8,null))[_0xcb26('0x33')](handleError(_0x39eeb8,null));};exports[_0xcb26('0x1f')]=function(_0x5eb105,_0x30f2b0){if(_0x5eb105['body']['id']){delete _0x5eb105[_0xcb26('0x34')]['id'];}return db[_0xcb26('0x29')][_0xcb26('0x35')]({'where':{'id':_0x5eb105[_0xcb26('0x36')]['id']}})[_0xcb26('0x20')](handleEntityNotFound(_0x30f2b0,null))[_0xcb26('0x20')](function(_0x44ce06){var _0x365dc5=_0x44ce06[_0xcb26('0x37')]({'plain':!![]});return utilLicense[_0xcb26('0x38')](_0x365dc5,_0x5eb105[_0xcb26('0x34')]['key']);})['then'](function(_0x579d3c){if(!_0x579d3c[_0xcb26('0x39')]){return saveUpdates(_0x5eb105['body'],null);}return _0x579d3c;})[_0xcb26('0x20')](respondWithResult(_0x30f2b0,null))['catch'](handleError(_0x30f2b0,null));};exports[_0xcb26('0x3a')]=function(_0xb152d1,_0x3c1ba6){var _0x38e406='license-info.log';var _0x3d0488=path[_0xcb26('0x3b')](_0xcb26('0x3c'),_0xcb26('0x3d'),_0xcb26('0x3e'),_0x38e406);_0x3c1ba6['setHeader'](_0xcb26('0x3f'),_0xcb26('0x40')+_0x38e406);_0x3c1ba6[_0xcb26('0x41')](_0xcb26('0x42'),'text/plain');_0x3c1ba6[_0xcb26('0x43')](_0x3d0488);}; \ No newline at end of file +var _0xc844=['keys','License','rawAttributes','query','filters','intersection','attributes','fields','options','catch','body','find','get','checkLicense','key','demo','downloadLogFile','/var','log','setHeader','Content-disposition','Content-Type','text/plain','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','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','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','../../config/license/util','index','model'];(function(_0x52869a,_0x4b4362){var _0x3229af=function(_0x69c629){while(--_0x69c629){_0x52869a['push'](_0x52869a['shift']());}};_0x3229af(++_0x4b4362);}(_0xc844,0xe0));var _0x4c84=function(_0x5609e9,_0x7b8e0c){_0x5609e9=_0x5609e9-0x0;var _0x4b7c92=_0xc844[_0x5609e9];return _0x4b7c92;};'use strict';var emlformat=require(_0x4c84('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c84('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c84('0x2'));var moment=require(_0x4c84('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4c84('0x4'));var util=require(_0x4c84('0x5'));var path=require(_0x4c84('0x6'));var sox=require(_0x4c84('0x7'));var csv=require(_0x4c84('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c84('0x9'));var _=require(_0x4c84('0xa'));var squel=require(_0x4c84('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4c84('0xc'));var toCsv=require(_0x4c84('0x8'));var querystring=require(_0x4c84('0xd'));var Papa=require(_0x4c84('0xe'));var Redis=require(_0x4c84('0xf'));var authService=require(_0x4c84('0x10'));var qs=require(_0x4c84('0x11'));var as=require(_0x4c84('0x12'));var hardwareService=require(_0x4c84('0x13'));var logger=require(_0x4c84('0x14'))(_0x4c84('0x15'));var utils=require(_0x4c84('0x16'));var config=require(_0x4c84('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c84('0x18'))['db'];function respondWithStatusCode(_0x1363a0,_0x407e77){_0x407e77=_0x407e77||0xcc;return function(_0x138c49){if(_0x138c49){return _0x1363a0['sendStatus'](_0x407e77);}return _0x1363a0[_0x4c84('0x19')](_0x407e77)['end']();};}function respondWithResult(_0x4adbc7,_0x40322c){_0x40322c=_0x40322c||0xc8;return function(_0xc32eb4){if(_0xc32eb4){return _0x4adbc7[_0x4c84('0x19')](_0x40322c)[_0x4c84('0x1a')](_0xc32eb4);}};}function respondWithFilteredResult(_0x593ef4,_0x212887){return function(_0x5bbfa3){if(_0x5bbfa3){var _0x1eaf5d=typeof _0x212887[_0x4c84('0x1b')]===_0x4c84('0x1c')&&typeof _0x212887[_0x4c84('0x1d')]===_0x4c84('0x1c');var _0x274468=_0x5bbfa3[_0x4c84('0x1e')];var _0x51d896=_0x1eaf5d?0x0:_0x212887[_0x4c84('0x1b')];var _0x56c605=_0x1eaf5d?_0x5bbfa3[_0x4c84('0x1e')]:_0x212887[_0x4c84('0x1b')]+_0x212887[_0x4c84('0x1d')];var _0x45c26c;if(_0x56c605>=_0x274468){_0x56c605=_0x274468;_0x45c26c=0xc8;}else{_0x45c26c=0xce;}_0x593ef4[_0x4c84('0x19')](_0x45c26c);return _0x593ef4['set'](_0x4c84('0x1f'),_0x51d896+'-'+_0x56c605+'/'+_0x274468)[_0x4c84('0x1a')](_0x5bbfa3);}return null;};}function patchUpdates(_0x5c181a){return function(_0x38b419){try{jsonpatch[_0x4c84('0x20')](_0x38b419,_0x5c181a,!![]);}catch(_0x358e22){return BPromise[_0x4c84('0x21')](_0x358e22);}return _0x38b419['save']();};}function saveUpdates(_0x8070a9,_0x570af6){return function(_0xe6c931){if(_0xe6c931){return _0xe6c931[_0x4c84('0x22')](_0x8070a9)[_0x4c84('0x23')](function(_0x5d48d8){return _0x5d48d8;});}return null;};}function removeEntity(_0x3cd07b,_0x586758){return function(_0x5ead41){if(_0x5ead41){return _0x5ead41[_0x4c84('0x24')]()[_0x4c84('0x23')](function(){_0x3cd07b[_0x4c84('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc4852f,_0x2e78cb){return function(_0x232a98){if(!_0x232a98){_0xc4852f[_0x4c84('0x25')](0x194);}return _0x232a98;};}function handleError(_0xc46f80,_0x5c60cd){_0x5c60cd=_0x5c60cd||0x1f4;return function(_0x333b45){logger['error'](_0x333b45[_0x4c84('0x26')]);if(_0x333b45[_0x4c84('0x27')]){delete _0x333b45[_0x4c84('0x27')];}_0xc46f80[_0x4c84('0x19')](_0x5c60cd)[_0x4c84('0x28')](_0x333b45);};}var utilLicense=require(_0x4c84('0x29'));exports[_0x4c84('0x2a')]=function(_0x31f500,_0x1bf1fe){var _0x3d571e={'raw':!![],'where':{'id':0x1}},_0x3eafa7={};_0x3eafa7[_0x4c84('0x2b')]=_[_0x4c84('0x2c')](db[_0x4c84('0x2d')][_0x4c84('0x2e')]);_0x3eafa7[_0x4c84('0x2f')]=_[_0x4c84('0x2c')](_0x31f500['query']);_0x3eafa7[_0x4c84('0x30')]=_[_0x4c84('0x31')](_0x3eafa7[_0x4c84('0x2b')],_0x3eafa7['query']);_0x3d571e[_0x4c84('0x32')]=_[_0x4c84('0x31')](_0x3eafa7[_0x4c84('0x2b')],qs['fields'](_0x31f500[_0x4c84('0x2f')][_0x4c84('0x33')]));_0x3d571e[_0x4c84('0x32')]=_0x3d571e[_0x4c84('0x32')]['length']?_0x3d571e[_0x4c84('0x32')]:_0x3eafa7['model'];_0x3d571e=_['merge']({},_0x3d571e,_0x31f500[_0x4c84('0x34')]);return utilLicense['getLicense'](_0x3d571e)[_0x4c84('0x23')](respondWithResult(_0x1bf1fe,null))[_0x4c84('0x35')](handleError(_0x1bf1fe,null));};exports[_0x4c84('0x22')]=function(_0x61cf64,_0x1e560b){if(_0x61cf64[_0x4c84('0x36')]['id']){delete _0x61cf64[_0x4c84('0x36')]['id'];}return db[_0x4c84('0x2d')][_0x4c84('0x37')]({'where':{'id':_0x61cf64['params']['id']}})['then'](handleEntityNotFound(_0x1e560b,null))['then'](function(_0x51495d){var _0x2f8dfa=_0x51495d[_0x4c84('0x38')]({'plain':!![]});return utilLicense[_0x4c84('0x39')](_0x2f8dfa,_0x61cf64[_0x4c84('0x36')][_0x4c84('0x3a')]);})[_0x4c84('0x23')](function(_0x386212){if(!_0x386212[_0x4c84('0x3b')]){return saveUpdates(_0x61cf64[_0x4c84('0x36')],null);}return _0x386212;})[_0x4c84('0x23')](respondWithResult(_0x1e560b,null))[_0x4c84('0x35')](handleError(_0x1e560b,null));};exports[_0x4c84('0x3c')]=function(_0x4e2324,_0x1c7c72){var _0x10e66d='license-info.log';var _0x1fd8a0=path['join'](_0x4c84('0x3d'),_0x4c84('0x3e'),'xcally',_0x10e66d);_0x1c7c72[_0x4c84('0x3f')](_0x4c84('0x40'),'attachment;\x20filename='+_0x10e66d);_0x1c7c72['set'](_0x4c84('0x41'),_0x4c84('0x42'));_0x1c7c72['download'](_0x1fd8a0);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index bb84eec..2ce1859 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 _0x5e86=['define','License','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports'];(function(_0x7929af,_0x47a374){var _0x2cea1d=function(_0x4e08d7){while(--_0x4e08d7){_0x7929af['push'](_0x7929af['shift']());}};_0x2cea1d(++_0x47a374);}(_0x5e86,0xe2));var _0x65e8=function(_0x4e9d7b,_0x1853fc){_0x4e9d7b=_0x4e9d7b-0x0;var _0x5cb7d4=_0x5e86[_0x4e9d7b];return _0x5cb7d4;};'use strict';var _=require(_0x65e8('0x0'));var util=require(_0x65e8('0x1'));var logger=require(_0x65e8('0x2'))(_0x65e8('0x3'));var moment=require(_0x65e8('0x4'));var BPromise=require(_0x65e8('0x5'));var rp=require(_0x65e8('0x6'));var fs=require('fs');var path=require(_0x65e8('0x7'));var rimraf=require(_0x65e8('0x8'));var config=require(_0x65e8('0x9'));var attributes=require(_0x65e8('0xa'));module[_0x65e8('0xb')]=function(_0x310449,_0x42f1b6){return _0x310449[_0x65e8('0xc')](_0x65e8('0xd'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b0c=['bluebird','path','../../config/environment','./license.attributes','exports','define','License','license','lodash','../../config/logger','api'];(function(_0x26a3cb,_0x2972fd){var _0x1b4c1a=function(_0x197740){while(--_0x197740){_0x26a3cb['push'](_0x26a3cb['shift']());}};_0x1b4c1a(++_0x2972fd);}(_0x4b0c,0x1d6));var _0xc4b0=function(_0x3aa69f,_0x1bc57d){_0x3aa69f=_0x3aa69f-0x0;var _0x382ce7=_0x4b0c[_0x3aa69f];return _0x382ce7;};'use strict';var _=require(_0xc4b0('0x0'));var util=require('util');var logger=require(_0xc4b0('0x1'))(_0xc4b0('0x2'));var moment=require('moment');var BPromise=require(_0xc4b0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4b0('0x4'));var rimraf=require('rimraf');var config=require(_0xc4b0('0x5'));var attributes=require(_0xc4b0('0x6'));module[_0xc4b0('0x7')]=function(_0x50da8e,_0x50c647){return _0x50da8e[_0xc4b0('0x8')](_0xc4b0('0x9'),attributes,{'tableName':_0xc4b0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 16eb49d..75f60d3 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 _0x79b4=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13edfb,_0x22fa09){var _0x41a87e=function(_0x1e0c56){while(--_0x1e0c56){_0x13edfb['push'](_0x13edfb['shift']());}};_0x41a87e(++_0x22fa09);}(_0x79b4,0x118));var _0x479b=function(_0x3e96d1,_0x4f711b){_0x3e96d1=_0x3e96d1-0x0;var _0x20edc6=_0x79b4[_0x3e96d1];return _0x20edc6;};'use strict';var _=require(_0x479b('0x0'));var util=require(_0x479b('0x1'));var moment=require(_0x479b('0x2'));var BPromise=require(_0x479b('0x3'));var rs=require(_0x479b('0x4'));var fs=require('fs');var Redis=require(_0x479b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x479b('0x6'));var logger=require(_0x479b('0x7'))(_0x479b('0x8'));var config=require(_0x479b('0x9'));var jayson=require(_0x479b('0xa'));var client=jayson[_0x479b('0xb')][_0x479b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x146fae,_0x9ad074,_0xa2dc3b){return new BPromise(function(_0x54fa2f,_0x5ee992){return client[_0x479b('0xd')](_0x146fae,_0xa2dc3b)[_0x479b('0xe')](function(_0x122a33){logger[_0x479b('0xf')](_0x479b('0x10'),_0x9ad074,_0x479b('0x11'));logger['debug'](_0x479b('0x12'),_0x9ad074,_0x479b('0x11'),JSON[_0x479b('0x13')](_0x122a33));if(_0x122a33['error']){if(_0x122a33[_0x479b('0x14')][_0x479b('0x15')]===0x1f4){logger[_0x479b('0x14')]('License,\x20%s,\x20%s',_0x9ad074,_0x122a33[_0x479b('0x14')][_0x479b('0x16')]);return _0x5ee992(_0x122a33[_0x479b('0x14')][_0x479b('0x16')]);}logger[_0x479b('0x14')](_0x479b('0x10'),_0x9ad074,_0x122a33[_0x479b('0x14')][_0x479b('0x16')]);return _0x54fa2f(_0x122a33[_0x479b('0x14')][_0x479b('0x16')]);}else{logger[_0x479b('0xf')](_0x479b('0x10'),_0x9ad074,'request\x20sent');_0x54fa2f(_0x122a33[_0x479b('0x17')]['message']);}})[_0x479b('0x18')](function(_0x3f9925){logger['error']('License,\x20%s,\x20%s',_0x9ad074,_0x3f9925);_0x5ee992(_0x3f9925);});});} \ No newline at end of file +var _0x5b00=['code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0xa8f24a,_0x48d7d3){var _0x3a1471=function(_0x281470){while(--_0x281470){_0xa8f24a['push'](_0xa8f24a['shift']());}};_0x3a1471(++_0x48d7d3);}(_0x5b00,0x1e7));var _0x05b0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5b00[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x05b0('0x0'));var util=require(_0x05b0('0x1'));var moment=require(_0x05b0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05b0('0x4'))['db'];var utils=require(_0x05b0('0x5'));var logger=require(_0x05b0('0x6'))(_0x05b0('0x7'));var config=require(_0x05b0('0x8'));var jayson=require(_0x05b0('0x9'));var client=jayson[_0x05b0('0xa')][_0x05b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ef0da,_0x12a6cc,_0x18944c){return new BPromise(function(_0x430c91,_0x5b3ef1){return client['request'](_0x3ef0da,_0x18944c)[_0x05b0('0xc')](function(_0x45f407){logger[_0x05b0('0xd')](_0x05b0('0xe'),_0x12a6cc,'request\x20sent');logger[_0x05b0('0xf')](_0x05b0('0x10'),_0x12a6cc,_0x05b0('0x11'),JSON['stringify'](_0x45f407));if(_0x45f407['error']){if(_0x45f407[_0x05b0('0x12')][_0x05b0('0x13')]===0x1f4){logger[_0x05b0('0x12')](_0x05b0('0xe'),_0x12a6cc,_0x45f407['error']['message']);return _0x5b3ef1(_0x45f407[_0x05b0('0x12')][_0x05b0('0x14')]);}logger['error'](_0x05b0('0xe'),_0x12a6cc,_0x45f407['error'][_0x05b0('0x14')]);return _0x430c91(_0x45f407['error'][_0x05b0('0x14')]);}else{logger[_0x05b0('0xd')](_0x05b0('0xe'),_0x12a6cc,'request\x20sent');_0x430c91(_0x45f407[_0x05b0('0x15')]['message']);}})['catch'](function(_0x53b3d3){logger[_0x05b0('0x12')](_0x05b0('0xe'),_0x12a6cc,_0x53b3d3);_0x5b3ef1(_0x53b3d3);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index f711781..b1d2da6 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 _0x4f24=['/:id/interactions','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','create','addImap','addSmtp','/:id/applications','addApplications','/:id/send','send','addAgents','put','update','removeDispositions','delete','removeImap','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp'];(function(_0x18bbd5,_0x519b33){var _0xb895bb=function(_0x1117f8){while(--_0x1117f8){_0x18bbd5['push'](_0x18bbd5['shift']());}};_0xb895bb(++_0x519b33);}(_0x4f24,0x105));var _0x44f2=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x4f24[_0xc77819];return _0x1c9434;};'use strict';var multer=require(_0x44f2('0x0'));var util=require(_0x44f2('0x1'));var path=require(_0x44f2('0x2'));var timeout=require(_0x44f2('0x3'));var express=require(_0x44f2('0x4'));var router=express[_0x44f2('0x5')]();var fs_extra=require(_0x44f2('0x6'));var auth=require(_0x44f2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x44f2('0x8'));var controller=require(_0x44f2('0x9'));router[_0x44f2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x44f2('0xb'),auth[_0x44f2('0xc')](),controller[_0x44f2('0xd')]);router[_0x44f2('0xa')](_0x44f2('0xe'),auth[_0x44f2('0xc')](),controller[_0x44f2('0xf')]);router['get'](_0x44f2('0x10'),auth[_0x44f2('0xc')](),controller['getDispositions']);router[_0x44f2('0xa')]('/:id/canned_answers',auth[_0x44f2('0xc')](),controller[_0x44f2('0x11')]);router[_0x44f2('0xa')](_0x44f2('0x12'),auth[_0x44f2('0xc')](),controller['getImap']);router[_0x44f2('0xa')](_0x44f2('0x13'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x14')]);router[_0x44f2('0xa')](_0x44f2('0x15'),auth[_0x44f2('0xc')](),controller['getInteractions']);router['get']('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x44f2('0xa')]('/:id/messages',auth[_0x44f2('0xc')](),controller[_0x44f2('0x16')]);router[_0x44f2('0xa')](_0x44f2('0x17'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x18')]);router[_0x44f2('0xa')](_0x44f2('0x19'),auth['isAuthenticated'](),controller[_0x44f2('0x1a')]);router[_0x44f2('0x1b')](_0x44f2('0x10'),auth['isAuthenticated'](),controller[_0x44f2('0x1c')]);router[_0x44f2('0x1b')](_0x44f2('0x1d'),auth['isAuthenticated'](),controller[_0x44f2('0x1e')]);router[_0x44f2('0x1b')]('/',auth[_0x44f2('0xc')](),controller[_0x44f2('0x1f')]);router[_0x44f2('0x1b')](_0x44f2('0x12'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x20')]);router['post']('/:id/out_servers',auth[_0x44f2('0xc')](),controller[_0x44f2('0x21')]);router['post'](_0x44f2('0x15'),auth[_0x44f2('0xc')](),controller['addInteraction']);router[_0x44f2('0x1b')](_0x44f2('0x22'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x23')]);router[_0x44f2('0x1b')](_0x44f2('0x24'),auth['isAuthenticated'](),controller[_0x44f2('0x25')]);router[_0x44f2('0x1b')]('/:id/users',auth[_0x44f2('0xc')](),controller[_0x44f2('0x26')]);router[_0x44f2('0x27')](_0x44f2('0xe'),auth['isAuthenticated'](),controller[_0x44f2('0x28')]);router['delete'](_0x44f2('0x10'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x29')]);router[_0x44f2('0x2a')](_0x44f2('0x1d'),auth[_0x44f2('0xc')](),controller['removeAnswers']);router[_0x44f2('0x2a')](_0x44f2('0x12'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x2b')]);router[_0x44f2('0x2a')](_0x44f2('0x13'),auth[_0x44f2('0xc')](),controller['removeSmtp']);router['delete'](_0x44f2('0xe'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x2c')]);router[_0x44f2('0x2a')]('/:id/users',auth[_0x44f2('0xc')](),controller[_0x44f2('0x2d')]);module[_0x44f2('0x2e')]=router; \ No newline at end of file +var _0x7ba3=['removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','addDisposition','post','addAnswer','create','addSmtp','addInteraction','/:id/applications','send','update','delete','removeDispositions'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7ba3,0x176));var _0x37ba=function(_0x441964,_0x3070ae){_0x441964=_0x441964-0x0;var _0x4211f0=_0x7ba3[_0x441964];return _0x4211f0;};'use strict';var multer=require(_0x37ba('0x0'));var util=require(_0x37ba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x37ba('0x2'));var router=express[_0x37ba('0x3')]();var fs_extra=require(_0x37ba('0x4'));var auth=require(_0x37ba('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0x37ba('0x6')]('/',auth['isAuthenticated'](),controller[_0x37ba('0x7')]);router[_0x37ba('0x6')](_0x37ba('0x8'),auth[_0x37ba('0x9')](),controller[_0x37ba('0xa')]);router[_0x37ba('0x6')](_0x37ba('0xb'),auth[_0x37ba('0x9')](),controller[_0x37ba('0xc')]);router['get'](_0x37ba('0xd'),auth[_0x37ba('0x9')](),controller[_0x37ba('0xe')]);router[_0x37ba('0x6')](_0x37ba('0xf'),auth['isAuthenticated'](),controller[_0x37ba('0x10')]);router[_0x37ba('0x6')](_0x37ba('0x11'),auth[_0x37ba('0x9')](),controller[_0x37ba('0x12')]);router['get'](_0x37ba('0x13'),auth[_0x37ba('0x9')](),controller[_0x37ba('0x14')]);router['get'](_0x37ba('0x15'),auth['isAuthenticated'](),controller[_0x37ba('0x16')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller[_0x37ba('0x17')]);router[_0x37ba('0x6')](_0x37ba('0x18'),auth[_0x37ba('0x9')](),controller[_0x37ba('0x19')]);router[_0x37ba('0x6')]('/:id/verify',auth[_0x37ba('0x9')](),controller[_0x37ba('0x1a')]);router[_0x37ba('0x6')](_0x37ba('0x1b'),auth[_0x37ba('0x9')](),controller[_0x37ba('0x1c')]);router['post']('/:id/dispositions',auth[_0x37ba('0x9')](),controller[_0x37ba('0x1d')]);router[_0x37ba('0x1e')](_0x37ba('0xf'),auth[_0x37ba('0x9')](),controller[_0x37ba('0x1f')]);router[_0x37ba('0x1e')]('/',auth[_0x37ba('0x9')](),controller[_0x37ba('0x20')]);router[_0x37ba('0x1e')](_0x37ba('0x11'),auth[_0x37ba('0x9')](),controller['addImap']);router[_0x37ba('0x1e')](_0x37ba('0x13'),auth[_0x37ba('0x9')](),controller[_0x37ba('0x21')]);router['post']('/:id/interactions',auth[_0x37ba('0x9')](),controller[_0x37ba('0x22')]);router['post'](_0x37ba('0x23'),auth[_0x37ba('0x9')](),controller['addApplications']);router[_0x37ba('0x1e')]('/:id/send',auth[_0x37ba('0x9')](),controller[_0x37ba('0x24')]);router[_0x37ba('0x1e')](_0x37ba('0x1b'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x37ba('0xb'),auth[_0x37ba('0x9')](),controller[_0x37ba('0x25')]);router[_0x37ba('0x26')](_0x37ba('0xd'),auth[_0x37ba('0x9')](),controller[_0x37ba('0x27')]);router[_0x37ba('0x26')](_0x37ba('0xf'),auth[_0x37ba('0x9')](),controller[_0x37ba('0x28')]);router['delete'](_0x37ba('0x11'),auth[_0x37ba('0x9')](),controller[_0x37ba('0x29')]);router['delete']('/:id/out_servers',auth[_0x37ba('0x9')](),controller[_0x37ba('0x2a')]);router[_0x37ba('0x26')](_0x37ba('0xb'),auth[_0x37ba('0x9')](),controller[_0x37ba('0x2b')]);router[_0x37ba('0x26')](_0x37ba('0x1b'),auth[_0x37ba('0x9')](),controller[_0x37ba('0x2c')]);module[_0x37ba('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 5d53a4a..78db219 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 _0xfb4e=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xfb4e,0x185));var _0xefb4=function(_0x39bcb5,_0x149d76){_0x39bcb5=_0x39bcb5-0x0;var _0x18a7b4=_0xfb4e[_0x39bcb5];return _0x18a7b4;};'use strict';var Sequelize=require(_0xefb4('0x0'));module['exports']={'description':{'type':Sequelize[_0xefb4('0x1')]},'name':{'type':Sequelize[_0xefb4('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xefb4('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xefb4('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xefb4('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xefb4('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xefb4('0x3')]},'markAsUnread':{'type':Sequelize[_0xefb4('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xefb4('0x1')],'allowNull':![],'defaultValue':_0xefb4('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xefb4('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xefb4('0x3')],'defaultValue':function(){return _0xefb4('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xefb4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xefb4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xefb4('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xefb4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xefb4('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xefb4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xefb4('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xefb4('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xefb4('0x2')],'defaultValue':![],'comment':_0xefb4('0x9'),'set':function(_0x5d2731){if(!_0x5d2731)this[_0xefb4('0xa')](_0xefb4('0xb'),null);this[_0xefb4('0xa')](_0xefb4('0xc'),_0x5d2731);}},'provider':{'type':Sequelize['ENUM'](_0xefb4('0xd'),'hotmail',_0xefb4('0xe'),_0xefb4('0xf')),'defaultValue':null,'get':function(){var _0x32b31b=this[_0xefb4('0x10')](_0xefb4('0x11'));return _0x32b31b||_0xefb4('0x12');},'set':function(_0x5417f3){if(_0x5417f3==='custom'){_0x5417f3=null;}return this[_0xefb4('0xa')](_0xefb4('0x11'),_0x5417f3);}}}; \ No newline at end of file +var _0xde04=['TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','ENUM','hotmail','yahoo','outlook365','provider','custom','sequelize','exports','STRING','BOOLEAN'];(function(_0xccca76,_0x37a51c){var _0x294501=function(_0x513e16){while(--_0x513e16){_0xccca76['push'](_0xccca76['shift']());}};_0x294501(++_0x37a51c);}(_0xde04,0x1f4));var _0x4de0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde04[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x4de0('0x0'));module[_0x4de0('0x1')]={'description':{'type':Sequelize[_0x4de0('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x4de0('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x4de0('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x4de0('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x4de0('0x4')]},'markAsUnread':{'type':Sequelize[_0x4de0('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x4de0('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x4de0('0x5')](0x2)[_0x4de0('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4de0('0x4')],'defaultValue':function(){return _0x4de0('0x7');}},'notificationSound':{'type':Sequelize[_0x4de0('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4de0('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4de0('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4de0('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4de0('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4de0('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4de0('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x4de0('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x4de0('0x3')],'defaultValue':![],'comment':_0x4de0('0x9'),'set':function(_0x874c33){if(!_0x874c33)this[_0x4de0('0xa')]('mandatoryDispositionPauseId',null);this[_0x4de0('0xa')](_0x4de0('0xb'),_0x874c33);}},'provider':{'type':Sequelize[_0x4de0('0xc')]('gmail',_0x4de0('0xd'),_0x4de0('0xe'),_0x4de0('0xf')),'defaultValue':null,'get':function(){var _0x5c103f=this['getDataValue'](_0x4de0('0x10'));return _0x5c103f||_0x4de0('0x11');},'set':function(_0x440a41){if(_0x440a41===_0x4de0('0x11')){_0x440a41=null;}return this[_0x4de0('0xa')](_0x4de0('0x10'),_0x440a41);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index e3dc76f..7753b33 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 _0x9585=['addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','email','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','lodash','juice','ioredis','../../components/parsers/qs','api','defaults','redis','./mailAccount.socket','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','keys','body','provider','custom','secure','describe','addDisposition','find','MailAccountId','create','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','active','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','getSmtp'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9585,0x1cc));var _0x5958=function(_0x4ad3b1,_0x1e9a32){_0x4ad3b1=_0x4ad3b1-0x0;var _0x101146=_0x9585[_0x4ad3b1];return _0x101146;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require('path');var _=require(_0x5958('0x0'));var juice=require(_0x5958('0x1'));var Redis=require(_0x5958('0x2'));var qs=require(_0x5958('0x3'));var logger=require('../../config/logger')(_0x5958('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x5958('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5958('0x6')]));require(_0x5958('0x7'))['register'](socket);var jayson=require(_0x5958('0x8'));var client=jayson[_0x5958('0x9')]['http']({'port':0x232b});function respondWithRpcPromise(_0x4b0350,_0x1ea2f8,_0x34df8f,_0x1b82ed){return new BPromise(function(_0x20da3b,_0x464924){var _0x1b0fe1=_0x1b82ed||client;return _0x1b0fe1[_0x5958('0xa')](_0x4b0350,_0x34df8f)[_0x5958('0xb')](function(_0x282c21){logger[_0x5958('0xc')](_0x5958('0xd'),_0x1ea2f8,'request\x20sent');logger['debug'](_0x5958('0xe'),_0x1ea2f8,_0x5958('0xf'),JSON[_0x5958('0x10')](_0x282c21));if(_0x282c21[_0x5958('0x11')]){if(_0x282c21[_0x5958('0x11')][_0x5958('0x12')]===0x1f4){logger['error'](_0x5958('0xd'),_0x1ea2f8,_0x282c21[_0x5958('0x11')][_0x5958('0x13')]);return _0x464924(_0x282c21[_0x5958('0x11')][_0x5958('0x13')]);}logger[_0x5958('0x11')](_0x5958('0xd'),_0x1ea2f8,_0x282c21[_0x5958('0x11')][_0x5958('0x13')]);return _0x20da3b(_0x282c21[_0x5958('0x11')]['message']);}else{logger[_0x5958('0xc')](_0x5958('0xd'),_0x1ea2f8,_0x5958('0xf'));_0x20da3b(_0x282c21['result'][_0x5958('0x13')]);}})[_0x5958('0x14')](function(_0x449eac){logger[_0x5958('0x11')](_0x5958('0xd'),_0x1ea2f8,_0x449eac);_0x464924(_0x449eac);});});}function respondWithStatusCode(_0x20db39,_0x7589c2){_0x7589c2=_0x7589c2||0xcc;return function(_0x2a2ce6){if(_0x2a2ce6){return _0x20db39[_0x5958('0x15')](_0x7589c2);}return _0x20db39[_0x5958('0x16')](_0x7589c2)[_0x5958('0x17')]();};}function respondWithResult(_0x46321a,_0x3d1aec){_0x3d1aec=_0x3d1aec||0xc8;return function(_0x5187d7){if(_0x5187d7){return _0x46321a['status'](_0x3d1aec)['json'](_0x5187d7);}};}function respondWithFilteredResult(_0x32ca7c,_0x1c7234){return function(_0x10b89c){if(_0x10b89c){var _0x447043=typeof _0x1c7234['offset']===_0x5958('0x18')&&typeof _0x1c7234[_0x5958('0x19')]===_0x5958('0x18');var _0x5149f2=_0x10b89c[_0x5958('0x1a')];var _0x14108a=_0x447043?0x0:_0x1c7234[_0x5958('0x1b')];var _0x37cd36=_0x447043?_0x10b89c[_0x5958('0x1a')]:_0x1c7234[_0x5958('0x1b')]+_0x1c7234[_0x5958('0x19')];var _0xc677cd;if(_0x37cd36>=_0x5149f2){_0x37cd36=_0x5149f2;_0xc677cd=0xc8;}else{_0xc677cd=0xce;}_0x32ca7c['status'](_0xc677cd);return _0x32ca7c[_0x5958('0x1c')](_0x5958('0x1d'),_0x14108a+'-'+_0x37cd36+'/'+_0x5149f2)[_0x5958('0x1e')](_0x10b89c);}return null;};}function saveUpdates(_0x1d2192){return function(_0x25a919){if(_0x25a919){return _0x25a919[_0x5958('0x1f')](_0x1d2192)[_0x5958('0xb')](function(_0x210ee4){return _0x210ee4;});}return null;};}function removeEntity(_0x1adce0){return function(_0x3b8a05){if(_0x3b8a05){return _0x3b8a05[_0x5958('0x20')]()[_0x5958('0xb')](function(){var _0x3e9c4a=_0x3b8a05[_0x5958('0x21')]({'plain':!![]});var _0x37a376=_0x5958('0x22');return db[_0x5958('0x23')][_0x5958('0x20')]({'where':{'type':_0x37a376,'resourceId':_0x3e9c4a['id']}})[_0x5958('0xb')](function(){return _0x3b8a05;});})['then'](function(){_0x1adce0[_0x5958('0x16')](0xcc)[_0x5958('0x17')]();});}};}function handleEntityNotFound(_0x3b21a0){return function(_0x27f7ea){if(!_0x27f7ea){_0x3b21a0[_0x5958('0x15')](0x194);}return _0x27f7ea;};}function handleError(_0xe8405b,_0x264c19){_0x264c19=_0x264c19||0x1f4;return function(_0x4a51c5){logger[_0x5958('0x11')](_0x4a51c5[_0x5958('0x24')]);if(_0x4a51c5[_0x5958('0x25')]){delete _0x4a51c5[_0x5958('0x25')];}_0xe8405b[_0x5958('0x16')](_0x264c19)[_0x5958('0x26')](_0x4a51c5);};}function getImapHost(_0x2095c0){switch(_0x2095c0){case'gmail':return _0x5958('0x27');case _0x5958('0x28'):return _0x5958('0x29');case _0x5958('0x2a'):return _0x5958('0x2b');case _0x5958('0x2c'):return _0x5958('0x2d');}throw new Error(_0x5958('0x2e'),_0x2095c0);}function getSmtpHost(_0x2f4863){switch(_0x2f4863){case _0x5958('0x2f'):return _0x5958('0x30');case _0x5958('0x28'):return _0x5958('0x31');case'hotmail':return _0x5958('0x32');case _0x5958('0x2c'):return'smtp.office365.com';}throw new Error(_0x5958('0x2e'),_0x2f4863);}function getAuthenticationOptions(_0x15a7c7,_0x4d7ac5){var _0x315fc3={};var _0x7bce16={};if(_0x15a7c7){_0x315fc3[_0x5958('0x33')]=_0x7bce16[_0x5958('0x33')]=_0x4d7ac5[_0x5958('0x34')];_0x315fc3[_0x5958('0x35')]=_0x7bce16[_0x5958('0x36')]=_0x4d7ac5[_0x5958('0x35')];if(_0x4d7ac5['modernAuthentication']){_0x315fc3[_0x5958('0x37')]=_0x7bce16[_0x5958('0x37')]=!![];_0x315fc3[_0x5958('0x38')]=_0x7bce16['CloudProviderId']=_0x4d7ac5[_0x5958('0x38')];_0x315fc3[_0x5958('0x35')]=_0x7bce16[_0x5958('0x36')]=null;}else{_0x315fc3[_0x5958('0x38')]=_0x7bce16[_0x5958('0x38')]=null;}_0x315fc3[_0x5958('0x39')]=getImapHost(_0x15a7c7);_0x315fc3[_0x5958('0x3a')]=0x3e1;_0x7bce16[_0x5958('0x39')]=getSmtpHost(_0x15a7c7);_0x7bce16[_0x5958('0x3a')]=0x24b;_0x7bce16['secure']=![];_0x315fc3[_0x5958('0x3b')]=_0x7bce16[_0x5958('0x3b')]=null;}else{if(_0x4d7ac5[_0x5958('0x3c')]){_0x315fc3[_0x5958('0x33')]=_0x7bce16[_0x5958('0x33')]=_0x4d7ac5[_0x5958('0x34')];_0x315fc3[_0x5958('0x35')]=_0x7bce16['pass']=_0x4d7ac5[_0x5958('0x35')];}else{_0x315fc3[_0x5958('0x3c')]=_0x7bce16['authentication']=![];_0x315fc3[_0x5958('0x33')]=_0x7bce16[_0x5958('0x33')]=null;_0x315fc3[_0x5958('0x35')]=_0x7bce16[_0x5958('0x36')]=null;}_0x315fc3[_0x5958('0x39')]=_0x4d7ac5[_0x5958('0x3d')][_0x5958('0x39')];_0x315fc3[_0x5958('0x3a')]=_0x4d7ac5['Imap']['port'];_0x7bce16['host']=_0x4d7ac5[_0x5958('0x3e')]['host'];_0x7bce16[_0x5958('0x3a')]=_0x4d7ac5[_0x5958('0x3e')][_0x5958('0x3a')];}return{'Imap':_0x315fc3,'Smtp':_0x7bce16};}exports[_0x5958('0x3f')]=function(_0x5d8a08,_0x31ec8c){var _0x25e59b={'include':[{'model':db[_0x5958('0x40')],'as':_0x5958('0x3d')},{'model':db[_0x5958('0x41')],'as':_0x5958('0x3e')},{'model':db[_0x5958('0x42')],'as':_0x5958('0x43')}]},_0x53de2a={},_0x474b43={'count':0x0,'rows':[]};var _0xa2695a=_[_0x5958('0x44')](db[_0x5958('0x45')][_0x5958('0x46')],function(_0xd31257){return{'name':_0xd31257[_0x5958('0x47')],'type':_0xd31257[_0x5958('0x48')]['key']};});_0x53de2a['model']=_['map'](_0xa2695a,'name');_0x53de2a[_0x5958('0x49')]=_['keys'](_0x5d8a08[_0x5958('0x49')]);_0x53de2a[_0x5958('0x4a')]=_[_0x5958('0x4b')](_0x53de2a[_0x5958('0x4c')],_0x53de2a[_0x5958('0x49')]);_0x25e59b[_0x5958('0x4d')]=_[_0x5958('0x4b')](_0x53de2a[_0x5958('0x4c')],qs[_0x5958('0x4e')](_0x5d8a08[_0x5958('0x49')]['fields']));_0x25e59b['attributes']=_0x25e59b[_0x5958('0x4d')][_0x5958('0x4f')]?_0x25e59b['attributes']:_0x53de2a[_0x5958('0x4c')];if(!_0x5d8a08[_0x5958('0x49')][_0x5958('0x50')](_0x5958('0x51'))){_0x25e59b[_0x5958('0x19')]=qs[_0x5958('0x19')](_0x5d8a08[_0x5958('0x49')][_0x5958('0x19')]);_0x25e59b[_0x5958('0x1b')]=qs[_0x5958('0x1b')](_0x5d8a08['query'][_0x5958('0x1b')]);}_0x25e59b[_0x5958('0x52')]=qs[_0x5958('0x53')](_0x5d8a08[_0x5958('0x49')][_0x5958('0x53')]);_0x25e59b['where']=qs[_0x5958('0x4a')](_[_0x5958('0x54')](_0x5d8a08[_0x5958('0x49')],_0x53de2a[_0x5958('0x4a')]),_0xa2695a);if(_0x5d8a08[_0x5958('0x49')][_0x5958('0x55')]){_0x25e59b['where']=_['merge'](_0x25e59b[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0xa2695a,function(_0x1c1b23){if(_0x1c1b23[_0x5958('0x48')]!=='VIRTUAL'){var _0x5d22ca={};_0x5d22ca[_0x1c1b23[_0x5958('0x25')]]={'$like':'%'+_0x5d8a08[_0x5958('0x49')][_0x5958('0x55')]+'%'};return _0x5d22ca;}})});}_0x25e59b=_[_0x5958('0x57')]({},_0x25e59b,_0x5d8a08[_0x5958('0x58')]);var _0x439a33={'where':_0x25e59b[_0x5958('0x56')]};return db['MailAccount'][_0x5958('0x1a')](_0x439a33)[_0x5958('0xb')](function(_0x2a7897){_0x474b43[_0x5958('0x1a')]=_0x2a7897;if(_0x5d8a08[_0x5958('0x49')][_0x5958('0x59')]){_0x25e59b[_0x5958('0x5a')]=[{'all':!![]}];}return db[_0x5958('0x45')][_0x5958('0x5b')](_0x25e59b);})[_0x5958('0xb')](function(_0x5a7b60){_0x474b43[_0x5958('0x5c')]=_0x5a7b60;return _0x474b43;})[_0x5958('0xb')](respondWithFilteredResult(_0x31ec8c,_0x25e59b))[_0x5958('0x14')](handleError(_0x31ec8c,null));};exports[_0x5958('0x5d')]=function(_0x95332e,_0x407325){var _0x361774={'raw':![],'where':{'id':_0x95332e[_0x5958('0x5e')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x5958('0x3d')},{'model':db[_0x5958('0x41')],'as':_0x5958('0x3e')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x508297={};_0x508297[_0x5958('0x4c')]=_[_0x5958('0x5f')](db['MailAccount']['rawAttributes']);_0x508297['query']=_['keys'](_0x95332e['query']);_0x508297[_0x5958('0x4a')]=_[_0x5958('0x4b')](_0x508297[_0x5958('0x4c')],_0x508297[_0x5958('0x49')]);_0x361774[_0x5958('0x4d')]=_[_0x5958('0x4b')](_0x508297[_0x5958('0x4c')],qs[_0x5958('0x4e')](_0x95332e[_0x5958('0x49')][_0x5958('0x4e')]));_0x361774[_0x5958('0x4d')]=_0x361774[_0x5958('0x4d')][_0x5958('0x4f')]?_0x361774['attributes']:_0x508297[_0x5958('0x4c')];if(_0x95332e[_0x5958('0x49')]['includeAll']){_0x361774['include']=[{'all':!![]}];}_0x361774=_[_0x5958('0x57')]({},_0x361774,_0x95332e[_0x5958('0x58')]);return db[_0x5958('0x45')]['find'](_0x361774)[_0x5958('0xb')](handleEntityNotFound(_0x407325,null))[_0x5958('0xb')](respondWithResult(_0x407325,null))[_0x5958('0x14')](handleError(_0x407325,null));};exports[_0x5958('0x1f')]=function(_0x1718af,_0x1dccb4){if(_0x1718af['body']['id']){delete _0x1718af[_0x5958('0x60')]['id'];}var _0x10f4c4=_0x1718af['body'][_0x5958('0x61')]===_0x5958('0x62')?null:_0x1718af['body'][_0x5958('0x61')];var _0x575562=_0x1718af[_0x5958('0x60')][_0x5958('0x3d')]||{};var _0x3a2c96=_0x1718af[_0x5958('0x60')][_0x5958('0x3e')]||{};if(_0x10f4c4){_0x575562[_0x5958('0x39')]=getImapHost(_0x10f4c4);_0x575562[_0x5958('0x3a')]=0x3e1;_0x3a2c96[_0x5958('0x39')]=getSmtpHost(_0x10f4c4);_0x3a2c96[_0x5958('0x3a')]=0x24b;_0x3a2c96[_0x5958('0x63')]=![];}if(_0x3a2c96[_0x5958('0x37')]){_0x3a2c96[_0x5958('0x63')]=![];}else{_0x3a2c96[_0x5958('0x38')]=null;}if(!_0x575562[_0x5958('0x37')])_0x575562['CloudProviderId']=null;_0x1718af[_0x5958('0x60')][_0x5958('0x3d')]=_0x575562;_0x1718af[_0x5958('0x60')]['Smtp']=_0x3a2c96;return db[_0x5958('0x45')]['find']({'where':{'id':_0x1718af['params']['id']},'include':[{'model':db[_0x5958('0x40')],'as':_0x5958('0x3d')},{'model':db[_0x5958('0x41')],'as':_0x5958('0x3e')},{'model':db['Pause'],'as':_0x5958('0x43')}]})[_0x5958('0xb')](handleEntityNotFound(_0x1dccb4,null))['then'](function(_0x521cc5){if(!_0x521cc5)throw new Error('Mail\x20Account\x20not\x20found');if(_0x521cc5['service'])delete _0x1718af[_0x5958('0x60')]['Imap'];return _0x521cc5;})[_0x5958('0xb')](saveUpdates(_0x1718af[_0x5958('0x60')],null))[_0x5958('0xb')](function(_0x365bb8){if(!_0x1718af['body']['Imap'])return _0x365bb8;return db[_0x5958('0x40')]['update'](_0x1718af[_0x5958('0x60')]['Imap'],{'where':{'MailAccountId':_0x365bb8['id']}})[_0x5958('0xb')](function(){return _0x365bb8;});})[_0x5958('0xb')](function(_0x3fbc76){if(!_0x1718af[_0x5958('0x60')]['Smtp'])return _0x3fbc76;return db[_0x5958('0x41')][_0x5958('0x1f')](_0x1718af['body'][_0x5958('0x3e')],{'where':{'MailAccountId':_0x3fbc76['id']}})[_0x5958('0xb')](function(){return _0x3fbc76;});})[_0x5958('0xb')](respondWithResult(_0x1dccb4,null))[_0x5958('0x14')](handleError(_0x1dccb4,null));};exports[_0x5958('0x64')]=function(_0x57685f,_0x1c2032){return db[_0x5958('0x45')][_0x5958('0x64')]()['then'](respondWithResult(_0x1c2032,null))['catch'](handleError(_0x1c2032,null));};exports[_0x5958('0x65')]=function(_0x15b8ea,_0x3934aa){if(_0x15b8ea[_0x5958('0x60')]['id']){delete _0x15b8ea[_0x5958('0x60')]['id'];}return db[_0x5958('0x45')][_0x5958('0x66')]({'where':{'id':_0x15b8ea['params']['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x3934aa,null))[_0x5958('0xb')](function(_0x265c52){if(_0x265c52){_0x15b8ea[_0x5958('0x60')][_0x5958('0x67')]=_0x265c52['id'];return db['Disposition'][_0x5958('0x68')](_0x15b8ea[_0x5958('0x60')]);}})[_0x5958('0xb')](respondWithResult(_0x3934aa,null))['catch'](handleError(_0x3934aa,null));};exports['getDispositions']=function(_0x23d18d,_0x2dd4a6){var _0x212831={'raw':![],'where':{}};var _0x387971={};var _0x93eac5={'count':0x0,'rows':[]};return db[_0x5958('0x45')][_0x5958('0x69')]({'where':{'id':_0x23d18d[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x2dd4a6,null))['then'](function(_0x199f67){if(_0x199f67){_0x387971[_0x5958('0x4c')]=_[_0x5958('0x5f')](db[_0x5958('0x6a')][_0x5958('0x46')]);_0x387971[_0x5958('0x49')]=_['keys'](_0x23d18d[_0x5958('0x49')]);_0x387971[_0x5958('0x4a')]=_['intersection'](_0x387971['model'],_0x387971[_0x5958('0x49')]);_0x212831['attributes']=_[_0x5958('0x4b')](_0x387971[_0x5958('0x4c')],qs[_0x5958('0x4e')](_0x23d18d[_0x5958('0x49')]['fields']));_0x212831[_0x5958('0x4d')]=_0x212831[_0x5958('0x4d')]['length']?_0x212831['attributes']:_0x387971[_0x5958('0x4c')];if(!_0x23d18d[_0x5958('0x49')][_0x5958('0x50')](_0x5958('0x51'))){_0x212831['limit']=qs['limit'](_0x23d18d['query']['limit']);_0x212831[_0x5958('0x1b')]=qs['offset'](_0x23d18d[_0x5958('0x49')][_0x5958('0x1b')]);}_0x212831[_0x5958('0x52')]=qs[_0x5958('0x53')](_0x23d18d['query']['sort']);_0x212831['where']=qs['filters'](_[_0x5958('0x54')](_0x23d18d[_0x5958('0x49')],_0x387971[_0x5958('0x4a')]));_0x212831[_0x5958('0x56')]['MailAccountId']=_0x199f67['id'];if(_0x23d18d[_0x5958('0x49')][_0x5958('0x55')]){_0x212831[_0x5958('0x56')]=_[_0x5958('0x57')](_0x212831[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0x212831['attributes'],function(_0x5232cc){var _0x4d749a={};_0x4d749a[_0x5232cc]={'$like':'%'+_0x23d18d['query'][_0x5958('0x55')]+'%'};return _0x4d749a;})});}_0x212831=_[_0x5958('0x57')]({},_0x212831,_0x23d18d[_0x5958('0x58')]);return db[_0x5958('0x6a')][_0x5958('0x1a')]({'where':_0x212831['where']})[_0x5958('0xb')](function(_0x4d46df){_0x93eac5[_0x5958('0x1a')]=_0x4d46df;if(_0x23d18d[_0x5958('0x49')][_0x5958('0x59')]){_0x212831[_0x5958('0x5a')]=[{'all':!![]}];}return db[_0x5958('0x6a')][_0x5958('0x5b')](_0x212831);})[_0x5958('0xb')](function(_0x7a0ca7){_0x93eac5[_0x5958('0x5c')]=_0x7a0ca7;return _0x93eac5;});}})[_0x5958('0xb')](respondWithFilteredResult(_0x2dd4a6,_0x212831))[_0x5958('0x14')](handleError(_0x2dd4a6,null));};exports[_0x5958('0x6b')]=function(_0x522428,_0x16a43b){return db[_0x5958('0x45')][_0x5958('0x66')]({'where':{'id':_0x522428[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x16a43b,null))[_0x5958('0xb')](function(_0x325005){if(_0x325005){return _0x325005[_0x5958('0x6b')](_0x522428[_0x5958('0x49')][_0x5958('0x6c')]);}})['then'](respondWithStatusCode(_0x16a43b,null))[_0x5958('0x14')](handleError(_0x16a43b,null));};exports[_0x5958('0x6d')]=function(_0x260fc4,_0x547884){if(_0x260fc4['body']['id']){delete _0x260fc4[_0x5958('0x60')]['id'];}return db[_0x5958('0x45')]['find']({'where':{'id':_0x260fc4['params']['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x547884,null))[_0x5958('0xb')](function(_0x6ff123){if(_0x6ff123){_0x260fc4[_0x5958('0x60')]['MailAccountId']=_0x6ff123['id'];return db[_0x5958('0x6e')][_0x5958('0x68')](_0x260fc4[_0x5958('0x60')]);}})[_0x5958('0xb')](respondWithResult(_0x547884,null))[_0x5958('0x14')](handleError(_0x547884,null));};exports[_0x5958('0x6f')]=function(_0x57cbf3,_0x5f569b){var _0x1a1a17={'raw':![],'where':{}};var _0x5ef3fc={};var _0x50c6b8={'count':0x0,'rows':[]};return db[_0x5958('0x45')][_0x5958('0x69')]({'where':{'id':_0x57cbf3[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x5f569b,null))[_0x5958('0xb')](function(_0x5a0dc0){if(_0x5a0dc0){_0x5ef3fc[_0x5958('0x4c')]=_[_0x5958('0x5f')](db[_0x5958('0x6e')]['rawAttributes']);_0x5ef3fc[_0x5958('0x49')]=_['keys'](_0x57cbf3[_0x5958('0x49')]);_0x5ef3fc[_0x5958('0x4a')]=_[_0x5958('0x4b')](_0x5ef3fc[_0x5958('0x4c')],_0x5ef3fc[_0x5958('0x49')]);_0x1a1a17[_0x5958('0x4d')]=_[_0x5958('0x4b')](_0x5ef3fc[_0x5958('0x4c')],qs[_0x5958('0x4e')](_0x57cbf3[_0x5958('0x49')][_0x5958('0x4e')]));_0x1a1a17[_0x5958('0x4d')]=_0x1a1a17[_0x5958('0x4d')][_0x5958('0x4f')]?_0x1a1a17[_0x5958('0x4d')]:_0x5ef3fc[_0x5958('0x4c')];if(!_0x57cbf3[_0x5958('0x49')][_0x5958('0x50')]('nolimit')){_0x1a1a17[_0x5958('0x19')]=qs['limit'](_0x57cbf3[_0x5958('0x49')][_0x5958('0x19')]);_0x1a1a17[_0x5958('0x1b')]=qs[_0x5958('0x1b')](_0x57cbf3[_0x5958('0x49')][_0x5958('0x1b')]);}_0x1a1a17[_0x5958('0x52')]=qs[_0x5958('0x53')](_0x57cbf3[_0x5958('0x49')]['sort']);_0x1a1a17[_0x5958('0x56')]=qs[_0x5958('0x4a')](_[_0x5958('0x54')](_0x57cbf3['query'],_0x5ef3fc['filters']));_0x1a1a17[_0x5958('0x56')][_0x5958('0x67')]=_0x5a0dc0['id'];if(_0x57cbf3[_0x5958('0x49')][_0x5958('0x55')]){_0x1a1a17['where']=_['merge'](_0x1a1a17[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0x1a1a17[_0x5958('0x4d')],function(_0x558e67){var _0x44070a={};_0x44070a[_0x558e67]={'$like':'%'+_0x57cbf3[_0x5958('0x49')][_0x5958('0x55')]+'%'};return _0x44070a;})});}_0x1a1a17=_[_0x5958('0x57')]({},_0x1a1a17,_0x57cbf3[_0x5958('0x58')]);return db[_0x5958('0x6e')]['count']({'where':_0x1a1a17[_0x5958('0x56')]})[_0x5958('0xb')](function(_0x375d3d){_0x50c6b8[_0x5958('0x1a')]=_0x375d3d;if(_0x57cbf3[_0x5958('0x49')][_0x5958('0x59')]){_0x1a1a17[_0x5958('0x5a')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1a1a17);})[_0x5958('0xb')](function(_0x1347e8){_0x50c6b8[_0x5958('0x5c')]=_0x1347e8;return _0x50c6b8;});}})[_0x5958('0xb')](respondWithFilteredResult(_0x5f569b,_0x1a1a17))['catch'](handleError(_0x5f569b,null));};exports[_0x5958('0x70')]=function(_0x1cb537,_0x481499){return db['MailAccount']['find']({'where':{'id':_0x1cb537[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x481499,null))[_0x5958('0xb')](function(_0x119293){if(_0x119293){return _0x119293['removeAnswers'](_0x1cb537['query'][_0x5958('0x6c')]);}})[_0x5958('0xb')](respondWithStatusCode(_0x481499,null))[_0x5958('0x14')](handleError(_0x481499,null));};exports[_0x5958('0x68')]=function(_0x5e5f0b,_0x9b5455){var _0x5bcc6a={'name':_0x5e5f0b[_0x5958('0x60')]['name'],'key':_0x5e5f0b['body'][_0x5958('0x71')],'provider':_0x5e5f0b[_0x5958('0x60')]['provider']===_0x5958('0x62')?null:_0x5e5f0b['body'][_0x5958('0x61')],'email':_0x5e5f0b[_0x5958('0x60')]['email'],'ListId':_0x5e5f0b[_0x5958('0x60')]['ListId'],'active':!_['isNil'](_0x5e5f0b['body']['active'])?_0x5e5f0b['body'][_0x5958('0x72')]:!![],'description':_0x5e5f0b[_0x5958('0x60')]['description']||null};var _0x349451=getAuthenticationOptions(_0x5bcc6a['provider'],_0x5e5f0b[_0x5958('0x60')]);_0x5bcc6a['Imap']=_0x349451[_0x5958('0x3d')];_0x5bcc6a['Smtp']=_0x349451['Smtp'];return db[_0x5958('0x45')][_0x5958('0x68')](_0x5bcc6a,{'include':[{'model':db[_0x5958('0x41')],'as':_0x5958('0x3e')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0x5958('0xb')](function(_0x2eee92){var _0x18147a=_0x5e5f0b['user'][_0x5958('0x21')]({'plain':!![]});if(!_0x18147a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18147a[_0x5958('0x73')]==='user'){var _0x43fc1b=_0x2eee92[_0x5958('0x21')]({'plain':!![]});return db[_0x5958('0x74')]['find']({'where':{'name':_0x5958('0x22'),'userProfileId':_0x18147a['userProfileId']},'raw':!![]})[_0x5958('0xb')](function(_0x1b7db2){if(_0x1b7db2&&_0x1b7db2[_0x5958('0x75')]===0x0){return db[_0x5958('0x23')][_0x5958('0x68')]({'name':_0x43fc1b['name'],'resourceId':_0x43fc1b['id'],'type':_0x1b7db2[_0x5958('0x25')],'sectionId':_0x1b7db2['id']},{})[_0x5958('0xb')](function(){return _0x2eee92;});}else{return _0x2eee92;}})[_0x5958('0x14')](function(_0x3cf209){logger[_0x5958('0x11')](_0x5958('0x76'),_0x3cf209);throw _0x3cf209;});}return _0x2eee92;})[_0x5958('0xb')](respondWithResult(_0x9b5455,0xc9))['catch'](handleError(_0x9b5455,null));};exports[_0x5958('0x77')]=function(_0x2fdac2,_0x395e5f){return db['MailAccount'][_0x5958('0x69')]({'where':{'id':_0x2fdac2['params']['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x395e5f,null))[_0x5958('0xb')](function(_0x5436c3){if(_0x5436c3){return _0x5436c3[_0x5958('0x77')]();}return null;})['then'](respondWithResult(_0x395e5f,null))[_0x5958('0x14')](handleError(_0x395e5f,null));};exports['addImap']=function(_0x2498ff,_0x17e2ef){if(_0x2498ff['body']['id']){delete _0x2498ff[_0x5958('0x60')]['id'];}return db[_0x5958('0x45')][_0x5958('0x66')]({'where':{'id':_0x2498ff['params']['id']}})['then'](handleEntityNotFound(_0x17e2ef,null))[_0x5958('0xb')](function(_0x1d1c1f){if(_0x1d1c1f){_0x2498ff[_0x5958('0x60')][_0x5958('0x67')]=_0x1d1c1f['id'];return db[_0x5958('0x40')]['create'](_0x2498ff[_0x5958('0x60')]);}})[_0x5958('0xb')](respondWithResult(_0x17e2ef,null))['catch'](handleError(_0x17e2ef,null));};exports[_0x5958('0x78')]=function(_0x3718fa,_0x22b2e3){return db[_0x5958('0x45')][_0x5958('0x69')]({'where':{'id':_0x3718fa[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x22b2e3,null))[_0x5958('0xb')](function(_0x79959a){if(_0x79959a){return _0x79959a['setImap'](null);}return null;})[_0x5958('0xb')](respondWithStatusCode(_0x22b2e3,null))[_0x5958('0x14')](handleError(_0x22b2e3,null));};exports[_0x5958('0x79')]=function(_0x19ddeb,_0x4c170a){return db['MailAccount']['findOne']({'where':{'id':_0x19ddeb[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x4c170a,null))[_0x5958('0xb')](function(_0x48c298){if(_0x48c298){return _0x48c298[_0x5958('0x79')]();}return null;})['then'](respondWithResult(_0x4c170a,null))[_0x5958('0x14')](handleError(_0x4c170a,null));};exports[_0x5958('0x7a')]=function(_0x3b69c5,_0x22567a){if(_0x3b69c5[_0x5958('0x60')]['id']){delete _0x3b69c5['body']['id'];}return db['MailAccount'][_0x5958('0x66')]({'where':{'id':_0x3b69c5[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x22567a,null))[_0x5958('0xb')](function(_0x113498){if(_0x113498){_0x3b69c5['body']['MailAccountId']=_0x113498['id'];return db[_0x5958('0x41')][_0x5958('0x68')](_0x3b69c5[_0x5958('0x60')]);}})[_0x5958('0xb')](respondWithResult(_0x22567a,null))[_0x5958('0x14')](handleError(_0x22567a,null));};exports[_0x5958('0x7b')]=function(_0x28696a,_0x596e73){return db['MailAccount'][_0x5958('0x69')]({'where':{'id':_0x28696a[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x596e73,null))[_0x5958('0xb')](function(_0x217168){if(_0x217168){return _0x217168[_0x5958('0x7c')](null);}return null;})[_0x5958('0xb')](respondWithStatusCode(_0x596e73,null))['catch'](handleError(_0x596e73,null));};exports[_0x5958('0x7d')]=function(_0x3ba7b9,_0x2ddc0d){return db[_0x5958('0x7e')]['find']({'where':{'id':_0x3ba7b9['params']['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x2ddc0d,null))[_0x5958('0xb')](function(_0x1d9a75){if(_0x1d9a75){return _0x1d9a75['addInteraction'](_0x3ba7b9[_0x5958('0x60')]['ids'],_[_0x5958('0x7f')](_0x3ba7b9[_0x5958('0x60')],['ids','id'])||{});}})[_0x5958('0xb')](respondWithResult(_0x2ddc0d,null))[_0x5958('0x14')](handleError(_0x2ddc0d,null));};exports[_0x5958('0x80')]=function(_0x5de85f,_0x3fb360){var _0x55b5f4={'raw':![],'where':{}};var _0xd253e0={};var _0x5436fc={'count':0x0,'rows':[]};return db[_0x5958('0x45')]['findOne']({'where':{'id':_0x5de85f[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x3fb360,null))[_0x5958('0xb')](function(_0x39c061){if(_0x39c061){_0xd253e0[_0x5958('0x4c')]=_['keys'](db['MailInteraction'][_0x5958('0x46')]);_0xd253e0[_0x5958('0x49')]=_[_0x5958('0x5f')](_0x5de85f[_0x5958('0x49')]);_0xd253e0['filters']=_[_0x5958('0x4b')](_0xd253e0[_0x5958('0x4c')],_0xd253e0[_0x5958('0x49')]);_0x55b5f4[_0x5958('0x4d')]=_[_0x5958('0x4b')](_0xd253e0[_0x5958('0x4c')],qs[_0x5958('0x4e')](_0x5de85f[_0x5958('0x49')][_0x5958('0x4e')]));_0x55b5f4[_0x5958('0x4d')]=_0x55b5f4[_0x5958('0x4d')][_0x5958('0x4f')]?_0x55b5f4[_0x5958('0x4d')]:_0xd253e0[_0x5958('0x4c')];if(!_0x5de85f[_0x5958('0x49')][_0x5958('0x50')](_0x5958('0x51'))){_0x55b5f4[_0x5958('0x19')]=qs[_0x5958('0x19')](_0x5de85f['query'][_0x5958('0x19')]);_0x55b5f4['offset']=qs[_0x5958('0x1b')](_0x5de85f['query'][_0x5958('0x1b')]);}_0x55b5f4[_0x5958('0x52')]=qs[_0x5958('0x53')](_0x5de85f['query'][_0x5958('0x53')]);_0x55b5f4[_0x5958('0x56')]=qs[_0x5958('0x4a')](_[_0x5958('0x54')](_0x5de85f[_0x5958('0x49')],_0xd253e0[_0x5958('0x4a')]));_0x55b5f4[_0x5958('0x56')][_0x5958('0x67')]=_0x39c061['id'];if(_0x5de85f[_0x5958('0x49')][_0x5958('0x55')]){_0x55b5f4[_0x5958('0x56')]=_[_0x5958('0x57')](_0x55b5f4[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0x55b5f4['attributes'],function(_0x1dc2f9){var _0x3d2782={};_0x3d2782[_0x1dc2f9]={'$like':'%'+_0x5de85f[_0x5958('0x49')][_0x5958('0x55')]+'%'};return _0x3d2782;})});}_0x55b5f4=_[_0x5958('0x57')]({},_0x55b5f4,_0x5de85f[_0x5958('0x58')]);return db[_0x5958('0x7e')]['count']({'where':_0x55b5f4[_0x5958('0x56')]})[_0x5958('0xb')](function(_0x3aa042){_0x5436fc['count']=_0x3aa042;if(_0x5de85f[_0x5958('0x49')]['includeAll']){_0x55b5f4[_0x5958('0x5a')]=[{'model':db[_0x5958('0x81')],'as':_0x5958('0x82'),'required':![]},{'model':db[_0x5958('0x83')],'as':_0x5958('0x84'),'attributes':['name',_0x5958('0x85'),_0x5958('0x86')],'required':![]},{'model':db[_0x5958('0x87')],'as':_0x5958('0x88'),'attributes':['id',_0x5958('0x25'),'color'],'where':_0x5de85f[_0x5958('0x49')][_0x5958('0x89')]?{'id':_0x5de85f['query'][_0x5958('0x89')]}:undefined,'required':_0x5de85f[_0x5958('0x49')][_0x5958('0x89')]?!![]:![]}];}return db[_0x5958('0x7e')]['findAll'](_0x55b5f4);})[_0x5958('0xb')](function(_0x23630b){_0x5436fc[_0x5958('0x5c')]=_0x23630b;return _0x5436fc;});}})[_0x5958('0xb')](respondWithFilteredResult(_0x3fb360,_0x55b5f4))[_0x5958('0x14')](handleError(_0x3fb360,null));};exports[_0x5958('0x8a')]=function addApplications(_0xe1fc65,_0x151ca9){var _0x2de351=_0xe1fc65[_0x5958('0x5e')]['id'];var _0x4d2eae=_0xe1fc65[_0x5958('0x60')];var _0x30c0a6=0xc8;var _0x5b1fd8=null;return db[_0x5958('0x8b')][_0x5958('0x8c')]({'isolationLevel':db['sequelize'][_0x5958('0x8d')][_0x5958('0x8e')][_0x5958('0x8f')]},function(_0x248e81){return db['MailAccount']['findOne']({'where':{'id':_0x2de351},'transaction':_0x248e81})[_0x5958('0xb')](function(_0x166462){if(_0x166462){return db[_0x5958('0x90')][_0x5958('0x20')]({'where':{'MailAccountId':_0x2de351},'transaction':_0x248e81})[_0x5958('0xb')](function(){var _0x1b37ec=_[_0x5958('0x44')](_0x4d2eae,function(_0x4e1d25){_0x4e1d25[_0x5958('0x67')]=_0x2de351;return _0x4e1d25;});return db[_0x5958('0x90')]['bulkCreate'](_0x1b37ec,{'transaction':_0x248e81});});}else{_0x30c0a6=0x194;_0x5b1fd8=[];}});})[_0x5958('0xb')](function(){if(_0x30c0a6!==0x194){return db['MailApplication'][_0x5958('0x91')]({'where':{'MailAccountId':_0x2de351},'order':'priority'})[_0x5958('0xb')](function(_0x4bb4e6){_0x5b1fd8=_0x4bb4e6;});}})[_0x5958('0x14')](function(_0x8234bd){_0x30c0a6=0x1f4;logger[_0x5958('0x11')](_0x8234bd['stack']);if(_0x8234bd['name']){delete _0x8234bd[_0x5958('0x25')];}_0x5b1fd8=_0x8234bd;})[_0x5958('0x92')](function(){if(_0x5b1fd8===null){_0x151ca9[_0x5958('0x15')](_0x30c0a6);}else{if(_0x30c0a6===0x1f4){_0x151ca9['status'](_0x30c0a6)[_0x5958('0x26')](_0x5b1fd8);}else{_0x151ca9['status'](_0x30c0a6)[_0x5958('0x1e')](_0x5b1fd8);}}});};exports[_0x5958('0x93')]=function(_0x76f83e,_0x2dc246){var _0x2ac0ac={};var _0x493a26={};var _0x1d34c7;var _0x5f36d4;return db[_0x5958('0x45')][_0x5958('0x69')]({'where':{'id':_0x76f83e[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x2dc246,null))['then'](function(_0x24f73a){if(_0x24f73a){_0x1d34c7=_0x24f73a;_0x493a26['model']=_['keys'](db[_0x5958('0x90')][_0x5958('0x46')]);_0x493a26['query']=_[_0x5958('0x5f')](_0x76f83e[_0x5958('0x49')]);_0x493a26[_0x5958('0x4a')]=_[_0x5958('0x4b')](_0x493a26[_0x5958('0x4c')],_0x493a26[_0x5958('0x49')]);_0x2ac0ac['attributes']=_[_0x5958('0x4b')](_0x493a26[_0x5958('0x4c')],qs[_0x5958('0x4e')](_0x76f83e[_0x5958('0x49')][_0x5958('0x4e')]));_0x2ac0ac['attributes']=_0x2ac0ac[_0x5958('0x4d')][_0x5958('0x4f')]?_0x2ac0ac[_0x5958('0x4d')]:_0x493a26[_0x5958('0x4c')];_0x2ac0ac[_0x5958('0x52')]=qs[_0x5958('0x53')](_0x76f83e[_0x5958('0x49')][_0x5958('0x53')]);_0x2ac0ac['where']=qs['filters'](_['pick'](_0x76f83e[_0x5958('0x49')],_0x493a26[_0x5958('0x4a')]));if(_0x76f83e[_0x5958('0x49')]['filter']){_0x2ac0ac[_0x5958('0x56')]=_[_0x5958('0x57')](_0x2ac0ac[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0x2ac0ac[_0x5958('0x4d')],function(_0x2eb183){var _0x5a9588={};_0x5a9588[_0x2eb183]={'$like':'%'+_0x76f83e[_0x5958('0x49')]['filter']+'%'};return _0x5a9588;})});}_0x2ac0ac=_[_0x5958('0x57')]({},_0x2ac0ac,_0x76f83e['options']);return _0x1d34c7[_0x5958('0x93')](_0x2ac0ac);}})[_0x5958('0xb')](function(_0x562f68){if(_0x562f68){_0x5f36d4=_0x562f68['length'];if(!_0x76f83e[_0x5958('0x49')][_0x5958('0x50')](_0x5958('0x51'))){_0x2ac0ac[_0x5958('0x19')]=qs[_0x5958('0x19')](_0x76f83e[_0x5958('0x49')]['limit']);_0x2ac0ac['offset']=qs['offset'](_0x76f83e['query'][_0x5958('0x1b')]);}return _0x1d34c7[_0x5958('0x93')](_0x2ac0ac);}})[_0x5958('0xb')](function(_0x748d89){if(_0x748d89){return _0x748d89?{'count':_0x5f36d4,'rows':_0x748d89}:null;}})[_0x5958('0xb')](respondWithResult(_0x2dc246,null))[_0x5958('0x14')](handleError(_0x2dc246,null));};exports[_0x5958('0x94')]=function(_0x370ccc,_0x85cd81){var _0xb16086={'raw':!![],'where':{}};var _0x3ee9e5={};var _0x34a60d={'count':0x0,'rows':[]};return db[_0x5958('0x45')][_0x5958('0x69')]({'where':{'id':_0x370ccc[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x85cd81,null))[_0x5958('0xb')](function(_0x22c23c){if(_0x22c23c){_0x3ee9e5[_0x5958('0x4c')]=_[_0x5958('0x5f')](db[_0x5958('0x95')][_0x5958('0x46')]);_0x3ee9e5[_0x5958('0x49')]=_['keys'](_0x370ccc['query']);_0x3ee9e5[_0x5958('0x4a')]=_[_0x5958('0x4b')](_0x3ee9e5[_0x5958('0x4c')],_0x3ee9e5[_0x5958('0x49')]);_0xb16086['attributes']=_[_0x5958('0x4b')](_0x3ee9e5['model'],qs[_0x5958('0x4e')](_0x370ccc[_0x5958('0x49')]['fields']));_0xb16086[_0x5958('0x4d')]=_0xb16086['attributes'][_0x5958('0x4f')]?_0xb16086['attributes']:_0x3ee9e5['model'];if(!_0x370ccc[_0x5958('0x49')][_0x5958('0x50')](_0x5958('0x51'))){_0xb16086[_0x5958('0x19')]=qs[_0x5958('0x19')](_0x370ccc[_0x5958('0x49')][_0x5958('0x19')]);_0xb16086[_0x5958('0x1b')]=qs[_0x5958('0x1b')](_0x370ccc[_0x5958('0x49')]['offset']);}_0xb16086['order']=qs[_0x5958('0x53')](_0x370ccc[_0x5958('0x49')]['sort']);_0xb16086['where']=qs['filters'](_[_0x5958('0x54')](_0x370ccc['query'],_0x3ee9e5[_0x5958('0x4a')]));_0xb16086[_0x5958('0x56')][_0x5958('0x67')]=_0x22c23c['id'];if(_0x370ccc[_0x5958('0x49')][_0x5958('0x55')]){_0xb16086[_0x5958('0x56')]=_[_0x5958('0x57')](_0xb16086[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0xb16086[_0x5958('0x4d')],function(_0x43440d){var _0x2a1a55={};_0x2a1a55[_0x43440d]={'$like':'%'+_0x370ccc['query'][_0x5958('0x55')]+'%'};return _0x2a1a55;})});}if(_0x370ccc['query'][_0x5958('0x96')]){var _0xb70172=_0x370ccc[_0x5958('0x49')][_0x5958('0x96')][_0x5958('0x97')](',');var _0x5cd132={};_0x5cd132[_0xb70172[0x0]]={'$gte':moment(_0xb70172[0x1])[_0x5958('0x98')](_0x5958('0x99'))};_0xb16086[_0x5958('0x56')]=_[_0x5958('0x57')](_0xb16086[_0x5958('0x56')],_0x5cd132);}_0xb16086=_[_0x5958('0x57')]({},_0xb16086,_0x370ccc[_0x5958('0x58')]);return db[_0x5958('0x95')]['count']({'where':_0xb16086[_0x5958('0x56')]})['then'](function(_0x474e45){_0x34a60d[_0x5958('0x1a')]=_0x474e45;if(_0x370ccc[_0x5958('0x49')][_0x5958('0x59')]){_0xb16086['include']=[{'all':!![]}];}return db[_0x5958('0x95')][_0x5958('0x5b')](_0xb16086);})[_0x5958('0xb')](function(_0x15b328){if(_0x370ccc[_0x5958('0x49')][_0x5958('0x9a')]===_0x5958('0x9b')){for(var _0x1a769a=0x0;_0x1a769a<_0x15b328[_0x5958('0x4f')];_0x1a769a++){_0x15b328[_0x1a769a]['body']=juice(_0x15b328[_0x1a769a][_0x5958('0x60')]);}}_0x34a60d[_0x5958('0x5c')]=_0x15b328;return _0x34a60d;});}})[_0x5958('0xb')](respondWithFilteredResult(_0x85cd81,_0xb16086))[_0x5958('0x14')](handleError(_0x85cd81,null));};exports[_0x5958('0x26')]=function(_0x26cba2,_0x313ff0){var _0x252ab3,_0x349c3d={},_0x55f960;if(_0x26cba2[_0x5958('0x60')]['to']){_0x55f960=_0x26cba2[_0x5958('0x60')]['to']['split'](',')[0x0];}return db[_0x5958('0x45')][_0x5958('0x66')]({'where':{'id':_0x26cba2[_0x5958('0x5e')]['id']},'include':[{'model':db[_0x5958('0x9c')],'as':_0x5958('0x9d'),'include':[{'model':db[_0x5958('0x81')],'as':_0x5958('0x9e'),'where':{'email':_0x55f960},'limit':0x1,'order':[[_0x5958('0x9f'),_0x5958('0xa0')]]}]},{'model':db[_0x5958('0x41')],'as':_0x5958('0x3e'),'raw':!![],'include':[{'model':db[_0x5958('0xa1')],'as':_0x5958('0xa1'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x313ff0,null))[_0x5958('0xb')](function(_0x3282b8){if(!_0x3282b8)return;_0x252ab3=_0x3282b8;if(!_0x3282b8[_0x5958('0x3e')])throw new Error(_0x5958('0xa2'));if(_[_0x5958('0xa3')](_0x26cba2[_0x5958('0x60')][_0x5958('0xa4')])){_0x26cba2[_0x5958('0x60')][_0x5958('0xa4')]=util['format'](_0x5958('0xa5'),_0x3282b8['name'],_0x3282b8[_0x5958('0xa6')]||_0x3282b8[_0x5958('0x3e')][_0x5958('0x33')]);}if(_0x26cba2[_0x5958('0x60')]['attachments']&&_0x26cba2[_0x5958('0x60')][_0x5958('0xa7')][_0x5958('0x4f')]){for(var _0x4337e7=0x0;_0x4337e7<_0x26cba2[_0x5958('0x60')][_0x5958('0xa7')][_0x5958('0x4f')];_0x4337e7+=0x1){_0x26cba2[_0x5958('0x60')]['attachments'][_0x4337e7]={'filename':_0x26cba2[_0x5958('0x60')][_0x5958('0xa7')][_0x4337e7][_0x5958('0x25')],'path':path['join'](config[_0x5958('0xa8')],_0x5958('0xa9'),_0x26cba2[_0x5958('0x60')][_0x5958('0xa7')][_0x4337e7][_0x5958('0xaa')])};}}var _0x466300=_0x3282b8[_0x5958('0xab')]();return respondWithRpcPromise(_0x5958('0xac'),_0x5958('0xad'),{'account':_0x466300,'message':_0x26cba2['body']});})['then'](function(_0x571960){if(!_0x571960)return;_0x349c3d=_0x571960;if(!_0x252ab3[_0x5958('0x9d')])throw new Error(_0x5958('0xae'));if(_0x252ab3[_0x5958('0x9d')][_0x5958('0x9e')][_0x5958('0x4f')])return _0x252ab3[_0x5958('0x9d')][_0x5958('0x9e')][0x0];return db[_0x5958('0x81')][_0x5958('0x68')](_[_0x5958('0x5')](_0x26cba2[_0x5958('0x60')],{'firstName':_0x26cba2[_0x5958('0x60')]['to'],'email':_0x26cba2[_0x5958('0x60')]['to'],'phone':_0x26cba2['body']['to'],'ListId':_0x252ab3[_0x5958('0xaf')]}));})[_0x5958('0xb')](function(_0x3ef0d6){if(!_0x3ef0d6)return;var _0x412220={'UserId':_0x26cba2[_0x5958('0x33')]['id'],'ContactId':_0x3ef0d6['id'],'MailAccountId':_0x252ab3['id'],'inReplyTo':_0x349c3d[_0x5958('0xb0')],'to':_0x26cba2['body'][_0x5958('0xa4')],'cc':_0x26cba2[_0x5958('0x60')]['cc'],'subject':_0x26cba2['body'][_0x5958('0xb1')],'attach':_0x26cba2[_0x5958('0x60')][_0x5958('0xb2')],'firstMsgDirection':_0x5958('0xb3'),'lastMsgAt':moment()[_0x5958('0x98')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x5958('0xb3'),'Messages':[_['merge'](_0x26cba2[_0x5958('0x60')],{'messageId':_0x349c3d['messageId'],'sentAt':moment()[_0x5958('0x98')](_0x5958('0x99')),'read':!![],'MailAccountId':_0x252ab3['id'],'UserId':_0x26cba2[_0x5958('0x33')]['id'],'ContactId':_0x3ef0d6['id']})]};if(_0x26cba2['body']['Interaction']){_0x412220=_[_0x5958('0x57')](_0x412220,_0x26cba2[_0x5958('0x60')][_0x5958('0xb4')]);}return db[_0x5958('0x7e')]['create'](_0x412220,{'include':[{'model':db[_0x5958('0x95')],'as':_0x5958('0xb5')}]});})[_0x5958('0xb')](respondWithResult(_0x313ff0,null))['catch'](handleError(_0x313ff0,null));};exports[_0x5958('0xb6')]=function(_0x2618cd,_0x21c46d){return db[_0x5958('0x45')]['find']({'where':{'id':_0x2618cd[_0x5958('0x5e')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x5958('0x3e'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x21c46d,null))[_0x5958('0xb')](function(_0x4d5ff5){if(!_0x4d5ff5[_0x5958('0x3e')])return;var _0x19ee91=_0x4d5ff5[_0x5958('0xab')]();return respondWithRpcPromise(_0x5958('0xb7'),_0x5958('0xb6'),{'account':_0x19ee91});})[_0x5958('0xb')](respondWithResult(_0x21c46d,null))[_0x5958('0x14')](handleError(_0x21c46d,null));};exports[_0x5958('0x20')]=function(_0x3cc345,_0x326681){return db[_0x5958('0x45')][_0x5958('0x66')]({'where':{'id':_0x3cc345['params']['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x326681,null))['then'](function(_0x3ab34){if(_0x3ab34&&_0x3ab34[_0x5958('0x3b')]){throw new db[(_0x5958('0xb8'))][(_0x5958('0xb9'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x3ab34;})[_0x5958('0xb')](removeEntity(_0x326681,null))[_0x5958('0x14')](handleError(_0x326681,null));};exports[_0x5958('0xba')]=function(_0x4013b9,_0x2e7c65){return db[_0x5958('0x45')]['find']({'where':{'id':_0x4013b9[_0x5958('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2e7c65,null))[_0x5958('0xb')](function(_0x1b1630){if(_0x1b1630){return _0x1b1630[_0x5958('0xba')](_0x4013b9[_0x5958('0x60')][_0x5958('0x6c')],_['omit'](_0x4013b9[_0x5958('0x60')],[_0x5958('0x6c'),'id'])||{})[_0x5958('0xbb')](function(_0x504d09){for(var _0x4018f0=0x0;_0x4018f0<_0x4013b9['body'][_0x5958('0x6c')]['length'];_0x4018f0+=0x1){socket[_0x5958('0xbc')](_0x5958('0xbd'),{'UserId':Number(_0x4013b9[_0x5958('0x60')]['ids'][_0x4018f0]),'MailAccountId':Number(_0x4013b9['params']['id'])});}return _0x504d09;});}})[_0x5958('0xb')](respondWithResult(_0x2e7c65,null))['catch'](handleError(_0x2e7c65,null));};exports[_0x5958('0xbe')]=function(_0x280d0e,_0x54cf65){return db['MailAccount'][_0x5958('0x66')]({'where':{'id':_0x280d0e['params']['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x54cf65,null))['then'](function(_0x416aa9){if(_0x416aa9){return _0x416aa9[_0x5958('0xbe')](_0x280d0e['query'][_0x5958('0x6c')])[_0x5958('0xb')](function(){if(_[_0x5958('0xbf')](_0x280d0e[_0x5958('0x49')][_0x5958('0x6c')])){for(var _0x481d65=0x0;_0x481d65<_0x280d0e[_0x5958('0x49')][_0x5958('0x6c')][_0x5958('0x4f')];_0x481d65+=0x1){socket[_0x5958('0xbc')](_0x5958('0xc0'),{'UserId':Number(_0x280d0e[_0x5958('0x49')][_0x5958('0x6c')][_0x481d65]),'MailAccountId':Number(_0x280d0e['params']['id'])});}}else{socket[_0x5958('0xbc')](_0x5958('0xc0'),{'UserId':Number(_0x280d0e[_0x5958('0x49')][_0x5958('0x6c')]),'MailAccountId':Number(_0x280d0e['params']['id'])});}});}})[_0x5958('0xb')](respondWithStatusCode(_0x54cf65,null))[_0x5958('0x14')](handleError(_0x54cf65,null));};exports[_0x5958('0xc1')]=function(_0x1d059d,_0x31bf81){var _0x43bf01={};var _0x47ee44={};var _0x4a5aa7;var _0x18c5cf;return db['MailAccount'][_0x5958('0x69')]({'where':{'id':_0x1d059d[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x31bf81,null))[_0x5958('0xb')](function(_0x24b6bb){if(_0x24b6bb){_0x4a5aa7=_0x24b6bb;_0x47ee44['model']=_['keys'](db[_0x5958('0x83')]['rawAttributes']);_0x47ee44[_0x5958('0x49')]=_[_0x5958('0x5f')](_0x1d059d['query']);_0x47ee44[_0x5958('0x4a')]=_[_0x5958('0x4b')](_0x47ee44[_0x5958('0x4c')],_0x47ee44[_0x5958('0x49')]);_0x43bf01['attributes']=_['intersection'](_0x47ee44['model'],qs['fields'](_0x1d059d[_0x5958('0x49')][_0x5958('0x4e')]));_0x43bf01[_0x5958('0x4d')]=_0x43bf01[_0x5958('0x4d')]['length']?_0x43bf01[_0x5958('0x4d')]:_0x47ee44[_0x5958('0x4c')];_0x43bf01[_0x5958('0x52')]=qs[_0x5958('0x53')](_0x1d059d['query'][_0x5958('0x53')]);_0x43bf01[_0x5958('0x56')]=qs[_0x5958('0x4a')](_[_0x5958('0x54')](_0x1d059d[_0x5958('0x49')],_0x47ee44['filters']));if(_0x1d059d[_0x5958('0x49')][_0x5958('0x55')]){_0x43bf01[_0x5958('0x56')]=_[_0x5958('0x57')](_0x43bf01[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0x43bf01['attributes'],function(_0x26b38b){var _0x48be27={};_0x48be27[_0x26b38b]={'$like':'%'+_0x1d059d['query']['filter']+'%'};return _0x48be27;})});}_0x43bf01=_[_0x5958('0x57')]({},_0x43bf01,_0x1d059d['options']);return _0x4a5aa7[_0x5958('0xc1')](_0x43bf01);}})[_0x5958('0xb')](function(_0xa3d687){if(_0xa3d687){_0x18c5cf=_0xa3d687[_0x5958('0x4f')];if(!_0x1d059d['query'][_0x5958('0x50')](_0x5958('0x51'))){_0x43bf01[_0x5958('0x19')]=qs[_0x5958('0x19')](_0x1d059d[_0x5958('0x49')][_0x5958('0x19')]);_0x43bf01['offset']=qs[_0x5958('0x1b')](_0x1d059d[_0x5958('0x49')][_0x5958('0x1b')]);}return _0x4a5aa7['getAgents'](_0x43bf01);}})['then'](function(_0x9afa8b){if(_0x9afa8b){return _0x9afa8b?{'count':_0x18c5cf,'rows':_0x9afa8b}:null;}})[_0x5958('0xb')](respondWithResult(_0x31bf81,null))[_0x5958('0x14')](handleError(_0x31bf81,null));}; \ No newline at end of file +var _0x3304=['filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','show','params','options','find','body','provider','custom','secure','MailServerOut','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','order','pick','rows','removeDispositions','addAnswer','CannedAnswer','findOne','removeAnswers','ids','key','email','ListId','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','omit','getInteractions','MailInteraction','Contact','User','Owner','fullname','Tag','Tags','color','tag','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmContact','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','subject','out','Interaction','VerifySmtp','verifySmtp','Sequelize','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','./mailAccount.socket','jayson/promise','client','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','end','stack','name','send','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','Imap','index','MailServerIn','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','model','keys'];(function(_0x3a8697,_0x4e39e8){var _0xa4c873=function(_0x3479aa){while(--_0x3479aa){_0x3a8697['push'](_0x3a8697['shift']());}};_0xa4c873(++_0x4e39e8);}(_0x3304,0x1e4));var _0x4330=function(_0x52b261,_0x5124db){_0x52b261=_0x52b261-0x0;var _0x1599d0=_0x3304[_0x52b261];return _0x1599d0;};'use strict';var moment=require(_0x4330('0x0'));var BPromise=require('bluebird');var util=require(_0x4330('0x1'));var path=require(_0x4330('0x2'));var _=require(_0x4330('0x3'));var juice=require(_0x4330('0x4'));var Redis=require(_0x4330('0x5'));var qs=require(_0x4330('0x6'));var logger=require(_0x4330('0x7'))(_0x4330('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4330('0x9')]=_[_0x4330('0xa')](config[_0x4330('0x9')],{'host':_0x4330('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4330('0x9')]));require(_0x4330('0xc'))['register'](socket);var jayson=require(_0x4330('0xd'));var client=jayson[_0x4330('0xe')]['http']({'port':0x232b});function respondWithRpcPromise(_0x205de5,_0x66ae91,_0xb851b3,_0x4f21d6){return new BPromise(function(_0x2344db,_0x5266a0){var _0x4a7c5a=_0x4f21d6||client;return _0x4a7c5a['request'](_0x205de5,_0xb851b3)[_0x4330('0xf')](function(_0xff6eef){logger[_0x4330('0x10')](_0x4330('0x11'),_0x66ae91,_0x4330('0x12'));logger[_0x4330('0x13')](_0x4330('0x14'),_0x66ae91,_0x4330('0x12'),JSON[_0x4330('0x15')](_0xff6eef));if(_0xff6eef['error']){if(_0xff6eef['error'][_0x4330('0x16')]===0x1f4){logger[_0x4330('0x17')](_0x4330('0x11'),_0x66ae91,_0xff6eef[_0x4330('0x17')]['message']);return _0x5266a0(_0xff6eef['error'][_0x4330('0x18')]);}logger[_0x4330('0x17')](_0x4330('0x11'),_0x66ae91,_0xff6eef['error'][_0x4330('0x18')]);return _0x2344db(_0xff6eef[_0x4330('0x17')][_0x4330('0x18')]);}else{logger['info'](_0x4330('0x11'),_0x66ae91,_0x4330('0x12'));_0x2344db(_0xff6eef['result'][_0x4330('0x18')]);}})[_0x4330('0x19')](function(_0x43f4ae){logger['error'](_0x4330('0x11'),_0x66ae91,_0x43f4ae);_0x5266a0(_0x43f4ae);});});}function respondWithStatusCode(_0x125bcf,_0x53d78d){_0x53d78d=_0x53d78d||0xcc;return function(_0x1cdeb5){if(_0x1cdeb5){return _0x125bcf[_0x4330('0x1a')](_0x53d78d);}return _0x125bcf[_0x4330('0x1b')](_0x53d78d)['end']();};}function respondWithResult(_0x59a877,_0x65eb16){_0x65eb16=_0x65eb16||0xc8;return function(_0x5a7ff6){if(_0x5a7ff6){return _0x59a877['status'](_0x65eb16)[_0x4330('0x1c')](_0x5a7ff6);}};}function respondWithFilteredResult(_0x35d164,_0x1fc687){return function(_0xc63069){if(_0xc63069){var _0x528a6c=typeof _0x1fc687[_0x4330('0x1d')]===_0x4330('0x1e')&&typeof _0x1fc687[_0x4330('0x1f')]==='undefined';var _0x361090=_0xc63069[_0x4330('0x20')];var _0x2fbba5=_0x528a6c?0x0:_0x1fc687['offset'];var _0x5444eb=_0x528a6c?_0xc63069[_0x4330('0x20')]:_0x1fc687[_0x4330('0x1d')]+_0x1fc687[_0x4330('0x1f')];var _0xab7236;if(_0x5444eb>=_0x361090){_0x5444eb=_0x361090;_0xab7236=0xc8;}else{_0xab7236=0xce;}_0x35d164['status'](_0xab7236);return _0x35d164[_0x4330('0x21')](_0x4330('0x22'),_0x2fbba5+'-'+_0x5444eb+'/'+_0x361090)[_0x4330('0x1c')](_0xc63069);}return null;};}function saveUpdates(_0x36064d){return function(_0x535a20){if(_0x535a20){return _0x535a20[_0x4330('0x23')](_0x36064d)[_0x4330('0xf')](function(_0x6f9fb){return _0x6f9fb;});}return null;};}function removeEntity(_0x3fb1c2){return function(_0x253898){if(_0x253898){return _0x253898[_0x4330('0x24')]()[_0x4330('0xf')](function(){var _0x492ce5=_0x253898[_0x4330('0x25')]({'plain':!![]});var _0x24b145=_0x4330('0x26');return db[_0x4330('0x27')][_0x4330('0x24')]({'where':{'type':_0x24b145,'resourceId':_0x492ce5['id']}})[_0x4330('0xf')](function(){return _0x253898;});})['then'](function(){_0x3fb1c2[_0x4330('0x1b')](0xcc)[_0x4330('0x28')]();});}};}function handleEntityNotFound(_0x54c2a2){return function(_0x3a7a87){if(!_0x3a7a87){_0x54c2a2[_0x4330('0x1a')](0x194);}return _0x3a7a87;};}function handleError(_0x49c650,_0x18c4db){_0x18c4db=_0x18c4db||0x1f4;return function(_0x19f295){logger['error'](_0x19f295[_0x4330('0x29')]);if(_0x19f295[_0x4330('0x2a')]){delete _0x19f295[_0x4330('0x2a')];}_0x49c650[_0x4330('0x1b')](_0x18c4db)[_0x4330('0x2b')](_0x19f295);};}function getImapHost(_0x34e134){switch(_0x34e134){case _0x4330('0x2c'):return'imap.gmail.com';case _0x4330('0x2d'):return _0x4330('0x2e');case _0x4330('0x2f'):return _0x4330('0x30');case _0x4330('0x31'):return'outlook.office365.com';}throw new Error(_0x4330('0x32'),_0x34e134);}function getSmtpHost(_0x2ca118){switch(_0x2ca118){case'gmail':return'smtp.gmail.com';case _0x4330('0x2d'):return'smtp.mail.yahoo.com';case _0x4330('0x2f'):return _0x4330('0x33');case'outlook365':return'smtp.office365.com';}throw new Error(_0x4330('0x32'),_0x2ca118);}function getAuthenticationOptions(_0x35720a,_0xf193c2){var _0x4e6dab={};var _0x4d6458={};if(_0x35720a){_0x4e6dab[_0x4330('0x34')]=_0x4d6458['user']=_0xf193c2[_0x4330('0x35')];_0x4e6dab[_0x4330('0x36')]=_0x4d6458[_0x4330('0x37')]=_0xf193c2[_0x4330('0x36')];if(_0xf193c2[_0x4330('0x38')]){_0x4e6dab[_0x4330('0x38')]=_0x4d6458[_0x4330('0x38')]=!![];_0x4e6dab['CloudProviderId']=_0x4d6458[_0x4330('0x39')]=_0xf193c2['CloudProviderId'];_0x4e6dab[_0x4330('0x36')]=_0x4d6458[_0x4330('0x37')]=null;}else{_0x4e6dab[_0x4330('0x39')]=_0x4d6458[_0x4330('0x39')]=null;}_0x4e6dab[_0x4330('0x3a')]=getImapHost(_0x35720a);_0x4e6dab[_0x4330('0x3b')]=0x3e1;_0x4d6458[_0x4330('0x3a')]=getSmtpHost(_0x35720a);_0x4d6458['port']=0x24b;_0x4d6458['secure']=![];_0x4e6dab[_0x4330('0x3c')]=_0x4d6458['service']=null;}else{if(_0xf193c2['authentication']){_0x4e6dab[_0x4330('0x34')]=_0x4d6458['user']=_0xf193c2[_0x4330('0x35')];_0x4e6dab[_0x4330('0x36')]=_0x4d6458[_0x4330('0x37')]=_0xf193c2[_0x4330('0x36')];}else{_0x4e6dab[_0x4330('0x3d')]=_0x4d6458[_0x4330('0x3d')]=![];_0x4e6dab[_0x4330('0x34')]=_0x4d6458[_0x4330('0x34')]=null;_0x4e6dab[_0x4330('0x36')]=_0x4d6458['pass']=null;}_0x4e6dab[_0x4330('0x3a')]=_0xf193c2[_0x4330('0x3e')][_0x4330('0x3a')];_0x4e6dab['port']=_0xf193c2[_0x4330('0x3e')][_0x4330('0x3b')];_0x4d6458[_0x4330('0x3a')]=_0xf193c2['Smtp'][_0x4330('0x3a')];_0x4d6458[_0x4330('0x3b')]=_0xf193c2['Smtp'][_0x4330('0x3b')];}return{'Imap':_0x4e6dab,'Smtp':_0x4d6458};}exports[_0x4330('0x3f')]=function(_0x524a1e,_0x416798){var _0x4371c9={'include':[{'model':db[_0x4330('0x40')],'as':_0x4330('0x3e')},{'model':db['MailServerOut'],'as':_0x4330('0x41')},{'model':db[_0x4330('0x42')],'as':_0x4330('0x43')}]},_0x834d2c={},_0x52ee5a={'count':0x0,'rows':[]};var _0x2407ba=_[_0x4330('0x44')](db[_0x4330('0x45')][_0x4330('0x46')],function(_0x30ba7e){return{'name':_0x30ba7e[_0x4330('0x47')],'type':_0x30ba7e['type']['key']};});_0x834d2c[_0x4330('0x48')]=_[_0x4330('0x44')](_0x2407ba,'name');_0x834d2c['query']=_[_0x4330('0x49')](_0x524a1e['query']);_0x834d2c[_0x4330('0x4a')]=_[_0x4330('0x4b')](_0x834d2c[_0x4330('0x48')],_0x834d2c[_0x4330('0x4c')]);_0x4371c9['attributes']=_[_0x4330('0x4b')](_0x834d2c[_0x4330('0x48')],qs['fields'](_0x524a1e['query'][_0x4330('0x4d')]));_0x4371c9['attributes']=_0x4371c9[_0x4330('0x4e')][_0x4330('0x4f')]?_0x4371c9[_0x4330('0x4e')]:_0x834d2c['model'];if(!_0x524a1e['query'][_0x4330('0x50')](_0x4330('0x51'))){_0x4371c9[_0x4330('0x1f')]=qs[_0x4330('0x1f')](_0x524a1e[_0x4330('0x4c')][_0x4330('0x1f')]);_0x4371c9[_0x4330('0x1d')]=qs[_0x4330('0x1d')](_0x524a1e[_0x4330('0x4c')][_0x4330('0x1d')]);}_0x4371c9['order']=qs[_0x4330('0x52')](_0x524a1e['query'][_0x4330('0x52')]);_0x4371c9['where']=qs[_0x4330('0x4a')](_['pick'](_0x524a1e[_0x4330('0x4c')],_0x834d2c[_0x4330('0x4a')]),_0x2407ba);if(_0x524a1e[_0x4330('0x4c')][_0x4330('0x53')]){_0x4371c9[_0x4330('0x54')]=_[_0x4330('0x55')](_0x4371c9[_0x4330('0x54')],{'$or':_[_0x4330('0x44')](_0x2407ba,function(_0x5510f8){if(_0x5510f8['type']!==_0x4330('0x56')){var _0x59a109={};_0x59a109[_0x5510f8[_0x4330('0x2a')]]={'$like':'%'+_0x524a1e[_0x4330('0x4c')][_0x4330('0x53')]+'%'};return _0x59a109;}})});}_0x4371c9=_[_0x4330('0x55')]({},_0x4371c9,_0x524a1e['options']);var _0x5ebdbc={'where':_0x4371c9[_0x4330('0x54')]};return db[_0x4330('0x45')][_0x4330('0x20')](_0x5ebdbc)['then'](function(_0x5ebcc2){_0x52ee5a[_0x4330('0x20')]=_0x5ebcc2;if(_0x524a1e['query'][_0x4330('0x57')]){_0x4371c9[_0x4330('0x58')]=[{'all':!![]}];}return db[_0x4330('0x45')][_0x4330('0x59')](_0x4371c9);})[_0x4330('0xf')](function(_0x118b77){_0x52ee5a['rows']=_0x118b77;return _0x52ee5a;})[_0x4330('0xf')](respondWithFilteredResult(_0x416798,_0x4371c9))[_0x4330('0x19')](handleError(_0x416798,null));};exports[_0x4330('0x5a')]=function(_0x16d476,_0x5a0a7a){var _0x5b81bc={'raw':![],'where':{'id':_0x16d476[_0x4330('0x5b')]['id']},'include':[{'model':db[_0x4330('0x40')],'as':_0x4330('0x3e')},{'model':db['MailServerOut'],'as':_0x4330('0x41')},{'model':db[_0x4330('0x42')],'as':_0x4330('0x43')}]},_0x4e7a9d={};_0x4e7a9d[_0x4330('0x48')]=_[_0x4330('0x49')](db[_0x4330('0x45')]['rawAttributes']);_0x4e7a9d[_0x4330('0x4c')]=_[_0x4330('0x49')](_0x16d476[_0x4330('0x4c')]);_0x4e7a9d[_0x4330('0x4a')]=_[_0x4330('0x4b')](_0x4e7a9d[_0x4330('0x48')],_0x4e7a9d[_0x4330('0x4c')]);_0x5b81bc['attributes']=_[_0x4330('0x4b')](_0x4e7a9d[_0x4330('0x48')],qs[_0x4330('0x4d')](_0x16d476[_0x4330('0x4c')][_0x4330('0x4d')]));_0x5b81bc[_0x4330('0x4e')]=_0x5b81bc['attributes'][_0x4330('0x4f')]?_0x5b81bc[_0x4330('0x4e')]:_0x4e7a9d[_0x4330('0x48')];if(_0x16d476[_0x4330('0x4c')][_0x4330('0x57')]){_0x5b81bc['include']=[{'all':!![]}];}_0x5b81bc=_['merge']({},_0x5b81bc,_0x16d476[_0x4330('0x5c')]);return db[_0x4330('0x45')][_0x4330('0x5d')](_0x5b81bc)['then'](handleEntityNotFound(_0x5a0a7a,null))['then'](respondWithResult(_0x5a0a7a,null))[_0x4330('0x19')](handleError(_0x5a0a7a,null));};exports[_0x4330('0x23')]=function(_0x4a4c90,_0x25fa9a){if(_0x4a4c90[_0x4330('0x5e')]['id']){delete _0x4a4c90[_0x4330('0x5e')]['id'];}var _0x3e61c2=_0x4a4c90[_0x4330('0x5e')][_0x4330('0x5f')]===_0x4330('0x60')?null:_0x4a4c90[_0x4330('0x5e')]['provider'];var _0x14e292=_0x4a4c90['body'][_0x4330('0x3e')]||{};var _0x541263=_0x4a4c90['body']['Smtp']||{};if(_0x3e61c2){_0x14e292[_0x4330('0x3a')]=getImapHost(_0x3e61c2);_0x14e292[_0x4330('0x3b')]=0x3e1;_0x541263[_0x4330('0x3a')]=getSmtpHost(_0x3e61c2);_0x541263['port']=0x24b;_0x541263[_0x4330('0x61')]=![];}if(_0x541263['modernAuthentication']){_0x541263[_0x4330('0x61')]=![];}else{_0x541263[_0x4330('0x39')]=null;}if(!_0x14e292[_0x4330('0x38')])_0x14e292[_0x4330('0x39')]=null;_0x4a4c90[_0x4330('0x5e')]['Imap']=_0x14e292;_0x4a4c90[_0x4330('0x5e')][_0x4330('0x41')]=_0x541263;return db[_0x4330('0x45')][_0x4330('0x5d')]({'where':{'id':_0x4a4c90[_0x4330('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x4330('0x62')],'as':_0x4330('0x41')},{'model':db[_0x4330('0x42')],'as':_0x4330('0x43')}]})[_0x4330('0xf')](handleEntityNotFound(_0x25fa9a,null))[_0x4330('0xf')](function(_0x254868){if(!_0x254868)throw new Error('Mail\x20Account\x20not\x20found');if(_0x254868[_0x4330('0x3c')])delete _0x4a4c90[_0x4330('0x5e')][_0x4330('0x3e')];return _0x254868;})[_0x4330('0xf')](saveUpdates(_0x4a4c90['body'],null))[_0x4330('0xf')](function(_0x2a8f60){if(!_0x4a4c90[_0x4330('0x5e')][_0x4330('0x3e')])return _0x2a8f60;return db[_0x4330('0x40')]['update'](_0x4a4c90[_0x4330('0x5e')]['Imap'],{'where':{'MailAccountId':_0x2a8f60['id']}})['then'](function(){return _0x2a8f60;});})[_0x4330('0xf')](function(_0x46b59d){if(!_0x4a4c90[_0x4330('0x5e')][_0x4330('0x41')])return _0x46b59d;return db[_0x4330('0x62')][_0x4330('0x23')](_0x4a4c90[_0x4330('0x5e')][_0x4330('0x41')],{'where':{'MailAccountId':_0x46b59d['id']}})['then'](function(){return _0x46b59d;});})[_0x4330('0xf')](respondWithResult(_0x25fa9a,null))[_0x4330('0x19')](handleError(_0x25fa9a,null));};exports['describe']=function(_0x14a2ed,_0x14d71c){return db[_0x4330('0x45')][_0x4330('0x63')]()[_0x4330('0xf')](respondWithResult(_0x14d71c,null))[_0x4330('0x19')](handleError(_0x14d71c,null));};exports[_0x4330('0x64')]=function(_0xc8431,_0x417189){if(_0xc8431[_0x4330('0x5e')]['id']){delete _0xc8431[_0x4330('0x5e')]['id'];}return db[_0x4330('0x45')]['find']({'where':{'id':_0xc8431['params']['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x417189,null))[_0x4330('0xf')](function(_0x5189c5){if(_0x5189c5){_0xc8431[_0x4330('0x5e')][_0x4330('0x65')]=_0x5189c5['id'];return db[_0x4330('0x66')][_0x4330('0x67')](_0xc8431[_0x4330('0x5e')]);}})['then'](respondWithResult(_0x417189,null))[_0x4330('0x19')](handleError(_0x417189,null));};exports[_0x4330('0x68')]=function(_0x493fc8,_0x3dbfd2){var _0x5e2996={'raw':![],'where':{}};var _0x3c5e87={};var _0x14361f={'count':0x0,'rows':[]};return db[_0x4330('0x45')]['findOne']({'where':{'id':_0x493fc8[_0x4330('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3dbfd2,null))['then'](function(_0x587a7c){if(_0x587a7c){_0x3c5e87[_0x4330('0x48')]=_[_0x4330('0x49')](db[_0x4330('0x66')][_0x4330('0x46')]);_0x3c5e87[_0x4330('0x4c')]=_[_0x4330('0x49')](_0x493fc8[_0x4330('0x4c')]);_0x3c5e87[_0x4330('0x4a')]=_[_0x4330('0x4b')](_0x3c5e87[_0x4330('0x48')],_0x3c5e87[_0x4330('0x4c')]);_0x5e2996[_0x4330('0x4e')]=_[_0x4330('0x4b')](_0x3c5e87['model'],qs['fields'](_0x493fc8[_0x4330('0x4c')][_0x4330('0x4d')]));_0x5e2996[_0x4330('0x4e')]=_0x5e2996['attributes'][_0x4330('0x4f')]?_0x5e2996[_0x4330('0x4e')]:_0x3c5e87[_0x4330('0x48')];if(!_0x493fc8[_0x4330('0x4c')][_0x4330('0x50')]('nolimit')){_0x5e2996[_0x4330('0x1f')]=qs[_0x4330('0x1f')](_0x493fc8[_0x4330('0x4c')][_0x4330('0x1f')]);_0x5e2996[_0x4330('0x1d')]=qs[_0x4330('0x1d')](_0x493fc8[_0x4330('0x4c')][_0x4330('0x1d')]);}_0x5e2996[_0x4330('0x69')]=qs['sort'](_0x493fc8[_0x4330('0x4c')][_0x4330('0x52')]);_0x5e2996[_0x4330('0x54')]=qs[_0x4330('0x4a')](_[_0x4330('0x6a')](_0x493fc8['query'],_0x3c5e87['filters']));_0x5e2996[_0x4330('0x54')]['MailAccountId']=_0x587a7c['id'];if(_0x493fc8[_0x4330('0x4c')][_0x4330('0x53')]){_0x5e2996[_0x4330('0x54')]=_[_0x4330('0x55')](_0x5e2996['where'],{'$or':_[_0x4330('0x44')](_0x5e2996['attributes'],function(_0x5b988b){var _0x1f500b={};_0x1f500b[_0x5b988b]={'$like':'%'+_0x493fc8[_0x4330('0x4c')][_0x4330('0x53')]+'%'};return _0x1f500b;})});}_0x5e2996=_[_0x4330('0x55')]({},_0x5e2996,_0x493fc8[_0x4330('0x5c')]);return db[_0x4330('0x66')]['count']({'where':_0x5e2996['where']})[_0x4330('0xf')](function(_0x59abf7){_0x14361f['count']=_0x59abf7;if(_0x493fc8[_0x4330('0x4c')][_0x4330('0x57')]){_0x5e2996['include']=[{'all':!![]}];}return db[_0x4330('0x66')]['findAll'](_0x5e2996);})[_0x4330('0xf')](function(_0x1b5f97){_0x14361f[_0x4330('0x6b')]=_0x1b5f97;return _0x14361f;});}})['then'](respondWithFilteredResult(_0x3dbfd2,_0x5e2996))[_0x4330('0x19')](handleError(_0x3dbfd2,null));};exports[_0x4330('0x6c')]=function(_0x2ff7b6,_0x3c03a6){return db[_0x4330('0x45')][_0x4330('0x5d')]({'where':{'id':_0x2ff7b6['params']['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x3c03a6,null))['then'](function(_0xb60cb7){if(_0xb60cb7){return _0xb60cb7[_0x4330('0x6c')](_0x2ff7b6[_0x4330('0x4c')]['ids']);}})[_0x4330('0xf')](respondWithStatusCode(_0x3c03a6,null))[_0x4330('0x19')](handleError(_0x3c03a6,null));};exports[_0x4330('0x6d')]=function(_0x310cee,_0x128c0e){if(_0x310cee[_0x4330('0x5e')]['id']){delete _0x310cee[_0x4330('0x5e')]['id'];}return db[_0x4330('0x45')][_0x4330('0x5d')]({'where':{'id':_0x310cee['params']['id']}})['then'](handleEntityNotFound(_0x128c0e,null))[_0x4330('0xf')](function(_0x48f87a){if(_0x48f87a){_0x310cee[_0x4330('0x5e')][_0x4330('0x65')]=_0x48f87a['id'];return db[_0x4330('0x6e')][_0x4330('0x67')](_0x310cee[_0x4330('0x5e')]);}})[_0x4330('0xf')](respondWithResult(_0x128c0e,null))[_0x4330('0x19')](handleError(_0x128c0e,null));};exports['getAnswers']=function(_0x1e5e18,_0x40c2fb){var _0x5ad020={'raw':![],'where':{}};var _0x29cd3f={};var _0x37a639={'count':0x0,'rows':[]};return db[_0x4330('0x45')][_0x4330('0x6f')]({'where':{'id':_0x1e5e18['params']['id']}})['then'](handleEntityNotFound(_0x40c2fb,null))[_0x4330('0xf')](function(_0x1ee5cd){if(_0x1ee5cd){_0x29cd3f['model']=_[_0x4330('0x49')](db[_0x4330('0x6e')][_0x4330('0x46')]);_0x29cd3f[_0x4330('0x4c')]=_[_0x4330('0x49')](_0x1e5e18[_0x4330('0x4c')]);_0x29cd3f[_0x4330('0x4a')]=_['intersection'](_0x29cd3f[_0x4330('0x48')],_0x29cd3f[_0x4330('0x4c')]);_0x5ad020[_0x4330('0x4e')]=_[_0x4330('0x4b')](_0x29cd3f[_0x4330('0x48')],qs[_0x4330('0x4d')](_0x1e5e18[_0x4330('0x4c')][_0x4330('0x4d')]));_0x5ad020['attributes']=_0x5ad020[_0x4330('0x4e')][_0x4330('0x4f')]?_0x5ad020[_0x4330('0x4e')]:_0x29cd3f[_0x4330('0x48')];if(!_0x1e5e18[_0x4330('0x4c')][_0x4330('0x50')]('nolimit')){_0x5ad020[_0x4330('0x1f')]=qs['limit'](_0x1e5e18['query'][_0x4330('0x1f')]);_0x5ad020['offset']=qs[_0x4330('0x1d')](_0x1e5e18[_0x4330('0x4c')][_0x4330('0x1d')]);}_0x5ad020['order']=qs['sort'](_0x1e5e18[_0x4330('0x4c')][_0x4330('0x52')]);_0x5ad020[_0x4330('0x54')]=qs[_0x4330('0x4a')](_[_0x4330('0x6a')](_0x1e5e18[_0x4330('0x4c')],_0x29cd3f['filters']));_0x5ad020[_0x4330('0x54')][_0x4330('0x65')]=_0x1ee5cd['id'];if(_0x1e5e18[_0x4330('0x4c')][_0x4330('0x53')]){_0x5ad020[_0x4330('0x54')]=_['merge'](_0x5ad020[_0x4330('0x54')],{'$or':_[_0x4330('0x44')](_0x5ad020[_0x4330('0x4e')],function(_0x249006){var _0x254053={};_0x254053[_0x249006]={'$like':'%'+_0x1e5e18[_0x4330('0x4c')][_0x4330('0x53')]+'%'};return _0x254053;})});}_0x5ad020=_[_0x4330('0x55')]({},_0x5ad020,_0x1e5e18[_0x4330('0x5c')]);return db[_0x4330('0x6e')][_0x4330('0x20')]({'where':_0x5ad020[_0x4330('0x54')]})[_0x4330('0xf')](function(_0x58b09e){_0x37a639[_0x4330('0x20')]=_0x58b09e;if(_0x1e5e18[_0x4330('0x4c')][_0x4330('0x57')]){_0x5ad020[_0x4330('0x58')]=[{'all':!![]}];}return db[_0x4330('0x6e')][_0x4330('0x59')](_0x5ad020);})[_0x4330('0xf')](function(_0xccb822){_0x37a639['rows']=_0xccb822;return _0x37a639;});}})[_0x4330('0xf')](respondWithFilteredResult(_0x40c2fb,_0x5ad020))[_0x4330('0x19')](handleError(_0x40c2fb,null));};exports[_0x4330('0x70')]=function(_0x594ca0,_0x50c5c8){return db[_0x4330('0x45')][_0x4330('0x5d')]({'where':{'id':_0x594ca0['params']['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x50c5c8,null))[_0x4330('0xf')](function(_0x1ee673){if(_0x1ee673){return _0x1ee673[_0x4330('0x70')](_0x594ca0[_0x4330('0x4c')][_0x4330('0x71')]);}})[_0x4330('0xf')](respondWithStatusCode(_0x50c5c8,null))[_0x4330('0x19')](handleError(_0x50c5c8,null));};exports[_0x4330('0x67')]=function(_0x1025ac,_0x257fa5){var _0x14002d={'name':_0x1025ac[_0x4330('0x5e')][_0x4330('0x2a')],'key':_0x1025ac[_0x4330('0x5e')][_0x4330('0x72')],'provider':_0x1025ac[_0x4330('0x5e')]['provider']==='custom'?null:_0x1025ac['body'][_0x4330('0x5f')],'email':_0x1025ac['body'][_0x4330('0x73')],'ListId':_0x1025ac[_0x4330('0x5e')][_0x4330('0x74')],'active':!_['isNil'](_0x1025ac[_0x4330('0x5e')][_0x4330('0x75')])?_0x1025ac[_0x4330('0x5e')][_0x4330('0x75')]:!![],'description':_0x1025ac[_0x4330('0x5e')][_0x4330('0x76')]||null};var _0x4d57f4=getAuthenticationOptions(_0x14002d[_0x4330('0x5f')],_0x1025ac[_0x4330('0x5e')]);_0x14002d['Imap']=_0x4d57f4[_0x4330('0x3e')];_0x14002d[_0x4330('0x41')]=_0x4d57f4['Smtp'];return db['MailAccount'][_0x4330('0x67')](_0x14002d,{'include':[{'model':db[_0x4330('0x62')],'as':'Smtp'},{'model':db[_0x4330('0x40')],'as':_0x4330('0x3e')}]})[_0x4330('0xf')](function(_0x239237){var _0x3be1df=_0x1025ac[_0x4330('0x34')][_0x4330('0x25')]({'plain':!![]});if(!_0x3be1df)throw new Error(_0x4330('0x77'));if(_0x3be1df['role']===_0x4330('0x34')){var _0x5edae6=_0x239237[_0x4330('0x25')]({'plain':!![]});return db[_0x4330('0x78')][_0x4330('0x5d')]({'where':{'name':_0x4330('0x26'),'userProfileId':_0x3be1df[_0x4330('0x79')]},'raw':!![]})['then'](function(_0x56695f){if(_0x56695f&&_0x56695f['autoAssociation']===0x0){return db[_0x4330('0x27')]['create']({'name':_0x5edae6[_0x4330('0x2a')],'resourceId':_0x5edae6['id'],'type':_0x56695f[_0x4330('0x2a')],'sectionId':_0x56695f['id']},{})[_0x4330('0xf')](function(){return _0x239237;});}else{return _0x239237;}})[_0x4330('0x19')](function(_0x52911e){logger[_0x4330('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52911e);throw _0x52911e;});}return _0x239237;})[_0x4330('0xf')](respondWithResult(_0x257fa5,0xc9))[_0x4330('0x19')](handleError(_0x257fa5,null));};exports[_0x4330('0x7a')]=function(_0x3fb091,_0x3198d5){return db['MailAccount']['findOne']({'where':{'id':_0x3fb091[_0x4330('0x5b')]['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x3198d5,null))[_0x4330('0xf')](function(_0x43a8b6){if(_0x43a8b6){return _0x43a8b6[_0x4330('0x7a')]();}return null;})[_0x4330('0xf')](respondWithResult(_0x3198d5,null))[_0x4330('0x19')](handleError(_0x3198d5,null));};exports[_0x4330('0x7b')]=function(_0x353324,_0x8a604c){if(_0x353324[_0x4330('0x5e')]['id']){delete _0x353324[_0x4330('0x5e')]['id'];}return db[_0x4330('0x45')][_0x4330('0x5d')]({'where':{'id':_0x353324[_0x4330('0x5b')]['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x8a604c,null))[_0x4330('0xf')](function(_0x58855c){if(_0x58855c){_0x353324[_0x4330('0x5e')][_0x4330('0x65')]=_0x58855c['id'];return db[_0x4330('0x40')]['create'](_0x353324[_0x4330('0x5e')]);}})['then'](respondWithResult(_0x8a604c,null))[_0x4330('0x19')](handleError(_0x8a604c,null));};exports[_0x4330('0x7c')]=function(_0x854e5a,_0x1ff03a){return db[_0x4330('0x45')]['findOne']({'where':{'id':_0x854e5a[_0x4330('0x5b')]['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x1ff03a,null))[_0x4330('0xf')](function(_0x475682){if(_0x475682){return _0x475682[_0x4330('0x7d')](null);}return null;})['then'](respondWithStatusCode(_0x1ff03a,null))['catch'](handleError(_0x1ff03a,null));};exports[_0x4330('0x7e')]=function(_0x1098bc,_0x2e0a8f){return db[_0x4330('0x45')][_0x4330('0x6f')]({'where':{'id':_0x1098bc[_0x4330('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2e0a8f,null))[_0x4330('0xf')](function(_0x2e1dd4){if(_0x2e1dd4){return _0x2e1dd4[_0x4330('0x7e')]();}return null;})['then'](respondWithResult(_0x2e0a8f,null))[_0x4330('0x19')](handleError(_0x2e0a8f,null));};exports[_0x4330('0x7f')]=function(_0x51d63f,_0x41b94a){if(_0x51d63f[_0x4330('0x5e')]['id']){delete _0x51d63f['body']['id'];}return db[_0x4330('0x45')]['find']({'where':{'id':_0x51d63f[_0x4330('0x5b')]['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x41b94a,null))['then'](function(_0x9fd5e0){if(_0x9fd5e0){_0x51d63f['body'][_0x4330('0x65')]=_0x9fd5e0['id'];return db[_0x4330('0x62')]['create'](_0x51d63f[_0x4330('0x5e')]);}})[_0x4330('0xf')](respondWithResult(_0x41b94a,null))['catch'](handleError(_0x41b94a,null));};exports['removeSmtp']=function(_0x407c2b,_0x5021fb){return db[_0x4330('0x45')][_0x4330('0x6f')]({'where':{'id':_0x407c2b[_0x4330('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5021fb,null))[_0x4330('0xf')](function(_0x51524a){if(_0x51524a){return _0x51524a['setSmtp'](null);}return null;})[_0x4330('0xf')](respondWithStatusCode(_0x5021fb,null))['catch'](handleError(_0x5021fb,null));};exports['addInteraction']=function(_0x2d42a2,_0x22c11e){return db['MailInteraction']['find']({'where':{'id':_0x2d42a2[_0x4330('0x5b')]['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x22c11e,null))[_0x4330('0xf')](function(_0x1ff0a6){if(_0x1ff0a6){return _0x1ff0a6['addInteraction'](_0x2d42a2[_0x4330('0x5e')]['ids'],_[_0x4330('0x80')](_0x2d42a2[_0x4330('0x5e')],[_0x4330('0x71'),'id'])||{});}})[_0x4330('0xf')](respondWithResult(_0x22c11e,null))[_0x4330('0x19')](handleError(_0x22c11e,null));};exports[_0x4330('0x81')]=function(_0x197886,_0x331eab){var _0x232d25={'raw':![],'where':{}};var _0x184fc6={};var _0x4c565d={'count':0x0,'rows':[]};return db[_0x4330('0x45')][_0x4330('0x6f')]({'where':{'id':_0x197886[_0x4330('0x5b')]['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x331eab,null))['then'](function(_0x119ddf){if(_0x119ddf){_0x184fc6['model']=_[_0x4330('0x49')](db[_0x4330('0x82')]['rawAttributes']);_0x184fc6[_0x4330('0x4c')]=_[_0x4330('0x49')](_0x197886['query']);_0x184fc6['filters']=_[_0x4330('0x4b')](_0x184fc6[_0x4330('0x48')],_0x184fc6[_0x4330('0x4c')]);_0x232d25['attributes']=_[_0x4330('0x4b')](_0x184fc6[_0x4330('0x48')],qs[_0x4330('0x4d')](_0x197886[_0x4330('0x4c')][_0x4330('0x4d')]));_0x232d25[_0x4330('0x4e')]=_0x232d25[_0x4330('0x4e')]['length']?_0x232d25[_0x4330('0x4e')]:_0x184fc6[_0x4330('0x48')];if(!_0x197886['query'][_0x4330('0x50')](_0x4330('0x51'))){_0x232d25['limit']=qs[_0x4330('0x1f')](_0x197886[_0x4330('0x4c')]['limit']);_0x232d25['offset']=qs['offset'](_0x197886[_0x4330('0x4c')][_0x4330('0x1d')]);}_0x232d25[_0x4330('0x69')]=qs[_0x4330('0x52')](_0x197886['query'][_0x4330('0x52')]);_0x232d25[_0x4330('0x54')]=qs[_0x4330('0x4a')](_[_0x4330('0x6a')](_0x197886[_0x4330('0x4c')],_0x184fc6[_0x4330('0x4a')]));_0x232d25[_0x4330('0x54')][_0x4330('0x65')]=_0x119ddf['id'];if(_0x197886[_0x4330('0x4c')][_0x4330('0x53')]){_0x232d25[_0x4330('0x54')]=_['merge'](_0x232d25[_0x4330('0x54')],{'$or':_[_0x4330('0x44')](_0x232d25[_0x4330('0x4e')],function(_0x3e40be){var _0x3c1c52={};_0x3c1c52[_0x3e40be]={'$like':'%'+_0x197886[_0x4330('0x4c')][_0x4330('0x53')]+'%'};return _0x3c1c52;})});}_0x232d25=_[_0x4330('0x55')]({},_0x232d25,_0x197886['options']);return db['MailInteraction'][_0x4330('0x20')]({'where':_0x232d25[_0x4330('0x54')]})[_0x4330('0xf')](function(_0x3cd91a){_0x4c565d[_0x4330('0x20')]=_0x3cd91a;if(_0x197886['query'][_0x4330('0x57')]){_0x232d25[_0x4330('0x58')]=[{'model':db['CmContact'],'as':_0x4330('0x83'),'required':![]},{'model':db[_0x4330('0x84')],'as':_0x4330('0x85'),'attributes':[_0x4330('0x2a'),_0x4330('0x86'),'internal'],'required':![]},{'model':db[_0x4330('0x87')],'as':_0x4330('0x88'),'attributes':['id','name',_0x4330('0x89')],'where':_0x197886[_0x4330('0x4c')][_0x4330('0x8a')]?{'id':_0x197886[_0x4330('0x4c')][_0x4330('0x8a')]}:undefined,'required':_0x197886[_0x4330('0x4c')]['tag']?!![]:![]}];}return db[_0x4330('0x82')][_0x4330('0x59')](_0x232d25);})[_0x4330('0xf')](function(_0x1d0e34){_0x4c565d['rows']=_0x1d0e34;return _0x4c565d;});}})[_0x4330('0xf')](respondWithFilteredResult(_0x331eab,_0x232d25))[_0x4330('0x19')](handleError(_0x331eab,null));};exports['addApplications']=function addApplications(_0x4d6857,_0x16b0dd){var _0x327004=_0x4d6857[_0x4330('0x5b')]['id'];var _0x2f95b0=_0x4d6857[_0x4330('0x5e')];var _0x4c7cc2=0xc8;var _0x57b34d=null;return db[_0x4330('0x8b')]['transaction']({'isolationLevel':db['sequelize'][_0x4330('0x8c')]['ISOLATION_LEVELS'][_0x4330('0x8d')]},function(_0x59b9a8){return db['MailAccount'][_0x4330('0x6f')]({'where':{'id':_0x327004},'transaction':_0x59b9a8})['then'](function(_0x501bad){if(_0x501bad){return db[_0x4330('0x8e')][_0x4330('0x24')]({'where':{'MailAccountId':_0x327004},'transaction':_0x59b9a8})['then'](function(){var _0x27548a=_[_0x4330('0x44')](_0x2f95b0,function(_0x3161aa){_0x3161aa[_0x4330('0x65')]=_0x327004;return _0x3161aa;});return db[_0x4330('0x8e')][_0x4330('0x8f')](_0x27548a,{'transaction':_0x59b9a8});});}else{_0x4c7cc2=0x194;_0x57b34d=[];}});})[_0x4330('0xf')](function(){if(_0x4c7cc2!==0x194){return db[_0x4330('0x8e')][_0x4330('0x90')]({'where':{'MailAccountId':_0x327004},'order':_0x4330('0x91')})[_0x4330('0xf')](function(_0x19424f){_0x57b34d=_0x19424f;});}})[_0x4330('0x19')](function(_0x5e33d7){_0x4c7cc2=0x1f4;logger['error'](_0x5e33d7[_0x4330('0x29')]);if(_0x5e33d7[_0x4330('0x2a')]){delete _0x5e33d7['name'];}_0x57b34d=_0x5e33d7;})['finally'](function(){if(_0x57b34d===null){_0x16b0dd[_0x4330('0x1a')](_0x4c7cc2);}else{if(_0x4c7cc2===0x1f4){_0x16b0dd[_0x4330('0x1b')](_0x4c7cc2)[_0x4330('0x2b')](_0x57b34d);}else{_0x16b0dd[_0x4330('0x1b')](_0x4c7cc2)[_0x4330('0x1c')](_0x57b34d);}}});};exports[_0x4330('0x92')]=function(_0x48ea2a,_0x3d5af3){var _0x57e442={};var _0x73ac27={};var _0x216eba;var _0x296486;return db['MailAccount'][_0x4330('0x6f')]({'where':{'id':_0x48ea2a[_0x4330('0x5b')]['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x3d5af3,null))[_0x4330('0xf')](function(_0x5a8583){if(_0x5a8583){_0x216eba=_0x5a8583;_0x73ac27['model']=_[_0x4330('0x49')](db['MailApplication'][_0x4330('0x46')]);_0x73ac27[_0x4330('0x4c')]=_[_0x4330('0x49')](_0x48ea2a[_0x4330('0x4c')]);_0x73ac27['filters']=_[_0x4330('0x4b')](_0x73ac27[_0x4330('0x48')],_0x73ac27[_0x4330('0x4c')]);_0x57e442[_0x4330('0x4e')]=_[_0x4330('0x4b')](_0x73ac27[_0x4330('0x48')],qs['fields'](_0x48ea2a[_0x4330('0x4c')][_0x4330('0x4d')]));_0x57e442[_0x4330('0x4e')]=_0x57e442[_0x4330('0x4e')][_0x4330('0x4f')]?_0x57e442[_0x4330('0x4e')]:_0x73ac27[_0x4330('0x48')];_0x57e442['order']=qs[_0x4330('0x52')](_0x48ea2a[_0x4330('0x4c')][_0x4330('0x52')]);_0x57e442[_0x4330('0x54')]=qs['filters'](_['pick'](_0x48ea2a[_0x4330('0x4c')],_0x73ac27[_0x4330('0x4a')]));if(_0x48ea2a['query'][_0x4330('0x53')]){_0x57e442[_0x4330('0x54')]=_['merge'](_0x57e442['where'],{'$or':_[_0x4330('0x44')](_0x57e442[_0x4330('0x4e')],function(_0x66339a){var _0x134fd9={};_0x134fd9[_0x66339a]={'$like':'%'+_0x48ea2a[_0x4330('0x4c')][_0x4330('0x53')]+'%'};return _0x134fd9;})});}_0x57e442=_[_0x4330('0x55')]({},_0x57e442,_0x48ea2a[_0x4330('0x5c')]);return _0x216eba[_0x4330('0x92')](_0x57e442);}})['then'](function(_0x347be8){if(_0x347be8){_0x296486=_0x347be8[_0x4330('0x4f')];if(!_0x48ea2a['query'][_0x4330('0x50')]('nolimit')){_0x57e442['limit']=qs[_0x4330('0x1f')](_0x48ea2a['query'][_0x4330('0x1f')]);_0x57e442[_0x4330('0x1d')]=qs[_0x4330('0x1d')](_0x48ea2a['query']['offset']);}return _0x216eba[_0x4330('0x92')](_0x57e442);}})[_0x4330('0xf')](function(_0x329fb1){if(_0x329fb1){return _0x329fb1?{'count':_0x296486,'rows':_0x329fb1}:null;}})['then'](respondWithResult(_0x3d5af3,null))[_0x4330('0x19')](handleError(_0x3d5af3,null));};exports[_0x4330('0x93')]=function(_0x1ba44c,_0x356531){var _0x4637b1={'raw':!![],'where':{}};var _0x161988={};var _0x1fe59d={'count':0x0,'rows':[]};return db[_0x4330('0x45')]['findOne']({'where':{'id':_0x1ba44c['params']['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x356531,null))[_0x4330('0xf')](function(_0x9a8e21){if(_0x9a8e21){_0x161988[_0x4330('0x48')]=_[_0x4330('0x49')](db[_0x4330('0x94')]['rawAttributes']);_0x161988[_0x4330('0x4c')]=_[_0x4330('0x49')](_0x1ba44c[_0x4330('0x4c')]);_0x161988['filters']=_[_0x4330('0x4b')](_0x161988[_0x4330('0x48')],_0x161988['query']);_0x4637b1[_0x4330('0x4e')]=_[_0x4330('0x4b')](_0x161988[_0x4330('0x48')],qs[_0x4330('0x4d')](_0x1ba44c['query'][_0x4330('0x4d')]));_0x4637b1[_0x4330('0x4e')]=_0x4637b1['attributes'][_0x4330('0x4f')]?_0x4637b1[_0x4330('0x4e')]:_0x161988[_0x4330('0x48')];if(!_0x1ba44c[_0x4330('0x4c')][_0x4330('0x50')](_0x4330('0x51'))){_0x4637b1[_0x4330('0x1f')]=qs[_0x4330('0x1f')](_0x1ba44c[_0x4330('0x4c')][_0x4330('0x1f')]);_0x4637b1[_0x4330('0x1d')]=qs[_0x4330('0x1d')](_0x1ba44c[_0x4330('0x4c')][_0x4330('0x1d')]);}_0x4637b1[_0x4330('0x69')]=qs[_0x4330('0x52')](_0x1ba44c[_0x4330('0x4c')]['sort']);_0x4637b1[_0x4330('0x54')]=qs[_0x4330('0x4a')](_[_0x4330('0x6a')](_0x1ba44c[_0x4330('0x4c')],_0x161988[_0x4330('0x4a')]));_0x4637b1[_0x4330('0x54')][_0x4330('0x65')]=_0x9a8e21['id'];if(_0x1ba44c['query']['filter']){_0x4637b1[_0x4330('0x54')]=_['merge'](_0x4637b1[_0x4330('0x54')],{'$or':_[_0x4330('0x44')](_0x4637b1['attributes'],function(_0x24d18f){var _0xb3403c={};_0xb3403c[_0x24d18f]={'$like':'%'+_0x1ba44c[_0x4330('0x4c')][_0x4330('0x53')]+'%'};return _0xb3403c;})});}if(_0x1ba44c['query'][_0x4330('0x95')]){var _0x320ad1=_0x1ba44c[_0x4330('0x4c')][_0x4330('0x95')][_0x4330('0x96')](',');var _0x2ea320={};_0x2ea320[_0x320ad1[0x0]]={'$gte':moment(_0x320ad1[0x1])[_0x4330('0x97')](_0x4330('0x98'))};_0x4637b1[_0x4330('0x54')]=_['merge'](_0x4637b1[_0x4330('0x54')],_0x2ea320);}_0x4637b1=_[_0x4330('0x55')]({},_0x4637b1,_0x1ba44c[_0x4330('0x5c')]);return db[_0x4330('0x94')]['count']({'where':_0x4637b1['where']})['then'](function(_0x58fab2){_0x1fe59d['count']=_0x58fab2;if(_0x1ba44c[_0x4330('0x4c')]['includeAll']){_0x4637b1[_0x4330('0x58')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x4637b1);})[_0x4330('0xf')](function(_0x3cc671){if(_0x1ba44c[_0x4330('0x4c')][_0x4330('0x99')]===_0x4330('0x9a')){for(var _0x34a850=0x0;_0x34a850<_0x3cc671['length'];_0x34a850++){_0x3cc671[_0x34a850][_0x4330('0x5e')]=juice(_0x3cc671[_0x34a850]['body']);}}_0x1fe59d[_0x4330('0x6b')]=_0x3cc671;return _0x1fe59d;});}})[_0x4330('0xf')](respondWithFilteredResult(_0x356531,_0x4637b1))[_0x4330('0x19')](handleError(_0x356531,null));};exports['send']=function(_0x2e40f6,_0x2a239b){var _0x3e586b,_0x327636={},_0x150593;if(_0x2e40f6[_0x4330('0x5e')]['to']){_0x150593=_0x2e40f6[_0x4330('0x5e')]['to'][_0x4330('0x96')](',')[0x0];}return db[_0x4330('0x45')][_0x4330('0x5d')]({'where':{'id':_0x2e40f6[_0x4330('0x5b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4330('0x9b')],'as':_0x4330('0x9c'),'where':{'email':_0x150593},'limit':0x1,'order':[[_0x4330('0x9d'),_0x4330('0x9e')]]}]},{'model':db['MailServerOut'],'as':_0x4330('0x41'),'raw':!![],'include':[{'model':db[_0x4330('0x9f')],'as':_0x4330('0x9f'),'raw':!![]}]}]})[_0x4330('0xf')](handleEntityNotFound(_0x2a239b,null))['then'](function(_0x5644bd){if(!_0x5644bd)return;_0x3e586b=_0x5644bd;if(!_0x5644bd[_0x4330('0x41')])throw new Error(_0x4330('0xa0'));if(_[_0x4330('0xa1')](_0x2e40f6[_0x4330('0x5e')]['from'])){_0x2e40f6[_0x4330('0x5e')][_0x4330('0xa2')]=util[_0x4330('0x97')]('%s\x20<%s>',_0x5644bd[_0x4330('0x2a')],_0x5644bd['email']||_0x5644bd[_0x4330('0x41')][_0x4330('0x34')]);}if(_0x2e40f6[_0x4330('0x5e')]['attachments']&&_0x2e40f6[_0x4330('0x5e')][_0x4330('0xa3')][_0x4330('0x4f')]){for(var _0x209fd4=0x0;_0x209fd4<_0x2e40f6[_0x4330('0x5e')][_0x4330('0xa3')][_0x4330('0x4f')];_0x209fd4+=0x1){_0x2e40f6[_0x4330('0x5e')][_0x4330('0xa3')][_0x209fd4]={'filename':_0x2e40f6[_0x4330('0x5e')][_0x4330('0xa3')][_0x209fd4]['name'],'path':path['join'](config[_0x4330('0xa4')],_0x4330('0xa5'),_0x2e40f6['body'][_0x4330('0xa3')][_0x209fd4][_0x4330('0xa6')])};}}var _0x2e5678=_0x5644bd[_0x4330('0xa7')]();return respondWithRpcPromise(_0x4330('0xa8'),_0x4330('0xa9'),{'account':_0x2e5678,'message':_0x2e40f6[_0x4330('0x5e')]});})['then'](function(_0x2d81f8){if(!_0x2d81f8)return;_0x327636=_0x2d81f8;if(!_0x3e586b['List'])throw new Error(_0x4330('0xaa'));if(_0x3e586b['List']['Contacts'][_0x4330('0x4f')])return _0x3e586b['List'][_0x4330('0x9c')][0x0];return db[_0x4330('0x9b')][_0x4330('0x67')](_[_0x4330('0xa')](_0x2e40f6[_0x4330('0x5e')],{'firstName':_0x2e40f6['body']['to'],'email':_0x2e40f6[_0x4330('0x5e')]['to'],'phone':_0x2e40f6[_0x4330('0x5e')]['to'],'ListId':_0x3e586b[_0x4330('0x74')]}));})['then'](function(_0x4dfa70){if(!_0x4dfa70)return;var _0x440ec6={'UserId':_0x2e40f6[_0x4330('0x34')]['id'],'ContactId':_0x4dfa70['id'],'MailAccountId':_0x3e586b['id'],'inReplyTo':_0x327636[_0x4330('0xab')],'to':_0x2e40f6[_0x4330('0x5e')][_0x4330('0xa2')],'cc':_0x2e40f6[_0x4330('0x5e')]['cc'],'subject':_0x2e40f6[_0x4330('0x5e')][_0x4330('0xac')],'attach':_0x2e40f6['body']['attach'],'firstMsgDirection':_0x4330('0xad'),'lastMsgAt':moment()['format'](_0x4330('0x98')),'lastMsgDirection':'out','Messages':[_['merge'](_0x2e40f6[_0x4330('0x5e')],{'messageId':_0x327636['messageId'],'sentAt':moment()[_0x4330('0x97')](_0x4330('0x98')),'read':!![],'MailAccountId':_0x3e586b['id'],'UserId':_0x2e40f6[_0x4330('0x34')]['id'],'ContactId':_0x4dfa70['id']})]};if(_0x2e40f6[_0x4330('0x5e')][_0x4330('0xae')]){_0x440ec6=_[_0x4330('0x55')](_0x440ec6,_0x2e40f6['body'][_0x4330('0xae')]);}return db[_0x4330('0x82')][_0x4330('0x67')](_0x440ec6,{'include':[{'model':db[_0x4330('0x94')],'as':'Messages'}]});})[_0x4330('0xf')](respondWithResult(_0x2a239b,null))[_0x4330('0x19')](handleError(_0x2a239b,null));};exports['verifySmtp']=function(_0x3b0ae3,_0xb7da64){return db[_0x4330('0x45')][_0x4330('0x5d')]({'where':{'id':_0x3b0ae3[_0x4330('0x5b')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x4330('0x41'),'raw':!![],'include':[{'model':db[_0x4330('0x9f')],'as':_0x4330('0x9f'),'raw':!![]}]}]})[_0x4330('0xf')](handleEntityNotFound(_0xb7da64,null))[_0x4330('0xf')](function(_0xbe805e){if(!_0xbe805e[_0x4330('0x41')])return;var _0x319793=_0xbe805e[_0x4330('0xa7')]();return respondWithRpcPromise(_0x4330('0xaf'),_0x4330('0xb0'),{'account':_0x319793});})['then'](respondWithResult(_0xb7da64,null))[_0x4330('0x19')](handleError(_0xb7da64,null));};exports['destroy']=function(_0xa428d5,_0x7accd0){return db[_0x4330('0x45')]['find']({'where':{'id':_0xa428d5[_0x4330('0x5b')]['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x7accd0,null))[_0x4330('0xf')](function(_0x3c4279){if(_0x3c4279&&_0x3c4279[_0x4330('0x3c')]){throw new db[(_0x4330('0xb1'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x3c4279;})[_0x4330('0xf')](removeEntity(_0x7accd0,null))[_0x4330('0x19')](handleError(_0x7accd0,null));};exports[_0x4330('0xb2')]=function(_0x2eb1c2,_0x14df88){return db[_0x4330('0x45')][_0x4330('0x5d')]({'where':{'id':_0x2eb1c2['params']['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x14df88,null))[_0x4330('0xf')](function(_0x30f51a){if(_0x30f51a){return _0x30f51a[_0x4330('0xb2')](_0x2eb1c2['body'][_0x4330('0x71')],_[_0x4330('0x80')](_0x2eb1c2[_0x4330('0x5e')],['ids','id'])||{})[_0x4330('0xb3')](function(_0xfb0d60){for(var _0x10c552=0x0;_0x10c552<_0x2eb1c2[_0x4330('0x5e')][_0x4330('0x71')][_0x4330('0x4f')];_0x10c552+=0x1){socket[_0x4330('0xb4')](_0x4330('0xb5'),{'UserId':Number(_0x2eb1c2[_0x4330('0x5e')][_0x4330('0x71')][_0x10c552]),'MailAccountId':Number(_0x2eb1c2[_0x4330('0x5b')]['id'])});}return _0xfb0d60;});}})['then'](respondWithResult(_0x14df88,null))[_0x4330('0x19')](handleError(_0x14df88,null));};exports[_0x4330('0xb6')]=function(_0x57d15d,_0x15678c){return db[_0x4330('0x45')]['find']({'where':{'id':_0x57d15d[_0x4330('0x5b')]['id']}})[_0x4330('0xf')](handleEntityNotFound(_0x15678c,null))[_0x4330('0xf')](function(_0x199e3e){if(_0x199e3e){return _0x199e3e[_0x4330('0xb6')](_0x57d15d[_0x4330('0x4c')]['ids'])['then'](function(){if(_[_0x4330('0xb7')](_0x57d15d[_0x4330('0x4c')][_0x4330('0x71')])){for(var _0x212ae5=0x0;_0x212ae5<_0x57d15d[_0x4330('0x4c')][_0x4330('0x71')]['length'];_0x212ae5+=0x1){socket['emit'](_0x4330('0xb8'),{'UserId':Number(_0x57d15d[_0x4330('0x4c')][_0x4330('0x71')][_0x212ae5]),'MailAccountId':Number(_0x57d15d[_0x4330('0x5b')]['id'])});}}else{socket[_0x4330('0xb4')](_0x4330('0xb8'),{'UserId':Number(_0x57d15d[_0x4330('0x4c')][_0x4330('0x71')]),'MailAccountId':Number(_0x57d15d[_0x4330('0x5b')]['id'])});}});}})[_0x4330('0xf')](respondWithStatusCode(_0x15678c,null))[_0x4330('0x19')](handleError(_0x15678c,null));};exports[_0x4330('0xb9')]=function(_0x110c3d,_0x331128){var _0x1d9486={};var _0x183d24={};var _0x52f390;var _0x5d9246;return db[_0x4330('0x45')][_0x4330('0x6f')]({'where':{'id':_0x110c3d[_0x4330('0x5b')]['id']}})['then'](handleEntityNotFound(_0x331128,null))[_0x4330('0xf')](function(_0x3379b1){if(_0x3379b1){_0x52f390=_0x3379b1;_0x183d24[_0x4330('0x48')]=_[_0x4330('0x49')](db[_0x4330('0x84')][_0x4330('0x46')]);_0x183d24[_0x4330('0x4c')]=_['keys'](_0x110c3d[_0x4330('0x4c')]);_0x183d24[_0x4330('0x4a')]=_['intersection'](_0x183d24['model'],_0x183d24[_0x4330('0x4c')]);_0x1d9486[_0x4330('0x4e')]=_['intersection'](_0x183d24[_0x4330('0x48')],qs[_0x4330('0x4d')](_0x110c3d[_0x4330('0x4c')][_0x4330('0x4d')]));_0x1d9486[_0x4330('0x4e')]=_0x1d9486['attributes'][_0x4330('0x4f')]?_0x1d9486['attributes']:_0x183d24['model'];_0x1d9486[_0x4330('0x69')]=qs[_0x4330('0x52')](_0x110c3d['query'][_0x4330('0x52')]);_0x1d9486[_0x4330('0x54')]=qs['filters'](_['pick'](_0x110c3d[_0x4330('0x4c')],_0x183d24[_0x4330('0x4a')]));if(_0x110c3d[_0x4330('0x4c')][_0x4330('0x53')]){_0x1d9486['where']=_[_0x4330('0x55')](_0x1d9486['where'],{'$or':_[_0x4330('0x44')](_0x1d9486[_0x4330('0x4e')],function(_0x394023){var _0x67174f={};_0x67174f[_0x394023]={'$like':'%'+_0x110c3d[_0x4330('0x4c')][_0x4330('0x53')]+'%'};return _0x67174f;})});}_0x1d9486=_[_0x4330('0x55')]({},_0x1d9486,_0x110c3d[_0x4330('0x5c')]);return _0x52f390['getAgents'](_0x1d9486);}})['then'](function(_0x3204e9){if(_0x3204e9){_0x5d9246=_0x3204e9[_0x4330('0x4f')];if(!_0x110c3d[_0x4330('0x4c')][_0x4330('0x50')](_0x4330('0x51'))){_0x1d9486[_0x4330('0x1f')]=qs[_0x4330('0x1f')](_0x110c3d[_0x4330('0x4c')]['limit']);_0x1d9486['offset']=qs[_0x4330('0x1d')](_0x110c3d[_0x4330('0x4c')]['offset']);}return _0x52f390[_0x4330('0xb9')](_0x1d9486);}})[_0x4330('0xf')](function(_0x210073){if(_0x210073){return _0x210073?{'count':_0x5d9246,'rows':_0x210073}:null;}})['then'](respondWithResult(_0x331128,null))['catch'](handleError(_0x331128,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index e0043b0..317a9c4 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 _0xcac3=['hasOwnProperty','hook','exports','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit'];(function(_0x4196bd,_0xdc31ac){var _0x170b43=function(_0x200ef0){while(--_0x200ef0){_0x4196bd['push'](_0x4196bd['shift']());}};_0x170b43(++_0xdc31ac);}(_0xcac3,0x193));var _0x3cac=function(_0x27a1a0,_0x32380c){_0x27a1a0=_0x27a1a0-0x0;var _0x38cf5c=_0xcac3[_0x27a1a0];return _0x38cf5c;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x3cac('0x0'))['db'][_0x3cac('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3cac('0x2')](0x0);var events={'afterCreate':_0x3cac('0x3'),'afterUpdate':_0x3cac('0x4'),'afterDestroy':_0x3cac('0x5')};function emitEvent(_0x40033c){return function(_0xce6bcd,_0x2d7790,_0x346c24){MailAccountEvents[_0x3cac('0x6')](_0x40033c+':'+_0xce6bcd['id'],_0xce6bcd);MailAccountEvents[_0x3cac('0x6')](_0x40033c,_0xce6bcd);_0x346c24(null);};}for(var e in events){if(events[_0x3cac('0x7')](e)){var event=events[e];MailAccount[_0x3cac('0x8')](e,emitEvent(event));}}module[_0x3cac('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x29b1=['exports','../../mysqldb','update','remove','emit','hook'];(function(_0x528123,_0xdee01a){var _0x37e7b5=function(_0x2ba9e6){while(--_0x2ba9e6){_0x528123['push'](_0x528123['shift']());}};_0x37e7b5(++_0xdee01a);}(_0x29b1,0xbb));var _0x129b=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x29b1[_0x1beef3];return _0x5af964;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x129b('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x129b('0x1'),'afterDestroy':_0x129b('0x2')};function emitEvent(_0x340c01){return function(_0x54a38b,_0x1e6cd4,_0xb4ee0e){MailAccountEvents[_0x129b('0x3')](_0x340c01+':'+_0x54a38b['id'],_0x54a38b);MailAccountEvents[_0x129b('0x3')](_0x340c01,_0x54a38b);_0xb4ee0e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x129b('0x4')](e,emitEvent(event));}}module[_0x129b('0x5')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index c0e8b5e..33d6f7a 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 _0x2624=['host','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','pass','exports','define','MailAccount','mail_accounts','provider','custom','service','Smtp'];(function(_0x5904fb,_0x16fccf){var _0x57b287=function(_0x2f88e1){while(--_0x2f88e1){_0x5904fb['push'](_0x5904fb['shift']());}};_0x57b287(++_0x16fccf);}(_0x2624,0x90));var _0x4262=function(_0x30a84e,_0x36d779){_0x30a84e=_0x30a84e-0x0;var _0xe600fa=_0x2624[_0x30a84e];return _0xe600fa;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x4262('0x0')]=function(_0xfd2105){return _0xfd2105[_0x4262('0x1')](_0x4262('0x2'),attributes,{'tableName':_0x4262('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x148d32=this;var _0x2e3d89={'id':_0x148d32['id'],'tls':{'rejectUnauthorized':![]}};if(_0x148d32[_0x4262('0x4')]!==_0x4262('0x5')){_0x2e3d89[_0x4262('0x6')]=_0x148d32[_0x4262('0x4')];}else{_0x2e3d89['host']=_0x148d32[_0x4262('0x7')][_0x4262('0x8')];_0x2e3d89[_0x4262('0x9')]=_0x148d32['Smtp'][_0x4262('0x9')];_0x2e3d89[_0x4262('0xa')]=_0x148d32[_0x4262('0x7')][_0x4262('0xa')];}if(_0x148d32[_0x4262('0x7')][_0x4262('0xb')]){if(_0x148d32[_0x4262('0x7')][_0x4262('0xc')]){if(!_0x148d32[_0x4262('0x7')][_0x4262('0xd')])throw new Error(_0x4262('0xe'));_0x2e3d89[_0x4262('0xf')]={'type':_0x4262('0x10'),'user':_0x148d32['Smtp'][_0x4262('0x11')],'accessToken':_0x148d32[_0x4262('0x7')][_0x4262('0xd')]['data5']};}else{_0x2e3d89['auth']={'user':_0x148d32[_0x4262('0x7')][_0x4262('0x11')],'pass':_0x148d32['Smtp'][_0x4262('0x12')]};}}return _0x2e3d89;}}});}; \ No newline at end of file +var _0x9bcf=['provider','custom','service','Smtp','host','port','secure','authentication','modernAuthentication','CloudProvider','auth','OAuth2','user','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts'];(function(_0x422b4a,_0x4d2074){var _0x48363f=function(_0x357769){while(--_0x357769){_0x422b4a['push'](_0x422b4a['shift']());}};_0x48363f(++_0x4d2074);}(_0x9bcf,0x1e9));var _0xf9bc=function(_0xcf687c,_0x6509fe){_0xcf687c=_0xcf687c-0x0;var _0x2ff525=_0x9bcf[_0xcf687c];return _0x2ff525;};'use strict';var attributes=require(_0xf9bc('0x0'));module[_0xf9bc('0x1')]=function(_0x35a27a){return _0x35a27a[_0xf9bc('0x2')](_0xf9bc('0x3'),attributes,{'tableName':_0xf9bc('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x32b545=this;var _0x5d8a65={'id':_0x32b545['id'],'tls':{'rejectUnauthorized':![]}};if(_0x32b545[_0xf9bc('0x5')]!==_0xf9bc('0x6')){_0x5d8a65[_0xf9bc('0x7')]=_0x32b545[_0xf9bc('0x5')];}else{_0x5d8a65['host']=_0x32b545[_0xf9bc('0x8')][_0xf9bc('0x9')];_0x5d8a65[_0xf9bc('0xa')]=_0x32b545['Smtp'][_0xf9bc('0xa')];_0x5d8a65[_0xf9bc('0xb')]=_0x32b545[_0xf9bc('0x8')]['secure'];}if(_0x32b545[_0xf9bc('0x8')][_0xf9bc('0xc')]){if(_0x32b545[_0xf9bc('0x8')][_0xf9bc('0xd')]){if(!_0x32b545[_0xf9bc('0x8')][_0xf9bc('0xe')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x5d8a65[_0xf9bc('0xf')]={'type':_0xf9bc('0x10'),'user':_0x32b545[_0xf9bc('0x8')][_0xf9bc('0x11')],'accessToken':_0x32b545[_0xf9bc('0x8')]['CloudProvider']['data5']};}else{_0x5d8a65[_0xf9bc('0xf')]={'user':_0x32b545[_0xf9bc('0x8')]['user'],'pass':_0x32b545[_0xf9bc('0x8')][_0xf9bc('0x12')]};}}return _0x5d8a65;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 52ffdb4..ff4176f 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 _0xa630=['MailAccount','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','MailApplication','Applications','Smtp','CloudProvider','get','omit','list','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','defaults','create','contact','messageId','generate','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','originTo','originCc','bcc','ChatWebsiteId','ChatOfflineMessageId','Attachment','Attachments','User','name','UserId','unshift','waitForTheAssignedAgent','queueId','MailQueue','queue','waitForTheAssignedQueue','startRouting','lodash','moment','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','findAll','options','raw','attributes','limit','include','map','model','debug','ShowMailAccount'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xa630,0xbe));var _0x0a63=function(_0x1f4adc,_0xba4637){_0x1f4adc=_0x1f4adc-0x0;var _0x468373=_0xa630[_0x1f4adc];return _0x468373;};'use strict';var _=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var Redis=require(_0x0a63('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x0a63('0x3'))('rpc');var config=require(_0x0a63('0x4'));var jayson=require(_0x0a63('0x5'));var client=jayson[_0x0a63('0x6')][_0x0a63('0x7')]({'port':0x232c});config[_0x0a63('0x8')]=_['defaults'](config[_0x0a63('0x8')],{'host':_0x0a63('0x9'),'port':0x18eb});var socket=require(_0x0a63('0xa'))(new Redis(config[_0x0a63('0x8')]));require(_0x0a63('0xb'))[_0x0a63('0xc')](socket);function respondWithRpcPromise(_0x501a82,_0x688acd,_0xb714c7){return new BPromise(function(_0x2dcbda,_0x218142){return client[_0x0a63('0xd')](_0x501a82,_0xb714c7)[_0x0a63('0xe')](function(_0x207434){logger[_0x0a63('0xf')](_0x0a63('0x10'),_0x688acd,_0x0a63('0x11'));logger['debug'](_0x0a63('0x12'),_0x688acd,_0x0a63('0x11'),JSON[_0x0a63('0x13')](_0x207434));if(_0x207434[_0x0a63('0x14')]){if(_0x207434['error'][_0x0a63('0x15')]===0x1f4){logger['error'](_0x0a63('0x10'),_0x688acd,_0x207434[_0x0a63('0x14')][_0x0a63('0x16')]);return _0x218142(_0x207434[_0x0a63('0x14')][_0x0a63('0x16')]);}logger[_0x0a63('0x14')](_0x0a63('0x10'),_0x688acd,_0x207434[_0x0a63('0x14')]['message']);return _0x2dcbda(_0x207434[_0x0a63('0x14')]['message']);}else{logger[_0x0a63('0xf')](_0x0a63('0x10'),_0x688acd,_0x0a63('0x11'));_0x2dcbda(_0x207434[_0x0a63('0x17')][_0x0a63('0x16')]);}})[_0x0a63('0x18')](function(_0x30f292){logger[_0x0a63('0x14')](_0x0a63('0x10'),_0x688acd,_0x30f292);_0x218142(_0x30f292);});});}exports[_0x0a63('0x19')]=function(_0x2ad167){var _0x4ea56f=this;return new Promise(function(_0x550568,_0x7b2ccd){return db['MailAccount'][_0x0a63('0x1a')]({'raw':_0x2ad167['options']?_0x2ad167[_0x0a63('0x1b')][_0x0a63('0x1c')]===undefined?!![]:![]:!![],'where':_0x2ad167[_0x0a63('0x1b')]?_0x2ad167[_0x0a63('0x1b')]['where']||null:null,'attributes':_0x2ad167[_0x0a63('0x1b')]?_0x2ad167['options'][_0x0a63('0x1d')]||null:null,'limit':_0x2ad167[_0x0a63('0x1b')]?_0x2ad167[_0x0a63('0x1b')][_0x0a63('0x1e')]||null:null,'include':_0x2ad167[_0x0a63('0x1b')]?_0x2ad167[_0x0a63('0x1b')][_0x0a63('0x1f')]?_[_0x0a63('0x20')](_0x2ad167['options']['include'],function(_0x55fb70){return{'model':db[_0x55fb70['model']],'as':_0x55fb70['as'],'attributes':_0x55fb70[_0x0a63('0x1d')],'include':_0x55fb70['include']?_['map'](_0x55fb70[_0x0a63('0x1f')],function(_0x1d5448){return{'model':db[_0x1d5448[_0x0a63('0x21')]],'as':_0x1d5448['as'],'attributes':_0x1d5448[_0x0a63('0x1d')],'include':_0x1d5448['include']?_[_0x0a63('0x20')](_0x1d5448[_0x0a63('0x1f')],function(_0x25ab82){return{'model':db[_0x25ab82['model']],'as':_0x25ab82['as'],'attributes':_0x25ab82[_0x0a63('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0a63('0xe')](function(_0x1b7bdb){logger[_0x0a63('0xf')](_0x0a63('0x19'),_0x2ad167);logger[_0x0a63('0x22')](_0x0a63('0x19'),_0x2ad167,JSON[_0x0a63('0x13')](_0x1b7bdb));_0x550568(_0x1b7bdb);})['catch'](function(_0x58cc71){logger['error'](_0x0a63('0x19'),_0x58cc71[_0x0a63('0x16')],_0x2ad167);_0x7b2ccd(_0x4ea56f[_0x0a63('0x14')](0x1f4,_0x58cc71[_0x0a63('0x16')]));});});};exports[_0x0a63('0x23')]=function(_0x53a46b){var _0x22a70a=this;return new Promise(function(_0x2884f1,_0x33a717){return db[_0x0a63('0x24')]['find']({'raw':_0x53a46b[_0x0a63('0x1b')]?_0x53a46b[_0x0a63('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x53a46b['options']?_0x53a46b[_0x0a63('0x1b')]['where']||null:null,'attributes':_0x53a46b['options']?_0x53a46b[_0x0a63('0x1b')][_0x0a63('0x1d')]||null:null,'include':_0x53a46b['options']?_0x53a46b[_0x0a63('0x1b')][_0x0a63('0x1f')]?_[_0x0a63('0x20')](_0x53a46b[_0x0a63('0x1b')][_0x0a63('0x1f')],function(_0x4dcacb){return{'model':db[_0x4dcacb['model']],'as':_0x4dcacb['as'],'attributes':_0x4dcacb[_0x0a63('0x1d')],'include':_0x4dcacb[_0x0a63('0x1f')]?_[_0x0a63('0x20')](_0x4dcacb[_0x0a63('0x1f')],function(_0x1c43fc){return{'model':db[_0x1c43fc[_0x0a63('0x21')]],'as':_0x1c43fc['as'],'attributes':_0x1c43fc['attributes'],'include':_0x1c43fc[_0x0a63('0x1f')]?_[_0x0a63('0x20')](_0x1c43fc['include'],function(_0xf9c6ea){return{'model':db[_0xf9c6ea['model']],'as':_0xf9c6ea['as'],'attributes':_0xf9c6ea['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a63('0xe')](function(_0x232388){if(_0x53a46b[_0x0a63('0x1b')]['smtp']===!![])_0x232388[_0x0a63('0x25')](_0x0a63('0x26'),_0x232388[_0x0a63('0x27')]());logger[_0x0a63('0xf')](_0x0a63('0x23'),_0x53a46b);logger[_0x0a63('0x22')](_0x0a63('0x23'),_0x53a46b,JSON['stringify'](_0x232388));_0x2884f1(_0x232388);})[_0x0a63('0x18')](function(_0x1c7e67){logger[_0x0a63('0x14')]('ShowMailAccount',_0x1c7e67['message'],_0x53a46b);_0x33a717(_0x22a70a[_0x0a63('0x14')](0x1f4,_0x1c7e67['message']));});});};exports[_0x0a63('0x28')]=function(_0x1e1aec){var _0x128e9e=this;return new Promise(function(_0x5c7b78,_0x2af987){var _0x14c737={'body':_0x1e1aec[_0x0a63('0x29')],'channel':_0x0a63('0x2a')};var _0x5d94e2=_[_0x0a63('0x2b')](_[_0x0a63('0x2c')](db[_0x0a63('0x2d')][_0x0a63('0x2e')]),[_0x0a63('0x2f'),_0x0a63('0x30'),'CompanyId',_0x0a63('0x31')]);var _0x218729=![];if(_0x1e1aec[_0x0a63('0x29')]['id']){delete _0x1e1aec[_0x0a63('0x29')]['id'];}if(_[_0x0a63('0x32')](_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x33')])){return _0x2af987(_0x128e9e[_0x0a63('0x14')](0x1f4,_0x0a63('0x34')));}if(_[_0x0a63('0x32')](_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x29')])||_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x29')]===''){return _0x2af987(_0x128e9e[_0x0a63('0x14')](0x1f4,_0x0a63('0x35')));}if(_[_0x0a63('0x32')](_0x1e1aec[_0x0a63('0x29')]['mapKey'])){return _0x2af987(_0x128e9e[_0x0a63('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5d94e2));}if(!_['includes'](_0x5d94e2,_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x36')])){return _0x2af987(_0x128e9e[_0x0a63('0x14')](0x1f4,_0x0a63('0x37')+_0x5d94e2));}var _0xd9149d={};_0xd9149d[_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x36')]]=_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x33')];return db[_0x0a63('0x24')][_0x0a63('0x38')]({'where':{'id':_0x1e1aec[_0x0a63('0x39')]['id']},'include':[{'model':db[_0x0a63('0x3a')],'as':_0x0a63('0x3b'),'include':[{'model':db[_0x0a63('0x2d')],'as':_0x0a63('0x3c'),'where':_0xd9149d,'limit':0x1,'order':[[_0x0a63('0x30'),_0x0a63('0x3d')]]}]},{'model':db[_0x0a63('0x3e')],'as':_0x0a63('0x3f')},{'model':db['MailServerOut'],'as':_0x0a63('0x40'),'include':[{'model':db[_0x0a63('0x41')],'as':'CloudProvider'}]}]})['then'](function(_0x58e686){if(_0x58e686&&_0x58e686['List']){var _0x36d066=_0x58e686[_0x0a63('0x42')]({'plain':!![]});_0x14c737['account']=_[_0x0a63('0x43')](_0x36d066,['Applications',_0x0a63('0x3b')]);_0x14c737[_0x0a63('0x39')]['smtpOptions']=_0x58e686['getSmtpOptions']();_0x14c737['applications']=_0x36d066[_0x0a63('0x3f')];_0x14c737[_0x0a63('0x44')]=_0x36d066[_0x0a63('0x3b')];_0x14c737[_0x0a63('0x45')]=_[_0x0a63('0x46')](_0x14c737['applications'],[_0x0a63('0x47')],[_0x0a63('0x48')]);if(_0x14c737[_0x0a63('0x39')]&&_0x14c737[_0x0a63('0x39')][_0x0a63('0x49')]){_0x14c737['applications'][_0x0a63('0x4a')]({'id':0x0,'priority':_0x14c737[_0x0a63('0x45')][_0x0a63('0x4b')]+0x1,'app':_0x0a63('0x4c'),'appdata':'autoclose','interval':_0x0a63('0x4d')});}if(_0x14c737[_0x0a63('0x39')][_0x0a63('0x3f')]){delete _0x14c737[_0x0a63('0x39')][_0x0a63('0x3f')];}if(_0x14c737[_0x0a63('0x39')]['List']){delete _0x14c737[_0x0a63('0x39')][_0x0a63('0x3b')];}if(_0x36d066[_0x0a63('0x3b')][_0x0a63('0x3c')]['length']){return _0x36d066['List'][_0x0a63('0x3c')][0x0];}var _0x1f2a59=_[_0x0a63('0x4e')](_0x1e1aec[_0x0a63('0x29')],{'firstName':_0x1e1aec[_0x0a63('0x29')]['from'],'ListId':_0x36d066['ListId']});_0x1f2a59[_0x1e1aec['body'][_0x0a63('0x36')]]=_0x1e1aec['body'][_0x0a63('0x33')];return db[_0x0a63('0x2d')][_0x0a63('0x4f')](_0x1f2a59);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x2d63c6){_0x14c737[_0x0a63('0x50')]=_0x2d63c6;if(_0x2d63c6){if(!_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x51')]){_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x51')]=rs[_0x0a63('0x52')]()+'\x20'+_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x33')];}var _0x5779c3={'ContactId':_0x2d63c6['id'],'MailAccountId':_0x1e1aec[_0x0a63('0x39')]['id'],'inReplyTo':_0x1e1aec['body']['message'][_0x0a63('0x51')],'to':_0x1e1aec[_0x0a63('0x29')]['message'][_0x0a63('0x33')],'cc':_0x1e1aec[_0x0a63('0x29')]['message']['cc'],'subject':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')]['subject'],'attach':_0x1e1aec['body'][_0x0a63('0x16')][_0x0a63('0x53')],'lastMsgAt':moment()[_0x0a63('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x0a63('0x55')][_0x0a63('0x38')]({'where':{'closed':![],'MailAccountId':_0x1e1aec[_0x0a63('0x39')]['id']},'include':[{'model':db[_0x0a63('0x56')],'as':_0x0a63('0x57'),'attributes':['messageId'],'where':{'messageId':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x58')]}}]})[_0x0a63('0xe')](function(_0x295c06){if(_0x295c06){return[_0x295c06,![]];}return db[_0x0a63('0x55')][_0x0a63('0x4f')](_0x5779c3)['then'](function(_0x4571e7){return[_0x4571e7,!![]];});});}else{throw new Error(_0x0a63('0x59'));}})[_0x0a63('0x5a')](function(_0x1155f1,_0xd52d09){if(_0x1155f1){_0x218729=_0xd52d09;if(!_0xd52d09){return _0x1155f1[_0x0a63('0x5b')]({'inReplyTo':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')]['messageId'],'to':_0x1e1aec['body'][_0x0a63('0x16')][_0x0a63('0x33')],'cc':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')]['cc'],'subject':_0x1e1aec[_0x0a63('0x29')]['message'][_0x0a63('0x5c')],'attach':_0x1155f1[_0x0a63('0x53')]?_0x1155f1[_0x0a63('0x53')]:_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x53')],'substatus':null,'substatusAt':moment()[_0x0a63('0x54')](_0x0a63('0x5d')),'lastMsgAt':moment()[_0x0a63('0x54')](_0x0a63('0x5d')),'lastMsgDirection':'in'});}else{return _0x1155f1;}}})[_0x0a63('0xe')](function(_0x485969){_0x14c737[_0x0a63('0x5e')]=_0x485969['get']({'plain':!![]});_0x14c737[_0x0a63('0x5e')][_0x0a63('0x5f')]=_0x218729;return db['MailMessage']['create']({'body':_0x1e1aec['body'][_0x0a63('0x29')],'MailAccountId':_0x1e1aec[_0x0a63('0x39')]['id'],'MailInteractionId':_0x485969['id'],'direction':'in','ContactId':_0x14c737[_0x0a63('0x50')]['id'],'messageId':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x51')],'from':_0x1e1aec['body']['message']['from'],'to':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')]['to'],'cc':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')]['cc'],'subject':_0x1e1aec['body'][_0x0a63('0x16')]['subject'],'attach':_0x1e1aec['body'][_0x0a63('0x16')]['attach'],'Attachments':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')]['attachments'],'originTo':_0x1e1aec[_0x0a63('0x29')]['message'][_0x0a63('0x60')],'originCc':_0x1e1aec['body'][_0x0a63('0x16')][_0x0a63('0x61')],'bcc':_0x1e1aec[_0x0a63('0x29')]['message'][_0x0a63('0x62')],'ChatWebsiteId':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x63')]||null,'originChannel':_0x1e1aec[_0x0a63('0x29')]['message']['originChannel']||'Email','ChatOfflineMessageId':_0x1e1aec[_0x0a63('0x29')]['message'][_0x0a63('0x64')]||null},{'include':[{'model':db[_0x0a63('0x65')],'as':_0x0a63('0x66')}]});})[_0x0a63('0xe')](function(_0x5540c6){_0x14c737[_0x0a63('0x16')]=_0x5540c6;if(!_0x14c737[_0x0a63('0x5e')]['UserId']){return;}return db[_0x0a63('0x67')][_0x0a63('0x38')]({'attributes':['id',_0x0a63('0x68')],'where':{'id':_0x14c737[_0x0a63('0x5e')][_0x0a63('0x69')]}});})['then'](function(_0x206221){if(_0x206221){_0x14c737[_0x0a63('0x45')][_0x0a63('0x6a')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x206221['name']+','+(_0x14c737['account'][_0x0a63('0x6b')]||0xa),'interval':_0x0a63('0x4d')});}if(!_0x14c737[_0x0a63('0x5e')][_0x0a63('0x6c')]){return;}return db[_0x0a63('0x6d')][_0x0a63('0x38')]({'attributes':['id',_0x0a63('0x68')],'where':{'id':_0x14c737[_0x0a63('0x5e')][_0x0a63('0x6c')]}});})[_0x0a63('0xe')](function(_0x5c6e18){if(_0x5c6e18){_0x14c737[_0x0a63('0x45')][_0x0a63('0x6a')]({'id':0x0,'priority':0x1,'app':_0x0a63('0x6e'),'appdata':_0x5c6e18[_0x0a63('0x68')]+','+(_0x14c737[_0x0a63('0x39')][_0x0a63('0x6f')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x0a63('0x70'),_0x14c737);})[_0x0a63('0xe')](function(_0x425c8c){_0x5c7b78(_0x425c8c);})[_0x0a63('0x18')](function(_0x50f07e){_0x2af987(_0x128e9e[_0x0a63('0x14')](0x1f4,_0x50f07e['message']));});});}; \ No newline at end of file +var _0x4351=['ChatWebsiteId','originChannel','Attachment','User','name','UserId','unshift','agent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','MailAccount,\x20%s,\x20%s','debug','request\x20sent','code','error','message','info','result','catch','findAll','options','raw','attributes','limit','include','map','model','GetMailAccount','stringify','find','smtp','setDataValue','smtpOptions','getSmtpOptions','ShowMailAccount','mail','difference','CmContact','rawAttributes','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','account','List','Contacts','MailApplication','MailServerOut','CloudProvider','get','omit','Applications','applications','list','orderBy','priority','asc','push','length','close','autoclose','*,*,*,*','create','contact','messageId','generate','subject','attach','MailInteraction','MailMessage','inReplyTo','update','format','YYYY-MM-DD\x20HH:mm:ss','interaction','attachments','originTo','originCc','bcc'];(function(_0x5b8d49,_0x344ec8){var _0x18f6c7=function(_0x44fc0b){while(--_0x44fc0b){_0x5b8d49['push'](_0x5b8d49['shift']());}};_0x18f6c7(++_0x344ec8);}(_0x4351,0x1b5));var _0x1435=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x4351[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x1435('0x0'));var moment=require(_0x1435('0x1'));var BPromise=require(_0x1435('0x2'));var rs=require(_0x1435('0x3'));var Redis=require(_0x1435('0x4'));var db=require(_0x1435('0x5'))['db'];var logger=require(_0x1435('0x6'))(_0x1435('0x7'));var config=require(_0x1435('0x8'));var jayson=require(_0x1435('0x9'));var client=jayson[_0x1435('0xa')][_0x1435('0xb')]({'port':0x232c});config[_0x1435('0xc')]=_[_0x1435('0xd')](config[_0x1435('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1435('0xe'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x1435('0xf')](socket);function respondWithRpcPromise(_0x22a221,_0x14a9e1,_0x35a509){return new BPromise(function(_0xade491,_0x55cd88){return client[_0x1435('0x10')](_0x22a221,_0x35a509)[_0x1435('0x11')](function(_0x5a64a4){logger['info'](_0x1435('0x12'),_0x14a9e1,'request\x20sent');logger[_0x1435('0x13')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x14a9e1,_0x1435('0x14'),JSON['stringify'](_0x5a64a4));if(_0x5a64a4['error']){if(_0x5a64a4['error'][_0x1435('0x15')]===0x1f4){logger[_0x1435('0x16')](_0x1435('0x12'),_0x14a9e1,_0x5a64a4['error']['message']);return _0x55cd88(_0x5a64a4[_0x1435('0x16')]['message']);}logger[_0x1435('0x16')](_0x1435('0x12'),_0x14a9e1,_0x5a64a4[_0x1435('0x16')][_0x1435('0x17')]);return _0xade491(_0x5a64a4[_0x1435('0x16')][_0x1435('0x17')]);}else{logger[_0x1435('0x18')](_0x1435('0x12'),_0x14a9e1,_0x1435('0x14'));_0xade491(_0x5a64a4[_0x1435('0x19')][_0x1435('0x17')]);}})[_0x1435('0x1a')](function(_0x68f503){logger[_0x1435('0x16')](_0x1435('0x12'),_0x14a9e1,_0x68f503);_0x55cd88(_0x68f503);});});}exports['GetMailAccount']=function(_0x26da28){var _0x34f555=this;return new Promise(function(_0x4cf63f,_0x4694cb){return db['MailAccount'][_0x1435('0x1b')]({'raw':_0x26da28[_0x1435('0x1c')]?_0x26da28[_0x1435('0x1c')][_0x1435('0x1d')]===undefined?!![]:![]:!![],'where':_0x26da28[_0x1435('0x1c')]?_0x26da28[_0x1435('0x1c')]['where']||null:null,'attributes':_0x26da28[_0x1435('0x1c')]?_0x26da28[_0x1435('0x1c')][_0x1435('0x1e')]||null:null,'limit':_0x26da28[_0x1435('0x1c')]?_0x26da28[_0x1435('0x1c')][_0x1435('0x1f')]||null:null,'include':_0x26da28[_0x1435('0x1c')]?_0x26da28[_0x1435('0x1c')][_0x1435('0x20')]?_[_0x1435('0x21')](_0x26da28[_0x1435('0x1c')]['include'],function(_0x523792){return{'model':db[_0x523792[_0x1435('0x22')]],'as':_0x523792['as'],'attributes':_0x523792[_0x1435('0x1e')],'include':_0x523792[_0x1435('0x20')]?_['map'](_0x523792[_0x1435('0x20')],function(_0x25cf29){return{'model':db[_0x25cf29[_0x1435('0x22')]],'as':_0x25cf29['as'],'attributes':_0x25cf29[_0x1435('0x1e')],'include':_0x25cf29[_0x1435('0x20')]?_['map'](_0x25cf29[_0x1435('0x20')],function(_0x7a2f63){return{'model':db[_0x7a2f63[_0x1435('0x22')]],'as':_0x7a2f63['as'],'attributes':_0x7a2f63[_0x1435('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1435('0x11')](function(_0x108c25){logger[_0x1435('0x18')]('GetMailAccount',_0x26da28);logger[_0x1435('0x13')](_0x1435('0x23'),_0x26da28,JSON[_0x1435('0x24')](_0x108c25));_0x4cf63f(_0x108c25);})[_0x1435('0x1a')](function(_0x297edf){logger['error'](_0x1435('0x23'),_0x297edf[_0x1435('0x17')],_0x26da28);_0x4694cb(_0x34f555[_0x1435('0x16')](0x1f4,_0x297edf[_0x1435('0x17')]));});});};exports['ShowMailAccount']=function(_0x2afc79){var _0x1dc553=this;return new Promise(function(_0x49209a,_0x4503a1){return db['MailAccount'][_0x1435('0x25')]({'raw':_0x2afc79[_0x1435('0x1c')]?_0x2afc79['options'][_0x1435('0x1d')]===undefined?!![]:![]:!![],'where':_0x2afc79[_0x1435('0x1c')]?_0x2afc79['options']['where']||null:null,'attributes':_0x2afc79['options']?_0x2afc79[_0x1435('0x1c')]['attributes']||null:null,'include':_0x2afc79[_0x1435('0x1c')]?_0x2afc79['options'][_0x1435('0x20')]?_['map'](_0x2afc79[_0x1435('0x1c')][_0x1435('0x20')],function(_0x249edc){return{'model':db[_0x249edc[_0x1435('0x22')]],'as':_0x249edc['as'],'attributes':_0x249edc[_0x1435('0x1e')],'include':_0x249edc[_0x1435('0x20')]?_['map'](_0x249edc[_0x1435('0x20')],function(_0x138597){return{'model':db[_0x138597[_0x1435('0x22')]],'as':_0x138597['as'],'attributes':_0x138597[_0x1435('0x1e')],'include':_0x138597[_0x1435('0x20')]?_['map'](_0x138597[_0x1435('0x20')],function(_0x578845){return{'model':db[_0x578845[_0x1435('0x22')]],'as':_0x578845['as'],'attributes':_0x578845[_0x1435('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11cf64){if(_0x2afc79[_0x1435('0x1c')][_0x1435('0x26')]===!![])_0x11cf64[_0x1435('0x27')](_0x1435('0x28'),_0x11cf64[_0x1435('0x29')]());logger[_0x1435('0x18')](_0x1435('0x2a'),_0x2afc79);logger[_0x1435('0x13')](_0x1435('0x2a'),_0x2afc79,JSON[_0x1435('0x24')](_0x11cf64));_0x49209a(_0x11cf64);})[_0x1435('0x1a')](function(_0x552a61){logger[_0x1435('0x16')]('ShowMailAccount',_0x552a61[_0x1435('0x17')],_0x2afc79);_0x4503a1(_0x1dc553['error'](0x1f4,_0x552a61[_0x1435('0x17')]));});});};exports['NotifyMailAccount']=function(_0x473d6){var _0x516e44=this;return new Promise(function(_0x36bc74,_0x186e7a){var _0x398d3c={'body':_0x473d6['body'],'channel':_0x1435('0x2b')};var _0x1fe164=_[_0x1435('0x2c')](_['keys'](db[_0x1435('0x2d')][_0x1435('0x2e')]),['createdAt','updatedAt',_0x1435('0x2f'),_0x1435('0x30')]);var _0x2dd1f5=![];if(_0x473d6['body']['id']){delete _0x473d6['body']['id'];}if(_[_0x1435('0x31')](_0x473d6['body'][_0x1435('0x32')])){return _0x186e7a(_0x516e44['error'](0x1f4,_0x1435('0x33')));}if(_['isNil'](_0x473d6[_0x1435('0x34')]['body'])||_0x473d6[_0x1435('0x34')]['body']===''){return _0x186e7a(_0x516e44[_0x1435('0x16')](0x1f4,_0x1435('0x35')));}if(_['isNil'](_0x473d6[_0x1435('0x34')]['mapKey'])){return _0x186e7a(_0x516e44[_0x1435('0x16')](0x1f4,_0x1435('0x36')+_0x1fe164));}if(!_[_0x1435('0x37')](_0x1fe164,_0x473d6['body'][_0x1435('0x38')])){return _0x186e7a(_0x516e44[_0x1435('0x16')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1fe164));}var _0x1f73f4={};_0x1f73f4[_0x473d6[_0x1435('0x34')]['mapKey']]=_0x473d6[_0x1435('0x34')][_0x1435('0x32')];return db['MailAccount'][_0x1435('0x25')]({'where':{'id':_0x473d6[_0x1435('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0x1435('0x3a'),'include':[{'model':db[_0x1435('0x2d')],'as':_0x1435('0x3b'),'where':_0x1f73f4,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x1435('0x3c')],'as':'Applications'},{'model':db[_0x1435('0x3d')],'as':'Smtp','include':[{'model':db[_0x1435('0x3e')],'as':_0x1435('0x3e')}]}]})[_0x1435('0x11')](function(_0x148862){if(_0x148862&&_0x148862[_0x1435('0x3a')]){var _0x3d2346=_0x148862[_0x1435('0x3f')]({'plain':!![]});_0x398d3c['account']=_[_0x1435('0x40')](_0x3d2346,[_0x1435('0x41'),_0x1435('0x3a')]);_0x398d3c['account'][_0x1435('0x28')]=_0x148862[_0x1435('0x29')]();_0x398d3c[_0x1435('0x42')]=_0x3d2346[_0x1435('0x41')];_0x398d3c[_0x1435('0x43')]=_0x3d2346[_0x1435('0x3a')];_0x398d3c[_0x1435('0x42')]=_[_0x1435('0x44')](_0x398d3c['applications'],[_0x1435('0x45')],[_0x1435('0x46')]);if(_0x398d3c[_0x1435('0x39')]&&_0x398d3c[_0x1435('0x39')]['autoclose']){_0x398d3c['applications'][_0x1435('0x47')]({'id':0x0,'priority':_0x398d3c[_0x1435('0x42')][_0x1435('0x48')]+0x1,'app':_0x1435('0x49'),'appdata':_0x1435('0x4a'),'interval':_0x1435('0x4b')});}if(_0x398d3c[_0x1435('0x39')][_0x1435('0x41')]){delete _0x398d3c[_0x1435('0x39')]['Applications'];}if(_0x398d3c['account'][_0x1435('0x3a')]){delete _0x398d3c['account'][_0x1435('0x3a')];}if(_0x3d2346[_0x1435('0x3a')][_0x1435('0x3b')][_0x1435('0x48')]){return _0x3d2346[_0x1435('0x3a')][_0x1435('0x3b')][0x0];}var _0xd776e6=_['defaults'](_0x473d6[_0x1435('0x34')],{'firstName':_0x473d6['body'][_0x1435('0x32')],'ListId':_0x3d2346[_0x1435('0x30')]});_0xd776e6[_0x473d6['body'][_0x1435('0x38')]]=_0x473d6[_0x1435('0x34')][_0x1435('0x32')];return db[_0x1435('0x2d')][_0x1435('0x4c')](_0xd776e6);}else{throw new Error('List\x20not\x20found');}})[_0x1435('0x11')](function(_0x3da03e){_0x398d3c[_0x1435('0x4d')]=_0x3da03e;if(_0x3da03e){if(!_0x473d6[_0x1435('0x34')][_0x1435('0x17')][_0x1435('0x4e')]){_0x473d6['body']['message'][_0x1435('0x4e')]=rs[_0x1435('0x4f')]()+'\x20'+_0x473d6[_0x1435('0x34')][_0x1435('0x17')][_0x1435('0x32')];}var _0x12c603={'ContactId':_0x3da03e['id'],'MailAccountId':_0x473d6[_0x1435('0x39')]['id'],'inReplyTo':_0x473d6[_0x1435('0x34')]['message'][_0x1435('0x4e')],'to':_0x473d6['body'][_0x1435('0x17')][_0x1435('0x32')],'cc':_0x473d6['body'][_0x1435('0x17')]['cc'],'subject':_0x473d6[_0x1435('0x34')]['message'][_0x1435('0x50')],'attach':_0x473d6[_0x1435('0x34')]['message'][_0x1435('0x51')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x1435('0x52')][_0x1435('0x25')]({'where':{'closed':![],'MailAccountId':_0x473d6[_0x1435('0x39')]['id']},'include':[{'model':db[_0x1435('0x53')],'as':'Messages','attributes':[_0x1435('0x4e')],'where':{'messageId':_0x473d6[_0x1435('0x34')]['message'][_0x1435('0x54')]}}]})[_0x1435('0x11')](function(_0x5d4807){if(_0x5d4807){return[_0x5d4807,![]];}return db[_0x1435('0x52')][_0x1435('0x4c')](_0x12c603)[_0x1435('0x11')](function(_0x44b211){return[_0x44b211,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x3e40d,_0x21bc66){if(_0x3e40d){_0x2dd1f5=_0x21bc66;if(!_0x21bc66){return _0x3e40d[_0x1435('0x55')]({'inReplyTo':_0x473d6[_0x1435('0x34')]['message'][_0x1435('0x4e')],'to':_0x473d6[_0x1435('0x34')][_0x1435('0x17')][_0x1435('0x32')],'cc':_0x473d6['body'][_0x1435('0x17')]['cc'],'subject':_0x473d6[_0x1435('0x34')][_0x1435('0x17')]['subject'],'attach':_0x3e40d[_0x1435('0x51')]?_0x3e40d[_0x1435('0x51')]:_0x473d6[_0x1435('0x34')][_0x1435('0x17')][_0x1435('0x51')],'substatus':null,'substatusAt':moment()[_0x1435('0x56')](_0x1435('0x57')),'lastMsgAt':moment()[_0x1435('0x56')](_0x1435('0x57')),'lastMsgDirection':'in'});}else{return _0x3e40d;}}})['then'](function(_0x1347a6){_0x398d3c[_0x1435('0x58')]=_0x1347a6[_0x1435('0x3f')]({'plain':!![]});_0x398d3c[_0x1435('0x58')]['created']=_0x2dd1f5;return db['MailMessage'][_0x1435('0x4c')]({'body':_0x473d6['body']['body'],'MailAccountId':_0x473d6['account']['id'],'MailInteractionId':_0x1347a6['id'],'direction':'in','ContactId':_0x398d3c[_0x1435('0x4d')]['id'],'messageId':_0x473d6['body']['message'][_0x1435('0x4e')],'from':_0x473d6[_0x1435('0x34')][_0x1435('0x17')][_0x1435('0x32')],'to':_0x473d6[_0x1435('0x34')]['message']['to'],'cc':_0x473d6[_0x1435('0x34')][_0x1435('0x17')]['cc'],'subject':_0x473d6[_0x1435('0x34')][_0x1435('0x17')]['subject'],'attach':_0x473d6[_0x1435('0x34')]['message'][_0x1435('0x51')],'Attachments':_0x473d6[_0x1435('0x34')]['message'][_0x1435('0x59')],'originTo':_0x473d6[_0x1435('0x34')][_0x1435('0x17')][_0x1435('0x5a')],'originCc':_0x473d6[_0x1435('0x34')][_0x1435('0x17')][_0x1435('0x5b')],'bcc':_0x473d6[_0x1435('0x34')][_0x1435('0x17')][_0x1435('0x5c')],'ChatWebsiteId':_0x473d6[_0x1435('0x34')][_0x1435('0x17')][_0x1435('0x5d')]||null,'originChannel':_0x473d6[_0x1435('0x34')][_0x1435('0x17')][_0x1435('0x5e')]||'Email','ChatOfflineMessageId':_0x473d6[_0x1435('0x34')][_0x1435('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x1435('0x5f')],'as':'Attachments'}]});})['then'](function(_0x1d0b14){_0x398d3c[_0x1435('0x17')]=_0x1d0b14;if(!_0x398d3c['interaction']['UserId']){return;}return db[_0x1435('0x60')]['find']({'attributes':['id',_0x1435('0x61')],'where':{'id':_0x398d3c[_0x1435('0x58')][_0x1435('0x62')]}});})['then'](function(_0x332d5a){if(_0x332d5a){_0x398d3c[_0x1435('0x42')][_0x1435('0x63')]({'id':0x0,'priority':0x0,'app':_0x1435('0x64'),'appdata':_0x332d5a[_0x1435('0x61')]+','+(_0x398d3c[_0x1435('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0x1435('0x4b')});}if(!_0x398d3c[_0x1435('0x58')][_0x1435('0x65')]){return;}return db['MailQueue']['find']({'attributes':['id','name'],'where':{'id':_0x398d3c[_0x1435('0x58')][_0x1435('0x65')]}});})['then'](function(_0x15fd08){if(_0x15fd08){_0x398d3c[_0x1435('0x42')][_0x1435('0x63')]({'id':0x0,'priority':0x1,'app':_0x1435('0x66'),'appdata':_0x15fd08[_0x1435('0x61')]+','+(_0x398d3c[_0x1435('0x39')][_0x1435('0x67')]||0x12c),'interval':_0x1435('0x4b')});}return respondWithRpcPromise(_0x1435('0x68'),_0x1435('0x69'),_0x398d3c);})['then'](function(_0x2a3f87){_0x36bc74(_0x2a3f87);})[_0x1435('0x1a')](function(_0x1f1acc){_0x186e7a(_0x516e44['error'](0x1f4,_0x1f1acc[_0x1435('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 82df262..bd05393 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 _0xc113=['removeListener','register','length','./mailAccount.events','save','remove','update','emit'];(function(_0x6b861c,_0x13994d){var _0x52038c=function(_0x292e25){while(--_0x292e25){_0x6b861c['push'](_0x6b861c['shift']());}};_0x52038c(++_0x13994d);}(_0xc113,0x1ab));var _0x3c11=function(_0x2dec14,_0x3206aa){_0x2dec14=_0x2dec14-0x0;var _0x2ac484=_0xc113[_0x2dec14];return _0x2ac484;};'use strict';var MailAccountEvents=require(_0x3c11('0x0'));var events=[_0x3c11('0x1'),_0x3c11('0x2'),_0x3c11('0x3')];function createListener(_0x27a620,_0x237e11){return function(_0x12bb58){_0x237e11[_0x3c11('0x4')](_0x27a620,_0x12bb58);};}function removeListener(_0x2286e4,_0x531ac1){return function(){MailAccountEvents[_0x3c11('0x5')](_0x2286e4,_0x531ac1);};}exports[_0x3c11('0x6')]=function(_0x595e66){for(var _0x3dd753=0x0,_0x3b181f=events[_0x3c11('0x7')];_0x3dd753<_0x3b181f;_0x3dd753++){var _0x5d6f91=events[_0x3dd753];var _0x16959a=createListener('mailAccount:'+_0x5d6f91,_0x595e66);MailAccountEvents['on'](_0x5d6f91,_0x16959a);}}; \ No newline at end of file +var _0xcf8f=['mailAccount:','./mailAccount.events','save','remove','emit','register','length'];(function(_0x539fe7,_0x3f9aa7){var _0x49abf5=function(_0x51826d){while(--_0x51826d){_0x539fe7['push'](_0x539fe7['shift']());}};_0x49abf5(++_0x3f9aa7);}(_0xcf8f,0x78));var _0xfcf8=function(_0x32dbf2,_0x39eab0){_0x32dbf2=_0x32dbf2-0x0;var _0x63b9d=_0xcf8f[_0x32dbf2];return _0x63b9d;};'use strict';var MailAccountEvents=require(_0xfcf8('0x0'));var events=[_0xfcf8('0x1'),_0xfcf8('0x2'),'update'];function createListener(_0x169001,_0x215896){return function(_0x47d110){_0x215896[_0xfcf8('0x3')](_0x169001,_0x47d110);};}function removeListener(_0x13740e,_0x526135){return function(){MailAccountEvents['removeListener'](_0x13740e,_0x526135);};}exports[_0xfcf8('0x4')]=function(_0x11ed4d){for(var _0x4eb934=0x0,_0x572efd=events[_0xfcf8('0x5')];_0x4eb934<_0x572efd;_0x4eb934++){var _0x22627b=events[_0x4eb934];var _0x12e8e5=createListener(_0xfcf8('0x6')+_0x22627b,_0x11ed4d);MailAccountEvents['on'](_0x22627b,_0x12e8e5);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 8a1ea85..ea8fc6f 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 _0x6418=['delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get','/:id','show','put','isAuthenticated','update'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x6418,0x145));var _0x8641=function(_0x2bcd1b,_0x24d386){_0x2bcd1b=_0x2bcd1b-0x0;var _0x577799=_0x6418[_0x2bcd1b];return _0x577799;};'use strict';var multer=require(_0x8641('0x0'));var util=require(_0x8641('0x1'));var path=require(_0x8641('0x2'));var timeout=require(_0x8641('0x3'));var express=require('express');var router=express[_0x8641('0x4')]();var fs_extra=require(_0x8641('0x5'));var auth=require(_0x8641('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8641('0x7'));var controller=require(_0x8641('0x8'));router[_0x8641('0x9')](_0x8641('0xa'),auth['isAuthenticated'](),controller[_0x8641('0xb')]);router[_0x8641('0xc')](_0x8641('0xa'),auth[_0x8641('0xd')](),controller[_0x8641('0xe')]);router[_0x8641('0xf')](_0x8641('0xa'),auth[_0x8641('0xd')](),controller[_0x8641('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0590=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','show','put','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x26ec1c,_0x274d1b){var _0x3759c0=function(_0x27f626){while(--_0x27f626){_0x26ec1c['push'](_0x26ec1c['shift']());}};_0x3759c0(++_0x274d1b);}(_0x0590,0x11c));var _0x0059=function(_0x372bae,_0xd5357c){_0x372bae=_0x372bae-0x0;var _0xfce3f4=_0x0590[_0x372bae];return _0xfce3f4;};'use strict';var multer=require(_0x0059('0x0'));var util=require(_0x0059('0x1'));var path=require(_0x0059('0x2'));var timeout=require(_0x0059('0x3'));var express=require(_0x0059('0x4'));var router=express[_0x0059('0x5')]();var fs_extra=require(_0x0059('0x6'));var auth=require(_0x0059('0x7'));var interaction=require(_0x0059('0x8'));var config=require(_0x0059('0x9'));var controller=require(_0x0059('0xa'));router['get'](_0x0059('0xb'),auth['isAuthenticated'](),controller[_0x0059('0xc')]);router[_0x0059('0xd')](_0x0059('0xb'),auth[_0x0059('0xe')](),controller[_0x0059('0xf')]);router['delete'](_0x0059('0xb'),auth[_0x0059('0xe')](),controller[_0x0059('0x10')]);module[_0x0059('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 9332cfc..9cd8962 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 _0x871b=['exports','INTEGER','STRING','sequelize'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0x871b,0x133));var _0xb871=function(_0x387651,_0x627c82){_0x387651=_0x387651-0x0;var _0x358169=_0x871b[_0x387651];return _0x358169;};'use strict';var Sequelize=require(_0xb871('0x0'));module[_0xb871('0x1')]={'priority':{'type':Sequelize[_0xb871('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb871('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb871('0x3')]},'interval':{'type':Sequelize[_0xb871('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x7df8=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x35b4e4,_0x3101aa){var _0x520638=function(_0x2f167e){while(--_0x2f167e){_0x35b4e4['push'](_0x35b4e4['shift']());}};_0x520638(++_0x3101aa);}(_0x7df8,0xc1));var _0x87df=function(_0x1c6099,_0x199be7){_0x1c6099=_0x1c6099-0x0;var _0x56445e=_0x7df8[_0x1c6099];return _0x56445e;};'use strict';var Sequelize=require(_0x87df('0x0'));module['exports']={'priority':{'type':Sequelize[_0x87df('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x87df('0x2')],'allowNull':![],'defaultValue':_0x87df('0x3')},'appdata':{'type':Sequelize[_0x87df('0x4')]()},'description':{'type':Sequelize[_0x87df('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x87df('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index cdd8c2e..0b499d6 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 _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x21d516,_0x45b0cd){var _0x1235b3=function(_0x147f05){while(--_0x147f05){_0x21d516['push'](_0x21d516['shift']());}};_0x1235b3(++_0x45b0cd);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2c58ac,_0x449fde){_0x2c58ac=_0x2c58ac-0x0;var _0x5a575b=_0xb43b[_0x2c58ac];return _0x5a575b;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));}; \ No newline at end of file +var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x3cf5a3,_0x5a4492){_0x3cf5a3=_0x3cf5a3-0x0;var _0x39ba2d=_0xaa88[_0x3cf5a3];return _0x39ba2d;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 4fbc0f5..287f50f 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 _0x39e8=['mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x39e8,0x65));var _0x839e=function(_0x5afb9b,_0x4dc022){_0x5afb9b=_0x5afb9b-0x0;var _0xc15656=_0x39e8[_0x5afb9b];return _0xc15656;};'use strict';var _=require(_0x839e('0x0'));var util=require(_0x839e('0x1'));var logger=require(_0x839e('0x2'))(_0x839e('0x3'));var moment=require(_0x839e('0x4'));var BPromise=require('bluebird');var rp=require(_0x839e('0x5'));var fs=require('fs');var path=require(_0x839e('0x6'));var rimraf=require(_0x839e('0x7'));var config=require(_0x839e('0x8'));var attributes=require('./mailApplication.attributes');module[_0x839e('0x9')]=function(_0x3b3e50,_0x14483c){return _0x3b3e50[_0x839e('0xa')]('MailApplication',attributes,{'tableName':_0x839e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x839e('0xc'),'collate':_0x839e('0xd')});}; \ No newline at end of file +var _0x5332=['./mailApplication.attributes','exports','define','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2ff623,_0x8b6a6d){var _0x520067=function(_0x45695c){while(--_0x45695c){_0x2ff623['push'](_0x2ff623['shift']());}};_0x520067(++_0x8b6a6d);}(_0x5332,0x107));var _0x2533=function(_0x378e55,_0x31d17b){_0x378e55=_0x378e55-0x0;var _0x2e4533=_0x5332[_0x378e55];return _0x2e4533;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2533('0x0'))('api');var moment=require(_0x2533('0x1'));var BPromise=require(_0x2533('0x2'));var rp=require(_0x2533('0x3'));var fs=require('fs');var path=require(_0x2533('0x4'));var rimraf=require(_0x2533('0x5'));var config=require(_0x2533('0x6'));var attributes=require(_0x2533('0x7'));module[_0x2533('0x8')]=function(_0x220300,_0x313b5e){return _0x220300[_0x2533('0x9')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 082840c..1987924 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 _0xe74c=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','MailApplication','update','options','raw','where','attributes','limit','UpdateMailApplication','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x368dd2,_0x108647){var _0x5e9aa7=function(_0x32ccbb){while(--_0x32ccbb){_0x368dd2['push'](_0x368dd2['shift']());}};_0x5e9aa7(++_0x108647);}(_0xe74c,0xf9));var _0xce74=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xe74c[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0xce74('0x0'));var util=require(_0xce74('0x1'));var moment=require('moment');var BPromise=require(_0xce74('0x2'));var rs=require(_0xce74('0x3'));var fs=require('fs');var Redis=require(_0xce74('0x4'));var db=require(_0xce74('0x5'))['db'];var utils=require(_0xce74('0x6'));var logger=require(_0xce74('0x7'))(_0xce74('0x8'));var config=require('../../config/environment');var jayson=require(_0xce74('0x9'));var client=jayson[_0xce74('0xa')][_0xce74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5538db,_0x112609,_0x113b6d){return new BPromise(function(_0x4d87bb,_0x13de0e){return client[_0xce74('0xc')](_0x5538db,_0x113b6d)[_0xce74('0xd')](function(_0x304193){logger[_0xce74('0xe')](_0xce74('0xf'),_0x112609,'request\x20sent');logger[_0xce74('0x10')](_0xce74('0x11'),_0x112609,_0xce74('0x12'),JSON['stringify'](_0x304193));if(_0x304193[_0xce74('0x13')]){if(_0x304193[_0xce74('0x13')]['code']===0x1f4){logger[_0xce74('0x13')]('MailApplication,\x20%s,\x20%s',_0x112609,_0x304193[_0xce74('0x13')]['message']);return _0x13de0e(_0x304193[_0xce74('0x13')][_0xce74('0x14')]);}logger[_0xce74('0x13')](_0xce74('0xf'),_0x112609,_0x304193[_0xce74('0x13')][_0xce74('0x14')]);return _0x4d87bb(_0x304193[_0xce74('0x13')]['message']);}else{logger['info'](_0xce74('0xf'),_0x112609,_0xce74('0x12'));_0x4d87bb(_0x304193[_0xce74('0x15')][_0xce74('0x14')]);}})[_0xce74('0x16')](function(_0x59f02a){logger[_0xce74('0x13')](_0xce74('0xf'),_0x112609,_0x59f02a);_0x13de0e(_0x59f02a);});});}exports['UpdateMailApplication']=function(_0x18b3f6){var _0x91ec22=this;return new Promise(function(_0x2a1fdd,_0x4083c7){return db[_0xce74('0x17')][_0xce74('0x18')](_0x18b3f6['body'],{'raw':_0x18b3f6['options']?_0x18b3f6[_0xce74('0x19')][_0xce74('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18b3f6[_0xce74('0x19')]?_0x18b3f6[_0xce74('0x19')][_0xce74('0x1b')]||null:null,'attributes':_0x18b3f6['options']?_0x18b3f6[_0xce74('0x19')][_0xce74('0x1c')]||null:null,'limit':_0x18b3f6['options']?_0x18b3f6[_0xce74('0x19')][_0xce74('0x1d')]||null:null})['then'](function(_0x10c045){logger[_0xce74('0xe')](_0xce74('0x1e'),_0x18b3f6);logger[_0xce74('0x10')]('UpdateMailApplication',_0x18b3f6,JSON[_0xce74('0x1f')](_0x10c045));_0x2a1fdd(_0x10c045);})[_0xce74('0x16')](function(_0x15eae3){logger[_0xce74('0x13')]('UpdateMailApplication',_0x15eae3['message'],_0x18b3f6);_0x4083c7(_0x91ec22[_0xce74('0x13')](0x1f4,_0x15eae3[_0xce74('0x14')]));});});}; \ No newline at end of file +var _0xdf68=['error','code','message','result','catch','UpdateMailApplication','MailApplication','options','raw','where','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xdf68,0x1ce));var _0x8df6=function(_0x34bd34,_0x1444f7){_0x34bd34=_0x34bd34-0x0;var _0x4e36d6=_0xdf68[_0x34bd34];return _0x4e36d6;};'use strict';var _=require(_0x8df6('0x0'));var util=require(_0x8df6('0x1'));var moment=require(_0x8df6('0x2'));var BPromise=require(_0x8df6('0x3'));var rs=require(_0x8df6('0x4'));var fs=require('fs');var Redis=require(_0x8df6('0x5'));var db=require(_0x8df6('0x6'))['db'];var utils=require(_0x8df6('0x7'));var logger=require(_0x8df6('0x8'))('rpc');var config=require(_0x8df6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8df6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ef9ba,_0x213f9f,_0x40c3a7){return new BPromise(function(_0x371ab1,_0x15e780){return client[_0x8df6('0xb')](_0x5ef9ba,_0x40c3a7)[_0x8df6('0xc')](function(_0xacf60a){logger[_0x8df6('0xd')](_0x8df6('0xe'),_0x213f9f,'request\x20sent');logger[_0x8df6('0xf')](_0x8df6('0x10'),_0x213f9f,_0x8df6('0x11'),JSON['stringify'](_0xacf60a));if(_0xacf60a[_0x8df6('0x12')]){if(_0xacf60a[_0x8df6('0x12')][_0x8df6('0x13')]===0x1f4){logger[_0x8df6('0x12')]('MailApplication,\x20%s,\x20%s',_0x213f9f,_0xacf60a[_0x8df6('0x12')][_0x8df6('0x14')]);return _0x15e780(_0xacf60a[_0x8df6('0x12')][_0x8df6('0x14')]);}logger['error'](_0x8df6('0xe'),_0x213f9f,_0xacf60a[_0x8df6('0x12')][_0x8df6('0x14')]);return _0x371ab1(_0xacf60a[_0x8df6('0x12')][_0x8df6('0x14')]);}else{logger[_0x8df6('0xd')](_0x8df6('0xe'),_0x213f9f,'request\x20sent');_0x371ab1(_0xacf60a[_0x8df6('0x15')]['message']);}})[_0x8df6('0x16')](function(_0x14be54){logger[_0x8df6('0x12')](_0x8df6('0xe'),_0x213f9f,_0x14be54);_0x15e780(_0x14be54);});});}exports[_0x8df6('0x17')]=function(_0x4c556d){var _0x559fc0=this;return new Promise(function(_0x59ffc0,_0x5080b7){return db[_0x8df6('0x18')]['update'](_0x4c556d['body'],{'raw':_0x4c556d[_0x8df6('0x19')]?_0x4c556d[_0x8df6('0x19')][_0x8df6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c556d[_0x8df6('0x19')]?_0x4c556d[_0x8df6('0x19')][_0x8df6('0x1b')]||null:null,'attributes':_0x4c556d[_0x8df6('0x19')]?_0x4c556d['options']['attributes']||null:null,'limit':_0x4c556d[_0x8df6('0x19')]?_0x4c556d[_0x8df6('0x19')][_0x8df6('0x1c')]||null:null})[_0x8df6('0xc')](function(_0x5f50ee){logger[_0x8df6('0xd')](_0x8df6('0x17'),_0x4c556d);logger[_0x8df6('0xf')](_0x8df6('0x17'),_0x4c556d,JSON[_0x8df6('0x1d')](_0x5f50ee));_0x59ffc0(_0x5f50ee);})[_0x8df6('0x16')](function(_0x2ded37){logger[_0x8df6('0x12')](_0x8df6('0x17'),_0x2ded37['message'],_0x4c556d);_0x5080b7(_0x559fc0['error'](0x1f4,_0x2ded37['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index a5b27e2..15becfc 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 _0x4d36=['/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','mailinteraction:destroy','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x4551f6,_0x48151b){var _0x581dc2=function(_0x1842af){while(--_0x1842af){_0x4551f6['push'](_0x4551f6['shift']());}};_0x581dc2(++_0x48151b);}(_0x4d36,0xe4));var _0x64d3=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0x4d36[_0xd13a88];return _0x1c993c;};'use strict';var express=require(_0x64d3('0x0'));var router=express[_0x64d3('0x1')]();var auth=require(_0x64d3('0x2'));var interaction=require(_0x64d3('0x3'));var controller=require(_0x64d3('0x4'));router[_0x64d3('0x5')]('/',auth[_0x64d3('0x6')](),controller[_0x64d3('0x7')]);router[_0x64d3('0x5')](_0x64d3('0x8'),auth[_0x64d3('0x6')](),controller[_0x64d3('0x9')]);router[_0x64d3('0x5')](_0x64d3('0xa'),auth[_0x64d3('0x6')](),controller[_0x64d3('0xb')]);router[_0x64d3('0x5')](_0x64d3('0xc'),auth[_0x64d3('0x6')](),controller[_0x64d3('0xd')]);router['get'](_0x64d3('0xe'),auth[_0x64d3('0x6')](),controller[_0x64d3('0xf')]);router[_0x64d3('0x10')]('/',auth[_0x64d3('0x6')](),controller[_0x64d3('0x11')]);router[_0x64d3('0x10')](_0x64d3('0xc'),auth[_0x64d3('0x6')](),controller[_0x64d3('0x12')]);router['post'](_0x64d3('0x13'),auth[_0x64d3('0x6')](),interaction[_0x64d3('0x14')](_0x64d3('0x15'),_0x64d3('0x16')),controller[_0x64d3('0x17')]);router[_0x64d3('0x18')](_0x64d3('0xa'),auth[_0x64d3('0x6')](),interaction[_0x64d3('0x14')](_0x64d3('0x15'),_0x64d3('0x19')),controller[_0x64d3('0x1a')]);router['delete']('/:id',auth[_0x64d3('0x6')](),interaction[_0x64d3('0x14')](_0x64d3('0x15'),_0x64d3('0x1b')),controller[_0x64d3('0x1c')]);router['delete'](_0x64d3('0x13'),auth[_0x64d3('0x6')](),controller['removeTags']);module[_0x64d3('0x1d')]=router; \ No newline at end of file +var _0x7d3c=['show','getMessages','/:id/download','download','post','create','/:id/messages','/:id/tags','tracked','put','mail','mailinteraction:update','/:id','mailinteraction:destroy','destroy','delete','removeTags','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7d3c,0x1af));var _0xc7d3=function(_0x1c03a6,_0x169722){_0x1c03a6=_0x1c03a6-0x0;var _0x3f83f6=_0x7d3c[_0x1c03a6];return _0x3f83f6;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xc7d3('0x0'));var interaction=require(_0xc7d3('0x1'));var controller=require(_0xc7d3('0x2'));router[_0xc7d3('0x3')]('/',auth[_0xc7d3('0x4')](),controller[_0xc7d3('0x5')]);router[_0xc7d3('0x3')]('/describe',auth[_0xc7d3('0x4')](),controller['describe']);router['get']('/:id',auth[_0xc7d3('0x4')](),controller[_0xc7d3('0x6')]);router[_0xc7d3('0x3')]('/:id/messages',auth[_0xc7d3('0x4')](),controller[_0xc7d3('0x7')]);router[_0xc7d3('0x3')](_0xc7d3('0x8'),auth[_0xc7d3('0x4')](),controller[_0xc7d3('0x9')]);router[_0xc7d3('0xa')]('/',auth[_0xc7d3('0x4')](),controller[_0xc7d3('0xb')]);router[_0xc7d3('0xa')](_0xc7d3('0xc'),auth[_0xc7d3('0x4')](),controller['addMessage']);router['post'](_0xc7d3('0xd'),auth['isAuthenticated'](),interaction[_0xc7d3('0xe')]('mail','mailinteraction:addtags'),controller['addTags']);router[_0xc7d3('0xf')]('/:id',auth[_0xc7d3('0x4')](),interaction[_0xc7d3('0xe')](_0xc7d3('0x10'),_0xc7d3('0x11')),controller['update']);router['delete'](_0xc7d3('0x12'),auth[_0xc7d3('0x4')](),interaction[_0xc7d3('0xe')]('mail',_0xc7d3('0x13')),controller[_0xc7d3('0x14')]);router[_0xc7d3('0x15')](_0xc7d3('0xd'),auth[_0xc7d3('0x4')](),controller[_0xc7d3('0x16')]);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 0d08b28..ae1a002 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 _0x19d4=['ENUM','INTEGER','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x19d4,0x1ec));var _0x419d=function(_0x529b97,_0x3a86c0){_0x529b97=_0x529b97-0x0;var _0x570b0e=_0x19d4[_0x529b97];return _0x570b0e;};'use strict';var Sequelize=require(_0x419d('0x0'));var iconv=require(_0x419d('0x1'));module[_0x419d('0x2')]={'closed':{'type':Sequelize[_0x419d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x419d('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x419d('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x419d('0x5')]},'cc':{'type':Sequelize[_0x419d('0x6')](_0x419d('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x419d('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x419d('0x4')]},'substatus':{'type':Sequelize[_0x419d('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x419d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x419d('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x419d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x419d('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x419d('0x9')]}}; \ No newline at end of file +var _0x461c=['sequelize','exports','DATE','STRING','long','TEXT','BOOLEAN','out','ENUM','INTEGER'];(function(_0x4db11e,_0x4b8cc2){var _0x55e7c4=function(_0x45ec87){while(--_0x45ec87){_0x4db11e['push'](_0x4db11e['shift']());}};_0x55e7c4(++_0x4b8cc2);}(_0x461c,0x10e));var _0xc461=function(_0x2e87d1,_0x12d90e){_0x2e87d1=_0x2e87d1-0x0;var _0x572987=_0x461c[_0x2e87d1];return _0x572987;};'use strict';var Sequelize=require(_0xc461('0x0'));var iconv=require('iconv');module[_0xc461('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc461('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc461('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc461('0x3')]},'note':{'type':Sequelize[_0xc461('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0xc461('0x4'))},'subject':{'type':Sequelize[_0xc461('0x5')]()},'attach':{'type':Sequelize[_0xc461('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xc461('0x2')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xc461('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc461('0x8')]('in',_0xc461('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc461('0x9')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 4a12436..9db8225 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 _0x90d3=['mailInteractionTags:save','removeTags','download','unix','toString','join','files','tmp','server','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','bcc','subject','get','mkdirSync','missing.recipient@your.company.com','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','build','message%d.eml','eml-format','rimraf','moment','util','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','getOptions','mail','query','user','catch','show','keys','MailInteraction','model','attributes','intersection','fields','includeAll','merge','options','find','create','body','params','describe','addMessage','MailMessage','omit','ids','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','findAll','inlineCss','length','setTags','Tag','color','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x90d3,0x91));var _0x390d=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x90d3[_0x9cd4c3];return _0x4c9025;};'use strict';var emlformat=require(_0x390d('0x0'));var rimraf=require(_0x390d('0x1'));var zipdir=require('zip-dir');var moment=require(_0x390d('0x2'));var BPromise=require('bluebird');var util=require(_0x390d('0x3'));var path=require(_0x390d('0x4'));var fs=require('fs');var _=require(_0x390d('0x5'));var juice=require(_0x390d('0x6'));var Redis=require(_0x390d('0x7'));var interaction=require(_0x390d('0x8'));var qs=require(_0x390d('0x9'));var logger=require(_0x390d('0xa'))(_0x390d('0xb'));var config=require('../../config/environment');var db=require(_0x390d('0xc'))['db'];var htmlEntities=require(_0x390d('0xd'));config[_0x390d('0xe')]=_[_0x390d('0xf')](config[_0x390d('0xe')],{'host':_0x390d('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x390d('0xe')]));require(_0x390d('0x11'))[_0x390d('0x12')](socket);function respondWithStatusCode(_0xcb24,_0x3086cc){_0x3086cc=_0x3086cc||0xcc;return function(_0x525e84){if(_0x525e84){return _0xcb24['sendStatus'](_0x3086cc);}return _0xcb24['status'](_0x3086cc)['end']();};}function respondWithResult(_0x23b6c5,_0x14cb2f){_0x14cb2f=_0x14cb2f||0xc8;return function(_0x5235d5){if(_0x5235d5){return _0x23b6c5[_0x390d('0x13')](_0x14cb2f)[_0x390d('0x14')](_0x5235d5);}};}function respondWithFilteredResult(_0x4048d5,_0x2dc96c){return function(_0x33bd36){if(_0x33bd36){var _0x2da1f6=typeof _0x2dc96c[_0x390d('0x15')]===_0x390d('0x16')&&typeof _0x2dc96c[_0x390d('0x17')]===_0x390d('0x16');var _0x246012=_0x33bd36['count'];var _0x91d12c=_0x2da1f6?0x0:_0x2dc96c[_0x390d('0x15')];var _0x49532e=_0x2da1f6?_0x33bd36[_0x390d('0x18')]:_0x2dc96c[_0x390d('0x15')]+_0x2dc96c[_0x390d('0x17')];var _0x4fdce6;if(_0x49532e>=_0x246012){_0x49532e=_0x246012;_0x4fdce6=0xc8;}else{_0x4fdce6=0xce;}_0x4048d5['status'](_0x4fdce6);return _0x4048d5['set'](_0x390d('0x19'),_0x91d12c+'-'+_0x49532e+'/'+_0x246012)[_0x390d('0x14')](_0x33bd36);}return null;};}function saveUpdates(_0x3e8da7){return function(_0x3670bf){if(_0x3670bf){return _0x3670bf[_0x390d('0x1a')](_0x3e8da7)[_0x390d('0x1b')](function(_0x1004b8){return _0x1004b8;});}return null;};}function removeEntity(_0x4e9e53){return function(_0x3e9fa5){if(_0x3e9fa5){return _0x3e9fa5[_0x390d('0x1c')]()['then'](function(){_0x4e9e53['status'](0xcc)[_0x390d('0x1d')]();});}};}function handleEntityNotFound(_0x194821){return function(_0x2ecc6f){if(!_0x2ecc6f){_0x194821[_0x390d('0x1e')](0x194);}return _0x2ecc6f;};}function handleError(_0x13cdcb,_0xdae35f){_0xdae35f=_0xdae35f||0x1f4;return function(_0xa81435){logger[_0x390d('0x1f')](_0xa81435[_0x390d('0x20')]);if(_0xa81435[_0x390d('0x21')]){delete _0xa81435[_0x390d('0x21')];}_0x13cdcb[_0x390d('0x13')](_0xdae35f)[_0x390d('0x22')](_0xa81435);};}exports[_0x390d('0x23')]=function(_0xbd3d8f,_0x173c57){var _0x37bec8={};var _0x330fdb=_[_0x390d('0x24')](db['MailInteraction'][_0x390d('0x25')],function(_0x314e9c){return{'name':_0x314e9c[_0x390d('0x26')],'type':_0x314e9c[_0x390d('0x27')]['key']};});_0x37bec8=qs[_0x390d('0x28')](_0x330fdb,_0xbd3d8f);return interaction['findAll'](_0x390d('0x29'),_0xbd3d8f[_0x390d('0x2a')],_0xbd3d8f[_0x390d('0x2b')],_0x37bec8,_0x330fdb)[_0x390d('0x1b')](respondWithFilteredResult(_0x173c57,_0x37bec8))[_0x390d('0x2c')](handleError(_0x173c57,null));};exports[_0x390d('0x2d')]=function(_0x5be009,_0x387bc9){var _0x1ea5b3={'raw':![],'where':{'id':_0x5be009['params']['id']}},_0x25fa34={};_0x25fa34['model']=_[_0x390d('0x2e')](db[_0x390d('0x2f')][_0x390d('0x25')]);_0x25fa34[_0x390d('0x2a')]=_[_0x390d('0x2e')](_0x5be009['query']);_0x25fa34['filters']=_['intersection'](_0x25fa34[_0x390d('0x30')],_0x25fa34['query']);_0x1ea5b3[_0x390d('0x31')]=_[_0x390d('0x32')](_0x25fa34['model'],qs[_0x390d('0x33')](_0x5be009[_0x390d('0x2a')][_0x390d('0x33')]));_0x1ea5b3['attributes']=_0x1ea5b3['attributes']['length']?_0x1ea5b3['attributes']:_0x25fa34[_0x390d('0x30')];if(_0x5be009[_0x390d('0x2a')][_0x390d('0x34')]){_0x1ea5b3['include']=[{'all':!![]}];}_0x1ea5b3=_[_0x390d('0x35')]({},_0x1ea5b3,_0x5be009[_0x390d('0x36')]);return db[_0x390d('0x2f')][_0x390d('0x37')](_0x1ea5b3)[_0x390d('0x1b')](handleEntityNotFound(_0x387bc9,null))[_0x390d('0x1b')](respondWithResult(_0x387bc9,null))[_0x390d('0x2c')](handleError(_0x387bc9,null));};exports['create']=function(_0x330e1c,_0x4500a2){return db[_0x390d('0x2f')][_0x390d('0x38')](_0x330e1c[_0x390d('0x39')],{})[_0x390d('0x1b')](respondWithResult(_0x4500a2,0xc9))['catch'](handleError(_0x4500a2,null));};exports['update']=function(_0x57dab1,_0x4cee65){if(_0x57dab1[_0x390d('0x39')]['id']){delete _0x57dab1[_0x390d('0x39')]['id'];}return db['MailInteraction'][_0x390d('0x37')]({'where':{'id':_0x57dab1[_0x390d('0x3a')]['id']}})[_0x390d('0x1b')](handleEntityNotFound(_0x4cee65,null))[_0x390d('0x1b')](saveUpdates(_0x57dab1[_0x390d('0x39')],null))[_0x390d('0x1b')](respondWithResult(_0x4cee65,null))[_0x390d('0x2c')](handleError(_0x4cee65,null));};exports[_0x390d('0x1c')]=function(_0x520531,_0x190090){return db['MailInteraction'][_0x390d('0x37')]({'where':{'id':_0x520531['params']['id']}})[_0x390d('0x1b')](handleEntityNotFound(_0x190090,null))[_0x390d('0x1b')](removeEntity(_0x190090,null))[_0x390d('0x2c')](handleError(_0x190090,null));};exports[_0x390d('0x3b')]=function(_0x449619,_0x56f3ab){return db[_0x390d('0x2f')][_0x390d('0x3b')]()[_0x390d('0x1b')](respondWithResult(_0x56f3ab,null))[_0x390d('0x2c')](handleError(_0x56f3ab,null));};exports[_0x390d('0x3c')]=function(_0x3ed8eb,_0x3750bf){return db[_0x390d('0x3d')][_0x390d('0x37')]({'where':{'id':_0x3ed8eb[_0x390d('0x3a')]['id']}})[_0x390d('0x1b')](handleEntityNotFound(_0x3750bf,null))[_0x390d('0x1b')](function(_0x49ff05){if(_0x49ff05){return _0x49ff05[_0x390d('0x3c')](_0x3ed8eb[_0x390d('0x39')]['ids'],_[_0x390d('0x3e')](_0x3ed8eb['body'],[_0x390d('0x3f'),'id'])||{});}})[_0x390d('0x1b')](respondWithResult(_0x3750bf,null))['catch'](handleError(_0x3750bf,null));};exports[_0x390d('0x40')]=function(_0x2c58fb,_0x441c09){var _0x336fbe={'raw':![],'where':{}};var _0x4bd6ab={};var _0x427cc3={'count':0x0,'rows':[]};return db[_0x390d('0x2f')][_0x390d('0x41')]({'where':{'id':_0x2c58fb[_0x390d('0x3a')]['id']}})[_0x390d('0x1b')](handleEntityNotFound(_0x441c09,null))['then'](function(_0x19af36){if(_0x19af36){_0x4bd6ab[_0x390d('0x30')]=_[_0x390d('0x2e')](db[_0x390d('0x3d')][_0x390d('0x25')]);_0x4bd6ab[_0x390d('0x2a')]=_[_0x390d('0x2e')](_0x2c58fb[_0x390d('0x2a')]);_0x4bd6ab[_0x390d('0x42')]=_[_0x390d('0x32')](_0x4bd6ab['model'],_0x4bd6ab[_0x390d('0x2a')]);_0x336fbe[_0x390d('0x31')]=_['intersection'](_0x4bd6ab['model'],qs[_0x390d('0x33')](_0x2c58fb[_0x390d('0x2a')]['fields']));_0x336fbe[_0x390d('0x31')]=_0x336fbe[_0x390d('0x31')]['length']?_0x336fbe[_0x390d('0x31')]:_0x4bd6ab[_0x390d('0x30')];if(!_0x2c58fb[_0x390d('0x2a')][_0x390d('0x43')](_0x390d('0x44'))){_0x336fbe[_0x390d('0x17')]=qs[_0x390d('0x17')](_0x2c58fb['query'][_0x390d('0x17')]);_0x336fbe[_0x390d('0x15')]=qs['offset'](_0x2c58fb['query']['offset']);}_0x336fbe[_0x390d('0x45')]=qs[_0x390d('0x46')](_0x2c58fb[_0x390d('0x2a')][_0x390d('0x46')]);_0x336fbe[_0x390d('0x47')]=qs[_0x390d('0x42')](_['pick'](_0x2c58fb['query'],_0x4bd6ab[_0x390d('0x42')]));_0x336fbe['where'][_0x390d('0x48')]=_0x19af36['id'];if(_0x2c58fb[_0x390d('0x2a')][_0x390d('0x49')]){_0x336fbe[_0x390d('0x47')]=_[_0x390d('0x35')](_0x336fbe[_0x390d('0x47')],{'$or':_[_0x390d('0x24')](_0x336fbe['attributes'],function(_0xa9b3bf){var _0x1b4591={};_0x1b4591[_0xa9b3bf]={'$like':'%'+_0x2c58fb[_0x390d('0x2a')][_0x390d('0x49')]+'%'};return _0x1b4591;})});}if(_0x2c58fb[_0x390d('0x2a')][_0x390d('0x4a')]){var _0x1546ad=_0x2c58fb[_0x390d('0x2a')]['$gte'][_0x390d('0x4b')](',');var _0x5245d7={};_0x5245d7[_0x1546ad[0x0]]={'$gte':moment(_0x1546ad[0x1])['format'](_0x390d('0x4c'))};_0x336fbe[_0x390d('0x47')]=_[_0x390d('0x35')](_0x336fbe['where'],_0x5245d7);}_0x336fbe=_[_0x390d('0x35')]({},_0x336fbe,_0x2c58fb[_0x390d('0x36')]);return db['MailMessage'][_0x390d('0x18')]({'where':_0x336fbe['where']})[_0x390d('0x1b')](function(_0x327904){_0x427cc3[_0x390d('0x18')]=_0x327904;if(_0x2c58fb[_0x390d('0x2a')][_0x390d('0x34')]){_0x336fbe[_0x390d('0x4d')]=[{'all':!![]}];}return db[_0x390d('0x3d')][_0x390d('0x4e')](_0x336fbe);})[_0x390d('0x1b')](function(_0x4b063a){if(_0x2c58fb[_0x390d('0x2a')][_0x390d('0x4f')]==='true'){for(var _0x86bf5d=0x0;_0x86bf5d<_0x4b063a[_0x390d('0x50')];_0x86bf5d++){_0x4b063a[_0x86bf5d][_0x390d('0x39')]=juice(_0x4b063a[_0x86bf5d][_0x390d('0x39')]);}}_0x427cc3['rows']=_0x4b063a;return _0x427cc3;});}})[_0x390d('0x1b')](respondWithFilteredResult(_0x441c09,_0x336fbe))[_0x390d('0x2c')](handleError(_0x441c09,null));};exports['addTags']=function(_0x5480fa,_0x13482a){return db[_0x390d('0x2f')]['find']({'where':{'id':_0x5480fa[_0x390d('0x3a')]['id']}})['then'](handleEntityNotFound(_0x13482a,null))[_0x390d('0x1b')](function(_0x47824f){if(_0x47824f){return _0x47824f[_0x390d('0x51')](_0x5480fa[_0x390d('0x39')][_0x390d('0x3f')],_[_0x390d('0x3e')](_0x5480fa['body'],[_0x390d('0x3f'),'id'])||{})['spread'](function(){return db[_0x390d('0x52')]['findAll']({'attributes':['id',_0x390d('0x21'),_0x390d('0x53')],'where':{'id':_0x5480fa[_0x390d('0x39')]['ids']}});})[_0x390d('0x1b')](function(_0x1a8a42){socket[_0x390d('0x54')](_0x390d('0x55'),{'id':Number(_0x5480fa[_0x390d('0x3a')]['id']),'tags':_0x1a8a42||[]});return{'id':Number(_0x5480fa[_0x390d('0x3a')]['id']),'tags':_0x1a8a42||[]};});}})[_0x390d('0x1b')](respondWithResult(_0x13482a,null))[_0x390d('0x2c')](handleError(_0x13482a,null));};exports['removeTags']=function(_0x122999,_0x13278b){return db['MailInteraction']['find']({'where':{'id':_0x122999[_0x390d('0x3a')]['id']}})[_0x390d('0x1b')](handleEntityNotFound(_0x13278b,null))['then'](function(_0x101340){if(_0x101340){return _0x101340[_0x390d('0x56')](_0x122999['query'][_0x390d('0x3f')]);}})[_0x390d('0x1b')](respondWithStatusCode(_0x13278b,null))[_0x390d('0x2c')](handleError(_0x13278b,null));};exports[_0x390d('0x57')]=function(_0x3b1cb4,_0x1c0030){var _0x584397=moment()[_0x390d('0x58')]()[_0x390d('0x59')]();var _0xdbb9e5=path[_0x390d('0x5a')](config['root'],'server',_0x390d('0x5b'),_0x390d('0x5c'));var _0x523126=path[_0x390d('0x5a')](config['root'],_0x390d('0x5d'),_0x390d('0x5b'),_0x390d('0x5e'));var _0x39df34=path[_0x390d('0x5a')](_0xdbb9e5,_0x584397);var _0x461859=util[_0x390d('0x5f')](_0x390d('0x60'),_0x3b1cb4[_0x390d('0x3a')]['id'],_0x584397);var _0x14076d=path[_0x390d('0x5a')](_0xdbb9e5,_0x461859);var _0x21f201=[];if(_0x3b1cb4[_0x390d('0x2a')][_0x390d('0x5e')]){_0x21f201[_0x390d('0x61')]({'model':db[_0x390d('0x62')],'as':'Attachments','raw':!![]});}var _0xc3f14a=[{'model':db['MailMessage'],'as':_0x390d('0x63'),'attributes':['id',_0x390d('0x39'),'from','to','cc',_0x390d('0x64'),_0x390d('0x65'),'createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x21f201}];return db[_0x390d('0x2f')][_0x390d('0x37')]({'where':{'id':_0x3b1cb4[_0x390d('0x3a')]['id']},'include':_0xc3f14a})[_0x390d('0x1b')](handleEntityNotFound(_0x1c0030,null))['then'](function(_0x444b0a){if(_0x444b0a&&_0x444b0a[_0x390d('0x63')]){var _0x4ebff6=_0x444b0a[_0x390d('0x66')]({'plain':!![]});fs[_0x390d('0x67')](_0x39df34);return BPromise['each'](_0x4ebff6[_0x390d('0x63')],function(_0x177a0d,_0x26c4ae){var _0x2bc6ba={'from':_0x177a0d['from'],'to':_0x177a0d['to']||_0x390d('0x68'),'subject':_0x177a0d[_0x390d('0x65')],'html':htmlEntities[_0x390d('0x69')](_0x177a0d[_0x390d('0x39')]),'headers':{'Date':moment(_0x177a0d[_0x390d('0x6a')])[_0x390d('0x5f')](_0x390d('0x6b'))},'attachments':[]};if(_0x177a0d['cc']){_0x2bc6ba[_0x390d('0x6c')]['Cc']=_0x177a0d['cc'];}if(_0x177a0d[_0x390d('0x64')]){_0x2bc6ba[_0x390d('0x6c')][_0x390d('0x6d')]=_0x177a0d[_0x390d('0x64')];}return new BPromise(function(_0x4dd8d2,_0x14472a){if(_0x177a0d[_0x390d('0x6e')]){for(var _0x9a098e=0x0;_0x9a098e<_0x177a0d['Attachments'][_0x390d('0x50')];_0x9a098e++){var _0x26fed1=_0x177a0d[_0x390d('0x6e')][_0x9a098e];var _0x4a834d=path['join'](_0x523126,_0x26fed1[_0x390d('0x6f')]);if(fs[_0x390d('0x70')](_0x4a834d)){_0x2bc6ba[_0x390d('0x5e')]['push']({'name':_0x26fed1[_0x390d('0x21')],'contentType':_0x26fed1[_0x390d('0x27')],'data':fs['readFileSync'](_0x4a834d)});}}}emlformat[_0x390d('0x71')](_0x2bc6ba,function(_0x11365c,_0x6dfefe){if(_0x11365c)return _0x14472a(_0x11365c);fs['writeFileSync'](path[_0x390d('0x5a')](_0x39df34,util[_0x390d('0x5f')](_0x390d('0x72'),_0x26c4ae)),_0x6dfefe);return _0x4dd8d2(_0x6dfefe);});});})['then'](function(){return new BPromise(function(_0x22999,_0x1bac81){zipdir(_0x39df34,{'saveTo':_0x14076d},function(_0x5a79e3,_0x2c5830){if(_0x5a79e3)return _0x1bac81(_0x5a79e3);return _0x22999(_0x2c5830);});})['then'](function(){return new BPromise(function(_0x38dad5,_0x1414b1){rimraf(_0x39df34,function(_0x44bc22){if(_0x44bc22)_0x1414b1(_0x44bc22);return _0x38dad5();});});})[_0x390d('0x1b')](function(){return _0x1c0030[_0x390d('0x57')](_0x14076d,_0x461859,function(_0x17b939){if(!_0x17b939)fs['unlinkSync'](_0x14076d);});});});}else{return _0x1c0030[_0x390d('0x1e')](0xc8);}})[_0x390d('0x2c')](handleError(_0x1c0030,null));}; \ No newline at end of file +var _0xf457=['../../config/environment','../../mysqldb','defaults','redis','localhost','./mailInteraction.socket','status','end','json','offset','limit','count','set','Content-Range','then','destroy','sendStatus','name','send','index','map','MailInteraction','rawAttributes','fieldName','type','findAll','query','user','catch','show','params','model','keys','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','describe','addMessage','MailMessage','ids','getMessages','findOne','filters','hasOwnProperty','sort','where','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','rows','addTags','setTags','omit','spread','Tag','emit','removeTags','download','unix','toString','root','server','files','tmp','join','attachments','Attachment','Attachments','Messages','from','subject','createdAt','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','basename','existsSync','push','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api'];(function(_0x19b082,_0x4749a9){var _0x34bb24=function(_0x4405b5){while(--_0x4405b5){_0x19b082['push'](_0x19b082['shift']());}};_0x34bb24(++_0x4749a9);}(_0xf457,0x1bb));var _0x7f45=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf457[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x7f45('0x0'));var rimraf=require(_0x7f45('0x1'));var zipdir=require(_0x7f45('0x2'));var moment=require(_0x7f45('0x3'));var BPromise=require(_0x7f45('0x4'));var util=require(_0x7f45('0x5'));var path=require(_0x7f45('0x6'));var fs=require('fs');var _=require(_0x7f45('0x7'));var juice=require('juice');var Redis=require(_0x7f45('0x8'));var interaction=require(_0x7f45('0x9'));var qs=require(_0x7f45('0xa'));var logger=require(_0x7f45('0xb'))(_0x7f45('0xc'));var config=require(_0x7f45('0xd'));var db=require(_0x7f45('0xe'))['db'];var htmlEntities=require('html-entities');config['redis']=_[_0x7f45('0xf')](config[_0x7f45('0x10')],{'host':_0x7f45('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f45('0x10')]));require(_0x7f45('0x12'))['register'](socket);function respondWithStatusCode(_0x55a290,_0x243f8f){_0x243f8f=_0x243f8f||0xcc;return function(_0x30615c){if(_0x30615c){return _0x55a290['sendStatus'](_0x243f8f);}return _0x55a290[_0x7f45('0x13')](_0x243f8f)[_0x7f45('0x14')]();};}function respondWithResult(_0x3459d6,_0xa43bb0){_0xa43bb0=_0xa43bb0||0xc8;return function(_0x5cd0df){if(_0x5cd0df){return _0x3459d6[_0x7f45('0x13')](_0xa43bb0)[_0x7f45('0x15')](_0x5cd0df);}};}function respondWithFilteredResult(_0x55b9c5,_0x1d9431){return function(_0x2b7e59){if(_0x2b7e59){var _0x24ec2c=typeof _0x1d9431[_0x7f45('0x16')]==='undefined'&&typeof _0x1d9431[_0x7f45('0x17')]==='undefined';var _0x3f4a55=_0x2b7e59[_0x7f45('0x18')];var _0x55fffa=_0x24ec2c?0x0:_0x1d9431[_0x7f45('0x16')];var _0x4a03b6=_0x24ec2c?_0x2b7e59[_0x7f45('0x18')]:_0x1d9431[_0x7f45('0x16')]+_0x1d9431['limit'];var _0x262e74;if(_0x4a03b6>=_0x3f4a55){_0x4a03b6=_0x3f4a55;_0x262e74=0xc8;}else{_0x262e74=0xce;}_0x55b9c5[_0x7f45('0x13')](_0x262e74);return _0x55b9c5[_0x7f45('0x19')](_0x7f45('0x1a'),_0x55fffa+'-'+_0x4a03b6+'/'+_0x3f4a55)['json'](_0x2b7e59);}return null;};}function saveUpdates(_0x61e873){return function(_0x379763){if(_0x379763){return _0x379763['update'](_0x61e873)[_0x7f45('0x1b')](function(_0x155210){return _0x155210;});}return null;};}function removeEntity(_0x3b2729){return function(_0x220fa8){if(_0x220fa8){return _0x220fa8[_0x7f45('0x1c')]()[_0x7f45('0x1b')](function(){_0x3b2729[_0x7f45('0x13')](0xcc)[_0x7f45('0x14')]();});}};}function handleEntityNotFound(_0x42952b){return function(_0x3877a0){if(!_0x3877a0){_0x42952b[_0x7f45('0x1d')](0x194);}return _0x3877a0;};}function handleError(_0x17c555,_0x2a9a76){_0x2a9a76=_0x2a9a76||0x1f4;return function(_0x225d19){logger['error'](_0x225d19['stack']);if(_0x225d19['name']){delete _0x225d19[_0x7f45('0x1e')];}_0x17c555[_0x7f45('0x13')](_0x2a9a76)[_0x7f45('0x1f')](_0x225d19);};}exports[_0x7f45('0x20')]=function(_0x278a94,_0x508f88){var _0x5a95a4={};var _0x402ddf=_[_0x7f45('0x21')](db[_0x7f45('0x22')][_0x7f45('0x23')],function(_0x27f87f){return{'name':_0x27f87f[_0x7f45('0x24')],'type':_0x27f87f[_0x7f45('0x25')]['key']};});_0x5a95a4=qs['getOptions'](_0x402ddf,_0x278a94);return interaction[_0x7f45('0x26')]('mail',_0x278a94[_0x7f45('0x27')],_0x278a94[_0x7f45('0x28')],_0x5a95a4,_0x402ddf)[_0x7f45('0x1b')](respondWithFilteredResult(_0x508f88,_0x5a95a4))[_0x7f45('0x29')](handleError(_0x508f88,null));};exports[_0x7f45('0x2a')]=function(_0x36e012,_0x55fc5a){var _0x2a626c={'raw':![],'where':{'id':_0x36e012[_0x7f45('0x2b')]['id']}},_0x254a6d={};_0x254a6d[_0x7f45('0x2c')]=_[_0x7f45('0x2d')](db[_0x7f45('0x22')][_0x7f45('0x23')]);_0x254a6d[_0x7f45('0x27')]=_['keys'](_0x36e012['query']);_0x254a6d['filters']=_[_0x7f45('0x2e')](_0x254a6d[_0x7f45('0x2c')],_0x254a6d['query']);_0x2a626c[_0x7f45('0x2f')]=_[_0x7f45('0x2e')](_0x254a6d[_0x7f45('0x2c')],qs[_0x7f45('0x30')](_0x36e012[_0x7f45('0x27')][_0x7f45('0x30')]));_0x2a626c['attributes']=_0x2a626c['attributes'][_0x7f45('0x31')]?_0x2a626c[_0x7f45('0x2f')]:_0x254a6d[_0x7f45('0x2c')];if(_0x36e012[_0x7f45('0x27')][_0x7f45('0x32')]){_0x2a626c[_0x7f45('0x33')]=[{'all':!![]}];}_0x2a626c=_[_0x7f45('0x34')]({},_0x2a626c,_0x36e012[_0x7f45('0x35')]);return db[_0x7f45('0x22')][_0x7f45('0x36')](_0x2a626c)[_0x7f45('0x1b')](handleEntityNotFound(_0x55fc5a,null))['then'](respondWithResult(_0x55fc5a,null))[_0x7f45('0x29')](handleError(_0x55fc5a,null));};exports['create']=function(_0xb79c0d,_0x5a9313){return db['MailInteraction'][_0x7f45('0x37')](_0xb79c0d[_0x7f45('0x38')],{})[_0x7f45('0x1b')](respondWithResult(_0x5a9313,0xc9))[_0x7f45('0x29')](handleError(_0x5a9313,null));};exports[_0x7f45('0x39')]=function(_0x23b3e6,_0x382aca){if(_0x23b3e6[_0x7f45('0x38')]['id']){delete _0x23b3e6['body']['id'];}return db[_0x7f45('0x22')][_0x7f45('0x36')]({'where':{'id':_0x23b3e6[_0x7f45('0x2b')]['id']}})['then'](handleEntityNotFound(_0x382aca,null))[_0x7f45('0x1b')](saveUpdates(_0x23b3e6[_0x7f45('0x38')],null))[_0x7f45('0x1b')](respondWithResult(_0x382aca,null))[_0x7f45('0x29')](handleError(_0x382aca,null));};exports[_0x7f45('0x1c')]=function(_0x51ee9a,_0x31bd20){return db[_0x7f45('0x22')][_0x7f45('0x36')]({'where':{'id':_0x51ee9a['params']['id']}})['then'](handleEntityNotFound(_0x31bd20,null))[_0x7f45('0x1b')](removeEntity(_0x31bd20,null))[_0x7f45('0x29')](handleError(_0x31bd20,null));};exports[_0x7f45('0x3a')]=function(_0x5e86e6,_0x4fe442){return db[_0x7f45('0x22')][_0x7f45('0x3a')]()[_0x7f45('0x1b')](respondWithResult(_0x4fe442,null))[_0x7f45('0x29')](handleError(_0x4fe442,null));};exports[_0x7f45('0x3b')]=function(_0x1f6cce,_0x5148af){return db[_0x7f45('0x3c')][_0x7f45('0x36')]({'where':{'id':_0x1f6cce[_0x7f45('0x2b')]['id']}})[_0x7f45('0x1b')](handleEntityNotFound(_0x5148af,null))[_0x7f45('0x1b')](function(_0x32acd3){if(_0x32acd3){return _0x32acd3[_0x7f45('0x3b')](_0x1f6cce[_0x7f45('0x38')]['ids'],_['omit'](_0x1f6cce[_0x7f45('0x38')],[_0x7f45('0x3d'),'id'])||{});}})[_0x7f45('0x1b')](respondWithResult(_0x5148af,null))[_0x7f45('0x29')](handleError(_0x5148af,null));};exports[_0x7f45('0x3e')]=function(_0x1d4d31,_0x577473){var _0x2cfc54={'raw':![],'where':{}};var _0x255fc4={};var _0x193094={'count':0x0,'rows':[]};return db[_0x7f45('0x22')][_0x7f45('0x3f')]({'where':{'id':_0x1d4d31[_0x7f45('0x2b')]['id']}})[_0x7f45('0x1b')](handleEntityNotFound(_0x577473,null))['then'](function(_0x33cdd5){if(_0x33cdd5){_0x255fc4[_0x7f45('0x2c')]=_[_0x7f45('0x2d')](db['MailMessage'][_0x7f45('0x23')]);_0x255fc4[_0x7f45('0x27')]=_[_0x7f45('0x2d')](_0x1d4d31[_0x7f45('0x27')]);_0x255fc4[_0x7f45('0x40')]=_[_0x7f45('0x2e')](_0x255fc4[_0x7f45('0x2c')],_0x255fc4[_0x7f45('0x27')]);_0x2cfc54[_0x7f45('0x2f')]=_[_0x7f45('0x2e')](_0x255fc4[_0x7f45('0x2c')],qs[_0x7f45('0x30')](_0x1d4d31[_0x7f45('0x27')][_0x7f45('0x30')]));_0x2cfc54[_0x7f45('0x2f')]=_0x2cfc54[_0x7f45('0x2f')][_0x7f45('0x31')]?_0x2cfc54[_0x7f45('0x2f')]:_0x255fc4[_0x7f45('0x2c')];if(!_0x1d4d31[_0x7f45('0x27')][_0x7f45('0x41')]('nolimit')){_0x2cfc54[_0x7f45('0x17')]=qs[_0x7f45('0x17')](_0x1d4d31[_0x7f45('0x27')]['limit']);_0x2cfc54[_0x7f45('0x16')]=qs[_0x7f45('0x16')](_0x1d4d31['query'][_0x7f45('0x16')]);}_0x2cfc54['order']=qs['sort'](_0x1d4d31[_0x7f45('0x27')][_0x7f45('0x42')]);_0x2cfc54[_0x7f45('0x43')]=qs[_0x7f45('0x40')](_['pick'](_0x1d4d31['query'],_0x255fc4[_0x7f45('0x40')]));_0x2cfc54[_0x7f45('0x43')][_0x7f45('0x44')]=_0x33cdd5['id'];if(_0x1d4d31[_0x7f45('0x27')][_0x7f45('0x45')]){_0x2cfc54['where']=_[_0x7f45('0x34')](_0x2cfc54[_0x7f45('0x43')],{'$or':_[_0x7f45('0x21')](_0x2cfc54[_0x7f45('0x2f')],function(_0x3bf393){var _0x1f62c6={};_0x1f62c6[_0x3bf393]={'$like':'%'+_0x1d4d31['query'][_0x7f45('0x45')]+'%'};return _0x1f62c6;})});}if(_0x1d4d31[_0x7f45('0x27')][_0x7f45('0x46')]){var _0x34bd46=_0x1d4d31[_0x7f45('0x27')][_0x7f45('0x46')][_0x7f45('0x47')](',');var _0x2659a1={};_0x2659a1[_0x34bd46[0x0]]={'$gte':moment(_0x34bd46[0x1])[_0x7f45('0x48')](_0x7f45('0x49'))};_0x2cfc54['where']=_['merge'](_0x2cfc54[_0x7f45('0x43')],_0x2659a1);}_0x2cfc54=_[_0x7f45('0x34')]({},_0x2cfc54,_0x1d4d31[_0x7f45('0x35')]);return db[_0x7f45('0x3c')][_0x7f45('0x18')]({'where':_0x2cfc54[_0x7f45('0x43')]})[_0x7f45('0x1b')](function(_0x5408f8){_0x193094[_0x7f45('0x18')]=_0x5408f8;if(_0x1d4d31[_0x7f45('0x27')]['includeAll']){_0x2cfc54[_0x7f45('0x33')]=[{'all':!![]}];}return db['MailMessage'][_0x7f45('0x26')](_0x2cfc54);})[_0x7f45('0x1b')](function(_0x5cb289){if(_0x1d4d31[_0x7f45('0x27')][_0x7f45('0x4a')]==='true'){for(var _0x2e22bf=0x0;_0x2e22bf<_0x5cb289['length'];_0x2e22bf++){_0x5cb289[_0x2e22bf]['body']=juice(_0x5cb289[_0x2e22bf]['body']);}}_0x193094[_0x7f45('0x4b')]=_0x5cb289;return _0x193094;});}})[_0x7f45('0x1b')](respondWithFilteredResult(_0x577473,_0x2cfc54))[_0x7f45('0x29')](handleError(_0x577473,null));};exports[_0x7f45('0x4c')]=function(_0x43f3b2,_0x1465f5){return db[_0x7f45('0x22')][_0x7f45('0x36')]({'where':{'id':_0x43f3b2[_0x7f45('0x2b')]['id']}})[_0x7f45('0x1b')](handleEntityNotFound(_0x1465f5,null))[_0x7f45('0x1b')](function(_0x620233){if(_0x620233){return _0x620233[_0x7f45('0x4d')](_0x43f3b2[_0x7f45('0x38')][_0x7f45('0x3d')],_[_0x7f45('0x4e')](_0x43f3b2[_0x7f45('0x38')],[_0x7f45('0x3d'),'id'])||{})[_0x7f45('0x4f')](function(){return db[_0x7f45('0x50')][_0x7f45('0x26')]({'attributes':['id','name','color'],'where':{'id':_0x43f3b2[_0x7f45('0x38')][_0x7f45('0x3d')]}});})['then'](function(_0x1b06db){socket[_0x7f45('0x51')]('mailInteractionTags:save',{'id':Number(_0x43f3b2[_0x7f45('0x2b')]['id']),'tags':_0x1b06db||[]});return{'id':Number(_0x43f3b2[_0x7f45('0x2b')]['id']),'tags':_0x1b06db||[]};});}})[_0x7f45('0x1b')](respondWithResult(_0x1465f5,null))[_0x7f45('0x29')](handleError(_0x1465f5,null));};exports[_0x7f45('0x52')]=function(_0x591ce7,_0x24cd00){return db[_0x7f45('0x22')][_0x7f45('0x36')]({'where':{'id':_0x591ce7[_0x7f45('0x2b')]['id']}})[_0x7f45('0x1b')](handleEntityNotFound(_0x24cd00,null))[_0x7f45('0x1b')](function(_0x4892d1){if(_0x4892d1){return _0x4892d1['removeTags'](_0x591ce7['query'][_0x7f45('0x3d')]);}})[_0x7f45('0x1b')](respondWithStatusCode(_0x24cd00,null))[_0x7f45('0x29')](handleError(_0x24cd00,null));};exports[_0x7f45('0x53')]=function(_0x44a32b,_0x1c6360){var _0x276c11=moment()[_0x7f45('0x54')]()[_0x7f45('0x55')]();var _0x5e563a=path['join'](config[_0x7f45('0x56')],_0x7f45('0x57'),_0x7f45('0x58'),_0x7f45('0x59'));var _0x22bb6d=path[_0x7f45('0x5a')](config[_0x7f45('0x56')],_0x7f45('0x57'),_0x7f45('0x58'),_0x7f45('0x5b'));var _0x46a7fc=path['join'](_0x5e563a,_0x276c11);var _0x4bab6d=util[_0x7f45('0x48')]('transcript-%d-%s.zip',_0x44a32b[_0x7f45('0x2b')]['id'],_0x276c11);var _0x2eab02=path[_0x7f45('0x5a')](_0x5e563a,_0x4bab6d);var _0x8d69d5=[];if(_0x44a32b[_0x7f45('0x27')][_0x7f45('0x5b')]){_0x8d69d5['push']({'model':db[_0x7f45('0x5c')],'as':_0x7f45('0x5d'),'raw':!![]});}var _0x4c903e=[{'model':db['MailMessage'],'as':_0x7f45('0x5e'),'attributes':['id','body',_0x7f45('0x5f'),'to','cc','bcc',_0x7f45('0x60'),_0x7f45('0x61')],'where':{'secret':![]},'order':qs[_0x7f45('0x42')]('id'),'include':_0x8d69d5}];return db[_0x7f45('0x22')]['find']({'where':{'id':_0x44a32b[_0x7f45('0x2b')]['id']},'include':_0x4c903e})[_0x7f45('0x1b')](handleEntityNotFound(_0x1c6360,null))['then'](function(_0x4649cc){if(_0x4649cc&&_0x4649cc['Messages']){var _0xfc92ee=_0x4649cc[_0x7f45('0x62')]({'plain':!![]});fs[_0x7f45('0x63')](_0x46a7fc);return BPromise[_0x7f45('0x64')](_0xfc92ee[_0x7f45('0x5e')],function(_0x4ddf8b,_0x3cadc2){var _0x3680b9={'from':_0x4ddf8b[_0x7f45('0x5f')],'to':_0x4ddf8b['to']||'missing.recipient@your.company.com','subject':_0x4ddf8b[_0x7f45('0x60')],'html':htmlEntities[_0x7f45('0x65')](_0x4ddf8b['body']),'headers':{'Date':moment(_0x4ddf8b[_0x7f45('0x61')])[_0x7f45('0x48')](_0x7f45('0x66'))},'attachments':[]};if(_0x4ddf8b['cc']){_0x3680b9['headers']['Cc']=_0x4ddf8b['cc'];}if(_0x4ddf8b[_0x7f45('0x67')]){_0x3680b9[_0x7f45('0x68')][_0x7f45('0x69')]=_0x4ddf8b[_0x7f45('0x67')];}return new BPromise(function(_0x47774d,_0xfce26){if(_0x4ddf8b[_0x7f45('0x5d')]){for(var _0x19ea93=0x0;_0x19ea93<_0x4ddf8b[_0x7f45('0x5d')][_0x7f45('0x31')];_0x19ea93++){var _0x2ace3b=_0x4ddf8b[_0x7f45('0x5d')][_0x19ea93];var _0x5a8499=path[_0x7f45('0x5a')](_0x22bb6d,_0x2ace3b[_0x7f45('0x6a')]);if(fs[_0x7f45('0x6b')](_0x5a8499)){_0x3680b9[_0x7f45('0x5b')][_0x7f45('0x6c')]({'name':_0x2ace3b['name'],'contentType':_0x2ace3b[_0x7f45('0x25')],'data':fs[_0x7f45('0x6d')](_0x5a8499)});}}}emlformat[_0x7f45('0x6e')](_0x3680b9,function(_0x1c04ed,_0x156768){if(_0x1c04ed)return _0xfce26(_0x1c04ed);fs[_0x7f45('0x6f')](path[_0x7f45('0x5a')](_0x46a7fc,util[_0x7f45('0x48')](_0x7f45('0x70'),_0x3cadc2)),_0x156768);return _0x47774d(_0x156768);});});})[_0x7f45('0x1b')](function(){return new BPromise(function(_0x1ce4ff,_0x341881){zipdir(_0x46a7fc,{'saveTo':_0x2eab02},function(_0x5132ed,_0x198b89){if(_0x5132ed)return _0x341881(_0x5132ed);return _0x1ce4ff(_0x198b89);});})['then'](function(){return new BPromise(function(_0x59c0a7,_0x58a8db){rimraf(_0x46a7fc,function(_0x37423d){if(_0x37423d)_0x58a8db(_0x37423d);return _0x59c0a7();});});})[_0x7f45('0x1b')](function(){return _0x1c6360[_0x7f45('0x53')](_0x2eab02,_0x4bab6d,function(_0x15d53b){if(!_0x15d53b)fs[_0x7f45('0x71')](_0x2eab02);});});});}else{return _0x1c6360[_0x7f45('0x1d')](0xc8);}})[_0x7f45('0x29')](handleError(_0x1c6360,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 9f306db..d5e91db 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 _0x3511=['MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','hasOwnProperty','hook','exports','events','MailInteraction','../../mysqldb'];(function(_0x3d145d,_0x3aa561){var _0x200285=function(_0x51e7ce){while(--_0x51e7ce){_0x3d145d['push'](_0x3d145d['shift']());}};_0x200285(++_0x3aa561);}(_0x3511,0xbb));var _0x1351=function(_0x594c6d,_0x4d984f){_0x594c6d=_0x594c6d-0x0;var _0x522757=_0x3511[_0x594c6d];return _0x522757;};'use strict';var EventEmitter=require(_0x1351('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x1351('0x1')];var MailMessage=require(_0x1351('0x2'))['db'][_0x1351('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x1351('0x4')](0x0);var events={'afterCreate':_0x1351('0x5'),'afterUpdate':_0x1351('0x6'),'afterDestroy':_0x1351('0x7')};function emitEvent(_0x46b9b8){return function(_0x228fb8,_0x5b4006,_0x4e6484){_0x228fb8[_0x1351('0x8')]({'attributes':['id'],'raw':!![]})[_0x1351('0x9')](function(_0x4d17bb){_0x228fb8[_0x1351('0xa')](_0x1351('0xb'),_0x4d17bb[_0x1351('0xc')](function(_0x291584){return{'id':_0x291584['id']};}));return MailMessage[_0x1351('0xd')]({'where':{'MailInteractionId':_0x228fb8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1351('0x9')](function(_0xc8cefc){_0x228fb8[_0x1351('0xa')]('unreadMessages',_0xc8cefc[_0x1351('0xe')]);MailInteractionEvents['emit'](_0x46b9b8+':'+_0x228fb8['id'],_0x228fb8);MailInteractionEvents[_0x1351('0xf')](_0x46b9b8,_0x228fb8);_0x4e6484(null);})['catch'](_0x4e6484(null));};}for(var e in events){if(events[_0x1351('0x10')](e)){var event=events[e];MailInteraction[_0x1351('0x11')](e,emitEvent(event));}}module[_0x1351('0x12')]=MailInteractionEvents; \ No newline at end of file +var _0xfd36=['../../mysqldb','MailMessage','setMaxListeners','save','update','remove','setDataValue','Users','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','MailInteraction'];(function(_0x29e90a,_0x3a790f){var _0x435d26=function(_0x4f9464){while(--_0x4f9464){_0x29e90a['push'](_0x29e90a['shift']());}};_0x435d26(++_0x3a790f);}(_0xfd36,0x154));var _0x6fd3=function(_0x1e39a4,_0x451db7){_0x1e39a4=_0x1e39a4-0x0;var _0x59b0de=_0xfd36[_0x1e39a4];return _0x59b0de;};'use strict';var EventEmitter=require(_0x6fd3('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x6fd3('0x1')];var MailMessage=require(_0x6fd3('0x2'))['db'][_0x6fd3('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6fd3('0x4')](0x0);var events={'afterCreate':_0x6fd3('0x5'),'afterUpdate':_0x6fd3('0x6'),'afterDestroy':_0x6fd3('0x7')};function emitEvent(_0x3951e2){return function(_0xb1afaa,_0x3d6475,_0x2c4ac0){_0xb1afaa['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x4944cf){_0xb1afaa[_0x6fd3('0x8')](_0x6fd3('0x9'),_0x4944cf['map'](function(_0x16ff46){return{'id':_0x16ff46['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0xb1afaa['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6fd3('0xa')](function(_0x3f7cc5){_0xb1afaa[_0x6fd3('0x8')](_0x6fd3('0xb'),_0x3f7cc5[_0x6fd3('0xc')]);MailInteractionEvents[_0x6fd3('0xd')](_0x3951e2+':'+_0xb1afaa['id'],_0xb1afaa);MailInteractionEvents['emit'](_0x3951e2,_0xb1afaa);_0x2c4ac0(null);})[_0x6fd3('0xe')](_0x2c4ac0(null));};}for(var e in events){if(events[_0x6fd3('0xf')](e)){var event=events[e];MailInteraction[_0x6fd3('0x10')](e,emitEvent(event));}}module[_0x6fd3('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index c7a96ea..510bf35 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 _0x62b1=['MailInteraction','mail_interactions','subject','FULLTEXT','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','substatus','changed','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','./mailInteraction.attributes','exports','define'];(function(_0x4b125e,_0x136d4b){var _0x3090a6=function(_0x4f385f){while(--_0x4f385f){_0x4b125e['push'](_0x4b125e['shift']());}};_0x3090a6(++_0x136d4b);}(_0x62b1,0x11f));var _0x162b=function(_0x3b1aac,_0x3b9fd6){_0x3b1aac=_0x3b1aac-0x0;var _0x18368c=_0x62b1[_0x3b1aac];return _0x18368c;};'use strict';var _=require(_0x162b('0x0'));var util=require(_0x162b('0x1'));var logger=require('../../config/logger')(_0x162b('0x2'));var moment=require(_0x162b('0x3'));var BPromise=require(_0x162b('0x4'));var rp=require(_0x162b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x162b('0x6'));var config=require('../../config/environment');var attributes=require(_0x162b('0x7'));module[_0x162b('0x8')]=function(_0x34d915,_0x155c7b){return _0x34d915[_0x162b('0x9')](_0x162b('0xa'),attributes,{'tableName':_0x162b('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x162b('0xc'),'to'],'type':_0x162b('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3c75e1,_0x281b80,_0x52db29){if(_0x3c75e1['substatus']){_0x3c75e1[_0x162b('0xe')]=moment()[_0x162b('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3c75e1[_0x162b('0x10')]){_0x3c75e1[_0x162b('0x11')]=moment()[_0x162b('0xf')](_0x162b('0x12'));}_0x52db29(null,_0x281b80);},'beforeUpdate':function(_0x160684,_0x5acac1,_0x47a393){if(_0x160684['changed'](_0x162b('0x13'))){_0x160684[_0x162b('0xe')]=_0x160684[_0x162b('0x13')]?moment()[_0x162b('0xf')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x160684[_0x162b('0x14')](_0x162b('0x10'))){_0x160684['closedAt']=moment()[_0x162b('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x160684[_0x162b('0x13')]=null;_0x160684[_0x162b('0xe')]=null;}_0x47a393(null,_0x160684);},'afterUpdate':function(_0x52f4c7,_0xd4e82b,_0x54c7f6){var _0x320718=_0x34d915['models'];var _0x4d6562=_0x52f4c7[_0x162b('0x15')]({'plain':!![]});if(_0x4d6562['closed']){return _0x320718[_0x162b('0x16')][_0x162b('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x4d6562['id']}})[_0x162b('0x18')](function(){_0x54c7f6();})['catch'](function(_0x4e6de7){_0x54c7f6(_0x4e6de7);});}else{_0x54c7f6();}}},'charset':_0x162b('0x19'),'collate':_0x162b('0x1a')});}; \ No newline at end of file +var _0x616a=['../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','update','then','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x26773e,_0x4d778f){var _0x5627ac=function(_0x38da18){while(--_0x38da18){_0x26773e['push'](_0x26773e['shift']());}};_0x5627ac(++_0x4d778f);}(_0x616a,0xd0));var _0xa616=function(_0x29d36c,_0x5d5bf0){_0x29d36c=_0x29d36c-0x0;var _0x2f7e10=_0x616a[_0x29d36c];return _0x2f7e10;};'use strict';var _=require(_0xa616('0x0'));var util=require(_0xa616('0x1'));var logger=require(_0xa616('0x2'))(_0xa616('0x3'));var moment=require(_0xa616('0x4'));var BPromise=require(_0xa616('0x5'));var rp=require(_0xa616('0x6'));var fs=require('fs');var path=require(_0xa616('0x7'));var rimraf=require('rimraf');var config=require(_0xa616('0x8'));var attributes=require(_0xa616('0x9'));module[_0xa616('0xa')]=function(_0x261380,_0x128d9a){return _0x261380[_0xa616('0xb')](_0xa616('0xc'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xa616('0xd'),'fields':[_0xa616('0xe'),'to'],'type':_0xa616('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3a1034,_0x4ed86f,_0x3decf8){if(_0x3a1034[_0xa616('0x10')]){_0x3a1034[_0xa616('0x11')]=moment()[_0xa616('0x12')](_0xa616('0x13'));}if(_0x3a1034[_0xa616('0x14')]){_0x3a1034[_0xa616('0x15')]=moment()[_0xa616('0x12')](_0xa616('0x13'));}_0x3decf8(null,_0x4ed86f);},'beforeUpdate':function(_0x18e370,_0x25b6b5,_0x4047b3){if(_0x18e370[_0xa616('0x16')](_0xa616('0x10'))){_0x18e370['substatusAt']=_0x18e370[_0xa616('0x10')]?moment()['format'](_0xa616('0x13')):null;}if(_0x18e370[_0xa616('0x16')](_0xa616('0x14'))){_0x18e370[_0xa616('0x15')]=moment()[_0xa616('0x12')](_0xa616('0x13'));_0x18e370[_0xa616('0x10')]=null;_0x18e370[_0xa616('0x11')]=null;}_0x4047b3(null,_0x18e370);},'afterUpdate':function(_0x408dbf,_0x224d7b,_0x4fae46){var _0x195eb0=_0x261380[_0xa616('0x17')];var _0x465458=_0x408dbf['get']({'plain':!![]});if(_0x465458['closed']){return _0x195eb0['MailMessage'][_0xa616('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x465458['id']}})[_0xa616('0x19')](function(){_0x4fae46();})['catch'](function(_0x1f07de){_0x4fae46(_0x1f07de);});}else{_0x4fae46();}}},'charset':_0xa616('0x1a'),'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 0e7e817..38bc73d 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 _0xf984=['update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','UpdateMailInteraction','MailInteraction'];(function(_0x41db88,_0x3f3af7){var _0x39eaff=function(_0x50c9ed){while(--_0x50c9ed){_0x41db88['push'](_0x41db88['shift']());}};_0x39eaff(++_0x3f3af7);}(_0xf984,0x193));var _0x4f98=function(_0x141e26,_0x18b19c){_0x141e26=_0x141e26-0x0;var _0xf0d405=_0xf984[_0x141e26];return _0xf0d405;};'use strict';var _=require(_0x4f98('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f98('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f98('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f98('0x3'));var logger=require(_0x4f98('0x4'))(_0x4f98('0x5'));var config=require(_0x4f98('0x6'));var jayson=require(_0x4f98('0x7'));var client=jayson[_0x4f98('0x8')]['http']({'port':0x232a});config[_0x4f98('0x9')]=_[_0x4f98('0xa')](config[_0x4f98('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f98('0xb'))(new Redis(config[_0x4f98('0x9')]));require(_0x4f98('0xc'))[_0x4f98('0xd')](socket);function respondWithRpcPromise(_0x547ae6,_0x3e0e57,_0x288989){return new BPromise(function(_0x31896f,_0x1c0a35){return client['request'](_0x547ae6,_0x288989)[_0x4f98('0xe')](function(_0x13837e){logger[_0x4f98('0xf')](_0x4f98('0x10'),_0x3e0e57,'request\x20sent');logger[_0x4f98('0x11')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x3e0e57,_0x4f98('0x12'),JSON[_0x4f98('0x13')](_0x13837e));if(_0x13837e[_0x4f98('0x14')]){if(_0x13837e[_0x4f98('0x14')][_0x4f98('0x15')]===0x1f4){logger[_0x4f98('0x14')]('MailInteraction,\x20%s,\x20%s',_0x3e0e57,_0x13837e[_0x4f98('0x14')][_0x4f98('0x16')]);return _0x1c0a35(_0x13837e[_0x4f98('0x14')][_0x4f98('0x16')]);}logger['error'](_0x4f98('0x10'),_0x3e0e57,_0x13837e[_0x4f98('0x14')][_0x4f98('0x16')]);return _0x31896f(_0x13837e['error'][_0x4f98('0x16')]);}else{logger['info'](_0x4f98('0x10'),_0x3e0e57,_0x4f98('0x12'));_0x31896f(_0x13837e['result'][_0x4f98('0x16')]);}})[_0x4f98('0x17')](function(_0x49061f){logger[_0x4f98('0x14')](_0x4f98('0x10'),_0x3e0e57,_0x49061f);_0x1c0a35(_0x49061f);});});}exports[_0x4f98('0x18')]=function(_0x4e252){var _0x3114e0=this;return new Promise(function(_0x169c89,_0x1e5a92){return db[_0x4f98('0x19')][_0x4f98('0x1a')](_0x4e252[_0x4f98('0x1b')],{'raw':_0x4e252[_0x4f98('0x1c')]?_0x4e252[_0x4f98('0x1c')][_0x4f98('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e252[_0x4f98('0x1c')]?_0x4e252[_0x4f98('0x1c')][_0x4f98('0x1e')]||null:null,'attributes':_0x4e252['options']?_0x4e252[_0x4f98('0x1c')][_0x4f98('0x1f')]||null:null,'limit':_0x4e252[_0x4f98('0x1c')]?_0x4e252['options'][_0x4f98('0x20')]||null:null})['then'](function(_0x486330){logger[_0x4f98('0xf')](_0x4f98('0x18'),_0x4e252);logger['debug']('UpdateMailInteraction',_0x4e252,JSON['stringify'](_0x486330));_0x169c89(_0x486330);})[_0x4f98('0x17')](function(_0x170bb2){logger[_0x4f98('0x14')](_0x4f98('0x18'),_0x170bb2['message'],_0x4e252);_0x1e5a92(_0x3114e0['error'](0x1f4,_0x170bb2[_0x4f98('0x16')]));});});};exports[_0x4f98('0x21')]=function(_0xcd5f20){return new Promise(function(_0x29ec6d,_0x5b0d2a){return db[_0x4f98('0x19')]['find']({'where':_0xcd5f20[_0x4f98('0x1c')]?_0xcd5f20[_0x4f98('0x1c')][_0x4f98('0x1e')]||null:null})[_0x4f98('0xe')](function(_0x540420){if(_0x540420){return _0x540420[_0x4f98('0x22')](_0xcd5f20[_0x4f98('0x1b')][_0x4f98('0x23')],_[_0x4f98('0x24')](_0xcd5f20[_0x4f98('0x1b')],[_0x4f98('0x23'),'id'])||{});}})[_0x4f98('0x25')](function(_0x347df0){logger[_0x4f98('0xf')](_0x4f98('0x26'),_0xcd5f20);logger[_0x4f98('0x11')]('AddTags',_0xcd5f20,JSON[_0x4f98('0x13')](_0x347df0));_0x29ec6d(_0x347df0);})[_0x4f98('0x17')](function(_0x1e9ff6){logger[_0x4f98('0x14')]('AddTags',_0x1e9ff6[_0x4f98('0x16')],_0xcd5f20);_0x5b0d2a(_this[_0x4f98('0x14')](0x1f4,_0x1e9ff6['message']));});});}; \ No newline at end of file +var _0xc967=['./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','MailInteraction','update','options','raw','attributes','limit','AddTagsToMailInteraction','find','where','addTags','body','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc967,0x1b3));var _0x7c96=function(_0x1493b9,_0x4eb7db){_0x1493b9=_0x1493b9-0x0;var _0x11514f=_0xc967[_0x1493b9];return _0x11514f;};'use strict';var _=require(_0x7c96('0x0'));var util=require(_0x7c96('0x1'));var moment=require(_0x7c96('0x2'));var BPromise=require(_0x7c96('0x3'));var rs=require(_0x7c96('0x4'));var fs=require('fs');var Redis=require(_0x7c96('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7c96('0x6'))(_0x7c96('0x7'));var config=require(_0x7c96('0x8'));var jayson=require(_0x7c96('0x9'));var client=jayson[_0x7c96('0xa')][_0x7c96('0xb')]({'port':0x232a});config[_0x7c96('0xc')]=_[_0x7c96('0xd')](config['redis'],{'host':_0x7c96('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c96('0xc')]));require(_0x7c96('0xf'))[_0x7c96('0x10')](socket);function respondWithRpcPromise(_0x27a102,_0x2d9d54,_0x5223dd){return new BPromise(function(_0x458ec4,_0x6aea79){return client[_0x7c96('0x11')](_0x27a102,_0x5223dd)[_0x7c96('0x12')](function(_0x5cb3c6){logger[_0x7c96('0x13')](_0x7c96('0x14'),_0x2d9d54,_0x7c96('0x15'));logger[_0x7c96('0x16')](_0x7c96('0x17'),_0x2d9d54,_0x7c96('0x15'),JSON[_0x7c96('0x18')](_0x5cb3c6));if(_0x5cb3c6[_0x7c96('0x19')]){if(_0x5cb3c6[_0x7c96('0x19')][_0x7c96('0x1a')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x2d9d54,_0x5cb3c6[_0x7c96('0x19')][_0x7c96('0x1b')]);return _0x6aea79(_0x5cb3c6['error'][_0x7c96('0x1b')]);}logger['error'](_0x7c96('0x14'),_0x2d9d54,_0x5cb3c6['error'][_0x7c96('0x1b')]);return _0x458ec4(_0x5cb3c6[_0x7c96('0x19')]['message']);}else{logger['info'](_0x7c96('0x14'),_0x2d9d54,_0x7c96('0x15'));_0x458ec4(_0x5cb3c6['result'][_0x7c96('0x1b')]);}})[_0x7c96('0x1c')](function(_0x5dc324){logger[_0x7c96('0x19')]('MailInteraction,\x20%s,\x20%s',_0x2d9d54,_0x5dc324);_0x6aea79(_0x5dc324);});});}exports[_0x7c96('0x1d')]=function(_0xbb831e){var _0x1d7c53=this;return new Promise(function(_0x2f361e,_0x48091e){return db[_0x7c96('0x1e')][_0x7c96('0x1f')](_0xbb831e['body'],{'raw':_0xbb831e[_0x7c96('0x20')]?_0xbb831e[_0x7c96('0x20')][_0x7c96('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbb831e[_0x7c96('0x20')]?_0xbb831e[_0x7c96('0x20')]['where']||null:null,'attributes':_0xbb831e[_0x7c96('0x20')]?_0xbb831e['options'][_0x7c96('0x22')]||null:null,'limit':_0xbb831e[_0x7c96('0x20')]?_0xbb831e[_0x7c96('0x20')][_0x7c96('0x23')]||null:null})[_0x7c96('0x12')](function(_0x45c75d){logger[_0x7c96('0x13')](_0x7c96('0x1d'),_0xbb831e);logger['debug'](_0x7c96('0x1d'),_0xbb831e,JSON[_0x7c96('0x18')](_0x45c75d));_0x2f361e(_0x45c75d);})['catch'](function(_0x2ade5b){logger[_0x7c96('0x19')](_0x7c96('0x1d'),_0x2ade5b[_0x7c96('0x1b')],_0xbb831e);_0x48091e(_0x1d7c53[_0x7c96('0x19')](0x1f4,_0x2ade5b[_0x7c96('0x1b')]));});});};exports[_0x7c96('0x24')]=function(_0x3f0a85){return new Promise(function(_0x5b7a83,_0x1ca450){return db[_0x7c96('0x1e')][_0x7c96('0x25')]({'where':_0x3f0a85[_0x7c96('0x20')]?_0x3f0a85[_0x7c96('0x20')][_0x7c96('0x26')]||null:null})[_0x7c96('0x12')](function(_0x9c6702){if(_0x9c6702){return _0x9c6702[_0x7c96('0x27')](_0x3f0a85[_0x7c96('0x28')]['ids'],_[_0x7c96('0x29')](_0x3f0a85[_0x7c96('0x28')],[_0x7c96('0x2a'),'id'])||{});}})[_0x7c96('0x2b')](function(_0x163154){logger[_0x7c96('0x13')](_0x7c96('0x2c'),_0x3f0a85);logger[_0x7c96('0x16')]('AddTags',_0x3f0a85,JSON[_0x7c96('0x18')](_0x163154));_0x5b7a83(_0x163154);})[_0x7c96('0x1c')](function(_0x22584e){logger[_0x7c96('0x19')](_0x7c96('0x2c'),_0x22584e[_0x7c96('0x1b')],_0x3f0a85);_0x1ca450(_this[_0x7c96('0x19')](0x1f4,_0x22584e[_0x7c96('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index ea1fc1c..d7cb1cb 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 _0x1e12=['remove','update','emit','removeListener','mailInteraction:','./mailInteraction.events'];(function(_0x3aef3b,_0x17a660){var _0x439021=function(_0x27f87d){while(--_0x27f87d){_0x3aef3b['push'](_0x3aef3b['shift']());}};_0x439021(++_0x17a660);}(_0x1e12,0x131));var _0x21e1=function(_0x3e0735,_0x1e221b){_0x3e0735=_0x3e0735-0x0;var _0x1391f7=_0x1e12[_0x3e0735];return _0x1391f7;};'use strict';var MailInteractionEvents=require(_0x21e1('0x0'));var events=['save',_0x21e1('0x1'),_0x21e1('0x2')];function createListener(_0x42a55b,_0x5e569a){return function(_0x1e9959){_0x5e569a[_0x21e1('0x3')](_0x42a55b,_0x1e9959);};}function removeListener(_0x2bb78e,_0x53f811){return function(){MailInteractionEvents[_0x21e1('0x4')](_0x2bb78e,_0x53f811);};}exports['register']=function(_0x139d43){for(var _0x5d8c9e=0x0,_0x3609f5=events['length'];_0x5d8c9e<_0x3609f5;_0x5d8c9e++){var _0x83c382=events[_0x5d8c9e];var _0x5b8815=createListener(_0x21e1('0x5')+_0x83c382,_0x139d43);MailInteractionEvents['on'](_0x83c382,_0x5b8815);}}; \ No newline at end of file +var _0xa752=['length','mailInteraction:','save','remove','update','emit','removeListener','register'];(function(_0x4b6792,_0x1098bb){var _0x406802=function(_0x56eef0){while(--_0x56eef0){_0x4b6792['push'](_0x4b6792['shift']());}};_0x406802(++_0x1098bb);}(_0xa752,0xa2));var _0x2a75=function(_0x39b646,_0x50965d){_0x39b646=_0x39b646-0x0;var _0x39db3c=_0xa752[_0x39b646];return _0x39db3c;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x2a75('0x0'),_0x2a75('0x1'),_0x2a75('0x2')];function createListener(_0x44d780,_0x5bd2d5){return function(_0x19c5f8){_0x5bd2d5[_0x2a75('0x3')](_0x44d780,_0x19c5f8);};}function removeListener(_0x113d9a,_0x5578ce){return function(){MailInteractionEvents[_0x2a75('0x4')](_0x113d9a,_0x5578ce);};}exports[_0x2a75('0x5')]=function(_0x5d6357){for(var _0x16738f=0x0,_0x13eee9=events[_0x2a75('0x6')];_0x16738f<_0x13eee9;_0x16738f++){var _0x1b4202=events[_0x16738f];var _0x41c258=createListener(_0x2a75('0x7')+_0x1b4202,_0x5d6357);MailInteractionEvents['on'](_0x1b4202,_0x41c258);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index 72b15f0..982f56e 100644 --- a/server/api/mailInteractionHasTag/index.js +++ b/server/api/mailInteractionHasTag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3274=['express','../../components/auth/service','./mailInteractionHasTag.controller','/describe','isAuthenticated','describe','exports'];(function(_0x189978,_0x48d117){var _0x1a7dc8=function(_0x4a5df3){while(--_0x4a5df3){_0x189978['push'](_0x189978['shift']());}};_0x1a7dc8(++_0x48d117);}(_0x3274,0x134));var _0x4327=function(_0x3cabaa,_0xc09d02){_0x3cabaa=_0x3cabaa-0x0;var _0xe69a93=_0x3274[_0x3cabaa];return _0xe69a93;};'use strict';var express=require(_0x4327('0x0'));var router=express['Router']();var auth=require(_0x4327('0x1'));var controller=require(_0x4327('0x2'));router['get'](_0x4327('0x3'),auth[_0x4327('0x4')](),controller[_0x4327('0x5')]);module[_0x4327('0x6')]=router; \ No newline at end of file +var _0xffb1=['isAuthenticated','describe','exports','express','Router','../../components/auth/service','./mailInteractionHasTag.controller','get','/describe'];(function(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0xffb1,0x93));var _0x1ffb=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0xffb1[_0x954b3a];return _0x3a313e;};'use strict';var express=require(_0x1ffb('0x0'));var router=express[_0x1ffb('0x1')]();var auth=require(_0x1ffb('0x2'));var controller=require(_0x1ffb('0x3'));router[_0x1ffb('0x4')](_0x1ffb('0x5'),auth[_0x1ffb('0x6')](),controller[_0x1ffb('0x7')]);module[_0x1ffb('0x8')]=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index d100f37..975636e 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x146689,_0x46f515){var _0x286567=function(_0x278e6d){while(--_0x278e6d){_0x146689['push'](_0x146689['shift']());}};_0x286567(++_0x46f515);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file +var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x21c553,_0xf0ec7c){var _0x4c8689=function(_0x15d19e){while(--_0x15d19e){_0x21c553['push'](_0x21c553['shift']());}};_0x4c8689(++_0xf0ec7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.js index ab0d7c9..e54ebc8 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76c5=['INTEGER','sequelize','exports'];(function(_0x4ca871,_0x4cc9bf){var _0x139b5c=function(_0x5d2f3e){while(--_0x5d2f3e){_0x4ca871['push'](_0x4ca871['shift']());}};_0x139b5c(++_0x4cc9bf);}(_0x76c5,0x160));var _0x576c=function(_0x3e5bc8,_0x457d89){_0x3e5bc8=_0x3e5bc8-0x0;var _0xfd84bc=_0x76c5[_0x3e5bc8];return _0xfd84bc;};'use strict';var Sequelize=require(_0x576c('0x0'));module[_0x576c('0x1')]={'MailInteractionId':{'type':Sequelize[_0x576c('0x2')],'primaryKey':!![]},'TagId':{'type':Sequelize['INTEGER'],'defaultValue':null}}; \ No newline at end of file +var _0x8a86=['exports','INTEGER'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8a86,0xd6));var _0x68a8=function(_0x5267d7,_0x576a6e){_0x5267d7=_0x5267d7-0x0;var _0x583d1f=_0x8a86[_0x5267d7];return _0x583d1f;};'use strict';var Sequelize=require('sequelize');module[_0x68a8('0x0')]={'MailInteractionId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'TagId':{'type':Sequelize[_0x68a8('0x1')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js index ab7468e..8467d04 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ead=['define','MailInteractionHasTag','mail_interaction_has_tags','exports'];(function(_0x2d9247,_0x2a2022){var _0x53a817=function(_0x50fbda){while(--_0x50fbda){_0x2d9247['push'](_0x2d9247['shift']());}};_0x53a817(++_0x2a2022);}(_0x4ead,0x183));var _0xd4ea=function(_0x40911a,_0x55ec99){_0x40911a=_0x40911a-0x0;var _0x27e8e3=_0x4ead[_0x40911a];return _0x27e8e3;};'use strict';var attributes=require('./mailInteractionHasTag');module[_0xd4ea('0x0')]=function(_0x27789a){return _0x27789a[_0xd4ea('0x1')](_0xd4ea('0x2'),attributes,{'tableName':_0xd4ea('0x3'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8952=['mail_interaction_has_tags','./mailInteractionHasTag','exports'];(function(_0x3f4098,_0x3365b2){var _0x3d5d0c=function(_0x3a7cdb){while(--_0x3a7cdb){_0x3f4098['push'](_0x3f4098['shift']());}};_0x3d5d0c(++_0x3365b2);}(_0x8952,0x1e4));var _0x2895=function(_0x51570a,_0x372b30){_0x51570a=_0x51570a-0x0;var _0x42c15a=_0x8952[_0x51570a];return _0x42c15a;};'use strict';var attributes=require(_0x2895('0x0'));module[_0x2895('0x1')]=function(_0x108fb4){return _0x108fb4['define']('MailInteractionHasTag',attributes,{'tableName':_0x2895('0x2'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index b9b7fd7..5562277 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 _0xdc65=['/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','download','post','tracked','mailmessage:create','create','update','put','/:id/accept','accept'];(function(_0x797bf3,_0x3fcc11){var _0xc17a03=function(_0x4a3097){while(--_0x4a3097){_0x797bf3['push'](_0x797bf3['shift']());}};_0xc17a03(++_0x3fcc11);}(_0xdc65,0x79));var _0x5dc6=function(_0x2a17ac,_0x15cf1d){_0x2a17ac=_0x2a17ac-0x0;var _0x5cd932=_0xdc65[_0x2a17ac];return _0x5cd932;};'use strict';var multer=require(_0x5dc6('0x0'));var util=require(_0x5dc6('0x1'));var path=require(_0x5dc6('0x2'));var timeout=require(_0x5dc6('0x3'));var express=require('express');var router=express[_0x5dc6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5dc6('0x5'));var interaction=require(_0x5dc6('0x6'));var config=require(_0x5dc6('0x7'));var controller=require(_0x5dc6('0x8'));router[_0x5dc6('0x9')]('/',auth[_0x5dc6('0xa')](),controller[_0x5dc6('0xb')]);router[_0x5dc6('0x9')](_0x5dc6('0xc'),auth['isAuthenticated'](),controller[_0x5dc6('0xd')]);router[_0x5dc6('0x9')](_0x5dc6('0xe'),auth[_0x5dc6('0xa')](),controller['show']);router[_0x5dc6('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x5dc6('0xf')]);router[_0x5dc6('0x10')]('/',auth['isAuthenticated'](),interaction[_0x5dc6('0x11')]('mail',_0x5dc6('0x12')),controller[_0x5dc6('0x13')]);router['put'](_0x5dc6('0xe'),auth[_0x5dc6('0xa')](),controller[_0x5dc6('0x14')]);router[_0x5dc6('0x15')](_0x5dc6('0x16'),auth['isAuthenticated'](),controller[_0x5dc6('0x17')]);router[_0x5dc6('0x15')](_0x5dc6('0x18'),auth[_0x5dc6('0xa')](),controller[_0x5dc6('0x19')]);router[_0x5dc6('0x1a')](_0x5dc6('0xe'),auth[_0x5dc6('0xa')](),controller[_0x5dc6('0x1b')]);module[_0x5dc6('0x1c')]=router; \ No newline at end of file +var _0xc0d6=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','describe','/:id','/:id/download','download','post','mailmessage:create','create','put','accept','reject'];(function(_0x280d7e,_0x17923f){var _0x1bcbad=function(_0x3ada31){while(--_0x3ada31){_0x280d7e['push'](_0x280d7e['shift']());}};_0x1bcbad(++_0x17923f);}(_0xc0d6,0x1ce));var _0x6c0d=function(_0x32b437,_0x4bfd6e){_0x32b437=_0x32b437-0x0;var _0x19065f=_0xc0d6[_0x32b437];return _0x19065f;};'use strict';var multer=require('multer');var util=require(_0x6c0d('0x0'));var path=require('path');var timeout=require(_0x6c0d('0x1'));var express=require(_0x6c0d('0x2'));var router=express[_0x6c0d('0x3')]();var fs_extra=require(_0x6c0d('0x4'));var auth=require(_0x6c0d('0x5'));var interaction=require(_0x6c0d('0x6'));var config=require(_0x6c0d('0x7'));var controller=require(_0x6c0d('0x8'));router[_0x6c0d('0x9')]('/',auth[_0x6c0d('0xa')](),controller['index']);router['get']('/describe',auth[_0x6c0d('0xa')](),controller[_0x6c0d('0xb')]);router[_0x6c0d('0x9')](_0x6c0d('0xc'),auth[_0x6c0d('0xa')](),controller['show']);router[_0x6c0d('0x9')](_0x6c0d('0xd'),auth['isAuthenticated'](),controller[_0x6c0d('0xe')]);router[_0x6c0d('0xf')]('/',auth['isAuthenticated'](),interaction['tracked']('mail',_0x6c0d('0x10')),controller[_0x6c0d('0x11')]);router[_0x6c0d('0x12')](_0x6c0d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x6c0d('0x12')]('/:id/accept',auth[_0x6c0d('0xa')](),controller[_0x6c0d('0x13')]);router[_0x6c0d('0x12')]('/:id/reject',auth[_0x6c0d('0xa')](),controller[_0x6c0d('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6c0d('0x15')]);module[_0x6c0d('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 269638c..132091e 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 _0x799f=['lodash','TEXT','long','medium','BOOLEAN','out','STRING','DATE','INTEGER','ENUM','Email','Chat'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x799f,0xd8));var _0xf799=function(_0x502815,_0x34c00e){_0x502815=_0x502815-0x0;var _0x101669=_0x799f[_0x502815];return _0x101669;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf799('0x0'));module['exports']={'body':{'type':Sequelize[_0xf799('0x1')](_0xf799('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf799('0x1')](_0xf799('0x3'))},'read':{'type':Sequelize[_0xf799('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf799('0x5')),'defaultValue':_0xf799('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf799('0x6')](0x1fe)},'from':{'type':Sequelize[_0xf799('0x6')]},'to':{'type':Sequelize[_0xf799('0x1')](_0xf799('0x2'))},'cc':{'type':Sequelize[_0xf799('0x1')]('long')},'bcc':{'type':Sequelize[_0xf799('0x1')](_0xf799('0x2'))},'subject':{'type':Sequelize[_0xf799('0x1')]},'sentAt':{'type':Sequelize[_0xf799('0x7')]},'attach':{'type':Sequelize[_0xf799('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf799('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xf799('0x7')]},'originTo':{'type':Sequelize['TEXT'](_0xf799('0x2'))},'originCc':{'type':Sequelize[_0xf799('0x1')](_0xf799('0x2'))},'originChannel':{'type':Sequelize[_0xf799('0x9')](_0xf799('0xa'),_0xf799('0xb')),'defaultValue':_0xf799('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x56b1=['ENUM','out','STRING','DATE','Email','Chat','lodash','exports','TEXT','long','BOOLEAN'];(function(_0x2a13c7,_0xbbe103){var _0x4c9f2d=function(_0x1f2370){while(--_0x1f2370){_0x2a13c7['push'](_0x2a13c7['shift']());}};_0x4c9f2d(++_0xbbe103);}(_0x56b1,0x8a));var _0x156b=function(_0x47685c,_0x3408ad){_0x47685c=_0x47685c-0x0;var _0x8ce9c9=_0x56b1[_0x47685c];return _0x8ce9c9;};'use strict';var Sequelize=require('sequelize');var _=require(_0x156b('0x0'));module[_0x156b('0x1')]={'body':{'type':Sequelize[_0x156b('0x2')](_0x156b('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0x156b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x156b('0x5')]('in',_0x156b('0x6')),'defaultValue':_0x156b('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x156b('0x7')](0x1fe)},'from':{'type':Sequelize[_0x156b('0x7')]},'to':{'type':Sequelize[_0x156b('0x2')](_0x156b('0x3'))},'cc':{'type':Sequelize[_0x156b('0x2')](_0x156b('0x3'))},'bcc':{'type':Sequelize[_0x156b('0x2')]('long')},'subject':{'type':Sequelize[_0x156b('0x2')]},'sentAt':{'type':Sequelize[_0x156b('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x156b('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x156b('0x8')]},'originTo':{'type':Sequelize[_0x156b('0x2')](_0x156b('0x3'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x156b('0x5')](_0x156b('0x9'),_0x156b('0xa')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index ec8c761..b07e359 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 _0xea47=['include','findAll','rows','show','params','includeAll','options','find','body','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','basename','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','format','UserId','user','MailInteraction','MailInteractionId','isNil','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','agent','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','RejectMessage','rejectMessage','SELECT','User','internal','download','unix','toString','server','files','message-%s.eml','from','bcc','Attachment','Attachments','subject','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','path','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','offset','limit','undefined','count','set','Content-Range','json','update','destroy','end','sendStatus','send','map','rawAttributes','fieldName','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','MailMessage'];(function(_0x2923fc,_0x466a44){var _0x1bdb6c=function(_0x394f83){while(--_0x394f83){_0x2923fc['push'](_0x2923fc['shift']());}};_0x1bdb6c(++_0x466a44);}(_0xea47,0xfc));var _0x7ea4=function(_0x27c0f9,_0x46ccb6){_0x27c0f9=_0x27c0f9-0x0;var _0x10064b=_0xea47[_0x27c0f9];return _0x10064b;};'use strict';var emlformat=require(_0x7ea4('0x0'));var moment=require(_0x7ea4('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x7ea4('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x7ea4('0x3'));var htmlToText=require('html-to-text');var qs=require(_0x7ea4('0x4'));var logger=require(_0x7ea4('0x5'))(_0x7ea4('0x6'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0x7ea4('0x7'));var db=require(_0x7ea4('0x8'))['db'];config['redis']=_[_0x7ea4('0x9')](config[_0x7ea4('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var htmlEntities=require(_0x7ea4('0xb'));require(_0x7ea4('0xc'))[_0x7ea4('0xd')](socket);var jayson=require(_0x7ea4('0xe'));var client=jayson[_0x7ea4('0xf')][_0x7ea4('0x10')]({'port':0x232c});var client9003=jayson['client'][_0x7ea4('0x10')]({'port':0x232b});var client9002=jayson[_0x7ea4('0xf')][_0x7ea4('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x378018,_0x4284d6,_0x18e214,_0x585ac7){return new BPromise(function(_0x5033e2,_0x1bd8cf){var _0x1761e4=_0x585ac7||client;return _0x1761e4[_0x7ea4('0x11')](_0x378018,_0x18e214)[_0x7ea4('0x12')](function(_0x1c9d0e){logger['info'](_0x7ea4('0x13'),_0x4284d6,_0x7ea4('0x14'));logger['debug'](_0x7ea4('0x15'),_0x4284d6,_0x7ea4('0x14'),JSON[_0x7ea4('0x16')](_0x1c9d0e));if(_0x1c9d0e[_0x7ea4('0x17')]){if(_0x1c9d0e[_0x7ea4('0x17')][_0x7ea4('0x18')]===0x1f4){logger['error'](_0x7ea4('0x13'),_0x4284d6,_0x1c9d0e[_0x7ea4('0x17')]['message']);return _0x1bd8cf(_0x1c9d0e[_0x7ea4('0x17')][_0x7ea4('0x19')]);}logger['error'](_0x7ea4('0x13'),_0x4284d6,_0x1c9d0e[_0x7ea4('0x17')][_0x7ea4('0x19')]);return _0x5033e2(_0x1c9d0e[_0x7ea4('0x17')][_0x7ea4('0x19')]);}else{logger[_0x7ea4('0x1a')]('MailMessage,\x20%s,\x20%s',_0x4284d6,_0x7ea4('0x14'));_0x5033e2(_0x1c9d0e['result'][_0x7ea4('0x19')]);}})[_0x7ea4('0x1b')](function(_0x46449c){logger['error']('MailMessage,\x20%s,\x20%s',_0x4284d6,_0x46449c);_0x1bd8cf(_0x46449c);});});}function respondWithResult(_0x10ace2,_0x5f01e0){_0x5f01e0=_0x5f01e0||0xc8;return function(_0x540d91){if(_0x540d91){return _0x10ace2[_0x7ea4('0x1c')](_0x5f01e0)['json'](_0x540d91);}};}function respondWithFilteredResult(_0x3356c0,_0x4030fa){return function(_0x59fa98){if(_0x59fa98){var _0x4f73a3=typeof _0x4030fa[_0x7ea4('0x1d')]==='undefined'&&typeof _0x4030fa[_0x7ea4('0x1e')]===_0x7ea4('0x1f');var _0x3f3c71=_0x59fa98[_0x7ea4('0x20')];var _0x977085=_0x4f73a3?0x0:_0x4030fa[_0x7ea4('0x1d')];var _0x1a1fd4=_0x4f73a3?_0x59fa98[_0x7ea4('0x20')]:_0x4030fa[_0x7ea4('0x1d')]+_0x4030fa[_0x7ea4('0x1e')];var _0x17addf;if(_0x1a1fd4>=_0x3f3c71){_0x1a1fd4=_0x3f3c71;_0x17addf=0xc8;}else{_0x17addf=0xce;}_0x3356c0['status'](_0x17addf);return _0x3356c0[_0x7ea4('0x21')](_0x7ea4('0x22'),_0x977085+'-'+_0x1a1fd4+'/'+_0x3f3c71)[_0x7ea4('0x23')](_0x59fa98);}return null;};}function saveUpdates(_0x2dd769){return function(_0x16732a){if(_0x16732a){return _0x16732a[_0x7ea4('0x24')](_0x2dd769)[_0x7ea4('0x12')](function(_0x347f5f){return _0x347f5f;});}return null;};}function removeEntity(_0x7c5322){return function(_0x47d0d6){if(_0x47d0d6){return _0x47d0d6[_0x7ea4('0x25')]()[_0x7ea4('0x12')](function(){_0x7c5322[_0x7ea4('0x1c')](0xcc)[_0x7ea4('0x26')]();});}};}function handleEntityNotFound(_0x28035e){return function(_0x3831ec){if(!_0x3831ec){_0x28035e[_0x7ea4('0x27')](0x194);}return _0x3831ec;};}function handleError(_0x549ac3,_0x257454){_0x257454=_0x257454||0x1f4;return function(_0x1efcc0){logger[_0x7ea4('0x17')](_0x1efcc0['stack']);if(_0x1efcc0['name']){delete _0x1efcc0['name'];}_0x549ac3[_0x7ea4('0x1c')](_0x257454)[_0x7ea4('0x28')](_0x1efcc0);};}exports['index']=function(_0x5b9fa8,_0x3fb212){var _0x360883={},_0x4a951b={},_0xabee96={'count':0x0,'rows':[]};var _0x392dfb=_[_0x7ea4('0x29')](db['MailMessage'][_0x7ea4('0x2a')],function(_0x3c1e5f){return{'name':_0x3c1e5f[_0x7ea4('0x2b')],'type':_0x3c1e5f['type']['key']};});_0x4a951b[_0x7ea4('0x2c')]=_[_0x7ea4('0x29')](_0x392dfb,_0x7ea4('0x2d'));_0x4a951b['query']=_[_0x7ea4('0x2e')](_0x5b9fa8[_0x7ea4('0x2f')]);_0x4a951b['filters']=_[_0x7ea4('0x30')](_0x4a951b[_0x7ea4('0x2c')],_0x4a951b[_0x7ea4('0x2f')]);_0x360883[_0x7ea4('0x31')]=_[_0x7ea4('0x30')](_0x4a951b[_0x7ea4('0x2c')],qs[_0x7ea4('0x32')](_0x5b9fa8['query'][_0x7ea4('0x32')]));_0x360883[_0x7ea4('0x31')]=_0x360883[_0x7ea4('0x31')][_0x7ea4('0x33')]?_0x360883['attributes']:_0x4a951b[_0x7ea4('0x2c')];if(!_0x5b9fa8[_0x7ea4('0x2f')][_0x7ea4('0x34')](_0x7ea4('0x35'))){_0x360883['limit']=qs[_0x7ea4('0x1e')](_0x5b9fa8['query'][_0x7ea4('0x1e')]);_0x360883[_0x7ea4('0x1d')]=qs[_0x7ea4('0x1d')](_0x5b9fa8[_0x7ea4('0x2f')][_0x7ea4('0x1d')]);}_0x360883[_0x7ea4('0x36')]=qs[_0x7ea4('0x37')](_0x5b9fa8[_0x7ea4('0x2f')][_0x7ea4('0x37')]);_0x360883[_0x7ea4('0x38')]=qs[_0x7ea4('0x39')](_[_0x7ea4('0x3a')](_0x5b9fa8['query'],_0x4a951b[_0x7ea4('0x39')]),_0x392dfb);if(_0x5b9fa8[_0x7ea4('0x2f')]['filter']){_0x360883[_0x7ea4('0x38')]=_[_0x7ea4('0x3b')](_0x360883[_0x7ea4('0x38')],{'$or':_[_0x7ea4('0x29')](_0x392dfb,function(_0x206acc){if(_0x206acc[_0x7ea4('0x3c')]!==_0x7ea4('0x3d')){var _0x103743={};_0x103743[_0x206acc[_0x7ea4('0x2d')]]={'$like':'%'+_0x5b9fa8[_0x7ea4('0x2f')][_0x7ea4('0x3e')]+'%'};return _0x103743;}})});}_0x360883=_[_0x7ea4('0x3b')]({},_0x360883,_0x5b9fa8['options']);var _0x146744={'where':_0x360883[_0x7ea4('0x38')]};return db[_0x7ea4('0x3f')][_0x7ea4('0x20')](_0x146744)['then'](function(_0x1b459b){_0xabee96[_0x7ea4('0x20')]=_0x1b459b;if(_0x5b9fa8[_0x7ea4('0x2f')]['includeAll']){_0x360883[_0x7ea4('0x40')]=[{'all':!![]}];}return db[_0x7ea4('0x3f')][_0x7ea4('0x41')](_0x360883);})[_0x7ea4('0x12')](function(_0x27195c){_0xabee96[_0x7ea4('0x42')]=_0x27195c;return _0xabee96;})[_0x7ea4('0x12')](respondWithFilteredResult(_0x3fb212,_0x360883))[_0x7ea4('0x1b')](handleError(_0x3fb212,null));};exports[_0x7ea4('0x43')]=function(_0x4cf7b5,_0x4cc180){var _0x45bd84={'raw':!![],'where':{'id':_0x4cf7b5[_0x7ea4('0x44')]['id']}},_0x3ab112={};_0x3ab112[_0x7ea4('0x2c')]=_['keys'](db[_0x7ea4('0x3f')][_0x7ea4('0x2a')]);_0x3ab112[_0x7ea4('0x2f')]=_[_0x7ea4('0x2e')](_0x4cf7b5[_0x7ea4('0x2f')]);_0x3ab112[_0x7ea4('0x39')]=_[_0x7ea4('0x30')](_0x3ab112[_0x7ea4('0x2c')],_0x3ab112[_0x7ea4('0x2f')]);_0x45bd84['attributes']=_[_0x7ea4('0x30')](_0x3ab112[_0x7ea4('0x2c')],qs[_0x7ea4('0x32')](_0x4cf7b5[_0x7ea4('0x2f')][_0x7ea4('0x32')]));_0x45bd84['attributes']=_0x45bd84[_0x7ea4('0x31')]['length']?_0x45bd84[_0x7ea4('0x31')]:_0x3ab112[_0x7ea4('0x2c')];if(_0x4cf7b5[_0x7ea4('0x2f')][_0x7ea4('0x45')]){_0x45bd84['include']=[{'all':!![]}];}_0x45bd84=_[_0x7ea4('0x3b')]({},_0x45bd84,_0x4cf7b5[_0x7ea4('0x46')]);return db['MailMessage'][_0x7ea4('0x47')](_0x45bd84)[_0x7ea4('0x12')](handleEntityNotFound(_0x4cc180,null))[_0x7ea4('0x12')](respondWithResult(_0x4cc180,null))[_0x7ea4('0x1b')](handleError(_0x4cc180,null));};exports[_0x7ea4('0x24')]=function(_0x48f367,_0x8b72bb){if(_0x48f367[_0x7ea4('0x48')]['id']){delete _0x48f367[_0x7ea4('0x48')]['id'];}return db['MailMessage'][_0x7ea4('0x47')]({'where':{'id':_0x48f367['params']['id']}})[_0x7ea4('0x12')](handleEntityNotFound(_0x8b72bb,null))[_0x7ea4('0x12')](saveUpdates(_0x48f367[_0x7ea4('0x48')],null))[_0x7ea4('0x12')](respondWithResult(_0x8b72bb,null))['catch'](handleError(_0x8b72bb,null));};exports['destroy']=function(_0x4316ba,_0x12f56e){return db[_0x7ea4('0x3f')][_0x7ea4('0x47')]({'where':{'id':_0x4316ba['params']['id']}})[_0x7ea4('0x12')](handleEntityNotFound(_0x12f56e,null))['then'](removeEntity(_0x12f56e,null))[_0x7ea4('0x1b')](handleError(_0x12f56e,null));};exports[_0x7ea4('0x49')]=function(_0x3104bb,_0xc71357){return db[_0x7ea4('0x3f')]['describe']()[_0x7ea4('0x12')](respondWithResult(_0xc71357,null))[_0x7ea4('0x1b')](handleError(_0xc71357,null));};exports['create']=function(_0x151068,_0x3bbb90){return db[_0x7ea4('0x3f')][_0x7ea4('0x4a')](_0x151068[_0x7ea4('0x48')])['then'](function(_0x3039c5){if(_0x3039c5){if(_0x3039c5[_0x7ea4('0x4b')]===_0x7ea4('0x4c')&&!_0x3039c5[_0x7ea4('0x4d')]){var _0x3469d4,_0x158484,_0x25b7f2;if(_0x151068[_0x7ea4('0x48')]['to']){_0x158484=_0x151068[_0x7ea4('0x48')]['to']['split'](',')[0x0];}return db[_0x7ea4('0x4e')][_0x7ea4('0x4f')]({'where':{'id':_0x3039c5[_0x7ea4('0x50')]},'include':[{'model':db[_0x7ea4('0x51')],'as':_0x7ea4('0x52'),'include':[{'model':db[_0x7ea4('0x53')],'as':'Contacts','where':{'email':_0x158484},'limit':0x1,'order':[[_0x7ea4('0x54'),_0x7ea4('0x55')]]}]},{'model':db[_0x7ea4('0x56')],'as':_0x7ea4('0x57'),'raw':!![],'include':[{'model':db[_0x7ea4('0x58')],'as':_0x7ea4('0x58'),'raw':!![]}]}]})['then'](function(_0x3b9337){_0x3469d4=_0x3b9337;if(!_0x3469d4||!_0x3469d4[_0x7ea4('0x57')])return;var _0x15ad15=_0x3469d4[_0x7ea4('0x59')]();if(_0x151068[_0x7ea4('0x48')][_0x7ea4('0x5a')]&&_0x151068[_0x7ea4('0x48')][_0x7ea4('0x5a')]['length']){for(var _0x239847=0x0;_0x239847<_0x151068[_0x7ea4('0x48')]['attachments'][_0x7ea4('0x33')];_0x239847+=0x1){_0x151068[_0x7ea4('0x48')]['attachments'][_0x239847]={'filename':_0x151068[_0x7ea4('0x48')][_0x7ea4('0x5a')][_0x239847][_0x7ea4('0x2d')],'path':path[_0x7ea4('0x5b')](config[_0x7ea4('0x5c')],'server/files/attachments',_0x151068[_0x7ea4('0x48')]['attachments'][_0x239847][_0x7ea4('0x5d')])};}}_0x25b7f2={'account':_0x15ad15,'message':_0x151068['body']};return;})[_0x7ea4('0x12')](function(){if(_0x3469d4[_0x7ea4('0x52')]){if(_0x3469d4[_0x7ea4('0x52')]['Contacts'][_0x7ea4('0x33')]){return _0x3469d4[_0x7ea4('0x52')]['Contacts'][0x0];}else{return db[_0x7ea4('0x53')][_0x7ea4('0x4a')](_[_0x7ea4('0x9')](_0x151068[_0x7ea4('0x48')],{'firstName':_0x151068[_0x7ea4('0x48')]['to'],'email':_0x151068[_0x7ea4('0x48')]['to'],'phone':_0x151068[_0x7ea4('0x48')]['to'],'ListId':_0x3469d4['ListId']}));}}else{throw new Error(_0x7ea4('0x5e'));}})['then'](function(){if(_0x25b7f2){return respondWithRpcPromise(_0x7ea4('0x5f'),_0x7ea4('0x60'),_0x25b7f2,client9003)[_0x7ea4('0x12')](function(_0x12ed4a){return _0x3039c5['update']({'read':!![],'messageId':_0x12ed4a[_0x7ea4('0x61')],'sentAt':moment()['format'](_0x7ea4('0x62'))});})[_0x7ea4('0x1b')](function(_0x16c0e0){logger['error']('%s',JSON[_0x7ea4('0x16')](_0x16c0e0));return _0x3039c5;});}return _0x3039c5;});}return _0x3039c5;}})['then'](respondWithResult(_0x3bbb90,0xc9))[_0x7ea4('0x1b')](handleError(_0x3bbb90,null));};exports[_0x7ea4('0x63')]=function(_0x5f474c,_0x480245){var _0x28102f={'agent':{},'channel':'mail'};if(_0x5f474c[_0x7ea4('0x48')]['id']){delete _0x5f474c[_0x7ea4('0x48')]['id'];}_0x5f474c[_0x7ea4('0x48')][_0x7ea4('0x64')]=!![];_0x5f474c['body'][_0x7ea4('0x65')]=moment()[_0x7ea4('0x66')](_0x7ea4('0x62'));_0x5f474c[_0x7ea4('0x48')]['UserId']=_0x5f474c['body'][_0x7ea4('0x67')]||_0x5f474c[_0x7ea4('0x68')]['id'];_0x28102f['agent']['id']=_0x5f474c[_0x7ea4('0x48')]['UserId'];return db[_0x7ea4('0x3f')][_0x7ea4('0x47')]({'where':{'id':_0x5f474c['params']['id'],'UserId':null}})[_0x7ea4('0x12')](handleEntityNotFound(_0x480245,null))[_0x7ea4('0x12')](saveUpdates(_0x5f474c['body'],null))[_0x7ea4('0x12')](function(_0x3bba28){if(_0x3bba28){_0x28102f[_0x7ea4('0x19')]=_0x3bba28['get']({'plain':!![]});return db[_0x7ea4('0x69')][_0x7ea4('0x47')]({'where':{'id':_0x3bba28[_0x7ea4('0x6a')]}});}return null;})[_0x7ea4('0x12')](handleEntityNotFound(_0x480245,null))['then'](function(_0x1609c1){if(_0x1609c1){return _0x1609c1[_0x7ea4('0x24')]({'UserId':_0x5f474c[_0x7ea4('0x48')][_0x7ea4('0x67')],'read1stAt':_[_0x7ea4('0x6b')](_0x1609c1['read1stAt'])?moment()[_0x7ea4('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7ea4('0x12')](function(_0x45b424){if(_0x45b424){_0x28102f[_0x7ea4('0x6c')]=_0x45b424[_0x7ea4('0x6d')]({'plain':!![]});interaction_log[_0x7ea4('0x1a')](_0x7ea4('0x6e'),_0x5f474c[_0x7ea4('0x68')]['id'],_0x5f474c[_0x7ea4('0x68')][_0x7ea4('0x2d')],_0x5f474c['user']['role'],_0x28102f['interaction']['id'],_0x5f474c[_0x7ea4('0x48')]?JSON[_0x7ea4('0x16')](_0x5f474c['body']):_0x7ea4('0x6f'));return respondWithRpcPromise(_0x7ea4('0x70'),'acceptMessage',_0x28102f);}return null;})['then'](function(_0x4cbd1c){var _0x3ee54a=_0x7ea4('0x71')+_0x4cbd1c[_0x7ea4('0x19')][_0x7ea4('0x72')];return db['sequelize'][_0x7ea4('0x2f')](_0x3ee54a,{'type':db[_0x7ea4('0x73')][_0x7ea4('0x74')]['SELECT'],'raw':!![]})[_0x7ea4('0x12')](function(_0x23aba2){return _0x23aba2;});})['then'](function(_0x1e4b5a){if(_0x1e4b5a){_0x28102f[_0x7ea4('0x19')][_0x7ea4('0x75')]=_0x1e4b5a[0x0];if(!_0x5f474c[_0x7ea4('0x48')][_0x7ea4('0x67')])return;return db['User']['find']({'where':{'id':_0x5f474c[_0x7ea4('0x48')][_0x7ea4('0x67')],'role':_0x7ea4('0x76')},'attributes':['id','name',_0x7ea4('0x77'),_0x7ea4('0x78'),'internal'],'raw':!![]});}return null;})[_0x7ea4('0x12')](function(_0x2ad4b8){if(!_0x2ad4b8)return null;_0x28102f['message'][_0x7ea4('0x76')]=_0x2ad4b8;return _0x28102f;})[_0x7ea4('0x12')](function(_0x478c73){if(_0x478c73){if(_0x5f474c[_0x7ea4('0x48')][_0x7ea4('0x79')]){_0x28102f[_0x7ea4('0x19')][_0x7ea4('0x7a')]=util[_0x7ea4('0x66')](_0x7ea4('0x7b'),_0x5f474c['user'][_0x7ea4('0x2d')]);_0x28102f[_0x7ea4('0x19')][_0x7ea4('0x7c')]=_0x28102f[_0x7ea4('0x7c')];_0x28102f[_0x7ea4('0x19')][_0x7ea4('0x7d')]=_0x28102f[_0x7ea4('0x7c')];_0x28102f[_0x7ea4('0x19')][_0x7ea4('0x7e')]='accept';_0x28102f[_0x7ea4('0x19')]['body']=htmlToText[_0x7ea4('0x7f')](_0x28102f[_0x7ea4('0x19')][_0x7ea4('0x48')]);return respondWithRpcPromise(_0x7ea4('0x80'),_0x7ea4('0x80'),{'event':_0x7ea4('0x81'),'message':_0x28102f['message']},client9002)[_0x7ea4('0x12')](function(){return _0x28102f;});}return _0x28102f;}return null;})[_0x7ea4('0x12')](respondWithResult(_0x480245,null))['catch'](handleError(_0x480245,null));};exports[_0x7ea4('0x82')]=function(_0xb31493,_0x2de29e){var _0x1f2788={'agent':{},'channel':_0x7ea4('0x83')};if(_0xb31493[_0x7ea4('0x48')]['id']){delete _0xb31493['body']['id'];}_0xb31493[_0x7ea4('0x48')]['UserId']=_0xb31493['body'][_0x7ea4('0x67')]||_0xb31493[_0x7ea4('0x68')]['id'];_0x1f2788['agent']['id']=_0xb31493['body'][_0x7ea4('0x67')];return db[_0x7ea4('0x3f')][_0x7ea4('0x47')]({'where':{'id':_0xb31493['params']['id'],'UserId':null}})[_0x7ea4('0x12')](handleEntityNotFound(_0x2de29e,null))['then'](function(_0x286a1c){if(_0x286a1c){_0x1f2788['message']=_0x286a1c[_0x7ea4('0x6d')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x286a1c[_0x7ea4('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x2de29e,null))[_0x7ea4('0x12')](function(_0x252ac5){if(_0x252ac5){_0x1f2788[_0x7ea4('0x6c')]=_0x252ac5['get']({'plain':!![]});interaction_log[_0x7ea4('0x1a')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xb31493[_0x7ea4('0x68')]['id'],_0xb31493[_0x7ea4('0x68')][_0x7ea4('0x2d')],_0xb31493[_0x7ea4('0x68')]['role'],_0x1f2788[_0x7ea4('0x6c')]['id'],_0xb31493[_0x7ea4('0x48')]?JSON[_0x7ea4('0x16')](_0xb31493[_0x7ea4('0x48')]):_0x7ea4('0x6f'));return respondWithRpcPromise(_0x7ea4('0x84'),_0x7ea4('0x85'),_0x1f2788);}return null;})[_0x7ea4('0x12')](function(_0x54eed6){var _0x45fabf=_0x7ea4('0x71')+_0x54eed6[_0x7ea4('0x19')][_0x7ea4('0x72')];return db['sequelize'][_0x7ea4('0x2f')](_0x45fabf,{'type':db['Sequelize'][_0x7ea4('0x74')][_0x7ea4('0x86')],'raw':!![]})[_0x7ea4('0x12')](function(_0x14ec93){return _0x14ec93;});})[_0x7ea4('0x12')](function(_0x4647aa){if(_0x4647aa){_0x1f2788[_0x7ea4('0x19')][_0x7ea4('0x75')]=_0x4647aa[0x0];if(!_0xb31493[_0x7ea4('0x48')][_0x7ea4('0x67')])return;return db[_0x7ea4('0x87')][_0x7ea4('0x47')]({'where':{'id':_0xb31493[_0x7ea4('0x48')][_0x7ea4('0x67')],'role':_0x7ea4('0x76')},'attributes':['id',_0x7ea4('0x2d'),'fullname','email',_0x7ea4('0x88')],'raw':!![]});}return null;})[_0x7ea4('0x12')](function(_0xe5c905){if(!_0xe5c905)return null;_0x1f2788['message'][_0x7ea4('0x76')]=_0xe5c905;return _0x1f2788;})['then'](function(_0x4b22ac){if(_0x4b22ac){_0x4b22ac[_0x7ea4('0x19')][_0x7ea4('0x7a')]=util['format'](_0x7ea4('0x7b'),_0xb31493['user'][_0x7ea4('0x2d')]);_0x4b22ac[_0x7ea4('0x19')][_0x7ea4('0x7c')]=_0x1f2788[_0x7ea4('0x7c')];_0x4b22ac[_0x7ea4('0x19')][_0x7ea4('0x7d')]=_0x1f2788['channel'];_0x4b22ac[_0x7ea4('0x19')][_0x7ea4('0x7e')]='reject';_0x4b22ac[_0x7ea4('0x19')]['body']=htmlToText[_0x7ea4('0x7f')](_0x1f2788[_0x7ea4('0x19')][_0x7ea4('0x48')]);respondWithRpcPromise(_0x7ea4('0x80'),_0x7ea4('0x80'),{'event':'rejectmessage','message':_0x4b22ac[_0x7ea4('0x19')]},client9002);return _0x1f2788;}return null;})['then'](respondWithResult(_0x2de29e,null))[_0x7ea4('0x1b')](handleError(_0x2de29e,null));};exports[_0x7ea4('0x89')]=function(_0x311bc5,_0x2ea3c5){var _0x20c345=moment()[_0x7ea4('0x8a')]()[_0x7ea4('0x8b')]();var _0x56acf6=path['join'](config['root'],_0x7ea4('0x8c'),_0x7ea4('0x8d'),'tmp');var _0x4bfc43=path[_0x7ea4('0x5b')](config['root'],_0x7ea4('0x8c'),'files',_0x7ea4('0x5a'));var _0x46327f=util['format'](_0x7ea4('0x8e'),_0x20c345);return db[_0x7ea4('0x3f')]['find']({'where':{'id':_0x311bc5[_0x7ea4('0x44')]['id']},'attributes':['id',_0x7ea4('0x48'),_0x7ea4('0x8f'),'to','cc',_0x7ea4('0x90'),'subject','createdAt'],'include':_0x311bc5[_0x7ea4('0x2f')][_0x7ea4('0x5a')]?[{'model':db[_0x7ea4('0x91')],'as':_0x7ea4('0x92')}]:undefined})[_0x7ea4('0x12')](handleEntityNotFound(_0x2ea3c5,null))[_0x7ea4('0x12')](function(_0x5c2c0a){if(_0x5c2c0a){var _0x48b4d9=_0x5c2c0a;var _0x2f5d51={'from':_0x48b4d9[_0x7ea4('0x8f')],'to':_0x48b4d9['to'],'subject':_0x48b4d9[_0x7ea4('0x93')],'html':htmlEntities[_0x7ea4('0x94')](_0x48b4d9['body']),'headers':{'Date':moment(_0x48b4d9[_0x7ea4('0x95')])['format'](_0x7ea4('0x96'))},'attachments':[]};if(_0x5c2c0a['cc']){_0x2f5d51[_0x7ea4('0x97')]['Cc']=_0x5c2c0a['cc'];}if(_0x5c2c0a['bcc']){_0x2f5d51['headers'][_0x7ea4('0x98')]=_0x5c2c0a[_0x7ea4('0x90')];}return new BPromise(function(_0x4b10f2,_0x5d23a2){if(_0x5c2c0a[_0x7ea4('0x92')]){for(var _0x1a9109=0x0;_0x1a9109<_0x5c2c0a['Attachments']['length'];_0x1a9109++){var _0x4c807e=_0x5c2c0a[_0x7ea4('0x92')][_0x1a9109];var _0x5a376f=path[_0x7ea4('0x5b')](_0x4bfc43,_0x4c807e[_0x7ea4('0x5d')]);if(fs['existsSync'](_0x5a376f)){_0x2f5d51[_0x7ea4('0x5a')][_0x7ea4('0x99')]({'name':_0x4c807e['name'],'contentType':_0x4c807e[_0x7ea4('0x3c')],'data':fs[_0x7ea4('0x9a')](_0x5a376f)});}}}emlformat[_0x7ea4('0x9b')](_0x2f5d51,function(_0x3b989c,_0xe4a3b9){if(_0x3b989c)return _0x5d23a2(_0x3b989c);fs[_0x7ea4('0x9c')](path[_0x7ea4('0x5b')](_0x56acf6,_0x46327f),_0xe4a3b9);return _0x4b10f2(_0xe4a3b9);});});}})[_0x7ea4('0x12')](function(_0x3eae05){if(_0x3eae05){return _0x2ea3c5[_0x7ea4('0x89')](path[_0x7ea4('0x5b')](_0x56acf6,_0x46327f),_0x46327f,function(_0x1b6921){if(!_0x1b6921)fs[_0x7ea4('0x9d')](path[_0x7ea4('0x5b')](_0x56acf6,_0x46327f));});}})[_0x7ea4('0x1b')](handleError(_0x2ea3c5,null));}; \ No newline at end of file +var _0x4185=['pick','filter','merge','VIRTUAL','options','includeAll','include','MailMessage','findAll','catch','params','keys','intersection','find','body','describe','create','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp','attachments','root','server/files/attachments','basename','CmContact','ListId','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','UserId','get','MailInteractionId','isNil','read1stAt','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','Sequelize','email','reject','rejectmessage','download','unix','toString','join','server','files','tmp','message-%s.eml','from','subject','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Attachments','existsSync','push','readFileSync','unlinkSync','eml-format','moment','bluebird','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','undefined','limit','count','offset','json','update','destroy','end','sendStatus','name','index','map','rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4185,0xf8));var _0x5418=function(_0x4fa337,_0x2c4e4b){_0x4fa337=_0x4fa337-0x0;var _0x58987a=_0x4185[_0x4fa337];return _0x58987a;};'use strict';var emlformat=require(_0x5418('0x0'));var moment=require(_0x5418('0x1'));var BPromise=require(_0x5418('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0x5418('0x3'));var logger=require(_0x5418('0x4'))(_0x5418('0x5'));var interaction_log=require(_0x5418('0x4'))('mail-interactions');var config=require(_0x5418('0x6'));var db=require(_0x5418('0x7'))['db'];config['redis']=_[_0x5418('0x8')](config[_0x5418('0x9')],{'host':_0x5418('0xa'),'port':0x18eb});var socket=require(_0x5418('0xb'))(new Redis(config[_0x5418('0x9')]));var htmlEntities=require(_0x5418('0xc'));require(_0x5418('0xd'))[_0x5418('0xe')](socket);var jayson=require(_0x5418('0xf'));var client=jayson[_0x5418('0x10')][_0x5418('0x11')]({'port':0x232c});var client9003=jayson[_0x5418('0x10')][_0x5418('0x11')]({'port':0x232b});var client9002=jayson['client'][_0x5418('0x11')]({'port':0x232a});function respondWithRpcPromise(_0xa1a273,_0x58dd84,_0x4a4cdd,_0x503c2f){return new BPromise(function(_0x1074b3,_0x19be49){var _0x1809a3=_0x503c2f||client;return _0x1809a3[_0x5418('0x12')](_0xa1a273,_0x4a4cdd)[_0x5418('0x13')](function(_0x4fd166){logger[_0x5418('0x14')](_0x5418('0x15'),_0x58dd84,_0x5418('0x16'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x58dd84,_0x5418('0x16'),JSON[_0x5418('0x17')](_0x4fd166));if(_0x4fd166[_0x5418('0x18')]){if(_0x4fd166['error'][_0x5418('0x19')]===0x1f4){logger[_0x5418('0x18')]('MailMessage,\x20%s,\x20%s',_0x58dd84,_0x4fd166[_0x5418('0x18')][_0x5418('0x1a')]);return _0x19be49(_0x4fd166['error']['message']);}logger[_0x5418('0x18')]('MailMessage,\x20%s,\x20%s',_0x58dd84,_0x4fd166[_0x5418('0x18')][_0x5418('0x1a')]);return _0x1074b3(_0x4fd166[_0x5418('0x18')][_0x5418('0x1a')]);}else{logger[_0x5418('0x14')]('MailMessage,\x20%s,\x20%s',_0x58dd84,_0x5418('0x16'));_0x1074b3(_0x4fd166[_0x5418('0x1b')][_0x5418('0x1a')]);}})['catch'](function(_0x31fb95){logger[_0x5418('0x18')](_0x5418('0x15'),_0x58dd84,_0x31fb95);_0x19be49(_0x31fb95);});});}function respondWithResult(_0x144e68,_0x518251){_0x518251=_0x518251||0xc8;return function(_0x4d2ca9){if(_0x4d2ca9){return _0x144e68[_0x5418('0x1c')](_0x518251)['json'](_0x4d2ca9);}};}function respondWithFilteredResult(_0x195a11,_0x5c2955){return function(_0x626a3f){if(_0x626a3f){var _0xb97976=typeof _0x5c2955['offset']===_0x5418('0x1d')&&typeof _0x5c2955[_0x5418('0x1e')]===_0x5418('0x1d');var _0x3fe16d=_0x626a3f[_0x5418('0x1f')];var _0x88d75b=_0xb97976?0x0:_0x5c2955[_0x5418('0x20')];var _0xd0c7c8=_0xb97976?_0x626a3f[_0x5418('0x1f')]:_0x5c2955['offset']+_0x5c2955[_0x5418('0x1e')];var _0x489fca;if(_0xd0c7c8>=_0x3fe16d){_0xd0c7c8=_0x3fe16d;_0x489fca=0xc8;}else{_0x489fca=0xce;}_0x195a11[_0x5418('0x1c')](_0x489fca);return _0x195a11['set']('Content-Range',_0x88d75b+'-'+_0xd0c7c8+'/'+_0x3fe16d)[_0x5418('0x21')](_0x626a3f);}return null;};}function saveUpdates(_0x41bdfb){return function(_0x312c66){if(_0x312c66){return _0x312c66[_0x5418('0x22')](_0x41bdfb)[_0x5418('0x13')](function(_0xeea04a){return _0xeea04a;});}return null;};}function removeEntity(_0x5d3acd){return function(_0x38e4de){if(_0x38e4de){return _0x38e4de[_0x5418('0x23')]()[_0x5418('0x13')](function(){_0x5d3acd[_0x5418('0x1c')](0xcc)[_0x5418('0x24')]();});}};}function handleEntityNotFound(_0x58593c){return function(_0x569af2){if(!_0x569af2){_0x58593c[_0x5418('0x25')](0x194);}return _0x569af2;};}function handleError(_0x427012,_0x19f559){_0x19f559=_0x19f559||0x1f4;return function(_0x5607a4){logger[_0x5418('0x18')](_0x5607a4['stack']);if(_0x5607a4[_0x5418('0x26')]){delete _0x5607a4[_0x5418('0x26')];}_0x427012[_0x5418('0x1c')](_0x19f559)['send'](_0x5607a4);};}exports[_0x5418('0x27')]=function(_0x1781d6,_0x43826d){var _0x14b03b={},_0x221782={},_0x2db7a8={'count':0x0,'rows':[]};var _0xb692cf=_[_0x5418('0x28')](db['MailMessage'][_0x5418('0x29')],function(_0x5c7d02){return{'name':_0x5c7d02[_0x5418('0x2a')],'type':_0x5c7d02[_0x5418('0x2b')]['key']};});_0x221782[_0x5418('0x2c')]=_[_0x5418('0x28')](_0xb692cf,_0x5418('0x26'));_0x221782['query']=_['keys'](_0x1781d6[_0x5418('0x2d')]);_0x221782[_0x5418('0x2e')]=_['intersection'](_0x221782[_0x5418('0x2c')],_0x221782[_0x5418('0x2d')]);_0x14b03b[_0x5418('0x2f')]=_['intersection'](_0x221782['model'],qs[_0x5418('0x30')](_0x1781d6[_0x5418('0x2d')][_0x5418('0x30')]));_0x14b03b[_0x5418('0x2f')]=_0x14b03b[_0x5418('0x2f')][_0x5418('0x31')]?_0x14b03b[_0x5418('0x2f')]:_0x221782['model'];if(!_0x1781d6[_0x5418('0x2d')][_0x5418('0x32')](_0x5418('0x33'))){_0x14b03b[_0x5418('0x1e')]=qs[_0x5418('0x1e')](_0x1781d6[_0x5418('0x2d')]['limit']);_0x14b03b[_0x5418('0x20')]=qs[_0x5418('0x20')](_0x1781d6[_0x5418('0x2d')][_0x5418('0x20')]);}_0x14b03b['order']=qs['sort'](_0x1781d6[_0x5418('0x2d')][_0x5418('0x34')]);_0x14b03b[_0x5418('0x35')]=qs[_0x5418('0x2e')](_[_0x5418('0x36')](_0x1781d6[_0x5418('0x2d')],_0x221782[_0x5418('0x2e')]),_0xb692cf);if(_0x1781d6[_0x5418('0x2d')][_0x5418('0x37')]){_0x14b03b[_0x5418('0x35')]=_[_0x5418('0x38')](_0x14b03b[_0x5418('0x35')],{'$or':_[_0x5418('0x28')](_0xb692cf,function(_0x2c2d7c){if(_0x2c2d7c[_0x5418('0x2b')]!==_0x5418('0x39')){var _0x188403={};_0x188403[_0x2c2d7c[_0x5418('0x26')]]={'$like':'%'+_0x1781d6[_0x5418('0x2d')][_0x5418('0x37')]+'%'};return _0x188403;}})});}_0x14b03b=_['merge']({},_0x14b03b,_0x1781d6[_0x5418('0x3a')]);var _0x163483={'where':_0x14b03b['where']};return db['MailMessage'][_0x5418('0x1f')](_0x163483)[_0x5418('0x13')](function(_0x2e004e){_0x2db7a8['count']=_0x2e004e;if(_0x1781d6[_0x5418('0x2d')][_0x5418('0x3b')]){_0x14b03b[_0x5418('0x3c')]=[{'all':!![]}];}return db[_0x5418('0x3d')][_0x5418('0x3e')](_0x14b03b);})[_0x5418('0x13')](function(_0x37f852){_0x2db7a8['rows']=_0x37f852;return _0x2db7a8;})[_0x5418('0x13')](respondWithFilteredResult(_0x43826d,_0x14b03b))[_0x5418('0x3f')](handleError(_0x43826d,null));};exports['show']=function(_0x3ade20,_0x58e46f){var _0xdf99ad={'raw':!![],'where':{'id':_0x3ade20[_0x5418('0x40')]['id']}},_0x34c0ee={};_0x34c0ee[_0x5418('0x2c')]=_[_0x5418('0x41')](db['MailMessage']['rawAttributes']);_0x34c0ee[_0x5418('0x2d')]=_[_0x5418('0x41')](_0x3ade20[_0x5418('0x2d')]);_0x34c0ee[_0x5418('0x2e')]=_[_0x5418('0x42')](_0x34c0ee[_0x5418('0x2c')],_0x34c0ee[_0x5418('0x2d')]);_0xdf99ad[_0x5418('0x2f')]=_[_0x5418('0x42')](_0x34c0ee[_0x5418('0x2c')],qs[_0x5418('0x30')](_0x3ade20[_0x5418('0x2d')][_0x5418('0x30')]));_0xdf99ad[_0x5418('0x2f')]=_0xdf99ad[_0x5418('0x2f')][_0x5418('0x31')]?_0xdf99ad[_0x5418('0x2f')]:_0x34c0ee[_0x5418('0x2c')];if(_0x3ade20[_0x5418('0x2d')]['includeAll']){_0xdf99ad[_0x5418('0x3c')]=[{'all':!![]}];}_0xdf99ad=_[_0x5418('0x38')]({},_0xdf99ad,_0x3ade20['options']);return db[_0x5418('0x3d')][_0x5418('0x43')](_0xdf99ad)[_0x5418('0x13')](handleEntityNotFound(_0x58e46f,null))[_0x5418('0x13')](respondWithResult(_0x58e46f,null))[_0x5418('0x3f')](handleError(_0x58e46f,null));};exports[_0x5418('0x22')]=function(_0x337d1b,_0x1b4dbc){if(_0x337d1b[_0x5418('0x44')]['id']){delete _0x337d1b['body']['id'];}return db[_0x5418('0x3d')][_0x5418('0x43')]({'where':{'id':_0x337d1b[_0x5418('0x40')]['id']}})[_0x5418('0x13')](handleEntityNotFound(_0x1b4dbc,null))[_0x5418('0x13')](saveUpdates(_0x337d1b[_0x5418('0x44')],null))['then'](respondWithResult(_0x1b4dbc,null))[_0x5418('0x3f')](handleError(_0x1b4dbc,null));};exports[_0x5418('0x23')]=function(_0x5c77e1,_0x48f5bb){return db[_0x5418('0x3d')][_0x5418('0x43')]({'where':{'id':_0x5c77e1['params']['id']}})[_0x5418('0x13')](handleEntityNotFound(_0x48f5bb,null))[_0x5418('0x13')](removeEntity(_0x48f5bb,null))['catch'](handleError(_0x48f5bb,null));};exports[_0x5418('0x45')]=function(_0x3ef3fd,_0x47c70a){return db[_0x5418('0x3d')][_0x5418('0x45')]()[_0x5418('0x13')](respondWithResult(_0x47c70a,null))['catch'](handleError(_0x47c70a,null));};exports['create']=function(_0x5e42e1,_0x25b223){return db[_0x5418('0x3d')][_0x5418('0x46')](_0x5e42e1[_0x5418('0x44')])[_0x5418('0x13')](function(_0x3f8121){if(_0x3f8121){if(_0x3f8121['direction']===_0x5418('0x47')&&!_0x3f8121[_0x5418('0x48')]){var _0x434d04,_0x5dbc47,_0x6137e7;if(_0x5e42e1[_0x5418('0x44')]['to']){_0x5dbc47=_0x5e42e1[_0x5418('0x44')]['to'][_0x5418('0x49')](',')[0x0];}return db[_0x5418('0x4a')][_0x5418('0x4b')]({'where':{'id':_0x3f8121[_0x5418('0x4c')]},'include':[{'model':db[_0x5418('0x4d')],'as':_0x5418('0x4e'),'include':[{'model':db['CmContact'],'as':_0x5418('0x4f'),'where':{'email':_0x5dbc47},'limit':0x1,'order':[[_0x5418('0x50'),_0x5418('0x51')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x5418('0x52')],'as':'CloudProvider','raw':!![]}]}]})[_0x5418('0x13')](function(_0xd53fbd){_0x434d04=_0xd53fbd;if(!_0x434d04||!_0x434d04[_0x5418('0x53')])return;var _0x4af6d6=_0x434d04['getSmtpOptions']();if(_0x5e42e1[_0x5418('0x44')]['attachments']&&_0x5e42e1['body'][_0x5418('0x54')][_0x5418('0x31')]){for(var _0x307ec7=0x0;_0x307ec7<_0x5e42e1[_0x5418('0x44')]['attachments'][_0x5418('0x31')];_0x307ec7+=0x1){_0x5e42e1[_0x5418('0x44')][_0x5418('0x54')][_0x307ec7]={'filename':_0x5e42e1[_0x5418('0x44')][_0x5418('0x54')][_0x307ec7]['name'],'path':path['join'](config[_0x5418('0x55')],_0x5418('0x56'),_0x5e42e1[_0x5418('0x44')][_0x5418('0x54')][_0x307ec7][_0x5418('0x57')])};}}_0x6137e7={'account':_0x4af6d6,'message':_0x5e42e1['body']};return;})[_0x5418('0x13')](function(){if(_0x434d04[_0x5418('0x4e')]){if(_0x434d04[_0x5418('0x4e')]['Contacts']['length']){return _0x434d04[_0x5418('0x4e')][_0x5418('0x4f')][0x0];}else{return db[_0x5418('0x58')]['create'](_[_0x5418('0x8')](_0x5e42e1[_0x5418('0x44')],{'firstName':_0x5e42e1['body']['to'],'email':_0x5e42e1['body']['to'],'phone':_0x5e42e1[_0x5418('0x44')]['to'],'ListId':_0x434d04[_0x5418('0x59')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x5418('0x13')](function(){if(_0x6137e7){return respondWithRpcPromise('SendMail',_0x5418('0x5a'),_0x6137e7,client9003)[_0x5418('0x13')](function(_0x28a83b){return _0x3f8121[_0x5418('0x22')]({'read':!![],'messageId':_0x28a83b[_0x5418('0x5b')],'sentAt':moment()[_0x5418('0x5c')](_0x5418('0x5d'))});})['catch'](function(_0x1c149a){logger[_0x5418('0x18')]('%s',JSON['stringify'](_0x1c149a));return _0x3f8121;});}return _0x3f8121;});}return _0x3f8121;}})[_0x5418('0x13')](respondWithResult(_0x25b223,0xc9))[_0x5418('0x3f')](handleError(_0x25b223,null));};exports[_0x5418('0x5e')]=function(_0x2e8fc9,_0x4d74c0){var _0x463f11={'agent':{},'channel':_0x5418('0x5f')};if(_0x2e8fc9[_0x5418('0x44')]['id']){delete _0x2e8fc9[_0x5418('0x44')]['id'];}_0x2e8fc9['body']['read']=!![];_0x2e8fc9[_0x5418('0x44')][_0x5418('0x60')]=moment()[_0x5418('0x5c')](_0x5418('0x5d'));_0x2e8fc9[_0x5418('0x44')]['UserId']=_0x2e8fc9[_0x5418('0x44')][_0x5418('0x61')]||_0x2e8fc9['user']['id'];_0x463f11['agent']['id']=_0x2e8fc9['body']['UserId'];return db['MailMessage'][_0x5418('0x43')]({'where':{'id':_0x2e8fc9['params']['id'],'UserId':null}})[_0x5418('0x13')](handleEntityNotFound(_0x4d74c0,null))[_0x5418('0x13')](saveUpdates(_0x2e8fc9['body'],null))[_0x5418('0x13')](function(_0x14756c){if(_0x14756c){_0x463f11[_0x5418('0x1a')]=_0x14756c[_0x5418('0x62')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x14756c[_0x5418('0x63')]}});}return null;})[_0x5418('0x13')](handleEntityNotFound(_0x4d74c0,null))[_0x5418('0x13')](function(_0x331727){if(_0x331727){return _0x331727[_0x5418('0x22')]({'UserId':_0x2e8fc9[_0x5418('0x44')][_0x5418('0x61')],'read1stAt':_[_0x5418('0x64')](_0x331727[_0x5418('0x65')])?moment()[_0x5418('0x5c')](_0x5418('0x5d')):undefined});}return null;})[_0x5418('0x13')](function(_0x1a50c8){if(_0x1a50c8){_0x463f11[_0x5418('0x66')]=_0x1a50c8['get']({'plain':!![]});interaction_log[_0x5418('0x14')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e8fc9[_0x5418('0x67')]['id'],_0x2e8fc9['user'][_0x5418('0x26')],_0x2e8fc9['user'][_0x5418('0x68')],_0x463f11[_0x5418('0x66')]['id'],_0x2e8fc9['body']?JSON[_0x5418('0x17')](_0x2e8fc9[_0x5418('0x44')]):_0x5418('0x69'));return respondWithRpcPromise(_0x5418('0x6a'),_0x5418('0x6b'),_0x463f11);}return null;})[_0x5418('0x13')](function(_0x4e2d08){var _0x714aa4=_0x5418('0x6c')+_0x4e2d08[_0x5418('0x1a')][_0x5418('0x6d')];return db[_0x5418('0x6e')][_0x5418('0x2d')](_0x714aa4,{'type':db['Sequelize'][_0x5418('0x6f')][_0x5418('0x70')],'raw':!![]})[_0x5418('0x13')](function(_0xaaca82){return _0xaaca82;});})[_0x5418('0x13')](function(_0x369fa9){if(_0x369fa9){_0x463f11[_0x5418('0x1a')][_0x5418('0x71')]=_0x369fa9[0x0];if(!_0x2e8fc9[_0x5418('0x44')]['UserId'])return;return db[_0x5418('0x72')][_0x5418('0x43')]({'where':{'id':_0x2e8fc9[_0x5418('0x44')][_0x5418('0x61')],'role':_0x5418('0x73')},'attributes':['id','name',_0x5418('0x74'),'email',_0x5418('0x75')],'raw':!![]});}return null;})[_0x5418('0x13')](function(_0xbede07){if(!_0xbede07)return null;_0x463f11[_0x5418('0x1a')][_0x5418('0x73')]=_0xbede07;return _0x463f11;})[_0x5418('0x13')](function(_0x560ccf){if(_0x560ccf){if(_0x2e8fc9[_0x5418('0x44')]['manual']){_0x463f11[_0x5418('0x1a')][_0x5418('0x76')]=util[_0x5418('0x5c')](_0x5418('0x77'),_0x2e8fc9[_0x5418('0x67')][_0x5418('0x26')]);_0x463f11[_0x5418('0x1a')][_0x5418('0x78')]=_0x463f11['channel'];_0x463f11[_0x5418('0x1a')][_0x5418('0x79')]=_0x463f11[_0x5418('0x78')];_0x463f11[_0x5418('0x1a')][_0x5418('0x7a')]=_0x5418('0x5e');_0x463f11[_0x5418('0x1a')]['body']=htmlToText[_0x5418('0x7b')](_0x463f11[_0x5418('0x1a')]['body']);return respondWithRpcPromise(_0x5418('0x7c'),_0x5418('0x7c'),{'event':_0x5418('0x7d'),'message':_0x463f11[_0x5418('0x1a')]},client9002)['then'](function(){return _0x463f11;});}return _0x463f11;}return null;})[_0x5418('0x13')](respondWithResult(_0x4d74c0,null))['catch'](handleError(_0x4d74c0,null));};exports['reject']=function(_0x330f4,_0x411afb){var _0x47766b={'agent':{},'channel':_0x5418('0x5f')};if(_0x330f4[_0x5418('0x44')]['id']){delete _0x330f4[_0x5418('0x44')]['id'];}_0x330f4[_0x5418('0x44')]['UserId']=_0x330f4['body']['UserId']||_0x330f4[_0x5418('0x67')]['id'];_0x47766b['agent']['id']=_0x330f4[_0x5418('0x44')][_0x5418('0x61')];return db[_0x5418('0x3d')][_0x5418('0x43')]({'where':{'id':_0x330f4[_0x5418('0x40')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x411afb,null))[_0x5418('0x13')](function(_0x36ef4d){if(_0x36ef4d){_0x47766b[_0x5418('0x1a')]=_0x36ef4d['get']({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x36ef4d[_0x5418('0x63')]}});}return null;})[_0x5418('0x13')](handleEntityNotFound(_0x411afb,null))[_0x5418('0x13')](function(_0x1da9e9){if(_0x1da9e9){_0x47766b[_0x5418('0x66')]=_0x1da9e9[_0x5418('0x62')]({'plain':!![]});interaction_log[_0x5418('0x14')](_0x5418('0x7e'),_0x330f4[_0x5418('0x67')]['id'],_0x330f4[_0x5418('0x67')][_0x5418('0x26')],_0x330f4['user'][_0x5418('0x68')],_0x47766b[_0x5418('0x66')]['id'],_0x330f4[_0x5418('0x44')]?JSON[_0x5418('0x17')](_0x330f4[_0x5418('0x44')]):_0x5418('0x69'));return respondWithRpcPromise('RejectMessage',_0x5418('0x7f'),_0x47766b);}return null;})[_0x5418('0x13')](function(_0x3bc632){var _0x4b755c=_0x5418('0x6c')+_0x3bc632[_0x5418('0x1a')][_0x5418('0x6d')];return db['sequelize']['query'](_0x4b755c,{'type':db[_0x5418('0x80')][_0x5418('0x6f')][_0x5418('0x70')],'raw':!![]})['then'](function(_0x4c1c4a){return _0x4c1c4a;});})[_0x5418('0x13')](function(_0x702410){if(_0x702410){_0x47766b[_0x5418('0x1a')][_0x5418('0x71')]=_0x702410[0x0];if(!_0x330f4[_0x5418('0x44')]['UserId'])return;return db[_0x5418('0x72')][_0x5418('0x43')]({'where':{'id':_0x330f4[_0x5418('0x44')]['UserId'],'role':_0x5418('0x73')},'attributes':['id',_0x5418('0x26'),_0x5418('0x74'),_0x5418('0x81'),_0x5418('0x75')],'raw':!![]});}return null;})[_0x5418('0x13')](function(_0x4b2baf){if(!_0x4b2baf)return null;_0x47766b['message'][_0x5418('0x73')]=_0x4b2baf;return _0x47766b;})[_0x5418('0x13')](function(_0x31e7b2){if(_0x31e7b2){_0x31e7b2['message'][_0x5418('0x76')]=util['format']('SIP/%s',_0x330f4[_0x5418('0x67')][_0x5418('0x26')]);_0x31e7b2['message'][_0x5418('0x78')]=_0x47766b[_0x5418('0x78')];_0x31e7b2[_0x5418('0x1a')][_0x5418('0x79')]=_0x47766b[_0x5418('0x78')];_0x31e7b2[_0x5418('0x1a')]['event']=_0x5418('0x82');_0x31e7b2[_0x5418('0x1a')][_0x5418('0x44')]=htmlToText['fromString'](_0x47766b[_0x5418('0x1a')]['body']);respondWithRpcPromise('EventManager',_0x5418('0x7c'),{'event':_0x5418('0x83'),'message':_0x31e7b2[_0x5418('0x1a')]},client9002);return _0x47766b;}return null;})['then'](respondWithResult(_0x411afb,null))['catch'](handleError(_0x411afb,null));};exports[_0x5418('0x84')]=function(_0x172127,_0x1f5658){var _0x4280fb=moment()[_0x5418('0x85')]()[_0x5418('0x86')]();var _0x242a95=path[_0x5418('0x87')](config['root'],_0x5418('0x88'),_0x5418('0x89'),_0x5418('0x8a'));var _0x24ad0d=path[_0x5418('0x87')](config[_0x5418('0x55')],_0x5418('0x88'),_0x5418('0x89'),'attachments');var _0x51508f=util[_0x5418('0x5c')](_0x5418('0x8b'),_0x4280fb);return db[_0x5418('0x3d')][_0x5418('0x43')]({'where':{'id':_0x172127[_0x5418('0x40')]['id']},'attributes':['id',_0x5418('0x44'),_0x5418('0x8c'),'to','cc','bcc',_0x5418('0x8d'),'createdAt'],'include':_0x172127[_0x5418('0x2d')][_0x5418('0x54')]?[{'model':db[_0x5418('0x8e')],'as':'Attachments'}]:undefined})[_0x5418('0x13')](handleEntityNotFound(_0x1f5658,null))[_0x5418('0x13')](function(_0x2b465e){if(_0x2b465e){var _0x1935e0=_0x2b465e;var _0x522636={'from':_0x1935e0[_0x5418('0x8c')],'to':_0x1935e0['to'],'subject':_0x1935e0[_0x5418('0x8d')],'html':htmlEntities['decode'](_0x1935e0[_0x5418('0x44')]),'headers':{'Date':moment(_0x1935e0['createdAt'])[_0x5418('0x5c')](_0x5418('0x8f'))},'attachments':[]};if(_0x2b465e['cc']){_0x522636[_0x5418('0x90')]['Cc']=_0x2b465e['cc'];}if(_0x2b465e[_0x5418('0x91')]){_0x522636[_0x5418('0x90')]['Bcc']=_0x2b465e[_0x5418('0x91')];}return new BPromise(function(_0x5a2293,_0x53d418){if(_0x2b465e[_0x5418('0x92')]){for(var _0x29e2ca=0x0;_0x29e2ca<_0x2b465e[_0x5418('0x92')][_0x5418('0x31')];_0x29e2ca++){var _0x29d8d1=_0x2b465e[_0x5418('0x92')][_0x29e2ca];var _0x2fb1e6=path[_0x5418('0x87')](_0x24ad0d,_0x29d8d1[_0x5418('0x57')]);if(fs[_0x5418('0x93')](_0x2fb1e6)){_0x522636[_0x5418('0x54')][_0x5418('0x94')]({'name':_0x29d8d1[_0x5418('0x26')],'contentType':_0x29d8d1['type'],'data':fs[_0x5418('0x95')](_0x2fb1e6)});}}}emlformat['build'](_0x522636,function(_0x496b24,_0x28579a){if(_0x496b24)return _0x53d418(_0x496b24);fs['writeFileSync'](path[_0x5418('0x87')](_0x242a95,_0x51508f),_0x28579a);return _0x5a2293(_0x28579a);});});}})[_0x5418('0x13')](function(_0x3c9d55){if(_0x3c9d55){return _0x1f5658[_0x5418('0x84')](path['join'](_0x242a95,_0x51508f),_0x51508f,function(_0x20dbb9){if(!_0x20dbb9)fs[_0x5418('0x96')](path[_0x5418('0x87')](_0x242a95,_0x51508f));});}})['catch'](handleError(_0x1f5658,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index df35acb..e085d7a 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 _0xe080=['MailMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x11eb1f,_0x826f0b){var _0x2121e9=function(_0x5b84a9){while(--_0x5b84a9){_0x11eb1f['push'](_0x11eb1f['shift']());}};_0x2121e9(++_0x826f0b);}(_0xe080,0x8a));var _0x0e08=function(_0x45acce,_0x2f9df6){_0x45acce=_0x45acce-0x0;var _0x10f08e=_0xe080[_0x45acce];return _0x10f08e;};'use strict';var EventEmitter=require(_0x0e08('0x0'));var MailMessage=require(_0x0e08('0x1'))['db'][_0x0e08('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0e08('0x3')](0x0);var events={'afterCreate':_0x0e08('0x4'),'afterUpdate':'update','afterDestroy':_0x0e08('0x5')};function emitEvent(_0x52802d){return function(_0x500f49,_0x4e5c3b,_0x4e05d2){MailMessageEvents[_0x0e08('0x6')](_0x52802d+':'+_0x500f49['id'],_0x500f49);MailMessageEvents['emit'](_0x52802d,_0x500f49);_0x4e05d2(null);};}for(var e in events){if(events[_0x0e08('0x7')](e)){var event=events[e];MailMessage[_0x0e08('0x8')](e,emitEvent(event));}}module[_0x0e08('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x43c5=['exports','events','../../mysqldb','MailMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x55f6d7,_0x5bd984){var _0x2153cc=function(_0x11ff8b){while(--_0x11ff8b){_0x55f6d7['push'](_0x55f6d7['shift']());}};_0x2153cc(++_0x5bd984);}(_0x43c5,0x65));var _0x543c=function(_0x1fe4c5,_0x5ade23){_0x1fe4c5=_0x1fe4c5-0x0;var _0x596fd9=_0x43c5[_0x1fe4c5];return _0x596fd9;};'use strict';var EventEmitter=require(_0x543c('0x0'));var MailMessage=require(_0x543c('0x1'))['db'][_0x543c('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x543c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x543c('0x4'),'afterDestroy':_0x543c('0x5')};function emitEvent(_0x1d5efe){return function(_0x52bc74,_0x1f9ab9,_0x117375){MailMessageEvents['emit'](_0x1d5efe+':'+_0x52bc74['id'],_0x52bc74);MailMessageEvents[_0x543c('0x6')](_0x1d5efe,_0x52bc74);_0x117375(null);};}for(var e in events){if(events[_0x543c('0x7')](e)){var event=events[e];MailMessage[_0x543c('0x8')](e,emitEvent(event));}}module[_0x543c('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 9955fa5..7c310ba 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 _0x7492=['messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','models','direction','toLowerCase','out','secret','UserId','findOne','MailInteractionId','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x229c2e,_0x56eb97){var _0x45defa=function(_0x153090){while(--_0x153090){_0x229c2e['push'](_0x229c2e['shift']());}};_0x45defa(++_0x56eb97);}(_0x7492,0x1a7));var _0x2749=function(_0x2caa93,_0x44fe92){_0x2caa93=_0x2caa93-0x0;var _0x2a0741=_0x7492[_0x2caa93];return _0x2a0741;};'use strict';var _=require(_0x2749('0x0'));var util=require(_0x2749('0x1'));var logger=require(_0x2749('0x2'))(_0x2749('0x3'));var moment=require(_0x2749('0x4'));var BPromise=require(_0x2749('0x5'));var rp=require(_0x2749('0x6'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x2749('0x7'));var config=require(_0x2749('0x8'));var attributes=require('./mailMessage.attributes');module[_0x2749('0x9')]=function(_0x5e8ff6,_0x2719e9){return _0x5e8ff6[_0x2749('0xa')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x2749('0xb'),'fields':[_0x2749('0xb')]},{'name':_0x2749('0xc'),'fields':['plainBody',_0x2749('0xd')],'type':_0x2749('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2c6a6a,_0x22758b,_0x243831){if(_0x2c6a6a[_0x2749('0xf')]){_0x2c6a6a[_0x2749('0x10')]=htmlToText[_0x2749('0x11')](_0x2c6a6a[_0x2749('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x243831(null,_0x22758b);},'afterCreate':function(_0x253f1,_0x41cf7b,_0x37eb70){var _0x264933=_0x5e8ff6[_0x2749('0x12')];var _0x1017e7=_0x253f1['get']({'plain':!![]});if(_0x1017e7[_0x2749('0x13')][_0x2749('0x14')]()==='in'||_0x1017e7[_0x2749('0x13')][_0x2749('0x14')]()===_0x2749('0x15')&&!_0x1017e7[_0x2749('0x16')]&&!_['isNil'](_0x1017e7[_0x2749('0x17')])){_0x264933['MailInteraction'][_0x2749('0x18')]({'where':{'id':_0x1017e7[_0x2749('0x19')]}})['then'](function(_0x16ab72){if(_0x16ab72){_0x16ab72[_0x2749('0x1a')]({'lastMsgAt':_0x1017e7['createdAt'],'lastMsgDirection':_0x1017e7['direction'][_0x2749('0x14')]()});}})[_0x2749('0x1b')](function(_0x35a594){console[_0x2749('0x1c')](_0x35a594);});}_0x37eb70();}},'charset':_0x2749('0x1d'),'collate':_0x2749('0x1e')});}; \ No newline at end of file +var _0x86ec=['define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','get','direction','toLowerCase','out','secret','MailInteraction','findOne','MailInteractionId','catch','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','html-to-text','rimraf','./mailMessage.attributes','exports'];(function(_0x4a78f,_0x33581c){var _0x2bb41b=function(_0x4b5cae){while(--_0x4b5cae){_0x4a78f['push'](_0x4a78f['shift']());}};_0x2bb41b(++_0x33581c);}(_0x86ec,0x83));var _0xc86e=function(_0x39cf00,_0x29f093){_0x39cf00=_0x39cf00-0x0;var _0x48c1bd=_0x86ec[_0x39cf00];return _0x48c1bd;};'use strict';var _=require('lodash');var util=require(_0xc86e('0x0'));var logger=require(_0xc86e('0x1'))('api');var moment=require(_0xc86e('0x2'));var BPromise=require(_0xc86e('0x3'));var rp=require(_0xc86e('0x4'));var htmlToText=require(_0xc86e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc86e('0x6'));var config=require('../../config/environment');var attributes=require(_0xc86e('0x7'));module[_0xc86e('0x8')]=function(_0x35a63e,_0x2b4dd4){return _0x35a63e[_0xc86e('0x9')](_0xc86e('0xa'),attributes,{'tableName':_0xc86e('0xb'),'paranoid':![],'indexes':[{'name':_0xc86e('0xc'),'fields':[_0xc86e('0xc')]},{'name':_0xc86e('0xd'),'fields':[_0xc86e('0xe'),'subject'],'type':_0xc86e('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xd9ae1a,_0x34400f,_0x1d0fe3){if(_0xd9ae1a['body']){_0xd9ae1a[_0xc86e('0xe')]=htmlToText['fromString'](_0xd9ae1a[_0xc86e('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1d0fe3(null,_0x34400f);},'afterCreate':function(_0x3019a6,_0x17d6ff,_0x28a72d){var _0x19366b=_0x35a63e[_0xc86e('0x11')];var _0x1ddcf6=_0x3019a6[_0xc86e('0x12')]({'plain':!![]});if(_0x1ddcf6[_0xc86e('0x13')][_0xc86e('0x14')]()==='in'||_0x1ddcf6[_0xc86e('0x13')][_0xc86e('0x14')]()===_0xc86e('0x15')&&!_0x1ddcf6[_0xc86e('0x16')]&&!_['isNil'](_0x1ddcf6['UserId'])){_0x19366b[_0xc86e('0x17')][_0xc86e('0x18')]({'where':{'id':_0x1ddcf6[_0xc86e('0x19')]}})['then'](function(_0x5f4dce){if(_0x5f4dce){_0x5f4dce['update']({'lastMsgAt':_0x1ddcf6['createdAt'],'lastMsgDirection':_0x1ddcf6['direction'][_0xc86e('0x14')]()});}})[_0xc86e('0x1a')](function(_0x258799){console['error'](_0x258799);});}_0x28a72d();}},'charset':'utf8mb4','collate':_0xc86e('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 74641b8..5d18ce1 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 _0xbaf0=['request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','MailMessage','create','body','options','raw','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register'];(function(_0x3a3ce9,_0x14513b){var _0x33a6e9=function(_0x15d257){while(--_0x15d257){_0x3a3ce9['push'](_0x3a3ce9['shift']());}};_0x33a6e9(++_0x14513b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});config[_0x0baf('0xc')]=_[_0x0baf('0xd')](config[_0x0baf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0xe'))(new Redis(config['redis']));require(_0x0baf('0xf'))[_0x0baf('0x10')](socket);function respondWithRpcPromise(_0x465528,_0x2f46e8,_0x7f54d4){return new BPromise(function(_0xf4c8ac,_0x41cead){return client[_0x0baf('0x11')](_0x465528,_0x7f54d4)[_0x0baf('0x12')](function(_0x1d60a2){logger[_0x0baf('0x13')]('MailMessage,\x20%s,\x20%s',_0x2f46e8,'request\x20sent');logger[_0x0baf('0x14')](_0x0baf('0x15'),_0x2f46e8,_0x0baf('0x16'),JSON[_0x0baf('0x17')](_0x1d60a2));if(_0x1d60a2['error']){if(_0x1d60a2[_0x0baf('0x18')]['code']===0x1f4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0x41cead(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0xf4c8ac(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}else{logger[_0x0baf('0x13')](_0x0baf('0x19'),_0x2f46e8,'request\x20sent');_0xf4c8ac(_0x1d60a2[_0x0baf('0x1b')][_0x0baf('0x1a')]);}})[_0x0baf('0x1c')](function(_0x3e9cb4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x3e9cb4);_0x41cead(_0x3e9cb4);});});}exports['CreateMailMessage']=function(_0x5cff5d){var _0x1410ec=this;return new Promise(function(_0x154f48,_0x32e839){return db[_0x0baf('0x1d')][_0x0baf('0x1e')](_0x5cff5d[_0x0baf('0x1f')],{'raw':_0x5cff5d[_0x0baf('0x20')]?_0x5cff5d[_0x0baf('0x20')][_0x0baf('0x21')]===undefined?!![]:![]:!![]})[_0x0baf('0x12')](function(_0x54f2fa){logger[_0x0baf('0x13')]('CreateMailMessage',_0x5cff5d);logger[_0x0baf('0x14')]('CreateMailMessage',_0x5cff5d,JSON['stringify'](_0x54f2fa));_0x154f48(_0x54f2fa);})[_0x0baf('0x1c')](function(_0x48a0e9){logger['error'](_0x0baf('0x22'),_0x48a0e9[_0x0baf('0x1a')],_0x5cff5d);_0x32e839(_0x1410ec[_0x0baf('0x18')](0x1f4,_0x48a0e9[_0x0baf('0x1a')]));});});}; \ No newline at end of file +var _0x80ed=['create','options','raw','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateMailMessage','MailMessage'];(function(_0x3ff30b,_0x5bd2c8){var _0x3b5be1=function(_0x41d282){while(--_0x41d282){_0x3ff30b['push'](_0x3ff30b['shift']());}};_0x3b5be1(++_0x5bd2c8);}(_0x80ed,0x11c));var _0xd80e=function(_0x429b26,_0x11cb9f){_0x429b26=_0x429b26-0x0;var _0x5087c7=_0x80ed[_0x429b26];return _0x5087c7;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var moment=require(_0xd80e('0x1'));var BPromise=require(_0xd80e('0x2'));var rs=require(_0xd80e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd80e('0x4'))['db'];var utils=require(_0xd80e('0x5'));var logger=require(_0xd80e('0x6'))(_0xd80e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd80e('0x8'));var client=jayson[_0xd80e('0x9')][_0xd80e('0xa')]({'port':0x232a});config['redis']=_[_0xd80e('0xb')](config[_0xd80e('0xc')],{'host':_0xd80e('0xd'),'port':0x18eb});var socket=require(_0xd80e('0xe'))(new Redis(config[_0xd80e('0xc')]));require(_0xd80e('0xf'))[_0xd80e('0x10')](socket);function respondWithRpcPromise(_0x2457f5,_0x68625,_0x7f93b4){return new BPromise(function(_0x4eee08,_0x450b44){return client[_0xd80e('0x11')](_0x2457f5,_0x7f93b4)[_0xd80e('0x12')](function(_0x30c9d0){logger[_0xd80e('0x13')](_0xd80e('0x14'),_0x68625,_0xd80e('0x15'));logger[_0xd80e('0x16')](_0xd80e('0x17'),_0x68625,'request\x20sent',JSON['stringify'](_0x30c9d0));if(_0x30c9d0['error']){if(_0x30c9d0['error'][_0xd80e('0x18')]===0x1f4){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x450b44(_0x30c9d0['error'][_0xd80e('0x1a')]);}logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x4eee08(_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);}else{logger[_0xd80e('0x13')]('MailMessage,\x20%s,\x20%s',_0x68625,_0xd80e('0x15'));_0x4eee08(_0x30c9d0[_0xd80e('0x1b')][_0xd80e('0x1a')]);}})[_0xd80e('0x1c')](function(_0x593af6){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x593af6);_0x450b44(_0x593af6);});});}exports[_0xd80e('0x1d')]=function(_0x527237){var _0x41417d=this;return new Promise(function(_0x2ef8a1,_0x2765ea){return db[_0xd80e('0x1e')][_0xd80e('0x1f')](_0x527237['body'],{'raw':_0x527237['options']?_0x527237[_0xd80e('0x20')][_0xd80e('0x21')]===undefined?!![]:![]:!![]})[_0xd80e('0x12')](function(_0x2d46e7){logger[_0xd80e('0x13')](_0xd80e('0x1d'),_0x527237);logger[_0xd80e('0x16')]('CreateMailMessage',_0x527237,JSON[_0xd80e('0x22')](_0x2d46e7));_0x2ef8a1(_0x2d46e7);})[_0xd80e('0x1c')](function(_0x170109){logger['error'](_0xd80e('0x1d'),_0x170109[_0xd80e('0x1a')],_0x527237);_0x2765ea(_0x41417d[_0xd80e('0x19')](0x1f4,_0x170109['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 2a9c048..5a7aca9 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 _0x0d6e=['update','emit','removeListener','./mailMessage.events','save','remove'];(function(_0xf8288e,_0x13d8ba){var _0x59f98d=function(_0x273dfd){while(--_0x273dfd){_0xf8288e['push'](_0xf8288e['shift']());}};_0x59f98d(++_0x13d8ba);}(_0x0d6e,0xc3));var _0xe0d6=function(_0x50c6ec,_0x4b7c55){_0x50c6ec=_0x50c6ec-0x0;var _0x311c3e=_0x0d6e[_0x50c6ec];return _0x311c3e;};'use strict';var MailMessageEvents=require(_0xe0d6('0x0'));var events=[_0xe0d6('0x1'),_0xe0d6('0x2'),_0xe0d6('0x3')];function createListener(_0x5ddec4,_0x228525){return function(_0x3e11d6){_0x228525[_0xe0d6('0x4')](_0x5ddec4,_0x3e11d6);};}function removeListener(_0x316a74,_0x57228d){return function(){MailMessageEvents[_0xe0d6('0x5')](_0x316a74,_0x57228d);};}exports['register']=function(_0x1c4dbe){for(var _0x40f626=0x0,_0x511b06=events['length'];_0x40f626<_0x511b06;_0x40f626++){var _0x26d150=events[_0x40f626];var _0x760900=createListener('mailMessage:'+_0x26d150,_0x1c4dbe);MailMessageEvents['on'](_0x26d150,_0x760900);}}; \ No newline at end of file +var _0x2ffa=['./mailMessage.events','emit','removeListener','register','length','mailMessage:'];(function(_0x41cf13,_0x55e5bc){var _0x731914=function(_0x218ab5){while(--_0x218ab5){_0x41cf13['push'](_0x41cf13['shift']());}};_0x731914(++_0x55e5bc);}(_0x2ffa,0x16e));var _0xa2ff=function(_0x30f6d4,_0x587155){_0x30f6d4=_0x30f6d4-0x0;var _0x1013b0=_0x2ffa[_0x30f6d4];return _0x1013b0;};'use strict';var MailMessageEvents=require(_0xa2ff('0x0'));var events=['save','remove','update'];function createListener(_0x1a6ce5,_0x420613){return function(_0x98991f){_0x420613[_0xa2ff('0x1')](_0x1a6ce5,_0x98991f);};}function removeListener(_0x360fe7,_0x14a75d){return function(){MailMessageEvents[_0xa2ff('0x2')](_0x360fe7,_0x14a75d);};}exports[_0xa2ff('0x3')]=function(_0x48c9bc){for(var _0x41a4b7=0x0,_0x264cc5=events[_0xa2ff('0x4')];_0x41a4b7<_0x264cc5;_0x41a4b7++){var _0x3b4f29=events[_0x41a4b7];var _0x403351=createListener(_0xa2ff('0x5')+_0x3b4f29,_0x48c9bc);MailMessageEvents['on'](_0x3b4f29,_0x403351);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 5cce578..b8e57f5 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 _0x6f1c=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer'];(function(_0xef61ba,_0x4b2a1a){var _0x307a18=function(_0x2f9d2e){while(--_0x2f9d2e){_0xef61ba['push'](_0xef61ba['shift']());}};_0x307a18(++_0x4b2a1a);}(_0x6f1c,0x95));var _0xc6f1=function(_0x4e70ea,_0x4d43f8){_0x4e70ea=_0x4e70ea-0x0;var _0x5e07c5=_0x6f1c[_0x4e70ea];return _0x5e07c5;};'use strict';var multer=require(_0xc6f1('0x0'));var util=require(_0xc6f1('0x1'));var path=require(_0xc6f1('0x2'));var timeout=require(_0xc6f1('0x3'));var express=require(_0xc6f1('0x4'));var router=express['Router']();var fs_extra=require(_0xc6f1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc6f1('0x6'));var config=require(_0xc6f1('0x7'));var controller=require(_0xc6f1('0x8'));router[_0xc6f1('0x9')]('/',auth[_0xc6f1('0xa')](),controller[_0xc6f1('0xb')]);router[_0xc6f1('0x9')](_0xc6f1('0xc'),auth[_0xc6f1('0xa')](),controller[_0xc6f1('0xd')]);router['get'](_0xc6f1('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc6f1('0x9')](_0xc6f1('0xf'),auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x10')]);router[_0xc6f1('0x9')](_0xc6f1('0x11'),auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x12')]);router[_0xc6f1('0x9')](_0xc6f1('0x13'),auth['isAuthenticated'](),controller[_0xc6f1('0x14')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc6f1('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0xc6f1('0x15')]('/:id/users',auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x16')]);router[_0xc6f1('0x17')](_0xc6f1('0xe'),auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x18')]);router['delete'](_0xc6f1('0xe'),auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x19')]);router[_0xc6f1('0x1a')](_0xc6f1('0x11'),auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x1b')]);router['delete']('/:id/users',auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x1c')]);module[_0xc6f1('0x1d')]=router; \ No newline at end of file +var _0x44b4=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','delete','destroy','removeAgents','exports','multer','util','path'];(function(_0x34bdda,_0x330efc){var _0x371352=function(_0xf7a970){while(--_0xf7a970){_0x34bdda['push'](_0x34bdda['shift']());}};_0x371352(++_0x330efc);}(_0x44b4,0x14d));var _0x444b=function(_0x3374a7,_0x582ff6){_0x3374a7=_0x3374a7-0x0;var _0x407827=_0x44b4[_0x3374a7];return _0x407827;};'use strict';var multer=require(_0x444b('0x0'));var util=require(_0x444b('0x1'));var path=require(_0x444b('0x2'));var timeout=require(_0x444b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x444b('0x4'));var auth=require(_0x444b('0x5'));var interaction=require(_0x444b('0x6'));var config=require(_0x444b('0x7'));var controller=require(_0x444b('0x8'));router[_0x444b('0x9')]('/',auth[_0x444b('0xa')](),controller[_0x444b('0xb')]);router[_0x444b('0x9')](_0x444b('0xc'),auth[_0x444b('0xa')](),controller['describe']);router[_0x444b('0x9')](_0x444b('0xd'),auth[_0x444b('0xa')](),controller[_0x444b('0xe')]);router[_0x444b('0x9')]('/:id/members',auth[_0x444b('0xa')](),controller[_0x444b('0xf')]);router[_0x444b('0x9')](_0x444b('0x10'),auth[_0x444b('0xa')](),controller[_0x444b('0x11')]);router['get'](_0x444b('0x12'),auth[_0x444b('0xa')](),controller[_0x444b('0x13')]);router[_0x444b('0x14')]('/',auth['isAuthenticated'](),controller[_0x444b('0x15')]);router[_0x444b('0x14')](_0x444b('0x10'),auth[_0x444b('0xa')](),controller['addTeams']);router[_0x444b('0x14')](_0x444b('0x12'),auth[_0x444b('0xa')](),controller[_0x444b('0x16')]);router[_0x444b('0x17')](_0x444b('0xd'),auth[_0x444b('0xa')](),controller['update']);router[_0x444b('0x18')]('/:id',auth[_0x444b('0xa')](),controller[_0x444b('0x19')]);router[_0x444b('0x18')](_0x444b('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x444b('0x18')](_0x444b('0x12'),auth[_0x444b('0xa')](),controller[_0x444b('0x1a')]);module[_0x444b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 5e79c3c..a376b62 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 _0x1c1e=['name','INTEGER','ENUM','beepall','roundrobin','exports','STRING'];(function(_0x5aa838,_0x29aa58){var _0x49b414=function(_0x1929ae){while(--_0x1929ae){_0x5aa838['push'](_0x5aa838['shift']());}};_0x49b414(++_0x29aa58);}(_0x1c1e,0x9f));var _0xe1c1=function(_0x5950bd,_0x103e16){_0x5950bd=_0x5950bd-0x0;var _0x33e816=_0x1c1e[_0x5950bd];return _0x33e816;};'use strict';var Sequelize=require('sequelize');module[_0xe1c1('0x0')]={'name':{'type':Sequelize[_0xe1c1('0x1')],'unique':_0xe1c1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe1c1('0x1')]},'timeout':{'type':Sequelize[_0xe1c1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe1c1('0x4')]('rrmemory',_0xe1c1('0x5'),_0xe1c1('0x6'))}}; \ No newline at end of file +var _0xa6f9=['STRING','name','INTEGER','ENUM','beepall','exports'];(function(_0x19445e,_0x53a992){var _0x339540=function(_0x482262){while(--_0x482262){_0x19445e['push'](_0x19445e['shift']());}};_0x339540(++_0x53a992);}(_0xa6f9,0x19d));var _0x9a6f=function(_0x487103,_0x3013a4){_0x487103=_0x487103-0x0;var _0x2af57f=_0xa6f9[_0x487103];return _0x2af57f;};'use strict';var Sequelize=require('sequelize');module[_0x9a6f('0x0')]={'name':{'type':Sequelize[_0x9a6f('0x1')],'unique':_0x9a6f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9a6f('0x1')]},'timeout':{'type':Sequelize[_0x9a6f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9a6f('0x4')]('rrmemory',_0x9a6f('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 24294de..263e266 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 _0x135b=['fieldName','type','key','getOptions','where','include','findAll','rows','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','limit','order','sort','pick','filter','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','nolimit','ids','Team','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','bluebird','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','./mailQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','then','get','MailQueues','UserProfileResource','destroy','error','name','index','map','MailQueue','rawAttributes'];(function(_0x22ed4b,_0x20609c){var _0x4e9cf6=function(_0x3a2de1){while(--_0x3a2de1){_0x22ed4b['push'](_0x22ed4b['shift']());}};_0x4e9cf6(++_0x20609c);}(_0x135b,0xd1));var _0xb135=function(_0x5ad794,_0x330eb1){_0x5ad794=_0x5ad794-0x0;var _0x58d45e=_0x135b[_0x5ad794];return _0x58d45e;};'use strict';var BPromise=require(_0xb135('0x0'));var util=require(_0xb135('0x1'));var _=require(_0xb135('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0xb135('0x3'));var logger=require(_0xb135('0x4'))(_0xb135('0x5'));var config=require('../../config/environment');var db=require(_0xb135('0x6'))['db'];config['redis']=_['defaults'](config[_0xb135('0x7')],{'host':_0xb135('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb135('0x7')]));require(_0xb135('0x9'))[_0xb135('0xa')](socket);function respondWithStatusCode(_0x200c70,_0x5ca96f){_0x5ca96f=_0x5ca96f||0xcc;return function(_0x1bedf6){if(_0x1bedf6){return _0x200c70[_0xb135('0xb')](_0x5ca96f);}return _0x200c70['status'](_0x5ca96f)[_0xb135('0xc')]();};}function respondWithResult(_0x1d4d7c,_0x1f24e4){_0x1f24e4=_0x1f24e4||0xc8;return function(_0x6457e6){if(_0x6457e6){return _0x1d4d7c[_0xb135('0xd')](_0x1f24e4)[_0xb135('0xe')](_0x6457e6);}};}function respondWithFilteredResult(_0x3e9f62,_0xdd4480){return function(_0x52ddf0){if(_0x52ddf0){var _0x47b95a=typeof _0xdd4480[_0xb135('0xf')]==='undefined'&&typeof _0xdd4480['limit']===_0xb135('0x10');var _0x308b73=_0x52ddf0[_0xb135('0x11')];var _0x31d2e3=_0x47b95a?0x0:_0xdd4480[_0xb135('0xf')];var _0x990990=_0x47b95a?_0x52ddf0[_0xb135('0x11')]:_0xdd4480[_0xb135('0xf')]+_0xdd4480['limit'];var _0x38032d;if(_0x990990>=_0x308b73){_0x990990=_0x308b73;_0x38032d=0xc8;}else{_0x38032d=0xce;}_0x3e9f62[_0xb135('0xd')](_0x38032d);return _0x3e9f62[_0xb135('0x12')](_0xb135('0x13'),_0x31d2e3+'-'+_0x990990+'/'+_0x308b73)[_0xb135('0xe')](_0x52ddf0);}return null;};}function saveUpdates(_0x45a31f){return function(_0x52ec8f){if(_0x52ec8f){return _0x52ec8f['update'](_0x45a31f)[_0xb135('0x14')](function(_0x107188){return _0x107188;});}return null;};}function removeEntity(_0x1e22bc){return function(_0x478b19){if(_0x478b19){return _0x478b19['destroy']()['then'](function(){var _0xe721ba=_0x478b19[_0xb135('0x15')]({'plain':!![]});var _0x3e3a9c=_0xb135('0x16');return db[_0xb135('0x17')][_0xb135('0x18')]({'where':{'type':_0x3e3a9c,'resourceId':_0xe721ba['id']}})[_0xb135('0x14')](function(){return _0x478b19;});})[_0xb135('0x14')](function(){_0x1e22bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1041cc){return function(_0x5c4bfa){if(!_0x5c4bfa){_0x1041cc['sendStatus'](0x194);}return _0x5c4bfa;};}function handleError(_0x30d209,_0x9c547){_0x9c547=_0x9c547||0x1f4;return function(_0x3ef473){logger[_0xb135('0x19')](_0x3ef473['stack']);if(_0x3ef473[_0xb135('0x1a')]){delete _0x3ef473[_0xb135('0x1a')];}_0x30d209[_0xb135('0xd')](_0x9c547)['send'](_0x3ef473);};}exports[_0xb135('0x1b')]=function(_0x4e6ec3,_0x28a9c7){var _0x4acec6={};var _0x2930b7={'count':0x0,'rows':[]};var _0x27941b=_[_0xb135('0x1c')](db[_0xb135('0x1d')][_0xb135('0x1e')],function(_0x4973b7){return{'name':_0x4973b7[_0xb135('0x1f')],'type':_0x4973b7[_0xb135('0x20')][_0xb135('0x21')]};});_0x4acec6=qs[_0xb135('0x22')](_0x27941b,_0x4e6ec3);var _0x4d3343={'where':_0x4acec6[_0xb135('0x23')]};return db[_0xb135('0x1d')][_0xb135('0x11')](_0x4d3343)[_0xb135('0x14')](function(_0x5145d1){_0x2930b7[_0xb135('0x11')]=_0x5145d1;_0x4acec6[_0xb135('0x24')]=qs[_0xb135('0x24')](_0x4e6ec3['query']);return db[_0xb135('0x1d')][_0xb135('0x25')](_0x4acec6);})[_0xb135('0x14')](function(_0x2a5a7a){_0x2930b7[_0xb135('0x26')]=_0x2a5a7a;return _0x2930b7;})[_0xb135('0x14')](respondWithFilteredResult(_0x28a9c7,_0x4acec6))[_0xb135('0x27')](handleError(_0x28a9c7,null));};exports[_0xb135('0x28')]=function(_0x81ece9,_0x1b9fd7){var _0x36b614={'raw':!![],'where':{'id':_0x81ece9[_0xb135('0x29')]['id']}},_0x252d09={};_0x252d09[_0xb135('0x2a')]=_[_0xb135('0x2b')](db[_0xb135('0x1d')][_0xb135('0x1e')]);_0x252d09[_0xb135('0x2c')]=_[_0xb135('0x2b')](_0x81ece9[_0xb135('0x2c')]);_0x252d09[_0xb135('0x2d')]=_[_0xb135('0x2e')](_0x252d09[_0xb135('0x2a')],_0x252d09['query']);_0x36b614[_0xb135('0x2f')]=_['intersection'](_0x252d09[_0xb135('0x2a')],qs[_0xb135('0x30')](_0x81ece9[_0xb135('0x2c')]['fields']));_0x36b614[_0xb135('0x2f')]=_0x36b614['attributes'][_0xb135('0x31')]?_0x36b614[_0xb135('0x2f')]:_0x252d09[_0xb135('0x2a')];if(_0x81ece9[_0xb135('0x2c')][_0xb135('0x32')]){_0x36b614[_0xb135('0x24')]=[{'all':!![]}];}_0x36b614=_[_0xb135('0x33')]({},_0x36b614,_0x81ece9[_0xb135('0x34')]);return db[_0xb135('0x1d')][_0xb135('0x35')](_0x36b614)[_0xb135('0x14')](handleEntityNotFound(_0x1b9fd7,null))[_0xb135('0x14')](respondWithResult(_0x1b9fd7,null))[_0xb135('0x27')](handleError(_0x1b9fd7,null));};exports[_0xb135('0x36')]=function(_0x32361b,_0xb3eb1f){return db[_0xb135('0x1d')][_0xb135('0x36')](_0x32361b[_0xb135('0x37')],{})['then'](function(_0x39a7c8){var _0x49d47e=_0x32361b[_0xb135('0x38')][_0xb135('0x15')]({'plain':!![]});if(!_0x49d47e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49d47e[_0xb135('0x39')]===_0xb135('0x38')){var _0x15a8c5=_0x39a7c8[_0xb135('0x15')]({'plain':!![]});var _0x2b83b8='MailQueues';return db[_0xb135('0x3a')]['find']({'where':{'name':_0x2b83b8,'userProfileId':_0x49d47e['userProfileId']},'raw':!![]})[_0xb135('0x14')](function(_0x4e0a34){if(_0x4e0a34&&_0x4e0a34[_0xb135('0x3b')]===0x0){return db[_0xb135('0x17')][_0xb135('0x36')]({'name':_0x15a8c5[_0xb135('0x1a')],'resourceId':_0x15a8c5['id'],'type':_0x4e0a34[_0xb135('0x1a')],'sectionId':_0x4e0a34['id']},{})[_0xb135('0x14')](function(){return _0x39a7c8;});}else{return _0x39a7c8;}})[_0xb135('0x27')](function(_0x4fbbf9){logger['error'](_0xb135('0x3c'),_0x4fbbf9);throw _0x4fbbf9;});}return _0x39a7c8;})['then'](respondWithResult(_0xb3eb1f,0xc9))['catch'](handleError(_0xb3eb1f,null));};exports['update']=function(_0x6b96ce,_0x4f7e47){if(_0x6b96ce['body']['id']){delete _0x6b96ce[_0xb135('0x37')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x6b96ce[_0xb135('0x29')]['id']}})[_0xb135('0x14')](handleEntityNotFound(_0x4f7e47,null))['then'](saveUpdates(_0x6b96ce[_0xb135('0x37')],null))[_0xb135('0x14')](respondWithResult(_0x4f7e47,null))[_0xb135('0x27')](handleError(_0x4f7e47,null));};exports[_0xb135('0x18')]=function(_0x4a3c0f,_0x4f182b){return db[_0xb135('0x1d')]['find']({'where':{'id':_0x4a3c0f[_0xb135('0x29')]['id']}})[_0xb135('0x14')](handleEntityNotFound(_0x4f182b,null))['then'](removeEntity(_0x4f182b,null))[_0xb135('0x27')](handleError(_0x4f182b,null));};exports[_0xb135('0x3d')]=function(_0xdb6293,_0x26d793){return db[_0xb135('0x1d')][_0xb135('0x3d')]()[_0xb135('0x14')](respondWithResult(_0x26d793,null))[_0xb135('0x27')](handleError(_0x26d793,null));};exports[_0xb135('0x3e')]=function(_0x32981b,_0x1aafda){var _0x2cfad5={'raw':!![],'where':{}},_0x2be6a6={},_0x3f91bd;return db['MailQueue'][_0xb135('0x3f')]({'where':{'id':_0x32981b[_0xb135('0x29')]['id']}})['then'](handleEntityNotFound(_0x1aafda,null))[_0xb135('0x14')](function(_0x4478ac){if(_0x4478ac){_0x3f91bd=_0x4478ac[_0xb135('0x15')]({'plain':!![]});_0x2be6a6[_0xb135('0x2a')]=_[_0xb135('0x2b')](db['UserMailQueue'][_0xb135('0x1e')]);_0x2be6a6[_0xb135('0x2c')]=_[_0xb135('0x2b')](_0x32981b[_0xb135('0x2c')]);_0x2be6a6[_0xb135('0x2d')]=_[_0xb135('0x2e')](_0x2be6a6['model'],_0x2be6a6[_0xb135('0x2c')]);_0x2cfad5[_0xb135('0x2f')]=_[_0xb135('0x2e')](_0x2be6a6[_0xb135('0x2a')],qs['fields'](_0x32981b[_0xb135('0x2c')][_0xb135('0x30')]));_0x2cfad5['attributes']=_0x2cfad5[_0xb135('0x2f')]['length']?_0x2cfad5[_0xb135('0x2f')]:_0x2be6a6['model'];if(!_0x32981b[_0xb135('0x2c')][_0xb135('0x40')]('nolimit')){_0x2cfad5[_0xb135('0x41')]=qs[_0xb135('0x41')](_0x32981b[_0xb135('0x2c')][_0xb135('0x41')]);_0x2cfad5['offset']=qs[_0xb135('0xf')](_0x32981b[_0xb135('0x2c')][_0xb135('0xf')]);}_0x2cfad5[_0xb135('0x42')]=qs[_0xb135('0x43')](_0x32981b[_0xb135('0x2c')]['sort']);_0x2cfad5['where']=qs[_0xb135('0x2d')](_[_0xb135('0x44')](_0x32981b[_0xb135('0x2c')],_0x2be6a6[_0xb135('0x2d')]));_0x2cfad5[_0xb135('0x23')]['MailQueueId']=_0x4478ac['id'];if(_0x32981b[_0xb135('0x2c')]['filter']){_0x2cfad5[_0xb135('0x23')]=_[_0xb135('0x33')](_0x2cfad5[_0xb135('0x23')],{'$or':_[_0xb135('0x1c')](_0x2cfad5[_0xb135('0x2f')],function(_0xa842a5){var _0x53cadb={};_0x53cadb[_0xa842a5]={'$like':'%'+_0x32981b['query'][_0xb135('0x45')]+'%'};return _0x53cadb;})});}_0x2cfad5=_[_0xb135('0x33')]({},_0x2cfad5,_0x32981b[_0xb135('0x34')]);return db['UserMailQueue'][_0xb135('0x25')](_0x2cfad5);}})[_0xb135('0x14')](function(_0x4186b1){if(_0x4186b1){return db[_0xb135('0x46')][_0xb135('0x47')]({'where':{'id':_[_0xb135('0x1c')](_0x4186b1,_0xb135('0x48')),'role':'agent'},'attributes':['id',_0xb135('0x1a'),_0xb135('0x49'),_0xb135('0x4a'),_0xb135('0x4b')]});}})['then'](function(_0x456886){if(_0x456886){return{'count':_0x456886[_0xb135('0x11')],'rows':_[_0xb135('0x1c')](_0x456886[_0xb135('0x26')],function(_0x3d5875){return{'membername':_0x3d5875[_0xb135('0x1a')],'UserId':_0x3d5875['id'],'queue_name':_0x3f91bd[_0xb135('0x1a')],'MailQueueId':_0x3f91bd['id'],'interface':util['format'](_0xb135('0x4c'),_0xb135('0x4d'),_0x3d5875['name']),'penalty':0x0,'paused':_0x3d5875[_0xb135('0x49')],'createdAt':_0x3d5875['createdAt'],'updatedAt':_0x3d5875[_0xb135('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb135('0x14')](respondWithFilteredResult(_0x1aafda,_0x2cfad5))[_0xb135('0x27')](handleError(_0x1aafda,null));};exports[_0xb135('0x4e')]=function(_0x4dcad1,_0xa2b714){var _0x4e0a60={};var _0x219078={};var _0xca4cc5;var _0x4b3b93;return db[_0xb135('0x1d')][_0xb135('0x3f')]({'where':{'id':_0x4dcad1[_0xb135('0x29')]['id']}})[_0xb135('0x14')](handleEntityNotFound(_0xa2b714,null))['then'](function(_0x32c818){if(_0x32c818){_0xca4cc5=_0x32c818;_0x219078['model']=_[_0xb135('0x2b')](db['Team'][_0xb135('0x1e')]);_0x219078[_0xb135('0x2c')]=_[_0xb135('0x2b')](_0x4dcad1['query']);_0x219078[_0xb135('0x2d')]=_[_0xb135('0x2e')](_0x219078[_0xb135('0x2a')],_0x219078[_0xb135('0x2c')]);_0x4e0a60[_0xb135('0x2f')]=_[_0xb135('0x2e')](_0x219078[_0xb135('0x2a')],qs[_0xb135('0x30')](_0x4dcad1[_0xb135('0x2c')][_0xb135('0x30')]));_0x4e0a60[_0xb135('0x2f')]=_0x4e0a60[_0xb135('0x2f')][_0xb135('0x31')]?_0x4e0a60['attributes']:_0x219078[_0xb135('0x2a')];_0x4e0a60['order']=qs['sort'](_0x4dcad1[_0xb135('0x2c')][_0xb135('0x43')]);_0x4e0a60[_0xb135('0x23')]=qs[_0xb135('0x2d')](_[_0xb135('0x44')](_0x4dcad1[_0xb135('0x2c')],_0x219078[_0xb135('0x2d')]));if(_0x4dcad1['query'][_0xb135('0x45')]){_0x4e0a60['where']=_[_0xb135('0x33')](_0x4e0a60[_0xb135('0x23')],{'$or':_[_0xb135('0x1c')](_0x4e0a60[_0xb135('0x2f')],function(_0x546527){var _0x34f9b6={};_0x34f9b6[_0x546527]={'$like':'%'+_0x4dcad1[_0xb135('0x2c')]['filter']+'%'};return _0x34f9b6;})});}_0x4e0a60=_['merge']({},_0x4e0a60,_0x4dcad1[_0xb135('0x34')]);return _0xca4cc5[_0xb135('0x4e')](_0x4e0a60);}})[_0xb135('0x14')](function(_0x55856f){if(_0x55856f){_0x4b3b93=_0x55856f[_0xb135('0x31')];if(!_0x4dcad1[_0xb135('0x2c')]['hasOwnProperty'](_0xb135('0x4f'))){_0x4e0a60['limit']=qs[_0xb135('0x41')](_0x4dcad1[_0xb135('0x2c')][_0xb135('0x41')]);_0x4e0a60['offset']=qs[_0xb135('0xf')](_0x4dcad1[_0xb135('0x2c')][_0xb135('0xf')]);}return _0xca4cc5[_0xb135('0x4e')](_0x4e0a60);}})['then'](function(_0x56bd68){if(_0x56bd68){return _0x56bd68?{'count':_0x4b3b93,'rows':_0x56bd68}:null;}})[_0xb135('0x14')](respondWithResult(_0xa2b714,null))['catch'](handleError(_0xa2b714,null));};exports['addTeams']=function(_0x10f2c2,_0x40821d){var _0x5a45a4=_0x10f2c2[_0xb135('0x37')][_0xb135('0x50')];return db[_0xb135('0x51')][_0xb135('0x25')]({'where':{'id':_0x5a45a4},'attributes':['id'],'include':[{'model':db[_0xb135('0x46')],'as':_0xb135('0x52'),'attributes':['id',_0xb135('0x1a'),_0xb135('0x53'),'voicePause',_0xb135('0x54')],'raw':!![]}]})[_0xb135('0x14')](function(_0x494e45){if(_0x494e45){var _0x211652=_[_0xb135('0x55')](_0x494e45,function(_0x3f170b){var _0x4ff389=_0x3f170b[_0xb135('0x15')]({'plain':!![]});return _0x4ff389[_0xb135('0x52')];});return db[_0xb135('0x1d')][_0xb135('0x35')]({'where':{'id':_0x10f2c2[_0xb135('0x29')]['id']}})['then'](function(_0x1e9c53){return db[_0xb135('0x56')][_0xb135('0x57')](function(_0x221530){return _0x1e9c53[_0xb135('0x58')](_0x5a45a4,{'transaction':_0x221530})[_0xb135('0x14')](function(){return BPromise[_0xb135('0x59')](_0x211652,function(_0xf09763){return db['UserMailQueue'][_0xb135('0x5a')]({'where':{'UserId':_0xf09763['id'],'MailQueueId':_0x10f2c2[_0xb135('0x29')]['id']},'transaction':_0x221530});});})[_0xb135('0x14')](function(){_0x211652[_0xb135('0x5b')](function(_0x510cf6){socket[_0xb135('0x5c')](_0xb135('0x5d'),{'UserId':_0x510cf6['id'],'MailQueueId':_0x1e9c53['id']});});});});});}})[_0xb135('0x14')](respondWithStatusCode(_0x40821d,null))[_0xb135('0x27')](handleError(_0x40821d,null));};exports[_0xb135('0x5e')]=function(_0x5c3626,_0x337d11){return db['Team']['findAll']({'where':{'id':_0x5c3626['query'][_0xb135('0x50')]},'attributes':['id'],'include':[{'model':db[_0xb135('0x46')],'as':_0xb135('0x52'),'attributes':['id'],'raw':!![]}]})[_0xb135('0x14')](handleEntityNotFound(_0x337d11,null))[_0xb135('0x14')](function(_0x58462c){var _0x2dbb6f=_[_0xb135('0x1c')](_0x58462c,'id');var _0x57803c=[];var _0x22ec12=[];var _0x1688a8=squel[_0xb135('0x5f')]();_0x1688a8[_0xb135('0x60')](_0xb135('0x61'))[_0xb135('0x62')](_0xb135('0x63'),'tq')[_0xb135('0x64')](_0xb135('0x65'),'ut',_0xb135('0x66'))['where'](_0xb135('0x67'),_0x5c3626[_0xb135('0x29')]['id']);for(var _0x57bc92=0x0;_0x57bc92<_0x58462c[_0xb135('0x31')];_0x57bc92+=0x1){let _0x4400dd=_0x58462c[_0x57bc92];for(var _0xe5946=0x0;_0xe5946<_0x4400dd['Agents'][_0xb135('0x31')];_0xe5946+=0x1){let _0x420317=_0x4400dd['Agents'][_0xe5946];var _0x54a384=_0x1688a8[_0xb135('0x68')]();_0x54a384[_0xb135('0x23')](_0xb135('0x69'),_0x420317['id']);_0x22ec12['push'](db[_0xb135('0x56')]['query'](_0x54a384[_0xb135('0x6a')](),{'type':db[_0xb135('0x56')]['QueryTypes'][_0xb135('0x6b')]})[_0xb135('0x14')](function(_0x170abc){if(_0x170abc[_0xb135('0x31')]===0x1){return _0x420317['id'];}else{var _0x102d9b=_[_0xb135('0x6c')](_[_0xb135('0x1c')](_0x170abc,_0xb135('0x6d')),function(_0xd6feba){return _['includes'](_0x2dbb6f,_0xd6feba);});if(_0x102d9b){return _0x420317['id'];}}}));}}return BPromise[_0xb135('0x6e')](_0x22ec12)['then'](function(_0x4d19cc){_0x57803c=_(_0x57803c)[_0xb135('0x6f')](_0x4d19cc)['compact']()[_0xb135('0x70')]();return db[_0xb135('0x1d')][_0xb135('0x35')]({'where':{'id':_0x5c3626['params']['id']}})[_0xb135('0x14')](function(_0x9160fa){return db['sequelize'][_0xb135('0x57')](function(_0x8b57a1){return _0x9160fa[_0xb135('0x5e')](_0x5c3626[_0xb135('0x2c')]['ids'],{'transaction':_0x8b57a1})[_0xb135('0x14')](function(){if(!_[_0xb135('0x71')](_0x57803c)){return _0x9160fa[_0xb135('0x72')](_0x57803c,{'transaction':_0x8b57a1});}})[_0xb135('0x14')](function(){_0x57803c['forEach'](function(_0x119f7e){socket[_0xb135('0x5c')](_0xb135('0x73'),{'UserId':_0x119f7e,'MailQueueId':_0x9160fa['id']});});});});});});})[_0xb135('0x14')](respondWithStatusCode(_0x337d11,null))['catch'](handleError(_0x337d11,null));};exports[_0xb135('0x74')]=function(_0x4c5e51,_0x412efe){return db['MailQueue'][_0xb135('0x35')]({'where':{'id':_0x4c5e51[_0xb135('0x29')]['id']}})[_0xb135('0x14')](handleEntityNotFound(_0x412efe,null))[_0xb135('0x14')](function(_0x595111){if(_0x595111){return _0x595111[_0xb135('0x74')](_0x4c5e51['body'][_0xb135('0x50')],_['omit'](_0x4c5e51['body'],[_0xb135('0x50'),'id'])||{})[_0xb135('0x75')](function(_0x130bbe){for(var _0x3a8d99=0x0;_0x3a8d99<_0x4c5e51[_0xb135('0x37')]['ids'][_0xb135('0x31')];_0x3a8d99+=0x1){socket[_0xb135('0x5c')](_0xb135('0x5d'),{'UserId':Number(_0x4c5e51[_0xb135('0x37')][_0xb135('0x50')][_0x3a8d99]),'MailQueueId':Number(_0x4c5e51[_0xb135('0x29')]['id'])});}return _0x130bbe;});}})[_0xb135('0x14')](respondWithResult(_0x412efe,null))[_0xb135('0x27')](handleError(_0x412efe,null));};exports['removeAgents']=function(_0x361824,_0x4ee89c){return db[_0xb135('0x1d')]['find']({'where':{'id':_0x361824[_0xb135('0x29')]['id']}})[_0xb135('0x14')](handleEntityNotFound(_0x4ee89c,null))[_0xb135('0x14')](function(_0x5c7a85){if(_0x5c7a85){return _0x5c7a85[_0xb135('0x72')](_0x361824[_0xb135('0x2c')]['ids'])['then'](function(){if(_[_0xb135('0x76')](_0x361824[_0xb135('0x2c')][_0xb135('0x50')])){for(var _0x270cff=0x0;_0x270cff<_0x361824[_0xb135('0x2c')][_0xb135('0x50')][_0xb135('0x31')];_0x270cff+=0x1){socket[_0xb135('0x5c')](_0xb135('0x73'),{'UserId':Number(_0x361824[_0xb135('0x2c')][_0xb135('0x50')][_0x270cff]),'MailQueueId':Number(_0x361824['params']['id'])});}}else{socket[_0xb135('0x5c')]('userMailQueue:remove',{'UserId':Number(_0x361824['query'][_0xb135('0x50')]),'MailQueueId':Number(_0x361824['params']['id'])});}});}})[_0xb135('0x14')](respondWithStatusCode(_0x4ee89c,null))[_0xb135('0x27')](handleError(_0x4ee89c,null));};exports[_0xb135('0x77')]=function(_0x12b43e,_0x448bf7){var _0x11283a={};var _0x57840a={};var _0x15a369;var _0x2ca6f1;return db['MailQueue']['findOne']({'where':{'id':_0x12b43e['params']['id']}})[_0xb135('0x14')](handleEntityNotFound(_0x448bf7,null))['then'](function(_0x2b48b0){if(_0x2b48b0){_0x15a369=_0x2b48b0;_0x57840a['model']=_[_0xb135('0x2b')](db[_0xb135('0x46')][_0xb135('0x1e')]);_0x57840a[_0xb135('0x2c')]=_[_0xb135('0x2b')](_0x12b43e[_0xb135('0x2c')]);_0x57840a[_0xb135('0x2d')]=_['intersection'](_0x57840a[_0xb135('0x2a')],_0x57840a[_0xb135('0x2c')]);_0x11283a[_0xb135('0x2f')]=_['intersection'](_0x57840a['model'],qs[_0xb135('0x30')](_0x12b43e[_0xb135('0x2c')][_0xb135('0x30')]));_0x11283a[_0xb135('0x2f')]=_0x11283a[_0xb135('0x2f')][_0xb135('0x31')]?_0x11283a[_0xb135('0x2f')]:_0x57840a[_0xb135('0x2a')];_0x11283a[_0xb135('0x42')]=qs['sort'](_0x12b43e[_0xb135('0x2c')][_0xb135('0x43')]);_0x11283a[_0xb135('0x23')]=qs[_0xb135('0x2d')](_[_0xb135('0x44')](_0x12b43e['query'],_0x57840a[_0xb135('0x2d')]));if(_0x12b43e[_0xb135('0x2c')]['filter']){_0x11283a[_0xb135('0x23')]=_['merge'](_0x11283a[_0xb135('0x23')],{'$or':_[_0xb135('0x1c')](_0x11283a['attributes'],function(_0x32a2ec){var _0x22d13e={};_0x22d13e[_0x32a2ec]={'$like':'%'+_0x12b43e[_0xb135('0x2c')][_0xb135('0x45')]+'%'};return _0x22d13e;})});}_0x11283a=_[_0xb135('0x33')]({},_0x11283a,_0x12b43e[_0xb135('0x34')]);return _0x15a369['getAgents'](_0x11283a);}})['then'](function(_0x4f56b6){if(_0x4f56b6){_0x2ca6f1=_0x4f56b6['length'];if(!_0x12b43e[_0xb135('0x2c')]['hasOwnProperty']('nolimit')){_0x11283a['limit']=qs[_0xb135('0x41')](_0x12b43e[_0xb135('0x2c')][_0xb135('0x41')]);_0x11283a[_0xb135('0xf')]=qs[_0xb135('0xf')](_0x12b43e['query'][_0xb135('0xf')]);}return _0x15a369['getAgents'](_0x11283a);}})[_0xb135('0x14')](function(_0x3b1776){if(_0x3b1776){return _0x3b1776?{'count':_0x2ca6f1,'rows':_0x3b1776}:null;}})['then'](respondWithResult(_0x448bf7,null))[_0xb135('0x27')](handleError(_0x448bf7,null));}; \ No newline at end of file +var _0x3028=['online','voicePause','flatMap','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','MailQueueId\x20=\x20?','clone','push','sequelize','toString','SELECT','TeamId','all','union','compact','isEmpty','removeAgents','addAgents','spread','isArray','userMailQueue:remove','getAgents','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','then','get','MailQueues','UserProfileResource','stack','name','send','map','MailQueue','rawAttributes','fieldName','type','include','query','findAll','rows','catch','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','hasOwnProperty','nolimit','order','sort','pick','where','MailQueueId','filter','User','findAndCountAll','UserId','agent','mailPause','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','ids','Agents'];(function(_0x4f08e3,_0x380124){var _0x410eae=function(_0x2d2920){while(--_0x2d2920){_0x4f08e3['push'](_0x4f08e3['shift']());}};_0x410eae(++_0x380124);}(_0x3028,0x112));var _0x8302=function(_0x312ff9,_0x3da93c){_0x312ff9=_0x312ff9-0x0;var _0x469683=_0x3028[_0x312ff9];return _0x469683;};'use strict';var BPromise=require(_0x8302('0x0'));var util=require('util');var _=require(_0x8302('0x1'));var squel=require(_0x8302('0x2'));var Redis=require(_0x8302('0x3'));var qs=require(_0x8302('0x4'));var logger=require(_0x8302('0x5'))(_0x8302('0x6'));var config=require(_0x8302('0x7'));var db=require(_0x8302('0x8'))['db'];config['redis']=_[_0x8302('0x9')](config[_0x8302('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8302('0xb'))(new Redis(config[_0x8302('0xa')]));require(_0x8302('0xc'))[_0x8302('0xd')](socket);function respondWithStatusCode(_0xb4b65a,_0x7ac13b){_0x7ac13b=_0x7ac13b||0xcc;return function(_0x149c70){if(_0x149c70){return _0xb4b65a[_0x8302('0xe')](_0x7ac13b);}return _0xb4b65a['status'](_0x7ac13b)[_0x8302('0xf')]();};}function respondWithResult(_0x54d890,_0x5a79a0){_0x5a79a0=_0x5a79a0||0xc8;return function(_0x39db53){if(_0x39db53){return _0x54d890[_0x8302('0x10')](_0x5a79a0)[_0x8302('0x11')](_0x39db53);}};}function respondWithFilteredResult(_0x1031cd,_0x5ee6e2){return function(_0x3f1aa2){if(_0x3f1aa2){var _0x1d3fb3=typeof _0x5ee6e2['offset']==='undefined'&&typeof _0x5ee6e2[_0x8302('0x12')]===_0x8302('0x13');var _0x4ae22d=_0x3f1aa2[_0x8302('0x14')];var _0x57727d=_0x1d3fb3?0x0:_0x5ee6e2[_0x8302('0x15')];var _0x400791=_0x1d3fb3?_0x3f1aa2['count']:_0x5ee6e2[_0x8302('0x15')]+_0x5ee6e2[_0x8302('0x12')];var _0x25257e;if(_0x400791>=_0x4ae22d){_0x400791=_0x4ae22d;_0x25257e=0xc8;}else{_0x25257e=0xce;}_0x1031cd[_0x8302('0x10')](_0x25257e);return _0x1031cd[_0x8302('0x16')](_0x8302('0x17'),_0x57727d+'-'+_0x400791+'/'+_0x4ae22d)[_0x8302('0x11')](_0x3f1aa2);}return null;};}function saveUpdates(_0x29e62e){return function(_0x4a21b5){if(_0x4a21b5){return _0x4a21b5['update'](_0x29e62e)[_0x8302('0x18')](function(_0x5eb191){return _0x5eb191;});}return null;};}function removeEntity(_0x2c19c0){return function(_0x282845){if(_0x282845){return _0x282845['destroy']()[_0x8302('0x18')](function(){var _0x26593f=_0x282845[_0x8302('0x19')]({'plain':!![]});var _0x27ac9a=_0x8302('0x1a');return db[_0x8302('0x1b')]['destroy']({'where':{'type':_0x27ac9a,'resourceId':_0x26593f['id']}})['then'](function(){return _0x282845;});})[_0x8302('0x18')](function(){_0x2c19c0[_0x8302('0x10')](0xcc)[_0x8302('0xf')]();});}};}function handleEntityNotFound(_0x5793e1){return function(_0x4887ad){if(!_0x4887ad){_0x5793e1[_0x8302('0xe')](0x194);}return _0x4887ad;};}function handleError(_0x571c0e,_0x89d032){_0x89d032=_0x89d032||0x1f4;return function(_0x36bc68){logger['error'](_0x36bc68[_0x8302('0x1c')]);if(_0x36bc68[_0x8302('0x1d')]){delete _0x36bc68[_0x8302('0x1d')];}_0x571c0e[_0x8302('0x10')](_0x89d032)[_0x8302('0x1e')](_0x36bc68);};}exports['index']=function(_0x1d2f5b,_0xc9e9c8){var _0xa3d3d3={};var _0x42de25={'count':0x0,'rows':[]};var _0xd960b=_[_0x8302('0x1f')](db[_0x8302('0x20')][_0x8302('0x21')],function(_0x9bf67f){return{'name':_0x9bf67f[_0x8302('0x22')],'type':_0x9bf67f[_0x8302('0x23')]['key']};});_0xa3d3d3=qs['getOptions'](_0xd960b,_0x1d2f5b);var _0x315a79={'where':_0xa3d3d3['where']};return db[_0x8302('0x20')]['count'](_0x315a79)['then'](function(_0x2cf04e){_0x42de25[_0x8302('0x14')]=_0x2cf04e;_0xa3d3d3[_0x8302('0x24')]=qs['include'](_0x1d2f5b[_0x8302('0x25')]);return db[_0x8302('0x20')][_0x8302('0x26')](_0xa3d3d3);})[_0x8302('0x18')](function(_0x461b0f){_0x42de25[_0x8302('0x27')]=_0x461b0f;return _0x42de25;})[_0x8302('0x18')](respondWithFilteredResult(_0xc9e9c8,_0xa3d3d3))[_0x8302('0x28')](handleError(_0xc9e9c8,null));};exports['show']=function(_0x4b524a,_0x3a1c00){var _0x577fbb={'raw':!![],'where':{'id':_0x4b524a[_0x8302('0x29')]['id']}},_0x23941f={};_0x23941f[_0x8302('0x2a')]=_['keys'](db[_0x8302('0x20')]['rawAttributes']);_0x23941f[_0x8302('0x25')]=_[_0x8302('0x2b')](_0x4b524a[_0x8302('0x25')]);_0x23941f[_0x8302('0x2c')]=_[_0x8302('0x2d')](_0x23941f['model'],_0x23941f[_0x8302('0x25')]);_0x577fbb[_0x8302('0x2e')]=_[_0x8302('0x2d')](_0x23941f[_0x8302('0x2a')],qs[_0x8302('0x2f')](_0x4b524a[_0x8302('0x25')][_0x8302('0x2f')]));_0x577fbb[_0x8302('0x2e')]=_0x577fbb['attributes'][_0x8302('0x30')]?_0x577fbb[_0x8302('0x2e')]:_0x23941f['model'];if(_0x4b524a[_0x8302('0x25')][_0x8302('0x31')]){_0x577fbb[_0x8302('0x24')]=[{'all':!![]}];}_0x577fbb=_[_0x8302('0x32')]({},_0x577fbb,_0x4b524a[_0x8302('0x33')]);return db[_0x8302('0x20')][_0x8302('0x34')](_0x577fbb)['then'](handleEntityNotFound(_0x3a1c00,null))[_0x8302('0x18')](respondWithResult(_0x3a1c00,null))[_0x8302('0x28')](handleError(_0x3a1c00,null));};exports[_0x8302('0x35')]=function(_0x1539f0,_0x5aa709){return db['MailQueue']['create'](_0x1539f0[_0x8302('0x36')],{})[_0x8302('0x18')](function(_0x13abf8){var _0x37ab42=_0x1539f0[_0x8302('0x37')][_0x8302('0x19')]({'plain':!![]});if(!_0x37ab42)throw new Error(_0x8302('0x38'));if(_0x37ab42[_0x8302('0x39')]===_0x8302('0x37')){var _0x368a8e=_0x13abf8[_0x8302('0x19')]({'plain':!![]});var _0x32dd92='MailQueues';return db[_0x8302('0x3a')][_0x8302('0x34')]({'where':{'name':_0x32dd92,'userProfileId':_0x37ab42[_0x8302('0x3b')]},'raw':!![]})[_0x8302('0x18')](function(_0x21b347){if(_0x21b347&&_0x21b347[_0x8302('0x3c')]===0x0){return db[_0x8302('0x1b')][_0x8302('0x35')]({'name':_0x368a8e['name'],'resourceId':_0x368a8e['id'],'type':_0x21b347[_0x8302('0x1d')],'sectionId':_0x21b347['id']},{})[_0x8302('0x18')](function(){return _0x13abf8;});}else{return _0x13abf8;}})[_0x8302('0x28')](function(_0x4eef73){logger[_0x8302('0x3d')](_0x8302('0x3e'),_0x4eef73);throw _0x4eef73;});}return _0x13abf8;})['then'](respondWithResult(_0x5aa709,0xc9))[_0x8302('0x28')](handleError(_0x5aa709,null));};exports['update']=function(_0x46d0c7,_0x231ec8){if(_0x46d0c7[_0x8302('0x36')]['id']){delete _0x46d0c7['body']['id'];}return db[_0x8302('0x20')][_0x8302('0x34')]({'where':{'id':_0x46d0c7['params']['id']}})[_0x8302('0x18')](handleEntityNotFound(_0x231ec8,null))[_0x8302('0x18')](saveUpdates(_0x46d0c7[_0x8302('0x36')],null))[_0x8302('0x18')](respondWithResult(_0x231ec8,null))[_0x8302('0x28')](handleError(_0x231ec8,null));};exports['destroy']=function(_0x2d934e,_0x3b7766){return db[_0x8302('0x20')][_0x8302('0x34')]({'where':{'id':_0x2d934e['params']['id']}})[_0x8302('0x18')](handleEntityNotFound(_0x3b7766,null))[_0x8302('0x18')](removeEntity(_0x3b7766,null))[_0x8302('0x28')](handleError(_0x3b7766,null));};exports[_0x8302('0x3f')]=function(_0x232d09,_0x48d6ec){return db[_0x8302('0x20')][_0x8302('0x3f')]()[_0x8302('0x18')](respondWithResult(_0x48d6ec,null))[_0x8302('0x28')](handleError(_0x48d6ec,null));};exports[_0x8302('0x40')]=function(_0x46d1cb,_0x174933){var _0x27de88={'raw':!![],'where':{}},_0x6b00de={},_0x3d1207;return db['MailQueue']['findOne']({'where':{'id':_0x46d1cb['params']['id']}})[_0x8302('0x18')](handleEntityNotFound(_0x174933,null))[_0x8302('0x18')](function(_0x10bceb){if(_0x10bceb){_0x3d1207=_0x10bceb['get']({'plain':!![]});_0x6b00de[_0x8302('0x2a')]=_[_0x8302('0x2b')](db[_0x8302('0x41')][_0x8302('0x21')]);_0x6b00de[_0x8302('0x25')]=_[_0x8302('0x2b')](_0x46d1cb[_0x8302('0x25')]);_0x6b00de[_0x8302('0x2c')]=_['intersection'](_0x6b00de[_0x8302('0x2a')],_0x6b00de[_0x8302('0x25')]);_0x27de88[_0x8302('0x2e')]=_[_0x8302('0x2d')](_0x6b00de[_0x8302('0x2a')],qs['fields'](_0x46d1cb[_0x8302('0x25')][_0x8302('0x2f')]));_0x27de88[_0x8302('0x2e')]=_0x27de88[_0x8302('0x2e')][_0x8302('0x30')]?_0x27de88[_0x8302('0x2e')]:_0x6b00de[_0x8302('0x2a')];if(!_0x46d1cb[_0x8302('0x25')][_0x8302('0x42')](_0x8302('0x43'))){_0x27de88[_0x8302('0x12')]=qs[_0x8302('0x12')](_0x46d1cb[_0x8302('0x25')][_0x8302('0x12')]);_0x27de88[_0x8302('0x15')]=qs[_0x8302('0x15')](_0x46d1cb['query'][_0x8302('0x15')]);}_0x27de88[_0x8302('0x44')]=qs[_0x8302('0x45')](_0x46d1cb['query'][_0x8302('0x45')]);_0x27de88['where']=qs[_0x8302('0x2c')](_[_0x8302('0x46')](_0x46d1cb[_0x8302('0x25')],_0x6b00de[_0x8302('0x2c')]));_0x27de88[_0x8302('0x47')][_0x8302('0x48')]=_0x10bceb['id'];if(_0x46d1cb[_0x8302('0x25')][_0x8302('0x49')]){_0x27de88[_0x8302('0x47')]=_[_0x8302('0x32')](_0x27de88['where'],{'$or':_[_0x8302('0x1f')](_0x27de88[_0x8302('0x2e')],function(_0x1abe6c){var _0x27f1b7={};_0x27f1b7[_0x1abe6c]={'$like':'%'+_0x46d1cb[_0x8302('0x25')][_0x8302('0x49')]+'%'};return _0x27f1b7;})});}_0x27de88=_['merge']({},_0x27de88,_0x46d1cb[_0x8302('0x33')]);return db[_0x8302('0x41')][_0x8302('0x26')](_0x27de88);}})[_0x8302('0x18')](function(_0x56589b){if(_0x56589b){return db[_0x8302('0x4a')][_0x8302('0x4b')]({'where':{'id':_[_0x8302('0x1f')](_0x56589b,_0x8302('0x4c')),'role':_0x8302('0x4d')},'attributes':['id',_0x8302('0x1d'),_0x8302('0x4e'),'updatedAt',_0x8302('0x4f')]});}})['then'](function(_0x52d7ee){if(_0x52d7ee){return{'count':_0x52d7ee[_0x8302('0x14')],'rows':_[_0x8302('0x1f')](_0x52d7ee[_0x8302('0x27')],function(_0x17ddf5){return{'membername':_0x17ddf5[_0x8302('0x1d')],'UserId':_0x17ddf5['id'],'queue_name':_0x3d1207['name'],'MailQueueId':_0x3d1207['id'],'interface':util[_0x8302('0x50')](_0x8302('0x51'),_0x8302('0x52'),_0x17ddf5['name']),'penalty':0x0,'paused':_0x17ddf5['mailPause'],'createdAt':_0x17ddf5[_0x8302('0x4f')],'updatedAt':_0x17ddf5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8302('0x18')](respondWithFilteredResult(_0x174933,_0x27de88))['catch'](handleError(_0x174933,null));};exports['getTeams']=function(_0x51f948,_0x2381df){var _0x3931ac={};var _0x1a76d8={};var _0xa1694c;var _0x2d5296;return db[_0x8302('0x20')][_0x8302('0x53')]({'where':{'id':_0x51f948[_0x8302('0x29')]['id']}})['then'](handleEntityNotFound(_0x2381df,null))[_0x8302('0x18')](function(_0x4e37de){if(_0x4e37de){_0xa1694c=_0x4e37de;_0x1a76d8[_0x8302('0x2a')]=_[_0x8302('0x2b')](db[_0x8302('0x54')][_0x8302('0x21')]);_0x1a76d8[_0x8302('0x25')]=_['keys'](_0x51f948[_0x8302('0x25')]);_0x1a76d8[_0x8302('0x2c')]=_[_0x8302('0x2d')](_0x1a76d8[_0x8302('0x2a')],_0x1a76d8[_0x8302('0x25')]);_0x3931ac[_0x8302('0x2e')]=_[_0x8302('0x2d')](_0x1a76d8[_0x8302('0x2a')],qs[_0x8302('0x2f')](_0x51f948['query'][_0x8302('0x2f')]));_0x3931ac[_0x8302('0x2e')]=_0x3931ac[_0x8302('0x2e')][_0x8302('0x30')]?_0x3931ac['attributes']:_0x1a76d8[_0x8302('0x2a')];_0x3931ac['order']=qs[_0x8302('0x45')](_0x51f948[_0x8302('0x25')][_0x8302('0x45')]);_0x3931ac[_0x8302('0x47')]=qs[_0x8302('0x2c')](_[_0x8302('0x46')](_0x51f948[_0x8302('0x25')],_0x1a76d8[_0x8302('0x2c')]));if(_0x51f948['query'][_0x8302('0x49')]){_0x3931ac[_0x8302('0x47')]=_[_0x8302('0x32')](_0x3931ac[_0x8302('0x47')],{'$or':_[_0x8302('0x1f')](_0x3931ac[_0x8302('0x2e')],function(_0x51e12b){var _0x125a90={};_0x125a90[_0x51e12b]={'$like':'%'+_0x51f948[_0x8302('0x25')][_0x8302('0x49')]+'%'};return _0x125a90;})});}_0x3931ac=_[_0x8302('0x32')]({},_0x3931ac,_0x51f948['options']);return _0xa1694c[_0x8302('0x55')](_0x3931ac);}})['then'](function(_0x7fa64e){if(_0x7fa64e){_0x2d5296=_0x7fa64e[_0x8302('0x30')];if(!_0x51f948[_0x8302('0x25')][_0x8302('0x42')](_0x8302('0x43'))){_0x3931ac[_0x8302('0x12')]=qs['limit'](_0x51f948[_0x8302('0x25')][_0x8302('0x12')]);_0x3931ac[_0x8302('0x15')]=qs['offset'](_0x51f948['query'][_0x8302('0x15')]);}return _0xa1694c[_0x8302('0x55')](_0x3931ac);}})['then'](function(_0x4761c5){if(_0x4761c5){return _0x4761c5?{'count':_0x2d5296,'rows':_0x4761c5}:null;}})[_0x8302('0x18')](respondWithResult(_0x2381df,null))['catch'](handleError(_0x2381df,null));};exports[_0x8302('0x56')]=function(_0x155320,_0x2ec716){var _0x82e9cb=_0x155320[_0x8302('0x36')][_0x8302('0x57')];return db[_0x8302('0x54')][_0x8302('0x26')]({'where':{'id':_0x82e9cb},'attributes':['id'],'include':[{'model':db[_0x8302('0x4a')],'as':_0x8302('0x58'),'attributes':['id',_0x8302('0x1d'),_0x8302('0x59'),_0x8302('0x5a'),'interface'],'raw':!![]}]})[_0x8302('0x18')](function(_0x3e7789){if(_0x3e7789){var _0xeeb544=_[_0x8302('0x5b')](_0x3e7789,function(_0x3711f8){var _0xd7c66f=_0x3711f8[_0x8302('0x19')]({'plain':!![]});return _0xd7c66f[_0x8302('0x58')];});return db['MailQueue']['find']({'where':{'id':_0x155320[_0x8302('0x29')]['id']}})[_0x8302('0x18')](function(_0x2154dc){return db['sequelize'][_0x8302('0x5c')](function(_0x388755){return _0x2154dc[_0x8302('0x56')](_0x82e9cb,{'transaction':_0x388755})[_0x8302('0x18')](function(){return BPromise[_0x8302('0x5d')](_0xeeb544,function(_0x7e008f){return db[_0x8302('0x41')][_0x8302('0x5e')]({'where':{'UserId':_0x7e008f['id'],'MailQueueId':_0x155320['params']['id']},'transaction':_0x388755});});})[_0x8302('0x18')](function(){_0xeeb544[_0x8302('0x5f')](function(_0x2b5727){socket[_0x8302('0x60')](_0x8302('0x61'),{'UserId':_0x2b5727['id'],'MailQueueId':_0x2154dc['id']});});});});});}})[_0x8302('0x18')](respondWithStatusCode(_0x2ec716,null))[_0x8302('0x28')](handleError(_0x2ec716,null));};exports[_0x8302('0x62')]=function(_0x18cb1d,_0x55350a){return db[_0x8302('0x54')][_0x8302('0x26')]({'where':{'id':_0x18cb1d[_0x8302('0x25')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8302('0x4a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x55350a,null))['then'](function(_0x5df259){var _0x1c2ab9=_['map'](_0x5df259,'id');var _0x307ee6=[];var _0x207245=[];var _0x4d49ff=squel[_0x8302('0x63')]();_0x4d49ff['field'](_0x8302('0x64'))[_0x8302('0x65')]('team_has_mail_queues','tq')[_0x8302('0x66')](_0x8302('0x67'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8302('0x47')](_0x8302('0x68'),_0x18cb1d['params']['id']);for(var _0x2f0e32=0x0;_0x2f0e32<_0x5df259['length'];_0x2f0e32+=0x1){let _0x28af77=_0x5df259[_0x2f0e32];for(var _0x3bede9=0x0;_0x3bede9<_0x28af77['Agents'][_0x8302('0x30')];_0x3bede9+=0x1){let _0x546c68=_0x28af77['Agents'][_0x3bede9];var _0x4bf16a=_0x4d49ff[_0x8302('0x69')]();_0x4bf16a[_0x8302('0x47')]('ut.UserId\x20=\x20?',_0x546c68['id']);_0x207245[_0x8302('0x6a')](db[_0x8302('0x6b')][_0x8302('0x25')](_0x4bf16a[_0x8302('0x6c')](),{'type':db[_0x8302('0x6b')]['QueryTypes'][_0x8302('0x6d')]})[_0x8302('0x18')](function(_0x432a38){if(_0x432a38[_0x8302('0x30')]===0x1){return _0x546c68['id'];}else{var _0x584d29=_['every'](_['map'](_0x432a38,_0x8302('0x6e')),function(_0x36efda){return _['includes'](_0x1c2ab9,_0x36efda);});if(_0x584d29){return _0x546c68['id'];}}}));}}return BPromise[_0x8302('0x6f')](_0x207245)[_0x8302('0x18')](function(_0x1b8795){_0x307ee6=_(_0x307ee6)[_0x8302('0x70')](_0x1b8795)[_0x8302('0x71')]()['value']();return db[_0x8302('0x20')][_0x8302('0x34')]({'where':{'id':_0x18cb1d[_0x8302('0x29')]['id']}})['then'](function(_0x2f2538){return db[_0x8302('0x6b')][_0x8302('0x5c')](function(_0x30e4c1){return _0x2f2538[_0x8302('0x62')](_0x18cb1d[_0x8302('0x25')][_0x8302('0x57')],{'transaction':_0x30e4c1})[_0x8302('0x18')](function(){if(!_[_0x8302('0x72')](_0x307ee6)){return _0x2f2538[_0x8302('0x73')](_0x307ee6,{'transaction':_0x30e4c1});}})['then'](function(){_0x307ee6[_0x8302('0x5f')](function(_0x48f182){socket[_0x8302('0x60')]('userMailQueue:remove',{'UserId':_0x48f182,'MailQueueId':_0x2f2538['id']});});});});});});})[_0x8302('0x18')](respondWithStatusCode(_0x55350a,null))[_0x8302('0x28')](handleError(_0x55350a,null));};exports[_0x8302('0x74')]=function(_0x3caba1,_0x280be1){return db[_0x8302('0x20')][_0x8302('0x34')]({'where':{'id':_0x3caba1[_0x8302('0x29')]['id']}})[_0x8302('0x18')](handleEntityNotFound(_0x280be1,null))[_0x8302('0x18')](function(_0x3f7899){if(_0x3f7899){return _0x3f7899[_0x8302('0x74')](_0x3caba1[_0x8302('0x36')][_0x8302('0x57')],_['omit'](_0x3caba1[_0x8302('0x36')],[_0x8302('0x57'),'id'])||{})[_0x8302('0x75')](function(_0x3f1917){for(var _0x4e8853=0x0;_0x4e8853<_0x3caba1[_0x8302('0x36')][_0x8302('0x57')][_0x8302('0x30')];_0x4e8853+=0x1){socket['emit'](_0x8302('0x61'),{'UserId':Number(_0x3caba1[_0x8302('0x36')]['ids'][_0x4e8853]),'MailQueueId':Number(_0x3caba1[_0x8302('0x29')]['id'])});}return _0x3f1917;});}})[_0x8302('0x18')](respondWithResult(_0x280be1,null))[_0x8302('0x28')](handleError(_0x280be1,null));};exports[_0x8302('0x73')]=function(_0x3ff897,_0x43f21d){return db['MailQueue'][_0x8302('0x34')]({'where':{'id':_0x3ff897[_0x8302('0x29')]['id']}})[_0x8302('0x18')](handleEntityNotFound(_0x43f21d,null))[_0x8302('0x18')](function(_0x5ea702){if(_0x5ea702){return _0x5ea702['removeAgents'](_0x3ff897[_0x8302('0x25')][_0x8302('0x57')])[_0x8302('0x18')](function(){if(_[_0x8302('0x76')](_0x3ff897[_0x8302('0x25')][_0x8302('0x57')])){for(var _0x43730d=0x0;_0x43730d<_0x3ff897[_0x8302('0x25')][_0x8302('0x57')][_0x8302('0x30')];_0x43730d+=0x1){socket[_0x8302('0x60')](_0x8302('0x77'),{'UserId':Number(_0x3ff897['query'][_0x8302('0x57')][_0x43730d]),'MailQueueId':Number(_0x3ff897[_0x8302('0x29')]['id'])});}}else{socket[_0x8302('0x60')](_0x8302('0x77'),{'UserId':Number(_0x3ff897[_0x8302('0x25')][_0x8302('0x57')]),'MailQueueId':Number(_0x3ff897[_0x8302('0x29')]['id'])});}});}})[_0x8302('0x18')](respondWithStatusCode(_0x43f21d,null))[_0x8302('0x28')](handleError(_0x43f21d,null));};exports['getAgents']=function(_0x135e7f,_0x56588f){var _0x2792ff={};var _0x5816b8={};var _0x3db76f;var _0x12a784;return db[_0x8302('0x20')]['findOne']({'where':{'id':_0x135e7f[_0x8302('0x29')]['id']}})['then'](handleEntityNotFound(_0x56588f,null))[_0x8302('0x18')](function(_0x2c800c){if(_0x2c800c){_0x3db76f=_0x2c800c;_0x5816b8[_0x8302('0x2a')]=_[_0x8302('0x2b')](db['User'][_0x8302('0x21')]);_0x5816b8['query']=_[_0x8302('0x2b')](_0x135e7f[_0x8302('0x25')]);_0x5816b8[_0x8302('0x2c')]=_[_0x8302('0x2d')](_0x5816b8[_0x8302('0x2a')],_0x5816b8[_0x8302('0x25')]);_0x2792ff[_0x8302('0x2e')]=_[_0x8302('0x2d')](_0x5816b8[_0x8302('0x2a')],qs[_0x8302('0x2f')](_0x135e7f[_0x8302('0x25')][_0x8302('0x2f')]));_0x2792ff[_0x8302('0x2e')]=_0x2792ff[_0x8302('0x2e')][_0x8302('0x30')]?_0x2792ff[_0x8302('0x2e')]:_0x5816b8[_0x8302('0x2a')];_0x2792ff[_0x8302('0x44')]=qs[_0x8302('0x45')](_0x135e7f[_0x8302('0x25')][_0x8302('0x45')]);_0x2792ff[_0x8302('0x47')]=qs[_0x8302('0x2c')](_[_0x8302('0x46')](_0x135e7f[_0x8302('0x25')],_0x5816b8[_0x8302('0x2c')]));if(_0x135e7f[_0x8302('0x25')]['filter']){_0x2792ff[_0x8302('0x47')]=_[_0x8302('0x32')](_0x2792ff[_0x8302('0x47')],{'$or':_[_0x8302('0x1f')](_0x2792ff['attributes'],function(_0x284a7f){var _0x4b054a={};_0x4b054a[_0x284a7f]={'$like':'%'+_0x135e7f[_0x8302('0x25')][_0x8302('0x49')]+'%'};return _0x4b054a;})});}_0x2792ff=_[_0x8302('0x32')]({},_0x2792ff,_0x135e7f[_0x8302('0x33')]);return _0x3db76f[_0x8302('0x78')](_0x2792ff);}})['then'](function(_0x129647){if(_0x129647){_0x12a784=_0x129647[_0x8302('0x30')];if(!_0x135e7f[_0x8302('0x25')][_0x8302('0x42')](_0x8302('0x43'))){_0x2792ff['limit']=qs['limit'](_0x135e7f['query'][_0x8302('0x12')]);_0x2792ff[_0x8302('0x15')]=qs['offset'](_0x135e7f[_0x8302('0x25')][_0x8302('0x15')]);}return _0x3db76f[_0x8302('0x78')](_0x2792ff);}})['then'](function(_0x4638ee){if(_0x4638ee){return _0x4638ee?{'count':_0x12a784,'rows':_0x4638ee}:null;}})['then'](respondWithResult(_0x56588f,null))[_0x8302('0x28')](handleError(_0x56588f,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index b1117d6..68eb86d 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 _0x4e59=['emit','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove'];(function(_0x5654df,_0x395bb2){var _0x7e5ba4=function(_0x38e76a){while(--_0x38e76a){_0x5654df['push'](_0x5654df['shift']());}};_0x7e5ba4(++_0x395bb2);}(_0x4e59,0xb6));var _0x94e5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4e59[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x94e5('0x0'));var MailQueue=require(_0x94e5('0x1'))['db'][_0x94e5('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x94e5('0x3')](0x0);var events={'afterCreate':_0x94e5('0x4'),'afterUpdate':_0x94e5('0x5'),'afterDestroy':_0x94e5('0x6')};function emitEvent(_0x4dbb7d){return function(_0x4fc251,_0x20a41f,_0x288faf){MailQueueEvents['emit'](_0x4dbb7d+':'+_0x4fc251['id'],_0x4fc251);MailQueueEvents[_0x94e5('0x7')](_0x4dbb7d,_0x4fc251);_0x288faf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x94e5('0x8')]=MailQueueEvents; \ No newline at end of file +var _0xb55b=['save','emit','hook','exports','MailQueue','setMaxListeners'];(function(_0xd56532,_0x229c9e){var _0x4fef28=function(_0x455c40){while(--_0x455c40){_0xd56532['push'](_0xd56532['shift']());}};_0x4fef28(++_0x229c9e);}(_0xb55b,0x166));var _0xbb55=function(_0x5e58d7,_0x1f8bfe){_0x5e58d7=_0x5e58d7-0x0;var _0x1f7d72=_0xb55b[_0x5e58d7];return _0x1f7d72;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0xbb55('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xbb55('0x1')](0x0);var events={'afterCreate':_0xbb55('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc9e2af){return function(_0x41dcf1,_0x42d5d0,_0x20fd5f){MailQueueEvents[_0xbb55('0x3')](_0xc9e2af+':'+_0x41dcf1['id'],_0x41dcf1);MailQueueEvents[_0xbb55('0x3')](_0xc9e2af,_0x41dcf1);_0x20fd5f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xbb55('0x4')](e,emitEvent(event));}}module[_0xbb55('0x5')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index d7d1ff0..33cac38 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 _0xef0b=['moment','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','mail_queues','lodash','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xef0b,0x1c9));var _0xbef0=function(_0x2d2185,_0x23db5d){_0x2d2185=_0x2d2185-0x0;var _0x17fa34=_0xef0b[_0x2d2185];return _0x17fa34;};'use strict';var _=require(_0xbef0('0x0'));var util=require('util');var logger=require(_0xbef0('0x1'))(_0xbef0('0x2'));var moment=require(_0xbef0('0x3'));var BPromise=require('bluebird');var rp=require(_0xbef0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbef0('0x5'));var config=require(_0xbef0('0x6'));var attributes=require(_0xbef0('0x7'));module[_0xbef0('0x8')]=function(_0x1d8635,_0x27fb25){return _0x1d8635['define']('MailQueue',attributes,{'tableName':_0xbef0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf633=['./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf633,0x1b1));var _0x3f63=function(_0x1ac9bc,_0x3af549){_0x1ac9bc=_0x1ac9bc-0x0;var _0x14f5a8=_0xf633[_0x1ac9bc];return _0x14f5a8;};'use strict';var _=require(_0x3f63('0x0'));var util=require(_0x3f63('0x1'));var logger=require(_0x3f63('0x2'))('api');var moment=require(_0x3f63('0x3'));var BPromise=require(_0x3f63('0x4'));var rp=require(_0x3f63('0x5'));var fs=require('fs');var path=require(_0x3f63('0x6'));var rimraf=require(_0x3f63('0x7'));var config=require(_0x3f63('0x8'));var attributes=require(_0x3f63('0x9'));module['exports']=function(_0x107993,_0x407edb){return _0x107993[_0x3f63('0xa')](_0x3f63('0xb'),attributes,{'tableName':_0x3f63('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 2c64c4b..765c055 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 _0x7b19=['MailQueue','find','ShowMailQueue','lodash','moment','ioredis','../../config/logger','rpc','client','http','redis','defaults','localhost','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetMailQueue','findAll','options','raw','where','attributes','map','include','model'];(function(_0x5152c0,_0x318148){var _0x3d0c73=function(_0x5529e8){while(--_0x5529e8){_0x5152c0['push'](_0x5152c0['shift']());}};_0x3d0c73(++_0x318148);}(_0x7b19,0x1df));var _0x97b1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7b19[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x97b1('0x0'));var util=require('util');var moment=require(_0x97b1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97b1('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x97b1('0x3'))(_0x97b1('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x97b1('0x5')][_0x97b1('0x6')]({'port':0x232a});config[_0x97b1('0x7')]=_[_0x97b1('0x8')](config[_0x97b1('0x7')],{'host':_0x97b1('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x97b1('0x7')]));require('./mailQueue.socket')[_0x97b1('0xa')](socket);function respondWithRpcPromise(_0x457f86,_0x3a7beb,_0x4f8735){return new BPromise(function(_0x431134,_0x76b612){return client[_0x97b1('0xb')](_0x457f86,_0x4f8735)[_0x97b1('0xc')](function(_0x94e716){logger[_0x97b1('0xd')](_0x97b1('0xe'),_0x3a7beb,_0x97b1('0xf'));logger[_0x97b1('0x10')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x3a7beb,_0x97b1('0xf'),JSON[_0x97b1('0x11')](_0x94e716));if(_0x94e716[_0x97b1('0x12')]){if(_0x94e716[_0x97b1('0x12')][_0x97b1('0x13')]===0x1f4){logger[_0x97b1('0x12')](_0x97b1('0xe'),_0x3a7beb,_0x94e716[_0x97b1('0x12')][_0x97b1('0x14')]);return _0x76b612(_0x94e716[_0x97b1('0x12')]['message']);}logger[_0x97b1('0x12')]('MailQueue,\x20%s,\x20%s',_0x3a7beb,_0x94e716['error'][_0x97b1('0x14')]);return _0x431134(_0x94e716['error']['message']);}else{logger['info'](_0x97b1('0xe'),_0x3a7beb,_0x97b1('0xf'));_0x431134(_0x94e716['result'][_0x97b1('0x14')]);}})[_0x97b1('0x15')](function(_0x2036d5){logger['error'](_0x97b1('0xe'),_0x3a7beb,_0x2036d5);_0x76b612(_0x2036d5);});});}exports[_0x97b1('0x16')]=function(_0x17a9a5){var _0x3e6ff2=this;return new Promise(function(_0x1592d8,_0x1cb65e){return db['MailQueue'][_0x97b1('0x17')]({'raw':_0x17a9a5['options']?_0x17a9a5[_0x97b1('0x18')][_0x97b1('0x19')]===undefined?!![]:![]:!![],'where':_0x17a9a5['options']?_0x17a9a5['options'][_0x97b1('0x1a')]||null:null,'attributes':_0x17a9a5[_0x97b1('0x18')]?_0x17a9a5[_0x97b1('0x18')][_0x97b1('0x1b')]||null:null,'limit':_0x17a9a5['options']?_0x17a9a5[_0x97b1('0x18')]['limit']||null:null,'include':_0x17a9a5[_0x97b1('0x18')]?_0x17a9a5['options']['include']?_[_0x97b1('0x1c')](_0x17a9a5[_0x97b1('0x18')][_0x97b1('0x1d')],function(_0xf8257a){return{'model':db[_0xf8257a[_0x97b1('0x1e')]],'as':_0xf8257a['as'],'attributes':_0xf8257a[_0x97b1('0x1b')],'include':_0xf8257a[_0x97b1('0x1d')]?_[_0x97b1('0x1c')](_0xf8257a[_0x97b1('0x1d')],function(_0x31856a){return{'model':db[_0x31856a[_0x97b1('0x1e')]],'as':_0x31856a['as'],'attributes':_0x31856a[_0x97b1('0x1b')],'include':_0x31856a[_0x97b1('0x1d')]?_['map'](_0x31856a[_0x97b1('0x1d')],function(_0x286c52){return{'model':db[_0x286c52[_0x97b1('0x1e')]],'as':_0x286c52['as'],'attributes':_0x286c52[_0x97b1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x97b1('0xc')](function(_0x657531){logger[_0x97b1('0xd')](_0x97b1('0x16'),_0x17a9a5);logger['debug']('GetMailQueue',_0x17a9a5,JSON[_0x97b1('0x11')](_0x657531));_0x1592d8(_0x657531);})[_0x97b1('0x15')](function(_0x340ad3){logger[_0x97b1('0x12')](_0x97b1('0x16'),_0x340ad3['message'],_0x17a9a5);_0x1cb65e(_0x3e6ff2[_0x97b1('0x12')](0x1f4,_0x340ad3[_0x97b1('0x14')]));});});};exports['ShowMailQueue']=function(_0x152fbc){var _0xa91292=this;return new Promise(function(_0x294f29,_0x5f7d7f){return db[_0x97b1('0x1f')][_0x97b1('0x20')]({'raw':_0x152fbc['options']?_0x152fbc['options'][_0x97b1('0x19')]===undefined?!![]:![]:!![],'where':_0x152fbc[_0x97b1('0x18')]?_0x152fbc[_0x97b1('0x18')][_0x97b1('0x1a')]||null:null,'attributes':_0x152fbc[_0x97b1('0x18')]?_0x152fbc['options'][_0x97b1('0x1b')]||null:null,'include':_0x152fbc[_0x97b1('0x18')]?_0x152fbc[_0x97b1('0x18')]['include']?_['map'](_0x152fbc[_0x97b1('0x18')][_0x97b1('0x1d')],function(_0x2f3f4b){return{'model':db[_0x2f3f4b[_0x97b1('0x1e')]],'as':_0x2f3f4b['as'],'attributes':_0x2f3f4b['attributes'],'include':_0x2f3f4b[_0x97b1('0x1d')]?_[_0x97b1('0x1c')](_0x2f3f4b[_0x97b1('0x1d')],function(_0x11cb7a){return{'model':db[_0x11cb7a[_0x97b1('0x1e')]],'as':_0x11cb7a['as'],'attributes':_0x11cb7a[_0x97b1('0x1b')],'include':_0x11cb7a[_0x97b1('0x1d')]?_[_0x97b1('0x1c')](_0x11cb7a['include'],function(_0x2685d4){return{'model':db[_0x2685d4[_0x97b1('0x1e')]],'as':_0x2685d4['as'],'attributes':_0x2685d4[_0x97b1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x143d11){logger[_0x97b1('0xd')](_0x97b1('0x21'),_0x152fbc);logger[_0x97b1('0x10')](_0x97b1('0x21'),_0x152fbc,JSON['stringify'](_0x143d11));_0x294f29(_0x143d11);})[_0x97b1('0x15')](function(_0x4dd41d){logger['error'](_0x97b1('0x21'),_0x4dd41d['message'],_0x152fbc);_0x5f7d7f(_0xa91292[_0x97b1('0x12')](0x1f4,_0x4dd41d['message']));});});}; \ No newline at end of file +var _0x9977=['jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','info','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailQueue,\x20%s,\x20%s','message','catch','options','where','attributes','limit','include','map','model','GetMailQueue','debug','ShowMailQueue','MailQueue','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4b74da,_0xf00c83){var _0x484592=function(_0x2c2d63){while(--_0x2c2d63){_0x4b74da['push'](_0x4b74da['shift']());}};_0x484592(++_0xf00c83);}(_0x9977,0x93));var _0x7997=function(_0x4ca288,_0x254dd8){_0x4ca288=_0x4ca288-0x0;var _0x2362c1=_0x9977[_0x4ca288];return _0x2362c1;};'use strict';var _=require(_0x7997('0x0'));var util=require('util');var moment=require(_0x7997('0x1'));var BPromise=require(_0x7997('0x2'));var rs=require(_0x7997('0x3'));var fs=require('fs');var Redis=require(_0x7997('0x4'));var db=require(_0x7997('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7997('0x6'))(_0x7997('0x7'));var config=require(_0x7997('0x8'));var jayson=require(_0x7997('0x9'));var client=jayson[_0x7997('0xa')]['http']({'port':0x232a});config['redis']=_[_0x7997('0xb')](config[_0x7997('0xc')],{'host':_0x7997('0xd'),'port':0x18eb});var socket=require(_0x7997('0xe'))(new Redis(config['redis']));require('./mailQueue.socket')[_0x7997('0xf')](socket);function respondWithRpcPromise(_0x592cdb,_0x2ebfc1,_0x514020){return new BPromise(function(_0x2cfdb4,_0x10291a){return client['request'](_0x592cdb,_0x514020)[_0x7997('0x10')](function(_0x32ec74){logger[_0x7997('0x11')]('MailQueue,\x20%s,\x20%s',_0x2ebfc1,'request\x20sent');logger['debug'](_0x7997('0x12'),_0x2ebfc1,_0x7997('0x13'),JSON[_0x7997('0x14')](_0x32ec74));if(_0x32ec74[_0x7997('0x15')]){if(_0x32ec74[_0x7997('0x15')][_0x7997('0x16')]===0x1f4){logger[_0x7997('0x15')](_0x7997('0x17'),_0x2ebfc1,_0x32ec74[_0x7997('0x15')][_0x7997('0x18')]);return _0x10291a(_0x32ec74[_0x7997('0x15')][_0x7997('0x18')]);}logger[_0x7997('0x15')]('MailQueue,\x20%s,\x20%s',_0x2ebfc1,_0x32ec74[_0x7997('0x15')]['message']);return _0x2cfdb4(_0x32ec74[_0x7997('0x15')][_0x7997('0x18')]);}else{logger[_0x7997('0x11')](_0x7997('0x17'),_0x2ebfc1,_0x7997('0x13'));_0x2cfdb4(_0x32ec74['result'][_0x7997('0x18')]);}})[_0x7997('0x19')](function(_0x1e9a83){logger[_0x7997('0x15')]('MailQueue,\x20%s,\x20%s',_0x2ebfc1,_0x1e9a83);_0x10291a(_0x1e9a83);});});}exports['GetMailQueue']=function(_0xf4c1d1){var _0x25c389=this;return new Promise(function(_0x1dda06,_0x4dacd3){return db['MailQueue']['findAll']({'raw':_0xf4c1d1[_0x7997('0x1a')]?_0xf4c1d1['options']['raw']===undefined?!![]:![]:!![],'where':_0xf4c1d1[_0x7997('0x1a')]?_0xf4c1d1['options'][_0x7997('0x1b')]||null:null,'attributes':_0xf4c1d1[_0x7997('0x1a')]?_0xf4c1d1['options'][_0x7997('0x1c')]||null:null,'limit':_0xf4c1d1['options']?_0xf4c1d1[_0x7997('0x1a')][_0x7997('0x1d')]||null:null,'include':_0xf4c1d1[_0x7997('0x1a')]?_0xf4c1d1[_0x7997('0x1a')][_0x7997('0x1e')]?_[_0x7997('0x1f')](_0xf4c1d1[_0x7997('0x1a')]['include'],function(_0x36b1bb){return{'model':db[_0x36b1bb[_0x7997('0x20')]],'as':_0x36b1bb['as'],'attributes':_0x36b1bb['attributes'],'include':_0x36b1bb['include']?_[_0x7997('0x1f')](_0x36b1bb['include'],function(_0x34b3c4){return{'model':db[_0x34b3c4[_0x7997('0x20')]],'as':_0x34b3c4['as'],'attributes':_0x34b3c4[_0x7997('0x1c')],'include':_0x34b3c4[_0x7997('0x1e')]?_[_0x7997('0x1f')](_0x34b3c4['include'],function(_0x5ab870){return{'model':db[_0x5ab870[_0x7997('0x20')]],'as':_0x5ab870['as'],'attributes':_0x5ab870['attributes']};}):[]};}):[]};}):[]:[]})[_0x7997('0x10')](function(_0x1a9252){logger[_0x7997('0x11')](_0x7997('0x21'),_0xf4c1d1);logger[_0x7997('0x22')](_0x7997('0x21'),_0xf4c1d1,JSON[_0x7997('0x14')](_0x1a9252));_0x1dda06(_0x1a9252);})['catch'](function(_0x10a36e){logger[_0x7997('0x15')]('GetMailQueue',_0x10a36e[_0x7997('0x18')],_0xf4c1d1);_0x4dacd3(_0x25c389['error'](0x1f4,_0x10a36e[_0x7997('0x18')]));});});};exports[_0x7997('0x23')]=function(_0x5f4600){var _0x37d78c=this;return new Promise(function(_0x21b825,_0x5007db){return db[_0x7997('0x24')][_0x7997('0x25')]({'raw':_0x5f4600['options']?_0x5f4600[_0x7997('0x1a')][_0x7997('0x26')]===undefined?!![]:![]:!![],'where':_0x5f4600[_0x7997('0x1a')]?_0x5f4600[_0x7997('0x1a')][_0x7997('0x1b')]||null:null,'attributes':_0x5f4600[_0x7997('0x1a')]?_0x5f4600[_0x7997('0x1a')][_0x7997('0x1c')]||null:null,'include':_0x5f4600[_0x7997('0x1a')]?_0x5f4600['options'][_0x7997('0x1e')]?_[_0x7997('0x1f')](_0x5f4600[_0x7997('0x1a')][_0x7997('0x1e')],function(_0x578191){return{'model':db[_0x578191[_0x7997('0x20')]],'as':_0x578191['as'],'attributes':_0x578191[_0x7997('0x1c')],'include':_0x578191[_0x7997('0x1e')]?_[_0x7997('0x1f')](_0x578191[_0x7997('0x1e')],function(_0x43f7ab){return{'model':db[_0x43f7ab[_0x7997('0x20')]],'as':_0x43f7ab['as'],'attributes':_0x43f7ab[_0x7997('0x1c')],'include':_0x43f7ab[_0x7997('0x1e')]?_[_0x7997('0x1f')](_0x43f7ab[_0x7997('0x1e')],function(_0x1f5c6e){return{'model':db[_0x1f5c6e[_0x7997('0x20')]],'as':_0x1f5c6e['as'],'attributes':_0x1f5c6e[_0x7997('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7997('0x10')](function(_0x1b4b3b){logger['info'](_0x7997('0x23'),_0x5f4600);logger[_0x7997('0x22')](_0x7997('0x23'),_0x5f4600,JSON['stringify'](_0x1b4b3b));_0x21b825(_0x1b4b3b);})[_0x7997('0x19')](function(_0x465f29){logger['error'](_0x7997('0x23'),_0x465f29[_0x7997('0x18')],_0x5f4600);_0x5007db(_0x37d78c[_0x7997('0x15')](0x1f4,_0x465f29[_0x7997('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index d0832a2..4e907bd 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 _0x6412=['length','mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x1424e3,_0x3b266b){var _0x3200ba=function(_0x50851a){while(--_0x50851a){_0x1424e3['push'](_0x1424e3['shift']());}};_0x3200ba(++_0x3b266b);}(_0x6412,0xad));var _0x2641=function(_0x3573cb,_0x3cc455){_0x3573cb=_0x3573cb-0x0;var _0x545d09=_0x6412[_0x3573cb];return _0x545d09;};'use strict';var MailQueueEvents=require(_0x2641('0x0'));var events=[_0x2641('0x1'),_0x2641('0x2'),_0x2641('0x3')];function createListener(_0x42e268,_0x3326a3){return function(_0x21d04e){_0x3326a3[_0x2641('0x4')](_0x42e268,_0x21d04e);};}function removeListener(_0x4ccfdb,_0x66ba43){return function(){MailQueueEvents[_0x2641('0x5')](_0x4ccfdb,_0x66ba43);};}exports[_0x2641('0x6')]=function(_0x2cdab6){for(var _0x4421a1=0x0,_0x3d4af4=events[_0x2641('0x7')];_0x4421a1<_0x3d4af4;_0x4421a1++){var _0x1e04ba=events[_0x4421a1];var _0x1c218d=createListener(_0x2641('0x8')+_0x1e04ba,_0x2cdab6);MailQueueEvents['on'](_0x1e04ba,_0x1c218d);}}; \ No newline at end of file +var _0xe7c2=['./mailQueue.events','save','remove','update','emit','register','length','mailQueue:'];(function(_0x147d66,_0x334d54){var _0x497ca3=function(_0x3eeb4f){while(--_0x3eeb4f){_0x147d66['push'](_0x147d66['shift']());}};_0x497ca3(++_0x334d54);}(_0xe7c2,0xc8));var _0x2e7c=function(_0x44c53a,_0x454149){_0x44c53a=_0x44c53a-0x0;var _0x7e0eb9=_0xe7c2[_0x44c53a];return _0x7e0eb9;};'use strict';var MailQueueEvents=require(_0x2e7c('0x0'));var events=[_0x2e7c('0x1'),_0x2e7c('0x2'),_0x2e7c('0x3')];function createListener(_0x124e22,_0xadc4f0){return function(_0x2042d8){_0xadc4f0[_0x2e7c('0x4')](_0x124e22,_0x2042d8);};}function removeListener(_0x93c4a9,_0x491291){return function(){MailQueueEvents['removeListener'](_0x93c4a9,_0x491291);};}exports[_0x2e7c('0x5')]=function(_0x5e43cd){for(var _0x35ce67=0x0,_0x375302=events[_0x2e7c('0x6')];_0x35ce67<_0x375302;_0x35ce67++){var _0x5bbaaa=events[_0x35ce67];var _0x2bbbbc=createListener(_0x2e7c('0x7')+_0x5bbaaa,_0x5e43cd);MailQueueEvents['on'](_0x5bbaaa,_0x2bbbbc);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 3e7d779..af16656 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 _0xf2af=['index','/describe','describe','/:id','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated'];(function(_0x114a7b,_0x4db906){var _0xd0868c=function(_0xbd07f3){while(--_0xbd07f3){_0x114a7b['push'](_0x114a7b['shift']());}};_0xd0868c(++_0x4db906);}(_0xf2af,0x149));var _0xff2a=function(_0x3334a5,_0x486d1c){_0x3334a5=_0x3334a5-0x0;var _0x528d73=_0xf2af[_0x3334a5];return _0x528d73;};'use strict';var multer=require('multer');var util=require(_0xff2a('0x0'));var path=require(_0xff2a('0x1'));var timeout=require(_0xff2a('0x2'));var express=require(_0xff2a('0x3'));var router=express[_0xff2a('0x4')]();var fs_extra=require(_0xff2a('0x5'));var auth=require(_0xff2a('0x6'));var interaction=require(_0xff2a('0x7'));var config=require('../../config/environment');var controller=require(_0xff2a('0x8'));router[_0xff2a('0x9')]('/',auth[_0xff2a('0xa')](),controller[_0xff2a('0xb')]);router[_0xff2a('0x9')](_0xff2a('0xc'),auth[_0xff2a('0xa')](),controller[_0xff2a('0xd')]);router[_0xff2a('0x9')](_0xff2a('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xff2a('0xf')]('/',auth[_0xff2a('0xa')](),controller[_0xff2a('0x10')]);router[_0xff2a('0x11')]('/:id',auth[_0xff2a('0xa')](),controller['update']);router[_0xff2a('0x12')](_0xff2a('0xe'),auth['isAuthenticated'](),controller[_0xff2a('0x13')]);module['exports']=router; \ No newline at end of file +var _0x8940=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','put','delete','destroy','exports'];(function(_0x4ddf22,_0x222d5c){var _0x1d2c69=function(_0x4590cd){while(--_0x4590cd){_0x4ddf22['push'](_0x4ddf22['shift']());}};_0x1d2c69(++_0x222d5c);}(_0x8940,0xbe));var _0x0894=function(_0x13d0f8,_0x1c0009){_0x13d0f8=_0x13d0f8-0x0;var _0x37e957=_0x8940[_0x13d0f8];return _0x37e957;};'use strict';var multer=require(_0x0894('0x0'));var util=require('util');var path=require(_0x0894('0x1'));var timeout=require(_0x0894('0x2'));var express=require(_0x0894('0x3'));var router=express[_0x0894('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0894('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0894('0x6'));var controller=require(_0x0894('0x7'));router['get']('/',auth[_0x0894('0x8')](),controller['index']);router[_0x0894('0x9')](_0x0894('0xa'),auth['isAuthenticated'](),controller[_0x0894('0xb')]);router['get'](_0x0894('0xc'),auth[_0x0894('0x8')](),controller[_0x0894('0xd')]);router[_0x0894('0xe')]('/',auth[_0x0894('0x8')](),controller['create']);router[_0x0894('0xf')](_0x0894('0xc'),auth[_0x0894('0x8')](),controller['update']);router[_0x0894('0x10')](_0x0894('0xc'),auth[_0x0894('0x8')](),controller[_0x0894('0x11')]);module[_0x0894('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 d202d37..47e8809 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 _0x0683=['sequelize','STRING','DATE'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x0683,0xe1));var _0x3068=function(_0xe807ee,_0x226d67){_0xe807ee=_0xe807ee-0x0;var _0x1cd439=_0x0683[_0xe807ee];return _0x1cd439;};'use strict';var moment=require('moment');var Sequelize=require(_0x3068('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3068('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x3068('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3068('0x2')]},'acceptAt':{'type':Sequelize[_0x3068('0x2')]},'exitAt':{'type':Sequelize[_0x3068('0x2')]},'reason':{'type':Sequelize[_0x3068('0x1')]}}; \ No newline at end of file +var _0xa092=['DATE','sequelize','STRING'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa092,0x17b));var _0x2a09=function(_0x597646,_0x3b7fa5){_0x597646=_0x597646-0x0;var _0x3d2ee8=_0xa092[_0x597646];return _0x3d2ee8;};'use strict';var moment=require('moment');var Sequelize=require(_0x2a09('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2a09('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x2a09('0x1')]},'joinAt':{'type':Sequelize[_0x2a09('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2a09('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x2a09('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 6e2b7ac..4acf555 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 _0x6050=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','send','index','map','MailQueueReport','rawAttributes','type','key','model','query','keys'];(function(_0x1f4eb7,_0x113f5b){var _0x30e697=function(_0x5771e3){while(--_0x5771e3){_0x1f4eb7['push'](_0x1f4eb7['shift']());}};_0x30e697(++_0x113f5b);}(_0x6050,0x196));var _0x0605=function(_0x356c5e,_0x28d757){_0x356c5e=_0x356c5e-0x0;var _0x34d907=_0x6050[_0x356c5e];return _0x34d907;};'use strict';var emlformat=require(_0x0605('0x0'));var rimraf=require(_0x0605('0x1'));var zipdir=require(_0x0605('0x2'));var jsonpatch=require(_0x0605('0x3'));var rp=require(_0x0605('0x4'));var moment=require(_0x0605('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0605('0x6'));var util=require(_0x0605('0x7'));var path=require(_0x0605('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0605('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0605('0xa'));var deskjs=require(_0x0605('0xb'));var toCsv=require(_0x0605('0xc'));var querystring=require(_0x0605('0xd'));var Papa=require(_0x0605('0xe'));var Redis=require('ioredis');var authService=require(_0x0605('0xf'));var qs=require(_0x0605('0x10'));var as=require(_0x0605('0x11'));var hardwareService=require(_0x0605('0x12'));var logger=require(_0x0605('0x13'))(_0x0605('0x14'));var utils=require(_0x0605('0x15'));var config=require(_0x0605('0x16'));var licenseUtil=require(_0x0605('0x17'));var db=require(_0x0605('0x18'))['db'];function respondWithStatusCode(_0xd22e35,_0x39e288){_0x39e288=_0x39e288||0xcc;return function(_0x34c9e6){if(_0x34c9e6){return _0xd22e35[_0x0605('0x19')](_0x39e288);}return _0xd22e35[_0x0605('0x1a')](_0x39e288)[_0x0605('0x1b')]();};}function respondWithResult(_0x169a70,_0x65a20b){_0x65a20b=_0x65a20b||0xc8;return function(_0x1b944f){if(_0x1b944f){return _0x169a70['status'](_0x65a20b)[_0x0605('0x1c')](_0x1b944f);}};}function respondWithFilteredResult(_0x1a802b,_0x4993ab){return function(_0x5ce56a){if(_0x5ce56a){var _0x4eefe9=typeof _0x4993ab[_0x0605('0x1d')]===_0x0605('0x1e')&&typeof _0x4993ab[_0x0605('0x1f')]===_0x0605('0x1e');var _0xefc557=_0x5ce56a[_0x0605('0x20')];var _0x2b7b5a=_0x4eefe9?0x0:_0x4993ab[_0x0605('0x1d')];var _0x193520=_0x4eefe9?_0x5ce56a[_0x0605('0x20')]:_0x4993ab[_0x0605('0x1d')]+_0x4993ab[_0x0605('0x1f')];var _0x2e2204;if(_0x193520>=_0xefc557){_0x193520=_0xefc557;_0x2e2204=0xc8;}else{_0x2e2204=0xce;}_0x1a802b[_0x0605('0x1a')](_0x2e2204);return _0x1a802b['set'](_0x0605('0x21'),_0x2b7b5a+'-'+_0x193520+'/'+_0xefc557)[_0x0605('0x1c')](_0x5ce56a);}return null;};}function patchUpdates(_0x430f28){return function(_0x443326){try{jsonpatch[_0x0605('0x22')](_0x443326,_0x430f28,!![]);}catch(_0x90b2e1){return BPromise[_0x0605('0x23')](_0x90b2e1);}return _0x443326[_0x0605('0x24')]();};}function saveUpdates(_0x226ef5,_0x5b0d44){return function(_0xc334b8){if(_0xc334b8){return _0xc334b8['update'](_0x226ef5)[_0x0605('0x25')](function(_0x118e9c){return _0x118e9c;});}return null;};}function removeEntity(_0x110098,_0xf182c4){return function(_0x10c575){if(_0x10c575){return _0x10c575[_0x0605('0x26')]()[_0x0605('0x25')](function(){_0x110098[_0x0605('0x1a')](0xcc)[_0x0605('0x1b')]();});}};}function handleEntityNotFound(_0x2896d7,_0x9f2833){return function(_0x1c3722){if(!_0x1c3722){_0x2896d7['sendStatus'](0x194);}return _0x1c3722;};}function handleError(_0x6bc204,_0x3c8e36){_0x3c8e36=_0x3c8e36||0x1f4;return function(_0x4b1e0c){logger['error'](_0x4b1e0c['stack']);if(_0x4b1e0c[_0x0605('0x27')]){delete _0x4b1e0c[_0x0605('0x27')];}_0x6bc204[_0x0605('0x1a')](_0x3c8e36)[_0x0605('0x28')](_0x4b1e0c);};}exports[_0x0605('0x29')]=function(_0x4554df,_0x4e32ef){var _0x34f25d={},_0x5daef6={},_0xa836f2={'count':0x0,'rows':[]};var _0x3640b9=_[_0x0605('0x2a')](db[_0x0605('0x2b')][_0x0605('0x2c')],function(_0x352dd6){return{'name':_0x352dd6['fieldName'],'type':_0x352dd6[_0x0605('0x2d')][_0x0605('0x2e')]};});_0x5daef6[_0x0605('0x2f')]=_[_0x0605('0x2a')](_0x3640b9,_0x0605('0x27'));_0x5daef6[_0x0605('0x30')]=_[_0x0605('0x31')](_0x4554df[_0x0605('0x30')]);_0x5daef6[_0x0605('0x32')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],_0x5daef6[_0x0605('0x30')]);_0x34f25d[_0x0605('0x34')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x4554df[_0x0605('0x30')][_0x0605('0x35')]));_0x34f25d[_0x0605('0x34')]=_0x34f25d[_0x0605('0x34')][_0x0605('0x36')]?_0x34f25d[_0x0605('0x34')]:_0x5daef6[_0x0605('0x2f')];if(!_0x4554df[_0x0605('0x30')][_0x0605('0x37')](_0x0605('0x38'))){_0x34f25d[_0x0605('0x1f')]=qs['limit'](_0x4554df[_0x0605('0x30')][_0x0605('0x1f')]);_0x34f25d['offset']=qs[_0x0605('0x1d')](_0x4554df[_0x0605('0x30')]['offset']);}_0x34f25d[_0x0605('0x39')]=qs[_0x0605('0x3a')](_0x4554df[_0x0605('0x30')][_0x0605('0x3a')]);_0x34f25d[_0x0605('0x3b')]=qs[_0x0605('0x32')](_['pick'](_0x4554df['query'],_0x5daef6[_0x0605('0x32')]),_0x3640b9);if(_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]){_0x34f25d['where']=_[_0x0605('0x3d')](_0x34f25d['where'],{'$or':_[_0x0605('0x2a')](_0x3640b9,function(_0x1e98f6){if(_0x1e98f6[_0x0605('0x2d')]!==_0x0605('0x3e')){var _0x42f7ce={};_0x42f7ce[_0x1e98f6[_0x0605('0x27')]]={'$like':'%'+_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]+'%'};return _0x42f7ce;}})});}_0x34f25d=_[_0x0605('0x3d')]({},_0x34f25d,_0x4554df[_0x0605('0x3f')]);var _0x57aa15={'where':_0x34f25d[_0x0605('0x3b')]};return db['MailQueueReport'][_0x0605('0x20')](_0x57aa15)[_0x0605('0x25')](function(_0x45787e){_0xa836f2['count']=_0x45787e;if(_0x4554df['query'][_0x0605('0x40')]){_0x34f25d['include']=[{'all':!![]}];}return db[_0x0605('0x2b')][_0x0605('0x41')](_0x34f25d);})[_0x0605('0x25')](function(_0x3de34a){_0xa836f2[_0x0605('0x42')]=_0x3de34a;return _0xa836f2;})[_0x0605('0x25')](respondWithFilteredResult(_0x4e32ef,_0x34f25d))[_0x0605('0x43')](handleError(_0x4e32ef,null));};exports[_0x0605('0x44')]=function(_0x3fa553,_0x10bb36){var _0x18d3ce={'raw':!![],'where':{'id':_0x3fa553[_0x0605('0x45')]['id']}},_0x3616a3={};_0x3616a3['model']=_['keys'](db[_0x0605('0x2b')]['rawAttributes']);_0x3616a3[_0x0605('0x30')]=_[_0x0605('0x31')](_0x3fa553['query']);_0x3616a3[_0x0605('0x32')]=_[_0x0605('0x33')](_0x3616a3['model'],_0x3616a3[_0x0605('0x30')]);_0x18d3ce[_0x0605('0x34')]=_['intersection'](_0x3616a3[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x3fa553['query'][_0x0605('0x35')]));_0x18d3ce['attributes']=_0x18d3ce['attributes'][_0x0605('0x36')]?_0x18d3ce[_0x0605('0x34')]:_0x3616a3[_0x0605('0x2f')];if(_0x3fa553[_0x0605('0x30')][_0x0605('0x40')]){_0x18d3ce[_0x0605('0x46')]=[{'all':!![]}];}_0x18d3ce=_[_0x0605('0x3d')]({},_0x18d3ce,_0x3fa553[_0x0605('0x3f')]);return db['MailQueueReport'][_0x0605('0x47')](_0x18d3ce)[_0x0605('0x25')](handleEntityNotFound(_0x10bb36,null))[_0x0605('0x25')](respondWithResult(_0x10bb36,null))['catch'](handleError(_0x10bb36,null));};exports[_0x0605('0x48')]=function(_0x1fb70b,_0x45cc1a){return db[_0x0605('0x2b')][_0x0605('0x48')](_0x1fb70b[_0x0605('0x49')],{})[_0x0605('0x25')](respondWithResult(_0x45cc1a,0xc9))[_0x0605('0x43')](handleError(_0x45cc1a,null));};exports[_0x0605('0x4a')]=function(_0x4bc55e,_0x3c597c){if(_0x4bc55e[_0x0605('0x49')]['id']){delete _0x4bc55e[_0x0605('0x49')]['id'];}return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4bc55e[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x3c597c,null))[_0x0605('0x25')](saveUpdates(_0x4bc55e[_0x0605('0x49')],null))[_0x0605('0x25')](respondWithResult(_0x3c597c,null))['catch'](handleError(_0x3c597c,null));};exports['destroy']=function(_0x4876c7,_0x2687a8){return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4876c7[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x2687a8,null))[_0x0605('0x25')](removeEntity(_0x2687a8,null))['catch'](handleError(_0x2687a8,null));};exports[_0x0605('0x4b')]=function(_0x286485,_0x184232){return db[_0x0605('0x2b')]['describe']()[_0x0605('0x25')](respondWithResult(_0x184232,null))[_0x0605('0x43')](handleError(_0x184232,null));}; \ No newline at end of file +var _0x47c5=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','key','model'];(function(_0x30a5e6,_0x4c0a32){var _0x1f5bb5=function(_0x52ee9e){while(--_0x52ee9e){_0x30a5e6['push'](_0x30a5e6['shift']());}};_0x1f5bb5(++_0x4c0a32);}(_0x47c5,0x165));var _0x547c=function(_0x2fa411,_0x1f755a){_0x2fa411=_0x2fa411-0x0;var _0x465756=_0x47c5[_0x2fa411];return _0x465756;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['MailQueueReport'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':!![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['MailQueueReport']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['MailQueueReport'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['MailQueueReport'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));};exports['describe']=function(_0x152982,_0x5258cf){return db[_0x547c('0x2f')][_0x547c('0x51')]()[_0x547c('0x2a')](respondWithResult(_0x5258cf,null))['catch'](handleError(_0x5258cf,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 8ddf53e..0553d77 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 _0x5090=['path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','moment','bluebird'];(function(_0x5982a5,_0x3dc07b){var _0x159c80=function(_0x274c92){while(--_0x274c92){_0x5982a5['push'](_0x5982a5['shift']());}};_0x159c80(++_0x3dc07b);}(_0x5090,0x140));var _0x0509=function(_0x29b107,_0x441b7c){_0x29b107=_0x29b107-0x0;var _0x5a923b=_0x5090[_0x29b107];return _0x5a923b;};'use strict';var _=require('lodash');var util=require(_0x0509('0x0'));var logger=require(_0x0509('0x1'))('api');var moment=require(_0x0509('0x2'));var BPromise=require(_0x0509('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0509('0x4'));var rimraf=require(_0x0509('0x5'));var config=require(_0x0509('0x6'));var attributes=require(_0x0509('0x7'));module[_0x0509('0x8')]=function(_0x4fb0d8,_0x354fed){return _0x4fb0d8['define'](_0x0509('0x9'),attributes,{'tableName':_0x0509('0xa'),'paranoid':![],'indexes':[{'name':_0x0509('0xb'),'fields':[_0x0509('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6778=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util'];(function(_0x4fcba8,_0x5089e9){var _0xfd6f25=function(_0x5d6782){while(--_0x5d6782){_0x4fcba8['push'](_0x4fcba8['shift']());}};_0xfd6f25(++_0x5089e9);}(_0x6778,0x1d2));var _0x8677=function(_0x10dc60,_0x2fcce1){_0x10dc60=_0x10dc60-0x0;var _0x47dec5=_0x6778[_0x10dc60];return _0x47dec5;};'use strict';var _=require(_0x8677('0x0'));var util=require(_0x8677('0x1'));var logger=require(_0x8677('0x2'))('api');var moment=require(_0x8677('0x3'));var BPromise=require('bluebird');var rp=require(_0x8677('0x4'));var fs=require('fs');var path=require(_0x8677('0x5'));var rimraf=require(_0x8677('0x6'));var config=require(_0x8677('0x7'));var attributes=require(_0x8677('0x8'));module[_0x8677('0x9')]=function(_0x3eee6d,_0x564b92){return _0x3eee6d[_0x8677('0xa')](_0x8677('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x8677('0xc'),'fields':[_0x8677('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index c26dfec..954cf3a 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x2eaa6b,_0x5f3658){var _0x4770c9=function(_0x1a22a2){while(--_0x1a22a2){_0x2eaa6b['push'](_0x2eaa6b['shift']());}};_0x4770c9(++_0x5f3658);}(_0x2ef3,0xba));var _0x32ef=function(_0x49eac1,_0x509058){_0x49eac1=_0x49eac1-0x0;var _0x23ff7d=_0x2ef3[_0x49eac1];return _0x23ff7d;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x314140,_0x5e2b0d){var _0xb354b4=function(_0x3197e2){while(--_0x3197e2){_0x314140['push'](_0x314140['shift']());}};_0xb354b4(++_0x5e2b0d);}(_0xdb28,0x106));var _0x8db2=function(_0x25ee83,_0x5278ef){_0x25ee83=_0x25ee83-0x0;var _0x317a84=_0xdb28[_0x25ee83];return _0x317a84;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 94f7962..ddf7c24 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x403ace,_0x5d7d12){var _0x2eb454=function(_0x463aac){while(--_0x463aac){_0x403ace['push'](_0x403ace['shift']());}};_0x2eb454(++_0x5d7d12);}(_0xe706,0xa3));var _0x6e70=function(_0x18b9a8,_0x1770b6){_0x18b9a8=_0x18b9a8-0x0;var _0x4a0a8f=_0xe706[_0x18b9a8];return _0x4a0a8f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x17242d,_0x3b9d43){var _0x11563f=function(_0x465f82){while(--_0x465f82){_0x17242d['push'](_0x17242d['shift']());}};_0x11563f(++_0x3b9d43);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0xcb91[_0x217c2e];return _0x22b7d8;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 22ec359..964a454 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 _0x5ff0=['STRING','BOOLEAN','INBOX','INTEGER','exports'];(function(_0x3a2587,_0x10a5f3){var _0x5b1abc=function(_0xf4ecb7){while(--_0xf4ecb7){_0x3a2587['push'](_0x3a2587['shift']());}};_0x5b1abc(++_0x10a5f3);}(_0x5ff0,0x72));var _0x05ff=function(_0x30bb42,_0x2440d2){_0x30bb42=_0x30bb42-0x0;var _0x42ea21=_0x5ff0[_0x30bb42];return _0x42ea21;};'use strict';var Sequelize=require('sequelize');module[_0x05ff('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x05ff('0x1')]},'authentication':{'type':Sequelize[_0x05ff('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x05ff('0x1')]},'password':{'type':Sequelize[_0x05ff('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x05ff('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x05ff('0x1')],'defaultValue':_0x05ff('0x3')},'connTimeout':{'type':Sequelize[_0x05ff('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x05ff('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5090=['exports','STRING','BOOLEAN','INBOX','INTEGER','sequelize'];(function(_0x33148c,_0x5c3408){var _0xb1b02f=function(_0x2e04ae){while(--_0x2e04ae){_0x33148c['push'](_0x33148c['shift']());}};_0xb1b02f(++_0x5c3408);}(_0x5090,0x1a3));var _0x0509=function(_0x153f1d,_0x59b636){_0x153f1d=_0x153f1d-0x0;var _0x4efb5b=_0x5090[_0x153f1d];return _0x4efb5b;};'use strict';var Sequelize=require(_0x0509('0x0'));module[_0x0509('0x1')]={'description':{'type':Sequelize[_0x0509('0x2')]},'host':{'type':Sequelize[_0x0509('0x2')]},'authentication':{'type':Sequelize[_0x0509('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x0509('0x2')]},'password':{'type':Sequelize[_0x0509('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x0509('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0509('0x2')],'defaultValue':_0x0509('0x4')},'connTimeout':{'type':Sequelize[_0x0509('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x0509('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x0509('0x2')]},'modernAuthentication':{'type':Sequelize[_0x0509('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 9fa22e1..5051458 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 _0xf125=['mail_servers_in','lodash','util','api','moment','bluebird','path','rimraf','./mailServerIn.attributes','define'];(function(_0x19b8cc,_0x487765){var _0x1f7596=function(_0x33dfa9){while(--_0x33dfa9){_0x19b8cc['push'](_0x19b8cc['shift']());}};_0x1f7596(++_0x487765);}(_0xf125,0x1a5));var _0x5f12=function(_0x154203,_0x249954){_0x154203=_0x154203-0x0;var _0x3a5923=_0xf125[_0x154203];return _0x3a5923;};'use strict';var _=require(_0x5f12('0x0'));var util=require(_0x5f12('0x1'));var logger=require('../../config/logger')(_0x5f12('0x2'));var moment=require(_0x5f12('0x3'));var BPromise=require(_0x5f12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f12('0x5'));var rimraf=require(_0x5f12('0x6'));var config=require('../../config/environment');var attributes=require(_0x5f12('0x7'));module['exports']=function(_0x47a86a,_0x2b6a07){return _0x47a86a[_0x5f12('0x8')]('MailServerIn',attributes,{'tableName':_0x5f12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7130=['MailServerIn','mail_servers_in','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0x4aefcd,_0x5e36ff){var _0x3cc806=function(_0x3475f4){while(--_0x3475f4){_0x4aefcd['push'](_0x4aefcd['shift']());}};_0x3cc806(++_0x5e36ff);}(_0x7130,0xf9));var _0x0713=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x7130[_0x556bb1];return _0x45455f;};'use strict';var _=require(_0x0713('0x0'));var util=require('util');var logger=require(_0x0713('0x1'))(_0x0713('0x2'));var moment=require(_0x0713('0x3'));var BPromise=require(_0x0713('0x4'));var rp=require(_0x0713('0x5'));var fs=require('fs');var path=require(_0x0713('0x6'));var rimraf=require('rimraf');var config=require(_0x0713('0x7'));var attributes=require(_0x0713('0x8'));module[_0x0713('0x9')]=function(_0x2984e,_0x442fd5){return _0x2984e[_0x0713('0xa')](_0x0713('0xb'),attributes,{'tableName':_0x0713('0xc'),'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 125fda2..4784b9b 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 _0xed59=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','include','map','model','then','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xed59,0x112));var _0x9ed5=function(_0x4ab866,_0x3f3800){_0x4ab866=_0x4ab866-0x0;var _0x3d9d2c=_0xed59[_0x4ab866];return _0x3d9d2c;};'use strict';var _=require(_0x9ed5('0x0'));var util=require(_0x9ed5('0x1'));var moment=require(_0x9ed5('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ed5('0x3'));var fs=require('fs');var Redis=require(_0x9ed5('0x4'));var db=require(_0x9ed5('0x5'))['db'];var utils=require(_0x9ed5('0x6'));var logger=require(_0x9ed5('0x7'))(_0x9ed5('0x8'));var config=require(_0x9ed5('0x9'));var jayson=require(_0x9ed5('0xa'));var client=jayson[_0x9ed5('0xb')][_0x9ed5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30dd85,_0x493b0f,_0x15d9b1){return new BPromise(function(_0x108ae4,_0x483827){return client[_0x9ed5('0xd')](_0x30dd85,_0x15d9b1)['then'](function(_0x15960e){logger['info'](_0x9ed5('0xe'),_0x493b0f,_0x9ed5('0xf'));logger[_0x9ed5('0x10')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x493b0f,_0x9ed5('0xf'),JSON['stringify'](_0x15960e));if(_0x15960e[_0x9ed5('0x11')]){if(_0x15960e[_0x9ed5('0x11')][_0x9ed5('0x12')]===0x1f4){logger['error'](_0x9ed5('0xe'),_0x493b0f,_0x15960e[_0x9ed5('0x11')][_0x9ed5('0x13')]);return _0x483827(_0x15960e[_0x9ed5('0x11')][_0x9ed5('0x13')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x493b0f,_0x15960e[_0x9ed5('0x11')]['message']);return _0x108ae4(_0x15960e[_0x9ed5('0x11')][_0x9ed5('0x13')]);}else{logger[_0x9ed5('0x14')](_0x9ed5('0xe'),_0x493b0f,_0x9ed5('0xf'));_0x108ae4(_0x15960e[_0x9ed5('0x15')][_0x9ed5('0x13')]);}})[_0x9ed5('0x16')](function(_0x5949e1){logger[_0x9ed5('0x11')]('MailServerIn,\x20%s,\x20%s',_0x493b0f,_0x5949e1);_0x483827(_0x5949e1);});});}exports[_0x9ed5('0x17')]=function(_0x4cd40e){var _0x5a8ee3=this;return new Promise(function(_0x53bd5d,_0x5c072c){return db[_0x9ed5('0x18')][_0x9ed5('0x19')]({'raw':_0x4cd40e[_0x9ed5('0x1a')]?_0x4cd40e[_0x9ed5('0x1a')][_0x9ed5('0x1b')]===undefined?!![]:![]:!![],'where':_0x4cd40e[_0x9ed5('0x1a')]?_0x4cd40e[_0x9ed5('0x1a')][_0x9ed5('0x1c')]||null:null,'attributes':_0x4cd40e['options']?_0x4cd40e[_0x9ed5('0x1a')][_0x9ed5('0x1d')]||null:null,'limit':_0x4cd40e[_0x9ed5('0x1a')]?_0x4cd40e[_0x9ed5('0x1a')]['limit']||null:null,'include':_0x4cd40e[_0x9ed5('0x1a')]?_0x4cd40e[_0x9ed5('0x1a')][_0x9ed5('0x1e')]?_[_0x9ed5('0x1f')](_0x4cd40e[_0x9ed5('0x1a')][_0x9ed5('0x1e')],function(_0x1e0648){return{'model':db[_0x1e0648[_0x9ed5('0x20')]],'as':_0x1e0648['as'],'attributes':_0x1e0648[_0x9ed5('0x1d')],'include':_0x1e0648[_0x9ed5('0x1e')]?_[_0x9ed5('0x1f')](_0x1e0648[_0x9ed5('0x1e')],function(_0x77151d){return{'model':db[_0x77151d[_0x9ed5('0x20')]],'as':_0x77151d['as'],'attributes':_0x77151d['attributes'],'include':_0x77151d[_0x9ed5('0x1e')]?_[_0x9ed5('0x1f')](_0x77151d[_0x9ed5('0x1e')],function(_0x28dccf){return{'model':db[_0x28dccf[_0x9ed5('0x20')]],'as':_0x28dccf['as'],'attributes':_0x28dccf[_0x9ed5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9ed5('0x21')](function(_0x5815ef){logger[_0x9ed5('0x14')]('GetMailServerIn',_0x4cd40e);logger['debug'](_0x9ed5('0x17'),_0x4cd40e,JSON[_0x9ed5('0x22')](_0x5815ef));_0x53bd5d(_0x5815ef);})['catch'](function(_0x5d9768){logger[_0x9ed5('0x11')](_0x9ed5('0x17'),_0x5d9768[_0x9ed5('0x13')],_0x4cd40e);_0x5c072c(_0x5a8ee3[_0x9ed5('0x11')](0x1f4,_0x5d9768['message']));});});}; \ No newline at end of file +var _0xbb5f=['findAll','raw','options','where','attributes','limit','include','model','map','then','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','MailServerIn,\x20%s,\x20%s','message','info','result','catch','GetMailServerIn','MailServerIn'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb5f,0x16a));var _0xfbb5=function(_0x404c35,_0xedfe89){_0x404c35=_0x404c35-0x0;var _0x28c900=_0xbb5f[_0x404c35];return _0x28c900;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfbb5('0x0'));var BPromise=require('bluebird');var rs=require(_0xfbb5('0x1'));var fs=require('fs');var Redis=require(_0xfbb5('0x2'));var db=require(_0xfbb5('0x3'))['db'];var utils=require(_0xfbb5('0x4'));var logger=require(_0xfbb5('0x5'))(_0xfbb5('0x6'));var config=require(_0xfbb5('0x7'));var jayson=require(_0xfbb5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c5026,_0x284080,_0x42228f){return new BPromise(function(_0x419540,_0x4785d4){return client[_0xfbb5('0x9')](_0x2c5026,_0x42228f)['then'](function(_0x5d9932){logger['info']('MailServerIn,\x20%s,\x20%s',_0x284080,_0xfbb5('0xa'));logger[_0xfbb5('0xb')](_0xfbb5('0xc'),_0x284080,_0xfbb5('0xa'),JSON[_0xfbb5('0xd')](_0x5d9932));if(_0x5d9932[_0xfbb5('0xe')]){if(_0x5d9932['error']['code']===0x1f4){logger[_0xfbb5('0xe')](_0xfbb5('0xf'),_0x284080,_0x5d9932[_0xfbb5('0xe')][_0xfbb5('0x10')]);return _0x4785d4(_0x5d9932[_0xfbb5('0xe')]['message']);}logger[_0xfbb5('0xe')]('MailServerIn,\x20%s,\x20%s',_0x284080,_0x5d9932['error']['message']);return _0x419540(_0x5d9932['error']['message']);}else{logger[_0xfbb5('0x11')](_0xfbb5('0xf'),_0x284080,_0xfbb5('0xa'));_0x419540(_0x5d9932[_0xfbb5('0x12')][_0xfbb5('0x10')]);}})[_0xfbb5('0x13')](function(_0x2f8505){logger[_0xfbb5('0xe')]('MailServerIn,\x20%s,\x20%s',_0x284080,_0x2f8505);_0x4785d4(_0x2f8505);});});}exports[_0xfbb5('0x14')]=function(_0x49e42d){var _0x102298=this;return new Promise(function(_0x2b8e69,_0x30f9bb){return db[_0xfbb5('0x15')][_0xfbb5('0x16')]({'raw':_0x49e42d['options']?_0x49e42d['options'][_0xfbb5('0x17')]===undefined?!![]:![]:!![],'where':_0x49e42d[_0xfbb5('0x18')]?_0x49e42d['options'][_0xfbb5('0x19')]||null:null,'attributes':_0x49e42d['options']?_0x49e42d['options'][_0xfbb5('0x1a')]||null:null,'limit':_0x49e42d[_0xfbb5('0x18')]?_0x49e42d[_0xfbb5('0x18')][_0xfbb5('0x1b')]||null:null,'include':_0x49e42d['options']?_0x49e42d[_0xfbb5('0x18')][_0xfbb5('0x1c')]?_['map'](_0x49e42d['options']['include'],function(_0x2bd066){return{'model':db[_0x2bd066[_0xfbb5('0x1d')]],'as':_0x2bd066['as'],'attributes':_0x2bd066[_0xfbb5('0x1a')],'include':_0x2bd066['include']?_[_0xfbb5('0x1e')](_0x2bd066[_0xfbb5('0x1c')],function(_0x2f8552){return{'model':db[_0x2f8552[_0xfbb5('0x1d')]],'as':_0x2f8552['as'],'attributes':_0x2f8552[_0xfbb5('0x1a')],'include':_0x2f8552[_0xfbb5('0x1c')]?_[_0xfbb5('0x1e')](_0x2f8552[_0xfbb5('0x1c')],function(_0x51dad7){return{'model':db[_0x51dad7[_0xfbb5('0x1d')]],'as':_0x51dad7['as'],'attributes':_0x51dad7[_0xfbb5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfbb5('0x1f')](function(_0x2a99eb){logger[_0xfbb5('0x11')](_0xfbb5('0x14'),_0x49e42d);logger[_0xfbb5('0xb')](_0xfbb5('0x14'),_0x49e42d,JSON[_0xfbb5('0xd')](_0x2a99eb));_0x2b8e69(_0x2a99eb);})[_0xfbb5('0x13')](function(_0x1abd73){logger['error'](_0xfbb5('0x14'),_0x1abd73[_0xfbb5('0x10')],_0x49e42d);_0x30f9bb(_0x102298['error'](0x1f4,_0x1abd73['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 2245a09..7c67c46 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +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(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x7a54,0x106));var _0x47a5=function(_0x5ee245,_0x58a81d){_0x5ee245=_0x5ee245-0x0;var _0x41a1b2=_0x7a54[_0x5ee245];return _0x41a1b2;};'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 diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 0754ae8..735c98c 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 _0xe605=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xe605,0x92));var _0x5e60=function(_0x56585f,_0x1625c8){_0x56585f=_0x56585f-0x0;var _0x43dd2f=_0xe605[_0x56585f];return _0x43dd2f;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x5e60('0x2')]},'user':{'type':Sequelize[_0x5e60('0x2')]},'pass':{'type':Sequelize[_0x5e60('0x2')]},'port':{'type':Sequelize[_0x5e60('0x3')]},'secure':{'type':Sequelize[_0x5e60('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x5e60('0x2')]},'authentication':{'type':Sequelize[_0x5e60('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x5e60('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x6324=['STRING','BOOLEAN','sequelize','exports'];(function(_0x12c263,_0x2d9bce){var _0x192cd7=function(_0x3a1fc0){while(--_0x3a1fc0){_0x12c263['push'](_0x12c263['shift']());}};_0x192cd7(++_0x2d9bce);}(_0x6324,0x142));var _0x4632=function(_0x550aed,_0x1ba6cb){_0x550aed=_0x550aed-0x0;var _0x1c43a5=_0x6324[_0x550aed];return _0x1c43a5;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'description':{'type':Sequelize[_0x4632('0x2')]},'host':{'type':Sequelize[_0x4632('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x4632('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x4632('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x4632('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index bb9dc9a..abce57f 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 _0xc736=['send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailServerOut','includeAll','include','rows','show','rawAttributes','catch','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name'];(function(_0x80bf6a,_0x3beee2){var _0x1522f3=function(_0x97d91e){while(--_0x97d91e){_0x80bf6a['push'](_0x80bf6a['shift']());}};_0x1522f3(++_0x3beee2);}(_0xc736,0x18a));var _0x6c73=function(_0x3e038d,_0x24e5b1){_0x3e038d=_0x3e038d-0x0;var _0x193e27=_0xc736[_0x3e038d];return _0x193e27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c73('0x0'));var zipdir=require(_0x6c73('0x1'));var jsonpatch=require(_0x6c73('0x2'));var rp=require(_0x6c73('0x3'));var moment=require('moment');var BPromise=require(_0x6c73('0x4'));var Mustache=require('mustache');var util=require(_0x6c73('0x5'));var path=require(_0x6c73('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c73('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c73('0x8'));var squel=require(_0x6c73('0x9'));var crypto=require(_0x6c73('0xa'));var jsforce=require(_0x6c73('0xb'));var deskjs=require(_0x6c73('0xc'));var toCsv=require(_0x6c73('0xd'));var querystring=require(_0x6c73('0xe'));var Papa=require(_0x6c73('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6c73('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c73('0x11'));var logger=require(_0x6c73('0x12'))('api');var utils=require(_0x6c73('0x13'));var config=require(_0x6c73('0x14'));var licenseUtil=require(_0x6c73('0x15'));var db=require(_0x6c73('0x16'))['db'];function respondWithStatusCode(_0x261888,_0x55efdf){_0x55efdf=_0x55efdf||0xcc;return function(_0x49144e){if(_0x49144e){return _0x261888['sendStatus'](_0x55efdf);}return _0x261888[_0x6c73('0x17')](_0x55efdf)[_0x6c73('0x18')]();};}function respondWithResult(_0x4aabcb,_0x223a29){_0x223a29=_0x223a29||0xc8;return function(_0x11ab06){if(_0x11ab06){return _0x4aabcb['status'](_0x223a29)[_0x6c73('0x19')](_0x11ab06);}};}function respondWithFilteredResult(_0x739889,_0x4afc28){return function(_0x13ae6e){if(_0x13ae6e){var _0x1fafec=typeof _0x4afc28[_0x6c73('0x1a')]==='undefined'&&typeof _0x4afc28[_0x6c73('0x1b')]==='undefined';var _0xe7e995=_0x13ae6e[_0x6c73('0x1c')];var _0x39ebd6=_0x1fafec?0x0:_0x4afc28[_0x6c73('0x1a')];var _0x125ed4=_0x1fafec?_0x13ae6e[_0x6c73('0x1c')]:_0x4afc28[_0x6c73('0x1a')]+_0x4afc28[_0x6c73('0x1b')];var _0x5977df;if(_0x125ed4>=_0xe7e995){_0x125ed4=_0xe7e995;_0x5977df=0xc8;}else{_0x5977df=0xce;}_0x739889[_0x6c73('0x17')](_0x5977df);return _0x739889[_0x6c73('0x1d')](_0x6c73('0x1e'),_0x39ebd6+'-'+_0x125ed4+'/'+_0xe7e995)[_0x6c73('0x19')](_0x13ae6e);}return null;};}function patchUpdates(_0x34f449){return function(_0x797030){try{jsonpatch[_0x6c73('0x1f')](_0x797030,_0x34f449,!![]);}catch(_0x2ac342){return BPromise[_0x6c73('0x20')](_0x2ac342);}return _0x797030['save']();};}function saveUpdates(_0x3094f2,_0xbfb91b){return function(_0x2fa098){if(_0x2fa098){return _0x2fa098[_0x6c73('0x21')](_0x3094f2)[_0x6c73('0x22')](function(_0x2756e2){return _0x2756e2;});}return null;};}function removeEntity(_0x1b5a05,_0x1cedc3){return function(_0xb6d119){if(_0xb6d119){return _0xb6d119[_0x6c73('0x23')]()[_0x6c73('0x22')](function(){_0x1b5a05[_0x6c73('0x17')](0xcc)[_0x6c73('0x18')]();});}};}function handleEntityNotFound(_0x1df750,_0x172cfa){return function(_0x488f0b){if(!_0x488f0b){_0x1df750['sendStatus'](0x194);}return _0x488f0b;};}function handleError(_0x10389c,_0x9bc9e4){_0x9bc9e4=_0x9bc9e4||0x1f4;return function(_0x3a60a0){logger[_0x6c73('0x24')](_0x3a60a0['stack']);if(_0x3a60a0[_0x6c73('0x25')]){delete _0x3a60a0[_0x6c73('0x25')];}_0x10389c['status'](_0x9bc9e4)[_0x6c73('0x26')](_0x3a60a0);};}exports[_0x6c73('0x27')]=function(_0x2a0090,_0x5127bc){var _0x56f45a={},_0x2af3c7={},_0x35b46b={'count':0x0,'rows':[]};var _0x567c0c=_[_0x6c73('0x28')](db['MailServerOut']['rawAttributes'],function(_0x33bc80){return{'name':_0x33bc80[_0x6c73('0x29')],'type':_0x33bc80[_0x6c73('0x2a')][_0x6c73('0x2b')]};});_0x2af3c7[_0x6c73('0x2c')]=_[_0x6c73('0x28')](_0x567c0c,_0x6c73('0x25'));_0x2af3c7[_0x6c73('0x2d')]=_[_0x6c73('0x2e')](_0x2a0090[_0x6c73('0x2d')]);_0x2af3c7[_0x6c73('0x2f')]=_[_0x6c73('0x30')](_0x2af3c7[_0x6c73('0x2c')],_0x2af3c7['query']);_0x56f45a[_0x6c73('0x31')]=_[_0x6c73('0x30')](_0x2af3c7['model'],qs[_0x6c73('0x32')](_0x2a0090[_0x6c73('0x2d')][_0x6c73('0x32')]));_0x56f45a[_0x6c73('0x31')]=_0x56f45a[_0x6c73('0x31')][_0x6c73('0x33')]?_0x56f45a['attributes']:_0x2af3c7['model'];if(!_0x2a0090[_0x6c73('0x2d')]['hasOwnProperty'](_0x6c73('0x34'))){_0x56f45a[_0x6c73('0x1b')]=qs[_0x6c73('0x1b')](_0x2a0090[_0x6c73('0x2d')][_0x6c73('0x1b')]);_0x56f45a[_0x6c73('0x1a')]=qs['offset'](_0x2a0090[_0x6c73('0x2d')][_0x6c73('0x1a')]);}_0x56f45a[_0x6c73('0x35')]=qs[_0x6c73('0x36')](_0x2a0090[_0x6c73('0x2d')][_0x6c73('0x36')]);_0x56f45a[_0x6c73('0x37')]=qs[_0x6c73('0x2f')](_[_0x6c73('0x38')](_0x2a0090['query'],_0x2af3c7[_0x6c73('0x2f')]),_0x567c0c);if(_0x2a0090[_0x6c73('0x2d')][_0x6c73('0x39')]){_0x56f45a[_0x6c73('0x37')]=_[_0x6c73('0x3a')](_0x56f45a[_0x6c73('0x37')],{'$or':_[_0x6c73('0x28')](_0x567c0c,function(_0x3957c4){if(_0x3957c4[_0x6c73('0x2a')]!==_0x6c73('0x3b')){var _0x5e10e3={};_0x5e10e3[_0x3957c4[_0x6c73('0x25')]]={'$like':'%'+_0x2a0090[_0x6c73('0x2d')][_0x6c73('0x39')]+'%'};return _0x5e10e3;}})});}_0x56f45a=_[_0x6c73('0x3a')]({},_0x56f45a,_0x2a0090[_0x6c73('0x3c')]);var _0x1f3d04={'where':_0x56f45a[_0x6c73('0x37')]};return db[_0x6c73('0x3d')][_0x6c73('0x1c')](_0x1f3d04)['then'](function(_0x370dcf){_0x35b46b[_0x6c73('0x1c')]=_0x370dcf;if(_0x2a0090['query'][_0x6c73('0x3e')]){_0x56f45a[_0x6c73('0x3f')]=[{'all':!![]}];}return db[_0x6c73('0x3d')]['findAll'](_0x56f45a);})[_0x6c73('0x22')](function(_0x450c64){_0x35b46b[_0x6c73('0x40')]=_0x450c64;return _0x35b46b;})['then'](respondWithFilteredResult(_0x5127bc,_0x56f45a))['catch'](handleError(_0x5127bc,null));};exports[_0x6c73('0x41')]=function(_0x4376ce,_0x51515c){var _0x8c5fb6={'raw':!![],'where':{'id':_0x4376ce['params']['id']}},_0x58168c={};_0x58168c[_0x6c73('0x2c')]=_[_0x6c73('0x2e')](db[_0x6c73('0x3d')][_0x6c73('0x42')]);_0x58168c[_0x6c73('0x2d')]=_[_0x6c73('0x2e')](_0x4376ce[_0x6c73('0x2d')]);_0x58168c[_0x6c73('0x2f')]=_[_0x6c73('0x30')](_0x58168c['model'],_0x58168c[_0x6c73('0x2d')]);_0x8c5fb6['attributes']=_[_0x6c73('0x30')](_0x58168c[_0x6c73('0x2c')],qs[_0x6c73('0x32')](_0x4376ce[_0x6c73('0x2d')]['fields']));_0x8c5fb6[_0x6c73('0x31')]=_0x8c5fb6[_0x6c73('0x31')]['length']?_0x8c5fb6['attributes']:_0x58168c[_0x6c73('0x2c')];if(_0x4376ce[_0x6c73('0x2d')]['includeAll']){_0x8c5fb6['include']=[{'all':!![]}];}_0x8c5fb6=_['merge']({},_0x8c5fb6,_0x4376ce[_0x6c73('0x3c')]);return db[_0x6c73('0x3d')]['find'](_0x8c5fb6)[_0x6c73('0x22')](handleEntityNotFound(_0x51515c,null))[_0x6c73('0x22')](respondWithResult(_0x51515c,null))[_0x6c73('0x43')](handleError(_0x51515c,null));};exports[_0x6c73('0x44')]=function(_0x514716,_0x3d00bc){return db[_0x6c73('0x3d')][_0x6c73('0x44')](_0x514716['body'],{})[_0x6c73('0x22')](respondWithResult(_0x3d00bc,0xc9))[_0x6c73('0x43')](handleError(_0x3d00bc,null));};exports[_0x6c73('0x21')]=function(_0x39723b,_0x2cb7fe){if(_0x39723b['body']['id']){delete _0x39723b[_0x6c73('0x45')]['id'];}return db['MailServerOut'][_0x6c73('0x46')]({'where':{'id':_0x39723b[_0x6c73('0x47')]['id']}})[_0x6c73('0x22')](handleEntityNotFound(_0x2cb7fe,null))[_0x6c73('0x22')](saveUpdates(_0x39723b[_0x6c73('0x45')],null))['then'](respondWithResult(_0x2cb7fe,null))[_0x6c73('0x43')](handleError(_0x2cb7fe,null));};exports['destroy']=function(_0x429be3,_0x21885a){return db[_0x6c73('0x3d')][_0x6c73('0x46')]({'where':{'id':_0x429be3[_0x6c73('0x47')]['id']}})[_0x6c73('0x22')](handleEntityNotFound(_0x21885a,null))[_0x6c73('0x22')](removeEntity(_0x21885a,null))[_0x6c73('0x43')](handleError(_0x21885a,null));}; \ No newline at end of file +var _0x3543=['end','json','offset','undefined','limit','count','status','set','Content-Range','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','MailServerOut','findAll','catch','show','params','include','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x2e427c,_0x4d5993){var _0x25d1b6=function(_0x29efce){while(--_0x29efce){_0x2e427c['push'](_0x2e427c['shift']());}};_0x25d1b6(++_0x4d5993);}(_0x3543,0x193));var _0x3354=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x3543[_0x3054be];return _0x3df150;};'use strict';var emlformat=require(_0x3354('0x0'));var rimraf=require(_0x3354('0x1'));var zipdir=require(_0x3354('0x2'));var jsonpatch=require(_0x3354('0x3'));var rp=require(_0x3354('0x4'));var moment=require(_0x3354('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3354('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3354('0x7'));var ejs=require(_0x3354('0x8'));var fs=require('fs');var fs_extra=require(_0x3354('0x9'));var _=require(_0x3354('0xa'));var squel=require(_0x3354('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3354('0xc'));var toCsv=require(_0x3354('0x7'));var querystring=require(_0x3354('0xd'));var Papa=require(_0x3354('0xe'));var Redis=require(_0x3354('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3354('0x10'));var as=require(_0x3354('0x11'));var hardwareService=require(_0x3354('0x12'));var logger=require(_0x3354('0x13'))(_0x3354('0x14'));var utils=require('../../config/utils');var config=require(_0x3354('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3354('0x16'))['db'];function respondWithStatusCode(_0x1c4b4c,_0x103292){_0x103292=_0x103292||0xcc;return function(_0x4cee38){if(_0x4cee38){return _0x1c4b4c['sendStatus'](_0x103292);}return _0x1c4b4c['status'](_0x103292)[_0x3354('0x17')]();};}function respondWithResult(_0x2156b9,_0x4cc954){_0x4cc954=_0x4cc954||0xc8;return function(_0x5a6625){if(_0x5a6625){return _0x2156b9['status'](_0x4cc954)[_0x3354('0x18')](_0x5a6625);}};}function respondWithFilteredResult(_0x87c638,_0x358fe2){return function(_0x25acc0){if(_0x25acc0){var _0x21bba2=typeof _0x358fe2[_0x3354('0x19')]===_0x3354('0x1a')&&typeof _0x358fe2[_0x3354('0x1b')]===_0x3354('0x1a');var _0x452c9c=_0x25acc0[_0x3354('0x1c')];var _0x265354=_0x21bba2?0x0:_0x358fe2[_0x3354('0x19')];var _0x361d76=_0x21bba2?_0x25acc0[_0x3354('0x1c')]:_0x358fe2[_0x3354('0x19')]+_0x358fe2['limit'];var _0x445dd5;if(_0x361d76>=_0x452c9c){_0x361d76=_0x452c9c;_0x445dd5=0xc8;}else{_0x445dd5=0xce;}_0x87c638[_0x3354('0x1d')](_0x445dd5);return _0x87c638[_0x3354('0x1e')](_0x3354('0x1f'),_0x265354+'-'+_0x361d76+'/'+_0x452c9c)[_0x3354('0x18')](_0x25acc0);}return null;};}function patchUpdates(_0x41ad5d){return function(_0x25f0dc){try{jsonpatch['apply'](_0x25f0dc,_0x41ad5d,!![]);}catch(_0x54093b){return BPromise['reject'](_0x54093b);}return _0x25f0dc[_0x3354('0x20')]();};}function saveUpdates(_0x51346f,_0x3b8e4f){return function(_0x9a0078){if(_0x9a0078){return _0x9a0078[_0x3354('0x21')](_0x51346f)[_0x3354('0x22')](function(_0x5c24e0){return _0x5c24e0;});}return null;};}function removeEntity(_0x4a3657,_0x13d0b4){return function(_0x499082){if(_0x499082){return _0x499082['destroy']()['then'](function(){_0x4a3657[_0x3354('0x1d')](0xcc)[_0x3354('0x17')]();});}};}function handleEntityNotFound(_0x2278bd,_0x336fab){return function(_0x3f1f85){if(!_0x3f1f85){_0x2278bd['sendStatus'](0x194);}return _0x3f1f85;};}function handleError(_0x2d6d45,_0x521d12){_0x521d12=_0x521d12||0x1f4;return function(_0x25ea94){logger[_0x3354('0x23')](_0x25ea94[_0x3354('0x24')]);if(_0x25ea94[_0x3354('0x25')]){delete _0x25ea94[_0x3354('0x25')];}_0x2d6d45[_0x3354('0x1d')](_0x521d12)[_0x3354('0x26')](_0x25ea94);};}exports['index']=function(_0x506199,_0x550d6c){var _0x202f17={},_0x3b0180={},_0x10bde5={'count':0x0,'rows':[]};var _0x169a9c=_[_0x3354('0x27')](db['MailServerOut'][_0x3354('0x28')],function(_0x207958){return{'name':_0x207958[_0x3354('0x29')],'type':_0x207958[_0x3354('0x2a')][_0x3354('0x2b')]};});_0x3b0180['model']=_[_0x3354('0x27')](_0x169a9c,_0x3354('0x25'));_0x3b0180[_0x3354('0x2c')]=_[_0x3354('0x2d')](_0x506199[_0x3354('0x2c')]);_0x3b0180[_0x3354('0x2e')]=_[_0x3354('0x2f')](_0x3b0180[_0x3354('0x30')],_0x3b0180[_0x3354('0x2c')]);_0x202f17[_0x3354('0x31')]=_['intersection'](_0x3b0180[_0x3354('0x30')],qs[_0x3354('0x32')](_0x506199[_0x3354('0x2c')][_0x3354('0x32')]));_0x202f17[_0x3354('0x31')]=_0x202f17[_0x3354('0x31')][_0x3354('0x33')]?_0x202f17[_0x3354('0x31')]:_0x3b0180[_0x3354('0x30')];if(!_0x506199[_0x3354('0x2c')][_0x3354('0x34')](_0x3354('0x35'))){_0x202f17[_0x3354('0x1b')]=qs['limit'](_0x506199[_0x3354('0x2c')]['limit']);_0x202f17['offset']=qs['offset'](_0x506199['query'][_0x3354('0x19')]);}_0x202f17[_0x3354('0x36')]=qs[_0x3354('0x37')](_0x506199[_0x3354('0x2c')][_0x3354('0x37')]);_0x202f17[_0x3354('0x38')]=qs[_0x3354('0x2e')](_[_0x3354('0x39')](_0x506199['query'],_0x3b0180[_0x3354('0x2e')]),_0x169a9c);if(_0x506199['query']['filter']){_0x202f17[_0x3354('0x38')]=_[_0x3354('0x3a')](_0x202f17['where'],{'$or':_[_0x3354('0x27')](_0x169a9c,function(_0x8fc647){if(_0x8fc647['type']!==_0x3354('0x3b')){var _0x6e867a={};_0x6e867a[_0x8fc647[_0x3354('0x25')]]={'$like':'%'+_0x506199[_0x3354('0x2c')]['filter']+'%'};return _0x6e867a;}})});}_0x202f17=_[_0x3354('0x3a')]({},_0x202f17,_0x506199[_0x3354('0x3c')]);var _0x3fe698={'where':_0x202f17[_0x3354('0x38')]};return db['MailServerOut'][_0x3354('0x1c')](_0x3fe698)[_0x3354('0x22')](function(_0x11c7e4){_0x10bde5[_0x3354('0x1c')]=_0x11c7e4;if(_0x506199[_0x3354('0x2c')][_0x3354('0x3d')]){_0x202f17['include']=[{'all':!![]}];}return db[_0x3354('0x3e')][_0x3354('0x3f')](_0x202f17);})[_0x3354('0x22')](function(_0x6c5d55){_0x10bde5['rows']=_0x6c5d55;return _0x10bde5;})[_0x3354('0x22')](respondWithFilteredResult(_0x550d6c,_0x202f17))[_0x3354('0x40')](handleError(_0x550d6c,null));};exports[_0x3354('0x41')]=function(_0x473106,_0x127d65){var _0x1b67b5={'raw':!![],'where':{'id':_0x473106[_0x3354('0x42')]['id']}},_0x8bcc33={};_0x8bcc33[_0x3354('0x30')]=_[_0x3354('0x2d')](db['MailServerOut'][_0x3354('0x28')]);_0x8bcc33[_0x3354('0x2c')]=_[_0x3354('0x2d')](_0x473106[_0x3354('0x2c')]);_0x8bcc33[_0x3354('0x2e')]=_[_0x3354('0x2f')](_0x8bcc33['model'],_0x8bcc33[_0x3354('0x2c')]);_0x1b67b5['attributes']=_['intersection'](_0x8bcc33[_0x3354('0x30')],qs['fields'](_0x473106['query'][_0x3354('0x32')]));_0x1b67b5[_0x3354('0x31')]=_0x1b67b5[_0x3354('0x31')]['length']?_0x1b67b5[_0x3354('0x31')]:_0x8bcc33[_0x3354('0x30')];if(_0x473106[_0x3354('0x2c')][_0x3354('0x3d')]){_0x1b67b5[_0x3354('0x43')]=[{'all':!![]}];}_0x1b67b5=_[_0x3354('0x3a')]({},_0x1b67b5,_0x473106['options']);return db[_0x3354('0x3e')][_0x3354('0x44')](_0x1b67b5)['then'](handleEntityNotFound(_0x127d65,null))[_0x3354('0x22')](respondWithResult(_0x127d65,null))[_0x3354('0x40')](handleError(_0x127d65,null));};exports['create']=function(_0x33c5b9,_0x272185){return db[_0x3354('0x3e')]['create'](_0x33c5b9['body'],{})[_0x3354('0x22')](respondWithResult(_0x272185,0xc9))[_0x3354('0x40')](handleError(_0x272185,null));};exports[_0x3354('0x21')]=function(_0x20fb36,_0x3931b7){if(_0x20fb36['body']['id']){delete _0x20fb36[_0x3354('0x45')]['id'];}return db['MailServerOut'][_0x3354('0x44')]({'where':{'id':_0x20fb36[_0x3354('0x42')]['id']}})[_0x3354('0x22')](handleEntityNotFound(_0x3931b7,null))['then'](saveUpdates(_0x20fb36['body'],null))[_0x3354('0x22')](respondWithResult(_0x3931b7,null))[_0x3354('0x40')](handleError(_0x3931b7,null));};exports[_0x3354('0x46')]=function(_0x836c12,_0x55c4bb){return db['MailServerOut'][_0x3354('0x44')]({'where':{'id':_0x836c12[_0x3354('0x42')]['id']}})[_0x3354('0x22')](handleEntityNotFound(_0x55c4bb,null))[_0x3354('0x22')](removeEntity(_0x55c4bb,null))[_0x3354('0x40')](handleError(_0x55c4bb,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index d9ea44b..3389106 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 _0x3a15=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x33a295,_0x203e88){var _0x117b21=function(_0x356c5d){while(--_0x356c5d){_0x33a295['push'](_0x33a295['shift']());}};_0x117b21(++_0x203e88);}(_0x3a15,0x19e));var _0x53a1=function(_0x4f90af,_0x14b70c){_0x4f90af=_0x4f90af-0x0;var _0x5e62c0=_0x3a15[_0x4f90af];return _0x5e62c0;};'use strict';var _=require(_0x53a1('0x0'));var util=require('util');var logger=require(_0x53a1('0x1'))(_0x53a1('0x2'));var moment=require(_0x53a1('0x3'));var BPromise=require(_0x53a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53a1('0x5'));var rimraf=require('rimraf');var config=require(_0x53a1('0x6'));var attributes=require(_0x53a1('0x7'));module[_0x53a1('0x8')]=function(_0x5cf82a,_0x176003){return _0x5cf82a[_0x53a1('0x9')](_0x53a1('0xa'),attributes,{'tableName':_0x53a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0bd=['./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x1adcde,_0x3352f9){var _0x53b05a=function(_0x18ab21){while(--_0x18ab21){_0x1adcde['push'](_0x1adcde['shift']());}};_0x53b05a(++_0x3352f9);}(_0xd0bd,0x1bc));var _0xdd0b=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0xd0bd[_0x8dc04d];return _0x2f5f28;};'use strict';var _=require(_0xdd0b('0x0'));var util=require(_0xdd0b('0x1'));var logger=require(_0xdd0b('0x2'))(_0xdd0b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdd0b('0x4'));var fs=require('fs');var path=require(_0xdd0b('0x5'));var rimraf=require('rimraf');var config=require(_0xdd0b('0x6'));var attributes=require(_0xdd0b('0x7'));module[_0xdd0b('0x8')]=function(_0x25d843,_0x1e7cc9){return _0x25d843[_0xdd0b('0x9')]('MailServerOut',attributes,{'tableName':_0xdd0b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 6399fc2..4089f9a 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x5392d7,_0x2bd841){var _0x272758=function(_0x1450a2){while(--_0x1450a2){_0x5392d7['push'](_0x5392d7['shift']());}};_0x272758(++_0x2bd841);}(_0xdb28,0x106));var _0x8db2=function(_0x13e4a3,_0x576e9b){_0x13e4a3=_0x13e4a3-0x0;var _0x26b079=_0xdb28[_0x13e4a3];return _0x26b079;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2b495c,_0x596e31){var _0x59e6cd=function(_0xf13e5c){while(--_0xf13e5c){_0x2b495c['push'](_0x2b495c['shift']());}};_0x59e6cd(++_0x596e31);}(_0x2ef3,0xba));var _0x32ef=function(_0x5f57fb,_0x40e3d8){_0x5f57fb=_0x5f57fb-0x0;var _0x57fcad=_0x2ef3[_0x5f57fb];return _0x57fcad;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 90645b0..75a6654 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 _0x3384=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create'];(function(_0x28b70a,_0x5a40c0){var _0x117957=function(_0x1f3d6d){while(--_0x1f3d6d){_0x28b70a['push'](_0x28b70a['shift']());}};_0x117957(++_0x5a40c0);}(_0x3384,0x12e));var _0x4338=function(_0x2160b9,_0x182473){_0x2160b9=_0x2160b9-0x0;var _0x4fdd91=_0x3384[_0x2160b9];return _0x4fdd91;};'use strict';var multer=require('multer');var util=require(_0x4338('0x0'));var path=require(_0x4338('0x1'));var timeout=require(_0x4338('0x2'));var express=require(_0x4338('0x3'));var router=express['Router']();var fs_extra=require(_0x4338('0x4'));var auth=require(_0x4338('0x5'));var interaction=require(_0x4338('0x6'));var config=require(_0x4338('0x7'));var controller=require(_0x4338('0x8'));router['get']('/',auth[_0x4338('0x9')](),controller[_0x4338('0xa')]);router[_0x4338('0xb')](_0x4338('0xc'),auth[_0x4338('0x9')](),controller[_0x4338('0xd')]);router[_0x4338('0xb')](_0x4338('0xe'),auth['isAuthenticated'](),controller[_0x4338('0xf')]);router[_0x4338('0x10')]('/',auth['isAuthenticated'](),controller[_0x4338('0x11')]);router['put'](_0x4338('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x4338('0x9')](),controller[_0x4338('0x12')]);module[_0x4338('0x13')]=router; \ No newline at end of file +var _0xf8f1=['show','create','put','update','delete','/:id','isAuthenticated','exports','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','index','describe'];(function(_0x5a5f05,_0x234d2a){var _0x52a1d4=function(_0x4d9e7c){while(--_0x4d9e7c){_0x5a5f05['push'](_0x5a5f05['shift']());}};_0x52a1d4(++_0x234d2a);}(_0xf8f1,0x188));var _0x1f8f=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xf8f1[_0x47e549];return _0x251374;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1f8f('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1f8f('0x1'));var auth=require(_0x1f8f('0x2'));var interaction=require(_0x1f8f('0x3'));var config=require('../../config/environment');var controller=require(_0x1f8f('0x4'));router[_0x1f8f('0x5')]('/',auth['isAuthenticated'](),controller[_0x1f8f('0x6')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1f8f('0x7')]);router[_0x1f8f('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x1f8f('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1f8f('0x9')]);router[_0x1f8f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1f8f('0xb')]);router[_0x1f8f('0xc')](_0x1f8f('0xd'),auth[_0x1f8f('0xe')](),controller['destroy']);module[_0x1f8f('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index f263e62..120a688 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(_0x59921d,_0x4f9082){var _0x5f36ae=function(_0x585d11){while(--_0x585d11){_0x59921d['push'](_0x59921d['shift']());}};_0x5f36ae(++_0x4f9082);}(_0xcaf2,0x8a));var _0x2caf=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0xcaf2[_0xf2628e];return _0x13863a;};'use strict';var Sequelize=require(_0x2caf('0x0'));module['exports']={'name':{'type':Sequelize[_0x2caf('0x1')],'unique':_0x2caf('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdfa0=['sequelize','STRING','name'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0xdfa0,0x69));var _0x0dfa=function(_0xa5cef6,_0x4554c1){_0xa5cef6=_0xa5cef6-0x0;var _0x2a3262=_0xdfa0[_0xa5cef6];return _0x2a3262;};'use strict';var Sequelize=require(_0x0dfa('0x0'));module['exports']={'name':{'type':Sequelize[_0x0dfa('0x1')],'unique':_0x0dfa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index cdb6288..a96c4ab 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 _0x2a28=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','MailSubstatus','include','rows','catch','params','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x39630a,_0x391ee1){var _0x46e078=function(_0x419ca5){while(--_0x419ca5){_0x39630a['push'](_0x39630a['shift']());}};_0x46e078(++_0x391ee1);}(_0x2a28,0x89));var _0x82a2=function(_0x557023,_0x18ce5e){_0x557023=_0x557023-0x0;var _0x559f5e=_0x2a28[_0x557023];return _0x559f5e;};'use strict';var emlformat=require(_0x82a2('0x0'));var rimraf=require(_0x82a2('0x1'));var zipdir=require(_0x82a2('0x2'));var jsonpatch=require(_0x82a2('0x3'));var rp=require(_0x82a2('0x4'));var moment=require('moment');var BPromise=require(_0x82a2('0x5'));var Mustache=require(_0x82a2('0x6'));var util=require('util');var path=require(_0x82a2('0x7'));var sox=require(_0x82a2('0x8'));var csv=require(_0x82a2('0x9'));var ejs=require(_0x82a2('0xa'));var fs=require('fs');var fs_extra=require(_0x82a2('0xb'));var _=require(_0x82a2('0xc'));var squel=require(_0x82a2('0xd'));var crypto=require(_0x82a2('0xe'));var jsforce=require(_0x82a2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x82a2('0x9'));var querystring=require(_0x82a2('0x10'));var Papa=require(_0x82a2('0x11'));var Redis=require(_0x82a2('0x12'));var authService=require(_0x82a2('0x13'));var qs=require(_0x82a2('0x14'));var as=require(_0x82a2('0x15'));var hardwareService=require(_0x82a2('0x16'));var logger=require(_0x82a2('0x17'))(_0x82a2('0x18'));var utils=require(_0x82a2('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x82a2('0x1a'));var db=require(_0x82a2('0x1b'))['db'];function respondWithStatusCode(_0x3a3cad,_0x547134){_0x547134=_0x547134||0xcc;return function(_0x27082d){if(_0x27082d){return _0x3a3cad[_0x82a2('0x1c')](_0x547134);}return _0x3a3cad[_0x82a2('0x1d')](_0x547134)['end']();};}function respondWithResult(_0x4fe555,_0x17b63c){_0x17b63c=_0x17b63c||0xc8;return function(_0x16184a){if(_0x16184a){return _0x4fe555[_0x82a2('0x1d')](_0x17b63c)[_0x82a2('0x1e')](_0x16184a);}};}function respondWithFilteredResult(_0x2e1950,_0x2247ae){return function(_0x3d71dd){if(_0x3d71dd){var _0x8c7a21=typeof _0x2247ae[_0x82a2('0x1f')]===_0x82a2('0x20')&&typeof _0x2247ae[_0x82a2('0x21')]===_0x82a2('0x20');var _0x272530=_0x3d71dd[_0x82a2('0x22')];var _0x800683=_0x8c7a21?0x0:_0x2247ae[_0x82a2('0x1f')];var _0x1604ca=_0x8c7a21?_0x3d71dd[_0x82a2('0x22')]:_0x2247ae['offset']+_0x2247ae[_0x82a2('0x21')];var _0x3b6bc0;if(_0x1604ca>=_0x272530){_0x1604ca=_0x272530;_0x3b6bc0=0xc8;}else{_0x3b6bc0=0xce;}_0x2e1950['status'](_0x3b6bc0);return _0x2e1950[_0x82a2('0x23')](_0x82a2('0x24'),_0x800683+'-'+_0x1604ca+'/'+_0x272530)[_0x82a2('0x1e')](_0x3d71dd);}return null;};}function patchUpdates(_0x5ab538){return function(_0x312f0e){try{jsonpatch[_0x82a2('0x25')](_0x312f0e,_0x5ab538,!![]);}catch(_0x4daa84){return BPromise['reject'](_0x4daa84);}return _0x312f0e[_0x82a2('0x26')]();};}function saveUpdates(_0x53dcea,_0x4de497){return function(_0xf78be8){if(_0xf78be8){return _0xf78be8['update'](_0x53dcea)[_0x82a2('0x27')](function(_0x356f21){return _0x356f21;});}return null;};}function removeEntity(_0x3a4e86,_0x7ae9d4){return function(_0x394922){if(_0x394922){return _0x394922['destroy']()[_0x82a2('0x27')](function(){_0x3a4e86[_0x82a2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d6d30,_0x25b8a9){return function(_0x1df339){if(!_0x1df339){_0x2d6d30['sendStatus'](0x194);}return _0x1df339;};}function handleError(_0x189f45,_0x8c75a2){_0x8c75a2=_0x8c75a2||0x1f4;return function(_0x23a69e){logger['error'](_0x23a69e[_0x82a2('0x28')]);if(_0x23a69e['name']){delete _0x23a69e['name'];}_0x189f45[_0x82a2('0x1d')](_0x8c75a2)[_0x82a2('0x29')](_0x23a69e);};}exports[_0x82a2('0x2a')]=function(_0x4b3f52,_0x53b134){var _0x864e1d={},_0x26da3d={},_0x264a8a={'count':0x0,'rows':[]};var _0x11e880=_['map'](db['MailSubstatus'][_0x82a2('0x2b')],function(_0x228071){return{'name':_0x228071[_0x82a2('0x2c')],'type':_0x228071[_0x82a2('0x2d')]['key']};});_0x26da3d[_0x82a2('0x2e')]=_[_0x82a2('0x2f')](_0x11e880,_0x82a2('0x30'));_0x26da3d[_0x82a2('0x31')]=_[_0x82a2('0x32')](_0x4b3f52[_0x82a2('0x31')]);_0x26da3d[_0x82a2('0x33')]=_[_0x82a2('0x34')](_0x26da3d[_0x82a2('0x2e')],_0x26da3d[_0x82a2('0x31')]);_0x864e1d[_0x82a2('0x35')]=_['intersection'](_0x26da3d['model'],qs[_0x82a2('0x36')](_0x4b3f52[_0x82a2('0x31')][_0x82a2('0x36')]));_0x864e1d['attributes']=_0x864e1d['attributes'][_0x82a2('0x37')]?_0x864e1d[_0x82a2('0x35')]:_0x26da3d[_0x82a2('0x2e')];if(!_0x4b3f52[_0x82a2('0x31')][_0x82a2('0x38')](_0x82a2('0x39'))){_0x864e1d[_0x82a2('0x21')]=qs[_0x82a2('0x21')](_0x4b3f52[_0x82a2('0x31')][_0x82a2('0x21')]);_0x864e1d[_0x82a2('0x1f')]=qs[_0x82a2('0x1f')](_0x4b3f52[_0x82a2('0x31')][_0x82a2('0x1f')]);}_0x864e1d[_0x82a2('0x3a')]=qs[_0x82a2('0x3b')](_0x4b3f52['query'][_0x82a2('0x3b')]);_0x864e1d[_0x82a2('0x3c')]=qs[_0x82a2('0x33')](_[_0x82a2('0x3d')](_0x4b3f52['query'],_0x26da3d[_0x82a2('0x33')]),_0x11e880);if(_0x4b3f52['query'][_0x82a2('0x3e')]){_0x864e1d['where']=_['merge'](_0x864e1d[_0x82a2('0x3c')],{'$or':_[_0x82a2('0x2f')](_0x11e880,function(_0x52c365){if(_0x52c365[_0x82a2('0x2d')]!==_0x82a2('0x3f')){var _0x15d4fc={};_0x15d4fc[_0x52c365[_0x82a2('0x30')]]={'$like':'%'+_0x4b3f52[_0x82a2('0x31')][_0x82a2('0x3e')]+'%'};return _0x15d4fc;}})});}_0x864e1d=_[_0x82a2('0x40')]({},_0x864e1d,_0x4b3f52[_0x82a2('0x41')]);var _0x3a0b30={'where':_0x864e1d[_0x82a2('0x3c')]};return db[_0x82a2('0x42')][_0x82a2('0x22')](_0x3a0b30)[_0x82a2('0x27')](function(_0x5d7dff){_0x264a8a[_0x82a2('0x22')]=_0x5d7dff;if(_0x4b3f52['query']['includeAll']){_0x864e1d[_0x82a2('0x43')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x864e1d);})['then'](function(_0x129c28){_0x264a8a[_0x82a2('0x44')]=_0x129c28;return _0x264a8a;})[_0x82a2('0x27')](respondWithFilteredResult(_0x53b134,_0x864e1d))[_0x82a2('0x45')](handleError(_0x53b134,null));};exports['show']=function(_0x33ad78,_0x15c49b){var _0x3c9a37={'raw':!![],'where':{'id':_0x33ad78[_0x82a2('0x46')]['id']}},_0x6d7bd3={};_0x6d7bd3[_0x82a2('0x2e')]=_['keys'](db['MailSubstatus'][_0x82a2('0x2b')]);_0x6d7bd3[_0x82a2('0x31')]=_[_0x82a2('0x32')](_0x33ad78['query']);_0x6d7bd3['filters']=_[_0x82a2('0x34')](_0x6d7bd3['model'],_0x6d7bd3[_0x82a2('0x31')]);_0x3c9a37['attributes']=_[_0x82a2('0x34')](_0x6d7bd3[_0x82a2('0x2e')],qs[_0x82a2('0x36')](_0x33ad78[_0x82a2('0x31')]['fields']));_0x3c9a37['attributes']=_0x3c9a37[_0x82a2('0x35')]['length']?_0x3c9a37[_0x82a2('0x35')]:_0x6d7bd3[_0x82a2('0x2e')];if(_0x33ad78[_0x82a2('0x31')]['includeAll']){_0x3c9a37['include']=[{'all':!![]}];}_0x3c9a37=_[_0x82a2('0x40')]({},_0x3c9a37,_0x33ad78[_0x82a2('0x41')]);return db['MailSubstatus'][_0x82a2('0x47')](_0x3c9a37)[_0x82a2('0x27')](handleEntityNotFound(_0x15c49b,null))['then'](respondWithResult(_0x15c49b,null))[_0x82a2('0x45')](handleError(_0x15c49b,null));};exports['create']=function(_0x5d501a,_0x5bc307){return db['MailSubstatus'][_0x82a2('0x48')](_0x5d501a[_0x82a2('0x49')],{})[_0x82a2('0x27')](respondWithResult(_0x5bc307,0xc9))[_0x82a2('0x45')](handleError(_0x5bc307,null));};exports[_0x82a2('0x4a')]=function(_0x3b50af,_0x2f2a9b){if(_0x3b50af[_0x82a2('0x49')]['id']){delete _0x3b50af[_0x82a2('0x49')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x3b50af['params']['id']}})[_0x82a2('0x27')](handleEntityNotFound(_0x2f2a9b,null))[_0x82a2('0x27')](saveUpdates(_0x3b50af[_0x82a2('0x49')],null))[_0x82a2('0x27')](respondWithResult(_0x2f2a9b,null))[_0x82a2('0x45')](handleError(_0x2f2a9b,null));};exports[_0x82a2('0x4b')]=function(_0x287db7,_0x413494){return db[_0x82a2('0x42')]['find']({'where':{'id':_0x287db7[_0x82a2('0x46')]['id']}})['then'](handleEntityNotFound(_0x413494,null))['then'](removeEntity(_0x413494,null))[_0x82a2('0x45')](handleError(_0x413494,null));};exports[_0x82a2('0x4c')]=function(_0x5195a7,_0x44275f){return db[_0x82a2('0x42')][_0x82a2('0x4c')]()[_0x82a2('0x27')](respondWithResult(_0x44275f,null))[_0x82a2('0x45')](handleError(_0x44275f,null));}; \ No newline at end of file +var _0xc154=['keys','query','filters','intersection','attributes','model','fields','length','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','type','key'];(function(_0x194360,_0x536c55){var _0x41fdc4=function(_0x63374){while(--_0x63374){_0x194360['push'](_0x194360['shift']());}};_0x41fdc4(++_0x536c55);}(_0xc154,0xa9));var _0x4c15=function(_0x2b16b3,_0x1611a1){_0x2b16b3=_0x2b16b3-0x0;var _0x415632=_0xc154[_0x2b16b3];return _0x415632;};'use strict';var emlformat=require(_0x4c15('0x0'));var rimraf=require(_0x4c15('0x1'));var zipdir=require(_0x4c15('0x2'));var jsonpatch=require(_0x4c15('0x3'));var rp=require(_0x4c15('0x4'));var moment=require('moment');var BPromise=require(_0x4c15('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4c15('0x6'));var sox=require(_0x4c15('0x7'));var csv=require(_0x4c15('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c15('0x9'));var _=require('lodash');var squel=require(_0x4c15('0xa'));var crypto=require(_0x4c15('0xb'));var jsforce=require(_0x4c15('0xc'));var deskjs=require(_0x4c15('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4c15('0xe'));var Papa=require(_0x4c15('0xf'));var Redis=require(_0x4c15('0x10'));var authService=require(_0x4c15('0x11'));var qs=require(_0x4c15('0x12'));var as=require(_0x4c15('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4c15('0x14'));var utils=require(_0x4c15('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4c15('0x16'));var db=require(_0x4c15('0x17'))['db'];function respondWithStatusCode(_0x17bb28,_0x4dfbb2){_0x4dfbb2=_0x4dfbb2||0xcc;return function(_0x328e83){if(_0x328e83){return _0x17bb28[_0x4c15('0x18')](_0x4dfbb2);}return _0x17bb28[_0x4c15('0x19')](_0x4dfbb2)[_0x4c15('0x1a')]();};}function respondWithResult(_0x5b127b,_0x166f21){_0x166f21=_0x166f21||0xc8;return function(_0x593feb){if(_0x593feb){return _0x5b127b[_0x4c15('0x19')](_0x166f21)['json'](_0x593feb);}};}function respondWithFilteredResult(_0x276aec,_0x2350ce){return function(_0x9b3b9b){if(_0x9b3b9b){var _0x5b32ec=typeof _0x2350ce[_0x4c15('0x1b')]===_0x4c15('0x1c')&&typeof _0x2350ce[_0x4c15('0x1d')]===_0x4c15('0x1c');var _0x5029ad=_0x9b3b9b['count'];var _0x101d45=_0x5b32ec?0x0:_0x2350ce[_0x4c15('0x1b')];var _0x45744f=_0x5b32ec?_0x9b3b9b[_0x4c15('0x1e')]:_0x2350ce[_0x4c15('0x1b')]+_0x2350ce[_0x4c15('0x1d')];var _0x107e91;if(_0x45744f>=_0x5029ad){_0x45744f=_0x5029ad;_0x107e91=0xc8;}else{_0x107e91=0xce;}_0x276aec['status'](_0x107e91);return _0x276aec[_0x4c15('0x1f')]('Content-Range',_0x101d45+'-'+_0x45744f+'/'+_0x5029ad)[_0x4c15('0x20')](_0x9b3b9b);}return null;};}function patchUpdates(_0x56ba50){return function(_0x55f455){try{jsonpatch[_0x4c15('0x21')](_0x55f455,_0x56ba50,!![]);}catch(_0x3ba99c){return BPromise[_0x4c15('0x22')](_0x3ba99c);}return _0x55f455['save']();};}function saveUpdates(_0x6c95dc,_0x11455e){return function(_0x3e8f97){if(_0x3e8f97){return _0x3e8f97[_0x4c15('0x23')](_0x6c95dc)[_0x4c15('0x24')](function(_0x3c066d){return _0x3c066d;});}return null;};}function removeEntity(_0x5b4005,_0x3f220e){return function(_0x14355a){if(_0x14355a){return _0x14355a[_0x4c15('0x25')]()[_0x4c15('0x24')](function(){_0x5b4005[_0x4c15('0x19')](0xcc)[_0x4c15('0x1a')]();});}};}function handleEntityNotFound(_0x576da5,_0x159087){return function(_0x1e03f5){if(!_0x1e03f5){_0x576da5['sendStatus'](0x194);}return _0x1e03f5;};}function handleError(_0x2a1c54,_0x59365a){_0x59365a=_0x59365a||0x1f4;return function(_0x1a168e){logger[_0x4c15('0x26')](_0x1a168e[_0x4c15('0x27')]);if(_0x1a168e[_0x4c15('0x28')]){delete _0x1a168e[_0x4c15('0x28')];}_0x2a1c54['status'](_0x59365a)[_0x4c15('0x29')](_0x1a168e);};}exports[_0x4c15('0x2a')]=function(_0x63e90f,_0x2b0aaa){var _0x29ee0c={},_0x564f66={},_0x47436d={'count':0x0,'rows':[]};var _0xe9747c=_[_0x4c15('0x2b')](db[_0x4c15('0x2c')]['rawAttributes'],function(_0x1a15a8){return{'name':_0x1a15a8['fieldName'],'type':_0x1a15a8[_0x4c15('0x2d')][_0x4c15('0x2e')]};});_0x564f66['model']=_[_0x4c15('0x2b')](_0xe9747c,_0x4c15('0x28'));_0x564f66['query']=_[_0x4c15('0x2f')](_0x63e90f[_0x4c15('0x30')]);_0x564f66[_0x4c15('0x31')]=_[_0x4c15('0x32')](_0x564f66['model'],_0x564f66[_0x4c15('0x30')]);_0x29ee0c[_0x4c15('0x33')]=_[_0x4c15('0x32')](_0x564f66[_0x4c15('0x34')],qs[_0x4c15('0x35')](_0x63e90f[_0x4c15('0x30')][_0x4c15('0x35')]));_0x29ee0c[_0x4c15('0x33')]=_0x29ee0c[_0x4c15('0x33')][_0x4c15('0x36')]?_0x29ee0c[_0x4c15('0x33')]:_0x564f66[_0x4c15('0x34')];if(!_0x63e90f[_0x4c15('0x30')]['hasOwnProperty']('nolimit')){_0x29ee0c[_0x4c15('0x1d')]=qs['limit'](_0x63e90f['query'][_0x4c15('0x1d')]);_0x29ee0c[_0x4c15('0x1b')]=qs[_0x4c15('0x1b')](_0x63e90f[_0x4c15('0x30')][_0x4c15('0x1b')]);}_0x29ee0c['order']=qs[_0x4c15('0x37')](_0x63e90f[_0x4c15('0x30')]['sort']);_0x29ee0c[_0x4c15('0x38')]=qs['filters'](_['pick'](_0x63e90f[_0x4c15('0x30')],_0x564f66[_0x4c15('0x31')]),_0xe9747c);if(_0x63e90f[_0x4c15('0x30')][_0x4c15('0x39')]){_0x29ee0c['where']=_[_0x4c15('0x3a')](_0x29ee0c[_0x4c15('0x38')],{'$or':_[_0x4c15('0x2b')](_0xe9747c,function(_0x54e725){if(_0x54e725[_0x4c15('0x2d')]!==_0x4c15('0x3b')){var _0x20295a={};_0x20295a[_0x54e725[_0x4c15('0x28')]]={'$like':'%'+_0x63e90f[_0x4c15('0x30')][_0x4c15('0x39')]+'%'};return _0x20295a;}})});}_0x29ee0c=_['merge']({},_0x29ee0c,_0x63e90f[_0x4c15('0x3c')]);var _0x48b517={'where':_0x29ee0c[_0x4c15('0x38')]};return db[_0x4c15('0x2c')][_0x4c15('0x1e')](_0x48b517)[_0x4c15('0x24')](function(_0x51beff){_0x47436d[_0x4c15('0x1e')]=_0x51beff;if(_0x63e90f['query'][_0x4c15('0x3d')]){_0x29ee0c['include']=[{'all':!![]}];}return db[_0x4c15('0x2c')][_0x4c15('0x3e')](_0x29ee0c);})[_0x4c15('0x24')](function(_0x5ae420){_0x47436d['rows']=_0x5ae420;return _0x47436d;})['then'](respondWithFilteredResult(_0x2b0aaa,_0x29ee0c))[_0x4c15('0x3f')](handleError(_0x2b0aaa,null));};exports[_0x4c15('0x40')]=function(_0x206a45,_0x5a535){var _0x28ff49={'raw':!![],'where':{'id':_0x206a45[_0x4c15('0x41')]['id']}},_0x10099d={};_0x10099d[_0x4c15('0x34')]=_[_0x4c15('0x2f')](db[_0x4c15('0x2c')][_0x4c15('0x42')]);_0x10099d['query']=_[_0x4c15('0x2f')](_0x206a45[_0x4c15('0x30')]);_0x10099d[_0x4c15('0x31')]=_[_0x4c15('0x32')](_0x10099d[_0x4c15('0x34')],_0x10099d[_0x4c15('0x30')]);_0x28ff49[_0x4c15('0x33')]=_[_0x4c15('0x32')](_0x10099d[_0x4c15('0x34')],qs[_0x4c15('0x35')](_0x206a45['query'][_0x4c15('0x35')]));_0x28ff49[_0x4c15('0x33')]=_0x28ff49['attributes'][_0x4c15('0x36')]?_0x28ff49[_0x4c15('0x33')]:_0x10099d['model'];if(_0x206a45[_0x4c15('0x30')][_0x4c15('0x3d')]){_0x28ff49[_0x4c15('0x43')]=[{'all':!![]}];}_0x28ff49=_[_0x4c15('0x3a')]({},_0x28ff49,_0x206a45['options']);return db[_0x4c15('0x2c')][_0x4c15('0x44')](_0x28ff49)[_0x4c15('0x24')](handleEntityNotFound(_0x5a535,null))[_0x4c15('0x24')](respondWithResult(_0x5a535,null))[_0x4c15('0x3f')](handleError(_0x5a535,null));};exports[_0x4c15('0x45')]=function(_0x19bb2b,_0x38bc62){return db[_0x4c15('0x2c')]['create'](_0x19bb2b[_0x4c15('0x46')],{})[_0x4c15('0x24')](respondWithResult(_0x38bc62,0xc9))['catch'](handleError(_0x38bc62,null));};exports[_0x4c15('0x23')]=function(_0x4d05f1,_0x2b040a){if(_0x4d05f1['body']['id']){delete _0x4d05f1[_0x4c15('0x46')]['id'];}return db[_0x4c15('0x2c')][_0x4c15('0x44')]({'where':{'id':_0x4d05f1[_0x4c15('0x41')]['id']}})[_0x4c15('0x24')](handleEntityNotFound(_0x2b040a,null))[_0x4c15('0x24')](saveUpdates(_0x4d05f1[_0x4c15('0x46')],null))[_0x4c15('0x24')](respondWithResult(_0x2b040a,null))[_0x4c15('0x3f')](handleError(_0x2b040a,null));};exports[_0x4c15('0x25')]=function(_0x343fb3,_0x2c7170){return db['MailSubstatus'][_0x4c15('0x44')]({'where':{'id':_0x343fb3[_0x4c15('0x41')]['id']}})[_0x4c15('0x24')](handleEntityNotFound(_0x2c7170,null))[_0x4c15('0x24')](removeEntity(_0x2c7170,null))[_0x4c15('0x3f')](handleError(_0x2c7170,null));};exports[_0x4c15('0x47')]=function(_0x156e10,_0x118e9a){return db[_0x4c15('0x2c')][_0x4c15('0x47')]()['then'](respondWithResult(_0x118e9a,null))[_0x4c15('0x3f')](handleError(_0x118e9a,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index dc504ba..1239cfc 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x922b=['exports','events','../../mysqldb','MailSubstatus','emit','hook'];(function(_0x578cee,_0x298f1d){var _0x40dfd3=function(_0x1f9019){while(--_0x1f9019){_0x578cee['push'](_0x578cee['shift']());}};_0x40dfd3(++_0x298f1d);}(_0x922b,0x1ab));var _0xb922=function(_0x58eda3,_0x3a5425){_0x58eda3=_0x58eda3-0x0;var _0x2b4377=_0x922b[_0x58eda3];return _0x2b4377;};'use strict';var EventEmitter=require(_0xb922('0x0'));var MailSubstatus=require(_0xb922('0x1'))['db'][_0xb922('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x58aa80){return function(_0x65d90a,_0x3f2d75,_0x257f6c){MailSubstatusEvents[_0xb922('0x3')](_0x58aa80+':'+_0x65d90a['id'],_0x65d90a);MailSubstatusEvents[_0xb922('0x3')](_0x58aa80,_0x65d90a);_0x257f6c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xb922('0x4')](e,emitEvent(event));}}module[_0xb922('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0x5c1b=['../../mysqldb','setMaxListeners','emit','hasOwnProperty','exports','events'];(function(_0x33e640,_0x5d8c8f){var _0x42269a=function(_0x3b5fcb){while(--_0x3b5fcb){_0x33e640['push'](_0x33e640['shift']());}};_0x42269a(++_0x5d8c8f);}(_0x5c1b,0x179));var _0xb5c1=function(_0x7b509b,_0xeeb4e){_0x7b509b=_0x7b509b-0x0;var _0x10091a=_0x5c1b[_0x7b509b];return _0x10091a;};'use strict';var EventEmitter=require(_0xb5c1('0x0'));var MailSubstatus=require(_0xb5c1('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xb5c1('0x2')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x4cf432){return function(_0x12b817,_0x39e744,_0x49a80e){MailSubstatusEvents['emit'](_0x4cf432+':'+_0x12b817['id'],_0x12b817);MailSubstatusEvents[_0xb5c1('0x3')](_0x4cf432,_0x12b817);_0x49a80e(null);};}for(var e in events){if(events[_0xb5c1('0x4')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0xb5c1('0x5')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index ba7b4b5..7942481 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 _0x6f26=['exports','models','define','mail_substatuses','update','name','mailSubstatus','then','catch'];(function(_0x4020a7,_0x136909){var _0x4f41dc=function(_0x51bb0f){while(--_0x51bb0f){_0x4020a7['push'](_0x4020a7['shift']());}};_0x4f41dc(++_0x136909);}(_0x6f26,0x144));var _0x66f2=function(_0xbe8102,_0x5b967f){_0xbe8102=_0xbe8102-0x0;var _0x1de5d0=_0x6f26[_0xbe8102];return _0x1de5d0;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x66f2('0x0')]=function(_0x5822b8){var _0xb77c8=_0x5822b8[_0x66f2('0x1')];return _0x5822b8[_0x66f2('0x2')]('MailSubstatus',attributes,{'tableName':_0x66f2('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x18168a,_0x4bb502,_0x349b63){return _0xb77c8['Condition'][_0x66f2('0x4')]({'value':_0x18168a[_0x66f2('0x5')]},{'where':{'field':_0x66f2('0x6'),'value':_0x18168a['_previousDataValues'][_0x66f2('0x5')]}})[_0x66f2('0x7')](function(){_0x349b63();})[_0x66f2('0x8')](function(_0x33fda5){_0x349b63(_0x33fda5);});}}});}; \ No newline at end of file +var _0xb1e1=['then','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus'];(function(_0xe80461,_0x4a0a1c){var _0xbc6a2c=function(_0x1f2e19){while(--_0x1f2e19){_0xe80461['push'](_0xe80461['shift']());}};_0xbc6a2c(++_0x4a0a1c);}(_0xb1e1,0x6f));var _0x1b1e=function(_0x53768e,_0x5abfaf){_0x53768e=_0x53768e-0x0;var _0x2a97ea=_0xb1e1[_0x53768e];return _0x2a97ea;};'use strict';var attributes=require(_0x1b1e('0x0'));module[_0x1b1e('0x1')]=function(_0x5f58ad){var _0x5c40b0=_0x5f58ad[_0x1b1e('0x2')];return _0x5f58ad[_0x1b1e('0x3')](_0x1b1e('0x4'),attributes,{'tableName':_0x1b1e('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x2bd4b4,_0x312206,_0x543435){return _0x5c40b0[_0x1b1e('0x6')][_0x1b1e('0x7')]({'value':_0x2bd4b4[_0x1b1e('0x8')]},{'where':{'field':_0x1b1e('0x9'),'value':_0x2bd4b4['_previousDataValues'][_0x1b1e('0x8')]}})[_0x1b1e('0xa')](function(){_0x543435();})['catch'](function(_0x58d939){_0x543435(_0x58d939);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 7daf49d..917fce2 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 _0xb708=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring'];(function(_0x1f1daf,_0x478566){var _0x176104=function(_0x22d1cf){while(--_0x22d1cf){_0x1f1daf['push'](_0x1f1daf['shift']());}};_0x176104(++_0x478566);}(_0xb708,0xe7));var _0x8b70=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0xb708[_0xb833b1];return _0x1ab87a;};'use strict';var _=require(_0x8b70('0x0'));var util=require('util');var moment=require(_0x8b70('0x1'));var BPromise=require('bluebird');var rs=require(_0x8b70('0x2'));var fs=require('fs');var Redis=require(_0x8b70('0x3'));var db=require(_0x8b70('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b70('0x5'))(_0x8b70('0x6'));var config=require(_0x8b70('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8b70('0x8')][_0x8b70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5228a9,_0x6eadce,_0x2552dd){return new BPromise(function(_0x7695f7,_0x3a36e4){return client['request'](_0x5228a9,_0x2552dd)[_0x8b70('0xa')](function(_0x4481b1){logger['info'](_0x8b70('0xb'),_0x6eadce,_0x8b70('0xc'));logger['debug'](_0x8b70('0xd'),_0x6eadce,'request\x20sent',JSON[_0x8b70('0xe')](_0x4481b1));if(_0x4481b1[_0x8b70('0xf')]){if(_0x4481b1[_0x8b70('0xf')]['code']===0x1f4){logger[_0x8b70('0xf')](_0x8b70('0xb'),_0x6eadce,_0x4481b1['error']['message']);return _0x3a36e4(_0x4481b1[_0x8b70('0xf')]['message']);}logger[_0x8b70('0xf')](_0x8b70('0xb'),_0x6eadce,_0x4481b1['error'][_0x8b70('0x10')]);return _0x7695f7(_0x4481b1[_0x8b70('0xf')][_0x8b70('0x10')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x6eadce,_0x8b70('0xc'));_0x7695f7(_0x4481b1['result'][_0x8b70('0x10')]);}})[_0x8b70('0x11')](function(_0x494d3e){logger[_0x8b70('0xf')](_0x8b70('0xb'),_0x6eadce,_0x494d3e);_0x3a36e4(_0x494d3e);});});} \ No newline at end of file +var _0xd1e8=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x198167,_0x419c0d){var _0x5407d0=function(_0x154c6a){while(--_0x154c6a){_0x198167['push'](_0x198167['shift']());}};_0x5407d0(++_0x419c0d);}(_0xd1e8,0xed));var _0x8d1e=function(_0x2109ff,_0x59366e){_0x2109ff=_0x2109ff-0x0;var _0x1b22e6=_0xd1e8[_0x2109ff];return _0x1b22e6;};'use strict';var _=require(_0x8d1e('0x0'));var util=require(_0x8d1e('0x1'));var moment=require('moment');var BPromise=require(_0x8d1e('0x2'));var rs=require(_0x8d1e('0x3'));var fs=require('fs');var Redis=require(_0x8d1e('0x4'));var db=require(_0x8d1e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d1e('0x6'))('rpc');var config=require(_0x8d1e('0x7'));var jayson=require(_0x8d1e('0x8'));var client=jayson['client'][_0x8d1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5686c2,_0x11be3c,_0x5bc89a){return new BPromise(function(_0x169742,_0x470d55){return client[_0x8d1e('0xa')](_0x5686c2,_0x5bc89a)['then'](function(_0x2bab6f){logger[_0x8d1e('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x11be3c,'request\x20sent');logger[_0x8d1e('0xc')](_0x8d1e('0xd'),_0x11be3c,_0x8d1e('0xe'),JSON[_0x8d1e('0xf')](_0x2bab6f));if(_0x2bab6f[_0x8d1e('0x10')]){if(_0x2bab6f[_0x8d1e('0x10')][_0x8d1e('0x11')]===0x1f4){logger['error'](_0x8d1e('0x12'),_0x11be3c,_0x2bab6f['error'][_0x8d1e('0x13')]);return _0x470d55(_0x2bab6f[_0x8d1e('0x10')][_0x8d1e('0x13')]);}logger[_0x8d1e('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x11be3c,_0x2bab6f[_0x8d1e('0x10')][_0x8d1e('0x13')]);return _0x169742(_0x2bab6f['error'][_0x8d1e('0x13')]);}else{logger['info'](_0x8d1e('0x12'),_0x11be3c,'request\x20sent');_0x169742(_0x2bab6f[_0x8d1e('0x14')][_0x8d1e('0x13')]);}})[_0x8d1e('0x15')](function(_0x5b6afa){logger[_0x8d1e('0x10')](_0x8d1e('0x12'),_0x11be3c,_0x5b6afa);_0x470d55(_0x5b6afa);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 4283607..6bba7cc 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 _0x9dd3=['exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailTransferReport.controller','index','get','/describe','isAuthenticated','post','create','put','/:id','delete'];(function(_0x4145c9,_0x5ca502){var _0x4a4b95=function(_0x79a9ca){while(--_0x79a9ca){_0x4145c9['push'](_0x4145c9['shift']());}};_0x4a4b95(++_0x5ca502);}(_0x9dd3,0x199));var _0x39dd=function(_0x2db3d3,_0x5dc096){_0x2db3d3=_0x2db3d3-0x0;var _0xf00dbd=_0x9dd3[_0x2db3d3];return _0xf00dbd;};'use strict';var multer=require('multer');var util=require(_0x39dd('0x0'));var path=require('path');var timeout=require(_0x39dd('0x1'));var express=require(_0x39dd('0x2'));var router=express[_0x39dd('0x3')]();var fs_extra=require(_0x39dd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x39dd('0x5'));var config=require('../../config/environment');var controller=require(_0x39dd('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x39dd('0x7')]);router[_0x39dd('0x8')](_0x39dd('0x9'),auth[_0x39dd('0xa')](),controller['describe']);router[_0x39dd('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x39dd('0xb')]('/',auth[_0x39dd('0xa')](),controller[_0x39dd('0xc')]);router[_0x39dd('0xd')](_0x39dd('0xe'),auth[_0x39dd('0xa')](),controller['update']);router[_0x39dd('0xf')](_0x39dd('0xe'),auth[_0x39dd('0xa')](),controller['destroy']);module[_0x39dd('0x10')]=router; \ No newline at end of file +var _0x5ff6=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','create','update','destroy','exports'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x5ff6,0x150));var _0x65ff=function(_0x13b5f8,_0x4994bc){_0x13b5f8=_0x13b5f8-0x0;var _0x3c4f0c=_0x5ff6[_0x13b5f8];return _0x3c4f0c;};'use strict';var multer=require(_0x65ff('0x0'));var util=require(_0x65ff('0x1'));var path=require(_0x65ff('0x2'));var timeout=require(_0x65ff('0x3'));var express=require(_0x65ff('0x4'));var router=express[_0x65ff('0x5')]();var fs_extra=require(_0x65ff('0x6'));var auth=require(_0x65ff('0x7'));var interaction=require(_0x65ff('0x8'));var config=require(_0x65ff('0x9'));var controller=require(_0x65ff('0xa'));router[_0x65ff('0xb')]('/',auth[_0x65ff('0xc')](),controller[_0x65ff('0xd')]);router[_0x65ff('0xb')]('/describe',auth[_0x65ff('0xc')](),controller[_0x65ff('0xe')]);router[_0x65ff('0xb')](_0x65ff('0xf'),auth[_0x65ff('0xc')](),controller[_0x65ff('0x10')]);router['post']('/',auth[_0x65ff('0xc')](),controller[_0x65ff('0x11')]);router['put'](_0x65ff('0xf'),auth[_0x65ff('0xc')](),controller[_0x65ff('0x12')]);router['delete']('/:id',auth[_0x65ff('0xc')](),controller[_0x65ff('0x13')]);module[_0x65ff('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index bca05cd..c8fff19 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x9f90a,_0x113a88){var _0x5629c2=function(_0x312406){while(--_0x312406){_0x9f90a['push'](_0x9f90a['shift']());}};_0x5629c2(++_0x113a88);}(_0xf4eb,0xec));var _0xbf4e=function(_0xb4e844,_0x5ea9bc){_0xb4e844=_0xb4e844-0x0;var _0x5a786b=_0xf4eb[_0xb4e844];return _0x5a786b;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1ce959,_0x57e2ee){var _0x397517=function(_0x50389b){while(--_0x50389b){_0x1ce959['push'](_0x1ce959['shift']());}};_0x397517(++_0x57e2ee);}(_0xaa88,0x137));var _0x8aa8=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xaa88[_0x2ec461];return _0x28603d;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 71a1e2a..84707c6 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 _0xe563=['end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','map','MailTransferReport','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','catch','create','body','describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x3dd910,_0x4ef4b3){var _0x2a9d7b=function(_0x112117){while(--_0x112117){_0x3dd910['push'](_0x3dd910['shift']());}};_0x2a9d7b(++_0x4ef4b3);}(_0xe563,0x197));var _0x3e56=function(_0x3341f5,_0x5c7b5f){_0x3341f5=_0x3341f5-0x0;var _0x22263e=_0xe563[_0x3341f5];return _0x22263e;};'use strict';var emlformat=require(_0x3e56('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e56('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e56('0x2'));var moment=require(_0x3e56('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3e56('0x4'));var util=require(_0x3e56('0x5'));var path=require(_0x3e56('0x6'));var sox=require(_0x3e56('0x7'));var csv=require(_0x3e56('0x8'));var ejs=require(_0x3e56('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3e56('0xa'));var crypto=require('crypto');var jsforce=require(_0x3e56('0xb'));var deskjs=require(_0x3e56('0xc'));var toCsv=require(_0x3e56('0x8'));var querystring=require(_0x3e56('0xd'));var Papa=require(_0x3e56('0xe'));var Redis=require(_0x3e56('0xf'));var authService=require(_0x3e56('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3e56('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e56('0x12'))(_0x3e56('0x13'));var utils=require(_0x3e56('0x14'));var config=require(_0x3e56('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e56('0x16'))['db'];function respondWithStatusCode(_0x5afb24,_0x37904d){_0x37904d=_0x37904d||0xcc;return function(_0x15ef6a){if(_0x15ef6a){return _0x5afb24[_0x3e56('0x17')](_0x37904d);}return _0x5afb24[_0x3e56('0x18')](_0x37904d)[_0x3e56('0x19')]();};}function respondWithResult(_0x661b04,_0x193669){_0x193669=_0x193669||0xc8;return function(_0x3bb1c9){if(_0x3bb1c9){return _0x661b04['status'](_0x193669)['json'](_0x3bb1c9);}};}function respondWithFilteredResult(_0x30f255,_0x374ffe){return function(_0x54f143){if(_0x54f143){var _0x313220=typeof _0x374ffe[_0x3e56('0x1a')]===_0x3e56('0x1b')&&typeof _0x374ffe[_0x3e56('0x1c')]===_0x3e56('0x1b');var _0x521d2d=_0x54f143[_0x3e56('0x1d')];var _0x2b2ac9=_0x313220?0x0:_0x374ffe['offset'];var _0x16c415=_0x313220?_0x54f143[_0x3e56('0x1d')]:_0x374ffe[_0x3e56('0x1a')]+_0x374ffe[_0x3e56('0x1c')];var _0x2ca121;if(_0x16c415>=_0x521d2d){_0x16c415=_0x521d2d;_0x2ca121=0xc8;}else{_0x2ca121=0xce;}_0x30f255[_0x3e56('0x18')](_0x2ca121);return _0x30f255[_0x3e56('0x1e')](_0x3e56('0x1f'),_0x2b2ac9+'-'+_0x16c415+'/'+_0x521d2d)[_0x3e56('0x20')](_0x54f143);}return null;};}function patchUpdates(_0x44081a){return function(_0x4e5b15){try{jsonpatch['apply'](_0x4e5b15,_0x44081a,!![]);}catch(_0x112c6d){return BPromise[_0x3e56('0x21')](_0x112c6d);}return _0x4e5b15[_0x3e56('0x22')]();};}function saveUpdates(_0x2ce408,_0x53e098){return function(_0x48f563){if(_0x48f563){return _0x48f563[_0x3e56('0x23')](_0x2ce408)[_0x3e56('0x24')](function(_0x5541c4){return _0x5541c4;});}return null;};}function removeEntity(_0x33de8a,_0x4b53d1){return function(_0xd0831a){if(_0xd0831a){return _0xd0831a[_0x3e56('0x25')]()[_0x3e56('0x24')](function(){_0x33de8a[_0x3e56('0x18')](0xcc)[_0x3e56('0x19')]();});}};}function handleEntityNotFound(_0x374037,_0x2546d1){return function(_0x3458a4){if(!_0x3458a4){_0x374037[_0x3e56('0x17')](0x194);}return _0x3458a4;};}function handleError(_0x585279,_0x1f0d28){_0x1f0d28=_0x1f0d28||0x1f4;return function(_0x28993b){logger['error'](_0x28993b[_0x3e56('0x26')]);if(_0x28993b[_0x3e56('0x27')]){delete _0x28993b['name'];}_0x585279[_0x3e56('0x18')](_0x1f0d28)[_0x3e56('0x28')](_0x28993b);};}exports['index']=function(_0x1b8985,_0x2f14b1){var _0x377c8c={},_0x11324c={},_0x3f5765={'count':0x0,'rows':[]};var _0x1e360a=_[_0x3e56('0x29')](db[_0x3e56('0x2a')]['rawAttributes'],function(_0x545fb7){return{'name':_0x545fb7['fieldName'],'type':_0x545fb7['type'][_0x3e56('0x2b')]};});_0x11324c[_0x3e56('0x2c')]=_[_0x3e56('0x29')](_0x1e360a,_0x3e56('0x27'));_0x11324c[_0x3e56('0x2d')]=_[_0x3e56('0x2e')](_0x1b8985[_0x3e56('0x2d')]);_0x11324c['filters']=_[_0x3e56('0x2f')](_0x11324c[_0x3e56('0x2c')],_0x11324c['query']);_0x377c8c[_0x3e56('0x30')]=_[_0x3e56('0x2f')](_0x11324c[_0x3e56('0x2c')],qs[_0x3e56('0x31')](_0x1b8985['query']['fields']));_0x377c8c[_0x3e56('0x30')]=_0x377c8c[_0x3e56('0x30')]['length']?_0x377c8c[_0x3e56('0x30')]:_0x11324c['model'];if(!_0x1b8985['query'][_0x3e56('0x32')](_0x3e56('0x33'))){_0x377c8c['limit']=qs['limit'](_0x1b8985[_0x3e56('0x2d')]['limit']);_0x377c8c['offset']=qs[_0x3e56('0x1a')](_0x1b8985[_0x3e56('0x2d')][_0x3e56('0x1a')]);}_0x377c8c['order']=qs['sort'](_0x1b8985['query'][_0x3e56('0x34')]);_0x377c8c['where']=qs[_0x3e56('0x35')](_['pick'](_0x1b8985[_0x3e56('0x2d')],_0x11324c['filters']),_0x1e360a);if(_0x1b8985[_0x3e56('0x2d')][_0x3e56('0x36')]){_0x377c8c[_0x3e56('0x37')]=_[_0x3e56('0x38')](_0x377c8c['where'],{'$or':_['map'](_0x1e360a,function(_0x1c9bf7){if(_0x1c9bf7[_0x3e56('0x39')]!==_0x3e56('0x3a')){var _0x434921={};_0x434921[_0x1c9bf7[_0x3e56('0x27')]]={'$like':'%'+_0x1b8985[_0x3e56('0x2d')]['filter']+'%'};return _0x434921;}})});}_0x377c8c=_[_0x3e56('0x38')]({},_0x377c8c,_0x1b8985[_0x3e56('0x3b')]);var _0xd6cf0f={'where':_0x377c8c[_0x3e56('0x37')]};return db['MailTransferReport'][_0x3e56('0x1d')](_0xd6cf0f)[_0x3e56('0x24')](function(_0x4dec34){_0x3f5765['count']=_0x4dec34;if(_0x1b8985[_0x3e56('0x2d')][_0x3e56('0x3c')]){_0x377c8c[_0x3e56('0x3d')]=[{'all':!![]}];}return db[_0x3e56('0x2a')][_0x3e56('0x3e')](_0x377c8c);})[_0x3e56('0x24')](function(_0x1389b5){_0x3f5765[_0x3e56('0x3f')]=_0x1389b5;return _0x3f5765;})[_0x3e56('0x24')](respondWithFilteredResult(_0x2f14b1,_0x377c8c))['catch'](handleError(_0x2f14b1,null));};exports[_0x3e56('0x40')]=function(_0x175688,_0x7316bb){var _0x433ea8={'raw':!![],'where':{'id':_0x175688[_0x3e56('0x41')]['id']}},_0x29f515={};_0x29f515['model']=_['keys'](db[_0x3e56('0x2a')][_0x3e56('0x42')]);_0x29f515[_0x3e56('0x2d')]=_[_0x3e56('0x2e')](_0x175688[_0x3e56('0x2d')]);_0x29f515['filters']=_[_0x3e56('0x2f')](_0x29f515[_0x3e56('0x2c')],_0x29f515['query']);_0x433ea8[_0x3e56('0x30')]=_[_0x3e56('0x2f')](_0x29f515[_0x3e56('0x2c')],qs[_0x3e56('0x31')](_0x175688[_0x3e56('0x2d')][_0x3e56('0x31')]));_0x433ea8[_0x3e56('0x30')]=_0x433ea8[_0x3e56('0x30')][_0x3e56('0x43')]?_0x433ea8[_0x3e56('0x30')]:_0x29f515['model'];if(_0x175688['query'][_0x3e56('0x3c')]){_0x433ea8[_0x3e56('0x3d')]=[{'all':!![]}];}_0x433ea8=_[_0x3e56('0x38')]({},_0x433ea8,_0x175688[_0x3e56('0x3b')]);return db[_0x3e56('0x2a')]['find'](_0x433ea8)['then'](handleEntityNotFound(_0x7316bb,null))[_0x3e56('0x24')](respondWithResult(_0x7316bb,null))[_0x3e56('0x44')](handleError(_0x7316bb,null));};exports[_0x3e56('0x45')]=function(_0x41ece2,_0x42ca80){return db[_0x3e56('0x2a')]['create'](_0x41ece2[_0x3e56('0x46')],{})[_0x3e56('0x24')](respondWithResult(_0x42ca80,0xc9))['catch'](handleError(_0x42ca80,null));};exports['update']=function(_0x193d70,_0x8007ab){if(_0x193d70['body']['id']){delete _0x193d70[_0x3e56('0x46')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x193d70[_0x3e56('0x41')]['id']}})[_0x3e56('0x24')](handleEntityNotFound(_0x8007ab,null))[_0x3e56('0x24')](saveUpdates(_0x193d70[_0x3e56('0x46')],null))['then'](respondWithResult(_0x8007ab,null))[_0x3e56('0x44')](handleError(_0x8007ab,null));};exports[_0x3e56('0x25')]=function(_0x5f1828,_0x210f8f){return db[_0x3e56('0x2a')]['find']({'where':{'id':_0x5f1828[_0x3e56('0x41')]['id']}})['then'](handleEntityNotFound(_0x210f8f,null))[_0x3e56('0x24')](removeEntity(_0x210f8f,null))[_0x3e56('0x44')](handleError(_0x210f8f,null));};exports['describe']=function(_0x36edd6,_0x4b2b18){return db[_0x3e56('0x2a')][_0x3e56('0x47')]()['then'](respondWithResult(_0x4b2b18,null))[_0x3e56('0x44')](handleError(_0x4b2b18,null));}; \ No newline at end of file +var _0xf6af=['json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','include','catch','params','options','create','body','update','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0xad930b,_0x158a6b){var _0x54f5c0=function(_0x2449d5){while(--_0x2449d5){_0xad930b['push'](_0xad930b['shift']());}};_0x54f5c0(++_0x158a6b);}(_0xf6af,0x14f));var _0xff6a=function(_0x18ba8d,_0x2751d8){_0x18ba8d=_0x18ba8d-0x0;var _0x54d7ba=_0xf6af[_0x18ba8d];return _0x54d7ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff6a('0x0'));var zipdir=require(_0xff6a('0x1'));var jsonpatch=require(_0xff6a('0x2'));var rp=require(_0xff6a('0x3'));var moment=require(_0xff6a('0x4'));var BPromise=require(_0xff6a('0x5'));var Mustache=require('mustache');var util=require(_0xff6a('0x6'));var path=require(_0xff6a('0x7'));var sox=require('sox');var csv=require(_0xff6a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff6a('0x9'));var _=require(_0xff6a('0xa'));var squel=require('squel');var crypto=require(_0xff6a('0xb'));var jsforce=require(_0xff6a('0xc'));var deskjs=require(_0xff6a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xff6a('0xe'));var Papa=require(_0xff6a('0xf'));var Redis=require('ioredis');var authService=require(_0xff6a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xff6a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff6a('0x12'))('api');var utils=require(_0xff6a('0x13'));var config=require(_0xff6a('0x14'));var licenseUtil=require(_0xff6a('0x15'));var db=require(_0xff6a('0x16'))['db'];function respondWithStatusCode(_0x36ecec,_0x93d34a){_0x93d34a=_0x93d34a||0xcc;return function(_0x2cbbc4){if(_0x2cbbc4){return _0x36ecec['sendStatus'](_0x93d34a);}return _0x36ecec[_0xff6a('0x17')](_0x93d34a)[_0xff6a('0x18')]();};}function respondWithResult(_0x4f7b88,_0x48c9cf){_0x48c9cf=_0x48c9cf||0xc8;return function(_0x785847){if(_0x785847){return _0x4f7b88[_0xff6a('0x17')](_0x48c9cf)[_0xff6a('0x19')](_0x785847);}};}function respondWithFilteredResult(_0x22df53,_0xe13a32){return function(_0x574c03){if(_0x574c03){var _0x5d0cd6=typeof _0xe13a32[_0xff6a('0x1a')]===_0xff6a('0x1b')&&typeof _0xe13a32[_0xff6a('0x1c')]===_0xff6a('0x1b');var _0x4d6ba7=_0x574c03[_0xff6a('0x1d')];var _0x6db829=_0x5d0cd6?0x0:_0xe13a32[_0xff6a('0x1a')];var _0x1b6c38=_0x5d0cd6?_0x574c03[_0xff6a('0x1d')]:_0xe13a32['offset']+_0xe13a32[_0xff6a('0x1c')];var _0x52aec8;if(_0x1b6c38>=_0x4d6ba7){_0x1b6c38=_0x4d6ba7;_0x52aec8=0xc8;}else{_0x52aec8=0xce;}_0x22df53[_0xff6a('0x17')](_0x52aec8);return _0x22df53['set'](_0xff6a('0x1e'),_0x6db829+'-'+_0x1b6c38+'/'+_0x4d6ba7)[_0xff6a('0x19')](_0x574c03);}return null;};}function patchUpdates(_0x18611c){return function(_0x26da97){try{jsonpatch['apply'](_0x26da97,_0x18611c,!![]);}catch(_0x2e5191){return BPromise[_0xff6a('0x1f')](_0x2e5191);}return _0x26da97[_0xff6a('0x20')]();};}function saveUpdates(_0x721bb,_0x3f23d1){return function(_0x401ea0){if(_0x401ea0){return _0x401ea0['update'](_0x721bb)[_0xff6a('0x21')](function(_0x4b3211){return _0x4b3211;});}return null;};}function removeEntity(_0x5bb663,_0xb01101){return function(_0x9b9239){if(_0x9b9239){return _0x9b9239[_0xff6a('0x22')]()[_0xff6a('0x21')](function(){_0x5bb663[_0xff6a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20ea20,_0x56eb9a){return function(_0x42cecb){if(!_0x42cecb){_0x20ea20[_0xff6a('0x23')](0x194);}return _0x42cecb;};}function handleError(_0x9b13e7,_0x7d6867){_0x7d6867=_0x7d6867||0x1f4;return function(_0x3855df){logger[_0xff6a('0x24')](_0x3855df[_0xff6a('0x25')]);if(_0x3855df[_0xff6a('0x26')]){delete _0x3855df[_0xff6a('0x26')];}_0x9b13e7[_0xff6a('0x17')](_0x7d6867)[_0xff6a('0x27')](_0x3855df);};}exports[_0xff6a('0x28')]=function(_0x1f0fb5,_0x1e0057){var _0x70a257={},_0x26731f={},_0x55375d={'count':0x0,'rows':[]};var _0x284ec0=_[_0xff6a('0x29')](db[_0xff6a('0x2a')][_0xff6a('0x2b')],function(_0x1ec35e){return{'name':_0x1ec35e[_0xff6a('0x2c')],'type':_0x1ec35e['type'][_0xff6a('0x2d')]};});_0x26731f[_0xff6a('0x2e')]=_[_0xff6a('0x29')](_0x284ec0,_0xff6a('0x26'));_0x26731f[_0xff6a('0x2f')]=_[_0xff6a('0x30')](_0x1f0fb5[_0xff6a('0x2f')]);_0x26731f[_0xff6a('0x31')]=_[_0xff6a('0x32')](_0x26731f[_0xff6a('0x2e')],_0x26731f[_0xff6a('0x2f')]);_0x70a257[_0xff6a('0x33')]=_[_0xff6a('0x32')](_0x26731f[_0xff6a('0x2e')],qs[_0xff6a('0x34')](_0x1f0fb5['query'][_0xff6a('0x34')]));_0x70a257[_0xff6a('0x33')]=_0x70a257[_0xff6a('0x33')][_0xff6a('0x35')]?_0x70a257[_0xff6a('0x33')]:_0x26731f[_0xff6a('0x2e')];if(!_0x1f0fb5['query'][_0xff6a('0x36')]('nolimit')){_0x70a257['limit']=qs['limit'](_0x1f0fb5[_0xff6a('0x2f')][_0xff6a('0x1c')]);_0x70a257['offset']=qs[_0xff6a('0x1a')](_0x1f0fb5['query'][_0xff6a('0x1a')]);}_0x70a257[_0xff6a('0x37')]=qs['sort'](_0x1f0fb5['query'][_0xff6a('0x38')]);_0x70a257[_0xff6a('0x39')]=qs[_0xff6a('0x31')](_[_0xff6a('0x3a')](_0x1f0fb5[_0xff6a('0x2f')],_0x26731f[_0xff6a('0x31')]),_0x284ec0);if(_0x1f0fb5[_0xff6a('0x2f')][_0xff6a('0x3b')]){_0x70a257[_0xff6a('0x39')]=_[_0xff6a('0x3c')](_0x70a257[_0xff6a('0x39')],{'$or':_[_0xff6a('0x29')](_0x284ec0,function(_0x24fe92){if(_0x24fe92[_0xff6a('0x3d')]!=='VIRTUAL'){var _0x180e16={};_0x180e16[_0x24fe92[_0xff6a('0x26')]]={'$like':'%'+_0x1f0fb5['query'][_0xff6a('0x3b')]+'%'};return _0x180e16;}})});}_0x70a257=_[_0xff6a('0x3c')]({},_0x70a257,_0x1f0fb5['options']);var _0x1c7ee2={'where':_0x70a257[_0xff6a('0x39')]};return db[_0xff6a('0x2a')][_0xff6a('0x1d')](_0x1c7ee2)[_0xff6a('0x21')](function(_0x55dfa2){_0x55375d['count']=_0x55dfa2;if(_0x1f0fb5[_0xff6a('0x2f')][_0xff6a('0x3e')]){_0x70a257[_0xff6a('0x3f')]=[{'all':!![]}];}return db[_0xff6a('0x2a')]['findAll'](_0x70a257);})[_0xff6a('0x21')](function(_0x4aad0d){_0x55375d['rows']=_0x4aad0d;return _0x55375d;})['then'](respondWithFilteredResult(_0x1e0057,_0x70a257))[_0xff6a('0x40')](handleError(_0x1e0057,null));};exports['show']=function(_0x53c01e,_0x5c56cd){var _0x50a310={'raw':!![],'where':{'id':_0x53c01e[_0xff6a('0x41')]['id']}},_0x39c783={};_0x39c783[_0xff6a('0x2e')]=_[_0xff6a('0x30')](db[_0xff6a('0x2a')][_0xff6a('0x2b')]);_0x39c783[_0xff6a('0x2f')]=_[_0xff6a('0x30')](_0x53c01e['query']);_0x39c783[_0xff6a('0x31')]=_['intersection'](_0x39c783['model'],_0x39c783[_0xff6a('0x2f')]);_0x50a310[_0xff6a('0x33')]=_[_0xff6a('0x32')](_0x39c783[_0xff6a('0x2e')],qs['fields'](_0x53c01e['query'][_0xff6a('0x34')]));_0x50a310[_0xff6a('0x33')]=_0x50a310['attributes'][_0xff6a('0x35')]?_0x50a310[_0xff6a('0x33')]:_0x39c783[_0xff6a('0x2e')];if(_0x53c01e['query']['includeAll']){_0x50a310[_0xff6a('0x3f')]=[{'all':!![]}];}_0x50a310=_[_0xff6a('0x3c')]({},_0x50a310,_0x53c01e[_0xff6a('0x42')]);return db[_0xff6a('0x2a')]['find'](_0x50a310)['then'](handleEntityNotFound(_0x5c56cd,null))['then'](respondWithResult(_0x5c56cd,null))[_0xff6a('0x40')](handleError(_0x5c56cd,null));};exports[_0xff6a('0x43')]=function(_0x53dc54,_0x5138ee){return db['MailTransferReport'][_0xff6a('0x43')](_0x53dc54[_0xff6a('0x44')],{})[_0xff6a('0x21')](respondWithResult(_0x5138ee,0xc9))['catch'](handleError(_0x5138ee,null));};exports[_0xff6a('0x45')]=function(_0x508254,_0x7ebbf8){if(_0x508254[_0xff6a('0x44')]['id']){delete _0x508254[_0xff6a('0x44')]['id'];}return db[_0xff6a('0x2a')][_0xff6a('0x46')]({'where':{'id':_0x508254[_0xff6a('0x41')]['id']}})[_0xff6a('0x21')](handleEntityNotFound(_0x7ebbf8,null))['then'](saveUpdates(_0x508254[_0xff6a('0x44')],null))[_0xff6a('0x21')](respondWithResult(_0x7ebbf8,null))[_0xff6a('0x40')](handleError(_0x7ebbf8,null));};exports[_0xff6a('0x22')]=function(_0xf529e2,_0x13cdef){return db[_0xff6a('0x2a')]['find']({'where':{'id':_0xf529e2[_0xff6a('0x41')]['id']}})[_0xff6a('0x21')](handleEntityNotFound(_0x13cdef,null))[_0xff6a('0x21')](removeEntity(_0x13cdef,null))[_0xff6a('0x40')](handleError(_0x13cdef,null));};exports[_0xff6a('0x47')]=function(_0xb072b4,_0x2cb4e6){return db[_0xff6a('0x2a')][_0xff6a('0x47')]()[_0xff6a('0x21')](respondWithResult(_0x2cb4e6,null))[_0xff6a('0x40')](handleError(_0x2cb4e6,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index fa883f0..d2dfec9 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 _0x131a=['exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x35b398,_0x381825){var _0xbfcb07=function(_0x77ad0c){while(--_0x77ad0c){_0x35b398['push'](_0x35b398['shift']());}};_0xbfcb07(++_0x381825);}(_0x131a,0x18b));var _0xa131=function(_0x450129,_0x3eef70){_0x450129=_0x450129-0x0;var _0x5dcd1c=_0x131a[_0x450129];return _0x5dcd1c;};'use strict';var _=require(_0xa131('0x0'));var util=require(_0xa131('0x1'));var logger=require(_0xa131('0x2'))(_0xa131('0x3'));var moment=require(_0xa131('0x4'));var BPromise=require('bluebird');var rp=require(_0xa131('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa131('0x6'));var config=require(_0xa131('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xa131('0x8')]=function(_0xdb263c,_0x1a51cf){return _0xdb263c[_0xa131('0x9')](_0xa131('0xa'),attributes,{'tableName':_0xa131('0xb'),'paranoid':![],'indexes':[{'name':_0xa131('0xc'),'fields':[_0xa131('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1e9d=['define','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x30c9b5,_0x2ffc2a){var _0x17950a=function(_0x494c90){while(--_0x494c90){_0x30c9b5['push'](_0x30c9b5['shift']());}};_0x17950a(++_0x2ffc2a);}(_0x1e9d,0x1dd));var _0xd1e9=function(_0x465a13,_0x135ac7){_0x465a13=_0x465a13-0x0;var _0x3ed0b2=_0x1e9d[_0x465a13];return _0x3ed0b2;};'use strict';var _=require(_0xd1e9('0x0'));var util=require('util');var logger=require(_0xd1e9('0x1'))(_0xd1e9('0x2'));var moment=require(_0xd1e9('0x3'));var BPromise=require(_0xd1e9('0x4'));var rp=require(_0xd1e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1e9('0x6'));var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x51f201,_0x47fa6c){return _0x51f201[_0xd1e9('0x7')](_0xd1e9('0x8'),attributes,{'tableName':_0xd1e9('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd1e9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 7099be5..948a6bf 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 _0x41f5=['MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','MailTransferReport,\x20%s,\x20%s','debug'];(function(_0xac6fdf,_0x315296){var _0x56d02f=function(_0x4e58c3){while(--_0x4e58c3){_0xac6fdf['push'](_0xac6fdf['shift']());}};_0x56d02f(++_0x315296);}(_0x41f5,0xa2));var _0x541f=function(_0x3fa1e1,_0x4e39f0){_0x3fa1e1=_0x3fa1e1-0x0;var _0x1cc2ad=_0x41f5[_0x3fa1e1];return _0x1cc2ad;};'use strict';var _=require(_0x541f('0x0'));var util=require(_0x541f('0x1'));var moment=require('moment');var BPromise=require(_0x541f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x541f('0x3'));var db=require(_0x541f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x541f('0x5'))(_0x541f('0x6'));var config=require(_0x541f('0x7'));var jayson=require(_0x541f('0x8'));var client=jayson['client'][_0x541f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13a62b,_0x10b315,_0x5d2a05){return new BPromise(function(_0x33f537,_0x25be8b){return client['request'](_0x13a62b,_0x5d2a05)[_0x541f('0xa')](function(_0x267fa4){logger[_0x541f('0xb')](_0x541f('0xc'),_0x10b315,'request\x20sent');logger[_0x541f('0xd')](_0x541f('0xe'),_0x10b315,_0x541f('0xf'),JSON[_0x541f('0x10')](_0x267fa4));if(_0x267fa4['error']){if(_0x267fa4[_0x541f('0x11')][_0x541f('0x12')]===0x1f4){logger['error'](_0x541f('0xc'),_0x10b315,_0x267fa4[_0x541f('0x11')][_0x541f('0x13')]);return _0x25be8b(_0x267fa4[_0x541f('0x11')][_0x541f('0x13')]);}logger[_0x541f('0x11')](_0x541f('0xc'),_0x10b315,_0x267fa4[_0x541f('0x11')]['message']);return _0x33f537(_0x267fa4['error'][_0x541f('0x13')]);}else{logger[_0x541f('0xb')](_0x541f('0xc'),_0x10b315,_0x541f('0xf'));_0x33f537(_0x267fa4[_0x541f('0x14')][_0x541f('0x13')]);}})[_0x541f('0x15')](function(_0x424f64){logger[_0x541f('0x11')](_0x541f('0xc'),_0x10b315,_0x424f64);_0x25be8b(_0x424f64);});});} \ No newline at end of file +var _0x0f88=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0f88,0x110));var _0x80f8=function(_0x558fe9,_0x1ca3f7){_0x558fe9=_0x558fe9-0x0;var _0x554d2a=_0x0f88[_0x558fe9];return _0x554d2a;};'use strict';var _=require('lodash');var util=require(_0x80f8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x80f8('0x1'));var fs=require('fs');var Redis=require(_0x80f8('0x2'));var db=require(_0x80f8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x80f8('0x4'))(_0x80f8('0x5'));var config=require(_0x80f8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x80f8('0x7')][_0x80f8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3fe582,_0xee1a5c,_0x7fa8e6){return new BPromise(function(_0x54caf6,_0x55779d){return client['request'](_0x3fe582,_0x7fa8e6)[_0x80f8('0x9')](function(_0xd7317e){logger[_0x80f8('0xa')](_0x80f8('0xb'),_0xee1a5c,_0x80f8('0xc'));logger[_0x80f8('0xd')](_0x80f8('0xe'),_0xee1a5c,'request\x20sent',JSON[_0x80f8('0xf')](_0xd7317e));if(_0xd7317e[_0x80f8('0x10')]){if(_0xd7317e[_0x80f8('0x10')][_0x80f8('0x11')]===0x1f4){logger[_0x80f8('0x10')]('MailTransferReport,\x20%s,\x20%s',_0xee1a5c,_0xd7317e[_0x80f8('0x10')][_0x80f8('0x12')]);return _0x55779d(_0xd7317e[_0x80f8('0x10')][_0x80f8('0x12')]);}logger[_0x80f8('0x10')](_0x80f8('0xb'),_0xee1a5c,_0xd7317e[_0x80f8('0x10')][_0x80f8('0x12')]);return _0x54caf6(_0xd7317e[_0x80f8('0x10')][_0x80f8('0x12')]);}else{logger[_0x80f8('0xa')]('MailTransferReport,\x20%s,\x20%s',_0xee1a5c,_0x80f8('0xc'));_0x54caf6(_0xd7317e[_0x80f8('0x13')][_0x80f8('0x12')]);}})[_0x80f8('0x14')](function(_0x257b8f){logger[_0x80f8('0x10')](_0x80f8('0xb'),_0xee1a5c,_0x257b8f);_0x55779d(_0x257b8f);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a70c7c5..e8b9845 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 _0x0c70=['index','describe','/:id','show','post','update','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x5239f6,_0x3bc30a){var _0xb66a8b=function(_0x3573ac){while(--_0x3573ac){_0x5239f6['push'](_0x5239f6['shift']());}};_0xb66a8b(++_0x3bc30a);}(_0x0c70,0xc9));var _0x00c7=function(_0x3f2c1c,_0x4f182b){_0x3f2c1c=_0x3f2c1c-0x0;var _0x391934=_0x0c70[_0x3f2c1c];return _0x391934;};'use strict';var multer=require(_0x00c7('0x0'));var util=require(_0x00c7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x00c7('0x2'));var auth=require(_0x00c7('0x3'));var interaction=require(_0x00c7('0x4'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x00c7('0x5')]('/',auth[_0x00c7('0x6')](),controller[_0x00c7('0x7')]);router[_0x00c7('0x5')]('/describe',auth['isAuthenticated'](),controller[_0x00c7('0x8')]);router[_0x00c7('0x5')](_0x00c7('0x9'),auth[_0x00c7('0x6')](),controller[_0x00c7('0xa')]);router[_0x00c7('0xb')]('/',auth[_0x00c7('0x6')](),controller['create']);router['put'](_0x00c7('0x9'),auth[_0x00c7('0x6')](),controller[_0x00c7('0xc')]);router[_0x00c7('0xd')](_0x00c7('0x9'),auth[_0x00c7('0x6')](),controller[_0x00c7('0xe')]);module[_0x00c7('0xf')]=router; \ No newline at end of file +var _0x4edd=['show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','index','get','/describe','isAuthenticated','describe'];(function(_0x27721f,_0x195f6d){var _0x4402a2=function(_0x12ff14){while(--_0x12ff14){_0x27721f['push'](_0x27721f['shift']());}};_0x4402a2(++_0x195f6d);}(_0x4edd,0x133));var _0xd4ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4edd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd4ed('0x0'));var util=require(_0xd4ed('0x1'));var path=require(_0xd4ed('0x2'));var timeout=require(_0xd4ed('0x3'));var express=require(_0xd4ed('0x4'));var router=express[_0xd4ed('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd4ed('0x6'));var interaction=require(_0xd4ed('0x7'));var config=require(_0xd4ed('0x8'));var controller=require(_0xd4ed('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xd4ed('0xa')]);router[_0xd4ed('0xb')](_0xd4ed('0xc'),auth[_0xd4ed('0xd')](),controller[_0xd4ed('0xe')]);router[_0xd4ed('0xb')]('/:id',auth[_0xd4ed('0xd')](),controller[_0xd4ed('0xf')]);router[_0xd4ed('0x10')]('/',auth[_0xd4ed('0xd')](),controller[_0xd4ed('0x11')]);router[_0xd4ed('0x12')](_0xd4ed('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xd4ed('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xd4ed('0x15')]);module[_0xd4ed('0x16')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 645af7b..66bc02b 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 _0xd19f=['setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','seconds'];(function(_0x392e52,_0x41196e){var _0x38ff9d=function(_0xd34be3){while(--_0xd34be3){_0x392e52['push'](_0x392e52['shift']());}};_0x38ff9d(++_0x41196e);}(_0xd19f,0x1e7));var _0xfd19=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xd19f[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require(_0xfd19('0x0'));var moment=require(_0xfd19('0x1'));module['exports']={'channel':{'type':Sequelize[_0xfd19('0x2')]},'membername':{'type':Sequelize[_0xfd19('0x2')]},'interface':{'type':Sequelize[_0xfd19('0x2')]},'type':{'type':Sequelize[_0xfd19('0x2')],'defaultValue':_0xfd19('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xfd19('0x4')]},'exitAt':{'type':Sequelize[_0xfd19('0x4')],'set':function(_0x237db7){var _0x411c73=moment(_0x237db7);var _0x1da879=moment(this[_0xfd19('0x5')]('enterAt'));var _0x4f8e85=_0x411c73['diff'](_0x1da879,_0xfd19('0x6'));this[_0xfd19('0x7')]('exitAt',_0x237db7);this[_0xfd19('0x7')](_0xfd19('0x8'),_0x4f8e85>=0x0?_0x4f8e85:null);}},'data1':{'type':Sequelize[_0xfd19('0x2')],'comment':_0xfd19('0x9')},'data2':{'type':Sequelize[_0xfd19('0x2')],'comment':_0xfd19('0xa')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xfd19('0x2')],'comment':_0xfd19('0xb')},'data5':{'type':Sequelize[_0xfd19('0x2')],'comment':_0xfd19('0xc')},'role':{'type':Sequelize[_0xfd19('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xfd19('0x2')]}}; \ No newline at end of file +var _0xc381=['exports','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','sequelize','moment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc381,0x1b1));var _0x1c38=function(_0x5e8e07,_0x1bdb05){_0x5e8e07=_0x5e8e07-0x0;var _0x1cb723=_0xc381[_0x5e8e07];return _0x1cb723;};'use strict';var Sequelize=require(_0x1c38('0x0'));var moment=require(_0x1c38('0x1'));module[_0x1c38('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1c38('0x3')]},'interface':{'type':Sequelize[_0x1c38('0x3')]},'type':{'type':Sequelize[_0x1c38('0x3')],'defaultValue':_0x1c38('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x1c38('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x21de1a){var _0x3d3c83=moment(_0x21de1a);var _0x2f5f11=moment(this[_0x1c38('0x6')](_0x1c38('0x7')));var _0x3d3f7a=_0x3d3c83[_0x1c38('0x8')](_0x2f5f11,_0x1c38('0x9'));this[_0x1c38('0xa')]('exitAt',_0x21de1a);this[_0x1c38('0xa')](_0x1c38('0xb'),_0x3d3f7a>=0x0?_0x3d3f7a:null);}},'data1':{'type':Sequelize[_0x1c38('0x3')],'comment':_0x1c38('0xc')},'data2':{'type':Sequelize[_0x1c38('0x3')],'comment':_0x1c38('0xd')},'data3':{'type':Sequelize[_0x1c38('0x3')],'comment':_0x1c38('0xe')},'data4':{'type':Sequelize[_0x1c38('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x1c38('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x1c38('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 1a613ca..e8c53bd 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 _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x580308,_0x569772){var _0x1e20dc=function(_0x1d7030){while(--_0x1d7030){_0x580308['push'](_0x580308['shift']());}};_0x1e20dc(++_0x569772);}(_0x008c,0x188));var _0xc008=function(_0x593683,_0x2b3213){_0x593683=_0x593683-0x0;var _0x44cc39=_0x008c[_0x593683];return _0x44cc39;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file +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(_0x166217,_0x89a7c0){var _0x43b45b=function(_0x3e1591){while(--_0x3e1591){_0x166217['push'](_0x166217['shift']());}};_0x43b45b(++_0x89a7c0);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 4af2ecb..09848c0 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 _0x0bb1=['moment','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','util'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0x0bb1,0x1cd));var _0x10bb=function(_0x23cc76,_0x9c756b){_0x23cc76=_0x23cc76-0x0;var _0x2f5c13=_0x0bb1[_0x23cc76];return _0x2f5c13;};'use strict';var _=require('lodash');var util=require(_0x10bb('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x10bb('0x1'));var BPromise=require(_0x10bb('0x2'));var rp=require(_0x10bb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x10bb('0x4'));var config=require(_0x10bb('0x5'));var attributes=require(_0x10bb('0x6'));module[_0x10bb('0x7')]=function(_0x6e2843,_0x2b6938){return _0x6e2843[_0x10bb('0x8')](_0x10bb('0x9'),attributes,{'tableName':_0x10bb('0xa'),'paranoid':![],'indexes':[{'name':_0x10bb('0xb'),'fields':[_0x10bb('0xc'),_0x10bb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2240=['interface','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','MemberReport','report_member','membername_interface','membername'];(function(_0x618644,_0x24242b){var _0x401623=function(_0x58dcce){while(--_0x58dcce){_0x618644['push'](_0x618644['shift']());}};_0x401623(++_0x24242b);}(_0x2240,0x13c));var _0x0224=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x2240[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x0224('0x0'));var util=require(_0x0224('0x1'));var logger=require('../../config/logger')(_0x0224('0x2'));var moment=require(_0x0224('0x3'));var BPromise=require(_0x0224('0x4'));var rp=require(_0x0224('0x5'));var fs=require('fs');var path=require(_0x0224('0x6'));var rimraf=require(_0x0224('0x7'));var config=require(_0x0224('0x8'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x3517b2,_0x3df8fc){return _0x3517b2[_0x0224('0x9')](_0x0224('0xa'),attributes,{'tableName':_0x0224('0xb'),'paranoid':![],'indexes':[{'name':_0x0224('0xc'),'fields':[_0x0224('0xd'),_0x0224('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index b728a9a..0641178 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 _0x82f8=['rpc','../../config/environment','jayson/promise','request','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','GetMemberReport','options','raw','where','attributes','limit','include','model','map','then','debug','CreateMemberReport','MemberReport','body','update','UpdateMemberReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x39ccf9,_0x637d5a){var _0xd8ca25=function(_0x3a6a34){while(--_0x3a6a34){_0x39ccf9['push'](_0x39ccf9['shift']());}};_0xd8ca25(++_0x637d5a);}(_0x82f8,0x157));var _0x882f=function(_0x4702b5,_0x154048){_0x4702b5=_0x4702b5-0x0;var _0x3b9bdd=_0x82f8[_0x4702b5];return _0x3b9bdd;};'use strict';var _=require('lodash');var util=require(_0x882f('0x0'));var moment=require(_0x882f('0x1'));var BPromise=require('bluebird');var rs=require(_0x882f('0x2'));var fs=require('fs');var Redis=require(_0x882f('0x3'));var db=require(_0x882f('0x4'))['db'];var utils=require(_0x882f('0x5'));var logger=require(_0x882f('0x6'))(_0x882f('0x7'));var config=require(_0x882f('0x8'));var jayson=require(_0x882f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c414d,_0x2c7ade,_0x3efa94){return new BPromise(function(_0x2e6f92,_0x4f9dd6){return client[_0x882f('0xa')](_0x3c414d,_0x3efa94)['then'](function(_0x29c3e8){logger['info'](_0x882f('0xb'),_0x2c7ade,'request\x20sent');logger['debug'](_0x882f('0xc'),_0x2c7ade,_0x882f('0xd'),JSON[_0x882f('0xe')](_0x29c3e8));if(_0x29c3e8[_0x882f('0xf')]){if(_0x29c3e8[_0x882f('0xf')]['code']===0x1f4){logger['error'](_0x882f('0xb'),_0x2c7ade,_0x29c3e8[_0x882f('0xf')][_0x882f('0x10')]);return _0x4f9dd6(_0x29c3e8[_0x882f('0xf')][_0x882f('0x10')]);}logger[_0x882f('0xf')](_0x882f('0xb'),_0x2c7ade,_0x29c3e8['error'][_0x882f('0x10')]);return _0x2e6f92(_0x29c3e8[_0x882f('0xf')][_0x882f('0x10')]);}else{logger[_0x882f('0x11')]('MemberReport,\x20%s,\x20%s',_0x2c7ade,'request\x20sent');_0x2e6f92(_0x29c3e8['result'][_0x882f('0x10')]);}})[_0x882f('0x12')](function(_0x3357ef){logger[_0x882f('0xf')](_0x882f('0xb'),_0x2c7ade,_0x3357ef);_0x4f9dd6(_0x3357ef);});});}exports[_0x882f('0x13')]=function(_0x3bd47c){var _0x67cc4b=this;return new Promise(function(_0x544fd5,_0x3e4847){return db['MemberReport']['findAll']({'raw':_0x3bd47c[_0x882f('0x14')]?_0x3bd47c[_0x882f('0x14')][_0x882f('0x15')]===undefined?!![]:![]:!![],'where':_0x3bd47c[_0x882f('0x14')]?_0x3bd47c['options'][_0x882f('0x16')]||null:null,'attributes':_0x3bd47c[_0x882f('0x14')]?_0x3bd47c[_0x882f('0x14')][_0x882f('0x17')]||null:null,'limit':_0x3bd47c[_0x882f('0x14')]?_0x3bd47c[_0x882f('0x14')][_0x882f('0x18')]||null:null,'include':_0x3bd47c[_0x882f('0x14')]?_0x3bd47c[_0x882f('0x14')]['include']?_['map'](_0x3bd47c['options'][_0x882f('0x19')],function(_0x2c44e5){return{'model':db[_0x2c44e5[_0x882f('0x1a')]],'as':_0x2c44e5['as'],'attributes':_0x2c44e5[_0x882f('0x17')],'include':_0x2c44e5[_0x882f('0x19')]?_[_0x882f('0x1b')](_0x2c44e5[_0x882f('0x19')],function(_0x2d6f58){return{'model':db[_0x2d6f58[_0x882f('0x1a')]],'as':_0x2d6f58['as'],'attributes':_0x2d6f58['attributes'],'include':_0x2d6f58[_0x882f('0x19')]?_[_0x882f('0x1b')](_0x2d6f58['include'],function(_0x48c52b){return{'model':db[_0x48c52b[_0x882f('0x1a')]],'as':_0x48c52b['as'],'attributes':_0x48c52b[_0x882f('0x17')]};}):[]};}):[]};}):[]:[]})[_0x882f('0x1c')](function(_0x4cf987){logger[_0x882f('0x11')](_0x882f('0x13'),_0x3bd47c);logger[_0x882f('0x1d')](_0x882f('0x13'),_0x3bd47c,JSON['stringify'](_0x4cf987));_0x544fd5(_0x4cf987);})[_0x882f('0x12')](function(_0x31d0b7){logger[_0x882f('0xf')](_0x882f('0x13'),_0x31d0b7[_0x882f('0x10')],_0x3bd47c);_0x3e4847(_0x67cc4b[_0x882f('0xf')](0x1f4,_0x31d0b7[_0x882f('0x10')]));});});};exports[_0x882f('0x1e')]=function(_0x299f62){var _0x46cb78=this;return new Promise(function(_0x97706f,_0x292532){return db[_0x882f('0x1f')]['create'](_0x299f62[_0x882f('0x20')],{'raw':_0x299f62['options']?_0x299f62[_0x882f('0x14')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x20aa1c){logger[_0x882f('0x11')]('CreateMemberReport',_0x299f62);logger[_0x882f('0x1d')](_0x882f('0x1e'),_0x299f62,JSON[_0x882f('0xe')](_0x20aa1c));_0x97706f(_0x20aa1c);})[_0x882f('0x12')](function(_0x4910ab){logger[_0x882f('0xf')]('CreateMemberReport',_0x4910ab['message'],_0x299f62);_0x292532(_0x46cb78['error'](0x1f4,_0x4910ab[_0x882f('0x10')]));});});};exports['UpdateMemberReport']=function(_0x2080ac){var _0x8ce14b=this;return new Promise(function(_0x496804,_0x5de26e){return db[_0x882f('0x1f')][_0x882f('0x21')](_0x2080ac['body'],{'raw':_0x2080ac[_0x882f('0x14')]?_0x2080ac[_0x882f('0x14')][_0x882f('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2080ac[_0x882f('0x14')]?_0x2080ac[_0x882f('0x14')]['where']||null:null,'attributes':_0x2080ac[_0x882f('0x14')]?_0x2080ac[_0x882f('0x14')][_0x882f('0x17')]||null:null,'limit':_0x2080ac[_0x882f('0x14')]?_0x2080ac[_0x882f('0x14')][_0x882f('0x18')]||null:null})[_0x882f('0x1c')](function(_0x328582){logger['info'](_0x882f('0x22'),_0x2080ac);logger[_0x882f('0x1d')](_0x882f('0x22'),_0x2080ac,JSON[_0x882f('0xe')](_0x328582));_0x496804(_0x328582);})[_0x882f('0x12')](function(_0x40a82f){logger[_0x882f('0xf')](_0x882f('0x22'),_0x40a82f['message'],_0x2080ac);_0x5de26e(_0x8ce14b[_0x882f('0xf')](0x1f4,_0x40a82f[_0x882f('0x10')]));});});}; \ No newline at end of file +var _0xc7b3=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','CreateMemberReport','create','body','stringify','UpdateMemberReport','lodash','util'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc7b3[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x3c7b('0x0'));var util=require(_0x3c7b('0x1'));var moment=require('moment');var BPromise=require(_0x3c7b('0x2'));var rs=require(_0x3c7b('0x3'));var fs=require('fs');var Redis=require(_0x3c7b('0x4'));var db=require(_0x3c7b('0x5'))['db'];var utils=require(_0x3c7b('0x6'));var logger=require(_0x3c7b('0x7'))('rpc');var config=require(_0x3c7b('0x8'));var jayson=require(_0x3c7b('0x9'));var client=jayson[_0x3c7b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x314af1,_0x3f06ac,_0x536df8){return new BPromise(function(_0x2777d9,_0x3990fe){return client['request'](_0x314af1,_0x536df8)[_0x3c7b('0xb')](function(_0x16968c){logger[_0x3c7b('0xc')]('MemberReport,\x20%s,\x20%s',_0x3f06ac,_0x3c7b('0xd'));logger['debug'](_0x3c7b('0xe'),_0x3f06ac,_0x3c7b('0xd'),JSON['stringify'](_0x16968c));if(_0x16968c[_0x3c7b('0xf')]){if(_0x16968c[_0x3c7b('0xf')][_0x3c7b('0x10')]===0x1f4){logger[_0x3c7b('0xf')](_0x3c7b('0x11'),_0x3f06ac,_0x16968c[_0x3c7b('0xf')]['message']);return _0x3990fe(_0x16968c[_0x3c7b('0xf')]['message']);}logger[_0x3c7b('0xf')](_0x3c7b('0x11'),_0x3f06ac,_0x16968c[_0x3c7b('0xf')][_0x3c7b('0x12')]);return _0x2777d9(_0x16968c[_0x3c7b('0xf')][_0x3c7b('0x12')]);}else{logger[_0x3c7b('0xc')](_0x3c7b('0x11'),_0x3f06ac,_0x3c7b('0xd'));_0x2777d9(_0x16968c[_0x3c7b('0x13')][_0x3c7b('0x12')]);}})[_0x3c7b('0x14')](function(_0x4ce512){logger[_0x3c7b('0xf')](_0x3c7b('0x11'),_0x3f06ac,_0x4ce512);_0x3990fe(_0x4ce512);});});}exports[_0x3c7b('0x15')]=function(_0x457c09){var _0x25b465=this;return new Promise(function(_0x38a9f6,_0x674c2c){return db[_0x3c7b('0x16')][_0x3c7b('0x17')]({'raw':_0x457c09[_0x3c7b('0x18')]?_0x457c09[_0x3c7b('0x18')][_0x3c7b('0x19')]===undefined?!![]:![]:!![],'where':_0x457c09[_0x3c7b('0x18')]?_0x457c09[_0x3c7b('0x18')][_0x3c7b('0x1a')]||null:null,'attributes':_0x457c09[_0x3c7b('0x18')]?_0x457c09[_0x3c7b('0x18')][_0x3c7b('0x1b')]||null:null,'limit':_0x457c09['options']?_0x457c09[_0x3c7b('0x18')][_0x3c7b('0x1c')]||null:null,'include':_0x457c09[_0x3c7b('0x18')]?_0x457c09[_0x3c7b('0x18')][_0x3c7b('0x1d')]?_[_0x3c7b('0x1e')](_0x457c09[_0x3c7b('0x18')][_0x3c7b('0x1d')],function(_0x39575b){return{'model':db[_0x39575b[_0x3c7b('0x1f')]],'as':_0x39575b['as'],'attributes':_0x39575b[_0x3c7b('0x1b')],'include':_0x39575b[_0x3c7b('0x1d')]?_[_0x3c7b('0x1e')](_0x39575b[_0x3c7b('0x1d')],function(_0x47f23c){return{'model':db[_0x47f23c['model']],'as':_0x47f23c['as'],'attributes':_0x47f23c[_0x3c7b('0x1b')],'include':_0x47f23c[_0x3c7b('0x1d')]?_['map'](_0x47f23c[_0x3c7b('0x1d')],function(_0x181097){return{'model':db[_0x181097[_0x3c7b('0x1f')]],'as':_0x181097['as'],'attributes':_0x181097[_0x3c7b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3c7b('0xb')](function(_0x423ed2){logger[_0x3c7b('0xc')](_0x3c7b('0x15'),_0x457c09);logger[_0x3c7b('0x20')]('GetMemberReport',_0x457c09,JSON['stringify'](_0x423ed2));_0x38a9f6(_0x423ed2);})[_0x3c7b('0x14')](function(_0x1162e1){logger[_0x3c7b('0xf')](_0x3c7b('0x15'),_0x1162e1[_0x3c7b('0x12')],_0x457c09);_0x674c2c(_0x25b465[_0x3c7b('0xf')](0x1f4,_0x1162e1[_0x3c7b('0x12')]));});});};exports[_0x3c7b('0x21')]=function(_0x530012){var _0x46db9c=this;return new Promise(function(_0xb390b1,_0x10751a){return db['MemberReport'][_0x3c7b('0x22')](_0x530012[_0x3c7b('0x23')],{'raw':_0x530012[_0x3c7b('0x18')]?_0x530012['options'][_0x3c7b('0x19')]===undefined?!![]:![]:!![]})[_0x3c7b('0xb')](function(_0x27021d){logger['info'](_0x3c7b('0x21'),_0x530012);logger[_0x3c7b('0x20')]('CreateMemberReport',_0x530012,JSON[_0x3c7b('0x24')](_0x27021d));_0xb390b1(_0x27021d);})[_0x3c7b('0x14')](function(_0x26b982){logger['error'](_0x3c7b('0x21'),_0x26b982[_0x3c7b('0x12')],_0x530012);_0x10751a(_0x46db9c['error'](0x1f4,_0x26b982['message']));});});};exports[_0x3c7b('0x25')]=function(_0x1a35b5){var _0x57c4cc=this;return new Promise(function(_0x1126c7,_0x13ddc6){return db[_0x3c7b('0x16')]['update'](_0x1a35b5[_0x3c7b('0x23')],{'raw':_0x1a35b5[_0x3c7b('0x18')]?_0x1a35b5[_0x3c7b('0x18')][_0x3c7b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a35b5[_0x3c7b('0x18')]?_0x1a35b5[_0x3c7b('0x18')][_0x3c7b('0x1a')]||null:null,'attributes':_0x1a35b5[_0x3c7b('0x18')]?_0x1a35b5[_0x3c7b('0x18')][_0x3c7b('0x1b')]||null:null,'limit':_0x1a35b5[_0x3c7b('0x18')]?_0x1a35b5['options'][_0x3c7b('0x1c')]||null:null})[_0x3c7b('0xb')](function(_0x269a6d){logger[_0x3c7b('0xc')]('UpdateMemberReport',_0x1a35b5);logger['debug'](_0x3c7b('0x25'),_0x1a35b5,JSON[_0x3c7b('0x24')](_0x269a6d));_0x1126c7(_0x269a6d);})[_0x3c7b('0x14')](function(_0xe92ac4){logger[_0x3c7b('0xf')](_0x3c7b('0x25'),_0xe92ac4[_0x3c7b('0x12')],_0x1a35b5);_0x13ddc6(_0x57c4cc[_0x3c7b('0xf')](0x1f4,_0xe92ac4[_0x3c7b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 3003517..54b0a49 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 _0x01e8=['get','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./migration.controller'];(function(_0x846a6b,_0x238622){var _0x29d50c=function(_0x348bba){while(--_0x348bba){_0x846a6b['push'](_0x846a6b['shift']());}};_0x29d50c(++_0x238622);}(_0x01e8,0x6e));var _0x801e=function(_0x4fc212,_0x1087aa){_0x4fc212=_0x4fc212-0x0;var _0x252317=_0x01e8[_0x4fc212];return _0x252317;};'use strict';var multer=require(_0x801e('0x0'));var util=require(_0x801e('0x1'));var path=require(_0x801e('0x2'));var timeout=require('connect-timeout');var express=require(_0x801e('0x3'));var router=express['Router']();var fs_extra=require(_0x801e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x801e('0x5'));var config=require('../../config/environment');var controller=require(_0x801e('0x6'));router[_0x801e('0x7')]('/',controller['index']);module[_0x801e('0x8')]=router; \ No newline at end of file +var _0xa10d=['../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3658af,_0x37aaf7){var _0x5441f0=function(_0x45f339){while(--_0x45f339){_0x3658af['push'](_0x3658af['shift']());}};_0x5441f0(++_0x37aaf7);}(_0xa10d,0xd2));var _0xda10=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xa10d[_0xaa1b3e];return _0x454d7d;};'use strict';var multer=require(_0xda10('0x0'));var util=require(_0xda10('0x1'));var path=require(_0xda10('0x2'));var timeout=require(_0xda10('0x3'));var express=require('express');var router=express[_0xda10('0x4')]();var fs_extra=require(_0xda10('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xda10('0x6'));var config=require(_0xda10('0x7'));var controller=require(_0xda10('0x8'));router[_0xda10('0x9')]('/',controller[_0xda10('0xa')]);module[_0xda10('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 63c67e0..eb91e86 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 _0xcbc9=['version','sequelize','exports'];(function(_0x21f266,_0x2cecb6){var _0x57c96a=function(_0x409519){while(--_0x409519){_0x21f266['push'](_0x21f266['shift']());}};_0x57c96a(++_0x2cecb6);}(_0xcbc9,0x1e4));var _0x9cbc=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0xcbc9[_0x39e164];return _0x13fa6b;};'use strict';var Sequelize=require(_0x9cbc('0x0'));module[_0x9cbc('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x9cbc('0x2')}}; \ No newline at end of file +var _0xb304=['sequelize','version'];(function(_0x4e96d7,_0x3a2644){var _0x40a8df=function(_0x5c6896){while(--_0x5c6896){_0x4e96d7['push'](_0x4e96d7['shift']());}};_0x40a8df(++_0x3a2644);}(_0xb304,0x7a));var _0x4b30=function(_0x371ae7,_0x2f083c){_0x371ae7=_0x371ae7-0x0;var _0x394de0=_0xb304[_0x371ae7];return _0x394de0;};'use strict';var Sequelize=require(_0x4b30('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0x4b30('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index a29cbfe..599ede3 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 _0xa752=['catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','save','update','stack','name','send','index','map','Migration','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','then','include'];(function(_0x216a3f,_0x325b5b){var _0x14bba2=function(_0x330b86){while(--_0x330b86){_0x216a3f['push'](_0x216a3f['shift']());}};_0x14bba2(++_0x325b5b);}(_0xa752,0x141));var _0x2a75=function(_0x525320,_0x8f2948){_0x525320=_0x525320-0x0;var _0x261ead=_0xa752[_0x525320];return _0x261ead;};'use strict';var emlformat=require(_0x2a75('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2a75('0x1'));var jsonpatch=require(_0x2a75('0x2'));var rp=require(_0x2a75('0x3'));var moment=require('moment');var BPromise=require(_0x2a75('0x4'));var Mustache=require(_0x2a75('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2a75('0x6'));var ejs=require(_0x2a75('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2a75('0x8'));var squel=require(_0x2a75('0x9'));var crypto=require(_0x2a75('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2a75('0xb'));var toCsv=require(_0x2a75('0x6'));var querystring=require(_0x2a75('0xc'));var Papa=require(_0x2a75('0xd'));var Redis=require('ioredis');var authService=require(_0x2a75('0xe'));var qs=require(_0x2a75('0xf'));var as=require(_0x2a75('0x10'));var hardwareService=require(_0x2a75('0x11'));var logger=require(_0x2a75('0x12'))(_0x2a75('0x13'));var utils=require(_0x2a75('0x14'));var config=require(_0x2a75('0x15'));var licenseUtil=require(_0x2a75('0x16'));var db=require(_0x2a75('0x17'))['db'];function respondWithStatusCode(_0x26ec7a,_0x284f91){_0x284f91=_0x284f91||0xcc;return function(_0x73453d){if(_0x73453d){return _0x26ec7a[_0x2a75('0x18')](_0x284f91);}return _0x26ec7a[_0x2a75('0x19')](_0x284f91)[_0x2a75('0x1a')]();};}function respondWithResult(_0x1e9121,_0x57103d){_0x57103d=_0x57103d||0xc8;return function(_0x109122){if(_0x109122){return _0x1e9121[_0x2a75('0x19')](_0x57103d)['json'](_0x109122);}};}function respondWithFilteredResult(_0xac8977,_0x598ab9){return function(_0x4d521d){if(_0x4d521d){var _0x4ecdea=typeof _0x598ab9[_0x2a75('0x1b')]===_0x2a75('0x1c')&&typeof _0x598ab9[_0x2a75('0x1d')]==='undefined';var _0x2d50c7=_0x4d521d[_0x2a75('0x1e')];var _0x26e294=_0x4ecdea?0x0:_0x598ab9[_0x2a75('0x1b')];var _0x30c356=_0x4ecdea?_0x4d521d[_0x2a75('0x1e')]:_0x598ab9[_0x2a75('0x1b')]+_0x598ab9[_0x2a75('0x1d')];var _0x217199;if(_0x30c356>=_0x2d50c7){_0x30c356=_0x2d50c7;_0x217199=0xc8;}else{_0x217199=0xce;}_0xac8977[_0x2a75('0x19')](_0x217199);return _0xac8977['set']('Content-Range',_0x26e294+'-'+_0x30c356+'/'+_0x2d50c7)[_0x2a75('0x1f')](_0x4d521d);}return null;};}function patchUpdates(_0x278f35){return function(_0x407e24){try{jsonpatch[_0x2a75('0x20')](_0x407e24,_0x278f35,!![]);}catch(_0x451c9d){return BPromise['reject'](_0x451c9d);}return _0x407e24[_0x2a75('0x21')]();};}function saveUpdates(_0x79dadf,_0x4fb9e4){return function(_0x4e39da){if(_0x4e39da){return _0x4e39da[_0x2a75('0x22')](_0x79dadf)['then'](function(_0x36ec9b){return _0x36ec9b;});}return null;};}function removeEntity(_0x175eda,_0x21a0c7){return function(_0x3b3800){if(_0x3b3800){return _0x3b3800['destroy']()['then'](function(){_0x175eda[_0x2a75('0x19')](0xcc)[_0x2a75('0x1a')]();});}};}function handleEntityNotFound(_0x47e58c,_0x45b1db){return function(_0x439f32){if(!_0x439f32){_0x47e58c[_0x2a75('0x18')](0x194);}return _0x439f32;};}function handleError(_0xded0a0,_0xa75375){_0xa75375=_0xa75375||0x1f4;return function(_0x17b792){logger['error'](_0x17b792[_0x2a75('0x23')]);if(_0x17b792[_0x2a75('0x24')]){delete _0x17b792['name'];}_0xded0a0[_0x2a75('0x19')](_0xa75375)[_0x2a75('0x25')](_0x17b792);};}exports[_0x2a75('0x26')]=function(_0x2e782e,_0x324ab7){var _0x267cb0={},_0x24abd6={},_0x14f689={'count':0x0,'rows':[]};var _0x1a74e4=_[_0x2a75('0x27')](db[_0x2a75('0x28')]['rawAttributes'],function(_0x5349a7){return{'name':_0x5349a7[_0x2a75('0x29')],'type':_0x5349a7[_0x2a75('0x2a')]['key']};});_0x24abd6[_0x2a75('0x2b')]=_[_0x2a75('0x27')](_0x1a74e4,_0x2a75('0x24'));_0x24abd6[_0x2a75('0x2c')]=_[_0x2a75('0x2d')](_0x2e782e[_0x2a75('0x2c')]);_0x24abd6['filters']=_['intersection'](_0x24abd6[_0x2a75('0x2b')],_0x24abd6['query']);_0x267cb0[_0x2a75('0x2e')]=_[_0x2a75('0x2f')](_0x24abd6[_0x2a75('0x2b')],qs[_0x2a75('0x30')](_0x2e782e[_0x2a75('0x2c')][_0x2a75('0x30')]));_0x267cb0[_0x2a75('0x2e')]=_0x267cb0[_0x2a75('0x2e')][_0x2a75('0x31')]?_0x267cb0[_0x2a75('0x2e')]:_0x24abd6[_0x2a75('0x2b')];if(!_0x2e782e[_0x2a75('0x2c')][_0x2a75('0x32')](_0x2a75('0x33'))){_0x267cb0['limit']=qs[_0x2a75('0x1d')](_0x2e782e['query'][_0x2a75('0x1d')]);_0x267cb0[_0x2a75('0x1b')]=qs[_0x2a75('0x1b')](_0x2e782e['query']['offset']);}_0x267cb0[_0x2a75('0x34')]=qs[_0x2a75('0x35')](_0x2e782e['query'][_0x2a75('0x35')]);_0x267cb0[_0x2a75('0x36')]=qs[_0x2a75('0x37')](_[_0x2a75('0x38')](_0x2e782e[_0x2a75('0x2c')],_0x24abd6[_0x2a75('0x37')]),_0x1a74e4);if(_0x2e782e[_0x2a75('0x2c')][_0x2a75('0x39')]){_0x267cb0['where']=_['merge'](_0x267cb0[_0x2a75('0x36')],{'$or':_[_0x2a75('0x27')](_0x1a74e4,function(_0x43d034){if(_0x43d034[_0x2a75('0x2a')]!==_0x2a75('0x3a')){var _0x4bd921={};_0x4bd921[_0x43d034['name']]={'$like':'%'+_0x2e782e['query'][_0x2a75('0x39')]+'%'};return _0x4bd921;}})});}_0x267cb0=_[_0x2a75('0x3b')]({},_0x267cb0,_0x2e782e[_0x2a75('0x3c')]);var _0x4734a3={'where':_0x267cb0['where']};return db[_0x2a75('0x28')][_0x2a75('0x1e')](_0x4734a3)[_0x2a75('0x3d')](function(_0x3989f5){_0x14f689[_0x2a75('0x1e')]=_0x3989f5;if(_0x2e782e[_0x2a75('0x2c')]['includeAll']){_0x267cb0[_0x2a75('0x3e')]=[{'all':!![]}];}return db[_0x2a75('0x28')]['findAll'](_0x267cb0);})[_0x2a75('0x3d')](function(_0x1b42ce){_0x14f689['rows']=_0x1b42ce;return _0x14f689;})['then'](respondWithFilteredResult(_0x324ab7,_0x267cb0))[_0x2a75('0x3f')](handleError(_0x324ab7,null));}; \ No newline at end of file +var _0xfd8b=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','update','then','destroy','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','rimraf','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x509a9a,_0x3c08b1){var _0x4499c8=function(_0x20e29c){while(--_0x20e29c){_0x509a9a['push'](_0x509a9a['shift']());}};_0x4499c8(++_0x3c08b1);}(_0xfd8b,0x72));var _0xbfd8=function(_0x57b443,_0x5145b4){_0x57b443=_0x57b443-0x0;var _0x1a763d=_0xfd8b[_0x57b443];return _0x1a763d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbfd8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbfd8('0x1'));var Mustache=require(_0xbfd8('0x2'));var util=require(_0xbfd8('0x3'));var path=require(_0xbfd8('0x4'));var sox=require(_0xbfd8('0x5'));var csv=require(_0xbfd8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbfd8('0x7'));var squel=require(_0xbfd8('0x8'));var crypto=require(_0xbfd8('0x9'));var jsforce=require(_0xbfd8('0xa'));var deskjs=require(_0xbfd8('0xb'));var toCsv=require(_0xbfd8('0x6'));var querystring=require(_0xbfd8('0xc'));var Papa=require(_0xbfd8('0xd'));var Redis=require(_0xbfd8('0xe'));var authService=require(_0xbfd8('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbfd8('0x10'));var logger=require(_0xbfd8('0x11'))(_0xbfd8('0x12'));var utils=require(_0xbfd8('0x13'));var config=require(_0xbfd8('0x14'));var licenseUtil=require(_0xbfd8('0x15'));var db=require(_0xbfd8('0x16'))['db'];function respondWithStatusCode(_0x4cd23d,_0x54c226){_0x54c226=_0x54c226||0xcc;return function(_0x5b7dc5){if(_0x5b7dc5){return _0x4cd23d[_0xbfd8('0x17')](_0x54c226);}return _0x4cd23d[_0xbfd8('0x18')](_0x54c226)[_0xbfd8('0x19')]();};}function respondWithResult(_0x580e18,_0x4d41d4){_0x4d41d4=_0x4d41d4||0xc8;return function(_0x175a3f){if(_0x175a3f){return _0x580e18['status'](_0x4d41d4)['json'](_0x175a3f);}};}function respondWithFilteredResult(_0x4ef020,_0x1e5437){return function(_0x1955e1){if(_0x1955e1){var _0x2502f9=typeof _0x1e5437['offset']===_0xbfd8('0x1a')&&typeof _0x1e5437[_0xbfd8('0x1b')]===_0xbfd8('0x1a');var _0x5d47e2=_0x1955e1['count'];var _0x500fd5=_0x2502f9?0x0:_0x1e5437[_0xbfd8('0x1c')];var _0x4b0c6c=_0x2502f9?_0x1955e1['count']:_0x1e5437['offset']+_0x1e5437[_0xbfd8('0x1b')];var _0x1673a7;if(_0x4b0c6c>=_0x5d47e2){_0x4b0c6c=_0x5d47e2;_0x1673a7=0xc8;}else{_0x1673a7=0xce;}_0x4ef020[_0xbfd8('0x18')](_0x1673a7);return _0x4ef020[_0xbfd8('0x1d')](_0xbfd8('0x1e'),_0x500fd5+'-'+_0x4b0c6c+'/'+_0x5d47e2)[_0xbfd8('0x1f')](_0x1955e1);}return null;};}function patchUpdates(_0x227a69){return function(_0x2cad22){try{jsonpatch['apply'](_0x2cad22,_0x227a69,!![]);}catch(_0x29afb9){return BPromise['reject'](_0x29afb9);}return _0x2cad22['save']();};}function saveUpdates(_0x76e37f,_0x2a9d2c){return function(_0x1f2cbd){if(_0x1f2cbd){return _0x1f2cbd[_0xbfd8('0x20')](_0x76e37f)[_0xbfd8('0x21')](function(_0x42ae3a){return _0x42ae3a;});}return null;};}function removeEntity(_0x44cc97,_0x481960){return function(_0x28821f){if(_0x28821f){return _0x28821f[_0xbfd8('0x22')]()[_0xbfd8('0x21')](function(){_0x44cc97[_0xbfd8('0x18')](0xcc)[_0xbfd8('0x19')]();});}};}function handleEntityNotFound(_0x1b38d2,_0x4d1539){return function(_0x55c673){if(!_0x55c673){_0x1b38d2[_0xbfd8('0x17')](0x194);}return _0x55c673;};}function handleError(_0x6ccd6d,_0x52de34){_0x52de34=_0x52de34||0x1f4;return function(_0x18e21e){logger[_0xbfd8('0x23')](_0x18e21e[_0xbfd8('0x24')]);if(_0x18e21e['name']){delete _0x18e21e[_0xbfd8('0x25')];}_0x6ccd6d[_0xbfd8('0x18')](_0x52de34)[_0xbfd8('0x26')](_0x18e21e);};}exports[_0xbfd8('0x27')]=function(_0x1951ea,_0x1481fd){var _0x4081b7={},_0x2807cb={},_0x55dbb6={'count':0x0,'rows':[]};var _0x3428a5=_[_0xbfd8('0x28')](db[_0xbfd8('0x29')][_0xbfd8('0x2a')],function(_0xa23034){return{'name':_0xa23034[_0xbfd8('0x2b')],'type':_0xa23034['type'][_0xbfd8('0x2c')]};});_0x2807cb[_0xbfd8('0x2d')]=_[_0xbfd8('0x28')](_0x3428a5,_0xbfd8('0x25'));_0x2807cb[_0xbfd8('0x2e')]=_['keys'](_0x1951ea[_0xbfd8('0x2e')]);_0x2807cb[_0xbfd8('0x2f')]=_[_0xbfd8('0x30')](_0x2807cb['model'],_0x2807cb[_0xbfd8('0x2e')]);_0x4081b7['attributes']=_[_0xbfd8('0x30')](_0x2807cb[_0xbfd8('0x2d')],qs[_0xbfd8('0x31')](_0x1951ea[_0xbfd8('0x2e')][_0xbfd8('0x31')]));_0x4081b7[_0xbfd8('0x32')]=_0x4081b7[_0xbfd8('0x32')]['length']?_0x4081b7[_0xbfd8('0x32')]:_0x2807cb[_0xbfd8('0x2d')];if(!_0x1951ea[_0xbfd8('0x2e')][_0xbfd8('0x33')]('nolimit')){_0x4081b7['limit']=qs[_0xbfd8('0x1b')](_0x1951ea[_0xbfd8('0x2e')][_0xbfd8('0x1b')]);_0x4081b7[_0xbfd8('0x1c')]=qs[_0xbfd8('0x1c')](_0x1951ea[_0xbfd8('0x2e')][_0xbfd8('0x1c')]);}_0x4081b7[_0xbfd8('0x34')]=qs[_0xbfd8('0x35')](_0x1951ea[_0xbfd8('0x2e')][_0xbfd8('0x35')]);_0x4081b7[_0xbfd8('0x36')]=qs[_0xbfd8('0x2f')](_[_0xbfd8('0x37')](_0x1951ea[_0xbfd8('0x2e')],_0x2807cb[_0xbfd8('0x2f')]),_0x3428a5);if(_0x1951ea['query'][_0xbfd8('0x38')]){_0x4081b7['where']=_[_0xbfd8('0x39')](_0x4081b7[_0xbfd8('0x36')],{'$or':_['map'](_0x3428a5,function(_0x21b539){if(_0x21b539[_0xbfd8('0x3a')]!=='VIRTUAL'){var _0x219c17={};_0x219c17[_0x21b539[_0xbfd8('0x25')]]={'$like':'%'+_0x1951ea[_0xbfd8('0x2e')][_0xbfd8('0x38')]+'%'};return _0x219c17;}})});}_0x4081b7=_['merge']({},_0x4081b7,_0x1951ea[_0xbfd8('0x3b')]);var _0x3dd505={'where':_0x4081b7[_0xbfd8('0x36')]};return db[_0xbfd8('0x29')]['count'](_0x3dd505)['then'](function(_0x442810){_0x55dbb6['count']=_0x442810;if(_0x1951ea[_0xbfd8('0x2e')][_0xbfd8('0x3c')]){_0x4081b7[_0xbfd8('0x3d')]=[{'all':!![]}];}return db[_0xbfd8('0x29')]['findAll'](_0x4081b7);})['then'](function(_0x5299bb){_0x55dbb6[_0xbfd8('0x3e')]=_0x5299bb;return _0x55dbb6;})['then'](respondWithFilteredResult(_0x1481fd,_0x4081b7))[_0xbfd8('0x3f')](handleError(_0x1481fd,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index c7614cf..cb42ed5 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 _0x2c5a=['migrations','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./migration.attributes','exports','define','Migration'];(function(_0xf906a2,_0x2a4c09){var _0xfe31b1=function(_0x4bf590){while(--_0x4bf590){_0xf906a2['push'](_0xf906a2['shift']());}};_0xfe31b1(++_0x2a4c09);}(_0x2c5a,0x11f));var _0xa2c5=function(_0x34eb0a,_0x1e76d3){_0x34eb0a=_0x34eb0a-0x0;var _0x9e84d1=_0x2c5a[_0x34eb0a];return _0x9e84d1;};'use strict';var _=require('lodash');var util=require(_0xa2c5('0x0'));var logger=require(_0xa2c5('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa2c5('0x2'));var rp=require(_0xa2c5('0x3'));var fs=require('fs');var path=require(_0xa2c5('0x4'));var rimraf=require('rimraf');var config=require(_0xa2c5('0x5'));var attributes=require(_0xa2c5('0x6'));module[_0xa2c5('0x7')]=function(_0x5119b7,_0x1da697){return _0x5119b7[_0xa2c5('0x8')](_0xa2c5('0x9'),attributes,{'tableName':_0xa2c5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x375a=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x54516e,_0x5df54c){var _0x4d1e6f=function(_0x454bbc){while(--_0x454bbc){_0x54516e['push'](_0x54516e['shift']());}};_0x4d1e6f(++_0x5df54c);}(_0x375a,0x1c0));var _0xa375=function(_0x5e8fc5,_0x4ec992){_0x5e8fc5=_0x5e8fc5-0x0;var _0x4a37d5=_0x375a[_0x5e8fc5];return _0x4a37d5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa375('0x0'))(_0xa375('0x1'));var moment=require(_0xa375('0x2'));var BPromise=require(_0xa375('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa375('0x4'));var rimraf=require(_0xa375('0x5'));var config=require(_0xa375('0x6'));var attributes=require('./migration.attributes');module['exports']=function(_0x319160,_0x37d10b){return _0x319160[_0xa375('0x7')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 07570f3..e57dd78 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 _0xd84c=['debug','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xd84c,0x102));var _0xcd84=function(_0x313f3c,_0x3aa28b){_0x313f3c=_0x313f3c-0x0;var _0x505716=_0xd84c[_0x313f3c];return _0x505716;};'use strict';var _=require(_0xcd84('0x0'));var util=require(_0xcd84('0x1'));var moment=require(_0xcd84('0x2'));var BPromise=require(_0xcd84('0x3'));var rs=require(_0xcd84('0x4'));var fs=require('fs');var Redis=require(_0xcd84('0x5'));var db=require(_0xcd84('0x6'))['db'];var utils=require(_0xcd84('0x7'));var logger=require(_0xcd84('0x8'))('rpc');var config=require(_0xcd84('0x9'));var jayson=require(_0xcd84('0xa'));var client=jayson[_0xcd84('0xb')][_0xcd84('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x520d49,_0x2b5383,_0x22c811){return new BPromise(function(_0x3f3617,_0x5408e2){return client[_0xcd84('0xd')](_0x520d49,_0x22c811)[_0xcd84('0xe')](function(_0xec34a2){logger[_0xcd84('0xf')]('Migration,\x20%s,\x20%s',_0x2b5383,_0xcd84('0x10'));logger[_0xcd84('0x11')]('Migration,\x20%s,\x20%s,\x20%s',_0x2b5383,_0xcd84('0x10'),JSON[_0xcd84('0x12')](_0xec34a2));if(_0xec34a2[_0xcd84('0x13')]){if(_0xec34a2['error'][_0xcd84('0x14')]===0x1f4){logger[_0xcd84('0x13')](_0xcd84('0x15'),_0x2b5383,_0xec34a2[_0xcd84('0x13')]['message']);return _0x5408e2(_0xec34a2[_0xcd84('0x13')][_0xcd84('0x16')]);}logger[_0xcd84('0x13')](_0xcd84('0x15'),_0x2b5383,_0xec34a2[_0xcd84('0x13')][_0xcd84('0x16')]);return _0x3f3617(_0xec34a2[_0xcd84('0x13')][_0xcd84('0x16')]);}else{logger[_0xcd84('0xf')](_0xcd84('0x15'),_0x2b5383,_0xcd84('0x10'));_0x3f3617(_0xec34a2[_0xcd84('0x17')][_0xcd84('0x16')]);}})[_0xcd84('0x18')](function(_0xfc4ec7){logger[_0xcd84('0x13')](_0xcd84('0x15'),_0x2b5383,_0xfc4ec7);_0x5408e2(_0xfc4ec7);});});} \ No newline at end of file +var _0xe205=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0xe205,0xa7));var _0x5e20=function(_0x1b143c,_0x458b30){_0x1b143c=_0x1b143c-0x0;var _0xe5e851=_0xe205[_0x1b143c];return _0xe5e851;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var moment=require(_0x5e20('0x2'));var BPromise=require(_0x5e20('0x3'));var rs=require(_0x5e20('0x4'));var fs=require('fs');var Redis=require(_0x5e20('0x5'));var db=require(_0x5e20('0x6'))['db'];var utils=require(_0x5e20('0x7'));var logger=require(_0x5e20('0x8'))('rpc');var config=require(_0x5e20('0x9'));var jayson=require(_0x5e20('0xa'));var client=jayson[_0x5e20('0xb')][_0x5e20('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5eca5c,_0x4cc88d,_0x3a382f){return new BPromise(function(_0x4c9332,_0x533e18){return client[_0x5e20('0xd')](_0x5eca5c,_0x3a382f)[_0x5e20('0xe')](function(_0x5c1eee){logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));logger[_0x5e20('0x12')]('Migration,\x20%s,\x20%s,\x20%s',_0x4cc88d,_0x5e20('0x11'),JSON[_0x5e20('0x13')](_0x5c1eee));if(_0x5c1eee[_0x5e20('0x14')]){if(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x15')]===0x1f4){logger[_0x5e20('0x14')]('Migration,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);return _0x533e18(_0x5c1eee[_0x5e20('0x14')]['message']);}logger[_0x5e20('0x14')]('Migration,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')]['message']);return _0x4c9332(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);}else{logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));_0x4c9332(_0x5c1eee['result'][_0x5e20('0x16')]);}})[_0x5e20('0x17')](function(_0x166ffd){logger[_0x5e20('0x14')](_0x5e20('0x10'),_0x4cc88d,_0x166ffd);_0x533e18(_0x166ffd);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index c279340..145a40c 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 _0x52a1=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./network.controller','get','isAuthenticated'];(function(_0x594b1b,_0xb70583){var _0x256560=function(_0x178f0f){while(--_0x178f0f){_0x594b1b['push'](_0x594b1b['shift']());}};_0x256560(++_0xb70583);}(_0x52a1,0x1b7));var _0x152a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x52a1[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x152a('0x0'));var util=require(_0x152a('0x1'));var path=require(_0x152a('0x2'));var timeout=require(_0x152a('0x3'));var express=require(_0x152a('0x4'));var router=express[_0x152a('0x5')]();var fs_extra=require(_0x152a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x152a('0x7'));var config=require('../../config/environment');var controller=require(_0x152a('0x8'));router[_0x152a('0x9')]('/',auth[_0x152a('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x152a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x152a('0xc')]);router[_0x152a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x152a('0xe')]);router[_0x152a('0xf')]('/:id',auth[_0x152a('0xa')](),controller[_0x152a('0x10')]);module[_0x152a('0x11')]=router; \ No newline at end of file +var _0x21c9=['Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','put','update','exports','multer','util','path','connect-timeout'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x21c9,0xea));var _0x921c=function(_0x38a053,_0x133cd3){_0x38a053=_0x38a053-0x0;var _0x3cb940=_0x21c9[_0x38a053];return _0x3cb940;};'use strict';var multer=require(_0x921c('0x0'));var util=require(_0x921c('0x1'));var path=require(_0x921c('0x2'));var timeout=require(_0x921c('0x3'));var express=require('express');var router=express[_0x921c('0x4')]();var fs_extra=require(_0x921c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x921c('0x6'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0x921c('0x7')]('/',auth[_0x921c('0x8')](),controller[_0x921c('0x9')]);router[_0x921c('0x7')](_0x921c('0xa'),auth[_0x921c('0x8')](),controller['show']);router['post']('/',auth[_0x921c('0x8')](),controller['create']);router[_0x921c('0xb')]('/:id',auth[_0x921c('0x8')](),controller[_0x921c('0xc')]);router['delete'](_0x921c('0xa'),auth[_0x921c('0x8')](),controller['destroy']);module[_0x921c('0xd')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 72f09b1..471d8ee 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 _0x4882=['exports','ENUM','localnet','externip','stun','turn','STRING','sequelize'];(function(_0x2c8ec1,_0x37988b){var _0x4708f8=function(_0x4d30e4){while(--_0x4d30e4){_0x2c8ec1['push'](_0x2c8ec1['shift']());}};_0x4708f8(++_0x37988b);}(_0x4882,0x14f));var _0x2488=function(_0x16547f,_0x162a2e){_0x16547f=_0x16547f-0x0;var _0x40ac82=_0x4882[_0x16547f];return _0x40ac82;};'use strict';var Sequelize=require(_0x2488('0x0'));module[_0x2488('0x1')]={'type':{'type':Sequelize[_0x2488('0x2')](_0x2488('0x3'),_0x2488('0x4'),_0x2488('0x5'),_0x2488('0x6'))},'value':{'type':Sequelize[_0x2488('0x7')]},'username':{'type':Sequelize[_0x2488('0x7')]},'password':{'type':Sequelize[_0x2488('0x7')]}}; \ No newline at end of file +var _0x6e40=['turn','STRING','sequelize','exports','ENUM','localnet','externip','stun'];(function(_0x230f8f,_0x483b54){var _0x1dc485=function(_0x2065e3){while(--_0x2065e3){_0x230f8f['push'](_0x230f8f['shift']());}};_0x1dc485(++_0x483b54);}(_0x6e40,0xba));var _0x06e4=function(_0x109581,_0x3d0162){_0x109581=_0x109581-0x0;var _0x43492b=_0x6e40[_0x109581];return _0x43492b;};'use strict';var Sequelize=require(_0x06e4('0x0'));module[_0x06e4('0x1')]={'type':{'type':Sequelize[_0x06e4('0x2')](_0x06e4('0x3'),_0x06e4('0x4'),_0x06e4('0x5'),_0x06e4('0x6'))},'value':{'type':Sequelize[_0x06e4('0x7')]},'username':{'type':Sequelize[_0x06e4('0x7')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 5f0ecea..4cf2f31 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 _0x6a21=['util','path','../../config/environment','client','http','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','offset','undefined','limit','count','Content-Range','update','destroy','end','stack','name','send','index','Network','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','toUpperCase','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','TURN','server/files/templates/turn_multiple.ejs','Reload','res_stun_monitor.so','root','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','STUN','/etc/asterisk/turn_xcally.conf','toLowerCase'];(function(_0x500d20,_0x2eaa7b){var _0x2f96a1=function(_0x1ee9f1){while(--_0x1ee9f1){_0x500d20['push'](_0x500d20['shift']());}};_0x2f96a1(++_0x2eaa7b);}(_0x6a21,0x9c));var _0x16a2=function(_0x12a06e,_0x343946){_0x12a06e=_0x12a06e-0x0;var _0x5931a1=_0x6a21[_0x12a06e];return _0x5931a1;};'use strict';var util=require(_0x16a2('0x0'));var path=require(_0x16a2('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x16a2('0x2'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x16a2('0x3')][_0x16a2('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x1ad137,_0x69cd7f,_0x3dad85,_0x20e8c7){return new Promise(function(_0x1c9bfc,_0x14c591){var _0x78a8c4=_0x20e8c7||client;return _0x78a8c4[_0x16a2('0x5')](_0x1ad137,_0x3dad85)[_0x16a2('0x6')](function(_0x2597dd){logger[_0x16a2('0x7')](_0x16a2('0x8'),_0x69cd7f,'request\x20sent');logger[_0x16a2('0x9')](_0x16a2('0xa'),_0x69cd7f,_0x16a2('0xb'),JSON[_0x16a2('0xc')](_0x2597dd));if(_0x2597dd[_0x16a2('0xd')]){if(_0x2597dd[_0x16a2('0xd')]['code']===0x1f4){logger[_0x16a2('0xd')](_0x16a2('0x8'),_0x69cd7f,_0x2597dd[_0x16a2('0xd')][_0x16a2('0xe')]);return _0x14c591(_0x2597dd[_0x16a2('0xd')][_0x16a2('0xe')]);}logger['error'](_0x16a2('0x8'),_0x69cd7f,_0x2597dd['error'][_0x16a2('0xe')]);return _0x1c9bfc(_0x2597dd['error'][_0x16a2('0xe')]);}else{logger[_0x16a2('0x7')](_0x16a2('0x8'),_0x69cd7f,_0x16a2('0xb'));_0x1c9bfc(_0x2597dd['result'][_0x16a2('0xe')]);}})[_0x16a2('0xf')](function(_0x3f5a8a){logger['error']('Network,\x20%s,\x20%s',_0x69cd7f,_0x3f5a8a);_0x14c591(_0x3f5a8a);});});}function respondWithResult(_0x408567,_0x232a9c){_0x232a9c=_0x232a9c||0xc8;return function(_0x54490d){if(_0x54490d){return _0x408567[_0x16a2('0x10')](_0x232a9c)['json'](_0x54490d);}};}function respondWithFilteredResult(_0x5a33c2,_0x4308f9){return function(_0x6c09f0){if(_0x6c09f0){var _0x53b021=typeof _0x4308f9[_0x16a2('0x11')]===_0x16a2('0x12')&&typeof _0x4308f9[_0x16a2('0x13')]===_0x16a2('0x12');var _0x13521c=_0x6c09f0['count'];var _0x2a5f9b=_0x53b021?0x0:_0x4308f9[_0x16a2('0x11')];var _0x2981bc=_0x53b021?_0x6c09f0[_0x16a2('0x14')]:_0x4308f9[_0x16a2('0x11')]+_0x4308f9[_0x16a2('0x13')];var _0x362f4b;if(_0x2981bc>=_0x13521c){_0x2981bc=_0x13521c;_0x362f4b=0xc8;}else{_0x362f4b=0xce;}_0x5a33c2[_0x16a2('0x10')](_0x362f4b);return _0x5a33c2['set'](_0x16a2('0x15'),_0x2a5f9b+'-'+_0x2981bc+'/'+_0x13521c)['json'](_0x6c09f0);}return null;};}function saveUpdates(_0xc9200f){return function(_0x31294c){if(_0x31294c){return _0x31294c[_0x16a2('0x16')](_0xc9200f)['then'](function(_0x387fc0){return _0x387fc0;});}return null;};}function removeEntity(_0x3c3e58){return function(_0x494cd4){if(_0x494cd4){return _0x494cd4[_0x16a2('0x17')]()[_0x16a2('0x6')](function(){_0x3c3e58[_0x16a2('0x10')](0xcc)[_0x16a2('0x18')]();});}};}function handleEntityNotFound(_0x45d222){return function(_0x55b858){if(!_0x55b858){_0x45d222['sendStatus'](0x194);}return _0x55b858;};}function handleError(_0x25926c,_0x5ebe62){_0x5ebe62=_0x5ebe62||0x1f4;return function(_0x96f95b){logger[_0x16a2('0xd')](_0x96f95b[_0x16a2('0x19')]);if(_0x96f95b[_0x16a2('0x1a')]){delete _0x96f95b['name'];}_0x25926c[_0x16a2('0x10')](_0x5ebe62)[_0x16a2('0x1b')](_0x96f95b);};}exports[_0x16a2('0x1c')]=function(_0xb4425d,_0x3ccc62){var _0x261c7f={},_0x5baf4f={},_0x5d252b={'count':0x0,'rows':[]};var _0x2e7d00=_['map'](db[_0x16a2('0x1d')][_0x16a2('0x1e')],function(_0x13306b){return{'name':_0x13306b['fieldName'],'type':_0x13306b[_0x16a2('0x1f')][_0x16a2('0x20')]};});_0x5baf4f['model']=_['map'](_0x2e7d00,_0x16a2('0x1a'));_0x5baf4f[_0x16a2('0x21')]=_[_0x16a2('0x22')](_0xb4425d['query']);_0x5baf4f[_0x16a2('0x23')]=_[_0x16a2('0x24')](_0x5baf4f[_0x16a2('0x25')],_0x5baf4f[_0x16a2('0x21')]);_0x261c7f[_0x16a2('0x26')]=_[_0x16a2('0x24')](_0x5baf4f['model'],qs[_0x16a2('0x27')](_0xb4425d[_0x16a2('0x21')][_0x16a2('0x27')]));_0x261c7f['attributes']=_0x261c7f['attributes'][_0x16a2('0x28')]?_0x261c7f['attributes']:_0x5baf4f[_0x16a2('0x25')];if(!_0xb4425d[_0x16a2('0x21')]['hasOwnProperty'](_0x16a2('0x29'))){_0x261c7f[_0x16a2('0x13')]=qs[_0x16a2('0x13')](_0xb4425d['query'][_0x16a2('0x13')]);_0x261c7f[_0x16a2('0x11')]=qs[_0x16a2('0x11')](_0xb4425d[_0x16a2('0x21')][_0x16a2('0x11')]);}_0x261c7f[_0x16a2('0x2a')]=qs[_0x16a2('0x2b')](_0xb4425d[_0x16a2('0x21')][_0x16a2('0x2b')]);_0x261c7f[_0x16a2('0x2c')]=qs[_0x16a2('0x23')](_[_0x16a2('0x2d')](_0xb4425d[_0x16a2('0x21')],_0x5baf4f['filters']),_0x2e7d00);if(_0xb4425d['query'][_0x16a2('0x2e')]){_0x261c7f[_0x16a2('0x2c')]=_[_0x16a2('0x2f')](_0x261c7f[_0x16a2('0x2c')],{'$or':_[_0x16a2('0x30')](_0x2e7d00,function(_0x1bbc39){if(_0x1bbc39[_0x16a2('0x1f')]!==_0x16a2('0x31')){var _0x52bb41={};_0x52bb41[_0x1bbc39[_0x16a2('0x1a')]]={'$like':'%'+_0xb4425d['query'][_0x16a2('0x2e')]+'%'};return _0x52bb41;}})});}_0x261c7f=_[_0x16a2('0x2f')]({},_0x261c7f,_0xb4425d[_0x16a2('0x32')]);var _0x5ac1e9={'where':_0x261c7f[_0x16a2('0x2c')]};return db[_0x16a2('0x1d')][_0x16a2('0x14')](_0x5ac1e9)[_0x16a2('0x6')](function(_0x388b00){_0x5d252b[_0x16a2('0x14')]=_0x388b00;if(_0xb4425d[_0x16a2('0x21')][_0x16a2('0x33')]){_0x261c7f[_0x16a2('0x34')]=[{'all':!![]}];}return db[_0x16a2('0x1d')][_0x16a2('0x35')](_0x261c7f);})[_0x16a2('0x6')](function(_0x39d34f){_0x5d252b['rows']=_0x39d34f;return _0x5d252b;})[_0x16a2('0x6')](respondWithFilteredResult(_0x3ccc62,_0x261c7f))['catch'](handleError(_0x3ccc62,null));};exports[_0x16a2('0x36')]=function(_0x37ec83,_0x130935){var _0x286aee={'raw':!![],'where':{'id':_0x37ec83[_0x16a2('0x37')]['id']}},_0x8c0888={};_0x8c0888[_0x16a2('0x25')]=_[_0x16a2('0x22')](db[_0x16a2('0x1d')][_0x16a2('0x1e')]);_0x8c0888['query']=_['keys'](_0x37ec83[_0x16a2('0x21')]);_0x8c0888['filters']=_[_0x16a2('0x24')](_0x8c0888[_0x16a2('0x25')],_0x8c0888[_0x16a2('0x21')]);_0x286aee[_0x16a2('0x26')]=_[_0x16a2('0x24')](_0x8c0888['model'],qs[_0x16a2('0x27')](_0x37ec83['query'][_0x16a2('0x27')]));_0x286aee[_0x16a2('0x26')]=_0x286aee[_0x16a2('0x26')][_0x16a2('0x28')]?_0x286aee[_0x16a2('0x26')]:_0x8c0888['model'];if(_0x37ec83['query'][_0x16a2('0x33')]){_0x286aee[_0x16a2('0x34')]=[{'all':!![]}];}_0x286aee=_['merge']({},_0x286aee,_0x37ec83[_0x16a2('0x32')]);return db['Network'][_0x16a2('0x38')](_0x286aee)['then'](handleEntityNotFound(_0x130935,null))[_0x16a2('0x6')](respondWithResult(_0x130935,null))[_0x16a2('0xf')](handleError(_0x130935,null));};exports[_0x16a2('0x39')]=function(_0x565e93,_0x4deab7){var _0x49bc54;return db['Network'][_0x16a2('0x39')](_0x565e93[_0x16a2('0x3a')],{'raw':!![]})['then'](function(_0x109fc3){_0x49bc54=_0x109fc3;return db['Network'][_0x16a2('0x35')]({'where':{'type':_0x565e93[_0x16a2('0x3a')][_0x16a2('0x1f')]},'raw':!![]});})['then'](function(_0x42804f){if(_0x49bc54[_0x16a2('0x1f')][_0x16a2('0x3b')]()=='STUN'){var _0x5a05e1=fs[_0x16a2('0x3c')](path[_0x16a2('0x3d')](config['root'],_0x16a2('0x3e')),_0x16a2('0x3f'));var _0x3e04a0=ejs[_0x16a2('0x40')](_0x5a05e1,{'networks':_0x42804f||[]});fs[_0x16a2('0x41')]('/etc/asterisk/stun_xcally.conf',_0x3e04a0);return respondWithRpcPromise('Reload','create',{'module':'res_stun_monitor.so'});}else if(_0x49bc54['type'][_0x16a2('0x3b')]()==_0x16a2('0x42')){var _0x43f3bf=fs['readFileSync'](path['join'](config['root'],_0x16a2('0x43')),_0x16a2('0x3f'));var _0x4c3532=ejs[_0x16a2('0x40')](_0x43f3bf,{'networks':_0x42804f||[]});fs[_0x16a2('0x41')]('/etc/asterisk/turn_xcally.conf',_0x4c3532);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x39'),{'module':_0x16a2('0x45')});}else{var _0x466703=fs['readFileSync'](path[_0x16a2('0x3d')](config[_0x16a2('0x46')],_0x16a2('0x47')),_0x16a2('0x3f'));var _0x2e52f7=ejs['render'](_0x466703,{'networks':_0x42804f||[]});fs['writeFileSync'](util[_0x16a2('0x48')](_0x16a2('0x49'),_0x565e93[_0x16a2('0x3a')][_0x16a2('0x1f')]['toLowerCase']()),_0x2e52f7);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x39'),{'module':_0x16a2('0x4a')});}})[_0x16a2('0x6')](function(){return _0x49bc54;})['then'](respondWithResult(_0x4deab7,0xc9))[_0x16a2('0xf')](handleError(_0x4deab7,null));};exports[_0x16a2('0x16')]=function(_0x449031,_0x34a2a9){var _0x409ce5;return db[_0x16a2('0x1d')]['find']({'where':{'id':_0x449031[_0x16a2('0x37')]['id']}})[_0x16a2('0x6')](handleEntityNotFound(_0x34a2a9,null))[_0x16a2('0x6')](saveUpdates(_0x449031[_0x16a2('0x3a')],null))[_0x16a2('0x6')](function(_0x2e234b){if(_0x2e234b){_0x409ce5=_0x2e234b;return db[_0x16a2('0x1d')]['findAll']({'where':{'type':_0x409ce5['type']},'raw':!![]});}return null;})[_0x16a2('0x6')](function(_0x544a98){if(_0x409ce5['type'][_0x16a2('0x3b')]()==_0x16a2('0x4b')){var _0x8d740=fs[_0x16a2('0x3c')](path[_0x16a2('0x3d')](config[_0x16a2('0x46')],_0x16a2('0x3e')),'utf8');var _0x2a804b=ejs[_0x16a2('0x40')](_0x8d740,{'networks':_0x544a98||[]});fs[_0x16a2('0x41')]('/etc/asterisk/stun_xcally.conf',_0x2a804b);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x16'),{'module':_0x16a2('0x45')});}else if(_0x409ce5[_0x16a2('0x1f')][_0x16a2('0x3b')]()==_0x16a2('0x42')){var _0x318849=fs[_0x16a2('0x3c')](path['join'](config[_0x16a2('0x46')],_0x16a2('0x43')),'utf8');var _0x2ce0d1=ejs[_0x16a2('0x40')](_0x318849,{'networks':_0x544a98||[]});fs[_0x16a2('0x41')](_0x16a2('0x4c'),_0x2ce0d1);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x16'),{'module':_0x16a2('0x45')});}else{var _0x2a6394=fs[_0x16a2('0x3c')](path[_0x16a2('0x3d')](config['root'],_0x16a2('0x47')),'utf8');var _0x48e49e=ejs['render'](_0x2a6394,{'networks':_0x544a98||[]});fs['writeFileSync'](util['format'](_0x16a2('0x49'),_0x449031[_0x16a2('0x3a')]['type']['toLowerCase']()),_0x48e49e);return respondWithRpcPromise('Reload','update',{'module':_0x16a2('0x4a')});}})['then'](function(_0xc7b20c){if(_0xc7b20c){return _0x409ce5;}return null;})[_0x16a2('0x6')](respondWithResult(_0x34a2a9,null))[_0x16a2('0xf')](handleError(_0x34a2a9,null));};exports[_0x16a2('0x17')]=function(_0x66d526,_0x39e4d0){var _0x4b8a3a;return db[_0x16a2('0x1d')][_0x16a2('0x38')]({'where':{'id':_0x66d526[_0x16a2('0x37')]['id']}})['then'](function(_0x2441d6){_0x4b8a3a=_0x2441d6;return _0x2441d6;})['then'](handleEntityNotFound(_0x39e4d0,null))[_0x16a2('0x6')](removeEntity(_0x39e4d0,null))[_0x16a2('0x6')](function(){if(_0x4b8a3a){return db[_0x16a2('0x1d')][_0x16a2('0x35')]({'where':{'type':_0x4b8a3a['type']},'raw':!![]});}})[_0x16a2('0x6')](function(_0x1e75eb){if(_0x4b8a3a[_0x16a2('0x1f')][_0x16a2('0x3b')]()==_0x16a2('0x4b')){var _0x255fb4=fs[_0x16a2('0x3c')](path['join'](config[_0x16a2('0x46')],_0x16a2('0x3e')),_0x16a2('0x3f'));var _0x5055ea=ejs['render'](_0x255fb4,{'networks':_0x1e75eb||[]});fs[_0x16a2('0x41')]('/etc/asterisk/stun_xcally.conf',_0x5055ea);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x17'),{'module':_0x16a2('0x45')});}else if(_0x4b8a3a[_0x16a2('0x1f')][_0x16a2('0x3b')]()==_0x16a2('0x42')){var _0x1e759f=fs[_0x16a2('0x3c')](path[_0x16a2('0x3d')](config[_0x16a2('0x46')],_0x16a2('0x43')),'utf8');var _0x331457=ejs[_0x16a2('0x40')](_0x1e759f,{'networks':_0x1e75eb||[]});fs[_0x16a2('0x41')](_0x16a2('0x4c'),_0x331457);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x17'),{'module':_0x16a2('0x45')});}else{var _0x62b461=fs[_0x16a2('0x3c')](path[_0x16a2('0x3d')](config[_0x16a2('0x46')],_0x16a2('0x47')),_0x16a2('0x3f'));var _0x4172af=ejs['render'](_0x62b461,{'networks':_0x1e75eb||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x4b8a3a[_0x16a2('0x1f')][_0x16a2('0x4d')]()),_0x4172af);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x17'),{'module':_0x16a2('0x4a')});}})[_0x16a2('0xf')](handleError(_0x39e4d0,null));}; \ No newline at end of file +var _0xe312=['rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','show','find','create','body','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/stun_xcally.conf','toUpperCase','writeFileSync','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','util','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','client','http','request','info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','status','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','end','sendStatus','stack','name','map','Network'];(function(_0x246437,_0x40f7c1){var _0x458cd2=function(_0x2a8c97){while(--_0x2a8c97){_0x246437['push'](_0x246437['shift']());}};_0x458cd2(++_0x40f7c1);}(_0xe312,0x128));var _0x2e31=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xe312[_0x1ac595];return _0x455fff;};'use strict';var util=require(_0x2e31('0x0'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2e31('0x1'));var qs=require(_0x2e31('0x2'));var logger=require(_0x2e31('0x3'))('api');var config=require(_0x2e31('0x4'));var db=require(_0x2e31('0x5'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2e31('0x6')][_0x2e31('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45e532,_0x48645e,_0x5874e2,_0x170fa1){return new Promise(function(_0x5c47c4,_0x37c76e){var _0x3e3431=_0x170fa1||client;return _0x3e3431[_0x2e31('0x8')](_0x45e532,_0x5874e2)['then'](function(_0x2ed5d8){logger[_0x2e31('0x9')](_0x2e31('0xa'),_0x48645e,'request\x20sent');logger[_0x2e31('0xb')]('Network,\x20%s,\x20%s,\x20%s',_0x48645e,'request\x20sent',JSON[_0x2e31('0xc')](_0x2ed5d8));if(_0x2ed5d8[_0x2e31('0xd')]){if(_0x2ed5d8[_0x2e31('0xd')][_0x2e31('0xe')]===0x1f4){logger[_0x2e31('0xd')](_0x2e31('0xa'),_0x48645e,_0x2ed5d8[_0x2e31('0xd')][_0x2e31('0xf')]);return _0x37c76e(_0x2ed5d8[_0x2e31('0xd')][_0x2e31('0xf')]);}logger['error']('Network,\x20%s,\x20%s',_0x48645e,_0x2ed5d8[_0x2e31('0xd')]['message']);return _0x5c47c4(_0x2ed5d8[_0x2e31('0xd')][_0x2e31('0xf')]);}else{logger[_0x2e31('0x9')](_0x2e31('0xa'),_0x48645e,_0x2e31('0x10'));_0x5c47c4(_0x2ed5d8[_0x2e31('0x11')][_0x2e31('0xf')]);}})[_0x2e31('0x12')](function(_0x2c83a2){logger[_0x2e31('0xd')](_0x2e31('0xa'),_0x48645e,_0x2c83a2);_0x37c76e(_0x2c83a2);});});}function respondWithResult(_0x5aede4,_0x55427e){_0x55427e=_0x55427e||0xc8;return function(_0x1c309b){if(_0x1c309b){return _0x5aede4[_0x2e31('0x13')](_0x55427e)[_0x2e31('0x14')](_0x1c309b);}};}function respondWithFilteredResult(_0x7ca45e,_0x19163b){return function(_0x5bec70){if(_0x5bec70){var _0x1f0043=typeof _0x19163b['offset']===_0x2e31('0x15')&&typeof _0x19163b['limit']===_0x2e31('0x15');var _0x161f86=_0x5bec70[_0x2e31('0x16')];var _0x394dfc=_0x1f0043?0x0:_0x19163b[_0x2e31('0x17')];var _0x1f00d5=_0x1f0043?_0x5bec70[_0x2e31('0x16')]:_0x19163b[_0x2e31('0x17')]+_0x19163b[_0x2e31('0x18')];var _0xe98d33;if(_0x1f00d5>=_0x161f86){_0x1f00d5=_0x161f86;_0xe98d33=0xc8;}else{_0xe98d33=0xce;}_0x7ca45e[_0x2e31('0x13')](_0xe98d33);return _0x7ca45e[_0x2e31('0x19')](_0x2e31('0x1a'),_0x394dfc+'-'+_0x1f00d5+'/'+_0x161f86)[_0x2e31('0x14')](_0x5bec70);}return null;};}function saveUpdates(_0x3cd6d5){return function(_0x38cc3f){if(_0x38cc3f){return _0x38cc3f[_0x2e31('0x1b')](_0x3cd6d5)[_0x2e31('0x1c')](function(_0x40a0b8){return _0x40a0b8;});}return null;};}function removeEntity(_0x6a3f4a){return function(_0x2c79cc){if(_0x2c79cc){return _0x2c79cc[_0x2e31('0x1d')]()['then'](function(){_0x6a3f4a[_0x2e31('0x13')](0xcc)[_0x2e31('0x1e')]();});}};}function handleEntityNotFound(_0x551e4f){return function(_0x16e90e){if(!_0x16e90e){_0x551e4f[_0x2e31('0x1f')](0x194);}return _0x16e90e;};}function handleError(_0x5c695e,_0x3e92ff){_0x3e92ff=_0x3e92ff||0x1f4;return function(_0x3ffa07){logger[_0x2e31('0xd')](_0x3ffa07[_0x2e31('0x20')]);if(_0x3ffa07[_0x2e31('0x21')]){delete _0x3ffa07[_0x2e31('0x21')];}_0x5c695e[_0x2e31('0x13')](_0x3e92ff)['send'](_0x3ffa07);};}exports['index']=function(_0x2b269f,_0x50c5f9){var _0x4b2cfb={},_0x591a86={},_0x4fe002={'count':0x0,'rows':[]};var _0x3b621b=_[_0x2e31('0x22')](db[_0x2e31('0x23')][_0x2e31('0x24')],function(_0x1620d6){return{'name':_0x1620d6[_0x2e31('0x25')],'type':_0x1620d6[_0x2e31('0x26')][_0x2e31('0x27')]};});_0x591a86['model']=_['map'](_0x3b621b,'name');_0x591a86['query']=_[_0x2e31('0x28')](_0x2b269f[_0x2e31('0x29')]);_0x591a86['filters']=_[_0x2e31('0x2a')](_0x591a86[_0x2e31('0x2b')],_0x591a86[_0x2e31('0x29')]);_0x4b2cfb[_0x2e31('0x2c')]=_[_0x2e31('0x2a')](_0x591a86['model'],qs[_0x2e31('0x2d')](_0x2b269f[_0x2e31('0x29')][_0x2e31('0x2d')]));_0x4b2cfb[_0x2e31('0x2c')]=_0x4b2cfb['attributes'][_0x2e31('0x2e')]?_0x4b2cfb[_0x2e31('0x2c')]:_0x591a86[_0x2e31('0x2b')];if(!_0x2b269f[_0x2e31('0x29')][_0x2e31('0x2f')](_0x2e31('0x30'))){_0x4b2cfb['limit']=qs[_0x2e31('0x18')](_0x2b269f[_0x2e31('0x29')][_0x2e31('0x18')]);_0x4b2cfb[_0x2e31('0x17')]=qs['offset'](_0x2b269f[_0x2e31('0x29')]['offset']);}_0x4b2cfb[_0x2e31('0x31')]=qs[_0x2e31('0x32')](_0x2b269f[_0x2e31('0x29')][_0x2e31('0x32')]);_0x4b2cfb[_0x2e31('0x33')]=qs['filters'](_[_0x2e31('0x34')](_0x2b269f['query'],_0x591a86[_0x2e31('0x35')]),_0x3b621b);if(_0x2b269f[_0x2e31('0x29')][_0x2e31('0x36')]){_0x4b2cfb[_0x2e31('0x33')]=_[_0x2e31('0x37')](_0x4b2cfb[_0x2e31('0x33')],{'$or':_[_0x2e31('0x22')](_0x3b621b,function(_0x23c517){if(_0x23c517[_0x2e31('0x26')]!=='VIRTUAL'){var _0x5d2829={};_0x5d2829[_0x23c517[_0x2e31('0x21')]]={'$like':'%'+_0x2b269f[_0x2e31('0x29')]['filter']+'%'};return _0x5d2829;}})});}_0x4b2cfb=_[_0x2e31('0x37')]({},_0x4b2cfb,_0x2b269f[_0x2e31('0x38')]);var _0x213a2b={'where':_0x4b2cfb[_0x2e31('0x33')]};return db[_0x2e31('0x23')][_0x2e31('0x16')](_0x213a2b)['then'](function(_0x3b771d){_0x4fe002[_0x2e31('0x16')]=_0x3b771d;if(_0x2b269f[_0x2e31('0x29')][_0x2e31('0x39')]){_0x4b2cfb[_0x2e31('0x3a')]=[{'all':!![]}];}return db[_0x2e31('0x23')][_0x2e31('0x3b')](_0x4b2cfb);})['then'](function(_0x487fb7){_0x4fe002['rows']=_0x487fb7;return _0x4fe002;})['then'](respondWithFilteredResult(_0x50c5f9,_0x4b2cfb))[_0x2e31('0x12')](handleError(_0x50c5f9,null));};exports[_0x2e31('0x3c')]=function(_0x450de1,_0x391be4){var _0x36ef49={'raw':!![],'where':{'id':_0x450de1['params']['id']}},_0x4e50cb={};_0x4e50cb['model']=_[_0x2e31('0x28')](db[_0x2e31('0x23')]['rawAttributes']);_0x4e50cb['query']=_['keys'](_0x450de1[_0x2e31('0x29')]);_0x4e50cb[_0x2e31('0x35')]=_[_0x2e31('0x2a')](_0x4e50cb['model'],_0x4e50cb[_0x2e31('0x29')]);_0x36ef49[_0x2e31('0x2c')]=_[_0x2e31('0x2a')](_0x4e50cb[_0x2e31('0x2b')],qs['fields'](_0x450de1[_0x2e31('0x29')][_0x2e31('0x2d')]));_0x36ef49[_0x2e31('0x2c')]=_0x36ef49[_0x2e31('0x2c')][_0x2e31('0x2e')]?_0x36ef49[_0x2e31('0x2c')]:_0x4e50cb[_0x2e31('0x2b')];if(_0x450de1[_0x2e31('0x29')][_0x2e31('0x39')]){_0x36ef49[_0x2e31('0x3a')]=[{'all':!![]}];}_0x36ef49=_['merge']({},_0x36ef49,_0x450de1['options']);return db[_0x2e31('0x23')][_0x2e31('0x3d')](_0x36ef49)[_0x2e31('0x1c')](handleEntityNotFound(_0x391be4,null))['then'](respondWithResult(_0x391be4,null))[_0x2e31('0x12')](handleError(_0x391be4,null));};exports[_0x2e31('0x3e')]=function(_0x1da480,_0x15e830){var _0x29cab6;return db[_0x2e31('0x23')][_0x2e31('0x3e')](_0x1da480[_0x2e31('0x3f')],{'raw':!![]})[_0x2e31('0x1c')](function(_0xe16fc7){_0x29cab6=_0xe16fc7;return db[_0x2e31('0x23')][_0x2e31('0x3b')]({'where':{'type':_0x1da480[_0x2e31('0x3f')][_0x2e31('0x26')]},'raw':!![]});})[_0x2e31('0x1c')](function(_0x1fe36b){if(_0x29cab6[_0x2e31('0x26')]['toUpperCase']()=='STUN'){var _0x2e082e=fs[_0x2e31('0x40')](path[_0x2e31('0x41')](config[_0x2e31('0x42')],_0x2e31('0x43')),_0x2e31('0x44'));var _0x1a9313=ejs[_0x2e31('0x45')](_0x2e082e,{'networks':_0x1fe36b||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x1a9313);return respondWithRpcPromise(_0x2e31('0x46'),_0x2e31('0x3e'),{'module':_0x2e31('0x47')});}else if(_0x29cab6[_0x2e31('0x26')]['toUpperCase']()==_0x2e31('0x48')){var _0x42426b=fs[_0x2e31('0x40')](path[_0x2e31('0x41')](config[_0x2e31('0x42')],_0x2e31('0x49')),_0x2e31('0x44'));var _0x1670ab=ejs[_0x2e31('0x45')](_0x42426b,{'networks':_0x1fe36b||[]});fs['writeFileSync'](_0x2e31('0x4a'),_0x1670ab);return respondWithRpcPromise(_0x2e31('0x46'),_0x2e31('0x3e'),{'module':_0x2e31('0x47')});}else{var _0x413c30=fs[_0x2e31('0x40')](path[_0x2e31('0x41')](config[_0x2e31('0x42')],_0x2e31('0x4b')),_0x2e31('0x44'));var _0x106d34=ejs['render'](_0x413c30,{'networks':_0x1fe36b||[]});fs['writeFileSync'](util[_0x2e31('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0x1da480[_0x2e31('0x3f')][_0x2e31('0x26')]['toLowerCase']()),_0x106d34);return respondWithRpcPromise(_0x2e31('0x46'),_0x2e31('0x3e'),{'module':'chan_sip.so'});}})['then'](function(){return _0x29cab6;})[_0x2e31('0x1c')](respondWithResult(_0x15e830,0xc9))[_0x2e31('0x12')](handleError(_0x15e830,null));};exports[_0x2e31('0x1b')]=function(_0x332388,_0x22c285){var _0x47d5ef;return db[_0x2e31('0x23')][_0x2e31('0x3d')]({'where':{'id':_0x332388['params']['id']}})['then'](handleEntityNotFound(_0x22c285,null))[_0x2e31('0x1c')](saveUpdates(_0x332388[_0x2e31('0x3f')],null))[_0x2e31('0x1c')](function(_0x259b89){if(_0x259b89){_0x47d5ef=_0x259b89;return db[_0x2e31('0x23')]['findAll']({'where':{'type':_0x47d5ef['type']},'raw':!![]});}return null;})[_0x2e31('0x1c')](function(_0x119f9d){if(_0x47d5ef['type']['toUpperCase']()=='STUN'){var _0x2cb88c=fs[_0x2e31('0x40')](path[_0x2e31('0x41')](config[_0x2e31('0x42')],_0x2e31('0x43')),_0x2e31('0x44'));var _0x512ace=ejs[_0x2e31('0x45')](_0x2cb88c,{'networks':_0x119f9d||[]});fs['writeFileSync'](_0x2e31('0x4d'),_0x512ace);return respondWithRpcPromise(_0x2e31('0x46'),_0x2e31('0x1b'),{'module':'res_stun_monitor.so'});}else if(_0x47d5ef[_0x2e31('0x26')][_0x2e31('0x4e')]()==_0x2e31('0x48')){var _0x2c3431=fs[_0x2e31('0x40')](path['join'](config[_0x2e31('0x42')],'server/files/templates/turn_multiple.ejs'),_0x2e31('0x44'));var _0x2e89d7=ejs[_0x2e31('0x45')](_0x2c3431,{'networks':_0x119f9d||[]});fs[_0x2e31('0x4f')](_0x2e31('0x4a'),_0x2e89d7);return respondWithRpcPromise(_0x2e31('0x46'),_0x2e31('0x1b'),{'module':_0x2e31('0x47')});}else{var _0x1eb0fc=fs[_0x2e31('0x40')](path['join'](config[_0x2e31('0x42')],_0x2e31('0x4b')),_0x2e31('0x44'));var _0x1bfd77=ejs[_0x2e31('0x45')](_0x1eb0fc,{'networks':_0x119f9d||[]});fs[_0x2e31('0x4f')](util[_0x2e31('0x4c')](_0x2e31('0x50'),_0x332388[_0x2e31('0x3f')][_0x2e31('0x26')][_0x2e31('0x51')]()),_0x1bfd77);return respondWithRpcPromise(_0x2e31('0x46'),_0x2e31('0x1b'),{'module':_0x2e31('0x52')});}})[_0x2e31('0x1c')](function(_0x5d704b){if(_0x5d704b){return _0x47d5ef;}return null;})[_0x2e31('0x1c')](respondWithResult(_0x22c285,null))[_0x2e31('0x12')](handleError(_0x22c285,null));};exports[_0x2e31('0x1d')]=function(_0x20e171,_0x5da34f){var _0x1fb2fb;return db[_0x2e31('0x23')][_0x2e31('0x3d')]({'where':{'id':_0x20e171['params']['id']}})[_0x2e31('0x1c')](function(_0x1f75a3){_0x1fb2fb=_0x1f75a3;return _0x1f75a3;})[_0x2e31('0x1c')](handleEntityNotFound(_0x5da34f,null))[_0x2e31('0x1c')](removeEntity(_0x5da34f,null))[_0x2e31('0x1c')](function(){if(_0x1fb2fb){return db[_0x2e31('0x23')]['findAll']({'where':{'type':_0x1fb2fb['type']},'raw':!![]});}})['then'](function(_0x354c8a){if(_0x1fb2fb['type'][_0x2e31('0x4e')]()=='STUN'){var _0x5f1f79=fs[_0x2e31('0x40')](path[_0x2e31('0x41')](config[_0x2e31('0x42')],_0x2e31('0x43')),_0x2e31('0x44'));var _0xcc7ed7=ejs[_0x2e31('0x45')](_0x5f1f79,{'networks':_0x354c8a||[]});fs[_0x2e31('0x4f')](_0x2e31('0x4d'),_0xcc7ed7);return respondWithRpcPromise(_0x2e31('0x46'),_0x2e31('0x1d'),{'module':'res_stun_monitor.so'});}else if(_0x1fb2fb[_0x2e31('0x26')][_0x2e31('0x4e')]()==_0x2e31('0x48')){var _0xec257d=fs['readFileSync'](path[_0x2e31('0x41')](config[_0x2e31('0x42')],_0x2e31('0x49')),_0x2e31('0x44'));var _0x34b845=ejs[_0x2e31('0x45')](_0xec257d,{'networks':_0x354c8a||[]});fs['writeFileSync'](_0x2e31('0x4a'),_0x34b845);return respondWithRpcPromise(_0x2e31('0x46'),'destroy',{'module':_0x2e31('0x47')});}else{var _0x142cde=fs[_0x2e31('0x40')](path[_0x2e31('0x41')](config['root'],_0x2e31('0x4b')),_0x2e31('0x44'));var _0x16ccb4=ejs['render'](_0x142cde,{'networks':_0x354c8a||[]});fs[_0x2e31('0x4f')](util['format'](_0x2e31('0x50'),_0x1fb2fb[_0x2e31('0x26')][_0x2e31('0x51')]()),_0x16ccb4);return respondWithRpcPromise(_0x2e31('0x46'),_0x2e31('0x1d'),{'module':'chan_sip.so'});}})[_0x2e31('0x12')](handleError(_0x5da34f,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 636df5f..2d050d6 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 _0x7a2c=['path','rimraf','../../config/environment','exports','network','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa3463d,_0x323da0){var _0x18f7ca=function(_0x1c0ec4){while(--_0x1c0ec4){_0xa3463d['push'](_0xa3463d['shift']());}};_0x18f7ca(++_0x323da0);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x2eb07f,_0x507792){_0x2eb07f=_0x2eb07f-0x0;var _0x591971=_0x7a2c[_0x2eb07f];return _0x591971;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var moment=require(_0xc7a2('0x3'));var BPromise=require(_0xc7a2('0x4'));var rp=require(_0xc7a2('0x5'));var fs=require('fs');var path=require(_0xc7a2('0x6'));var rimraf=require(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var attributes=require('./network.attributes');module[_0xc7a2('0x9')]=function(_0x1ddbae,_0x5f334e){return _0x1ddbae['define']('Network',attributes,{'tableName':_0xc7a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','define','Network','lodash','util'];(function(_0x4f7ebe,_0x3ca82a){var _0xfde8f8=function(_0x5e10d4){while(--_0x5e10d4){_0x4f7ebe['push'](_0x4f7ebe['shift']());}};_0xfde8f8(++_0x3ca82a);}(_0x54ef,0x112));var _0xf54e=function(_0x5cd7ec,_0x53b7ca){_0x5cd7ec=_0x5cd7ec-0x0;var _0xbb1df7=_0x54ef[_0x5cd7ec];return _0xbb1df7;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 58ca4bf..65ca797 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x292eeb,_0x3dd9df){var _0x4e4d59=function(_0x3c6928){while(--_0x3c6928){_0x292eeb['push'](_0x292eeb['shift']());}};_0x4e4d59(++_0x3dd9df);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x219979,_0x42ecd9){_0x219979=_0x219979-0x0;var _0xf8eddf=_0x7a54[_0x219979];return _0xf8eddf;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 4de4d99..bfe13e5 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 _0xf61e=['../../config/environment','./openchannelAccount.controller','get','index','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/users','getAgents','create','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','/:id','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4f0bc3,_0x5185ba){var _0x277b9a=function(_0x35e0fb){while(--_0x35e0fb){_0x4f0bc3['push'](_0x4f0bc3['shift']());}};_0x277b9a(++_0x5185ba);}(_0xf61e,0x191));var _0xef61=function(_0x3a16e3,_0x514411){_0x3a16e3=_0x3a16e3-0x0;var _0x474c2f=_0xf61e[_0x3a16e3];return _0x474c2f;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require(_0xef61('0x3'));var express=require(_0xef61('0x4'));var router=express[_0xef61('0x5')]();var fs_extra=require(_0xef61('0x6'));var auth=require(_0xef61('0x7'));var interaction=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var controller=require(_0xef61('0xa'));router[_0xef61('0xb')]('/',auth['isAuthenticated'](),controller[_0xef61('0xc')]);router[_0xef61('0xb')]('/describe',auth[_0xef61('0xd')](),controller[_0xef61('0xe')]);router[_0xef61('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xef61('0xf')]);router[_0xef61('0xb')](_0xef61('0x10'),auth[_0xef61('0xd')](),controller[_0xef61('0x11')]);router[_0xef61('0xb')](_0xef61('0x12'),auth[_0xef61('0xd')](),controller[_0xef61('0x13')]);router[_0xef61('0xb')](_0xef61('0x14'),auth[_0xef61('0xd')](),controller[_0xef61('0x15')]);router[_0xef61('0xb')]('/:id/interactions',auth[_0xef61('0xd')](),controller['getInteractions']);router[_0xef61('0xb')](_0xef61('0x16'),auth[_0xef61('0xd')](),controller[_0xef61('0x17')]);router['post']('/',auth[_0xef61('0xd')](),controller[_0xef61('0x18')]);router[_0xef61('0x19')](_0xef61('0x10'),auth['isAuthenticated'](),controller[_0xef61('0x1a')]);router[_0xef61('0x19')]('/:id/canned_answers',auth[_0xef61('0xd')](),controller[_0xef61('0x1b')]);router[_0xef61('0x19')](_0xef61('0x1c'),controller[_0xef61('0x1d')]);router[_0xef61('0x19')](_0xef61('0x14'),auth['isAuthenticated'](),controller[_0xef61('0x1e')]);router[_0xef61('0x19')]('/:id/users',auth[_0xef61('0xd')](),controller[_0xef61('0x1f')]);router[_0xef61('0x19')](_0xef61('0x20'),auth[_0xef61('0xd')](),controller[_0xef61('0x21')]);router[_0xef61('0x22')]('/:id',auth['isAuthenticated'](),controller[_0xef61('0x23')]);router['delete'](_0xef61('0x24'),auth['isAuthenticated'](),controller['destroy']);router[_0xef61('0x25')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xef61('0x26')]);router[_0xef61('0x25')](_0xef61('0x12'),auth[_0xef61('0xd')](),controller['removeAnswers']);router[_0xef61('0x25')]('/:id/users',auth[_0xef61('0xd')](),controller[_0xef61('0x27')]);module[_0xef61('0x28')]=router; \ No newline at end of file +var _0x5f2f=['./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4e395b,_0x123684){var _0x7dd261=function(_0x5ef081){while(--_0x5ef081){_0x4e395b['push'](_0x4e395b['shift']());}};_0x7dd261(++_0x123684);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2cd408,_0x7ebfaf){_0x2cd408=_0x2cd408-0x0;var _0x417a26=_0x5f2f[_0x2cd408];return _0x417a26;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/canned_answers',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['get'](_0xf5f2('0x13'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);router[_0xf5f2('0x9')](_0xf5f2('0x15'),auth[_0xf5f2('0xa')](),controller['getInteractions']);router[_0xf5f2('0x9')](_0xf5f2('0x16'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x17')]);router[_0xf5f2('0x18')]('/',auth['isAuthenticated'](),controller[_0xf5f2('0x19')]);router[_0xf5f2('0x18')](_0xf5f2('0x10'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x18')](_0xf5f2('0x1b'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x18')](_0xf5f2('0x1d'),controller[_0xf5f2('0x1e')]);router[_0xf5f2('0x18')](_0xf5f2('0x13'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1f')]);router[_0xf5f2('0x18')]('/:id/users',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x20')]);router['post']('/:id/send',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x21')]);router['put'](_0xf5f2('0xe'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x22')]);router[_0xf5f2('0x23')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0x24')]);router[_0xf5f2('0x23')](_0xf5f2('0x10'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x25')]);router['delete']('/:id/canned_answers',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x26')]);router[_0xf5f2('0x23')](_0xf5f2('0x16'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x27')]);module[_0xf5f2('0x28')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 3b70937..f6ec317 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 _0xf793=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x30aaae,_0x2c24b3){var _0x1c8a18=function(_0x57c5b3){while(--_0x57c5b3){_0x30aaae['push'](_0x30aaae['shift']());}};_0x1c8a18(++_0x2c24b3);}(_0xf793,0x117));var _0x3f79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf793[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x3f79('0x0'));var rs=require('randomstring');module[_0x3f79('0x1')]={'name':{'type':Sequelize[_0x3f79('0x2')],'unique':_0x3f79('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x3f79('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x3f79('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3f79('0x4')],'defaultValue':function(){return _0x3f79('0x5');}},'notificationSound':{'type':Sequelize[_0x3f79('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3f79('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3f79('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3f79('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x3f79('0x2')]},'queueTransfer':{'type':Sequelize[_0x3f79('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3f79('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3f79('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3f79('0x6')],'defaultValue':![],'comment':_0x3f79('0x8'),'set':function(_0x170203){if(!_0x170203)this[_0x3f79('0x9')]('mandatoryDispositionPauseId',null);this[_0x3f79('0x9')](_0x3f79('0xa'),_0x170203);}}}; \ No newline at end of file +var _0x1eed=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','randomstring','exports','STRING','generate','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x12c98e,_0x2d0b4b){var _0x198b35=function(_0x26c881){while(--_0x26c881){_0x12c98e['push'](_0x12c98e['shift']());}};_0x198b35(++_0x2d0b4b);}(_0x1eed,0x189));var _0xd1ee=function(_0x3fb41c,_0x4aa926){_0x3fb41c=_0x3fb41c-0x0;var _0x2c12c9=_0x1eed[_0x3fb41c];return _0x2c12c9;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd1ee('0x0'));module[_0xd1ee('0x1')]={'name':{'type':Sequelize[_0xd1ee('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xd1ee('0x2')]},'token':{'type':Sequelize[_0xd1ee('0x2')],'defaultValue':function(){return rs[_0xd1ee('0x3')]();}},'replyUri':{'type':Sequelize[_0xd1ee('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd1ee('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd1ee('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd1ee('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xd1ee('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd1ee('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd1ee('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd1ee('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd1ee('0x4')],'defaultValue':![],'comment':_0xd1ee('0x6'),'set':function(_0x2a044c){if(!_0x2a044c)this['setDataValue'](_0xd1ee('0x7'),null);this[_0xd1ee('0x8')](_0xd1ee('0x9'),_0x2a044c);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 64902e0..7b40fc7 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 _0x6f46=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','http','client','request','info','debug','error','code','message','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','destroy','stack','name','Pause','mandatoryDispositionPause','OpenchannelAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','map','type','VIRTUAL','filter','merge','options','include','rows','params','rawAttributes','length','includeAll','find','create','body','user','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','pick','Disposition','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','CompanyId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','updatedAt','DESC','Applications','account','list','List','applications','orderBy','priority','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','startRouting','EventManager','notify','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','finally','sendStatus','send','getApplications','getInteractions','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','ListId','out','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x5cde25,_0xaecb63){var _0x33c9fd=function(_0x557cff){while(--_0x557cff){_0x5cde25['push'](_0x5cde25['shift']());}};_0x33c9fd(++_0xaecb63);}(_0x6f46,0xb8));var _0x66f4=function(_0x38bcf8,_0x11307d){_0x38bcf8=_0x38bcf8-0x0;var _0x2a035e=_0x6f46[_0x38bcf8];return _0x2a035e;};'use strict';var emlformat=require(_0x66f4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x66f4('0x1'));var jsonpatch=require(_0x66f4('0x2'));var rp=require(_0x66f4('0x3'));var moment=require(_0x66f4('0x4'));var BPromise=require(_0x66f4('0x5'));var Mustache=require(_0x66f4('0x6'));var util=require(_0x66f4('0x7'));var path=require(_0x66f4('0x8'));var sox=require(_0x66f4('0x9'));var csv=require(_0x66f4('0xa'));var ejs=require(_0x66f4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x66f4('0xc'));var crypto=require(_0x66f4('0xd'));var jsforce=require(_0x66f4('0xe'));var deskjs=require(_0x66f4('0xf'));var toCsv=require(_0x66f4('0xa'));var querystring=require(_0x66f4('0x10'));var Papa=require(_0x66f4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x66f4('0x12'));var as=require(_0x66f4('0x13'));var hardwareService=require(_0x66f4('0x14'));var logger=require(_0x66f4('0x15'))('api');var utils=require(_0x66f4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x66f4('0x17'));var db=require(_0x66f4('0x18'))['db'];config['redis']=_['defaults'](config[_0x66f4('0x19')],{'host':_0x66f4('0x1a'),'port':0x18eb});var socket=require(_0x66f4('0x1b'))(new Redis(config[_0x66f4('0x19')]));require(_0x66f4('0x1c'))['register'](socket);var jayson=require(_0x66f4('0x1d'));var client=jayson['client'][_0x66f4('0x1e')]({'port':0x232c});var client9002=jayson[_0x66f4('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e6971,_0x42058d,_0x6ce3fc,_0x45f714){return new BPromise(function(_0x8d4a5d,_0x1c8407){var _0x1adbc7=_0x45f714||client;return _0x1adbc7[_0x66f4('0x20')](_0x1e6971,_0x6ce3fc)['then'](function(_0x20b8f2){logger[_0x66f4('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x42058d,'request\x20sent');logger[_0x66f4('0x22')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x42058d,'request\x20sent',JSON['stringify'](_0x20b8f2));if(_0x20b8f2[_0x66f4('0x23')]){if(_0x20b8f2[_0x66f4('0x23')][_0x66f4('0x24')]===0x1f4){logger[_0x66f4('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x42058d,_0x20b8f2[_0x66f4('0x23')][_0x66f4('0x25')]);return _0x1c8407(_0x20b8f2[_0x66f4('0x23')]['message']);}logger['error'](_0x66f4('0x26'),_0x42058d,_0x20b8f2[_0x66f4('0x23')]['message']);return _0x8d4a5d(_0x20b8f2[_0x66f4('0x23')][_0x66f4('0x25')]);}else{logger[_0x66f4('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x42058d,_0x66f4('0x27'));_0x8d4a5d(_0x20b8f2[_0x66f4('0x28')][_0x66f4('0x25')]);}})[_0x66f4('0x29')](function(_0x145c9a){logger[_0x66f4('0x23')](_0x66f4('0x26'),_0x42058d,_0x145c9a);_0x1c8407(_0x145c9a);});});}function respondWithStatusCode(_0x48e0c3,_0x582d0e){_0x582d0e=_0x582d0e||0xcc;return function(_0x2904ec){if(_0x2904ec){return _0x48e0c3['sendStatus'](_0x582d0e);}return _0x48e0c3[_0x66f4('0x2a')](_0x582d0e)[_0x66f4('0x2b')]();};}function respondWithResult(_0x2a4cdc,_0x31131d){_0x31131d=_0x31131d||0xc8;return function(_0x307d34){if(_0x307d34){return _0x2a4cdc[_0x66f4('0x2a')](_0x31131d)[_0x66f4('0x2c')](_0x307d34);}};}function respondWithFilteredResult(_0x464a25,_0x24f02b){return function(_0x2d545b){if(_0x2d545b){var _0x5df22b=typeof _0x24f02b[_0x66f4('0x2d')]===_0x66f4('0x2e')&&typeof _0x24f02b[_0x66f4('0x2f')]===_0x66f4('0x2e');var _0x161dcd=_0x2d545b[_0x66f4('0x30')];var _0x56f398=_0x5df22b?0x0:_0x24f02b['offset'];var _0x5cae64=_0x5df22b?_0x2d545b[_0x66f4('0x30')]:_0x24f02b[_0x66f4('0x2d')]+_0x24f02b[_0x66f4('0x2f')];var _0xca40c2;if(_0x5cae64>=_0x161dcd){_0x5cae64=_0x161dcd;_0xca40c2=0xc8;}else{_0xca40c2=0xce;}_0x464a25[_0x66f4('0x2a')](_0xca40c2);return _0x464a25['set'](_0x66f4('0x31'),_0x56f398+'-'+_0x5cae64+'/'+_0x161dcd)[_0x66f4('0x2c')](_0x2d545b);}return null;};}function patchUpdates(_0x2149c5){return function(_0x4652af){try{jsonpatch[_0x66f4('0x32')](_0x4652af,_0x2149c5,!![]);}catch(_0xb35595){return BPromise[_0x66f4('0x33')](_0xb35595);}return _0x4652af[_0x66f4('0x34')]();};}function saveUpdates(_0x50ecf4,_0x4ec570){return function(_0x17406d){if(_0x17406d){return _0x17406d[_0x66f4('0x35')](_0x50ecf4)[_0x66f4('0x36')](function(_0xbc439b){return _0xbc439b;});}return null;};}function removeEntity(_0x91b977,_0x220e1e){return function(_0x4175f0){if(_0x4175f0){return _0x4175f0['destroy']()[_0x66f4('0x36')](function(){var _0x18cabb=_0x4175f0[_0x66f4('0x37')]({'plain':!![]});var _0x2874a4='OpenchannelAccounts';return db['UserProfileResource'][_0x66f4('0x38')]({'where':{'type':_0x2874a4,'resourceId':_0x18cabb['id']}})[_0x66f4('0x36')](function(){return _0x4175f0;});})[_0x66f4('0x36')](function(){_0x91b977['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x150c5c,_0x1a7845){return function(_0x1a06e3){if(!_0x1a06e3){_0x150c5c['sendStatus'](0x194);}return _0x1a06e3;};}function handleError(_0x16f159,_0x3f4bb){_0x3f4bb=_0x3f4bb||0x1f4;return function(_0x311e5d){logger[_0x66f4('0x23')](_0x311e5d[_0x66f4('0x39')]);if(_0x311e5d[_0x66f4('0x3a')]){delete _0x311e5d[_0x66f4('0x3a')];}_0x16f159[_0x66f4('0x2a')](_0x3f4bb)['send'](_0x311e5d);};}exports['index']=function(_0x2067bd,_0x1b54e8){var _0x39e8a6={'include':[{'model':db[_0x66f4('0x3b')],'as':_0x66f4('0x3c')}]},_0x21b7af={},_0x1b4834={'count':0x0,'rows':[]};var _0x10ef70=_['map'](db[_0x66f4('0x3d')]['rawAttributes'],function(_0x52e7e2){return{'name':_0x52e7e2[_0x66f4('0x3e')],'type':_0x52e7e2['type'][_0x66f4('0x3f')]};});_0x21b7af[_0x66f4('0x40')]=_['map'](_0x10ef70,'name');_0x21b7af[_0x66f4('0x41')]=_[_0x66f4('0x42')](_0x2067bd[_0x66f4('0x41')]);_0x21b7af[_0x66f4('0x43')]=_[_0x66f4('0x44')](_0x21b7af['model'],_0x21b7af['query']);_0x39e8a6[_0x66f4('0x45')]=_[_0x66f4('0x44')](_0x21b7af[_0x66f4('0x40')],qs[_0x66f4('0x46')](_0x2067bd[_0x66f4('0x41')]['fields']));_0x39e8a6[_0x66f4('0x45')]=_0x39e8a6[_0x66f4('0x45')]['length']?_0x39e8a6[_0x66f4('0x45')]:_0x21b7af[_0x66f4('0x40')];if(!_0x2067bd['query'][_0x66f4('0x47')](_0x66f4('0x48'))){_0x39e8a6[_0x66f4('0x2f')]=qs['limit'](_0x2067bd[_0x66f4('0x41')]['limit']);_0x39e8a6[_0x66f4('0x2d')]=qs['offset'](_0x2067bd[_0x66f4('0x41')][_0x66f4('0x2d')]);}_0x39e8a6[_0x66f4('0x49')]=qs[_0x66f4('0x4a')](_0x2067bd[_0x66f4('0x41')][_0x66f4('0x4a')]);_0x39e8a6[_0x66f4('0x4b')]=qs['filters'](_['pick'](_0x2067bd[_0x66f4('0x41')],_0x21b7af['filters']),_0x10ef70);if(_0x2067bd[_0x66f4('0x41')]['filter']){_0x39e8a6['where']=_['merge'](_0x39e8a6['where'],{'$or':_[_0x66f4('0x4c')](_0x10ef70,function(_0x5e0303){if(_0x5e0303[_0x66f4('0x4d')]!==_0x66f4('0x4e')){var _0x1991d7={};_0x1991d7[_0x5e0303[_0x66f4('0x3a')]]={'$like':'%'+_0x2067bd[_0x66f4('0x41')][_0x66f4('0x4f')]+'%'};return _0x1991d7;}})});}_0x39e8a6=_[_0x66f4('0x50')]({},_0x39e8a6,_0x2067bd[_0x66f4('0x51')]);var _0x157270={'where':_0x39e8a6[_0x66f4('0x4b')]};return db['OpenchannelAccount'][_0x66f4('0x30')](_0x157270)['then'](function(_0x5aee6c){_0x1b4834[_0x66f4('0x30')]=_0x5aee6c;if(_0x2067bd[_0x66f4('0x41')]['includeAll']){_0x39e8a6[_0x66f4('0x52')]=[{'all':!![]}];}return db[_0x66f4('0x3d')]['findAll'](_0x39e8a6);})[_0x66f4('0x36')](function(_0x381e77){_0x1b4834[_0x66f4('0x53')]=_0x381e77;return _0x1b4834;})[_0x66f4('0x36')](respondWithFilteredResult(_0x1b54e8,_0x39e8a6))['catch'](handleError(_0x1b54e8,null));};exports['show']=function(_0x3ed41b,_0x3991f9){var _0x2c040c={'raw':![],'where':{'id':_0x3ed41b[_0x66f4('0x54')]['id']},'include':[{'model':db[_0x66f4('0x3b')],'as':_0x66f4('0x3c')}]},_0x49962c={};_0x49962c[_0x66f4('0x40')]=_[_0x66f4('0x42')](db[_0x66f4('0x3d')][_0x66f4('0x55')]);_0x49962c[_0x66f4('0x41')]=_[_0x66f4('0x42')](_0x3ed41b['query']);_0x49962c[_0x66f4('0x43')]=_[_0x66f4('0x44')](_0x49962c[_0x66f4('0x40')],_0x49962c[_0x66f4('0x41')]);_0x2c040c['attributes']=_[_0x66f4('0x44')](_0x49962c[_0x66f4('0x40')],qs[_0x66f4('0x46')](_0x3ed41b[_0x66f4('0x41')][_0x66f4('0x46')]));_0x2c040c[_0x66f4('0x45')]=_0x2c040c[_0x66f4('0x45')][_0x66f4('0x56')]?_0x2c040c[_0x66f4('0x45')]:_0x49962c[_0x66f4('0x40')];if(_0x3ed41b[_0x66f4('0x41')][_0x66f4('0x57')]){_0x2c040c['include']=[{'all':!![]}];}_0x2c040c=_[_0x66f4('0x50')]({},_0x2c040c,_0x3ed41b[_0x66f4('0x51')]);return db[_0x66f4('0x3d')][_0x66f4('0x58')](_0x2c040c)[_0x66f4('0x36')](handleEntityNotFound(_0x3991f9,null))[_0x66f4('0x36')](respondWithResult(_0x3991f9,null))[_0x66f4('0x29')](handleError(_0x3991f9,null));};exports[_0x66f4('0x59')]=function(_0x109664,_0x236211){return db[_0x66f4('0x3d')][_0x66f4('0x59')](_0x109664[_0x66f4('0x5a')],{})[_0x66f4('0x36')](function(_0x50b412){var _0x3c90e3=_0x109664[_0x66f4('0x5b')][_0x66f4('0x37')]({'plain':!![]});if(!_0x3c90e3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c90e3[_0x66f4('0x5c')]==='user'){var _0xd7dc44=_0x50b412[_0x66f4('0x37')]({'plain':!![]});var _0x4cdedf=_0x66f4('0x5d');return db[_0x66f4('0x5e')][_0x66f4('0x58')]({'where':{'name':_0x4cdedf,'userProfileId':_0x3c90e3[_0x66f4('0x5f')]},'raw':!![]})['then'](function(_0x19f4e4){if(_0x19f4e4&&_0x19f4e4[_0x66f4('0x60')]===0x0){return db[_0x66f4('0x61')]['create']({'name':_0xd7dc44['name'],'resourceId':_0xd7dc44['id'],'type':_0x19f4e4[_0x66f4('0x3a')],'sectionId':_0x19f4e4['id']},{})[_0x66f4('0x36')](function(){return _0x50b412;});}else{return _0x50b412;}})[_0x66f4('0x29')](function(_0x296f70){logger[_0x66f4('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x296f70);throw _0x296f70;});}return _0x50b412;})['then'](respondWithResult(_0x236211,0xc9))['catch'](handleError(_0x236211,null));};exports['update']=function(_0x33a2d4,_0x10782f){if(_0x33a2d4['body']['id']){delete _0x33a2d4[_0x66f4('0x5a')]['id'];}return db[_0x66f4('0x3d')]['find']({'where':{'id':_0x33a2d4['params']['id']},'include':[{'model':db[_0x66f4('0x3b')],'as':_0x66f4('0x3c')}]})[_0x66f4('0x36')](handleEntityNotFound(_0x10782f,null))[_0x66f4('0x36')](saveUpdates(_0x33a2d4[_0x66f4('0x5a')],null))[_0x66f4('0x36')](respondWithResult(_0x10782f,null))[_0x66f4('0x29')](handleError(_0x10782f,null));};exports['destroy']=function(_0x227c97,_0x4f83d4){return db[_0x66f4('0x3d')][_0x66f4('0x58')]({'where':{'id':_0x227c97[_0x66f4('0x54')]['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x4f83d4,null))[_0x66f4('0x36')](removeEntity(_0x4f83d4,null))[_0x66f4('0x29')](handleError(_0x4f83d4,null));};exports[_0x66f4('0x62')]=function(_0xab39f9,_0x15139c){return db['OpenchannelAccount'][_0x66f4('0x62')]()[_0x66f4('0x36')](respondWithResult(_0x15139c,null))[_0x66f4('0x29')](handleError(_0x15139c,null));};exports[_0x66f4('0x63')]=function(_0x268429,_0x10ece5,_0x31a602){if(_0x268429[_0x66f4('0x5a')]['id']){delete _0x268429[_0x66f4('0x5a')]['id'];}return db['OpenchannelAccount'][_0x66f4('0x58')]({'where':{'id':_0x268429[_0x66f4('0x54')]['id']}})['then'](handleEntityNotFound(_0x10ece5,null))[_0x66f4('0x36')](function(_0x3337b6){if(_0x3337b6){_0x268429['body'][_0x66f4('0x64')]=_0x3337b6['id'];return db['Disposition'][_0x66f4('0x59')](_0x268429[_0x66f4('0x5a')]);}})[_0x66f4('0x36')](respondWithResult(_0x10ece5,null))[_0x66f4('0x29')](handleError(_0x10ece5,null));};exports[_0x66f4('0x65')]=function(_0xc96132,_0xee6f6e,_0xc2d28){var _0x59f75={'raw':![],'where':{}};var _0x2c5649={};var _0x55d3f3={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x66f4('0x66')]({'where':{'id':_0xc96132['params']['id']}})['then'](handleEntityNotFound(_0xee6f6e,null))['then'](function(_0x169357){if(_0x169357){_0x2c5649['model']=_[_0x66f4('0x42')](db['Disposition'][_0x66f4('0x55')]);_0x2c5649['query']=_['keys'](_0xc96132[_0x66f4('0x41')]);_0x2c5649[_0x66f4('0x43')]=_[_0x66f4('0x44')](_0x2c5649[_0x66f4('0x40')],_0x2c5649[_0x66f4('0x41')]);_0x59f75[_0x66f4('0x45')]=_[_0x66f4('0x44')](_0x2c5649[_0x66f4('0x40')],qs[_0x66f4('0x46')](_0xc96132[_0x66f4('0x41')][_0x66f4('0x46')]));_0x59f75[_0x66f4('0x45')]=_0x59f75[_0x66f4('0x45')]['length']?_0x59f75['attributes']:_0x2c5649['model'];if(!_0xc96132[_0x66f4('0x41')][_0x66f4('0x47')](_0x66f4('0x48'))){_0x59f75['limit']=qs['limit'](_0xc96132['query'][_0x66f4('0x2f')]);_0x59f75[_0x66f4('0x2d')]=qs[_0x66f4('0x2d')](_0xc96132['query'][_0x66f4('0x2d')]);}_0x59f75[_0x66f4('0x49')]=qs[_0x66f4('0x4a')](_0xc96132['query'][_0x66f4('0x4a')]);_0x59f75[_0x66f4('0x4b')]=qs[_0x66f4('0x43')](_[_0x66f4('0x67')](_0xc96132[_0x66f4('0x41')],_0x2c5649[_0x66f4('0x43')]));_0x59f75[_0x66f4('0x4b')]['OpenchannelAccountId']=_0x169357['id'];if(_0xc96132[_0x66f4('0x41')]['filter']){_0x59f75['where']=_[_0x66f4('0x50')](_0x59f75['where'],{'$or':_[_0x66f4('0x4c')](_0x59f75[_0x66f4('0x45')],function(_0x3fd2bb){var _0x54d90a={};_0x54d90a[_0x3fd2bb]={'$like':'%'+_0xc96132[_0x66f4('0x41')]['filter']+'%'};return _0x54d90a;})});}_0x59f75=_[_0x66f4('0x50')]({},_0x59f75,_0xc96132[_0x66f4('0x51')]);return db[_0x66f4('0x68')][_0x66f4('0x30')]({'where':_0x59f75[_0x66f4('0x4b')]})['then'](function(_0x1e81e3){_0x55d3f3[_0x66f4('0x30')]=_0x1e81e3;if(_0xc96132[_0x66f4('0x41')]['includeAll']){_0x59f75[_0x66f4('0x52')]=[{'all':!![]}];}return db[_0x66f4('0x68')][_0x66f4('0x69')](_0x59f75);})[_0x66f4('0x36')](function(_0xeb1d40){_0x55d3f3[_0x66f4('0x53')]=_0xeb1d40;return _0x55d3f3;});}})[_0x66f4('0x36')](respondWithFilteredResult(_0xee6f6e,_0x59f75))['catch'](handleError(_0xee6f6e,null));};exports[_0x66f4('0x6a')]=function(_0x1ac2a0,_0x5c785a,_0x187df4){return db['OpenchannelAccount']['find']({'where':{'id':_0x1ac2a0['params']['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x5c785a,null))[_0x66f4('0x36')](function(_0x13dc8d){if(_0x13dc8d){return _0x13dc8d[_0x66f4('0x6a')](_0x1ac2a0['query'][_0x66f4('0x6b')]);}})['then'](respondWithStatusCode(_0x5c785a,null))[_0x66f4('0x29')](handleError(_0x5c785a,null));};exports[_0x66f4('0x6c')]=function(_0x1e76e2,_0x42e133,_0x249734){if(_0x1e76e2[_0x66f4('0x5a')]['id']){delete _0x1e76e2[_0x66f4('0x5a')]['id'];}return db[_0x66f4('0x3d')][_0x66f4('0x58')]({'where':{'id':_0x1e76e2['params']['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x42e133,null))['then'](function(_0x1695a3){if(_0x1695a3){_0x1e76e2['body'][_0x66f4('0x64')]=_0x1695a3['id'];return db['CannedAnswer'][_0x66f4('0x59')](_0x1e76e2['body']);}})[_0x66f4('0x36')](respondWithResult(_0x42e133,null))[_0x66f4('0x29')](handleError(_0x42e133,null));};exports[_0x66f4('0x6d')]=function(_0x3c8048,_0x40294c,_0xda9d6c){var _0x4c94e2={'raw':![],'where':{}};var _0x1eca0b={};var _0x40d0fb={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x66f4('0x66')]({'where':{'id':_0x3c8048[_0x66f4('0x54')]['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x40294c,null))[_0x66f4('0x36')](function(_0x95976e){if(_0x95976e){_0x1eca0b[_0x66f4('0x40')]=_[_0x66f4('0x42')](db[_0x66f4('0x6e')][_0x66f4('0x55')]);_0x1eca0b[_0x66f4('0x41')]=_[_0x66f4('0x42')](_0x3c8048[_0x66f4('0x41')]);_0x1eca0b[_0x66f4('0x43')]=_[_0x66f4('0x44')](_0x1eca0b[_0x66f4('0x40')],_0x1eca0b['query']);_0x4c94e2[_0x66f4('0x45')]=_[_0x66f4('0x44')](_0x1eca0b[_0x66f4('0x40')],qs[_0x66f4('0x46')](_0x3c8048['query'][_0x66f4('0x46')]));_0x4c94e2['attributes']=_0x4c94e2[_0x66f4('0x45')][_0x66f4('0x56')]?_0x4c94e2[_0x66f4('0x45')]:_0x1eca0b[_0x66f4('0x40')];if(!_0x3c8048[_0x66f4('0x41')][_0x66f4('0x47')](_0x66f4('0x48'))){_0x4c94e2[_0x66f4('0x2f')]=qs[_0x66f4('0x2f')](_0x3c8048[_0x66f4('0x41')][_0x66f4('0x2f')]);_0x4c94e2[_0x66f4('0x2d')]=qs[_0x66f4('0x2d')](_0x3c8048['query'][_0x66f4('0x2d')]);}_0x4c94e2[_0x66f4('0x49')]=qs['sort'](_0x3c8048['query'][_0x66f4('0x4a')]);_0x4c94e2[_0x66f4('0x4b')]=qs[_0x66f4('0x43')](_[_0x66f4('0x67')](_0x3c8048[_0x66f4('0x41')],_0x1eca0b[_0x66f4('0x43')]));_0x4c94e2[_0x66f4('0x4b')][_0x66f4('0x64')]=_0x95976e['id'];if(_0x3c8048[_0x66f4('0x41')][_0x66f4('0x4f')]){_0x4c94e2[_0x66f4('0x4b')]=_[_0x66f4('0x50')](_0x4c94e2[_0x66f4('0x4b')],{'$or':_[_0x66f4('0x4c')](_0x4c94e2[_0x66f4('0x45')],function(_0x18d2a4){var _0x17356a={};_0x17356a[_0x18d2a4]={'$like':'%'+_0x3c8048['query'][_0x66f4('0x4f')]+'%'};return _0x17356a;})});}_0x4c94e2=_[_0x66f4('0x50')]({},_0x4c94e2,_0x3c8048[_0x66f4('0x51')]);return db['CannedAnswer'][_0x66f4('0x30')]({'where':_0x4c94e2['where']})[_0x66f4('0x36')](function(_0x28d411){_0x40d0fb[_0x66f4('0x30')]=_0x28d411;if(_0x3c8048['query'][_0x66f4('0x57')]){_0x4c94e2[_0x66f4('0x52')]=[{'all':!![]}];}return db[_0x66f4('0x6e')]['findAll'](_0x4c94e2);})[_0x66f4('0x36')](function(_0x16adba){_0x40d0fb[_0x66f4('0x53')]=_0x16adba;return _0x40d0fb;});}})[_0x66f4('0x36')](respondWithFilteredResult(_0x40294c,_0x4c94e2))[_0x66f4('0x29')](handleError(_0x40294c,null));};exports[_0x66f4('0x6f')]=function(_0x21222a,_0x53903a,_0x4a3f21){return db['OpenchannelAccount'][_0x66f4('0x58')]({'where':{'id':_0x21222a[_0x66f4('0x54')]['id']}})['then'](handleEntityNotFound(_0x53903a,null))[_0x66f4('0x36')](function(_0x4b1338){if(_0x4b1338){return _0x4b1338['removeAnswers'](_0x21222a[_0x66f4('0x41')]['ids']);}})[_0x66f4('0x36')](respondWithStatusCode(_0x53903a,null))[_0x66f4('0x29')](handleError(_0x53903a,null));};exports['notify']=function(_0xf6ea2b,_0x3052ba,_0x460950){var _0x5dce0b={'body':_0xf6ea2b[_0x66f4('0x5a')],'channel':_0x66f4('0x70')};var _0xdadbc8=[];var _0x482aa4=[];var _0x507f9b={};var _0x1174d4=![];return db[_0x66f4('0x71')][_0x66f4('0x62')]()[_0x66f4('0x36')](function(_0x43eb77){if(!_0x43eb77){throw new db[(_0x66f4('0x72'))][(_0x66f4('0x73'))](_0x66f4('0x74'));}_0xdadbc8=_['difference'](_['keys'](_0x43eb77),[_0x66f4('0x75'),'updatedAt']);_0x482aa4=_[_0x66f4('0x76')](_[_0x66f4('0x42')](_0x43eb77),['createdAt','updatedAt',_0x66f4('0x77'),'ListId']);if(_0xf6ea2b[_0x66f4('0x5a')]['id']){delete _0xf6ea2b[_0x66f4('0x5a')]['id'];}if(_[_0x66f4('0x78')](_0xf6ea2b[_0x66f4('0x5a')]['from'])){throw new db[(_0x66f4('0x72'))][(_0x66f4('0x73'))](_0x66f4('0x79'));}if(_['isNil'](_0xf6ea2b['body'][_0x66f4('0x5a')])||_0xf6ea2b[_0x66f4('0x5a')]['body']===''){throw new db[(_0x66f4('0x72'))][(_0x66f4('0x73'))](_0x66f4('0x7a'));}if(_[_0x66f4('0x78')](_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x7b')])){throw new db['Sequelize'][(_0x66f4('0x73'))](_0x66f4('0x7c')+_0x482aa4);}if(!_[_0x66f4('0x7d')](_0x482aa4,_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x7b')])){throw new db[(_0x66f4('0x72'))][(_0x66f4('0x73'))](_0x66f4('0x7e')+_0x482aa4);}_0x507f9b[_0xf6ea2b['body'][_0x66f4('0x7b')]]=_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x7f')];})[_0x66f4('0x36')](function(){return db[_0x66f4('0x3d')]['find']({'where':{'id':_0xf6ea2b[_0x66f4('0x54')]['id']},'include':[{'model':db[_0x66f4('0x80')],'as':'List','include':[{'model':db['CmContact'],'as':_0x66f4('0x81'),'where':_0x507f9b,'limit':0x1,'order':[[_0x66f4('0x82'),_0x66f4('0x83')]]}]},{'model':db['OpenchannelApplication'],'as':_0x66f4('0x84')}]});})[_0x66f4('0x36')](handleEntityNotFound(_0x3052ba,null))['then'](function(_0x4337c7){if(_0x4337c7&&_0x4337c7['List']){_0x5dce0b[_0x66f4('0x85')]=_0x4337c7;_0x5dce0b['applications']=_0x4337c7[_0x66f4('0x84')];_0x5dce0b[_0x66f4('0x86')]=_0x4337c7[_0x66f4('0x87')];_0x5dce0b[_0x66f4('0x88')]=_[_0x66f4('0x89')](_0x5dce0b['applications'],[_0x66f4('0x8a')],['asc']);if(_0x5dce0b[_0x66f4('0x85')]['Applications']){delete _0x5dce0b[_0x66f4('0x85')]['Applications'];}if(_0x5dce0b[_0x66f4('0x85')]['List']&&_0x5dce0b[_0x66f4('0x85')]['List'][_0x66f4('0x81')][_0x66f4('0x56')]){return _0x5dce0b[_0x66f4('0x85')][_0x66f4('0x87')][_0x66f4('0x81')][0x0];}var _0x23ffd5=_[_0x66f4('0x8b')](_0xf6ea2b[_0x66f4('0x5a')],{'firstName':_0xf6ea2b[_0x66f4('0x5a')]['from'],'ListId':_0x4337c7['ListId']});_0x23ffd5[_0xf6ea2b['body']['mapKey']]=_0xf6ea2b['body'][_0x66f4('0x7f')];return db['CmContact'][_0x66f4('0x59')](_0x23ffd5,{'fields':_0xdadbc8,'raw':!![]});}})[_0x66f4('0x36')](handleEntityNotFound(_0x3052ba,null))[_0x66f4('0x36')](function(_0x4d0ccf){_0x5dce0b[_0x66f4('0x8c')]=_0x4d0ccf;if(_0x4d0ccf){var _0x1c60d5={'ContactId':_0x4d0ccf['id'],'OpenchannelAccountId':_0xf6ea2b[_0x66f4('0x54')]['id'],'from':(_0x4d0ccf[_0x66f4('0x8d')]||'')+'\x20'+(_0x4d0ccf[_0x66f4('0x8e')]||'')};var _0x2bb509={'OpenchannelAccountId':_0xf6ea2b[_0x66f4('0x54')]['id'],'closed':![]};if(_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x8f')]){_0x2bb509[_0x66f4('0x8f')]=_0xf6ea2b[_0x66f4('0x5a')]['threadId'];return db[_0x66f4('0x90')][_0x66f4('0x58')]({'where':_0x2bb509})[_0x66f4('0x36')](function(_0x5e9b35){if(_0x5e9b35){return[_0x5e9b35,![]];}_0x1c60d5[_0x66f4('0x8f')]=_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x8f')];_0x1c60d5['externalUrl']=_0xf6ea2b['body'][_0x66f4('0x91')];return db[_0x66f4('0x90')][_0x66f4('0x59')](_0x1c60d5)[_0x66f4('0x36')](function(_0x26de43){return[_0x26de43,!![]];});});}else{_0x2bb509['threadId']=null;}_0x2bb509[_0x66f4('0x92')]=_0x4d0ccf['id'];return db[_0x66f4('0x90')][_0x66f4('0x58')]({'where':_0x2bb509})['then'](function(_0x22086d){if(_0x22086d){return[_0x22086d,![]];}return db['OpenchannelInteraction'][_0x66f4('0x59')](_0x1c60d5)[_0x66f4('0x36')](function(_0x87a54e){return[_0x87a54e,!![]];});});}})[_0x66f4('0x93')](function(_0x20a3af,_0x3e4924){if(_0x20a3af){_0x1174d4=_0x3e4924;if(!_0x3e4924){var _0x2d796a={'from':(_0x5dce0b[_0x66f4('0x8c')]['firstName']||'')+'\x20'+(_0x5dce0b[_0x66f4('0x8c')]['lastName']||'')};if(_0xf6ea2b['body']['threadId']&&_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x94')]&&_0xf6ea2b['body'][_0x66f4('0x8f')]!=_0xf6ea2b['body'][_0x66f4('0x94')]){_0x2d796a[_0x66f4('0x8f')]=_0xf6ea2b[_0x66f4('0x5a')]['messageId'];}return _0x20a3af['update'](_0x2d796a);}else{return _0x20a3af;}}})[_0x66f4('0x36')](function(_0x2cb445){_0x5dce0b[_0x66f4('0x95')]=_0x2cb445['get']({'plain':!![]});_0x5dce0b[_0x66f4('0x95')]['created']=_0x1174d4;if(_0x5dce0b[_0x66f4('0x95')][_0x66f4('0x96')]){if(_0x5dce0b['account'][_0x66f4('0x97')]){_0x5dce0b[_0x66f4('0x88')][_0x66f4('0x98')]({'id':0x0,'priority':_0x5dce0b['applications']['length']+0x1,'app':_0x66f4('0x99'),'appdata':'unmanaged','interval':_0x66f4('0x9a')});}}return db[_0x66f4('0x9b')][_0x66f4('0x59')]({'body':_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x5a')],'OpenchannelAccountId':_0xf6ea2b[_0x66f4('0x54')]['id'],'OpenchannelInteractionId':_0x2cb445['id'],'direction':'in','ContactId':_0x5dce0b[_0x66f4('0x8c')]['id'],'AttachmentId':_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x9c')]});})[_0x66f4('0x36')](function(_0x2d4471){_0x5dce0b['message']=_0x2d4471;if(!_0x5dce0b['interaction']['UserId'])return;return db[_0x66f4('0x9d')][_0x66f4('0x58')]({'attributes':['id','name'],'where':{'id':_0x5dce0b[_0x66f4('0x95')]['UserId']}});})[_0x66f4('0x36')](function(_0x4254e5){if(_0x4254e5){_0x5dce0b[_0x66f4('0x88')][_0x66f4('0x9e')]({'id':0x0,'priority':0x0,'app':_0x66f4('0x9f'),'appdata':_0x4254e5[_0x66f4('0x3a')]+','+(_0x5dce0b[_0x66f4('0x85')][_0x66f4('0xa0')]||0xa),'interval':_0x66f4('0x9a')});}if(!_0x5dce0b['interaction'][_0x66f4('0xa1')])return;return db[_0x66f4('0xa2')][_0x66f4('0x58')]({'attributes':['id',_0x66f4('0x3a')],'where':{'id':_0x5dce0b['interaction'][_0x66f4('0xa1')]}});})[_0x66f4('0x36')](function(_0xd29272){if(_0xd29272){_0x5dce0b[_0x66f4('0x88')][_0x66f4('0x9e')]({'id':0x0,'priority':0x1,'app':_0x66f4('0xa3'),'appdata':_0xd29272[_0x66f4('0x3a')]+','+(_0x5dce0b['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x66f4('0x9a')});}return respondWithRpcPromise('Start',_0x66f4('0xa4'),_0x5dce0b);})[_0x66f4('0x36')](function(_0x5ebcb2){respondWithRpcPromise(_0x66f4('0xa5'),_0x66f4('0xa5'),{'event':_0x66f4('0xa6'),'message':_0x5ebcb2},client9002);return _0x5ebcb2;})['then'](respondWithResult(_0x3052ba,null))[_0x66f4('0x29')](handleError(_0x3052ba,null));};exports[_0x66f4('0xa7')]=function(_0x1578e2,_0x263216){var _0x2f2088=_0x1578e2[_0x66f4('0x54')]['id'];var _0x5497b7=_0x1578e2[_0x66f4('0x5a')];var _0x5eff23=0xc8;var _0x2520af=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x66f4('0xa8')][_0x66f4('0xa9')][_0x66f4('0xaa')][_0x66f4('0xab')]},function(_0x542763){return db['OpenchannelAccount'][_0x66f4('0x66')]({'where':{'id':_0x2f2088},'transaction':_0x542763})[_0x66f4('0x36')](function(_0x37d82d){if(_0x37d82d){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x2f2088},'transaction':_0x542763})['then'](function(){var _0x3b338f=_[_0x66f4('0x4c')](_0x5497b7,function(_0x3ae36c){_0x3ae36c[_0x66f4('0x64')]=_0x2f2088;return _0x3ae36c;});return db[_0x66f4('0xac')][_0x66f4('0xad')](_0x3b338f,{'transaction':_0x542763});});}else{_0x5eff23=0x194;_0x2520af=[];}});})[_0x66f4('0x36')](function(){if(_0x5eff23!==0x194){return db[_0x66f4('0xac')][_0x66f4('0xae')]({'where':{'OpenchannelAccountId':_0x2f2088},'order':_0x66f4('0x8a')})[_0x66f4('0x36')](function(_0x154235){_0x2520af=_0x154235;});}})[_0x66f4('0x29')](function(_0x257906){_0x5eff23=0x1f4;logger[_0x66f4('0x23')](_0x257906[_0x66f4('0x39')]);if(_0x257906[_0x66f4('0x3a')]){delete _0x257906[_0x66f4('0x3a')];}_0x2520af=_0x257906;})[_0x66f4('0xaf')](function(){if(_0x2520af===null){_0x263216[_0x66f4('0xb0')](_0x5eff23);}else{if(_0x5eff23===0x1f4){_0x263216[_0x66f4('0x2a')](_0x5eff23)[_0x66f4('0xb1')](_0x2520af);}else{_0x263216[_0x66f4('0x2a')](_0x5eff23)[_0x66f4('0x2c')](_0x2520af);}}});};exports[_0x66f4('0xb2')]=function(_0x4fb1fc,_0x3e83ad,_0x5bf2ba){var _0x200f45={};var _0x4210e8={};var _0x49de7f;var _0x54e9c8;return db[_0x66f4('0x3d')][_0x66f4('0x66')]({'where':{'id':_0x4fb1fc[_0x66f4('0x54')]['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x3e83ad,null))[_0x66f4('0x36')](function(_0x3a4860){if(_0x3a4860){_0x49de7f=_0x3a4860;_0x4210e8[_0x66f4('0x40')]=_['keys'](db[_0x66f4('0xac')][_0x66f4('0x55')]);_0x4210e8['query']=_['keys'](_0x4fb1fc[_0x66f4('0x41')]);_0x4210e8[_0x66f4('0x43')]=_[_0x66f4('0x44')](_0x4210e8['model'],_0x4210e8[_0x66f4('0x41')]);_0x200f45[_0x66f4('0x45')]=_[_0x66f4('0x44')](_0x4210e8[_0x66f4('0x40')],qs[_0x66f4('0x46')](_0x4fb1fc[_0x66f4('0x41')]['fields']));_0x200f45[_0x66f4('0x45')]=_0x200f45['attributes'][_0x66f4('0x56')]?_0x200f45[_0x66f4('0x45')]:_0x4210e8['model'];_0x200f45[_0x66f4('0x49')]=qs[_0x66f4('0x4a')](_0x4fb1fc[_0x66f4('0x41')][_0x66f4('0x4a')]);_0x200f45['where']=qs[_0x66f4('0x43')](_[_0x66f4('0x67')](_0x4fb1fc[_0x66f4('0x41')],_0x4210e8[_0x66f4('0x43')]));if(_0x4fb1fc[_0x66f4('0x41')]['filter']){_0x200f45[_0x66f4('0x4b')]=_[_0x66f4('0x50')](_0x200f45[_0x66f4('0x4b')],{'$or':_[_0x66f4('0x4c')](_0x200f45[_0x66f4('0x45')],function(_0x27da25){var _0x4b229b={};_0x4b229b[_0x27da25]={'$like':'%'+_0x4fb1fc[_0x66f4('0x41')][_0x66f4('0x4f')]+'%'};return _0x4b229b;})});}_0x200f45=_['merge']({},_0x200f45,_0x4fb1fc[_0x66f4('0x51')]);return _0x49de7f[_0x66f4('0xb2')](_0x200f45);}})[_0x66f4('0x36')](function(_0x2239f0){if(_0x2239f0){_0x54e9c8=_0x2239f0[_0x66f4('0x56')];if(!_0x4fb1fc['query'][_0x66f4('0x47')](_0x66f4('0x48'))){_0x200f45[_0x66f4('0x2f')]=qs[_0x66f4('0x2f')](_0x4fb1fc[_0x66f4('0x41')][_0x66f4('0x2f')]);_0x200f45[_0x66f4('0x2d')]=qs['offset'](_0x4fb1fc['query'][_0x66f4('0x2d')]);}return _0x49de7f[_0x66f4('0xb2')](_0x200f45);}})['then'](function(_0x13be28){if(_0x13be28){return _0x13be28?{'count':_0x54e9c8,'rows':_0x13be28}:null;}})[_0x66f4('0x36')](respondWithResult(_0x3e83ad,null))[_0x66f4('0x29')](handleError(_0x3e83ad,null));};exports[_0x66f4('0xb3')]=function(_0x100b78,_0x331fb3,_0xeba647){var _0x47ca7f={'raw':![],'where':{}};var _0x5a61c6={};var _0x57b590={'count':0x0,'rows':[]};return db[_0x66f4('0x3d')]['findOne']({'where':{'id':_0x100b78[_0x66f4('0x54')]['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x331fb3,null))[_0x66f4('0x36')](function(_0x2b2f2b){if(_0x2b2f2b){_0x5a61c6['model']=_[_0x66f4('0x42')](db[_0x66f4('0x90')][_0x66f4('0x55')]);_0x5a61c6['query']=_[_0x66f4('0x42')](_0x100b78[_0x66f4('0x41')]);_0x5a61c6['filters']=_['intersection'](_0x5a61c6['model'],_0x5a61c6[_0x66f4('0x41')]);_0x47ca7f[_0x66f4('0x45')]=_[_0x66f4('0x44')](_0x5a61c6[_0x66f4('0x40')],qs['fields'](_0x100b78[_0x66f4('0x41')][_0x66f4('0x46')]));_0x47ca7f[_0x66f4('0x45')]=_0x47ca7f[_0x66f4('0x45')][_0x66f4('0x56')]?_0x47ca7f[_0x66f4('0x45')]:_0x5a61c6[_0x66f4('0x40')];if(!_0x100b78['query']['hasOwnProperty']('nolimit')){_0x47ca7f[_0x66f4('0x2f')]=qs[_0x66f4('0x2f')](_0x100b78[_0x66f4('0x41')][_0x66f4('0x2f')]);_0x47ca7f['offset']=qs[_0x66f4('0x2d')](_0x100b78[_0x66f4('0x41')][_0x66f4('0x2d')]);}_0x47ca7f[_0x66f4('0x49')]=qs[_0x66f4('0x4a')](_0x100b78[_0x66f4('0x41')][_0x66f4('0x4a')]);_0x47ca7f[_0x66f4('0x4b')]=qs[_0x66f4('0x43')](_[_0x66f4('0x67')](_0x100b78[_0x66f4('0x41')],_0x5a61c6[_0x66f4('0x43')]));_0x47ca7f[_0x66f4('0x4b')]['OpenchannelAccountId']=_0x2b2f2b['id'];if(_0x100b78[_0x66f4('0x41')]['filter']){_0x47ca7f[_0x66f4('0x4b')]=_[_0x66f4('0x50')](_0x47ca7f[_0x66f4('0x4b')],{'$or':_[_0x66f4('0x4c')](_0x47ca7f[_0x66f4('0x45')],function(_0x187215){var _0x493ba6={};_0x493ba6[_0x187215]={'$like':'%'+_0x100b78[_0x66f4('0x41')][_0x66f4('0x4f')]+'%'};return _0x493ba6;})});}_0x47ca7f=_[_0x66f4('0x50')]({},_0x47ca7f,_0x100b78[_0x66f4('0x51')]);return db['OpenchannelInteraction'][_0x66f4('0x30')]({'where':_0x47ca7f[_0x66f4('0x4b')]})[_0x66f4('0x36')](function(_0x31599a){_0x57b590[_0x66f4('0x30')]=_0x31599a;if(_0x100b78[_0x66f4('0x41')][_0x66f4('0x57')]){_0x47ca7f['include']=[{'model':db[_0x66f4('0x71')],'as':'Contact','required':![]},{'model':db[_0x66f4('0x9d')],'as':'Owner','attributes':[_0x66f4('0x3a'),_0x66f4('0xb4'),_0x66f4('0xb5')],'required':![]},{'model':db[_0x66f4('0xb6')],'as':_0x66f4('0xb7'),'attributes':['id',_0x66f4('0x3a'),_0x66f4('0xb8')],'where':_0x100b78[_0x66f4('0x41')][_0x66f4('0xb9')]?{'id':_0x100b78[_0x66f4('0x41')][_0x66f4('0xb9')]}:undefined,'required':_0x100b78[_0x66f4('0x41')][_0x66f4('0xb9')]?!![]:![]}];}return db[_0x66f4('0x90')]['findAll'](_0x47ca7f);})[_0x66f4('0x36')](function(_0x49feff){_0x57b590[_0x66f4('0x53')]=_0x49feff;return _0x57b590;});}})[_0x66f4('0x36')](respondWithFilteredResult(_0x331fb3,_0x47ca7f))['catch'](handleError(_0x331fb3,null));};exports[_0x66f4('0xba')]=function(_0xda13db,_0x5135a1,_0x111e98){return db['OpenchannelAccount'][_0x66f4('0x58')]({'where':{'id':_0xda13db[_0x66f4('0x54')]['id']}})['then'](handleEntityNotFound(_0x5135a1,null))[_0x66f4('0x36')](function(_0x4c0653){if(_0x4c0653){return _0x4c0653['addAgents'](_0xda13db['body']['ids'],_[_0x66f4('0xbb')](_0xda13db['body'],[_0x66f4('0x6b'),'id'])||{})[_0x66f4('0x93')](function(_0x777b95){for(var _0x397056=0x0;_0x397056<_0xda13db['body'][_0x66f4('0x6b')]['length'];_0x397056+=0x1){socket[_0x66f4('0xbc')]('userOpenchannelAccount:save',{'UserId':Number(_0xda13db[_0x66f4('0x5a')][_0x66f4('0x6b')][_0x397056]),'OpenchannelAccountId':Number(_0xda13db[_0x66f4('0x54')]['id'])});}return _0x777b95;});}})[_0x66f4('0x36')](respondWithResult(_0x5135a1,null))[_0x66f4('0x29')](handleError(_0x5135a1,null));};exports[_0x66f4('0xbd')]=function(_0x7c63a3,_0x3a47d0,_0x1bf9a7){return db[_0x66f4('0x3d')][_0x66f4('0x58')]({'where':{'id':_0x7c63a3['params']['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x3a47d0,null))[_0x66f4('0x36')](function(_0x7005c){if(_0x7005c){return _0x7005c[_0x66f4('0xbd')](_0x7c63a3[_0x66f4('0x41')][_0x66f4('0x6b')])[_0x66f4('0x36')](function(){if(_[_0x66f4('0xbe')](_0x7c63a3[_0x66f4('0x41')]['ids'])){for(var _0x4c7ad4=0x0;_0x4c7ad4<_0x7c63a3[_0x66f4('0x41')][_0x66f4('0x6b')]['length'];_0x4c7ad4+=0x1){socket[_0x66f4('0xbc')]('userOpenchannelAccount:remove',{'UserId':Number(_0x7c63a3[_0x66f4('0x41')][_0x66f4('0x6b')][_0x4c7ad4]),'OpenchannelAccountId':Number(_0x7c63a3[_0x66f4('0x54')]['id'])});}}else{socket[_0x66f4('0xbc')](_0x66f4('0xbf'),{'UserId':Number(_0x7c63a3[_0x66f4('0x41')]['ids']),'OpenchannelAccountId':Number(_0x7c63a3[_0x66f4('0x54')]['id'])});}});}})[_0x66f4('0x36')](respondWithStatusCode(_0x3a47d0,null))[_0x66f4('0x29')](handleError(_0x3a47d0,null));};exports[_0x66f4('0xc0')]=function(_0x3d025d,_0x84e0e6,_0x496cce){var _0xa4094e={};var _0x18140b={};var _0xc6e972;var _0x553ffd;return db[_0x66f4('0x3d')][_0x66f4('0x66')]({'where':{'id':_0x3d025d[_0x66f4('0x54')]['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x84e0e6,null))[_0x66f4('0x36')](function(_0x18e3ac){if(_0x18e3ac){_0xc6e972=_0x18e3ac;_0x18140b[_0x66f4('0x40')]=_[_0x66f4('0x42')](db[_0x66f4('0x9d')][_0x66f4('0x55')]);_0x18140b['query']=_[_0x66f4('0x42')](_0x3d025d[_0x66f4('0x41')]);_0x18140b[_0x66f4('0x43')]=_['intersection'](_0x18140b['model'],_0x18140b[_0x66f4('0x41')]);_0xa4094e[_0x66f4('0x45')]=_[_0x66f4('0x44')](_0x18140b[_0x66f4('0x40')],qs['fields'](_0x3d025d[_0x66f4('0x41')][_0x66f4('0x46')]));_0xa4094e[_0x66f4('0x45')]=_0xa4094e[_0x66f4('0x45')]['length']?_0xa4094e['attributes']:_0x18140b[_0x66f4('0x40')];_0xa4094e[_0x66f4('0x49')]=qs[_0x66f4('0x4a')](_0x3d025d[_0x66f4('0x41')]['sort']);_0xa4094e[_0x66f4('0x4b')]=qs['filters'](_['pick'](_0x3d025d[_0x66f4('0x41')],_0x18140b[_0x66f4('0x43')]));if(_0x3d025d[_0x66f4('0x41')][_0x66f4('0x4f')]){_0xa4094e['where']=_[_0x66f4('0x50')](_0xa4094e[_0x66f4('0x4b')],{'$or':_[_0x66f4('0x4c')](_0xa4094e[_0x66f4('0x45')],function(_0x35ed39){var _0x5cac9d={};_0x5cac9d[_0x35ed39]={'$like':'%'+_0x3d025d['query'][_0x66f4('0x4f')]+'%'};return _0x5cac9d;})});}_0xa4094e=_[_0x66f4('0x50')]({},_0xa4094e,_0x3d025d[_0x66f4('0x51')]);return _0xc6e972[_0x66f4('0xc0')](_0xa4094e);}})[_0x66f4('0x36')](function(_0x5af59b){if(_0x5af59b){_0x553ffd=_0x5af59b[_0x66f4('0x56')];if(!_0x3d025d[_0x66f4('0x41')]['hasOwnProperty']('nolimit')){_0xa4094e[_0x66f4('0x2f')]=qs[_0x66f4('0x2f')](_0x3d025d[_0x66f4('0x41')][_0x66f4('0x2f')]);_0xa4094e['offset']=qs['offset'](_0x3d025d[_0x66f4('0x41')]['offset']);}return _0xc6e972['getAgents'](_0xa4094e);}})[_0x66f4('0x36')](function(_0xed8867){if(_0xed8867){return _0xed8867?{'count':_0x553ffd,'rows':_0xed8867}:null;}})[_0x66f4('0x36')](respondWithResult(_0x84e0e6,null))['catch'](handleError(_0x84e0e6,null));};exports[_0x66f4('0xb1')]=function(_0x2c9ac6,_0x567120,_0x4519b4){var _0xfa5239,_0x1bb2b6,_0x3b8f52;if(_['isNil'](_0x2c9ac6[_0x66f4('0x5a')]['body'])||_0x2c9ac6[_0x66f4('0x5a')]['body']===''){throw new db[(_0x66f4('0x72'))][(_0x66f4('0x73'))](_0x66f4('0x7a'));}if(_[_0x66f4('0x78')](_0x2c9ac6[_0x66f4('0x5a')]['to'])){}_0xfa5239=_0x2c9ac6[_0x66f4('0x5a')]['to'];return db['OpenchannelAccount'][_0x66f4('0x66')]({'where':{'id':_0x2c9ac6['params']['id']}})['then'](handleEntityNotFound(_0x567120,null))[_0x66f4('0x36')](function(_0x234cb3){if(_0x234cb3){return db[_0x66f4('0x3d')][_0x66f4('0x58')]({'where':{'id':_0x234cb3['id']},'include':[{'model':db[_0x66f4('0x80')],'as':_0x66f4('0x87'),'include':[{'model':db[_0x66f4('0x71')],'as':_0x66f4('0x81'),'where':{[_0x234cb3[_0x66f4('0x7b')]]:_0xfa5239},'limit':0x1,'order':[[_0x66f4('0x82'),_0x66f4('0x83')]]}]}]})[_0x66f4('0x36')](handleEntityNotFound(_0x567120,null))[_0x66f4('0x36')](function(_0x5077ff){if(_0x5077ff&&_0x5077ff[_0x66f4('0x87')]){_0x1bb2b6=_0x5077ff[_0x66f4('0x37')]({'plain':!![]});if(_0x1bb2b6[_0x66f4('0x87')]&&_0x1bb2b6[_0x66f4('0x87')][_0x66f4('0x81')][_0x66f4('0x56')]){return _0x1bb2b6[_0x66f4('0x87')]['Contacts'][0x0];}return db['CmContact'][_0x66f4('0x59')](_['defaults'](_0x2c9ac6[_0x66f4('0x5a')],{'firstName':_0xfa5239,[_0x5077ff['mapKey']]:_0xfa5239,'phone':_0xfa5239,'ListId':_0x1bb2b6[_0x66f4('0xc1')]}));}})[_0x66f4('0x36')](handleEntityNotFound(_0x567120,null))['then'](function(_0x4a77fe){if(_0x4a77fe){_0x3b8f52=_0x4a77fe;return db[_0x66f4('0x90')]['find']({'where':{'ContactId':_0x3b8f52['id'],'closed':![],'OpenchannelAccountId':_0x1bb2b6['id']}})[_0x66f4('0x36')](function(_0x1661f4){if(_0x1661f4){return[_0x1661f4,![]];}return db[_0x66f4('0x90')]['create']({'UserId':_0x2c9ac6['user']['id'],'ContactId':_0x3b8f52['id'],'OpenchannelAccountId':_0x1bb2b6['id'],'lastMsgDirection':_0x66f4('0xc2'),'firstMsgDirection':_0x66f4('0xc2'),'Messages':[_[_0x66f4('0x50')](_0x2c9ac6['body'],{'read':![],'body':_0x2c9ac6[_0x66f4('0x5a')]['body'],'OpenchannelAccountId':_0x1bb2b6['id'],'UserId':_0x2c9ac6[_0x66f4('0x5b')]['id'],'ContactId':_0x3b8f52['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0x66f4('0x36')](function(_0x3c5b14){return[_0x3c5b14,!![]];});});}})[_0x66f4('0x93')](function(_0x5743ee,_0x408ffe){if(_0x408ffe){return _0x5743ee;}return db[_0x66f4('0x9b')][_0x66f4('0x59')](_[_0x66f4('0x50')](_0x2c9ac6[_0x66f4('0x5a')],{'read':![],'body':_0x2c9ac6[_0x66f4('0x5a')][_0x66f4('0x5a')],'OpenchannelAccountId':_0x1bb2b6['id'],'OpenchannelInteractionId':_0x5743ee['id'],'UserId':_0x2c9ac6[_0x66f4('0x5b')]['id'],'ContactId':_0x3b8f52['id']}))['then'](function(_0x4cd340){_0x5743ee[_0x66f4('0xc3')]['Messages']=[];_0x5743ee[_0x66f4('0xc3')]['Messages']['push'](_0x4cd340['dataValues']);return _0x5743ee;});});}})[_0x66f4('0x36')](respondWithResult(_0x567120,null))[_0x66f4('0x29')](handleError(_0x567120,null));}; \ No newline at end of file +var _0xd634=['List','account','list','applications','priority','asc','contact','lastName','threadId','OpenchannelInteraction','externalUrl','firstName','messageId','interaction','created','autoclose','close','unmanaged','UserId','unshift','agent','waitForTheAssignedAgent','queueId','waitForTheAssignedQueue','*,*,*,*','startRouting','EventManager','transaction','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','stack','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tags','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','findAll','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','updatedAt','difference','createdAt','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','OpenchannelApplication','Applications'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd634,0xf4));var _0x4d63=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0xd634[_0x4b03c9];return _0x161ba2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d63('0x0'));var zipdir=require(_0x4d63('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4d63('0x2'));var BPromise=require(_0x4d63('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4d63('0x4'));var sox=require(_0x4d63('0x5'));var csv=require(_0x4d63('0x6'));var ejs=require(_0x4d63('0x7'));var fs=require('fs');var fs_extra=require(_0x4d63('0x8'));var _=require(_0x4d63('0x9'));var squel=require(_0x4d63('0xa'));var crypto=require(_0x4d63('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d63('0xc'));var authService=require(_0x4d63('0xd'));var qs=require(_0x4d63('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d63('0xf'));var logger=require(_0x4d63('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4d63('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x4d63('0x12'))['db'];config[_0x4d63('0x13')]=_[_0x4d63('0x14')](config[_0x4d63('0x13')],{'host':_0x4d63('0x15'),'port':0x18eb});var socket=require(_0x4d63('0x16'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x4d63('0x17'));var client=jayson[_0x4d63('0x18')][_0x4d63('0x19')]({'port':0x232c});var client9002=jayson[_0x4d63('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x226eb4,_0x2ca49a,_0x26d6fa,_0x44c1d8){return new BPromise(function(_0x3c96b8,_0x2e321b){var _0x43dc31=_0x44c1d8||client;return _0x43dc31[_0x4d63('0x1a')](_0x226eb4,_0x26d6fa)['then'](function(_0x4fe175){logger[_0x4d63('0x1b')]('OpenchannelAccount,\x20%s,\x20%s',_0x2ca49a,_0x4d63('0x1c'));logger[_0x4d63('0x1d')](_0x4d63('0x1e'),_0x2ca49a,_0x4d63('0x1c'),JSON[_0x4d63('0x1f')](_0x4fe175));if(_0x4fe175['error']){if(_0x4fe175[_0x4d63('0x20')][_0x4d63('0x21')]===0x1f4){logger['error'](_0x4d63('0x22'),_0x2ca49a,_0x4fe175[_0x4d63('0x20')][_0x4d63('0x23')]);return _0x2e321b(_0x4fe175['error'][_0x4d63('0x23')]);}logger[_0x4d63('0x20')](_0x4d63('0x22'),_0x2ca49a,_0x4fe175[_0x4d63('0x20')]['message']);return _0x3c96b8(_0x4fe175[_0x4d63('0x20')]['message']);}else{logger['info'](_0x4d63('0x22'),_0x2ca49a,_0x4d63('0x1c'));_0x3c96b8(_0x4fe175[_0x4d63('0x24')][_0x4d63('0x23')]);}})[_0x4d63('0x25')](function(_0x2b4423){logger[_0x4d63('0x20')](_0x4d63('0x22'),_0x2ca49a,_0x2b4423);_0x2e321b(_0x2b4423);});});}function respondWithStatusCode(_0x147150,_0x24a95d){_0x24a95d=_0x24a95d||0xcc;return function(_0x4d0d14){if(_0x4d0d14){return _0x147150[_0x4d63('0x26')](_0x24a95d);}return _0x147150[_0x4d63('0x27')](_0x24a95d)[_0x4d63('0x28')]();};}function respondWithResult(_0x1bf4dd,_0x2c4864){_0x2c4864=_0x2c4864||0xc8;return function(_0x12b131){if(_0x12b131){return _0x1bf4dd[_0x4d63('0x27')](_0x2c4864)[_0x4d63('0x29')](_0x12b131);}};}function respondWithFilteredResult(_0xee43e,_0x6fcc4c){return function(_0x3860fe){if(_0x3860fe){var _0x1f8950=typeof _0x6fcc4c[_0x4d63('0x2a')]===_0x4d63('0x2b')&&typeof _0x6fcc4c[_0x4d63('0x2c')]===_0x4d63('0x2b');var _0x4b6f80=_0x3860fe[_0x4d63('0x2d')];var _0x20dec4=_0x1f8950?0x0:_0x6fcc4c[_0x4d63('0x2a')];var _0x5c17c1=_0x1f8950?_0x3860fe[_0x4d63('0x2d')]:_0x6fcc4c[_0x4d63('0x2a')]+_0x6fcc4c['limit'];var _0x18662a;if(_0x5c17c1>=_0x4b6f80){_0x5c17c1=_0x4b6f80;_0x18662a=0xc8;}else{_0x18662a=0xce;}_0xee43e[_0x4d63('0x27')](_0x18662a);return _0xee43e[_0x4d63('0x2e')](_0x4d63('0x2f'),_0x20dec4+'-'+_0x5c17c1+'/'+_0x4b6f80)[_0x4d63('0x29')](_0x3860fe);}return null;};}function patchUpdates(_0x4bd75e){return function(_0x17d11b){try{jsonpatch[_0x4d63('0x30')](_0x17d11b,_0x4bd75e,!![]);}catch(_0x50d9e6){return BPromise[_0x4d63('0x31')](_0x50d9e6);}return _0x17d11b[_0x4d63('0x32')]();};}function saveUpdates(_0x27874c,_0x4ec27e){return function(_0x1f6593){if(_0x1f6593){return _0x1f6593[_0x4d63('0x33')](_0x27874c)['then'](function(_0x282b15){return _0x282b15;});}return null;};}function removeEntity(_0x511ff5,_0x50d5ae){return function(_0x2ed2dd){if(_0x2ed2dd){return _0x2ed2dd[_0x4d63('0x34')]()[_0x4d63('0x35')](function(){var _0x63ffb3=_0x2ed2dd[_0x4d63('0x36')]({'plain':!![]});var _0xe3cbbc='OpenchannelAccounts';return db[_0x4d63('0x37')][_0x4d63('0x34')]({'where':{'type':_0xe3cbbc,'resourceId':_0x63ffb3['id']}})[_0x4d63('0x35')](function(){return _0x2ed2dd;});})[_0x4d63('0x35')](function(){_0x511ff5['status'](0xcc)[_0x4d63('0x28')]();});}};}function handleEntityNotFound(_0x2fb445,_0x44f874){return function(_0x397c94){if(!_0x397c94){_0x2fb445[_0x4d63('0x26')](0x194);}return _0x397c94;};}function handleError(_0x5916ee,_0x55b37e){_0x55b37e=_0x55b37e||0x1f4;return function(_0x2073ab){logger[_0x4d63('0x20')](_0x2073ab['stack']);if(_0x2073ab['name']){delete _0x2073ab[_0x4d63('0x38')];}_0x5916ee['status'](_0x55b37e)[_0x4d63('0x39')](_0x2073ab);};}exports[_0x4d63('0x3a')]=function(_0xce59e3,_0x47880b){var _0x6142a0={'include':[{'model':db[_0x4d63('0x3b')],'as':_0x4d63('0x3c')}]},_0x270bc9={},_0x595492={'count':0x0,'rows':[]};var _0x1a693e=_[_0x4d63('0x3d')](db[_0x4d63('0x3e')][_0x4d63('0x3f')],function(_0x410dc9){return{'name':_0x410dc9[_0x4d63('0x40')],'type':_0x410dc9[_0x4d63('0x41')][_0x4d63('0x42')]};});_0x270bc9['model']=_[_0x4d63('0x3d')](_0x1a693e,_0x4d63('0x38'));_0x270bc9[_0x4d63('0x43')]=_[_0x4d63('0x44')](_0xce59e3['query']);_0x270bc9[_0x4d63('0x45')]=_['intersection'](_0x270bc9[_0x4d63('0x46')],_0x270bc9[_0x4d63('0x43')]);_0x6142a0[_0x4d63('0x47')]=_['intersection'](_0x270bc9[_0x4d63('0x46')],qs['fields'](_0xce59e3[_0x4d63('0x43')][_0x4d63('0x48')]));_0x6142a0[_0x4d63('0x47')]=_0x6142a0[_0x4d63('0x47')][_0x4d63('0x49')]?_0x6142a0[_0x4d63('0x47')]:_0x270bc9['model'];if(!_0xce59e3[_0x4d63('0x43')][_0x4d63('0x4a')](_0x4d63('0x4b'))){_0x6142a0['limit']=qs[_0x4d63('0x2c')](_0xce59e3[_0x4d63('0x43')][_0x4d63('0x2c')]);_0x6142a0[_0x4d63('0x2a')]=qs[_0x4d63('0x2a')](_0xce59e3[_0x4d63('0x43')]['offset']);}_0x6142a0[_0x4d63('0x4c')]=qs[_0x4d63('0x4d')](_0xce59e3[_0x4d63('0x43')][_0x4d63('0x4d')]);_0x6142a0[_0x4d63('0x4e')]=qs[_0x4d63('0x45')](_[_0x4d63('0x4f')](_0xce59e3['query'],_0x270bc9[_0x4d63('0x45')]),_0x1a693e);if(_0xce59e3['query']['filter']){_0x6142a0[_0x4d63('0x4e')]=_['merge'](_0x6142a0[_0x4d63('0x4e')],{'$or':_[_0x4d63('0x3d')](_0x1a693e,function(_0x58dc5d){if(_0x58dc5d[_0x4d63('0x41')]!=='VIRTUAL'){var _0x324af8={};_0x324af8[_0x58dc5d[_0x4d63('0x38')]]={'$like':'%'+_0xce59e3[_0x4d63('0x43')][_0x4d63('0x50')]+'%'};return _0x324af8;}})});}_0x6142a0=_[_0x4d63('0x51')]({},_0x6142a0,_0xce59e3[_0x4d63('0x52')]);var _0x1b74e9={'where':_0x6142a0[_0x4d63('0x4e')]};return db[_0x4d63('0x3e')][_0x4d63('0x2d')](_0x1b74e9)[_0x4d63('0x35')](function(_0x2f0fb9){_0x595492[_0x4d63('0x2d')]=_0x2f0fb9;if(_0xce59e3['query'][_0x4d63('0x53')]){_0x6142a0[_0x4d63('0x54')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x6142a0);})[_0x4d63('0x35')](function(_0x5a9553){_0x595492[_0x4d63('0x55')]=_0x5a9553;return _0x595492;})[_0x4d63('0x35')](respondWithFilteredResult(_0x47880b,_0x6142a0))[_0x4d63('0x25')](handleError(_0x47880b,null));};exports['show']=function(_0x189a8a,_0x4c150f){var _0x142bf3={'raw':![],'where':{'id':_0x189a8a[_0x4d63('0x56')]['id']},'include':[{'model':db[_0x4d63('0x3b')],'as':_0x4d63('0x3c')}]},_0x540d92={};_0x540d92[_0x4d63('0x46')]=_['keys'](db[_0x4d63('0x3e')][_0x4d63('0x3f')]);_0x540d92[_0x4d63('0x43')]=_[_0x4d63('0x44')](_0x189a8a[_0x4d63('0x43')]);_0x540d92[_0x4d63('0x45')]=_[_0x4d63('0x57')](_0x540d92['model'],_0x540d92[_0x4d63('0x43')]);_0x142bf3[_0x4d63('0x47')]=_[_0x4d63('0x57')](_0x540d92[_0x4d63('0x46')],qs[_0x4d63('0x48')](_0x189a8a[_0x4d63('0x43')][_0x4d63('0x48')]));_0x142bf3[_0x4d63('0x47')]=_0x142bf3[_0x4d63('0x47')]['length']?_0x142bf3[_0x4d63('0x47')]:_0x540d92[_0x4d63('0x46')];if(_0x189a8a[_0x4d63('0x43')][_0x4d63('0x53')]){_0x142bf3[_0x4d63('0x54')]=[{'all':!![]}];}_0x142bf3=_[_0x4d63('0x51')]({},_0x142bf3,_0x189a8a[_0x4d63('0x52')]);return db[_0x4d63('0x3e')][_0x4d63('0x58')](_0x142bf3)[_0x4d63('0x35')](handleEntityNotFound(_0x4c150f,null))[_0x4d63('0x35')](respondWithResult(_0x4c150f,null))[_0x4d63('0x25')](handleError(_0x4c150f,null));};exports['create']=function(_0xd4fede,_0x2355f8){return db[_0x4d63('0x3e')][_0x4d63('0x59')](_0xd4fede[_0x4d63('0x5a')],{})[_0x4d63('0x35')](function(_0x52027d){var _0x3d1fba=_0xd4fede[_0x4d63('0x5b')][_0x4d63('0x36')]({'plain':!![]});if(!_0x3d1fba)throw new Error(_0x4d63('0x5c'));if(_0x3d1fba[_0x4d63('0x5d')]===_0x4d63('0x5b')){var _0x3218b0=_0x52027d[_0x4d63('0x36')]({'plain':!![]});var _0x117795=_0x4d63('0x5e');return db[_0x4d63('0x5f')]['find']({'where':{'name':_0x117795,'userProfileId':_0x3d1fba[_0x4d63('0x60')]},'raw':!![]})[_0x4d63('0x35')](function(_0x3b0a85){if(_0x3b0a85&&_0x3b0a85['autoAssociation']===0x0){return db[_0x4d63('0x37')][_0x4d63('0x59')]({'name':_0x3218b0[_0x4d63('0x38')],'resourceId':_0x3218b0['id'],'type':_0x3b0a85['name'],'sectionId':_0x3b0a85['id']},{})[_0x4d63('0x35')](function(){return _0x52027d;});}else{return _0x52027d;}})['catch'](function(_0x46e39e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46e39e);throw _0x46e39e;});}return _0x52027d;})[_0x4d63('0x35')](respondWithResult(_0x2355f8,0xc9))[_0x4d63('0x25')](handleError(_0x2355f8,null));};exports[_0x4d63('0x33')]=function(_0x216c07,_0x41c60c){if(_0x216c07[_0x4d63('0x5a')]['id']){delete _0x216c07[_0x4d63('0x5a')]['id'];}return db[_0x4d63('0x3e')][_0x4d63('0x58')]({'where':{'id':_0x216c07[_0x4d63('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x4d63('0x3c')}]})[_0x4d63('0x35')](handleEntityNotFound(_0x41c60c,null))[_0x4d63('0x35')](saveUpdates(_0x216c07[_0x4d63('0x5a')],null))[_0x4d63('0x35')](respondWithResult(_0x41c60c,null))[_0x4d63('0x25')](handleError(_0x41c60c,null));};exports[_0x4d63('0x34')]=function(_0x9c0891,_0x7c8608){return db[_0x4d63('0x3e')][_0x4d63('0x58')]({'where':{'id':_0x9c0891[_0x4d63('0x56')]['id']}})[_0x4d63('0x35')](handleEntityNotFound(_0x7c8608,null))[_0x4d63('0x35')](removeEntity(_0x7c8608,null))[_0x4d63('0x25')](handleError(_0x7c8608,null));};exports['describe']=function(_0x456dd5,_0x626f01){return db['OpenchannelAccount'][_0x4d63('0x61')]()[_0x4d63('0x35')](respondWithResult(_0x626f01,null))['catch'](handleError(_0x626f01,null));};exports[_0x4d63('0x62')]=function(_0x18829e,_0x583ab7,_0x320a1f){if(_0x18829e[_0x4d63('0x5a')]['id']){delete _0x18829e[_0x4d63('0x5a')]['id'];}return db['OpenchannelAccount'][_0x4d63('0x58')]({'where':{'id':_0x18829e[_0x4d63('0x56')]['id']}})[_0x4d63('0x35')](handleEntityNotFound(_0x583ab7,null))[_0x4d63('0x35')](function(_0x2c211f){if(_0x2c211f){_0x18829e[_0x4d63('0x5a')][_0x4d63('0x63')]=_0x2c211f['id'];return db[_0x4d63('0x64')][_0x4d63('0x59')](_0x18829e['body']);}})['then'](respondWithResult(_0x583ab7,null))[_0x4d63('0x25')](handleError(_0x583ab7,null));};exports[_0x4d63('0x65')]=function(_0x3ec356,_0x48c3af,_0x1d8944){var _0x1694cc={'raw':![],'where':{}};var _0x473260={};var _0x14d6e4={'count':0x0,'rows':[]};return db[_0x4d63('0x3e')][_0x4d63('0x66')]({'where':{'id':_0x3ec356[_0x4d63('0x56')]['id']}})[_0x4d63('0x35')](handleEntityNotFound(_0x48c3af,null))[_0x4d63('0x35')](function(_0x3e6153){if(_0x3e6153){_0x473260[_0x4d63('0x46')]=_[_0x4d63('0x44')](db[_0x4d63('0x64')][_0x4d63('0x3f')]);_0x473260[_0x4d63('0x43')]=_[_0x4d63('0x44')](_0x3ec356[_0x4d63('0x43')]);_0x473260[_0x4d63('0x45')]=_[_0x4d63('0x57')](_0x473260[_0x4d63('0x46')],_0x473260[_0x4d63('0x43')]);_0x1694cc[_0x4d63('0x47')]=_[_0x4d63('0x57')](_0x473260[_0x4d63('0x46')],qs['fields'](_0x3ec356[_0x4d63('0x43')]['fields']));_0x1694cc[_0x4d63('0x47')]=_0x1694cc[_0x4d63('0x47')][_0x4d63('0x49')]?_0x1694cc[_0x4d63('0x47')]:_0x473260['model'];if(!_0x3ec356[_0x4d63('0x43')][_0x4d63('0x4a')]('nolimit')){_0x1694cc[_0x4d63('0x2c')]=qs[_0x4d63('0x2c')](_0x3ec356[_0x4d63('0x43')]['limit']);_0x1694cc[_0x4d63('0x2a')]=qs[_0x4d63('0x2a')](_0x3ec356[_0x4d63('0x43')][_0x4d63('0x2a')]);}_0x1694cc[_0x4d63('0x4c')]=qs[_0x4d63('0x4d')](_0x3ec356[_0x4d63('0x43')][_0x4d63('0x4d')]);_0x1694cc[_0x4d63('0x4e')]=qs['filters'](_[_0x4d63('0x4f')](_0x3ec356['query'],_0x473260[_0x4d63('0x45')]));_0x1694cc['where']['OpenchannelAccountId']=_0x3e6153['id'];if(_0x3ec356[_0x4d63('0x43')][_0x4d63('0x50')]){_0x1694cc['where']=_[_0x4d63('0x51')](_0x1694cc[_0x4d63('0x4e')],{'$or':_[_0x4d63('0x3d')](_0x1694cc[_0x4d63('0x47')],function(_0x2fdd18){var _0x50bdd0={};_0x50bdd0[_0x2fdd18]={'$like':'%'+_0x3ec356[_0x4d63('0x43')][_0x4d63('0x50')]+'%'};return _0x50bdd0;})});}_0x1694cc=_['merge']({},_0x1694cc,_0x3ec356[_0x4d63('0x52')]);return db[_0x4d63('0x64')][_0x4d63('0x2d')]({'where':_0x1694cc[_0x4d63('0x4e')]})[_0x4d63('0x35')](function(_0x56487e){_0x14d6e4[_0x4d63('0x2d')]=_0x56487e;if(_0x3ec356[_0x4d63('0x43')][_0x4d63('0x53')]){_0x1694cc[_0x4d63('0x54')]=[{'all':!![]}];}return db[_0x4d63('0x64')]['findAll'](_0x1694cc);})[_0x4d63('0x35')](function(_0x4dda7b){_0x14d6e4[_0x4d63('0x55')]=_0x4dda7b;return _0x14d6e4;});}})[_0x4d63('0x35')](respondWithFilteredResult(_0x48c3af,_0x1694cc))[_0x4d63('0x25')](handleError(_0x48c3af,null));};exports[_0x4d63('0x67')]=function(_0xb2cf51,_0x1be0c1,_0x416a0f){return db[_0x4d63('0x3e')][_0x4d63('0x58')]({'where':{'id':_0xb2cf51[_0x4d63('0x56')]['id']}})[_0x4d63('0x35')](handleEntityNotFound(_0x1be0c1,null))[_0x4d63('0x35')](function(_0xe70302){if(_0xe70302){return _0xe70302[_0x4d63('0x67')](_0xb2cf51[_0x4d63('0x43')]['ids']);}})[_0x4d63('0x35')](respondWithStatusCode(_0x1be0c1,null))['catch'](handleError(_0x1be0c1,null));};exports[_0x4d63('0x68')]=function(_0x4674c8,_0x14918c,_0x31d5b4){if(_0x4674c8[_0x4d63('0x5a')]['id']){delete _0x4674c8[_0x4d63('0x5a')]['id'];}return db[_0x4d63('0x3e')][_0x4d63('0x58')]({'where':{'id':_0x4674c8[_0x4d63('0x56')]['id']}})[_0x4d63('0x35')](handleEntityNotFound(_0x14918c,null))[_0x4d63('0x35')](function(_0x359532){if(_0x359532){_0x4674c8[_0x4d63('0x5a')][_0x4d63('0x63')]=_0x359532['id'];return db[_0x4d63('0x69')][_0x4d63('0x59')](_0x4674c8['body']);}})[_0x4d63('0x35')](respondWithResult(_0x14918c,null))['catch'](handleError(_0x14918c,null));};exports['getAnswers']=function(_0x289b6c,_0x580ad3,_0x40f8fd){var _0x22fc16={'raw':![],'where':{}};var _0x52a9f9={};var _0x30228d={'count':0x0,'rows':[]};return db[_0x4d63('0x3e')]['findOne']({'where':{'id':_0x289b6c[_0x4d63('0x56')]['id']}})[_0x4d63('0x35')](handleEntityNotFound(_0x580ad3,null))[_0x4d63('0x35')](function(_0x14ddef){if(_0x14ddef){_0x52a9f9[_0x4d63('0x46')]=_['keys'](db[_0x4d63('0x69')][_0x4d63('0x3f')]);_0x52a9f9['query']=_[_0x4d63('0x44')](_0x289b6c['query']);_0x52a9f9[_0x4d63('0x45')]=_[_0x4d63('0x57')](_0x52a9f9[_0x4d63('0x46')],_0x52a9f9[_0x4d63('0x43')]);_0x22fc16[_0x4d63('0x47')]=_['intersection'](_0x52a9f9['model'],qs[_0x4d63('0x48')](_0x289b6c[_0x4d63('0x43')][_0x4d63('0x48')]));_0x22fc16[_0x4d63('0x47')]=_0x22fc16['attributes'][_0x4d63('0x49')]?_0x22fc16['attributes']:_0x52a9f9[_0x4d63('0x46')];if(!_0x289b6c[_0x4d63('0x43')]['hasOwnProperty']('nolimit')){_0x22fc16[_0x4d63('0x2c')]=qs['limit'](_0x289b6c[_0x4d63('0x43')][_0x4d63('0x2c')]);_0x22fc16[_0x4d63('0x2a')]=qs['offset'](_0x289b6c['query'][_0x4d63('0x2a')]);}_0x22fc16[_0x4d63('0x4c')]=qs['sort'](_0x289b6c['query'][_0x4d63('0x4d')]);_0x22fc16[_0x4d63('0x4e')]=qs[_0x4d63('0x45')](_[_0x4d63('0x4f')](_0x289b6c[_0x4d63('0x43')],_0x52a9f9[_0x4d63('0x45')]));_0x22fc16[_0x4d63('0x4e')][_0x4d63('0x63')]=_0x14ddef['id'];if(_0x289b6c[_0x4d63('0x43')][_0x4d63('0x50')]){_0x22fc16[_0x4d63('0x4e')]=_[_0x4d63('0x51')](_0x22fc16[_0x4d63('0x4e')],{'$or':_[_0x4d63('0x3d')](_0x22fc16[_0x4d63('0x47')],function(_0x5e53aa){var _0x50de3a={};_0x50de3a[_0x5e53aa]={'$like':'%'+_0x289b6c[_0x4d63('0x43')][_0x4d63('0x50')]+'%'};return _0x50de3a;})});}_0x22fc16=_[_0x4d63('0x51')]({},_0x22fc16,_0x289b6c[_0x4d63('0x52')]);return db[_0x4d63('0x69')][_0x4d63('0x2d')]({'where':_0x22fc16['where']})[_0x4d63('0x35')](function(_0x43f055){_0x30228d[_0x4d63('0x2d')]=_0x43f055;if(_0x289b6c[_0x4d63('0x43')]['includeAll']){_0x22fc16[_0x4d63('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4d63('0x6a')](_0x22fc16);})[_0x4d63('0x35')](function(_0x1dcf3b){_0x30228d[_0x4d63('0x55')]=_0x1dcf3b;return _0x30228d;});}})[_0x4d63('0x35')](respondWithFilteredResult(_0x580ad3,_0x22fc16))['catch'](handleError(_0x580ad3,null));};exports[_0x4d63('0x6b')]=function(_0x52e8cc,_0x63f36d,_0x4f47e7){return db[_0x4d63('0x3e')]['find']({'where':{'id':_0x52e8cc[_0x4d63('0x56')]['id']}})[_0x4d63('0x35')](handleEntityNotFound(_0x63f36d,null))[_0x4d63('0x35')](function(_0x4da3e5){if(_0x4da3e5){return _0x4da3e5[_0x4d63('0x6b')](_0x52e8cc[_0x4d63('0x43')][_0x4d63('0x6c')]);}})[_0x4d63('0x35')](respondWithStatusCode(_0x63f36d,null))[_0x4d63('0x25')](handleError(_0x63f36d,null));};exports[_0x4d63('0x6d')]=function(_0xc18828,_0x431c4f,_0x336766){var _0x5cc76b={'body':_0xc18828[_0x4d63('0x5a')],'channel':_0x4d63('0x6e')};var _0x30cbb5=[];var _0x212c4f=[];var _0x1b8042={};var _0x106e0a=![];return db[_0x4d63('0x6f')]['describe']()[_0x4d63('0x35')](function(_0x171e92){if(!_0x171e92){throw new db[(_0x4d63('0x70'))]['ValidationError'](_0x4d63('0x71'));}_0x30cbb5=_['difference'](_[_0x4d63('0x44')](_0x171e92),['createdAt',_0x4d63('0x72')]);_0x212c4f=_[_0x4d63('0x73')](_[_0x4d63('0x44')](_0x171e92),[_0x4d63('0x74'),'updatedAt','CompanyId',_0x4d63('0x75')]);if(_0xc18828['body']['id']){delete _0xc18828[_0x4d63('0x5a')]['id'];}if(_['isNil'](_0xc18828[_0x4d63('0x5a')][_0x4d63('0x76')])){throw new db[(_0x4d63('0x70'))][(_0x4d63('0x77'))](_0x4d63('0x78'));}if(_['isNil'](_0xc18828[_0x4d63('0x5a')][_0x4d63('0x5a')])||_0xc18828['body']['body']===''){throw new db['Sequelize']['ValidationError'](_0x4d63('0x79'));}if(_[_0x4d63('0x7a')](_0xc18828[_0x4d63('0x5a')][_0x4d63('0x7b')])){throw new db[(_0x4d63('0x70'))][(_0x4d63('0x77'))](_0x4d63('0x7c')+_0x212c4f);}if(!_[_0x4d63('0x7d')](_0x212c4f,_0xc18828[_0x4d63('0x5a')][_0x4d63('0x7b')])){throw new db[(_0x4d63('0x70'))][(_0x4d63('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x212c4f);}_0x1b8042[_0xc18828[_0x4d63('0x5a')]['mapKey']]=_0xc18828[_0x4d63('0x5a')][_0x4d63('0x76')];})['then'](function(){return db['OpenchannelAccount'][_0x4d63('0x58')]({'where':{'id':_0xc18828[_0x4d63('0x56')]['id']},'include':[{'model':db[_0x4d63('0x7e')],'as':'List','include':[{'model':db[_0x4d63('0x6f')],'as':_0x4d63('0x7f'),'where':_0x1b8042,'limit':0x1,'order':[[_0x4d63('0x72'),'DESC']]}]},{'model':db[_0x4d63('0x80')],'as':_0x4d63('0x81')}]});})[_0x4d63('0x35')](handleEntityNotFound(_0x431c4f,null))['then'](function(_0x5f2df5){if(_0x5f2df5&&_0x5f2df5[_0x4d63('0x82')]){_0x5cc76b[_0x4d63('0x83')]=_0x5f2df5;_0x5cc76b['applications']=_0x5f2df5['Applications'];_0x5cc76b[_0x4d63('0x84')]=_0x5f2df5[_0x4d63('0x82')];_0x5cc76b['applications']=_['orderBy'](_0x5cc76b[_0x4d63('0x85')],[_0x4d63('0x86')],[_0x4d63('0x87')]);if(_0x5cc76b[_0x4d63('0x83')][_0x4d63('0x81')]){delete _0x5cc76b['account']['Applications'];}if(_0x5cc76b['account'][_0x4d63('0x82')]&&_0x5cc76b[_0x4d63('0x83')]['List'][_0x4d63('0x7f')][_0x4d63('0x49')]){return _0x5cc76b[_0x4d63('0x83')]['List'][_0x4d63('0x7f')][0x0];}var _0x59f15c=_[_0x4d63('0x14')](_0xc18828[_0x4d63('0x5a')],{'firstName':_0xc18828[_0x4d63('0x5a')][_0x4d63('0x76')],'ListId':_0x5f2df5[_0x4d63('0x75')]});_0x59f15c[_0xc18828[_0x4d63('0x5a')][_0x4d63('0x7b')]]=_0xc18828[_0x4d63('0x5a')][_0x4d63('0x76')];return db[_0x4d63('0x6f')]['create'](_0x59f15c,{'fields':_0x30cbb5,'raw':!![]});}})['then'](handleEntityNotFound(_0x431c4f,null))['then'](function(_0x4639f7){_0x5cc76b[_0x4d63('0x88')]=_0x4639f7;if(_0x4639f7){var _0x36c2ea={'ContactId':_0x4639f7['id'],'OpenchannelAccountId':_0xc18828[_0x4d63('0x56')]['id'],'from':(_0x4639f7['firstName']||'')+'\x20'+(_0x4639f7[_0x4d63('0x89')]||'')};var _0x2cd20b={'OpenchannelAccountId':_0xc18828[_0x4d63('0x56')]['id'],'closed':![]};if(_0xc18828['body']['threadId']){_0x2cd20b[_0x4d63('0x8a')]=_0xc18828['body'][_0x4d63('0x8a')];return db[_0x4d63('0x8b')][_0x4d63('0x58')]({'where':_0x2cd20b})[_0x4d63('0x35')](function(_0x268475){if(_0x268475){return[_0x268475,![]];}_0x36c2ea[_0x4d63('0x8a')]=_0xc18828[_0x4d63('0x5a')]['threadId'];_0x36c2ea[_0x4d63('0x8c')]=_0xc18828[_0x4d63('0x5a')][_0x4d63('0x8c')];return db[_0x4d63('0x8b')][_0x4d63('0x59')](_0x36c2ea)['then'](function(_0x304867){return[_0x304867,!![]];});});}else{_0x2cd20b['threadId']=null;}_0x2cd20b['ContactId']=_0x4639f7['id'];return db[_0x4d63('0x8b')]['find']({'where':_0x2cd20b})[_0x4d63('0x35')](function(_0x353c88){if(_0x353c88){return[_0x353c88,![]];}return db[_0x4d63('0x8b')][_0x4d63('0x59')](_0x36c2ea)['then'](function(_0x999a83){return[_0x999a83,!![]];});});}})['spread'](function(_0xcb672c,_0x5311ba){if(_0xcb672c){_0x106e0a=_0x5311ba;if(!_0x5311ba){var _0x513e3d={'from':(_0x5cc76b[_0x4d63('0x88')][_0x4d63('0x8d')]||'')+'\x20'+(_0x5cc76b[_0x4d63('0x88')][_0x4d63('0x89')]||'')};if(_0xc18828[_0x4d63('0x5a')][_0x4d63('0x8a')]&&_0xc18828['body'][_0x4d63('0x8e')]&&_0xc18828[_0x4d63('0x5a')][_0x4d63('0x8a')]!=_0xc18828[_0x4d63('0x5a')][_0x4d63('0x8e')]){_0x513e3d[_0x4d63('0x8a')]=_0xc18828[_0x4d63('0x5a')][_0x4d63('0x8e')];}return _0xcb672c[_0x4d63('0x33')](_0x513e3d);}else{return _0xcb672c;}}})[_0x4d63('0x35')](function(_0x4a0964){_0x5cc76b[_0x4d63('0x8f')]=_0x4a0964[_0x4d63('0x36')]({'plain':!![]});_0x5cc76b[_0x4d63('0x8f')]['created']=_0x106e0a;if(_0x5cc76b[_0x4d63('0x8f')][_0x4d63('0x90')]){if(_0x5cc76b[_0x4d63('0x83')][_0x4d63('0x91')]){_0x5cc76b[_0x4d63('0x85')]['push']({'id':0x0,'priority':_0x5cc76b[_0x4d63('0x85')][_0x4d63('0x49')]+0x1,'app':_0x4d63('0x92'),'appdata':_0x4d63('0x93'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0x4d63('0x59')]({'body':_0xc18828[_0x4d63('0x5a')]['body'],'OpenchannelAccountId':_0xc18828[_0x4d63('0x56')]['id'],'OpenchannelInteractionId':_0x4a0964['id'],'direction':'in','ContactId':_0x5cc76b[_0x4d63('0x88')]['id'],'AttachmentId':_0xc18828['body']['AttachmentId']});})[_0x4d63('0x35')](function(_0x344f24){_0x5cc76b['message']=_0x344f24;if(!_0x5cc76b[_0x4d63('0x8f')][_0x4d63('0x94')])return;return db['User'][_0x4d63('0x58')]({'attributes':['id',_0x4d63('0x38')],'where':{'id':_0x5cc76b[_0x4d63('0x8f')][_0x4d63('0x94')]}});})[_0x4d63('0x35')](function(_0x261c8f){if(_0x261c8f){_0x5cc76b[_0x4d63('0x85')][_0x4d63('0x95')]({'id':0x0,'priority':0x0,'app':_0x4d63('0x96'),'appdata':_0x261c8f[_0x4d63('0x38')]+','+(_0x5cc76b['account'][_0x4d63('0x97')]||0xa),'interval':'*,*,*,*'});}if(!_0x5cc76b[_0x4d63('0x8f')][_0x4d63('0x98')])return;return db['OpenchannelQueue'][_0x4d63('0x58')]({'attributes':['id','name'],'where':{'id':_0x5cc76b[_0x4d63('0x8f')][_0x4d63('0x98')]}});})[_0x4d63('0x35')](function(_0x1b6bb5){if(_0x1b6bb5){_0x5cc76b[_0x4d63('0x85')][_0x4d63('0x95')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1b6bb5[_0x4d63('0x38')]+','+(_0x5cc76b[_0x4d63('0x83')][_0x4d63('0x99')]||0x12c),'interval':_0x4d63('0x9a')});}return respondWithRpcPromise('Start',_0x4d63('0x9b'),_0x5cc76b);})[_0x4d63('0x35')](function(_0x28d132){respondWithRpcPromise(_0x4d63('0x9c'),'EventManager',{'event':_0x4d63('0x6d'),'message':_0x28d132},client9002);return _0x28d132;})['then'](respondWithResult(_0x431c4f,null))['catch'](handleError(_0x431c4f,null));};exports['addApplications']=function(_0x5ac09e,_0x5981f5){var _0x1ada92=_0x5ac09e[_0x4d63('0x56')]['id'];var _0x16fa7b=_0x5ac09e[_0x4d63('0x5a')];var _0x188a28=0xc8;var _0x4a584f=null;return db['sequelize'][_0x4d63('0x9d')]({'isolationLevel':db[_0x4d63('0x9e')][_0x4d63('0x9f')]['ISOLATION_LEVELS'][_0x4d63('0xa0')]},function(_0x5c48a6){return db[_0x4d63('0x3e')][_0x4d63('0x66')]({'where':{'id':_0x1ada92},'transaction':_0x5c48a6})['then'](function(_0x5f56f6){if(_0x5f56f6){return db['OpenchannelApplication'][_0x4d63('0x34')]({'where':{'OpenchannelAccountId':_0x1ada92},'transaction':_0x5c48a6})[_0x4d63('0x35')](function(){var _0x29d6b7=_[_0x4d63('0x3d')](_0x16fa7b,function(_0x5e13ff){_0x5e13ff[_0x4d63('0x63')]=_0x1ada92;return _0x5e13ff;});return db[_0x4d63('0x80')][_0x4d63('0xa1')](_0x29d6b7,{'transaction':_0x5c48a6});});}else{_0x188a28=0x194;_0x4a584f=[];}});})[_0x4d63('0x35')](function(){if(_0x188a28!==0x194){return db[_0x4d63('0x80')][_0x4d63('0xa2')]({'where':{'OpenchannelAccountId':_0x1ada92},'order':_0x4d63('0x86')})[_0x4d63('0x35')](function(_0x38ca07){_0x4a584f=_0x38ca07;});}})[_0x4d63('0x25')](function(_0x1c083d){_0x188a28=0x1f4;logger[_0x4d63('0x20')](_0x1c083d[_0x4d63('0xa3')]);if(_0x1c083d['name']){delete _0x1c083d[_0x4d63('0x38')];}_0x4a584f=_0x1c083d;})['finally'](function(){if(_0x4a584f===null){_0x5981f5['sendStatus'](_0x188a28);}else{if(_0x188a28===0x1f4){_0x5981f5[_0x4d63('0x27')](_0x188a28)['send'](_0x4a584f);}else{_0x5981f5[_0x4d63('0x27')](_0x188a28)['json'](_0x4a584f);}}});};exports[_0x4d63('0xa4')]=function(_0x204962,_0x40e6f3,_0x35ceab){var _0x33fd20={};var _0x3dd63b={};var _0x274d5a;var _0x3bc980;return db[_0x4d63('0x3e')][_0x4d63('0x66')]({'where':{'id':_0x204962['params']['id']}})[_0x4d63('0x35')](handleEntityNotFound(_0x40e6f3,null))[_0x4d63('0x35')](function(_0xf6ee9){if(_0xf6ee9){_0x274d5a=_0xf6ee9;_0x3dd63b[_0x4d63('0x46')]=_[_0x4d63('0x44')](db[_0x4d63('0x80')][_0x4d63('0x3f')]);_0x3dd63b[_0x4d63('0x43')]=_[_0x4d63('0x44')](_0x204962[_0x4d63('0x43')]);_0x3dd63b[_0x4d63('0x45')]=_['intersection'](_0x3dd63b[_0x4d63('0x46')],_0x3dd63b['query']);_0x33fd20[_0x4d63('0x47')]=_[_0x4d63('0x57')](_0x3dd63b[_0x4d63('0x46')],qs['fields'](_0x204962[_0x4d63('0x43')][_0x4d63('0x48')]));_0x33fd20[_0x4d63('0x47')]=_0x33fd20[_0x4d63('0x47')]['length']?_0x33fd20['attributes']:_0x3dd63b['model'];_0x33fd20[_0x4d63('0x4c')]=qs[_0x4d63('0x4d')](_0x204962[_0x4d63('0x43')][_0x4d63('0x4d')]);_0x33fd20['where']=qs[_0x4d63('0x45')](_['pick'](_0x204962[_0x4d63('0x43')],_0x3dd63b[_0x4d63('0x45')]));if(_0x204962[_0x4d63('0x43')][_0x4d63('0x50')]){_0x33fd20['where']=_['merge'](_0x33fd20[_0x4d63('0x4e')],{'$or':_['map'](_0x33fd20[_0x4d63('0x47')],function(_0x2c7650){var _0x79dd71={};_0x79dd71[_0x2c7650]={'$like':'%'+_0x204962['query'][_0x4d63('0x50')]+'%'};return _0x79dd71;})});}_0x33fd20=_[_0x4d63('0x51')]({},_0x33fd20,_0x204962[_0x4d63('0x52')]);return _0x274d5a['getApplications'](_0x33fd20);}})[_0x4d63('0x35')](function(_0x4100a1){if(_0x4100a1){_0x3bc980=_0x4100a1[_0x4d63('0x49')];if(!_0x204962[_0x4d63('0x43')][_0x4d63('0x4a')](_0x4d63('0x4b'))){_0x33fd20['limit']=qs[_0x4d63('0x2c')](_0x204962[_0x4d63('0x43')][_0x4d63('0x2c')]);_0x33fd20[_0x4d63('0x2a')]=qs[_0x4d63('0x2a')](_0x204962[_0x4d63('0x43')][_0x4d63('0x2a')]);}return _0x274d5a[_0x4d63('0xa4')](_0x33fd20);}})['then'](function(_0x494399){if(_0x494399){return _0x494399?{'count':_0x3bc980,'rows':_0x494399}:null;}})[_0x4d63('0x35')](respondWithResult(_0x40e6f3,null))['catch'](handleError(_0x40e6f3,null));};exports[_0x4d63('0xa5')]=function(_0xdd6f5b,_0x24c794,_0x1f66b7){var _0x65c4d1={'raw':![],'where':{}};var _0x21aa6c={};var _0x5338d1={'count':0x0,'rows':[]};return db[_0x4d63('0x3e')][_0x4d63('0x66')]({'where':{'id':_0xdd6f5b[_0x4d63('0x56')]['id']}})[_0x4d63('0x35')](handleEntityNotFound(_0x24c794,null))[_0x4d63('0x35')](function(_0xc451c1){if(_0xc451c1){_0x21aa6c[_0x4d63('0x46')]=_[_0x4d63('0x44')](db[_0x4d63('0x8b')][_0x4d63('0x3f')]);_0x21aa6c['query']=_[_0x4d63('0x44')](_0xdd6f5b[_0x4d63('0x43')]);_0x21aa6c[_0x4d63('0x45')]=_['intersection'](_0x21aa6c[_0x4d63('0x46')],_0x21aa6c[_0x4d63('0x43')]);_0x65c4d1[_0x4d63('0x47')]=_[_0x4d63('0x57')](_0x21aa6c[_0x4d63('0x46')],qs[_0x4d63('0x48')](_0xdd6f5b[_0x4d63('0x43')][_0x4d63('0x48')]));_0x65c4d1['attributes']=_0x65c4d1[_0x4d63('0x47')][_0x4d63('0x49')]?_0x65c4d1[_0x4d63('0x47')]:_0x21aa6c[_0x4d63('0x46')];if(!_0xdd6f5b[_0x4d63('0x43')][_0x4d63('0x4a')](_0x4d63('0x4b'))){_0x65c4d1[_0x4d63('0x2c')]=qs[_0x4d63('0x2c')](_0xdd6f5b[_0x4d63('0x43')][_0x4d63('0x2c')]);_0x65c4d1[_0x4d63('0x2a')]=qs[_0x4d63('0x2a')](_0xdd6f5b[_0x4d63('0x43')][_0x4d63('0x2a')]);}_0x65c4d1[_0x4d63('0x4c')]=qs['sort'](_0xdd6f5b['query'][_0x4d63('0x4d')]);_0x65c4d1[_0x4d63('0x4e')]=qs[_0x4d63('0x45')](_[_0x4d63('0x4f')](_0xdd6f5b['query'],_0x21aa6c['filters']));_0x65c4d1[_0x4d63('0x4e')][_0x4d63('0x63')]=_0xc451c1['id'];if(_0xdd6f5b[_0x4d63('0x43')][_0x4d63('0x50')]){_0x65c4d1[_0x4d63('0x4e')]=_[_0x4d63('0x51')](_0x65c4d1[_0x4d63('0x4e')],{'$or':_[_0x4d63('0x3d')](_0x65c4d1['attributes'],function(_0x768e44){var _0x1eacce={};_0x1eacce[_0x768e44]={'$like':'%'+_0xdd6f5b[_0x4d63('0x43')][_0x4d63('0x50')]+'%'};return _0x1eacce;})});}_0x65c4d1=_[_0x4d63('0x51')]({},_0x65c4d1,_0xdd6f5b['options']);return db[_0x4d63('0x8b')][_0x4d63('0x2d')]({'where':_0x65c4d1[_0x4d63('0x4e')]})[_0x4d63('0x35')](function(_0xdd1863){_0x5338d1[_0x4d63('0x2d')]=_0xdd1863;if(_0xdd6f5b[_0x4d63('0x43')][_0x4d63('0x53')]){_0x65c4d1[_0x4d63('0x54')]=[{'model':db[_0x4d63('0x6f')],'as':_0x4d63('0xa6'),'required':![]},{'model':db[_0x4d63('0xa7')],'as':_0x4d63('0xa8'),'attributes':[_0x4d63('0x38'),_0x4d63('0xa9'),_0x4d63('0xaa')],'required':![]},{'model':db['Tag'],'as':_0x4d63('0xab'),'attributes':['id',_0x4d63('0x38'),_0x4d63('0xac')],'where':_0xdd6f5b[_0x4d63('0x43')]['tag']?{'id':_0xdd6f5b[_0x4d63('0x43')][_0x4d63('0xad')]}:undefined,'required':_0xdd6f5b['query'][_0x4d63('0xad')]?!![]:![]}];}return db[_0x4d63('0x8b')][_0x4d63('0x6a')](_0x65c4d1);})[_0x4d63('0x35')](function(_0x4e73f7){_0x5338d1[_0x4d63('0x55')]=_0x4e73f7;return _0x5338d1;});}})[_0x4d63('0x35')](respondWithFilteredResult(_0x24c794,_0x65c4d1))[_0x4d63('0x25')](handleError(_0x24c794,null));};exports['addAgents']=function(_0x327569,_0x196c6e,_0x2b294e){return db['OpenchannelAccount'][_0x4d63('0x58')]({'where':{'id':_0x327569[_0x4d63('0x56')]['id']}})[_0x4d63('0x35')](handleEntityNotFound(_0x196c6e,null))[_0x4d63('0x35')](function(_0x30fed7){if(_0x30fed7){return _0x30fed7[_0x4d63('0xae')](_0x327569['body'][_0x4d63('0x6c')],_[_0x4d63('0xaf')](_0x327569[_0x4d63('0x5a')],[_0x4d63('0x6c'),'id'])||{})[_0x4d63('0xb0')](function(_0x504e65){for(var _0x1c738f=0x0;_0x1c738f<_0x327569[_0x4d63('0x5a')][_0x4d63('0x6c')]['length'];_0x1c738f+=0x1){socket[_0x4d63('0xb1')](_0x4d63('0xb2'),{'UserId':Number(_0x327569['body'][_0x4d63('0x6c')][_0x1c738f]),'OpenchannelAccountId':Number(_0x327569[_0x4d63('0x56')]['id'])});}return _0x504e65;});}})[_0x4d63('0x35')](respondWithResult(_0x196c6e,null))[_0x4d63('0x25')](handleError(_0x196c6e,null));};exports[_0x4d63('0xb3')]=function(_0x211995,_0x1e1126,_0x591f8f){return db[_0x4d63('0x3e')][_0x4d63('0x58')]({'where':{'id':_0x211995[_0x4d63('0x56')]['id']}})[_0x4d63('0x35')](handleEntityNotFound(_0x1e1126,null))['then'](function(_0x1d3605){if(_0x1d3605){return _0x1d3605['removeAgents'](_0x211995[_0x4d63('0x43')][_0x4d63('0x6c')])[_0x4d63('0x35')](function(){if(_[_0x4d63('0xb4')](_0x211995['query'][_0x4d63('0x6c')])){for(var _0xc8b64=0x0;_0xc8b64<_0x211995[_0x4d63('0x43')][_0x4d63('0x6c')][_0x4d63('0x49')];_0xc8b64+=0x1){socket[_0x4d63('0xb1')](_0x4d63('0xb5'),{'UserId':Number(_0x211995[_0x4d63('0x43')][_0x4d63('0x6c')][_0xc8b64]),'OpenchannelAccountId':Number(_0x211995[_0x4d63('0x56')]['id'])});}}else{socket['emit'](_0x4d63('0xb5'),{'UserId':Number(_0x211995[_0x4d63('0x43')][_0x4d63('0x6c')]),'OpenchannelAccountId':Number(_0x211995['params']['id'])});}});}})[_0x4d63('0x35')](respondWithStatusCode(_0x1e1126,null))[_0x4d63('0x25')](handleError(_0x1e1126,null));};exports[_0x4d63('0xb6')]=function(_0x207607,_0x38fe6e,_0x1c6048){var _0x38e56a={};var _0x4310f3={};var _0x30a441;var _0x26a82e;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x207607['params']['id']}})['then'](handleEntityNotFound(_0x38fe6e,null))[_0x4d63('0x35')](function(_0x2eddc2){if(_0x2eddc2){_0x30a441=_0x2eddc2;_0x4310f3[_0x4d63('0x46')]=_[_0x4d63('0x44')](db[_0x4d63('0xa7')][_0x4d63('0x3f')]);_0x4310f3[_0x4d63('0x43')]=_[_0x4d63('0x44')](_0x207607[_0x4d63('0x43')]);_0x4310f3[_0x4d63('0x45')]=_[_0x4d63('0x57')](_0x4310f3[_0x4d63('0x46')],_0x4310f3[_0x4d63('0x43')]);_0x38e56a[_0x4d63('0x47')]=_['intersection'](_0x4310f3[_0x4d63('0x46')],qs[_0x4d63('0x48')](_0x207607[_0x4d63('0x43')][_0x4d63('0x48')]));_0x38e56a[_0x4d63('0x47')]=_0x38e56a[_0x4d63('0x47')][_0x4d63('0x49')]?_0x38e56a[_0x4d63('0x47')]:_0x4310f3[_0x4d63('0x46')];_0x38e56a[_0x4d63('0x4c')]=qs[_0x4d63('0x4d')](_0x207607[_0x4d63('0x43')][_0x4d63('0x4d')]);_0x38e56a[_0x4d63('0x4e')]=qs[_0x4d63('0x45')](_['pick'](_0x207607[_0x4d63('0x43')],_0x4310f3[_0x4d63('0x45')]));if(_0x207607[_0x4d63('0x43')][_0x4d63('0x50')]){_0x38e56a[_0x4d63('0x4e')]=_['merge'](_0x38e56a['where'],{'$or':_[_0x4d63('0x3d')](_0x38e56a[_0x4d63('0x47')],function(_0x50f96f){var _0x4e4f69={};_0x4e4f69[_0x50f96f]={'$like':'%'+_0x207607['query'][_0x4d63('0x50')]+'%'};return _0x4e4f69;})});}_0x38e56a=_[_0x4d63('0x51')]({},_0x38e56a,_0x207607[_0x4d63('0x52')]);return _0x30a441['getAgents'](_0x38e56a);}})[_0x4d63('0x35')](function(_0x1164cb){if(_0x1164cb){_0x26a82e=_0x1164cb[_0x4d63('0x49')];if(!_0x207607[_0x4d63('0x43')][_0x4d63('0x4a')](_0x4d63('0x4b'))){_0x38e56a['limit']=qs['limit'](_0x207607['query'][_0x4d63('0x2c')]);_0x38e56a[_0x4d63('0x2a')]=qs[_0x4d63('0x2a')](_0x207607[_0x4d63('0x43')][_0x4d63('0x2a')]);}return _0x30a441[_0x4d63('0xb6')](_0x38e56a);}})[_0x4d63('0x35')](function(_0x3eef02){if(_0x3eef02){return _0x3eef02?{'count':_0x26a82e,'rows':_0x3eef02}:null;}})[_0x4d63('0x35')](respondWithResult(_0x38fe6e,null))[_0x4d63('0x25')](handleError(_0x38fe6e,null));};exports[_0x4d63('0x39')]=function(_0x503921,_0x56e297,_0x4ad951){var _0x3f42c6,_0x44d226,_0x28f5c1;if(_[_0x4d63('0x7a')](_0x503921[_0x4d63('0x5a')][_0x4d63('0x5a')])||_0x503921[_0x4d63('0x5a')][_0x4d63('0x5a')]===''){throw new db[(_0x4d63('0x70'))]['ValidationError'](_0x4d63('0x79'));}if(_['isNil'](_0x503921[_0x4d63('0x5a')]['to'])){}_0x3f42c6=_0x503921[_0x4d63('0x5a')]['to'];return db['OpenchannelAccount'][_0x4d63('0x66')]({'where':{'id':_0x503921['params']['id']}})['then'](handleEntityNotFound(_0x56e297,null))[_0x4d63('0x35')](function(_0x55a790){if(_0x55a790){return db[_0x4d63('0x3e')][_0x4d63('0x58')]({'where':{'id':_0x55a790['id']},'include':[{'model':db[_0x4d63('0x7e')],'as':_0x4d63('0x82'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x55a790[_0x4d63('0x7b')]]:_0x3f42c6},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x4d63('0x35')](handleEntityNotFound(_0x56e297,null))[_0x4d63('0x35')](function(_0x56940f){if(_0x56940f&&_0x56940f['List']){_0x44d226=_0x56940f[_0x4d63('0x36')]({'plain':!![]});if(_0x44d226[_0x4d63('0x82')]&&_0x44d226[_0x4d63('0x82')][_0x4d63('0x7f')][_0x4d63('0x49')]){return _0x44d226[_0x4d63('0x82')]['Contacts'][0x0];}return db[_0x4d63('0x6f')][_0x4d63('0x59')](_['defaults'](_0x503921['body'],{'firstName':_0x3f42c6,[_0x56940f[_0x4d63('0x7b')]]:_0x3f42c6,'phone':_0x3f42c6,'ListId':_0x44d226[_0x4d63('0x75')]}));}})[_0x4d63('0x35')](handleEntityNotFound(_0x56e297,null))[_0x4d63('0x35')](function(_0xb07e46){if(_0xb07e46){_0x28f5c1=_0xb07e46;return db[_0x4d63('0x8b')][_0x4d63('0x58')]({'where':{'ContactId':_0x28f5c1['id'],'closed':![],'OpenchannelAccountId':_0x44d226['id']}})[_0x4d63('0x35')](function(_0x3757ef){if(_0x3757ef){return[_0x3757ef,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x503921[_0x4d63('0x5b')]['id'],'ContactId':_0x28f5c1['id'],'OpenchannelAccountId':_0x44d226['id'],'lastMsgDirection':_0x4d63('0xb7'),'firstMsgDirection':_0x4d63('0xb7'),'Messages':[_['merge'](_0x503921[_0x4d63('0x5a')],{'read':![],'body':_0x503921[_0x4d63('0x5a')][_0x4d63('0x5a')],'OpenchannelAccountId':_0x44d226['id'],'UserId':_0x503921[_0x4d63('0x5b')]['id'],'ContactId':_0x28f5c1['id']})]},{'include':[{'model':db[_0x4d63('0xb8')],'as':_0x4d63('0xb9')}]})['then'](function(_0x30428e){return[_0x30428e,!![]];});});}})[_0x4d63('0xb0')](function(_0x1c226d,_0x186b08){if(_0x186b08){return _0x1c226d;}return db[_0x4d63('0xb8')][_0x4d63('0x59')](_['merge'](_0x503921[_0x4d63('0x5a')],{'read':![],'body':_0x503921[_0x4d63('0x5a')]['body'],'OpenchannelAccountId':_0x44d226['id'],'OpenchannelInteractionId':_0x1c226d['id'],'UserId':_0x503921[_0x4d63('0x5b')]['id'],'ContactId':_0x28f5c1['id']}))[_0x4d63('0x35')](function(_0x40b2ca){_0x1c226d[_0x4d63('0xba')][_0x4d63('0xb9')]=[];_0x1c226d[_0x4d63('0xba')]['Messages']['push'](_0x40b2ca['dataValues']);return _0x1c226d;});});}})[_0x4d63('0x35')](respondWithResult(_0x56e297,null))[_0x4d63('0x25')](handleError(_0x56e297,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index af47d91..fc78c5e 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22fb=['hook','exports','OpenchannelAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0x22fb,0x192));var _0xb22f=function(_0xe85ca6,_0x75aa69){_0xe85ca6=_0xe85ca6-0x0;var _0x1b1c10=_0x22fb[_0xe85ca6];return _0x1b1c10;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xb22f('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb22f('0x1'),'afterUpdate':_0xb22f('0x2'),'afterDestroy':_0xb22f('0x3')};function emitEvent(_0x10d2c4){return function(_0x201512,_0x50cdab,_0x44717d){OpenchannelAccountEvents[_0xb22f('0x4')](_0x10d2c4+':'+_0x201512['id'],_0x201512);OpenchannelAccountEvents[_0xb22f('0x4')](_0x10d2c4,_0x201512);_0x44717d(null);};}for(var e in events){if(events[_0xb22f('0x5')](e)){var event=events[e];OpenchannelAccount[_0xb22f('0x6')](e,emitEvent(event));}}module[_0xb22f('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xcb91=['save','update','emit','hasOwnProperty','hook','OpenchannelAccount','setMaxListeners'];(function(_0x5155bc,_0x2083f7){var _0x9f43ca=function(_0x10d115){while(--_0x10d115){_0x5155bc['push'](_0x5155bc['shift']());}};_0x9f43ca(++_0x2083f7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0xcb91[_0x3ed054];return _0x16dd95;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x1cb9('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x1cb9('0x1')](0x0);var events={'afterCreate':_0x1cb9('0x2'),'afterUpdate':_0x1cb9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8c392f){return function(_0x2c17b8,_0x545a34,_0x13d5fd){OpenchannelAccountEvents[_0x1cb9('0x4')](_0x8c392f+':'+_0x2c17b8['id'],_0x2c17b8);OpenchannelAccountEvents['emit'](_0x8c392f,_0x2c17b8);_0x13d5fd(null);};}for(var e in events){if(events[_0x1cb9('0x5')](e)){var event=events[e];OpenchannelAccount[_0x1cb9('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 74a28b1..8c8d506 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(_0x325ef0,_0x2e70f7){var _0x46b472=function(_0x3f8bd1){while(--_0x3f8bd1){_0x325ef0['push'](_0x325ef0['shift']());}};_0x46b472(++_0x2e70f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x53d7f2,_0x4d9e54){var _0x69d96=function(_0x4d63c4){while(--_0x4d63c4){_0x53d7f2['push'](_0x53d7f2['shift']());}};_0x69d96(++_0x4d9e54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 62880d3..468075f 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 _0x84a0=['redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0xddc012,_0x5cf07a){var _0x395581=function(_0x483e9d){while(--_0x483e9d){_0xddc012['push'](_0xddc012['shift']());}};_0x395581(++_0x5cf07a);}(_0x84a0,0x66));var _0x084a=function(_0x19aee6,_0xcb2918){_0x19aee6=_0x19aee6-0x0;var _0x511975=_0x84a0[_0x19aee6];return _0x511975;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var moment=require(_0x084a('0x2'));var BPromise=require(_0x084a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x084a('0x4'));var db=require(_0x084a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x084a('0x6'));var config=require(_0x084a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x084a('0x8')][_0x084a('0x9')]({'port':0x232a});config[_0x084a('0xa')]=_[_0x084a('0xb')](config[_0x084a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x084a('0xc'))(new Redis(config[_0x084a('0xa')]));require(_0x084a('0xd'))[_0x084a('0xe')](socket);function respondWithRpcPromise(_0x142127,_0x4c1e29,_0x4dd423){return new BPromise(function(_0x3d9dc6,_0x853df){return client[_0x084a('0xf')](_0x142127,_0x4dd423)[_0x084a('0x10')](function(_0x2d7c90){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x4c1e29,_0x084a('0x11'));logger[_0x084a('0x12')](_0x084a('0x13'),_0x4c1e29,_0x084a('0x11'),JSON[_0x084a('0x14')](_0x2d7c90));if(_0x2d7c90[_0x084a('0x15')]){if(_0x2d7c90[_0x084a('0x15')][_0x084a('0x16')]===0x1f4){logger['error'](_0x084a('0x17'),_0x4c1e29,_0x2d7c90['error'][_0x084a('0x18')]);return _0x853df(_0x2d7c90[_0x084a('0x15')][_0x084a('0x18')]);}logger[_0x084a('0x15')](_0x084a('0x17'),_0x4c1e29,_0x2d7c90['error'][_0x084a('0x18')]);return _0x3d9dc6(_0x2d7c90['error'][_0x084a('0x18')]);}else{logger[_0x084a('0x19')]('OpenchannelAccount,\x20%s,\x20%s',_0x4c1e29,_0x084a('0x11'));_0x3d9dc6(_0x2d7c90[_0x084a('0x1a')][_0x084a('0x18')]);}})[_0x084a('0x1b')](function(_0x33d3a6){logger[_0x084a('0x15')](_0x084a('0x17'),_0x4c1e29,_0x33d3a6);_0x853df(_0x33d3a6);});});} \ No newline at end of file +var _0x3070=['register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','./openchannelAccount.socket'];(function(_0x7fa2a1,_0x84d256){var _0x2cedf0=function(_0x210f8b){while(--_0x210f8b){_0x7fa2a1['push'](_0x7fa2a1['shift']());}};_0x2cedf0(++_0x84d256);}(_0x3070,0x75));var _0x0307=function(_0x15fdd4,_0xe13d5e){_0x15fdd4=_0x15fdd4-0x0;var _0xaa8b3a=_0x3070[_0x15fdd4];return _0xaa8b3a;};'use strict';var _=require('lodash');var util=require(_0x0307('0x0'));var moment=require('moment');var BPromise=require(_0x0307('0x1'));var rs=require(_0x0307('0x2'));var fs=require('fs');var Redis=require(_0x0307('0x3'));var db=require(_0x0307('0x4'))['db'];var utils=require(_0x0307('0x5'));var logger=require(_0x0307('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0307('0x7'));var client=jayson[_0x0307('0x8')][_0x0307('0x9')]({'port':0x232a});config[_0x0307('0xa')]=_['defaults'](config[_0x0307('0xa')],{'host':_0x0307('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0307('0xa')]));require(_0x0307('0xc'))[_0x0307('0xd')](socket);function respondWithRpcPromise(_0xd40e5d,_0x18d426,_0x33c001){return new BPromise(function(_0x10513a,_0x461212){return client[_0x0307('0xe')](_0xd40e5d,_0x33c001)['then'](function(_0x41d9a0){logger['info'](_0x0307('0xf'),_0x18d426,_0x0307('0x10'));logger[_0x0307('0x11')](_0x0307('0x12'),_0x18d426,_0x0307('0x10'),JSON[_0x0307('0x13')](_0x41d9a0));if(_0x41d9a0[_0x0307('0x14')]){if(_0x41d9a0[_0x0307('0x14')][_0x0307('0x15')]===0x1f4){logger[_0x0307('0x14')](_0x0307('0xf'),_0x18d426,_0x41d9a0[_0x0307('0x14')][_0x0307('0x16')]);return _0x461212(_0x41d9a0[_0x0307('0x14')][_0x0307('0x16')]);}logger['error'](_0x0307('0xf'),_0x18d426,_0x41d9a0[_0x0307('0x14')][_0x0307('0x16')]);return _0x10513a(_0x41d9a0['error']['message']);}else{logger[_0x0307('0x17')](_0x0307('0xf'),_0x18d426,_0x0307('0x10'));_0x10513a(_0x41d9a0[_0x0307('0x18')][_0x0307('0x16')]);}})[_0x0307('0x19')](function(_0x1f97ca){logger['error'](_0x0307('0xf'),_0x18d426,_0x1f97ca);_0x461212(_0x1f97ca);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 850e607..22b7757 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 _0x636f=['length','openchannelAccount:','remove','update','removeListener','register'];(function(_0x224012,_0x293e50){var _0x544142=function(_0x5f0835){while(--_0x5f0835){_0x224012['push'](_0x224012['shift']());}};_0x544142(++_0x293e50);}(_0x636f,0x188));var _0xf636=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x636f[_0x3bf83f];return _0x22c4a9;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0xf636('0x0'),_0xf636('0x1')];function createListener(_0x17e637,_0x42cf1c){return function(_0x20d16a){_0x42cf1c['emit'](_0x17e637,_0x20d16a);};}function removeListener(_0x29ac70,_0x1479ae){return function(){OpenchannelAccountEvents[_0xf636('0x2')](_0x29ac70,_0x1479ae);};}exports[_0xf636('0x3')]=function(_0x39c5f1){for(var _0x526990=0x0,_0xdae985=events[_0xf636('0x4')];_0x526990<_0xdae985;_0x526990++){var _0x2da859=events[_0x526990];var _0x3f6dfb=createListener(_0xf636('0x5')+_0x2da859,_0x39c5f1);OpenchannelAccountEvents['on'](_0x2da859,_0x3f6dfb);}}; \ No newline at end of file +var _0x1be1=['remove','update','emit','removeListener','register','openchannelAccount:'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1be1,0x192));var _0x11be=function(_0x580285,_0x1aa7e1){_0x580285=_0x580285-0x0;var _0x533133=_0x1be1[_0x580285];return _0x533133;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x11be('0x0'),_0x11be('0x1')];function createListener(_0x5527b3,_0x175deb){return function(_0xd002ca){_0x175deb[_0x11be('0x2')](_0x5527b3,_0xd002ca);};}function removeListener(_0x318d41,_0x504d3a){return function(){OpenchannelAccountEvents[_0x11be('0x3')](_0x318d41,_0x504d3a);};}exports[_0x11be('0x4')]=function(_0x11f793){for(var _0x479719=0x0,_0xfe8c62=events['length'];_0x479719<_0xfe8c62;_0x479719++){var _0x18f661=events[_0x479719];var _0x11fc15=createListener(_0x11be('0x5')+_0x18f661,_0x11f793);OpenchannelAccountEvents['on'](_0x18f661,_0x11fc15);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 45ab023..f13cdb3 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 _0x8560=['/:id','show','post','create','put','isAuthenticated','update','delete','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelApplication.controller','get','index'];(function(_0x152719,_0x377574){var _0x3f7961=function(_0x3cfc7d){while(--_0x3cfc7d){_0x152719['push'](_0x152719['shift']());}};_0x3f7961(++_0x377574);}(_0x8560,0xe8));var _0x0856=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x8560[_0x30faec];return _0x29484f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0856('0x0'));var express=require(_0x0856('0x1'));var router=express[_0x0856('0x2')]();var fs_extra=require(_0x0856('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0856('0x4'));var config=require('../../config/environment');var controller=require(_0x0856('0x5'));router[_0x0856('0x6')]('/',auth['isAuthenticated'](),controller[_0x0856('0x7')]);router[_0x0856('0x6')](_0x0856('0x8'),auth['isAuthenticated'](),controller[_0x0856('0x9')]);router[_0x0856('0xa')]('/',auth['isAuthenticated'](),controller[_0x0856('0xb')]);router[_0x0856('0xc')](_0x0856('0x8'),auth[_0x0856('0xd')](),controller[_0x0856('0xe')]);router[_0x0856('0xf')](_0x0856('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3330=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','multer'];(function(_0x502953,_0x28de83){var _0x2fa32d=function(_0x3b3a52){while(--_0x3b3a52){_0x502953['push'](_0x502953['shift']());}};_0x2fa32d(++_0x28de83);}(_0x3330,0x1cd));var _0x0333=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x3330[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x0333('0x0'));var util=require(_0x0333('0x1'));var path=require('path');var timeout=require(_0x0333('0x2'));var express=require(_0x0333('0x3'));var router=express[_0x0333('0x4')]();var fs_extra=require(_0x0333('0x5'));var auth=require(_0x0333('0x6'));var interaction=require(_0x0333('0x7'));var config=require(_0x0333('0x8'));var controller=require(_0x0333('0x9'));router[_0x0333('0xa')]('/',auth['isAuthenticated'](),controller[_0x0333('0xb')]);router[_0x0333('0xa')](_0x0333('0xc'),auth['isAuthenticated'](),controller[_0x0333('0xd')]);router[_0x0333('0xe')]('/',auth[_0x0333('0xf')](),controller[_0x0333('0x10')]);router[_0x0333('0x11')]('/:id',auth[_0x0333('0xf')](),controller[_0x0333('0x12')]);router[_0x0333('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x0333('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 1d03247..1f9b612 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 _0x39e7=['STRING','*,*,*,*','sequelize','exports','noop'];(function(_0x3984d0,_0x5c72ce){var _0xb71ce8=function(_0x2fd779){while(--_0x2fd779){_0x3984d0['push'](_0x3984d0['shift']());}};_0xb71ce8(++_0x5c72ce);}(_0x39e7,0x98));var _0x739e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x39e7[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x739e('0x0'));module[_0x739e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x739e('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x739e('0x3')]},'interval':{'type':Sequelize[_0x739e('0x3')],'defaultValue':_0x739e('0x4')}}; \ No newline at end of file +var _0x0551=['*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x0551,0x191));var _0x1055=function(_0x375efe,_0x27df2d){_0x375efe=_0x375efe-0x0;var _0x1d5db6=_0x0551[_0x375efe];return _0x1d5db6;};'use strict';var Sequelize=require(_0x1055('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1055('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1055('0x2')],'allowNull':![],'defaultValue':_0x1055('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x1055('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index e8ca7c4..148e292 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 _0x52b2=['fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','name','map','OpenchannelApplication','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','rawAttributes','find','create','catch','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs'];(function(_0x38d2a0,_0xf48b4f){var _0x93079e=function(_0x4f6d2f){while(--_0x4f6d2f){_0x38d2a0['push'](_0x38d2a0['shift']());}};_0x93079e(++_0xf48b4f);}(_0x52b2,0x163));var _0x252b=function(_0x39e1bd,_0x469981){_0x39e1bd=_0x39e1bd-0x0;var _0x3662b9=_0x52b2[_0x39e1bd];return _0x3662b9;};'use strict';var emlformat=require(_0x252b('0x0'));var rimraf=require(_0x252b('0x1'));var zipdir=require(_0x252b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x252b('0x3'));var moment=require(_0x252b('0x4'));var BPromise=require(_0x252b('0x5'));var Mustache=require(_0x252b('0x6'));var util=require(_0x252b('0x7'));var path=require(_0x252b('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x252b('0x9'));var fs=require('fs');var fs_extra=require(_0x252b('0xa'));var _=require('lodash');var squel=require(_0x252b('0xb'));var crypto=require(_0x252b('0xc'));var jsforce=require(_0x252b('0xd'));var deskjs=require(_0x252b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x252b('0xf'));var Papa=require('papaparse');var Redis=require(_0x252b('0x10'));var authService=require(_0x252b('0x11'));var qs=require(_0x252b('0x12'));var as=require(_0x252b('0x13'));var hardwareService=require(_0x252b('0x14'));var logger=require(_0x252b('0x15'))(_0x252b('0x16'));var utils=require(_0x252b('0x17'));var config=require(_0x252b('0x18'));var licenseUtil=require(_0x252b('0x19'));var db=require(_0x252b('0x1a'))['db'];function respondWithStatusCode(_0x46beb1,_0x2c5af3){_0x2c5af3=_0x2c5af3||0xcc;return function(_0x257c0d){if(_0x257c0d){return _0x46beb1[_0x252b('0x1b')](_0x2c5af3);}return _0x46beb1[_0x252b('0x1c')](_0x2c5af3)['end']();};}function respondWithResult(_0x17b5f4,_0x52fadf){_0x52fadf=_0x52fadf||0xc8;return function(_0x5bc751){if(_0x5bc751){return _0x17b5f4[_0x252b('0x1c')](_0x52fadf)[_0x252b('0x1d')](_0x5bc751);}};}function respondWithFilteredResult(_0xb5299f,_0x35dd65){return function(_0x288a53){if(_0x288a53){var _0x119e4f=typeof _0x35dd65[_0x252b('0x1e')]===_0x252b('0x1f')&&typeof _0x35dd65[_0x252b('0x20')]===_0x252b('0x1f');var _0x35fb2f=_0x288a53[_0x252b('0x21')];var _0xcef9c1=_0x119e4f?0x0:_0x35dd65[_0x252b('0x1e')];var _0x1098ce=_0x119e4f?_0x288a53[_0x252b('0x21')]:_0x35dd65[_0x252b('0x1e')]+_0x35dd65['limit'];var _0x51f2a3;if(_0x1098ce>=_0x35fb2f){_0x1098ce=_0x35fb2f;_0x51f2a3=0xc8;}else{_0x51f2a3=0xce;}_0xb5299f[_0x252b('0x1c')](_0x51f2a3);return _0xb5299f['set']('Content-Range',_0xcef9c1+'-'+_0x1098ce+'/'+_0x35fb2f)[_0x252b('0x1d')](_0x288a53);}return null;};}function patchUpdates(_0x28cf9f){return function(_0x2de61b){try{jsonpatch[_0x252b('0x22')](_0x2de61b,_0x28cf9f,!![]);}catch(_0x353d0d){return BPromise[_0x252b('0x23')](_0x353d0d);}return _0x2de61b[_0x252b('0x24')]();};}function saveUpdates(_0x3d2795,_0xb290f9){return function(_0x564491){if(_0x564491){return _0x564491[_0x252b('0x25')](_0x3d2795)[_0x252b('0x26')](function(_0x28cef7){return _0x28cef7;});}return null;};}function removeEntity(_0x3ac296,_0x54ae33){return function(_0x10f961){if(_0x10f961){return _0x10f961['destroy']()['then'](function(){_0x3ac296['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48e9c9,_0x5181ea){return function(_0x252686){if(!_0x252686){_0x48e9c9[_0x252b('0x1b')](0x194);}return _0x252686;};}function handleError(_0x793458,_0x5287af){_0x5287af=_0x5287af||0x1f4;return function(_0x3c8ecd){logger['error'](_0x3c8ecd['stack']);if(_0x3c8ecd['name']){delete _0x3c8ecd[_0x252b('0x27')];}_0x793458[_0x252b('0x1c')](_0x5287af)['send'](_0x3c8ecd);};}exports['index']=function(_0x4fba70,_0x38b32a){var _0x13322e={},_0xd5370c={},_0x4df629={'count':0x0,'rows':[]};var _0x328faf=_[_0x252b('0x28')](db[_0x252b('0x29')]['rawAttributes'],function(_0x2b1074){return{'name':_0x2b1074[_0x252b('0x2a')],'type':_0x2b1074[_0x252b('0x2b')][_0x252b('0x2c')]};});_0xd5370c['model']=_[_0x252b('0x28')](_0x328faf,_0x252b('0x27'));_0xd5370c[_0x252b('0x2d')]=_[_0x252b('0x2e')](_0x4fba70['query']);_0xd5370c[_0x252b('0x2f')]=_[_0x252b('0x30')](_0xd5370c['model'],_0xd5370c[_0x252b('0x2d')]);_0x13322e[_0x252b('0x31')]=_[_0x252b('0x30')](_0xd5370c['model'],qs[_0x252b('0x32')](_0x4fba70['query']['fields']));_0x13322e['attributes']=_0x13322e[_0x252b('0x31')][_0x252b('0x33')]?_0x13322e[_0x252b('0x31')]:_0xd5370c[_0x252b('0x34')];if(!_0x4fba70[_0x252b('0x2d')][_0x252b('0x35')](_0x252b('0x36'))){_0x13322e[_0x252b('0x20')]=qs[_0x252b('0x20')](_0x4fba70[_0x252b('0x2d')][_0x252b('0x20')]);_0x13322e[_0x252b('0x1e')]=qs['offset'](_0x4fba70['query'][_0x252b('0x1e')]);}_0x13322e[_0x252b('0x37')]=qs[_0x252b('0x38')](_0x4fba70[_0x252b('0x2d')][_0x252b('0x38')]);_0x13322e[_0x252b('0x39')]=qs['filters'](_[_0x252b('0x3a')](_0x4fba70['query'],_0xd5370c['filters']),_0x328faf);if(_0x4fba70[_0x252b('0x2d')][_0x252b('0x3b')]){_0x13322e[_0x252b('0x39')]=_['merge'](_0x13322e['where'],{'$or':_[_0x252b('0x28')](_0x328faf,function(_0x1a9907){if(_0x1a9907[_0x252b('0x2b')]!=='VIRTUAL'){var _0x15c24c={};_0x15c24c[_0x1a9907['name']]={'$like':'%'+_0x4fba70['query'][_0x252b('0x3b')]+'%'};return _0x15c24c;}})});}_0x13322e=_[_0x252b('0x3c')]({},_0x13322e,_0x4fba70[_0x252b('0x3d')]);var _0x209d63={'where':_0x13322e[_0x252b('0x39')]};return db[_0x252b('0x29')][_0x252b('0x21')](_0x209d63)[_0x252b('0x26')](function(_0x3e8a2d){_0x4df629[_0x252b('0x21')]=_0x3e8a2d;if(_0x4fba70[_0x252b('0x2d')]['includeAll']){_0x13322e[_0x252b('0x3e')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x252b('0x3f')](_0x13322e);})[_0x252b('0x26')](function(_0x2f3659){_0x4df629[_0x252b('0x40')]=_0x2f3659;return _0x4df629;})[_0x252b('0x26')](respondWithFilteredResult(_0x38b32a,_0x13322e))['catch'](handleError(_0x38b32a,null));};exports[_0x252b('0x41')]=function(_0x3e1945,_0x41747b){var _0x55cfe1={'raw':!![],'where':{'id':_0x3e1945[_0x252b('0x42')]['id']}},_0x2fbaa={};_0x2fbaa[_0x252b('0x34')]=_[_0x252b('0x2e')](db[_0x252b('0x29')][_0x252b('0x43')]);_0x2fbaa['query']=_['keys'](_0x3e1945[_0x252b('0x2d')]);_0x2fbaa['filters']=_[_0x252b('0x30')](_0x2fbaa[_0x252b('0x34')],_0x2fbaa[_0x252b('0x2d')]);_0x55cfe1[_0x252b('0x31')]=_[_0x252b('0x30')](_0x2fbaa[_0x252b('0x34')],qs['fields'](_0x3e1945['query'][_0x252b('0x32')]));_0x55cfe1[_0x252b('0x31')]=_0x55cfe1[_0x252b('0x31')]['length']?_0x55cfe1[_0x252b('0x31')]:_0x2fbaa[_0x252b('0x34')];if(_0x3e1945['query']['includeAll']){_0x55cfe1[_0x252b('0x3e')]=[{'all':!![]}];}_0x55cfe1=_[_0x252b('0x3c')]({},_0x55cfe1,_0x3e1945[_0x252b('0x3d')]);return db['OpenchannelApplication'][_0x252b('0x44')](_0x55cfe1)[_0x252b('0x26')](handleEntityNotFound(_0x41747b,null))[_0x252b('0x26')](respondWithResult(_0x41747b,null))['catch'](handleError(_0x41747b,null));};exports[_0x252b('0x45')]=function(_0x12cd43,_0x3f7921){return db[_0x252b('0x29')][_0x252b('0x45')](_0x12cd43['body'],{})[_0x252b('0x26')](respondWithResult(_0x3f7921,0xc9))[_0x252b('0x46')](handleError(_0x3f7921,null));};exports['update']=function(_0x1a45e5,_0x26295a){if(_0x1a45e5[_0x252b('0x47')]['id']){delete _0x1a45e5[_0x252b('0x47')]['id'];}return db[_0x252b('0x29')]['find']({'where':{'id':_0x1a45e5[_0x252b('0x42')]['id']}})[_0x252b('0x26')](handleEntityNotFound(_0x26295a,null))[_0x252b('0x26')](saveUpdates(_0x1a45e5['body'],null))[_0x252b('0x26')](respondWithResult(_0x26295a,null))[_0x252b('0x46')](handleError(_0x26295a,null));};exports[_0x252b('0x48')]=function(_0x2762f6,_0x3ad44d){return db[_0x252b('0x29')][_0x252b('0x44')]({'where':{'id':_0x2762f6[_0x252b('0x42')]['id']}})[_0x252b('0x26')](handleEntityNotFound(_0x3ad44d,null))['then'](removeEntity(_0x3ad44d,null))[_0x252b('0x46')](handleError(_0x3ad44d,null));}; \ No newline at end of file +var _0xcb92=['stack','name','send','map','OpenchannelApplication','rawAttributes','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','type','count','includeAll','include','findAll','rows','length','options','find','catch','create','body','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','offset','set','reject','save','update','then','destroy','sendStatus','error'];(function(_0x8ee873,_0x35651b){var _0x18dc06=function(_0x192f1c){while(--_0x192f1c){_0x8ee873['push'](_0x8ee873['shift']());}};_0x18dc06(++_0x35651b);}(_0xcb92,0xdf));var _0x2cb9=function(_0x3442dd,_0x32c909){_0x3442dd=_0x3442dd-0x0;var _0x54758c=_0xcb92[_0x3442dd];return _0x54758c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2cb9('0x0'));var jsonpatch=require(_0x2cb9('0x1'));var rp=require('request-promise');var moment=require(_0x2cb9('0x2'));var BPromise=require(_0x2cb9('0x3'));var Mustache=require('mustache');var util=require(_0x2cb9('0x4'));var path=require(_0x2cb9('0x5'));var sox=require(_0x2cb9('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2cb9('0x7'));var _=require(_0x2cb9('0x8'));var squel=require(_0x2cb9('0x9'));var crypto=require(_0x2cb9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2cb9('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2cb9('0xc'));var Papa=require(_0x2cb9('0xd'));var Redis=require(_0x2cb9('0xe'));var authService=require(_0x2cb9('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2cb9('0x10'));var utils=require(_0x2cb9('0x11'));var config=require(_0x2cb9('0x12'));var licenseUtil=require(_0x2cb9('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x404648,_0x15b50d){_0x15b50d=_0x15b50d||0xcc;return function(_0x4a0194){if(_0x4a0194){return _0x404648['sendStatus'](_0x15b50d);}return _0x404648[_0x2cb9('0x14')](_0x15b50d)['end']();};}function respondWithResult(_0xabb84e,_0x384e9f){_0x384e9f=_0x384e9f||0xc8;return function(_0x570322){if(_0x570322){return _0xabb84e[_0x2cb9('0x14')](_0x384e9f)[_0x2cb9('0x15')](_0x570322);}};}function respondWithFilteredResult(_0x215164,_0x58d142){return function(_0x506888){if(_0x506888){var _0x323f5f=typeof _0x58d142['offset']===_0x2cb9('0x16')&&typeof _0x58d142[_0x2cb9('0x17')]===_0x2cb9('0x16');var _0x2249c6=_0x506888['count'];var _0x132435=_0x323f5f?0x0:_0x58d142[_0x2cb9('0x18')];var _0x18d6b2=_0x323f5f?_0x506888['count']:_0x58d142[_0x2cb9('0x18')]+_0x58d142[_0x2cb9('0x17')];var _0x30b66a;if(_0x18d6b2>=_0x2249c6){_0x18d6b2=_0x2249c6;_0x30b66a=0xc8;}else{_0x30b66a=0xce;}_0x215164[_0x2cb9('0x14')](_0x30b66a);return _0x215164[_0x2cb9('0x19')]('Content-Range',_0x132435+'-'+_0x18d6b2+'/'+_0x2249c6)[_0x2cb9('0x15')](_0x506888);}return null;};}function patchUpdates(_0x1f5bbc){return function(_0x1d8c41){try{jsonpatch['apply'](_0x1d8c41,_0x1f5bbc,!![]);}catch(_0x19b88b){return BPromise[_0x2cb9('0x1a')](_0x19b88b);}return _0x1d8c41[_0x2cb9('0x1b')]();};}function saveUpdates(_0x5dd77c,_0x3df5fb){return function(_0x506233){if(_0x506233){return _0x506233[_0x2cb9('0x1c')](_0x5dd77c)[_0x2cb9('0x1d')](function(_0x2bbbe2){return _0x2bbbe2;});}return null;};}function removeEntity(_0x5c367c,_0x4b3a90){return function(_0x55f581){if(_0x55f581){return _0x55f581[_0x2cb9('0x1e')]()[_0x2cb9('0x1d')](function(){_0x5c367c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f3ff3,_0x20f327){return function(_0x24857c){if(!_0x24857c){_0x2f3ff3[_0x2cb9('0x1f')](0x194);}return _0x24857c;};}function handleError(_0x52317f,_0x201173){_0x201173=_0x201173||0x1f4;return function(_0xf0e7f5){logger[_0x2cb9('0x20')](_0xf0e7f5[_0x2cb9('0x21')]);if(_0xf0e7f5[_0x2cb9('0x22')]){delete _0xf0e7f5['name'];}_0x52317f[_0x2cb9('0x14')](_0x201173)[_0x2cb9('0x23')](_0xf0e7f5);};}exports['index']=function(_0x95b90d,_0x38d66e){var _0x494b69={},_0x4aeccb={},_0x104d45={'count':0x0,'rows':[]};var _0x52d0cd=_[_0x2cb9('0x24')](db[_0x2cb9('0x25')][_0x2cb9('0x26')],function(_0x41f195){return{'name':_0x41f195['fieldName'],'type':_0x41f195['type']['key']};});_0x4aeccb[_0x2cb9('0x27')]=_[_0x2cb9('0x24')](_0x52d0cd,_0x2cb9('0x22'));_0x4aeccb[_0x2cb9('0x28')]=_[_0x2cb9('0x29')](_0x95b90d[_0x2cb9('0x28')]);_0x4aeccb['filters']=_[_0x2cb9('0x2a')](_0x4aeccb[_0x2cb9('0x27')],_0x4aeccb['query']);_0x494b69[_0x2cb9('0x2b')]=_['intersection'](_0x4aeccb[_0x2cb9('0x27')],qs[_0x2cb9('0x2c')](_0x95b90d[_0x2cb9('0x28')][_0x2cb9('0x2c')]));_0x494b69[_0x2cb9('0x2b')]=_0x494b69[_0x2cb9('0x2b')]['length']?_0x494b69[_0x2cb9('0x2b')]:_0x4aeccb['model'];if(!_0x95b90d[_0x2cb9('0x28')]['hasOwnProperty'](_0x2cb9('0x2d'))){_0x494b69[_0x2cb9('0x17')]=qs['limit'](_0x95b90d[_0x2cb9('0x28')]['limit']);_0x494b69[_0x2cb9('0x18')]=qs['offset'](_0x95b90d[_0x2cb9('0x28')][_0x2cb9('0x18')]);}_0x494b69[_0x2cb9('0x2e')]=qs[_0x2cb9('0x2f')](_0x95b90d[_0x2cb9('0x28')][_0x2cb9('0x2f')]);_0x494b69[_0x2cb9('0x30')]=qs['filters'](_['pick'](_0x95b90d[_0x2cb9('0x28')],_0x4aeccb[_0x2cb9('0x31')]),_0x52d0cd);if(_0x95b90d[_0x2cb9('0x28')][_0x2cb9('0x32')]){_0x494b69[_0x2cb9('0x30')]=_[_0x2cb9('0x33')](_0x494b69[_0x2cb9('0x30')],{'$or':_[_0x2cb9('0x24')](_0x52d0cd,function(_0x47d4ac){if(_0x47d4ac[_0x2cb9('0x34')]!=='VIRTUAL'){var _0x248718={};_0x248718[_0x47d4ac[_0x2cb9('0x22')]]={'$like':'%'+_0x95b90d['query'][_0x2cb9('0x32')]+'%'};return _0x248718;}})});}_0x494b69=_['merge']({},_0x494b69,_0x95b90d['options']);var _0x2f1bfa={'where':_0x494b69[_0x2cb9('0x30')]};return db['OpenchannelApplication'][_0x2cb9('0x35')](_0x2f1bfa)[_0x2cb9('0x1d')](function(_0x579855){_0x104d45[_0x2cb9('0x35')]=_0x579855;if(_0x95b90d['query'][_0x2cb9('0x36')]){_0x494b69[_0x2cb9('0x37')]=[{'all':!![]}];}return db[_0x2cb9('0x25')][_0x2cb9('0x38')](_0x494b69);})['then'](function(_0x3d2207){_0x104d45[_0x2cb9('0x39')]=_0x3d2207;return _0x104d45;})[_0x2cb9('0x1d')](respondWithFilteredResult(_0x38d66e,_0x494b69))['catch'](handleError(_0x38d66e,null));};exports['show']=function(_0xfc344e,_0x4123ad){var _0x1ab114={'raw':!![],'where':{'id':_0xfc344e['params']['id']}},_0xf70f05={};_0xf70f05['model']=_[_0x2cb9('0x29')](db['OpenchannelApplication'][_0x2cb9('0x26')]);_0xf70f05[_0x2cb9('0x28')]=_['keys'](_0xfc344e['query']);_0xf70f05[_0x2cb9('0x31')]=_['intersection'](_0xf70f05[_0x2cb9('0x27')],_0xf70f05[_0x2cb9('0x28')]);_0x1ab114[_0x2cb9('0x2b')]=_[_0x2cb9('0x2a')](_0xf70f05[_0x2cb9('0x27')],qs['fields'](_0xfc344e['query'][_0x2cb9('0x2c')]));_0x1ab114[_0x2cb9('0x2b')]=_0x1ab114['attributes'][_0x2cb9('0x3a')]?_0x1ab114[_0x2cb9('0x2b')]:_0xf70f05['model'];if(_0xfc344e[_0x2cb9('0x28')][_0x2cb9('0x36')]){_0x1ab114[_0x2cb9('0x37')]=[{'all':!![]}];}_0x1ab114=_[_0x2cb9('0x33')]({},_0x1ab114,_0xfc344e[_0x2cb9('0x3b')]);return db['OpenchannelApplication'][_0x2cb9('0x3c')](_0x1ab114)['then'](handleEntityNotFound(_0x4123ad,null))[_0x2cb9('0x1d')](respondWithResult(_0x4123ad,null))[_0x2cb9('0x3d')](handleError(_0x4123ad,null));};exports[_0x2cb9('0x3e')]=function(_0x24aadd,_0x172d35){return db[_0x2cb9('0x25')][_0x2cb9('0x3e')](_0x24aadd['body'],{})['then'](respondWithResult(_0x172d35,0xc9))[_0x2cb9('0x3d')](handleError(_0x172d35,null));};exports[_0x2cb9('0x1c')]=function(_0x588e8a,_0x516d45){if(_0x588e8a['body']['id']){delete _0x588e8a[_0x2cb9('0x3f')]['id'];}return db[_0x2cb9('0x25')][_0x2cb9('0x3c')]({'where':{'id':_0x588e8a['params']['id']}})['then'](handleEntityNotFound(_0x516d45,null))[_0x2cb9('0x1d')](saveUpdates(_0x588e8a['body'],null))[_0x2cb9('0x1d')](respondWithResult(_0x516d45,null))['catch'](handleError(_0x516d45,null));};exports[_0x2cb9('0x1e')]=function(_0x299156,_0x362ce8){return db['OpenchannelApplication'][_0x2cb9('0x3c')]({'where':{'id':_0x299156['params']['id']}})[_0x2cb9('0x1d')](handleEntityNotFound(_0x362ce8,null))[_0x2cb9('0x1d')](removeEntity(_0x362ce8,null))[_0x2cb9('0x3d')](handleError(_0x362ce8,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index a72412e..217d2c5 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 _0x26bc=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','./openchannelApplication.attributes','exports','define'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x26bc,0x152));var _0xc26b=function(_0x4f7de3,_0x4662e6){_0x4f7de3=_0x4f7de3-0x0;var _0x24036c=_0x26bc[_0x4f7de3];return _0x24036c;};'use strict';var _=require(_0xc26b('0x0'));var util=require(_0xc26b('0x1'));var logger=require('../../config/logger')(_0xc26b('0x2'));var moment=require(_0xc26b('0x3'));var BPromise=require(_0xc26b('0x4'));var rp=require(_0xc26b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc26b('0x6'));var config=require('../../config/environment');var attributes=require(_0xc26b('0x7'));module[_0xc26b('0x8')]=function(_0xc40465,_0x1de666){return _0xc40465[_0xc26b('0x9')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc26b('0xa'),'collate':_0xc26b('0xb')});}; \ No newline at end of file +var _0x0d7f=['rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path'];(function(_0x480540,_0x36df3b){var _0x44d74b=function(_0x1c900e){while(--_0x1c900e){_0x480540['push'](_0x480540['shift']());}};_0x44d74b(++_0x36df3b);}(_0x0d7f,0xfe));var _0xf0d7=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x0d7f[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xf0d7('0x0'));var util=require(_0xf0d7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf0d7('0x2'));var BPromise=require(_0xf0d7('0x3'));var rp=require(_0xf0d7('0x4'));var fs=require('fs');var path=require(_0xf0d7('0x5'));var rimraf=require(_0xf0d7('0x6'));var config=require(_0xf0d7('0x7'));var attributes=require(_0xf0d7('0x8'));module[_0xf0d7('0x9')]=function(_0x3168ab,_0x52694d){return _0x3168ab[_0xf0d7('0xa')](_0xf0d7('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf0d7('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 1b05395..12cc02f 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 _0xa763=['raw','attributes','then','UpdateOpenchannelApplication','debug','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','update','body','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa763,0x19c));var _0x3a76=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0xa763[_0x872b02];return _0x1a6b24;};'use strict';var _=require('lodash');var util=require(_0x3a76('0x0'));var moment=require(_0x3a76('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a76('0x2'));var fs=require('fs');var Redis=require(_0x3a76('0x3'));var db=require(_0x3a76('0x4'))['db'];var utils=require(_0x3a76('0x5'));var logger=require(_0x3a76('0x6'))(_0x3a76('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3a76('0x8')][_0x3a76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c3f7b,_0x3e6838,_0x3c6d58){return new BPromise(function(_0x38aaa1,_0xd32a38){return client[_0x3a76('0xa')](_0x1c3f7b,_0x3c6d58)['then'](function(_0x1301fc){logger[_0x3a76('0xb')](_0x3a76('0xc'),_0x3e6838,_0x3a76('0xd'));logger['debug'](_0x3a76('0xe'),_0x3e6838,'request\x20sent',JSON['stringify'](_0x1301fc));if(_0x1301fc['error']){if(_0x1301fc['error'][_0x3a76('0xf')]===0x1f4){logger[_0x3a76('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x3e6838,_0x1301fc[_0x3a76('0x10')][_0x3a76('0x11')]);return _0xd32a38(_0x1301fc[_0x3a76('0x10')][_0x3a76('0x11')]);}logger[_0x3a76('0x10')](_0x3a76('0xc'),_0x3e6838,_0x1301fc['error'][_0x3a76('0x11')]);return _0x38aaa1(_0x1301fc['error'][_0x3a76('0x11')]);}else{logger[_0x3a76('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x3e6838,_0x3a76('0xd'));_0x38aaa1(_0x1301fc[_0x3a76('0x12')][_0x3a76('0x11')]);}})[_0x3a76('0x13')](function(_0x1045c8){logger['error'](_0x3a76('0xc'),_0x3e6838,_0x1045c8);_0xd32a38(_0x1045c8);});});}exports['UpdateOpenchannelApplication']=function(_0x153504){var _0x2a25c3=this;return new Promise(function(_0x348b35,_0x592c29){return db['OpenchannelApplication'][_0x3a76('0x14')](_0x153504[_0x3a76('0x15')],{'raw':_0x153504[_0x3a76('0x16')]?_0x153504['options'][_0x3a76('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x153504[_0x3a76('0x16')]?_0x153504[_0x3a76('0x16')]['where']||null:null,'attributes':_0x153504[_0x3a76('0x16')]?_0x153504['options'][_0x3a76('0x18')]||null:null,'limit':_0x153504[_0x3a76('0x16')]?_0x153504[_0x3a76('0x16')]['limit']||null:null})[_0x3a76('0x19')](function(_0x24ebfc){logger['info'](_0x3a76('0x1a'),_0x153504);logger[_0x3a76('0x1b')](_0x3a76('0x1a'),_0x153504,JSON[_0x3a76('0x1c')](_0x24ebfc));_0x348b35(_0x24ebfc);})['catch'](function(_0x35f846){logger[_0x3a76('0x10')](_0x3a76('0x1a'),_0x35f846[_0x3a76('0x11')],_0x153504);_0x592c29(_0x2a25c3[_0x3a76('0x10')](0x1f4,_0x35f846['message']));});});}; \ No newline at end of file +var _0x3ec7=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','limit','lodash'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x3ec7,0xd1));var _0x73ec=function(_0x319261,_0x3ba1ca){_0x319261=_0x319261-0x0;var _0x14f0d0=_0x3ec7[_0x319261];return _0x14f0d0;};'use strict';var _=require(_0x73ec('0x0'));var util=require('util');var moment=require(_0x73ec('0x1'));var BPromise=require(_0x73ec('0x2'));var rs=require(_0x73ec('0x3'));var fs=require('fs');var Redis=require(_0x73ec('0x4'));var db=require(_0x73ec('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x73ec('0x6'));var config=require('../../config/environment');var jayson=require(_0x73ec('0x7'));var client=jayson[_0x73ec('0x8')][_0x73ec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1575f3,_0x2d81f9,_0xf4a262){return new BPromise(function(_0x12ff35,_0x59f8c6){return client[_0x73ec('0xa')](_0x1575f3,_0xf4a262)[_0x73ec('0xb')](function(_0x52d8b2){logger[_0x73ec('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x2d81f9,_0x73ec('0xd'));logger[_0x73ec('0xe')](_0x73ec('0xf'),_0x2d81f9,_0x73ec('0xd'),JSON[_0x73ec('0x10')](_0x52d8b2));if(_0x52d8b2[_0x73ec('0x11')]){if(_0x52d8b2[_0x73ec('0x11')][_0x73ec('0x12')]===0x1f4){logger['error'](_0x73ec('0x13'),_0x2d81f9,_0x52d8b2[_0x73ec('0x11')][_0x73ec('0x14')]);return _0x59f8c6(_0x52d8b2[_0x73ec('0x11')][_0x73ec('0x14')]);}logger[_0x73ec('0x11')](_0x73ec('0x13'),_0x2d81f9,_0x52d8b2[_0x73ec('0x11')]['message']);return _0x12ff35(_0x52d8b2['error'][_0x73ec('0x14')]);}else{logger[_0x73ec('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x2d81f9,_0x73ec('0xd'));_0x12ff35(_0x52d8b2['result'][_0x73ec('0x14')]);}})[_0x73ec('0x15')](function(_0x37cbcf){logger[_0x73ec('0x11')](_0x73ec('0x13'),_0x2d81f9,_0x37cbcf);_0x59f8c6(_0x37cbcf);});});}exports[_0x73ec('0x16')]=function(_0x41341d){var _0x1b2394=this;return new Promise(function(_0x40d476,_0x4705a8){return db[_0x73ec('0x17')][_0x73ec('0x18')](_0x41341d[_0x73ec('0x19')],{'raw':_0x41341d['options']?_0x41341d[_0x73ec('0x1a')][_0x73ec('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41341d[_0x73ec('0x1a')]?_0x41341d[_0x73ec('0x1a')][_0x73ec('0x1c')]||null:null,'attributes':_0x41341d['options']?_0x41341d[_0x73ec('0x1a')]['attributes']||null:null,'limit':_0x41341d[_0x73ec('0x1a')]?_0x41341d[_0x73ec('0x1a')][_0x73ec('0x1d')]||null:null})[_0x73ec('0xb')](function(_0x11a601){logger[_0x73ec('0xc')](_0x73ec('0x16'),_0x41341d);logger[_0x73ec('0xe')](_0x73ec('0x16'),_0x41341d,JSON[_0x73ec('0x10')](_0x11a601));_0x40d476(_0x11a601);})[_0x73ec('0x15')](function(_0x1602ec){logger[_0x73ec('0x11')](_0x73ec('0x16'),_0x1602ec['message'],_0x41341d);_0x4705a8(_0x1b2394[_0x73ec('0x11')](0x1f4,_0x1602ec[_0x73ec('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 8762faa..bef1893 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 _0x3469=['/:id/tags','tracked','openchannelinteraction:addtags','addTags','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','path','express','Router','fs-extra','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','download','post','create','addMessage'];(function(_0x55f000,_0x3fd032){var _0x38cbdf=function(_0x2f2c95){while(--_0x2f2c95){_0x55f000['push'](_0x55f000['shift']());}};_0x38cbdf(++_0x3fd032);}(_0x3469,0xcf));var _0x9346=function(_0x2a5903,_0xa82139){_0x2a5903=_0x2a5903-0x0;var _0x18a2c7=_0x3469[_0x2a5903];return _0x18a2c7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9346('0x0'));var timeout=require('connect-timeout');var express=require(_0x9346('0x1'));var router=express[_0x9346('0x2')]();var fs_extra=require(_0x9346('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9346('0x4'));var controller=require(_0x9346('0x5'));router['get']('/',auth[_0x9346('0x6')](),controller[_0x9346('0x7')]);router[_0x9346('0x8')](_0x9346('0x9'),auth[_0x9346('0x6')](),controller['describe']);router[_0x9346('0x8')](_0x9346('0xa'),auth['isAuthenticated'](),controller[_0x9346('0xb')]);router[_0x9346('0x8')](_0x9346('0xc'),auth[_0x9346('0x6')](),controller['getMessages']);router[_0x9346('0x8')]('/:id/download',auth[_0x9346('0x6')](),controller[_0x9346('0xd')]);router[_0x9346('0xe')]('/',auth[_0x9346('0x6')](),controller[_0x9346('0xf')]);router['post'](_0x9346('0xc'),auth[_0x9346('0x6')](),controller[_0x9346('0x10')]);router[_0x9346('0xe')](_0x9346('0x11'),auth[_0x9346('0x6')](),interaction[_0x9346('0x12')]('openchannel',_0x9346('0x13')),controller[_0x9346('0x14')]);router['put'](_0x9346('0xa'),auth['isAuthenticated'](),interaction[_0x9346('0x12')](_0x9346('0x15'),_0x9346('0x16')),controller[_0x9346('0x17')]);router[_0x9346('0x18')](_0x9346('0xa'),auth['isAuthenticated'](),interaction['tracked'](_0x9346('0x15'),_0x9346('0x19')),controller['destroy']);router[_0x9346('0x18')](_0x9346('0x11'),auth[_0x9346('0x6')](),controller[_0x9346('0x1a')]);module[_0x9346('0x1b')]=router; \ No newline at end of file +var _0x94a6=['/describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x94a6,0x1d3));var _0x694a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94a6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x694a('0x0'));var express=require('express');var router=express[_0x694a('0x1')]();var fs_extra=require(_0x694a('0x2'));var auth=require(_0x694a('0x3'));var interaction=require(_0x694a('0x4'));var config=require(_0x694a('0x5'));var controller=require(_0x694a('0x6'));router[_0x694a('0x7')]('/',auth[_0x694a('0x8')](),controller['index']);router[_0x694a('0x7')](_0x694a('0x9'),auth[_0x694a('0x8')](),controller['describe']);router[_0x694a('0x7')](_0x694a('0xa'),auth[_0x694a('0x8')](),controller[_0x694a('0xb')]);router[_0x694a('0x7')]('/:id/messages',auth[_0x694a('0x8')](),controller[_0x694a('0xc')]);router['get'](_0x694a('0xd'),auth['isAuthenticated'](),controller[_0x694a('0xe')]);router[_0x694a('0xf')]('/',auth[_0x694a('0x8')](),controller[_0x694a('0x10')]);router[_0x694a('0xf')](_0x694a('0x11'),auth['isAuthenticated'](),controller['addMessage']);router[_0x694a('0xf')](_0x694a('0x12'),auth[_0x694a('0x8')](),interaction[_0x694a('0x13')](_0x694a('0x14'),_0x694a('0x15')),controller['addTags']);router['put'](_0x694a('0xa'),auth[_0x694a('0x8')](),interaction[_0x694a('0x13')]('openchannel',_0x694a('0x16')),controller[_0x694a('0x17')]);router[_0x694a('0x18')](_0x694a('0xa'),auth[_0x694a('0x8')](),interaction[_0x694a('0x13')](_0x694a('0x14'),_0x694a('0x19')),controller['destroy']);router[_0x694a('0x18')](_0x694a('0x12'),auth[_0x694a('0x8')](),controller[_0x694a('0x1a')]);module[_0x694a('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index ead452e..c523417 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 _0x0b96=['STRING','DATE','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x4256c5,_0x288cee){var _0x3c8bfd=function(_0x5471f1){while(--_0x5471f1){_0x4256c5['push'](_0x4256c5['shift']());}};_0x3c8bfd(++_0x288cee);}(_0x0b96,0xa5));var _0x60b9=function(_0x2f8bc6,_0x4dc869){_0x2f8bc6=_0x2f8bc6-0x0;var _0x2d008a=_0x0b96[_0x2f8bc6];return _0x2d008a;};'use strict';var Sequelize=require(_0x60b9('0x0'));module[_0x60b9('0x1')]={'closed':{'type':Sequelize[_0x60b9('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x60b9('0x3')]},'secondDisposition':{'type':Sequelize[_0x60b9('0x3')]},'thirdDisposition':{'type':Sequelize[_0x60b9('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x60b9('0x4')]},'threadId':{'type':Sequelize[_0x60b9('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x60b9('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x60b9('0x5')]('in',_0x60b9('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x60b9('0x5')]('in',_0x60b9('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x60b9('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x60b9('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe650=['STRING','DATE','ENUM','out','INTEGER','sequelize','exports','BOOLEAN'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xe650,0xfd));var _0x0e65=function(_0x28e919,_0x145939){_0x28e919=_0x28e919-0x0;var _0x692b7e=_0xe650[_0x28e919];return _0x692b7e;};'use strict';var Sequelize=require(_0x0e65('0x0'));module[_0x0e65('0x1')]={'closed':{'type':Sequelize[_0x0e65('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0e65('0x3')]},'secondDisposition':{'type':Sequelize[_0x0e65('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0e65('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x0e65('0x3')]},'externalUrl':{'type':Sequelize[_0x0e65('0x3')]},'lastMsgAt':{'type':Sequelize[_0x0e65('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x0e65('0x5')]('in',_0x0e65('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x0e65('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0e65('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x0e65('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0e65('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 87c1c95..38bc629 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 _0x620e=['openchannel','catch','show','query','from','params','keys','filters','intersection','model','attributes','length','includeAll','include','merge','options','create','body','update','find','describe','addMessage','OpenchannelMessage','omit','getMessages','findOne','fields','nolimit','offset','order','sort','pick','where','OpenchannelInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','ids','spread','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','push','User','Contact','firstName','Attachment','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','fullname','mkdirSync','N.A.','closed','threadId','Public','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','lastName','value','renderFile','views','downloadInteraction.ejs','.pdf','Openchannel','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','rimraf','moment','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','then','destroy','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll'];(function(_0x177d46,_0x2dd37f){var _0x3c18af=function(_0x5ba1f1){while(--_0x5ba1f1){_0x177d46['push'](_0x177d46['shift']());}};_0x3c18af(++_0x2dd37f);}(_0x620e,0x161));var _0xe620=function(_0x1b2a87,_0x1f3502){_0x1b2a87=_0x1b2a87-0x0;var _0x186e90=_0x620e[_0x1b2a87];return _0x186e90;};'use strict';var rimraf=require(_0xe620('0x0'));var zipdir=require('zip-dir');var moment=require(_0xe620('0x1'));var util=require(_0xe620('0x2'));var path=require('path');var ejs=require(_0xe620('0x3'));var fs=require('fs');var _=require(_0xe620('0x4'));var Redis=require(_0xe620('0x5'));var interaction=require(_0xe620('0x6'));var qs=require(_0xe620('0x7'));var pdf=require(_0xe620('0x8'));var logger=require(_0xe620('0x9'))('api');var config=require('../../config/environment');var db=require(_0xe620('0xa'))['db'];config[_0xe620('0xb')]=_[_0xe620('0xc')](config['redis'],{'host':_0xe620('0xd'),'port':0x18eb});var socket=require(_0xe620('0xe'))(new Redis(config[_0xe620('0xb')]));require(_0xe620('0xf'))[_0xe620('0x10')](socket);function respondWithStatusCode(_0x1a8e04,_0x14efa0){_0x14efa0=_0x14efa0||0xcc;return function(_0x4b9baa){if(_0x4b9baa){return _0x1a8e04[_0xe620('0x11')](_0x14efa0);}return _0x1a8e04[_0xe620('0x12')](_0x14efa0)[_0xe620('0x13')]();};}function respondWithResult(_0x4f4730,_0x285fe0){_0x285fe0=_0x285fe0||0xc8;return function(_0x1fd196){if(_0x1fd196){return _0x4f4730[_0xe620('0x12')](_0x285fe0)[_0xe620('0x14')](_0x1fd196);}};}function respondWithFilteredResult(_0xfd6123,_0x58b6dc){return function(_0x569928){if(_0x569928){var _0x278d52=typeof _0x58b6dc['offset']===_0xe620('0x15')&&typeof _0x58b6dc[_0xe620('0x16')]==='undefined';var _0x5a3633=_0x569928[_0xe620('0x17')];var _0x28faf7=_0x278d52?0x0:_0x58b6dc['offset'];var _0x5e98e1=_0x278d52?_0x569928[_0xe620('0x17')]:_0x58b6dc['offset']+_0x58b6dc[_0xe620('0x16')];var _0x446266;if(_0x5e98e1>=_0x5a3633){_0x5e98e1=_0x5a3633;_0x446266=0xc8;}else{_0x446266=0xce;}_0xfd6123[_0xe620('0x12')](_0x446266);return _0xfd6123[_0xe620('0x18')](_0xe620('0x19'),_0x28faf7+'-'+_0x5e98e1+'/'+_0x5a3633)[_0xe620('0x14')](_0x569928);}return null;};}function saveUpdates(_0x1903e1){return function(_0x4019c8){if(_0x4019c8){return _0x4019c8['update'](_0x1903e1)[_0xe620('0x1a')](function(_0x1be474){return _0x1be474;});}return null;};}function removeEntity(_0x38bee2){return function(_0x5ebfe9){if(_0x5ebfe9){return _0x5ebfe9[_0xe620('0x1b')]()[_0xe620('0x1a')](function(){_0x38bee2[_0xe620('0x12')](0xcc)[_0xe620('0x13')]();});}};}function handleEntityNotFound(_0x143e19){return function(_0x48d539){if(!_0x48d539){_0x143e19[_0xe620('0x11')](0x194);}return _0x48d539;};}function handleError(_0x2dade3,_0x44319a){_0x44319a=_0x44319a||0x1f4;return function(_0x5b2b15){logger['error'](_0x5b2b15[_0xe620('0x1c')]);if(_0x5b2b15[_0xe620('0x1d')]){delete _0x5b2b15[_0xe620('0x1d')];}_0x2dade3[_0xe620('0x12')](_0x44319a)[_0xe620('0x1e')](_0x5b2b15);};}exports[_0xe620('0x1f')]=function(_0x3d8df2,_0xb3c40d){var _0x2a8fcb={};var _0x3e5549=_[_0xe620('0x20')](db[_0xe620('0x21')][_0xe620('0x22')],function(_0x459e82){return{'name':_0x459e82[_0xe620('0x23')],'type':_0x459e82[_0xe620('0x24')][_0xe620('0x25')]};});_0x2a8fcb=qs[_0xe620('0x26')](_0x3e5549,_0x3d8df2);return interaction[_0xe620('0x27')](_0xe620('0x28'),_0x3d8df2['query'],_0x3d8df2['user'],_0x2a8fcb,_0x3e5549)['then'](respondWithFilteredResult(_0xb3c40d,_0x2a8fcb))[_0xe620('0x29')](handleError(_0xb3c40d,null));};exports[_0xe620('0x2a')]=function(_0x296061,_0x52e819){var _0x2a958f={};if(_0x296061[_0xe620('0x2b')][_0xe620('0x24')]&&_0x296061['query'][_0xe620('0x24')]===_0xe620('0x2c')){_0x2a958f[_0xe620('0x2c')]=_0x296061[_0xe620('0x2d')]['id'];}else{_0x2a958f['id']=_0x296061[_0xe620('0x2d')]['id'];}var _0x2927ee={'raw':![],'where':_0x2a958f},_0x3c3e62={};_0x3c3e62['model']=_[_0xe620('0x2e')](db[_0xe620('0x21')][_0xe620('0x22')]);_0x3c3e62[_0xe620('0x2b')]=_[_0xe620('0x2e')](_0x296061['query']);_0x3c3e62[_0xe620('0x2f')]=_[_0xe620('0x30')](_0x3c3e62[_0xe620('0x31')],_0x3c3e62[_0xe620('0x2b')]);_0x2927ee[_0xe620('0x32')]=_[_0xe620('0x30')](_0x3c3e62[_0xe620('0x31')],qs['fields'](_0x296061[_0xe620('0x2b')]['fields']));_0x2927ee[_0xe620('0x32')]=_0x2927ee[_0xe620('0x32')][_0xe620('0x33')]?_0x2927ee[_0xe620('0x32')]:_0x3c3e62['model'];if(_0x296061[_0xe620('0x2b')][_0xe620('0x34')]){_0x2927ee[_0xe620('0x35')]=[{'all':!![]}];}_0x2927ee=_[_0xe620('0x36')]({},_0x2927ee,_0x296061[_0xe620('0x37')]);return db[_0xe620('0x21')]['find'](_0x2927ee)[_0xe620('0x1a')](handleEntityNotFound(_0x52e819,null))[_0xe620('0x1a')](respondWithResult(_0x52e819,null))[_0xe620('0x29')](handleError(_0x52e819,null));};exports[_0xe620('0x38')]=function(_0x52313a,_0x2901b1){return db[_0xe620('0x21')][_0xe620('0x38')](_0x52313a[_0xe620('0x39')],{})[_0xe620('0x1a')](respondWithResult(_0x2901b1,0xc9))[_0xe620('0x29')](handleError(_0x2901b1,null));};exports[_0xe620('0x3a')]=function(_0x4815fc,_0x361e8e){if(_0x4815fc[_0xe620('0x39')]['id']){delete _0x4815fc['body']['id'];}return db[_0xe620('0x21')][_0xe620('0x3b')]({'where':{'id':_0x4815fc['params']['id']}})['then'](handleEntityNotFound(_0x361e8e,null))[_0xe620('0x1a')](saveUpdates(_0x4815fc[_0xe620('0x39')],null))['then'](respondWithResult(_0x361e8e,null))['catch'](handleError(_0x361e8e,null));};exports[_0xe620('0x1b')]=function(_0x18a39b,_0x5670f5){return db['OpenchannelInteraction']['find']({'where':{'id':_0x18a39b[_0xe620('0x2d')]['id']}})[_0xe620('0x1a')](handleEntityNotFound(_0x5670f5,null))[_0xe620('0x1a')](removeEntity(_0x5670f5,null))[_0xe620('0x29')](handleError(_0x5670f5,null));};exports[_0xe620('0x3c')]=function(_0x2e252e,_0x1411ab){return db['OpenchannelInteraction'][_0xe620('0x3c')]()[_0xe620('0x1a')](respondWithResult(_0x1411ab,null))[_0xe620('0x29')](handleError(_0x1411ab,null));};exports[_0xe620('0x3d')]=function(_0x1ea94c,_0x1007c3){return db[_0xe620('0x3e')][_0xe620('0x3b')]({'where':{'id':_0x1ea94c[_0xe620('0x2d')]['id']}})[_0xe620('0x1a')](handleEntityNotFound(_0x1007c3,null))[_0xe620('0x1a')](function(_0x414b78){if(_0x414b78){return _0x414b78[_0xe620('0x3d')](_0x1ea94c['body']['ids'],_[_0xe620('0x3f')](_0x1ea94c[_0xe620('0x39')],['ids','id'])||{});}})[_0xe620('0x1a')](respondWithResult(_0x1007c3,null))[_0xe620('0x29')](handleError(_0x1007c3,null));};exports[_0xe620('0x40')]=function(_0x1a20c0,_0x47c24c){var _0x2df9a8={'raw':![],'where':{}};var _0x4705bb={};var _0x1b5774={'count':0x0,'rows':[]};return db[_0xe620('0x21')][_0xe620('0x41')]({'where':{'id':_0x1a20c0[_0xe620('0x2d')]['id']}})[_0xe620('0x1a')](handleEntityNotFound(_0x47c24c,null))[_0xe620('0x1a')](function(_0x1311a8){if(_0x1311a8){_0x4705bb[_0xe620('0x31')]=_[_0xe620('0x2e')](db[_0xe620('0x3e')][_0xe620('0x22')]);_0x4705bb[_0xe620('0x2b')]=_['keys'](_0x1a20c0[_0xe620('0x2b')]);_0x4705bb['filters']=_['intersection'](_0x4705bb[_0xe620('0x31')],_0x4705bb[_0xe620('0x2b')]);_0x2df9a8[_0xe620('0x32')]=_[_0xe620('0x30')](_0x4705bb['model'],qs['fields'](_0x1a20c0[_0xe620('0x2b')][_0xe620('0x42')]));_0x2df9a8[_0xe620('0x32')]=_0x2df9a8[_0xe620('0x32')][_0xe620('0x33')]?_0x2df9a8[_0xe620('0x32')]:_0x4705bb[_0xe620('0x31')];if(!_0x1a20c0[_0xe620('0x2b')]['hasOwnProperty'](_0xe620('0x43'))){_0x2df9a8[_0xe620('0x16')]=qs[_0xe620('0x16')](_0x1a20c0['query'][_0xe620('0x16')]);_0x2df9a8[_0xe620('0x44')]=qs[_0xe620('0x44')](_0x1a20c0[_0xe620('0x2b')]['offset']);}_0x2df9a8[_0xe620('0x45')]=qs[_0xe620('0x46')](_0x1a20c0[_0xe620('0x2b')][_0xe620('0x46')]);_0x2df9a8['where']=qs['filters'](_[_0xe620('0x47')](_0x1a20c0[_0xe620('0x2b')],_0x4705bb[_0xe620('0x2f')]));_0x2df9a8[_0xe620('0x48')][_0xe620('0x49')]=_0x1311a8['id'];if(_0x1a20c0['query'][_0xe620('0x4a')]){_0x2df9a8[_0xe620('0x48')]=_[_0xe620('0x36')](_0x2df9a8['where'],{'$or':_[_0xe620('0x20')](_0x2df9a8[_0xe620('0x32')],function(_0x4a97ed){var _0x5aa191={};_0x5aa191[_0x4a97ed]={'$like':'%'+_0x1a20c0['query'][_0xe620('0x4a')]+'%'};return _0x5aa191;})});}if(_0x1a20c0['query'][_0xe620('0x4b')]){var _0x3b2ade=_0x1a20c0[_0xe620('0x2b')]['$gte']['split'](',');var _0x221277={};_0x221277[_0x3b2ade[0x0]]={'$gte':moment(_0x3b2ade[0x1])[_0xe620('0x4c')](_0xe620('0x4d'))};_0x2df9a8[_0xe620('0x48')]=_[_0xe620('0x36')](_0x2df9a8['where'],_0x221277);}_0x2df9a8=_[_0xe620('0x36')]({},_0x2df9a8,_0x1a20c0[_0xe620('0x37')]);return db[_0xe620('0x3e')][_0xe620('0x17')]({'where':_0x2df9a8[_0xe620('0x48')]})[_0xe620('0x1a')](function(_0x5304db){_0x1b5774[_0xe620('0x17')]=_0x5304db;if(_0x1a20c0[_0xe620('0x2b')][_0xe620('0x34')]){_0x2df9a8[_0xe620('0x35')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x2df9a8);})[_0xe620('0x1a')](function(_0x284faa){_0x1b5774[_0xe620('0x4e')]=_0x284faa;return _0x1b5774;});}})[_0xe620('0x1a')](respondWithFilteredResult(_0x47c24c,_0x2df9a8))['catch'](handleError(_0x47c24c,null));};exports[_0xe620('0x4f')]=function(_0x1435cc,_0x59aa34){return db[_0xe620('0x21')][_0xe620('0x3b')]({'where':{'id':_0x1435cc[_0xe620('0x2d')]['id']}})['then'](handleEntityNotFound(_0x59aa34,null))[_0xe620('0x1a')](function(_0x350ccb){if(_0x350ccb){return _0x350ccb[_0xe620('0x50')](_0x1435cc[_0xe620('0x39')][_0xe620('0x51')],_[_0xe620('0x3f')](_0x1435cc[_0xe620('0x39')],[_0xe620('0x51'),'id'])||{})[_0xe620('0x52')](function(){return db['Tag'][_0xe620('0x27')]({'attributes':['id',_0xe620('0x1d'),_0xe620('0x53')],'where':{'id':_0x1435cc[_0xe620('0x39')][_0xe620('0x51')]}});})['then'](function(_0x2a6b26){socket[_0xe620('0x54')](_0xe620('0x55'),{'id':Number(_0x1435cc[_0xe620('0x2d')]['id']),'tags':_0x2a6b26||[]});return{'id':Number(_0x1435cc[_0xe620('0x2d')]['id']),'tags':_0x2a6b26||[]};});}})[_0xe620('0x1a')](respondWithResult(_0x59aa34,null))[_0xe620('0x29')](handleError(_0x59aa34,null));};exports['removeTags']=function(_0x296612,_0x4a5746){return db[_0xe620('0x21')][_0xe620('0x3b')]({'where':{'id':_0x296612[_0xe620('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4a5746,null))[_0xe620('0x1a')](function(_0x350330){if(_0x350330){return _0x350330[_0xe620('0x56')](_0x296612['query'][_0xe620('0x51')]);}})[_0xe620('0x1a')](respondWithStatusCode(_0x4a5746,null))['catch'](handleError(_0x4a5746,null));};exports['download']=function(_0x2c4dd3,_0x141f52){var _0x1c4269=moment()[_0xe620('0x57')]()[_0xe620('0x58')]();var _0x176b22=path[_0xe620('0x59')](config['root'],_0xe620('0x5a'),_0xe620('0x5b'),_0xe620('0x5c'));var _0x1e14d2=path[_0xe620('0x59')](config[_0xe620('0x5d')],_0xe620('0x5a'),'files',_0xe620('0x5e'));var _0x46c2fd=path[_0xe620('0x59')](_0x176b22,_0x1c4269);var _0x14e97e=util['format'](_0xe620('0x5f'),_0x2c4dd3[_0xe620('0x2d')]['id'],_0x1c4269);var _0xcfc284=path[_0xe620('0x59')](_0x176b22,_0x14e97e);var _0x1b57da=[];_0x1b57da[_0xe620('0x60')]({'model':db[_0xe620('0x61')],'as':_0xe620('0x61'),'attributes':['id','fullname'],'raw':!![]});_0x1b57da['push']({'model':db['CmContact'],'as':_0xe620('0x62'),'attributes':['id',_0xe620('0x63'),'lastName'],'raw':!![]});if(_0x2c4dd3[_0xe620('0x2b')]['attachments']){_0x1b57da[_0xe620('0x60')]({'model':db[_0xe620('0x64')],'as':_0xe620('0x64'),'raw':!![]});}var _0x58302d=[{'model':db[_0xe620('0x3e')],'as':'Messages','attributes':['id',_0xe620('0x39'),_0xe620('0x65'),_0xe620('0x66'),_0xe620('0x67'),_0xe620('0x68')],'include':_0x1b57da}];_0x58302d[_0xe620('0x60')]({'model':db[_0xe620('0x69')],'as':_0xe620('0x6a'),'attributes':['id',_0xe620('0x1d')]});_0x58302d['push']({'model':db['User'],'as':_0xe620('0x6b'),'attributes':['id',_0xe620('0x6c')]});return db[_0xe620('0x21')]['find']({'where':{'id':_0x2c4dd3[_0xe620('0x2d')]['id']},'include':_0x58302d})[_0xe620('0x1a')](handleEntityNotFound(_0x141f52,null))['then'](function(_0x66e35c){if(_0x66e35c){var _0x3bbdd1=_0x66e35c['get']({'plain':!![]});fs[_0xe620('0x6d')](_0x46c2fd);var _0x4002a1={'channel':'Openchannel','account':_0x3bbdd1[_0xe620('0x6a')][_0xe620('0x1d')],'agent':_0x3bbdd1['Owner']?_0x3bbdd1[_0xe620('0x6b')][_0xe620('0x6c')]:_0xe620('0x6e'),'createdAt':moment(_0x3bbdd1['createdAt'])[_0xe620('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x3bbdd1[_0xe620('0x6f')]?moment(_0x3bbdd1['closedAt'])[_0xe620('0x4c')](_0xe620('0x4d'))['toString']():'','disposition':_0x3bbdd1['disposition'],'visibility':_0x3bbdd1[_0xe620('0x70')]?_0xe620('0x71'):_0xe620('0x72'),'messages':_(_0x3bbdd1[_0xe620('0x73')])[_0xe620('0x4a')]({'secret':![]})['map'](function(_0x3aa11c){if(_0x3aa11c[_0xe620('0x64')]){var _0x588dd4=path[_0xe620('0x59')](_0x1e14d2,_0x3aa11c[_0xe620('0x64')][_0xe620('0x74')]);if(fs[_0xe620('0x75')](_0x588dd4)){fs[_0xe620('0x76')](_0x588dd4)[_0xe620('0x77')](fs[_0xe620('0x78')](path[_0xe620('0x59')](_0x46c2fd,_0x3aa11c[_0xe620('0x64')][_0xe620('0x74')])));}}return{'date':moment(_0x3aa11c['createdAt'])[_0xe620('0x4c')](_0xe620('0x4d'))[_0xe620('0x58')](),'sender':_0x3aa11c[_0xe620('0x66')]==='out'?_0x3aa11c[_0xe620('0x61')]?_0x3aa11c['User'][_0xe620('0x6c')]:'System':_0x3aa11c[_0xe620('0x62')][_0xe620('0x63')]+(_0x3aa11c[_0xe620('0x62')][_0xe620('0x79')]?'\x20'+_0x3aa11c[_0xe620('0x62')][_0xe620('0x79')]:''),'body':_0x3aa11c['Attachment']?_0x3aa11c['Attachment'][_0xe620('0x74')]:_0x3aa11c[_0xe620('0x39')],'direction':_0x3aa11c[_0xe620('0x66')]==='out'?'A':'C','secret':_0x3aa11c[_0xe620('0x67')],'read':_0x3aa11c[_0xe620('0x68')],'attachment':_0x3aa11c[_0xe620('0x64')]};})[_0xe620('0x7a')]()};return ejs[_0xe620('0x7b')](path[_0xe620('0x59')](config[_0xe620('0x5d')],_0xe620('0x5a'),_0xe620('0x7c'),_0xe620('0x7d')),{'interaction':_0x4002a1})['then'](function(_0x15dd7c){var _0x243141=path['join'](_0x46c2fd,'transcript-'+_0x3bbdd1['id']+'-'+_0x1c4269+_0xe620('0x7e'));var _0x1dc29e={'path':_0x243141,'channel':_0xe620('0x7f'),'interactionId':_0x3bbdd1['id']};return pdf[_0xe620('0x80')](_0x15dd7c,_0x1dc29e);})[_0xe620('0x1a')](function(){return new Promise(function(_0x34f349,_0x2509f7){zipdir(_0x46c2fd,{'saveTo':_0xcfc284},function(_0x4acda8,_0x343cca){if(_0x4acda8)return _0x2509f7(_0x4acda8);return _0x34f349(_0x343cca);});})['then'](function(){return new Promise(function(_0x12029e,_0x417ae5){rimraf(_0x46c2fd,function(_0x5d5fc9){if(_0x5d5fc9)_0x417ae5(_0x5d5fc9);return _0x12029e();});});})[_0xe620('0x1a')](function(){return _0x141f52[_0xe620('0x81')](_0xcfc284,_0x14e97e,function(_0x35f0aa){if(_0x35f0aa){logger['error'](_0xe620('0x82'),_0x35f0aa);}else{fs['unlinkSync'](_0xcfc284);}});});});}else{return _0x141f52[_0xe620('0x11')](0xc8);}})[_0xe620('0x29')](handleError(_0x141f52,null));}; \ No newline at end of file +var _0xf6eb=['YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','toString','join','root','server','tmp','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','lastName','Attachment','createdAt','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','threadId','Public','Private','Messages','basename','createReadStream','pipe','createWriteStream','out','System','secret','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','status','end','offset','undefined','limit','count','Content-Range','json','update','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','type','getOptions','findAll','openchannel','query','user','catch','show','from','params','model','keys','filters','intersection','attributes','fields','length','merge','options','find','create','body','describe','addMessage','omit','ids','findOne','OpenchannelMessage','hasOwnProperty','nolimit','where','pick','OpenchannelInteractionId','filter','$gte','split','format'];(function(_0x1b1c0a,_0xabeb0a){var _0x1e3cc8=function(_0x590ca6){while(--_0x590ca6){_0x1b1c0a['push'](_0x1b1c0a['shift']());}};_0x1e3cc8(++_0xabeb0a);}(_0xf6eb,0xb7));var _0xbf6e=function(_0x5bf00f,_0x2c9dfd){_0x5bf00f=_0x5bf00f-0x0;var _0x3ba0ec=_0xf6eb[_0x5bf00f];return _0x3ba0ec;};'use strict';var rimraf=require(_0xbf6e('0x0'));var zipdir=require(_0xbf6e('0x1'));var moment=require(_0xbf6e('0x2'));var util=require('util');var path=require('path');var ejs=require(_0xbf6e('0x3'));var fs=require('fs');var _=require(_0xbf6e('0x4'));var Redis=require('ioredis');var interaction=require(_0xbf6e('0x5'));var qs=require(_0xbf6e('0x6'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0xbf6e('0x7'));var config=require(_0xbf6e('0x8'));var db=require(_0xbf6e('0x9'))['db'];config[_0xbf6e('0xa')]=_[_0xbf6e('0xb')](config[_0xbf6e('0xa')],{'host':_0xbf6e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf6e('0xa')]));require('./openchannelInteraction.socket')[_0xbf6e('0xd')](socket);function respondWithStatusCode(_0x331cae,_0xfc2a87){_0xfc2a87=_0xfc2a87||0xcc;return function(_0x1716a1){if(_0x1716a1){return _0x331cae['sendStatus'](_0xfc2a87);}return _0x331cae[_0xbf6e('0xe')](_0xfc2a87)[_0xbf6e('0xf')]();};}function respondWithResult(_0x5797db,_0x2398fa){_0x2398fa=_0x2398fa||0xc8;return function(_0x5b7f21){if(_0x5b7f21){return _0x5797db[_0xbf6e('0xe')](_0x2398fa)['json'](_0x5b7f21);}};}function respondWithFilteredResult(_0xc55e32,_0x38db17){return function(_0x366c5a){if(_0x366c5a){var _0x241288=typeof _0x38db17[_0xbf6e('0x10')]===_0xbf6e('0x11')&&typeof _0x38db17[_0xbf6e('0x12')]===_0xbf6e('0x11');var _0x57caea=_0x366c5a[_0xbf6e('0x13')];var _0x471a74=_0x241288?0x0:_0x38db17[_0xbf6e('0x10')];var _0x4d41b7=_0x241288?_0x366c5a[_0xbf6e('0x13')]:_0x38db17['offset']+_0x38db17[_0xbf6e('0x12')];var _0x2957b1;if(_0x4d41b7>=_0x57caea){_0x4d41b7=_0x57caea;_0x2957b1=0xc8;}else{_0x2957b1=0xce;}_0xc55e32[_0xbf6e('0xe')](_0x2957b1);return _0xc55e32['set'](_0xbf6e('0x14'),_0x471a74+'-'+_0x4d41b7+'/'+_0x57caea)[_0xbf6e('0x15')](_0x366c5a);}return null;};}function saveUpdates(_0x59ff91){return function(_0x44a81c){if(_0x44a81c){return _0x44a81c[_0xbf6e('0x16')](_0x59ff91)[_0xbf6e('0x17')](function(_0x4557ca){return _0x4557ca;});}return null;};}function removeEntity(_0x376140){return function(_0x3fc668){if(_0x3fc668){return _0x3fc668[_0xbf6e('0x18')]()['then'](function(){_0x376140['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21ee7b){return function(_0x2fd521){if(!_0x2fd521){_0x21ee7b[_0xbf6e('0x19')](0x194);}return _0x2fd521;};}function handleError(_0x712225,_0x4b1190){_0x4b1190=_0x4b1190||0x1f4;return function(_0x3e861e){logger[_0xbf6e('0x1a')](_0x3e861e[_0xbf6e('0x1b')]);if(_0x3e861e[_0xbf6e('0x1c')]){delete _0x3e861e[_0xbf6e('0x1c')];}_0x712225[_0xbf6e('0xe')](_0x4b1190)[_0xbf6e('0x1d')](_0x3e861e);};}exports[_0xbf6e('0x1e')]=function(_0x3545d0,_0x3b60b2){var _0x30addf={};var _0x19ac9a=_[_0xbf6e('0x1f')](db[_0xbf6e('0x20')][_0xbf6e('0x21')],function(_0x1cf14e){return{'name':_0x1cf14e['fieldName'],'type':_0x1cf14e[_0xbf6e('0x22')]['key']};});_0x30addf=qs[_0xbf6e('0x23')](_0x19ac9a,_0x3545d0);return interaction[_0xbf6e('0x24')](_0xbf6e('0x25'),_0x3545d0[_0xbf6e('0x26')],_0x3545d0[_0xbf6e('0x27')],_0x30addf,_0x19ac9a)[_0xbf6e('0x17')](respondWithFilteredResult(_0x3b60b2,_0x30addf))[_0xbf6e('0x28')](handleError(_0x3b60b2,null));};exports[_0xbf6e('0x29')]=function(_0x220eb4,_0x38aac6){var _0x395413={};if(_0x220eb4[_0xbf6e('0x26')][_0xbf6e('0x22')]&&_0x220eb4['query'][_0xbf6e('0x22')]==='from'){_0x395413[_0xbf6e('0x2a')]=_0x220eb4[_0xbf6e('0x2b')]['id'];}else{_0x395413['id']=_0x220eb4['params']['id'];}var _0x1ac5ad={'raw':![],'where':_0x395413},_0x3db302={};_0x3db302[_0xbf6e('0x2c')]=_[_0xbf6e('0x2d')](db[_0xbf6e('0x20')]['rawAttributes']);_0x3db302[_0xbf6e('0x26')]=_['keys'](_0x220eb4[_0xbf6e('0x26')]);_0x3db302[_0xbf6e('0x2e')]=_[_0xbf6e('0x2f')](_0x3db302[_0xbf6e('0x2c')],_0x3db302[_0xbf6e('0x26')]);_0x1ac5ad[_0xbf6e('0x30')]=_['intersection'](_0x3db302[_0xbf6e('0x2c')],qs[_0xbf6e('0x31')](_0x220eb4[_0xbf6e('0x26')][_0xbf6e('0x31')]));_0x1ac5ad['attributes']=_0x1ac5ad[_0xbf6e('0x30')][_0xbf6e('0x32')]?_0x1ac5ad['attributes']:_0x3db302[_0xbf6e('0x2c')];if(_0x220eb4['query']['includeAll']){_0x1ac5ad['include']=[{'all':!![]}];}_0x1ac5ad=_[_0xbf6e('0x33')]({},_0x1ac5ad,_0x220eb4[_0xbf6e('0x34')]);return db[_0xbf6e('0x20')][_0xbf6e('0x35')](_0x1ac5ad)['then'](handleEntityNotFound(_0x38aac6,null))[_0xbf6e('0x17')](respondWithResult(_0x38aac6,null))['catch'](handleError(_0x38aac6,null));};exports['create']=function(_0x14c732,_0x5a9cdd){return db['OpenchannelInteraction'][_0xbf6e('0x36')](_0x14c732[_0xbf6e('0x37')],{})[_0xbf6e('0x17')](respondWithResult(_0x5a9cdd,0xc9))['catch'](handleError(_0x5a9cdd,null));};exports['update']=function(_0x54141d,_0xa8ae4f){if(_0x54141d[_0xbf6e('0x37')]['id']){delete _0x54141d[_0xbf6e('0x37')]['id'];}return db['OpenchannelInteraction'][_0xbf6e('0x35')]({'where':{'id':_0x54141d['params']['id']}})[_0xbf6e('0x17')](handleEntityNotFound(_0xa8ae4f,null))[_0xbf6e('0x17')](saveUpdates(_0x54141d[_0xbf6e('0x37')],null))[_0xbf6e('0x17')](respondWithResult(_0xa8ae4f,null))['catch'](handleError(_0xa8ae4f,null));};exports['destroy']=function(_0x510630,_0x326817){return db[_0xbf6e('0x20')][_0xbf6e('0x35')]({'where':{'id':_0x510630[_0xbf6e('0x2b')]['id']}})[_0xbf6e('0x17')](handleEntityNotFound(_0x326817,null))['then'](removeEntity(_0x326817,null))[_0xbf6e('0x28')](handleError(_0x326817,null));};exports[_0xbf6e('0x38')]=function(_0x49267e,_0x58a87f){return db['OpenchannelInteraction'][_0xbf6e('0x38')]()[_0xbf6e('0x17')](respondWithResult(_0x58a87f,null))['catch'](handleError(_0x58a87f,null));};exports[_0xbf6e('0x39')]=function(_0x4e0eed,_0xf94404){return db['OpenchannelMessage'][_0xbf6e('0x35')]({'where':{'id':_0x4e0eed[_0xbf6e('0x2b')]['id']}})[_0xbf6e('0x17')](handleEntityNotFound(_0xf94404,null))[_0xbf6e('0x17')](function(_0x515585){if(_0x515585){return _0x515585[_0xbf6e('0x39')](_0x4e0eed[_0xbf6e('0x37')]['ids'],_[_0xbf6e('0x3a')](_0x4e0eed[_0xbf6e('0x37')],[_0xbf6e('0x3b'),'id'])||{});}})['then'](respondWithResult(_0xf94404,null))[_0xbf6e('0x28')](handleError(_0xf94404,null));};exports['getMessages']=function(_0x199187,_0x39b2b9){var _0x1e53ba={'raw':![],'where':{}};var _0xd6c57c={};var _0x5b5e62={'count':0x0,'rows':[]};return db[_0xbf6e('0x20')][_0xbf6e('0x3c')]({'where':{'id':_0x199187[_0xbf6e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x39b2b9,null))[_0xbf6e('0x17')](function(_0x1da8da){if(_0x1da8da){_0xd6c57c[_0xbf6e('0x2c')]=_['keys'](db[_0xbf6e('0x3d')][_0xbf6e('0x21')]);_0xd6c57c[_0xbf6e('0x26')]=_[_0xbf6e('0x2d')](_0x199187[_0xbf6e('0x26')]);_0xd6c57c[_0xbf6e('0x2e')]=_['intersection'](_0xd6c57c[_0xbf6e('0x2c')],_0xd6c57c[_0xbf6e('0x26')]);_0x1e53ba[_0xbf6e('0x30')]=_[_0xbf6e('0x2f')](_0xd6c57c['model'],qs['fields'](_0x199187[_0xbf6e('0x26')]['fields']));_0x1e53ba[_0xbf6e('0x30')]=_0x1e53ba['attributes'][_0xbf6e('0x32')]?_0x1e53ba[_0xbf6e('0x30')]:_0xd6c57c[_0xbf6e('0x2c')];if(!_0x199187['query'][_0xbf6e('0x3e')](_0xbf6e('0x3f'))){_0x1e53ba['limit']=qs[_0xbf6e('0x12')](_0x199187[_0xbf6e('0x26')]['limit']);_0x1e53ba[_0xbf6e('0x10')]=qs[_0xbf6e('0x10')](_0x199187[_0xbf6e('0x26')][_0xbf6e('0x10')]);}_0x1e53ba['order']=qs['sort'](_0x199187[_0xbf6e('0x26')]['sort']);_0x1e53ba[_0xbf6e('0x40')]=qs['filters'](_[_0xbf6e('0x41')](_0x199187[_0xbf6e('0x26')],_0xd6c57c['filters']));_0x1e53ba['where'][_0xbf6e('0x42')]=_0x1da8da['id'];if(_0x199187['query'][_0xbf6e('0x43')]){_0x1e53ba[_0xbf6e('0x40')]=_[_0xbf6e('0x33')](_0x1e53ba['where'],{'$or':_['map'](_0x1e53ba[_0xbf6e('0x30')],function(_0x1fda07){var _0x5b012e={};_0x5b012e[_0x1fda07]={'$like':'%'+_0x199187[_0xbf6e('0x26')][_0xbf6e('0x43')]+'%'};return _0x5b012e;})});}if(_0x199187[_0xbf6e('0x26')]['$gte']){var _0x2883ca=_0x199187[_0xbf6e('0x26')][_0xbf6e('0x44')][_0xbf6e('0x45')](',');var _0x2bdf14={};_0x2bdf14[_0x2883ca[0x0]]={'$gte':moment(_0x2883ca[0x1])[_0xbf6e('0x46')](_0xbf6e('0x47'))};_0x1e53ba[_0xbf6e('0x40')]=_['merge'](_0x1e53ba[_0xbf6e('0x40')],_0x2bdf14);}_0x1e53ba=_[_0xbf6e('0x33')]({},_0x1e53ba,_0x199187[_0xbf6e('0x34')]);return db[_0xbf6e('0x3d')][_0xbf6e('0x13')]({'where':_0x1e53ba[_0xbf6e('0x40')]})[_0xbf6e('0x17')](function(_0x2c192a){_0x5b5e62[_0xbf6e('0x13')]=_0x2c192a;if(_0x199187[_0xbf6e('0x26')][_0xbf6e('0x48')]){_0x1e53ba['include']=[{'all':!![]}];}return db[_0xbf6e('0x3d')][_0xbf6e('0x24')](_0x1e53ba);})[_0xbf6e('0x17')](function(_0x55a3b8){_0x5b5e62[_0xbf6e('0x49')]=_0x55a3b8;return _0x5b5e62;});}})['then'](respondWithFilteredResult(_0x39b2b9,_0x1e53ba))[_0xbf6e('0x28')](handleError(_0x39b2b9,null));};exports[_0xbf6e('0x4a')]=function(_0x5e05d7,_0x5aca8f){return db[_0xbf6e('0x20')][_0xbf6e('0x35')]({'where':{'id':_0x5e05d7[_0xbf6e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5aca8f,null))[_0xbf6e('0x17')](function(_0x1e5b78){if(_0x1e5b78){return _0x1e5b78[_0xbf6e('0x4b')](_0x5e05d7[_0xbf6e('0x37')][_0xbf6e('0x3b')],_[_0xbf6e('0x3a')](_0x5e05d7['body'],['ids','id'])||{})['spread'](function(){return db[_0xbf6e('0x4c')][_0xbf6e('0x24')]({'attributes':['id',_0xbf6e('0x1c'),_0xbf6e('0x4d')],'where':{'id':_0x5e05d7[_0xbf6e('0x37')]['ids']}});})[_0xbf6e('0x17')](function(_0x58189b){socket[_0xbf6e('0x4e')](_0xbf6e('0x4f'),{'id':Number(_0x5e05d7['params']['id']),'tags':_0x58189b||[]});return{'id':Number(_0x5e05d7['params']['id']),'tags':_0x58189b||[]};});}})[_0xbf6e('0x17')](respondWithResult(_0x5aca8f,null))[_0xbf6e('0x28')](handleError(_0x5aca8f,null));};exports[_0xbf6e('0x50')]=function(_0x11e433,_0x4ca2d2){return db[_0xbf6e('0x20')][_0xbf6e('0x35')]({'where':{'id':_0x11e433['params']['id']}})[_0xbf6e('0x17')](handleEntityNotFound(_0x4ca2d2,null))[_0xbf6e('0x17')](function(_0x584d84){if(_0x584d84){return _0x584d84[_0xbf6e('0x50')](_0x11e433[_0xbf6e('0x26')][_0xbf6e('0x3b')]);}})[_0xbf6e('0x17')](respondWithStatusCode(_0x4ca2d2,null))[_0xbf6e('0x28')](handleError(_0x4ca2d2,null));};exports[_0xbf6e('0x51')]=function(_0x3e22cf,_0x30443f){var _0x5bd7f8=moment()['unix']()[_0xbf6e('0x52')]();var _0x187667=path[_0xbf6e('0x53')](config[_0xbf6e('0x54')],_0xbf6e('0x55'),'files',_0xbf6e('0x56'));var _0x3520e5=path[_0xbf6e('0x53')](config[_0xbf6e('0x54')],_0xbf6e('0x55'),'files','attachments');var _0x5f4c97=path[_0xbf6e('0x53')](_0x187667,_0x5bd7f8);var _0x52a8d7=util[_0xbf6e('0x46')](_0xbf6e('0x57'),_0x3e22cf[_0xbf6e('0x2b')]['id'],_0x5bd7f8);var _0x585451=path[_0xbf6e('0x53')](_0x187667,_0x52a8d7);var _0x36b8f7=[];_0x36b8f7['push']({'model':db[_0xbf6e('0x58')],'as':_0xbf6e('0x58'),'attributes':['id',_0xbf6e('0x59')],'raw':!![]});_0x36b8f7[_0xbf6e('0x5a')]({'model':db[_0xbf6e('0x5b')],'as':_0xbf6e('0x5c'),'attributes':['id',_0xbf6e('0x5d'),_0xbf6e('0x5e')],'raw':!![]});if(_0x3e22cf[_0xbf6e('0x26')]['attachments']){_0x36b8f7[_0xbf6e('0x5a')]({'model':db[_0xbf6e('0x5f')],'as':_0xbf6e('0x5f'),'raw':!![]});}var _0x536cba=[{'model':db[_0xbf6e('0x3d')],'as':'Messages','attributes':['id','body',_0xbf6e('0x60'),'direction','secret',_0xbf6e('0x61')],'include':_0x36b8f7}];_0x536cba['push']({'model':db[_0xbf6e('0x62')],'as':_0xbf6e('0x63'),'attributes':['id',_0xbf6e('0x1c')]});_0x536cba[_0xbf6e('0x5a')]({'model':db[_0xbf6e('0x58')],'as':_0xbf6e('0x64'),'attributes':['id','fullname']});return db['OpenchannelInteraction'][_0xbf6e('0x35')]({'where':{'id':_0x3e22cf[_0xbf6e('0x2b')]['id']},'include':_0x536cba})[_0xbf6e('0x17')](handleEntityNotFound(_0x30443f,null))['then'](function(_0xfe0b82){if(_0xfe0b82){var _0x3c398f=_0xfe0b82[_0xbf6e('0x65')]({'plain':!![]});fs[_0xbf6e('0x66')](_0x5f4c97);var _0xb0caa9={'channel':_0xbf6e('0x67'),'account':_0x3c398f[_0xbf6e('0x63')]['name'],'agent':_0x3c398f[_0xbf6e('0x64')]?_0x3c398f[_0xbf6e('0x64')][_0xbf6e('0x59')]:_0xbf6e('0x68'),'createdAt':moment(_0x3c398f[_0xbf6e('0x60')])[_0xbf6e('0x46')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbf6e('0x52')](),'closedAt':_0x3c398f[_0xbf6e('0x69')]?moment(_0x3c398f[_0xbf6e('0x6a')])['format'](_0xbf6e('0x47'))[_0xbf6e('0x52')]():'','disposition':_0x3c398f['disposition'],'visibility':_0x3c398f[_0xbf6e('0x6b')]?_0xbf6e('0x6c'):_0xbf6e('0x6d'),'messages':_(_0x3c398f[_0xbf6e('0x6e')])[_0xbf6e('0x43')]({'secret':![]})['map'](function(_0x2ef1f4){if(_0x2ef1f4[_0xbf6e('0x5f')]){var _0x2363ec=path['join'](_0x3520e5,_0x2ef1f4[_0xbf6e('0x5f')][_0xbf6e('0x6f')]);if(fs['existsSync'](_0x2363ec)){fs[_0xbf6e('0x70')](_0x2363ec)[_0xbf6e('0x71')](fs[_0xbf6e('0x72')](path['join'](_0x5f4c97,_0x2ef1f4[_0xbf6e('0x5f')][_0xbf6e('0x6f')])));}}return{'date':moment(_0x2ef1f4[_0xbf6e('0x60')])[_0xbf6e('0x46')](_0xbf6e('0x47'))['toString'](),'sender':_0x2ef1f4['direction']===_0xbf6e('0x73')?_0x2ef1f4[_0xbf6e('0x58')]?_0x2ef1f4[_0xbf6e('0x58')][_0xbf6e('0x59')]:_0xbf6e('0x74'):_0x2ef1f4[_0xbf6e('0x5c')][_0xbf6e('0x5d')]+(_0x2ef1f4[_0xbf6e('0x5c')][_0xbf6e('0x5e')]?'\x20'+_0x2ef1f4[_0xbf6e('0x5c')][_0xbf6e('0x5e')]:''),'body':_0x2ef1f4[_0xbf6e('0x5f')]?_0x2ef1f4[_0xbf6e('0x5f')][_0xbf6e('0x6f')]:_0x2ef1f4['body'],'direction':_0x2ef1f4['direction']===_0xbf6e('0x73')?'A':'C','secret':_0x2ef1f4[_0xbf6e('0x75')],'read':_0x2ef1f4[_0xbf6e('0x61')],'attachment':_0x2ef1f4[_0xbf6e('0x5f')]};})[_0xbf6e('0x76')]()};return ejs[_0xbf6e('0x77')](path[_0xbf6e('0x53')](config[_0xbf6e('0x54')],_0xbf6e('0x55'),_0xbf6e('0x78'),_0xbf6e('0x79')),{'interaction':_0xb0caa9})[_0xbf6e('0x17')](function(_0xff81ed){var _0xfd069d=path[_0xbf6e('0x53')](_0x5f4c97,_0xbf6e('0x7a')+_0x3c398f['id']+'-'+_0x5bd7f8+_0xbf6e('0x7b'));var _0x29aafb={'path':_0xfd069d,'channel':'Openchannel','interactionId':_0x3c398f['id']};return pdf[_0xbf6e('0x7c')](_0xff81ed,_0x29aafb);})[_0xbf6e('0x17')](function(){return new Promise(function(_0x1aaa53,_0x3d67f8){zipdir(_0x5f4c97,{'saveTo':_0x585451},function(_0xa5b075,_0x4ee9b5){if(_0xa5b075)return _0x3d67f8(_0xa5b075);return _0x1aaa53(_0x4ee9b5);});})['then'](function(){return new Promise(function(_0x7216e5,_0x1dea7d){rimraf(_0x5f4c97,function(_0x5782d3){if(_0x5782d3)_0x1dea7d(_0x5782d3);return _0x7216e5();});});})['then'](function(){return _0x30443f[_0xbf6e('0x51')](_0x585451,_0x52a8d7,function(_0x1ee678){if(_0x1ee678){logger[_0xbf6e('0x1a')](_0xbf6e('0x7d'),_0x1ee678);}else{fs[_0xbf6e('0x7e')](_0x585451);}});});});}else{return _0x30443f[_0xbf6e('0x19')](0xc8);}})[_0xbf6e('0x28')](handleError(_0x30443f,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index dbad29f..64cae7e 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 _0x613e=['emit','catch','hasOwnProperty','hook','exports','OpenchannelInteraction','../../mysqldb','setMaxListeners','update','remove','getUsers','then','setDataValue','map'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x613e,0xbb));var _0xe613=function(_0x39f2d0,_0x219bd2){_0x39f2d0=_0x39f2d0-0x0;var _0xf026a2=_0x613e[_0x39f2d0];return _0xf026a2;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0xe613('0x0')];var OpenchannelMessage=require(_0xe613('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe613('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe613('0x3'),'afterDestroy':_0xe613('0x4')};function emitEvent(_0x5c2896){return function(_0x5dbbf4,_0x28f091,_0x4933ad){_0x5dbbf4[_0xe613('0x5')]({'attributes':['id'],'raw':!![]})[_0xe613('0x6')](function(_0x43526a){_0x5dbbf4[_0xe613('0x7')]('Users',_0x43526a[_0xe613('0x8')](function(_0x9fb215){return{'id':_0x9fb215['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x5dbbf4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe613('0x6')](function(_0x389c97){_0x5dbbf4['setDataValue']('unreadMessages',_0x389c97['length']);OpenchannelInteractionEvents[_0xe613('0x9')](_0x5c2896+':'+_0x5dbbf4['id'],_0x5dbbf4);OpenchannelInteractionEvents['emit'](_0x5c2896,_0x5dbbf4);_0x4933ad(null);})[_0xe613('0xa')](_0x4933ad(null));};}for(var e in events){if(events[_0xe613('0xb')](e)){var event=events[e];OpenchannelInteraction[_0xe613('0xc')](e,emitEvent(event));}}module[_0xe613('0xd')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x1d7f=['update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d7f,0x193));var _0xf1d7=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1d7f[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0xf1d7('0x0'));var OpenchannelInteraction=require(_0xf1d7('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xf1d7('0x1'))['db'][_0xf1d7('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xf1d7('0x3')](0x0);var events={'afterCreate':_0xf1d7('0x4'),'afterUpdate':_0xf1d7('0x5'),'afterDestroy':_0xf1d7('0x6')};function emitEvent(_0x1f6f41){return function(_0x572917,_0x163e62,_0x10dfe4){_0x572917[_0xf1d7('0x7')]({'attributes':['id'],'raw':!![]})[_0xf1d7('0x8')](function(_0x2c2db7){_0x572917[_0xf1d7('0x9')](_0xf1d7('0xa'),_0x2c2db7['map'](function(_0x386d48){return{'id':_0x386d48['id']};}));return OpenchannelMessage[_0xf1d7('0xb')]({'where':{'OpenchannelInteractionId':_0x572917['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf1d7('0x8')](function(_0x369a71){_0x572917[_0xf1d7('0x9')](_0xf1d7('0xc'),_0x369a71[_0xf1d7('0xd')]);OpenchannelInteractionEvents['emit'](_0x1f6f41+':'+_0x572917['id'],_0x572917);OpenchannelInteractionEvents['emit'](_0x1f6f41,_0x572917);_0x10dfe4(null);})['catch'](_0x10dfe4(null));};}for(var e in events){if(events[_0xf1d7('0xe')](e)){var event=events[e];OpenchannelInteraction[_0xf1d7('0xf')](e,emitEvent(event));}}module[_0xf1d7('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 5d4ee4c..4b60166 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 _0x6cd1=['closedAt','format','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','closed'];(function(_0x41e507,_0x694b79){var _0x3bbe37=function(_0x2df851){while(--_0x2df851){_0x41e507['push'](_0x41e507['shift']());}};_0x3bbe37(++_0x694b79);}(_0x6cd1,0x1c4));var _0x16cd=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0x6cd1[_0xacb1e2];return _0x463815;};'use strict';var _=require(_0x16cd('0x0'));var util=require(_0x16cd('0x1'));var logger=require(_0x16cd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x16cd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x16cd('0x4'));var config=require(_0x16cd('0x5'));var attributes=require(_0x16cd('0x6'));module[_0x16cd('0x7')]=function(_0x535274,_0x40941d){return _0x535274[_0x16cd('0x8')](_0x16cd('0x9'),attributes,{'tableName':_0x16cd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x16cd('0xb'),'hooks':{'beforeUpdate':function(_0x573e56,_0x5257e1,_0x4b953d){if(_0x573e56['changed'](_0x16cd('0xc'))){_0x573e56[_0x16cd('0xd')]=moment()[_0x16cd('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4b953d(null,_0x573e56);}}});}; \ No newline at end of file +var _0x0d64=['request-promise','rimraf','../../config/environment','exports','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','util','../../config/logger','bluebird'];(function(_0x2f36dc,_0x2099d4){var _0x4f785d=function(_0x2cfe60){while(--_0x2cfe60){_0x2f36dc['push'](_0x2f36dc['shift']());}};_0x4f785d(++_0x2099d4);}(_0x0d64,0x1c4));var _0x40d6=function(_0x6c7b6d,_0x452210){_0x6c7b6d=_0x6c7b6d-0x0;var _0x5bebd3=_0x0d64[_0x6c7b6d];return _0x5bebd3;};'use strict';var _=require('lodash');var util=require(_0x40d6('0x0'));var logger=require(_0x40d6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x40d6('0x2'));var rp=require(_0x40d6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x40d6('0x4'));var config=require(_0x40d6('0x5'));var attributes=require('./openchannelInteraction.attributes');module[_0x40d6('0x6')]=function(_0x1386a6,_0x33ae10){return _0x1386a6['define']('OpenchannelInteraction',attributes,{'tableName':_0x40d6('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x40d6('0x8'),'collate':_0x40d6('0x9'),'hooks':{'beforeUpdate':function(_0x385544,_0x15006b,_0x1faf99){if(_0x385544[_0x40d6('0xa')](_0x40d6('0xb'))){_0x385544['closedAt']=moment()[_0x40d6('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1faf99(null,_0x385544);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index bf5be63..4b4646b 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 _0x6039=['body','AddTags','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','ids'];(function(_0x23f5ae,_0x2a6e8f){var _0x3c426f=function(_0x53b83c){while(--_0x53b83c){_0x23f5ae['push'](_0x23f5ae['shift']());}};_0x3c426f(++_0x2a6e8f);}(_0x6039,0xae));var _0x9603=function(_0x3eecb2,_0x5c5bb5){_0x3eecb2=_0x3eecb2-0x0;var _0x5e86ef=_0x6039[_0x3eecb2];return _0x5e86ef;};'use strict';var _=require('lodash');var util=require(_0x9603('0x0'));var moment=require(_0x9603('0x1'));var BPromise=require('bluebird');var rs=require(_0x9603('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9603('0x3'))['db'];var utils=require(_0x9603('0x4'));var logger=require(_0x9603('0x5'))('rpc');var config=require(_0x9603('0x6'));var jayson=require(_0x9603('0x7'));var client=jayson[_0x9603('0x8')][_0x9603('0x9')]({'port':0x232a});config[_0x9603('0xa')]=_[_0x9603('0xb')](config[_0x9603('0xa')],{'host':_0x9603('0xc'),'port':0x18eb});var socket=require(_0x9603('0xd'))(new Redis(config[_0x9603('0xa')]));require(_0x9603('0xe'))[_0x9603('0xf')](socket);function respondWithRpcPromise(_0x4d2c90,_0x27da15,_0x11ef32){return new BPromise(function(_0x242167,_0x29a413){return client[_0x9603('0x10')](_0x4d2c90,_0x11ef32)[_0x9603('0x11')](function(_0x6d4a66){logger[_0x9603('0x12')](_0x9603('0x13'),_0x27da15,_0x9603('0x14'));logger[_0x9603('0x15')](_0x9603('0x16'),_0x27da15,_0x9603('0x14'),JSON[_0x9603('0x17')](_0x6d4a66));if(_0x6d4a66[_0x9603('0x18')]){if(_0x6d4a66[_0x9603('0x18')][_0x9603('0x19')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x27da15,_0x6d4a66[_0x9603('0x18')][_0x9603('0x1a')]);return _0x29a413(_0x6d4a66[_0x9603('0x18')]['message']);}logger[_0x9603('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x27da15,_0x6d4a66[_0x9603('0x18')][_0x9603('0x1a')]);return _0x242167(_0x6d4a66[_0x9603('0x18')][_0x9603('0x1a')]);}else{logger[_0x9603('0x12')](_0x9603('0x13'),_0x27da15,_0x9603('0x14'));_0x242167(_0x6d4a66[_0x9603('0x1b')][_0x9603('0x1a')]);}})[_0x9603('0x1c')](function(_0x132c54){logger[_0x9603('0x18')](_0x9603('0x13'),_0x27da15,_0x132c54);_0x29a413(_0x132c54);});});}exports[_0x9603('0x1d')]=function(_0x2b0ad6){var _0x134000=this;return new Promise(function(_0x8705f,_0x1333b5){return db[_0x9603('0x1e')][_0x9603('0x1f')](_0x2b0ad6['body'],{'raw':_0x2b0ad6[_0x9603('0x20')]?_0x2b0ad6[_0x9603('0x20')][_0x9603('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b0ad6[_0x9603('0x20')]?_0x2b0ad6[_0x9603('0x20')][_0x9603('0x22')]||null:null,'attributes':_0x2b0ad6['options']?_0x2b0ad6['options'][_0x9603('0x23')]||null:null,'limit':_0x2b0ad6['options']?_0x2b0ad6[_0x9603('0x20')][_0x9603('0x24')]||null:null})[_0x9603('0x11')](function(_0x302d11){logger[_0x9603('0x12')](_0x9603('0x1d'),_0x2b0ad6);logger[_0x9603('0x15')](_0x9603('0x1d'),_0x2b0ad6,JSON[_0x9603('0x17')](_0x302d11));_0x8705f(_0x302d11);})[_0x9603('0x1c')](function(_0xf041d0){logger['error']('UpdateOpenchannelInteraction',_0xf041d0[_0x9603('0x1a')],_0x2b0ad6);_0x1333b5(_0x134000['error'](0x1f4,_0xf041d0[_0x9603('0x1a')]));});});};exports[_0x9603('0x25')]=function(_0x276a89){return new Promise(function(_0xaa554c,_0x4612e7){return db['OpenchannelInteraction'][_0x9603('0x26')]({'where':_0x276a89['options']?_0x276a89[_0x9603('0x20')][_0x9603('0x22')]||null:null})[_0x9603('0x11')](function(_0x516fbe){if(_0x516fbe){return _0x516fbe[_0x9603('0x27')](_0x276a89['body'][_0x9603('0x28')],_['omit'](_0x276a89[_0x9603('0x29')],[_0x9603('0x28'),'id'])||{});}})['spread'](function(_0x24be1b){logger[_0x9603('0x12')]('AddTags',_0x276a89);logger['debug'](_0x9603('0x2a'),_0x276a89,JSON[_0x9603('0x17')](_0x24be1b));_0xaa554c(_0x24be1b);})[_0x9603('0x1c')](function(_0x4d9b7d){logger[_0x9603('0x18')](_0x9603('0x2a'),_0x4d9b7d[_0x9603('0x1a')],_0x276a89);_0x4612e7(_this['error'](0x1f4,_0x4d9b7d[_0x9603('0x1a')]));});});}; \ No newline at end of file +var _0xe5f6=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','where','limit','find','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x222da3,_0x1472f5){var _0x410716=function(_0x46b2cb){while(--_0x46b2cb){_0x222da3['push'](_0x222da3['shift']());}};_0x410716(++_0x1472f5);}(_0xe5f6,0x1cc));var _0x6e5f=function(_0x2f8c48,_0x18b6bc){_0x2f8c48=_0x2f8c48-0x0;var _0x35d75e=_0xe5f6[_0x2f8c48];return _0x35d75e;};'use strict';var _=require(_0x6e5f('0x0'));var util=require(_0x6e5f('0x1'));var moment=require(_0x6e5f('0x2'));var BPromise=require(_0x6e5f('0x3'));var rs=require(_0x6e5f('0x4'));var fs=require('fs');var Redis=require(_0x6e5f('0x5'));var db=require(_0x6e5f('0x6'))['db'];var utils=require(_0x6e5f('0x7'));var logger=require('../../config/logger')(_0x6e5f('0x8'));var config=require(_0x6e5f('0x9'));var jayson=require(_0x6e5f('0xa'));var client=jayson[_0x6e5f('0xb')][_0x6e5f('0xc')]({'port':0x232a});config[_0x6e5f('0xd')]=_[_0x6e5f('0xe')](config['redis'],{'host':_0x6e5f('0xf'),'port':0x18eb});var socket=require(_0x6e5f('0x10'))(new Redis(config[_0x6e5f('0xd')]));require('./openchannelInteraction.socket')[_0x6e5f('0x11')](socket);function respondWithRpcPromise(_0x334f6e,_0x18296c,_0x497bf3){return new BPromise(function(_0x29b7cf,_0x37dc76){return client[_0x6e5f('0x12')](_0x334f6e,_0x497bf3)[_0x6e5f('0x13')](function(_0x12b3b0){logger[_0x6e5f('0x14')](_0x6e5f('0x15'),_0x18296c,_0x6e5f('0x16'));logger[_0x6e5f('0x17')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x18296c,_0x6e5f('0x16'),JSON[_0x6e5f('0x18')](_0x12b3b0));if(_0x12b3b0['error']){if(_0x12b3b0[_0x6e5f('0x19')][_0x6e5f('0x1a')]===0x1f4){logger['error'](_0x6e5f('0x15'),_0x18296c,_0x12b3b0[_0x6e5f('0x19')][_0x6e5f('0x1b')]);return _0x37dc76(_0x12b3b0[_0x6e5f('0x19')][_0x6e5f('0x1b')]);}logger['error'](_0x6e5f('0x15'),_0x18296c,_0x12b3b0[_0x6e5f('0x19')][_0x6e5f('0x1b')]);return _0x29b7cf(_0x12b3b0[_0x6e5f('0x19')][_0x6e5f('0x1b')]);}else{logger['info'](_0x6e5f('0x15'),_0x18296c,'request\x20sent');_0x29b7cf(_0x12b3b0[_0x6e5f('0x1c')][_0x6e5f('0x1b')]);}})[_0x6e5f('0x1d')](function(_0x246150){logger[_0x6e5f('0x19')]('OpenchannelInteraction,\x20%s,\x20%s',_0x18296c,_0x246150);_0x37dc76(_0x246150);});});}exports[_0x6e5f('0x1e')]=function(_0x5cd1ce){var _0x21442d=this;return new Promise(function(_0x2089c0,_0x405216){return db[_0x6e5f('0x1f')]['update'](_0x5cd1ce[_0x6e5f('0x20')],{'raw':_0x5cd1ce[_0x6e5f('0x21')]?_0x5cd1ce[_0x6e5f('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cd1ce[_0x6e5f('0x21')]?_0x5cd1ce[_0x6e5f('0x21')][_0x6e5f('0x22')]||null:null,'attributes':_0x5cd1ce[_0x6e5f('0x21')]?_0x5cd1ce[_0x6e5f('0x21')]['attributes']||null:null,'limit':_0x5cd1ce[_0x6e5f('0x21')]?_0x5cd1ce[_0x6e5f('0x21')][_0x6e5f('0x23')]||null:null})['then'](function(_0x4df3be){logger[_0x6e5f('0x14')](_0x6e5f('0x1e'),_0x5cd1ce);logger[_0x6e5f('0x17')](_0x6e5f('0x1e'),_0x5cd1ce,JSON['stringify'](_0x4df3be));_0x2089c0(_0x4df3be);})[_0x6e5f('0x1d')](function(_0x6369fd){logger[_0x6e5f('0x19')]('UpdateOpenchannelInteraction',_0x6369fd[_0x6e5f('0x1b')],_0x5cd1ce);_0x405216(_0x21442d[_0x6e5f('0x19')](0x1f4,_0x6369fd[_0x6e5f('0x1b')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x265511){return new Promise(function(_0xd5acc2,_0x58d66a){return db[_0x6e5f('0x1f')][_0x6e5f('0x24')]({'where':_0x265511[_0x6e5f('0x21')]?_0x265511['options'][_0x6e5f('0x22')]||null:null})[_0x6e5f('0x13')](function(_0x465371){if(_0x465371){return _0x465371['addTags'](_0x265511[_0x6e5f('0x20')][_0x6e5f('0x25')],_['omit'](_0x265511[_0x6e5f('0x20')],['ids','id'])||{});}})['spread'](function(_0x4a69c2){logger[_0x6e5f('0x14')](_0x6e5f('0x26'),_0x265511);logger['debug'](_0x6e5f('0x26'),_0x265511,JSON[_0x6e5f('0x18')](_0x4a69c2));_0xd5acc2(_0x4a69c2);})[_0x6e5f('0x1d')](function(_0x487f19){logger[_0x6e5f('0x19')](_0x6e5f('0x26'),_0x487f19[_0x6e5f('0x1b')],_0x265511);_0x58d66a(_this[_0x6e5f('0x19')](0x1f4,_0x487f19['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index fe27d1c..c95f9e1 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 _0x3aeb=['length','openchannelInteraction:','./openchannelInteraction.events','save','remove','emit','removeListener','register'];(function(_0x3e8d18,_0x413252){var _0x27fe76=function(_0xd25159){while(--_0xd25159){_0x3e8d18['push'](_0x3e8d18['shift']());}};_0x27fe76(++_0x413252);}(_0x3aeb,0x92));var _0xb3ae=function(_0x36e14a,_0x55d29b){_0x36e14a=_0x36e14a-0x0;var _0x33a7b6=_0x3aeb[_0x36e14a];return _0x33a7b6;};'use strict';var OpenchannelInteractionEvents=require(_0xb3ae('0x0'));var events=[_0xb3ae('0x1'),_0xb3ae('0x2'),'update'];function createListener(_0x398d28,_0x1c267d){return function(_0x4231a7){_0x1c267d[_0xb3ae('0x3')](_0x398d28,_0x4231a7);};}function removeListener(_0x1ddd99,_0x4b2b4e){return function(){OpenchannelInteractionEvents[_0xb3ae('0x4')](_0x1ddd99,_0x4b2b4e);};}exports[_0xb3ae('0x5')]=function(_0x32a76a){for(var _0x4f5538=0x0,_0x374331=events[_0xb3ae('0x6')];_0x4f5538<_0x374331;_0x4f5538++){var _0x689773=events[_0x4f5538];var _0x139052=createListener(_0xb3ae('0x7')+_0x689773,_0x32a76a);OpenchannelInteractionEvents['on'](_0x689773,_0x139052);}}; \ No newline at end of file +var _0x753f=['openchannelInteraction:','./openchannelInteraction.events','save','update','emit','register','length'];(function(_0x5b44f4,_0x4a4c11){var _0x55d17c=function(_0x362b3d){while(--_0x362b3d){_0x5b44f4['push'](_0x5b44f4['shift']());}};_0x55d17c(++_0x4a4c11);}(_0x753f,0x166));var _0xf753=function(_0xb3dc0c,_0x55df5f){_0xb3dc0c=_0xb3dc0c-0x0;var _0xf423d0=_0x753f[_0xb3dc0c];return _0xf423d0;};'use strict';var OpenchannelInteractionEvents=require(_0xf753('0x0'));var events=[_0xf753('0x1'),'remove',_0xf753('0x2')];function createListener(_0x21719e,_0x57fc00){return function(_0x6f518f){_0x57fc00[_0xf753('0x3')](_0x21719e,_0x6f518f);};}function removeListener(_0x1a9b7d,_0x590e0c){return function(){OpenchannelInteractionEvents['removeListener'](_0x1a9b7d,_0x590e0c);};}exports[_0xf753('0x4')]=function(_0x5a83a0){for(var _0x40754e=0x0,_0x20d965=events[_0xf753('0x5')];_0x40754e<_0x20d965;_0x40754e++){var _0x541a3d=events[_0x40754e];var _0x3b8e20=createListener(_0xf753('0x6')+_0x541a3d,_0x5a83a0);OpenchannelInteractionEvents['on'](_0x541a3d,_0x3b8e20);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index e457ccc..537fd09 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x30cafe,_0x2951f){var _0x370767=function(_0x417013){while(--_0x417013){_0x30cafe['push'](_0x30cafe['shift']());}};_0x370767(++_0x2951f);}(_0xe706,0xa3));var _0x6e70=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0xe706[_0x29dda1];return _0x21b0ef;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 6c77aee..2ad0750 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 _0x6e6c=['exports','medium','BOOLEAN','out','DATE','TEXT','sequelize'];(function(_0x2114d8,_0x355df7){var _0x4bcb29=function(_0x40ae35){while(--_0x40ae35){_0x2114d8['push'](_0x2114d8['shift']());}};_0x4bcb29(++_0x355df7);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc6e6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc6e6('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc6e6('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xc6e6('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xc6e6('0x6')]}}; \ No newline at end of file +var _0x8c7a=['sequelize','medium','BOOLEAN','ENUM','out','STRING','TEXT'];(function(_0x28666a,_0x3dc25d){var _0x19d752=function(_0x551e47){while(--_0x551e47){_0x28666a['push'](_0x28666a['shift']());}};_0x19d752(++_0x3dc25d);}(_0x8c7a,0x8c));var _0xa8c7=function(_0x1482c7,_0x4e035e){_0x1482c7=_0x1482c7-0x0;var _0x69bc25=_0x8c7a[_0x1482c7];return _0x69bc25;};'use strict';var Sequelize=require(_0xa8c7('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xa8c7('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xa8c7('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa8c7('0x3')]('in',_0xa8c7('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xa8c7('0x5')]},'providerResponse':{'type':Sequelize[_0xa8c7('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 7c00c67..a86f7d0 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 _0x7177=['info','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','update','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','OpenchannelMessage','includeAll','findAll','rows','show','params','length','include','options','find','create','body','describe','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','openchannel-interactions','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','http','client','then'];(function(_0x4faa7b,_0x4da8c0){var _0x4ee40b=function(_0x1fabc3){while(--_0x1fabc3){_0x4faa7b['push'](_0x4faa7b['shift']());}};_0x4ee40b(++_0x4da8c0);}(_0x7177,0x174));var _0x7717=function(_0x6a21f4,_0x220ad8){_0x6a21f4=_0x6a21f4-0x0;var _0x4c15ac=_0x7177[_0x6a21f4];return _0x4c15ac;};'use strict';var emlformat=require(_0x7717('0x0'));var rimraf=require(_0x7717('0x1'));var zipdir=require(_0x7717('0x2'));var jsonpatch=require(_0x7717('0x3'));var rp=require(_0x7717('0x4'));var moment=require(_0x7717('0x5'));var BPromise=require(_0x7717('0x6'));var Mustache=require(_0x7717('0x7'));var util=require(_0x7717('0x8'));var path=require('path');var sox=require(_0x7717('0x9'));var csv=require(_0x7717('0xa'));var ejs=require(_0x7717('0xb'));var fs=require('fs');var fs_extra=require(_0x7717('0xc'));var _=require('lodash');var squel=require(_0x7717('0xd'));var crypto=require(_0x7717('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7717('0xf'));var toCsv=require(_0x7717('0xa'));var querystring=require(_0x7717('0x10'));var Papa=require(_0x7717('0x11'));var Redis=require(_0x7717('0x12'));var authService=require(_0x7717('0x13'));var qs=require(_0x7717('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7717('0x15'))(_0x7717('0x16'));var utils=require(_0x7717('0x17'));var config=require(_0x7717('0x18'));var licenseUtil=require(_0x7717('0x19'));var db=require(_0x7717('0x1a'))['db'];config[_0x7717('0x1b')]=_[_0x7717('0x1c')](config[_0x7717('0x1b')],{'host':_0x7717('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7717('0x1b')]));require(_0x7717('0x1e'))[_0x7717('0x1f')](socket);var jayson=require(_0x7717('0x20'));var client=jayson['client'][_0x7717('0x21')]({'port':0x232c});var client9002=jayson[_0x7717('0x22')][_0x7717('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2fd014,_0x57c61b,_0x4b5ae9,_0x1cbf2f){return new BPromise(function(_0x344942,_0x4e45a4){var _0x2d94b7=_0x1cbf2f||client;return _0x2d94b7['request'](_0x2fd014,_0x4b5ae9)[_0x7717('0x23')](function(_0xd23cf9){logger[_0x7717('0x24')](_0x7717('0x25'),_0x57c61b,'request\x20sent');logger[_0x7717('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x57c61b,_0x7717('0x27'),JSON[_0x7717('0x28')](_0xd23cf9));if(_0xd23cf9[_0x7717('0x29')]){if(_0xd23cf9[_0x7717('0x29')][_0x7717('0x2a')]===0x1f4){logger[_0x7717('0x29')](_0x7717('0x25'),_0x57c61b,_0xd23cf9[_0x7717('0x29')][_0x7717('0x2b')]);return _0x4e45a4(_0xd23cf9[_0x7717('0x29')]['message']);}logger[_0x7717('0x29')](_0x7717('0x25'),_0x57c61b,_0xd23cf9['error'][_0x7717('0x2b')]);return _0x344942(_0xd23cf9[_0x7717('0x29')][_0x7717('0x2b')]);}else{logger[_0x7717('0x24')](_0x7717('0x25'),_0x57c61b,'request\x20sent');_0x344942(_0xd23cf9[_0x7717('0x2c')]['message']);}})[_0x7717('0x2d')](function(_0x1a9b41){logger[_0x7717('0x29')](_0x7717('0x25'),_0x57c61b,_0x1a9b41);_0x4e45a4(_0x1a9b41);});});}function respondWithStatusCode(_0x5b8a82,_0x42e112){_0x42e112=_0x42e112||0xcc;return function(_0x34a321){if(_0x34a321){return _0x5b8a82[_0x7717('0x2e')](_0x42e112);}return _0x5b8a82[_0x7717('0x2f')](_0x42e112)[_0x7717('0x30')]();};}function respondWithResult(_0x51e71d,_0x312a1c){_0x312a1c=_0x312a1c||0xc8;return function(_0x1ada0c){if(_0x1ada0c){return _0x51e71d[_0x7717('0x2f')](_0x312a1c)[_0x7717('0x31')](_0x1ada0c);}};}function respondWithFilteredResult(_0x14df72,_0x13d04a){return function(_0x27a2ca){if(_0x27a2ca){var _0x4632c1=typeof _0x13d04a['offset']==='undefined'&&typeof _0x13d04a['limit']===_0x7717('0x32');var _0x226537=_0x27a2ca[_0x7717('0x33')];var _0x50f7ed=_0x4632c1?0x0:_0x13d04a[_0x7717('0x34')];var _0x196697=_0x4632c1?_0x27a2ca[_0x7717('0x33')]:_0x13d04a[_0x7717('0x34')]+_0x13d04a[_0x7717('0x35')];var _0x2fffee;if(_0x196697>=_0x226537){_0x196697=_0x226537;_0x2fffee=0xc8;}else{_0x2fffee=0xce;}_0x14df72[_0x7717('0x2f')](_0x2fffee);return _0x14df72[_0x7717('0x36')]('Content-Range',_0x50f7ed+'-'+_0x196697+'/'+_0x226537)['json'](_0x27a2ca);}return null;};}function patchUpdates(_0x44a5e0){return function(_0x1a5ed8){try{jsonpatch[_0x7717('0x37')](_0x1a5ed8,_0x44a5e0,!![]);}catch(_0x4655d5){return BPromise[_0x7717('0x38')](_0x4655d5);}return _0x1a5ed8['save']();};}function saveUpdates(_0x336b78,_0x4d095d){return function(_0x17615b){if(_0x17615b){return _0x17615b[_0x7717('0x39')](_0x336b78)[_0x7717('0x23')](function(_0x4bc736){return _0x4bc736;});}return null;};}function removeEntity(_0x1e4c42,_0x1210ab){return function(_0xfab0c1){if(_0xfab0c1){return _0xfab0c1[_0x7717('0x3a')]()['then'](function(){_0x1e4c42['status'](0xcc)[_0x7717('0x30')]();});}};}function handleEntityNotFound(_0x976524,_0x11684d){return function(_0x17b225){if(!_0x17b225){_0x976524['sendStatus'](0x194);}return _0x17b225;};}function handleError(_0x42707a,_0x314bf9){_0x314bf9=_0x314bf9||0x1f4;return function(_0x483f32){logger[_0x7717('0x29')](_0x483f32['stack']);if(_0x483f32['name']){delete _0x483f32[_0x7717('0x3b')];}_0x42707a[_0x7717('0x2f')](_0x314bf9)[_0x7717('0x3c')](_0x483f32);};}exports[_0x7717('0x3d')]=function(_0x2aeb90,_0x495517){var _0x2e0730={},_0x281979={},_0x34a7e2={'count':0x0,'rows':[]};var _0xc9a50f=_[_0x7717('0x3e')](db['OpenchannelMessage'][_0x7717('0x3f')],function(_0x3960bc){return{'name':_0x3960bc[_0x7717('0x40')],'type':_0x3960bc[_0x7717('0x41')][_0x7717('0x42')]};});_0x281979[_0x7717('0x43')]=_['map'](_0xc9a50f,_0x7717('0x3b'));_0x281979['query']=_[_0x7717('0x44')](_0x2aeb90['query']);_0x281979['filters']=_[_0x7717('0x45')](_0x281979[_0x7717('0x43')],_0x281979[_0x7717('0x46')]);_0x2e0730[_0x7717('0x47')]=_[_0x7717('0x45')](_0x281979[_0x7717('0x43')],qs['fields'](_0x2aeb90['query'][_0x7717('0x48')]));_0x2e0730[_0x7717('0x47')]=_0x2e0730[_0x7717('0x47')]['length']?_0x2e0730['attributes']:_0x281979[_0x7717('0x43')];if(!_0x2aeb90[_0x7717('0x46')][_0x7717('0x49')]('nolimit')){_0x2e0730['limit']=qs[_0x7717('0x35')](_0x2aeb90['query'][_0x7717('0x35')]);_0x2e0730[_0x7717('0x34')]=qs[_0x7717('0x34')](_0x2aeb90['query'][_0x7717('0x34')]);}_0x2e0730[_0x7717('0x4a')]=qs['sort'](_0x2aeb90[_0x7717('0x46')][_0x7717('0x4b')]);_0x2e0730[_0x7717('0x4c')]=qs[_0x7717('0x4d')](_[_0x7717('0x4e')](_0x2aeb90['query'],_0x281979[_0x7717('0x4d')]),_0xc9a50f);if(_0x2aeb90[_0x7717('0x46')]['filter']){_0x2e0730[_0x7717('0x4c')]=_['merge'](_0x2e0730[_0x7717('0x4c')],{'$or':_[_0x7717('0x3e')](_0xc9a50f,function(_0x337a60){if(_0x337a60[_0x7717('0x41')]!=='VIRTUAL'){var _0x483d42={};_0x483d42[_0x337a60[_0x7717('0x3b')]]={'$like':'%'+_0x2aeb90[_0x7717('0x46')]['filter']+'%'};return _0x483d42;}})});}_0x2e0730=_[_0x7717('0x4f')]({},_0x2e0730,_0x2aeb90['options']);var _0x2ebd99={'where':_0x2e0730[_0x7717('0x4c')]};return db[_0x7717('0x50')][_0x7717('0x33')](_0x2ebd99)['then'](function(_0x5b6150){_0x34a7e2[_0x7717('0x33')]=_0x5b6150;if(_0x2aeb90['query'][_0x7717('0x51')]){_0x2e0730['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x7717('0x52')](_0x2e0730);})[_0x7717('0x23')](function(_0x5b5508){_0x34a7e2[_0x7717('0x53')]=_0x5b5508;return _0x34a7e2;})['then'](respondWithFilteredResult(_0x495517,_0x2e0730))[_0x7717('0x2d')](handleError(_0x495517,null));};exports[_0x7717('0x54')]=function(_0x51c6d7,_0xefec5a){var _0xde6b46={'raw':!![],'where':{'id':_0x51c6d7[_0x7717('0x55')]['id']}},_0x2c7864={};_0x2c7864[_0x7717('0x43')]=_[_0x7717('0x44')](db['OpenchannelMessage'][_0x7717('0x3f')]);_0x2c7864['query']=_[_0x7717('0x44')](_0x51c6d7[_0x7717('0x46')]);_0x2c7864[_0x7717('0x4d')]=_[_0x7717('0x45')](_0x2c7864[_0x7717('0x43')],_0x2c7864[_0x7717('0x46')]);_0xde6b46[_0x7717('0x47')]=_[_0x7717('0x45')](_0x2c7864[_0x7717('0x43')],qs[_0x7717('0x48')](_0x51c6d7[_0x7717('0x46')]['fields']));_0xde6b46['attributes']=_0xde6b46['attributes'][_0x7717('0x56')]?_0xde6b46[_0x7717('0x47')]:_0x2c7864['model'];if(_0x51c6d7['query'][_0x7717('0x51')]){_0xde6b46[_0x7717('0x57')]=[{'all':!![]}];}_0xde6b46=_[_0x7717('0x4f')]({},_0xde6b46,_0x51c6d7[_0x7717('0x58')]);return db[_0x7717('0x50')][_0x7717('0x59')](_0xde6b46)['then'](handleEntityNotFound(_0xefec5a,null))[_0x7717('0x23')](respondWithResult(_0xefec5a,null))[_0x7717('0x2d')](handleError(_0xefec5a,null));};exports[_0x7717('0x5a')]=function(_0x3bf594,_0x506d99){return db[_0x7717('0x50')]['create'](_0x3bf594['body'],{})['then'](respondWithResult(_0x506d99,0xc9))[_0x7717('0x2d')](handleError(_0x506d99,null));};exports[_0x7717('0x39')]=function(_0x2529d6,_0x11fbaf){if(_0x2529d6['body']['id']){delete _0x2529d6[_0x7717('0x5b')]['id'];}return db[_0x7717('0x50')][_0x7717('0x59')]({'where':{'id':_0x2529d6[_0x7717('0x55')]['id']}})[_0x7717('0x23')](handleEntityNotFound(_0x11fbaf,null))['then'](saveUpdates(_0x2529d6['body'],null))[_0x7717('0x23')](respondWithResult(_0x11fbaf,null))['catch'](handleError(_0x11fbaf,null));};exports[_0x7717('0x3a')]=function(_0x1df052,_0xddaf11){return db[_0x7717('0x50')][_0x7717('0x59')]({'where':{'id':_0x1df052[_0x7717('0x55')]['id']}})[_0x7717('0x23')](handleEntityNotFound(_0xddaf11,null))[_0x7717('0x23')](removeEntity(_0xddaf11,null))[_0x7717('0x2d')](handleError(_0xddaf11,null));};exports[_0x7717('0x5c')]=function(_0x527ed1,_0x28177a){return db[_0x7717('0x50')][_0x7717('0x5c')]()[_0x7717('0x23')](respondWithResult(_0x28177a,null))[_0x7717('0x2d')](handleError(_0x28177a,null));};var interaction_log=require(_0x7717('0x15'))('openchannel-interactions');exports['accept']=function(_0x18d4fe,_0x145ea3,_0x546fd0){var _0x51bd95={'agent':{},'channel':_0x7717('0x5d')};if(_0x18d4fe[_0x7717('0x5b')]['id']){delete _0x18d4fe[_0x7717('0x5b')]['id'];}_0x18d4fe[_0x7717('0x5b')][_0x7717('0x5e')]=!![];_0x18d4fe[_0x7717('0x5b')][_0x7717('0x5f')]=moment()[_0x7717('0x60')](_0x7717('0x61'));_0x18d4fe[_0x7717('0x5b')]['UserId']=_0x18d4fe[_0x7717('0x5b')][_0x7717('0x62')]||_0x18d4fe[_0x7717('0x63')]['id'];_0x51bd95[_0x7717('0x64')]['id']=_0x18d4fe[_0x7717('0x5b')][_0x7717('0x62')];return db[_0x7717('0x50')][_0x7717('0x59')]({'where':{'id':_0x18d4fe['params']['id'],'UserId':null}})[_0x7717('0x23')](handleEntityNotFound(_0x145ea3,null))[_0x7717('0x23')](saveUpdates(_0x18d4fe[_0x7717('0x5b')],null))[_0x7717('0x23')](function(_0x5f27cf){if(_0x5f27cf){_0x51bd95[_0x7717('0x2b')]=_0x5f27cf[_0x7717('0x65')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x5f27cf[_0x7717('0x66')]}});}return null;})[_0x7717('0x23')](handleEntityNotFound(_0x145ea3,null))[_0x7717('0x23')](function(_0x178cfb){if(_0x178cfb){return _0x178cfb[_0x7717('0x39')]({'UserId':_0x18d4fe[_0x7717('0x5b')][_0x7717('0x62')],'read1stAt':_[_0x7717('0x67')](_0x178cfb[_0x7717('0x68')])?moment()[_0x7717('0x60')](_0x7717('0x61')):undefined});}return null;})['then'](function(_0x3ae5b2){if(_0x3ae5b2){_0x51bd95['interaction']=_0x3ae5b2[_0x7717('0x65')]({'plain':!![]});interaction_log[_0x7717('0x24')](_0x7717('0x69'),_0x18d4fe['user']['id'],_0x18d4fe[_0x7717('0x63')][_0x7717('0x3b')],_0x18d4fe[_0x7717('0x63')][_0x7717('0x6a')],_0x51bd95[_0x7717('0x6b')]['id'],_0x18d4fe[_0x7717('0x5b')]?JSON[_0x7717('0x28')](_0x18d4fe[_0x7717('0x5b')]):'null');return respondWithRpcPromise(_0x7717('0x6c'),_0x7717('0x6d'),_0x51bd95);}return null;})[_0x7717('0x23')](function(_0x3f0066){var _0xbeb3f1=_0x7717('0x6e')+_0x3f0066['message'][_0x7717('0x6f')];return db[_0x7717('0x70')]['query'](_0xbeb3f1,{'type':db['Sequelize'][_0x7717('0x71')][_0x7717('0x72')],'raw':!![]})[_0x7717('0x23')](function(_0x42e4f3){return _0x42e4f3;});})[_0x7717('0x23')](function(_0x2f4a62){if(_0x2f4a62){_0x51bd95[_0x7717('0x2b')][_0x7717('0x73')]=_0x2f4a62[0x0];if(!_0x18d4fe[_0x7717('0x5b')][_0x7717('0x62')])return;return db[_0x7717('0x74')]['find']({'where':{'id':_0x18d4fe[_0x7717('0x5b')][_0x7717('0x62')],'role':_0x7717('0x64')},'attributes':['id','name',_0x7717('0x75'),_0x7717('0x76'),_0x7717('0x77')],'raw':!![]});}return null;})[_0x7717('0x23')](function(_0x512737){if(!_0x512737)return null;_0x51bd95['message'][_0x7717('0x64')]=_0x512737;return _0x51bd95;})['then'](function(_0x3e10df){if(_0x3e10df){if(_0x18d4fe[_0x7717('0x5b')]['manual']){_0x51bd95[_0x7717('0x2b')][_0x7717('0x78')]=util[_0x7717('0x60')](_0x7717('0x79'),_0x18d4fe['user'][_0x7717('0x3b')]);_0x51bd95[_0x7717('0x2b')][_0x7717('0x7a')]=_0x51bd95[_0x7717('0x7a')];_0x51bd95[_0x7717('0x2b')][_0x7717('0x7b')]=_0x51bd95[_0x7717('0x7a')];_0x51bd95[_0x7717('0x2b')][_0x7717('0x7c')]=_0x7717('0x7d');return respondWithRpcPromise('EventManager',_0x7717('0x7e'),{'event':_0x7717('0x7f'),'message':_0x51bd95['message']},client9002)['then'](function(){return _0x51bd95;});}return _0x51bd95;}return null;})['then'](respondWithResult(_0x145ea3,null))[_0x7717('0x2d')](handleError(_0x145ea3,null));};var interaction_log=require(_0x7717('0x15'))(_0x7717('0x80'));exports['reject']=function(_0x171cd5,_0x402de8,_0x4cb004){var _0x562e3b={'agent':{},'channel':'openchannel'};if(_0x171cd5[_0x7717('0x5b')]['id']){delete _0x171cd5[_0x7717('0x5b')]['id'];}_0x171cd5['body'][_0x7717('0x62')]=_0x171cd5[_0x7717('0x5b')][_0x7717('0x62')]||_0x171cd5[_0x7717('0x63')]['id'];_0x562e3b['agent']['id']=_0x171cd5[_0x7717('0x5b')][_0x7717('0x62')];return db[_0x7717('0x50')][_0x7717('0x59')]({'where':{'id':_0x171cd5[_0x7717('0x55')]['id'],'UserId':null}})[_0x7717('0x23')](handleEntityNotFound(_0x402de8,null))['then'](function(_0x57d00d){if(_0x57d00d){_0x562e3b['message']=_0x57d00d[_0x7717('0x65')]({'plain':!![]});return db[_0x7717('0x81')][_0x7717('0x59')]({'where':{'id':_0x57d00d['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x402de8,null))[_0x7717('0x23')](function(_0x252322){if(_0x252322){_0x562e3b[_0x7717('0x6b')]=_0x252322[_0x7717('0x65')]({'plain':!![]});interaction_log[_0x7717('0x24')](_0x7717('0x82'),_0x171cd5[_0x7717('0x63')]['id'],_0x171cd5[_0x7717('0x63')][_0x7717('0x3b')],_0x171cd5['user'][_0x7717('0x6a')],_0x562e3b[_0x7717('0x6b')]['id'],_0x171cd5[_0x7717('0x5b')]?JSON[_0x7717('0x28')](_0x171cd5[_0x7717('0x5b')]):_0x7717('0x83'));return respondWithRpcPromise(_0x7717('0x84'),_0x7717('0x85'),_0x562e3b);}return null;})[_0x7717('0x23')](function(_0x12bd0d){var _0x2cf668=_0x7717('0x6e')+_0x12bd0d[_0x7717('0x2b')]['ContactId'];return db[_0x7717('0x70')]['query'](_0x2cf668,{'type':db[_0x7717('0x86')]['QueryTypes'][_0x7717('0x72')],'raw':!![]})['then'](function(_0x423268){return _0x423268;});})[_0x7717('0x23')](function(_0x558f07){if(_0x558f07){_0x562e3b[_0x7717('0x2b')][_0x7717('0x73')]=_0x558f07[0x0];if(!_0x171cd5[_0x7717('0x5b')][_0x7717('0x62')])return;return db['User'][_0x7717('0x59')]({'where':{'id':_0x171cd5['body']['UserId'],'role':'agent'},'attributes':['id',_0x7717('0x3b'),_0x7717('0x75'),'email',_0x7717('0x77')],'raw':!![]});}return null;})[_0x7717('0x23')](function(_0x59c0ca){if(!_0x59c0ca)return null;_0x562e3b[_0x7717('0x2b')][_0x7717('0x64')]=_0x59c0ca;return _0x562e3b;})[_0x7717('0x23')](function(_0x32e0c5){if(_0x32e0c5){_0x32e0c5[_0x7717('0x2b')][_0x7717('0x78')]=util[_0x7717('0x60')]('SIP/%s',_0x171cd5[_0x7717('0x63')]['name']);_0x32e0c5[_0x7717('0x2b')][_0x7717('0x7a')]=_0x562e3b[_0x7717('0x7a')];_0x32e0c5['message']['motionChannel']=_0x562e3b[_0x7717('0x7a')];_0x32e0c5[_0x7717('0x2b')][_0x7717('0x7c')]=_0x7717('0x38');respondWithRpcPromise(_0x7717('0x7e'),'EventManager',{'event':_0x7717('0x87'),'message':_0x32e0c5[_0x7717('0x2b')]},client9002);return _0x562e3b;}return null;})[_0x7717('0x23')](respondWithResult(_0x402de8,null))[_0x7717('0x2d')](handleError(_0x402de8,null));}; \ No newline at end of file +var _0x29eb=['map','OpenchannelMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','create','body','find','params','destroy','describe','../../config/logger','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','internal','agent','manual','interface','SIP/%s','channel','motionChannel','EventManager','openchannel-interactions','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','email','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','json','undefined','limit','count','offset','Content-Range','save','update','stack','name'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x29eb,0x1c5));var _0xb29e=function(_0x233c10,_0x25d0fe){_0x233c10=_0x233c10-0x0;var _0x1abb14=_0x29eb[_0x233c10];return _0x1abb14;};'use strict';var emlformat=require(_0xb29e('0x0'));var rimraf=require(_0xb29e('0x1'));var zipdir=require(_0xb29e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb29e('0x3'));var moment=require(_0xb29e('0x4'));var BPromise=require(_0xb29e('0x5'));var Mustache=require('mustache');var util=require(_0xb29e('0x6'));var path=require('path');var sox=require(_0xb29e('0x7'));var csv=require(_0xb29e('0x8'));var ejs=require(_0xb29e('0x9'));var fs=require('fs');var fs_extra=require(_0xb29e('0xa'));var _=require(_0xb29e('0xb'));var squel=require(_0xb29e('0xc'));var crypto=require('crypto');var jsforce=require(_0xb29e('0xd'));var deskjs=require(_0xb29e('0xe'));var toCsv=require(_0xb29e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb29e('0xf'));var authService=require(_0xb29e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb29e('0x11'));var hardwareService=require(_0xb29e('0x12'));var logger=require('../../config/logger')(_0xb29e('0x13'));var utils=require(_0xb29e('0x14'));var config=require(_0xb29e('0x15'));var licenseUtil=require(_0xb29e('0x16'));var db=require(_0xb29e('0x17'))['db'];config['redis']=_[_0xb29e('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb29e('0x19')]));require(_0xb29e('0x1a'))[_0xb29e('0x1b')](socket);var jayson=require(_0xb29e('0x1c'));var client=jayson[_0xb29e('0x1d')][_0xb29e('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xb29e('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2c0324,_0x32bd5d,_0x33e2dd,_0x5e66ff){return new BPromise(function(_0x523341,_0x244067){var _0x2aa3a1=_0x5e66ff||client;return _0x2aa3a1[_0xb29e('0x1f')](_0x2c0324,_0x33e2dd)[_0xb29e('0x20')](function(_0x6049e){logger[_0xb29e('0x21')](_0xb29e('0x22'),_0x32bd5d,_0xb29e('0x23'));logger[_0xb29e('0x24')](_0xb29e('0x25'),_0x32bd5d,'request\x20sent',JSON[_0xb29e('0x26')](_0x6049e));if(_0x6049e[_0xb29e('0x27')]){if(_0x6049e[_0xb29e('0x27')]['code']===0x1f4){logger[_0xb29e('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x32bd5d,_0x6049e[_0xb29e('0x27')][_0xb29e('0x28')]);return _0x244067(_0x6049e[_0xb29e('0x27')][_0xb29e('0x28')]);}logger[_0xb29e('0x27')](_0xb29e('0x22'),_0x32bd5d,_0x6049e[_0xb29e('0x27')]['message']);return _0x523341(_0x6049e['error'][_0xb29e('0x28')]);}else{logger[_0xb29e('0x21')](_0xb29e('0x22'),_0x32bd5d,_0xb29e('0x23'));_0x523341(_0x6049e[_0xb29e('0x29')][_0xb29e('0x28')]);}})[_0xb29e('0x2a')](function(_0x5b8cee){logger['error'](_0xb29e('0x22'),_0x32bd5d,_0x5b8cee);_0x244067(_0x5b8cee);});});}function respondWithStatusCode(_0x2cbd32,_0x16595b){_0x16595b=_0x16595b||0xcc;return function(_0x59305f){if(_0x59305f){return _0x2cbd32['sendStatus'](_0x16595b);}return _0x2cbd32['status'](_0x16595b)[_0xb29e('0x2b')]();};}function respondWithResult(_0x31654e,_0x19a1a9){_0x19a1a9=_0x19a1a9||0xc8;return function(_0x27a934){if(_0x27a934){return _0x31654e[_0xb29e('0x2c')](_0x19a1a9)[_0xb29e('0x2d')](_0x27a934);}};}function respondWithFilteredResult(_0x375abe,_0x11a022){return function(_0x22b5f7){if(_0x22b5f7){var _0xc08c05=typeof _0x11a022['offset']===_0xb29e('0x2e')&&typeof _0x11a022[_0xb29e('0x2f')]===_0xb29e('0x2e');var _0x491c9b=_0x22b5f7[_0xb29e('0x30')];var _0xd56beb=_0xc08c05?0x0:_0x11a022[_0xb29e('0x31')];var _0x287609=_0xc08c05?_0x22b5f7['count']:_0x11a022[_0xb29e('0x31')]+_0x11a022[_0xb29e('0x2f')];var _0x23e6b0;if(_0x287609>=_0x491c9b){_0x287609=_0x491c9b;_0x23e6b0=0xc8;}else{_0x23e6b0=0xce;}_0x375abe[_0xb29e('0x2c')](_0x23e6b0);return _0x375abe['set'](_0xb29e('0x32'),_0xd56beb+'-'+_0x287609+'/'+_0x491c9b)[_0xb29e('0x2d')](_0x22b5f7);}return null;};}function patchUpdates(_0x48ce78){return function(_0x41606e){try{jsonpatch['apply'](_0x41606e,_0x48ce78,!![]);}catch(_0x233563){return BPromise['reject'](_0x233563);}return _0x41606e[_0xb29e('0x33')]();};}function saveUpdates(_0x47e724,_0x2b7a6a){return function(_0x47b6de){if(_0x47b6de){return _0x47b6de[_0xb29e('0x34')](_0x47e724)['then'](function(_0x1af8a7){return _0x1af8a7;});}return null;};}function removeEntity(_0x530872,_0x16557b){return function(_0x3e4c6b){if(_0x3e4c6b){return _0x3e4c6b['destroy']()['then'](function(){_0x530872[_0xb29e('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x796790,_0x1560bd){return function(_0x23eae1){if(!_0x23eae1){_0x796790['sendStatus'](0x194);}return _0x23eae1;};}function handleError(_0x500d95,_0x1b3bf6){_0x1b3bf6=_0x1b3bf6||0x1f4;return function(_0x586f85){logger[_0xb29e('0x27')](_0x586f85[_0xb29e('0x35')]);if(_0x586f85['name']){delete _0x586f85[_0xb29e('0x36')];}_0x500d95['status'](_0x1b3bf6)['send'](_0x586f85);};}exports['index']=function(_0xca5fde,_0x102490){var _0x5d1ed7={},_0x31501f={},_0xa54a4f={'count':0x0,'rows':[]};var _0x393e3c=_[_0xb29e('0x37')](db[_0xb29e('0x38')][_0xb29e('0x39')],function(_0x21bc16){return{'name':_0x21bc16['fieldName'],'type':_0x21bc16[_0xb29e('0x3a')]['key']};});_0x31501f[_0xb29e('0x3b')]=_[_0xb29e('0x37')](_0x393e3c,_0xb29e('0x36'));_0x31501f[_0xb29e('0x3c')]=_[_0xb29e('0x3d')](_0xca5fde['query']);_0x31501f[_0xb29e('0x3e')]=_[_0xb29e('0x3f')](_0x31501f[_0xb29e('0x3b')],_0x31501f['query']);_0x5d1ed7[_0xb29e('0x40')]=_['intersection'](_0x31501f[_0xb29e('0x3b')],qs[_0xb29e('0x41')](_0xca5fde[_0xb29e('0x3c')]['fields']));_0x5d1ed7[_0xb29e('0x40')]=_0x5d1ed7[_0xb29e('0x40')][_0xb29e('0x42')]?_0x5d1ed7['attributes']:_0x31501f['model'];if(!_0xca5fde[_0xb29e('0x3c')][_0xb29e('0x43')](_0xb29e('0x44'))){_0x5d1ed7['limit']=qs['limit'](_0xca5fde[_0xb29e('0x3c')][_0xb29e('0x2f')]);_0x5d1ed7[_0xb29e('0x31')]=qs[_0xb29e('0x31')](_0xca5fde[_0xb29e('0x3c')]['offset']);}_0x5d1ed7[_0xb29e('0x45')]=qs[_0xb29e('0x46')](_0xca5fde[_0xb29e('0x3c')]['sort']);_0x5d1ed7[_0xb29e('0x47')]=qs[_0xb29e('0x3e')](_[_0xb29e('0x48')](_0xca5fde[_0xb29e('0x3c')],_0x31501f[_0xb29e('0x3e')]),_0x393e3c);if(_0xca5fde[_0xb29e('0x3c')][_0xb29e('0x49')]){_0x5d1ed7[_0xb29e('0x47')]=_[_0xb29e('0x4a')](_0x5d1ed7[_0xb29e('0x47')],{'$or':_[_0xb29e('0x37')](_0x393e3c,function(_0x169c56){if(_0x169c56['type']!==_0xb29e('0x4b')){var _0x5b5154={};_0x5b5154[_0x169c56[_0xb29e('0x36')]]={'$like':'%'+_0xca5fde[_0xb29e('0x3c')][_0xb29e('0x49')]+'%'};return _0x5b5154;}})});}_0x5d1ed7=_[_0xb29e('0x4a')]({},_0x5d1ed7,_0xca5fde['options']);var _0x3c06ea={'where':_0x5d1ed7[_0xb29e('0x47')]};return db[_0xb29e('0x38')][_0xb29e('0x30')](_0x3c06ea)[_0xb29e('0x20')](function(_0x4f01d6){_0xa54a4f[_0xb29e('0x30')]=_0x4f01d6;if(_0xca5fde['query'][_0xb29e('0x4c')]){_0x5d1ed7[_0xb29e('0x4d')]=[{'all':!![]}];}return db[_0xb29e('0x38')][_0xb29e('0x4e')](_0x5d1ed7);})[_0xb29e('0x20')](function(_0x24d342){_0xa54a4f[_0xb29e('0x4f')]=_0x24d342;return _0xa54a4f;})[_0xb29e('0x20')](respondWithFilteredResult(_0x102490,_0x5d1ed7))['catch'](handleError(_0x102490,null));};exports['show']=function(_0x370dbf,_0x3fcbaa){var _0x25b287={'raw':!![],'where':{'id':_0x370dbf['params']['id']}},_0x20dd75={};_0x20dd75[_0xb29e('0x3b')]=_[_0xb29e('0x3d')](db[_0xb29e('0x38')]['rawAttributes']);_0x20dd75['query']=_[_0xb29e('0x3d')](_0x370dbf[_0xb29e('0x3c')]);_0x20dd75[_0xb29e('0x3e')]=_[_0xb29e('0x3f')](_0x20dd75['model'],_0x20dd75['query']);_0x25b287['attributes']=_[_0xb29e('0x3f')](_0x20dd75[_0xb29e('0x3b')],qs[_0xb29e('0x41')](_0x370dbf[_0xb29e('0x3c')][_0xb29e('0x41')]));_0x25b287[_0xb29e('0x40')]=_0x25b287[_0xb29e('0x40')]['length']?_0x25b287[_0xb29e('0x40')]:_0x20dd75[_0xb29e('0x3b')];if(_0x370dbf['query']['includeAll']){_0x25b287['include']=[{'all':!![]}];}_0x25b287=_['merge']({},_0x25b287,_0x370dbf['options']);return db[_0xb29e('0x38')]['find'](_0x25b287)['then'](handleEntityNotFound(_0x3fcbaa,null))[_0xb29e('0x20')](respondWithResult(_0x3fcbaa,null))[_0xb29e('0x2a')](handleError(_0x3fcbaa,null));};exports['create']=function(_0x3af23f,_0x1fd3a2){return db['OpenchannelMessage'][_0xb29e('0x50')](_0x3af23f[_0xb29e('0x51')],{})[_0xb29e('0x20')](respondWithResult(_0x1fd3a2,0xc9))[_0xb29e('0x2a')](handleError(_0x1fd3a2,null));};exports[_0xb29e('0x34')]=function(_0x456855,_0x41bada){if(_0x456855[_0xb29e('0x51')]['id']){delete _0x456855['body']['id'];}return db[_0xb29e('0x38')][_0xb29e('0x52')]({'where':{'id':_0x456855[_0xb29e('0x53')]['id']}})[_0xb29e('0x20')](handleEntityNotFound(_0x41bada,null))[_0xb29e('0x20')](saveUpdates(_0x456855[_0xb29e('0x51')],null))['then'](respondWithResult(_0x41bada,null))['catch'](handleError(_0x41bada,null));};exports[_0xb29e('0x54')]=function(_0x2304ac,_0x2beecf){return db[_0xb29e('0x38')][_0xb29e('0x52')]({'where':{'id':_0x2304ac[_0xb29e('0x53')]['id']}})[_0xb29e('0x20')](handleEntityNotFound(_0x2beecf,null))[_0xb29e('0x20')](removeEntity(_0x2beecf,null))[_0xb29e('0x2a')](handleError(_0x2beecf,null));};exports[_0xb29e('0x55')]=function(_0x151f51,_0xefe774){return db[_0xb29e('0x38')]['describe']()[_0xb29e('0x20')](respondWithResult(_0xefe774,null))[_0xb29e('0x2a')](handleError(_0xefe774,null));};var interaction_log=require(_0xb29e('0x56'))('openchannel-interactions');exports[_0xb29e('0x57')]=function(_0x83a403,_0x54d41a,_0x5f4ef3){var _0x205dcf={'agent':{},'channel':_0xb29e('0x58')};if(_0x83a403[_0xb29e('0x51')]['id']){delete _0x83a403[_0xb29e('0x51')]['id'];}_0x83a403[_0xb29e('0x51')][_0xb29e('0x59')]=!![];_0x83a403[_0xb29e('0x51')][_0xb29e('0x5a')]=moment()[_0xb29e('0x5b')](_0xb29e('0x5c'));_0x83a403[_0xb29e('0x51')]['UserId']=_0x83a403[_0xb29e('0x51')][_0xb29e('0x5d')]||_0x83a403[_0xb29e('0x5e')]['id'];_0x205dcf['agent']['id']=_0x83a403[_0xb29e('0x51')]['UserId'];return db['OpenchannelMessage'][_0xb29e('0x52')]({'where':{'id':_0x83a403['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x54d41a,null))['then'](saveUpdates(_0x83a403[_0xb29e('0x51')],null))[_0xb29e('0x20')](function(_0x319944){if(_0x319944){_0x205dcf[_0xb29e('0x28')]=_0x319944[_0xb29e('0x5f')]({'plain':!![]});return db[_0xb29e('0x60')]['find']({'where':{'id':_0x319944[_0xb29e('0x61')]}});}return null;})[_0xb29e('0x20')](handleEntityNotFound(_0x54d41a,null))[_0xb29e('0x20')](function(_0x49c75b){if(_0x49c75b){return _0x49c75b[_0xb29e('0x34')]({'UserId':_0x83a403['body']['UserId'],'read1stAt':_['isNil'](_0x49c75b[_0xb29e('0x62')])?moment()[_0xb29e('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb29e('0x20')](function(_0x2ea8e){if(_0x2ea8e){_0x205dcf[_0xb29e('0x63')]=_0x2ea8e[_0xb29e('0x5f')]({'plain':!![]});interaction_log[_0xb29e('0x21')](_0xb29e('0x64'),_0x83a403[_0xb29e('0x5e')]['id'],_0x83a403['user'][_0xb29e('0x36')],_0x83a403[_0xb29e('0x5e')]['role'],_0x205dcf[_0xb29e('0x63')]['id'],_0x83a403[_0xb29e('0x51')]?JSON[_0xb29e('0x26')](_0x83a403[_0xb29e('0x51')]):'null');return respondWithRpcPromise(_0xb29e('0x65'),_0xb29e('0x66'),_0x205dcf);}return null;})[_0xb29e('0x20')](function(_0x2a971e){var _0x3ac6d6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a971e['message'][_0xb29e('0x67')];return db[_0xb29e('0x68')][_0xb29e('0x3c')](_0x3ac6d6,{'type':db[_0xb29e('0x69')][_0xb29e('0x6a')][_0xb29e('0x6b')],'raw':!![]})[_0xb29e('0x20')](function(_0x5429a1){return _0x5429a1;});})['then'](function(_0x5b694a){if(_0x5b694a){_0x205dcf[_0xb29e('0x28')][_0xb29e('0x6c')]=_0x5b694a[0x0];if(!_0x83a403[_0xb29e('0x51')]['UserId'])return;return db['User'][_0xb29e('0x52')]({'where':{'id':_0x83a403['body'][_0xb29e('0x5d')],'role':'agent'},'attributes':['id',_0xb29e('0x36'),_0xb29e('0x6d'),'email',_0xb29e('0x6e')],'raw':!![]});}return null;})[_0xb29e('0x20')](function(_0x17fd3c){if(!_0x17fd3c)return null;_0x205dcf['message'][_0xb29e('0x6f')]=_0x17fd3c;return _0x205dcf;})['then'](function(_0x2ff5dc){if(_0x2ff5dc){if(_0x83a403['body'][_0xb29e('0x70')]){_0x205dcf['message'][_0xb29e('0x71')]=util[_0xb29e('0x5b')](_0xb29e('0x72'),_0x83a403[_0xb29e('0x5e')][_0xb29e('0x36')]);_0x205dcf[_0xb29e('0x28')][_0xb29e('0x73')]=_0x205dcf[_0xb29e('0x73')];_0x205dcf[_0xb29e('0x28')][_0xb29e('0x74')]=_0x205dcf['channel'];_0x205dcf[_0xb29e('0x28')]['event']=_0xb29e('0x57');return respondWithRpcPromise(_0xb29e('0x75'),'EventManager',{'event':'acceptmessage','message':_0x205dcf['message']},client9002)[_0xb29e('0x20')](function(){return _0x205dcf;});}return _0x205dcf;}return null;})[_0xb29e('0x20')](respondWithResult(_0x54d41a,null))[_0xb29e('0x2a')](handleError(_0x54d41a,null));};var interaction_log=require(_0xb29e('0x56'))(_0xb29e('0x76'));exports[_0xb29e('0x77')]=function(_0x150537,_0x22287f,_0x5b88ad){var _0x4cfc27={'agent':{},'channel':'openchannel'};if(_0x150537[_0xb29e('0x51')]['id']){delete _0x150537['body']['id'];}_0x150537[_0xb29e('0x51')][_0xb29e('0x5d')]=_0x150537[_0xb29e('0x51')][_0xb29e('0x5d')]||_0x150537[_0xb29e('0x5e')]['id'];_0x4cfc27[_0xb29e('0x6f')]['id']=_0x150537[_0xb29e('0x51')][_0xb29e('0x5d')];return db[_0xb29e('0x38')]['find']({'where':{'id':_0x150537[_0xb29e('0x53')]['id'],'UserId':null}})[_0xb29e('0x20')](handleEntityNotFound(_0x22287f,null))[_0xb29e('0x20')](function(_0x46725b){if(_0x46725b){_0x4cfc27[_0xb29e('0x28')]=_0x46725b[_0xb29e('0x5f')]({'plain':!![]});return db[_0xb29e('0x60')][_0xb29e('0x52')]({'where':{'id':_0x46725b[_0xb29e('0x61')]}});}return null;})[_0xb29e('0x20')](handleEntityNotFound(_0x22287f,null))[_0xb29e('0x20')](function(_0x4a211c){if(_0x4a211c){_0x4cfc27[_0xb29e('0x63')]=_0x4a211c['get']({'plain':!![]});interaction_log[_0xb29e('0x21')](_0xb29e('0x78'),_0x150537[_0xb29e('0x5e')]['id'],_0x150537[_0xb29e('0x5e')]['name'],_0x150537['user'][_0xb29e('0x79')],_0x4cfc27['interaction']['id'],_0x150537[_0xb29e('0x51')]?JSON[_0xb29e('0x26')](_0x150537[_0xb29e('0x51')]):'null');return respondWithRpcPromise(_0xb29e('0x7a'),'rejectMessage',_0x4cfc27);}return null;})[_0xb29e('0x20')](function(_0x730d0b){var _0x12319b=_0xb29e('0x7b')+_0x730d0b[_0xb29e('0x28')][_0xb29e('0x67')];return db[_0xb29e('0x68')][_0xb29e('0x3c')](_0x12319b,{'type':db[_0xb29e('0x69')][_0xb29e('0x6a')][_0xb29e('0x6b')],'raw':!![]})[_0xb29e('0x20')](function(_0x2f50ca){return _0x2f50ca;});})[_0xb29e('0x20')](function(_0x6db12d){if(_0x6db12d){_0x4cfc27[_0xb29e('0x28')][_0xb29e('0x6c')]=_0x6db12d[0x0];if(!_0x150537['body'][_0xb29e('0x5d')])return;return db[_0xb29e('0x7c')][_0xb29e('0x52')]({'where':{'id':_0x150537[_0xb29e('0x51')][_0xb29e('0x5d')],'role':_0xb29e('0x6f')},'attributes':['id',_0xb29e('0x36'),_0xb29e('0x6d'),_0xb29e('0x7d'),_0xb29e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x204115){if(!_0x204115)return null;_0x4cfc27[_0xb29e('0x28')][_0xb29e('0x6f')]=_0x204115;return _0x4cfc27;})['then'](function(_0x2e714b){if(_0x2e714b){_0x2e714b[_0xb29e('0x28')][_0xb29e('0x71')]=util['format'](_0xb29e('0x72'),_0x150537['user'][_0xb29e('0x36')]);_0x2e714b['message'][_0xb29e('0x73')]=_0x4cfc27[_0xb29e('0x73')];_0x2e714b[_0xb29e('0x28')][_0xb29e('0x74')]=_0x4cfc27[_0xb29e('0x73')];_0x2e714b[_0xb29e('0x28')]['event']=_0xb29e('0x77');respondWithRpcPromise('EventManager','EventManager',{'event':_0xb29e('0x7e'),'message':_0x2e714b[_0xb29e('0x28')]},client9002);return _0x4cfc27;}return null;})[_0xb29e('0x20')](respondWithResult(_0x22287f,null))[_0xb29e('0x2a')](handleError(_0x22287f,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 77662a9..6c66254 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 _0xd9bc=['OpenchannelMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x32ca29,_0x3308c8){var _0x4aab90=function(_0x1147e6){while(--_0x1147e6){_0x32ca29['push'](_0x32ca29['shift']());}};_0x4aab90(++_0x3308c8);}(_0xd9bc,0xe4));var _0xcd9b=function(_0x4f48d4,_0x3300c5){_0x4f48d4=_0x4f48d4-0x0;var _0x5a2989=_0xd9bc[_0x4f48d4];return _0x5a2989;};'use strict';var EventEmitter=require(_0xcd9b('0x0'));var OpenchannelMessage=require(_0xcd9b('0x1'))['db'][_0xcd9b('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xcd9b('0x3')](0x0);var events={'afterCreate':_0xcd9b('0x4'),'afterUpdate':_0xcd9b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1256b6){return function(_0x5654e2,_0x4ecc85,_0x45b3ab){OpenchannelMessageEvents[_0xcd9b('0x6')](_0x1256b6+':'+_0x5654e2['id'],_0x5654e2);OpenchannelMessageEvents['emit'](_0x1256b6,_0x5654e2);_0x45b3ab(null);};}for(var e in events){if(events[_0xcd9b('0x7')](e)){var event=events[e];OpenchannelMessage[_0xcd9b('0x8')](e,emitEvent(event));}}module[_0xcd9b('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x2957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x161f59,_0x42e9ff){var _0x3ffa0e=function(_0x3aef14){while(--_0x3aef14){_0x161f59['push'](_0x161f59['shift']());}};_0x3ffa0e(++_0x42e9ff);}(_0x2957,0x142));var _0x7295=function(_0x97e94d,_0x9f1c0a){_0x97e94d=_0x97e94d-0x0;var _0x1e5572=_0x2957[_0x97e94d];return _0x1e5572;};'use strict';var EventEmitter=require(_0x7295('0x0'));var OpenchannelMessage=require(_0x7295('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x7295('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7295('0x3'),'afterDestroy':_0x7295('0x4')};function emitEvent(_0x1f5979){return function(_0x32dd88,_0x1bb936,_0x589373){OpenchannelMessageEvents[_0x7295('0x5')](_0x1f5979+':'+_0x32dd88['id'],_0x32dd88);OpenchannelMessageEvents['emit'](_0x1f5979,_0x32dd88);_0x589373(null);};}for(var e in events){if(events[_0x7295('0x6')](e)){var event=events[e];OpenchannelMessage[_0x7295('0x7')](e,emitEvent(event));}}module[_0x7295('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 8ba8653..da24e6d 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 _0x2adb=['info','format','Forwarding\x20message\x20%d\x20to\x20%s','omit','method','GET','POST','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','error','afterCreate','inspect','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','CmContact','describe','find','OpenchannelInteraction','Interactions','Contact','keys','replyUri'];(function(_0x5c82c0,_0x3668aa){var _0x1fc3d9=function(_0x40ee4e){while(--_0x40ee4e){_0x5c82c0['push'](_0x5c82c0['shift']());}};_0x1fc3d9(++_0x3668aa);}(_0x2adb,0x103));var _0xb2ad=function(_0x4df86c,_0x1cc313){_0x4df86c=_0x4df86c-0x0;var _0x2283d4=_0x2adb[_0x4df86c];return _0x2283d4;};'use strict';var _=require(_0xb2ad('0x0'));var util=require(_0xb2ad('0x1'));var logger=require(_0xb2ad('0x2'))('api');var moment=require(_0xb2ad('0x3'));var BPromise=require('bluebird');var rp=require(_0xb2ad('0x4'));var fs=require('fs');var path=require(_0xb2ad('0x5'));var rimraf=require(_0xb2ad('0x6'));var config=require(_0xb2ad('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0xb2ad('0x8')]=function(_0x19362,_0x3b9dcf){return _0x19362[_0xb2ad('0x9')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xb2ad('0xa'),'fields':[_0xb2ad('0xb')],'type':_0xb2ad('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c8062,_0x37a213,_0x5ecc4e){var _0x48cd80=_0x19362[_0xb2ad('0xd')];var _0x4546aa=_0x4c8062[_0xb2ad('0xe')]({'plain':!![]});if(_0x4546aa[_0xb2ad('0xf')][_0xb2ad('0x10')]()==='in'||_0x4546aa[_0xb2ad('0xf')][_0xb2ad('0x10')]()===_0xb2ad('0x11')&&!_0x4546aa[_0xb2ad('0x12')]&&!_[_0xb2ad('0x13')](_0x4546aa[_0xb2ad('0x14')])){_0x48cd80['OpenchannelInteraction'][_0xb2ad('0x15')]({'where':{'id':_0x4546aa[_0xb2ad('0x16')]}})[_0xb2ad('0x17')](function(_0x548074){if(_0x548074){_0x548074[_0xb2ad('0x18')]({'lastMsgAt':_0x4546aa[_0xb2ad('0x19')],'lastMsgDirection':_0x4546aa[_0xb2ad('0xf')][_0xb2ad('0x10')]()});}})[_0xb2ad('0x1a')](function(_0x262a2d){console['error'](_0x262a2d);});}if(_0x4546aa[_0xb2ad('0xf')]===_0xb2ad('0x11')&&!_0x4546aa[_0xb2ad('0x12')]){var _0x4a940d;_0x48cd80[_0xb2ad('0x1b')][_0xb2ad('0x1c')]()[_0xb2ad('0x17')](function(_0x2a13c1){return _0x48cd80['OpenchannelAccount'][_0xb2ad('0x1d')]({'where':{'id':_0x4546aa['OpenchannelAccountId']},'include':[{'model':_0x48cd80[_0xb2ad('0x1e')],'as':_0xb2ad('0x1f'),'where':{'id':_0x4546aa['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x48cd80[_0xb2ad('0x1b')],'as':_0xb2ad('0x20'),'attributes':_[_0xb2ad('0x21')](_0x2a13c1)}]}]});})[_0xb2ad('0x17')](function(_0x4b1713){_0x4a940d=_0x4b1713[_0xb2ad('0xe')]({'plain':!![]});if(_0x4a940d&&_0x4a940d[_0xb2ad('0x22')]){logger[_0xb2ad('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xb2ad('0x24')](_0xb2ad('0x25'),_0x4546aa['id'],_0x4a940d[_0xb2ad('0x22')]));if(_0x4a940d['Interactions']&&_0x4a940d['Interactions']['length']){_0x4546aa['Interaction']=_[_0xb2ad('0x26')](_0x4a940d[_0xb2ad('0x1f')][0x0],_0xb2ad('0x20'));_0x4546aa[_0xb2ad('0x20')]=_0x4a940d['Interactions'][0x0][_0xb2ad('0x20')];}var _0x37a213={'method':'POST','uri':encodeURI(_0x4a940d[_0xb2ad('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x37a213[_0xb2ad('0x27')]){case _0xb2ad('0x28'):_0x37a213['qs']=_0x4546aa;break;case _0xb2ad('0x29'):_0x37a213['body']=_0x4546aa;break;}return rp(_0x37a213)[_0xb2ad('0x17')](function(_0x1d9859){logger['info'](_0xb2ad('0x2a'),'afterCreate',util[_0xb2ad('0x24')](_0xb2ad('0x2b'),_0x4546aa['id'],_0x4a940d[_0xb2ad('0x22')]));if(_0x1d9859[_0xb2ad('0xb')][_0xb2ad('0x2c')]&&_0x1d9859[_0xb2ad('0xb')][_0xb2ad('0x2c')]!=_0x4546aa[_0xb2ad('0x2d')]['threadId']){return _0x48cd80[_0xb2ad('0x1e')][_0xb2ad('0x18')]({'threadId':_0x1d9859['body']['threadId']},{'where':{'id':_0x4546aa[_0xb2ad('0x2d')]['id']}});}else{return;}})[_0xb2ad('0x17')](function(){return _0x4c8062[_0xb2ad('0x18')]({'read':!![]});})[_0xb2ad('0x1a')](function(_0x503ae){logger[_0xb2ad('0x2e')](_0xb2ad('0x2a'),_0xb2ad('0x2f'),util[_0xb2ad('0x30')](_0x503ae,{'showHidden':![],'depth':null}));_0x5ecc4e();});}else{_0x5ecc4e();}})['finally'](function(){_0x5ecc4e();});}else{_0x5ecc4e();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xfa05=['format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','GET','body','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','catch','CmContact','describe','OpenchannelAccount','find','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate'];(function(_0x37ac2a,_0x5e7536){var _0x586c61=function(_0x24ee6d){while(--_0x24ee6d){_0x37ac2a['push'](_0x37ac2a['shift']());}};_0x586c61(++_0x5e7536);}(_0xfa05,0x7a));var _0x5fa0=function(_0x4e4b7b,_0x56d148){_0x4e4b7b=_0x4e4b7b-0x0;var _0x28d7cd=_0xfa05[_0x4e4b7b];return _0x28d7cd;};'use strict';var _=require(_0x5fa0('0x0'));var util=require('util');var logger=require(_0x5fa0('0x1'))(_0x5fa0('0x2'));var moment=require(_0x5fa0('0x3'));var BPromise=require(_0x5fa0('0x4'));var rp=require(_0x5fa0('0x5'));var fs=require('fs');var path=require(_0x5fa0('0x6'));var rimraf=require(_0x5fa0('0x7'));var config=require('../../config/environment');var attributes=require(_0x5fa0('0x8'));module[_0x5fa0('0x9')]=function(_0xc6a02b,_0xe3180){return _0xc6a02b[_0x5fa0('0xa')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':_0x5fa0('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xd5d58c,_0x5b90d9,_0x3d71a6){var _0x1edb0b=_0xc6a02b[_0x5fa0('0xc')];var _0x4fb926=_0xd5d58c[_0x5fa0('0xd')]({'plain':!![]});if(_0x4fb926[_0x5fa0('0xe')][_0x5fa0('0xf')]()==='in'||_0x4fb926[_0x5fa0('0xe')]['toLowerCase']()===_0x5fa0('0x10')&&!_0x4fb926[_0x5fa0('0x11')]&&!_[_0x5fa0('0x12')](_0x4fb926[_0x5fa0('0x13')])){_0x1edb0b[_0x5fa0('0x14')][_0x5fa0('0x15')]({'where':{'id':_0x4fb926[_0x5fa0('0x16')]}})[_0x5fa0('0x17')](function(_0x3e9e6a){if(_0x3e9e6a){_0x3e9e6a['update']({'lastMsgAt':_0x4fb926[_0x5fa0('0x18')],'lastMsgDirection':_0x4fb926[_0x5fa0('0xe')][_0x5fa0('0xf')]()});}})[_0x5fa0('0x19')](function(_0x50566d){console['error'](_0x50566d);});}if(_0x4fb926[_0x5fa0('0xe')]===_0x5fa0('0x10')&&!_0x4fb926[_0x5fa0('0x11')]){var _0x7fb3ea;_0x1edb0b[_0x5fa0('0x1a')][_0x5fa0('0x1b')]()[_0x5fa0('0x17')](function(_0x28f976){return _0x1edb0b[_0x5fa0('0x1c')][_0x5fa0('0x1d')]({'where':{'id':_0x4fb926['OpenchannelAccountId']},'include':[{'model':_0x1edb0b[_0x5fa0('0x14')],'as':_0x5fa0('0x1e'),'where':{'id':_0x4fb926[_0x5fa0('0x16')]},'limit':0x1,'include':[{'model':_0x1edb0b['CmContact'],'as':_0x5fa0('0x1f'),'attributes':_[_0x5fa0('0x20')](_0x28f976)}]}]});})[_0x5fa0('0x17')](function(_0x3c8058){_0x7fb3ea=_0x3c8058[_0x5fa0('0xd')]({'plain':!![]});if(_0x7fb3ea&&_0x7fb3ea[_0x5fa0('0x21')]){logger[_0x5fa0('0x22')](_0x5fa0('0x23'),_0x5fa0('0x24'),util[_0x5fa0('0x25')](_0x5fa0('0x26'),_0x4fb926['id'],_0x7fb3ea[_0x5fa0('0x21')]));if(_0x7fb3ea[_0x5fa0('0x1e')]&&_0x7fb3ea[_0x5fa0('0x1e')][_0x5fa0('0x27')]){_0x4fb926['Interaction']=_[_0x5fa0('0x28')](_0x7fb3ea[_0x5fa0('0x1e')][0x0],_0x5fa0('0x1f'));_0x4fb926[_0x5fa0('0x1f')]=_0x7fb3ea[_0x5fa0('0x1e')][0x0]['Contact'];}var _0x5b90d9={'method':_0x5fa0('0x29'),'uri':encodeURI(_0x7fb3ea[_0x5fa0('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5b90d9['method']){case _0x5fa0('0x2a'):_0x5b90d9['qs']=_0x4fb926;break;case _0x5fa0('0x29'):_0x5b90d9[_0x5fa0('0x2b')]=_0x4fb926;break;}return rp(_0x5b90d9)['then'](function(_0x109f89){logger[_0x5fa0('0x22')](_0x5fa0('0x23'),_0x5fa0('0x24'),util[_0x5fa0('0x25')](_0x5fa0('0x2c'),_0x4fb926['id'],_0x7fb3ea[_0x5fa0('0x21')]));if(_0x109f89['body'][_0x5fa0('0x2d')]&&_0x109f89[_0x5fa0('0x2b')]['threadId']!=_0x4fb926[_0x5fa0('0x2e')]['threadId']){return _0x1edb0b[_0x5fa0('0x14')][_0x5fa0('0x2f')]({'threadId':_0x109f89[_0x5fa0('0x2b')][_0x5fa0('0x2d')]},{'where':{'id':_0x4fb926[_0x5fa0('0x2e')]['id']}});}else{return;}})[_0x5fa0('0x17')](function(){return _0xd5d58c[_0x5fa0('0x2f')]({'read':!![]});})[_0x5fa0('0x19')](function(_0x4ca1c3){logger[_0x5fa0('0x30')](_0x5fa0('0x23'),'afterCreate',util[_0x5fa0('0x31')](_0x4ca1c3,{'showHidden':![],'depth':null}));_0x3d71a6();});}else{_0x3d71a6();}})[_0x5fa0('0x32')](function(){_0x3d71a6();});}else{_0x3d71a6();}}},'charset':_0x5fa0('0x33'),'collate':_0x5fa0('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 2666f45..b086abd 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 _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0xf18977,_0x87ecc4){var _0x360bb8=function(_0x58a178){while(--_0x58a178){_0xf18977['push'](_0xf18977['shift']());}};_0x360bb8(++_0x87ecc4);}(_0xdb28,0x106));var _0x8db2=function(_0x2c6794,_0x54cf82){_0x2c6794=_0x2c6794-0x0;var _0x5d7719=_0xdb28[_0x2c6794];return _0x5d7719;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x153dc7,_0x20d3a7){var _0x3bfb6a=function(_0x4efb03){while(--_0x4efb03){_0x153dc7['push'](_0x153dc7['shift']());}};_0x3bfb6a(++_0x20d3a7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1ce2f3,_0x344e68){_0x1ce2f3=_0x1ce2f3-0x0;var _0x2f61e3=_0x5f2f[_0x1ce2f3];return _0x2f61e3;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index c270b45..2e3080a 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 _0x6b4e=['removeListener','register','length','openchannelMessage:','save','emit'];(function(_0x4145ed,_0x1965e3){var _0x2294a6=function(_0x21c3bb){while(--_0x21c3bb){_0x4145ed['push'](_0x4145ed['shift']());}};_0x2294a6(++_0x1965e3);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x2aff56,_0x3ade94){_0x2aff56=_0x2aff56-0x0;var _0x2ffdce=_0x6b4e[_0x2aff56];return _0x2ffdce;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xe6b4('0x0'),'remove','update'];function createListener(_0x5c3328,_0x54da12){return function(_0x4566e9){_0x54da12[_0xe6b4('0x1')](_0x5c3328,_0x4566e9);};}function removeListener(_0x1aedc5,_0x344db1){return function(){OpenchannelMessageEvents[_0xe6b4('0x2')](_0x1aedc5,_0x344db1);};}exports[_0xe6b4('0x3')]=function(_0x598f8c){for(var _0x29c81b=0x0,_0x3458d8=events[_0xe6b4('0x4')];_0x29c81b<_0x3458d8;_0x29c81b++){var _0x1d062b=events[_0x29c81b];var _0x15cf31=createListener(_0xe6b4('0x5')+_0x1d062b,_0x598f8c);OpenchannelMessageEvents['on'](_0x1d062b,_0x15cf31);}}; \ No newline at end of file +var _0x76fd=['remove','update','emit','register','length','openchannelMessage:','./openchannelMessage.events','save'];(function(_0x48b912,_0x4c07ad){var _0x2fc7f1=function(_0x4b9506){while(--_0x4b9506){_0x48b912['push'](_0x48b912['shift']());}};_0x2fc7f1(++_0x4c07ad);}(_0x76fd,0x186));var _0xd76f=function(_0x430d00,_0x46485c){_0x430d00=_0x430d00-0x0;var _0x37774b=_0x76fd[_0x430d00];return _0x37774b;};'use strict';var OpenchannelMessageEvents=require(_0xd76f('0x0'));var events=[_0xd76f('0x1'),_0xd76f('0x2'),_0xd76f('0x3')];function createListener(_0x4b03c2,_0x4917ff){return function(_0x1d76d9){_0x4917ff[_0xd76f('0x4')](_0x4b03c2,_0x1d76d9);};}function removeListener(_0x365cf3,_0x469df9){return function(){OpenchannelMessageEvents['removeListener'](_0x365cf3,_0x469df9);};}exports[_0xd76f('0x5')]=function(_0x2b8988){for(var _0x31ac4c=0x0,_0x5a00e7=events[_0xd76f('0x6')];_0x31ac4c<_0x5a00e7;_0x31ac4c++){var _0x1efbf2=events[_0x31ac4c];var _0x20e412=createListener(_0xd76f('0x7')+_0x1efbf2,_0x2b8988);OpenchannelMessageEvents['on'](_0x1efbf2,_0x20e412);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 4cc5f46..7c96b14 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 _0x4369=['getAgents','addTeams','post','addAgents','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x265006,_0x3425b0){var _0x5923c3=function(_0x1138c2){while(--_0x1138c2){_0x265006['push'](_0x265006['shift']());}};_0x5923c3(++_0x3425b0);}(_0x4369,0xab));var _0x9436=function(_0x214266,_0x1f6f52){_0x214266=_0x214266-0x0;var _0x568f75=_0x4369[_0x214266];return _0x568f75;};'use strict';var multer=require(_0x9436('0x0'));var util=require(_0x9436('0x1'));var path=require(_0x9436('0x2'));var timeout=require(_0x9436('0x3'));var express=require(_0x9436('0x4'));var router=express[_0x9436('0x5')]();var fs_extra=require(_0x9436('0x6'));var auth=require(_0x9436('0x7'));var interaction=require(_0x9436('0x8'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x9436('0x9')]('/',auth[_0x9436('0xa')](),controller[_0x9436('0xb')]);router[_0x9436('0x9')]('/describe',auth[_0x9436('0xa')](),controller['describe']);router[_0x9436('0x9')](_0x9436('0xc'),auth[_0x9436('0xa')](),controller[_0x9436('0xd')]);router['get'](_0x9436('0xe'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x9436('0xf'),auth['isAuthenticated'](),controller[_0x9436('0x10')]);router['get'](_0x9436('0x11'),auth[_0x9436('0xa')](),controller[_0x9436('0x12')]);router['post']('/',auth[_0x9436('0xa')](),controller['create']);router['post'](_0x9436('0xf'),auth['isAuthenticated'](),controller[_0x9436('0x13')]);router[_0x9436('0x14')](_0x9436('0x11'),auth['isAuthenticated'](),controller[_0x9436('0x15')]);router['put'](_0x9436('0xc'),auth[_0x9436('0xa')](),controller[_0x9436('0x16')]);router[_0x9436('0x17')](_0x9436('0xc'),auth['isAuthenticated'](),controller[_0x9436('0x18')]);router[_0x9436('0x17')](_0x9436('0xf'),auth['isAuthenticated'](),controller[_0x9436('0x19')]);router[_0x9436('0x17')]('/:id/users',auth[_0x9436('0xa')](),controller[_0x9436('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xc05e=['post','addAgents','update','delete','destroy','removeTeams','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc05e,0x1b6));var _0xec05=function(_0x130e6c,_0x586e5c){_0x130e6c=_0x130e6c-0x0;var _0x356d32=_0xc05e[_0x130e6c];return _0x356d32;};'use strict';var multer=require(_0xec05('0x0'));var util=require(_0xec05('0x1'));var path=require(_0xec05('0x2'));var timeout=require('connect-timeout');var express=require(_0xec05('0x3'));var router=express['Router']();var fs_extra=require(_0xec05('0x4'));var auth=require(_0xec05('0x5'));var interaction=require(_0xec05('0x6'));var config=require('../../config/environment');var controller=require(_0xec05('0x7'));router[_0xec05('0x8')]('/',auth[_0xec05('0x9')](),controller[_0xec05('0xa')]);router['get'](_0xec05('0xb'),auth['isAuthenticated'](),controller[_0xec05('0xc')]);router[_0xec05('0x8')](_0xec05('0xd'),auth[_0xec05('0x9')](),controller['show']);router['get'](_0xec05('0xe'),auth[_0xec05('0x9')](),controller['getMembers']);router['get'](_0xec05('0xf'),auth['isAuthenticated'](),controller[_0xec05('0x10')]);router[_0xec05('0x8')](_0xec05('0x11'),auth[_0xec05('0x9')](),controller['getAgents']);router[_0xec05('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xec05('0x12')](_0xec05('0xf'),auth['isAuthenticated'](),controller['addTeams']);router[_0xec05('0x12')](_0xec05('0x11'),auth[_0xec05('0x9')](),controller[_0xec05('0x13')]);router['put']('/:id',auth[_0xec05('0x9')](),controller[_0xec05('0x14')]);router[_0xec05('0x15')](_0xec05('0xd'),auth['isAuthenticated'](),controller[_0xec05('0x16')]);router['delete'](_0xec05('0xf'),auth[_0xec05('0x9')](),controller[_0xec05('0x17')]);router[_0xec05('0x15')](_0xec05('0x11'),auth[_0xec05('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 2eef9be..a2cd350 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 _0xbb35=['INTEGER','ENUM','rrmemory','STRING','name'];(function(_0x28e926,_0xbafb8a){var _0x59335c=function(_0x81a596){while(--_0x81a596){_0x28e926['push'](_0x28e926['shift']());}};_0x59335c(++_0xbafb8a);}(_0xbb35,0x18e));var _0x5bb3=function(_0x19d7d9,_0x315d19){_0x19d7d9=_0x19d7d9-0x0;var _0x51d5df=_0xbb35[_0x19d7d9];return _0x51d5df;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5bb3('0x0')],'unique':_0x5bb3('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5bb3('0x0')]},'timeout':{'type':Sequelize[_0x5bb3('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5bb3('0x3')](_0x5bb3('0x4'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x29c0=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0x29c0,0xb5));var _0x029c=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x29c0[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x029c('0x0'));module[_0x029c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x029c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x029c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x029c('0x4')](_0x029c('0x5'),_0x029c('0x6'),_0x029c('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 73cac68..d229a38 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 _0x8010=['findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','includes','all','union','value','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','intersection','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','filters','attributes','fields','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','findOne','hasOwnProperty','order','sort','pick','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','filter','options','getTeams','nolimit','addTeams','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x8010,0x18f));var _0x0801=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8010[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x0801('0x0'));var util=require(_0x0801('0x1'));var _=require(_0x0801('0x2'));var squel=require(_0x0801('0x3'));var Redis=require('ioredis');var qs=require(_0x0801('0x4'));var logger=require(_0x0801('0x5'))(_0x0801('0x6'));var config=require(_0x0801('0x7'));var db=require(_0x0801('0x8'))['db'];config['redis']=_[_0x0801('0x9')](config[_0x0801('0xa')],{'host':_0x0801('0xb'),'port':0x18eb});var socket=require(_0x0801('0xc'))(new Redis(config['redis']));require(_0x0801('0xd'))[_0x0801('0xe')](socket);function respondWithStatusCode(_0x57d88c,_0x4e4604){_0x4e4604=_0x4e4604||0xcc;return function(_0x313c50){if(_0x313c50){return _0x57d88c[_0x0801('0xf')](_0x4e4604);}return _0x57d88c['status'](_0x4e4604)[_0x0801('0x10')]();};}function respondWithResult(_0x12e326,_0x478b0a){_0x478b0a=_0x478b0a||0xc8;return function(_0x55a5bf){if(_0x55a5bf){return _0x12e326[_0x0801('0x11')](_0x478b0a)[_0x0801('0x12')](_0x55a5bf);}};}function respondWithFilteredResult(_0x89f5e4,_0x546eaf){return function(_0x5bcfb2){if(_0x5bcfb2){var _0x3bb65a=typeof _0x546eaf['offset']===_0x0801('0x13')&&typeof _0x546eaf[_0x0801('0x14')]===_0x0801('0x13');var _0x21cfdf=_0x5bcfb2[_0x0801('0x15')];var _0xbdb9fe=_0x3bb65a?0x0:_0x546eaf['offset'];var _0x38c58d=_0x3bb65a?_0x5bcfb2['count']:_0x546eaf[_0x0801('0x16')]+_0x546eaf[_0x0801('0x14')];var _0x3e4ade;if(_0x38c58d>=_0x21cfdf){_0x38c58d=_0x21cfdf;_0x3e4ade=0xc8;}else{_0x3e4ade=0xce;}_0x89f5e4[_0x0801('0x11')](_0x3e4ade);return _0x89f5e4[_0x0801('0x17')](_0x0801('0x18'),_0xbdb9fe+'-'+_0x38c58d+'/'+_0x21cfdf)[_0x0801('0x12')](_0x5bcfb2);}return null;};}function saveUpdates(_0x4ec9c8){return function(_0x202424){if(_0x202424){return _0x202424[_0x0801('0x19')](_0x4ec9c8)[_0x0801('0x1a')](function(_0x3c4ebd){return _0x3c4ebd;});}return null;};}function removeEntity(_0x5714c9){return function(_0x243d94){if(_0x243d94){return _0x243d94[_0x0801('0x1b')]()['then'](function(){var _0x38b3fc=_0x243d94[_0x0801('0x1c')]({'plain':!![]});var _0x43eb40=_0x0801('0x1d');return db[_0x0801('0x1e')]['destroy']({'where':{'type':_0x43eb40,'resourceId':_0x38b3fc['id']}})['then'](function(){return _0x243d94;});})[_0x0801('0x1a')](function(){_0x5714c9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26e961){return function(_0x506dfd){if(!_0x506dfd){_0x26e961[_0x0801('0xf')](0x194);}return _0x506dfd;};}function handleError(_0x42b18a,_0x2b676a){_0x2b676a=_0x2b676a||0x1f4;return function(_0x141696){logger[_0x0801('0x1f')](_0x141696[_0x0801('0x20')]);if(_0x141696[_0x0801('0x21')]){delete _0x141696[_0x0801('0x21')];}_0x42b18a[_0x0801('0x11')](_0x2b676a)['send'](_0x141696);};}exports[_0x0801('0x22')]=function(_0x329284,_0x3b0a80){var _0x375d1f={};var _0x1c1333={'count':0x0,'rows':[]};var _0x45dce2=_[_0x0801('0x23')](db[_0x0801('0x24')][_0x0801('0x25')],function(_0x24a6f9){return{'name':_0x24a6f9[_0x0801('0x26')],'type':_0x24a6f9['type'][_0x0801('0x27')]};});_0x375d1f=qs[_0x0801('0x28')](_0x45dce2,_0x329284);var _0x199ba2={'where':_0x375d1f[_0x0801('0x29')]};return db['OpenchannelQueue'][_0x0801('0x15')](_0x199ba2)[_0x0801('0x1a')](function(_0x47bfec){_0x1c1333['count']=_0x47bfec;_0x375d1f[_0x0801('0x2a')]=qs['include'](_0x329284[_0x0801('0x2b')]);return db[_0x0801('0x24')][_0x0801('0x2c')](_0x375d1f);})[_0x0801('0x1a')](function(_0xf46b4){_0x1c1333[_0x0801('0x2d')]=_0xf46b4;return _0x1c1333;})[_0x0801('0x1a')](respondWithFilteredResult(_0x3b0a80,_0x375d1f))[_0x0801('0x2e')](handleError(_0x3b0a80,null));};exports[_0x0801('0x2f')]=function(_0x538f08,_0x55b7f1){var _0x161462={'raw':!![],'where':{'id':_0x538f08[_0x0801('0x30')]['id']}},_0x3225a9={};_0x3225a9[_0x0801('0x31')]=_[_0x0801('0x32')](db['OpenchannelQueue'][_0x0801('0x25')]);_0x3225a9['query']=_[_0x0801('0x32')](_0x538f08[_0x0801('0x2b')]);_0x3225a9[_0x0801('0x33')]=_['intersection'](_0x3225a9[_0x0801('0x31')],_0x3225a9[_0x0801('0x2b')]);_0x161462[_0x0801('0x34')]=_['intersection'](_0x3225a9[_0x0801('0x31')],qs[_0x0801('0x35')](_0x538f08[_0x0801('0x2b')][_0x0801('0x35')]));_0x161462[_0x0801('0x34')]=_0x161462[_0x0801('0x34')][_0x0801('0x36')]?_0x161462[_0x0801('0x34')]:_0x3225a9['model'];if(_0x538f08[_0x0801('0x2b')][_0x0801('0x37')]){_0x161462['include']=[{'all':!![]}];}_0x161462=_[_0x0801('0x38')]({},_0x161462,_0x538f08['options']);return db['OpenchannelQueue'][_0x0801('0x39')](_0x161462)[_0x0801('0x1a')](handleEntityNotFound(_0x55b7f1,null))[_0x0801('0x1a')](respondWithResult(_0x55b7f1,null))['catch'](handleError(_0x55b7f1,null));};exports[_0x0801('0x3a')]=function(_0x417b7c,_0x35f468){return db[_0x0801('0x24')][_0x0801('0x3a')](_0x417b7c[_0x0801('0x3b')],{})[_0x0801('0x1a')](function(_0x39ef2d){var _0x42ecaf=_0x417b7c[_0x0801('0x3c')][_0x0801('0x1c')]({'plain':!![]});if(!_0x42ecaf)throw new Error(_0x0801('0x3d'));if(_0x42ecaf['role']===_0x0801('0x3c')){var _0x4db7df=_0x39ef2d['get']({'plain':!![]});var _0x392acb=_0x0801('0x1d');return db[_0x0801('0x3e')][_0x0801('0x39')]({'where':{'name':_0x392acb,'userProfileId':_0x42ecaf[_0x0801('0x3f')]},'raw':!![]})[_0x0801('0x1a')](function(_0x197c84){if(_0x197c84&&_0x197c84[_0x0801('0x40')]===0x0){return db[_0x0801('0x1e')][_0x0801('0x3a')]({'name':_0x4db7df[_0x0801('0x21')],'resourceId':_0x4db7df['id'],'type':_0x197c84['name'],'sectionId':_0x197c84['id']},{})['then'](function(){return _0x39ef2d;});}else{return _0x39ef2d;}})['catch'](function(_0x391734){logger[_0x0801('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x391734);throw _0x391734;});}return _0x39ef2d;})[_0x0801('0x1a')](respondWithResult(_0x35f468,0xc9))[_0x0801('0x2e')](handleError(_0x35f468,null));};exports[_0x0801('0x19')]=function(_0x4b9782,_0x368c71){if(_0x4b9782['body']['id']){delete _0x4b9782[_0x0801('0x3b')]['id'];}return db[_0x0801('0x24')][_0x0801('0x39')]({'where':{'id':_0x4b9782['params']['id']}})[_0x0801('0x1a')](handleEntityNotFound(_0x368c71,null))[_0x0801('0x1a')](saveUpdates(_0x4b9782['body'],null))[_0x0801('0x1a')](respondWithResult(_0x368c71,null))[_0x0801('0x2e')](handleError(_0x368c71,null));};exports[_0x0801('0x1b')]=function(_0xdca28a,_0x722cc0){return db[_0x0801('0x24')][_0x0801('0x39')]({'where':{'id':_0xdca28a[_0x0801('0x30')]['id']}})['then'](handleEntityNotFound(_0x722cc0,null))[_0x0801('0x1a')](removeEntity(_0x722cc0,null))[_0x0801('0x2e')](handleError(_0x722cc0,null));};exports[_0x0801('0x41')]=function(_0x1b6f2c,_0x5869bc){return db[_0x0801('0x24')][_0x0801('0x41')]()['then'](respondWithResult(_0x5869bc,null))[_0x0801('0x2e')](handleError(_0x5869bc,null));};exports['getMembers']=function(_0x47db92,_0xf38fb6){var _0x1d0122={'raw':!![],'where':{}},_0x50d870={},_0x54c556;return db['OpenchannelQueue'][_0x0801('0x42')]({'where':{'id':_0x47db92[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](handleEntityNotFound(_0xf38fb6,null))[_0x0801('0x1a')](function(_0x2ea92d){if(_0x2ea92d){_0x54c556=_0x2ea92d['get']({'plain':!![]});_0x50d870[_0x0801('0x31')]=_['keys'](db['UserOpenchannelQueue'][_0x0801('0x25')]);_0x50d870[_0x0801('0x2b')]=_[_0x0801('0x32')](_0x47db92[_0x0801('0x2b')]);_0x50d870[_0x0801('0x33')]=_['intersection'](_0x50d870[_0x0801('0x31')],_0x50d870[_0x0801('0x2b')]);_0x1d0122[_0x0801('0x34')]=_['intersection'](_0x50d870[_0x0801('0x31')],qs[_0x0801('0x35')](_0x47db92[_0x0801('0x2b')]['fields']));_0x1d0122['attributes']=_0x1d0122[_0x0801('0x34')][_0x0801('0x36')]?_0x1d0122[_0x0801('0x34')]:_0x50d870[_0x0801('0x31')];if(!_0x47db92[_0x0801('0x2b')][_0x0801('0x43')]('nolimit')){_0x1d0122[_0x0801('0x14')]=qs['limit'](_0x47db92[_0x0801('0x2b')]['limit']);_0x1d0122['offset']=qs[_0x0801('0x16')](_0x47db92[_0x0801('0x2b')][_0x0801('0x16')]);}_0x1d0122[_0x0801('0x44')]=qs[_0x0801('0x45')](_0x47db92[_0x0801('0x2b')]['sort']);_0x1d0122[_0x0801('0x29')]=qs[_0x0801('0x33')](_[_0x0801('0x46')](_0x47db92['query'],_0x50d870['filters']));_0x1d0122[_0x0801('0x29')][_0x0801('0x47')]=_0x2ea92d['id'];if(_0x47db92[_0x0801('0x2b')]['filter']){_0x1d0122[_0x0801('0x29')]=_[_0x0801('0x38')](_0x1d0122[_0x0801('0x29')],{'$or':_['map'](_0x1d0122[_0x0801('0x34')],function(_0xef10d3){var _0x14d1fb={};_0x14d1fb[_0xef10d3]={'$like':'%'+_0x47db92[_0x0801('0x2b')]['filter']+'%'};return _0x14d1fb;})});}_0x1d0122=_[_0x0801('0x38')]({},_0x1d0122,_0x47db92['options']);return db[_0x0801('0x48')][_0x0801('0x2c')](_0x1d0122);}})[_0x0801('0x1a')](function(_0x468da0){if(_0x468da0){return db[_0x0801('0x49')][_0x0801('0x4a')]({'where':{'id':_[_0x0801('0x23')](_0x468da0,_0x0801('0x4b')),'role':_0x0801('0x4c')},'attributes':['id',_0x0801('0x21'),_0x0801('0x4d'),_0x0801('0x4e'),_0x0801('0x4f')]});}})['then'](function(_0x450d4a){if(_0x450d4a){return{'count':_0x450d4a[_0x0801('0x15')],'rows':_[_0x0801('0x23')](_0x450d4a['rows'],function(_0x15b830){return{'membername':_0x15b830[_0x0801('0x21')],'UserId':_0x15b830['id'],'queue_name':_0x54c556[_0x0801('0x21')],'OpenchannelQueueId':_0x54c556['id'],'interface':util[_0x0801('0x50')](_0x0801('0x51'),_0x0801('0x52'),_0x15b830['name']),'penalty':0x0,'paused':_0x15b830[_0x0801('0x4d')],'createdAt':_0x15b830[_0x0801('0x4f')],'updatedAt':_0x15b830[_0x0801('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0801('0x1a')](respondWithFilteredResult(_0xf38fb6,_0x1d0122))['catch'](handleError(_0xf38fb6,null));};exports['getTeams']=function(_0x1045e9,_0x2e7d48){var _0x5dc97a={};var _0x419b4f={};var _0x39cc0b;var _0xe70823;return db[_0x0801('0x24')]['findOne']({'where':{'id':_0x1045e9[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](handleEntityNotFound(_0x2e7d48,null))[_0x0801('0x1a')](function(_0x56ef92){if(_0x56ef92){_0x39cc0b=_0x56ef92;_0x419b4f[_0x0801('0x31')]=_['keys'](db[_0x0801('0x53')][_0x0801('0x25')]);_0x419b4f[_0x0801('0x2b')]=_[_0x0801('0x32')](_0x1045e9[_0x0801('0x2b')]);_0x419b4f['filters']=_['intersection'](_0x419b4f[_0x0801('0x31')],_0x419b4f[_0x0801('0x2b')]);_0x5dc97a[_0x0801('0x34')]=_['intersection'](_0x419b4f[_0x0801('0x31')],qs[_0x0801('0x35')](_0x1045e9[_0x0801('0x2b')]['fields']));_0x5dc97a[_0x0801('0x34')]=_0x5dc97a[_0x0801('0x34')][_0x0801('0x36')]?_0x5dc97a['attributes']:_0x419b4f[_0x0801('0x31')];_0x5dc97a[_0x0801('0x44')]=qs['sort'](_0x1045e9['query'][_0x0801('0x45')]);_0x5dc97a[_0x0801('0x29')]=qs['filters'](_[_0x0801('0x46')](_0x1045e9['query'],_0x419b4f['filters']));if(_0x1045e9['query'][_0x0801('0x54')]){_0x5dc97a[_0x0801('0x29')]=_[_0x0801('0x38')](_0x5dc97a[_0x0801('0x29')],{'$or':_['map'](_0x5dc97a['attributes'],function(_0x352da0){var _0x415256={};_0x415256[_0x352da0]={'$like':'%'+_0x1045e9['query'][_0x0801('0x54')]+'%'};return _0x415256;})});}_0x5dc97a=_[_0x0801('0x38')]({},_0x5dc97a,_0x1045e9[_0x0801('0x55')]);return _0x39cc0b[_0x0801('0x56')](_0x5dc97a);}})[_0x0801('0x1a')](function(_0x650e5f){if(_0x650e5f){_0xe70823=_0x650e5f['length'];if(!_0x1045e9[_0x0801('0x2b')][_0x0801('0x43')](_0x0801('0x57'))){_0x5dc97a[_0x0801('0x14')]=qs['limit'](_0x1045e9['query'][_0x0801('0x14')]);_0x5dc97a[_0x0801('0x16')]=qs[_0x0801('0x16')](_0x1045e9['query']['offset']);}return _0x39cc0b[_0x0801('0x56')](_0x5dc97a);}})[_0x0801('0x1a')](function(_0x22a46a){if(_0x22a46a){return _0x22a46a?{'count':_0xe70823,'rows':_0x22a46a}:null;}})['then'](respondWithResult(_0x2e7d48,null))[_0x0801('0x2e')](handleError(_0x2e7d48,null));};exports[_0x0801('0x58')]=function(_0x3bdbba,_0x2c0b6b){var _0x3ea8b5=_0x3bdbba[_0x0801('0x3b')]['ids'];return db[_0x0801('0x53')][_0x0801('0x2c')]({'where':{'id':_0x3ea8b5},'attributes':['id'],'include':[{'model':db[_0x0801('0x49')],'as':'Agents','attributes':['id','name',_0x0801('0x59'),_0x0801('0x5a'),_0x0801('0x5b')],'raw':!![]}]})['then'](function(_0x174681){if(_0x174681){var _0x5f0507=_[_0x0801('0x5c')](_0x174681,function(_0x577e63){var _0x3bebaf=_0x577e63['get']({'plain':!![]});return _0x3bebaf[_0x0801('0x5d')];});return db[_0x0801('0x24')][_0x0801('0x39')]({'where':{'id':_0x3bdbba[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](function(_0xaf0d85){return db[_0x0801('0x5e')][_0x0801('0x5f')](function(_0x149b48){return _0xaf0d85['addTeams'](_0x3ea8b5,{'transaction':_0x149b48})[_0x0801('0x1a')](function(){return BPromise[_0x0801('0x60')](_0x5f0507,function(_0x5ed7b7){return db[_0x0801('0x48')][_0x0801('0x61')]({'where':{'UserId':_0x5ed7b7['id'],'OpenchannelQueueId':_0x3bdbba['params']['id']},'transaction':_0x149b48});});})['then'](function(){_0x5f0507[_0x0801('0x62')](function(_0x27607b){socket['emit'](_0x0801('0x63'),{'UserId':_0x27607b['id'],'OpenchannelQueueId':_0xaf0d85['id']});});});});});}})[_0x0801('0x1a')](respondWithStatusCode(_0x2c0b6b,null))[_0x0801('0x2e')](handleError(_0x2c0b6b,null));};exports[_0x0801('0x64')]=function(_0x19c503,_0x565bf5){return db[_0x0801('0x53')][_0x0801('0x2c')]({'where':{'id':_0x19c503['query'][_0x0801('0x65')]},'attributes':['id'],'include':[{'model':db[_0x0801('0x49')],'as':_0x0801('0x5d'),'attributes':['id'],'raw':!![]}]})[_0x0801('0x1a')](handleEntityNotFound(_0x565bf5,null))[_0x0801('0x1a')](function(_0x583a63){var _0x8eabb1=_['map'](_0x583a63,'id');var _0x1a06b1=[];var _0x5775bf=[];var _0x3e0e7d=squel[_0x0801('0x66')]();_0x3e0e7d[_0x0801('0x67')](_0x0801('0x68'))[_0x0801('0x69')]('team_has_openchannel_queues','tq')[_0x0801('0x6a')](_0x0801('0x6b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0801('0x29')](_0x0801('0x6c'),_0x19c503[_0x0801('0x30')]['id']);for(var _0x1ea495=0x0;_0x1ea495<_0x583a63[_0x0801('0x36')];_0x1ea495+=0x1){let _0x4912f9=_0x583a63[_0x1ea495];for(var _0x40baea=0x0;_0x40baea<_0x4912f9[_0x0801('0x5d')]['length'];_0x40baea+=0x1){let _0x541dc5=_0x4912f9['Agents'][_0x40baea];var _0x1a71f8=_0x3e0e7d[_0x0801('0x6d')]();_0x1a71f8['where'](_0x0801('0x6e'),_0x541dc5['id']);_0x5775bf['push'](db[_0x0801('0x5e')]['query'](_0x1a71f8[_0x0801('0x6f')](),{'type':db[_0x0801('0x5e')]['QueryTypes']['SELECT']})[_0x0801('0x1a')](function(_0x46a2e0){if(_0x46a2e0[_0x0801('0x36')]===0x1){return _0x541dc5['id'];}else{var _0x5bfa1b=_['every'](_[_0x0801('0x23')](_0x46a2e0,'TeamId'),function(_0x417230){return _[_0x0801('0x70')](_0x8eabb1,_0x417230);});if(_0x5bfa1b){return _0x541dc5['id'];}}}));}}return BPromise[_0x0801('0x71')](_0x5775bf)['then'](function(_0x4db23a){_0x1a06b1=_(_0x1a06b1)[_0x0801('0x72')](_0x4db23a)['compact']()[_0x0801('0x73')]();return db[_0x0801('0x24')][_0x0801('0x39')]({'where':{'id':_0x19c503[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](function(_0x133e6e){return db[_0x0801('0x5e')]['transaction'](function(_0x130523){return _0x133e6e[_0x0801('0x64')](_0x19c503[_0x0801('0x2b')]['ids'],{'transaction':_0x130523})[_0x0801('0x1a')](function(){if(!_['isEmpty'](_0x1a06b1)){return _0x133e6e[_0x0801('0x74')](_0x1a06b1,{'transaction':_0x130523});}})[_0x0801('0x1a')](function(){_0x1a06b1['forEach'](function(_0x2d646f){socket[_0x0801('0x75')](_0x0801('0x76'),{'UserId':_0x2d646f,'OpenchannelQueueId':_0x133e6e['id']});});});});});});})['then'](respondWithStatusCode(_0x565bf5,null))[_0x0801('0x2e')](handleError(_0x565bf5,null));};exports[_0x0801('0x77')]=function(_0x3a9b41,_0x2e32f9){return db[_0x0801('0x24')]['find']({'where':{'id':_0x3a9b41[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](handleEntityNotFound(_0x2e32f9,null))['then'](function(_0x4694cd){if(_0x4694cd){return _0x4694cd[_0x0801('0x77')](_0x3a9b41[_0x0801('0x3b')][_0x0801('0x65')],_[_0x0801('0x78')](_0x3a9b41[_0x0801('0x3b')],[_0x0801('0x65'),'id'])||{})[_0x0801('0x79')](function(_0x2ba9ff){for(var _0x2f5504=0x0;_0x2f5504<_0x3a9b41[_0x0801('0x3b')][_0x0801('0x65')][_0x0801('0x36')];_0x2f5504+=0x1){socket[_0x0801('0x75')]('userOpenchannelQueue:save',{'UserId':Number(_0x3a9b41[_0x0801('0x3b')][_0x0801('0x65')][_0x2f5504]),'OpenchannelQueueId':Number(_0x3a9b41['params']['id'])});}return _0x2ba9ff;});}})[_0x0801('0x1a')](respondWithResult(_0x2e32f9,null))['catch'](handleError(_0x2e32f9,null));};exports[_0x0801('0x74')]=function(_0x551bfe,_0x2258f5){return db[_0x0801('0x24')]['find']({'where':{'id':_0x551bfe[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](handleEntityNotFound(_0x2258f5,null))['then'](function(_0x42f525){if(_0x42f525){return _0x42f525[_0x0801('0x74')](_0x551bfe[_0x0801('0x2b')][_0x0801('0x65')])['then'](function(){if(_['isArray'](_0x551bfe['query'][_0x0801('0x65')])){for(var _0x31acab=0x0;_0x31acab<_0x551bfe[_0x0801('0x2b')][_0x0801('0x65')][_0x0801('0x36')];_0x31acab+=0x1){socket[_0x0801('0x75')](_0x0801('0x76'),{'UserId':Number(_0x551bfe[_0x0801('0x2b')][_0x0801('0x65')][_0x31acab]),'OpenchannelQueueId':Number(_0x551bfe[_0x0801('0x30')]['id'])});}}else{socket[_0x0801('0x75')]('userOpenchannelQueue:remove',{'UserId':Number(_0x551bfe[_0x0801('0x2b')]['ids']),'OpenchannelQueueId':Number(_0x551bfe[_0x0801('0x30')]['id'])});}});}})[_0x0801('0x1a')](respondWithStatusCode(_0x2258f5,null))['catch'](handleError(_0x2258f5,null));};exports['getAgents']=function(_0x2dedad,_0x51fb1f){var _0x5bccfe={};var _0x560963={};var _0x22e5c7;var _0x4859a4;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x2dedad[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](handleEntityNotFound(_0x51fb1f,null))[_0x0801('0x1a')](function(_0x67e5d5){if(_0x67e5d5){_0x22e5c7=_0x67e5d5;_0x560963[_0x0801('0x31')]=_[_0x0801('0x32')](db[_0x0801('0x49')][_0x0801('0x25')]);_0x560963[_0x0801('0x2b')]=_[_0x0801('0x32')](_0x2dedad[_0x0801('0x2b')]);_0x560963[_0x0801('0x33')]=_[_0x0801('0x7a')](_0x560963[_0x0801('0x31')],_0x560963['query']);_0x5bccfe[_0x0801('0x34')]=_['intersection'](_0x560963[_0x0801('0x31')],qs[_0x0801('0x35')](_0x2dedad[_0x0801('0x2b')][_0x0801('0x35')]));_0x5bccfe[_0x0801('0x34')]=_0x5bccfe['attributes'][_0x0801('0x36')]?_0x5bccfe['attributes']:_0x560963[_0x0801('0x31')];_0x5bccfe[_0x0801('0x44')]=qs['sort'](_0x2dedad['query']['sort']);_0x5bccfe[_0x0801('0x29')]=qs[_0x0801('0x33')](_['pick'](_0x2dedad[_0x0801('0x2b')],_0x560963[_0x0801('0x33')]));if(_0x2dedad[_0x0801('0x2b')]['filter']){_0x5bccfe[_0x0801('0x29')]=_[_0x0801('0x38')](_0x5bccfe[_0x0801('0x29')],{'$or':_['map'](_0x5bccfe[_0x0801('0x34')],function(_0x2fca73){var _0x2196b2={};_0x2196b2[_0x2fca73]={'$like':'%'+_0x2dedad[_0x0801('0x2b')][_0x0801('0x54')]+'%'};return _0x2196b2;})});}_0x5bccfe=_[_0x0801('0x38')]({},_0x5bccfe,_0x2dedad[_0x0801('0x55')]);return _0x22e5c7[_0x0801('0x7b')](_0x5bccfe);}})[_0x0801('0x1a')](function(_0x16a745){if(_0x16a745){_0x4859a4=_0x16a745[_0x0801('0x36')];if(!_0x2dedad['query'][_0x0801('0x43')](_0x0801('0x57'))){_0x5bccfe['limit']=qs[_0x0801('0x14')](_0x2dedad[_0x0801('0x2b')][_0x0801('0x14')]);_0x5bccfe['offset']=qs[_0x0801('0x16')](_0x2dedad['query'][_0x0801('0x16')]);}return _0x22e5c7[_0x0801('0x7b')](_0x5bccfe);}})['then'](function(_0x41026d){if(_0x41026d){return _0x41026d?{'count':_0x4859a4,'rows':_0x41026d}:null;}})['then'](respondWithResult(_0x51fb1f,null))[_0x0801('0x2e')](handleError(_0x51fb1f,null));}; \ No newline at end of file +var _0xf819=['findAll','rows','catch','show','model','keys','rawAttributes','intersection','attributes','fields','length','includeAll','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','params','describe','findOne','UserOpenchannelQueue','hasOwnProperty','sort','pick','OpenchannelQueueId','filter','options','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','order','filters','getTeams','nolimit','addTeams','ids','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','removeTeams','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','all','union','compact','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','getAgents','bluebird','util','lodash','../../config/environment','../../mysqldb','redis','localhost','./openchannelQueue.socket','json','offset','undefined','limit','count','Content-Range','update','then','destroy','OpenchannelQueues','status','end','sendStatus','error','stack','name','send','map','OpenchannelQueue','fieldName','type','key','getOptions','where','include','query'];(function(_0xc2b84,_0x415691){var _0x20de52=function(_0xcd5aa){while(--_0xcd5aa){_0xc2b84['push'](_0xc2b84['shift']());}};_0x20de52(++_0x415691);}(_0xf819,0x1a6));var _0x9f81=function(_0x9c8c83,_0x16ebdd){_0x9c8c83=_0x9c8c83-0x0;var _0x4636ac=_0xf819[_0x9c8c83];return _0x4636ac;};'use strict';var BPromise=require(_0x9f81('0x0'));var util=require(_0x9f81('0x1'));var _=require(_0x9f81('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x9f81('0x3'));var db=require(_0x9f81('0x4'))['db'];config[_0x9f81('0x5')]=_['defaults'](config[_0x9f81('0x5')],{'host':_0x9f81('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f81('0x5')]));require(_0x9f81('0x7'))['register'](socket);function respondWithStatusCode(_0x36566a,_0xc2dba1){_0xc2dba1=_0xc2dba1||0xcc;return function(_0x170ba6){if(_0x170ba6){return _0x36566a['sendStatus'](_0xc2dba1);}return _0x36566a['status'](_0xc2dba1)['end']();};}function respondWithResult(_0x17d024,_0x45fc3c){_0x45fc3c=_0x45fc3c||0xc8;return function(_0x4966ec){if(_0x4966ec){return _0x17d024['status'](_0x45fc3c)[_0x9f81('0x8')](_0x4966ec);}};}function respondWithFilteredResult(_0x4b43c1,_0xaa6a59){return function(_0x69d70a){if(_0x69d70a){var _0x4c6ea7=typeof _0xaa6a59[_0x9f81('0x9')]===_0x9f81('0xa')&&typeof _0xaa6a59[_0x9f81('0xb')]===_0x9f81('0xa');var _0x412de0=_0x69d70a[_0x9f81('0xc')];var _0x3d0d51=_0x4c6ea7?0x0:_0xaa6a59[_0x9f81('0x9')];var _0x1e3fad=_0x4c6ea7?_0x69d70a[_0x9f81('0xc')]:_0xaa6a59[_0x9f81('0x9')]+_0xaa6a59[_0x9f81('0xb')];var _0x582d23;if(_0x1e3fad>=_0x412de0){_0x1e3fad=_0x412de0;_0x582d23=0xc8;}else{_0x582d23=0xce;}_0x4b43c1['status'](_0x582d23);return _0x4b43c1['set'](_0x9f81('0xd'),_0x3d0d51+'-'+_0x1e3fad+'/'+_0x412de0)[_0x9f81('0x8')](_0x69d70a);}return null;};}function saveUpdates(_0x49df28){return function(_0x263812){if(_0x263812){return _0x263812[_0x9f81('0xe')](_0x49df28)[_0x9f81('0xf')](function(_0x574f83){return _0x574f83;});}return null;};}function removeEntity(_0x1fe830){return function(_0x4e178f){if(_0x4e178f){return _0x4e178f[_0x9f81('0x10')]()['then'](function(){var _0x1127ab=_0x4e178f['get']({'plain':!![]});var _0x34b9aa=_0x9f81('0x11');return db['UserProfileResource'][_0x9f81('0x10')]({'where':{'type':_0x34b9aa,'resourceId':_0x1127ab['id']}})[_0x9f81('0xf')](function(){return _0x4e178f;});})[_0x9f81('0xf')](function(){_0x1fe830[_0x9f81('0x12')](0xcc)[_0x9f81('0x13')]();});}};}function handleEntityNotFound(_0x18ed80){return function(_0x16bea1){if(!_0x16bea1){_0x18ed80[_0x9f81('0x14')](0x194);}return _0x16bea1;};}function handleError(_0xfa0e7b,_0x41ae4a){_0x41ae4a=_0x41ae4a||0x1f4;return function(_0x2afee1){logger[_0x9f81('0x15')](_0x2afee1[_0x9f81('0x16')]);if(_0x2afee1['name']){delete _0x2afee1[_0x9f81('0x17')];}_0xfa0e7b[_0x9f81('0x12')](_0x41ae4a)[_0x9f81('0x18')](_0x2afee1);};}exports['index']=function(_0x2128e2,_0x2a64a8){var _0x2f753c={};var _0x1a2eaf={'count':0x0,'rows':[]};var _0x2241f9=_[_0x9f81('0x19')](db[_0x9f81('0x1a')]['rawAttributes'],function(_0x17100c){return{'name':_0x17100c[_0x9f81('0x1b')],'type':_0x17100c[_0x9f81('0x1c')][_0x9f81('0x1d')]};});_0x2f753c=qs[_0x9f81('0x1e')](_0x2241f9,_0x2128e2);var _0x1548fe={'where':_0x2f753c[_0x9f81('0x1f')]};return db[_0x9f81('0x1a')][_0x9f81('0xc')](_0x1548fe)[_0x9f81('0xf')](function(_0x26e909){_0x1a2eaf[_0x9f81('0xc')]=_0x26e909;_0x2f753c['include']=qs[_0x9f81('0x20')](_0x2128e2[_0x9f81('0x21')]);return db[_0x9f81('0x1a')][_0x9f81('0x22')](_0x2f753c);})['then'](function(_0x120d1c){_0x1a2eaf[_0x9f81('0x23')]=_0x120d1c;return _0x1a2eaf;})[_0x9f81('0xf')](respondWithFilteredResult(_0x2a64a8,_0x2f753c))[_0x9f81('0x24')](handleError(_0x2a64a8,null));};exports[_0x9f81('0x25')]=function(_0x43c0f1,_0x1a4b41){var _0x1564c5={'raw':!![],'where':{'id':_0x43c0f1['params']['id']}},_0x539ff8={};_0x539ff8[_0x9f81('0x26')]=_[_0x9f81('0x27')](db['OpenchannelQueue'][_0x9f81('0x28')]);_0x539ff8['query']=_[_0x9f81('0x27')](_0x43c0f1[_0x9f81('0x21')]);_0x539ff8['filters']=_[_0x9f81('0x29')](_0x539ff8[_0x9f81('0x26')],_0x539ff8['query']);_0x1564c5[_0x9f81('0x2a')]=_['intersection'](_0x539ff8[_0x9f81('0x26')],qs['fields'](_0x43c0f1[_0x9f81('0x21')][_0x9f81('0x2b')]));_0x1564c5['attributes']=_0x1564c5[_0x9f81('0x2a')][_0x9f81('0x2c')]?_0x1564c5[_0x9f81('0x2a')]:_0x539ff8[_0x9f81('0x26')];if(_0x43c0f1[_0x9f81('0x21')][_0x9f81('0x2d')]){_0x1564c5[_0x9f81('0x20')]=[{'all':!![]}];}_0x1564c5=_[_0x9f81('0x2e')]({},_0x1564c5,_0x43c0f1['options']);return db['OpenchannelQueue'][_0x9f81('0x2f')](_0x1564c5)['then'](handleEntityNotFound(_0x1a4b41,null))[_0x9f81('0xf')](respondWithResult(_0x1a4b41,null))[_0x9f81('0x24')](handleError(_0x1a4b41,null));};exports[_0x9f81('0x30')]=function(_0xf4907c,_0x226360){return db['OpenchannelQueue'][_0x9f81('0x30')](_0xf4907c[_0x9f81('0x31')],{})['then'](function(_0x3e7c5e){var _0x307d66=_0xf4907c[_0x9f81('0x32')][_0x9f81('0x33')]({'plain':!![]});if(!_0x307d66)throw new Error(_0x9f81('0x34'));if(_0x307d66['role']==='user'){var _0x5a4fa9=_0x3e7c5e[_0x9f81('0x33')]({'plain':!![]});var _0x4539d2=_0x9f81('0x11');return db[_0x9f81('0x35')]['find']({'where':{'name':_0x4539d2,'userProfileId':_0x307d66[_0x9f81('0x36')]},'raw':!![]})[_0x9f81('0xf')](function(_0x38bcc3){if(_0x38bcc3&&_0x38bcc3['autoAssociation']===0x0){return db[_0x9f81('0x37')][_0x9f81('0x30')]({'name':_0x5a4fa9[_0x9f81('0x17')],'resourceId':_0x5a4fa9['id'],'type':_0x38bcc3[_0x9f81('0x17')],'sectionId':_0x38bcc3['id']},{})['then'](function(){return _0x3e7c5e;});}else{return _0x3e7c5e;}})[_0x9f81('0x24')](function(_0x2d337f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d337f);throw _0x2d337f;});}return _0x3e7c5e;})['then'](respondWithResult(_0x226360,0xc9))[_0x9f81('0x24')](handleError(_0x226360,null));};exports['update']=function(_0x1e1ce2,_0x3a89ba){if(_0x1e1ce2[_0x9f81('0x31')]['id']){delete _0x1e1ce2[_0x9f81('0x31')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x1e1ce2['params']['id']}})[_0x9f81('0xf')](handleEntityNotFound(_0x3a89ba,null))[_0x9f81('0xf')](saveUpdates(_0x1e1ce2['body'],null))[_0x9f81('0xf')](respondWithResult(_0x3a89ba,null))['catch'](handleError(_0x3a89ba,null));};exports[_0x9f81('0x10')]=function(_0x127a3e,_0x2b37de){return db[_0x9f81('0x1a')][_0x9f81('0x2f')]({'where':{'id':_0x127a3e[_0x9f81('0x38')]['id']}})[_0x9f81('0xf')](handleEntityNotFound(_0x2b37de,null))[_0x9f81('0xf')](removeEntity(_0x2b37de,null))[_0x9f81('0x24')](handleError(_0x2b37de,null));};exports[_0x9f81('0x39')]=function(_0x5859c7,_0x355670){return db['OpenchannelQueue'][_0x9f81('0x39')]()[_0x9f81('0xf')](respondWithResult(_0x355670,null))['catch'](handleError(_0x355670,null));};exports['getMembers']=function(_0x47c26e,_0x5c9e07){var _0x4f0d5d={'raw':!![],'where':{}},_0x104f9a={},_0x1c158b;return db[_0x9f81('0x1a')][_0x9f81('0x3a')]({'where':{'id':_0x47c26e[_0x9f81('0x38')]['id']}})['then'](handleEntityNotFound(_0x5c9e07,null))[_0x9f81('0xf')](function(_0xca5ca5){if(_0xca5ca5){_0x1c158b=_0xca5ca5[_0x9f81('0x33')]({'plain':!![]});_0x104f9a[_0x9f81('0x26')]=_['keys'](db[_0x9f81('0x3b')][_0x9f81('0x28')]);_0x104f9a[_0x9f81('0x21')]=_[_0x9f81('0x27')](_0x47c26e[_0x9f81('0x21')]);_0x104f9a['filters']=_[_0x9f81('0x29')](_0x104f9a[_0x9f81('0x26')],_0x104f9a['query']);_0x4f0d5d['attributes']=_[_0x9f81('0x29')](_0x104f9a[_0x9f81('0x26')],qs[_0x9f81('0x2b')](_0x47c26e[_0x9f81('0x21')][_0x9f81('0x2b')]));_0x4f0d5d[_0x9f81('0x2a')]=_0x4f0d5d[_0x9f81('0x2a')]['length']?_0x4f0d5d[_0x9f81('0x2a')]:_0x104f9a[_0x9f81('0x26')];if(!_0x47c26e[_0x9f81('0x21')][_0x9f81('0x3c')]('nolimit')){_0x4f0d5d[_0x9f81('0xb')]=qs[_0x9f81('0xb')](_0x47c26e[_0x9f81('0x21')][_0x9f81('0xb')]);_0x4f0d5d[_0x9f81('0x9')]=qs[_0x9f81('0x9')](_0x47c26e['query'][_0x9f81('0x9')]);}_0x4f0d5d['order']=qs[_0x9f81('0x3d')](_0x47c26e['query'][_0x9f81('0x3d')]);_0x4f0d5d[_0x9f81('0x1f')]=qs['filters'](_[_0x9f81('0x3e')](_0x47c26e[_0x9f81('0x21')],_0x104f9a['filters']));_0x4f0d5d[_0x9f81('0x1f')][_0x9f81('0x3f')]=_0xca5ca5['id'];if(_0x47c26e[_0x9f81('0x21')][_0x9f81('0x40')]){_0x4f0d5d[_0x9f81('0x1f')]=_[_0x9f81('0x2e')](_0x4f0d5d[_0x9f81('0x1f')],{'$or':_['map'](_0x4f0d5d[_0x9f81('0x2a')],function(_0x1e7658){var _0x29b111={};_0x29b111[_0x1e7658]={'$like':'%'+_0x47c26e[_0x9f81('0x21')]['filter']+'%'};return _0x29b111;})});}_0x4f0d5d=_[_0x9f81('0x2e')]({},_0x4f0d5d,_0x47c26e[_0x9f81('0x41')]);return db['UserOpenchannelQueue'][_0x9f81('0x22')](_0x4f0d5d);}})[_0x9f81('0xf')](function(_0xb9794c){if(_0xb9794c){return db[_0x9f81('0x42')][_0x9f81('0x43')]({'where':{'id':_[_0x9f81('0x19')](_0xb9794c,_0x9f81('0x44')),'role':_0x9f81('0x45')},'attributes':['id',_0x9f81('0x17'),_0x9f81('0x46'),_0x9f81('0x47'),_0x9f81('0x48')]});}})[_0x9f81('0xf')](function(_0x268bbb){if(_0x268bbb){return{'count':_0x268bbb[_0x9f81('0xc')],'rows':_[_0x9f81('0x19')](_0x268bbb[_0x9f81('0x23')],function(_0x36897e){return{'membername':_0x36897e['name'],'UserId':_0x36897e['id'],'queue_name':_0x1c158b[_0x9f81('0x17')],'OpenchannelQueueId':_0x1c158b['id'],'interface':util[_0x9f81('0x49')](_0x9f81('0x4a'),_0x9f81('0x4b'),_0x36897e[_0x9f81('0x17')]),'penalty':0x0,'paused':_0x36897e[_0x9f81('0x46')],'createdAt':_0x36897e[_0x9f81('0x48')],'updatedAt':_0x36897e[_0x9f81('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9f81('0xf')](respondWithFilteredResult(_0x5c9e07,_0x4f0d5d))[_0x9f81('0x24')](handleError(_0x5c9e07,null));};exports['getTeams']=function(_0x430f2a,_0x34c554){var _0x12ba1f={};var _0x4fe99d={};var _0x7972cd;var _0x32c75c;return db[_0x9f81('0x1a')][_0x9f81('0x3a')]({'where':{'id':_0x430f2a[_0x9f81('0x38')]['id']}})[_0x9f81('0xf')](handleEntityNotFound(_0x34c554,null))[_0x9f81('0xf')](function(_0x70d394){if(_0x70d394){_0x7972cd=_0x70d394;_0x4fe99d[_0x9f81('0x26')]=_[_0x9f81('0x27')](db[_0x9f81('0x4c')][_0x9f81('0x28')]);_0x4fe99d[_0x9f81('0x21')]=_[_0x9f81('0x27')](_0x430f2a[_0x9f81('0x21')]);_0x4fe99d['filters']=_[_0x9f81('0x29')](_0x4fe99d[_0x9f81('0x26')],_0x4fe99d[_0x9f81('0x21')]);_0x12ba1f[_0x9f81('0x2a')]=_[_0x9f81('0x29')](_0x4fe99d[_0x9f81('0x26')],qs['fields'](_0x430f2a[_0x9f81('0x21')]['fields']));_0x12ba1f[_0x9f81('0x2a')]=_0x12ba1f['attributes'][_0x9f81('0x2c')]?_0x12ba1f['attributes']:_0x4fe99d['model'];_0x12ba1f[_0x9f81('0x4d')]=qs['sort'](_0x430f2a['query'][_0x9f81('0x3d')]);_0x12ba1f[_0x9f81('0x1f')]=qs[_0x9f81('0x4e')](_['pick'](_0x430f2a[_0x9f81('0x21')],_0x4fe99d[_0x9f81('0x4e')]));if(_0x430f2a['query'][_0x9f81('0x40')]){_0x12ba1f[_0x9f81('0x1f')]=_[_0x9f81('0x2e')](_0x12ba1f[_0x9f81('0x1f')],{'$or':_['map'](_0x12ba1f['attributes'],function(_0xbf4e3a){var _0x376d30={};_0x376d30[_0xbf4e3a]={'$like':'%'+_0x430f2a[_0x9f81('0x21')]['filter']+'%'};return _0x376d30;})});}_0x12ba1f=_[_0x9f81('0x2e')]({},_0x12ba1f,_0x430f2a[_0x9f81('0x41')]);return _0x7972cd[_0x9f81('0x4f')](_0x12ba1f);}})[_0x9f81('0xf')](function(_0x2407bf){if(_0x2407bf){_0x32c75c=_0x2407bf[_0x9f81('0x2c')];if(!_0x430f2a[_0x9f81('0x21')][_0x9f81('0x3c')](_0x9f81('0x50'))){_0x12ba1f['limit']=qs[_0x9f81('0xb')](_0x430f2a[_0x9f81('0x21')][_0x9f81('0xb')]);_0x12ba1f[_0x9f81('0x9')]=qs['offset'](_0x430f2a['query']['offset']);}return _0x7972cd[_0x9f81('0x4f')](_0x12ba1f);}})[_0x9f81('0xf')](function(_0x4783a4){if(_0x4783a4){return _0x4783a4?{'count':_0x32c75c,'rows':_0x4783a4}:null;}})['then'](respondWithResult(_0x34c554,null))['catch'](handleError(_0x34c554,null));};exports[_0x9f81('0x51')]=function(_0x20909f,_0x4384ec){var _0x2c07d4=_0x20909f[_0x9f81('0x31')][_0x9f81('0x52')];return db[_0x9f81('0x4c')][_0x9f81('0x22')]({'where':{'id':_0x2c07d4},'attributes':['id'],'include':[{'model':db[_0x9f81('0x42')],'as':'Agents','attributes':['id',_0x9f81('0x17'),'online','voicePause',_0x9f81('0x53')],'raw':!![]}]})[_0x9f81('0xf')](function(_0x3f5e08){if(_0x3f5e08){var _0x1434f9=_[_0x9f81('0x54')](_0x3f5e08,function(_0x2d024a){var _0x22d594=_0x2d024a[_0x9f81('0x33')]({'plain':!![]});return _0x22d594[_0x9f81('0x55')];});return db[_0x9f81('0x1a')][_0x9f81('0x2f')]({'where':{'id':_0x20909f[_0x9f81('0x38')]['id']}})[_0x9f81('0xf')](function(_0x5a883d){return db[_0x9f81('0x56')][_0x9f81('0x57')](function(_0x562151){return _0x5a883d['addTeams'](_0x2c07d4,{'transaction':_0x562151})[_0x9f81('0xf')](function(){return BPromise[_0x9f81('0x58')](_0x1434f9,function(_0xf51743){return db[_0x9f81('0x3b')][_0x9f81('0x59')]({'where':{'UserId':_0xf51743['id'],'OpenchannelQueueId':_0x20909f[_0x9f81('0x38')]['id']},'transaction':_0x562151});});})[_0x9f81('0xf')](function(){_0x1434f9['forEach'](function(_0x2a1f97){socket[_0x9f81('0x5a')]('userOpenchannelQueue:save',{'UserId':_0x2a1f97['id'],'OpenchannelQueueId':_0x5a883d['id']});});});});});}})[_0x9f81('0xf')](respondWithStatusCode(_0x4384ec,null))['catch'](handleError(_0x4384ec,null));};exports[_0x9f81('0x5b')]=function(_0x3cf5ec,_0x33d8ee){return db[_0x9f81('0x4c')]['findAll']({'where':{'id':_0x3cf5ec[_0x9f81('0x21')][_0x9f81('0x52')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9f81('0xf')](handleEntityNotFound(_0x33d8ee,null))['then'](function(_0x3d68bc){var _0x4f0876=_[_0x9f81('0x19')](_0x3d68bc,'id');var _0x546724=[];var _0x956581=[];var _0x14d5b7=squel['select']();_0x14d5b7['field']('tq.TeamId')[_0x9f81('0x5c')](_0x9f81('0x5d'),'tq')[_0x9f81('0x5e')]('user_has_teams','ut',_0x9f81('0x5f'))[_0x9f81('0x1f')](_0x9f81('0x60'),_0x3cf5ec[_0x9f81('0x38')]['id']);for(var _0x176e0a=0x0;_0x176e0a<_0x3d68bc['length'];_0x176e0a+=0x1){let _0x2bfe80=_0x3d68bc[_0x176e0a];for(var _0x537ca5=0x0;_0x537ca5<_0x2bfe80['Agents']['length'];_0x537ca5+=0x1){let _0x2a07ef=_0x2bfe80[_0x9f81('0x55')][_0x537ca5];var _0x393a9f=_0x14d5b7[_0x9f81('0x61')]();_0x393a9f[_0x9f81('0x1f')](_0x9f81('0x62'),_0x2a07ef['id']);_0x956581['push'](db[_0x9f81('0x56')][_0x9f81('0x21')](_0x393a9f[_0x9f81('0x63')](),{'type':db['sequelize'][_0x9f81('0x64')][_0x9f81('0x65')]})[_0x9f81('0xf')](function(_0xaf5444){if(_0xaf5444[_0x9f81('0x2c')]===0x1){return _0x2a07ef['id'];}else{var _0x15004c=_[_0x9f81('0x66')](_[_0x9f81('0x19')](_0xaf5444,'TeamId'),function(_0x33dfef){return _['includes'](_0x4f0876,_0x33dfef);});if(_0x15004c){return _0x2a07ef['id'];}}}));}}return BPromise[_0x9f81('0x67')](_0x956581)[_0x9f81('0xf')](function(_0xec36a9){_0x546724=_(_0x546724)[_0x9f81('0x68')](_0xec36a9)[_0x9f81('0x69')]()['value']();return db[_0x9f81('0x1a')][_0x9f81('0x2f')]({'where':{'id':_0x3cf5ec[_0x9f81('0x38')]['id']}})[_0x9f81('0xf')](function(_0x508a77){return db['sequelize'][_0x9f81('0x57')](function(_0x457d36){return _0x508a77[_0x9f81('0x5b')](_0x3cf5ec['query'][_0x9f81('0x52')],{'transaction':_0x457d36})['then'](function(){if(!_['isEmpty'](_0x546724)){return _0x508a77[_0x9f81('0x6a')](_0x546724,{'transaction':_0x457d36});}})[_0x9f81('0xf')](function(){_0x546724['forEach'](function(_0x963978){socket['emit'](_0x9f81('0x6b'),{'UserId':_0x963978,'OpenchannelQueueId':_0x508a77['id']});});});});});});})[_0x9f81('0xf')](respondWithStatusCode(_0x33d8ee,null))[_0x9f81('0x24')](handleError(_0x33d8ee,null));};exports['addAgents']=function(_0xbdafbd,_0x52223e){return db[_0x9f81('0x1a')][_0x9f81('0x2f')]({'where':{'id':_0xbdafbd[_0x9f81('0x38')]['id']}})[_0x9f81('0xf')](handleEntityNotFound(_0x52223e,null))[_0x9f81('0xf')](function(_0x41910d){if(_0x41910d){return _0x41910d[_0x9f81('0x6c')](_0xbdafbd['body'][_0x9f81('0x52')],_[_0x9f81('0x6d')](_0xbdafbd[_0x9f81('0x31')],[_0x9f81('0x52'),'id'])||{})[_0x9f81('0x6e')](function(_0xe14957){for(var _0x285df7=0x0;_0x285df7<_0xbdafbd[_0x9f81('0x31')]['ids'][_0x9f81('0x2c')];_0x285df7+=0x1){socket[_0x9f81('0x5a')](_0x9f81('0x6f'),{'UserId':Number(_0xbdafbd[_0x9f81('0x31')][_0x9f81('0x52')][_0x285df7]),'OpenchannelQueueId':Number(_0xbdafbd[_0x9f81('0x38')]['id'])});}return _0xe14957;});}})[_0x9f81('0xf')](respondWithResult(_0x52223e,null))[_0x9f81('0x24')](handleError(_0x52223e,null));};exports['removeAgents']=function(_0x4d2d88,_0x247880){return db['OpenchannelQueue']['find']({'where':{'id':_0x4d2d88['params']['id']}})[_0x9f81('0xf')](handleEntityNotFound(_0x247880,null))[_0x9f81('0xf')](function(_0x184765){if(_0x184765){return _0x184765[_0x9f81('0x6a')](_0x4d2d88[_0x9f81('0x21')][_0x9f81('0x52')])[_0x9f81('0xf')](function(){if(_[_0x9f81('0x70')](_0x4d2d88[_0x9f81('0x21')]['ids'])){for(var _0x489a89=0x0;_0x489a89<_0x4d2d88[_0x9f81('0x21')][_0x9f81('0x52')][_0x9f81('0x2c')];_0x489a89+=0x1){socket[_0x9f81('0x5a')](_0x9f81('0x6b'),{'UserId':Number(_0x4d2d88[_0x9f81('0x21')][_0x9f81('0x52')][_0x489a89]),'OpenchannelQueueId':Number(_0x4d2d88['params']['id'])});}}else{socket[_0x9f81('0x5a')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4d2d88['query']['ids']),'OpenchannelQueueId':Number(_0x4d2d88['params']['id'])});}});}})['then'](respondWithStatusCode(_0x247880,null))[_0x9f81('0x24')](handleError(_0x247880,null));};exports[_0x9f81('0x71')]=function(_0x1bf4f8,_0x30dc7b){var _0x1b2ee1={};var _0x30633b={};var _0x3d1b1b;var _0x2102a9;return db[_0x9f81('0x1a')][_0x9f81('0x3a')]({'where':{'id':_0x1bf4f8['params']['id']}})['then'](handleEntityNotFound(_0x30dc7b,null))[_0x9f81('0xf')](function(_0x54b7b8){if(_0x54b7b8){_0x3d1b1b=_0x54b7b8;_0x30633b['model']=_[_0x9f81('0x27')](db[_0x9f81('0x42')][_0x9f81('0x28')]);_0x30633b[_0x9f81('0x21')]=_[_0x9f81('0x27')](_0x1bf4f8[_0x9f81('0x21')]);_0x30633b['filters']=_[_0x9f81('0x29')](_0x30633b['model'],_0x30633b['query']);_0x1b2ee1[_0x9f81('0x2a')]=_[_0x9f81('0x29')](_0x30633b[_0x9f81('0x26')],qs[_0x9f81('0x2b')](_0x1bf4f8[_0x9f81('0x21')][_0x9f81('0x2b')]));_0x1b2ee1[_0x9f81('0x2a')]=_0x1b2ee1[_0x9f81('0x2a')]['length']?_0x1b2ee1[_0x9f81('0x2a')]:_0x30633b[_0x9f81('0x26')];_0x1b2ee1[_0x9f81('0x4d')]=qs[_0x9f81('0x3d')](_0x1bf4f8[_0x9f81('0x21')][_0x9f81('0x3d')]);_0x1b2ee1[_0x9f81('0x1f')]=qs['filters'](_['pick'](_0x1bf4f8['query'],_0x30633b[_0x9f81('0x4e')]));if(_0x1bf4f8[_0x9f81('0x21')][_0x9f81('0x40')]){_0x1b2ee1[_0x9f81('0x1f')]=_[_0x9f81('0x2e')](_0x1b2ee1['where'],{'$or':_[_0x9f81('0x19')](_0x1b2ee1[_0x9f81('0x2a')],function(_0x1f21a6){var _0x24de10={};_0x24de10[_0x1f21a6]={'$like':'%'+_0x1bf4f8[_0x9f81('0x21')][_0x9f81('0x40')]+'%'};return _0x24de10;})});}_0x1b2ee1=_[_0x9f81('0x2e')]({},_0x1b2ee1,_0x1bf4f8['options']);return _0x3d1b1b[_0x9f81('0x71')](_0x1b2ee1);}})[_0x9f81('0xf')](function(_0x1e06b1){if(_0x1e06b1){_0x2102a9=_0x1e06b1['length'];if(!_0x1bf4f8[_0x9f81('0x21')][_0x9f81('0x3c')]('nolimit')){_0x1b2ee1['limit']=qs[_0x9f81('0xb')](_0x1bf4f8[_0x9f81('0x21')][_0x9f81('0xb')]);_0x1b2ee1[_0x9f81('0x9')]=qs['offset'](_0x1bf4f8[_0x9f81('0x21')][_0x9f81('0x9')]);}return _0x3d1b1b[_0x9f81('0x71')](_0x1b2ee1);}})['then'](function(_0x11b702){if(_0x11b702){return _0x11b702?{'count':_0x2102a9,'rows':_0x11b702}:null;}})[_0x9f81('0xf')](respondWithResult(_0x30dc7b,null))[_0x9f81('0x24')](handleError(_0x30dc7b,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 85bf0ec..4dccec8 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 _0x13ee=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x548467,_0x5ef1f2){var _0x53c1b0=function(_0x38644a){while(--_0x38644a){_0x548467['push'](_0x548467['shift']());}};_0x53c1b0(++_0x5ef1f2);}(_0x13ee,0x125));var _0xe13e=function(_0xa990b7,_0x26c527){_0xa990b7=_0xa990b7-0x0;var _0x52c99c=_0x13ee[_0xa990b7];return _0x52c99c;};'use strict';var EventEmitter=require(_0xe13e('0x0'));var OpenchannelQueue=require(_0xe13e('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xe13e('0x2')](0x0);var events={'afterCreate':_0xe13e('0x3'),'afterUpdate':_0xe13e('0x4'),'afterDestroy':_0xe13e('0x5')};function emitEvent(_0x2136a1){return function(_0x13361c,_0x2babcf,_0x1c4033){OpenchannelQueueEvents[_0xe13e('0x6')](_0x2136a1+':'+_0x13361c['id'],_0x13361c);OpenchannelQueueEvents[_0xe13e('0x6')](_0x2136a1,_0x13361c);_0x1c4033(null);};}for(var e in events){if(events[_0xe13e('0x7')](e)){var event=events[e];OpenchannelQueue[_0xe13e('0x8')](e,emitEvent(event));}}module[_0xe13e('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xe4ea=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3e0b8f,_0x1cddeb){var _0x22f742=function(_0xacb1bc){while(--_0xacb1bc){_0x3e0b8f['push'](_0x3e0b8f['shift']());}};_0x22f742(++_0x1cddeb);}(_0xe4ea,0xc6));var _0xae4e=function(_0x4607a4,_0x2cc9c9){_0x4607a4=_0x4607a4-0x0;var _0x1d7679=_0xe4ea[_0x4607a4];return _0x1d7679;};'use strict';var EventEmitter=require(_0xae4e('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xae4e('0x1')](0x0);var events={'afterCreate':_0xae4e('0x2'),'afterUpdate':_0xae4e('0x3'),'afterDestroy':_0xae4e('0x4')};function emitEvent(_0x456a90){return function(_0x57b9ab,_0x376aad,_0x464053){OpenchannelQueueEvents['emit'](_0x456a90+':'+_0x57b9ab['id'],_0x57b9ab);OpenchannelQueueEvents[_0xae4e('0x5')](_0x456a90,_0x57b9ab);_0x464053(null);};}for(var e in events){if(events[_0xae4e('0x6')](e)){var event=events[e];OpenchannelQueue[_0xae4e('0x7')](e,emitEvent(event));}}module[_0xae4e('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 6fc57ea..f0a1140 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 _0x5e9f=['rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','../../config/logger','moment','bluebird','path'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0x5e9f,0x182));var _0xf5e9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5e9f[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf5e9('0x0'))('api');var moment=require(_0xf5e9('0x1'));var BPromise=require(_0xf5e9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5e9('0x3'));var rimraf=require(_0xf5e9('0x4'));var config=require('../../config/environment');var attributes=require(_0xf5e9('0x5'));module[_0xf5e9('0x6')]=function(_0x2abeda,_0x5a0714){return _0x2abeda[_0xf5e9('0x7')](_0xf5e9('0x8'),attributes,{'tableName':_0xf5e9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28ed=['../../config/environment','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3f6f86,_0x3e1639){var _0x4f7adf=function(_0x4758f5){while(--_0x4758f5){_0x3f6f86['push'](_0x3f6f86['shift']());}};_0x4f7adf(++_0x3e1639);}(_0x28ed,0x14a));var _0xd28e=function(_0x3c6da7,_0x3600f8){_0x3c6da7=_0x3c6da7-0x0;var _0x4a8afb=_0x28ed[_0x3c6da7];return _0x4a8afb;};'use strict';var _=require(_0xd28e('0x0'));var util=require(_0xd28e('0x1'));var logger=require(_0xd28e('0x2'))(_0xd28e('0x3'));var moment=require(_0xd28e('0x4'));var BPromise=require(_0xd28e('0x5'));var rp=require(_0xd28e('0x6'));var fs=require('fs');var path=require(_0xd28e('0x7'));var rimraf=require('rimraf');var config=require(_0xd28e('0x8'));var attributes=require('./openchannelQueue.attributes');module[_0xd28e('0x9')]=function(_0x7e2b,_0x2c14eb){return _0x7e2b[_0xd28e('0xa')](_0xd28e('0xb'),attributes,{'tableName':_0xd28e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index b1561f8..e94b48d 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 _0x917a=['result','catch','GetOpenchannelQueue','findAll','options','where','attributes','limit','map','include','model','ShowOpenchannelQueue','OpenchannelQueue','find','raw','then','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./openchannelQueue.socket','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0xd1d034,_0x5d5d10){var _0x23b4e4=function(_0x52e2be){while(--_0x52e2be){_0xd1d034['push'](_0xd1d034['shift']());}};_0x23b4e4(++_0x5d5d10);}(_0x917a,0x1cc));var _0xa917=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x917a[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xa917('0x0'));var moment=require(_0xa917('0x1'));var BPromise=require(_0xa917('0x2'));var rs=require(_0xa917('0x3'));var fs=require('fs');var Redis=require(_0xa917('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa917('0x5'));var config=require(_0xa917('0x6'));var jayson=require(_0xa917('0x7'));var client=jayson[_0xa917('0x8')]['http']({'port':0x232a});config[_0xa917('0x9')]=_['defaults'](config[_0xa917('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xa917('0xa'))(new Redis(config[_0xa917('0x9')]));require(_0xa917('0xb'))['register'](socket);function respondWithRpcPromise(_0x1c7351,_0x2c4539,_0x5f08c1){return new BPromise(function(_0x2c8a93,_0x3ae2a5){return client[_0xa917('0xc')](_0x1c7351,_0x5f08c1)['then'](function(_0x55e855){logger['info'](_0xa917('0xd'),_0x2c4539,_0xa917('0xe'));logger[_0xa917('0xf')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2c4539,'request\x20sent',JSON[_0xa917('0x10')](_0x55e855));if(_0x55e855[_0xa917('0x11')]){if(_0x55e855[_0xa917('0x11')][_0xa917('0x12')]===0x1f4){logger[_0xa917('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x2c4539,_0x55e855[_0xa917('0x11')][_0xa917('0x13')]);return _0x3ae2a5(_0x55e855['error']['message']);}logger[_0xa917('0x11')](_0xa917('0xd'),_0x2c4539,_0x55e855[_0xa917('0x11')][_0xa917('0x13')]);return _0x2c8a93(_0x55e855['error'][_0xa917('0x13')]);}else{logger[_0xa917('0x14')](_0xa917('0xd'),_0x2c4539,_0xa917('0xe'));_0x2c8a93(_0x55e855[_0xa917('0x15')][_0xa917('0x13')]);}})[_0xa917('0x16')](function(_0x3f34c3){logger['error'](_0xa917('0xd'),_0x2c4539,_0x3f34c3);_0x3ae2a5(_0x3f34c3);});});}exports[_0xa917('0x17')]=function(_0x290b33){var _0x3dca3e=this;return new Promise(function(_0x42bf46,_0x2b06ff){return db['OpenchannelQueue'][_0xa917('0x18')]({'raw':_0x290b33[_0xa917('0x19')]?_0x290b33['options']['raw']===undefined?!![]:![]:!![],'where':_0x290b33[_0xa917('0x19')]?_0x290b33[_0xa917('0x19')][_0xa917('0x1a')]||null:null,'attributes':_0x290b33[_0xa917('0x19')]?_0x290b33['options'][_0xa917('0x1b')]||null:null,'limit':_0x290b33[_0xa917('0x19')]?_0x290b33[_0xa917('0x19')][_0xa917('0x1c')]||null:null,'include':_0x290b33[_0xa917('0x19')]?_0x290b33[_0xa917('0x19')]['include']?_[_0xa917('0x1d')](_0x290b33['options'][_0xa917('0x1e')],function(_0x15346e){return{'model':db[_0x15346e[_0xa917('0x1f')]],'as':_0x15346e['as'],'attributes':_0x15346e[_0xa917('0x1b')],'include':_0x15346e[_0xa917('0x1e')]?_[_0xa917('0x1d')](_0x15346e['include'],function(_0x4dd368){return{'model':db[_0x4dd368[_0xa917('0x1f')]],'as':_0x4dd368['as'],'attributes':_0x4dd368[_0xa917('0x1b')],'include':_0x4dd368['include']?_[_0xa917('0x1d')](_0x4dd368[_0xa917('0x1e')],function(_0x4a8ae5){return{'model':db[_0x4a8ae5[_0xa917('0x1f')]],'as':_0x4a8ae5['as'],'attributes':_0x4a8ae5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x51ea1b){logger['info'](_0xa917('0x17'),_0x290b33);logger[_0xa917('0xf')](_0xa917('0x17'),_0x290b33,JSON[_0xa917('0x10')](_0x51ea1b));_0x42bf46(_0x51ea1b);})[_0xa917('0x16')](function(_0x5aa60f){logger[_0xa917('0x11')](_0xa917('0x17'),_0x5aa60f['message'],_0x290b33);_0x2b06ff(_0x3dca3e['error'](0x1f4,_0x5aa60f[_0xa917('0x13')]));});});};exports[_0xa917('0x20')]=function(_0x47da8a){var _0x52d30b=this;return new Promise(function(_0x595d75,_0x4d62f1){return db[_0xa917('0x21')][_0xa917('0x22')]({'raw':_0x47da8a[_0xa917('0x19')]?_0x47da8a[_0xa917('0x19')][_0xa917('0x23')]===undefined?!![]:![]:!![],'where':_0x47da8a[_0xa917('0x19')]?_0x47da8a[_0xa917('0x19')][_0xa917('0x1a')]||null:null,'attributes':_0x47da8a[_0xa917('0x19')]?_0x47da8a['options']['attributes']||null:null,'include':_0x47da8a['options']?_0x47da8a[_0xa917('0x19')][_0xa917('0x1e')]?_[_0xa917('0x1d')](_0x47da8a[_0xa917('0x19')][_0xa917('0x1e')],function(_0x51c289){return{'model':db[_0x51c289['model']],'as':_0x51c289['as'],'attributes':_0x51c289[_0xa917('0x1b')],'include':_0x51c289[_0xa917('0x1e')]?_[_0xa917('0x1d')](_0x51c289[_0xa917('0x1e')],function(_0x4ab78b){return{'model':db[_0x4ab78b['model']],'as':_0x4ab78b['as'],'attributes':_0x4ab78b[_0xa917('0x1b')],'include':_0x4ab78b['include']?_[_0xa917('0x1d')](_0x4ab78b[_0xa917('0x1e')],function(_0x228076){return{'model':db[_0x228076[_0xa917('0x1f')]],'as':_0x228076['as'],'attributes':_0x228076['attributes']};}):[]};}):[]};}):[]:[]})[_0xa917('0x24')](function(_0x2bce12){logger[_0xa917('0x14')](_0xa917('0x20'),_0x47da8a);logger[_0xa917('0xf')](_0xa917('0x20'),_0x47da8a,JSON['stringify'](_0x2bce12));_0x595d75(_0x2bce12);})[_0xa917('0x16')](function(_0x304543){logger[_0xa917('0x11')](_0xa917('0x20'),_0x304543['message'],_0x47da8a);_0x4d62f1(_0x52d30b['error'](0x1f4,_0x304543[_0xa917('0x13')]));});});}; \ No newline at end of file +var _0xb3b1=['./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetOpenchannelQueue','findAll','options','where','attributes','include','map','model','catch','ShowOpenchannelQueue','raw','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter'];(function(_0x5ddac4,_0x17156e){var _0x5443ac=function(_0x4eafc2){while(--_0x4eafc2){_0x5ddac4['push'](_0x5ddac4['shift']());}};_0x5443ac(++_0x17156e);}(_0xb3b1,0xd2));var _0x1b3b=function(_0x449531,_0x5767ba){_0x449531=_0x449531-0x0;var _0x4ef912=_0xb3b1[_0x449531];return _0x4ef912;};'use strict';var _=require(_0x1b3b('0x0'));var util=require(_0x1b3b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b3b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b3b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b3b('0x4'))(_0x1b3b('0x5'));var config=require(_0x1b3b('0x6'));var jayson=require(_0x1b3b('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x1b3b('0x8')]=_[_0x1b3b('0x9')](config[_0x1b3b('0x8')],{'host':_0x1b3b('0xa'),'port':0x18eb});var socket=require(_0x1b3b('0xb'))(new Redis(config[_0x1b3b('0x8')]));require(_0x1b3b('0xc'))[_0x1b3b('0xd')](socket);function respondWithRpcPromise(_0x4f9cec,_0x2b92e9,_0xaa9f66){return new BPromise(function(_0xb0879b,_0x107ea2){return client[_0x1b3b('0xe')](_0x4f9cec,_0xaa9f66)[_0x1b3b('0xf')](function(_0x32aa44){logger[_0x1b3b('0x10')](_0x1b3b('0x11'),_0x2b92e9,_0x1b3b('0x12'));logger[_0x1b3b('0x13')](_0x1b3b('0x14'),_0x2b92e9,_0x1b3b('0x12'),JSON[_0x1b3b('0x15')](_0x32aa44));if(_0x32aa44['error']){if(_0x32aa44[_0x1b3b('0x16')][_0x1b3b('0x17')]===0x1f4){logger['error'](_0x1b3b('0x11'),_0x2b92e9,_0x32aa44[_0x1b3b('0x16')][_0x1b3b('0x18')]);return _0x107ea2(_0x32aa44[_0x1b3b('0x16')]['message']);}logger[_0x1b3b('0x16')](_0x1b3b('0x11'),_0x2b92e9,_0x32aa44['error']['message']);return _0xb0879b(_0x32aa44['error'][_0x1b3b('0x18')]);}else{logger['info'](_0x1b3b('0x11'),_0x2b92e9,'request\x20sent');_0xb0879b(_0x32aa44[_0x1b3b('0x19')][_0x1b3b('0x18')]);}})['catch'](function(_0x56eb61){logger[_0x1b3b('0x16')](_0x1b3b('0x11'),_0x2b92e9,_0x56eb61);_0x107ea2(_0x56eb61);});});}exports[_0x1b3b('0x1a')]=function(_0x181983){var _0x42e08f=this;return new Promise(function(_0x1dd670,_0x2e0d4e){return db['OpenchannelQueue'][_0x1b3b('0x1b')]({'raw':_0x181983[_0x1b3b('0x1c')]?_0x181983['options']['raw']===undefined?!![]:![]:!![],'where':_0x181983[_0x1b3b('0x1c')]?_0x181983['options'][_0x1b3b('0x1d')]||null:null,'attributes':_0x181983[_0x1b3b('0x1c')]?_0x181983[_0x1b3b('0x1c')][_0x1b3b('0x1e')]||null:null,'limit':_0x181983[_0x1b3b('0x1c')]?_0x181983['options']['limit']||null:null,'include':_0x181983[_0x1b3b('0x1c')]?_0x181983['options'][_0x1b3b('0x1f')]?_[_0x1b3b('0x20')](_0x181983[_0x1b3b('0x1c')]['include'],function(_0x231027){return{'model':db[_0x231027[_0x1b3b('0x21')]],'as':_0x231027['as'],'attributes':_0x231027[_0x1b3b('0x1e')],'include':_0x231027[_0x1b3b('0x1f')]?_[_0x1b3b('0x20')](_0x231027[_0x1b3b('0x1f')],function(_0x5815cf){return{'model':db[_0x5815cf['model']],'as':_0x5815cf['as'],'attributes':_0x5815cf[_0x1b3b('0x1e')],'include':_0x5815cf[_0x1b3b('0x1f')]?_['map'](_0x5815cf['include'],function(_0x32c258){return{'model':db[_0x32c258['model']],'as':_0x32c258['as'],'attributes':_0x32c258[_0x1b3b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1b3b('0xf')](function(_0x1ba793){logger[_0x1b3b('0x10')](_0x1b3b('0x1a'),_0x181983);logger[_0x1b3b('0x13')](_0x1b3b('0x1a'),_0x181983,JSON[_0x1b3b('0x15')](_0x1ba793));_0x1dd670(_0x1ba793);})[_0x1b3b('0x22')](function(_0x459773){logger['error'](_0x1b3b('0x1a'),_0x459773['message'],_0x181983);_0x2e0d4e(_0x42e08f[_0x1b3b('0x16')](0x1f4,_0x459773[_0x1b3b('0x18')]));});});};exports[_0x1b3b('0x23')]=function(_0xe2e575){var _0x32249e=this;return new Promise(function(_0x27012f,_0x1a66b0){return db['OpenchannelQueue']['find']({'raw':_0xe2e575[_0x1b3b('0x1c')]?_0xe2e575['options'][_0x1b3b('0x24')]===undefined?!![]:![]:!![],'where':_0xe2e575[_0x1b3b('0x1c')]?_0xe2e575[_0x1b3b('0x1c')][_0x1b3b('0x1d')]||null:null,'attributes':_0xe2e575['options']?_0xe2e575[_0x1b3b('0x1c')]['attributes']||null:null,'include':_0xe2e575[_0x1b3b('0x1c')]?_0xe2e575[_0x1b3b('0x1c')]['include']?_[_0x1b3b('0x20')](_0xe2e575[_0x1b3b('0x1c')]['include'],function(_0x1476d1){return{'model':db[_0x1476d1[_0x1b3b('0x21')]],'as':_0x1476d1['as'],'attributes':_0x1476d1[_0x1b3b('0x1e')],'include':_0x1476d1[_0x1b3b('0x1f')]?_[_0x1b3b('0x20')](_0x1476d1['include'],function(_0x2f0461){return{'model':db[_0x2f0461[_0x1b3b('0x21')]],'as':_0x2f0461['as'],'attributes':_0x2f0461[_0x1b3b('0x1e')],'include':_0x2f0461['include']?_[_0x1b3b('0x20')](_0x2f0461['include'],function(_0x50029c){return{'model':db[_0x50029c[_0x1b3b('0x21')]],'as':_0x50029c['as'],'attributes':_0x50029c[_0x1b3b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11c3c1){logger[_0x1b3b('0x10')]('ShowOpenchannelQueue',_0xe2e575);logger['debug'](_0x1b3b('0x23'),_0xe2e575,JSON['stringify'](_0x11c3c1));_0x27012f(_0x11c3c1);})['catch'](function(_0x4e711b){logger['error'](_0x1b3b('0x23'),_0x4e711b['message'],_0xe2e575);_0x1a66b0(_0x32249e[_0x1b3b('0x16')](0x1f4,_0x4e711b[_0x1b3b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 3ec992f..11f4f1e 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 _0xecab=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xecab,0x16b));var _0xbeca=function(_0x472cac,_0x43ccd2){_0x472cac=_0x472cac-0x0;var _0x38deac=_0xecab[_0x472cac];return _0x38deac;};'use strict';var OpenchannelQueueEvents=require(_0xbeca('0x0'));var events=[_0xbeca('0x1'),_0xbeca('0x2'),'update'];function createListener(_0x2341dd,_0xcb4add){return function(_0x3bbebc){_0xcb4add[_0xbeca('0x3')](_0x2341dd,_0x3bbebc);};}function removeListener(_0x2e1e56,_0x180ab0){return function(){OpenchannelQueueEvents[_0xbeca('0x4')](_0x2e1e56,_0x180ab0);};}exports[_0xbeca('0x5')]=function(_0x56505e){for(var _0x9f772f=0x0,_0x3b3cf6=events[_0xbeca('0x6')];_0x9f772f<_0x3b3cf6;_0x9f772f++){var _0x427e6b=events[_0x9f772f];var _0x520eab=createListener(_0xbeca('0x7')+_0x427e6b,_0x56505e);OpenchannelQueueEvents['on'](_0x427e6b,_0x520eab);}}; \ No newline at end of file +var _0x66e8=['update','emit','removeListener','openchannelQueue:','./openchannelQueue.events','remove'];(function(_0xcf416b,_0xbff34){var _0x3b0d44=function(_0x2c3ee9){while(--_0x2c3ee9){_0xcf416b['push'](_0xcf416b['shift']());}};_0x3b0d44(++_0xbff34);}(_0x66e8,0x10c));var _0x866e=function(_0x479b24,_0x1aec5b){_0x479b24=_0x479b24-0x0;var _0x1cbfa4=_0x66e8[_0x479b24];return _0x1cbfa4;};'use strict';var OpenchannelQueueEvents=require(_0x866e('0x0'));var events=['save',_0x866e('0x1'),_0x866e('0x2')];function createListener(_0x3ea311,_0x1ff709){return function(_0x13bb47){_0x1ff709[_0x866e('0x3')](_0x3ea311,_0x13bb47);};}function removeListener(_0xd2d065,_0x17609d){return function(){OpenchannelQueueEvents[_0x866e('0x4')](_0xd2d065,_0x17609d);};}exports['register']=function(_0x34ebac){for(var _0x2b23af=0x0,_0x3ec65f=events['length'];_0x2b23af<_0x3ec65f;_0x2b23af++){var _0x3a6bf5=events[_0x2b23af];var _0x507fd3=createListener(_0x866e('0x5')+_0x3a6bf5,_0x34ebac);OpenchannelQueueEvents['on'](_0x3a6bf5,_0x507fd3);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index a07645a..492bff8 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 _0x678e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','delete','destroy','exports','util','connect-timeout'];(function(_0x40971c,_0x41e1c7){var _0x46c23e=function(_0x339f52){while(--_0x339f52){_0x40971c['push'](_0x40971c['shift']());}};_0x46c23e(++_0x41e1c7);}(_0x678e,0xb2));var _0xe678=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x678e[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0xe678('0x0'));var path=require('path');var timeout=require(_0xe678('0x1'));var express=require(_0xe678('0x2'));var router=express[_0xe678('0x3')]();var fs_extra=require(_0xe678('0x4'));var auth=require(_0xe678('0x5'));var interaction=require(_0xe678('0x6'));var config=require('../../config/environment');var controller=require(_0xe678('0x7'));router[_0xe678('0x8')]('/',auth[_0xe678('0x9')](),controller['index']);router['get'](_0xe678('0xa'),auth['isAuthenticated'](),controller[_0xe678('0xb')]);router[_0xe678('0x8')](_0xe678('0xc'),auth[_0xe678('0x9')](),controller['show']);router[_0xe678('0xd')]('/',auth['isAuthenticated'](),controller[_0xe678('0xe')]);router['put'](_0xe678('0xc'),auth[_0xe678('0x9')](),controller['update']);router[_0xe678('0xf')](_0xe678('0xc'),auth[_0xe678('0x9')](),controller[_0xe678('0x10')]);module[_0xe678('0x11')]=router; \ No newline at end of file +var _0x117f=['put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','post','create'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0x117f,0xcd));var _0xf117=function(_0xbc066f,_0x3f57ab){_0xbc066f=_0xbc066f-0x0;var _0x42c8cf=_0x117f[_0xbc066f];return _0x42c8cf;};'use strict';var multer=require('multer');var util=require(_0xf117('0x0'));var path=require(_0xf117('0x1'));var timeout=require(_0xf117('0x2'));var express=require('express');var router=express[_0xf117('0x3')]();var fs_extra=require(_0xf117('0x4'));var auth=require(_0xf117('0x5'));var interaction=require(_0xf117('0x6'));var config=require(_0xf117('0x7'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0xf117('0x8')](),controller[_0xf117('0x9')]);router[_0xf117('0xa')](_0xf117('0xb'),auth[_0xf117('0x8')](),controller['describe']);router[_0xf117('0xa')](_0xf117('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf117('0xd')]('/',auth[_0xf117('0x8')](),controller[_0xf117('0xe')]);router[_0xf117('0xf')](_0xf117('0xc'),auth[_0xf117('0x8')](),controller[_0xf117('0x10')]);router[_0xf117('0x11')](_0xf117('0xc'),auth[_0xf117('0x8')](),controller[_0xf117('0x12')]);module[_0xf117('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 2b41e63..8f396fc 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 _0xd10c=['exports','STRING','DATE','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd10c,0x1c3));var _0xcd10=function(_0x3571dd,_0x22bfea){_0x3571dd=_0x3571dd-0x0;var _0xc523f9=_0xd10c[_0x3571dd];return _0xc523f9;};'use strict';var moment=require(_0xcd10('0x0'));var Sequelize=require('sequelize');module[_0xcd10('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xcd10('0x2')]},'joinAt':{'type':Sequelize[_0xcd10('0x3')]},'leaveAt':{'type':Sequelize[_0xcd10('0x3')]},'acceptAt':{'type':Sequelize[_0xcd10('0x3')]},'exitAt':{'type':Sequelize[_0xcd10('0x3')]},'reason':{'type':Sequelize[_0xcd10('0x2')]}}; \ No newline at end of file +var _0x2f45=['exports','STRING','DATE','moment','sequelize'];(function(_0x458b32,_0x2f8f95){var _0x34ea60=function(_0x4e01f5){while(--_0x4e01f5){_0x458b32['push'](_0x458b32['shift']());}};_0x34ea60(++_0x2f8f95);}(_0x2f45,0x189));var _0x52f4=function(_0x596174,_0x1cd426){_0x596174=_0x596174-0x0;var _0x56431c=_0x2f45[_0x596174];return _0x56431c;};'use strict';var moment=require(_0x52f4('0x0'));var Sequelize=require(_0x52f4('0x1'));module[_0x52f4('0x2')]={'uniqueid':{'type':Sequelize[_0x52f4('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x52f4('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x52f4('0x4')]},'acceptAt':{'type':Sequelize[_0x52f4('0x4')]},'exitAt':{'type':Sequelize[_0x52f4('0x4')]},'reason':{'type':Sequelize[_0x52f4('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 1cf869f..7b54bfc 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 _0xb5e1=['to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','includeAll','include','findAll','rows','fields','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb5e1,0x89));var _0x1b5e=function(_0x1b1681,_0x3d2541){_0x1b1681=_0x1b1681-0x0;var _0x5d465d=_0xb5e1[_0x1b1681];return _0x5d465d;};'use strict';var emlformat=require(_0x1b5e('0x0'));var rimraf=require(_0x1b5e('0x1'));var zipdir=require(_0x1b5e('0x2'));var jsonpatch=require(_0x1b5e('0x3'));var rp=require(_0x1b5e('0x4'));var moment=require(_0x1b5e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1b5e('0x6'));var util=require('util');var path=require(_0x1b5e('0x7'));var sox=require(_0x1b5e('0x8'));var csv=require(_0x1b5e('0x9'));var ejs=require(_0x1b5e('0xa'));var fs=require('fs');var fs_extra=require(_0x1b5e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1b5e('0xc'));var jsforce=require(_0x1b5e('0xd'));var deskjs=require(_0x1b5e('0xe'));var toCsv=require(_0x1b5e('0x9'));var querystring=require(_0x1b5e('0xf'));var Papa=require(_0x1b5e('0x10'));var Redis=require(_0x1b5e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1b5e('0x12'));var hardwareService=require(_0x1b5e('0x13'));var logger=require(_0x1b5e('0x14'))(_0x1b5e('0x15'));var utils=require(_0x1b5e('0x16'));var config=require(_0x1b5e('0x17'));var licenseUtil=require(_0x1b5e('0x18'));var db=require(_0x1b5e('0x19'))['db'];function respondWithStatusCode(_0x527ca9,_0x5a7a4e){_0x5a7a4e=_0x5a7a4e||0xcc;return function(_0x2ce4ce){if(_0x2ce4ce){return _0x527ca9[_0x1b5e('0x1a')](_0x5a7a4e);}return _0x527ca9[_0x1b5e('0x1b')](_0x5a7a4e)[_0x1b5e('0x1c')]();};}function respondWithResult(_0x2d4686,_0x3279af){_0x3279af=_0x3279af||0xc8;return function(_0x4cbc07){if(_0x4cbc07){return _0x2d4686[_0x1b5e('0x1b')](_0x3279af)['json'](_0x4cbc07);}};}function respondWithFilteredResult(_0x5f0d96,_0x55247a){return function(_0x213204){if(_0x213204){var _0x4fd0c7=typeof _0x55247a[_0x1b5e('0x1d')]==='undefined'&&typeof _0x55247a['limit']===_0x1b5e('0x1e');var _0x479db4=_0x213204[_0x1b5e('0x1f')];var _0x5aa19b=_0x4fd0c7?0x0:_0x55247a[_0x1b5e('0x1d')];var _0x31ed9a=_0x4fd0c7?_0x213204[_0x1b5e('0x1f')]:_0x55247a[_0x1b5e('0x1d')]+_0x55247a[_0x1b5e('0x20')];var _0x2a4155;if(_0x31ed9a>=_0x479db4){_0x31ed9a=_0x479db4;_0x2a4155=0xc8;}else{_0x2a4155=0xce;}_0x5f0d96[_0x1b5e('0x1b')](_0x2a4155);return _0x5f0d96[_0x1b5e('0x21')](_0x1b5e('0x22'),_0x5aa19b+'-'+_0x31ed9a+'/'+_0x479db4)['json'](_0x213204);}return null;};}function patchUpdates(_0x2c3c8d){return function(_0x2f416e){try{jsonpatch['apply'](_0x2f416e,_0x2c3c8d,!![]);}catch(_0x4da655){return BPromise['reject'](_0x4da655);}return _0x2f416e[_0x1b5e('0x23')]();};}function saveUpdates(_0x352591,_0x5e319b){return function(_0x584d5c){if(_0x584d5c){return _0x584d5c[_0x1b5e('0x24')](_0x352591)[_0x1b5e('0x25')](function(_0x16992b){return _0x16992b;});}return null;};}function removeEntity(_0x5f7641,_0x123788){return function(_0x48339b){if(_0x48339b){return _0x48339b[_0x1b5e('0x26')]()[_0x1b5e('0x25')](function(){_0x5f7641[_0x1b5e('0x1b')](0xcc)[_0x1b5e('0x1c')]();});}};}function handleEntityNotFound(_0xb40e1a,_0x55086b){return function(_0x3b2834){if(!_0x3b2834){_0xb40e1a['sendStatus'](0x194);}return _0x3b2834;};}function handleError(_0x8271ed,_0x357d42){_0x357d42=_0x357d42||0x1f4;return function(_0x33afa0){logger[_0x1b5e('0x27')](_0x33afa0[_0x1b5e('0x28')]);if(_0x33afa0[_0x1b5e('0x29')]){delete _0x33afa0[_0x1b5e('0x29')];}_0x8271ed[_0x1b5e('0x1b')](_0x357d42)[_0x1b5e('0x2a')](_0x33afa0);};}exports[_0x1b5e('0x2b')]=function(_0x376afb,_0x33eaba){var _0x5d2f91={},_0x5a4934={},_0x46b29d={'count':0x0,'rows':[]};var _0x301230=_[_0x1b5e('0x2c')](db[_0x1b5e('0x2d')]['rawAttributes'],function(_0x2d9715){return{'name':_0x2d9715[_0x1b5e('0x2e')],'type':_0x2d9715['type'][_0x1b5e('0x2f')]};});_0x5a4934[_0x1b5e('0x30')]=_[_0x1b5e('0x2c')](_0x301230,_0x1b5e('0x29'));_0x5a4934['query']=_[_0x1b5e('0x31')](_0x376afb[_0x1b5e('0x32')]);_0x5a4934[_0x1b5e('0x33')]=_['intersection'](_0x5a4934[_0x1b5e('0x30')],_0x5a4934[_0x1b5e('0x32')]);_0x5d2f91['attributes']=_[_0x1b5e('0x34')](_0x5a4934[_0x1b5e('0x30')],qs['fields'](_0x376afb[_0x1b5e('0x32')]['fields']));_0x5d2f91[_0x1b5e('0x35')]=_0x5d2f91[_0x1b5e('0x35')][_0x1b5e('0x36')]?_0x5d2f91[_0x1b5e('0x35')]:_0x5a4934[_0x1b5e('0x30')];if(!_0x376afb[_0x1b5e('0x32')][_0x1b5e('0x37')](_0x1b5e('0x38'))){_0x5d2f91['limit']=qs[_0x1b5e('0x20')](_0x376afb['query']['limit']);_0x5d2f91['offset']=qs[_0x1b5e('0x1d')](_0x376afb['query'][_0x1b5e('0x1d')]);}_0x5d2f91[_0x1b5e('0x39')]=qs[_0x1b5e('0x3a')](_0x376afb[_0x1b5e('0x32')][_0x1b5e('0x3a')]);_0x5d2f91[_0x1b5e('0x3b')]=qs['filters'](_['pick'](_0x376afb['query'],_0x5a4934[_0x1b5e('0x33')]),_0x301230);if(_0x376afb[_0x1b5e('0x32')][_0x1b5e('0x3c')]){_0x5d2f91['where']=_[_0x1b5e('0x3d')](_0x5d2f91[_0x1b5e('0x3b')],{'$or':_[_0x1b5e('0x2c')](_0x301230,function(_0x421cad){if(_0x421cad[_0x1b5e('0x3e')]!=='VIRTUAL'){var _0x22b0b1={};_0x22b0b1[_0x421cad[_0x1b5e('0x29')]]={'$like':'%'+_0x376afb[_0x1b5e('0x32')][_0x1b5e('0x3c')]+'%'};return _0x22b0b1;}})});}_0x5d2f91=_[_0x1b5e('0x3d')]({},_0x5d2f91,_0x376afb['options']);var _0x49fed8={'where':_0x5d2f91['where']};return db[_0x1b5e('0x2d')]['count'](_0x49fed8)[_0x1b5e('0x25')](function(_0x506b2d){_0x46b29d[_0x1b5e('0x1f')]=_0x506b2d;if(_0x376afb[_0x1b5e('0x32')][_0x1b5e('0x3f')]){_0x5d2f91[_0x1b5e('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x1b5e('0x41')](_0x5d2f91);})[_0x1b5e('0x25')](function(_0x4f015){_0x46b29d[_0x1b5e('0x42')]=_0x4f015;return _0x46b29d;})[_0x1b5e('0x25')](respondWithFilteredResult(_0x33eaba,_0x5d2f91))['catch'](handleError(_0x33eaba,null));};exports['show']=function(_0x23633b,_0x4c240b){var _0x2e472c={'raw':!![],'where':{'id':_0x23633b['params']['id']}},_0x2d9569={};_0x2d9569[_0x1b5e('0x30')]=_[_0x1b5e('0x31')](db[_0x1b5e('0x2d')]['rawAttributes']);_0x2d9569[_0x1b5e('0x32')]=_[_0x1b5e('0x31')](_0x23633b['query']);_0x2d9569[_0x1b5e('0x33')]=_[_0x1b5e('0x34')](_0x2d9569[_0x1b5e('0x30')],_0x2d9569[_0x1b5e('0x32')]);_0x2e472c[_0x1b5e('0x35')]=_[_0x1b5e('0x34')](_0x2d9569[_0x1b5e('0x30')],qs['fields'](_0x23633b[_0x1b5e('0x32')][_0x1b5e('0x43')]));_0x2e472c[_0x1b5e('0x35')]=_0x2e472c['attributes'][_0x1b5e('0x36')]?_0x2e472c[_0x1b5e('0x35')]:_0x2d9569['model'];if(_0x23633b[_0x1b5e('0x32')]['includeAll']){_0x2e472c[_0x1b5e('0x40')]=[{'all':!![]}];}_0x2e472c=_['merge']({},_0x2e472c,_0x23633b['options']);return db[_0x1b5e('0x2d')][_0x1b5e('0x44')](_0x2e472c)[_0x1b5e('0x25')](handleEntityNotFound(_0x4c240b,null))[_0x1b5e('0x25')](respondWithResult(_0x4c240b,null))[_0x1b5e('0x45')](handleError(_0x4c240b,null));};exports[_0x1b5e('0x46')]=function(_0x2bf56f,_0x17d98f){return db[_0x1b5e('0x2d')][_0x1b5e('0x46')](_0x2bf56f['body'],{})[_0x1b5e('0x25')](respondWithResult(_0x17d98f,0xc9))[_0x1b5e('0x45')](handleError(_0x17d98f,null));};exports[_0x1b5e('0x24')]=function(_0x101ab2,_0x2ffc26){if(_0x101ab2[_0x1b5e('0x47')]['id']){delete _0x101ab2[_0x1b5e('0x47')]['id'];}return db[_0x1b5e('0x2d')][_0x1b5e('0x44')]({'where':{'id':_0x101ab2['params']['id']}})['then'](handleEntityNotFound(_0x2ffc26,null))[_0x1b5e('0x25')](saveUpdates(_0x101ab2[_0x1b5e('0x47')],null))[_0x1b5e('0x25')](respondWithResult(_0x2ffc26,null))[_0x1b5e('0x45')](handleError(_0x2ffc26,null));};exports[_0x1b5e('0x26')]=function(_0x51af1b,_0x3e028f){return db[_0x1b5e('0x2d')][_0x1b5e('0x44')]({'where':{'id':_0x51af1b['params']['id']}})[_0x1b5e('0x25')](handleEntityNotFound(_0x3e028f,null))[_0x1b5e('0x25')](removeEntity(_0x3e028f,null))[_0x1b5e('0x45')](handleError(_0x3e028f,null));};exports['describe']=function(_0x1a91bb,_0x420e09){return db[_0x1b5e('0x2d')][_0x1b5e('0x48')]()[_0x1b5e('0x25')](respondWithResult(_0x420e09,null))['catch'](handleError(_0x420e09,null));}; \ No newline at end of file +var _0x3bcf=['map','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','rows','catch','show','fields','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','reject','save','update','destroy','then','sendStatus','stack','name','OpenchannelQueueReport','rawAttributes','fieldName','type','model'];(function(_0x16f145,_0x10b782){var _0x234cc5=function(_0x75e369){while(--_0x75e369){_0x16f145['push'](_0x16f145['shift']());}};_0x234cc5(++_0x10b782);}(_0x3bcf,0x179));var _0xf3bc=function(_0x3483d5,_0x4dfa06){_0x3483d5=_0x3483d5-0x0;var _0x36ab6b=_0x3bcf[_0x3483d5];return _0x36ab6b;};'use strict';var emlformat=require(_0xf3bc('0x0'));var rimraf=require(_0xf3bc('0x1'));var zipdir=require(_0xf3bc('0x2'));var jsonpatch=require(_0xf3bc('0x3'));var rp=require('request-promise');var moment=require(_0xf3bc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf3bc('0x5'));var sox=require(_0xf3bc('0x6'));var csv=require('to-csv');var ejs=require(_0xf3bc('0x7'));var fs=require('fs');var fs_extra=require(_0xf3bc('0x8'));var _=require(_0xf3bc('0x9'));var squel=require(_0xf3bc('0xa'));var crypto=require(_0xf3bc('0xb'));var jsforce=require(_0xf3bc('0xc'));var deskjs=require(_0xf3bc('0xd'));var toCsv=require(_0xf3bc('0xe'));var querystring=require('querystring');var Papa=require(_0xf3bc('0xf'));var Redis=require(_0xf3bc('0x10'));var authService=require(_0xf3bc('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf3bc('0x12'));var logger=require('../../config/logger')(_0xf3bc('0x13'));var utils=require(_0xf3bc('0x14'));var config=require(_0xf3bc('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3bc('0x16'))['db'];function respondWithStatusCode(_0xb0ea5f,_0x26115d){_0x26115d=_0x26115d||0xcc;return function(_0x335d6f){if(_0x335d6f){return _0xb0ea5f['sendStatus'](_0x26115d);}return _0xb0ea5f[_0xf3bc('0x17')](_0x26115d)[_0xf3bc('0x18')]();};}function respondWithResult(_0xa02e68,_0x486e72){_0x486e72=_0x486e72||0xc8;return function(_0x6b0c26){if(_0x6b0c26){return _0xa02e68[_0xf3bc('0x17')](_0x486e72)['json'](_0x6b0c26);}};}function respondWithFilteredResult(_0x398e3,_0x4ac915){return function(_0x4572dd){if(_0x4572dd){var _0xed9ce0=typeof _0x4ac915[_0xf3bc('0x19')]===_0xf3bc('0x1a')&&typeof _0x4ac915['limit']==='undefined';var _0xf50d1=_0x4572dd[_0xf3bc('0x1b')];var _0xe8c0a3=_0xed9ce0?0x0:_0x4ac915[_0xf3bc('0x19')];var _0x27b8ac=_0xed9ce0?_0x4572dd[_0xf3bc('0x1b')]:_0x4ac915[_0xf3bc('0x19')]+_0x4ac915[_0xf3bc('0x1c')];var _0x44d7a6;if(_0x27b8ac>=_0xf50d1){_0x27b8ac=_0xf50d1;_0x44d7a6=0xc8;}else{_0x44d7a6=0xce;}_0x398e3[_0xf3bc('0x17')](_0x44d7a6);return _0x398e3[_0xf3bc('0x1d')]('Content-Range',_0xe8c0a3+'-'+_0x27b8ac+'/'+_0xf50d1)['json'](_0x4572dd);}return null;};}function patchUpdates(_0x5b2ad9){return function(_0x292c14){try{jsonpatch['apply'](_0x292c14,_0x5b2ad9,!![]);}catch(_0x350273){return BPromise[_0xf3bc('0x1e')](_0x350273);}return _0x292c14[_0xf3bc('0x1f')]();};}function saveUpdates(_0x22c696,_0x3f154f){return function(_0x12aaa5){if(_0x12aaa5){return _0x12aaa5[_0xf3bc('0x20')](_0x22c696)['then'](function(_0x1a4435){return _0x1a4435;});}return null;};}function removeEntity(_0xc8c097,_0x3ad2ca){return function(_0x411034){if(_0x411034){return _0x411034[_0xf3bc('0x21')]()[_0xf3bc('0x22')](function(){_0xc8c097[_0xf3bc('0x17')](0xcc)[_0xf3bc('0x18')]();});}};}function handleEntityNotFound(_0x50f1f2,_0x4de375){return function(_0x1da840){if(!_0x1da840){_0x50f1f2[_0xf3bc('0x23')](0x194);}return _0x1da840;};}function handleError(_0x17f056,_0x3ba297){_0x3ba297=_0x3ba297||0x1f4;return function(_0x594593){logger['error'](_0x594593[_0xf3bc('0x24')]);if(_0x594593[_0xf3bc('0x25')]){delete _0x594593[_0xf3bc('0x25')];}_0x17f056['status'](_0x3ba297)['send'](_0x594593);};}exports['index']=function(_0x222aa,_0x8ff52c){var _0x4568a3={},_0x43dc12={},_0x7cbfe3={'count':0x0,'rows':[]};var _0x52504b=_['map'](db[_0xf3bc('0x26')][_0xf3bc('0x27')],function(_0x16c5e6){return{'name':_0x16c5e6[_0xf3bc('0x28')],'type':_0x16c5e6[_0xf3bc('0x29')]['key']};});_0x43dc12[_0xf3bc('0x2a')]=_[_0xf3bc('0x2b')](_0x52504b,_0xf3bc('0x25'));_0x43dc12[_0xf3bc('0x2c')]=_[_0xf3bc('0x2d')](_0x222aa[_0xf3bc('0x2c')]);_0x43dc12[_0xf3bc('0x2e')]=_['intersection'](_0x43dc12[_0xf3bc('0x2a')],_0x43dc12['query']);_0x4568a3[_0xf3bc('0x2f')]=_[_0xf3bc('0x30')](_0x43dc12[_0xf3bc('0x2a')],qs['fields'](_0x222aa['query']['fields']));_0x4568a3[_0xf3bc('0x2f')]=_0x4568a3[_0xf3bc('0x2f')][_0xf3bc('0x31')]?_0x4568a3[_0xf3bc('0x2f')]:_0x43dc12[_0xf3bc('0x2a')];if(!_0x222aa[_0xf3bc('0x2c')][_0xf3bc('0x32')](_0xf3bc('0x33'))){_0x4568a3['limit']=qs['limit'](_0x222aa['query'][_0xf3bc('0x1c')]);_0x4568a3[_0xf3bc('0x19')]=qs[_0xf3bc('0x19')](_0x222aa[_0xf3bc('0x2c')]['offset']);}_0x4568a3[_0xf3bc('0x34')]=qs[_0xf3bc('0x35')](_0x222aa[_0xf3bc('0x2c')][_0xf3bc('0x35')]);_0x4568a3['where']=qs['filters'](_[_0xf3bc('0x36')](_0x222aa[_0xf3bc('0x2c')],_0x43dc12[_0xf3bc('0x2e')]),_0x52504b);if(_0x222aa[_0xf3bc('0x2c')][_0xf3bc('0x37')]){_0x4568a3[_0xf3bc('0x38')]=_['merge'](_0x4568a3[_0xf3bc('0x38')],{'$or':_[_0xf3bc('0x2b')](_0x52504b,function(_0x1b0247){if(_0x1b0247[_0xf3bc('0x29')]!==_0xf3bc('0x39')){var _0x295c97={};_0x295c97[_0x1b0247[_0xf3bc('0x25')]]={'$like':'%'+_0x222aa[_0xf3bc('0x2c')]['filter']+'%'};return _0x295c97;}})});}_0x4568a3=_[_0xf3bc('0x3a')]({},_0x4568a3,_0x222aa['options']);var _0x3c3ae4={'where':_0x4568a3[_0xf3bc('0x38')]};return db[_0xf3bc('0x26')]['count'](_0x3c3ae4)[_0xf3bc('0x22')](function(_0x10ae73){_0x7cbfe3[_0xf3bc('0x1b')]=_0x10ae73;if(_0x222aa[_0xf3bc('0x2c')][_0xf3bc('0x3b')]){_0x4568a3[_0xf3bc('0x3c')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x4568a3);})[_0xf3bc('0x22')](function(_0x3d954e){_0x7cbfe3[_0xf3bc('0x3d')]=_0x3d954e;return _0x7cbfe3;})['then'](respondWithFilteredResult(_0x8ff52c,_0x4568a3))[_0xf3bc('0x3e')](handleError(_0x8ff52c,null));};exports[_0xf3bc('0x3f')]=function(_0xbf51aa,_0x3bcd8c){var _0x4e443b={'raw':!![],'where':{'id':_0xbf51aa['params']['id']}},_0x14b140={};_0x14b140[_0xf3bc('0x2a')]=_[_0xf3bc('0x2d')](db[_0xf3bc('0x26')][_0xf3bc('0x27')]);_0x14b140['query']=_[_0xf3bc('0x2d')](_0xbf51aa[_0xf3bc('0x2c')]);_0x14b140['filters']=_[_0xf3bc('0x30')](_0x14b140[_0xf3bc('0x2a')],_0x14b140[_0xf3bc('0x2c')]);_0x4e443b[_0xf3bc('0x2f')]=_[_0xf3bc('0x30')](_0x14b140[_0xf3bc('0x2a')],qs[_0xf3bc('0x40')](_0xbf51aa[_0xf3bc('0x2c')]['fields']));_0x4e443b[_0xf3bc('0x2f')]=_0x4e443b[_0xf3bc('0x2f')][_0xf3bc('0x31')]?_0x4e443b[_0xf3bc('0x2f')]:_0x14b140['model'];if(_0xbf51aa[_0xf3bc('0x2c')][_0xf3bc('0x3b')]){_0x4e443b[_0xf3bc('0x3c')]=[{'all':!![]}];}_0x4e443b=_[_0xf3bc('0x3a')]({},_0x4e443b,_0xbf51aa['options']);return db[_0xf3bc('0x26')][_0xf3bc('0x41')](_0x4e443b)[_0xf3bc('0x22')](handleEntityNotFound(_0x3bcd8c,null))[_0xf3bc('0x22')](respondWithResult(_0x3bcd8c,null))[_0xf3bc('0x3e')](handleError(_0x3bcd8c,null));};exports[_0xf3bc('0x42')]=function(_0x2e5df3,_0x4dbffd){return db[_0xf3bc('0x26')][_0xf3bc('0x42')](_0x2e5df3[_0xf3bc('0x43')],{})['then'](respondWithResult(_0x4dbffd,0xc9))[_0xf3bc('0x3e')](handleError(_0x4dbffd,null));};exports[_0xf3bc('0x20')]=function(_0x5b6ead,_0x26a9d7){if(_0x5b6ead[_0xf3bc('0x43')]['id']){delete _0x5b6ead['body']['id'];}return db[_0xf3bc('0x26')][_0xf3bc('0x41')]({'where':{'id':_0x5b6ead[_0xf3bc('0x44')]['id']}})[_0xf3bc('0x22')](handleEntityNotFound(_0x26a9d7,null))['then'](saveUpdates(_0x5b6ead[_0xf3bc('0x43')],null))['then'](respondWithResult(_0x26a9d7,null))['catch'](handleError(_0x26a9d7,null));};exports[_0xf3bc('0x21')]=function(_0x52256e,_0x45288d){return db[_0xf3bc('0x26')][_0xf3bc('0x41')]({'where':{'id':_0x52256e[_0xf3bc('0x44')]['id']}})[_0xf3bc('0x22')](handleEntityNotFound(_0x45288d,null))[_0xf3bc('0x22')](removeEntity(_0x45288d,null))['catch'](handleError(_0x45288d,null));};exports[_0xf3bc('0x45')]=function(_0x4164b3,_0x14eaa6){return db['OpenchannelQueueReport'][_0xf3bc('0x45')]()[_0xf3bc('0x22')](respondWithResult(_0x14eaa6,null))[_0xf3bc('0x3e')](handleError(_0x14eaa6,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 5d16ecd..781189d 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x814b,0x1a2));var _0xb814=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0x814b[_0x4ab3fb];return _0x34fe1e;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0x814b,0x1a2));var _0xb814=function(_0x300c89,_0x25fcad){_0x300c89=_0x300c89-0x0;var _0x41762e=_0x814b[_0x300c89];return _0x41762e;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 5f77cb5..51cac7a 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 _0xa866=['catch','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result'];(function(_0x297a98,_0x41b89c){var _0x320676=function(_0x11c69d){while(--_0x11c69d){_0x297a98['push'](_0x297a98['shift']());}};_0x320676(++_0x41b89c);}(_0xa866,0x6a));var _0x6a86=function(_0x533df5,_0xba416c){_0x533df5=_0x533df5-0x0;var _0x45a54f=_0xa866[_0x533df5];return _0x45a54f;};'use strict';var _=require(_0x6a86('0x0'));var util=require(_0x6a86('0x1'));var moment=require(_0x6a86('0x2'));var BPromise=require(_0x6a86('0x3'));var rs=require(_0x6a86('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a86('0x5'))['db'];var utils=require(_0x6a86('0x6'));var logger=require(_0x6a86('0x7'))('rpc');var config=require(_0x6a86('0x8'));var jayson=require(_0x6a86('0x9'));var client=jayson[_0x6a86('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183997,_0x288910,_0x3ed589){return new BPromise(function(_0x1330e1,_0x37e3ee){return client[_0x6a86('0xb')](_0x183997,_0x3ed589)[_0x6a86('0xc')](function(_0x4a83c9){logger[_0x6a86('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x288910,_0x6a86('0xe'));logger[_0x6a86('0xf')](_0x6a86('0x10'),_0x288910,'request\x20sent',JSON[_0x6a86('0x11')](_0x4a83c9));if(_0x4a83c9[_0x6a86('0x12')]){if(_0x4a83c9['error']['code']===0x1f4){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);return _0x37e3ee(_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);}logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9['error'][_0x6a86('0x14')]);return _0x1330e1(_0x4a83c9[_0x6a86('0x12')]['message']);}else{logger[_0x6a86('0xd')](_0x6a86('0x13'),_0x288910,_0x6a86('0xe'));_0x1330e1(_0x4a83c9[_0x6a86('0x15')][_0x6a86('0x14')]);}})[_0x6a86('0x16')](function(_0x500b59){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x500b59);_0x37e3ee(_0x500b59);});});}exports['CreateOpenchannelQueueReport']=function(_0x50024d){var _0x11fe3b=this;return new Promise(function(_0x535fd9,_0x588a2f){return db[_0x6a86('0x17')][_0x6a86('0x18')](_0x50024d[_0x6a86('0x19')],{'raw':_0x50024d['options']?_0x50024d[_0x6a86('0x1a')][_0x6a86('0x1b')]===undefined?!![]:![]:!![]})[_0x6a86('0xc')](function(_0x262bf5){logger[_0x6a86('0xd')](_0x6a86('0x1c'),_0x50024d);logger['debug']('CreateOpenchannelQueueReport',_0x50024d,JSON['stringify'](_0x262bf5));_0x535fd9(_0x262bf5);})[_0x6a86('0x16')](function(_0x2007c7){logger[_0x6a86('0x12')](_0x6a86('0x1c'),_0x2007c7['message'],_0x50024d);_0x588a2f(_0x11fe3b[_0x6a86('0x12')](0x1f4,_0x2007c7[_0x6a86('0x14')]));});});};exports[_0x6a86('0x1d')]=function(_0x3f2b70){var _0x19382d=this;return new Promise(function(_0x1c41a7,_0x46f6c7){return db[_0x6a86('0x17')][_0x6a86('0x1e')](_0x3f2b70['body'],{'raw':_0x3f2b70['options']?_0x3f2b70[_0x6a86('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f2b70[_0x6a86('0x1a')]?_0x3f2b70[_0x6a86('0x1a')]['where']||null:null,'attributes':_0x3f2b70[_0x6a86('0x1a')]?_0x3f2b70[_0x6a86('0x1a')][_0x6a86('0x1f')]||null:null,'limit':_0x3f2b70['options']?_0x3f2b70[_0x6a86('0x1a')]['limit']||null:null})['then'](function(_0x4d8bf0){logger[_0x6a86('0xd')](_0x6a86('0x1d'),_0x3f2b70);logger[_0x6a86('0xf')]('UpdateOpenchannelQueueReport',_0x3f2b70,JSON[_0x6a86('0x11')](_0x4d8bf0));_0x1c41a7(_0x4d8bf0);})[_0x6a86('0x16')](function(_0x1bb745){logger[_0x6a86('0x12')]('UpdateOpenchannelQueueReport',_0x1bb745[_0x6a86('0x14')],_0x3f2b70);_0x46f6c7(_0x19382d['error'](0x1f4,_0x1bb745[_0x6a86('0x14')]));});});}; \ No newline at end of file +var _0xde9f=['client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','OpenchannelQueueReport','options','raw','CreateOpenchannelQueueReport','catch','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xde9f,0x118));var _0xfde9=function(_0x2ecb67,_0x8ec62d){_0x2ecb67=_0x2ecb67-0x0;var _0x168079=_0xde9f[_0x2ecb67];return _0x168079;};'use strict';var _=require(_0xfde9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfde9('0x1'));var rs=require(_0xfde9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfde9('0x3'))['db'];var utils=require(_0xfde9('0x4'));var logger=require('../../config/logger')(_0xfde9('0x5'));var config=require(_0xfde9('0x6'));var jayson=require(_0xfde9('0x7'));var client=jayson[_0xfde9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c3e01,_0x179ee0,_0x18a202){return new BPromise(function(_0x5569c2,_0x19a337){return client[_0xfde9('0x9')](_0x4c3e01,_0x18a202)[_0xfde9('0xa')](function(_0x3b775d){logger[_0xfde9('0xb')](_0xfde9('0xc'),_0x179ee0,_0xfde9('0xd'));logger[_0xfde9('0xe')](_0xfde9('0xf'),_0x179ee0,_0xfde9('0xd'),JSON[_0xfde9('0x10')](_0x3b775d));if(_0x3b775d[_0xfde9('0x11')]){if(_0x3b775d[_0xfde9('0x11')][_0xfde9('0x12')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x179ee0,_0x3b775d[_0xfde9('0x11')][_0xfde9('0x13')]);return _0x19a337(_0x3b775d[_0xfde9('0x11')][_0xfde9('0x13')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x179ee0,_0x3b775d[_0xfde9('0x11')][_0xfde9('0x13')]);return _0x5569c2(_0x3b775d[_0xfde9('0x11')][_0xfde9('0x13')]);}else{logger[_0xfde9('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x179ee0,_0xfde9('0xd'));_0x5569c2(_0x3b775d[_0xfde9('0x14')][_0xfde9('0x13')]);}})['catch'](function(_0x31b1c7){logger[_0xfde9('0x11')](_0xfde9('0xc'),_0x179ee0,_0x31b1c7);_0x19a337(_0x31b1c7);});});}exports['CreateOpenchannelQueueReport']=function(_0x4c9f24){var _0x5eb89e=this;return new Promise(function(_0x544f19,_0x166f1c){return db[_0xfde9('0x15')]['create'](_0x4c9f24['body'],{'raw':_0x4c9f24[_0xfde9('0x16')]?_0x4c9f24[_0xfde9('0x16')][_0xfde9('0x17')]===undefined?!![]:![]:!![]})[_0xfde9('0xa')](function(_0x162b07){logger[_0xfde9('0xb')](_0xfde9('0x18'),_0x4c9f24);logger[_0xfde9('0xe')](_0xfde9('0x18'),_0x4c9f24,JSON[_0xfde9('0x10')](_0x162b07));_0x544f19(_0x162b07);})[_0xfde9('0x19')](function(_0x28d189){logger['error'](_0xfde9('0x18'),_0x28d189['message'],_0x4c9f24);_0x166f1c(_0x5eb89e[_0xfde9('0x11')](0x1f4,_0x28d189[_0xfde9('0x13')]));});});};exports[_0xfde9('0x1a')]=function(_0x5d0a74){var _0x12e3e7=this;return new Promise(function(_0x10e809,_0x53733b){return db[_0xfde9('0x15')][_0xfde9('0x1b')](_0x5d0a74[_0xfde9('0x1c')],{'raw':_0x5d0a74[_0xfde9('0x16')]?_0x5d0a74[_0xfde9('0x16')][_0xfde9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d0a74[_0xfde9('0x16')]?_0x5d0a74[_0xfde9('0x16')][_0xfde9('0x1d')]||null:null,'attributes':_0x5d0a74[_0xfde9('0x16')]?_0x5d0a74[_0xfde9('0x16')][_0xfde9('0x1e')]||null:null,'limit':_0x5d0a74[_0xfde9('0x16')]?_0x5d0a74[_0xfde9('0x16')][_0xfde9('0x1f')]||null:null})[_0xfde9('0xa')](function(_0x4b7956){logger['info'](_0xfde9('0x1a'),_0x5d0a74);logger[_0xfde9('0xe')]('UpdateOpenchannelQueueReport',_0x5d0a74,JSON[_0xfde9('0x10')](_0x4b7956));_0x10e809(_0x4b7956);})[_0xfde9('0x19')](function(_0x1651e0){logger[_0xfde9('0x11')](_0xfde9('0x1a'),_0x1651e0['message'],_0x5d0a74);_0x53733b(_0x12e3e7[_0xfde9('0x11')](0x1f4,_0x1651e0[_0xfde9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 30c51b4..c71a987 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 _0x1d8e=['create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x45943c,_0x292e90){var _0xe1cf98=function(_0x4ba1ae){while(--_0x4ba1ae){_0x45943c['push'](_0x45943c['shift']());}};_0xe1cf98(++_0x292e90);}(_0x1d8e,0x83));var _0xe1d8=function(_0x179b53,_0x31f6fe){_0x179b53=_0x179b53-0x0;var _0x38a146=_0x1d8e[_0x179b53];return _0x38a146;};'use strict';var multer=require(_0xe1d8('0x0'));var util=require(_0xe1d8('0x1'));var path=require(_0xe1d8('0x2'));var timeout=require(_0xe1d8('0x3'));var express=require('express');var router=express[_0xe1d8('0x4')]();var fs_extra=require(_0xe1d8('0x5'));var auth=require(_0xe1d8('0x6'));var interaction=require(_0xe1d8('0x7'));var config=require(_0xe1d8('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0xe1d8('0x9')]('/',auth[_0xe1d8('0xa')](),controller['index']);router[_0xe1d8('0x9')](_0xe1d8('0xb'),auth['isAuthenticated'](),controller[_0xe1d8('0xc')]);router[_0xe1d8('0x9')](_0xe1d8('0xd'),auth[_0xe1d8('0xa')](),controller[_0xe1d8('0xe')]);router[_0xe1d8('0xf')]('/',auth[_0xe1d8('0xa')](),controller[_0xe1d8('0x10')]);router[_0xe1d8('0x11')]('/:id',auth[_0xe1d8('0xa')](),controller[_0xe1d8('0x12')]);router[_0xe1d8('0x13')](_0xe1d8('0xd'),auth[_0xe1d8('0xa')](),controller['destroy']);module[_0xe1d8('0x14')]=router; \ No newline at end of file +var _0xcbd8=['../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x19fce5,_0x3414ad){var _0x2be1f2=function(_0x4fd05a){while(--_0x4fd05a){_0x19fce5['push'](_0x19fce5['shift']());}};_0x2be1f2(++_0x3414ad);}(_0xcbd8,0x1c7));var _0x8cbd=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xcbd8[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x8cbd('0x0'));var util=require(_0x8cbd('0x1'));var path=require(_0x8cbd('0x2'));var timeout=require(_0x8cbd('0x3'));var express=require(_0x8cbd('0x4'));var router=express[_0x8cbd('0x5')]();var fs_extra=require(_0x8cbd('0x6'));var auth=require(_0x8cbd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8cbd('0x8'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8cbd('0x9')](_0x8cbd('0xa'),auth[_0x8cbd('0xb')](),controller[_0x8cbd('0xc')]);router[_0x8cbd('0x9')](_0x8cbd('0xd'),auth[_0x8cbd('0xb')](),controller[_0x8cbd('0xe')]);router[_0x8cbd('0xf')]('/',auth[_0x8cbd('0xb')](),controller[_0x8cbd('0x10')]);router[_0x8cbd('0x11')](_0x8cbd('0xd'),auth[_0x8cbd('0xb')](),controller[_0x8cbd('0x12')]);router['delete'](_0x8cbd('0xd'),auth[_0x8cbd('0xb')](),controller[_0x8cbd('0x13')]);module[_0x8cbd('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 5398ca0..9a2ef88 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5ad309,_0x5d2d75){_0x5ad309=_0x5ad309-0x0;var _0x2c2fc0=_0x9bde[_0x5ad309];return _0x2c2fc0;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 3c51a20..930dfa5 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 _0x11db=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','name','send','index','OpenchannelTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','update','body','describe','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0x11db,0x116));var _0xb11d=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0x11db[_0x1034bb];return _0x453fdb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb11d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb11d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb11d('0x2'));var util=require(_0xb11d('0x3'));var path=require(_0xb11d('0x4'));var sox=require(_0xb11d('0x5'));var csv=require(_0xb11d('0x6'));var ejs=require(_0xb11d('0x7'));var fs=require('fs');var fs_extra=require(_0xb11d('0x8'));var _=require(_0xb11d('0x9'));var squel=require(_0xb11d('0xa'));var crypto=require('crypto');var jsforce=require(_0xb11d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb11d('0x6'));var querystring=require(_0xb11d('0xc'));var Papa=require(_0xb11d('0xd'));var Redis=require(_0xb11d('0xe'));var authService=require(_0xb11d('0xf'));var qs=require(_0xb11d('0x10'));var as=require(_0xb11d('0x11'));var hardwareService=require(_0xb11d('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xb11d('0x13'));var config=require(_0xb11d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb11d('0x15'))['db'];function respondWithStatusCode(_0x14c180,_0x37dc9e){_0x37dc9e=_0x37dc9e||0xcc;return function(_0x510e5f){if(_0x510e5f){return _0x14c180['sendStatus'](_0x37dc9e);}return _0x14c180[_0xb11d('0x16')](_0x37dc9e)[_0xb11d('0x17')]();};}function respondWithResult(_0x3978f3,_0x35cdd0){_0x35cdd0=_0x35cdd0||0xc8;return function(_0xa1c5a7){if(_0xa1c5a7){return _0x3978f3['status'](_0x35cdd0)['json'](_0xa1c5a7);}};}function respondWithFilteredResult(_0x59d452,_0x5389b8){return function(_0x49b7ac){if(_0x49b7ac){var _0x479b27=typeof _0x5389b8['offset']===_0xb11d('0x18')&&typeof _0x5389b8[_0xb11d('0x19')]===_0xb11d('0x18');var _0x4e0c2d=_0x49b7ac[_0xb11d('0x1a')];var _0x3b33e4=_0x479b27?0x0:_0x5389b8[_0xb11d('0x1b')];var _0x1f253e=_0x479b27?_0x49b7ac['count']:_0x5389b8['offset']+_0x5389b8['limit'];var _0x4aa026;if(_0x1f253e>=_0x4e0c2d){_0x1f253e=_0x4e0c2d;_0x4aa026=0xc8;}else{_0x4aa026=0xce;}_0x59d452['status'](_0x4aa026);return _0x59d452[_0xb11d('0x1c')](_0xb11d('0x1d'),_0x3b33e4+'-'+_0x1f253e+'/'+_0x4e0c2d)[_0xb11d('0x1e')](_0x49b7ac);}return null;};}function patchUpdates(_0x2460d5){return function(_0x26054f){try{jsonpatch[_0xb11d('0x1f')](_0x26054f,_0x2460d5,!![]);}catch(_0x5bbf28){return BPromise[_0xb11d('0x20')](_0x5bbf28);}return _0x26054f[_0xb11d('0x21')]();};}function saveUpdates(_0x2eec8c,_0x26e2c1){return function(_0x46c1e2){if(_0x46c1e2){return _0x46c1e2['update'](_0x2eec8c)[_0xb11d('0x22')](function(_0x526e95){return _0x526e95;});}return null;};}function removeEntity(_0x4c673f,_0x1b427f){return function(_0xf47139){if(_0xf47139){return _0xf47139[_0xb11d('0x23')]()[_0xb11d('0x22')](function(){_0x4c673f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x593bf7,_0x3e43d9){return function(_0x72d06d){if(!_0x72d06d){_0x593bf7[_0xb11d('0x24')](0x194);}return _0x72d06d;};}function handleError(_0x3e9df1,_0x28bb41){_0x28bb41=_0x28bb41||0x1f4;return function(_0x55e172){logger['error'](_0x55e172['stack']);if(_0x55e172[_0xb11d('0x25')]){delete _0x55e172[_0xb11d('0x25')];}_0x3e9df1[_0xb11d('0x16')](_0x28bb41)[_0xb11d('0x26')](_0x55e172);};}exports[_0xb11d('0x27')]=function(_0x2fc6f1,_0x2910ad){var _0x5abe11={},_0x52c0e3={},_0x3de0f8={'count':0x0,'rows':[]};var _0x2372c4=_['map'](db[_0xb11d('0x28')]['rawAttributes'],function(_0x3843b0){return{'name':_0x3843b0[_0xb11d('0x29')],'type':_0x3843b0[_0xb11d('0x2a')][_0xb11d('0x2b')]};});_0x52c0e3[_0xb11d('0x2c')]=_['map'](_0x2372c4,_0xb11d('0x25'));_0x52c0e3[_0xb11d('0x2d')]=_[_0xb11d('0x2e')](_0x2fc6f1['query']);_0x52c0e3[_0xb11d('0x2f')]=_[_0xb11d('0x30')](_0x52c0e3[_0xb11d('0x2c')],_0x52c0e3[_0xb11d('0x2d')]);_0x5abe11['attributes']=_['intersection'](_0x52c0e3[_0xb11d('0x2c')],qs[_0xb11d('0x31')](_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x31')]));_0x5abe11[_0xb11d('0x32')]=_0x5abe11[_0xb11d('0x32')][_0xb11d('0x33')]?_0x5abe11[_0xb11d('0x32')]:_0x52c0e3[_0xb11d('0x2c')];if(!_0x2fc6f1['query']['hasOwnProperty'](_0xb11d('0x34'))){_0x5abe11[_0xb11d('0x19')]=qs[_0xb11d('0x19')](_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x19')]);_0x5abe11[_0xb11d('0x1b')]=qs[_0xb11d('0x1b')](_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x1b')]);}_0x5abe11[_0xb11d('0x35')]=qs[_0xb11d('0x36')](_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x36')]);_0x5abe11[_0xb11d('0x37')]=qs[_0xb11d('0x2f')](_[_0xb11d('0x38')](_0x2fc6f1['query'],_0x52c0e3[_0xb11d('0x2f')]),_0x2372c4);if(_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x39')]){_0x5abe11[_0xb11d('0x37')]=_[_0xb11d('0x3a')](_0x5abe11['where'],{'$or':_[_0xb11d('0x3b')](_0x2372c4,function(_0x144f45){if(_0x144f45[_0xb11d('0x2a')]!==_0xb11d('0x3c')){var _0x3b760c={};_0x3b760c[_0x144f45['name']]={'$like':'%'+_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x39')]+'%'};return _0x3b760c;}})});}_0x5abe11=_[_0xb11d('0x3a')]({},_0x5abe11,_0x2fc6f1[_0xb11d('0x3d')]);var _0x10f251={'where':_0x5abe11[_0xb11d('0x37')]};return db[_0xb11d('0x28')]['count'](_0x10f251)[_0xb11d('0x22')](function(_0x229873){_0x3de0f8[_0xb11d('0x1a')]=_0x229873;if(_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x3e')]){_0x5abe11[_0xb11d('0x3f')]=[{'all':!![]}];}return db[_0xb11d('0x28')]['findAll'](_0x5abe11);})[_0xb11d('0x22')](function(_0x4cb208){_0x3de0f8[_0xb11d('0x40')]=_0x4cb208;return _0x3de0f8;})[_0xb11d('0x22')](respondWithFilteredResult(_0x2910ad,_0x5abe11))[_0xb11d('0x41')](handleError(_0x2910ad,null));};exports['show']=function(_0x47b82b,_0x2c88a2){var _0x117273={'raw':!![],'where':{'id':_0x47b82b[_0xb11d('0x42')]['id']}},_0x2a63bb={};_0x2a63bb[_0xb11d('0x2c')]=_[_0xb11d('0x2e')](db[_0xb11d('0x28')][_0xb11d('0x43')]);_0x2a63bb['query']=_[_0xb11d('0x2e')](_0x47b82b['query']);_0x2a63bb['filters']=_['intersection'](_0x2a63bb[_0xb11d('0x2c')],_0x2a63bb[_0xb11d('0x2d')]);_0x117273[_0xb11d('0x32')]=_[_0xb11d('0x30')](_0x2a63bb[_0xb11d('0x2c')],qs['fields'](_0x47b82b[_0xb11d('0x2d')][_0xb11d('0x31')]));_0x117273[_0xb11d('0x32')]=_0x117273[_0xb11d('0x32')][_0xb11d('0x33')]?_0x117273[_0xb11d('0x32')]:_0x2a63bb[_0xb11d('0x2c')];if(_0x47b82b[_0xb11d('0x2d')]['includeAll']){_0x117273[_0xb11d('0x3f')]=[{'all':!![]}];}_0x117273=_[_0xb11d('0x3a')]({},_0x117273,_0x47b82b[_0xb11d('0x3d')]);return db[_0xb11d('0x28')][_0xb11d('0x44')](_0x117273)[_0xb11d('0x22')](handleEntityNotFound(_0x2c88a2,null))[_0xb11d('0x22')](respondWithResult(_0x2c88a2,null))['catch'](handleError(_0x2c88a2,null));};exports['create']=function(_0x2566a2,_0x26d320){return db[_0xb11d('0x28')][_0xb11d('0x45')](_0x2566a2['body'],{})[_0xb11d('0x22')](respondWithResult(_0x26d320,0xc9))[_0xb11d('0x41')](handleError(_0x26d320,null));};exports[_0xb11d('0x46')]=function(_0xe00c3b,_0x4fc19c){if(_0xe00c3b[_0xb11d('0x47')]['id']){delete _0xe00c3b[_0xb11d('0x47')]['id'];}return db[_0xb11d('0x28')][_0xb11d('0x44')]({'where':{'id':_0xe00c3b[_0xb11d('0x42')]['id']}})[_0xb11d('0x22')](handleEntityNotFound(_0x4fc19c,null))[_0xb11d('0x22')](saveUpdates(_0xe00c3b['body'],null))[_0xb11d('0x22')](respondWithResult(_0x4fc19c,null))[_0xb11d('0x41')](handleError(_0x4fc19c,null));};exports[_0xb11d('0x23')]=function(_0x9fd5cb,_0x32dd65){return db[_0xb11d('0x28')]['find']({'where':{'id':_0x9fd5cb['params']['id']}})[_0xb11d('0x22')](handleEntityNotFound(_0x32dd65,null))[_0xb11d('0x22')](removeEntity(_0x32dd65,null))[_0xb11d('0x41')](handleError(_0x32dd65,null));};exports[_0xb11d('0x48')]=function(_0x4cea29,_0xd05b10){return db[_0xb11d('0x28')][_0xb11d('0x48')]()[_0xb11d('0x22')](respondWithResult(_0xd05b10,null))['catch'](handleError(_0xd05b10,null));}; \ No newline at end of file +var _0xf894=['pick','filter','merge','options','include','findAll','catch','show','params','OpenchannelTransferReport','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0x18d792,_0x2bb187){var _0x30b22=function(_0x53eca4){while(--_0x53eca4){_0x18d792['push'](_0x18d792['shift']());}};_0x30b22(++_0x2bb187);}(_0xf894,0xe4));var _0x4f89=function(_0x2119d8,_0x32f87){_0x2119d8=_0x2119d8-0x0;var _0x2e0528=_0xf894[_0x2119d8];return _0x2e0528;};'use strict';var emlformat=require(_0x4f89('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f89('0x1'));var jsonpatch=require(_0x4f89('0x2'));var rp=require(_0x4f89('0x3'));var moment=require(_0x4f89('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4f89('0x5'));var util=require(_0x4f89('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4f89('0x7'));var ejs=require(_0x4f89('0x8'));var fs=require('fs');var fs_extra=require(_0x4f89('0x9'));var _=require('lodash');var squel=require(_0x4f89('0xa'));var crypto=require('crypto');var jsforce=require(_0x4f89('0xb'));var deskjs=require(_0x4f89('0xc'));var toCsv=require(_0x4f89('0x7'));var querystring=require(_0x4f89('0xd'));var Papa=require(_0x4f89('0xe'));var Redis=require(_0x4f89('0xf'));var authService=require(_0x4f89('0x10'));var qs=require(_0x4f89('0x11'));var as=require(_0x4f89('0x12'));var hardwareService=require(_0x4f89('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x4f89('0x14'));var config=require(_0x4f89('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f89('0x16'))['db'];function respondWithStatusCode(_0x3e40e1,_0x1ccc98){_0x1ccc98=_0x1ccc98||0xcc;return function(_0x1e3066){if(_0x1e3066){return _0x3e40e1[_0x4f89('0x17')](_0x1ccc98);}return _0x3e40e1[_0x4f89('0x18')](_0x1ccc98)[_0x4f89('0x19')]();};}function respondWithResult(_0x4ccce8,_0x56b1aa){_0x56b1aa=_0x56b1aa||0xc8;return function(_0xb6b3d5){if(_0xb6b3d5){return _0x4ccce8['status'](_0x56b1aa)[_0x4f89('0x1a')](_0xb6b3d5);}};}function respondWithFilteredResult(_0x1d1ad5,_0x11c056){return function(_0x19ba75){if(_0x19ba75){var _0x10472d=typeof _0x11c056[_0x4f89('0x1b')]===_0x4f89('0x1c')&&typeof _0x11c056[_0x4f89('0x1d')]===_0x4f89('0x1c');var _0x591f5d=_0x19ba75[_0x4f89('0x1e')];var _0x697c9b=_0x10472d?0x0:_0x11c056['offset'];var _0x2cdcb3=_0x10472d?_0x19ba75['count']:_0x11c056[_0x4f89('0x1b')]+_0x11c056[_0x4f89('0x1d')];var _0x2ca6e2;if(_0x2cdcb3>=_0x591f5d){_0x2cdcb3=_0x591f5d;_0x2ca6e2=0xc8;}else{_0x2ca6e2=0xce;}_0x1d1ad5[_0x4f89('0x18')](_0x2ca6e2);return _0x1d1ad5['set'](_0x4f89('0x1f'),_0x697c9b+'-'+_0x2cdcb3+'/'+_0x591f5d)[_0x4f89('0x1a')](_0x19ba75);}return null;};}function patchUpdates(_0x44427e){return function(_0x1f632a){try{jsonpatch[_0x4f89('0x20')](_0x1f632a,_0x44427e,!![]);}catch(_0x4632cd){return BPromise['reject'](_0x4632cd);}return _0x1f632a['save']();};}function saveUpdates(_0x50cac4,_0x5d27b3){return function(_0x6ddc72){if(_0x6ddc72){return _0x6ddc72[_0x4f89('0x21')](_0x50cac4)[_0x4f89('0x22')](function(_0x33c360){return _0x33c360;});}return null;};}function removeEntity(_0x43c9cc,_0x103c84){return function(_0x476e59){if(_0x476e59){return _0x476e59[_0x4f89('0x23')]()[_0x4f89('0x22')](function(){_0x43c9cc['status'](0xcc)[_0x4f89('0x19')]();});}};}function handleEntityNotFound(_0x178873,_0xaf4422){return function(_0x461297){if(!_0x461297){_0x178873[_0x4f89('0x17')](0x194);}return _0x461297;};}function handleError(_0x5afe9a,_0x42c050){_0x42c050=_0x42c050||0x1f4;return function(_0x14b082){logger[_0x4f89('0x24')](_0x14b082[_0x4f89('0x25')]);if(_0x14b082[_0x4f89('0x26')]){delete _0x14b082[_0x4f89('0x26')];}_0x5afe9a[_0x4f89('0x18')](_0x42c050)[_0x4f89('0x27')](_0x14b082);};}exports[_0x4f89('0x28')]=function(_0x5d4415,_0x38d6d2){var _0x3d2f8b={},_0x2c2a7c={},_0x50b047={'count':0x0,'rows':[]};var _0x13f20f=_[_0x4f89('0x29')](db['OpenchannelTransferReport'][_0x4f89('0x2a')],function(_0x383ecb){return{'name':_0x383ecb[_0x4f89('0x2b')],'type':_0x383ecb['type']['key']};});_0x2c2a7c[_0x4f89('0x2c')]=_[_0x4f89('0x29')](_0x13f20f,'name');_0x2c2a7c[_0x4f89('0x2d')]=_[_0x4f89('0x2e')](_0x5d4415[_0x4f89('0x2d')]);_0x2c2a7c[_0x4f89('0x2f')]=_[_0x4f89('0x30')](_0x2c2a7c[_0x4f89('0x2c')],_0x2c2a7c[_0x4f89('0x2d')]);_0x3d2f8b[_0x4f89('0x31')]=_[_0x4f89('0x30')](_0x2c2a7c[_0x4f89('0x2c')],qs['fields'](_0x5d4415[_0x4f89('0x2d')][_0x4f89('0x32')]));_0x3d2f8b[_0x4f89('0x31')]=_0x3d2f8b[_0x4f89('0x31')][_0x4f89('0x33')]?_0x3d2f8b['attributes']:_0x2c2a7c['model'];if(!_0x5d4415[_0x4f89('0x2d')]['hasOwnProperty'](_0x4f89('0x34'))){_0x3d2f8b[_0x4f89('0x1d')]=qs[_0x4f89('0x1d')](_0x5d4415[_0x4f89('0x2d')]['limit']);_0x3d2f8b['offset']=qs['offset'](_0x5d4415[_0x4f89('0x2d')][_0x4f89('0x1b')]);}_0x3d2f8b[_0x4f89('0x35')]=qs[_0x4f89('0x36')](_0x5d4415[_0x4f89('0x2d')][_0x4f89('0x36')]);_0x3d2f8b[_0x4f89('0x37')]=qs[_0x4f89('0x2f')](_[_0x4f89('0x38')](_0x5d4415[_0x4f89('0x2d')],_0x2c2a7c['filters']),_0x13f20f);if(_0x5d4415[_0x4f89('0x2d')][_0x4f89('0x39')]){_0x3d2f8b['where']=_[_0x4f89('0x3a')](_0x3d2f8b[_0x4f89('0x37')],{'$or':_[_0x4f89('0x29')](_0x13f20f,function(_0x2613b0){if(_0x2613b0['type']!=='VIRTUAL'){var _0x2fa0da={};_0x2fa0da[_0x2613b0[_0x4f89('0x26')]]={'$like':'%'+_0x5d4415[_0x4f89('0x2d')]['filter']+'%'};return _0x2fa0da;}})});}_0x3d2f8b=_['merge']({},_0x3d2f8b,_0x5d4415[_0x4f89('0x3b')]);var _0x43bf3d={'where':_0x3d2f8b['where']};return db['OpenchannelTransferReport'][_0x4f89('0x1e')](_0x43bf3d)['then'](function(_0x23f2c9){_0x50b047[_0x4f89('0x1e')]=_0x23f2c9;if(_0x5d4415['query']['includeAll']){_0x3d2f8b[_0x4f89('0x3c')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x4f89('0x3d')](_0x3d2f8b);})['then'](function(_0x2c5444){_0x50b047['rows']=_0x2c5444;return _0x50b047;})[_0x4f89('0x22')](respondWithFilteredResult(_0x38d6d2,_0x3d2f8b))[_0x4f89('0x3e')](handleError(_0x38d6d2,null));};exports[_0x4f89('0x3f')]=function(_0x2151c9,_0x28ac8a){var _0x39c296={'raw':!![],'where':{'id':_0x2151c9[_0x4f89('0x40')]['id']}},_0x28b946={};_0x28b946[_0x4f89('0x2c')]=_['keys'](db[_0x4f89('0x41')][_0x4f89('0x2a')]);_0x28b946['query']=_[_0x4f89('0x2e')](_0x2151c9['query']);_0x28b946[_0x4f89('0x2f')]=_[_0x4f89('0x30')](_0x28b946[_0x4f89('0x2c')],_0x28b946['query']);_0x39c296[_0x4f89('0x31')]=_[_0x4f89('0x30')](_0x28b946['model'],qs[_0x4f89('0x32')](_0x2151c9[_0x4f89('0x2d')][_0x4f89('0x32')]));_0x39c296[_0x4f89('0x31')]=_0x39c296[_0x4f89('0x31')][_0x4f89('0x33')]?_0x39c296[_0x4f89('0x31')]:_0x28b946[_0x4f89('0x2c')];if(_0x2151c9[_0x4f89('0x2d')][_0x4f89('0x42')]){_0x39c296['include']=[{'all':!![]}];}_0x39c296=_['merge']({},_0x39c296,_0x2151c9[_0x4f89('0x3b')]);return db['OpenchannelTransferReport'][_0x4f89('0x43')](_0x39c296)[_0x4f89('0x22')](handleEntityNotFound(_0x28ac8a,null))['then'](respondWithResult(_0x28ac8a,null))[_0x4f89('0x3e')](handleError(_0x28ac8a,null));};exports['create']=function(_0x4a340d,_0x2fd495){return db[_0x4f89('0x41')][_0x4f89('0x44')](_0x4a340d[_0x4f89('0x45')],{})['then'](respondWithResult(_0x2fd495,0xc9))[_0x4f89('0x3e')](handleError(_0x2fd495,null));};exports['update']=function(_0x1ed7ff,_0x3efc8){if(_0x1ed7ff[_0x4f89('0x45')]['id']){delete _0x1ed7ff['body']['id'];}return db[_0x4f89('0x41')][_0x4f89('0x43')]({'where':{'id':_0x1ed7ff[_0x4f89('0x40')]['id']}})[_0x4f89('0x22')](handleEntityNotFound(_0x3efc8,null))[_0x4f89('0x22')](saveUpdates(_0x1ed7ff[_0x4f89('0x45')],null))[_0x4f89('0x22')](respondWithResult(_0x3efc8,null))[_0x4f89('0x3e')](handleError(_0x3efc8,null));};exports[_0x4f89('0x23')]=function(_0x539bd0,_0x43b72a){return db[_0x4f89('0x41')]['find']({'where':{'id':_0x539bd0[_0x4f89('0x40')]['id']}})[_0x4f89('0x22')](handleEntityNotFound(_0x43b72a,null))[_0x4f89('0x22')](removeEntity(_0x43b72a,null))['catch'](handleError(_0x43b72a,null));};exports['describe']=function(_0x1b8c46,_0x27386f){return db[_0x4f89('0x41')][_0x4f89('0x46')]()['then'](respondWithResult(_0x27386f,null))[_0x4f89('0x3e')](handleError(_0x27386f,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 6e3689f..d284fc7 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 _0xa8c3=['exports','define','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa8c3,0x7c));var _0x3a8c=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xa8c3[_0x30b0d8];return _0x459c09;};'use strict';var _=require(_0x3a8c('0x0'));var util=require('util');var logger=require(_0x3a8c('0x1'))(_0x3a8c('0x2'));var moment=require('moment');var BPromise=require(_0x3a8c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a8c('0x4'));var rimraf=require(_0x3a8c('0x5'));var config=require(_0x3a8c('0x6'));var attributes=require(_0x3a8c('0x7'));module[_0x3a8c('0x8')]=function(_0x5277f8,_0x158e6b){return _0x5277f8[_0x3a8c('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0x3a8c('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3a8c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa299=['bluebird','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash','moment'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xa299,0x1ab));var _0x9a29=function(_0x130ad1,_0xbf1f3a){_0x130ad1=_0x130ad1-0x0;var _0x5399fb=_0xa299[_0x130ad1];return _0x5399fb;};'use strict';var _=require(_0x9a29('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9a29('0x1'));var BPromise=require(_0x9a29('0x2'));var rp=require(_0x9a29('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a29('0x4'));var config=require(_0x9a29('0x5'));var attributes=require(_0x9a29('0x6'));module[_0x9a29('0x7')]=function(_0xb518d8,_0x5444a0){return _0xb518d8[_0x9a29('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0x9a29('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9a29('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 05b0ded..b2f51ca 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 _0x0e17=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x4fa1f0,_0x5b5c01){var _0x20c7b6=function(_0x5db9a4){while(--_0x5db9a4){_0x4fa1f0['push'](_0x4fa1f0['shift']());}};_0x20c7b6(++_0x5b5c01);}(_0x0e17,0xd6));var _0x70e1=function(_0x127501,_0x5a42b1){_0x127501=_0x127501-0x0;var _0xaa76c3=_0x0e17[_0x127501];return _0xaa76c3;};'use strict';var _=require(_0x70e1('0x0'));var util=require(_0x70e1('0x1'));var moment=require(_0x70e1('0x2'));var BPromise=require(_0x70e1('0x3'));var rs=require(_0x70e1('0x4'));var fs=require('fs');var Redis=require(_0x70e1('0x5'));var db=require(_0x70e1('0x6'))['db'];var utils=require(_0x70e1('0x7'));var logger=require(_0x70e1('0x8'))(_0x70e1('0x9'));var config=require(_0x70e1('0xa'));var jayson=require(_0x70e1('0xb'));var client=jayson['client'][_0x70e1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16a2ad,_0x191d53,_0x27f310){return new BPromise(function(_0x26218a,_0x2c45c3){return client['request'](_0x16a2ad,_0x27f310)['then'](function(_0xfe25b1){logger['info'](_0x70e1('0xd'),_0x191d53,_0x70e1('0xe'));logger['debug'](_0x70e1('0xf'),_0x191d53,_0x70e1('0xe'),JSON['stringify'](_0xfe25b1));if(_0xfe25b1[_0x70e1('0x10')]){if(_0xfe25b1['error'][_0x70e1('0x11')]===0x1f4){logger['error'](_0x70e1('0xd'),_0x191d53,_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);return _0x2c45c3(_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);}logger[_0x70e1('0x10')](_0x70e1('0xd'),_0x191d53,_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);return _0x26218a(_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);}else{logger['info'](_0x70e1('0xd'),_0x191d53,_0x70e1('0xe'));_0x26218a(_0xfe25b1[_0x70e1('0x13')][_0x70e1('0x12')]);}})[_0x70e1('0x14')](function(_0xc18a09){logger[_0x70e1('0x10')](_0x70e1('0xd'),_0x191d53,_0xc18a09);_0x2c45c3(_0xc18a09);});});} \ No newline at end of file +var _0x1d7e=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','util'];(function(_0x21db01,_0x3bee50){var _0x2f3d7e=function(_0x10f22c){while(--_0x10f22c){_0x21db01['push'](_0x21db01['shift']());}};_0x2f3d7e(++_0x3bee50);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x1d7e[_0x187ee1];return _0x388160;};'use strict';var _=require('lodash');var util=require(_0xe1d7('0x0'));var moment=require(_0xe1d7('0x1'));var BPromise=require(_0xe1d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe1d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe1d7('0x4'));var logger=require(_0xe1d7('0x5'))(_0xe1d7('0x6'));var config=require(_0xe1d7('0x7'));var jayson=require(_0xe1d7('0x8'));var client=jayson[_0xe1d7('0x9')][_0xe1d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x867e5,_0x40e06c,_0x439ffd){return new BPromise(function(_0x3f1859,_0x494eaf){return client[_0xe1d7('0xb')](_0x867e5,_0x439ffd)[_0xe1d7('0xc')](function(_0x5d4bec){logger[_0xe1d7('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x40e06c,_0xe1d7('0xe'));logger['debug'](_0xe1d7('0xf'),_0x40e06c,'request\x20sent',JSON['stringify'](_0x5d4bec));if(_0x5d4bec[_0xe1d7('0x10')]){if(_0x5d4bec[_0xe1d7('0x10')][_0xe1d7('0x11')]===0x1f4){logger[_0xe1d7('0x10')](_0xe1d7('0x12'),_0x40e06c,_0x5d4bec[_0xe1d7('0x10')][_0xe1d7('0x13')]);return _0x494eaf(_0x5d4bec[_0xe1d7('0x10')]['message']);}logger[_0xe1d7('0x10')](_0xe1d7('0x12'),_0x40e06c,_0x5d4bec[_0xe1d7('0x10')][_0xe1d7('0x13')]);return _0x3f1859(_0x5d4bec[_0xe1d7('0x10')][_0xe1d7('0x13')]);}else{logger[_0xe1d7('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x40e06c,_0xe1d7('0xe'));_0x3f1859(_0x5d4bec[_0xe1d7('0x14')][_0xe1d7('0x13')]);}})['catch'](function(_0x41cd11){logger[_0xe1d7('0x10')](_0xe1d7('0x12'),_0x40e06c,_0x41cd11);_0x494eaf(_0x41cd11);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index cf68f41..f138bbe 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 _0x200a=['fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','util','connect-timeout','Router'];(function(_0x4a79b8,_0x23163f){var _0xc03275=function(_0x1edfe4){while(--_0x1edfe4){_0x4a79b8['push'](_0x4a79b8['shift']());}};_0xc03275(++_0x23163f);}(_0x200a,0xf8));var _0xa200=function(_0x1b8e60,_0x21b885){_0x1b8e60=_0x1b8e60-0x0;var _0x363363=_0x200a[_0x1b8e60];return _0x363363;};'use strict';var multer=require(_0xa200('0x0'));var util=require(_0xa200('0x1'));var path=require('path');var timeout=require(_0xa200('0x2'));var express=require('express');var router=express[_0xa200('0x3')]();var fs_extra=require(_0xa200('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa200('0x5'));var config=require(_0xa200('0x6'));var controller=require(_0xa200('0x7'));router[_0xa200('0x8')]('/',auth['isAuthenticated'](),controller[_0xa200('0x9')]);router[_0xa200('0x8')](_0xa200('0xa'),auth[_0xa200('0xb')](),controller['show']);router[_0xa200('0xc')]('/',auth[_0xa200('0xb')](),controller[_0xa200('0xd')]);router[_0xa200('0xe')]('/:id',auth[_0xa200('0xb')](),controller[_0xa200('0xf')]);router[_0xa200('0x10')](_0xa200('0xa'),auth['isAuthenticated'](),controller[_0xa200('0x11')]);module['exports']=router; \ No newline at end of file +var _0x79c6=['/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index'];(function(_0x37e1bd,_0x1b4a3d){var _0x578a36=function(_0x3833ce){while(--_0x3833ce){_0x37e1bd['push'](_0x37e1bd['shift']());}};_0x578a36(++_0x1b4a3d);}(_0x79c6,0x158));var _0x679c=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0x79c6[_0x1a0daa];return _0x1dbe15;};'use strict';var multer=require(_0x679c('0x0'));var util=require(_0x679c('0x1'));var path=require(_0x679c('0x2'));var timeout=require('connect-timeout');var express=require(_0x679c('0x3'));var router=express[_0x679c('0x4')]();var fs_extra=require(_0x679c('0x5'));var auth=require(_0x679c('0x6'));var interaction=require(_0x679c('0x7'));var config=require(_0x679c('0x8'));var controller=require(_0x679c('0x9'));router[_0x679c('0xa')]('/',auth[_0x679c('0xb')](),controller[_0x679c('0xc')]);router[_0x679c('0xa')](_0x679c('0xd'),auth[_0x679c('0xb')](),controller[_0x679c('0xe')]);router[_0x679c('0xf')]('/',auth[_0x679c('0xb')](),controller[_0x679c('0x10')]);router['put'](_0x679c('0xd'),auth['isAuthenticated'](),controller[_0x679c('0x11')]);router[_0x679c('0x12')](_0x679c('0xd'),auth[_0x679c('0xb')](),controller[_0x679c('0x13')]);module[_0x679c('0x14')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index f99f13c..8e30cff 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 _0x3495=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3495,0x1e1));var _0x5349=function(_0x4fe1da,_0x2dc506){_0x4fe1da=_0x4fe1da-0x0;var _0x567636=_0x3495[_0x4fe1da];return _0x567636;};'use strict';var Sequelize=require(_0x5349('0x0'));module['exports']={'name':{'type':Sequelize[_0x5349('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x5349('0x1')]}}; \ No newline at end of file +var _0xeae9=['name','sequelize','exports','STRING'];(function(_0x140527,_0x2a54e1){var _0x466e8a=function(_0x44f6c6){while(--_0x44f6c6){_0x140527['push'](_0x140527['shift']());}};_0x466e8a(++_0x2a54e1);}(_0xeae9,0x8d));var _0x9eae=function(_0x5d35f7,_0x570c67){_0x5d35f7=_0x5d35f7-0x0;var _0x49a993=_0xeae9[_0x5d35f7];return _0x49a993;};'use strict';var Sequelize=require(_0x9eae('0x0'));module[_0x9eae('0x1')]={'name':{'type':Sequelize[_0x9eae('0x2')],'unique':_0x9eae('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9eae('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 052fffb..2b087f7 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 _0xc609=['userProfileId','autoAssociation','error','params','eml-format','zip-dir','fast-json-patch','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','Pauses','UserProfileResource','sendStatus','stack','map','Pause','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0xc609,0x1ea));var _0x9c60=function(_0x16c4d0,_0x5cb02b){_0x16c4d0=_0x16c4d0-0x0;var _0x360bdd=_0xc609[_0x16c4d0];return _0x360bdd;};'use strict';var emlformat=require(_0x9c60('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c60('0x1'));var jsonpatch=require(_0x9c60('0x2'));var rp=require('request-promise');var moment=require(_0x9c60('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9c60('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9c60('0x5'));var ejs=require(_0x9c60('0x6'));var fs=require('fs');var fs_extra=require(_0x9c60('0x7'));var _=require(_0x9c60('0x8'));var squel=require(_0x9c60('0x9'));var crypto=require(_0x9c60('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9c60('0x5'));var querystring=require(_0x9c60('0xb'));var Papa=require(_0x9c60('0xc'));var Redis=require(_0x9c60('0xd'));var authService=require(_0x9c60('0xe'));var qs=require(_0x9c60('0xf'));var as=require(_0x9c60('0x10'));var hardwareService=require(_0x9c60('0x11'));var logger=require(_0x9c60('0x12'))(_0x9c60('0x13'));var utils=require(_0x9c60('0x14'));var config=require(_0x9c60('0x15'));var licenseUtil=require(_0x9c60('0x16'));var db=require(_0x9c60('0x17'))['db'];function respondWithStatusCode(_0x20e92b,_0x487569){_0x487569=_0x487569||0xcc;return function(_0x2a1b2e){if(_0x2a1b2e){return _0x20e92b['sendStatus'](_0x487569);}return _0x20e92b['status'](_0x487569)[_0x9c60('0x18')]();};}function respondWithResult(_0xe2c493,_0x350b65){_0x350b65=_0x350b65||0xc8;return function(_0x23a03d){if(_0x23a03d){return _0xe2c493[_0x9c60('0x19')](_0x350b65)[_0x9c60('0x1a')](_0x23a03d);}};}function respondWithFilteredResult(_0x55a6ad,_0x1865cc){return function(_0x1c34c4){if(_0x1c34c4){var _0x2e8c0a=typeof _0x1865cc['offset']===_0x9c60('0x1b')&&typeof _0x1865cc[_0x9c60('0x1c')]==='undefined';var _0x41a902=_0x1c34c4['count'];var _0xa4b8e=_0x2e8c0a?0x0:_0x1865cc[_0x9c60('0x1d')];var _0x1915e3=_0x2e8c0a?_0x1c34c4[_0x9c60('0x1e')]:_0x1865cc['offset']+_0x1865cc[_0x9c60('0x1c')];var _0x285c10;if(_0x1915e3>=_0x41a902){_0x1915e3=_0x41a902;_0x285c10=0xc8;}else{_0x285c10=0xce;}_0x55a6ad[_0x9c60('0x19')](_0x285c10);return _0x55a6ad[_0x9c60('0x1f')](_0x9c60('0x20'),_0xa4b8e+'-'+_0x1915e3+'/'+_0x41a902)[_0x9c60('0x1a')](_0x1c34c4);}return null;};}function patchUpdates(_0x4382cf){return function(_0x445a27){try{jsonpatch[_0x9c60('0x21')](_0x445a27,_0x4382cf,!![]);}catch(_0x3b9553){return BPromise[_0x9c60('0x22')](_0x3b9553);}return _0x445a27['save']();};}function saveUpdates(_0x582082,_0x2b211a){return function(_0x260881){if(_0x260881){return _0x260881[_0x9c60('0x23')](_0x582082)[_0x9c60('0x24')](function(_0x2730a9){return _0x2730a9;});}return null;};}function removeEntity(_0x21057d,_0x444d2f){return function(_0x535512){if(_0x535512){return _0x535512[_0x9c60('0x25')]()[_0x9c60('0x24')](function(){var _0x239283=_0x535512['get']({'plain':!![]});var _0xd63597=_0x9c60('0x26');return db[_0x9c60('0x27')][_0x9c60('0x25')]({'where':{'type':_0xd63597,'resourceId':_0x239283['id']}})[_0x9c60('0x24')](function(){return _0x535512;});})[_0x9c60('0x24')](function(){_0x21057d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59f932,_0x2a44bc){return function(_0x53d8a2){if(!_0x53d8a2){_0x59f932[_0x9c60('0x28')](0x194);}return _0x53d8a2;};}function handleError(_0x557b34,_0x4ba606){_0x4ba606=_0x4ba606||0x1f4;return function(_0x4d4f26){logger['error'](_0x4d4f26[_0x9c60('0x29')]);if(_0x4d4f26['name']){delete _0x4d4f26['name'];}_0x557b34[_0x9c60('0x19')](_0x4ba606)['send'](_0x4d4f26);};}exports['index']=function(_0x518c05,_0x47a941){var _0x16d0c6={},_0x11a0ae={},_0x28dd69={'count':0x0,'rows':[]};var _0x178bca=_[_0x9c60('0x2a')](db[_0x9c60('0x2b')][_0x9c60('0x2c')],function(_0x3dcb00){return{'name':_0x3dcb00[_0x9c60('0x2d')],'type':_0x3dcb00[_0x9c60('0x2e')][_0x9c60('0x2f')]};});_0x11a0ae[_0x9c60('0x30')]=_['map'](_0x178bca,_0x9c60('0x31'));_0x11a0ae['query']=_['keys'](_0x518c05[_0x9c60('0x32')]);_0x11a0ae['filters']=_[_0x9c60('0x33')](_0x11a0ae[_0x9c60('0x30')],_0x11a0ae[_0x9c60('0x32')]);_0x16d0c6[_0x9c60('0x34')]=_[_0x9c60('0x33')](_0x11a0ae[_0x9c60('0x30')],qs[_0x9c60('0x35')](_0x518c05[_0x9c60('0x32')][_0x9c60('0x35')]));_0x16d0c6[_0x9c60('0x34')]=_0x16d0c6[_0x9c60('0x34')][_0x9c60('0x36')]?_0x16d0c6[_0x9c60('0x34')]:_0x11a0ae[_0x9c60('0x30')];if(!_0x518c05[_0x9c60('0x32')][_0x9c60('0x37')](_0x9c60('0x38'))){_0x16d0c6[_0x9c60('0x1c')]=qs['limit'](_0x518c05[_0x9c60('0x32')][_0x9c60('0x1c')]);_0x16d0c6[_0x9c60('0x1d')]=qs[_0x9c60('0x1d')](_0x518c05[_0x9c60('0x32')][_0x9c60('0x1d')]);}_0x16d0c6['order']=qs[_0x9c60('0x39')](_0x518c05[_0x9c60('0x32')][_0x9c60('0x39')]);_0x16d0c6[_0x9c60('0x3a')]=qs['filters'](_['pick'](_0x518c05[_0x9c60('0x32')],_0x11a0ae[_0x9c60('0x3b')]),_0x178bca);if(_0x518c05[_0x9c60('0x32')][_0x9c60('0x3c')]){_0x16d0c6[_0x9c60('0x3a')]=_[_0x9c60('0x3d')](_0x16d0c6[_0x9c60('0x3a')],{'$or':_['map'](_0x178bca,function(_0x4814e5){if(_0x4814e5[_0x9c60('0x2e')]!==_0x9c60('0x3e')){var _0x5dc482={};_0x5dc482[_0x4814e5[_0x9c60('0x31')]]={'$like':'%'+_0x518c05[_0x9c60('0x32')]['filter']+'%'};return _0x5dc482;}})});}_0x16d0c6=_[_0x9c60('0x3d')]({},_0x16d0c6,_0x518c05[_0x9c60('0x3f')]);var _0x20bd39={'where':_0x16d0c6[_0x9c60('0x3a')]};return db[_0x9c60('0x2b')][_0x9c60('0x1e')](_0x20bd39)[_0x9c60('0x24')](function(_0x17a523){_0x28dd69[_0x9c60('0x1e')]=_0x17a523;if(_0x518c05[_0x9c60('0x32')][_0x9c60('0x40')]){_0x16d0c6[_0x9c60('0x41')]=[{'all':!![]}];}return db[_0x9c60('0x2b')][_0x9c60('0x42')](_0x16d0c6);})[_0x9c60('0x24')](function(_0x13f264){_0x28dd69['rows']=_0x13f264;return _0x28dd69;})['then'](respondWithFilteredResult(_0x47a941,_0x16d0c6))[_0x9c60('0x43')](handleError(_0x47a941,null));};exports[_0x9c60('0x44')]=function(_0x32ad6b,_0x80de9d){var _0x53da0f={'raw':!![],'where':{'id':_0x32ad6b['params']['id']}},_0x230bcc={};_0x230bcc[_0x9c60('0x30')]=_[_0x9c60('0x45')](db[_0x9c60('0x2b')]['rawAttributes']);_0x230bcc['query']=_[_0x9c60('0x45')](_0x32ad6b[_0x9c60('0x32')]);_0x230bcc[_0x9c60('0x3b')]=_[_0x9c60('0x33')](_0x230bcc['model'],_0x230bcc[_0x9c60('0x32')]);_0x53da0f['attributes']=_[_0x9c60('0x33')](_0x230bcc[_0x9c60('0x30')],qs['fields'](_0x32ad6b['query'][_0x9c60('0x35')]));_0x53da0f[_0x9c60('0x34')]=_0x53da0f[_0x9c60('0x34')][_0x9c60('0x36')]?_0x53da0f['attributes']:_0x230bcc[_0x9c60('0x30')];if(_0x32ad6b[_0x9c60('0x32')][_0x9c60('0x40')]){_0x53da0f[_0x9c60('0x41')]=[{'all':!![]}];}_0x53da0f=_[_0x9c60('0x3d')]({},_0x53da0f,_0x32ad6b['options']);return db['Pause'][_0x9c60('0x46')](_0x53da0f)[_0x9c60('0x24')](handleEntityNotFound(_0x80de9d,null))[_0x9c60('0x24')](respondWithResult(_0x80de9d,null))['catch'](handleError(_0x80de9d,null));};exports[_0x9c60('0x47')]=function(_0x14473c,_0x34a8fb){return db[_0x9c60('0x2b')]['create'](_0x14473c[_0x9c60('0x48')],{})[_0x9c60('0x24')](function(_0x47fc41){var _0x36a973=_0x14473c[_0x9c60('0x49')]['get']({'plain':!![]});if(!_0x36a973)throw new Error(_0x9c60('0x4a'));if(_0x36a973[_0x9c60('0x4b')]==='user'){var _0x130ecf=_0x47fc41[_0x9c60('0x4c')]({'plain':!![]});var _0x342bec=_0x9c60('0x26');return db['UserProfileSection'][_0x9c60('0x46')]({'where':{'name':_0x342bec,'userProfileId':_0x36a973[_0x9c60('0x4d')]},'raw':!![]})[_0x9c60('0x24')](function(_0x41bb){if(_0x41bb&&_0x41bb[_0x9c60('0x4e')]===0x0){return db[_0x9c60('0x27')][_0x9c60('0x47')]({'name':_0x130ecf[_0x9c60('0x31')],'resourceId':_0x130ecf['id'],'type':_0x41bb[_0x9c60('0x31')],'sectionId':_0x41bb['id']},{})[_0x9c60('0x24')](function(){return _0x47fc41;});}else{return _0x47fc41;}})['catch'](function(_0x259f0d){logger[_0x9c60('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x259f0d);throw _0x259f0d;});}return _0x47fc41;})[_0x9c60('0x24')](respondWithResult(_0x34a8fb,0xc9))[_0x9c60('0x43')](handleError(_0x34a8fb,null));};exports[_0x9c60('0x23')]=function(_0x4fe347,_0x1b6976){if(_0x4fe347[_0x9c60('0x48')]['id']){delete _0x4fe347[_0x9c60('0x48')]['id'];}return db[_0x9c60('0x2b')][_0x9c60('0x46')]({'where':{'id':_0x4fe347[_0x9c60('0x50')]['id']}})['then'](handleEntityNotFound(_0x1b6976,null))[_0x9c60('0x24')](saveUpdates(_0x4fe347['body'],null))['then'](respondWithResult(_0x1b6976,null))[_0x9c60('0x43')](handleError(_0x1b6976,null));};exports[_0x9c60('0x25')]=function(_0x3f08be,_0x897f8e){return db['Pause']['find']({'where':{'id':_0x3f08be['params']['id']}})[_0x9c60('0x24')](handleEntityNotFound(_0x897f8e,null))[_0x9c60('0x24')](removeEntity(_0x897f8e,null))[_0x9c60('0x43')](handleError(_0x897f8e,null));}; \ No newline at end of file +var _0x1291=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','limit','undefined','count','status','set','Content-Range','json','reject','save','update','then','destroy','get','Pauses','UserProfileResource','stack','name','send','index','map','Pause','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','keys','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service'];(function(_0x536076,_0x4c5460){var _0x246902=function(_0x3101ca){while(--_0x3101ca){_0x536076['push'](_0x536076['shift']());}};_0x246902(++_0x4c5460);}(_0x1291,0xe3));var _0x1129=function(_0x1fcc49,_0x37be24){_0x1fcc49=_0x1fcc49-0x0;var _0x4b3247=_0x1291[_0x1fcc49];return _0x4b3247;};'use strict';var emlformat=require(_0x1129('0x0'));var rimraf=require(_0x1129('0x1'));var zipdir=require(_0x1129('0x2'));var jsonpatch=require(_0x1129('0x3'));var rp=require(_0x1129('0x4'));var moment=require(_0x1129('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1129('0x6'));var util=require(_0x1129('0x7'));var path=require('path');var sox=require(_0x1129('0x8'));var csv=require(_0x1129('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1129('0xa'));var _=require('lodash');var squel=require(_0x1129('0xb'));var crypto=require(_0x1129('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1129('0x9'));var querystring=require(_0x1129('0xd'));var Papa=require('papaparse');var Redis=require(_0x1129('0xe'));var authService=require(_0x1129('0xf'));var qs=require(_0x1129('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1129('0x11'))(_0x1129('0x12'));var utils=require(_0x1129('0x13'));var config=require(_0x1129('0x14'));var licenseUtil=require(_0x1129('0x15'));var db=require(_0x1129('0x16'))['db'];function respondWithStatusCode(_0x208778,_0x5c799c){_0x5c799c=_0x5c799c||0xcc;return function(_0x14048a){if(_0x14048a){return _0x208778['sendStatus'](_0x5c799c);}return _0x208778['status'](_0x5c799c)[_0x1129('0x17')]();};}function respondWithResult(_0x51f3d6,_0x714037){_0x714037=_0x714037||0xc8;return function(_0x40fac6){if(_0x40fac6){return _0x51f3d6['status'](_0x714037)['json'](_0x40fac6);}};}function respondWithFilteredResult(_0x12dfa6,_0x301195){return function(_0x13b1d3){if(_0x13b1d3){var _0x13eb74=typeof _0x301195[_0x1129('0x18')]==='undefined'&&typeof _0x301195[_0x1129('0x19')]===_0x1129('0x1a');var _0x2d8b3d=_0x13b1d3['count'];var _0x539a83=_0x13eb74?0x0:_0x301195[_0x1129('0x18')];var _0x1743c6=_0x13eb74?_0x13b1d3[_0x1129('0x1b')]:_0x301195[_0x1129('0x18')]+_0x301195[_0x1129('0x19')];var _0xb4b8e3;if(_0x1743c6>=_0x2d8b3d){_0x1743c6=_0x2d8b3d;_0xb4b8e3=0xc8;}else{_0xb4b8e3=0xce;}_0x12dfa6[_0x1129('0x1c')](_0xb4b8e3);return _0x12dfa6[_0x1129('0x1d')](_0x1129('0x1e'),_0x539a83+'-'+_0x1743c6+'/'+_0x2d8b3d)[_0x1129('0x1f')](_0x13b1d3);}return null;};}function patchUpdates(_0x3ce052){return function(_0x40ca14){try{jsonpatch['apply'](_0x40ca14,_0x3ce052,!![]);}catch(_0x5b5109){return BPromise[_0x1129('0x20')](_0x5b5109);}return _0x40ca14[_0x1129('0x21')]();};}function saveUpdates(_0x127d13,_0x3c42fc){return function(_0x2bca04){if(_0x2bca04){return _0x2bca04[_0x1129('0x22')](_0x127d13)[_0x1129('0x23')](function(_0x58cf77){return _0x58cf77;});}return null;};}function removeEntity(_0x2afb8b,_0x10bf89){return function(_0x2127ab){if(_0x2127ab){return _0x2127ab[_0x1129('0x24')]()['then'](function(){var _0x53010b=_0x2127ab[_0x1129('0x25')]({'plain':!![]});var _0x44e7fd=_0x1129('0x26');return db[_0x1129('0x27')][_0x1129('0x24')]({'where':{'type':_0x44e7fd,'resourceId':_0x53010b['id']}})[_0x1129('0x23')](function(){return _0x2127ab;});})[_0x1129('0x23')](function(){_0x2afb8b[_0x1129('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53df36,_0x2ae08e){return function(_0x5bdfe9){if(!_0x5bdfe9){_0x53df36['sendStatus'](0x194);}return _0x5bdfe9;};}function handleError(_0x27bb05,_0x5c4566){_0x5c4566=_0x5c4566||0x1f4;return function(_0x281831){logger['error'](_0x281831[_0x1129('0x28')]);if(_0x281831[_0x1129('0x29')]){delete _0x281831[_0x1129('0x29')];}_0x27bb05['status'](_0x5c4566)[_0x1129('0x2a')](_0x281831);};}exports[_0x1129('0x2b')]=function(_0x411fc9,_0x374769){var _0x17435d={},_0x68afca={},_0x4f7d9d={'count':0x0,'rows':[]};var _0x4ccdbb=_[_0x1129('0x2c')](db[_0x1129('0x2d')]['rawAttributes'],function(_0x480e0c){return{'name':_0x480e0c[_0x1129('0x2e')],'type':_0x480e0c[_0x1129('0x2f')]['key']};});_0x68afca[_0x1129('0x30')]=_[_0x1129('0x2c')](_0x4ccdbb,_0x1129('0x29'));_0x68afca[_0x1129('0x31')]=_['keys'](_0x411fc9[_0x1129('0x31')]);_0x68afca[_0x1129('0x32')]=_[_0x1129('0x33')](_0x68afca[_0x1129('0x30')],_0x68afca[_0x1129('0x31')]);_0x17435d[_0x1129('0x34')]=_[_0x1129('0x33')](_0x68afca[_0x1129('0x30')],qs[_0x1129('0x35')](_0x411fc9[_0x1129('0x31')][_0x1129('0x35')]));_0x17435d[_0x1129('0x34')]=_0x17435d[_0x1129('0x34')][_0x1129('0x36')]?_0x17435d[_0x1129('0x34')]:_0x68afca[_0x1129('0x30')];if(!_0x411fc9[_0x1129('0x31')][_0x1129('0x37')](_0x1129('0x38'))){_0x17435d[_0x1129('0x19')]=qs[_0x1129('0x19')](_0x411fc9[_0x1129('0x31')][_0x1129('0x19')]);_0x17435d[_0x1129('0x18')]=qs['offset'](_0x411fc9[_0x1129('0x31')]['offset']);}_0x17435d[_0x1129('0x39')]=qs[_0x1129('0x3a')](_0x411fc9['query'][_0x1129('0x3a')]);_0x17435d[_0x1129('0x3b')]=qs['filters'](_[_0x1129('0x3c')](_0x411fc9[_0x1129('0x31')],_0x68afca[_0x1129('0x32')]),_0x4ccdbb);if(_0x411fc9[_0x1129('0x31')][_0x1129('0x3d')]){_0x17435d['where']=_[_0x1129('0x3e')](_0x17435d[_0x1129('0x3b')],{'$or':_[_0x1129('0x2c')](_0x4ccdbb,function(_0x51c070){if(_0x51c070[_0x1129('0x2f')]!=='VIRTUAL'){var _0x47d625={};_0x47d625[_0x51c070['name']]={'$like':'%'+_0x411fc9[_0x1129('0x31')]['filter']+'%'};return _0x47d625;}})});}_0x17435d=_[_0x1129('0x3e')]({},_0x17435d,_0x411fc9[_0x1129('0x3f')]);var _0x542fee={'where':_0x17435d[_0x1129('0x3b')]};return db[_0x1129('0x2d')][_0x1129('0x1b')](_0x542fee)[_0x1129('0x23')](function(_0x35e2b5){_0x4f7d9d['count']=_0x35e2b5;if(_0x411fc9['query'][_0x1129('0x40')]){_0x17435d[_0x1129('0x41')]=[{'all':!![]}];}return db[_0x1129('0x2d')][_0x1129('0x42')](_0x17435d);})[_0x1129('0x23')](function(_0x5a991c){_0x4f7d9d[_0x1129('0x43')]=_0x5a991c;return _0x4f7d9d;})[_0x1129('0x23')](respondWithFilteredResult(_0x374769,_0x17435d))[_0x1129('0x44')](handleError(_0x374769,null));};exports['show']=function(_0x9c5f59,_0x237f67){var _0x5e4bc7={'raw':!![],'where':{'id':_0x9c5f59['params']['id']}},_0x1c7b33={};_0x1c7b33[_0x1129('0x30')]=_[_0x1129('0x45')](db['Pause'][_0x1129('0x46')]);_0x1c7b33[_0x1129('0x31')]=_[_0x1129('0x45')](_0x9c5f59[_0x1129('0x31')]);_0x1c7b33['filters']=_['intersection'](_0x1c7b33['model'],_0x1c7b33[_0x1129('0x31')]);_0x5e4bc7[_0x1129('0x34')]=_[_0x1129('0x33')](_0x1c7b33[_0x1129('0x30')],qs[_0x1129('0x35')](_0x9c5f59[_0x1129('0x31')][_0x1129('0x35')]));_0x5e4bc7[_0x1129('0x34')]=_0x5e4bc7[_0x1129('0x34')][_0x1129('0x36')]?_0x5e4bc7[_0x1129('0x34')]:_0x1c7b33[_0x1129('0x30')];if(_0x9c5f59[_0x1129('0x31')][_0x1129('0x40')]){_0x5e4bc7[_0x1129('0x41')]=[{'all':!![]}];}_0x5e4bc7=_[_0x1129('0x3e')]({},_0x5e4bc7,_0x9c5f59[_0x1129('0x3f')]);return db[_0x1129('0x2d')][_0x1129('0x47')](_0x5e4bc7)[_0x1129('0x23')](handleEntityNotFound(_0x237f67,null))[_0x1129('0x23')](respondWithResult(_0x237f67,null))[_0x1129('0x44')](handleError(_0x237f67,null));};exports[_0x1129('0x48')]=function(_0x157baf,_0x3704a1){return db['Pause']['create'](_0x157baf[_0x1129('0x49')],{})[_0x1129('0x23')](function(_0x228087){var _0x26551e=_0x157baf[_0x1129('0x4a')][_0x1129('0x25')]({'plain':!![]});if(!_0x26551e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26551e[_0x1129('0x4b')]===_0x1129('0x4a')){var _0x55a247=_0x228087[_0x1129('0x25')]({'plain':!![]});var _0x286cd8=_0x1129('0x26');return db[_0x1129('0x4c')][_0x1129('0x47')]({'where':{'name':_0x286cd8,'userProfileId':_0x26551e[_0x1129('0x4d')]},'raw':!![]})[_0x1129('0x23')](function(_0x21ebef){if(_0x21ebef&&_0x21ebef['autoAssociation']===0x0){return db[_0x1129('0x27')][_0x1129('0x48')]({'name':_0x55a247['name'],'resourceId':_0x55a247['id'],'type':_0x21ebef[_0x1129('0x29')],'sectionId':_0x21ebef['id']},{})[_0x1129('0x23')](function(){return _0x228087;});}else{return _0x228087;}})[_0x1129('0x44')](function(_0x4f5823){logger[_0x1129('0x4e')](_0x1129('0x4f'),_0x4f5823);throw _0x4f5823;});}return _0x228087;})[_0x1129('0x23')](respondWithResult(_0x3704a1,0xc9))[_0x1129('0x44')](handleError(_0x3704a1,null));};exports['update']=function(_0x3dae99,_0x2f4709){if(_0x3dae99[_0x1129('0x49')]['id']){delete _0x3dae99[_0x1129('0x49')]['id'];}return db[_0x1129('0x2d')][_0x1129('0x47')]({'where':{'id':_0x3dae99[_0x1129('0x50')]['id']}})[_0x1129('0x23')](handleEntityNotFound(_0x2f4709,null))[_0x1129('0x23')](saveUpdates(_0x3dae99[_0x1129('0x49')],null))[_0x1129('0x23')](respondWithResult(_0x2f4709,null))[_0x1129('0x44')](handleError(_0x2f4709,null));};exports['destroy']=function(_0xb17dba,_0x41082f){return db['Pause'][_0x1129('0x47')]({'where':{'id':_0xb17dba[_0x1129('0x50')]['id']}})[_0x1129('0x23')](handleEntityNotFound(_0x41082f,null))[_0x1129('0x23')](removeEntity(_0x41082f,null))[_0x1129('0x44')](handleError(_0x41082f,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 7280eed..523c5e0 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 _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x500781,_0x28d318){var _0x4458df=function(_0xf19b3f){while(--_0xf19b3f){_0x500781['push'](_0x500781['shift']());}};_0x4458df(++_0x28d318);}(_0xf494,0x1c6));var _0x4f49=function(_0x3cb080,_0x13d62a){_0x3cb080=_0x3cb080-0x0;var _0x597c35=_0xf494[_0x3cb080];return _0x597c35;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1deba7,_0x30f270){_0x1deba7=_0x1deba7-0x0;var _0x2dcc31=_0x7fbe[_0x1deba7];return _0x2dcc31;};'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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index d3dbe78..b8dc85f 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x2f4899,_0x2083d7){var _0x8c7341=function(_0x4d7585){while(--_0x4d7585){_0x2f4899['push'](_0x2f4899['shift']());}};_0x8c7341(++_0x2083d7);}(_0x7a54,0x106));var _0x47a5=function(_0x253f0b,_0x518384){_0x253f0b=_0x253f0b-0x0;var _0x41d77f=_0x7a54[_0x253f0b];return _0x41d77f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x1467fd,_0x2f4641){var _0x4f0130=function(_0x2f0e2c){while(--_0x2f0e2c){_0x1467fd['push'](_0x1467fd['shift']());}};_0x4f0130(++_0x2f4641);}(_0x7a54,0x106));var _0x47a5=function(_0x5827aa,_0x5d9f4c){_0x5827aa=_0x5827aa-0x0;var _0x35cd7a=_0x7a54[_0x5827aa];return _0x35cd7a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 0706318..8d20e21 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 _0x6aa7=['isAuthenticated','get','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','file','webhookPost','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a9782,_0x19e573){var _0x9ea8b9=function(_0x4fa80d){while(--_0x4fa80d){_0x5a9782['push'](_0x5a9782['shift']());}};_0x9ea8b9(++_0x19e573);}(_0x6aa7,0x178));var _0x76aa=function(_0x11aaac,_0x4b9083){_0x11aaac=_0x11aaac-0x0;var _0xe2a384=_0x6aa7[_0x11aaac];return _0xe2a384;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./plugin.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),controller[_0x76aa('0xb')]);router['get'](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router['get'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);var upload=multer({'storage':multer[_0x76aa('0x10')]({'destination':function(_0x37f1ab,_0x128435,_0x2c5075){_0x2c5075(null,path[_0x76aa('0x11')](config[_0x76aa('0x12')],_0x76aa('0x13')));},'filename':function(_0x5e5f47,_0x112c39,_0x5df49c){_0x112c39[_0x76aa('0x14')]=_0x112c39[_0x76aa('0x14')][_0x76aa('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5df49c(null,util[_0x76aa('0x16')](_0x76aa('0x17'),path['basename'](_0x112c39['originalname'],path[_0x76aa('0x18')](_0x112c39['originalname'])),Date[_0x76aa('0x19')](),path[_0x76aa('0x18')](_0x112c39['originalname'])));}})});router[_0x76aa('0x1a')]('/',upload['single'](_0x76aa('0x1b')),controller['upload']);router[_0x76aa('0x1a')](_0x76aa('0xa'),controller[_0x76aa('0x1c')]);router[_0x76aa('0x1d')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller['update']);router['delete'](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1e')]);module[_0x76aa('0x1f')]=router; \ No newline at end of file +var _0xfd28=['webhookPost','put','update','delete','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/:id','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','/webhook'];(function(_0x42e672,_0x392fa5){var _0x3df000=function(_0x1d46e2){while(--_0x1d46e2){_0x42e672['push'](_0x42e672['shift']());}};_0x3df000(++_0x392fa5);}(_0xfd28,0x148));var _0x8fd2=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0xfd28[_0x104e21];return _0x605b37;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/webhook',controller['webhookGet']);router[_0x8fd2('0x7')](_0x8fd2('0xa'),auth[_0x8fd2('0x8')](),controller['show']);router[_0x8fd2('0x7')]('/:id/download',auth[_0x8fd2('0x8')](),controller['download']);var upload=multer({'storage':multer[_0x8fd2('0xb')]({'destination':function(_0x4fdf0b,_0x1ca2a1,_0x5244ed){_0x5244ed(null,path[_0x8fd2('0xc')](config['root'],_0x8fd2('0xd')));},'filename':function(_0x207298,_0xfd78d,_0xa6d7ca){_0xfd78d[_0x8fd2('0xe')]=_0xfd78d[_0x8fd2('0xe')][_0x8fd2('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xa6d7ca(null,util[_0x8fd2('0x10')](_0x8fd2('0x11'),path[_0x8fd2('0x12')](_0xfd78d[_0x8fd2('0xe')],path[_0x8fd2('0x13')](_0xfd78d[_0x8fd2('0xe')])),Date[_0x8fd2('0x14')](),path[_0x8fd2('0x13')](_0xfd78d['originalname'])));}})});router[_0x8fd2('0x15')]('/',upload['single']('file'),controller['upload']);router[_0x8fd2('0x15')](_0x8fd2('0x16'),controller[_0x8fd2('0x17')]);router[_0x8fd2('0x18')]('/:id',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x19')]);router[_0x8fd2('0x1a')](_0x8fd2('0xa'),auth[_0x8fd2('0x8')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 56b7900..d0d0919 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 _0xb511=['BOOLEAN','ENUM','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x49192,_0x2fc6fb){var _0x57d8e8=function(_0xc4ed8d){while(--_0xc4ed8d){_0x49192['push'](_0x49192['shift']());}};_0x57d8e8(++_0x2fc6fb);}(_0xb511,0x166));var _0x1b51=function(_0x519eca,_0x3cced2){_0x519eca=_0x519eca-0x0;var _0xb82e4c=_0xb511[_0x519eca];return _0xb82e4c;};'use strict';var Sequelize=require(_0x1b51('0x0'));module['exports']={'name':{'type':Sequelize[_0x1b51('0x1')]},'type':{'type':Sequelize['ENUM'](_0x1b51('0x2'),_0x1b51('0x3'))},'description':{'type':Sequelize[_0x1b51('0x4')]},'version':{'type':Sequelize[_0x1b51('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0x1b51('0x5')},'active':{'type':Sequelize[_0x1b51('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x1b51('0x7')](_0x1b51('0x8'),_0x1b51('0x9'),_0x1b51('0xa'),_0x1b51('0xb')),'defaultValue':'always','comment':_0x1b51('0xc')},'icon':{'type':Sequelize[_0x1b51('0x1')]},'adminUrl':{'type':Sequelize[_0x1b51('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x1b51('0x1')]},'scriptPath':{'type':Sequelize[_0x1b51('0x1')]}}; \ No newline at end of file +var _0x2384=['BOOLEAN','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x3387a2,_0x52799f){var _0x1cc9c9=function(_0x49ceae){while(--_0x49ceae){_0x3387a2['push'](_0x3387a2['shift']());}};_0x1cc9c9(++_0x52799f);}(_0x2384,0xf0));var _0x4238=function(_0x5411ab,_0x3903a8){_0x5411ab=_0x5411ab-0x0;var _0x1cfd06=_0x2384[_0x5411ab];return _0x1cfd06;};'use strict';var Sequelize=require(_0x4238('0x0'));module[_0x4238('0x1')]={'name':{'type':Sequelize[_0x4238('0x2')]},'type':{'type':Sequelize[_0x4238('0x3')]('html',_0x4238('0x4'))},'description':{'type':Sequelize[_0x4238('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x4238('0x2')],'comment':_0x4238('0x6')},'active':{'type':Sequelize[_0x4238('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x4238('0x3')](_0x4238('0x8'),_0x4238('0x9'),'always',_0x4238('0xa')),'defaultValue':_0x4238('0xb'),'comment':_0x4238('0xc')},'icon':{'type':Sequelize[_0x4238('0x2')]},'adminUrl':{'type':Sequelize[_0x4238('0x2')]},'agentUrl':{'type':Sequelize[_0x4238('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 82dfb4d..cef65e8 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 _0x95ab=['basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','create','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','extract-zip','rimraf','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','reject','then','destroy','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','includeAll','catch','show','params','keys','include','find','join','root','server/files/plugins','format','%s.zip','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*'];(function(_0x2a10e7,_0x39da4c){var _0x5cfd7d=function(_0xf7e998){while(--_0xf7e998){_0x2a10e7['push'](_0x2a10e7['shift']());}};_0x5cfd7d(++_0x39da4c);}(_0x95ab,0xf9));var _0xb95a=function(_0x13f989,_0x18d87b){_0x13f989=_0x13f989-0x0;var _0x4aaf53=_0x95ab[_0x13f989];return _0x4aaf53;};'use strict';var emlformat=require(_0xb95a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb95a('0x1'));var rp=require(_0xb95a('0x2'));var moment=require(_0xb95a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb95a('0x4'));var util=require('util');var path=require(_0xb95a('0x5'));var sox=require('sox');var csv=require(_0xb95a('0x6'));var ejs=require(_0xb95a('0x7'));var fs=require('fs');var fs_extra=require(_0xb95a('0x8'));var _=require(_0xb95a('0x9'));var squel=require(_0xb95a('0xa'));var crypto=require(_0xb95a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0xb95a('0xc'));var rimraf=require(_0xb95a('0xd'));var archiver=require('archiver');var Redis=require(_0xb95a('0xe'));var authService=require(_0xb95a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb95a('0x10'));var hardwareService=require(_0xb95a('0x11'));var logger=require(_0xb95a('0x12'))(_0xb95a('0x13'));var utils=require(_0xb95a('0x14'));var config=require(_0xb95a('0x15'));var licenseUtil=require(_0xb95a('0x16'));var db=require(_0xb95a('0x17'))['db'];config[_0xb95a('0x18')]=_[_0xb95a('0x19')](config[_0xb95a('0x18')],{'host':_0xb95a('0x1a'),'port':0x18eb});var socket=require(_0xb95a('0x1b'))(new Redis(config[_0xb95a('0x18')]));require(_0xb95a('0x1c'))['register'](socket);function respondWithStatusCode(_0x14895f,_0x298770){_0x298770=_0x298770||0xcc;return function(_0x197b7c){if(_0x197b7c){return _0x14895f[_0xb95a('0x1d')](_0x298770);}return _0x14895f[_0xb95a('0x1e')](_0x298770)[_0xb95a('0x1f')]();};}function respondWithResult(_0x15313d,_0x58b152){_0x58b152=_0x58b152||0xc8;return function(_0x419c5e){if(_0x419c5e){return _0x15313d[_0xb95a('0x1e')](_0x58b152)['json'](_0x419c5e);}};}function respondWithFilteredResult(_0x3b3a67,_0x54be19){return function(_0x11fb8f){if(_0x11fb8f){var _0x2a1ff1=typeof _0x54be19['offset']==='undefined'&&typeof _0x54be19[_0xb95a('0x20')]==='undefined';var _0x3deae7=_0x11fb8f[_0xb95a('0x21')];var _0xdf5dbe=_0x2a1ff1?0x0:_0x54be19[_0xb95a('0x22')];var _0x49ff12=_0x2a1ff1?_0x11fb8f['count']:_0x54be19[_0xb95a('0x22')]+_0x54be19[_0xb95a('0x20')];var _0x56c5c5;if(_0x49ff12>=_0x3deae7){_0x49ff12=_0x3deae7;_0x56c5c5=0xc8;}else{_0x56c5c5=0xce;}_0x3b3a67[_0xb95a('0x1e')](_0x56c5c5);return _0x3b3a67[_0xb95a('0x23')](_0xb95a('0x24'),_0xdf5dbe+'-'+_0x49ff12+'/'+_0x3deae7)[_0xb95a('0x25')](_0x11fb8f);}return null;};}function patchUpdates(_0x38a786){return function(_0x464b2d){try{jsonpatch[_0xb95a('0x26')](_0x464b2d,_0x38a786,!![]);}catch(_0x3f68f1){return BPromise[_0xb95a('0x27')](_0x3f68f1);}return _0x464b2d['save']();};}function saveUpdates(_0x3c343b,_0xc3f26d){return function(_0x8249a0){if(_0x8249a0){return _0x8249a0['update'](_0x3c343b)[_0xb95a('0x28')](function(_0x968504){return _0x968504;});}return null;};}function removeEntity(_0x13fe70,_0x55d54d){return function(_0x3b251d){if(_0x3b251d){return _0x3b251d[_0xb95a('0x29')]()['then'](function(){var _0x3a1c4a=_0x3b251d['get']({'plain':!![]});var _0x50532c=_0xb95a('0x2a');return db[_0xb95a('0x2b')][_0xb95a('0x29')]({'where':{'type':_0x50532c,'resourceId':_0x3a1c4a['id']}})[_0xb95a('0x28')](function(){return _0x3b251d;});})[_0xb95a('0x28')](function(){_0x13fe70[_0xb95a('0x1e')](0xcc)[_0xb95a('0x1f')]();});}};}function handleEntityNotFound(_0x2edd73,_0x422e52){return function(_0x1bc893){if(!_0x1bc893){_0x2edd73[_0xb95a('0x1d')](0x194);}return _0x1bc893;};}function handleError(_0x5547b2,_0x36b3ce){_0x36b3ce=_0x36b3ce||0x1f4;return function(_0x3e2047){logger[_0xb95a('0x2c')](_0x3e2047[_0xb95a('0x2d')]);if(_0x3e2047[_0xb95a('0x2e')]){delete _0x3e2047[_0xb95a('0x2e')];}_0x5547b2[_0xb95a('0x1e')](_0x36b3ce)[_0xb95a('0x2f')](_0x3e2047);};}exports[_0xb95a('0x30')]=function(_0x16cde6,_0x3c637f){var _0xc60c89={},_0x1ca9aa={},_0x5def17={'count':0x0,'rows':[]};var _0x358639=_[_0xb95a('0x31')](db[_0xb95a('0x32')][_0xb95a('0x33')],function(_0x402dd5){return{'name':_0x402dd5['fieldName'],'type':_0x402dd5[_0xb95a('0x34')][_0xb95a('0x35')]};});_0x1ca9aa['model']=_[_0xb95a('0x31')](_0x358639,_0xb95a('0x2e'));_0x1ca9aa[_0xb95a('0x36')]=_['keys'](_0x16cde6[_0xb95a('0x36')]);_0x1ca9aa[_0xb95a('0x37')]=_[_0xb95a('0x38')](_0x1ca9aa[_0xb95a('0x39')],_0x1ca9aa['query']);_0xc60c89[_0xb95a('0x3a')]=_[_0xb95a('0x38')](_0x1ca9aa[_0xb95a('0x39')],qs[_0xb95a('0x3b')](_0x16cde6[_0xb95a('0x36')]['fields']));_0xc60c89['attributes']=_0xc60c89[_0xb95a('0x3a')][_0xb95a('0x3c')]?_0xc60c89[_0xb95a('0x3a')]:_0x1ca9aa['model'];if(!_0x16cde6[_0xb95a('0x36')]['hasOwnProperty']('nolimit')){_0xc60c89[_0xb95a('0x20')]=qs[_0xb95a('0x20')](_0x16cde6[_0xb95a('0x36')]['limit']);_0xc60c89[_0xb95a('0x22')]=qs['offset'](_0x16cde6[_0xb95a('0x36')]['offset']);}_0xc60c89[_0xb95a('0x3d')]=qs['sort'](_0x16cde6[_0xb95a('0x36')][_0xb95a('0x3e')]);_0xc60c89[_0xb95a('0x3f')]=qs['filters'](_[_0xb95a('0x40')](_0x16cde6[_0xb95a('0x36')],_0x1ca9aa['filters']),_0x358639);if(_0x16cde6[_0xb95a('0x36')][_0xb95a('0x41')]){_0xc60c89[_0xb95a('0x3f')]=_['merge'](_0xc60c89[_0xb95a('0x3f')],{'$or':_[_0xb95a('0x31')](_0x358639,function(_0x282a2e){if(_0x282a2e[_0xb95a('0x34')]!==_0xb95a('0x42')){var _0xc4cd8b={};_0xc4cd8b[_0x282a2e[_0xb95a('0x2e')]]={'$like':'%'+_0x16cde6[_0xb95a('0x36')][_0xb95a('0x41')]+'%'};return _0xc4cd8b;}})});}_0xc60c89=_['merge']({},_0xc60c89,_0x16cde6['options']);var _0x2a8a89={'where':_0xc60c89['where']};return db['Plugin']['count'](_0x2a8a89)[_0xb95a('0x28')](function(_0x1403ad){_0x5def17[_0xb95a('0x21')]=_0x1403ad;if(_0x16cde6[_0xb95a('0x36')][_0xb95a('0x43')]){_0xc60c89['include']=[{'all':!![]}];}return db[_0xb95a('0x32')]['findAll'](_0xc60c89);})['then'](function(_0x170249){_0x5def17['rows']=_0x170249;return _0x5def17;})[_0xb95a('0x28')](respondWithFilteredResult(_0x3c637f,_0xc60c89))[_0xb95a('0x44')](handleError(_0x3c637f,null));};exports[_0xb95a('0x45')]=function(_0x4525fb,_0x57c692){var _0x4869ec={'raw':!![],'where':{'id':_0x4525fb[_0xb95a('0x46')]['id']}},_0x3a61b0={};_0x3a61b0['model']=_[_0xb95a('0x47')](db[_0xb95a('0x32')][_0xb95a('0x33')]);_0x3a61b0[_0xb95a('0x36')]=_[_0xb95a('0x47')](_0x4525fb[_0xb95a('0x36')]);_0x3a61b0[_0xb95a('0x37')]=_[_0xb95a('0x38')](_0x3a61b0[_0xb95a('0x39')],_0x3a61b0[_0xb95a('0x36')]);_0x4869ec[_0xb95a('0x3a')]=_['intersection'](_0x3a61b0[_0xb95a('0x39')],qs['fields'](_0x4525fb['query'][_0xb95a('0x3b')]));_0x4869ec[_0xb95a('0x3a')]=_0x4869ec[_0xb95a('0x3a')][_0xb95a('0x3c')]?_0x4869ec['attributes']:_0x3a61b0['model'];if(_0x4525fb[_0xb95a('0x36')]['includeAll']){_0x4869ec[_0xb95a('0x48')]=[{'all':!![]}];}_0x4869ec=_['merge']({},_0x4869ec,_0x4525fb['options']);return db['Plugin']['find'](_0x4869ec)[_0xb95a('0x28')](handleEntityNotFound(_0x57c692,null))['then'](respondWithResult(_0x57c692,null))['catch'](handleError(_0x57c692,null));};exports['download']=function(_0x4601a4,_0x147555,_0x7ad307){return db[_0xb95a('0x32')][_0xb95a('0x49')]({'where':{'id':_0x4601a4['params']['id']},'attributes':[_0xb95a('0x2e'),_0xb95a('0x5')],'raw':!![]})[_0xb95a('0x28')](handleEntityNotFound(_0x147555,null))[_0xb95a('0x28')](function(_0xea5981){if(_0xea5981){var _0x59f2b2=path[_0xb95a('0x4a')](config[_0xb95a('0x4b')],_0xb95a('0x4c'),util[_0xb95a('0x4d')](_0xb95a('0x4e'),path['basename'](_0xea5981[_0xb95a('0x5')])));var _0x213a4f=fs['createWriteStream'](_0x59f2b2);var _0x1ed499=archiver(_0xb95a('0x4f'),{'zlib':{'level':0x9}});_0x1ed499['on'](_0xb95a('0x50'),function(_0x38a976){if(_0x38a976['code']===_0xb95a('0x51')){logger[_0xb95a('0x2c')](_0x38a976);}else{throw new db[(_0xb95a('0x52'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1ed499['on'](_0xb95a('0x2c'),function(_0x2058b9){throw new db[(_0xb95a('0x52'))][(_0xb95a('0x53'))](_0xb95a('0x54'));});_0x1ed499['pipe'](_0x213a4f);_0x1ed499[_0xb95a('0x55')](_0xb95a('0x56'),{'cwd':path[_0xb95a('0x4a')](config['root'],_0xb95a('0x4c'),path['dirname'](_0xea5981[_0xb95a('0x5')])),'ignore':[path[_0xb95a('0x4a')](path[_0xb95a('0x57')](_0xea5981[_0xb95a('0x5')]),_0xb95a('0x58')),path[_0xb95a('0x4a')](path[_0xb95a('0x57')](_0xea5981[_0xb95a('0x5')]),_0xb95a('0x59'))],'nodir':!![]})[_0xb95a('0x5a')]();_0x213a4f['on'](_0xb95a('0x5b'),function(){if(!fs[_0xb95a('0x5c')](_0x59f2b2)){throw new db[(_0xb95a('0x52'))][(_0xb95a('0x53'))](_0xb95a('0x5d'));}return _0x147555[_0xb95a('0x5e')](_0x59f2b2,util[_0xb95a('0x4d')](_0xb95a('0x4e'),path[_0xb95a('0x57')](_0xea5981[_0xb95a('0x5')])),function(_0x51e87b){if(_0x51e87b){throw new db[(_0xb95a('0x52'))][(_0xb95a('0x53'))](_0xb95a('0x5f'));}fs[_0xb95a('0x60')](_0x59f2b2);logger[_0xb95a('0x61')](_0xb95a('0x62'));logger['info']('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x147555,null));};exports['upload']=function(_0x4748fe,_0x5358d8,_0x34fc53){var _0x2bec17=path[_0xb95a('0x57')](_0x4748fe[_0xb95a('0x63')][_0xb95a('0x64')],path[_0xb95a('0x65')](_0x4748fe['file']['filename']));var _0x15b6c9=path['join'](config[_0xb95a('0x4b')],_0xb95a('0x4c'),_0x4748fe[_0xb95a('0x63')][_0xb95a('0x64')]);var _0x3ad102=path[_0xb95a('0x4a')](config[_0xb95a('0x4b')],_0xb95a('0x4c'),_0x2bec17);logger[_0xb95a('0x61')](_0xb95a('0x66'),_0x15b6c9);logger[_0xb95a('0x61')]('Plugin\x20upload\x20destination:\x20%s',_0x3ad102);try{fs[_0xb95a('0x67')](_0x15b6c9,parseInt(_0xb95a('0x68'),0x8));extract(_0x15b6c9,{'dir':_0x3ad102},function(_0x5f45d2){if(_0x5f45d2){logger[_0xb95a('0x2c')](_0x5f45d2);handleError(_0x5f45d2,!![]);};var _0x2b2228=fs[_0xb95a('0x69')](_0x3ad102);if(_0x2b2228[_0xb95a('0x3c')]>0x1){removeReferences(_0x15b6c9,_0x3ad102);logger[_0xb95a('0x2c')](_0xb95a('0x6a'));return _0x34fc53(new Error(_0xb95a('0x6a')));}var _0xaf2684=fs['lstatSync'](path[_0xb95a('0x4a')](_0x3ad102,_0x2b2228[0x0]));if(_0xaf2684[_0xb95a('0x6b')]()){removeReferences(_0x15b6c9,_0x3ad102);logger[_0xb95a('0x2c')](_0xb95a('0x6a'));return _0x34fc53(new Error(_0xb95a('0x6a')));}if(_0xaf2684[_0xb95a('0x6c')]()){var _0x4dee5d=fs[_0xb95a('0x69')](path[_0xb95a('0x4a')](_0x3ad102,_0x2b2228[0x0]));if(_0x4dee5d[_0xb95a('0x3c')]===0x0){removeReferences(_0x15b6c9,_0x3ad102);logger[_0xb95a('0x2c')]('Invalid\x20plugin\x20structure');return _0x34fc53(new Error('Invalid\x20plugin\x20structure'));}var _0x1b6b8e=_0x4dee5d[_0xb95a('0x6d')](function(_0x3a6174){return _0x3a6174===_0xb95a('0x6e');});if(!_0x1b6b8e){return _0x34fc53(new Error(_0xb95a('0x6f')));}var _0x51c60e=fs[_0xb95a('0x70')](path[_0xb95a('0x4a')](_0x3ad102,_0x2b2228[0x0],_0xb95a('0x6e')));var _0x5dfd01=JSON['parse'](_0x51c60e);if(_0xb95a('0x71')==typeof _0x5dfd01[_0xb95a('0x2e')]){return _0x34fc53(new Error(_0xb95a('0x72')));}if(_0xb95a('0x71')==typeof _0x5dfd01['type']){return _0x34fc53(new Error(_0xb95a('0x73')));}if(_0xb95a('0x71')==typeof _0x5dfd01['version']){return _0x34fc53(new Error(_0xb95a('0x74')));}if(_0xb95a('0x71')==typeof _0x5dfd01[_0xb95a('0x75')]){return _0x34fc53(new Error(_0xb95a('0x76')));}if(_0x5dfd01[_0xb95a('0x34')]===_0xb95a('0x77')){if(_0xb95a('0x71')==typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')]){return _0x34fc53(new Error(_0xb95a('0x79')));}if(_0xb95a('0x71')==typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7a')]&&_0xb95a('0x71')==typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7b')]){return _0x34fc53(new Error(_0xb95a('0x7c')));}}else if(_0x5dfd01[_0xb95a('0x34')]===_0xb95a('0x7d')){if(_0xb95a('0x71')==typeof _0x5dfd01['parameters'][_0xb95a('0x7e')]){return _0x34fc53(new Error(_0xb95a('0x7f')));}if('undefined'==typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x80')]){return _0x34fc53(new Error(_0xb95a('0x81')));}}else{return _0x34fc53(new Error(_0xb95a('0x82')));}var _0x5fe458=_0x5dfd01[_0xb95a('0x2e')];var _0x599415=_0x5dfd01[_0xb95a('0x83')];var _0x3b2df1=_0x5dfd01['type'];var _0x4b6777=_0x5dfd01[_0xb95a('0x84')]?_0x5dfd01[_0xb95a('0x84')]:'always';var _0x16b560=_0x5dfd01[_0xb95a('0x85')]?_0x5dfd01['icon']:_0xb95a('0x86');var _0x5b4d40='';var _0xd96550='';var _0x5092da='';var _0x5eeb4d='';var _0x50283d=_0x5dfd01['version'];if(_0x3b2df1===_0xb95a('0x77')){if(_0xb95a('0x71')!=typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7a')]){var _0x3e473f=_0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xb95a('0x87')](_0x3e473f)){_0x5b4d40=path[_0xb95a('0x4a')](_0xb95a('0x88'),_0x2bec17,_0x2b2228[0x0],_0x3e473f);}else{_0x5b4d40=_0x3e473f;}}else{logger[_0xb95a('0x61')](_0xb95a('0x89'));}if(_0xb95a('0x71')!=typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')]['agent']){var _0x1e27df=_0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xb95a('0x87')](_0x1e27df)){_0xd96550=path[_0xb95a('0x4a')](_0xb95a('0x88'),_0x2bec17,_0x2b2228[0x0],_0x1e27df);}else{_0xd96550=_0x1e27df;}}else{logger[_0xb95a('0x61')](_0xb95a('0x8a'));}}else if(_0x3b2df1===_0xb95a('0x7d')){_0x5092da=_0x5dfd01[_0xb95a('0x75')][_0xb95a('0x7e')];_0x5eeb4d=_0x5dfd01['parameters'][_0xb95a('0x80')];if(_0xb95a('0x71')!=typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')]){if('undefined'!=typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7a')]){var _0x3e473f=_0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xb95a('0x87')](_0x3e473f)){_0x5b4d40=path[_0xb95a('0x4a')](_0xb95a('0x88'),_0x2bec17,_0x2b2228[0x0],_0x3e473f);}else{_0x5b4d40=_0x3e473f;}}if('undefined'!=typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')]['agent']){var _0x1e27df=_0x5dfd01[_0xb95a('0x75')]['views'][_0xb95a('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xb95a('0x87')](_0x1e27df)){_0xd96550=path['join']('plugins',_0x2bec17,_0x2b2228[0x0],_0x1e27df);}else{_0xd96550=_0x1e27df;}}}}var _0x3aac8c={'name':_0x5fe458,'description':_0x599415,'path':path['join'](_0x2bec17,_0x2b2228[0x0]),'type':_0x3b2df1,'sidebar':_0x4b6777,'icon':_0x16b560,'adminUrl':_0x5b4d40,'agentUrl':_0xd96550,'scriptName':_0x5092da,'scriptPath':_0x5eeb4d,'version':_0x50283d};removeReferences(_0x15b6c9,null);return db[_0xb95a('0x32')]['create'](_0x3aac8c)[_0xb95a('0x28')](function(_0x11f867){var _0x5cf13d={'role':_0x4748fe['body']['role'],'userProfileId':_0x4748fe[_0xb95a('0x8b')][_0xb95a('0x8c')]};if(!_0x5cf13d)throw new Error(_0xb95a('0x8d'));if(_0x5cf13d[_0xb95a('0x8e')]==='user'){var _0x5d2e43=_0x11f867[_0xb95a('0x8f')]({'plain':!![]});return db[_0xb95a('0x90')]['find']({'where':{'name':_0xb95a('0x2a'),'userProfileId':_0x5cf13d['userProfileId']},'raw':!![]})[_0xb95a('0x28')](function(_0x1b0e76){if(_0x1b0e76&&_0x1b0e76[_0xb95a('0x91')]===0x0){return db['UserProfileResource'][_0xb95a('0x92')]({'name':_0x5d2e43[_0xb95a('0x2e')],'resourceId':_0x5d2e43['id'],'type':_0x1b0e76['name'],'sectionId':_0x1b0e76['id']},{})[_0xb95a('0x28')](function(){return _0x11f867;});}else{return _0x11f867;}})['catch'](function(_0x5f596f){logger[_0xb95a('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f596f);throw _0x5f596f;});}return _0x11f867;})[_0xb95a('0x28')](respondWithResult(_0x5358d8,null))['catch'](handleError(_0x5358d8,null));}});}catch(_0x16f4fd){_0x5358d8['status'](0x1f4)[_0xb95a('0x2f')](_0x16f4fd);}};function removeReferences(_0x97413,_0x1f0dc0){try{if(_0x97413){fs[_0xb95a('0x60')](_0x97413);logger[_0xb95a('0x61')](_0xb95a('0x93'));}if(_0x1f0dc0){rimraf(_0x1f0dc0,function(){});logger['info'](_0xb95a('0x94'));}}catch(_0x830e9c){logger[_0xb95a('0x2c')](_0x830e9c);}}exports[_0xb95a('0x95')]=function(_0x3c26bc,_0x12b2fc,_0x20e965){return db['Plugin'][_0xb95a('0x49')]({'where':{'id':_0x3c26bc[_0xb95a('0x46')]['id']}})[_0xb95a('0x28')](handleEntityNotFound(_0x12b2fc,null))[_0xb95a('0x28')](saveUpdates(_0x3c26bc[_0xb95a('0x8b')],null))[_0xb95a('0x28')](respondWithResult(_0x12b2fc,null))['catch'](handleError(_0x12b2fc,null));};exports[_0xb95a('0x96')]=function(_0x3c3b0c,_0xc73474,_0xb04092){return db[_0xb95a('0x32')][_0xb95a('0x49')]({'where':{'id':_0x3c3b0c[_0xb95a('0x46')]['id']}})[_0xb95a('0x28')](function(_0x183e9e){if(_0x183e9e){return _0x183e9e[_0xb95a('0x29')]();}})[_0xb95a('0x28')](function(_0x13f066){rimraf(path[_0xb95a('0x4a')](config[_0xb95a('0x4b')],_0xb95a('0x4c'),path[_0xb95a('0x97')](_0x13f066[_0xb95a('0x5')])),function(){});return _0x13f066;})[_0xb95a('0x28')](handleEntityNotFound(_0xc73474,null))['then'](respondWithStatusCode(_0xc73474,null))[_0xb95a('0x44')](handleError(_0xc73474,null));};exports[_0xb95a('0x98')]=function(_0x58f2e0,_0x953020,_0xf9b7a){return BPromise[_0xb95a('0x99')]()[_0xb95a('0x28')](function(){if(!_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x5')]){throw new Error(_0xb95a('0x9a'));}if(!_0x58f2e0['query'][_0xb95a('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x27143f=_0x58f2e0['query']['hostname']?_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x9c')]+':'+_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x9b')]:_0xb95a('0x9d')+_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x9b')];var _0x507e7b=_0x58f2e0['query'][_0xb95a('0x25')]?_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x25')]:!![];var _0x300ad0=_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x9e')]?_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x9e')]:null;var _0x4e3385={'method':_0x58f2e0[_0xb95a('0x9f')],'uri':util['format'](_0xb95a('0xa0'),_0x27143f,_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x5')]),'json':_0x507e7b,'resolveWithFullResponse':!![],'encoding':_0x300ad0,'qs':_0x58f2e0[_0xb95a('0x36')]};if(_0x58f2e0[_0xb95a('0xa1')]){_0x4e3385[_0xb95a('0xa1')]=_0x58f2e0[_0xb95a('0xa1')];if(_0x4e3385['headers'][_0xb95a('0xa2')]){delete _0x4e3385[_0xb95a('0xa1')][_0xb95a('0xa2')];}}if(_0x4e3385['headers'][_0xb95a('0xa3')]){delete _0x4e3385[_0xb95a('0xa1')][_0xb95a('0xa3')];}return rp(_0x4e3385);})[_0xb95a('0x28')](function(_0x18ed5d){if(_0x18ed5d){_0x953020[_0xb95a('0x23')](_0x18ed5d[_0xb95a('0xa1')]);logger[_0xb95a('0x61')](_0x18ed5d['body']);if(_[_0xb95a('0xa4')](_0x58f2e0['query'][_0xb95a('0x5')],_0xb95a('0x5e'))&&_0x18ed5d[_0xb95a('0xa5')]==0x1f4){return _0x953020[_0xb95a('0x1d')](_0x18ed5d['statusCode']);}else{return _0x953020[_0xb95a('0x1e')](_0x18ed5d[_0xb95a('0xa5')])[_0xb95a('0x2f')](_0x18ed5d[_0xb95a('0x8b')]);}}else{return _0x953020[_0xb95a('0x1d')](0xc8);}})[_0xb95a('0x44')](handleError(_0x953020,null));};exports[_0xb95a('0xa6')]=function(_0x571121,_0x2ed6d6,_0x4414ae){return BPromise['resolve']()['then'](function(){if(!_0x571121[_0xb95a('0x36')][_0xb95a('0x5')]){throw new Error(_0xb95a('0x9a'));}if(!_0x571121['query'][_0xb95a('0x9b')]){throw new Error(_0xb95a('0xa7'));}var _0x2b2760=_0x571121[_0xb95a('0x36')][_0xb95a('0x9c')]?_0x571121[_0xb95a('0x36')]['hostname']+':'+_0x571121[_0xb95a('0x36')][_0xb95a('0x9b')]:_0xb95a('0x9d')+_0x571121[_0xb95a('0x36')][_0xb95a('0x9b')];var _0x57ff10=_0x571121[_0xb95a('0x36')][_0xb95a('0x25')]?_0x571121['query'][_0xb95a('0x25')]:!![];var _0x4bee36=_0x571121['query'][_0xb95a('0x9e')]?_0x571121[_0xb95a('0x36')]['encoding']:null;var _0x3f2fac={'method':_0x571121[_0xb95a('0x9f')],'uri':util['format'](_0xb95a('0xa0'),_0x2b2760,_0x571121[_0xb95a('0x36')][_0xb95a('0x5')]),'json':_0x57ff10,'resolveWithFullResponse':!![],'encoding':_0x4bee36,'body':_0x571121['body']};if(_0x571121[_0xb95a('0xa1')]){_0x3f2fac[_0xb95a('0xa1')]=_0x571121[_0xb95a('0xa1')];if(_0x3f2fac[_0xb95a('0xa1')]['content-length']){delete _0x3f2fac[_0xb95a('0xa1')][_0xb95a('0xa2')];}}if(_0x3f2fac['headers'][_0xb95a('0xa3')]){delete _0x3f2fac[_0xb95a('0xa1')][_0xb95a('0xa3')];}return rp(_0x3f2fac);})[_0xb95a('0x28')](function(_0x37394d){if(_0x37394d){_0x2ed6d6[_0xb95a('0x23')](_0x37394d[_0xb95a('0xa1')]);logger[_0xb95a('0x61')](_0x37394d[_0xb95a('0x8b')]);return _0x2ed6d6[_0xb95a('0x1e')](_0x37394d[_0xb95a('0xa5')])[_0xb95a('0x2f')](_0x37394d['body']);}else{return _0x2ed6d6['sendStatus'](0xc8);}})[_0xb95a('0x44')](handleError(_0x2ed6d6,null));}; \ No newline at end of file +var _0x1f55=['moment','bluebird','mustache','util','sox','squel','jsforce','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','destroy','get','then','end','error','name','send','Plugin','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','find','download','path','join','root','format','%s.zip','zip','warning','code','Sequelize','Error','pipe','glob','**/*','server/files/plugins','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','upload','filename','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','version','parameters','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','headers','content-type','set','endsWith','statusCode','webhookPost','%s%s','content-length','rimraf','zip-dir','fast-json-patch'];(function(_0x42d2af,_0x3961b5){var _0x1d6d63=function(_0x10833e){while(--_0x10833e){_0x42d2af['push'](_0x42d2af['shift']());}};_0x1d6d63(++_0x3961b5);}(_0x1f55,0x147));var _0x51f5=function(_0x2b020e,_0x4afedd){_0x2b020e=_0x2b020e-0x0;var _0xc7ceb5=_0x1f55[_0x2b020e];return _0xc7ceb5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51f5('0x0'));var zipdir=require(_0x51f5('0x1'));var jsonpatch=require(_0x51f5('0x2'));var rp=require('request-promise');var moment=require(_0x51f5('0x3'));var BPromise=require(_0x51f5('0x4'));var Mustache=require(_0x51f5('0x5'));var util=require(_0x51f5('0x6'));var path=require('path');var sox=require(_0x51f5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x51f5('0x8'));var crypto=require('crypto');var jsforce=require(_0x51f5('0x9'));var deskjs=require(_0x51f5('0xa'));var toCsv=require(_0x51f5('0xb'));var querystring=require(_0x51f5('0xc'));var Papa=require(_0x51f5('0xd'));var extract=require(_0x51f5('0xe'));var rimraf=require('rimraf');var archiver=require(_0x51f5('0xf'));var Redis=require('ioredis');var authService=require(_0x51f5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x51f5('0x11'));var hardwareService=require(_0x51f5('0x12'));var logger=require(_0x51f5('0x13'))(_0x51f5('0x14'));var utils=require(_0x51f5('0x15'));var config=require(_0x51f5('0x16'));var licenseUtil=require(_0x51f5('0x17'));var db=require(_0x51f5('0x18'))['db'];config[_0x51f5('0x19')]=_['defaults'](config[_0x51f5('0x19')],{'host':_0x51f5('0x1a'),'port':0x18eb});var socket=require(_0x51f5('0x1b'))(new Redis(config[_0x51f5('0x19')]));require('./plugin.socket')[_0x51f5('0x1c')](socket);function respondWithStatusCode(_0x5c074e,_0x835590){_0x835590=_0x835590||0xcc;return function(_0x42eae7){if(_0x42eae7){return _0x5c074e[_0x51f5('0x1d')](_0x835590);}return _0x5c074e[_0x51f5('0x1e')](_0x835590)['end']();};}function respondWithResult(_0x5c208e,_0x16766a){_0x16766a=_0x16766a||0xc8;return function(_0x2a194a){if(_0x2a194a){return _0x5c208e[_0x51f5('0x1e')](_0x16766a)[_0x51f5('0x1f')](_0x2a194a);}};}function respondWithFilteredResult(_0x5b77d9,_0x1e841d){return function(_0x204d10){if(_0x204d10){var _0x2ae75d=typeof _0x1e841d[_0x51f5('0x20')]===_0x51f5('0x21')&&typeof _0x1e841d['limit']===_0x51f5('0x21');var _0x34ae3d=_0x204d10['count'];var _0x24e63f=_0x2ae75d?0x0:_0x1e841d[_0x51f5('0x20')];var _0x5b4b86=_0x2ae75d?_0x204d10['count']:_0x1e841d['offset']+_0x1e841d[_0x51f5('0x22')];var _0x88dff8;if(_0x5b4b86>=_0x34ae3d){_0x5b4b86=_0x34ae3d;_0x88dff8=0xc8;}else{_0x88dff8=0xce;}_0x5b77d9['status'](_0x88dff8);return _0x5b77d9['set'](_0x51f5('0x23'),_0x24e63f+'-'+_0x5b4b86+'/'+_0x34ae3d)[_0x51f5('0x1f')](_0x204d10);}return null;};}function patchUpdates(_0x507552){return function(_0x5d2c5b){try{jsonpatch[_0x51f5('0x24')](_0x5d2c5b,_0x507552,!![]);}catch(_0x36acc1){return BPromise[_0x51f5('0x25')](_0x36acc1);}return _0x5d2c5b[_0x51f5('0x26')]();};}function saveUpdates(_0x1c9596,_0x1badf6){return function(_0x1c47f1){if(_0x1c47f1){return _0x1c47f1[_0x51f5('0x27')](_0x1c9596)['then'](function(_0x527f74){return _0x527f74;});}return null;};}function removeEntity(_0x94ca,_0x48af74){return function(_0x32ae92){if(_0x32ae92){return _0x32ae92[_0x51f5('0x28')]()['then'](function(){var _0x3f3c1d=_0x32ae92[_0x51f5('0x29')]({'plain':!![]});var _0x5323c1='Plugins';return db['UserProfileResource'][_0x51f5('0x28')]({'where':{'type':_0x5323c1,'resourceId':_0x3f3c1d['id']}})[_0x51f5('0x2a')](function(){return _0x32ae92;});})[_0x51f5('0x2a')](function(){_0x94ca['status'](0xcc)[_0x51f5('0x2b')]();});}};}function handleEntityNotFound(_0x43b957,_0x1ced0f){return function(_0x2f0c8d){if(!_0x2f0c8d){_0x43b957['sendStatus'](0x194);}return _0x2f0c8d;};}function handleError(_0x446250,_0x3c45af){_0x3c45af=_0x3c45af||0x1f4;return function(_0x4ec792){logger[_0x51f5('0x2c')](_0x4ec792['stack']);if(_0x4ec792[_0x51f5('0x2d')]){delete _0x4ec792[_0x51f5('0x2d')];}_0x446250[_0x51f5('0x1e')](_0x3c45af)[_0x51f5('0x2e')](_0x4ec792);};}exports['index']=function(_0x343c02,_0x4a5783){var _0x1fdc74={},_0x527ada={},_0x16176b={'count':0x0,'rows':[]};var _0x5cc7dc=_['map'](db[_0x51f5('0x2f')][_0x51f5('0x30')],function(_0x3f1338){return{'name':_0x3f1338['fieldName'],'type':_0x3f1338[_0x51f5('0x31')][_0x51f5('0x32')]};});_0x527ada['model']=_['map'](_0x5cc7dc,_0x51f5('0x2d'));_0x527ada[_0x51f5('0x33')]=_[_0x51f5('0x34')](_0x343c02['query']);_0x527ada[_0x51f5('0x35')]=_['intersection'](_0x527ada['model'],_0x527ada['query']);_0x1fdc74['attributes']=_[_0x51f5('0x36')](_0x527ada[_0x51f5('0x37')],qs[_0x51f5('0x38')](_0x343c02[_0x51f5('0x33')]['fields']));_0x1fdc74[_0x51f5('0x39')]=_0x1fdc74[_0x51f5('0x39')][_0x51f5('0x3a')]?_0x1fdc74[_0x51f5('0x39')]:_0x527ada[_0x51f5('0x37')];if(!_0x343c02[_0x51f5('0x33')][_0x51f5('0x3b')](_0x51f5('0x3c'))){_0x1fdc74['limit']=qs[_0x51f5('0x22')](_0x343c02[_0x51f5('0x33')][_0x51f5('0x22')]);_0x1fdc74[_0x51f5('0x20')]=qs[_0x51f5('0x20')](_0x343c02[_0x51f5('0x33')][_0x51f5('0x20')]);}_0x1fdc74[_0x51f5('0x3d')]=qs[_0x51f5('0x3e')](_0x343c02[_0x51f5('0x33')][_0x51f5('0x3e')]);_0x1fdc74[_0x51f5('0x3f')]=qs[_0x51f5('0x35')](_[_0x51f5('0x40')](_0x343c02['query'],_0x527ada[_0x51f5('0x35')]),_0x5cc7dc);if(_0x343c02[_0x51f5('0x33')]['filter']){_0x1fdc74[_0x51f5('0x3f')]=_[_0x51f5('0x41')](_0x1fdc74[_0x51f5('0x3f')],{'$or':_[_0x51f5('0x42')](_0x5cc7dc,function(_0xf12701){if(_0xf12701[_0x51f5('0x31')]!==_0x51f5('0x43')){var _0x215d71={};_0x215d71[_0xf12701[_0x51f5('0x2d')]]={'$like':'%'+_0x343c02[_0x51f5('0x33')][_0x51f5('0x44')]+'%'};return _0x215d71;}})});}_0x1fdc74=_[_0x51f5('0x41')]({},_0x1fdc74,_0x343c02[_0x51f5('0x45')]);var _0x35fc52={'where':_0x1fdc74[_0x51f5('0x3f')]};return db[_0x51f5('0x2f')][_0x51f5('0x46')](_0x35fc52)[_0x51f5('0x2a')](function(_0x4f1cdd){_0x16176b[_0x51f5('0x46')]=_0x4f1cdd;if(_0x343c02['query'][_0x51f5('0x47')]){_0x1fdc74[_0x51f5('0x48')]=[{'all':!![]}];}return db['Plugin'][_0x51f5('0x49')](_0x1fdc74);})[_0x51f5('0x2a')](function(_0x2d03fe){_0x16176b[_0x51f5('0x4a')]=_0x2d03fe;return _0x16176b;})['then'](respondWithFilteredResult(_0x4a5783,_0x1fdc74))[_0x51f5('0x4b')](handleError(_0x4a5783,null));};exports[_0x51f5('0x4c')]=function(_0x56e2f2,_0x1320c7){var _0xe67b35={'raw':!![],'where':{'id':_0x56e2f2[_0x51f5('0x4d')]['id']}},_0x2b81e2={};_0x2b81e2[_0x51f5('0x37')]=_['keys'](db[_0x51f5('0x2f')]['rawAttributes']);_0x2b81e2[_0x51f5('0x33')]=_[_0x51f5('0x34')](_0x56e2f2['query']);_0x2b81e2[_0x51f5('0x35')]=_[_0x51f5('0x36')](_0x2b81e2[_0x51f5('0x37')],_0x2b81e2['query']);_0xe67b35[_0x51f5('0x39')]=_['intersection'](_0x2b81e2[_0x51f5('0x37')],qs[_0x51f5('0x38')](_0x56e2f2[_0x51f5('0x33')]['fields']));_0xe67b35[_0x51f5('0x39')]=_0xe67b35[_0x51f5('0x39')][_0x51f5('0x3a')]?_0xe67b35[_0x51f5('0x39')]:_0x2b81e2['model'];if(_0x56e2f2[_0x51f5('0x33')]['includeAll']){_0xe67b35[_0x51f5('0x48')]=[{'all':!![]}];}_0xe67b35=_[_0x51f5('0x41')]({},_0xe67b35,_0x56e2f2[_0x51f5('0x45')]);return db[_0x51f5('0x2f')][_0x51f5('0x4e')](_0xe67b35)[_0x51f5('0x2a')](handleEntityNotFound(_0x1320c7,null))['then'](respondWithResult(_0x1320c7,null))[_0x51f5('0x4b')](handleError(_0x1320c7,null));};exports[_0x51f5('0x4f')]=function(_0x1bec31,_0x2318d2,_0xc89e9c){return db['Plugin'][_0x51f5('0x4e')]({'where':{'id':_0x1bec31[_0x51f5('0x4d')]['id']},'attributes':[_0x51f5('0x2d'),_0x51f5('0x50')],'raw':!![]})[_0x51f5('0x2a')](handleEntityNotFound(_0x2318d2,null))[_0x51f5('0x2a')](function(_0x4d3176){if(_0x4d3176){var _0x61169b=path[_0x51f5('0x51')](config[_0x51f5('0x52')],'server/files/plugins',util[_0x51f5('0x53')](_0x51f5('0x54'),path['basename'](_0x4d3176[_0x51f5('0x50')])));var _0x18996c=fs['createWriteStream'](_0x61169b);var _0x30192f=archiver(_0x51f5('0x55'),{'zlib':{'level':0x9}});_0x30192f['on'](_0x51f5('0x56'),function(_0x489594){if(_0x489594[_0x51f5('0x57')]==='ENOENT'){logger['error'](_0x489594);}else{throw new db[(_0x51f5('0x58'))][(_0x51f5('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x30192f['on'](_0x51f5('0x2c'),function(_0x749021){throw new db[(_0x51f5('0x58'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x30192f[_0x51f5('0x5a')](_0x18996c);_0x30192f[_0x51f5('0x5b')](_0x51f5('0x5c'),{'cwd':path['join'](config['root'],_0x51f5('0x5d'),path[_0x51f5('0x5e')](_0x4d3176['path'])),'ignore':[path[_0x51f5('0x51')](path[_0x51f5('0x5f')](_0x4d3176[_0x51f5('0x50')]),_0x51f5('0x60')),path[_0x51f5('0x51')](path['basename'](_0x4d3176[_0x51f5('0x50')]),_0x51f5('0x61'))],'nodir':!![]})[_0x51f5('0x62')]();_0x18996c['on'](_0x51f5('0x63'),function(){if(!fs['existsSync'](_0x61169b)){throw new db['Sequelize'][(_0x51f5('0x59'))](_0x51f5('0x64'));}return _0x2318d2[_0x51f5('0x4f')](_0x61169b,util[_0x51f5('0x53')](_0x51f5('0x54'),path[_0x51f5('0x5f')](_0x4d3176['path'])),function(_0x26754e){if(_0x26754e){throw new db['Sequelize'][(_0x51f5('0x59'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x51f5('0x65')](_0x61169b);logger[_0x51f5('0x66')](_0x51f5('0x67'));logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0x51f5('0x4b')](handleError(_0x2318d2,null));};exports[_0x51f5('0x68')]=function(_0x513a97,_0x4acbce,_0x38350e){var _0x4d269d=path[_0x51f5('0x5f')](_0x513a97['file'][_0x51f5('0x69')],path['extname'](_0x513a97[_0x51f5('0x6a')][_0x51f5('0x69')]));var _0x2b4bf4=path[_0x51f5('0x51')](config[_0x51f5('0x52')],_0x51f5('0x5d'),_0x513a97[_0x51f5('0x6a')][_0x51f5('0x69')]);var _0x3bfb8d=path[_0x51f5('0x51')](config[_0x51f5('0x52')],_0x51f5('0x5d'),_0x4d269d);logger[_0x51f5('0x66')](_0x51f5('0x6b'),_0x2b4bf4);logger['info'](_0x51f5('0x6c'),_0x3bfb8d);try{fs[_0x51f5('0x6d')](_0x2b4bf4,parseInt(_0x51f5('0x6e'),0x8));extract(_0x2b4bf4,{'dir':_0x3bfb8d},function(_0xc6d6d7){if(_0xc6d6d7){logger[_0x51f5('0x2c')](_0xc6d6d7);handleError(_0xc6d6d7,!![]);};var _0x4dbcd1=fs['readdirSync'](_0x3bfb8d);if(_0x4dbcd1[_0x51f5('0x3a')]>0x1){removeReferences(_0x2b4bf4,_0x3bfb8d);logger['error'](_0x51f5('0x6f'));return _0x38350e(new Error(_0x51f5('0x6f')));}var _0x42fb96=fs['lstatSync'](path[_0x51f5('0x51')](_0x3bfb8d,_0x4dbcd1[0x0]));if(_0x42fb96['isFile']()){removeReferences(_0x2b4bf4,_0x3bfb8d);logger[_0x51f5('0x2c')](_0x51f5('0x6f'));return _0x38350e(new Error('Invalid\x20plugin\x20structure'));}if(_0x42fb96[_0x51f5('0x70')]()){var _0x2de908=fs['readdirSync'](path[_0x51f5('0x51')](_0x3bfb8d,_0x4dbcd1[0x0]));if(_0x2de908['length']===0x0){removeReferences(_0x2b4bf4,_0x3bfb8d);logger[_0x51f5('0x2c')](_0x51f5('0x6f'));return _0x38350e(new Error(_0x51f5('0x6f')));}var _0x5b19e2=_0x2de908[_0x51f5('0x71')](function(_0x4aaf7b){return _0x4aaf7b==='manifest.json';});if(!_0x5b19e2){return _0x38350e(new Error(_0x51f5('0x72')));}var _0x198782=fs[_0x51f5('0x73')](path[_0x51f5('0x51')](_0x3bfb8d,_0x4dbcd1[0x0],_0x51f5('0x74')));var _0x78eb42=JSON[_0x51f5('0x75')](_0x198782);if(_0x51f5('0x21')==typeof _0x78eb42['name']){return _0x38350e(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x78eb42[_0x51f5('0x31')]){return _0x38350e(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x51f5('0x21')==typeof _0x78eb42[_0x51f5('0x76')]){return _0x38350e(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x51f5('0x21')==typeof _0x78eb42[_0x51f5('0x77')]){return _0x38350e(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x78eb42['type']==='html'){if(_0x51f5('0x21')==typeof _0x78eb42[_0x51f5('0x77')][_0x51f5('0x78')]){return _0x38350e(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x51f5('0x21')==typeof _0x78eb42['parameters'][_0x51f5('0x78')][_0x51f5('0x79')]&&'undefined'==typeof _0x78eb42['parameters'][_0x51f5('0x78')][_0x51f5('0x7a')]){return _0x38350e(new Error(_0x51f5('0x7b')));}}else if(_0x78eb42[_0x51f5('0x31')]===_0x51f5('0x7c')){if(_0x51f5('0x21')==typeof _0x78eb42[_0x51f5('0x77')][_0x51f5('0x7d')]){return _0x38350e(new Error(_0x51f5('0x7e')));}if(_0x51f5('0x21')==typeof _0x78eb42['parameters'][_0x51f5('0x7f')]){return _0x38350e(new Error(_0x51f5('0x80')));}}else{return _0x38350e(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x2fe250=_0x78eb42[_0x51f5('0x2d')];var _0x2ad40b=_0x78eb42[_0x51f5('0x81')];var _0x56e578=_0x78eb42[_0x51f5('0x31')];var _0x5bf154=_0x78eb42[_0x51f5('0x82')]?_0x78eb42[_0x51f5('0x82')]:'always';var _0x24c68f=_0x78eb42[_0x51f5('0x83')]?_0x78eb42['icon']:_0x51f5('0x84');var _0xd316f6='';var _0x2544c7='';var _0xd20db4='';var _0x382f76='';var _0x14d914=_0x78eb42[_0x51f5('0x76')];if(_0x56e578===_0x51f5('0x85')){if(_0x51f5('0x21')!=typeof _0x78eb42[_0x51f5('0x77')][_0x51f5('0x78')][_0x51f5('0x79')]){var _0x498d4d=_0x78eb42[_0x51f5('0x77')][_0x51f5('0x78')][_0x51f5('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x51f5('0x86')](_0x498d4d)){_0xd316f6=path[_0x51f5('0x51')](_0x51f5('0x87'),_0x4d269d,_0x4dbcd1[0x0],_0x498d4d);}else{_0xd316f6=_0x498d4d;}}else{logger[_0x51f5('0x66')](_0x51f5('0x88'));}if(_0x51f5('0x21')!=typeof _0x78eb42['parameters'][_0x51f5('0x78')]['agent']){var _0x2a4d5a=_0x78eb42[_0x51f5('0x77')][_0x51f5('0x78')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x51f5('0x86')](_0x2a4d5a)){_0x2544c7=path['join'](_0x51f5('0x87'),_0x4d269d,_0x4dbcd1[0x0],_0x2a4d5a);}else{_0x2544c7=_0x2a4d5a;}}else{logger[_0x51f5('0x66')](_0x51f5('0x89'));}}else if(_0x56e578==='script'){_0xd20db4=_0x78eb42[_0x51f5('0x77')][_0x51f5('0x7d')];_0x382f76=_0x78eb42[_0x51f5('0x77')][_0x51f5('0x7f')];if(_0x51f5('0x21')!=typeof _0x78eb42[_0x51f5('0x77')][_0x51f5('0x78')]){if(_0x51f5('0x21')!=typeof _0x78eb42[_0x51f5('0x77')][_0x51f5('0x78')][_0x51f5('0x79')]){var _0x498d4d=_0x78eb42[_0x51f5('0x77')][_0x51f5('0x78')][_0x51f5('0x79')];if(!/^(f|ht)tps?:\/\//i['test'](_0x498d4d)){_0xd316f6=path[_0x51f5('0x51')](_0x51f5('0x87'),_0x4d269d,_0x4dbcd1[0x0],_0x498d4d);}else{_0xd316f6=_0x498d4d;}}if(_0x51f5('0x21')!=typeof _0x78eb42[_0x51f5('0x77')][_0x51f5('0x78')][_0x51f5('0x7a')]){var _0x2a4d5a=_0x78eb42[_0x51f5('0x77')][_0x51f5('0x78')][_0x51f5('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0x51f5('0x86')](_0x2a4d5a)){_0x2544c7=path['join'](_0x51f5('0x87'),_0x4d269d,_0x4dbcd1[0x0],_0x2a4d5a);}else{_0x2544c7=_0x2a4d5a;}}}}var _0x349f6d={'name':_0x2fe250,'description':_0x2ad40b,'path':path[_0x51f5('0x51')](_0x4d269d,_0x4dbcd1[0x0]),'type':_0x56e578,'sidebar':_0x5bf154,'icon':_0x24c68f,'adminUrl':_0xd316f6,'agentUrl':_0x2544c7,'scriptName':_0xd20db4,'scriptPath':_0x382f76,'version':_0x14d914};removeReferences(_0x2b4bf4,null);return db[_0x51f5('0x2f')][_0x51f5('0x8a')](_0x349f6d)['then'](function(_0x4def2c){var _0x500d6e={'role':_0x513a97['body']['role'],'userProfileId':_0x513a97[_0x51f5('0x8b')]['userProfileId']};if(!_0x500d6e)throw new Error(_0x51f5('0x8c'));if(_0x500d6e[_0x51f5('0x8d')]==='user'){var _0x3563cf=_0x4def2c[_0x51f5('0x29')]({'plain':!![]});return db[_0x51f5('0x8e')][_0x51f5('0x4e')]({'where':{'name':_0x51f5('0x8f'),'userProfileId':_0x500d6e['userProfileId']},'raw':!![]})[_0x51f5('0x2a')](function(_0x311bc6){if(_0x311bc6&&_0x311bc6[_0x51f5('0x90')]===0x0){return db['UserProfileResource'][_0x51f5('0x8a')]({'name':_0x3563cf['name'],'resourceId':_0x3563cf['id'],'type':_0x311bc6['name'],'sectionId':_0x311bc6['id']},{})['then'](function(){return _0x4def2c;});}else{return _0x4def2c;}})['catch'](function(_0x2f926e){logger[_0x51f5('0x2c')](_0x51f5('0x91'),_0x2f926e);throw _0x2f926e;});}return _0x4def2c;})['then'](respondWithResult(_0x4acbce,null))['catch'](handleError(_0x4acbce,null));}});}catch(_0x5ecb60){_0x4acbce[_0x51f5('0x1e')](0x1f4)[_0x51f5('0x2e')](_0x5ecb60);}};function removeReferences(_0x4b8b38,_0x358e1f){try{if(_0x4b8b38){fs[_0x51f5('0x65')](_0x4b8b38);logger['info'](_0x51f5('0x92'));}if(_0x358e1f){rimraf(_0x358e1f,function(){});logger['info'](_0x51f5('0x93'));}}catch(_0x515bff){logger[_0x51f5('0x2c')](_0x515bff);}}exports[_0x51f5('0x27')]=function(_0x40bf73,_0x556d31,_0x4c01fa){return db['Plugin'][_0x51f5('0x4e')]({'where':{'id':_0x40bf73[_0x51f5('0x4d')]['id']}})['then'](handleEntityNotFound(_0x556d31,null))[_0x51f5('0x2a')](saveUpdates(_0x40bf73[_0x51f5('0x8b')],null))[_0x51f5('0x2a')](respondWithResult(_0x556d31,null))['catch'](handleError(_0x556d31,null));};exports[_0x51f5('0x94')]=function(_0x561362,_0xc4efaf,_0x3c83b8){return db['Plugin'][_0x51f5('0x4e')]({'where':{'id':_0x561362[_0x51f5('0x4d')]['id']}})['then'](function(_0x18a689){if(_0x18a689){return _0x18a689[_0x51f5('0x28')]();}})[_0x51f5('0x2a')](function(_0x2dca84){rimraf(path[_0x51f5('0x51')](config['root'],_0x51f5('0x5d'),path[_0x51f5('0x5e')](_0x2dca84[_0x51f5('0x50')])),function(){});return _0x2dca84;})[_0x51f5('0x2a')](handleEntityNotFound(_0xc4efaf,null))['then'](respondWithStatusCode(_0xc4efaf,null))[_0x51f5('0x4b')](handleError(_0xc4efaf,null));};exports[_0x51f5('0x95')]=function(_0x2a354e,_0x1718d7,_0x35d7f0){return BPromise[_0x51f5('0x96')]()[_0x51f5('0x2a')](function(){if(!_0x2a354e[_0x51f5('0x33')][_0x51f5('0x50')]){throw new Error(_0x51f5('0x97'));}if(!_0x2a354e[_0x51f5('0x33')][_0x51f5('0x98')]){throw new Error(_0x51f5('0x99'));}var _0x8996df=_0x2a354e[_0x51f5('0x33')][_0x51f5('0x9a')]?_0x2a354e[_0x51f5('0x33')][_0x51f5('0x9a')]+':'+_0x2a354e[_0x51f5('0x33')][_0x51f5('0x98')]:'http://localhost:'+_0x2a354e[_0x51f5('0x33')][_0x51f5('0x98')];var _0x1f2edd=_0x2a354e['query'][_0x51f5('0x1f')]?_0x2a354e[_0x51f5('0x33')][_0x51f5('0x1f')]:!![];var _0x4cf83d=_0x2a354e[_0x51f5('0x33')][_0x51f5('0x9b')]?_0x2a354e[_0x51f5('0x33')][_0x51f5('0x9b')]:null;var _0x287818={'method':_0x2a354e[_0x51f5('0x9c')],'uri':util['format']('%s%s',_0x8996df,_0x2a354e[_0x51f5('0x33')][_0x51f5('0x50')]),'json':_0x1f2edd,'resolveWithFullResponse':!![],'encoding':_0x4cf83d,'qs':_0x2a354e[_0x51f5('0x33')]};if(_0x2a354e[_0x51f5('0x9d')]){_0x287818[_0x51f5('0x9d')]=_0x2a354e[_0x51f5('0x9d')];if(_0x287818['headers']['content-length']){delete _0x287818[_0x51f5('0x9d')]['content-length'];}}if(_0x287818['headers']['content-type']){delete _0x287818[_0x51f5('0x9d')][_0x51f5('0x9e')];}return rp(_0x287818);})[_0x51f5('0x2a')](function(_0x6501b2){if(_0x6501b2){_0x1718d7[_0x51f5('0x9f')](_0x6501b2[_0x51f5('0x9d')]);logger['info'](_0x6501b2[_0x51f5('0x8b')]);if(_[_0x51f5('0xa0')](_0x2a354e[_0x51f5('0x33')][_0x51f5('0x50')],'download')&&_0x6501b2[_0x51f5('0xa1')]==0x1f4){return _0x1718d7['sendStatus'](_0x6501b2[_0x51f5('0xa1')]);}else{return _0x1718d7[_0x51f5('0x1e')](_0x6501b2[_0x51f5('0xa1')])['send'](_0x6501b2[_0x51f5('0x8b')]);}}else{return _0x1718d7[_0x51f5('0x1d')](0xc8);}})['catch'](handleError(_0x1718d7,null));};exports[_0x51f5('0xa2')]=function(_0xad1804,_0x64b198,_0x65af5a){return BPromise[_0x51f5('0x96')]()[_0x51f5('0x2a')](function(){if(!_0xad1804[_0x51f5('0x33')]['path']){throw new Error(_0x51f5('0x97'));}if(!_0xad1804[_0x51f5('0x33')][_0x51f5('0x98')]){throw new Error(_0x51f5('0x99'));}var _0x514c31=_0xad1804[_0x51f5('0x33')][_0x51f5('0x9a')]?_0xad1804['query']['hostname']+':'+_0xad1804[_0x51f5('0x33')][_0x51f5('0x98')]:'http://localhost:'+_0xad1804[_0x51f5('0x33')][_0x51f5('0x98')];var _0x49db47=_0xad1804[_0x51f5('0x33')]['json']?_0xad1804[_0x51f5('0x33')][_0x51f5('0x1f')]:!![];var _0x1aa683=_0xad1804[_0x51f5('0x33')][_0x51f5('0x9b')]?_0xad1804[_0x51f5('0x33')][_0x51f5('0x9b')]:null;var _0x12753f={'method':_0xad1804[_0x51f5('0x9c')],'uri':util[_0x51f5('0x53')](_0x51f5('0xa3'),_0x514c31,_0xad1804[_0x51f5('0x33')][_0x51f5('0x50')]),'json':_0x49db47,'resolveWithFullResponse':!![],'encoding':_0x1aa683,'body':_0xad1804[_0x51f5('0x8b')]};if(_0xad1804[_0x51f5('0x9d')]){_0x12753f[_0x51f5('0x9d')]=_0xad1804[_0x51f5('0x9d')];if(_0x12753f[_0x51f5('0x9d')][_0x51f5('0xa4')]){delete _0x12753f[_0x51f5('0x9d')][_0x51f5('0xa4')];}}if(_0x12753f[_0x51f5('0x9d')]['content-type']){delete _0x12753f['headers'][_0x51f5('0x9e')];}return rp(_0x12753f);})['then'](function(_0x29d64b){if(_0x29d64b){_0x64b198[_0x51f5('0x9f')](_0x29d64b[_0x51f5('0x9d')]);logger[_0x51f5('0x66')](_0x29d64b[_0x51f5('0x8b')]);return _0x64b198[_0x51f5('0x1e')](_0x29d64b[_0x51f5('0xa1')])[_0x51f5('0x2e')](_0x29d64b[_0x51f5('0x8b')]);}else{return _0x64b198[_0x51f5('0x1d')](0xc8);}})[_0x51f5('0x4b')](handleError(_0x64b198,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index bd7ddfd..352ad9c 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 _0x7278=['hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','remove','emit'];(function(_0x573c19,_0x5525bd){var _0x26df1d=function(_0x1ce098){while(--_0x1ce098){_0x573c19['push'](_0x573c19['shift']());}};_0x26df1d(++_0x5525bd);}(_0x7278,0x161));var _0x8727=function(_0x489afb,_0x40738f){_0x489afb=_0x489afb-0x0;var _0x45ad1b=_0x7278[_0x489afb];return _0x45ad1b;};'use strict';var EventEmitter=require(_0x8727('0x0'));var Plugin=require(_0x8727('0x1'))['db'][_0x8727('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x8727('0x3')](0x0);var events={'afterCreate':_0x8727('0x4'),'afterUpdate':'update','afterDestroy':_0x8727('0x5')};function emitEvent(_0x19c8ac){return function(_0x6007de,_0x221021,_0x2df052){PluginEvents[_0x8727('0x6')](_0x19c8ac+':'+_0x6007de['id'],_0x6007de);PluginEvents[_0x8727('0x6')](_0x19c8ac,_0x6007de);_0x2df052(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x8727('0x7')](e,emitEvent(event));}}module[_0x8727('0x8')]=PluginEvents; \ No newline at end of file +var _0x04cc=['hasOwnProperty','hook','events','../../mysqldb','Plugin','setMaxListeners','update','emit'];(function(_0x21e6dd,_0x4c44ee){var _0x53515c=function(_0x47174d){while(--_0x47174d){_0x21e6dd['push'](_0x21e6dd['shift']());}};_0x53515c(++_0x4c44ee);}(_0x04cc,0x11a));var _0xc04c=function(_0x22e513,_0x53d375){_0x22e513=_0x22e513-0x0;var _0x55d29b=_0x04cc[_0x22e513];return _0x55d29b;};'use strict';var EventEmitter=require(_0xc04c('0x0'));var Plugin=require(_0xc04c('0x1'))['db'][_0xc04c('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xc04c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc04c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4cca40){return function(_0x138028,_0x2fefd7,_0x153c93){PluginEvents[_0xc04c('0x5')](_0x4cca40+':'+_0x138028['id'],_0x138028);PluginEvents[_0xc04c('0x5')](_0x4cca40,_0x138028);_0x153c93(null);};}for(var e in events){if(events[_0xc04c('0x6')](e)){var event=events[e];Plugin[_0xc04c('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index a6913fe..a00b2c6 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 _0x8840=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger'];(function(_0x3163e9,_0x45f4c4){var _0x175bf0=function(_0x589888){while(--_0x589888){_0x3163e9['push'](_0x3163e9['shift']());}};_0x175bf0(++_0x45f4c4);}(_0x8840,0x15b));var _0x0884=function(_0x319df2,_0x4085fb){_0x319df2=_0x319df2-0x0;var _0x41f9df=_0x8840[_0x319df2];return _0x41f9df;};'use strict';var _=require(_0x0884('0x0'));var util=require(_0x0884('0x1'));var logger=require(_0x0884('0x2'))(_0x0884('0x3'));var moment=require(_0x0884('0x4'));var BPromise=require(_0x0884('0x5'));var rp=require(_0x0884('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0884('0x7'));var config=require(_0x0884('0x8'));var attributes=require(_0x0884('0x9'));module[_0x0884('0xa')]=function(_0x4dfa82,_0x45a820){return _0x4dfa82[_0x0884('0xb')](_0x0884('0xc'),attributes,{'tableName':_0x0884('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0e7=['bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','lodash','util','../../config/logger','api'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xa0e7,0x141));var _0x7a0e=function(_0x100710,_0x2fa428){_0x100710=_0x100710-0x0;var _0x18b4e3=_0xa0e7[_0x100710];return _0x18b4e3;};'use strict';var _=require(_0x7a0e('0x0'));var util=require(_0x7a0e('0x1'));var logger=require(_0x7a0e('0x2'))(_0x7a0e('0x3'));var moment=require('moment');var BPromise=require(_0x7a0e('0x4'));var rp=require(_0x7a0e('0x5'));var fs=require('fs');var path=require(_0x7a0e('0x6'));var rimraf=require(_0x7a0e('0x7'));var config=require(_0x7a0e('0x8'));var attributes=require(_0x7a0e('0x9'));module[_0x7a0e('0xa')]=function(_0x1a12dd,_0x5c8f72){return _0x1a12dd[_0x7a0e('0xb')](_0x7a0e('0xc'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 5f20f30..cfed4ba 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 _0x5fbd=['../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','CreatePlugin','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x418570,_0x565e2f){var _0x2fcd53=function(_0x39cddc){while(--_0x39cddc){_0x418570['push'](_0x418570['shift']());}};_0x2fcd53(++_0x565e2f);}(_0x5fbd,0x109));var _0xd5fb=function(_0x4db775,_0x30f6d0){_0x4db775=_0x4db775-0x0;var _0x5b245d=_0x5fbd[_0x4db775];return _0x5b245d;};'use strict';var _=require('lodash');var util=require(_0xd5fb('0x0'));var moment=require(_0xd5fb('0x1'));var BPromise=require(_0xd5fb('0x2'));var rs=require(_0xd5fb('0x3'));var fs=require('fs');var Redis=require(_0xd5fb('0x4'));var db=require(_0xd5fb('0x5'))['db'];var utils=require(_0xd5fb('0x6'));var logger=require(_0xd5fb('0x7'))(_0xd5fb('0x8'));var config=require(_0xd5fb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd5fb('0xa')][_0xd5fb('0xb')]({'port':0x232a});config[_0xd5fb('0xc')]=_['defaults'](config['redis'],{'host':_0xd5fb('0xd'),'port':0x18eb});var socket=require(_0xd5fb('0xe'))(new Redis(config[_0xd5fb('0xc')]));require(_0xd5fb('0xf'))[_0xd5fb('0x10')](socket);function respondWithRpcPromise(_0x138115,_0x13b990,_0x1a47f7){return new BPromise(function(_0x5aaa1e,_0x1fd53c){return client[_0xd5fb('0x11')](_0x138115,_0x1a47f7)[_0xd5fb('0x12')](function(_0x43e8d6){logger[_0xd5fb('0x13')]('Plugin,\x20%s,\x20%s',_0x13b990,_0xd5fb('0x14'));logger[_0xd5fb('0x15')](_0xd5fb('0x16'),_0x13b990,_0xd5fb('0x14'),JSON[_0xd5fb('0x17')](_0x43e8d6));if(_0x43e8d6[_0xd5fb('0x18')]){if(_0x43e8d6[_0xd5fb('0x18')][_0xd5fb('0x19')]===0x1f4){logger[_0xd5fb('0x18')](_0xd5fb('0x1a'),_0x13b990,_0x43e8d6[_0xd5fb('0x18')][_0xd5fb('0x1b')]);return _0x1fd53c(_0x43e8d6[_0xd5fb('0x18')][_0xd5fb('0x1b')]);}logger['error'](_0xd5fb('0x1a'),_0x13b990,_0x43e8d6['error'][_0xd5fb('0x1b')]);return _0x5aaa1e(_0x43e8d6[_0xd5fb('0x18')][_0xd5fb('0x1b')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x13b990,'request\x20sent');_0x5aaa1e(_0x43e8d6[_0xd5fb('0x1c')][_0xd5fb('0x1b')]);}})['catch'](function(_0x591b95){logger['error']('Plugin,\x20%s,\x20%s',_0x13b990,_0x591b95);_0x1fd53c(_0x591b95);});});}exports[_0xd5fb('0x1d')]=function(_0x5cad62){var _0x5f4295=this;return new Promise(function(_0x3b932a,_0x3fe254){return db['Plugin']['create'](_0x5cad62[_0xd5fb('0x1e')],{'raw':_0x5cad62[_0xd5fb('0x1f')]?_0x5cad62[_0xd5fb('0x1f')][_0xd5fb('0x20')]===undefined?!![]:![]:!![]})[_0xd5fb('0x12')](function(_0x5a3d44){logger['info'](_0xd5fb('0x1d'),_0x5cad62);logger['debug'](_0xd5fb('0x1d'),_0x5cad62,JSON['stringify'](_0x5a3d44));_0x3b932a(_0x5a3d44);})[_0xd5fb('0x21')](function(_0x341748){logger[_0xd5fb('0x18')](_0xd5fb('0x1d'),_0x341748[_0xd5fb('0x1b')],_0x5cad62);_0x3fe254(_0x5f4295['error'](0x1f4,_0x341748[_0xd5fb('0x1b')]));});});}; \ No newline at end of file +var _0xac07=['CreatePlugin','Plugin','create','body','options','raw','then','debug','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','Plugin,\x20%s,\x20%s','error','message','info','result','catch'];(function(_0x541da8,_0x43beb2){var _0x2ac2af=function(_0x39e897){while(--_0x39e897){_0x541da8['push'](_0x541da8['shift']());}};_0x2ac2af(++_0x43beb2);}(_0xac07,0x152));var _0x7ac0=function(_0x5d9fe1,_0x49d0bc){_0x5d9fe1=_0x5d9fe1-0x0;var _0x5cbfcb=_0xac07[_0x5d9fe1];return _0x5cbfcb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7ac0('0x0'));var BPromise=require(_0x7ac0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ac0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ac0('0x3'));var logger=require(_0x7ac0('0x4'))(_0x7ac0('0x5'));var config=require(_0x7ac0('0x6'));var jayson=require(_0x7ac0('0x7'));var client=jayson[_0x7ac0('0x8')][_0x7ac0('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7ac0('0xa')],{'host':_0x7ac0('0xb'),'port':0x18eb});var socket=require(_0x7ac0('0xc'))(new Redis(config['redis']));require(_0x7ac0('0xd'))[_0x7ac0('0xe')](socket);function respondWithRpcPromise(_0x37eff0,_0xa1a208,_0x100afd){return new BPromise(function(_0x2bfee7,_0x2d38e6){return client[_0x7ac0('0xf')](_0x37eff0,_0x100afd)['then'](function(_0x24569e){logger['info']('Plugin,\x20%s,\x20%s',_0xa1a208,'request\x20sent');logger['debug'](_0x7ac0('0x10'),_0xa1a208,_0x7ac0('0x11'),JSON[_0x7ac0('0x12')](_0x24569e));if(_0x24569e['error']){if(_0x24569e['error']['code']===0x1f4){logger['error'](_0x7ac0('0x13'),_0xa1a208,_0x24569e[_0x7ac0('0x14')]['message']);return _0x2d38e6(_0x24569e[_0x7ac0('0x14')][_0x7ac0('0x15')]);}logger['error']('Plugin,\x20%s,\x20%s',_0xa1a208,_0x24569e[_0x7ac0('0x14')]['message']);return _0x2bfee7(_0x24569e[_0x7ac0('0x14')][_0x7ac0('0x15')]);}else{logger[_0x7ac0('0x16')](_0x7ac0('0x13'),_0xa1a208,_0x7ac0('0x11'));_0x2bfee7(_0x24569e[_0x7ac0('0x17')]['message']);}})[_0x7ac0('0x18')](function(_0x18f80f){logger[_0x7ac0('0x14')]('Plugin,\x20%s,\x20%s',_0xa1a208,_0x18f80f);_0x2d38e6(_0x18f80f);});});}exports[_0x7ac0('0x19')]=function(_0x4fa273){var _0x4f0d04=this;return new Promise(function(_0x94b03e,_0x47ee9c){return db[_0x7ac0('0x1a')][_0x7ac0('0x1b')](_0x4fa273[_0x7ac0('0x1c')],{'raw':_0x4fa273[_0x7ac0('0x1d')]?_0x4fa273['options'][_0x7ac0('0x1e')]===undefined?!![]:![]:!![]})[_0x7ac0('0x1f')](function(_0x3c9980){logger[_0x7ac0('0x16')](_0x7ac0('0x19'),_0x4fa273);logger[_0x7ac0('0x20')](_0x7ac0('0x19'),_0x4fa273,JSON['stringify'](_0x3c9980));_0x94b03e(_0x3c9980);})[_0x7ac0('0x18')](function(_0x141559){logger[_0x7ac0('0x14')](_0x7ac0('0x19'),_0x141559[_0x7ac0('0x15')],_0x4fa273);_0x47ee9c(_0x4f0d04[_0x7ac0('0x14')](0x1f4,_0x141559[_0x7ac0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 4b61c7b..e5e8b88 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 _0x2b30=['emit','register','./plugin.events','remove','update'];(function(_0x3850de,_0x2acfca){var _0x3c405f=function(_0x1e0b0d){while(--_0x1e0b0d){_0x3850de['push'](_0x3850de['shift']());}};_0x3c405f(++_0x2acfca);}(_0x2b30,0x1d3));var _0x02b3=function(_0x1da155,_0x142860){_0x1da155=_0x1da155-0x0;var _0x489653=_0x2b30[_0x1da155];return _0x489653;};'use strict';var PluginEvents=require(_0x02b3('0x0'));var events=['save',_0x02b3('0x1'),_0x02b3('0x2')];function createListener(_0x3048be,_0x25a5be){return function(_0x4724fe){_0x25a5be[_0x02b3('0x3')](_0x3048be,_0x4724fe);};}function removeListener(_0x27db1e,_0x2aa313){return function(){PluginEvents['removeListener'](_0x27db1e,_0x2aa313);};}exports[_0x02b3('0x4')]=function(_0x5d3f26){for(var _0x4779ad=0x0,_0x3861f9=events['length'];_0x4779ad<_0x3861f9;_0x4779ad++){var _0xd284cb=events[_0x4779ad];var _0x390ce4=createListener('plugin:'+_0xd284cb,_0x5d3f26);PluginEvents['on'](_0xd284cb,_0x390ce4);}}; \ No newline at end of file +var _0x5468=['length','plugin:','./plugin.events','save','remove','register'];(function(_0x45a55c,_0x18e873){var _0x5bc75e=function(_0x7b3559){while(--_0x7b3559){_0x45a55c['push'](_0x45a55c['shift']());}};_0x5bc75e(++_0x18e873);}(_0x5468,0x122));var _0x8546=function(_0x176e40,_0x338904){_0x176e40=_0x176e40-0x0;var _0x4b2d13=_0x5468[_0x176e40];return _0x4b2d13;};'use strict';var PluginEvents=require(_0x8546('0x0'));var events=[_0x8546('0x1'),_0x8546('0x2'),'update'];function createListener(_0x4bc1c0,_0x3db93f){return function(_0x34fe9b){_0x3db93f['emit'](_0x4bc1c0,_0x34fe9b);};}function removeListener(_0x54732a,_0x4ed43a){return function(){PluginEvents['removeListener'](_0x54732a,_0x4ed43a);};}exports[_0x8546('0x3')]=function(_0x294b9a){for(var _0x32784e=0x0,_0x41533a=events[_0x8546('0x4')];_0x32784e<_0x41533a;_0x32784e++){var _0x141fd1=events[_0x32784e];var _0x468ece=createListener(_0x8546('0x5')+_0x141fd1,_0x294b9a);PluginEvents['on'](_0x141fd1,_0x468ece);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index aebd5fd..3d19306 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(_0x6810a7,_0x3bb876){var _0x51ab69=function(_0x37e7aa){while(--_0x37e7aa){_0x6810a7['push'](_0x6810a7['shift']());}};_0x51ab69(++_0x3bb876);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x339562,_0x4b746d){var _0x4237be=function(_0x4170c8){while(--_0x4170c8){_0x339562['push'](_0x339562['shift']());}};_0x4237be(++_0x4b746d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 5387697..006ede6 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 _0x70e0=['dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','bluebird','json','error','stack','name','send','npm\x20install','info','index','list','reject','motion2','length','then','describe','params','catch','create','body','join','../../files/plugins','script','cwd','chdir','dirname','start'];(function(_0x1a2f9c,_0x18ae12){var _0x1aa41e=function(_0x2fe65f){while(--_0x2fe65f){_0x1a2f9c['push'](_0x1a2f9c['shift']());}};_0x1aa41e(++_0x18ae12);}(_0x70e0,0x17b));var _0x070e=function(_0x400c68,_0x3aca03){_0x400c68=_0x400c68-0x0;var _0xe0ce3e=_0x70e0[_0x400c68];return _0xe0ce3e;};'use strict';var _=require(_0x070e('0x0'));var pm2=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var path=require('path');var exec=require(_0x070e('0x3'))[_0x070e('0x4')];var BPromise=require(_0x070e('0x5'));function handleEntityNotFound(_0x2593e5,_0x5c90fc){return function(_0x7bce9b){if(!_0x7bce9b){_0x2593e5['sendStatus'](0x194);;}return _0x7bce9b;};}function respondWithResult(_0x46fe68,_0x4b041d){_0x4b041d=_0x4b041d||0xc8;return function(_0x56e420){if(_0x56e420){return _0x46fe68['status'](_0x4b041d)[_0x070e('0x6')](_0x56e420);}return null;};}function handleError(_0x1e11f0,_0x604664){_0x604664=_0x604664||0x1f4;return function(_0x2611e6){logger[_0x070e('0x7')](_0x2611e6[_0x070e('0x8')]);if(_0x2611e6[_0x070e('0x9')]){delete _0x2611e6['name'];}_0x1e11f0['status'](_0x604664)[_0x070e('0xa')](_0x2611e6);};}function execChildProcess(){return new BPromise(function(_0x2e3e5e,_0x12bb37){exec(_0x070e('0xb'),function(_0xa927a2,_0xffcdd6,_0x25cfe1){logger[_0x070e('0xc')](_0xffcdd6);logger[_0x070e('0xc')](_0x25cfe1);if(_0xa927a2){logger[_0x070e('0x7')](_0xa927a2);return _0x12bb37(_0xa927a2);}return _0x2e3e5e(_0xffcdd6);});});}exports[_0x070e('0xd')]=function(_0x52da3b,_0x5dca0f){return pm2[_0x070e('0xe')]()['then'](function(_0x4a33d2){if(_0x4a33d2){var _0x5bae0f=_[_0x070e('0xf')](_0x4a33d2,function(_0x14c3fd){return _0x14c3fd['name']==='express'||_0x14c3fd[_0x070e('0x9')]===_0x070e('0x10');});return{'rows':_0x5bae0f,'count':_0x5bae0f[_0x070e('0x11')]};}return null;})[_0x070e('0x12')](respondWithResult(_0x5dca0f,null))['catch'](handleError(_0x5dca0f,null));};exports['show']=function(_0x17e2e4,_0x2bd937){return pm2[_0x070e('0x13')](_0x17e2e4[_0x070e('0x14')]['id'])[_0x070e('0x12')](respondWithResult(_0x2bd937,null))['then'](handleEntityNotFound(_0x2bd937,null))[_0x070e('0x15')](handleError(_0x2bd937,null));};exports[_0x070e('0x16')]=function(_0x1ad3de,_0x3ea105){if(_0x1ad3de[_0x070e('0x17')]['name']&&_0x1ad3de['body']['script']){var _0x9907cf=path[_0x070e('0x18')](__dirname,_0x070e('0x19'),_0x1ad3de['body'][_0x070e('0x1a')]);var _0x5dc5d2=process[_0x070e('0x1b')]();process[_0x070e('0x1c')](path[_0x070e('0x1d')](_0x9907cf));return execChildProcess()[_0x070e('0x12')](function(_0x28a1c3){process[_0x070e('0x1c')](_0x5dc5d2);return pm2[_0x070e('0x1e')]({'name':_0x1ad3de[_0x070e('0x17')]['name'],'script':_0x9907cf});})[_0x070e('0x12')](function(_0x270061){pm2[_0x070e('0x1f')]();return _0x270061[0x0];})['then'](respondWithResult(_0x3ea105,0xc9))[_0x070e('0x15')](handleError(_0x3ea105,null));}else{return _0x3ea105['status'](0x1f4)['send']({'message':_0x070e('0x20')});}};exports[_0x070e('0x21')]=function(_0x41deb1,_0x1743cc){if(_0x41deb1[_0x070e('0x17')]['id']){delete _0x41deb1['body']['id'];}var _0x374c54={'online':_0x070e('0x22'),'stopped':_0x070e('0x23')};if(_0x374c54[_0x070e('0x24')](_0x41deb1[_0x070e('0x17')][_0x070e('0x25')])){return pm2[_0x374c54[_0x41deb1[_0x070e('0x17')][_0x070e('0x25')]]](_0x41deb1['params']['id'])[_0x070e('0x12')](respondWithResult(_0x1743cc,0xc8))[_0x070e('0x15')](handleError(_0x1743cc,null));}else{return _0x1743cc[_0x070e('0x25')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0x070e('0x26')]=function(_0x46065c,_0xa6c0ab){if(_0x46065c['body']['id']){delete _0x46065c[_0x070e('0x17')]['id'];}if(_0x46065c[_0x070e('0x14')]['id']){return pm2[_0x070e('0x27')](_0x46065c[_0x070e('0x14')]['id'])['then'](function(_0x5bf522){pm2['dump']();return _0x5bf522[0x0];})['then'](respondWithResult(_0xa6c0ab,null))[_0x070e('0x15')](handleError(_0xa6c0ab,null));}else{return _0xa6c0ab['status'](0x1f4)[_0x070e('0xa')]({'message':_0x070e('0x28')});}}; \ No newline at end of file +var _0xc788=['body','script','join','../../files/plugins','chdir','dirname','start','dump','send','update','stop','hasOwnProperty','Unknown\x20status','params','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','bluebird','sendStatus','status','error','stack','name','info','index','list','then','reject','motion2','catch','show','describe'];(function(_0x4ed786,_0x74f270){var _0x2f0243=function(_0x5642f5){while(--_0x5642f5){_0x4ed786['push'](_0x4ed786['shift']());}};_0x2f0243(++_0x74f270);}(_0xc788,0xc4));var _0x8c78=function(_0x4730bd,_0x1e9541){_0x4730bd=_0x4730bd-0x0;var _0x1b2849=_0xc788[_0x4730bd];return _0x1b2849;};'use strict';var _=require(_0x8c78('0x0'));var pm2=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var path=require('path');var exec=require(_0x8c78('0x3'))[_0x8c78('0x4')];var BPromise=require(_0x8c78('0x5'));function handleEntityNotFound(_0x1d0670,_0x386f0a){return function(_0x5498f9){if(!_0x5498f9){_0x1d0670[_0x8c78('0x6')](0x194);;}return _0x5498f9;};}function respondWithResult(_0x4555da,_0x329152){_0x329152=_0x329152||0xc8;return function(_0x1ac27f){if(_0x1ac27f){return _0x4555da[_0x8c78('0x7')](_0x329152)['json'](_0x1ac27f);}return null;};}function handleError(_0x247188,_0x299d9d){_0x299d9d=_0x299d9d||0x1f4;return function(_0x9bc075){logger[_0x8c78('0x8')](_0x9bc075[_0x8c78('0x9')]);if(_0x9bc075[_0x8c78('0xa')]){delete _0x9bc075['name'];}_0x247188[_0x8c78('0x7')](_0x299d9d)['send'](_0x9bc075);};}function execChildProcess(){return new BPromise(function(_0x3d55f0,_0x45935a){exec('npm\x20install',function(_0x1a05a7,_0x95e78e,_0x5ee642){logger[_0x8c78('0xb')](_0x95e78e);logger['info'](_0x5ee642);if(_0x1a05a7){logger['error'](_0x1a05a7);return _0x45935a(_0x1a05a7);}return _0x3d55f0(_0x95e78e);});});}exports[_0x8c78('0xc')]=function(_0x1b1d0e,_0x26178c){return pm2[_0x8c78('0xd')]()[_0x8c78('0xe')](function(_0x3d1306){if(_0x3d1306){var _0xe5f8ae=_[_0x8c78('0xf')](_0x3d1306,function(_0x2f44af){return _0x2f44af[_0x8c78('0xa')]==='express'||_0x2f44af[_0x8c78('0xa')]===_0x8c78('0x10');});return{'rows':_0xe5f8ae,'count':_0xe5f8ae['length']};}return null;})[_0x8c78('0xe')](respondWithResult(_0x26178c,null))[_0x8c78('0x11')](handleError(_0x26178c,null));};exports[_0x8c78('0x12')]=function(_0x23824e,_0x2a982c){return pm2[_0x8c78('0x13')](_0x23824e['params']['id'])['then'](respondWithResult(_0x2a982c,null))[_0x8c78('0xe')](handleEntityNotFound(_0x2a982c,null))['catch'](handleError(_0x2a982c,null));};exports['create']=function(_0xece4f0,_0x56c191){if(_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')]&&_0xece4f0['body'][_0x8c78('0x15')]){var _0x5b111b=path[_0x8c78('0x16')](__dirname,_0x8c78('0x17'),_0xece4f0['body'][_0x8c78('0x15')]);var _0x188cc3=process['cwd']();process[_0x8c78('0x18')](path[_0x8c78('0x19')](_0x5b111b));return execChildProcess()[_0x8c78('0xe')](function(_0x9581c6){process[_0x8c78('0x18')](_0x188cc3);return pm2[_0x8c78('0x1a')]({'name':_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')],'script':_0x5b111b});})[_0x8c78('0xe')](function(_0x4a7d20){pm2[_0x8c78('0x1b')]();return _0x4a7d20[0x0];})[_0x8c78('0xe')](respondWithResult(_0x56c191,0xc9))[_0x8c78('0x11')](handleError(_0x56c191,null));}else{return _0x56c191['status'](0x1f4)[_0x8c78('0x1c')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8c78('0x1d')]=function(_0x24f9a7,_0x8d9ff9){if(_0x24f9a7['body']['id']){delete _0x24f9a7[_0x8c78('0x14')]['id'];}var _0x2568d5={'online':'restart','stopped':_0x8c78('0x1e')};if(_0x2568d5[_0x8c78('0x1f')](_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')])){return pm2[_0x2568d5[_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')]]](_0x24f9a7['params']['id'])[_0x8c78('0xe')](respondWithResult(_0x8d9ff9,0xc8))['catch'](handleError(_0x8d9ff9,null));}else{return _0x8d9ff9[_0x8c78('0x7')](0x1f4)[_0x8c78('0x1c')]({'message':_0x8c78('0x20')});}};exports['destroy']=function(_0x1f1a0c,_0x3816d2){if(_0x1f1a0c['body']['id']){delete _0x1f1a0c[_0x8c78('0x14')]['id'];}if(_0x1f1a0c[_0x8c78('0x21')]['id']){return pm2[_0x8c78('0x22')](_0x1f1a0c['params']['id'])[_0x8c78('0xe')](function(_0x63307e){pm2[_0x8c78('0x1b')]();return _0x63307e[0x0];})['then'](respondWithResult(_0x3816d2,null))[_0x8c78('0x11')](handleError(_0x3816d2,null));}else{return _0x3816d2[_0x8c78('0x7')](0x1f4)['send']({'message':_0x8c78('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index a6dfa06..185430d 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 _0xcd80=['getAgents','get','/queues','getQueues','exports','express','Router','/agents','isAuthenticated'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xcd80,0x137));var _0x0cd8=function(_0x211b9c,_0x3e4a38){_0x211b9c=_0x211b9c-0x0;var _0x5be03d=_0xcd80[_0x211b9c];return _0x5be03d;};'use strict';var express=require(_0x0cd8('0x0'));var router=express[_0x0cd8('0x1')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router['get'](_0x0cd8('0x2'),auth[_0x0cd8('0x3')](),controller[_0x0cd8('0x4')]);router[_0x0cd8('0x5')](_0x0cd8('0x6'),auth[_0x0cd8('0x3')](),controller[_0x0cd8('0x7')]);module[_0x0cd8('0x8')]=router; \ No newline at end of file +var _0xb84e=['getAgents','get','./realtime.controller','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb84e,0x112));var _0xeb84=function(_0x38841c,_0x1af0bf){_0x38841c=_0x38841c-0x0;var _0x500610=_0xb84e[_0x38841c];return _0x500610;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xeb84('0x0'));router['get']('/agents',auth[_0xeb84('0x1')](),controller[_0xeb84('0x2')]);router[_0xeb84('0x3')]('/queues',auth[_0xeb84('0x1')](),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 c60e223..6110601 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 _0x892a=['fields','join','order','then','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','agent','raw','push','sequelize','literal','forEach','Pause','where','merge','user','online','extraQueryConditions','assign','omit','UserProfile','getResources','findAndCountAll','filterAgentAttributes','getAgentStatus','globalStatus','pause','voice','voiceStatus','getRealtimeAgentsQueryFields','pick','getQueues','resolve','toLowerCase','startCase','Queue','outbound','dialActive','getOptions','userProfileId','QueueCampaigns','name','initializeQueues','catch','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../errors/api','handleError','offset','undefined','limit','count','set','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter','*pause','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','validateSortParameter'];(function(_0x188a6e,_0x1db968){var _0x3e36b0=function(_0x43383c){while(--_0x43383c){_0x188a6e['push'](_0x188a6e['shift']());}};_0x3e36b0(++_0x1db968);}(_0x892a,0x176));var _0xa892=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x892a[_0x3a78a0];return _0x48e917;};'use strict';var _=require(_0xa892('0x0'));var util=require(_0xa892('0x1'));var rta=require(_0xa892('0x2'));var rtq=require(_0xa892('0x3'));var qs=require(_0xa892('0x4'));var utils=require('../../config/utils');var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0xa892('0x5'))['APIBadRequestError'];var APIHandleError=require('../../errors/api')[_0xa892('0x6')];function respondWithFilteredResult(_0x408dc2,_0x557cd4){return function(_0x5cced7){if(_0x5cced7){var _0x2b0721=typeof _0x557cd4[_0xa892('0x7')]===_0xa892('0x8')&&typeof _0x557cd4[_0xa892('0x9')]===_0xa892('0x8');var _0x166d4d=_0x5cced7[_0xa892('0xa')];var _0x560c99=_0x2b0721?0x0:_0x557cd4[_0xa892('0x7')];var _0x3f7404=_0x2b0721?_0x5cced7['count']:_0x557cd4['offset']+_0x557cd4[_0xa892('0x9')];var _0x2e56da;if(_0x3f7404>=_0x166d4d){_0x3f7404=_0x166d4d;_0x2e56da=0xc8;}else{_0x2e56da=0xce;}_0x408dc2['status'](_0x2e56da);return _0x408dc2[_0xa892('0xb')]('Content-Range',_0x560c99+'-'+_0x3f7404+'/'+_0x166d4d)[_0xa892('0xc')](_0x5cced7);}return null;};}exports[_0xa892('0xd')]=function(_0x47755d,_0x478aa4){var _0x48f50c={'count':0x0,'rows':[]};var _0xdf9ed1={};var _0x2d0c3a;var _0x550e2a=utils[_0xa892('0xe')]();var _0x234060;var _0x33a4fd;var _0x3eb84a=_0x47755d[_0xa892('0xf')]['globalQueueFilter'];var _0x349b50=_0x47755d[_0xa892('0xf')][_0xa892('0x10')];var _0x1e1227=_0x47755d[_0xa892('0xf')][_0xa892('0x11')];var _0xafd86d=_0x349b50==='pause'||_0x349b50===_0xa892('0x12')?!![]:![];var _0x158995=[];var _0x5bc9b3;var _0x4480aa;Promise['resolve']()['then'](function(){if(_0x47755d['query'][_0xa892('0x13')]){if(!utils[_0xa892('0x14')](_0x47755d[_0xa892('0xf')][_0xa892('0x13')])){throw new APIBadRequestError(util[_0xa892('0x15')](_0xa892('0x16'),_0x47755d[_0xa892('0xf')][_0xa892('0x13')]));}_0x2d0c3a=_0x47755d[_0xa892('0xf')][_0xa892('0x13')]['toLowerCase']();}if(!_0x47755d[_0xa892('0xf')]['sort']||!_0x47755d[_0xa892('0xf')][_0xa892('0x17')][_0xa892('0x18')]('globalStatus')){_0x47755d[_0xa892('0xf')][_0xa892('0x17')]=rta[_0xa892('0x19')](_0x47755d['query'][_0xa892('0x17')]);return;}var _0x4ede6c=rta['getUpdatedSortOptions'](_0x47755d[_0xa892('0xf')][_0xa892('0x17')]);_0x47755d[_0xa892('0xf')][_0xa892('0x17')]=_0x4ede6c[_0xa892('0x1a')][_0xa892('0x1b')](',');_0x5bc9b3=_0x4ede6c[_0xa892('0x1c')];})['then'](function(){if(!_0x3eb84a){return[];}return rta['getAgentIdsByQueues'](_0x3eb84a,_0x2d0c3a);})[_0xa892('0x1d')](function(_0x443ac8){_0x158995=_0x443ac8;return rta[_0xa892('0x1e')]();})[_0xa892('0x1d')](function(_0x1a9aa1){_0x33a4fd=_0x1a9aa1[_0xa892('0x1f')];if((!_0x349b50||_0xafd86d)&&!_0x5bc9b3){return _0x158995;}if(_0x5bc9b3&&!_0x349b50){return rta[_0xa892('0x20')](_0x33a4fd,_0x158995,_0x5bc9b3);}else{return rta[_0xa892('0x21')](_0x33a4fd,_0x158995,_0x349b50);}})[_0xa892('0x1d')](function(_0x36ee18){_0x158995=_0x36ee18;var _0x4d5bbc=![];if(_0x158995[_0xa892('0x22')]===0x0){if(_0x3eb84a||_0x349b50){_0x4d5bbc=!![];}if(_0xafd86d){_0x4d5bbc=![];}}if(_0x4d5bbc){return _0x48f50c;}var _0x29d5d3=_[_0xa892('0x23')](db[_0xa892('0x24')][_0xa892('0x25')],function(_0x18520b){return{'name':_0x18520b[_0xa892('0x26')],'type':_0x18520b[_0xa892('0x27')][_0xa892('0x28')]};});_0x47755d[_0xa892('0xf')][_0xa892('0x29')]=_0xa892('0x2a');_0xdf9ed1=qs['getOptions'](_0x29d5d3,_0x47755d);_0xdf9ed1[_0xa892('0x2b')]=!![];var _0x4bcd2d=[];if(_0x158995[_0xa892('0x22')]>0x0){_0x4bcd2d[_0xa892('0x2c')]({'id':{'$in':_0x158995}});if(_0x5bc9b3&&!_0x349b50){_0x4480aa=[db[_0xa892('0x2d')][_0xa892('0x2e')]('FIELD(id,'+_0x158995+')')];_0xdf9ed1[_0xa892('0x1c')]=_0x4480aa;}}if(_0xafd86d){_0x550e2a['forEach'](function(_0x64b4ca){var _0x50e5cd=!![];if(_0x349b50===_0xa892('0x12')&&_0x2d0c3a!==_0x64b4ca){_0x50e5cd=![];}_0x4bcd2d[_0xa892('0x2c')]({[_0x64b4ca+'Pause']:_0x50e5cd});});if(_0x1e1227){_0x4bcd2d[_0xa892('0x2c')]({'pauseType':_0x1e1227});}}else if(_0x349b50){_0x550e2a[_0xa892('0x2f')](function(_0x32cd94){_0x4bcd2d[_0xa892('0x2c')]({[_0x32cd94+_0xa892('0x30')]:![]});});}_0xdf9ed1[_0xa892('0x31')]=_[_0xa892('0x32')](_0xdf9ed1[_0xa892('0x31')],{'$and':_0x4bcd2d});if(_0x47755d['user'][_0xa892('0x29')]===_0xa892('0x33')){var _0xc49883={'params':{'id':_0x47755d[_0xa892('0x33')]['userProfileId']},'query':{'section':'Agents','role':'agent','raw':!![],'ids':_0x158995,'customSorting':_0x4480aa}};if(_0x47755d[_0xa892('0xf')][_0xa892('0x34')]){_0xc49883[_0xa892('0xf')][_0xa892('0x34')]=!![];}if(_0xafd86d){_0xc49883['query'][_0xa892('0x35')]=_0x4bcd2d;}_0xc49883[_0xa892('0xf')]=Object[_0xa892('0x36')](_0xc49883['query'],_[_0xa892('0x37')](_0x47755d['query'],'id'));return db[_0xa892('0x38')][_0xa892('0x39')](_0xc49883);}return db['User'][_0xa892('0x3a')](_0xdf9ed1);})[_0xa892('0x1d')](function(_0x4a8c8d){_0x48f50c['count']=_0x4a8c8d['count'];_0x234060=_0x4a8c8d[_0xa892('0x1f')];return _0x234060[_0xa892('0x23')](function(_0xcf2064){var _0x558e55=_['find'](_0x33a4fd,['id',_0xcf2064['id']]);if(_0x558e55){var _0x2610de=rta[_0xa892('0x3b')](_0x558e55);_[_0xa892('0x32')](_0xcf2064,_0x2610de);}_0xcf2064['globalStatus']=rta[_0xa892('0x3c')](_0xcf2064);if(_0xcf2064[_0xa892('0x3d')][_0xa892('0x18')](_0xa892('0x3e'))){_0x550e2a[_0xa892('0x2f')](function(_0xee9936){if(_0xcf2064[_0xee9936+_0xa892('0x30')]){if(_0xee9936===_0xa892('0x3f')){if(_0xcf2064['voiceStatus']!=='talking'){_0xcf2064[_0xa892('0x40')]=_0xa892('0x3e');}}else{_0xcf2064[_0xee9936+'Status']=_0xa892('0x3e');}}});}return _0xcf2064;});})[_0xa892('0x1d')](function(_0x80316c){if(!_0x5bc9b3||_0x4480aa){return _0x80316c;}return rta['sortAgentsByStatus'](_0x80316c,_0x5bc9b3);})[_0xa892('0x1d')](function(_0x1fb352){var _0x2cde27=rta[_0xa892('0x41')]();_0x48f50c[_0xa892('0x1f')]=_0x1fb352[_0xa892('0x23')](function(_0xfcb3a8){return _[_0xa892('0x42')](_0xfcb3a8,_0x2cde27);});return _0x48f50c;})[_0xa892('0x1d')](respondWithFilteredResult(_0x478aa4,_0xdf9ed1))['catch'](APIHandleError(_0x478aa4));};exports[_0xa892('0x43')]=function(_0x45cb4d,_0xf2df9){var _0x4fbc97={'count':0x0,'rows':[]};var _0x36bbee={};var _0x30871f;var _0x17ded0;var _0x4de064;Promise[_0xa892('0x44')]()[_0xa892('0x1d')](function(){if(_0x45cb4d[_0xa892('0xf')][_0xa892('0x13')]){if(!utils[_0xa892('0x14')](_0x45cb4d[_0xa892('0xf')][_0xa892('0x13')])){throw new APIBadRequestError(util[_0xa892('0x15')](_0xa892('0x16'),_0x45cb4d['query'][_0xa892('0x13')]));}_0x30871f=_0x45cb4d[_0xa892('0xf')][_0xa892('0x13')][_0xa892('0x45')]();}var _0x2aa39d=_[_0xa892('0x46')](_0x30871f)+_0xa892('0x47');var _0x52a73f=_['map'](db[_0x2aa39d][_0xa892('0x25')],function(_0x5f37d1){return{'name':_0x5f37d1[_0xa892('0x26')],'type':_0x5f37d1[_0xa892('0x27')]['key']};});if(!_0x45cb4d[_0xa892('0xf')]['fields']){var _0x1fcbce=['id','name'];if(_0x30871f==='voice'){_0x1fcbce[_0xa892('0x2c')](_0xa892('0x27'));if(_0x45cb4d['query'][_0xa892('0x27')]===_0xa892('0x48')){_0x1fcbce['push']([_0xa892('0x49'),'dialMethod']);}}_0x45cb4d[_0xa892('0xf')][_0xa892('0x1a')]=_0x1fcbce[_0xa892('0x1b')](',');}_0x36bbee=qs[_0xa892('0x4a')](_0x52a73f,_0x45cb4d);if(_0x45cb4d[_0xa892('0x33')][_0xa892('0x29')]===_0xa892('0x33')){var _0x1d8108={'params':{'id':_0x45cb4d[_0xa892('0x33')][_0xa892('0x4b')]},'query':{'section':_0x30871f===_0xa892('0x3f')&&_0x45cb4d[_0xa892('0xf')][_0xa892('0x27')]===_0xa892('0x48')?_0xa892('0x4c'):_['startCase'](_0x30871f)+'Queues','type':_0x45cb4d[_0xa892('0xf')][_0xa892('0x27')],'nolimit':!![],'sort':_0xa892('0x4d'),'filter':_0x45cb4d[_0xa892('0xf')]['filter']}};_0x1d8108[_0xa892('0xf')]=Object[_0xa892('0x36')](_0x1d8108[_0xa892('0xf')],_0x45cb4d[_0xa892('0xf')]);delete _0x1d8108['query']['id'];return db['UserProfile'][_0xa892('0x39')](_0x1d8108);}return db[_0x2aa39d][_0xa892('0x3a')](_0x36bbee);})[_0xa892('0x1d')](function(_0x52bea3){_0x4fbc97[_0xa892('0xa')]=_0x52bea3[_0xa892('0xa')];_0x17ded0=_0x52bea3[_0xa892('0x1f')];return rtq['getRealtimeQueues'](_0x45cb4d,_0x30871f);})[_0xa892('0x1d')](function(_0x3c51a0){_0x4de064=_0x3c51a0[_0xa892('0x1f')];return rtq[_0xa892('0x4e')](_0x17ded0,_0x4de064,_0x30871f,_0x45cb4d[_0xa892('0xf')]['type']);})['then'](function(_0x45560c){_0x4fbc97['rows']=_0x45560c;return _0x4fbc97;})[_0xa892('0x1d')](respondWithFilteredResult(_0xf2df9,_0x36bbee))[_0xa892('0x4f')](APIHandleError(_0xf2df9));}; \ No newline at end of file +var _0x7e3c=['User','rawAttributes','type','key','role','agent','getOptions','push','sequelize','*pause','Pause','forEach','merge','where','user','userProfileId','Agents','online','extraQueryConditions','assign','getResources','findAndCountAll','filterAgentAttributes','globalStatus','getAgentStatus','voice','voiceStatus','talking','Status','sortAgentsByStatus','startCase','Queue','name','outbound','dialActive','QueueCampaigns','Queues','UserProfile','getRealtimeQueues','initializeQueues','catch','lodash','util','../../components/realtime/agents','../../config/utils','../../mysqldb','../../errors/api','handleError','offset','undefined','limit','count','status','Content-Range','getAgents','globalQueueFilter','query','globalStatusFilter','pauseTypeFilter','pause','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','validateSortParameter','getUpdatedSortOptions','fields','join','order','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map'];(function(_0xfeb2f3,_0x49dc28){var _0x42b758=function(_0x3a21da){while(--_0x3a21da){_0xfeb2f3['push'](_0xfeb2f3['shift']());}};_0x42b758(++_0x49dc28);}(_0x7e3c,0x116));var _0xc7e3=function(_0x3f619d,_0x4762c5){_0x3f619d=_0x3f619d-0x0;var _0x1eb364=_0x7e3c[_0x3f619d];return _0x1eb364;};'use strict';var _=require(_0xc7e3('0x0'));var util=require(_0xc7e3('0x1'));var rta=require(_0xc7e3('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0xc7e3('0x3'));var db=require(_0xc7e3('0x4'))['db'];var APIBadRequestError=require(_0xc7e3('0x5'))['APIBadRequestError'];var APIHandleError=require(_0xc7e3('0x5'))[_0xc7e3('0x6')];function respondWithFilteredResult(_0x44e8a3,_0x3a738b){return function(_0x5b8f1c){if(_0x5b8f1c){var _0x90e71=typeof _0x3a738b[_0xc7e3('0x7')]===_0xc7e3('0x8')&&typeof _0x3a738b[_0xc7e3('0x9')]===_0xc7e3('0x8');var _0x491595=_0x5b8f1c['count'];var _0x4bb11c=_0x90e71?0x0:_0x3a738b[_0xc7e3('0x7')];var _0x589f4a=_0x90e71?_0x5b8f1c[_0xc7e3('0xa')]:_0x3a738b[_0xc7e3('0x7')]+_0x3a738b[_0xc7e3('0x9')];var _0x2f487e;if(_0x589f4a>=_0x491595){_0x589f4a=_0x491595;_0x2f487e=0xc8;}else{_0x2f487e=0xce;}_0x44e8a3[_0xc7e3('0xb')](_0x2f487e);return _0x44e8a3['set'](_0xc7e3('0xc'),_0x4bb11c+'-'+_0x589f4a+'/'+_0x491595)['json'](_0x5b8f1c);}return null;};}exports[_0xc7e3('0xd')]=function(_0x5f2a85,_0x3fb681){var _0x39a3c5={'count':0x0,'rows':[]};var _0x537157={};var _0x1bfb92;var _0x564042=utils['getChannels']();var _0x2e639b;var _0x5bae24;var _0x298851=_0x5f2a85['query'][_0xc7e3('0xe')];var _0x1cb141=_0x5f2a85[_0xc7e3('0xf')][_0xc7e3('0x10')];var _0x258e40=_0x5f2a85[_0xc7e3('0xf')][_0xc7e3('0x11')];var _0x52066e=_0x1cb141===_0xc7e3('0x12')||_0x1cb141==='*pause'?!![]:![];var _0xb709fc=[];var _0x4e7f30;var _0x5d94a0;Promise['resolve']()[_0xc7e3('0x13')](function(){if(_0x5f2a85[_0xc7e3('0xf')][_0xc7e3('0x14')]){if(!utils[_0xc7e3('0x15')](_0x5f2a85['query'][_0xc7e3('0x14')])){throw new APIBadRequestError(util[_0xc7e3('0x16')](_0xc7e3('0x17'),_0x5f2a85[_0xc7e3('0xf')][_0xc7e3('0x14')]));}_0x1bfb92=_0x5f2a85[_0xc7e3('0xf')][_0xc7e3('0x14')][_0xc7e3('0x18')]();}if(!_0x5f2a85[_0xc7e3('0xf')]['sort']||!_0x5f2a85[_0xc7e3('0xf')][_0xc7e3('0x19')][_0xc7e3('0x1a')]('globalStatus')){_0x5f2a85['query'][_0xc7e3('0x19')]=rta[_0xc7e3('0x1b')](_0x5f2a85[_0xc7e3('0xf')][_0xc7e3('0x19')]);return;}var _0x22c820=rta[_0xc7e3('0x1c')](_0x5f2a85[_0xc7e3('0xf')][_0xc7e3('0x19')]);_0x5f2a85[_0xc7e3('0xf')][_0xc7e3('0x19')]=_0x22c820[_0xc7e3('0x1d')][_0xc7e3('0x1e')](',');_0x4e7f30=_0x22c820[_0xc7e3('0x1f')];})[_0xc7e3('0x13')](function(){if(!_0x298851){return[];}return rta['getAgentIdsByQueues'](_0x298851,_0x1bfb92);})[_0xc7e3('0x13')](function(_0x1165e4){_0xb709fc=_0x1165e4;return rta[_0xc7e3('0x20')]();})['then'](function(_0x3a302a){_0x5bae24=_0x3a302a[_0xc7e3('0x21')];if((!_0x1cb141||_0x52066e)&&!_0x4e7f30){return _0xb709fc;}if(_0x4e7f30&&!_0x1cb141){return rta[_0xc7e3('0x22')](_0x5bae24,_0xb709fc,_0x4e7f30);}else{return rta[_0xc7e3('0x23')](_0x5bae24,_0xb709fc,_0x1cb141);}})['then'](function(_0x242989){_0xb709fc=_0x242989;var _0x254e00=![];if(_0xb709fc[_0xc7e3('0x24')]===0x0){if(_0x298851||_0x1cb141){_0x254e00=!![];}if(_0x52066e){_0x254e00=![];}}if(_0x254e00){return _0x39a3c5;}var _0x1dbcc5=_[_0xc7e3('0x25')](db[_0xc7e3('0x26')][_0xc7e3('0x27')],function(_0x7f64d1){return{'name':_0x7f64d1['fieldName'],'type':_0x7f64d1[_0xc7e3('0x28')][_0xc7e3('0x29')]};});_0x5f2a85[_0xc7e3('0xf')][_0xc7e3('0x2a')]=_0xc7e3('0x2b');_0x537157=qs[_0xc7e3('0x2c')](_0x1dbcc5,_0x5f2a85);_0x537157['raw']=!![];var _0x510b84=[];if(_0xb709fc[_0xc7e3('0x24')]>0x0){_0x510b84[_0xc7e3('0x2d')]({'id':{'$in':_0xb709fc}});if(_0x4e7f30&&!_0x1cb141){_0x5d94a0=[db[_0xc7e3('0x2e')]['literal']('FIELD(id,'+_0xb709fc+')')];_0x537157[_0xc7e3('0x1f')]=_0x5d94a0;}}if(_0x52066e){_0x564042['forEach'](function(_0x4c9bd8){var _0x46c66e=!![];if(_0x1cb141===_0xc7e3('0x2f')&&_0x1bfb92!==_0x4c9bd8){_0x46c66e=![];}_0x510b84[_0xc7e3('0x2d')]({[_0x4c9bd8+_0xc7e3('0x30')]:_0x46c66e});});if(_0x258e40){_0x510b84[_0xc7e3('0x2d')]({'pauseType':_0x258e40});}}else if(_0x1cb141){_0x564042[_0xc7e3('0x31')](function(_0x323169){_0x510b84[_0xc7e3('0x2d')]({[_0x323169+_0xc7e3('0x30')]:![]});});}_0x537157['where']=_[_0xc7e3('0x32')](_0x537157[_0xc7e3('0x33')],{'$and':_0x510b84});if(_0x5f2a85[_0xc7e3('0x34')][_0xc7e3('0x2a')]===_0xc7e3('0x34')){var _0x4945c5={'params':{'id':_0x5f2a85[_0xc7e3('0x34')][_0xc7e3('0x35')]},'query':{'section':_0xc7e3('0x36'),'role':_0xc7e3('0x2b'),'raw':!![],'ids':_0xb709fc,'customSorting':_0x5d94a0}};if(_0x5f2a85[_0xc7e3('0xf')]['online']){_0x4945c5[_0xc7e3('0xf')][_0xc7e3('0x37')]=!![];}if(_0x52066e){_0x4945c5[_0xc7e3('0xf')][_0xc7e3('0x38')]=_0x510b84;}_0x4945c5['query']=Object[_0xc7e3('0x39')](_0x4945c5[_0xc7e3('0xf')],_['omit'](_0x5f2a85[_0xc7e3('0xf')],'id'));return db['UserProfile'][_0xc7e3('0x3a')](_0x4945c5);}return db['User'][_0xc7e3('0x3b')](_0x537157);})['then'](function(_0x1047bc){_0x39a3c5[_0xc7e3('0xa')]=_0x1047bc['count'];_0x2e639b=_0x1047bc[_0xc7e3('0x21')];return _0x2e639b[_0xc7e3('0x25')](function(_0x246231){var _0x437ec5=_['find'](_0x5bae24,['id',_0x246231['id']]);if(_0x437ec5){var _0xbb7226=rta[_0xc7e3('0x3c')](_0x437ec5);_['merge'](_0x246231,_0xbb7226);}_0x246231[_0xc7e3('0x3d')]=rta[_0xc7e3('0x3e')](_0x246231);if(_0x246231[_0xc7e3('0x3d')][_0xc7e3('0x1a')](_0xc7e3('0x12'))){_0x564042[_0xc7e3('0x31')](function(_0x3260cd){if(_0x246231[_0x3260cd+_0xc7e3('0x30')]){if(_0x3260cd===_0xc7e3('0x3f')){if(_0x246231[_0xc7e3('0x40')]!==_0xc7e3('0x41')){_0x246231[_0xc7e3('0x40')]=_0xc7e3('0x12');}}else{_0x246231[_0x3260cd+_0xc7e3('0x42')]='pause';}}});}return _0x246231;});})[_0xc7e3('0x13')](function(_0x40263a){if(!_0x4e7f30||_0x5d94a0){return _0x40263a;}return rta[_0xc7e3('0x43')](_0x40263a,_0x4e7f30);})['then'](function(_0x29c831){var _0x135088=rta['getRealtimeAgentsQueryFields']();_0x39a3c5[_0xc7e3('0x21')]=_0x29c831[_0xc7e3('0x25')](function(_0x17d8f9){return _['pick'](_0x17d8f9,_0x135088);});return _0x39a3c5;})[_0xc7e3('0x13')](respondWithFilteredResult(_0x3fb681,_0x537157))['catch'](APIHandleError(_0x3fb681));};exports['getQueues']=function(_0x5d89c0,_0x4833b1){var _0x371fd9={'count':0x0,'rows':[]};var _0xa81a0d={};var _0x4da24f;var _0x1a7b7d;var _0x480be4;Promise['resolve']()[_0xc7e3('0x13')](function(){if(_0x5d89c0[_0xc7e3('0xf')][_0xc7e3('0x14')]){if(!utils[_0xc7e3('0x15')](_0x5d89c0[_0xc7e3('0xf')][_0xc7e3('0x14')])){throw new APIBadRequestError(util[_0xc7e3('0x16')](_0xc7e3('0x17'),_0x5d89c0[_0xc7e3('0xf')][_0xc7e3('0x14')]));}_0x4da24f=_0x5d89c0[_0xc7e3('0xf')]['channel'][_0xc7e3('0x18')]();}var _0x54e976=_[_0xc7e3('0x44')](_0x4da24f)+_0xc7e3('0x45');var _0x590d03=_[_0xc7e3('0x25')](db[_0x54e976][_0xc7e3('0x27')],function(_0x19e54f){return{'name':_0x19e54f['fieldName'],'type':_0x19e54f[_0xc7e3('0x28')][_0xc7e3('0x29')]};});if(!_0x5d89c0['query']['fields']){var _0x534972=['id',_0xc7e3('0x46')];if(_0x4da24f===_0xc7e3('0x3f')){_0x534972['push']('type');if(_0x5d89c0[_0xc7e3('0xf')][_0xc7e3('0x28')]===_0xc7e3('0x47')){_0x534972[_0xc7e3('0x2d')]([_0xc7e3('0x48'),'dialMethod']);}}_0x5d89c0[_0xc7e3('0xf')][_0xc7e3('0x1d')]=_0x534972['join'](',');}_0xa81a0d=qs[_0xc7e3('0x2c')](_0x590d03,_0x5d89c0);if(_0x5d89c0['user']['role']===_0xc7e3('0x34')){var _0x228022={'params':{'id':_0x5d89c0[_0xc7e3('0x34')]['userProfileId']},'query':{'section':_0x4da24f===_0xc7e3('0x3f')&&_0x5d89c0[_0xc7e3('0xf')][_0xc7e3('0x28')]===_0xc7e3('0x47')?_0xc7e3('0x49'):_[_0xc7e3('0x44')](_0x4da24f)+_0xc7e3('0x4a'),'type':_0x5d89c0[_0xc7e3('0xf')]['type'],'nolimit':!![],'sort':_0xc7e3('0x46'),'filter':_0x5d89c0[_0xc7e3('0xf')]['filter']}};_0x228022[_0xc7e3('0xf')]=Object[_0xc7e3('0x39')](_0x228022[_0xc7e3('0xf')],_0x5d89c0[_0xc7e3('0xf')]);delete _0x228022[_0xc7e3('0xf')]['id'];return db[_0xc7e3('0x4b')][_0xc7e3('0x3a')](_0x228022);}return db[_0x54e976][_0xc7e3('0x3b')](_0xa81a0d);})[_0xc7e3('0x13')](function(_0x1f1398){_0x371fd9[_0xc7e3('0xa')]=_0x1f1398['count'];_0x1a7b7d=_0x1f1398[_0xc7e3('0x21')];return rtq[_0xc7e3('0x4c')](_0x5d89c0,_0x4da24f);})['then'](function(_0x5205f7){_0x480be4=_0x5205f7[_0xc7e3('0x21')];return rtq[_0xc7e3('0x4d')](_0x1a7b7d,_0x480be4,_0x4da24f,_0x5d89c0[_0xc7e3('0xf')][_0xc7e3('0x28')]);})[_0xc7e3('0x13')](function(_0x44cbe8){_0x371fd9[_0xc7e3('0x21')]=_0x44cbe8;return _0x371fd9;})[_0xc7e3('0x13')](respondWithFilteredResult(_0x4833b1,_0xa81a0d))[_0xc7e3('0x4e')](APIHandleError(_0x4833b1));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index ffd4ae6..c9e173f 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x59781a,_0x460f2f){var _0x371685=function(_0x3d8069){while(--_0x3d8069){_0x59781a['push'](_0x59781a['shift']());}};_0x371685(++_0x460f2f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x257a28,_0x2cd00d){_0x257a28=_0x257a28-0x0;var _0x13bccc=_0xcb91[_0x257a28];return _0x13bccc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5ca65b,_0x30057b){var _0x2bdf5a=function(_0x3887a6){while(--_0x3887a6){_0x5ca65b['push'](_0x5ca65b['shift']());}};_0x2bdf5a(++_0x30057b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xcb91[_0x3511d3];return _0x5d6321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index a5c2b9d..d6ed79e 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 _0x6b8f=['exports','STRING','DATE'];(function(_0x1ed5cf,_0x5e50b9){var _0x4a1b1c=function(_0x516981){while(--_0x516981){_0x1ed5cf['push'](_0x1ed5cf['shift']());}};_0x4a1b1c(++_0x5e50b9);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x353d8b,_0x506ca6){_0x353d8b=_0x353d8b-0x0;var _0x3cf9af=_0x6b8f[_0x353d8b];return _0x3cf9af;};'use strict';var Sequelize=require('sequelize');module[_0xf6b8('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xf6b8('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xf6b8('0x2')]},'responsetime':{'type':Sequelize[_0xf6b8('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf6b8('0x1')]},'campaigntype':{'type':Sequelize[_0xf6b8('0x1')]},'membername':{'type':Sequelize[_0xf6b8('0x1')]}}; \ No newline at end of file +var _0x7fd6=['INTEGER','STRING','DATE','sequelize'];(function(_0x33ac70,_0x74576e){var _0x1bd5fd=function(_0x50d103){while(--_0x50d103){_0x33ac70['push'](_0x33ac70['shift']());}};_0x1bd5fd(++_0x74576e);}(_0x7fd6,0x157));var _0x67fd=function(_0x2e2226,_0x29bd22){_0x2e2226=_0x2e2226-0x0;var _0x2abb3b=_0x7fd6[_0x2e2226];return _0x2abb3b;};'use strict';var Sequelize=require(_0x67fd('0x0'));module['exports']={'state':{'type':Sequelize[_0x67fd('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x67fd('0x2')]},'scheduledat':{'type':Sequelize[_0x67fd('0x3')]},'uniqueid':{'type':Sequelize[_0x67fd('0x2')]},'starttime':{'type':Sequelize[_0x67fd('0x3')]},'responsetime':{'type':Sequelize[_0x67fd('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x67fd('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index a7d5e1a..d36a79c 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 _0x6615=['../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x3a10b6,_0x3181f0){var _0x463dc3=function(_0x5e37f2){while(--_0x5e37f2){_0x3a10b6['push'](_0x3a10b6['shift']());}};_0x463dc3(++_0x3181f0);}(_0x6615,0x18b));var _0x5661=function(_0x117994,_0x46bbbb){_0x117994=_0x117994-0x0;var _0x40814a=_0x6615[_0x117994];return _0x40814a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5661('0x0'))(_0x5661('0x1'));var moment=require(_0x5661('0x2'));var BPromise=require(_0x5661('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5661('0x4'));var config=require(_0x5661('0x5'));var attributes=require(_0x5661('0x6'));module['exports']=function(_0x48c693,_0x5a37e8){return _0x48c693[_0x5661('0x7')](_0x5661('0x8'),attributes,{'tableName':_0x5661('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5e7=['./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x29788a,_0x1a3dac){var _0x1980e3=function(_0x121a46){while(--_0x121a46){_0x29788a['push'](_0x29788a['shift']());}};_0x1980e3(++_0x1a3dac);}(_0xd5e7,0x14e));var _0x7d5e=function(_0x390b46,_0x310e77){_0x390b46=_0x390b46-0x0;var _0x5ee529=_0xd5e7[_0x390b46];return _0x5ee529;};'use strict';var _=require(_0x7d5e('0x0'));var util=require('util');var logger=require(_0x7d5e('0x1'))(_0x7d5e('0x2'));var moment=require(_0x7d5e('0x3'));var BPromise=require('bluebird');var rp=require(_0x7d5e('0x4'));var fs=require('fs');var path=require(_0x7d5e('0x5'));var rimraf=require('rimraf');var config=require(_0x7d5e('0x6'));var attributes=require(_0x7d5e('0x7'));module[_0x7d5e('0x8')]=function(_0x32b9de,_0x411ddd){return _0x32b9de[_0x7d5e('0x9')]('ReportAgentPreview',attributes,{'tableName':_0x7d5e('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 bc785e2..14193a1 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 _0x5004=['catch','ReportAgentPreview','body','options','raw','CreateReportAgentPreview','stringify','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x5004,0x84));var _0x4500=function(_0x18588,_0x5e1235){_0x18588=_0x18588-0x0;var _0x5a21b2=_0x5004[_0x18588];return _0x5a21b2;};'use strict';var _=require('lodash');var util=require(_0x4500('0x0'));var moment=require(_0x4500('0x1'));var BPromise=require('bluebird');var rs=require(_0x4500('0x2'));var fs=require('fs');var Redis=require(_0x4500('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4500('0x4'));var logger=require(_0x4500('0x5'))(_0x4500('0x6'));var config=require(_0x4500('0x7'));var jayson=require(_0x4500('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x318684,_0x5e692e,_0x562591){return new BPromise(function(_0x20174e,_0x2d5172){return client[_0x4500('0x9')](_0x318684,_0x562591)[_0x4500('0xa')](function(_0xc3ad78){logger[_0x4500('0xb')](_0x4500('0xc'),_0x5e692e,_0x4500('0xd'));logger[_0x4500('0xe')](_0x4500('0xf'),_0x5e692e,_0x4500('0xd'),JSON['stringify'](_0xc3ad78));if(_0xc3ad78[_0x4500('0x10')]){if(_0xc3ad78[_0x4500('0x10')]['code']===0x1f4){logger['error'](_0x4500('0xc'),_0x5e692e,_0xc3ad78[_0x4500('0x10')][_0x4500('0x11')]);return _0x2d5172(_0xc3ad78[_0x4500('0x10')][_0x4500('0x11')]);}logger[_0x4500('0x10')](_0x4500('0xc'),_0x5e692e,_0xc3ad78['error']['message']);return _0x20174e(_0xc3ad78[_0x4500('0x10')][_0x4500('0x11')]);}else{logger['info'](_0x4500('0xc'),_0x5e692e,_0x4500('0xd'));_0x20174e(_0xc3ad78['result'][_0x4500('0x11')]);}})[_0x4500('0x12')](function(_0x540c6f){logger[_0x4500('0x10')](_0x4500('0xc'),_0x5e692e,_0x540c6f);_0x2d5172(_0x540c6f);});});}exports['CreateReportAgentPreview']=function(_0x46030d){var _0x19e601=this;return new Promise(function(_0x20f3ae,_0x15ef4b){return db[_0x4500('0x13')]['create'](_0x46030d[_0x4500('0x14')],{'raw':_0x46030d[_0x4500('0x15')]?_0x46030d[_0x4500('0x15')][_0x4500('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x3e07e5){logger[_0x4500('0xb')]('CreateReportAgentPreview',_0x46030d);logger[_0x4500('0xe')](_0x4500('0x17'),_0x46030d,JSON[_0x4500('0x18')](_0x3e07e5));_0x20f3ae(_0x3e07e5);})['catch'](function(_0x566859){logger[_0x4500('0x10')](_0x4500('0x17'),_0x566859[_0x4500('0x11')],_0x46030d);_0x15ef4b(_0x19e601[_0x4500('0x10')](0x1f4,_0x566859[_0x4500('0x11')]));});});}; \ No newline at end of file +var _0x9192=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','ReportAgentPreview,\x20%s,\x20%s','debug','error','code','message','request\x20sent','catch','CreateReportAgentPreview','options','raw','stringify','lodash','util','moment','ioredis'];(function(_0x450689,_0x3b857c){var _0x46ffb0=function(_0x5d3679){while(--_0x5d3679){_0x450689['push'](_0x450689['shift']());}};_0x46ffb0(++_0x3b857c);}(_0x9192,0xf9));var _0x2919=function(_0x452985,_0x1ca4af){_0x452985=_0x452985-0x0;var _0x115294=_0x9192[_0x452985];return _0x115294;};'use strict';var _=require(_0x2919('0x0'));var util=require(_0x2919('0x1'));var moment=require(_0x2919('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2919('0x3'));var db=require(_0x2919('0x4'))['db'];var utils=require(_0x2919('0x5'));var logger=require(_0x2919('0x6'))(_0x2919('0x7'));var config=require(_0x2919('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2919('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cef5a,_0x26a53c,_0x315aee){return new BPromise(function(_0x5428ea,_0x4cc61a){return client[_0x2919('0xa')](_0x3cef5a,_0x315aee)['then'](function(_0x283fd1){logger[_0x2919('0xb')](_0x2919('0xc'),_0x26a53c,'request\x20sent');logger[_0x2919('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x26a53c,'request\x20sent',JSON['stringify'](_0x283fd1));if(_0x283fd1[_0x2919('0xe')]){if(_0x283fd1[_0x2919('0xe')][_0x2919('0xf')]===0x1f4){logger[_0x2919('0xe')](_0x2919('0xc'),_0x26a53c,_0x283fd1[_0x2919('0xe')]['message']);return _0x4cc61a(_0x283fd1[_0x2919('0xe')]['message']);}logger[_0x2919('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x26a53c,_0x283fd1[_0x2919('0xe')][_0x2919('0x10')]);return _0x5428ea(_0x283fd1['error'][_0x2919('0x10')]);}else{logger[_0x2919('0xb')](_0x2919('0xc'),_0x26a53c,_0x2919('0x11'));_0x5428ea(_0x283fd1['result'][_0x2919('0x10')]);}})[_0x2919('0x12')](function(_0x1c9edd){logger['error'](_0x2919('0xc'),_0x26a53c,_0x1c9edd);_0x4cc61a(_0x1c9edd);});});}exports[_0x2919('0x13')]=function(_0x4aa5c2){var _0x1f194b=this;return new Promise(function(_0x2d2816,_0xeece82){return db['ReportAgentPreview']['create'](_0x4aa5c2['body'],{'raw':_0x4aa5c2[_0x2919('0x14')]?_0x4aa5c2[_0x2919('0x14')][_0x2919('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x38bb98){logger[_0x2919('0xb')](_0x2919('0x13'),_0x4aa5c2);logger[_0x2919('0xd')](_0x2919('0x13'),_0x4aa5c2,JSON[_0x2919('0x16')](_0x38bb98));_0x2d2816(_0x38bb98);})[_0x2919('0x12')](function(_0x3d6b23){logger[_0x2919('0xe')](_0x2919('0x13'),_0x3d6b23[_0x2919('0x10')],_0x4aa5c2);_0xeece82(_0x1f194b[_0x2919('0xe')](0x1f4,_0x3d6b23[_0x2919('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index de9c72d..fec1ea5 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 _0x9847=['whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','post','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x9847,0xf9));var _0x7984=function(_0x2bdcfd,_0x32697d){_0x2bdcfd=_0x2bdcfd-0x0;var _0x53a635=_0x9847[_0x2bdcfd];return _0x53a635;};'use strict';var multer=require('multer');var util=require(_0x7984('0x0'));var path=require('path');var express=require(_0x7984('0x1'));var router=express['Router']();var auth=require(_0x7984('0x2'));var controller=require(_0x7984('0x3'));router[_0x7984('0x4')](_0x7984('0x5'),auth[_0x7984('0x6')](),controller[_0x7984('0x7')]);router[_0x7984('0x4')](_0x7984('0x8'),auth[_0x7984('0x6')](),controller['voiceChannelMixMonitor']);router[_0x7984('0x4')](_0x7984('0x9'),auth[_0x7984('0x6')](),controller[_0x7984('0xa')]);router['get'](_0x7984('0xb'),auth[_0x7984('0x6')](),controller[_0x7984('0xc')]);router[_0x7984('0x4')](_0x7984('0xd'),auth[_0x7984('0x6')](),controller[_0x7984('0xe')]);router[_0x7984('0x4')](_0x7984('0xf'),auth[_0x7984('0x6')](),controller['mailQueues']);router['get'](_0x7984('0x10'),auth[_0x7984('0x6')](),controller[_0x7984('0x11')]);router[_0x7984('0x4')]('/openchannel/queues',auth[_0x7984('0x6')](),controller['openchannelQueues']);router[_0x7984('0x4')](_0x7984('0x12'),auth[_0x7984('0x6')](),controller[_0x7984('0x13')]);router[_0x7984('0x4')](_0x7984('0x14'),auth[_0x7984('0x6')](),controller[_0x7984('0x15')]);router[_0x7984('0x4')](_0x7984('0x16'),auth[_0x7984('0x6')](),controller['faxQueues']);router[_0x7984('0x4')](_0x7984('0x17'),auth[_0x7984('0x6')](),controller['voiceQueuesPreview']);router[_0x7984('0x4')](_0x7984('0x18'),auth['isAuthenticated'](),controller[_0x7984('0x19')]);router[_0x7984('0x4')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x7984('0x4')](_0x7984('0x1a'),auth[_0x7984('0x6')](),controller[_0x7984('0x1b')]);router['get'](_0x7984('0x1c'),auth[_0x7984('0x6')](),controller[_0x7984('0x1d')]);router[_0x7984('0x4')]('/voice/queues/:id',auth[_0x7984('0x6')](),controller[_0x7984('0x1e')]);router[_0x7984('0x1f')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x7984('0x20')]);router['get'](_0x7984('0x21'),auth[_0x7984('0x6')](),controller[_0x7984('0x22')]);router[_0x7984('0x4')](_0x7984('0x23'),auth[_0x7984('0x6')](),controller[_0x7984('0x24')]);router['get']('/agents',auth[_0x7984('0x6')](),controller['agents']);router[_0x7984('0x1f')](_0x7984('0x25'),auth['isAuthenticated'](),controller['agentCapacity']);router[_0x7984('0x4')](_0x7984('0x26'),auth[_0x7984('0x6')](),controller[_0x7984('0x27')]);router['get'](_0x7984('0x28'),auth['isAuthenticated'](),controller[_0x7984('0x29')]);router[_0x7984('0x4')](_0x7984('0x2a'),auth[_0x7984('0x6')](),controller['campaigns']);router['get'](_0x7984('0x2b'),auth[_0x7984('0x6')](),controller['faxAccounts']);router[_0x7984('0x4')](_0x7984('0x2c'),auth[_0x7984('0x6')](),controller[_0x7984('0x2d')]);router[_0x7984('0x4')](_0x7984('0x2e'),auth['isAuthenticated'](),controller[_0x7984('0x2f')]);router[_0x7984('0x4')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0x7984('0x4')]('/openchannel/queues/:id/waitinginteractions',auth[_0x7984('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x7984('0x4')](_0x7984('0x30'),auth[_0x7984('0x6')](),controller[_0x7984('0x31')]);router[_0x7984('0x4')](_0x7984('0x32'),auth['isAuthenticated'](),controller[_0x7984('0x33')]);router[_0x7984('0x4')]('/fax/queues/waitinginteractions',auth[_0x7984('0x6')](),controller[_0x7984('0x34')]);router['post'](_0x7984('0x35'),auth[_0x7984('0x6')](),controller[_0x7984('0x36')]('mail'));router[_0x7984('0x4')](_0x7984('0x37'),auth[_0x7984('0x6')](),controller['showMailQueues']);router[_0x7984('0x38')](_0x7984('0x39'),auth[_0x7984('0x6')](),controller[_0x7984('0x36')]('chat'));router[_0x7984('0x4')](_0x7984('0x3a'),auth[_0x7984('0x6')](),controller[_0x7984('0x3b')]);router[_0x7984('0x38')]('/fax/queues/:id/notify',auth[_0x7984('0x6')](),controller[_0x7984('0x36')]('fax'));router[_0x7984('0x4')](_0x7984('0x3c'),auth[_0x7984('0x6')](),controller[_0x7984('0x3d')]);router[_0x7984('0x38')]('/openchannel/queues/:id/notify',auth[_0x7984('0x6')](),controller[_0x7984('0x36')]('openchannel'));router['get'](_0x7984('0x3e'),auth['isAuthenticated'](),controller[_0x7984('0x3f')]);router[_0x7984('0x38')](_0x7984('0x40'),auth[_0x7984('0x6')](),controller[_0x7984('0x36')](_0x7984('0x41')));router[_0x7984('0x38')](_0x7984('0x42'),auth['isAuthenticated'](),controller[_0x7984('0x36')](_0x7984('0x43')));router[_0x7984('0x4')](_0x7984('0x44'),auth[_0x7984('0x6')](),controller[_0x7984('0x45')]);router[_0x7984('0x4')](_0x7984('0x46'),auth['isAuthenticated'](),controller[_0x7984('0x47')]);router[_0x7984('0x38')](_0x7984('0x48'),auth[_0x7984('0x6')](),controller[_0x7984('0x49')]);module[_0x7984('0x4a')]=router; \ No newline at end of file +var _0xcbb3=['showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','showSmsQueues','showWhatsappQueues','agentNotify','exports','path','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','/outbound','/outbound/channels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','faxAccounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify'];(function(_0x4cd892,_0xab55c8){var _0x55b022=function(_0x4ef114){while(--_0x4ef114){_0x4cd892['push'](_0x4cd892['shift']());}};_0x55b022(++_0xab55c8);}(_0xcbb3,0x130));var _0x3cbb=function(_0x227ab4,_0x5c8e1b){_0x227ab4=_0x227ab4-0x0;var _0x3374da=_0xcbb3[_0x227ab4];return _0x3374da;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3cbb('0x0'));var express=require('express');var router=express[_0x3cbb('0x1')]();var auth=require(_0x3cbb('0x2'));var controller=require('./rpc.controller');router[_0x3cbb('0x3')](_0x3cbb('0x4'),auth[_0x3cbb('0x5')](),controller['voiceChannels']);router[_0x3cbb('0x3')](_0x3cbb('0x6'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x7')]);router[_0x3cbb('0x3')](_0x3cbb('0x8'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x9')]);router[_0x3cbb('0x3')](_0x3cbb('0xa'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0xb')]);router[_0x3cbb('0x3')]('/chat/queues',auth[_0x3cbb('0x5')](),controller[_0x3cbb('0xc')]);router['get'](_0x3cbb('0xd'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0xe')]);router[_0x3cbb('0x3')](_0x3cbb('0xf'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x10')]);router[_0x3cbb('0x3')](_0x3cbb('0x11'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x12')]);router[_0x3cbb('0x3')]('/sms/queues',auth['isAuthenticated'](),controller[_0x3cbb('0x13')]);router[_0x3cbb('0x3')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0x3cbb('0x14')]);router['get'](_0x3cbb('0x15'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x16')]);router[_0x3cbb('0x3')](_0x3cbb('0x17'),auth[_0x3cbb('0x5')](),controller['voiceQueuesPreview']);router[_0x3cbb('0x3')]('/voice/queues/channels',auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x18')]);router[_0x3cbb('0x3')](_0x3cbb('0x19'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x1a')]);router[_0x3cbb('0x3')](_0x3cbb('0x1b'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x1c')]);router[_0x3cbb('0x3')](_0x3cbb('0x1d'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x1e')]);router[_0x3cbb('0x3')](_0x3cbb('0x1f'),auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0x3cbb('0x20')](_0x3cbb('0x1f'),auth['isAuthenticated'](),controller['updateVoiceQueue']);router[_0x3cbb('0x3')](_0x3cbb('0x21'),auth['isAuthenticated'](),controller['outbound']);router[_0x3cbb('0x3')](_0x3cbb('0x22'),auth[_0x3cbb('0x5')](),controller['outboundChannels']);router[_0x3cbb('0x3')](_0x3cbb('0x23'),auth[_0x3cbb('0x5')](),controller['agents']);router[_0x3cbb('0x20')](_0x3cbb('0x24'),auth['isAuthenticated'](),controller[_0x3cbb('0x25')]);router[_0x3cbb('0x3')](_0x3cbb('0x26'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x27')]);router['get'](_0x3cbb('0x28'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x29')]);router['get']('/campaigns',auth['isAuthenticated'](),controller[_0x3cbb('0x2a')]);router[_0x3cbb('0x3')]('/fax/accounts',auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x2b')]);router[_0x3cbb('0x3')](_0x3cbb('0x2c'),auth[_0x3cbb('0x5')](),controller['chatQueuesWaitingInteractions']);router[_0x3cbb('0x3')]('/mail/queues/waitinginteractions',auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x2d')]);router[_0x3cbb('0x3')](_0x3cbb('0x2e'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0x3cbb('0x2f'),auth['isAuthenticated'](),controller[_0x3cbb('0x30')]);router[_0x3cbb('0x3')](_0x3cbb('0x31'),auth['isAuthenticated'](),controller[_0x3cbb('0x32')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x33')]);router[_0x3cbb('0x3')]('/fax/queues/waitinginteractions',auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x34')]);router[_0x3cbb('0x35')](_0x3cbb('0x36'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x37')](_0x3cbb('0x38')));router['get'](_0x3cbb('0x39'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x3a')]);router[_0x3cbb('0x35')]('/chat/queues/:id/notify',auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x37')]('chat'));router['get'](_0x3cbb('0x3b'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x3c')]);router[_0x3cbb('0x35')](_0x3cbb('0x3d'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x37')](_0x3cbb('0x3e')));router[_0x3cbb('0x3')](_0x3cbb('0x3f'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x40')]);router[_0x3cbb('0x35')](_0x3cbb('0x41'),auth[_0x3cbb('0x5')](),controller['queueNotify']('openchannel'));router[_0x3cbb('0x3')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0x3cbb('0x42')]);router[_0x3cbb('0x35')](_0x3cbb('0x43'),auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x37')](_0x3cbb('0x44')));router[_0x3cbb('0x35')]('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller[_0x3cbb('0x37')](_0x3cbb('0x45')));router[_0x3cbb('0x3')]('/sms/queues/:id',auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x46')]);router[_0x3cbb('0x3')]('/whatsapp/queues/:id',auth[_0x3cbb('0x5')](),controller[_0x3cbb('0x47')]);router[_0x3cbb('0x35')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x3cbb('0x48')]);module[_0x3cbb('0x49')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 1ffc160..1837552 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','User','messageId','update','bluebird','moment','lodash','../../config/logger','jayson/promise','client','http','then','error','code','catch','status','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','Trunks','campaigns','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var BPromise=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0a9e('0x3'))('api');var jayson=require(_0x0a9e('0x4'));var amiClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232a});var mailClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x0a9e('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){var _0x56465b=_0x5f41ea?_0x5f41ea:amiClient;return _0x56465b['request'](_0x441e3a,_0x2cc193)[_0x0a9e('0x7')](function(_0xf81284){if(_0xf81284[_0x0a9e('0x8')]){if(_0xf81284[_0x0a9e('0x8')][_0x0a9e('0x9')]===0x1f4){return _0xe42b77(_0xf81284[_0x0a9e('0x8')]['message']);}return _0x503809(_0xf81284['error']['message']);}else{_0x503809(_0xf81284['result']);}})[_0x0a9e('0xa')](function(_0x36471c){_0xe42b77(_0x36471c);});});}function respondWithResult(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xc8;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0xb')](_0x26d672)['json'](_0x32d742);}return _0xd5b662[_0x0a9e('0xc')](0x194);};}function handleError(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0x1f4;return function(_0x281129){logger[_0x0a9e('0x8')](_0x281129[_0x0a9e('0xd')]);if(_0x281129['name']){delete _0x281129[_0x0a9e('0xe')];}_0x239b12['status'](_0x2b4227)[_0x0a9e('0xf')](_0x281129);};}function findById(_0x519dfd){return function(_0x16033c){if(!_[_0x0a9e('0x10')](_0x519dfd)&&!_['isNil'](_0x16033c)&&!_[_0x0a9e('0x10')](_0x16033c['rows'])){return _[_0x0a9e('0x11')](_0x16033c[_0x0a9e('0x12')],function(_0x106033){return _0x106033['id']==_0x519dfd;});}return null;};}exports[_0x0a9e('0x13')]=function(_0x31b1ca,_0x2eb11f){return respondWithRpcPromise(_0x0a9e('0x14'),_0x31b1ca[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x2eb11f,null))[_0x0a9e('0xa')](handleError(_0x2eb11f,null));};exports[_0x0a9e('0x16')]=function(_0x105080,_0x4bb1e3){return respondWithRpcPromise(_0x0a9e('0x17'),_[_0x0a9e('0x18')](_0x105080['query'],_0x105080[_0x0a9e('0x19')]))['then'](respondWithResult(_0x4bb1e3,null))['catch'](handleError(_0x4bb1e3,null));};exports[_0x0a9e('0x1a')]=function(_0x432e56,_0x38e7c4){return respondWithRpcPromise(_0x0a9e('0x1b'),_['merge'](_0x432e56[_0x0a9e('0x15')],_0x432e56[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x38e7c4,null))[_0x0a9e('0xa')](handleError(_0x38e7c4,null));};exports[_0x0a9e('0x1c')]=function(_0x42ac8f,_0x16b1ca){return respondWithRpcPromise('VoiceQueues',_0x42ac8f['query'])[_0x0a9e('0x7')](respondWithResult(_0x16b1ca,null))[_0x0a9e('0xa')](handleError(_0x16b1ca,null));};exports[_0x0a9e('0x1d')]=function(_0x33161b,_0x526cf3){return respondWithRpcPromise(_0x0a9e('0x1e'),_0x33161b['query'])[_0x0a9e('0x7')](findById(_0x33161b['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x526cf3,null))[_0x0a9e('0xa')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x1f')]=function(_0x14433c,_0x140511){return respondWithRpcPromise(_0x0a9e('0x20'),_[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x21')],_0x14433c['params']))[_0x0a9e('0x7')](respondWithResult(_0x140511,null))[_0x0a9e('0xa')](handleError(_0x140511,null));};exports[_0x0a9e('0x22')]=function(_0x2ec755,_0x5c877d){return respondWithRpcPromise(_0x0a9e('0x23'),_[_0x0a9e('0x18')](_0x2ec755[_0x0a9e('0x15')],_0x2ec755[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x5c877d,null))[_0x0a9e('0xa')](handleError(_0x5c877d,null));};exports[_0x0a9e('0x24')]=function(_0x2e8759,_0x1dbde2){return respondWithRpcPromise('VoiceQueuesChannels',_0x2e8759[_0x0a9e('0x15')])['then'](respondWithResult(_0x1dbde2,null))[_0x0a9e('0xa')](handleError(_0x1dbde2,null));};exports[_0x0a9e('0x25')]=function(_0x1122db,_0x33bdb7){return respondWithRpcPromise(_0x0a9e('0x26'),_['merge'](_0x1122db[_0x0a9e('0x15')],_0x1122db[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x33bdb7,null))[_0x0a9e('0xa')](handleError(_0x33bdb7,null));};exports[_0x0a9e('0x27')]=function(_0x409319,_0x332d35){return respondWithRpcPromise(_0x0a9e('0x28'),_['merge'](_0x409319[_0x0a9e('0x15')],_0x409319['params']))[_0x0a9e('0x7')](respondWithResult(_0x332d35,null))[_0x0a9e('0xa')](handleError(_0x332d35,null));};exports[_0x0a9e('0x29')]=function(_0x3f3d41,_0x567193){return respondWithRpcPromise(_0x0a9e('0x2a'),_[_0x0a9e('0x18')](_0x3f3d41[_0x0a9e('0x15')],_0x3f3d41[_0x0a9e('0x19')]))['then'](respondWithResult(_0x567193,null))['catch'](handleError(_0x567193,null));};exports[_0x0a9e('0x2b')]=function(_0x5640eb,_0x24936a){return respondWithRpcPromise(_0x0a9e('0x2c'),_0x5640eb[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x24936a,null))['catch'](handleError(_0x24936a,null));};exports[_0x0a9e('0x2d')]=function(_0x3bfce8,_0x3cae){return respondWithRpcPromise('OutboundChannels',_0x3bfce8[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x3cae,null))[_0x0a9e('0xa')](handleError(_0x3cae,null));};exports['agents']=function(_0x546ef8,_0x11b61d){var _0x40d766;return respondWithRpcPromise('Agents',_0x546ef8[_0x0a9e('0x15')])[_0x0a9e('0x7')](function(_0x2e1b3a){_0x40d766=_0x2e1b3a;return respondWithRpcPromise(_0x0a9e('0x2e'),_0x546ef8['query'],routingClient);})['then'](function(_0x15e37d){return _[_0x0a9e('0x18')]({},_0x15e37d,_0x40d766);})['then'](respondWithResult(_0x11b61d,null))[_0x0a9e('0xa')](handleError(_0x11b61d,null));};exports[_0x0a9e('0x2f')]=function(_0x1459bb,_0x5b4f5e){if(_0x1459bb[_0x0a9e('0x21')]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]&&_0x1459bb[_0x0a9e('0x31')]&&_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0xe')]){for(var _0x2881b3 in _0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]){if(_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x0a9e('0x32')](_0x2881b3)){db[_0x0a9e('0x33')][_0x0a9e('0x34')]({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')]?{'$notIn':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]}:{'$ne':null}}})[_0x0a9e('0x7')](function(_0x432fcc){var _0x25c6e6=moment()[_0x0a9e('0x36')](_0x0a9e('0x37'));for(var _0x5026aa=0x0,_0x117c99=_0x432fcc[_0x0a9e('0x35')];_0x5026aa<_0x117c99;_0x5026aa+=0x1){_0x432fcc[_0x5026aa][_0x0a9e('0x38')]({'exitAt':_0x25c6e6});}});for(var _0xfbd5ad=0x0;_0xfbd5ad<_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')];_0xfbd5ad+=0x1){db[_0x0a9e('0x33')]['findOrCreate']({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':_0x0a9e('0x39'),'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0xfbd5ad],'exitAt':null},'defaults':{'channel':_0x2881b3,'membername':_0x1459bb['user'][_0x0a9e('0xe')],'interface':_[_0x0a9e('0x10')](_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')])?util[_0x0a9e('0x36')](_0x0a9e('0x3b'),_0x1459bb[_0x0a9e('0x31')]['name']):_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')],'type':_0x0a9e('0x39'),'enterAt':moment()[_0x0a9e('0x36')](_0x0a9e('0x37')),'role':_0x0a9e('0x3c'),'internal':_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3d')],'uniqueid':_0x1459bb[_0x0a9e('0x21')]['interaction'][_0x2881b3][_0xfbd5ad]}});}}}}return respondWithRpcPromise(_0x0a9e('0x3e'),{'id':_0x1459bb[_0x0a9e('0x19')]['id'],'capacity':_0x1459bb['body']['capacity']},routingClient)['then'](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0xa')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x3f')]=function(_0x37edaa,_0x11545a){return respondWithRpcPromise(_0x0a9e('0x40'),_0x37edaa[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x11545a,null))[_0x0a9e('0xa')](handleError(_0x11545a,null));};exports['trunks']=function(_0x4b1b9f,_0x53975a){return respondWithRpcPromise(_0x0a9e('0x41'),_0x4b1b9f[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x53975a,null))['catch'](handleError(_0x53975a,null));};exports[_0x0a9e('0x42')]=function(_0x161aa7,_0x53d113){return respondWithRpcPromise('Campaigns',_0x161aa7[_0x0a9e('0x15')])['then'](respondWithResult(_0x53d113,null))[_0x0a9e('0xa')](handleError(_0x53d113,null));};exports['chatQueues']=function(_0x2e5e62,_0x3c20b2){return respondWithRpcPromise(_0x0a9e('0x43'),_0x2e5e62['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x3c20b2,null))[_0x0a9e('0xa')](handleError(_0x3c20b2,null));};exports['showChatQueues']=function(_0x50f687,_0x128aa6){return respondWithRpcPromise(_0x0a9e('0x43'),_0x50f687['query'],routingClient)[_0x0a9e('0x7')](findById(_0x50f687['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x44')]=function(_0x4a6deb,_0x5da27d){return respondWithRpcPromise('MailQueues',_0x4a6deb[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x5da27d,null))[_0x0a9e('0xa')](handleError(_0x5da27d,null));};exports[_0x0a9e('0x45')]=function(_0x3cfd00,_0x19b4df){return respondWithRpcPromise(_0x0a9e('0x46'),_0x3cfd00[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x3cfd00[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x19b4df,null))[_0x0a9e('0xa')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x47')]=function(_0x2642bb,_0x30c491){return respondWithRpcPromise(_0x0a9e('0x48'),_0x2642bb[_0x0a9e('0x15')],mailClient)['then'](respondWithResult(_0x30c491,null))[_0x0a9e('0xa')](handleError(_0x30c491,null));};exports[_0x0a9e('0x49')]=function(_0x5239ef,_0x3649cc){return respondWithRpcPromise('OpenchannelQueues',_0x5239ef[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x3649cc,null))['catch'](handleError(_0x3649cc,null));};exports['showOpenchannelQueues']=function(_0x273cb5,_0x49d231){return respondWithRpcPromise(_0x0a9e('0x4a'),_0x273cb5[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x273cb5[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x49d231,null))[_0x0a9e('0xa')](handleError(_0x49d231,null));};exports['smsQueues']=function(_0x1627a7,_0x5854cc){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x1627a7[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5854cc,null))['catch'](handleError(_0x5854cc,null));};exports[_0x0a9e('0x4c')]=function(_0x156f1c,_0x119677){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x156f1c['query'],routingClient)[_0x0a9e('0x7')](findById(_0x156f1c[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x119677,null))[_0x0a9e('0xa')](handleError(_0x119677,null));};exports[_0x0a9e('0x4d')]=function(_0x88dcbf,_0x409b29){return respondWithRpcPromise(_0x0a9e('0x4e'),_0x88dcbf['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x409b29,null))[_0x0a9e('0xa')](handleError(_0x409b29,null));};exports[_0x0a9e('0x4f')]=function(_0x47bb43,_0x3528b7){return respondWithRpcPromise('WhatsappQueues',_0x47bb43['query'],routingClient)[_0x0a9e('0x7')](findById(_0x47bb43[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x3528b7,null))[_0x0a9e('0xa')](handleError(_0x3528b7,null));};exports[_0x0a9e('0x50')]=function(_0xc8c264,_0x387489){return respondWithRpcPromise(_0x0a9e('0x51'),_0xc8c264[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x387489,null))[_0x0a9e('0xa')](handleError(_0x387489,null));};exports[_0x0a9e('0x52')]=function(_0x2bbb86,_0x2b8192){return respondWithRpcPromise(_0x0a9e('0x51'),_0x2bbb86[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x2bbb86[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x2b8192,null))[_0x0a9e('0xa')](handleError(_0x2b8192,null));};exports[_0x0a9e('0x53')]=function(_0x243d12,_0x4edbb0){return respondWithRpcPromise(_0x0a9e('0x54'),_0x243d12[_0x0a9e('0x15')])['then'](respondWithResult(_0x4edbb0,null))[_0x0a9e('0xa')](handleError(_0x4edbb0,null));};exports[_0x0a9e('0x55')]=function(_0x3ef315,_0x427946){return respondWithRpcPromise(_0x0a9e('0x56'),_0x3ef315['query'],routingClient)['then'](respondWithResult(_0x427946,null))['catch'](handleError(_0x427946,null));};exports[_0x0a9e('0x57')]=function(_0x18bf5d,_0x1104ad){return respondWithRpcPromise(_0x0a9e('0x58'),_0x18bf5d[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x1104ad,null))[_0x0a9e('0xa')](handleError(_0x1104ad,null));};exports[_0x0a9e('0x59')]=function(_0x5512d1,_0x235f8f){return respondWithRpcPromise(_0x0a9e('0x5a'),_0x5512d1[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x235f8f,null))[_0x0a9e('0xa')](handleError(_0x235f8f,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4437ff,_0x44351d){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4437ff[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](function(_0x2cc7a7){if(_0x4437ff[_0x0a9e('0x15')]['type']!==undefined){var _0x1d442c=_(_0x2cc7a7[_0x0a9e('0x12')])[_0x0a9e('0x5b')]([_0x4437ff[_0x0a9e('0x15')]['type'],_0x4437ff[_0x0a9e('0x19')]['id']])[_0x0a9e('0x5c')](_0x0a9e('0x5d'))[_0x0a9e('0x5e')]()['value']();return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x30a4c7){return _0x1d442c[_0x0a9e('0x5f')](_0x30a4c7[_0x0a9e('0x5d')])>-0x1;});}else{return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x3df0e3){return _0x3df0e3[_0x0a9e('0x5d')]===parseInt(_0x4437ff[_0x0a9e('0x19')]['id']);});}})[_0x0a9e('0x7')](respondWithResult(_0x44351d,null))[_0x0a9e('0xa')](handleError(_0x44351d,null));};exports[_0x0a9e('0x60')]=function(_0xe0749e,_0x5b35db){return respondWithRpcPromise(_0x0a9e('0x61'),_0xe0749e[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5b35db,null))['catch'](handleError(_0x5b35db,null));};exports[_0x0a9e('0x62')]=function(_0x33dda0,_0x8cea96){return respondWithRpcPromise(_0x0a9e('0x63'),_0x33dda0['query'],routingClient)['then'](respondWithResult(_0x8cea96,null))[_0x0a9e('0xa')](handleError(_0x8cea96,null));};exports[_0x0a9e('0x64')]=function(_0x4c54fa,_0x45108c){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x4c54fa[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x45108c,null))['catch'](handleError(_0x45108c,null));};exports[_0x0a9e('0x65')]=function(_0x41cf12){return function(_0x2d2286,_0x42b959){var _0x3755fe,_0x1f42a0;var _0x444f1f=_['capitalize'](_0x41cf12);var _0x2973d3=_0x41cf12===_0x0a9e('0x66')?_0x0a9e('0x67'):_0x0a9e('0x68');return db[_0x444f1f+'Queue'][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2d2286[_0x0a9e('0x19')]['id']}})['then'](function(_0x1d6834){if(_['isNil'](_0x1d6834)){throw new Error(_0x444f1f+_0x0a9e('0x6a'));}_0x3755fe=_0x1d6834;return db[_0x444f1f+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2d2286[_0x0a9e('0x21')]['messageId']},'include':[{'model':db[_0x444f1f+'Interaction'],'as':_0x0a9e('0x6c')},{'model':db[_0x444f1f+_0x2973d3],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x5ac73d){if(_[_0x0a9e('0x10')](_0x5ac73d)){throw new Error(_0x444f1f+_0x0a9e('0x6d'));}_0x1f42a0=_0x5ac73d;return _0x5ac73d['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0xf0a802={'uniqueid':_0x41cf12+'.'+_0x1f42a0['id']+'.'+_0x1f42a0['Interaction']['id'],'FromUserId':_0x2d2286['user']['id'],'type':'queue'};_0xf0a802[_0x444f1f+_0x0a9e('0x6e')]=_0x1f42a0['id'];_0xf0a802[_0x444f1f+_0x0a9e('0x6f')]=_0x1f42a0[_0x0a9e('0x6c')]['id'];_0xf0a802[_0x0a9e('0x70')+_0x444f1f+_0x2973d3+'Id']=_0x1f42a0[_0x0a9e('0x68')]['id'];_0xf0a802['To'+_0x444f1f+_0x0a9e('0x71')]=_0x3755fe['id'];return db[_0x444f1f+'TransferReport'][_0x0a9e('0x72')](_0xf0a802);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x41cf12,'interaction':_0x1f42a0[_0x0a9e('0x6c')],'message':_0x1f42a0,'account':_0x1f42a0[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x74'),'appdata':_0x3755fe['name']+','+(_0x1f42a0[_0x0a9e('0x68')][_0x0a9e('0x75')]||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x42b959,null))[_0x0a9e('0xa')](handleError(_0x42b959,null));};};exports[_0x0a9e('0x77')]=function(_0x2a563d,_0x22063c){var _0x255e49,_0x1910bf;if(_[_0x0a9e('0x10')](_0x2a563d[_0x0a9e('0x21')]['channel'])){throw new Error(_0x0a9e('0x78'));}var _0x3325c5=_0x2a563d['body'][_0x0a9e('0x79')];var _0x982340=_[_0x0a9e('0x7a')](_0x3325c5);var _0x5a26c8=_0x3325c5===_0x0a9e('0x66')?'Website':_0x0a9e('0x68');return db[_0x0a9e('0x7b')][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2a563d[_0x0a9e('0x19')]['id'],'role':_0x0a9e('0x3c')}})[_0x0a9e('0x7')](function(_0x16a039){if(_[_0x0a9e('0x10')](_0x16a039)){throw new Error('Agent\x20not\x20found');}_0x255e49=_0x16a039;return db[_0x982340+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2a563d[_0x0a9e('0x21')][_0x0a9e('0x7c')]},'include':[{'model':db[_0x982340+_0x0a9e('0x6c')],'as':_0x0a9e('0x6c')},{'model':db[_0x982340+_0x5a26c8],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x1808ba){if(_[_0x0a9e('0x10')](_0x1808ba)){throw new Error(_0x982340+_0x0a9e('0x6d'));}_0x1910bf=_0x1808ba;return _0x1808ba[_0x0a9e('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0a9e('0x7')](function(){var _0x4989f9={'uniqueid':_0x3325c5+'.'+_0x1910bf['id']+'.'+_0x1910bf[_0x0a9e('0x6c')]['id'],'FromUserId':_0x2a563d[_0x0a9e('0x31')]['id'],'type':_0x0a9e('0x3c'),'ToUserId':_0x255e49['id']};_0x4989f9[_0x982340+_0x0a9e('0x6e')]=_0x1910bf['id'];_0x4989f9[_0x982340+_0x0a9e('0x6f')]=_0x1910bf['Interaction']['id'];_0x4989f9[_0x0a9e('0x70')+_0x982340+_0x5a26c8+'Id']=_0x1910bf[_0x0a9e('0x68')]['id'];return db[_0x982340+'TransferReport'][_0x0a9e('0x72')](_0x4989f9);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x3325c5,'interaction':_0x1910bf[_0x0a9e('0x6c')],'message':_0x1910bf,'account':_0x1910bf[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x3c'),'appdata':_0x255e49['name']+','+(_0x1910bf[_0x0a9e('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})[_0x0a9e('0x7')](respondWithResult(_0x22063c,null))['catch'](handleError(_0x22063c,null));}; \ No newline at end of file +var _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x2bd9d3,_0x2eb841){var _0x28c943=function(_0x5d65cf){while(--_0x5d65cf){_0x2bd9d3['push'](_0x2bd9d3['shift']());}};_0x28c943(++_0x2eb841);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 205950a..b254d16 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 _0x122b=['put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/run','post'];(function(_0x3d97eb,_0x357d0e){var _0x3291e1=function(_0x34df49){while(--_0x34df49){_0x3d97eb['push'](_0x3d97eb['shift']());}};_0x3291e1(++_0x357d0e);}(_0x122b,0xd0));var _0xb122=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x122b[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require(_0xb122('0x0'));var util=require('util');var path=require(_0xb122('0x1'));var timeout=require('connect-timeout');var express=require(_0xb122('0x2'));var router=express[_0xb122('0x3')]();var fs_extra=require(_0xb122('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb122('0x5'));var config=require(_0xb122('0x6'));var controller=require('./schedule.controller');router[_0xb122('0x7')]('/',auth[_0xb122('0x8')](),controller[_0xb122('0x9')]);router[_0xb122('0x7')](_0xb122('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb122('0xb'),auth[_0xb122('0x8')](),controller['run']);router[_0xb122('0xc')]('/',auth[_0xb122('0x8')](),controller['create']);router[_0xb122('0xd')](_0xb122('0xa'),auth[_0xb122('0x8')](),controller['update']);router[_0xb122('0xe')]('/:id',auth[_0xb122('0x8')](),controller[_0xb122('0xf')]);module[_0xb122('0x10')]=router; \ No newline at end of file +var _0x2768=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','/:id/run','run','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xf1488b,_0x5abd6f){var _0x6d2fe4=function(_0x2dbaf8){while(--_0x2dbaf8){_0xf1488b['push'](_0xf1488b['shift']());}};_0x6d2fe4(++_0x5abd6f);}(_0x2768,0x187));var _0x8276=function(_0x4bfbf4,_0xfdacf){_0x4bfbf4=_0x4bfbf4-0x0;var _0x4fefce=_0x2768[_0x4bfbf4];return _0x4fefce;};'use strict';var multer=require(_0x8276('0x0'));var util=require(_0x8276('0x1'));var path=require(_0x8276('0x2'));var timeout=require(_0x8276('0x3'));var express=require(_0x8276('0x4'));var router=express[_0x8276('0x5')]();var fs_extra=require(_0x8276('0x6'));var auth=require(_0x8276('0x7'));var interaction=require(_0x8276('0x8'));var config=require(_0x8276('0x9'));var controller=require(_0x8276('0xa'));router[_0x8276('0xb')]('/',auth[_0x8276('0xc')](),controller[_0x8276('0xd')]);router['get'](_0x8276('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x8276('0xb')](_0x8276('0xf'),auth['isAuthenticated'](),controller[_0x8276('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8276('0x11')]);router[_0x8276('0x12')](_0x8276('0xe'),auth[_0x8276('0xc')](),controller[_0x8276('0x13')]);router['delete'](_0x8276('0xe'),auth[_0x8276('0xc')](),controller[_0x8276('0x14')]);module[_0x8276('0x15')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 00e3a67..757a265 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 _0x1e48=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','hours','minutes','days','csv','pdf','xlsx','custom','TEXT','STRING'];(function(_0x3fe32a,_0x35ec60){var _0x7541fb=function(_0x2b36fd){while(--_0x2b36fd){_0x3fe32a['push'](_0x3fe32a['shift']());}};_0x7541fb(++_0x35ec60);}(_0x1e48,0xd7));var _0x81e4=function(_0x12ceba,_0x59ba15){_0x12ceba=_0x12ceba-0x0;var _0x36c243=_0x1e48[_0x12ceba];return _0x36c243;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x81e4('0x0')]},'active':{'type':Sequelize[_0x81e4('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x81e4('0x0')],'allowNull':![],'defaultValue':_0x81e4('0x2')},'startAt':{'type':Sequelize[_0x81e4('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x81e4('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x81e4('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x81e4('0x5')](_0x81e4('0x6'),_0x81e4('0x7'),_0x81e4('0x8'),_0x81e4('0x9'),'days',_0x81e4('0xa'),_0x81e4('0xb')),'allowNull':![],'defaultValue':_0x81e4('0xc')},'output':{'type':Sequelize['ENUM'](_0x81e4('0xd'),_0x81e4('0xe'),_0x81e4('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x81e4('0x5')]('custom','default'),'allowNull':![],'defaultValue':_0x81e4('0x10')},'sendMail':{'type':Sequelize[_0x81e4('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x81e4('0x0')]},'cc':{'type':Sequelize[_0x81e4('0x11')]},'bcc':{'type':Sequelize[_0x81e4('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xd9d5=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','weeks','hours','csv','pdf','ENUM','default','custom','TEXT','exports','STRING'];(function(_0x451376,_0x3f0b97){var _0x42f748=function(_0x163fd5){while(--_0x163fd5){_0x451376['push'](_0x451376['shift']());}};_0x42f748(++_0x3f0b97);}(_0xd9d5,0x8e));var _0x5d9d=function(_0x562185,_0xbfeb1d){_0x562185=_0x562185-0x0;var _0x16a628=_0xd9d5[_0x562185];return _0x16a628;};'use strict';var Sequelize=require('sequelize');module[_0x5d9d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5d9d('0x1')]},'active':{'type':Sequelize[_0x5d9d('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5d9d('0x1')],'allowNull':![],'defaultValue':_0x5d9d('0x3')},'startAt':{'type':Sequelize[_0x5d9d('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x5d9d('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x5d9d('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x5d9d('0x6'),_0x5d9d('0x7'),'months',_0x5d9d('0x8'),'days',_0x5d9d('0x9'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x5d9d('0xa'),_0x5d9d('0xb'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x5d9d('0xc')]('custom',_0x5d9d('0xd')),'allowNull':![],'defaultValue':_0x5d9d('0xe')},'sendMail':{'type':Sequelize[_0x5d9d('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x5d9d('0x1')]},'cc':{'type':Sequelize[_0x5d9d('0xf')]},'bcc':{'type':Sequelize[_0x5d9d('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x5d9d('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index a40d950..bccbb7a 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 _0x0fa3=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','stack','name','index','map','Schedule','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','intersection','include','find','catch','create','body','user'];(function(_0x8b8046,_0x525556){var _0x5c6832=function(_0x5a3e24){while(--_0x5a3e24){_0x8b8046['push'](_0x8b8046['shift']());}};_0x5c6832(++_0x525556);}(_0x0fa3,0x1b1));var _0x30fa=function(_0x10a6c5,_0x3b8168){_0x10a6c5=_0x10a6c5-0x0;var _0x79e4b8=_0x0fa3[_0x10a6c5];return _0x79e4b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x30fa('0x0'));var zipdir=require(_0x30fa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x30fa('0x2'));var moment=require(_0x30fa('0x3'));var BPromise=require(_0x30fa('0x4'));var Mustache=require(_0x30fa('0x5'));var util=require(_0x30fa('0x6'));var path=require(_0x30fa('0x7'));var sox=require(_0x30fa('0x8'));var csv=require(_0x30fa('0x9'));var ejs=require(_0x30fa('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x30fa('0xb'));var crypto=require(_0x30fa('0xc'));var jsforce=require(_0x30fa('0xd'));var deskjs=require(_0x30fa('0xe'));var toCsv=require(_0x30fa('0x9'));var querystring=require(_0x30fa('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x30fa('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x30fa('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x30fa('0x12'))('api');var utils=require(_0x30fa('0x13'));var config=require(_0x30fa('0x14'));var licenseUtil=require(_0x30fa('0x15'));var db=require(_0x30fa('0x16'))['db'];function respondWithStatusCode(_0x6647ff,_0xfdcadb){_0xfdcadb=_0xfdcadb||0xcc;return function(_0x1fabc5){if(_0x1fabc5){return _0x6647ff['sendStatus'](_0xfdcadb);}return _0x6647ff[_0x30fa('0x17')](_0xfdcadb)['end']();};}function respondWithResult(_0xd1f98c,_0x539365){_0x539365=_0x539365||0xc8;return function(_0x1059eb){if(_0x1059eb){return _0xd1f98c[_0x30fa('0x17')](_0x539365)['json'](_0x1059eb);}};}function respondWithFilteredResult(_0x1d0a65,_0x32ca97){return function(_0x283d12){if(_0x283d12){var _0x3d5e43=typeof _0x32ca97[_0x30fa('0x18')]===_0x30fa('0x19')&&typeof _0x32ca97[_0x30fa('0x1a')]===_0x30fa('0x19');var _0x6536e8=_0x283d12[_0x30fa('0x1b')];var _0x23ca1e=_0x3d5e43?0x0:_0x32ca97[_0x30fa('0x18')];var _0x4f306e=_0x3d5e43?_0x283d12[_0x30fa('0x1b')]:_0x32ca97[_0x30fa('0x18')]+_0x32ca97['limit'];var _0x363196;if(_0x4f306e>=_0x6536e8){_0x4f306e=_0x6536e8;_0x363196=0xc8;}else{_0x363196=0xce;}_0x1d0a65[_0x30fa('0x17')](_0x363196);return _0x1d0a65[_0x30fa('0x1c')](_0x30fa('0x1d'),_0x23ca1e+'-'+_0x4f306e+'/'+_0x6536e8)[_0x30fa('0x1e')](_0x283d12);}return null;};}function patchUpdates(_0x150dd7){return function(_0x27d184){try{jsonpatch[_0x30fa('0x1f')](_0x27d184,_0x150dd7,!![]);}catch(_0x56b67d){return BPromise[_0x30fa('0x20')](_0x56b67d);}return _0x27d184[_0x30fa('0x21')]();};}function saveUpdates(_0x44ae48,_0x5b5912){return function(_0x209fa2){if(_0x209fa2){return _0x209fa2[_0x30fa('0x22')](_0x44ae48)[_0x30fa('0x23')](function(_0x1854de){return _0x1854de;});}return null;};}function removeEntity(_0x49b51b,_0x10f0ea){return function(_0x5b3e9f){if(_0x5b3e9f){return _0x5b3e9f[_0x30fa('0x24')]()[_0x30fa('0x23')](function(){var _0x24efb5=_0x5b3e9f[_0x30fa('0x25')]({'plain':!![]});var _0x25e322=_0x30fa('0x26');return db[_0x30fa('0x27')]['destroy']({'where':{'type':_0x25e322,'resourceId':_0x24efb5['id']}})['then'](function(){return _0x5b3e9f;});})[_0x30fa('0x23')](function(){_0x49b51b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52a2c0,_0x411526){return function(_0x48c150){if(!_0x48c150){_0x52a2c0[_0x30fa('0x28')](0x194);}return _0x48c150;};}function handleError(_0xf7abf5,_0x2025c4){_0x2025c4=_0x2025c4||0x1f4;return function(_0x5708e8){logger['error'](_0x5708e8[_0x30fa('0x29')]);if(_0x5708e8[_0x30fa('0x2a')]){delete _0x5708e8[_0x30fa('0x2a')];}_0xf7abf5[_0x30fa('0x17')](_0x2025c4)['send'](_0x5708e8);};}exports[_0x30fa('0x2b')]=function(_0x483e10,_0x227b5c){var _0x19fa27={},_0x7a97c6={},_0x390918={'count':0x0,'rows':[]};var _0x2de608=_[_0x30fa('0x2c')](db[_0x30fa('0x2d')][_0x30fa('0x2e')],function(_0x2dbed8){return{'name':_0x2dbed8[_0x30fa('0x2f')],'type':_0x2dbed8[_0x30fa('0x30')]['key']};});_0x7a97c6[_0x30fa('0x31')]=_[_0x30fa('0x2c')](_0x2de608,_0x30fa('0x2a'));_0x7a97c6[_0x30fa('0x32')]=_[_0x30fa('0x33')](_0x483e10['query']);_0x7a97c6[_0x30fa('0x34')]=_['intersection'](_0x7a97c6[_0x30fa('0x31')],_0x7a97c6['query']);_0x19fa27[_0x30fa('0x35')]=_['intersection'](_0x7a97c6[_0x30fa('0x31')],qs['fields'](_0x483e10[_0x30fa('0x32')][_0x30fa('0x36')]));_0x19fa27[_0x30fa('0x35')]=_0x19fa27[_0x30fa('0x35')][_0x30fa('0x37')]?_0x19fa27['attributes']:_0x7a97c6[_0x30fa('0x31')];if(!_0x483e10[_0x30fa('0x32')][_0x30fa('0x38')]('nolimit')){_0x19fa27[_0x30fa('0x1a')]=qs[_0x30fa('0x1a')](_0x483e10[_0x30fa('0x32')][_0x30fa('0x1a')]);_0x19fa27[_0x30fa('0x18')]=qs[_0x30fa('0x18')](_0x483e10['query'][_0x30fa('0x18')]);}_0x19fa27[_0x30fa('0x39')]=qs['sort'](_0x483e10[_0x30fa('0x32')][_0x30fa('0x3a')]);_0x19fa27[_0x30fa('0x3b')]=qs['filters'](_[_0x30fa('0x3c')](_0x483e10[_0x30fa('0x32')],_0x7a97c6[_0x30fa('0x34')]),_0x2de608);if(_0x483e10[_0x30fa('0x32')]['filter']){_0x19fa27[_0x30fa('0x3b')]=_[_0x30fa('0x3d')](_0x19fa27[_0x30fa('0x3b')],{'$or':_[_0x30fa('0x2c')](_0x2de608,function(_0x29bca6){if(_0x29bca6['type']!==_0x30fa('0x3e')){var _0xf11ba={};_0xf11ba[_0x29bca6[_0x30fa('0x2a')]]={'$like':'%'+_0x483e10[_0x30fa('0x32')][_0x30fa('0x3f')]+'%'};return _0xf11ba;}})});}_0x19fa27=_[_0x30fa('0x3d')]({},_0x19fa27,_0x483e10[_0x30fa('0x40')]);var _0xc5fd78={'where':_0x19fa27[_0x30fa('0x3b')]};return db[_0x30fa('0x2d')][_0x30fa('0x1b')](_0xc5fd78)['then'](function(_0x21ff89){_0x390918[_0x30fa('0x1b')]=_0x21ff89;if(_0x483e10[_0x30fa('0x32')][_0x30fa('0x41')]){_0x19fa27['include']=[{'all':!![]}];}return db[_0x30fa('0x2d')][_0x30fa('0x42')](_0x19fa27);})[_0x30fa('0x23')](function(_0x378a42){_0x390918[_0x30fa('0x43')]=_0x378a42;return _0x390918;})[_0x30fa('0x23')](respondWithFilteredResult(_0x227b5c,_0x19fa27))['catch'](handleError(_0x227b5c,null));};exports[_0x30fa('0x44')]=function(_0xf29e77,_0xacce19){var _0x12f307={'raw':![],'where':{'id':_0xf29e77[_0x30fa('0x45')]['id']}},_0x112138={};_0x112138[_0x30fa('0x31')]=_['keys'](db[_0x30fa('0x2d')][_0x30fa('0x2e')]);_0x112138[_0x30fa('0x32')]=_[_0x30fa('0x33')](_0xf29e77[_0x30fa('0x32')]);_0x112138[_0x30fa('0x34')]=_[_0x30fa('0x46')](_0x112138[_0x30fa('0x31')],_0x112138[_0x30fa('0x32')]);_0x12f307[_0x30fa('0x35')]=_[_0x30fa('0x46')](_0x112138[_0x30fa('0x31')],qs[_0x30fa('0x36')](_0xf29e77[_0x30fa('0x32')][_0x30fa('0x36')]));_0x12f307[_0x30fa('0x35')]=_0x12f307[_0x30fa('0x35')][_0x30fa('0x37')]?_0x12f307['attributes']:_0x112138['model'];if(_0xf29e77[_0x30fa('0x32')][_0x30fa('0x41')]){_0x12f307[_0x30fa('0x47')]=[{'all':!![]}];}_0x12f307=_[_0x30fa('0x3d')]({},_0x12f307,_0xf29e77['options']);return db[_0x30fa('0x2d')][_0x30fa('0x48')](_0x12f307)['then'](handleEntityNotFound(_0xacce19,null))['then'](respondWithResult(_0xacce19,null))[_0x30fa('0x49')](handleError(_0xacce19,null));};exports[_0x30fa('0x4a')]=function(_0x1eb640,_0x531e99){return db[_0x30fa('0x2d')][_0x30fa('0x4a')](_0x1eb640[_0x30fa('0x4b')],{})[_0x30fa('0x23')](function(_0xabb5b7){var _0x57175f=_0x1eb640[_0x30fa('0x4c')][_0x30fa('0x25')]({'plain':!![]});if(!_0x57175f)throw new Error(_0x30fa('0x4d'));if(_0x57175f['role']===_0x30fa('0x4c')){var _0x470027=_0xabb5b7['get']({'plain':!![]});var _0x440d22='Scheduler';return db[_0x30fa('0x4e')][_0x30fa('0x48')]({'where':{'name':_0x440d22,'userProfileId':_0x57175f[_0x30fa('0x4f')]},'raw':!![]})[_0x30fa('0x23')](function(_0x30ed86){if(_0x30ed86&&_0x30ed86[_0x30fa('0x50')]===0x0){return db['UserProfileResource'][_0x30fa('0x4a')]({'name':_0x470027[_0x30fa('0x2a')],'resourceId':_0x470027['id'],'type':_0x30ed86[_0x30fa('0x2a')],'sectionId':_0x30ed86['id']},{})[_0x30fa('0x23')](function(){return _0xabb5b7;});}else{return _0xabb5b7;}})['catch'](function(_0x4d1039){logger[_0x30fa('0x51')](_0x30fa('0x52'),_0x4d1039);throw _0x4d1039;});}return _0xabb5b7;})[_0x30fa('0x23')](respondWithResult(_0x531e99,0xc9))[_0x30fa('0x49')](handleError(_0x531e99,null));};exports[_0x30fa('0x22')]=function(_0x26d1c0,_0x440325){if(_0x26d1c0[_0x30fa('0x4b')]['id']){delete _0x26d1c0[_0x30fa('0x4b')]['id'];}return db[_0x30fa('0x2d')][_0x30fa('0x48')]({'where':{'id':_0x26d1c0[_0x30fa('0x45')]['id']}})[_0x30fa('0x23')](handleEntityNotFound(_0x440325,null))['then'](saveUpdates(_0x26d1c0[_0x30fa('0x4b')],null))['then'](respondWithResult(_0x440325,null))[_0x30fa('0x49')](handleError(_0x440325,null));};exports[_0x30fa('0x24')]=function(_0x144bef,_0x266259){return db[_0x30fa('0x2d')][_0x30fa('0x48')]({'where':{'id':_0x144bef[_0x30fa('0x45')]['id']}})[_0x30fa('0x23')](handleEntityNotFound(_0x266259,null))['then'](removeEntity(_0x266259,null))[_0x30fa('0x49')](handleError(_0x266259,null));};exports[_0x30fa('0x53')]=function(_0x34352b,_0x4687b4,_0x189146){var _0x3e2bca=require(_0x30fa('0x54'));return db[_0x30fa('0x2d')][_0x30fa('0x48')]({'where':{'id':_0x34352b[_0x30fa('0x45')]['id']},'raw':!![]})[_0x30fa('0x23')](handleEntityNotFound(_0x4687b4,null))[_0x30fa('0x23')](function(){_0x3e2bca[_0x30fa('0x53')](_0x34352b['params']['id']);})[_0x30fa('0x23')](respondWithStatusCode(_0x4687b4,null))[_0x30fa('0x49')](handleError(_0x4687b4,null));}; \ No newline at end of file +var _0x5684=['include','findAll','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','index','map','fieldName','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','Schedule','includeAll'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x5684,0xc0));var _0x4568=function(_0x5ed34c,_0x42b93b){_0x5ed34c=_0x5ed34c-0x0;var _0x4f8663=_0x5684[_0x5ed34c];return _0x4f8663;};'use strict';var emlformat=require(_0x4568('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4568('0x1'));var jsonpatch=require(_0x4568('0x2'));var rp=require(_0x4568('0x3'));var moment=require(_0x4568('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4568('0x5'));var util=require(_0x4568('0x6'));var path=require('path');var sox=require(_0x4568('0x7'));var csv=require('to-csv');var ejs=require(_0x4568('0x8'));var fs=require('fs');var fs_extra=require(_0x4568('0x9'));var _=require(_0x4568('0xa'));var squel=require(_0x4568('0xb'));var crypto=require(_0x4568('0xc'));var jsforce=require(_0x4568('0xd'));var deskjs=require(_0x4568('0xe'));var toCsv=require(_0x4568('0xf'));var querystring=require(_0x4568('0x10'));var Papa=require('papaparse');var Redis=require(_0x4568('0x11'));var authService=require(_0x4568('0x12'));var qs=require(_0x4568('0x13'));var as=require(_0x4568('0x14'));var hardwareService=require(_0x4568('0x15'));var logger=require(_0x4568('0x16'))(_0x4568('0x17'));var utils=require('../../config/utils');var config=require(_0x4568('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4568('0x19'))['db'];function respondWithStatusCode(_0x3fdf7d,_0x12eb87){_0x12eb87=_0x12eb87||0xcc;return function(_0x2f350c){if(_0x2f350c){return _0x3fdf7d[_0x4568('0x1a')](_0x12eb87);}return _0x3fdf7d[_0x4568('0x1b')](_0x12eb87)[_0x4568('0x1c')]();};}function respondWithResult(_0x1e6e77,_0x367143){_0x367143=_0x367143||0xc8;return function(_0x488c25){if(_0x488c25){return _0x1e6e77[_0x4568('0x1b')](_0x367143)['json'](_0x488c25);}};}function respondWithFilteredResult(_0x5679b9,_0x55380e){return function(_0x508791){if(_0x508791){var _0x2279a5=typeof _0x55380e[_0x4568('0x1d')]===_0x4568('0x1e')&&typeof _0x55380e[_0x4568('0x1f')]===_0x4568('0x1e');var _0x5f8344=_0x508791[_0x4568('0x20')];var _0x496954=_0x2279a5?0x0:_0x55380e[_0x4568('0x1d')];var _0x3041c3=_0x2279a5?_0x508791[_0x4568('0x20')]:_0x55380e[_0x4568('0x1d')]+_0x55380e['limit'];var _0x596ee9;if(_0x3041c3>=_0x5f8344){_0x3041c3=_0x5f8344;_0x596ee9=0xc8;}else{_0x596ee9=0xce;}_0x5679b9['status'](_0x596ee9);return _0x5679b9[_0x4568('0x21')](_0x4568('0x22'),_0x496954+'-'+_0x3041c3+'/'+_0x5f8344)[_0x4568('0x23')](_0x508791);}return null;};}function patchUpdates(_0x1d5712){return function(_0x1995a8){try{jsonpatch[_0x4568('0x24')](_0x1995a8,_0x1d5712,!![]);}catch(_0x4074f8){return BPromise[_0x4568('0x25')](_0x4074f8);}return _0x1995a8[_0x4568('0x26')]();};}function saveUpdates(_0x21b621,_0xf5d204){return function(_0x170654){if(_0x170654){return _0x170654[_0x4568('0x27')](_0x21b621)[_0x4568('0x28')](function(_0x3f4514){return _0x3f4514;});}return null;};}function removeEntity(_0x13ec8e,_0x18d356){return function(_0x5876e8){if(_0x5876e8){return _0x5876e8[_0x4568('0x29')]()['then'](function(){var _0x569727=_0x5876e8[_0x4568('0x2a')]({'plain':!![]});var _0x5ce0fc=_0x4568('0x2b');return db[_0x4568('0x2c')][_0x4568('0x29')]({'where':{'type':_0x5ce0fc,'resourceId':_0x569727['id']}})['then'](function(){return _0x5876e8;});})['then'](function(){_0x13ec8e[_0x4568('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x142ad5,_0x1a55bc){return function(_0x2e57f1){if(!_0x2e57f1){_0x142ad5[_0x4568('0x1a')](0x194);}return _0x2e57f1;};}function handleError(_0x1b7f28,_0x29ea30){_0x29ea30=_0x29ea30||0x1f4;return function(_0x7ef31b){logger[_0x4568('0x2d')](_0x7ef31b[_0x4568('0x2e')]);if(_0x7ef31b['name']){delete _0x7ef31b['name'];}_0x1b7f28[_0x4568('0x1b')](_0x29ea30)['send'](_0x7ef31b);};}exports[_0x4568('0x2f')]=function(_0x38bb51,_0x2617ba){var _0x10bc80={},_0x2b629c={},_0x3ca5ba={'count':0x0,'rows':[]};var _0x5c7541=_[_0x4568('0x30')](db['Schedule']['rawAttributes'],function(_0x427710){return{'name':_0x427710[_0x4568('0x31')],'type':_0x427710[_0x4568('0x32')][_0x4568('0x33')]};});_0x2b629c['model']=_['map'](_0x5c7541,_0x4568('0x34'));_0x2b629c[_0x4568('0x35')]=_[_0x4568('0x36')](_0x38bb51['query']);_0x2b629c['filters']=_[_0x4568('0x37')](_0x2b629c[_0x4568('0x38')],_0x2b629c[_0x4568('0x35')]);_0x10bc80[_0x4568('0x39')]=_[_0x4568('0x37')](_0x2b629c[_0x4568('0x38')],qs[_0x4568('0x3a')](_0x38bb51[_0x4568('0x35')]['fields']));_0x10bc80[_0x4568('0x39')]=_0x10bc80[_0x4568('0x39')][_0x4568('0x3b')]?_0x10bc80[_0x4568('0x39')]:_0x2b629c[_0x4568('0x38')];if(!_0x38bb51[_0x4568('0x35')][_0x4568('0x3c')](_0x4568('0x3d'))){_0x10bc80['limit']=qs[_0x4568('0x1f')](_0x38bb51[_0x4568('0x35')]['limit']);_0x10bc80[_0x4568('0x1d')]=qs['offset'](_0x38bb51[_0x4568('0x35')]['offset']);}_0x10bc80[_0x4568('0x3e')]=qs['sort'](_0x38bb51[_0x4568('0x35')]['sort']);_0x10bc80[_0x4568('0x3f')]=qs[_0x4568('0x40')](_[_0x4568('0x41')](_0x38bb51[_0x4568('0x35')],_0x2b629c['filters']),_0x5c7541);if(_0x38bb51[_0x4568('0x35')][_0x4568('0x42')]){_0x10bc80[_0x4568('0x3f')]=_[_0x4568('0x43')](_0x10bc80[_0x4568('0x3f')],{'$or':_[_0x4568('0x30')](_0x5c7541,function(_0x5e7585){if(_0x5e7585[_0x4568('0x32')]!==_0x4568('0x44')){var _0x2abba7={};_0x2abba7[_0x5e7585[_0x4568('0x34')]]={'$like':'%'+_0x38bb51[_0x4568('0x35')][_0x4568('0x42')]+'%'};return _0x2abba7;}})});}_0x10bc80=_[_0x4568('0x43')]({},_0x10bc80,_0x38bb51[_0x4568('0x45')]);var _0x510488={'where':_0x10bc80[_0x4568('0x3f')]};return db[_0x4568('0x46')][_0x4568('0x20')](_0x510488)[_0x4568('0x28')](function(_0x441f4b){_0x3ca5ba[_0x4568('0x20')]=_0x441f4b;if(_0x38bb51[_0x4568('0x35')][_0x4568('0x47')]){_0x10bc80[_0x4568('0x48')]=[{'all':!![]}];}return db[_0x4568('0x46')][_0x4568('0x49')](_0x10bc80);})[_0x4568('0x28')](function(_0x5985a9){_0x3ca5ba['rows']=_0x5985a9;return _0x3ca5ba;})[_0x4568('0x28')](respondWithFilteredResult(_0x2617ba,_0x10bc80))[_0x4568('0x4a')](handleError(_0x2617ba,null));};exports[_0x4568('0x4b')]=function(_0x2ebf25,_0x547f49){var _0x440452={'raw':![],'where':{'id':_0x2ebf25[_0x4568('0x4c')]['id']}},_0x32a174={};_0x32a174[_0x4568('0x38')]=_[_0x4568('0x36')](db['Schedule'][_0x4568('0x4d')]);_0x32a174[_0x4568('0x35')]=_['keys'](_0x2ebf25[_0x4568('0x35')]);_0x32a174['filters']=_[_0x4568('0x37')](_0x32a174[_0x4568('0x38')],_0x32a174[_0x4568('0x35')]);_0x440452[_0x4568('0x39')]=_[_0x4568('0x37')](_0x32a174['model'],qs[_0x4568('0x3a')](_0x2ebf25['query'][_0x4568('0x3a')]));_0x440452[_0x4568('0x39')]=_0x440452[_0x4568('0x39')]['length']?_0x440452[_0x4568('0x39')]:_0x32a174[_0x4568('0x38')];if(_0x2ebf25['query'][_0x4568('0x47')]){_0x440452['include']=[{'all':!![]}];}_0x440452=_[_0x4568('0x43')]({},_0x440452,_0x2ebf25[_0x4568('0x45')]);return db[_0x4568('0x46')][_0x4568('0x4e')](_0x440452)[_0x4568('0x28')](handleEntityNotFound(_0x547f49,null))[_0x4568('0x28')](respondWithResult(_0x547f49,null))[_0x4568('0x4a')](handleError(_0x547f49,null));};exports[_0x4568('0x4f')]=function(_0x4a647c,_0x154ed6){return db[_0x4568('0x46')][_0x4568('0x4f')](_0x4a647c[_0x4568('0x50')],{})[_0x4568('0x28')](function(_0x5d6100){var _0x32a085=_0x4a647c['user'][_0x4568('0x2a')]({'plain':!![]});if(!_0x32a085)throw new Error(_0x4568('0x51'));if(_0x32a085[_0x4568('0x52')]==='user'){var _0x377296=_0x5d6100[_0x4568('0x2a')]({'plain':!![]});var _0x29e6e1=_0x4568('0x2b');return db[_0x4568('0x53')]['find']({'where':{'name':_0x29e6e1,'userProfileId':_0x32a085[_0x4568('0x54')]},'raw':!![]})[_0x4568('0x28')](function(_0x3d923d){if(_0x3d923d&&_0x3d923d[_0x4568('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x377296['name'],'resourceId':_0x377296['id'],'type':_0x3d923d[_0x4568('0x34')],'sectionId':_0x3d923d['id']},{})[_0x4568('0x28')](function(){return _0x5d6100;});}else{return _0x5d6100;}})['catch'](function(_0x44faee){logger[_0x4568('0x2d')](_0x4568('0x56'),_0x44faee);throw _0x44faee;});}return _0x5d6100;})[_0x4568('0x28')](respondWithResult(_0x154ed6,0xc9))[_0x4568('0x4a')](handleError(_0x154ed6,null));};exports[_0x4568('0x27')]=function(_0x546446,_0x13e298){if(_0x546446[_0x4568('0x50')]['id']){delete _0x546446[_0x4568('0x50')]['id'];}return db['Schedule'][_0x4568('0x4e')]({'where':{'id':_0x546446['params']['id']}})['then'](handleEntityNotFound(_0x13e298,null))[_0x4568('0x28')](saveUpdates(_0x546446[_0x4568('0x50')],null))[_0x4568('0x28')](respondWithResult(_0x13e298,null))[_0x4568('0x4a')](handleError(_0x13e298,null));};exports[_0x4568('0x29')]=function(_0x512c5e,_0x3cbda4){return db['Schedule']['find']({'where':{'id':_0x512c5e[_0x4568('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3cbda4,null))[_0x4568('0x28')](removeEntity(_0x3cbda4,null))[_0x4568('0x4a')](handleError(_0x3cbda4,null));};exports[_0x4568('0x57')]=function(_0x5a058c,_0x5c8f44,_0x450a5a){var _0x3ce749=require('../../config/schedule');return db[_0x4568('0x46')][_0x4568('0x4e')]({'where':{'id':_0x5a058c[_0x4568('0x4c')]['id']},'raw':!![]})[_0x4568('0x28')](handleEntityNotFound(_0x5c8f44,null))[_0x4568('0x28')](function(){_0x3ce749[_0x4568('0x57')](_0x5a058c[_0x4568('0x4c')]['id']);})[_0x4568('0x28')](respondWithStatusCode(_0x5c8f44,null))[_0x4568('0x4a')](handleError(_0x5c8f44,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 34e61b6..61a75d2 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 _0xd318=['api','moment','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules','lodash','util','../../config/logger'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0xd318,0x1de));var _0x8d31=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd318[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x8d31('0x0'));var util=require(_0x8d31('0x1'));var logger=require(_0x8d31('0x2'))(_0x8d31('0x3'));var moment=require(_0x8d31('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d31('0x5'));var fs=require('fs');var path=require(_0x8d31('0x6'));var rimraf=require(_0x8d31('0x7'));var config=require(_0x8d31('0x8'));var attributes=require(_0x8d31('0x9'));module[_0x8d31('0xa')]=function(_0x165b84,_0x3b5d6d){return _0x165b84['define'](_0x8d31('0xb'),attributes,{'tableName':_0x8d31('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94de=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94de,0x106));var _0xe94d=function(_0x491da1,_0xace78e){_0x491da1=_0x491da1-0x0;var _0x1284fe=_0x94de[_0x491da1];return _0x1284fe;};'use strict';var _=require(_0xe94d('0x0'));var util=require(_0xe94d('0x1'));var logger=require(_0xe94d('0x2'))(_0xe94d('0x3'));var moment=require(_0xe94d('0x4'));var BPromise=require(_0xe94d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe94d('0x6'));var config=require(_0xe94d('0x7'));var attributes=require(_0xe94d('0x8'));module['exports']=function(_0x3e12ff,_0x5c7614){return _0x3e12ff[_0xe94d('0x9')](_0xe94d('0xa'),attributes,{'tableName':_0xe94d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 922685e..c84ee9f 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 _0xb8db=['rpc','../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x44a3b0,_0x352810){var _0x39e6f6=function(_0x248002){while(--_0x248002){_0x44a3b0['push'](_0x44a3b0['shift']());}};_0x39e6f6(++_0x352810);}(_0xb8db,0xb7));var _0xbb8d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb8db[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbb8d('0x0'));var util=require(_0xbb8d('0x1'));var moment=require(_0xbb8d('0x2'));var BPromise=require(_0xbb8d('0x3'));var rs=require(_0xbb8d('0x4'));var fs=require('fs');var Redis=require(_0xbb8d('0x5'));var db=require(_0xbb8d('0x6'))['db'];var utils=require(_0xbb8d('0x7'));var logger=require(_0xbb8d('0x8'))(_0xbb8d('0x9'));var config=require(_0xbb8d('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xbb8d('0xb')][_0xbb8d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f1b3b,_0x1617f4,_0x18daa7){return new BPromise(function(_0x439668,_0x6b9d87){return client[_0xbb8d('0xd')](_0x3f1b3b,_0x18daa7)[_0xbb8d('0xe')](function(_0x4ee9e9){logger[_0xbb8d('0xf')](_0xbb8d('0x10'),_0x1617f4,_0xbb8d('0x11'));logger['debug'](_0xbb8d('0x12'),_0x1617f4,_0xbb8d('0x11'),JSON['stringify'](_0x4ee9e9));if(_0x4ee9e9[_0xbb8d('0x13')]){if(_0x4ee9e9[_0xbb8d('0x13')][_0xbb8d('0x14')]===0x1f4){logger['error'](_0xbb8d('0x10'),_0x1617f4,_0x4ee9e9[_0xbb8d('0x13')][_0xbb8d('0x15')]);return _0x6b9d87(_0x4ee9e9[_0xbb8d('0x13')][_0xbb8d('0x15')]);}logger['error'](_0xbb8d('0x10'),_0x1617f4,_0x4ee9e9[_0xbb8d('0x13')][_0xbb8d('0x15')]);return _0x439668(_0x4ee9e9['error'][_0xbb8d('0x15')]);}else{logger[_0xbb8d('0xf')]('Schedule,\x20%s,\x20%s',_0x1617f4,'request\x20sent');_0x439668(_0x4ee9e9[_0xbb8d('0x16')]['message']);}})[_0xbb8d('0x17')](function(_0x323c11){logger[_0xbb8d('0x13')](_0xbb8d('0x10'),_0x1617f4,_0x323c11);_0x6b9d87(_0x323c11);});});} \ No newline at end of file +var _0x6c8d=['debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x190c20,_0x28c07e){var _0x3f3504=function(_0x175582){while(--_0x175582){_0x190c20['push'](_0x190c20['shift']());}};_0x3f3504(++_0x28c07e);}(_0x6c8d,0x7f));var _0xd6c8=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6c8d[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xd6c8('0x0'));var util=require(_0xd6c8('0x1'));var moment=require(_0xd6c8('0x2'));var BPromise=require(_0xd6c8('0x3'));var rs=require(_0xd6c8('0x4'));var fs=require('fs');var Redis=require(_0xd6c8('0x5'));var db=require(_0xd6c8('0x6'))['db'];var utils=require(_0xd6c8('0x7'));var logger=require(_0xd6c8('0x8'))(_0xd6c8('0x9'));var config=require(_0xd6c8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xd6c8('0xb')][_0xd6c8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45374e,_0x3677fc,_0x249c4f){return new BPromise(function(_0x2a4024,_0x452815){return client[_0xd6c8('0xd')](_0x45374e,_0x249c4f)[_0xd6c8('0xe')](function(_0x28f838){logger[_0xd6c8('0xf')]('Schedule,\x20%s,\x20%s',_0x3677fc,_0xd6c8('0x10'));logger[_0xd6c8('0x11')](_0xd6c8('0x12'),_0x3677fc,_0xd6c8('0x10'),JSON[_0xd6c8('0x13')](_0x28f838));if(_0x28f838[_0xd6c8('0x14')]){if(_0x28f838['error'][_0xd6c8('0x15')]===0x1f4){logger['error'](_0xd6c8('0x16'),_0x3677fc,_0x28f838['error'][_0xd6c8('0x17')]);return _0x452815(_0x28f838[_0xd6c8('0x14')][_0xd6c8('0x17')]);}logger[_0xd6c8('0x14')]('Schedule,\x20%s,\x20%s',_0x3677fc,_0x28f838[_0xd6c8('0x14')]['message']);return _0x2a4024(_0x28f838[_0xd6c8('0x14')][_0xd6c8('0x17')]);}else{logger[_0xd6c8('0xf')]('Schedule,\x20%s,\x20%s',_0x3677fc,_0xd6c8('0x10'));_0x2a4024(_0x28f838['result'][_0xd6c8('0x17')]);}})['catch'](function(_0x11a04a){logger[_0xd6c8('0x14')](_0xd6c8('0x16'),_0x3677fc,_0x11a04a);_0x452815(_0x11a04a);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 78dc760..abed0da 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 _0x4116=['../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','describe','/:id/download','download','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','fs-extra'];(function(_0x3f2ecf,_0x4ccad6){var _0xa6dd7e=function(_0x5e04c3){while(--_0x5e04c3){_0x3f2ecf['push'](_0x3f2ecf['shift']());}};_0xa6dd7e(++_0x4ccad6);}(_0x4116,0x87));var _0x6411=function(_0x4fa166,_0x58b7fb){_0x4fa166=_0x4fa166-0x0;var _0x5dd974=_0x4116[_0x4fa166];return _0x5dd974;};'use strict';var multer=require(_0x6411('0x0'));var util=require(_0x6411('0x1'));var path=require(_0x6411('0x2'));var timeout=require(_0x6411('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6411('0x4'));var auth=require(_0x6411('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6411('0x6'));var controller=require(_0x6411('0x7'));router[_0x6411('0x8')]('/',auth[_0x6411('0x9')](),controller[_0x6411('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x6411('0xb')]);router[_0x6411('0x8')]('/:id',auth[_0x6411('0x9')](),controller['show']);router[_0x6411('0x8')](_0x6411('0xc'),auth[_0x6411('0x9')](),controller[_0x6411('0xd')]);router[_0x6411('0xe')]('/',auth[_0x6411('0x9')](),controller[_0x6411('0xf')]);router[_0x6411('0x10')](_0x6411('0x11'),auth[_0x6411('0x9')](),controller[_0x6411('0x12')]);router[_0x6411('0x13')]('/:id',auth[_0x6411('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe6a1=['../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','describe','/:id','isAuthenticated','show','/:id/download','post','create','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4cebb6,_0x53ba59){var _0x5ef179=function(_0x4fe9dc){while(--_0x4fe9dc){_0x4cebb6['push'](_0x4cebb6['shift']());}};_0x5ef179(++_0x53ba59);}(_0xe6a1,0x1b0));var _0x1e6a=function(_0x2b3d9f,_0x432c53){_0x2b3d9f=_0x2b3d9f-0x0;var _0x5bea13=_0xe6a1[_0x2b3d9f];return _0x5bea13;};'use strict';var multer=require(_0x1e6a('0x0'));var util=require(_0x1e6a('0x1'));var path=require(_0x1e6a('0x2'));var timeout=require(_0x1e6a('0x3'));var express=require(_0x1e6a('0x4'));var router=express[_0x1e6a('0x5')]();var fs_extra=require(_0x1e6a('0x6'));var auth=require(_0x1e6a('0x7'));var interaction=require(_0x1e6a('0x8'));var config=require(_0x1e6a('0x9'));var controller=require(_0x1e6a('0xa'));router[_0x1e6a('0xb')]('/',auth['isAuthenticated'](),controller[_0x1e6a('0xc')]);router[_0x1e6a('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x1e6a('0xd')]);router['get'](_0x1e6a('0xe'),auth[_0x1e6a('0xf')](),controller[_0x1e6a('0x10')]);router[_0x1e6a('0xb')](_0x1e6a('0x11'),auth[_0x1e6a('0xf')](),controller['download']);router[_0x1e6a('0x12')]('/',auth[_0x1e6a('0xf')](),controller[_0x1e6a('0x13')]);router['put'](_0x1e6a('0xe'),auth[_0x1e6a('0xf')](),controller['update']);router[_0x1e6a('0x14')](_0x1e6a('0xe'),auth[_0x1e6a('0xf')](),controller['destroy']);module[_0x1e6a('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 2f1dacb..5f5daf7 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 _0x3fc6=['exports','VIRTUAL','value','extname','getDataValue','STRING','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x3fc6,0x115));var _0x63fc=function(_0x396880,_0x1ee0cc){_0x396880=_0x396880-0x0;var _0x381a29=_0x3fc6[_0x396880];return _0x381a29;};'use strict';var Sequelize=require(_0x63fc('0x0'));var moment=require('moment');var path=require(_0x63fc('0x1'));var config=require(_0x63fc('0x2'));module[_0x63fc('0x3')]={'format':{'type':Sequelize[_0x63fc('0x4')],'get':function(){return this['getDataValue'](_0x63fc('0x5'))?path[_0x63fc('0x6')](this[_0x63fc('0x7')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x63fc('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x63fc('0x8')],'set':function(_0x1c7f72){var _0x3e8157=_0x1c7f72['replace'](/\\/g,'/');this[_0x63fc('0x9')](_0x63fc('0x5'),_0x3e8157);}},'rating':{'type':Sequelize[_0x63fc('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x63fc('0xa')],'set':function(_0x32749b){this['setDataValue'](_0x63fc('0xb'),moment()['subtract'](_0x32749b,'ms'));this['setDataValue'](_0x63fc('0xc'),moment());this[_0x63fc('0x9')](_0x63fc('0xd'),_0x32749b);}},'startedAt':{'type':Sequelize[_0x63fc('0xe')],'get':function(){return moment(this[_0x63fc('0x7')](_0x63fc('0xb')))[_0x63fc('0xf')](_0x63fc('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x63fc('0xe')],'get':function(){return moment(this[_0x63fc('0x7')](_0x63fc('0xc')))['format'](_0x63fc('0x10'))[_0x63fc('0x11')]();}},'createdAt':{'type':Sequelize[_0x63fc('0xe')],'get':function(){return moment(this['getDataValue'](_0x63fc('0x12')))[_0x63fc('0xf')](_0x63fc('0x10'))[_0x63fc('0x11')]();}},'updatedAt':{'type':Sequelize[_0x63fc('0xe')],'get':function(){return moment(this[_0x63fc('0x7')](_0x63fc('0x13')))[_0x63fc('0xf')](_0x63fc('0x10'))[_0x63fc('0x11')]();}}}; \ No newline at end of file +var _0x81cb=['moment','../../config/environment','exports','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize'];(function(_0x4fb60e,_0x5c570b){var _0x2670ba=function(_0x2ac752){while(--_0x2ac752){_0x4fb60e['push'](_0x4fb60e['shift']());}};_0x2670ba(++_0x5c570b);}(_0x81cb,0xaa));var _0xb81c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81cb[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xb81c('0x0'));var moment=require(_0xb81c('0x1'));var path=require('path');var config=require(_0xb81c('0x2'));module[_0xb81c('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb81c('0x4')](_0xb81c('0x5'))?path[_0xb81c('0x6')](this[_0xb81c('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xb81c('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x2666f6){var _0x2a06b2=_0x2666f6[_0xb81c('0x8')](/\\/g,'/');this[_0xb81c('0x9')](_0xb81c('0x5'),_0x2a06b2);}},'rating':{'type':Sequelize[_0xb81c('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xb81c('0xa')],'set':function(_0x14b1bf){this[_0xb81c('0x9')](_0xb81c('0xb'),moment()[_0xb81c('0xc')](_0x14b1bf,'ms'));this[_0xb81c('0x9')](_0xb81c('0xd'),moment());this[_0xb81c('0x9')]('duration',_0x14b1bf);}},'startedAt':{'type':Sequelize[_0xb81c('0xe')],'get':function(){return moment(this[_0xb81c('0x4')](_0xb81c('0xb')))[_0xb81c('0xf')](_0xb81c('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0xb81c('0xe')],'get':function(){return moment(this['getDataValue'](_0xb81c('0xd')))[_0xb81c('0xf')]('MM-DD-YYYY\x20HH:mm')[_0xb81c('0x11')]();}},'createdAt':{'type':Sequelize[_0xb81c('0xe')],'get':function(){return moment(this['getDataValue'](_0xb81c('0x12')))[_0xb81c('0xf')](_0xb81c('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0xb81c('0xe')],'get':function(){return moment(this[_0xb81c('0x4')]('updatedAt'))[_0xb81c('0xf')](_0xb81c('0x10'))[_0xb81c('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 8536929..2c70b57 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 _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x1b943f,_0x6f6e83){var _0x8b7549=function(_0x5b52d3){while(--_0x5b52d3){_0x1b943f['push'](_0x1b943f['shift']());}};_0x8b7549(++_0x6f6e83);}(_0xb138,0x1dd));var _0x8b13=function(_0x569bf8,_0x3dcec0){_0x569bf8=_0x569bf8-0x0;var _0x29045e=_0xb138[_0x569bf8];return _0x29045e;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,null));}; \ No newline at end of file +var _0x5075=['send','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','end','error','name','index','map','ScreenRecording','rawAttributes','fieldName','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','message'];(function(_0x2cf98f,_0x3b763a){var _0x1ac3a2=function(_0x3e3d85){while(--_0x3e3d85){_0x2cf98f['push'](_0x2cf98f['shift']());}};_0x1ac3a2(++_0x3b763a);}(_0x5075,0x73));var _0x5507=function(_0x312ad6,_0x5dcca8){_0x312ad6=_0x312ad6-0x0;var _0x1069dc=_0x5075[_0x312ad6];return _0x1069dc;};'use strict';var emlformat=require(_0x5507('0x0'));var rimraf=require(_0x5507('0x1'));var zipdir=require(_0x5507('0x2'));var jsonpatch=require(_0x5507('0x3'));var rp=require(_0x5507('0x4'));var moment=require(_0x5507('0x5'));var BPromise=require(_0x5507('0x6'));var Mustache=require('mustache');var util=require(_0x5507('0x7'));var path=require(_0x5507('0x8'));var sox=require(_0x5507('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5507('0xa'));var _=require(_0x5507('0xb'));var squel=require('squel');var crypto=require(_0x5507('0xc'));var jsforce=require(_0x5507('0xd'));var deskjs=require(_0x5507('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5507('0xf'));var Redis=require(_0x5507('0x10'));var authService=require(_0x5507('0x11'));var qs=require(_0x5507('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5507('0x13'));var logger=require(_0x5507('0x14'))('api');var utils=require(_0x5507('0x15'));var config=require(_0x5507('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5507('0x17'))['db'];function respondWithStatusCode(_0x2a2ea0,_0x32c872){_0x32c872=_0x32c872||0xcc;return function(_0x267f27){if(_0x267f27){return _0x2a2ea0[_0x5507('0x18')](_0x32c872);}return _0x2a2ea0[_0x5507('0x19')](_0x32c872)['end']();};}function respondWithResult(_0x9cc3f9,_0x2b7c43){_0x2b7c43=_0x2b7c43||0xc8;return function(_0xc828e5){if(_0xc828e5){return _0x9cc3f9[_0x5507('0x19')](_0x2b7c43)['json'](_0xc828e5);}};}function respondWithFilteredResult(_0x49e400,_0x10d7b9){return function(_0x2dfd06){if(_0x2dfd06){var _0x1ab167=typeof _0x10d7b9[_0x5507('0x1a')]===_0x5507('0x1b')&&typeof _0x10d7b9[_0x5507('0x1c')]===_0x5507('0x1b');var _0x3d1619=_0x2dfd06[_0x5507('0x1d')];var _0x233b6a=_0x1ab167?0x0:_0x10d7b9[_0x5507('0x1a')];var _0x3822dd=_0x1ab167?_0x2dfd06['count']:_0x10d7b9[_0x5507('0x1a')]+_0x10d7b9[_0x5507('0x1c')];var _0x4054c6;if(_0x3822dd>=_0x3d1619){_0x3822dd=_0x3d1619;_0x4054c6=0xc8;}else{_0x4054c6=0xce;}_0x49e400[_0x5507('0x19')](_0x4054c6);return _0x49e400['set'](_0x5507('0x1e'),_0x233b6a+'-'+_0x3822dd+'/'+_0x3d1619)[_0x5507('0x1f')](_0x2dfd06);}return null;};}function patchUpdates(_0x1a54b0){return function(_0x3ca1f7){try{jsonpatch[_0x5507('0x20')](_0x3ca1f7,_0x1a54b0,!![]);}catch(_0x1be8b1){return BPromise['reject'](_0x1be8b1);}return _0x3ca1f7[_0x5507('0x21')]();};}function saveUpdates(_0x105535,_0x1f6325){return function(_0xa3e2cf){if(_0xa3e2cf){return _0xa3e2cf[_0x5507('0x22')](_0x105535)[_0x5507('0x23')](function(_0x1fcc8d){return _0x1fcc8d;});}return null;};}function removeEntity(_0x10f149,_0x398911){return function(_0xa47641){if(_0xa47641){return _0xa47641[_0x5507('0x24')]()[_0x5507('0x23')](function(){_0x10f149[_0x5507('0x19')](0xcc)[_0x5507('0x25')]();});}};}function handleEntityNotFound(_0x1a2203,_0x4915ed){return function(_0x4e8906){if(!_0x4e8906){_0x1a2203['sendStatus'](0x194);}return _0x4e8906;};}function handleError(_0x26335e,_0x4ea271){_0x4ea271=_0x4ea271||0x1f4;return function(_0xa66a01){logger[_0x5507('0x26')](_0xa66a01['stack']);if(_0xa66a01['name']){delete _0xa66a01[_0x5507('0x27')];}_0x26335e[_0x5507('0x19')](_0x4ea271)['send'](_0xa66a01);};}exports[_0x5507('0x28')]=function(_0x24574b,_0x85d383){var _0x38f4d9={},_0x1e5ce6={},_0x14fdea={'count':0x0,'rows':[]};var _0x55e889=_[_0x5507('0x29')](db[_0x5507('0x2a')][_0x5507('0x2b')],function(_0x38f0f5){return{'name':_0x38f0f5[_0x5507('0x2c')],'type':_0x38f0f5['type']['key']};});_0x1e5ce6[_0x5507('0x2d')]=_[_0x5507('0x2e')](_[_0x5507('0x29')](_0x55e889,_0x5507('0x27')),['format']);_0x1e5ce6[_0x5507('0x2f')]=_[_0x5507('0x30')](_0x24574b[_0x5507('0x2f')]);_0x1e5ce6[_0x5507('0x31')]=_[_0x5507('0x32')](_0x1e5ce6[_0x5507('0x2d')],_0x1e5ce6[_0x5507('0x2f')]);_0x38f4d9[_0x5507('0x33')]=_['intersection'](_0x1e5ce6[_0x5507('0x2d')],qs[_0x5507('0x34')](_0x24574b[_0x5507('0x2f')]['fields']));_0x38f4d9['attributes']=_0x38f4d9[_0x5507('0x33')][_0x5507('0x35')]?_0x38f4d9[_0x5507('0x33')]:_0x1e5ce6[_0x5507('0x2d')];if(!_0x24574b[_0x5507('0x2f')]['hasOwnProperty']('nolimit')){_0x38f4d9[_0x5507('0x1c')]=qs[_0x5507('0x1c')](_0x24574b[_0x5507('0x2f')][_0x5507('0x1c')]);_0x38f4d9['offset']=qs['offset'](_0x24574b[_0x5507('0x2f')]['offset']);}_0x38f4d9[_0x5507('0x36')]=qs[_0x5507('0x37')](_0x24574b[_0x5507('0x2f')][_0x5507('0x37')]);_0x38f4d9[_0x5507('0x38')]=qs[_0x5507('0x31')](_[_0x5507('0x39')](_0x24574b[_0x5507('0x2f')],_0x1e5ce6[_0x5507('0x31')]),_0x55e889);if(_0x24574b[_0x5507('0x2f')]['filter']){_0x38f4d9['where']=_['merge'](_0x38f4d9['where'],{'$or':_[_0x5507('0x29')](_0x55e889,function(_0x2cf512){if(_0x2cf512[_0x5507('0x3a')]!==_0x5507('0x3b')){var _0x2b32a5={};_0x2b32a5[_0x2cf512[_0x5507('0x27')]]={'$like':'%'+_0x24574b[_0x5507('0x2f')][_0x5507('0x3c')]+'%'};return _0x2b32a5;}})});}_0x38f4d9=_[_0x5507('0x3d')]({},_0x38f4d9,_0x24574b[_0x5507('0x3e')]);var _0x3ec0ed={'where':_0x38f4d9[_0x5507('0x38')]};return db[_0x5507('0x2a')][_0x5507('0x1d')](_0x3ec0ed)['then'](function(_0x53b3f3){_0x14fdea['count']=_0x53b3f3;if(_0x24574b[_0x5507('0x2f')][_0x5507('0x3f')]){_0x38f4d9[_0x5507('0x40')]=[{'all':!![]}];}return db[_0x5507('0x2a')][_0x5507('0x41')](_0x38f4d9);})[_0x5507('0x23')](function(_0x340c4c){_0x14fdea[_0x5507('0x42')]=_0x340c4c;return _0x14fdea;})[_0x5507('0x23')](respondWithFilteredResult(_0x85d383,_0x38f4d9))[_0x5507('0x43')](handleError(_0x85d383,null));};exports[_0x5507('0x44')]=function(_0x192a00,_0x24d7b5){var _0x25496b={'raw':![],'where':{'id':_0x192a00[_0x5507('0x45')]['id']}},_0x1b3006={};_0x1b3006[_0x5507('0x2d')]=_[_0x5507('0x30')](db[_0x5507('0x2a')]['rawAttributes']);_0x1b3006[_0x5507('0x2f')]=_[_0x5507('0x30')](_0x192a00['query']);_0x1b3006['filters']=_[_0x5507('0x32')](_0x1b3006[_0x5507('0x2d')],_0x1b3006[_0x5507('0x2f')]);_0x25496b[_0x5507('0x33')]=_[_0x5507('0x32')](_0x1b3006['model'],qs[_0x5507('0x34')](_0x192a00[_0x5507('0x2f')][_0x5507('0x34')]));_0x25496b['attributes']=_0x25496b[_0x5507('0x33')][_0x5507('0x35')]?_0x25496b[_0x5507('0x33')]:_0x1b3006[_0x5507('0x2d')];if(_0x192a00[_0x5507('0x2f')]['includeAll']){_0x25496b[_0x5507('0x40')]=[{'all':!![]}];}_0x25496b=_['merge']({},_0x25496b,_0x192a00[_0x5507('0x3e')]);return db[_0x5507('0x2a')][_0x5507('0x46')](_0x25496b)[_0x5507('0x23')](handleEntityNotFound(_0x24d7b5,null))[_0x5507('0x23')](respondWithResult(_0x24d7b5,null))[_0x5507('0x43')](handleError(_0x24d7b5,null));};exports[_0x5507('0x47')]=function(_0x3452e4,_0x549cf0){return db[_0x5507('0x2a')][_0x5507('0x47')](_0x3452e4['body'],{})['then'](respondWithResult(_0x549cf0,0xc9))['catch'](handleError(_0x549cf0,null));};exports[_0x5507('0x22')]=function(_0x5961fd,_0x403d03){if(_0x5961fd['body']['id']){delete _0x5961fd[_0x5507('0x48')]['id'];}delete _0x5961fd['body']['duration'];delete _0x5961fd[_0x5507('0x48')][_0x5507('0x49')];delete _0x5961fd[_0x5507('0x48')][_0x5507('0x4a')];delete _0x5961fd[_0x5507('0x48')][_0x5507('0x4b')];return db['ScreenRecording'][_0x5507('0x46')]({'where':{'id':_0x5961fd[_0x5507('0x45')]['id']}})[_0x5507('0x23')](handleEntityNotFound(_0x403d03,null))['then'](saveUpdates(_0x5961fd[_0x5507('0x48')],null))[_0x5507('0x23')](respondWithResult(_0x403d03,null))[_0x5507('0x43')](handleError(_0x403d03,null));};exports[_0x5507('0x4c')]=function(_0x300c9f,_0x3af70f){return db[_0x5507('0x2a')][_0x5507('0x4c')]()[_0x5507('0x23')](respondWithResult(_0x3af70f,null))[_0x5507('0x43')](handleError(_0x3af70f,null));};exports[_0x5507('0x4d')]=function(_0x49a2f8,_0x570928,_0x1992fa){var _0x5d7753=require(_0x5507('0x4e'));var _0x1b34c8=![];var _0xce851d={};if(_0x49a2f8[_0x5507('0x2f')][_0x5507('0x3a')]&&_0x49a2f8[_0x5507('0x2f')][_0x5507('0x3a')]===_0x5507('0x4f')){_0xce851d[_0x5507('0x4f')]=_0x49a2f8[_0x5507('0x45')]['id'];}else{_0xce851d['id']=_0x49a2f8[_0x5507('0x45')]['id'];}return db[_0x5507('0x2a')][_0x5507('0x46')]({'where':_0xce851d,'attributes':['id',_0x5507('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x570928,null))[_0x5507('0x23')](function(_0x56e0cd){if(_0x56e0cd){var _0x5af5f5=path[_0x5507('0x50')](config[_0x5507('0x51')],_0x5507('0x52'),_0x56e0cd[_0x5507('0x4b')]);var _0x52b9f2=util[_0x5507('0x53')](_0x5507('0x54'),_0x5af5f5);if(fs[_0x5507('0x55')](_0x52b9f2)){_0x1b34c8=!![];return _0x5d7753[_0x5507('0x56')](_0x52b9f2,_0x5af5f5,config[_0x5507('0x57')][_0x5507('0x58')])['then'](function(){return _0x56e0cd;});}return _0x56e0cd;}})[_0x5507('0x23')](function(_0x46e589){if(_0x46e589){var _0x3a2f9f=path['join'](config['root'],_0x5507('0x52'),_0x46e589['value']);if(!fs[_0x5507('0x55')](_0x3a2f9f)){throw new db[(_0x5507('0x59'))]['ValidationError'](_0x5507('0x5a'));}if(_0x46e589[_0x5507('0x5b')]){return _0x570928[_0x5507('0x4d')](_0x3a2f9f,_0x46e589[_0x5507('0x5b')]+path[_0x5507('0x5c')](_0x3a2f9f),function(){if(_0x1b34c8){fs[_0x5507('0x5d')](_0x3a2f9f);}});}else{return _0x570928[_0x5507('0x4d')](_0x3a2f9f,function(_0x2928f2){if(_0x1b34c8){fs[_0x5507('0x5d')](_0x3a2f9f);}});}}})[_0x5507('0x43')](function(_0x1453f1){if(_0x1453f1[_0x5507('0x5e')]==='ScreenRecording\x20not\x20found'){_0x570928[_0x5507('0x19')](0x194)[_0x5507('0x5f')](_0x5507('0x60'));}else{return handleError(_0x570928,null);}});};exports[_0x5507('0x24')]=function(_0x3c4422,_0x5183ae){return db[_0x5507('0x2a')]['find']({'where':{'id':_0x3c4422[_0x5507('0x45')]['id']}})[_0x5507('0x23')](function(_0x241733){if(_['isNil'](_0x241733)){throw new ReferenceError(_0x5507('0x61'));}return _0x241733;})[_0x5507('0x23')](function(_0x2a9672){var _0x56632b=path[_0x5507('0x50')](config['root'],_0x5507('0x52'),_0x2a9672['value']);logger['info'](_0x5507('0x62'),_0x56632b);if(!_[_0x5507('0x63')](_0x2a9672[_0x5507('0x4b')])&&fs[_0x5507('0x55')](_0x56632b)){logger[_0x5507('0x64')](_0x5507('0x65')+_0x56632b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x56632b);}_0x56632b=_0x56632b+_0x5507('0x66');if(!_[_0x5507('0x63')](_0x2a9672[_0x5507('0x4b')])&&fs[_0x5507('0x55')](_0x56632b)){logger['info'](_0x5507('0x65')+_0x56632b+_0x5507('0x67'));fs[_0x5507('0x68')](_0x56632b);}return _0x2a9672;})[_0x5507('0x23')](function(_0x296cf5){if(!_0x296cf5)throw new InternalError();return _0x296cf5[_0x5507('0x24')]();})[_0x5507('0x23')](function(){_0x5183ae['status'](0xcc)[_0x5507('0x25')]();})[_0x5507('0x43')](handleError(_0x5183ae,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index f3cc5fe..5f5822a 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 _0x2017=['ScreenRecording','interactionid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x2017,0x113));var _0x7201=function(_0x1d0499,_0x23e22f){_0x1d0499=_0x1d0499-0x0;var _0x153fb3=_0x2017[_0x1d0499];return _0x153fb3;};'use strict';var _=require(_0x7201('0x0'));var util=require(_0x7201('0x1'));var logger=require(_0x7201('0x2'))('api');var moment=require(_0x7201('0x3'));var BPromise=require(_0x7201('0x4'));var rp=require(_0x7201('0x5'));var fs=require('fs');var path=require(_0x7201('0x6'));var rimraf=require(_0x7201('0x7'));var config=require(_0x7201('0x8'));var attributes=require(_0x7201('0x9'));module[_0x7201('0xa')]=function(_0x4822e4,_0x46cd5a){return _0x4822e4['define'](_0x7201('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x7201('0xc'),'fields':[_0x7201('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xec06=['ScreenRecording','screen_recordings','interactionid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','define'];(function(_0x534b07,_0x38f7d7){var _0x4360ba=function(_0x209ef1){while(--_0x209ef1){_0x534b07['push'](_0x534b07['shift']());}};_0x4360ba(++_0x38f7d7);}(_0xec06,0x1d9));var _0x6ec0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec06[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x6ec0('0x0'));var logger=require(_0x6ec0('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6ec0('0x2'));var fs=require('fs');var path=require(_0x6ec0('0x3'));var rimraf=require(_0x6ec0('0x4'));var config=require(_0x6ec0('0x5'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0xdc47ad,_0x5a77a5){return _0xdc47ad[_0x6ec0('0x6')](_0x6ec0('0x7'),attributes,{'tableName':_0x6ec0('0x8'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x6ec0('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 345b18d..7937827 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 _0xd2dd=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','ScreenRecording,\x20%s,\x20%s','message','error','result','lodash','util'];(function(_0x5e4a4d,_0x522015){var _0x1ffbfc=function(_0xdb4f23){while(--_0xdb4f23){_0x5e4a4d['push'](_0x5e4a4d['shift']());}};_0x1ffbfc(++_0x522015);}(_0xd2dd,0x1de));var _0xdd2d=function(_0x31793e,_0x48f246){_0x31793e=_0x31793e-0x0;var _0x3e4f32=_0xd2dd[_0x31793e];return _0x3e4f32;};'use strict';var _=require(_0xdd2d('0x0'));var util=require(_0xdd2d('0x1'));var moment=require(_0xdd2d('0x2'));var BPromise=require(_0xdd2d('0x3'));var rs=require(_0xdd2d('0x4'));var fs=require('fs');var Redis=require(_0xdd2d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd2d('0x6'));var logger=require('../../config/logger')(_0xdd2d('0x7'));var config=require(_0xdd2d('0x8'));var jayson=require(_0xdd2d('0x9'));var client=jayson[_0xdd2d('0xa')][_0xdd2d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50f638,_0x1cb55a,_0x3ce98f){return new BPromise(function(_0x177a3f,_0x48538b){return client[_0xdd2d('0xc')](_0x50f638,_0x3ce98f)[_0xdd2d('0xd')](function(_0x5f6458){logger[_0xdd2d('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x1cb55a,'request\x20sent');logger[_0xdd2d('0xf')](_0xdd2d('0x10'),_0x1cb55a,_0xdd2d('0x11'),JSON[_0xdd2d('0x12')](_0x5f6458));if(_0x5f6458['error']){if(_0x5f6458['error'][_0xdd2d('0x13')]===0x1f4){logger['error'](_0xdd2d('0x14'),_0x1cb55a,_0x5f6458['error'][_0xdd2d('0x15')]);return _0x48538b(_0x5f6458[_0xdd2d('0x16')][_0xdd2d('0x15')]);}logger[_0xdd2d('0x16')](_0xdd2d('0x14'),_0x1cb55a,_0x5f6458[_0xdd2d('0x16')][_0xdd2d('0x15')]);return _0x177a3f(_0x5f6458['error'][_0xdd2d('0x15')]);}else{logger[_0xdd2d('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x1cb55a,'request\x20sent');_0x177a3f(_0x5f6458[_0xdd2d('0x17')]['message']);}})['catch'](function(_0x58bc82){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x1cb55a,_0x58bc82);_0x48538b(_0x58bc82);});});} \ No newline at end of file +var _0x042d=['stringify','code','error','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s'];(function(_0x463462,_0x35a47f){var _0x57fecf=function(_0x3ab3c9){while(--_0x3ab3c9){_0x463462['push'](_0x463462['shift']());}};_0x57fecf(++_0x35a47f);}(_0x042d,0x15a));var _0xd042=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x042d[_0x204eb7];return _0x37e444;};'use strict';var _=require('lodash');var util=require(_0xd042('0x0'));var moment=require('moment');var BPromise=require(_0xd042('0x1'));var rs=require(_0xd042('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd042('0x3'))['db'];var utils=require(_0xd042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd042('0x5'));var jayson=require(_0xd042('0x6'));var client=jayson[_0xd042('0x7')][_0xd042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x580ecf,_0x5ebffd,_0x5abff3){return new BPromise(function(_0x1b8611,_0x30c8ba){return client[_0xd042('0x9')](_0x580ecf,_0x5abff3)[_0xd042('0xa')](function(_0x2358ab){logger['info'](_0xd042('0xb'),_0x5ebffd,_0xd042('0xc'));logger['debug'](_0xd042('0xd'),_0x5ebffd,_0xd042('0xc'),JSON[_0xd042('0xe')](_0x2358ab));if(_0x2358ab['error']){if(_0x2358ab['error'][_0xd042('0xf')]===0x1f4){logger[_0xd042('0x10')](_0xd042('0xb'),_0x5ebffd,_0x2358ab[_0xd042('0x10')][_0xd042('0x11')]);return _0x30c8ba(_0x2358ab[_0xd042('0x10')]['message']);}logger['error'](_0xd042('0xb'),_0x5ebffd,_0x2358ab[_0xd042('0x10')]['message']);return _0x1b8611(_0x2358ab[_0xd042('0x10')]['message']);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x5ebffd,_0xd042('0xc'));_0x1b8611(_0x2358ab[_0xd042('0x12')][_0xd042('0x11')]);}})[_0xd042('0x13')](function(_0x59cf23){logger['error'](_0xd042('0xb'),_0x5ebffd,_0x59cf23);_0x30c8ba(_0x59cf23);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 3633baf..0984c14 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 _0x6461=['addLogoLogin','/:id/preferred','addPreferred','favicon','addFavicon','put','update','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','getLogo','/:id/favicon','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','addLogo','diskStorage','logologin','/:id/logo_login'];(function(_0x799123,_0x4e7fbc){var _0x46d7bc=function(_0x2577c4){while(--_0x2577c4){_0x799123['push'](_0x799123['shift']());}};_0x46d7bc(++_0x4e7fbc);}(_0x6461,0x138));var _0x1646=function(_0x3d5f07,_0x4a7b08){_0x3d5f07=_0x3d5f07-0x0;var _0x58f33f=_0x6461[_0x3d5f07];return _0x58f33f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1646('0x0'));var express=require('express');var router=express[_0x1646('0x1')]();var fs_extra=require(_0x1646('0x2'));var auth=require(_0x1646('0x3'));var interaction=require(_0x1646('0x4'));var config=require(_0x1646('0x5'));var controller=require(_0x1646('0x6'));router[_0x1646('0x7')]('/',auth[_0x1646('0x8')](),controller[_0x1646('0x9')]);router[_0x1646('0x7')](_0x1646('0xa'),controller['getDate']);router[_0x1646('0x7')](_0x1646('0xb'),controller[_0x1646('0xc')]);router[_0x1646('0x7')]('/:id/logo',controller[_0x1646('0xd')]);router['get']('/:id/logo_login',controller['getLogoLogin']);router[_0x1646('0x7')]('/:id/gdpr',controller['gdpr']);router[_0x1646('0x7')]('/:id/preferred',controller['getPreferred']);router[_0x1646('0x7')](_0x1646('0xe'),controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x6dcdc0,_0x569df4,_0x1ef184){_0x1ef184(null,path[_0x1646('0xf')](config[_0x1646('0x10')],_0x1646('0x11')));},'filename':function(_0xf43f40,_0x5463a2,_0x94cfaa){_0x94cfaa(null,util[_0x1646('0x12')](_0x1646('0x13'),_0x1646('0x14'),path[_0x1646('0x15')](_0x5463a2[_0x1646('0x16')])));}})});router[_0x1646('0x17')]('/:id/logo',upload[_0x1646('0x18')](_0x1646('0x19')),controller[_0x1646('0x1a')]);var upload=multer({'storage':multer[_0x1646('0x1b')]({'destination':function(_0x5e85a7,_0x2cf61e,_0x5aaabe){_0x5aaabe(null,path[_0x1646('0xf')](config[_0x1646('0x10')],_0x1646('0x11')));},'filename':function(_0x3f4a2d,_0x35a163,_0x26ec95){_0x26ec95(null,util[_0x1646('0x12')](_0x1646('0x13'),_0x1646('0x1c'),path[_0x1646('0x15')](_0x35a163[_0x1646('0x16')])));}})});router[_0x1646('0x17')](_0x1646('0x1d'),upload[_0x1646('0x18')](_0x1646('0x19')),controller[_0x1646('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f3af9,_0xea139b,_0x1acce4){_0x1acce4(null,path[_0x1646('0xf')](config[_0x1646('0x10')],_0x1646('0x11')));},'filename':function(_0x2ac580,_0x2df041,_0x57635a){_0x57635a(null,util[_0x1646('0x12')](_0x1646('0x13'),'preferred',path[_0x1646('0x15')](_0x2df041[_0x1646('0x16')])));}})});router[_0x1646('0x17')](_0x1646('0x1f'),upload[_0x1646('0x18')]('file'),controller[_0x1646('0x20')]);var upload=multer({'storage':multer[_0x1646('0x1b')]({'destination':function(_0x4a56dc,_0x4fa151,_0xd3a77a){_0xd3a77a(null,path['join'](config[_0x1646('0x10')],'server/files/images/logos/'));},'filename':function(_0x4a4bf7,_0x20c208,_0x2c7ba5){_0x2c7ba5(null,util[_0x1646('0x12')](_0x1646('0x13'),_0x1646('0x21'),path[_0x1646('0x15')](_0x20c208[_0x1646('0x16')])));}})});router[_0x1646('0x17')]('/:id/favicon',upload[_0x1646('0x18')](_0x1646('0x19')),controller[_0x1646('0x22')]);router[_0x1646('0x23')](_0x1646('0xb'),auth[_0x1646('0x8')](),controller[_0x1646('0x24')]);module[_0x1646('0x25')]=router; \ No newline at end of file +var _0x795f=['/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','logo','extname','originalname','single','file','logologin','post','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x795f,0xf6));var _0xf795=function(_0x20829f,_0xc5f34){_0x20829f=_0x20829f-0x0;var _0x2a96f8=_0x795f[_0x20829f];return _0x2a96f8;};'use strict';var multer=require(_0xf795('0x0'));var util=require('util');var path=require(_0xf795('0x1'));var timeout=require(_0xf795('0x2'));var express=require(_0xf795('0x3'));var router=express[_0xf795('0x4')]();var fs_extra=require(_0xf795('0x5'));var auth=require(_0xf795('0x6'));var interaction=require(_0xf795('0x7'));var config=require(_0xf795('0x8'));var controller=require('./setting.controller');router['get']('/',auth[_0xf795('0x9')](),controller[_0xf795('0xa')]);router[_0xf795('0xb')](_0xf795('0xc'),controller[_0xf795('0xd')]);router[_0xf795('0xb')](_0xf795('0xe'),controller[_0xf795('0xf')]);router[_0xf795('0xb')](_0xf795('0x10'),controller[_0xf795('0x11')]);router[_0xf795('0xb')](_0xf795('0x12'),controller['getLogoLogin']);router['get']('/:id/gdpr',controller['gdpr']);router['get'](_0xf795('0x13'),controller[_0xf795('0x14')]);router[_0xf795('0xb')](_0xf795('0x15'),controller[_0xf795('0x16')]);var upload=multer({'storage':multer[_0xf795('0x17')]({'destination':function(_0x386db6,_0x51fc2b,_0x382817){_0x382817(null,path[_0xf795('0x18')](config[_0xf795('0x19')],_0xf795('0x1a')));},'filename':function(_0x462df7,_0x1e8a05,_0xb74bee){_0xb74bee(null,util['format'](_0xf795('0x1b'),_0xf795('0x1c'),path[_0xf795('0x1d')](_0x1e8a05[_0xf795('0x1e')])));}})});router['post'](_0xf795('0x10'),upload[_0xf795('0x1f')](_0xf795('0x20')),controller['addLogo']);var upload=multer({'storage':multer[_0xf795('0x17')]({'destination':function(_0x415777,_0x5db4fd,_0x54d8d9){_0x54d8d9(null,path[_0xf795('0x18')](config[_0xf795('0x19')],'server/files/images/logos/'));},'filename':function(_0x3c4536,_0x3b8ac8,_0x368e62){_0x368e62(null,util['format']('%s%s',_0xf795('0x21'),path[_0xf795('0x1d')](_0x3b8ac8[_0xf795('0x1e')])));}})});router[_0xf795('0x22')]('/:id/logo_login',upload[_0xf795('0x1f')]('file'),controller[_0xf795('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd89f95,_0xad85bd,_0x38daa6){_0x38daa6(null,path[_0xf795('0x18')](config[_0xf795('0x19')],_0xf795('0x1a')));},'filename':function(_0x532727,_0x1de78d,_0x1e05a0){_0x1e05a0(null,util['format'](_0xf795('0x1b'),_0xf795('0x24'),path[_0xf795('0x1d')](_0x1de78d[_0xf795('0x1e')])));}})});router[_0xf795('0x22')]('/:id/preferred',upload[_0xf795('0x1f')](_0xf795('0x20')),controller[_0xf795('0x25')]);var upload=multer({'storage':multer[_0xf795('0x17')]({'destination':function(_0x51343b,_0x3f4d90,_0x3c00b6){_0x3c00b6(null,path[_0xf795('0x18')](config[_0xf795('0x19')],_0xf795('0x1a')));},'filename':function(_0x2eeebf,_0x452eaf,_0x581031){_0x581031(null,util['format'](_0xf795('0x1b'),_0xf795('0x26'),path[_0xf795('0x1d')](_0x452eaf['originalname'])));}})});router[_0xf795('0x22')]('/:id/favicon',upload['single'](_0xf795('0x20')),controller[_0xf795('0x27')]);router[_0xf795('0x28')](_0xf795('0xe'),auth[_0xf795('0x9')](),controller[_0xf795('0x29')]);module[_0xf795('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index bcddaad..a7bf04b 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 _0x50cd=['alternate','UNSIGNED','sequelize','INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0x13c7e4,_0x58b9c5){var _0x5652a8=function(_0x3f56a9){while(--_0x3f56a9){_0x13c7e4['push'](_0x13c7e4['shift']());}};_0x5652a8(++_0x58b9c5);}(_0x50cd,0x146));var _0xd50c=function(_0x138387,_0x2a16ac){_0x138387=_0x138387-0x0;var _0x45b15a=_0x50cd[_0x138387];return _0x45b15a;};'use strict';var Sequelize=require(_0xd50c('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xd50c('0x1')](0xb),'unique':_0xd50c('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0xd50c('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xd50c('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xd50c('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xd50c('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xd50c('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xd50c('0x4')]},'turnusername':{'type':Sequelize[_0xd50c('0x4')]},'turnpassword':{'type':Sequelize[_0xd50c('0x4')]},'pageTitle':{'type':Sequelize[_0xd50c('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xd50c('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xd50c('0x4')],'defaultValue':_0xd50c('0x6')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xd50c('0x7')},'chatTimeout':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xd50c('0x4')]},'defaultPreferred':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xd50c('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xd50c('0x4')]},'sentiment':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xd50c('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd50c('0x4')]},'bucket':{'type':Sequelize[_0xd50c('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xd50c('0x1')](0x2)[_0xd50c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xd50c('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xd50c('0x1')](0x2)[_0xd50c('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xd50c('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x9c66=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','BOOLEAN'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x9c66,0x1b1));var _0x69c6=function(_0x385467,_0x298239){_0x385467=_0x385467-0x0;var _0x5ed67e=_0x9c66[_0x385467];return _0x5ed67e;};'use strict';var Sequelize=require(_0x69c6('0x0'));module[_0x69c6('0x1')]={'min_internal':{'type':Sequelize[_0x69c6('0x2')](0xb),'unique':_0x69c6('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x69c6('0x2')](0xb),'unique':_0x69c6('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x69c6('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x69c6('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x69c6('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x69c6('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x69c6('0x5')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x69c6('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x69c6('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x69c6('0x5')],'defaultValue':_0x69c6('0x7')},'enableEmailPreview':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x69c6('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x69c6('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x69c6('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x69c6('0x5')],'defaultValue':_0x69c6('0x8')},'chatTimeout':{'type':Sequelize[_0x69c6('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x69c6('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x69c6('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x69c6('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x69c6('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x69c6('0x5')]},'defaultFavicon':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x69c6('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x69c6('0x5')]},'sentiment':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x69c6('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x69c6('0x5')]},'bucket':{'type':Sequelize[_0x69c6('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x69c6('0x2')](0x2)[_0x69c6('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x69c6('0x2')](0x2)[_0x69c6('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x69c6('0x2')](0x2)[_0x69c6('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x69c6('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x69c6('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x69c6('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x69c6('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x69c6('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x69c6('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x69c6('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x69c6('0x2')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x69c6('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 0061a0b..4595e44 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 _0xf418=['jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','body','find','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','default_logo.svg','default','custom','root','upperFirst','\x20not\x20found','download','getLogoLogin','getLicense','favicon','default_loginLogo.svg','Sequelize','ValidationError','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','default_favicon.ico','utcOffset','format','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x82434e,_0x3af2fb){var _0x24a7a4=function(_0x5ac3d8){while(--_0x5ac3d8){_0x82434e['push'](_0x82434e['shift']());}};_0x24a7a4(++_0x3af2fb);}(_0xf418,0x1e3));var _0x8f41=function(_0x2e8a06,_0x22b27b){_0x2e8a06=_0x2e8a06-0x0;var _0x2fb353=_0xf418[_0x2e8a06];return _0x2fb353;};'use strict';var emlformat=require(_0x8f41('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f41('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f41('0x2'));var moment=require(_0x8f41('0x3'));var BPromise=require(_0x8f41('0x4'));var Mustache=require(_0x8f41('0x5'));var util=require('util');var path=require(_0x8f41('0x6'));var sox=require(_0x8f41('0x7'));var csv=require(_0x8f41('0x8'));var ejs=require(_0x8f41('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f41('0xa'));var squel=require(_0x8f41('0xb'));var crypto=require(_0x8f41('0xc'));var jsforce=require(_0x8f41('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8f41('0xe'));var Redis=require(_0x8f41('0xf'));var authService=require(_0x8f41('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8f41('0x11'));var hardwareService=require(_0x8f41('0x12'));var logger=require(_0x8f41('0x13'))('api');var utils=require(_0x8f41('0x14'));var config=require(_0x8f41('0x15'));var licenseUtil=require(_0x8f41('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x8f41('0x17'));var client=jayson[_0x8f41('0x18')][_0x8f41('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x31578a,_0x1e9fd3,_0x5e5773,_0x4be780){return new BPromise(function(_0x59f81e,_0x54b08f){var _0x2e2ced=_0x4be780||client;return _0x2e2ced[_0x8f41('0x1a')](_0x31578a,_0x5e5773)[_0x8f41('0x1b')](function(_0x26a231){logger['info'](_0x8f41('0x1c'),_0x1e9fd3,_0x8f41('0x1d'));logger[_0x8f41('0x1e')](_0x8f41('0x1f'),_0x1e9fd3,_0x8f41('0x1d'),JSON[_0x8f41('0x20')](_0x26a231));if(_0x26a231[_0x8f41('0x21')]){if(_0x26a231[_0x8f41('0x21')]['code']===0x1f4){logger[_0x8f41('0x21')](_0x8f41('0x1c'),_0x1e9fd3,_0x26a231['error'][_0x8f41('0x22')]);return _0x54b08f(_0x26a231[_0x8f41('0x21')][_0x8f41('0x22')]);}logger['error'](_0x8f41('0x1c'),_0x1e9fd3,_0x26a231[_0x8f41('0x21')][_0x8f41('0x22')]);return _0x59f81e(_0x26a231[_0x8f41('0x21')][_0x8f41('0x22')]);}else{logger[_0x8f41('0x23')](_0x8f41('0x1c'),_0x1e9fd3,_0x8f41('0x1d'));_0x59f81e(_0x26a231[_0x8f41('0x24')]['message']);}})[_0x8f41('0x25')](function(_0xb7970a){logger[_0x8f41('0x21')](_0x8f41('0x1c'),_0x1e9fd3,_0xb7970a);_0x54b08f(_0xb7970a);});});}function respondWithStatusCode(_0x42fc88,_0x597c5f){_0x597c5f=_0x597c5f||0xcc;return function(_0x4c0920){if(_0x4c0920){return _0x42fc88[_0x8f41('0x26')](_0x597c5f);}return _0x42fc88[_0x8f41('0x27')](_0x597c5f)[_0x8f41('0x28')]();};}function respondWithResult(_0x39a9ef,_0x4c0075){_0x4c0075=_0x4c0075||0xc8;return function(_0x5597df){if(_0x5597df){return _0x39a9ef[_0x8f41('0x27')](_0x4c0075)[_0x8f41('0x29')](_0x5597df);}};}function respondWithFilteredResult(_0x275678,_0x2d13fe){return function(_0xe4415a){if(_0xe4415a){var _0x4a5f3f=typeof _0x2d13fe[_0x8f41('0x2a')]===_0x8f41('0x2b')&&typeof _0x2d13fe['limit']===_0x8f41('0x2b');var _0x550b8e=_0xe4415a[_0x8f41('0x2c')];var _0x1c14c6=_0x4a5f3f?0x0:_0x2d13fe[_0x8f41('0x2a')];var _0x280d88=_0x4a5f3f?_0xe4415a[_0x8f41('0x2c')]:_0x2d13fe['offset']+_0x2d13fe[_0x8f41('0x2d')];var _0x4bde2b;if(_0x280d88>=_0x550b8e){_0x280d88=_0x550b8e;_0x4bde2b=0xc8;}else{_0x4bde2b=0xce;}_0x275678[_0x8f41('0x27')](_0x4bde2b);return _0x275678[_0x8f41('0x2e')](_0x8f41('0x2f'),_0x1c14c6+'-'+_0x280d88+'/'+_0x550b8e)[_0x8f41('0x29')](_0xe4415a);}return null;};}function patchUpdates(_0x105bed){return function(_0x22c6ec){try{jsonpatch[_0x8f41('0x30')](_0x22c6ec,_0x105bed,!![]);}catch(_0xb6af76){return BPromise[_0x8f41('0x31')](_0xb6af76);}return _0x22c6ec[_0x8f41('0x32')]();};}function saveUpdates(_0x1f4861,_0x2b674a){return function(_0x3734e5){if(_0x3734e5){return _0x3734e5[_0x8f41('0x33')](_0x1f4861)[_0x8f41('0x1b')](function(_0x416fd2){return _0x416fd2;});}return null;};}function removeEntity(_0x2d5157,_0x25b106){return function(_0x2587ac){if(_0x2587ac){return _0x2587ac[_0x8f41('0x34')]()[_0x8f41('0x1b')](function(){_0x2d5157['status'](0xcc)[_0x8f41('0x28')]();});}};}function handleEntityNotFound(_0x4d11f0,_0x515cf2){return function(_0x58c4b7){if(!_0x58c4b7){_0x4d11f0['sendStatus'](0x194);}return _0x58c4b7;};}function handleError(_0x7e94b2,_0x1d5d1e){_0x1d5d1e=_0x1d5d1e||0x1f4;return function(_0x35ab9c){logger[_0x8f41('0x21')](_0x35ab9c['stack']);if(_0x35ab9c[_0x8f41('0x35')]){delete _0x35ab9c['name'];}_0x7e94b2[_0x8f41('0x27')](_0x1d5d1e)[_0x8f41('0x36')](_0x35ab9c);};}exports['index']=function(_0x496398,_0x2cc1aa){var _0x4f09ca={},_0x156d54={},_0xf748c7={'count':0x0,'rows':[]};var _0x36b6c8=_[_0x8f41('0x37')](db[_0x8f41('0x38')][_0x8f41('0x39')],function(_0x521211){return{'name':_0x521211[_0x8f41('0x3a')],'type':_0x521211[_0x8f41('0x3b')][_0x8f41('0x3c')]};});_0x156d54[_0x8f41('0x3d')]=_['map'](_0x36b6c8,'name');_0x156d54[_0x8f41('0x3e')]=_[_0x8f41('0x3f')](_0x496398['query']);_0x156d54[_0x8f41('0x40')]=_[_0x8f41('0x41')](_0x156d54[_0x8f41('0x3d')],_0x156d54[_0x8f41('0x3e')]);_0x4f09ca[_0x8f41('0x42')]=_[_0x8f41('0x41')](_0x156d54['model'],qs[_0x8f41('0x43')](_0x496398[_0x8f41('0x3e')]['fields']));_0x4f09ca[_0x8f41('0x42')]=_0x4f09ca[_0x8f41('0x42')][_0x8f41('0x44')]?_0x4f09ca['attributes']:_0x156d54[_0x8f41('0x3d')];if(!_0x496398[_0x8f41('0x3e')][_0x8f41('0x45')](_0x8f41('0x46'))){_0x4f09ca[_0x8f41('0x2d')]=qs[_0x8f41('0x2d')](_0x496398[_0x8f41('0x3e')][_0x8f41('0x2d')]);_0x4f09ca[_0x8f41('0x2a')]=qs[_0x8f41('0x2a')](_0x496398[_0x8f41('0x3e')][_0x8f41('0x2a')]);}_0x4f09ca[_0x8f41('0x47')]=qs[_0x8f41('0x48')](_0x496398['query'][_0x8f41('0x48')]);_0x4f09ca[_0x8f41('0x49')]=qs[_0x8f41('0x40')](_[_0x8f41('0x4a')](_0x496398['query'],_0x156d54['filters']),_0x36b6c8);if(_0x496398[_0x8f41('0x3e')][_0x8f41('0x4b')]){_0x4f09ca[_0x8f41('0x49')]=_[_0x8f41('0x4c')](_0x4f09ca[_0x8f41('0x49')],{'$or':_[_0x8f41('0x37')](_0x36b6c8,function(_0x37bd08){if(_0x37bd08[_0x8f41('0x3b')]!==_0x8f41('0x4d')){var _0x36d09b={};_0x36d09b[_0x37bd08[_0x8f41('0x35')]]={'$like':'%'+_0x496398[_0x8f41('0x3e')][_0x8f41('0x4b')]+'%'};return _0x36d09b;}})});}_0x4f09ca=_[_0x8f41('0x4c')]({},_0x4f09ca,_0x496398[_0x8f41('0x4e')]);var _0x134a82={'where':_0x4f09ca['where']};return db[_0x8f41('0x38')][_0x8f41('0x2c')](_0x134a82)[_0x8f41('0x1b')](function(_0x55a3ad){_0xf748c7[_0x8f41('0x2c')]=_0x55a3ad;if(_0x496398[_0x8f41('0x3e')]['includeAll']){_0x4f09ca[_0x8f41('0x4f')]=[{'all':!![]}];}return db[_0x8f41('0x38')][_0x8f41('0x50')](_0x4f09ca);})[_0x8f41('0x1b')](function(_0x1e8a46){_0xf748c7[_0x8f41('0x51')]=_0x1e8a46;return _0xf748c7;})['then'](respondWithFilteredResult(_0x2cc1aa,_0x4f09ca))[_0x8f41('0x25')](handleError(_0x2cc1aa,null));};exports[_0x8f41('0x52')]=function(_0x36592d,_0x25d5a0){var _0x2f1220={'raw':![],'where':{'id':_0x36592d[_0x8f41('0x53')]['id']}},_0x398a45={};_0x398a45['model']=_[_0x8f41('0x3f')](db['Setting']['rawAttributes']);_0x398a45[_0x8f41('0x3e')]=_[_0x8f41('0x3f')](_0x36592d['query']);_0x398a45['filters']=_['intersection'](_0x398a45[_0x8f41('0x3d')],_0x398a45[_0x8f41('0x3e')]);_0x2f1220[_0x8f41('0x42')]=_[_0x8f41('0x41')](_0x398a45[_0x8f41('0x3d')],qs[_0x8f41('0x43')](_0x36592d[_0x8f41('0x3e')]['fields']));_0x2f1220[_0x8f41('0x42')]=_0x2f1220[_0x8f41('0x42')][_0x8f41('0x44')]?_0x2f1220['attributes']:_0x398a45[_0x8f41('0x3d')];if(_0x36592d[_0x8f41('0x3e')][_0x8f41('0x54')]){_0x2f1220[_0x8f41('0x4f')]=[{'all':!![]}];}_0x2f1220=_[_0x8f41('0x4c')]({},_0x2f1220,_0x36592d[_0x8f41('0x4e')]);return db[_0x8f41('0x38')]['find'](_0x2f1220)['then'](handleEntityNotFound(_0x25d5a0,null))[_0x8f41('0x1b')](respondWithResult(_0x25d5a0,null))['catch'](handleError(_0x25d5a0,null));};exports['update']=function(_0x1750d7,_0x43c740){if(_0x1750d7['body']['id']){delete _0x1750d7[_0x8f41('0x55')]['id'];}return db[_0x8f41('0x38')][_0x8f41('0x56')]({'where':{'id':_0x1750d7[_0x8f41('0x53')]['id']}})[_0x8f41('0x1b')](handleEntityNotFound(_0x43c740,null))[_0x8f41('0x1b')](saveUpdates(_0x1750d7['body'],null))['then'](respondWithResult(_0x43c740,null))[_0x8f41('0x25')](handleError(_0x43c740,null));};exports[_0x8f41('0x57')]=function(_0x4f2522,_0x4c631b,_0x44260a){if(_0x4f2522[_0x8f41('0x58')]&&_0x4f2522['file'][_0x8f41('0x59')]){_0x4f2522['body'][_0x8f41('0x5a')]=_0x4f2522['file']['filename'];}return db['Setting'][_0x8f41('0x56')]({'where':{'id':_0x4f2522[_0x8f41('0x53')]['id']}})[_0x8f41('0x1b')](handleEntityNotFound(_0x4c631b,null))[_0x8f41('0x1b')](saveUpdates(_0x4f2522[_0x8f41('0x55')],null))[_0x8f41('0x1b')](respondWithResult(_0x4c631b,null))[_0x8f41('0x25')](handleError(_0x4c631b,null));};exports[_0x8f41('0x5b')]=function(_0x1b34d3,_0x4a9e4e,_0x52d62a){if(_0x1b34d3[_0x8f41('0x58')]&&_0x1b34d3[_0x8f41('0x58')][_0x8f41('0x59')]){_0x1b34d3[_0x8f41('0x55')][_0x8f41('0x5c')]=_0x1b34d3[_0x8f41('0x58')]['filename'];}return db['Setting'][_0x8f41('0x56')]({'where':{'id':_0x1b34d3[_0x8f41('0x53')]['id']}})[_0x8f41('0x1b')](handleEntityNotFound(_0x4a9e4e,null))[_0x8f41('0x1b')](saveUpdates(_0x1b34d3[_0x8f41('0x55')],null))[_0x8f41('0x1b')](respondWithResult(_0x4a9e4e,null))[_0x8f41('0x25')](handleError(_0x4a9e4e,null));};var utilLicense=require(_0x8f41('0x16'));exports[_0x8f41('0x5d')]=function(_0x5eea04,_0x309fa4,_0xe1bb78){var _0x1d2ec4=_0x8f41('0x5e');var _0xac2cd1={'custom':![]};return utilLicense['getLicense']()[_0x8f41('0x1b')](function(_0x128969){if(_0x128969){_0xac2cd1=_0x128969;}return db[_0x8f41('0x38')][_0x8f41('0x56')]({'where':{'id':_0x5eea04[_0x8f41('0x53')]['id']},'attributes':['logo',_0x8f41('0x5c'),_0x8f41('0x5f'),'favicon',_0x8f41('0x60'),_0x8f41('0x61'),_0x8f41('0x62'),_0x8f41('0x63')],'raw':!![]});})[_0x8f41('0x1b')](handleEntityNotFound(_0x309fa4,null))[_0x8f41('0x1b')](function(_0x4f0450){if(_0x4f0450){var _0x403ee5=_0x4f0450[_0x8f41('0x5a')]&&fs[_0x8f41('0x64')](path[_0x8f41('0x65')](config['root'],_0x1d2ec4,_[_0x8f41('0x66')](_0x4f0450[_0x8f41('0x5a')])))?path[_0x8f41('0x65')](config['root'],_0x1d2ec4,_['toLower'](_0x4f0450[_0x8f41('0x5a')])):path[_0x8f41('0x65')](config['root'],_0x1d2ec4,_[_0x8f41('0x66')](_0x8f41('0x67')));var _0x2e6666=_0x8f41('0x68')+_['upperFirst'](_0x8f41('0x5a'));if(_0x4f0450[_0x2e6666]||!_0xac2cd1[_0x8f41('0x69')]){_0x403ee5=path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x1d2ec4,_[_0x8f41('0x66')]('default_logo.svg'));}if(!fs[_0x8f41('0x64')](_0x403ee5)){throw new db['Sequelize']['ValidationError'](_[_0x8f41('0x6b')](_0x8f41('0x5a'))+_0x8f41('0x6c'));}return _0x309fa4[_0x8f41('0x6d')](_0x403ee5);}})[_0x8f41('0x25')](handleError(_0x309fa4,null));};var utilLicense=require(_0x8f41('0x16'));exports[_0x8f41('0x6e')]=function(_0x4822d9,_0xa1553d,_0x302a4b){var _0x2505b2=_0x8f41('0x5e');var _0x2df03c={'custom':![]};return utilLicense[_0x8f41('0x6f')]()[_0x8f41('0x1b')](function(_0x5f864f){if(_0x5f864f){_0x2df03c=_0x5f864f;}return db['Setting']['find']({'where':{'id':_0x4822d9['params']['id']},'attributes':[_0x8f41('0x5a'),_0x8f41('0x5c'),_0x8f41('0x5f'),_0x8f41('0x70'),_0x8f41('0x60'),_0x8f41('0x61'),_0x8f41('0x62'),_0x8f41('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0xa1553d,null))[_0x8f41('0x1b')](function(_0x47599f){if(_0x47599f){var _0x484c34=_0x47599f[_0x8f41('0x5c')]&&fs[_0x8f41('0x64')](path[_0x8f41('0x65')](config['root'],_0x2505b2,_[_0x8f41('0x66')](_0x47599f[_0x8f41('0x5c')])))?path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x2505b2,_[_0x8f41('0x66')](_0x47599f[_0x8f41('0x5c')])):path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x2505b2,_[_0x8f41('0x66')]('default_loginLogo.svg'));var _0x47eb8b='default'+_[_0x8f41('0x6b')](_0x8f41('0x5c'));if(_0x47599f[_0x47eb8b]||!_0x2df03c[_0x8f41('0x69')]){_0x484c34=path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x2505b2,_[_0x8f41('0x66')](_0x8f41('0x71')));}if(!fs[_0x8f41('0x64')](_0x484c34)){throw new db[(_0x8f41('0x72'))][(_0x8f41('0x73'))](_['upperFirst'](_0x8f41('0x5c'))+_0x8f41('0x6c'));}return _0xa1553d[_0x8f41('0x6d')](_0x484c34);}})[_0x8f41('0x25')](handleError(_0xa1553d,null));};exports[_0x8f41('0x74')]=function(_0x2602c9,_0x11bd28){return db[_0x8f41('0x38')]['find']({'where':{'id':_0x2602c9[_0x8f41('0x53')]['id']},'attributes':[_0x8f41('0x75')]})[_0x8f41('0x1b')](respondWithResult(_0x11bd28,null))[_0x8f41('0x25')](handleError(_0x11bd28,null));};exports[_0x8f41('0x76')]=function(_0x3fec5b,_0x4a66b0,_0x4fe8e9){if(_0x3fec5b[_0x8f41('0x58')]&&_0x3fec5b[_0x8f41('0x58')][_0x8f41('0x59')]){_0x3fec5b['body'][_0x8f41('0x5f')]=_0x3fec5b[_0x8f41('0x58')]['filename'];}return db[_0x8f41('0x38')]['find']({'where':{'id':_0x3fec5b[_0x8f41('0x53')]['id']}})[_0x8f41('0x1b')](handleEntityNotFound(_0x4a66b0,null))[_0x8f41('0x1b')](saveUpdates(_0x3fec5b[_0x8f41('0x55')],null))['then'](respondWithResult(_0x4a66b0,null))[_0x8f41('0x25')](handleError(_0x4a66b0,null));};var utilLicense=require(_0x8f41('0x16'));exports[_0x8f41('0x77')]=function(_0x2b64b5,_0x48d514,_0x5d6ef5){var _0x39600a=_0x8f41('0x5e');var _0x15c4f9={'custom':![]};return utilLicense[_0x8f41('0x6f')]()['then'](function(_0x386b95){if(_0x386b95){_0x15c4f9=_0x386b95;}return db[_0x8f41('0x38')][_0x8f41('0x56')]({'where':{'id':_0x2b64b5[_0x8f41('0x53')]['id']},'attributes':[_0x8f41('0x5a'),_0x8f41('0x5c'),_0x8f41('0x5f'),_0x8f41('0x70'),_0x8f41('0x60'),_0x8f41('0x61'),'defaultPreferred',_0x8f41('0x63')],'raw':!![]});})[_0x8f41('0x1b')](handleEntityNotFound(_0x48d514,null))[_0x8f41('0x1b')](function(_0x3cc26e){if(_0x3cc26e){var _0x1de8e2=_0x3cc26e[_0x8f41('0x5f')]&&fs[_0x8f41('0x64')](path[_0x8f41('0x65')](config['root'],_0x39600a,_[_0x8f41('0x66')](_0x3cc26e[_0x8f41('0x5f')])))?path[_0x8f41('0x65')](config['root'],_0x39600a,_[_0x8f41('0x66')](_0x3cc26e[_0x8f41('0x5f')])):path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x39600a,_[_0x8f41('0x66')]('default_preferred.png'));var _0x299ae8=_0x8f41('0x68')+_[_0x8f41('0x6b')](_0x8f41('0x5f'));if(_0x3cc26e[_0x299ae8]||!_0x15c4f9[_0x8f41('0x69')]||!_0x15c4f9[_0x8f41('0x5f')]){_0x1de8e2=path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x39600a,_[_0x8f41('0x66')](_0x8f41('0x78')));}if(!fs['existsSync'](_0x1de8e2)){throw new db['Sequelize']['ValidationError'](_[_0x8f41('0x6b')](_0x8f41('0x5f'))+_0x8f41('0x6c'));}return _0x48d514['download'](_0x1de8e2);}})[_0x8f41('0x25')](handleError(_0x48d514,null));};exports['addFavicon']=function(_0x2af5c1,_0x33fd4f,_0x4ae924){if(_0x2af5c1[_0x8f41('0x58')]&&_0x2af5c1[_0x8f41('0x58')][_0x8f41('0x59')]){_0x2af5c1[_0x8f41('0x55')][_0x8f41('0x70')]=_0x2af5c1['file'][_0x8f41('0x59')];}return db[_0x8f41('0x38')][_0x8f41('0x56')]({'where':{'id':_0x2af5c1[_0x8f41('0x53')]['id']}})[_0x8f41('0x1b')](handleEntityNotFound(_0x33fd4f,null))[_0x8f41('0x1b')](saveUpdates(_0x2af5c1['body'],null))[_0x8f41('0x1b')](respondWithResult(_0x33fd4f,null))['catch'](handleError(_0x33fd4f,null));};var utilLicense=require(_0x8f41('0x16'));exports['getFavicon']=function(_0x9bbfe,_0x40ad22,_0x59808){var _0x286d71=_0x8f41('0x5e');var _0x248a4d={'custom':![]};return utilLicense[_0x8f41('0x6f')]()['then'](function(_0x523853){if(_0x523853){_0x248a4d=_0x523853;}return db['Setting']['find']({'where':{'id':_0x9bbfe[_0x8f41('0x53')]['id']},'attributes':[_0x8f41('0x5a'),_0x8f41('0x5c'),_0x8f41('0x5f'),'favicon',_0x8f41('0x60'),_0x8f41('0x61'),'defaultPreferred',_0x8f41('0x63')],'raw':!![]});})[_0x8f41('0x1b')](handleEntityNotFound(_0x40ad22,null))[_0x8f41('0x1b')](function(_0xada734){if(_0xada734){var _0x75c661=_0xada734[_0x8f41('0x70')]&&fs[_0x8f41('0x64')](path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x286d71,_['toLower'](_0xada734[_0x8f41('0x70')])))?path['join'](config['root'],_0x286d71,_[_0x8f41('0x66')](_0xada734[_0x8f41('0x70')])):path[_0x8f41('0x65')](config['root'],_0x286d71,_['toLower'](_0x8f41('0x79')));var _0x499450=_0x8f41('0x68')+_[_0x8f41('0x6b')]('favicon');if(_0xada734[_0x499450]||!_0x248a4d['custom']){_0x75c661=path[_0x8f41('0x65')](config['root'],_0x286d71,_[_0x8f41('0x66')](_0x8f41('0x79')));}if(!fs[_0x8f41('0x64')](_0x75c661)){throw new db[(_0x8f41('0x72'))]['ValidationError'](_[_0x8f41('0x6b')](_0x8f41('0x70'))+_0x8f41('0x6c'));}return _0x40ad22[_0x8f41('0x6d')](_0x75c661);}})[_0x8f41('0x25')](handleError(_0x40ad22,null));};exports['getDate']=function(_0x3a2901,_0x239ef8){var _0x3f5ded={'offset':moment()[_0x8f41('0x7a')]()};_0x3f5ded['now']=moment()[_0x8f41('0x7a')](_0x3f5ded[_0x8f41('0x2a')])[_0x8f41('0x7b')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x239ef8[_0x8f41('0x27')](0xc8)['send'](_0x3f5ded);}; \ No newline at end of file +var _0x8fcd=['save','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','params','keys','fields','includeAll','find','update','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','defaultLogo','defaultFavicon','join','root','toLower','default_logo.svg','default','custom','existsSync','Sequelize','upperFirst','\x20not\x20found','download','getLogoLogin','preferred','favicon','defaultPreferred','default_loginLogo.svg','ValidationError','gdpr','securePassword','addPreferred','getPreferred','defaultLoginLogo','default_preferred.png','addFavicon','getFavicon','utcOffset','now','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x271275,_0x3b51cd){var _0xe41c9d=function(_0x85f5a){while(--_0x85f5a){_0x271275['push'](_0x271275['shift']());}};_0xe41c9d(++_0x3b51cd);}(_0x8fcd,0x13d));var _0xd8fc=function(_0x18be17,_0x578282){_0x18be17=_0x18be17-0x0;var _0x18c0ff=_0x8fcd[_0x18be17];return _0x18c0ff;};'use strict';var emlformat=require(_0xd8fc('0x0'));var rimraf=require(_0xd8fc('0x1'));var zipdir=require(_0xd8fc('0x2'));var jsonpatch=require(_0xd8fc('0x3'));var rp=require(_0xd8fc('0x4'));var moment=require(_0xd8fc('0x5'));var BPromise=require(_0xd8fc('0x6'));var Mustache=require(_0xd8fc('0x7'));var util=require(_0xd8fc('0x8'));var path=require('path');var sox=require(_0xd8fc('0x9'));var csv=require('to-csv');var ejs=require(_0xd8fc('0xa'));var fs=require('fs');var fs_extra=require(_0xd8fc('0xb'));var _=require(_0xd8fc('0xc'));var squel=require(_0xd8fc('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd8fc('0xe'));var toCsv=require(_0xd8fc('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd8fc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd8fc('0x12'));var logger=require(_0xd8fc('0x13'))(_0xd8fc('0x14'));var utils=require(_0xd8fc('0x15'));var config=require(_0xd8fc('0x16'));var licenseUtil=require(_0xd8fc('0x17'));var db=require(_0xd8fc('0x18'))['db'];var jayson=require(_0xd8fc('0x19'));var client=jayson[_0xd8fc('0x1a')][_0xd8fc('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x21c4f8,_0x5770b5,_0x5372e6,_0x96f744){return new BPromise(function(_0x4f95db,_0x56b077){var _0x4c94b0=_0x96f744||client;return _0x4c94b0['request'](_0x21c4f8,_0x5372e6)[_0xd8fc('0x1c')](function(_0x418314){logger['info'](_0xd8fc('0x1d'),_0x5770b5,_0xd8fc('0x1e'));logger[_0xd8fc('0x1f')](_0xd8fc('0x20'),_0x5770b5,_0xd8fc('0x1e'),JSON[_0xd8fc('0x21')](_0x418314));if(_0x418314[_0xd8fc('0x22')]){if(_0x418314[_0xd8fc('0x22')][_0xd8fc('0x23')]===0x1f4){logger[_0xd8fc('0x22')](_0xd8fc('0x1d'),_0x5770b5,_0x418314[_0xd8fc('0x22')][_0xd8fc('0x24')]);return _0x56b077(_0x418314['error'][_0xd8fc('0x24')]);}logger['error'](_0xd8fc('0x1d'),_0x5770b5,_0x418314[_0xd8fc('0x22')][_0xd8fc('0x24')]);return _0x4f95db(_0x418314[_0xd8fc('0x22')]['message']);}else{logger[_0xd8fc('0x25')](_0xd8fc('0x1d'),_0x5770b5,_0xd8fc('0x1e'));_0x4f95db(_0x418314[_0xd8fc('0x26')][_0xd8fc('0x24')]);}})[_0xd8fc('0x27')](function(_0x35a875){logger[_0xd8fc('0x22')](_0xd8fc('0x1d'),_0x5770b5,_0x35a875);_0x56b077(_0x35a875);});});}function respondWithStatusCode(_0x1270f1,_0x194010){_0x194010=_0x194010||0xcc;return function(_0x5bc2e8){if(_0x5bc2e8){return _0x1270f1[_0xd8fc('0x28')](_0x194010);}return _0x1270f1['status'](_0x194010)[_0xd8fc('0x29')]();};}function respondWithResult(_0x3683eb,_0x4ba87f){_0x4ba87f=_0x4ba87f||0xc8;return function(_0x1801d3){if(_0x1801d3){return _0x3683eb[_0xd8fc('0x2a')](_0x4ba87f)[_0xd8fc('0x2b')](_0x1801d3);}};}function respondWithFilteredResult(_0x3c2008,_0x538731){return function(_0x573406){if(_0x573406){var _0x3eaf61=typeof _0x538731[_0xd8fc('0x2c')]===_0xd8fc('0x2d')&&typeof _0x538731['limit']===_0xd8fc('0x2d');var _0x1c3d15=_0x573406[_0xd8fc('0x2e')];var _0x5adf2d=_0x3eaf61?0x0:_0x538731[_0xd8fc('0x2c')];var _0x4e9feb=_0x3eaf61?_0x573406[_0xd8fc('0x2e')]:_0x538731[_0xd8fc('0x2c')]+_0x538731[_0xd8fc('0x2f')];var _0x5ef6e9;if(_0x4e9feb>=_0x1c3d15){_0x4e9feb=_0x1c3d15;_0x5ef6e9=0xc8;}else{_0x5ef6e9=0xce;}_0x3c2008[_0xd8fc('0x2a')](_0x5ef6e9);return _0x3c2008[_0xd8fc('0x30')](_0xd8fc('0x31'),_0x5adf2d+'-'+_0x4e9feb+'/'+_0x1c3d15)[_0xd8fc('0x2b')](_0x573406);}return null;};}function patchUpdates(_0x44406b){return function(_0x2a14c2){try{jsonpatch[_0xd8fc('0x32')](_0x2a14c2,_0x44406b,!![]);}catch(_0x33e429){return BPromise[_0xd8fc('0x33')](_0x33e429);}return _0x2a14c2[_0xd8fc('0x34')]();};}function saveUpdates(_0x1fbfb3,_0x2373c6){return function(_0x1e3210){if(_0x1e3210){return _0x1e3210['update'](_0x1fbfb3)[_0xd8fc('0x1c')](function(_0x5c345a){return _0x5c345a;});}return null;};}function removeEntity(_0x2e7432,_0x40aba5){return function(_0x2940c1){if(_0x2940c1){return _0x2940c1['destroy']()[_0xd8fc('0x1c')](function(){_0x2e7432[_0xd8fc('0x2a')](0xcc)[_0xd8fc('0x29')]();});}};}function handleEntityNotFound(_0x351f67,_0x160829){return function(_0x55cc7f){if(!_0x55cc7f){_0x351f67[_0xd8fc('0x28')](0x194);}return _0x55cc7f;};}function handleError(_0x304e9d,_0x3db026){_0x3db026=_0x3db026||0x1f4;return function(_0x3d573d){logger[_0xd8fc('0x22')](_0x3d573d[_0xd8fc('0x35')]);if(_0x3d573d['name']){delete _0x3d573d[_0xd8fc('0x36')];}_0x304e9d[_0xd8fc('0x2a')](_0x3db026)[_0xd8fc('0x37')](_0x3d573d);};}exports[_0xd8fc('0x38')]=function(_0x12c746,_0x7ca29e){var _0x59fe38={},_0x843af9={},_0x2b9f9c={'count':0x0,'rows':[]};var _0x60e734=_[_0xd8fc('0x39')](db[_0xd8fc('0x3a')][_0xd8fc('0x3b')],function(_0x3c8f86){return{'name':_0x3c8f86[_0xd8fc('0x3c')],'type':_0x3c8f86[_0xd8fc('0x3d')]['key']};});_0x843af9[_0xd8fc('0x3e')]=_['map'](_0x60e734,_0xd8fc('0x36'));_0x843af9[_0xd8fc('0x3f')]=_['keys'](_0x12c746[_0xd8fc('0x3f')]);_0x843af9[_0xd8fc('0x40')]=_[_0xd8fc('0x41')](_0x843af9['model'],_0x843af9[_0xd8fc('0x3f')]);_0x59fe38[_0xd8fc('0x42')]=_[_0xd8fc('0x41')](_0x843af9[_0xd8fc('0x3e')],qs['fields'](_0x12c746[_0xd8fc('0x3f')]['fields']));_0x59fe38['attributes']=_0x59fe38['attributes']['length']?_0x59fe38[_0xd8fc('0x42')]:_0x843af9[_0xd8fc('0x3e')];if(!_0x12c746[_0xd8fc('0x3f')]['hasOwnProperty']('nolimit')){_0x59fe38[_0xd8fc('0x2f')]=qs[_0xd8fc('0x2f')](_0x12c746[_0xd8fc('0x3f')][_0xd8fc('0x2f')]);_0x59fe38[_0xd8fc('0x2c')]=qs['offset'](_0x12c746[_0xd8fc('0x3f')][_0xd8fc('0x2c')]);}_0x59fe38[_0xd8fc('0x43')]=qs[_0xd8fc('0x44')](_0x12c746[_0xd8fc('0x3f')][_0xd8fc('0x44')]);_0x59fe38['where']=qs[_0xd8fc('0x40')](_[_0xd8fc('0x45')](_0x12c746[_0xd8fc('0x3f')],_0x843af9[_0xd8fc('0x40')]),_0x60e734);if(_0x12c746[_0xd8fc('0x3f')][_0xd8fc('0x46')]){_0x59fe38[_0xd8fc('0x47')]=_[_0xd8fc('0x48')](_0x59fe38[_0xd8fc('0x47')],{'$or':_[_0xd8fc('0x39')](_0x60e734,function(_0x415f63){if(_0x415f63[_0xd8fc('0x3d')]!==_0xd8fc('0x49')){var _0x45299f={};_0x45299f[_0x415f63['name']]={'$like':'%'+_0x12c746[_0xd8fc('0x3f')][_0xd8fc('0x46')]+'%'};return _0x45299f;}})});}_0x59fe38=_[_0xd8fc('0x48')]({},_0x59fe38,_0x12c746[_0xd8fc('0x4a')]);var _0x2dcc43={'where':_0x59fe38[_0xd8fc('0x47')]};return db[_0xd8fc('0x3a')]['count'](_0x2dcc43)['then'](function(_0x223b64){_0x2b9f9c[_0xd8fc('0x2e')]=_0x223b64;if(_0x12c746[_0xd8fc('0x3f')]['includeAll']){_0x59fe38[_0xd8fc('0x4b')]=[{'all':!![]}];}return db[_0xd8fc('0x3a')]['findAll'](_0x59fe38);})[_0xd8fc('0x1c')](function(_0x453d9f){_0x2b9f9c[_0xd8fc('0x4c')]=_0x453d9f;return _0x2b9f9c;})['then'](respondWithFilteredResult(_0x7ca29e,_0x59fe38))[_0xd8fc('0x27')](handleError(_0x7ca29e,null));};exports['show']=function(_0x589369,_0xd9dc5e){var _0x273190={'raw':![],'where':{'id':_0x589369[_0xd8fc('0x4d')]['id']}},_0x1dfbbc={};_0x1dfbbc[_0xd8fc('0x3e')]=_[_0xd8fc('0x4e')](db['Setting']['rawAttributes']);_0x1dfbbc[_0xd8fc('0x3f')]=_['keys'](_0x589369[_0xd8fc('0x3f')]);_0x1dfbbc[_0xd8fc('0x40')]=_[_0xd8fc('0x41')](_0x1dfbbc[_0xd8fc('0x3e')],_0x1dfbbc['query']);_0x273190[_0xd8fc('0x42')]=_[_0xd8fc('0x41')](_0x1dfbbc[_0xd8fc('0x3e')],qs['fields'](_0x589369['query'][_0xd8fc('0x4f')]));_0x273190['attributes']=_0x273190[_0xd8fc('0x42')]['length']?_0x273190['attributes']:_0x1dfbbc[_0xd8fc('0x3e')];if(_0x589369[_0xd8fc('0x3f')][_0xd8fc('0x50')]){_0x273190[_0xd8fc('0x4b')]=[{'all':!![]}];}_0x273190=_['merge']({},_0x273190,_0x589369[_0xd8fc('0x4a')]);return db[_0xd8fc('0x3a')][_0xd8fc('0x51')](_0x273190)[_0xd8fc('0x1c')](handleEntityNotFound(_0xd9dc5e,null))[_0xd8fc('0x1c')](respondWithResult(_0xd9dc5e,null))[_0xd8fc('0x27')](handleError(_0xd9dc5e,null));};exports[_0xd8fc('0x52')]=function(_0x211bff,_0x14dbbe){if(_0x211bff[_0xd8fc('0x53')]['id']){delete _0x211bff['body']['id'];}return db[_0xd8fc('0x3a')][_0xd8fc('0x51')]({'where':{'id':_0x211bff[_0xd8fc('0x4d')]['id']}})[_0xd8fc('0x1c')](handleEntityNotFound(_0x14dbbe,null))[_0xd8fc('0x1c')](saveUpdates(_0x211bff['body'],null))[_0xd8fc('0x1c')](respondWithResult(_0x14dbbe,null))[_0xd8fc('0x27')](handleError(_0x14dbbe,null));};exports[_0xd8fc('0x54')]=function(_0x5c41dc,_0x303f40,_0x5ca475){if(_0x5c41dc['file']&&_0x5c41dc[_0xd8fc('0x55')][_0xd8fc('0x56')]){_0x5c41dc['body'][_0xd8fc('0x57')]=_0x5c41dc[_0xd8fc('0x55')][_0xd8fc('0x56')];}return db[_0xd8fc('0x3a')]['find']({'where':{'id':_0x5c41dc[_0xd8fc('0x4d')]['id']}})[_0xd8fc('0x1c')](handleEntityNotFound(_0x303f40,null))[_0xd8fc('0x1c')](saveUpdates(_0x5c41dc[_0xd8fc('0x53')],null))[_0xd8fc('0x1c')](respondWithResult(_0x303f40,null))[_0xd8fc('0x27')](handleError(_0x303f40,null));};exports[_0xd8fc('0x58')]=function(_0x187072,_0x27986f,_0x5e127e){if(_0x187072[_0xd8fc('0x55')]&&_0x187072[_0xd8fc('0x55')][_0xd8fc('0x56')]){_0x187072['body'][_0xd8fc('0x59')]=_0x187072[_0xd8fc('0x55')]['filename'];}return db[_0xd8fc('0x3a')][_0xd8fc('0x51')]({'where':{'id':_0x187072[_0xd8fc('0x4d')]['id']}})[_0xd8fc('0x1c')](handleEntityNotFound(_0x27986f,null))[_0xd8fc('0x1c')](saveUpdates(_0x187072[_0xd8fc('0x53')],null))[_0xd8fc('0x1c')](respondWithResult(_0x27986f,null))[_0xd8fc('0x27')](handleError(_0x27986f,null));};var utilLicense=require(_0xd8fc('0x17'));exports[_0xd8fc('0x5a')]=function(_0x23f68a,_0x220656,_0x50e52a){var _0x2dc0fb=_0xd8fc('0x5b');var _0xc62c5d={'custom':![]};return utilLicense[_0xd8fc('0x5c')]()[_0xd8fc('0x1c')](function(_0x333d78){if(_0x333d78){_0xc62c5d=_0x333d78;}return db['Setting']['find']({'where':{'id':_0x23f68a[_0xd8fc('0x4d')]['id']},'attributes':[_0xd8fc('0x57'),'loginLogo','preferred','favicon',_0xd8fc('0x5d'),'defaultLoginLogo','defaultPreferred',_0xd8fc('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x220656,null))['then'](function(_0x204d60){if(_0x204d60){var _0x339338=_0x204d60['logo']&&fs['existsSync'](path[_0xd8fc('0x5f')](config[_0xd8fc('0x60')],_0x2dc0fb,_[_0xd8fc('0x61')](_0x204d60[_0xd8fc('0x57')])))?path[_0xd8fc('0x5f')](config['root'],_0x2dc0fb,_[_0xd8fc('0x61')](_0x204d60[_0xd8fc('0x57')])):path[_0xd8fc('0x5f')](config[_0xd8fc('0x60')],_0x2dc0fb,_[_0xd8fc('0x61')](_0xd8fc('0x62')));var _0x4d9073=_0xd8fc('0x63')+_['upperFirst'](_0xd8fc('0x57'));if(_0x204d60[_0x4d9073]||!_0xc62c5d[_0xd8fc('0x64')]){_0x339338=path[_0xd8fc('0x5f')](config[_0xd8fc('0x60')],_0x2dc0fb,_['toLower'](_0xd8fc('0x62')));}if(!fs[_0xd8fc('0x65')](_0x339338)){throw new db[(_0xd8fc('0x66'))]['ValidationError'](_[_0xd8fc('0x67')](_0xd8fc('0x57'))+_0xd8fc('0x68'));}return _0x220656[_0xd8fc('0x69')](_0x339338);}})[_0xd8fc('0x27')](handleError(_0x220656,null));};var utilLicense=require(_0xd8fc('0x17'));exports[_0xd8fc('0x6a')]=function(_0x16c6ad,_0x2d0394,_0x4420af){var _0x550435='server/files/images/logos';var _0x777230={'custom':![]};return utilLicense[_0xd8fc('0x5c')]()[_0xd8fc('0x1c')](function(_0x5adc5b){if(_0x5adc5b){_0x777230=_0x5adc5b;}return db[_0xd8fc('0x3a')]['find']({'where':{'id':_0x16c6ad[_0xd8fc('0x4d')]['id']},'attributes':[_0xd8fc('0x57'),'loginLogo',_0xd8fc('0x6b'),_0xd8fc('0x6c'),_0xd8fc('0x5d'),'defaultLoginLogo',_0xd8fc('0x6d'),_0xd8fc('0x5e')],'raw':!![]});})[_0xd8fc('0x1c')](handleEntityNotFound(_0x2d0394,null))[_0xd8fc('0x1c')](function(_0xa2c8cf){if(_0xa2c8cf){var _0x11f6fc=_0xa2c8cf['loginLogo']&&fs[_0xd8fc('0x65')](path[_0xd8fc('0x5f')](config[_0xd8fc('0x60')],_0x550435,_[_0xd8fc('0x61')](_0xa2c8cf['loginLogo'])))?path[_0xd8fc('0x5f')](config[_0xd8fc('0x60')],_0x550435,_[_0xd8fc('0x61')](_0xa2c8cf[_0xd8fc('0x59')])):path['join'](config['root'],_0x550435,_[_0xd8fc('0x61')](_0xd8fc('0x6e')));var _0x3995f9=_0xd8fc('0x63')+_[_0xd8fc('0x67')](_0xd8fc('0x59'));if(_0xa2c8cf[_0x3995f9]||!_0x777230[_0xd8fc('0x64')]){_0x11f6fc=path[_0xd8fc('0x5f')](config[_0xd8fc('0x60')],_0x550435,_['toLower'](_0xd8fc('0x6e')));}if(!fs[_0xd8fc('0x65')](_0x11f6fc)){throw new db['Sequelize'][(_0xd8fc('0x6f'))](_[_0xd8fc('0x67')](_0xd8fc('0x59'))+_0xd8fc('0x68'));}return _0x2d0394[_0xd8fc('0x69')](_0x11f6fc);}})[_0xd8fc('0x27')](handleError(_0x2d0394,null));};exports[_0xd8fc('0x70')]=function(_0x25ef47,_0x28be7b){return db['Setting'][_0xd8fc('0x51')]({'where':{'id':_0x25ef47[_0xd8fc('0x4d')]['id']},'attributes':[_0xd8fc('0x71')]})[_0xd8fc('0x1c')](respondWithResult(_0x28be7b,null))[_0xd8fc('0x27')](handleError(_0x28be7b,null));};exports[_0xd8fc('0x72')]=function(_0x38a96a,_0x20b8ca,_0xb56eb4){if(_0x38a96a['file']&&_0x38a96a['file'][_0xd8fc('0x56')]){_0x38a96a[_0xd8fc('0x53')]['preferred']=_0x38a96a['file']['filename'];}return db['Setting']['find']({'where':{'id':_0x38a96a['params']['id']}})['then'](handleEntityNotFound(_0x20b8ca,null))[_0xd8fc('0x1c')](saveUpdates(_0x38a96a['body'],null))[_0xd8fc('0x1c')](respondWithResult(_0x20b8ca,null))[_0xd8fc('0x27')](handleError(_0x20b8ca,null));};var utilLicense=require(_0xd8fc('0x17'));exports[_0xd8fc('0x73')]=function(_0x33777d,_0xa7e023,_0x48c6f6){var _0x10f230=_0xd8fc('0x5b');var _0x1da830={'custom':![]};return utilLicense['getLicense']()[_0xd8fc('0x1c')](function(_0xee5562){if(_0xee5562){_0x1da830=_0xee5562;}return db[_0xd8fc('0x3a')]['find']({'where':{'id':_0x33777d[_0xd8fc('0x4d')]['id']},'attributes':[_0xd8fc('0x57'),'loginLogo',_0xd8fc('0x6b'),'favicon',_0xd8fc('0x5d'),_0xd8fc('0x74'),_0xd8fc('0x6d'),_0xd8fc('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0xa7e023,null))['then'](function(_0x171448){if(_0x171448){var _0x512ef8=_0x171448['preferred']&&fs[_0xd8fc('0x65')](path[_0xd8fc('0x5f')](config[_0xd8fc('0x60')],_0x10f230,_[_0xd8fc('0x61')](_0x171448[_0xd8fc('0x6b')])))?path[_0xd8fc('0x5f')](config[_0xd8fc('0x60')],_0x10f230,_[_0xd8fc('0x61')](_0x171448['preferred'])):path['join'](config[_0xd8fc('0x60')],_0x10f230,_[_0xd8fc('0x61')](_0xd8fc('0x75')));var _0x94ad75=_0xd8fc('0x63')+_['upperFirst'](_0xd8fc('0x6b'));if(_0x171448[_0x94ad75]||!_0x1da830[_0xd8fc('0x64')]||!_0x1da830['preferred']){_0x512ef8=path['join'](config[_0xd8fc('0x60')],_0x10f230,_[_0xd8fc('0x61')]('default_preferred.png'));}if(!fs[_0xd8fc('0x65')](_0x512ef8)){throw new db['Sequelize']['ValidationError'](_['upperFirst']('preferred')+_0xd8fc('0x68'));}return _0xa7e023['download'](_0x512ef8);}})[_0xd8fc('0x27')](handleError(_0xa7e023,null));};exports[_0xd8fc('0x76')]=function(_0x1a95a3,_0x21764a,_0x516325){if(_0x1a95a3[_0xd8fc('0x55')]&&_0x1a95a3[_0xd8fc('0x55')]['filename']){_0x1a95a3[_0xd8fc('0x53')]['favicon']=_0x1a95a3[_0xd8fc('0x55')][_0xd8fc('0x56')];}return db[_0xd8fc('0x3a')][_0xd8fc('0x51')]({'where':{'id':_0x1a95a3[_0xd8fc('0x4d')]['id']}})[_0xd8fc('0x1c')](handleEntityNotFound(_0x21764a,null))[_0xd8fc('0x1c')](saveUpdates(_0x1a95a3[_0xd8fc('0x53')],null))[_0xd8fc('0x1c')](respondWithResult(_0x21764a,null))['catch'](handleError(_0x21764a,null));};var utilLicense=require(_0xd8fc('0x17'));exports[_0xd8fc('0x77')]=function(_0x20de0b,_0x1081ae,_0x20df24){var _0x4cc246='server/files/images/logos';var _0x10ed9a={'custom':![]};return utilLicense['getLicense']()[_0xd8fc('0x1c')](function(_0x55dce8){if(_0x55dce8){_0x10ed9a=_0x55dce8;}return db[_0xd8fc('0x3a')][_0xd8fc('0x51')]({'where':{'id':_0x20de0b['params']['id']},'attributes':[_0xd8fc('0x57'),_0xd8fc('0x59'),_0xd8fc('0x6b'),'favicon',_0xd8fc('0x5d'),_0xd8fc('0x74'),_0xd8fc('0x6d'),_0xd8fc('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x1081ae,null))['then'](function(_0x1a8061){if(_0x1a8061){var _0x2caf69=_0x1a8061[_0xd8fc('0x6c')]&&fs[_0xd8fc('0x65')](path[_0xd8fc('0x5f')](config[_0xd8fc('0x60')],_0x4cc246,_[_0xd8fc('0x61')](_0x1a8061[_0xd8fc('0x6c')])))?path[_0xd8fc('0x5f')](config['root'],_0x4cc246,_['toLower'](_0x1a8061[_0xd8fc('0x6c')])):path['join'](config[_0xd8fc('0x60')],_0x4cc246,_[_0xd8fc('0x61')]('default_favicon.ico'));var _0x51d554=_0xd8fc('0x63')+_[_0xd8fc('0x67')](_0xd8fc('0x6c'));if(_0x1a8061[_0x51d554]||!_0x10ed9a[_0xd8fc('0x64')]){_0x2caf69=path[_0xd8fc('0x5f')](config[_0xd8fc('0x60')],_0x4cc246,_['toLower']('default_favicon.ico'));}if(!fs['existsSync'](_0x2caf69)){throw new db[(_0xd8fc('0x66'))][(_0xd8fc('0x6f'))](_[_0xd8fc('0x67')](_0xd8fc('0x6c'))+'\x20not\x20found');}return _0x1081ae['download'](_0x2caf69);}})['catch'](handleError(_0x1081ae,null));};exports['getDate']=function(_0x49fe13,_0x417448){var _0x2ecc1f={'offset':moment()[_0xd8fc('0x78')]()};_0x2ecc1f[_0xd8fc('0x79')]=moment()[_0xd8fc('0x78')](_0x2ecc1f['offset'])[_0xd8fc('0x7a')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x417448[_0xd8fc('0x2a')](0xc8)[_0xd8fc('0x37')](_0x2ecc1f);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 4b15ae0..2a4a66c 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x3e74,0x175));var _0x43e7=function(_0x4a2f3a,_0x56cf1d){_0x4a2f3a=_0x4a2f3a-0x0;var _0x1608c6=_0x3e74[_0x4a2f3a];return _0x1608c6;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0x008c,0x188));var _0xc008=function(_0x512661,_0x4b4012){_0x512661=_0x512661-0x0;var _0x1debde=_0x008c[_0x512661];return _0x1debde;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'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 2609aa0..852e7bb 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 _0x156f=['http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSetting','find','options','raw','attributes','include','model','map','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1e247a,_0x25bafb){var _0x582c37=function(_0x392e7d){while(--_0x392e7d){_0x1e247a['push'](_0x1e247a['shift']());}};_0x582c37(++_0x25bafb);}(_0x156f,0x95));var _0xf156=function(_0x476322,_0x4ef7de){_0x476322=_0x476322-0x0;var _0x35e35f=_0x156f[_0x476322];return _0x35e35f;};'use strict';var _=require(_0xf156('0x0'));var util=require(_0xf156('0x1'));var moment=require(_0xf156('0x2'));var BPromise=require(_0xf156('0x3'));var rs=require(_0xf156('0x4'));var fs=require('fs');var Redis=require(_0xf156('0x5'));var db=require(_0xf156('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf156('0x7'))(_0xf156('0x8'));var config=require(_0xf156('0x9'));var jayson=require(_0xf156('0xa'));var client=jayson['client'][_0xf156('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa4aa32,_0x363f16,_0x1fad59){return new BPromise(function(_0x794f64,_0x388411){return client[_0xf156('0xc')](_0xa4aa32,_0x1fad59)[_0xf156('0xd')](function(_0x1fb008){logger[_0xf156('0xe')](_0xf156('0xf'),_0x363f16,_0xf156('0x10'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x363f16,_0xf156('0x10'),JSON[_0xf156('0x11')](_0x1fb008));if(_0x1fb008[_0xf156('0x12')]){if(_0x1fb008[_0xf156('0x12')][_0xf156('0x13')]===0x1f4){logger[_0xf156('0x12')](_0xf156('0xf'),_0x363f16,_0x1fb008[_0xf156('0x12')]['message']);return _0x388411(_0x1fb008['error'][_0xf156('0x14')]);}logger[_0xf156('0x12')](_0xf156('0xf'),_0x363f16,_0x1fb008[_0xf156('0x12')][_0xf156('0x14')]);return _0x794f64(_0x1fb008[_0xf156('0x12')][_0xf156('0x14')]);}else{logger[_0xf156('0xe')](_0xf156('0xf'),_0x363f16,_0xf156('0x10'));_0x794f64(_0x1fb008[_0xf156('0x15')][_0xf156('0x14')]);}})[_0xf156('0x16')](function(_0x424a3c){logger['error'](_0xf156('0xf'),_0x363f16,_0x424a3c);_0x388411(_0x424a3c);});});}exports[_0xf156('0x17')]=function(_0x16738e){var _0x3f7a48=this;return new Promise(function(_0x3ef41b,_0x19e268){return db['Setting'][_0xf156('0x18')]({'raw':_0x16738e[_0xf156('0x19')]?_0x16738e[_0xf156('0x19')][_0xf156('0x1a')]===undefined?!![]:![]:!![],'where':_0x16738e[_0xf156('0x19')]?_0x16738e['options']['where']||null:null,'attributes':_0x16738e[_0xf156('0x19')]?_0x16738e['options'][_0xf156('0x1b')]||null:null,'include':_0x16738e[_0xf156('0x19')]?_0x16738e[_0xf156('0x19')][_0xf156('0x1c')]?_['map'](_0x16738e['options']['include'],function(_0x44470f){return{'model':db[_0x44470f[_0xf156('0x1d')]],'as':_0x44470f['as'],'attributes':_0x44470f[_0xf156('0x1b')],'include':_0x44470f[_0xf156('0x1c')]?_[_0xf156('0x1e')](_0x44470f['include'],function(_0x596442){return{'model':db[_0x596442[_0xf156('0x1d')]],'as':_0x596442['as'],'attributes':_0x596442[_0xf156('0x1b')],'include':_0x596442[_0xf156('0x1c')]?_[_0xf156('0x1e')](_0x596442[_0xf156('0x1c')],function(_0x80b383){return{'model':db[_0x80b383['model']],'as':_0x80b383['as'],'attributes':_0x80b383[_0xf156('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e0831){logger[_0xf156('0xe')](_0xf156('0x17'),_0x16738e);logger[_0xf156('0x1f')]('ShowSetting',_0x16738e,JSON[_0xf156('0x11')](_0x2e0831));_0x3ef41b(_0x2e0831);})['catch'](function(_0x26a3c6){logger[_0xf156('0x12')](_0xf156('0x17'),_0x26a3c6[_0xf156('0x14')],_0x16738e);_0x19e268(_0x3f7a48['error'](0x1f4,_0x26a3c6[_0xf156('0x14')]));});});}; \ No newline at end of file +var _0x0b77=['ioredis','../../mysqldb','../../config/utils','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','message','catch','Setting','find','options','raw','attributes','include','map','model','ShowSetting','lodash','util','moment','bluebird','randomstring'];(function(_0x536b33,_0xab0be1){var _0x53018c=function(_0x3bcc81){while(--_0x3bcc81){_0x536b33['push'](_0x536b33['shift']());}};_0x53018c(++_0xab0be1);}(_0x0b77,0x13b));var _0x70b7=function(_0x2fd0f0,_0x4b634e){_0x2fd0f0=_0x2fd0f0-0x0;var _0x57f71a=_0x0b77[_0x2fd0f0];return _0x57f71a;};'use strict';var _=require(_0x70b7('0x0'));var util=require(_0x70b7('0x1'));var moment=require(_0x70b7('0x2'));var BPromise=require(_0x70b7('0x3'));var rs=require(_0x70b7('0x4'));var fs=require('fs');var Redis=require(_0x70b7('0x5'));var db=require(_0x70b7('0x6'))['db'];var utils=require(_0x70b7('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x70b7('0x8'));var client=jayson[_0x70b7('0x9')][_0x70b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21c594,_0x44dbdd,_0x22bbc1){return new BPromise(function(_0x22506b,_0x1b0460){return client[_0x70b7('0xb')](_0x21c594,_0x22bbc1)[_0x70b7('0xc')](function(_0x4df650){logger[_0x70b7('0xd')](_0x70b7('0xe'),_0x44dbdd,_0x70b7('0xf'));logger[_0x70b7('0x10')](_0x70b7('0x11'),_0x44dbdd,'request\x20sent',JSON[_0x70b7('0x12')](_0x4df650));if(_0x4df650[_0x70b7('0x13')]){if(_0x4df650[_0x70b7('0x13')][_0x70b7('0x14')]===0x1f4){logger[_0x70b7('0x13')]('Setting,\x20%s,\x20%s',_0x44dbdd,_0x4df650[_0x70b7('0x13')]['message']);return _0x1b0460(_0x4df650[_0x70b7('0x13')][_0x70b7('0x15')]);}logger[_0x70b7('0x13')](_0x70b7('0xe'),_0x44dbdd,_0x4df650[_0x70b7('0x13')][_0x70b7('0x15')]);return _0x22506b(_0x4df650[_0x70b7('0x13')][_0x70b7('0x15')]);}else{logger['info'](_0x70b7('0xe'),_0x44dbdd,'request\x20sent');_0x22506b(_0x4df650['result'][_0x70b7('0x15')]);}})[_0x70b7('0x16')](function(_0x1fb9fe){logger['error']('Setting,\x20%s,\x20%s',_0x44dbdd,_0x1fb9fe);_0x1b0460(_0x1fb9fe);});});}exports['ShowSetting']=function(_0x54926d){var _0x2bfefd=this;return new Promise(function(_0x23d8f7,_0x3ae3dd){return db[_0x70b7('0x17')][_0x70b7('0x18')]({'raw':_0x54926d[_0x70b7('0x19')]?_0x54926d[_0x70b7('0x19')][_0x70b7('0x1a')]===undefined?!![]:![]:!![],'where':_0x54926d['options']?_0x54926d[_0x70b7('0x19')]['where']||null:null,'attributes':_0x54926d[_0x70b7('0x19')]?_0x54926d[_0x70b7('0x19')][_0x70b7('0x1b')]||null:null,'include':_0x54926d[_0x70b7('0x19')]?_0x54926d[_0x70b7('0x19')][_0x70b7('0x1c')]?_[_0x70b7('0x1d')](_0x54926d[_0x70b7('0x19')][_0x70b7('0x1c')],function(_0x1d88e0){return{'model':db[_0x1d88e0[_0x70b7('0x1e')]],'as':_0x1d88e0['as'],'attributes':_0x1d88e0[_0x70b7('0x1b')],'include':_0x1d88e0['include']?_['map'](_0x1d88e0[_0x70b7('0x1c')],function(_0x32f497){return{'model':db[_0x32f497[_0x70b7('0x1e')]],'as':_0x32f497['as'],'attributes':_0x32f497[_0x70b7('0x1b')],'include':_0x32f497[_0x70b7('0x1c')]?_[_0x70b7('0x1d')](_0x32f497[_0x70b7('0x1c')],function(_0xc9a8){return{'model':db[_0xc9a8[_0x70b7('0x1e')]],'as':_0xc9a8['as'],'attributes':_0xc9a8[_0x70b7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x70b7('0xc')](function(_0x211483){logger['info'](_0x70b7('0x1f'),_0x54926d);logger[_0x70b7('0x10')](_0x70b7('0x1f'),_0x54926d,JSON[_0x70b7('0x12')](_0x211483));_0x23d8f7(_0x211483);})[_0x70b7('0x16')](function(_0x58b249){logger[_0x70b7('0x13')](_0x70b7('0x1f'),_0x58b249[_0x70b7('0x15')],_0x54926d);_0x3ae3dd(_0x2bfefd['error'](0x1f4,_0x58b249[_0x70b7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index d96dfec..cfb509d 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 _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x4ee87e,_0x4cba98){var _0x254709=function(_0x539f68){while(--_0x539f68){_0x4ee87e['push'](_0x4ee87e['shift']());}};_0x254709(++_0x4cba98);}(_0x7a54,0x106));var _0x47a5=function(_0x219b97,_0x1fa138){_0x219b97=_0x219b97-0x0;var _0x59c8ae=_0x7a54[_0x219b97];return _0x59c8ae;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x280885,_0x4ed544){var _0x1ff0dc=function(_0xaf271a){while(--_0xaf271a){_0x280885['push'](_0x280885['shift']());}};_0x1ff0dc(++_0x4ed544);}(_0x7a54,0x106));var _0x47a5=function(_0x3a448c,_0x21dc61){_0x3a448c=_0x3a448c-0x0;var _0xef8f92=_0x7a54[_0x3a448c];return _0xef8f92;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index f1e92dd..4d1e851 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 _0x2a23=['skebby','connectel','clicksend','plivo','clickatell','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','ENUM','twilio'];(function(_0x8b4dd3,_0x120bdc){var _0x1f9fda=function(_0x59eb16){while(--_0x59eb16){_0x8b4dd3['push'](_0x8b4dd3['shift']());}};_0x1f9fda(++_0x120bdc);}(_0x2a23,0x6d));var _0x32a2=function(_0x354a15,_0x27b020){_0x354a15=_0x354a15-0x0;var _0x49159d=_0x2a23[_0x354a15];return _0x49159d;};'use strict';var Sequelize=require(_0x32a2('0x0'));var rs=require(_0x32a2('0x1'));module['exports']={'name':{'type':Sequelize[_0x32a2('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x32a2('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x32a2('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x32a2('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x32a2('0x2')]},'type':{'type':Sequelize[_0x32a2('0x3')](_0x32a2('0x4'),_0x32a2('0x5'),_0x32a2('0x6'),_0x32a2('0x7'),_0x32a2('0x8'),_0x32a2('0x9'),'bandwidth','csc',_0x32a2('0xa'),_0x32a2('0xb'))},'accountSid':{'type':Sequelize[_0x32a2('0x2')]},'authId':{'type':Sequelize[_0x32a2('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x32a2('0x2')]},'password':{'type':Sequelize[_0x32a2('0x2')]},'apiKey':{'type':Sequelize[_0x32a2('0x2')]},'applicationId':{'type':Sequelize[_0x32a2('0x2')]},'accountId':{'type':Sequelize[_0x32a2('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x32a2('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x32a2('0x2')]},'notificationTemplate':{'type':Sequelize[_0x32a2('0xd')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x32a2('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x32a2('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x32a2('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x32a2('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x32a2('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x32a2('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x32a2('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x32a2('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x32a2('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x32a2('0xe')],'comment':_0x32a2('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x32a2('0xc')],'defaultValue':![],'comment':_0x32a2('0x10'),'set':function(_0x192509){if(!_0x192509)this[_0x32a2('0x11')]('mandatoryDispositionPauseId',null);this[_0x32a2('0x11')](_0x32a2('0x12'),_0x192509);}}}; \ No newline at end of file +var _0x8de3=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','generate','ENUM','twilio','skebby','clickatell','bandwidth','csc','infobip','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x396e90,_0x4c7718){var _0xaf7e4c=function(_0x2a96bc){while(--_0x2a96bc){_0x396e90['push'](_0x396e90['shift']());}};_0xaf7e4c(++_0x4c7718);}(_0x8de3,0xfa));var _0x38de=function(_0x2bb66c,_0x36c6c6){_0x2bb66c=_0x2bb66c-0x0;var _0x1e0f98=_0x8de3[_0x2bb66c];return _0x1e0f98;};'use strict';var Sequelize=require(_0x38de('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x38de('0x1')],'unique':_0x38de('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x38de('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x38de('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x38de('0x1')],'defaultValue':function(){return rs[_0x38de('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x38de('0x4')](_0x38de('0x5'),_0x38de('0x6'),'connectel','clicksend','plivo',_0x38de('0x7'),_0x38de('0x8'),_0x38de('0x9'),_0x38de('0xa'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x38de('0x1')]},'authToken':{'type':Sequelize[_0x38de('0x1')]},'smsMethod':{'type':Sequelize[_0x38de('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x38de('0x1')]},'applicationId':{'type':Sequelize[_0x38de('0x1')]},'accountId':{'type':Sequelize[_0x38de('0x1')]},'senderString':{'type':Sequelize[_0x38de('0x1')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x38de('0xb')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x38de('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x38de('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x38de('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x38de('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x38de('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x38de('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x38de('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x38de('0xd')],'comment':_0x38de('0xe')},'mandatoryDisposition':{'type':Sequelize[_0x38de('0xc')],'defaultValue':![],'comment':_0x38de('0xf'),'set':function(_0x15d811){if(!_0x15d811)this[_0x38de('0x10')](_0x38de('0x11'),null);this['setDataValue'](_0x38de('0x12'),_0x15d811);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index e024a0c..1f055c0 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 _0xd325=['Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','omit','SmsInteraction','created','autoclose','push','close','unmanaged','*,*,*,*','interaction','ContactId','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','SmsApplication','bulkCreate','findAndCountAll','priority','stack','finally','sendStatus','getApplications','getInteractions','fullname','internal','Tag','color','tag','List','out','Messages','spread','SmsMessage','dataValues','debug','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','csc','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','get','SmsAccounts','name','send','index','Pause','map','SmsAccount','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','params','mandatoryDispositionPause','length','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','findAll','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','sms','Applications','applications','orderBy','account','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','MessageSid','skebby','connectel','clicksend','message_id','plivo','From','Text','MessageUUID','infobip','results','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','text','intelepeer','isNil'];(function(_0x1356df,_0x5685f8){var _0x376d50=function(_0x4129ac){while(--_0x4129ac){_0x1356df['push'](_0x1356df['shift']());}};_0x376d50(++_0x5685f8);}(_0xd325,0x13d));var _0x5d32=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0xd325[_0x132558];return _0x34f138;};'use strict';var emlformat=require(_0x5d32('0x0'));var rimraf=require(_0x5d32('0x1'));var zipdir=require(_0x5d32('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d32('0x3'));var moment=require(_0x5d32('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5d32('0x5'));var path=require(_0x5d32('0x6'));var sox=require(_0x5d32('0x7'));var csv=require(_0x5d32('0x8'));var ejs=require(_0x5d32('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5d32('0xa'));var crypto=require(_0x5d32('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5d32('0xc'));var toCsv=require(_0x5d32('0x8'));var querystring=require('querystring');var Papa=require(_0x5d32('0xd'));var Redis=require(_0x5d32('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5d32('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d32('0x10'));var logger=require('../../config/logger')(_0x5d32('0x11'));var utils=require(_0x5d32('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5d32('0x13'));var db=require(_0x5d32('0x14'))['db'];config[_0x5d32('0x15')]=_[_0x5d32('0x16')](config[_0x5d32('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x5d32('0x17'))(new Redis(config['redis']));require(_0x5d32('0x18'))[_0x5d32('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5d32('0x1a')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5d5fc9,_0x48aa18,_0x11136e,_0x4437d1){return new BPromise(function(_0xfaedfd,_0x7e07b9){var _0x1b3cb5=_0x4437d1||client;return _0x1b3cb5[_0x5d32('0x1b')](_0x5d5fc9,_0x11136e)[_0x5d32('0x1c')](function(_0x3b057c){logger[_0x5d32('0x1d')](_0x5d32('0x1e'),_0x48aa18,'request\x20sent');logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x48aa18,_0x5d32('0x1f'),JSON[_0x5d32('0x20')](_0x3b057c));if(_0x3b057c[_0x5d32('0x21')]){if(_0x3b057c['error'][_0x5d32('0x22')]===0x1f4){logger[_0x5d32('0x21')]('SmsAccount,\x20%s,\x20%s',_0x48aa18,_0x3b057c[_0x5d32('0x21')]['message']);return _0x7e07b9(_0x3b057c['error'][_0x5d32('0x23')]);}logger[_0x5d32('0x21')](_0x5d32('0x1e'),_0x48aa18,_0x3b057c['error'][_0x5d32('0x23')]);return _0xfaedfd(_0x3b057c['error'][_0x5d32('0x23')]);}else{logger[_0x5d32('0x1d')](_0x5d32('0x1e'),_0x48aa18,_0x5d32('0x1f'));_0xfaedfd(_0x3b057c['result'][_0x5d32('0x23')]);}})[_0x5d32('0x24')](function(_0x48445e){logger[_0x5d32('0x21')](_0x5d32('0x1e'),_0x48aa18,_0x48445e);_0x7e07b9(_0x48445e);});});}function respondWithStatusCode(_0xc4ee96,_0x4219cf){_0x4219cf=_0x4219cf||0xcc;return function(_0x5c413b){if(_0x5c413b){return _0xc4ee96['sendStatus'](_0x4219cf);}return _0xc4ee96[_0x5d32('0x25')](_0x4219cf)[_0x5d32('0x26')]();};}function respondWithResult(_0x472f64,_0x5babb6){_0x5babb6=_0x5babb6||0xc8;return function(_0x4ad32d){if(_0x4ad32d){return _0x472f64[_0x5d32('0x25')](_0x5babb6)[_0x5d32('0x27')](_0x4ad32d);}};}function respondWithFilteredResult(_0x493c37,_0x1f5d20){return function(_0x30a705){if(_0x30a705){var _0x1a180b=typeof _0x1f5d20[_0x5d32('0x28')]===_0x5d32('0x29')&&typeof _0x1f5d20['limit']===_0x5d32('0x29');var _0x36883b=_0x30a705[_0x5d32('0x2a')];var _0x570670=_0x1a180b?0x0:_0x1f5d20['offset'];var _0x50e44c=_0x1a180b?_0x30a705[_0x5d32('0x2a')]:_0x1f5d20[_0x5d32('0x28')]+_0x1f5d20[_0x5d32('0x2b')];var _0x1d2228;if(_0x50e44c>=_0x36883b){_0x50e44c=_0x36883b;_0x1d2228=0xc8;}else{_0x1d2228=0xce;}_0x493c37[_0x5d32('0x25')](_0x1d2228);return _0x493c37['set'](_0x5d32('0x2c'),_0x570670+'-'+_0x50e44c+'/'+_0x36883b)[_0x5d32('0x27')](_0x30a705);}return null;};}function patchUpdates(_0x19080f){return function(_0x5e34d2){try{jsonpatch[_0x5d32('0x2d')](_0x5e34d2,_0x19080f,!![]);}catch(_0x3a87e0){return BPromise[_0x5d32('0x2e')](_0x3a87e0);}return _0x5e34d2[_0x5d32('0x2f')]();};}function saveUpdates(_0x4ac03f,_0x7952e9){return function(_0x4cae4d){if(_0x4cae4d){return _0x4cae4d['update'](_0x4ac03f)[_0x5d32('0x1c')](function(_0x11c5b6){return _0x11c5b6;});}return null;};}function removeEntity(_0x338cb0,_0x5b13fd){return function(_0x54d3ee){if(_0x54d3ee){return _0x54d3ee[_0x5d32('0x30')]()[_0x5d32('0x1c')](function(){var _0x268411=_0x54d3ee[_0x5d32('0x31')]({'plain':!![]});var _0x5becb7=_0x5d32('0x32');return db['UserProfileResource'][_0x5d32('0x30')]({'where':{'type':_0x5becb7,'resourceId':_0x268411['id']}})[_0x5d32('0x1c')](function(){return _0x54d3ee;});})[_0x5d32('0x1c')](function(){_0x338cb0[_0x5d32('0x25')](0xcc)[_0x5d32('0x26')]();});}};}function handleEntityNotFound(_0x453754,_0x5aec14){return function(_0x523a1a){if(!_0x523a1a){_0x453754['sendStatus'](0x194);}return _0x523a1a;};}function handleError(_0x20a4c5,_0x30e1dd){_0x30e1dd=_0x30e1dd||0x1f4;return function(_0x56816f){logger[_0x5d32('0x21')](_0x56816f['stack']);if(_0x56816f[_0x5d32('0x33')]){delete _0x56816f[_0x5d32('0x33')];}_0x20a4c5['status'](_0x30e1dd)[_0x5d32('0x34')](_0x56816f);};}exports[_0x5d32('0x35')]=function(_0xfb577a,_0x51099c){var _0x289812={'include':[{'model':db[_0x5d32('0x36')],'as':'mandatoryDispositionPause'}]},_0x3433e3={},_0x3d3960={'count':0x0,'rows':[]};var _0x57494d=_[_0x5d32('0x37')](db[_0x5d32('0x38')][_0x5d32('0x39')],function(_0x185eff){return{'name':_0x185eff[_0x5d32('0x3a')],'type':_0x185eff['type'][_0x5d32('0x3b')]};});_0x3433e3['model']=_[_0x5d32('0x37')](_0x57494d,_0x5d32('0x33'));_0x3433e3['query']=_[_0x5d32('0x3c')](_0xfb577a[_0x5d32('0x3d')]);_0x3433e3['filters']=_[_0x5d32('0x3e')](_0x3433e3[_0x5d32('0x3f')],_0x3433e3[_0x5d32('0x3d')]);_0x289812[_0x5d32('0x40')]=_[_0x5d32('0x3e')](_0x3433e3[_0x5d32('0x3f')],qs[_0x5d32('0x41')](_0xfb577a[_0x5d32('0x3d')]['fields']));_0x289812[_0x5d32('0x40')]=_0x289812['attributes']['length']?_0x289812[_0x5d32('0x40')]:_0x3433e3[_0x5d32('0x3f')];if(!_0xfb577a[_0x5d32('0x3d')][_0x5d32('0x42')](_0x5d32('0x43'))){_0x289812['limit']=qs[_0x5d32('0x2b')](_0xfb577a[_0x5d32('0x3d')][_0x5d32('0x2b')]);_0x289812[_0x5d32('0x28')]=qs[_0x5d32('0x28')](_0xfb577a['query'][_0x5d32('0x28')]);}_0x289812[_0x5d32('0x44')]=qs[_0x5d32('0x45')](_0xfb577a[_0x5d32('0x3d')][_0x5d32('0x45')]);_0x289812[_0x5d32('0x46')]=qs[_0x5d32('0x47')](_[_0x5d32('0x48')](_0xfb577a[_0x5d32('0x3d')],_0x3433e3[_0x5d32('0x47')]),_0x57494d);if(_0xfb577a['query'][_0x5d32('0x49')]){_0x289812[_0x5d32('0x46')]=_[_0x5d32('0x4a')](_0x289812[_0x5d32('0x46')],{'$or':_[_0x5d32('0x37')](_0x57494d,function(_0x50e587){if(_0x50e587[_0x5d32('0x4b')]!=='VIRTUAL'){var _0x952899={};_0x952899[_0x50e587['name']]={'$like':'%'+_0xfb577a[_0x5d32('0x3d')][_0x5d32('0x49')]+'%'};return _0x952899;}})});}_0x289812=_[_0x5d32('0x4a')]({},_0x289812,_0xfb577a[_0x5d32('0x4c')]);var _0x28bb6e={'where':_0x289812[_0x5d32('0x46')]};return db[_0x5d32('0x38')][_0x5d32('0x2a')](_0x28bb6e)[_0x5d32('0x1c')](function(_0x436b0b){_0x3d3960[_0x5d32('0x2a')]=_0x436b0b;if(_0xfb577a['query'][_0x5d32('0x4d')]){_0x289812[_0x5d32('0x4e')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x289812);})['then'](function(_0x48d583){_0x3d3960['rows']=_0x48d583;return _0x3d3960;})[_0x5d32('0x1c')](respondWithFilteredResult(_0x51099c,_0x289812))[_0x5d32('0x24')](handleError(_0x51099c,null));};exports['show']=function(_0x97a2fa,_0x1c53a5){var _0x15ff4f={'raw':![],'where':{'id':_0x97a2fa[_0x5d32('0x4f')]['id']},'include':[{'model':db[_0x5d32('0x36')],'as':_0x5d32('0x50')}]},_0x57e169={};_0x57e169[_0x5d32('0x3f')]=_[_0x5d32('0x3c')](db[_0x5d32('0x38')][_0x5d32('0x39')]);_0x57e169[_0x5d32('0x3d')]=_['keys'](_0x97a2fa['query']);_0x57e169[_0x5d32('0x47')]=_[_0x5d32('0x3e')](_0x57e169['model'],_0x57e169[_0x5d32('0x3d')]);_0x15ff4f[_0x5d32('0x40')]=_[_0x5d32('0x3e')](_0x57e169[_0x5d32('0x3f')],qs[_0x5d32('0x41')](_0x97a2fa['query'][_0x5d32('0x41')]));_0x15ff4f['attributes']=_0x15ff4f[_0x5d32('0x40')][_0x5d32('0x51')]?_0x15ff4f[_0x5d32('0x40')]:_0x57e169[_0x5d32('0x3f')];if(_0x97a2fa[_0x5d32('0x3d')][_0x5d32('0x4d')]){_0x15ff4f[_0x5d32('0x4e')]=[{'all':!![]}];}_0x15ff4f=_[_0x5d32('0x4a')]({},_0x15ff4f,_0x97a2fa[_0x5d32('0x4c')]);return db[_0x5d32('0x38')][_0x5d32('0x52')](_0x15ff4f)[_0x5d32('0x1c')](handleEntityNotFound(_0x1c53a5,null))[_0x5d32('0x1c')](respondWithResult(_0x1c53a5,null))[_0x5d32('0x24')](handleError(_0x1c53a5,null));};exports[_0x5d32('0x53')]=function(_0x31f614,_0x558b0f){return db[_0x5d32('0x38')]['create'](_0x31f614[_0x5d32('0x54')],{})[_0x5d32('0x1c')](function(_0x37a2e1){var _0xc8a49b=_0x31f614['user'][_0x5d32('0x31')]({'plain':!![]});if(!_0xc8a49b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc8a49b[_0x5d32('0x55')]===_0x5d32('0x56')){var _0x4017af=_0x37a2e1[_0x5d32('0x31')]({'plain':!![]});var _0x592494='SmsAccounts';return db[_0x5d32('0x57')][_0x5d32('0x52')]({'where':{'name':_0x592494,'userProfileId':_0xc8a49b[_0x5d32('0x58')]},'raw':!![]})[_0x5d32('0x1c')](function(_0x5e3f1c){if(_0x5e3f1c&&_0x5e3f1c[_0x5d32('0x59')]===0x0){return db[_0x5d32('0x5a')][_0x5d32('0x53')]({'name':_0x4017af['name'],'resourceId':_0x4017af['id'],'type':_0x5e3f1c['name'],'sectionId':_0x5e3f1c['id']},{})[_0x5d32('0x1c')](function(){return _0x37a2e1;});}else{return _0x37a2e1;}})[_0x5d32('0x24')](function(_0x6fd029){logger['error'](_0x5d32('0x5b'),_0x6fd029);throw _0x6fd029;});}return _0x37a2e1;})[_0x5d32('0x1c')](respondWithResult(_0x558b0f,0xc9))[_0x5d32('0x24')](handleError(_0x558b0f,null));};exports[_0x5d32('0x5c')]=function(_0x1965a7,_0x563f50){if(_0x1965a7['body']['id']){delete _0x1965a7[_0x5d32('0x54')]['id'];}return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x1965a7['params']['id']},'include':[{'model':db[_0x5d32('0x36')],'as':_0x5d32('0x50')}]})[_0x5d32('0x1c')](handleEntityNotFound(_0x563f50,null))[_0x5d32('0x1c')](saveUpdates(_0x1965a7[_0x5d32('0x54')],null))[_0x5d32('0x1c')](respondWithResult(_0x563f50,null))['catch'](handleError(_0x563f50,null));};exports['destroy']=function(_0x524720,_0xa9ae12){return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x524720[_0x5d32('0x4f')]['id']}})['then'](handleEntityNotFound(_0xa9ae12,null))[_0x5d32('0x1c')](removeEntity(_0xa9ae12,null))[_0x5d32('0x24')](handleError(_0xa9ae12,null));};exports['describe']=function(_0x482a01,_0x578d87){return db[_0x5d32('0x38')][_0x5d32('0x5d')]()[_0x5d32('0x1c')](respondWithResult(_0x578d87,null))[_0x5d32('0x24')](handleError(_0x578d87,null));};exports[_0x5d32('0x5e')]=function(_0x25d080,_0x5acb37,_0xe2092){if(_0x25d080[_0x5d32('0x54')]['id']){delete _0x25d080[_0x5d32('0x54')]['id'];}return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x25d080[_0x5d32('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5acb37,null))[_0x5d32('0x1c')](function(_0x2fedb8){if(_0x2fedb8){_0x25d080[_0x5d32('0x54')][_0x5d32('0x5f')]=_0x2fedb8['id'];return db[_0x5d32('0x60')][_0x5d32('0x53')](_0x25d080['body']);}})['then'](respondWithResult(_0x5acb37,null))[_0x5d32('0x24')](handleError(_0x5acb37,null));};exports['getDispositions']=function(_0x4e4acd,_0x4abaeb,_0x3e8fab){var _0x6c01c6={'raw':![],'where':{}};var _0x1669ff={};var _0x2fac4a={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x4e4acd[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x4abaeb,null))[_0x5d32('0x1c')](function(_0x1b106f){if(_0x1b106f){_0x1669ff[_0x5d32('0x3f')]=_[_0x5d32('0x3c')](db['Disposition'][_0x5d32('0x39')]);_0x1669ff[_0x5d32('0x3d')]=_[_0x5d32('0x3c')](_0x4e4acd[_0x5d32('0x3d')]);_0x1669ff['filters']=_[_0x5d32('0x3e')](_0x1669ff['model'],_0x1669ff[_0x5d32('0x3d')]);_0x6c01c6[_0x5d32('0x40')]=_[_0x5d32('0x3e')](_0x1669ff[_0x5d32('0x3f')],qs[_0x5d32('0x41')](_0x4e4acd[_0x5d32('0x3d')]['fields']));_0x6c01c6[_0x5d32('0x40')]=_0x6c01c6[_0x5d32('0x40')][_0x5d32('0x51')]?_0x6c01c6[_0x5d32('0x40')]:_0x1669ff[_0x5d32('0x3f')];if(!_0x4e4acd[_0x5d32('0x3d')][_0x5d32('0x42')]('nolimit')){_0x6c01c6[_0x5d32('0x2b')]=qs['limit'](_0x4e4acd['query'][_0x5d32('0x2b')]);_0x6c01c6[_0x5d32('0x28')]=qs[_0x5d32('0x28')](_0x4e4acd['query'][_0x5d32('0x28')]);}_0x6c01c6[_0x5d32('0x44')]=qs['sort'](_0x4e4acd[_0x5d32('0x3d')][_0x5d32('0x45')]);_0x6c01c6[_0x5d32('0x46')]=qs[_0x5d32('0x47')](_[_0x5d32('0x48')](_0x4e4acd[_0x5d32('0x3d')],_0x1669ff[_0x5d32('0x47')]));_0x6c01c6[_0x5d32('0x46')][_0x5d32('0x5f')]=_0x1b106f['id'];if(_0x4e4acd['query']['filter']){_0x6c01c6[_0x5d32('0x46')]=_[_0x5d32('0x4a')](_0x6c01c6[_0x5d32('0x46')],{'$or':_[_0x5d32('0x37')](_0x6c01c6['attributes'],function(_0x3ab218){var _0x49a412={};_0x49a412[_0x3ab218]={'$like':'%'+_0x4e4acd[_0x5d32('0x3d')][_0x5d32('0x49')]+'%'};return _0x49a412;})});}_0x6c01c6=_[_0x5d32('0x4a')]({},_0x6c01c6,_0x4e4acd[_0x5d32('0x4c')]);return db[_0x5d32('0x60')]['count']({'where':_0x6c01c6[_0x5d32('0x46')]})[_0x5d32('0x1c')](function(_0x57474b){_0x2fac4a[_0x5d32('0x2a')]=_0x57474b;if(_0x4e4acd[_0x5d32('0x3d')][_0x5d32('0x4d')]){_0x6c01c6[_0x5d32('0x4e')]=[{'all':!![]}];}return db[_0x5d32('0x60')][_0x5d32('0x61')](_0x6c01c6);})[_0x5d32('0x1c')](function(_0x314f1b){_0x2fac4a[_0x5d32('0x62')]=_0x314f1b;return _0x2fac4a;});}})['then'](respondWithFilteredResult(_0x4abaeb,_0x6c01c6))[_0x5d32('0x24')](handleError(_0x4abaeb,null));};exports['removeDispositions']=function(_0x5c4842,_0x5127b9,_0x499a85){return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x5c4842['params']['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x5127b9,null))[_0x5d32('0x1c')](function(_0x1c1655){if(_0x1c1655){return _0x1c1655[_0x5d32('0x63')](_0x5c4842[_0x5d32('0x3d')][_0x5d32('0x64')]);}})[_0x5d32('0x1c')](respondWithStatusCode(_0x5127b9,null))[_0x5d32('0x24')](handleError(_0x5127b9,null));};exports[_0x5d32('0x65')]=function(_0x2d9c5e,_0x40a3c8,_0x18c2a1){if(_0x2d9c5e[_0x5d32('0x54')]['id']){delete _0x2d9c5e[_0x5d32('0x54')]['id'];}return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x2d9c5e[_0x5d32('0x4f')]['id']}})['then'](handleEntityNotFound(_0x40a3c8,null))[_0x5d32('0x1c')](function(_0x313f10){if(_0x313f10){_0x2d9c5e['body'][_0x5d32('0x5f')]=_0x313f10['id'];return db['CannedAnswer']['create'](_0x2d9c5e['body']);}})[_0x5d32('0x1c')](respondWithResult(_0x40a3c8,null))[_0x5d32('0x24')](handleError(_0x40a3c8,null));};exports[_0x5d32('0x66')]=function(_0xba9d35,_0x18ea67,_0x52880d){var _0x122189={'raw':![],'where':{}};var _0x83ff6b={};var _0x2860ea={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0xba9d35[_0x5d32('0x4f')]['id']}})['then'](handleEntityNotFound(_0x18ea67,null))['then'](function(_0x4fe2c0){if(_0x4fe2c0){_0x83ff6b['model']=_['keys'](db[_0x5d32('0x67')]['rawAttributes']);_0x83ff6b['query']=_['keys'](_0xba9d35[_0x5d32('0x3d')]);_0x83ff6b[_0x5d32('0x47')]=_[_0x5d32('0x3e')](_0x83ff6b['model'],_0x83ff6b[_0x5d32('0x3d')]);_0x122189['attributes']=_[_0x5d32('0x3e')](_0x83ff6b[_0x5d32('0x3f')],qs[_0x5d32('0x41')](_0xba9d35[_0x5d32('0x3d')]['fields']));_0x122189[_0x5d32('0x40')]=_0x122189['attributes'][_0x5d32('0x51')]?_0x122189[_0x5d32('0x40')]:_0x83ff6b[_0x5d32('0x3f')];if(!_0xba9d35[_0x5d32('0x3d')][_0x5d32('0x42')](_0x5d32('0x43'))){_0x122189['limit']=qs[_0x5d32('0x2b')](_0xba9d35[_0x5d32('0x3d')][_0x5d32('0x2b')]);_0x122189['offset']=qs['offset'](_0xba9d35[_0x5d32('0x3d')][_0x5d32('0x28')]);}_0x122189[_0x5d32('0x44')]=qs[_0x5d32('0x45')](_0xba9d35[_0x5d32('0x3d')]['sort']);_0x122189[_0x5d32('0x46')]=qs[_0x5d32('0x47')](_['pick'](_0xba9d35[_0x5d32('0x3d')],_0x83ff6b[_0x5d32('0x47')]));_0x122189[_0x5d32('0x46')]['SmsAccountId']=_0x4fe2c0['id'];if(_0xba9d35[_0x5d32('0x3d')][_0x5d32('0x49')]){_0x122189[_0x5d32('0x46')]=_['merge'](_0x122189[_0x5d32('0x46')],{'$or':_[_0x5d32('0x37')](_0x122189[_0x5d32('0x40')],function(_0x5cf8cc){var _0x4d5533={};_0x4d5533[_0x5cf8cc]={'$like':'%'+_0xba9d35[_0x5d32('0x3d')][_0x5d32('0x49')]+'%'};return _0x4d5533;})});}_0x122189=_['merge']({},_0x122189,_0xba9d35[_0x5d32('0x4c')]);return db[_0x5d32('0x67')]['count']({'where':_0x122189[_0x5d32('0x46')]})[_0x5d32('0x1c')](function(_0x3ef992){_0x2860ea[_0x5d32('0x2a')]=_0x3ef992;if(_0xba9d35[_0x5d32('0x3d')][_0x5d32('0x4d')]){_0x122189[_0x5d32('0x4e')]=[{'all':!![]}];}return db[_0x5d32('0x67')][_0x5d32('0x61')](_0x122189);})[_0x5d32('0x1c')](function(_0x235940){_0x2860ea[_0x5d32('0x62')]=_0x235940;return _0x2860ea;});}})[_0x5d32('0x1c')](respondWithFilteredResult(_0x18ea67,_0x122189))[_0x5d32('0x24')](handleError(_0x18ea67,null));};exports[_0x5d32('0x68')]=function(_0x1aee55,_0x39f5fa,_0x1fb21f){return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x1aee55[_0x5d32('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39f5fa,null))['then'](function(_0x5b956d){if(_0x5b956d){return _0x5b956d['removeAnswers'](_0x1aee55[_0x5d32('0x3d')][_0x5d32('0x64')]);}})['then'](respondWithStatusCode(_0x39f5fa,null))['catch'](handleError(_0x39f5fa,null));};exports['notify']=function(_0x153993,_0x185180,_0xab5090){var _0x48e0d9={'channel':_0x5d32('0x69')};var _0x259f18=[];var _0x25a98f=[];var _0x20afc7={};return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x153993[_0x5d32('0x4f')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x5d32('0x6a')}]})[_0x5d32('0x1c')](handleEntityNotFound(_0x185180,null))[_0x5d32('0x1c')](function(_0x5c5e14){_0x48e0d9['account']=_0x5c5e14;_0x48e0d9[_0x5d32('0x6b')]=_[_0x5d32('0x6c')](_0x5c5e14['Applications'],['priority'],['asc']);if(_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0x6a')]){delete _0x48e0d9[_0x5d32('0x6d')][_0x5d32('0x6a')];}return db[_0x5d32('0x6e')][_0x5d32('0x5d')]();})[_0x5d32('0x1c')](function(_0x267662){if(!_0x267662){throw new db['Sequelize']['ValidationError'](_0x5d32('0x6f'));}_0x259f18=_[_0x5d32('0x70')](_['keys'](_0x267662),['createdAt','updatedAt']);_0x25a98f=_[_0x5d32('0x70')](_[_0x5d32('0x3c')](_0x267662),[_0x5d32('0x71'),_0x5d32('0x72'),_0x5d32('0x73'),_0x5d32('0x74')]);_0x48e0d9['body']={'mapKey':_0x5d32('0x75')};if(_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0x4b')]){switch(_0x48e0d9['account'][_0x5d32('0x4b')]){case _0x5d32('0x76'):_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]=_0x153993[_0x5d32('0x54')]['From'];_0x48e0d9['body'][_0x5d32('0x54')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x78')];_0x48e0d9['body'][_0x5d32('0x79')]=_0x153993['body'][_0x5d32('0x7a')];break;case _0x5d32('0x7b'):_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]='+'+_0x153993[_0x5d32('0x54')]['sender'];_0x48e0d9['body'][_0x5d32('0x54')]=_0x153993[_0x5d32('0x54')]['text'];break;case _0x5d32('0x7c'):_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]=_0x153993['body']['from'];_0x48e0d9[_0x5d32('0x54')]['body']=_0x153993[_0x5d32('0x54')]['message'];break;case _0x5d32('0x7d'):_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]=_0x153993[_0x5d32('0x54')]['from'];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x54')];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x79')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x7e')];break;case _0x5d32('0x7f'):_0x48e0d9['body'][_0x5d32('0x77')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x80')];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]=_0x153993['body'][_0x5d32('0x81')];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x79')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x82')];break;case _0x5d32('0x83'):_0x48e0d9[_0x5d32('0x54')]['from']='+'+_0x153993[_0x5d32('0x54')]['results'][0x0][_0x5d32('0x77')];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x84')][0x0]['text'];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x79')]=_0x153993[_0x5d32('0x54')]['results'][0x0][_0x5d32('0x79')];break;case'csc':_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x85')];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]=_0x153993[_0x5d32('0x54')]['segmentedMessage']['message'];break;case _0x5d32('0x86'):_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x87')];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]=_0x153993['body']['text'];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x79')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x88')];break;case _0x5d32('0x89'):_0x48e0d9['body'][_0x5d32('0x79')]=_0x153993[_0x5d32('0x54')][0x0][_0x5d32('0x23')]['id'];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]=_0x153993[_0x5d32('0x54')][0x0][_0x5d32('0x23')][_0x5d32('0x77')];_0x48e0d9[_0x5d32('0x54')]['body']=_0x153993['body'][0x0][_0x5d32('0x23')][_0x5d32('0x8a')];break;case _0x5d32('0x8b'):_0x48e0d9['body']['from']=_0x153993[_0x5d32('0x54')]['from'];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x23')];_0x48e0d9['body'][_0x5d32('0x79')]=_0x153993['body']['refid'];break;}}if(_0x48e0d9['body']['id']){delete _0x48e0d9['body']['id'];}if(_[_0x5d32('0x8c')](_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')])){throw new db[(_0x5d32('0x8d'))][(_0x5d32('0x8e'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')])||_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]===''){throw new db[(_0x5d32('0x8d'))]['ValidationError'](_0x5d32('0x8f'));}if(_[_0x5d32('0x8c')](_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x90')])){throw new db[(_0x5d32('0x8d'))][(_0x5d32('0x8e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x25a98f);}if(!_[_0x5d32('0x91')](_0x25a98f,_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x90')])){throw new db[(_0x5d32('0x8d'))]['ValidationError'](_0x5d32('0x92')+_0x25a98f);}_0x20afc7[_0x48e0d9['body'][_0x5d32('0x90')]]=_0x48e0d9['body'][_0x5d32('0x77')];return db[_0x5d32('0x93')][_0x5d32('0x52')]({'where':{'id':_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0x74')]},'include':[{'model':db[_0x5d32('0x6e')],'as':_0x5d32('0x94'),'where':_0x20afc7,'limit':0x1,'order':[[_0x5d32('0x72'),_0x5d32('0x95')]]}]});})[_0x5d32('0x1c')](handleEntityNotFound(_0x185180,null))[_0x5d32('0x1c')](function(_0x314e6c){if(_0x314e6c){_0x48e0d9['list']=_[_0x5d32('0x96')](_0x314e6c,['Contacts']);if(_0x314e6c[_0x5d32('0x94')][_0x5d32('0x51')]){return _0x314e6c[_0x5d32('0x94')][0x0];}var _0x76dddf=_[_0x5d32('0x16')](_0x48e0d9[_0x5d32('0x54')],{'firstName':_0x48e0d9['body'][_0x5d32('0x77')],'ListId':_0x314e6c['id']});_0x76dddf[_0x48e0d9[_0x5d32('0x54')]['mapKey']]=_0x48e0d9[_0x5d32('0x54')]['from'];return db[_0x5d32('0x6e')][_0x5d32('0x53')](_0x76dddf,{'fields':_0x259f18,'raw':!![]});}})[_0x5d32('0x1c')](handleEntityNotFound(_0x185180,null))[_0x5d32('0x1c')](function(_0x4b97d1){if(_0x4b97d1){_0x48e0d9['contact']=_0x4b97d1;var _0x23f96a={'ContactId':_0x4b97d1['id'],'phone':_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')],'SmsAccountId':_0x153993['params']['id']};var _0x2fbde4={'ContactId':_0x4b97d1['id'],'SmsAccountId':_0x153993['params']['id'],'closed':![]};return db[_0x5d32('0x97')][_0x5d32('0x52')]({'where':_0x2fbde4})[_0x5d32('0x1c')](function(_0x403aa2){if(_0x403aa2){return[_0x403aa2,![]];}return db[_0x5d32('0x97')][_0x5d32('0x53')](_0x23f96a)[_0x5d32('0x1c')](function(_0x471734){return[_0x471734,!![]];});});}})['spread'](function(_0x27ceda,_0x563e4f){_0x48e0d9['interaction']=_0x27ceda[_0x5d32('0x31')]({'plain':!![]});_0x48e0d9['interaction'][_0x5d32('0x98')]=![];if(_0x563e4f){if(_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0x99')]){_0x48e0d9[_0x5d32('0x6b')][_0x5d32('0x9a')]({'id':0x0,'priority':_0x48e0d9['applications'][_0x5d32('0x51')]+0x1,'app':_0x5d32('0x9b'),'appdata':_0x5d32('0x9c'),'interval':_0x5d32('0x9d')});}_0x48e0d9[_0x5d32('0x9e')][_0x5d32('0x98')]=!![];}return db['SmsMessage'][_0x5d32('0x53')]({'phone':_0x48e0d9[_0x5d32('0x54')]['from'],'messageId':_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x79')],'body':_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')],'SmsAccountId':_0x153993[_0x5d32('0x4f')]['id'],'SmsInteractionId':_0x27ceda['id'],'direction':'in','ContactId':_0x27ceda[_0x5d32('0x9f')],'AttachmentId':_0x48e0d9[_0x5d32('0x54')][_0x5d32('0xa0')]});})[_0x5d32('0x1c')](function(_0x5472a4){_0x48e0d9[_0x5d32('0x23')]=_0x5472a4;if(!_0x48e0d9[_0x5d32('0x9e')]['UserId'])return;return db[_0x5d32('0xa1')][_0x5d32('0x52')]({'attributes':['id','name'],'where':{'id':_0x48e0d9['interaction'][_0x5d32('0xa2')]}});})[_0x5d32('0x1c')](function(_0x1f566e){if(_0x1f566e){_0x48e0d9[_0x5d32('0x6b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5d32('0xa3'),'appdata':_0x1f566e['name']+','+(_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0xa4')]||0xa),'interval':_0x5d32('0x9d')});}if(!_0x48e0d9[_0x5d32('0x9e')][_0x5d32('0xa5')])return;return db[_0x5d32('0xa6')][_0x5d32('0x52')]({'attributes':['id',_0x5d32('0x33')],'where':{'id':_0x48e0d9[_0x5d32('0x9e')]['queueId']}});})['then'](function(_0x3c0464){if(_0x3c0464){_0x48e0d9['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0x5d32('0xa7'),'appdata':_0x3c0464[_0x5d32('0x33')]+','+(_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0xa8')]||0x12c),'interval':_0x5d32('0x9d')});}return respondWithRpcPromise(_0x5d32('0xa9'),_0x5d32('0xaa'),_0x48e0d9);})['then'](function(_0x1627eb){if(_0x1627eb){var _0x21eabe=0xc8;var _0x4dd266=_0x5d32('0xab');logger[_0x5d32('0x1d')](_0x5d32('0xac'),_0x4dd266,_0x21eabe,_0x5d32('0xad'));logger['debug'](_0x5d32('0xae'),_0x4dd266,_0x21eabe,_0x5d32('0xad'),JSON['stringify'](_0x1627eb));if(_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0x4b')]===_0x5d32('0x76')){return _0x185180[_0x5d32('0x25')](_0x21eabe)[_0x5d32('0xaf')]('Content-Type',_0x5d32('0xb0'))[_0x5d32('0x34')](_0x5d32('0xb1'));}else{return _0x185180[_0x5d32('0x25')](_0x21eabe)[_0x5d32('0x27')](_0x1627eb);}}})[_0x5d32('0x24')](handleError(_0x185180,null));};exports[_0x5d32('0xb2')]=function(_0x33e698,_0x44ed38){var _0x355255=_0x33e698[_0x5d32('0x4f')]['id'];var _0x34f898=_0x33e698[_0x5d32('0x54')];var _0xbf38d7=0xc8;var _0x19fd26=null;return db[_0x5d32('0xb3')][_0x5d32('0xb4')]({'isolationLevel':db[_0x5d32('0xb3')][_0x5d32('0xb5')][_0x5d32('0xb6')]['READ_COMMITTED']},function(_0x1e6a08){return db['SmsAccount'][_0x5d32('0xb7')]({'where':{'id':_0x355255},'transaction':_0x1e6a08})[_0x5d32('0x1c')](function(_0xb320f8){if(_0xb320f8){return db[_0x5d32('0xb8')]['destroy']({'where':{'SmsAccountId':_0x355255},'transaction':_0x1e6a08})[_0x5d32('0x1c')](function(){var _0x3db4e6=_[_0x5d32('0x37')](_0x34f898,function(_0x268732){_0x268732[_0x5d32('0x5f')]=_0x355255;return _0x268732;});return db[_0x5d32('0xb8')][_0x5d32('0xb9')](_0x3db4e6,{'transaction':_0x1e6a08});});}else{_0xbf38d7=0x194;_0x19fd26=[];}});})[_0x5d32('0x1c')](function(){if(_0xbf38d7!==0x194){return db['SmsApplication'][_0x5d32('0xba')]({'where':{'SmsAccountId':_0x355255},'order':_0x5d32('0xbb')})[_0x5d32('0x1c')](function(_0x377850){_0x19fd26=_0x377850;});}})[_0x5d32('0x24')](function(_0x2bae3e){_0xbf38d7=0x1f4;logger[_0x5d32('0x21')](_0x2bae3e[_0x5d32('0xbc')]);if(_0x2bae3e[_0x5d32('0x33')]){delete _0x2bae3e[_0x5d32('0x33')];}_0x19fd26=_0x2bae3e;})[_0x5d32('0xbd')](function(){if(_0x19fd26===null){_0x44ed38[_0x5d32('0xbe')](_0xbf38d7);}else{if(_0xbf38d7===0x1f4){_0x44ed38[_0x5d32('0x25')](_0xbf38d7)['send'](_0x19fd26);}else{_0x44ed38['status'](_0xbf38d7)[_0x5d32('0x27')](_0x19fd26);}}});};exports['getApplications']=function(_0x54bdd3,_0x23a5e5,_0x2f73ca){var _0x5f1627={};var _0x341bee={};var _0x30f56c;var _0x540a22;return db[_0x5d32('0x38')]['findOne']({'where':{'id':_0x54bdd3[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x23a5e5,null))[_0x5d32('0x1c')](function(_0x39ecff){if(_0x39ecff){_0x30f56c=_0x39ecff;_0x341bee[_0x5d32('0x3f')]=_[_0x5d32('0x3c')](db[_0x5d32('0xb8')][_0x5d32('0x39')]);_0x341bee[_0x5d32('0x3d')]=_[_0x5d32('0x3c')](_0x54bdd3[_0x5d32('0x3d')]);_0x341bee[_0x5d32('0x47')]=_[_0x5d32('0x3e')](_0x341bee['model'],_0x341bee[_0x5d32('0x3d')]);_0x5f1627[_0x5d32('0x40')]=_[_0x5d32('0x3e')](_0x341bee['model'],qs['fields'](_0x54bdd3[_0x5d32('0x3d')][_0x5d32('0x41')]));_0x5f1627[_0x5d32('0x40')]=_0x5f1627[_0x5d32('0x40')][_0x5d32('0x51')]?_0x5f1627[_0x5d32('0x40')]:_0x341bee[_0x5d32('0x3f')];_0x5f1627[_0x5d32('0x44')]=qs['sort'](_0x54bdd3[_0x5d32('0x3d')][_0x5d32('0x45')]);_0x5f1627[_0x5d32('0x46')]=qs['filters'](_[_0x5d32('0x48')](_0x54bdd3[_0x5d32('0x3d')],_0x341bee['filters']));if(_0x54bdd3[_0x5d32('0x3d')]['filter']){_0x5f1627[_0x5d32('0x46')]=_[_0x5d32('0x4a')](_0x5f1627[_0x5d32('0x46')],{'$or':_[_0x5d32('0x37')](_0x5f1627[_0x5d32('0x40')],function(_0xaf9826){var _0x46d04f={};_0x46d04f[_0xaf9826]={'$like':'%'+_0x54bdd3[_0x5d32('0x3d')][_0x5d32('0x49')]+'%'};return _0x46d04f;})});}_0x5f1627=_['merge']({},_0x5f1627,_0x54bdd3[_0x5d32('0x4c')]);return _0x30f56c[_0x5d32('0xbf')](_0x5f1627);}})['then'](function(_0x498081){if(_0x498081){_0x540a22=_0x498081[_0x5d32('0x51')];if(!_0x54bdd3['query'][_0x5d32('0x42')](_0x5d32('0x43'))){_0x5f1627[_0x5d32('0x2b')]=qs[_0x5d32('0x2b')](_0x54bdd3[_0x5d32('0x3d')][_0x5d32('0x2b')]);_0x5f1627[_0x5d32('0x28')]=qs[_0x5d32('0x28')](_0x54bdd3[_0x5d32('0x3d')][_0x5d32('0x28')]);}return _0x30f56c[_0x5d32('0xbf')](_0x5f1627);}})[_0x5d32('0x1c')](function(_0x554407){if(_0x554407){return _0x554407?{'count':_0x540a22,'rows':_0x554407}:null;}})[_0x5d32('0x1c')](respondWithResult(_0x23a5e5,null))[_0x5d32('0x24')](handleError(_0x23a5e5,null));};exports[_0x5d32('0xc0')]=function(_0x263b2c,_0x2bee42,_0x33ff7c){var _0x1c0eda={'raw':![],'where':{}};var _0x35a052={};var _0x1cc77b={'count':0x0,'rows':[]};return db[_0x5d32('0x38')]['findOne']({'where':{'id':_0x263b2c[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x2bee42,null))['then'](function(_0x4137b2){if(_0x4137b2){_0x35a052[_0x5d32('0x3f')]=_['keys'](db[_0x5d32('0x97')]['rawAttributes']);_0x35a052['query']=_['keys'](_0x263b2c['query']);_0x35a052[_0x5d32('0x47')]=_['intersection'](_0x35a052[_0x5d32('0x3f')],_0x35a052[_0x5d32('0x3d')]);_0x1c0eda[_0x5d32('0x40')]=_[_0x5d32('0x3e')](_0x35a052[_0x5d32('0x3f')],qs[_0x5d32('0x41')](_0x263b2c[_0x5d32('0x3d')]['fields']));_0x1c0eda[_0x5d32('0x40')]=_0x1c0eda[_0x5d32('0x40')][_0x5d32('0x51')]?_0x1c0eda['attributes']:_0x35a052[_0x5d32('0x3f')];if(!_0x263b2c[_0x5d32('0x3d')]['hasOwnProperty'](_0x5d32('0x43'))){_0x1c0eda[_0x5d32('0x2b')]=qs[_0x5d32('0x2b')](_0x263b2c[_0x5d32('0x3d')][_0x5d32('0x2b')]);_0x1c0eda[_0x5d32('0x28')]=qs['offset'](_0x263b2c[_0x5d32('0x3d')][_0x5d32('0x28')]);}_0x1c0eda[_0x5d32('0x44')]=qs[_0x5d32('0x45')](_0x263b2c[_0x5d32('0x3d')]['sort']);_0x1c0eda[_0x5d32('0x46')]=qs['filters'](_[_0x5d32('0x48')](_0x263b2c[_0x5d32('0x3d')],_0x35a052[_0x5d32('0x47')]));_0x1c0eda[_0x5d32('0x46')]['SmsAccountId']=_0x4137b2['id'];if(_0x263b2c['query'][_0x5d32('0x49')]){_0x1c0eda[_0x5d32('0x46')]=_['merge'](_0x1c0eda['where'],{'$or':_[_0x5d32('0x37')](_0x1c0eda['attributes'],function(_0x15038e){var _0x3be936={};_0x3be936[_0x15038e]={'$like':'%'+_0x263b2c[_0x5d32('0x3d')]['filter']+'%'};return _0x3be936;})});}_0x1c0eda=_['merge']({},_0x1c0eda,_0x263b2c['options']);return db['SmsInteraction']['count']({'where':_0x1c0eda[_0x5d32('0x46')]})[_0x5d32('0x1c')](function(_0x4f3ed0){_0x1cc77b['count']=_0x4f3ed0;if(_0x263b2c[_0x5d32('0x3d')][_0x5d32('0x4d')]){_0x1c0eda[_0x5d32('0x4e')]=[{'model':db[_0x5d32('0x6e')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x5d32('0x33'),_0x5d32('0xc1'),_0x5d32('0xc2')],'required':![]},{'model':db[_0x5d32('0xc3')],'as':'Tags','attributes':['id',_0x5d32('0x33'),_0x5d32('0xc4')],'where':_0x263b2c[_0x5d32('0x3d')][_0x5d32('0xc5')]?{'id':_0x263b2c[_0x5d32('0x3d')]['tag']}:undefined,'required':_0x263b2c['query'][_0x5d32('0xc5')]?!![]:![]}];}return db[_0x5d32('0x97')]['findAll'](_0x1c0eda);})[_0x5d32('0x1c')](function(_0x2ac5fb){_0x1cc77b['rows']=_0x2ac5fb;return _0x1cc77b;});}})['then'](respondWithFilteredResult(_0x2bee42,_0x1c0eda))[_0x5d32('0x24')](handleError(_0x2bee42,null));};exports[_0x5d32('0x34')]=function(_0xbb4298,_0x21057c,_0x71c4a0){var _0x593c5a,_0x22e565,_0x395f9f;if(_['isNil'](_0xbb4298[_0x5d32('0x54')][_0x5d32('0x54')])||_0xbb4298['body'][_0x5d32('0x54')]===''){throw new db[(_0x5d32('0x8d'))][(_0x5d32('0x8e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5d32('0x8c')](_0xbb4298['body']['to'])){throw new db[(_0x5d32('0x8d'))][(_0x5d32('0x8e'))]('to\x20is\x20mandatory');}_0x593c5a=_0xbb4298[_0x5d32('0x54')]['to'];return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0xbb4298[_0x5d32('0x4f')]['id']},'include':[{'model':db[_0x5d32('0x93')],'as':'List','include':[{'model':db[_0x5d32('0x6e')],'as':_0x5d32('0x94'),'where':{'mobile':_0x593c5a},'limit':0x1,'order':[[_0x5d32('0x72'),_0x5d32('0x95')]]}]}]})[_0x5d32('0x1c')](handleEntityNotFound(_0x21057c,null))[_0x5d32('0x1c')](function(_0x393d17){if(_0x393d17&&_0x393d17[_0x5d32('0xc6')]){_0x22e565=_0x393d17['get']({'plain':!![]});if(_0x22e565[_0x5d32('0xc6')]&&_0x22e565['List'][_0x5d32('0x94')]['length']){return _0x22e565[_0x5d32('0xc6')]['Contacts'][0x0];}return db[_0x5d32('0x6e')][_0x5d32('0x53')](_['defaults'](_0xbb4298[_0x5d32('0x54')],{'firstName':_0x593c5a,'mobile':_0x593c5a,'phone':_0x593c5a,'ListId':_0x22e565[_0x5d32('0x74')]}));}})[_0x5d32('0x1c')](handleEntityNotFound(_0x21057c,null))[_0x5d32('0x1c')](function(_0x39d991){if(_0x39d991){_0x395f9f=_0x39d991;return db['SmsInteraction'][_0x5d32('0x52')]({'where':{'ContactId':_0x395f9f['id'],'closed':![],'SmsAccountId':_0x22e565['id']}})[_0x5d32('0x1c')](function(_0x2c7a61){if(_0x2c7a61){return[_0x2c7a61,![]];}return db['SmsInteraction'][_0x5d32('0x53')]({'UserId':_0xbb4298[_0x5d32('0x56')]['id'],'ContactId':_0x395f9f['id'],'SmsAccountId':_0x22e565['id'],'phone':_0x593c5a,'firstMsgDirection':_0x5d32('0xc7'),'Messages':[_[_0x5d32('0x4a')](_0xbb4298[_0x5d32('0x54')],{'read':![],'body':_0xbb4298[_0x5d32('0x54')][_0x5d32('0x54')],'phone':_0x593c5a,'SmsAccountId':_0x22e565['id'],'UserId':_0xbb4298[_0x5d32('0x56')]['id'],'ContactId':_0x395f9f['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x5d32('0xc8')}]})[_0x5d32('0x1c')](function(_0x6b140f){return[_0x6b140f,!![]];});});}})[_0x5d32('0xc9')](function(_0x42a1d1,_0x20f517){if(_0x20f517){return _0x42a1d1;}return db[_0x5d32('0xca')][_0x5d32('0x53')](_[_0x5d32('0x4a')](_0xbb4298[_0x5d32('0x54')],{'read':![],'body':_0xbb4298['body']['body'],'phone':_0x593c5a,'SmsAccountId':_0x22e565['id'],'SmsInteractionId':_0x42a1d1['id'],'UserId':_0xbb4298[_0x5d32('0x56')]['id'],'ContactId':_0x395f9f['id']}))[_0x5d32('0x1c')](function(_0x442201){_0x42a1d1[_0x5d32('0xcb')][_0x5d32('0xc8')]=[];_0x42a1d1['dataValues'][_0x5d32('0xc8')][_0x5d32('0x9a')](_0x442201['dataValues']);return _0x42a1d1;});})[_0x5d32('0x1c')](respondWithResult(_0x21057c,null))[_0x5d32('0x24')](handleError(_0x21057c,null));};exports[_0x5d32('0x25')]=function(_0x45f67f,_0x3f6def,_0x32484f){if(_0x45f67f[_0x5d32('0x54')]['id']){delete _0x45f67f[_0x5d32('0x54')]['id'];}var _0x56a9a0,_0x2fb92f,_0x5d4087;return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x45f67f[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x3f6def,null))[_0x5d32('0x1c')](function(_0x4932d3){if(_0x4932d3){_0x5d4087=_0x4932d3;logger[_0x5d32('0xcc')](_0x5d32('0xac'),_0x5d32('0x25'),_0x5d32('0xcd'),_0x4932d3[_0x5d32('0x4b')],util[_0x5d32('0xce')](_0x45f67f[_0x5d32('0x54')],{'showHidden':![],'depth':null}));switch(_0x4932d3[_0x5d32('0x4b')]){case _0x5d32('0x7b'):if(_0x45f67f[_0x5d32('0x54')]['skebby_dispatch_id']&&_0x45f67f['body'][_0x5d32('0x25')]){_0x2fb92f=_0x45f67f[_0x5d32('0x54')][_0x5d32('0x25')];return db[_0x5d32('0xca')][_0x5d32('0x52')]({'where':{'messageId':_0x45f67f[_0x5d32('0x54')][_0x5d32('0xcf')]}});}break;case _0x5d32('0x7c'):if(_0x45f67f[_0x5d32('0x54')][_0x5d32('0xd0')]&&_0x45f67f['body'][_0x5d32('0xd1')]){_0x2fb92f=_0x45f67f['body'][_0x5d32('0xd1')];return db[_0x5d32('0xca')][_0x5d32('0x52')]({'where':{'messageId':_0x45f67f[_0x5d32('0x54')][_0x5d32('0xd0')]}});}break;case _0x5d32('0x7d'):if(_0x45f67f[_0x5d32('0x54')]['message_id']&&_0x45f67f['body'][_0x5d32('0xd2')]){_0x2fb92f=_0x45f67f[_0x5d32('0x54')][_0x5d32('0xd2')];return db[_0x5d32('0xca')][_0x5d32('0x52')]({'where':{'messageId':_0x45f67f[_0x5d32('0x54')][_0x5d32('0x7e')]}});}break;case'infobip':var _0xc403be=_0x45f67f[_0x5d32('0x54')]['results'][0x0];if(_0xc403be[_0x5d32('0x79')]&&_0xc403be[_0x5d32('0x25')][_0x5d32('0xd3')]===_0x5d32('0xd4')){_0x2fb92f=_0xc403be[_0x5d32('0x25')][_0x5d32('0xd3')];return db[_0x5d32('0xca')][_0x5d32('0x52')]({'where':{'messageId':_0xc403be['messageId']}});}break;case _0x5d32('0x86'):if(_0x45f67f['body'][_0x5d32('0x79')]&&_0x45f67f[_0x5d32('0x54')]['status']){_0x2fb92f=_0x45f67f['body']['status'];return db[_0x5d32('0xca')]['find']({'where':{'messageId':_0x45f67f[_0x5d32('0x54')][_0x5d32('0x79')]}});}break;case _0x5d32('0x89'):if(_0x45f67f[_0x5d32('0x54')][0x0]['message']['id']){_0x2fb92f=_0x45f67f['body'][0x0][_0x5d32('0x4b')];return db['SmsMessage'][_0x5d32('0x52')]({'where':{'messageId':_0x45f67f[_0x5d32('0x54')][0x0]['message']['id']}});}break;case _0x5d32('0x8b'):if(_0x45f67f['body'][_0x5d32('0xd5')]&&_0x45f67f[_0x5d32('0x54')][_0x5d32('0x25')]){_0x2fb92f=_0x45f67f['body']['status'];return db[_0x5d32('0xca')][_0x5d32('0x52')]({'where':{'messageId':_0x45f67f['body']['redif']}});}break;}}})[_0x5d32('0x1c')](handleEntityNotFound(_0x3f6def,null))[_0x5d32('0x1c')](function(_0x4426a1){if(_0x4426a1){_0x56a9a0=_0x4426a1;switch(_0x5d4087[_0x5d32('0x4b')]){case _0x5d32('0x7b'):if(_0x2fb92f==='DELIVERED'){return _0x56a9a0[_0x5d32('0x5c')]({'read':!![]});}else{logger[_0x5d32('0x21')](_0x5d32('0xac'),_0x5d32('0x25'),_0x5d32('0x7b'),util[_0x5d32('0xce')](_0x45f67f['body'],{'showHidden':![],'depth':null}));}break;case _0x5d32('0x7c'):if(_0x2fb92f==='1'){return _0x56a9a0[_0x5d32('0x5c')]({'read':!![]});}else{logger[_0x5d32('0x21')](_0x5d32('0xac'),_0x5d32('0x25'),'skebby',util[_0x5d32('0xce')](_0x45f67f[_0x5d32('0x54')],{'showHidden':![],'depth':null}));}break;case _0x5d32('0x7d'):if(!_0x45f67f['body'][_0x5d32('0xd6')]&&_0x2fb92f>=0xc8&&_0x2fb92f<=0xce){return _0x56a9a0['update']({'read':!![]});}else{logger['error'](_0x5d32('0xac'),_0x5d32('0x25'),_0x5d32('0x7d'),util[_0x5d32('0xce')](_0x45f67f[_0x5d32('0x54')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x457cb0=_0x45f67f['body']['results'][0x0];if(_0x457cb0[_0x5d32('0x25')]['groupName']===_0x5d32('0xd4')){return _0x56a9a0[_0x5d32('0x5c')]({'read':!![]});}else{logger['error'](_0x5d32('0xac'),'status','infobip',util['inspect'](_0x45f67f['body'],{'showHidden':![],'depth':null}));}break;case _0x5d32('0x86'):if(_0x2fb92f=='DELIVERED_TO_GATEWAY'||_0x2fb92f==_0x5d32('0xd7')){return _0x56a9a0[_0x5d32('0x5c')]({'read':!![]});}else{logger[_0x5d32('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5d32('0x25'),'clickatell',util[_0x5d32('0xce')](_0x45f67f[_0x5d32('0x54')],{'showHidden':![],'depth':null}));}break;case _0x5d32('0x89'):if(_0x2fb92f==_0x5d32('0xd8')){return _0x56a9a0[_0x5d32('0x5c')]({'read':!![]});}else{logger['error'](_0x5d32('0xac'),_0x5d32('0x25'),_0x5d32('0x89'),util[_0x5d32('0xce')](_0x45f67f[_0x5d32('0x54')],{'showHidden':![],'depth':null}));}break;case _0x5d32('0x8b'):if(_0x2fb92f===_0x5d32('0xd9')||_0x2fb92f===_0x5d32('0xda')){return _0x56a9a0[_0x5d32('0x5c')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5d32('0x8b'),util['inspect'](_0x45f67f[_0x5d32('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x56a9a0;}})['then'](respondWithResult(_0x3f6def,null))[_0x5d32('0x24')](handleError(_0x3f6def,null));};exports[_0x5d32('0xdb')]=function(_0x3f55ef,_0x5eb5ee,_0x502885){var _0x248671,_0x191a09,_0x3273f7;return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x3f55ef[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x5eb5ee,null))['then'](function(_0x24f492){if(_0x24f492){_0x3273f7=_0x24f492;logger[_0x5d32('0xcc')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5d32('0xcd'),_0x24f492[_0x5d32('0x4b')],util[_0x5d32('0xce')](_0x3f55ef[_0x5d32('0x3d')],{'showHidden':![],'depth':null}));switch(_0x24f492[_0x5d32('0x4b')]){case _0x5d32('0xdc'):if(_0x3f55ef[_0x5d32('0x3d')]['message-id']&&_0x3f55ef[_0x5d32('0x3d')][_0x5d32('0xdd')]){_0x191a09=_0x3f55ef[_0x5d32('0x3d')]['state'];return db[_0x5d32('0xca')][_0x5d32('0x52')]({'where':{'messageId':_0x3f55ef[_0x5d32('0x3d')][_0x5d32('0xde')]}});}break;}}})[_0x5d32('0x1c')](handleEntityNotFound(_0x5eb5ee,null))[_0x5d32('0x1c')](function(_0x597d97){if(_0x597d97){_0x248671=_0x597d97;switch(_0x3273f7['type']){case'csc':if(_0x191a09==='2'||_0x191a09==='6'){return _0x248671[_0x5d32('0x5c')]({'read':!![]});}else{logger[_0x5d32('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5d32('0xdc'),util[_0x5d32('0xce')](_0x3f55ef[_0x5d32('0x3d')],{'showHidden':![],'depth':null}));};break;}return _0x248671;}})['then'](respondWithResult(_0x5eb5ee,null))[_0x5d32('0x24')](handleError(_0x5eb5ee,null));};exports[_0x5d32('0xdf')]=function(_0x1a3de9,_0xb99668,_0x3397b0){return db[_0x5d32('0x38')]['find']({'where':{'id':_0x1a3de9[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0xb99668,null))[_0x5d32('0x1c')](function(_0x373df4){if(_0x373df4){return _0x373df4['addAgents'](_0x1a3de9[_0x5d32('0x54')][_0x5d32('0x64')],_[_0x5d32('0x96')](_0x1a3de9['body'],[_0x5d32('0x64'),'id'])||{})['spread'](function(_0x3e0764){for(var _0xd1f981=0x0;_0xd1f981<_0x1a3de9['body'][_0x5d32('0x64')][_0x5d32('0x51')];_0xd1f981+=0x1){socket[_0x5d32('0xe0')](_0x5d32('0xe1'),{'UserId':Number(_0x1a3de9[_0x5d32('0x54')][_0x5d32('0x64')][_0xd1f981]),'SmsAccountId':Number(_0x1a3de9[_0x5d32('0x4f')]['id'])});}return _0x3e0764;});}})['then'](respondWithResult(_0xb99668,null))[_0x5d32('0x24')](handleError(_0xb99668,null));};exports[_0x5d32('0xe2')]=function(_0x2d3270,_0x4e4b56,_0x3ceeaa){return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x2d3270['params']['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x4e4b56,null))['then'](function(_0x1d8ae2){if(_0x1d8ae2){return _0x1d8ae2[_0x5d32('0xe2')](_0x2d3270[_0x5d32('0x3d')][_0x5d32('0x64')])[_0x5d32('0x1c')](function(){if(_['isArray'](_0x2d3270['query']['ids'])){for(var _0x587e3a=0x0;_0x587e3a<_0x2d3270['query'][_0x5d32('0x64')][_0x5d32('0x51')];_0x587e3a+=0x1){socket[_0x5d32('0xe0')](_0x5d32('0xe3'),{'UserId':Number(_0x2d3270[_0x5d32('0x3d')][_0x5d32('0x64')][_0x587e3a]),'SmsAccountId':Number(_0x2d3270[_0x5d32('0x4f')]['id'])});}}else{socket[_0x5d32('0xe0')]('userSmsAccount:remove',{'UserId':Number(_0x2d3270[_0x5d32('0x3d')]['ids']),'SmsAccountId':Number(_0x2d3270['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4e4b56,null))['catch'](handleError(_0x4e4b56,null));};exports[_0x5d32('0xe4')]=function(_0x37a557,_0x5ddbc1,_0x1223d6){var _0x27c6bd={};var _0x1965c9={};var _0x2ef015;var _0x5024e4;return db[_0x5d32('0x38')][_0x5d32('0xb7')]({'where':{'id':_0x37a557[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x5ddbc1,null))[_0x5d32('0x1c')](function(_0x36d091){if(_0x36d091){_0x2ef015=_0x36d091;_0x1965c9[_0x5d32('0x3f')]=_[_0x5d32('0x3c')](db['User'][_0x5d32('0x39')]);_0x1965c9[_0x5d32('0x3d')]=_[_0x5d32('0x3c')](_0x37a557[_0x5d32('0x3d')]);_0x1965c9[_0x5d32('0x47')]=_[_0x5d32('0x3e')](_0x1965c9['model'],_0x1965c9['query']);_0x27c6bd['attributes']=_['intersection'](_0x1965c9[_0x5d32('0x3f')],qs['fields'](_0x37a557[_0x5d32('0x3d')]['fields']));_0x27c6bd['attributes']=_0x27c6bd[_0x5d32('0x40')]['length']?_0x27c6bd[_0x5d32('0x40')]:_0x1965c9[_0x5d32('0x3f')];_0x27c6bd[_0x5d32('0x44')]=qs[_0x5d32('0x45')](_0x37a557[_0x5d32('0x3d')][_0x5d32('0x45')]);_0x27c6bd[_0x5d32('0x46')]=qs[_0x5d32('0x47')](_[_0x5d32('0x48')](_0x37a557[_0x5d32('0x3d')],_0x1965c9[_0x5d32('0x47')]));if(_0x37a557[_0x5d32('0x3d')][_0x5d32('0x49')]){_0x27c6bd[_0x5d32('0x46')]=_[_0x5d32('0x4a')](_0x27c6bd[_0x5d32('0x46')],{'$or':_['map'](_0x27c6bd['attributes'],function(_0x35cb19){var _0x29cf5a={};_0x29cf5a[_0x35cb19]={'$like':'%'+_0x37a557['query'][_0x5d32('0x49')]+'%'};return _0x29cf5a;})});}_0x27c6bd=_[_0x5d32('0x4a')]({},_0x27c6bd,_0x37a557[_0x5d32('0x4c')]);return _0x2ef015[_0x5d32('0xe4')](_0x27c6bd);}})[_0x5d32('0x1c')](function(_0x87908){if(_0x87908){_0x5024e4=_0x87908['length'];if(!_0x37a557['query']['hasOwnProperty'](_0x5d32('0x43'))){_0x27c6bd[_0x5d32('0x2b')]=qs[_0x5d32('0x2b')](_0x37a557['query']['limit']);_0x27c6bd[_0x5d32('0x28')]=qs[_0x5d32('0x28')](_0x37a557[_0x5d32('0x3d')][_0x5d32('0x28')]);}return _0x2ef015[_0x5d32('0xe4')](_0x27c6bd);}})[_0x5d32('0x1c')](function(_0x55c4b3){if(_0x55c4b3){return _0x55c4b3?{'count':_0x5024e4,'rows':_0x55c4b3}:null;}})[_0x5d32('0x1c')](respondWithResult(_0x5ddbc1,null))[_0x5d32('0x24')](handleError(_0x5ddbc1,null));}; \ No newline at end of file +var _0xb5c5=['from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','queueId','SmsQueue','queue','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','set','Content-Type','text/xml','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','finally','getApplications','hasOwnProperty','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','user','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','statusInt','requestid','message_id','status_code','infobip','groupName','DELIVERED','intelepeer','redif','inspect','clicksend','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','sendStatus','end','status','offset','limit','count','json','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','params','length','includeAll','find','create','body','role','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','SmsAccountId','Disposition','getDispositions','nolimit','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','notify','sms','Applications','account','applications','priority','asc','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','From','Body','messageId','MessageSid','skebby','sender','connectel','from','plivo','Text','MessageUUID','results','text','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','isNil','Sequelize','ValidationError'];(function(_0x3575ed,_0x3294bb){var _0x36cb29=function(_0x346b66){while(--_0x346b66){_0x3575ed['push'](_0x3575ed['shift']());}};_0x36cb29(++_0x3294bb);}(_0xb5c5,0x148));var _0x5b5c=function(_0x569e14,_0x3ad7f2){_0x569e14=_0x569e14-0x0;var _0x17500c=_0xb5c5[_0x569e14];return _0x17500c;};'use strict';var emlformat=require(_0x5b5c('0x0'));var rimraf=require(_0x5b5c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5b5c('0x2'));var moment=require(_0x5b5c('0x3'));var BPromise=require(_0x5b5c('0x4'));var Mustache=require(_0x5b5c('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5b5c('0x6'));var csv=require(_0x5b5c('0x7'));var ejs=require(_0x5b5c('0x8'));var fs=require('fs');var fs_extra=require(_0x5b5c('0x9'));var _=require(_0x5b5c('0xa'));var squel=require(_0x5b5c('0xb'));var crypto=require('crypto');var jsforce=require(_0x5b5c('0xc'));var deskjs=require(_0x5b5c('0xd'));var toCsv=require(_0x5b5c('0x7'));var querystring=require(_0x5b5c('0xe'));var Papa=require(_0x5b5c('0xf'));var Redis=require('ioredis');var authService=require(_0x5b5c('0x10'));var qs=require(_0x5b5c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b5c('0x12'));var logger=require(_0x5b5c('0x13'))(_0x5b5c('0x14'));var utils=require('../../config/utils');var config=require(_0x5b5c('0x15'));var licenseUtil=require(_0x5b5c('0x16'));var db=require(_0x5b5c('0x17'))['db'];config[_0x5b5c('0x18')]=_[_0x5b5c('0x19')](config[_0x5b5c('0x18')],{'host':_0x5b5c('0x1a'),'port':0x18eb});var socket=require(_0x5b5c('0x1b'))(new Redis(config[_0x5b5c('0x18')]));require(_0x5b5c('0x1c'))[_0x5b5c('0x1d')](socket);var jayson=require(_0x5b5c('0x1e'));var client=jayson[_0x5b5c('0x1f')][_0x5b5c('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x4114f1,_0xa8563e,_0x65d071,_0x367375){return new BPromise(function(_0x5270d1,_0x4e92cd){var _0x2a9264=_0x367375||client;return _0x2a9264[_0x5b5c('0x21')](_0x4114f1,_0x65d071)[_0x5b5c('0x22')](function(_0x56f3e0){logger[_0x5b5c('0x23')](_0x5b5c('0x24'),_0xa8563e,'request\x20sent');logger[_0x5b5c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa8563e,_0x5b5c('0x26'),JSON['stringify'](_0x56f3e0));if(_0x56f3e0[_0x5b5c('0x27')]){if(_0x56f3e0[_0x5b5c('0x27')][_0x5b5c('0x28')]===0x1f4){logger[_0x5b5c('0x27')](_0x5b5c('0x24'),_0xa8563e,_0x56f3e0[_0x5b5c('0x27')][_0x5b5c('0x29')]);return _0x4e92cd(_0x56f3e0[_0x5b5c('0x27')][_0x5b5c('0x29')]);}logger[_0x5b5c('0x27')](_0x5b5c('0x24'),_0xa8563e,_0x56f3e0['error'][_0x5b5c('0x29')]);return _0x5270d1(_0x56f3e0['error'][_0x5b5c('0x29')]);}else{logger['info'](_0x5b5c('0x24'),_0xa8563e,_0x5b5c('0x26'));_0x5270d1(_0x56f3e0[_0x5b5c('0x2a')][_0x5b5c('0x29')]);}})[_0x5b5c('0x2b')](function(_0x3d7816){logger[_0x5b5c('0x27')](_0x5b5c('0x24'),_0xa8563e,_0x3d7816);_0x4e92cd(_0x3d7816);});});}function respondWithStatusCode(_0xdfd705,_0x43219d){_0x43219d=_0x43219d||0xcc;return function(_0x1a017a){if(_0x1a017a){return _0xdfd705[_0x5b5c('0x2c')](_0x43219d);}return _0xdfd705['status'](_0x43219d)[_0x5b5c('0x2d')]();};}function respondWithResult(_0x2483de,_0x56508b){_0x56508b=_0x56508b||0xc8;return function(_0x51f7c6){if(_0x51f7c6){return _0x2483de[_0x5b5c('0x2e')](_0x56508b)['json'](_0x51f7c6);}};}function respondWithFilteredResult(_0x54d73e,_0x358161){return function(_0x118080){if(_0x118080){var _0x2dd1ba=typeof _0x358161[_0x5b5c('0x2f')]==='undefined'&&typeof _0x358161[_0x5b5c('0x30')]==='undefined';var _0x543122=_0x118080[_0x5b5c('0x31')];var _0x59e480=_0x2dd1ba?0x0:_0x358161[_0x5b5c('0x2f')];var _0x100d4c=_0x2dd1ba?_0x118080[_0x5b5c('0x31')]:_0x358161[_0x5b5c('0x2f')]+_0x358161[_0x5b5c('0x30')];var _0x5952b8;if(_0x100d4c>=_0x543122){_0x100d4c=_0x543122;_0x5952b8=0xc8;}else{_0x5952b8=0xce;}_0x54d73e[_0x5b5c('0x2e')](_0x5952b8);return _0x54d73e['set']('Content-Range',_0x59e480+'-'+_0x100d4c+'/'+_0x543122)[_0x5b5c('0x32')](_0x118080);}return null;};}function patchUpdates(_0x318c03){return function(_0x3d8c4f){try{jsonpatch[_0x5b5c('0x33')](_0x3d8c4f,_0x318c03,!![]);}catch(_0x4686ff){return BPromise[_0x5b5c('0x34')](_0x4686ff);}return _0x3d8c4f[_0x5b5c('0x35')]();};}function saveUpdates(_0x4417a9,_0x46f434){return function(_0x82b835){if(_0x82b835){return _0x82b835[_0x5b5c('0x36')](_0x4417a9)['then'](function(_0x11b2da){return _0x11b2da;});}return null;};}function removeEntity(_0x381508,_0x3a3b00){return function(_0xe423a5){if(_0xe423a5){return _0xe423a5[_0x5b5c('0x37')]()[_0x5b5c('0x22')](function(){var _0x4a1e62=_0xe423a5[_0x5b5c('0x38')]({'plain':!![]});var _0x48b26b='SmsAccounts';return db[_0x5b5c('0x39')][_0x5b5c('0x37')]({'where':{'type':_0x48b26b,'resourceId':_0x4a1e62['id']}})[_0x5b5c('0x22')](function(){return _0xe423a5;});})[_0x5b5c('0x22')](function(){_0x381508['status'](0xcc)[_0x5b5c('0x2d')]();});}};}function handleEntityNotFound(_0x2b4eb6,_0x190423){return function(_0x2aa70c){if(!_0x2aa70c){_0x2b4eb6['sendStatus'](0x194);}return _0x2aa70c;};}function handleError(_0x4616b3,_0x4094a9){_0x4094a9=_0x4094a9||0x1f4;return function(_0x51086f){logger[_0x5b5c('0x27')](_0x51086f[_0x5b5c('0x3a')]);if(_0x51086f[_0x5b5c('0x3b')]){delete _0x51086f[_0x5b5c('0x3b')];}_0x4616b3[_0x5b5c('0x2e')](_0x4094a9)[_0x5b5c('0x3c')](_0x51086f);};}exports['index']=function(_0x156826,_0x8c483e){var _0x326bd4={'include':[{'model':db[_0x5b5c('0x3d')],'as':'mandatoryDispositionPause'}]},_0x344a40={},_0x509b06={'count':0x0,'rows':[]};var _0x4244e3=_[_0x5b5c('0x3e')](db[_0x5b5c('0x3f')][_0x5b5c('0x40')],function(_0x15ed20){return{'name':_0x15ed20[_0x5b5c('0x41')],'type':_0x15ed20[_0x5b5c('0x42')][_0x5b5c('0x43')]};});_0x344a40[_0x5b5c('0x44')]=_[_0x5b5c('0x3e')](_0x4244e3,'name');_0x344a40['query']=_[_0x5b5c('0x45')](_0x156826[_0x5b5c('0x46')]);_0x344a40[_0x5b5c('0x47')]=_[_0x5b5c('0x48')](_0x344a40['model'],_0x344a40[_0x5b5c('0x46')]);_0x326bd4[_0x5b5c('0x49')]=_['intersection'](_0x344a40[_0x5b5c('0x44')],qs[_0x5b5c('0x4a')](_0x156826[_0x5b5c('0x46')][_0x5b5c('0x4a')]));_0x326bd4['attributes']=_0x326bd4['attributes']['length']?_0x326bd4[_0x5b5c('0x49')]:_0x344a40[_0x5b5c('0x44')];if(!_0x156826[_0x5b5c('0x46')]['hasOwnProperty']('nolimit')){_0x326bd4[_0x5b5c('0x30')]=qs[_0x5b5c('0x30')](_0x156826[_0x5b5c('0x46')][_0x5b5c('0x30')]);_0x326bd4[_0x5b5c('0x2f')]=qs[_0x5b5c('0x2f')](_0x156826[_0x5b5c('0x46')][_0x5b5c('0x2f')]);}_0x326bd4[_0x5b5c('0x4b')]=qs[_0x5b5c('0x4c')](_0x156826[_0x5b5c('0x46')][_0x5b5c('0x4c')]);_0x326bd4[_0x5b5c('0x4d')]=qs['filters'](_[_0x5b5c('0x4e')](_0x156826[_0x5b5c('0x46')],_0x344a40['filters']),_0x4244e3);if(_0x156826[_0x5b5c('0x46')][_0x5b5c('0x4f')]){_0x326bd4[_0x5b5c('0x4d')]=_['merge'](_0x326bd4[_0x5b5c('0x4d')],{'$or':_[_0x5b5c('0x3e')](_0x4244e3,function(_0x3e526f){if(_0x3e526f[_0x5b5c('0x42')]!==_0x5b5c('0x50')){var _0x1ca804={};_0x1ca804[_0x3e526f[_0x5b5c('0x3b')]]={'$like':'%'+_0x156826[_0x5b5c('0x46')][_0x5b5c('0x4f')]+'%'};return _0x1ca804;}})});}_0x326bd4=_[_0x5b5c('0x51')]({},_0x326bd4,_0x156826[_0x5b5c('0x52')]);var _0x301e2a={'where':_0x326bd4[_0x5b5c('0x4d')]};return db[_0x5b5c('0x3f')][_0x5b5c('0x31')](_0x301e2a)['then'](function(_0x2a5cad){_0x509b06['count']=_0x2a5cad;if(_0x156826[_0x5b5c('0x46')]['includeAll']){_0x326bd4[_0x5b5c('0x53')]=[{'all':!![]}];}return db['SmsAccount'][_0x5b5c('0x54')](_0x326bd4);})[_0x5b5c('0x22')](function(_0x18c4b4){_0x509b06[_0x5b5c('0x55')]=_0x18c4b4;return _0x509b06;})[_0x5b5c('0x22')](respondWithFilteredResult(_0x8c483e,_0x326bd4))[_0x5b5c('0x2b')](handleError(_0x8c483e,null));};exports['show']=function(_0x1a168c,_0x5279a9){var _0x3a70c8={'raw':![],'where':{'id':_0x1a168c[_0x5b5c('0x56')]['id']},'include':[{'model':db[_0x5b5c('0x3d')],'as':'mandatoryDispositionPause'}]},_0xff8bff={};_0xff8bff[_0x5b5c('0x44')]=_[_0x5b5c('0x45')](db[_0x5b5c('0x3f')][_0x5b5c('0x40')]);_0xff8bff[_0x5b5c('0x46')]=_[_0x5b5c('0x45')](_0x1a168c[_0x5b5c('0x46')]);_0xff8bff['filters']=_[_0x5b5c('0x48')](_0xff8bff[_0x5b5c('0x44')],_0xff8bff[_0x5b5c('0x46')]);_0x3a70c8[_0x5b5c('0x49')]=_[_0x5b5c('0x48')](_0xff8bff[_0x5b5c('0x44')],qs[_0x5b5c('0x4a')](_0x1a168c[_0x5b5c('0x46')][_0x5b5c('0x4a')]));_0x3a70c8['attributes']=_0x3a70c8[_0x5b5c('0x49')][_0x5b5c('0x57')]?_0x3a70c8[_0x5b5c('0x49')]:_0xff8bff[_0x5b5c('0x44')];if(_0x1a168c['query'][_0x5b5c('0x58')]){_0x3a70c8[_0x5b5c('0x53')]=[{'all':!![]}];}_0x3a70c8=_[_0x5b5c('0x51')]({},_0x3a70c8,_0x1a168c['options']);return db[_0x5b5c('0x3f')][_0x5b5c('0x59')](_0x3a70c8)[_0x5b5c('0x22')](handleEntityNotFound(_0x5279a9,null))[_0x5b5c('0x22')](respondWithResult(_0x5279a9,null))[_0x5b5c('0x2b')](handleError(_0x5279a9,null));};exports[_0x5b5c('0x5a')]=function(_0x3e6a8d,_0x1c2586){return db['SmsAccount']['create'](_0x3e6a8d[_0x5b5c('0x5b')],{})[_0x5b5c('0x22')](function(_0x64dcf0){var _0x4bc1d9=_0x3e6a8d['user']['get']({'plain':!![]});if(!_0x4bc1d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bc1d9[_0x5b5c('0x5c')]==='user'){var _0x4ed435=_0x64dcf0[_0x5b5c('0x38')]({'plain':!![]});var _0x3c93f9=_0x5b5c('0x5d');return db[_0x5b5c('0x5e')][_0x5b5c('0x59')]({'where':{'name':_0x3c93f9,'userProfileId':_0x4bc1d9[_0x5b5c('0x5f')]},'raw':!![]})['then'](function(_0x503738){if(_0x503738&&_0x503738[_0x5b5c('0x60')]===0x0){return db[_0x5b5c('0x39')]['create']({'name':_0x4ed435[_0x5b5c('0x3b')],'resourceId':_0x4ed435['id'],'type':_0x503738[_0x5b5c('0x3b')],'sectionId':_0x503738['id']},{})[_0x5b5c('0x22')](function(){return _0x64dcf0;});}else{return _0x64dcf0;}})[_0x5b5c('0x2b')](function(_0x31b17e){logger[_0x5b5c('0x27')](_0x5b5c('0x61'),_0x31b17e);throw _0x31b17e;});}return _0x64dcf0;})[_0x5b5c('0x22')](respondWithResult(_0x1c2586,0xc9))[_0x5b5c('0x2b')](handleError(_0x1c2586,null));};exports[_0x5b5c('0x36')]=function(_0x357446,_0x30ea13){if(_0x357446[_0x5b5c('0x5b')]['id']){delete _0x357446[_0x5b5c('0x5b')]['id'];}return db[_0x5b5c('0x3f')]['find']({'where':{'id':_0x357446[_0x5b5c('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x5b5c('0x62')}]})['then'](handleEntityNotFound(_0x30ea13,null))[_0x5b5c('0x22')](saveUpdates(_0x357446[_0x5b5c('0x5b')],null))['then'](respondWithResult(_0x30ea13,null))[_0x5b5c('0x2b')](handleError(_0x30ea13,null));};exports[_0x5b5c('0x37')]=function(_0x51a566,_0x5ae0ad){return db[_0x5b5c('0x3f')][_0x5b5c('0x59')]({'where':{'id':_0x51a566[_0x5b5c('0x56')]['id']}})[_0x5b5c('0x22')](handleEntityNotFound(_0x5ae0ad,null))[_0x5b5c('0x22')](removeEntity(_0x5ae0ad,null))[_0x5b5c('0x2b')](handleError(_0x5ae0ad,null));};exports[_0x5b5c('0x63')]=function(_0x2bdc5f,_0x22918a){return db[_0x5b5c('0x3f')][_0x5b5c('0x63')]()[_0x5b5c('0x22')](respondWithResult(_0x22918a,null))[_0x5b5c('0x2b')](handleError(_0x22918a,null));};exports['addDisposition']=function(_0x324e52,_0x251aa2,_0x36547d){if(_0x324e52[_0x5b5c('0x5b')]['id']){delete _0x324e52[_0x5b5c('0x5b')]['id'];}return db[_0x5b5c('0x3f')]['find']({'where':{'id':_0x324e52[_0x5b5c('0x56')]['id']}})['then'](handleEntityNotFound(_0x251aa2,null))[_0x5b5c('0x22')](function(_0x38ed6d){if(_0x38ed6d){_0x324e52[_0x5b5c('0x5b')][_0x5b5c('0x64')]=_0x38ed6d['id'];return db[_0x5b5c('0x65')][_0x5b5c('0x5a')](_0x324e52[_0x5b5c('0x5b')]);}})[_0x5b5c('0x22')](respondWithResult(_0x251aa2,null))['catch'](handleError(_0x251aa2,null));};exports[_0x5b5c('0x66')]=function(_0x13e7bd,_0xe09158,_0x4a5af7){var _0x2822cc={'raw':![],'where':{}};var _0x21bea0={};var _0x5c93a9={'count':0x0,'rows':[]};return db[_0x5b5c('0x3f')]['findOne']({'where':{'id':_0x13e7bd[_0x5b5c('0x56')]['id']}})[_0x5b5c('0x22')](handleEntityNotFound(_0xe09158,null))[_0x5b5c('0x22')](function(_0x4293a1){if(_0x4293a1){_0x21bea0[_0x5b5c('0x44')]=_[_0x5b5c('0x45')](db[_0x5b5c('0x65')][_0x5b5c('0x40')]);_0x21bea0[_0x5b5c('0x46')]=_[_0x5b5c('0x45')](_0x13e7bd[_0x5b5c('0x46')]);_0x21bea0[_0x5b5c('0x47')]=_['intersection'](_0x21bea0['model'],_0x21bea0[_0x5b5c('0x46')]);_0x2822cc[_0x5b5c('0x49')]=_[_0x5b5c('0x48')](_0x21bea0[_0x5b5c('0x44')],qs[_0x5b5c('0x4a')](_0x13e7bd[_0x5b5c('0x46')][_0x5b5c('0x4a')]));_0x2822cc['attributes']=_0x2822cc[_0x5b5c('0x49')][_0x5b5c('0x57')]?_0x2822cc[_0x5b5c('0x49')]:_0x21bea0['model'];if(!_0x13e7bd[_0x5b5c('0x46')]['hasOwnProperty'](_0x5b5c('0x67'))){_0x2822cc[_0x5b5c('0x30')]=qs[_0x5b5c('0x30')](_0x13e7bd[_0x5b5c('0x46')][_0x5b5c('0x30')]);_0x2822cc['offset']=qs[_0x5b5c('0x2f')](_0x13e7bd[_0x5b5c('0x46')]['offset']);}_0x2822cc['order']=qs[_0x5b5c('0x4c')](_0x13e7bd[_0x5b5c('0x46')][_0x5b5c('0x4c')]);_0x2822cc[_0x5b5c('0x4d')]=qs[_0x5b5c('0x47')](_[_0x5b5c('0x4e')](_0x13e7bd[_0x5b5c('0x46')],_0x21bea0[_0x5b5c('0x47')]));_0x2822cc[_0x5b5c('0x4d')][_0x5b5c('0x64')]=_0x4293a1['id'];if(_0x13e7bd['query'][_0x5b5c('0x4f')]){_0x2822cc[_0x5b5c('0x4d')]=_[_0x5b5c('0x51')](_0x2822cc[_0x5b5c('0x4d')],{'$or':_[_0x5b5c('0x3e')](_0x2822cc['attributes'],function(_0x2434be){var _0x399064={};_0x399064[_0x2434be]={'$like':'%'+_0x13e7bd['query'][_0x5b5c('0x4f')]+'%'};return _0x399064;})});}_0x2822cc=_[_0x5b5c('0x51')]({},_0x2822cc,_0x13e7bd[_0x5b5c('0x52')]);return db[_0x5b5c('0x65')][_0x5b5c('0x31')]({'where':_0x2822cc['where']})[_0x5b5c('0x22')](function(_0xeee8d){_0x5c93a9[_0x5b5c('0x31')]=_0xeee8d;if(_0x13e7bd[_0x5b5c('0x46')][_0x5b5c('0x58')]){_0x2822cc[_0x5b5c('0x53')]=[{'all':!![]}];}return db[_0x5b5c('0x65')][_0x5b5c('0x54')](_0x2822cc);})[_0x5b5c('0x22')](function(_0x1da033){_0x5c93a9['rows']=_0x1da033;return _0x5c93a9;});}})[_0x5b5c('0x22')](respondWithFilteredResult(_0xe09158,_0x2822cc))[_0x5b5c('0x2b')](handleError(_0xe09158,null));};exports[_0x5b5c('0x68')]=function(_0x4b7a62,_0x2413c0,_0x35d7a0){return db[_0x5b5c('0x3f')][_0x5b5c('0x59')]({'where':{'id':_0x4b7a62[_0x5b5c('0x56')]['id']}})[_0x5b5c('0x22')](handleEntityNotFound(_0x2413c0,null))[_0x5b5c('0x22')](function(_0x546f6f){if(_0x546f6f){return _0x546f6f['removeDispositions'](_0x4b7a62[_0x5b5c('0x46')][_0x5b5c('0x69')]);}})['then'](respondWithStatusCode(_0x2413c0,null))[_0x5b5c('0x2b')](handleError(_0x2413c0,null));};exports[_0x5b5c('0x6a')]=function(_0x2130f7,_0x1f2cbd,_0x511714){if(_0x2130f7[_0x5b5c('0x5b')]['id']){delete _0x2130f7[_0x5b5c('0x5b')]['id'];}return db['SmsAccount'][_0x5b5c('0x59')]({'where':{'id':_0x2130f7['params']['id']}})[_0x5b5c('0x22')](handleEntityNotFound(_0x1f2cbd,null))[_0x5b5c('0x22')](function(_0x35585f){if(_0x35585f){_0x2130f7[_0x5b5c('0x5b')][_0x5b5c('0x64')]=_0x35585f['id'];return db['CannedAnswer'][_0x5b5c('0x5a')](_0x2130f7[_0x5b5c('0x5b')]);}})[_0x5b5c('0x22')](respondWithResult(_0x1f2cbd,null))['catch'](handleError(_0x1f2cbd,null));};exports[_0x5b5c('0x6b')]=function(_0x35769f,_0x1d5bf0,_0x359f30){var _0x4b1d6e={'raw':![],'where':{}};var _0x38e0d8={};var _0x28381b={'count':0x0,'rows':[]};return db[_0x5b5c('0x3f')][_0x5b5c('0x6c')]({'where':{'id':_0x35769f[_0x5b5c('0x56')]['id']}})['then'](handleEntityNotFound(_0x1d5bf0,null))[_0x5b5c('0x22')](function(_0x27a4e1){if(_0x27a4e1){_0x38e0d8['model']=_[_0x5b5c('0x45')](db[_0x5b5c('0x6d')][_0x5b5c('0x40')]);_0x38e0d8[_0x5b5c('0x46')]=_[_0x5b5c('0x45')](_0x35769f[_0x5b5c('0x46')]);_0x38e0d8[_0x5b5c('0x47')]=_[_0x5b5c('0x48')](_0x38e0d8[_0x5b5c('0x44')],_0x38e0d8[_0x5b5c('0x46')]);_0x4b1d6e['attributes']=_[_0x5b5c('0x48')](_0x38e0d8['model'],qs[_0x5b5c('0x4a')](_0x35769f['query'][_0x5b5c('0x4a')]));_0x4b1d6e['attributes']=_0x4b1d6e[_0x5b5c('0x49')][_0x5b5c('0x57')]?_0x4b1d6e['attributes']:_0x38e0d8[_0x5b5c('0x44')];if(!_0x35769f[_0x5b5c('0x46')]['hasOwnProperty'](_0x5b5c('0x67'))){_0x4b1d6e[_0x5b5c('0x30')]=qs[_0x5b5c('0x30')](_0x35769f[_0x5b5c('0x46')][_0x5b5c('0x30')]);_0x4b1d6e['offset']=qs[_0x5b5c('0x2f')](_0x35769f['query'][_0x5b5c('0x2f')]);}_0x4b1d6e[_0x5b5c('0x4b')]=qs[_0x5b5c('0x4c')](_0x35769f[_0x5b5c('0x46')]['sort']);_0x4b1d6e[_0x5b5c('0x4d')]=qs['filters'](_['pick'](_0x35769f[_0x5b5c('0x46')],_0x38e0d8[_0x5b5c('0x47')]));_0x4b1d6e[_0x5b5c('0x4d')][_0x5b5c('0x64')]=_0x27a4e1['id'];if(_0x35769f[_0x5b5c('0x46')][_0x5b5c('0x4f')]){_0x4b1d6e[_0x5b5c('0x4d')]=_['merge'](_0x4b1d6e[_0x5b5c('0x4d')],{'$or':_['map'](_0x4b1d6e['attributes'],function(_0x2039c6){var _0x4b18a8={};_0x4b18a8[_0x2039c6]={'$like':'%'+_0x35769f['query'][_0x5b5c('0x4f')]+'%'};return _0x4b18a8;})});}_0x4b1d6e=_[_0x5b5c('0x51')]({},_0x4b1d6e,_0x35769f[_0x5b5c('0x52')]);return db['CannedAnswer'][_0x5b5c('0x31')]({'where':_0x4b1d6e[_0x5b5c('0x4d')]})[_0x5b5c('0x22')](function(_0x3effec){_0x28381b[_0x5b5c('0x31')]=_0x3effec;if(_0x35769f[_0x5b5c('0x46')]['includeAll']){_0x4b1d6e[_0x5b5c('0x53')]=[{'all':!![]}];}return db[_0x5b5c('0x6d')][_0x5b5c('0x54')](_0x4b1d6e);})[_0x5b5c('0x22')](function(_0x26c925){_0x28381b[_0x5b5c('0x55')]=_0x26c925;return _0x28381b;});}})[_0x5b5c('0x22')](respondWithFilteredResult(_0x1d5bf0,_0x4b1d6e))['catch'](handleError(_0x1d5bf0,null));};exports[_0x5b5c('0x6e')]=function(_0x53b76c,_0x2d9d64,_0x49c689){return db[_0x5b5c('0x3f')][_0x5b5c('0x59')]({'where':{'id':_0x53b76c[_0x5b5c('0x56')]['id']}})[_0x5b5c('0x22')](handleEntityNotFound(_0x2d9d64,null))[_0x5b5c('0x22')](function(_0x288e5a){if(_0x288e5a){return _0x288e5a[_0x5b5c('0x6e')](_0x53b76c[_0x5b5c('0x46')][_0x5b5c('0x69')]);}})[_0x5b5c('0x22')](respondWithStatusCode(_0x2d9d64,null))[_0x5b5c('0x2b')](handleError(_0x2d9d64,null));};exports[_0x5b5c('0x6f')]=function(_0x1f6cf3,_0x1a9a84,_0x2b88f9){var _0x49da93={'channel':_0x5b5c('0x70')};var _0x376048=[];var _0x268138=[];var _0x2f50ea={};return db[_0x5b5c('0x3f')]['find']({'where':{'id':_0x1f6cf3[_0x5b5c('0x56')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x5b5c('0x71')}]})[_0x5b5c('0x22')](handleEntityNotFound(_0x1a9a84,null))[_0x5b5c('0x22')](function(_0x53f9f1){_0x49da93[_0x5b5c('0x72')]=_0x53f9f1;_0x49da93[_0x5b5c('0x73')]=_['orderBy'](_0x53f9f1[_0x5b5c('0x71')],[_0x5b5c('0x74')],[_0x5b5c('0x75')]);if(_0x49da93[_0x5b5c('0x72')][_0x5b5c('0x71')]){delete _0x49da93[_0x5b5c('0x72')][_0x5b5c('0x71')];}return db[_0x5b5c('0x76')][_0x5b5c('0x63')]();})[_0x5b5c('0x22')](function(_0x3fe721){if(!_0x3fe721){throw new db['Sequelize']['ValidationError'](_0x5b5c('0x77'));}_0x376048=_[_0x5b5c('0x78')](_[_0x5b5c('0x45')](_0x3fe721),[_0x5b5c('0x79'),_0x5b5c('0x7a')]);_0x268138=_[_0x5b5c('0x78')](_[_0x5b5c('0x45')](_0x3fe721),[_0x5b5c('0x79'),_0x5b5c('0x7a'),_0x5b5c('0x7b'),_0x5b5c('0x7c')]);_0x49da93[_0x5b5c('0x5b')]={'mapKey':_0x5b5c('0x7d')};if(_0x49da93[_0x5b5c('0x72')][_0x5b5c('0x42')]){switch(_0x49da93[_0x5b5c('0x72')][_0x5b5c('0x42')]){case'twilio':_0x49da93[_0x5b5c('0x5b')]['from']=_0x1f6cf3[_0x5b5c('0x5b')][_0x5b5c('0x7e')];_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x5b')]=_0x1f6cf3['body'][_0x5b5c('0x7f')];_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x80')]=_0x1f6cf3['body'][_0x5b5c('0x81')];break;case _0x5b5c('0x82'):_0x49da93['body']['from']='+'+_0x1f6cf3[_0x5b5c('0x5b')][_0x5b5c('0x83')];_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x5b')]=_0x1f6cf3[_0x5b5c('0x5b')]['text'];break;case _0x5b5c('0x84'):_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x85')]=_0x1f6cf3[_0x5b5c('0x5b')][_0x5b5c('0x85')];_0x49da93['body'][_0x5b5c('0x5b')]=_0x1f6cf3[_0x5b5c('0x5b')][_0x5b5c('0x29')];break;case'clicksend':_0x49da93['body'][_0x5b5c('0x85')]=_0x1f6cf3['body'][_0x5b5c('0x85')];_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x5b')]=_0x1f6cf3[_0x5b5c('0x5b')][_0x5b5c('0x5b')];_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x80')]=_0x1f6cf3['body']['message_id'];break;case _0x5b5c('0x86'):_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x85')]=_0x1f6cf3[_0x5b5c('0x5b')][_0x5b5c('0x7e')];_0x49da93[_0x5b5c('0x5b')]['body']=_0x1f6cf3[_0x5b5c('0x5b')][_0x5b5c('0x87')];_0x49da93['body'][_0x5b5c('0x80')]=_0x1f6cf3['body'][_0x5b5c('0x88')];break;case'infobip':_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x85')]='+'+_0x1f6cf3['body'][_0x5b5c('0x89')][0x0]['from'];_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x5b')]=_0x1f6cf3[_0x5b5c('0x5b')][_0x5b5c('0x89')][0x0][_0x5b5c('0x8a')];_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x80')]=_0x1f6cf3[_0x5b5c('0x5b')][_0x5b5c('0x89')][0x0][_0x5b5c('0x80')];break;case _0x5b5c('0x8b'):_0x49da93['body'][_0x5b5c('0x85')]=_0x1f6cf3['body']['originatingAddress'];_0x49da93[_0x5b5c('0x5b')]['body']=_0x1f6cf3['body'][_0x5b5c('0x8c')]['message'];break;case _0x5b5c('0x8d'):_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x85')]=_0x1f6cf3[_0x5b5c('0x5b')][_0x5b5c('0x8e')];_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x5b')]=_0x1f6cf3[_0x5b5c('0x5b')]['text'];_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x80')]=_0x1f6cf3[_0x5b5c('0x5b')][_0x5b5c('0x8f')];break;case _0x5b5c('0x90'):_0x49da93['body'][_0x5b5c('0x80')]=_0x1f6cf3[_0x5b5c('0x5b')][0x0][_0x5b5c('0x29')]['id'];_0x49da93['body'][_0x5b5c('0x85')]=_0x1f6cf3[_0x5b5c('0x5b')][0x0]['message'][_0x5b5c('0x85')];_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x5b')]=_0x1f6cf3['body'][0x0][_0x5b5c('0x29')][_0x5b5c('0x8a')];break;case'intelepeer':_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x85')]=_0x1f6cf3['body'][_0x5b5c('0x85')];_0x49da93[_0x5b5c('0x5b')]['body']=_0x1f6cf3[_0x5b5c('0x5b')][_0x5b5c('0x29')];_0x49da93[_0x5b5c('0x5b')]['messageId']=_0x1f6cf3[_0x5b5c('0x5b')]['refid'];break;}}if(_0x49da93['body']['id']){delete _0x49da93[_0x5b5c('0x5b')]['id'];}if(_[_0x5b5c('0x91')](_0x49da93[_0x5b5c('0x5b')]['from'])){throw new db[(_0x5b5c('0x92'))][(_0x5b5c('0x93'))](_0x5b5c('0x94'));}if(_[_0x5b5c('0x91')](_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x5b')])||_0x49da93['body']['body']===''){throw new db[(_0x5b5c('0x92'))][(_0x5b5c('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5b5c('0x91')](_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x95')])){throw new db[(_0x5b5c('0x92'))][(_0x5b5c('0x93'))](_0x5b5c('0x96')+_0x268138);}if(!_[_0x5b5c('0x97')](_0x268138,_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x95')])){throw new db[(_0x5b5c('0x92'))][(_0x5b5c('0x93'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x268138);}_0x2f50ea[_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x95')]]=_0x49da93[_0x5b5c('0x5b')]['from'];return db[_0x5b5c('0x98')][_0x5b5c('0x59')]({'where':{'id':_0x49da93['account'][_0x5b5c('0x7c')]},'include':[{'model':db[_0x5b5c('0x76')],'as':'Contacts','where':_0x2f50ea,'limit':0x1,'order':[[_0x5b5c('0x7a'),_0x5b5c('0x99')]]}]});})[_0x5b5c('0x22')](handleEntityNotFound(_0x1a9a84,null))[_0x5b5c('0x22')](function(_0xe0ce9){if(_0xe0ce9){_0x49da93[_0x5b5c('0x9a')]=_[_0x5b5c('0x9b')](_0xe0ce9,[_0x5b5c('0x9c')]);if(_0xe0ce9['Contacts'][_0x5b5c('0x57')]){return _0xe0ce9[_0x5b5c('0x9c')][0x0];}var _0x5e2ee2=_[_0x5b5c('0x19')](_0x49da93[_0x5b5c('0x5b')],{'firstName':_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x85')],'ListId':_0xe0ce9['id']});_0x5e2ee2[_0x49da93[_0x5b5c('0x5b')]['mapKey']]=_0x49da93['body'][_0x5b5c('0x85')];return db[_0x5b5c('0x76')][_0x5b5c('0x5a')](_0x5e2ee2,{'fields':_0x376048,'raw':!![]});}})[_0x5b5c('0x22')](handleEntityNotFound(_0x1a9a84,null))[_0x5b5c('0x22')](function(_0x507c21){if(_0x507c21){_0x49da93[_0x5b5c('0x9d')]=_0x507c21;var _0x40035a={'ContactId':_0x507c21['id'],'phone':_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x85')],'SmsAccountId':_0x1f6cf3[_0x5b5c('0x56')]['id']};var _0x27b94c={'ContactId':_0x507c21['id'],'SmsAccountId':_0x1f6cf3[_0x5b5c('0x56')]['id'],'closed':![]};return db['SmsInteraction'][_0x5b5c('0x59')]({'where':_0x27b94c})['then'](function(_0x13d439){if(_0x13d439){return[_0x13d439,![]];}return db[_0x5b5c('0x9e')][_0x5b5c('0x5a')](_0x40035a)[_0x5b5c('0x22')](function(_0x57a1c3){return[_0x57a1c3,!![]];});});}})[_0x5b5c('0x9f')](function(_0x12c59a,_0x491269){_0x49da93[_0x5b5c('0xa0')]=_0x12c59a[_0x5b5c('0x38')]({'plain':!![]});_0x49da93['interaction'][_0x5b5c('0xa1')]=![];if(_0x491269){if(_0x49da93[_0x5b5c('0x72')][_0x5b5c('0xa2')]){_0x49da93[_0x5b5c('0x73')][_0x5b5c('0xa3')]({'id':0x0,'priority':_0x49da93[_0x5b5c('0x73')][_0x5b5c('0x57')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x5b5c('0xa4')});}_0x49da93[_0x5b5c('0xa0')][_0x5b5c('0xa1')]=!![];}return db[_0x5b5c('0xa5')][_0x5b5c('0x5a')]({'phone':_0x49da93['body'][_0x5b5c('0x85')],'messageId':_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x80')],'body':_0x49da93[_0x5b5c('0x5b')][_0x5b5c('0x5b')],'SmsAccountId':_0x1f6cf3[_0x5b5c('0x56')]['id'],'SmsInteractionId':_0x12c59a['id'],'direction':'in','ContactId':_0x12c59a[_0x5b5c('0xa6')],'AttachmentId':_0x49da93['body'][_0x5b5c('0xa7')]});})['then'](function(_0x4443c8){_0x49da93[_0x5b5c('0x29')]=_0x4443c8;if(!_0x49da93[_0x5b5c('0xa0')][_0x5b5c('0xa8')])return;return db[_0x5b5c('0xa9')]['find']({'attributes':['id',_0x5b5c('0x3b')],'where':{'id':_0x49da93['interaction']['UserId']}});})['then'](function(_0x2f7baa){if(_0x2f7baa){_0x49da93[_0x5b5c('0x73')][_0x5b5c('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2f7baa[_0x5b5c('0x3b')]+','+(_0x49da93[_0x5b5c('0x72')][_0x5b5c('0xab')]||0xa),'interval':_0x5b5c('0xa4')});}if(!_0x49da93[_0x5b5c('0xa0')][_0x5b5c('0xac')])return;return db[_0x5b5c('0xad')][_0x5b5c('0x59')]({'attributes':['id',_0x5b5c('0x3b')],'where':{'id':_0x49da93[_0x5b5c('0xa0')][_0x5b5c('0xac')]}});})[_0x5b5c('0x22')](function(_0x508f15){if(_0x508f15){_0x49da93[_0x5b5c('0x73')][_0x5b5c('0xaa')]({'id':0x0,'priority':0x1,'app':_0x5b5c('0xae'),'appdata':_0x508f15[_0x5b5c('0x3b')]+','+(_0x49da93[_0x5b5c('0x72')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x5b5c('0xaf'),_0x5b5c('0xb0'),_0x49da93);})[_0x5b5c('0x22')](function(_0x5d8f0e){if(_0x5d8f0e){var _0x186fe9=0xc8;var _0x3ad569=_0x5b5c('0xb1');logger[_0x5b5c('0x23')](_0x5b5c('0xb2'),_0x3ad569,_0x186fe9,_0x5b5c('0xb3'));logger[_0x5b5c('0x25')](_0x5b5c('0xb4'),_0x3ad569,_0x186fe9,_0x5b5c('0xb3'),JSON[_0x5b5c('0xb5')](_0x5d8f0e));if(_0x49da93[_0x5b5c('0x72')][_0x5b5c('0x42')]==='twilio'){return _0x1a9a84[_0x5b5c('0x2e')](_0x186fe9)[_0x5b5c('0xb6')](_0x5b5c('0xb7'),_0x5b5c('0xb8'))[_0x5b5c('0x3c')]('\x0a');}else{return _0x1a9a84[_0x5b5c('0x2e')](_0x186fe9)[_0x5b5c('0x32')](_0x5d8f0e);}}})['catch'](handleError(_0x1a9a84,null));};exports['addApplications']=function(_0x1fa1e2,_0x337851){var _0x71f0bd=_0x1fa1e2['params']['id'];var _0x1753d7=_0x1fa1e2['body'];var _0x4ab240=0xc8;var _0x372f6b=null;return db[_0x5b5c('0xb9')][_0x5b5c('0xba')]({'isolationLevel':db[_0x5b5c('0xb9')][_0x5b5c('0xbb')][_0x5b5c('0xbc')][_0x5b5c('0xbd')]},function(_0x52b53c){return db[_0x5b5c('0x3f')][_0x5b5c('0x6c')]({'where':{'id':_0x71f0bd},'transaction':_0x52b53c})[_0x5b5c('0x22')](function(_0x4d03de){if(_0x4d03de){return db['SmsApplication'][_0x5b5c('0x37')]({'where':{'SmsAccountId':_0x71f0bd},'transaction':_0x52b53c})[_0x5b5c('0x22')](function(){var _0x4ff649=_[_0x5b5c('0x3e')](_0x1753d7,function(_0x2098bc){_0x2098bc[_0x5b5c('0x64')]=_0x71f0bd;return _0x2098bc;});return db[_0x5b5c('0xbe')][_0x5b5c('0xbf')](_0x4ff649,{'transaction':_0x52b53c});});}else{_0x4ab240=0x194;_0x372f6b=[];}});})[_0x5b5c('0x22')](function(){if(_0x4ab240!==0x194){return db['SmsApplication'][_0x5b5c('0xc0')]({'where':{'SmsAccountId':_0x71f0bd},'order':'priority'})[_0x5b5c('0x22')](function(_0x2ff65d){_0x372f6b=_0x2ff65d;});}})[_0x5b5c('0x2b')](function(_0xf4544e){_0x4ab240=0x1f4;logger[_0x5b5c('0x27')](_0xf4544e[_0x5b5c('0x3a')]);if(_0xf4544e[_0x5b5c('0x3b')]){delete _0xf4544e[_0x5b5c('0x3b')];}_0x372f6b=_0xf4544e;})[_0x5b5c('0xc1')](function(){if(_0x372f6b===null){_0x337851[_0x5b5c('0x2c')](_0x4ab240);}else{if(_0x4ab240===0x1f4){_0x337851[_0x5b5c('0x2e')](_0x4ab240)[_0x5b5c('0x3c')](_0x372f6b);}else{_0x337851[_0x5b5c('0x2e')](_0x4ab240)[_0x5b5c('0x32')](_0x372f6b);}}});};exports['getApplications']=function(_0x58318d,_0x4ea2c3,_0x2db737){var _0x43787b={};var _0x5e6653={};var _0x3a4974;var _0x57932a;return db['SmsAccount'][_0x5b5c('0x6c')]({'where':{'id':_0x58318d['params']['id']}})[_0x5b5c('0x22')](handleEntityNotFound(_0x4ea2c3,null))['then'](function(_0x1e3911){if(_0x1e3911){_0x3a4974=_0x1e3911;_0x5e6653[_0x5b5c('0x44')]=_[_0x5b5c('0x45')](db[_0x5b5c('0xbe')][_0x5b5c('0x40')]);_0x5e6653[_0x5b5c('0x46')]=_[_0x5b5c('0x45')](_0x58318d[_0x5b5c('0x46')]);_0x5e6653['filters']=_[_0x5b5c('0x48')](_0x5e6653[_0x5b5c('0x44')],_0x5e6653[_0x5b5c('0x46')]);_0x43787b[_0x5b5c('0x49')]=_[_0x5b5c('0x48')](_0x5e6653[_0x5b5c('0x44')],qs[_0x5b5c('0x4a')](_0x58318d[_0x5b5c('0x46')][_0x5b5c('0x4a')]));_0x43787b[_0x5b5c('0x49')]=_0x43787b[_0x5b5c('0x49')][_0x5b5c('0x57')]?_0x43787b[_0x5b5c('0x49')]:_0x5e6653[_0x5b5c('0x44')];_0x43787b[_0x5b5c('0x4b')]=qs[_0x5b5c('0x4c')](_0x58318d[_0x5b5c('0x46')]['sort']);_0x43787b[_0x5b5c('0x4d')]=qs[_0x5b5c('0x47')](_[_0x5b5c('0x4e')](_0x58318d[_0x5b5c('0x46')],_0x5e6653['filters']));if(_0x58318d[_0x5b5c('0x46')]['filter']){_0x43787b[_0x5b5c('0x4d')]=_[_0x5b5c('0x51')](_0x43787b[_0x5b5c('0x4d')],{'$or':_[_0x5b5c('0x3e')](_0x43787b[_0x5b5c('0x49')],function(_0x399c6c){var _0xc462b0={};_0xc462b0[_0x399c6c]={'$like':'%'+_0x58318d[_0x5b5c('0x46')][_0x5b5c('0x4f')]+'%'};return _0xc462b0;})});}_0x43787b=_[_0x5b5c('0x51')]({},_0x43787b,_0x58318d[_0x5b5c('0x52')]);return _0x3a4974[_0x5b5c('0xc2')](_0x43787b);}})[_0x5b5c('0x22')](function(_0x282305){if(_0x282305){_0x57932a=_0x282305[_0x5b5c('0x57')];if(!_0x58318d[_0x5b5c('0x46')][_0x5b5c('0xc3')]('nolimit')){_0x43787b['limit']=qs[_0x5b5c('0x30')](_0x58318d['query'][_0x5b5c('0x30')]);_0x43787b['offset']=qs['offset'](_0x58318d[_0x5b5c('0x46')][_0x5b5c('0x2f')]);}return _0x3a4974[_0x5b5c('0xc2')](_0x43787b);}})[_0x5b5c('0x22')](function(_0x4be761){if(_0x4be761){return _0x4be761?{'count':_0x57932a,'rows':_0x4be761}:null;}})[_0x5b5c('0x22')](respondWithResult(_0x4ea2c3,null))[_0x5b5c('0x2b')](handleError(_0x4ea2c3,null));};exports[_0x5b5c('0xc4')]=function(_0x110dfa,_0x144534,_0x2ca9d2){var _0x42af81={'raw':![],'where':{}};var _0x2635df={};var _0x1898ac={'count':0x0,'rows':[]};return db[_0x5b5c('0x3f')]['findOne']({'where':{'id':_0x110dfa[_0x5b5c('0x56')]['id']}})[_0x5b5c('0x22')](handleEntityNotFound(_0x144534,null))[_0x5b5c('0x22')](function(_0x2a0996){if(_0x2a0996){_0x2635df['model']=_['keys'](db[_0x5b5c('0x9e')][_0x5b5c('0x40')]);_0x2635df['query']=_['keys'](_0x110dfa[_0x5b5c('0x46')]);_0x2635df['filters']=_[_0x5b5c('0x48')](_0x2635df[_0x5b5c('0x44')],_0x2635df[_0x5b5c('0x46')]);_0x42af81[_0x5b5c('0x49')]=_[_0x5b5c('0x48')](_0x2635df[_0x5b5c('0x44')],qs[_0x5b5c('0x4a')](_0x110dfa[_0x5b5c('0x46')]['fields']));_0x42af81['attributes']=_0x42af81[_0x5b5c('0x49')]['length']?_0x42af81['attributes']:_0x2635df['model'];if(!_0x110dfa[_0x5b5c('0x46')][_0x5b5c('0xc3')](_0x5b5c('0x67'))){_0x42af81[_0x5b5c('0x30')]=qs[_0x5b5c('0x30')](_0x110dfa[_0x5b5c('0x46')][_0x5b5c('0x30')]);_0x42af81['offset']=qs[_0x5b5c('0x2f')](_0x110dfa[_0x5b5c('0x46')][_0x5b5c('0x2f')]);}_0x42af81['order']=qs[_0x5b5c('0x4c')](_0x110dfa[_0x5b5c('0x46')][_0x5b5c('0x4c')]);_0x42af81[_0x5b5c('0x4d')]=qs[_0x5b5c('0x47')](_[_0x5b5c('0x4e')](_0x110dfa[_0x5b5c('0x46')],_0x2635df[_0x5b5c('0x47')]));_0x42af81[_0x5b5c('0x4d')]['SmsAccountId']=_0x2a0996['id'];if(_0x110dfa[_0x5b5c('0x46')][_0x5b5c('0x4f')]){_0x42af81[_0x5b5c('0x4d')]=_[_0x5b5c('0x51')](_0x42af81[_0x5b5c('0x4d')],{'$or':_['map'](_0x42af81[_0x5b5c('0x49')],function(_0xd56b54){var _0x36f6af={};_0x36f6af[_0xd56b54]={'$like':'%'+_0x110dfa[_0x5b5c('0x46')]['filter']+'%'};return _0x36f6af;})});}_0x42af81=_[_0x5b5c('0x51')]({},_0x42af81,_0x110dfa[_0x5b5c('0x52')]);return db['SmsInteraction'][_0x5b5c('0x31')]({'where':_0x42af81[_0x5b5c('0x4d')]})[_0x5b5c('0x22')](function(_0x2d3566){_0x1898ac[_0x5b5c('0x31')]=_0x2d3566;if(_0x110dfa[_0x5b5c('0x46')]['includeAll']){_0x42af81[_0x5b5c('0x53')]=[{'model':db[_0x5b5c('0x76')],'as':_0x5b5c('0xc5'),'required':![]},{'model':db['User'],'as':_0x5b5c('0xc6'),'attributes':[_0x5b5c('0x3b'),_0x5b5c('0xc7'),_0x5b5c('0xc8')],'required':![]},{'model':db['Tag'],'as':_0x5b5c('0xc9'),'attributes':['id',_0x5b5c('0x3b'),_0x5b5c('0xca')],'where':_0x110dfa[_0x5b5c('0x46')][_0x5b5c('0xcb')]?{'id':_0x110dfa[_0x5b5c('0x46')]['tag']}:undefined,'required':_0x110dfa['query']['tag']?!![]:![]}];}return db['SmsInteraction'][_0x5b5c('0x54')](_0x42af81);})[_0x5b5c('0x22')](function(_0x45c9f7){_0x1898ac[_0x5b5c('0x55')]=_0x45c9f7;return _0x1898ac;});}})[_0x5b5c('0x22')](respondWithFilteredResult(_0x144534,_0x42af81))[_0x5b5c('0x2b')](handleError(_0x144534,null));};exports['send']=function(_0x4100e4,_0x528a84,_0x1f6c95){var _0x347e11,_0x39302c,_0x19971e;if(_['isNil'](_0x4100e4[_0x5b5c('0x5b')]['body'])||_0x4100e4[_0x5b5c('0x5b')][_0x5b5c('0x5b')]===''){throw new db[(_0x5b5c('0x92'))][(_0x5b5c('0x93'))](_0x5b5c('0xcc'));}if(_[_0x5b5c('0x91')](_0x4100e4[_0x5b5c('0x5b')]['to'])){throw new db[(_0x5b5c('0x92'))][(_0x5b5c('0x93'))](_0x5b5c('0xcd'));}_0x347e11=_0x4100e4[_0x5b5c('0x5b')]['to'];return db[_0x5b5c('0x3f')][_0x5b5c('0x59')]({'where':{'id':_0x4100e4[_0x5b5c('0x56')]['id']},'include':[{'model':db[_0x5b5c('0x98')],'as':_0x5b5c('0xce'),'include':[{'model':db['CmContact'],'as':_0x5b5c('0x9c'),'where':{'mobile':_0x347e11},'limit':0x1,'order':[[_0x5b5c('0x7a'),_0x5b5c('0x99')]]}]}]})[_0x5b5c('0x22')](handleEntityNotFound(_0x528a84,null))[_0x5b5c('0x22')](function(_0x486134){if(_0x486134&&_0x486134[_0x5b5c('0xce')]){_0x39302c=_0x486134[_0x5b5c('0x38')]({'plain':!![]});if(_0x39302c[_0x5b5c('0xce')]&&_0x39302c[_0x5b5c('0xce')][_0x5b5c('0x9c')][_0x5b5c('0x57')]){return _0x39302c[_0x5b5c('0xce')][_0x5b5c('0x9c')][0x0];}return db[_0x5b5c('0x76')][_0x5b5c('0x5a')](_[_0x5b5c('0x19')](_0x4100e4['body'],{'firstName':_0x347e11,'mobile':_0x347e11,'phone':_0x347e11,'ListId':_0x39302c['ListId']}));}})['then'](handleEntityNotFound(_0x528a84,null))['then'](function(_0x5736f5){if(_0x5736f5){_0x19971e=_0x5736f5;return db['SmsInteraction'][_0x5b5c('0x59')]({'where':{'ContactId':_0x19971e['id'],'closed':![],'SmsAccountId':_0x39302c['id']}})['then'](function(_0x28cdfe){if(_0x28cdfe){return[_0x28cdfe,![]];}return db[_0x5b5c('0x9e')][_0x5b5c('0x5a')]({'UserId':_0x4100e4[_0x5b5c('0xcf')]['id'],'ContactId':_0x19971e['id'],'SmsAccountId':_0x39302c['id'],'phone':_0x347e11,'firstMsgDirection':_0x5b5c('0xd0'),'Messages':[_[_0x5b5c('0x51')](_0x4100e4[_0x5b5c('0x5b')],{'read':![],'body':_0x4100e4[_0x5b5c('0x5b')][_0x5b5c('0x5b')],'phone':_0x347e11,'SmsAccountId':_0x39302c['id'],'UserId':_0x4100e4[_0x5b5c('0xcf')]['id'],'ContactId':_0x19971e['id']})]},{'include':[{'model':db[_0x5b5c('0xa5')],'as':_0x5b5c('0xd1')}]})[_0x5b5c('0x22')](function(_0x4b5d4a){return[_0x4b5d4a,!![]];});});}})[_0x5b5c('0x9f')](function(_0x2c17e9,_0x22979b){if(_0x22979b){return _0x2c17e9;}return db['SmsMessage'][_0x5b5c('0x5a')](_[_0x5b5c('0x51')](_0x4100e4[_0x5b5c('0x5b')],{'read':![],'body':_0x4100e4[_0x5b5c('0x5b')][_0x5b5c('0x5b')],'phone':_0x347e11,'SmsAccountId':_0x39302c['id'],'SmsInteractionId':_0x2c17e9['id'],'UserId':_0x4100e4['user']['id'],'ContactId':_0x19971e['id']}))['then'](function(_0x2d6635){_0x2c17e9[_0x5b5c('0xd2')]['Messages']=[];_0x2c17e9[_0x5b5c('0xd2')][_0x5b5c('0xd1')][_0x5b5c('0xa3')](_0x2d6635[_0x5b5c('0xd2')]);return _0x2c17e9;});})[_0x5b5c('0x22')](respondWithResult(_0x528a84,null))[_0x5b5c('0x2b')](handleError(_0x528a84,null));};exports['status']=function(_0x579b3a,_0x1fe198,_0x3778e2){if(_0x579b3a[_0x5b5c('0x5b')]['id']){delete _0x579b3a[_0x5b5c('0x5b')]['id'];}var _0x3b0d21,_0x2da36c,_0x408b7f;return db[_0x5b5c('0x3f')][_0x5b5c('0x59')]({'where':{'id':_0x579b3a['params']['id']}})[_0x5b5c('0x22')](handleEntityNotFound(_0x1fe198,null))['then'](function(_0x515f6a){if(_0x515f6a){_0x408b7f=_0x515f6a;logger['debug'](_0x5b5c('0xb2'),_0x5b5c('0x2e'),_0x5b5c('0xd3'),_0x515f6a[_0x5b5c('0x42')],util['inspect'](_0x579b3a[_0x5b5c('0x5b')],{'showHidden':![],'depth':null}));switch(_0x515f6a[_0x5b5c('0x42')]){case _0x5b5c('0x82'):if(_0x579b3a[_0x5b5c('0x5b')][_0x5b5c('0xd4')]&&_0x579b3a[_0x5b5c('0x5b')]['status']){_0x2da36c=_0x579b3a[_0x5b5c('0x5b')][_0x5b5c('0x2e')];return db['SmsMessage']['find']({'where':{'messageId':_0x579b3a[_0x5b5c('0x5b')][_0x5b5c('0xd4')]}});}break;case _0x5b5c('0x84'):if(_0x579b3a['body']['requestid']&&_0x579b3a[_0x5b5c('0x5b')][_0x5b5c('0xd5')]){_0x2da36c=_0x579b3a['body'][_0x5b5c('0xd5')];return db['SmsMessage'][_0x5b5c('0x59')]({'where':{'messageId':_0x579b3a[_0x5b5c('0x5b')][_0x5b5c('0xd6')]}});}break;case'clicksend':if(_0x579b3a[_0x5b5c('0x5b')][_0x5b5c('0xd7')]&&_0x579b3a[_0x5b5c('0x5b')][_0x5b5c('0xd8')]){_0x2da36c=_0x579b3a['body'][_0x5b5c('0xd8')];return db[_0x5b5c('0xa5')][_0x5b5c('0x59')]({'where':{'messageId':_0x579b3a['body'][_0x5b5c('0xd7')]}});}break;case _0x5b5c('0xd9'):var _0x9aa475=_0x579b3a[_0x5b5c('0x5b')][_0x5b5c('0x89')][0x0];if(_0x9aa475[_0x5b5c('0x80')]&&_0x9aa475[_0x5b5c('0x2e')][_0x5b5c('0xda')]===_0x5b5c('0xdb')){_0x2da36c=_0x9aa475[_0x5b5c('0x2e')][_0x5b5c('0xda')];return db[_0x5b5c('0xa5')][_0x5b5c('0x59')]({'where':{'messageId':_0x9aa475[_0x5b5c('0x80')]}});}break;case _0x5b5c('0x8d'):if(_0x579b3a['body'][_0x5b5c('0x80')]&&_0x579b3a[_0x5b5c('0x5b')][_0x5b5c('0x2e')]){_0x2da36c=_0x579b3a[_0x5b5c('0x5b')][_0x5b5c('0x2e')];return db[_0x5b5c('0xa5')][_0x5b5c('0x59')]({'where':{'messageId':_0x579b3a['body'][_0x5b5c('0x80')]}});}break;case _0x5b5c('0x90'):if(_0x579b3a[_0x5b5c('0x5b')][0x0][_0x5b5c('0x29')]['id']){_0x2da36c=_0x579b3a['body'][0x0][_0x5b5c('0x42')];return db['SmsMessage']['find']({'where':{'messageId':_0x579b3a[_0x5b5c('0x5b')][0x0][_0x5b5c('0x29')]['id']}});}break;case _0x5b5c('0xdc'):if(_0x579b3a[_0x5b5c('0x5b')][_0x5b5c('0xdd')]&&_0x579b3a['body'][_0x5b5c('0x2e')]){_0x2da36c=_0x579b3a[_0x5b5c('0x5b')]['status'];return db[_0x5b5c('0xa5')][_0x5b5c('0x59')]({'where':{'messageId':_0x579b3a[_0x5b5c('0x5b')][_0x5b5c('0xdd')]}});}break;}}})[_0x5b5c('0x22')](handleEntityNotFound(_0x1fe198,null))[_0x5b5c('0x22')](function(_0x51d492){if(_0x51d492){_0x3b0d21=_0x51d492;switch(_0x408b7f[_0x5b5c('0x42')]){case _0x5b5c('0x82'):if(_0x2da36c==='DELIVERED'){return _0x3b0d21['update']({'read':!![]});}else{logger[_0x5b5c('0x27')](_0x5b5c('0xb2'),'status',_0x5b5c('0x82'),util[_0x5b5c('0xde')](_0x579b3a[_0x5b5c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x5b5c('0x84'):if(_0x2da36c==='1'){return _0x3b0d21['update']({'read':!![]});}else{logger[_0x5b5c('0x27')](_0x5b5c('0xb2'),'status','skebby',util[_0x5b5c('0xde')](_0x579b3a[_0x5b5c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x5b5c('0xdf'):if(!_0x579b3a['body'][_0x5b5c('0xe0')]&&_0x2da36c>=0xc8&&_0x2da36c<=0xce){return _0x3b0d21[_0x5b5c('0x36')]({'read':!![]});}else{logger[_0x5b5c('0x27')](_0x5b5c('0xb2'),'status',_0x5b5c('0xdf'),util[_0x5b5c('0xde')](_0x579b3a[_0x5b5c('0x5b')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x58d30d=_0x579b3a[_0x5b5c('0x5b')][_0x5b5c('0x89')][0x0];if(_0x58d30d[_0x5b5c('0x2e')][_0x5b5c('0xda')]===_0x5b5c('0xdb')){return _0x3b0d21['update']({'read':!![]});}else{logger[_0x5b5c('0x27')](_0x5b5c('0xb2'),_0x5b5c('0x2e'),_0x5b5c('0xd9'),util[_0x5b5c('0xde')](_0x579b3a['body'],{'showHidden':![],'depth':null}));}break;case _0x5b5c('0x8d'):if(_0x2da36c==_0x5b5c('0xe1')||_0x2da36c==_0x5b5c('0xe2')){return _0x3b0d21[_0x5b5c('0x36')]({'read':!![]});}else{logger[_0x5b5c('0x27')](_0x5b5c('0xb2'),'status','clickatell',util['inspect'](_0x579b3a[_0x5b5c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x5b5c('0x90'):if(_0x2da36c==_0x5b5c('0xe3')){return _0x3b0d21['update']({'read':!![]});}else{logger[_0x5b5c('0x27')](_0x5b5c('0xb2'),'status',_0x5b5c('0x90'),util[_0x5b5c('0xde')](_0x579b3a['body'],{'showHidden':![],'depth':null}));}break;case _0x5b5c('0xdc'):if(_0x2da36c===_0x5b5c('0xe4')||_0x2da36c===_0x5b5c('0xe5')){return _0x3b0d21[_0x5b5c('0x36')]({'read':!![]});}else{logger['error'](_0x5b5c('0xb2'),_0x5b5c('0x2e'),_0x5b5c('0xdc'),util[_0x5b5c('0xde')](_0x579b3a[_0x5b5c('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x3b0d21;}})[_0x5b5c('0x22')](respondWithResult(_0x1fe198,null))[_0x5b5c('0x2b')](handleError(_0x1fe198,null));};exports[_0x5b5c('0xe6')]=function(_0x5208cb,_0x557cc1,_0x45d8c7){var _0x44b125,_0x2fbb3f,_0x1a3d07;return db['SmsAccount']['find']({'where':{'id':_0x5208cb[_0x5b5c('0x56')]['id']}})[_0x5b5c('0x22')](handleEntityNotFound(_0x557cc1,null))['then'](function(_0x2d6046){if(_0x2d6046){_0x1a3d07=_0x2d6046;logger[_0x5b5c('0x25')](_0x5b5c('0xb2'),_0x5b5c('0x2e'),_0x5b5c('0xd3'),_0x2d6046[_0x5b5c('0x42')],util[_0x5b5c('0xde')](_0x5208cb[_0x5b5c('0x46')],{'showHidden':![],'depth':null}));switch(_0x2d6046[_0x5b5c('0x42')]){case _0x5b5c('0x8b'):if(_0x5208cb[_0x5b5c('0x46')][_0x5b5c('0xe7')]&&_0x5208cb[_0x5b5c('0x46')][_0x5b5c('0xe8')]){_0x2fbb3f=_0x5208cb['query']['state'];return db[_0x5b5c('0xa5')]['find']({'where':{'messageId':_0x5208cb[_0x5b5c('0x46')]['message-id']}});}break;}}})[_0x5b5c('0x22')](handleEntityNotFound(_0x557cc1,null))[_0x5b5c('0x22')](function(_0x226129){if(_0x226129){_0x44b125=_0x226129;switch(_0x1a3d07[_0x5b5c('0x42')]){case _0x5b5c('0x8b'):if(_0x2fbb3f==='2'||_0x2fbb3f==='6'){return _0x44b125[_0x5b5c('0x36')]({'read':!![]});}else{logger[_0x5b5c('0x27')](_0x5b5c('0xb2'),_0x5b5c('0x2e'),'csc',util[_0x5b5c('0xde')](_0x5208cb[_0x5b5c('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x44b125;}})[_0x5b5c('0x22')](respondWithResult(_0x557cc1,null))['catch'](handleError(_0x557cc1,null));};exports['addAgents']=function(_0x1fce5e,_0x1ffff2,_0x321427){return db[_0x5b5c('0x3f')][_0x5b5c('0x59')]({'where':{'id':_0x1fce5e['params']['id']}})[_0x5b5c('0x22')](handleEntityNotFound(_0x1ffff2,null))[_0x5b5c('0x22')](function(_0x4b929e){if(_0x4b929e){return _0x4b929e['addAgents'](_0x1fce5e[_0x5b5c('0x5b')][_0x5b5c('0x69')],_[_0x5b5c('0x9b')](_0x1fce5e[_0x5b5c('0x5b')],[_0x5b5c('0x69'),'id'])||{})[_0x5b5c('0x9f')](function(_0x1db057){for(var _0x1b4e6e=0x0;_0x1b4e6e<_0x1fce5e[_0x5b5c('0x5b')][_0x5b5c('0x69')][_0x5b5c('0x57')];_0x1b4e6e+=0x1){socket[_0x5b5c('0xe9')]('userSmsAccount:save',{'UserId':Number(_0x1fce5e[_0x5b5c('0x5b')][_0x5b5c('0x69')][_0x1b4e6e]),'SmsAccountId':Number(_0x1fce5e[_0x5b5c('0x56')]['id'])});}return _0x1db057;});}})[_0x5b5c('0x22')](respondWithResult(_0x1ffff2,null))[_0x5b5c('0x2b')](handleError(_0x1ffff2,null));};exports['removeAgents']=function(_0x1d2972,_0x11c0fc,_0x1798fd){return db['SmsAccount']['find']({'where':{'id':_0x1d2972[_0x5b5c('0x56')]['id']}})[_0x5b5c('0x22')](handleEntityNotFound(_0x11c0fc,null))[_0x5b5c('0x22')](function(_0x2fb274){if(_0x2fb274){return _0x2fb274[_0x5b5c('0xea')](_0x1d2972['query'][_0x5b5c('0x69')])['then'](function(){if(_[_0x5b5c('0xeb')](_0x1d2972[_0x5b5c('0x46')][_0x5b5c('0x69')])){for(var _0x28d376=0x0;_0x28d376<_0x1d2972[_0x5b5c('0x46')]['ids'][_0x5b5c('0x57')];_0x28d376+=0x1){socket[_0x5b5c('0xe9')](_0x5b5c('0xec'),{'UserId':Number(_0x1d2972['query'][_0x5b5c('0x69')][_0x28d376]),'SmsAccountId':Number(_0x1d2972['params']['id'])});}}else{socket['emit'](_0x5b5c('0xec'),{'UserId':Number(_0x1d2972['query'][_0x5b5c('0x69')]),'SmsAccountId':Number(_0x1d2972[_0x5b5c('0x56')]['id'])});}});}})[_0x5b5c('0x22')](respondWithStatusCode(_0x11c0fc,null))['catch'](handleError(_0x11c0fc,null));};exports[_0x5b5c('0xed')]=function(_0x177ba4,_0x3fefd9,_0x1d7fe9){var _0x4eace0={};var _0x3c289a={};var _0x1fd2cc;var _0x1280e3;return db[_0x5b5c('0x3f')][_0x5b5c('0x6c')]({'where':{'id':_0x177ba4[_0x5b5c('0x56')]['id']}})[_0x5b5c('0x22')](handleEntityNotFound(_0x3fefd9,null))['then'](function(_0x26dae6){if(_0x26dae6){_0x1fd2cc=_0x26dae6;_0x3c289a[_0x5b5c('0x44')]=_['keys'](db[_0x5b5c('0xa9')]['rawAttributes']);_0x3c289a[_0x5b5c('0x46')]=_[_0x5b5c('0x45')](_0x177ba4['query']);_0x3c289a[_0x5b5c('0x47')]=_['intersection'](_0x3c289a[_0x5b5c('0x44')],_0x3c289a[_0x5b5c('0x46')]);_0x4eace0[_0x5b5c('0x49')]=_['intersection'](_0x3c289a[_0x5b5c('0x44')],qs[_0x5b5c('0x4a')](_0x177ba4[_0x5b5c('0x46')][_0x5b5c('0x4a')]));_0x4eace0[_0x5b5c('0x49')]=_0x4eace0[_0x5b5c('0x49')][_0x5b5c('0x57')]?_0x4eace0[_0x5b5c('0x49')]:_0x3c289a['model'];_0x4eace0[_0x5b5c('0x4b')]=qs[_0x5b5c('0x4c')](_0x177ba4[_0x5b5c('0x46')]['sort']);_0x4eace0[_0x5b5c('0x4d')]=qs['filters'](_['pick'](_0x177ba4[_0x5b5c('0x46')],_0x3c289a['filters']));if(_0x177ba4['query'][_0x5b5c('0x4f')]){_0x4eace0[_0x5b5c('0x4d')]=_[_0x5b5c('0x51')](_0x4eace0[_0x5b5c('0x4d')],{'$or':_[_0x5b5c('0x3e')](_0x4eace0['attributes'],function(_0x11ae3e){var _0x1bef53={};_0x1bef53[_0x11ae3e]={'$like':'%'+_0x177ba4[_0x5b5c('0x46')][_0x5b5c('0x4f')]+'%'};return _0x1bef53;})});}_0x4eace0=_[_0x5b5c('0x51')]({},_0x4eace0,_0x177ba4[_0x5b5c('0x52')]);return _0x1fd2cc[_0x5b5c('0xed')](_0x4eace0);}})['then'](function(_0x3d7f2b){if(_0x3d7f2b){_0x1280e3=_0x3d7f2b['length'];if(!_0x177ba4['query'][_0x5b5c('0xc3')](_0x5b5c('0x67'))){_0x4eace0[_0x5b5c('0x30')]=qs[_0x5b5c('0x30')](_0x177ba4[_0x5b5c('0x46')][_0x5b5c('0x30')]);_0x4eace0['offset']=qs[_0x5b5c('0x2f')](_0x177ba4[_0x5b5c('0x46')][_0x5b5c('0x2f')]);}return _0x1fd2cc['getAgents'](_0x4eace0);}})[_0x5b5c('0x22')](function(_0x1951d7){if(_0x1951d7){return _0x1951d7?{'count':_0x1280e3,'rows':_0x1951d7}:null;}})[_0x5b5c('0x22')](respondWithResult(_0x3fefd9,null))['catch'](handleError(_0x3fefd9,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index aa5ba4a..d88ff07 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 _0xd106=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x178dff,_0x5c5c24){var _0x538b4b=function(_0x261a0d){while(--_0x261a0d){_0x178dff['push'](_0x178dff['shift']());}};_0x538b4b(++_0x5c5c24);}(_0xd106,0x19a));var _0x6d10=function(_0x7a2a06,_0x4f8a8d){_0x7a2a06=_0x7a2a06-0x0;var _0x24ae55=_0xd106[_0x7a2a06];return _0x24ae55;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x6d10('0x0'))['db'][_0x6d10('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6d10('0x2')](0x0);var events={'afterCreate':_0x6d10('0x3'),'afterUpdate':_0x6d10('0x4'),'afterDestroy':'remove'};function emitEvent(_0x22abcf){return function(_0x5dbb63,_0x1f93cb,_0x46318f){SmsAccountEvents[_0x6d10('0x5')](_0x22abcf+':'+_0x5dbb63['id'],_0x5dbb63);SmsAccountEvents[_0x6d10('0x5')](_0x22abcf,_0x5dbb63);_0x46318f(null);};}for(var e in events){if(events[_0x6d10('0x6')](e)){var event=events[e];SmsAccount[_0x6d10('0x7')](e,emitEvent(event));}}module[_0x6d10('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x30f3=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5c9a2a,_0x1fd9cb){var _0x582e52=function(_0x1ca8cf){while(--_0x1ca8cf){_0x5c9a2a['push'](_0x5c9a2a['shift']());}};_0x582e52(++_0x1fd9cb);}(_0x30f3,0x126));var _0x330f=function(_0x1580f7,_0xf2b31c){_0x1580f7=_0x1580f7-0x0;var _0x2a5b4f=_0x30f3[_0x1580f7];return _0x2a5b4f;};'use strict';var EventEmitter=require(_0x330f('0x0'));var SmsAccount=require(_0x330f('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x330f('0x2')](0x0);var events={'afterCreate':_0x330f('0x3'),'afterUpdate':'update','afterDestroy':_0x330f('0x4')};function emitEvent(_0x2f7613){return function(_0x254187,_0xe0bc09,_0x245594){SmsAccountEvents[_0x330f('0x5')](_0x2f7613+':'+_0x254187['id'],_0x254187);SmsAccountEvents['emit'](_0x2f7613,_0x254187);_0x245594(null);};}for(var e in events){if(events[_0x330f('0x6')](e)){var event=events[e];SmsAccount[_0x330f('0x7')](e,emitEvent(event));}}module[_0x330f('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index b36078d..a55603e 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 _0x2143=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','./smsAccount.attributes','exports','define'];(function(_0x3e0601,_0x342916){var _0x4dceda=function(_0x32e7da){while(--_0x32e7da){_0x3e0601['push'](_0x3e0601['shift']());}};_0x4dceda(++_0x342916);}(_0x2143,0xf0));var _0x3214=function(_0x43d65d,_0x54d57c){_0x43d65d=_0x43d65d-0x0;var _0x2a5f77=_0x2143[_0x43d65d];return _0x2a5f77;};'use strict';var _=require(_0x3214('0x0'));var util=require(_0x3214('0x1'));var logger=require(_0x3214('0x2'))('api');var moment=require(_0x3214('0x3'));var BPromise=require(_0x3214('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3214('0x5'));var rimraf=require(_0x3214('0x6'));var config=require('../../config/environment');var attributes=require(_0x3214('0x7'));module[_0x3214('0x8')]=function(_0x51a071,_0x24bdc5){return _0x51a071[_0x3214('0x9')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed46=['path','rimraf','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','../../config/logger','api','bluebird'];(function(_0x3328ac,_0x28f068){var _0x5c729e=function(_0x1866e7){while(--_0x1866e7){_0x3328ac['push'](_0x3328ac['shift']());}};_0x5c729e(++_0x28f068);}(_0xed46,0x1f0));var _0x6ed4=function(_0x4855ce,_0x3fbf65){_0x4855ce=_0x4855ce-0x0;var _0x150377=_0xed46[_0x4855ce];return _0x150377;};'use strict';var _=require(_0x6ed4('0x0'));var util=require('util');var logger=require(_0x6ed4('0x1'))(_0x6ed4('0x2'));var moment=require('moment');var BPromise=require(_0x6ed4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ed4('0x4'));var rimraf=require(_0x6ed4('0x5'));var config=require('../../config/environment');var attributes=require(_0x6ed4('0x6'));module[_0x6ed4('0x7')]=function(_0x24f32d,_0x168280){return _0x24f32d['define'](_0x6ed4('0x8'),attributes,{'tableName':_0x6ed4('0x9'),'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 6cc90c7..8060085 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 _0x767c=['../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','model','map','then','debug','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x53a1a3,_0x5d31e3){var _0xd0402c=function(_0x3c2e61){while(--_0x3c2e61){_0x53a1a3['push'](_0x53a1a3['shift']());}};_0xd0402c(++_0x5d31e3);}(_0x767c,0x11b));var _0xc767=function(_0x22d1ef,_0x4a5152){_0x22d1ef=_0x22d1ef-0x0;var _0x47c5a3=_0x767c[_0x22d1ef];return _0x47c5a3;};'use strict';var _=require('lodash');var util=require(_0xc767('0x0'));var moment=require(_0xc767('0x1'));var BPromise=require('bluebird');var rs=require(_0xc767('0x2'));var fs=require('fs');var Redis=require(_0xc767('0x3'));var db=require(_0xc767('0x4'))['db'];var utils=require(_0xc767('0x5'));var logger=require(_0xc767('0x6'))(_0xc767('0x7'));var config=require(_0xc767('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc767('0x9')]['http']({'port':0x232a});config[_0xc767('0xa')]=_[_0xc767('0xb')](config[_0xc767('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc767('0xc'))(new Redis(config['redis']));require(_0xc767('0xd'))[_0xc767('0xe')](socket);function respondWithRpcPromise(_0x2106f1,_0x591fba,_0x11567a){return new BPromise(function(_0x20314a,_0x43cc30){return client[_0xc767('0xf')](_0x2106f1,_0x11567a)['then'](function(_0xb8f5d8){logger[_0xc767('0x10')](_0xc767('0x11'),_0x591fba,_0xc767('0x12'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x591fba,_0xc767('0x12'),JSON[_0xc767('0x13')](_0xb8f5d8));if(_0xb8f5d8['error']){if(_0xb8f5d8['error']['code']===0x1f4){logger[_0xc767('0x14')]('SmsAccount,\x20%s,\x20%s',_0x591fba,_0xb8f5d8[_0xc767('0x14')][_0xc767('0x15')]);return _0x43cc30(_0xb8f5d8[_0xc767('0x14')][_0xc767('0x15')]);}logger[_0xc767('0x14')]('SmsAccount,\x20%s,\x20%s',_0x591fba,_0xb8f5d8[_0xc767('0x14')]['message']);return _0x20314a(_0xb8f5d8[_0xc767('0x14')][_0xc767('0x15')]);}else{logger[_0xc767('0x10')](_0xc767('0x11'),_0x591fba,_0xc767('0x12'));_0x20314a(_0xb8f5d8[_0xc767('0x16')][_0xc767('0x15')]);}})[_0xc767('0x17')](function(_0x514029){logger[_0xc767('0x14')](_0xc767('0x11'),_0x591fba,_0x514029);_0x43cc30(_0x514029);});});}exports[_0xc767('0x18')]=function(_0x519957){var _0xe12ddd=this;return new Promise(function(_0x25c6de,_0x4d1d0c){return db[_0xc767('0x19')][_0xc767('0x1a')]({'raw':_0x519957[_0xc767('0x1b')]?_0x519957[_0xc767('0x1b')][_0xc767('0x1c')]===undefined?!![]:![]:!![],'where':_0x519957[_0xc767('0x1b')]?_0x519957['options'][_0xc767('0x1d')]||null:null,'attributes':_0x519957[_0xc767('0x1b')]?_0x519957['options'][_0xc767('0x1e')]||null:null,'include':_0x519957['options']?_0x519957[_0xc767('0x1b')][_0xc767('0x1f')]?_['map'](_0x519957['options'][_0xc767('0x1f')],function(_0x48d415){return{'model':db[_0x48d415[_0xc767('0x20')]],'as':_0x48d415['as'],'attributes':_0x48d415[_0xc767('0x1e')],'include':_0x48d415[_0xc767('0x1f')]?_[_0xc767('0x21')](_0x48d415[_0xc767('0x1f')],function(_0x1d2a41){return{'model':db[_0x1d2a41[_0xc767('0x20')]],'as':_0x1d2a41['as'],'attributes':_0x1d2a41[_0xc767('0x1e')],'include':_0x1d2a41[_0xc767('0x1f')]?_[_0xc767('0x21')](_0x1d2a41[_0xc767('0x1f')],function(_0x594c91){return{'model':db[_0x594c91[_0xc767('0x20')]],'as':_0x594c91['as'],'attributes':_0x594c91[_0xc767('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc767('0x22')](function(_0x4fed21){logger['info']('ShowSmsAccount',_0x519957);logger[_0xc767('0x23')](_0xc767('0x18'),_0x519957,JSON[_0xc767('0x13')](_0x4fed21));_0x25c6de(_0x4fed21);})[_0xc767('0x17')](function(_0x21166d){logger[_0xc767('0x14')]('ShowSmsAccount',_0x21166d[_0xc767('0x15')],_0x519957);_0x4d1d0c(_0xe12ddd[_0xc767('0x14')](0x1f4,_0x21166d[_0xc767('0x15')]));});});}; \ No newline at end of file +var _0x4906=['find','options','where','include','map','model','attributes','debug','ShowSmsAccount','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x291c4d,_0x10ffab){var _0x23e403=function(_0x3f6cc8){while(--_0x3f6cc8){_0x291c4d['push'](_0x291c4d['shift']());}};_0x23e403(++_0x10ffab);}(_0x4906,0x69));var _0x6490=function(_0x4d19ba,_0x1c2808){_0x4d19ba=_0x4d19ba-0x0;var _0x416c1a=_0x4906[_0x4d19ba];return _0x416c1a;};'use strict';var _=require(_0x6490('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6490('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6490('0x2'));var db=require(_0x6490('0x3'))['db'];var utils=require(_0x6490('0x4'));var logger=require(_0x6490('0x5'))('rpc');var config=require(_0x6490('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6490('0x7')]({'port':0x232a});config[_0x6490('0x8')]=_['defaults'](config[_0x6490('0x8')],{'host':_0x6490('0x9'),'port':0x18eb});var socket=require(_0x6490('0xa'))(new Redis(config[_0x6490('0x8')]));require(_0x6490('0xb'))[_0x6490('0xc')](socket);function respondWithRpcPromise(_0x4ef0ab,_0x310c9f,_0x438718){return new BPromise(function(_0x339d93,_0x59c70d){return client[_0x6490('0xd')](_0x4ef0ab,_0x438718)[_0x6490('0xe')](function(_0x5f33b0){logger[_0x6490('0xf')](_0x6490('0x10'),_0x310c9f,_0x6490('0x11'));logger['debug'](_0x6490('0x12'),_0x310c9f,_0x6490('0x11'),JSON[_0x6490('0x13')](_0x5f33b0));if(_0x5f33b0[_0x6490('0x14')]){if(_0x5f33b0['error']['code']===0x1f4){logger[_0x6490('0x14')]('SmsAccount,\x20%s,\x20%s',_0x310c9f,_0x5f33b0[_0x6490('0x14')][_0x6490('0x15')]);return _0x59c70d(_0x5f33b0[_0x6490('0x14')][_0x6490('0x15')]);}logger['error'](_0x6490('0x10'),_0x310c9f,_0x5f33b0['error'][_0x6490('0x15')]);return _0x339d93(_0x5f33b0[_0x6490('0x14')][_0x6490('0x15')]);}else{logger[_0x6490('0xf')](_0x6490('0x10'),_0x310c9f,_0x6490('0x11'));_0x339d93(_0x5f33b0['result']['message']);}})[_0x6490('0x16')](function(_0x1b55cb){logger[_0x6490('0x14')](_0x6490('0x10'),_0x310c9f,_0x1b55cb);_0x59c70d(_0x1b55cb);});});}exports['ShowSmsAccount']=function(_0x1f4d15){var _0x579a71=this;return new Promise(function(_0x3654c0,_0x483bc9){return db['SmsAccount'][_0x6490('0x17')]({'raw':_0x1f4d15['options']?_0x1f4d15[_0x6490('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1f4d15[_0x6490('0x18')]?_0x1f4d15[_0x6490('0x18')][_0x6490('0x19')]||null:null,'attributes':_0x1f4d15['options']?_0x1f4d15[_0x6490('0x18')]['attributes']||null:null,'include':_0x1f4d15[_0x6490('0x18')]?_0x1f4d15[_0x6490('0x18')][_0x6490('0x1a')]?_[_0x6490('0x1b')](_0x1f4d15[_0x6490('0x18')][_0x6490('0x1a')],function(_0x5f4b10){return{'model':db[_0x5f4b10[_0x6490('0x1c')]],'as':_0x5f4b10['as'],'attributes':_0x5f4b10['attributes'],'include':_0x5f4b10[_0x6490('0x1a')]?_[_0x6490('0x1b')](_0x5f4b10[_0x6490('0x1a')],function(_0x2fe3d9){return{'model':db[_0x2fe3d9[_0x6490('0x1c')]],'as':_0x2fe3d9['as'],'attributes':_0x2fe3d9[_0x6490('0x1d')],'include':_0x2fe3d9[_0x6490('0x1a')]?_[_0x6490('0x1b')](_0x2fe3d9[_0x6490('0x1a')],function(_0x56d2a9){return{'model':db[_0x56d2a9[_0x6490('0x1c')]],'as':_0x56d2a9['as'],'attributes':_0x56d2a9[_0x6490('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6490('0xe')](function(_0x4aaedf){logger[_0x6490('0xf')]('ShowSmsAccount',_0x1f4d15);logger[_0x6490('0x1e')](_0x6490('0x1f'),_0x1f4d15,JSON['stringify'](_0x4aaedf));_0x3654c0(_0x4aaedf);})[_0x6490('0x16')](function(_0x5783b8){logger['error'](_0x6490('0x1f'),_0x5783b8[_0x6490('0x15')],_0x1f4d15);_0x483bc9(_0x579a71['error'](0x1f4,_0x5783b8['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index da38b0f..1cc644b 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +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(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 0864be6..3268ade 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(_0x1c5ac3,_0x2c5a2f){var _0x2e872c=function(_0xb14d){while(--_0xb14d){_0x1c5ac3['push'](_0x1c5ac3['shift']());}};_0x2e872c(++_0x2c5a2f);}(_0x7217,0x19e));var _0x7721=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7217[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file +var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x32aa9d,_0x1194bd){var _0x5d6fb6=function(_0x99324e){while(--_0x99324e){_0x32aa9d['push'](_0x32aa9d['shift']());}};_0x5d6fb6(++_0x1194bd);}(_0x55ca,0x126));var _0xa55c=function(_0x3a19d4,_0x3f19a4){_0x3a19d4=_0x3a19d4-0x0;var _0x5b858b=_0x55ca[_0x3a19d4];return _0x5b858b;};'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['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index e55bd1d..c4a5462 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 _0x841b=['exports','INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x3cebff,_0x20b43d){var _0x6e5423=function(_0x1043e1){while(--_0x1043e1){_0x3cebff['push'](_0x3cebff['shift']());}};_0x6e5423(++_0x20b43d);}(_0x841b,0xe3));var _0xb841=function(_0x164a40,_0xb704f7){_0x164a40=_0x164a40-0x0;var _0x2a551a=_0x841b[_0x164a40];return _0x2a551a;};'use strict';var Sequelize=require(_0xb841('0x0'));module[_0xb841('0x1')]={'priority':{'type':Sequelize[_0xb841('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb841('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb841('0x4')]},'interval':{'type':Sequelize[_0xb841('0x4')],'defaultValue':_0xb841('0x5')}}; \ No newline at end of file +var _0xf649=['STRING','*,*,*,*','exports','INTEGER'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf649,0x19a));var _0x9f64=function(_0x39fa4,_0x53e3b7){_0x39fa4=_0x39fa4-0x0;var _0xab6881=_0xf649[_0x39fa4];return _0xab6881;};'use strict';var Sequelize=require('sequelize');module[_0x9f64('0x0')]={'priority':{'type':Sequelize[_0x9f64('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9f64('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9f64('0x3')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 9c5a00f..b593bfb 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 _0x071d=['name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','sendStatus','stack'];(function(_0x2794cd,_0x1bd97e){var _0x12642a=function(_0x5f200b){while(--_0x5f200b){_0x2794cd['push'](_0x2794cd['shift']());}};_0x12642a(++_0x1bd97e);}(_0x071d,0x6f));var _0xd071=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0x071d[_0x2f62aa];return _0x1a341f;};'use strict';var emlformat=require(_0xd071('0x0'));var rimraf=require(_0xd071('0x1'));var zipdir=require(_0xd071('0x2'));var jsonpatch=require(_0xd071('0x3'));var rp=require(_0xd071('0x4'));var moment=require(_0xd071('0x5'));var BPromise=require(_0xd071('0x6'));var Mustache=require(_0xd071('0x7'));var util=require(_0xd071('0x8'));var path=require('path');var sox=require(_0xd071('0x9'));var csv=require(_0xd071('0xa'));var ejs=require(_0xd071('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd071('0xc'));var squel=require(_0xd071('0xd'));var crypto=require(_0xd071('0xe'));var jsforce=require(_0xd071('0xf'));var deskjs=require(_0xd071('0x10'));var toCsv=require(_0xd071('0xa'));var querystring=require(_0xd071('0x11'));var Papa=require(_0xd071('0x12'));var Redis=require(_0xd071('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd071('0x14'));var as=require(_0xd071('0x15'));var hardwareService=require(_0xd071('0x16'));var logger=require(_0xd071('0x17'))(_0xd071('0x18'));var utils=require(_0xd071('0x19'));var config=require(_0xd071('0x1a'));var licenseUtil=require(_0xd071('0x1b'));var db=require(_0xd071('0x1c'))['db'];function respondWithStatusCode(_0x36166d,_0x4ac36d){_0x4ac36d=_0x4ac36d||0xcc;return function(_0x300019){if(_0x300019){return _0x36166d['sendStatus'](_0x4ac36d);}return _0x36166d[_0xd071('0x1d')](_0x4ac36d)[_0xd071('0x1e')]();};}function respondWithResult(_0x4b58ae,_0x215a45){_0x215a45=_0x215a45||0xc8;return function(_0x4c1eda){if(_0x4c1eda){return _0x4b58ae['status'](_0x215a45)[_0xd071('0x1f')](_0x4c1eda);}};}function respondWithFilteredResult(_0x25fc0b,_0x4793c1){return function(_0x2b6733){if(_0x2b6733){var _0x24ff8f=typeof _0x4793c1[_0xd071('0x20')]==='undefined'&&typeof _0x4793c1[_0xd071('0x21')]===_0xd071('0x22');var _0x448cda=_0x2b6733[_0xd071('0x23')];var _0x96e185=_0x24ff8f?0x0:_0x4793c1[_0xd071('0x20')];var _0x2dcfe9=_0x24ff8f?_0x2b6733[_0xd071('0x23')]:_0x4793c1['offset']+_0x4793c1[_0xd071('0x21')];var _0xd8fc6f;if(_0x2dcfe9>=_0x448cda){_0x2dcfe9=_0x448cda;_0xd8fc6f=0xc8;}else{_0xd8fc6f=0xce;}_0x25fc0b[_0xd071('0x1d')](_0xd8fc6f);return _0x25fc0b[_0xd071('0x24')]('Content-Range',_0x96e185+'-'+_0x2dcfe9+'/'+_0x448cda)['json'](_0x2b6733);}return null;};}function patchUpdates(_0x67cad9){return function(_0x1171d7){try{jsonpatch[_0xd071('0x25')](_0x1171d7,_0x67cad9,!![]);}catch(_0x2a6b68){return BPromise[_0xd071('0x26')](_0x2a6b68);}return _0x1171d7[_0xd071('0x27')]();};}function saveUpdates(_0x4644e5,_0x2fd235){return function(_0x55ed1c){if(_0x55ed1c){return _0x55ed1c[_0xd071('0x28')](_0x4644e5)[_0xd071('0x29')](function(_0x12ade6){return _0x12ade6;});}return null;};}function removeEntity(_0x35ae0f,_0x437191){return function(_0x13be3d){if(_0x13be3d){return _0x13be3d[_0xd071('0x2a')]()[_0xd071('0x29')](function(){_0x35ae0f[_0xd071('0x1d')](0xcc)[_0xd071('0x1e')]();});}};}function handleEntityNotFound(_0x144ce3,_0x1fb1ca){return function(_0x2dc76c){if(!_0x2dc76c){_0x144ce3[_0xd071('0x2b')](0x194);}return _0x2dc76c;};}function handleError(_0x4a0edb,_0x2e702a){_0x2e702a=_0x2e702a||0x1f4;return function(_0x3db8cf){logger['error'](_0x3db8cf[_0xd071('0x2c')]);if(_0x3db8cf[_0xd071('0x2d')]){delete _0x3db8cf[_0xd071('0x2d')];}_0x4a0edb[_0xd071('0x1d')](_0x2e702a)[_0xd071('0x2e')](_0x3db8cf);};}exports[_0xd071('0x2f')]=function(_0x74dea1,_0x4eb1d){var _0x4fb33c={},_0x4c50c9={},_0x158eb3={'count':0x0,'rows':[]};var _0x2685b5=_[_0xd071('0x30')](db[_0xd071('0x31')][_0xd071('0x32')],function(_0x2dc75c){return{'name':_0x2dc75c[_0xd071('0x33')],'type':_0x2dc75c['type'][_0xd071('0x34')]};});_0x4c50c9[_0xd071('0x35')]=_['map'](_0x2685b5,'name');_0x4c50c9[_0xd071('0x36')]=_[_0xd071('0x37')](_0x74dea1[_0xd071('0x36')]);_0x4c50c9['filters']=_[_0xd071('0x38')](_0x4c50c9[_0xd071('0x35')],_0x4c50c9[_0xd071('0x36')]);_0x4fb33c['attributes']=_[_0xd071('0x38')](_0x4c50c9[_0xd071('0x35')],qs[_0xd071('0x39')](_0x74dea1['query'][_0xd071('0x39')]));_0x4fb33c[_0xd071('0x3a')]=_0x4fb33c[_0xd071('0x3a')][_0xd071('0x3b')]?_0x4fb33c[_0xd071('0x3a')]:_0x4c50c9[_0xd071('0x35')];if(!_0x74dea1[_0xd071('0x36')][_0xd071('0x3c')]('nolimit')){_0x4fb33c[_0xd071('0x21')]=qs[_0xd071('0x21')](_0x74dea1[_0xd071('0x36')]['limit']);_0x4fb33c[_0xd071('0x20')]=qs[_0xd071('0x20')](_0x74dea1['query']['offset']);}_0x4fb33c[_0xd071('0x3d')]=qs[_0xd071('0x3e')](_0x74dea1[_0xd071('0x36')][_0xd071('0x3e')]);_0x4fb33c[_0xd071('0x3f')]=qs[_0xd071('0x40')](_[_0xd071('0x41')](_0x74dea1[_0xd071('0x36')],_0x4c50c9[_0xd071('0x40')]),_0x2685b5);if(_0x74dea1[_0xd071('0x36')][_0xd071('0x42')]){_0x4fb33c['where']=_[_0xd071('0x43')](_0x4fb33c[_0xd071('0x3f')],{'$or':_['map'](_0x2685b5,function(_0x204242){if(_0x204242[_0xd071('0x44')]!==_0xd071('0x45')){var _0x19ad57={};_0x19ad57[_0x204242[_0xd071('0x2d')]]={'$like':'%'+_0x74dea1[_0xd071('0x36')][_0xd071('0x42')]+'%'};return _0x19ad57;}})});}_0x4fb33c=_[_0xd071('0x43')]({},_0x4fb33c,_0x74dea1[_0xd071('0x46')]);var _0x2db925={'where':_0x4fb33c[_0xd071('0x3f')]};return db[_0xd071('0x31')][_0xd071('0x23')](_0x2db925)[_0xd071('0x29')](function(_0xc2b8){_0x158eb3['count']=_0xc2b8;if(_0x74dea1['query']['includeAll']){_0x4fb33c['include']=[{'all':!![]}];}return db[_0xd071('0x31')][_0xd071('0x47')](_0x4fb33c);})['then'](function(_0x498145){_0x158eb3['rows']=_0x498145;return _0x158eb3;})[_0xd071('0x29')](respondWithFilteredResult(_0x4eb1d,_0x4fb33c))['catch'](handleError(_0x4eb1d,null));};exports['show']=function(_0x450b85,_0x1ddc12){var _0x184020={'raw':!![],'where':{'id':_0x450b85[_0xd071('0x48')]['id']}},_0x563e7b={};_0x563e7b['model']=_['keys'](db[_0xd071('0x31')][_0xd071('0x32')]);_0x563e7b[_0xd071('0x36')]=_['keys'](_0x450b85[_0xd071('0x36')]);_0x563e7b['filters']=_['intersection'](_0x563e7b[_0xd071('0x35')],_0x563e7b[_0xd071('0x36')]);_0x184020['attributes']=_[_0xd071('0x38')](_0x563e7b[_0xd071('0x35')],qs[_0xd071('0x39')](_0x450b85[_0xd071('0x36')]['fields']));_0x184020[_0xd071('0x3a')]=_0x184020[_0xd071('0x3a')]['length']?_0x184020[_0xd071('0x3a')]:_0x563e7b[_0xd071('0x35')];if(_0x450b85['query'][_0xd071('0x49')]){_0x184020['include']=[{'all':!![]}];}_0x184020=_['merge']({},_0x184020,_0x450b85[_0xd071('0x46')]);return db[_0xd071('0x31')][_0xd071('0x4a')](_0x184020)[_0xd071('0x29')](handleEntityNotFound(_0x1ddc12,null))[_0xd071('0x29')](respondWithResult(_0x1ddc12,null))[_0xd071('0x4b')](handleError(_0x1ddc12,null));};exports['create']=function(_0x4c1211,_0x1bd9b2){return db['SmsApplication'][_0xd071('0x4c')](_0x4c1211[_0xd071('0x4d')],{})[_0xd071('0x29')](respondWithResult(_0x1bd9b2,0xc9))['catch'](handleError(_0x1bd9b2,null));};exports[_0xd071('0x28')]=function(_0x17886b,_0x3d5821){if(_0x17886b[_0xd071('0x4d')]['id']){delete _0x17886b[_0xd071('0x4d')]['id'];}return db[_0xd071('0x31')][_0xd071('0x4a')]({'where':{'id':_0x17886b[_0xd071('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d5821,null))[_0xd071('0x29')](saveUpdates(_0x17886b[_0xd071('0x4d')],null))['then'](respondWithResult(_0x3d5821,null))[_0xd071('0x4b')](handleError(_0x3d5821,null));};exports[_0xd071('0x2a')]=function(_0x2e23b7,_0x3f03f7){return db[_0xd071('0x31')][_0xd071('0x4a')]({'where':{'id':_0x2e23b7[_0xd071('0x48')]['id']}})[_0xd071('0x29')](handleEntityNotFound(_0x3f03f7,null))['then'](removeEntity(_0x3f03f7,null))[_0xd071('0x4b')](handleError(_0x3f03f7,null));}; \ No newline at end of file +var _0x2df5=['sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../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','SmsApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','rimraf','zip-dir','bluebird','mustache','path'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x2df5,0x123));var _0x52df=function(_0x132c6f,_0x5fd92c){_0x132c6f=_0x132c6f-0x0;var _0x5ba3f5=_0x2df5[_0x132c6f];return _0x5ba3f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x52df('0x0'));var zipdir=require(_0x52df('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x52df('0x2'));var Mustache=require(_0x52df('0x3'));var util=require('util');var path=require(_0x52df('0x4'));var sox=require(_0x52df('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x52df('0x6'));var _=require(_0x52df('0x7'));var squel=require(_0x52df('0x8'));var crypto=require('crypto');var jsforce=require(_0x52df('0x9'));var deskjs=require(_0x52df('0xa'));var toCsv=require('to-csv');var querystring=require(_0x52df('0xb'));var Papa=require(_0x52df('0xc'));var Redis=require(_0x52df('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x52df('0xe'));var hardwareService=require(_0x52df('0xf'));var logger=require(_0x52df('0x10'))(_0x52df('0x11'));var utils=require(_0x52df('0x12'));var config=require(_0x52df('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x52df('0x14'))['db'];function respondWithStatusCode(_0x5429bf,_0x51f81b){_0x51f81b=_0x51f81b||0xcc;return function(_0x38245b){if(_0x38245b){return _0x5429bf[_0x52df('0x15')](_0x51f81b);}return _0x5429bf[_0x52df('0x16')](_0x51f81b)[_0x52df('0x17')]();};}function respondWithResult(_0x49ce87,_0x346ce5){_0x346ce5=_0x346ce5||0xc8;return function(_0x2069c8){if(_0x2069c8){return _0x49ce87[_0x52df('0x16')](_0x346ce5)[_0x52df('0x18')](_0x2069c8);}};}function respondWithFilteredResult(_0x68f085,_0x47b27d){return function(_0x5cfeff){if(_0x5cfeff){var _0x51f076=typeof _0x47b27d[_0x52df('0x19')]===_0x52df('0x1a')&&typeof _0x47b27d[_0x52df('0x1b')]===_0x52df('0x1a');var _0x352273=_0x5cfeff['count'];var _0x44603c=_0x51f076?0x0:_0x47b27d[_0x52df('0x19')];var _0x198053=_0x51f076?_0x5cfeff[_0x52df('0x1c')]:_0x47b27d['offset']+_0x47b27d[_0x52df('0x1b')];var _0x332572;if(_0x198053>=_0x352273){_0x198053=_0x352273;_0x332572=0xc8;}else{_0x332572=0xce;}_0x68f085[_0x52df('0x16')](_0x332572);return _0x68f085[_0x52df('0x1d')]('Content-Range',_0x44603c+'-'+_0x198053+'/'+_0x352273)[_0x52df('0x18')](_0x5cfeff);}return null;};}function patchUpdates(_0x5dd3d5){return function(_0x18de94){try{jsonpatch[_0x52df('0x1e')](_0x18de94,_0x5dd3d5,!![]);}catch(_0x433af7){return BPromise['reject'](_0x433af7);}return _0x18de94[_0x52df('0x1f')]();};}function saveUpdates(_0x16e367,_0x3743fe){return function(_0x2047d3){if(_0x2047d3){return _0x2047d3[_0x52df('0x20')](_0x16e367)[_0x52df('0x21')](function(_0x3b3faa){return _0x3b3faa;});}return null;};}function removeEntity(_0x578041,_0x3f689a){return function(_0x3816c3){if(_0x3816c3){return _0x3816c3[_0x52df('0x22')]()['then'](function(){_0x578041[_0x52df('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d7446,_0x12721e){return function(_0x5225d1){if(!_0x5225d1){_0x3d7446[_0x52df('0x15')](0x194);}return _0x5225d1;};}function handleError(_0x4fc92d,_0xf10462){_0xf10462=_0xf10462||0x1f4;return function(_0xf54e8e){logger[_0x52df('0x23')](_0xf54e8e[_0x52df('0x24')]);if(_0xf54e8e[_0x52df('0x25')]){delete _0xf54e8e['name'];}_0x4fc92d['status'](_0xf10462)[_0x52df('0x26')](_0xf54e8e);};}exports[_0x52df('0x27')]=function(_0x2b6938,_0x8b5f56){var _0x523245={},_0x328aa7={},_0x621917={'count':0x0,'rows':[]};var _0x15098e=_['map'](db[_0x52df('0x28')][_0x52df('0x29')],function(_0xbd5e0e){return{'name':_0xbd5e0e[_0x52df('0x2a')],'type':_0xbd5e0e[_0x52df('0x2b')][_0x52df('0x2c')]};});_0x328aa7[_0x52df('0x2d')]=_[_0x52df('0x2e')](_0x15098e,_0x52df('0x25'));_0x328aa7[_0x52df('0x2f')]=_[_0x52df('0x30')](_0x2b6938[_0x52df('0x2f')]);_0x328aa7[_0x52df('0x31')]=_[_0x52df('0x32')](_0x328aa7[_0x52df('0x2d')],_0x328aa7['query']);_0x523245[_0x52df('0x33')]=_['intersection'](_0x328aa7[_0x52df('0x2d')],qs[_0x52df('0x34')](_0x2b6938['query'][_0x52df('0x34')]));_0x523245[_0x52df('0x33')]=_0x523245[_0x52df('0x33')][_0x52df('0x35')]?_0x523245[_0x52df('0x33')]:_0x328aa7[_0x52df('0x2d')];if(!_0x2b6938[_0x52df('0x2f')][_0x52df('0x36')](_0x52df('0x37'))){_0x523245['limit']=qs[_0x52df('0x1b')](_0x2b6938[_0x52df('0x2f')][_0x52df('0x1b')]);_0x523245[_0x52df('0x19')]=qs[_0x52df('0x19')](_0x2b6938[_0x52df('0x2f')][_0x52df('0x19')]);}_0x523245[_0x52df('0x38')]=qs[_0x52df('0x39')](_0x2b6938[_0x52df('0x2f')][_0x52df('0x39')]);_0x523245['where']=qs[_0x52df('0x31')](_[_0x52df('0x3a')](_0x2b6938[_0x52df('0x2f')],_0x328aa7['filters']),_0x15098e);if(_0x2b6938[_0x52df('0x2f')][_0x52df('0x3b')]){_0x523245[_0x52df('0x3c')]=_[_0x52df('0x3d')](_0x523245[_0x52df('0x3c')],{'$or':_['map'](_0x15098e,function(_0x3f58a9){if(_0x3f58a9[_0x52df('0x2b')]!==_0x52df('0x3e')){var _0x3d7a4f={};_0x3d7a4f[_0x3f58a9[_0x52df('0x25')]]={'$like':'%'+_0x2b6938[_0x52df('0x2f')][_0x52df('0x3b')]+'%'};return _0x3d7a4f;}})});}_0x523245=_['merge']({},_0x523245,_0x2b6938[_0x52df('0x3f')]);var _0x10664c={'where':_0x523245[_0x52df('0x3c')]};return db[_0x52df('0x28')][_0x52df('0x1c')](_0x10664c)['then'](function(_0x3215bd){_0x621917['count']=_0x3215bd;if(_0x2b6938[_0x52df('0x2f')][_0x52df('0x40')]){_0x523245[_0x52df('0x41')]=[{'all':!![]}];}return db[_0x52df('0x28')][_0x52df('0x42')](_0x523245);})[_0x52df('0x21')](function(_0x5abe9c){_0x621917[_0x52df('0x43')]=_0x5abe9c;return _0x621917;})['then'](respondWithFilteredResult(_0x8b5f56,_0x523245))[_0x52df('0x44')](handleError(_0x8b5f56,null));};exports[_0x52df('0x45')]=function(_0x15330a,_0x52d114){var _0x354393={'raw':!![],'where':{'id':_0x15330a[_0x52df('0x46')]['id']}},_0x56413d={};_0x56413d[_0x52df('0x2d')]=_[_0x52df('0x30')](db['SmsApplication']['rawAttributes']);_0x56413d[_0x52df('0x2f')]=_[_0x52df('0x30')](_0x15330a[_0x52df('0x2f')]);_0x56413d[_0x52df('0x31')]=_[_0x52df('0x32')](_0x56413d[_0x52df('0x2d')],_0x56413d[_0x52df('0x2f')]);_0x354393[_0x52df('0x33')]=_[_0x52df('0x32')](_0x56413d[_0x52df('0x2d')],qs['fields'](_0x15330a[_0x52df('0x2f')][_0x52df('0x34')]));_0x354393['attributes']=_0x354393[_0x52df('0x33')][_0x52df('0x35')]?_0x354393[_0x52df('0x33')]:_0x56413d[_0x52df('0x2d')];if(_0x15330a['query']['includeAll']){_0x354393['include']=[{'all':!![]}];}_0x354393=_[_0x52df('0x3d')]({},_0x354393,_0x15330a[_0x52df('0x3f')]);return db[_0x52df('0x28')]['find'](_0x354393)[_0x52df('0x21')](handleEntityNotFound(_0x52d114,null))['then'](respondWithResult(_0x52d114,null))[_0x52df('0x44')](handleError(_0x52d114,null));};exports['create']=function(_0x354806,_0x1bceb7){return db[_0x52df('0x28')][_0x52df('0x47')](_0x354806[_0x52df('0x48')],{})[_0x52df('0x21')](respondWithResult(_0x1bceb7,0xc9))[_0x52df('0x44')](handleError(_0x1bceb7,null));};exports[_0x52df('0x20')]=function(_0x5e31e6,_0x2c4c0f){if(_0x5e31e6['body']['id']){delete _0x5e31e6[_0x52df('0x48')]['id'];}return db['SmsApplication']['find']({'where':{'id':_0x5e31e6[_0x52df('0x46')]['id']}})[_0x52df('0x21')](handleEntityNotFound(_0x2c4c0f,null))[_0x52df('0x21')](saveUpdates(_0x5e31e6['body'],null))['then'](respondWithResult(_0x2c4c0f,null))[_0x52df('0x44')](handleError(_0x2c4c0f,null));};exports[_0x52df('0x22')]=function(_0x204749,_0x15235c){return db[_0x52df('0x28')][_0x52df('0x49')]({'where':{'id':_0x204749[_0x52df('0x46')]['id']}})['then'](handleEntityNotFound(_0x15235c,null))['then'](removeEntity(_0x15235c,null))[_0x52df('0x44')](handleError(_0x15235c,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index c028d4f..0dbc111 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 _0x127f=['rimraf','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2f5c10,_0x104d44){var _0x652ebd=function(_0x38f684){while(--_0x38f684){_0x2f5c10['push'](_0x2f5c10['shift']());}};_0x652ebd(++_0x104d44);}(_0x127f,0xbc));var _0xf127=function(_0x2a83dd,_0x595542){_0x2a83dd=_0x2a83dd-0x0;var _0x5c89f6=_0x127f[_0x2a83dd];return _0x5c89f6;};'use strict';var _=require(_0xf127('0x0'));var util=require(_0xf127('0x1'));var logger=require(_0xf127('0x2'))('api');var moment=require(_0xf127('0x3'));var BPromise=require(_0xf127('0x4'));var rp=require(_0xf127('0x5'));var fs=require('fs');var path=require(_0xf127('0x6'));var rimraf=require(_0xf127('0x7'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0xf127('0x8')]=function(_0x560234,_0x22864d){return _0x560234[_0xf127('0x9')](_0xf127('0xa'),attributes,{'tableName':_0xf127('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf127('0xc')});}; \ No newline at end of file +var _0x4c5e=['SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x4c5e,0x73));var _0xe4c5=function(_0xf298d9,_0x5c313d){_0xf298d9=_0xf298d9-0x0;var _0x488aef=_0x4c5e[_0xf298d9];return _0x488aef;};'use strict';var _=require(_0xe4c5('0x0'));var util=require(_0xe4c5('0x1'));var logger=require('../../config/logger')(_0xe4c5('0x2'));var moment=require(_0xe4c5('0x3'));var BPromise=require(_0xe4c5('0x4'));var rp=require(_0xe4c5('0x5'));var fs=require('fs');var path=require(_0xe4c5('0x6'));var rimraf=require(_0xe4c5('0x7'));var config=require(_0xe4c5('0x8'));var attributes=require(_0xe4c5('0x9'));module[_0xe4c5('0xa')]=function(_0x229899,_0x585573){return _0x229899['define'](_0xe4c5('0xb'),attributes,{'tableName':_0xe4c5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe4c5('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 803f67b..46398d4 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 _0xc23d=['stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xc23d,0x7f));var _0xdc23=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0xc23d[_0x5a8aa3];return _0x5d0458;};'use strict';var _=require(_0xdc23('0x0'));var util=require(_0xdc23('0x1'));var moment=require(_0xdc23('0x2'));var BPromise=require(_0xdc23('0x3'));var rs=require(_0xdc23('0x4'));var fs=require('fs');var Redis=require(_0xdc23('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc23('0x6'));var logger=require(_0xdc23('0x7'))(_0xdc23('0x8'));var config=require(_0xdc23('0x9'));var jayson=require(_0xdc23('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17cb48,_0x47c9cd,_0x2a5303){return new BPromise(function(_0x4d16cf,_0x459f6d){return client[_0xdc23('0xb')](_0x17cb48,_0x2a5303)[_0xdc23('0xc')](function(_0x43ba94){logger[_0xdc23('0xd')]('SmsApplication,\x20%s,\x20%s',_0x47c9cd,_0xdc23('0xe'));logger[_0xdc23('0xf')](_0xdc23('0x10'),_0x47c9cd,_0xdc23('0xe'),JSON[_0xdc23('0x11')](_0x43ba94));if(_0x43ba94[_0xdc23('0x12')]){if(_0x43ba94['error'][_0xdc23('0x13')]===0x1f4){logger[_0xdc23('0x12')](_0xdc23('0x14'),_0x47c9cd,_0x43ba94[_0xdc23('0x12')]['message']);return _0x459f6d(_0x43ba94[_0xdc23('0x12')][_0xdc23('0x15')]);}logger[_0xdc23('0x12')](_0xdc23('0x14'),_0x47c9cd,_0x43ba94[_0xdc23('0x12')][_0xdc23('0x15')]);return _0x4d16cf(_0x43ba94['error'][_0xdc23('0x15')]);}else{logger['info'](_0xdc23('0x14'),_0x47c9cd,_0xdc23('0xe'));_0x4d16cf(_0x43ba94[_0xdc23('0x16')]['message']);}})[_0xdc23('0x17')](function(_0x476654){logger[_0xdc23('0x12')](_0xdc23('0x14'),_0x47c9cd,_0x476654);_0x459f6d(_0x476654);});});} \ No newline at end of file +var _0xc373=['../../config/environment','jayson/promise','request','then','info','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x438c86,_0xb5313c){var _0x3f8e3f=function(_0x570755){while(--_0x570755){_0x438c86['push'](_0x438c86['shift']());}};_0x3f8e3f(++_0xb5313c);}(_0xc373,0x1c7));var _0x3c37=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0xc373[_0x3bd52b];return _0x1e5b89;};'use strict';var _=require('lodash');var util=require(_0x3c37('0x0'));var moment=require(_0x3c37('0x1'));var BPromise=require(_0x3c37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c37('0x3'))['db'];var utils=require(_0x3c37('0x4'));var logger=require(_0x3c37('0x5'))(_0x3c37('0x6'));var config=require(_0x3c37('0x7'));var jayson=require(_0x3c37('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e1941,_0x1244e6,_0x14b09d){return new BPromise(function(_0x10617,_0x465de6){return client[_0x3c37('0x9')](_0x2e1941,_0x14b09d)[_0x3c37('0xa')](function(_0x59d4f9){logger[_0x3c37('0xb')]('SmsApplication,\x20%s,\x20%s',_0x1244e6,'request\x20sent');logger[_0x3c37('0xc')](_0x3c37('0xd'),_0x1244e6,_0x3c37('0xe'),JSON[_0x3c37('0xf')](_0x59d4f9));if(_0x59d4f9[_0x3c37('0x10')]){if(_0x59d4f9[_0x3c37('0x10')][_0x3c37('0x11')]===0x1f4){logger['error'](_0x3c37('0x12'),_0x1244e6,_0x59d4f9[_0x3c37('0x10')][_0x3c37('0x13')]);return _0x465de6(_0x59d4f9['error']['message']);}logger[_0x3c37('0x10')]('SmsApplication,\x20%s,\x20%s',_0x1244e6,_0x59d4f9['error'][_0x3c37('0x13')]);return _0x10617(_0x59d4f9[_0x3c37('0x10')][_0x3c37('0x13')]);}else{logger[_0x3c37('0xb')](_0x3c37('0x12'),_0x1244e6,_0x3c37('0xe'));_0x10617(_0x59d4f9[_0x3c37('0x14')][_0x3c37('0x13')]);}})[_0x3c37('0x15')](function(_0x4e1560){logger[_0x3c37('0x10')](_0x3c37('0x12'),_0x1244e6,_0x4e1560);_0x465de6(_0x4e1560);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 867081c..bf2f319 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 _0xd7d1=['update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','download','post','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0xa07a61,_0x480ee3){_0xa07a61=_0xa07a61-0x0;var _0x2e717b=_0xd7d1[_0xa07a61];return _0x2e717b;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xb')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xb')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller['getMessages']);router[_0x1d7d('0xb')]('/:id/download',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/',auth[_0x1d7d('0xc')](),controller['create']);router[_0x1d7d('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router[_0x1d7d('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x1d7d('0x15')](_0x1d7d('0x16'),_0x1d7d('0x17')),controller[_0x1d7d('0x18')]);router[_0x1d7d('0x19')]('/:id',auth[_0x1d7d('0xc')](),interaction[_0x1d7d('0x15')]('sms',_0x1d7d('0x1a')),controller[_0x1d7d('0x1b')]);router[_0x1d7d('0x1c')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),interaction['tracked'](_0x1d7d('0x16'),_0x1d7d('0x1d')),controller['destroy']);router['delete'](_0x1d7d('0x1e'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1f')]);module[_0x1d7d('0x20')]=router; \ No newline at end of file +var _0x3c81=['express','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','addTags','tracked','sms','update','delete','smsinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout'];(function(_0x1e5f05,_0x67d587){var _0x5e6dbd=function(_0x5783e9){while(--_0x5783e9){_0x1e5f05['push'](_0x1e5f05['shift']());}};_0x5e6dbd(++_0x67d587);}(_0x3c81,0x102));var _0x13c8=function(_0x15f6aa,_0x151d55){_0x15f6aa=_0x15f6aa-0x0;var _0x2cefe3=_0x3c81[_0x15f6aa];return _0x2cefe3;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0x6')](_0x13c8('0xf'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);router['post'](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x13')]);router[_0x13c8('0x11')]('/:id/tags',auth[_0x13c8('0x7')](),interaction['tracked']('sms','smsinteraction:addtags'),controller[_0x13c8('0x14')]);router['put'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),'smsinteraction:update'),controller[_0x13c8('0x17')]);router[_0x13c8('0x18')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),_0x13c8('0x19')),controller[_0x13c8('0x1a')]);router[_0x13c8('0x18')](_0x13c8('0x1b'),auth[_0x13c8('0x7')](),controller['removeTags']);module[_0x13c8('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 7618d60..21fb621 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 _0x0833=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0833,0x1bd));var _0x3083=function(_0x51ded0,_0x45b05b){_0x51ded0=_0x51ded0-0x0;var _0x492c4f=_0x0833[_0x51ded0];return _0x492c4f;};'use strict';var Sequelize=require(_0x3083('0x0'));var moment=require(_0x3083('0x1'));module[_0x3083('0x2')]={'closed':{'type':Sequelize[_0x3083('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3083('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3083('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3083('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3083('0x6')]('in',_0x3083('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3083('0x6')]('in',_0x3083('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x42f4=['DATE','STRING','ENUM','out','INTEGER','sequelize','exports','BOOLEAN'];(function(_0x489d5d,_0x5dfa8c){var _0x120435=function(_0xfb4fa0){while(--_0xfb4fa0){_0x489d5d['push'](_0x489d5d['shift']());}};_0x120435(++_0x5dfa8c);}(_0x42f4,0x19d));var _0x442f=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x42f4[_0x8dc04d];return _0x2f5f28;};'use strict';var Sequelize=require(_0x442f('0x0'));var moment=require('moment');module[_0x442f('0x1')]={'closed':{'type':Sequelize[_0x442f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x442f('0x3')]},'disposition':{'type':Sequelize[_0x442f('0x4')]},'secondDisposition':{'type':Sequelize[_0x442f('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x442f('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x442f('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x442f('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x442f('0x5')]('in',_0x442f('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x442f('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x442f('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 2254137..e48082b 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 _0x76a5=['lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsInteraction.socket','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','findAll','query','user','catch','show','model','keys','SmsInteraction','filters','intersection','attributes','fields','length','merge','options','find','body','params','describe','addMessage','SmsMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','sort','where','pick','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','rows','addTags','setTags','spread','color','smsInteractionTags:save','removeTags','download','unix','toString','join','root','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Messages','direction','secret','read','SmsAccount','Account','Owner','get','mkdirSync','Sms','createdAt','closed','closedAt','out','System','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','zip-dir','util','path','ejs'];(function(_0x451de4,_0x35bc19){var _0x32ccfc=function(_0x47d468){while(--_0x47d468){_0x451de4['push'](_0x451de4['shift']());}};_0x32ccfc(++_0x35bc19);}(_0x76a5,0x74));var _0x576a=function(_0x4ccc2d,_0x437454){_0x4ccc2d=_0x4ccc2d-0x0;var _0x3284ae=_0x76a5[_0x4ccc2d];return _0x3284ae;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x576a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x576a('0x1'));var path=require(_0x576a('0x2'));var ejs=require(_0x576a('0x3'));var fs=require('fs');var _=require(_0x576a('0x4'));var Redis=require(_0x576a('0x5'));var interaction=require(_0x576a('0x6'));var qs=require(_0x576a('0x7'));var pdf=require(_0x576a('0x8'));var logger=require(_0x576a('0x9'))(_0x576a('0xa'));var config=require(_0x576a('0xb'));var db=require(_0x576a('0xc'))['db'];config[_0x576a('0xd')]=_['defaults'](config[_0x576a('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x576a('0xe'))(new Redis(config[_0x576a('0xd')]));require(_0x576a('0xf'))['register'](socket);function respondWithStatusCode(_0x1d7dd6,_0x10ef4e){_0x10ef4e=_0x10ef4e||0xcc;return function(_0x2e9823){if(_0x2e9823){return _0x1d7dd6[_0x576a('0x10')](_0x10ef4e);}return _0x1d7dd6['status'](_0x10ef4e)[_0x576a('0x11')]();};}function respondWithResult(_0x1623e2,_0x3bdfa9){_0x3bdfa9=_0x3bdfa9||0xc8;return function(_0x50309a){if(_0x50309a){return _0x1623e2[_0x576a('0x12')](_0x3bdfa9)[_0x576a('0x13')](_0x50309a);}};}function respondWithFilteredResult(_0x4f1e44,_0x304e27){return function(_0x3826cc){if(_0x3826cc){var _0x21111e=typeof _0x304e27[_0x576a('0x14')]==='undefined'&&typeof _0x304e27['limit']===_0x576a('0x15');var _0x2548da=_0x3826cc['count'];var _0x19f26b=_0x21111e?0x0:_0x304e27['offset'];var _0x415b9c=_0x21111e?_0x3826cc[_0x576a('0x16')]:_0x304e27[_0x576a('0x14')]+_0x304e27[_0x576a('0x17')];var _0x60c7d9;if(_0x415b9c>=_0x2548da){_0x415b9c=_0x2548da;_0x60c7d9=0xc8;}else{_0x60c7d9=0xce;}_0x4f1e44[_0x576a('0x12')](_0x60c7d9);return _0x4f1e44[_0x576a('0x18')](_0x576a('0x19'),_0x19f26b+'-'+_0x415b9c+'/'+_0x2548da)[_0x576a('0x13')](_0x3826cc);}return null;};}function saveUpdates(_0x4697de){return function(_0x2a39a5){if(_0x2a39a5){return _0x2a39a5[_0x576a('0x1a')](_0x4697de)[_0x576a('0x1b')](function(_0x995abf){return _0x995abf;});}return null;};}function removeEntity(_0x1ee08d){return function(_0x29284e){if(_0x29284e){return _0x29284e[_0x576a('0x1c')]()[_0x576a('0x1b')](function(){_0x1ee08d[_0x576a('0x12')](0xcc)[_0x576a('0x11')]();});}};}function handleEntityNotFound(_0x5d95e3){return function(_0x35713a){if(!_0x35713a){_0x5d95e3[_0x576a('0x10')](0x194);}return _0x35713a;};}function handleError(_0x8aefaf,_0x37dd51){_0x37dd51=_0x37dd51||0x1f4;return function(_0x3d8650){logger[_0x576a('0x1d')](_0x3d8650['stack']);if(_0x3d8650[_0x576a('0x1e')]){delete _0x3d8650[_0x576a('0x1e')];}_0x8aefaf[_0x576a('0x12')](_0x37dd51)[_0x576a('0x1f')](_0x3d8650);};}exports[_0x576a('0x20')]=function(_0x3dcfa8,_0x542dfe){var _0x3fff5e={};var _0x34a0aa=_[_0x576a('0x21')](db['SmsInteraction'][_0x576a('0x22')],function(_0x50f92a){return{'name':_0x50f92a[_0x576a('0x23')],'type':_0x50f92a[_0x576a('0x24')][_0x576a('0x25')]};});_0x3fff5e=qs['getOptions'](_0x34a0aa,_0x3dcfa8);return interaction[_0x576a('0x26')]('sms',_0x3dcfa8[_0x576a('0x27')],_0x3dcfa8[_0x576a('0x28')],_0x3fff5e,_0x34a0aa)[_0x576a('0x1b')](respondWithFilteredResult(_0x542dfe,_0x3fff5e))[_0x576a('0x29')](handleError(_0x542dfe,null));};exports[_0x576a('0x2a')]=function(_0x51058a,_0x302ad4){var _0x307893={'raw':![],'where':{'id':_0x51058a['params']['id']}},_0x1a9f83={};_0x1a9f83[_0x576a('0x2b')]=_[_0x576a('0x2c')](db[_0x576a('0x2d')][_0x576a('0x22')]);_0x1a9f83[_0x576a('0x27')]=_[_0x576a('0x2c')](_0x51058a[_0x576a('0x27')]);_0x1a9f83[_0x576a('0x2e')]=_[_0x576a('0x2f')](_0x1a9f83[_0x576a('0x2b')],_0x1a9f83[_0x576a('0x27')]);_0x307893[_0x576a('0x30')]=_[_0x576a('0x2f')](_0x1a9f83[_0x576a('0x2b')],qs[_0x576a('0x31')](_0x51058a['query'][_0x576a('0x31')]));_0x307893[_0x576a('0x30')]=_0x307893[_0x576a('0x30')][_0x576a('0x32')]?_0x307893[_0x576a('0x30')]:_0x1a9f83['model'];if(_0x51058a[_0x576a('0x27')]['includeAll']){_0x307893['include']=[{'all':!![]}];}_0x307893=_[_0x576a('0x33')]({},_0x307893,_0x51058a[_0x576a('0x34')]);return db[_0x576a('0x2d')][_0x576a('0x35')](_0x307893)[_0x576a('0x1b')](handleEntityNotFound(_0x302ad4,null))['then'](respondWithResult(_0x302ad4,null))[_0x576a('0x29')](handleError(_0x302ad4,null));};exports['create']=function(_0x201f1e,_0xc31bb5){return db[_0x576a('0x2d')]['create'](_0x201f1e[_0x576a('0x36')],{})[_0x576a('0x1b')](respondWithResult(_0xc31bb5,0xc9))[_0x576a('0x29')](handleError(_0xc31bb5,null));};exports[_0x576a('0x1a')]=function(_0x3b3e17,_0x2288f6){if(_0x3b3e17['body']['id']){delete _0x3b3e17[_0x576a('0x36')]['id'];}return db[_0x576a('0x2d')][_0x576a('0x35')]({'where':{'id':_0x3b3e17['params']['id']}})[_0x576a('0x1b')](handleEntityNotFound(_0x2288f6,null))[_0x576a('0x1b')](saveUpdates(_0x3b3e17[_0x576a('0x36')],null))[_0x576a('0x1b')](respondWithResult(_0x2288f6,null))[_0x576a('0x29')](handleError(_0x2288f6,null));};exports[_0x576a('0x1c')]=function(_0x4d230d,_0x1d6362){return db['SmsInteraction'][_0x576a('0x35')]({'where':{'id':_0x4d230d[_0x576a('0x37')]['id']}})[_0x576a('0x1b')](handleEntityNotFound(_0x1d6362,null))[_0x576a('0x1b')](removeEntity(_0x1d6362,null))['catch'](handleError(_0x1d6362,null));};exports[_0x576a('0x38')]=function(_0x325e4b,_0x23d76d){return db[_0x576a('0x2d')][_0x576a('0x38')]()[_0x576a('0x1b')](respondWithResult(_0x23d76d,null))[_0x576a('0x29')](handleError(_0x23d76d,null));};exports[_0x576a('0x39')]=function(_0x3952d7,_0xc53048){return db[_0x576a('0x3a')][_0x576a('0x35')]({'where':{'id':_0x3952d7['params']['id']}})[_0x576a('0x1b')](handleEntityNotFound(_0xc53048,null))[_0x576a('0x1b')](function(_0x4f5218){if(_0x4f5218){return _0x4f5218['addMessage'](_0x3952d7[_0x576a('0x36')][_0x576a('0x3b')],_['omit'](_0x3952d7[_0x576a('0x36')],[_0x576a('0x3b'),'id'])||{});}})[_0x576a('0x1b')](respondWithResult(_0xc53048,null))[_0x576a('0x29')](handleError(_0xc53048,null));};exports[_0x576a('0x3c')]=function(_0x5d25e3,_0x261277){var _0x2f3537={'raw':![],'where':{}};var _0x4048be={};var _0x1bfc34={'count':0x0,'rows':[]};return db[_0x576a('0x2d')][_0x576a('0x3d')]({'where':{'id':_0x5d25e3['params']['id']}})[_0x576a('0x1b')](handleEntityNotFound(_0x261277,null))[_0x576a('0x1b')](function(_0x38e2ab){if(_0x38e2ab){_0x4048be[_0x576a('0x2b')]=_['keys'](db[_0x576a('0x3a')][_0x576a('0x22')]);_0x4048be[_0x576a('0x27')]=_[_0x576a('0x2c')](_0x5d25e3[_0x576a('0x27')]);_0x4048be[_0x576a('0x2e')]=_[_0x576a('0x2f')](_0x4048be[_0x576a('0x2b')],_0x4048be[_0x576a('0x27')]);_0x2f3537['attributes']=_[_0x576a('0x2f')](_0x4048be['model'],qs[_0x576a('0x31')](_0x5d25e3[_0x576a('0x27')][_0x576a('0x31')]));_0x2f3537[_0x576a('0x30')]=_0x2f3537[_0x576a('0x30')]['length']?_0x2f3537[_0x576a('0x30')]:_0x4048be[_0x576a('0x2b')];if(!_0x5d25e3[_0x576a('0x27')][_0x576a('0x3e')](_0x576a('0x3f'))){_0x2f3537[_0x576a('0x17')]=qs[_0x576a('0x17')](_0x5d25e3['query']['limit']);_0x2f3537[_0x576a('0x14')]=qs[_0x576a('0x14')](_0x5d25e3[_0x576a('0x27')][_0x576a('0x14')]);}_0x2f3537['order']=qs[_0x576a('0x40')](_0x5d25e3[_0x576a('0x27')]['sort']);_0x2f3537[_0x576a('0x41')]=qs[_0x576a('0x2e')](_[_0x576a('0x42')](_0x5d25e3['query'],_0x4048be[_0x576a('0x2e')]));_0x2f3537[_0x576a('0x41')][_0x576a('0x43')]=_0x38e2ab['id'];if(_0x5d25e3['query'][_0x576a('0x44')]){_0x2f3537['where']=_[_0x576a('0x33')](_0x2f3537[_0x576a('0x41')],{'$or':_['map'](_0x2f3537[_0x576a('0x30')],function(_0x4bbde0){var _0x42e3e5={};_0x42e3e5[_0x4bbde0]={'$like':'%'+_0x5d25e3[_0x576a('0x27')][_0x576a('0x44')]+'%'};return _0x42e3e5;})});}if(_0x5d25e3[_0x576a('0x27')][_0x576a('0x45')]){var _0x48b25e=_0x5d25e3['query'][_0x576a('0x45')][_0x576a('0x46')](',');var _0x190274={};_0x190274[_0x48b25e[0x0]]={'$gte':moment(_0x48b25e[0x1])[_0x576a('0x47')](_0x576a('0x48'))};_0x2f3537[_0x576a('0x41')]=_[_0x576a('0x33')](_0x2f3537[_0x576a('0x41')],_0x190274);}_0x2f3537=_['merge']({},_0x2f3537,_0x5d25e3[_0x576a('0x34')]);return db[_0x576a('0x3a')][_0x576a('0x16')]({'where':_0x2f3537[_0x576a('0x41')]})[_0x576a('0x1b')](function(_0x5aaf72){_0x1bfc34[_0x576a('0x16')]=_0x5aaf72;if(_0x5d25e3[_0x576a('0x27')][_0x576a('0x49')]){_0x2f3537[_0x576a('0x4a')]=[{'all':!![]}];}return db['SmsMessage'][_0x576a('0x26')](_0x2f3537);})[_0x576a('0x1b')](function(_0x23f723){_0x1bfc34[_0x576a('0x4b')]=_0x23f723;return _0x1bfc34;});}})['then'](respondWithFilteredResult(_0x261277,_0x2f3537))[_0x576a('0x29')](handleError(_0x261277,null));};exports[_0x576a('0x4c')]=function(_0x3cdfe9,_0x180ea9){return db[_0x576a('0x2d')][_0x576a('0x35')]({'where':{'id':_0x3cdfe9[_0x576a('0x37')]['id']}})['then'](handleEntityNotFound(_0x180ea9,null))['then'](function(_0xa01f08){if(_0xa01f08){return _0xa01f08[_0x576a('0x4d')](_0x3cdfe9[_0x576a('0x36')][_0x576a('0x3b')],_['omit'](_0x3cdfe9[_0x576a('0x36')],[_0x576a('0x3b'),'id'])||{})[_0x576a('0x4e')](function(){return db['Tag']['findAll']({'attributes':['id',_0x576a('0x1e'),_0x576a('0x4f')],'where':{'id':_0x3cdfe9[_0x576a('0x36')][_0x576a('0x3b')]}});})[_0x576a('0x1b')](function(_0x303fe7){socket['emit'](_0x576a('0x50'),{'id':Number(_0x3cdfe9[_0x576a('0x37')]['id']),'tags':_0x303fe7||[]});return{'id':Number(_0x3cdfe9[_0x576a('0x37')]['id']),'tags':_0x303fe7||[]};});}})['then'](respondWithResult(_0x180ea9,null))[_0x576a('0x29')](handleError(_0x180ea9,null));};exports[_0x576a('0x51')]=function(_0xd376b0,_0xc0b8e9){return db[_0x576a('0x2d')]['find']({'where':{'id':_0xd376b0[_0x576a('0x37')]['id']}})['then'](handleEntityNotFound(_0xc0b8e9,null))['then'](function(_0x5b4c1f){if(_0x5b4c1f){return _0x5b4c1f['removeTags'](_0xd376b0['query'][_0x576a('0x3b')]);}})[_0x576a('0x1b')](respondWithStatusCode(_0xc0b8e9,null))[_0x576a('0x29')](handleError(_0xc0b8e9,null));};exports[_0x576a('0x52')]=function(_0x64ad14,_0x599141){var _0x4051d6=moment()[_0x576a('0x53')]()[_0x576a('0x54')]();var _0x3b2b6a=path[_0x576a('0x55')](config[_0x576a('0x56')],'server','files',_0x576a('0x57'));var _0x2aa641=path[_0x576a('0x55')](_0x3b2b6a,_0x4051d6);var _0x590d91=util[_0x576a('0x47')](_0x576a('0x58'),_0x64ad14[_0x576a('0x37')]['id'],_0x4051d6);var _0x54f089=path[_0x576a('0x55')](_0x3b2b6a,_0x590d91);var _0x315a02=[];_0x315a02[_0x576a('0x59')]({'model':db['User'],'as':_0x576a('0x5a'),'attributes':['id',_0x576a('0x5b')],'raw':!![]});_0x315a02[_0x576a('0x59')]({'model':db[_0x576a('0x5c')],'as':_0x576a('0x5d'),'attributes':['id',_0x576a('0x5e'),'lastName'],'raw':!![]});var _0x39af4a=[{'model':db[_0x576a('0x3a')],'as':_0x576a('0x5f'),'attributes':['id',_0x576a('0x36'),'createdAt',_0x576a('0x60'),_0x576a('0x61'),_0x576a('0x62')],'include':_0x315a02}];_0x39af4a['push']({'model':db[_0x576a('0x63')],'as':_0x576a('0x64'),'attributes':['id',_0x576a('0x1e')]});_0x39af4a[_0x576a('0x59')]({'model':db[_0x576a('0x5a')],'as':_0x576a('0x65'),'attributes':['id','fullname']});return db['SmsInteraction'][_0x576a('0x35')]({'where':{'id':_0x64ad14[_0x576a('0x37')]['id']},'include':_0x39af4a})[_0x576a('0x1b')](handleEntityNotFound(_0x599141,null))[_0x576a('0x1b')](function(_0x1b609b){if(_0x1b609b){var _0x1f873d=_0x1b609b[_0x576a('0x66')]({'plain':!![]});fs[_0x576a('0x67')](_0x2aa641);var _0x3705a2={'channel':_0x576a('0x68'),'account':_0x1f873d[_0x576a('0x64')][_0x576a('0x1e')],'agent':_0x1f873d[_0x576a('0x65')]?_0x1f873d[_0x576a('0x65')][_0x576a('0x5b')]:'N.A.','createdAt':moment(_0x1f873d[_0x576a('0x69')])[_0x576a('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0x576a('0x54')](),'closedAt':_0x1f873d[_0x576a('0x6a')]?moment(_0x1f873d[_0x576a('0x6b')])[_0x576a('0x47')](_0x576a('0x48'))[_0x576a('0x54')]():'','disposition':_0x1f873d['disposition'],'messages':_(_0x1f873d[_0x576a('0x5f')])[_0x576a('0x44')]({'secret':![]})[_0x576a('0x21')](function(_0x446221){return{'date':moment(_0x446221[_0x576a('0x69')])[_0x576a('0x47')](_0x576a('0x48'))[_0x576a('0x54')](),'sender':_0x446221[_0x576a('0x60')]===_0x576a('0x6c')?_0x446221[_0x576a('0x5a')]?_0x446221[_0x576a('0x5a')][_0x576a('0x5b')]:_0x576a('0x6d'):_0x446221[_0x576a('0x5d')][_0x576a('0x5e')]+(_0x446221[_0x576a('0x5d')][_0x576a('0x6e')]?'\x20'+_0x446221[_0x576a('0x5d')][_0x576a('0x6e')]:''),'body':_0x446221[_0x576a('0x36')],'direction':_0x446221['direction']===_0x576a('0x6c')?'A':'C','secret':_0x446221[_0x576a('0x61')],'read':_0x446221[_0x576a('0x62')]};})[_0x576a('0x6f')]()};return ejs[_0x576a('0x70')](path[_0x576a('0x55')](config[_0x576a('0x56')],'server',_0x576a('0x71'),_0x576a('0x72')),{'interaction':_0x3705a2})[_0x576a('0x1b')](function(_0x5b2db6){var _0x7c7aec=path[_0x576a('0x55')](_0x2aa641,_0x576a('0x73')+_0x1f873d['id']+'-'+_0x4051d6+'.pdf');var _0x56e535={'path':_0x7c7aec,'channel':_0x576a('0x68'),'interactionId':_0x1f873d['id']};return pdf[_0x576a('0x74')](_0x5b2db6,_0x56e535);})[_0x576a('0x1b')](function(){return new BPromise(function(_0x2b7926,_0x11a72e){zipdir(_0x2aa641,{'saveTo':_0x54f089},function(_0x287795,_0x2acf43){if(_0x287795)return _0x11a72e(_0x287795);return _0x2b7926(_0x2acf43);});})['then'](function(){return new BPromise(function(_0x404c79,_0x883469){rimraf(_0x2aa641,function(_0x3f075f){if(_0x3f075f)_0x883469(_0x3f075f);return _0x404c79();});});})[_0x576a('0x1b')](function(){return _0x599141[_0x576a('0x52')](_0x54f089,_0x590d91,function(_0x5449d6){if(_0x5449d6){console[_0x576a('0x75')](_0x576a('0x76'),_0x5449d6);}else{fs[_0x576a('0x77')](_0x54f089);}});});});}else{return _0x599141[_0x576a('0x10')](0xc8);}})[_0x576a('0x29')](handleError(_0x599141,null));}; \ No newline at end of file +var _0xc6fd=['rows','addTags','omit','spread','color','emit','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','fullname','push','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','User','Owner','get','N.A.','closed','closedAt','disposition','out','System','value','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','then','end','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','findAll','query','user','catch','show','params','keys','filters','intersection','model','attributes','fields','length','include','merge','find','create','body','destroy','describe','addMessage','ids','hasOwnProperty','nolimit','sort','where','pick','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','SmsMessage','includeAll'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xc6fd,0x11d));var _0xdc6f=function(_0x29339e,_0x4eeafa){_0x29339e=_0x29339e-0x0;var _0x7e0447=_0xc6fd[_0x29339e];return _0x7e0447;};'use strict';var rimraf=require(_0xdc6f('0x0'));var zipdir=require(_0xdc6f('0x1'));var moment=require('moment');var BPromise=require(_0xdc6f('0x2'));var util=require(_0xdc6f('0x3'));var path=require(_0xdc6f('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdc6f('0x5'));var Redis=require(_0xdc6f('0x6'));var interaction=require(_0xdc6f('0x7'));var qs=require(_0xdc6f('0x8'));var pdf=require(_0xdc6f('0x9'));var logger=require(_0xdc6f('0xa'))('api');var config=require(_0xdc6f('0xb'));var db=require(_0xdc6f('0xc'))['db'];config[_0xdc6f('0xd')]=_[_0xdc6f('0xe')](config[_0xdc6f('0xd')],{'host':_0xdc6f('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdc6f('0x10'))[_0xdc6f('0x11')](socket);function respondWithStatusCode(_0x578bd4,_0x12d410){_0x12d410=_0x12d410||0xcc;return function(_0x2d9ab3){if(_0x2d9ab3){return _0x578bd4[_0xdc6f('0x12')](_0x12d410);}return _0x578bd4[_0xdc6f('0x13')](_0x12d410)['end']();};}function respondWithResult(_0x1ac7b3,_0x8cfb5){_0x8cfb5=_0x8cfb5||0xc8;return function(_0x3f10a7){if(_0x3f10a7){return _0x1ac7b3[_0xdc6f('0x13')](_0x8cfb5)[_0xdc6f('0x14')](_0x3f10a7);}};}function respondWithFilteredResult(_0x1707a8,_0x2c8b0e){return function(_0x7eeed7){if(_0x7eeed7){var _0x1eef75=typeof _0x2c8b0e[_0xdc6f('0x15')]===_0xdc6f('0x16')&&typeof _0x2c8b0e[_0xdc6f('0x17')]===_0xdc6f('0x16');var _0x50a309=_0x7eeed7[_0xdc6f('0x18')];var _0x88eaa=_0x1eef75?0x0:_0x2c8b0e['offset'];var _0x299f26=_0x1eef75?_0x7eeed7[_0xdc6f('0x18')]:_0x2c8b0e[_0xdc6f('0x15')]+_0x2c8b0e['limit'];var _0x51053b;if(_0x299f26>=_0x50a309){_0x299f26=_0x50a309;_0x51053b=0xc8;}else{_0x51053b=0xce;}_0x1707a8['status'](_0x51053b);return _0x1707a8['set'](_0xdc6f('0x19'),_0x88eaa+'-'+_0x299f26+'/'+_0x50a309)[_0xdc6f('0x14')](_0x7eeed7);}return null;};}function saveUpdates(_0x127467){return function(_0x9d705f){if(_0x9d705f){return _0x9d705f[_0xdc6f('0x1a')](_0x127467)[_0xdc6f('0x1b')](function(_0x5977e7){return _0x5977e7;});}return null;};}function removeEntity(_0x2400b6){return function(_0x151475){if(_0x151475){return _0x151475['destroy']()[_0xdc6f('0x1b')](function(){_0x2400b6['status'](0xcc)[_0xdc6f('0x1c')]();});}};}function handleEntityNotFound(_0x280fd5){return function(_0x584e61){if(!_0x584e61){_0x280fd5[_0xdc6f('0x12')](0x194);}return _0x584e61;};}function handleError(_0x5e88f0,_0x1b58b1){_0x1b58b1=_0x1b58b1||0x1f4;return function(_0x5bf860){logger[_0xdc6f('0x1d')](_0x5bf860[_0xdc6f('0x1e')]);if(_0x5bf860[_0xdc6f('0x1f')]){delete _0x5bf860['name'];}_0x5e88f0[_0xdc6f('0x13')](_0x1b58b1)[_0xdc6f('0x20')](_0x5bf860);};}exports[_0xdc6f('0x21')]=function(_0x1f96a0,_0x35918c){var _0x1f837b={};var _0x120e4d=_[_0xdc6f('0x22')](db[_0xdc6f('0x23')][_0xdc6f('0x24')],function(_0x2e49bc){return{'name':_0x2e49bc[_0xdc6f('0x25')],'type':_0x2e49bc[_0xdc6f('0x26')]['key']};});_0x1f837b=qs['getOptions'](_0x120e4d,_0x1f96a0);return interaction[_0xdc6f('0x27')]('sms',_0x1f96a0[_0xdc6f('0x28')],_0x1f96a0[_0xdc6f('0x29')],_0x1f837b,_0x120e4d)['then'](respondWithFilteredResult(_0x35918c,_0x1f837b))[_0xdc6f('0x2a')](handleError(_0x35918c,null));};exports[_0xdc6f('0x2b')]=function(_0x545f60,_0x2f77dd){var _0x30a944={'raw':![],'where':{'id':_0x545f60[_0xdc6f('0x2c')]['id']}},_0x6ca371={};_0x6ca371['model']=_[_0xdc6f('0x2d')](db[_0xdc6f('0x23')][_0xdc6f('0x24')]);_0x6ca371[_0xdc6f('0x28')]=_[_0xdc6f('0x2d')](_0x545f60['query']);_0x6ca371[_0xdc6f('0x2e')]=_[_0xdc6f('0x2f')](_0x6ca371[_0xdc6f('0x30')],_0x6ca371[_0xdc6f('0x28')]);_0x30a944[_0xdc6f('0x31')]=_[_0xdc6f('0x2f')](_0x6ca371['model'],qs[_0xdc6f('0x32')](_0x545f60[_0xdc6f('0x28')][_0xdc6f('0x32')]));_0x30a944[_0xdc6f('0x31')]=_0x30a944[_0xdc6f('0x31')][_0xdc6f('0x33')]?_0x30a944[_0xdc6f('0x31')]:_0x6ca371[_0xdc6f('0x30')];if(_0x545f60[_0xdc6f('0x28')]['includeAll']){_0x30a944[_0xdc6f('0x34')]=[{'all':!![]}];}_0x30a944=_[_0xdc6f('0x35')]({},_0x30a944,_0x545f60['options']);return db['SmsInteraction'][_0xdc6f('0x36')](_0x30a944)[_0xdc6f('0x1b')](handleEntityNotFound(_0x2f77dd,null))[_0xdc6f('0x1b')](respondWithResult(_0x2f77dd,null))[_0xdc6f('0x2a')](handleError(_0x2f77dd,null));};exports[_0xdc6f('0x37')]=function(_0xf8a51,_0xefdf8){return db[_0xdc6f('0x23')][_0xdc6f('0x37')](_0xf8a51[_0xdc6f('0x38')],{})['then'](respondWithResult(_0xefdf8,0xc9))[_0xdc6f('0x2a')](handleError(_0xefdf8,null));};exports[_0xdc6f('0x1a')]=function(_0x3a7e44,_0x2d3ff3){if(_0x3a7e44[_0xdc6f('0x38')]['id']){delete _0x3a7e44[_0xdc6f('0x38')]['id'];}return db['SmsInteraction'][_0xdc6f('0x36')]({'where':{'id':_0x3a7e44[_0xdc6f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2d3ff3,null))[_0xdc6f('0x1b')](saveUpdates(_0x3a7e44['body'],null))['then'](respondWithResult(_0x2d3ff3,null))[_0xdc6f('0x2a')](handleError(_0x2d3ff3,null));};exports[_0xdc6f('0x39')]=function(_0x3da9fb,_0x3d2beb){return db[_0xdc6f('0x23')][_0xdc6f('0x36')]({'where':{'id':_0x3da9fb['params']['id']}})['then'](handleEntityNotFound(_0x3d2beb,null))['then'](removeEntity(_0x3d2beb,null))['catch'](handleError(_0x3d2beb,null));};exports['describe']=function(_0x5f505c,_0x46424a){return db[_0xdc6f('0x23')][_0xdc6f('0x3a')]()[_0xdc6f('0x1b')](respondWithResult(_0x46424a,null))[_0xdc6f('0x2a')](handleError(_0x46424a,null));};exports[_0xdc6f('0x3b')]=function(_0x3731fc,_0x1d898d){return db['SmsMessage'][_0xdc6f('0x36')]({'where':{'id':_0x3731fc[_0xdc6f('0x2c')]['id']}})[_0xdc6f('0x1b')](handleEntityNotFound(_0x1d898d,null))['then'](function(_0x45d8cc){if(_0x45d8cc){return _0x45d8cc[_0xdc6f('0x3b')](_0x3731fc['body'][_0xdc6f('0x3c')],_['omit'](_0x3731fc['body'],[_0xdc6f('0x3c'),'id'])||{});}})[_0xdc6f('0x1b')](respondWithResult(_0x1d898d,null))[_0xdc6f('0x2a')](handleError(_0x1d898d,null));};exports['getMessages']=function(_0xad1118,_0x3ff2b7){var _0x461578={'raw':![],'where':{}};var _0x586714={};var _0x560b51={'count':0x0,'rows':[]};return db[_0xdc6f('0x23')]['findOne']({'where':{'id':_0xad1118['params']['id']}})[_0xdc6f('0x1b')](handleEntityNotFound(_0x3ff2b7,null))[_0xdc6f('0x1b')](function(_0x4012fa){if(_0x4012fa){_0x586714[_0xdc6f('0x30')]=_[_0xdc6f('0x2d')](db['SmsMessage'][_0xdc6f('0x24')]);_0x586714[_0xdc6f('0x28')]=_['keys'](_0xad1118[_0xdc6f('0x28')]);_0x586714[_0xdc6f('0x2e')]=_[_0xdc6f('0x2f')](_0x586714['model'],_0x586714[_0xdc6f('0x28')]);_0x461578[_0xdc6f('0x31')]=_[_0xdc6f('0x2f')](_0x586714['model'],qs[_0xdc6f('0x32')](_0xad1118[_0xdc6f('0x28')][_0xdc6f('0x32')]));_0x461578['attributes']=_0x461578['attributes'][_0xdc6f('0x33')]?_0x461578[_0xdc6f('0x31')]:_0x586714[_0xdc6f('0x30')];if(!_0xad1118[_0xdc6f('0x28')][_0xdc6f('0x3d')](_0xdc6f('0x3e'))){_0x461578[_0xdc6f('0x17')]=qs[_0xdc6f('0x17')](_0xad1118[_0xdc6f('0x28')]['limit']);_0x461578[_0xdc6f('0x15')]=qs['offset'](_0xad1118[_0xdc6f('0x28')]['offset']);}_0x461578['order']=qs[_0xdc6f('0x3f')](_0xad1118['query'][_0xdc6f('0x3f')]);_0x461578[_0xdc6f('0x40')]=qs[_0xdc6f('0x2e')](_[_0xdc6f('0x41')](_0xad1118['query'],_0x586714[_0xdc6f('0x2e')]));_0x461578[_0xdc6f('0x40')][_0xdc6f('0x42')]=_0x4012fa['id'];if(_0xad1118[_0xdc6f('0x28')][_0xdc6f('0x43')]){_0x461578['where']=_[_0xdc6f('0x35')](_0x461578[_0xdc6f('0x40')],{'$or':_[_0xdc6f('0x22')](_0x461578[_0xdc6f('0x31')],function(_0x2dd4b3){var _0x1b04f8={};_0x1b04f8[_0x2dd4b3]={'$like':'%'+_0xad1118[_0xdc6f('0x28')][_0xdc6f('0x43')]+'%'};return _0x1b04f8;})});}if(_0xad1118[_0xdc6f('0x28')][_0xdc6f('0x44')]){var _0x4f7b14=_0xad1118['query'][_0xdc6f('0x44')][_0xdc6f('0x45')](',');var _0x5ba59e={};_0x5ba59e[_0x4f7b14[0x0]]={'$gte':moment(_0x4f7b14[0x1])[_0xdc6f('0x46')](_0xdc6f('0x47'))};_0x461578[_0xdc6f('0x40')]=_[_0xdc6f('0x35')](_0x461578[_0xdc6f('0x40')],_0x5ba59e);}_0x461578=_[_0xdc6f('0x35')]({},_0x461578,_0xad1118[_0xdc6f('0x48')]);return db[_0xdc6f('0x49')][_0xdc6f('0x18')]({'where':_0x461578['where']})[_0xdc6f('0x1b')](function(_0x3cbdd1){_0x560b51['count']=_0x3cbdd1;if(_0xad1118['query'][_0xdc6f('0x4a')]){_0x461578[_0xdc6f('0x34')]=[{'all':!![]}];}return db[_0xdc6f('0x49')][_0xdc6f('0x27')](_0x461578);})[_0xdc6f('0x1b')](function(_0x30bf9d){_0x560b51[_0xdc6f('0x4b')]=_0x30bf9d;return _0x560b51;});}})[_0xdc6f('0x1b')](respondWithFilteredResult(_0x3ff2b7,_0x461578))[_0xdc6f('0x2a')](handleError(_0x3ff2b7,null));};exports[_0xdc6f('0x4c')]=function(_0xdc1efb,_0x5cef98){return db['SmsInteraction'][_0xdc6f('0x36')]({'where':{'id':_0xdc1efb[_0xdc6f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5cef98,null))[_0xdc6f('0x1b')](function(_0x1e66fd){if(_0x1e66fd){return _0x1e66fd['setTags'](_0xdc1efb[_0xdc6f('0x38')][_0xdc6f('0x3c')],_[_0xdc6f('0x4d')](_0xdc1efb[_0xdc6f('0x38')],['ids','id'])||{})[_0xdc6f('0x4e')](function(){return db['Tag'][_0xdc6f('0x27')]({'attributes':['id',_0xdc6f('0x1f'),_0xdc6f('0x4f')],'where':{'id':_0xdc1efb['body'][_0xdc6f('0x3c')]}});})[_0xdc6f('0x1b')](function(_0x47b563){socket[_0xdc6f('0x50')]('smsInteractionTags:save',{'id':Number(_0xdc1efb[_0xdc6f('0x2c')]['id']),'tags':_0x47b563||[]});return{'id':Number(_0xdc1efb[_0xdc6f('0x2c')]['id']),'tags':_0x47b563||[]};});}})['then'](respondWithResult(_0x5cef98,null))[_0xdc6f('0x2a')](handleError(_0x5cef98,null));};exports[_0xdc6f('0x51')]=function(_0x5ab072,_0x52cc96){return db['SmsInteraction']['find']({'where':{'id':_0x5ab072[_0xdc6f('0x2c')]['id']}})[_0xdc6f('0x1b')](handleEntityNotFound(_0x52cc96,null))[_0xdc6f('0x1b')](function(_0x1f8a85){if(_0x1f8a85){return _0x1f8a85[_0xdc6f('0x51')](_0x5ab072[_0xdc6f('0x28')]['ids']);}})[_0xdc6f('0x1b')](respondWithStatusCode(_0x52cc96,null))['catch'](handleError(_0x52cc96,null));};exports[_0xdc6f('0x52')]=function(_0x42b780,_0x20bccb){var _0x1a9dcd=moment()[_0xdc6f('0x53')]()[_0xdc6f('0x54')]();var _0xa4d647=path[_0xdc6f('0x55')](config[_0xdc6f('0x56')],_0xdc6f('0x57'),_0xdc6f('0x58'),_0xdc6f('0x59'));var _0x128990=path[_0xdc6f('0x55')](_0xa4d647,_0x1a9dcd);var _0x1fad25=util['format'](_0xdc6f('0x5a'),_0x42b780[_0xdc6f('0x2c')]['id'],_0x1a9dcd);var _0x401d0b=path[_0xdc6f('0x55')](_0xa4d647,_0x1fad25);var _0x17abd9=[];_0x17abd9['push']({'model':db['User'],'as':'User','attributes':['id',_0xdc6f('0x5b')],'raw':!![]});_0x17abd9[_0xdc6f('0x5c')]({'model':db['CmContact'],'as':_0xdc6f('0x5d'),'attributes':['id',_0xdc6f('0x5e'),_0xdc6f('0x5f')],'raw':!![]});var _0x31f865=[{'model':db[_0xdc6f('0x49')],'as':_0xdc6f('0x60'),'attributes':['id',_0xdc6f('0x38'),_0xdc6f('0x61'),_0xdc6f('0x62'),_0xdc6f('0x63'),_0xdc6f('0x64')],'include':_0x17abd9}];_0x31f865[_0xdc6f('0x5c')]({'model':db[_0xdc6f('0x65')],'as':_0xdc6f('0x66'),'attributes':['id',_0xdc6f('0x1f')]});_0x31f865[_0xdc6f('0x5c')]({'model':db[_0xdc6f('0x67')],'as':_0xdc6f('0x68'),'attributes':['id',_0xdc6f('0x5b')]});return db[_0xdc6f('0x23')][_0xdc6f('0x36')]({'where':{'id':_0x42b780['params']['id']},'include':_0x31f865})[_0xdc6f('0x1b')](handleEntityNotFound(_0x20bccb,null))[_0xdc6f('0x1b')](function(_0x1c19b9){if(_0x1c19b9){var _0x2ce731=_0x1c19b9[_0xdc6f('0x69')]({'plain':!![]});fs['mkdirSync'](_0x128990);var _0x3d576d={'channel':'Sms','account':_0x2ce731['Account']['name'],'agent':_0x2ce731[_0xdc6f('0x68')]?_0x2ce731[_0xdc6f('0x68')][_0xdc6f('0x5b')]:_0xdc6f('0x6a'),'createdAt':moment(_0x2ce731[_0xdc6f('0x61')])[_0xdc6f('0x46')](_0xdc6f('0x47'))[_0xdc6f('0x54')](),'closedAt':_0x2ce731[_0xdc6f('0x6b')]?moment(_0x2ce731[_0xdc6f('0x6c')])[_0xdc6f('0x46')](_0xdc6f('0x47'))[_0xdc6f('0x54')]():'','disposition':_0x2ce731[_0xdc6f('0x6d')],'messages':_(_0x2ce731[_0xdc6f('0x60')])[_0xdc6f('0x43')]({'secret':![]})[_0xdc6f('0x22')](function(_0xbe64ef){return{'date':moment(_0xbe64ef[_0xdc6f('0x61')])[_0xdc6f('0x46')]('YYYY-MM-DD\x20HH:mm:ss')[_0xdc6f('0x54')](),'sender':_0xbe64ef['direction']===_0xdc6f('0x6e')?_0xbe64ef[_0xdc6f('0x67')]?_0xbe64ef[_0xdc6f('0x67')][_0xdc6f('0x5b')]:_0xdc6f('0x6f'):_0xbe64ef[_0xdc6f('0x5d')][_0xdc6f('0x5e')]+(_0xbe64ef[_0xdc6f('0x5d')][_0xdc6f('0x5f')]?'\x20'+_0xbe64ef['Contact']['lastName']:''),'body':_0xbe64ef[_0xdc6f('0x38')],'direction':_0xbe64ef[_0xdc6f('0x62')]===_0xdc6f('0x6e')?'A':'C','secret':_0xbe64ef[_0xdc6f('0x63')],'read':_0xbe64ef['read']};})[_0xdc6f('0x70')]()};return ejs['renderFile'](path[_0xdc6f('0x55')](config[_0xdc6f('0x56')],'server',_0xdc6f('0x71'),_0xdc6f('0x72')),{'interaction':_0x3d576d})[_0xdc6f('0x1b')](function(_0x18bdbc){var _0x5ae0d9=path[_0xdc6f('0x55')](_0x128990,_0xdc6f('0x73')+_0x2ce731['id']+'-'+_0x1a9dcd+'.pdf');var _0x2ac04a={'path':_0x5ae0d9,'channel':'Sms','interactionId':_0x2ce731['id']};return pdf[_0xdc6f('0x74')](_0x18bdbc,_0x2ac04a);})['then'](function(){return new BPromise(function(_0xe71faa,_0x44fbdd){zipdir(_0x128990,{'saveTo':_0x401d0b},function(_0x486c02,_0x29135c){if(_0x486c02)return _0x44fbdd(_0x486c02);return _0xe71faa(_0x29135c);});})[_0xdc6f('0x1b')](function(){return new BPromise(function(_0x27b82c,_0xc84950){rimraf(_0x128990,function(_0x1f455a){if(_0x1f455a)_0xc84950(_0x1f455a);return _0x27b82c();});});})[_0xdc6f('0x1b')](function(){return _0x20bccb['download'](_0x401d0b,_0x1fad25,function(_0x20e421){if(_0x20e421){console[_0xdc6f('0x75')](_0xdc6f('0x76'),_0x20e421);}else{fs[_0xdc6f('0x77')](_0x401d0b);}});});});}else{return _0x20bccb[_0xdc6f('0x12')](0xc8);}})[_0xdc6f('0x2a')](handleError(_0x20bccb,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 900eec0..3e61297 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 _0xb78e=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook'];(function(_0x2d196f,_0x4285d2){var _0x236e3e=function(_0x55f9c0){while(--_0x55f9c0){_0x2d196f['push'](_0x2d196f['shift']());}};_0x236e3e(++_0x4285d2);}(_0xb78e,0x1c9));var _0xeb78=function(_0x5b8e4a,_0x1593f2){_0x5b8e4a=_0x5b8e4a-0x0;var _0x2e79f2=_0xb78e[_0x5b8e4a];return _0x2e79f2;};'use strict';var EventEmitter=require(_0xeb78('0x0'));var SmsInteraction=require(_0xeb78('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0xeb78('0x1'))['db'][_0xeb78('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xeb78('0x3')](0x0);var events={'afterCreate':_0xeb78('0x4'),'afterUpdate':_0xeb78('0x5'),'afterDestroy':_0xeb78('0x6')};function emitEvent(_0x13ef9d){return function(_0x1bdf83,_0x57ec6b,_0x3c35e7){_0x1bdf83[_0xeb78('0x7')]({'attributes':['id'],'raw':!![]})[_0xeb78('0x8')](function(_0x30c884){_0x1bdf83[_0xeb78('0x9')](_0xeb78('0xa'),_0x30c884[_0xeb78('0xb')](function(_0x573406){return{'id':_0x573406['id']};}));return SmsMessage[_0xeb78('0xc')]({'where':{'SmsInteractionId':_0x1bdf83['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeb78('0x8')](function(_0xa1ca82){_0x1bdf83[_0xeb78('0x9')](_0xeb78('0xd'),_0xa1ca82[_0xeb78('0xe')]);SmsInteractionEvents[_0xeb78('0xf')](_0x13ef9d+':'+_0x1bdf83['id'],_0x1bdf83);SmsInteractionEvents[_0xeb78('0xf')](_0x13ef9d,_0x1bdf83);_0x3c35e7(null);})[_0xeb78('0x10')](_0x3c35e7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xeb78('0x11')](e,emitEvent(event));}}module[_0xeb78('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x3266=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages'];(function(_0x7b2e73,_0x22d970){var _0x3b1367=function(_0x35d275){while(--_0x35d275){_0x7b2e73['push'](_0x7b2e73['shift']());}};_0x3b1367(++_0x22d970);}(_0x3266,0x6a));var _0x6326=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x3266[_0x35da42];return _0x370035;};'use strict';var EventEmitter=require(_0x6326('0x0'));var SmsInteraction=require(_0x6326('0x1'))['db'][_0x6326('0x2')];var SmsMessage=require(_0x6326('0x1'))['db'][_0x6326('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6326('0x4')](0x0);var events={'afterCreate':_0x6326('0x5'),'afterUpdate':_0x6326('0x6'),'afterDestroy':_0x6326('0x7')};function emitEvent(_0x5a6b4d){return function(_0x30b22e,_0x5f38a3,_0x25ecd8){_0x30b22e[_0x6326('0x8')]({'attributes':['id'],'raw':!![]})[_0x6326('0x9')](function(_0x5402e5){_0x30b22e[_0x6326('0xa')]('Users',_0x5402e5[_0x6326('0xb')](function(_0x90c0f){return{'id':_0x90c0f['id']};}));return SmsMessage[_0x6326('0xc')]({'where':{'SmsInteractionId':_0x30b22e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6326('0x9')](function(_0x37a23d){_0x30b22e['setDataValue'](_0x6326('0xd'),_0x37a23d[_0x6326('0xe')]);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d+':'+_0x30b22e['id'],_0x30b22e);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d,_0x30b22e);_0x25ecd8(null);})[_0x6326('0x10')](_0x25ecd8(null));};}for(var e in events){if(events[_0x6326('0x11')](e)){var event=events[e];SmsInteraction[_0x6326('0x12')](e,emitEvent(event));}}module[_0x6326('0x13')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 2a8949b..6a7b617 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 _0x8ad2=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','SmsInteraction','sms_interactions'];(function(_0x4f1eb3,_0x58f0b3){var _0x2ae396=function(_0x5c5985){while(--_0x5c5985){_0x4f1eb3['push'](_0x4f1eb3['shift']());}};_0x2ae396(++_0x58f0b3);}(_0x8ad2,0xe4));var _0x28ad=function(_0x1ebb66,_0x37402a){_0x1ebb66=_0x1ebb66-0x0;var _0x3c4300=_0x8ad2[_0x1ebb66];return _0x3c4300;};'use strict';var _=require('lodash');var util=require(_0x28ad('0x0'));var logger=require(_0x28ad('0x1'))('api');var moment=require(_0x28ad('0x2'));var BPromise=require(_0x28ad('0x3'));var rp=require(_0x28ad('0x4'));var fs=require('fs');var path=require(_0x28ad('0x5'));var rimraf=require(_0x28ad('0x6'));var config=require('../../config/environment');var attributes=require(_0x28ad('0x7'));module['exports']=function(_0xfabf1b,_0x14c963){return _0xfabf1b['define'](_0x28ad('0x8'),attributes,{'tableName':_0x28ad('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b630b,_0x532589,_0xd30228){if(_0x3b630b[_0x28ad('0xa')]('closed')){_0x3b630b[_0x28ad('0xb')]=moment()[_0x28ad('0xc')](_0x28ad('0xd'));}_0xd30228(null,_0x3b630b);}}});}; \ No newline at end of file +var _0xcd11=['path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ca292,_0x285529){var _0x20f796=function(_0x2b0da9){while(--_0x2b0da9){_0x3ca292['push'](_0x3ca292['shift']());}};_0x20f796(++_0x285529);}(_0xcd11,0xbf));var _0x1cd1=function(_0x2410d4,_0x5bb287){_0x2410d4=_0x2410d4-0x0;var _0x375ce8=_0xcd11[_0x2410d4];return _0x375ce8;};'use strict';var _=require(_0x1cd1('0x0'));var util=require(_0x1cd1('0x1'));var logger=require(_0x1cd1('0x2'))(_0x1cd1('0x3'));var moment=require(_0x1cd1('0x4'));var BPromise=require(_0x1cd1('0x5'));var rp=require(_0x1cd1('0x6'));var fs=require('fs');var path=require(_0x1cd1('0x7'));var rimraf=require(_0x1cd1('0x8'));var config=require(_0x1cd1('0x9'));var attributes=require(_0x1cd1('0xa'));module['exports']=function(_0x42d4b6,_0x27f67f){return _0x42d4b6[_0x1cd1('0xb')](_0x1cd1('0xc'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d5048,_0x459b8b,_0x3dfab2){if(_0x2d5048[_0x1cd1('0xd')](_0x1cd1('0xe'))){_0x2d5048[_0x1cd1('0xf')]=moment()[_0x1cd1('0x10')](_0x1cd1('0x11'));}_0x3dfab2(null,_0x2d5048);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 0926707..993accb 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 _0x4e3a=['client','http','redis','./smsInteraction.socket','register','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','then','debug','find','ids','omit','AddTags','bluebird','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0xe0c89b,_0x18cb9d){var _0x3d9162=function(_0x2c4f3b){while(--_0x2c4f3b){_0xe0c89b['push'](_0xe0c89b['shift']());}};_0x3d9162(++_0x18cb9d);}(_0x4e3a,0x83));var _0xa4e3=function(_0xbf171b,_0x21c916){_0xbf171b=_0xbf171b-0x0;var _0x21ab7e=_0x4e3a[_0xbf171b];return _0x21ab7e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa4e3('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4e3('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa4e3('0x2'));var config=require(_0xa4e3('0x3'));var jayson=require(_0xa4e3('0x4'));var client=jayson[_0xa4e3('0x5')][_0xa4e3('0x6')]({'port':0x232a});config[_0xa4e3('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4e3('0x7')]));require(_0xa4e3('0x8'))[_0xa4e3('0x9')](socket);function respondWithRpcPromise(_0x2cfb62,_0x3c1e2b,_0x1e7454){return new BPromise(function(_0x209c22,_0x526a47){return client['request'](_0x2cfb62,_0x1e7454)['then'](function(_0x2ed5e1){logger[_0xa4e3('0xa')](_0xa4e3('0xb'),_0x3c1e2b,_0xa4e3('0xc'));logger['debug'](_0xa4e3('0xd'),_0x3c1e2b,_0xa4e3('0xc'),JSON[_0xa4e3('0xe')](_0x2ed5e1));if(_0x2ed5e1[_0xa4e3('0xf')]){if(_0x2ed5e1[_0xa4e3('0xf')][_0xa4e3('0x10')]===0x1f4){logger[_0xa4e3('0xf')](_0xa4e3('0xb'),_0x3c1e2b,_0x2ed5e1[_0xa4e3('0xf')][_0xa4e3('0x11')]);return _0x526a47(_0x2ed5e1[_0xa4e3('0xf')][_0xa4e3('0x11')]);}logger['error'](_0xa4e3('0xb'),_0x3c1e2b,_0x2ed5e1['error'][_0xa4e3('0x11')]);return _0x209c22(_0x2ed5e1[_0xa4e3('0xf')][_0xa4e3('0x11')]);}else{logger['info'](_0xa4e3('0xb'),_0x3c1e2b,_0xa4e3('0xc'));_0x209c22(_0x2ed5e1[_0xa4e3('0x12')]['message']);}})[_0xa4e3('0x13')](function(_0x1e25c7){logger[_0xa4e3('0xf')](_0xa4e3('0xb'),_0x3c1e2b,_0x1e25c7);_0x526a47(_0x1e25c7);});});}exports[_0xa4e3('0x14')]=function(_0x2d43f5){var _0x54a443=this;return new Promise(function(_0x56c7fe,_0x167109){return db[_0xa4e3('0x15')][_0xa4e3('0x16')](_0x2d43f5[_0xa4e3('0x17')],{'raw':_0x2d43f5[_0xa4e3('0x18')]?_0x2d43f5[_0xa4e3('0x18')][_0xa4e3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d43f5[_0xa4e3('0x18')]?_0x2d43f5[_0xa4e3('0x18')][_0xa4e3('0x1a')]||null:null,'attributes':_0x2d43f5[_0xa4e3('0x18')]?_0x2d43f5[_0xa4e3('0x18')]['attributes']||null:null,'limit':_0x2d43f5['options']?_0x2d43f5[_0xa4e3('0x18')][_0xa4e3('0x1b')]||null:null})[_0xa4e3('0x1c')](function(_0x1b4a0b){logger[_0xa4e3('0xa')](_0xa4e3('0x14'),_0x2d43f5);logger[_0xa4e3('0x1d')](_0xa4e3('0x14'),_0x2d43f5,JSON[_0xa4e3('0xe')](_0x1b4a0b));_0x56c7fe(_0x1b4a0b);})[_0xa4e3('0x13')](function(_0x40df37){logger[_0xa4e3('0xf')](_0xa4e3('0x14'),_0x40df37[_0xa4e3('0x11')],_0x2d43f5);_0x167109(_0x54a443['error'](0x1f4,_0x40df37[_0xa4e3('0x11')]));});});};exports['AddTagsToSmsInteraction']=function(_0x63b537){return new Promise(function(_0x34d72d,_0x2e20d3){return db[_0xa4e3('0x15')][_0xa4e3('0x1e')]({'where':_0x63b537[_0xa4e3('0x18')]?_0x63b537[_0xa4e3('0x18')]['where']||null:null})[_0xa4e3('0x1c')](function(_0xf5e8c7){if(_0xf5e8c7){return _0xf5e8c7['addTags'](_0x63b537[_0xa4e3('0x17')][_0xa4e3('0x1f')],_[_0xa4e3('0x20')](_0x63b537[_0xa4e3('0x17')],['ids','id'])||{});}})['spread'](function(_0x1449a7){logger[_0xa4e3('0xa')]('AddTags',_0x63b537);logger['debug'](_0xa4e3('0x21'),_0x63b537,JSON[_0xa4e3('0xe')](_0x1449a7));_0x34d72d(_0x1449a7);})[_0xa4e3('0x13')](function(_0xe59e81){logger[_0xa4e3('0xf')](_0xa4e3('0x21'),_0xe59e81[_0xa4e3('0x11')],_0x63b537);_0x2e20d3(_this['error'](0x1f4,_0xe59e81[_0xa4e3('0x11')]));});});}; \ No newline at end of file +var _0xa940=['limit','AddTagsToSmsInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','raw','options','where','attributes'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0xa940,0x1bf));var _0x0a94=function(_0x3acb0f,_0x5b7fee){_0x3acb0f=_0x3acb0f-0x0;var _0x4cd2eb=_0xa940[_0x3acb0f];return _0x4cd2eb;};'use strict';var _=require(_0x0a94('0x0'));var util=require(_0x0a94('0x1'));var moment=require(_0x0a94('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a94('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a94('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a94('0x5'))('rpc');var config=require(_0x0a94('0x6'));var jayson=require(_0x0a94('0x7'));var client=jayson['client'][_0x0a94('0x8')]({'port':0x232a});config[_0x0a94('0x9')]=_['defaults'](config['redis'],{'host':_0x0a94('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')[_0x0a94('0xb')](socket);function respondWithRpcPromise(_0x11f02c,_0xc9a38c,_0xb9a0cb){return new BPromise(function(_0x855186,_0x5ab40e){return client[_0x0a94('0xc')](_0x11f02c,_0xb9a0cb)[_0x0a94('0xd')](function(_0x3961f3){logger[_0x0a94('0xe')](_0x0a94('0xf'),_0xc9a38c,_0x0a94('0x10'));logger[_0x0a94('0x11')](_0x0a94('0x12'),_0xc9a38c,_0x0a94('0x10'),JSON[_0x0a94('0x13')](_0x3961f3));if(_0x3961f3['error']){if(_0x3961f3['error'][_0x0a94('0x14')]===0x1f4){logger[_0x0a94('0x15')](_0x0a94('0xf'),_0xc9a38c,_0x3961f3[_0x0a94('0x15')]['message']);return _0x5ab40e(_0x3961f3['error'][_0x0a94('0x16')]);}logger[_0x0a94('0x15')]('SmsInteraction,\x20%s,\x20%s',_0xc9a38c,_0x3961f3[_0x0a94('0x15')]['message']);return _0x855186(_0x3961f3[_0x0a94('0x15')]['message']);}else{logger[_0x0a94('0xe')]('SmsInteraction,\x20%s,\x20%s',_0xc9a38c,_0x0a94('0x10'));_0x855186(_0x3961f3[_0x0a94('0x17')][_0x0a94('0x16')]);}})[_0x0a94('0x18')](function(_0x342d77){logger[_0x0a94('0x15')]('SmsInteraction,\x20%s,\x20%s',_0xc9a38c,_0x342d77);_0x5ab40e(_0x342d77);});});}exports[_0x0a94('0x19')]=function(_0x1d78c7){var _0x43e776=this;return new Promise(function(_0x1bf47c,_0x451261){return db[_0x0a94('0x1a')][_0x0a94('0x1b')](_0x1d78c7[_0x0a94('0x1c')],{'raw':_0x1d78c7['options']?_0x1d78c7['options'][_0x0a94('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d78c7[_0x0a94('0x1e')]?_0x1d78c7[_0x0a94('0x1e')][_0x0a94('0x1f')]||null:null,'attributes':_0x1d78c7[_0x0a94('0x1e')]?_0x1d78c7[_0x0a94('0x1e')][_0x0a94('0x20')]||null:null,'limit':_0x1d78c7[_0x0a94('0x1e')]?_0x1d78c7['options'][_0x0a94('0x21')]||null:null})[_0x0a94('0xd')](function(_0x201a8b){logger[_0x0a94('0xe')](_0x0a94('0x19'),_0x1d78c7);logger[_0x0a94('0x11')](_0x0a94('0x19'),_0x1d78c7,JSON[_0x0a94('0x13')](_0x201a8b));_0x1bf47c(_0x201a8b);})[_0x0a94('0x18')](function(_0x49d30d){logger[_0x0a94('0x15')](_0x0a94('0x19'),_0x49d30d[_0x0a94('0x16')],_0x1d78c7);_0x451261(_0x43e776['error'](0x1f4,_0x49d30d[_0x0a94('0x16')]));});});};exports[_0x0a94('0x22')]=function(_0x291279){return new Promise(function(_0x404aef,_0x2fab09){return db[_0x0a94('0x1a')][_0x0a94('0x23')]({'where':_0x291279['options']?_0x291279[_0x0a94('0x1e')][_0x0a94('0x1f')]||null:null})[_0x0a94('0xd')](function(_0x535ade){if(_0x535ade){return _0x535ade['addTags'](_0x291279[_0x0a94('0x1c')][_0x0a94('0x24')],_[_0x0a94('0x25')](_0x291279[_0x0a94('0x1c')],['ids','id'])||{});}})[_0x0a94('0x26')](function(_0x2256d4){logger['info']('AddTags',_0x291279);logger[_0x0a94('0x11')](_0x0a94('0x27'),_0x291279,JSON[_0x0a94('0x13')](_0x2256d4));_0x404aef(_0x2256d4);})[_0x0a94('0x18')](function(_0x46a350){logger[_0x0a94('0x15')]('AddTags',_0x46a350[_0x0a94('0x16')],_0x291279);_0x2fab09(_this[_0x0a94('0x15')](0x1f4,_0x46a350[_0x0a94('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index b89397c..725eeb9 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 _0x2174=['removeListener','register','length','smsInteraction:','save','remove','update','emit'];(function(_0x5a6981,_0x4e35e2){var _0x3c1fa2=function(_0x170a30){while(--_0x170a30){_0x5a6981['push'](_0x5a6981['shift']());}};_0x3c1fa2(++_0x4e35e2);}(_0x2174,0x1ac));var _0x4217=function(_0x3109c0,_0x8c0569){_0x3109c0=_0x3109c0-0x0;var _0x34f514=_0x2174[_0x3109c0];return _0x34f514;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x4217('0x0'),_0x4217('0x1'),_0x4217('0x2')];function createListener(_0xd9747b,_0x41e5e1){return function(_0x1fbb1a){_0x41e5e1[_0x4217('0x3')](_0xd9747b,_0x1fbb1a);};}function removeListener(_0x50936d,_0x2e6bf1){return function(){SmsInteractionEvents[_0x4217('0x4')](_0x50936d,_0x2e6bf1);};}exports[_0x4217('0x5')]=function(_0x4d611e){for(var _0x53694f=0x0,_0x28968a=events[_0x4217('0x6')];_0x53694f<_0x28968a;_0x53694f++){var _0x5cbe76=events[_0x53694f];var _0x14f2bf=createListener(_0x4217('0x7')+_0x5cbe76,_0x4d611e);SmsInteractionEvents['on'](_0x5cbe76,_0x14f2bf);}}; \ No newline at end of file +var _0xcdc4=['remove','update','removeListener','./smsInteraction.events','save'];(function(_0x19dca9,_0x3f2bdf){var _0x3b201b=function(_0x377392){while(--_0x377392){_0x19dca9['push'](_0x19dca9['shift']());}};_0x3b201b(++_0x3f2bdf);}(_0xcdc4,0x161));var _0x4cdc=function(_0x532a2c,_0xba730e){_0x532a2c=_0x532a2c-0x0;var _0x125d20=_0xcdc4[_0x532a2c];return _0x125d20;};'use strict';var SmsInteractionEvents=require(_0x4cdc('0x0'));var events=[_0x4cdc('0x1'),_0x4cdc('0x2'),_0x4cdc('0x3')];function createListener(_0x314521,_0x4dc0ff){return function(_0x414e12){_0x4dc0ff['emit'](_0x314521,_0x414e12);};}function removeListener(_0x4c7fd5,_0x4d8a93){return function(){SmsInteractionEvents[_0x4cdc('0x4')](_0x4c7fd5,_0x4d8a93);};}exports['register']=function(_0x1fd779){for(var _0x43df1f=0x0,_0x45aa9f=events['length'];_0x43df1f<_0x45aa9f;_0x43df1f++){var _0x3ca33d=events[_0x43df1f];var _0x1fa642=createListener('smsInteraction:'+_0x3ca33d,_0x1fd779);SmsInteractionEvents['on'](_0x3ca33d,_0x1fa642);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 5f75e0b..cad1b7d 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 _0x7df3=['multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/:id','show','tracked','sms','create','post','/:id/status','put','update','accept','reject','destroy','exports'];(function(_0x14da84,_0x5d849b){var _0x1ab813=function(_0x5d56e6){while(--_0x5d56e6){_0x14da84['push'](_0x14da84['shift']());}};_0x1ab813(++_0x5d849b);}(_0x7df3,0x1cc));var _0x37df=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x7df3[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x37df('0x0'));var util=require(_0x37df('0x1'));var path=require('path');var timeout=require(_0x37df('0x2'));var express=require('express');var router=express[_0x37df('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x37df('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x37df('0x5'));var controller=require(_0x37df('0x6'));router[_0x37df('0x7')]('/',auth[_0x37df('0x8')](),controller[_0x37df('0x9')]);router[_0x37df('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x37df('0x7')](_0x37df('0xa'),auth[_0x37df('0x8')](),controller[_0x37df('0xb')]);router['post']('/',auth[_0x37df('0x8')](),interaction[_0x37df('0xc')](_0x37df('0xd'),'smsmessage:create'),controller[_0x37df('0xe')]);router[_0x37df('0xf')](_0x37df('0x10'),controller['status']);router[_0x37df('0x11')](_0x37df('0xa'),auth[_0x37df('0x8')](),controller[_0x37df('0x12')]);router[_0x37df('0x11')]('/:id/accept',auth[_0x37df('0x8')](),controller[_0x37df('0x13')]);router[_0x37df('0x11')]('/:id/reject',auth[_0x37df('0x8')](),controller[_0x37df('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x37df('0x15')]);module[_0x37df('0x16')]=router; \ No newline at end of file +var _0x42f4=['get','index','/describe','isAuthenticated','describe','tracked','sms','smsmessage:create','create','post','/:id/status','status','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','./smsMessage.controller'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x42f4,0x19d));var _0x442f=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x42f4[_0x2a55f8];return _0x245efd;};'use strict';var multer=require(_0x442f('0x0'));var util=require('util');var path=require(_0x442f('0x1'));var timeout=require(_0x442f('0x2'));var express=require(_0x442f('0x3'));var router=express[_0x442f('0x4')]();var fs_extra=require(_0x442f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x442f('0x6'));router[_0x442f('0x7')]('/',auth['isAuthenticated'](),controller[_0x442f('0x8')]);router[_0x442f('0x7')](_0x442f('0x9'),auth[_0x442f('0xa')](),controller[_0x442f('0xb')]);router[_0x442f('0x7')]('/:id',auth[_0x442f('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0x442f('0xc')](_0x442f('0xd'),_0x442f('0xe')),controller[_0x442f('0xf')]);router[_0x442f('0x10')](_0x442f('0x11'),controller[_0x442f('0x12')]);router[_0x442f('0x13')](_0x442f('0x14'),auth[_0x442f('0xa')](),controller['update']);router[_0x442f('0x13')](_0x442f('0x15'),auth[_0x442f('0xa')](),controller[_0x442f('0x16')]);router[_0x442f('0x13')](_0x442f('0x17'),auth[_0x442f('0xa')](),controller[_0x442f('0x18')]);router[_0x442f('0x19')](_0x442f('0x14'),auth[_0x442f('0xa')](),controller[_0x442f('0x1a')]);module[_0x442f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 93195dc..4b8d5ad 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 _0xece2=['BOOLEAN','ENUM','STRING','sequelize','TEXT'];(function(_0x11baab,_0x5bd419){var _0x4039bf=function(_0x1f3651){while(--_0x1f3651){_0x11baab['push'](_0x11baab['shift']());}};_0x4039bf(++_0x5bd419);}(_0xece2,0x1f2));var _0x2ece=function(_0x263d61,_0x198f38){_0x263d61=_0x263d61-0x0;var _0x53dc8f=_0xece2[_0x263d61];return _0x53dc8f;};'use strict';var Sequelize=require(_0x2ece('0x0'));module['exports']={'body':{'type':Sequelize[_0x2ece('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2ece('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2ece('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x2ece('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x2ece('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x2ece('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x28e3=['BOOLEAN','sequelize','exports','TEXT','medium','ENUM','out','STRING','DATE'];(function(_0x5ef7b8,_0x15cc07){var _0x2c7148=function(_0x398519){while(--_0x398519){_0x5ef7b8['push'](_0x5ef7b8['shift']());}};_0x2c7148(++_0x15cc07);}(_0x28e3,0x106));var _0x328e=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x28e3[_0x125ff8];return _0x2d9ef;};'use strict';var Sequelize=require(_0x328e('0x0'));module[_0x328e('0x1')]={'body':{'type':Sequelize[_0x328e('0x2')](_0x328e('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x328e('0x4')]('in',_0x328e('0x5')),'defaultValue':_0x328e('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x328e('0x6')](0xbe)},'phone':{'type':Sequelize[_0x328e('0x6')]},'readAt':{'type':Sequelize[_0x328e('0x7')]},'secret':{'type':Sequelize[_0x328e('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x328e('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 0e81c5f..6e296f6 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 _0x9666=['end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','name','send','map','SmsMessage','rawAttributes','fieldName','type','key','keys','query','model','attributes','fields','length','order','sort','where','filters','pick','merge','filter','options','includeAll','rows','intersection','include','find','create','body','params','describe','sms-interactions','accept','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','MessageUUID','sent','Status','plivio','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','register','jayson/promise','client','http','request','debug','code','error','SmsMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','status'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9666,0x17a));var _0x6966=function(_0xf7a6d5,_0x12436d){_0xf7a6d5=_0xf7a6d5-0x0;var _0x5bb1c1=_0x9666[_0xf7a6d5];return _0x5bb1c1;};'use strict';var emlformat=require(_0x6966('0x0'));var rimraf=require(_0x6966('0x1'));var zipdir=require(_0x6966('0x2'));var jsonpatch=require(_0x6966('0x3'));var rp=require('request-promise');var moment=require(_0x6966('0x4'));var BPromise=require(_0x6966('0x5'));var Mustache=require(_0x6966('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6966('0x7'));var csv=require(_0x6966('0x8'));var ejs=require(_0x6966('0x9'));var fs=require('fs');var fs_extra=require(_0x6966('0xa'));var _=require(_0x6966('0xb'));var squel=require(_0x6966('0xc'));var crypto=require('crypto');var jsforce=require(_0x6966('0xd'));var deskjs=require(_0x6966('0xe'));var toCsv=require(_0x6966('0x8'));var querystring=require('querystring');var Papa=require(_0x6966('0xf'));var Redis=require(_0x6966('0x10'));var authService=require(_0x6966('0x11'));var qs=require(_0x6966('0x12'));var as=require(_0x6966('0x13'));var hardwareService=require(_0x6966('0x14'));var logger=require(_0x6966('0x15'))(_0x6966('0x16'));var utils=require(_0x6966('0x17'));var config=require(_0x6966('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x6966('0x19')](config[_0x6966('0x1a')],{'host':_0x6966('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0x6966('0x1c')](socket);var jayson=require(_0x6966('0x1d'));var client=jayson[_0x6966('0x1e')][_0x6966('0x1f')]({'port':0x232c});var client9002=jayson[_0x6966('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x204200,_0x1bf59d,_0x550d77,_0x376300){return new BPromise(function(_0x30f650,_0x26df66){var _0x529dbd=_0x376300||client;return _0x529dbd[_0x6966('0x20')](_0x204200,_0x550d77)['then'](function(_0x43e2e9){logger['info']('SmsMessage,\x20%s,\x20%s',_0x1bf59d,'request\x20sent');logger[_0x6966('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1bf59d,'request\x20sent',JSON['stringify'](_0x43e2e9));if(_0x43e2e9['error']){if(_0x43e2e9['error'][_0x6966('0x22')]===0x1f4){logger[_0x6966('0x23')](_0x6966('0x24'),_0x1bf59d,_0x43e2e9['error'][_0x6966('0x25')]);return _0x26df66(_0x43e2e9[_0x6966('0x23')][_0x6966('0x25')]);}logger[_0x6966('0x23')](_0x6966('0x24'),_0x1bf59d,_0x43e2e9[_0x6966('0x23')][_0x6966('0x25')]);return _0x30f650(_0x43e2e9[_0x6966('0x23')][_0x6966('0x25')]);}else{logger['info'](_0x6966('0x24'),_0x1bf59d,_0x6966('0x26'));_0x30f650(_0x43e2e9[_0x6966('0x27')][_0x6966('0x25')]);}})[_0x6966('0x28')](function(_0x27db0e){logger[_0x6966('0x23')]('SmsMessage,\x20%s,\x20%s',_0x1bf59d,_0x27db0e);_0x26df66(_0x27db0e);});});}function respondWithStatusCode(_0x221b7d,_0x5a7f85){_0x5a7f85=_0x5a7f85||0xcc;return function(_0x433601){if(_0x433601){return _0x221b7d['sendStatus'](_0x5a7f85);}return _0x221b7d[_0x6966('0x29')](_0x5a7f85)[_0x6966('0x2a')]();};}function respondWithResult(_0xeae4fb,_0x85106d){_0x85106d=_0x85106d||0xc8;return function(_0x3c2b41){if(_0x3c2b41){return _0xeae4fb[_0x6966('0x29')](_0x85106d)[_0x6966('0x2b')](_0x3c2b41);}};}function respondWithFilteredResult(_0x1b86a7,_0x2c9fbb){return function(_0x4a85c7){if(_0x4a85c7){var _0x270919=typeof _0x2c9fbb[_0x6966('0x2c')]==='undefined'&&typeof _0x2c9fbb[_0x6966('0x2d')]==='undefined';var _0x44b6b0=_0x4a85c7[_0x6966('0x2e')];var _0x171f19=_0x270919?0x0:_0x2c9fbb[_0x6966('0x2c')];var _0x40a50d=_0x270919?_0x4a85c7[_0x6966('0x2e')]:_0x2c9fbb[_0x6966('0x2c')]+_0x2c9fbb[_0x6966('0x2d')];var _0x3346f5;if(_0x40a50d>=_0x44b6b0){_0x40a50d=_0x44b6b0;_0x3346f5=0xc8;}else{_0x3346f5=0xce;}_0x1b86a7[_0x6966('0x29')](_0x3346f5);return _0x1b86a7[_0x6966('0x2f')](_0x6966('0x30'),_0x171f19+'-'+_0x40a50d+'/'+_0x44b6b0)[_0x6966('0x2b')](_0x4a85c7);}return null;};}function patchUpdates(_0x1b433c){return function(_0x8e7e81){try{jsonpatch[_0x6966('0x31')](_0x8e7e81,_0x1b433c,!![]);}catch(_0x4af933){return BPromise[_0x6966('0x32')](_0x4af933);}return _0x8e7e81['save']();};}function saveUpdates(_0x167ed7,_0x9d4803){return function(_0x1b0118){if(_0x1b0118){return _0x1b0118[_0x6966('0x33')](_0x167ed7)[_0x6966('0x34')](function(_0x1fb851){return _0x1fb851;});}return null;};}function removeEntity(_0x3316b0,_0x12f579){return function(_0x129a56){if(_0x129a56){return _0x129a56[_0x6966('0x35')]()['then'](function(){_0x3316b0[_0x6966('0x29')](0xcc)[_0x6966('0x2a')]();});}};}function handleEntityNotFound(_0x45976a,_0x4fbdc6){return function(_0x5edd22){if(!_0x5edd22){_0x45976a[_0x6966('0x36')](0x194);}return _0x5edd22;};}function handleError(_0x1cc795,_0x492528){_0x492528=_0x492528||0x1f4;return function(_0x1b4925){logger['error'](_0x1b4925['stack']);if(_0x1b4925[_0x6966('0x37')]){delete _0x1b4925[_0x6966('0x37')];}_0x1cc795[_0x6966('0x29')](_0x492528)[_0x6966('0x38')](_0x1b4925);};}exports['index']=function(_0x40667f,_0x678ac){var _0xd47a92={},_0xa47954={},_0x2520e2={'count':0x0,'rows':[]};var _0x14496f=_[_0x6966('0x39')](db[_0x6966('0x3a')][_0x6966('0x3b')],function(_0x112bff){return{'name':_0x112bff[_0x6966('0x3c')],'type':_0x112bff[_0x6966('0x3d')][_0x6966('0x3e')]};});_0xa47954['model']=_[_0x6966('0x39')](_0x14496f,_0x6966('0x37'));_0xa47954['query']=_[_0x6966('0x3f')](_0x40667f[_0x6966('0x40')]);_0xa47954['filters']=_['intersection'](_0xa47954[_0x6966('0x41')],_0xa47954[_0x6966('0x40')]);_0xd47a92[_0x6966('0x42')]=_['intersection'](_0xa47954[_0x6966('0x41')],qs[_0x6966('0x43')](_0x40667f[_0x6966('0x40')][_0x6966('0x43')]));_0xd47a92[_0x6966('0x42')]=_0xd47a92[_0x6966('0x42')][_0x6966('0x44')]?_0xd47a92[_0x6966('0x42')]:_0xa47954[_0x6966('0x41')];if(!_0x40667f['query']['hasOwnProperty']('nolimit')){_0xd47a92[_0x6966('0x2d')]=qs['limit'](_0x40667f[_0x6966('0x40')][_0x6966('0x2d')]);_0xd47a92['offset']=qs[_0x6966('0x2c')](_0x40667f['query'][_0x6966('0x2c')]);}_0xd47a92[_0x6966('0x45')]=qs[_0x6966('0x46')](_0x40667f[_0x6966('0x40')][_0x6966('0x46')]);_0xd47a92[_0x6966('0x47')]=qs[_0x6966('0x48')](_[_0x6966('0x49')](_0x40667f[_0x6966('0x40')],_0xa47954[_0x6966('0x48')]),_0x14496f);if(_0x40667f[_0x6966('0x40')]['filter']){_0xd47a92[_0x6966('0x47')]=_[_0x6966('0x4a')](_0xd47a92[_0x6966('0x47')],{'$or':_['map'](_0x14496f,function(_0x1a9bf6){if(_0x1a9bf6[_0x6966('0x3d')]!=='VIRTUAL'){var _0x3153d9={};_0x3153d9[_0x1a9bf6[_0x6966('0x37')]]={'$like':'%'+_0x40667f[_0x6966('0x40')][_0x6966('0x4b')]+'%'};return _0x3153d9;}})});}_0xd47a92=_[_0x6966('0x4a')]({},_0xd47a92,_0x40667f[_0x6966('0x4c')]);var _0xf4227d={'where':_0xd47a92[_0x6966('0x47')]};return db[_0x6966('0x3a')][_0x6966('0x2e')](_0xf4227d)['then'](function(_0x882953){_0x2520e2['count']=_0x882953;if(_0x40667f[_0x6966('0x40')][_0x6966('0x4d')]){_0xd47a92['include']=[{'all':!![]}];}return db[_0x6966('0x3a')]['findAll'](_0xd47a92);})[_0x6966('0x34')](function(_0x165bdd){_0x2520e2[_0x6966('0x4e')]=_0x165bdd;return _0x2520e2;})['then'](respondWithFilteredResult(_0x678ac,_0xd47a92))[_0x6966('0x28')](handleError(_0x678ac,null));};exports['show']=function(_0x26f69f,_0xffdd04){var _0x348319={'raw':!![],'where':{'id':_0x26f69f['params']['id']}},_0x4b9091={};_0x4b9091[_0x6966('0x41')]=_[_0x6966('0x3f')](db[_0x6966('0x3a')][_0x6966('0x3b')]);_0x4b9091[_0x6966('0x40')]=_['keys'](_0x26f69f[_0x6966('0x40')]);_0x4b9091[_0x6966('0x48')]=_[_0x6966('0x4f')](_0x4b9091[_0x6966('0x41')],_0x4b9091[_0x6966('0x40')]);_0x348319[_0x6966('0x42')]=_[_0x6966('0x4f')](_0x4b9091[_0x6966('0x41')],qs[_0x6966('0x43')](_0x26f69f['query']['fields']));_0x348319[_0x6966('0x42')]=_0x348319['attributes']['length']?_0x348319[_0x6966('0x42')]:_0x4b9091[_0x6966('0x41')];if(_0x26f69f[_0x6966('0x40')][_0x6966('0x4d')]){_0x348319[_0x6966('0x50')]=[{'all':!![]}];}_0x348319=_[_0x6966('0x4a')]({},_0x348319,_0x26f69f[_0x6966('0x4c')]);return db[_0x6966('0x3a')][_0x6966('0x51')](_0x348319)[_0x6966('0x34')](handleEntityNotFound(_0xffdd04,null))[_0x6966('0x34')](respondWithResult(_0xffdd04,null))[_0x6966('0x28')](handleError(_0xffdd04,null));};exports['create']=function(_0x4fa465,_0x42f437){return db[_0x6966('0x3a')][_0x6966('0x52')](_0x4fa465[_0x6966('0x53')],{})[_0x6966('0x34')](respondWithResult(_0x42f437,0xc9))['catch'](handleError(_0x42f437,null));};exports[_0x6966('0x33')]=function(_0x2775e0,_0xce65be){if(_0x2775e0['body']['id']){delete _0x2775e0[_0x6966('0x53')]['id'];}return db[_0x6966('0x3a')][_0x6966('0x51')]({'where':{'id':_0x2775e0[_0x6966('0x54')]['id']}})[_0x6966('0x34')](handleEntityNotFound(_0xce65be,null))[_0x6966('0x34')](saveUpdates(_0x2775e0[_0x6966('0x53')],null))[_0x6966('0x34')](respondWithResult(_0xce65be,null))[_0x6966('0x28')](handleError(_0xce65be,null));};exports[_0x6966('0x35')]=function(_0x537a7d,_0x58c1e1){return db[_0x6966('0x3a')][_0x6966('0x51')]({'where':{'id':_0x537a7d[_0x6966('0x54')]['id']}})[_0x6966('0x34')](handleEntityNotFound(_0x58c1e1,null))[_0x6966('0x34')](removeEntity(_0x58c1e1,null))[_0x6966('0x28')](handleError(_0x58c1e1,null));};exports['describe']=function(_0x3b4a15,_0x1b3d45){return db[_0x6966('0x3a')][_0x6966('0x55')]()[_0x6966('0x34')](respondWithResult(_0x1b3d45,null))[_0x6966('0x28')](handleError(_0x1b3d45,null));};var interaction_log=require('../../config/logger')(_0x6966('0x56'));exports[_0x6966('0x57')]=function(_0x333f45,_0x34110d,_0x5d2519){var _0x41ec2e={'agent':{},'channel':'sms'};if(_0x333f45[_0x6966('0x53')]['id']){delete _0x333f45[_0x6966('0x53')]['id'];}_0x333f45[_0x6966('0x53')]['read']=!![];_0x333f45['body']['readAt']=moment()[_0x6966('0x58')](_0x6966('0x59'));_0x333f45['body']['UserId']=_0x333f45['body'][_0x6966('0x5a')]||_0x333f45[_0x6966('0x5b')]['id'];_0x41ec2e[_0x6966('0x5c')]['id']=_0x333f45[_0x6966('0x53')][_0x6966('0x5a')];return db[_0x6966('0x3a')]['find']({'where':{'id':_0x333f45['params']['id'],'UserId':null}})[_0x6966('0x34')](handleEntityNotFound(_0x34110d,null))['then'](saveUpdates(_0x333f45[_0x6966('0x53')],null))[_0x6966('0x34')](function(_0x11135f){if(_0x11135f){_0x41ec2e[_0x6966('0x25')]=_0x11135f[_0x6966('0x5d')]({'plain':!![]});return db[_0x6966('0x5e')][_0x6966('0x51')]({'where':{'id':_0x11135f[_0x6966('0x5f')]}});}return null;})[_0x6966('0x34')](handleEntityNotFound(_0x34110d,null))[_0x6966('0x34')](function(_0x1d0af3){if(_0x1d0af3){return _0x1d0af3['update']({'UserId':_0x333f45[_0x6966('0x53')][_0x6966('0x5a')],'read1stAt':_[_0x6966('0x60')](_0x1d0af3['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6966('0x34')](function(_0xd73efc){if(_0xd73efc){_0x41ec2e[_0x6966('0x61')]=_0xd73efc['get']({'plain':!![]});interaction_log[_0x6966('0x62')](_0x6966('0x63'),_0x333f45[_0x6966('0x5b')]['id'],_0x333f45['user'][_0x6966('0x37')],_0x333f45[_0x6966('0x5b')]['role'],_0x41ec2e[_0x6966('0x61')]['id'],_0x333f45[_0x6966('0x53')]?JSON[_0x6966('0x64')](_0x333f45['body']):_0x6966('0x65'));return respondWithRpcPromise(_0x6966('0x66'),_0x6966('0x67'),_0x41ec2e);}return null;})['then'](function(_0xc260e0){var _0x589560='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xc260e0[_0x6966('0x25')][_0x6966('0x68')];return db[_0x6966('0x69')]['query'](_0x589560,{'type':db[_0x6966('0x6a')][_0x6966('0x6b')][_0x6966('0x6c')],'raw':!![]})[_0x6966('0x34')](function(_0x3e8164){return _0x3e8164;});})[_0x6966('0x34')](function(_0x5370dc){if(_0x5370dc){_0x41ec2e['message'][_0x6966('0x6d')]=_0x5370dc[0x0];if(!_0x333f45[_0x6966('0x53')][_0x6966('0x5a')])return;return db[_0x6966('0x6e')][_0x6966('0x51')]({'where':{'id':_0x333f45[_0x6966('0x53')][_0x6966('0x5a')],'role':_0x6966('0x5c')},'attributes':['id',_0x6966('0x37'),_0x6966('0x6f'),_0x6966('0x70'),'internal'],'raw':!![]});}return null;})[_0x6966('0x34')](function(_0x4ba9af){if(!_0x4ba9af)return null;_0x41ec2e['message'][_0x6966('0x5c')]=_0x4ba9af;return _0x41ec2e;})[_0x6966('0x34')](function(_0x1781b9){if(_0x1781b9){if(_0x333f45['body']['manual']){_0x41ec2e[_0x6966('0x25')][_0x6966('0x71')]=util[_0x6966('0x58')](_0x6966('0x72'),_0x333f45[_0x6966('0x5b')]['name']);_0x41ec2e[_0x6966('0x25')][_0x6966('0x73')]=_0x41ec2e[_0x6966('0x73')];_0x41ec2e['message'][_0x6966('0x74')]=_0x41ec2e[_0x6966('0x73')];_0x41ec2e[_0x6966('0x25')][_0x6966('0x75')]=_0x6966('0x57');return respondWithRpcPromise(_0x6966('0x76'),_0x6966('0x76'),{'event':_0x6966('0x77'),'message':_0x41ec2e['message']},client9002)[_0x6966('0x34')](function(){return _0x41ec2e;});}return _0x41ec2e;}return null;})[_0x6966('0x34')](respondWithResult(_0x34110d,null))[_0x6966('0x28')](handleError(_0x34110d,null));};var interaction_log=require(_0x6966('0x15'))(_0x6966('0x56'));exports['reject']=function(_0x57b1c7,_0xc9fc00,_0x43178b){var _0x29d229={'agent':{},'channel':'sms'};if(_0x57b1c7['body']['id']){delete _0x57b1c7[_0x6966('0x53')]['id'];}_0x57b1c7[_0x6966('0x53')]['UserId']=_0x57b1c7[_0x6966('0x53')][_0x6966('0x5a')]||_0x57b1c7['user']['id'];_0x29d229[_0x6966('0x5c')]['id']=_0x57b1c7[_0x6966('0x53')][_0x6966('0x5a')];return db[_0x6966('0x3a')][_0x6966('0x51')]({'where':{'id':_0x57b1c7['params']['id'],'UserId':null}})[_0x6966('0x34')](handleEntityNotFound(_0xc9fc00,null))['then'](function(_0x2d0fe8){if(_0x2d0fe8){_0x29d229[_0x6966('0x25')]=_0x2d0fe8[_0x6966('0x5d')]({'plain':!![]});return db['SmsInteraction'][_0x6966('0x51')]({'where':{'id':_0x2d0fe8[_0x6966('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0xc9fc00,null))['then'](function(_0x54ff54){if(_0x54ff54){_0x29d229[_0x6966('0x61')]=_0x54ff54[_0x6966('0x5d')]({'plain':!![]});interaction_log[_0x6966('0x62')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x57b1c7[_0x6966('0x5b')]['id'],_0x57b1c7[_0x6966('0x5b')][_0x6966('0x37')],_0x57b1c7['user']['role'],_0x29d229[_0x6966('0x61')]['id'],_0x57b1c7[_0x6966('0x53')]?JSON[_0x6966('0x64')](_0x57b1c7[_0x6966('0x53')]):_0x6966('0x65'));return respondWithRpcPromise(_0x6966('0x78'),_0x6966('0x79'),_0x29d229);}return null;})['then'](function(_0x58849c){var _0x500dcd=_0x6966('0x7a')+_0x58849c[_0x6966('0x25')][_0x6966('0x68')];return db[_0x6966('0x69')][_0x6966('0x40')](_0x500dcd,{'type':db[_0x6966('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x13dd27){return _0x13dd27;});})[_0x6966('0x34')](function(_0x4dc2c1){if(_0x4dc2c1){_0x29d229[_0x6966('0x25')][_0x6966('0x6d')]=_0x4dc2c1[0x0];if(!_0x57b1c7[_0x6966('0x53')]['UserId'])return;return db['User'][_0x6966('0x51')]({'where':{'id':_0x57b1c7[_0x6966('0x53')][_0x6966('0x5a')],'role':_0x6966('0x5c')},'attributes':['id',_0x6966('0x37'),_0x6966('0x6f'),_0x6966('0x70'),_0x6966('0x7b')],'raw':!![]});}return null;})[_0x6966('0x34')](function(_0x246d25){if(!_0x246d25)return null;_0x29d229[_0x6966('0x25')][_0x6966('0x5c')]=_0x246d25;return _0x29d229;})[_0x6966('0x34')](function(_0x4e8806){if(_0x4e8806){_0x4e8806[_0x6966('0x25')][_0x6966('0x71')]=util[_0x6966('0x58')](_0x6966('0x72'),_0x57b1c7[_0x6966('0x5b')]['name']);_0x4e8806[_0x6966('0x25')][_0x6966('0x73')]=_0x29d229[_0x6966('0x73')];_0x4e8806[_0x6966('0x25')][_0x6966('0x74')]=_0x29d229[_0x6966('0x73')];_0x4e8806[_0x6966('0x25')][_0x6966('0x75')]=_0x6966('0x32');respondWithRpcPromise(_0x6966('0x76'),'EventManager',{'event':_0x6966('0x7c'),'message':_0x4e8806[_0x6966('0x25')]},client9002);return _0x29d229;}return null;})[_0x6966('0x34')](respondWithResult(_0xc9fc00,null))[_0x6966('0x28')](handleError(_0xc9fc00,null));};exports[_0x6966('0x29')]=function(_0xdb0b73,_0x475904,_0x889e80){if(_0xdb0b73[_0x6966('0x53')]['id']){delete _0xdb0b73[_0x6966('0x53')]['id'];}var _0x444de8;return db[_0x6966('0x3a')][_0x6966('0x51')]({'where':{'id':_0xdb0b73['params']['id']}})[_0x6966('0x34')](handleEntityNotFound(_0x475904,null))[_0x6966('0x34')](function(_0x482906){if(_0x482906){_0x444de8=_0x482906;return db[_0x6966('0x7d')][_0x6966('0x51')]({'where':{'id':_0x482906[_0x6966('0x7e')]}});}})[_0x6966('0x34')](handleEntityNotFound(_0x475904,null))[_0x6966('0x34')](function(_0x4f7672){if(_0x4f7672){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6966('0x29'),_0x6966('0x7f'),_0x4f7672['type'],util[_0x6966('0x80')](_0xdb0b73[_0x6966('0x53')],{'showHidden':![],'depth':null}));switch(_0x4f7672[_0x6966('0x3d')]){case'twilio':if(_0xdb0b73[_0x6966('0x53')][_0x6966('0x81')]&&_0xdb0b73[_0x6966('0x53')][_0x6966('0x81')]===_0x444de8[_0x6966('0x82')]){return _0x444de8[_0x6966('0x33')]({'read':!![]});}else{logger['error'](_0x6966('0x83'),_0x6966('0x29'),_0x6966('0x84'),util[_0x6966('0x80')](_0xdb0b73[_0x6966('0x53')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0xdb0b73[_0x6966('0x53')][_0x6966('0x85')]&&_0xdb0b73[_0x6966('0x53')][_0x6966('0x85')]===_0x444de8[_0x6966('0x82')]&&_['indexOf']([_0x6966('0x86'),'delivered'],_0xdb0b73[_0x6966('0x53')][_0x6966('0x87')])>=0x0){return _0x444de8[_0x6966('0x33')]({'read':!![]});}else{logger['error'](_0x6966('0x83'),_0x6966('0x29'),_0x6966('0x88'),util[_0x6966('0x80')](_0xdb0b73['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2e08af=_0xdb0b73[_0x6966('0x53')][_0x6966('0x89')][0x0];if(_0x2e08af[_0x6966('0x29')][_0x6966('0x8a')]===_0x6966('0x8b')){return _0x444de8['update']({'read':!![]});}else{logger['error'](_0x6966('0x83'),_0x6966('0x29'),'infobip',util[_0x6966('0x80')](_0xdb0b73['body'],{'showHidden':![],'depth':null}));}break;}return _0x444de8;}})[_0x6966('0x34')](respondWithResult(_0x475904,null))['catch'](handleError(_0x475904,null));}; \ No newline at end of file +var _0xc3f3=['find','create','body','describe','../../config/logger','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','fullname','email','internal','SIP/%s','channel','motionChannel','event','acceptmessage','sms','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','QueryTypes','User','interface','EventManager','rejectmessage','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','delivered','Status','plivio','infobip','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','localhost','./smsMessage.socket','register','client','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','destroy','stack','name','index','map','SmsMessage','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','keys','includeAll'];(function(_0x2b0a86,_0x2ecebd){var _0x955940=function(_0x1988f8){while(--_0x1988f8){_0x2b0a86['push'](_0x2b0a86['shift']());}};_0x955940(++_0x2ecebd);}(_0xc3f3,0xd2));var _0x3c3f=function(_0x4f5911,_0x760049){_0x4f5911=_0x4f5911-0x0;var _0x50a5f1=_0xc3f3[_0x4f5911];return _0x50a5f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c3f('0x0'));var zipdir=require(_0x3c3f('0x1'));var jsonpatch=require(_0x3c3f('0x2'));var rp=require(_0x3c3f('0x3'));var moment=require(_0x3c3f('0x4'));var BPromise=require(_0x3c3f('0x5'));var Mustache=require(_0x3c3f('0x6'));var util=require(_0x3c3f('0x7'));var path=require(_0x3c3f('0x8'));var sox=require(_0x3c3f('0x9'));var csv=require(_0x3c3f('0xa'));var ejs=require(_0x3c3f('0xb'));var fs=require('fs');var fs_extra=require(_0x3c3f('0xc'));var _=require(_0x3c3f('0xd'));var squel=require(_0x3c3f('0xe'));var crypto=require(_0x3c3f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x3c3f('0x10'));var toCsv=require(_0x3c3f('0xa'));var querystring=require('querystring');var Papa=require(_0x3c3f('0x11'));var Redis=require(_0x3c3f('0x12'));var authService=require(_0x3c3f('0x13'));var qs=require(_0x3c3f('0x14'));var as=require(_0x3c3f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3c3f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c3f('0x17'))['db'];config[_0x3c3f('0x18')]=_['defaults'](config['redis'],{'host':_0x3c3f('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c3f('0x18')]));require(_0x3c3f('0x1a'))[_0x3c3f('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3c3f('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x3c3f('0x1c')][_0x3c3f('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4e5994,_0x487a83,_0x487036,_0x2d2782){return new BPromise(function(_0x106eb0,_0x160629){var _0x7e6aa6=_0x2d2782||client;return _0x7e6aa6[_0x3c3f('0x1e')](_0x4e5994,_0x487036)[_0x3c3f('0x1f')](function(_0x2311da){logger['info'](_0x3c3f('0x20'),_0x487a83,_0x3c3f('0x21'));logger[_0x3c3f('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x487a83,_0x3c3f('0x21'),JSON[_0x3c3f('0x23')](_0x2311da));if(_0x2311da[_0x3c3f('0x24')]){if(_0x2311da['error']['code']===0x1f4){logger[_0x3c3f('0x24')]('SmsMessage,\x20%s,\x20%s',_0x487a83,_0x2311da[_0x3c3f('0x24')]['message']);return _0x160629(_0x2311da[_0x3c3f('0x24')][_0x3c3f('0x25')]);}logger['error'](_0x3c3f('0x20'),_0x487a83,_0x2311da[_0x3c3f('0x24')][_0x3c3f('0x25')]);return _0x106eb0(_0x2311da[_0x3c3f('0x24')][_0x3c3f('0x25')]);}else{logger[_0x3c3f('0x26')](_0x3c3f('0x20'),_0x487a83,_0x3c3f('0x21'));_0x106eb0(_0x2311da['result'][_0x3c3f('0x25')]);}})[_0x3c3f('0x27')](function(_0x1c5584){logger[_0x3c3f('0x24')](_0x3c3f('0x20'),_0x487a83,_0x1c5584);_0x160629(_0x1c5584);});});}function respondWithStatusCode(_0x1485e9,_0x5dcd60){_0x5dcd60=_0x5dcd60||0xcc;return function(_0x470377){if(_0x470377){return _0x1485e9[_0x3c3f('0x28')](_0x5dcd60);}return _0x1485e9[_0x3c3f('0x29')](_0x5dcd60)[_0x3c3f('0x2a')]();};}function respondWithResult(_0xc89e04,_0xc181c0){_0xc181c0=_0xc181c0||0xc8;return function(_0xf75de6){if(_0xf75de6){return _0xc89e04[_0x3c3f('0x29')](_0xc181c0)[_0x3c3f('0x2b')](_0xf75de6);}};}function respondWithFilteredResult(_0x3eae70,_0x9b6215){return function(_0x36c32b){if(_0x36c32b){var _0x26f0d6=typeof _0x9b6215[_0x3c3f('0x2c')]===_0x3c3f('0x2d')&&typeof _0x9b6215['limit']===_0x3c3f('0x2d');var _0x192546=_0x36c32b[_0x3c3f('0x2e')];var _0x29e7bb=_0x26f0d6?0x0:_0x9b6215[_0x3c3f('0x2c')];var _0x6d2b15=_0x26f0d6?_0x36c32b[_0x3c3f('0x2e')]:_0x9b6215[_0x3c3f('0x2c')]+_0x9b6215['limit'];var _0x538f49;if(_0x6d2b15>=_0x192546){_0x6d2b15=_0x192546;_0x538f49=0xc8;}else{_0x538f49=0xce;}_0x3eae70[_0x3c3f('0x29')](_0x538f49);return _0x3eae70[_0x3c3f('0x2f')]('Content-Range',_0x29e7bb+'-'+_0x6d2b15+'/'+_0x192546)[_0x3c3f('0x2b')](_0x36c32b);}return null;};}function patchUpdates(_0x5f2c0d){return function(_0x3453d7){try{jsonpatch[_0x3c3f('0x30')](_0x3453d7,_0x5f2c0d,!![]);}catch(_0x4a7842){return BPromise[_0x3c3f('0x31')](_0x4a7842);}return _0x3453d7[_0x3c3f('0x32')]();};}function saveUpdates(_0x230e39,_0xa808da){return function(_0x55e11b){if(_0x55e11b){return _0x55e11b[_0x3c3f('0x33')](_0x230e39)[_0x3c3f('0x1f')](function(_0xb4821b){return _0xb4821b;});}return null;};}function removeEntity(_0x134054,_0x153f99){return function(_0x573e57){if(_0x573e57){return _0x573e57[_0x3c3f('0x34')]()[_0x3c3f('0x1f')](function(){_0x134054[_0x3c3f('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a8afa,_0x56ad08){return function(_0x9b8b83){if(!_0x9b8b83){_0x3a8afa[_0x3c3f('0x28')](0x194);}return _0x9b8b83;};}function handleError(_0x2ad1d6,_0x465823){_0x465823=_0x465823||0x1f4;return function(_0x341f5d){logger[_0x3c3f('0x24')](_0x341f5d[_0x3c3f('0x35')]);if(_0x341f5d[_0x3c3f('0x36')]){delete _0x341f5d[_0x3c3f('0x36')];}_0x2ad1d6['status'](_0x465823)['send'](_0x341f5d);};}exports[_0x3c3f('0x37')]=function(_0x3a27db,_0x3ef187){var _0x325e9c={},_0x489b3d={},_0x378f50={'count':0x0,'rows':[]};var _0x5c49ae=_[_0x3c3f('0x38')](db[_0x3c3f('0x39')][_0x3c3f('0x3a')],function(_0x2fd50d){return{'name':_0x2fd50d[_0x3c3f('0x3b')],'type':_0x2fd50d['type']['key']};});_0x489b3d[_0x3c3f('0x3c')]=_['map'](_0x5c49ae,_0x3c3f('0x36'));_0x489b3d[_0x3c3f('0x3d')]=_['keys'](_0x3a27db[_0x3c3f('0x3d')]);_0x489b3d[_0x3c3f('0x3e')]=_[_0x3c3f('0x3f')](_0x489b3d['model'],_0x489b3d[_0x3c3f('0x3d')]);_0x325e9c['attributes']=_[_0x3c3f('0x3f')](_0x489b3d['model'],qs['fields'](_0x3a27db[_0x3c3f('0x3d')][_0x3c3f('0x40')]));_0x325e9c[_0x3c3f('0x41')]=_0x325e9c[_0x3c3f('0x41')][_0x3c3f('0x42')]?_0x325e9c['attributes']:_0x489b3d[_0x3c3f('0x3c')];if(!_0x3a27db[_0x3c3f('0x3d')][_0x3c3f('0x43')]('nolimit')){_0x325e9c['limit']=qs[_0x3c3f('0x44')](_0x3a27db[_0x3c3f('0x3d')][_0x3c3f('0x44')]);_0x325e9c['offset']=qs[_0x3c3f('0x2c')](_0x3a27db[_0x3c3f('0x3d')][_0x3c3f('0x2c')]);}_0x325e9c['order']=qs[_0x3c3f('0x45')](_0x3a27db['query'][_0x3c3f('0x45')]);_0x325e9c[_0x3c3f('0x46')]=qs['filters'](_[_0x3c3f('0x47')](_0x3a27db[_0x3c3f('0x3d')],_0x489b3d[_0x3c3f('0x3e')]),_0x5c49ae);if(_0x3a27db[_0x3c3f('0x3d')][_0x3c3f('0x48')]){_0x325e9c[_0x3c3f('0x46')]=_[_0x3c3f('0x49')](_0x325e9c[_0x3c3f('0x46')],{'$or':_[_0x3c3f('0x38')](_0x5c49ae,function(_0x44cbdd){if(_0x44cbdd['type']!==_0x3c3f('0x4a')){var _0x3a51f2={};_0x3a51f2[_0x44cbdd[_0x3c3f('0x36')]]={'$like':'%'+_0x3a27db[_0x3c3f('0x3d')][_0x3c3f('0x48')]+'%'};return _0x3a51f2;}})});}_0x325e9c=_[_0x3c3f('0x49')]({},_0x325e9c,_0x3a27db[_0x3c3f('0x4b')]);var _0x378ebd={'where':_0x325e9c[_0x3c3f('0x46')]};return db[_0x3c3f('0x39')][_0x3c3f('0x2e')](_0x378ebd)[_0x3c3f('0x1f')](function(_0x36edb2){_0x378f50[_0x3c3f('0x2e')]=_0x36edb2;if(_0x3a27db[_0x3c3f('0x3d')]['includeAll']){_0x325e9c[_0x3c3f('0x4c')]=[{'all':!![]}];}return db[_0x3c3f('0x39')][_0x3c3f('0x4d')](_0x325e9c);})[_0x3c3f('0x1f')](function(_0x4a53aa){_0x378f50[_0x3c3f('0x4e')]=_0x4a53aa;return _0x378f50;})['then'](respondWithFilteredResult(_0x3ef187,_0x325e9c))[_0x3c3f('0x27')](handleError(_0x3ef187,null));};exports['show']=function(_0x4a5b46,_0x340247){var _0x3233d5={'raw':!![],'where':{'id':_0x4a5b46[_0x3c3f('0x4f')]['id']}},_0x1e2b9b={};_0x1e2b9b['model']=_[_0x3c3f('0x50')](db[_0x3c3f('0x39')][_0x3c3f('0x3a')]);_0x1e2b9b['query']=_[_0x3c3f('0x50')](_0x4a5b46[_0x3c3f('0x3d')]);_0x1e2b9b['filters']=_[_0x3c3f('0x3f')](_0x1e2b9b[_0x3c3f('0x3c')],_0x1e2b9b['query']);_0x3233d5['attributes']=_[_0x3c3f('0x3f')](_0x1e2b9b[_0x3c3f('0x3c')],qs[_0x3c3f('0x40')](_0x4a5b46['query']['fields']));_0x3233d5[_0x3c3f('0x41')]=_0x3233d5[_0x3c3f('0x41')][_0x3c3f('0x42')]?_0x3233d5[_0x3c3f('0x41')]:_0x1e2b9b['model'];if(_0x4a5b46['query'][_0x3c3f('0x51')]){_0x3233d5['include']=[{'all':!![]}];}_0x3233d5=_['merge']({},_0x3233d5,_0x4a5b46['options']);return db['SmsMessage'][_0x3c3f('0x52')](_0x3233d5)['then'](handleEntityNotFound(_0x340247,null))[_0x3c3f('0x1f')](respondWithResult(_0x340247,null))[_0x3c3f('0x27')](handleError(_0x340247,null));};exports[_0x3c3f('0x53')]=function(_0x13c8df,_0x40fa6b){return db['SmsMessage'][_0x3c3f('0x53')](_0x13c8df[_0x3c3f('0x54')],{})[_0x3c3f('0x1f')](respondWithResult(_0x40fa6b,0xc9))['catch'](handleError(_0x40fa6b,null));};exports[_0x3c3f('0x33')]=function(_0x4919a6,_0x3ffa57){if(_0x4919a6[_0x3c3f('0x54')]['id']){delete _0x4919a6[_0x3c3f('0x54')]['id'];}return db[_0x3c3f('0x39')][_0x3c3f('0x52')]({'where':{'id':_0x4919a6[_0x3c3f('0x4f')]['id']}})[_0x3c3f('0x1f')](handleEntityNotFound(_0x3ffa57,null))[_0x3c3f('0x1f')](saveUpdates(_0x4919a6[_0x3c3f('0x54')],null))[_0x3c3f('0x1f')](respondWithResult(_0x3ffa57,null))[_0x3c3f('0x27')](handleError(_0x3ffa57,null));};exports[_0x3c3f('0x34')]=function(_0x58cd96,_0x5d308e){return db['SmsMessage'][_0x3c3f('0x52')]({'where':{'id':_0x58cd96[_0x3c3f('0x4f')]['id']}})[_0x3c3f('0x1f')](handleEntityNotFound(_0x5d308e,null))[_0x3c3f('0x1f')](removeEntity(_0x5d308e,null))[_0x3c3f('0x27')](handleError(_0x5d308e,null));};exports[_0x3c3f('0x55')]=function(_0x5a74c5,_0x4f60d9){return db[_0x3c3f('0x39')][_0x3c3f('0x55')]()[_0x3c3f('0x1f')](respondWithResult(_0x4f60d9,null))['catch'](handleError(_0x4f60d9,null));};var interaction_log=require(_0x3c3f('0x56'))(_0x3c3f('0x57'));exports[_0x3c3f('0x58')]=function(_0x3b5bc1,_0x146cbe,_0x94f407){var _0x58cac5={'agent':{},'channel':'sms'};if(_0x3b5bc1['body']['id']){delete _0x3b5bc1[_0x3c3f('0x54')]['id'];}_0x3b5bc1[_0x3c3f('0x54')][_0x3c3f('0x59')]=!![];_0x3b5bc1['body'][_0x3c3f('0x5a')]=moment()[_0x3c3f('0x5b')](_0x3c3f('0x5c'));_0x3b5bc1[_0x3c3f('0x54')]['UserId']=_0x3b5bc1[_0x3c3f('0x54')][_0x3c3f('0x5d')]||_0x3b5bc1[_0x3c3f('0x5e')]['id'];_0x58cac5['agent']['id']=_0x3b5bc1['body']['UserId'];return db[_0x3c3f('0x39')][_0x3c3f('0x52')]({'where':{'id':_0x3b5bc1[_0x3c3f('0x4f')]['id'],'UserId':null}})[_0x3c3f('0x1f')](handleEntityNotFound(_0x146cbe,null))[_0x3c3f('0x1f')](saveUpdates(_0x3b5bc1[_0x3c3f('0x54')],null))[_0x3c3f('0x1f')](function(_0x1637aa){if(_0x1637aa){_0x58cac5[_0x3c3f('0x25')]=_0x1637aa[_0x3c3f('0x5f')]({'plain':!![]});return db[_0x3c3f('0x60')][_0x3c3f('0x52')]({'where':{'id':_0x1637aa[_0x3c3f('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x146cbe,null))[_0x3c3f('0x1f')](function(_0x15d1b2){if(_0x15d1b2){return _0x15d1b2[_0x3c3f('0x33')]({'UserId':_0x3b5bc1[_0x3c3f('0x54')][_0x3c3f('0x5d')],'read1stAt':_[_0x3c3f('0x62')](_0x15d1b2[_0x3c3f('0x63')])?moment()[_0x3c3f('0x5b')](_0x3c3f('0x5c')):undefined});}return null;})['then'](function(_0x5955df){if(_0x5955df){_0x58cac5[_0x3c3f('0x64')]=_0x5955df[_0x3c3f('0x5f')]({'plain':!![]});interaction_log[_0x3c3f('0x26')](_0x3c3f('0x65'),_0x3b5bc1[_0x3c3f('0x5e')]['id'],_0x3b5bc1[_0x3c3f('0x5e')][_0x3c3f('0x36')],_0x3b5bc1[_0x3c3f('0x5e')][_0x3c3f('0x66')],_0x58cac5[_0x3c3f('0x64')]['id'],_0x3b5bc1[_0x3c3f('0x54')]?JSON[_0x3c3f('0x23')](_0x3b5bc1[_0x3c3f('0x54')]):_0x3c3f('0x67'));return respondWithRpcPromise(_0x3c3f('0x68'),_0x3c3f('0x69'),_0x58cac5);}return null;})[_0x3c3f('0x1f')](function(_0xe3c814){var _0x385369=_0x3c3f('0x6a')+_0xe3c814[_0x3c3f('0x25')]['ContactId'];return db[_0x3c3f('0x6b')][_0x3c3f('0x3d')](_0x385369,{'type':db[_0x3c3f('0x6c')]['QueryTypes'][_0x3c3f('0x6d')],'raw':!![]})[_0x3c3f('0x1f')](function(_0x5d9460){return _0x5d9460;});})[_0x3c3f('0x1f')](function(_0x251ccd){if(_0x251ccd){_0x58cac5[_0x3c3f('0x25')][_0x3c3f('0x6e')]=_0x251ccd[0x0];if(!_0x3b5bc1['body']['UserId'])return;return db['User'][_0x3c3f('0x52')]({'where':{'id':_0x3b5bc1[_0x3c3f('0x54')]['UserId'],'role':'agent'},'attributes':['id',_0x3c3f('0x36'),_0x3c3f('0x6f'),_0x3c3f('0x70'),_0x3c3f('0x71')],'raw':!![]});}return null;})[_0x3c3f('0x1f')](function(_0x50d3c9){if(!_0x50d3c9)return null;_0x58cac5[_0x3c3f('0x25')]['agent']=_0x50d3c9;return _0x58cac5;})[_0x3c3f('0x1f')](function(_0x15f7df){if(_0x15f7df){if(_0x3b5bc1[_0x3c3f('0x54')]['manual']){_0x58cac5['message']['interface']=util[_0x3c3f('0x5b')](_0x3c3f('0x72'),_0x3b5bc1[_0x3c3f('0x5e')][_0x3c3f('0x36')]);_0x58cac5[_0x3c3f('0x25')][_0x3c3f('0x73')]=_0x58cac5['channel'];_0x58cac5[_0x3c3f('0x25')][_0x3c3f('0x74')]=_0x58cac5[_0x3c3f('0x73')];_0x58cac5[_0x3c3f('0x25')][_0x3c3f('0x75')]=_0x3c3f('0x58');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x3c3f('0x76'),'message':_0x58cac5[_0x3c3f('0x25')]},client9002)[_0x3c3f('0x1f')](function(){return _0x58cac5;});}return _0x58cac5;}return null;})[_0x3c3f('0x1f')](respondWithResult(_0x146cbe,null))['catch'](handleError(_0x146cbe,null));};var interaction_log=require(_0x3c3f('0x56'))('sms-interactions');exports[_0x3c3f('0x31')]=function(_0x3be6b6,_0x2dedb5,_0x45bfc5){var _0x44e431={'agent':{},'channel':_0x3c3f('0x77')};if(_0x3be6b6[_0x3c3f('0x54')]['id']){delete _0x3be6b6[_0x3c3f('0x54')]['id'];}_0x3be6b6[_0x3c3f('0x54')]['UserId']=_0x3be6b6[_0x3c3f('0x54')]['UserId']||_0x3be6b6[_0x3c3f('0x5e')]['id'];_0x44e431[_0x3c3f('0x78')]['id']=_0x3be6b6[_0x3c3f('0x54')][_0x3c3f('0x5d')];return db['SmsMessage'][_0x3c3f('0x52')]({'where':{'id':_0x3be6b6[_0x3c3f('0x4f')]['id'],'UserId':null}})[_0x3c3f('0x1f')](handleEntityNotFound(_0x2dedb5,null))[_0x3c3f('0x1f')](function(_0x2aa3ea){if(_0x2aa3ea){_0x44e431['message']=_0x2aa3ea[_0x3c3f('0x5f')]({'plain':!![]});return db['SmsInteraction'][_0x3c3f('0x52')]({'where':{'id':_0x2aa3ea[_0x3c3f('0x61')]}});}return null;})[_0x3c3f('0x1f')](handleEntityNotFound(_0x2dedb5,null))['then'](function(_0xb6df25){if(_0xb6df25){_0x44e431[_0x3c3f('0x64')]=_0xb6df25[_0x3c3f('0x5f')]({'plain':!![]});interaction_log['info'](_0x3c3f('0x79'),_0x3be6b6[_0x3c3f('0x5e')]['id'],_0x3be6b6[_0x3c3f('0x5e')][_0x3c3f('0x36')],_0x3be6b6[_0x3c3f('0x5e')][_0x3c3f('0x66')],_0x44e431[_0x3c3f('0x64')]['id'],_0x3be6b6[_0x3c3f('0x54')]?JSON[_0x3c3f('0x23')](_0x3be6b6[_0x3c3f('0x54')]):_0x3c3f('0x67'));return respondWithRpcPromise('RejectMessage',_0x3c3f('0x7a'),_0x44e431);}return null;})[_0x3c3f('0x1f')](function(_0xf695d0){var _0x1bccce=_0x3c3f('0x6a')+_0xf695d0['message']['ContactId'];return db[_0x3c3f('0x6b')]['query'](_0x1bccce,{'type':db[_0x3c3f('0x6c')][_0x3c3f('0x7b')]['SELECT'],'raw':!![]})[_0x3c3f('0x1f')](function(_0x13d473){return _0x13d473;});})[_0x3c3f('0x1f')](function(_0x50ec02){if(_0x50ec02){_0x44e431['message'][_0x3c3f('0x6e')]=_0x50ec02[0x0];if(!_0x3be6b6[_0x3c3f('0x54')][_0x3c3f('0x5d')])return;return db[_0x3c3f('0x7c')]['find']({'where':{'id':_0x3be6b6['body'][_0x3c3f('0x5d')],'role':_0x3c3f('0x78')},'attributes':['id',_0x3c3f('0x36'),'fullname',_0x3c3f('0x70'),_0x3c3f('0x71')],'raw':!![]});}return null;})['then'](function(_0x1bfca4){if(!_0x1bfca4)return null;_0x44e431[_0x3c3f('0x25')][_0x3c3f('0x78')]=_0x1bfca4;return _0x44e431;})[_0x3c3f('0x1f')](function(_0x442719){if(_0x442719){_0x442719[_0x3c3f('0x25')][_0x3c3f('0x7d')]=util[_0x3c3f('0x5b')]('SIP/%s',_0x3be6b6[_0x3c3f('0x5e')][_0x3c3f('0x36')]);_0x442719[_0x3c3f('0x25')][_0x3c3f('0x73')]=_0x44e431[_0x3c3f('0x73')];_0x442719['message'][_0x3c3f('0x74')]=_0x44e431['channel'];_0x442719[_0x3c3f('0x25')]['event']='reject';respondWithRpcPromise('EventManager',_0x3c3f('0x7e'),{'event':_0x3c3f('0x7f'),'message':_0x442719[_0x3c3f('0x25')]},client9002);return _0x44e431;}return null;})['then'](respondWithResult(_0x2dedb5,null))[_0x3c3f('0x27')](handleError(_0x2dedb5,null));};exports['status']=function(_0x2c5d09,_0x4d8951,_0x393af3){if(_0x2c5d09[_0x3c3f('0x54')]['id']){delete _0x2c5d09['body']['id'];}var _0x1a329d;return db[_0x3c3f('0x39')]['find']({'where':{'id':_0x2c5d09[_0x3c3f('0x4f')]['id']}})[_0x3c3f('0x1f')](handleEntityNotFound(_0x4d8951,null))[_0x3c3f('0x1f')](function(_0x4217ef){if(_0x4217ef){_0x1a329d=_0x4217ef;return db['SmsAccount'][_0x3c3f('0x52')]({'where':{'id':_0x4217ef[_0x3c3f('0x80')]}});}})[_0x3c3f('0x1f')](handleEntityNotFound(_0x4d8951,null))[_0x3c3f('0x1f')](function(_0x1b2af5){if(_0x1b2af5){logger[_0x3c3f('0x22')](_0x3c3f('0x81'),_0x3c3f('0x29'),_0x3c3f('0x82'),_0x1b2af5[_0x3c3f('0x83')],util[_0x3c3f('0x84')](_0x2c5d09[_0x3c3f('0x54')],{'showHidden':![],'depth':null}));switch(_0x1b2af5[_0x3c3f('0x83')]){case _0x3c3f('0x85'):if(_0x2c5d09[_0x3c3f('0x54')][_0x3c3f('0x86')]&&_0x2c5d09[_0x3c3f('0x54')][_0x3c3f('0x86')]===_0x1a329d[_0x3c3f('0x87')]){return _0x1a329d[_0x3c3f('0x33')]({'read':!![]});}else{logger['error'](_0x3c3f('0x88'),_0x3c3f('0x29'),_0x3c3f('0x85'),util['inspect'](_0x2c5d09[_0x3c3f('0x54')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x2c5d09[_0x3c3f('0x54')]['MessageUUID']&&_0x2c5d09[_0x3c3f('0x54')][_0x3c3f('0x89')]===_0x1a329d[_0x3c3f('0x87')]&&_[_0x3c3f('0x8a')](['sent',_0x3c3f('0x8b')],_0x2c5d09[_0x3c3f('0x54')][_0x3c3f('0x8c')])>=0x0){return _0x1a329d['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x3c3f('0x8d'),util[_0x3c3f('0x84')](_0x2c5d09[_0x3c3f('0x54')],{'showHidden':![],'depth':null}));}break;case _0x3c3f('0x8e'):var _0x111938=_0x2c5d09[_0x3c3f('0x54')][_0x3c3f('0x8f')][0x0];if(_0x111938[_0x3c3f('0x29')][_0x3c3f('0x90')]===_0x3c3f('0x91')){return _0x1a329d[_0x3c3f('0x33')]({'read':!![]});}else{logger[_0x3c3f('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3c3f('0x29'),_0x3c3f('0x8e'),util[_0x3c3f('0x84')](_0x2c5d09[_0x3c3f('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x1a329d;}})['then'](respondWithResult(_0x4d8951,null))[_0x3c3f('0x27')](handleError(_0x4d8951,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index b1f852d..146f6ba 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 _0x6662=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x12402a,_0x550650){var _0x3213d4=function(_0x221318){while(--_0x221318){_0x12402a['push'](_0x12402a['shift']());}};_0x3213d4(++_0x550650);}(_0x6662,0x1b2));var _0x2666=function(_0x542149,_0x5df180){_0x542149=_0x542149-0x0;var _0x36df57=_0x6662[_0x542149];return _0x36df57;};'use strict';var EventEmitter=require(_0x2666('0x0'));var SmsMessage=require(_0x2666('0x1'))['db'][_0x2666('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2666('0x3')](0x0);var events={'afterCreate':_0x2666('0x4'),'afterUpdate':_0x2666('0x5'),'afterDestroy':_0x2666('0x6')};function emitEvent(_0x1f99c6){return function(_0x2575eb,_0x12d004,_0x572862){SmsMessageEvents[_0x2666('0x7')](_0x1f99c6+':'+_0x2575eb['id'],_0x2575eb);SmsMessageEvents['emit'](_0x1f99c6,_0x2575eb);_0x572862(null);};}for(var e in events){if(events[_0x2666('0x8')](e)){var event=events[e];SmsMessage[_0x2666('0x9')](e,emitEvent(event));}}module[_0x2666('0xa')]=SmsMessageEvents; \ No newline at end of file +var _0x0da0=['exports','events','../../mysqldb','SmsMessage','save','update','remove','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0da0,0x111));var _0x00da=function(_0x35028e,_0x719104){_0x35028e=_0x35028e-0x0;var _0x14fc8e=_0x0da0[_0x35028e];return _0x14fc8e;};'use strict';var EventEmitter=require(_0x00da('0x0'));var SmsMessage=require(_0x00da('0x1'))['db'][_0x00da('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x00da('0x3'),'afterUpdate':_0x00da('0x4'),'afterDestroy':_0x00da('0x5')};function emitEvent(_0x32d0ea){return function(_0x1a9e63,_0x45df5d,_0x4bc4f8){SmsMessageEvents[_0x00da('0x6')](_0x32d0ea+':'+_0x1a9e63['id'],_0x1a9e63);SmsMessageEvents[_0x00da('0x6')](_0x32d0ea,_0x1a9e63);_0x4bc4f8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x00da('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 52552dc..e68a167 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 _0x386d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','sms_messages','messageId','FULLTEXT','models','get','direction','toLowerCase','out','SmsInteractionId','SmsInteraction','findOne','update','catch','error','secret','SmsAccount','SmsAccountId','then','type','twilio','accountSid','authToken','messages','create','phone','remote','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','body','smsMethod','sender','login?username=','&password=','password','GET','POST','user_key','session_key','deliveryReport','inspect','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','read','clicksend','senderString','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','infobip','baseUrl','/auth/1/session','/api/sms/messages/','application/json','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','lodash'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0x386d,0x1cf));var _0xd386=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x386d[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xd386('0x0'));var util=require(_0xd386('0x1'));var logger=require(_0xd386('0x2'))(_0xd386('0x3'));var moment=require(_0xd386('0x4'));var BPromise=require(_0xd386('0x5'));var rp=require(_0xd386('0x6'));var fs=require('fs');var path=require(_0xd386('0x7'));var rimraf=require(_0xd386('0x8'));var config=require(_0xd386('0x9'));var attributes=require(_0xd386('0xa'));module[_0xd386('0xb')]=function(_0x3a1d84,_0x502a5a){return _0x3a1d84['define']('SmsMessage',attributes,{'tableName':_0xd386('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xd386('0xd')]},{'name':'fti_sms_messages','fields':['body'],'type':_0xd386('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e2c0f,_0x225be1,_0x26348a){var _0x534452=_0x3a1d84[_0xd386('0xf')];var _0x4b5225=_0x3e2c0f[_0xd386('0x10')]({'plain':!![]});if(_0x4b5225[_0xd386('0x11')]['toLowerCase']()==='in'||_0x4b5225[_0xd386('0x11')][_0xd386('0x12')]()===_0xd386('0x13')&&!_0x4b5225['secret']&&!_['isNil'](_0x4b5225['UserId'])&&!_['isNil'](_0x4b5225[_0xd386('0x14')])){_0x534452[_0xd386('0x15')][_0xd386('0x16')]({'where':{'id':_0x4b5225['SmsInteractionId']}})['then'](function(_0x317980){if(_0x317980){_0x317980[_0xd386('0x17')]({'lastMsgAt':_0x4b5225['createdAt'],'lastMsgDirection':_0x4b5225[_0xd386('0x11')][_0xd386('0x12')]()});}})[_0xd386('0x18')](function(_0x6b3e9b){console[_0xd386('0x19')](_0x6b3e9b);});}if(_0x4b5225[_0xd386('0x11')]===_0xd386('0x13')&&!_0x4b5225[_0xd386('0x1a')]){var _0xed4708;_0x534452[_0xd386('0x1b')]['find']({'where':{'id':_0x4b5225[_0xd386('0x1c')]},'raw':!![]})[_0xd386('0x1d')](function(_0x44df7a){_0xed4708=_0x44df7a;if(_0xed4708&&_0xed4708['type']){switch(_0xed4708[_0xd386('0x1e')]){case _0xd386('0x1f'):var _0x44b335=require(_0xd386('0x1f'));if(_0xed4708[_0xd386('0x20')]&&_0xed4708[_0xd386('0x21')]&&_0xed4708['phone']){var _0xaa2c92=new _0x44b335(_0xed4708[_0xd386('0x20')],_0xed4708[_0xd386('0x21')]);_0xaa2c92[_0xd386('0x22')][_0xd386('0x23')]({'body':_0x4b5225['body'],'to':_0x4b5225[_0xd386('0x24')],'from':_0xed4708[_0xd386('0x24')],'statusCallback':_0xed4708[_0xd386('0x25')]+'/api/sms/messages/'+_0x4b5225['id']+_0xd386('0x26')+_0xed4708[_0xd386('0x27')]})['then'](function(_0x3d638d){if(_0x3d638d[_0xd386('0x28')]){return _0x3e2c0f[_0xd386('0x17')]({'messageId':_0x3d638d[_0xd386('0x28')]});}})[_0xd386('0x18')](function(_0x4a5365){logger[_0xd386('0x19')](_0xd386('0x29'),'afterCreate',_0xd386('0x1f'),util['inspect'](_0x4a5365,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xd386('0x2b'):var _0x3a69de=_0xd386('0x2c');if(_0xed4708[_0xd386('0x2d')]&&_0xed4708['password']){var _0x5f4be1={'recipient':[_0x4b5225[_0xd386('0x24')]],'message':_0x4b5225[_0xd386('0x2e')],'message_type':_0xed4708[_0xd386('0x2f')]};if(_0xed4708['smsMethod']&&_0xed4708['smsMethod']!=='SI'){_0x5f4be1[_0xd386('0x30')]=_0xed4708[_0xd386('0x24')];}var _0x2df79f={'url':_0x3a69de+_0xd386('0x31')+_0xed4708[_0xd386('0x2d')]+_0xd386('0x32')+_0xed4708[_0xd386('0x33')],'method':_0xd386('0x34')};rp(_0x2df79f)[_0xd386('0x1d')](function(_0x1ff4c9){var _0x527329=_0x1ff4c9['split'](';');var _0x3b7232={'user_key':_0x527329[0x0],'session_key':_0x527329[0x1]};_0x2df79f={'url':_0x3a69de+'sms','method':_0xd386('0x35'),'headers':{'user_key':_0x3b7232[_0xd386('0x36')],'Session_key':_0x3b7232[_0xd386('0x37')]},'json':!![],'body':_0x5f4be1};return rp(_0x2df79f);})['then'](function(_0x1e07a7){if(_0x1e07a7['total_sent']>=0x1){var _0x4e827b={'messageId':_0x1e07a7['internal_order_id']};if(_0xed4708[_0xd386('0x2f')]!=='GP'||!_0xed4708[_0xd386('0x38')]){_0x4e827b['read']=!![];}return _0x3e2c0f['update'](_0x4e827b);}else{return logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x2b'),util[_0xd386('0x39')](_0x1e07a7,{'showHidden':![],'depth':null}));}})[_0xd386('0x18')](function(_0xbdbbc9){return logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),'skebby',util[_0xd386('0x39')](_0xbdbbc9,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x2b'),_0xd386('0x3a'));}break;case _0xd386('0x3b'):if(_0xed4708[_0xd386('0x21')]){var _0x4fc7ee={'recipient':_0x4b5225['phone'],'message':_0x4b5225[_0xd386('0x2e')],'sender':_0xed4708['senderString']||_0xed4708['phone'],'authorization':_0xed4708['authToken']};var _0x225be1={'method':_0xd386('0x35'),'uri':_0xd386('0x3c'),'body':_0x4fc7ee,'json':!![]};rp(_0x225be1)[_0xd386('0x1d')](function(_0x4fb6c5){var _0x2c6cec={'messageId':_0x4fb6c5['requestid']};if(!_0xed4708['deliveryReport']){_0x2c6cec[_0xd386('0x3d')]=!![];}return _0x3e2c0f[_0xd386('0x17')](_0x2c6cec);})[_0xd386('0x18')](function(_0x3a1b32){logger[_0xd386('0x19')](_0xd386('0x29'),'afterCreate','connectel',util[_0xd386('0x39')](_0x3a1b32,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0xd386('0x3e'):if(_0xed4708[_0xd386('0x2d')]&&_0xed4708['password']){var _0x4fc7ee={'messages':[{'source':'xCALLY\x20Motion','to':_0x4b5225[_0xd386('0x24')],'body':_0x4b5225[_0xd386('0x2e')],'from':_0xed4708[_0xd386('0x3f')]||_0xed4708['phone']}]};var _0x30c4e3=util['format'](_0xd386('0x40'),_0xed4708[_0xd386('0x2d')],_0xed4708[_0xd386('0x33')]);var _0x225be1={'method':'POST','uri':_0xd386('0x41'),'body':_0x4fc7ee,'headers':{'Authorization':util[_0xd386('0x42')](_0xd386('0x43'),new Buffer(_0x30c4e3)['toString'](_0xd386('0x44')))},'json':!![]};rp(_0x225be1)[_0xd386('0x1d')](function(_0x24e192){if(_0x24e192[_0xd386('0x45')]>=0xc8&&_0x24e192[_0xd386('0x45')]<=0xce){if(_0x24e192[_0xd386('0x46')]&&_0x24e192[_0xd386('0x46')][_0xd386('0x47')]>0x0){var _0x4a2856=_['head'](_0x24e192[_0xd386('0x46')][_0xd386('0x22')]);var _0x118839={'messageId':_0x4a2856[_0xd386('0x48')]};if(!_0xed4708['deliveryReport']){_0x118839[_0xd386('0x3d')]=!![];}return _0x3e2c0f[_0xd386('0x17')](_0x118839);}else{logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),_0xd386('0x49'),util['inspect'](_0x24e192,{'showHidden':![],'depth':null}));}}else{logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),_0xd386('0x49'),util[_0xd386('0x39')](_0x24e192,{'showHidden':![],'depth':null}));}})[_0xd386('0x18')](function(_0x1b3fcb){logger[_0xd386('0x19')](_0xd386('0x29'),'afterCreate',_0xd386('0x49'),util[_0xd386('0x39')](_0x1b3fcb,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x49'),_0xd386('0x3a'));}break;case _0xd386('0x4a'):if(_0xed4708[_0xd386('0x4b')]&&_0xed4708['authToken']){var _0x4fc7ee={'dst':_0x4b5225[_0xd386('0x24')],'text':_0x4b5225[_0xd386('0x2e')],'src':_0xed4708[_0xd386('0x3f')]||_0xed4708[_0xd386('0x24')],'url':_0xed4708['remote']+'/api/sms/messages/'+_0x4b5225['id']+'/status?token='+_0xed4708[_0xd386('0x27')]};var _0x30c4e3=util[_0xd386('0x42')](_0xd386('0x40'),_0xed4708[_0xd386('0x4b')],_0xed4708[_0xd386('0x21')]);var _0x225be1={'method':_0xd386('0x35'),'uri':util[_0xd386('0x42')](_0xd386('0x4c'),_0xed4708[_0xd386('0x4b')]),'body':_0x4fc7ee,'headers':{'Authorization':util[_0xd386('0x42')]('Basic\x20%s',new Buffer(_0x30c4e3)[_0xd386('0x4d')](_0xd386('0x44')))},'json':!![]};rp(_0x225be1)[_0xd386('0x1d')](function(_0x1e04df){var _0x48690b={'messageId':_0x1e04df['message_uuid'][0x0]};return _0x3e2c0f[_0xd386('0x17')](_0x48690b);})[_0xd386('0x18')](function(_0x48cf9e){logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x4a'),util[_0xd386('0x39')](_0x48cf9e,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),_0xd386('0x4a'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xd386('0x4e'):if(_0xed4708[_0xd386('0x2d')]&&_0xed4708[_0xd386('0x33')]){if(_0xed4708[_0xd386('0x4f')]){var _0xd54ea2={'method':_0xd386('0x35'),'uri':_0xed4708[_0xd386('0x4f')]+_0xd386('0x50'),'body':{'username':_0xed4708[_0xd386('0x2d')],'password':_0xed4708[_0xd386('0x33')]},'json':!![]};return rp(_0xd54ea2)[_0xd386('0x1d')](function(_0x2735ba){var _0x654814={'method':_0xd386('0x35'),'uri':_0xed4708['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0xed4708[_0xd386('0x24')],'destinations':[{'to':_0x4b5225[_0xd386('0x24')]}],'text':_0x4b5225['body'],'notifyUrl':_0xed4708['remote']+_0xd386('0x51')+_0x4b5225['id']+'/status?token='+_0xed4708[_0xd386('0x27')],'notifyContentType':_0xd386('0x52'),'callbackData':_0xed4708[_0xd386('0x24')]+';'+_0x4b5225[_0xd386('0x2e')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x2735ba[_0xd386('0x27')]},'json':!![]};return rp(_0x654814)['then'](function(_0x44df08){if(_0x44df08[_0xd386('0x22')]){var _0x235023={'messageId':_0x44df08['messages'][0x0][_0xd386('0xd')]};if(!_0xed4708[_0xd386('0x38')]){_0x235023[_0xd386('0x3d')]=!![];}return _0x3e2c0f['update'](_0x235023);}else{return logger[_0xd386('0x19')](_0xd386('0x29'),'afterCreate',_0xd386('0x4e'),util[_0xd386('0x39')](_0x44df08,{'showHidden':![],'depth':null}));}});})[_0xd386('0x18')](function(_0x4379dd){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),'infobip',util[_0xd386('0x39')](_0x4379dd,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd386('0x4e'),_0xd386('0x53'));}}else{logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),'infobip',_0xd386('0x3a'));}break;case _0xd386('0x54'):var _0x38432e=require('crypto');if(_0xed4708[_0xd386('0x55')]){var _0x501900={};_0x501900[_0xd386('0x56')]=_0xed4708['username'];_0x501900[_0xd386('0x24')]=_0x4b5225[_0xd386('0x24')];_0x501900['sender']=_0xed4708[_0xd386('0x24')];_0x501900[_0xd386('0x57')]=_0x4b5225['body'];_0x501900[_0xd386('0x58')]=+new Date();var _0x22b1fa='';var _0x24b6e0='';var _0x2360d3=Object[_0xd386('0x59')](_0x501900);_0x2360d3[_0xd386('0x5a')]();for(var _0x5a72f7=0x0;_0x5a72f7<_0x2360d3[_0xd386('0x5b')];_0x5a72f7++){if(_0x22b1fa!=''){_0x22b1fa+='&';}_0x22b1fa+=_0x2360d3[_0x5a72f7]+'='+encodeURIComponent(_0x501900[_0x2360d3[_0x5a72f7]]);_0x24b6e0+=_0x501900[_0x2360d3[_0x5a72f7]];}_0x24b6e0+=_0xed4708[_0xd386('0x55')];_0x24b6e0=_0x38432e[_0xd386('0x5c')](_0xd386('0x5d'))[_0xd386('0x17')](_0x24b6e0)[_0xd386('0x5e')]('hex');if(_0x22b1fa!==''){_0x22b1fa+='&';}_0x22b1fa+=_0xd386('0x5f')+_0x24b6e0;var _0x2df79f={'method':'GET','uri':_0xed4708[_0xd386('0x4f')]+_0xd386('0x60')+_0x22b1fa,'json':!![]};return rp(_0x2df79f)[_0xd386('0x1d')](function(_0x417ff4){var _0x5aca34=Object[_0xd386('0x59')](_0x417ff4);if(_0x417ff4[_0x5aca34[0x0]][_0xd386('0x19')]&&parseInt(_0x417ff4[_0x5aca34[0x0]]['error'])===0x0){var _0x44224a={'messageId':_0x417ff4[_0x5aca34[0x0]]['id_sms']};if(!_0xed4708[_0xd386('0x38')]){_0x44224a[_0xd386('0x3d')]=!![];}return _0x3e2c0f[_0xd386('0x17')](_0x44224a);}else{return logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x54'),util['inspect'](_0x417ff4['error'],{'showHidden':![],'depth':null}));}})[_0xd386('0x18')](function(_0x377370){return logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0xd386('0x39')](_0x377370,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x54'),_0xd386('0x61'));}break;case _0xd386('0x62'):if(_0xed4708[_0xd386('0x55')]){var _0x2d9b92={'method':'POST','uri':_0xd386('0x63'),'headers':{'Authorization':_0xed4708['apiKey']},'body':{'content':_0x4b5225[_0xd386('0x2e')],'to':[_0x4b5225[_0xd386('0x24')]],'from':_0xed4708[_0xd386('0x24')],'binary':![],'clientMessageId':'uuid','charset':_0xd386('0x64')},'json':!![]};rp(_0x2d9b92)['then'](function(_0xde2218){if(!_0xde2218['error']){var _0xe0285d={'messageId':_0xde2218[_0xd386('0x22')][0x0][_0xd386('0x65')]};if(!_0xed4708[_0xd386('0x38')]){_0xe0285d[_0xd386('0x3d')]=!![];}return _0x3e2c0f[_0xd386('0x17')](_0xe0285d);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),'clickatell',util[_0xd386('0x39')](_0xde2218[_0xd386('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x10116d){return logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x62'),util[_0xd386('0x39')](_0x10116d,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x62'),_0xd386('0x61'));}break;case _0xd386('0x66'):if(_0xed4708[_0xd386('0x2d')]&&_0xed4708['password']){var _0x30c4e3=util['format'](_0xd386('0x40'),_0xed4708[_0xd386('0x2d')],_0xed4708[_0xd386('0x33')]);var _0x225be1={'method':_0xd386('0x35'),'uri':_0xd386('0x67')+_0xed4708[_0xd386('0x68')]+'/messages','body':{'to':[_0x4b5225['phone']],'text':_0x4b5225[_0xd386('0x2e')],'from':_0xed4708[_0xd386('0x24')],'applicationId':_0xed4708[_0xd386('0x69')]},'headers':{'Authorization':util[_0xd386('0x42')](_0xd386('0x43'),new Buffer(_0x30c4e3)['toString'](_0xd386('0x44')))},'json':!![]};rp(_0x225be1)[_0xd386('0x1d')](function(_0x21b3bd){if(_0x21b3bd['id']){var _0x177ad0={'messageId':_0x21b3bd['id']};return _0x3e2c0f['update'](_0x177ad0);}else{logger['error'](_0xd386('0x29'),'afterCreate',_0xd386('0x66'),util[_0xd386('0x39')](_0x21b3bd,{'showHidden':![],'depth':null}));}})[_0xd386('0x18')](function(_0x63a5ae){logger[_0xd386('0x19')](_0xd386('0x29'),'afterCreate','bandwidth',util[_0xd386('0x39')](_0x63a5ae,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),_0xd386('0x66'),_0xd386('0x3a'));}break;case'intelepeer':if(_0xed4708['apiKey']){var _0x3853d9={};var _0x2df79f={'method':_0xd386('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0xed4708[_0xd386('0x55')],'Content-Type':'application/json'},'body':{'from':_0xed4708['phone'],'to':_0x4b5225[_0xd386('0x24')],'text':_0x4b5225[_0xd386('0x2e')]},'json':!![]};return rp(_0x2df79f)[_0xd386('0x1d')](function(_0x1d1a46){if(_0x1d1a46[_0xd386('0x6a')]==0xca){_0x3853d9[_0xd386('0x6b')]=_0x1d1a46;var _0x5a2f44={'method':_0xd386('0x35'),'uri':_0xd386('0x6c'),'headers':{'Authorization':_0xd386('0x6d')+_0xed4708[_0xd386('0x55')],'Content-Type':_0xd386('0x52')},'body':{'refid':_0x3853d9[_0xd386('0x6b')][_0xd386('0x6e')]},'json':!![]};return rp(_0x5a2f44)[_0xd386('0x1d')](function(_0x4b288a){_0x3853d9[_0xd386('0x6f')]=_0x4b288a;var _0x23fb54={'messageId':_0x3853d9[_0xd386('0x6b')][_0xd386('0x6e')],'read':!![]};return _0x3e2c0f[_0xd386('0x17')](_0x23fb54);});}else{return logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x70'),util[_0xd386('0x39')](_0x1d1a46,{'showHidden':![],'depth':null}));}})['catch'](function(_0x18a8e5){return logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),_0xd386('0x70'),util['inspect'](_0x18a8e5,{'showHidden':![],'depth':null}));});}else{return logger[_0xd386('0x19')](_0xd386('0x29'),'afterCreate',_0xd386('0x70'),_0xd386('0x71'));}break;}}})[_0xd386('0x72')](function(){_0x26348a();});}else{_0x26348a();}}},'charset':_0xd386('0x73'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x91e8=['crypto','apiKey','login','text','timestamp','keys','sort','length','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','direction','toLowerCase','out','secret','UserId','isNil','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','SmsAccount','find','SmsAccountId','type','twilio','phone','accountSid','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','&password=','split','sms','POST','session_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','authToken','senderString','requestid','deliveryReport','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','username','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','clickSend','plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','baseUrl','/auth/1/session','application/json','infobip','Missing\x20parameters:\x20base_url','csc'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x91e8,0x9d));var _0x891e=function(_0x1e214e,_0x3bf473){_0x1e214e=_0x1e214e-0x0;var _0x204e82=_0x91e8[_0x1e214e];return _0x204e82;};'use strict';var _=require(_0x891e('0x0'));var util=require(_0x891e('0x1'));var logger=require(_0x891e('0x2'))(_0x891e('0x3'));var moment=require(_0x891e('0x4'));var BPromise=require(_0x891e('0x5'));var rp=require(_0x891e('0x6'));var fs=require('fs');var path=require(_0x891e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x891e('0x8')]=function(_0x134d9f,_0x330cc9){return _0x134d9f['define'](_0x891e('0x9'),attributes,{'tableName':_0x891e('0xa'),'paranoid':![],'indexes':[{'name':_0x891e('0xb'),'fields':[_0x891e('0xb')]},{'name':_0x891e('0xc'),'fields':[_0x891e('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x256f44,_0x4de40e,_0x39372b){var _0x37bacc=_0x134d9f['models'];var _0x232930=_0x256f44['get']({'plain':!![]});if(_0x232930[_0x891e('0xe')][_0x891e('0xf')]()==='in'||_0x232930[_0x891e('0xe')][_0x891e('0xf')]()===_0x891e('0x10')&&!_0x232930[_0x891e('0x11')]&&!_['isNil'](_0x232930[_0x891e('0x12')])&&!_[_0x891e('0x13')](_0x232930[_0x891e('0x14')])){_0x37bacc[_0x891e('0x15')]['findOne']({'where':{'id':_0x232930['SmsInteractionId']}})[_0x891e('0x16')](function(_0x50cc94){if(_0x50cc94){_0x50cc94[_0x891e('0x17')]({'lastMsgAt':_0x232930[_0x891e('0x18')],'lastMsgDirection':_0x232930[_0x891e('0xe')][_0x891e('0xf')]()});}})[_0x891e('0x19')](function(_0x3b8008){console['error'](_0x3b8008);});}if(_0x232930[_0x891e('0xe')]===_0x891e('0x10')&&!_0x232930[_0x891e('0x11')]){var _0x2df5cc;_0x37bacc[_0x891e('0x1a')][_0x891e('0x1b')]({'where':{'id':_0x232930[_0x891e('0x1c')]},'raw':!![]})['then'](function(_0x5489b9){_0x2df5cc=_0x5489b9;if(_0x2df5cc&&_0x2df5cc[_0x891e('0x1d')]){switch(_0x2df5cc[_0x891e('0x1d')]){case _0x891e('0x1e'):var _0x5c89a5=require(_0x891e('0x1e'));if(_0x2df5cc['accountSid']&&_0x2df5cc['authToken']&&_0x2df5cc[_0x891e('0x1f')]){var _0x403237=new _0x5c89a5(_0x2df5cc[_0x891e('0x20')],_0x2df5cc['authToken']);_0x403237[_0x891e('0x21')][_0x891e('0x22')]({'body':_0x232930[_0x891e('0xd')],'to':_0x232930[_0x891e('0x1f')],'from':_0x2df5cc[_0x891e('0x1f')],'statusCallback':_0x2df5cc[_0x891e('0x23')]+_0x891e('0x24')+_0x232930['id']+_0x891e('0x25')+_0x2df5cc[_0x891e('0x26')]})[_0x891e('0x16')](function(_0x15efbd){if(_0x15efbd[_0x891e('0x27')]){return _0x256f44[_0x891e('0x17')]({'messageId':_0x15efbd[_0x891e('0x27')]});}})['catch'](function(_0x3de394){logger['error'](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x1e'),util[_0x891e('0x2a')](_0x3de394,{'showHidden':![],'depth':null}));});}else{logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x1e'),_0x891e('0x2c'));}break;case _0x891e('0x2d'):var _0xa9817f=_0x891e('0x2e');if(_0x2df5cc['username']&&_0x2df5cc[_0x891e('0x2f')]){var _0x36d359={'recipient':[_0x232930['phone']],'message':_0x232930[_0x891e('0xd')],'message_type':_0x2df5cc[_0x891e('0x30')]};if(_0x2df5cc[_0x891e('0x30')]&&_0x2df5cc[_0x891e('0x30')]!=='SI'){_0x36d359[_0x891e('0x31')]=_0x2df5cc[_0x891e('0x1f')];}var _0x490b6d={'url':_0xa9817f+'login?username='+_0x2df5cc['username']+_0x891e('0x32')+_0x2df5cc[_0x891e('0x2f')],'method':'GET'};rp(_0x490b6d)[_0x891e('0x16')](function(_0x5472f4){var _0x23e76d=_0x5472f4[_0x891e('0x33')](';');var _0x1fd341={'user_key':_0x23e76d[0x0],'session_key':_0x23e76d[0x1]};_0x490b6d={'url':_0xa9817f+_0x891e('0x34'),'method':_0x891e('0x35'),'headers':{'user_key':_0x1fd341['user_key'],'Session_key':_0x1fd341[_0x891e('0x36')]},'json':!![],'body':_0x36d359};return rp(_0x490b6d);})[_0x891e('0x16')](function(_0x4e921c){if(_0x4e921c[_0x891e('0x37')]>=0x1){var _0x224ef3={'messageId':_0x4e921c[_0x891e('0x38')]};if(_0x2df5cc[_0x891e('0x30')]!=='GP'||!_0x2df5cc['deliveryReport']){_0x224ef3[_0x891e('0x39')]=!![];}return _0x256f44[_0x891e('0x17')](_0x224ef3);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x891e('0x29'),_0x891e('0x2d'),util[_0x891e('0x2a')](_0x4e921c,{'showHidden':![],'depth':null}));}})[_0x891e('0x19')](function(_0x2fc3c9){return logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x2d'),util[_0x891e('0x2a')](_0x2fc3c9,{'showHidden':![],'depth':null}));});}else{logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x2d'),_0x891e('0x3a'));}break;case _0x891e('0x3b'):if(_0x2df5cc[_0x891e('0x3c')]){var _0x1592f2={'recipient':_0x232930[_0x891e('0x1f')],'message':_0x232930['body'],'sender':_0x2df5cc[_0x891e('0x3d')]||_0x2df5cc[_0x891e('0x1f')],'authorization':_0x2df5cc['authToken']};var _0x4de40e={'method':_0x891e('0x35'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x1592f2,'json':!![]};rp(_0x4de40e)[_0x891e('0x16')](function(_0x3d0abd){var _0x4af3e2={'messageId':_0x3d0abd[_0x891e('0x3e')]};if(!_0x2df5cc[_0x891e('0x3f')]){_0x4af3e2['read']=!![];}return _0x256f44[_0x891e('0x17')](_0x4af3e2);})[_0x891e('0x19')](function(_0x46081e){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x891e('0x29'),_0x891e('0x3b'),util[_0x891e('0x2a')](_0x46081e,{'showHidden':![],'depth':null}));});}else{logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x3b'),_0x891e('0x40'));}break;case'clicksend':if(_0x2df5cc['username']&&_0x2df5cc[_0x891e('0x2f')]){var _0x1592f2={'messages':[{'source':_0x891e('0x41'),'to':_0x232930[_0x891e('0x1f')],'body':_0x232930['body'],'from':_0x2df5cc['senderString']||_0x2df5cc[_0x891e('0x1f')]}]};var _0x37fd0d=util[_0x891e('0x42')]('%s:%s',_0x2df5cc[_0x891e('0x43')],_0x2df5cc['password']);var _0x4de40e={'method':_0x891e('0x35'),'uri':_0x891e('0x44'),'body':_0x1592f2,'headers':{'Authorization':util[_0x891e('0x42')](_0x891e('0x45'),new Buffer(_0x37fd0d)[_0x891e('0x46')](_0x891e('0x47')))},'json':!![]};rp(_0x4de40e)['then'](function(_0x26b5c4){if(_0x26b5c4[_0x891e('0x48')]>=0xc8&&_0x26b5c4[_0x891e('0x48')]<=0xce){if(_0x26b5c4[_0x891e('0x49')]&&_0x26b5c4['data'][_0x891e('0x4a')]>0x0){var _0x3b63e0=_['head'](_0x26b5c4['data'][_0x891e('0x21')]);var _0x11a797={'messageId':_0x3b63e0['message_id']};if(!_0x2df5cc[_0x891e('0x3f')]){_0x11a797['read']=!![];}return _0x256f44[_0x891e('0x17')](_0x11a797);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x891e('0x29'),_0x891e('0x4b'),util[_0x891e('0x2a')](_0x26b5c4,{'showHidden':![],'depth':null}));}}else{logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x4b'),util['inspect'](_0x26b5c4,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5a77df){logger[_0x891e('0x2b')](_0x891e('0x28'),'afterCreate',_0x891e('0x4b'),util[_0x891e('0x2a')](_0x5a77df,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x4b'),_0x891e('0x3a'));}break;case _0x891e('0x4c'):if(_0x2df5cc[_0x891e('0x4d')]&&_0x2df5cc['authToken']){var _0x1592f2={'dst':_0x232930[_0x891e('0x1f')],'text':_0x232930[_0x891e('0xd')],'src':_0x2df5cc[_0x891e('0x3d')]||_0x2df5cc['phone'],'url':_0x2df5cc[_0x891e('0x23')]+_0x891e('0x24')+_0x232930['id']+'/status?token='+_0x2df5cc[_0x891e('0x26')]};var _0x37fd0d=util[_0x891e('0x42')](_0x891e('0x4e'),_0x2df5cc[_0x891e('0x4d')],_0x2df5cc['authToken']);var _0x4de40e={'method':'POST','uri':util[_0x891e('0x42')](_0x891e('0x4f'),_0x2df5cc[_0x891e('0x4d')]),'body':_0x1592f2,'headers':{'Authorization':util['format'](_0x891e('0x45'),new Buffer(_0x37fd0d)[_0x891e('0x46')]('base64'))},'json':!![]};rp(_0x4de40e)['then'](function(_0x2d45e6){var _0x1bf3ff={'messageId':_0x2d45e6[_0x891e('0x50')][0x0]};return _0x256f44[_0x891e('0x17')](_0x1bf3ff);})['catch'](function(_0x290898){logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x4c'),util['inspect'](_0x290898,{'showHidden':![],'depth':null}));});}else{logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x4c'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x2df5cc['username']&&_0x2df5cc[_0x891e('0x2f')]){if(_0x2df5cc['baseUrl']){var _0x5d223f={'method':'POST','uri':_0x2df5cc[_0x891e('0x51')]+_0x891e('0x52'),'body':{'username':_0x2df5cc['username'],'password':_0x2df5cc['password']},'json':!![]};return rp(_0x5d223f)[_0x891e('0x16')](function(_0x66fc2f){var _0x220e6e={'method':_0x891e('0x35'),'uri':_0x2df5cc[_0x891e('0x51')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x2df5cc[_0x891e('0x1f')],'destinations':[{'to':_0x232930[_0x891e('0x1f')]}],'text':_0x232930[_0x891e('0xd')],'notifyUrl':_0x2df5cc[_0x891e('0x23')]+_0x891e('0x24')+_0x232930['id']+_0x891e('0x25')+_0x2df5cc['token'],'notifyContentType':_0x891e('0x53'),'callbackData':_0x2df5cc[_0x891e('0x1f')]+';'+_0x232930[_0x891e('0xd')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x66fc2f['token']},'json':!![]};return rp(_0x220e6e)['then'](function(_0x380d76){if(_0x380d76['messages']){var _0x79a7c9={'messageId':_0x380d76['messages'][0x0][_0x891e('0xb')]};if(!_0x2df5cc['deliveryReport']){_0x79a7c9[_0x891e('0x39')]=!![];}return _0x256f44[_0x891e('0x17')](_0x79a7c9);}else{return logger['error'](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x54'),util[_0x891e('0x2a')](_0x380d76,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x5647b4){return logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x54'),util['inspect'](_0x5647b4,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x891e('0x28'),'afterCreate',_0x891e('0x54'),_0x891e('0x55'));}}else{logger['error'](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x54'),_0x891e('0x3a'));}break;case _0x891e('0x56'):var _0x5efb77=require(_0x891e('0x57'));if(_0x2df5cc[_0x891e('0x58')]){var _0x5b3996={};_0x5b3996[_0x891e('0x59')]=_0x2df5cc[_0x891e('0x43')];_0x5b3996['phone']=_0x232930[_0x891e('0x1f')];_0x5b3996[_0x891e('0x31')]=_0x2df5cc[_0x891e('0x1f')];_0x5b3996[_0x891e('0x5a')]=_0x232930[_0x891e('0xd')];_0x5b3996[_0x891e('0x5b')]=+new Date();var _0x4a9e13='';var _0x282599='';var _0x143209=Object[_0x891e('0x5c')](_0x5b3996);_0x143209[_0x891e('0x5d')]();for(var _0x4848c2=0x0;_0x4848c2<_0x143209[_0x891e('0x5e')];_0x4848c2++){if(_0x4a9e13!=''){_0x4a9e13+='&';}_0x4a9e13+=_0x143209[_0x4848c2]+'='+encodeURIComponent(_0x5b3996[_0x143209[_0x4848c2]]);_0x282599+=_0x5b3996[_0x143209[_0x4848c2]];}_0x282599+=_0x2df5cc[_0x891e('0x58')];_0x282599=_0x5efb77['createHash'](_0x891e('0x5f'))[_0x891e('0x17')](_0x282599)[_0x891e('0x60')](_0x891e('0x61'));if(_0x4a9e13!==''){_0x4a9e13+='&';}_0x4a9e13+=_0x891e('0x62')+_0x282599;var _0x490b6d={'method':_0x891e('0x63'),'uri':_0x2df5cc['baseUrl']+_0x891e('0x64')+_0x4a9e13,'json':!![]};return rp(_0x490b6d)[_0x891e('0x16')](function(_0x2099f0){var _0x2310fe=Object[_0x891e('0x5c')](_0x2099f0);if(_0x2099f0[_0x2310fe[0x0]]['error']&&parseInt(_0x2099f0[_0x2310fe[0x0]]['error'])===0x0){var _0x4f2756={'messageId':_0x2099f0[_0x2310fe[0x0]][_0x891e('0x65')]};if(!_0x2df5cc[_0x891e('0x3f')]){_0x4f2756['read']=!![];}return _0x256f44[_0x891e('0x17')](_0x4f2756);}else{return logger[_0x891e('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x891e('0x29'),_0x891e('0x56'),util[_0x891e('0x2a')](_0x2099f0['error'],{'showHidden':![],'depth':null}));}})[_0x891e('0x19')](function(_0x2464f2){return logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x56'),util[_0x891e('0x2a')](_0x2464f2,{'showHidden':![],'depth':null}));});}else{logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x56'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x2df5cc[_0x891e('0x58')]){var _0x15f51b={'method':_0x891e('0x35'),'uri':_0x891e('0x66'),'headers':{'Authorization':_0x2df5cc[_0x891e('0x58')]},'body':{'content':_0x232930[_0x891e('0xd')],'to':[_0x232930[_0x891e('0x1f')]],'from':_0x2df5cc[_0x891e('0x1f')],'binary':![],'clientMessageId':'uuid','charset':_0x891e('0x67')},'json':!![]};rp(_0x15f51b)[_0x891e('0x16')](function(_0xb1cbd7){if(!_0xb1cbd7['error']){var _0x2d8077={'messageId':_0xb1cbd7['messages'][0x0][_0x891e('0x68')]};if(!_0x2df5cc['deliveryReport']){_0x2d8077[_0x891e('0x39')]=!![];}return _0x256f44['update'](_0x2d8077);}else{return logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x69'),util[_0x891e('0x2a')](_0xb1cbd7['error'],{'showHidden':![],'depth':null}));}})[_0x891e('0x19')](function(_0x34edc5){return logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x69'),util[_0x891e('0x2a')](_0x34edc5,{'showHidden':![],'depth':null}));});}else{logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x69'),_0x891e('0x6a'));}break;case _0x891e('0x6b'):if(_0x2df5cc[_0x891e('0x43')]&&_0x2df5cc['password']){var _0x37fd0d=util[_0x891e('0x42')](_0x891e('0x4e'),_0x2df5cc['username'],_0x2df5cc[_0x891e('0x2f')]);var _0x4de40e={'method':_0x891e('0x35'),'uri':_0x891e('0x6c')+_0x2df5cc[_0x891e('0x6d')]+'/messages','body':{'to':[_0x232930[_0x891e('0x1f')]],'text':_0x232930[_0x891e('0xd')],'from':_0x2df5cc['phone'],'applicationId':_0x2df5cc[_0x891e('0x6e')]},'headers':{'Authorization':util[_0x891e('0x42')](_0x891e('0x45'),new Buffer(_0x37fd0d)['toString']('base64'))},'json':!![]};rp(_0x4de40e)[_0x891e('0x16')](function(_0x174bed){if(_0x174bed['id']){var _0x1a3681={'messageId':_0x174bed['id']};return _0x256f44['update'](_0x1a3681);}else{logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x6b'),util[_0x891e('0x2a')](_0x174bed,{'showHidden':![],'depth':null}));}})[_0x891e('0x19')](function(_0x31c252){logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x6b'),util[_0x891e('0x2a')](_0x31c252,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x6b'),_0x891e('0x3a'));}break;case'intelepeer':if(_0x2df5cc[_0x891e('0x58')]){var _0x4b3bd8={};var _0x490b6d={'method':_0x891e('0x35'),'uri':_0x891e('0x6f'),'headers':{'Authorization':_0x891e('0x70')+_0x2df5cc[_0x891e('0x58')],'Content-Type':_0x891e('0x53')},'body':{'from':_0x2df5cc[_0x891e('0x1f')],'to':_0x232930[_0x891e('0x1f')],'text':_0x232930['body']},'json':!![]};return rp(_0x490b6d)[_0x891e('0x16')](function(_0x74a782){if(_0x74a782[_0x891e('0x71')]==0xca){_0x4b3bd8[_0x891e('0x72')]=_0x74a782;var _0x18f43d={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x891e('0x70')+_0x2df5cc[_0x891e('0x58')],'Content-Type':_0x891e('0x53')},'body':{'refid':_0x4b3bd8['message'][_0x891e('0x73')]},'json':!![]};return rp(_0x18f43d)[_0x891e('0x16')](function(_0x5c7f68){_0x4b3bd8[_0x891e('0x74')]=_0x5c7f68;var _0x1bd272={'messageId':_0x4b3bd8['message'][_0x891e('0x73')],'read':!![]};return _0x256f44[_0x891e('0x17')](_0x1bd272);});}else{return logger['error'](_0x891e('0x28'),'afterCreate',_0x891e('0x75'),util['inspect'](_0x74a782,{'showHidden':![],'depth':null}));}})[_0x891e('0x19')](function(_0x5f40e6){return logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x75'),util['inspect'](_0x5f40e6,{'showHidden':![],'depth':null}));});}else{return logger[_0x891e('0x2b')](_0x891e('0x28'),_0x891e('0x29'),_0x891e('0x75'),_0x891e('0x76'));}break;}}})[_0x891e('0x77')](function(){_0x39372b();});}else{_0x39372b();}}},'charset':_0x891e('0x78'),'collate':_0x891e('0x79')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index b607785..42a13d0 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 _0x65fc=['info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch','CreateSmsMessage','create','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','localhost','socket.io-emitter','./smsMessage.socket','register','then'];(function(_0x2c6761,_0x5aefd1){var _0x4f9445=function(_0x464f54){while(--_0x464f54){_0x2c6761['push'](_0x2c6761['shift']());}};_0x4f9445(++_0x5aefd1);}(_0x65fc,0x176));var _0xc65f=function(_0x2f1182,_0x1551ea){_0x2f1182=_0x2f1182-0x0;var _0x412471=_0x65fc[_0x2f1182];return _0x412471;};'use strict';var _=require('lodash');var util=require(_0xc65f('0x0'));var moment=require(_0xc65f('0x1'));var BPromise=require(_0xc65f('0x2'));var rs=require(_0xc65f('0x3'));var fs=require('fs');var Redis=require(_0xc65f('0x4'));var db=require(_0xc65f('0x5'))['db'];var utils=require(_0xc65f('0x6'));var logger=require('../../config/logger')(_0xc65f('0x7'));var config=require(_0xc65f('0x8'));var jayson=require(_0xc65f('0x9'));var client=jayson[_0xc65f('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc65f('0xb'),'port':0x18eb});var socket=require(_0xc65f('0xc'))(new Redis(config['redis']));require(_0xc65f('0xd'))[_0xc65f('0xe')](socket);function respondWithRpcPromise(_0x312a25,_0x90c8cf,_0x53a7ae){return new BPromise(function(_0xbceacc,_0x2fe498){return client['request'](_0x312a25,_0x53a7ae)[_0xc65f('0xf')](function(_0x519fc5){logger[_0xc65f('0x10')]('SmsMessage,\x20%s,\x20%s',_0x90c8cf,_0xc65f('0x11'));logger[_0xc65f('0x12')](_0xc65f('0x13'),_0x90c8cf,_0xc65f('0x11'),JSON[_0xc65f('0x14')](_0x519fc5));if(_0x519fc5['error']){if(_0x519fc5[_0xc65f('0x15')][_0xc65f('0x16')]===0x1f4){logger[_0xc65f('0x15')](_0xc65f('0x17'),_0x90c8cf,_0x519fc5[_0xc65f('0x15')][_0xc65f('0x18')]);return _0x2fe498(_0x519fc5[_0xc65f('0x15')][_0xc65f('0x18')]);}logger[_0xc65f('0x15')](_0xc65f('0x17'),_0x90c8cf,_0x519fc5[_0xc65f('0x15')][_0xc65f('0x18')]);return _0xbceacc(_0x519fc5[_0xc65f('0x15')]['message']);}else{logger[_0xc65f('0x10')](_0xc65f('0x17'),_0x90c8cf,_0xc65f('0x11'));_0xbceacc(_0x519fc5['result'][_0xc65f('0x18')]);}})[_0xc65f('0x19')](function(_0x5a24a7){logger[_0xc65f('0x15')](_0xc65f('0x17'),_0x90c8cf,_0x5a24a7);_0x2fe498(_0x5a24a7);});});}exports[_0xc65f('0x1a')]=function(_0x4a4975){var _0x4fdbac=this;return new Promise(function(_0x3b2b96,_0x2393a2){return db['SmsMessage'][_0xc65f('0x1b')](_0x4a4975['body'],{'raw':_0x4a4975[_0xc65f('0x1c')]?_0x4a4975['options'][_0xc65f('0x1d')]===undefined?!![]:![]:!![]})[_0xc65f('0xf')](function(_0x653614){logger[_0xc65f('0x10')](_0xc65f('0x1a'),_0x4a4975);logger['debug'](_0xc65f('0x1a'),_0x4a4975,JSON[_0xc65f('0x14')](_0x653614));_0x3b2b96(_0x653614);})[_0xc65f('0x19')](function(_0x27331b){logger[_0xc65f('0x15')]('CreateSmsMessage',_0x27331b[_0xc65f('0x18')],_0x4a4975);_0x2393a2(_0x4fdbac['error'](0x1f4,_0x27331b['message']));});});}; \ No newline at end of file +var _0xd8cd=['CreateSmsMessage','SmsMessage','create','body','options','raw','stringify','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./smsMessage.socket','register','request','then','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd8cd,0xa3));var _0xdd8c=function(_0x5bbc4b,_0x38fd86){_0x5bbc4b=_0x5bbc4b-0x0;var _0x38c064=_0xd8cd[_0x5bbc4b];return _0x38c064;};'use strict';var _=require(_0xdd8c('0x0'));var util=require('util');var moment=require(_0xdd8c('0x1'));var BPromise=require(_0xdd8c('0x2'));var rs=require(_0xdd8c('0x3'));var fs=require('fs');var Redis=require(_0xdd8c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdd8c('0x5'))(_0xdd8c('0x6'));var config=require(_0xdd8c('0x7'));var jayson=require(_0xdd8c('0x8'));var client=jayson[_0xdd8c('0x9')]['http']({'port':0x232a});config[_0xdd8c('0xa')]=_[_0xdd8c('0xb')](config[_0xdd8c('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdd8c('0xc'))[_0xdd8c('0xd')](socket);function respondWithRpcPromise(_0x1bc075,_0x3a495e,_0x55d5fd){return new BPromise(function(_0x547567,_0x50b2cb){return client[_0xdd8c('0xe')](_0x1bc075,_0x55d5fd)[_0xdd8c('0xf')](function(_0x381144){logger[_0xdd8c('0x10')]('SmsMessage,\x20%s,\x20%s',_0x3a495e,'request\x20sent');logger[_0xdd8c('0x11')](_0xdd8c('0x12'),_0x3a495e,'request\x20sent',JSON['stringify'](_0x381144));if(_0x381144[_0xdd8c('0x13')]){if(_0x381144['error'][_0xdd8c('0x14')]===0x1f4){logger['error'](_0xdd8c('0x15'),_0x3a495e,_0x381144[_0xdd8c('0x13')][_0xdd8c('0x16')]);return _0x50b2cb(_0x381144['error'][_0xdd8c('0x16')]);}logger[_0xdd8c('0x13')]('SmsMessage,\x20%s,\x20%s',_0x3a495e,_0x381144[_0xdd8c('0x13')][_0xdd8c('0x16')]);return _0x547567(_0x381144[_0xdd8c('0x13')]['message']);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x3a495e,'request\x20sent');_0x547567(_0x381144['result'][_0xdd8c('0x16')]);}})['catch'](function(_0x324f30){logger[_0xdd8c('0x13')](_0xdd8c('0x15'),_0x3a495e,_0x324f30);_0x50b2cb(_0x324f30);});});}exports[_0xdd8c('0x17')]=function(_0x5da7d1){var _0x4e6a0c=this;return new Promise(function(_0x819430,_0x603506){return db[_0xdd8c('0x18')][_0xdd8c('0x19')](_0x5da7d1[_0xdd8c('0x1a')],{'raw':_0x5da7d1[_0xdd8c('0x1b')]?_0x5da7d1['options'][_0xdd8c('0x1c')]===undefined?!![]:![]:!![]})[_0xdd8c('0xf')](function(_0x7f96fa){logger[_0xdd8c('0x10')](_0xdd8c('0x17'),_0x5da7d1);logger[_0xdd8c('0x11')]('CreateSmsMessage',_0x5da7d1,JSON[_0xdd8c('0x1d')](_0x7f96fa));_0x819430(_0x7f96fa);})[_0xdd8c('0x1e')](function(_0x365c8a){logger[_0xdd8c('0x13')]('CreateSmsMessage',_0x365c8a[_0xdd8c('0x16')],_0x5da7d1);_0x603506(_0x4e6a0c[_0xdd8c('0x13')](0x1f4,_0x365c8a['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 4f5bfa3..549e7bd 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 _0x0123=['./smsMessage.events','save','remove','emit','register','length','smsMessage:'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0x0123,0x165));var _0x3012=function(_0x31fdcd,_0x2b43f3){_0x31fdcd=_0x31fdcd-0x0;var _0xe1a26c=_0x0123[_0x31fdcd];return _0xe1a26c;};'use strict';var SmsMessageEvents=require(_0x3012('0x0'));var events=[_0x3012('0x1'),_0x3012('0x2'),'update'];function createListener(_0x12faaf,_0x3ee0e9){return function(_0x3d8717){_0x3ee0e9[_0x3012('0x3')](_0x12faaf,_0x3d8717);};}function removeListener(_0x4e22fd,_0xe7803e){return function(){SmsMessageEvents['removeListener'](_0x4e22fd,_0xe7803e);};}exports[_0x3012('0x4')]=function(_0x34b02f){for(var _0x15faaf=0x0,_0x790c16=events[_0x3012('0x5')];_0x15faaf<_0x790c16;_0x15faaf++){var _0x203939=events[_0x15faaf];var _0x111adb=createListener(_0x3012('0x6')+_0x203939,_0x34b02f);SmsMessageEvents['on'](_0x203939,_0x111adb);}}; \ No newline at end of file +var _0x8199=['save','update','emit','removeListener','register','smsMessage:'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8199,0xc0));var _0x9819=function(_0x3e42bc,_0x453323){_0x3e42bc=_0x3e42bc-0x0;var _0x2081ed=_0x8199[_0x3e42bc];return _0x2081ed;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x9819('0x0'),'remove',_0x9819('0x1')];function createListener(_0x265053,_0x29bfec){return function(_0x49d09b){_0x29bfec[_0x9819('0x2')](_0x265053,_0x49d09b);};}function removeListener(_0x612d5a,_0x12c5ed){return function(){SmsMessageEvents[_0x9819('0x3')](_0x612d5a,_0x12c5ed);};}exports[_0x9819('0x4')]=function(_0x374ff7){for(var _0x3ef4f8=0x0,_0x205cd7=events['length'];_0x3ef4f8<_0x205cd7;_0x3ef4f8++){var _0x259f87=events[_0x3ef4f8];var _0x17cbf9=createListener(_0x9819('0x5')+_0x259f87,_0x374ff7);SmsMessageEvents['on'](_0x259f87,_0x17cbf9);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index f8a1d78..30dc052 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 _0xcce2=['/:id','getMembers','/:id/teams','getTeams','create','post','/:id/users','update','delete','destroy','removeTeams','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4f045c,_0x383164){var _0x430ec4=function(_0x3a6488){while(--_0x3a6488){_0x4f045c['push'](_0x4f045c['shift']());}};_0x430ec4(++_0x383164);}(_0xcce2,0x135));var _0x2cce=function(_0x1aade5,_0x28d424){_0x1aade5=_0x1aade5-0x0;var _0x538d6d=_0xcce2[_0x1aade5];return _0x538d6d;};'use strict';var multer=require(_0x2cce('0x0'));var util=require(_0x2cce('0x1'));var path=require('path');var timeout=require(_0x2cce('0x2'));var express=require(_0x2cce('0x3'));var router=express[_0x2cce('0x4')]();var fs_extra=require(_0x2cce('0x5'));var auth=require(_0x2cce('0x6'));var interaction=require(_0x2cce('0x7'));var config=require(_0x2cce('0x8'));var controller=require(_0x2cce('0x9'));router[_0x2cce('0xa')]('/',auth[_0x2cce('0xb')](),controller[_0x2cce('0xc')]);router[_0x2cce('0xa')](_0x2cce('0xd'),auth['isAuthenticated'](),controller[_0x2cce('0xe')]);router[_0x2cce('0xa')](_0x2cce('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x2cce('0xa')]('/:id/members',auth[_0x2cce('0xb')](),controller[_0x2cce('0x10')]);router[_0x2cce('0xa')](_0x2cce('0x11'),auth[_0x2cce('0xb')](),controller[_0x2cce('0x12')]);router[_0x2cce('0xa')]('/:id/users',auth[_0x2cce('0xb')](),controller['getAgents']);router['post']('/',auth[_0x2cce('0xb')](),controller[_0x2cce('0x13')]);router[_0x2cce('0x14')](_0x2cce('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0x2cce('0x14')](_0x2cce('0x15'),auth[_0x2cce('0xb')](),controller['addAgents']);router['put'](_0x2cce('0xf'),auth['isAuthenticated'](),controller[_0x2cce('0x16')]);router[_0x2cce('0x17')](_0x2cce('0xf'),auth[_0x2cce('0xb')](),controller[_0x2cce('0x18')]);router[_0x2cce('0x17')](_0x2cce('0x11'),auth['isAuthenticated'](),controller[_0x2cce('0x19')]);router[_0x2cce('0x17')](_0x2cce('0x15'),auth[_0x2cce('0xb')](),controller[_0x2cce('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x045c=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','update','destroy','removeTeams','delete','removeAgents','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x045c,0x81));var _0xc045=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x045c[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc045('0x0'));var timeout=require(_0xc045('0x1'));var express=require(_0xc045('0x2'));var router=express[_0xc045('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc045('0x4'));var interaction=require(_0xc045('0x5'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0xc045('0x6')]('/',auth[_0xc045('0x7')](),controller[_0xc045('0x8')]);router[_0xc045('0x6')](_0xc045('0x9'),auth[_0xc045('0x7')](),controller[_0xc045('0xa')]);router[_0xc045('0x6')](_0xc045('0xb'),auth[_0xc045('0x7')](),controller[_0xc045('0xc')]);router[_0xc045('0x6')](_0xc045('0xd'),auth[_0xc045('0x7')](),controller[_0xc045('0xe')]);router['get'](_0xc045('0xf'),auth[_0xc045('0x7')](),controller[_0xc045('0x10')]);router[_0xc045('0x6')](_0xc045('0x11'),auth[_0xc045('0x7')](),controller['getAgents']);router[_0xc045('0x12')]('/',auth['isAuthenticated'](),controller[_0xc045('0x13')]);router[_0xc045('0x12')](_0xc045('0xf'),auth[_0xc045('0x7')](),controller[_0xc045('0x14')]);router['post'](_0xc045('0x11'),auth[_0xc045('0x7')](),controller['addAgents']);router[_0xc045('0x15')](_0xc045('0xb'),auth[_0xc045('0x7')](),controller[_0xc045('0x16')]);router['delete'](_0xc045('0xb'),auth['isAuthenticated'](),controller[_0xc045('0x17')]);router['delete'](_0xc045('0xf'),auth[_0xc045('0x7')](),controller[_0xc045('0x18')]);router[_0xc045('0x19')](_0xc045('0x11'),auth['isAuthenticated'](),controller[_0xc045('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 1aaac79..0ec283e 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 _0x459c=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','ENUM'];(function(_0x1830e9,_0x32a22e){var _0x327d99=function(_0x11c48f){while(--_0x11c48f){_0x1830e9['push'](_0x1830e9['shift']());}};_0x327d99(++_0x32a22e);}(_0x459c,0x18b));var _0xc459=function(_0x279893,_0x210445){_0x279893=_0x279893-0x0;var _0x174c6b=_0x459c[_0x279893];return _0x174c6b;};'use strict';var Sequelize=require(_0xc459('0x0'));module[_0xc459('0x1')]={'name':{'type':Sequelize[_0xc459('0x2')],'unique':_0xc459('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc459('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc459('0x4')](_0xc459('0x5'),_0xc459('0x6'),_0xc459('0x7'))}}; \ No newline at end of file +var _0xcb30=['STRING','INTEGER','beepall','roundrobin','sequelize','name'];(function(_0x2a3689,_0x5269be){var _0x3915d3=function(_0x1803ac){while(--_0x1803ac){_0x2a3689['push'](_0x2a3689['shift']());}};_0x3915d3(++_0x5269be);}(_0xcb30,0x70));var _0x0cb3=function(_0x179a00,_0x30c575){_0x179a00=_0x179a00-0x0;var _0x1d1e4f=_0xcb30[_0x179a00];return _0x1d1e4f;};'use strict';var Sequelize=require(_0x0cb3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x0cb3('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0cb3('0x2')]},'timeout':{'type':Sequelize[_0x0cb3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x0cb3('0x4'),_0x0cb3('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index b32f11a..8e84eed 100644 --- a/server/api/smsQueue/smsQueue.controller.js +++ b/server/api/smsQueue/smsQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','then','get','SmsQueues','destroy','error','stack','name','map','SmsQueue','fieldName','type','key','where','include','rows','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','body','params','describe','getMembers','findOne','UserSmsQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','SmsQueueId','filter','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','pick','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','emit'];(function(_0x48ebe8,_0x25cf34){var _0x2aa204=function(_0x3b13af){while(--_0x3b13af){_0x48ebe8['push'](_0x48ebe8['shift']());}};_0x2aa204(++_0x25cf34);}(_0xdb28,0x106));var _0x8db2=function(_0x4daee2,_0x5d6b1){_0x4daee2=_0x4daee2-0x0;var _0x55120e=_0xdb28[_0x4daee2];return _0x55120e;};'use strict';var BPromise=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var _=require(_0x8db2('0x2'));var squel=require(_0x8db2('0x3'));var Redis=require('ioredis');var qs=require(_0x8db2('0x4'));var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var db=require(_0x8db2('0x8'))['db'];config['redis']=_[_0x8db2('0x9')](config[_0x8db2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xb'))[_0x8db2('0xc')](socket);function respondWithStatusCode(_0x29f698,_0x2f3f2f){_0x2f3f2f=_0x2f3f2f||0xcc;return function(_0x1ff362){if(_0x1ff362){return _0x29f698[_0x8db2('0xd')](_0x2f3f2f);}return _0x29f698['status'](_0x2f3f2f)[_0x8db2('0xe')]();};}function respondWithResult(_0x476216,_0x1f62af){_0x1f62af=_0x1f62af||0xc8;return function(_0x57015f){if(_0x57015f){return _0x476216[_0x8db2('0xf')](_0x1f62af)[_0x8db2('0x10')](_0x57015f);}};}function respondWithFilteredResult(_0x576475,_0x41beda){return function(_0x3b2faa){if(_0x3b2faa){var _0x1349f6=typeof _0x41beda[_0x8db2('0x11')]===_0x8db2('0x12')&&typeof _0x41beda['limit']==='undefined';var _0x15070d=_0x3b2faa[_0x8db2('0x13')];var _0x350d61=_0x1349f6?0x0:_0x41beda[_0x8db2('0x11')];var _0x227355=_0x1349f6?_0x3b2faa[_0x8db2('0x13')]:_0x41beda[_0x8db2('0x11')]+_0x41beda[_0x8db2('0x14')];var _0x131252;if(_0x227355>=_0x15070d){_0x227355=_0x15070d;_0x131252=0xc8;}else{_0x131252=0xce;}_0x576475[_0x8db2('0xf')](_0x131252);return _0x576475['set'](_0x8db2('0x15'),_0x350d61+'-'+_0x227355+'/'+_0x15070d)[_0x8db2('0x10')](_0x3b2faa);}return null;};}function saveUpdates(_0x48101e){return function(_0x2b3f73){if(_0x2b3f73){return _0x2b3f73[_0x8db2('0x16')](_0x48101e)[_0x8db2('0x17')](function(_0x3fddc2){return _0x3fddc2;});}return null;};}function removeEntity(_0x2efd06){return function(_0x46ce14){if(_0x46ce14){return _0x46ce14['destroy']()['then'](function(){var _0x77789=_0x46ce14[_0x8db2('0x18')]({'plain':!![]});var _0x1310d3=_0x8db2('0x19');return db['UserProfileResource'][_0x8db2('0x1a')]({'where':{'type':_0x1310d3,'resourceId':_0x77789['id']}})[_0x8db2('0x17')](function(){return _0x46ce14;});})[_0x8db2('0x17')](function(){_0x2efd06[_0x8db2('0xf')](0xcc)[_0x8db2('0xe')]();});}};}function handleEntityNotFound(_0x597260){return function(_0x124467){if(!_0x124467){_0x597260[_0x8db2('0xd')](0x194);}return _0x124467;};}function handleError(_0x18f69c,_0x125be2){_0x125be2=_0x125be2||0x1f4;return function(_0x2260d8){logger[_0x8db2('0x1b')](_0x2260d8[_0x8db2('0x1c')]);if(_0x2260d8['name']){delete _0x2260d8[_0x8db2('0x1d')];}_0x18f69c['status'](_0x125be2)['send'](_0x2260d8);};}exports['index']=function(_0x4d923c,_0xec8cd2){var _0x29b5cd={};var _0x3be281={'count':0x0,'rows':[]};var _0x2baed0=_[_0x8db2('0x1e')](db[_0x8db2('0x1f')]['rawAttributes'],function(_0x3544ba){return{'name':_0x3544ba[_0x8db2('0x20')],'type':_0x3544ba[_0x8db2('0x21')][_0x8db2('0x22')]};});_0x29b5cd=qs['getOptions'](_0x2baed0,_0x4d923c);var _0x2e0691={'where':_0x29b5cd[_0x8db2('0x23')]};return db[_0x8db2('0x1f')][_0x8db2('0x13')](_0x2e0691)[_0x8db2('0x17')](function(_0x21bae5){_0x3be281[_0x8db2('0x13')]=_0x21bae5;_0x29b5cd[_0x8db2('0x24')]=qs[_0x8db2('0x24')](_0x4d923c['query']);return db[_0x8db2('0x1f')]['findAll'](_0x29b5cd);})['then'](function(_0x302188){_0x3be281[_0x8db2('0x25')]=_0x302188;return _0x3be281;})[_0x8db2('0x17')](respondWithFilteredResult(_0xec8cd2,_0x29b5cd))['catch'](handleError(_0xec8cd2,null));};exports[_0x8db2('0x26')]=function(_0x56b71a,_0x3f7aac){var _0x2b653b={'raw':!![],'where':{'id':_0x56b71a['params']['id']}},_0x14bd12={};_0x14bd12['model']=_[_0x8db2('0x27')](db[_0x8db2('0x1f')]['rawAttributes']);_0x14bd12['query']=_[_0x8db2('0x27')](_0x56b71a[_0x8db2('0x28')]);_0x14bd12[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],_0x14bd12[_0x8db2('0x28')]);_0x2b653b[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x56b71a['query'][_0x8db2('0x2d')]));_0x2b653b[_0x8db2('0x2c')]=_0x2b653b['attributes'][_0x8db2('0x2e')]?_0x2b653b[_0x8db2('0x2c')]:_0x14bd12['model'];if(_0x56b71a['query'][_0x8db2('0x2f')]){_0x2b653b['include']=[{'all':!![]}];}_0x2b653b=_[_0x8db2('0x30')]({},_0x2b653b,_0x56b71a[_0x8db2('0x31')]);return db[_0x8db2('0x1f')][_0x8db2('0x32')](_0x2b653b)['then'](handleEntityNotFound(_0x3f7aac,null))[_0x8db2('0x17')](respondWithResult(_0x3f7aac,null))['catch'](handleError(_0x3f7aac,null));};exports[_0x8db2('0x33')]=function(_0xd550ae,_0x2c8bc9){return db[_0x8db2('0x1f')]['create'](_0xd550ae['body'],{})[_0x8db2('0x17')](function(_0x2c0507){var _0x5dc2b4=_0xd550ae[_0x8db2('0x34')][_0x8db2('0x18')]({'plain':!![]});if(!_0x5dc2b4)throw new Error(_0x8db2('0x35'));if(_0x5dc2b4['role']===_0x8db2('0x34')){var _0x149186=_0x2c0507[_0x8db2('0x18')]({'plain':!![]});var _0x279e74=_0x8db2('0x19');return db[_0x8db2('0x36')][_0x8db2('0x32')]({'where':{'name':_0x279e74,'userProfileId':_0x5dc2b4[_0x8db2('0x37')]},'raw':!![]})[_0x8db2('0x17')](function(_0x63c561){if(_0x63c561&&_0x63c561[_0x8db2('0x38')]===0x0){return db[_0x8db2('0x39')][_0x8db2('0x33')]({'name':_0x149186['name'],'resourceId':_0x149186['id'],'type':_0x63c561[_0x8db2('0x1d')],'sectionId':_0x63c561['id']},{})[_0x8db2('0x17')](function(){return _0x2c0507;});}else{return _0x2c0507;}})['catch'](function(_0x49a7ae){logger[_0x8db2('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a7ae);throw _0x49a7ae;});}return _0x2c0507;})[_0x8db2('0x17')](respondWithResult(_0x2c8bc9,0xc9))[_0x8db2('0x3a')](handleError(_0x2c8bc9,null));};exports[_0x8db2('0x16')]=function(_0x307783,_0xb4fe2c){if(_0x307783[_0x8db2('0x3b')]['id']){delete _0x307783[_0x8db2('0x3b')]['id'];}return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x307783[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0xb4fe2c,null))[_0x8db2('0x17')](saveUpdates(_0x307783['body'],null))[_0x8db2('0x17')](respondWithResult(_0xb4fe2c,null))[_0x8db2('0x3a')](handleError(_0xb4fe2c,null));};exports[_0x8db2('0x1a')]=function(_0x2c47cc,_0x5427af){return db[_0x8db2('0x1f')]['find']({'where':{'id':_0x2c47cc[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5427af,null))[_0x8db2('0x17')](removeEntity(_0x5427af,null))['catch'](handleError(_0x5427af,null));};exports['describe']=function(_0x1ec3d0,_0x47c556){return db[_0x8db2('0x1f')][_0x8db2('0x3d')]()[_0x8db2('0x17')](respondWithResult(_0x47c556,null))[_0x8db2('0x3a')](handleError(_0x47c556,null));};exports[_0x8db2('0x3e')]=function(_0x40c6e6,_0x4355e2){var _0xab6bdd={'raw':!![],'where':{}},_0x4291e3={},_0x12a1ef;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x40c6e6['params']['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4355e2,null))[_0x8db2('0x17')](function(_0xdbba64){if(_0xdbba64){_0x12a1ef=_0xdbba64[_0x8db2('0x18')]({'plain':!![]});_0x4291e3['model']=_['keys'](db[_0x8db2('0x40')][_0x8db2('0x41')]);_0x4291e3[_0x8db2('0x28')]=_['keys'](_0x40c6e6['query']);_0x4291e3['filters']=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],_0x4291e3[_0x8db2('0x28')]);_0xab6bdd[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x40c6e6['query']['fields']));_0xab6bdd[_0x8db2('0x2c')]=_0xab6bdd[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0xab6bdd[_0x8db2('0x2c')]:_0x4291e3[_0x8db2('0x2b')];if(!_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x42')](_0x8db2('0x43'))){_0xab6bdd[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x14')]);_0xab6bdd[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x40c6e6[_0x8db2('0x28')]['offset']);}_0xab6bdd[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x40c6e6['query'][_0x8db2('0x45')]);_0xab6bdd[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x40c6e6[_0x8db2('0x28')],_0x4291e3[_0x8db2('0x29')]));_0xab6bdd[_0x8db2('0x23')][_0x8db2('0x46')]=_0xdbba64['id'];if(_0x40c6e6[_0x8db2('0x28')]['filter']){_0xab6bdd[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0xab6bdd[_0x8db2('0x23')],{'$or':_['map'](_0xab6bdd[_0x8db2('0x2c')],function(_0x18cc13){var _0x33dddd={};_0x33dddd[_0x18cc13]={'$like':'%'+_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x33dddd;})});}_0xab6bdd=_[_0x8db2('0x30')]({},_0xab6bdd,_0x40c6e6[_0x8db2('0x31')]);return db['UserSmsQueue'][_0x8db2('0x48')](_0xab6bdd);}})[_0x8db2('0x17')](function(_0x4d3c19){if(_0x4d3c19){return db[_0x8db2('0x49')][_0x8db2('0x4a')]({'where':{'id':_['map'](_0x4d3c19,_0x8db2('0x4b')),'role':_0x8db2('0x4c')},'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x4d'),_0x8db2('0x4e'),_0x8db2('0x4f')]});}})[_0x8db2('0x17')](function(_0x33a600){if(_0x33a600){return{'count':_0x33a600[_0x8db2('0x13')],'rows':_[_0x8db2('0x1e')](_0x33a600[_0x8db2('0x25')],function(_0x447a47){return{'membername':_0x447a47[_0x8db2('0x1d')],'UserId':_0x447a47['id'],'queue_name':_0x12a1ef[_0x8db2('0x1d')],'SmsQueueId':_0x12a1ef['id'],'interface':util[_0x8db2('0x50')](_0x8db2('0x51'),'SIP',_0x447a47[_0x8db2('0x1d')]),'penalty':0x0,'paused':_0x447a47[_0x8db2('0x4d')],'createdAt':_0x447a47[_0x8db2('0x4f')],'updatedAt':_0x447a47[_0x8db2('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8db2('0x17')](respondWithFilteredResult(_0x4355e2,_0xab6bdd))['catch'](handleError(_0x4355e2,null));};exports[_0x8db2('0x52')]=function(_0x2c3087,_0x3ab670){var _0x1e1c0d={};var _0x2ad70f={};var _0x348da8;var _0x17341d;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x2c3087[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x3ab670,null))[_0x8db2('0x17')](function(_0x170a72){if(_0x170a72){_0x348da8=_0x170a72;_0x2ad70f[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x53')][_0x8db2('0x41')]);_0x2ad70f[_0x8db2('0x28')]=_['keys'](_0x2c3087[_0x8db2('0x28')]);_0x2ad70f['filters']=_[_0x8db2('0x2a')](_0x2ad70f['model'],_0x2ad70f[_0x8db2('0x28')]);_0x1e1c0d[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x2ad70f[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x2c3087['query']['fields']));_0x1e1c0d[_0x8db2('0x2c')]=_0x1e1c0d[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0x1e1c0d[_0x8db2('0x2c')]:_0x2ad70f[_0x8db2('0x2b')];_0x1e1c0d[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2c3087[_0x8db2('0x28')]['sort']);_0x1e1c0d[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_[_0x8db2('0x54')](_0x2c3087[_0x8db2('0x28')],_0x2ad70f[_0x8db2('0x29')]));if(_0x2c3087[_0x8db2('0x28')][_0x8db2('0x47')]){_0x1e1c0d[_0x8db2('0x23')]=_['merge'](_0x1e1c0d['where'],{'$or':_[_0x8db2('0x1e')](_0x1e1c0d[_0x8db2('0x2c')],function(_0x1d2dfc){var _0x27f4cd={};_0x27f4cd[_0x1d2dfc]={'$like':'%'+_0x2c3087[_0x8db2('0x28')]['filter']+'%'};return _0x27f4cd;})});}_0x1e1c0d=_['merge']({},_0x1e1c0d,_0x2c3087[_0x8db2('0x31')]);return _0x348da8[_0x8db2('0x52')](_0x1e1c0d);}})['then'](function(_0xa698bd){if(_0xa698bd){_0x17341d=_0xa698bd[_0x8db2('0x2e')];if(!_0x2c3087[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x1e1c0d[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2c3087['query'][_0x8db2('0x14')]);_0x1e1c0d[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2c3087[_0x8db2('0x28')][_0x8db2('0x11')]);}return _0x348da8['getTeams'](_0x1e1c0d);}})[_0x8db2('0x17')](function(_0x3023fe){if(_0x3023fe){return _0x3023fe?{'count':_0x17341d,'rows':_0x3023fe}:null;}})[_0x8db2('0x17')](respondWithResult(_0x3ab670,null))['catch'](handleError(_0x3ab670,null));};exports['addTeams']=function(_0x2cdf3c,_0xbe05ca){var _0x487dcb=_0x2cdf3c[_0x8db2('0x3b')][_0x8db2('0x55')];return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x487dcb},'attributes':['id'],'include':[{'model':db[_0x8db2('0x49')],'as':_0x8db2('0x56'),'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x57'),_0x8db2('0x58'),_0x8db2('0x59')],'raw':!![]}]})[_0x8db2('0x17')](function(_0x3e1478){if(_0x3e1478){var _0x24a52d=_['flatMap'](_0x3e1478,function(_0x2ba42d){var _0x4f29f1=_0x2ba42d[_0x8db2('0x18')]({'plain':!![]});return _0x4f29f1[_0x8db2('0x56')];});return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x2cdf3c[_0x8db2('0x3c')]['id']}})['then'](function(_0x2159c4){return db[_0x8db2('0x5a')][_0x8db2('0x5b')](function(_0x25a3ab){return _0x2159c4[_0x8db2('0x5c')](_0x487dcb,{'transaction':_0x25a3ab})[_0x8db2('0x17')](function(){return BPromise[_0x8db2('0x5d')](_0x24a52d,function(_0x3ac0fa){return db[_0x8db2('0x40')]['findOrCreate']({'where':{'UserId':_0x3ac0fa['id'],'SmsQueueId':_0x2cdf3c['params']['id']},'transaction':_0x25a3ab});});})[_0x8db2('0x17')](function(){_0x24a52d['forEach'](function(_0xf8afa5){socket[_0x8db2('0x5e')](_0x8db2('0x5f'),{'UserId':_0xf8afa5['id'],'SmsQueueId':_0x2159c4['id']});});});});});}})['then'](respondWithStatusCode(_0xbe05ca,null))[_0x8db2('0x3a')](handleError(_0xbe05ca,null));};exports[_0x8db2('0x60')]=function(_0x3e37e7,_0x591c5d){return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8db2('0x56'),'attributes':['id'],'raw':!![]}]})[_0x8db2('0x17')](handleEntityNotFound(_0x591c5d,null))[_0x8db2('0x17')](function(_0x1edb1a){var _0xcf1c42=_[_0x8db2('0x1e')](_0x1edb1a,'id');var _0x1aadfb=[];var _0x3682bf=[];var _0x358f48=squel[_0x8db2('0x61')]();_0x358f48[_0x8db2('0x62')]('tq.TeamId')[_0x8db2('0x63')](_0x8db2('0x64'),'tq')[_0x8db2('0x65')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8db2('0x66'),_0x3e37e7[_0x8db2('0x3c')]['id']);for(var _0x3191c8=0x0;_0x3191c8<_0x1edb1a[_0x8db2('0x2e')];_0x3191c8+=0x1){let _0x2ad024=_0x1edb1a[_0x3191c8];for(var _0x313918=0x0;_0x313918<_0x2ad024[_0x8db2('0x56')][_0x8db2('0x2e')];_0x313918+=0x1){let _0x3b1929=_0x2ad024[_0x8db2('0x56')][_0x313918];var _0x46eb80=_0x358f48['clone']();_0x46eb80[_0x8db2('0x23')](_0x8db2('0x67'),_0x3b1929['id']);_0x3682bf[_0x8db2('0x68')](db[_0x8db2('0x5a')]['query'](_0x46eb80['toString'](),{'type':db[_0x8db2('0x5a')][_0x8db2('0x69')]['SELECT']})[_0x8db2('0x17')](function(_0x121f31){if(_0x121f31[_0x8db2('0x2e')]===0x1){return _0x3b1929['id'];}else{var _0x5f2ece=_['every'](_['map'](_0x121f31,_0x8db2('0x6a')),function(_0x18b4a6){return _[_0x8db2('0x6b')](_0xcf1c42,_0x18b4a6);});if(_0x5f2ece){return _0x3b1929['id'];}}}));}}return BPromise[_0x8db2('0x6c')](_0x3682bf)[_0x8db2('0x17')](function(_0x4e8aac){_0x1aadfb=_(_0x1aadfb)[_0x8db2('0x6d')](_0x4e8aac)['compact']()[_0x8db2('0x6e')]();return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x3e37e7[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](function(_0x5d5380){return db['sequelize'][_0x8db2('0x5b')](function(_0x51afcf){return _0x5d5380[_0x8db2('0x60')](_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')],{'transaction':_0x51afcf})[_0x8db2('0x17')](function(){if(!_[_0x8db2('0x6f')](_0x1aadfb)){return _0x5d5380[_0x8db2('0x70')](_0x1aadfb,{'transaction':_0x51afcf});}})['then'](function(){_0x1aadfb[_0x8db2('0x71')](function(_0x222ea2){socket[_0x8db2('0x5e')]('userSmsQueue:remove',{'UserId':_0x222ea2,'SmsQueueId':_0x5d5380['id']});});});});});});})[_0x8db2('0x17')](respondWithStatusCode(_0x591c5d,null))[_0x8db2('0x3a')](handleError(_0x591c5d,null));};exports['addAgents']=function(_0x2d7abf,_0x7cb97d){return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x2d7abf[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x7cb97d,null))[_0x8db2('0x17')](function(_0x19e25b){if(_0x19e25b){return _0x19e25b[_0x8db2('0x72')](_0x2d7abf['body'][_0x8db2('0x55')],_[_0x8db2('0x73')](_0x2d7abf[_0x8db2('0x3b')],[_0x8db2('0x55'),'id'])||{})[_0x8db2('0x74')](function(_0x345ff9){for(var _0x16d1c5=0x0;_0x16d1c5<_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x8db2('0x2e')];_0x16d1c5+=0x1){socket['emit'](_0x8db2('0x5f'),{'UserId':Number(_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x16d1c5]),'SmsQueueId':Number(_0x2d7abf[_0x8db2('0x3c')]['id'])});}return _0x345ff9;});}})['then'](respondWithResult(_0x7cb97d,null))[_0x8db2('0x3a')](handleError(_0x7cb97d,null));};exports[_0x8db2('0x70')]=function(_0x46476e,_0x4f653e){return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x46476e[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4f653e,null))[_0x8db2('0x17')](function(_0x4f9ce4){if(_0x4f9ce4){return _0x4f9ce4[_0x8db2('0x70')](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])[_0x8db2('0x17')](function(){if(_['isArray'](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])){for(var _0x3e7b24=0x0;_0x3e7b24<_0x46476e['query']['ids']['length'];_0x3e7b24+=0x1){socket[_0x8db2('0x5e')](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')][_0x3e7b24]),'SmsQueueId':Number(_0x46476e['params']['id'])});}}else{socket['emit'](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')]),'SmsQueueId':Number(_0x46476e[_0x8db2('0x3c')]['id'])});}});}})[_0x8db2('0x17')](respondWithStatusCode(_0x4f653e,null))[_0x8db2('0x3a')](handleError(_0x4f653e,null));};exports['getAgents']=function(_0x2942eb,_0x5f32ce){var _0x432780={};var _0x23457b={};var _0x1ef898;var _0x39f2d3;return db[_0x8db2('0x1f')]['findOne']({'where':{'id':_0x2942eb[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5f32ce,null))['then'](function(_0x28beec){if(_0x28beec){_0x1ef898=_0x28beec;_0x23457b[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x49')]['rawAttributes']);_0x23457b[_0x8db2('0x28')]=_['keys'](_0x2942eb['query']);_0x23457b[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],_0x23457b[_0x8db2('0x28')]);_0x432780[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],qs['fields'](_0x2942eb[_0x8db2('0x28')]['fields']));_0x432780['attributes']=_0x432780[_0x8db2('0x2c')]['length']?_0x432780['attributes']:_0x23457b[_0x8db2('0x2b')];_0x432780[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2942eb['query'][_0x8db2('0x45')]);_0x432780[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x2942eb[_0x8db2('0x28')],_0x23457b[_0x8db2('0x29')]));if(_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]){_0x432780[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0x432780[_0x8db2('0x23')],{'$or':_[_0x8db2('0x1e')](_0x432780['attributes'],function(_0xa7b208){var _0x3cb456={};_0x3cb456[_0xa7b208]={'$like':'%'+_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x3cb456;})});}_0x432780=_[_0x8db2('0x30')]({},_0x432780,_0x2942eb[_0x8db2('0x31')]);return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x3a53e2){if(_0x3a53e2){_0x39f2d3=_0x3a53e2[_0x8db2('0x2e')];if(!_0x2942eb[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x432780[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2942eb['query'][_0x8db2('0x14')]);_0x432780[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2942eb['query']['offset']);}return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x296966){if(_0x296966){return _0x296966?{'count':_0x39f2d3,'rows':_0x296966}:null;}})[_0x8db2('0x17')](respondWithResult(_0x5f32ce,null))[_0x8db2('0x3a')](handleError(_0x5f32ce,null));}; \ No newline at end of file +var _0x0b0e=['userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','union','value','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','update','SmsQueues','destroy','then','error','stack','name','send','SmsQueue','fieldName','type','key','getOptions','include','query','findAll','rows','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','params','nolimit','order','sort','where','SmsQueueId','filter','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','findOne','Team','pick','getTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x591a90,_0x5525b0){_0x591a90=_0x591a90-0x0;var _0x551587=_0x0b0e[_0x591a90];return _0x551587;};'use strict';var BPromise=require(_0xe0b0('0x0'));var util=require('util');var _=require(_0xe0b0('0x1'));var squel=require('squel');var Redis=require(_0xe0b0('0x2'));var qs=require(_0xe0b0('0x3'));var logger=require(_0xe0b0('0x4'))(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var db=require(_0xe0b0('0x7'))['db'];config[_0xe0b0('0x8')]=_[_0xe0b0('0x9')](config[_0xe0b0('0x8')],{'host':_0xe0b0('0xa'),'port':0x18eb});var socket=require(_0xe0b0('0xb'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xe0b0('0xc')](socket);function respondWithStatusCode(_0x435060,_0xc4a085){_0xc4a085=_0xc4a085||0xcc;return function(_0x2ac27e){if(_0x2ac27e){return _0x435060['sendStatus'](_0xc4a085);}return _0x435060[_0xe0b0('0xd')](_0xc4a085)[_0xe0b0('0xe')]();};}function respondWithResult(_0x553d4f,_0x1fef28){_0x1fef28=_0x1fef28||0xc8;return function(_0x2f32b6){if(_0x2f32b6){return _0x553d4f['status'](_0x1fef28)[_0xe0b0('0xf')](_0x2f32b6);}};}function respondWithFilteredResult(_0x2cdad2,_0x39b1c2){return function(_0x585615){if(_0x585615){var _0x3068c0=typeof _0x39b1c2[_0xe0b0('0x10')]===_0xe0b0('0x11')&&typeof _0x39b1c2[_0xe0b0('0x12')]===_0xe0b0('0x11');var _0x4d2bf7=_0x585615[_0xe0b0('0x13')];var _0x154de6=_0x3068c0?0x0:_0x39b1c2[_0xe0b0('0x10')];var _0x24babd=_0x3068c0?_0x585615[_0xe0b0('0x13')]:_0x39b1c2['offset']+_0x39b1c2[_0xe0b0('0x12')];var _0x5adb01;if(_0x24babd>=_0x4d2bf7){_0x24babd=_0x4d2bf7;_0x5adb01=0xc8;}else{_0x5adb01=0xce;}_0x2cdad2[_0xe0b0('0xd')](_0x5adb01);return _0x2cdad2[_0xe0b0('0x14')]('Content-Range',_0x154de6+'-'+_0x24babd+'/'+_0x4d2bf7)[_0xe0b0('0xf')](_0x585615);}return null;};}function saveUpdates(_0x4a4cc0){return function(_0x2d6fb6){if(_0x2d6fb6){return _0x2d6fb6[_0xe0b0('0x15')](_0x4a4cc0)['then'](function(_0x54a3eb){return _0x54a3eb;});}return null;};}function removeEntity(_0x46bb44){return function(_0x50a441){if(_0x50a441){return _0x50a441['destroy']()['then'](function(){var _0x1920ee=_0x50a441['get']({'plain':!![]});var _0x52598b=_0xe0b0('0x16');return db['UserProfileResource'][_0xe0b0('0x17')]({'where':{'type':_0x52598b,'resourceId':_0x1920ee['id']}})['then'](function(){return _0x50a441;});})[_0xe0b0('0x18')](function(){_0x46bb44[_0xe0b0('0xd')](0xcc)[_0xe0b0('0xe')]();});}};}function handleEntityNotFound(_0x310a6d){return function(_0x2cf6a1){if(!_0x2cf6a1){_0x310a6d['sendStatus'](0x194);}return _0x2cf6a1;};}function handleError(_0x4cae54,_0x2fa820){_0x2fa820=_0x2fa820||0x1f4;return function(_0x5512bb){logger[_0xe0b0('0x19')](_0x5512bb[_0xe0b0('0x1a')]);if(_0x5512bb['name']){delete _0x5512bb[_0xe0b0('0x1b')];}_0x4cae54['status'](_0x2fa820)[_0xe0b0('0x1c')](_0x5512bb);};}exports['index']=function(_0x28586d,_0x576352){var _0x3e5c88={};var _0x4de537={'count':0x0,'rows':[]};var _0x4700cc=_['map'](db[_0xe0b0('0x1d')]['rawAttributes'],function(_0x362aba){return{'name':_0x362aba[_0xe0b0('0x1e')],'type':_0x362aba[_0xe0b0('0x1f')][_0xe0b0('0x20')]};});_0x3e5c88=qs[_0xe0b0('0x21')](_0x4700cc,_0x28586d);var _0x10745d={'where':_0x3e5c88['where']};return db[_0xe0b0('0x1d')][_0xe0b0('0x13')](_0x10745d)['then'](function(_0x15e13b){_0x4de537[_0xe0b0('0x13')]=_0x15e13b;_0x3e5c88[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x28586d[_0xe0b0('0x23')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x24')](_0x3e5c88);})['then'](function(_0x1854b8){_0x4de537[_0xe0b0('0x25')]=_0x1854b8;return _0x4de537;})['then'](respondWithFilteredResult(_0x576352,_0x3e5c88))['catch'](handleError(_0x576352,null));};exports[_0xe0b0('0x26')]=function(_0x33e672,_0x422575){var _0x3f81d5={'raw':!![],'where':{'id':_0x33e672['params']['id']}},_0x2ab1b1={};_0x2ab1b1[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db[_0xe0b0('0x1d')][_0xe0b0('0x29')]);_0x2ab1b1[_0xe0b0('0x23')]=_['keys'](_0x33e672[_0xe0b0('0x23')]);_0x2ab1b1[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],_0x2ab1b1[_0xe0b0('0x23')]);_0x3f81d5[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3f81d5[_0xe0b0('0x2c')]=_0x3f81d5[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x3f81d5[_0xe0b0('0x2c')]:_0x2ab1b1['model'];if(_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2f')]){_0x3f81d5[_0xe0b0('0x22')]=[{'all':!![]}];}_0x3f81d5=_[_0xe0b0('0x30')]({},_0x3f81d5,_0x33e672[_0xe0b0('0x31')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x32')](_0x3f81d5)['then'](handleEntityNotFound(_0x422575,null))['then'](respondWithResult(_0x422575,null))['catch'](handleError(_0x422575,null));};exports['create']=function(_0x26137c,_0xc3d967){return db[_0xe0b0('0x1d')]['create'](_0x26137c[_0xe0b0('0x33')],{})[_0xe0b0('0x18')](function(_0x1cd705){var _0x297c64=_0x26137c['user'][_0xe0b0('0x34')]({'plain':!![]});if(!_0x297c64)throw new Error(_0xe0b0('0x35'));if(_0x297c64[_0xe0b0('0x36')]===_0xe0b0('0x37')){var _0x4265e3=_0x1cd705[_0xe0b0('0x34')]({'plain':!![]});var _0x8b745=_0xe0b0('0x16');return db[_0xe0b0('0x38')]['find']({'where':{'name':_0x8b745,'userProfileId':_0x297c64[_0xe0b0('0x39')]},'raw':!![]})['then'](function(_0x34178d){if(_0x34178d&&_0x34178d[_0xe0b0('0x3a')]===0x0){return db[_0xe0b0('0x3b')][_0xe0b0('0x3c')]({'name':_0x4265e3['name'],'resourceId':_0x4265e3['id'],'type':_0x34178d[_0xe0b0('0x1b')],'sectionId':_0x34178d['id']},{})[_0xe0b0('0x18')](function(){return _0x1cd705;});}else{return _0x1cd705;}})[_0xe0b0('0x3d')](function(_0x402a0e){logger[_0xe0b0('0x19')](_0xe0b0('0x3e'),_0x402a0e);throw _0x402a0e;});}return _0x1cd705;})[_0xe0b0('0x18')](respondWithResult(_0xc3d967,0xc9))[_0xe0b0('0x3d')](handleError(_0xc3d967,null));};exports['update']=function(_0x2aad80,_0x309bbf){if(_0x2aad80['body']['id']){delete _0x2aad80['body']['id'];}return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x2aad80['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x309bbf,null))[_0xe0b0('0x18')](saveUpdates(_0x2aad80[_0xe0b0('0x33')],null))[_0xe0b0('0x18')](respondWithResult(_0x309bbf,null))[_0xe0b0('0x3d')](handleError(_0x309bbf,null));};exports['destroy']=function(_0x5d2fa2,_0x51c580){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x5d2fa2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x51c580,null))[_0xe0b0('0x18')](removeEntity(_0x51c580,null))[_0xe0b0('0x3d')](handleError(_0x51c580,null));};exports[_0xe0b0('0x3f')]=function(_0x16ccca,_0x5c6f94){return db['SmsQueue'][_0xe0b0('0x3f')]()[_0xe0b0('0x18')](respondWithResult(_0x5c6f94,null))[_0xe0b0('0x3d')](handleError(_0x5c6f94,null));};exports[_0xe0b0('0x40')]=function(_0x1bf77d,_0x575c7d){var _0x3b1474={'raw':!![],'where':{}},_0x11d4fd={},_0x534340;return db['SmsQueue']['findOne']({'where':{'id':_0x1bf77d[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x575c7d,null))[_0xe0b0('0x18')](function(_0x364877){if(_0x364877){_0x534340=_0x364877['get']({'plain':!![]});_0x11d4fd[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db['UserSmsQueue']['rawAttributes']);_0x11d4fd[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x1bf77d['query']);_0x11d4fd[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x11d4fd['model'],_0x11d4fd['query']);_0x3b1474[_0xe0b0('0x2c')]=_['intersection'](_0x11d4fd[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3b1474[_0xe0b0('0x2c')]=_0x3b1474[_0xe0b0('0x2c')]['length']?_0x3b1474['attributes']:_0x11d4fd[_0xe0b0('0x27')];if(!_0x1bf77d['query']['hasOwnProperty'](_0xe0b0('0x42'))){_0x3b1474[_0xe0b0('0x12')]=qs['limit'](_0x1bf77d['query'][_0xe0b0('0x12')]);_0x3b1474[_0xe0b0('0x10')]=qs[_0xe0b0('0x10')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x10')]);}_0x3b1474[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x1bf77d['query'][_0xe0b0('0x44')]);_0x3b1474['where']=qs[_0xe0b0('0x2a')](_['pick'](_0x1bf77d['query'],_0x11d4fd[_0xe0b0('0x2a')]));_0x3b1474[_0xe0b0('0x45')][_0xe0b0('0x46')]=_0x364877['id'];if(_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x3b1474[_0xe0b0('0x45')]=_[_0xe0b0('0x30')](_0x3b1474[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x3b1474['attributes'],function(_0x253ab0){var _0x57ccc9={};_0x57ccc9[_0x253ab0]={'$like':'%'+_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x57ccc9;})});}_0x3b1474=_[_0xe0b0('0x30')]({},_0x3b1474,_0x1bf77d[_0xe0b0('0x31')]);return db[_0xe0b0('0x49')][_0xe0b0('0x24')](_0x3b1474);}})['then'](function(_0x1a057c){if(_0x1a057c){return db[_0xe0b0('0x4a')][_0xe0b0('0x4b')]({'where':{'id':_[_0xe0b0('0x48')](_0x1a057c,_0xe0b0('0x4c')),'role':_0xe0b0('0x4d')},'attributes':['id',_0xe0b0('0x1b'),_0xe0b0('0x4e'),_0xe0b0('0x4f'),_0xe0b0('0x50')]});}})[_0xe0b0('0x18')](function(_0x18ab99){if(_0x18ab99){return{'count':_0x18ab99[_0xe0b0('0x13')],'rows':_[_0xe0b0('0x48')](_0x18ab99[_0xe0b0('0x25')],function(_0x34c642){return{'membername':_0x34c642[_0xe0b0('0x1b')],'UserId':_0x34c642['id'],'queue_name':_0x534340[_0xe0b0('0x1b')],'SmsQueueId':_0x534340['id'],'interface':util['format'](_0xe0b0('0x51'),_0xe0b0('0x52'),_0x34c642[_0xe0b0('0x1b')]),'penalty':0x0,'paused':_0x34c642[_0xe0b0('0x4e')],'createdAt':_0x34c642[_0xe0b0('0x50')],'updatedAt':_0x34c642[_0xe0b0('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe0b0('0x18')](respondWithFilteredResult(_0x575c7d,_0x3b1474))['catch'](handleError(_0x575c7d,null));};exports['getTeams']=function(_0x139014,_0x2a0415){var _0x157556={};var _0x47ecc1={};var _0x117d20;var _0x13fb4b;return db[_0xe0b0('0x1d')][_0xe0b0('0x53')]({'where':{'id':_0x139014[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a0415,null))[_0xe0b0('0x18')](function(_0x242120){if(_0x242120){_0x117d20=_0x242120;_0x47ecc1[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x54')][_0xe0b0('0x29')]);_0x47ecc1['query']=_[_0xe0b0('0x28')](_0x139014['query']);_0x47ecc1['filters']=_[_0xe0b0('0x2b')](_0x47ecc1['model'],_0x47ecc1['query']);_0x157556[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x47ecc1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x139014['query'][_0xe0b0('0x2d')]));_0x157556[_0xe0b0('0x2c')]=_0x157556[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x157556[_0xe0b0('0x2c')]:_0x47ecc1[_0xe0b0('0x27')];_0x157556[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x139014['query']['sort']);_0x157556[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x139014['query'],_0x47ecc1['filters']));if(_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x157556['where']=_['merge'](_0x157556[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x157556[_0xe0b0('0x2c')],function(_0x29175a){var _0x3b263f={};_0x3b263f[_0x29175a]={'$like':'%'+_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3b263f;})});}_0x157556=_[_0xe0b0('0x30')]({},_0x157556,_0x139014['options']);return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0x1673bc){if(_0x1673bc){_0x13fb4b=_0x1673bc['length'];if(!_0x139014['query']['hasOwnProperty']('nolimit')){_0x157556['limit']=qs['limit'](_0x139014[_0xe0b0('0x23')]['limit']);_0x157556['offset']=qs[_0xe0b0('0x10')](_0x139014[_0xe0b0('0x23')][_0xe0b0('0x10')]);}return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0xd0629e){if(_0xd0629e){return _0xd0629e?{'count':_0x13fb4b,'rows':_0xd0629e}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x2a0415,null))[_0xe0b0('0x3d')](handleError(_0x2a0415,null));};exports['addTeams']=function(_0x3097fb,_0x5da8fd){var _0x86e90=_0x3097fb[_0xe0b0('0x33')][_0xe0b0('0x57')];return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x86e90},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x58'),'attributes':['id','name',_0xe0b0('0x59'),_0xe0b0('0x5a'),_0xe0b0('0x5b')],'raw':!![]}]})[_0xe0b0('0x18')](function(_0x4a78f8){if(_0x4a78f8){var _0x311f79=_[_0xe0b0('0x5c')](_0x4a78f8,function(_0x49deef){var _0x4cf60a=_0x49deef[_0xe0b0('0x34')]({'plain':!![]});return _0x4cf60a[_0xe0b0('0x58')];});return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x3097fb[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](function(_0x34f4ff){return db[_0xe0b0('0x5d')][_0xe0b0('0x5e')](function(_0x24571b){return _0x34f4ff['addTeams'](_0x86e90,{'transaction':_0x24571b})['then'](function(){return BPromise[_0xe0b0('0x5f')](_0x311f79,function(_0x4880d5){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4880d5['id'],'SmsQueueId':_0x3097fb['params']['id']},'transaction':_0x24571b});});})[_0xe0b0('0x18')](function(){_0x311f79['forEach'](function(_0x654d2b){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':_0x654d2b['id'],'SmsQueueId':_0x34f4ff['id']});});});});});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x5da8fd,null))['catch'](handleError(_0x5da8fd,null));};exports[_0xe0b0('0x62')]=function(_0x948708,_0x5a0817){return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')]},'attributes':['id'],'include':[{'model':db[_0xe0b0('0x4a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5a0817,null))['then'](function(_0x545694){var _0x5c258b=_[_0xe0b0('0x48')](_0x545694,'id');var _0x567e1a=[];var _0x3c09af=[];var _0x5f4aaf=squel[_0xe0b0('0x63')]();_0x5f4aaf[_0xe0b0('0x64')](_0xe0b0('0x65'))[_0xe0b0('0x66')](_0xe0b0('0x67'),'tq')[_0xe0b0('0x68')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('SmsQueueId\x20=\x20?',_0x948708[_0xe0b0('0x41')]['id']);for(var _0x261381=0x0;_0x261381<_0x545694[_0xe0b0('0x2e')];_0x261381+=0x1){let _0x4377f7=_0x545694[_0x261381];for(var _0x2c1149=0x0;_0x2c1149<_0x4377f7['Agents'][_0xe0b0('0x2e')];_0x2c1149+=0x1){let _0x39a07b=_0x4377f7[_0xe0b0('0x58')][_0x2c1149];var _0xc6090e=_0x5f4aaf[_0xe0b0('0x69')]();_0xc6090e[_0xe0b0('0x45')](_0xe0b0('0x6a'),_0x39a07b['id']);_0x3c09af[_0xe0b0('0x6b')](db[_0xe0b0('0x5d')]['query'](_0xc6090e['toString'](),{'type':db[_0xe0b0('0x5d')][_0xe0b0('0x6c')]['SELECT']})[_0xe0b0('0x18')](function(_0x4593f1){if(_0x4593f1[_0xe0b0('0x2e')]===0x1){return _0x39a07b['id'];}else{var _0x3fcffd=_[_0xe0b0('0x6d')](_[_0xe0b0('0x48')](_0x4593f1,_0xe0b0('0x6e')),function(_0xc8eba3){return _['includes'](_0x5c258b,_0xc8eba3);});if(_0x3fcffd){return _0x39a07b['id'];}}}));}}return BPromise['all'](_0x3c09af)['then'](function(_0xc19743){_0x567e1a=_(_0x567e1a)[_0xe0b0('0x6f')](_0xc19743)['compact']()[_0xe0b0('0x70')]();return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x948708[_0xe0b0('0x41')]['id']}})['then'](function(_0x56c4b9){return db['sequelize'][_0xe0b0('0x5e')](function(_0x266835){return _0x56c4b9['removeTeams'](_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')],{'transaction':_0x266835})['then'](function(){if(!_['isEmpty'](_0x567e1a)){return _0x56c4b9[_0xe0b0('0x71')](_0x567e1a,{'transaction':_0x266835});}})['then'](function(){_0x567e1a[_0xe0b0('0x72')](function(_0x5f06c0){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':_0x5f06c0,'SmsQueueId':_0x56c4b9['id']});});});});});});})[_0xe0b0('0x18')](respondWithStatusCode(_0x5a0817,null))[_0xe0b0('0x3d')](handleError(_0x5a0817,null));};exports[_0xe0b0('0x74')]=function(_0x1ec7c2,_0x434dfa){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x1ec7c2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x434dfa,null))[_0xe0b0('0x18')](function(_0x2b40eb){if(_0x2b40eb){return _0x2b40eb['addAgents'](_0x1ec7c2[_0xe0b0('0x33')]['ids'],_[_0xe0b0('0x75')](_0x1ec7c2[_0xe0b0('0x33')],['ids','id'])||{})[_0xe0b0('0x76')](function(_0x4e4b45){for(var _0x528932=0x0;_0x528932<_0x1ec7c2[_0xe0b0('0x33')]['ids']['length'];_0x528932+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':Number(_0x1ec7c2[_0xe0b0('0x33')][_0xe0b0('0x57')][_0x528932]),'SmsQueueId':Number(_0x1ec7c2[_0xe0b0('0x41')]['id'])});}return _0x4e4b45;});}})[_0xe0b0('0x18')](respondWithResult(_0x434dfa,null))['catch'](handleError(_0x434dfa,null));};exports[_0xe0b0('0x71')]=function(_0x4609d5,_0x421b3b){return db['SmsQueue'][_0xe0b0('0x32')]({'where':{'id':_0x4609d5[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x421b3b,null))['then'](function(_0x33f89a){if(_0x33f89a){return _0x33f89a['removeAgents'](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])[_0xe0b0('0x18')](function(){if(_[_0xe0b0('0x77')](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])){for(var _0x3d70d7=0x0;_0x3d70d7<_0x4609d5['query'][_0xe0b0('0x57')][_0xe0b0('0x2e')];_0x3d70d7+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')]['ids'][_0x3d70d7]),'SmsQueueId':Number(_0x4609d5['params']['id'])});}}else{socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')]),'SmsQueueId':Number(_0x4609d5[_0xe0b0('0x41')]['id'])});}});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x421b3b,null))[_0xe0b0('0x3d')](handleError(_0x421b3b,null));};exports[_0xe0b0('0x78')]=function(_0x932e,_0x1b3f4d){var _0x4fe048={};var _0xac45e6={};var _0x401c4b;var _0x3e18a3;return db[_0xe0b0('0x1d')]['findOne']({'where':{'id':_0x932e[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x1b3f4d,null))[_0xe0b0('0x18')](function(_0x116c16){if(_0x116c16){_0x401c4b=_0x116c16;_0xac45e6[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x4a')]['rawAttributes']);_0xac45e6[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x932e[_0xe0b0('0x23')]);_0xac45e6[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0xac45e6['model'],_0xac45e6['query']);_0x4fe048[_0xe0b0('0x2c')]=_['intersection'](_0xac45e6[_0xe0b0('0x27')],qs['fields'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x4fe048[_0xe0b0('0x2c')]=_0x4fe048[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x4fe048[_0xe0b0('0x2c')]:_0xac45e6[_0xe0b0('0x27')];_0x4fe048['order']=qs['sort'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x44')]);_0x4fe048[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x932e[_0xe0b0('0x23')],_0xac45e6[_0xe0b0('0x2a')]));if(_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x4fe048[_0xe0b0('0x45')]=_['merge'](_0x4fe048['where'],{'$or':_[_0xe0b0('0x48')](_0x4fe048[_0xe0b0('0x2c')],function(_0x187465){var _0x3f9e6b={};_0x3f9e6b[_0x187465]={'$like':'%'+_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3f9e6b;})});}_0x4fe048=_[_0xe0b0('0x30')]({},_0x4fe048,_0x932e['options']);return _0x401c4b['getAgents'](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x1ea4d5){if(_0x1ea4d5){_0x3e18a3=_0x1ea4d5[_0xe0b0('0x2e')];if(!_0x932e[_0xe0b0('0x23')][_0xe0b0('0x79')](_0xe0b0('0x42'))){_0x4fe048[_0xe0b0('0x12')]=qs[_0xe0b0('0x12')](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x12')]);_0x4fe048['offset']=qs[_0xe0b0('0x10')](_0x932e[_0xe0b0('0x23')]['offset']);}return _0x401c4b[_0xe0b0('0x78')](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x3615f9){if(_0x3615f9){return _0x3615f9?{'count':_0x3e18a3,'rows':_0x3615f9}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x1b3f4d,null))[_0xe0b0('0x3d')](handleError(_0x1b3f4d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 9fe3e94..52611b8 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 _0x32ce=['events','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1acdd9,_0x4be278){var _0x2058c4=function(_0x1bc472){while(--_0x1bc472){_0x1acdd9['push'](_0x1acdd9['shift']());}};_0x2058c4(++_0x4be278);}(_0x32ce,0x104));var _0xe32c=function(_0x4cceef,_0x1313a3){_0x4cceef=_0x4cceef-0x0;var _0x54d224=_0x32ce[_0x4cceef];return _0x54d224;};'use strict';var EventEmitter=require(_0xe32c('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xe32c('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xe32c('0x2')](0x0);var events={'afterCreate':_0xe32c('0x3'),'afterUpdate':_0xe32c('0x4'),'afterDestroy':_0xe32c('0x5')};function emitEvent(_0x4288ac){return function(_0x16ab73,_0x54b575,_0x318d49){SmsQueueEvents[_0xe32c('0x6')](_0x4288ac+':'+_0x16ab73['id'],_0x16ab73);SmsQueueEvents[_0xe32c('0x6')](_0x4288ac,_0x16ab73);_0x318d49(null);};}for(var e in events){if(events[_0xe32c('0x7')](e)){var event=events[e];SmsQueue[_0xe32c('0x8')](e,emitEvent(event));}}module[_0xe32c('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0x93e1=['SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x93e1,0x95));var _0x193e=function(_0x4a68b4,_0x321868){_0x4a68b4=_0x4a68b4-0x0;var _0x195b4e=_0x93e1[_0x4a68b4];return _0x195b4e;};'use strict';var EventEmitter=require(_0x193e('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x193e('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x193e('0x2')](0x0);var events={'afterCreate':_0x193e('0x3'),'afterUpdate':_0x193e('0x4'),'afterDestroy':_0x193e('0x5')};function emitEvent(_0x50b5fe){return function(_0x41b3b9,_0x16929f,_0xdbed0e){SmsQueueEvents[_0x193e('0x6')](_0x50b5fe+':'+_0x41b3b9['id'],_0x41b3b9);SmsQueueEvents[_0x193e('0x6')](_0x50b5fe,_0x41b3b9);_0xdbed0e(null);};}for(var e in events){if(events[_0x193e('0x7')](e)){var event=events[e];SmsQueue[_0x193e('0x8')](e,emitEvent(event));}}module[_0x193e('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 059b283..bd5fce0 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 _0x9cd7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','sms_queues','lodash','util','../../config/logger','api'];(function(_0x1c7de4,_0x5629c8){var _0x49e3d1=function(_0x31db26){while(--_0x31db26){_0x1c7de4['push'](_0x1c7de4['shift']());}};_0x49e3d1(++_0x5629c8);}(_0x9cd7,0x168));var _0x79cd=function(_0x3dfa3e,_0x293558){_0x3dfa3e=_0x3dfa3e-0x0;var _0x3ff9ed=_0x9cd7[_0x3dfa3e];return _0x3ff9ed;};'use strict';var _=require(_0x79cd('0x0'));var util=require(_0x79cd('0x1'));var logger=require(_0x79cd('0x2'))(_0x79cd('0x3'));var moment=require(_0x79cd('0x4'));var BPromise=require(_0x79cd('0x5'));var rp=require(_0x79cd('0x6'));var fs=require('fs');var path=require(_0x79cd('0x7'));var rimraf=require(_0x79cd('0x8'));var config=require(_0x79cd('0x9'));var attributes=require(_0x79cd('0xa'));module[_0x79cd('0xb')]=function(_0x1f1d22,_0x61302a){return _0x1f1d22['define']('SmsQueue',attributes,{'tableName':_0x79cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47d4=['SmsQueue','sms_queues','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','define'];(function(_0x21221e,_0x3d5027){var _0x4d38e7=function(_0x2d7691){while(--_0x2d7691){_0x21221e['push'](_0x21221e['shift']());}};_0x4d38e7(++_0x3d5027);}(_0x47d4,0x152));var _0x447d=function(_0x52456d,_0x3e5e0e){_0x52456d=_0x52456d-0x0;var _0x4431f0=_0x47d4[_0x52456d];return _0x4431f0;};'use strict';var _=require(_0x447d('0x0'));var util=require(_0x447d('0x1'));var logger=require('../../config/logger')(_0x447d('0x2'));var moment=require('moment');var BPromise=require(_0x447d('0x3'));var rp=require(_0x447d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x447d('0x5'));var config=require(_0x447d('0x6'));var attributes=require(_0x447d('0x7'));module[_0x447d('0x8')]=function(_0x37a79d,_0x487fc4){return _0x37a79d[_0x447d('0x9')](_0x447d('0xa'),attributes,{'tableName':_0x447d('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 920a06a..0d4d814 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 _0x14fb=['SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x195024,_0x1401f2){var _0x352ef7=function(_0x36bc16){while(--_0x36bc16){_0x195024['push'](_0x195024['shift']());}};_0x352ef7(++_0x1401f2);}(_0x14fb,0x91));var _0xb14f=function(_0xd7d31d,_0xdc9735){_0xd7d31d=_0xd7d31d-0x0;var _0x1a54f=_0x14fb[_0xd7d31d];return _0x1a54f;};'use strict';var _=require(_0xb14f('0x0'));var util=require(_0xb14f('0x1'));var moment=require(_0xb14f('0x2'));var BPromise=require(_0xb14f('0x3'));var rs=require(_0xb14f('0x4'));var fs=require('fs');var Redis=require(_0xb14f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb14f('0x6'));var logger=require(_0xb14f('0x7'))(_0xb14f('0x8'));var config=require(_0xb14f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb14f('0xa')][_0xb14f('0xb')]({'port':0x232a});config[_0xb14f('0xc')]=_[_0xb14f('0xd')](config[_0xb14f('0xc')],{'host':_0xb14f('0xe'),'port':0x18eb});var socket=require(_0xb14f('0xf'))(new Redis(config[_0xb14f('0xc')]));require('./smsQueue.socket')[_0xb14f('0x10')](socket);function respondWithRpcPromise(_0xfc598e,_0x579387,_0x2cb4f9){return new BPromise(function(_0x238073,_0x533367){return client[_0xb14f('0x11')](_0xfc598e,_0x2cb4f9)[_0xb14f('0x12')](function(_0x3908d4){logger[_0xb14f('0x13')](_0xb14f('0x14'),_0x579387,_0xb14f('0x15'));logger[_0xb14f('0x16')](_0xb14f('0x17'),_0x579387,_0xb14f('0x15'),JSON[_0xb14f('0x18')](_0x3908d4));if(_0x3908d4['error']){if(_0x3908d4[_0xb14f('0x19')][_0xb14f('0x1a')]===0x1f4){logger[_0xb14f('0x19')](_0xb14f('0x14'),_0x579387,_0x3908d4['error']['message']);return _0x533367(_0x3908d4['error'][_0xb14f('0x1b')]);}logger[_0xb14f('0x19')]('SmsQueue,\x20%s,\x20%s',_0x579387,_0x3908d4['error'][_0xb14f('0x1b')]);return _0x238073(_0x3908d4[_0xb14f('0x19')][_0xb14f('0x1b')]);}else{logger['info'](_0xb14f('0x14'),_0x579387,_0xb14f('0x15'));_0x238073(_0x3908d4[_0xb14f('0x1c')]['message']);}})[_0xb14f('0x1d')](function(_0x2a1f8c){logger[_0xb14f('0x19')](_0xb14f('0x14'),_0x579387,_0x2a1f8c);_0x533367(_0x2a1f8c);});});}exports[_0xb14f('0x1e')]=function(_0x5e56e8){var _0x13f436=this;return new Promise(function(_0x1e60d4,_0x451ea3){return db[_0xb14f('0x1f')][_0xb14f('0x20')]({'raw':_0x5e56e8[_0xb14f('0x21')]?_0x5e56e8[_0xb14f('0x21')][_0xb14f('0x22')]===undefined?!![]:![]:!![],'where':_0x5e56e8['options']?_0x5e56e8[_0xb14f('0x21')][_0xb14f('0x23')]||null:null,'attributes':_0x5e56e8[_0xb14f('0x21')]?_0x5e56e8[_0xb14f('0x21')][_0xb14f('0x24')]||null:null,'limit':_0x5e56e8[_0xb14f('0x21')]?_0x5e56e8[_0xb14f('0x21')][_0xb14f('0x25')]||null:null,'include':_0x5e56e8['options']?_0x5e56e8[_0xb14f('0x21')][_0xb14f('0x26')]?_[_0xb14f('0x27')](_0x5e56e8[_0xb14f('0x21')][_0xb14f('0x26')],function(_0x51f1ea){return{'model':db[_0x51f1ea[_0xb14f('0x28')]],'as':_0x51f1ea['as'],'attributes':_0x51f1ea[_0xb14f('0x24')],'include':_0x51f1ea[_0xb14f('0x26')]?_[_0xb14f('0x27')](_0x51f1ea[_0xb14f('0x26')],function(_0x277022){return{'model':db[_0x277022[_0xb14f('0x28')]],'as':_0x277022['as'],'attributes':_0x277022['attributes'],'include':_0x277022[_0xb14f('0x26')]?_['map'](_0x277022[_0xb14f('0x26')],function(_0x2b7bbf){return{'model':db[_0x2b7bbf[_0xb14f('0x28')]],'as':_0x2b7bbf['as'],'attributes':_0x2b7bbf[_0xb14f('0x24')]};}):[]};}):[]};}):[]:[]})[_0xb14f('0x12')](function(_0x51b2ba){logger[_0xb14f('0x13')](_0xb14f('0x1e'),_0x5e56e8);logger[_0xb14f('0x16')](_0xb14f('0x1e'),_0x5e56e8,JSON[_0xb14f('0x18')](_0x51b2ba));_0x1e60d4(_0x51b2ba);})[_0xb14f('0x1d')](function(_0x52a18a){logger['error'](_0xb14f('0x1e'),_0x52a18a[_0xb14f('0x1b')],_0x5e56e8);_0x451ea3(_0x13f436[_0xb14f('0x19')](0x1f4,_0x52a18a[_0xb14f('0x1b')]));});});};exports['ShowSmsQueue']=function(_0x53dec1){var _0x6b5637=this;return new Promise(function(_0x457cbf,_0x56c5e8){return db['SmsQueue']['find']({'raw':_0x53dec1[_0xb14f('0x21')]?_0x53dec1[_0xb14f('0x21')][_0xb14f('0x22')]===undefined?!![]:![]:!![],'where':_0x53dec1['options']?_0x53dec1[_0xb14f('0x21')][_0xb14f('0x23')]||null:null,'attributes':_0x53dec1[_0xb14f('0x21')]?_0x53dec1['options']['attributes']||null:null,'include':_0x53dec1[_0xb14f('0x21')]?_0x53dec1['options'][_0xb14f('0x26')]?_['map'](_0x53dec1['options'][_0xb14f('0x26')],function(_0x15d9ee){return{'model':db[_0x15d9ee[_0xb14f('0x28')]],'as':_0x15d9ee['as'],'attributes':_0x15d9ee[_0xb14f('0x24')],'include':_0x15d9ee[_0xb14f('0x26')]?_[_0xb14f('0x27')](_0x15d9ee[_0xb14f('0x26')],function(_0x8ead01){return{'model':db[_0x8ead01[_0xb14f('0x28')]],'as':_0x8ead01['as'],'attributes':_0x8ead01['attributes'],'include':_0x8ead01[_0xb14f('0x26')]?_[_0xb14f('0x27')](_0x8ead01['include'],function(_0x5e847a){return{'model':db[_0x5e847a['model']],'as':_0x5e847a['as'],'attributes':_0x5e847a[_0xb14f('0x24')]};}):[]};}):[]};}):[]:[]})[_0xb14f('0x12')](function(_0xebe515){logger['info']('ShowSmsQueue',_0x53dec1);logger[_0xb14f('0x16')](_0xb14f('0x29'),_0x53dec1,JSON['stringify'](_0xebe515));_0x457cbf(_0xebe515);})[_0xb14f('0x1d')](function(_0x598c39){logger[_0xb14f('0x19')](_0xb14f('0x29'),_0x598c39[_0xb14f('0x1b')],_0x53dec1);_0x56c5e8(_0x6b5637[_0xb14f('0x19')](0x1f4,_0x598c39['message']));});});}; \ No newline at end of file +var _0x0d2d=['attributes','then','catch','ShowSmsQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','include','map','model'];(function(_0x557f34,_0x58bae6){var _0x314b0b=function(_0x90ac23){while(--_0x90ac23){_0x557f34['push'](_0x557f34['shift']());}};_0x314b0b(++_0x58bae6);}(_0x0d2d,0x79));var _0xd0d2=function(_0x146289,_0xb04ab){_0x146289=_0x146289-0x0;var _0x165ee1=_0x0d2d[_0x146289];return _0x165ee1;};'use strict';var _=require(_0xd0d2('0x0'));var util=require(_0xd0d2('0x1'));var moment=require('moment');var BPromise=require(_0xd0d2('0x2'));var rs=require(_0xd0d2('0x3'));var fs=require('fs');var Redis=require(_0xd0d2('0x4'));var db=require(_0xd0d2('0x5'))['db'];var utils=require(_0xd0d2('0x6'));var logger=require('../../config/logger')(_0xd0d2('0x7'));var config=require(_0xd0d2('0x8'));var jayson=require(_0xd0d2('0x9'));var client=jayson[_0xd0d2('0xa')][_0xd0d2('0xb')]({'port':0x232a});config[_0xd0d2('0xc')]=_['defaults'](config['redis'],{'host':_0xd0d2('0xd'),'port':0x18eb});var socket=require(_0xd0d2('0xe'))(new Redis(config['redis']));require(_0xd0d2('0xf'))[_0xd0d2('0x10')](socket);function respondWithRpcPromise(_0x54d577,_0x427fa8,_0x4eaab5){return new BPromise(function(_0x90212f,_0x3cd37a){return client['request'](_0x54d577,_0x4eaab5)['then'](function(_0x36cabd){logger[_0xd0d2('0x11')](_0xd0d2('0x12'),_0x427fa8,_0xd0d2('0x13'));logger[_0xd0d2('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x427fa8,_0xd0d2('0x13'),JSON[_0xd0d2('0x15')](_0x36cabd));if(_0x36cabd[_0xd0d2('0x16')]){if(_0x36cabd[_0xd0d2('0x16')][_0xd0d2('0x17')]===0x1f4){logger[_0xd0d2('0x16')]('SmsQueue,\x20%s,\x20%s',_0x427fa8,_0x36cabd[_0xd0d2('0x16')][_0xd0d2('0x18')]);return _0x3cd37a(_0x36cabd[_0xd0d2('0x16')][_0xd0d2('0x18')]);}logger[_0xd0d2('0x16')]('SmsQueue,\x20%s,\x20%s',_0x427fa8,_0x36cabd['error'][_0xd0d2('0x18')]);return _0x90212f(_0x36cabd[_0xd0d2('0x16')][_0xd0d2('0x18')]);}else{logger['info'](_0xd0d2('0x12'),_0x427fa8,'request\x20sent');_0x90212f(_0x36cabd[_0xd0d2('0x19')][_0xd0d2('0x18')]);}})['catch'](function(_0x1cca1c){logger[_0xd0d2('0x16')]('SmsQueue,\x20%s,\x20%s',_0x427fa8,_0x1cca1c);_0x3cd37a(_0x1cca1c);});});}exports[_0xd0d2('0x1a')]=function(_0x6851c8){var _0x252279=this;return new Promise(function(_0x50e1f0,_0x296815){return db[_0xd0d2('0x1b')][_0xd0d2('0x1c')]({'raw':_0x6851c8['options']?_0x6851c8[_0xd0d2('0x1d')][_0xd0d2('0x1e')]===undefined?!![]:![]:!![],'where':_0x6851c8[_0xd0d2('0x1d')]?_0x6851c8[_0xd0d2('0x1d')][_0xd0d2('0x1f')]||null:null,'attributes':_0x6851c8[_0xd0d2('0x1d')]?_0x6851c8[_0xd0d2('0x1d')]['attributes']||null:null,'limit':_0x6851c8[_0xd0d2('0x1d')]?_0x6851c8[_0xd0d2('0x1d')]['limit']||null:null,'include':_0x6851c8[_0xd0d2('0x1d')]?_0x6851c8['options'][_0xd0d2('0x20')]?_[_0xd0d2('0x21')](_0x6851c8[_0xd0d2('0x1d')][_0xd0d2('0x20')],function(_0x555d96){return{'model':db[_0x555d96[_0xd0d2('0x22')]],'as':_0x555d96['as'],'attributes':_0x555d96['attributes'],'include':_0x555d96[_0xd0d2('0x20')]?_[_0xd0d2('0x21')](_0x555d96[_0xd0d2('0x20')],function(_0x454da5){return{'model':db[_0x454da5[_0xd0d2('0x22')]],'as':_0x454da5['as'],'attributes':_0x454da5['attributes'],'include':_0x454da5[_0xd0d2('0x20')]?_[_0xd0d2('0x21')](_0x454da5[_0xd0d2('0x20')],function(_0x183740){return{'model':db[_0x183740[_0xd0d2('0x22')]],'as':_0x183740['as'],'attributes':_0x183740[_0xd0d2('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd0d2('0x24')](function(_0x208037){logger[_0xd0d2('0x11')](_0xd0d2('0x1a'),_0x6851c8);logger['debug'](_0xd0d2('0x1a'),_0x6851c8,JSON[_0xd0d2('0x15')](_0x208037));_0x50e1f0(_0x208037);})[_0xd0d2('0x25')](function(_0x22c5b9){logger['error'](_0xd0d2('0x1a'),_0x22c5b9[_0xd0d2('0x18')],_0x6851c8);_0x296815(_0x252279[_0xd0d2('0x16')](0x1f4,_0x22c5b9[_0xd0d2('0x18')]));});});};exports[_0xd0d2('0x26')]=function(_0xf05715){var _0x3a87a8=this;return new Promise(function(_0x202f81,_0x4b7415){return db[_0xd0d2('0x1b')]['find']({'raw':_0xf05715[_0xd0d2('0x1d')]?_0xf05715[_0xd0d2('0x1d')][_0xd0d2('0x1e')]===undefined?!![]:![]:!![],'where':_0xf05715['options']?_0xf05715[_0xd0d2('0x1d')][_0xd0d2('0x1f')]||null:null,'attributes':_0xf05715['options']?_0xf05715[_0xd0d2('0x1d')][_0xd0d2('0x23')]||null:null,'include':_0xf05715[_0xd0d2('0x1d')]?_0xf05715[_0xd0d2('0x1d')][_0xd0d2('0x20')]?_['map'](_0xf05715['options'][_0xd0d2('0x20')],function(_0x253c81){return{'model':db[_0x253c81['model']],'as':_0x253c81['as'],'attributes':_0x253c81['attributes'],'include':_0x253c81[_0xd0d2('0x20')]?_['map'](_0x253c81['include'],function(_0x3e6db6){return{'model':db[_0x3e6db6[_0xd0d2('0x22')]],'as':_0x3e6db6['as'],'attributes':_0x3e6db6[_0xd0d2('0x23')],'include':_0x3e6db6['include']?_[_0xd0d2('0x21')](_0x3e6db6['include'],function(_0x1be1de){return{'model':db[_0x1be1de[_0xd0d2('0x22')]],'as':_0x1be1de['as'],'attributes':_0x1be1de['attributes']};}):[]};}):[]};}):[]:[]})[_0xd0d2('0x24')](function(_0x331edc){logger[_0xd0d2('0x11')](_0xd0d2('0x26'),_0xf05715);logger[_0xd0d2('0x14')]('ShowSmsQueue',_0xf05715,JSON[_0xd0d2('0x15')](_0x331edc));_0x202f81(_0x331edc);})[_0xd0d2('0x25')](function(_0x39995d){logger['error']('ShowSmsQueue',_0x39995d['message'],_0xf05715);_0x4b7415(_0x3a87a8[_0xd0d2('0x16')](0x1f4,_0x39995d['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 22efbd1..cde7271 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 _0xd5df=['save','remove','update','emit','register','length'];(function(_0x547f2f,_0x42b2c2){var _0x5ea1f5=function(_0x5516ab){while(--_0x5516ab){_0x547f2f['push'](_0x547f2f['shift']());}};_0x5ea1f5(++_0x42b2c2);}(_0xd5df,0x16e));var _0xfd5d=function(_0x1c9f1e,_0x1fbc36){_0x1c9f1e=_0x1c9f1e-0x0;var _0x18ebcc=_0xd5df[_0x1c9f1e];return _0x18ebcc;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xfd5d('0x0'),_0xfd5d('0x1'),_0xfd5d('0x2')];function createListener(_0x1c22fd,_0x8ecfb1){return function(_0x6d3a0b){_0x8ecfb1[_0xfd5d('0x3')](_0x1c22fd,_0x6d3a0b);};}function removeListener(_0x52e923,_0x356d94){return function(){SmsQueueEvents['removeListener'](_0x52e923,_0x356d94);};}exports[_0xfd5d('0x4')]=function(_0x1168aa){for(var _0x391eaf=0x0,_0x28b8b3=events[_0xfd5d('0x5')];_0x391eaf<_0x28b8b3;_0x391eaf++){var _0x18a325=events[_0x391eaf];var _0x3ff71d=createListener('smsQueue:'+_0x18a325,_0x1168aa);SmsQueueEvents['on'](_0x18a325,_0x3ff71d);}}; \ No newline at end of file +var _0x585c=['emit','removeListener','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x4805ac,_0x3fd2ae){var _0x50d6f0=function(_0x74263a){while(--_0x74263a){_0x4805ac['push'](_0x4805ac['shift']());}};_0x50d6f0(++_0x3fd2ae);}(_0x585c,0x83));var _0xc585=function(_0x3f3a3e,_0x588b8e){_0x3f3a3e=_0x3f3a3e-0x0;var _0x2fc984=_0x585c[_0x3f3a3e];return _0x2fc984;};'use strict';var SmsQueueEvents=require(_0xc585('0x0'));var events=[_0xc585('0x1'),_0xc585('0x2'),_0xc585('0x3')];function createListener(_0x567797,_0x40c10b){return function(_0x28d7aa){_0x40c10b[_0xc585('0x4')](_0x567797,_0x28d7aa);};}function removeListener(_0x2dfe6e,_0x393943){return function(){SmsQueueEvents[_0xc585('0x5')](_0x2dfe6e,_0x393943);};}exports[_0xc585('0x6')]=function(_0x15605f){for(var _0x31c343=0x0,_0x4bfcf8=events[_0xc585('0x7')];_0x31c343<_0x4bfcf8;_0x31c343++){var _0x5bd342=events[_0x31c343];var _0x5d93b0=createListener(_0xc585('0x8')+_0x5bd342,_0x15605f);SmsQueueEvents['on'](_0x5bd342,_0x5d93b0);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 26c76b1..710d29e 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 _0xf2fc=['/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf2fc,0x15c));var _0xcf2f=function(_0x5e02cf,_0x118c03){_0x5e02cf=_0x5e02cf-0x0;var _0x1beca5=_0xf2fc[_0x5e02cf];return _0x1beca5;};'use strict';var multer=require(_0xcf2f('0x0'));var util=require(_0xcf2f('0x1'));var path=require(_0xcf2f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcf2f('0x3')]();var fs_extra=require(_0xcf2f('0x4'));var auth=require(_0xcf2f('0x5'));var interaction=require(_0xcf2f('0x6'));var config=require('../../config/environment');var controller=require(_0xcf2f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xcf2f('0x8')](_0xcf2f('0x9'),auth['isAuthenticated'](),controller[_0xcf2f('0xa')]);router[_0xcf2f('0x8')](_0xcf2f('0xb'),auth[_0xcf2f('0xc')](),controller[_0xcf2f('0xd')]);router[_0xcf2f('0xe')]('/',auth['isAuthenticated'](),controller[_0xcf2f('0xf')]);router[_0xcf2f('0x10')](_0xcf2f('0xb'),auth[_0xcf2f('0xc')](),controller[_0xcf2f('0x11')]);router[_0xcf2f('0x12')](_0xcf2f('0xb'),auth['isAuthenticated'](),controller[_0xcf2f('0x13')]);module[_0xcf2f('0x14')]=router; \ No newline at end of file +var _0xbf25=['/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x4bb995,_0x22d513){var _0x6b9120=function(_0xafb8df){while(--_0xafb8df){_0x4bb995['push'](_0x4bb995['shift']());}};_0x6b9120(++_0x22d513);}(_0xbf25,0x15e));var _0x5bf2=function(_0x448754,_0x2d6ba5){_0x448754=_0x448754-0x0;var _0x5bfaf4=_0xbf25[_0x448754];return _0x5bfaf4;};'use strict';var multer=require(_0x5bf2('0x0'));var util=require('util');var path=require(_0x5bf2('0x1'));var timeout=require(_0x5bf2('0x2'));var express=require(_0x5bf2('0x3'));var router=express[_0x5bf2('0x4')]();var fs_extra=require(_0x5bf2('0x5'));var auth=require(_0x5bf2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bf2('0x7'));var controller=require('./smsQueueReport.controller');router[_0x5bf2('0x8')]('/',auth[_0x5bf2('0x9')](),controller['index']);router[_0x5bf2('0x8')](_0x5bf2('0xa'),auth[_0x5bf2('0x9')](),controller['describe']);router[_0x5bf2('0x8')](_0x5bf2('0xb'),auth[_0x5bf2('0x9')](),controller['show']);router[_0x5bf2('0xc')]('/',auth[_0x5bf2('0x9')](),controller[_0x5bf2('0xd')]);router[_0x5bf2('0xe')](_0x5bf2('0xb'),auth[_0x5bf2('0x9')](),controller[_0x5bf2('0xf')]);router[_0x5bf2('0x10')](_0x5bf2('0xb'),auth[_0x5bf2('0x9')](),controller[_0x5bf2('0x11')]);module[_0x5bf2('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index e471b8b..9f767a7 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 _0x41ed=['STRING','DATE','moment','exports'];(function(_0x263664,_0x4779c9){var _0x44e79a=function(_0x456ff5){while(--_0x456ff5){_0x263664['push'](_0x263664['shift']());}};_0x44e79a(++_0x4779c9);}(_0x41ed,0xa6));var _0xd41e=function(_0x39561b,_0x4b88fe){_0x39561b=_0x39561b-0x0;var _0x576767=_0x41ed[_0x39561b];return _0x576767;};'use strict';var moment=require(_0xd41e('0x0'));var Sequelize=require('sequelize');module[_0xd41e('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xd41e('0x2')]},'joinAt':{'type':Sequelize[_0xd41e('0x3')]},'leaveAt':{'type':Sequelize[_0xd41e('0x3')]},'acceptAt':{'type':Sequelize[_0xd41e('0x3')]},'exitAt':{'type':Sequelize[_0xd41e('0x3')]},'reason':{'type':Sequelize[_0xd41e('0x2')]}}; \ No newline at end of file +var _0xfd95=['exports','STRING','DATE','moment'];(function(_0x2d7a56,_0x44dd65){var _0x4cc621=function(_0x5e7982){while(--_0x5e7982){_0x2d7a56['push'](_0x2d7a56['shift']());}};_0x4cc621(++_0x44dd65);}(_0xfd95,0x97));var _0x5fd9=function(_0x459956,_0x865157){_0x459956=_0x459956-0x0;var _0x1ad735=_0xfd95[_0x459956];return _0x1ad735;};'use strict';var moment=require(_0x5fd9('0x0'));var Sequelize=require('sequelize');module[_0x5fd9('0x1')]={'uniqueid':{'type':Sequelize[_0x5fd9('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5fd9('0x2')]},'joinAt':{'type':Sequelize[_0x5fd9('0x3')]},'leaveAt':{'type':Sequelize[_0x5fd9('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5fd9('0x3')]},'reason':{'type':Sequelize[_0x5fd9('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 6cceee6..c8982aa 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 _0xc105=['include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','catch','show','fields'];(function(_0x120123,_0x4eff59){var _0x3bec4c=function(_0x182818){while(--_0x182818){_0x120123['push'](_0x120123['shift']());}};_0x3bec4c(++_0x4eff59);}(_0xc105,0x1d4));var _0x5c10=function(_0x372a57,_0x9aa407){_0x372a57=_0x372a57-0x0;var _0x358f6d=_0xc105[_0x372a57];return _0x358f6d;};'use strict';var emlformat=require(_0x5c10('0x0'));var rimraf=require(_0x5c10('0x1'));var zipdir=require(_0x5c10('0x2'));var jsonpatch=require(_0x5c10('0x3'));var rp=require(_0x5c10('0x4'));var moment=require(_0x5c10('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5c10('0x6'));var util=require(_0x5c10('0x7'));var path=require('path');var sox=require(_0x5c10('0x8'));var csv=require(_0x5c10('0x9'));var ejs=require(_0x5c10('0xa'));var fs=require('fs');var fs_extra=require(_0x5c10('0xb'));var _=require(_0x5c10('0xc'));var squel=require(_0x5c10('0xd'));var crypto=require('crypto');var jsforce=require(_0x5c10('0xe'));var deskjs=require(_0x5c10('0xf'));var toCsv=require(_0x5c10('0x9'));var querystring=require(_0x5c10('0x10'));var Papa=require(_0x5c10('0x11'));var Redis=require(_0x5c10('0x12'));var authService=require(_0x5c10('0x13'));var qs=require(_0x5c10('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5c10('0x15'));var utils=require('../../config/utils');var config=require(_0x5c10('0x16'));var licenseUtil=require(_0x5c10('0x17'));var db=require(_0x5c10('0x18'))['db'];function respondWithStatusCode(_0x360268,_0x1b1470){_0x1b1470=_0x1b1470||0xcc;return function(_0x9d7aa9){if(_0x9d7aa9){return _0x360268['sendStatus'](_0x1b1470);}return _0x360268[_0x5c10('0x19')](_0x1b1470)[_0x5c10('0x1a')]();};}function respondWithResult(_0x57ef36,_0x2a7602){_0x2a7602=_0x2a7602||0xc8;return function(_0x3bf9ed){if(_0x3bf9ed){return _0x57ef36[_0x5c10('0x19')](_0x2a7602)[_0x5c10('0x1b')](_0x3bf9ed);}};}function respondWithFilteredResult(_0x176724,_0x27fadd){return function(_0x1241c7){if(_0x1241c7){var _0x2a4f2c=typeof _0x27fadd[_0x5c10('0x1c')]==='undefined'&&typeof _0x27fadd[_0x5c10('0x1d')]===_0x5c10('0x1e');var _0x3a2625=_0x1241c7['count'];var _0xb4e162=_0x2a4f2c?0x0:_0x27fadd['offset'];var _0x18c5bd=_0x2a4f2c?_0x1241c7[_0x5c10('0x1f')]:_0x27fadd[_0x5c10('0x1c')]+_0x27fadd[_0x5c10('0x1d')];var _0x490eaa;if(_0x18c5bd>=_0x3a2625){_0x18c5bd=_0x3a2625;_0x490eaa=0xc8;}else{_0x490eaa=0xce;}_0x176724[_0x5c10('0x19')](_0x490eaa);return _0x176724[_0x5c10('0x20')](_0x5c10('0x21'),_0xb4e162+'-'+_0x18c5bd+'/'+_0x3a2625)['json'](_0x1241c7);}return null;};}function patchUpdates(_0x2761ad){return function(_0x7aff15){try{jsonpatch[_0x5c10('0x22')](_0x7aff15,_0x2761ad,!![]);}catch(_0x5582fa){return BPromise['reject'](_0x5582fa);}return _0x7aff15[_0x5c10('0x23')]();};}function saveUpdates(_0x48eb94,_0xce3cfb){return function(_0x102db3){if(_0x102db3){return _0x102db3[_0x5c10('0x24')](_0x48eb94)[_0x5c10('0x25')](function(_0xb1c660){return _0xb1c660;});}return null;};}function removeEntity(_0x3f6bc4,_0x4a4f3f){return function(_0x493b26){if(_0x493b26){return _0x493b26[_0x5c10('0x26')]()[_0x5c10('0x25')](function(){_0x3f6bc4[_0x5c10('0x19')](0xcc)[_0x5c10('0x1a')]();});}};}function handleEntityNotFound(_0x49a2f9,_0x2c8f56){return function(_0xde14bd){if(!_0xde14bd){_0x49a2f9[_0x5c10('0x27')](0x194);}return _0xde14bd;};}function handleError(_0x25831d,_0x4810e4){_0x4810e4=_0x4810e4||0x1f4;return function(_0x57514f){logger[_0x5c10('0x28')](_0x57514f[_0x5c10('0x29')]);if(_0x57514f[_0x5c10('0x2a')]){delete _0x57514f[_0x5c10('0x2a')];}_0x25831d[_0x5c10('0x19')](_0x4810e4)[_0x5c10('0x2b')](_0x57514f);};}exports[_0x5c10('0x2c')]=function(_0x1e80fc,_0x4d13fa){var _0x1a4435={},_0x7724a2={},_0x34ad51={'count':0x0,'rows':[]};var _0x468db7=_[_0x5c10('0x2d')](db[_0x5c10('0x2e')][_0x5c10('0x2f')],function(_0x4e0104){return{'name':_0x4e0104[_0x5c10('0x30')],'type':_0x4e0104[_0x5c10('0x31')][_0x5c10('0x32')]};});_0x7724a2[_0x5c10('0x33')]=_[_0x5c10('0x2d')](_0x468db7,_0x5c10('0x2a'));_0x7724a2[_0x5c10('0x34')]=_[_0x5c10('0x35')](_0x1e80fc[_0x5c10('0x34')]);_0x7724a2[_0x5c10('0x36')]=_['intersection'](_0x7724a2[_0x5c10('0x33')],_0x7724a2['query']);_0x1a4435[_0x5c10('0x37')]=_[_0x5c10('0x38')](_0x7724a2['model'],qs['fields'](_0x1e80fc['query']['fields']));_0x1a4435[_0x5c10('0x37')]=_0x1a4435[_0x5c10('0x37')][_0x5c10('0x39')]?_0x1a4435['attributes']:_0x7724a2[_0x5c10('0x33')];if(!_0x1e80fc[_0x5c10('0x34')]['hasOwnProperty']('nolimit')){_0x1a4435[_0x5c10('0x1d')]=qs['limit'](_0x1e80fc['query']['limit']);_0x1a4435[_0x5c10('0x1c')]=qs[_0x5c10('0x1c')](_0x1e80fc[_0x5c10('0x34')][_0x5c10('0x1c')]);}_0x1a4435[_0x5c10('0x3a')]=qs[_0x5c10('0x3b')](_0x1e80fc[_0x5c10('0x34')][_0x5c10('0x3b')]);_0x1a4435['where']=qs['filters'](_[_0x5c10('0x3c')](_0x1e80fc['query'],_0x7724a2[_0x5c10('0x36')]),_0x468db7);if(_0x1e80fc[_0x5c10('0x34')][_0x5c10('0x3d')]){_0x1a4435['where']=_['merge'](_0x1a4435[_0x5c10('0x3e')],{'$or':_[_0x5c10('0x2d')](_0x468db7,function(_0x57384b){if(_0x57384b[_0x5c10('0x31')]!==_0x5c10('0x3f')){var _0x41e84c={};_0x41e84c[_0x57384b[_0x5c10('0x2a')]]={'$like':'%'+_0x1e80fc[_0x5c10('0x34')][_0x5c10('0x3d')]+'%'};return _0x41e84c;}})});}_0x1a4435=_[_0x5c10('0x40')]({},_0x1a4435,_0x1e80fc[_0x5c10('0x41')]);var _0x14d292={'where':_0x1a4435[_0x5c10('0x3e')]};return db[_0x5c10('0x2e')][_0x5c10('0x1f')](_0x14d292)[_0x5c10('0x25')](function(_0x42f964){_0x34ad51[_0x5c10('0x1f')]=_0x42f964;if(_0x1e80fc[_0x5c10('0x34')][_0x5c10('0x42')]){_0x1a4435['include']=[{'all':!![]}];}return db[_0x5c10('0x2e')][_0x5c10('0x43')](_0x1a4435);})[_0x5c10('0x25')](function(_0x583861){_0x34ad51['rows']=_0x583861;return _0x34ad51;})[_0x5c10('0x25')](respondWithFilteredResult(_0x4d13fa,_0x1a4435))[_0x5c10('0x44')](handleError(_0x4d13fa,null));};exports[_0x5c10('0x45')]=function(_0x4be469,_0xc7979c){var _0x2119f5={'raw':!![],'where':{'id':_0x4be469['params']['id']}},_0xff9613={};_0xff9613[_0x5c10('0x33')]=_['keys'](db[_0x5c10('0x2e')][_0x5c10('0x2f')]);_0xff9613[_0x5c10('0x34')]=_[_0x5c10('0x35')](_0x4be469[_0x5c10('0x34')]);_0xff9613[_0x5c10('0x36')]=_[_0x5c10('0x38')](_0xff9613[_0x5c10('0x33')],_0xff9613['query']);_0x2119f5[_0x5c10('0x37')]=_['intersection'](_0xff9613[_0x5c10('0x33')],qs[_0x5c10('0x46')](_0x4be469[_0x5c10('0x34')][_0x5c10('0x46')]));_0x2119f5[_0x5c10('0x37')]=_0x2119f5[_0x5c10('0x37')]['length']?_0x2119f5[_0x5c10('0x37')]:_0xff9613[_0x5c10('0x33')];if(_0x4be469[_0x5c10('0x34')]['includeAll']){_0x2119f5[_0x5c10('0x47')]=[{'all':!![]}];}_0x2119f5=_[_0x5c10('0x40')]({},_0x2119f5,_0x4be469['options']);return db['SmsQueueReport'][_0x5c10('0x48')](_0x2119f5)[_0x5c10('0x25')](handleEntityNotFound(_0xc7979c,null))[_0x5c10('0x25')](respondWithResult(_0xc7979c,null))[_0x5c10('0x44')](handleError(_0xc7979c,null));};exports[_0x5c10('0x49')]=function(_0x2363e6,_0x2af183){return db[_0x5c10('0x2e')][_0x5c10('0x49')](_0x2363e6[_0x5c10('0x4a')],{})[_0x5c10('0x25')](respondWithResult(_0x2af183,0xc9))[_0x5c10('0x44')](handleError(_0x2af183,null));};exports[_0x5c10('0x24')]=function(_0x1f32c7,_0x7afc1f){if(_0x1f32c7['body']['id']){delete _0x1f32c7[_0x5c10('0x4a')]['id'];}return db['SmsQueueReport'][_0x5c10('0x48')]({'where':{'id':_0x1f32c7[_0x5c10('0x4b')]['id']}})[_0x5c10('0x25')](handleEntityNotFound(_0x7afc1f,null))[_0x5c10('0x25')](saveUpdates(_0x1f32c7[_0x5c10('0x4a')],null))[_0x5c10('0x25')](respondWithResult(_0x7afc1f,null))[_0x5c10('0x44')](handleError(_0x7afc1f,null));};exports[_0x5c10('0x26')]=function(_0x1f7c2d,_0x3f9536){return db['SmsQueueReport'][_0x5c10('0x48')]({'where':{'id':_0x1f7c2d[_0x5c10('0x4b')]['id']}})[_0x5c10('0x25')](handleEntityNotFound(_0x3f9536,null))[_0x5c10('0x25')](removeEntity(_0x3f9536,null))['catch'](handleError(_0x3f9536,null));};exports[_0x5c10('0x4c')]=function(_0xf28674,_0x2d6be4){return db[_0x5c10('0x2e')]['describe']()[_0x5c10('0x25')](respondWithResult(_0x2d6be4,null))[_0x5c10('0x44')](handleError(_0x2d6be4,null));}; \ No newline at end of file +var _0xbe34=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','index','rawAttributes','fieldName','key','model','map','name','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','SmsQueueReport','includeAll','include','rows','catch','show','params','keys','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe34,0x8e));var _0x4be3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbe34[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x4be3('0x0'));var rimraf=require(_0x4be3('0x1'));var zipdir=require(_0x4be3('0x2'));var jsonpatch=require(_0x4be3('0x3'));var rp=require('request-promise');var moment=require(_0x4be3('0x4'));var BPromise=require(_0x4be3('0x5'));var Mustache=require(_0x4be3('0x6'));var util=require(_0x4be3('0x7'));var path=require(_0x4be3('0x8'));var sox=require('sox');var csv=require(_0x4be3('0x9'));var ejs=require(_0x4be3('0xa'));var fs=require('fs');var fs_extra=require(_0x4be3('0xb'));var _=require(_0x4be3('0xc'));var squel=require(_0x4be3('0xd'));var crypto=require(_0x4be3('0xe'));var jsforce=require(_0x4be3('0xf'));var deskjs=require(_0x4be3('0x10'));var toCsv=require(_0x4be3('0x9'));var querystring=require('querystring');var Papa=require(_0x4be3('0x11'));var Redis=require(_0x4be3('0x12'));var authService=require(_0x4be3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4be3('0x14'));var hardwareService=require(_0x4be3('0x15'));var logger=require(_0x4be3('0x16'))('api');var utils=require(_0x4be3('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27a95b,_0x496d27){_0x496d27=_0x496d27||0xcc;return function(_0x16793a){if(_0x16793a){return _0x27a95b['sendStatus'](_0x496d27);}return _0x27a95b[_0x4be3('0x18')](_0x496d27)[_0x4be3('0x19')]();};}function respondWithResult(_0x23b010,_0xbe8ed2){_0xbe8ed2=_0xbe8ed2||0xc8;return function(_0xf4c250){if(_0xf4c250){return _0x23b010[_0x4be3('0x18')](_0xbe8ed2)[_0x4be3('0x1a')](_0xf4c250);}};}function respondWithFilteredResult(_0x98747d,_0x215600){return function(_0x1e8da5){if(_0x1e8da5){var _0x3d2adc=typeof _0x215600[_0x4be3('0x1b')]==='undefined'&&typeof _0x215600[_0x4be3('0x1c')]===_0x4be3('0x1d');var _0x3dbaef=_0x1e8da5['count'];var _0x3d5b1c=_0x3d2adc?0x0:_0x215600[_0x4be3('0x1b')];var _0x36e7d2=_0x3d2adc?_0x1e8da5[_0x4be3('0x1e')]:_0x215600[_0x4be3('0x1b')]+_0x215600[_0x4be3('0x1c')];var _0x4c62d7;if(_0x36e7d2>=_0x3dbaef){_0x36e7d2=_0x3dbaef;_0x4c62d7=0xc8;}else{_0x4c62d7=0xce;}_0x98747d[_0x4be3('0x18')](_0x4c62d7);return _0x98747d[_0x4be3('0x1f')](_0x4be3('0x20'),_0x3d5b1c+'-'+_0x36e7d2+'/'+_0x3dbaef)[_0x4be3('0x1a')](_0x1e8da5);}return null;};}function patchUpdates(_0x14ad5c){return function(_0x48b023){try{jsonpatch[_0x4be3('0x21')](_0x48b023,_0x14ad5c,!![]);}catch(_0x398d7b){return BPromise[_0x4be3('0x22')](_0x398d7b);}return _0x48b023['save']();};}function saveUpdates(_0x3d9fa9,_0x1a4a3b){return function(_0x1d2c02){if(_0x1d2c02){return _0x1d2c02[_0x4be3('0x23')](_0x3d9fa9)[_0x4be3('0x24')](function(_0x20b307){return _0x20b307;});}return null;};}function removeEntity(_0x353c91,_0x523510){return function(_0x1dbd8c){if(_0x1dbd8c){return _0x1dbd8c[_0x4be3('0x25')]()[_0x4be3('0x24')](function(){_0x353c91[_0x4be3('0x18')](0xcc)[_0x4be3('0x19')]();});}};}function handleEntityNotFound(_0x448dc7,_0x1c610a){return function(_0x33bf5a){if(!_0x33bf5a){_0x448dc7['sendStatus'](0x194);}return _0x33bf5a;};}function handleError(_0x1228d0,_0x2f6138){_0x2f6138=_0x2f6138||0x1f4;return function(_0xa383b6){logger[_0x4be3('0x26')](_0xa383b6[_0x4be3('0x27')]);if(_0xa383b6['name']){delete _0xa383b6['name'];}_0x1228d0['status'](_0x2f6138)[_0x4be3('0x28')](_0xa383b6);};}exports[_0x4be3('0x29')]=function(_0x57ff43,_0x5b1dbf){var _0x11c130={},_0x5af76e={},_0xf05161={'count':0x0,'rows':[]};var _0x5bcb98=_['map'](db['SmsQueueReport'][_0x4be3('0x2a')],function(_0x15ade9){return{'name':_0x15ade9[_0x4be3('0x2b')],'type':_0x15ade9['type'][_0x4be3('0x2c')]};});_0x5af76e[_0x4be3('0x2d')]=_[_0x4be3('0x2e')](_0x5bcb98,_0x4be3('0x2f'));_0x5af76e[_0x4be3('0x30')]=_['keys'](_0x57ff43[_0x4be3('0x30')]);_0x5af76e[_0x4be3('0x31')]=_[_0x4be3('0x32')](_0x5af76e['model'],_0x5af76e[_0x4be3('0x30')]);_0x11c130['attributes']=_[_0x4be3('0x32')](_0x5af76e[_0x4be3('0x2d')],qs[_0x4be3('0x33')](_0x57ff43[_0x4be3('0x30')][_0x4be3('0x33')]));_0x11c130[_0x4be3('0x34')]=_0x11c130[_0x4be3('0x34')]['length']?_0x11c130['attributes']:_0x5af76e[_0x4be3('0x2d')];if(!_0x57ff43[_0x4be3('0x30')]['hasOwnProperty'](_0x4be3('0x35'))){_0x11c130[_0x4be3('0x1c')]=qs['limit'](_0x57ff43[_0x4be3('0x30')][_0x4be3('0x1c')]);_0x11c130[_0x4be3('0x1b')]=qs[_0x4be3('0x1b')](_0x57ff43['query']['offset']);}_0x11c130[_0x4be3('0x36')]=qs[_0x4be3('0x37')](_0x57ff43[_0x4be3('0x30')][_0x4be3('0x37')]);_0x11c130[_0x4be3('0x38')]=qs[_0x4be3('0x31')](_[_0x4be3('0x39')](_0x57ff43[_0x4be3('0x30')],_0x5af76e['filters']),_0x5bcb98);if(_0x57ff43[_0x4be3('0x30')][_0x4be3('0x3a')]){_0x11c130[_0x4be3('0x38')]=_[_0x4be3('0x3b')](_0x11c130[_0x4be3('0x38')],{'$or':_[_0x4be3('0x2e')](_0x5bcb98,function(_0x2d8cde){if(_0x2d8cde[_0x4be3('0x3c')]!==_0x4be3('0x3d')){var _0x28239a={};_0x28239a[_0x2d8cde[_0x4be3('0x2f')]]={'$like':'%'+_0x57ff43['query']['filter']+'%'};return _0x28239a;}})});}_0x11c130=_[_0x4be3('0x3b')]({},_0x11c130,_0x57ff43['options']);var _0x32c96b={'where':_0x11c130[_0x4be3('0x38')]};return db[_0x4be3('0x3e')][_0x4be3('0x1e')](_0x32c96b)[_0x4be3('0x24')](function(_0x4e3686){_0xf05161[_0x4be3('0x1e')]=_0x4e3686;if(_0x57ff43[_0x4be3('0x30')][_0x4be3('0x3f')]){_0x11c130[_0x4be3('0x40')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x11c130);})[_0x4be3('0x24')](function(_0x2afc96){_0xf05161[_0x4be3('0x41')]=_0x2afc96;return _0xf05161;})[_0x4be3('0x24')](respondWithFilteredResult(_0x5b1dbf,_0x11c130))[_0x4be3('0x42')](handleError(_0x5b1dbf,null));};exports[_0x4be3('0x43')]=function(_0x56954f,_0x9588f){var _0x5abaf1={'raw':!![],'where':{'id':_0x56954f[_0x4be3('0x44')]['id']}},_0x1b547a={};_0x1b547a[_0x4be3('0x2d')]=_[_0x4be3('0x45')](db[_0x4be3('0x3e')][_0x4be3('0x2a')]);_0x1b547a['query']=_[_0x4be3('0x45')](_0x56954f['query']);_0x1b547a['filters']=_[_0x4be3('0x32')](_0x1b547a[_0x4be3('0x2d')],_0x1b547a['query']);_0x5abaf1[_0x4be3('0x34')]=_['intersection'](_0x1b547a['model'],qs[_0x4be3('0x33')](_0x56954f[_0x4be3('0x30')][_0x4be3('0x33')]));_0x5abaf1[_0x4be3('0x34')]=_0x5abaf1[_0x4be3('0x34')][_0x4be3('0x46')]?_0x5abaf1['attributes']:_0x1b547a[_0x4be3('0x2d')];if(_0x56954f[_0x4be3('0x30')]['includeAll']){_0x5abaf1['include']=[{'all':!![]}];}_0x5abaf1=_[_0x4be3('0x3b')]({},_0x5abaf1,_0x56954f[_0x4be3('0x47')]);return db[_0x4be3('0x3e')][_0x4be3('0x48')](_0x5abaf1)[_0x4be3('0x24')](handleEntityNotFound(_0x9588f,null))[_0x4be3('0x24')](respondWithResult(_0x9588f,null))[_0x4be3('0x42')](handleError(_0x9588f,null));};exports[_0x4be3('0x49')]=function(_0xbfada5,_0x42495d){return db[_0x4be3('0x3e')][_0x4be3('0x49')](_0xbfada5['body'],{})[_0x4be3('0x24')](respondWithResult(_0x42495d,0xc9))[_0x4be3('0x42')](handleError(_0x42495d,null));};exports[_0x4be3('0x23')]=function(_0x3d42bd,_0x3ea3ff){if(_0x3d42bd[_0x4be3('0x4a')]['id']){delete _0x3d42bd[_0x4be3('0x4a')]['id'];}return db[_0x4be3('0x3e')][_0x4be3('0x48')]({'where':{'id':_0x3d42bd[_0x4be3('0x44')]['id']}})[_0x4be3('0x24')](handleEntityNotFound(_0x3ea3ff,null))[_0x4be3('0x24')](saveUpdates(_0x3d42bd[_0x4be3('0x4a')],null))[_0x4be3('0x24')](respondWithResult(_0x3ea3ff,null))[_0x4be3('0x42')](handleError(_0x3ea3ff,null));};exports[_0x4be3('0x25')]=function(_0x1a2e0d,_0x196ee1){return db['SmsQueueReport'][_0x4be3('0x48')]({'where':{'id':_0x1a2e0d[_0x4be3('0x44')]['id']}})[_0x4be3('0x24')](handleEntityNotFound(_0x196ee1,null))[_0x4be3('0x24')](removeEntity(_0x196ee1,null))[_0x4be3('0x42')](handleError(_0x196ee1,null));};exports['describe']=function(_0x37c0c6,_0x4d4f16){return db['SmsQueueReport']['describe']()[_0x4be3('0x24')](respondWithResult(_0x4d4f16,null))[_0x4be3('0x42')](handleError(_0x4d4f16,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index e1e8d21..55cfcaf 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x2ff739,_0x1c8e0f){var _0x12dc13=function(_0x26fc97){while(--_0x26fc97){_0x2ff739['push'](_0x2ff739['shift']());}};_0x12dc13(++_0x1c8e0f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x2454c9,_0x6041a9){var _0x3c92b1=function(_0x156c3f){while(--_0x156c3f){_0x2454c9['push'](_0x2454c9['shift']());}};_0x3c92b1(++_0x6041a9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index aca1ea5..8bb37ac 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 _0x1045=['CreateSmsQueueReport','UpdateSmsQueueReport','update','options','where','attributes','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsQueueReport','create','body','raw','then','debug'];(function(_0xac9d09,_0x8f8173){var _0x35410a=function(_0x4ed66b){while(--_0x4ed66b){_0xac9d09['push'](_0xac9d09['shift']());}};_0x35410a(++_0x8f8173);}(_0x1045,0xc6));var _0x5104=function(_0x52bd65,_0x160646){_0x52bd65=_0x52bd65-0x0;var _0x13fd57=_0x1045[_0x52bd65];return _0x13fd57;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5104('0x0'));var BPromise=require('bluebird');var rs=require(_0x5104('0x1'));var fs=require('fs');var Redis=require(_0x5104('0x2'));var db=require(_0x5104('0x3'))['db'];var utils=require(_0x5104('0x4'));var logger=require('../../config/logger')(_0x5104('0x5'));var config=require(_0x5104('0x6'));var jayson=require(_0x5104('0x7'));var client=jayson[_0x5104('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41191d,_0x4ce979,_0x45558b){return new BPromise(function(_0x817bdf,_0x7b851a){return client[_0x5104('0x9')](_0x41191d,_0x45558b)['then'](function(_0x566ed8){logger[_0x5104('0xa')](_0x5104('0xb'),_0x4ce979,_0x5104('0xc'));logger['debug'](_0x5104('0xd'),_0x4ce979,_0x5104('0xc'),JSON[_0x5104('0xe')](_0x566ed8));if(_0x566ed8[_0x5104('0xf')]){if(_0x566ed8[_0x5104('0xf')][_0x5104('0x10')]===0x1f4){logger[_0x5104('0xf')](_0x5104('0xb'),_0x4ce979,_0x566ed8[_0x5104('0xf')][_0x5104('0x11')]);return _0x7b851a(_0x566ed8['error'][_0x5104('0x11')]);}logger[_0x5104('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x4ce979,_0x566ed8[_0x5104('0xf')]['message']);return _0x817bdf(_0x566ed8[_0x5104('0xf')]['message']);}else{logger[_0x5104('0xa')]('SmsQueueReport,\x20%s,\x20%s',_0x4ce979,_0x5104('0xc'));_0x817bdf(_0x566ed8[_0x5104('0x12')]['message']);}})[_0x5104('0x13')](function(_0x55a590){logger[_0x5104('0xf')](_0x5104('0xb'),_0x4ce979,_0x55a590);_0x7b851a(_0x55a590);});});}exports['CreateSmsQueueReport']=function(_0x46763f){var _0x217ded=this;return new Promise(function(_0x46f5b5,_0x526ab9){return db[_0x5104('0x14')][_0x5104('0x15')](_0x46763f[_0x5104('0x16')],{'raw':_0x46763f['options']?_0x46763f['options'][_0x5104('0x17')]===undefined?!![]:![]:!![]})[_0x5104('0x18')](function(_0x6caf97){logger[_0x5104('0xa')]('CreateSmsQueueReport',_0x46763f);logger[_0x5104('0x19')]('CreateSmsQueueReport',_0x46763f,JSON[_0x5104('0xe')](_0x6caf97));_0x46f5b5(_0x6caf97);})[_0x5104('0x13')](function(_0x532786){logger['error'](_0x5104('0x1a'),_0x532786[_0x5104('0x11')],_0x46763f);_0x526ab9(_0x217ded[_0x5104('0xf')](0x1f4,_0x532786[_0x5104('0x11')]));});});};exports[_0x5104('0x1b')]=function(_0x284489){var _0x4393b3=this;return new Promise(function(_0x2c1ff5,_0x5b4e5f){return db[_0x5104('0x14')][_0x5104('0x1c')](_0x284489[_0x5104('0x16')],{'raw':_0x284489[_0x5104('0x1d')]?_0x284489[_0x5104('0x1d')][_0x5104('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x284489[_0x5104('0x1d')]?_0x284489[_0x5104('0x1d')][_0x5104('0x1e')]||null:null,'attributes':_0x284489[_0x5104('0x1d')]?_0x284489[_0x5104('0x1d')][_0x5104('0x1f')]||null:null,'limit':_0x284489[_0x5104('0x1d')]?_0x284489[_0x5104('0x1d')]['limit']||null:null})[_0x5104('0x18')](function(_0x35f2d4){logger['info']('UpdateSmsQueueReport',_0x284489);logger[_0x5104('0x19')](_0x5104('0x1b'),_0x284489,JSON[_0x5104('0xe')](_0x35f2d4));_0x2c1ff5(_0x35f2d4);})['catch'](function(_0xa6d72a){logger[_0x5104('0xf')](_0x5104('0x1b'),_0xa6d72a[_0x5104('0x11')],_0x284489);_0x5b4e5f(_0x4393b3['error'](0x1f4,_0xa6d72a[_0x5104('0x11')]));});});}; \ No newline at end of file +var _0xca53=['code','message','result','catch','CreateSmsQueueReport','body','options','raw','debug','UpdateSmsQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x14874e,_0x3545bf){var _0xfe515a=function(_0x106a53){while(--_0x106a53){_0x14874e['push'](_0x14874e['shift']());}};_0xfe515a(++_0x3545bf);}(_0xca53,0x194));var _0x3ca5=function(_0x552e59,_0x5c4591){_0x552e59=_0x552e59-0x0;var _0x5e15ad=_0xca53[_0x552e59];return _0x5e15ad;};'use strict';var _=require(_0x3ca5('0x0'));var util=require(_0x3ca5('0x1'));var moment=require(_0x3ca5('0x2'));var BPromise=require('bluebird');var rs=require(_0x3ca5('0x3'));var fs=require('fs');var Redis=require(_0x3ca5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ca5('0x5'));var logger=require('../../config/logger')(_0x3ca5('0x6'));var config=require(_0x3ca5('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x157812,_0x625c9,_0x576cab){return new BPromise(function(_0x1a5fe3,_0x480efe){return client[_0x3ca5('0x8')](_0x157812,_0x576cab)[_0x3ca5('0x9')](function(_0x575b11){logger[_0x3ca5('0xa')](_0x3ca5('0xb'),_0x625c9,_0x3ca5('0xc'));logger['debug'](_0x3ca5('0xd'),_0x625c9,_0x3ca5('0xc'),JSON[_0x3ca5('0xe')](_0x575b11));if(_0x575b11[_0x3ca5('0xf')]){if(_0x575b11['error'][_0x3ca5('0x10')]===0x1f4){logger[_0x3ca5('0xf')](_0x3ca5('0xb'),_0x625c9,_0x575b11['error']['message']);return _0x480efe(_0x575b11[_0x3ca5('0xf')][_0x3ca5('0x11')]);}logger[_0x3ca5('0xf')](_0x3ca5('0xb'),_0x625c9,_0x575b11[_0x3ca5('0xf')][_0x3ca5('0x11')]);return _0x1a5fe3(_0x575b11[_0x3ca5('0xf')][_0x3ca5('0x11')]);}else{logger[_0x3ca5('0xa')]('SmsQueueReport,\x20%s,\x20%s',_0x625c9,_0x3ca5('0xc'));_0x1a5fe3(_0x575b11[_0x3ca5('0x12')][_0x3ca5('0x11')]);}})[_0x3ca5('0x13')](function(_0x31a320){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x625c9,_0x31a320);_0x480efe(_0x31a320);});});}exports[_0x3ca5('0x14')]=function(_0x25c86a){var _0x4da223=this;return new Promise(function(_0x20bd66,_0x11440e){return db['SmsQueueReport']['create'](_0x25c86a[_0x3ca5('0x15')],{'raw':_0x25c86a[_0x3ca5('0x16')]?_0x25c86a['options'][_0x3ca5('0x17')]===undefined?!![]:![]:!![]})[_0x3ca5('0x9')](function(_0x1635b4){logger[_0x3ca5('0xa')](_0x3ca5('0x14'),_0x25c86a);logger[_0x3ca5('0x18')](_0x3ca5('0x14'),_0x25c86a,JSON['stringify'](_0x1635b4));_0x20bd66(_0x1635b4);})[_0x3ca5('0x13')](function(_0x4e44fa){logger[_0x3ca5('0xf')](_0x3ca5('0x14'),_0x4e44fa[_0x3ca5('0x11')],_0x25c86a);_0x11440e(_0x4da223[_0x3ca5('0xf')](0x1f4,_0x4e44fa[_0x3ca5('0x11')]));});});};exports[_0x3ca5('0x19')]=function(_0xc5dd88){var _0x58f9f3=this;return new Promise(function(_0xf6251e,_0x2951df){return db['SmsQueueReport'][_0x3ca5('0x1a')](_0xc5dd88['body'],{'raw':_0xc5dd88['options']?_0xc5dd88[_0x3ca5('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc5dd88['options']?_0xc5dd88[_0x3ca5('0x16')][_0x3ca5('0x1b')]||null:null,'attributes':_0xc5dd88[_0x3ca5('0x16')]?_0xc5dd88[_0x3ca5('0x16')][_0x3ca5('0x1c')]||null:null,'limit':_0xc5dd88[_0x3ca5('0x16')]?_0xc5dd88[_0x3ca5('0x16')][_0x3ca5('0x1d')]||null:null})[_0x3ca5('0x9')](function(_0x117588){logger[_0x3ca5('0xa')]('UpdateSmsQueueReport',_0xc5dd88);logger['debug'](_0x3ca5('0x19'),_0xc5dd88,JSON[_0x3ca5('0xe')](_0x117588));_0xf6251e(_0x117588);})[_0x3ca5('0x13')](function(_0x25b472){logger[_0x3ca5('0xf')](_0x3ca5('0x19'),_0x25b472[_0x3ca5('0x11')],_0xc5dd88);_0x2951df(_0x58f9f3[_0x3ca5('0xf')](0x1f4,_0x25b472[_0x3ca5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 2ea8b8e..cd6cb03 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 _0x8958=['index','get','/describe','/:id','show','post','create','put','delete','destroy','exports','util','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated'];(function(_0x464e05,_0x430401){var _0x45bb69=function(_0x501b49){while(--_0x501b49){_0x464e05['push'](_0x464e05['shift']());}};_0x45bb69(++_0x430401);}(_0x8958,0x93));var _0x8895=function(_0x15715d,_0x2bedee){_0x15715d=_0x15715d-0x0;var _0x4f24ba=_0x8958[_0x15715d];return _0x4f24ba;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8895('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var controller=require(_0x8895('0x4'));router['get']('/',auth[_0x8895('0x5')](),controller[_0x8895('0x6')]);router[_0x8895('0x7')](_0x8895('0x8'),auth[_0x8895('0x5')](),controller['describe']);router[_0x8895('0x7')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller[_0x8895('0xa')]);router[_0x8895('0xb')]('/',auth[_0x8895('0x5')](),controller[_0x8895('0xc')]);router[_0x8895('0xd')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller['update']);router[_0x8895('0xe')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller[_0x8895('0xf')]);module[_0x8895('0x10')]=router; \ No newline at end of file +var _0x9009=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','/describe','describe','/:id','isAuthenticated','post','create','put','delete','exports'];(function(_0x3ba27f,_0x308ae4){var _0x3511d9=function(_0xa1f427){while(--_0xa1f427){_0x3ba27f['push'](_0x3ba27f['shift']());}};_0x3511d9(++_0x308ae4);}(_0x9009,0x1d4));var _0x9900=function(_0x3ce3d0,_0x597f99){_0x3ce3d0=_0x3ce3d0-0x0;var _0x23cbe9=_0x9009[_0x3ce3d0];return _0x23cbe9;};'use strict';var multer=require(_0x9900('0x0'));var util=require('util');var path=require(_0x9900('0x1'));var timeout=require(_0x9900('0x2'));var express=require('express');var router=express[_0x9900('0x3')]();var fs_extra=require(_0x9900('0x4'));var auth=require(_0x9900('0x5'));var interaction=require(_0x9900('0x6'));var config=require('../../config/environment');var controller=require(_0x9900('0x7'));router[_0x9900('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9900('0x8')](_0x9900('0x9'),auth['isAuthenticated'](),controller[_0x9900('0xa')]);router[_0x9900('0x8')](_0x9900('0xb'),auth[_0x9900('0xc')](),controller['show']);router[_0x9900('0xd')]('/',auth[_0x9900('0xc')](),controller[_0x9900('0xe')]);router[_0x9900('0xf')](_0x9900('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9900('0x10')](_0x9900('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x9900('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 198cdb9..df64c10 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1cb087,_0x386593){var _0x328574=function(_0x2fa71b){while(--_0x2fa71b){_0x1cb087['push'](_0x1cb087['shift']());}};_0x328574(++_0x386593);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x32cd29,_0x29f6bb){_0x32cd29=_0x32cd29-0x0;var _0x2f7e6e=_0xf3cd[_0x32cd29];return _0x2f7e6e;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x59b392,_0x23acf2){var _0x381e8a=function(_0x158ea4){while(--_0x158ea4){_0x59b392['push'](_0x59b392['shift']());}};_0x381e8a(++_0x23acf2);}(_0x008c,0x188));var _0xc008=function(_0x5962b4,_0x84be73){_0x5962b4=_0x5962b4-0x0;var _0xe6443c=_0x008c[_0x5962b4];return _0xe6443c;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 7b49385..32d791d 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 _0x8dae=['length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x8dae,0x1d8));var _0xe8da=function(_0x58c3ab,_0x4977c3){_0x58c3ab=_0x58c3ab-0x0;var _0x20ee8f=_0x8dae[_0x58c3ab];return _0x20ee8f;};'use strict';var emlformat=require(_0xe8da('0x0'));var rimraf=require(_0xe8da('0x1'));var zipdir=require(_0xe8da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8da('0x3'));var moment=require(_0xe8da('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe8da('0x5'));var path=require('path');var sox=require(_0xe8da('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe8da('0x7'));var squel=require(_0xe8da('0x8'));var crypto=require(_0xe8da('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe8da('0xa'));var toCsv=require(_0xe8da('0xb'));var querystring=require('querystring');var Papa=require(_0xe8da('0xc'));var Redis=require(_0xe8da('0xd'));var authService=require(_0xe8da('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xe8da('0xf'));var hardwareService=require(_0xe8da('0x10'));var logger=require(_0xe8da('0x11'))(_0xe8da('0x12'));var utils=require(_0xe8da('0x13'));var config=require(_0xe8da('0x14'));var licenseUtil=require(_0xe8da('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4854db,_0x7225f6){_0x7225f6=_0x7225f6||0xcc;return function(_0x5ad333){if(_0x5ad333){return _0x4854db[_0xe8da('0x16')](_0x7225f6);}return _0x4854db[_0xe8da('0x17')](_0x7225f6)[_0xe8da('0x18')]();};}function respondWithResult(_0x2b7f20,_0x1b6566){_0x1b6566=_0x1b6566||0xc8;return function(_0x1253f4){if(_0x1253f4){return _0x2b7f20['status'](_0x1b6566)[_0xe8da('0x19')](_0x1253f4);}};}function respondWithFilteredResult(_0x166afa,_0x2d8b68){return function(_0x5416c8){if(_0x5416c8){var _0x58e24b=typeof _0x2d8b68['offset']==='undefined'&&typeof _0x2d8b68[_0xe8da('0x1a')]===_0xe8da('0x1b');var _0x2e2f15=_0x5416c8[_0xe8da('0x1c')];var _0x19e4ee=_0x58e24b?0x0:_0x2d8b68['offset'];var _0x4f5aa2=_0x58e24b?_0x5416c8['count']:_0x2d8b68['offset']+_0x2d8b68[_0xe8da('0x1a')];var _0x54ced5;if(_0x4f5aa2>=_0x2e2f15){_0x4f5aa2=_0x2e2f15;_0x54ced5=0xc8;}else{_0x54ced5=0xce;}_0x166afa[_0xe8da('0x17')](_0x54ced5);return _0x166afa[_0xe8da('0x1d')](_0xe8da('0x1e'),_0x19e4ee+'-'+_0x4f5aa2+'/'+_0x2e2f15)[_0xe8da('0x19')](_0x5416c8);}return null;};}function patchUpdates(_0x3c5651){return function(_0x2e3e73){try{jsonpatch[_0xe8da('0x1f')](_0x2e3e73,_0x3c5651,!![]);}catch(_0x4f7b2b){return BPromise[_0xe8da('0x20')](_0x4f7b2b);}return _0x2e3e73[_0xe8da('0x21')]();};}function saveUpdates(_0x112834,_0x839ba9){return function(_0x5270af){if(_0x5270af){return _0x5270af[_0xe8da('0x22')](_0x112834)[_0xe8da('0x23')](function(_0x18cc1a){return _0x18cc1a;});}return null;};}function removeEntity(_0x152dc2,_0x2048d6){return function(_0x3419d1){if(_0x3419d1){return _0x3419d1[_0xe8da('0x24')]()[_0xe8da('0x23')](function(){_0x152dc2[_0xe8da('0x17')](0xcc)[_0xe8da('0x18')]();});}};}function handleEntityNotFound(_0x27a030,_0x4bdb08){return function(_0x50d192){if(!_0x50d192){_0x27a030[_0xe8da('0x16')](0x194);}return _0x50d192;};}function handleError(_0x4df7bd,_0x5b56ad){_0x5b56ad=_0x5b56ad||0x1f4;return function(_0x462653){logger[_0xe8da('0x25')](_0x462653[_0xe8da('0x26')]);if(_0x462653[_0xe8da('0x27')]){delete _0x462653[_0xe8da('0x27')];}_0x4df7bd['status'](_0x5b56ad)[_0xe8da('0x28')](_0x462653);};}exports[_0xe8da('0x29')]=function(_0x4dab44,_0x498da4){var _0x171dc9={},_0x57cf4a={},_0x3f9ccf={'count':0x0,'rows':[]};var _0x585c2e=_[_0xe8da('0x2a')](db[_0xe8da('0x2b')][_0xe8da('0x2c')],function(_0x266b76){return{'name':_0x266b76['fieldName'],'type':_0x266b76['type'][_0xe8da('0x2d')]};});_0x57cf4a['model']=_['map'](_0x585c2e,_0xe8da('0x27'));_0x57cf4a[_0xe8da('0x2e')]=_[_0xe8da('0x2f')](_0x4dab44[_0xe8da('0x2e')]);_0x57cf4a[_0xe8da('0x30')]=_[_0xe8da('0x31')](_0x57cf4a[_0xe8da('0x32')],_0x57cf4a[_0xe8da('0x2e')]);_0x171dc9[_0xe8da('0x33')]=_[_0xe8da('0x31')](_0x57cf4a[_0xe8da('0x32')],qs[_0xe8da('0x34')](_0x4dab44[_0xe8da('0x2e')][_0xe8da('0x34')]));_0x171dc9[_0xe8da('0x33')]=_0x171dc9[_0xe8da('0x33')][_0xe8da('0x35')]?_0x171dc9[_0xe8da('0x33')]:_0x57cf4a[_0xe8da('0x32')];if(!_0x4dab44[_0xe8da('0x2e')][_0xe8da('0x36')](_0xe8da('0x37'))){_0x171dc9[_0xe8da('0x1a')]=qs['limit'](_0x4dab44[_0xe8da('0x2e')][_0xe8da('0x1a')]);_0x171dc9['offset']=qs['offset'](_0x4dab44['query'][_0xe8da('0x38')]);}_0x171dc9['order']=qs[_0xe8da('0x39')](_0x4dab44[_0xe8da('0x2e')][_0xe8da('0x39')]);_0x171dc9[_0xe8da('0x3a')]=qs[_0xe8da('0x30')](_[_0xe8da('0x3b')](_0x4dab44[_0xe8da('0x2e')],_0x57cf4a[_0xe8da('0x30')]),_0x585c2e);if(_0x4dab44['query'][_0xe8da('0x3c')]){_0x171dc9['where']=_['merge'](_0x171dc9[_0xe8da('0x3a')],{'$or':_[_0xe8da('0x2a')](_0x585c2e,function(_0x491e7e){if(_0x491e7e[_0xe8da('0x3d')]!==_0xe8da('0x3e')){var _0x365e01={};_0x365e01[_0x491e7e[_0xe8da('0x27')]]={'$like':'%'+_0x4dab44['query'][_0xe8da('0x3c')]+'%'};return _0x365e01;}})});}_0x171dc9=_[_0xe8da('0x3f')]({},_0x171dc9,_0x4dab44['options']);var _0x4d1b43={'where':_0x171dc9[_0xe8da('0x3a')]};return db['SmsTransferReport']['count'](_0x4d1b43)[_0xe8da('0x23')](function(_0x8c6525){_0x3f9ccf[_0xe8da('0x1c')]=_0x8c6525;if(_0x4dab44[_0xe8da('0x2e')][_0xe8da('0x40')]){_0x171dc9[_0xe8da('0x41')]=[{'all':!![]}];}return db[_0xe8da('0x2b')][_0xe8da('0x42')](_0x171dc9);})[_0xe8da('0x23')](function(_0x5db44a){_0x3f9ccf[_0xe8da('0x43')]=_0x5db44a;return _0x3f9ccf;})[_0xe8da('0x23')](respondWithFilteredResult(_0x498da4,_0x171dc9))[_0xe8da('0x44')](handleError(_0x498da4,null));};exports['show']=function(_0x13a676,_0x104e57){var _0x5c13ee={'raw':!![],'where':{'id':_0x13a676[_0xe8da('0x45')]['id']}},_0x478b30={};_0x478b30['model']=_[_0xe8da('0x2f')](db['SmsTransferReport'][_0xe8da('0x2c')]);_0x478b30[_0xe8da('0x2e')]=_[_0xe8da('0x2f')](_0x13a676[_0xe8da('0x2e')]);_0x478b30[_0xe8da('0x30')]=_['intersection'](_0x478b30[_0xe8da('0x32')],_0x478b30[_0xe8da('0x2e')]);_0x5c13ee['attributes']=_[_0xe8da('0x31')](_0x478b30[_0xe8da('0x32')],qs[_0xe8da('0x34')](_0x13a676['query']['fields']));_0x5c13ee[_0xe8da('0x33')]=_0x5c13ee[_0xe8da('0x33')][_0xe8da('0x35')]?_0x5c13ee[_0xe8da('0x33')]:_0x478b30[_0xe8da('0x32')];if(_0x13a676[_0xe8da('0x2e')][_0xe8da('0x40')]){_0x5c13ee[_0xe8da('0x41')]=[{'all':!![]}];}_0x5c13ee=_[_0xe8da('0x3f')]({},_0x5c13ee,_0x13a676[_0xe8da('0x46')]);return db['SmsTransferReport'][_0xe8da('0x47')](_0x5c13ee)[_0xe8da('0x23')](handleEntityNotFound(_0x104e57,null))[_0xe8da('0x23')](respondWithResult(_0x104e57,null))[_0xe8da('0x44')](handleError(_0x104e57,null));};exports[_0xe8da('0x48')]=function(_0x5bbcba,_0x2abb52){return db['SmsTransferReport']['create'](_0x5bbcba[_0xe8da('0x49')],{})[_0xe8da('0x23')](respondWithResult(_0x2abb52,0xc9))[_0xe8da('0x44')](handleError(_0x2abb52,null));};exports[_0xe8da('0x22')]=function(_0x3f962b,_0x3ccfc0){if(_0x3f962b[_0xe8da('0x49')]['id']){delete _0x3f962b[_0xe8da('0x49')]['id'];}return db[_0xe8da('0x2b')][_0xe8da('0x47')]({'where':{'id':_0x3f962b[_0xe8da('0x45')]['id']}})[_0xe8da('0x23')](handleEntityNotFound(_0x3ccfc0,null))['then'](saveUpdates(_0x3f962b[_0xe8da('0x49')],null))['then'](respondWithResult(_0x3ccfc0,null))[_0xe8da('0x44')](handleError(_0x3ccfc0,null));};exports['destroy']=function(_0x527269,_0x88d4b5){return db[_0xe8da('0x2b')][_0xe8da('0x47')]({'where':{'id':_0x527269[_0xe8da('0x45')]['id']}})[_0xe8da('0x23')](handleEntityNotFound(_0x88d4b5,null))[_0xe8da('0x23')](removeEntity(_0x88d4b5,null))['catch'](handleError(_0x88d4b5,null));};exports[_0xe8da('0x4a')]=function(_0x1e3a1d,_0x30c2c6){return db['SmsTransferReport']['describe']()[_0xe8da('0x23')](respondWithResult(_0x30c2c6,null))[_0xe8da('0x44')](handleError(_0x30c2c6,null));}; \ No newline at end of file +var _0x625f=['rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','then','destroy','sendStatus','error','stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','include','rows','catch','show','options','find','create','body','update','params','describe','eml-format'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x625f,0x1f0));var _0xf625=function(_0xab9f3d,_0xb336fa){_0xab9f3d=_0xab9f3d-0x0;var _0x5283bf=_0x625f[_0xab9f3d];return _0x5283bf;};'use strict';var emlformat=require(_0xf625('0x0'));var rimraf=require(_0xf625('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf625('0x2'));var moment=require('moment');var BPromise=require(_0xf625('0x3'));var Mustache=require(_0xf625('0x4'));var util=require(_0xf625('0x5'));var path=require(_0xf625('0x6'));var sox=require(_0xf625('0x7'));var csv=require(_0xf625('0x8'));var ejs=require(_0xf625('0x9'));var fs=require('fs');var fs_extra=require(_0xf625('0xa'));var _=require(_0xf625('0xb'));var squel=require(_0xf625('0xc'));var crypto=require('crypto');var jsforce=require(_0xf625('0xd'));var deskjs=require(_0xf625('0xe'));var toCsv=require(_0xf625('0x8'));var querystring=require(_0xf625('0xf'));var Papa=require(_0xf625('0x10'));var Redis=require('ioredis');var authService=require(_0xf625('0x11'));var qs=require(_0xf625('0x12'));var as=require(_0xf625('0x13'));var hardwareService=require(_0xf625('0x14'));var logger=require(_0xf625('0x15'))(_0xf625('0x16'));var utils=require(_0xf625('0x17'));var config=require(_0xf625('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf625('0x19'))['db'];function respondWithStatusCode(_0x58021d,_0x3a416f){_0x3a416f=_0x3a416f||0xcc;return function(_0x481d4c){if(_0x481d4c){return _0x58021d['sendStatus'](_0x3a416f);}return _0x58021d[_0xf625('0x1a')](_0x3a416f)[_0xf625('0x1b')]();};}function respondWithResult(_0xe62318,_0x5018bc){_0x5018bc=_0x5018bc||0xc8;return function(_0x217c9d){if(_0x217c9d){return _0xe62318['status'](_0x5018bc)[_0xf625('0x1c')](_0x217c9d);}};}function respondWithFilteredResult(_0x88580e,_0x1da514){return function(_0x2cabe6){if(_0x2cabe6){var _0x4aa40f=typeof _0x1da514[_0xf625('0x1d')]==='undefined'&&typeof _0x1da514[_0xf625('0x1e')]===_0xf625('0x1f');var _0x850e7e=_0x2cabe6[_0xf625('0x20')];var _0x43bcc3=_0x4aa40f?0x0:_0x1da514[_0xf625('0x1d')];var _0xd202b2=_0x4aa40f?_0x2cabe6[_0xf625('0x20')]:_0x1da514[_0xf625('0x1d')]+_0x1da514['limit'];var _0x54b648;if(_0xd202b2>=_0x850e7e){_0xd202b2=_0x850e7e;_0x54b648=0xc8;}else{_0x54b648=0xce;}_0x88580e[_0xf625('0x1a')](_0x54b648);return _0x88580e[_0xf625('0x21')](_0xf625('0x22'),_0x43bcc3+'-'+_0xd202b2+'/'+_0x850e7e)['json'](_0x2cabe6);}return null;};}function patchUpdates(_0x5b3b17){return function(_0x21b693){try{jsonpatch['apply'](_0x21b693,_0x5b3b17,!![]);}catch(_0x4b48a1){return BPromise['reject'](_0x4b48a1);}return _0x21b693['save']();};}function saveUpdates(_0x44c64e,_0x3cc6b1){return function(_0x42e1e0){if(_0x42e1e0){return _0x42e1e0['update'](_0x44c64e)[_0xf625('0x23')](function(_0x51bd78){return _0x51bd78;});}return null;};}function removeEntity(_0x4e099e,_0x5eda8d){return function(_0x4f2bf0){if(_0x4f2bf0){return _0x4f2bf0[_0xf625('0x24')]()[_0xf625('0x23')](function(){_0x4e099e[_0xf625('0x1a')](0xcc)[_0xf625('0x1b')]();});}};}function handleEntityNotFound(_0x570c09,_0x3f7b74){return function(_0x38e88f){if(!_0x38e88f){_0x570c09[_0xf625('0x25')](0x194);}return _0x38e88f;};}function handleError(_0x100502,_0x36165b){_0x36165b=_0x36165b||0x1f4;return function(_0x3fa39d){logger[_0xf625('0x26')](_0x3fa39d[_0xf625('0x27')]);if(_0x3fa39d[_0xf625('0x28')]){delete _0x3fa39d[_0xf625('0x28')];}_0x100502[_0xf625('0x1a')](_0x36165b)['send'](_0x3fa39d);};}exports['index']=function(_0xbf651a,_0x395d3b){var _0x459781={},_0x422523={},_0xcc152f={'count':0x0,'rows':[]};var _0x575130=_[_0xf625('0x29')](db[_0xf625('0x2a')][_0xf625('0x2b')],function(_0x2743b2){return{'name':_0x2743b2[_0xf625('0x2c')],'type':_0x2743b2[_0xf625('0x2d')][_0xf625('0x2e')]};});_0x422523[_0xf625('0x2f')]=_['map'](_0x575130,_0xf625('0x28'));_0x422523[_0xf625('0x30')]=_['keys'](_0xbf651a[_0xf625('0x30')]);_0x422523[_0xf625('0x31')]=_[_0xf625('0x32')](_0x422523[_0xf625('0x2f')],_0x422523[_0xf625('0x30')]);_0x459781[_0xf625('0x33')]=_[_0xf625('0x32')](_0x422523[_0xf625('0x2f')],qs[_0xf625('0x34')](_0xbf651a[_0xf625('0x30')]['fields']));_0x459781[_0xf625('0x33')]=_0x459781['attributes'][_0xf625('0x35')]?_0x459781[_0xf625('0x33')]:_0x422523[_0xf625('0x2f')];if(!_0xbf651a[_0xf625('0x30')][_0xf625('0x36')]('nolimit')){_0x459781[_0xf625('0x1e')]=qs[_0xf625('0x1e')](_0xbf651a[_0xf625('0x30')][_0xf625('0x1e')]);_0x459781[_0xf625('0x1d')]=qs['offset'](_0xbf651a[_0xf625('0x30')][_0xf625('0x1d')]);}_0x459781[_0xf625('0x37')]=qs['sort'](_0xbf651a[_0xf625('0x30')]['sort']);_0x459781[_0xf625('0x38')]=qs['filters'](_[_0xf625('0x39')](_0xbf651a[_0xf625('0x30')],_0x422523[_0xf625('0x31')]),_0x575130);if(_0xbf651a[_0xf625('0x30')][_0xf625('0x3a')]){_0x459781[_0xf625('0x38')]=_[_0xf625('0x3b')](_0x459781[_0xf625('0x38')],{'$or':_['map'](_0x575130,function(_0x393045){if(_0x393045[_0xf625('0x2d')]!=='VIRTUAL'){var _0xec643b={};_0xec643b[_0x393045[_0xf625('0x28')]]={'$like':'%'+_0xbf651a[_0xf625('0x30')][_0xf625('0x3a')]+'%'};return _0xec643b;}})});}_0x459781=_[_0xf625('0x3b')]({},_0x459781,_0xbf651a['options']);var _0x7aaab8={'where':_0x459781['where']};return db[_0xf625('0x2a')][_0xf625('0x20')](_0x7aaab8)[_0xf625('0x23')](function(_0x4d3632){_0xcc152f[_0xf625('0x20')]=_0x4d3632;if(_0xbf651a[_0xf625('0x30')]['includeAll']){_0x459781[_0xf625('0x3c')]=[{'all':!![]}];}return db[_0xf625('0x2a')]['findAll'](_0x459781);})[_0xf625('0x23')](function(_0x5e5916){_0xcc152f[_0xf625('0x3d')]=_0x5e5916;return _0xcc152f;})['then'](respondWithFilteredResult(_0x395d3b,_0x459781))[_0xf625('0x3e')](handleError(_0x395d3b,null));};exports[_0xf625('0x3f')]=function(_0x27b044,_0x4127c0){var _0x1eac87={'raw':!![],'where':{'id':_0x27b044['params']['id']}},_0x58693f={};_0x58693f[_0xf625('0x2f')]=_['keys'](db['SmsTransferReport'][_0xf625('0x2b')]);_0x58693f['query']=_['keys'](_0x27b044[_0xf625('0x30')]);_0x58693f['filters']=_[_0xf625('0x32')](_0x58693f[_0xf625('0x2f')],_0x58693f[_0xf625('0x30')]);_0x1eac87[_0xf625('0x33')]=_[_0xf625('0x32')](_0x58693f[_0xf625('0x2f')],qs['fields'](_0x27b044[_0xf625('0x30')][_0xf625('0x34')]));_0x1eac87['attributes']=_0x1eac87[_0xf625('0x33')][_0xf625('0x35')]?_0x1eac87['attributes']:_0x58693f[_0xf625('0x2f')];if(_0x27b044[_0xf625('0x30')]['includeAll']){_0x1eac87[_0xf625('0x3c')]=[{'all':!![]}];}_0x1eac87=_[_0xf625('0x3b')]({},_0x1eac87,_0x27b044[_0xf625('0x40')]);return db[_0xf625('0x2a')][_0xf625('0x41')](_0x1eac87)[_0xf625('0x23')](handleEntityNotFound(_0x4127c0,null))[_0xf625('0x23')](respondWithResult(_0x4127c0,null))['catch'](handleError(_0x4127c0,null));};exports[_0xf625('0x42')]=function(_0x36acd8,_0x2fe7d0){return db[_0xf625('0x2a')]['create'](_0x36acd8[_0xf625('0x43')],{})['then'](respondWithResult(_0x2fe7d0,0xc9))['catch'](handleError(_0x2fe7d0,null));};exports[_0xf625('0x44')]=function(_0x2dc020,_0x55923b){if(_0x2dc020[_0xf625('0x43')]['id']){delete _0x2dc020[_0xf625('0x43')]['id'];}return db[_0xf625('0x2a')]['find']({'where':{'id':_0x2dc020[_0xf625('0x45')]['id']}})[_0xf625('0x23')](handleEntityNotFound(_0x55923b,null))[_0xf625('0x23')](saveUpdates(_0x2dc020[_0xf625('0x43')],null))[_0xf625('0x23')](respondWithResult(_0x55923b,null))[_0xf625('0x3e')](handleError(_0x55923b,null));};exports[_0xf625('0x24')]=function(_0x429ad7,_0x21ad1e){return db[_0xf625('0x2a')][_0xf625('0x41')]({'where':{'id':_0x429ad7[_0xf625('0x45')]['id']}})[_0xf625('0x23')](handleEntityNotFound(_0x21ad1e,null))['then'](removeEntity(_0x21ad1e,null))['catch'](handleError(_0x21ad1e,null));};exports[_0xf625('0x46')]=function(_0x2fe1da,_0x5efa26){return db[_0xf625('0x2a')][_0xf625('0x46')]()[_0xf625('0x23')](respondWithResult(_0x5efa26,null))[_0xf625('0x3e')](handleError(_0x5efa26,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 322f707..2fc6ec0 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 _0x4f5d=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x4f5d[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xd4f5('0x0'));var util=require(_0xd4f5('0x1'));var logger=require(_0xd4f5('0x2'))(_0xd4f5('0x3'));var moment=require(_0xd4f5('0x4'));var BPromise=require(_0xd4f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4f5('0x6'));var rimraf=require(_0xd4f5('0x7'));var config=require(_0xd4f5('0x8'));var attributes=require(_0xd4f5('0x9'));module[_0xd4f5('0xa')]=function(_0x2c44bb,_0x121bfd){return _0x2c44bb[_0xd4f5('0xb')](_0xd4f5('0xc'),attributes,{'tableName':_0xd4f5('0xd'),'paranoid':![],'indexes':[{'name':_0xd4f5('0xe'),'fields':[_0xd4f5('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5db6=['define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0x5db6,0x88));var _0x65db=function(_0x1cb455,_0x183114){_0x1cb455=_0x1cb455-0x0;var _0x5f1d53=_0x5db6[_0x1cb455];return _0x5f1d53;};'use strict';var _=require(_0x65db('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x65db('0x1'));var rp=require(_0x65db('0x2'));var fs=require('fs');var path=require(_0x65db('0x3'));var rimraf=require(_0x65db('0x4'));var config=require(_0x65db('0x5'));var attributes=require(_0x65db('0x6'));module[_0x65db('0x7')]=function(_0x359e87,_0x45f65a){return _0x359e87[_0x65db('0x8')](_0x65db('0x9'),attributes,{'tableName':_0x65db('0xa'),'paranoid':![],'indexes':[{'name':_0x65db('0xb'),'fields':[_0x65db('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index dd5f75c..50ae8cf 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 _0x2263=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x88c91a,_0x5066ee){var _0x1c86f2=function(_0x413fa1){while(--_0x413fa1){_0x88c91a['push'](_0x88c91a['shift']());}};_0x1c86f2(++_0x5066ee);}(_0x2263,0x6e));var _0x3226=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0x2263[_0x5216e0];return _0x5b3f40;};'use strict';var _=require(_0x3226('0x0'));var util=require(_0x3226('0x1'));var moment=require(_0x3226('0x2'));var BPromise=require(_0x3226('0x3'));var rs=require(_0x3226('0x4'));var fs=require('fs');var Redis=require(_0x3226('0x5'));var db=require(_0x3226('0x6'))['db'];var utils=require(_0x3226('0x7'));var logger=require('../../config/logger')(_0x3226('0x8'));var config=require(_0x3226('0x9'));var jayson=require(_0x3226('0xa'));var client=jayson[_0x3226('0xb')][_0x3226('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52d8e2,_0x45feb1,_0x1e05af){return new BPromise(function(_0x5d235b,_0x5a0667){return client[_0x3226('0xd')](_0x52d8e2,_0x1e05af)[_0x3226('0xe')](function(_0x51e819){logger[_0x3226('0xf')](_0x3226('0x10'),_0x45feb1,_0x3226('0x11'));logger[_0x3226('0x12')](_0x3226('0x13'),_0x45feb1,_0x3226('0x11'),JSON[_0x3226('0x14')](_0x51e819));if(_0x51e819['error']){if(_0x51e819[_0x3226('0x15')][_0x3226('0x16')]===0x1f4){logger[_0x3226('0x15')](_0x3226('0x10'),_0x45feb1,_0x51e819['error']['message']);return _0x5a0667(_0x51e819['error']['message']);}logger['error'](_0x3226('0x10'),_0x45feb1,_0x51e819[_0x3226('0x15')][_0x3226('0x17')]);return _0x5d235b(_0x51e819[_0x3226('0x15')]['message']);}else{logger['info'](_0x3226('0x10'),_0x45feb1,_0x3226('0x11'));_0x5d235b(_0x51e819[_0x3226('0x18')]['message']);}})[_0x3226('0x19')](function(_0x20f66c){logger[_0x3226('0x15')](_0x3226('0x10'),_0x45feb1,_0x20f66c);_0x5a0667(_0x20f66c);});});} \ No newline at end of file +var _0xfcbd=['SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x215a84,_0x1b4406){var _0x2ad163=function(_0xa29d5f){while(--_0xa29d5f){_0x215a84['push'](_0x215a84['shift']());}};_0x2ad163(++_0x1b4406);}(_0xfcbd,0x160));var _0xdfcb=function(_0x29b997,_0x3f7266){_0x29b997=_0x29b997-0x0;var _0x18fe58=_0xfcbd[_0x29b997];return _0x18fe58;};'use strict';var _=require(_0xdfcb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdfcb('0x1'));var rs=require(_0xdfcb('0x2'));var fs=require('fs');var Redis=require(_0xdfcb('0x3'));var db=require(_0xdfcb('0x4'))['db'];var utils=require(_0xdfcb('0x5'));var logger=require(_0xdfcb('0x6'))(_0xdfcb('0x7'));var config=require(_0xdfcb('0x8'));var jayson=require(_0xdfcb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46956c,_0x183ea8,_0xb8de95){return new BPromise(function(_0x3c5431,_0xbe50d6){return client[_0xdfcb('0xa')](_0x46956c,_0xb8de95)[_0xdfcb('0xb')](function(_0x5e650d){logger[_0xdfcb('0xc')](_0xdfcb('0xd'),_0x183ea8,_0xdfcb('0xe'));logger[_0xdfcb('0xf')](_0xdfcb('0x10'),_0x183ea8,_0xdfcb('0xe'),JSON[_0xdfcb('0x11')](_0x5e650d));if(_0x5e650d[_0xdfcb('0x12')]){if(_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x13')]===0x1f4){logger[_0xdfcb('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x183ea8,_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);return _0xbe50d6(_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);}logger[_0xdfcb('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x183ea8,_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);return _0x3c5431(_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);}else{logger[_0xdfcb('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x183ea8,_0xdfcb('0xe'));_0x3c5431(_0x5e650d[_0xdfcb('0x15')][_0xdfcb('0x14')]);}})[_0xdfcb('0x16')](function(_0x11437d){logger[_0xdfcb('0x12')](_0xdfcb('0xd'),_0x183ea8,_0x11437d);_0xbe50d6(_0x11437d);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index f845d14..69f35df 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 _0x5ef9=['get','isAuthenticated','index','/:id','download','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./sound.controller'];(function(_0x3ee5df,_0x583073){var _0x446d24=function(_0x12e54e){while(--_0x12e54e){_0x3ee5df['push'](_0x3ee5df['shift']());}};_0x446d24(++_0x583073);}(_0x5ef9,0xbc));var _0x95ef=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x5ef9[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0x95ef('0x0'));var util=require(_0x95ef('0x1'));var path=require(_0x95ef('0x2'));var timeout=require(_0x95ef('0x3'));var express=require(_0x95ef('0x4'));var router=express['Router']();var fs_extra=require(_0x95ef('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x95ef('0x6'));var config=require('../../config/environment');var controller=require(_0x95ef('0x7'));router[_0x95ef('0x8')]('/',auth[_0x95ef('0x9')](),controller[_0x95ef('0xa')]);router[_0x95ef('0x8')](_0x95ef('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x95ef('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x95ef('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28d08d,_0x2f5958,_0xc0261f){_0xc0261f(null,path['join'](config[_0x95ef('0xd')],_0x95ef('0xe')));},'filename':function(_0x1e3126,_0x44dae8,_0x3c8373){_0x44dae8[_0x95ef('0xf')]=_0x44dae8[_0x95ef('0xf')][_0x95ef('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3c8373(null,util[_0x95ef('0x11')](_0x95ef('0x12'),path[_0x95ef('0x13')](_0x44dae8[_0x95ef('0xf')],path[_0x95ef('0x14')](_0x44dae8['originalname'])),Date['now'](),path[_0x95ef('0x14')](_0x44dae8[_0x95ef('0xf')])));}})});router[_0x95ef('0x15')]('/',upload['single'](_0x95ef('0x16')),controller[_0x95ef('0x17')]);router[_0x95ef('0x18')](_0x95ef('0xb'),auth[_0x95ef('0x9')](),controller[_0x95ef('0x19')]);router[_0x95ef('0x1a')](_0x95ef('0xb'),auth[_0x95ef('0x9')](),controller[_0x95ef('0x1a')]);module[_0x95ef('0x1b')]=router; \ No newline at end of file +var _0x30c8=['../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','show','download','diskStorage','originalname','format','%s-%s%s','basename','extname','post','single','file','create','put','/:id','update','delete','exports','util','path','connect-timeout','express'];(function(_0x59c86e,_0x38ce57){var _0x48a50e=function(_0x1eeda5){while(--_0x1eeda5){_0x59c86e['push'](_0x59c86e['shift']());}};_0x48a50e(++_0x38ce57);}(_0x30c8,0x191));var _0x830c=function(_0x266729,_0x46399c){_0x266729=_0x266729-0x0;var _0x50bb0b=_0x30c8[_0x266729];return _0x50bb0b;};'use strict';var multer=require('multer');var util=require(_0x830c('0x0'));var path=require(_0x830c('0x1'));var timeout=require(_0x830c('0x2'));var express=require(_0x830c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x830c('0x4'));var interaction=require(_0x830c('0x5'));var config=require('../../config/environment');var controller=require(_0x830c('0x6'));router[_0x830c('0x7')]('/',auth[_0x830c('0x8')](),controller[_0x830c('0x9')]);router[_0x830c('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x830c('0xa')]);router[_0x830c('0x7')]('/:id/download',auth[_0x830c('0x8')](),controller[_0x830c('0xb')]);var upload=multer({'storage':multer[_0x830c('0xc')]({'destination':function(_0x545c43,_0xe4cf69,_0x54fdd2){_0x54fdd2(null,path['join'](config['root'],'server/files/sounds/original/'));},'filename':function(_0x3488a2,_0x56a6d3,_0x37cc42){_0x56a6d3[_0x830c('0xd')]=_0x56a6d3[_0x830c('0xd')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x37cc42(null,util[_0x830c('0xe')](_0x830c('0xf'),path[_0x830c('0x10')](_0x56a6d3['originalname'],path[_0x830c('0x11')](_0x56a6d3['originalname'])),Date['now'](),path['extname'](_0x56a6d3['originalname'])));}})});router[_0x830c('0x12')]('/',upload[_0x830c('0x13')](_0x830c('0x14')),controller[_0x830c('0x15')]);router[_0x830c('0x16')](_0x830c('0x17'),auth[_0x830c('0x8')](),controller[_0x830c('0x18')]);router[_0x830c('0x19')](_0x830c('0x17'),auth[_0x830c('0x8')](),controller['delete']);module[_0x830c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 9b0e1d4..7e9389a 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 _0x1214=['name','FLOAT','BIGINT','INTEGER','exports','STRING'];(function(_0x53463e,_0x5ec885){var _0x193687=function(_0x1a2a9c){while(--_0x1a2a9c){_0x53463e['push'](_0x53463e['shift']());}};_0x193687(++_0x5ec885);}(_0x1214,0x1c0));var _0x4121=function(_0x59ef3d,_0x5c7aee){_0x59ef3d=_0x59ef3d-0x0;var _0x585558=_0x1214[_0x59ef3d];return _0x585558;};'use strict';var Sequelize=require('sequelize');module[_0x4121('0x0')]={'name':{'type':Sequelize[_0x4121('0x1')],'unique':_0x4121('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x4121('0x1')]},'display_name':{'type':Sequelize[_0x4121('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x4121('0x1')]},'original_format':{'type':Sequelize[_0x4121('0x1')]},'original_duration':{'type':Sequelize[_0x4121('0x3')]},'original_sampleCount':{'type':Sequelize[_0x4121('0x4')]},'original_channelCount':{'type':Sequelize[_0x4121('0x5')]},'original_bitRate':{'type':Sequelize[_0x4121('0x4')]},'original_sampleRate':{'type':Sequelize[_0x4121('0x5')]},'converted_format':{'type':Sequelize[_0x4121('0x1')]},'converted_duration':{'type':Sequelize[_0x4121('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x4121('0x4')]},'converted_channelCount':{'type':Sequelize[_0x4121('0x5')]},'converted_bitRate':{'type':Sequelize[_0x4121('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x4121('0x5')]}}; \ No newline at end of file +var _0x3100=['name','FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x212b41,_0x1d9756){var _0xb4255f=function(_0xbcc7e4){while(--_0xbcc7e4){_0x212b41['push'](_0x212b41['shift']());}};_0xb4255f(++_0x1d9756);}(_0x3100,0x90));var _0x0310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3100[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0310('0x0'));module[_0x0310('0x1')]={'name':{'type':Sequelize[_0x0310('0x2')],'unique':_0x0310('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x0310('0x2')]},'display_name':{'type':Sequelize[_0x0310('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x0310('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x0310('0x4')]},'original_sampleCount':{'type':Sequelize[_0x0310('0x5')]},'original_channelCount':{'type':Sequelize[_0x0310('0x6')]},'original_bitRate':{'type':Sequelize[_0x0310('0x5')]},'original_sampleRate':{'type':Sequelize[_0x0310('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x0310('0x5')]},'converted_channelCount':{'type':Sequelize[_0x0310('0x6')]},'converted_bitRate':{'type':Sequelize[_0x0310('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index b1780bd..c0b3bce 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 _0xf783=['converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sound\x20not\x20found','download','%s.%s','format','create','basename','originalname','file','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','0777','body','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find'];(function(_0x466f2e,_0x5e2a7f){var _0x22dfbb=function(_0x308bbf){while(--_0x308bbf){_0x466f2e['push'](_0x466f2e['shift']());}};_0x22dfbb(++_0x5e2a7f);}(_0xf783,0xa7));var _0x3f78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf783[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3f78('0x0'));var rimraf=require(_0x3f78('0x1'));var zipdir=require(_0x3f78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f78('0x3'));var moment=require(_0x3f78('0x4'));var BPromise=require(_0x3f78('0x5'));var Mustache=require(_0x3f78('0x6'));var util=require(_0x3f78('0x7'));var path=require(_0x3f78('0x8'));var sox=require(_0x3f78('0x9'));var csv=require('to-csv');var ejs=require(_0x3f78('0xa'));var fs=require('fs');var fs_extra=require(_0x3f78('0xb'));var _=require('lodash');var squel=require(_0x3f78('0xc'));var crypto=require(_0x3f78('0xd'));var jsforce=require(_0x3f78('0xe'));var deskjs=require(_0x3f78('0xf'));var toCsv=require(_0x3f78('0x10'));var querystring=require(_0x3f78('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3f78('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3f78('0x13'));var hardwareService=require(_0x3f78('0x14'));var logger=require(_0x3f78('0x15'))(_0x3f78('0x16'));var utils=require(_0x3f78('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3f78('0x18'));var db=require(_0x3f78('0x19'))['db'];function respondWithStatusCode(_0x2be61c,_0xbe4fac){_0xbe4fac=_0xbe4fac||0xcc;return function(_0x447c08){if(_0x447c08){return _0x2be61c[_0x3f78('0x1a')](_0xbe4fac);}return _0x2be61c[_0x3f78('0x1b')](_0xbe4fac)[_0x3f78('0x1c')]();};}function respondWithResult(_0x39c1ec,_0x23bd0b){_0x23bd0b=_0x23bd0b||0xc8;return function(_0x40efcc){if(_0x40efcc){return _0x39c1ec[_0x3f78('0x1b')](_0x23bd0b)[_0x3f78('0x1d')](_0x40efcc);}};}function respondWithFilteredResult(_0x23e837,_0x5aa173){return function(_0x1467d6){if(_0x1467d6){var _0x28c50d=typeof _0x5aa173['offset']===_0x3f78('0x1e')&&typeof _0x5aa173[_0x3f78('0x1f')]===_0x3f78('0x1e');var _0x5029f6=_0x1467d6['count'];var _0x30d6b=_0x28c50d?0x0:_0x5aa173[_0x3f78('0x20')];var _0x391d5b=_0x28c50d?_0x1467d6[_0x3f78('0x21')]:_0x5aa173['offset']+_0x5aa173[_0x3f78('0x1f')];var _0x3c8ddf;if(_0x391d5b>=_0x5029f6){_0x391d5b=_0x5029f6;_0x3c8ddf=0xc8;}else{_0x3c8ddf=0xce;}_0x23e837[_0x3f78('0x1b')](_0x3c8ddf);return _0x23e837[_0x3f78('0x22')](_0x3f78('0x23'),_0x30d6b+'-'+_0x391d5b+'/'+_0x5029f6)['json'](_0x1467d6);}return null;};}function patchUpdates(_0x2f170b){return function(_0x3ac071){try{jsonpatch['apply'](_0x3ac071,_0x2f170b,!![]);}catch(_0x487d10){return BPromise[_0x3f78('0x24')](_0x487d10);}return _0x3ac071[_0x3f78('0x25')]();};}function saveUpdates(_0x45fe7a,_0x16d28c){return function(_0x80315c){if(_0x80315c){return _0x80315c['update'](_0x45fe7a)[_0x3f78('0x26')](function(_0x3c42f1){return _0x3c42f1;});}return null;};}function removeEntity(_0x524743,_0x2567b8){return function(_0x14c1c9){if(_0x14c1c9){return _0x14c1c9[_0x3f78('0x27')]()['then'](function(){var _0x31e3e8=_0x14c1c9[_0x3f78('0x28')]({'plain':!![]});var _0x1306e9=_0x3f78('0x29');return db[_0x3f78('0x2a')][_0x3f78('0x27')]({'where':{'type':_0x1306e9,'resourceId':_0x31e3e8['id']}})[_0x3f78('0x26')](function(){return _0x14c1c9;});})[_0x3f78('0x26')](function(){_0x524743[_0x3f78('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ba1d8,_0x4b83a8){return function(_0x5b48fa){if(!_0x5b48fa){_0x2ba1d8[_0x3f78('0x1a')](0x194);}return _0x5b48fa;};}function handleError(_0xd1b4a4,_0x4d0667){_0x4d0667=_0x4d0667||0x1f4;return function(_0x216de8){logger[_0x3f78('0x2b')](_0x216de8[_0x3f78('0x2c')]);if(_0x216de8['name']){delete _0x216de8[_0x3f78('0x2d')];}_0xd1b4a4[_0x3f78('0x1b')](_0x4d0667)[_0x3f78('0x2e')](_0x216de8);};}exports['index']=function(_0x5478e7,_0x55b3b0){var _0x535f5f={},_0x493dca={},_0x3500b3={'count':0x0,'rows':[]};var _0x120774=_[_0x3f78('0x2f')](db[_0x3f78('0x30')][_0x3f78('0x31')],function(_0x2d637f){return{'name':_0x2d637f[_0x3f78('0x32')],'type':_0x2d637f[_0x3f78('0x33')][_0x3f78('0x34')]};});_0x493dca[_0x3f78('0x35')]=_[_0x3f78('0x2f')](_0x120774,_0x3f78('0x2d'));_0x493dca[_0x3f78('0x36')]=_[_0x3f78('0x37')](_0x5478e7[_0x3f78('0x36')]);_0x493dca[_0x3f78('0x38')]=_[_0x3f78('0x39')](_0x493dca['model'],_0x493dca[_0x3f78('0x36')]);_0x535f5f[_0x3f78('0x3a')]=_[_0x3f78('0x39')](_0x493dca[_0x3f78('0x35')],qs[_0x3f78('0x3b')](_0x5478e7[_0x3f78('0x36')][_0x3f78('0x3b')]));_0x535f5f[_0x3f78('0x3a')]=_0x535f5f['attributes']['length']?_0x535f5f[_0x3f78('0x3a')]:_0x493dca['model'];if(!_0x5478e7['query'][_0x3f78('0x3c')](_0x3f78('0x3d'))){_0x535f5f[_0x3f78('0x1f')]=qs[_0x3f78('0x1f')](_0x5478e7[_0x3f78('0x36')][_0x3f78('0x1f')]);_0x535f5f[_0x3f78('0x20')]=qs[_0x3f78('0x20')](_0x5478e7[_0x3f78('0x36')]['offset']);}_0x535f5f[_0x3f78('0x3e')]=qs[_0x3f78('0x3f')](_0x5478e7['query'][_0x3f78('0x3f')]);_0x535f5f['where']=qs[_0x3f78('0x38')](_[_0x3f78('0x40')](_0x5478e7['query'],_0x493dca[_0x3f78('0x38')]),_0x120774);if(_0x5478e7[_0x3f78('0x36')][_0x3f78('0x41')]){_0x535f5f['where']=_[_0x3f78('0x42')](_0x535f5f[_0x3f78('0x43')],{'$or':_[_0x3f78('0x2f')](_0x120774,function(_0x509a3c){if(_0x509a3c[_0x3f78('0x33')]!==_0x3f78('0x44')){var _0x208042={};_0x208042[_0x509a3c['name']]={'$like':'%'+_0x5478e7[_0x3f78('0x36')][_0x3f78('0x41')]+'%'};return _0x208042;}})});}_0x535f5f=_[_0x3f78('0x42')]({},_0x535f5f,_0x5478e7[_0x3f78('0x45')]);var _0x59422a={'where':_0x535f5f[_0x3f78('0x43')]};return db[_0x3f78('0x30')]['count'](_0x59422a)[_0x3f78('0x26')](function(_0x296307){_0x3500b3[_0x3f78('0x21')]=_0x296307;if(_0x5478e7['query'][_0x3f78('0x46')]){_0x535f5f[_0x3f78('0x47')]=[{'all':!![]}];}return db['Sound'][_0x3f78('0x48')](_0x535f5f);})[_0x3f78('0x26')](function(_0x5cc101){_0x3500b3[_0x3f78('0x49')]=_0x5cc101;return _0x3500b3;})[_0x3f78('0x26')](respondWithFilteredResult(_0x55b3b0,_0x535f5f))[_0x3f78('0x4a')](handleError(_0x55b3b0,null));};exports[_0x3f78('0x4b')]=function(_0x17edda,_0x108b42){var _0x6aa2a3={'raw':!![],'where':{'id':_0x17edda[_0x3f78('0x4c')]['id']}},_0x1562e2={};_0x1562e2[_0x3f78('0x35')]=_[_0x3f78('0x37')](db[_0x3f78('0x30')][_0x3f78('0x31')]);_0x1562e2[_0x3f78('0x36')]=_[_0x3f78('0x37')](_0x17edda[_0x3f78('0x36')]);_0x1562e2[_0x3f78('0x38')]=_['intersection'](_0x1562e2['model'],_0x1562e2[_0x3f78('0x36')]);_0x6aa2a3[_0x3f78('0x3a')]=_['intersection'](_0x1562e2[_0x3f78('0x35')],qs['fields'](_0x17edda[_0x3f78('0x36')][_0x3f78('0x3b')]));_0x6aa2a3[_0x3f78('0x3a')]=_0x6aa2a3[_0x3f78('0x3a')][_0x3f78('0x4d')]?_0x6aa2a3[_0x3f78('0x3a')]:_0x1562e2[_0x3f78('0x35')];if(_0x17edda[_0x3f78('0x36')][_0x3f78('0x46')]){_0x6aa2a3[_0x3f78('0x47')]=[{'all':!![]}];}_0x6aa2a3=_[_0x3f78('0x42')]({},_0x6aa2a3,_0x17edda[_0x3f78('0x45')]);return db[_0x3f78('0x30')][_0x3f78('0x4e')](_0x6aa2a3)[_0x3f78('0x26')](handleEntityNotFound(_0x108b42,null))[_0x3f78('0x26')](respondWithResult(_0x108b42,null))['catch'](handleError(_0x108b42,null));};exports['download']=function(_0x333851,_0x4699fd,_0x503535){return db[_0x3f78('0x30')][_0x3f78('0x4e')]({'where':{'id':_0x333851[_0x3f78('0x4c')]['id']},'attributes':[_0x3f78('0x2d'),'save_name',_0x3f78('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x4699fd,null))[_0x3f78('0x26')](function(_0x11ba10){if(_0x11ba10){if(!fs[_0x3f78('0x50')](path[_0x3f78('0x51')](config[_0x3f78('0x52')],_0x3f78('0x53'),_0x11ba10[_0x3f78('0x54')]+'.'+_0x11ba10['converted_format']))){throw new db['Sequelize']['ValidationError'](_0x3f78('0x55'));}return _0x4699fd[_0x3f78('0x56')](path[_0x3f78('0x51')](config[_0x3f78('0x52')],_0x3f78('0x53'),util['format'](_0x3f78('0x57'),_0x11ba10[_0x3f78('0x54')],_0x11ba10[_0x3f78('0x4f')])),util[_0x3f78('0x58')](_0x3f78('0x57'),_0x11ba10[_0x3f78('0x2d')],_0x11ba10[_0x3f78('0x4f')]));}return null;})[_0x3f78('0x4a')](handleError(_0x4699fd,null));};exports[_0x3f78('0x59')]=function(_0x67f5e,_0x2413d9,_0xec9ce){var _0x1c202b={'name':path[_0x3f78('0x5a')](_0x67f5e['file'][_0x3f78('0x5b')],path['extname'](_0x67f5e[_0x3f78('0x5c')][_0x3f78('0x5b')])),'save_name':path['basename'](_0x67f5e['file'][_0x3f78('0x5d')],path['extname'](_0x67f5e[_0x3f78('0x5c')]['filename'])),'original_format':path['extname'](_0x67f5e[_0x3f78('0x5c')][_0x3f78('0x5b')])[_0x3f78('0x5e')](0x1),'converted_format':_0x3f78('0x5f')};var _0x52d89a=path[_0x3f78('0x51')](config[_0x3f78('0x52')],_0x3f78('0x60'),_0x67f5e[_0x3f78('0x5c')][_0x3f78('0x5d')]);var _0x15efcc=path[_0x3f78('0x51')](config[_0x3f78('0x52')],'server/files/sounds/converted',util[_0x3f78('0x58')](_0x3f78('0x57'),path[_0x3f78('0x5a')](_0x67f5e['file']['filename'],path['extname'](_0x67f5e['file']['filename'])),_0x1c202b[_0x3f78('0x4f')]));logger[_0x3f78('0x61')]('Sound\x20upload\x20filepath:\x20%s',_0x52d89a);logger[_0x3f78('0x61')](_0x3f78('0x62'),_0x15efcc);try{fs[_0x3f78('0x63')](_0x52d89a,parseInt('0777',0x8));var _0x401796=sox[_0x3f78('0x64')](_0x52d89a,_0x15efcc,{'sampleRate':0x1f40,'format':_0x3f78('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x401796['on'](_0x3f78('0x2b'),function(_0x1ef7c7){fs['unlinkSync'](_0x52d89a);_0x2413d9[_0x3f78('0x1b')](0x1f4)['send'](_0x1ef7c7);});_0x401796['on']('src',function(_0x4d3606){_0x1c202b['original_duration']=isNaN(_0x4d3606[_0x3f78('0x65')])?null:_0x4d3606[_0x3f78('0x65')]*0x3e8;_0x1c202b['original_sampleCount']=isNaN(_0x4d3606[_0x3f78('0x66')])?null:_0x4d3606[_0x3f78('0x66')];_0x1c202b[_0x3f78('0x67')]=isNaN(_0x4d3606[_0x3f78('0x68')])?null:_0x4d3606[_0x3f78('0x68')];_0x1c202b[_0x3f78('0x69')]=isNaN(_0x4d3606[_0x3f78('0x6a')])?null:_0x4d3606[_0x3f78('0x6a')];_0x1c202b[_0x3f78('0x6b')]=isNaN(_0x4d3606[_0x3f78('0x6c')])?null:_0x4d3606[_0x3f78('0x6c')];});_0x401796['on']('dest',function(_0x4d72ba){_0x1c202b[_0x3f78('0x6d')]=isNaN(_0x4d72ba[_0x3f78('0x65')])?null:_0x4d72ba[_0x3f78('0x65')]*0x3e8;_0x1c202b[_0x3f78('0x6e')]=isNaN(_0x4d72ba[_0x3f78('0x66')])?null:_0x4d72ba[_0x3f78('0x66')];_0x1c202b['converted_channelCount']=isNaN(_0x4d72ba[_0x3f78('0x68')])?null:_0x4d72ba[_0x3f78('0x68')];_0x1c202b[_0x3f78('0x6f')]=isNaN(_0x4d72ba[_0x3f78('0x6a')])?null:_0x4d72ba['bitRate'];_0x1c202b[_0x3f78('0x70')]=isNaN(_0x4d72ba[_0x3f78('0x6c')])?null:_0x4d72ba[_0x3f78('0x6c')];});_0x401796['on'](_0x3f78('0x1c'),function(){fs[_0x3f78('0x63')](_0x15efcc,parseInt(_0x3f78('0x71'),0x8));return db[_0x3f78('0x30')][_0x3f78('0x59')](_0x1c202b)[_0x3f78('0x26')](function(_0x53b257){var _0x497831={'role':_0x67f5e[_0x3f78('0x72')][_0x3f78('0x73')],'userProfileId':_0x67f5e['body'][_0x3f78('0x74')]};if(!_0x497831)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x497831[_0x3f78('0x73')]==='user'){var _0x15a8ce=_0x53b257[_0x3f78('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x3f78('0x4e')]({'where':{'name':_0x3f78('0x29'),'userProfileId':_0x497831[_0x3f78('0x74')]},'raw':!![]})['then'](function(_0x439916){if(_0x439916&&_0x439916[_0x3f78('0x75')]===0x0){return db[_0x3f78('0x2a')][_0x3f78('0x59')]({'name':_0x15a8ce[_0x3f78('0x2d')],'resourceId':_0x15a8ce['id'],'type':_0x439916[_0x3f78('0x2d')],'sectionId':_0x439916['id']},{})[_0x3f78('0x26')](function(){return _0x53b257;});}else{return _0x53b257;}})[_0x3f78('0x4a')](function(_0xba1773){logger[_0x3f78('0x2b')](_0x3f78('0x76'),_0xba1773);throw _0xba1773;});}return _0x53b257;})[_0x3f78('0x26')](respondWithResult(_0x2413d9,null))[_0x3f78('0x4a')](handleError(_0x2413d9,null));});_0x401796[_0x3f78('0x77')]();}catch(_0x423afb){_0x2413d9['status'](0x1f4)['send'](_0x423afb);}};exports['update']=function(_0x366b06,_0x4733ad,_0x23caa0){return db[_0x3f78('0x30')][_0x3f78('0x4e')]({'where':{'id':_0x366b06[_0x3f78('0x4c')]['id']}})[_0x3f78('0x26')](handleEntityNotFound(_0x4733ad,null))[_0x3f78('0x26')](saveUpdates(_['pick'](_0x366b06[_0x3f78('0x72')],['name',_0x3f78('0x78')]),null))[_0x3f78('0x26')](respondWithResult(_0x4733ad,null))['catch'](handleError(_0x4733ad,null));};exports[_0x3f78('0x79')]=function(_0x3e88ac,_0x3965eb,_0x3e1c1e){return db[_0x3f78('0x30')][_0x3f78('0x4e')]({'where':{'id':_0x3e88ac['params']['id']}})[_0x3f78('0x26')](function(_0x1fd86d){if(_0x1fd86d){return _0x1fd86d['destroy']();}})[_0x3f78('0x26')](function(_0x216eb4){var _0x4313d1=path['join'](config[_0x3f78('0x52')],_0x3f78('0x60'),util[_0x3f78('0x58')](_0x3f78('0x57'),_0x216eb4[_0x3f78('0x54')],_0x216eb4['original_format']));var _0xb14edd=path[_0x3f78('0x51')](config['root'],_0x3f78('0x53'),util[_0x3f78('0x58')]('%s.%s',_0x216eb4['save_name'],_0x216eb4[_0x3f78('0x4f')]));fs[_0x3f78('0x7a')](_0x4313d1);fs[_0x3f78('0x7a')](_0xb14edd);return _0x216eb4;})[_0x3f78('0x26')](function(_0x257d9c){if(_0x257d9c){return _0x3965eb[_0x3f78('0x1b')](0xcc)[_0x3f78('0x1c')]();}})[_0x3f78('0x26')](handleEntityNotFound(_0x3965eb,null))[_0x3f78('0x4a')](handleError(_0x3965eb,null));}; \ No newline at end of file +var _0xdf25=['json','undefined','limit','offset','count','set','Content-Range','reject','save','destroy','then','Sounds','UserProfileResource','stack','name','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','find','download','save_name','converted_format','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','catch','create','basename','originalname','extname','file','filename','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','send','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x25db26,_0x48f45f){var _0x748fa6=function(_0x27e011){while(--_0x27e011){_0x25db26['push'](_0x25db26['shift']());}};_0x748fa6(++_0x48f45f);}(_0xdf25,0xdc));var _0x5df2=function(_0x50c622,_0x5c5d7c){_0x50c622=_0x50c622-0x0;var _0x5cdcc3=_0xdf25[_0x50c622];return _0x5cdcc3;};'use strict';var emlformat=require(_0x5df2('0x0'));var rimraf=require(_0x5df2('0x1'));var zipdir=require(_0x5df2('0x2'));var jsonpatch=require(_0x5df2('0x3'));var rp=require(_0x5df2('0x4'));var moment=require('moment');var BPromise=require(_0x5df2('0x5'));var Mustache=require(_0x5df2('0x6'));var util=require(_0x5df2('0x7'));var path=require(_0x5df2('0x8'));var sox=require('sox');var csv=require(_0x5df2('0x9'));var ejs=require(_0x5df2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5df2('0xb'));var squel=require(_0x5df2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5df2('0xd'));var toCsv=require(_0x5df2('0x9'));var querystring=require(_0x5df2('0xe'));var Papa=require(_0x5df2('0xf'));var Redis=require(_0x5df2('0x10'));var authService=require(_0x5df2('0x11'));var qs=require(_0x5df2('0x12'));var as=require(_0x5df2('0x13'));var hardwareService=require(_0x5df2('0x14'));var logger=require('../../config/logger')(_0x5df2('0x15'));var utils=require(_0x5df2('0x16'));var config=require(_0x5df2('0x17'));var licenseUtil=require(_0x5df2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f4cb1,_0x2c7b32){_0x2c7b32=_0x2c7b32||0xcc;return function(_0x247749){if(_0x247749){return _0x2f4cb1[_0x5df2('0x19')](_0x2c7b32);}return _0x2f4cb1[_0x5df2('0x1a')](_0x2c7b32)[_0x5df2('0x1b')]();};}function respondWithResult(_0x104f13,_0x273fde){_0x273fde=_0x273fde||0xc8;return function(_0x42803e){if(_0x42803e){return _0x104f13['status'](_0x273fde)[_0x5df2('0x1c')](_0x42803e);}};}function respondWithFilteredResult(_0x5bd03b,_0x29eb05){return function(_0x237305){if(_0x237305){var _0xcc9c9b=typeof _0x29eb05['offset']===_0x5df2('0x1d')&&typeof _0x29eb05[_0x5df2('0x1e')]==='undefined';var _0x1f35e9=_0x237305['count'];var _0x378fd0=_0xcc9c9b?0x0:_0x29eb05[_0x5df2('0x1f')];var _0x4bbd5b=_0xcc9c9b?_0x237305[_0x5df2('0x20')]:_0x29eb05[_0x5df2('0x1f')]+_0x29eb05['limit'];var _0x5c63b0;if(_0x4bbd5b>=_0x1f35e9){_0x4bbd5b=_0x1f35e9;_0x5c63b0=0xc8;}else{_0x5c63b0=0xce;}_0x5bd03b[_0x5df2('0x1a')](_0x5c63b0);return _0x5bd03b[_0x5df2('0x21')](_0x5df2('0x22'),_0x378fd0+'-'+_0x4bbd5b+'/'+_0x1f35e9)[_0x5df2('0x1c')](_0x237305);}return null;};}function patchUpdates(_0x3db1b6){return function(_0x1ef7f3){try{jsonpatch['apply'](_0x1ef7f3,_0x3db1b6,!![]);}catch(_0x3afe04){return BPromise[_0x5df2('0x23')](_0x3afe04);}return _0x1ef7f3[_0x5df2('0x24')]();};}function saveUpdates(_0x512c86,_0x127d6b){return function(_0x994030){if(_0x994030){return _0x994030['update'](_0x512c86)['then'](function(_0x59e7db){return _0x59e7db;});}return null;};}function removeEntity(_0x480ca4,_0x40df85){return function(_0x3768bb){if(_0x3768bb){return _0x3768bb[_0x5df2('0x25')]()[_0x5df2('0x26')](function(){var _0x3751bf=_0x3768bb['get']({'plain':!![]});var _0x1441a3=_0x5df2('0x27');return db[_0x5df2('0x28')]['destroy']({'where':{'type':_0x1441a3,'resourceId':_0x3751bf['id']}})[_0x5df2('0x26')](function(){return _0x3768bb;});})['then'](function(){_0x480ca4[_0x5df2('0x1a')](0xcc)[_0x5df2('0x1b')]();});}};}function handleEntityNotFound(_0x1f944d,_0x15de24){return function(_0x73d149){if(!_0x73d149){_0x1f944d['sendStatus'](0x194);}return _0x73d149;};}function handleError(_0xf4f1d3,_0x35b172){_0x35b172=_0x35b172||0x1f4;return function(_0x5b4da2){logger['error'](_0x5b4da2[_0x5df2('0x29')]);if(_0x5b4da2[_0x5df2('0x2a')]){delete _0x5b4da2[_0x5df2('0x2a')];}_0xf4f1d3[_0x5df2('0x1a')](_0x35b172)['send'](_0x5b4da2);};}exports[_0x5df2('0x2b')]=function(_0x51080d,_0xf50902){var _0x1547c3={},_0x3126e7={},_0x435cc2={'count':0x0,'rows':[]};var _0x278105=_[_0x5df2('0x2c')](db[_0x5df2('0x2d')][_0x5df2('0x2e')],function(_0x534ea0){return{'name':_0x534ea0[_0x5df2('0x2f')],'type':_0x534ea0[_0x5df2('0x30')][_0x5df2('0x31')]};});_0x3126e7[_0x5df2('0x32')]=_[_0x5df2('0x2c')](_0x278105,_0x5df2('0x2a'));_0x3126e7[_0x5df2('0x33')]=_[_0x5df2('0x34')](_0x51080d[_0x5df2('0x33')]);_0x3126e7[_0x5df2('0x35')]=_[_0x5df2('0x36')](_0x3126e7['model'],_0x3126e7[_0x5df2('0x33')]);_0x1547c3['attributes']=_['intersection'](_0x3126e7[_0x5df2('0x32')],qs[_0x5df2('0x37')](_0x51080d[_0x5df2('0x33')][_0x5df2('0x37')]));_0x1547c3[_0x5df2('0x38')]=_0x1547c3[_0x5df2('0x38')][_0x5df2('0x39')]?_0x1547c3[_0x5df2('0x38')]:_0x3126e7[_0x5df2('0x32')];if(!_0x51080d[_0x5df2('0x33')][_0x5df2('0x3a')]('nolimit')){_0x1547c3[_0x5df2('0x1e')]=qs['limit'](_0x51080d[_0x5df2('0x33')]['limit']);_0x1547c3[_0x5df2('0x1f')]=qs[_0x5df2('0x1f')](_0x51080d['query'][_0x5df2('0x1f')]);}_0x1547c3[_0x5df2('0x3b')]=qs[_0x5df2('0x3c')](_0x51080d[_0x5df2('0x33')][_0x5df2('0x3c')]);_0x1547c3['where']=qs[_0x5df2('0x35')](_[_0x5df2('0x3d')](_0x51080d[_0x5df2('0x33')],_0x3126e7[_0x5df2('0x35')]),_0x278105);if(_0x51080d[_0x5df2('0x33')][_0x5df2('0x3e')]){_0x1547c3[_0x5df2('0x3f')]=_[_0x5df2('0x40')](_0x1547c3['where'],{'$or':_[_0x5df2('0x2c')](_0x278105,function(_0x5b4a9a){if(_0x5b4a9a[_0x5df2('0x30')]!==_0x5df2('0x41')){var _0x150e33={};_0x150e33[_0x5b4a9a['name']]={'$like':'%'+_0x51080d[_0x5df2('0x33')]['filter']+'%'};return _0x150e33;}})});}_0x1547c3=_[_0x5df2('0x40')]({},_0x1547c3,_0x51080d[_0x5df2('0x42')]);var _0x1d4765={'where':_0x1547c3['where']};return db[_0x5df2('0x2d')]['count'](_0x1d4765)[_0x5df2('0x26')](function(_0x376f0d){_0x435cc2['count']=_0x376f0d;if(_0x51080d[_0x5df2('0x33')][_0x5df2('0x43')]){_0x1547c3[_0x5df2('0x44')]=[{'all':!![]}];}return db[_0x5df2('0x2d')][_0x5df2('0x45')](_0x1547c3);})[_0x5df2('0x26')](function(_0x480757){_0x435cc2['rows']=_0x480757;return _0x435cc2;})[_0x5df2('0x26')](respondWithFilteredResult(_0xf50902,_0x1547c3))['catch'](handleError(_0xf50902,null));};exports['show']=function(_0x2e9f6e,_0x521c3d){var _0x19fce7={'raw':!![],'where':{'id':_0x2e9f6e[_0x5df2('0x46')]['id']}},_0x245d7e={};_0x245d7e['model']=_[_0x5df2('0x34')](db[_0x5df2('0x2d')][_0x5df2('0x2e')]);_0x245d7e[_0x5df2('0x33')]=_[_0x5df2('0x34')](_0x2e9f6e['query']);_0x245d7e[_0x5df2('0x35')]=_['intersection'](_0x245d7e['model'],_0x245d7e['query']);_0x19fce7['attributes']=_['intersection'](_0x245d7e[_0x5df2('0x32')],qs[_0x5df2('0x37')](_0x2e9f6e['query'][_0x5df2('0x37')]));_0x19fce7['attributes']=_0x19fce7[_0x5df2('0x38')][_0x5df2('0x39')]?_0x19fce7[_0x5df2('0x38')]:_0x245d7e[_0x5df2('0x32')];if(_0x2e9f6e[_0x5df2('0x33')][_0x5df2('0x43')]){_0x19fce7[_0x5df2('0x44')]=[{'all':!![]}];}_0x19fce7=_[_0x5df2('0x40')]({},_0x19fce7,_0x2e9f6e[_0x5df2('0x42')]);return db[_0x5df2('0x2d')][_0x5df2('0x47')](_0x19fce7)['then'](handleEntityNotFound(_0x521c3d,null))[_0x5df2('0x26')](respondWithResult(_0x521c3d,null))['catch'](handleError(_0x521c3d,null));};exports[_0x5df2('0x48')]=function(_0x456c30,_0x45fda0,_0x4a39ea){return db[_0x5df2('0x2d')][_0x5df2('0x47')]({'where':{'id':_0x456c30[_0x5df2('0x46')]['id']},'attributes':[_0x5df2('0x2a'),_0x5df2('0x49'),_0x5df2('0x4a')],'raw':!![]})[_0x5df2('0x26')](handleEntityNotFound(_0x45fda0,null))['then'](function(_0x3cec0e){if(_0x3cec0e){if(!fs['existsSync'](path[_0x5df2('0x4b')](config['root'],_0x5df2('0x4c'),_0x3cec0e[_0x5df2('0x49')]+'.'+_0x3cec0e[_0x5df2('0x4a')]))){throw new db[(_0x5df2('0x4d'))][(_0x5df2('0x4e'))](_0x5df2('0x4f'));}return _0x45fda0[_0x5df2('0x48')](path[_0x5df2('0x4b')](config[_0x5df2('0x50')],_0x5df2('0x4c'),util[_0x5df2('0x51')](_0x5df2('0x52'),_0x3cec0e[_0x5df2('0x49')],_0x3cec0e[_0x5df2('0x4a')])),util[_0x5df2('0x51')](_0x5df2('0x52'),_0x3cec0e[_0x5df2('0x2a')],_0x3cec0e['converted_format']));}return null;})[_0x5df2('0x53')](handleError(_0x45fda0,null));};exports[_0x5df2('0x54')]=function(_0x4c29f9,_0x1f47e5,_0x61b46a){var _0x193721={'name':path[_0x5df2('0x55')](_0x4c29f9['file'][_0x5df2('0x56')],path[_0x5df2('0x57')](_0x4c29f9[_0x5df2('0x58')][_0x5df2('0x56')])),'save_name':path[_0x5df2('0x55')](_0x4c29f9['file'][_0x5df2('0x59')],path[_0x5df2('0x57')](_0x4c29f9[_0x5df2('0x58')][_0x5df2('0x59')])),'original_format':path[_0x5df2('0x57')](_0x4c29f9[_0x5df2('0x58')][_0x5df2('0x56')])['substring'](0x1),'converted_format':'wav'};var _0x4ac4c3=path[_0x5df2('0x4b')](config[_0x5df2('0x50')],'server/files/sounds/original',_0x4c29f9[_0x5df2('0x58')][_0x5df2('0x59')]);var _0x1a90d4=path[_0x5df2('0x4b')](config[_0x5df2('0x50')],'server/files/sounds/converted',util[_0x5df2('0x51')](_0x5df2('0x52'),path[_0x5df2('0x55')](_0x4c29f9[_0x5df2('0x58')][_0x5df2('0x59')],path[_0x5df2('0x57')](_0x4c29f9[_0x5df2('0x58')]['filename'])),_0x193721[_0x5df2('0x4a')]));logger[_0x5df2('0x5a')]('Sound\x20upload\x20filepath:\x20%s',_0x4ac4c3);logger['info'](_0x5df2('0x5b'),_0x1a90d4);try{fs[_0x5df2('0x5c')](_0x4ac4c3,parseInt(_0x5df2('0x5d'),0x8));var _0x25fac4=sox['transcode'](_0x4ac4c3,_0x1a90d4,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x25fac4['on']('error',function(_0x5eb5e3){fs[_0x5df2('0x5e')](_0x4ac4c3);_0x1f47e5[_0x5df2('0x1a')](0x1f4)[_0x5df2('0x5f')](_0x5eb5e3);});_0x25fac4['on']('src',function(_0x3ef012){_0x193721[_0x5df2('0x60')]=isNaN(_0x3ef012[_0x5df2('0x61')])?null:_0x3ef012[_0x5df2('0x61')]*0x3e8;_0x193721[_0x5df2('0x62')]=isNaN(_0x3ef012[_0x5df2('0x63')])?null:_0x3ef012[_0x5df2('0x63')];_0x193721[_0x5df2('0x64')]=isNaN(_0x3ef012[_0x5df2('0x65')])?null:_0x3ef012[_0x5df2('0x65')];_0x193721['original_bitRate']=isNaN(_0x3ef012[_0x5df2('0x66')])?null:_0x3ef012['bitRate'];_0x193721[_0x5df2('0x67')]=isNaN(_0x3ef012[_0x5df2('0x68')])?null:_0x3ef012[_0x5df2('0x68')];});_0x25fac4['on'](_0x5df2('0x69'),function(_0x272792){_0x193721[_0x5df2('0x6a')]=isNaN(_0x272792[_0x5df2('0x61')])?null:_0x272792[_0x5df2('0x61')]*0x3e8;_0x193721[_0x5df2('0x6b')]=isNaN(_0x272792[_0x5df2('0x63')])?null:_0x272792[_0x5df2('0x63')];_0x193721['converted_channelCount']=isNaN(_0x272792['channelCount'])?null:_0x272792[_0x5df2('0x65')];_0x193721[_0x5df2('0x6c')]=isNaN(_0x272792['bitRate'])?null:_0x272792[_0x5df2('0x66')];_0x193721[_0x5df2('0x6d')]=isNaN(_0x272792[_0x5df2('0x68')])?null:_0x272792[_0x5df2('0x68')];});_0x25fac4['on'](_0x5df2('0x1b'),function(){fs['chmodSync'](_0x1a90d4,parseInt(_0x5df2('0x5d'),0x8));return db[_0x5df2('0x2d')][_0x5df2('0x54')](_0x193721)['then'](function(_0x1e71bc){var _0x3dcabe={'role':_0x4c29f9[_0x5df2('0x6e')][_0x5df2('0x6f')],'userProfileId':_0x4c29f9['body'][_0x5df2('0x70')]};if(!_0x3dcabe)throw new Error(_0x5df2('0x71'));if(_0x3dcabe[_0x5df2('0x6f')]===_0x5df2('0x72')){var _0x32db7c=_0x1e71bc[_0x5df2('0x73')]({'plain':!![]});return db[_0x5df2('0x74')]['find']({'where':{'name':'Sounds','userProfileId':_0x3dcabe[_0x5df2('0x70')]},'raw':!![]})[_0x5df2('0x26')](function(_0x29fe81){if(_0x29fe81&&_0x29fe81['autoAssociation']===0x0){return db[_0x5df2('0x28')][_0x5df2('0x54')]({'name':_0x32db7c[_0x5df2('0x2a')],'resourceId':_0x32db7c['id'],'type':_0x29fe81[_0x5df2('0x2a')],'sectionId':_0x29fe81['id']},{})['then'](function(){return _0x1e71bc;});}else{return _0x1e71bc;}})[_0x5df2('0x53')](function(_0x4dee23){logger['error'](_0x5df2('0x75'),_0x4dee23);throw _0x4dee23;});}return _0x1e71bc;})['then'](respondWithResult(_0x1f47e5,null))[_0x5df2('0x53')](handleError(_0x1f47e5,null));});_0x25fac4[_0x5df2('0x76')]();}catch(_0x4976a8){_0x1f47e5[_0x5df2('0x1a')](0x1f4)[_0x5df2('0x5f')](_0x4976a8);}};exports[_0x5df2('0x77')]=function(_0x3bc7bc,_0x42128c,_0x526ee7){return db[_0x5df2('0x2d')]['find']({'where':{'id':_0x3bc7bc[_0x5df2('0x46')]['id']}})[_0x5df2('0x26')](handleEntityNotFound(_0x42128c,null))[_0x5df2('0x26')](saveUpdates(_['pick'](_0x3bc7bc[_0x5df2('0x6e')],[_0x5df2('0x2a'),_0x5df2('0x78')]),null))[_0x5df2('0x26')](respondWithResult(_0x42128c,null))['catch'](handleError(_0x42128c,null));};exports[_0x5df2('0x79')]=function(_0x48772f,_0x1c2602,_0x352fb2){return db['Sound']['find']({'where':{'id':_0x48772f[_0x5df2('0x46')]['id']}})[_0x5df2('0x26')](function(_0x3cdbaf){if(_0x3cdbaf){return _0x3cdbaf[_0x5df2('0x25')]();}})[_0x5df2('0x26')](function(_0x156061){var _0x15faab=path[_0x5df2('0x4b')](config[_0x5df2('0x50')],_0x5df2('0x7a'),util['format'](_0x5df2('0x52'),_0x156061['save_name'],_0x156061[_0x5df2('0x7b')]));var _0x1d9390=path[_0x5df2('0x4b')](config['root'],_0x5df2('0x4c'),util['format'](_0x5df2('0x52'),_0x156061[_0x5df2('0x49')],_0x156061[_0x5df2('0x4a')]));fs['unlinkSync'](_0x15faab);fs[_0x5df2('0x5e')](_0x1d9390);return _0x156061;})[_0x5df2('0x26')](function(_0x24bcf9){if(_0x24bcf9){return _0x1c2602[_0x5df2('0x1a')](0xcc)['end']();}})[_0x5df2('0x26')](handleEntityNotFound(_0x1c2602,null))[_0x5df2('0x53')](handleError(_0x1c2602,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 3563f40..67867b6 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 _0x1087=['define','Sound','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./sound.attributes'];(function(_0x289710,_0x523524){var _0x5bf7b1=function(_0x466e31){while(--_0x466e31){_0x289710['push'](_0x289710['shift']());}};_0x5bf7b1(++_0x523524);}(_0x1087,0xad));var _0x7108=function(_0xedbc0,_0x4ec66f){_0xedbc0=_0xedbc0-0x0;var _0x3318c5=_0x1087[_0xedbc0];return _0x3318c5;};'use strict';var _=require(_0x7108('0x0'));var util=require('util');var logger=require(_0x7108('0x1'))(_0x7108('0x2'));var moment=require(_0x7108('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7108('0x4'));var config=require(_0x7108('0x5'));var attributes=require(_0x7108('0x6'));module['exports']=function(_0x11eccd,_0x421a1c){return _0x11eccd[_0x7108('0x7')](_0x7108('0x8'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8619=['request-promise','rimraf','../../config/environment','./sound.attributes','exports','Sound','tools_sounds','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x8619,0x17b));var _0x9861=function(_0x381c2f,_0x2dde11){_0x381c2f=_0x381c2f-0x0;var _0x43bda5=_0x8619[_0x381c2f];return _0x43bda5;};'use strict';var _=require(_0x9861('0x0'));var util=require(_0x9861('0x1'));var logger=require(_0x9861('0x2'))('api');var moment=require(_0x9861('0x3'));var BPromise=require(_0x9861('0x4'));var rp=require(_0x9861('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9861('0x6'));var config=require(_0x9861('0x7'));var attributes=require(_0x9861('0x8'));module[_0x9861('0x9')]=function(_0x1b5495,_0x145c67){return _0x1b5495['define'](_0x9861('0xa'),attributes,{'tableName':_0x9861('0xb'),'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 5b9f70c..48f0a35 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 _0xd471=['raw','where','attributes','include','map','model','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','info','catch','ShowSound','Sound','find','options'];(function(_0x71b765,_0x3053f8){var _0x34cb24=function(_0x2dd237){while(--_0x2dd237){_0x71b765['push'](_0x71b765['shift']());}};_0x34cb24(++_0x3053f8);}(_0xd471,0x6c));var _0x1d47=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd471[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1d47('0x0'));var util=require('util');var moment=require(_0x1d47('0x1'));var BPromise=require(_0x1d47('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d47('0x3'));var db=require(_0x1d47('0x4'))['db'];var utils=require(_0x1d47('0x5'));var logger=require(_0x1d47('0x6'))(_0x1d47('0x7'));var config=require(_0x1d47('0x8'));var jayson=require(_0x1d47('0x9'));var client=jayson[_0x1d47('0xa')][_0x1d47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17376a,_0x163e4,_0x39b863){return new BPromise(function(_0x43f0b8,_0x3bb6ec){return client[_0x1d47('0xc')](_0x17376a,_0x39b863)[_0x1d47('0xd')](function(_0x334a29){logger['info']('Sound,\x20%s,\x20%s',_0x163e4,_0x1d47('0xe'));logger[_0x1d47('0xf')](_0x1d47('0x10'),_0x163e4,_0x1d47('0xe'),JSON[_0x1d47('0x11')](_0x334a29));if(_0x334a29[_0x1d47('0x12')]){if(_0x334a29[_0x1d47('0x12')][_0x1d47('0x13')]===0x1f4){logger['error'](_0x1d47('0x14'),_0x163e4,_0x334a29[_0x1d47('0x12')][_0x1d47('0x15')]);return _0x3bb6ec(_0x334a29[_0x1d47('0x12')]['message']);}logger['error'](_0x1d47('0x14'),_0x163e4,_0x334a29[_0x1d47('0x12')][_0x1d47('0x15')]);return _0x43f0b8(_0x334a29[_0x1d47('0x12')][_0x1d47('0x15')]);}else{logger[_0x1d47('0x16')](_0x1d47('0x14'),_0x163e4,_0x1d47('0xe'));_0x43f0b8(_0x334a29['result'][_0x1d47('0x15')]);}})[_0x1d47('0x17')](function(_0x3bff33){logger[_0x1d47('0x12')](_0x1d47('0x14'),_0x163e4,_0x3bff33);_0x3bb6ec(_0x3bff33);});});}exports[_0x1d47('0x18')]=function(_0xe47edf){var _0x3d8250=this;return new Promise(function(_0x39bcb1,_0x49c71d){return db[_0x1d47('0x19')][_0x1d47('0x1a')]({'raw':_0xe47edf[_0x1d47('0x1b')]?_0xe47edf[_0x1d47('0x1b')][_0x1d47('0x1c')]===undefined?!![]:![]:!![],'where':_0xe47edf[_0x1d47('0x1b')]?_0xe47edf[_0x1d47('0x1b')][_0x1d47('0x1d')]||null:null,'attributes':_0xe47edf[_0x1d47('0x1b')]?_0xe47edf['options'][_0x1d47('0x1e')]||null:null,'include':_0xe47edf[_0x1d47('0x1b')]?_0xe47edf['options'][_0x1d47('0x1f')]?_[_0x1d47('0x20')](_0xe47edf[_0x1d47('0x1b')][_0x1d47('0x1f')],function(_0x571b69){return{'model':db[_0x571b69[_0x1d47('0x21')]],'as':_0x571b69['as'],'attributes':_0x571b69[_0x1d47('0x1e')],'include':_0x571b69[_0x1d47('0x1f')]?_['map'](_0x571b69[_0x1d47('0x1f')],function(_0x225152){return{'model':db[_0x225152[_0x1d47('0x21')]],'as':_0x225152['as'],'attributes':_0x225152[_0x1d47('0x1e')],'include':_0x225152['include']?_[_0x1d47('0x20')](_0x225152['include'],function(_0x34ba45){return{'model':db[_0x34ba45['model']],'as':_0x34ba45['as'],'attributes':_0x34ba45[_0x1d47('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1d47('0xd')](function(_0x5261fc){logger[_0x1d47('0x16')](_0x1d47('0x18'),_0xe47edf);logger[_0x1d47('0xf')](_0x1d47('0x18'),_0xe47edf,JSON[_0x1d47('0x11')](_0x5261fc));_0x39bcb1(_0x5261fc);})[_0x1d47('0x17')](function(_0x5997ff){logger['error'](_0x1d47('0x18'),_0x5997ff[_0x1d47('0x15')],_0xe47edf);_0x49c71d(_0x3d8250[_0x1d47('0x12')](0x1f4,_0x5997ff[_0x1d47('0x15')]));});});}; \ No newline at end of file +var _0x974c=['client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','ShowSound','Sound','options','raw','attributes','include','map','model','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0x974c,0xa7));var _0xc974=function(_0x3f84ff,_0x531bbc){_0x3f84ff=_0x3f84ff-0x0;var _0x1479d9=_0x974c[_0x3f84ff];return _0x1479d9;};'use strict';var _=require(_0xc974('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc974('0x1'));var rs=require(_0xc974('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc974('0x3'))['db'];var utils=require(_0xc974('0x4'));var logger=require(_0xc974('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc974('0x6'));var client=jayson[_0xc974('0x7')][_0xc974('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f73c6,_0xded1c1,_0x21ff2b){return new BPromise(function(_0xe7e9e3,_0x737430){return client[_0xc974('0x9')](_0x4f73c6,_0x21ff2b)[_0xc974('0xa')](function(_0x2cb860){logger['info'](_0xc974('0xb'),_0xded1c1,_0xc974('0xc'));logger[_0xc974('0xd')]('Sound,\x20%s,\x20%s,\x20%s',_0xded1c1,_0xc974('0xc'),JSON[_0xc974('0xe')](_0x2cb860));if(_0x2cb860[_0xc974('0xf')]){if(_0x2cb860[_0xc974('0xf')][_0xc974('0x10')]===0x1f4){logger[_0xc974('0xf')]('Sound,\x20%s,\x20%s',_0xded1c1,_0x2cb860[_0xc974('0xf')][_0xc974('0x11')]);return _0x737430(_0x2cb860[_0xc974('0xf')][_0xc974('0x11')]);}logger[_0xc974('0xf')](_0xc974('0xb'),_0xded1c1,_0x2cb860[_0xc974('0xf')][_0xc974('0x11')]);return _0xe7e9e3(_0x2cb860[_0xc974('0xf')][_0xc974('0x11')]);}else{logger[_0xc974('0x12')](_0xc974('0xb'),_0xded1c1,'request\x20sent');_0xe7e9e3(_0x2cb860[_0xc974('0x13')][_0xc974('0x11')]);}})[_0xc974('0x14')](function(_0x412202){logger[_0xc974('0xf')]('Sound,\x20%s,\x20%s',_0xded1c1,_0x412202);_0x737430(_0x412202);});});}exports[_0xc974('0x15')]=function(_0x36fe55){var _0xbfe501=this;return new Promise(function(_0x35d38c,_0x478796){return db[_0xc974('0x16')]['find']({'raw':_0x36fe55[_0xc974('0x17')]?_0x36fe55['options'][_0xc974('0x18')]===undefined?!![]:![]:!![],'where':_0x36fe55[_0xc974('0x17')]?_0x36fe55[_0xc974('0x17')]['where']||null:null,'attributes':_0x36fe55['options']?_0x36fe55[_0xc974('0x17')][_0xc974('0x19')]||null:null,'include':_0x36fe55[_0xc974('0x17')]?_0x36fe55[_0xc974('0x17')][_0xc974('0x1a')]?_[_0xc974('0x1b')](_0x36fe55['options']['include'],function(_0x44d9db){return{'model':db[_0x44d9db[_0xc974('0x1c')]],'as':_0x44d9db['as'],'attributes':_0x44d9db['attributes'],'include':_0x44d9db[_0xc974('0x1a')]?_[_0xc974('0x1b')](_0x44d9db['include'],function(_0x116361){return{'model':db[_0x116361[_0xc974('0x1c')]],'as':_0x116361['as'],'attributes':_0x116361[_0xc974('0x19')],'include':_0x116361[_0xc974('0x1a')]?_[_0xc974('0x1b')](_0x116361['include'],function(_0xc2cd0f){return{'model':db[_0xc2cd0f[_0xc974('0x1c')]],'as':_0xc2cd0f['as'],'attributes':_0xc2cd0f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x37c051){logger['info'](_0xc974('0x15'),_0x36fe55);logger[_0xc974('0xd')]('ShowSound',_0x36fe55,JSON[_0xc974('0xe')](_0x37c051));_0x35d38c(_0x37c051);})[_0xc974('0x14')](function(_0x21ba9f){logger[_0xc974('0xf')](_0xc974('0x15'),_0x21ba9f[_0xc974('0x11')],_0x36fe55);_0x478796(_0xbfe501[_0xc974('0xf')](0x1f4,_0x21ba9f[_0xc974('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 0614be4..cbb85de 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x201be4,_0xce265e){_0x201be4=_0x201be4-0x0;var _0x31e220=_0x9ffd[_0x201be4];return _0x31e220;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file +var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5bb136,_0x88b5bd){var _0x3d2b8f=function(_0x24387f){while(--_0x24387f){_0x5bb136['push'](_0x5bb136['shift']());}};_0x3d2b8f(++_0x88b5bd);}(_0xb10b,0x12a));var _0xbb10=function(_0x137815,_0x78dd4b){_0x137815=_0x137815-0x0;var _0x29ded1=_0xb10b[_0x137815];return _0x29ded1;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 061cf11..866e338 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 _0x4f96=['sequelize','exports','out','TEXT'];(function(_0x308c00,_0x3cbd67){var _0x2b21b2=function(_0x4ce3fc){while(--_0x4ce3fc){_0x308c00['push'](_0x308c00['shift']());}};_0x2b21b2(++_0x3cbd67);}(_0x4f96,0xbc));var _0x64f9=function(_0x369e54,_0x17530a){_0x369e54=_0x369e54-0x0;var _0x3b5b5b=_0x4f96[_0x369e54];return _0x3b5b5b;};'use strict';var Sequelize=require(_0x64f9('0x0'));module[_0x64f9('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x64f9('0x2')),'defaultValue':_0x64f9('0x2'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x64f9('0x3')]}}; \ No newline at end of file +var _0xf207=['sequelize','exports','medium','ENUM','out','STRING','TEXT'];(function(_0x59587e,_0x218284){var _0xf2a818=function(_0x49dbf2){while(--_0x49dbf2){_0x59587e['push'](_0x59587e['shift']());}};_0xf2a818(++_0x218284);}(_0xf207,0x181));var _0x7f20=function(_0x2d7842,_0x5e1932){_0x2d7842=_0x2d7842-0x0;var _0x35485d=_0xf207[_0x2d7842];return _0x35485d;};'use strict';var Sequelize=require(_0x7f20('0x0'));module[_0x7f20('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0x7f20('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x7f20('0x3')]('in',_0x7f20('0x4')),'defaultValue':_0x7f20('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x7f20('0x5')]},'providerResponse':{'type':Sequelize[_0x7f20('0x6')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index cf9ab07..264a66c 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 _0x567a=['find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','offset','count','set','apply','save','update','destroy','sendStatus','stack','name','send','index','map','SquareMessage','fieldName','type','key','model','keys','filters','query','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','show','params','intersection','catch','body'];(function(_0x3b2c6f,_0xa9f35c){var _0x22e219=function(_0x3ee04c){while(--_0x3ee04c){_0x3b2c6f['push'](_0x3b2c6f['shift']());}};_0x22e219(++_0xa9f35c);}(_0x567a,0x8d));var _0xa567=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x567a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xa567('0x0'));var rimraf=require(_0xa567('0x1'));var zipdir=require(_0xa567('0x2'));var jsonpatch=require(_0xa567('0x3'));var rp=require(_0xa567('0x4'));var moment=require(_0xa567('0x5'));var BPromise=require(_0xa567('0x6'));var Mustache=require('mustache');var util=require(_0xa567('0x7'));var path=require('path');var sox=require(_0xa567('0x8'));var csv=require(_0xa567('0x9'));var ejs=require(_0xa567('0xa'));var fs=require('fs');var fs_extra=require(_0xa567('0xb'));var _=require(_0xa567('0xc'));var squel=require(_0xa567('0xd'));var crypto=require(_0xa567('0xe'));var jsforce=require(_0xa567('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa567('0x10'));var Papa=require('papaparse');var Redis=require(_0xa567('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa567('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa567('0x13'))(_0xa567('0x14'));var utils=require(_0xa567('0x15'));var config=require(_0xa567('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa567('0x17'))['db'];function respondWithStatusCode(_0x158f5e,_0x42089f){_0x42089f=_0x42089f||0xcc;return function(_0x593f1b){if(_0x593f1b){return _0x158f5e['sendStatus'](_0x42089f);}return _0x158f5e[_0xa567('0x18')](_0x42089f)[_0xa567('0x19')]();};}function respondWithResult(_0x4d329d,_0xb59e0f){_0xb59e0f=_0xb59e0f||0xc8;return function(_0x4177b8){if(_0x4177b8){return _0x4d329d['status'](_0xb59e0f)[_0xa567('0x1a')](_0x4177b8);}};}function respondWithFilteredResult(_0x5b3070,_0x4b5353){return function(_0x8f93fa){if(_0x8f93fa){var _0x1fe0cc=typeof _0x4b5353['offset']==='undefined'&&typeof _0x4b5353[_0xa567('0x1b')]===_0xa567('0x1c');var _0xaf202f=_0x8f93fa['count'];var _0x1a47ee=_0x1fe0cc?0x0:_0x4b5353[_0xa567('0x1d')];var _0x4e013f=_0x1fe0cc?_0x8f93fa[_0xa567('0x1e')]:_0x4b5353[_0xa567('0x1d')]+_0x4b5353[_0xa567('0x1b')];var _0x186a6b;if(_0x4e013f>=_0xaf202f){_0x4e013f=_0xaf202f;_0x186a6b=0xc8;}else{_0x186a6b=0xce;}_0x5b3070[_0xa567('0x18')](_0x186a6b);return _0x5b3070[_0xa567('0x1f')]('Content-Range',_0x1a47ee+'-'+_0x4e013f+'/'+_0xaf202f)['json'](_0x8f93fa);}return null;};}function patchUpdates(_0x29fee8){return function(_0x2910b6){try{jsonpatch[_0xa567('0x20')](_0x2910b6,_0x29fee8,!![]);}catch(_0x2d72ab){return BPromise['reject'](_0x2d72ab);}return _0x2910b6[_0xa567('0x21')]();};}function saveUpdates(_0x1e261e,_0x5aeabf){return function(_0x215605){if(_0x215605){return _0x215605[_0xa567('0x22')](_0x1e261e)['then'](function(_0x4041a3){return _0x4041a3;});}return null;};}function removeEntity(_0x15b02b,_0x5ea11b){return function(_0x41a3eb){if(_0x41a3eb){return _0x41a3eb[_0xa567('0x23')]()['then'](function(){_0x15b02b[_0xa567('0x18')](0xcc)[_0xa567('0x19')]();});}};}function handleEntityNotFound(_0x2e7430,_0x3778d2){return function(_0x5eda94){if(!_0x5eda94){_0x2e7430[_0xa567('0x24')](0x194);}return _0x5eda94;};}function handleError(_0x5c0d49,_0xf7f01d){_0xf7f01d=_0xf7f01d||0x1f4;return function(_0xbdca8f){logger['error'](_0xbdca8f[_0xa567('0x25')]);if(_0xbdca8f[_0xa567('0x26')]){delete _0xbdca8f[_0xa567('0x26')];}_0x5c0d49[_0xa567('0x18')](_0xf7f01d)[_0xa567('0x27')](_0xbdca8f);};}exports[_0xa567('0x28')]=function(_0x26042d,_0x389f06){var _0x266f93={},_0x479ed0={},_0xdb134a={'count':0x0,'rows':[]};var _0x543d22=_[_0xa567('0x29')](db[_0xa567('0x2a')]['rawAttributes'],function(_0x226f7f){return{'name':_0x226f7f[_0xa567('0x2b')],'type':_0x226f7f[_0xa567('0x2c')][_0xa567('0x2d')]};});_0x479ed0[_0xa567('0x2e')]=_[_0xa567('0x29')](_0x543d22,_0xa567('0x26'));_0x479ed0['query']=_[_0xa567('0x2f')](_0x26042d['query']);_0x479ed0[_0xa567('0x30')]=_['intersection'](_0x479ed0[_0xa567('0x2e')],_0x479ed0[_0xa567('0x31')]);_0x266f93[_0xa567('0x32')]=_['intersection'](_0x479ed0[_0xa567('0x2e')],qs[_0xa567('0x33')](_0x26042d[_0xa567('0x31')][_0xa567('0x33')]));_0x266f93[_0xa567('0x32')]=_0x266f93[_0xa567('0x32')][_0xa567('0x34')]?_0x266f93['attributes']:_0x479ed0[_0xa567('0x2e')];if(!_0x26042d[_0xa567('0x31')]['hasOwnProperty'](_0xa567('0x35'))){_0x266f93[_0xa567('0x1b')]=qs[_0xa567('0x1b')](_0x26042d[_0xa567('0x31')][_0xa567('0x1b')]);_0x266f93['offset']=qs[_0xa567('0x1d')](_0x26042d['query']['offset']);}_0x266f93['order']=qs['sort'](_0x26042d[_0xa567('0x31')][_0xa567('0x36')]);_0x266f93[_0xa567('0x37')]=qs[_0xa567('0x30')](_['pick'](_0x26042d[_0xa567('0x31')],_0x479ed0[_0xa567('0x30')]),_0x543d22);if(_0x26042d[_0xa567('0x31')]['filter']){_0x266f93[_0xa567('0x37')]=_[_0xa567('0x38')](_0x266f93[_0xa567('0x37')],{'$or':_[_0xa567('0x29')](_0x543d22,function(_0x36f2b0){if(_0x36f2b0['type']!==_0xa567('0x39')){var _0x3cd2e8={};_0x3cd2e8[_0x36f2b0[_0xa567('0x26')]]={'$like':'%'+_0x26042d['query'][_0xa567('0x3a')]+'%'};return _0x3cd2e8;}})});}_0x266f93=_[_0xa567('0x38')]({},_0x266f93,_0x26042d[_0xa567('0x3b')]);var _0x4eb4c9={'where':_0x266f93[_0xa567('0x37')]};return db['SquareMessage'][_0xa567('0x1e')](_0x4eb4c9)[_0xa567('0x3c')](function(_0x33a0dc){_0xdb134a[_0xa567('0x1e')]=_0x33a0dc;if(_0x26042d[_0xa567('0x31')][_0xa567('0x3d')]){_0x266f93[_0xa567('0x3e')]=[{'all':!![]}];}return db[_0xa567('0x2a')][_0xa567('0x3f')](_0x266f93);})['then'](function(_0x1b8dc3){_0xdb134a['rows']=_0x1b8dc3;return _0xdb134a;})[_0xa567('0x3c')](respondWithFilteredResult(_0x389f06,_0x266f93))['catch'](handleError(_0x389f06,null));};exports[_0xa567('0x40')]=function(_0x16579f,_0x494723){var _0x4576aa={'raw':!![],'where':{'id':_0x16579f[_0xa567('0x41')]['id']}},_0x479947={};_0x479947[_0xa567('0x2e')]=_[_0xa567('0x2f')](db[_0xa567('0x2a')]['rawAttributes']);_0x479947[_0xa567('0x31')]=_['keys'](_0x16579f['query']);_0x479947[_0xa567('0x30')]=_['intersection'](_0x479947[_0xa567('0x2e')],_0x479947[_0xa567('0x31')]);_0x4576aa['attributes']=_[_0xa567('0x42')](_0x479947[_0xa567('0x2e')],qs[_0xa567('0x33')](_0x16579f[_0xa567('0x31')]['fields']));_0x4576aa[_0xa567('0x32')]=_0x4576aa[_0xa567('0x32')]['length']?_0x4576aa[_0xa567('0x32')]:_0x479947[_0xa567('0x2e')];if(_0x16579f['query'][_0xa567('0x3d')]){_0x4576aa[_0xa567('0x3e')]=[{'all':!![]}];}_0x4576aa=_['merge']({},_0x4576aa,_0x16579f['options']);return db[_0xa567('0x2a')]['find'](_0x4576aa)['then'](handleEntityNotFound(_0x494723,null))['then'](respondWithResult(_0x494723,null))['catch'](handleError(_0x494723,null));};exports['create']=function(_0x4428ae,_0x1e69d6){return db[_0xa567('0x2a')]['create'](_0x4428ae['body'],{})['then'](respondWithResult(_0x1e69d6,0xc9))[_0xa567('0x43')](handleError(_0x1e69d6,null));};exports[_0xa567('0x22')]=function(_0x47fbb8,_0x403ca8){if(_0x47fbb8[_0xa567('0x44')]['id']){delete _0x47fbb8[_0xa567('0x44')]['id'];}return db[_0xa567('0x2a')][_0xa567('0x45')]({'where':{'id':_0x47fbb8[_0xa567('0x41')]['id']}})[_0xa567('0x3c')](handleEntityNotFound(_0x403ca8,null))[_0xa567('0x3c')](saveUpdates(_0x47fbb8[_0xa567('0x44')],null))['then'](respondWithResult(_0x403ca8,null))[_0xa567('0x43')](handleError(_0x403ca8,null));};exports[_0xa567('0x23')]=function(_0x6af71,_0x439088){return db[_0xa567('0x2a')][_0xa567('0x45')]({'where':{'id':_0x6af71[_0xa567('0x41')]['id']}})[_0xa567('0x3c')](handleEntityNotFound(_0x439088,null))[_0xa567('0x3c')](removeEntity(_0x439088,null))['catch'](handleError(_0x439088,null));}; \ No newline at end of file +var _0xd9ed=['limit','order','sort','where','pick','filter','type','merge','options','include','findAll','rows','params','keys','includeAll','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','key','filters','intersection','model','fields','attributes','length','query','hasOwnProperty','nolimit'];(function(_0x1b4002,_0x5b4094){var _0x1716f3=function(_0x47cfd1){while(--_0x47cfd1){_0x1b4002['push'](_0x1b4002['shift']());}};_0x1716f3(++_0x5b4094);}(_0xd9ed,0x18a));var _0xdd9e=function(_0x1a20fa,_0xa753f6){_0x1a20fa=_0x1a20fa-0x0;var _0x540063=_0xd9ed[_0x1a20fa];return _0x540063;};'use strict';var emlformat=require(_0xdd9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd9e('0x1'));var jsonpatch=require(_0xdd9e('0x2'));var rp=require(_0xdd9e('0x3'));var moment=require(_0xdd9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdd9e('0x5'));var util=require('util');var path=require('path');var sox=require(_0xdd9e('0x6'));var csv=require(_0xdd9e('0x7'));var ejs=require(_0xdd9e('0x8'));var fs=require('fs');var fs_extra=require(_0xdd9e('0x9'));var _=require(_0xdd9e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdd9e('0xb'));var deskjs=require(_0xdd9e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdd9e('0xd'));var Papa=require(_0xdd9e('0xe'));var Redis=require(_0xdd9e('0xf'));var authService=require(_0xdd9e('0x10'));var qs=require(_0xdd9e('0x11'));var as=require(_0xdd9e('0x12'));var hardwareService=require(_0xdd9e('0x13'));var logger=require('../../config/logger')(_0xdd9e('0x14'));var utils=require(_0xdd9e('0x15'));var config=require(_0xdd9e('0x16'));var licenseUtil=require(_0xdd9e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x409203,_0x1a342b){_0x1a342b=_0x1a342b||0xcc;return function(_0x38de14){if(_0x38de14){return _0x409203[_0xdd9e('0x18')](_0x1a342b);}return _0x409203['status'](_0x1a342b)[_0xdd9e('0x19')]();};}function respondWithResult(_0x4ab963,_0x39e320){_0x39e320=_0x39e320||0xc8;return function(_0x44f4a7){if(_0x44f4a7){return _0x4ab963[_0xdd9e('0x1a')](_0x39e320)[_0xdd9e('0x1b')](_0x44f4a7);}};}function respondWithFilteredResult(_0x328a40,_0xdd4e57){return function(_0x2fa978){if(_0x2fa978){var _0x4f0da0=typeof _0xdd4e57[_0xdd9e('0x1c')]==='undefined'&&typeof _0xdd4e57['limit']===_0xdd9e('0x1d');var _0x4f1d81=_0x2fa978[_0xdd9e('0x1e')];var _0x589c9c=_0x4f0da0?0x0:_0xdd4e57[_0xdd9e('0x1c')];var _0x12bfb9=_0x4f0da0?_0x2fa978[_0xdd9e('0x1e')]:_0xdd4e57['offset']+_0xdd4e57['limit'];var _0x40cbf0;if(_0x12bfb9>=_0x4f1d81){_0x12bfb9=_0x4f1d81;_0x40cbf0=0xc8;}else{_0x40cbf0=0xce;}_0x328a40['status'](_0x40cbf0);return _0x328a40[_0xdd9e('0x1f')](_0xdd9e('0x20'),_0x589c9c+'-'+_0x12bfb9+'/'+_0x4f1d81)[_0xdd9e('0x1b')](_0x2fa978);}return null;};}function patchUpdates(_0x264096){return function(_0x209f03){try{jsonpatch['apply'](_0x209f03,_0x264096,!![]);}catch(_0x3ac5de){return BPromise[_0xdd9e('0x21')](_0x3ac5de);}return _0x209f03[_0xdd9e('0x22')]();};}function saveUpdates(_0x35759e,_0x46aff0){return function(_0x2d4520){if(_0x2d4520){return _0x2d4520['update'](_0x35759e)[_0xdd9e('0x23')](function(_0x468e2e){return _0x468e2e;});}return null;};}function removeEntity(_0x5d50d0,_0x1841ae){return function(_0x1c41b4){if(_0x1c41b4){return _0x1c41b4[_0xdd9e('0x24')]()[_0xdd9e('0x23')](function(){_0x5d50d0[_0xdd9e('0x1a')](0xcc)[_0xdd9e('0x19')]();});}};}function handleEntityNotFound(_0x33b134,_0x279c6e){return function(_0x3c311b){if(!_0x3c311b){_0x33b134['sendStatus'](0x194);}return _0x3c311b;};}function handleError(_0x276221,_0x57d524){_0x57d524=_0x57d524||0x1f4;return function(_0x544f77){logger[_0xdd9e('0x25')](_0x544f77[_0xdd9e('0x26')]);if(_0x544f77[_0xdd9e('0x27')]){delete _0x544f77[_0xdd9e('0x27')];}_0x276221[_0xdd9e('0x1a')](_0x57d524)[_0xdd9e('0x28')](_0x544f77);};}exports[_0xdd9e('0x29')]=function(_0x3b66d6,_0x791727){var _0x48aca4={},_0x26ea2a={},_0x3b9bf7={'count':0x0,'rows':[]};var _0x5145f1=_[_0xdd9e('0x2a')](db[_0xdd9e('0x2b')][_0xdd9e('0x2c')],function(_0x258544){return{'name':_0x258544[_0xdd9e('0x2d')],'type':_0x258544['type'][_0xdd9e('0x2e')]};});_0x26ea2a['model']=_['map'](_0x5145f1,'name');_0x26ea2a['query']=_['keys'](_0x3b66d6['query']);_0x26ea2a[_0xdd9e('0x2f')]=_[_0xdd9e('0x30')](_0x26ea2a['model'],_0x26ea2a['query']);_0x48aca4['attributes']=_[_0xdd9e('0x30')](_0x26ea2a[_0xdd9e('0x31')],qs[_0xdd9e('0x32')](_0x3b66d6['query'][_0xdd9e('0x32')]));_0x48aca4[_0xdd9e('0x33')]=_0x48aca4[_0xdd9e('0x33')][_0xdd9e('0x34')]?_0x48aca4[_0xdd9e('0x33')]:_0x26ea2a[_0xdd9e('0x31')];if(!_0x3b66d6[_0xdd9e('0x35')][_0xdd9e('0x36')](_0xdd9e('0x37'))){_0x48aca4[_0xdd9e('0x38')]=qs['limit'](_0x3b66d6[_0xdd9e('0x35')][_0xdd9e('0x38')]);_0x48aca4[_0xdd9e('0x1c')]=qs[_0xdd9e('0x1c')](_0x3b66d6[_0xdd9e('0x35')][_0xdd9e('0x1c')]);}_0x48aca4[_0xdd9e('0x39')]=qs[_0xdd9e('0x3a')](_0x3b66d6[_0xdd9e('0x35')][_0xdd9e('0x3a')]);_0x48aca4[_0xdd9e('0x3b')]=qs[_0xdd9e('0x2f')](_[_0xdd9e('0x3c')](_0x3b66d6['query'],_0x26ea2a[_0xdd9e('0x2f')]),_0x5145f1);if(_0x3b66d6[_0xdd9e('0x35')][_0xdd9e('0x3d')]){_0x48aca4[_0xdd9e('0x3b')]=_['merge'](_0x48aca4[_0xdd9e('0x3b')],{'$or':_['map'](_0x5145f1,function(_0xc01e7c){if(_0xc01e7c[_0xdd9e('0x3e')]!=='VIRTUAL'){var _0x5137ab={};_0x5137ab[_0xc01e7c[_0xdd9e('0x27')]]={'$like':'%'+_0x3b66d6[_0xdd9e('0x35')][_0xdd9e('0x3d')]+'%'};return _0x5137ab;}})});}_0x48aca4=_[_0xdd9e('0x3f')]({},_0x48aca4,_0x3b66d6[_0xdd9e('0x40')]);var _0x253bb0={'where':_0x48aca4['where']};return db['SquareMessage']['count'](_0x253bb0)[_0xdd9e('0x23')](function(_0x41863f){_0x3b9bf7[_0xdd9e('0x1e')]=_0x41863f;if(_0x3b66d6['query']['includeAll']){_0x48aca4[_0xdd9e('0x41')]=[{'all':!![]}];}return db[_0xdd9e('0x2b')][_0xdd9e('0x42')](_0x48aca4);})['then'](function(_0x1c45d6){_0x3b9bf7[_0xdd9e('0x43')]=_0x1c45d6;return _0x3b9bf7;})['then'](respondWithFilteredResult(_0x791727,_0x48aca4))['catch'](handleError(_0x791727,null));};exports['show']=function(_0x29aec2,_0x160523){var _0xcd2bd5={'raw':!![],'where':{'id':_0x29aec2[_0xdd9e('0x44')]['id']}},_0x2327f2={};_0x2327f2[_0xdd9e('0x31')]=_['keys'](db[_0xdd9e('0x2b')][_0xdd9e('0x2c')]);_0x2327f2[_0xdd9e('0x35')]=_[_0xdd9e('0x45')](_0x29aec2[_0xdd9e('0x35')]);_0x2327f2[_0xdd9e('0x2f')]=_[_0xdd9e('0x30')](_0x2327f2['model'],_0x2327f2[_0xdd9e('0x35')]);_0xcd2bd5[_0xdd9e('0x33')]=_['intersection'](_0x2327f2[_0xdd9e('0x31')],qs['fields'](_0x29aec2[_0xdd9e('0x35')][_0xdd9e('0x32')]));_0xcd2bd5[_0xdd9e('0x33')]=_0xcd2bd5[_0xdd9e('0x33')][_0xdd9e('0x34')]?_0xcd2bd5[_0xdd9e('0x33')]:_0x2327f2[_0xdd9e('0x31')];if(_0x29aec2[_0xdd9e('0x35')][_0xdd9e('0x46')]){_0xcd2bd5[_0xdd9e('0x41')]=[{'all':!![]}];}_0xcd2bd5=_[_0xdd9e('0x3f')]({},_0xcd2bd5,_0x29aec2[_0xdd9e('0x40')]);return db[_0xdd9e('0x2b')][_0xdd9e('0x47')](_0xcd2bd5)[_0xdd9e('0x23')](handleEntityNotFound(_0x160523,null))[_0xdd9e('0x23')](respondWithResult(_0x160523,null))[_0xdd9e('0x48')](handleError(_0x160523,null));};exports[_0xdd9e('0x49')]=function(_0x33761f,_0x5be223){return db['SquareMessage'][_0xdd9e('0x49')](_0x33761f[_0xdd9e('0x4a')],{})[_0xdd9e('0x23')](respondWithResult(_0x5be223,0xc9))['catch'](handleError(_0x5be223,null));};exports['update']=function(_0x206c96,_0x3fc54e){if(_0x206c96['body']['id']){delete _0x206c96[_0xdd9e('0x4a')]['id'];}return db[_0xdd9e('0x2b')][_0xdd9e('0x47')]({'where':{'id':_0x206c96[_0xdd9e('0x44')]['id']}})[_0xdd9e('0x23')](handleEntityNotFound(_0x3fc54e,null))['then'](saveUpdates(_0x206c96[_0xdd9e('0x4a')],null))[_0xdd9e('0x23')](respondWithResult(_0x3fc54e,null))[_0xdd9e('0x48')](handleError(_0x3fc54e,null));};exports[_0xdd9e('0x24')]=function(_0x2e34bb,_0x110af3){return db['SquareMessage'][_0xdd9e('0x47')]({'where':{'id':_0x2e34bb[_0xdd9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x110af3,null))[_0xdd9e('0x23')](removeEntity(_0x110af3,null))[_0xdd9e('0x48')](handleError(_0x110af3,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index bc82cf1..835a32d 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 _0x2fe8=['./squareMessage.attributes','exports','define','square_messages','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2fe8,0x1e1));var _0x82fe=function(_0x3ee134,_0x28b844){_0x3ee134=_0x3ee134-0x0;var _0x1eda39=_0x2fe8[_0x3ee134];return _0x1eda39;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x82fe('0x0'));var moment=require(_0x82fe('0x1'));var BPromise=require('bluebird');var rp=require(_0x82fe('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82fe('0x3'));var config=require(_0x82fe('0x4'));var attributes=require(_0x82fe('0x5'));module[_0x82fe('0x6')]=function(_0x51c4ed,_0x48a52e){return _0x51c4ed[_0x82fe('0x7')]('SquareMessage',attributes,{'tableName':_0x82fe('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8083=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','square_messages','util','../../config/logger'];(function(_0x5e2196,_0x4583c2){var _0x106340=function(_0x291748){while(--_0x291748){_0x5e2196['push'](_0x5e2196['shift']());}};_0x106340(++_0x4583c2);}(_0x8083,0x1ed));var _0x3808=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x8083[_0x5f1617];return _0x3af5da;};'use strict';var _=require('lodash');var util=require(_0x3808('0x0'));var logger=require(_0x3808('0x1'))(_0x3808('0x2'));var moment=require('moment');var BPromise=require(_0x3808('0x3'));var rp=require(_0x3808('0x4'));var fs=require('fs');var path=require(_0x3808('0x5'));var rimraf=require(_0x3808('0x6'));var config=require(_0x3808('0x7'));var attributes=require('./squareMessage.attributes');module[_0x3808('0x8')]=function(_0x2a46b9,_0x4c481a){return _0x2a46b9[_0x3808('0x9')]('SquareMessage',attributes,{'tableName':_0x3808('0xa'),'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 d1a7249..c771bd0 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 _0x607d=['options','raw','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateSquareMessage','SquareMessage'];(function(_0x214a31,_0x41447a){var _0x354fb9=function(_0x5eef67){while(--_0x5eef67){_0x214a31['push'](_0x214a31['shift']());}};_0x354fb9(++_0x41447a);}(_0x607d,0x78));var _0xd607=function(_0x2a4e0f,_0x32f7df){_0x2a4e0f=_0x2a4e0f-0x0;var _0x217ae0=_0x607d[_0x2a4e0f];return _0x217ae0;};'use strict';var _=require(_0xd607('0x0'));var util=require(_0xd607('0x1'));var moment=require(_0xd607('0x2'));var BPromise=require(_0xd607('0x3'));var rs=require(_0xd607('0x4'));var fs=require('fs');var Redis=require(_0xd607('0x5'));var db=require(_0xd607('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd607('0x7'))(_0xd607('0x8'));var config=require(_0xd607('0x9'));var jayson=require(_0xd607('0xa'));var client=jayson[_0xd607('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b4643,_0x797f74,_0x63871b){return new BPromise(function(_0x5d90a3,_0x30ad79){return client[_0xd607('0xc')](_0x1b4643,_0x63871b)[_0xd607('0xd')](function(_0x58b93e){logger['info'](_0xd607('0xe'),_0x797f74,_0xd607('0xf'));logger[_0xd607('0x10')](_0xd607('0x11'),_0x797f74,_0xd607('0xf'),JSON['stringify'](_0x58b93e));if(_0x58b93e[_0xd607('0x12')]){if(_0x58b93e[_0xd607('0x12')][_0xd607('0x13')]===0x1f4){logger[_0xd607('0x12')](_0xd607('0xe'),_0x797f74,_0x58b93e[_0xd607('0x12')]['message']);return _0x30ad79(_0x58b93e[_0xd607('0x12')]['message']);}logger[_0xd607('0x12')](_0xd607('0xe'),_0x797f74,_0x58b93e[_0xd607('0x12')][_0xd607('0x14')]);return _0x5d90a3(_0x58b93e['error'][_0xd607('0x14')]);}else{logger[_0xd607('0x15')]('SquareMessage,\x20%s,\x20%s',_0x797f74,_0xd607('0xf'));_0x5d90a3(_0x58b93e[_0xd607('0x16')][_0xd607('0x14')]);}})['catch'](function(_0x5169e8){logger['error'](_0xd607('0xe'),_0x797f74,_0x5169e8);_0x30ad79(_0x5169e8);});});}exports[_0xd607('0x17')]=function(_0x25e49e){var _0x1616c6=this;return new Promise(function(_0x326e8a,_0x5a8a48){return db[_0xd607('0x18')]['create'](_0x25e49e['body'],{'raw':_0x25e49e[_0xd607('0x19')]?_0x25e49e[_0xd607('0x19')][_0xd607('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3c0aa0){logger['info'](_0xd607('0x17'),_0x25e49e);logger[_0xd607('0x10')](_0xd607('0x17'),_0x25e49e,JSON[_0xd607('0x1b')](_0x3c0aa0));_0x326e8a(_0x3c0aa0);})[_0xd607('0x1c')](function(_0x525e8e){logger['error'](_0xd607('0x17'),_0x525e8e[_0xd607('0x14')],_0x25e49e);_0x5a8a48(_0x1616c6[_0xd607('0x12')](0x1f4,_0x525e8e['message']));});});}; \ No newline at end of file +var _0xeaf5=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x19607c,_0x19ebfa){var _0x3752e9=function(_0x3adcf5){while(--_0x3adcf5){_0x19607c['push'](_0x19607c['shift']());}};_0x3752e9(++_0x19ebfa);}(_0xeaf5,0x173));var _0x5eaf=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0xeaf5[_0x3c5f8d];return _0x3b7beb;};'use strict';var _=require('lodash');var util=require(_0x5eaf('0x0'));var moment=require('moment');var BPromise=require(_0x5eaf('0x1'));var rs=require(_0x5eaf('0x2'));var fs=require('fs');var Redis=require(_0x5eaf('0x3'));var db=require(_0x5eaf('0x4'))['db'];var utils=require(_0x5eaf('0x5'));var logger=require(_0x5eaf('0x6'))(_0x5eaf('0x7'));var config=require(_0x5eaf('0x8'));var jayson=require(_0x5eaf('0x9'));var client=jayson['client'][_0x5eaf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x171899,_0x318136,_0x290611){return new BPromise(function(_0x1cb322,_0x1bea9d){return client[_0x5eaf('0xb')](_0x171899,_0x290611)[_0x5eaf('0xc')](function(_0x2e6453){logger[_0x5eaf('0xd')](_0x5eaf('0xe'),_0x318136,_0x5eaf('0xf'));logger[_0x5eaf('0x10')](_0x5eaf('0x11'),_0x318136,_0x5eaf('0xf'),JSON[_0x5eaf('0x12')](_0x2e6453));if(_0x2e6453[_0x5eaf('0x13')]){if(_0x2e6453['error']['code']===0x1f4){logger[_0x5eaf('0x13')](_0x5eaf('0xe'),_0x318136,_0x2e6453[_0x5eaf('0x13')][_0x5eaf('0x14')]);return _0x1bea9d(_0x2e6453['error']['message']);}logger[_0x5eaf('0x13')](_0x5eaf('0xe'),_0x318136,_0x2e6453[_0x5eaf('0x13')][_0x5eaf('0x14')]);return _0x1cb322(_0x2e6453[_0x5eaf('0x13')][_0x5eaf('0x14')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x318136,_0x5eaf('0xf'));_0x1cb322(_0x2e6453[_0x5eaf('0x15')]['message']);}})[_0x5eaf('0x16')](function(_0x394954){logger[_0x5eaf('0x13')]('SquareMessage,\x20%s,\x20%s',_0x318136,_0x394954);_0x1bea9d(_0x394954);});});}exports['CreateSquareMessage']=function(_0x5bc6c5){var _0x15539c=this;return new Promise(function(_0x8d8f67,_0x3d849f){return db[_0x5eaf('0x17')][_0x5eaf('0x18')](_0x5bc6c5[_0x5eaf('0x19')],{'raw':_0x5bc6c5['options']?_0x5bc6c5[_0x5eaf('0x1a')][_0x5eaf('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x374516){logger[_0x5eaf('0xd')]('CreateSquareMessage',_0x5bc6c5);logger['debug'](_0x5eaf('0x1c'),_0x5bc6c5,JSON[_0x5eaf('0x12')](_0x374516));_0x8d8f67(_0x374516);})[_0x5eaf('0x16')](function(_0x44ad08){logger['error'](_0x5eaf('0x1c'),_0x44ad08[_0x5eaf('0x14')],_0x5bc6c5);_0x3d849f(_0x15539c[_0x5eaf('0x13')](0x1f4,_0x44ad08['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 49859a0..43d8241 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 _0x3003=['/:id/test','post','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x3003,0x91));var _0x3300=function(_0x23fb89,_0x45dfe4){_0x23fb89=_0x23fb89-0x0;var _0x95cb84=_0x3003[_0x23fb89];return _0x95cb84;};'use strict';var multer=require(_0x3300('0x0'));var util=require(_0x3300('0x1'));var path=require('path');var timeout=require(_0x3300('0x2'));var express=require(_0x3300('0x3'));var router=express[_0x3300('0x4')]();var fs_extra=require(_0x3300('0x5'));var auth=require(_0x3300('0x6'));var interaction=require(_0x3300('0x7'));var config=require(_0x3300('0x8'));var controller=require(_0x3300('0x9'));router[_0x3300('0xa')]('/',auth[_0x3300('0xb')](),controller[_0x3300('0xc')]);router[_0x3300('0xa')](_0x3300('0xd'),auth[_0x3300('0xb')](),controller[_0x3300('0xe')]);router[_0x3300('0xa')](_0x3300('0xf'),auth['isAuthenticated'](),timeout('15s'),controller['test']);router[_0x3300('0x10')]('/',auth[_0x3300('0xb')](),controller['create']);router['put'](_0x3300('0xd'),auth[_0x3300('0xb')](),controller[_0x3300('0x11')]);router[_0x3300('0x12')](_0x3300('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x3300('0x13')]=router; \ No newline at end of file +var _0xfa3d=['post','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test'];(function(_0x682a3f,_0x12b172){var _0x103e0b=function(_0x291204){while(--_0x291204){_0x682a3f['push'](_0x682a3f['shift']());}};_0x103e0b(++_0x12b172);}(_0xfa3d,0x1c3));var _0xdfa3=function(_0x353c00,_0x26a620){_0x353c00=_0x353c00-0x0;var _0x490d89=_0xfa3d[_0x353c00];return _0x490d89;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdfa3('0x0'));var timeout=require(_0xdfa3('0x1'));var express=require(_0xdfa3('0x2'));var router=express[_0xdfa3('0x3')]();var fs_extra=require(_0xdfa3('0x4'));var auth=require(_0xdfa3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdfa3('0x6'));router[_0xdfa3('0x7')]('/',auth[_0xdfa3('0x8')](),controller[_0xdfa3('0x9')]);router[_0xdfa3('0x7')](_0xdfa3('0xa'),auth[_0xdfa3('0x8')](),controller[_0xdfa3('0xb')]);router[_0xdfa3('0x7')](_0xdfa3('0xc'),auth[_0xdfa3('0x8')](),timeout('15s'),controller['test']);router[_0xdfa3('0xd')]('/',auth[_0xdfa3('0x8')](),controller['create']);router['put'](_0xdfa3('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xdfa3('0xe')](_0xdfa3('0xa'),auth[_0xdfa3('0x8')](),controller['destroy']);module[_0xdfa3('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index cde3253..490e208 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 _0xb2af=['exports','STRING'];(function(_0x34cec5,_0x15c71c){var _0x203227=function(_0x570dfd){while(--_0x570dfd){_0x34cec5['push'](_0x34cec5['shift']());}};_0x203227(++_0x15c71c);}(_0xb2af,0x14a));var _0xfb2a=function(_0x41eb02,_0x2f0de6){_0x41eb02=_0x41eb02-0x0;var _0x59710d=_0xb2af[_0x41eb02];return _0x59710d;};'use strict';var Sequelize=require('sequelize');module[_0xfb2a('0x0')]={'name':{'type':Sequelize[_0xfb2a('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xfb2a('0x1')]},'description':{'type':Sequelize[_0xfb2a('0x1')]}}; \ No newline at end of file +var _0xf718=['name','sequelize','exports','STRING'];(function(_0x490a39,_0x519f6d){var _0x1b24a1=function(_0x30bce2){while(--_0x30bce2){_0x490a39['push'](_0x490a39['shift']());}};_0x1b24a1(++_0x519f6d);}(_0xf718,0x1d1));var _0x8f71=function(_0x3c873e,_0x224e7f){_0x3c873e=_0x3c873e-0x0;var _0x3bc68c=_0xf718[_0x3c873e];return _0x3bc68c;};'use strict';var Sequelize=require(_0x8f71('0x0'));module[_0x8f71('0x1')]={'name':{'type':Sequelize[_0x8f71('0x2')],'unique':_0x8f71('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8f71('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 3aba7b2..f0669f2 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 _0xefa5=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','get','ODBC','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','SquareOdbc','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','test','odbc','openSync','dsn','closeSync','eml-format','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x10a2fd,_0x31c178){var _0x1e16f9=function(_0x28e3ef){while(--_0x28e3ef){_0x10a2fd['push'](_0x10a2fd['shift']());}};_0x1e16f9(++_0x31c178);}(_0xefa5,0x9c));var _0x5efa=function(_0x29cd14,_0x245c40){_0x29cd14=_0x29cd14-0x0;var _0x4229d1=_0xefa5[_0x29cd14];return _0x4229d1;};'use strict';var emlformat=require(_0x5efa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5efa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5efa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5efa('0x3'));var util=require(_0x5efa('0x4'));var path=require('path');var sox=require(_0x5efa('0x5'));var csv=require(_0x5efa('0x6'));var ejs=require(_0x5efa('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5efa('0x8'));var squel=require(_0x5efa('0x9'));var crypto=require(_0x5efa('0xa'));var jsforce=require(_0x5efa('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5efa('0x6'));var querystring=require('querystring');var Papa=require(_0x5efa('0xc'));var Redis=require('ioredis');var authService=require(_0x5efa('0xd'));var qs=require(_0x5efa('0xe'));var as=require(_0x5efa('0xf'));var hardwareService=require(_0x5efa('0x10'));var logger=require(_0x5efa('0x11'))('api');var utils=require(_0x5efa('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5efa('0x13'));var db=require(_0x5efa('0x14'))['db'];function respondWithStatusCode(_0x7aa488,_0xf4bd4c){_0xf4bd4c=_0xf4bd4c||0xcc;return function(_0x3dcd35){if(_0x3dcd35){return _0x7aa488['sendStatus'](_0xf4bd4c);}return _0x7aa488['status'](_0xf4bd4c)['end']();};}function respondWithResult(_0x1d19ab,_0x29c9a3){_0x29c9a3=_0x29c9a3||0xc8;return function(_0x300553){if(_0x300553){return _0x1d19ab[_0x5efa('0x15')](_0x29c9a3)[_0x5efa('0x16')](_0x300553);}};}function respondWithFilteredResult(_0x5dab51,_0x546f05){return function(_0x460974){if(_0x460974){var _0x1564a3=typeof _0x546f05['offset']===_0x5efa('0x17')&&typeof _0x546f05['limit']===_0x5efa('0x17');var _0x5011b6=_0x460974[_0x5efa('0x18')];var _0x170b85=_0x1564a3?0x0:_0x546f05[_0x5efa('0x19')];var _0xf9ccbe=_0x1564a3?_0x460974['count']:_0x546f05['offset']+_0x546f05[_0x5efa('0x1a')];var _0x1968ff;if(_0xf9ccbe>=_0x5011b6){_0xf9ccbe=_0x5011b6;_0x1968ff=0xc8;}else{_0x1968ff=0xce;}_0x5dab51['status'](_0x1968ff);return _0x5dab51['set'](_0x5efa('0x1b'),_0x170b85+'-'+_0xf9ccbe+'/'+_0x5011b6)['json'](_0x460974);}return null;};}function patchUpdates(_0x4106dc){return function(_0x4a7693){try{jsonpatch[_0x5efa('0x1c')](_0x4a7693,_0x4106dc,!![]);}catch(_0x80060d){return BPromise[_0x5efa('0x1d')](_0x80060d);}return _0x4a7693['save']();};}function saveUpdates(_0x1ef1e4,_0x4b79e0){return function(_0x3004b8){if(_0x3004b8){return _0x3004b8[_0x5efa('0x1e')](_0x1ef1e4)[_0x5efa('0x1f')](function(_0x34f3c5){return _0x34f3c5;});}return null;};}function removeEntity(_0x7acad7,_0x28c942){return function(_0x580236){if(_0x580236){return _0x580236['destroy']()[_0x5efa('0x1f')](function(){var _0x164bb9=_0x580236[_0x5efa('0x20')]({'plain':!![]});var _0x1c51d0=_0x5efa('0x21');return db[_0x5efa('0x22')][_0x5efa('0x23')]({'where':{'type':_0x1c51d0,'resourceId':_0x164bb9['id']}})[_0x5efa('0x1f')](function(){return _0x580236;});})[_0x5efa('0x1f')](function(){_0x7acad7['status'](0xcc)[_0x5efa('0x24')]();});}};}function handleEntityNotFound(_0x514725,_0xa2f411){return function(_0x331794){if(!_0x331794){_0x514725[_0x5efa('0x25')](0x194);}return _0x331794;};}function handleError(_0x36b915,_0x17f26b){_0x17f26b=_0x17f26b||0x1f4;return function(_0x1bd244){logger['error'](_0x1bd244[_0x5efa('0x26')]);if(_0x1bd244[_0x5efa('0x27')]){delete _0x1bd244[_0x5efa('0x27')];}_0x36b915[_0x5efa('0x15')](_0x17f26b)[_0x5efa('0x28')](_0x1bd244);};}exports[_0x5efa('0x29')]=function(_0x1bf8ec,_0x10a679){var _0x464bc5={},_0x5976d6={},_0x10b284={'count':0x0,'rows':[]};var _0x4310c4=_['map'](db[_0x5efa('0x2a')][_0x5efa('0x2b')],function(_0x4efeac){return{'name':_0x4efeac[_0x5efa('0x2c')],'type':_0x4efeac['type'][_0x5efa('0x2d')]};});_0x5976d6[_0x5efa('0x2e')]=_['map'](_0x4310c4,_0x5efa('0x27'));_0x5976d6[_0x5efa('0x2f')]=_[_0x5efa('0x30')](_0x1bf8ec[_0x5efa('0x2f')]);_0x5976d6['filters']=_[_0x5efa('0x31')](_0x5976d6[_0x5efa('0x2e')],_0x5976d6[_0x5efa('0x2f')]);_0x464bc5[_0x5efa('0x32')]=_[_0x5efa('0x31')](_0x5976d6[_0x5efa('0x2e')],qs[_0x5efa('0x33')](_0x1bf8ec[_0x5efa('0x2f')][_0x5efa('0x33')]));_0x464bc5[_0x5efa('0x32')]=_0x464bc5[_0x5efa('0x32')][_0x5efa('0x34')]?_0x464bc5[_0x5efa('0x32')]:_0x5976d6[_0x5efa('0x2e')];if(!_0x1bf8ec[_0x5efa('0x2f')][_0x5efa('0x35')](_0x5efa('0x36'))){_0x464bc5[_0x5efa('0x1a')]=qs[_0x5efa('0x1a')](_0x1bf8ec[_0x5efa('0x2f')]['limit']);_0x464bc5['offset']=qs[_0x5efa('0x19')](_0x1bf8ec[_0x5efa('0x2f')][_0x5efa('0x19')]);}_0x464bc5['order']=qs[_0x5efa('0x37')](_0x1bf8ec['query'][_0x5efa('0x37')]);_0x464bc5['where']=qs[_0x5efa('0x38')](_[_0x5efa('0x39')](_0x1bf8ec[_0x5efa('0x2f')],_0x5976d6['filters']),_0x4310c4);if(_0x1bf8ec['query']['filter']){_0x464bc5[_0x5efa('0x3a')]=_[_0x5efa('0x3b')](_0x464bc5['where'],{'$or':_['map'](_0x4310c4,function(_0x3b64f6){if(_0x3b64f6[_0x5efa('0x3c')]!==_0x5efa('0x3d')){var _0x28f384={};_0x28f384[_0x3b64f6[_0x5efa('0x27')]]={'$like':'%'+_0x1bf8ec[_0x5efa('0x2f')][_0x5efa('0x3e')]+'%'};return _0x28f384;}})});}_0x464bc5=_[_0x5efa('0x3b')]({},_0x464bc5,_0x1bf8ec['options']);var _0x3f43c3={'where':_0x464bc5['where']};return db[_0x5efa('0x2a')]['count'](_0x3f43c3)[_0x5efa('0x1f')](function(_0xbbe5b4){_0x10b284[_0x5efa('0x18')]=_0xbbe5b4;if(_0x1bf8ec['query'][_0x5efa('0x3f')]){_0x464bc5[_0x5efa('0x40')]=[{'all':!![]}];}return db[_0x5efa('0x2a')][_0x5efa('0x41')](_0x464bc5);})[_0x5efa('0x1f')](function(_0x56e6a4){_0x10b284['rows']=_0x56e6a4;return _0x10b284;})[_0x5efa('0x1f')](respondWithFilteredResult(_0x10a679,_0x464bc5))[_0x5efa('0x42')](handleError(_0x10a679,null));};exports[_0x5efa('0x43')]=function(_0x2f3112,_0x487445){var _0x1eaec0={'raw':!![],'where':{'id':_0x2f3112['params']['id']}},_0x400d29={};_0x400d29[_0x5efa('0x2e')]=_[_0x5efa('0x30')](db[_0x5efa('0x2a')]['rawAttributes']);_0x400d29['query']=_['keys'](_0x2f3112['query']);_0x400d29['filters']=_[_0x5efa('0x31')](_0x400d29[_0x5efa('0x2e')],_0x400d29[_0x5efa('0x2f')]);_0x1eaec0['attributes']=_[_0x5efa('0x31')](_0x400d29[_0x5efa('0x2e')],qs[_0x5efa('0x33')](_0x2f3112[_0x5efa('0x2f')][_0x5efa('0x33')]));_0x1eaec0[_0x5efa('0x32')]=_0x1eaec0[_0x5efa('0x32')]['length']?_0x1eaec0[_0x5efa('0x32')]:_0x400d29[_0x5efa('0x2e')];if(_0x2f3112['query'][_0x5efa('0x3f')]){_0x1eaec0[_0x5efa('0x40')]=[{'all':!![]}];}_0x1eaec0=_['merge']({},_0x1eaec0,_0x2f3112[_0x5efa('0x44')]);return db[_0x5efa('0x2a')][_0x5efa('0x45')](_0x1eaec0)[_0x5efa('0x1f')](handleEntityNotFound(_0x487445,null))['then'](respondWithResult(_0x487445,null))[_0x5efa('0x42')](handleError(_0x487445,null));};exports['create']=function(_0xef5f02,_0x627d01){return db['SquareOdbc'][_0x5efa('0x46')](_0xef5f02[_0x5efa('0x47')],{})[_0x5efa('0x1f')](function(_0x1e37df){var _0x3bc88a=_0xef5f02[_0x5efa('0x48')][_0x5efa('0x20')]({'plain':!![]});if(!_0x3bc88a)throw new Error(_0x5efa('0x49'));if(_0x3bc88a[_0x5efa('0x4a')]===_0x5efa('0x48')){var _0x3feb46=_0x1e37df[_0x5efa('0x20')]({'plain':!![]});var _0x5b389c=_0x5efa('0x21');return db[_0x5efa('0x4b')][_0x5efa('0x45')]({'where':{'name':_0x5b389c,'userProfileId':_0x3bc88a[_0x5efa('0x4c')]},'raw':!![]})[_0x5efa('0x1f')](function(_0x2c1520){if(_0x2c1520&&_0x2c1520[_0x5efa('0x4d')]===0x0){return db['UserProfileResource'][_0x5efa('0x46')]({'name':_0x3feb46['name'],'resourceId':_0x3feb46['id'],'type':_0x2c1520[_0x5efa('0x27')],'sectionId':_0x2c1520['id']},{})[_0x5efa('0x1f')](function(){return _0x1e37df;});}else{return _0x1e37df;}})['catch'](function(_0x236c59){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x236c59);throw _0x236c59;});}return _0x1e37df;})[_0x5efa('0x1f')](respondWithResult(_0x627d01,0xc9))[_0x5efa('0x42')](handleError(_0x627d01,null));};exports['update']=function(_0x4b3dbf,_0x24b6dc){if(_0x4b3dbf[_0x5efa('0x47')]['id']){delete _0x4b3dbf[_0x5efa('0x47')]['id'];}return db[_0x5efa('0x2a')][_0x5efa('0x45')]({'where':{'id':_0x4b3dbf[_0x5efa('0x4e')]['id']}})['then'](handleEntityNotFound(_0x24b6dc,null))[_0x5efa('0x1f')](saveUpdates(_0x4b3dbf['body'],null))[_0x5efa('0x1f')](respondWithResult(_0x24b6dc,null))[_0x5efa('0x42')](handleError(_0x24b6dc,null));};exports[_0x5efa('0x23')]=function(_0x52772d,_0xff6ca8){return db[_0x5efa('0x2a')][_0x5efa('0x45')]({'where':{'id':_0x52772d[_0x5efa('0x4e')]['id']}})[_0x5efa('0x1f')](handleEntityNotFound(_0xff6ca8,null))[_0x5efa('0x1f')](removeEntity(_0xff6ca8,null))[_0x5efa('0x42')](handleError(_0xff6ca8,null));};exports[_0x5efa('0x4f')]=function(_0x1d9ba0,_0x5466fb,_0x3f687b){var _0x1f3e2e;return db[_0x5efa('0x2a')]['find']({'where':{'id':_0x1d9ba0[_0x5efa('0x4e')]['id']},'attributes':['id','dsn']})[_0x5efa('0x1f')](handleEntityNotFound(_0x5466fb,null))[_0x5efa('0x1f')](function(_0x36f464){if(_0x36f464){var _0x19d8cd=require(_0x5efa('0x50'))();_0x19d8cd[_0x5efa('0x51')](_0x36f464[_0x5efa('0x52')]);_0x19d8cd[_0x5efa('0x53')]();return _0x36f464;}})[_0x5efa('0x1f')](respondWithResult(_0x5466fb,null))[_0x5efa('0x42')](handleError(_0x5466fb,null));}; \ No newline at end of file +var _0xff83=['json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','ODBC','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareOdbc','includeAll','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','odbc','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x4bc992,_0x175e4a){var _0x4079b1=function(_0x302b54){while(--_0x302b54){_0x4bc992['push'](_0x4bc992['shift']());}};_0x4079b1(++_0x175e4a);}(_0xff83,0x93));var _0x3ff8=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xff83[_0x13ea00];return _0x1f7347;};'use strict';var emlformat=require(_0x3ff8('0x0'));var rimraf=require(_0x3ff8('0x1'));var zipdir=require(_0x3ff8('0x2'));var jsonpatch=require(_0x3ff8('0x3'));var rp=require(_0x3ff8('0x4'));var moment=require(_0x3ff8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3ff8('0x6'));var util=require(_0x3ff8('0x7'));var path=require(_0x3ff8('0x8'));var sox=require(_0x3ff8('0x9'));var csv=require(_0x3ff8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ff8('0xb'));var _=require(_0x3ff8('0xc'));var squel=require(_0x3ff8('0xd'));var crypto=require(_0x3ff8('0xe'));var jsforce=require(_0x3ff8('0xf'));var deskjs=require(_0x3ff8('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3ff8('0x11'));var Papa=require(_0x3ff8('0x12'));var Redis=require('ioredis');var authService=require(_0x3ff8('0x13'));var qs=require(_0x3ff8('0x14'));var as=require(_0x3ff8('0x15'));var hardwareService=require(_0x3ff8('0x16'));var logger=require(_0x3ff8('0x17'))(_0x3ff8('0x18'));var utils=require(_0x3ff8('0x19'));var config=require(_0x3ff8('0x1a'));var licenseUtil=require(_0x3ff8('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2de97c,_0x211a9e){_0x211a9e=_0x211a9e||0xcc;return function(_0x5d5b2e){if(_0x5d5b2e){return _0x2de97c[_0x3ff8('0x1c')](_0x211a9e);}return _0x2de97c[_0x3ff8('0x1d')](_0x211a9e)[_0x3ff8('0x1e')]();};}function respondWithResult(_0x2b5951,_0x1672bc){_0x1672bc=_0x1672bc||0xc8;return function(_0x527219){if(_0x527219){return _0x2b5951[_0x3ff8('0x1d')](_0x1672bc)[_0x3ff8('0x1f')](_0x527219);}};}function respondWithFilteredResult(_0x50551b,_0x21abc8){return function(_0x4d3d44){if(_0x4d3d44){var _0x529957=typeof _0x21abc8[_0x3ff8('0x20')]===_0x3ff8('0x21')&&typeof _0x21abc8[_0x3ff8('0x22')]===_0x3ff8('0x21');var _0x37421c=_0x4d3d44['count'];var _0x5593c4=_0x529957?0x0:_0x21abc8[_0x3ff8('0x20')];var _0x5bba2f=_0x529957?_0x4d3d44[_0x3ff8('0x23')]:_0x21abc8[_0x3ff8('0x20')]+_0x21abc8[_0x3ff8('0x22')];var _0x526697;if(_0x5bba2f>=_0x37421c){_0x5bba2f=_0x37421c;_0x526697=0xc8;}else{_0x526697=0xce;}_0x50551b[_0x3ff8('0x1d')](_0x526697);return _0x50551b[_0x3ff8('0x24')](_0x3ff8('0x25'),_0x5593c4+'-'+_0x5bba2f+'/'+_0x37421c)[_0x3ff8('0x1f')](_0x4d3d44);}return null;};}function patchUpdates(_0x70022d){return function(_0x37a8a0){try{jsonpatch['apply'](_0x37a8a0,_0x70022d,!![]);}catch(_0x566955){return BPromise[_0x3ff8('0x26')](_0x566955);}return _0x37a8a0[_0x3ff8('0x27')]();};}function saveUpdates(_0x183b13,_0x1ca4e9){return function(_0xbcb231){if(_0xbcb231){return _0xbcb231[_0x3ff8('0x28')](_0x183b13)[_0x3ff8('0x29')](function(_0x1a7dff){return _0x1a7dff;});}return null;};}function removeEntity(_0x2efc06,_0x408aef){return function(_0x466ec1){if(_0x466ec1){return _0x466ec1[_0x3ff8('0x2a')]()[_0x3ff8('0x29')](function(){var _0x223ea9=_0x466ec1[_0x3ff8('0x2b')]({'plain':!![]});var _0x24c7f9=_0x3ff8('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x24c7f9,'resourceId':_0x223ea9['id']}})[_0x3ff8('0x29')](function(){return _0x466ec1;});})[_0x3ff8('0x29')](function(){_0x2efc06[_0x3ff8('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc801bb,_0x5b0a22){return function(_0x2f588e){if(!_0x2f588e){_0xc801bb[_0x3ff8('0x1c')](0x194);}return _0x2f588e;};}function handleError(_0x41e3a8,_0x2c6d7b){_0x2c6d7b=_0x2c6d7b||0x1f4;return function(_0x11b8fd){logger['error'](_0x11b8fd[_0x3ff8('0x2d')]);if(_0x11b8fd[_0x3ff8('0x2e')]){delete _0x11b8fd[_0x3ff8('0x2e')];}_0x41e3a8[_0x3ff8('0x1d')](_0x2c6d7b)[_0x3ff8('0x2f')](_0x11b8fd);};}exports[_0x3ff8('0x30')]=function(_0x122229,_0x39a88c){var _0x55461f={},_0x53eed0={},_0xb07e2={'count':0x0,'rows':[]};var _0x4098a9=_['map'](db['SquareOdbc'][_0x3ff8('0x31')],function(_0x3ba92a){return{'name':_0x3ba92a['fieldName'],'type':_0x3ba92a[_0x3ff8('0x32')][_0x3ff8('0x33')]};});_0x53eed0[_0x3ff8('0x34')]=_[_0x3ff8('0x35')](_0x4098a9,'name');_0x53eed0[_0x3ff8('0x36')]=_[_0x3ff8('0x37')](_0x122229['query']);_0x53eed0[_0x3ff8('0x38')]=_[_0x3ff8('0x39')](_0x53eed0[_0x3ff8('0x34')],_0x53eed0[_0x3ff8('0x36')]);_0x55461f[_0x3ff8('0x3a')]=_[_0x3ff8('0x39')](_0x53eed0[_0x3ff8('0x34')],qs[_0x3ff8('0x3b')](_0x122229[_0x3ff8('0x36')][_0x3ff8('0x3b')]));_0x55461f[_0x3ff8('0x3a')]=_0x55461f[_0x3ff8('0x3a')][_0x3ff8('0x3c')]?_0x55461f['attributes']:_0x53eed0[_0x3ff8('0x34')];if(!_0x122229[_0x3ff8('0x36')][_0x3ff8('0x3d')]('nolimit')){_0x55461f['limit']=qs[_0x3ff8('0x22')](_0x122229[_0x3ff8('0x36')][_0x3ff8('0x22')]);_0x55461f[_0x3ff8('0x20')]=qs[_0x3ff8('0x20')](_0x122229[_0x3ff8('0x36')]['offset']);}_0x55461f[_0x3ff8('0x3e')]=qs[_0x3ff8('0x3f')](_0x122229[_0x3ff8('0x36')]['sort']);_0x55461f[_0x3ff8('0x40')]=qs['filters'](_[_0x3ff8('0x41')](_0x122229['query'],_0x53eed0[_0x3ff8('0x38')]),_0x4098a9);if(_0x122229[_0x3ff8('0x36')][_0x3ff8('0x42')]){_0x55461f[_0x3ff8('0x40')]=_[_0x3ff8('0x43')](_0x55461f[_0x3ff8('0x40')],{'$or':_['map'](_0x4098a9,function(_0x2644ce){if(_0x2644ce[_0x3ff8('0x32')]!==_0x3ff8('0x44')){var _0x230e28={};_0x230e28[_0x2644ce[_0x3ff8('0x2e')]]={'$like':'%'+_0x122229[_0x3ff8('0x36')][_0x3ff8('0x42')]+'%'};return _0x230e28;}})});}_0x55461f=_[_0x3ff8('0x43')]({},_0x55461f,_0x122229[_0x3ff8('0x45')]);var _0x4b4ac0={'where':_0x55461f[_0x3ff8('0x40')]};return db[_0x3ff8('0x46')][_0x3ff8('0x23')](_0x4b4ac0)[_0x3ff8('0x29')](function(_0x2e5d92){_0xb07e2[_0x3ff8('0x23')]=_0x2e5d92;if(_0x122229['query'][_0x3ff8('0x47')]){_0x55461f['include']=[{'all':!![]}];}return db[_0x3ff8('0x46')][_0x3ff8('0x48')](_0x55461f);})['then'](function(_0x5c944b){_0xb07e2['rows']=_0x5c944b;return _0xb07e2;})['then'](respondWithFilteredResult(_0x39a88c,_0x55461f))[_0x3ff8('0x49')](handleError(_0x39a88c,null));};exports['show']=function(_0x24d637,_0x4c1e2e){var _0x2c67e4={'raw':!![],'where':{'id':_0x24d637[_0x3ff8('0x4a')]['id']}},_0x16dae0={};_0x16dae0[_0x3ff8('0x34')]=_[_0x3ff8('0x37')](db[_0x3ff8('0x46')]['rawAttributes']);_0x16dae0[_0x3ff8('0x36')]=_[_0x3ff8('0x37')](_0x24d637[_0x3ff8('0x36')]);_0x16dae0[_0x3ff8('0x38')]=_[_0x3ff8('0x39')](_0x16dae0[_0x3ff8('0x34')],_0x16dae0[_0x3ff8('0x36')]);_0x2c67e4[_0x3ff8('0x3a')]=_[_0x3ff8('0x39')](_0x16dae0[_0x3ff8('0x34')],qs[_0x3ff8('0x3b')](_0x24d637[_0x3ff8('0x36')]['fields']));_0x2c67e4[_0x3ff8('0x3a')]=_0x2c67e4[_0x3ff8('0x3a')][_0x3ff8('0x3c')]?_0x2c67e4['attributes']:_0x16dae0['model'];if(_0x24d637[_0x3ff8('0x36')]['includeAll']){_0x2c67e4['include']=[{'all':!![]}];}_0x2c67e4=_[_0x3ff8('0x43')]({},_0x2c67e4,_0x24d637[_0x3ff8('0x45')]);return db['SquareOdbc'][_0x3ff8('0x4b')](_0x2c67e4)[_0x3ff8('0x29')](handleEntityNotFound(_0x4c1e2e,null))[_0x3ff8('0x29')](respondWithResult(_0x4c1e2e,null))[_0x3ff8('0x49')](handleError(_0x4c1e2e,null));};exports[_0x3ff8('0x4c')]=function(_0x584955,_0x40a2df){return db[_0x3ff8('0x46')]['create'](_0x584955[_0x3ff8('0x4d')],{})['then'](function(_0x4923a0){var _0x276a84=_0x584955[_0x3ff8('0x4e')][_0x3ff8('0x2b')]({'plain':!![]});if(!_0x276a84)throw new Error(_0x3ff8('0x4f'));if(_0x276a84[_0x3ff8('0x50')]==='user'){var _0x5c7742=_0x4923a0[_0x3ff8('0x2b')]({'plain':!![]});var _0x59c5db=_0x3ff8('0x2c');return db[_0x3ff8('0x51')][_0x3ff8('0x4b')]({'where':{'name':_0x59c5db,'userProfileId':_0x276a84[_0x3ff8('0x52')]},'raw':!![]})['then'](function(_0x3f72a3){if(_0x3f72a3&&_0x3f72a3[_0x3ff8('0x53')]===0x0){return db[_0x3ff8('0x54')][_0x3ff8('0x4c')]({'name':_0x5c7742['name'],'resourceId':_0x5c7742['id'],'type':_0x3f72a3[_0x3ff8('0x2e')],'sectionId':_0x3f72a3['id']},{})[_0x3ff8('0x29')](function(){return _0x4923a0;});}else{return _0x4923a0;}})['catch'](function(_0x23644e){logger[_0x3ff8('0x55')](_0x3ff8('0x56'),_0x23644e);throw _0x23644e;});}return _0x4923a0;})[_0x3ff8('0x29')](respondWithResult(_0x40a2df,0xc9))['catch'](handleError(_0x40a2df,null));};exports[_0x3ff8('0x28')]=function(_0x1ab7bd,_0x412501){if(_0x1ab7bd['body']['id']){delete _0x1ab7bd[_0x3ff8('0x4d')]['id'];}return db['SquareOdbc'][_0x3ff8('0x4b')]({'where':{'id':_0x1ab7bd[_0x3ff8('0x4a')]['id']}})[_0x3ff8('0x29')](handleEntityNotFound(_0x412501,null))[_0x3ff8('0x29')](saveUpdates(_0x1ab7bd[_0x3ff8('0x4d')],null))['then'](respondWithResult(_0x412501,null))[_0x3ff8('0x49')](handleError(_0x412501,null));};exports[_0x3ff8('0x2a')]=function(_0xfa8747,_0x951f7){return db['SquareOdbc'][_0x3ff8('0x4b')]({'where':{'id':_0xfa8747['params']['id']}})['then'](handleEntityNotFound(_0x951f7,null))[_0x3ff8('0x29')](removeEntity(_0x951f7,null))[_0x3ff8('0x49')](handleError(_0x951f7,null));};exports['test']=function(_0xd48c34,_0x4bf71f,_0x2da7e8){var _0x2d5611;return db[_0x3ff8('0x46')][_0x3ff8('0x4b')]({'where':{'id':_0xd48c34[_0x3ff8('0x4a')]['id']},'attributes':['id',_0x3ff8('0x57')]})[_0x3ff8('0x29')](handleEntityNotFound(_0x4bf71f,null))['then'](function(_0x179776){if(_0x179776){var _0x189ff6=require(_0x3ff8('0x58'))();_0x189ff6['openSync'](_0x179776[_0x3ff8('0x57')]);_0x189ff6['closeSync']();return _0x179776;}})[_0x3ff8('0x29')](respondWithResult(_0x4bf71f,null))[_0x3ff8('0x49')](handleError(_0x4bf71f,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index e2dea91..d0c6f86 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 _0x2a2c=['./squareOdbc.attributes','exports','define','SquareOdbc','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x2a2c,0x197));var _0xc2a2=function(_0x769fc1,_0x4b4339){_0x769fc1=_0x769fc1-0x0;var _0x2bbb37=_0x2a2c[_0x769fc1];return _0x2bbb37;};'use strict';var _=require(_0xc2a2('0x0'));var util=require(_0xc2a2('0x1'));var logger=require('../../config/logger')(_0xc2a2('0x2'));var moment=require(_0xc2a2('0x3'));var BPromise=require(_0xc2a2('0x4'));var rp=require(_0xc2a2('0x5'));var fs=require('fs');var path=require(_0xc2a2('0x6'));var rimraf=require(_0xc2a2('0x7'));var config=require(_0xc2a2('0x8'));var attributes=require(_0xc2a2('0x9'));module[_0xc2a2('0xa')]=function(_0x149092,_0x401797){return _0x149092[_0xc2a2('0xb')](_0xc2a2('0xc'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43f0=['request-promise','rimraf','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','moment'];(function(_0x12591f,_0x68f920){var _0x382e61=function(_0xa7e963){while(--_0xa7e963){_0x12591f['push'](_0x12591f['shift']());}};_0x382e61(++_0x68f920);}(_0x43f0,0x1d2));var _0x043f=function(_0xe2da2f,_0x1ce93d){_0xe2da2f=_0xe2da2f-0x0;var _0x42b59c=_0x43f0[_0xe2da2f];return _0x42b59c;};'use strict';var _=require(_0x043f('0x0'));var util=require(_0x043f('0x1'));var logger=require(_0x043f('0x2'))('api');var moment=require(_0x043f('0x3'));var BPromise=require('bluebird');var rp=require(_0x043f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x043f('0x5'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x043f('0x6')]=function(_0xc49784,_0x97a5ca){return _0xc49784[_0x043f('0x7')](_0x043f('0x8'),attributes,{'tableName':_0x043f('0x9'),'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 211f619..b91f5e5 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 _0x9dbd=['error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x38aa54,_0x379627){var _0x46b04e=function(_0x21691e){while(--_0x21691e){_0x38aa54['push'](_0x38aa54['shift']());}};_0x46b04e(++_0x379627);}(_0x9dbd,0x72));var _0xd9db=function(_0x4d5b51,_0x4b2851){_0x4d5b51=_0x4d5b51-0x0;var _0x51db59=_0x9dbd[_0x4d5b51];return _0x51db59;};'use strict';var _=require(_0xd9db('0x0'));var util=require(_0xd9db('0x1'));var moment=require(_0xd9db('0x2'));var BPromise=require(_0xd9db('0x3'));var rs=require(_0xd9db('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9db('0x5'))['db'];var utils=require(_0xd9db('0x6'));var logger=require(_0xd9db('0x7'))(_0xd9db('0x8'));var config=require('../../config/environment');var jayson=require(_0xd9db('0x9'));var client=jayson[_0xd9db('0xa')][_0xd9db('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x257b10,_0x39626e,_0x10ce11){return new BPromise(function(_0x16b1ff,_0x1dd60a){return client[_0xd9db('0xc')](_0x257b10,_0x10ce11)[_0xd9db('0xd')](function(_0x3ffbad){logger[_0xd9db('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x39626e,'request\x20sent');logger[_0xd9db('0xf')](_0xd9db('0x10'),_0x39626e,'request\x20sent',JSON[_0xd9db('0x11')](_0x3ffbad));if(_0x3ffbad['error']){if(_0x3ffbad[_0xd9db('0x12')][_0xd9db('0x13')]===0x1f4){logger[_0xd9db('0x12')](_0xd9db('0x14'),_0x39626e,_0x3ffbad[_0xd9db('0x12')]['message']);return _0x1dd60a(_0x3ffbad[_0xd9db('0x12')][_0xd9db('0x15')]);}logger[_0xd9db('0x12')](_0xd9db('0x14'),_0x39626e,_0x3ffbad[_0xd9db('0x12')][_0xd9db('0x15')]);return _0x16b1ff(_0x3ffbad['error']['message']);}else{logger[_0xd9db('0xe')](_0xd9db('0x14'),_0x39626e,'request\x20sent');_0x16b1ff(_0x3ffbad[_0xd9db('0x16')][_0xd9db('0x15')]);}})[_0xd9db('0x17')](function(_0x203623){logger[_0xd9db('0x12')](_0xd9db('0x14'),_0x39626e,_0x203623);_0x1dd60a(_0x203623);});});}exports[_0xd9db('0x18')]=function(_0x38a3e4){var _0x2426cf=this;return new Promise(function(_0xf286c,_0x10243d){return db[_0xd9db('0x19')][_0xd9db('0x1a')]({'raw':_0x38a3e4[_0xd9db('0x1b')]?_0x38a3e4[_0xd9db('0x1b')][_0xd9db('0x1c')]===undefined?!![]:![]:!![],'where':_0x38a3e4['options']?_0x38a3e4[_0xd9db('0x1b')]['where']||null:null,'attributes':_0x38a3e4[_0xd9db('0x1b')]?_0x38a3e4[_0xd9db('0x1b')][_0xd9db('0x1d')]||null:null,'include':_0x38a3e4[_0xd9db('0x1b')]?_0x38a3e4[_0xd9db('0x1b')][_0xd9db('0x1e')]?_[_0xd9db('0x1f')](_0x38a3e4['options'][_0xd9db('0x1e')],function(_0x564195){return{'model':db[_0x564195[_0xd9db('0x20')]],'as':_0x564195['as'],'attributes':_0x564195[_0xd9db('0x1d')],'include':_0x564195[_0xd9db('0x1e')]?_[_0xd9db('0x1f')](_0x564195[_0xd9db('0x1e')],function(_0x2e34e1){return{'model':db[_0x2e34e1[_0xd9db('0x20')]],'as':_0x2e34e1['as'],'attributes':_0x2e34e1[_0xd9db('0x1d')],'include':_0x2e34e1[_0xd9db('0x1e')]?_[_0xd9db('0x1f')](_0x2e34e1[_0xd9db('0x1e')],function(_0x19a999){return{'model':db[_0x19a999[_0xd9db('0x20')]],'as':_0x19a999['as'],'attributes':_0x19a999[_0xd9db('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd9db('0xd')](function(_0x458145){logger[_0xd9db('0xe')](_0xd9db('0x18'),_0x38a3e4);logger[_0xd9db('0xf')]('ShowSquareOdbc',_0x38a3e4,JSON['stringify'](_0x458145));_0xf286c(_0x458145);})[_0xd9db('0x17')](function(_0xa9098b){logger[_0xd9db('0x12')](_0xd9db('0x18'),_0xa9098b[_0xd9db('0x15')],_0x38a3e4);_0x10243d(_0x2426cf[_0xd9db('0x12')](0x1f4,_0xa9098b[_0xd9db('0x15')]));});});}; \ No newline at end of file +var _0x1f1c=['options','raw','where','include','map','model','attributes','ShowSquareOdbc','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','SquareOdbc,\x20%s,\x20%s','message','result','catch','SquareOdbc','find'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0x1f1c,0xce));var _0xc1f1=function(_0x6e9351,_0x2032da){_0x6e9351=_0x6e9351-0x0;var _0x5c33a5=_0x1f1c[_0x6e9351];return _0x5c33a5;};'use strict';var _=require(_0xc1f1('0x0'));var util=require(_0xc1f1('0x1'));var moment=require(_0xc1f1('0x2'));var BPromise=require(_0xc1f1('0x3'));var rs=require(_0xc1f1('0x4'));var fs=require('fs');var Redis=require(_0xc1f1('0x5'));var db=require(_0xc1f1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1f1('0x7'))('rpc');var config=require(_0xc1f1('0x8'));var jayson=require(_0xc1f1('0x9'));var client=jayson[_0xc1f1('0xa')][_0xc1f1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31454e,_0x40f9ca,_0x4f31ac){return new BPromise(function(_0xf3716,_0x2d700a){return client[_0xc1f1('0xc')](_0x31454e,_0x4f31ac)[_0xc1f1('0xd')](function(_0x2b8767){logger[_0xc1f1('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x40f9ca,_0xc1f1('0xf'));logger[_0xc1f1('0x10')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x40f9ca,_0xc1f1('0xf'),JSON[_0xc1f1('0x11')](_0x2b8767));if(_0x2b8767['error']){if(_0x2b8767[_0xc1f1('0x12')]['code']===0x1f4){logger[_0xc1f1('0x12')](_0xc1f1('0x13'),_0x40f9ca,_0x2b8767['error'][_0xc1f1('0x14')]);return _0x2d700a(_0x2b8767[_0xc1f1('0x12')][_0xc1f1('0x14')]);}logger[_0xc1f1('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x40f9ca,_0x2b8767['error'][_0xc1f1('0x14')]);return _0xf3716(_0x2b8767[_0xc1f1('0x12')][_0xc1f1('0x14')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x40f9ca,_0xc1f1('0xf'));_0xf3716(_0x2b8767[_0xc1f1('0x15')][_0xc1f1('0x14')]);}})[_0xc1f1('0x16')](function(_0x2864c3){logger[_0xc1f1('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x40f9ca,_0x2864c3);_0x2d700a(_0x2864c3);});});}exports['ShowSquareOdbc']=function(_0x5eb305){var _0x26fa03=this;return new Promise(function(_0x306dd7,_0x42f049){return db[_0xc1f1('0x17')][_0xc1f1('0x18')]({'raw':_0x5eb305[_0xc1f1('0x19')]?_0x5eb305['options'][_0xc1f1('0x1a')]===undefined?!![]:![]:!![],'where':_0x5eb305[_0xc1f1('0x19')]?_0x5eb305['options'][_0xc1f1('0x1b')]||null:null,'attributes':_0x5eb305[_0xc1f1('0x19')]?_0x5eb305[_0xc1f1('0x19')]['attributes']||null:null,'include':_0x5eb305['options']?_0x5eb305['options'][_0xc1f1('0x1c')]?_[_0xc1f1('0x1d')](_0x5eb305[_0xc1f1('0x19')][_0xc1f1('0x1c')],function(_0x307fd3){return{'model':db[_0x307fd3[_0xc1f1('0x1e')]],'as':_0x307fd3['as'],'attributes':_0x307fd3[_0xc1f1('0x1f')],'include':_0x307fd3['include']?_[_0xc1f1('0x1d')](_0x307fd3[_0xc1f1('0x1c')],function(_0x514a74){return{'model':db[_0x514a74[_0xc1f1('0x1e')]],'as':_0x514a74['as'],'attributes':_0x514a74[_0xc1f1('0x1f')],'include':_0x514a74[_0xc1f1('0x1c')]?_[_0xc1f1('0x1d')](_0x514a74[_0xc1f1('0x1c')],function(_0x1340ff){return{'model':db[_0x1340ff['model']],'as':_0x1340ff['as'],'attributes':_0x1340ff[_0xc1f1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc1f1('0xd')](function(_0x667a38){logger[_0xc1f1('0xe')](_0xc1f1('0x20'),_0x5eb305);logger[_0xc1f1('0x10')](_0xc1f1('0x20'),_0x5eb305,JSON[_0xc1f1('0x11')](_0x667a38));_0x306dd7(_0x667a38);})[_0xc1f1('0x16')](function(_0x9a167b){logger[_0xc1f1('0x12')](_0xc1f1('0x20'),_0x9a167b[_0xc1f1('0x14')],_0x5eb305);_0x42f049(_0x26fa03[_0xc1f1('0x12')](0x1f4,_0x9a167b[_0xc1f1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 29514fa..53acb9e 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 _0xd205=['update','delete','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','show','post','put','/:id'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd205,0x1ac));var _0x5d20=function(_0x16df9f,_0x55db97){_0x16df9f=_0x16df9f-0x0;var _0x16f0da=_0xd205[_0x16df9f];return _0x16f0da;};'use strict';var multer=require('multer');var util=require(_0x5d20('0x0'));var path=require('path');var timeout=require(_0x5d20('0x1'));var express=require(_0x5d20('0x2'));var router=express['Router']();var fs_extra=require(_0x5d20('0x3'));var auth=require(_0x5d20('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5d20('0x5'));var controller=require(_0x5d20('0x6'));router['get']('/',auth[_0x5d20('0x7')](),controller[_0x5d20('0x8')]);router[_0x5d20('0x9')]('/:id',auth[_0x5d20('0x7')](),controller[_0x5d20('0xa')]);router[_0x5d20('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5d20('0xc')](_0x5d20('0xd'),auth[_0x5d20('0x7')](),controller[_0x5d20('0xe')]);router[_0x5d20('0xf')]('/:id',auth[_0x5d20('0x7')](),controller['destroy']);module[_0x5d20('0x10')]=router; \ No newline at end of file +var _0x50b3=['/:id','isAuthenticated','show','post','create','put','update','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x3e3107,_0x55a826){var _0xfaf8be=function(_0x4cd410){while(--_0x4cd410){_0x3e3107['push'](_0x3e3107['shift']());}};_0xfaf8be(++_0x55a826);}(_0x50b3,0x13a));var _0x350b=function(_0x5bd5fc,_0x57597){_0x5bd5fc=_0x5bd5fc-0x0;var _0x420110=_0x50b3[_0x5bd5fc];return _0x420110;};'use strict';var multer=require('multer');var util=require(_0x350b('0x0'));var path=require(_0x350b('0x1'));var timeout=require('connect-timeout');var express=require(_0x350b('0x2'));var router=express[_0x350b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x350b('0x4'));var interaction=require(_0x350b('0x5'));var config=require(_0x350b('0x6'));var controller=require('./squareProject.controller');router[_0x350b('0x7')]('/',auth['isAuthenticated'](),controller[_0x350b('0x8')]);router['get'](_0x350b('0x9'),auth[_0x350b('0xa')](),controller[_0x350b('0xb')]);router[_0x350b('0xc')]('/',auth['isAuthenticated'](),controller[_0x350b('0xd')]);router[_0x350b('0xe')](_0x350b('0x9'),auth[_0x350b('0xa')](),controller[_0x350b('0xf')]);router['delete'](_0x350b('0x9'),auth[_0x350b('0xa')](),controller['destroy']);module[_0x350b('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 76cd836..7975252 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 _0x63e2=['exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','utf8','production','toString','DATE'];(function(_0x1f2307,_0x36394e){var _0x66841b=function(_0x9abb9d){while(--_0x9abb9d){_0x1f2307['push'](_0x1f2307['shift']());}};_0x66841b(++_0x36394e);}(_0x63e2,0x180));var _0x263e=function(_0x5a015b,_0x3aa47a){_0x5a015b=_0x5a015b-0x0;var _0x12db7c=_0x63e2[_0x5a015b];return _0x12db7c;};'use strict';var Sequelize=require('sequelize');module[_0x263e('0x0')]={'name':{'type':Sequelize[_0x263e('0x1')],'unique':_0x263e('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x263e('0x1')]},'notes':{'type':Sequelize[_0x263e('0x3')]},'preproduction':{'type':Sequelize[_0x263e('0x4')](_0x263e('0x5')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x263e('0x6')](_0x263e('0x7'))['toString'](_0x263e('0x8'));}}},'production':{'type':Sequelize[_0x263e('0x4')](_0x263e('0x5')),'get':function(){if(this[_0x263e('0x6')](_0x263e('0x9'))){return this['getDataValue'](_0x263e('0x9'))[_0x263e('0xa')](_0x263e('0x8'));}}},'savedAt':{'type':Sequelize[_0x263e('0xb')]},'publishedAt':{'type':Sequelize[_0x263e('0xb')]}}; \ No newline at end of file +var _0xf604=['TEXT','BLOB','getDataValue','utf8','production','toString','DATE','sequelize','exports','STRING'];(function(_0x1a57c7,_0x1f0c32){var _0xb5899c=function(_0x4b7242){while(--_0x4b7242){_0x1a57c7['push'](_0x1a57c7['shift']());}};_0xb5899c(++_0x1f0c32);}(_0xf604,0xbb));var _0x4f60=function(_0xf66b9,_0x3c0a11){_0xf66b9=_0xf66b9-0x0;var _0x1305f6=_0xf604[_0xf66b9];return _0x1305f6;};'use strict';var Sequelize=require(_0x4f60('0x0'));module[_0x4f60('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4f60('0x2')]},'notes':{'type':Sequelize[_0x4f60('0x3')]},'preproduction':{'type':Sequelize[_0x4f60('0x4')]('long'),'get':function(){if(this[_0x4f60('0x5')]('preproduction')){return this[_0x4f60('0x5')]('preproduction')['toString'](_0x4f60('0x6'));}}},'production':{'type':Sequelize[_0x4f60('0x4')]('long'),'get':function(){if(this[_0x4f60('0x5')](_0x4f60('0x7'))){return this['getDataValue'](_0x4f60('0x7'))[_0x4f60('0x8')](_0x4f60('0x6'));}}},'savedAt':{'type':Sequelize[_0x4f60('0x9')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index f683958..4762d73 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 _0xddda=['name','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','SquareProject','includeAll','include','findAll','rows','show','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','stringify','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','get','UserProfileResource','publish','agi','end','sendStatus','error'];(function(_0x4ddd99,_0x11bbcd){var _0x583ca6=function(_0x1e36d8){while(--_0x1e36d8){_0x4ddd99['push'](_0x4ddd99['shift']());}};_0x583ca6(++_0x11bbcd);}(_0xddda,0x13d));var _0xaddd=function(_0x2991d8,_0x6b8bf4){_0x2991d8=_0x2991d8-0x0;var _0x17e45b=_0xddda[_0x2991d8];return _0x17e45b;};'use strict';var _=require(_0xaddd('0x0'));var Redis=require(_0xaddd('0x1'));var qs=require(_0xaddd('0x2'));var logger=require(_0xaddd('0x3'))('api');var config=require(_0xaddd('0x4'));var db=require(_0xaddd('0x5'))['db'];config[_0xaddd('0x6')]=_[_0xaddd('0x7')](config[_0xaddd('0x6')],{'host':_0xaddd('0x8'),'port':0x18eb});var socket=require(_0xaddd('0x9'))(new Redis(config[_0xaddd('0x6')]));require('./squareProject.socket')['register'](socket);function respondWithResult(_0x5aaf58,_0x55b229){_0x55b229=_0x55b229||0xc8;return function(_0x44f12d){if(_0x44f12d){return _0x5aaf58[_0xaddd('0xa')](_0x55b229)[_0xaddd('0xb')](_0x44f12d);}};}function respondWithFilteredResult(_0x263952,_0x309086){return function(_0x523b10){if(_0x523b10){var _0x18fa96=typeof _0x309086[_0xaddd('0xc')]==='undefined'&&typeof _0x309086[_0xaddd('0xd')]===_0xaddd('0xe');var _0x125500=_0x523b10[_0xaddd('0xf')];var _0x109555=_0x18fa96?0x0:_0x309086[_0xaddd('0xc')];var _0x1f7e2e=_0x18fa96?_0x523b10[_0xaddd('0xf')]:_0x309086['offset']+_0x309086[_0xaddd('0xd')];var _0x1019d8;if(_0x1f7e2e>=_0x125500){_0x1f7e2e=_0x125500;_0x1019d8=0xc8;}else{_0x1019d8=0xce;}_0x263952['status'](_0x1019d8);return _0x263952[_0xaddd('0x10')](_0xaddd('0x11'),_0x109555+'-'+_0x1f7e2e+'/'+_0x125500)[_0xaddd('0xb')](_0x523b10);}return null;};}function saveUpdates(_0x140de7){return function(_0x3a0250){if(_0x3a0250){return _0x3a0250[_0xaddd('0x12')](_0x140de7)[_0xaddd('0x13')](function(_0x2ad742){return _0x2ad742;});}return null;};}function removeEntity(_0x2ab00d){return function(_0x5f3b16){if(_0x5f3b16){return _0x5f3b16[_0xaddd('0x14')]()[_0xaddd('0x13')](function(){var _0x21593a=_0x5f3b16[_0xaddd('0x15')]({'plain':!![]});var _0x5da048='SquareProjects';return db[_0xaddd('0x16')][_0xaddd('0x14')]({'where':{'type':_0x5da048,'resourceId':_0x21593a['id']}})[_0xaddd('0x13')](function(){return _0x5f3b16;});})[_0xaddd('0x13')](function(){var _0x4a13d5=new Redis(config[_0xaddd('0x6')]);_0x4a13d5[_0xaddd('0x17')](_0xaddd('0x18'),JSON['stringify']({'id':_0x5f3b16['id'],'deleted':!![]}));})['then'](function(){_0x2ab00d[_0xaddd('0xa')](0xcc)[_0xaddd('0x19')]();});}};}function handleEntityNotFound(_0x33aebf){return function(_0xe02095){if(!_0xe02095){_0x33aebf[_0xaddd('0x1a')](0x194);}return _0xe02095;};}function handleError(_0x1c67cd,_0x320e81){_0x320e81=_0x320e81||0x1f4;return function(_0x18182d){logger[_0xaddd('0x1b')](_0x18182d['stack']);if(_0x18182d[_0xaddd('0x1c')]){delete _0x18182d[_0xaddd('0x1c')];}_0x1c67cd[_0xaddd('0xa')](_0x320e81)['send'](_0x18182d);};}exports[_0xaddd('0x1d')]=function(_0x18af4b,_0x213afc){var _0x5479cb={},_0xaf8aa9={},_0x1bb1b3={'count':0x0,'rows':[]};var _0x11535e=_['map'](db['SquareProject'][_0xaddd('0x1e')],function(_0x32cd3a){return{'name':_0x32cd3a[_0xaddd('0x1f')],'type':_0x32cd3a[_0xaddd('0x20')]['key']};});_0xaf8aa9['model']=_[_0xaddd('0x21')](_0x11535e,'name');_0xaf8aa9[_0xaddd('0x22')]=_[_0xaddd('0x23')](_0x18af4b[_0xaddd('0x22')]);_0xaf8aa9[_0xaddd('0x24')]=_[_0xaddd('0x25')](_0xaf8aa9[_0xaddd('0x26')],_0xaf8aa9[_0xaddd('0x22')]);_0x5479cb[_0xaddd('0x27')]=_['intersection'](_0xaf8aa9['model'],qs[_0xaddd('0x28')](_0x18af4b['query']['fields']));_0x5479cb[_0xaddd('0x27')]=_0x5479cb['attributes'][_0xaddd('0x29')]?_0x5479cb[_0xaddd('0x27')]:_0xaf8aa9[_0xaddd('0x26')];if(!_0x18af4b[_0xaddd('0x22')][_0xaddd('0x2a')]('nolimit')){_0x5479cb[_0xaddd('0xd')]=qs[_0xaddd('0xd')](_0x18af4b[_0xaddd('0x22')]['limit']);_0x5479cb[_0xaddd('0xc')]=qs[_0xaddd('0xc')](_0x18af4b[_0xaddd('0x22')][_0xaddd('0xc')]);}_0x5479cb[_0xaddd('0x2b')]=qs['sort'](_0x18af4b[_0xaddd('0x22')][_0xaddd('0x2c')]);_0x5479cb[_0xaddd('0x2d')]=qs['filters'](_[_0xaddd('0x2e')](_0x18af4b[_0xaddd('0x22')],_0xaf8aa9[_0xaddd('0x24')]),_0x11535e);if(_0x18af4b[_0xaddd('0x22')][_0xaddd('0x2f')]){_0x5479cb[_0xaddd('0x2d')]=_[_0xaddd('0x30')](_0x5479cb['where'],{'$or':_[_0xaddd('0x21')](_0x11535e,function(_0x427d43){if(_0x427d43[_0xaddd('0x20')]!==_0xaddd('0x31')){var _0x1d3406={};_0x1d3406[_0x427d43[_0xaddd('0x1c')]]={'$like':'%'+_0x18af4b[_0xaddd('0x22')][_0xaddd('0x2f')]+'%'};return _0x1d3406;}})});}_0x5479cb=_[_0xaddd('0x30')]({},_0x5479cb,_0x18af4b['options']);var _0x3938cf={'where':_0x5479cb['where']};return db[_0xaddd('0x32')][_0xaddd('0xf')](_0x3938cf)[_0xaddd('0x13')](function(_0x5acd85){_0x1bb1b3[_0xaddd('0xf')]=_0x5acd85;if(_0x18af4b['query'][_0xaddd('0x33')]){_0x5479cb[_0xaddd('0x34')]=[{'all':!![]}];}return db[_0xaddd('0x32')][_0xaddd('0x35')](_0x5479cb);})['then'](function(_0x37d648){_0x1bb1b3[_0xaddd('0x36')]=_0x37d648;return _0x1bb1b3;})[_0xaddd('0x13')](respondWithFilteredResult(_0x213afc,_0x5479cb))['catch'](handleError(_0x213afc,null));};exports[_0xaddd('0x37')]=function(_0x2c3cb4,_0x5c06d1){var _0x49e991={'raw':![],'where':{'id':_0x2c3cb4['params']['id']}},_0x432913={};_0x432913[_0xaddd('0x26')]=_[_0xaddd('0x23')](db[_0xaddd('0x32')]['rawAttributes']);_0x432913['query']=_[_0xaddd('0x23')](_0x2c3cb4['query']);_0x432913['filters']=_[_0xaddd('0x25')](_0x432913[_0xaddd('0x26')],_0x432913[_0xaddd('0x22')]);_0x49e991[_0xaddd('0x27')]=_[_0xaddd('0x25')](_0x432913[_0xaddd('0x26')],qs[_0xaddd('0x28')](_0x2c3cb4[_0xaddd('0x22')][_0xaddd('0x28')]));_0x49e991[_0xaddd('0x27')]=_0x49e991[_0xaddd('0x27')][_0xaddd('0x29')]?_0x49e991[_0xaddd('0x27')]:_0x432913[_0xaddd('0x26')];if(_0x2c3cb4[_0xaddd('0x22')][_0xaddd('0x33')]){_0x49e991[_0xaddd('0x34')]=[{'all':!![]}];}_0x49e991=_[_0xaddd('0x30')]({},_0x49e991,_0x2c3cb4[_0xaddd('0x38')]);return db['SquareProject'][_0xaddd('0x39')](_0x49e991)[_0xaddd('0x13')](handleEntityNotFound(_0x5c06d1,null))[_0xaddd('0x13')](respondWithResult(_0x5c06d1,null))[_0xaddd('0x3a')](handleError(_0x5c06d1,null));};exports[_0xaddd('0x3b')]=function(_0x2d7444,_0x1e86b4){return db[_0xaddd('0x32')][_0xaddd('0x3b')](_0x2d7444[_0xaddd('0x3c')],{})[_0xaddd('0x13')](function(_0x44ac59){var _0x54bc30=_0x2d7444[_0xaddd('0x3d')][_0xaddd('0x15')]({'plain':!![]});if(!_0x54bc30)throw new Error(_0xaddd('0x3e'));if(_0x54bc30[_0xaddd('0x3f')]===_0xaddd('0x3d')){var _0x101fb5=_0x44ac59[_0xaddd('0x15')]({'plain':!![]});var _0x241e93='SquareProjects';return db['UserProfileSection'][_0xaddd('0x39')]({'where':{'name':_0x241e93,'userProfileId':_0x54bc30[_0xaddd('0x40')]},'raw':!![]})[_0xaddd('0x13')](function(_0x1ebb18){if(_0x1ebb18&&_0x1ebb18[_0xaddd('0x41')]===0x0){return db[_0xaddd('0x16')]['create']({'name':_0x101fb5['name'],'resourceId':_0x101fb5['id'],'type':_0x1ebb18[_0xaddd('0x1c')],'sectionId':_0x1ebb18['id']},{})['then'](function(){return _0x44ac59;});}else{return _0x44ac59;}})[_0xaddd('0x3a')](function(_0x7fac0a){logger['error'](_0xaddd('0x42'),_0x7fac0a);throw _0x7fac0a;});}return _0x44ac59;})[_0xaddd('0x13')](respondWithResult(_0x1e86b4,0xc9))[_0xaddd('0x3a')](handleError(_0x1e86b4,null));};exports[_0xaddd('0x12')]=function(_0x5d0834,_0x527e9b){if(_0x5d0834[_0xaddd('0x3c')]['id']){delete _0x5d0834[_0xaddd('0x3c')]['id'];}return db[_0xaddd('0x32')]['find']({'where':{'id':_0x5d0834['params']['id']}})['then'](handleEntityNotFound(_0x527e9b,null))[_0xaddd('0x13')](saveUpdates(_0x5d0834['body'],null))[_0xaddd('0x13')](function(_0x575015){if(!_0x575015)return;var _0x3893fc=_0x575015[_0xaddd('0x15')]({'plain':!![]});return _0x3893fc;})[_0xaddd('0x13')](function(_0xb40aa9){var _0x5b6c54=new Redis(config[_0xaddd('0x6')]);_0x5b6c54[_0xaddd('0x17')](_0xaddd('0x18'),JSON[_0xaddd('0x43')](_[_0xaddd('0x2e')](_0xb40aa9,['id',_0xaddd('0x1c'),_0xaddd('0x44')])));return _0xb40aa9;})['then'](respondWithResult(_0x527e9b,null))[_0xaddd('0x3a')](handleError(_0x527e9b,null));};exports['destroy']=function(_0x2786ef,_0x30a6ee){return db[_0xaddd('0x32')][_0xaddd('0x39')]({'where':{'id':_0x2786ef['params']['id']}})[_0xaddd('0x13')](handleEntityNotFound(_0x30a6ee,null))[_0xaddd('0x13')](removeEntity(_0x30a6ee,null))[_0xaddd('0x3a')](handleError(_0x30a6ee,null));}; \ No newline at end of file +var _0xd87c=['SquareProjects','UserProfileResource','publish','agi','stringify','end','sendStatus','error','stack','name','send','index','map','SquareProject','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','get','pick','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./squareProject.socket','status','json','offset','undefined','limit','set','Content-Range','update','then','destroy'];(function(_0x1db4d8,_0xec4bc8){var _0x556d58=function(_0x3c2b52){while(--_0x3c2b52){_0x1db4d8['push'](_0x1db4d8['shift']());}};_0x556d58(++_0xec4bc8);}(_0xd87c,0x191));var _0xcd87=function(_0x4f2bf4,_0x1a126d){_0x4f2bf4=_0x4f2bf4-0x0;var _0x3ef050=_0xd87c[_0x4f2bf4];return _0x3ef050;};'use strict';var _=require(_0xcd87('0x0'));var Redis=require('ioredis');var qs=require(_0xcd87('0x1'));var logger=require(_0xcd87('0x2'))(_0xcd87('0x3'));var config=require('../../config/environment');var db=require(_0xcd87('0x4'))['db'];config[_0xcd87('0x5')]=_[_0xcd87('0x6')](config[_0xcd87('0x5')],{'host':_0xcd87('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcd87('0x5')]));require(_0xcd87('0x8'))['register'](socket);function respondWithResult(_0x1bbecb,_0x1ba681){_0x1ba681=_0x1ba681||0xc8;return function(_0x10fd22){if(_0x10fd22){return _0x1bbecb[_0xcd87('0x9')](_0x1ba681)[_0xcd87('0xa')](_0x10fd22);}};}function respondWithFilteredResult(_0xa6187d,_0x406b3b){return function(_0x4cd113){if(_0x4cd113){var _0x5812dc=typeof _0x406b3b[_0xcd87('0xb')]===_0xcd87('0xc')&&typeof _0x406b3b[_0xcd87('0xd')]===_0xcd87('0xc');var _0x3ad931=_0x4cd113['count'];var _0x2fd820=_0x5812dc?0x0:_0x406b3b[_0xcd87('0xb')];var _0x46e57a=_0x5812dc?_0x4cd113['count']:_0x406b3b[_0xcd87('0xb')]+_0x406b3b[_0xcd87('0xd')];var _0x1f33a2;if(_0x46e57a>=_0x3ad931){_0x46e57a=_0x3ad931;_0x1f33a2=0xc8;}else{_0x1f33a2=0xce;}_0xa6187d[_0xcd87('0x9')](_0x1f33a2);return _0xa6187d[_0xcd87('0xe')](_0xcd87('0xf'),_0x2fd820+'-'+_0x46e57a+'/'+_0x3ad931)[_0xcd87('0xa')](_0x4cd113);}return null;};}function saveUpdates(_0x4b6563){return function(_0x7bbc85){if(_0x7bbc85){return _0x7bbc85[_0xcd87('0x10')](_0x4b6563)[_0xcd87('0x11')](function(_0x2391d1){return _0x2391d1;});}return null;};}function removeEntity(_0x83db23){return function(_0x209384){if(_0x209384){return _0x209384[_0xcd87('0x12')]()['then'](function(){var _0x3ec6d5=_0x209384['get']({'plain':!![]});var _0x209a59=_0xcd87('0x13');return db[_0xcd87('0x14')][_0xcd87('0x12')]({'where':{'type':_0x209a59,'resourceId':_0x3ec6d5['id']}})[_0xcd87('0x11')](function(){return _0x209384;});})['then'](function(){var _0x502e4b=new Redis(config['redis']);_0x502e4b[_0xcd87('0x15')](_0xcd87('0x16'),JSON[_0xcd87('0x17')]({'id':_0x209384['id'],'deleted':!![]}));})[_0xcd87('0x11')](function(){_0x83db23[_0xcd87('0x9')](0xcc)[_0xcd87('0x18')]();});}};}function handleEntityNotFound(_0x321c5c){return function(_0x566717){if(!_0x566717){_0x321c5c[_0xcd87('0x19')](0x194);}return _0x566717;};}function handleError(_0x1ef39f,_0x27c71e){_0x27c71e=_0x27c71e||0x1f4;return function(_0x40d770){logger[_0xcd87('0x1a')](_0x40d770[_0xcd87('0x1b')]);if(_0x40d770[_0xcd87('0x1c')]){delete _0x40d770[_0xcd87('0x1c')];}_0x1ef39f[_0xcd87('0x9')](_0x27c71e)[_0xcd87('0x1d')](_0x40d770);};}exports[_0xcd87('0x1e')]=function(_0x76a234,_0x4645a3){var _0x13cc9a={},_0x44d9f9={},_0x154a0c={'count':0x0,'rows':[]};var _0x9ba3ed=_[_0xcd87('0x1f')](db[_0xcd87('0x20')]['rawAttributes'],function(_0x525f3d){return{'name':_0x525f3d[_0xcd87('0x21')],'type':_0x525f3d[_0xcd87('0x22')][_0xcd87('0x23')]};});_0x44d9f9['model']=_[_0xcd87('0x1f')](_0x9ba3ed,_0xcd87('0x1c'));_0x44d9f9[_0xcd87('0x24')]=_[_0xcd87('0x25')](_0x76a234[_0xcd87('0x24')]);_0x44d9f9[_0xcd87('0x26')]=_[_0xcd87('0x27')](_0x44d9f9[_0xcd87('0x28')],_0x44d9f9['query']);_0x13cc9a['attributes']=_['intersection'](_0x44d9f9[_0xcd87('0x28')],qs[_0xcd87('0x29')](_0x76a234[_0xcd87('0x24')][_0xcd87('0x29')]));_0x13cc9a[_0xcd87('0x2a')]=_0x13cc9a[_0xcd87('0x2a')][_0xcd87('0x2b')]?_0x13cc9a[_0xcd87('0x2a')]:_0x44d9f9['model'];if(!_0x76a234[_0xcd87('0x24')][_0xcd87('0x2c')]('nolimit')){_0x13cc9a['limit']=qs[_0xcd87('0xd')](_0x76a234[_0xcd87('0x24')]['limit']);_0x13cc9a[_0xcd87('0xb')]=qs[_0xcd87('0xb')](_0x76a234['query'][_0xcd87('0xb')]);}_0x13cc9a[_0xcd87('0x2d')]=qs['sort'](_0x76a234[_0xcd87('0x24')][_0xcd87('0x2e')]);_0x13cc9a[_0xcd87('0x2f')]=qs[_0xcd87('0x26')](_['pick'](_0x76a234[_0xcd87('0x24')],_0x44d9f9['filters']),_0x9ba3ed);if(_0x76a234[_0xcd87('0x24')][_0xcd87('0x30')]){_0x13cc9a[_0xcd87('0x2f')]=_[_0xcd87('0x31')](_0x13cc9a[_0xcd87('0x2f')],{'$or':_[_0xcd87('0x1f')](_0x9ba3ed,function(_0x372dad){if(_0x372dad[_0xcd87('0x22')]!==_0xcd87('0x32')){var _0x483267={};_0x483267[_0x372dad[_0xcd87('0x1c')]]={'$like':'%'+_0x76a234[_0xcd87('0x24')][_0xcd87('0x30')]+'%'};return _0x483267;}})});}_0x13cc9a=_[_0xcd87('0x31')]({},_0x13cc9a,_0x76a234[_0xcd87('0x33')]);var _0x3b73c5={'where':_0x13cc9a['where']};return db['SquareProject'][_0xcd87('0x34')](_0x3b73c5)['then'](function(_0x174cb6){_0x154a0c[_0xcd87('0x34')]=_0x174cb6;if(_0x76a234[_0xcd87('0x24')][_0xcd87('0x35')]){_0x13cc9a[_0xcd87('0x36')]=[{'all':!![]}];}return db[_0xcd87('0x20')]['findAll'](_0x13cc9a);})[_0xcd87('0x11')](function(_0x153799){_0x154a0c[_0xcd87('0x37')]=_0x153799;return _0x154a0c;})[_0xcd87('0x11')](respondWithFilteredResult(_0x4645a3,_0x13cc9a))['catch'](handleError(_0x4645a3,null));};exports[_0xcd87('0x38')]=function(_0x7a043c,_0x2f0d9f){var _0x19daf0={'raw':![],'where':{'id':_0x7a043c[_0xcd87('0x39')]['id']}},_0x41b2d0={};_0x41b2d0[_0xcd87('0x28')]=_[_0xcd87('0x25')](db[_0xcd87('0x20')][_0xcd87('0x3a')]);_0x41b2d0['query']=_['keys'](_0x7a043c['query']);_0x41b2d0[_0xcd87('0x26')]=_['intersection'](_0x41b2d0['model'],_0x41b2d0[_0xcd87('0x24')]);_0x19daf0[_0xcd87('0x2a')]=_['intersection'](_0x41b2d0[_0xcd87('0x28')],qs[_0xcd87('0x29')](_0x7a043c[_0xcd87('0x24')][_0xcd87('0x29')]));_0x19daf0[_0xcd87('0x2a')]=_0x19daf0[_0xcd87('0x2a')][_0xcd87('0x2b')]?_0x19daf0[_0xcd87('0x2a')]:_0x41b2d0[_0xcd87('0x28')];if(_0x7a043c[_0xcd87('0x24')][_0xcd87('0x35')]){_0x19daf0[_0xcd87('0x36')]=[{'all':!![]}];}_0x19daf0=_[_0xcd87('0x31')]({},_0x19daf0,_0x7a043c['options']);return db[_0xcd87('0x20')][_0xcd87('0x3b')](_0x19daf0)['then'](handleEntityNotFound(_0x2f0d9f,null))['then'](respondWithResult(_0x2f0d9f,null))[_0xcd87('0x3c')](handleError(_0x2f0d9f,null));};exports[_0xcd87('0x3d')]=function(_0x1d4a77,_0x48cef5){return db[_0xcd87('0x20')][_0xcd87('0x3d')](_0x1d4a77[_0xcd87('0x3e')],{})[_0xcd87('0x11')](function(_0x4f5987){var _0x237a39=_0x1d4a77[_0xcd87('0x3f')]['get']({'plain':!![]});if(!_0x237a39)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x237a39['role']===_0xcd87('0x3f')){var _0x59a29d=_0x4f5987['get']({'plain':!![]});var _0xe329c2=_0xcd87('0x13');return db[_0xcd87('0x40')][_0xcd87('0x3b')]({'where':{'name':_0xe329c2,'userProfileId':_0x237a39[_0xcd87('0x41')]},'raw':!![]})['then'](function(_0xae016b){if(_0xae016b&&_0xae016b[_0xcd87('0x42')]===0x0){return db[_0xcd87('0x14')][_0xcd87('0x3d')]({'name':_0x59a29d['name'],'resourceId':_0x59a29d['id'],'type':_0xae016b[_0xcd87('0x1c')],'sectionId':_0xae016b['id']},{})[_0xcd87('0x11')](function(){return _0x4f5987;});}else{return _0x4f5987;}})[_0xcd87('0x3c')](function(_0x15f816){logger[_0xcd87('0x1a')](_0xcd87('0x43'),_0x15f816);throw _0x15f816;});}return _0x4f5987;})[_0xcd87('0x11')](respondWithResult(_0x48cef5,0xc9))['catch'](handleError(_0x48cef5,null));};exports[_0xcd87('0x10')]=function(_0x47f12c,_0x42bf05){if(_0x47f12c[_0xcd87('0x3e')]['id']){delete _0x47f12c[_0xcd87('0x3e')]['id'];}return db['SquareProject'][_0xcd87('0x3b')]({'where':{'id':_0x47f12c[_0xcd87('0x39')]['id']}})['then'](handleEntityNotFound(_0x42bf05,null))[_0xcd87('0x11')](saveUpdates(_0x47f12c['body'],null))[_0xcd87('0x11')](function(_0x42d3bb){if(!_0x42d3bb)return;var _0x2c7ba3=_0x42d3bb[_0xcd87('0x44')]({'plain':!![]});return _0x2c7ba3;})[_0xcd87('0x11')](function(_0x2eb758){var _0x2375eb=new Redis(config['redis']);_0x2375eb['publish'](_0xcd87('0x16'),JSON[_0xcd87('0x17')](_[_0xcd87('0x45')](_0x2eb758,['id',_0xcd87('0x1c'),'production'])));return _0x2eb758;})[_0xcd87('0x11')](respondWithResult(_0x42bf05,null))['catch'](handleError(_0x42bf05,null));};exports[_0xcd87('0x12')]=function(_0x62338f,_0x3bef0a){return db[_0xcd87('0x20')][_0xcd87('0x3b')]({'where':{'id':_0x62338f['params']['id']}})[_0xcd87('0x11')](handleEntityNotFound(_0x3bef0a,null))[_0xcd87('0x11')](removeEntity(_0x3bef0a,null))[_0xcd87('0x3c')](handleError(_0x3bef0a,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index cb61702..80ef347 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 _0xde21=['../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xde21,0x107));var _0x1de2=function(_0x5a405b,_0x2550b9){_0x5a405b=_0x5a405b-0x0;var _0x19145e=_0xde21[_0x5a405b];return _0x19145e;};'use strict';var EventEmitter=require(_0x1de2('0x0'));var SquareProject=require(_0x1de2('0x1'))['db'][_0x1de2('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1de2('0x3')](0x0);var events={'afterCreate':_0x1de2('0x4'),'afterUpdate':_0x1de2('0x5'),'afterDestroy':_0x1de2('0x6')};function emitEvent(_0x1288d4){return function(_0x3a25c2,_0x63cb6f,_0x22a106){SquareProjectEvents[_0x1de2('0x7')](_0x1288d4+':'+_0x3a25c2['id'],_0x3a25c2);SquareProjectEvents[_0x1de2('0x7')](_0x1288d4,_0x3a25c2);_0x22a106(null);};}for(var e in events){if(events[_0x1de2('0x8')](e)){var event=events[e];SquareProject[_0x1de2('0x9')](e,emitEvent(event));}}module[_0x1de2('0xa')]=SquareProjectEvents; \ No newline at end of file +var _0xe8db=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x37d835,_0x35c8dd){var _0x3b4cf6=function(_0x36c153){while(--_0x36c153){_0x37d835['push'](_0x37d835['shift']());}};_0x3b4cf6(++_0x35c8dd);}(_0xe8db,0x10e));var _0xbe8d=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0xe8db[_0x4f6d08];return _0x53a9c6;};'use strict';var EventEmitter=require(_0xbe8d('0x0'));var SquareProject=require(_0xbe8d('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xbe8d('0x2')](0x0);var events={'afterCreate':_0xbe8d('0x3'),'afterUpdate':_0xbe8d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3f0ae9){return function(_0x408774,_0x3f5ef4,_0x6719fa){SquareProjectEvents[_0xbe8d('0x5')](_0x3f0ae9+':'+_0x408774['id'],_0x408774);SquareProjectEvents[_0xbe8d('0x5')](_0x3f0ae9,_0x408774);_0x6719fa(null);};}for(var e in events){if(events[_0xbe8d('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xbe8d('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 84dbe94..61b3ab4 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 _0x7587=['path','../../config/environment','./squareProject.attributes','define','SquareProject','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xab4a7c,_0x28b640){var _0x4b0bd2=function(_0x254009){while(--_0x254009){_0xab4a7c['push'](_0xab4a7c['shift']());}};_0x4b0bd2(++_0x28b640);}(_0x7587,0x1bb));var _0x7758=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x7587[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x7758('0x0'));var util=require(_0x7758('0x1'));var logger=require(_0x7758('0x2'))(_0x7758('0x3'));var moment=require(_0x7758('0x4'));var BPromise=require(_0x7758('0x5'));var rp=require(_0x7758('0x6'));var fs=require('fs');var path=require(_0x7758('0x7'));var rimraf=require('rimraf');var config=require(_0x7758('0x8'));var attributes=require(_0x7758('0x9'));module['exports']=function(_0x2a56e5,_0x140e71){return _0x2a56e5[_0x7758('0xa')](_0x7758('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe2f5a6,_0x1a2bb3,_0x27dd8f){if(_0xe2f5a6['changed']('preproduction')){_0xe2f5a6[_0x7758('0xc')]=moment()[_0x7758('0xd')](_0x7758('0xe'));}if(_0xe2f5a6[_0x7758('0xf')](_0x7758('0x10'))){_0xe2f5a6[_0x7758('0x11')]=moment()[_0x7758('0xd')](_0x7758('0xe'));}_0x27dd8f(null,_0xe2f5a6);}}});}; \ No newline at end of file +var _0x4e47=['savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','preproduction'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x4e47,0x1a4));var _0x74e4=function(_0xd7c642,_0x1977db){_0xd7c642=_0xd7c642-0x0;var _0xa638ae=_0x4e47[_0xd7c642];return _0xa638ae;};'use strict';var _=require(_0x74e4('0x0'));var util=require('util');var logger=require(_0x74e4('0x1'))(_0x74e4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x74e4('0x3'));var fs=require('fs');var path=require(_0x74e4('0x4'));var rimraf=require(_0x74e4('0x5'));var config=require(_0x74e4('0x6'));var attributes=require(_0x74e4('0x7'));module['exports']=function(_0x12b417,_0x239846){return _0x12b417[_0x74e4('0x8')](_0x74e4('0x9'),attributes,{'tableName':_0x74e4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x248107,_0xc04cc9,_0x5ddf5d){if(_0x248107['changed'](_0x74e4('0xb'))){_0x248107[_0x74e4('0xc')]=moment()[_0x74e4('0xd')](_0x74e4('0xe'));}if(_0x248107[_0x74e4('0xf')](_0x74e4('0x10'))){_0x248107[_0x74e4('0x11')]=moment()[_0x74e4('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5ddf5d(null,_0x248107);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 82a68bf..988b67f 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 _0x5c4e=['../../config/environment','redis','defaults','socket.io-emitter','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','map','include','model','then','info','debug','stringify','error','message','find','ShowSquareProject','lodash','../../mysqldb'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x5c4e,0x9a));var _0xe5c4=function(_0x2bc551,_0x35c0bf){_0x2bc551=_0x2bc551-0x0;var _0x4466db=_0x5c4e[_0x2bc551];return _0x4466db;};'use strict';var _=require(_0xe5c4('0x0'));var Redis=require('ioredis');var db=require(_0xe5c4('0x1'))['db'];var logger=require('../../config/logger')('rpc');var config=require(_0xe5c4('0x2'));config[_0xe5c4('0x3')]=_[_0xe5c4('0x4')](config[_0xe5c4('0x3')],{'host':'localhost','port':0x18eb});var socket=require(_0xe5c4('0x5'))(new Redis(config[_0xe5c4('0x3')]));require('./squareProject.socket')[_0xe5c4('0x6')](socket);exports[_0xe5c4('0x7')]=function(_0xd82673){var _0x1e529c=this;return new Promise(function(_0x4ee591,_0xf82889){return db[_0xe5c4('0x8')][_0xe5c4('0x9')]({'raw':_0xd82673[_0xe5c4('0xa')]?_0xd82673[_0xe5c4('0xa')][_0xe5c4('0xb')]===undefined?!![]:![]:!![],'where':_0xd82673['options']?_0xd82673[_0xe5c4('0xa')][_0xe5c4('0xc')]||null:null,'attributes':_0xd82673[_0xe5c4('0xa')]?_0xd82673[_0xe5c4('0xa')][_0xe5c4('0xd')]||null:null,'limit':_0xd82673[_0xe5c4('0xa')]?_0xd82673[_0xe5c4('0xa')][_0xe5c4('0xe')]||null:null,'include':_0xd82673[_0xe5c4('0xa')]?_0xd82673[_0xe5c4('0xa')]['include']?_[_0xe5c4('0xf')](_0xd82673[_0xe5c4('0xa')][_0xe5c4('0x10')],function(_0x33972f){return{'model':db[_0x33972f[_0xe5c4('0x11')]],'as':_0x33972f['as'],'attributes':_0x33972f['attributes'],'include':_0x33972f['include']?_[_0xe5c4('0xf')](_0x33972f['include'],function(_0x5aff5b){return{'model':db[_0x5aff5b[_0xe5c4('0x11')]],'as':_0x5aff5b['as'],'attributes':_0x5aff5b['attributes'],'include':_0x5aff5b[_0xe5c4('0x10')]?_['map'](_0x5aff5b[_0xe5c4('0x10')],function(_0x40a51c){return{'model':db[_0x40a51c[_0xe5c4('0x11')]],'as':_0x40a51c['as'],'attributes':_0x40a51c['attributes']};}):[]};}):[]};}):[]:[]})[_0xe5c4('0x12')](function(_0x1092f0){logger[_0xe5c4('0x13')](_0xe5c4('0x7'),_0xd82673);logger[_0xe5c4('0x14')](_0xe5c4('0x7'),_0xd82673,JSON[_0xe5c4('0x15')](_0x1092f0));_0x4ee591(_0x1092f0);})['catch'](function(_0x13f09c){logger[_0xe5c4('0x16')]('GetSquareProjects',_0x13f09c[_0xe5c4('0x17')],_0xd82673);_0xf82889(_0x1e529c[_0xe5c4('0x16')](0x1f4,_0x13f09c[_0xe5c4('0x17')]));});});};exports['ShowSquareProject']=function(_0xa3dbed){var _0x403ee7=this;return new Promise(function(_0xa189cf,_0x1f7049){return db['SquareProject'][_0xe5c4('0x18')]({'raw':_0xa3dbed['options']?_0xa3dbed[_0xe5c4('0xa')][_0xe5c4('0xb')]===undefined?!![]:![]:!![],'where':_0xa3dbed[_0xe5c4('0xa')]?_0xa3dbed[_0xe5c4('0xa')]['where']||null:null,'attributes':_0xa3dbed['options']?_0xa3dbed[_0xe5c4('0xa')]['attributes']||null:null,'include':_0xa3dbed[_0xe5c4('0xa')]?_0xa3dbed['options'][_0xe5c4('0x10')]?_['map'](_0xa3dbed['options'][_0xe5c4('0x10')],function(_0x366c43){return{'model':db[_0x366c43[_0xe5c4('0x11')]],'as':_0x366c43['as'],'attributes':_0x366c43[_0xe5c4('0xd')],'include':_0x366c43[_0xe5c4('0x10')]?_[_0xe5c4('0xf')](_0x366c43[_0xe5c4('0x10')],function(_0xe1adcf){return{'model':db[_0xe1adcf[_0xe5c4('0x11')]],'as':_0xe1adcf['as'],'attributes':_0xe1adcf['attributes'],'include':_0xe1adcf[_0xe5c4('0x10')]?_[_0xe5c4('0xf')](_0xe1adcf[_0xe5c4('0x10')],function(_0x42deae){return{'model':db[_0x42deae[_0xe5c4('0x11')]],'as':_0x42deae['as'],'attributes':_0x42deae[_0xe5c4('0xd')]};}):[]};}):[]};}):[]:[]})[_0xe5c4('0x12')](function(_0x560402){logger['info'](_0xe5c4('0x19'),_0xa3dbed);logger[_0xe5c4('0x14')]('ShowSquareProject',_0xa3dbed,JSON[_0xe5c4('0x15')](_0x560402));_0xa189cf(_0x560402);})['catch'](function(_0x35cb3a){logger['error'](_0xe5c4('0x19'),_0x35cb3a['message'],_0xa3dbed);_0x1f7049(_0x403ee7[_0xe5c4('0x16')](0x1f4,_0x35cb3a[_0xe5c4('0x17')]));});});}; \ No newline at end of file +var _0xef2c=['rpc','../../config/environment','redis','defaults','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','options','raw','where','attributes','include','map','model','then','info','debug','stringify','catch','error','message','ShowSquareProject','find','lodash','../../config/logger'];(function(_0x31688a,_0x588c7d){var _0xc7b088=function(_0x3ed4c8){while(--_0x3ed4c8){_0x31688a['push'](_0x31688a['shift']());}};_0xc7b088(++_0x588c7d);}(_0xef2c,0xa0));var _0xcef2=function(_0x369a98,_0x32250c){_0x369a98=_0x369a98-0x0;var _0x29565c=_0xef2c[_0x369a98];return _0x29565c;};'use strict';var _=require(_0xcef2('0x0'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0xcef2('0x1'))(_0xcef2('0x2'));var config=require(_0xcef2('0x3'));config[_0xcef2('0x4')]=_[_0xcef2('0x5')](config[_0xcef2('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0xcef2('0x6'))(new Redis(config['redis']));require(_0xcef2('0x7'))[_0xcef2('0x8')](socket);exports[_0xcef2('0x9')]=function(_0x307a7d){var _0x478a26=this;return new Promise(function(_0x6690e9,_0x27dcab){return db[_0xcef2('0xa')]['findAll']({'raw':_0x307a7d[_0xcef2('0xb')]?_0x307a7d[_0xcef2('0xb')][_0xcef2('0xc')]===undefined?!![]:![]:!![],'where':_0x307a7d[_0xcef2('0xb')]?_0x307a7d[_0xcef2('0xb')][_0xcef2('0xd')]||null:null,'attributes':_0x307a7d[_0xcef2('0xb')]?_0x307a7d['options'][_0xcef2('0xe')]||null:null,'limit':_0x307a7d[_0xcef2('0xb')]?_0x307a7d['options']['limit']||null:null,'include':_0x307a7d[_0xcef2('0xb')]?_0x307a7d['options'][_0xcef2('0xf')]?_[_0xcef2('0x10')](_0x307a7d[_0xcef2('0xb')][_0xcef2('0xf')],function(_0x56cf59){return{'model':db[_0x56cf59['model']],'as':_0x56cf59['as'],'attributes':_0x56cf59['attributes'],'include':_0x56cf59[_0xcef2('0xf')]?_['map'](_0x56cf59[_0xcef2('0xf')],function(_0x5617fe){return{'model':db[_0x5617fe[_0xcef2('0x11')]],'as':_0x5617fe['as'],'attributes':_0x5617fe[_0xcef2('0xe')],'include':_0x5617fe['include']?_['map'](_0x5617fe[_0xcef2('0xf')],function(_0x53141e){return{'model':db[_0x53141e[_0xcef2('0x11')]],'as':_0x53141e['as'],'attributes':_0x53141e[_0xcef2('0xe')]};}):[]};}):[]};}):[]:[]})[_0xcef2('0x12')](function(_0x19d355){logger[_0xcef2('0x13')](_0xcef2('0x9'),_0x307a7d);logger[_0xcef2('0x14')](_0xcef2('0x9'),_0x307a7d,JSON[_0xcef2('0x15')](_0x19d355));_0x6690e9(_0x19d355);})[_0xcef2('0x16')](function(_0x591514){logger[_0xcef2('0x17')]('GetSquareProjects',_0x591514[_0xcef2('0x18')],_0x307a7d);_0x27dcab(_0x478a26['error'](0x1f4,_0x591514[_0xcef2('0x18')]));});});};exports[_0xcef2('0x19')]=function(_0x5dd91f){var _0x59c8a7=this;return new Promise(function(_0x5c638a,_0x5ad729){return db[_0xcef2('0xa')][_0xcef2('0x1a')]({'raw':_0x5dd91f['options']?_0x5dd91f[_0xcef2('0xb')][_0xcef2('0xc')]===undefined?!![]:![]:!![],'where':_0x5dd91f[_0xcef2('0xb')]?_0x5dd91f['options']['where']||null:null,'attributes':_0x5dd91f[_0xcef2('0xb')]?_0x5dd91f[_0xcef2('0xb')]['attributes']||null:null,'include':_0x5dd91f['options']?_0x5dd91f['options']['include']?_[_0xcef2('0x10')](_0x5dd91f[_0xcef2('0xb')]['include'],function(_0x3a14c9){return{'model':db[_0x3a14c9[_0xcef2('0x11')]],'as':_0x3a14c9['as'],'attributes':_0x3a14c9['attributes'],'include':_0x3a14c9[_0xcef2('0xf')]?_[_0xcef2('0x10')](_0x3a14c9[_0xcef2('0xf')],function(_0x2bcbcd){return{'model':db[_0x2bcbcd[_0xcef2('0x11')]],'as':_0x2bcbcd['as'],'attributes':_0x2bcbcd[_0xcef2('0xe')],'include':_0x2bcbcd[_0xcef2('0xf')]?_['map'](_0x2bcbcd[_0xcef2('0xf')],function(_0x3d9d5b){return{'model':db[_0x3d9d5b[_0xcef2('0x11')]],'as':_0x3d9d5b['as'],'attributes':_0x3d9d5b['attributes']};}):[]};}):[]};}):[]:[]})[_0xcef2('0x12')](function(_0x20a289){logger['info'](_0xcef2('0x19'),_0x5dd91f);logger[_0xcef2('0x14')](_0xcef2('0x19'),_0x5dd91f,JSON[_0xcef2('0x15')](_0x20a289));_0x5c638a(_0x20a289);})[_0xcef2('0x16')](function(_0x1678f6){logger[_0xcef2('0x17')]('ShowSquareProject',_0x1678f6[_0xcef2('0x18')],_0x5dd91f);_0x5ad729(_0x59c8a7[_0xcef2('0x17')](0x1f4,_0x1678f6[_0xcef2('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 2808e3c..752c7b0 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 _0xa788=['length','squareProject:','remove','emit'];(function(_0x5228cc,_0x31e708){var _0x5b8f6a=function(_0x11deb8){while(--_0x11deb8){_0x5228cc['push'](_0x5228cc['shift']());}};_0x5b8f6a(++_0x31e708);}(_0xa788,0xfa));var _0x8a78=function(_0x321fc3,_0x233331){_0x321fc3=_0x321fc3-0x0;var _0x38cdb8=_0xa788[_0x321fc3];return _0x38cdb8;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0x8a78('0x0'),'update'];function createListener(_0x294c3e,_0x8afc2a){return function(_0x478593){_0x8afc2a[_0x8a78('0x1')](_0x294c3e,_0x478593);};}function removeListener(_0x26b0e0,_0xfc9e1a){return function(){SquareProjectEvents['removeListener'](_0x26b0e0,_0xfc9e1a);};}exports['register']=function(_0x1399af){for(var _0x5c2255=0x0,_0x2c3157=events[_0x8a78('0x2')];_0x5c2255<_0x2c3157;_0x5c2255++){var _0x1390fd=events[_0x5c2255];var _0x4cd18a=createListener(_0x8a78('0x3')+_0x1390fd,_0x1399af);SquareProjectEvents['on'](_0x1390fd,_0x4cd18a);}}; \ No newline at end of file +var _0xd86e=['removeListener','register','length','squareProject:','./squareProject.events','save','remove'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0xd86e,0x97));var _0xed86=function(_0xe507d7,_0x79a33f){_0xe507d7=_0xe507d7-0x0;var _0x3e7f3a=_0xd86e[_0xe507d7];return _0x3e7f3a;};'use strict';var SquareProjectEvents=require(_0xed86('0x0'));var events=[_0xed86('0x1'),_0xed86('0x2'),'update'];function createListener(_0x178924,_0x25a70f){return function(_0x559a0a){_0x25a70f['emit'](_0x178924,_0x559a0a);};}function removeListener(_0x262a3e,_0x4f3f73){return function(){SquareProjectEvents[_0xed86('0x3')](_0x262a3e,_0x4f3f73);};}exports[_0xed86('0x4')]=function(_0x1594fe){for(var _0x482691=0x0,_0x3ad7dc=events[_0xed86('0x5')];_0x482691<_0x3ad7dc;_0x482691++){var _0x48efe2=events[_0x482691];var _0x46ab7c=createListener(_0xed86('0x6')+_0x48efe2,_0x1594fe);SquareProjectEvents['on'](_0x48efe2,_0x46ab7c);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b92c089..9513966 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 _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x51491a,_0x8858df){var _0x3f2b9d=function(_0x1239d3){while(--_0x1239d3){_0x51491a['push'](_0x51491a['shift']());}};_0x3f2b9d(++_0x8858df);}(_0x326f,0xd1));var _0xf326=function(_0x117c5d,_0x2997f3){_0x117c5d=_0x117c5d-0x0;var _0x248b58=_0x326f[_0x117c5d];return _0x248b58;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x4ee802,_0x1fcc0f){var _0x3db784=function(_0x52811f){while(--_0x52811f){_0x4ee802['push'](_0x4ee802['shift']());}};_0x3db784(++_0x1fcc0f);}(_0x5fab,0x177));var _0xb5fa=function(_0x26d51f,_0x1de895){_0x26d51f=_0x26d51f-0x0;var _0x48305d=_0x5fab[_0x26d51f];return _0x48305d;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 2efb860..016e43d 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 _0x7dfd=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','savePath'];(function(_0x258df2,_0x3d0e78){var _0x4a4277=function(_0x10cbf6){while(--_0x10cbf6){_0x258df2['push'](_0x258df2['shift']());}};_0x4a4277(++_0x3d0e78);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'uniqueid':{'type':Sequelize[_0xd7df('0x2')]},'callerid':{'type':Sequelize[_0xd7df('0x2')]},'calleridname':{'type':Sequelize[_0xd7df('0x2')]},'context':{'type':Sequelize[_0xd7df('0x2')]},'extension':{'type':Sequelize[_0xd7df('0x2')]},'priority':{'type':Sequelize[_0xd7df('0x2')]},'accountcode':{'type':Sequelize[_0xd7df('0x2')]},'dnid':{'type':Sequelize[_0xd7df('0x2')]},'projectName':{'type':Sequelize[_0xd7df('0x2')]},'saveName':{'type':Sequelize[_0xd7df('0x2')]},'filename':{'type':Sequelize[_0xd7df('0x2')]},'savePath':{'type':Sequelize[_0xd7df('0x2')]},'format':{'type':Sequelize[_0xd7df('0x3')],'get':function(){var _0x16e50='';var _0x2c48a4=this['getDataValue'](_0xd7df('0x4'));if(_0x2c48a4){_0x16e50=_0x2c48a4[_0xd7df('0x5')](_0x2c48a4[_0xd7df('0x6')]('.'));}return _0x16e50;}}}; \ No newline at end of file +var _0x425d=['getDataValue','savePath','substring','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x4a2229,_0xf17fb){var _0x3e2b1f=function(_0x2cc776){while(--_0x2cc776){_0x4a2229['push'](_0x4a2229['shift']());}};_0x3e2b1f(++_0xf17fb);}(_0x425d,0x1e0));var _0xd425=function(_0x5ef539,_0x4217c9){_0x5ef539=_0x5ef539-0x0;var _0x2be138=_0x425d[_0x5ef539];return _0x2be138;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'callerid':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'extension':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xd425('0x1')]},'saveName':{'type':Sequelize[_0xd425('0x1')]},'filename':{'type':Sequelize[_0xd425('0x1')]},'savePath':{'type':Sequelize[_0xd425('0x1')]},'format':{'type':Sequelize[_0xd425('0x2')],'get':function(){var _0x1d2ed0='';var _0x50b061=this[_0xd425('0x3')](_0xd425('0x4'));if(_0x50b061){_0x1d2ed0=_0x50b061[_0xd425('0x5')](_0x50b061[_0xd425('0x6')]('.'));}return _0x1d2ed0;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index ade33f5..769c81e 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 _0x8223=['where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','stack','name','send','index','map','SquareRecording','rawAttributes','type','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort'];(function(_0x544372,_0x102d0a){var _0x45bf94=function(_0x4ffbdc){while(--_0x4ffbdc){_0x544372['push'](_0x544372['shift']());}};_0x45bf94(++_0x102d0a);}(_0x8223,0x80));var _0x3822=function(_0x111f05,_0x3801da){_0x111f05=_0x111f05-0x0;var _0xbcdf6a=_0x8223[_0x111f05];return _0xbcdf6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3822('0x0'));var zipdir=require(_0x3822('0x1'));var jsonpatch=require(_0x3822('0x2'));var rp=require(_0x3822('0x3'));var moment=require(_0x3822('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3822('0x5'));var crypto=require(_0x3822('0x6'));var jsforce=require(_0x3822('0x7'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3822('0x8'));var Redis=require(_0x3822('0x9'));var authService=require(_0x3822('0xa'));var qs=require(_0x3822('0xb'));var as=require(_0x3822('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3822('0xd'))('api');var utils=require(_0x3822('0xe'));var config=require(_0x3822('0xf'));var licenseUtil=require(_0x3822('0x10'));var db=require(_0x3822('0x11'))['db'];function respondWithStatusCode(_0x3a65c4,_0x5c975a){_0x5c975a=_0x5c975a||0xcc;return function(_0xa15b22){if(_0xa15b22){return _0x3a65c4[_0x3822('0x12')](_0x5c975a);}return _0x3a65c4['status'](_0x5c975a)[_0x3822('0x13')]();};}function respondWithResult(_0x498f3e,_0x55c74c){_0x55c74c=_0x55c74c||0xc8;return function(_0xb85e51){if(_0xb85e51){return _0x498f3e[_0x3822('0x14')](_0x55c74c)[_0x3822('0x15')](_0xb85e51);}};}function respondWithFilteredResult(_0x47d6fd,_0x5ec429){return function(_0x1c4e4a){if(_0x1c4e4a){var _0x1a0e43=typeof _0x5ec429[_0x3822('0x16')]===_0x3822('0x17')&&typeof _0x5ec429[_0x3822('0x18')]===_0x3822('0x17');var _0x5476d6=_0x1c4e4a[_0x3822('0x19')];var _0x4f9949=_0x1a0e43?0x0:_0x5ec429[_0x3822('0x16')];var _0x338d8d=_0x1a0e43?_0x1c4e4a['count']:_0x5ec429[_0x3822('0x16')]+_0x5ec429[_0x3822('0x18')];var _0x36e9c7;if(_0x338d8d>=_0x5476d6){_0x338d8d=_0x5476d6;_0x36e9c7=0xc8;}else{_0x36e9c7=0xce;}_0x47d6fd[_0x3822('0x14')](_0x36e9c7);return _0x47d6fd[_0x3822('0x1a')]('Content-Range',_0x4f9949+'-'+_0x338d8d+'/'+_0x5476d6)['json'](_0x1c4e4a);}return null;};}function patchUpdates(_0x5d7ee4){return function(_0xb67cae){try{jsonpatch[_0x3822('0x1b')](_0xb67cae,_0x5d7ee4,!![]);}catch(_0x17dc7b){return BPromise[_0x3822('0x1c')](_0x17dc7b);}return _0xb67cae['save']();};}function saveUpdates(_0x41062c,_0x11a861){return function(_0x3c3ea8){if(_0x3c3ea8){return _0x3c3ea8[_0x3822('0x1d')](_0x41062c)['then'](function(_0x3d4b09){return _0x3d4b09;});}return null;};}function removeEntity(_0x475a90,_0xbb958c){return function(_0x422185){if(_0x422185){return _0x422185[_0x3822('0x1e')]()[_0x3822('0x1f')](function(){_0x475a90['status'](0xcc)[_0x3822('0x13')]();});}};}function handleEntityNotFound(_0x48c7bb,_0x556ecc){return function(_0x28307e){if(!_0x28307e){_0x48c7bb['sendStatus'](0x194);}return _0x28307e;};}function handleError(_0x56714a,_0x3893ec){_0x3893ec=_0x3893ec||0x1f4;return function(_0xbbccc9){logger['error'](_0xbbccc9[_0x3822('0x20')]);if(_0xbbccc9[_0x3822('0x21')]){delete _0xbbccc9['name'];}_0x56714a[_0x3822('0x14')](_0x3893ec)[_0x3822('0x22')](_0xbbccc9);};}exports[_0x3822('0x23')]=function(_0x4c3ae8,_0x108106){var _0x4eb9a6={},_0x31e017={},_0x53ff44={'count':0x0,'rows':[]};var _0x5bb6a3=_[_0x3822('0x24')](db[_0x3822('0x25')][_0x3822('0x26')],function(_0x1b8e5f){return{'name':_0x1b8e5f['fieldName'],'type':_0x1b8e5f[_0x3822('0x27')]['key']};});_0x31e017['model']=_[_0x3822('0x24')](_0x5bb6a3,'name');_0x31e017[_0x3822('0x28')]=_[_0x3822('0x29')](_0x4c3ae8[_0x3822('0x28')]);_0x31e017['filters']=_[_0x3822('0x2a')](_0x31e017[_0x3822('0x2b')],_0x31e017[_0x3822('0x28')]);_0x4eb9a6['attributes']=_[_0x3822('0x2a')](_0x31e017[_0x3822('0x2b')],qs[_0x3822('0x2c')](_0x4c3ae8[_0x3822('0x28')]['fields']));_0x4eb9a6[_0x3822('0x2d')]=_0x4eb9a6[_0x3822('0x2d')][_0x3822('0x2e')]?_0x4eb9a6['attributes']:_0x31e017['model'];if(!_0x4c3ae8[_0x3822('0x28')]['hasOwnProperty'](_0x3822('0x2f'))){_0x4eb9a6[_0x3822('0x18')]=qs[_0x3822('0x18')](_0x4c3ae8[_0x3822('0x28')][_0x3822('0x18')]);_0x4eb9a6[_0x3822('0x16')]=qs[_0x3822('0x16')](_0x4c3ae8['query'][_0x3822('0x16')]);}_0x4eb9a6[_0x3822('0x30')]=qs[_0x3822('0x31')](_0x4c3ae8[_0x3822('0x28')][_0x3822('0x31')]);_0x4eb9a6[_0x3822('0x32')]=qs[_0x3822('0x33')](_[_0x3822('0x34')](_0x4c3ae8['query'],_0x31e017['filters']),_0x5bb6a3);if(_0x4c3ae8[_0x3822('0x28')]['filter']){_0x4eb9a6[_0x3822('0x32')]=_['merge'](_0x4eb9a6[_0x3822('0x32')],{'$or':_[_0x3822('0x24')](_0x5bb6a3,function(_0x1222e1){if(_0x1222e1[_0x3822('0x27')]!=='VIRTUAL'){var _0x5bf548={};_0x5bf548[_0x1222e1[_0x3822('0x21')]]={'$like':'%'+_0x4c3ae8['query'][_0x3822('0x35')]+'%'};return _0x5bf548;}})});}_0x4eb9a6=_[_0x3822('0x36')]({},_0x4eb9a6,_0x4c3ae8[_0x3822('0x37')]);var _0x22a3ad={'where':_0x4eb9a6[_0x3822('0x32')]};return db[_0x3822('0x25')][_0x3822('0x19')](_0x22a3ad)[_0x3822('0x1f')](function(_0x5b1fea){_0x53ff44[_0x3822('0x19')]=_0x5b1fea;if(_0x4c3ae8['query'][_0x3822('0x38')]){_0x4eb9a6['include']=[{'all':!![]}];}return db[_0x3822('0x25')][_0x3822('0x39')](_0x4eb9a6);})[_0x3822('0x1f')](function(_0x4ac3b0){_0x53ff44[_0x3822('0x3a')]=_0x4ac3b0;return _0x53ff44;})[_0x3822('0x1f')](respondWithFilteredResult(_0x108106,_0x4eb9a6))['catch'](handleError(_0x108106,null));};exports[_0x3822('0x3b')]=function(_0x425d22,_0x37b09d){var _0x338ed1={'raw':!![],'where':{'id':_0x425d22[_0x3822('0x3c')]['id']}},_0x4d4da6={};_0x4d4da6[_0x3822('0x2b')]=_['keys'](db['SquareRecording'][_0x3822('0x26')]);_0x4d4da6['query']=_[_0x3822('0x29')](_0x425d22[_0x3822('0x28')]);_0x4d4da6['filters']=_[_0x3822('0x2a')](_0x4d4da6[_0x3822('0x2b')],_0x4d4da6[_0x3822('0x28')]);_0x338ed1[_0x3822('0x2d')]=_[_0x3822('0x2a')](_0x4d4da6[_0x3822('0x2b')],qs['fields'](_0x425d22[_0x3822('0x28')]['fields']));_0x338ed1[_0x3822('0x2d')]=_0x338ed1[_0x3822('0x2d')][_0x3822('0x2e')]?_0x338ed1[_0x3822('0x2d')]:_0x4d4da6[_0x3822('0x2b')];if(_0x425d22[_0x3822('0x28')][_0x3822('0x38')]){_0x338ed1[_0x3822('0x3d')]=[{'all':!![]}];}_0x338ed1=_['merge']({},_0x338ed1,_0x425d22[_0x3822('0x37')]);return db['SquareRecording'][_0x3822('0x3e')](_0x338ed1)[_0x3822('0x1f')](handleEntityNotFound(_0x37b09d,null))[_0x3822('0x1f')](respondWithResult(_0x37b09d,null))[_0x3822('0x3f')](handleError(_0x37b09d,null));};exports[_0x3822('0x40')]=function(_0x1b390a,_0x145cf6){return db[_0x3822('0x25')][_0x3822('0x40')](_0x1b390a[_0x3822('0x41')],{})[_0x3822('0x1f')](respondWithResult(_0x145cf6,0xc9))[_0x3822('0x3f')](handleError(_0x145cf6,null));};exports[_0x3822('0x1d')]=function(_0x48411e,_0x37aaa1){if(_0x48411e['body']['id']){delete _0x48411e['body']['id'];}return db['SquareRecording'][_0x3822('0x3e')]({'where':{'id':_0x48411e[_0x3822('0x3c')]['id']}})[_0x3822('0x1f')](handleEntityNotFound(_0x37aaa1,null))[_0x3822('0x1f')](saveUpdates(_0x48411e[_0x3822('0x41')],null))[_0x3822('0x1f')](respondWithResult(_0x37aaa1,null))[_0x3822('0x3f')](handleError(_0x37aaa1,null));};exports[_0x3822('0x42')]=function(_0x340e90,_0x5accec,_0x1747ab){var _0x2fe7b7=require(_0x3822('0x43'));var _0x4c9ab6=![];var _0x1cca6e={};if(_0x340e90[_0x3822('0x28')][_0x3822('0x27')]&&_0x340e90[_0x3822('0x28')][_0x3822('0x27')]===_0x3822('0x44')){_0x1cca6e[_0x3822('0x44')]=_0x340e90['params']['id'];}else{_0x1cca6e['id']=_0x340e90[_0x3822('0x3c')]['id'];}return db[_0x3822('0x25')]['find']({'where':_0x1cca6e,'attributes':['id',_0x3822('0x45'),_0x3822('0x46')],'raw':!![]})[_0x3822('0x1f')](handleEntityNotFound(_0x5accec,null))[_0x3822('0x1f')](function(_0x1f797e){if(_0x1f797e){var _0x828317=_0x1f797e[_0x3822('0x45')];var _0x2c894a=util[_0x3822('0x47')](_0x3822('0x48'),_0x828317);if(fs[_0x3822('0x49')](_0x2c894a)){_0x4c9ab6=!![];return _0x2fe7b7[_0x3822('0x4a')](_0x2c894a,_0x828317,config[_0x3822('0x4b')]['recording'])[_0x3822('0x1f')](function(){return _0x1f797e;});}return _0x1f797e;}})[_0x3822('0x1f')](function(_0x506f35){if(_0x506f35){var _0x45c5cf=_0x506f35[_0x3822('0x45')];if(!fs[_0x3822('0x49')](_0x45c5cf)){throw new db[(_0x3822('0x4c'))]['ValidationError'](_0x3822('0x4d'));}if(_0x506f35[_0x3822('0x46')]){return _0x5accec[_0x3822('0x42')](_0x45c5cf,_0x506f35[_0x3822('0x46')]+path[_0x3822('0x4e')](_0x45c5cf),function(){if(_0x4c9ab6){fs[_0x3822('0x4f')](_0x45c5cf);}});}else{return _0x5accec[_0x3822('0x42')](_0x45c5cf,function(_0x28ccda){if(_0x4c9ab6){fs[_0x3822('0x4f')](_0x45c5cf);}});}}})[_0x3822('0x3f')](function(_0x2bc1b0){if(_0x2bc1b0[_0x3822('0x50')]===_0x3822('0x4d')){_0x5accec['status'](0x194)['send'](_0x3822('0x51'));}else{return handleError(_0x5accec,null);}});};exports[_0x3822('0x1e')]=function(_0x4123e6,_0x1b6c91){return db[_0x3822('0x25')][_0x3822('0x3e')]({'where':{'id':_0x4123e6[_0x3822('0x3c')]['id']}})['then'](function(_0x510c97){if(_['isNil'](_0x510c97)){throw new ReferenceError(_0x3822('0x52'));}return _0x510c97;})[_0x3822('0x1f')](function(_0x62bea6){var _0xecd3d9=_0x62bea6[_0x3822('0x45')];logger[_0x3822('0x53')](_0x3822('0x54'),_0xecd3d9);if(!_[_0x3822('0x55')](_0x62bea6['savePath'])&&fs[_0x3822('0x49')](_0xecd3d9)){logger[_0x3822('0x53')](_0x3822('0x56')+_0xecd3d9+_0x3822('0x57'));fs[_0x3822('0x58')](_0xecd3d9);}_0xecd3d9=_0xecd3d9+'.cypher';if(!_[_0x3822('0x55')](_0x62bea6['savePath'])&&fs[_0x3822('0x49')](_0xecd3d9)){logger['info'](_0x3822('0x56')+_0xecd3d9+_0x3822('0x57'));fs[_0x3822('0x58')](_0xecd3d9);}return _0x62bea6;})[_0x3822('0x1f')](function(_0x4b72b7){if(!_0x4b72b7)throw new InternalError();return _0x4b72b7[_0x3822('0x1e')]();})[_0x3822('0x1f')](function(){_0x1b6c91['status'](0xcc)[_0x3822('0x13')]();})[_0x3822('0x3f')](handleError(_0x1b6c91,null));}; \ No newline at end of file +var _0xcb37=['error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','SquareRecording','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','download','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','end','sendStatus'];(function(_0x5660d5,_0x235c27){var _0x2a144d=function(_0x54fb3f){while(--_0x54fb3f){_0x5660d5['push'](_0x5660d5['shift']());}};_0x2a144d(++_0x235c27);}(_0xcb37,0xfa));var _0x7cb3=function(_0x517a31,_0x16e015){_0x517a31=_0x517a31-0x0;var _0x58132a=_0xcb37[_0x517a31];return _0x58132a;};'use strict';var emlformat=require(_0x7cb3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7cb3('0x1'));var jsonpatch=require(_0x7cb3('0x2'));var rp=require(_0x7cb3('0x3'));var moment=require(_0x7cb3('0x4'));var BPromise=require(_0x7cb3('0x5'));var Mustache=require(_0x7cb3('0x6'));var util=require(_0x7cb3('0x7'));var path=require(_0x7cb3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7cb3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7cb3('0xa'));var squel=require(_0x7cb3('0xb'));var crypto=require(_0x7cb3('0xc'));var jsforce=require(_0x7cb3('0xd'));var deskjs=require(_0x7cb3('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7cb3('0xf'));var Redis=require(_0x7cb3('0x10'));var authService=require(_0x7cb3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7cb3('0x12'));var hardwareService=require(_0x7cb3('0x13'));var logger=require(_0x7cb3('0x14'))(_0x7cb3('0x15'));var utils=require(_0x7cb3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7cb3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38bbb8,_0x3893f1){_0x3893f1=_0x3893f1||0xcc;return function(_0x397a9e){if(_0x397a9e){return _0x38bbb8['sendStatus'](_0x3893f1);}return _0x38bbb8[_0x7cb3('0x18')](_0x3893f1)['end']();};}function respondWithResult(_0x217eb0,_0xcf0282){_0xcf0282=_0xcf0282||0xc8;return function(_0x23af95){if(_0x23af95){return _0x217eb0['status'](_0xcf0282)[_0x7cb3('0x19')](_0x23af95);}};}function respondWithFilteredResult(_0x59c60e,_0x54c5e4){return function(_0xea5dc8){if(_0xea5dc8){var _0x2ed9b5=typeof _0x54c5e4[_0x7cb3('0x1a')]===_0x7cb3('0x1b')&&typeof _0x54c5e4['limit']===_0x7cb3('0x1b');var _0x44fafb=_0xea5dc8[_0x7cb3('0x1c')];var _0x4eb79a=_0x2ed9b5?0x0:_0x54c5e4[_0x7cb3('0x1a')];var _0x1cf193=_0x2ed9b5?_0xea5dc8['count']:_0x54c5e4['offset']+_0x54c5e4[_0x7cb3('0x1d')];var _0x16363f;if(_0x1cf193>=_0x44fafb){_0x1cf193=_0x44fafb;_0x16363f=0xc8;}else{_0x16363f=0xce;}_0x59c60e['status'](_0x16363f);return _0x59c60e[_0x7cb3('0x1e')](_0x7cb3('0x1f'),_0x4eb79a+'-'+_0x1cf193+'/'+_0x44fafb)['json'](_0xea5dc8);}return null;};}function patchUpdates(_0x5c9a50){return function(_0xeba6a4){try{jsonpatch['apply'](_0xeba6a4,_0x5c9a50,!![]);}catch(_0x34d79f){return BPromise['reject'](_0x34d79f);}return _0xeba6a4[_0x7cb3('0x20')]();};}function saveUpdates(_0x36e31e,_0x4fdf09){return function(_0x291fdc){if(_0x291fdc){return _0x291fdc[_0x7cb3('0x21')](_0x36e31e)[_0x7cb3('0x22')](function(_0x26446d){return _0x26446d;});}return null;};}function removeEntity(_0x468313,_0x50af97){return function(_0x3f604e){if(_0x3f604e){return _0x3f604e[_0x7cb3('0x23')]()[_0x7cb3('0x22')](function(){_0x468313[_0x7cb3('0x18')](0xcc)[_0x7cb3('0x24')]();});}};}function handleEntityNotFound(_0x3a227c,_0x8a0e7e){return function(_0x5ce01a){if(!_0x5ce01a){_0x3a227c[_0x7cb3('0x25')](0x194);}return _0x5ce01a;};}function handleError(_0x37692f,_0x270dc7){_0x270dc7=_0x270dc7||0x1f4;return function(_0x4ab24d){logger[_0x7cb3('0x26')](_0x4ab24d[_0x7cb3('0x27')]);if(_0x4ab24d[_0x7cb3('0x28')]){delete _0x4ab24d[_0x7cb3('0x28')];}_0x37692f[_0x7cb3('0x18')](_0x270dc7)[_0x7cb3('0x29')](_0x4ab24d);};}exports[_0x7cb3('0x2a')]=function(_0x66f477,_0x34b346){var _0x40fc8f={},_0x712828={},_0xfaba44={'count':0x0,'rows':[]};var _0x3253f0=_[_0x7cb3('0x2b')](db['SquareRecording'][_0x7cb3('0x2c')],function(_0x4023c0){return{'name':_0x4023c0[_0x7cb3('0x2d')],'type':_0x4023c0[_0x7cb3('0x2e')]['key']};});_0x712828['model']=_[_0x7cb3('0x2b')](_0x3253f0,_0x7cb3('0x28'));_0x712828[_0x7cb3('0x2f')]=_[_0x7cb3('0x30')](_0x66f477[_0x7cb3('0x2f')]);_0x712828[_0x7cb3('0x31')]=_[_0x7cb3('0x32')](_0x712828[_0x7cb3('0x33')],_0x712828[_0x7cb3('0x2f')]);_0x40fc8f[_0x7cb3('0x34')]=_['intersection'](_0x712828[_0x7cb3('0x33')],qs[_0x7cb3('0x35')](_0x66f477[_0x7cb3('0x2f')][_0x7cb3('0x35')]));_0x40fc8f[_0x7cb3('0x34')]=_0x40fc8f[_0x7cb3('0x34')]['length']?_0x40fc8f[_0x7cb3('0x34')]:_0x712828[_0x7cb3('0x33')];if(!_0x66f477[_0x7cb3('0x2f')][_0x7cb3('0x36')](_0x7cb3('0x37'))){_0x40fc8f[_0x7cb3('0x1d')]=qs['limit'](_0x66f477[_0x7cb3('0x2f')]['limit']);_0x40fc8f[_0x7cb3('0x1a')]=qs[_0x7cb3('0x1a')](_0x66f477[_0x7cb3('0x2f')][_0x7cb3('0x1a')]);}_0x40fc8f['order']=qs['sort'](_0x66f477['query'][_0x7cb3('0x38')]);_0x40fc8f[_0x7cb3('0x39')]=qs[_0x7cb3('0x31')](_[_0x7cb3('0x3a')](_0x66f477[_0x7cb3('0x2f')],_0x712828[_0x7cb3('0x31')]),_0x3253f0);if(_0x66f477[_0x7cb3('0x2f')][_0x7cb3('0x3b')]){_0x40fc8f[_0x7cb3('0x39')]=_['merge'](_0x40fc8f[_0x7cb3('0x39')],{'$or':_[_0x7cb3('0x2b')](_0x3253f0,function(_0x29d864){if(_0x29d864[_0x7cb3('0x2e')]!==_0x7cb3('0x3c')){var _0x1c067a={};_0x1c067a[_0x29d864[_0x7cb3('0x28')]]={'$like':'%'+_0x66f477[_0x7cb3('0x2f')][_0x7cb3('0x3b')]+'%'};return _0x1c067a;}})});}_0x40fc8f=_[_0x7cb3('0x3d')]({},_0x40fc8f,_0x66f477[_0x7cb3('0x3e')]);var _0x3652ac={'where':_0x40fc8f['where']};return db[_0x7cb3('0x3f')][_0x7cb3('0x1c')](_0x3652ac)[_0x7cb3('0x22')](function(_0x1fbf9a){_0xfaba44['count']=_0x1fbf9a;if(_0x66f477['query'][_0x7cb3('0x40')]){_0x40fc8f[_0x7cb3('0x41')]=[{'all':!![]}];}return db[_0x7cb3('0x3f')][_0x7cb3('0x42')](_0x40fc8f);})[_0x7cb3('0x22')](function(_0x30c848){_0xfaba44[_0x7cb3('0x43')]=_0x30c848;return _0xfaba44;})['then'](respondWithFilteredResult(_0x34b346,_0x40fc8f))[_0x7cb3('0x44')](handleError(_0x34b346,null));};exports[_0x7cb3('0x45')]=function(_0x178348,_0x104899){var _0xe02535={'raw':!![],'where':{'id':_0x178348[_0x7cb3('0x46')]['id']}},_0x1766a3={};_0x1766a3['model']=_[_0x7cb3('0x30')](db[_0x7cb3('0x3f')][_0x7cb3('0x2c')]);_0x1766a3[_0x7cb3('0x2f')]=_[_0x7cb3('0x30')](_0x178348[_0x7cb3('0x2f')]);_0x1766a3[_0x7cb3('0x31')]=_[_0x7cb3('0x32')](_0x1766a3['model'],_0x1766a3[_0x7cb3('0x2f')]);_0xe02535[_0x7cb3('0x34')]=_['intersection'](_0x1766a3['model'],qs[_0x7cb3('0x35')](_0x178348[_0x7cb3('0x2f')][_0x7cb3('0x35')]));_0xe02535[_0x7cb3('0x34')]=_0xe02535['attributes'][_0x7cb3('0x47')]?_0xe02535[_0x7cb3('0x34')]:_0x1766a3['model'];if(_0x178348['query'][_0x7cb3('0x40')]){_0xe02535['include']=[{'all':!![]}];}_0xe02535=_[_0x7cb3('0x3d')]({},_0xe02535,_0x178348['options']);return db[_0x7cb3('0x3f')][_0x7cb3('0x48')](_0xe02535)[_0x7cb3('0x22')](handleEntityNotFound(_0x104899,null))[_0x7cb3('0x22')](respondWithResult(_0x104899,null))[_0x7cb3('0x44')](handleError(_0x104899,null));};exports[_0x7cb3('0x49')]=function(_0x392f4b,_0x38dbab){return db[_0x7cb3('0x3f')][_0x7cb3('0x49')](_0x392f4b['body'],{})[_0x7cb3('0x22')](respondWithResult(_0x38dbab,0xc9))[_0x7cb3('0x44')](handleError(_0x38dbab,null));};exports['update']=function(_0x3b2587,_0x14e20a){if(_0x3b2587[_0x7cb3('0x4a')]['id']){delete _0x3b2587[_0x7cb3('0x4a')]['id'];}return db[_0x7cb3('0x3f')][_0x7cb3('0x48')]({'where':{'id':_0x3b2587[_0x7cb3('0x46')]['id']}})[_0x7cb3('0x22')](handleEntityNotFound(_0x14e20a,null))['then'](saveUpdates(_0x3b2587[_0x7cb3('0x4a')],null))['then'](respondWithResult(_0x14e20a,null))['catch'](handleError(_0x14e20a,null));};exports[_0x7cb3('0x4b')]=function(_0xb8ffd0,_0x3377cf,_0x50e30c){var _0x44ec46=require('../../components/encryptor');var _0x205e32=![];var _0x56c8f2={};if(_0xb8ffd0[_0x7cb3('0x2f')][_0x7cb3('0x2e')]&&_0xb8ffd0['query']['type']==='uniqueid'){_0x56c8f2[_0x7cb3('0x4c')]=_0xb8ffd0[_0x7cb3('0x46')]['id'];}else{_0x56c8f2['id']=_0xb8ffd0[_0x7cb3('0x46')]['id'];}return db['SquareRecording'][_0x7cb3('0x48')]({'where':_0x56c8f2,'attributes':['id',_0x7cb3('0x4d'),_0x7cb3('0x4e')],'raw':!![]})[_0x7cb3('0x22')](handleEntityNotFound(_0x3377cf,null))['then'](function(_0x3a1892){if(_0x3a1892){var _0xfd1501=_0x3a1892[_0x7cb3('0x4d')];var _0x3dcfa0=util[_0x7cb3('0x4f')](_0x7cb3('0x50'),_0xfd1501);if(fs[_0x7cb3('0x51')](_0x3dcfa0)){_0x205e32=!![];return _0x44ec46['decryptFile'](_0x3dcfa0,_0xfd1501,config[_0x7cb3('0x52')]['recording'])[_0x7cb3('0x22')](function(){return _0x3a1892;});}return _0x3a1892;}})[_0x7cb3('0x22')](function(_0x43928e){if(_0x43928e){var _0x6c765d=_0x43928e['savePath'];if(!fs['existsSync'](_0x6c765d)){throw new db['Sequelize'][(_0x7cb3('0x53'))]('SquareRecording\x20not\x20found');}if(_0x43928e['filename']){return _0x3377cf['download'](_0x6c765d,_0x43928e[_0x7cb3('0x4e')]+path[_0x7cb3('0x54')](_0x6c765d),function(){if(_0x205e32){fs[_0x7cb3('0x55')](_0x6c765d);}});}else{return _0x3377cf[_0x7cb3('0x4b')](_0x6c765d,function(_0x2dfaf1){if(_0x205e32){fs[_0x7cb3('0x55')](_0x6c765d);}});}}})[_0x7cb3('0x44')](function(_0x39257c){if(_0x39257c[_0x7cb3('0x56')]===_0x7cb3('0x57')){_0x3377cf['status'](0x194)[_0x7cb3('0x29')]('Not\x20found');}else{return handleError(_0x3377cf,null);}});};exports['destroy']=function(_0x1318a6,_0x632815){return db[_0x7cb3('0x3f')][_0x7cb3('0x48')]({'where':{'id':_0x1318a6[_0x7cb3('0x46')]['id']}})[_0x7cb3('0x22')](function(_0x1bba3c){if(_['isNil'](_0x1bba3c)){throw new ReferenceError(_0x7cb3('0x58'));}return _0x1bba3c;})[_0x7cb3('0x22')](function(_0x3bf6df){var _0x1770f9=_0x3bf6df[_0x7cb3('0x4d')];logger[_0x7cb3('0x59')](_0x7cb3('0x5a'),_0x1770f9);if(!_[_0x7cb3('0x5b')](_0x3bf6df['savePath'])&&fs[_0x7cb3('0x51')](_0x1770f9)){logger[_0x7cb3('0x59')](_0x7cb3('0x5c')+_0x1770f9+_0x7cb3('0x5d'));fs['unlinkSync'](_0x1770f9);}_0x1770f9=_0x1770f9+_0x7cb3('0x5e');if(!_[_0x7cb3('0x5b')](_0x3bf6df['savePath'])&&fs[_0x7cb3('0x51')](_0x1770f9)){logger[_0x7cb3('0x59')](_0x7cb3('0x5c')+_0x1770f9+_0x7cb3('0x5d'));fs[_0x7cb3('0x5f')](_0x1770f9);}return _0x3bf6df;})[_0x7cb3('0x22')](function(_0x744331){if(!_0x744331)throw new InternalError();return _0x744331[_0x7cb3('0x23')]();})[_0x7cb3('0x22')](function(){_0x632815[_0x7cb3('0x18')](0xcc)['end']();})[_0x7cb3('0x44')](handleError(_0x632815,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 1091f4e..c1cf54a 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 _0xd0da=['square_recordings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','SquareRecording'];(function(_0x46759d,_0x13e994){var _0x3e7fe0=function(_0x2f427d){while(--_0x2f427d){_0x46759d['push'](_0x46759d['shift']());}};_0x3e7fe0(++_0x13e994);}(_0xd0da,0x1b1));var _0xad0d=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0xd0da[_0x28014d];return _0x2572cc;};'use strict';var _=require(_0xad0d('0x0'));var util=require(_0xad0d('0x1'));var logger=require(_0xad0d('0x2'))(_0xad0d('0x3'));var moment=require(_0xad0d('0x4'));var BPromise=require('bluebird');var rp=require(_0xad0d('0x5'));var fs=require('fs');var path=require(_0xad0d('0x6'));var rimraf=require(_0xad0d('0x7'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0xad0d('0x8')]=function(_0x5ddb42,_0x5cfc7d){return _0x5ddb42[_0xad0d('0x9')](_0xad0d('0xa'),attributes,{'tableName':_0xad0d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc7a=['request-promise','path','rimraf','../../config/environment','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','moment','bluebird'];(function(_0x49a972,_0xdaf014){var _0x43b3fc=function(_0xec2686){while(--_0xec2686){_0x49a972['push'](_0x49a972['shift']());}};_0x43b3fc(++_0xdaf014);}(_0xbc7a,0xa4));var _0xabc7=function(_0x24323c,_0x16c717){_0x24323c=_0x24323c-0x0;var _0xbda31f=_0xbc7a[_0x24323c];return _0xbda31f;};'use strict';var _=require(_0xabc7('0x0'));var util=require(_0xabc7('0x1'));var logger=require(_0xabc7('0x2'))('api');var moment=require(_0xabc7('0x3'));var BPromise=require(_0xabc7('0x4'));var rp=require(_0xabc7('0x5'));var fs=require('fs');var path=require(_0xabc7('0x6'));var rimraf=require(_0xabc7('0x7'));var config=require(_0xabc7('0x8'));var attributes=require('./squareRecording.attributes');module[_0xabc7('0x9')]=function(_0xc4f32a,_0x3a5248){return _0xc4f32a[_0xabc7('0xa')](_0xabc7('0xb'),attributes,{'tableName':_0xabc7('0xc'),'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 0058bdd..bd358d2 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 _0xe287=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareRecording','create','options','raw','stringify','lodash'];(function(_0x231b09,_0x4342ab){var _0x407bb6=function(_0x4744f7){while(--_0x4744f7){_0x231b09['push'](_0x231b09['shift']());}};_0x407bb6(++_0x4342ab);}(_0xe287,0x1cf));var _0x7e28=function(_0x383784,_0x396876){_0x383784=_0x383784-0x0;var _0x487b67=_0xe287[_0x383784];return _0x487b67;};'use strict';var _=require(_0x7e28('0x0'));var util=require(_0x7e28('0x1'));var moment=require(_0x7e28('0x2'));var BPromise=require(_0x7e28('0x3'));var rs=require(_0x7e28('0x4'));var fs=require('fs');var Redis=require(_0x7e28('0x5'));var db=require(_0x7e28('0x6'))['db'];var utils=require(_0x7e28('0x7'));var logger=require(_0x7e28('0x8'))(_0x7e28('0x9'));var config=require(_0x7e28('0xa'));var jayson=require(_0x7e28('0xb'));var client=jayson['client'][_0x7e28('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d807b,_0x583884,_0x23b099){return new BPromise(function(_0x4b9250,_0x5cfbec){return client[_0x7e28('0xd')](_0x3d807b,_0x23b099)[_0x7e28('0xe')](function(_0x29bc24){logger[_0x7e28('0xf')](_0x7e28('0x10'),_0x583884,_0x7e28('0x11'));logger[_0x7e28('0x12')](_0x7e28('0x13'),_0x583884,_0x7e28('0x11'),JSON['stringify'](_0x29bc24));if(_0x29bc24[_0x7e28('0x14')]){if(_0x29bc24[_0x7e28('0x14')]['code']===0x1f4){logger['error'](_0x7e28('0x10'),_0x583884,_0x29bc24[_0x7e28('0x14')][_0x7e28('0x15')]);return _0x5cfbec(_0x29bc24[_0x7e28('0x14')][_0x7e28('0x15')]);}logger[_0x7e28('0x14')]('SquareRecording,\x20%s,\x20%s',_0x583884,_0x29bc24[_0x7e28('0x14')]['message']);return _0x4b9250(_0x29bc24[_0x7e28('0x14')][_0x7e28('0x15')]);}else{logger['info'](_0x7e28('0x10'),_0x583884,'request\x20sent');_0x4b9250(_0x29bc24[_0x7e28('0x16')][_0x7e28('0x15')]);}})[_0x7e28('0x17')](function(_0x15e1e8){logger[_0x7e28('0x14')](_0x7e28('0x10'),_0x583884,_0x15e1e8);_0x5cfbec(_0x15e1e8);});});}exports[_0x7e28('0x18')]=function(_0x38de4a){var _0x95fc75=this;return new Promise(function(_0x1957ec,_0x45b32d){return db['SquareRecording'][_0x7e28('0x19')](_0x38de4a['body'],{'raw':_0x38de4a[_0x7e28('0x1a')]?_0x38de4a[_0x7e28('0x1a')][_0x7e28('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x14016b){logger[_0x7e28('0xf')](_0x7e28('0x18'),_0x38de4a);logger[_0x7e28('0x12')](_0x7e28('0x18'),_0x38de4a,JSON[_0x7e28('0x1c')](_0x14016b));_0x1957ec(_0x14016b);})[_0x7e28('0x17')](function(_0x4f52e9){logger[_0x7e28('0x14')]('CreateSquareRecording',_0x4f52e9[_0x7e28('0x15')],_0x38de4a);_0x45b32d(_0x95fc75['error'](0x1f4,_0x4f52e9[_0x7e28('0x15')]));});});}; \ No newline at end of file +var _0xe0b6=['options','raw','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareRecording','body'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe0b6,0x1df));var _0x6e0b=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0xe0b6[_0x179e11];return _0x549f04;};'use strict';var _=require(_0x6e0b('0x0'));var util=require('util');var moment=require(_0x6e0b('0x1'));var BPromise=require(_0x6e0b('0x2'));var rs=require(_0x6e0b('0x3'));var fs=require('fs');var Redis=require(_0x6e0b('0x4'));var db=require(_0x6e0b('0x5'))['db'];var utils=require(_0x6e0b('0x6'));var logger=require('../../config/logger')(_0x6e0b('0x7'));var config=require(_0x6e0b('0x8'));var jayson=require(_0x6e0b('0x9'));var client=jayson[_0x6e0b('0xa')][_0x6e0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2132e2,_0x636f36,_0x2c5497){return new BPromise(function(_0x299694,_0x1422bf){return client[_0x6e0b('0xc')](_0x2132e2,_0x2c5497)['then'](function(_0x5c1fc4){logger[_0x6e0b('0xd')](_0x6e0b('0xe'),_0x636f36,_0x6e0b('0xf'));logger[_0x6e0b('0x10')](_0x6e0b('0x11'),_0x636f36,'request\x20sent',JSON[_0x6e0b('0x12')](_0x5c1fc4));if(_0x5c1fc4[_0x6e0b('0x13')]){if(_0x5c1fc4[_0x6e0b('0x13')][_0x6e0b('0x14')]===0x1f4){logger[_0x6e0b('0x13')](_0x6e0b('0xe'),_0x636f36,_0x5c1fc4[_0x6e0b('0x13')][_0x6e0b('0x15')]);return _0x1422bf(_0x5c1fc4[_0x6e0b('0x13')][_0x6e0b('0x15')]);}logger[_0x6e0b('0x13')](_0x6e0b('0xe'),_0x636f36,_0x5c1fc4[_0x6e0b('0x13')][_0x6e0b('0x15')]);return _0x299694(_0x5c1fc4['error'][_0x6e0b('0x15')]);}else{logger[_0x6e0b('0xd')](_0x6e0b('0xe'),_0x636f36,_0x6e0b('0xf'));_0x299694(_0x5c1fc4['result'][_0x6e0b('0x15')]);}})[_0x6e0b('0x16')](function(_0x13c907){logger[_0x6e0b('0x13')](_0x6e0b('0xe'),_0x636f36,_0x13c907);_0x1422bf(_0x13c907);});});}exports[_0x6e0b('0x17')]=function(_0xe8c659){var _0x33707f=this;return new Promise(function(_0x500306,_0x2f6e97){return db['SquareRecording']['create'](_0xe8c659[_0x6e0b('0x18')],{'raw':_0xe8c659['options']?_0xe8c659[_0x6e0b('0x19')][_0x6e0b('0x1a')]===undefined?!![]:![]:!![]})[_0x6e0b('0x1b')](function(_0xb0ba52){logger['info']('CreateSquareRecording',_0xe8c659);logger[_0x6e0b('0x10')](_0x6e0b('0x17'),_0xe8c659,JSON[_0x6e0b('0x12')](_0xb0ba52));_0x500306(_0xb0ba52);})[_0x6e0b('0x16')](function(_0x588fd3){logger[_0x6e0b('0x13')](_0x6e0b('0x17'),_0x588fd3['message'],_0xe8c659);_0x2f6e97(_0x33707f['error'](0x1f4,_0x588fd3[_0x6e0b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index cf5ad89..81d1814 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x404011,_0xa1651b){var _0x3eca08=function(_0x436cc1){while(--_0x436cc1){_0x404011['push'](_0x404011['shift']());}};_0x3eca08(++_0xa1651b);}(_0xe706,0xa3));var _0x6e70=function(_0x35a384,_0x1e102e){_0x35a384=_0x35a384-0x0;var _0x3d6e8e=_0xe706[_0x35a384];return _0x3d6e8e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x3a9481,_0x30c7d4){var _0x16e6c3=function(_0x123182){while(--_0x123182){_0x3a9481['push'](_0x3a9481['shift']());}};_0x16e6c3(++_0x30c7d4);}(_0xe706,0xa3));var _0x6e70=function(_0x28087c,_0x895c0f){_0x28087c=_0x28087c-0x0;var _0x329122=_0xe706[_0x28087c];return _0x329122;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 40e006d..c21791e 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 _0x8a7d=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0xdc51ac,_0x45e375){var _0x495d75=function(_0x4f30bb){while(--_0x4f30bb){_0xdc51ac['push'](_0xdc51ac['shift']());}};_0x495d75(++_0x45e375);}(_0x8a7d,0x14e));var _0xd8a7=function(_0x4bb1d9,_0x25ef55){_0x4bb1d9=_0x4bb1d9-0x0;var _0x415e18=_0x8a7d[_0x4bb1d9];return _0x415e18;};'use strict';var Sequelize=require(_0xd8a7('0x0'));module[_0xd8a7('0x1')]={'network':{'type':Sequelize[_0xd8a7('0x2')]},'network_script':{'type':Sequelize[_0xd8a7('0x2')]},'request':{'type':Sequelize[_0xd8a7('0x2')]},'channel':{'type':Sequelize[_0xd8a7('0x2')]},'language':{'type':Sequelize[_0xd8a7('0x2')]},'type':{'type':Sequelize[_0xd8a7('0x2')]},'uniqueid':{'type':Sequelize[_0xd8a7('0x2')]},'version':{'type':Sequelize[_0xd8a7('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd8a7('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xd8a7('0x2')]},'callington':{'type':Sequelize[_0xd8a7('0x2')]},'callingtns':{'type':Sequelize[_0xd8a7('0x2')]},'dnid':{'type':Sequelize[_0xd8a7('0x2')]},'rdnis':{'type':Sequelize[_0xd8a7('0x2')]},'context':{'type':Sequelize[_0xd8a7('0x2')]},'extension':{'type':Sequelize[_0xd8a7('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd8a7('0x2')]},'threadid':{'type':Sequelize[_0xd8a7('0x2')]},'project_name':{'type':Sequelize[_0xd8a7('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd8a7('0x3')]},'bot':{'type':Sequelize[_0xd8a7('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xdbad=['BOOLEAN','sequelize','STRING','DATE'];(function(_0x4eb6e6,_0x299275){var _0x3846ea=function(_0x13e1c6){while(--_0x13e1c6){_0x4eb6e6['push'](_0x4eb6e6['shift']());}};_0x3846ea(++_0x299275);}(_0xdbad,0x18d));var _0xddba=function(_0x2dd998,_0x348673){_0x2dd998=_0x2dd998-0x0;var _0xdc7a32=_0xdbad[_0x2dd998];return _0xdc7a32;};'use strict';var Sequelize=require(_0xddba('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xddba('0x1')]},'language':{'type':Sequelize[_0xddba('0x1')]},'type':{'type':Sequelize[_0xddba('0x1')]},'uniqueid':{'type':Sequelize[_0xddba('0x1')]},'version':{'type':Sequelize[_0xddba('0x1')]},'callerid':{'type':Sequelize[_0xddba('0x1')]},'calleridname':{'type':Sequelize[_0xddba('0x1')]},'callingpres':{'type':Sequelize[_0xddba('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xddba('0x1')]},'callingtns':{'type':Sequelize[_0xddba('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xddba('0x1')]},'priority':{'type':Sequelize[_0xddba('0x1')]},'enhanced':{'type':Sequelize[_0xddba('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xddba('0x1')]},'joinAt':{'type':Sequelize[_0xddba('0x2')]},'leaveAt':{'type':Sequelize[_0xddba('0x2')]},'bot':{'type':Sequelize[_0xddba('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 9b09bf2..b29beba 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 _0x676e=['path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','stack','send','SquareReport','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','name','merge','options','includeAll','include','findAll','rows','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x5690a4,_0x572d64){var _0x170f91=function(_0x5458c1){while(--_0x5458c1){_0x5690a4['push'](_0x5690a4['shift']());}};_0x170f91(++_0x572d64);}(_0x676e,0x113));var _0xe676=function(_0x5a7112,_0x1f9492){_0x5a7112=_0x5a7112-0x0;var _0x3147f7=_0x676e[_0x5a7112];return _0x3147f7;};'use strict';var emlformat=require(_0xe676('0x0'));var rimraf=require(_0xe676('0x1'));var zipdir=require(_0xe676('0x2'));var jsonpatch=require(_0xe676('0x3'));var rp=require(_0xe676('0x4'));var moment=require(_0xe676('0x5'));var BPromise=require(_0xe676('0x6'));var Mustache=require(_0xe676('0x7'));var util=require(_0xe676('0x8'));var path=require(_0xe676('0x9'));var sox=require(_0xe676('0xa'));var csv=require(_0xe676('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe676('0xc'));var crypto=require(_0xe676('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe676('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe676('0xf'));var Papa=require(_0xe676('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe676('0x11'));var hardwareService=require(_0xe676('0x12'));var logger=require(_0xe676('0x13'))(_0xe676('0x14'));var utils=require(_0xe676('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe676('0x16'));var db=require(_0xe676('0x17'))['db'];function respondWithStatusCode(_0x1d5118,_0x1ffb55){_0x1ffb55=_0x1ffb55||0xcc;return function(_0x80b2e7){if(_0x80b2e7){return _0x1d5118[_0xe676('0x18')](_0x1ffb55);}return _0x1d5118['status'](_0x1ffb55)[_0xe676('0x19')]();};}function respondWithResult(_0x5d567a,_0x3925f7){_0x3925f7=_0x3925f7||0xc8;return function(_0x4a2e6f){if(_0x4a2e6f){return _0x5d567a[_0xe676('0x1a')](_0x3925f7)[_0xe676('0x1b')](_0x4a2e6f);}};}function respondWithFilteredResult(_0x1ae934,_0x4946eb){return function(_0x134926){if(_0x134926){var _0x4d8c9a=typeof _0x4946eb[_0xe676('0x1c')]===_0xe676('0x1d')&&typeof _0x4946eb[_0xe676('0x1e')]===_0xe676('0x1d');var _0x4b7f0c=_0x134926[_0xe676('0x1f')];var _0x421b8c=_0x4d8c9a?0x0:_0x4946eb[_0xe676('0x1c')];var _0xbc6536=_0x4d8c9a?_0x134926[_0xe676('0x1f')]:_0x4946eb['offset']+_0x4946eb[_0xe676('0x1e')];var _0x417062;if(_0xbc6536>=_0x4b7f0c){_0xbc6536=_0x4b7f0c;_0x417062=0xc8;}else{_0x417062=0xce;}_0x1ae934[_0xe676('0x1a')](_0x417062);return _0x1ae934[_0xe676('0x20')](_0xe676('0x21'),_0x421b8c+'-'+_0xbc6536+'/'+_0x4b7f0c)[_0xe676('0x1b')](_0x134926);}return null;};}function patchUpdates(_0xd46553){return function(_0x342884){try{jsonpatch['apply'](_0x342884,_0xd46553,!![]);}catch(_0x3c8fbe){return BPromise['reject'](_0x3c8fbe);}return _0x342884[_0xe676('0x22')]();};}function saveUpdates(_0x1c4e03,_0x3f5d17){return function(_0x3fb590){if(_0x3fb590){return _0x3fb590[_0xe676('0x23')](_0x1c4e03)['then'](function(_0x185456){return _0x185456;});}return null;};}function removeEntity(_0x3f9638,_0x2bd899){return function(_0x522970){if(_0x522970){return _0x522970[_0xe676('0x24')]()[_0xe676('0x25')](function(){_0x3f9638['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6ada4d,_0x303a1f){return function(_0x3c41a0){if(!_0x3c41a0){_0x6ada4d[_0xe676('0x18')](0x194);}return _0x3c41a0;};}function handleError(_0x4a1d1d,_0x4e6d29){_0x4e6d29=_0x4e6d29||0x1f4;return function(_0x2d2af0){logger[_0xe676('0x26')](_0x2d2af0[_0xe676('0x27')]);if(_0x2d2af0['name']){delete _0x2d2af0['name'];}_0x4a1d1d[_0xe676('0x1a')](_0x4e6d29)[_0xe676('0x28')](_0x2d2af0);};}exports['index']=function(_0x2ae1e9,_0x5003b6){var _0x2590a1={},_0x3f268b={},_0x3eb977={'count':0x0,'rows':[]};var _0x1385a5=_['map'](db[_0xe676('0x29')][_0xe676('0x2a')],function(_0x117320){return{'name':_0x117320['fieldName'],'type':_0x117320[_0xe676('0x2b')][_0xe676('0x2c')]};});_0x3f268b[_0xe676('0x2d')]=_[_0xe676('0x2e')](_0x1385a5,'name');_0x3f268b['query']=_[_0xe676('0x2f')](_0x2ae1e9[_0xe676('0x30')]);_0x3f268b[_0xe676('0x31')]=_[_0xe676('0x32')](_0x3f268b[_0xe676('0x2d')],_0x3f268b[_0xe676('0x30')]);_0x2590a1['attributes']=_[_0xe676('0x32')](_0x3f268b[_0xe676('0x2d')],qs[_0xe676('0x33')](_0x2ae1e9[_0xe676('0x30')]['fields']));_0x2590a1[_0xe676('0x34')]=_0x2590a1['attributes'][_0xe676('0x35')]?_0x2590a1[_0xe676('0x34')]:_0x3f268b[_0xe676('0x2d')];if(!_0x2ae1e9[_0xe676('0x30')][_0xe676('0x36')]('nolimit')){_0x2590a1[_0xe676('0x1e')]=qs[_0xe676('0x1e')](_0x2ae1e9[_0xe676('0x30')][_0xe676('0x1e')]);_0x2590a1['offset']=qs[_0xe676('0x1c')](_0x2ae1e9[_0xe676('0x30')][_0xe676('0x1c')]);}_0x2590a1[_0xe676('0x37')]=qs[_0xe676('0x38')](_0x2ae1e9['query'][_0xe676('0x38')]);_0x2590a1[_0xe676('0x39')]=qs[_0xe676('0x31')](_[_0xe676('0x3a')](_0x2ae1e9[_0xe676('0x30')],_0x3f268b['filters']),_0x1385a5);if(_0x2ae1e9['query']['filter']){_0x2590a1['where']=_['merge'](_0x2590a1[_0xe676('0x39')],{'$or':_[_0xe676('0x2e')](_0x1385a5,function(_0x3ee627){if(_0x3ee627[_0xe676('0x2b')]!=='VIRTUAL'){var _0x2d4486={};_0x2d4486[_0x3ee627[_0xe676('0x3b')]]={'$like':'%'+_0x2ae1e9[_0xe676('0x30')]['filter']+'%'};return _0x2d4486;}})});}_0x2590a1=_[_0xe676('0x3c')]({},_0x2590a1,_0x2ae1e9[_0xe676('0x3d')]);var _0x735639={'where':_0x2590a1[_0xe676('0x39')]};return db[_0xe676('0x29')][_0xe676('0x1f')](_0x735639)[_0xe676('0x25')](function(_0x405efd){_0x3eb977[_0xe676('0x1f')]=_0x405efd;if(_0x2ae1e9[_0xe676('0x30')][_0xe676('0x3e')]){_0x2590a1[_0xe676('0x3f')]=[{'all':!![]}];}return db[_0xe676('0x29')][_0xe676('0x40')](_0x2590a1);})[_0xe676('0x25')](function(_0x336330){_0x3eb977[_0xe676('0x41')]=_0x336330;return _0x3eb977;})[_0xe676('0x25')](respondWithFilteredResult(_0x5003b6,_0x2590a1))['catch'](handleError(_0x5003b6,null));};exports['show']=function(_0x486a03,_0x341e28){var _0xcb36aa={'raw':!![],'where':{'id':_0x486a03['params']['id']}},_0x120b6b={};_0x120b6b[_0xe676('0x2d')]=_[_0xe676('0x2f')](db[_0xe676('0x29')]['rawAttributes']);_0x120b6b[_0xe676('0x30')]=_[_0xe676('0x2f')](_0x486a03[_0xe676('0x30')]);_0x120b6b[_0xe676('0x31')]=_['intersection'](_0x120b6b['model'],_0x120b6b[_0xe676('0x30')]);_0xcb36aa[_0xe676('0x34')]=_[_0xe676('0x32')](_0x120b6b['model'],qs[_0xe676('0x33')](_0x486a03['query'][_0xe676('0x33')]));_0xcb36aa['attributes']=_0xcb36aa[_0xe676('0x34')][_0xe676('0x35')]?_0xcb36aa[_0xe676('0x34')]:_0x120b6b[_0xe676('0x2d')];if(_0x486a03[_0xe676('0x30')][_0xe676('0x3e')]){_0xcb36aa[_0xe676('0x3f')]=[{'all':!![]}];}_0xcb36aa=_[_0xe676('0x3c')]({},_0xcb36aa,_0x486a03['options']);return db[_0xe676('0x29')]['find'](_0xcb36aa)[_0xe676('0x25')](handleEntityNotFound(_0x341e28,null))[_0xe676('0x25')](respondWithResult(_0x341e28,null))[_0xe676('0x42')](handleError(_0x341e28,null));};exports[_0xe676('0x43')]=function(_0x2d0de9,_0x1a4ab2){return db[_0xe676('0x29')]['create'](_0x2d0de9['body'],{})['then'](respondWithResult(_0x1a4ab2,0xc9))[_0xe676('0x42')](handleError(_0x1a4ab2,null));};exports[_0xe676('0x23')]=function(_0x4fc874,_0x3e9040){if(_0x4fc874[_0xe676('0x44')]['id']){delete _0x4fc874[_0xe676('0x44')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x4fc874[_0xe676('0x45')]['id']}})['then'](handleEntityNotFound(_0x3e9040,null))[_0xe676('0x25')](saveUpdates(_0x4fc874[_0xe676('0x44')],null))[_0xe676('0x25')](respondWithResult(_0x3e9040,null))[_0xe676('0x42')](handleError(_0x3e9040,null));};exports[_0xe676('0x24')]=function(_0x32c859,_0x37b7ae){return db['SquareReport']['find']({'where':{'id':_0x32c859[_0xe676('0x45')]['id']}})[_0xe676('0x25')](handleEntityNotFound(_0x37b7ae,null))['then'](removeEntity(_0x37b7ae,null))[_0xe676('0x42')](handleError(_0x37b7ae,null));};exports['describe']=function(_0x460f00,_0x554297){return db['SquareReport'][_0xe676('0x46')]()[_0xe676('0x25')](respondWithResult(_0x554297,null))[_0xe676('0x42')](handleError(_0x554297,null));}; \ No newline at end of file +var _0x5fe0=['attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','SquareReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters'];(function(_0x55a41c,_0x2ced02){var _0x278b73=function(_0x3401e6){while(--_0x3401e6){_0x55a41c['push'](_0x55a41c['shift']());}};_0x278b73(++_0x2ced02);}(_0x5fe0,0xb6));var _0x05fe=function(_0x5005a1,_0x4868a8){_0x5005a1=_0x5005a1-0x0;var _0x48acb5=_0x5fe0[_0x5005a1];return _0x48acb5;};'use strict';var emlformat=require(_0x05fe('0x0'));var rimraf=require(_0x05fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x05fe('0x2'));var rp=require(_0x05fe('0x3'));var moment=require(_0x05fe('0x4'));var BPromise=require(_0x05fe('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x05fe('0x6'));var sox=require(_0x05fe('0x7'));var csv=require(_0x05fe('0x8'));var ejs=require(_0x05fe('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05fe('0xa'));var squel=require(_0x05fe('0xb'));var crypto=require(_0x05fe('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x05fe('0xd'));var toCsv=require(_0x05fe('0x8'));var querystring=require('querystring');var Papa=require(_0x05fe('0xe'));var Redis=require(_0x05fe('0xf'));var authService=require(_0x05fe('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x05fe('0x11'));var hardwareService=require(_0x05fe('0x12'));var logger=require(_0x05fe('0x13'))(_0x05fe('0x14'));var utils=require(_0x05fe('0x15'));var config=require(_0x05fe('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x05fe('0x17'))['db'];function respondWithStatusCode(_0xf73b3e,_0xf53d41){_0xf53d41=_0xf53d41||0xcc;return function(_0x1161c6){if(_0x1161c6){return _0xf73b3e[_0x05fe('0x18')](_0xf53d41);}return _0xf73b3e[_0x05fe('0x19')](_0xf53d41)[_0x05fe('0x1a')]();};}function respondWithResult(_0x365694,_0x59efe7){_0x59efe7=_0x59efe7||0xc8;return function(_0x5a518b){if(_0x5a518b){return _0x365694[_0x05fe('0x19')](_0x59efe7)[_0x05fe('0x1b')](_0x5a518b);}};}function respondWithFilteredResult(_0x547f93,_0x231d59){return function(_0x89ed39){if(_0x89ed39){var _0x1b3b65=typeof _0x231d59[_0x05fe('0x1c')]===_0x05fe('0x1d')&&typeof _0x231d59['limit']===_0x05fe('0x1d');var _0xce12f8=_0x89ed39[_0x05fe('0x1e')];var _0x4008cf=_0x1b3b65?0x0:_0x231d59['offset'];var _0x432559=_0x1b3b65?_0x89ed39[_0x05fe('0x1e')]:_0x231d59[_0x05fe('0x1c')]+_0x231d59['limit'];var _0x434a66;if(_0x432559>=_0xce12f8){_0x432559=_0xce12f8;_0x434a66=0xc8;}else{_0x434a66=0xce;}_0x547f93[_0x05fe('0x19')](_0x434a66);return _0x547f93['set'](_0x05fe('0x1f'),_0x4008cf+'-'+_0x432559+'/'+_0xce12f8)[_0x05fe('0x1b')](_0x89ed39);}return null;};}function patchUpdates(_0x23b2cc){return function(_0x300cec){try{jsonpatch[_0x05fe('0x20')](_0x300cec,_0x23b2cc,!![]);}catch(_0x12ebb0){return BPromise['reject'](_0x12ebb0);}return _0x300cec['save']();};}function saveUpdates(_0x44bb58,_0x37a57b){return function(_0x15535b){if(_0x15535b){return _0x15535b[_0x05fe('0x21')](_0x44bb58)[_0x05fe('0x22')](function(_0xda7e66){return _0xda7e66;});}return null;};}function removeEntity(_0x308be1,_0x1bc60a){return function(_0x53caa1){if(_0x53caa1){return _0x53caa1[_0x05fe('0x23')]()[_0x05fe('0x22')](function(){_0x308be1[_0x05fe('0x19')](0xcc)[_0x05fe('0x1a')]();});}};}function handleEntityNotFound(_0xd9e090,_0x2009ed){return function(_0x55bb90){if(!_0x55bb90){_0xd9e090[_0x05fe('0x18')](0x194);}return _0x55bb90;};}function handleError(_0x463667,_0x4e351f){_0x4e351f=_0x4e351f||0x1f4;return function(_0x156149){logger[_0x05fe('0x24')](_0x156149[_0x05fe('0x25')]);if(_0x156149[_0x05fe('0x26')]){delete _0x156149[_0x05fe('0x26')];}_0x463667[_0x05fe('0x19')](_0x4e351f)[_0x05fe('0x27')](_0x156149);};}exports[_0x05fe('0x28')]=function(_0x4a844f,_0x109cc9){var _0x1c643f={},_0x72c274={},_0x3cb894={'count':0x0,'rows':[]};var _0x57b886=_[_0x05fe('0x29')](db['SquareReport']['rawAttributes'],function(_0x36c004){return{'name':_0x36c004[_0x05fe('0x2a')],'type':_0x36c004[_0x05fe('0x2b')][_0x05fe('0x2c')]};});_0x72c274[_0x05fe('0x2d')]=_[_0x05fe('0x29')](_0x57b886,_0x05fe('0x26'));_0x72c274[_0x05fe('0x2e')]=_[_0x05fe('0x2f')](_0x4a844f[_0x05fe('0x2e')]);_0x72c274[_0x05fe('0x30')]=_['intersection'](_0x72c274[_0x05fe('0x2d')],_0x72c274['query']);_0x1c643f[_0x05fe('0x31')]=_[_0x05fe('0x32')](_0x72c274['model'],qs[_0x05fe('0x33')](_0x4a844f[_0x05fe('0x2e')][_0x05fe('0x33')]));_0x1c643f[_0x05fe('0x31')]=_0x1c643f[_0x05fe('0x31')][_0x05fe('0x34')]?_0x1c643f[_0x05fe('0x31')]:_0x72c274[_0x05fe('0x2d')];if(!_0x4a844f[_0x05fe('0x2e')][_0x05fe('0x35')](_0x05fe('0x36'))){_0x1c643f['limit']=qs[_0x05fe('0x37')](_0x4a844f['query']['limit']);_0x1c643f[_0x05fe('0x1c')]=qs['offset'](_0x4a844f['query'][_0x05fe('0x1c')]);}_0x1c643f[_0x05fe('0x38')]=qs[_0x05fe('0x39')](_0x4a844f[_0x05fe('0x2e')]['sort']);_0x1c643f['where']=qs[_0x05fe('0x30')](_[_0x05fe('0x3a')](_0x4a844f[_0x05fe('0x2e')],_0x72c274[_0x05fe('0x30')]),_0x57b886);if(_0x4a844f[_0x05fe('0x2e')][_0x05fe('0x3b')]){_0x1c643f[_0x05fe('0x3c')]=_['merge'](_0x1c643f['where'],{'$or':_['map'](_0x57b886,function(_0xeba99f){if(_0xeba99f[_0x05fe('0x2b')]!==_0x05fe('0x3d')){var _0x4c91e4={};_0x4c91e4[_0xeba99f[_0x05fe('0x26')]]={'$like':'%'+_0x4a844f[_0x05fe('0x2e')]['filter']+'%'};return _0x4c91e4;}})});}_0x1c643f=_[_0x05fe('0x3e')]({},_0x1c643f,_0x4a844f[_0x05fe('0x3f')]);var _0x1e8721={'where':_0x1c643f[_0x05fe('0x3c')]};return db[_0x05fe('0x40')][_0x05fe('0x1e')](_0x1e8721)[_0x05fe('0x22')](function(_0x41b3ad){_0x3cb894[_0x05fe('0x1e')]=_0x41b3ad;if(_0x4a844f[_0x05fe('0x2e')][_0x05fe('0x41')]){_0x1c643f[_0x05fe('0x42')]=[{'all':!![]}];}return db[_0x05fe('0x40')][_0x05fe('0x43')](_0x1c643f);})['then'](function(_0x3f9a6a){_0x3cb894[_0x05fe('0x44')]=_0x3f9a6a;return _0x3cb894;})[_0x05fe('0x22')](respondWithFilteredResult(_0x109cc9,_0x1c643f))[_0x05fe('0x45')](handleError(_0x109cc9,null));};exports[_0x05fe('0x46')]=function(_0x3762e8,_0x50496d){var _0x4501c2={'raw':!![],'where':{'id':_0x3762e8[_0x05fe('0x47')]['id']}},_0x406221={};_0x406221[_0x05fe('0x2d')]=_['keys'](db[_0x05fe('0x40')][_0x05fe('0x48')]);_0x406221[_0x05fe('0x2e')]=_[_0x05fe('0x2f')](_0x3762e8['query']);_0x406221[_0x05fe('0x30')]=_[_0x05fe('0x32')](_0x406221[_0x05fe('0x2d')],_0x406221[_0x05fe('0x2e')]);_0x4501c2[_0x05fe('0x31')]=_[_0x05fe('0x32')](_0x406221[_0x05fe('0x2d')],qs[_0x05fe('0x33')](_0x3762e8['query'][_0x05fe('0x33')]));_0x4501c2[_0x05fe('0x31')]=_0x4501c2[_0x05fe('0x31')][_0x05fe('0x34')]?_0x4501c2[_0x05fe('0x31')]:_0x406221[_0x05fe('0x2d')];if(_0x3762e8['query'][_0x05fe('0x41')]){_0x4501c2[_0x05fe('0x42')]=[{'all':!![]}];}_0x4501c2=_['merge']({},_0x4501c2,_0x3762e8['options']);return db[_0x05fe('0x40')][_0x05fe('0x49')](_0x4501c2)[_0x05fe('0x22')](handleEntityNotFound(_0x50496d,null))[_0x05fe('0x22')](respondWithResult(_0x50496d,null))[_0x05fe('0x45')](handleError(_0x50496d,null));};exports[_0x05fe('0x4a')]=function(_0xa783de,_0x3d0b23){return db[_0x05fe('0x40')]['create'](_0xa783de[_0x05fe('0x4b')],{})[_0x05fe('0x22')](respondWithResult(_0x3d0b23,0xc9))[_0x05fe('0x45')](handleError(_0x3d0b23,null));};exports['update']=function(_0x1a0fc3,_0x10f4d3){if(_0x1a0fc3[_0x05fe('0x4b')]['id']){delete _0x1a0fc3[_0x05fe('0x4b')]['id'];}return db[_0x05fe('0x40')]['find']({'where':{'id':_0x1a0fc3[_0x05fe('0x47')]['id']}})['then'](handleEntityNotFound(_0x10f4d3,null))[_0x05fe('0x22')](saveUpdates(_0x1a0fc3[_0x05fe('0x4b')],null))[_0x05fe('0x22')](respondWithResult(_0x10f4d3,null))[_0x05fe('0x45')](handleError(_0x10f4d3,null));};exports[_0x05fe('0x23')]=function(_0x2294c8,_0x469b3a){return db[_0x05fe('0x40')][_0x05fe('0x49')]({'where':{'id':_0x2294c8[_0x05fe('0x47')]['id']}})[_0x05fe('0x22')](handleEntityNotFound(_0x469b3a,null))['then'](removeEntity(_0x469b3a,null))['catch'](handleError(_0x469b3a,null));};exports[_0x05fe('0x4c')]=function(_0x3dc6f4,_0x2bc877){return db[_0x05fe('0x40')][_0x05fe('0x4c')]()['then'](respondWithResult(_0x2bc877,null))[_0x05fe('0x45')](handleError(_0x2bc877,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 0ab31bf..0e2e89c 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 _0x109e=['leaveAt','lodash','util','moment','bluebird','path','../../config/environment','exports','define','uid_pname','uniqueid','project_name'];(function(_0x45c61e,_0x59694d){var _0x19033c=function(_0x19fc2b){while(--_0x19fc2b){_0x45c61e['push'](_0x45c61e['shift']());}};_0x19033c(++_0x59694d);}(_0x109e,0x121));var _0xe109=function(_0x26ea61,_0x1b983c){_0x26ea61=_0x26ea61-0x0;var _0x1b89c4=_0x109e[_0x26ea61];return _0x1b89c4;};'use strict';var _=require(_0xe109('0x0'));var util=require(_0xe109('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe109('0x2'));var BPromise=require(_0xe109('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe109('0x4'));var rimraf=require('rimraf');var config=require(_0xe109('0x5'));var attributes=require('./squareReport.attributes');module[_0xe109('0x6')]=function(_0xdbf69c,_0x2c9f3e){return _0xdbf69c[_0xe109('0x7')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xe109('0x8'),'fields':[_0xe109('0x9'),_0xe109('0xa')]},{'name':'leaveAt','fields':[_0xe109('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ba0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','util','../../config/logger','api'];(function(_0x4e34ec,_0x1967f0){var _0x315eec=function(_0x47d1f2){while(--_0x47d1f2){_0x4e34ec['push'](_0x4e34ec['shift']());}};_0x315eec(++_0x1967f0);}(_0x2ba0,0x1d0));var _0x02ba=function(_0x40ed50,_0x5a60a5){_0x40ed50=_0x40ed50-0x0;var _0x317ec6=_0x2ba0[_0x40ed50];return _0x317ec6;};'use strict';var _=require(_0x02ba('0x0'));var util=require(_0x02ba('0x1'));var logger=require(_0x02ba('0x2'))(_0x02ba('0x3'));var moment=require(_0x02ba('0x4'));var BPromise=require(_0x02ba('0x5'));var rp=require(_0x02ba('0x6'));var fs=require('fs');var path=require(_0x02ba('0x7'));var rimraf=require(_0x02ba('0x8'));var config=require(_0x02ba('0x9'));var attributes=require(_0x02ba('0xa'));module[_0x02ba('0xb')]=function(_0x4e2a6f,_0x2bdd0a){return _0x4e2a6f[_0x02ba('0xc')](_0x02ba('0xd'),attributes,{'tableName':_0x02ba('0xe'),'paranoid':![],'indexes':[{'name':_0x02ba('0xf'),'fields':['uniqueid',_0x02ba('0x10')]},{'name':'leaveAt','fields':[_0x02ba('0x11')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index a26c23c..6a2b46c 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 _0x559d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareReport','SquareReport','create','body','options','raw','catch','UpdateSquareReport','update','where','attributes','limit','then'];(function(_0x130667,_0x444ae8){var _0x389d0d=function(_0x541b32){while(--_0x541b32){_0x130667['push'](_0x130667['shift']());}};_0x389d0d(++_0x444ae8);}(_0x559d,0x108));var _0xd559=function(_0x10bcb7,_0x518c99){_0x10bcb7=_0x10bcb7-0x0;var _0x3c1b3b=_0x559d[_0x10bcb7];return _0x3c1b3b;};'use strict';var _=require('lodash');var util=require(_0xd559('0x0'));var moment=require(_0xd559('0x1'));var BPromise=require(_0xd559('0x2'));var rs=require(_0xd559('0x3'));var fs=require('fs');var Redis=require(_0xd559('0x4'));var db=require(_0xd559('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd559('0x6'))(_0xd559('0x7'));var config=require(_0xd559('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd559('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x488fe5,_0x26949d,_0x501a9a){return new BPromise(function(_0x2856d6,_0x32faae){return client[_0xd559('0xa')](_0x488fe5,_0x501a9a)['then'](function(_0x142948){logger[_0xd559('0xb')](_0xd559('0xc'),_0x26949d,_0xd559('0xd'));logger[_0xd559('0xe')](_0xd559('0xf'),_0x26949d,_0xd559('0xd'),JSON[_0xd559('0x10')](_0x142948));if(_0x142948[_0xd559('0x11')]){if(_0x142948[_0xd559('0x11')][_0xd559('0x12')]===0x1f4){logger[_0xd559('0x11')]('SquareReport,\x20%s,\x20%s',_0x26949d,_0x142948[_0xd559('0x11')][_0xd559('0x13')]);return _0x32faae(_0x142948[_0xd559('0x11')][_0xd559('0x13')]);}logger['error'](_0xd559('0xc'),_0x26949d,_0x142948[_0xd559('0x11')]['message']);return _0x2856d6(_0x142948['error'][_0xd559('0x13')]);}else{logger[_0xd559('0xb')](_0xd559('0xc'),_0x26949d,_0xd559('0xd'));_0x2856d6(_0x142948['result']['message']);}})['catch'](function(_0x43fc3a){logger[_0xd559('0x11')](_0xd559('0xc'),_0x26949d,_0x43fc3a);_0x32faae(_0x43fc3a);});});}exports[_0xd559('0x14')]=function(_0x874769){var _0x265afd=this;return new Promise(function(_0x4aa929,_0x155fb2){return db[_0xd559('0x15')][_0xd559('0x16')](_0x874769[_0xd559('0x17')],{'raw':_0x874769[_0xd559('0x18')]?_0x874769[_0xd559('0x18')][_0xd559('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3af2ee){logger[_0xd559('0xb')](_0xd559('0x14'),_0x874769);logger[_0xd559('0xe')](_0xd559('0x14'),_0x874769,JSON[_0xd559('0x10')](_0x3af2ee));_0x4aa929(_0x3af2ee);})[_0xd559('0x1a')](function(_0x103c19){logger[_0xd559('0x11')](_0xd559('0x14'),_0x103c19[_0xd559('0x13')],_0x874769);_0x155fb2(_0x265afd[_0xd559('0x11')](0x1f4,_0x103c19['message']));});});};exports[_0xd559('0x1b')]=function(_0x132ddb){var _0x4fff16=this;return new Promise(function(_0x59c012,_0xb7c984){return db[_0xd559('0x15')][_0xd559('0x1c')](_0x132ddb[_0xd559('0x17')],{'raw':_0x132ddb[_0xd559('0x18')]?_0x132ddb[_0xd559('0x18')][_0xd559('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x132ddb[_0xd559('0x18')]?_0x132ddb[_0xd559('0x18')][_0xd559('0x1d')]||null:null,'attributes':_0x132ddb['options']?_0x132ddb['options'][_0xd559('0x1e')]||null:null,'limit':_0x132ddb[_0xd559('0x18')]?_0x132ddb[_0xd559('0x18')][_0xd559('0x1f')]||null:null})[_0xd559('0x20')](function(_0x1b1f7a){logger[_0xd559('0xb')](_0xd559('0x1b'),_0x132ddb);logger[_0xd559('0xe')](_0xd559('0x1b'),_0x132ddb,JSON[_0xd559('0x10')](_0x1b1f7a));_0x59c012(_0x1b1f7a);})[_0xd559('0x1a')](function(_0x1dc7dc){logger[_0xd559('0x11')](_0xd559('0x1b'),_0x1dc7dc[_0xd559('0x13')],_0x132ddb);_0xb7c984(_0x4fff16[_0xd559('0x11')](0x1f4,_0x1dc7dc['message']));});});}; \ No newline at end of file +var _0xd8fc=['rpc','jayson/promise','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','then','UpdateSquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x33ebf5,_0x258ec6){var _0x66957b=function(_0x49739a){while(--_0x49739a){_0x33ebf5['push'](_0x33ebf5['shift']());}};_0x66957b(++_0x258ec6);}(_0xd8fc,0x13a));var _0xcd8f=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xd8fc[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0xcd8f('0x0'));var util=require(_0xcd8f('0x1'));var moment=require(_0xcd8f('0x2'));var BPromise=require(_0xcd8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd8f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd8f('0x5'))(_0xcd8f('0x6'));var config=require('../../config/environment');var jayson=require(_0xcd8f('0x7'));var client=jayson['client'][_0xcd8f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16df72,_0x138d8c,_0x33f6b5){return new BPromise(function(_0x5be213,_0x22fc92){return client[_0xcd8f('0x9')](_0x16df72,_0x33f6b5)['then'](function(_0x2dce3d){logger[_0xcd8f('0xa')](_0xcd8f('0xb'),_0x138d8c,_0xcd8f('0xc'));logger[_0xcd8f('0xd')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x138d8c,_0xcd8f('0xc'),JSON[_0xcd8f('0xe')](_0x2dce3d));if(_0x2dce3d[_0xcd8f('0xf')]){if(_0x2dce3d['error'][_0xcd8f('0x10')]===0x1f4){logger[_0xcd8f('0xf')]('SquareReport,\x20%s,\x20%s',_0x138d8c,_0x2dce3d[_0xcd8f('0xf')][_0xcd8f('0x11')]);return _0x22fc92(_0x2dce3d['error'][_0xcd8f('0x11')]);}logger['error'](_0xcd8f('0xb'),_0x138d8c,_0x2dce3d[_0xcd8f('0xf')][_0xcd8f('0x11')]);return _0x5be213(_0x2dce3d[_0xcd8f('0xf')][_0xcd8f('0x11')]);}else{logger[_0xcd8f('0xa')](_0xcd8f('0xb'),_0x138d8c,_0xcd8f('0xc'));_0x5be213(_0x2dce3d[_0xcd8f('0x12')][_0xcd8f('0x11')]);}})[_0xcd8f('0x13')](function(_0x225117){logger['error'](_0xcd8f('0xb'),_0x138d8c,_0x225117);_0x22fc92(_0x225117);});});}exports[_0xcd8f('0x14')]=function(_0x413a57){var _0x5f57ea=this;return new Promise(function(_0xefd3a4,_0x15e928){return db[_0xcd8f('0x15')][_0xcd8f('0x16')](_0x413a57[_0xcd8f('0x17')],{'raw':_0x413a57[_0xcd8f('0x18')]?_0x413a57[_0xcd8f('0x18')][_0xcd8f('0x19')]===undefined?!![]:![]:!![]})[_0xcd8f('0x1a')](function(_0x13afc9){logger[_0xcd8f('0xa')]('CreateSquareReport',_0x413a57);logger[_0xcd8f('0xd')](_0xcd8f('0x14'),_0x413a57,JSON['stringify'](_0x13afc9));_0xefd3a4(_0x13afc9);})[_0xcd8f('0x13')](function(_0x56bafa){logger[_0xcd8f('0xf')](_0xcd8f('0x14'),_0x56bafa[_0xcd8f('0x11')],_0x413a57);_0x15e928(_0x5f57ea[_0xcd8f('0xf')](0x1f4,_0x56bafa[_0xcd8f('0x11')]));});});};exports[_0xcd8f('0x1b')]=function(_0xafebc4){var _0x1ed2bd=this;return new Promise(function(_0x11a541,_0x79ffe6){return db[_0xcd8f('0x15')][_0xcd8f('0x1c')](_0xafebc4[_0xcd8f('0x17')],{'raw':_0xafebc4[_0xcd8f('0x18')]?_0xafebc4['options'][_0xcd8f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xafebc4['options']?_0xafebc4['options'][_0xcd8f('0x1d')]||null:null,'attributes':_0xafebc4[_0xcd8f('0x18')]?_0xafebc4[_0xcd8f('0x18')][_0xcd8f('0x1e')]||null:null,'limit':_0xafebc4[_0xcd8f('0x18')]?_0xafebc4[_0xcd8f('0x18')][_0xcd8f('0x1f')]||null:null})[_0xcd8f('0x1a')](function(_0x2a848d){logger[_0xcd8f('0xa')](_0xcd8f('0x1b'),_0xafebc4);logger[_0xcd8f('0xd')](_0xcd8f('0x1b'),_0xafebc4,JSON['stringify'](_0x2a848d));_0x11a541(_0x2a848d);})['catch'](function(_0x116648){logger[_0xcd8f('0xf')]('UpdateSquareReport',_0x116648[_0xcd8f('0x11')],_0xafebc4);_0x79ffe6(_0x1ed2bd['error'](0x1f4,_0x116648[_0xcd8f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 16d1145..99d083b 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 _0x6630=['../../config/environment','./squareReportDetail.controller','isAuthenticated','get','/describe','describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x50352a,_0x3cf37e){var _0x4e1204=function(_0x242759){while(--_0x242759){_0x50352a['push'](_0x50352a['shift']());}};_0x4e1204(++_0x3cf37e);}(_0x6630,0xb5));var _0x0663=function(_0x373d13,_0xbbf7ad){_0x373d13=_0x373d13-0x0;var _0x3ffd36=_0x6630[_0x373d13];return _0x3ffd36;};'use strict';var multer=require(_0x0663('0x0'));var util=require(_0x0663('0x1'));var path=require(_0x0663('0x2'));var timeout=require(_0x0663('0x3'));var express=require(_0x0663('0x4'));var router=express['Router']();var fs_extra=require(_0x0663('0x5'));var auth=require(_0x0663('0x6'));var interaction=require(_0x0663('0x7'));var config=require(_0x0663('0x8'));var controller=require(_0x0663('0x9'));router['get']('/',auth[_0x0663('0xa')](),controller['index']);router[_0x0663('0xb')](_0x0663('0xc'),auth[_0x0663('0xa')](),controller[_0x0663('0xd')]);router[_0x0663('0xb')](_0x0663('0xe'),auth[_0x0663('0xa')](),controller['show']);router[_0x0663('0xf')]('/',auth[_0x0663('0xa')](),controller['create']);router[_0x0663('0x10')](_0x0663('0xe'),auth[_0x0663('0xa')](),controller[_0x0663('0x11')]);router[_0x0663('0x12')](_0x0663('0xe'),auth['isAuthenticated'](),controller[_0x0663('0x13')]);module[_0x0663('0x14')]=router; \ No newline at end of file +var _0xdb40=['multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','index','isAuthenticated','describe','/:id','show','post','delete','destroy','exports'];(function(_0x3398a6,_0x4cacfc){var _0x4e2459=function(_0x4c1f35){while(--_0x4c1f35){_0x3398a6['push'](_0x3398a6['shift']());}};_0x4e2459(++_0x4cacfc);}(_0xdb40,0xd8));var _0x0db4=function(_0x37f811,_0x523ccf){_0x37f811=_0x37f811-0x0;var _0x472653=_0xdb40[_0x37f811];return _0x472653;};'use strict';var multer=require(_0x0db4('0x0'));var util=require('util');var path=require(_0x0db4('0x1'));var timeout=require(_0x0db4('0x2'));var express=require(_0x0db4('0x3'));var router=express[_0x0db4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0db4('0x5'));var config=require(_0x0db4('0x6'));var controller=require(_0x0db4('0x7'));router[_0x0db4('0x8')]('/',auth['isAuthenticated'](),controller[_0x0db4('0x9')]);router[_0x0db4('0x8')]('/describe',auth[_0x0db4('0xa')](),controller[_0x0db4('0xb')]);router[_0x0db4('0x8')](_0x0db4('0xc'),auth[_0x0db4('0xa')](),controller[_0x0db4('0xd')]);router[_0x0db4('0xe')]('/',auth[_0x0db4('0xa')](),controller['create']);router['put'](_0x0db4('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x0db4('0xf')](_0x0db4('0xc'),auth[_0x0db4('0xa')](),controller[_0x0db4('0x10')]);module[_0x0db4('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index f5f5e69..1de56a9 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 _0xed43=['STRING','sequelize','exports'];(function(_0x3186aa,_0x34c21e){var _0x2d8c36=function(_0x239e99){while(--_0x239e99){_0x3186aa['push'](_0x3186aa['shift']());}};_0x2d8c36(++_0x34c21e);}(_0xed43,0x13f));var _0x3ed4=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0xed43[_0x19d24c];return _0x2fae8d;};'use strict';var Sequelize=require(_0x3ed4('0x0'));module[_0x3ed4('0x1')]={'uniqueid':{'type':Sequelize[_0x3ed4('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x3ed4('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x3ed4('0x2')]},'callerid':{'type':Sequelize[_0x3ed4('0x2')]}}; \ No newline at end of file +var _0x0cbb=['TEXT','sequelize','exports','STRING'];(function(_0x197c9e,_0x2804e2){var _0x4966d4=function(_0x2e3770){while(--_0x2e3770){_0x197c9e['push'](_0x197c9e['shift']());}};_0x4966d4(++_0x2804e2);}(_0x0cbb,0xf9));var _0xb0cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cbb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb0cb('0x0'));module[_0xb0cb('0x1')]={'uniqueid':{'type':Sequelize[_0xb0cb('0x2')]},'node':{'type':Sequelize[_0xb0cb('0x2')]},'application':{'type':Sequelize[_0xb0cb('0x2')]},'data':{'type':Sequelize[_0xb0cb('0x3')]},'project_name':{'type':Sequelize[_0xb0cb('0x2')]},'callerid':{'type':Sequelize[_0xb0cb('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 42f0ec1..75c43f8 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 _0x8130=['where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','filters','include','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8130,0x146));var _0x0813=function(_0x463dfd,_0x12488b){_0x463dfd=_0x463dfd-0x0;var _0x4ca1b3=_0x8130[_0x463dfd];return _0x4ca1b3;};'use strict';var emlformat=require(_0x0813('0x0'));var rimraf=require(_0x0813('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0813('0x2'));var rp=require(_0x0813('0x3'));var moment=require(_0x0813('0x4'));var BPromise=require(_0x0813('0x5'));var Mustache=require(_0x0813('0x6'));var util=require(_0x0813('0x7'));var path=require('path');var sox=require(_0x0813('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0813('0x9'));var _=require(_0x0813('0xa'));var squel=require(_0x0813('0xb'));var crypto=require(_0x0813('0xc'));var jsforce=require(_0x0813('0xd'));var deskjs=require(_0x0813('0xe'));var toCsv=require(_0x0813('0xf'));var querystring=require('querystring');var Papa=require(_0x0813('0x10'));var Redis=require(_0x0813('0x11'));var authService=require(_0x0813('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0813('0x13'));var logger=require('../../config/logger')(_0x0813('0x14'));var utils=require('../../config/utils');var config=require(_0x0813('0x15'));var licenseUtil=require(_0x0813('0x16'));var db=require(_0x0813('0x17'))['db'];function respondWithStatusCode(_0x230ec7,_0x5b17f2){_0x5b17f2=_0x5b17f2||0xcc;return function(_0x4dcc3a){if(_0x4dcc3a){return _0x230ec7[_0x0813('0x18')](_0x5b17f2);}return _0x230ec7[_0x0813('0x19')](_0x5b17f2)['end']();};}function respondWithResult(_0x403e40,_0x4dae33){_0x4dae33=_0x4dae33||0xc8;return function(_0x58e56c){if(_0x58e56c){return _0x403e40[_0x0813('0x19')](_0x4dae33)[_0x0813('0x1a')](_0x58e56c);}};}function respondWithFilteredResult(_0x4ffaad,_0x2cf4f1){return function(_0x5793cb){if(_0x5793cb){var _0x29537f=typeof _0x2cf4f1[_0x0813('0x1b')]===_0x0813('0x1c')&&typeof _0x2cf4f1[_0x0813('0x1d')]===_0x0813('0x1c');var _0x10e29a=_0x5793cb[_0x0813('0x1e')];var _0x3e15da=_0x29537f?0x0:_0x2cf4f1['offset'];var _0x3ec7b5=_0x29537f?_0x5793cb['count']:_0x2cf4f1[_0x0813('0x1b')]+_0x2cf4f1[_0x0813('0x1d')];var _0x518923;if(_0x3ec7b5>=_0x10e29a){_0x3ec7b5=_0x10e29a;_0x518923=0xc8;}else{_0x518923=0xce;}_0x4ffaad[_0x0813('0x19')](_0x518923);return _0x4ffaad[_0x0813('0x1f')]('Content-Range',_0x3e15da+'-'+_0x3ec7b5+'/'+_0x10e29a)[_0x0813('0x1a')](_0x5793cb);}return null;};}function patchUpdates(_0x334741){return function(_0x4d7680){try{jsonpatch[_0x0813('0x20')](_0x4d7680,_0x334741,!![]);}catch(_0x3b3662){return BPromise[_0x0813('0x21')](_0x3b3662);}return _0x4d7680[_0x0813('0x22')]();};}function saveUpdates(_0xf6ee0c,_0x5a6cdc){return function(_0x2bb694){if(_0x2bb694){return _0x2bb694[_0x0813('0x23')](_0xf6ee0c)[_0x0813('0x24')](function(_0x598cf2){return _0x598cf2;});}return null;};}function removeEntity(_0x35b3d6,_0x5eabe4){return function(_0x56f4b6){if(_0x56f4b6){return _0x56f4b6[_0x0813('0x25')]()['then'](function(){_0x35b3d6['status'](0xcc)[_0x0813('0x26')]();});}};}function handleEntityNotFound(_0x2366a3,_0x1a8d2a){return function(_0x2f8849){if(!_0x2f8849){_0x2366a3[_0x0813('0x18')](0x194);}return _0x2f8849;};}function handleError(_0x1418c7,_0x42627c){_0x42627c=_0x42627c||0x1f4;return function(_0x3ac129){logger['error'](_0x3ac129[_0x0813('0x27')]);if(_0x3ac129[_0x0813('0x28')]){delete _0x3ac129[_0x0813('0x28')];}_0x1418c7[_0x0813('0x19')](_0x42627c)[_0x0813('0x29')](_0x3ac129);};}exports[_0x0813('0x2a')]=function(_0x55e115,_0xa36d86){var _0x48294b={},_0x54ed64={},_0x54bf5d={'count':0x0,'rows':[]};var _0x3c3321=_[_0x0813('0x2b')](db[_0x0813('0x2c')][_0x0813('0x2d')],function(_0x21f388){return{'name':_0x21f388[_0x0813('0x2e')],'type':_0x21f388['type'][_0x0813('0x2f')]};});_0x54ed64[_0x0813('0x30')]=_['map'](_0x3c3321,'name');_0x54ed64[_0x0813('0x31')]=_[_0x0813('0x32')](_0x55e115[_0x0813('0x31')]);_0x54ed64['filters']=_[_0x0813('0x33')](_0x54ed64[_0x0813('0x30')],_0x54ed64['query']);_0x48294b['attributes']=_[_0x0813('0x33')](_0x54ed64[_0x0813('0x30')],qs[_0x0813('0x34')](_0x55e115[_0x0813('0x31')]['fields']));_0x48294b[_0x0813('0x35')]=_0x48294b[_0x0813('0x35')][_0x0813('0x36')]?_0x48294b[_0x0813('0x35')]:_0x54ed64['model'];if(!_0x55e115['query'][_0x0813('0x37')](_0x0813('0x38'))){_0x48294b[_0x0813('0x1d')]=qs['limit'](_0x55e115[_0x0813('0x31')][_0x0813('0x1d')]);_0x48294b[_0x0813('0x1b')]=qs['offset'](_0x55e115['query'][_0x0813('0x1b')]);}_0x48294b[_0x0813('0x39')]=qs[_0x0813('0x3a')](_0x55e115[_0x0813('0x31')][_0x0813('0x3a')]);_0x48294b[_0x0813('0x3b')]=qs['filters'](_[_0x0813('0x3c')](_0x55e115['query'],_0x54ed64['filters']),_0x3c3321);if(_0x55e115['query'][_0x0813('0x3d')]){_0x48294b[_0x0813('0x3b')]=_['merge'](_0x48294b['where'],{'$or':_[_0x0813('0x2b')](_0x3c3321,function(_0x36ce6d){if(_0x36ce6d[_0x0813('0x3e')]!==_0x0813('0x3f')){var _0x36f4d5={};_0x36f4d5[_0x36ce6d[_0x0813('0x28')]]={'$like':'%'+_0x55e115[_0x0813('0x31')][_0x0813('0x3d')]+'%'};return _0x36f4d5;}})});}_0x48294b=_[_0x0813('0x40')]({},_0x48294b,_0x55e115[_0x0813('0x41')]);var _0x54b271={'where':_0x48294b['where']};return db['SquareDetailsReport'][_0x0813('0x1e')](_0x54b271)[_0x0813('0x24')](function(_0x5cb01b){_0x54bf5d[_0x0813('0x1e')]=_0x5cb01b;if(_0x55e115[_0x0813('0x31')][_0x0813('0x42')]){_0x48294b['include']=[{'all':!![]}];}return db[_0x0813('0x2c')][_0x0813('0x43')](_0x48294b);})[_0x0813('0x24')](function(_0x4e94b0){_0x54bf5d[_0x0813('0x44')]=_0x4e94b0;return _0x54bf5d;})[_0x0813('0x24')](respondWithFilteredResult(_0xa36d86,_0x48294b))[_0x0813('0x45')](handleError(_0xa36d86,null));};exports['show']=function(_0x22564d,_0x38dc22){var _0x47da3b={'raw':!![],'where':{'id':_0x22564d[_0x0813('0x46')]['id']}},_0x171a5e={};_0x171a5e['model']=_[_0x0813('0x32')](db['SquareDetailsReport'][_0x0813('0x2d')]);_0x171a5e[_0x0813('0x31')]=_[_0x0813('0x32')](_0x22564d['query']);_0x171a5e[_0x0813('0x47')]=_['intersection'](_0x171a5e[_0x0813('0x30')],_0x171a5e[_0x0813('0x31')]);_0x47da3b[_0x0813('0x35')]=_[_0x0813('0x33')](_0x171a5e[_0x0813('0x30')],qs[_0x0813('0x34')](_0x22564d['query'][_0x0813('0x34')]));_0x47da3b['attributes']=_0x47da3b[_0x0813('0x35')]['length']?_0x47da3b['attributes']:_0x171a5e['model'];if(_0x22564d[_0x0813('0x31')][_0x0813('0x42')]){_0x47da3b[_0x0813('0x48')]=[{'all':!![]}];}_0x47da3b=_[_0x0813('0x40')]({},_0x47da3b,_0x22564d[_0x0813('0x41')]);return db[_0x0813('0x2c')]['find'](_0x47da3b)['then'](handleEntityNotFound(_0x38dc22,null))[_0x0813('0x24')](respondWithResult(_0x38dc22,null))[_0x0813('0x45')](handleError(_0x38dc22,null));};exports[_0x0813('0x49')]=function(_0x3fd5f9,_0xadaead){return db[_0x0813('0x2c')][_0x0813('0x49')](_0x3fd5f9[_0x0813('0x4a')],{})['then'](respondWithResult(_0xadaead,0xc9))[_0x0813('0x45')](handleError(_0xadaead,null));};exports[_0x0813('0x23')]=function(_0x42e4e4,_0x1baf77){if(_0x42e4e4[_0x0813('0x4a')]['id']){delete _0x42e4e4[_0x0813('0x4a')]['id'];}return db['SquareDetailsReport'][_0x0813('0x4b')]({'where':{'id':_0x42e4e4['params']['id']}})[_0x0813('0x24')](handleEntityNotFound(_0x1baf77,null))[_0x0813('0x24')](saveUpdates(_0x42e4e4[_0x0813('0x4a')],null))[_0x0813('0x24')](respondWithResult(_0x1baf77,null))['catch'](handleError(_0x1baf77,null));};exports[_0x0813('0x25')]=function(_0x3a93eb,_0x353e25){return db[_0x0813('0x2c')]['find']({'where':{'id':_0x3a93eb[_0x0813('0x46')]['id']}})[_0x0813('0x24')](handleEntityNotFound(_0x353e25,null))['then'](removeEntity(_0x353e25,null))['catch'](handleError(_0x353e25,null));};exports[_0x0813('0x4c')]=function(_0x30956a,_0x2846a7){return db['SquareDetailsReport']['describe']()['then'](respondWithResult(_0x2846a7,null))['catch'](handleError(_0x2846a7,null));}; \ No newline at end of file +var _0xe9a5=['count','json','reject','save','update','then','end','error','stack','send','index','map','SquareDetailsReport','rawAttributes','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','body','find','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit'];(function(_0x4040d5,_0x748833){var _0x459cee=function(_0x2e7ce5){while(--_0x2e7ce5){_0x4040d5['push'](_0x4040d5['shift']());}};_0x459cee(++_0x748833);}(_0xe9a5,0xbc));var _0x5e9a=function(_0x3d7571,_0x3c1a44){_0x3d7571=_0x3d7571-0x0;var _0x2fda33=_0xe9a5[_0x3d7571];return _0x2fda33;};'use strict';var emlformat=require(_0x5e9a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5e9a('0x1'));var rp=require(_0x5e9a('0x2'));var moment=require(_0x5e9a('0x3'));var BPromise=require(_0x5e9a('0x4'));var Mustache=require('mustache');var util=require(_0x5e9a('0x5'));var path=require(_0x5e9a('0x6'));var sox=require(_0x5e9a('0x7'));var csv=require('to-csv');var ejs=require(_0x5e9a('0x8'));var fs=require('fs');var fs_extra=require(_0x5e9a('0x9'));var _=require(_0x5e9a('0xa'));var squel=require(_0x5e9a('0xb'));var crypto=require(_0x5e9a('0xc'));var jsforce=require(_0x5e9a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5e9a('0xe'));var querystring=require(_0x5e9a('0xf'));var Papa=require(_0x5e9a('0x10'));var Redis=require(_0x5e9a('0x11'));var authService=require(_0x5e9a('0x12'));var qs=require(_0x5e9a('0x13'));var as=require(_0x5e9a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e9a('0x15'))(_0x5e9a('0x16'));var utils=require('../../config/utils');var config=require(_0x5e9a('0x17'));var licenseUtil=require(_0x5e9a('0x18'));var db=require(_0x5e9a('0x19'))['db'];function respondWithStatusCode(_0x4f00da,_0x390e8c){_0x390e8c=_0x390e8c||0xcc;return function(_0x53db87){if(_0x53db87){return _0x4f00da[_0x5e9a('0x1a')](_0x390e8c);}return _0x4f00da[_0x5e9a('0x1b')](_0x390e8c)['end']();};}function respondWithResult(_0x37120e,_0xb5f62c){_0xb5f62c=_0xb5f62c||0xc8;return function(_0x704a1f){if(_0x704a1f){return _0x37120e[_0x5e9a('0x1b')](_0xb5f62c)['json'](_0x704a1f);}};}function respondWithFilteredResult(_0x177d0a,_0x525886){return function(_0xb39922){if(_0xb39922){var _0x12144c=typeof _0x525886[_0x5e9a('0x1c')]===_0x5e9a('0x1d')&&typeof _0x525886[_0x5e9a('0x1e')]===_0x5e9a('0x1d');var _0x5750ea=_0xb39922['count'];var _0xd60f40=_0x12144c?0x0:_0x525886[_0x5e9a('0x1c')];var _0x24605f=_0x12144c?_0xb39922[_0x5e9a('0x1f')]:_0x525886[_0x5e9a('0x1c')]+_0x525886[_0x5e9a('0x1e')];var _0x5ae71c;if(_0x24605f>=_0x5750ea){_0x24605f=_0x5750ea;_0x5ae71c=0xc8;}else{_0x5ae71c=0xce;}_0x177d0a[_0x5e9a('0x1b')](_0x5ae71c);return _0x177d0a['set']('Content-Range',_0xd60f40+'-'+_0x24605f+'/'+_0x5750ea)[_0x5e9a('0x20')](_0xb39922);}return null;};}function patchUpdates(_0x5e07a3){return function(_0x1b5c09){try{jsonpatch['apply'](_0x1b5c09,_0x5e07a3,!![]);}catch(_0x102ac1){return BPromise[_0x5e9a('0x21')](_0x102ac1);}return _0x1b5c09[_0x5e9a('0x22')]();};}function saveUpdates(_0x4f2451,_0x384c04){return function(_0xcf2b77){if(_0xcf2b77){return _0xcf2b77[_0x5e9a('0x23')](_0x4f2451)[_0x5e9a('0x24')](function(_0x5eebd1){return _0x5eebd1;});}return null;};}function removeEntity(_0x52aa0f,_0x7ebe0c){return function(_0x5480fc){if(_0x5480fc){return _0x5480fc['destroy']()[_0x5e9a('0x24')](function(){_0x52aa0f[_0x5e9a('0x1b')](0xcc)[_0x5e9a('0x25')]();});}};}function handleEntityNotFound(_0x48f1b6,_0x1abcc3){return function(_0x5825ef){if(!_0x5825ef){_0x48f1b6[_0x5e9a('0x1a')](0x194);}return _0x5825ef;};}function handleError(_0x35a3c0,_0x4f0bde){_0x4f0bde=_0x4f0bde||0x1f4;return function(_0x36a3fc){logger[_0x5e9a('0x26')](_0x36a3fc[_0x5e9a('0x27')]);if(_0x36a3fc['name']){delete _0x36a3fc['name'];}_0x35a3c0['status'](_0x4f0bde)[_0x5e9a('0x28')](_0x36a3fc);};}exports[_0x5e9a('0x29')]=function(_0x4d2e9b,_0x3b0050){var _0x1199d8={},_0xd4adf4={},_0x46da27={'count':0x0,'rows':[]};var _0x4590d8=_[_0x5e9a('0x2a')](db[_0x5e9a('0x2b')][_0x5e9a('0x2c')],function(_0x167ff2){return{'name':_0x167ff2['fieldName'],'type':_0x167ff2[_0x5e9a('0x2d')]['key']};});_0xd4adf4[_0x5e9a('0x2e')]=_[_0x5e9a('0x2a')](_0x4590d8,_0x5e9a('0x2f'));_0xd4adf4[_0x5e9a('0x30')]=_[_0x5e9a('0x31')](_0x4d2e9b[_0x5e9a('0x30')]);_0xd4adf4[_0x5e9a('0x32')]=_[_0x5e9a('0x33')](_0xd4adf4[_0x5e9a('0x2e')],_0xd4adf4[_0x5e9a('0x30')]);_0x1199d8[_0x5e9a('0x34')]=_[_0x5e9a('0x33')](_0xd4adf4[_0x5e9a('0x2e')],qs[_0x5e9a('0x35')](_0x4d2e9b['query']['fields']));_0x1199d8[_0x5e9a('0x34')]=_0x1199d8['attributes'][_0x5e9a('0x36')]?_0x1199d8['attributes']:_0xd4adf4['model'];if(!_0x4d2e9b[_0x5e9a('0x30')][_0x5e9a('0x37')](_0x5e9a('0x38'))){_0x1199d8[_0x5e9a('0x1e')]=qs[_0x5e9a('0x1e')](_0x4d2e9b[_0x5e9a('0x30')][_0x5e9a('0x1e')]);_0x1199d8[_0x5e9a('0x1c')]=qs[_0x5e9a('0x1c')](_0x4d2e9b['query'][_0x5e9a('0x1c')]);}_0x1199d8[_0x5e9a('0x39')]=qs['sort'](_0x4d2e9b[_0x5e9a('0x30')][_0x5e9a('0x3a')]);_0x1199d8[_0x5e9a('0x3b')]=qs[_0x5e9a('0x32')](_['pick'](_0x4d2e9b[_0x5e9a('0x30')],_0xd4adf4['filters']),_0x4590d8);if(_0x4d2e9b['query'][_0x5e9a('0x3c')]){_0x1199d8[_0x5e9a('0x3b')]=_[_0x5e9a('0x3d')](_0x1199d8[_0x5e9a('0x3b')],{'$or':_['map'](_0x4590d8,function(_0x181731){if(_0x181731['type']!==_0x5e9a('0x3e')){var _0x1fd9d3={};_0x1fd9d3[_0x181731['name']]={'$like':'%'+_0x4d2e9b[_0x5e9a('0x30')][_0x5e9a('0x3c')]+'%'};return _0x1fd9d3;}})});}_0x1199d8=_[_0x5e9a('0x3d')]({},_0x1199d8,_0x4d2e9b[_0x5e9a('0x3f')]);var _0x330f8b={'where':_0x1199d8[_0x5e9a('0x3b')]};return db[_0x5e9a('0x2b')][_0x5e9a('0x1f')](_0x330f8b)[_0x5e9a('0x24')](function(_0x965528){_0x46da27[_0x5e9a('0x1f')]=_0x965528;if(_0x4d2e9b[_0x5e9a('0x30')]['includeAll']){_0x1199d8[_0x5e9a('0x40')]=[{'all':!![]}];}return db[_0x5e9a('0x2b')][_0x5e9a('0x41')](_0x1199d8);})[_0x5e9a('0x24')](function(_0x3ea90c){_0x46da27['rows']=_0x3ea90c;return _0x46da27;})[_0x5e9a('0x24')](respondWithFilteredResult(_0x3b0050,_0x1199d8))[_0x5e9a('0x42')](handleError(_0x3b0050,null));};exports[_0x5e9a('0x43')]=function(_0x2e54e5,_0x129e3e){var _0x8ae2b7={'raw':!![],'where':{'id':_0x2e54e5[_0x5e9a('0x44')]['id']}},_0x1cde29={};_0x1cde29[_0x5e9a('0x2e')]=_[_0x5e9a('0x31')](db[_0x5e9a('0x2b')][_0x5e9a('0x2c')]);_0x1cde29['query']=_[_0x5e9a('0x31')](_0x2e54e5[_0x5e9a('0x30')]);_0x1cde29[_0x5e9a('0x32')]=_[_0x5e9a('0x33')](_0x1cde29[_0x5e9a('0x2e')],_0x1cde29[_0x5e9a('0x30')]);_0x8ae2b7[_0x5e9a('0x34')]=_[_0x5e9a('0x33')](_0x1cde29[_0x5e9a('0x2e')],qs[_0x5e9a('0x35')](_0x2e54e5[_0x5e9a('0x30')][_0x5e9a('0x35')]));_0x8ae2b7[_0x5e9a('0x34')]=_0x8ae2b7['attributes'][_0x5e9a('0x36')]?_0x8ae2b7[_0x5e9a('0x34')]:_0x1cde29[_0x5e9a('0x2e')];if(_0x2e54e5['query'][_0x5e9a('0x45')]){_0x8ae2b7['include']=[{'all':!![]}];}_0x8ae2b7=_[_0x5e9a('0x3d')]({},_0x8ae2b7,_0x2e54e5['options']);return db[_0x5e9a('0x2b')]['find'](_0x8ae2b7)[_0x5e9a('0x24')](handleEntityNotFound(_0x129e3e,null))[_0x5e9a('0x24')](respondWithResult(_0x129e3e,null))[_0x5e9a('0x42')](handleError(_0x129e3e,null));};exports['create']=function(_0x3c8cad,_0x33a596){return db[_0x5e9a('0x2b')]['create'](_0x3c8cad[_0x5e9a('0x46')],{})[_0x5e9a('0x24')](respondWithResult(_0x33a596,0xc9))[_0x5e9a('0x42')](handleError(_0x33a596,null));};exports[_0x5e9a('0x23')]=function(_0x1daeb1,_0x5ec0ec){if(_0x1daeb1['body']['id']){delete _0x1daeb1[_0x5e9a('0x46')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x1daeb1['params']['id']}})[_0x5e9a('0x24')](handleEntityNotFound(_0x5ec0ec,null))[_0x5e9a('0x24')](saveUpdates(_0x1daeb1[_0x5e9a('0x46')],null))['then'](respondWithResult(_0x5ec0ec,null))[_0x5e9a('0x42')](handleError(_0x5ec0ec,null));};exports['destroy']=function(_0x5e0c8c,_0x63542e){return db['SquareDetailsReport'][_0x5e9a('0x47')]({'where':{'id':_0x5e0c8c['params']['id']}})[_0x5e9a('0x24')](handleEntityNotFound(_0x63542e,null))[_0x5e9a('0x24')](removeEntity(_0x63542e,null))[_0x5e9a('0x42')](handleError(_0x63542e,null));};exports[_0x5e9a('0x48')]=function(_0x4c3165,_0x3f5375){return db[_0x5e9a('0x2b')][_0x5e9a('0x48')]()[_0x5e9a('0x24')](respondWithResult(_0x3f5375,null))['catch'](handleError(_0x3f5375,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index e6d9094..6567545 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 _0x5725=['exports','define','util','../../config/logger','api','moment','request-promise','../../config/environment','./squareReportDetail.attributes'];(function(_0x13b103,_0x45ad6b){var _0x1b0436=function(_0x574652){while(--_0x574652){_0x13b103['push'](_0x13b103['shift']());}};_0x1b0436(++_0x45ad6b);}(_0x5725,0x18e));var _0x5572=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5725[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x5572('0x0'));var logger=require(_0x5572('0x1'))(_0x5572('0x2'));var moment=require(_0x5572('0x3'));var BPromise=require('bluebird');var rp=require(_0x5572('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5572('0x5'));var attributes=require(_0x5572('0x6'));module[_0x5572('0x7')]=function(_0x922afe,_0x4244d6){return _0x922afe[_0x5572('0x8')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedf8=['../../config/environment','define','SquareDetailsReport','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x5a658d,_0x1e2c04){var _0x23d493=function(_0x18dc9f){while(--_0x18dc9f){_0x5a658d['push'](_0x5a658d['shift']());}};_0x23d493(++_0x1e2c04);}(_0xedf8,0x175));var _0x8edf=function(_0x2d5882,_0x3be122){_0x2d5882=_0x2d5882-0x0;var _0x25495f=_0xedf8[_0x2d5882];return _0x25495f;};'use strict';var _=require(_0x8edf('0x0'));var util=require(_0x8edf('0x1'));var logger=require('../../config/logger')(_0x8edf('0x2'));var moment=require(_0x8edf('0x3'));var BPromise=require(_0x8edf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8edf('0x5'));var rimraf=require(_0x8edf('0x6'));var config=require(_0x8edf('0x7'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0xc0b5b5,_0x2a4a30){return _0xc0b5b5[_0x8edf('0x8')](_0x8edf('0x9'),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 7a6ebd6..591eda6 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 _0x51c5=['options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','stringify','error','code','message','SquareDetailsReport,\x20%s,\x20%s','info','catch','CreateSquareDetailsReport','create'];(function(_0x2ceb9c,_0x107a89){var _0x696c6b=function(_0x2f5525){while(--_0x2f5525){_0x2ceb9c['push'](_0x2ceb9c['shift']());}};_0x696c6b(++_0x107a89);}(_0x51c5,0x8f));var _0x551c=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x51c5[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var moment=require(_0x551c('0x2'));var BPromise=require(_0x551c('0x3'));var rs=require(_0x551c('0x4'));var fs=require('fs');var Redis=require(_0x551c('0x5'));var db=require(_0x551c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x551c('0x7'))(_0x551c('0x8'));var config=require(_0x551c('0x9'));var jayson=require(_0x551c('0xa'));var client=jayson[_0x551c('0xb')][_0x551c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21dfa1,_0x196955,_0x4f3a0a){return new BPromise(function(_0x414edb,_0x15f4f8){return client[_0x551c('0xd')](_0x21dfa1,_0x4f3a0a)['then'](function(_0x17683c){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x196955,'request\x20sent');logger[_0x551c('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x196955,_0x551c('0xf'),JSON[_0x551c('0x10')](_0x17683c));if(_0x17683c[_0x551c('0x11')]){if(_0x17683c[_0x551c('0x11')][_0x551c('0x12')]===0x1f4){logger[_0x551c('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x196955,_0x17683c[_0x551c('0x11')][_0x551c('0x13')]);return _0x15f4f8(_0x17683c[_0x551c('0x11')]['message']);}logger[_0x551c('0x11')](_0x551c('0x14'),_0x196955,_0x17683c['error'][_0x551c('0x13')]);return _0x414edb(_0x17683c['error'][_0x551c('0x13')]);}else{logger[_0x551c('0x15')](_0x551c('0x14'),_0x196955,_0x551c('0xf'));_0x414edb(_0x17683c['result']['message']);}})[_0x551c('0x16')](function(_0xcdf011){logger['error'](_0x551c('0x14'),_0x196955,_0xcdf011);_0x15f4f8(_0xcdf011);});});}exports[_0x551c('0x17')]=function(_0x274432){var _0x2a0b55=this;return new Promise(function(_0x4c8dba,_0x4fcaf3){return db['SquareDetailsReport'][_0x551c('0x18')](_0x274432['body'],{'raw':_0x274432['options']?_0x274432[_0x551c('0x19')][_0x551c('0x1a')]===undefined?!![]:![]:!![]})[_0x551c('0x1b')](function(_0x1927e7){logger[_0x551c('0x15')](_0x551c('0x17'),_0x274432);logger['debug']('CreateSquareDetailsReport',_0x274432,JSON[_0x551c('0x10')](_0x1927e7));_0x4c8dba(_0x1927e7);})['catch'](function(_0x330160){logger[_0x551c('0x11')](_0x551c('0x17'),_0x330160[_0x551c('0x13')],_0x274432);_0x4fcaf3(_0x2a0b55[_0x551c('0x11')](0x1f4,_0x330160['message']));});});}; \ No newline at end of file +var _0xcf66=['body','options','raw','info','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport'];(function(_0x6539dc,_0x5c28f9){var _0x199380=function(_0x546e4a){while(--_0x546e4a){_0x6539dc['push'](_0x6539dc['shift']());}};_0x199380(++_0x5c28f9);}(_0xcf66,0x71));var _0x6cf6=function(_0x5685c0,_0x2c5e6e){_0x5685c0=_0x5685c0-0x0;var _0x3e0c7b=_0xcf66[_0x5685c0];return _0x3e0c7b;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb082,_0x94c6a9,_0x308d0d){return new BPromise(function(_0x36b892,_0x748c93){return client[_0x6cf6('0xa')](_0x5eb082,_0x308d0d)[_0x6cf6('0xb')](function(_0x5b3827){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x94c6a9,_0x6cf6('0xc'));logger['debug'](_0x6cf6('0xd'),_0x94c6a9,_0x6cf6('0xc'),JSON[_0x6cf6('0xe')](_0x5b3827));if(_0x5b3827[_0x6cf6('0xf')]){if(_0x5b3827['error']['code']===0x1f4){logger['error'](_0x6cf6('0x10'),_0x94c6a9,_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);return _0x748c93(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}logger[_0x6cf6('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x94c6a9,_0x5b3827[_0x6cf6('0xf')]['message']);return _0x36b892(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}else{logger['info'](_0x6cf6('0x10'),_0x94c6a9,_0x6cf6('0xc'));_0x36b892(_0x5b3827[_0x6cf6('0x12')][_0x6cf6('0x11')]);}})[_0x6cf6('0x13')](function(_0x2bdb12){logger[_0x6cf6('0xf')](_0x6cf6('0x10'),_0x94c6a9,_0x2bdb12);_0x748c93(_0x2bdb12);});});}exports[_0x6cf6('0x14')]=function(_0x2ca2b1){var _0x5e8b11=this;return new Promise(function(_0x11d994,_0x22915c){return db[_0x6cf6('0x15')]['create'](_0x2ca2b1[_0x6cf6('0x16')],{'raw':_0x2ca2b1[_0x6cf6('0x17')]?_0x2ca2b1[_0x6cf6('0x17')][_0x6cf6('0x18')]===undefined?!![]:![]:!![]})[_0x6cf6('0xb')](function(_0x21e903){logger[_0x6cf6('0x19')]('CreateSquareDetailsReport',_0x2ca2b1);logger[_0x6cf6('0x1a')](_0x6cf6('0x14'),_0x2ca2b1,JSON[_0x6cf6('0xe')](_0x21e903));_0x11d994(_0x21e903);})[_0x6cf6('0x13')](function(_0x5cba3a){logger[_0x6cf6('0xf')](_0x6cf6('0x14'),_0x5cba3a[_0x6cf6('0x11')],_0x2ca2b1);_0x22915c(_0x5e8b11['error'](0x1f4,_0x5cba3a['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 621f286..496f422 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 _0x716c=['killProcess','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index'];(function(_0x1d5c65,_0x81e95c){var _0x38a8bf=function(_0x29f1e2){while(--_0x29f1e2){_0x1d5c65['push'](_0x1d5c65['shift']());}};_0x38a8bf(++_0x81e95c);}(_0x716c,0x1d1));var _0xc716=function(_0xcd9e09,_0x4817fb){_0xcd9e09=_0xcd9e09-0x0;var _0x587429=_0x716c[_0xcd9e09];return _0x587429;};'use strict';var express=require(_0xc716('0x0'));var router=express[_0xc716('0x1')]();var auth=require(_0xc716('0x2'));var controller=require(_0xc716('0x3'));router[_0xc716('0x4')]('/',auth[_0xc716('0x5')](),controller[_0xc716('0x6')]);router[_0xc716('0x4')]('/process/:pid/kill',auth[_0xc716('0x5')](),controller[_0xc716('0x7')]);module['exports']=router; \ No newline at end of file +var _0x575e=['./system.controller','index','get','isAuthenticated','killProcess','express','Router','../../components/auth/service'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x575e,0x1d5));var _0xe575=function(_0x2fc69b,_0x55537d){_0x2fc69b=_0x2fc69b-0x0;var _0x25e3c9=_0x575e[_0x2fc69b];return _0x25e3c9;};'use strict';var express=require(_0xe575('0x0'));var router=express[_0xe575('0x1')]();var auth=require(_0xe575('0x2'));var controller=require(_0xe575('0x3'));router['get']('/',auth['isAuthenticated'](),controller[_0xe575('0x4')]);router[_0xe575('0x5')]('/process/:pid/kill',auth[_0xe575('0x6')](),controller[_0xe575('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index c2c4dbc..5bf06bc 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 _0x528d=['<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','api','util','bluebird','lodash'];(function(_0x4c3a36,_0xdba60f){var _0x40f945=function(_0x4efdb2){while(--_0x4efdb2){_0x4c3a36['push'](_0x4c3a36['shift']());}};_0x40f945(++_0xdba60f);}(_0x528d,0xf6));var _0xd528=function(_0x5ce4e8,_0x1cf7ee){_0x5ce4e8=_0x5ce4e8-0x0;var _0x3edc5b=_0x528d[_0x5ce4e8];return _0x3edc5b;};'use strict';var info=require(_0xd528('0x0'));var exec=require(_0xd528('0x1'))['exec'];var logger=require('../../config/logger')(_0xd528('0x2'));var util=require(_0xd528('0x3'));var BPromise=require(_0xd528('0x4'));var _=require(_0xd528('0x5'));function handleError(_0x468f02,_0x28d751,_0x584062){_0x28d751=_0x28d751||0x1f4;return function(_0x2bd8e0){logger['error'](_0xd528('0x6'),_0x584062,_0x28d751,util[_0xd528('0x7')](_0x2bd8e0,{'showHidden':![],'depth':null}));delete _0x2bd8e0[_0xd528('0x8')];_0x468f02[_0xd528('0x9')](_0x28d751)[_0xd528('0xa')](_0x2bd8e0);};}exports[_0xd528('0xb')]=function(_0x909f76,_0xd19d86){return info[_0xd528('0xc')]()['then'](function(_0x339381){return _0xd19d86[_0xd528('0x9')](0xc8)[_0xd528('0xd')](_0x339381);})[_0xd528('0xe')](function(_0x47a1f5){return _0xd19d86[_0xd528('0x9')](0x1f4)[_0xd528('0xd')](_0x47a1f5);});};exports[_0xd528('0xf')]=function(_0x1ffa01,_0x3a5b42){var _0x1f4a8a=[_0xd528('0x10')];return new BPromise(function(_0x49f4c1,_0x3ee671){return exec(util['format'](_0xd528('0x11'),_0x1ffa01[_0xd528('0x12')][_0xd528('0x13')]),function(_0x1f5e53,_0xcc8f83,_0x233308){if(_0x1f5e53){return _0x3ee671(_0x1f5e53);}return _0x49f4c1(_0xcc8f83);});})['then'](function(_0x364926){var _0x330809=![];var _0x333e6a=_0x364926[_0xd528('0x14')](/\n/);for(var _0x2f28ad=0x0,_0x53a57a=_0x1f4a8a[_0xd528('0x15')];_0x2f28ad<_0x53a57a,_0x330809===![];_0x2f28ad+=0x1){if(_0x364926[_0xd528('0x16')](_0x1f4a8a[_0x2f28ad])>=0x0){_0x330809=!![];}}if(!_0x330809){throw new Error(util[_0xd528('0x17')](_0xd528('0x18'),_0x1ffa01[_0xd528('0x12')][_0xd528('0x13')]));}process[_0xd528('0x19')](_0x1ffa01['params']['pid'],_0xd528('0x1a'));return _0x3a5b42[_0xd528('0x9')](0xc8)[_0xd528('0xd')]({'message':util[_0xd528('0x17')](_0xd528('0x1b'),_0x1ffa01['params'][_0xd528('0x13')])});})[_0xd528('0xe')](handleError(_0x3a5b42,null,_0xd528('0xf')));}; \ No newline at end of file +var _0x7977=['status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','length','indexOf','pid','kill','params','SIGINT','child_process','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name'];(function(_0x67d4f5,_0xed252c){var _0x3c98b6=function(_0x1b00c5){while(--_0x1b00c5){_0x67d4f5['push'](_0x67d4f5['shift']());}};_0x3c98b6(++_0xed252c);}(_0x7977,0x12f));var _0x7797=function(_0x2bea35,_0x3f7baf){_0x2bea35=_0x2bea35-0x0;var _0x8477cb=_0x7977[_0x2bea35];return _0x8477cb;};'use strict';var info=require('systeminformation');var exec=require(_0x7797('0x0'))['exec'];var logger=require(_0x7797('0x1'))(_0x7797('0x2'));var util=require('util');var BPromise=require(_0x7797('0x3'));var _=require(_0x7797('0x4'));function handleError(_0x40f5c7,_0x1ea230,_0x3355a9){_0x1ea230=_0x1ea230||0x1f4;return function(_0x39d791){logger[_0x7797('0x5')](_0x7797('0x6'),_0x3355a9,_0x1ea230,util[_0x7797('0x7')](_0x39d791,{'showHidden':![],'depth':null}));delete _0x39d791[_0x7797('0x8')];_0x40f5c7[_0x7797('0x9')](_0x1ea230)[_0x7797('0xa')](_0x39d791);};}exports[_0x7797('0xb')]=function(_0x43e13a,_0x4ccc78){return info[_0x7797('0xc')]()[_0x7797('0xd')](function(_0x342ee5){return _0x4ccc78['status'](0xc8)[_0x7797('0xe')](_0x342ee5);})[_0x7797('0xf')](function(_0x44590b){return _0x4ccc78[_0x7797('0x9')](0x1f4)[_0x7797('0xe')](_0x44590b);});};exports[_0x7797('0x10')]=function(_0x1512d0,_0x41b2f5){var _0x41fd4d=[_0x7797('0x11')];return new BPromise(function(_0x1aff0a,_0x4764b7){return exec(util[_0x7797('0x12')](_0x7797('0x13'),_0x1512d0['params']['pid']),function(_0x9c2977,_0x277d44,_0x14f6af){if(_0x9c2977){return _0x4764b7(_0x9c2977);}return _0x1aff0a(_0x277d44);});})['then'](function(_0x4520c7){var _0x49c5e0=![];var _0x302a1c=_0x4520c7['split'](/\n/);for(var _0x5351f5=0x0,_0x5c3052=_0x41fd4d[_0x7797('0x14')];_0x5351f5<_0x5c3052,_0x49c5e0===![];_0x5351f5+=0x1){if(_0x4520c7[_0x7797('0x15')](_0x41fd4d[_0x5351f5])>=0x0){_0x49c5e0=!![];}}if(!_0x49c5e0){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1512d0['params'][_0x7797('0x16')]));}process[_0x7797('0x17')](_0x1512d0[_0x7797('0x18')][_0x7797('0x16')],_0x7797('0x19'));return _0x41b2f5[_0x7797('0x9')](0xc8)[_0x7797('0xe')]({'message':util[_0x7797('0x12')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x1512d0['params'][_0x7797('0x16')])});})['catch'](handleError(_0x41b2f5,null,_0x7797('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 6acf779..1c1fc25 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 _0xbd50=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','show','create','delete','exports','multer','util'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xbd50,0x196));var _0x0bd5=function(_0x244240,_0x3b44e2){_0x244240=_0x244240-0x0;var _0x57af02=_0xbd50[_0x244240];return _0x57af02;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var fs_extra=require(_0x0bd5('0x5'));var auth=require(_0x0bd5('0x6'));var interaction=require(_0x0bd5('0x7'));var config=require('../../config/environment');var controller=require('./tag.controller');router['get']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x9')]);router[_0x0bd5('0xa')](_0x0bd5('0xb'),auth[_0x0bd5('0x8')](),controller['describe']);router['get'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xd')]);router['post']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xe')]);router['put'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['update']);router[_0x0bd5('0xf')](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['destroy']);module[_0x0bd5('0x10')]=router; \ No newline at end of file +var _0xec56=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0xecbaa,_0x3ca83d){var _0xbefa93=function(_0x447c70){while(--_0x447c70){_0xecbaa['push'](_0xecbaa['shift']());}};_0xbefa93(++_0x3ca83d);}(_0xec56,0x1bd));var _0x6ec5=function(_0x27a73d,_0x3eb2d1){_0x27a73d=_0x27a73d-0x0;var _0x3c068f=_0xec56[_0x27a73d];return _0x3c068f;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['post']('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x10')]);router[_0x6ec5('0x11')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x12')]);router[_0x6ec5('0x13')]('/:id',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x14')]);module[_0x6ec5('0x15')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index d1071f0..2075cf4 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 _0x4a3c=['sequelize','STRING','name','#0091EA'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x4a3c,0x13c));var _0xc4a3=function(_0x2f0a08,_0x81ff8c){_0x2f0a08=_0x2f0a08-0x0;var _0x3597d7=_0x4a3c[_0x2f0a08];return _0x3597d7;};'use strict';var Sequelize=require(_0xc4a3('0x0'));module['exports']={'name':{'type':Sequelize[_0xc4a3('0x1')],'unique':_0xc4a3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc4a3('0x1')],'defaultValue':_0xc4a3('0x3')},'description':{'type':Sequelize[_0xc4a3('0x1')]}}; \ No newline at end of file +var _0xa7fa=['sequelize','name','STRING','#0091EA'];(function(_0x21daa5,_0x418e2f){var _0x51f3ea=function(_0x286c25){while(--_0x286c25){_0x21daa5['push'](_0x21daa5['shift']());}};_0x51f3ea(++_0x418e2f);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaa7f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xaa7f('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xaa7f('0x2')],'defaultValue':_0xaa7f('0x3')},'description':{'type':Sequelize[_0xaa7f('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index ef10e70..4651b83 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 _0x0218=['describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','end','error','stack','name','index','map','Tag','fieldName','type','key','query','filters','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','keys','rawAttributes','attributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params'];(function(_0x303098,_0x443898){var _0x5b8a81=function(_0x29e6f0){while(--_0x29e6f0){_0x303098['push'](_0x303098['shift']());}};_0x5b8a81(++_0x443898);}(_0x0218,0x1aa));var _0x8021=function(_0x1f6035,_0x592ec0){_0x1f6035=_0x1f6035-0x0;var _0x3ac85d=_0x0218[_0x1f6035];return _0x3ac85d;};'use strict';var emlformat=require(_0x8021('0x0'));var rimraf=require(_0x8021('0x1'));var zipdir=require(_0x8021('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8021('0x3'));var moment=require(_0x8021('0x4'));var BPromise=require(_0x8021('0x5'));var Mustache=require(_0x8021('0x6'));var util=require(_0x8021('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8021('0x8'));var ejs=require(_0x8021('0x9'));var fs=require('fs');var fs_extra=require(_0x8021('0xa'));var _=require(_0x8021('0xb'));var squel=require('squel');var crypto=require(_0x8021('0xc'));var jsforce=require(_0x8021('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8021('0x8'));var querystring=require(_0x8021('0xe'));var Papa=require(_0x8021('0xf'));var Redis=require(_0x8021('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8021('0x11'));var logger=require(_0x8021('0x12'))(_0x8021('0x13'));var utils=require(_0x8021('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8021('0x15'));var db=require(_0x8021('0x16'))['db'];function respondWithStatusCode(_0x2f46e2,_0x52d0c9){_0x52d0c9=_0x52d0c9||0xcc;return function(_0x5e42ab){if(_0x5e42ab){return _0x2f46e2[_0x8021('0x17')](_0x52d0c9);}return _0x2f46e2[_0x8021('0x18')](_0x52d0c9)['end']();};}function respondWithResult(_0x2f4187,_0x1b32fb){_0x1b32fb=_0x1b32fb||0xc8;return function(_0x728259){if(_0x728259){return _0x2f4187[_0x8021('0x18')](_0x1b32fb)[_0x8021('0x19')](_0x728259);}};}function respondWithFilteredResult(_0x2c5a30,_0x3930b0){return function(_0x4efbff){if(_0x4efbff){var _0x17d483=typeof _0x3930b0[_0x8021('0x1a')]===_0x8021('0x1b')&&typeof _0x3930b0[_0x8021('0x1c')]==='undefined';var _0x241e2a=_0x4efbff[_0x8021('0x1d')];var _0x483327=_0x17d483?0x0:_0x3930b0[_0x8021('0x1a')];var _0x3bf542=_0x17d483?_0x4efbff['count']:_0x3930b0[_0x8021('0x1a')]+_0x3930b0['limit'];var _0x33698b;if(_0x3bf542>=_0x241e2a){_0x3bf542=_0x241e2a;_0x33698b=0xc8;}else{_0x33698b=0xce;}_0x2c5a30[_0x8021('0x18')](_0x33698b);return _0x2c5a30[_0x8021('0x1e')](_0x8021('0x1f'),_0x483327+'-'+_0x3bf542+'/'+_0x241e2a)[_0x8021('0x19')](_0x4efbff);}return null;};}function patchUpdates(_0x3c18e0){return function(_0x41b493){try{jsonpatch[_0x8021('0x20')](_0x41b493,_0x3c18e0,!![]);}catch(_0x316975){return BPromise[_0x8021('0x21')](_0x316975);}return _0x41b493[_0x8021('0x22')]();};}function saveUpdates(_0x42e8b9,_0x32743f){return function(_0x5589a4){if(_0x5589a4){return _0x5589a4['update'](_0x42e8b9)[_0x8021('0x23')](function(_0x58734d){return _0x58734d;});}return null;};}function removeEntity(_0x34e725,_0x5e5118){return function(_0x5ec06b){if(_0x5ec06b){return _0x5ec06b[_0x8021('0x24')]()[_0x8021('0x23')](function(){var _0x16083d=_0x5ec06b[_0x8021('0x25')]({'plain':!![]});var _0x372730='Tags';return db['UserProfileResource'][_0x8021('0x24')]({'where':{'type':_0x372730,'resourceId':_0x16083d['id']}})[_0x8021('0x23')](function(){return _0x5ec06b;});})['then'](function(){_0x34e725['status'](0xcc)[_0x8021('0x26')]();});}};}function handleEntityNotFound(_0x8e423,_0xdaa748){return function(_0x26742a){if(!_0x26742a){_0x8e423[_0x8021('0x17')](0x194);}return _0x26742a;};}function handleError(_0x11213a,_0x2ee0f0){_0x2ee0f0=_0x2ee0f0||0x1f4;return function(_0x18f0f8){logger[_0x8021('0x27')](_0x18f0f8[_0x8021('0x28')]);if(_0x18f0f8[_0x8021('0x29')]){delete _0x18f0f8[_0x8021('0x29')];}_0x11213a[_0x8021('0x18')](_0x2ee0f0)['send'](_0x18f0f8);};}exports[_0x8021('0x2a')]=function(_0x4ac419,_0x5e0d57){var _0x3a7ab0={},_0x48596f={},_0x4f0b2b={'count':0x0,'rows':[]};var _0x112f25=_[_0x8021('0x2b')](db[_0x8021('0x2c')]['rawAttributes'],function(_0x358e31){return{'name':_0x358e31[_0x8021('0x2d')],'type':_0x358e31[_0x8021('0x2e')][_0x8021('0x2f')]};});_0x48596f['model']=_[_0x8021('0x2b')](_0x112f25,_0x8021('0x29'));_0x48596f[_0x8021('0x30')]=_['keys'](_0x4ac419[_0x8021('0x30')]);_0x48596f[_0x8021('0x31')]=_[_0x8021('0x32')](_0x48596f['model'],_0x48596f[_0x8021('0x30')]);_0x3a7ab0['attributes']=_['intersection'](_0x48596f[_0x8021('0x33')],qs[_0x8021('0x34')](_0x4ac419['query'][_0x8021('0x34')]));_0x3a7ab0['attributes']=_0x3a7ab0['attributes'][_0x8021('0x35')]?_0x3a7ab0['attributes']:_0x48596f['model'];if(!_0x4ac419[_0x8021('0x30')][_0x8021('0x36')](_0x8021('0x37'))){_0x3a7ab0['limit']=qs[_0x8021('0x1c')](_0x4ac419['query'][_0x8021('0x1c')]);_0x3a7ab0[_0x8021('0x1a')]=qs[_0x8021('0x1a')](_0x4ac419[_0x8021('0x30')][_0x8021('0x1a')]);}_0x3a7ab0[_0x8021('0x38')]=qs[_0x8021('0x39')](_0x4ac419[_0x8021('0x30')][_0x8021('0x39')]);_0x3a7ab0[_0x8021('0x3a')]=qs[_0x8021('0x31')](_['pick'](_0x4ac419[_0x8021('0x30')],_0x48596f[_0x8021('0x31')]),_0x112f25);if(_0x4ac419[_0x8021('0x30')][_0x8021('0x3b')]){_0x3a7ab0[_0x8021('0x3a')]=_['merge'](_0x3a7ab0[_0x8021('0x3a')],{'$or':_[_0x8021('0x2b')](_0x112f25,function(_0xcd366a){if(_0xcd366a['type']!==_0x8021('0x3c')){var _0x36e68d={};_0x36e68d[_0xcd366a[_0x8021('0x29')]]={'$like':'%'+_0x4ac419['query'][_0x8021('0x3b')]+'%'};return _0x36e68d;}})});}_0x3a7ab0=_[_0x8021('0x3d')]({},_0x3a7ab0,_0x4ac419[_0x8021('0x3e')]);var _0xc8b9c5={'where':_0x3a7ab0[_0x8021('0x3a')]};return db[_0x8021('0x2c')][_0x8021('0x1d')](_0xc8b9c5)[_0x8021('0x23')](function(_0x4306ce){_0x4f0b2b[_0x8021('0x1d')]=_0x4306ce;if(_0x4ac419[_0x8021('0x30')][_0x8021('0x3f')]){_0x3a7ab0[_0x8021('0x40')]=[{'all':!![]}];}return db[_0x8021('0x2c')][_0x8021('0x41')](_0x3a7ab0);})[_0x8021('0x23')](function(_0x5dcf39){_0x4f0b2b[_0x8021('0x42')]=_0x5dcf39;return _0x4f0b2b;})[_0x8021('0x23')](respondWithFilteredResult(_0x5e0d57,_0x3a7ab0))[_0x8021('0x43')](handleError(_0x5e0d57,null));};exports['show']=function(_0x541f49,_0x57f888){var _0x271b32={'raw':!![],'where':{'id':_0x541f49['params']['id']}},_0x4a5a8a={};_0x4a5a8a[_0x8021('0x33')]=_[_0x8021('0x44')](db['Tag'][_0x8021('0x45')]);_0x4a5a8a['query']=_[_0x8021('0x44')](_0x541f49[_0x8021('0x30')]);_0x4a5a8a['filters']=_['intersection'](_0x4a5a8a['model'],_0x4a5a8a['query']);_0x271b32[_0x8021('0x46')]=_[_0x8021('0x32')](_0x4a5a8a['model'],qs[_0x8021('0x34')](_0x541f49[_0x8021('0x30')][_0x8021('0x34')]));_0x271b32[_0x8021('0x46')]=_0x271b32[_0x8021('0x46')][_0x8021('0x35')]?_0x271b32['attributes']:_0x4a5a8a[_0x8021('0x33')];if(_0x541f49[_0x8021('0x30')]['includeAll']){_0x271b32[_0x8021('0x40')]=[{'all':!![]}];}_0x271b32=_[_0x8021('0x3d')]({},_0x271b32,_0x541f49[_0x8021('0x3e')]);return db[_0x8021('0x2c')][_0x8021('0x47')](_0x271b32)[_0x8021('0x23')](handleEntityNotFound(_0x57f888,null))[_0x8021('0x23')](respondWithResult(_0x57f888,null))[_0x8021('0x43')](handleError(_0x57f888,null));};exports['create']=function(_0x4a57d9,_0x3c10ed){return db[_0x8021('0x2c')][_0x8021('0x48')](_0x4a57d9[_0x8021('0x49')],{})[_0x8021('0x23')](function(_0x3cd4fa){var _0xd18e82=_0x4a57d9[_0x8021('0x4a')][_0x8021('0x25')]({'plain':!![]});if(!_0xd18e82)throw new Error(_0x8021('0x4b'));if(_0xd18e82[_0x8021('0x4c')]===_0x8021('0x4a')){var _0x568fc5=_0x3cd4fa[_0x8021('0x25')]({'plain':!![]});var _0x580299=_0x8021('0x4d');return db['UserProfileSection'][_0x8021('0x47')]({'where':{'name':_0x580299,'userProfileId':_0xd18e82[_0x8021('0x4e')]},'raw':!![]})[_0x8021('0x23')](function(_0x132e28){if(_0x132e28&&_0x132e28[_0x8021('0x4f')]===0x0){return db[_0x8021('0x50')][_0x8021('0x48')]({'name':_0x568fc5['name'],'resourceId':_0x568fc5['id'],'type':_0x132e28[_0x8021('0x29')],'sectionId':_0x132e28['id']},{})[_0x8021('0x23')](function(){return _0x3cd4fa;});}else{return _0x3cd4fa;}})[_0x8021('0x43')](function(_0x3f8f69){logger[_0x8021('0x27')](_0x8021('0x51'),_0x3f8f69);throw _0x3f8f69;});}return _0x3cd4fa;})[_0x8021('0x23')](respondWithResult(_0x3c10ed,0xc9))[_0x8021('0x43')](handleError(_0x3c10ed,null));};exports[_0x8021('0x52')]=function(_0x1a707b,_0x29e23f){if(_0x1a707b[_0x8021('0x49')]['id']){delete _0x1a707b['body']['id'];}return db[_0x8021('0x2c')][_0x8021('0x47')]({'where':{'id':_0x1a707b[_0x8021('0x53')]['id']}})[_0x8021('0x23')](handleEntityNotFound(_0x29e23f,null))['then'](saveUpdates(_0x1a707b['body'],null))[_0x8021('0x23')](respondWithResult(_0x29e23f,null))['catch'](handleError(_0x29e23f,null));};exports['destroy']=function(_0x36804b,_0xb649ea){return db[_0x8021('0x2c')]['find']({'where':{'id':_0x36804b[_0x8021('0x53')]['id']}})[_0x8021('0x23')](handleEntityNotFound(_0xb649ea,null))['then'](removeEntity(_0xb649ea,null))[_0x8021('0x43')](handleError(_0xb649ea,null));};exports[_0x8021('0x54')]=function(_0x52bcaf,_0x4c40eb){return db[_0x8021('0x2c')][_0x8021('0x54')]()[_0x8021('0x23')](respondWithResult(_0x4c40eb,null))[_0x8021('0x43')](handleError(_0x4c40eb,null));}; \ No newline at end of file +var _0x341c=['rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','Tag','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','update','destroy','then','get','Tags','end','error','stack','name','send','index'];(function(_0x17636e,_0x38ce15){var _0xafd088=function(_0xf20682){while(--_0xf20682){_0x17636e['push'](_0x17636e['shift']());}};_0xafd088(++_0x38ce15);}(_0x341c,0x137));var _0xc341=function(_0x460dae,_0x3a907f){_0x460dae=_0x460dae-0x0;var _0x36e6d0=_0x341c[_0x460dae];return _0x36e6d0;};'use strict';var emlformat=require(_0xc341('0x0'));var rimraf=require(_0xc341('0x1'));var zipdir=require(_0xc341('0x2'));var jsonpatch=require(_0xc341('0x3'));var rp=require(_0xc341('0x4'));var moment=require(_0xc341('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc341('0x6'));var util=require(_0xc341('0x7'));var path=require(_0xc341('0x8'));var sox=require(_0xc341('0x9'));var csv=require(_0xc341('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc341('0xb'));var _=require(_0xc341('0xc'));var squel=require(_0xc341('0xd'));var crypto=require(_0xc341('0xe'));var jsforce=require(_0xc341('0xf'));var deskjs=require(_0xc341('0x10'));var toCsv=require(_0xc341('0xa'));var querystring=require(_0xc341('0x11'));var Papa=require(_0xc341('0x12'));var Redis=require(_0xc341('0x13'));var authService=require(_0xc341('0x14'));var qs=require(_0xc341('0x15'));var as=require(_0xc341('0x16'));var hardwareService=require(_0xc341('0x17'));var logger=require(_0xc341('0x18'))(_0xc341('0x19'));var utils=require(_0xc341('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xc341('0x1b'));var db=require(_0xc341('0x1c'))['db'];function respondWithStatusCode(_0x166b2d,_0x3767fc){_0x3767fc=_0x3767fc||0xcc;return function(_0x49ddc5){if(_0x49ddc5){return _0x166b2d[_0xc341('0x1d')](_0x3767fc);}return _0x166b2d[_0xc341('0x1e')](_0x3767fc)['end']();};}function respondWithResult(_0x7d9307,_0x476348){_0x476348=_0x476348||0xc8;return function(_0x632884){if(_0x632884){return _0x7d9307[_0xc341('0x1e')](_0x476348)[_0xc341('0x1f')](_0x632884);}};}function respondWithFilteredResult(_0x38d86c,_0x4547d6){return function(_0x23dc7c){if(_0x23dc7c){var _0x5ed86f=typeof _0x4547d6['offset']===_0xc341('0x20')&&typeof _0x4547d6[_0xc341('0x21')]==='undefined';var _0x30be21=_0x23dc7c[_0xc341('0x22')];var _0x182a42=_0x5ed86f?0x0:_0x4547d6[_0xc341('0x23')];var _0xc00963=_0x5ed86f?_0x23dc7c[_0xc341('0x22')]:_0x4547d6['offset']+_0x4547d6[_0xc341('0x21')];var _0x51a293;if(_0xc00963>=_0x30be21){_0xc00963=_0x30be21;_0x51a293=0xc8;}else{_0x51a293=0xce;}_0x38d86c[_0xc341('0x1e')](_0x51a293);return _0x38d86c[_0xc341('0x24')]('Content-Range',_0x182a42+'-'+_0xc00963+'/'+_0x30be21)['json'](_0x23dc7c);}return null;};}function patchUpdates(_0x438508){return function(_0x597e8d){try{jsonpatch[_0xc341('0x25')](_0x597e8d,_0x438508,!![]);}catch(_0x1dc87d){return BPromise['reject'](_0x1dc87d);}return _0x597e8d['save']();};}function saveUpdates(_0x436968,_0x4afd83){return function(_0x5c915e){if(_0x5c915e){return _0x5c915e[_0xc341('0x26')](_0x436968)['then'](function(_0x2d0da5){return _0x2d0da5;});}return null;};}function removeEntity(_0x54109f,_0x3b5d89){return function(_0x6f845e){if(_0x6f845e){return _0x6f845e[_0xc341('0x27')]()[_0xc341('0x28')](function(){var _0x2c5f99=_0x6f845e[_0xc341('0x29')]({'plain':!![]});var _0x3ed181=_0xc341('0x2a');return db['UserProfileResource'][_0xc341('0x27')]({'where':{'type':_0x3ed181,'resourceId':_0x2c5f99['id']}})[_0xc341('0x28')](function(){return _0x6f845e;});})[_0xc341('0x28')](function(){_0x54109f[_0xc341('0x1e')](0xcc)[_0xc341('0x2b')]();});}};}function handleEntityNotFound(_0x33e57c,_0x277ec3){return function(_0xb9022f){if(!_0xb9022f){_0x33e57c[_0xc341('0x1d')](0x194);}return _0xb9022f;};}function handleError(_0x408c00,_0x31698d){_0x31698d=_0x31698d||0x1f4;return function(_0xf1aea6){logger[_0xc341('0x2c')](_0xf1aea6[_0xc341('0x2d')]);if(_0xf1aea6[_0xc341('0x2e')]){delete _0xf1aea6[_0xc341('0x2e')];}_0x408c00[_0xc341('0x1e')](_0x31698d)[_0xc341('0x2f')](_0xf1aea6);};}exports[_0xc341('0x30')]=function(_0xb2709a,_0x6771fb){var _0x499144={},_0x3c772b={},_0x4babc1={'count':0x0,'rows':[]};var _0x57cf9d=_['map'](db['Tag'][_0xc341('0x31')],function(_0x1363c2){return{'name':_0x1363c2[_0xc341('0x32')],'type':_0x1363c2[_0xc341('0x33')][_0xc341('0x34')]};});_0x3c772b['model']=_[_0xc341('0x35')](_0x57cf9d,'name');_0x3c772b[_0xc341('0x36')]=_['keys'](_0xb2709a[_0xc341('0x36')]);_0x3c772b['filters']=_[_0xc341('0x37')](_0x3c772b[_0xc341('0x38')],_0x3c772b[_0xc341('0x36')]);_0x499144[_0xc341('0x39')]=_['intersection'](_0x3c772b[_0xc341('0x38')],qs[_0xc341('0x3a')](_0xb2709a[_0xc341('0x36')]['fields']));_0x499144[_0xc341('0x39')]=_0x499144[_0xc341('0x39')][_0xc341('0x3b')]?_0x499144[_0xc341('0x39')]:_0x3c772b[_0xc341('0x38')];if(!_0xb2709a['query'][_0xc341('0x3c')](_0xc341('0x3d'))){_0x499144[_0xc341('0x21')]=qs[_0xc341('0x21')](_0xb2709a['query'][_0xc341('0x21')]);_0x499144[_0xc341('0x23')]=qs[_0xc341('0x23')](_0xb2709a['query'][_0xc341('0x23')]);}_0x499144[_0xc341('0x3e')]=qs[_0xc341('0x3f')](_0xb2709a['query'][_0xc341('0x3f')]);_0x499144[_0xc341('0x40')]=qs[_0xc341('0x41')](_[_0xc341('0x42')](_0xb2709a[_0xc341('0x36')],_0x3c772b['filters']),_0x57cf9d);if(_0xb2709a['query'][_0xc341('0x43')]){_0x499144['where']=_['merge'](_0x499144['where'],{'$or':_['map'](_0x57cf9d,function(_0x12fee3){if(_0x12fee3['type']!==_0xc341('0x44')){var _0x32d6ae={};_0x32d6ae[_0x12fee3['name']]={'$like':'%'+_0xb2709a[_0xc341('0x36')]['filter']+'%'};return _0x32d6ae;}})});}_0x499144=_['merge']({},_0x499144,_0xb2709a['options']);var _0x47560b={'where':_0x499144[_0xc341('0x40')]};return db[_0xc341('0x45')][_0xc341('0x22')](_0x47560b)[_0xc341('0x28')](function(_0x50c028){_0x4babc1[_0xc341('0x22')]=_0x50c028;if(_0xb2709a[_0xc341('0x36')][_0xc341('0x46')]){_0x499144[_0xc341('0x47')]=[{'all':!![]}];}return db[_0xc341('0x45')][_0xc341('0x48')](_0x499144);})[_0xc341('0x28')](function(_0x202211){_0x4babc1[_0xc341('0x49')]=_0x202211;return _0x4babc1;})[_0xc341('0x28')](respondWithFilteredResult(_0x6771fb,_0x499144))[_0xc341('0x4a')](handleError(_0x6771fb,null));};exports[_0xc341('0x4b')]=function(_0x15f3e4,_0x1efb5a){var _0x4f5997={'raw':!![],'where':{'id':_0x15f3e4['params']['id']}},_0x4e8562={};_0x4e8562[_0xc341('0x38')]=_[_0xc341('0x4c')](db['Tag'][_0xc341('0x31')]);_0x4e8562[_0xc341('0x36')]=_[_0xc341('0x4c')](_0x15f3e4[_0xc341('0x36')]);_0x4e8562[_0xc341('0x41')]=_['intersection'](_0x4e8562[_0xc341('0x38')],_0x4e8562[_0xc341('0x36')]);_0x4f5997[_0xc341('0x39')]=_[_0xc341('0x37')](_0x4e8562[_0xc341('0x38')],qs[_0xc341('0x3a')](_0x15f3e4['query']['fields']));_0x4f5997['attributes']=_0x4f5997['attributes']['length']?_0x4f5997[_0xc341('0x39')]:_0x4e8562['model'];if(_0x15f3e4[_0xc341('0x36')][_0xc341('0x46')]){_0x4f5997['include']=[{'all':!![]}];}_0x4f5997=_['merge']({},_0x4f5997,_0x15f3e4[_0xc341('0x4d')]);return db[_0xc341('0x45')][_0xc341('0x4e')](_0x4f5997)['then'](handleEntityNotFound(_0x1efb5a,null))[_0xc341('0x28')](respondWithResult(_0x1efb5a,null))['catch'](handleError(_0x1efb5a,null));};exports['create']=function(_0x59e775,_0x430435){return db[_0xc341('0x45')][_0xc341('0x4f')](_0x59e775[_0xc341('0x50')],{})[_0xc341('0x28')](function(_0x13ae62){var _0x5c4c6c=_0x59e775[_0xc341('0x51')][_0xc341('0x29')]({'plain':!![]});if(!_0x5c4c6c)throw new Error(_0xc341('0x52'));if(_0x5c4c6c['role']===_0xc341('0x51')){var _0x3a925c=_0x13ae62[_0xc341('0x29')]({'plain':!![]});var _0x1ae221=_0xc341('0x2a');return db[_0xc341('0x53')]['find']({'where':{'name':_0x1ae221,'userProfileId':_0x5c4c6c[_0xc341('0x54')]},'raw':!![]})[_0xc341('0x28')](function(_0x5de1e9){if(_0x5de1e9&&_0x5de1e9[_0xc341('0x55')]===0x0){return db[_0xc341('0x56')][_0xc341('0x4f')]({'name':_0x3a925c[_0xc341('0x2e')],'resourceId':_0x3a925c['id'],'type':_0x5de1e9[_0xc341('0x2e')],'sectionId':_0x5de1e9['id']},{})[_0xc341('0x28')](function(){return _0x13ae62;});}else{return _0x13ae62;}})[_0xc341('0x4a')](function(_0xbfe04){logger[_0xc341('0x2c')](_0xc341('0x57'),_0xbfe04);throw _0xbfe04;});}return _0x13ae62;})[_0xc341('0x28')](respondWithResult(_0x430435,0xc9))[_0xc341('0x4a')](handleError(_0x430435,null));};exports['update']=function(_0x5e2923,_0x422965){if(_0x5e2923['body']['id']){delete _0x5e2923[_0xc341('0x50')]['id'];}return db['Tag']['find']({'where':{'id':_0x5e2923[_0xc341('0x58')]['id']}})['then'](handleEntityNotFound(_0x422965,null))[_0xc341('0x28')](saveUpdates(_0x5e2923[_0xc341('0x50')],null))[_0xc341('0x28')](respondWithResult(_0x422965,null))['catch'](handleError(_0x422965,null));};exports[_0xc341('0x27')]=function(_0x11ad87,_0x461e9a){return db[_0xc341('0x45')][_0xc341('0x4e')]({'where':{'id':_0x11ad87[_0xc341('0x58')]['id']}})[_0xc341('0x28')](handleEntityNotFound(_0x461e9a,null))[_0xc341('0x28')](removeEntity(_0x461e9a,null))['catch'](handleError(_0x461e9a,null));};exports['describe']=function(_0x3fc61b,_0x40d955){return db[_0xc341('0x45')][_0xc341('0x59')]()[_0xc341('0x28')](respondWithResult(_0x40d955,null))[_0xc341('0x4a')](handleError(_0x40d955,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index ea60ea2..e5fb18a 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 _0x2993=['request-promise','path','exports','Tag','tools_tags','util','../../config/logger','api','moment','bluebird'];(function(_0x4a4563,_0x2771c3){var _0x201be1=function(_0x32505c){while(--_0x32505c){_0x4a4563['push'](_0x4a4563['shift']());}};_0x201be1(++_0x2771c3);}(_0x2993,0x113));var _0x3299=function(_0x123657,_0x464b83){_0x123657=_0x123657-0x0;var _0x49b15b=_0x2993[_0x123657];return _0x49b15b;};'use strict';var _=require('lodash');var util=require(_0x3299('0x0'));var logger=require(_0x3299('0x1'))(_0x3299('0x2'));var moment=require(_0x3299('0x3'));var BPromise=require(_0x3299('0x4'));var rp=require(_0x3299('0x5'));var fs=require('fs');var path=require(_0x3299('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0x3299('0x7')]=function(_0x42bf70,_0xce1b55){return _0x42bf70['define'](_0x3299('0x8'),attributes,{'tableName':_0x3299('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4b7=['request-promise','rimraf','./tag.attributes','exports','define','Tag','tools_tags','lodash','../../config/logger','moment','bluebird'];(function(_0x279ce4,_0x13a3c8){var _0x3e8bcd=function(_0x122463){while(--_0x122463){_0x279ce4['push'](_0x279ce4['shift']());}};_0x3e8bcd(++_0x13a3c8);}(_0xb4b7,0x6a));var _0x7b4b=function(_0x41ec79,_0x1ef07c){_0x41ec79=_0x41ec79-0x0;var _0x1e64fc=_0xb4b7[_0x41ec79];return _0x1e64fc;};'use strict';var _=require(_0x7b4b('0x0'));var util=require('util');var logger=require(_0x7b4b('0x1'))('api');var moment=require(_0x7b4b('0x2'));var BPromise=require(_0x7b4b('0x3'));var rp=require(_0x7b4b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b4b('0x5'));var config=require('../../config/environment');var attributes=require(_0x7b4b('0x6'));module[_0x7b4b('0x7')]=function(_0x1f14fe,_0x241991){return _0x1f14fe[_0x7b4b('0x8')](_0x7b4b('0x9'),attributes,{'tableName':_0x7b4b('0xa'),'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 212ef62..a6ac3ee 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 _0xc3b5=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x238e59,_0x3d5bd8){var _0x2cdb69=function(_0x45125b){while(--_0x45125b){_0x238e59['push'](_0x238e59['shift']());}};_0x2cdb69(++_0x3d5bd8);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x57173a,_0x4fb2ce){_0x57173a=_0x57173a-0x0;var _0x5f52aa=_0xc3b5[_0x57173a];return _0x5f52aa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5c3b('0x0'));var BPromise=require(_0x5c3b('0x1'));var rs=require(_0x5c3b('0x2'));var fs=require('fs');var Redis=require(_0x5c3b('0x3'));var db=require(_0x5c3b('0x4'))['db'];var utils=require(_0x5c3b('0x5'));var logger=require(_0x5c3b('0x6'))(_0x5c3b('0x7'));var config=require('../../config/environment');var jayson=require(_0x5c3b('0x8'));var client=jayson[_0x5c3b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568a28,_0x30a08f,_0x420839){return new BPromise(function(_0x3892ad,_0x5be9ee){return client[_0x5c3b('0xa')](_0x568a28,_0x420839)[_0x5c3b('0xb')](function(_0x159db5){logger[_0x5c3b('0xc')]('Tag,\x20%s,\x20%s',_0x30a08f,_0x5c3b('0xd'));logger[_0x5c3b('0xe')](_0x5c3b('0xf'),_0x30a08f,_0x5c3b('0xd'),JSON[_0x5c3b('0x10')](_0x159db5));if(_0x159db5['error']){if(_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x12')]===0x1f4){logger['error'](_0x5c3b('0x13'),_0x30a08f,_0x159db5[_0x5c3b('0x11')]['message']);return _0x5be9ee(_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x14')]);}logger[_0x5c3b('0x11')](_0x5c3b('0x13'),_0x30a08f,_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x14')]);return _0x3892ad(_0x159db5[_0x5c3b('0x11')]['message']);}else{logger[_0x5c3b('0xc')]('Tag,\x20%s,\x20%s',_0x30a08f,'request\x20sent');_0x3892ad(_0x159db5[_0x5c3b('0x15')][_0x5c3b('0x14')]);}})[_0x5c3b('0x16')](function(_0x589797){logger[_0x5c3b('0x11')](_0x5c3b('0x13'),_0x30a08f,_0x589797);_0x5be9ee(_0x589797);});});} \ No newline at end of file +var _0xe13a=['code','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x557b5f,_0x22b00f){var _0x1a2919=function(_0x384568){while(--_0x384568){_0x557b5f['push'](_0x557b5f['shift']());}};_0x1a2919(++_0x22b00f);}(_0xe13a,0x178));var _0xae13=function(_0x4d1803,_0x34aac6){_0x4d1803=_0x4d1803-0x0;var _0x31a5de=_0xe13a[_0x4d1803];return _0x31a5de;};'use strict';var _=require('lodash');var util=require(_0xae13('0x0'));var moment=require(_0xae13('0x1'));var BPromise=require(_0xae13('0x2'));var rs=require(_0xae13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae13('0x4'))['db'];var utils=require(_0xae13('0x5'));var logger=require(_0xae13('0x6'))(_0xae13('0x7'));var config=require(_0xae13('0x8'));var jayson=require(_0xae13('0x9'));var client=jayson[_0xae13('0xa')][_0xae13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x341ba4,_0x4ae51f,_0x2f6d10){return new BPromise(function(_0x2b2e1f,_0x27fefd){return client[_0xae13('0xc')](_0x341ba4,_0x2f6d10)[_0xae13('0xd')](function(_0x41bf44){logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));logger['debug'](_0xae13('0x11'),_0x4ae51f,_0xae13('0x10'),JSON[_0xae13('0x12')](_0x41bf44));if(_0x41bf44[_0xae13('0x13')]){if(_0x41bf44[_0xae13('0x13')][_0xae13('0x14')]===0x1f4){logger[_0xae13('0x13')]('Tag,\x20%s,\x20%s',_0x4ae51f,_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);return _0x27fefd(_0x41bf44['error']['message']);}logger['error']('Tag,\x20%s,\x20%s',_0x4ae51f,_0x41bf44['error'][_0xae13('0x15')]);return _0x2b2e1f(_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);}else{logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));_0x2b2e1f(_0x41bf44['result'][_0xae13('0x15')]);}})['catch'](function(_0xe10aab){logger[_0xae13('0x13')](_0xae13('0xf'),_0x4ae51f,_0xe10aab);_0x27fefd(_0xe10aab);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index fc56631..8cb3316 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 2e61e6c..44355e2 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0x5a7caf,_0x2dc952){var _0x5bcd83=function(_0x410e06){while(--_0x410e06){_0x5a7caf['push'](_0x5a7caf['shift']());}};_0x5bcd83(++_0x2dc952);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x419ff3,_0x21a897){var _0x556cd8=function(_0x3a7885){while(--_0x3a7885){_0x419ff3['push'](_0x419ff3['shift']());}};_0x556cd8(++_0x21a897);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 8045eac..3d3d5f0 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 _0xbf75=['filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','error','send','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','Team','then','includeAll','include','findAll','rows','catch','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','Teams','getQueues','findOne','channel','isValidChannel','capitalize','Queue','toLowerCase','Queues','addQueues','Unknown\x20channel','add','removeQueues','ValidationError','remove','ids','addAgents','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','through','penalty','QueueId','Voice','findOrCreate','emit','user','online','voicePause','interface','UserVoiceQueueRt','isNil','format','TeamVoiceQueue','all','TeamVoicePrefix','upsert','spread','removeAgents','isArray','getAgents','User'];(function(_0x2b49fb,_0xa3d5bb){var _0x41dd90=function(_0x49c3d6){while(--_0x49c3d6){_0x2b49fb['push'](_0x2b49fb['shift']());}};_0x41dd90(++_0xa3d5bb);}(_0xbf75,0x13b));var _0x5bf7=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xbf75[_0xdc37a1];return _0x99b4fe;};'use strict';var emlformat=require(_0x5bf7('0x0'));var rimraf=require(_0x5bf7('0x1'));var zipdir=require(_0x5bf7('0x2'));var jsonpatch=require(_0x5bf7('0x3'));var rp=require(_0x5bf7('0x4'));var moment=require(_0x5bf7('0x5'));var BPromise=require(_0x5bf7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5bf7('0x7'));var csv=require(_0x5bf7('0x8'));var ejs=require(_0x5bf7('0x9'));var fs=require('fs');var fs_extra=require(_0x5bf7('0xa'));var _=require(_0x5bf7('0xb'));var squel=require(_0x5bf7('0xc'));var crypto=require(_0x5bf7('0xd'));var jsforce=require(_0x5bf7('0xe'));var deskjs=require(_0x5bf7('0xf'));var toCsv=require(_0x5bf7('0x8'));var querystring=require(_0x5bf7('0x10'));var Papa=require(_0x5bf7('0x11'));var Redis=require(_0x5bf7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5bf7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bf7('0x14'));var logger=require(_0x5bf7('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5bf7('0x16'))['db'];config[_0x5bf7('0x17')]=_[_0x5bf7('0x18')](config[_0x5bf7('0x17')],{'host':_0x5bf7('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5bf7('0x1a'))[_0x5bf7('0x1b')](socket);function respondWithStatusCode(_0x9b0b0a,_0x3527fb){_0x3527fb=_0x3527fb||0xcc;return function(_0x578bbc){if(_0x578bbc){return _0x9b0b0a[_0x5bf7('0x1c')](_0x3527fb);}return _0x9b0b0a[_0x5bf7('0x1d')](_0x3527fb)[_0x5bf7('0x1e')]();};}function respondWithResult(_0x434891,_0x3e5e91){_0x3e5e91=_0x3e5e91||0xc8;return function(_0x2a67f9){if(_0x2a67f9){return _0x434891[_0x5bf7('0x1d')](_0x3e5e91)[_0x5bf7('0x1f')](_0x2a67f9);}};}function respondWithFilteredResult(_0x3902ee,_0x4ad0c9){return function(_0x379faa){if(_0x379faa){var _0x39e567=typeof _0x4ad0c9['offset']===_0x5bf7('0x20')&&typeof _0x4ad0c9[_0x5bf7('0x21')]===_0x5bf7('0x20');var _0x59fe48=_0x379faa[_0x5bf7('0x22')];var _0x4b0dcd=_0x39e567?0x0:_0x4ad0c9[_0x5bf7('0x23')];var _0x3cf84a=_0x39e567?_0x379faa[_0x5bf7('0x22')]:_0x4ad0c9[_0x5bf7('0x23')]+_0x4ad0c9[_0x5bf7('0x21')];var _0x11ea94;if(_0x3cf84a>=_0x59fe48){_0x3cf84a=_0x59fe48;_0x11ea94=0xc8;}else{_0x11ea94=0xce;}_0x3902ee[_0x5bf7('0x1d')](_0x11ea94);return _0x3902ee[_0x5bf7('0x24')]('Content-Range',_0x4b0dcd+'-'+_0x3cf84a+'/'+_0x59fe48)[_0x5bf7('0x1f')](_0x379faa);}return null;};}function patchUpdates(_0x179f28){return function(_0xb9cbdf){try{jsonpatch[_0x5bf7('0x25')](_0xb9cbdf,_0x179f28,!![]);}catch(_0x4fe50a){return BPromise[_0x5bf7('0x26')](_0x4fe50a);}return _0xb9cbdf[_0x5bf7('0x27')]();};}function saveUpdates(_0x41f475,_0x1602a5){return function(_0x4e5743){if(_0x4e5743){return _0x4e5743['update'](_0x41f475)['then'](function(_0x4b43f9){return _0x4b43f9;});}return null;};}function handleEntityNotFound(_0x8e1d35,_0x33c445){return function(_0x250976){if(!_0x250976){_0x8e1d35[_0x5bf7('0x1c')](0x194);}return _0x250976;};}function handleError(_0x2e76cf,_0x525f86){_0x525f86=_0x525f86||0x1f4;return function(_0x1ea8f9){logger[_0x5bf7('0x28')](_0x1ea8f9['stack']);if(_0x1ea8f9['name']){delete _0x1ea8f9['name'];}_0x2e76cf[_0x5bf7('0x1d')](_0x525f86)[_0x5bf7('0x29')](_0x1ea8f9);};}exports[_0x5bf7('0x2a')]=function(_0x2343dd,_0x25d989){var _0x155d7a={},_0x3c9a01={},_0xc71906={'count':0x0,'rows':[]};var _0x132eb9=_[_0x5bf7('0x2b')](db['Team'][_0x5bf7('0x2c')],function(_0x184cf9){return{'name':_0x184cf9[_0x5bf7('0x2d')],'type':_0x184cf9[_0x5bf7('0x2e')][_0x5bf7('0x2f')]};});_0x3c9a01[_0x5bf7('0x30')]=_[_0x5bf7('0x2b')](_0x132eb9,_0x5bf7('0x31'));_0x3c9a01['query']=_[_0x5bf7('0x32')](_0x2343dd[_0x5bf7('0x33')]);_0x3c9a01[_0x5bf7('0x34')]=_[_0x5bf7('0x35')](_0x3c9a01['model'],_0x3c9a01[_0x5bf7('0x33')]);_0x155d7a[_0x5bf7('0x36')]=_[_0x5bf7('0x35')](_0x3c9a01['model'],qs[_0x5bf7('0x37')](_0x2343dd[_0x5bf7('0x33')]['fields']));_0x155d7a['attributes']=_0x155d7a['attributes'][_0x5bf7('0x38')]?_0x155d7a[_0x5bf7('0x36')]:_0x3c9a01[_0x5bf7('0x30')];if(!_0x2343dd[_0x5bf7('0x33')]['hasOwnProperty'](_0x5bf7('0x39'))){_0x155d7a[_0x5bf7('0x21')]=qs['limit'](_0x2343dd[_0x5bf7('0x33')]['limit']);_0x155d7a[_0x5bf7('0x23')]=qs[_0x5bf7('0x23')](_0x2343dd[_0x5bf7('0x33')][_0x5bf7('0x23')]);}_0x155d7a[_0x5bf7('0x3a')]=qs['sort'](_0x2343dd[_0x5bf7('0x33')][_0x5bf7('0x3b')]);_0x155d7a[_0x5bf7('0x3c')]=qs[_0x5bf7('0x34')](_[_0x5bf7('0x3d')](_0x2343dd[_0x5bf7('0x33')],_0x3c9a01[_0x5bf7('0x34')]),_0x132eb9);if(_0x2343dd['query']['filter']){_0x155d7a[_0x5bf7('0x3c')]=_[_0x5bf7('0x3e')](_0x155d7a['where'],{'$or':_['map'](_0x132eb9,function(_0x47fcc0){if(_0x47fcc0['type']!==_0x5bf7('0x3f')){var _0x1b582a={};_0x1b582a[_0x47fcc0[_0x5bf7('0x31')]]={'$like':'%'+_0x2343dd[_0x5bf7('0x33')]['filter']+'%'};return _0x1b582a;}})});}_0x155d7a=_[_0x5bf7('0x3e')]({},_0x155d7a,_0x2343dd[_0x5bf7('0x40')]);var _0x474f86={'where':_0x155d7a[_0x5bf7('0x3c')]};return db[_0x5bf7('0x41')]['count'](_0x474f86)[_0x5bf7('0x42')](function(_0x1eb56a){_0xc71906[_0x5bf7('0x22')]=_0x1eb56a;if(_0x2343dd[_0x5bf7('0x33')][_0x5bf7('0x43')]){_0x155d7a[_0x5bf7('0x44')]=[{'all':!![]}];}return db[_0x5bf7('0x41')][_0x5bf7('0x45')](_0x155d7a);})[_0x5bf7('0x42')](function(_0x14e356){_0xc71906[_0x5bf7('0x46')]=_0x14e356;return _0xc71906;})[_0x5bf7('0x42')](respondWithFilteredResult(_0x25d989,_0x155d7a))[_0x5bf7('0x47')](handleError(_0x25d989,null));};exports['show']=function(_0x40a2c1,_0x545ccc){var _0x2663ab={'raw':![],'where':{'id':_0x40a2c1[_0x5bf7('0x48')]['id']}},_0x5d26b6={};_0x5d26b6[_0x5bf7('0x30')]=_[_0x5bf7('0x32')](db[_0x5bf7('0x41')][_0x5bf7('0x2c')]);_0x5d26b6['query']=_[_0x5bf7('0x32')](_0x40a2c1['query']);_0x5d26b6['filters']=_[_0x5bf7('0x35')](_0x5d26b6['model'],_0x5d26b6[_0x5bf7('0x33')]);_0x2663ab[_0x5bf7('0x36')]=_[_0x5bf7('0x35')](_0x5d26b6['model'],qs['fields'](_0x40a2c1['query'][_0x5bf7('0x37')]));_0x2663ab[_0x5bf7('0x36')]=_0x2663ab[_0x5bf7('0x36')][_0x5bf7('0x38')]?_0x2663ab[_0x5bf7('0x36')]:_0x5d26b6[_0x5bf7('0x30')];if(_0x40a2c1['query']['includeAll']){_0x2663ab[_0x5bf7('0x44')]=[{'all':!![]}];}_0x2663ab=_['merge']({},_0x2663ab,_0x40a2c1['options']);return db[_0x5bf7('0x41')]['find'](_0x2663ab)[_0x5bf7('0x42')](handleEntityNotFound(_0x545ccc,null))['then'](respondWithResult(_0x545ccc,null))['catch'](handleError(_0x545ccc,null));};exports[_0x5bf7('0x49')]=function(_0x5dc216,_0x56e8d9){return db['Team'][_0x5bf7('0x49')](_0x5dc216[_0x5bf7('0x4a')],{})[_0x5bf7('0x42')](function(_0x573c50){var _0x3301dc=_0x5dc216['user']['get']({'plain':!![]});if(!_0x3301dc)throw new Error(_0x5bf7('0x4b'));if(_0x3301dc[_0x5bf7('0x4c')]==='user'){var _0x1ac25d=_0x573c50[_0x5bf7('0x4d')]({'plain':!![]});var _0x5c3440='Teams';return db[_0x5bf7('0x4e')][_0x5bf7('0x4f')]({'where':{'name':_0x5c3440,'userProfileId':_0x3301dc[_0x5bf7('0x50')]},'raw':!![]})['then'](function(_0x205bd4){if(_0x205bd4&&_0x205bd4[_0x5bf7('0x51')]===0x0){return db[_0x5bf7('0x52')][_0x5bf7('0x49')]({'name':_0x1ac25d[_0x5bf7('0x31')],'resourceId':_0x1ac25d['id'],'type':_0x205bd4[_0x5bf7('0x31')],'sectionId':_0x205bd4['id']},{})[_0x5bf7('0x42')](function(){return _0x573c50;});}else{return _0x573c50;}})['catch'](function(_0x419f3e){logger[_0x5bf7('0x28')](_0x5bf7('0x53'),_0x419f3e);throw _0x419f3e;});}return _0x573c50;})[_0x5bf7('0x42')](respondWithResult(_0x56e8d9,0xc9))['catch'](handleError(_0x56e8d9,null));};exports['update']=function(_0x36f055,_0x515604){if(_0x36f055[_0x5bf7('0x4a')]['id']){delete _0x36f055[_0x5bf7('0x4a')]['id'];}return db['Team'][_0x5bf7('0x4f')]({'where':{'id':_0x36f055['params']['id']}})['then'](handleEntityNotFound(_0x515604,null))['then'](saveUpdates(_0x36f055['body'],null))[_0x5bf7('0x42')](respondWithResult(_0x515604,null))[_0x5bf7('0x47')](handleError(_0x515604,null));};exports[_0x5bf7('0x54')]=function(_0x462be6,_0x1ee7c9){var _0x490d08=_0x462be6[_0x5bf7('0x48')]['id'];var _0x40ba92=[];return db['sequelize']['transaction'](function(_0x248ec8){var _0x1f3007=_0x5bf7('0x55')+_0x490d08;return db[_0x5bf7('0x56')][_0x5bf7('0x33')](_0x1f3007,{'type':db[_0x5bf7('0x57')][_0x5bf7('0x58')][_0x5bf7('0x59')],'raw':!![],'transaction':_0x248ec8})['then'](function(_0x1ad263){_0x40ba92=_[_0x5bf7('0x2b')](_0x1ad263,function(_0x43c647){return Number(_0x43c647[_0x5bf7('0x5a')]);});})['then'](function(){var _0x551cdb=_0x5bf7('0x5b')+_0x490d08;return db['sequelize'][_0x5bf7('0x33')](_0x551cdb,{'type':db['Sequelize'][_0x5bf7('0x58')]['SELECT'],'raw':!![],'transaction':_0x248ec8});})['then'](function(_0x23f7b5){var _0x48ded7=_['map'](_0x23f7b5,function(_0x3c0f39){return Number(_0x3c0f39[_0x5bf7('0x5c')]);});return db[_0x5bf7('0x5d')][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'VoiceQueueId':{'$in':_0x48ded7}},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){var _0x3604f2=_0x5bf7('0x5e')+_0x490d08;return db[_0x5bf7('0x56')]['query'](_0x3604f2,{'type':db[_0x5bf7('0x57')][_0x5bf7('0x58')][_0x5bf7('0x59')],'raw':!![],'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(_0x53cf38){var _0x546f81=_[_0x5bf7('0x2b')](_0x53cf38,function(_0x39981e){return Number(_0x39981e[_0x5bf7('0x5f')]);});return db['UserMailQueue'][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'MailQueueId':{'$in':_0x546f81}},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){var _0x56650c=_0x5bf7('0x60')+_0x490d08;return db['sequelize']['query'](_0x56650c,{'type':db[_0x5bf7('0x57')][_0x5bf7('0x58')]['SELECT'],'raw':!![],'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(_0x6c23d9){var _0x3bf08f=_[_0x5bf7('0x2b')](_0x6c23d9,function(_0x38fe49){return Number(_0x38fe49[_0x5bf7('0x61')]);});return db[_0x5bf7('0x62')][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'SmsQueueId':{'$in':_0x3bf08f}},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){var _0x4ef193=_0x5bf7('0x63')+_0x490d08;return db[_0x5bf7('0x56')][_0x5bf7('0x33')](_0x4ef193,{'type':db[_0x5bf7('0x57')]['QueryTypes'][_0x5bf7('0x59')],'raw':!![],'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(_0x4eb8c2){var _0x278b5f=_['map'](_0x4eb8c2,function(_0x13e313){return Number(_0x13e313['ChatQueueId']);});return db[_0x5bf7('0x64')][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'ChatQueueId':{'$in':_0x278b5f}},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){var _0x38b619=_0x5bf7('0x65')+_0x490d08;return db[_0x5bf7('0x56')]['query'](_0x38b619,{'type':db[_0x5bf7('0x57')][_0x5bf7('0x58')][_0x5bf7('0x59')],'raw':!![],'transaction':_0x248ec8});})['then'](function(_0x492693){var _0x2108a6=_[_0x5bf7('0x2b')](_0x492693,function(_0x4dac2d){return Number(_0x4dac2d[_0x5bf7('0x66')]);});return db[_0x5bf7('0x67')][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'FaxQueueId':{'$in':_0x2108a6}},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){var _0x10429c='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x490d08;return db['sequelize'][_0x5bf7('0x33')](_0x10429c,{'type':db[_0x5bf7('0x57')][_0x5bf7('0x58')][_0x5bf7('0x59')],'raw':!![],'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(_0x1a85cd){var _0x19f8df=_[_0x5bf7('0x2b')](_0x1a85cd,function(_0x34aed3){return Number(_0x34aed3[_0x5bf7('0x68')]);});return db['UserOpenchannelQueue'][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'OpenchannelQueueId':{'$in':_0x19f8df}},'transaction':_0x248ec8});})['then'](function(){var _0xdbf2b4=_0x5bf7('0x69')+_0x490d08;return db['sequelize']['query'](_0xdbf2b4,{'type':db[_0x5bf7('0x57')][_0x5bf7('0x58')][_0x5bf7('0x59')],'raw':!![],'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(_0x4a412a){var _0x3ab2e2=_[_0x5bf7('0x2b')](_0x4a412a,function(_0x2e8c71){return Number(_0x2e8c71[_0x5bf7('0x6a')]);});return db[_0x5bf7('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x40ba92},'WhatsappQueueId':{'$in':_0x3ab2e2}},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){return db['TeamVoicePrefix'][_0x5bf7('0x4f')]({'where':{'TeamId':_0x490d08}});})[_0x5bf7('0x42')](function(_0x558bc6){if(_0x558bc6===null){return;}return db[_0x5bf7('0x6c')][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'VoicePrefixId':_0x558bc6[_0x5bf7('0x6d')]},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){return db[_0x5bf7('0x41')][_0x5bf7('0x54')]({'where':{'id':_0x490d08},'cascade':!![],'transaction':_0x248ec8});})['then'](function(_0x102408){if(_0x102408===0x0){_0x1ee7c9[_0x5bf7('0x1c')](0x194);}else{return db[_0x5bf7('0x52')]['destroy']({'where':{'type':_0x5bf7('0x6e'),'resourceId':_0x490d08},'cascade':!![],'transaction':_0x248ec8})['then'](function(){_0x1ee7c9['status'](0xcc)[_0x5bf7('0x1e')]();});}})[_0x5bf7('0x47')](function(_0x3a4853){_0x1ee7c9[_0x5bf7('0x1d')](0x1f4)[_0x5bf7('0x29')](_0x3a4853);});});};exports[_0x5bf7('0x6f')]=function(_0x1ffda8,_0x1fed93,_0x162256){return db[_0x5bf7('0x41')][_0x5bf7('0x70')]({'where':{'id':_0x1ffda8[_0x5bf7('0x48')]['id']}})['then'](handleEntityNotFound(_0x1fed93,null))[_0x5bf7('0x42')](function(_0x1f06d4){if(!_0x1ffda8[_0x5bf7('0x33')][_0x5bf7('0x71')]||!utils[_0x5bf7('0x72')](_0x1ffda8[_0x5bf7('0x33')][_0x5bf7('0x71')])){throw new db[(_0x5bf7('0x57'))]['ValidationError']('Unknown\x20channel');}var _0x4fd5e1={};var _0x18e956={};_0x18e956[_0x5bf7('0x30')]=_[_0x5bf7('0x32')](db[_[_0x5bf7('0x73')](_0x1ffda8[_0x5bf7('0x33')][_0x5bf7('0x71')]['toLowerCase']())+_0x5bf7('0x74')][_0x5bf7('0x2c')]);_0x18e956[_0x5bf7('0x33')]=_[_0x5bf7('0x32')](_0x1ffda8[_0x5bf7('0x33')]);_0x18e956['filters']=_[_0x5bf7('0x35')](_0x18e956[_0x5bf7('0x30')],_0x18e956[_0x5bf7('0x33')]);_0x4fd5e1[_0x5bf7('0x36')]=_[_0x5bf7('0x35')](_0x18e956[_0x5bf7('0x30')],qs[_0x5bf7('0x37')](_0x1ffda8['query']['fields']));_0x4fd5e1[_0x5bf7('0x36')]=_0x4fd5e1['attributes']['length']?_0x4fd5e1[_0x5bf7('0x36')]:_0x18e956[_0x5bf7('0x30')];_0x4fd5e1[_0x5bf7('0x21')]=qs[_0x5bf7('0x21')](_0x1ffda8[_0x5bf7('0x33')]['limit']);_0x4fd5e1[_0x5bf7('0x23')]=qs[_0x5bf7('0x23')](_0x1ffda8['query']['offset']);_0x4fd5e1[_0x5bf7('0x3a')]=qs[_0x5bf7('0x3b')](_0x1ffda8[_0x5bf7('0x33')][_0x5bf7('0x3b')]);_0x4fd5e1[_0x5bf7('0x3c')]=qs[_0x5bf7('0x34')](_[_0x5bf7('0x3d')](_0x1ffda8[_0x5bf7('0x33')],_0x18e956[_0x5bf7('0x34')]));_0x4fd5e1=_[_0x5bf7('0x3e')]({},_0x4fd5e1,_0x1ffda8[_0x5bf7('0x40')]);return _0x1f06d4[_0x5bf7('0x4d')+_['capitalize'](_0x1ffda8[_0x5bf7('0x33')][_0x5bf7('0x71')][_0x5bf7('0x75')]())+_0x5bf7('0x76')](_0x4fd5e1);})['then'](respondWithResult(_0x1fed93,null))['catch'](handleError(_0x1fed93,null));};exports[_0x5bf7('0x77')]=function(_0x3427ac,_0x371cbd,_0x8ffc73){return db[_0x5bf7('0x41')][_0x5bf7('0x70')]({'where':{'id':_0x3427ac[_0x5bf7('0x48')]['id']}})['then'](function(_0xada7b){if(_0xada7b){if(!_0x3427ac['body'][_0x5bf7('0x71')]||!utils[_0x5bf7('0x72')](_0x3427ac[_0x5bf7('0x4a')][_0x5bf7('0x71')])){throw new db[(_0x5bf7('0x57'))]['ValidationError'](_0x5bf7('0x78'));}return _0xada7b[_0x5bf7('0x79')+_['capitalize'](_0x3427ac[_0x5bf7('0x4a')][_0x5bf7('0x71')]['toLowerCase']())+'Queues'](_0x3427ac[_0x5bf7('0x4a')]['ids']);}return null;})[_0x5bf7('0x42')](handleEntityNotFound(_0x371cbd,null))[_0x5bf7('0x42')](respondWithStatusCode(_0x371cbd,null))[_0x5bf7('0x47')](handleError(_0x371cbd,null));};exports[_0x5bf7('0x7a')]=function(_0x5f5db4,_0x6eb7e9,_0x5175dd){return db['Team']['findOne']({'where':{'id':_0x5f5db4[_0x5bf7('0x48')]['id']}})[_0x5bf7('0x42')](function(_0x23a395){if(_0x23a395){if(!_0x5f5db4[_0x5bf7('0x33')][_0x5bf7('0x71')]||!utils[_0x5bf7('0x72')](_0x5f5db4[_0x5bf7('0x33')][_0x5bf7('0x71')])){throw new db[(_0x5bf7('0x57'))][(_0x5bf7('0x7b'))](_0x5bf7('0x78'));}return _0x23a395[_0x5bf7('0x7c')+_[_0x5bf7('0x73')](_0x5f5db4['query'][_0x5bf7('0x71')][_0x5bf7('0x75')]())+_0x5bf7('0x76')](_0x5f5db4['query'][_0x5bf7('0x7d')]);}return null;})[_0x5bf7('0x42')](handleEntityNotFound(_0x6eb7e9,null))[_0x5bf7('0x42')](respondWithStatusCode(_0x6eb7e9,null))[_0x5bf7('0x47')](handleError(_0x6eb7e9,null));};exports[_0x5bf7('0x7e')]=function(_0x3827a9,_0x341734){var _0x46b95a=_['isArray'](_0x3827a9[_0x5bf7('0x4a')][_0x5bf7('0x7d')])?_0x3827a9[_0x5bf7('0x4a')][_0x5bf7('0x7d')]:[_0x3827a9[_0x5bf7('0x4a')][_0x5bf7('0x7d')]];var _0x7c87=_0x3827a9[_0x5bf7('0x48')]['id'];return db[_0x5bf7('0x41')][_0x5bf7('0x4f')]({'where':{'id':_0x7c87}})[_0x5bf7('0x42')](handleEntityNotFound(_0x341734,null))[_0x5bf7('0x42')](function(_0x445a22){if(_0x445a22){var _0x49acf5=['Voice',_0x5bf7('0x7f'),_0x5bf7('0x80'),_0x5bf7('0x81'),_0x5bf7('0x82'),_0x5bf7('0x83'),_0x5bf7('0x84')];return db[_0x5bf7('0x56')][_0x5bf7('0x85')](function(_0x57d9e7){var _0x520afb=_['map'](_0x49acf5,function(_0x3584ce){var _0x343b9b={'attributes':['id',_0x5bf7('0x31')]};if(_0x3584ce==='Voice'){_0x343b9b[_0x5bf7('0x86')]={'attributes':[_0x5bf7('0x87')]};}return _0x445a22[_0x5bf7('0x4d')+_0x3584ce+'Queues'](_0x343b9b)[_0x5bf7('0x42')](function(_0x3677fe){var _0x103621=_[_0x5bf7('0x2b')](_0x3677fe,function(_0x5cc40b){var _0x576a2c=_['map'](_0x46b95a,function(_0x460abb){var _0x46f504={'where':{'UserId':_0x460abb,[_0x3584ce+_0x5bf7('0x88')]:_0x5cc40b['id']},'transaction':_0x57d9e7};if(_0x3584ce===_0x5bf7('0x89')){_0x46f504[_0x5bf7('0x18')]={'penalty':_0x5cc40b['TeamVoiceQueue'][_0x5bf7('0x87')]};}return db['User'+_0x3584ce+_0x5bf7('0x74')][_0x5bf7('0x8a')](_0x46f504)[_0x5bf7('0x42')](function(){socket[_0x5bf7('0x8b')](_0x5bf7('0x8c')+_0x3584ce+'Queue:save',{'UserId':_0x460abb,[_0x3584ce+_0x5bf7('0x88')]:_0x5cc40b['id']});if(_0x3584ce!==_0x5bf7('0x89')){return;}return db['User'][_0x5bf7('0x45')]({'where':{'id':_0x46b95a,'online':0x1},'attributes':['id',_0x5bf7('0x31'),_0x5bf7('0x8d'),_0x5bf7('0x8e'),_0x5bf7('0x8f')],'raw':!![]})['then'](function(_0x59c7c2){var _0x521330=_[_0x5bf7('0x2b')](_0x59c7c2,function(_0x45cd58){return db[_0x5bf7('0x90')]['upsert']({'membername':_0x45cd58['name'],'UserId':_0x45cd58['id'],'queue_name':_0x5cc40b[_0x5bf7('0x31')],'VoiceQueueId':_0x5cc40b['id'],'interface':_[_0x5bf7('0x91')](_0x45cd58[_0x5bf7('0x8f')])?util[_0x5bf7('0x92')]('SIP/%s',_0x45cd58[_0x5bf7('0x31')]):_0x45cd58[_0x5bf7('0x8f')],'paused':_0x45cd58[_0x5bf7('0x8e')]||![],'penalty':_0x5cc40b[_0x5bf7('0x93')]['penalty']},{'transaction':_0x57d9e7});});return Promise['all'](_0x521330);});});});return Promise[_0x5bf7('0x94')](_0x576a2c);});return Promise[_0x5bf7('0x94')](_0x103621);})[_0x5bf7('0x42')](function(){return db[_0x5bf7('0x95')][_0x5bf7('0x70')]({'where':{'teamId':_0x7c87}})['then'](function(_0x23c233){if(_0x23c233){var _0x2fc38f=_[_0x5bf7('0x2b')](_0x46b95a,function(_0x4147ac){db[_0x5bf7('0x6c')][_0x5bf7('0x96')]({'UserId':_0x4147ac,'VoicePrefixId':_0x23c233[_0x5bf7('0x6d')]});});return Promise['all'](_0x2fc38f);}});});});return Promise[_0x5bf7('0x94')](_0x520afb)[_0x5bf7('0x42')](function(){return _0x445a22[_0x5bf7('0x7e')](_0x46b95a,{'transaction':_0x57d9e7})[_0x5bf7('0x97')](function(_0x493aaf){return _0x493aaf;});});});}})['then'](respondWithResult(_0x341734,null))[_0x5bf7('0x47')](handleError(_0x341734,null));};exports[_0x5bf7('0x98')]=function(_0x1eda20,_0x3ff6f8){var _0x314386=_[_0x5bf7('0x99')](_0x1eda20['query'][_0x5bf7('0x7d')])?_0x1eda20[_0x5bf7('0x33')]['ids']:[_0x1eda20['query'][_0x5bf7('0x7d')]];var _0x514896=_0x1eda20['params']['id'];return db[_0x5bf7('0x41')][_0x5bf7('0x4f')]({'where':{'id':_0x514896}})['then'](handleEntityNotFound(_0x3ff6f8,null))[_0x5bf7('0x42')](function(_0x2d913b){if(_0x2d913b){var _0x54d56f=[_0x5bf7('0x89'),_0x5bf7('0x7f'),_0x5bf7('0x80'),_0x5bf7('0x81'),_0x5bf7('0x82'),_0x5bf7('0x83'),_0x5bf7('0x84')];return db[_0x5bf7('0x56')][_0x5bf7('0x85')](function(_0x50e7d1){var _0x43a57d=_[_0x5bf7('0x2b')](_0x54d56f,function(_0x36e490){var _0x36107e={'attributes':['id',_0x5bf7('0x31')]};return _0x2d913b['get'+_0x36e490+_0x5bf7('0x76')](_0x36107e)['then'](function(_0x5851a6){var _0x4538dd=_[_0x5bf7('0x2b')](_0x5851a6,function(_0x4345cd){return _0x4345cd[_0x5bf7('0x98')](_0x314386,{'transaction':_0x50e7d1})['then'](function(){var _0x334dc7=_[_0x5bf7('0x2b')](_0x314386,function(_0x3c967d){socket[_0x5bf7('0x8b')]('user'+_0x36e490+'Queue:remove',{'UserId':Number(_0x3c967d),[_0x36e490+_0x5bf7('0x88')]:_0x4345cd['id']});if(_0x36e490!==_0x5bf7('0x89')){return;}return db['UserVoiceQueueRt'][_0x5bf7('0x54')]({'where':{'VoiceQueueId':_0x4345cd['id'],'UserId':_0x3c967d},'transaction':_0x50e7d1});});return Promise[_0x5bf7('0x94')](_0x334dc7);});});return Promise[_0x5bf7('0x94')](_0x4538dd);});});return Promise['all'](_0x43a57d)['then'](function(){return _0x2d913b[_0x5bf7('0x98')](_0x314386,{'transaction':_0x50e7d1});})[_0x5bf7('0x42')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x514896}})[_0x5bf7('0x42')](function(_0x39fe13){if(_0x39fe13){var _0x1bb139=_[_0x5bf7('0x2b')](_0x314386,function(_0x34a6af){db[_0x5bf7('0x6c')][_0x5bf7('0x54')]({'where':{'UserId':_0x34a6af,'VoicePrefixId':_0x39fe13[_0x5bf7('0x6d')]}});});return Promise[_0x5bf7('0x94')](_0x1bb139);}});});});}})[_0x5bf7('0x42')](respondWithStatusCode(_0x3ff6f8,null))[_0x5bf7('0x47')](handleError(_0x3ff6f8,null));};exports[_0x5bf7('0x9a')]=function(_0x11b3a2,_0x1e64ef,_0x27dfc6){var _0x4330e9={};var _0x5b9d99={};var _0x3ba7cd;var _0x33f616;return db[_0x5bf7('0x41')][_0x5bf7('0x70')]({'where':{'id':_0x11b3a2['params']['id']}})[_0x5bf7('0x42')](handleEntityNotFound(_0x1e64ef,null))[_0x5bf7('0x42')](function(_0x7419a4){if(_0x7419a4){_0x3ba7cd=_0x7419a4;_0x5b9d99[_0x5bf7('0x30')]=_['keys'](db[_0x5bf7('0x9b')][_0x5bf7('0x2c')]);_0x5b9d99[_0x5bf7('0x33')]=_['keys'](_0x11b3a2['query']);_0x5b9d99[_0x5bf7('0x34')]=_[_0x5bf7('0x35')](_0x5b9d99[_0x5bf7('0x30')],_0x5b9d99[_0x5bf7('0x33')]);_0x4330e9[_0x5bf7('0x36')]=_[_0x5bf7('0x35')](_0x5b9d99[_0x5bf7('0x30')],qs['fields'](_0x11b3a2['query'][_0x5bf7('0x37')]));_0x4330e9['attributes']=_0x4330e9[_0x5bf7('0x36')]['length']?_0x4330e9[_0x5bf7('0x36')]:_0x5b9d99[_0x5bf7('0x30')];_0x4330e9[_0x5bf7('0x3a')]=qs[_0x5bf7('0x3b')](_0x11b3a2[_0x5bf7('0x33')][_0x5bf7('0x3b')]);_0x4330e9['where']=qs[_0x5bf7('0x34')](_[_0x5bf7('0x3d')](_0x11b3a2['query'],_0x5b9d99[_0x5bf7('0x34')]));if(_0x11b3a2[_0x5bf7('0x33')][_0x5bf7('0x9c')]){_0x4330e9[_0x5bf7('0x3c')]=_['merge'](_0x4330e9[_0x5bf7('0x3c')],{'$or':_[_0x5bf7('0x2b')](_0x4330e9[_0x5bf7('0x36')],function(_0x1421f5){var _0x266a7b={};_0x266a7b[_0x1421f5]={'$like':'%'+_0x11b3a2[_0x5bf7('0x33')][_0x5bf7('0x9c')]+'%'};return _0x266a7b;})});}_0x4330e9=_[_0x5bf7('0x3e')]({},_0x4330e9,_0x11b3a2[_0x5bf7('0x40')]);return _0x3ba7cd[_0x5bf7('0x9a')](_0x4330e9);}})['then'](function(_0x5a2483){if(_0x5a2483){_0x33f616=_0x5a2483[_0x5bf7('0x38')];if(!_0x11b3a2[_0x5bf7('0x33')]['hasOwnProperty']('nolimit')){_0x4330e9[_0x5bf7('0x21')]=qs[_0x5bf7('0x21')](_0x11b3a2['query']['limit']);_0x4330e9[_0x5bf7('0x23')]=qs['offset'](_0x11b3a2[_0x5bf7('0x33')]['offset']);}return _0x3ba7cd[_0x5bf7('0x9a')](_0x4330e9);}})[_0x5bf7('0x42')](function(_0x5a7567){if(_0x5a7567){return _0x5a7567?{'count':_0x33f616,'rows':_0x5a7567}:null;}})[_0x5bf7('0x42')](respondWithResult(_0x1e64ef,null))[_0x5bf7('0x47')](handleError(_0x1e64ef,null));}; \ No newline at end of file +var _0xe74e=['undefined','count','set','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','Team','includeAll','include','findAll','rows','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','destroy','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','findOne','channel','Unknown\x20channel','capitalize','toLowerCase','Queues','isValidChannel','ValidationError','ids','removeQueues','remove','isArray','Voice','Mail','Sms','Fax','Openchannel','through','penalty','QueueId','User','Queue','findOrCreate','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','TeamVoiceQueue','all','UserVoicePrefix','addAgents','spread','removeAgents','Chat','Whatsapp','emit','Queue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','end','status','json','offset','limit'];(function(_0x3cca50,_0x17b2c9){var _0x9915a0=function(_0x3c4a45){while(--_0x3c4a45){_0x3cca50['push'](_0x3cca50['shift']());}};_0x9915a0(++_0x17b2c9);}(_0xe74e,0x112));var _0xee74=function(_0x30be91,_0x4ee78a){_0x30be91=_0x30be91-0x0;var _0x52a73b=_0xe74e[_0x30be91];return _0x52a73b;};'use strict';var emlformat=require(_0xee74('0x0'));var rimraf=require(_0xee74('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee74('0x2'));var rp=require('request-promise');var moment=require(_0xee74('0x3'));var BPromise=require(_0xee74('0x4'));var Mustache=require(_0xee74('0x5'));var util=require('util');var path=require(_0xee74('0x6'));var sox=require(_0xee74('0x7'));var csv=require(_0xee74('0x8'));var ejs=require(_0xee74('0x9'));var fs=require('fs');var fs_extra=require(_0xee74('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xee74('0xb'));var jsforce=require(_0xee74('0xc'));var deskjs=require(_0xee74('0xd'));var toCsv=require(_0xee74('0x8'));var querystring=require(_0xee74('0xe'));var Papa=require(_0xee74('0xf'));var Redis=require(_0xee74('0x10'));var authService=require(_0xee74('0x11'));var qs=require(_0xee74('0x12'));var as=require(_0xee74('0x13'));var hardwareService=require(_0xee74('0x14'));var logger=require(_0xee74('0x15'))(_0xee74('0x16'));var utils=require(_0xee74('0x17'));var config=require(_0xee74('0x18'));var licenseUtil=require(_0xee74('0x19'));var db=require(_0xee74('0x1a'))['db'];config[_0xee74('0x1b')]=_[_0xee74('0x1c')](config[_0xee74('0x1b')],{'host':_0xee74('0x1d'),'port':0x18eb});var socket=require(_0xee74('0x1e'))(new Redis(config['redis']));require(_0xee74('0x1f'))['register'](socket);function respondWithStatusCode(_0x45e06a,_0x4bb1d6){_0x4bb1d6=_0x4bb1d6||0xcc;return function(_0x532dc9){if(_0x532dc9){return _0x45e06a[_0xee74('0x20')](_0x4bb1d6);}return _0x45e06a['status'](_0x4bb1d6)[_0xee74('0x21')]();};}function respondWithResult(_0x34ef45,_0x1ab246){_0x1ab246=_0x1ab246||0xc8;return function(_0x34386f){if(_0x34386f){return _0x34ef45[_0xee74('0x22')](_0x1ab246)[_0xee74('0x23')](_0x34386f);}};}function respondWithFilteredResult(_0x5ad6e7,_0x28e93b){return function(_0x3fc7c4){if(_0x3fc7c4){var _0x144cdc=typeof _0x28e93b[_0xee74('0x24')]==='undefined'&&typeof _0x28e93b[_0xee74('0x25')]===_0xee74('0x26');var _0xd3bd09=_0x3fc7c4['count'];var _0x43de42=_0x144cdc?0x0:_0x28e93b[_0xee74('0x24')];var _0x56ea18=_0x144cdc?_0x3fc7c4[_0xee74('0x27')]:_0x28e93b[_0xee74('0x24')]+_0x28e93b[_0xee74('0x25')];var _0x4f3859;if(_0x56ea18>=_0xd3bd09){_0x56ea18=_0xd3bd09;_0x4f3859=0xc8;}else{_0x4f3859=0xce;}_0x5ad6e7['status'](_0x4f3859);return _0x5ad6e7[_0xee74('0x28')]('Content-Range',_0x43de42+'-'+_0x56ea18+'/'+_0xd3bd09)[_0xee74('0x23')](_0x3fc7c4);}return null;};}function patchUpdates(_0x26e206){return function(_0x280393){try{jsonpatch[_0xee74('0x29')](_0x280393,_0x26e206,!![]);}catch(_0x3817d0){return BPromise['reject'](_0x3817d0);}return _0x280393[_0xee74('0x2a')]();};}function saveUpdates(_0x33e33d,_0x36e3b5){return function(_0x298007){if(_0x298007){return _0x298007[_0xee74('0x2b')](_0x33e33d)[_0xee74('0x2c')](function(_0x10b993){return _0x10b993;});}return null;};}function handleEntityNotFound(_0x2d35b7,_0x5bb615){return function(_0x397b87){if(!_0x397b87){_0x2d35b7[_0xee74('0x20')](0x194);}return _0x397b87;};}function handleError(_0x5b01ca,_0x4dde46){_0x4dde46=_0x4dde46||0x1f4;return function(_0x4be60d){logger[_0xee74('0x2d')](_0x4be60d[_0xee74('0x2e')]);if(_0x4be60d[_0xee74('0x2f')]){delete _0x4be60d['name'];}_0x5b01ca['status'](_0x4dde46)[_0xee74('0x30')](_0x4be60d);};}exports[_0xee74('0x31')]=function(_0x1a768c,_0x6d559c){var _0x42a942={},_0x5d0844={},_0x25251a={'count':0x0,'rows':[]};var _0x24921c=_[_0xee74('0x32')](db['Team'][_0xee74('0x33')],function(_0x4078ba){return{'name':_0x4078ba[_0xee74('0x34')],'type':_0x4078ba[_0xee74('0x35')][_0xee74('0x36')]};});_0x5d0844['model']=_[_0xee74('0x32')](_0x24921c,_0xee74('0x2f'));_0x5d0844[_0xee74('0x37')]=_[_0xee74('0x38')](_0x1a768c['query']);_0x5d0844[_0xee74('0x39')]=_[_0xee74('0x3a')](_0x5d0844[_0xee74('0x3b')],_0x5d0844[_0xee74('0x37')]);_0x42a942[_0xee74('0x3c')]=_[_0xee74('0x3a')](_0x5d0844[_0xee74('0x3b')],qs[_0xee74('0x3d')](_0x1a768c['query']['fields']));_0x42a942[_0xee74('0x3c')]=_0x42a942[_0xee74('0x3c')][_0xee74('0x3e')]?_0x42a942['attributes']:_0x5d0844[_0xee74('0x3b')];if(!_0x1a768c[_0xee74('0x37')][_0xee74('0x3f')]('nolimit')){_0x42a942[_0xee74('0x25')]=qs[_0xee74('0x25')](_0x1a768c[_0xee74('0x37')]['limit']);_0x42a942['offset']=qs[_0xee74('0x24')](_0x1a768c[_0xee74('0x37')][_0xee74('0x24')]);}_0x42a942[_0xee74('0x40')]=qs['sort'](_0x1a768c[_0xee74('0x37')][_0xee74('0x41')]);_0x42a942[_0xee74('0x42')]=qs[_0xee74('0x39')](_[_0xee74('0x43')](_0x1a768c[_0xee74('0x37')],_0x5d0844[_0xee74('0x39')]),_0x24921c);if(_0x1a768c[_0xee74('0x37')][_0xee74('0x44')]){_0x42a942[_0xee74('0x42')]=_[_0xee74('0x45')](_0x42a942[_0xee74('0x42')],{'$or':_[_0xee74('0x32')](_0x24921c,function(_0x36f666){if(_0x36f666['type']!==_0xee74('0x46')){var _0x3d7615={};_0x3d7615[_0x36f666[_0xee74('0x2f')]]={'$like':'%'+_0x1a768c[_0xee74('0x37')]['filter']+'%'};return _0x3d7615;}})});}_0x42a942=_[_0xee74('0x45')]({},_0x42a942,_0x1a768c['options']);var _0x21fcc6={'where':_0x42a942[_0xee74('0x42')]};return db[_0xee74('0x47')][_0xee74('0x27')](_0x21fcc6)[_0xee74('0x2c')](function(_0x3f12f7){_0x25251a['count']=_0x3f12f7;if(_0x1a768c[_0xee74('0x37')][_0xee74('0x48')]){_0x42a942[_0xee74('0x49')]=[{'all':!![]}];}return db[_0xee74('0x47')][_0xee74('0x4a')](_0x42a942);})['then'](function(_0x5e965a){_0x25251a[_0xee74('0x4b')]=_0x5e965a;return _0x25251a;})[_0xee74('0x2c')](respondWithFilteredResult(_0x6d559c,_0x42a942))[_0xee74('0x4c')](handleError(_0x6d559c,null));};exports['show']=function(_0x53f4e3,_0x304057){var _0x36165f={'raw':![],'where':{'id':_0x53f4e3[_0xee74('0x4d')]['id']}},_0x14b899={};_0x14b899['model']=_[_0xee74('0x38')](db[_0xee74('0x47')]['rawAttributes']);_0x14b899[_0xee74('0x37')]=_[_0xee74('0x38')](_0x53f4e3[_0xee74('0x37')]);_0x14b899[_0xee74('0x39')]=_[_0xee74('0x3a')](_0x14b899[_0xee74('0x3b')],_0x14b899[_0xee74('0x37')]);_0x36165f[_0xee74('0x3c')]=_[_0xee74('0x3a')](_0x14b899[_0xee74('0x3b')],qs[_0xee74('0x3d')](_0x53f4e3[_0xee74('0x37')]['fields']));_0x36165f[_0xee74('0x3c')]=_0x36165f[_0xee74('0x3c')][_0xee74('0x3e')]?_0x36165f[_0xee74('0x3c')]:_0x14b899[_0xee74('0x3b')];if(_0x53f4e3[_0xee74('0x37')][_0xee74('0x48')]){_0x36165f[_0xee74('0x49')]=[{'all':!![]}];}_0x36165f=_['merge']({},_0x36165f,_0x53f4e3[_0xee74('0x4e')]);return db['Team'][_0xee74('0x4f')](_0x36165f)[_0xee74('0x2c')](handleEntityNotFound(_0x304057,null))['then'](respondWithResult(_0x304057,null))[_0xee74('0x4c')](handleError(_0x304057,null));};exports[_0xee74('0x50')]=function(_0x4d1e0d,_0x3af600){return db[_0xee74('0x47')][_0xee74('0x50')](_0x4d1e0d[_0xee74('0x51')],{})[_0xee74('0x2c')](function(_0x4ee4cd){var _0x30c155=_0x4d1e0d[_0xee74('0x52')]['get']({'plain':!![]});if(!_0x30c155)throw new Error(_0xee74('0x53'));if(_0x30c155[_0xee74('0x54')]===_0xee74('0x52')){var _0x324ec7=_0x4ee4cd[_0xee74('0x55')]({'plain':!![]});var _0x80e1e='Teams';return db[_0xee74('0x56')]['find']({'where':{'name':_0x80e1e,'userProfileId':_0x30c155['userProfileId']},'raw':!![]})['then'](function(_0x45d611){if(_0x45d611&&_0x45d611['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x324ec7['name'],'resourceId':_0x324ec7['id'],'type':_0x45d611[_0xee74('0x2f')],'sectionId':_0x45d611['id']},{})[_0xee74('0x2c')](function(){return _0x4ee4cd;});}else{return _0x4ee4cd;}})['catch'](function(_0x24845e){logger[_0xee74('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24845e);throw _0x24845e;});}return _0x4ee4cd;})[_0xee74('0x2c')](respondWithResult(_0x3af600,0xc9))['catch'](handleError(_0x3af600,null));};exports[_0xee74('0x2b')]=function(_0x14c724,_0xbee9fe){if(_0x14c724['body']['id']){delete _0x14c724['body']['id'];}return db[_0xee74('0x47')]['find']({'where':{'id':_0x14c724[_0xee74('0x4d')]['id']}})['then'](handleEntityNotFound(_0xbee9fe,null))[_0xee74('0x2c')](saveUpdates(_0x14c724[_0xee74('0x51')],null))[_0xee74('0x2c')](respondWithResult(_0xbee9fe,null))['catch'](handleError(_0xbee9fe,null));};exports['destroy']=function(_0x35ff35,_0x29eae9){var _0x508d68=_0x35ff35[_0xee74('0x4d')]['id'];var _0x42a53d=[];return db[_0xee74('0x57')][_0xee74('0x58')](function(_0x3b1a71){var _0xe01559=_0xee74('0x59')+_0x508d68;return db[_0xee74('0x57')][_0xee74('0x37')](_0xe01559,{'type':db['Sequelize'][_0xee74('0x5a')][_0xee74('0x5b')],'raw':!![],'transaction':_0x3b1a71})[_0xee74('0x2c')](function(_0x3e29b3){_0x42a53d=_[_0xee74('0x32')](_0x3e29b3,function(_0x2410ff){return Number(_0x2410ff[_0xee74('0x5c')]);});})[_0xee74('0x2c')](function(){var _0x4dc941=_0xee74('0x5d')+_0x508d68;return db[_0xee74('0x57')][_0xee74('0x37')](_0x4dc941,{'type':db[_0xee74('0x5e')][_0xee74('0x5a')][_0xee74('0x5b')],'raw':!![],'transaction':_0x3b1a71});})[_0xee74('0x2c')](function(_0x17779b){var _0x4ec16e=_[_0xee74('0x32')](_0x17779b,function(_0x557d48){return Number(_0x557d48['VoiceQueueId']);});return db[_0xee74('0x5f')]['destroy']({'where':{'UserId':{'$in':_0x42a53d},'VoiceQueueId':{'$in':_0x4ec16e}},'transaction':_0x3b1a71});})[_0xee74('0x2c')](function(){var _0x999eca=_0xee74('0x60')+_0x508d68;return db[_0xee74('0x57')][_0xee74('0x37')](_0x999eca,{'type':db[_0xee74('0x5e')][_0xee74('0x5a')][_0xee74('0x5b')],'raw':!![],'transaction':_0x3b1a71});})[_0xee74('0x2c')](function(_0x12e613){var _0x2d3009=_['map'](_0x12e613,function(_0x19603d){return Number(_0x19603d[_0xee74('0x61')]);});return db[_0xee74('0x62')]['destroy']({'where':{'UserId':{'$in':_0x42a53d},'MailQueueId':{'$in':_0x2d3009}},'transaction':_0x3b1a71});})[_0xee74('0x2c')](function(){var _0x1eae10=_0xee74('0x63')+_0x508d68;return db['sequelize'][_0xee74('0x37')](_0x1eae10,{'type':db[_0xee74('0x5e')][_0xee74('0x5a')]['SELECT'],'raw':!![],'transaction':_0x3b1a71});})[_0xee74('0x2c')](function(_0x170a89){var _0x54288c=_[_0xee74('0x32')](_0x170a89,function(_0x646f5c){return Number(_0x646f5c[_0xee74('0x64')]);});return db[_0xee74('0x65')]['destroy']({'where':{'UserId':{'$in':_0x42a53d},'SmsQueueId':{'$in':_0x54288c}},'transaction':_0x3b1a71});})[_0xee74('0x2c')](function(){var _0x2343b9=_0xee74('0x66')+_0x508d68;return db['sequelize']['query'](_0x2343b9,{'type':db[_0xee74('0x5e')][_0xee74('0x5a')][_0xee74('0x5b')],'raw':!![],'transaction':_0x3b1a71});})[_0xee74('0x2c')](function(_0xd70822){var _0x5e39ad=_['map'](_0xd70822,function(_0x4cffa3){return Number(_0x4cffa3['ChatQueueId']);});return db[_0xee74('0x67')][_0xee74('0x68')]({'where':{'UserId':{'$in':_0x42a53d},'ChatQueueId':{'$in':_0x5e39ad}},'transaction':_0x3b1a71});})[_0xee74('0x2c')](function(){var _0x1a71ab=_0xee74('0x69')+_0x508d68;return db['sequelize']['query'](_0x1a71ab,{'type':db['Sequelize'][_0xee74('0x5a')][_0xee74('0x5b')],'raw':!![],'transaction':_0x3b1a71});})['then'](function(_0x2af9c3){var _0x31fa20=_['map'](_0x2af9c3,function(_0x243abd){return Number(_0x243abd[_0xee74('0x6a')]);});return db[_0xee74('0x6b')][_0xee74('0x68')]({'where':{'UserId':{'$in':_0x42a53d},'FaxQueueId':{'$in':_0x31fa20}},'transaction':_0x3b1a71});})[_0xee74('0x2c')](function(){var _0x39d68f='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x508d68;return db[_0xee74('0x57')]['query'](_0x39d68f,{'type':db['Sequelize']['QueryTypes'][_0xee74('0x5b')],'raw':!![],'transaction':_0x3b1a71});})[_0xee74('0x2c')](function(_0x4bdf07){var _0x5c1d17=_[_0xee74('0x32')](_0x4bdf07,function(_0x2668f7){return Number(_0x2668f7['OpenchannelQueueId']);});return db[_0xee74('0x6c')][_0xee74('0x68')]({'where':{'UserId':{'$in':_0x42a53d},'OpenchannelQueueId':{'$in':_0x5c1d17}},'transaction':_0x3b1a71});})['then'](function(){var _0x4a30ca=_0xee74('0x6d')+_0x508d68;return db[_0xee74('0x57')][_0xee74('0x37')](_0x4a30ca,{'type':db[_0xee74('0x5e')][_0xee74('0x5a')]['SELECT'],'raw':!![],'transaction':_0x3b1a71});})['then'](function(_0x88e991){var _0x52bf9e=_['map'](_0x88e991,function(_0x2f6597){return Number(_0x2f6597[_0xee74('0x6e')]);});return db[_0xee74('0x6f')][_0xee74('0x68')]({'where':{'UserId':{'$in':_0x42a53d},'WhatsappQueueId':{'$in':_0x52bf9e}},'transaction':_0x3b1a71});})[_0xee74('0x2c')](function(){return db[_0xee74('0x70')]['find']({'where':{'TeamId':_0x508d68}});})[_0xee74('0x2c')](function(_0x2191cb){if(_0x2191cb===null){return;}return db['UserVoicePrefix'][_0xee74('0x68')]({'where':{'UserId':{'$in':_0x42a53d},'VoicePrefixId':_0x2191cb[_0xee74('0x71')]},'transaction':_0x3b1a71});})['then'](function(){return db[_0xee74('0x47')]['destroy']({'where':{'id':_0x508d68},'cascade':!![],'transaction':_0x3b1a71});})['then'](function(_0x25394b){if(_0x25394b===0x0){_0x29eae9[_0xee74('0x20')](0x194);}else{return db[_0xee74('0x72')][_0xee74('0x68')]({'where':{'type':'Teams','resourceId':_0x508d68},'cascade':!![],'transaction':_0x3b1a71})[_0xee74('0x2c')](function(){_0x29eae9['status'](0xcc)[_0xee74('0x21')]();});}})[_0xee74('0x4c')](function(_0x5a435d){_0x29eae9[_0xee74('0x22')](0x1f4)[_0xee74('0x30')](_0x5a435d);});});};exports[_0xee74('0x73')]=function(_0x30cd35,_0x5381b9,_0x53509d){return db[_0xee74('0x47')][_0xee74('0x74')]({'where':{'id':_0x30cd35[_0xee74('0x4d')]['id']}})[_0xee74('0x2c')](handleEntityNotFound(_0x5381b9,null))[_0xee74('0x2c')](function(_0x198d6b){if(!_0x30cd35[_0xee74('0x37')][_0xee74('0x75')]||!utils['isValidChannel'](_0x30cd35[_0xee74('0x37')]['channel'])){throw new db[(_0xee74('0x5e'))]['ValidationError'](_0xee74('0x76'));}var _0x2f6b78={};var _0x4cde64={};_0x4cde64['model']=_[_0xee74('0x38')](db[_[_0xee74('0x77')](_0x30cd35[_0xee74('0x37')][_0xee74('0x75')][_0xee74('0x78')]())+'Queue']['rawAttributes']);_0x4cde64[_0xee74('0x37')]=_[_0xee74('0x38')](_0x30cd35[_0xee74('0x37')]);_0x4cde64[_0xee74('0x39')]=_[_0xee74('0x3a')](_0x4cde64[_0xee74('0x3b')],_0x4cde64['query']);_0x2f6b78[_0xee74('0x3c')]=_[_0xee74('0x3a')](_0x4cde64['model'],qs[_0xee74('0x3d')](_0x30cd35['query'][_0xee74('0x3d')]));_0x2f6b78[_0xee74('0x3c')]=_0x2f6b78[_0xee74('0x3c')][_0xee74('0x3e')]?_0x2f6b78[_0xee74('0x3c')]:_0x4cde64['model'];_0x2f6b78[_0xee74('0x25')]=qs[_0xee74('0x25')](_0x30cd35[_0xee74('0x37')][_0xee74('0x25')]);_0x2f6b78[_0xee74('0x24')]=qs[_0xee74('0x24')](_0x30cd35[_0xee74('0x37')]['offset']);_0x2f6b78[_0xee74('0x40')]=qs[_0xee74('0x41')](_0x30cd35['query']['sort']);_0x2f6b78[_0xee74('0x42')]=qs[_0xee74('0x39')](_[_0xee74('0x43')](_0x30cd35[_0xee74('0x37')],_0x4cde64[_0xee74('0x39')]));_0x2f6b78=_['merge']({},_0x2f6b78,_0x30cd35[_0xee74('0x4e')]);return _0x198d6b[_0xee74('0x55')+_[_0xee74('0x77')](_0x30cd35[_0xee74('0x37')]['channel']['toLowerCase']())+_0xee74('0x79')](_0x2f6b78);})[_0xee74('0x2c')](respondWithResult(_0x5381b9,null))['catch'](handleError(_0x5381b9,null));};exports['addQueues']=function(_0x14cdeb,_0x1d0498,_0x18235c){return db['Team'][_0xee74('0x74')]({'where':{'id':_0x14cdeb[_0xee74('0x4d')]['id']}})[_0xee74('0x2c')](function(_0x3013d5){if(_0x3013d5){if(!_0x14cdeb[_0xee74('0x51')][_0xee74('0x75')]||!utils[_0xee74('0x7a')](_0x14cdeb['body'][_0xee74('0x75')])){throw new db[(_0xee74('0x5e'))][(_0xee74('0x7b'))](_0xee74('0x76'));}return _0x3013d5['add'+_[_0xee74('0x77')](_0x14cdeb[_0xee74('0x51')][_0xee74('0x75')][_0xee74('0x78')]())+'Queues'](_0x14cdeb[_0xee74('0x51')][_0xee74('0x7c')]);}return null;})[_0xee74('0x2c')](handleEntityNotFound(_0x1d0498,null))[_0xee74('0x2c')](respondWithStatusCode(_0x1d0498,null))[_0xee74('0x4c')](handleError(_0x1d0498,null));};exports[_0xee74('0x7d')]=function(_0x5a83ae,_0x41bb7a,_0x45a077){return db[_0xee74('0x47')][_0xee74('0x74')]({'where':{'id':_0x5a83ae[_0xee74('0x4d')]['id']}})[_0xee74('0x2c')](function(_0x90fc7c){if(_0x90fc7c){if(!_0x5a83ae[_0xee74('0x37')][_0xee74('0x75')]||!utils[_0xee74('0x7a')](_0x5a83ae[_0xee74('0x37')][_0xee74('0x75')])){throw new db[(_0xee74('0x5e'))][(_0xee74('0x7b'))](_0xee74('0x76'));}return _0x90fc7c[_0xee74('0x7e')+_[_0xee74('0x77')](_0x5a83ae[_0xee74('0x37')][_0xee74('0x75')][_0xee74('0x78')]())+_0xee74('0x79')](_0x5a83ae['query'][_0xee74('0x7c')]);}return null;})[_0xee74('0x2c')](handleEntityNotFound(_0x41bb7a,null))['then'](respondWithStatusCode(_0x41bb7a,null))[_0xee74('0x4c')](handleError(_0x41bb7a,null));};exports['addAgents']=function(_0x412195,_0xb6485a){var _0x275fbe=_[_0xee74('0x7f')](_0x412195['body'][_0xee74('0x7c')])?_0x412195[_0xee74('0x51')]['ids']:[_0x412195[_0xee74('0x51')][_0xee74('0x7c')]];var _0x3d1ad3=_0x412195[_0xee74('0x4d')]['id'];return db[_0xee74('0x47')][_0xee74('0x4f')]({'where':{'id':_0x3d1ad3}})[_0xee74('0x2c')](handleEntityNotFound(_0xb6485a,null))[_0xee74('0x2c')](function(_0x1fc7a5){if(_0x1fc7a5){var _0x4897e3=[_0xee74('0x80'),'Chat',_0xee74('0x81'),_0xee74('0x82'),_0xee74('0x83'),_0xee74('0x84'),'Whatsapp'];return db['sequelize'][_0xee74('0x58')](function(_0x405f94){var _0x4efa93=_[_0xee74('0x32')](_0x4897e3,function(_0x17f838){var _0x3e9612={'attributes':['id',_0xee74('0x2f')]};if(_0x17f838==='Voice'){_0x3e9612[_0xee74('0x85')]={'attributes':[_0xee74('0x86')]};}return _0x1fc7a5['get'+_0x17f838+_0xee74('0x79')](_0x3e9612)['then'](function(_0x114fbb){var _0x5da9d7=_[_0xee74('0x32')](_0x114fbb,function(_0x81b2b7){var _0x2388c1=_['map'](_0x275fbe,function(_0x1404f0){var _0x503444={'where':{'UserId':_0x1404f0,[_0x17f838+_0xee74('0x87')]:_0x81b2b7['id']},'transaction':_0x405f94};if(_0x17f838===_0xee74('0x80')){_0x503444[_0xee74('0x1c')]={'penalty':_0x81b2b7['TeamVoiceQueue'][_0xee74('0x86')]};}return db[_0xee74('0x88')+_0x17f838+_0xee74('0x89')][_0xee74('0x8a')](_0x503444)[_0xee74('0x2c')](function(){socket['emit'](_0xee74('0x52')+_0x17f838+'Queue:save',{'UserId':_0x1404f0,[_0x17f838+'QueueId']:_0x81b2b7['id']});if(_0x17f838!==_0xee74('0x80')){return;}return db[_0xee74('0x88')][_0xee74('0x4a')]({'where':{'id':_0x275fbe,'online':0x1},'attributes':['id','name',_0xee74('0x8b'),_0xee74('0x8c'),_0xee74('0x8d')],'raw':!![]})[_0xee74('0x2c')](function(_0x2540b3){var _0x151dcf=_[_0xee74('0x32')](_0x2540b3,function(_0x3cfb4d){return db[_0xee74('0x8e')][_0xee74('0x8f')]({'membername':_0x3cfb4d[_0xee74('0x2f')],'UserId':_0x3cfb4d['id'],'queue_name':_0x81b2b7['name'],'VoiceQueueId':_0x81b2b7['id'],'interface':_[_0xee74('0x90')](_0x3cfb4d['interface'])?util['format']('SIP/%s',_0x3cfb4d[_0xee74('0x2f')]):_0x3cfb4d['interface'],'paused':_0x3cfb4d[_0xee74('0x8c')]||![],'penalty':_0x81b2b7[_0xee74('0x91')][_0xee74('0x86')]},{'transaction':_0x405f94});});return Promise[_0xee74('0x92')](_0x151dcf);});});});return Promise[_0xee74('0x92')](_0x2388c1);});return Promise[_0xee74('0x92')](_0x5da9d7);})[_0xee74('0x2c')](function(){return db['TeamVoicePrefix'][_0xee74('0x74')]({'where':{'teamId':_0x3d1ad3}})[_0xee74('0x2c')](function(_0x1f5bba){if(_0x1f5bba){var _0x23d069=_[_0xee74('0x32')](_0x275fbe,function(_0x15e8a4){db[_0xee74('0x93')]['upsert']({'UserId':_0x15e8a4,'VoicePrefixId':_0x1f5bba['VoicePrefixId']});});return Promise[_0xee74('0x92')](_0x23d069);}});});});return Promise['all'](_0x4efa93)['then'](function(){return _0x1fc7a5[_0xee74('0x94')](_0x275fbe,{'transaction':_0x405f94})[_0xee74('0x95')](function(_0x32e6c9){return _0x32e6c9;});});});}})[_0xee74('0x2c')](respondWithResult(_0xb6485a,null))['catch'](handleError(_0xb6485a,null));};exports[_0xee74('0x96')]=function(_0x471237,_0x19daa5){var _0x39f606=_['isArray'](_0x471237[_0xee74('0x37')][_0xee74('0x7c')])?_0x471237[_0xee74('0x37')][_0xee74('0x7c')]:[_0x471237[_0xee74('0x37')][_0xee74('0x7c')]];var _0x1e9c37=_0x471237[_0xee74('0x4d')]['id'];return db[_0xee74('0x47')][_0xee74('0x4f')]({'where':{'id':_0x1e9c37}})[_0xee74('0x2c')](handleEntityNotFound(_0x19daa5,null))[_0xee74('0x2c')](function(_0x5dab4c){if(_0x5dab4c){var _0x5d0b36=[_0xee74('0x80'),_0xee74('0x97'),_0xee74('0x81'),'Sms',_0xee74('0x83'),'Openchannel',_0xee74('0x98')];return db[_0xee74('0x57')][_0xee74('0x58')](function(_0x41332e){var _0x19ff91=_[_0xee74('0x32')](_0x5d0b36,function(_0x162926){var _0x33e87e={'attributes':['id',_0xee74('0x2f')]};return _0x5dab4c[_0xee74('0x55')+_0x162926+_0xee74('0x79')](_0x33e87e)[_0xee74('0x2c')](function(_0x5089eb){var _0xcde4da=_[_0xee74('0x32')](_0x5089eb,function(_0x41c8ca){return _0x41c8ca['removeAgents'](_0x39f606,{'transaction':_0x41332e})[_0xee74('0x2c')](function(){var _0x418039=_[_0xee74('0x32')](_0x39f606,function(_0x11f6b8){socket[_0xee74('0x99')](_0xee74('0x52')+_0x162926+_0xee74('0x9a'),{'UserId':Number(_0x11f6b8),[_0x162926+_0xee74('0x87')]:_0x41c8ca['id']});if(_0x162926!==_0xee74('0x80')){return;}return db[_0xee74('0x8e')][_0xee74('0x68')]({'where':{'VoiceQueueId':_0x41c8ca['id'],'UserId':_0x11f6b8},'transaction':_0x41332e});});return Promise['all'](_0x418039);});});return Promise['all'](_0xcde4da);});});return Promise['all'](_0x19ff91)['then'](function(){return _0x5dab4c[_0xee74('0x96')](_0x39f606,{'transaction':_0x41332e});})['then'](function(){return db[_0xee74('0x70')]['findOne']({'where':{'teamId':_0x1e9c37}})[_0xee74('0x2c')](function(_0x4b3db8){if(_0x4b3db8){var _0x5e5571=_[_0xee74('0x32')](_0x39f606,function(_0xffd0c5){db['UserVoicePrefix'][_0xee74('0x68')]({'where':{'UserId':_0xffd0c5,'VoicePrefixId':_0x4b3db8['VoicePrefixId']}});});return Promise['all'](_0x5e5571);}});});});}})[_0xee74('0x2c')](respondWithStatusCode(_0x19daa5,null))[_0xee74('0x4c')](handleError(_0x19daa5,null));};exports[_0xee74('0x9b')]=function(_0x4a19a8,_0x34da16,_0x4b81d6){var _0x4063f1={};var _0x22f326={};var _0x218681;var _0xd90586;return db[_0xee74('0x47')][_0xee74('0x74')]({'where':{'id':_0x4a19a8['params']['id']}})[_0xee74('0x2c')](handleEntityNotFound(_0x34da16,null))[_0xee74('0x2c')](function(_0x3ad236){if(_0x3ad236){_0x218681=_0x3ad236;_0x22f326['model']=_[_0xee74('0x38')](db[_0xee74('0x88')]['rawAttributes']);_0x22f326[_0xee74('0x37')]=_[_0xee74('0x38')](_0x4a19a8[_0xee74('0x37')]);_0x22f326[_0xee74('0x39')]=_[_0xee74('0x3a')](_0x22f326[_0xee74('0x3b')],_0x22f326[_0xee74('0x37')]);_0x4063f1[_0xee74('0x3c')]=_[_0xee74('0x3a')](_0x22f326[_0xee74('0x3b')],qs[_0xee74('0x3d')](_0x4a19a8['query']['fields']));_0x4063f1['attributes']=_0x4063f1[_0xee74('0x3c')]['length']?_0x4063f1[_0xee74('0x3c')]:_0x22f326[_0xee74('0x3b')];_0x4063f1[_0xee74('0x40')]=qs[_0xee74('0x41')](_0x4a19a8[_0xee74('0x37')][_0xee74('0x41')]);_0x4063f1[_0xee74('0x42')]=qs[_0xee74('0x39')](_['pick'](_0x4a19a8[_0xee74('0x37')],_0x22f326[_0xee74('0x39')]));if(_0x4a19a8['query'][_0xee74('0x44')]){_0x4063f1['where']=_[_0xee74('0x45')](_0x4063f1[_0xee74('0x42')],{'$or':_[_0xee74('0x32')](_0x4063f1[_0xee74('0x3c')],function(_0x47c070){var _0x4ad147={};_0x4ad147[_0x47c070]={'$like':'%'+_0x4a19a8[_0xee74('0x37')][_0xee74('0x44')]+'%'};return _0x4ad147;})});}_0x4063f1=_['merge']({},_0x4063f1,_0x4a19a8[_0xee74('0x4e')]);return _0x218681[_0xee74('0x9b')](_0x4063f1);}})[_0xee74('0x2c')](function(_0x4c7799){if(_0x4c7799){_0xd90586=_0x4c7799[_0xee74('0x3e')];if(!_0x4a19a8[_0xee74('0x37')][_0xee74('0x3f')]('nolimit')){_0x4063f1[_0xee74('0x25')]=qs['limit'](_0x4a19a8[_0xee74('0x37')][_0xee74('0x25')]);_0x4063f1[_0xee74('0x24')]=qs[_0xee74('0x24')](_0x4a19a8[_0xee74('0x37')]['offset']);}return _0x218681[_0xee74('0x9b')](_0x4063f1);}})[_0xee74('0x2c')](function(_0x5ccc07){if(_0x5ccc07){return _0x5ccc07?{'count':_0xd90586,'rows':_0x5ccc07}:null;}})[_0xee74('0x2c')](respondWithResult(_0x34da16,null))[_0xee74('0x4c')](handleError(_0x34da16,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index cd1f042..cc9219f 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 _0xc00d=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Team'];(function(_0x4930da,_0x2f5b8c){var _0x44bbdb=function(_0x1e0e52){while(--_0x1e0e52){_0x4930da['push'](_0x4930da['shift']());}};_0x44bbdb(++_0x2f5b8c);}(_0xc00d,0x11d));var _0xdc00=function(_0x41e051,_0x19b802){_0x41e051=_0x41e051-0x0;var _0x29e55b=_0xc00d[_0x41e051];return _0x29e55b;};'use strict';var EventEmitter=require(_0xdc00('0x0'));var Team=require(_0xdc00('0x1'))['db'][_0xdc00('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xdc00('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdc00('0x4'),'afterDestroy':_0xdc00('0x5')};function emitEvent(_0x5a95d4){return function(_0x150b1d,_0xe0efe0,_0x214eae){TeamEvents[_0xdc00('0x6')](_0x5a95d4+':'+_0x150b1d['id'],_0x150b1d);TeamEvents[_0xdc00('0x6')](_0x5a95d4,_0x150b1d);_0x214eae(null);};}for(var e in events){if(events[_0xdc00('0x7')](e)){var event=events[e];Team[_0xdc00('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xae07=['Team','setMaxListeners','save','update','emit','hook','events'];(function(_0x5e6515,_0x2954b1){var _0xd33ce2=function(_0x5ce7ea){while(--_0x5ce7ea){_0x5e6515['push'](_0x5e6515['shift']());}};_0xd33ce2(++_0x2954b1);}(_0xae07,0x16b));var _0x7ae0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xae07[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x7ae0('0x0'));var Team=require('../../mysqldb')['db'][_0x7ae0('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x7ae0('0x2')](0x0);var events={'afterCreate':_0x7ae0('0x3'),'afterUpdate':_0x7ae0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ba5b0){return function(_0x3e7d81,_0x2f5066,_0xc3294f){TeamEvents['emit'](_0x1ba5b0+':'+_0x3e7d81['id'],_0x3e7d81);TeamEvents[_0x7ae0('0x5')](_0x1ba5b0,_0x3e7d81);_0xc3294f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x7ae0('0x6')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 1527a67..8b8507b 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 _0x2191=['setDataValue','channel','exports','define','Team','teams','Chat','Fax','Mail','Voice','Whatsapp','resolve','map','lodash','./team.attributes','get','then'];(function(_0x391a0a,_0x2e7f43){var _0x46ed44=function(_0xded700){while(--_0xded700){_0x391a0a['push'](_0x391a0a['shift']());}};_0x46ed44(++_0x2e7f43);}(_0x2191,0xb7));var _0x1219=function(_0x42d400,_0x42cce3){_0x42d400=_0x42d400-0x0;var _0x35b691=_0x2191[_0x42d400];return _0x35b691;};'use strict';var _=require(_0x1219('0x0'));var attributes=require(_0x1219('0x1'));function getQueuesByChannel(_0x33192e,_0x217b6a){var _0x52746a=_0x1219('0x2')+_0x217b6a+'Queues';return _0x33192e[_0x52746a]()[_0x1219('0x3')](function(_0x128b2a){return _['map'](_0x128b2a,function(_0x22aa0d){_0x22aa0d[_0x1219('0x4')](_0x1219('0x5'),_0x217b6a);return _0x22aa0d;});})['catch'](function(_0xc8e142){throw _0xc8e142;});}module[_0x1219('0x6')]=function(_0x404969){return _0x404969[_0x1219('0x7')](_0x1219('0x8'),attributes,{'tableName':_0x1219('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5175e9=this;var _0x7f1109=[_0x1219('0xa'),_0x1219('0xb'),_0x1219('0xc'),'Openchannel','Sms',_0x1219('0xd'),_0x1219('0xe')];return Promise[_0x1219('0xf')]()[_0x1219('0x3')](function(){var _0x56b1b2=_[_0x1219('0x10')](_0x7f1109,function(_0x197300){return getQueuesByChannel(_0x5175e9,_0x197300);});return Promise['all'](_0x56b1b2);})['catch'](function(_0x5952b3){throw _0x5952b3;});}}});}; \ No newline at end of file +var _0x0751=['then','channel','catch','exports','define','Team','teams','Chat','Mail','Sms','map','all','./team.attributes','get','Queues'];(function(_0x5b1010,_0x3bbceb){var _0x23e5a5=function(_0x118b72){while(--_0x118b72){_0x5b1010['push'](_0x5b1010['shift']());}};_0x23e5a5(++_0x3bbceb);}(_0x0751,0x10b));var _0x1075=function(_0x34f555,_0x10cb07){_0x34f555=_0x34f555-0x0;var _0xba91a8=_0x0751[_0x34f555];return _0xba91a8;};'use strict';var _=require('lodash');var attributes=require(_0x1075('0x0'));function getQueuesByChannel(_0x46abcf,_0x5ef45c){var _0xb62f6b=_0x1075('0x1')+_0x5ef45c+_0x1075('0x2');return _0x46abcf[_0xb62f6b]()[_0x1075('0x3')](function(_0xc494a9){return _['map'](_0xc494a9,function(_0x4afac2){_0x4afac2['setDataValue'](_0x1075('0x4'),_0x5ef45c);return _0x4afac2;});})[_0x1075('0x5')](function(_0x5df0c8){throw _0x5df0c8;});}module[_0x1075('0x6')]=function(_0x393eee){return _0x393eee[_0x1075('0x7')](_0x1075('0x8'),attributes,{'tableName':_0x1075('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5e1864=this;var _0x455ef2=[_0x1075('0xa'),'Fax',_0x1075('0xb'),'Openchannel',_0x1075('0xc'),'Voice','Whatsapp'];return Promise['resolve']()['then'](function(){var _0x3542b6=_[_0x1075('0xd')](_0x455ef2,function(_0x19888e){return getQueuesByChannel(_0x5e1864,_0x19888e);});return Promise[_0x1075('0xe')](_0x3542b6);})[_0x1075('0x5')](function(_0x5c6666){throw _0x5c6666;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 0731b72..0a8f6bf 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 _0x85f0=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','./team.socket','register','request','then','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x144128,_0x5164a1){var _0x3e39d7=function(_0x1eec7f){while(--_0x1eec7f){_0x144128['push'](_0x144128['shift']());}};_0x3e39d7(++_0x5164a1);}(_0x85f0,0x6f));var _0x085f=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x85f0[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x085f('0x0'));var util=require(_0x085f('0x1'));var moment=require(_0x085f('0x2'));var BPromise=require(_0x085f('0x3'));var rs=require(_0x085f('0x4'));var fs=require('fs');var Redis=require(_0x085f('0x5'));var db=require(_0x085f('0x6'))['db'];var utils=require(_0x085f('0x7'));var logger=require(_0x085f('0x8'))(_0x085f('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x085f('0xa')][_0x085f('0xb')]({'port':0x232a});config[_0x085f('0xc')]=_['defaults'](config['redis'],{'host':_0x085f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x085f('0xc')]));require(_0x085f('0xe'))[_0x085f('0xf')](socket);function respondWithRpcPromise(_0x17dc5b,_0x3c058b,_0x5df8d){return new BPromise(function(_0x26dbdf,_0x3e16bc){return client[_0x085f('0x10')](_0x17dc5b,_0x5df8d)[_0x085f('0x11')](function(_0x1af5c3){logger['info']('Team,\x20%s,\x20%s',_0x3c058b,_0x085f('0x12'));logger[_0x085f('0x13')](_0x085f('0x14'),_0x3c058b,'request\x20sent',JSON[_0x085f('0x15')](_0x1af5c3));if(_0x1af5c3[_0x085f('0x16')]){if(_0x1af5c3[_0x085f('0x16')][_0x085f('0x17')]===0x1f4){logger[_0x085f('0x16')](_0x085f('0x18'),_0x3c058b,_0x1af5c3[_0x085f('0x16')]['message']);return _0x3e16bc(_0x1af5c3[_0x085f('0x16')][_0x085f('0x19')]);}logger[_0x085f('0x16')]('Team,\x20%s,\x20%s',_0x3c058b,_0x1af5c3[_0x085f('0x16')]['message']);return _0x26dbdf(_0x1af5c3[_0x085f('0x16')][_0x085f('0x19')]);}else{logger['info'](_0x085f('0x18'),_0x3c058b,_0x085f('0x12'));_0x26dbdf(_0x1af5c3[_0x085f('0x1a')][_0x085f('0x19')]);}})[_0x085f('0x1b')](function(_0x17016b){logger[_0x085f('0x16')](_0x085f('0x18'),_0x3c058b,_0x17016b);_0x3e16bc(_0x17016b);});});} \ No newline at end of file +var _0x8429=['Team,\x20%s,\x20%s','debug','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','./team.socket','request','then'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x8429,0x17d));var _0x9842=function(_0x98bb75,_0x217507){_0x98bb75=_0x98bb75-0x0;var _0x55c6c1=_0x8429[_0x98bb75];return _0x55c6c1;};'use strict';var _=require('lodash');var util=require(_0x9842('0x0'));var moment=require(_0x9842('0x1'));var BPromise=require('bluebird');var rs=require(_0x9842('0x2'));var fs=require('fs');var Redis=require(_0x9842('0x3'));var db=require(_0x9842('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9842('0x5'))(_0x9842('0x6'));var config=require(_0x9842('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9842('0x8')]({'port':0x232a});config['redis']=_[_0x9842('0x9')](config[_0x9842('0xa')],{'host':_0x9842('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9842('0xa')]));require(_0x9842('0xc'))['register'](socket);function respondWithRpcPromise(_0x4cd00d,_0x53329b,_0x139969){return new BPromise(function(_0x2c8abe,_0x48b012){return client[_0x9842('0xd')](_0x4cd00d,_0x139969)[_0x9842('0xe')](function(_0x5d8e96){logger['info'](_0x9842('0xf'),_0x53329b,'request\x20sent');logger[_0x9842('0x10')]('Team,\x20%s,\x20%s,\x20%s',_0x53329b,'request\x20sent',JSON['stringify'](_0x5d8e96));if(_0x5d8e96[_0x9842('0x11')]){if(_0x5d8e96[_0x9842('0x11')][_0x9842('0x12')]===0x1f4){logger[_0x9842('0x11')](_0x9842('0xf'),_0x53329b,_0x5d8e96[_0x9842('0x11')]['message']);return _0x48b012(_0x5d8e96['error']['message']);}logger[_0x9842('0x11')](_0x9842('0xf'),_0x53329b,_0x5d8e96[_0x9842('0x11')][_0x9842('0x13')]);return _0x2c8abe(_0x5d8e96[_0x9842('0x11')][_0x9842('0x13')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x53329b,'request\x20sent');_0x2c8abe(_0x5d8e96[_0x9842('0x14')]['message']);}})[_0x9842('0x15')](function(_0x3766ed){logger[_0x9842('0x11')](_0x9842('0xf'),_0x53329b,_0x3766ed);_0x48b012(_0x3766ed);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 3c9f19e..33572bb 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 _0xe7e8=['remove','update','removeListener','register','length','save'];(function(_0x26e149,_0x18bd28){var _0x237c3d=function(_0x235627){while(--_0x235627){_0x26e149['push'](_0x26e149['shift']());}};_0x237c3d(++_0x18bd28);}(_0xe7e8,0xe3));var _0x8e7e=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0xe7e8[_0x4358f5];return _0x4d8104;};'use strict';var TeamEvents=require('./team.events');var events=[_0x8e7e('0x0'),_0x8e7e('0x1'),_0x8e7e('0x2')];function createListener(_0x4e5f9b,_0x484e89){return function(_0x41affe){_0x484e89['emit'](_0x4e5f9b,_0x41affe);};}function removeListener(_0x2313de,_0x22edb0){return function(){TeamEvents[_0x8e7e('0x3')](_0x2313de,_0x22edb0);};}exports[_0x8e7e('0x4')]=function(_0x2ff8db){for(var _0x11183f=0x0,_0x11cdd0=events[_0x8e7e('0x5')];_0x11183f<_0x11cdd0;_0x11183f++){var _0x505978=events[_0x11183f];var _0x2b134f=createListener('team:'+_0x505978,_0x2ff8db);TeamEvents['on'](_0x505978,_0x2b134f);}}; \ No newline at end of file +var _0x4f08=['removeListener','team:','./team.events','save','update','emit'];(function(_0x516ae9,_0x53138c){var _0x42dbff=function(_0x42c38e){while(--_0x42c38e){_0x516ae9['push'](_0x516ae9['shift']());}};_0x42dbff(++_0x53138c);}(_0x4f08,0x194));var _0x84f0=function(_0x58f059,_0xc3992c){_0x58f059=_0x58f059-0x0;var _0x5d9abb=_0x4f08[_0x58f059];return _0x5d9abb;};'use strict';var TeamEvents=require(_0x84f0('0x0'));var events=[_0x84f0('0x1'),'remove',_0x84f0('0x2')];function createListener(_0x211a1a,_0x5b53ff){return function(_0x466018){_0x5b53ff[_0x84f0('0x3')](_0x211a1a,_0x466018);};}function removeListener(_0xa3f34f,_0x5ce5cb){return function(){TeamEvents[_0x84f0('0x4')](_0xa3f34f,_0x5ce5cb);};}exports['register']=function(_0x3886d6){for(var _0x3a1161=0x0,_0x4548f3=events['length'];_0x3a1161<_0x4548f3;_0x3a1161++){var _0x430993=events[_0x3a1161];var _0x42f42e=createListener(_0x84f0('0x5')+_0x430993,_0x3886d6);TeamEvents['on'](_0x430993,_0x42f42e);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 22deee0..f816476 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 _0xe5fb=['exports','INTEGER','sequelize'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xe5fb,0xce));var _0xbe5f=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0xe5fb[_0x80d733];return _0x435868;};'use strict';var Sequelize=require(_0xbe5f('0x0'));module[_0xbe5f('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xbe5f('0x2')]}}; \ No newline at end of file +var _0x18ea=['sequelize','exports'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0x18ea,0xbe));var _0xa18e=function(_0x1c5b43,_0x2508fb){_0x1c5b43=_0x1c5b43-0x0;var _0xab4e63=_0x18ea[_0x1c5b43];return _0xab4e63;};'use strict';var Sequelize=require(_0xa18e('0x0'));module[_0xa18e('0x1')]={'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 93a7a9d..20d714a 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 _0x4171=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger'];(function(_0x372f85,_0x5873bb){var _0x207cca=function(_0xdec6be){while(--_0xdec6be){_0x372f85['push'](_0x372f85['shift']());}};_0x207cca(++_0x5873bb);}(_0x4171,0x6a));var _0x1417=function(_0x1bbcb0,_0x9efeb3){_0x1bbcb0=_0x1bbcb0-0x0;var _0x36aeff=_0x4171[_0x1bbcb0];return _0x36aeff;};'use strict';var _=require('lodash');var util=require(_0x1417('0x0'));var logger=require(_0x1417('0x1'))(_0x1417('0x2'));var moment=require(_0x1417('0x3'));var BPromise=require(_0x1417('0x4'));var rp=require(_0x1417('0x5'));var fs=require('fs');var path=require(_0x1417('0x6'));var rimraf=require('rimraf');var config=require(_0x1417('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0x1417('0x8')]=function(_0x51c955,_0x1d24e){return _0x51c955[_0x1417('0x9')](_0x1417('0xa'),attributes,{'tableName':_0x1417('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5a2=['moment','bluebird','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','api'];(function(_0x251421,_0x34bf49){var _0xe9bbff=function(_0x522759){while(--_0x522759){_0x251421['push'](_0x251421['shift']());}};_0xe9bbff(++_0x34bf49);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x5c9d6d,_0x1e3eb0){_0x5c9d6d=_0x5c9d6d-0x0;var _0x4ec5ba=_0xd5a2[_0x5c9d6d];return _0x4ec5ba;};'use strict';var _=require('lodash');var util=require(_0x2d5a('0x0'));var logger=require(_0x2d5a('0x1'))(_0x2d5a('0x2'));var moment=require(_0x2d5a('0x3'));var BPromise=require(_0x2d5a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d5a('0x5'));var rimraf=require(_0x2d5a('0x6'));var config=require(_0x2d5a('0x7'));var attributes=require(_0x2d5a('0x8'));module[_0x2d5a('0x9')]=function(_0x1187b5,_0x923c29){return _0x1187b5[_0x2d5a('0xa')](_0x2d5a('0xb'),attributes,{'tableName':_0x2d5a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 07b175c..1e1e694 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x437820,_0x2c5c38){var _0x5efaa8=function(_0x5048c2){while(--_0x5048c2){_0x437820['push'](_0x437820['shift']());}};_0x5efaa8(++_0x2c5c38);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x27d8bc,_0x19e010){_0x27d8bc=_0x27d8bc-0x0;var _0x4b04cb=_0xcb91[_0x27d8bc];return _0x4b04cb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x409c94,_0x4efc98){var _0x81bdc2=function(_0x1cf8fc){while(--_0x1cf8fc){_0x409c94['push'](_0x409c94['shift']());}};_0x81bdc2(++_0x4efc98);}(_0x70e0,0x17b));var _0x070e=function(_0x105d3e,_0x3018b0){_0x105d3e=_0x105d3e-0x0;var _0x5d6d16=_0x70e0[_0x105d3e];return _0x5d6d16;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index ca72dd1..6deaba2 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 _0x4cd9=['INTEGER','sequelize','exports'];(function(_0x1345a6,_0x330524){var _0x5709e6=function(_0x51639b){while(--_0x51639b){_0x1345a6['push'](_0x1345a6['shift']());}};_0x5709e6(++_0x330524);}(_0x4cd9,0x13c));var _0x94cd=function(_0x310b6f,_0x839ec3){_0x310b6f=_0x310b6f-0x0;var _0x36182d=_0x4cd9[_0x310b6f];return _0x36182d;};'use strict';var Sequelize=require(_0x94cd('0x0'));module[_0x94cd('0x1')]={'penalty':{'type':Sequelize[_0x94cd('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6386=['INTEGER','sequelize','exports'];(function(_0x4f76c3,_0x1f9630){var _0x3ed86a=function(_0x46230f){while(--_0x46230f){_0x4f76c3['push'](_0x4f76c3['shift']());}};_0x3ed86a(++_0x1f9630);}(_0x6386,0x1cf));var _0x6638=function(_0x58c55f,_0x3d9f4b){_0x58c55f=_0x58c55f-0x0;var _0x31c7ed=_0x6386[_0x58c55f];return _0x31c7ed;};'use strict';var Sequelize=require(_0x6638('0x0'));module[_0x6638('0x1')]={'penalty':{'type':Sequelize[_0x6638('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index d61b9fd..3108cf6 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 _0x99e9=['util','../../config/logger','api','moment','request-promise','path','rimraf','./teamVoiceQueue.attributes','define','TeamVoiceQueue'];(function(_0x5c568b,_0xaa5457){var _0x4b744e=function(_0x10facf){while(--_0x10facf){_0x5c568b['push'](_0x5c568b['shift']());}};_0x4b744e(++_0xaa5457);}(_0x99e9,0xb4));var _0x999e=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x99e9[_0x46d0c9];return _0x174506;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e12=['util','../../config/logger','api','bluebird','request-promise','path','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash'];(function(_0x1eeff4,_0x173232){var _0x22fe3b=function(_0xd22e6d){while(--_0xd22e6d){_0x1eeff4['push'](_0x1eeff4['shift']());}};_0x22fe3b(++_0x173232);}(_0x6e12,0x154));var _0x26e1=function(_0x306d92,_0x1107d1){_0x306d92=_0x306d92-0x0;var _0xebe066=_0x6e12[_0x306d92];return _0xebe066;};'use strict';var _=require(_0x26e1('0x0'));var util=require(_0x26e1('0x1'));var logger=require(_0x26e1('0x2'))(_0x26e1('0x3'));var moment=require('moment');var BPromise=require(_0x26e1('0x4'));var rp=require(_0x26e1('0x5'));var fs=require('fs');var path=require(_0x26e1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x26e1('0x7'));module[_0x26e1('0x8')]=function(_0x18467c,_0x2073c9){return _0x18467c[_0x26e1('0x9')]('TeamVoiceQueue',attributes,{'tableName':_0x26e1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index bbef725..77f7dd7 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 _0xe062=['client','http','request','then','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xe062,0xd5));var _0x2e06=function(_0x59c5d2,_0x27d656){_0x59c5d2=_0x59c5d2-0x0;var _0x52aa6f=_0xe062[_0x59c5d2];return _0x52aa6f;};'use strict';var _=require(_0x2e06('0x0'));var util=require(_0x2e06('0x1'));var moment=require('moment');var BPromise=require(_0x2e06('0x2'));var rs=require(_0x2e06('0x3'));var fs=require('fs');var Redis=require(_0x2e06('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2e06('0x5'))(_0x2e06('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2e06('0x7')][_0x2e06('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52bf0a,_0x5747de,_0x255317){return new BPromise(function(_0x31645b,_0x8ede0e){return client[_0x2e06('0x9')](_0x52bf0a,_0x255317)[_0x2e06('0xa')](function(_0x2a2ee4){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x5747de,_0x2e06('0xb'));logger[_0x2e06('0xc')](_0x2e06('0xd'),_0x5747de,'request\x20sent',JSON[_0x2e06('0xe')](_0x2a2ee4));if(_0x2a2ee4[_0x2e06('0xf')]){if(_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x10')]===0x1f4){logger['error'](_0x2e06('0x11'),_0x5747de,_0x2a2ee4[_0x2e06('0xf')]['message']);return _0x8ede0e(_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x12')]);}logger['error'](_0x2e06('0x11'),_0x5747de,_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x12')]);return _0x31645b(_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x12')]);}else{logger[_0x2e06('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5747de,_0x2e06('0xb'));_0x31645b(_0x2a2ee4[_0x2e06('0x14')][_0x2e06('0x12')]);}})[_0x2e06('0x15')](function(_0x41d1fc){logger[_0x2e06('0xf')](_0x2e06('0x11'),_0x5747de,_0x41d1fc);_0x8ede0e(_0x41d1fc);});});} \ No newline at end of file +var _0x66d9=['../../config/utils','../../config/logger','client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x5b6677,_0x8f0953){var _0x10a794=function(_0x3f2529){while(--_0x3f2529){_0x5b6677['push'](_0x5b6677['shift']());}};_0x10a794(++_0x8f0953);}(_0x66d9,0x1e9));var _0x966d=function(_0x496acd,_0x2be788){_0x496acd=_0x496acd-0x0;var _0x64a99d=_0x66d9[_0x496acd];return _0x64a99d;};'use strict';var _=require(_0x966d('0x0'));var util=require(_0x966d('0x1'));var moment=require(_0x966d('0x2'));var BPromise=require(_0x966d('0x3'));var rs=require(_0x966d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x966d('0x5'));var logger=require(_0x966d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x966d('0x7')][_0x966d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14fba3,_0x446ed9,_0x59544a){return new BPromise(function(_0x3fbe0e,_0x3c5df2){return client['request'](_0x14fba3,_0x59544a)[_0x966d('0x9')](function(_0xf95b32){logger[_0x966d('0xa')](_0x966d('0xb'),_0x446ed9,_0x966d('0xc'));logger['debug'](_0x966d('0xd'),_0x446ed9,_0x966d('0xc'),JSON[_0x966d('0xe')](_0xf95b32));if(_0xf95b32[_0x966d('0xf')]){if(_0xf95b32[_0x966d('0xf')][_0x966d('0x10')]===0x1f4){logger[_0x966d('0xf')](_0x966d('0xb'),_0x446ed9,_0xf95b32[_0x966d('0xf')]['message']);return _0x3c5df2(_0xf95b32[_0x966d('0xf')][_0x966d('0x11')]);}logger[_0x966d('0xf')](_0x966d('0xb'),_0x446ed9,_0xf95b32[_0x966d('0xf')]['message']);return _0x3fbe0e(_0xf95b32['error'][_0x966d('0x11')]);}else{logger[_0x966d('0xa')]('TeamVoiceQueue,\x20%s,\x20%s',_0x446ed9,'request\x20sent');_0x3fbe0e(_0xf95b32[_0x966d('0x12')][_0x966d('0x11')]);}})['catch'](function(_0x24fa42){logger[_0x966d('0xf')](_0x966d('0xb'),_0x446ed9,_0x24fa42);_0x3c5df2(_0x24fa42);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index f4ed551..c3013d8 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 _0x2ff5=['/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3cb09b,_0x31c2a5){var _0x242048=function(_0x464aba){while(--_0x464aba){_0x3cb09b['push'](_0x3cb09b['shift']());}};_0x242048(++_0x31c2a5);}(_0x2ff5,0x1d5));var _0x52ff=function(_0x382eb3,_0x25c58){_0x382eb3=_0x382eb3-0x0;var _0x2ab29a=_0x2ff5[_0x382eb3];return _0x2ab29a;};'use strict';var multer=require('multer');var util=require(_0x52ff('0x0'));var path=require(_0x52ff('0x1'));var timeout=require('connect-timeout');var express=require(_0x52ff('0x2'));var router=express[_0x52ff('0x3')]();var fs_extra=require(_0x52ff('0x4'));var auth=require(_0x52ff('0x5'));var interaction=require(_0x52ff('0x6'));var config=require(_0x52ff('0x7'));var controller=require('./template.controller');router[_0x52ff('0x8')]('/',auth[_0x52ff('0x9')](),controller[_0x52ff('0xa')]);router['get'](_0x52ff('0xb'),auth[_0x52ff('0x9')](),controller[_0x52ff('0xc')]);router[_0x52ff('0xd')]('/',auth[_0x52ff('0x9')](),controller[_0x52ff('0xe')]);router[_0x52ff('0xf')](_0x52ff('0xb'),auth[_0x52ff('0x9')](),controller[_0x52ff('0x10')]);router[_0x52ff('0x11')](_0x52ff('0xb'),auth[_0x52ff('0x9')](),controller[_0x52ff('0x12')]);module[_0x52ff('0x13')]=router; \ No newline at end of file +var _0x6209=['get','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index'];(function(_0x422a4a,_0x339b48){var _0x612a5c=function(_0x55be51){while(--_0x55be51){_0x422a4a['push'](_0x422a4a['shift']());}};_0x612a5c(++_0x339b48);}(_0x6209,0x1e8));var _0x9620=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6209[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x9620('0x0'));var util=require(_0x9620('0x1'));var path=require(_0x9620('0x2'));var timeout=require(_0x9620('0x3'));var express=require(_0x9620('0x4'));var router=express[_0x9620('0x5')]();var fs_extra=require(_0x9620('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9620('0x7'));var config=require(_0x9620('0x8'));var controller=require(_0x9620('0x9'));router['get']('/',auth[_0x9620('0xa')](),controller[_0x9620('0xb')]);router[_0x9620('0xc')](_0x9620('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9620('0xe')]('/',auth['isAuthenticated'](),controller[_0x9620('0xf')]);router[_0x9620('0x10')](_0x9620('0xd'),auth[_0x9620('0xa')](),controller[_0x9620('0x11')]);router[_0x9620('0x12')](_0x9620('0xd'),auth['isAuthenticated'](),controller[_0x9620('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 8b970af..ee66ff7 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 _0x77cf=['TEXT','STRING'];(function(_0x561292,_0xe75afb){var _0x5f30b1=function(_0x296f93){while(--_0x296f93){_0x561292['push'](_0x561292['shift']());}};_0x5f30b1(++_0xe75afb);}(_0x77cf,0xef));var _0xf77c=function(_0x204c3a,_0x5b0deb){_0x204c3a=_0x204c3a-0x0;var _0x126f27=_0x77cf[_0x204c3a];return _0x126f27;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf77c('0x0')]},'description':{'type':Sequelize[_0xf77c('0x0')]},'html':{'type':Sequelize[_0xf77c('0x1')]}}; \ No newline at end of file +var _0x0c89=['exports','STRING','TEXT','sequelize'];(function(_0x53e4a7,_0x36d0fc){var _0x5e4ccb=function(_0x3d130e){while(--_0x3d130e){_0x53e4a7['push'](_0x53e4a7['shift']());}};_0x5e4ccb(++_0x36d0fc);}(_0x0c89,0xa3));var _0x90c8=function(_0x4f9650,_0x44ca6c){_0x4f9650=_0x4f9650-0x0;var _0x32b541=_0x0c89[_0x4f9650];return _0x32b541;};'use strict';var Sequelize=require(_0x90c8('0x0'));module[_0x90c8('0x1')]={'name':{'type':Sequelize[_0x90c8('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x90c8('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 400df41..92d5d23 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 _0xb776=['fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','create','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','apply','destroy','then','Templates','end','sendStatus','error','name','send','map','Template','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb776,0xbe));var _0x6b77=function(_0x2b86e0,_0x1f63d4){_0x2b86e0=_0x2b86e0-0x0;var _0x57a252=_0xb776[_0x2b86e0];return _0x57a252;};'use strict';var emlformat=require(_0x6b77('0x0'));var rimraf=require(_0x6b77('0x1'));var zipdir=require(_0x6b77('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b77('0x3'));var moment=require(_0x6b77('0x4'));var BPromise=require(_0x6b77('0x5'));var Mustache=require(_0x6b77('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6b77('0x7'));var ejs=require(_0x6b77('0x8'));var fs=require('fs');var fs_extra=require(_0x6b77('0x9'));var _=require('lodash');var squel=require(_0x6b77('0xa'));var crypto=require(_0x6b77('0xb'));var jsforce=require(_0x6b77('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6b77('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6b77('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6b77('0xe'));var hardwareService=require(_0x6b77('0xf'));var logger=require(_0x6b77('0x10'))(_0x6b77('0x11'));var utils=require(_0x6b77('0x12'));var config=require(_0x6b77('0x13'));var licenseUtil=require(_0x6b77('0x14'));var db=require(_0x6b77('0x15'))['db'];function respondWithStatusCode(_0xc54cf7,_0x23b4b1){_0x23b4b1=_0x23b4b1||0xcc;return function(_0x257755){if(_0x257755){return _0xc54cf7['sendStatus'](_0x23b4b1);}return _0xc54cf7['status'](_0x23b4b1)['end']();};}function respondWithResult(_0x138877,_0x54f7ab){_0x54f7ab=_0x54f7ab||0xc8;return function(_0x1f775a){if(_0x1f775a){return _0x138877[_0x6b77('0x16')](_0x54f7ab)['json'](_0x1f775a);}};}function respondWithFilteredResult(_0x5e617b,_0x4d0799){return function(_0x94aa7f){if(_0x94aa7f){var _0x383818=typeof _0x4d0799[_0x6b77('0x17')]===_0x6b77('0x18')&&typeof _0x4d0799['limit']===_0x6b77('0x18');var _0x406209=_0x94aa7f[_0x6b77('0x19')];var _0x52e74d=_0x383818?0x0:_0x4d0799['offset'];var _0x3537db=_0x383818?_0x94aa7f[_0x6b77('0x19')]:_0x4d0799[_0x6b77('0x17')]+_0x4d0799[_0x6b77('0x1a')];var _0x9743c9;if(_0x3537db>=_0x406209){_0x3537db=_0x406209;_0x9743c9=0xc8;}else{_0x9743c9=0xce;}_0x5e617b[_0x6b77('0x16')](_0x9743c9);return _0x5e617b[_0x6b77('0x1b')](_0x6b77('0x1c'),_0x52e74d+'-'+_0x3537db+'/'+_0x406209)[_0x6b77('0x1d')](_0x94aa7f);}return null;};}function patchUpdates(_0x256572){return function(_0x175fa5){try{jsonpatch[_0x6b77('0x1e')](_0x175fa5,_0x256572,!![]);}catch(_0x1ef6cb){return BPromise['reject'](_0x1ef6cb);}return _0x175fa5['save']();};}function saveUpdates(_0x3c95da,_0x1f0dad){return function(_0x1f072a){if(_0x1f072a){return _0x1f072a['update'](_0x3c95da)['then'](function(_0x26d425){return _0x26d425;});}return null;};}function removeEntity(_0x25148d,_0x2a1b6e){return function(_0x3a9c4b){if(_0x3a9c4b){return _0x3a9c4b[_0x6b77('0x1f')]()[_0x6b77('0x20')](function(){var _0x2973c5=_0x3a9c4b['get']({'plain':!![]});var _0x3b52fc=_0x6b77('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b52fc,'resourceId':_0x2973c5['id']}})[_0x6b77('0x20')](function(){return _0x3a9c4b;});})['then'](function(){_0x25148d[_0x6b77('0x16')](0xcc)[_0x6b77('0x22')]();});}};}function handleEntityNotFound(_0x3d9572,_0xb12c40){return function(_0x58df5e){if(!_0x58df5e){_0x3d9572[_0x6b77('0x23')](0x194);}return _0x58df5e;};}function handleError(_0x155e6b,_0x5f5b56){_0x5f5b56=_0x5f5b56||0x1f4;return function(_0x2b26b0){logger[_0x6b77('0x24')](_0x2b26b0['stack']);if(_0x2b26b0['name']){delete _0x2b26b0[_0x6b77('0x25')];}_0x155e6b[_0x6b77('0x16')](_0x5f5b56)[_0x6b77('0x26')](_0x2b26b0);};}exports['index']=function(_0xddb265,_0x5c1082){var _0x107bab={},_0x402446={},_0x373450={'count':0x0,'rows':[]};var _0x4db3d3=_[_0x6b77('0x27')](db[_0x6b77('0x28')][_0x6b77('0x29')],function(_0x5dee99){return{'name':_0x5dee99[_0x6b77('0x2a')],'type':_0x5dee99['type'][_0x6b77('0x2b')]};});_0x402446[_0x6b77('0x2c')]=_['map'](_0x4db3d3,_0x6b77('0x25'));_0x402446[_0x6b77('0x2d')]=_[_0x6b77('0x2e')](_0xddb265[_0x6b77('0x2d')]);_0x402446[_0x6b77('0x2f')]=_[_0x6b77('0x30')](_0x402446[_0x6b77('0x2c')],_0x402446[_0x6b77('0x2d')]);_0x107bab[_0x6b77('0x31')]=_[_0x6b77('0x30')](_0x402446[_0x6b77('0x2c')],qs[_0x6b77('0x32')](_0xddb265['query'][_0x6b77('0x32')]));_0x107bab[_0x6b77('0x31')]=_0x107bab['attributes'][_0x6b77('0x33')]?_0x107bab[_0x6b77('0x31')]:_0x402446[_0x6b77('0x2c')];if(!_0xddb265[_0x6b77('0x2d')][_0x6b77('0x34')](_0x6b77('0x35'))){_0x107bab['limit']=qs['limit'](_0xddb265[_0x6b77('0x2d')][_0x6b77('0x1a')]);_0x107bab['offset']=qs[_0x6b77('0x17')](_0xddb265[_0x6b77('0x2d')][_0x6b77('0x17')]);}_0x107bab[_0x6b77('0x36')]=qs[_0x6b77('0x37')](_0xddb265['query']['sort']);_0x107bab['where']=qs[_0x6b77('0x2f')](_[_0x6b77('0x38')](_0xddb265[_0x6b77('0x2d')],_0x402446[_0x6b77('0x2f')]),_0x4db3d3);if(_0xddb265[_0x6b77('0x2d')]['filter']){_0x107bab[_0x6b77('0x39')]=_[_0x6b77('0x3a')](_0x107bab[_0x6b77('0x39')],{'$or':_[_0x6b77('0x27')](_0x4db3d3,function(_0x346312){if(_0x346312['type']!==_0x6b77('0x3b')){var _0x15ddc9={};_0x15ddc9[_0x346312[_0x6b77('0x25')]]={'$like':'%'+_0xddb265[_0x6b77('0x2d')][_0x6b77('0x3c')]+'%'};return _0x15ddc9;}})});}_0x107bab=_['merge']({},_0x107bab,_0xddb265[_0x6b77('0x3d')]);var _0x3a42cf={'where':_0x107bab[_0x6b77('0x39')]};return db[_0x6b77('0x28')][_0x6b77('0x19')](_0x3a42cf)[_0x6b77('0x20')](function(_0x5b2b6e){_0x373450['count']=_0x5b2b6e;if(_0xddb265[_0x6b77('0x2d')]['includeAll']){_0x107bab[_0x6b77('0x3e')]=[{'all':!![]}];}return db[_0x6b77('0x28')][_0x6b77('0x3f')](_0x107bab);})[_0x6b77('0x20')](function(_0x3ecbc3){_0x373450[_0x6b77('0x40')]=_0x3ecbc3;return _0x373450;})[_0x6b77('0x20')](respondWithFilteredResult(_0x5c1082,_0x107bab))[_0x6b77('0x41')](handleError(_0x5c1082,null));};exports[_0x6b77('0x42')]=function(_0x108076,_0x589348){var _0x375077={'raw':!![],'where':{'id':_0x108076[_0x6b77('0x43')]['id']}},_0x211776={};_0x211776[_0x6b77('0x2c')]=_[_0x6b77('0x2e')](db[_0x6b77('0x28')][_0x6b77('0x29')]);_0x211776[_0x6b77('0x2d')]=_[_0x6b77('0x2e')](_0x108076['query']);_0x211776[_0x6b77('0x2f')]=_[_0x6b77('0x30')](_0x211776[_0x6b77('0x2c')],_0x211776[_0x6b77('0x2d')]);_0x375077[_0x6b77('0x31')]=_[_0x6b77('0x30')](_0x211776[_0x6b77('0x2c')],qs[_0x6b77('0x32')](_0x108076[_0x6b77('0x2d')][_0x6b77('0x32')]));_0x375077[_0x6b77('0x31')]=_0x375077[_0x6b77('0x31')][_0x6b77('0x33')]?_0x375077[_0x6b77('0x31')]:_0x211776[_0x6b77('0x2c')];if(_0x108076[_0x6b77('0x2d')][_0x6b77('0x44')]){_0x375077[_0x6b77('0x3e')]=[{'all':!![]}];}_0x375077=_[_0x6b77('0x3a')]({},_0x375077,_0x108076[_0x6b77('0x3d')]);return db[_0x6b77('0x28')][_0x6b77('0x45')](_0x375077)['then'](handleEntityNotFound(_0x589348,null))[_0x6b77('0x20')](respondWithResult(_0x589348,null))[_0x6b77('0x41')](handleError(_0x589348,null));};exports['create']=function(_0x450878,_0x5796f0){return db['Template']['create'](_0x450878[_0x6b77('0x46')],{})[_0x6b77('0x20')](function(_0x2292dc){var _0xf0f2d7=_0x450878[_0x6b77('0x47')][_0x6b77('0x48')]({'plain':!![]});if(!_0xf0f2d7)throw new Error(_0x6b77('0x49'));if(_0xf0f2d7[_0x6b77('0x4a')]==='user'){var _0x20960f=_0x2292dc[_0x6b77('0x48')]({'plain':!![]});var _0x2750c3='Templates';return db[_0x6b77('0x4b')][_0x6b77('0x45')]({'where':{'name':_0x2750c3,'userProfileId':_0xf0f2d7[_0x6b77('0x4c')]},'raw':!![]})[_0x6b77('0x20')](function(_0x10273b){if(_0x10273b&&_0x10273b['autoAssociation']===0x0){return db[_0x6b77('0x4d')][_0x6b77('0x4e')]({'name':_0x20960f['name'],'resourceId':_0x20960f['id'],'type':_0x10273b[_0x6b77('0x25')],'sectionId':_0x10273b['id']},{})[_0x6b77('0x20')](function(){return _0x2292dc;});}else{return _0x2292dc;}})[_0x6b77('0x41')](function(_0x2aa33e){logger[_0x6b77('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2aa33e);throw _0x2aa33e;});}return _0x2292dc;})[_0x6b77('0x20')](respondWithResult(_0x5796f0,0xc9))['catch'](handleError(_0x5796f0,null));};exports[_0x6b77('0x4f')]=function(_0xca0701,_0x2a5fad){if(_0xca0701['body']['id']){delete _0xca0701[_0x6b77('0x46')]['id'];}return db[_0x6b77('0x28')][_0x6b77('0x45')]({'where':{'id':_0xca0701[_0x6b77('0x43')]['id']}})[_0x6b77('0x20')](handleEntityNotFound(_0x2a5fad,null))['then'](saveUpdates(_0xca0701['body'],null))[_0x6b77('0x20')](respondWithResult(_0x2a5fad,null))[_0x6b77('0x41')](handleError(_0x2a5fad,null));};exports[_0x6b77('0x1f')]=function(_0x5afb93,_0x1edcbb){return db['Template'][_0x6b77('0x45')]({'where':{'id':_0x5afb93['params']['id']}})[_0x6b77('0x20')](handleEntityNotFound(_0x1edcbb,null))[_0x6b77('0x20')](removeEntity(_0x1edcbb,null))[_0x6b77('0x41')](handleError(_0x1edcbb,null));}; \ No newline at end of file +var _0xe6ef=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','get','Templates','UserProfileResource','stack','name','send','index','map','Template','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','to-csv'];(function(_0x4a6c86,_0x2a3ae3){var _0x549a94=function(_0x359991){while(--_0x359991){_0x4a6c86['push'](_0x4a6c86['shift']());}};_0x549a94(++_0x2a3ae3);}(_0xe6ef,0x1cc));var _0xfe6e=function(_0x5155a2,_0x2b42ee){_0x5155a2=_0x5155a2-0x0;var _0x35a9bd=_0xe6ef[_0x5155a2];return _0x35a9bd;};'use strict';var emlformat=require(_0xfe6e('0x0'));var rimraf=require(_0xfe6e('0x1'));var zipdir=require(_0xfe6e('0x2'));var jsonpatch=require(_0xfe6e('0x3'));var rp=require(_0xfe6e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfe6e('0x5'));var util=require(_0xfe6e('0x6'));var path=require(_0xfe6e('0x7'));var sox=require(_0xfe6e('0x8'));var csv=require('to-csv');var ejs=require(_0xfe6e('0x9'));var fs=require('fs');var fs_extra=require(_0xfe6e('0xa'));var _=require('lodash');var squel=require(_0xfe6e('0xb'));var crypto=require('crypto');var jsforce=require(_0xfe6e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfe6e('0xd'));var querystring=require(_0xfe6e('0xe'));var Papa=require(_0xfe6e('0xf'));var Redis=require(_0xfe6e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfe6e('0x11'));var as=require(_0xfe6e('0x12'));var hardwareService=require(_0xfe6e('0x13'));var logger=require(_0xfe6e('0x14'))(_0xfe6e('0x15'));var utils=require(_0xfe6e('0x16'));var config=require(_0xfe6e('0x17'));var licenseUtil=require(_0xfe6e('0x18'));var db=require(_0xfe6e('0x19'))['db'];function respondWithStatusCode(_0x40e68e,_0x2e1204){_0x2e1204=_0x2e1204||0xcc;return function(_0x260c94){if(_0x260c94){return _0x40e68e[_0xfe6e('0x1a')](_0x2e1204);}return _0x40e68e['status'](_0x2e1204)[_0xfe6e('0x1b')]();};}function respondWithResult(_0x52007c,_0x49f04d){_0x49f04d=_0x49f04d||0xc8;return function(_0x6a4ac2){if(_0x6a4ac2){return _0x52007c[_0xfe6e('0x1c')](_0x49f04d)[_0xfe6e('0x1d')](_0x6a4ac2);}};}function respondWithFilteredResult(_0x40a084,_0x47ea44){return function(_0x555833){if(_0x555833){var _0x587e37=typeof _0x47ea44[_0xfe6e('0x1e')]===_0xfe6e('0x1f')&&typeof _0x47ea44[_0xfe6e('0x20')]===_0xfe6e('0x1f');var _0x503867=_0x555833[_0xfe6e('0x21')];var _0x11b205=_0x587e37?0x0:_0x47ea44[_0xfe6e('0x1e')];var _0x198cde=_0x587e37?_0x555833[_0xfe6e('0x21')]:_0x47ea44['offset']+_0x47ea44[_0xfe6e('0x20')];var _0x352813;if(_0x198cde>=_0x503867){_0x198cde=_0x503867;_0x352813=0xc8;}else{_0x352813=0xce;}_0x40a084[_0xfe6e('0x1c')](_0x352813);return _0x40a084[_0xfe6e('0x22')](_0xfe6e('0x23'),_0x11b205+'-'+_0x198cde+'/'+_0x503867)[_0xfe6e('0x1d')](_0x555833);}return null;};}function patchUpdates(_0x52c8eb){return function(_0x3968fd){try{jsonpatch['apply'](_0x3968fd,_0x52c8eb,!![]);}catch(_0x6e8b55){return BPromise['reject'](_0x6e8b55);}return _0x3968fd['save']();};}function saveUpdates(_0x28d8f9,_0x54f901){return function(_0x1fe81d){if(_0x1fe81d){return _0x1fe81d[_0xfe6e('0x24')](_0x28d8f9)['then'](function(_0x523ed1){return _0x523ed1;});}return null;};}function removeEntity(_0x15f010,_0x1e02ef){return function(_0xa7d1c5){if(_0xa7d1c5){return _0xa7d1c5[_0xfe6e('0x25')]()[_0xfe6e('0x26')](function(){var _0x21a48d=_0xa7d1c5[_0xfe6e('0x27')]({'plain':!![]});var _0x1450b6=_0xfe6e('0x28');return db[_0xfe6e('0x29')]['destroy']({'where':{'type':_0x1450b6,'resourceId':_0x21a48d['id']}})[_0xfe6e('0x26')](function(){return _0xa7d1c5;});})[_0xfe6e('0x26')](function(){_0x15f010[_0xfe6e('0x1c')](0xcc)[_0xfe6e('0x1b')]();});}};}function handleEntityNotFound(_0x336e65,_0x5204ae){return function(_0x24625e){if(!_0x24625e){_0x336e65['sendStatus'](0x194);}return _0x24625e;};}function handleError(_0x4b02f7,_0xfc7440){_0xfc7440=_0xfc7440||0x1f4;return function(_0x59014b){logger['error'](_0x59014b[_0xfe6e('0x2a')]);if(_0x59014b[_0xfe6e('0x2b')]){delete _0x59014b[_0xfe6e('0x2b')];}_0x4b02f7[_0xfe6e('0x1c')](_0xfc7440)[_0xfe6e('0x2c')](_0x59014b);};}exports[_0xfe6e('0x2d')]=function(_0x57a358,_0x2bf87d){var _0x37936c={},_0x5a29e6={},_0x327660={'count':0x0,'rows':[]};var _0x386889=_[_0xfe6e('0x2e')](db[_0xfe6e('0x2f')][_0xfe6e('0x30')],function(_0x5466c2){return{'name':_0x5466c2[_0xfe6e('0x31')],'type':_0x5466c2[_0xfe6e('0x32')]['key']};});_0x5a29e6[_0xfe6e('0x33')]=_['map'](_0x386889,_0xfe6e('0x2b'));_0x5a29e6[_0xfe6e('0x34')]=_[_0xfe6e('0x35')](_0x57a358['query']);_0x5a29e6[_0xfe6e('0x36')]=_[_0xfe6e('0x37')](_0x5a29e6[_0xfe6e('0x33')],_0x5a29e6[_0xfe6e('0x34')]);_0x37936c[_0xfe6e('0x38')]=_[_0xfe6e('0x37')](_0x5a29e6[_0xfe6e('0x33')],qs[_0xfe6e('0x39')](_0x57a358[_0xfe6e('0x34')]['fields']));_0x37936c['attributes']=_0x37936c['attributes']['length']?_0x37936c['attributes']:_0x5a29e6[_0xfe6e('0x33')];if(!_0x57a358['query'][_0xfe6e('0x3a')]('nolimit')){_0x37936c[_0xfe6e('0x20')]=qs[_0xfe6e('0x20')](_0x57a358['query'][_0xfe6e('0x20')]);_0x37936c[_0xfe6e('0x1e')]=qs['offset'](_0x57a358[_0xfe6e('0x34')][_0xfe6e('0x1e')]);}_0x37936c['order']=qs[_0xfe6e('0x3b')](_0x57a358['query'][_0xfe6e('0x3b')]);_0x37936c['where']=qs[_0xfe6e('0x36')](_[_0xfe6e('0x3c')](_0x57a358['query'],_0x5a29e6[_0xfe6e('0x36')]),_0x386889);if(_0x57a358['query'][_0xfe6e('0x3d')]){_0x37936c[_0xfe6e('0x3e')]=_['merge'](_0x37936c['where'],{'$or':_['map'](_0x386889,function(_0x556e23){if(_0x556e23['type']!==_0xfe6e('0x3f')){var _0x2f6e64={};_0x2f6e64[_0x556e23['name']]={'$like':'%'+_0x57a358[_0xfe6e('0x34')][_0xfe6e('0x3d')]+'%'};return _0x2f6e64;}})});}_0x37936c=_[_0xfe6e('0x40')]({},_0x37936c,_0x57a358[_0xfe6e('0x41')]);var _0x2e7211={'where':_0x37936c[_0xfe6e('0x3e')]};return db[_0xfe6e('0x2f')]['count'](_0x2e7211)['then'](function(_0x70e66d){_0x327660['count']=_0x70e66d;if(_0x57a358[_0xfe6e('0x34')][_0xfe6e('0x42')]){_0x37936c['include']=[{'all':!![]}];}return db['Template']['findAll'](_0x37936c);})[_0xfe6e('0x26')](function(_0x23ba8b){_0x327660['rows']=_0x23ba8b;return _0x327660;})['then'](respondWithFilteredResult(_0x2bf87d,_0x37936c))[_0xfe6e('0x43')](handleError(_0x2bf87d,null));};exports[_0xfe6e('0x44')]=function(_0x49bce1,_0xc4df9c){var _0x54d36b={'raw':!![],'where':{'id':_0x49bce1['params']['id']}},_0x2e5b50={};_0x2e5b50[_0xfe6e('0x33')]=_['keys'](db['Template'][_0xfe6e('0x30')]);_0x2e5b50[_0xfe6e('0x34')]=_[_0xfe6e('0x35')](_0x49bce1[_0xfe6e('0x34')]);_0x2e5b50[_0xfe6e('0x36')]=_[_0xfe6e('0x37')](_0x2e5b50[_0xfe6e('0x33')],_0x2e5b50[_0xfe6e('0x34')]);_0x54d36b[_0xfe6e('0x38')]=_[_0xfe6e('0x37')](_0x2e5b50[_0xfe6e('0x33')],qs[_0xfe6e('0x39')](_0x49bce1[_0xfe6e('0x34')][_0xfe6e('0x39')]));_0x54d36b[_0xfe6e('0x38')]=_0x54d36b[_0xfe6e('0x38')]['length']?_0x54d36b[_0xfe6e('0x38')]:_0x2e5b50[_0xfe6e('0x33')];if(_0x49bce1[_0xfe6e('0x34')][_0xfe6e('0x42')]){_0x54d36b[_0xfe6e('0x45')]=[{'all':!![]}];}_0x54d36b=_[_0xfe6e('0x40')]({},_0x54d36b,_0x49bce1['options']);return db[_0xfe6e('0x2f')][_0xfe6e('0x46')](_0x54d36b)['then'](handleEntityNotFound(_0xc4df9c,null))[_0xfe6e('0x26')](respondWithResult(_0xc4df9c,null))[_0xfe6e('0x43')](handleError(_0xc4df9c,null));};exports[_0xfe6e('0x47')]=function(_0x20e2c6,_0x124211){return db['Template']['create'](_0x20e2c6[_0xfe6e('0x48')],{})[_0xfe6e('0x26')](function(_0x57a81d){var _0x1d42a9=_0x20e2c6[_0xfe6e('0x49')][_0xfe6e('0x27')]({'plain':!![]});if(!_0x1d42a9)throw new Error(_0xfe6e('0x4a'));if(_0x1d42a9[_0xfe6e('0x4b')]===_0xfe6e('0x49')){var _0x3544af=_0x57a81d[_0xfe6e('0x27')]({'plain':!![]});var _0x3cc08c='Templates';return db[_0xfe6e('0x4c')][_0xfe6e('0x46')]({'where':{'name':_0x3cc08c,'userProfileId':_0x1d42a9['userProfileId']},'raw':!![]})[_0xfe6e('0x26')](function(_0x23f39a){if(_0x23f39a&&_0x23f39a['autoAssociation']===0x0){return db[_0xfe6e('0x29')][_0xfe6e('0x47')]({'name':_0x3544af[_0xfe6e('0x2b')],'resourceId':_0x3544af['id'],'type':_0x23f39a[_0xfe6e('0x2b')],'sectionId':_0x23f39a['id']},{})[_0xfe6e('0x26')](function(){return _0x57a81d;});}else{return _0x57a81d;}})[_0xfe6e('0x43')](function(_0x401160){logger[_0xfe6e('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x401160);throw _0x401160;});}return _0x57a81d;})[_0xfe6e('0x26')](respondWithResult(_0x124211,0xc9))[_0xfe6e('0x43')](handleError(_0x124211,null));};exports['update']=function(_0x3433a9,_0x1edbbf){if(_0x3433a9[_0xfe6e('0x48')]['id']){delete _0x3433a9[_0xfe6e('0x48')]['id'];}return db[_0xfe6e('0x2f')][_0xfe6e('0x46')]({'where':{'id':_0x3433a9[_0xfe6e('0x4e')]['id']}})[_0xfe6e('0x26')](handleEntityNotFound(_0x1edbbf,null))[_0xfe6e('0x26')](saveUpdates(_0x3433a9[_0xfe6e('0x48')],null))[_0xfe6e('0x26')](respondWithResult(_0x1edbbf,null))['catch'](handleError(_0x1edbbf,null));};exports[_0xfe6e('0x25')]=function(_0x58ca80,_0x3e0a03){return db[_0xfe6e('0x2f')][_0xfe6e('0x46')]({'where':{'id':_0x58ca80[_0xfe6e('0x4e')]['id']}})[_0xfe6e('0x26')](handleEntityNotFound(_0x3e0a03,null))[_0xfe6e('0x26')](removeEntity(_0x3e0a03,null))[_0xfe6e('0x43')](handleError(_0x3e0a03,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 5242b03..b614585 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 _0x7afd=['exports','define','Template','tools_templates','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./template.attributes'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x7afd,0x64));var _0xd7af=function(_0x333fc8,_0x2b292c){_0x333fc8=_0x333fc8-0x0;var _0x432439=_0x7afd[_0x333fc8];return _0x432439;};'use strict';var _=require(_0xd7af('0x0'));var util=require('util');var logger=require(_0xd7af('0x1'))(_0xd7af('0x2'));var moment=require(_0xd7af('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7af('0x4'));var rimraf=require(_0xd7af('0x5'));var config=require(_0xd7af('0x6'));var attributes=require(_0xd7af('0x7'));module[_0xd7af('0x8')]=function(_0x3bd3c0,_0x4e9c63){return _0x3bd3c0[_0xd7af('0x9')](_0xd7af('0xa'),attributes,{'tableName':_0xd7af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb826=['rimraf','../../config/environment','exports','define','Template','lodash','../../config/logger','bluebird','request-promise','path'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb826,0x1ef));var _0x6b82=function(_0x56bd82,_0x5b35ca){_0x56bd82=_0x56bd82-0x0;var _0x5a6bbd=_0xb826[_0x56bd82];return _0x5a6bbd;};'use strict';var _=require(_0x6b82('0x0'));var util=require('util');var logger=require(_0x6b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6b82('0x2'));var rp=require(_0x6b82('0x3'));var fs=require('fs');var path=require(_0x6b82('0x4'));var rimraf=require(_0x6b82('0x5'));var config=require(_0x6b82('0x6'));var attributes=require('./template.attributes');module[_0x6b82('0x7')]=function(_0x272ef7,_0xef7d66){return _0x272ef7[_0x6b82('0x8')](_0x6b82('0x9'),attributes,{'tableName':'tools_templates','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 163ab24..551ab52 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 _0xcea1=['message','result','catch','GetTemplate','Template','findAll','options','raw','where','limit','include','map','model','attributes','debug','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','error'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xcea1,0x150));var _0x1cea=function(_0x196f40,_0x417e6e){_0x196f40=_0x196f40-0x0;var _0x544d7b=_0xcea1[_0x196f40];return _0x544d7b;};'use strict';var _=require(_0x1cea('0x0'));var util=require(_0x1cea('0x1'));var moment=require('moment');var BPromise=require(_0x1cea('0x2'));var rs=require(_0x1cea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cea('0x4'))['db'];var utils=require(_0x1cea('0x5'));var logger=require('../../config/logger')(_0x1cea('0x6'));var config=require(_0x1cea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1cea('0x8')][_0x1cea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc6c68b,_0x49cb6e,_0x556e8b){return new BPromise(function(_0x2418cd,_0x36bbc2){return client[_0x1cea('0xa')](_0xc6c68b,_0x556e8b)[_0x1cea('0xb')](function(_0x4412a7){logger[_0x1cea('0xc')](_0x1cea('0xd'),_0x49cb6e,'request\x20sent');logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x49cb6e,_0x1cea('0xe'),JSON['stringify'](_0x4412a7));if(_0x4412a7['error']){if(_0x4412a7[_0x1cea('0xf')]['code']===0x1f4){logger[_0x1cea('0xf')](_0x1cea('0xd'),_0x49cb6e,_0x4412a7[_0x1cea('0xf')][_0x1cea('0x10')]);return _0x36bbc2(_0x4412a7[_0x1cea('0xf')][_0x1cea('0x10')]);}logger[_0x1cea('0xf')](_0x1cea('0xd'),_0x49cb6e,_0x4412a7['error'][_0x1cea('0x10')]);return _0x2418cd(_0x4412a7[_0x1cea('0xf')][_0x1cea('0x10')]);}else{logger[_0x1cea('0xc')]('Template,\x20%s,\x20%s',_0x49cb6e,'request\x20sent');_0x2418cd(_0x4412a7[_0x1cea('0x11')][_0x1cea('0x10')]);}})[_0x1cea('0x12')](function(_0x2d31e8){logger['error'](_0x1cea('0xd'),_0x49cb6e,_0x2d31e8);_0x36bbc2(_0x2d31e8);});});}exports[_0x1cea('0x13')]=function(_0x5c5868){var _0xcc5cfc=this;return new Promise(function(_0x3180be,_0x54cdd6){return db[_0x1cea('0x14')][_0x1cea('0x15')]({'raw':_0x5c5868[_0x1cea('0x16')]?_0x5c5868['options'][_0x1cea('0x17')]===undefined?!![]:![]:!![],'where':_0x5c5868[_0x1cea('0x16')]?_0x5c5868[_0x1cea('0x16')][_0x1cea('0x18')]||null:null,'attributes':_0x5c5868[_0x1cea('0x16')]?_0x5c5868[_0x1cea('0x16')]['attributes']||null:null,'limit':_0x5c5868[_0x1cea('0x16')]?_0x5c5868[_0x1cea('0x16')][_0x1cea('0x19')]||null:null,'include':_0x5c5868[_0x1cea('0x16')]?_0x5c5868[_0x1cea('0x16')][_0x1cea('0x1a')]?_[_0x1cea('0x1b')](_0x5c5868['options']['include'],function(_0x1b5a21){return{'model':db[_0x1b5a21[_0x1cea('0x1c')]],'as':_0x1b5a21['as'],'attributes':_0x1b5a21[_0x1cea('0x1d')],'include':_0x1b5a21['include']?_[_0x1cea('0x1b')](_0x1b5a21[_0x1cea('0x1a')],function(_0x373547){return{'model':db[_0x373547[_0x1cea('0x1c')]],'as':_0x373547['as'],'attributes':_0x373547[_0x1cea('0x1d')],'include':_0x373547[_0x1cea('0x1a')]?_[_0x1cea('0x1b')](_0x373547[_0x1cea('0x1a')],function(_0x2d373d){return{'model':db[_0x2d373d[_0x1cea('0x1c')]],'as':_0x2d373d['as'],'attributes':_0x2d373d['attributes']};}):[]};}):[]};}):[]:[]})[_0x1cea('0xb')](function(_0x3b4b25){logger['info']('GetTemplate',_0x5c5868);logger[_0x1cea('0x1e')](_0x1cea('0x13'),_0x5c5868,JSON[_0x1cea('0x1f')](_0x3b4b25));_0x3180be(_0x3b4b25);})['catch'](function(_0x4025fb){logger[_0x1cea('0xf')](_0x1cea('0x13'),_0x4025fb[_0x1cea('0x10')],_0x5c5868);_0x54cdd6(_0xcc5cfc[_0x1cea('0xf')](0x1f4,_0x4025fb[_0x1cea('0x10')]));});});}; \ No newline at end of file +var _0x2737=['model','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTemplate','Template','findAll','options','raw','attributes','include','map'];(function(_0x2deb01,_0x4e741c){var _0x3920b3=function(_0x391a64){while(--_0x391a64){_0x2deb01['push'](_0x2deb01['shift']());}};_0x3920b3(++_0x4e741c);}(_0x2737,0xa1));var _0x7273=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2737[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7273('0x0'));var BPromise=require(_0x7273('0x1'));var rs=require(_0x7273('0x2'));var fs=require('fs');var Redis=require(_0x7273('0x3'));var db=require(_0x7273('0x4'))['db'];var utils=require(_0x7273('0x5'));var logger=require(_0x7273('0x6'))(_0x7273('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7273('0x8')][_0x7273('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d110c,_0x2244a4,_0xa14ce8){return new BPromise(function(_0x329724,_0xaf1ebf){return client[_0x7273('0xa')](_0x5d110c,_0xa14ce8)[_0x7273('0xb')](function(_0x5c26c4){logger['info'](_0x7273('0xc'),_0x2244a4,_0x7273('0xd'));logger[_0x7273('0xe')](_0x7273('0xf'),_0x2244a4,_0x7273('0xd'),JSON[_0x7273('0x10')](_0x5c26c4));if(_0x5c26c4[_0x7273('0x11')]){if(_0x5c26c4[_0x7273('0x11')][_0x7273('0x12')]===0x1f4){logger[_0x7273('0x11')](_0x7273('0xc'),_0x2244a4,_0x5c26c4[_0x7273('0x11')][_0x7273('0x13')]);return _0xaf1ebf(_0x5c26c4['error'][_0x7273('0x13')]);}logger[_0x7273('0x11')](_0x7273('0xc'),_0x2244a4,_0x5c26c4[_0x7273('0x11')][_0x7273('0x13')]);return _0x329724(_0x5c26c4['error']['message']);}else{logger[_0x7273('0x14')]('Template,\x20%s,\x20%s',_0x2244a4,_0x7273('0xd'));_0x329724(_0x5c26c4[_0x7273('0x15')][_0x7273('0x13')]);}})[_0x7273('0x16')](function(_0x1828f4){logger[_0x7273('0x11')](_0x7273('0xc'),_0x2244a4,_0x1828f4);_0xaf1ebf(_0x1828f4);});});}exports[_0x7273('0x17')]=function(_0x5e3739){var _0x4227e6=this;return new Promise(function(_0x306733,_0x3460f1){return db[_0x7273('0x18')][_0x7273('0x19')]({'raw':_0x5e3739[_0x7273('0x1a')]?_0x5e3739['options'][_0x7273('0x1b')]===undefined?!![]:![]:!![],'where':_0x5e3739[_0x7273('0x1a')]?_0x5e3739[_0x7273('0x1a')]['where']||null:null,'attributes':_0x5e3739['options']?_0x5e3739[_0x7273('0x1a')][_0x7273('0x1c')]||null:null,'limit':_0x5e3739[_0x7273('0x1a')]?_0x5e3739['options']['limit']||null:null,'include':_0x5e3739[_0x7273('0x1a')]?_0x5e3739[_0x7273('0x1a')][_0x7273('0x1d')]?_[_0x7273('0x1e')](_0x5e3739[_0x7273('0x1a')][_0x7273('0x1d')],function(_0x18b5b2){return{'model':db[_0x18b5b2[_0x7273('0x1f')]],'as':_0x18b5b2['as'],'attributes':_0x18b5b2[_0x7273('0x1c')],'include':_0x18b5b2[_0x7273('0x1d')]?_[_0x7273('0x1e')](_0x18b5b2[_0x7273('0x1d')],function(_0x29111e){return{'model':db[_0x29111e['model']],'as':_0x29111e['as'],'attributes':_0x29111e['attributes'],'include':_0x29111e['include']?_['map'](_0x29111e['include'],function(_0x2ad572){return{'model':db[_0x2ad572[_0x7273('0x1f')]],'as':_0x2ad572['as'],'attributes':_0x2ad572[_0x7273('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7273('0xb')](function(_0x39ea40){logger[_0x7273('0x14')](_0x7273('0x17'),_0x5e3739);logger[_0x7273('0xe')](_0x7273('0x17'),_0x5e3739,JSON['stringify'](_0x39ea40));_0x306733(_0x39ea40);})[_0x7273('0x16')](function(_0x15f5d1){logger[_0x7273('0x11')](_0x7273('0x17'),_0x15f5d1['message'],_0x5e3739);_0x3460f1(_0x4227e6[_0x7273('0x11')](0x1f4,_0x15f5d1[_0x7273('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 18126c1..8f3d7a9 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 _0xea17=['delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAnyConditions','post','create','/:id/any_conditions','addAnyCondition','addAction','put'];(function(_0x50d433,_0x21a962){var _0x28d422=function(_0x5437d6){while(--_0x5437d6){_0x50d433['push'](_0x50d433['shift']());}};_0x28d422(++_0x21a962);}(_0xea17,0xa3));var _0x7ea1=function(_0x660da0,_0x5b1d24){_0x660da0=_0x660da0-0x0;var _0x195a51=_0xea17[_0x660da0];return _0x195a51;};'use strict';var multer=require(_0x7ea1('0x0'));var util=require(_0x7ea1('0x1'));var path=require(_0x7ea1('0x2'));var timeout=require(_0x7ea1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7ea1('0x4'));var auth=require(_0x7ea1('0x5'));var interaction=require(_0x7ea1('0x6'));var config=require('../../config/environment');var controller=require(_0x7ea1('0x7'));router[_0x7ea1('0x8')]('/',auth[_0x7ea1('0x9')](),controller[_0x7ea1('0xa')]);router[_0x7ea1('0x8')](_0x7ea1('0xb'),auth[_0x7ea1('0x9')](),controller[_0x7ea1('0xc')]);router['get'](_0x7ea1('0xd'),auth[_0x7ea1('0x9')](),controller['getAllConditions']);router[_0x7ea1('0x8')]('/:id/any_conditions',auth[_0x7ea1('0x9')](),controller[_0x7ea1('0xe')]);router['get']('/:id/actions',auth[_0x7ea1('0x9')](),controller['getActions']);router[_0x7ea1('0xf')]('/',auth[_0x7ea1('0x9')](),controller[_0x7ea1('0x10')]);router['post'](_0x7ea1('0xd'),auth[_0x7ea1('0x9')](),controller['addAllCondition']);router[_0x7ea1('0xf')](_0x7ea1('0x11'),auth['isAuthenticated'](),controller[_0x7ea1('0x12')]);router[_0x7ea1('0xf')]('/:id/actions',auth[_0x7ea1('0x9')](),controller[_0x7ea1('0x13')]);router[_0x7ea1('0x14')](_0x7ea1('0xb'),auth[_0x7ea1('0x9')](),controller['update']);router[_0x7ea1('0x15')](_0x7ea1('0xb'),auth[_0x7ea1('0x9')](),controller[_0x7ea1('0x16')]);module['exports']=router; \ No newline at end of file +var _0x71ee=['delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','/:id/actions','post','addAllCondition','addAnyCondition','addAction','put'];(function(_0x28da79,_0x54d56b){var _0x477817=function(_0x3ca4f7){while(--_0x3ca4f7){_0x28da79['push'](_0x28da79['shift']());}};_0x477817(++_0x54d56b);}(_0x71ee,0x1cb));var _0xe71e=function(_0x4baae3,_0x5f0235){_0x4baae3=_0x4baae3-0x0;var _0x454819=_0x71ee[_0x4baae3];return _0x454819;};'use strict';var multer=require(_0xe71e('0x0'));var util=require('util');var path=require(_0xe71e('0x1'));var timeout=require('connect-timeout');var express=require(_0xe71e('0x2'));var router=express[_0xe71e('0x3')]();var fs_extra=require(_0xe71e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe71e('0x5'));var config=require(_0xe71e('0x6'));var controller=require(_0xe71e('0x7'));router[_0xe71e('0x8')]('/',auth[_0xe71e('0x9')](),controller[_0xe71e('0xa')]);router['get'](_0xe71e('0xb'),auth['isAuthenticated'](),controller[_0xe71e('0xc')]);router['get']('/:id/all_conditions',auth[_0xe71e('0x9')](),controller[_0xe71e('0xd')]);router[_0xe71e('0x8')](_0xe71e('0xe'),auth[_0xe71e('0x9')](),controller['getAnyConditions']);router[_0xe71e('0x8')](_0xe71e('0xf'),auth[_0xe71e('0x9')](),controller['getActions']);router[_0xe71e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe71e('0x10')]('/:id/all_conditions',auth[_0xe71e('0x9')](),controller[_0xe71e('0x11')]);router['post'](_0xe71e('0xe'),auth[_0xe71e('0x9')](),controller[_0xe71e('0x12')]);router[_0xe71e('0x10')](_0xe71e('0xf'),auth[_0xe71e('0x9')](),controller[_0xe71e('0x13')]);router[_0xe71e('0x14')](_0xe71e('0xb'),auth[_0xe71e('0x9')](),controller['update']);router[_0xe71e('0x15')](_0xe71e('0xb'),auth[_0xe71e('0x9')](),controller[_0xe71e('0x16')]);module[_0xe71e('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 26e5c87..40d3618 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 _0x6f47=['STRING','exports'];(function(_0x2118ad,_0xe8e3fd){var _0x4b5715=function(_0x399f72){while(--_0x399f72){_0x2118ad['push'](_0x2118ad['shift']());}};_0x4b5715(++_0xe8e3fd);}(_0x6f47,0xc7));var _0x76f4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6f47[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x76f4('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4c75=['STRING','BOOLEAN','sequelize','exports'];(function(_0x325d4e,_0x376461){var _0x6cde45=function(_0x376c1a){while(--_0x376c1a){_0x325d4e['push'](_0x325d4e['shift']());}};_0x6cde45(++_0x376461);}(_0x4c75,0xf6));var _0x54c7=function(_0x6d0c3e,_0xbc2aed){_0x6d0c3e=_0x6d0c3e-0x0;var _0x2895ce=_0x4c75[_0x6d0c3e];return _0x2895ce;};'use strict';var Sequelize=require(_0x54c7('0x0'));module[_0x54c7('0x1')]={'name':{'type':Sequelize[_0x54c7('0x2')]},'channel':{'type':Sequelize[_0x54c7('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x54c7('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 04716a2..deae848 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 _0x6881=['getActions','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Triggers','UserProfileResource','then','sendStatus','error','stack','name','send','map','Trigger','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','rawAttributes','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Condition','addAnyCondition','TriggerAnyId','findOne','getAllConditions','getAnyConditions','TriggerId','Action'];(function(_0x32f53,_0x265d56){var _0x3868ae=function(_0x51e1af){while(--_0x51e1af){_0x32f53['push'](_0x32f53['shift']());}};_0x3868ae(++_0x265d56);}(_0x6881,0x1dc));var _0x1688=function(_0x165cf4,_0x26dc04){_0x165cf4=_0x165cf4-0x0;var _0x210676=_0x6881[_0x165cf4];return _0x210676;};'use strict';var emlformat=require(_0x1688('0x0'));var rimraf=require(_0x1688('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1688('0x2'));var rp=require(_0x1688('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1688('0x4'));var util=require(_0x1688('0x5'));var path=require(_0x1688('0x6'));var sox=require(_0x1688('0x7'));var csv=require(_0x1688('0x8'));var ejs=require(_0x1688('0x9'));var fs=require('fs');var fs_extra=require(_0x1688('0xa'));var _=require(_0x1688('0xb'));var squel=require(_0x1688('0xc'));var crypto=require(_0x1688('0xd'));var jsforce=require(_0x1688('0xe'));var deskjs=require(_0x1688('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1688('0x10'));var Papa=require(_0x1688('0x11'));var Redis=require(_0x1688('0x12'));var authService=require(_0x1688('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1688('0x14'));var hardwareService=require(_0x1688('0x15'));var logger=require(_0x1688('0x16'))(_0x1688('0x17'));var utils=require(_0x1688('0x18'));var config=require(_0x1688('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55fc1c,_0x3b3b38){_0x3b3b38=_0x3b3b38||0xcc;return function(_0x4f429f){if(_0x4f429f){return _0x55fc1c['sendStatus'](_0x3b3b38);}return _0x55fc1c[_0x1688('0x1a')](_0x3b3b38)[_0x1688('0x1b')]();};}function respondWithResult(_0x488401,_0x2eb445){_0x2eb445=_0x2eb445||0xc8;return function(_0x4cf4ac){if(_0x4cf4ac){return _0x488401[_0x1688('0x1a')](_0x2eb445)[_0x1688('0x1c')](_0x4cf4ac);}};}function respondWithFilteredResult(_0x4322d,_0x569d66){return function(_0xe6173b){if(_0xe6173b){var _0x31e64e=typeof _0x569d66[_0x1688('0x1d')]===_0x1688('0x1e')&&typeof _0x569d66[_0x1688('0x1f')]===_0x1688('0x1e');var _0xe49409=_0xe6173b[_0x1688('0x20')];var _0xbb72a0=_0x31e64e?0x0:_0x569d66[_0x1688('0x1d')];var _0x27923a=_0x31e64e?_0xe6173b[_0x1688('0x20')]:_0x569d66[_0x1688('0x1d')]+_0x569d66[_0x1688('0x1f')];var _0x4b27c0;if(_0x27923a>=_0xe49409){_0x27923a=_0xe49409;_0x4b27c0=0xc8;}else{_0x4b27c0=0xce;}_0x4322d[_0x1688('0x1a')](_0x4b27c0);return _0x4322d[_0x1688('0x21')](_0x1688('0x22'),_0xbb72a0+'-'+_0x27923a+'/'+_0xe49409)['json'](_0xe6173b);}return null;};}function patchUpdates(_0x2c0b82){return function(_0x5af48e){try{jsonpatch[_0x1688('0x23')](_0x5af48e,_0x2c0b82,!![]);}catch(_0x5ca38f){return BPromise[_0x1688('0x24')](_0x5ca38f);}return _0x5af48e[_0x1688('0x25')]();};}function saveUpdates(_0x4e5b0b,_0x48e8f0){return function(_0x252c75){if(_0x252c75){return _0x252c75[_0x1688('0x26')](_0x4e5b0b)['then'](function(_0x3935a8){return _0x3935a8;});}return null;};}function removeEntity(_0x301e3a,_0x341a49){return function(_0x3de5fe){if(_0x3de5fe){return _0x3de5fe[_0x1688('0x27')]()['then'](function(){var _0x32a328=_0x3de5fe[_0x1688('0x28')]({'plain':!![]});var _0x19105e=_0x1688('0x29');return db[_0x1688('0x2a')][_0x1688('0x27')]({'where':{'type':_0x19105e,'resourceId':_0x32a328['id']}})[_0x1688('0x2b')](function(){return _0x3de5fe;});})[_0x1688('0x2b')](function(){_0x301e3a[_0x1688('0x1a')](0xcc)[_0x1688('0x1b')]();});}};}function handleEntityNotFound(_0x2aa696,_0x34ec4f){return function(_0x377271){if(!_0x377271){_0x2aa696[_0x1688('0x2c')](0x194);}return _0x377271;};}function handleError(_0x114fe2,_0x2dc923){_0x2dc923=_0x2dc923||0x1f4;return function(_0x5c533a){logger[_0x1688('0x2d')](_0x5c533a[_0x1688('0x2e')]);if(_0x5c533a[_0x1688('0x2f')]){delete _0x5c533a[_0x1688('0x2f')];}_0x114fe2[_0x1688('0x1a')](_0x2dc923)[_0x1688('0x30')](_0x5c533a);};}exports['index']=function(_0x43ab21,_0x154a1c){var _0x20c285={},_0x15cacd={},_0x3272d0={'count':0x0,'rows':[]};var _0x48e4ef=_[_0x1688('0x31')](db[_0x1688('0x32')]['rawAttributes'],function(_0x3618f){return{'name':_0x3618f['fieldName'],'type':_0x3618f[_0x1688('0x33')][_0x1688('0x34')]};});_0x15cacd[_0x1688('0x35')]=_[_0x1688('0x31')](_0x48e4ef,_0x1688('0x2f'));_0x15cacd['query']=_['keys'](_0x43ab21[_0x1688('0x36')]);_0x15cacd[_0x1688('0x37')]=_['intersection'](_0x15cacd[_0x1688('0x35')],_0x15cacd['query']);_0x20c285['attributes']=_[_0x1688('0x38')](_0x15cacd['model'],qs[_0x1688('0x39')](_0x43ab21[_0x1688('0x36')][_0x1688('0x39')]));_0x20c285['attributes']=_0x20c285[_0x1688('0x3a')][_0x1688('0x3b')]?_0x20c285['attributes']:_0x15cacd[_0x1688('0x35')];if(!_0x43ab21[_0x1688('0x36')][_0x1688('0x3c')](_0x1688('0x3d'))){_0x20c285['limit']=qs[_0x1688('0x1f')](_0x43ab21['query']['limit']);_0x20c285[_0x1688('0x1d')]=qs[_0x1688('0x1d')](_0x43ab21[_0x1688('0x36')][_0x1688('0x1d')]);}_0x20c285[_0x1688('0x3e')]=qs[_0x1688('0x3f')](_0x43ab21[_0x1688('0x36')][_0x1688('0x3f')]);_0x20c285[_0x1688('0x40')]=qs[_0x1688('0x37')](_[_0x1688('0x41')](_0x43ab21[_0x1688('0x36')],_0x15cacd[_0x1688('0x37')]),_0x48e4ef);if(_0x43ab21['query'][_0x1688('0x42')]){_0x20c285['where']=_[_0x1688('0x43')](_0x20c285[_0x1688('0x40')],{'$or':_[_0x1688('0x31')](_0x48e4ef,function(_0x151dba){if(_0x151dba[_0x1688('0x33')]!==_0x1688('0x44')){var _0x51f583={};_0x51f583[_0x151dba[_0x1688('0x2f')]]={'$like':'%'+_0x43ab21[_0x1688('0x36')][_0x1688('0x42')]+'%'};return _0x51f583;}})});}_0x20c285=_['merge']({},_0x20c285,_0x43ab21['options']);var _0x4eed04={'where':_0x20c285[_0x1688('0x40')]};return db['Trigger'][_0x1688('0x20')](_0x4eed04)[_0x1688('0x2b')](function(_0x1b5159){_0x3272d0[_0x1688('0x20')]=_0x1b5159;if(_0x43ab21[_0x1688('0x36')][_0x1688('0x45')]){_0x20c285['include']=[{'all':!![]}];}return db['Trigger']['findAll'](_0x20c285);})[_0x1688('0x2b')](function(_0x5afe3e){_0x3272d0[_0x1688('0x46')]=_0x5afe3e;return _0x3272d0;})[_0x1688('0x2b')](respondWithFilteredResult(_0x154a1c,_0x20c285))[_0x1688('0x47')](handleError(_0x154a1c,null));};exports[_0x1688('0x48')]=function(_0x4b4d4b,_0x4a5985){var _0x7e47a4={'raw':![],'where':{'id':_0x4b4d4b[_0x1688('0x49')]['id']}},_0x10d31b={};_0x10d31b[_0x1688('0x35')]=_[_0x1688('0x4a')](db[_0x1688('0x32')][_0x1688('0x4b')]);_0x10d31b[_0x1688('0x36')]=_[_0x1688('0x4a')](_0x4b4d4b[_0x1688('0x36')]);_0x10d31b['filters']=_[_0x1688('0x38')](_0x10d31b[_0x1688('0x35')],_0x10d31b['query']);_0x7e47a4[_0x1688('0x3a')]=_[_0x1688('0x38')](_0x10d31b['model'],qs[_0x1688('0x39')](_0x4b4d4b[_0x1688('0x36')]['fields']));_0x7e47a4[_0x1688('0x3a')]=_0x7e47a4['attributes'][_0x1688('0x3b')]?_0x7e47a4['attributes']:_0x10d31b[_0x1688('0x35')];if(_0x4b4d4b['query'][_0x1688('0x45')]){_0x7e47a4[_0x1688('0x4c')]=[{'all':!![]}];}_0x7e47a4=_['merge']({},_0x7e47a4,_0x4b4d4b[_0x1688('0x4d')]);return db[_0x1688('0x32')][_0x1688('0x4e')](_0x7e47a4)[_0x1688('0x2b')](handleEntityNotFound(_0x4a5985,null))[_0x1688('0x2b')](respondWithResult(_0x4a5985,null))['catch'](handleError(_0x4a5985,null));};exports[_0x1688('0x4f')]=function(_0x383a64,_0x39a251){return db['Trigger']['create'](_0x383a64[_0x1688('0x50')],{})[_0x1688('0x2b')](function(_0x185d66){var _0x8e091a=_0x383a64[_0x1688('0x51')][_0x1688('0x28')]({'plain':!![]});if(!_0x8e091a)throw new Error(_0x1688('0x52'));if(_0x8e091a['role']===_0x1688('0x51')){var _0x5e9185=_0x185d66['get']({'plain':!![]});var _0xa0eea8=_0x1688('0x29');return db[_0x1688('0x53')][_0x1688('0x4e')]({'where':{'name':_0xa0eea8,'userProfileId':_0x8e091a['userProfileId']},'raw':!![]})[_0x1688('0x2b')](function(_0x46eded){if(_0x46eded&&_0x46eded[_0x1688('0x54')]===0x0){return db[_0x1688('0x2a')][_0x1688('0x4f')]({'name':_0x5e9185[_0x1688('0x2f')],'resourceId':_0x5e9185['id'],'type':_0x46eded[_0x1688('0x2f')],'sectionId':_0x46eded['id']},{})[_0x1688('0x2b')](function(){return _0x185d66;});}else{return _0x185d66;}})[_0x1688('0x47')](function(_0x3bfd7a){logger[_0x1688('0x2d')](_0x1688('0x55'),_0x3bfd7a);throw _0x3bfd7a;});}return _0x185d66;})[_0x1688('0x2b')](respondWithResult(_0x39a251,0xc9))[_0x1688('0x47')](handleError(_0x39a251,null));};exports['update']=function(_0x37104c,_0x1b6dc6){if(_0x37104c[_0x1688('0x50')]['id']){delete _0x37104c['body']['id'];}return db[_0x1688('0x32')]['find']({'where':{'id':_0x37104c[_0x1688('0x49')]['id']}})[_0x1688('0x2b')](handleEntityNotFound(_0x1b6dc6,null))['then'](saveUpdates(_0x37104c[_0x1688('0x50')],null))[_0x1688('0x2b')](respondWithResult(_0x1b6dc6,null))['catch'](handleError(_0x1b6dc6,null));};exports[_0x1688('0x27')]=function(_0x56b25d,_0x2b277e){return db['Trigger'][_0x1688('0x4e')]({'where':{'id':_0x56b25d['params']['id']}})[_0x1688('0x2b')](handleEntityNotFound(_0x2b277e,null))['then'](removeEntity(_0x2b277e,null))[_0x1688('0x47')](handleError(_0x2b277e,null));};exports['addAllCondition']=function(_0x293717,_0x297e82,_0x244544){if(_0x293717[_0x1688('0x50')]['id']){delete _0x293717[_0x1688('0x50')]['id'];}return db[_0x1688('0x32')]['find']({'where':{'id':_0x293717['params']['id']}})[_0x1688('0x2b')](handleEntityNotFound(_0x297e82,null))[_0x1688('0x2b')](function(_0x4d8fed){if(_0x4d8fed){_0x293717[_0x1688('0x50')]['TriggerAllId']=_0x4d8fed['id'];return db[_0x1688('0x56')]['create'](_0x293717[_0x1688('0x50')]);}})[_0x1688('0x2b')](respondWithResult(_0x297e82,null))[_0x1688('0x47')](handleError(_0x297e82,null));};exports[_0x1688('0x57')]=function(_0x443adf,_0x112abc,_0x50e728){if(_0x443adf['body']['id']){delete _0x443adf[_0x1688('0x50')]['id'];}return db[_0x1688('0x32')][_0x1688('0x4e')]({'where':{'id':_0x443adf['params']['id']}})['then'](handleEntityNotFound(_0x112abc,null))[_0x1688('0x2b')](function(_0x5c9429){if(_0x5c9429){_0x443adf[_0x1688('0x50')][_0x1688('0x58')]=_0x5c9429['id'];return db[_0x1688('0x56')]['create'](_0x443adf['body']);}})[_0x1688('0x2b')](respondWithResult(_0x112abc,null))[_0x1688('0x47')](handleError(_0x112abc,null));};exports['getAllConditions']=function(_0x2803ea,_0x5dab82,_0x36089f){var _0x25eb2d={};var _0x433924={};var _0x41618e;var _0x56e9b3;return db['Trigger'][_0x1688('0x59')]({'where':{'id':_0x2803ea[_0x1688('0x49')]['id']}})[_0x1688('0x2b')](handleEntityNotFound(_0x5dab82,null))[_0x1688('0x2b')](function(_0x1e9e89){if(_0x1e9e89){_0x41618e=_0x1e9e89;_0x433924['model']=_[_0x1688('0x4a')](db[_0x1688('0x56')][_0x1688('0x4b')]);_0x433924[_0x1688('0x36')]=_['keys'](_0x2803ea[_0x1688('0x36')]);_0x433924['filters']=_[_0x1688('0x38')](_0x433924[_0x1688('0x35')],_0x433924[_0x1688('0x36')]);_0x25eb2d[_0x1688('0x3a')]=_[_0x1688('0x38')](_0x433924['model'],qs[_0x1688('0x39')](_0x2803ea['query'][_0x1688('0x39')]));_0x25eb2d[_0x1688('0x3a')]=_0x25eb2d['attributes'][_0x1688('0x3b')]?_0x25eb2d['attributes']:_0x433924[_0x1688('0x35')];_0x25eb2d['order']=qs[_0x1688('0x3f')](_0x2803ea['query'][_0x1688('0x3f')]);_0x25eb2d[_0x1688('0x40')]=qs[_0x1688('0x37')](_['pick'](_0x2803ea[_0x1688('0x36')],_0x433924[_0x1688('0x37')]));if(_0x2803ea['query'][_0x1688('0x42')]){_0x25eb2d[_0x1688('0x40')]=_[_0x1688('0x43')](_0x25eb2d['where'],{'$or':_[_0x1688('0x31')](_0x25eb2d[_0x1688('0x3a')],function(_0x943caa){var _0x3f15ef={};_0x3f15ef[_0x943caa]={'$like':'%'+_0x2803ea[_0x1688('0x36')][_0x1688('0x42')]+'%'};return _0x3f15ef;})});}_0x25eb2d=_[_0x1688('0x43')]({},_0x25eb2d,_0x2803ea['options']);return _0x41618e[_0x1688('0x5a')](_0x25eb2d);}})[_0x1688('0x2b')](function(_0x476614){if(_0x476614){_0x56e9b3=_0x476614[_0x1688('0x3b')];if(!_0x2803ea[_0x1688('0x36')][_0x1688('0x3c')](_0x1688('0x3d'))){_0x25eb2d[_0x1688('0x1f')]=qs['limit'](_0x2803ea[_0x1688('0x36')][_0x1688('0x1f')]);_0x25eb2d[_0x1688('0x1d')]=qs[_0x1688('0x1d')](_0x2803ea[_0x1688('0x36')][_0x1688('0x1d')]);}return _0x41618e[_0x1688('0x5a')](_0x25eb2d);}})['then'](function(_0x1a1c55){if(_0x1a1c55){return _0x1a1c55?{'count':_0x56e9b3,'rows':_0x1a1c55}:null;}})[_0x1688('0x2b')](respondWithResult(_0x5dab82,null))[_0x1688('0x47')](handleError(_0x5dab82,null));};exports[_0x1688('0x5b')]=function(_0x225b39,_0x3d6f5c,_0x2e7dd1){var _0x24d771={};var _0x25d67f={};var _0x2cfc53;var _0x1f1872;return db[_0x1688('0x32')]['findOne']({'where':{'id':_0x225b39['params']['id']}})[_0x1688('0x2b')](handleEntityNotFound(_0x3d6f5c,null))['then'](function(_0x49677a){if(_0x49677a){_0x2cfc53=_0x49677a;_0x25d67f[_0x1688('0x35')]=_[_0x1688('0x4a')](db[_0x1688('0x56')]['rawAttributes']);_0x25d67f['query']=_[_0x1688('0x4a')](_0x225b39['query']);_0x25d67f['filters']=_[_0x1688('0x38')](_0x25d67f[_0x1688('0x35')],_0x25d67f[_0x1688('0x36')]);_0x24d771[_0x1688('0x3a')]=_[_0x1688('0x38')](_0x25d67f[_0x1688('0x35')],qs[_0x1688('0x39')](_0x225b39[_0x1688('0x36')][_0x1688('0x39')]));_0x24d771[_0x1688('0x3a')]=_0x24d771[_0x1688('0x3a')][_0x1688('0x3b')]?_0x24d771[_0x1688('0x3a')]:_0x25d67f[_0x1688('0x35')];_0x24d771[_0x1688('0x3e')]=qs[_0x1688('0x3f')](_0x225b39[_0x1688('0x36')][_0x1688('0x3f')]);_0x24d771[_0x1688('0x40')]=qs[_0x1688('0x37')](_[_0x1688('0x41')](_0x225b39[_0x1688('0x36')],_0x25d67f[_0x1688('0x37')]));if(_0x225b39['query'][_0x1688('0x42')]){_0x24d771[_0x1688('0x40')]=_['merge'](_0x24d771['where'],{'$or':_[_0x1688('0x31')](_0x24d771[_0x1688('0x3a')],function(_0x43cd3f){var _0x3122b1={};_0x3122b1[_0x43cd3f]={'$like':'%'+_0x225b39[_0x1688('0x36')][_0x1688('0x42')]+'%'};return _0x3122b1;})});}_0x24d771=_['merge']({},_0x24d771,_0x225b39['options']);return _0x2cfc53[_0x1688('0x5b')](_0x24d771);}})[_0x1688('0x2b')](function(_0x1dca73){if(_0x1dca73){_0x1f1872=_0x1dca73[_0x1688('0x3b')];if(!_0x225b39[_0x1688('0x36')]['hasOwnProperty'](_0x1688('0x3d'))){_0x24d771[_0x1688('0x1f')]=qs[_0x1688('0x1f')](_0x225b39[_0x1688('0x36')][_0x1688('0x1f')]);_0x24d771[_0x1688('0x1d')]=qs[_0x1688('0x1d')](_0x225b39[_0x1688('0x36')]['offset']);}return _0x2cfc53[_0x1688('0x5b')](_0x24d771);}})[_0x1688('0x2b')](function(_0x5d87ce){if(_0x5d87ce){return _0x5d87ce?{'count':_0x1f1872,'rows':_0x5d87ce}:null;}})[_0x1688('0x2b')](respondWithResult(_0x3d6f5c,null))[_0x1688('0x47')](handleError(_0x3d6f5c,null));};exports['addAction']=function(_0x57f549,_0x21aa57,_0x1835d6){if(_0x57f549[_0x1688('0x50')]['id']){delete _0x57f549[_0x1688('0x50')]['id'];}return db[_0x1688('0x32')][_0x1688('0x4e')]({'where':{'id':_0x57f549[_0x1688('0x49')]['id']}})[_0x1688('0x2b')](handleEntityNotFound(_0x21aa57,null))[_0x1688('0x2b')](function(_0x4a20f0){if(_0x4a20f0){_0x57f549[_0x1688('0x50')][_0x1688('0x5c')]=_0x4a20f0['id'];return db['Action'][_0x1688('0x4f')](_0x57f549['body']);}})['then'](respondWithResult(_0x21aa57,null))[_0x1688('0x47')](handleError(_0x21aa57,null));};exports['getActions']=function(_0x4c7a74,_0xb5c9a2,_0x283646){var _0x109815={};var _0x1cb2ed={};var _0x5bb508;var _0x2fc382;return db[_0x1688('0x32')][_0x1688('0x59')]({'where':{'id':_0x4c7a74[_0x1688('0x49')]['id']}})['then'](handleEntityNotFound(_0xb5c9a2,null))[_0x1688('0x2b')](function(_0x55c03a){if(_0x55c03a){_0x5bb508=_0x55c03a;_0x1cb2ed[_0x1688('0x35')]=_[_0x1688('0x4a')](db[_0x1688('0x5d')][_0x1688('0x4b')]);_0x1cb2ed[_0x1688('0x36')]=_[_0x1688('0x4a')](_0x4c7a74['query']);_0x1cb2ed['filters']=_[_0x1688('0x38')](_0x1cb2ed[_0x1688('0x35')],_0x1cb2ed[_0x1688('0x36')]);_0x109815[_0x1688('0x3a')]=_[_0x1688('0x38')](_0x1cb2ed[_0x1688('0x35')],qs[_0x1688('0x39')](_0x4c7a74[_0x1688('0x36')]['fields']));_0x109815['attributes']=_0x109815[_0x1688('0x3a')][_0x1688('0x3b')]?_0x109815['attributes']:_0x1cb2ed[_0x1688('0x35')];_0x109815['order']=qs[_0x1688('0x3f')](_0x4c7a74['query'][_0x1688('0x3f')]);_0x109815[_0x1688('0x40')]=qs['filters'](_['pick'](_0x4c7a74[_0x1688('0x36')],_0x1cb2ed[_0x1688('0x37')]));if(_0x4c7a74[_0x1688('0x36')]['filter']){_0x109815['where']=_[_0x1688('0x43')](_0x109815[_0x1688('0x40')],{'$or':_['map'](_0x109815[_0x1688('0x3a')],function(_0x258a3f){var _0x19929b={};_0x19929b[_0x258a3f]={'$like':'%'+_0x4c7a74[_0x1688('0x36')]['filter']+'%'};return _0x19929b;})});}_0x109815=_[_0x1688('0x43')]({},_0x109815,_0x4c7a74[_0x1688('0x4d')]);return _0x5bb508[_0x1688('0x5e')](_0x109815);}})[_0x1688('0x2b')](function(_0x5a1a3e){if(_0x5a1a3e){_0x2fc382=_0x5a1a3e['length'];if(!_0x4c7a74['query'][_0x1688('0x3c')](_0x1688('0x3d'))){_0x109815[_0x1688('0x1f')]=qs[_0x1688('0x1f')](_0x4c7a74[_0x1688('0x36')][_0x1688('0x1f')]);_0x109815['offset']=qs[_0x1688('0x1d')](_0x4c7a74[_0x1688('0x36')][_0x1688('0x1d')]);}return _0x5bb508['getActions'](_0x109815);}})[_0x1688('0x2b')](function(_0x7801d1){if(_0x7801d1){return _0x7801d1?{'count':_0x2fc382,'rows':_0x7801d1}:null;}})[_0x1688('0x2b')](respondWithResult(_0xb5c9a2,null))['catch'](handleError(_0xb5c9a2,null));}; \ No newline at end of file +var _0x5066=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','getAllConditions','findOne','rawAttributes','hasOwnProperty','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','count','limit','Content-Range','save','update','destroy','then','Triggers','UserProfileResource','end','name','map','Trigger','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','options','findAll','catch','show','include','merge','find','create','body','user'];(function(_0x58f64e,_0x1a57a8){var _0x2aee49=function(_0x10b075){while(--_0x10b075){_0x58f64e['push'](_0x58f64e['shift']());}};_0x2aee49(++_0x1a57a8);}(_0x5066,0xc0));var _0x6506=function(_0x198446,_0x119c8f){_0x198446=_0x198446-0x0;var _0x38d7b7=_0x5066[_0x198446];return _0x38d7b7;};'use strict';var emlformat=require(_0x6506('0x0'));var rimraf=require(_0x6506('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6506('0x2'));var rp=require(_0x6506('0x3'));var moment=require(_0x6506('0x4'));var BPromise=require(_0x6506('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6506('0x6'));var sox=require(_0x6506('0x7'));var csv=require(_0x6506('0x8'));var ejs=require(_0x6506('0x9'));var fs=require('fs');var fs_extra=require(_0x6506('0xa'));var _=require('lodash');var squel=require(_0x6506('0xb'));var crypto=require('crypto');var jsforce=require(_0x6506('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6506('0x8'));var querystring=require(_0x6506('0xd'));var Papa=require(_0x6506('0xe'));var Redis=require(_0x6506('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6506('0x10'));var as=require(_0x6506('0x11'));var hardwareService=require(_0x6506('0x12'));var logger=require('../../config/logger')(_0x6506('0x13'));var utils=require(_0x6506('0x14'));var config=require(_0x6506('0x15'));var licenseUtil=require(_0x6506('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbbfda6,_0x4f287d){_0x4f287d=_0x4f287d||0xcc;return function(_0xf2840a){if(_0xf2840a){return _0xbbfda6[_0x6506('0x17')](_0x4f287d);}return _0xbbfda6[_0x6506('0x18')](_0x4f287d)['end']();};}function respondWithResult(_0x1e7681,_0x3683e5){_0x3683e5=_0x3683e5||0xc8;return function(_0x1619f2){if(_0x1619f2){return _0x1e7681['status'](_0x3683e5)[_0x6506('0x19')](_0x1619f2);}};}function respondWithFilteredResult(_0x18752c,_0x44b4d6){return function(_0x43dbd4){if(_0x43dbd4){var _0x530987=typeof _0x44b4d6[_0x6506('0x1a')]==='undefined'&&typeof _0x44b4d6['limit']==='undefined';var _0x356c77=_0x43dbd4[_0x6506('0x1b')];var _0x2de4d4=_0x530987?0x0:_0x44b4d6['offset'];var _0x31c98f=_0x530987?_0x43dbd4[_0x6506('0x1b')]:_0x44b4d6[_0x6506('0x1a')]+_0x44b4d6[_0x6506('0x1c')];var _0x4dfcd9;if(_0x31c98f>=_0x356c77){_0x31c98f=_0x356c77;_0x4dfcd9=0xc8;}else{_0x4dfcd9=0xce;}_0x18752c['status'](_0x4dfcd9);return _0x18752c['set'](_0x6506('0x1d'),_0x2de4d4+'-'+_0x31c98f+'/'+_0x356c77)[_0x6506('0x19')](_0x43dbd4);}return null;};}function patchUpdates(_0x1c5b37){return function(_0x2832a3){try{jsonpatch['apply'](_0x2832a3,_0x1c5b37,!![]);}catch(_0x2375be){return BPromise['reject'](_0x2375be);}return _0x2832a3[_0x6506('0x1e')]();};}function saveUpdates(_0x9ddd0e,_0x265277){return function(_0x2e21e0){if(_0x2e21e0){return _0x2e21e0[_0x6506('0x1f')](_0x9ddd0e)['then'](function(_0xafaa13){return _0xafaa13;});}return null;};}function removeEntity(_0x5499d1,_0x40d1b3){return function(_0x1a53cb){if(_0x1a53cb){return _0x1a53cb[_0x6506('0x20')]()[_0x6506('0x21')](function(){var _0xff1812=_0x1a53cb['get']({'plain':!![]});var _0x2d15fd=_0x6506('0x22');return db[_0x6506('0x23')]['destroy']({'where':{'type':_0x2d15fd,'resourceId':_0xff1812['id']}})[_0x6506('0x21')](function(){return _0x1a53cb;});})[_0x6506('0x21')](function(){_0x5499d1['status'](0xcc)[_0x6506('0x24')]();});}};}function handleEntityNotFound(_0x317c28,_0x2f30b2){return function(_0x2fa6ea){if(!_0x2fa6ea){_0x317c28[_0x6506('0x17')](0x194);}return _0x2fa6ea;};}function handleError(_0x15a988,_0x3a31ff){_0x3a31ff=_0x3a31ff||0x1f4;return function(_0x5eb12f){logger['error'](_0x5eb12f['stack']);if(_0x5eb12f[_0x6506('0x25')]){delete _0x5eb12f[_0x6506('0x25')];}_0x15a988[_0x6506('0x18')](_0x3a31ff)['send'](_0x5eb12f);};}exports['index']=function(_0x402aaa,_0x32a9bc){var _0x29c989={},_0x50c8d0={},_0x2eabec={'count':0x0,'rows':[]};var _0x3a1f46=_[_0x6506('0x26')](db[_0x6506('0x27')]['rawAttributes'],function(_0x580faa){return{'name':_0x580faa[_0x6506('0x28')],'type':_0x580faa[_0x6506('0x29')]['key']};});_0x50c8d0[_0x6506('0x2a')]=_[_0x6506('0x26')](_0x3a1f46,_0x6506('0x25'));_0x50c8d0[_0x6506('0x2b')]=_[_0x6506('0x2c')](_0x402aaa[_0x6506('0x2b')]);_0x50c8d0[_0x6506('0x2d')]=_[_0x6506('0x2e')](_0x50c8d0['model'],_0x50c8d0[_0x6506('0x2b')]);_0x29c989['attributes']=_[_0x6506('0x2e')](_0x50c8d0[_0x6506('0x2a')],qs[_0x6506('0x2f')](_0x402aaa['query']['fields']));_0x29c989[_0x6506('0x30')]=_0x29c989['attributes'][_0x6506('0x31')]?_0x29c989[_0x6506('0x30')]:_0x50c8d0[_0x6506('0x2a')];if(!_0x402aaa['query']['hasOwnProperty']('nolimit')){_0x29c989[_0x6506('0x1c')]=qs[_0x6506('0x1c')](_0x402aaa[_0x6506('0x2b')][_0x6506('0x1c')]);_0x29c989[_0x6506('0x1a')]=qs[_0x6506('0x1a')](_0x402aaa[_0x6506('0x2b')][_0x6506('0x1a')]);}_0x29c989[_0x6506('0x32')]=qs[_0x6506('0x33')](_0x402aaa[_0x6506('0x2b')][_0x6506('0x33')]);_0x29c989[_0x6506('0x34')]=qs[_0x6506('0x2d')](_[_0x6506('0x35')](_0x402aaa[_0x6506('0x2b')],_0x50c8d0[_0x6506('0x2d')]),_0x3a1f46);if(_0x402aaa[_0x6506('0x2b')][_0x6506('0x36')]){_0x29c989[_0x6506('0x34')]=_['merge'](_0x29c989[_0x6506('0x34')],{'$or':_[_0x6506('0x26')](_0x3a1f46,function(_0x15d05e){if(_0x15d05e[_0x6506('0x29')]!==_0x6506('0x37')){var _0x13c6a0={};_0x13c6a0[_0x15d05e[_0x6506('0x25')]]={'$like':'%'+_0x402aaa[_0x6506('0x2b')][_0x6506('0x36')]+'%'};return _0x13c6a0;}})});}_0x29c989=_['merge']({},_0x29c989,_0x402aaa[_0x6506('0x38')]);var _0x2df837={'where':_0x29c989[_0x6506('0x34')]};return db[_0x6506('0x27')][_0x6506('0x1b')](_0x2df837)[_0x6506('0x21')](function(_0x493385){_0x2eabec[_0x6506('0x1b')]=_0x493385;if(_0x402aaa[_0x6506('0x2b')]['includeAll']){_0x29c989['include']=[{'all':!![]}];}return db[_0x6506('0x27')][_0x6506('0x39')](_0x29c989);})[_0x6506('0x21')](function(_0x6a3f40){_0x2eabec['rows']=_0x6a3f40;return _0x2eabec;})[_0x6506('0x21')](respondWithFilteredResult(_0x32a9bc,_0x29c989))[_0x6506('0x3a')](handleError(_0x32a9bc,null));};exports[_0x6506('0x3b')]=function(_0x13777f,_0x36ecaa){var _0x59238d={'raw':![],'where':{'id':_0x13777f['params']['id']}},_0x31124f={};_0x31124f['model']=_['keys'](db[_0x6506('0x27')]['rawAttributes']);_0x31124f['query']=_['keys'](_0x13777f[_0x6506('0x2b')]);_0x31124f[_0x6506('0x2d')]=_[_0x6506('0x2e')](_0x31124f[_0x6506('0x2a')],_0x31124f['query']);_0x59238d[_0x6506('0x30')]=_[_0x6506('0x2e')](_0x31124f['model'],qs[_0x6506('0x2f')](_0x13777f[_0x6506('0x2b')][_0x6506('0x2f')]));_0x59238d[_0x6506('0x30')]=_0x59238d[_0x6506('0x30')][_0x6506('0x31')]?_0x59238d[_0x6506('0x30')]:_0x31124f['model'];if(_0x13777f[_0x6506('0x2b')]['includeAll']){_0x59238d[_0x6506('0x3c')]=[{'all':!![]}];}_0x59238d=_[_0x6506('0x3d')]({},_0x59238d,_0x13777f[_0x6506('0x38')]);return db['Trigger'][_0x6506('0x3e')](_0x59238d)[_0x6506('0x21')](handleEntityNotFound(_0x36ecaa,null))[_0x6506('0x21')](respondWithResult(_0x36ecaa,null))[_0x6506('0x3a')](handleError(_0x36ecaa,null));};exports[_0x6506('0x3f')]=function(_0x1dbe7a,_0xf7dfd8){return db[_0x6506('0x27')][_0x6506('0x3f')](_0x1dbe7a[_0x6506('0x40')],{})[_0x6506('0x21')](function(_0x442ce1){var _0x26e835=_0x1dbe7a[_0x6506('0x41')][_0x6506('0x42')]({'plain':!![]});if(!_0x26e835)throw new Error(_0x6506('0x43'));if(_0x26e835[_0x6506('0x44')]===_0x6506('0x41')){var _0x539ca6=_0x442ce1[_0x6506('0x42')]({'plain':!![]});var _0x133a87=_0x6506('0x22');return db['UserProfileSection'][_0x6506('0x3e')]({'where':{'name':_0x133a87,'userProfileId':_0x26e835[_0x6506('0x45')]},'raw':!![]})[_0x6506('0x21')](function(_0x13bfd9){if(_0x13bfd9&&_0x13bfd9['autoAssociation']===0x0){return db[_0x6506('0x23')][_0x6506('0x3f')]({'name':_0x539ca6[_0x6506('0x25')],'resourceId':_0x539ca6['id'],'type':_0x13bfd9[_0x6506('0x25')],'sectionId':_0x13bfd9['id']},{})['then'](function(){return _0x442ce1;});}else{return _0x442ce1;}})['catch'](function(_0x1b599e){logger[_0x6506('0x46')](_0x6506('0x47'),_0x1b599e);throw _0x1b599e;});}return _0x442ce1;})[_0x6506('0x21')](respondWithResult(_0xf7dfd8,0xc9))[_0x6506('0x3a')](handleError(_0xf7dfd8,null));};exports[_0x6506('0x1f')]=function(_0x371a6f,_0x5d1ddb){if(_0x371a6f[_0x6506('0x40')]['id']){delete _0x371a6f[_0x6506('0x40')]['id'];}return db['Trigger'][_0x6506('0x3e')]({'where':{'id':_0x371a6f[_0x6506('0x48')]['id']}})[_0x6506('0x21')](handleEntityNotFound(_0x5d1ddb,null))['then'](saveUpdates(_0x371a6f['body'],null))[_0x6506('0x21')](respondWithResult(_0x5d1ddb,null))[_0x6506('0x3a')](handleError(_0x5d1ddb,null));};exports[_0x6506('0x20')]=function(_0x4377d3,_0x34928c){return db[_0x6506('0x27')][_0x6506('0x3e')]({'where':{'id':_0x4377d3[_0x6506('0x48')]['id']}})[_0x6506('0x21')](handleEntityNotFound(_0x34928c,null))[_0x6506('0x21')](removeEntity(_0x34928c,null))['catch'](handleError(_0x34928c,null));};exports[_0x6506('0x49')]=function(_0x5a5801,_0x5a9883,_0x5e9936){if(_0x5a5801['body']['id']){delete _0x5a5801[_0x6506('0x40')]['id'];}return db['Trigger'][_0x6506('0x3e')]({'where':{'id':_0x5a5801['params']['id']}})[_0x6506('0x21')](handleEntityNotFound(_0x5a9883,null))[_0x6506('0x21')](function(_0x246597){if(_0x246597){_0x5a5801['body'][_0x6506('0x4a')]=_0x246597['id'];return db[_0x6506('0x4b')]['create'](_0x5a5801[_0x6506('0x40')]);}})[_0x6506('0x21')](respondWithResult(_0x5a9883,null))[_0x6506('0x3a')](handleError(_0x5a9883,null));};exports['addAnyCondition']=function(_0x55dd63,_0x1cac05,_0x21fae2){if(_0x55dd63[_0x6506('0x40')]['id']){delete _0x55dd63['body']['id'];}return db[_0x6506('0x27')]['find']({'where':{'id':_0x55dd63[_0x6506('0x48')]['id']}})[_0x6506('0x21')](handleEntityNotFound(_0x1cac05,null))[_0x6506('0x21')](function(_0x89361c){if(_0x89361c){_0x55dd63[_0x6506('0x40')]['TriggerAnyId']=_0x89361c['id'];return db[_0x6506('0x4b')][_0x6506('0x3f')](_0x55dd63[_0x6506('0x40')]);}})[_0x6506('0x21')](respondWithResult(_0x1cac05,null))[_0x6506('0x3a')](handleError(_0x1cac05,null));};exports[_0x6506('0x4c')]=function(_0x21ceb1,_0x174fe4,_0x2d8708){var _0x3c8176={};var _0x5ae655={};var _0x441d83;var _0x7b191c;return db[_0x6506('0x27')][_0x6506('0x4d')]({'where':{'id':_0x21ceb1[_0x6506('0x48')]['id']}})['then'](handleEntityNotFound(_0x174fe4,null))[_0x6506('0x21')](function(_0x27d2e6){if(_0x27d2e6){_0x441d83=_0x27d2e6;_0x5ae655['model']=_[_0x6506('0x2c')](db[_0x6506('0x4b')][_0x6506('0x4e')]);_0x5ae655[_0x6506('0x2b')]=_[_0x6506('0x2c')](_0x21ceb1[_0x6506('0x2b')]);_0x5ae655[_0x6506('0x2d')]=_[_0x6506('0x2e')](_0x5ae655[_0x6506('0x2a')],_0x5ae655[_0x6506('0x2b')]);_0x3c8176[_0x6506('0x30')]=_[_0x6506('0x2e')](_0x5ae655['model'],qs['fields'](_0x21ceb1['query'][_0x6506('0x2f')]));_0x3c8176[_0x6506('0x30')]=_0x3c8176['attributes']['length']?_0x3c8176[_0x6506('0x30')]:_0x5ae655['model'];_0x3c8176['order']=qs[_0x6506('0x33')](_0x21ceb1[_0x6506('0x2b')][_0x6506('0x33')]);_0x3c8176['where']=qs[_0x6506('0x2d')](_[_0x6506('0x35')](_0x21ceb1[_0x6506('0x2b')],_0x5ae655[_0x6506('0x2d')]));if(_0x21ceb1[_0x6506('0x2b')][_0x6506('0x36')]){_0x3c8176[_0x6506('0x34')]=_[_0x6506('0x3d')](_0x3c8176['where'],{'$or':_[_0x6506('0x26')](_0x3c8176['attributes'],function(_0x445a43){var _0x52f077={};_0x52f077[_0x445a43]={'$like':'%'+_0x21ceb1[_0x6506('0x2b')][_0x6506('0x36')]+'%'};return _0x52f077;})});}_0x3c8176=_[_0x6506('0x3d')]({},_0x3c8176,_0x21ceb1[_0x6506('0x38')]);return _0x441d83['getAllConditions'](_0x3c8176);}})[_0x6506('0x21')](function(_0x38b36e){if(_0x38b36e){_0x7b191c=_0x38b36e[_0x6506('0x31')];if(!_0x21ceb1[_0x6506('0x2b')][_0x6506('0x4f')](_0x6506('0x50'))){_0x3c8176['limit']=qs[_0x6506('0x1c')](_0x21ceb1[_0x6506('0x2b')][_0x6506('0x1c')]);_0x3c8176[_0x6506('0x1a')]=qs[_0x6506('0x1a')](_0x21ceb1['query'][_0x6506('0x1a')]);}return _0x441d83[_0x6506('0x4c')](_0x3c8176);}})[_0x6506('0x21')](function(_0x49d844){if(_0x49d844){return _0x49d844?{'count':_0x7b191c,'rows':_0x49d844}:null;}})[_0x6506('0x21')](respondWithResult(_0x174fe4,null))[_0x6506('0x3a')](handleError(_0x174fe4,null));};exports[_0x6506('0x51')]=function(_0x23d6e0,_0x2a973f,_0x1beb45){var _0x292add={};var _0x148c8a={};var _0x2ee1d9;var _0x4c2dd7;return db[_0x6506('0x27')][_0x6506('0x4d')]({'where':{'id':_0x23d6e0[_0x6506('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a973f,null))[_0x6506('0x21')](function(_0x1c8b21){if(_0x1c8b21){_0x2ee1d9=_0x1c8b21;_0x148c8a[_0x6506('0x2a')]=_[_0x6506('0x2c')](db[_0x6506('0x4b')]['rawAttributes']);_0x148c8a[_0x6506('0x2b')]=_[_0x6506('0x2c')](_0x23d6e0[_0x6506('0x2b')]);_0x148c8a['filters']=_['intersection'](_0x148c8a[_0x6506('0x2a')],_0x148c8a[_0x6506('0x2b')]);_0x292add[_0x6506('0x30')]=_['intersection'](_0x148c8a[_0x6506('0x2a')],qs[_0x6506('0x2f')](_0x23d6e0[_0x6506('0x2b')][_0x6506('0x2f')]));_0x292add[_0x6506('0x30')]=_0x292add[_0x6506('0x30')][_0x6506('0x31')]?_0x292add[_0x6506('0x30')]:_0x148c8a[_0x6506('0x2a')];_0x292add[_0x6506('0x32')]=qs[_0x6506('0x33')](_0x23d6e0[_0x6506('0x2b')]['sort']);_0x292add['where']=qs[_0x6506('0x2d')](_[_0x6506('0x35')](_0x23d6e0[_0x6506('0x2b')],_0x148c8a[_0x6506('0x2d')]));if(_0x23d6e0['query'][_0x6506('0x36')]){_0x292add['where']=_['merge'](_0x292add[_0x6506('0x34')],{'$or':_[_0x6506('0x26')](_0x292add[_0x6506('0x30')],function(_0x41366e){var _0x9d0403={};_0x9d0403[_0x41366e]={'$like':'%'+_0x23d6e0[_0x6506('0x2b')][_0x6506('0x36')]+'%'};return _0x9d0403;})});}_0x292add=_['merge']({},_0x292add,_0x23d6e0['options']);return _0x2ee1d9[_0x6506('0x51')](_0x292add);}})[_0x6506('0x21')](function(_0x37b090){if(_0x37b090){_0x4c2dd7=_0x37b090[_0x6506('0x31')];if(!_0x23d6e0['query'][_0x6506('0x4f')](_0x6506('0x50'))){_0x292add[_0x6506('0x1c')]=qs[_0x6506('0x1c')](_0x23d6e0[_0x6506('0x2b')][_0x6506('0x1c')]);_0x292add[_0x6506('0x1a')]=qs[_0x6506('0x1a')](_0x23d6e0['query'][_0x6506('0x1a')]);}return _0x2ee1d9['getAnyConditions'](_0x292add);}})[_0x6506('0x21')](function(_0x1babc5){if(_0x1babc5){return _0x1babc5?{'count':_0x4c2dd7,'rows':_0x1babc5}:null;}})[_0x6506('0x21')](respondWithResult(_0x2a973f,null))[_0x6506('0x3a')](handleError(_0x2a973f,null));};exports[_0x6506('0x52')]=function(_0x2f9c2e,_0xdffb45,_0x187271){if(_0x2f9c2e[_0x6506('0x40')]['id']){delete _0x2f9c2e[_0x6506('0x40')]['id'];}return db[_0x6506('0x27')]['find']({'where':{'id':_0x2f9c2e[_0x6506('0x48')]['id']}})[_0x6506('0x21')](handleEntityNotFound(_0xdffb45,null))[_0x6506('0x21')](function(_0x6cf3bc){if(_0x6cf3bc){_0x2f9c2e[_0x6506('0x40')][_0x6506('0x53')]=_0x6cf3bc['id'];return db[_0x6506('0x54')]['create'](_0x2f9c2e[_0x6506('0x40')]);}})[_0x6506('0x21')](respondWithResult(_0xdffb45,null))[_0x6506('0x3a')](handleError(_0xdffb45,null));};exports[_0x6506('0x55')]=function(_0x26f1b7,_0x5d162b,_0xb39543){var _0x2d603e={};var _0x1d3759={};var _0x3ecc98;var _0x4c2033;return db[_0x6506('0x27')][_0x6506('0x4d')]({'where':{'id':_0x26f1b7[_0x6506('0x48')]['id']}})[_0x6506('0x21')](handleEntityNotFound(_0x5d162b,null))['then'](function(_0x111e72){if(_0x111e72){_0x3ecc98=_0x111e72;_0x1d3759[_0x6506('0x2a')]=_[_0x6506('0x2c')](db[_0x6506('0x54')][_0x6506('0x4e')]);_0x1d3759['query']=_[_0x6506('0x2c')](_0x26f1b7[_0x6506('0x2b')]);_0x1d3759['filters']=_[_0x6506('0x2e')](_0x1d3759['model'],_0x1d3759[_0x6506('0x2b')]);_0x2d603e[_0x6506('0x30')]=_['intersection'](_0x1d3759['model'],qs[_0x6506('0x2f')](_0x26f1b7[_0x6506('0x2b')][_0x6506('0x2f')]));_0x2d603e[_0x6506('0x30')]=_0x2d603e[_0x6506('0x30')][_0x6506('0x31')]?_0x2d603e[_0x6506('0x30')]:_0x1d3759['model'];_0x2d603e[_0x6506('0x32')]=qs[_0x6506('0x33')](_0x26f1b7[_0x6506('0x2b')][_0x6506('0x33')]);_0x2d603e['where']=qs[_0x6506('0x2d')](_['pick'](_0x26f1b7[_0x6506('0x2b')],_0x1d3759[_0x6506('0x2d')]));if(_0x26f1b7[_0x6506('0x2b')][_0x6506('0x36')]){_0x2d603e[_0x6506('0x34')]=_[_0x6506('0x3d')](_0x2d603e[_0x6506('0x34')],{'$or':_[_0x6506('0x26')](_0x2d603e[_0x6506('0x30')],function(_0x46109a){var _0x5e1d18={};_0x5e1d18[_0x46109a]={'$like':'%'+_0x26f1b7[_0x6506('0x2b')][_0x6506('0x36')]+'%'};return _0x5e1d18;})});}_0x2d603e=_[_0x6506('0x3d')]({},_0x2d603e,_0x26f1b7['options']);return _0x3ecc98[_0x6506('0x55')](_0x2d603e);}})[_0x6506('0x21')](function(_0x53f78c){if(_0x53f78c){_0x4c2033=_0x53f78c[_0x6506('0x31')];if(!_0x26f1b7[_0x6506('0x2b')][_0x6506('0x4f')](_0x6506('0x50'))){_0x2d603e['limit']=qs[_0x6506('0x1c')](_0x26f1b7[_0x6506('0x2b')]['limit']);_0x2d603e['offset']=qs[_0x6506('0x1a')](_0x26f1b7[_0x6506('0x2b')][_0x6506('0x1a')]);}return _0x3ecc98[_0x6506('0x55')](_0x2d603e);}})['then'](function(_0x1f535f){if(_0x1f535f){return _0x1f535f?{'count':_0x4c2033,'rows':_0x1f535f}:null;}})['then'](respondWithResult(_0x5d162b,null))[_0x6506('0x3a')](handleError(_0x5d162b,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 1dd05ba..6ea304f 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 _0xa990=['path','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x33ca83,_0x54f25c){var _0x175082=function(_0x1c44a9){while(--_0x1c44a9){_0x33ca83['push'](_0x33ca83['shift']());}};_0x175082(++_0x54f25c);}(_0xa990,0xc9));var _0x0a99=function(_0x37a0b4,_0x5adc7d){_0x37a0b4=_0x37a0b4-0x0;var _0x578168=_0xa990[_0x37a0b4];return _0x578168;};'use strict';var _=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var logger=require(_0x0a99('0x2'))(_0x0a99('0x3'));var moment=require(_0x0a99('0x4'));var BPromise=require(_0x0a99('0x5'));var rp=require(_0x0a99('0x6'));var fs=require('fs');var path=require(_0x0a99('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0a99('0x8'));module[_0x0a99('0x9')]=function(_0xfdb594,_0x320560){return _0xfdb594[_0x0a99('0xa')](_0x0a99('0xb'),attributes,{'tableName':_0x0a99('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd382=['request-promise','path','rimraf','../../config/environment','define','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd382,0x1b6));var _0x2d38=function(_0x27fec9,_0x5d4d03){_0x27fec9=_0x27fec9-0x0;var _0x244da1=_0xd382[_0x27fec9];return _0x244da1;};'use strict';var _=require(_0x2d38('0x0'));var util=require(_0x2d38('0x1'));var logger=require(_0x2d38('0x2'))(_0x2d38('0x3'));var moment=require(_0x2d38('0x4'));var BPromise=require(_0x2d38('0x5'));var rp=require(_0x2d38('0x6'));var fs=require('fs');var path=require(_0x2d38('0x7'));var rimraf=require(_0x2d38('0x8'));var config=require(_0x2d38('0x9'));var attributes=require('./trigger.attributes');module['exports']=function(_0x5a8219,_0x30106c){return _0x5a8219[_0x2d38('0xa')]('Trigger',attributes,{'tableName':_0x2d38('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 d9dd1f2..3f17dd9 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 _0xade6=['attributes','limit','include','map','model','ShowTrigger','Trigger','then','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Trigger,\x20%s,\x20%s','result','catch','GetTrigger','raw','options','where'];(function(_0xe20bfc,_0x31fc9b){var _0x5b6cd0=function(_0x15f408){while(--_0x15f408){_0xe20bfc['push'](_0xe20bfc['shift']());}};_0x5b6cd0(++_0x31fc9b);}(_0xade6,0x120));var _0x6ade=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0xade6[_0x19babd];return _0x314eaf;};'use strict';var _=require(_0x6ade('0x0'));var util=require(_0x6ade('0x1'));var moment=require(_0x6ade('0x2'));var BPromise=require('bluebird');var rs=require(_0x6ade('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ade('0x4'))['db'];var utils=require(_0x6ade('0x5'));var logger=require(_0x6ade('0x6'))(_0x6ade('0x7'));var config=require(_0x6ade('0x8'));var jayson=require(_0x6ade('0x9'));var client=jayson[_0x6ade('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x274878,_0x2b0347,_0x2f6f13){return new BPromise(function(_0x5356eb,_0x4f8586){return client[_0x6ade('0xb')](_0x274878,_0x2f6f13)['then'](function(_0xaf7ff1){logger[_0x6ade('0xc')]('Trigger,\x20%s,\x20%s',_0x2b0347,'request\x20sent');logger[_0x6ade('0xd')](_0x6ade('0xe'),_0x2b0347,_0x6ade('0xf'),JSON[_0x6ade('0x10')](_0xaf7ff1));if(_0xaf7ff1[_0x6ade('0x11')]){if(_0xaf7ff1['error'][_0x6ade('0x12')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x2b0347,_0xaf7ff1[_0x6ade('0x11')][_0x6ade('0x13')]);return _0x4f8586(_0xaf7ff1[_0x6ade('0x11')][_0x6ade('0x13')]);}logger[_0x6ade('0x11')]('Trigger,\x20%s,\x20%s',_0x2b0347,_0xaf7ff1[_0x6ade('0x11')][_0x6ade('0x13')]);return _0x5356eb(_0xaf7ff1[_0x6ade('0x11')][_0x6ade('0x13')]);}else{logger['info'](_0x6ade('0x14'),_0x2b0347,_0x6ade('0xf'));_0x5356eb(_0xaf7ff1[_0x6ade('0x15')][_0x6ade('0x13')]);}})[_0x6ade('0x16')](function(_0x54e901){logger[_0x6ade('0x11')](_0x6ade('0x14'),_0x2b0347,_0x54e901);_0x4f8586(_0x54e901);});});}exports[_0x6ade('0x17')]=function(_0x52a3ca){var _0x4a5e92=this;return new Promise(function(_0x2e32b9,_0x45d9d5){return db['Trigger']['findAll']({'raw':_0x52a3ca['options']?_0x52a3ca['options'][_0x6ade('0x18')]===undefined?!![]:![]:!![],'where':_0x52a3ca[_0x6ade('0x19')]?_0x52a3ca['options'][_0x6ade('0x1a')]||null:null,'attributes':_0x52a3ca['options']?_0x52a3ca[_0x6ade('0x19')][_0x6ade('0x1b')]||null:null,'limit':_0x52a3ca[_0x6ade('0x19')]?_0x52a3ca[_0x6ade('0x19')][_0x6ade('0x1c')]||null:null,'include':_0x52a3ca['options']?_0x52a3ca[_0x6ade('0x19')][_0x6ade('0x1d')]?_[_0x6ade('0x1e')](_0x52a3ca['options'][_0x6ade('0x1d')],function(_0x4b4ea9){return{'model':db[_0x4b4ea9[_0x6ade('0x1f')]],'as':_0x4b4ea9['as'],'attributes':_0x4b4ea9['attributes'],'include':_0x4b4ea9[_0x6ade('0x1d')]?_[_0x6ade('0x1e')](_0x4b4ea9['include'],function(_0x57057d){return{'model':db[_0x57057d[_0x6ade('0x1f')]],'as':_0x57057d['as'],'attributes':_0x57057d[_0x6ade('0x1b')],'include':_0x57057d[_0x6ade('0x1d')]?_['map'](_0x57057d[_0x6ade('0x1d')],function(_0xa9c513){return{'model':db[_0xa9c513[_0x6ade('0x1f')]],'as':_0xa9c513['as'],'attributes':_0xa9c513[_0x6ade('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4902d8){logger[_0x6ade('0xc')](_0x6ade('0x17'),_0x52a3ca);logger[_0x6ade('0xd')](_0x6ade('0x17'),_0x52a3ca,JSON[_0x6ade('0x10')](_0x4902d8));_0x2e32b9(_0x4902d8);})[_0x6ade('0x16')](function(_0x5d0c12){logger[_0x6ade('0x11')](_0x6ade('0x17'),_0x5d0c12[_0x6ade('0x13')],_0x52a3ca);_0x45d9d5(_0x4a5e92[_0x6ade('0x11')](0x1f4,_0x5d0c12[_0x6ade('0x13')]));});});};exports[_0x6ade('0x20')]=function(_0x27c608){var _0x133030=this;return new Promise(function(_0x55d287,_0x44266d){return db[_0x6ade('0x21')]['find']({'raw':_0x27c608[_0x6ade('0x19')]?_0x27c608[_0x6ade('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x27c608['options']?_0x27c608[_0x6ade('0x19')]['where']||null:null,'attributes':_0x27c608[_0x6ade('0x19')]?_0x27c608['options'][_0x6ade('0x1b')]||null:null,'include':_0x27c608['options']?_0x27c608[_0x6ade('0x19')][_0x6ade('0x1d')]?_['map'](_0x27c608['options'][_0x6ade('0x1d')],function(_0x228e41){return{'model':db[_0x228e41['model']],'as':_0x228e41['as'],'attributes':_0x228e41[_0x6ade('0x1b')],'include':_0x228e41[_0x6ade('0x1d')]?_[_0x6ade('0x1e')](_0x228e41[_0x6ade('0x1d')],function(_0x5158dc){return{'model':db[_0x5158dc[_0x6ade('0x1f')]],'as':_0x5158dc['as'],'attributes':_0x5158dc[_0x6ade('0x1b')],'include':_0x5158dc['include']?_[_0x6ade('0x1e')](_0x5158dc[_0x6ade('0x1d')],function(_0x5e5b8d){return{'model':db[_0x5e5b8d['model']],'as':_0x5e5b8d['as'],'attributes':_0x5e5b8d['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ade('0x22')](function(_0x21942c){logger['info'](_0x6ade('0x20'),_0x27c608);logger['debug'](_0x6ade('0x20'),_0x27c608,JSON[_0x6ade('0x10')](_0x21942c));_0x55d287(_0x21942c);})['catch'](function(_0x8b4ad8){logger[_0x6ade('0x11')](_0x6ade('0x20'),_0x8b4ad8['message'],_0x27c608);_0x44266d(_0x133030['error'](0x1f4,_0x8b4ad8[_0x6ade('0x13')]));});});}; \ No newline at end of file +var _0x37c2=['ShowTrigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','error','Trigger,\x20%s,\x20%s','message','info','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x4f898e,_0x30c8cb){var _0x37e93b=function(_0x440793){while(--_0x440793){_0x4f898e['push'](_0x4f898e['shift']());}};_0x37e93b(++_0x30c8cb);}(_0x37c2,0xb1));var _0x237c=function(_0x105116,_0x188ffd){_0x105116=_0x105116-0x0;var _0x24f1d9=_0x37c2[_0x105116];return _0x24f1d9;};'use strict';var _=require(_0x237c('0x0'));var util=require(_0x237c('0x1'));var moment=require(_0x237c('0x2'));var BPromise=require(_0x237c('0x3'));var rs=require(_0x237c('0x4'));var fs=require('fs');var Redis=require(_0x237c('0x5'));var db=require(_0x237c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x237c('0x7'));var config=require(_0x237c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x237c('0x9')][_0x237c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3379b1,_0x4f17e9,_0x1a8b1f){return new BPromise(function(_0x33379f,_0x55159f){return client[_0x237c('0xb')](_0x3379b1,_0x1a8b1f)[_0x237c('0xc')](function(_0x2716d7){logger['info']('Trigger,\x20%s,\x20%s',_0x4f17e9,_0x237c('0xd'));logger[_0x237c('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x4f17e9,_0x237c('0xd'),JSON[_0x237c('0xf')](_0x2716d7));if(_0x2716d7[_0x237c('0x10')]){if(_0x2716d7[_0x237c('0x10')]['code']===0x1f4){logger['error'](_0x237c('0x11'),_0x4f17e9,_0x2716d7[_0x237c('0x10')][_0x237c('0x12')]);return _0x55159f(_0x2716d7[_0x237c('0x10')]['message']);}logger[_0x237c('0x10')](_0x237c('0x11'),_0x4f17e9,_0x2716d7['error'][_0x237c('0x12')]);return _0x33379f(_0x2716d7[_0x237c('0x10')][_0x237c('0x12')]);}else{logger[_0x237c('0x13')](_0x237c('0x11'),_0x4f17e9,_0x237c('0xd'));_0x33379f(_0x2716d7[_0x237c('0x14')][_0x237c('0x12')]);}})[_0x237c('0x15')](function(_0x7d1486){logger['error'](_0x237c('0x11'),_0x4f17e9,_0x7d1486);_0x55159f(_0x7d1486);});});}exports[_0x237c('0x16')]=function(_0x515a3e){var _0x39b339=this;return new Promise(function(_0x4433cb,_0x2ef490){return db[_0x237c('0x17')][_0x237c('0x18')]({'raw':_0x515a3e[_0x237c('0x19')]?_0x515a3e[_0x237c('0x19')][_0x237c('0x1a')]===undefined?!![]:![]:!![],'where':_0x515a3e['options']?_0x515a3e[_0x237c('0x19')][_0x237c('0x1b')]||null:null,'attributes':_0x515a3e['options']?_0x515a3e['options'][_0x237c('0x1c')]||null:null,'limit':_0x515a3e[_0x237c('0x19')]?_0x515a3e[_0x237c('0x19')][_0x237c('0x1d')]||null:null,'include':_0x515a3e[_0x237c('0x19')]?_0x515a3e[_0x237c('0x19')][_0x237c('0x1e')]?_['map'](_0x515a3e['options'][_0x237c('0x1e')],function(_0x189f0d){return{'model':db[_0x189f0d['model']],'as':_0x189f0d['as'],'attributes':_0x189f0d[_0x237c('0x1c')],'include':_0x189f0d[_0x237c('0x1e')]?_[_0x237c('0x1f')](_0x189f0d[_0x237c('0x1e')],function(_0x1500a9){return{'model':db[_0x1500a9[_0x237c('0x20')]],'as':_0x1500a9['as'],'attributes':_0x1500a9[_0x237c('0x1c')],'include':_0x1500a9[_0x237c('0x1e')]?_[_0x237c('0x1f')](_0x1500a9[_0x237c('0x1e')],function(_0xc0a98){return{'model':db[_0xc0a98['model']],'as':_0xc0a98['as'],'attributes':_0xc0a98[_0x237c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x237c('0xc')](function(_0xd56faf){logger[_0x237c('0x13')]('GetTrigger',_0x515a3e);logger[_0x237c('0xe')](_0x237c('0x16'),_0x515a3e,JSON[_0x237c('0xf')](_0xd56faf));_0x4433cb(_0xd56faf);})[_0x237c('0x15')](function(_0x4ca9b0){logger[_0x237c('0x10')](_0x237c('0x16'),_0x4ca9b0['message'],_0x515a3e);_0x2ef490(_0x39b339[_0x237c('0x10')](0x1f4,_0x4ca9b0['message']));});});};exports[_0x237c('0x21')]=function(_0xff5bda){var _0x330a99=this;return new Promise(function(_0x28083b,_0x16af97){return db[_0x237c('0x17')][_0x237c('0x22')]({'raw':_0xff5bda[_0x237c('0x19')]?_0xff5bda[_0x237c('0x19')][_0x237c('0x1a')]===undefined?!![]:![]:!![],'where':_0xff5bda[_0x237c('0x19')]?_0xff5bda[_0x237c('0x19')][_0x237c('0x1b')]||null:null,'attributes':_0xff5bda[_0x237c('0x19')]?_0xff5bda[_0x237c('0x19')]['attributes']||null:null,'include':_0xff5bda[_0x237c('0x19')]?_0xff5bda[_0x237c('0x19')][_0x237c('0x1e')]?_[_0x237c('0x1f')](_0xff5bda[_0x237c('0x19')][_0x237c('0x1e')],function(_0x49d352){return{'model':db[_0x49d352[_0x237c('0x20')]],'as':_0x49d352['as'],'attributes':_0x49d352[_0x237c('0x1c')],'include':_0x49d352[_0x237c('0x1e')]?_[_0x237c('0x1f')](_0x49d352[_0x237c('0x1e')],function(_0x437e78){return{'model':db[_0x437e78[_0x237c('0x20')]],'as':_0x437e78['as'],'attributes':_0x437e78[_0x237c('0x1c')],'include':_0x437e78[_0x237c('0x1e')]?_[_0x237c('0x1f')](_0x437e78[_0x237c('0x1e')],function(_0x53edc7){return{'model':db[_0x53edc7[_0x237c('0x20')]],'as':_0x53edc7['as'],'attributes':_0x53edc7[_0x237c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x237c('0xc')](function(_0x50ec12){logger['info'](_0x237c('0x21'),_0xff5bda);logger['debug'](_0x237c('0x21'),_0xff5bda,JSON['stringify'](_0x50ec12));_0x28083b(_0x50ec12);})[_0x237c('0x15')](function(_0x101c09){logger[_0x237c('0x10')]('ShowTrigger',_0x101c09[_0x237c('0x12')],_0xff5bda);_0x16af97(_0x330a99[_0x237c('0x10')](0x1f4,_0x101c09[_0x237c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index d860ab7..b81cde8 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 _0xfa42=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','show','post','clone','create','put','/:id','update','delete','multer','util'];(function(_0x2b762d,_0x453a43){var _0x44b267=function(_0xdecc38){while(--_0xdecc38){_0x2b762d['push'](_0x2b762d['shift']());}};_0x44b267(++_0x453a43);}(_0xfa42,0x152));var _0x2fa4=function(_0x4f6d05,_0x351e5f){_0x4f6d05=_0x4f6d05-0x0;var _0x4fbfd0=_0xfa42[_0x4f6d05];return _0x4fbfd0;};'use strict';var multer=require(_0x2fa4('0x0'));var util=require(_0x2fa4('0x1'));var path=require(_0x2fa4('0x2'));var timeout=require(_0x2fa4('0x3'));var express=require(_0x2fa4('0x4'));var router=express['Router']();var fs_extra=require(_0x2fa4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2fa4('0x6'));var config=require(_0x2fa4('0x7'));var controller=require(_0x2fa4('0x8'));router['get']('/',auth[_0x2fa4('0x9')](),controller[_0x2fa4('0xa')]);router[_0x2fa4('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x2fa4('0xc')]);router[_0x2fa4('0xd')]('/:id/clone',auth[_0x2fa4('0x9')](),controller[_0x2fa4('0xe')]);router[_0x2fa4('0xd')]('/',auth['isAuthenticated'](),controller[_0x2fa4('0xf')]);router[_0x2fa4('0x10')](_0x2fa4('0x11'),auth[_0x2fa4('0x9')](),controller[_0x2fa4('0x12')]);router[_0x2fa4('0x13')]('/:id',auth[_0x2fa4('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc5fc=['post','clone','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','/:id'];(function(_0x4625ae,_0x369b39){var _0x17346b=function(_0x13d9d6){while(--_0x13d9d6){_0x4625ae['push'](_0x4625ae['shift']());}};_0x17346b(++_0x369b39);}(_0xc5fc,0x114));var _0xcc5f=function(_0x3f855f,_0x19209b){_0x3f855f=_0x3f855f-0x0;var _0x3c4406=_0xc5fc[_0x3f855f];return _0x3c4406;};'use strict';var multer=require('multer');var util=require(_0xcc5f('0x0'));var path=require(_0xcc5f('0x1'));var timeout=require('connect-timeout');var express=require(_0xcc5f('0x2'));var router=express[_0xcc5f('0x3')]();var fs_extra=require(_0xcc5f('0x4'));var auth=require(_0xcc5f('0x5'));var interaction=require(_0xcc5f('0x6'));var config=require(_0xcc5f('0x7'));var controller=require(_0xcc5f('0x8'));router[_0xcc5f('0x9')]('/',auth[_0xcc5f('0xa')](),controller['index']);router[_0xcc5f('0x9')](_0xcc5f('0xb'),auth[_0xcc5f('0xa')](),controller['show']);router[_0xcc5f('0xc')]('/:id/clone',auth[_0xcc5f('0xa')](),controller[_0xcc5f('0xd')]);router['post']('/',auth[_0xcc5f('0xa')](),controller['create']);router[_0xcc5f('0xe')](_0xcc5f('0xb'),auth[_0xcc5f('0xa')](),controller['update']);router[_0xcc5f('0xf')](_0xcc5f('0xb'),auth['isAuthenticated'](),controller[_0xcc5f('0x10')]);module[_0xcc5f('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 9f6db57..c1d0459 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 _0xc0f2=['all','ulaw;alaw;gsm','allow','port,invite','insecure','never','INTEGER','always','accept','refuse','originate','uas','pai','certificate','passive','nonat','update,nonat','BOOLEAN','sequelize','exports','STRING','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','split','rfc2833','auto','yes','update','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0xbfc560,_0x311fba){var _0x47b022=function(_0x2cd37f){while(--_0x2cd37f){_0xbfc560['push'](_0xbfc560['shift']());}};_0x47b022(++_0x311fba);}(_0xc0f2,0x1b0));var _0x2c0f=function(_0x5e301d,_0x37628e){_0x5e301d=_0x5e301d-0x0;var _0x3b217f=_0xc0f2[_0x5e301d];return _0x3b217f;};'use strict';var Sequelize=require(_0x2c0f('0x0'));module[_0x2c0f('0x1')]={'name':{'type':Sequelize[_0x2c0f('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x4'),_0x2c0f('0x5'),_0x2c0f('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x2c0f('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x7'),_0x2c0f('0x8'),_0x2c0f('0x9'),_0x2c0f('0xa'),_0x2c0f('0xb'),_0x2c0f('0xc'),_0x2c0f('0xd'),_0x2c0f('0xe'))},'deny':{'type':Sequelize[_0x2c0f('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x2c0f('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x2c0f('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x2c0f('0xf'),'set':function(_0x3cd43f){this[_0x2c0f('0x10')](_0x2c0f('0x11'),_0x3cd43f?_0x3cd43f['join'](','):null);},'get':function(){return this[_0x2c0f('0x12')]('transport')?this['getDataValue']('transport')[_0x2c0f('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x2c0f('0x14'),'info','shortinfo','inband',_0x2c0f('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no','nonat',_0x2c0f('0x17'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2c0f('0x2')]},'directmediadeny':{'type':Sequelize[_0x2c0f('0x2')]},'nat':{'type':Sequelize[_0x2c0f('0x2')],'defaultValue':_0x2c0f('0x18'),'set':function(_0x1cedd0){this[_0x2c0f('0x10')]('nat',_0x1cedd0?_0x1cedd0[_0x2c0f('0x19')](','):null);},'get':function(){return this['getDataValue'](_0x2c0f('0x1a'))?this[_0x2c0f('0x12')](_0x2c0f('0x1a'))[_0x2c0f('0x13')](','):null;},'comment':_0x2c0f('0x1b')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x2c0f('0x2')]},'pickupgroup':{'type':Sequelize[_0x2c0f('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x2c0f('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2c0f('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x2c0f('0x2')],'defaultValue':_0x2c0f('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2c0f('0x1d'),'set':function(_0x5be8b1){this[_0x2c0f('0x10')](_0x2c0f('0x1e'),_0x5be8b1?_0x5be8b1[_0x2c0f('0x19')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x2c0f('0x12')](_0x2c0f('0x1e'))?this[_0x2c0f('0x12')](_0x2c0f('0x1e'))[_0x2c0f('0x13')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'insecure':{'type':Sequelize[_0x2c0f('0x2')],'defaultValue':_0x2c0f('0x1f'),'set':function(_0x32dbc5){this[_0x2c0f('0x10')](_0x2c0f('0x20'),_0x32dbc5?_0x32dbc5[_0x2c0f('0x19')](','):null);},'get':function(){return this[_0x2c0f('0x12')](_0x2c0f('0x20'))?this[_0x2c0f('0x12')](_0x2c0f('0x20'))[_0x2c0f('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2c0f('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no',_0x2c0f('0x21'))},'promiscredir':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x2c0f('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x2c0f('0x2')]},'callcounter':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no'),'defaultValue':_0x2c0f('0x16')},'busylevel':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x2c0f('0x16'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x2c0f('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x2c0f('0x2')]},'videosupport':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no',_0x2c0f('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'mailbox':{'type':Sequelize[_0x2c0f('0x2')]},'session_timers':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x24'),_0x2c0f('0x25'),_0x2c0f('0x26'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x2c0f('0x3')]('uac','uas'),'defaultValue':_0x2c0f('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x2c0f('0x2')]},'regexten':{'type':Sequelize[_0x2c0f('0x2')]},'fromdomain':{'type':Sequelize[_0x2c0f('0x2')]},'fromuser':{'type':Sequelize[_0x2c0f('0x2')]},'port':{'type':Sequelize[_0x2c0f('0x22')](0x5)},'qualify':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x2c0f('0x2')]},'rtptimeout':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x2c0f('0x16'),'no',_0x2c0f('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2c0f('0x2')]},'callbackextension':{'type':Sequelize[_0x2c0f('0x2')]},'timert1':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'timerb':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x2c0f('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x2c0f('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x2c0f('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'encryption':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'force_avp':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x2c0f('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x2c0f('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x2c0f('0x16'),'no','fingerprint',_0x2c0f('0x29'))},'dtlsrekey':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x2c0f('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x2c0f('0x2')]},'dtlscipher':{'type':Sequelize[_0x2c0f('0x2')]},'dtlscafile':{'type':Sequelize[_0x2c0f('0x2')]},'dtlscapath':{'type':Sequelize[_0x2c0f('0x2')]},'dtlssetup':{'type':Sequelize[_0x2c0f('0x3')]('active',_0x2c0f('0x2a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2c0f('0x2')]},'usereqphone':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x2c0f('0x2')]},'call_limit':{'type':Sequelize[_0x2c0f('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x2c0f('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x2c0f('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no',_0x2c0f('0x2b'),'update',_0x2c0f('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x2c0f('0x2')]},'active':{'type':Sequelize[_0x2c0f('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2c0f('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x1161=['allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','INTEGER','originate','uac','uas','fingerprint','certificate','actpass','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm'];(function(_0x4dd63b,_0x1bf52d){var _0x1a5ccd=function(_0xd483d7){while(--_0xd483d7){_0x4dd63b['push'](_0x4dd63b['shift']());}};_0x1a5ccd(++_0x1bf52d);}(_0x1161,0xa0));var _0x1116=function(_0x4c20e5,_0x2e82f9){_0x4c20e5=_0x4c20e5-0x0;var _0x4e9686=_0x1161[_0x4c20e5];return _0x4e9686;};'use strict';var Sequelize=require(_0x1116('0x0'));module[_0x1116('0x1')]={'name':{'type':Sequelize[_0x1116('0x2')],'allowNull':![],'unique':_0x1116('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1116('0x4')]('friend',_0x1116('0x5'),_0x1116('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x1116('0x2')],'allowNull':![],'defaultValue':_0x1116('0x7')},'callingpres':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x8'),_0x1116('0x9'),_0x1116('0xa'),_0x1116('0xb'),_0x1116('0xc'),_0x1116('0xd'),_0x1116('0xe'),'PROHIB')},'deny':{'type':Sequelize[_0x1116('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x1116('0x2')]},'md5secret':{'type':Sequelize[_0x1116('0x2')]},'remotesecret':{'type':Sequelize[_0x1116('0x2')]},'transport':{'type':Sequelize[_0x1116('0x2')],'defaultValue':_0x1116('0xf'),'set':function(_0x532996){this[_0x1116('0x10')](_0x1116('0x11'),_0x532996?_0x532996[_0x1116('0x12')](','):null);},'get':function(){return this['getDataValue'](_0x1116('0x11'))?this[_0x1116('0x13')](_0x1116('0x11'))[_0x1116('0x14')](','):null;},'comment':_0x1116('0x15')},'dtmfmode':{'type':Sequelize['ENUM'](_0x1116('0x16'),'info','shortinfo','inband',_0x1116('0x17')),'defaultValue':_0x1116('0x16')},'directmedia':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x18'),'no',_0x1116('0x19'),_0x1116('0x1a'),_0x1116('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x1116('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1116('0x2')]},'directmediadeny':{'type':Sequelize[_0x1116('0x2')]},'nat':{'type':Sequelize[_0x1116('0x2')],'defaultValue':_0x1116('0x1c'),'set':function(_0x1ec7c2){this[_0x1116('0x10')](_0x1116('0x1d'),_0x1ec7c2?_0x1ec7c2[_0x1116('0x12')](','):null);},'get':function(){return this[_0x1116('0x13')]('nat')?this[_0x1116('0x13')]('nat')[_0x1116('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x1116('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x1116('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1116('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x1116('0x2')],'defaultValue':_0x1116('0x1e')},'allow':{'type':Sequelize[_0x1116('0x2')],'allowNull':![],'defaultValue':_0x1116('0x1f'),'set':function(_0x4ea418){this[_0x1116('0x10')]('allow',_0x4ea418?_0x4ea418[_0x1116('0x12')](';'):_0x1116('0x1f'));},'get':function(){return this[_0x1116('0x13')]('allow')?this['getDataValue'](_0x1116('0x20'))[_0x1116('0x14')](';'):null;},'comment':_0x1116('0x21')},'autoframing':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x18'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x1116('0x22'),'set':function(_0x4ca544){this['setDataValue']('insecure',_0x4ca544?_0x4ca544[_0x1116('0x12')](','):null);},'get':function(){return this[_0x1116('0x13')]('insecure')?this[_0x1116('0x13')]('insecure')[_0x1116('0x14')](','):null;},'comment':_0x1116('0x23')},'trustrpid':{'type':Sequelize['ENUM'](_0x1116('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1116('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x18'),'no',_0x1116('0x24'))},'promiscredir':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x18'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x1116('0x2')]},'callerid':{'type':Sequelize[_0x1116('0x2')],'defaultValue':_0x1116('0x25')},'amaflags':{'type':Sequelize[_0x1116('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0x1116('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x1116('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x1116('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x1116('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x1116('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x1116('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x18'),'no',_0x1116('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1116('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x18'),'no')},'mailbox':{'type':Sequelize[_0x1116('0x2')]},'session_timers':{'type':Sequelize[_0x1116('0x4')]('accept','refuse',_0x1116('0x28'))},'session_expires':{'type':Sequelize[_0x1116('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x1116('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x29'),'uas'),'defaultValue':_0x1116('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x1116('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x1116('0x2')]},'fromuser':{'type':Sequelize[_0x1116('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x1116('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x1116('0x27')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x1116('0x2')]},'rtptimeout':{'type':Sequelize[_0x1116('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x1116('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x1116('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x1116('0x27')](0xb)},'timerb':{'type':Sequelize[_0x1116('0x27')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x1116('0x2')]},'contactdeny':{'type':Sequelize[_0x1116('0x2')]},'contactacl':{'type':Sequelize[_0x1116('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x1116('0x2')]},'maxforwards':{'type':Sequelize[_0x1116('0x27')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x1116('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x18'),'no')},'force_avp':{'type':Sequelize[_0x1116('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0x1116('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x18'),'no',_0x1116('0x2b'),_0x1116('0x2c'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x1116('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x1116('0x2')]},'dtlscipher':{'type':Sequelize[_0x1116('0x2')]},'dtlscafile':{'type':Sequelize[_0x1116('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM']('active','passive',_0x1116('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1116('0x2')]},'usereqphone':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1116('0x2')]},'recordofffeature':{'type':Sequelize[_0x1116('0x2')]},'call_limit':{'type':Sequelize[_0x1116('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x1116('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x1116('0x4')]('yes','no')},'vmexten':{'type':Sequelize[_0x1116('0x2')]},'mohinterpret':{'type':Sequelize[_0x1116('0x2')]},'mohsuggest':{'type':Sequelize[_0x1116('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1116('0x2')]},'host':{'type':Sequelize[_0x1116('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x1116('0x4')](_0x1116('0x18'),'no',_0x1116('0x19'),_0x1116('0x1a'),_0x1116('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x1116('0x2')]},'otherFields':{'type':Sequelize[_0x1116('0x2')]},'active':{'type':Sequelize[_0x1116('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x1116('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 16deba8..7b68c46 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 _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0x14d1a2,_0x4c246a){var _0x46e47d=function(_0x9fc4ad){while(--_0x9fc4ad){_0x14d1a2['push'](_0x14d1a2['shift']());}};_0x46e47d(++_0x4c246a);}(_0xbec5,0xe5));var _0x5bec=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0xbec5[_0x237546];return _0x233e29;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));}; \ No newline at end of file +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(_0x1ee1ed,_0x4e54a3){var _0x19e29b=function(_0x425f78){while(--_0x425f78){_0x1ee1ed['push'](_0x1ee1ed['shift']());}};_0x19e29b(++_0x4e54a3);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x20a0ec,_0x4633b5){_0x20a0ec=_0x20a0ec-0x0;var _0x37bfe0=_0x6f0d[_0x20a0ec];return _0x37bfe0;};'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 0d66396..dd60506 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 _0x746a=['moment','request-promise','rimraf','./trunk.attributes','lodash','../../config/logger','api'];(function(_0xbf09ab,_0x251a19){var _0x2a9aef=function(_0x22d793){while(--_0x22d793){_0xbf09ab['push'](_0xbf09ab['shift']());}};_0x2a9aef(++_0x251a19);}(_0x746a,0x1ee));var _0xa746=function(_0x584b76,_0x365e9b){_0x584b76=_0x584b76-0x0;var _0x3ad1d9=_0x746a[_0x584b76];return _0x3ad1d9;};'use strict';var _=require(_0xa746('0x0'));var util=require('util');var logger=require(_0xa746('0x1'))(_0xa746('0x2'));var moment=require(_0xa746('0x3'));var BPromise=require('bluebird');var rp=require(_0xa746('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa746('0x5'));var config=require('../../config/environment');var attributes=require(_0xa746('0x6'));module['exports']=function(_0x5b41bd,_0x5f493b){return _0x5b41bd['define']('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ac7=['moment','bluebird','request-promise','path','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api'];(function(_0x19fbdc,_0x2e1d6a){var _0x176533=function(_0x9003da){while(--_0x9003da){_0x19fbdc['push'](_0x19fbdc['shift']());}};_0x176533(++_0x2e1d6a);}(_0x3ac7,0x1c3));var _0x73ac=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3ac7[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x73ac('0x0'));var util=require(_0x73ac('0x1'));var logger=require(_0x73ac('0x2'))(_0x73ac('0x3'));var moment=require(_0x73ac('0x4'));var BPromise=require(_0x73ac('0x5'));var rp=require(_0x73ac('0x6'));var fs=require('fs');var path=require(_0x73ac('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x73ac('0x8'));module[_0x73ac('0x9')]=function(_0xf8535b,_0x2f9435){return _0xf8535b[_0x73ac('0xa')](_0x73ac('0xb'),attributes,{'tableName':_0x73ac('0xc'),'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 2cfcc16..812cd97 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 _0xedb4=['debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','Trunk','findAll','options','raw','attributes','limit','include','map','model','then','GetTrunk','ShowTrunk','find','where','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Trunk,\x20%s,\x20%s'];(function(_0x5e7c51,_0x16e1ce){var _0x1480b8=function(_0x1eeb25){while(--_0x1eeb25){_0x5e7c51['push'](_0x5e7c51['shift']());}};_0x1480b8(++_0x16e1ce);}(_0xedb4,0x15b));var _0x4edb=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0xedb4[_0x4e1a49];return _0x136aae;};'use strict';var _=require(_0x4edb('0x0'));var util=require(_0x4edb('0x1'));var moment=require('moment');var BPromise=require(_0x4edb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4edb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4edb('0x4'));var logger=require(_0x4edb('0x5'))(_0x4edb('0x6'));var config=require(_0x4edb('0x7'));var jayson=require(_0x4edb('0x8'));var client=jayson[_0x4edb('0x9')][_0x4edb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e7e63,_0x2d9c75,_0x5a5313){return new BPromise(function(_0x2ef986,_0x1b688b){return client[_0x4edb('0xb')](_0x1e7e63,_0x5a5313)['then'](function(_0x568fdd){logger['info'](_0x4edb('0xc'),_0x2d9c75,'request\x20sent');logger[_0x4edb('0xd')](_0x4edb('0xe'),_0x2d9c75,_0x4edb('0xf'),JSON[_0x4edb('0x10')](_0x568fdd));if(_0x568fdd[_0x4edb('0x11')]){if(_0x568fdd['error'][_0x4edb('0x12')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x2d9c75,_0x568fdd[_0x4edb('0x11')][_0x4edb('0x13')]);return _0x1b688b(_0x568fdd[_0x4edb('0x11')][_0x4edb('0x13')]);}logger['error'](_0x4edb('0xc'),_0x2d9c75,_0x568fdd[_0x4edb('0x11')][_0x4edb('0x13')]);return _0x2ef986(_0x568fdd[_0x4edb('0x11')][_0x4edb('0x13')]);}else{logger[_0x4edb('0x14')](_0x4edb('0xc'),_0x2d9c75,_0x4edb('0xf'));_0x2ef986(_0x568fdd['result'][_0x4edb('0x13')]);}})[_0x4edb('0x15')](function(_0x1affb9){logger[_0x4edb('0x11')](_0x4edb('0xc'),_0x2d9c75,_0x1affb9);_0x1b688b(_0x1affb9);});});}exports['GetTrunk']=function(_0x49a8b6){var _0x5aca17=this;return new Promise(function(_0x2cc18b,_0x2cf6c3){return db[_0x4edb('0x16')][_0x4edb('0x17')]({'raw':_0x49a8b6[_0x4edb('0x18')]?_0x49a8b6[_0x4edb('0x18')][_0x4edb('0x19')]===undefined?!![]:![]:!![],'where':_0x49a8b6[_0x4edb('0x18')]?_0x49a8b6[_0x4edb('0x18')]['where']||null:null,'attributes':_0x49a8b6[_0x4edb('0x18')]?_0x49a8b6['options'][_0x4edb('0x1a')]||null:null,'limit':_0x49a8b6[_0x4edb('0x18')]?_0x49a8b6[_0x4edb('0x18')][_0x4edb('0x1b')]||null:null,'include':_0x49a8b6['options']?_0x49a8b6[_0x4edb('0x18')][_0x4edb('0x1c')]?_[_0x4edb('0x1d')](_0x49a8b6['options']['include'],function(_0xb3a03f){return{'model':db[_0xb3a03f[_0x4edb('0x1e')]],'as':_0xb3a03f['as'],'attributes':_0xb3a03f[_0x4edb('0x1a')],'include':_0xb3a03f[_0x4edb('0x1c')]?_[_0x4edb('0x1d')](_0xb3a03f[_0x4edb('0x1c')],function(_0x56e02d){return{'model':db[_0x56e02d[_0x4edb('0x1e')]],'as':_0x56e02d['as'],'attributes':_0x56e02d['attributes'],'include':_0x56e02d['include']?_['map'](_0x56e02d[_0x4edb('0x1c')],function(_0xd72ed9){return{'model':db[_0xd72ed9[_0x4edb('0x1e')]],'as':_0xd72ed9['as'],'attributes':_0xd72ed9[_0x4edb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4edb('0x1f')](function(_0x581453){logger['info'](_0x4edb('0x20'),_0x49a8b6);logger[_0x4edb('0xd')](_0x4edb('0x20'),_0x49a8b6,JSON[_0x4edb('0x10')](_0x581453));_0x2cc18b(_0x581453);})[_0x4edb('0x15')](function(_0x3c647f){logger['error'](_0x4edb('0x20'),_0x3c647f[_0x4edb('0x13')],_0x49a8b6);_0x2cf6c3(_0x5aca17[_0x4edb('0x11')](0x1f4,_0x3c647f[_0x4edb('0x13')]));});});};exports[_0x4edb('0x21')]=function(_0x1a3345){var _0x43e142=this;return new Promise(function(_0x4423c8,_0x53c428){return db[_0x4edb('0x16')][_0x4edb('0x22')]({'raw':_0x1a3345[_0x4edb('0x18')]?_0x1a3345[_0x4edb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1a3345[_0x4edb('0x18')]?_0x1a3345[_0x4edb('0x18')][_0x4edb('0x23')]||null:null,'attributes':_0x1a3345[_0x4edb('0x18')]?_0x1a3345['options'][_0x4edb('0x1a')]||null:null,'include':_0x1a3345[_0x4edb('0x18')]?_0x1a3345['options'][_0x4edb('0x1c')]?_[_0x4edb('0x1d')](_0x1a3345[_0x4edb('0x18')][_0x4edb('0x1c')],function(_0x2a3147){return{'model':db[_0x2a3147[_0x4edb('0x1e')]],'as':_0x2a3147['as'],'attributes':_0x2a3147[_0x4edb('0x1a')],'include':_0x2a3147['include']?_[_0x4edb('0x1d')](_0x2a3147[_0x4edb('0x1c')],function(_0x3f748a){return{'model':db[_0x3f748a[_0x4edb('0x1e')]],'as':_0x3f748a['as'],'attributes':_0x3f748a[_0x4edb('0x1a')],'include':_0x3f748a[_0x4edb('0x1c')]?_[_0x4edb('0x1d')](_0x3f748a[_0x4edb('0x1c')],function(_0xe81b4b){return{'model':db[_0xe81b4b[_0x4edb('0x1e')]],'as':_0xe81b4b['as'],'attributes':_0xe81b4b[_0x4edb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4edb('0x1f')](function(_0x2c6821){logger[_0x4edb('0x14')]('ShowTrunk',_0x1a3345);logger[_0x4edb('0xd')](_0x4edb('0x21'),_0x1a3345,JSON[_0x4edb('0x10')](_0x2c6821));_0x4423c8(_0x2c6821);})['catch'](function(_0x999808){logger[_0x4edb('0x11')](_0x4edb('0x21'),_0x999808['message'],_0x1a3345);_0x53c428(_0x43e142[_0x4edb('0x11')](0x1f4,_0x999808[_0x4edb('0x13')]));});});}; \ No newline at end of file +var _0xc380=['info','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','GetTrunk','stringify','catch','ShowTrunk','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','Trunk,\x20%s,\x20%s','message'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xc380,0x1a8));var _0x0c38=function(_0x54de73,_0x45224e){_0x54de73=_0x54de73-0x0;var _0x458315=_0xc380[_0x54de73];return _0x458315;};'use strict';var _=require(_0x0c38('0x0'));var util=require('util');var moment=require(_0x0c38('0x1'));var BPromise=require(_0x0c38('0x2'));var rs=require(_0x0c38('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c38('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c38('0x5'))(_0x0c38('0x6'));var config=require('../../config/environment');var jayson=require(_0x0c38('0x7'));var client=jayson[_0x0c38('0x8')][_0x0c38('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54cd14,_0x167e7a,_0x5337e3){return new BPromise(function(_0x240b30,_0x27b0aa){return client[_0x0c38('0xa')](_0x54cd14,_0x5337e3)[_0x0c38('0xb')](function(_0x190ffd){logger['info']('Trunk,\x20%s,\x20%s',_0x167e7a,_0x0c38('0xc'));logger[_0x0c38('0xd')]('Trunk,\x20%s,\x20%s,\x20%s',_0x167e7a,_0x0c38('0xc'),JSON['stringify'](_0x190ffd));if(_0x190ffd['error']){if(_0x190ffd[_0x0c38('0xe')][_0x0c38('0xf')]===0x1f4){logger[_0x0c38('0xe')](_0x0c38('0x10'),_0x167e7a,_0x190ffd[_0x0c38('0xe')][_0x0c38('0x11')]);return _0x27b0aa(_0x190ffd[_0x0c38('0xe')][_0x0c38('0x11')]);}logger[_0x0c38('0xe')]('Trunk,\x20%s,\x20%s',_0x167e7a,_0x190ffd[_0x0c38('0xe')][_0x0c38('0x11')]);return _0x240b30(_0x190ffd['error']['message']);}else{logger[_0x0c38('0x12')](_0x0c38('0x10'),_0x167e7a,_0x0c38('0xc'));_0x240b30(_0x190ffd['result'][_0x0c38('0x11')]);}})['catch'](function(_0x3cbb27){logger[_0x0c38('0xe')]('Trunk,\x20%s,\x20%s',_0x167e7a,_0x3cbb27);_0x27b0aa(_0x3cbb27);});});}exports['GetTrunk']=function(_0x28d6c1){var _0x485f11=this;return new Promise(function(_0x1b64b3,_0xc6a194){return db[_0x0c38('0x13')][_0x0c38('0x14')]({'raw':_0x28d6c1[_0x0c38('0x15')]?_0x28d6c1[_0x0c38('0x15')][_0x0c38('0x16')]===undefined?!![]:![]:!![],'where':_0x28d6c1[_0x0c38('0x15')]?_0x28d6c1['options'][_0x0c38('0x17')]||null:null,'attributes':_0x28d6c1[_0x0c38('0x15')]?_0x28d6c1[_0x0c38('0x15')][_0x0c38('0x18')]||null:null,'limit':_0x28d6c1['options']?_0x28d6c1['options'][_0x0c38('0x19')]||null:null,'include':_0x28d6c1['options']?_0x28d6c1[_0x0c38('0x15')][_0x0c38('0x1a')]?_[_0x0c38('0x1b')](_0x28d6c1[_0x0c38('0x15')][_0x0c38('0x1a')],function(_0x118472){return{'model':db[_0x118472[_0x0c38('0x1c')]],'as':_0x118472['as'],'attributes':_0x118472[_0x0c38('0x18')],'include':_0x118472['include']?_[_0x0c38('0x1b')](_0x118472[_0x0c38('0x1a')],function(_0x5bc0b9){return{'model':db[_0x5bc0b9[_0x0c38('0x1c')]],'as':_0x5bc0b9['as'],'attributes':_0x5bc0b9[_0x0c38('0x18')],'include':_0x5bc0b9[_0x0c38('0x1a')]?_['map'](_0x5bc0b9[_0x0c38('0x1a')],function(_0x40e43b){return{'model':db[_0x40e43b['model']],'as':_0x40e43b['as'],'attributes':_0x40e43b[_0x0c38('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0c38('0xb')](function(_0x4e93f4){logger[_0x0c38('0x12')](_0x0c38('0x1d'),_0x28d6c1);logger[_0x0c38('0xd')](_0x0c38('0x1d'),_0x28d6c1,JSON[_0x0c38('0x1e')](_0x4e93f4));_0x1b64b3(_0x4e93f4);})[_0x0c38('0x1f')](function(_0x40ec6a){logger[_0x0c38('0xe')](_0x0c38('0x1d'),_0x40ec6a[_0x0c38('0x11')],_0x28d6c1);_0xc6a194(_0x485f11[_0x0c38('0xe')](0x1f4,_0x40ec6a[_0x0c38('0x11')]));});});};exports[_0x0c38('0x20')]=function(_0x10a035){var _0x2cda02=this;return new Promise(function(_0x497b68,_0xabfe3c){return db[_0x0c38('0x13')][_0x0c38('0x21')]({'raw':_0x10a035['options']?_0x10a035[_0x0c38('0x15')][_0x0c38('0x16')]===undefined?!![]:![]:!![],'where':_0x10a035[_0x0c38('0x15')]?_0x10a035['options']['where']||null:null,'attributes':_0x10a035[_0x0c38('0x15')]?_0x10a035['options']['attributes']||null:null,'include':_0x10a035['options']?_0x10a035[_0x0c38('0x15')]['include']?_[_0x0c38('0x1b')](_0x10a035[_0x0c38('0x15')][_0x0c38('0x1a')],function(_0x19233a){return{'model':db[_0x19233a['model']],'as':_0x19233a['as'],'attributes':_0x19233a[_0x0c38('0x18')],'include':_0x19233a[_0x0c38('0x1a')]?_[_0x0c38('0x1b')](_0x19233a[_0x0c38('0x1a')],function(_0x1203be){return{'model':db[_0x1203be[_0x0c38('0x1c')]],'as':_0x1203be['as'],'attributes':_0x1203be[_0x0c38('0x18')],'include':_0x1203be['include']?_[_0x0c38('0x1b')](_0x1203be['include'],function(_0x2d093b){return{'model':db[_0x2d093b[_0x0c38('0x1c')]],'as':_0x2d093b['as'],'attributes':_0x2d093b[_0x0c38('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0c38('0xb')](function(_0x12ee24){logger['info']('ShowTrunk',_0x10a035);logger[_0x0c38('0xd')](_0x0c38('0x20'),_0x10a035,JSON[_0x0c38('0x1e')](_0x12ee24));_0x497b68(_0x12ee24);})[_0x0c38('0x1f')](function(_0x12c784){logger[_0x0c38('0xe')](_0x0c38('0x20'),_0x12c784[_0x0c38('0x11')],_0x10a035);_0xabfe3c(_0x2cda02[_0x0c38('0xe')](0x1f4,_0x12c784[_0x0c38('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index a9e1d31..fd707ff 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0164=['update','Router','put','/:id','isAuthenticated'];(function(_0x4a579f,_0x2971d5){var _0x207bf1=function(_0x3b62ac){while(--_0x3b62ac){_0x4a579f['push'](_0x4a579f['shift']());}};_0x207bf1(++_0x2971d5);}(_0x0164,0x92));var _0x4016=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x0164[_0x521929];return _0x632436;};'use strict';var express=require('express');var router=express[_0x4016('0x0')]();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router[_0x4016('0x1')](_0x4016('0x2'),auth[_0x4016('0x3')](),controller[_0x4016('0x4')]);module['exports']=router; \ No newline at end of file +var _0xc9b3=['isAuthenticated','exports','express','Router','../../components/auth/service','put','/:id'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xc9b3,0x159));var _0x3c9b=function(_0x29e5b8,_0x2b9feb){_0x29e5b8=_0x29e5b8-0x0;var _0x5e62e0=_0xc9b3[_0x29e5b8];return _0x5e62e0;};'use strict';var express=require(_0x3c9b('0x0'));var router=express[_0x3c9b('0x1')]();var auth=require(_0x3c9b('0x2'));var controller=require('./user-setting.controller');router[_0x3c9b('0x3')](_0x3c9b('0x4'),auth[_0x3c9b('0x5')](),controller['update']);module[_0x3c9b('0x6')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 2865aed..cc93009 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4747=['warning','info','debug','exports','ENUM','TEXT','DATE','INTEGER','UserId','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4747,0x15d));var _0x7474=function(_0x5f5be8,_0x56cc02){_0x5f5be8=_0x5f5be8-0x0;var _0x5a9a36=_0x4747[_0x5f5be8];return _0x5a9a36;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x7474('0x0'),_0x7474('0x1'),_0x7474('0x2'),_0x7474('0x3')];module[_0x7474('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x7474('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x7474('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x7474('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x7474('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x7474('0x8')],'unique':_0x7474('0x9')}}; \ No newline at end of file +var _0x45e8=['warning','exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0x45e8,0x1b6));var _0x845e=function(_0x2bb787,_0x41bf02){_0x2bb787=_0x2bb787-0x0;var _0x425b33=_0x45e8[_0x2bb787];return _0x425b33;};'use strict';var Sequelize=require(_0x845e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x845e('0x1'),_0x845e('0x2'),'info','debug'];module[_0x845e('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x845e('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x845e('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x845e('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x845e('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x845e('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x845e('0x8')],'unique':_0x845e('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 3b3e858..a079891 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83f1=['defaults','localhost','status','update','then','error','stack','name','send','user','role','admin','Unauthorized','Invalid\x20user\x20setting\x20id','find','params','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','redis','./user-setting.socket','register'];(function(_0x109371,_0x441c8e){var _0x4fd858=function(_0x13504f){while(--_0x13504f){_0x109371['push'](_0x109371['shift']());}};_0x4fd858(++_0x441c8e);}(_0x83f1,0x1cc));var _0x183f=function(_0x1ffddc,_0x5cbe4a){_0x1ffddc=_0x1ffddc-0x0;var _0x42bbb1=_0x83f1[_0x1ffddc];return _0x42bbb1;};'use strict';var _=require(_0x183f('0x0'));var Redis=require(_0x183f('0x1'));var logger=require(_0x183f('0x2'))(_0x183f('0x3'));var config=require(_0x183f('0x4'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x183f('0x5')]));require(_0x183f('0x6'))[_0x183f('0x7')](socket);config[_0x183f('0x5')]=_[_0x183f('0x8')](config['redis'],{'host':_0x183f('0x9'),'port':0x18eb});function respondWithResult(_0xf702f5,_0x364cc4){_0x364cc4=_0x364cc4||0xc8;return function(_0x5c75c3){if(_0x5c75c3){return _0xf702f5[_0x183f('0xa')](_0x364cc4)['json'](_0x5c75c3);}};}function saveUpdates(_0xf1140d){return function(_0x828173){if(_0x828173){return _0x828173[_0x183f('0xb')](_0xf1140d)[_0x183f('0xc')](function(_0x22bcd6){return _0x22bcd6;});}return null;};}function handleEntityNotFound(_0x1848a6){return function(_0x333813){if(!_0x333813){_0x1848a6['sendStatus'](0x194);}return _0x333813;};}function handleError(_0x1a1031,_0xa7889b){_0xa7889b=_0xa7889b||0x1f4;return function(_0x3a99ee){logger[_0x183f('0xd')](_0x3a99ee[_0x183f('0xe')]);if(_0x3a99ee[_0x183f('0xf')]){delete _0x3a99ee[_0x183f('0xf')];}_0x1a1031['status'](_0xa7889b)[_0x183f('0x10')](_0x3a99ee);};}exports['update']=function(_0x5619e8,_0xa71c57){if(_0x5619e8[_0x183f('0x11')][_0x183f('0x12')]!==_0x183f('0x13'))throw new Error(_0x183f('0x14'));if(isNaN(Number(_0x5619e8['params']['id'])))throw new Error(_0x183f('0x15'));return db['UserSetting'][_0x183f('0x16')]({'where':{'id':_0x5619e8[_0x183f('0x17')]['id']}})[_0x183f('0xc')](handleEntityNotFound(_0xa71c57,null))['then'](saveUpdates(_0x5619e8[_0x183f('0x18')],null))[_0x183f('0xc')](respondWithResult(_0xa71c57,null))[_0x183f('0x19')](handleError(_0xa71c57,null));}; \ No newline at end of file +var _0x1d25=['redis','register','defaults','localhost','json','update','then','sendStatus','error','name','user','role','Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter'];(function(_0x48f70a,_0xb94a02){var _0x3a2208=function(_0xe9324a){while(--_0xe9324a){_0x48f70a['push'](_0x48f70a['shift']());}};_0x3a2208(++_0xb94a02);}(_0x1d25,0xba));var _0x51d2=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0x1d25[_0x23c73d];return _0x36ba47;};'use strict';var _=require(_0x51d2('0x0'));var Redis=require(_0x51d2('0x1'));var logger=require(_0x51d2('0x2'))(_0x51d2('0x3'));var config=require(_0x51d2('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0x51d2('0x5'))(new Redis(config[_0x51d2('0x6')]));require('./user-setting.socket')[_0x51d2('0x7')](socket);config[_0x51d2('0x6')]=_[_0x51d2('0x8')](config[_0x51d2('0x6')],{'host':_0x51d2('0x9'),'port':0x18eb});function respondWithResult(_0x2e6956,_0x56edda){_0x56edda=_0x56edda||0xc8;return function(_0x18e8a9){if(_0x18e8a9){return _0x2e6956['status'](_0x56edda)[_0x51d2('0xa')](_0x18e8a9);}};}function saveUpdates(_0x4dfc7e){return function(_0x532061){if(_0x532061){return _0x532061[_0x51d2('0xb')](_0x4dfc7e)[_0x51d2('0xc')](function(_0x39cf55){return _0x39cf55;});}return null;};}function handleEntityNotFound(_0x359fb6){return function(_0x50f9b4){if(!_0x50f9b4){_0x359fb6[_0x51d2('0xd')](0x194);}return _0x50f9b4;};}function handleError(_0x46c9e8,_0x32d0ff){_0x32d0ff=_0x32d0ff||0x1f4;return function(_0xc69291){logger[_0x51d2('0xe')](_0xc69291['stack']);if(_0xc69291[_0x51d2('0xf')]){delete _0xc69291[_0x51d2('0xf')];}_0x46c9e8['status'](_0x32d0ff)['send'](_0xc69291);};}exports[_0x51d2('0xb')]=function(_0x1f81e4,_0x43ddf6){if(_0x1f81e4[_0x51d2('0x10')][_0x51d2('0x11')]!=='admin')throw new Error(_0x51d2('0x12'));if(isNaN(Number(_0x1f81e4['params']['id'])))throw new Error(_0x51d2('0x13'));return db[_0x51d2('0x14')][_0x51d2('0x15')]({'where':{'id':_0x1f81e4['params']['id']}})[_0x51d2('0xc')](handleEntityNotFound(_0x43ddf6,null))[_0x51d2('0xc')](saveUpdates(_0x1f81e4[_0x51d2('0x16')],null))[_0x51d2('0xc')](respondWithResult(_0x43ddf6,null))[_0x51d2('0x17')](handleError(_0x43ddf6,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 1d3f312..55ad2f3 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf62d=['hasOwnProperty','hook','UserSetting','save','update','remove','emit'];(function(_0x1fd988,_0xf7f376){var _0x9c37ab=function(_0x28528b){while(--_0x28528b){_0x1fd988['push'](_0x1fd988['shift']());}};_0x9c37ab(++_0xf7f376);}(_0xf62d,0x1ad));var _0xdf62=function(_0x43577a,_0xd9dc6e){_0x43577a=_0x43577a-0x0;var _0xb8d923=_0xf62d[_0x43577a];return _0xb8d923;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db'][_0xdf62('0x0')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdf62('0x1'),'afterUpdate':_0xdf62('0x2'),'afterDestroy':_0xdf62('0x3')};function emitEvent(_0x1f18b4){return function(_0x50e60e,_0x13dc85,_0x193c30){UserSettingEvents[_0xdf62('0x4')](_0x1f18b4+':'+_0x50e60e['id'],_0x50e60e);UserSettingEvents[_0xdf62('0x4')](_0x1f18b4,_0x50e60e);_0x193c30(null);};}for(var e in events){if(events[_0xdf62('0x5')](e)){var event=events[e];UserSetting[_0xdf62('0x6')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0xd843=['remove','emit','hasOwnProperty','exports','events','save','update'];(function(_0x31ffde,_0x34561b){var _0x5825de=function(_0x7aae40){while(--_0x7aae40){_0x31ffde['push'](_0x31ffde['shift']());}};_0x5825de(++_0x34561b);}(_0xd843,0x1cb));var _0x3d84=function(_0x9a29ea,_0x5b8b29){_0x9a29ea=_0x9a29ea-0x0;var _0x11f261=_0xd843[_0x9a29ea];return _0x11f261;};'use strict';var EventEmitter=require(_0x3d84('0x0'));var UserSetting=require('../../mysqldb')['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3d84('0x1'),'afterUpdate':_0x3d84('0x2'),'afterDestroy':_0x3d84('0x3')};function emitEvent(_0x5c53aa){return function(_0x5109aa,_0x52b7c1,_0x115217){UserSettingEvents[_0x3d84('0x4')](_0x5c53aa+':'+_0x5109aa['id'],_0x5109aa);UserSettingEvents[_0x3d84('0x4')](_0x5c53aa,_0x5109aa);_0x115217(null);};}for(var e in events){if(events[_0x3d84('0x5')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x3d84('0x6')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index ccf6038..71c6341 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e77=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','exports'];(function(_0x1faaa1,_0x1568dd){var _0x994ec=function(_0x298ef4){while(--_0x298ef4){_0x1faaa1['push'](_0x1faaa1['shift']());}};_0x994ec(++_0x1568dd);}(_0x6e77,0xef));var _0x76e7=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x6e77[_0x2f6541];return _0x4d76d8;};'use strict';var attributes=require('./user-setting.attributes');module[_0x76e7('0x0')]=function(_0x558eec){return _0x558eec['define'](_0x76e7('0x1'),attributes,{'tableName':_0x76e7('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57a8b3){if(!_0x57a8b3[_0x76e7('0x3')])_0x57a8b3[_0x76e7('0x4')]=null;else if(_0x57a8b3[_0x76e7('0x4')]===null)_0x57a8b3['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0x3870=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting','clientSideLoggingEnabled'];(function(_0x5db0a5,_0x129534){var _0x328d07=function(_0x5513d9){while(--_0x5513d9){_0x5db0a5['push'](_0x5db0a5['shift']());}};_0x328d07(++_0x129534);}(_0x3870,0x146));var _0x0387=function(_0x102dca,_0x5b78e1){_0x102dca=_0x102dca-0x0;var _0x3096e7=_0x3870[_0x102dca];return _0x3096e7;};'use strict';var attributes=require(_0x0387('0x0'));module[_0x0387('0x1')]=function(_0x2a67ee){return _0x2a67ee['define'](_0x0387('0x2'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x310701){if(!_0x310701[_0x0387('0x3')])_0x310701['clientSideLoggingEnabledSince']=null;else if(_0x310701[_0x0387('0x4')]===null)_0x310701[_0x0387('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index adee2b0..aabcbb7 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc448=['update','emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save','remove'];(function(_0x1e7935,_0x3bb652){var _0x3eb2aa=function(_0x665b78){while(--_0x665b78){_0x1e7935['push'](_0x1e7935['shift']());}};_0x3eb2aa(++_0x3bb652);}(_0xc448,0x8c));var _0x8c44=function(_0x50a330,_0x1533cf){_0x50a330=_0x50a330-0x0;var _0x3205ce=_0xc448[_0x50a330];return _0x3205ce;};'use strict';var UserSettingEvents=require(_0x8c44('0x0'));var events=[_0x8c44('0x1'),_0x8c44('0x2'),_0x8c44('0x3')];function createListener(_0x422417,_0x4b0d8b){return function(_0x468b93){_0x4b0d8b[_0x8c44('0x4')](_0x422417,_0x468b93);if(_0x422417===_0x8c44('0x5')){_0x4b0d8b[_0x8c44('0x4')](_0x8c44('0x6')+_0x468b93[_0x8c44('0x7')],_0x468b93);}};}exports[_0x8c44('0x8')]=function(_0x667b35){for(var _0x146ccf=0x0,_0x3ed469=events[_0x8c44('0x9')];_0x146ccf<_0x3ed469;_0x146ccf++){var _0x531f90=events[_0x146ccf];var _0xef5b9b=createListener(_0x8c44('0xa')+_0x531f90,_0x667b35);UserSettingEvents['on'](_0x531f90,_0xef5b9b);}}; \ No newline at end of file +var _0x66f8=['UserId','length','user-setting:','./user-setting.events','update','emit','user-setting:update:user-'];(function(_0x4240af,_0x1619f7){var _0x1f6338=function(_0xb52fd0){while(--_0xb52fd0){_0x4240af['push'](_0x4240af['shift']());}};_0x1f6338(++_0x1619f7);}(_0x66f8,0x137));var _0x866f=function(_0x46fa98,_0x57bf65){_0x46fa98=_0x46fa98-0x0;var _0x2e55ff=_0x66f8[_0x46fa98];return _0x2e55ff;};'use strict';var UserSettingEvents=require(_0x866f('0x0'));var events=['save','remove',_0x866f('0x1')];function createListener(_0x4a75b5,_0x22cc33){return function(_0x3388b9){_0x22cc33[_0x866f('0x2')](_0x4a75b5,_0x3388b9);if(_0x4a75b5==='user-setting:update'){_0x22cc33[_0x866f('0x2')](_0x866f('0x3')+_0x3388b9[_0x866f('0x4')],_0x3388b9);}};}exports['register']=function(_0x344e2b){for(var _0x297b9c=0x0,_0x12f8e6=events[_0x866f('0x5')];_0x297b9c<_0x12f8e6;_0x297b9c++){var _0x31e2c6=events[_0x297b9c];var _0x45c58a=createListener(_0x866f('0x6')+_0x31e2c6,_0x344e2b);UserSettingEvents['on'](_0x31e2c6,_0x45c58a);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index b556d90..56c52e1 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 _0xcd7a=['getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','getApiKey','create','post','/create_many','bulkCreate','addQueues','diskStorage','join','root','%s-%s','now','originalname','/:id/avatar','file','/:id/login','login','/:id/logout','/:id/pause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addWhatsappAccounts','createApiKey','put','update','changePassword','delete','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeSmsInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','/:id/openchannel_accounts','removeOpenchannelAccounts','removeSmsAccounts','messengerSoundNotification','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents'];(function(_0x24d676,_0x40fdbc){var _0x14f30e=function(_0x2a4a9f){while(--_0x2a4a9f){_0x24d676['push'](_0x24d676['shift']());}};_0x14f30e(++_0x40fdbc);}(_0xcd7a,0x115));var _0xacd7=function(_0x94eb04,_0x1d0870){_0x94eb04=_0x94eb04-0x0;var _0x4d5e86=_0xcd7a[_0x94eb04];return _0x4d5e86;};'use strict';var multer=require(_0xacd7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xacd7('0x1'));var express=require(_0xacd7('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xacd7('0x3'));var interaction=require(_0xacd7('0x4'));var config=require(_0xacd7('0x5'));var controller=require(_0xacd7('0x6'));router[_0xacd7('0x7')]('/',auth[_0xacd7('0x8')](),controller[_0xacd7('0x9')]);router[_0xacd7('0x7')](_0xacd7('0xa'),auth[_0xacd7('0x8')](),controller[_0xacd7('0xb')]);router[_0xacd7('0x7')](_0xacd7('0xc'),auth[_0xacd7('0x8')](),controller['whoami']);router[_0xacd7('0x7')](_0xacd7('0xd'),auth[_0xacd7('0x8')](),controller[_0xacd7('0xe')]);router[_0xacd7('0x7')](_0xacd7('0xf'),auth['isAuthenticated'](),controller[_0xacd7('0x10')]);router[_0xacd7('0x7')]('/:id/avatar',controller[_0xacd7('0x11')]);router[_0xacd7('0x7')](_0xacd7('0x12'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0xacd7('0x7')](_0xacd7('0x13'),auth[_0xacd7('0x8')](),controller['getContacts']);router['get'](_0xacd7('0x14'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x15')]);router[_0xacd7('0x7')](_0xacd7('0x16'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x17')]);router[_0xacd7('0x7')](_0xacd7('0x18'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x19')]);router[_0xacd7('0x7')](_0xacd7('0x1a'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x1b')]);router[_0xacd7('0x7')](_0xacd7('0x1c'),auth['isAuthenticated'](),controller['getScreenRecordings']);router['get'](_0xacd7('0x1d'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x1e')]);router[_0xacd7('0x7')](_0xacd7('0x1f'),auth['isAuthenticated'](),controller[_0xacd7('0x20')]);router[_0xacd7('0x7')](_0xacd7('0x21'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x22')]);router[_0xacd7('0x7')]('/:id/sms/interactions',auth[_0xacd7('0x8')](),controller[_0xacd7('0x23')]);router['get']('/:id/fax/interactions',auth[_0xacd7('0x8')](),controller[_0xacd7('0x24')]);router['get'](_0xacd7('0x25'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x26')]);router[_0xacd7('0x7')](_0xacd7('0x27'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x28')]);router[_0xacd7('0x7')]('/:id/lists',auth[_0xacd7('0x8')](),controller[_0xacd7('0x29')]);router[_0xacd7('0x7')](_0xacd7('0x2a'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x2b')]);router[_0xacd7('0x7')]('/:id/prefixes',auth[_0xacd7('0x8')](),controller[_0xacd7('0x2c')]);router[_0xacd7('0x7')](_0xacd7('0x2d'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x2e')]);router[_0xacd7('0x7')](_0xacd7('0x2f'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x30')]);router['get']('/:id/openchannel_accounts',auth[_0xacd7('0x8')](),controller[_0xacd7('0x31')]);router[_0xacd7('0x7')]('/:id/sms_accounts',auth[_0xacd7('0x8')](),controller['getSmsAccounts']);router[_0xacd7('0x7')](_0xacd7('0x32'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x33')]);router['get'](_0xacd7('0x34'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x35')]);router[_0xacd7('0x7')]('/:id/scheduled_calls',auth[_0xacd7('0x8')](),controller[_0xacd7('0x36')]);router['get'](_0xacd7('0x37'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x38')]);router['post'](_0xacd7('0x13'),auth['isAuthenticated'](),controller['addContacts']);router['post']('/',auth[_0xacd7('0x8')](),controller[_0xacd7('0x39')]);router[_0xacd7('0x3a')](_0xacd7('0x3b'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x3c')]);router['post'](_0xacd7('0x14'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x3d')]);var upload=multer({'storage':multer[_0xacd7('0x3e')]({'destination':function(_0x4f7210,_0x47a09b,_0x54e064){_0x54e064(null,path[_0xacd7('0x3f')](config[_0xacd7('0x40')],'server/files/images/'));},'filename':function(_0x100cd3,_0x4b40e7,_0x17fa5a){_0x17fa5a(null,util['format'](_0xacd7('0x41'),Date[_0xacd7('0x42')](),_0x4b40e7[_0xacd7('0x43')]));}})});router['post'](_0xacd7('0x44'),upload['single'](_0xacd7('0x45')),controller['addAvatar']);router[_0xacd7('0x3a')](_0xacd7('0x46'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x47')]);router[_0xacd7('0x3a')](_0xacd7('0x48'),auth[_0xacd7('0x8')](),controller['logout']);router['post'](_0xacd7('0x49'),auth[_0xacd7('0x8')](),controller['pause']);router[_0xacd7('0x3a')]('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router['post'](_0xacd7('0x27'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x4a')]);router[_0xacd7('0x3a')]('/:id/chat_interactions',auth[_0xacd7('0x8')](),controller[_0xacd7('0x4b')]);router[_0xacd7('0x3a')](_0xacd7('0x4c'),auth['isAuthenticated'](),controller[_0xacd7('0x4d')]);router['post']('/:id/fax_interactions',auth[_0xacd7('0x8')](),controller[_0xacd7('0x4e')]);router['post']('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xacd7('0x4f')]);router[_0xacd7('0x3a')]('/:id/openchannel_interactions',auth[_0xacd7('0x8')](),controller[_0xacd7('0x50')]);router[_0xacd7('0x3a')](_0xacd7('0x51'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x52')]);router[_0xacd7('0x3a')](_0xacd7('0x2d'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x53')]);router[_0xacd7('0x3a')](_0xacd7('0x2f'),auth['isAuthenticated'](),controller['addMailAccounts']);router['post']('/:id/openchannel_accounts',auth[_0xacd7('0x8')](),controller[_0xacd7('0x54')]);router[_0xacd7('0x3a')](_0xacd7('0x55'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x56')]);router['post']('/:id/chat_websites',auth['isAuthenticated'](),controller['addChatWebsites']);router[_0xacd7('0x3a')](_0xacd7('0x34'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x57')]);router[_0xacd7('0x3a')]('/:id/api_key',auth[_0xacd7('0x8')](),controller[_0xacd7('0x58')]);router[_0xacd7('0x59')]('/:id',auth[_0xacd7('0x8')](),controller[_0xacd7('0x5a')]);router[_0xacd7('0x59')]('/:id/password',auth[_0xacd7('0x8')](),controller[_0xacd7('0x5b')]);router[_0xacd7('0x5c')](_0xacd7('0x14'),auth[_0xacd7('0x8')](),controller['removeQueues']);router[_0xacd7('0x5c')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0xacd7('0x5c')](_0xacd7('0xf'),auth[_0xacd7('0x8')](),controller['destroy']);router[_0xacd7('0x5c')](_0xacd7('0x5d'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x5e')]);router[_0xacd7('0x5c')](_0xacd7('0x4c'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x5f')]);router['delete'](_0xacd7('0x60'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0xacd7('0x5c')]('/:id/sms_interactions',auth[_0xacd7('0x8')](),controller[_0xacd7('0x61')]);router[_0xacd7('0x5c')](_0xacd7('0x62'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0xacd7('0x5c')](_0xacd7('0x51'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x63')]);router['delete'](_0xacd7('0x2d'),auth['isAuthenticated'](),controller[_0xacd7('0x64')]);router[_0xacd7('0x5c')]('/:id/mail_accounts',auth[_0xacd7('0x8')](),controller[_0xacd7('0x65')]);router[_0xacd7('0x5c')](_0xacd7('0x66'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x67')]);router[_0xacd7('0x5c')](_0xacd7('0x55'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x68')]);router[_0xacd7('0x5c')](_0xacd7('0x32'),auth[_0xacd7('0x8')](),controller['removeChatWebsites']);router[_0xacd7('0x5c')](_0xacd7('0x34'),auth[_0xacd7('0x8')](),controller['removeWhatsappAccounts']);router[_0xacd7('0x5c')]('/:id/api_key',auth[_0xacd7('0x8')](),controller['removeApiKey']);router[_0xacd7('0x3a')]('/:id/messengerSoundNotification',auth[_0xacd7('0x8')](),controller[_0xacd7('0x69')]);module[_0xacd7('0x6a')]=router; \ No newline at end of file +var _0xbc71=['addWhatsappAccounts','/:id/api_key','update','/:id/password','changePassword','removeQueues','delete','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','exports','multer','path','express','fs-extra','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','/presence','getPresence','/:id','/:id/avatar','/:id/open_tabs','getOpenTabs','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','post','/:id/contacts','addContacts','create','/create_many','bulkCreate','/:id/queues','diskStorage','join','root','server/files/images/','format','%s-%s','originalname','single','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','/:id/chat_websites','addChatWebsites'];(function(_0x522e58,_0x3e4601){var _0x375ad2=function(_0x250426){while(--_0x250426){_0x522e58['push'](_0x522e58['shift']());}};_0x375ad2(++_0x3e4601);}(_0xbc71,0x86));var _0x1bc7=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xbc71[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0x1bc7('0x0'));var util=require('util');var path=require(_0x1bc7('0x1'));var timeout=require('connect-timeout');var express=require(_0x1bc7('0x2'));var router=express['Router']();var fs_extra=require(_0x1bc7('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1bc7('0x4'));var controller=require(_0x1bc7('0x5'));router[_0x1bc7('0x6')]('/',auth['isAuthenticated'](),controller[_0x1bc7('0x7')]);router[_0x1bc7('0x6')](_0x1bc7('0x8'),auth[_0x1bc7('0x9')](),controller['describe']);router[_0x1bc7('0x6')]('/whoami',auth[_0x1bc7('0x9')](),controller['whoami']);router[_0x1bc7('0x6')](_0x1bc7('0xa'),auth['isAuthenticated'](),controller[_0x1bc7('0xb')]);router[_0x1bc7('0x6')](_0x1bc7('0xc'),auth[_0x1bc7('0x9')](),controller['show']);router[_0x1bc7('0x6')](_0x1bc7('0xd'),controller['getAvatar']);router[_0x1bc7('0x6')](_0x1bc7('0xe'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0xf')]);router[_0x1bc7('0x6')]('/:id/contacts',auth[_0x1bc7('0x9')](),controller['getContacts']);router['get']('/:id/queues',auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x10')]);router['get'](_0x1bc7('0x11'),auth['isAuthenticated'](),controller[_0x1bc7('0x12')]);router['get']('/:id/groups',auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x13')]);router[_0x1bc7('0x6')](_0x1bc7('0x14'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x15')]);router[_0x1bc7('0x6')](_0x1bc7('0x16'),auth[_0x1bc7('0x9')](),controller['getScreenRecordings']);router[_0x1bc7('0x6')](_0x1bc7('0x17'),auth['isAuthenticated'](),controller[_0x1bc7('0x18')]);router[_0x1bc7('0x6')](_0x1bc7('0x19'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x1a')]);router[_0x1bc7('0x6')](_0x1bc7('0x1b'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x1c')]);router[_0x1bc7('0x6')](_0x1bc7('0x1d'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x1e')]);router[_0x1bc7('0x6')](_0x1bc7('0x1f'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x1bc7('0x6')](_0x1bc7('0x20'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x21')]);router[_0x1bc7('0x6')](_0x1bc7('0x22'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x23')]);router['get']('/:id/lists',auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x24')]);router[_0x1bc7('0x6')]('/:id/agents',auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x25')]);router[_0x1bc7('0x6')]('/:id/prefixes',auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x26')]);router[_0x1bc7('0x6')](_0x1bc7('0x27'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x28')]);router['get'](_0x1bc7('0x29'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x2a')]);router[_0x1bc7('0x6')]('/:id/openchannel_accounts',auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x2b')]);router[_0x1bc7('0x6')](_0x1bc7('0x2c'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x2d')]);router[_0x1bc7('0x6')]('/:id/chat_websites',auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x2e')]);router[_0x1bc7('0x6')](_0x1bc7('0x2f'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x30')]);router[_0x1bc7('0x6')](_0x1bc7('0x31'),auth['isAuthenticated'](),controller[_0x1bc7('0x32')]);router[_0x1bc7('0x6')]('/:id/api_key',auth[_0x1bc7('0x9')](),controller['getApiKey']);router[_0x1bc7('0x33')](_0x1bc7('0x34'),auth['isAuthenticated'](),controller[_0x1bc7('0x35')]);router[_0x1bc7('0x33')]('/',auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x36')]);router[_0x1bc7('0x33')](_0x1bc7('0x37'),auth['isAuthenticated'](),controller[_0x1bc7('0x38')]);router[_0x1bc7('0x33')](_0x1bc7('0x39'),auth[_0x1bc7('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0x1bc7('0x3a')]({'destination':function(_0x6ff990,_0x352035,_0x51a44f){_0x51a44f(null,path[_0x1bc7('0x3b')](config[_0x1bc7('0x3c')],_0x1bc7('0x3d')));},'filename':function(_0x32cf9e,_0x289cbc,_0x22a6e2){_0x22a6e2(null,util[_0x1bc7('0x3e')](_0x1bc7('0x3f'),Date['now'](),_0x289cbc[_0x1bc7('0x40')]));}})});router[_0x1bc7('0x33')](_0x1bc7('0xd'),upload[_0x1bc7('0x41')](_0x1bc7('0x42')),controller['addAvatar']);router[_0x1bc7('0x33')](_0x1bc7('0x43'),auth['isAuthenticated'](),controller[_0x1bc7('0x44')]);router[_0x1bc7('0x33')](_0x1bc7('0x45'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x46')]);router[_0x1bc7('0x33')](_0x1bc7('0x47'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x48')]);router[_0x1bc7('0x33')](_0x1bc7('0x49'),auth[_0x1bc7('0x9')](),controller['unpause']);router['post']('/:id/teams',auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x4a')]);router[_0x1bc7('0x33')](_0x1bc7('0x4b'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x4c')]);router[_0x1bc7('0x33')](_0x1bc7('0x4d'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x4e')]);router[_0x1bc7('0x33')](_0x1bc7('0x4f'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x50')]);router['post'](_0x1bc7('0x51'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x52')]);router[_0x1bc7('0x33')](_0x1bc7('0x53'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x1bc7('0x33')](_0x1bc7('0x54'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x55')]);router[_0x1bc7('0x33')](_0x1bc7('0x27'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x56')]);router[_0x1bc7('0x33')](_0x1bc7('0x29'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x57')]);router[_0x1bc7('0x33')](_0x1bc7('0x58'),auth['isAuthenticated'](),controller[_0x1bc7('0x59')]);router[_0x1bc7('0x33')](_0x1bc7('0x2c'),auth[_0x1bc7('0x9')](),controller['addSmsAccounts']);router['post'](_0x1bc7('0x5a'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x5b')]);router[_0x1bc7('0x33')](_0x1bc7('0x2f'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x5c')]);router[_0x1bc7('0x33')](_0x1bc7('0x5d'),auth['isAuthenticated'](),controller['createApiKey']);router['put'](_0x1bc7('0xc'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x5e')]);router['put'](_0x1bc7('0x5f'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x60')]);router['delete']('/:id/queues',auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x61')]);router[_0x1bc7('0x62')]('/:id/teams',auth[_0x1bc7('0x9')](),controller['removeTeams']);router['delete']('/:id',auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x63')]);router['delete']('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x1bc7('0x64')]);router[_0x1bc7('0x62')](_0x1bc7('0x4d'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x65')]);router[_0x1bc7('0x62')](_0x1bc7('0x4f'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x66')]);router['delete'](_0x1bc7('0x51'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x67')]);router[_0x1bc7('0x62')](_0x1bc7('0x53'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x68')]);router['delete'](_0x1bc7('0x54'),auth['isAuthenticated'](),controller[_0x1bc7('0x69')]);router[_0x1bc7('0x62')](_0x1bc7('0x27'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x6a')]);router[_0x1bc7('0x62')](_0x1bc7('0x29'),auth['isAuthenticated'](),controller[_0x1bc7('0x6b')]);router[_0x1bc7('0x62')](_0x1bc7('0x58'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x6c')]);router[_0x1bc7('0x62')](_0x1bc7('0x2c'),auth[_0x1bc7('0x9')](),controller['removeSmsAccounts']);router[_0x1bc7('0x62')](_0x1bc7('0x5a'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0x1bc7('0x62')](_0x1bc7('0x2f'),auth[_0x1bc7('0x9')](),controller[_0x1bc7('0x6d')]);router[_0x1bc7('0x62')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x1bc7('0x6e')]);router[_0x1bc7('0x33')](_0x1bc7('0x6f'),auth[_0x1bc7('0x9')](),controller['messengerSoundNotification']);module[_0x1bc7('0x70')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index e5b79a1..d8a7bd3 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 _0xacdb=['ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','get','isArray','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','user','agent','telephone','BOOLEAN','DATE','INTEGER','ENUM','friend','peer','from-sip'];(function(_0x118733,_0x2bd820){var _0x4777af=function(_0x52886a){while(--_0x52886a){_0x118733['push'](_0x118733['shift']());}};_0x4777af(++_0x2bd820);}(_0xacdb,0xf7));var _0xbacd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xacdb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbacd('0x0'));var util=require(_0xbacd('0x1'));var _=require(_0xbacd('0x2'));module[_0xbacd('0x3')]={'name':{'type':Sequelize[_0xbacd('0x4')],'allowNull':![],'unique':_0xbacd('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xee15c2){this['setDataValue'](_0xbacd('0x5'),_0xee15c2);this[_0xbacd('0x6')](_0xbacd('0x7'),_0xee15c2);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xbacd('0x4')],'allowNull':![],'set':function(_0x20f401){this[_0xbacd('0x6')](_0xbacd('0x8'),_0x20f401);this[_0xbacd('0x6')](_0xbacd('0x9'),util[_0xbacd('0xa')](_0xbacd('0xb'),_0x20f401,this[_0xbacd('0xc')](_0xbacd('0xd'))));}},'alias':{'type':Sequelize[_0xbacd('0x4')]},'email':{'type':Sequelize[_0xbacd('0x4')],'allowNull':![],'unique':_0xbacd('0xe'),'validate':{'isEmail':!![]},'set':function(_0x5ba8af){if(_0x5ba8af){this['setDataValue'](_0xbacd('0xe'),_0x5ba8af[_0xbacd('0xf')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0xbacd('0x10'),_0xbacd('0x11'),_0xbacd('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xbacd('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xbacd('0xd'),'set':function(_0x37fc35){this[_0xbacd('0x6')](_0xbacd('0xd'),_0x37fc35);this[_0xbacd('0x6')]('accountcode',_0x37fc35);this[_0xbacd('0x6')](_0xbacd('0x9'),util[_0xbacd('0xa')](_0xbacd('0xb'),this[_0xbacd('0xc')]('fullname'),_0x37fc35));}},'salt':{'type':Sequelize[_0xbacd('0x4')]},'phone':{'type':Sequelize[_0xbacd('0x4')]},'mobile':{'type':Sequelize[_0xbacd('0x4')]},'address':{'type':Sequelize[_0xbacd('0x4')]},'zipcode':{'type':Sequelize[_0xbacd('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xbacd('0x4')]},'country':{'type':Sequelize[_0xbacd('0x4')]},'online':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xbacd('0x14')]},'voicePause':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xbacd('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xbacd('0x14')]},'chatCapacity':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xbacd('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xbacd('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xbacd('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x17'),_0xbacd('0x10'),_0xbacd('0x18')),'allowNull':!![],'defaultValue':_0xbacd('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xbacd('0x19')},'callingpres':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x1a'),'ALLOWED_PASSED_SCREEN',_0xbacd('0x1b'),'ALLOWED',_0xbacd('0x1c'),_0xbacd('0x1d'),_0xbacd('0x1e'),_0xbacd('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![],'defaultValue':_0xbacd('0x20'),'set':function(_0x26c3b9){this[_0xbacd('0x6')]('transport',_0x26c3b9?_0x26c3b9[_0xbacd('0x21')](','):null);},'get':function(){return this['getDataValue'](_0xbacd('0x22'))?this[_0xbacd('0xc')](_0xbacd('0x22'))['split'](','):null;},'comment':_0xbacd('0x23')},'dtmfmode':{'type':Sequelize[_0xbacd('0x16')]('rfc2833',_0xbacd('0x24'),_0xbacd('0x25'),_0xbacd('0x26'),'auto'),'allowNull':!![],'defaultValue':_0xbacd('0x27')},'directmedia':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no',_0xbacd('0x29'),_0xbacd('0x2a'),_0xbacd('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![],'defaultValue':_0xbacd('0x2c'),'set':function(_0x1d383a){this['setDataValue'](_0xbacd('0x2d'),_0x1d383a?_0x1d383a[_0xbacd('0x21')](','):null);},'get':function(){return this[_0xbacd('0xc')](_0xbacd('0x2d'))?this[_0xbacd('0xc')](_0xbacd('0x2d'))['split'](','):null;},'comment':_0xbacd('0x2e')},'callgroup':{'type':Sequelize[_0xbacd('0x4')]},'namedcallgroup':{'type':Sequelize[_0xbacd('0x4')]},'pickupgroup':{'type':Sequelize[_0xbacd('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xbacd('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xbacd('0x4')]},'disallow':{'type':Sequelize[_0xbacd('0x4')],'allowNull':![],'defaultValue':_0xbacd('0x2f')},'allow':{'type':Sequelize[_0xbacd('0x4')],'allowNull':![],'defaultValue':_0xbacd('0x30'),'set':function(_0xb57083){this[_0xbacd('0x6')](_0xbacd('0x31'),_0xb57083?_0xb57083[_0xbacd('0x21')](';'):_0xbacd('0x30'));},'get':function(){return this['getDataValue']('allow')?this[_0xbacd('0xc')]('allow')[_0xbacd('0x32')](';'):null;},'comment':_0xbacd('0x33')},'autoframing':{'type':Sequelize[_0xbacd('0x16')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![],'set':function(_0x79b06){this['setDataValue'](_0xbacd('0x34'),_0x79b06?_0x79b06['join'](','):null);},'get':function(){return this[_0xbacd('0xc')](_0xbacd('0x34'))?this['getDataValue'](_0xbacd('0x34'))[_0xbacd('0x32')](','):null;},'comment':_0xbacd('0x35')},'trustrpid':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no',_0xbacd('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xbacd('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':_0xbacd('0x28')},'busylevel':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xbacd('0x16')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM']('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xbacd('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x37'),_0xbacd('0x38'),_0xbacd('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x3a'),_0xbacd('0x3b')),'allowNull':!![],'defaultValue':_0xbacd('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':_0xbacd('0x28')},'keepalive':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xbacd('0x16')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xbacd('0x16')]('yes','no',_0xbacd('0x3c'),_0xbacd('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x3e'),_0xbacd('0x3f'),_0xbacd('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no','nonat',_0xbacd('0x2a'),_0xbacd('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xbacd('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xbacd('0x14')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xbacd('0x42')]},'showWebBar':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0,'set':function(_0x5a53b0){this['setDataValue']('showWebBar',_0x5a53b0);var _0x99e9d7=this[_0xbacd('0x43')]({'plain':!![]});switch(_0x5a53b0){case 0x0:case 0x1:var _0x3d8c0c=_0x99e9d7['transport']?_[_0xbacd('0x44')](_0x99e9d7[_0xbacd('0x22')])?_0x99e9d7[_0xbacd('0x22')][_0xbacd('0x21')]():_0x99e9d7[_0xbacd('0x22')]:_0xbacd('0x20');if(_0x3d8c0c==='wss'){_0x3d8c0c='udp';}this[_0xbacd('0x6')]('transport',_0x3d8c0c);this['setDataValue'](_0xbacd('0x45'),'no');this[_0xbacd('0x6')]('avpf',null);this[_0xbacd('0x6')](_0xbacd('0x46'),null);this[_0xbacd('0x6')](_0xbacd('0x47'),null);this[_0xbacd('0x6')](_0xbacd('0x48'),null);this['setDataValue'](_0xbacd('0x49'),null);this['setDataValue'](_0xbacd('0x4a'),null);this[_0xbacd('0x6')](_0xbacd('0x4b'),null);this[_0xbacd('0x6')](_0xbacd('0x4c'),null);this[_0xbacd('0x6')](_0xbacd('0x4d'),'no');break;case 0x2:this[_0xbacd('0x6')](_0xbacd('0x22'),_0xbacd('0x4e'));this[_0xbacd('0x6')]('encryption',_0xbacd('0x28'));this[_0xbacd('0x6')](_0xbacd('0x4f'),_0xbacd('0x28'));this[_0xbacd('0x6')](_0xbacd('0x46'),'yes');this[_0xbacd('0x6')](_0xbacd('0x47'),_0xbacd('0x28'));this[_0xbacd('0x6')]('dtlsenable',_0xbacd('0x28'));this[_0xbacd('0x6')](_0xbacd('0x49'),'no');this[_0xbacd('0x6')]('dtlssetup','actpass');this[_0xbacd('0x6')](_0xbacd('0x4b'),_0x99e9d7['dtlscertfile']||_0xbacd('0x50'));this[_0xbacd('0x6')](_0xbacd('0x4c'),_0x99e9d7[_0xbacd('0x4c')]||_0xbacd('0x51'));this[_0xbacd('0x6')](_0xbacd('0x4d'),_0xbacd('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0xbacd('0x42')],'set':function(_0x49a7c1){this[_0xbacd('0x6')](_0xbacd('0x52'),_0x49a7c1?_0x49a7c1['join'](','):[]);},'get':function(){return this[_0xbacd('0xc')](_0xbacd('0x52'))?_['map'](this[_0xbacd('0xc')](_0xbacd('0x52'))['split'](','),function(_0x28418){return parseInt(_0x28418,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xbacd('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xbacd('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xbacd('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xbacd('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xbacd('0x53')],'get':function(){return this['getDataValue'](_0xbacd('0x54'))?this['getDataValue'](_0xbacd('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xbacd('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![],'set':function(_0x204015){if(typeof _0x204015==='string'){var _0x2a1f8c=_0x204015==='1'?!![]:_0x204015==='0'?![]:_0x204015==='true'?!![]:_0x204015===_0xbacd('0x55')?![]:![];this[_0xbacd('0x6')](_0xbacd('0x56'),_0x2a1f8c);}else{this[_0xbacd('0x6')](_0xbacd('0x56'),_0x204015);}}},'blocked':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![],'set':function(_0x5da9ac){this[_0xbacd('0x6')](_0xbacd('0x57'),_0x5da9ac);if(_0x5da9ac===!![]){this['setDataValue'](_0xbacd('0x58'),moment());this['setDataValue'](_0xbacd('0x59'),0x0);}else{this[_0xbacd('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xbacd('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xbacd('0x15')](0x5)[_0xbacd('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]}}; \ No newline at end of file +var _0x81b9=['ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','refuse','originate','uac','uas','certificate','active','passive','actpass','update','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','dtlsverify','dtlssetup','dtlsprivatekey','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','util','lodash','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','telephone','local','INTEGER','accountcode','callerid','format','DATE','BOOLEAN','dynamic','peer','friend','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','split','info','inband','rfc2833','yes','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all'];(function(_0x22afd5,_0x488d9f){var _0x336ebc=function(_0x32ac62){while(--_0x32ac62){_0x22afd5['push'](_0x22afd5['shift']());}};_0x336ebc(++_0x488d9f);}(_0x81b9,0xdc));var _0x981b=function(_0x11eda7,_0x32a90e){_0x11eda7=_0x11eda7-0x0;var _0x2c00ad=_0x81b9[_0x11eda7];return _0x2c00ad;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x981b('0x0'));var _=require(_0x981b('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x981b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1ea51b){this[_0x981b('0x3')](_0x981b('0x2'),_0x1ea51b);this[_0x981b('0x3')](_0x981b('0x4'),_0x1ea51b);},'comment':_0x981b('0x5')},'fullname':{'type':Sequelize[_0x981b('0x6')],'allowNull':![],'set':function(_0x3691c1){this[_0x981b('0x3')](_0x981b('0x7'),_0x3691c1);this[_0x981b('0x3')]('callerid',util['format'](_0x981b('0x8'),_0x3691c1,this[_0x981b('0x9')](_0x981b('0xa'))));}},'alias':{'type':Sequelize[_0x981b('0x6')]},'email':{'type':Sequelize[_0x981b('0x6')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x1da4ab){if(_0x1da4ab){this[_0x981b('0x3')](_0x981b('0xb'),_0x1da4ab[_0x981b('0xc')]());}}},'role':{'type':Sequelize[_0x981b('0xd')](_0x981b('0xe'),_0x981b('0xf'),'agent',_0x981b('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x981b('0x11')},'internal':{'type':Sequelize[_0x981b('0x12')](0xb),'allowNull':![],'unique':_0x981b('0xa'),'set':function(_0x1402db){this[_0x981b('0x3')]('internal',_0x1402db);this[_0x981b('0x3')](_0x981b('0x13'),_0x1402db);this[_0x981b('0x3')](_0x981b('0x14'),util[_0x981b('0x15')](_0x981b('0x8'),this[_0x981b('0x9')](_0x981b('0x7')),_0x1402db));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x981b('0x6')]},'mobile':{'type':Sequelize[_0x981b('0x6')]},'address':{'type':Sequelize[_0x981b('0x6')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x981b('0x6')]},'city':{'type':Sequelize[_0x981b('0x6')]},'country':{'type':Sequelize[_0x981b('0x6')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x981b('0x16')]},'voicePause':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x981b('0x16')]},'chatCapacity':{'type':Sequelize[_0x981b('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x981b('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x981b('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x981b('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x981b('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x981b('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x981b('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x981b('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x981b('0x18')},'ipaddr':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'port':{'type':Sequelize[_0x981b('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x981b('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x981b('0xd')]('friend',_0x981b('0xf'),_0x981b('0x19')),'allowNull':!![],'defaultValue':_0x981b('0x1a')},'context':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![],'defaultValue':_0x981b('0x1b')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x981b('0x1c'),_0x981b('0x1d'),'ALLOWED',_0x981b('0x1e'),_0x981b('0x1f'),_0x981b('0x20'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'permit':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'secret':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![],'defaultValue':_0x981b('0x21'),'set':function(_0x414ed4){this[_0x981b('0x3')](_0x981b('0x22'),_0x414ed4?_0x414ed4[_0x981b('0x23')](','):null);},'get':function(){return this[_0x981b('0x9')](_0x981b('0x22'))?this[_0x981b('0x9')]('transport')[_0x981b('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x981b('0x25'),'shortinfo',_0x981b('0x26'),'auto'),'allowNull':!![],'defaultValue':_0x981b('0x27')},'directmedia':{'type':Sequelize['ENUM'](_0x981b('0x28'),'no',_0x981b('0x29'),'update',_0x981b('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'nat':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![],'defaultValue':_0x981b('0x2b'),'set':function(_0x4f6c2f){this[_0x981b('0x3')](_0x981b('0x2c'),_0x4f6c2f?_0x4f6c2f['join'](','):null);},'get':function(){return this[_0x981b('0x9')](_0x981b('0x2c'))?this['getDataValue'](_0x981b('0x2c'))[_0x981b('0x24')](','):null;},'comment':_0x981b('0x2d')},'callgroup':{'type':Sequelize[_0x981b('0x6')]},'namedcallgroup':{'type':Sequelize[_0x981b('0x6')]},'pickupgroup':{'type':Sequelize[_0x981b('0x6')]},'namedpickupgroup':{'type':Sequelize[_0x981b('0x6')]},'language':{'type':Sequelize[_0x981b('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x981b('0x6')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x981b('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x981b('0x2f'),'set':function(_0xa92b3c){this[_0x981b('0x3')](_0x981b('0x30'),_0xa92b3c?_0xa92b3c[_0x981b('0x23')](';'):_0x981b('0x2f'));},'get':function(){return this[_0x981b('0x9')]('allow')?this['getDataValue'](_0x981b('0x30'))[_0x981b('0x24')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x981b('0xd')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![],'set':function(_0x4e971a){this['setDataValue'](_0x981b('0x31'),_0x4e971a?_0x4e971a[_0x981b('0x23')](','):null);},'get':function(){return this['getDataValue'](_0x981b('0x31'))?this[_0x981b('0x9')](_0x981b('0x31'))[_0x981b('0x24')](','):null;},'comment':_0x981b('0x32')},'trustrpid':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x981b('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x981b('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![],'defaultValue':_0x981b('0x33')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x981b('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0x981b('0x28')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'template':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no',_0x981b('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x981b('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x981b('0xd')]('accept',_0x981b('0x35'),_0x981b('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x981b('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x37'),_0x981b('0x38')),'allowNull':!![],'defaultValue':_0x981b('0x38')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no'),'allowNull':!![],'defaultValue':_0x981b('0x28')},'keepalive':{'type':Sequelize[_0x981b('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x981b('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x981b('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x981b('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x981b('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x981b('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x981b('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x981b('0xd')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x981b('0xd')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x981b('0xd')]('yes','no','fingerprint',_0x981b('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x981b('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x3a'),_0x981b('0x3b'),_0x981b('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x981b('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x981b('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x981b('0xd')](_0x981b('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x981b('0xd')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x981b('0x28'),'no',_0x981b('0x29'),_0x981b('0x3d'),_0x981b('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x981b('0x6')]},'resetPasswordExpires':{'type':Sequelize[_0x981b('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x981b('0x3f')]},'showWebBar':{'type':Sequelize[_0x981b('0x12')],'defaultValue':0x0,'set':function(_0x44e5b2){this[_0x981b('0x3')](_0x981b('0x40'),_0x44e5b2);var _0x5ea88b=this[_0x981b('0x41')]({'plain':!![]});switch(_0x44e5b2){case 0x0:case 0x1:var _0x4ed6be=_0x5ea88b['transport']?_[_0x981b('0x42')](_0x5ea88b[_0x981b('0x22')])?_0x5ea88b['transport'][_0x981b('0x23')]():_0x5ea88b['transport']:_0x981b('0x21');if(_0x4ed6be===_0x981b('0x43')){_0x4ed6be=_0x981b('0x21');}this[_0x981b('0x3')](_0x981b('0x22'),_0x4ed6be);this[_0x981b('0x3')](_0x981b('0x44'),'no');this[_0x981b('0x3')]('avpf',null);this[_0x981b('0x3')]('force_avp',null);this[_0x981b('0x3')]('icesupport',null);this[_0x981b('0x3')]('dtlsenable',null);this[_0x981b('0x3')](_0x981b('0x45'),null);this[_0x981b('0x3')](_0x981b('0x46'),null);this[_0x981b('0x3')]('dtlscertfile',null);this['setDataValue'](_0x981b('0x47'),null);this[_0x981b('0x3')]('rtcp_mux','no');break;case 0x2:this[_0x981b('0x3')](_0x981b('0x22'),'wss');this[_0x981b('0x3')]('encryption',_0x981b('0x28'));this[_0x981b('0x3')]('avpf',_0x981b('0x28'));this[_0x981b('0x3')](_0x981b('0x48'),'yes');this[_0x981b('0x3')]('icesupport',_0x981b('0x28'));this['setDataValue']('dtlsenable',_0x981b('0x28'));this[_0x981b('0x3')](_0x981b('0x45'),'no');this['setDataValue'](_0x981b('0x46'),'actpass');this['setDataValue'](_0x981b('0x49'),_0x5ea88b[_0x981b('0x49')]||_0x981b('0x4a'));this['setDataValue']('dtlsprivatekey',_0x5ea88b['dtlsprivatekey']||_0x981b('0x4b'));this[_0x981b('0x3')](_0x981b('0x4c'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x981b('0x3f')],'set':function(_0x1915b4){this['setDataValue']('permissions',_0x1915b4?_0x1915b4[_0x981b('0x23')](','):[]);},'get':function(){return this[_0x981b('0x9')](_0x981b('0x4d'))?_[_0x981b('0x4e')](this['getDataValue'](_0x981b('0x4d'))[_0x981b('0x24')](','),function(_0x5c5410){return parseInt(_0x5c5410,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x981b('0x6')]},'phoneBarBusyNumber':{'type':Sequelize[_0x981b('0x6')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x981b('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x981b('0x6')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x981b('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x981b('0x4f')],'get':function(){return this[_0x981b('0x9')](_0x981b('0x50'))?this[_0x981b('0x9')](_0x981b('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x981b('0x6')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![],'set':function(_0x45bc02){if(typeof _0x45bc02===_0x981b('0x51')){var _0x4afb43=_0x45bc02==='1'?!![]:_0x45bc02==='0'?![]:_0x45bc02===_0x981b('0x52')?!![]:_0x45bc02===_0x981b('0x53')?![]:![];this['setDataValue'](_0x981b('0x54'),_0x4afb43);}else{this[_0x981b('0x3')](_0x981b('0x54'),_0x45bc02);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x32a94e){this[_0x981b('0x3')](_0x981b('0x55'),_0x32a94e);if(_0x32a94e===!![]){this[_0x981b('0x3')](_0x981b('0x56'),moment());this[_0x981b('0x3')](_0x981b('0x57'),0x0);}else{this[_0x981b('0x3')](_0x981b('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x981b('0x12')](0x5)[_0x981b('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x981b('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x981b('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x981b('0x12')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x981b('0x12')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x981b('0x12')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x981b('0x12')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x981b('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x981b('0x12')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x981b('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 ffe5eb4..c68ba24 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 _0xf189=['New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','addQueues','channel','online','loginInPause','isValidChannel','Unknown\x20channel','add','Queues','penalty','spread','QueueId','capitalize','toLowerCase','Queue:save','voice','VoiceQueue','interface','format','SIP/%s','UserVoiceQueueRt','removeQueues','remove','isArray','Queue:remove','addAvatar','userpic','file','root','server/files/images/logos/default_profile.png','download','existsSync','join','server/files/images/','getOpenTabs','sms','ChatOpenTabs','createdAt','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','hasOwnProperty','CmList','Tag','Tags','color','tag','getQueues','model','keys','Queue','filters','intersection','fields','order','sort','pick','Unknown\x20role','getVoiceQueuesRt','nolimit','ChatGroup','getGroups','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','UserId','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','resolve','logout','pause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','unpause','voicePause','mailPause','chatPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','sequelize','transaction','Team','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','upsert','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','getLists','values','You\x20can\x27t\x20delete\x20yourself','CmHopper','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','$and','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contained','$any','firstName','lastName','CmContact','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','API\x20key\x20not\x20available','whoami','send','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','idle','ringing','teams','inbound','getAgents','flatten','col','asc','desc','substring','uniqBy','orderBy','getRealtimeAgents','offline','unavailable','voiceStatus','charAt','toUpperCase','slice','QueryTypes','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','toString','messengerSoundNotification','enabled','moment','util','path','lodash','squel','ioredis','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../components/realtime/agents','../../config/logger','api','../../config/utils','../../errors/api','APIBadRequestError','APINotFoundError','APIForbiddenrror','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','http','sendStatus','end','status','offset','undefined','count','limit','set','json','request','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','update','role','agent','emit','userNotification:recalc:','destroy','get','admin','Users','user','Agents','Telephones','filter','ignore','map','value','includes','find','UserProfileResource','then','stack','name','User','rawAttributes','fieldName','type','key','password','salt','previousPasswords','resetPasswordExpires','md5secret','index','getOptions','where','query','include','userSetting','true','UserSetting','attributes','push','findAll','rows','openTabs','length','chat','dataValues','fax','mail','openchannel','whatsapp','params','includeAll','merge','options','catch','body','describe','addContacts','ids','omit','internal','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','SELECT','from','voicemail','mailbox','fullname','email','permissions','102','103','113','104','105','106','107','108','109','114','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','create','VoiceMail','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','all','isEmpty','compact','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','ValidationError'];(function(_0x21e7fc,_0x8fe9d7){var _0x55067a=function(_0x5a324f){while(--_0x5a324f){_0x21e7fc['push'](_0x21e7fc['shift']());}};_0x55067a(++_0x8fe9d7);}(_0xf189,0x101));var _0x9f18=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf189[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x9f18('0x0'));var util=require(_0x9f18('0x1'));var path=require(_0x9f18('0x2'));var fs=require('fs');var _=require(_0x9f18('0x3'));var squel=require(_0x9f18('0x4'));var Redis=require(_0x9f18('0x5'));var jayson=require(_0x9f18('0x6'));var authService=require(_0x9f18('0x7'));var contacts=require('../../components/contacts');var qs=require(_0x9f18('0x8'));var rta=require(_0x9f18('0x9'));var logger=require(_0x9f18('0xa'))(_0x9f18('0xb'));var utils=require(_0x9f18('0xc'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var APIBadRequestError=require(_0x9f18('0xd'))[_0x9f18('0xe')];var APINotFoundError=require(_0x9f18('0xd'))[_0x9f18('0xf')];var APIForbiddenError=require(_0x9f18('0xd'))[_0x9f18('0x10')];var APIHandleError=require(_0x9f18('0xd'))[_0x9f18('0x11')];var db=require(_0x9f18('0x12'))['db'];var socket=require(_0x9f18('0x13'))(new Redis(config[_0x9f18('0x14')]));require(_0x9f18('0x15'))[_0x9f18('0x16')](socket);config[_0x9f18('0x14')]=_[_0x9f18('0x17')](config[_0x9f18('0x14')],{'host':_0x9f18('0x18'),'port':0x18eb});var amiClient=jayson['client'][_0x9f18('0x19')]({'port':0x232a});var values;function respondWithStatusCode(_0x4badd1,_0x25859a){_0x25859a=_0x25859a||0xcc;return function(_0x1efb5f){if(_0x1efb5f){return _0x4badd1[_0x9f18('0x1a')](_0x25859a);}return _0x4badd1['status'](_0x25859a)[_0x9f18('0x1b')]();};}function respondWithResult(_0x2dc2bd,_0x620998){_0x620998=_0x620998||0xc8;return function(_0x3b8f99){if(_0x3b8f99){return _0x2dc2bd[_0x9f18('0x1c')](_0x620998)['json'](_0x3b8f99);}};}function respondWithFilteredResult(_0x3c178d,_0x2161b4){return function(_0x247d15){if(_0x247d15){var _0x441574=typeof _0x2161b4[_0x9f18('0x1d')]==='undefined'&&typeof _0x2161b4['limit']===_0x9f18('0x1e');var _0x23a851=_0x247d15[_0x9f18('0x1f')];var _0x185937=_0x441574?0x0:_0x2161b4[_0x9f18('0x1d')];var _0x22fb1f=_0x441574?_0x247d15[_0x9f18('0x1f')]:_0x2161b4['offset']+_0x2161b4[_0x9f18('0x20')];var _0xdba2e0;if(_0x22fb1f>=_0x23a851){_0x22fb1f=_0x23a851;_0xdba2e0=0xc8;}else{_0xdba2e0=0xce;}_0x3c178d[_0x9f18('0x1c')](_0xdba2e0);return _0x3c178d[_0x9f18('0x21')]('Content-Range',_0x185937+'-'+_0x22fb1f+'/'+_0x23a851)[_0x9f18('0x22')](_0x247d15);}return null;};}function respondWithRpcPromise(_0x193427,_0x1a2acf,_0x56b761,_0x1ea2a5){return new Promise(function(_0x3fd283,_0x2f5377){var _0x287058=_0x1ea2a5||amiClient;return _0x287058[_0x9f18('0x23')](_0x193427,_0x56b761)['then'](function(_0x30a5d5){logger[_0x9f18('0x24')](_0x9f18('0x25'),_0x1a2acf,_0x9f18('0x26'));logger['debug'](_0x9f18('0x27'),_0x1a2acf,_0x9f18('0x26'),JSON[_0x9f18('0x28')](_0x30a5d5));if(_0x30a5d5[_0x9f18('0x29')]){if(_0x30a5d5[_0x9f18('0x29')][_0x9f18('0x2a')]===0x1f4){logger[_0x9f18('0x29')](_0x9f18('0x25'),_0x1a2acf,_0x30a5d5['error'][_0x9f18('0x2b')]);return _0x2f5377(_0x30a5d5['error']['message']);}logger['error']('User,\x20%s,\x20%s',_0x1a2acf,_0x30a5d5[_0x9f18('0x29')]['message']);return _0x3fd283(_0x30a5d5[_0x9f18('0x29')]['message']);}else{logger[_0x9f18('0x24')](_0x9f18('0x25'),_0x1a2acf,_0x9f18('0x26'));_0x3fd283(_0x30a5d5[_0x9f18('0x2c')][_0x9f18('0x2b')]);}})['catch'](function(_0x41e508){logger[_0x9f18('0x29')]('User,\x20%s,\x20%s',_0x1a2acf,_0x41e508);_0x2f5377(_0x41e508);});});}function saveUpdates(_0x127604){return function(_0x166bec){if(_0x166bec){return _0x166bec[_0x9f18('0x2d')](_0x127604)['then'](function(_0x35c79a){if(_0x35c79a[_0x9f18('0x2e')]===_0x9f18('0x2f')){socket[_0x9f18('0x30')](_0x9f18('0x31')+_0x35c79a['id'],_0x35c79a);}return _0x35c79a;});}return null;};}function removeEntity(_0x2b4d10,_0x3c229e){return function(_0x2b8500){if(_0x2b8500){return _0x2b8500[_0x9f18('0x32')]({'transaction':_0x3c229e})['then'](function(){var _0x2535d5=_0x2b8500[_0x9f18('0x33')]({'plain':!![]});if(_0x2535d5['role']===_0x9f18('0x34'))return;var _0x2d350a=[{'name':_0x9f18('0x35'),'value':_0x9f18('0x36'),'ignore':!![]},{'name':_0x9f18('0x37'),'value':_0x9f18('0x2f'),'ignore':![]},{'name':_0x9f18('0x38'),'value':'telephone','ignore':![]}];var _0x28f58f=_(_0x2d350a)[_0x9f18('0x39')](_0x9f18('0x3a'))[_0x9f18('0x3b')](_0x9f18('0x3c'))[_0x9f18('0x3c')]();if(_[_0x9f18('0x3d')](_0x28f58f,_0x2535d5[_0x9f18('0x2e')])){return;}var _0x333f7c=_[_0x9f18('0x3e')](_0x2d350a,['value',_0x2535d5[_0x9f18('0x2e')]])['name'];return db[_0x9f18('0x3f')]['destroy']({'where':{'type':_0x333f7c,'resourceId':_0x2535d5['id']},'transaction':_0x3c229e})['then'](function(){return _0x2b8500;});})[_0x9f18('0x40')](function(){_0x2b4d10[_0x9f18('0x1c')](0xcc)[_0x9f18('0x1b')]();});}};}function handleEntityNotFound(_0x1c5790){return function(_0x4d2596){if(!_0x4d2596){_0x1c5790['sendStatus'](0x194);}return _0x4d2596;};}function handleError(_0x340c6b,_0x3bb90e){_0x3bb90e=_0x3bb90e||0x1f4;return function(_0x530d9c){logger['error'](_0x530d9c[_0x9f18('0x41')]);if(_0x530d9c[_0x9f18('0x42')]){delete _0x530d9c[_0x9f18('0x42')];}_0x340c6b['status'](_0x3bb90e)['send'](_0x530d9c);};}function getUserAttributes(){return _(db[_0x9f18('0x43')][_0x9f18('0x44')])['map'](function(_0x2ba124){return{'name':_0x2ba124[_0x9f18('0x45')],'type':_0x2ba124[_0x9f18('0x46')][_0x9f18('0x47')]};})[_0x9f18('0x39')](function(_0x1dc33e){return![_0x9f18('0x48'),_0x9f18('0x49'),_0x9f18('0x4a'),'resetPasswordToken',_0x9f18('0x4b'),_0x9f18('0x4c')]['includes'](_0x1dc33e[_0x9f18('0x42')]);})[_0x9f18('0x3c')]();}exports[_0x9f18('0x4d')]=function(_0x16b441,_0x49ffbe){var _0xa95968={},_0x21825f={'count':0x0,'rows':[]};var _0x103c3e=getUserAttributes();_0xa95968=qs[_0x9f18('0x4e')](_0x103c3e,_0x16b441);var _0x4ca263={'where':_0xa95968[_0x9f18('0x4f')]};return db['User'][_0x9f18('0x1f')](_0x4ca263)[_0x9f18('0x40')](function(_0x275112){_0x21825f[_0x9f18('0x1f')]=_0x275112;if(_0x16b441[_0x9f18('0x50')]['includeAll']){_0xa95968[_0x9f18('0x51')]=[{'all':!![]}];}if(_0x16b441[_0x9f18('0x50')][_0x9f18('0x52')]===_0x9f18('0x53')){_0xa95968[_0x9f18('0x51')]=[{'model':db[_0x9f18('0x54')],'as':_0x9f18('0x52')}];}if(!_[_0x9f18('0x3d')](_0xa95968['attributes'],'id')){_0xa95968[_0x9f18('0x55')][_0x9f18('0x56')]('id');}return db['User'][_0x9f18('0x57')](_0xa95968);})[_0x9f18('0x40')](function(_0x158736){_0x21825f[_0x9f18('0x58')]=_0x158736;if(_0x16b441[_0x9f18('0x50')][_0x9f18('0x59')]===_0x9f18('0x53')){var _0x4f80d5=[];for(var _0x17cdf0=0x0;_0x17cdf0<_0x21825f[_0x9f18('0x58')][_0x9f18('0x5a')];_0x17cdf0++){_0x4f80d5['push'](get_open_tabs(_0x9f18('0x5b'),_0x21825f[_0x9f18('0x58')][_0x17cdf0][_0x9f18('0x5c')]));_0x4f80d5[_0x9f18('0x56')](get_open_tabs('sms',_0x21825f[_0x9f18('0x58')][_0x17cdf0][_0x9f18('0x5c')]));_0x4f80d5[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x5d'),_0x21825f[_0x9f18('0x58')][_0x17cdf0]['dataValues']));_0x4f80d5['push'](get_open_tabs(_0x9f18('0x5e'),_0x21825f[_0x9f18('0x58')][_0x17cdf0][_0x9f18('0x5c')]));_0x4f80d5[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x5f'),_0x21825f['rows'][_0x17cdf0][_0x9f18('0x5c')]));_0x4f80d5['push'](get_open_tabs(_0x9f18('0x60'),_0x21825f['rows'][_0x17cdf0]['dataValues']));}return Promise['all'](_0x4f80d5)[_0x9f18('0x40')](function(){return _0x21825f;});}else{return _0x21825f;}})['then'](respondWithFilteredResult(_0x49ffbe,_0xa95968))['catch'](handleError(_0x49ffbe,null));};exports['show']=function(_0xcf5dc5,_0x50c33f){var _0x2c0424=getUserAttributes();_0xcf5dc5['query']['id']=_0xcf5dc5[_0x9f18('0x61')]['id'];var _0x4691e9=qs[_0x9f18('0x4e')](_0x2c0424,_0xcf5dc5);if(_0xcf5dc5[_0x9f18('0x50')][_0x9f18('0x62')]){_0x4691e9[_0x9f18('0x51')]=[{'all':!![]}];}if(_0xcf5dc5[_0x9f18('0x50')][_0x9f18('0x52')]===_0x9f18('0x53')){_0x4691e9['include']=[{'model':db[_0x9f18('0x54')],'as':'userSetting'}];}_0x4691e9=_[_0x9f18('0x63')]({},_0x4691e9,_0xcf5dc5[_0x9f18('0x64')]);if(!_[_0x9f18('0x3d')](_0x4691e9['attributes'],'id')){_0x4691e9[_0x9f18('0x55')][_0x9f18('0x56')]('id');}return db['User'][_0x9f18('0x3e')](_0x4691e9)[_0x9f18('0x40')](handleEntityNotFound(_0x50c33f,null))[_0x9f18('0x40')](function(_0x35d1ed){var _0x4e3102=[];values=_0x35d1ed;if(_0xcf5dc5['query'][_0x9f18('0x59')]===_0x9f18('0x53')){_0x4e3102['push'](get_open_tabs(_0x9f18('0x5b'),_0x35d1ed[_0x9f18('0x5c')]));_0x4e3102[_0x9f18('0x56')](get_open_tabs('sms',_0x35d1ed[_0x9f18('0x5c')]));_0x4e3102[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x5f'),_0x35d1ed[_0x9f18('0x5c')]));_0x4e3102[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x60'),_0x35d1ed[_0x9f18('0x5c')]));_0x4e3102[_0x9f18('0x56')](get_open_tabs('fax',_0x35d1ed[_0x9f18('0x5c')]));_0x4e3102[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x5e'),_0x35d1ed[_0x9f18('0x5c')]));return Promise['all'](_0x4e3102);}else{return values;}})[_0x9f18('0x40')](function(){return values;})[_0x9f18('0x40')](respondWithResult(_0x50c33f,null))[_0x9f18('0x65')](handleError(_0x50c33f,null));};exports[_0x9f18('0x2d')]=function(_0x309df6,_0x1f6b25){if(_0x309df6[_0x9f18('0x66')]['id']){delete _0x309df6['body']['id'];}delete _0x309df6['body'][_0x9f18('0x2e')];return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x309df6['params']['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x1f6b25,null))[_0x9f18('0x40')](saveUpdates(_0x309df6['body'],null))['then'](respondWithResult(_0x1f6b25,null))['catch'](handleError(_0x1f6b25,null));};exports[_0x9f18('0x67')]=function(_0x4d094b,_0x5186ea){return db[_0x9f18('0x43')][_0x9f18('0x67')]()[_0x9f18('0x40')](respondWithResult(_0x5186ea,null))['catch'](handleError(_0x5186ea,null));};exports[_0x9f18('0x68')]=function(_0x32ccf0,_0x4a4173){return db[_0x9f18('0x43')]['find']({'where':{'id':_0x32ccf0['params']['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x4a4173,null))[_0x9f18('0x40')](function(_0x4eb48d){if(_0x4eb48d){return _0x4eb48d[_0x9f18('0x68')](_0x32ccf0['body'][_0x9f18('0x69')],_[_0x9f18('0x6a')](_0x32ccf0['body'],[_0x9f18('0x69'),'id'])||{});}})[_0x9f18('0x40')](respondWithResult(_0x4a4173,null))['catch'](handleError(_0x4a4173,null));};function validateUser(_0x300830){return new Promise(function(_0x166063,_0x251a4b){if(_0x300830[_0x9f18('0x6b')])return _0x166063(_0x300830);return db['Setting'][_0x9f18('0x6c')](0x1)['then'](function(_0x2691c0){if(_0x2691c0[_0x9f18('0x6d')])authService[_0x9f18('0x6e')](_0x300830[_0x9f18('0x48')]);db[_0x9f18('0x43')][_0x9f18('0x6f')](_0x9f18('0x6b'))[_0x9f18('0x40')](function(_0x5e6532){if(_['isNil'](_0x5e6532)){_0x300830[_0x9f18('0x6b')]=_0x2691c0['min_internal']||0x1;return;}if(_[_0x9f18('0x70')](_0x2691c0[_0x9f18('0x71')])||_0x2691c0['min_internal']===_0x5e6532){_0x300830[_0x9f18('0x6b')]=_0x5e6532+0x1;return;}if(_0x2691c0[_0x9f18('0x71')]>_0x5e6532){_0x300830[_0x9f18('0x6b')]=_0x2691c0['min_internal'];return;}return db['sequelize']['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize']['QueryTypes'][_0x9f18('0x72')]})[_0x9f18('0x40')](function(_0x58984c){if(_0x58984c&&_0x58984c[_0x9f18('0x5a')]){for(var _0x286abd=0x0,_0x2e0678=_0x58984c[_0x9f18('0x5a')];_0x286abd<_0x2e0678&&_[_0x9f18('0x70')](_0x300830['internal']);_0x286abd++){if(_0x2691c0[_0x9f18('0x71')]<=_0x58984c[_0x286abd][_0x9f18('0x73')]){_0x300830['internal']=_0x58984c[_0x286abd][_0x9f18('0x73')];}else if(_0x2691c0[_0x9f18('0x71')]>_0x58984c[_0x286abd]['from']&&_0x2691c0[_0x9f18('0x71')]<=_0x58984c[_0x286abd]['to']){_0x300830[_0x9f18('0x6b')]=_0x2691c0[_0x9f18('0x71')];}}}if(_[_0x9f18('0x70')](_0x300830[_0x9f18('0x6b')])){_0x300830[_0x9f18('0x6b')]=_0x5e6532+0x1;}return _0x166063(_0x300830);});});})[_0x9f18('0x65')](function(_0x12b8c){_0x251a4b(_0x12b8c);});});}function updateUser(_0xdce6ef){return new Promise(function(_0x27046e,_0x531196){try{if(_0xdce6ef[_0x9f18('0x74')]){_0xdce6ef[_0x9f18('0x75')]=_0xdce6ef[_0x9f18('0x6b')];_0xdce6ef['VoiceMail']={'mailbox':_0xdce6ef[_0x9f18('0x6b')],'password':_0xdce6ef[_0x9f18('0x48')],'fullname':_0xdce6ef[_0x9f18('0x76')],'email':_0xdce6ef[_0x9f18('0x77')]};}if(_0xdce6ef['role']===_0x9f18('0x2f')){if(!_0xdce6ef['permissions'])_0xdce6ef[_0x9f18('0x78')]=['101',_0x9f18('0x79'),_0x9f18('0x7a'),_0x9f18('0x7b'),'110',_0x9f18('0x7c'),_0x9f18('0x7d'),_0x9f18('0x7e'),_0x9f18('0x7f'),_0x9f18('0x80'),_0x9f18('0x81'),'100','111',_0x9f18('0x82'),_0x9f18('0x83')];}_0x27046e(_0xdce6ef);}catch(_0x2e6e3e){_0x531196(_0x2e6e3e);}});}exports['create']=function(_0x372312,_0x465053){if(_0x372312[_0x9f18('0x36')][_0x9f18('0x2e')]==='agent')throw new Error(_0x9f18('0x84'));if(_0x372312[_0x9f18('0x66')][_0x9f18('0x2e')]===_0x9f18('0x36')&&_0x372312[_0x9f18('0x36')][_0x9f18('0x2e')]!==_0x9f18('0x34')){throw new Error(_0x9f18('0x85'));}if(_0x372312[_0x9f18('0x66')][_0x9f18('0x2e')]===_0x9f18('0x34')&&_0x372312[_0x9f18('0x36')][_0x9f18('0x2e')]!==_0x9f18('0x34')){throw new Error(_0x9f18('0x86'));}return licenseUtil[_0x9f18('0x87')]([_0x372312[_0x9f18('0x66')]])['then'](function(){return validateUser(_0x372312['body']);})['then'](function(_0x389cf1){return updateUser(_0x389cf1)[_0x9f18('0x40')](function(_0x1f1344){if(_0x1f1344[_0x9f18('0x2e')]==='admin'){_0x1f1344[_0x9f18('0x88')]=_0x372312[_0x9f18('0x36')][_0x9f18('0x88')];delete _0x1f1344['userProfileId'];}return _0x1f1344;});})['then'](function(_0x190b06){return db['User'][_0x9f18('0x89')](_0x190b06,{'include':[{'model':db['VoiceMail'],'as':_0x9f18('0x8a')}]});})[_0x9f18('0x40')](function(_0x448c7f){if(_0x372312[_0x9f18('0x66')][_0x9f18('0x2e')]===_0x9f18('0x36'))return _0x448c7f;if(_0x372312['user']['role']!==_0x9f18('0x36'))return _0x448c7f;return db[_0x9f18('0x8b')][_0x9f18('0x3e')]({'where':{'name':_0x448c7f[_0x9f18('0x2e')]===_0x9f18('0x2f')?_0x9f18('0x37'):_0x9f18('0x38'),'userProfileId':_0x372312[_0x9f18('0x36')][_0x9f18('0x8c')]},'raw':!![]})[_0x9f18('0x40')](function(_0x170ead){if(!_0x170ead||_0x170ead[_0x9f18('0x8d')]!=0x0)return _0x448c7f;return db[_0x9f18('0x3f')][_0x9f18('0x89')]({'name':_0x448c7f['name'],'resourceId':_0x448c7f['id'],'type':_0x170ead[_0x9f18('0x42')],'sectionId':_0x170ead['id']},{})[_0x9f18('0x40')](function(){return _0x448c7f;});})[_0x9f18('0x65')](function(_0x4aaaa6){logger['error'](_0x9f18('0x8e'),_0x4aaaa6);throw _0x4aaaa6;});})[_0x9f18('0x40')](respondWithResult(_0x465053,0xc9))[_0x9f18('0x65')](handleError(_0x465053,null));};exports[_0x9f18('0x8f')]=function(_0x2f4425,_0xdc8c7c){var _0x2fe72a=_0x2f4425[_0x9f18('0x66')];var _0x59cc30=[];if(_0x2f4425[_0x9f18('0x36')]['role']==='agent')throw new Error(_0x9f18('0x84'));if(_['some'](_0x2fe72a,[_0x9f18('0x2e'),'user'])&&_0x2f4425['user'][_0x9f18('0x2e')]!==_0x9f18('0x34')){throw new Error(_0x9f18('0x85'));}if(_[_0x9f18('0x90')](_0x2fe72a,['role',_0x9f18('0x34')])&&_0x2f4425[_0x9f18('0x36')][_0x9f18('0x2e')]!==_0x9f18('0x34')){throw new Error(_0x9f18('0x91'));}return licenseUtil[_0x9f18('0x87')](_0x2fe72a)[_0x9f18('0x40')](function(){return validateUser(_0x2fe72a[0x0]);})[_0x9f18('0x40')](function(){for(var _0x149062=0x1;_0x149062<_0x2fe72a[_0x9f18('0x5a')];_0x149062++){var _0x1bc075=_0x2fe72a[_0x149062-0x1]['internal'];if(!_0x2fe72a[_0x149062][_0x9f18('0x6b')])_0x2fe72a[_0x149062][_0x9f18('0x6b')]=_0x1bc075+0x1;_0x59cc30[_0x9f18('0x56')](validateUser(_0x2fe72a[_0x149062]));}return Promise[_0x9f18('0x92')](_0x59cc30);})[_0x9f18('0x40')](function(){_0x59cc30=[];for(var _0x2b78a6=0x0;_0x2b78a6<_0x2fe72a[_0x9f18('0x5a')];_0x2b78a6++){_0x59cc30[_0x9f18('0x56')](updateUser(_0x2fe72a[_0x2b78a6]));}return Promise['all'](_0x59cc30);})['then'](function(){_0x59cc30=_0x2fe72a[_0x9f18('0x3b')](function(_0x346ece){return db['User'][_0x9f18('0x89')](_0x346ece,{'include':[{'model':db[_0x9f18('0x8a')],'as':'VoiceMail'}]})[_0x9f18('0x40')](function(_0x5f2040){_0x346ece['id']=_0x5f2040['id'];return _0x346ece;});});return Promise[_0x9f18('0x92')](_0x59cc30);})['then'](function(_0x5448fa){if(_0x2f4425[_0x9f18('0x66')][_0x9f18('0x2e')]==='user')return _0x5448fa;if(_0x2f4425[_0x9f18('0x36')][_0x9f18('0x2e')]!=='user')return _0x5448fa;var _0xf4888b=_['some'](_0x5448fa,function(_0x2449b3){return _0x2449b3[_0x9f18('0x2e')]===_0x9f18('0x2f')||_0x2449b3[_0x9f18('0x2e')]==='telephone';});if(!_0xf4888b)return _0x5448fa;return db[_0x9f18('0x8b')][_0x9f18('0x57')]({'where':{'name':{'$or':[_0x9f18('0x37'),_0x9f18('0x38')]},'userProfileId':_0x2f4425[_0x9f18('0x36')][_0x9f18('0x8c')]},'raw':!![]})['then'](function(_0x1832f8){if(_[_0x9f18('0x93')](_0x1832f8)||!_['some'](_0x1832f8,[_0x9f18('0x8d'),0x0]))return _0x5448fa;_0x59cc30=[];var _0x4a9081=_(_0x1832f8)[_0x9f18('0x3b')](function(_0x47a001){if(_0x47a001['autoAssociation']===0x1)return;return _0x47a001[_0x9f18('0x42')]===_0x9f18('0x37')?'agent':'telephone';})[_0x9f18('0x94')]()[_0x9f18('0x3c')]();for(var _0x43eb81=0x0;_0x43eb81<_0x5448fa[_0x9f18('0x5a')];_0x43eb81++){if(!_[_0x9f18('0x3d')](_0x4a9081,_0x5448fa[_0x43eb81]['role']))return;var _0x6375c7=_0x5448fa[_0x43eb81][_0x9f18('0x2e')]===_0x9f18('0x2f')?_0x9f18('0x37'):_0x9f18('0x38');_0x59cc30[_0x9f18('0x56')](db[_0x9f18('0x3f')]['create']({'name':_0x5448fa[_0x43eb81][_0x9f18('0x42')],'resourceId':_0x5448fa[_0x43eb81]['id'],'type':_0x6375c7,'sectionId':_[_0x9f18('0x3e')](_0x1832f8,[_0x9f18('0x42'),_0x6375c7])['id']},{}));}return Promise[_0x9f18('0x92')](_0x59cc30);});})[_0x9f18('0x40')](respondWithResult(_0xdc8c7c,0xc9))[_0x9f18('0x65')](handleError(_0xdc8c7c,null));};exports['changePassword']=function(_0x160f70,_0x7570fc){if(_0x160f70['body']['id']){delete _0x160f70['body']['id'];}return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x160f70[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](function(_0x37afc6){if(!_0x37afc6)return null;if(_0x37afc6['id']===_0x160f70[_0x9f18('0x36')]['id']){if(!_0x160f70['body'][_0x9f18('0x95')]||!_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')]){throw new db[(_0x9f18('0x97'))]['ValidationError'](_0x9f18('0x98'));}if(!_0x37afc6[_0x9f18('0x99')](_0x160f70['body'][_0x9f18('0x95')])){throw new db[(_0x9f18('0x97'))]['ValidationError'](_0x9f18('0x9a'));}if(_0x160f70[_0x9f18('0x66')][_0x9f18('0x95')]===_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')]){throw new db['Sequelize'][(_0x9f18('0x9b'))](_0x9f18('0x9c'));}}else if(_0x160f70[_0x9f18('0x36')][_0x9f18('0x2e')]===_0x9f18('0x34')){if(!_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')]){throw new db[(_0x9f18('0x97'))][(_0x9f18('0x9b'))](_0x9f18('0x9d'));}}else if(_0x160f70['user'][_0x9f18('0x2e')]==='user'){if(!_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')]){throw new db[(_0x9f18('0x97'))]['ValidationError'](_0x9f18('0x9d'));}if(_0x37afc6['role']!==_0x9f18('0x2f')){throw new db[(_0x9f18('0x97'))][(_0x9f18('0x9b'))](_0x9f18('0x84'));}}else{throw new db[(_0x9f18('0x97'))][(_0x9f18('0x9b'))](_0x9f18('0x84'));}return _0x37afc6;})[_0x9f18('0x40')](handleEntityNotFound(_0x7570fc,null))[_0x9f18('0x40')](function(_0x4167bb){return db[_0x9f18('0x9e')][_0x9f18('0x9f')]({'attributes':['id',_0x9f18('0x6d'),_0x9f18('0xa0'),_0x9f18('0xa1')]})[_0x9f18('0x40')](function(_0x102341){if(_0x102341[_0x9f18('0x6d')])authService['validatePasswordPattern'](_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')]);if(!_0x102341[_0x9f18('0xa0')]||!_0x4167bb['previousPasswords'])return _0x4167bb;authService[_0x9f18('0xa2')](_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')],_0x4167bb[_0x9f18('0x4a')],_0x102341[_0x9f18('0xa1')]);return _0x4167bb;})['then'](saveUpdates({'password':_0x160f70[_0x9f18('0x66')]['newPassword'],'passwordResetAt':_0x160f70[_0x9f18('0x36')]['id']==_0x160f70['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')],_0x4167bb[_0x9f18('0x4a')])},null));})['then'](respondWithResult(_0x7570fc,null))['catch'](handleError(_0x7570fc,null));};exports[_0x9f18('0xa3')]=function(_0x357438,_0x433ac2){var _0x47b9e5=_0x357438[_0x9f18('0x66')][_0x9f18('0xa4')];return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x357438[_0x9f18('0x61')]['id']},'attributes':['id',_0x9f18('0x42'),_0x9f18('0x2e'),_0x9f18('0xa5'),_0x9f18('0xa6'),'voicePause','interface']})[_0x9f18('0x40')](handleEntityNotFound(_0x433ac2,null))[_0x9f18('0x40')](function(_0x318e78){if(_0x318e78){if(!utils[_0x9f18('0xa7')](_0x47b9e5)){throw new db[(_0x9f18('0x97'))]['ValidationError'](_0x9f18('0xa8'));}return _0x318e78[_0x9f18('0xa9')+_['capitalize'](_0x47b9e5['toLowerCase']())+_0x9f18('0xaa')](_0x357438['body']['ids'],{'penalty':_0x357438[_0x9f18('0x66')][_0x9f18('0xab')]||0x0})[_0x9f18('0xac')](function(_0x22cd19){for(var _0x2a134d=0x0;_0x2a134d<_0x357438[_0x9f18('0x66')][_0x9f18('0x69')][_0x9f18('0x5a')];_0x2a134d+=0x1){var _0xd32c04={'UserId':Number(_0x357438['params']['id'])};_0xd32c04[_['capitalize'](_0x47b9e5['toLowerCase']())+_0x9f18('0xad')]=Number(_0x357438['body'][_0x9f18('0x69')][_0x2a134d]);socket['emit'](_0x9f18('0x36')+_[_0x9f18('0xae')](_0x47b9e5[_0x9f18('0xaf')]())+_0x9f18('0xb0'),_0xd32c04);}return _0x22cd19;})[_0x9f18('0x40')](function(){if(_0x47b9e5===_0x9f18('0xb1')){return db[_0x9f18('0xb2')][_0x9f18('0x57')]({'where':{'id':_0x357438['body']['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0x9f18('0x40')](function(_0x3df71c){var _0xf44bdc=_0x318e78[_0x9f18('0x33')]({'plain':!![]});var _0x4bc306=[];if(_0x47b9e5===_0x9f18('0xb1')&&_0xf44bdc[_0x9f18('0x2e')]==='agent'&&_0xf44bdc['online']){for(let _0x3db786=0x0;_0x3db786<_0x3df71c[_0x9f18('0x5a')];_0x3db786+=0x1){_0x4bc306[_0x9f18('0x56')]({'membername':_0xf44bdc[_0x9f18('0x42')],'UserId':_0xf44bdc['id'],'queue_name':_0x3df71c[_0x3db786][_0x9f18('0x42')],'VoiceQueueId':_0x3df71c[_0x3db786]['id'],'interface':_['isNil'](_0xf44bdc[_0x9f18('0xb3')])?util[_0x9f18('0xb4')](_0x9f18('0xb5'),_0xf44bdc[_0x9f18('0x42')]):_0xf44bdc['interface'],'paused':_0xf44bdc['voicePause']||![],'penalty':_0x357438['body'][_0x9f18('0xab')]||0x0});}return Promise[_0x9f18('0x92')](_0x4bc306[_0x9f18('0x3b')](function(_0x16d0cc){return db[_0x9f18('0xb6')]['upsert'](_0x16d0cc);}));}return _0x318e78;});}})['then'](respondWithStatusCode(_0x433ac2,null))[_0x9f18('0x65')](handleError(_0x433ac2,null));};exports[_0x9f18('0xb7')]=function(_0x4c08df,_0x24732c){var _0x42133f,_0x416441;return db['User'][_0x9f18('0x3e')]({'where':{'id':_0x4c08df[_0x9f18('0x61')]['id']},'attributes':['id',_0x9f18('0x42'),_0x9f18('0x2e')]})[_0x9f18('0x40')](handleEntityNotFound(_0x24732c,null))[_0x9f18('0x40')](function(_0x268472){if(_0x268472){_0x42133f=_0x268472;if(!_0x4c08df[_0x9f18('0x50')][_0x9f18('0xa4')]||!utils['isValidChannel'](_0x4c08df[_0x9f18('0x50')]['channel'])){throw new db[(_0x9f18('0x97'))]['ValidationError'](_0x9f18('0xa8'));}return _0x268472[_0x9f18('0xb8')+_[_0x9f18('0xae')](_0x4c08df[_0x9f18('0x50')][_0x9f18('0xa4')]['toLowerCase']())+'Queues'](_0x4c08df[_0x9f18('0x50')][_0x9f18('0x69')]);}})['then'](function(_0x3a265d){if(_[_0x9f18('0xb9')](_0x4c08df[_0x9f18('0x50')]['ids'])){for(var _0x37c314=0x0;_0x37c314<_0x4c08df['query']['ids'][_0x9f18('0x5a')];_0x37c314+=0x1){_0x416441={'UserId':Number(_0x4c08df[_0x9f18('0x61')]['id'])};_0x416441[_['capitalize'](_0x4c08df[_0x9f18('0x50')][_0x9f18('0xa4')][_0x9f18('0xaf')]())+_0x9f18('0xad')]=Number(_0x4c08df[_0x9f18('0x50')][_0x9f18('0x69')][_0x37c314]);socket[_0x9f18('0x30')](_0x9f18('0x36')+_['capitalize'](_0x4c08df[_0x9f18('0x50')][_0x9f18('0xa4')][_0x9f18('0xaf')]())+_0x9f18('0xba'),_0x416441);}}else{_0x416441={'UserId':Number(_0x4c08df[_0x9f18('0x61')]['id'])};_0x416441[_[_0x9f18('0xae')](_0x4c08df[_0x9f18('0x50')]['channel'][_0x9f18('0xaf')]())+_0x9f18('0xad')]=Number(_0x4c08df[_0x9f18('0x50')][_0x9f18('0x69')]);socket[_0x9f18('0x30')](_0x9f18('0x36')+_[_0x9f18('0xae')](_0x4c08df[_0x9f18('0x50')][_0x9f18('0xa4')][_0x9f18('0xaf')]())+_0x9f18('0xba'),_0x416441);}return _0x3a265d;})[_0x9f18('0x40')](function(){if(_0x4c08df['query'][_0x9f18('0xa4')]===_0x9f18('0xb1')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x4c08df[_0x9f18('0x61')]['id'],'VoiceQueueId':_0x4c08df[_0x9f18('0x50')][_0x9f18('0x69')]},'individualHooks':!![]})['then'](function(){return _0x42133f;});}return _0x42133f;})['then'](respondWithStatusCode(_0x24732c,null))[_0x9f18('0x65')](handleError(_0x24732c,null));};exports[_0x9f18('0xbb')]=function(_0x5ddf4b,_0x293329){_0x5ddf4b['body'][_0x9f18('0xbc')]=_0x5ddf4b[_0x9f18('0xbd')]['filename'];return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x5ddf4b['params']['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x293329,null))[_0x9f18('0x40')](saveUpdates(_0x5ddf4b[_0x9f18('0x66')],null))[_0x9f18('0x40')](respondWithResult(_0x293329,null))[_0x9f18('0x65')](handleError(_0x293329,null));};exports['getAvatar']=function(_0x18ade5,_0x34f2f0){var _0x415fdb=path['join'](config[_0x9f18('0xbe')],_0x9f18('0xbf'));return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x18ade5[_0x9f18('0x61')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x34f2f0,null))[_0x9f18('0x40')](function(_0x37e41d){if(_0x37e41d){if(_[_0x9f18('0x70')](_0x37e41d['userpic'])){return _0x34f2f0[_0x9f18('0xc0')](_0x415fdb);}else{if(!fs[_0x9f18('0xc1')](path[_0x9f18('0xc2')](config[_0x9f18('0xbe')],_0x9f18('0xc3'),_0x37e41d['userpic']))){return _0x34f2f0[_0x9f18('0xc0')](_0x415fdb);}return _0x34f2f0['download'](path[_0x9f18('0xc2')](config[_0x9f18('0xbe')],_0x9f18('0xc3'),_0x37e41d[_0x9f18('0xbc')]));}}})[_0x9f18('0x65')](handleError(_0x34f2f0,null));};exports[_0x9f18('0xc4')]=function(_0x450a29,_0x24b9e1){return db[_0x9f18('0x43')]['find']({'where':{'id':_0x450a29[_0x9f18('0x61')]['id']},'attributes':['id']})[_0x9f18('0x40')](handleEntityNotFound(_0x24b9e1,null))[_0x9f18('0x40')](function(_0xb8263){var _0x290eee=[];values=_0xb8263[_0x9f18('0x5c')];_0x290eee[_0x9f18('0x56')](get_open_tabs('chat',_0xb8263[_0x9f18('0x5c')]));_0x290eee[_0x9f18('0x56')](get_open_tabs(_0x9f18('0xc5'),_0xb8263[_0x9f18('0x5c')]));_0x290eee['push'](get_open_tabs(_0x9f18('0x5f'),_0xb8263[_0x9f18('0x5c')]));_0x290eee[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x60'),_0xb8263['dataValues']));_0x290eee[_0x9f18('0x56')](get_open_tabs('fax',_0xb8263['dataValues']));_0x290eee[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x5e'),_0xb8263[_0x9f18('0x5c')]));return Promise[_0x9f18('0x92')](_0x290eee);})['then'](function(_0x20a7b2){if(_0x20a7b2){var _0x281d60=_[_0x9f18('0x3b')](values[_0x9f18('0xc6')],function(_0xd33deb){return{'channel':'CHAT','id':_0xd33deb['id'],'createdAt':_0xd33deb[_0x9f18('0xc7')]};});var _0x4b1dc5=_['map'](values['FaxOpenTabs'],function(_0x4b72cf){return{'channel':_0x9f18('0xc8'),'id':_0x4b72cf['id'],'createdAt':_0x4b72cf[_0x9f18('0xc7')]};});var _0x749788=_[_0x9f18('0x3b')](values[_0x9f18('0xc9')],function(_0x536498){return{'channel':_0x9f18('0xca'),'id':_0x536498['id'],'createdAt':_0x536498[_0x9f18('0xc7')]};});var _0x13b2a7=_[_0x9f18('0x3b')](values[_0x9f18('0xcb')],function(_0xe2beba){return{'channel':_0x9f18('0xcc'),'id':_0xe2beba['id'],'createdAt':_0xe2beba[_0x9f18('0xc7')]};});var _0x523f80=_[_0x9f18('0x3b')](values[_0x9f18('0xcd')],function(_0x6afca6){return{'channel':_0x9f18('0xce'),'id':_0x6afca6['id'],'createdAt':_0x6afca6[_0x9f18('0xc7')]};});var _0x51d71f=_[_0x9f18('0x3b')](values[_0x9f18('0xcf')],function(_0x408644){return{'channel':_0x9f18('0xd0'),'id':_0x408644['id'],'createdAt':_0x408644['createdAt']};});var _0x2c19c7=_[_0x9f18('0xd1')](_0x281d60,_0x4b1dc5,_0x749788,_0x13b2a7,_0x523f80,_0x51d71f);var _0x18be42={'count':_0x2c19c7[_0x9f18('0x5a')],'rows':_0x2c19c7};return _0x18be42;}else return null;})[_0x9f18('0x40')](respondWithResult(_0x24b9e1,null))[_0x9f18('0x65')](handleError(_0x24b9e1,null));};exports[_0x9f18('0xd2')]=function(_0x2dc088,_0x2ffe4a){var _0x313924={};return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x2dc088['params']['id']}})[_0x9f18('0x40')](function(_0x501d05){if(!_0x501d05){throw new APINotFoundError(util[_0x9f18('0xb4')]('User\x20with\x20id\x20%s\x20not\x20found',_0x2dc088[_0x9f18('0x61')]['id']));}return contacts[_0x9f18('0x67')]();})['then'](function(_0x3e0c9d){_0x2dc088[_0x9f18('0x50')][_0x9f18('0x43')]=_0x2dc088[_0x9f18('0x61')]['id'];_0x313924=qs[_0x9f18('0x4e')](_0x3e0c9d,_0x2dc088);if(_0x2dc088['query'][_0x9f18('0xd3')]('includeAll')){_0x313924[_0x9f18('0x51')]=[{'model':db[_0x9f18('0xd4')],'as':'List','required':![]},{'model':db[_0x9f18('0xd5')],'as':_0x9f18('0xd6'),'attributes':['id',_0x9f18('0x42'),_0x9f18('0xd7')],'where':_0x2dc088[_0x9f18('0x50')][_0x9f18('0xd8')]?{'id':_0x2dc088[_0x9f18('0x50')][_0x9f18('0xd8')]}:undefined,'required':_0x2dc088[_0x9f18('0x50')][_0x9f18('0xd8')]?!![]:![]}];}return contacts[_0x9f18('0x57')](_0x2dc088[_0x9f18('0x50')],_0x2dc088[_0x9f18('0x36')],_0x313924,_0x3e0c9d);})[_0x9f18('0x40')](respondWithFilteredResult(_0x2ffe4a,_0x313924))[_0x9f18('0x65')](APIHandleError(_0x2ffe4a));};exports[_0x9f18('0xd9')]=function(_0x1f6d94,_0x14d99b){var _0x4252d4;var _0x1a2b33={};var _0x47496b;return db['User']['findOne']({'where':{'id':_0x1f6d94[_0x9f18('0x61')]['id']},'attributes':['id',_0x9f18('0x42'),'role']})[_0x9f18('0x40')](handleEntityNotFound(_0x14d99b,null))['then'](function(_0x16b064){if(!utils[_0x9f18('0xa7')](_0x1f6d94[_0x9f18('0x50')]['channel'])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}_0x4252d4=_0x16b064;var _0x112a87={};_0x112a87[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_[_0x9f18('0xae')](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0xa4')])+_0x9f18('0xdc')][_0x9f18('0x44')]);_0x112a87[_0x9f18('0x50')]=_['keys'](_0x1f6d94['query']);_0x112a87[_0x9f18('0xdd')]=_[_0x9f18('0xde')](_0x112a87['model'],_0x112a87[_0x9f18('0x50')]);_0x1a2b33['attributes']=_['intersection'](_0x112a87[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x1a2b33[_0x9f18('0x55')]=_0x1a2b33[_0x9f18('0x55')][_0x9f18('0x5a')]?_0x1a2b33['attributes']:_0x112a87['model'];_0x1a2b33[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x1f6d94[_0x9f18('0x50')]['sort']);_0x1a2b33[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x1f6d94[_0x9f18('0x50')],_0x112a87[_0x9f18('0xdd')]));if(_0x1f6d94[_0x9f18('0x50')]['filter']){_0x1a2b33[_0x9f18('0x4f')]=_['merge'](_0x1a2b33['where'],{'$or':_[_0x9f18('0x3b')](_0x1a2b33['attributes'],function(_0x446920){var _0x1e3e85={};_0x1e3e85[_0x446920]={'$like':'%'+_0x1f6d94[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x1e3e85;})});}_0x1a2b33=_['merge']({},_0x1a2b33,_0x1f6d94[_0x9f18('0x64')]);switch(_0x4252d4[_0x9f18('0x2e')]){case'admin':return db[_['capitalize'](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0xa4')])+'Queue'][_0x9f18('0x57')](_0x1a2b33);case _0x9f18('0x36'):case _0x9f18('0x2f'):return _0x4252d4['get'+_[_0x9f18('0xae')](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0xa4')])+'Queues'](_0x1a2b33);default:throw new db[(_0x9f18('0x97'))]['ValidationError'](_0x9f18('0xe3'));}})[_0x9f18('0x40')](function(_0xcd28f1){_0x47496b=_0xcd28f1[_0x9f18('0x5a')];if(!_0x1f6d94[_0x9f18('0x50')][_0x9f18('0xd3')]('nolimit')){_0x1a2b33[_0x9f18('0x20')]=qs[_0x9f18('0x20')](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0x20')]);_0x1a2b33['offset']=qs[_0x9f18('0x1d')](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0x1d')]);}switch(_0x4252d4[_0x9f18('0x2e')]){case'admin':return db[_['capitalize'](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0xa4')])+_0x9f18('0xdc')][_0x9f18('0x57')](_0x1a2b33);case _0x9f18('0x36'):case'agent':return _0x4252d4[_0x9f18('0x33')+_[_0x9f18('0xae')](_0x1f6d94['query'][_0x9f18('0xa4')])+_0x9f18('0xaa')](_0x1a2b33);}})[_0x9f18('0x40')](function(_0x364431){return{'count':_0x47496b,'rows':_0x364431};})[_0x9f18('0x40')](respondWithResult(_0x14d99b,null))['catch'](handleError(_0x14d99b,null));};exports['getVoiceQueuesRt']=function(_0x1ade0f,_0x5bad29){var _0x484cbf={};var _0x34d85b={};var _0x2d5b04;var _0x1c0621;return db['User']['findOne']({'where':{'id':_0x1ade0f[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x5bad29,null))[_0x9f18('0x40')](function(_0x2066c6){if(_0x2066c6){_0x2d5b04=_0x2066c6;_0x34d85b['model']=_['keys'](db[_0x9f18('0xb6')][_0x9f18('0x44')]);_0x34d85b[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x1ade0f[_0x9f18('0x50')]);_0x34d85b[_0x9f18('0xdd')]=_[_0x9f18('0xde')](_0x34d85b[_0x9f18('0xda')],_0x34d85b['query']);_0x484cbf[_0x9f18('0x55')]=_[_0x9f18('0xde')](_0x34d85b[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x1ade0f[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x484cbf[_0x9f18('0x55')]=_0x484cbf[_0x9f18('0x55')][_0x9f18('0x5a')]?_0x484cbf[_0x9f18('0x55')]:_0x34d85b[_0x9f18('0xda')];_0x484cbf['order']=qs[_0x9f18('0xe1')](_0x1ade0f[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x484cbf[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x1ade0f[_0x9f18('0x50')],_0x34d85b['filters']));if(_0x1ade0f['query'][_0x9f18('0x39')]){_0x484cbf[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x484cbf[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x484cbf[_0x9f18('0x55')],function(_0x587046){var _0x5c5716={};_0x5c5716[_0x587046]={'$like':'%'+_0x1ade0f[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x5c5716;})});}_0x484cbf=_['merge']({},_0x484cbf,_0x1ade0f[_0x9f18('0x64')]);return _0x2d5b04[_0x9f18('0xe4')](_0x484cbf);}})[_0x9f18('0x40')](function(_0x1f36cd){if(_0x1f36cd){_0x1c0621=_0x1f36cd['length'];if(!_0x1ade0f['query'][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x484cbf['limit']=qs['limit'](_0x1ade0f[_0x9f18('0x50')][_0x9f18('0x20')]);_0x484cbf[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x1ade0f[_0x9f18('0x50')][_0x9f18('0x1d')]);}return _0x2d5b04[_0x9f18('0xe4')](_0x484cbf);}})[_0x9f18('0x40')](function(_0x544b86){if(_0x544b86){return _0x544b86?{'count':_0x1c0621,'rows':_0x544b86}:null;}})[_0x9f18('0x40')](respondWithResult(_0x5bad29,null))[_0x9f18('0x65')](handleError(_0x5bad29,null));};exports['getGroups']=function(_0x6d0b7c,_0x2d08b4){var _0x33f802={};var _0xbd7896={};var _0x2e4c0b;var _0x4aa889;return db['User'][_0x9f18('0x9f')]({'where':{'id':_0x6d0b7c['params']['id']}})['then'](handleEntityNotFound(_0x2d08b4,null))[_0x9f18('0x40')](function(_0x1c9212){if(_0x1c9212){_0x2e4c0b=_0x1c9212;_0xbd7896['model']=_[_0x9f18('0xdb')](db[_0x9f18('0xe6')][_0x9f18('0x44')]);_0xbd7896[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x6d0b7c[_0x9f18('0x50')]);_0xbd7896[_0x9f18('0xdd')]=_[_0x9f18('0xde')](_0xbd7896[_0x9f18('0xda')],_0xbd7896['query']);_0x33f802['attributes']=_[_0x9f18('0xde')](_0xbd7896[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x6d0b7c[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x33f802['attributes']=_0x33f802['attributes'][_0x9f18('0x5a')]?_0x33f802[_0x9f18('0x55')]:_0xbd7896[_0x9f18('0xda')];_0x33f802[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x6d0b7c[_0x9f18('0x50')]['sort']);_0x33f802[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_['pick'](_0x6d0b7c['query'],_0xbd7896[_0x9f18('0xdd')]));if(_0x6d0b7c['query']['filter']){_0x33f802[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x33f802[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x33f802['attributes'],function(_0x2e5a5d){var _0x140178={};_0x140178[_0x2e5a5d]={'$like':'%'+_0x6d0b7c[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x140178;})});}_0x33f802=_['merge']({},_0x33f802,_0x6d0b7c[_0x9f18('0x64')]);return _0x2e4c0b[_0x9f18('0xe7')](_0x33f802);}})[_0x9f18('0x40')](function(_0xa384d7){if(_0xa384d7){_0x4aa889=_0xa384d7[_0x9f18('0x5a')];if(!_0x6d0b7c[_0x9f18('0x50')][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x33f802[_0x9f18('0x20')]=qs[_0x9f18('0x20')](_0x6d0b7c[_0x9f18('0x50')][_0x9f18('0x20')]);_0x33f802[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x6d0b7c['query'][_0x9f18('0x1d')]);}return _0x2e4c0b['getGroups'](_0x33f802);}})[_0x9f18('0x40')](function(_0x476aa9){if(_0x476aa9){return _0x476aa9?{'count':_0x4aa889,'rows':_0x476aa9}:null;}})[_0x9f18('0x40')](respondWithResult(_0x2d08b4,null))['catch'](handleError(_0x2d08b4,null));};exports[_0x9f18('0xe8')]=function(_0x1d11c1,_0x46e062){var _0x31e26d={'raw':!![],'where':{}};var _0x23a78b={};var _0x32253e={'count':0x0,'rows':[]};return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x1d11c1[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x46e062,null))[_0x9f18('0x40')](function(_0x3308a4){if(_0x3308a4){_0x23a78b[_0x9f18('0xda')]=_['keys'](db[_0x9f18('0xe9')]['rawAttributes']);_0x23a78b[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x1d11c1[_0x9f18('0x50')]);_0x23a78b['filters']=_[_0x9f18('0xde')](_0x23a78b[_0x9f18('0xda')],_0x23a78b[_0x9f18('0x50')]);_0x31e26d[_0x9f18('0x55')]=_['intersection'](_0x23a78b['model'],qs[_0x9f18('0xdf')](_0x1d11c1[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x31e26d['attributes']=_0x31e26d['attributes'][_0x9f18('0x5a')]?_0x31e26d[_0x9f18('0x55')]:_0x23a78b[_0x9f18('0xda')];if(!_0x1d11c1[_0x9f18('0x50')]['hasOwnProperty'](_0x9f18('0xe5'))){_0x31e26d['limit']=qs['limit'](_0x1d11c1[_0x9f18('0x50')][_0x9f18('0x20')]);_0x31e26d['offset']=qs['offset'](_0x1d11c1[_0x9f18('0x50')][_0x9f18('0x1d')]);}_0x31e26d[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x1d11c1['query'][_0x9f18('0xe1')]);_0x31e26d[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x1d11c1[_0x9f18('0x50')],_0x23a78b['filters']));_0x31e26d['where']['UserId']=_0x3308a4['id'];if(_0x1d11c1['query'][_0x9f18('0x39')]){_0x31e26d[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x31e26d[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x31e26d['attributes'],function(_0x33a055){var _0x5b8e05={};_0x5b8e05[_0x33a055]={'$like':'%'+_0x1d11c1[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x5b8e05;})});}_0x31e26d=_[_0x9f18('0x63')]({},_0x31e26d,_0x1d11c1[_0x9f18('0x64')]);return db[_0x9f18('0xe9')][_0x9f18('0x1f')]({'where':_0x31e26d['where']})[_0x9f18('0x40')](function(_0x22027b){_0x32253e[_0x9f18('0x1f')]=_0x22027b;if(_0x1d11c1[_0x9f18('0x50')][_0x9f18('0x62')]){_0x31e26d[_0x9f18('0x51')]=[{'all':!![]}];}return db[_0x9f18('0xe9')]['findAll'](_0x31e26d);})[_0x9f18('0x40')](function(_0x47c896){_0x32253e['rows']=_0x47c896;return _0x32253e;});}})[_0x9f18('0x40')](respondWithFilteredResult(_0x46e062,_0x31e26d))['catch'](handleError(_0x46e062,null));};exports[_0x9f18('0xea')]=function(_0x187faa,_0x4695bf){var _0x485458={'raw':!![],'where':{}};var _0x5152b7={};var _0xaab2bb={'count':0x0,'rows':[]};return db['User'][_0x9f18('0x9f')]({'where':{'id':_0x187faa[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x4695bf,null))[_0x9f18('0x40')](function(_0x5e379f){if(_0x5e379f){_0x5152b7['model']=_[_0x9f18('0xdb')](db[_0x9f18('0xeb')][_0x9f18('0x44')]);_0x5152b7[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x187faa[_0x9f18('0x50')]);_0x5152b7[_0x9f18('0xdd')]=_['intersection'](_0x5152b7['model'],_0x5152b7[_0x9f18('0x50')]);_0x485458[_0x9f18('0x55')]=_[_0x9f18('0xde')](_0x5152b7[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x187faa[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x485458[_0x9f18('0x55')]=_0x485458[_0x9f18('0x55')][_0x9f18('0x5a')]?_0x485458[_0x9f18('0x55')]:_0x5152b7[_0x9f18('0xda')];if(!_0x187faa['query'][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x485458['limit']=qs[_0x9f18('0x20')](_0x187faa[_0x9f18('0x50')]['limit']);_0x485458[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x187faa['query'][_0x9f18('0x1d')]);}_0x485458[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x187faa['query'][_0x9f18('0xe1')]);_0x485458[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x187faa[_0x9f18('0x50')],_0x5152b7[_0x9f18('0xdd')]));_0x485458[_0x9f18('0x4f')]['UserId']=_0x5e379f['id'];if(_0x187faa[_0x9f18('0x50')][_0x9f18('0x39')]){_0x485458[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x485458[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x485458[_0x9f18('0x55')],function(_0x5296cc){var _0x4aedfc={};_0x4aedfc[_0x5296cc]={'$like':'%'+_0x187faa[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x4aedfc;})});}_0x485458=_['merge']({},_0x485458,_0x187faa[_0x9f18('0x64')]);return db[_0x9f18('0xeb')][_0x9f18('0x1f')]({'where':_0x485458[_0x9f18('0x4f')]})[_0x9f18('0x40')](function(_0x19088a){_0xaab2bb[_0x9f18('0x1f')]=_0x19088a;if(_0x187faa[_0x9f18('0x50')]['includeAll']){_0x485458[_0x9f18('0x51')]=[{'all':!![]}];}return db['ScreenRecording'][_0x9f18('0x57')](_0x485458);})[_0x9f18('0x40')](function(_0x32027e){_0xaab2bb[_0x9f18('0x58')]=_0x32027e;return _0xaab2bb;});}})[_0x9f18('0x40')](respondWithFilteredResult(_0x4695bf,_0x485458))['catch'](handleError(_0x4695bf,null));};exports[_0x9f18('0xec')]=function(_0x51c0aa,_0x2e16cc){var _0x5b9f32={};var _0x5b71af={};var _0x45afff;var _0x5ca3d4;return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x51c0aa['params']['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x2e16cc,null))[_0x9f18('0x40')](function(_0x105832){if(_0x105832){_0x45afff=_0x105832;_0x5b71af[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0xed')][_0x9f18('0x44')]);_0x5b71af[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x51c0aa['query']);_0x5b71af['filters']=_['intersection'](_0x5b71af[_0x9f18('0xda')],_0x5b71af[_0x9f18('0x50')]);_0x5b9f32['attributes']=_[_0x9f18('0xde')](_0x5b71af[_0x9f18('0xda')],qs['fields'](_0x51c0aa[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x5b9f32[_0x9f18('0x55')]=_0x5b9f32[_0x9f18('0x55')]['length']?_0x5b9f32[_0x9f18('0x55')]:_0x5b71af[_0x9f18('0xda')];_0x5b9f32[_0x9f18('0xe0')]=qs['sort'](_0x51c0aa[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x5b9f32[_0x9f18('0x4f')]=qs['filters'](_[_0x9f18('0xe2')](_0x51c0aa[_0x9f18('0x50')],_0x5b71af[_0x9f18('0xdd')]));if(_0x51c0aa[_0x9f18('0x50')][_0x9f18('0x39')]){_0x5b9f32[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x5b9f32[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x5b9f32[_0x9f18('0x55')],function(_0x3e5f76){var _0x44c96c={};_0x44c96c[_0x3e5f76]={'$like':'%'+_0x51c0aa[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x44c96c;})});}_0x5b9f32=_[_0x9f18('0x63')]({},_0x5b9f32,_0x51c0aa[_0x9f18('0x64')]);return _0x45afff[_0x9f18('0xec')](_0x5b9f32);}})[_0x9f18('0x40')](function(_0xaeca7d){if(_0xaeca7d){_0x5ca3d4=_0xaeca7d[_0x9f18('0x5a')];if(!_0x51c0aa[_0x9f18('0x50')][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x5b9f32['limit']=qs[_0x9f18('0x20')](_0x51c0aa['query']['limit']);_0x5b9f32[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x51c0aa['query'][_0x9f18('0x1d')]);}return _0x45afff[_0x9f18('0xec')](_0x5b9f32);}})['then'](function(_0x1b0a52){if(_0x1b0a52){return _0x1b0a52?{'count':_0x5ca3d4,'rows':_0x1b0a52}:null;}})['then'](respondWithResult(_0x2e16cc,null))[_0x9f18('0x65')](handleError(_0x2e16cc,null));};exports[_0x9f18('0xee')]=function(_0x5caeab,_0x49664c){var _0x4dbb90={};var _0x92c50a={};var _0x2d2a96;var _0x528b69;return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x5caeab[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x49664c,null))['then'](function(_0x1c5457){if(_0x1c5457){_0x2d2a96=_0x1c5457;_0x92c50a[_0x9f18('0xda')]=_['keys'](db['OpenchannelInteraction'][_0x9f18('0x44')]);_0x92c50a[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x5caeab[_0x9f18('0x50')]);_0x92c50a['filters']=_[_0x9f18('0xde')](_0x92c50a[_0x9f18('0xda')],_0x92c50a[_0x9f18('0x50')]);_0x4dbb90[_0x9f18('0x55')]=_[_0x9f18('0xde')](_0x92c50a[_0x9f18('0xda')],qs['fields'](_0x5caeab['query'][_0x9f18('0xdf')]));_0x4dbb90['attributes']=_0x4dbb90['attributes']['length']?_0x4dbb90[_0x9f18('0x55')]:_0x92c50a[_0x9f18('0xda')];_0x4dbb90[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x5caeab[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x4dbb90[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x5caeab[_0x9f18('0x50')],_0x92c50a[_0x9f18('0xdd')]));if(_0x5caeab[_0x9f18('0x50')]['filter']){_0x4dbb90[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x4dbb90[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x4dbb90[_0x9f18('0x55')],function(_0x392450){var _0x402ada={};_0x402ada[_0x392450]={'$like':'%'+_0x5caeab[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x402ada;})});}_0x4dbb90=_[_0x9f18('0x63')]({},_0x4dbb90,_0x5caeab[_0x9f18('0x64')]);return _0x2d2a96[_0x9f18('0xee')](_0x4dbb90);}})[_0x9f18('0x40')](function(_0x49406){if(_0x49406){_0x528b69=_0x49406[_0x9f18('0x5a')];if(!_0x5caeab[_0x9f18('0x50')][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x4dbb90[_0x9f18('0x20')]=qs[_0x9f18('0x20')](_0x5caeab[_0x9f18('0x50')]['limit']);_0x4dbb90[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x5caeab[_0x9f18('0x50')]['offset']);}return _0x2d2a96[_0x9f18('0xee')](_0x4dbb90);}})[_0x9f18('0x40')](function(_0x23e322){if(_0x23e322){return _0x23e322?{'count':_0x528b69,'rows':_0x23e322}:null;}})[_0x9f18('0x40')](respondWithResult(_0x49664c,null))[_0x9f18('0x65')](handleError(_0x49664c,null));};exports[_0x9f18('0xef')]=function(_0xac4823,_0x3364fc){var _0x950b82={'raw':!![],'where':{}};var _0x1898ea={};var _0x5bb663={'count':0x0,'rows':[]};return db[_0x9f18('0x43')]['findOne']({'where':{'id':_0xac4823[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x3364fc,null))[_0x9f18('0x40')](function(_0x3ed2bc){if(_0x3ed2bc){_0x1898ea[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0xf0')][_0x9f18('0x44')]);_0x1898ea[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0xac4823['query']);_0x1898ea[_0x9f18('0xdd')]=_[_0x9f18('0xde')](_0x1898ea[_0x9f18('0xda')],_0x1898ea[_0x9f18('0x50')]);_0x950b82[_0x9f18('0x55')]=_[_0x9f18('0xde')](_0x1898ea[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0xac4823[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x950b82[_0x9f18('0x55')]=_0x950b82[_0x9f18('0x55')][_0x9f18('0x5a')]?_0x950b82[_0x9f18('0x55')]:_0x1898ea[_0x9f18('0xda')];if(!_0xac4823[_0x9f18('0x50')][_0x9f18('0xd3')]('nolimit')){_0x950b82[_0x9f18('0x20')]=qs[_0x9f18('0x20')](_0xac4823['query'][_0x9f18('0x20')]);_0x950b82[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0xac4823[_0x9f18('0x50')][_0x9f18('0x1d')]);}_0x950b82[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0xac4823[_0x9f18('0x50')]['sort']);_0x950b82['where']=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0xac4823[_0x9f18('0x50')],_0x1898ea[_0x9f18('0xdd')]));_0x950b82[_0x9f18('0x4f')][_0x9f18('0xf1')]=_0x3ed2bc['id'];if(_0xac4823[_0x9f18('0x50')][_0x9f18('0x39')]){_0x950b82[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x950b82[_0x9f18('0x4f')],{'$or':_['map'](_0x950b82[_0x9f18('0x55')],function(_0x1c09fb){var _0x5e4ca9={};_0x5e4ca9[_0x1c09fb]={'$like':'%'+_0xac4823[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x5e4ca9;})});}_0x950b82=_[_0x9f18('0x63')]({},_0x950b82,_0xac4823['options']);return db[_0x9f18('0xf0')][_0x9f18('0x1f')]({'where':_0x950b82[_0x9f18('0x4f')]})[_0x9f18('0x40')](function(_0x253a2a){_0x5bb663[_0x9f18('0x1f')]=_0x253a2a;if(_0xac4823[_0x9f18('0x50')][_0x9f18('0x62')]){_0x950b82[_0x9f18('0x51')]=[{'all':!![]}];}return db[_0x9f18('0xf0')][_0x9f18('0x57')](_0x950b82);})[_0x9f18('0x40')](function(_0xd8158c){_0x5bb663[_0x9f18('0x58')]=_0xd8158c;return _0x5bb663;});}})[_0x9f18('0x40')](respondWithFilteredResult(_0x3364fc,_0x950b82))[_0x9f18('0x65')](handleError(_0x3364fc,null));};exports[_0x9f18('0xf2')]=function(_0x5dad15,_0xe882fa){var _0x29f099={};var _0x3b6674={};var _0x55e077;var _0x5e891b;return db[_0x9f18('0x43')]['findOne']({'where':{'id':_0x5dad15[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0xe882fa,null))[_0x9f18('0x40')](function(_0x513dee){if(_0x513dee){_0x55e077=_0x513dee;_0x3b6674[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0xf3')]['rawAttributes']);_0x3b6674['query']=_['keys'](_0x5dad15[_0x9f18('0x50')]);_0x3b6674[_0x9f18('0xdd')]=_[_0x9f18('0xde')](_0x3b6674[_0x9f18('0xda')],_0x3b6674[_0x9f18('0x50')]);_0x29f099[_0x9f18('0x55')]=_['intersection'](_0x3b6674[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x5dad15[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x29f099[_0x9f18('0x55')]=_0x29f099[_0x9f18('0x55')]['length']?_0x29f099[_0x9f18('0x55')]:_0x3b6674['model'];_0x29f099[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x5dad15[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x29f099[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x5dad15[_0x9f18('0x50')],_0x3b6674['filters']));if(_0x5dad15[_0x9f18('0x50')]['filter']){_0x29f099[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x29f099['where'],{'$or':_['map'](_0x29f099['attributes'],function(_0x4b6290){var _0x294ca4={};_0x294ca4[_0x4b6290]={'$like':'%'+_0x5dad15[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x294ca4;})});}_0x29f099=_['merge']({},_0x29f099,_0x5dad15['options']);return _0x55e077['getSmsInteractions'](_0x29f099);}})[_0x9f18('0x40')](function(_0x42a9ef){if(_0x42a9ef){_0x5e891b=_0x42a9ef[_0x9f18('0x5a')];if(!_0x5dad15[_0x9f18('0x50')]['hasOwnProperty']('nolimit')){_0x29f099[_0x9f18('0x20')]=qs['limit'](_0x5dad15[_0x9f18('0x50')]['limit']);_0x29f099[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x5dad15[_0x9f18('0x50')][_0x9f18('0x1d')]);}return _0x55e077[_0x9f18('0xf2')](_0x29f099);}})[_0x9f18('0x40')](function(_0x9f43ae){if(_0x9f43ae){return _0x9f43ae?{'count':_0x5e891b,'rows':_0x9f43ae}:null;}})[_0x9f18('0x40')](respondWithResult(_0xe882fa,null))[_0x9f18('0x65')](handleError(_0xe882fa,null));};exports[_0x9f18('0xf4')]=function(_0x4349f0,_0x362aa6){var _0x25bd84={};var _0xf439fa={};var _0x22841f;var _0x1b6da2;return db[_0x9f18('0x43')]['findOne']({'where':{'id':_0x4349f0[_0x9f18('0x61')]['id']}})['then'](handleEntityNotFound(_0x362aa6,null))[_0x9f18('0x40')](function(_0x9d4882){if(_0x9d4882){_0x22841f=_0x9d4882;_0xf439fa[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0xf5')][_0x9f18('0x44')]);_0xf439fa[_0x9f18('0x50')]=_['keys'](_0x4349f0[_0x9f18('0x50')]);_0xf439fa['filters']=_[_0x9f18('0xde')](_0xf439fa[_0x9f18('0xda')],_0xf439fa[_0x9f18('0x50')]);_0x25bd84[_0x9f18('0x55')]=_['intersection'](_0xf439fa[_0x9f18('0xda')],qs['fields'](_0x4349f0[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x25bd84['attributes']=_0x25bd84[_0x9f18('0x55')]['length']?_0x25bd84[_0x9f18('0x55')]:_0xf439fa[_0x9f18('0xda')];_0x25bd84[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x4349f0[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x25bd84[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_['pick'](_0x4349f0[_0x9f18('0x50')],_0xf439fa[_0x9f18('0xdd')]));if(_0x4349f0['query'][_0x9f18('0x39')]){_0x25bd84[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x25bd84[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x25bd84[_0x9f18('0x55')],function(_0x4894d5){var _0xa96376={};_0xa96376[_0x4894d5]={'$like':'%'+_0x4349f0[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0xa96376;})});}_0x25bd84=_[_0x9f18('0x63')]({},_0x25bd84,_0x4349f0[_0x9f18('0x64')]);return _0x22841f[_0x9f18('0xf4')](_0x25bd84);}})['then'](function(_0x502f00){if(_0x502f00){_0x1b6da2=_0x502f00['length'];if(!_0x4349f0[_0x9f18('0x50')][_0x9f18('0xd3')]('nolimit')){_0x25bd84['limit']=qs[_0x9f18('0x20')](_0x4349f0[_0x9f18('0x50')]['limit']);_0x25bd84[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x4349f0[_0x9f18('0x50')]['offset']);}return _0x22841f[_0x9f18('0xf4')](_0x25bd84);}})[_0x9f18('0x40')](function(_0x5eae14){if(_0x5eae14){return _0x5eae14?{'count':_0x1b6da2,'rows':_0x5eae14}:null;}})[_0x9f18('0x40')](respondWithResult(_0x362aa6,null))[_0x9f18('0x65')](handleError(_0x362aa6,null));};exports[_0x9f18('0xf6')]=function(_0x57d946,_0x217b83){var _0x34734e={};var _0x3ac8a3={};var _0x1ee3ef;var _0x2ccc70;return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x57d946[_0x9f18('0x61')]['id']}})['then'](handleEntityNotFound(_0x217b83,null))[_0x9f18('0x40')](function(_0x26cbd0){if(_0x26cbd0){_0x1ee3ef=_0x26cbd0;_0x3ac8a3[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0xf7')][_0x9f18('0x44')]);_0x3ac8a3['query']=_[_0x9f18('0xdb')](_0x57d946[_0x9f18('0x50')]);_0x3ac8a3['filters']=_[_0x9f18('0xde')](_0x3ac8a3[_0x9f18('0xda')],_0x3ac8a3['query']);_0x34734e[_0x9f18('0x55')]=_['intersection'](_0x3ac8a3[_0x9f18('0xda')],qs['fields'](_0x57d946[_0x9f18('0x50')]['fields']));_0x34734e[_0x9f18('0x55')]=_0x34734e[_0x9f18('0x55')]['length']?_0x34734e[_0x9f18('0x55')]:_0x3ac8a3[_0x9f18('0xda')];_0x34734e[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x57d946[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x34734e[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x57d946[_0x9f18('0x50')],_0x3ac8a3[_0x9f18('0xdd')]));if(_0x57d946[_0x9f18('0x50')][_0x9f18('0x39')]){_0x34734e[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x34734e[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x34734e['attributes'],function(_0x40d0ae){var _0xe26b92={};_0xe26b92[_0x40d0ae]={'$like':'%'+_0x57d946['query'][_0x9f18('0x39')]+'%'};return _0xe26b92;})});}_0x34734e=_['merge']({},_0x34734e,_0x57d946[_0x9f18('0x64')]);return _0x1ee3ef[_0x9f18('0xf6')](_0x34734e);}})[_0x9f18('0x40')](function(_0x414b24){if(_0x414b24){_0x2ccc70=_0x414b24[_0x9f18('0x5a')];if(!_0x57d946[_0x9f18('0x50')][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x34734e['limit']=qs['limit'](_0x57d946[_0x9f18('0x50')]['limit']);_0x34734e['offset']=qs[_0x9f18('0x1d')](_0x57d946[_0x9f18('0x50')]['offset']);}return _0x1ee3ef[_0x9f18('0xf6')](_0x34734e);}})[_0x9f18('0x40')](function(_0x1b160c){if(_0x1b160c){return _0x1b160c?{'count':_0x2ccc70,'rows':_0x1b160c}:null;}})[_0x9f18('0x40')](respondWithResult(_0x217b83,null))[_0x9f18('0x65')](handleError(_0x217b83,null));};exports[_0x9f18('0xf8')]=function(_0x562854,_0x323b19,_0x200ab6){var _0x5d17c7;var _0x4bb2fa;var _0x44d284;var _0x22b065=!_['isNil'](_0x562854[_0x9f18('0x61')]['id'])?_0x562854['params']['id']:!_[_0x9f18('0x70')](_0x562854[_0x9f18('0x36')]['id'])?_0x562854[_0x9f18('0x36')]['id']:null;return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x22b065,'role':{'$or':[_0x9f18('0x34'),_0x9f18('0x36'),_0x9f18('0x2f')]}},'attributes':['id',_0x9f18('0x42'),_0x9f18('0xf9'),_0x9f18('0xfa'),_0x9f18('0x2e'),_0x9f18('0x6b'),_0x9f18('0xa6')]})['then'](function(_0xcb584f){if(_0xcb584f){if(_0xcb584f['role']==='agent'){_0x5d17c7=_0xcb584f;if(_0x562854[_0x9f18('0x66')][_0x9f18('0xb3')]){_0x44d284=util['format'](_0x9f18('0xfb'),_0x5d17c7[_0x562854[_0x9f18('0x66')][_0x9f18('0xb3')]]);}else if(_0x562854[_0x9f18('0x66')][_0x9f18('0xfc')]){_0x44d284=util[_0x9f18('0xb4')](_0x9f18('0xb5'),_0x562854[_0x9f18('0x66')][_0x9f18('0xfc')]);}else{_0x44d284=util[_0x9f18('0xb4')]('SIP/%s',_0x5d17c7[_0x9f18('0x42')]);}socket['to'](util[_0x9f18('0xb4')](_0x9f18('0xfd'),_0x5d17c7[_0x9f18('0x42')]))[_0x9f18('0x30')](_0x9f18('0xfe'),{'user':{'id':_0x5d17c7['id'],'name':_0x5d17c7[_0x9f18('0x42')]},'ip':_0x562854[_0x9f18('0xff')][_0x9f18('0x100')]||_0x562854[_0x9f18('0x101')][_0x9f18('0x102')]||_0x562854['socket']['remoteAddress']||_0x562854[_0x9f18('0x101')][_0x9f18('0x103')][_0x9f18('0x102')]});return db[_0x9f18('0xb6')][_0x9f18('0x32')]({'where':{'membername':_0x5d17c7[_0x9f18('0x42')]},'individualHooks':!![]});}}else{throw new db[(_0x9f18('0x97'))][(_0x9f18('0x9b'))](_0x9f18('0x104'));}})[_0x9f18('0x40')](function(){if(_0x5d17c7){return _0x5d17c7[_0x9f18('0x105')]({'raw':!![]});}})['then'](function(_0x3858a9){if(_0x5d17c7){if(_0x3858a9){_0x4bb2fa=_0x3858a9;if(_0x4bb2fa[_0x9f18('0x5a')]){var _0x3d1f95=_0x4bb2fa[_0x9f18('0x3b')](function(_0x11fe2a){var _0xbec7ee={'membername':_0x5d17c7['name'],'UserId':_0x5d17c7['id'],'queue_name':_0x11fe2a[_0x9f18('0x42')],'VoiceQueueId':_0x11fe2a['id'],'interface':_0x44d284,'paused':_0x5d17c7[_0x9f18('0xa6')]||![],'penalty':_0x11fe2a[_0x9f18('0x106')]||0x0};return db[_0x9f18('0xb6')]['upsert'](_0xbec7ee);});return Promise['all'](_0x3d1f95);}}}})[_0x9f18('0x40')](function(){if(_0x5d17c7){return db[_0x9f18('0x107')][_0x9f18('0x57')]({'where':{'membername':_0x5d17c7[_0x9f18('0x42')],'exitAt':null}});}})[_0x9f18('0x40')](function(_0x42537f){if(_0x5d17c7){var _0x14df00=[];_0x42537f[_0x9f18('0x108')](function(_0x565079){_0x14df00[_0x9f18('0x56')](_0x565079['update']({'exitAt':moment()[_0x9f18('0xb4')](_0x9f18('0x109'))}));});return Promise[_0x9f18('0x92')](_0x14df00);}})['then'](function(){if(_0x5d17c7){var _0x187535=[];var _0x105cbc=[];var _0x5aae2a=utils[_0x9f18('0x10a')]();var _0x326125={'membername':_0x5d17c7['name'],'interface':_0x44d284,'enterAt':moment()[_0x9f18('0xb4')](_0x9f18('0x109')),'role':_0x5d17c7[_0x9f18('0x2e')],'internal':_0x5d17c7[_0x9f18('0x6b')]};_0x5aae2a['forEach'](function(_0x49d093){_0x187535[_0x9f18('0x56')](_['merge']({'channel':_0x49d093,'type':_0x9f18('0x10b'),'data1':_0x562854[_0x9f18('0x66')][_0x9f18('0x10c')],'data2':_0x44d284},_0x326125));if(_0x5d17c7[_0x9f18('0xa6')]){_0x105cbc[_0x9f18('0x56')](_['merge']({'channel':_0x49d093,'type':'PAUSE','data1':'LOGININPAUSE'},_0x326125));}});return db['MemberReport']['bulkCreate'](_0x187535[_0x9f18('0xd1')](_0x105cbc),{'individualHooks':!![]});}})[_0x9f18('0x40')](function(){if(_0x5d17c7){return _0x5d17c7['update']({'online':!![],'lastLoginAt':moment()[_0x9f18('0xb4')](_0x9f18('0x109')),'voicePause':_0x5d17c7['loginInPause']||![],'mailPause':_0x5d17c7[_0x9f18('0xa6')]||![],'chatPause':_0x5d17c7[_0x9f18('0xa6')]||![],'faxPause':_0x5d17c7[_0x9f18('0xa6')]||![],'smsPause':_0x5d17c7[_0x9f18('0xa6')]||![],'openchannelPause':_0x5d17c7[_0x9f18('0xa6')]||![],'whatsappPause':_0x5d17c7[_0x9f18('0xa6')]||![],'pauseType':_0x5d17c7[_0x9f18('0xa6')]?'LOGININPAUSE':null,'interface':_0x44d284,'lastPauseAt':moment()[_0x9f18('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x9f18('0x40')](function(_0x495a6d){if(_0x562854['isMiddleware']){return _0x200ab6();}else{return Promise[_0x9f18('0x10d')](_0x495a6d)[_0x9f18('0x40')](respondWithResult(_0x323b19,null));}})[_0x9f18('0x65')](handleError(_0x323b19,null));};exports[_0x9f18('0x10e')]=function(_0x20c55e,_0x4e486){var _0x415d72;return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x20c55e[_0x9f18('0x61')]['id'],'role':_0x9f18('0x2f')},'attributes':['id','name',_0x9f18('0x2e')]})['then'](handleEntityNotFound(_0x4e486,null))[_0x9f18('0x40')](function(_0x1a04f0){if(_0x1a04f0){_0x415d72=_0x1a04f0;return db['UserVoiceQueueRt'][_0x9f18('0x32')]({'where':{'membername':_0x415d72[_0x9f18('0x42')]},'individualHooks':!![]});}})[_0x9f18('0x40')](function(){return db[_0x9f18('0x107')][_0x9f18('0x57')]({'where':{'membername':_0x415d72[_0x9f18('0x42')],'exitAt':null}});})[_0x9f18('0x40')](function(_0x9ed86d){var _0x182659=[];_0x9ed86d[_0x9f18('0x108')](function(_0x52f8fb){_0x182659[_0x9f18('0x56')](_0x52f8fb['update']({'exitAt':moment()[_0x9f18('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x9f18('0x92')](_0x182659);})[_0x9f18('0x40')](function(){return _0x415d72[_0x9f18('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x4e486,null))[_0x9f18('0x65')](handleError(_0x4e486,null));};exports[_0x9f18('0x10f')]=function(_0x898d39,_0x27d614){var _0x3c80bc;return db[_0x9f18('0xb6')][_0x9f18('0x2d')]({'paused':0x1},{'where':{'UserId':_0x898d39[_0x9f18('0x61')]['id']},'individualHooks':!![]})[_0x9f18('0x40')](function(){return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x898d39[_0x9f18('0x61')]['id'],'role':_0x9f18('0x2f')},'attributes':['id','name',_0x9f18('0x2e'),'internal',_0x9f18('0xb3'),'online']});})['then'](handleEntityNotFound(_0x27d614,null))[_0x9f18('0x40')](function(_0x5ecc93){if(_0x5ecc93){_0x3c80bc=_0x5ecc93;return respondWithRpcPromise('QueuePause','pause',{'id':_0x3c80bc['id'],'name':_0x3c80bc[_0x9f18('0x42')],'pause':!![]});}})[_0x9f18('0x40')](function(){if(_0x3c80bc){return db[_0x9f18('0x107')]['findAll']({'where':{'membername':_0x3c80bc[_0x9f18('0x42')],'type':_0x9f18('0x110'),'exitAt':null}});}})[_0x9f18('0x40')](function(_0x3a14ec){if(_0x3a14ec[_0x9f18('0x5a')]){var _0x1f7641=moment()[_0x9f18('0xb4')](_0x9f18('0x109'));for(var _0x5dabae=0x0,_0x3df9ec=_0x3a14ec[_0x9f18('0x5a')];_0x5dabae<_0x3df9ec;_0x5dabae++){_0x3a14ec[_0x5dabae][_0x9f18('0x111')]({'exitAt':_0x1f7641});}}})['then'](function(){var _0x178609=[];var _0x103884=utils[_0x9f18('0x10a')]();_0x103884[_0x9f18('0x108')](function(_0x3fc709){_0x178609[_0x9f18('0x56')]({'channel':_0x3fc709,'membername':_0x3c80bc['name'],'interface':_[_0x9f18('0x70')](_0x3c80bc[_0x9f18('0xb3')])?util[_0x9f18('0xb4')]('SIP/%s',_0x3c80bc['name']):_0x3c80bc[_0x9f18('0xb3')],'type':_0x9f18('0x110'),'enterAt':moment()[_0x9f18('0xb4')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x898d39[_0x9f18('0x66')][_0x9f18('0x46')]||_0x9f18('0x112'),'role':_0x3c80bc['role'],'internal':_0x3c80bc[_0x9f18('0x6b')]});});return db[_0x9f18('0x107')]['bulkCreate'](_0x178609,{'individualHooks':!![]});})['then'](function(){return _0x3c80bc[_0x9f18('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x898d39[_0x9f18('0x66')][_0x9f18('0x46')]||_0x9f18('0x112'),'lastPauseAt':moment()[_0x9f18('0xb4')](_0x9f18('0x109'))});})[_0x9f18('0x40')](respondWithResult(_0x27d614,null))['catch'](handleError(_0x27d614,null));};exports[_0x9f18('0x113')]=function(_0x52f90d,_0x55fcb5){if(_0x52f90d[_0x9f18('0x66')][_0x9f18('0xa4')]&&!utils['isValidChannel'](_0x52f90d[_0x9f18('0x66')]['channel'])){throw new APIBadRequestError(util[_0x9f18('0xb4')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x52f90d[_0x9f18('0x66')][_0x9f18('0xa4')]));}return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x52f90d[_0x9f18('0x61')]['id']},'attributes':['id','name',_0x9f18('0x2e'),'internal','interface',_0x9f18('0xa5'),_0x9f18('0x114'),_0x9f18('0x115'),_0x9f18('0x116'),'faxPause',_0x9f18('0x117'),_0x9f18('0x118'),_0x9f18('0x119'),_0x9f18('0x11a'),_0x9f18('0x11b')]})['then'](function(_0x37d8d8){if(!_0x37d8d8){throw new APINotFoundError(util[_0x9f18('0xb4')](_0x9f18('0x11c'),_0x52f90d[_0x9f18('0x61')]['id']));}return _0x37d8d8['unpause'](_0x52f90d[_0x9f18('0x66')]['channel']);})[_0x9f18('0x40')](respondWithResult(_0x55fcb5,null))[_0x9f18('0x65')](APIHandleError(_0x55fcb5));};exports[_0x9f18('0x11d')]=function(_0x5cd55a,_0x29318e){var _0xb63fe5={};var _0x52bbb2={};var _0x5bd9c9;var _0xd340c4;return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x5cd55a[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x29318e,null))[_0x9f18('0x40')](function(_0x32530d){if(_0x32530d){_0x5bd9c9=_0x32530d;_0x52bbb2[_0x9f18('0xda')]=_['keys'](db['Team'][_0x9f18('0x44')]);_0x52bbb2['query']=_['keys'](_0x5cd55a['query']);_0x52bbb2[_0x9f18('0xdd')]=_['intersection'](_0x52bbb2[_0x9f18('0xda')],_0x52bbb2[_0x9f18('0x50')]);_0xb63fe5[_0x9f18('0x55')]=_['intersection'](_0x52bbb2[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x5cd55a[_0x9f18('0x50')][_0x9f18('0xdf')]));_0xb63fe5['attributes']=_0xb63fe5[_0x9f18('0x55')][_0x9f18('0x5a')]?_0xb63fe5[_0x9f18('0x55')]:_0x52bbb2[_0x9f18('0xda')];_0xb63fe5[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x5cd55a[_0x9f18('0x50')][_0x9f18('0xe1')]);_0xb63fe5[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x5cd55a[_0x9f18('0x50')],_0x52bbb2[_0x9f18('0xdd')]));if(_0x5cd55a['query'][_0x9f18('0x39')]){_0xb63fe5['where']=_[_0x9f18('0x63')](_0xb63fe5[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0xb63fe5[_0x9f18('0x55')],function(_0x26720e){var _0x10e096={};_0x10e096[_0x26720e]={'$like':'%'+_0x5cd55a[_0x9f18('0x50')]['filter']+'%'};return _0x10e096;})});}_0xb63fe5=_[_0x9f18('0x63')]({},_0xb63fe5,_0x5cd55a[_0x9f18('0x64')]);return _0x5bd9c9['getTeams'](_0xb63fe5);}})[_0x9f18('0x40')](function(_0x516ea6){if(_0x516ea6){_0xd340c4=_0x516ea6['length'];if(!_0x5cd55a[_0x9f18('0x50')][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0xb63fe5[_0x9f18('0x20')]=qs['limit'](_0x5cd55a[_0x9f18('0x50')][_0x9f18('0x20')]);_0xb63fe5[_0x9f18('0x1d')]=qs['offset'](_0x5cd55a['query'][_0x9f18('0x1d')]);}return _0x5bd9c9[_0x9f18('0x11d')](_0xb63fe5);}})[_0x9f18('0x40')](function(_0x2520ad){if(_0x2520ad){return _0x2520ad?{'count':_0xd340c4,'rows':_0x2520ad}:null;}})[_0x9f18('0x40')](respondWithResult(_0x29318e,null))['catch'](handleError(_0x29318e,null));};exports[_0x9f18('0x11e')]=function(_0xc977f6,_0x40bc5c){var _0x4ca238=_0xc977f6[_0x9f18('0x61')]['id'];var _0x20d6d6=_0xc977f6['body']?_0xc977f6[_0x9f18('0x66')][_0x9f18('0x69')]:null;var _0x70f0bb=[];return Promise[_0x9f18('0x10d')]()[_0x9f18('0x40')](function(){if(!_0x20d6d6)throw new APIBadRequestError(_0x9f18('0x11f'));})[_0x9f18('0x40')](function(){return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x4ca238}});})['then'](function(_0x3ef9ec){if(!_0x3ef9ec)throw new APINotFoundError(util[_0x9f18('0xb4')]('User\x20with\x20id\x20%s\x20not\x20found',_0xc977f6['params']['id']));return db[_0x9f18('0x120')][_0x9f18('0x121')](function(_0x3a489a){return _0x3ef9ec[_0x9f18('0x11e')](_0x20d6d6,{'transaction':_0x3a489a})[_0x9f18('0x40')](function(){return db[_0x9f18('0x122')][_0x9f18('0x57')]({'where':{'id':{'$in':_0x20d6d6}}});})[_0x9f18('0x40')](function(_0x41e465){var _0x1f3f97=_[_0x9f18('0x3b')](_0x41e465,function(_0x260537){return _0x260537[_0x9f18('0x123')]();});return Promise[_0x9f18('0x92')](_0x1f3f97);})[_0x9f18('0x40')](function(_0x534681){_0x70f0bb=_[_0x9f18('0x124')](_0x534681);var _0x408799=_[_0x9f18('0x3b')](_0x70f0bb,function(_0x7036cb){return _0x7036cb[_0x9f18('0x125')](_0x3ef9ec['id'],{'transaction':_0x3a489a});});return Promise['all'](_0x408799);})['then'](function(){if(!_0x3ef9ec[_0x9f18('0xa5')])return;var _0xa112d8=_[_0x9f18('0x39')](_0x70f0bb,function(_0x446359){return _0x446359[_0x9f18('0x126')](_0x9f18('0xa4'))===_0x9f18('0x127');});var _0x1a95de=_['map'](_0xa112d8,function(_0xbccab3){return db['UserVoiceQueueRt'][_0x9f18('0x128')]({'membername':_0x3ef9ec[_0x9f18('0x42')],'UserId':_0x3ef9ec['id'],'queue_name':_0xbccab3[_0x9f18('0x42')],'VoiceQueueId':_0xbccab3['id'],'interface':_[_0x9f18('0x70')](_0x3ef9ec['interface'])?util[_0x9f18('0xb4')](_0x9f18('0xb5'),_0x3ef9ec[_0x9f18('0x42')]):_0x3ef9ec[_0x9f18('0xb3')],'paused':_0x3ef9ec[_0x9f18('0x114')]||![],'penalty':_0x3ef9ec[_0x9f18('0xab')]},{'transaction':_0x3a489a});});return Promise['all'](_0x1a95de);})['then'](function(){return db[_0x9f18('0x129')][_0x9f18('0x57')]({'where':{'teamId':{'$in':_0x20d6d6}}});})[_0x9f18('0x40')](function(_0x3db6c5){var _0x257d64=_[_0x9f18('0x3b')](_0x3db6c5,function(_0xc6fd5){return db[_0x9f18('0x12a')][_0x9f18('0x89')]({'UserId':_0x3ef9ec['id'],'VoicePrefixId':_0xc6fd5[_0x9f18('0x12b')]},{'transaction':_0x3a489a});});return Promise[_0x9f18('0x92')](_0x257d64);});});})[_0x9f18('0x40')](function(){for(var _0x16844d=0x0;_0x16844d<_0x70f0bb[_0x9f18('0x5a')];_0x16844d++){var _0x4479a3=_0x70f0bb[_0x16844d][_0x9f18('0x126')](_0x9f18('0xa4'));var _0x25b322=_0x4479a3+_0x9f18('0xad');socket[_0x9f18('0x30')]('user'+_0x4479a3+_0x9f18('0xb0'),{'UserId':_0x4ca238,['queueField']:_0x70f0bb[_0x16844d]['id']});}})[_0x9f18('0x40')](respondWithStatusCode(_0x40bc5c,null))[_0x9f18('0x65')](APIHandleError(_0x40bc5c));};exports[_0x9f18('0x12c')]=function(_0xa0999b,_0x748457){var _0x3549b7=_0xa0999b['params']['id'];var _0x3d42f5=null;if(_0xa0999b[_0x9f18('0x50')][_0x9f18('0x69')]){_0x3d42f5=_[_0x9f18('0xb9')](_0xa0999b[_0x9f18('0x50')][_0x9f18('0x69')])?_0xa0999b['query'][_0x9f18('0x69')]:[_0xa0999b[_0x9f18('0x50')]['ids']];}var _0x14adc0=[];return Promise['resolve']()[_0x9f18('0x40')](function(){if(!_0x3d42f5)throw new APIBadRequestError(_0x9f18('0x12d'));})[_0x9f18('0x40')](function(){return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x3549b7}});})[_0x9f18('0x40')](function(_0x52e58a){if(!_0x52e58a)throw new APINotFoundError(util[_0x9f18('0xb4')](_0x9f18('0x11c'),_0xa0999b[_0x9f18('0x61')]['id']));return db[_0x9f18('0x120')]['transaction'](function(_0x8ff892){return _0x52e58a['removeTeams'](_0x3d42f5,{'transaction':_0x8ff892})[_0x9f18('0x40')](function(){return db[_0x9f18('0x122')][_0x9f18('0x57')]({'where':{'id':{'$in':_0x3d42f5}}});})[_0x9f18('0x40')](function(_0x2822bf){var _0x47ad0f=_[_0x9f18('0x3b')](_0x2822bf,function(_0x41dd2a){return _0x41dd2a['getAssociatedQueues']();});return Promise[_0x9f18('0x92')](_0x47ad0f);})[_0x9f18('0x40')](function(_0x121f5d){_0x14adc0=_[_0x9f18('0x124')](_0x121f5d);var _0x3c0269=_[_0x9f18('0x3b')](_0x14adc0,function(_0x3923de){return _0x3923de['removeAgent'](_0x52e58a['id'],{'transaction':_0x8ff892});});return Promise[_0x9f18('0x92')](_0x3c0269);})['then'](function(){if(!_0x52e58a[_0x9f18('0xa5')])return;var _0x1effaf=_['filter'](_0x14adc0,function(_0x5b931b){return _0x5b931b[_0x9f18('0x126')](_0x9f18('0xa4'))==='Voice';});var _0x5f21b2=_['map'](_0x1effaf,function(_0x344302){return db[_0x9f18('0xb6')][_0x9f18('0x32')]({'where':{'VoiceQueueId':_0x344302['id'],'UserId':_0x52e58a['id']},'transaction':_0x8ff892});});return Promise[_0x9f18('0x92')](_0x5f21b2);})[_0x9f18('0x40')](function(){return db[_0x9f18('0x129')]['findAll']({'where':{'teamId':{'$in':_0x3d42f5}}});})['then'](function(_0xa10e5a){var _0xbb3f6a=_['map'](_0xa10e5a,function(_0x27154a){return db[_0x9f18('0x12a')]['destroy']({'where':{'UserId':_0x52e58a['id'],'VoicePrefixId':_0x27154a['VoicePrefixId']}},{'transaction':_0x8ff892});});return Promise[_0x9f18('0x92')](_0xbb3f6a);});});})['then'](function(){for(var _0x275d10=0x0;_0x275d10<_0x14adc0[_0x9f18('0x5a')];_0x275d10++){var _0x27760d=_0x14adc0[_0x275d10][_0x9f18('0x126')](_0x9f18('0xa4'));var _0x5894b0=_0x27760d+_0x9f18('0xad');socket[_0x9f18('0x30')]('user'+_0x27760d+_0x9f18('0xba'),{'UserId':_0x3549b7,['queueField']:_0x14adc0[_0x275d10]['id']});}})[_0x9f18('0x40')](respondWithStatusCode(_0x748457,null))['catch'](APIHandleError(_0x748457));};exports[_0x9f18('0x12e')]=function(_0x5ae3d3,_0x1496c2){var _0x114dae={};var _0x32aa6b={};var _0x10c152;var _0xd3a92e;return db['User'][_0x9f18('0x9f')]({'where':{'id':_0x5ae3d3['params']['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x1496c2,null))['then'](function(_0x5a480f){if(_0x5a480f){_0x10c152=_0x5a480f;_0x32aa6b[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0xd4')][_0x9f18('0x44')]);_0x32aa6b[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x5ae3d3[_0x9f18('0x50')]);_0x32aa6b['filters']=_[_0x9f18('0xde')](_0x32aa6b['model'],_0x32aa6b[_0x9f18('0x50')]);_0x114dae[_0x9f18('0x55')]=_[_0x9f18('0xde')](_0x32aa6b[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x5ae3d3['query'][_0x9f18('0xdf')]));_0x114dae[_0x9f18('0x55')]=_0x114dae[_0x9f18('0x55')][_0x9f18('0x5a')]?_0x114dae[_0x9f18('0x55')]:_0x32aa6b[_0x9f18('0xda')];_0x114dae[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x5ae3d3[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x114dae[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x5ae3d3['query'],_0x32aa6b[_0x9f18('0xdd')]));if(_0x5ae3d3[_0x9f18('0x50')][_0x9f18('0x39')]){_0x114dae[_0x9f18('0x4f')]=_['merge'](_0x114dae[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x114dae[_0x9f18('0x55')],function(_0x481cf9){var _0x1dff32={};_0x1dff32[_0x481cf9]={'$like':'%'+_0x5ae3d3['query'][_0x9f18('0x39')]+'%'};return _0x1dff32;})});}_0x114dae=_[_0x9f18('0x63')]({},_0x114dae,_0x5ae3d3['options']);return _0x10c152['getLists'](_0x114dae);}})[_0x9f18('0x40')](function(_0x2876ef){if(_0x2876ef){_0xd3a92e=_0x2876ef['length'];if(!_0x5ae3d3['query'][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x114dae[_0x9f18('0x20')]=qs[_0x9f18('0x20')](_0x5ae3d3['query'][_0x9f18('0x20')]);_0x114dae[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x5ae3d3[_0x9f18('0x50')][_0x9f18('0x1d')]);}return _0x10c152[_0x9f18('0x12e')](_0x114dae);}})['then'](function(_0xccbdd0){if(_0xccbdd0){return _0xccbdd0?{'count':_0xd3a92e,'rows':_0xccbdd0}:null;}})[_0x9f18('0x40')](respondWithResult(_0x1496c2,null))['catch'](handleError(_0x1496c2,null));};exports['getAgents']=function(_0x5f24a0,_0x200359){var _0x1ee95f={};var _0xa9e86b={};var _0x442d58;return db[_0x9f18('0x43')]['findOne']({'where':{'id':_0x5f24a0[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x200359,null))[_0x9f18('0x40')](function(_0x5f3e96){if(_0x5f3e96){_0x442d58=_0x5f3e96;_0xa9e86b[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0x43')][_0x9f18('0x44')]);_0xa9e86b['query']=_[_0x9f18('0xdb')](_0x5f24a0['query']);_0xa9e86b['filters']=_['intersection'](_0xa9e86b[_0x9f18('0xda')],_0xa9e86b['query']);_0x1ee95f[_0x9f18('0x55')]=_['intersection'](_0xa9e86b[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x5f24a0[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x1ee95f[_0x9f18('0x55')]=_0x1ee95f['attributes']['length']?_0x1ee95f[_0x9f18('0x55')]:_0xa9e86b['model'];_0x1ee95f[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x5f24a0['query'][_0x9f18('0xe1')]);_0x1ee95f[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x5f24a0[_0x9f18('0x50')],_0xa9e86b[_0x9f18('0xdd')]));if(_0x5f24a0[_0x9f18('0x50')]['filter']){_0x1ee95f[_0x9f18('0x4f')]=_['merge'](_0x1ee95f[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x1ee95f[_0x9f18('0x55')],function(_0x3707fc){var _0x48da79={};_0x48da79[_0x3707fc]={'$like':'%'+_0x5f24a0[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x48da79;})});}_0x1ee95f[_0x9f18('0xda')]=db[_0x9f18('0x43')];_0x1ee95f['as']=_0x9f18('0x37');_0x1ee95f=_['merge']({},_0x1ee95f,_0x5f24a0[_0x9f18('0x64')]);return _0x442d58['getVoiceQueues']({'include':[_0x1ee95f]});}})[_0x9f18('0x40')](function(_0x32aee9){if(_0x32aee9){var _0x3ea597={},_0x3cb16b=[];for(var _0x58f517=0x0;_0x58f517<_0x32aee9[_0x9f18('0x5a')];_0x58f517+=0x1){for(var _0x3747c8=0x0,_0xefeb0d;_0x3747c8<_0x32aee9[_0x58f517][_0x9f18('0x37')][_0x9f18('0x5a')];_0x3747c8+=0x1){_0xefeb0d=_0x32aee9[_0x58f517][_0x9f18('0x37')][_0x3747c8][_0x9f18('0x33')]({'plain':!![]});_0x3ea597[_0xefeb0d['id']]=_0xefeb0d;}}_0x3ea597=_[_0x9f18('0x12f')](_0x3ea597);for(var _0x1eaa04=qs[_0x9f18('0x1d')](_0x5f24a0[_0x9f18('0x50')][_0x9f18('0x1d')]);_0x1eaa04<_0x3ea597['length']&&_0x3cb16b[_0x9f18('0x5a')]=_0x47eeaf){_0x40c1eb=_0x47eeaf;_0x400903=0xc8;}else{_0x400903=0xce;}_0x3134d4[_0x9820('0x13')](_0x400903);return _0x3134d4['set'](_0x9820('0x1a'),_0x2b115b+'-'+_0x40c1eb+'/'+_0x47eeaf)[_0x9820('0x15')](_0x435ffe);}return null;};}function respondWithRpcPromise(_0x57e6d,_0x533e7f,_0x556e6d,_0x151bab){return new Promise(function(_0x26046c,_0x3f1777){var _0x465cf3=_0x151bab||amiClient;return _0x465cf3['request'](_0x57e6d,_0x556e6d)[_0x9820('0x1b')](function(_0x2b82e3){logger[_0x9820('0x1c')]('User,\x20%s,\x20%s',_0x533e7f,_0x9820('0x1d'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x533e7f,_0x9820('0x1d'),JSON[_0x9820('0x1e')](_0x2b82e3));if(_0x2b82e3[_0x9820('0x1f')]){if(_0x2b82e3[_0x9820('0x1f')][_0x9820('0x20')]===0x1f4){logger[_0x9820('0x1f')](_0x9820('0x21'),_0x533e7f,_0x2b82e3[_0x9820('0x1f')][_0x9820('0x22')]);return _0x3f1777(_0x2b82e3[_0x9820('0x1f')][_0x9820('0x22')]);}logger[_0x9820('0x1f')]('User,\x20%s,\x20%s',_0x533e7f,_0x2b82e3['error'][_0x9820('0x22')]);return _0x26046c(_0x2b82e3['error'][_0x9820('0x22')]);}else{logger['info'](_0x9820('0x21'),_0x533e7f,_0x9820('0x1d'));_0x26046c(_0x2b82e3[_0x9820('0x23')][_0x9820('0x22')]);}})['catch'](function(_0xcf3507){logger[_0x9820('0x1f')](_0x9820('0x21'),_0x533e7f,_0xcf3507);_0x3f1777(_0xcf3507);});});}function saveUpdates(_0x47a449){return function(_0x409955){if(_0x409955){return _0x409955[_0x9820('0x24')](_0x47a449)[_0x9820('0x1b')](function(_0x7c8994){if(_0x7c8994[_0x9820('0x25')]===_0x9820('0x26')){socket['emit'](_0x9820('0x27')+_0x7c8994['id'],_0x7c8994);}return _0x7c8994;});}return null;};}function removeEntity(_0x1585bd,_0x57f11e){return function(_0x5137be){if(_0x5137be){return _0x5137be[_0x9820('0x28')]({'transaction':_0x57f11e})[_0x9820('0x1b')](function(){var _0x5575eb=_0x5137be[_0x9820('0x29')]({'plain':!![]});if(_0x5575eb['role']==='admin')return;var _0xa61374=[{'name':_0x9820('0x2a'),'value':_0x9820('0x2b'),'ignore':!![]},{'name':_0x9820('0x2c'),'value':_0x9820('0x26'),'ignore':![]},{'name':'Telephones','value':_0x9820('0x2d'),'ignore':![]}];var _0x58f3d1=_(_0xa61374)[_0x9820('0x2e')](_0x9820('0x2f'))[_0x9820('0x30')](_0x9820('0x31'))['value']();if(_[_0x9820('0x32')](_0x58f3d1,_0x5575eb[_0x9820('0x25')])){return;}var _0x11ef53=_[_0x9820('0x33')](_0xa61374,[_0x9820('0x31'),_0x5575eb[_0x9820('0x25')]])[_0x9820('0x34')];return db[_0x9820('0x35')][_0x9820('0x28')]({'where':{'type':_0x11ef53,'resourceId':_0x5575eb['id']},'transaction':_0x57f11e})[_0x9820('0x1b')](function(){return _0x5137be;});})[_0x9820('0x1b')](function(){_0x1585bd[_0x9820('0x13')](0xcc)[_0x9820('0x14')]();});}};}function handleEntityNotFound(_0xe67485){return function(_0x4c4cc9){if(!_0x4c4cc9){_0xe67485['sendStatus'](0x194);}return _0x4c4cc9;};}function handleError(_0x284ba4,_0x2e36b5){_0x2e36b5=_0x2e36b5||0x1f4;return function(_0x2940ea){logger[_0x9820('0x1f')](_0x2940ea[_0x9820('0x36')]);if(_0x2940ea[_0x9820('0x34')]){delete _0x2940ea['name'];}_0x284ba4[_0x9820('0x13')](_0x2e36b5)['send'](_0x2940ea);};}function getUserAttributes(){return _(db[_0x9820('0x37')]['rawAttributes'])[_0x9820('0x30')](function(_0x2a6a15){return{'name':_0x2a6a15[_0x9820('0x38')],'type':_0x2a6a15[_0x9820('0x39')][_0x9820('0x3a')]};})[_0x9820('0x2e')](function(_0x38d6a8){return![_0x9820('0x3b'),_0x9820('0x3c'),_0x9820('0x3d'),_0x9820('0x3e'),_0x9820('0x3f'),_0x9820('0x40')][_0x9820('0x32')](_0x38d6a8[_0x9820('0x34')]);})['value']();}exports[_0x9820('0x41')]=function(_0x2bd4b3,_0x3dd128){var _0x342a1e={},_0x1a5c62={'count':0x0,'rows':[]};var _0x39bc8e=getUserAttributes();_0x342a1e=qs[_0x9820('0x42')](_0x39bc8e,_0x2bd4b3);var _0x30559f={'where':_0x342a1e[_0x9820('0x43')]};return db[_0x9820('0x37')][_0x9820('0x18')](_0x30559f)[_0x9820('0x1b')](function(_0x374909){_0x1a5c62[_0x9820('0x18')]=_0x374909;if(_0x2bd4b3[_0x9820('0x44')]['includeAll']){_0x342a1e[_0x9820('0x45')]=[{'all':!![]}];}if(_0x2bd4b3['query'][_0x9820('0x46')]==='true'){_0x342a1e[_0x9820('0x45')]=[{'model':db[_0x9820('0x47')],'as':_0x9820('0x46')}];}if(!_[_0x9820('0x32')](_0x342a1e['attributes'],'id')){_0x342a1e[_0x9820('0x48')][_0x9820('0x49')]('id');}return db[_0x9820('0x37')][_0x9820('0x4a')](_0x342a1e);})[_0x9820('0x1b')](function(_0x417818){_0x1a5c62[_0x9820('0x4b')]=_0x417818;if(_0x2bd4b3[_0x9820('0x44')][_0x9820('0x4c')]===_0x9820('0x4d')){var _0x292cce=[];for(var _0xe45762=0x0;_0xe45762<_0x1a5c62[_0x9820('0x4b')][_0x9820('0x4e')];_0xe45762++){_0x292cce[_0x9820('0x49')](get_open_tabs(_0x9820('0x4f'),_0x1a5c62[_0x9820('0x4b')][_0xe45762][_0x9820('0x50')]));_0x292cce[_0x9820('0x49')](get_open_tabs(_0x9820('0x51'),_0x1a5c62['rows'][_0xe45762][_0x9820('0x50')]));_0x292cce['push'](get_open_tabs(_0x9820('0x52'),_0x1a5c62['rows'][_0xe45762][_0x9820('0x50')]));_0x292cce[_0x9820('0x49')](get_open_tabs(_0x9820('0x53'),_0x1a5c62['rows'][_0xe45762]['dataValues']));_0x292cce['push'](get_open_tabs(_0x9820('0x54'),_0x1a5c62[_0x9820('0x4b')][_0xe45762][_0x9820('0x50')]));_0x292cce[_0x9820('0x49')](get_open_tabs(_0x9820('0x55'),_0x1a5c62['rows'][_0xe45762][_0x9820('0x50')]));}return Promise[_0x9820('0x56')](_0x292cce)[_0x9820('0x1b')](function(){return _0x1a5c62;});}else{return _0x1a5c62;}})[_0x9820('0x1b')](respondWithFilteredResult(_0x3dd128,_0x342a1e))[_0x9820('0x57')](handleError(_0x3dd128,null));};exports[_0x9820('0x58')]=function(_0x551bdd,_0x4f5390){var _0x5d633e=getUserAttributes();_0x551bdd[_0x9820('0x44')]['id']=_0x551bdd[_0x9820('0x59')]['id'];var _0x8f5fb5=qs[_0x9820('0x42')](_0x5d633e,_0x551bdd);if(_0x551bdd['query'][_0x9820('0x5a')]){_0x8f5fb5[_0x9820('0x45')]=[{'all':!![]}];}if(_0x551bdd[_0x9820('0x44')][_0x9820('0x46')]===_0x9820('0x4d')){_0x8f5fb5[_0x9820('0x45')]=[{'model':db[_0x9820('0x47')],'as':_0x9820('0x46')}];}_0x8f5fb5=_[_0x9820('0x5b')]({},_0x8f5fb5,_0x551bdd[_0x9820('0x5c')]);if(!_[_0x9820('0x32')](_0x8f5fb5[_0x9820('0x48')],'id')){_0x8f5fb5[_0x9820('0x48')][_0x9820('0x49')]('id');}return db[_0x9820('0x37')][_0x9820('0x33')](_0x8f5fb5)[_0x9820('0x1b')](handleEntityNotFound(_0x4f5390,null))['then'](function(_0x979084){var _0x2919ae=[];values=_0x979084;if(_0x551bdd[_0x9820('0x44')]['openTabs']===_0x9820('0x4d')){_0x2919ae[_0x9820('0x49')](get_open_tabs(_0x9820('0x4f'),_0x979084[_0x9820('0x50')]));_0x2919ae[_0x9820('0x49')](get_open_tabs('sms',_0x979084[_0x9820('0x50')]));_0x2919ae[_0x9820('0x49')](get_open_tabs(_0x9820('0x54'),_0x979084['dataValues']));_0x2919ae[_0x9820('0x49')](get_open_tabs(_0x9820('0x55'),_0x979084[_0x9820('0x50')]));_0x2919ae[_0x9820('0x49')](get_open_tabs('fax',_0x979084[_0x9820('0x50')]));_0x2919ae['push'](get_open_tabs(_0x9820('0x53'),_0x979084[_0x9820('0x50')]));return Promise['all'](_0x2919ae);}else{return values;}})[_0x9820('0x1b')](function(){return values;})[_0x9820('0x1b')](respondWithResult(_0x4f5390,null))[_0x9820('0x57')](handleError(_0x4f5390,null));};exports[_0x9820('0x24')]=function(_0x3e0139,_0x36a41f){if(_0x3e0139[_0x9820('0x5d')]['id']){delete _0x3e0139['body']['id'];}delete _0x3e0139['body']['role'];return db[_0x9820('0x37')][_0x9820('0x33')]({'where':{'id':_0x3e0139[_0x9820('0x59')]['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0x36a41f,null))['then'](saveUpdates(_0x3e0139[_0x9820('0x5d')],null))[_0x9820('0x1b')](respondWithResult(_0x36a41f,null))[_0x9820('0x57')](handleError(_0x36a41f,null));};exports[_0x9820('0x5e')]=function(_0x3bf2e5,_0x5d0350){return db[_0x9820('0x37')][_0x9820('0x5e')]()[_0x9820('0x1b')](respondWithResult(_0x5d0350,null))[_0x9820('0x57')](handleError(_0x5d0350,null));};exports[_0x9820('0x5f')]=function(_0x5ab9c1,_0x135c87){return db[_0x9820('0x37')]['find']({'where':{'id':_0x5ab9c1['params']['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0x135c87,null))[_0x9820('0x1b')](function(_0x31be9f){if(_0x31be9f){return _0x31be9f['addContacts'](_0x5ab9c1[_0x9820('0x5d')][_0x9820('0x60')],_[_0x9820('0x61')](_0x5ab9c1[_0x9820('0x5d')],['ids','id'])||{});}})[_0x9820('0x1b')](respondWithResult(_0x135c87,null))[_0x9820('0x57')](handleError(_0x135c87,null));};function validateUser(_0x5de973){return new Promise(function(_0x23bf1c,_0x169353){if(_0x5de973[_0x9820('0x62')])return _0x23bf1c(_0x5de973);return db[_0x9820('0x63')]['findById'](0x1)['then'](function(_0x2ac09b){if(_0x2ac09b[_0x9820('0x64')])authService[_0x9820('0x65')](_0x5de973[_0x9820('0x3b')]);db[_0x9820('0x37')]['max'](_0x9820('0x62'))[_0x9820('0x1b')](function(_0x40961a){if(_['isNil'](_0x40961a)){_0x5de973[_0x9820('0x62')]=_0x2ac09b[_0x9820('0x66')]||0x1;return;}if(_['isNil'](_0x2ac09b[_0x9820('0x66')])||_0x2ac09b[_0x9820('0x66')]===_0x40961a){_0x5de973[_0x9820('0x62')]=_0x40961a+0x1;return;}if(_0x2ac09b['min_internal']>_0x40961a){_0x5de973[_0x9820('0x62')]=_0x2ac09b[_0x9820('0x66')];return;}return db[_0x9820('0x67')][_0x9820('0x44')](_0x9820('0x68'),{'type':db[_0x9820('0x67')]['QueryTypes'][_0x9820('0x69')]})[_0x9820('0x1b')](function(_0x23e056){if(_0x23e056&&_0x23e056[_0x9820('0x4e')]){for(var _0x3b10bc=0x0,_0x37b7a3=_0x23e056['length'];_0x3b10bc<_0x37b7a3&&_['isNil'](_0x5de973['internal']);_0x3b10bc++){if(_0x2ac09b[_0x9820('0x66')]<=_0x23e056[_0x3b10bc][_0x9820('0x6a')]){_0x5de973[_0x9820('0x62')]=_0x23e056[_0x3b10bc]['from'];}else if(_0x2ac09b[_0x9820('0x66')]>_0x23e056[_0x3b10bc]['from']&&_0x2ac09b['min_internal']<=_0x23e056[_0x3b10bc]['to']){_0x5de973['internal']=_0x2ac09b[_0x9820('0x66')];}}}if(_[_0x9820('0x6b')](_0x5de973['internal'])){_0x5de973['internal']=_0x40961a+0x1;}return _0x23bf1c(_0x5de973);});});})[_0x9820('0x57')](function(_0x4e6b6e){_0x169353(_0x4e6b6e);});});}function updateUser(_0x478dc0){return new Promise(function(_0x1f5064,_0x2c17b8){try{if(_0x478dc0[_0x9820('0x6c')]){_0x478dc0['mailbox']=_0x478dc0[_0x9820('0x62')];_0x478dc0[_0x9820('0x6d')]={'mailbox':_0x478dc0[_0x9820('0x62')],'password':_0x478dc0[_0x9820('0x3b')],'fullname':_0x478dc0[_0x9820('0x6e')],'email':_0x478dc0[_0x9820('0x6f')]};}if(_0x478dc0['role']===_0x9820('0x26')){if(!_0x478dc0[_0x9820('0x70')])_0x478dc0[_0x9820('0x70')]=[_0x9820('0x71'),_0x9820('0x72'),'103',_0x9820('0x73'),_0x9820('0x74'),_0x9820('0x75'),_0x9820('0x76'),_0x9820('0x77'),_0x9820('0x78'),_0x9820('0x79'),_0x9820('0x7a'),_0x9820('0x7b'),'111',_0x9820('0x7c'),_0x9820('0x7d')];}_0x1f5064(_0x478dc0);}catch(_0x2d962a){_0x2c17b8(_0x2d962a);}});}exports[_0x9820('0x7e')]=function(_0x4de93f,_0x5254bc){if(_0x4de93f[_0x9820('0x2b')][_0x9820('0x25')]===_0x9820('0x26'))throw new Error(_0x9820('0x7f'));if(_0x4de93f[_0x9820('0x5d')]['role']===_0x9820('0x2b')&&_0x4de93f[_0x9820('0x2b')][_0x9820('0x25')]!=='admin'){throw new Error(_0x9820('0x80'));}if(_0x4de93f[_0x9820('0x5d')][_0x9820('0x25')]===_0x9820('0x81')&&_0x4de93f['user'][_0x9820('0x25')]!==_0x9820('0x81')){throw new Error(_0x9820('0x82'));}return licenseUtil[_0x9820('0x83')]([_0x4de93f[_0x9820('0x5d')]])[_0x9820('0x1b')](function(){return validateUser(_0x4de93f[_0x9820('0x5d')]);})[_0x9820('0x1b')](function(_0x4f8b27){return updateUser(_0x4f8b27)[_0x9820('0x1b')](function(_0x1bcee1){if(_0x1bcee1[_0x9820('0x25')]===_0x9820('0x81')){_0x1bcee1[_0x9820('0x84')]=_0x4de93f[_0x9820('0x2b')]['settingsEnabled'];delete _0x1bcee1[_0x9820('0x85')];}return _0x1bcee1;});})[_0x9820('0x1b')](function(_0x2a0264){return db[_0x9820('0x37')][_0x9820('0x7e')](_0x2a0264,{'include':[{'model':db[_0x9820('0x6d')],'as':'VoiceMail'}]});})['then'](function(_0x126820){if(_0x4de93f[_0x9820('0x5d')]['role']===_0x9820('0x2b'))return _0x126820;if(_0x4de93f[_0x9820('0x2b')][_0x9820('0x25')]!==_0x9820('0x2b'))return _0x126820;return db[_0x9820('0x86')][_0x9820('0x33')]({'where':{'name':_0x126820[_0x9820('0x25')]===_0x9820('0x26')?_0x9820('0x2c'):_0x9820('0x87'),'userProfileId':_0x4de93f[_0x9820('0x2b')][_0x9820('0x85')]},'raw':!![]})[_0x9820('0x1b')](function(_0x2bceaa){if(!_0x2bceaa||_0x2bceaa[_0x9820('0x88')]!=0x0)return _0x126820;return db['UserProfileResource'][_0x9820('0x7e')]({'name':_0x126820[_0x9820('0x34')],'resourceId':_0x126820['id'],'type':_0x2bceaa[_0x9820('0x34')],'sectionId':_0x2bceaa['id']},{})['then'](function(){return _0x126820;});})[_0x9820('0x57')](function(_0xc24016){logger['error'](_0x9820('0x89'),_0xc24016);throw _0xc24016;});})[_0x9820('0x1b')](respondWithResult(_0x5254bc,0xc9))['catch'](handleError(_0x5254bc,null));};exports[_0x9820('0x8a')]=function(_0x342233,_0x47c274){var _0xbb4581=_0x342233['body'];var _0x1d7cd7=[];if(_0x342233[_0x9820('0x2b')][_0x9820('0x25')]===_0x9820('0x26'))throw new Error(_0x9820('0x7f'));if(_['some'](_0xbb4581,['role',_0x9820('0x2b')])&&_0x342233[_0x9820('0x2b')][_0x9820('0x25')]!==_0x9820('0x81')){throw new Error(_0x9820('0x80'));}if(_['some'](_0xbb4581,[_0x9820('0x25'),_0x9820('0x81')])&&_0x342233[_0x9820('0x2b')]['role']!==_0x9820('0x81')){throw new Error(_0x9820('0x8b'));}return licenseUtil[_0x9820('0x83')](_0xbb4581)[_0x9820('0x1b')](function(){return validateUser(_0xbb4581[0x0]);})['then'](function(){for(var _0x27c4ae=0x1;_0x27c4ae<_0xbb4581[_0x9820('0x4e')];_0x27c4ae++){var _0x3a0249=_0xbb4581[_0x27c4ae-0x1][_0x9820('0x62')];if(!_0xbb4581[_0x27c4ae][_0x9820('0x62')])_0xbb4581[_0x27c4ae][_0x9820('0x62')]=_0x3a0249+0x1;_0x1d7cd7[_0x9820('0x49')](validateUser(_0xbb4581[_0x27c4ae]));}return Promise[_0x9820('0x56')](_0x1d7cd7);})[_0x9820('0x1b')](function(){_0x1d7cd7=[];for(var _0x33817f=0x0;_0x33817f<_0xbb4581[_0x9820('0x4e')];_0x33817f++){_0x1d7cd7[_0x9820('0x49')](updateUser(_0xbb4581[_0x33817f]));}return Promise[_0x9820('0x56')](_0x1d7cd7);})[_0x9820('0x1b')](function(){_0x1d7cd7=_0xbb4581[_0x9820('0x30')](function(_0x9acf55){return db[_0x9820('0x37')]['create'](_0x9acf55,{'include':[{'model':db[_0x9820('0x6d')],'as':_0x9820('0x6d')}]})[_0x9820('0x1b')](function(_0x81babd){_0x9acf55['id']=_0x81babd['id'];return _0x9acf55;});});return Promise['all'](_0x1d7cd7);})[_0x9820('0x1b')](function(_0x1648e4){if(_0x342233[_0x9820('0x5d')][_0x9820('0x25')]===_0x9820('0x2b'))return _0x1648e4;if(_0x342233[_0x9820('0x2b')][_0x9820('0x25')]!==_0x9820('0x2b'))return _0x1648e4;var _0x259462=_[_0x9820('0x8c')](_0x1648e4,function(_0x57dec4){return _0x57dec4[_0x9820('0x25')]===_0x9820('0x26')||_0x57dec4[_0x9820('0x25')]===_0x9820('0x2d');});if(!_0x259462)return _0x1648e4;return db[_0x9820('0x86')][_0x9820('0x4a')]({'where':{'name':{'$or':['Agents',_0x9820('0x87')]},'userProfileId':_0x342233[_0x9820('0x2b')][_0x9820('0x85')]},'raw':!![]})[_0x9820('0x1b')](function(_0x3e897e){if(_['isEmpty'](_0x3e897e)||!_['some'](_0x3e897e,[_0x9820('0x88'),0x0]))return _0x1648e4;_0x1d7cd7=[];var _0x4febfd=_(_0x3e897e)[_0x9820('0x30')](function(_0x40df03){if(_0x40df03[_0x9820('0x88')]===0x1)return;return _0x40df03[_0x9820('0x34')]==='Agents'?_0x9820('0x26'):'telephone';})['compact']()[_0x9820('0x31')]();for(var _0x72750a=0x0;_0x72750a<_0x1648e4[_0x9820('0x4e')];_0x72750a++){if(!_[_0x9820('0x32')](_0x4febfd,_0x1648e4[_0x72750a][_0x9820('0x25')]))return;var _0x1f87c3=_0x1648e4[_0x72750a][_0x9820('0x25')]===_0x9820('0x26')?_0x9820('0x2c'):'Telephones';_0x1d7cd7['push'](db[_0x9820('0x35')][_0x9820('0x7e')]({'name':_0x1648e4[_0x72750a][_0x9820('0x34')],'resourceId':_0x1648e4[_0x72750a]['id'],'type':_0x1f87c3,'sectionId':_[_0x9820('0x33')](_0x3e897e,['name',_0x1f87c3])['id']},{}));}return Promise[_0x9820('0x56')](_0x1d7cd7);});})[_0x9820('0x1b')](respondWithResult(_0x47c274,0xc9))[_0x9820('0x57')](handleError(_0x47c274,null));};exports[_0x9820('0x8d')]=function(_0x147610,_0x1ac445){if(_0x147610[_0x9820('0x5d')]['id']){delete _0x147610[_0x9820('0x5d')]['id'];}return db[_0x9820('0x37')][_0x9820('0x33')]({'where':{'id':_0x147610[_0x9820('0x59')]['id']}})[_0x9820('0x1b')](function(_0x437978){if(!_0x437978)return null;if(_0x437978['id']===_0x147610[_0x9820('0x2b')]['id']){if(!_0x147610[_0x9820('0x5d')][_0x9820('0x8e')]||!_0x147610[_0x9820('0x5d')][_0x9820('0x8f')]){throw new db[(_0x9820('0x90'))][(_0x9820('0x91'))](_0x9820('0x92'));}if(!_0x437978[_0x9820('0x93')](_0x147610[_0x9820('0x5d')][_0x9820('0x8e')])){throw new db[(_0x9820('0x90'))]['ValidationError']('Wrong\x20credentials');}if(_0x147610[_0x9820('0x5d')]['oldPassword']===_0x147610[_0x9820('0x5d')]['newPassword']){throw new db[(_0x9820('0x90'))]['ValidationError'](_0x9820('0x94'));}}else if(_0x147610[_0x9820('0x2b')][_0x9820('0x25')]==='admin'){if(!_0x147610[_0x9820('0x5d')][_0x9820('0x8f')]){throw new db[(_0x9820('0x90'))][(_0x9820('0x91'))](_0x9820('0x95'));}}else if(_0x147610[_0x9820('0x2b')]['role']===_0x9820('0x2b')){if(!_0x147610[_0x9820('0x5d')]['newPassword']){throw new db[(_0x9820('0x90'))][(_0x9820('0x91'))](_0x9820('0x95'));}if(_0x437978['role']!==_0x9820('0x26')){throw new db['Sequelize']['ValidationError'](_0x9820('0x7f'));}}else{throw new db[(_0x9820('0x90'))][(_0x9820('0x91'))](_0x9820('0x7f'));}return _0x437978;})['then'](handleEntityNotFound(_0x1ac445,null))[_0x9820('0x1b')](function(_0x910b20){return db[_0x9820('0x63')][_0x9820('0x96')]({'attributes':['id',_0x9820('0x64'),_0x9820('0x97'),_0x9820('0x98')]})[_0x9820('0x1b')](function(_0x1318bd){if(_0x1318bd[_0x9820('0x64')])authService[_0x9820('0x65')](_0x147610[_0x9820('0x5d')]['newPassword']);if(!_0x1318bd['enforcePasswordHistory']||!_0x910b20[_0x9820('0x3d')])return _0x910b20;authService[_0x9820('0x99')](_0x147610[_0x9820('0x5d')][_0x9820('0x8f')],_0x910b20[_0x9820('0x3d')],_0x1318bd[_0x9820('0x98')]);return _0x910b20;})['then'](saveUpdates({'password':_0x147610[_0x9820('0x5d')][_0x9820('0x8f')],'passwordResetAt':_0x147610['user']['id']==_0x147610[_0x9820('0x59')]['id']?moment():null,'previousPasswords':authService[_0x9820('0x9a')](_0x147610['body']['newPassword'],_0x910b20[_0x9820('0x3d')])},null));})['then'](respondWithResult(_0x1ac445,null))[_0x9820('0x57')](handleError(_0x1ac445,null));};exports[_0x9820('0x9b')]=function(_0x47448d,_0x944bc9){var _0x29a8aa=_0x47448d['body'][_0x9820('0x9c')];return db[_0x9820('0x37')][_0x9820('0x33')]({'where':{'id':_0x47448d[_0x9820('0x59')]['id']},'attributes':['id',_0x9820('0x34'),'role',_0x9820('0x9d'),_0x9820('0x9e'),_0x9820('0x9f'),_0x9820('0xa0')]})[_0x9820('0x1b')](handleEntityNotFound(_0x944bc9,null))[_0x9820('0x1b')](function(_0xf0e0d2){if(_0xf0e0d2){if(!utils[_0x9820('0xa1')](_0x29a8aa)){throw new db[(_0x9820('0x90'))]['ValidationError'](_0x9820('0xa2'));}return _0xf0e0d2[_0x9820('0xa3')+_[_0x9820('0xa4')](_0x29a8aa[_0x9820('0xa5')]())+_0x9820('0xa6')](_0x47448d['body'][_0x9820('0x60')],{'penalty':_0x47448d[_0x9820('0x5d')][_0x9820('0xa7')]||0x0})['spread'](function(_0x144aac){for(var _0x3dc445=0x0;_0x3dc445<_0x47448d[_0x9820('0x5d')][_0x9820('0x60')][_0x9820('0x4e')];_0x3dc445+=0x1){var _0x4e7d59={'UserId':Number(_0x47448d[_0x9820('0x59')]['id'])};_0x4e7d59[_[_0x9820('0xa4')](_0x29a8aa['toLowerCase']())+'QueueId']=Number(_0x47448d[_0x9820('0x5d')][_0x9820('0x60')][_0x3dc445]);socket['emit']('user'+_[_0x9820('0xa4')](_0x29a8aa[_0x9820('0xa5')]())+'Queue:save',_0x4e7d59);}return _0x144aac;})[_0x9820('0x1b')](function(){if(_0x29a8aa===_0x9820('0xa8')){return db['VoiceQueue'][_0x9820('0x4a')]({'where':{'id':_0x47448d[_0x9820('0x5d')][_0x9820('0x60')]||[]},'raw':!![],'attributes':['id',_0x9820('0x34')]});}})['then'](function(_0x1b51b7){var _0x55a04c=_0xf0e0d2['get']({'plain':!![]});var _0x4a523e=[];if(_0x29a8aa==='voice'&&_0x55a04c['role']==='agent'&&_0x55a04c[_0x9820('0x9d')]){for(let _0x3571ae=0x0;_0x3571ae<_0x1b51b7['length'];_0x3571ae+=0x1){_0x4a523e['push']({'membername':_0x55a04c['name'],'UserId':_0x55a04c['id'],'queue_name':_0x1b51b7[_0x3571ae][_0x9820('0x34')],'VoiceQueueId':_0x1b51b7[_0x3571ae]['id'],'interface':_[_0x9820('0x6b')](_0x55a04c[_0x9820('0xa0')])?util['format']('SIP/%s',_0x55a04c[_0x9820('0x34')]):_0x55a04c[_0x9820('0xa0')],'paused':_0x55a04c[_0x9820('0x9f')]||![],'penalty':_0x47448d['body'][_0x9820('0xa7')]||0x0});}return Promise[_0x9820('0x56')](_0x4a523e[_0x9820('0x30')](function(_0xd84605){return db['UserVoiceQueueRt'][_0x9820('0xa9')](_0xd84605);}));}return _0xf0e0d2;});}})[_0x9820('0x1b')](respondWithStatusCode(_0x944bc9,null))[_0x9820('0x57')](handleError(_0x944bc9,null));};exports[_0x9820('0xaa')]=function(_0x2a9bf3,_0x5c1455){var _0x1fb4d0,_0x250f6c;return db[_0x9820('0x37')][_0x9820('0x33')]({'where':{'id':_0x2a9bf3['params']['id']},'attributes':['id',_0x9820('0x34'),_0x9820('0x25')]})[_0x9820('0x1b')](handleEntityNotFound(_0x5c1455,null))['then'](function(_0x453450){if(_0x453450){_0x1fb4d0=_0x453450;if(!_0x2a9bf3[_0x9820('0x44')]['channel']||!utils[_0x9820('0xa1')](_0x2a9bf3[_0x9820('0x44')][_0x9820('0x9c')])){throw new db['Sequelize'][(_0x9820('0x91'))]('Unknown\x20channel');}return _0x453450['remove'+_[_0x9820('0xa4')](_0x2a9bf3[_0x9820('0x44')][_0x9820('0x9c')][_0x9820('0xa5')]())+_0x9820('0xa6')](_0x2a9bf3[_0x9820('0x44')][_0x9820('0x60')]);}})[_0x9820('0x1b')](function(_0xa6b61b){if(_['isArray'](_0x2a9bf3[_0x9820('0x44')][_0x9820('0x60')])){for(var _0x170a68=0x0;_0x170a68<_0x2a9bf3[_0x9820('0x44')][_0x9820('0x60')][_0x9820('0x4e')];_0x170a68+=0x1){_0x250f6c={'UserId':Number(_0x2a9bf3[_0x9820('0x59')]['id'])};_0x250f6c[_[_0x9820('0xa4')](_0x2a9bf3['query'][_0x9820('0x9c')][_0x9820('0xa5')]())+_0x9820('0xab')]=Number(_0x2a9bf3[_0x9820('0x44')][_0x9820('0x60')][_0x170a68]);socket[_0x9820('0xac')](_0x9820('0x2b')+_['capitalize'](_0x2a9bf3[_0x9820('0x44')]['channel']['toLowerCase']())+_0x9820('0xad'),_0x250f6c);}}else{_0x250f6c={'UserId':Number(_0x2a9bf3[_0x9820('0x59')]['id'])};_0x250f6c[_['capitalize'](_0x2a9bf3[_0x9820('0x44')][_0x9820('0x9c')][_0x9820('0xa5')]())+_0x9820('0xab')]=Number(_0x2a9bf3[_0x9820('0x44')][_0x9820('0x60')]);socket[_0x9820('0xac')](_0x9820('0x2b')+_[_0x9820('0xa4')](_0x2a9bf3[_0x9820('0x44')][_0x9820('0x9c')][_0x9820('0xa5')]())+_0x9820('0xad'),_0x250f6c);}return _0xa6b61b;})[_0x9820('0x1b')](function(){if(_0x2a9bf3[_0x9820('0x44')]['channel']==='voice'){return db[_0x9820('0xae')][_0x9820('0x28')]({'where':{'UserId':_0x2a9bf3[_0x9820('0x59')]['id'],'VoiceQueueId':_0x2a9bf3['query']['ids']},'individualHooks':!![]})['then'](function(){return _0x1fb4d0;});}return _0x1fb4d0;})['then'](respondWithStatusCode(_0x5c1455,null))[_0x9820('0x57')](handleError(_0x5c1455,null));};exports[_0x9820('0xaf')]=function(_0x34279b,_0xfaf829){_0x34279b[_0x9820('0x5d')][_0x9820('0xb0')]=_0x34279b['file'][_0x9820('0xb1')];return db[_0x9820('0x37')][_0x9820('0x33')]({'where':{'id':_0x34279b[_0x9820('0x59')]['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0xfaf829,null))[_0x9820('0x1b')](saveUpdates(_0x34279b[_0x9820('0x5d')],null))[_0x9820('0x1b')](respondWithResult(_0xfaf829,null))['catch'](handleError(_0xfaf829,null));};exports[_0x9820('0xb2')]=function(_0x589d20,_0x1ab73e){var _0x3f8c0f=path['join'](config[_0x9820('0xb3')],_0x9820('0xb4'));return db[_0x9820('0x37')][_0x9820('0x33')]({'where':{'id':_0x589d20[_0x9820('0x59')]['id']},'attributes':['id',_0x9820('0xb0')],'raw':!![]})[_0x9820('0x1b')](handleEntityNotFound(_0x1ab73e,null))[_0x9820('0x1b')](function(_0x2c47aa){if(_0x2c47aa){if(_[_0x9820('0x6b')](_0x2c47aa['userpic'])){return _0x1ab73e[_0x9820('0xb5')](_0x3f8c0f);}else{if(!fs[_0x9820('0xb6')](path['join'](config[_0x9820('0xb3')],_0x9820('0xb7'),_0x2c47aa[_0x9820('0xb0')]))){return _0x1ab73e[_0x9820('0xb5')](_0x3f8c0f);}return _0x1ab73e[_0x9820('0xb5')](path[_0x9820('0xb8')](config[_0x9820('0xb3')],'server/files/images/',_0x2c47aa[_0x9820('0xb0')]));}}})[_0x9820('0x57')](handleError(_0x1ab73e,null));};exports['getOpenTabs']=function(_0x5f1ca7,_0x367010){return db[_0x9820('0x37')][_0x9820('0x33')]({'where':{'id':_0x5f1ca7[_0x9820('0x59')]['id']},'attributes':['id']})[_0x9820('0x1b')](handleEntityNotFound(_0x367010,null))[_0x9820('0x1b')](function(_0x1dd1b6){var _0x3bdb94=[];values=_0x1dd1b6['dataValues'];_0x3bdb94[_0x9820('0x49')](get_open_tabs(_0x9820('0x4f'),_0x1dd1b6[_0x9820('0x50')]));_0x3bdb94[_0x9820('0x49')](get_open_tabs('sms',_0x1dd1b6[_0x9820('0x50')]));_0x3bdb94[_0x9820('0x49')](get_open_tabs(_0x9820('0x54'),_0x1dd1b6[_0x9820('0x50')]));_0x3bdb94[_0x9820('0x49')](get_open_tabs(_0x9820('0x55'),_0x1dd1b6[_0x9820('0x50')]));_0x3bdb94[_0x9820('0x49')](get_open_tabs(_0x9820('0x52'),_0x1dd1b6[_0x9820('0x50')]));_0x3bdb94[_0x9820('0x49')](get_open_tabs(_0x9820('0x53'),_0x1dd1b6[_0x9820('0x50')]));return Promise[_0x9820('0x56')](_0x3bdb94);})[_0x9820('0x1b')](function(_0x4259a7){if(_0x4259a7){var _0x38ad6e=_['map'](values[_0x9820('0xb9')],function(_0x1a5240){return{'channel':_0x9820('0xba'),'id':_0x1a5240['id'],'createdAt':_0x1a5240[_0x9820('0xbb')]};});var _0x4dd4db=_[_0x9820('0x30')](values[_0x9820('0xbc')],function(_0x52b2f3){return{'channel':_0x9820('0xbd'),'id':_0x52b2f3['id'],'createdAt':_0x52b2f3['createdAt']};});var _0x3e2f9d=_[_0x9820('0x30')](values[_0x9820('0xbe')],function(_0xca6444){return{'channel':_0x9820('0xbf'),'id':_0xca6444['id'],'createdAt':_0xca6444[_0x9820('0xbb')]};});var _0x4bd147=_[_0x9820('0x30')](values[_0x9820('0xc0')],function(_0x2d2396){return{'channel':'MAIL','id':_0x2d2396['id'],'createdAt':_0x2d2396[_0x9820('0xbb')]};});var _0x108e49=_[_0x9820('0x30')](values[_0x9820('0xc1')],function(_0x3e0faa){return{'channel':_0x9820('0xc2'),'id':_0x3e0faa['id'],'createdAt':_0x3e0faa[_0x9820('0xbb')]};});var _0x5eb002=_[_0x9820('0x30')](values[_0x9820('0xc3')],function(_0x149c5d){return{'channel':_0x9820('0xc4'),'id':_0x149c5d['id'],'createdAt':_0x149c5d[_0x9820('0xbb')]};});var _0x508972=_[_0x9820('0xc5')](_0x38ad6e,_0x4dd4db,_0x3e2f9d,_0x4bd147,_0x108e49,_0x5eb002);var _0x4b4d6f={'count':_0x508972['length'],'rows':_0x508972};return _0x4b4d6f;}else return null;})[_0x9820('0x1b')](respondWithResult(_0x367010,null))['catch'](handleError(_0x367010,null));};exports['getContacts']=function(_0x34f014,_0x4c56dc){var _0x21ee7b={};return db[_0x9820('0x37')]['findOne']({'where':{'id':_0x34f014[_0x9820('0x59')]['id']}})[_0x9820('0x1b')](function(_0xd8a281){if(!_0xd8a281){throw new APINotFoundError(util[_0x9820('0xc6')](_0x9820('0xc7'),_0x34f014['params']['id']));}return contacts['describe']();})[_0x9820('0x1b')](function(_0xc18da8){_0x34f014[_0x9820('0x44')]['User']=_0x34f014['params']['id'];_0x21ee7b=qs[_0x9820('0x42')](_0xc18da8,_0x34f014);if(_0x34f014['query']['hasOwnProperty'](_0x9820('0x5a'))){_0x21ee7b[_0x9820('0x45')]=[{'model':db[_0x9820('0xc8')],'as':'List','required':![]},{'model':db[_0x9820('0xc9')],'as':_0x9820('0xca'),'attributes':['id',_0x9820('0x34'),_0x9820('0xcb')],'where':_0x34f014[_0x9820('0x44')][_0x9820('0xcc')]?{'id':_0x34f014['query']['tag']}:undefined,'required':_0x34f014['query'][_0x9820('0xcc')]?!![]:![]}];}return contacts[_0x9820('0x4a')](_0x34f014[_0x9820('0x44')],_0x34f014[_0x9820('0x2b')],_0x21ee7b,_0xc18da8);})[_0x9820('0x1b')](respondWithFilteredResult(_0x4c56dc,_0x21ee7b))['catch'](APIHandleError(_0x4c56dc));};exports[_0x9820('0xcd')]=function(_0x3a0175,_0x25edd4){var _0x1d104f;var _0x1c7577={};var _0x33aa12;return db['User']['findOne']({'where':{'id':_0x3a0175[_0x9820('0x59')]['id']},'attributes':['id','name','role']})[_0x9820('0x1b')](handleEntityNotFound(_0x25edd4,null))[_0x9820('0x1b')](function(_0x2f49ce){if(!utils[_0x9820('0xa1')](_0x3a0175['query'][_0x9820('0x9c')])){throw new db['Sequelize'][(_0x9820('0x91'))](_0x9820('0xa2'));}_0x1d104f=_0x2f49ce;var _0x2ea91a={};_0x2ea91a[_0x9820('0xce')]=_[_0x9820('0xcf')](db[_[_0x9820('0xa4')](_0x3a0175[_0x9820('0x44')][_0x9820('0x9c')])+_0x9820('0xd0')][_0x9820('0xd1')]);_0x2ea91a[_0x9820('0x44')]=_[_0x9820('0xcf')](_0x3a0175['query']);_0x2ea91a[_0x9820('0xd2')]=_[_0x9820('0xd3')](_0x2ea91a[_0x9820('0xce')],_0x2ea91a[_0x9820('0x44')]);_0x1c7577['attributes']=_[_0x9820('0xd3')](_0x2ea91a[_0x9820('0xce')],qs[_0x9820('0xd4')](_0x3a0175['query'][_0x9820('0xd4')]));_0x1c7577[_0x9820('0x48')]=_0x1c7577[_0x9820('0x48')][_0x9820('0x4e')]?_0x1c7577[_0x9820('0x48')]:_0x2ea91a['model'];_0x1c7577[_0x9820('0xd5')]=qs[_0x9820('0xd6')](_0x3a0175[_0x9820('0x44')][_0x9820('0xd6')]);_0x1c7577['where']=qs[_0x9820('0xd2')](_['pick'](_0x3a0175[_0x9820('0x44')],_0x2ea91a['filters']));if(_0x3a0175[_0x9820('0x44')][_0x9820('0x2e')]){_0x1c7577[_0x9820('0x43')]=_['merge'](_0x1c7577[_0x9820('0x43')],{'$or':_[_0x9820('0x30')](_0x1c7577[_0x9820('0x48')],function(_0x15146f){var _0x56f3dc={};_0x56f3dc[_0x15146f]={'$like':'%'+_0x3a0175['query'][_0x9820('0x2e')]+'%'};return _0x56f3dc;})});}_0x1c7577=_['merge']({},_0x1c7577,_0x3a0175[_0x9820('0x5c')]);switch(_0x1d104f[_0x9820('0x25')]){case _0x9820('0x81'):return db[_[_0x9820('0xa4')](_0x3a0175[_0x9820('0x44')]['channel'])+'Queue'][_0x9820('0x4a')](_0x1c7577);case'user':case _0x9820('0x26'):return _0x1d104f[_0x9820('0x29')+_['capitalize'](_0x3a0175[_0x9820('0x44')][_0x9820('0x9c')])+'Queues'](_0x1c7577);default:throw new db['Sequelize'][(_0x9820('0x91'))](_0x9820('0xd7'));}})[_0x9820('0x1b')](function(_0x3c9acd){_0x33aa12=_0x3c9acd[_0x9820('0x4e')];if(!_0x3a0175['query']['hasOwnProperty'](_0x9820('0xd8'))){_0x1c7577[_0x9820('0x17')]=qs[_0x9820('0x17')](_0x3a0175[_0x9820('0x44')]['limit']);_0x1c7577['offset']=qs['offset'](_0x3a0175['query']['offset']);}switch(_0x1d104f[_0x9820('0x25')]){case'admin':return db[_[_0x9820('0xa4')](_0x3a0175[_0x9820('0x44')][_0x9820('0x9c')])+'Queue']['findAll'](_0x1c7577);case _0x9820('0x2b'):case _0x9820('0x26'):return _0x1d104f[_0x9820('0x29')+_[_0x9820('0xa4')](_0x3a0175['query'][_0x9820('0x9c')])+_0x9820('0xa6')](_0x1c7577);}})[_0x9820('0x1b')](function(_0x526992){return{'count':_0x33aa12,'rows':_0x526992};})['then'](respondWithResult(_0x25edd4,null))[_0x9820('0x57')](handleError(_0x25edd4,null));};exports['getVoiceQueuesRt']=function(_0x517179,_0x581c44){var _0x341df5={};var _0x2566cd={};var _0x2faa37;var _0x5d3f2d;return db[_0x9820('0x37')]['findOne']({'where':{'id':_0x517179[_0x9820('0x59')]['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0x581c44,null))['then'](function(_0x34add2){if(_0x34add2){_0x2faa37=_0x34add2;_0x2566cd[_0x9820('0xce')]=_['keys'](db[_0x9820('0xae')][_0x9820('0xd1')]);_0x2566cd[_0x9820('0x44')]=_[_0x9820('0xcf')](_0x517179[_0x9820('0x44')]);_0x2566cd[_0x9820('0xd2')]=_[_0x9820('0xd3')](_0x2566cd[_0x9820('0xce')],_0x2566cd[_0x9820('0x44')]);_0x341df5[_0x9820('0x48')]=_[_0x9820('0xd3')](_0x2566cd[_0x9820('0xce')],qs[_0x9820('0xd4')](_0x517179['query'][_0x9820('0xd4')]));_0x341df5[_0x9820('0x48')]=_0x341df5[_0x9820('0x48')]['length']?_0x341df5[_0x9820('0x48')]:_0x2566cd['model'];_0x341df5[_0x9820('0xd5')]=qs['sort'](_0x517179[_0x9820('0x44')]['sort']);_0x341df5['where']=qs[_0x9820('0xd2')](_[_0x9820('0xd9')](_0x517179['query'],_0x2566cd['filters']));if(_0x517179[_0x9820('0x44')][_0x9820('0x2e')]){_0x341df5[_0x9820('0x43')]=_['merge'](_0x341df5[_0x9820('0x43')],{'$or':_[_0x9820('0x30')](_0x341df5[_0x9820('0x48')],function(_0x3d3574){var _0x42b004={};_0x42b004[_0x3d3574]={'$like':'%'+_0x517179[_0x9820('0x44')][_0x9820('0x2e')]+'%'};return _0x42b004;})});}_0x341df5=_[_0x9820('0x5b')]({},_0x341df5,_0x517179['options']);return _0x2faa37[_0x9820('0xda')](_0x341df5);}})[_0x9820('0x1b')](function(_0x11a2bb){if(_0x11a2bb){_0x5d3f2d=_0x11a2bb['length'];if(!_0x517179[_0x9820('0x44')][_0x9820('0xdb')](_0x9820('0xd8'))){_0x341df5[_0x9820('0x17')]=qs[_0x9820('0x17')](_0x517179[_0x9820('0x44')]['limit']);_0x341df5['offset']=qs[_0x9820('0x19')](_0x517179[_0x9820('0x44')]['offset']);}return _0x2faa37[_0x9820('0xda')](_0x341df5);}})[_0x9820('0x1b')](function(_0x4f873c){if(_0x4f873c){return _0x4f873c?{'count':_0x5d3f2d,'rows':_0x4f873c}:null;}})[_0x9820('0x1b')](respondWithResult(_0x581c44,null))['catch'](handleError(_0x581c44,null));};exports[_0x9820('0xdc')]=function(_0x26ae37,_0xfb5b87){var _0x37dab3={};var _0x284f86={};var _0x2526b3;var _0x1814d0;return db[_0x9820('0x37')][_0x9820('0x96')]({'where':{'id':_0x26ae37['params']['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0xfb5b87,null))[_0x9820('0x1b')](function(_0x4a513c){if(_0x4a513c){_0x2526b3=_0x4a513c;_0x284f86['model']=_['keys'](db[_0x9820('0xdd')][_0x9820('0xd1')]);_0x284f86[_0x9820('0x44')]=_['keys'](_0x26ae37[_0x9820('0x44')]);_0x284f86[_0x9820('0xd2')]=_[_0x9820('0xd3')](_0x284f86[_0x9820('0xce')],_0x284f86['query']);_0x37dab3[_0x9820('0x48')]=_['intersection'](_0x284f86[_0x9820('0xce')],qs[_0x9820('0xd4')](_0x26ae37['query'][_0x9820('0xd4')]));_0x37dab3[_0x9820('0x48')]=_0x37dab3[_0x9820('0x48')][_0x9820('0x4e')]?_0x37dab3[_0x9820('0x48')]:_0x284f86[_0x9820('0xce')];_0x37dab3['order']=qs[_0x9820('0xd6')](_0x26ae37[_0x9820('0x44')][_0x9820('0xd6')]);_0x37dab3[_0x9820('0x43')]=qs['filters'](_[_0x9820('0xd9')](_0x26ae37[_0x9820('0x44')],_0x284f86['filters']));if(_0x26ae37['query'][_0x9820('0x2e')]){_0x37dab3['where']=_[_0x9820('0x5b')](_0x37dab3[_0x9820('0x43')],{'$or':_['map'](_0x37dab3[_0x9820('0x48')],function(_0x505adb){var _0xd4b4f7={};_0xd4b4f7[_0x505adb]={'$like':'%'+_0x26ae37['query'][_0x9820('0x2e')]+'%'};return _0xd4b4f7;})});}_0x37dab3=_[_0x9820('0x5b')]({},_0x37dab3,_0x26ae37[_0x9820('0x5c')]);return _0x2526b3[_0x9820('0xdc')](_0x37dab3);}})[_0x9820('0x1b')](function(_0x1397d5){if(_0x1397d5){_0x1814d0=_0x1397d5[_0x9820('0x4e')];if(!_0x26ae37['query'][_0x9820('0xdb')](_0x9820('0xd8'))){_0x37dab3[_0x9820('0x17')]=qs[_0x9820('0x17')](_0x26ae37[_0x9820('0x44')][_0x9820('0x17')]);_0x37dab3[_0x9820('0x19')]=qs['offset'](_0x26ae37['query'][_0x9820('0x19')]);}return _0x2526b3[_0x9820('0xdc')](_0x37dab3);}})[_0x9820('0x1b')](function(_0x220834){if(_0x220834){return _0x220834?{'count':_0x1814d0,'rows':_0x220834}:null;}})[_0x9820('0x1b')](respondWithResult(_0xfb5b87,null))[_0x9820('0x57')](handleError(_0xfb5b87,null));};exports['getRecordings']=function(_0x56d1e0,_0x5eb67f){var _0x5a68d9={'raw':!![],'where':{}};var _0xb96bc1={};var _0x716b9={'count':0x0,'rows':[]};return db[_0x9820('0x37')][_0x9820('0x96')]({'where':{'id':_0x56d1e0['params']['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0x5eb67f,null))[_0x9820('0x1b')](function(_0x383237){if(_0x383237){_0xb96bc1[_0x9820('0xce')]=_[_0x9820('0xcf')](db[_0x9820('0xde')][_0x9820('0xd1')]);_0xb96bc1[_0x9820('0x44')]=_[_0x9820('0xcf')](_0x56d1e0[_0x9820('0x44')]);_0xb96bc1[_0x9820('0xd2')]=_['intersection'](_0xb96bc1['model'],_0xb96bc1[_0x9820('0x44')]);_0x5a68d9[_0x9820('0x48')]=_[_0x9820('0xd3')](_0xb96bc1[_0x9820('0xce')],qs[_0x9820('0xd4')](_0x56d1e0['query']['fields']));_0x5a68d9[_0x9820('0x48')]=_0x5a68d9[_0x9820('0x48')][_0x9820('0x4e')]?_0x5a68d9[_0x9820('0x48')]:_0xb96bc1['model'];if(!_0x56d1e0['query'][_0x9820('0xdb')]('nolimit')){_0x5a68d9[_0x9820('0x17')]=qs['limit'](_0x56d1e0[_0x9820('0x44')]['limit']);_0x5a68d9[_0x9820('0x19')]=qs[_0x9820('0x19')](_0x56d1e0[_0x9820('0x44')][_0x9820('0x19')]);}_0x5a68d9[_0x9820('0xd5')]=qs[_0x9820('0xd6')](_0x56d1e0[_0x9820('0x44')][_0x9820('0xd6')]);_0x5a68d9[_0x9820('0x43')]=qs[_0x9820('0xd2')](_[_0x9820('0xd9')](_0x56d1e0[_0x9820('0x44')],_0xb96bc1[_0x9820('0xd2')]));_0x5a68d9[_0x9820('0x43')][_0x9820('0xdf')]=_0x383237['id'];if(_0x56d1e0[_0x9820('0x44')]['filter']){_0x5a68d9['where']=_[_0x9820('0x5b')](_0x5a68d9['where'],{'$or':_['map'](_0x5a68d9[_0x9820('0x48')],function(_0x3433b5){var _0x3e9f43={};_0x3e9f43[_0x3433b5]={'$like':'%'+_0x56d1e0['query'][_0x9820('0x2e')]+'%'};return _0x3e9f43;})});}_0x5a68d9=_[_0x9820('0x5b')]({},_0x5a68d9,_0x56d1e0['options']);return db[_0x9820('0xde')][_0x9820('0x18')]({'where':_0x5a68d9[_0x9820('0x43')]})[_0x9820('0x1b')](function(_0x36c872){_0x716b9[_0x9820('0x18')]=_0x36c872;if(_0x56d1e0[_0x9820('0x44')][_0x9820('0x5a')]){_0x5a68d9['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x9820('0x4a')](_0x5a68d9);})[_0x9820('0x1b')](function(_0x46f270){_0x716b9[_0x9820('0x4b')]=_0x46f270;return _0x716b9;});}})[_0x9820('0x1b')](respondWithFilteredResult(_0x5eb67f,_0x5a68d9))[_0x9820('0x57')](handleError(_0x5eb67f,null));};exports['getScreenRecordings']=function(_0x35fccd,_0x2ed78f){var _0x19e4c0={'raw':!![],'where':{}};var _0xd905c7={};var _0x20d5a3={'count':0x0,'rows':[]};return db[_0x9820('0x37')][_0x9820('0x96')]({'where':{'id':_0x35fccd[_0x9820('0x59')]['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0x2ed78f,null))[_0x9820('0x1b')](function(_0xc71362){if(_0xc71362){_0xd905c7[_0x9820('0xce')]=_[_0x9820('0xcf')](db[_0x9820('0xe0')][_0x9820('0xd1')]);_0xd905c7[_0x9820('0x44')]=_['keys'](_0x35fccd[_0x9820('0x44')]);_0xd905c7[_0x9820('0xd2')]=_[_0x9820('0xd3')](_0xd905c7[_0x9820('0xce')],_0xd905c7[_0x9820('0x44')]);_0x19e4c0['attributes']=_['intersection'](_0xd905c7[_0x9820('0xce')],qs[_0x9820('0xd4')](_0x35fccd[_0x9820('0x44')]['fields']));_0x19e4c0['attributes']=_0x19e4c0[_0x9820('0x48')]['length']?_0x19e4c0[_0x9820('0x48')]:_0xd905c7[_0x9820('0xce')];if(!_0x35fccd[_0x9820('0x44')]['hasOwnProperty'](_0x9820('0xd8'))){_0x19e4c0['limit']=qs[_0x9820('0x17')](_0x35fccd['query'][_0x9820('0x17')]);_0x19e4c0[_0x9820('0x19')]=qs[_0x9820('0x19')](_0x35fccd[_0x9820('0x44')]['offset']);}_0x19e4c0[_0x9820('0xd5')]=qs[_0x9820('0xd6')](_0x35fccd['query'][_0x9820('0xd6')]);_0x19e4c0['where']=qs[_0x9820('0xd2')](_[_0x9820('0xd9')](_0x35fccd[_0x9820('0x44')],_0xd905c7[_0x9820('0xd2')]));_0x19e4c0[_0x9820('0x43')]['UserId']=_0xc71362['id'];if(_0x35fccd[_0x9820('0x44')][_0x9820('0x2e')]){_0x19e4c0[_0x9820('0x43')]=_[_0x9820('0x5b')](_0x19e4c0[_0x9820('0x43')],{'$or':_[_0x9820('0x30')](_0x19e4c0[_0x9820('0x48')],function(_0x22728a){var _0x19242a={};_0x19242a[_0x22728a]={'$like':'%'+_0x35fccd[_0x9820('0x44')][_0x9820('0x2e')]+'%'};return _0x19242a;})});}_0x19e4c0=_[_0x9820('0x5b')]({},_0x19e4c0,_0x35fccd[_0x9820('0x5c')]);return db['ScreenRecording'][_0x9820('0x18')]({'where':_0x19e4c0[_0x9820('0x43')]})[_0x9820('0x1b')](function(_0x1bad4b){_0x20d5a3[_0x9820('0x18')]=_0x1bad4b;if(_0x35fccd[_0x9820('0x44')][_0x9820('0x5a')]){_0x19e4c0[_0x9820('0x45')]=[{'all':!![]}];}return db['ScreenRecording'][_0x9820('0x4a')](_0x19e4c0);})[_0x9820('0x1b')](function(_0x3b24f3){_0x20d5a3[_0x9820('0x4b')]=_0x3b24f3;return _0x20d5a3;});}})['then'](respondWithFilteredResult(_0x2ed78f,_0x19e4c0))['catch'](handleError(_0x2ed78f,null));};exports[_0x9820('0xe1')]=function(_0x210d35,_0x5a9547){var _0x40775a={};var _0x44cf5c={};var _0xe2ab06;var _0x502fd0;return db[_0x9820('0x37')][_0x9820('0x96')]({'where':{'id':_0x210d35[_0x9820('0x59')]['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0x5a9547,null))[_0x9820('0x1b')](function(_0x162357){if(_0x162357){_0xe2ab06=_0x162357;_0x44cf5c[_0x9820('0xce')]=_['keys'](db[_0x9820('0xe2')]['rawAttributes']);_0x44cf5c[_0x9820('0x44')]=_['keys'](_0x210d35[_0x9820('0x44')]);_0x44cf5c['filters']=_[_0x9820('0xd3')](_0x44cf5c[_0x9820('0xce')],_0x44cf5c[_0x9820('0x44')]);_0x40775a['attributes']=_[_0x9820('0xd3')](_0x44cf5c[_0x9820('0xce')],qs[_0x9820('0xd4')](_0x210d35[_0x9820('0x44')][_0x9820('0xd4')]));_0x40775a[_0x9820('0x48')]=_0x40775a['attributes'][_0x9820('0x4e')]?_0x40775a['attributes']:_0x44cf5c[_0x9820('0xce')];_0x40775a['order']=qs['sort'](_0x210d35[_0x9820('0x44')][_0x9820('0xd6')]);_0x40775a[_0x9820('0x43')]=qs['filters'](_['pick'](_0x210d35['query'],_0x44cf5c[_0x9820('0xd2')]));if(_0x210d35[_0x9820('0x44')][_0x9820('0x2e')]){_0x40775a[_0x9820('0x43')]=_[_0x9820('0x5b')](_0x40775a[_0x9820('0x43')],{'$or':_['map'](_0x40775a[_0x9820('0x48')],function(_0x58dc3d){var _0x222610={};_0x222610[_0x58dc3d]={'$like':'%'+_0x210d35[_0x9820('0x44')]['filter']+'%'};return _0x222610;})});}_0x40775a=_[_0x9820('0x5b')]({},_0x40775a,_0x210d35[_0x9820('0x5c')]);return _0xe2ab06[_0x9820('0xe1')](_0x40775a);}})[_0x9820('0x1b')](function(_0x343bf3){if(_0x343bf3){_0x502fd0=_0x343bf3[_0x9820('0x4e')];if(!_0x210d35[_0x9820('0x44')]['hasOwnProperty'](_0x9820('0xd8'))){_0x40775a[_0x9820('0x17')]=qs[_0x9820('0x17')](_0x210d35[_0x9820('0x44')][_0x9820('0x17')]);_0x40775a[_0x9820('0x19')]=qs[_0x9820('0x19')](_0x210d35[_0x9820('0x44')][_0x9820('0x19')]);}return _0xe2ab06[_0x9820('0xe1')](_0x40775a);}})[_0x9820('0x1b')](function(_0x4d8d12){if(_0x4d8d12){return _0x4d8d12?{'count':_0x502fd0,'rows':_0x4d8d12}:null;}})[_0x9820('0x1b')](respondWithResult(_0x5a9547,null))[_0x9820('0x57')](handleError(_0x5a9547,null));};exports[_0x9820('0xe3')]=function(_0x3aa9aa,_0x170f7a){var _0x583527={};var _0x15caea={};var _0x2a798e;var _0x2fc314;return db[_0x9820('0x37')][_0x9820('0x96')]({'where':{'id':_0x3aa9aa[_0x9820('0x59')]['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0x170f7a,null))['then'](function(_0x3d2f6d){if(_0x3d2f6d){_0x2a798e=_0x3d2f6d;_0x15caea[_0x9820('0xce')]=_['keys'](db[_0x9820('0xe4')][_0x9820('0xd1')]);_0x15caea['query']=_[_0x9820('0xcf')](_0x3aa9aa[_0x9820('0x44')]);_0x15caea[_0x9820('0xd2')]=_[_0x9820('0xd3')](_0x15caea[_0x9820('0xce')],_0x15caea[_0x9820('0x44')]);_0x583527[_0x9820('0x48')]=_[_0x9820('0xd3')](_0x15caea[_0x9820('0xce')],qs[_0x9820('0xd4')](_0x3aa9aa[_0x9820('0x44')]['fields']));_0x583527[_0x9820('0x48')]=_0x583527[_0x9820('0x48')][_0x9820('0x4e')]?_0x583527[_0x9820('0x48')]:_0x15caea[_0x9820('0xce')];_0x583527[_0x9820('0xd5')]=qs[_0x9820('0xd6')](_0x3aa9aa[_0x9820('0x44')][_0x9820('0xd6')]);_0x583527[_0x9820('0x43')]=qs['filters'](_['pick'](_0x3aa9aa[_0x9820('0x44')],_0x15caea['filters']));if(_0x3aa9aa[_0x9820('0x44')][_0x9820('0x2e')]){_0x583527[_0x9820('0x43')]=_[_0x9820('0x5b')](_0x583527[_0x9820('0x43')],{'$or':_[_0x9820('0x30')](_0x583527[_0x9820('0x48')],function(_0x933a4b){var _0x18325c={};_0x18325c[_0x933a4b]={'$like':'%'+_0x3aa9aa[_0x9820('0x44')][_0x9820('0x2e')]+'%'};return _0x18325c;})});}_0x583527=_[_0x9820('0x5b')]({},_0x583527,_0x3aa9aa[_0x9820('0x5c')]);return _0x2a798e[_0x9820('0xe3')](_0x583527);}})[_0x9820('0x1b')](function(_0x2af4e1){if(_0x2af4e1){_0x2fc314=_0x2af4e1[_0x9820('0x4e')];if(!_0x3aa9aa[_0x9820('0x44')][_0x9820('0xdb')](_0x9820('0xd8'))){_0x583527[_0x9820('0x17')]=qs[_0x9820('0x17')](_0x3aa9aa[_0x9820('0x44')]['limit']);_0x583527[_0x9820('0x19')]=qs[_0x9820('0x19')](_0x3aa9aa[_0x9820('0x44')][_0x9820('0x19')]);}return _0x2a798e[_0x9820('0xe3')](_0x583527);}})[_0x9820('0x1b')](function(_0x49655e){if(_0x49655e){return _0x49655e?{'count':_0x2fc314,'rows':_0x49655e}:null;}})[_0x9820('0x1b')](respondWithResult(_0x170f7a,null))[_0x9820('0x57')](handleError(_0x170f7a,null));};exports['getMailInteractions']=function(_0x5e130d,_0x5aecdb){var _0x2cdad7={'raw':!![],'where':{}};var _0x26f8f9={};var _0x2b3b9e={'count':0x0,'rows':[]};return db[_0x9820('0x37')][_0x9820('0x96')]({'where':{'id':_0x5e130d[_0x9820('0x59')]['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0x5aecdb,null))[_0x9820('0x1b')](function(_0x1be9e6){if(_0x1be9e6){_0x26f8f9[_0x9820('0xce')]=_['keys'](db[_0x9820('0xe5')][_0x9820('0xd1')]);_0x26f8f9['query']=_[_0x9820('0xcf')](_0x5e130d['query']);_0x26f8f9[_0x9820('0xd2')]=_['intersection'](_0x26f8f9[_0x9820('0xce')],_0x26f8f9['query']);_0x2cdad7[_0x9820('0x48')]=_['intersection'](_0x26f8f9['model'],qs[_0x9820('0xd4')](_0x5e130d['query']['fields']));_0x2cdad7[_0x9820('0x48')]=_0x2cdad7[_0x9820('0x48')]['length']?_0x2cdad7[_0x9820('0x48')]:_0x26f8f9[_0x9820('0xce')];if(!_0x5e130d[_0x9820('0x44')][_0x9820('0xdb')]('nolimit')){_0x2cdad7[_0x9820('0x17')]=qs[_0x9820('0x17')](_0x5e130d[_0x9820('0x44')][_0x9820('0x17')]);_0x2cdad7[_0x9820('0x19')]=qs[_0x9820('0x19')](_0x5e130d[_0x9820('0x44')][_0x9820('0x19')]);}_0x2cdad7[_0x9820('0xd5')]=qs[_0x9820('0xd6')](_0x5e130d[_0x9820('0x44')][_0x9820('0xd6')]);_0x2cdad7[_0x9820('0x43')]=qs['filters'](_[_0x9820('0xd9')](_0x5e130d[_0x9820('0x44')],_0x26f8f9['filters']));_0x2cdad7[_0x9820('0x43')]['UserId']=_0x1be9e6['id'];if(_0x5e130d[_0x9820('0x44')][_0x9820('0x2e')]){_0x2cdad7[_0x9820('0x43')]=_[_0x9820('0x5b')](_0x2cdad7[_0x9820('0x43')],{'$or':_[_0x9820('0x30')](_0x2cdad7[_0x9820('0x48')],function(_0x28240f){var _0x3c0c2e={};_0x3c0c2e[_0x28240f]={'$like':'%'+_0x5e130d[_0x9820('0x44')][_0x9820('0x2e')]+'%'};return _0x3c0c2e;})});}_0x2cdad7=_[_0x9820('0x5b')]({},_0x2cdad7,_0x5e130d['options']);return db[_0x9820('0xe5')]['count']({'where':_0x2cdad7[_0x9820('0x43')]})['then'](function(_0xf10e1b){_0x2b3b9e['count']=_0xf10e1b;if(_0x5e130d[_0x9820('0x44')][_0x9820('0x5a')]){_0x2cdad7[_0x9820('0x45')]=[{'all':!![]}];}return db[_0x9820('0xe5')][_0x9820('0x4a')](_0x2cdad7);})['then'](function(_0x5740f7){_0x2b3b9e[_0x9820('0x4b')]=_0x5740f7;return _0x2b3b9e;});}})[_0x9820('0x1b')](respondWithFilteredResult(_0x5aecdb,_0x2cdad7))['catch'](handleError(_0x5aecdb,null));};exports[_0x9820('0xe6')]=function(_0x508dbd,_0x1cb019){var _0xd7c268={};var _0x37d75b={};var _0x791718;var _0x3ef45e;return db[_0x9820('0x37')][_0x9820('0x96')]({'where':{'id':_0x508dbd[_0x9820('0x59')]['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0x1cb019,null))[_0x9820('0x1b')](function(_0x3080e0){if(_0x3080e0){_0x791718=_0x3080e0;_0x37d75b[_0x9820('0xce')]=_[_0x9820('0xcf')](db[_0x9820('0xe7')]['rawAttributes']);_0x37d75b[_0x9820('0x44')]=_['keys'](_0x508dbd[_0x9820('0x44')]);_0x37d75b[_0x9820('0xd2')]=_[_0x9820('0xd3')](_0x37d75b[_0x9820('0xce')],_0x37d75b['query']);_0xd7c268[_0x9820('0x48')]=_[_0x9820('0xd3')](_0x37d75b[_0x9820('0xce')],qs[_0x9820('0xd4')](_0x508dbd[_0x9820('0x44')][_0x9820('0xd4')]));_0xd7c268[_0x9820('0x48')]=_0xd7c268[_0x9820('0x48')][_0x9820('0x4e')]?_0xd7c268['attributes']:_0x37d75b[_0x9820('0xce')];_0xd7c268[_0x9820('0xd5')]=qs[_0x9820('0xd6')](_0x508dbd[_0x9820('0x44')][_0x9820('0xd6')]);_0xd7c268[_0x9820('0x43')]=qs['filters'](_[_0x9820('0xd9')](_0x508dbd[_0x9820('0x44')],_0x37d75b[_0x9820('0xd2')]));if(_0x508dbd[_0x9820('0x44')]['filter']){_0xd7c268[_0x9820('0x43')]=_['merge'](_0xd7c268[_0x9820('0x43')],{'$or':_['map'](_0xd7c268[_0x9820('0x48')],function(_0x3bb6b5){var _0x613361={};_0x613361[_0x3bb6b5]={'$like':'%'+_0x508dbd[_0x9820('0x44')][_0x9820('0x2e')]+'%'};return _0x613361;})});}_0xd7c268=_[_0x9820('0x5b')]({},_0xd7c268,_0x508dbd['options']);return _0x791718[_0x9820('0xe6')](_0xd7c268);}})[_0x9820('0x1b')](function(_0x581505){if(_0x581505){_0x3ef45e=_0x581505[_0x9820('0x4e')];if(!_0x508dbd['query']['hasOwnProperty'](_0x9820('0xd8'))){_0xd7c268[_0x9820('0x17')]=qs[_0x9820('0x17')](_0x508dbd[_0x9820('0x44')]['limit']);_0xd7c268[_0x9820('0x19')]=qs[_0x9820('0x19')](_0x508dbd['query'][_0x9820('0x19')]);}return _0x791718[_0x9820('0xe6')](_0xd7c268);}})[_0x9820('0x1b')](function(_0x3ed2f6){if(_0x3ed2f6){return _0x3ed2f6?{'count':_0x3ef45e,'rows':_0x3ed2f6}:null;}})[_0x9820('0x1b')](respondWithResult(_0x1cb019,null))[_0x9820('0x57')](handleError(_0x1cb019,null));};exports[_0x9820('0xe8')]=function(_0x45e671,_0x522828){var _0x306d94={};var _0x2f4666={};var _0x2af28d;var _0x31fe1e;return db[_0x9820('0x37')][_0x9820('0x96')]({'where':{'id':_0x45e671['params']['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0x522828,null))['then'](function(_0x4a1cb7){if(_0x4a1cb7){_0x2af28d=_0x4a1cb7;_0x2f4666[_0x9820('0xce')]=_[_0x9820('0xcf')](db['FaxInteraction'][_0x9820('0xd1')]);_0x2f4666[_0x9820('0x44')]=_[_0x9820('0xcf')](_0x45e671[_0x9820('0x44')]);_0x2f4666['filters']=_['intersection'](_0x2f4666[_0x9820('0xce')],_0x2f4666['query']);_0x306d94[_0x9820('0x48')]=_[_0x9820('0xd3')](_0x2f4666[_0x9820('0xce')],qs[_0x9820('0xd4')](_0x45e671[_0x9820('0x44')][_0x9820('0xd4')]));_0x306d94[_0x9820('0x48')]=_0x306d94[_0x9820('0x48')][_0x9820('0x4e')]?_0x306d94[_0x9820('0x48')]:_0x2f4666['model'];_0x306d94['order']=qs['sort'](_0x45e671[_0x9820('0x44')][_0x9820('0xd6')]);_0x306d94['where']=qs['filters'](_['pick'](_0x45e671[_0x9820('0x44')],_0x2f4666[_0x9820('0xd2')]));if(_0x45e671['query'][_0x9820('0x2e')]){_0x306d94['where']=_['merge'](_0x306d94['where'],{'$or':_[_0x9820('0x30')](_0x306d94[_0x9820('0x48')],function(_0x2def65){var _0x5c189d={};_0x5c189d[_0x2def65]={'$like':'%'+_0x45e671['query'][_0x9820('0x2e')]+'%'};return _0x5c189d;})});}_0x306d94=_[_0x9820('0x5b')]({},_0x306d94,_0x45e671[_0x9820('0x5c')]);return _0x2af28d[_0x9820('0xe8')](_0x306d94);}})[_0x9820('0x1b')](function(_0x58203a){if(_0x58203a){_0x31fe1e=_0x58203a[_0x9820('0x4e')];if(!_0x45e671[_0x9820('0x44')][_0x9820('0xdb')](_0x9820('0xd8'))){_0x306d94[_0x9820('0x17')]=qs['limit'](_0x45e671['query'][_0x9820('0x17')]);_0x306d94[_0x9820('0x19')]=qs['offset'](_0x45e671[_0x9820('0x44')][_0x9820('0x19')]);}return _0x2af28d[_0x9820('0xe8')](_0x306d94);}})[_0x9820('0x1b')](function(_0x4a0a22){if(_0x4a0a22){return _0x4a0a22?{'count':_0x31fe1e,'rows':_0x4a0a22}:null;}})[_0x9820('0x1b')](respondWithResult(_0x522828,null))[_0x9820('0x57')](handleError(_0x522828,null));};exports[_0x9820('0xe9')]=function(_0x2e84f9,_0xa73645){var _0x219572={};var _0x351c6e={};var _0x14c3e9;var _0x401272;return db[_0x9820('0x37')][_0x9820('0x96')]({'where':{'id':_0x2e84f9['params']['id']}})['then'](handleEntityNotFound(_0xa73645,null))[_0x9820('0x1b')](function(_0x507dee){if(_0x507dee){_0x14c3e9=_0x507dee;_0x351c6e[_0x9820('0xce')]=_[_0x9820('0xcf')](db['WhatsappInteraction']['rawAttributes']);_0x351c6e[_0x9820('0x44')]=_[_0x9820('0xcf')](_0x2e84f9[_0x9820('0x44')]);_0x351c6e[_0x9820('0xd2')]=_['intersection'](_0x351c6e['model'],_0x351c6e[_0x9820('0x44')]);_0x219572[_0x9820('0x48')]=_[_0x9820('0xd3')](_0x351c6e[_0x9820('0xce')],qs[_0x9820('0xd4')](_0x2e84f9[_0x9820('0x44')][_0x9820('0xd4')]));_0x219572[_0x9820('0x48')]=_0x219572[_0x9820('0x48')][_0x9820('0x4e')]?_0x219572['attributes']:_0x351c6e['model'];_0x219572['order']=qs['sort'](_0x2e84f9[_0x9820('0x44')][_0x9820('0xd6')]);_0x219572[_0x9820('0x43')]=qs[_0x9820('0xd2')](_['pick'](_0x2e84f9[_0x9820('0x44')],_0x351c6e['filters']));if(_0x2e84f9[_0x9820('0x44')][_0x9820('0x2e')]){_0x219572[_0x9820('0x43')]=_['merge'](_0x219572[_0x9820('0x43')],{'$or':_[_0x9820('0x30')](_0x219572[_0x9820('0x48')],function(_0x567535){var _0xaa3c59={};_0xaa3c59[_0x567535]={'$like':'%'+_0x2e84f9['query'][_0x9820('0x2e')]+'%'};return _0xaa3c59;})});}_0x219572=_[_0x9820('0x5b')]({},_0x219572,_0x2e84f9[_0x9820('0x5c')]);return _0x14c3e9[_0x9820('0xe9')](_0x219572);}})['then'](function(_0x167f32){if(_0x167f32){_0x401272=_0x167f32[_0x9820('0x4e')];if(!_0x2e84f9[_0x9820('0x44')][_0x9820('0xdb')](_0x9820('0xd8'))){_0x219572[_0x9820('0x17')]=qs[_0x9820('0x17')](_0x2e84f9['query'][_0x9820('0x17')]);_0x219572[_0x9820('0x19')]=qs[_0x9820('0x19')](_0x2e84f9[_0x9820('0x44')][_0x9820('0x19')]);}return _0x14c3e9[_0x9820('0xe9')](_0x219572);}})[_0x9820('0x1b')](function(_0x53dc27){if(_0x53dc27){return _0x53dc27?{'count':_0x401272,'rows':_0x53dc27}:null;}})['then'](respondWithResult(_0xa73645,null))['catch'](handleError(_0xa73645,null));};exports[_0x9820('0xea')]=function(_0x47ab22,_0xeb9612,_0x390f8f){var _0x1a9f29;var _0x339184;var _0x41d38d;var _0x4baa50=!_['isNil'](_0x47ab22[_0x9820('0x59')]['id'])?_0x47ab22[_0x9820('0x59')]['id']:!_['isNil'](_0x47ab22['user']['id'])?_0x47ab22[_0x9820('0x2b')]['id']:null;return db['User'][_0x9820('0x33')]({'where':{'id':_0x4baa50,'role':{'$or':[_0x9820('0x81'),_0x9820('0x2b'),_0x9820('0x26')]}},'attributes':['id',_0x9820('0x34'),_0x9820('0xeb'),_0x9820('0xec'),_0x9820('0x25'),_0x9820('0x62'),_0x9820('0x9e')]})[_0x9820('0x1b')](function(_0x1915ea){if(_0x1915ea){if(_0x1915ea[_0x9820('0x25')]==='agent'){_0x1a9f29=_0x1915ea;if(_0x47ab22['body']['interface']){_0x41d38d=util[_0x9820('0xc6')](_0x9820('0xed'),_0x1a9f29[_0x47ab22[_0x9820('0x5d')][_0x9820('0xa0')]]);}else if(_0x47ab22[_0x9820('0x5d')][_0x9820('0xee')]){_0x41d38d=util[_0x9820('0xc6')]('SIP/%s',_0x47ab22['body'][_0x9820('0xee')]);}else{_0x41d38d=util[_0x9820('0xc6')](_0x9820('0xef'),_0x1a9f29[_0x9820('0x34')]);}socket['to'](util[_0x9820('0xc6')]('user:%s',_0x1a9f29['name']))[_0x9820('0xac')](_0x9820('0xf0'),{'user':{'id':_0x1a9f29['id'],'name':_0x1a9f29['name']},'ip':_0x47ab22[_0x9820('0xf1')][_0x9820('0xf2')]||_0x47ab22[_0x9820('0xf3')][_0x9820('0xf4')]||_0x47ab22[_0x9820('0xf5')]['remoteAddress']||_0x47ab22[_0x9820('0xf3')]['socket'][_0x9820('0xf4')]});return db[_0x9820('0xae')]['destroy']({'where':{'membername':_0x1a9f29[_0x9820('0x34')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x9820('0x91'))](_0x9820('0xf6'));}})['then'](function(){if(_0x1a9f29){return _0x1a9f29[_0x9820('0xf7')]({'raw':!![]});}})[_0x9820('0x1b')](function(_0xd8ca47){if(_0x1a9f29){if(_0xd8ca47){_0x339184=_0xd8ca47;if(_0x339184[_0x9820('0x4e')]){var _0x5ad58d=_0x339184[_0x9820('0x30')](function(_0x20700d){var _0x103715={'membername':_0x1a9f29['name'],'UserId':_0x1a9f29['id'],'queue_name':_0x20700d[_0x9820('0x34')],'VoiceQueueId':_0x20700d['id'],'interface':_0x41d38d,'paused':_0x1a9f29[_0x9820('0x9e')]||![],'penalty':_0x20700d[_0x9820('0xf8')]||0x0};return db['UserVoiceQueueRt']['upsert'](_0x103715);});return Promise[_0x9820('0x56')](_0x5ad58d);}}}})[_0x9820('0x1b')](function(){if(_0x1a9f29){return db[_0x9820('0xf9')]['findAll']({'where':{'membername':_0x1a9f29[_0x9820('0x34')],'exitAt':null}});}})[_0x9820('0x1b')](function(_0x3d4618){if(_0x1a9f29){var _0x19c4a7=[];_0x3d4618['forEach'](function(_0x3ca319){_0x19c4a7[_0x9820('0x49')](_0x3ca319[_0x9820('0x24')]({'exitAt':moment()[_0x9820('0xc6')](_0x9820('0xfa'))}));});return Promise[_0x9820('0x56')](_0x19c4a7);}})[_0x9820('0x1b')](function(){if(_0x1a9f29){var _0x338683=[];var _0x3abdda=[];var _0x32ee0a=utils['getChannels']();var _0x1b2f48={'membername':_0x1a9f29[_0x9820('0x34')],'interface':_0x41d38d,'enterAt':moment()['format'](_0x9820('0xfa')),'role':_0x1a9f29['role'],'internal':_0x1a9f29[_0x9820('0x62')]};_0x32ee0a[_0x9820('0xfb')](function(_0x35c55a){_0x338683[_0x9820('0x49')](_[_0x9820('0x5b')]({'channel':_0x35c55a,'type':_0x9820('0xfc'),'data1':_0x47ab22[_0x9820('0x5d')][_0x9820('0xfd')],'data2':_0x41d38d},_0x1b2f48));if(_0x1a9f29['loginInPause']){_0x3abdda[_0x9820('0x49')](_[_0x9820('0x5b')]({'channel':_0x35c55a,'type':_0x9820('0xfe'),'data1':_0x9820('0xff')},_0x1b2f48));}});return db[_0x9820('0xf9')][_0x9820('0x8a')](_0x338683[_0x9820('0xc5')](_0x3abdda),{'individualHooks':!![]});}})[_0x9820('0x1b')](function(){if(_0x1a9f29){return _0x1a9f29[_0x9820('0x24')]({'online':!![],'lastLoginAt':moment()[_0x9820('0xc6')](_0x9820('0xfa')),'voicePause':_0x1a9f29[_0x9820('0x9e')]||![],'mailPause':_0x1a9f29[_0x9820('0x9e')]||![],'chatPause':_0x1a9f29[_0x9820('0x9e')]||![],'faxPause':_0x1a9f29[_0x9820('0x9e')]||![],'smsPause':_0x1a9f29[_0x9820('0x9e')]||![],'openchannelPause':_0x1a9f29[_0x9820('0x9e')]||![],'whatsappPause':_0x1a9f29[_0x9820('0x9e')]||![],'pauseType':_0x1a9f29[_0x9820('0x9e')]?_0x9820('0xff'):null,'interface':_0x41d38d,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x9820('0x1b')](function(_0x3cc618){if(_0x47ab22[_0x9820('0x100')]){return _0x390f8f();}else{return Promise[_0x9820('0x101')](_0x3cc618)[_0x9820('0x1b')](respondWithResult(_0xeb9612,null));}})[_0x9820('0x57')](handleError(_0xeb9612,null));};exports['logout']=function(_0x4c4801,_0x4e63a3){var _0x3e1a88;return db[_0x9820('0x37')][_0x9820('0x33')]({'where':{'id':_0x4c4801[_0x9820('0x59')]['id'],'role':_0x9820('0x26')},'attributes':['id',_0x9820('0x34'),_0x9820('0x25')]})[_0x9820('0x1b')](handleEntityNotFound(_0x4e63a3,null))['then'](function(_0x47c710){if(_0x47c710){_0x3e1a88=_0x47c710;return db[_0x9820('0xae')][_0x9820('0x28')]({'where':{'membername':_0x3e1a88['name']},'individualHooks':!![]});}})[_0x9820('0x1b')](function(){return db[_0x9820('0xf9')]['findAll']({'where':{'membername':_0x3e1a88[_0x9820('0x34')],'exitAt':null}});})[_0x9820('0x1b')](function(_0x2b7242){var _0x321992=[];_0x2b7242['forEach'](function(_0x19e9bd){_0x321992['push'](_0x19e9bd[_0x9820('0x24')]({'exitAt':moment()['format'](_0x9820('0xfa'))}));});return Promise[_0x9820('0x56')](_0x321992);})['then'](function(){return _0x3e1a88[_0x9820('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x9820('0x1b')](respondWithResult(_0x4e63a3,null))[_0x9820('0x57')](handleError(_0x4e63a3,null));};exports[_0x9820('0x102')]=function(_0x35c013,_0x31c8bc){var _0x1770c6;return db[_0x9820('0xae')][_0x9820('0x24')]({'paused':0x1},{'where':{'UserId':_0x35c013['params']['id']},'individualHooks':!![]})[_0x9820('0x1b')](function(){return db[_0x9820('0x37')][_0x9820('0x33')]({'where':{'id':_0x35c013[_0x9820('0x59')]['id'],'role':_0x9820('0x26')},'attributes':['id',_0x9820('0x34'),_0x9820('0x25'),_0x9820('0x62'),_0x9820('0xa0'),_0x9820('0x9d')]});})[_0x9820('0x1b')](handleEntityNotFound(_0x31c8bc,null))[_0x9820('0x1b')](function(_0x32733a){if(_0x32733a){_0x1770c6=_0x32733a;return respondWithRpcPromise('QueuePause',_0x9820('0x102'),{'id':_0x1770c6['id'],'name':_0x1770c6[_0x9820('0x34')],'pause':!![]});}})[_0x9820('0x1b')](function(){if(_0x1770c6){return db[_0x9820('0xf9')]['findAll']({'where':{'membername':_0x1770c6[_0x9820('0x34')],'type':_0x9820('0xfe'),'exitAt':null}});}})[_0x9820('0x1b')](function(_0x1d70a6){if(_0x1d70a6['length']){var _0x13ea28=moment()[_0x9820('0xc6')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x86f0f7=0x0,_0x32a898=_0x1d70a6[_0x9820('0x4e')];_0x86f0f7<_0x32a898;_0x86f0f7++){_0x1d70a6[_0x86f0f7][_0x9820('0x103')]({'exitAt':_0x13ea28});}}})['then'](function(){var _0x463319=[];var _0x15aa66=utils[_0x9820('0x104')]();_0x15aa66['forEach'](function(_0x19db15){_0x463319[_0x9820('0x49')]({'channel':_0x19db15,'membername':_0x1770c6['name'],'interface':_[_0x9820('0x6b')](_0x1770c6['interface'])?util[_0x9820('0xc6')]('SIP/%s',_0x1770c6['name']):_0x1770c6[_0x9820('0xa0')],'type':_0x9820('0xfe'),'enterAt':moment()[_0x9820('0xc6')](_0x9820('0xfa')),'data1':_0x35c013['body'][_0x9820('0x39')]||_0x9820('0x105'),'role':_0x1770c6[_0x9820('0x25')],'internal':_0x1770c6[_0x9820('0x62')]});});return db[_0x9820('0xf9')][_0x9820('0x8a')](_0x463319,{'individualHooks':!![]});})[_0x9820('0x1b')](function(){return _0x1770c6[_0x9820('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x35c013[_0x9820('0x5d')][_0x9820('0x39')]||_0x9820('0x105'),'lastPauseAt':moment()[_0x9820('0xc6')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x9820('0x1b')](respondWithResult(_0x31c8bc,null))[_0x9820('0x57')](handleError(_0x31c8bc,null));};exports['unpause']=function(_0xeafdfd,_0x3d8eb8){if(_0xeafdfd['body'][_0x9820('0x9c')]&&!utils[_0x9820('0xa1')](_0xeafdfd['body'][_0x9820('0x9c')])){throw new APIBadRequestError(util[_0x9820('0xc6')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0xeafdfd[_0x9820('0x5d')][_0x9820('0x9c')]));}return db['User']['find']({'where':{'id':_0xeafdfd[_0x9820('0x59')]['id']},'attributes':['id',_0x9820('0x34'),_0x9820('0x25'),_0x9820('0x62'),_0x9820('0xa0'),_0x9820('0x9d'),_0x9820('0x9f'),_0x9820('0x106'),'chatPause',_0x9820('0x107'),_0x9820('0x108'),_0x9820('0x109'),_0x9820('0x10a'),_0x9820('0x10b'),_0x9820('0x10c')]})[_0x9820('0x1b')](function(_0x860bd3){if(!_0x860bd3){throw new APINotFoundError(util[_0x9820('0xc6')](_0x9820('0xc7'),_0xeafdfd[_0x9820('0x59')]['id']));}return _0x860bd3[_0x9820('0x10d')](_0xeafdfd[_0x9820('0x5d')]['channel']);})[_0x9820('0x1b')](respondWithResult(_0x3d8eb8,null))[_0x9820('0x57')](APIHandleError(_0x3d8eb8));};exports[_0x9820('0x10e')]=function(_0x56b5fd,_0x2857e5){var _0x4cdbdb={};var _0x3903a0={};var _0x17b614;var _0x2a0b7c;return db[_0x9820('0x37')][_0x9820('0x96')]({'where':{'id':_0x56b5fd[_0x9820('0x59')]['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0x2857e5,null))['then'](function(_0x372479){if(_0x372479){_0x17b614=_0x372479;_0x3903a0[_0x9820('0xce')]=_[_0x9820('0xcf')](db[_0x9820('0x10f')][_0x9820('0xd1')]);_0x3903a0[_0x9820('0x44')]=_[_0x9820('0xcf')](_0x56b5fd[_0x9820('0x44')]);_0x3903a0[_0x9820('0xd2')]=_[_0x9820('0xd3')](_0x3903a0['model'],_0x3903a0['query']);_0x4cdbdb[_0x9820('0x48')]=_[_0x9820('0xd3')](_0x3903a0[_0x9820('0xce')],qs['fields'](_0x56b5fd[_0x9820('0x44')]['fields']));_0x4cdbdb[_0x9820('0x48')]=_0x4cdbdb[_0x9820('0x48')]['length']?_0x4cdbdb[_0x9820('0x48')]:_0x3903a0['model'];_0x4cdbdb['order']=qs[_0x9820('0xd6')](_0x56b5fd['query'][_0x9820('0xd6')]);_0x4cdbdb[_0x9820('0x43')]=qs[_0x9820('0xd2')](_['pick'](_0x56b5fd[_0x9820('0x44')],_0x3903a0[_0x9820('0xd2')]));if(_0x56b5fd['query']['filter']){_0x4cdbdb[_0x9820('0x43')]=_[_0x9820('0x5b')](_0x4cdbdb['where'],{'$or':_['map'](_0x4cdbdb[_0x9820('0x48')],function(_0xfafa13){var _0x8d94fb={};_0x8d94fb[_0xfafa13]={'$like':'%'+_0x56b5fd[_0x9820('0x44')][_0x9820('0x2e')]+'%'};return _0x8d94fb;})});}_0x4cdbdb=_[_0x9820('0x5b')]({},_0x4cdbdb,_0x56b5fd[_0x9820('0x5c')]);return _0x17b614[_0x9820('0x10e')](_0x4cdbdb);}})[_0x9820('0x1b')](function(_0x3f2a42){if(_0x3f2a42){_0x2a0b7c=_0x3f2a42[_0x9820('0x4e')];if(!_0x56b5fd['query'][_0x9820('0xdb')](_0x9820('0xd8'))){_0x4cdbdb[_0x9820('0x17')]=qs[_0x9820('0x17')](_0x56b5fd[_0x9820('0x44')][_0x9820('0x17')]);_0x4cdbdb[_0x9820('0x19')]=qs[_0x9820('0x19')](_0x56b5fd[_0x9820('0x44')][_0x9820('0x19')]);}return _0x17b614[_0x9820('0x10e')](_0x4cdbdb);}})['then'](function(_0x2aabd7){if(_0x2aabd7){return _0x2aabd7?{'count':_0x2a0b7c,'rows':_0x2aabd7}:null;}})[_0x9820('0x1b')](respondWithResult(_0x2857e5,null))[_0x9820('0x57')](handleError(_0x2857e5,null));};exports['addTeams']=function(_0x5e4281,_0x3bd698){var _0x22dafe=_0x5e4281[_0x9820('0x59')]['id'];var _0x5edeb7=_0x5e4281[_0x9820('0x5d')]?_0x5e4281[_0x9820('0x5d')][_0x9820('0x60')]:null;var _0x548136=[];return Promise[_0x9820('0x101')]()[_0x9820('0x1b')](function(){if(!_0x5edeb7)throw new APIBadRequestError(_0x9820('0x110'));})[_0x9820('0x1b')](function(){return db[_0x9820('0x37')][_0x9820('0x96')]({'where':{'id':_0x22dafe}});})[_0x9820('0x1b')](function(_0x4e5744){if(!_0x4e5744)throw new APINotFoundError(util['format'](_0x9820('0xc7'),_0x5e4281[_0x9820('0x59')]['id']));return db[_0x9820('0x67')][_0x9820('0x111')](function(_0x466637){return _0x4e5744[_0x9820('0x112')](_0x5edeb7,{'transaction':_0x466637})[_0x9820('0x1b')](function(){return db[_0x9820('0x10f')][_0x9820('0x4a')]({'where':{'id':{'$in':_0x5edeb7}}});})['then'](function(_0x50a8f8){var _0x414e69=_[_0x9820('0x30')](_0x50a8f8,function(_0x155ce1){return _0x155ce1[_0x9820('0x113')]();});return Promise[_0x9820('0x56')](_0x414e69);})[_0x9820('0x1b')](function(_0x8df61e){_0x548136=_[_0x9820('0x114')](_0x8df61e);var _0x1dff73=_[_0x9820('0x30')](_0x548136,function(_0x1857d6){return _0x1857d6[_0x9820('0x115')](_0x4e5744['id'],{'transaction':_0x466637});});return Promise['all'](_0x1dff73);})[_0x9820('0x1b')](function(){if(!_0x4e5744['online'])return;var _0x174a1e=_[_0x9820('0x2e')](_0x548136,function(_0x56ec0f){return _0x56ec0f[_0x9820('0x116')](_0x9820('0x9c'))==='Voice';});var _0x2fa0e6=_[_0x9820('0x30')](_0x174a1e,function(_0x1a06f1){return db[_0x9820('0xae')][_0x9820('0xa9')]({'membername':_0x4e5744[_0x9820('0x34')],'UserId':_0x4e5744['id'],'queue_name':_0x1a06f1[_0x9820('0x34')],'VoiceQueueId':_0x1a06f1['id'],'interface':_[_0x9820('0x6b')](_0x4e5744[_0x9820('0xa0')])?util[_0x9820('0xc6')]('SIP/%s',_0x4e5744['name']):_0x4e5744[_0x9820('0xa0')],'paused':_0x4e5744[_0x9820('0x9f')]||![],'penalty':_0x4e5744[_0x9820('0xa7')]},{'transaction':_0x466637});});return Promise['all'](_0x2fa0e6);})[_0x9820('0x1b')](function(){return db[_0x9820('0x117')][_0x9820('0x4a')]({'where':{'teamId':{'$in':_0x5edeb7}}});})[_0x9820('0x1b')](function(_0x445730){var _0x14a29a=_[_0x9820('0x30')](_0x445730,function(_0x1b1e9f){return db[_0x9820('0x118')][_0x9820('0x7e')]({'UserId':_0x4e5744['id'],'VoicePrefixId':_0x1b1e9f[_0x9820('0x119')]},{'transaction':_0x466637});});return Promise['all'](_0x14a29a);});});})['then'](function(){for(var _0x4fca8f=0x0;_0x4fca8f<_0x548136[_0x9820('0x4e')];_0x4fca8f++){var _0x57673f=_0x548136[_0x4fca8f][_0x9820('0x116')]('channel');var _0x2aa250=_0x57673f+'QueueId';socket['emit'](_0x9820('0x2b')+_0x57673f+_0x9820('0x11a'),{'UserId':_0x22dafe,['queueField']:_0x548136[_0x4fca8f]['id']});}})[_0x9820('0x1b')](respondWithStatusCode(_0x3bd698,null))['catch'](APIHandleError(_0x3bd698));};exports[_0x9820('0x11b')]=function(_0x59f2db,_0x1a7635){var _0x224c49=_0x59f2db[_0x9820('0x59')]['id'];var _0x5f24a1=null;if(_0x59f2db[_0x9820('0x44')]['ids']){_0x5f24a1=_[_0x9820('0x11c')](_0x59f2db[_0x9820('0x44')][_0x9820('0x60')])?_0x59f2db['query'][_0x9820('0x60')]:[_0x59f2db[_0x9820('0x44')][_0x9820('0x60')]];}var _0x4b0a19=[];return Promise[_0x9820('0x101')]()[_0x9820('0x1b')](function(){if(!_0x5f24a1)throw new APIBadRequestError(_0x9820('0x11d'));})['then'](function(){return db[_0x9820('0x37')][_0x9820('0x96')]({'where':{'id':_0x224c49}});})[_0x9820('0x1b')](function(_0x5f1afd){if(!_0x5f1afd)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x59f2db['params']['id']));return db['sequelize'][_0x9820('0x111')](function(_0x42206f){return _0x5f1afd[_0x9820('0x11b')](_0x5f24a1,{'transaction':_0x42206f})[_0x9820('0x1b')](function(){return db[_0x9820('0x10f')][_0x9820('0x4a')]({'where':{'id':{'$in':_0x5f24a1}}});})[_0x9820('0x1b')](function(_0x20638a){var _0x516430=_[_0x9820('0x30')](_0x20638a,function(_0x38dd17){return _0x38dd17[_0x9820('0x113')]();});return Promise[_0x9820('0x56')](_0x516430);})['then'](function(_0x2a9ec8){_0x4b0a19=_[_0x9820('0x114')](_0x2a9ec8);var _0x1040dd=_[_0x9820('0x30')](_0x4b0a19,function(_0x1e67a5){return _0x1e67a5[_0x9820('0x11e')](_0x5f1afd['id'],{'transaction':_0x42206f});});return Promise['all'](_0x1040dd);})[_0x9820('0x1b')](function(){if(!_0x5f1afd[_0x9820('0x9d')])return;var _0x27afb9=_[_0x9820('0x2e')](_0x4b0a19,function(_0x447f69){return _0x447f69[_0x9820('0x116')]('channel')===_0x9820('0x11f');});var _0x565d47=_[_0x9820('0x30')](_0x27afb9,function(_0x5614df){return db[_0x9820('0xae')]['destroy']({'where':{'VoiceQueueId':_0x5614df['id'],'UserId':_0x5f1afd['id']},'transaction':_0x42206f});});return Promise['all'](_0x565d47);})[_0x9820('0x1b')](function(){return db[_0x9820('0x117')][_0x9820('0x4a')]({'where':{'teamId':{'$in':_0x5f24a1}}});})[_0x9820('0x1b')](function(_0x2bff2d){var _0xb97799=_[_0x9820('0x30')](_0x2bff2d,function(_0x4c8772){return db[_0x9820('0x118')][_0x9820('0x28')]({'where':{'UserId':_0x5f1afd['id'],'VoicePrefixId':_0x4c8772[_0x9820('0x119')]}},{'transaction':_0x42206f});});return Promise[_0x9820('0x56')](_0xb97799);});});})[_0x9820('0x1b')](function(){for(var _0x47404e=0x0;_0x47404e<_0x4b0a19[_0x9820('0x4e')];_0x47404e++){var _0xec89e7=_0x4b0a19[_0x47404e][_0x9820('0x116')](_0x9820('0x9c'));var _0x1cc589=_0xec89e7+_0x9820('0xab');socket['emit'](_0x9820('0x2b')+_0xec89e7+_0x9820('0xad'),{'UserId':_0x224c49,['queueField']:_0x4b0a19[_0x47404e]['id']});}})['then'](respondWithStatusCode(_0x1a7635,null))[_0x9820('0x57')](APIHandleError(_0x1a7635));};exports['getLists']=function(_0x45c77c,_0x3edf7e){var _0x59b97b={};var _0x446a70={};var _0x5d2fdb;var _0x37e107;return db[_0x9820('0x37')]['findOne']({'where':{'id':_0x45c77c[_0x9820('0x59')]['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0x3edf7e,null))[_0x9820('0x1b')](function(_0x2c782e){if(_0x2c782e){_0x5d2fdb=_0x2c782e;_0x446a70[_0x9820('0xce')]=_['keys'](db[_0x9820('0xc8')]['rawAttributes']);_0x446a70[_0x9820('0x44')]=_[_0x9820('0xcf')](_0x45c77c[_0x9820('0x44')]);_0x446a70[_0x9820('0xd2')]=_[_0x9820('0xd3')](_0x446a70[_0x9820('0xce')],_0x446a70[_0x9820('0x44')]);_0x59b97b[_0x9820('0x48')]=_[_0x9820('0xd3')](_0x446a70[_0x9820('0xce')],qs['fields'](_0x45c77c[_0x9820('0x44')][_0x9820('0xd4')]));_0x59b97b['attributes']=_0x59b97b[_0x9820('0x48')]['length']?_0x59b97b[_0x9820('0x48')]:_0x446a70[_0x9820('0xce')];_0x59b97b['order']=qs['sort'](_0x45c77c['query'][_0x9820('0xd6')]);_0x59b97b[_0x9820('0x43')]=qs[_0x9820('0xd2')](_['pick'](_0x45c77c[_0x9820('0x44')],_0x446a70['filters']));if(_0x45c77c[_0x9820('0x44')][_0x9820('0x2e')]){_0x59b97b['where']=_[_0x9820('0x5b')](_0x59b97b[_0x9820('0x43')],{'$or':_[_0x9820('0x30')](_0x59b97b['attributes'],function(_0x49301f){var _0x15e010={};_0x15e010[_0x49301f]={'$like':'%'+_0x45c77c[_0x9820('0x44')][_0x9820('0x2e')]+'%'};return _0x15e010;})});}_0x59b97b=_[_0x9820('0x5b')]({},_0x59b97b,_0x45c77c[_0x9820('0x5c')]);return _0x5d2fdb[_0x9820('0x120')](_0x59b97b);}})[_0x9820('0x1b')](function(_0x454b89){if(_0x454b89){_0x37e107=_0x454b89[_0x9820('0x4e')];if(!_0x45c77c[_0x9820('0x44')][_0x9820('0xdb')](_0x9820('0xd8'))){_0x59b97b['limit']=qs['limit'](_0x45c77c[_0x9820('0x44')]['limit']);_0x59b97b[_0x9820('0x19')]=qs[_0x9820('0x19')](_0x45c77c[_0x9820('0x44')][_0x9820('0x19')]);}return _0x5d2fdb[_0x9820('0x120')](_0x59b97b);}})[_0x9820('0x1b')](function(_0x5c8b4a){if(_0x5c8b4a){return _0x5c8b4a?{'count':_0x37e107,'rows':_0x5c8b4a}:null;}})[_0x9820('0x1b')](respondWithResult(_0x3edf7e,null))[_0x9820('0x57')](handleError(_0x3edf7e,null));};exports[_0x9820('0x121')]=function(_0x158f36,_0x2fe770){var _0x505eba={};var _0x177771={};var _0x8f7d6e;return db['User'][_0x9820('0x96')]({'where':{'id':_0x158f36[_0x9820('0x59')]['id']}})[_0x9820('0x1b')](handleEntityNotFound(_0x2fe770,null))[_0x9820('0x1b')](function(_0x3b5347){if(_0x3b5347){_0x8f7d6e=_0x3b5347;_0x177771['model']=_['keys'](db[_0x9820('0x37')]['rawAttributes']);_0x177771[_0x9820('0x44')]=_[_0x9820('0xcf')](_0x158f36[_0x9820('0x44')]);_0x177771['filters']=_[_0x9820('0xd3')](_0x177771['model'],_0x177771['query']);_0x505eba[_0x9820('0x48')]=_[_0x9820('0xd3')](_0x177771[_0x9820('0xce')],qs[_0x9820('0xd4')](_0x158f36['query']['fields']));_0x505eba[_0x9820('0x48')]=_0x505eba[_0x9820('0x48')]['length']?_0x505eba[_0x9820('0x48')]:_0x177771[_0x9820('0xce')];_0x505eba['order']=qs[_0x9820('0xd6')](_0x158f36[_0x9820('0x44')][_0x9820('0xd6')]);_0x505eba[_0x9820('0x43')]=qs[_0x9820('0xd2')](_[_0x9820('0xd9')](_0x158f36[_0x9820('0x44')],_0x177771[_0x9820('0xd2')]));if(_0x158f36[_0x9820('0x44')][_0x9820('0x2e')]){_0x505eba['where']=_[_0x9820('0x5b')](_0x505eba[_0x9820('0x43')],{'$or':_[_0x9820('0x30')](_0x505eba['attributes'],function(_0x3c83fc){var _0x384cf2={};_0x384cf2[_0x3c83fc]={'$like':'%'+_0x158f36[_0x9820('0x44')]['filter']+'%'};return _0x384cf2;})});}_0x505eba[_0x9820('0xce')]=db[_0x9820('0x37')];_0x505eba['as']=_0x9820('0x2c');_0x505eba=_[_0x9820('0x5b')]({},_0x505eba,_0x158f36[_0x9820('0x5c')]);return _0x8f7d6e[_0x9820('0xf7')]({'include':[_0x505eba]});}})['then'](function(_0x30456e){if(_0x30456e){var _0x4518e4={},_0x188a03=[];for(var _0x24a3ac=0x0;_0x24a3ac<_0x30456e[_0x9820('0x4e')];_0x24a3ac+=0x1){for(var _0x4fd889=0x0,_0x21f7cf;_0x4fd889<_0x30456e[_0x24a3ac][_0x9820('0x2c')]['length'];_0x4fd889+=0x1){_0x21f7cf=_0x30456e[_0x24a3ac][_0x9820('0x2c')][_0x4fd889]['get']({'plain':!![]});_0x4518e4[_0x21f7cf['id']]=_0x21f7cf;}}_0x4518e4=_[_0x9820('0x122')](_0x4518e4);for(var _0x43c374=qs[_0x9820('0x19')](_0x158f36[_0x9820('0x44')]['offset']);_0x43c374<_0x4518e4[_0x9820('0x4e')]&&_0x188a03['length']=_0x20c8d5['agents']){throw new Error(_0xea4d('0x4c'));}})['then'](function(){if(_0x582b18){return db['UserVoiceQueueRt'][_0xea4d('0x4d')]({'where':{'membername':_0x582b18['name']},'individualHooks':!![]});}})['then'](function(){if(_0x582b18){return _0x582b18[_0xea4d('0x4e')]({'raw':!![]});}})[_0xea4d('0x15')](function(_0x53d3b7){if(_0x582b18){if(_0x53d3b7){var _0x129da8=[];_0x372b71=_0x53d3b7;if(_0x372b71[_0xea4d('0x2a')]){for(var _0x48e31d=0x0;_0x48e31d<_0x372b71['length'];_0x48e31d++){_0x129da8[_0xea4d('0x2f')](db[_0xea4d('0x26')][_0xea4d('0x4f')]({'membername':_0x582b18[_0xea4d('0x1f')],'UserId':_0x582b18['id'],'queue_name':_0x372b71[_0x48e31d]['name'],'VoiceQueueId':_0x372b71[_0x48e31d]['id'],'interface':_0x12def6,'paused':_0x582b18['loginInPause']||![],'penalty':_0x372b71[_0x48e31d]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x129da8);}}}})[_0xea4d('0x15')](function(){if(_0x582b18){return db[_0xea4d('0x28')][_0xea4d('0xd')]({'where':{'membername':_0x582b18[_0xea4d('0x1f')],'exitAt':null}});}})[_0xea4d('0x15')](function(_0x5bda46){if(_0x582b18){if(_0x5bda46&&_0x5bda46[_0xea4d('0x2a')]){var _0x388759=[];_0x5bda46['forEach'](function(_0x4faf88){_0x388759[_0xea4d('0x2f')](_0x4faf88['update']({'exitAt':moment()[_0xea4d('0x23')](_0xea4d('0x2b'))}));});return BPromise['all'](_0x388759);}}})[_0xea4d('0x15')](function(){if(_0x582b18){var _0xf64b37=[];var _0x3f37db=[];var _0x427c70=utils['getChannels']();var _0x22fd29={'membername':_0x582b18['name'],'interface':_0x12def6,'enterAt':moment()[_0xea4d('0x23')](_0xea4d('0x2b')),'role':_0x582b18[_0xea4d('0x20')],'internal':_0x582b18[_0xea4d('0x21')]};_0x427c70[_0xea4d('0x2e')](function(_0x29cd46){_0xf64b37[_0xea4d('0x2f')](_[_0xea4d('0x50')]({'channel':_0x29cd46,'type':'LOGIN','data1':_0xea4d('0x51'),'data2':_0x12def6},_0x22fd29));if(_0x582b18[_0xea4d('0x46')]){_0x3f37db[_0xea4d('0x2f')](_[_0xea4d('0x50')]({'channel':_0x29cd46,'type':_0xea4d('0x29'),'data1':_0xea4d('0x52')},_0x22fd29));}});return db[_0xea4d('0x28')]['bulkCreate'](_0xf64b37[_0xea4d('0x53')](_0x3f37db),{'individualHooks':!![]});}})['then'](function(){if(_0x582b18){return _0x582b18[_0xea4d('0x27')]({'online':!![],'lastLoginAt':moment()['format'](_0xea4d('0x2b')),'voicePause':_0x582b18[_0xea4d('0x46')]||![],'mailPause':_0x582b18[_0xea4d('0x46')]||![],'chatPause':_0x582b18[_0xea4d('0x46')]||![],'faxPause':_0x582b18[_0xea4d('0x46')]||![],'smsPause':_0x582b18[_0xea4d('0x46')]||![],'openchannelPause':_0x582b18['loginInPause']||![],'pauseType':_0x582b18['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xea4d('0x23')](_0xea4d('0x2b')),'interface':_0x12def6});}})[_0xea4d('0x15')](function(_0x19dbf8){_0x32feb6(_0x19dbf8);})[_0xea4d('0x18')](function(_0x2d56a9){_0x269173(_0xa1b376[_0xea4d('0x19')](0x1f4,_0x2d56a9[_0xea4d('0x1a')]));});});}; \ No newline at end of file +var _0xce28=['../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','findAll','options','raw','where','attributes','limit','include','map','model','then','info','GetUser','debug','stringify','catch','message','error','ShowUser','find','PauseUser','User','name','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','update','MemberReport','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','isNil','PAUSE','body','DEFAULT\x20PAUSE','uniqueid','bulkCreate','type','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','role','online','voicePause','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','unpause','system','UserVoiceQueueRt','push','all','mobile','phone','loginInPause','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','concat','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x23804e,_0x445ff0){var _0x5ba8bd=function(_0xce0e46){while(--_0xce0e46){_0x23804e['push'](_0x23804e['shift']());}};_0x5ba8bd(++_0x445ff0);}(_0xce28,0x1cb));var _0x8ce2=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xce28[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0x8ce2('0x0'));var util=require(_0x8ce2('0x1'));var moment=require(_0x8ce2('0x2'));var BPromise=require(_0x8ce2('0x3'));var Redis=require(_0x8ce2('0x4'));var db=require(_0x8ce2('0x5'))['db'];var utils=require(_0x8ce2('0x6'));var logger=require(_0x8ce2('0x7'))(_0x8ce2('0x8'));var config=require(_0x8ce2('0x9'));config[_0x8ce2('0xa')]=_[_0x8ce2('0xb')](config[_0x8ce2('0xa')],{'host':_0x8ce2('0xc'),'port':0x18eb});var socket=require(_0x8ce2('0xd'))(new Redis(config[_0x8ce2('0xa')]));require(_0x8ce2('0xe'))[_0x8ce2('0xf')](socket);exports['GetUser']=function(_0x561d5e){var _0x5e39a4=this;return new Promise(function(_0x8dd162,_0x56ec75){return db['User'][_0x8ce2('0x10')]({'raw':_0x561d5e[_0x8ce2('0x11')]?_0x561d5e[_0x8ce2('0x11')][_0x8ce2('0x12')]===undefined?!![]:![]:!![],'where':_0x561d5e['options']?_0x561d5e[_0x8ce2('0x11')][_0x8ce2('0x13')]||null:null,'attributes':_0x561d5e[_0x8ce2('0x11')]?_0x561d5e['options'][_0x8ce2('0x14')]||null:null,'limit':_0x561d5e[_0x8ce2('0x11')]?_0x561d5e[_0x8ce2('0x11')][_0x8ce2('0x15')]||null:null,'include':_0x561d5e[_0x8ce2('0x11')]?_0x561d5e[_0x8ce2('0x11')][_0x8ce2('0x16')]?_[_0x8ce2('0x17')](_0x561d5e[_0x8ce2('0x11')][_0x8ce2('0x16')],function(_0x2dfc6e){return{'model':db[_0x2dfc6e[_0x8ce2('0x18')]],'as':_0x2dfc6e['as'],'attributes':_0x2dfc6e[_0x8ce2('0x14')],'include':_0x2dfc6e[_0x8ce2('0x16')]?_['map'](_0x2dfc6e[_0x8ce2('0x16')],function(_0x1a41f){return{'model':db[_0x1a41f[_0x8ce2('0x18')]],'as':_0x1a41f['as'],'attributes':_0x1a41f['attributes'],'include':_0x1a41f[_0x8ce2('0x16')]?_['map'](_0x1a41f['include'],function(_0x542381){return{'model':db[_0x542381[_0x8ce2('0x18')]],'as':_0x542381['as'],'attributes':_0x542381[_0x8ce2('0x14')]};}):[]};}):[]};}):[]:[]})[_0x8ce2('0x19')](function(_0x47850c){logger[_0x8ce2('0x1a')](_0x8ce2('0x1b'),_0x561d5e);logger[_0x8ce2('0x1c')]('GetUser',_0x561d5e,JSON[_0x8ce2('0x1d')](_0x47850c));_0x8dd162(_0x47850c);})[_0x8ce2('0x1e')](function(_0x2ab92a){logger['error'](_0x8ce2('0x1b'),_0x2ab92a[_0x8ce2('0x1f')],_0x561d5e);_0x56ec75(_0x5e39a4[_0x8ce2('0x20')](0x1f4,_0x2ab92a[_0x8ce2('0x1f')]));});});};exports[_0x8ce2('0x21')]=function(_0x356e4c){var _0x159b00=this;return new Promise(function(_0x128f29,_0x2c7ab0){return db['User'][_0x8ce2('0x22')]({'raw':_0x356e4c[_0x8ce2('0x11')]?_0x356e4c[_0x8ce2('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x356e4c[_0x8ce2('0x11')]?_0x356e4c['options'][_0x8ce2('0x13')]||null:null,'attributes':_0x356e4c[_0x8ce2('0x11')]?_0x356e4c[_0x8ce2('0x11')]['attributes']||null:null,'include':_0x356e4c[_0x8ce2('0x11')]?_0x356e4c[_0x8ce2('0x11')][_0x8ce2('0x16')]?_[_0x8ce2('0x17')](_0x356e4c[_0x8ce2('0x11')]['include'],function(_0x195e77){return{'model':db[_0x195e77['model']],'as':_0x195e77['as'],'attributes':_0x195e77['attributes'],'include':_0x195e77['include']?_[_0x8ce2('0x17')](_0x195e77[_0x8ce2('0x16')],function(_0x1f4172){return{'model':db[_0x1f4172[_0x8ce2('0x18')]],'as':_0x1f4172['as'],'attributes':_0x1f4172[_0x8ce2('0x14')],'include':_0x1f4172[_0x8ce2('0x16')]?_[_0x8ce2('0x17')](_0x1f4172[_0x8ce2('0x16')],function(_0x45a98d){return{'model':db[_0x45a98d['model']],'as':_0x45a98d['as'],'attributes':_0x45a98d['attributes']};}):[]};}):[]};}):[]:[]})[_0x8ce2('0x19')](function(_0x109136){logger[_0x8ce2('0x1a')](_0x8ce2('0x21'),_0x356e4c);logger['debug']('ShowUser',_0x356e4c,JSON[_0x8ce2('0x1d')](_0x109136));_0x128f29(_0x109136);})[_0x8ce2('0x1e')](function(_0x280555){logger['error'](_0x8ce2('0x21'),_0x280555[_0x8ce2('0x1f')],_0x356e4c);_0x2c7ab0(_0x159b00[_0x8ce2('0x20')](0x1f4,_0x280555[_0x8ce2('0x1f')]));});});};exports[_0x8ce2('0x23')]=function(_0x547f8b){var _0x38f831;return db[_0x8ce2('0x24')]['find']({'where':_0x547f8b['options']['where']||{},'attributes':['id',_0x8ce2('0x25'),'role',_0x8ce2('0x26'),_0x8ce2('0x27')]})[_0x8ce2('0x19')](function(_0xb67860){if(!_0xb67860){throw new Error(util[_0x8ce2('0x28')](_0x8ce2('0x29'),_0x547f8b[_0x8ce2('0x2a')]['id']));}_0x38f831=_0xb67860;return db['UserVoiceQueueRt'][_0x8ce2('0x2b')]({'paused':0x1},{'where':{'UserId':_0x38f831['id']},'individualHooks':!![]});})[_0x8ce2('0x19')](function(){return db[_0x8ce2('0x2c')][_0x8ce2('0x10')]({'where':{'membername':_0x38f831[_0x8ce2('0x25')],'type':'PAUSE','exitAt':null}});})[_0x8ce2('0x19')](function(_0x302955){if(_0x302955&&_0x302955[_0x8ce2('0x2d')]){var _0x425ada=moment()['format'](_0x8ce2('0x2e'));for(var _0x9a2a58=0x0,_0x121ca8=_0x302955[_0x8ce2('0x2d')];_0x9a2a58<_0x121ca8;_0x9a2a58++){_0x302955[_0x9a2a58][_0x8ce2('0x2f')]({'exitAt':_0x425ada});}}})['then'](function(){var _0x45660e=[];var _0xa399fc=utils[_0x8ce2('0x30')]();_0xa399fc[_0x8ce2('0x31')](function(_0x24bbd7){_0x45660e['push']({'channel':_0x24bbd7,'membername':_0x38f831[_0x8ce2('0x25')],'interface':_[_0x8ce2('0x32')](_0x38f831[_0x8ce2('0x27')])?util['format']('SIP/%s',_0x38f831[_0x8ce2('0x25')]):_0x38f831[_0x8ce2('0x27')],'type':_0x8ce2('0x33'),'enterAt':moment()['format'](_0x8ce2('0x2e')),'data1':_0x547f8b[_0x8ce2('0x34')]['type']||_0x8ce2('0x35'),'role':_0x38f831['role'],'internal':_0x38f831[_0x8ce2('0x26')],'uniqueid':_0x547f8b[_0x8ce2('0x34')][_0x8ce2('0x36')]||null});});return db[_0x8ce2('0x2c')][_0x8ce2('0x37')](_0x45660e,{'individualHooks':!![]});})[_0x8ce2('0x19')](function(){return _0x38f831['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x547f8b[_0x8ce2('0x34')][_0x8ce2('0x38')]||_0x8ce2('0x35'),'lastPauseAt':moment()[_0x8ce2('0x28')](_0x8ce2('0x2e'))});})[_0x8ce2('0x1e')](function(_0x19690e){throw _0x19690e;});};exports[_0x8ce2('0x39')]=function(_0x86ddb){return Promise[_0x8ce2('0x3a')]()['then'](function(){if(_0x86ddb[_0x8ce2('0x34')][_0x8ce2('0x3b')]&&!utils[_0x8ce2('0x3c')](_0x86ddb[_0x8ce2('0x34')][_0x8ce2('0x3b')])){throw new Error(util['format'](_0x8ce2('0x3d'),_0x86ddb[_0x8ce2('0x34')]['channel']));}return db[_0x8ce2('0x24')][_0x8ce2('0x3e')]({'where':_0x86ddb[_0x8ce2('0x11')][_0x8ce2('0x13')]||{},'attributes':['id','name',_0x8ce2('0x3f'),_0x8ce2('0x26'),_0x8ce2('0x27'),_0x8ce2('0x40'),_0x8ce2('0x41'),_0x8ce2('0x42'),'chatPause',_0x8ce2('0x43'),_0x8ce2('0x44'),_0x8ce2('0x45'),_0x8ce2('0x46'),_0x8ce2('0x47'),_0x8ce2('0x48')]});})[_0x8ce2('0x19')](function(_0x148627){if(!_0x148627){throw new Error(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x86ddb[_0x8ce2('0x2a')]['id']));}return _0x148627[_0x8ce2('0x49')](_0x86ddb[_0x8ce2('0x34')][_0x8ce2('0x3b')],_0x8ce2('0x4a'));})[_0x8ce2('0x1e')](function(_0x434423){throw _0x434423;});};exports['LogoutUser']=function(_0x40bf6c){var _0x56cda5=this;return new Promise(function(_0x3d92bd,_0xd1dbb2){var _0x126b78;return db[_0x8ce2('0x24')]['findOne']({'where':_0x40bf6c[_0x8ce2('0x11')][_0x8ce2('0x13')]||{},'attributes':['id',_0x8ce2('0x25')]})['then'](function(_0x2e7c4b){if(_0x2e7c4b){_0x126b78=_0x2e7c4b;return db[_0x8ce2('0x4b')]['destroy']({'where':{'membername':_0x126b78[_0x8ce2('0x25')]},'individualHooks':!![]});}})[_0x8ce2('0x19')](function(){if(_0x126b78){return db[_0x8ce2('0x2c')][_0x8ce2('0x10')]({'where':{'membername':_0x126b78[_0x8ce2('0x25')],'exitAt':null}});}})['then'](function(_0xa604d0){if(_0x126b78){if(_0xa604d0&&_0xa604d0[_0x8ce2('0x2d')]){var _0x378dba=[];_0xa604d0[_0x8ce2('0x31')](function(_0x4a90f5){_0x378dba[_0x8ce2('0x4c')](_0x4a90f5[_0x8ce2('0x2b')]({'exitAt':moment()[_0x8ce2('0x28')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x8ce2('0x4d')](_0x378dba);}}})[_0x8ce2('0x19')](function(){if(_0x126b78){return _0x126b78[_0x8ce2('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x8ce2('0x19')](function(_0x96bfc1){_0x3d92bd(_0x96bfc1);})['catch'](function(_0x45888e){_0xd1dbb2(_0x56cda5[_0x8ce2('0x20')](0x1f4,_0x45888e['message']));});});};exports['LoginUser']=function(_0x1509c4){var _0x2ba7b5=this;return new Promise(function(_0x34f2be,_0xf180e9){var _0x12852f;var _0x17225c;var _0x551a40;var _0x41f2e4;return db[_0x8ce2('0x24')][_0x8ce2('0x3e')]({'where':_0x1509c4[_0x8ce2('0x11')]['where']||{},'attributes':['id','name',_0x8ce2('0x3f'),_0x8ce2('0x4e'),_0x8ce2('0x4f'),_0x8ce2('0x26'),_0x8ce2('0x50'),'interface']})[_0x8ce2('0x19')](function(_0x1571b3){if(_0x1571b3){_0x12852f=_0x1571b3;_0x41f2e4=_0x1509c4['body'][_0x8ce2('0x27')]?_0x1509c4[_0x8ce2('0x34')][_0x8ce2('0x27')]:util[_0x8ce2('0x28')]('SIP/%s',_0x12852f[_0x8ce2('0x25')]);return db[_0x8ce2('0x24')]['count']({'where':{'role':_0x8ce2('0x51'),'online':!![],'id':{'$ne':_0x12852f['id']}}});}})[_0x8ce2('0x19')](function(_0xb53c91){if(_0xb53c91){_0x551a40=_0xb53c91;return require('../../config/license/util')[_0x8ce2('0x52')]();}})[_0x8ce2('0x19')](function(_0x2e61e5){if(_0x2e61e5&&_0x2e61e5[_0x8ce2('0x53')]&&_0x551a40>=_0x2e61e5['agents']){throw new Error(_0x8ce2('0x54'));}})[_0x8ce2('0x19')](function(){if(_0x12852f){return db[_0x8ce2('0x4b')][_0x8ce2('0x55')]({'where':{'membername':_0x12852f[_0x8ce2('0x25')]},'individualHooks':!![]});}})['then'](function(){if(_0x12852f){return _0x12852f[_0x8ce2('0x56')]({'raw':!![]});}})[_0x8ce2('0x19')](function(_0x59df29){if(_0x12852f){if(_0x59df29){var _0x2499e3=[];_0x17225c=_0x59df29;if(_0x17225c[_0x8ce2('0x2d')]){for(var _0xc5e17e=0x0;_0xc5e17e<_0x17225c[_0x8ce2('0x2d')];_0xc5e17e++){_0x2499e3[_0x8ce2('0x4c')](db[_0x8ce2('0x4b')][_0x8ce2('0x57')]({'membername':_0x12852f[_0x8ce2('0x25')],'UserId':_0x12852f['id'],'queue_name':_0x17225c[_0xc5e17e][_0x8ce2('0x25')],'VoiceQueueId':_0x17225c[_0xc5e17e]['id'],'interface':_0x41f2e4,'paused':_0x12852f[_0x8ce2('0x50')]||![],'penalty':_0x17225c[_0xc5e17e][_0x8ce2('0x58')]||0x0}));}return BPromise[_0x8ce2('0x4d')](_0x2499e3);}}}})[_0x8ce2('0x19')](function(){if(_0x12852f){return db[_0x8ce2('0x2c')][_0x8ce2('0x10')]({'where':{'membername':_0x12852f[_0x8ce2('0x25')],'exitAt':null}});}})[_0x8ce2('0x19')](function(_0x40906a){if(_0x12852f){if(_0x40906a&&_0x40906a[_0x8ce2('0x2d')]){var _0x42baa2=[];_0x40906a[_0x8ce2('0x31')](function(_0x10fbda){_0x42baa2[_0x8ce2('0x4c')](_0x10fbda[_0x8ce2('0x2b')]({'exitAt':moment()[_0x8ce2('0x28')](_0x8ce2('0x2e'))}));});return BPromise['all'](_0x42baa2);}}})['then'](function(){if(_0x12852f){var _0x4696eb=[];var _0x1fcaef=[];var _0x75ce96=utils[_0x8ce2('0x30')]();var _0x325fef={'membername':_0x12852f[_0x8ce2('0x25')],'interface':_0x41f2e4,'enterAt':moment()['format'](_0x8ce2('0x2e')),'role':_0x12852f['role'],'internal':_0x12852f['internal']};_0x75ce96[_0x8ce2('0x31')](function(_0x5c7b27){_0x4696eb['push'](_[_0x8ce2('0x59')]({'channel':_0x5c7b27,'type':_0x8ce2('0x5a'),'data1':_0x8ce2('0x5b'),'data2':_0x41f2e4},_0x325fef));if(_0x12852f[_0x8ce2('0x50')]){_0x1fcaef['push'](_['merge']({'channel':_0x5c7b27,'type':'PAUSE','data1':'LOGININPAUSE'},_0x325fef));}});return db[_0x8ce2('0x2c')][_0x8ce2('0x37')](_0x4696eb[_0x8ce2('0x5c')](_0x1fcaef),{'individualHooks':!![]});}})[_0x8ce2('0x19')](function(){if(_0x12852f){return _0x12852f[_0x8ce2('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x8ce2('0x28')](_0x8ce2('0x2e')),'voicePause':_0x12852f['loginInPause']||![],'mailPause':_0x12852f[_0x8ce2('0x50')]||![],'chatPause':_0x12852f[_0x8ce2('0x50')]||![],'faxPause':_0x12852f['loginInPause']||![],'smsPause':_0x12852f[_0x8ce2('0x50')]||![],'openchannelPause':_0x12852f[_0x8ce2('0x50')]||![],'pauseType':_0x12852f[_0x8ce2('0x50')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x8ce2('0x28')](_0x8ce2('0x2e')),'interface':_0x41f2e4});}})[_0x8ce2('0x19')](function(_0xa05723){_0x34f2be(_0xa05723);})[_0x8ce2('0x1e')](function(_0x421c23){_0xf180e9(_0x2ba7b5['error'](0x1f4,_0x421c23[_0x8ce2('0x1f')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index b54c625..f177cd5 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 _0x3045=['save','remove','removeListener','register','length','user:','./user.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3045,0xfb));var _0x5304=function(_0x1c2248,_0x28f775){_0x1c2248=_0x1c2248-0x0;var _0x3d4061=_0x3045[_0x1c2248];return _0x3d4061;};'use strict';var UserEvents=require(_0x5304('0x0'));var events=[_0x5304('0x1'),_0x5304('0x2'),'update'];function createListener(_0x13bb91,_0x1abfcb){return function(_0x363f2b){_0x1abfcb['emit'](_0x13bb91,_0x363f2b);};}function removeListener(_0x41c57e,_0x1dea90){return function(){UserEvents[_0x5304('0x3')](_0x41c57e,_0x1dea90);};}exports[_0x5304('0x4')]=function(_0x45e739){for(var _0x541b2f=0x0,_0x251c5b=events[_0x5304('0x5')];_0x541b2f<_0x251c5b;_0x541b2f++){var _0x2af98f=events[_0x541b2f];var _0x2e088f=createListener(_0x5304('0x6')+_0x2af98f,_0x45e739);UserEvents['on'](_0x2af98f,_0x2e088f);}}; \ No newline at end of file +var _0x398f=['./user.events','save','remove','update','emit','removeListener','register','user:'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0x398f,0x68));var _0xf398=function(_0x3097cc,_0x123fca){_0x3097cc=_0x3097cc-0x0;var _0x2c11a4=_0x398f[_0x3097cc];return _0x2c11a4;};'use strict';var UserEvents=require(_0xf398('0x0'));var events=[_0xf398('0x1'),_0xf398('0x2'),_0xf398('0x3')];function createListener(_0x522ee7,_0x175b5b){return function(_0x233088){_0x175b5b[_0xf398('0x4')](_0x522ee7,_0x233088);};}function removeListener(_0x45fe44,_0x469b8c){return function(){UserEvents[_0xf398('0x5')](_0x45fe44,_0x469b8c);};}exports[_0xf398('0x6')]=function(_0x3f5f60){for(var _0x186bc4=0x0,_0x5ea1f9=events['length'];_0x186bc4<_0x5ea1f9;_0x186bc4++){var _0x709d8e=events[_0x186bc4];var _0x13081c=createListener(_0xf398('0x7')+_0x709d8e,_0x3f5f60);UserEvents['on'](_0x709d8e,_0x13081c);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 9f5cb2e..5221e6c 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4c8544,_0x44266a){var _0x41983a=function(_0xc02f9d){while(--_0xc02f9d){_0x4c8544['push'](_0x4c8544['shift']());}};_0x41983a(++_0x44266a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0xcb91[_0x381379];return _0x3e1063;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1af7a9,_0xb90fe6){var _0x2561ac=function(_0x4a8609){while(--_0x4a8609){_0x1af7a9['push'](_0x1af7a9['shift']());}};_0x2561ac(++_0xb90fe6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x356e8d,_0x24c719){_0x356e8d=_0x356e8d-0x0;var _0x39e65a=_0xcb91[_0x356e8d];return _0x39e65a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 7600a9a..9175c73 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 _0x77aa=['sequelize','exports','INTEGER'];(function(_0x50dd23,_0x2882a4){var _0x42598c=function(_0x438c5b){while(--_0x438c5b){_0x50dd23['push'](_0x50dd23['shift']());}};_0x42598c(++_0x2882a4);}(_0x77aa,0x126));var _0xa77a=function(_0x182f4d,_0x219691){_0x182f4d=_0x182f4d-0x0;var _0x557d88=_0x77aa[_0x182f4d];return _0x557d88;};'use strict';var Sequelize=require(_0xa77a('0x0'));module[_0xa77a('0x1')]={'penalty':{'type':Sequelize[_0xa77a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1f19=['sequelize','exports','INTEGER'];(function(_0x2131c7,_0x3d6b30){var _0xcb6d47=function(_0x141558){while(--_0x141558){_0x2131c7['push'](_0x2131c7['shift']());}};_0xcb6d47(++_0x3d6b30);}(_0x1f19,0x162));var _0x91f1=function(_0x355983,_0x5e838d){_0x355983=_0x355983-0x0;var _0x241cd0=_0x1f19[_0x355983];return _0x241cd0;};'use strict';var Sequelize=require(_0x91f1('0x0'));module[_0x91f1('0x1')]={'penalty':{'type':Sequelize[_0x91f1('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 7c0adae..bbadd5f 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 _0x2ec2=['rimraf','../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','../../config/logger','moment','bluebird','path'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x2ec2,0x1a8));var _0x22ec=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0x2ec2[_0x413b4d];return _0x8b810a;};'use strict';var _=require(_0x22ec('0x0'));var util=require('util');var logger=require(_0x22ec('0x1'))('api');var moment=require(_0x22ec('0x2'));var BPromise=require(_0x22ec('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22ec('0x4'));var rimraf=require(_0x22ec('0x5'));var config=require(_0x22ec('0x6'));var attributes=require(_0x22ec('0x7'));module[_0x22ec('0x8')]=function(_0x141097,_0x88aa46){return _0x141097[_0x22ec('0x9')]('UserChatQueue',attributes,{'tableName':_0x22ec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15ca=['exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x1a4241,_0x1bef9c){var _0x1d39cc=function(_0x30694e){while(--_0x30694e){_0x1a4241['push'](_0x1a4241['shift']());}};_0x1d39cc(++_0x1bef9c);}(_0x15ca,0xeb));var _0xa15c=function(_0x3b0095,_0x59a626){_0x3b0095=_0x3b0095-0x0;var _0x2fd593=_0x15ca[_0x3b0095];return _0x2fd593;};'use strict';var _=require(_0xa15c('0x0'));var util=require('util');var logger=require(_0xa15c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa15c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa15c('0x3'));var rimraf=require(_0xa15c('0x4'));var config=require(_0xa15c('0x5'));var attributes=require(_0xa15c('0x6'));module[_0xa15c('0x7')]=function(_0x430074,_0x546472){return _0x430074[_0xa15c('0x8')](_0xa15c('0x9'),attributes,{'tableName':_0xa15c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 77c446c..9292e84 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 _0x6aeb=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x426fd7,_0x4ccbc3){var _0x1f920f=function(_0x49532d){while(--_0x49532d){_0x426fd7['push'](_0x426fd7['shift']());}};_0x1f920f(++_0x4ccbc3);}(_0x6aeb,0x124));var _0xb6ae=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x6aeb[_0xd09668];return _0x68726;};'use strict';var _=require(_0xb6ae('0x0'));var util=require(_0xb6ae('0x1'));var moment=require(_0xb6ae('0x2'));var BPromise=require(_0xb6ae('0x3'));var rs=require(_0xb6ae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb6ae('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb6ae('0x6'))(_0xb6ae('0x7'));var config=require('../../config/environment');var jayson=require(_0xb6ae('0x8'));var client=jayson['client'][_0xb6ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x61cdc,_0x37ab03,_0x4c7a2b){return new BPromise(function(_0x2589d7,_0x59b277){return client['request'](_0x61cdc,_0x4c7a2b)[_0xb6ae('0xa')](function(_0x303e58){logger[_0xb6ae('0xb')](_0xb6ae('0xc'),_0x37ab03,'request\x20sent');logger[_0xb6ae('0xd')](_0xb6ae('0xe'),_0x37ab03,_0xb6ae('0xf'),JSON[_0xb6ae('0x10')](_0x303e58));if(_0x303e58[_0xb6ae('0x11')]){if(_0x303e58[_0xb6ae('0x11')]['code']===0x1f4){logger[_0xb6ae('0x11')](_0xb6ae('0xc'),_0x37ab03,_0x303e58['error'][_0xb6ae('0x12')]);return _0x59b277(_0x303e58['error'][_0xb6ae('0x12')]);}logger[_0xb6ae('0x11')](_0xb6ae('0xc'),_0x37ab03,_0x303e58[_0xb6ae('0x11')][_0xb6ae('0x12')]);return _0x2589d7(_0x303e58[_0xb6ae('0x11')]['message']);}else{logger['info'](_0xb6ae('0xc'),_0x37ab03,_0xb6ae('0xf'));_0x2589d7(_0x303e58[_0xb6ae('0x13')][_0xb6ae('0x12')]);}})[_0xb6ae('0x14')](function(_0x3ff1fb){logger['error'](_0xb6ae('0xc'),_0x37ab03,_0x3ff1fb);_0x59b277(_0x3ff1fb);});});} \ No newline at end of file +var _0x1fb9=['../../config/utils','../../config/logger','rpc','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','moment','../../mysqldb'];(function(_0x3b2244,_0x54873f){var _0x2dcc14=function(_0x53d73f){while(--_0x53d73f){_0x3b2244['push'](_0x3b2244['shift']());}};_0x2dcc14(++_0x54873f);}(_0x1fb9,0x1a0));var _0x91fb=function(_0x2f2e3f,_0x902203){_0x2f2e3f=_0x2f2e3f-0x0;var _0x2bb971=_0x1fb9[_0x2f2e3f];return _0x2bb971;};'use strict';var _=require(_0x91fb('0x0'));var util=require(_0x91fb('0x1'));var moment=require(_0x91fb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91fb('0x3'))['db'];var utils=require(_0x91fb('0x4'));var logger=require(_0x91fb('0x5'))(_0x91fb('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x91fb('0x7')][_0x91fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4786e4,_0x4aa98d,_0x1d962c){return new BPromise(function(_0x5365bb,_0x17052f){return client[_0x91fb('0x9')](_0x4786e4,_0x1d962c)[_0x91fb('0xa')](function(_0x156664){logger['info'](_0x91fb('0xb'),_0x4aa98d,_0x91fb('0xc'));logger[_0x91fb('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x4aa98d,_0x91fb('0xc'),JSON['stringify'](_0x156664));if(_0x156664[_0x91fb('0xe')]){if(_0x156664[_0x91fb('0xe')][_0x91fb('0xf')]===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x4aa98d,_0x156664[_0x91fb('0xe')][_0x91fb('0x10')]);return _0x17052f(_0x156664[_0x91fb('0xe')][_0x91fb('0x10')]);}logger[_0x91fb('0xe')](_0x91fb('0xb'),_0x4aa98d,_0x156664[_0x91fb('0xe')][_0x91fb('0x10')]);return _0x5365bb(_0x156664[_0x91fb('0xe')][_0x91fb('0x10')]);}else{logger[_0x91fb('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x4aa98d,_0x91fb('0xc'));_0x5365bb(_0x156664[_0x91fb('0x12')]['message']);}})[_0x91fb('0x13')](function(_0x470f7a){logger[_0x91fb('0xe')](_0x91fb('0xb'),_0x4aa98d,_0x470f7a);_0x17052f(_0x470f7a);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index af328c1..97b77b0 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x32ff1d,_0x3e29bb){var _0x50489e=function(_0x588ff3){while(--_0x588ff3){_0x32ff1d['push'](_0x32ff1d['shift']());}};_0x50489e(++_0x3e29bb);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x519233,_0x47c421){var _0x3a1a15=function(_0x16111a){while(--_0x16111a){_0x519233['push'](_0x519233['shift']());}};_0x3a1a15(++_0x47c421);}(_0xedd9,0xfc));var _0x9edd=function(_0x191f69,_0x1bdee8){_0x191f69=_0x191f69-0x0;var _0x12a480=_0xedd9[_0x191f69];return _0x12a480;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index d67bd87..c7d0463 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 _0x0e6a=['sequelize','exports','INTEGER','STRING'];(function(_0x827e20,_0x7ea620){var _0x403c34=function(_0x3cd458){while(--_0x3cd458){_0x827e20['push'](_0x827e20['shift']());}};_0x403c34(++_0x7ea620);}(_0x0e6a,0x7c));var _0xa0e6=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x0e6a[_0x874cf1];return _0x233579;};'use strict';var Sequelize=require(_0xa0e6('0x0'));module[_0xa0e6('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa0e6('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xa0e6('0x3')]}}; \ No newline at end of file +var _0xa9ee=['STRING','exports','INTEGER'];(function(_0x4abe02,_0xf5d76){var _0xcf37c7=function(_0x54fd99){while(--_0x54fd99){_0x4abe02['push'](_0x4abe02['shift']());}};_0xcf37c7(++_0xf5d76);}(_0xa9ee,0xaf));var _0xea9e=function(_0x492825,_0x12c19e){_0x492825=_0x492825-0x0;var _0x228b54=_0xa9ee[_0x492825];return _0x228b54;};'use strict';var Sequelize=require('sequelize');module[_0xea9e('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xea9e('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xea9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 3d3568f..353a513 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 _0x256e=['path','rimraf','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','util','api','moment','bluebird','request-promise'];(function(_0x47a6b7,_0x33d26e){var _0x29395a=function(_0x1f6221){while(--_0x1f6221){_0x47a6b7['push'](_0x47a6b7['shift']());}};_0x29395a(++_0x33d26e);}(_0x256e,0x12f));var _0xe256=function(_0x1dae31,_0xb467ef){_0x1dae31=_0x1dae31-0x0;var _0x3827f4=_0x256e[_0x1dae31];return _0x3827f4;};'use strict';var _=require('lodash');var util=require(_0xe256('0x0'));var logger=require('../../config/logger')(_0xe256('0x1'));var moment=require(_0xe256('0x2'));var BPromise=require(_0xe256('0x3'));var rp=require(_0xe256('0x4'));var fs=require('fs');var path=require(_0xe256('0x5'));var rimraf=require(_0xe256('0x6'));var config=require('../../config/environment');var attributes=require(_0xe256('0x7'));module[_0xe256('0x8')]=function(_0x5a397c,_0x41070b){return _0x5a397c['define'](_0xe256('0x9'),attributes,{'tableName':_0xe256('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6fd=['request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x9be166,_0x4fdd8e){var _0x5f3409=function(_0x5eae5f){while(--_0x5eae5f){_0x9be166['push'](_0x9be166['shift']());}};_0x5f3409(++_0x4fdd8e);}(_0xf6fd,0xf2));var _0xdf6f=function(_0x2777af,_0x52f8b2){_0x2777af=_0x2777af-0x0;var _0x4499ab=_0xf6fd[_0x2777af];return _0x4499ab;};'use strict';var _=require(_0xdf6f('0x0'));var util=require(_0xdf6f('0x1'));var logger=require(_0xdf6f('0x2'))(_0xdf6f('0x3'));var moment=require('moment');var BPromise=require(_0xdf6f('0x4'));var rp=require(_0xdf6f('0x5'));var fs=require('fs');var path=require(_0xdf6f('0x6'));var rimraf=require(_0xdf6f('0x7'));var config=require(_0xdf6f('0x8'));var attributes=require(_0xdf6f('0x9'));module[_0xdf6f('0xa')]=function(_0x46ea1c,_0x2e1850){return _0x46ea1c[_0xdf6f('0xb')]('UserFaxQueue',attributes,{'tableName':_0xdf6f('0xc'),'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 e04b8c1..00aeac5 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 _0xd46e=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','client','http','request'];(function(_0x18e1ae,_0x1b6789){var _0x3acf76=function(_0x53c107){while(--_0x53c107){_0x18e1ae['push'](_0x18e1ae['shift']());}};_0x3acf76(++_0x1b6789);}(_0xd46e,0x104));var _0xed46=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xd46e[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0xed46('0x0'));var util=require(_0xed46('0x1'));var moment=require(_0xed46('0x2'));var BPromise=require('bluebird');var rs=require(_0xed46('0x3'));var fs=require('fs');var Redis=require(_0xed46('0x4'));var db=require(_0xed46('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xed46('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xed46('0x7')][_0xed46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xca8848,_0x92683c,_0x20d4df){return new BPromise(function(_0x2d3a1d,_0x453817){return client[_0xed46('0x9')](_0xca8848,_0x20d4df)['then'](function(_0x5e054d){logger['info'](_0xed46('0xa'),_0x92683c,_0xed46('0xb'));logger['debug'](_0xed46('0xc'),_0x92683c,'request\x20sent',JSON[_0xed46('0xd')](_0x5e054d));if(_0x5e054d['error']){if(_0x5e054d[_0xed46('0xe')]['code']===0x1f4){logger[_0xed46('0xe')](_0xed46('0xa'),_0x92683c,_0x5e054d[_0xed46('0xe')][_0xed46('0xf')]);return _0x453817(_0x5e054d[_0xed46('0xe')][_0xed46('0xf')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x92683c,_0x5e054d[_0xed46('0xe')]['message']);return _0x2d3a1d(_0x5e054d[_0xed46('0xe')][_0xed46('0xf')]);}else{logger['info'](_0xed46('0xa'),_0x92683c,_0xed46('0xb'));_0x2d3a1d(_0x5e054d[_0xed46('0x10')][_0xed46('0xf')]);}})[_0xed46('0x11')](function(_0x1cd83a){logger[_0xed46('0xe')](_0xed46('0xa'),_0x92683c,_0x1cd83a);_0x453817(_0x1cd83a);});});} \ No newline at end of file +var _0x65ae=['request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','bluebird','../../config/logger','rpc','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s'];(function(_0x215ef9,_0xba26eb){var _0x386e50=function(_0x3f9c26){while(--_0x3f9c26){_0x215ef9['push'](_0x215ef9['shift']());}};_0x386e50(++_0xba26eb);}(_0x65ae,0xdf));var _0xe65a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x65ae[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe65a('0x0'));var util=require(_0xe65a('0x1'));var moment=require('moment');var BPromise=require(_0xe65a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe65a('0x3'))(_0xe65a('0x4'));var config=require('../../config/environment');var jayson=require(_0xe65a('0x5'));var client=jayson[_0xe65a('0x6')][_0xe65a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x41fd15,_0x25d431,_0x36603f){return new BPromise(function(_0x254dbf,_0x1751b0){return client[_0xe65a('0x8')](_0x41fd15,_0x36603f)[_0xe65a('0x9')](function(_0x288d0c){logger['info'](_0xe65a('0xa'),_0x25d431,_0xe65a('0xb'));logger[_0xe65a('0xc')](_0xe65a('0xd'),_0x25d431,'request\x20sent',JSON['stringify'](_0x288d0c));if(_0x288d0c[_0xe65a('0xe')]){if(_0x288d0c['error'][_0xe65a('0xf')]===0x1f4){logger[_0xe65a('0xe')](_0xe65a('0xa'),_0x25d431,_0x288d0c[_0xe65a('0xe')][_0xe65a('0x10')]);return _0x1751b0(_0x288d0c[_0xe65a('0xe')][_0xe65a('0x10')]);}logger[_0xe65a('0xe')](_0xe65a('0xa'),_0x25d431,_0x288d0c['error'][_0xe65a('0x10')]);return _0x254dbf(_0x288d0c[_0xe65a('0xe')][_0xe65a('0x10')]);}else{logger[_0xe65a('0x11')](_0xe65a('0xa'),_0x25d431,'request\x20sent');_0x254dbf(_0x288d0c['result'][_0xe65a('0x10')]);}})['catch'](function(_0x297125){logger['error'](_0xe65a('0xa'),_0x25d431,_0x297125);_0x1751b0(_0x297125);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index f05883d..22679c0 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x418d84,_0xecaca0){var _0x3077f1=function(_0x99f53e){while(--_0x99f53e){_0x418d84['push'](_0x418d84['shift']());}};_0x3077f1(++_0xecaca0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x366e0b,_0x2a14f9){var _0x1d4f1f=function(_0x57f331){while(--_0x57f331){_0x366e0b['push'](_0x366e0b['shift']());}};_0x1d4f1f(++_0x2a14f9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0xcb91[_0x28a5ad];return _0x176b8a;};'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 890edf6..fcb7784 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 _0x7ad9=['exports','sequelize'];(function(_0x1ba1e4,_0x4505e6){var _0x27ae54=function(_0x47bdb5){while(--_0x47bdb5){_0x1ba1e4['push'](_0x1ba1e4['shift']());}};_0x27ae54(++_0x4505e6);}(_0x7ad9,0x16f));var _0x97ad=function(_0x4b1d61,_0x1586d1){_0x4b1d61=_0x4b1d61-0x0;var _0x1a0e11=_0x7ad9[_0x4b1d61];return _0x1a0e11;};'use strict';var Sequelize=require(_0x97ad('0x0'));module[_0x97ad('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x5c54=['exports','INTEGER','sequelize'];(function(_0x36eb42,_0x557596){var _0x304d3a=function(_0x57b7ab){while(--_0x57b7ab){_0x36eb42['push'](_0x36eb42['shift']());}};_0x304d3a(++_0x557596);}(_0x5c54,0x71));var _0x45c5=function(_0x56c6d4,_0x2ad88f){_0x56c6d4=_0x56c6d4-0x0;var _0xbca8e8=_0x5c54[_0x56c6d4];return _0xbca8e8;};'use strict';var Sequelize=require(_0x45c5('0x0'));module[_0x45c5('0x1')]={'penalty':{'type':Sequelize[_0x45c5('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 e7241c3..f811063 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 _0x85d3=['moment','request-promise','path','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util','../../config/logger'];(function(_0x837259,_0x3adb94){var _0x4d2be3=function(_0x58901d){while(--_0x58901d){_0x837259['push'](_0x837259['shift']());}};_0x4d2be3(++_0x3adb94);}(_0x85d3,0x1e2));var _0x385d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x85d3[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x385d('0x0'));var logger=require(_0x385d('0x1'))('api');var moment=require(_0x385d('0x2'));var BPromise=require('bluebird');var rp=require(_0x385d('0x3'));var fs=require('fs');var path=require(_0x385d('0x4'));var rimraf=require('rimraf');var config=require(_0x385d('0x5'));var attributes=require(_0x385d('0x6'));module[_0x385d('0x7')]=function(_0x4a1c2d,_0x4bda2e){return _0x4a1c2d[_0x385d('0x8')](_0x385d('0x9'),attributes,{'tableName':_0x385d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e59=['exports','define','UserMailQueue','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e59,0xc0));var _0x91e5=function(_0x1fcb5b,_0x2e5a1d){_0x1fcb5b=_0x1fcb5b-0x0;var _0x529443=_0x1e59[_0x1fcb5b];return _0x529443;};'use strict';var _=require(_0x91e5('0x0'));var util=require(_0x91e5('0x1'));var logger=require(_0x91e5('0x2'))(_0x91e5('0x3'));var moment=require(_0x91e5('0x4'));var BPromise=require('bluebird');var rp=require(_0x91e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x91e5('0x6')]=function(_0x2cccf9,_0x25b959){return _0x2cccf9[_0x91e5('0x7')](_0x91e5('0x8'),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 42fa682..ed72d04 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x7217,0x19e));var _0x7721=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x7217[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x16a49e,_0x2190d9){var _0x4e0cfd=function(_0x3de7a0){while(--_0x3de7a0){_0x16a49e['push'](_0x16a49e['shift']());}};_0x4e0cfd(++_0x2190d9);}(_0x55ca,0x126));var _0xa55c=function(_0x3f1076,_0x23b6c1){_0x3f1076=_0x3f1076-0x0;var _0x21d34f=_0x55ca[_0x3f1076];return _0x21d34f;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 92537f0..dea5f67 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 _0x373b=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x5a0451,_0x2376b7){var _0x332372=function(_0x2ee813){while(--_0x2ee813){_0x5a0451['push'](_0x5a0451['shift']());}};_0x332372(++_0x2376b7);}(_0x373b,0x83));var _0xb373=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x373b[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xb373('0x0'));var util=require(_0xb373('0x1'));var path=require(_0xb373('0x2'));var timeout=require(_0xb373('0x3'));var express=require('express');var router=express[_0xb373('0x4')]();var fs_extra=require(_0xb373('0x5'));var auth=require(_0xb373('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb373('0x7'));var controller=require('./userNotification.controller');router[_0xb373('0x8')]('/',auth[_0xb373('0x9')](),controller[_0xb373('0xa')]);module[_0xb373('0xb')]=router; \ No newline at end of file +var _0x9e2f=['./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x47fcdd,_0x3e1178){var _0xcf2ba3=function(_0xdfaaed){while(--_0xdfaaed){_0x47fcdd['push'](_0x47fcdd['shift']());}};_0xcf2ba3(++_0x3e1178);}(_0x9e2f,0x191));var _0xf9e2=function(_0x410433,_0x52a1c9){_0x410433=_0x410433-0x0;var _0x3d324a=_0x9e2f[_0x410433];return _0x3d324a;};'use strict';var multer=require(_0xf9e2('0x0'));var util=require(_0xf9e2('0x1'));var path=require(_0xf9e2('0x2'));var timeout=require(_0xf9e2('0x3'));var express=require('express');var router=express[_0xf9e2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf9e2('0x5'));var interaction=require(_0xf9e2('0x6'));var config=require('../../config/environment');var controller=require(_0xf9e2('0x7'));router[_0xf9e2('0x8')]('/',auth[_0xf9e2('0x9')](),controller[_0xf9e2('0xa')]);module[_0xf9e2('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 7014074..4800923 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 _0xe358=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xe358,0x1f4));var _0x8e35=function(_0x19c5f2,_0x44ed13){_0x19c5f2=_0x19c5f2-0x0;var _0xb94caf=_0xe358[_0x19c5f2];return _0xb94caf;};'use strict';var Sequelize=require(_0x8e35('0x0'));module[_0x8e35('0x1')]={'body':{'type':Sequelize[_0x8e35('0x2')]},'senderName':{'type':Sequelize[_0x8e35('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x8e35('0x3')]},'beep':{'type':Sequelize[_0x8e35('0x4')]}}; \ No newline at end of file +var _0x4705=['BOOLEAN','exports','TEXT'];(function(_0x3161bf,_0x19e6ff){var _0x233133=function(_0x323fd8){while(--_0x323fd8){_0x3161bf['push'](_0x3161bf['shift']());}};_0x233133(++_0x19e6ff);}(_0x4705,0x1f3));var _0x5470=function(_0x5e79ea,_0xcf7ea9){_0x5e79ea=_0x5e79ea-0x0;var _0x49e14f=_0x4705[_0x5e79ea];return _0x49e14f;};'use strict';var Sequelize=require('sequelize');module[_0x5470('0x0')]={'body':{'type':Sequelize[_0x5470('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x5470('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x5470('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 5d8f232..8ac3979 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 _0x8433=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','json','undefined','count','offset','limit','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','faxqueue','openchannelqueue','voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','recipientsId','sortBy','sequelize','transaction','create','forEach','recipient','userNotification:send','catch','Template','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','toLowerCase','User','union','ids','queue','Queue','push','flatten','findOne','getAgents','map','eml-format','rimraf'];(function(_0x2a8276,_0x20f185){var _0x13d2d1=function(_0x232d04){while(--_0x232d04){_0x2a8276['push'](_0x2a8276['shift']());}};_0x13d2d1(++_0x20f185);}(_0x8433,0x186));var _0x3843=function(_0x1c0f3d,_0x55a9e2){_0x1c0f3d=_0x1c0f3d-0x0;var _0x4d71a8=_0x8433[_0x1c0f3d];return _0x4d71a8;};'use strict';var emlformat=require(_0x3843('0x0'));var rimraf=require(_0x3843('0x1'));var zipdir=require(_0x3843('0x2'));var jsonpatch=require(_0x3843('0x3'));var rp=require(_0x3843('0x4'));var moment=require(_0x3843('0x5'));var BPromise=require(_0x3843('0x6'));var Mustache=require('mustache');var util=require(_0x3843('0x7'));var path=require('path');var sox=require(_0x3843('0x8'));var csv=require('to-csv');var ejs=require(_0x3843('0x9'));var fs=require('fs');var fs_extra=require(_0x3843('0xa'));var _=require(_0x3843('0xb'));var squel=require(_0x3843('0xc'));var crypto=require('crypto');var jsforce=require(_0x3843('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3843('0xe'));var querystring=require(_0x3843('0xf'));var Papa=require(_0x3843('0x10'));var Redis=require('ioredis');var authService=require(_0x3843('0x11'));var qs=require(_0x3843('0x12'));var as=require(_0x3843('0x13'));var hardwareService=require(_0x3843('0x14'));var logger=require('../../config/logger')(_0x3843('0x15'));var utils=require(_0x3843('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3843('0x17'));var db=require(_0x3843('0x18'))['db'];config['redis']=_[_0x3843('0x19')](config[_0x3843('0x1a')],{'host':_0x3843('0x1b'),'port':0x18eb});var socket=require(_0x3843('0x1c'))(new Redis(config[_0x3843('0x1a')]));require(_0x3843('0x1d'))['register'](socket);function respondWithStatusCode(_0x21fdf4,_0x4f2fb7){_0x4f2fb7=_0x4f2fb7||0xcc;return function(_0x185ebd){if(_0x185ebd){return _0x21fdf4[_0x3843('0x1e')](_0x4f2fb7);}return _0x21fdf4[_0x3843('0x1f')](_0x4f2fb7)['end']();};}function respondWithResult(_0xff6967,_0x22468e){_0x22468e=_0x22468e||0xc8;return function(_0x2fcd4d){if(_0x2fcd4d){return _0xff6967['status'](_0x22468e)[_0x3843('0x20')](_0x2fcd4d);}};}function respondWithFilteredResult(_0x46775b,_0x126796){return function(_0x92383e){if(_0x92383e){var _0x32cd98=typeof _0x126796['offset']===_0x3843('0x21')&&typeof _0x126796['limit']==='undefined';var _0x250b7d=_0x92383e[_0x3843('0x22')];var _0x4538e7=_0x32cd98?0x0:_0x126796['offset'];var _0x1c9c28=_0x32cd98?_0x92383e[_0x3843('0x22')]:_0x126796[_0x3843('0x23')]+_0x126796[_0x3843('0x24')];var _0x210ee6;if(_0x1c9c28>=_0x250b7d){_0x1c9c28=_0x250b7d;_0x210ee6=0xc8;}else{_0x210ee6=0xce;}_0x46775b[_0x3843('0x1f')](_0x210ee6);return _0x46775b['set'](_0x3843('0x25'),_0x4538e7+'-'+_0x1c9c28+'/'+_0x250b7d)[_0x3843('0x20')](_0x92383e);}return null;};}function patchUpdates(_0x393886){return function(_0x271de7){try{jsonpatch['apply'](_0x271de7,_0x393886,!![]);}catch(_0xfa19c4){return BPromise[_0x3843('0x26')](_0xfa19c4);}return _0x271de7[_0x3843('0x27')]();};}function saveUpdates(_0x18dcea,_0x2da0a2){return function(_0x4cc597){if(_0x4cc597){return _0x4cc597[_0x3843('0x28')](_0x18dcea)[_0x3843('0x29')](function(_0x269123){return _0x269123;});}return null;};}function removeEntity(_0x4c8694,_0x197487){return function(_0x1dbe16){if(_0x1dbe16){return _0x1dbe16[_0x3843('0x2a')]()['then'](function(){_0x4c8694[_0x3843('0x1f')](0xcc)[_0x3843('0x2b')]();});}};}function handleEntityNotFound(_0x351395,_0x12da37){return function(_0xfe4624){if(!_0xfe4624){_0x351395[_0x3843('0x1e')](0x194);}return _0xfe4624;};}function handleError(_0x37abee,_0x2469bb){_0x2469bb=_0x2469bb||0x1f4;return function(_0x3d1790){logger[_0x3843('0x2c')](_0x3d1790[_0x3843('0x2d')]);if(_0x3d1790[_0x3843('0x2e')]){delete _0x3d1790[_0x3843('0x2e')];}_0x37abee[_0x3843('0x1f')](_0x2469bb)[_0x3843('0x2f')](_0x3d1790);};}exports['sendUserNotification']=function(_0x5917d6,_0x32632a,_0x31065e){if(!_0x5917d6[_0x3843('0x30')][_0x3843('0x31')](_0x3843('0x32'))&&!_0x5917d6['body'][_0x3843('0x31')]('TemplateId')){throw new db[(_0x3843('0x33'))][(_0x3843('0x34'))](_0x3843('0x35'));}else{if(_0x5917d6[_0x3843('0x30')][_0x3843('0x31')](_0x3843('0x36'))&&!_0x5917d6['body'][_0x3843('0x31')]('view')){throw new db[(_0x3843('0x33'))]['ValidationError'](_0x3843('0x37'));}if(!_0x5917d6['body'][_0x3843('0x31')](_0x3843('0x38'))){throw new db[(_0x3843('0x33'))][(_0x3843('0x34'))](_0x3843('0x39'));}else{try{var _0x3f3df4=JSON['parse'](_0x5917d6['body'][_0x3843('0x38')]);}catch(_0x5e6314){logger[_0x3843('0x2c')](_0x5e6314);throw new db[(_0x3843('0x33'))]['ValidationError'](_0x3843('0x3a'));}var _0x13d185=['chatqueue',_0x3843('0x3b'),'mailqueue',_0x3843('0x3c'),'smsqueue',_0x3843('0x3d'),_0x3843('0x3e'),_0x3843('0x3f'),_0x3843('0x40')];if(_[_0x3843('0x41')](_0x3f3df4,function(_0x324ef0){return!_[_0x3843('0x42')](_0x13d185,_0x324ef0[_0x3843('0x43')]['toLowerCase']());})){throw new db['Sequelize']['ValidationError'](_0x3843('0x44'));}}}var _0x4b128d={};_0x4b128d[_0x3843('0x45')]=_0x5917d6['body'][_0x3843('0x31')](_0x3843('0x45'))?_0x5917d6[_0x3843('0x30')]['senderName']:_0x5917d6[_0x3843('0x40')][_0x3843('0x46')];_0x4b128d['recipientsDescription']=_[_0x3843('0x47')](_0x5917d6['body']['recipientsDescription'])?null:_0x5917d6[_0x3843('0x30')][_0x3843('0x48')];_0x4b128d[_0x3843('0x49')]=_0x5917d6[_0x3843('0x30')][_0x3843('0x49')]||![];_0x4b128d['SenderId']=_0x5917d6[_0x3843('0x40')]['id'];return getContent(_0x5917d6[_0x3843('0x30')])[_0x3843('0x29')](function(_0xf01197){_0x4b128d[_0x3843('0x30')]=_0xf01197;return getRecipients(_0x3f3df4);})[_0x3843('0x29')](function(_0x1ecfd0){_0x4b128d[_0x3843('0x4a')]=_[_0x3843('0x4b')](_0x1ecfd0)['join'](',');return db[_0x3843('0x4c')][_0x3843('0x4d')](function(_0x25d0f8){return db['UserNotification'][_0x3843('0x4e')](_0x4b128d,{'raw':!![],'transaction':_0x25d0f8})[_0x3843('0x29')](function(_0x433f6e){var _0x55976a={'sender':_0x4b128d[_0x3843('0x45')],'description':_0x4b128d['recipientsDescription'],'content':_0x4b128d['body'],'beep':_0x4b128d[_0x3843('0x49')]};_0x1ecfd0[_0x3843('0x4f')](function(_0x51daa3){_0x55976a[_0x3843('0x50')]=_0x51daa3;socket['emit'](_0x3843('0x51'),_0x55976a);});return _0x433f6e;});});})['then'](respondWithResult(_0x32632a,0xc9))[_0x3843('0x52')](handleError(_0x32632a,null));};function getContent(_0x1b1722){return new BPromise(function(_0x3e5cf7,_0x4d05e9){if(_0x1b1722[_0x3843('0x32')]){_0x3e5cf7(_0x1b1722[_0x3843('0x32')]);return;}return db[_0x3843('0x53')]['findOne']({'attributes':['html'],'where':{'id':_0x1b1722[_0x3843('0x36')]},'raw':!![]})[_0x3843('0x29')](function(_0x2a0937){if(!_0x2a0937)throw new db[(_0x3843('0x33'))][(_0x3843('0x34'))](_0x3843('0x54'));var _0x2b0360=Mustache[_0x3843('0x55')](_0x2a0937[_0x3843('0x56')],_0x1b1722['view']);_0x3e5cf7(_0x2b0360);})[_0x3843('0x52')](function(_0x96e0ec){_0x4d05e9(_0x96e0ec);});});}function getRecipients(_0x1610d9){return new BPromise(function(_0x55744d,_0x4d666e){var _0x4df8ab=[];var _0x15cd04=[];_0x1610d9[_0x3843('0x4f')](function(_0x191b83){var _0x40aaa7=_['startCase'](_0x191b83[_0x3843('0x43')][_0x3843('0x57')]());if(_0x40aaa7===_0x3843('0x58')){_0x4df8ab=_[_0x3843('0x59')](_0x4df8ab,_0x191b83[_0x3843('0x5a')]);}else{if(_[_0x3843('0x42')](_0x40aaa7,'queue'))_0x40aaa7=_0x40aaa7['replace'](_0x3843('0x5b'),_0x3843('0x5c'));_0x191b83['ids'][_0x3843('0x4f')](function(_0x5ebd08){_0x15cd04[_0x3843('0x5d')](getAgents(_0x40aaa7,_0x5ebd08));});}});return BPromise['all'](_0x15cd04)[_0x3843('0x29')](function(_0x1912d6){_0x4df8ab=_[_0x3843('0x59')](_0x4df8ab,_[_0x3843('0x5e')](_0x1912d6));_0x55744d(_0x4df8ab);})['catch'](function(_0x4bc866){_0x4d666e(_0x4bc866);});});}function getAgents(_0x1457fc,_0x2d497a){return new BPromise(function(_0x67444f,_0x56f0c7){return db[_0x1457fc][_0x3843('0x5f')]({'where':{'id':_0x2d497a}})[_0x3843('0x29')](function(_0x2a1ec6){return _0x2a1ec6[_0x3843('0x60')]({'attributes':['id'],'raw':!![]})[_0x3843('0x29')](function(_0x1bfbe6){var _0x436d40=_[_0x3843('0x61')](_0x1bfbe6,'id');_0x67444f(_0x436d40);});})[_0x3843('0x52')](function(_0x200ec8){_0x56f0c7(_0x200ec8);});});} \ No newline at end of file +var _0x4dbb=['ids','replace','queue','push','all','flatten','findOne','getAgents','map','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','isEmpty','recipientsDescription','beep','then','sortBy','join','sequelize','transaction','create','forEach','recipient','emit','userNotification:send','catch','Template','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','toLowerCase','union'];(function(_0x3d1d77,_0x52dfec){var _0x2f0ce5=function(_0x5019dd){while(--_0x5019dd){_0x3d1d77['push'](_0x3d1d77['shift']());}};_0x2f0ce5(++_0x52dfec);}(_0x4dbb,0x132));var _0xb4db=function(_0x59a549,_0x2fe2bb){_0x59a549=_0x59a549-0x0;var _0x12adbe=_0x4dbb[_0x59a549];return _0x12adbe;};'use strict';var emlformat=require(_0xb4db('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb4db('0x1'));var rp=require(_0xb4db('0x2'));var moment=require(_0xb4db('0x3'));var BPromise=require(_0xb4db('0x4'));var Mustache=require('mustache');var util=require(_0xb4db('0x5'));var path=require(_0xb4db('0x6'));var sox=require(_0xb4db('0x7'));var csv=require(_0xb4db('0x8'));var ejs=require(_0xb4db('0x9'));var fs=require('fs');var fs_extra=require(_0xb4db('0xa'));var _=require(_0xb4db('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb4db('0xc'));var deskjs=require(_0xb4db('0xd'));var toCsv=require(_0xb4db('0x8'));var querystring=require(_0xb4db('0xe'));var Papa=require('papaparse');var Redis=require(_0xb4db('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb4db('0x10'));var hardwareService=require(_0xb4db('0x11'));var logger=require(_0xb4db('0x12'))('api');var utils=require(_0xb4db('0x13'));var config=require(_0xb4db('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb4db('0x15'))['db'];config[_0xb4db('0x16')]=_[_0xb4db('0x17')](config[_0xb4db('0x16')],{'host':_0xb4db('0x18'),'port':0x18eb});var socket=require(_0xb4db('0x19'))(new Redis(config[_0xb4db('0x16')]));require('./userNotification.socket')[_0xb4db('0x1a')](socket);function respondWithStatusCode(_0x1b3cc2,_0xfe5592){_0xfe5592=_0xfe5592||0xcc;return function(_0x5cc1f8){if(_0x5cc1f8){return _0x1b3cc2[_0xb4db('0x1b')](_0xfe5592);}return _0x1b3cc2[_0xb4db('0x1c')](_0xfe5592)['end']();};}function respondWithResult(_0x4698f3,_0x54da44){_0x54da44=_0x54da44||0xc8;return function(_0x48f119){if(_0x48f119){return _0x4698f3['status'](_0x54da44)[_0xb4db('0x1d')](_0x48f119);}};}function respondWithFilteredResult(_0x38d2ba,_0x1acb4b){return function(_0x4f2a99){if(_0x4f2a99){var _0xda663f=typeof _0x1acb4b['offset']===_0xb4db('0x1e')&&typeof _0x1acb4b['limit']===_0xb4db('0x1e');var _0x41237f=_0x4f2a99[_0xb4db('0x1f')];var _0x33180d=_0xda663f?0x0:_0x1acb4b[_0xb4db('0x20')];var _0x308298=_0xda663f?_0x4f2a99[_0xb4db('0x1f')]:_0x1acb4b['offset']+_0x1acb4b[_0xb4db('0x21')];var _0x4db539;if(_0x308298>=_0x41237f){_0x308298=_0x41237f;_0x4db539=0xc8;}else{_0x4db539=0xce;}_0x38d2ba[_0xb4db('0x1c')](_0x4db539);return _0x38d2ba[_0xb4db('0x22')](_0xb4db('0x23'),_0x33180d+'-'+_0x308298+'/'+_0x41237f)[_0xb4db('0x1d')](_0x4f2a99);}return null;};}function patchUpdates(_0x189649){return function(_0x17b56b){try{jsonpatch[_0xb4db('0x24')](_0x17b56b,_0x189649,!![]);}catch(_0x381447){return BPromise[_0xb4db('0x25')](_0x381447);}return _0x17b56b['save']();};}function saveUpdates(_0x1e0b8f,_0x1e61fe){return function(_0x1af30c){if(_0x1af30c){return _0x1af30c[_0xb4db('0x26')](_0x1e0b8f)['then'](function(_0x333778){return _0x333778;});}return null;};}function removeEntity(_0x328391,_0x41146f){return function(_0x5dcf13){if(_0x5dcf13){return _0x5dcf13[_0xb4db('0x27')]()['then'](function(){_0x328391[_0xb4db('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ed0a2,_0x2ede88){return function(_0x3742d2){if(!_0x3742d2){_0x1ed0a2[_0xb4db('0x1b')](0x194);}return _0x3742d2;};}function handleError(_0x3597cb,_0x129550){_0x129550=_0x129550||0x1f4;return function(_0x206007){logger[_0xb4db('0x28')](_0x206007[_0xb4db('0x29')]);if(_0x206007[_0xb4db('0x2a')]){delete _0x206007['name'];}_0x3597cb['status'](_0x129550)[_0xb4db('0x2b')](_0x206007);};}exports[_0xb4db('0x2c')]=function(_0x18a40b,_0x29209b,_0x8ee28b){if(!_0x18a40b[_0xb4db('0x2d')][_0xb4db('0x2e')](_0xb4db('0x2f'))&&!_0x18a40b['body'][_0xb4db('0x2e')](_0xb4db('0x30'))){throw new db[(_0xb4db('0x31'))][(_0xb4db('0x32'))](_0xb4db('0x33'));}else{if(_0x18a40b[_0xb4db('0x2d')]['hasOwnProperty'](_0xb4db('0x30'))&&!_0x18a40b[_0xb4db('0x2d')][_0xb4db('0x2e')](_0xb4db('0x34'))){throw new db[(_0xb4db('0x31'))]['ValidationError'](_0xb4db('0x35'));}if(!_0x18a40b[_0xb4db('0x2d')][_0xb4db('0x2e')](_0xb4db('0x36'))){throw new db[(_0xb4db('0x31'))][(_0xb4db('0x32'))](_0xb4db('0x37'));}else{try{var _0x1bc2b7=JSON[_0xb4db('0x38')](_0x18a40b['body']['recipients']);}catch(_0x4cff4b){logger['error'](_0x4cff4b);throw new db['Sequelize']['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x4cb7f7=['chatqueue','faxqueue',_0xb4db('0x39'),_0xb4db('0x3a'),_0xb4db('0x3b'),_0xb4db('0x3c'),_0xb4db('0x3d'),_0xb4db('0x3e'),'user'];if(_[_0xb4db('0x3f')](_0x1bc2b7,function(_0x12eb9a){return!_[_0xb4db('0x40')](_0x4cb7f7,_0x12eb9a[_0xb4db('0x41')]['toLowerCase']());})){throw new db[(_0xb4db('0x31'))]['ValidationError'](_0xb4db('0x42'));}}}var _0x349fbb={};_0x349fbb[_0xb4db('0x43')]=_0x18a40b[_0xb4db('0x2d')]['hasOwnProperty'](_0xb4db('0x43'))?_0x18a40b[_0xb4db('0x2d')][_0xb4db('0x43')]:_0x18a40b[_0xb4db('0x44')][_0xb4db('0x45')];_0x349fbb['recipientsDescription']=_[_0xb4db('0x46')](_0x18a40b[_0xb4db('0x2d')][_0xb4db('0x47')])?null:_0x18a40b[_0xb4db('0x2d')][_0xb4db('0x47')];_0x349fbb[_0xb4db('0x48')]=_0x18a40b['body']['beep']||![];_0x349fbb['SenderId']=_0x18a40b[_0xb4db('0x44')]['id'];return getContent(_0x18a40b[_0xb4db('0x2d')])[_0xb4db('0x49')](function(_0x209d94){_0x349fbb[_0xb4db('0x2d')]=_0x209d94;return getRecipients(_0x1bc2b7);})[_0xb4db('0x49')](function(_0x37fd3e){_0x349fbb['recipientsId']=_[_0xb4db('0x4a')](_0x37fd3e)[_0xb4db('0x4b')](',');return db[_0xb4db('0x4c')][_0xb4db('0x4d')](function(_0x1118c1){return db['UserNotification'][_0xb4db('0x4e')](_0x349fbb,{'raw':!![],'transaction':_0x1118c1})[_0xb4db('0x49')](function(_0x515f74){var _0x3f5554={'sender':_0x349fbb['senderName'],'description':_0x349fbb[_0xb4db('0x47')],'content':_0x349fbb[_0xb4db('0x2d')],'beep':_0x349fbb['beep']};_0x37fd3e[_0xb4db('0x4f')](function(_0x244a5e){_0x3f5554[_0xb4db('0x50')]=_0x244a5e;socket[_0xb4db('0x51')](_0xb4db('0x52'),_0x3f5554);});return _0x515f74;});});})[_0xb4db('0x49')](respondWithResult(_0x29209b,0xc9))[_0xb4db('0x53')](handleError(_0x29209b,null));};function getContent(_0x195b07){return new BPromise(function(_0x5f2891,_0x2f01d1){if(_0x195b07[_0xb4db('0x2f')]){_0x5f2891(_0x195b07[_0xb4db('0x2f')]);return;}return db[_0xb4db('0x54')]['findOne']({'attributes':['html'],'where':{'id':_0x195b07[_0xb4db('0x30')]},'raw':!![]})[_0xb4db('0x49')](function(_0x4ff7ec){if(!_0x4ff7ec)throw new db[(_0xb4db('0x31'))]['ValidationError'](_0xb4db('0x55'));var _0x2dd126=Mustache[_0xb4db('0x56')](_0x4ff7ec[_0xb4db('0x57')],_0x195b07[_0xb4db('0x34')]);_0x5f2891(_0x2dd126);})[_0xb4db('0x53')](function(_0x23a43f){_0x2f01d1(_0x23a43f);});});}function getRecipients(_0x4283bf){return new BPromise(function(_0x3325c5,_0x48fad8){var _0x465de1=[];var _0x1c42f9=[];_0x4283bf[_0xb4db('0x4f')](function(_0x3c57ac){var _0xf3605b=_['startCase'](_0x3c57ac[_0xb4db('0x41')][_0xb4db('0x58')]());if(_0xf3605b==='User'){_0x465de1=_[_0xb4db('0x59')](_0x465de1,_0x3c57ac[_0xb4db('0x5a')]);}else{if(_[_0xb4db('0x40')](_0xf3605b,'queue'))_0xf3605b=_0xf3605b[_0xb4db('0x5b')](_0xb4db('0x5c'),'Queue');_0x3c57ac[_0xb4db('0x5a')]['forEach'](function(_0x2c531e){_0x1c42f9[_0xb4db('0x5d')](getAgents(_0xf3605b,_0x2c531e));});}});return BPromise[_0xb4db('0x5e')](_0x1c42f9)[_0xb4db('0x49')](function(_0x23e785){_0x465de1=_[_0xb4db('0x59')](_0x465de1,_[_0xb4db('0x5f')](_0x23e785));_0x3325c5(_0x465de1);})[_0xb4db('0x53')](function(_0x134ef1){_0x48fad8(_0x134ef1);});});}function getAgents(_0x5228b1,_0x26ed5a){return new BPromise(function(_0x3dc7a6,_0x33656b){return db[_0x5228b1][_0xb4db('0x60')]({'where':{'id':_0x26ed5a}})['then'](function(_0x28d31d){return _0x28d31d[_0xb4db('0x61')]({'attributes':['id'],'raw':!![]})[_0xb4db('0x49')](function(_0x4bef9b){var _0x1bae63=_[_0xb4db('0x62')](_0x4bef9b,'id');_0x3dc7a6(_0x1bae63);});})[_0xb4db('0x53')](function(_0x16eb64){_0x33656b(_0x16eb64);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 8e4993c..099604a 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 _0x9293=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x9b0881,_0x1a4fcb){var _0x53b16e=function(_0xd6748){while(--_0xd6748){_0x9b0881['push'](_0x9b0881['shift']());}};_0x53b16e(++_0x1a4fcb);}(_0x9293,0xf8));var _0x3929=function(_0x13188a,_0x2f635f){_0x13188a=_0x13188a-0x0;var _0x2f5716=_0x9293[_0x13188a];return _0x2f5716;};'use strict';var EventEmitter=require(_0x3929('0x0'));var UserNotification=require(_0x3929('0x1'))['db'][_0x3929('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x3929('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3929('0x4'),'afterDestroy':_0x3929('0x5')};function emitEvent(_0x279262){return function(_0x143d51,_0x27460f,_0x170bc9){UserNotificationEvents['emit'](_0x279262+':'+_0x143d51['id'],_0x143d51);UserNotificationEvents[_0x3929('0x6')](_0x279262,_0x143d51);_0x170bc9(null);};}for(var e in events){if(events[_0x3929('0x7')](e)){var event=events[e];UserNotification[_0x3929('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0xa63f=['update','emit','hasOwnProperty','hook','events','../../mysqldb','UserNotification','setMaxListeners','save'];(function(_0x25e133,_0x5926df){var _0x52517c=function(_0x1723bf){while(--_0x1723bf){_0x25e133['push'](_0x25e133['shift']());}};_0x52517c(++_0x5926df);}(_0xa63f,0xe5));var _0xfa63=function(_0x2bbe8d,_0x5156c2){_0x2bbe8d=_0x2bbe8d-0x0;var _0x539e7a=_0xa63f[_0x2bbe8d];return _0x539e7a;};'use strict';var EventEmitter=require(_0xfa63('0x0'));var UserNotification=require(_0xfa63('0x1'))['db'][_0xfa63('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xfa63('0x3')](0x0);var events={'afterCreate':_0xfa63('0x4'),'afterUpdate':_0xfa63('0x5'),'afterDestroy':'remove'};function emitEvent(_0x22da8d){return function(_0x4f98ab,_0x4b1bbb,_0x1d8d77){UserNotificationEvents['emit'](_0x22da8d+':'+_0x4f98ab['id'],_0x4f98ab);UserNotificationEvents[_0xfa63('0x6')](_0x22da8d,_0x4f98ab);_0x1d8d77(null);};}for(var e in events){if(events[_0xfa63('0x7')](e)){var event=events[e];UserNotification[_0xfa63('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 5e493bf..8200004 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 _0xf6c0=['../../config/logger','bluebird','path','rimraf','../../config/environment','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash'];(function(_0x6b5424,_0xf43bec){var _0xacaccf=function(_0x11f76e){while(--_0x11f76e){_0x6b5424['push'](_0x6b5424['shift']());}};_0xacaccf(++_0xf43bec);}(_0xf6c0,0x194));var _0x0f6c=function(_0x2bac06,_0xe7cc4c){_0x2bac06=_0x2bac06-0x0;var _0xde9d11=_0xf6c0[_0x2bac06];return _0xde9d11;};'use strict';var _=require(_0x0f6c('0x0'));var util=require('util');var logger=require(_0x0f6c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0f6c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f6c('0x3'));var rimraf=require(_0x0f6c('0x4'));var config=require(_0x0f6c('0x5'));var attributes=require('./userNotification.attributes');module['exports']=function(_0x5baf53,_0x161454){return _0x5baf53['define'](_0x0f6c('0x6'),attributes,{'tableName':_0x0f6c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0f6c('0x8')});}; \ No newline at end of file +var _0x7baa=['userNotifications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','path','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0x7baa,0x1ef));var _0xa7ba=function(_0x5b5eb4,_0x117c87){_0x5b5eb4=_0x5b5eb4-0x0;var _0x42af53=_0x7baa[_0x5b5eb4];return _0x42af53;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa7ba('0x0'))(_0xa7ba('0x1'));var moment=require(_0xa7ba('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa7ba('0x3'));var rimraf=require(_0xa7ba('0x4'));var config=require(_0xa7ba('0x5'));var attributes=require(_0xa7ba('0x6'));module[_0xa7ba('0x7')]=function(_0x4913ce,_0xf5d053){return _0x4913ce['define'](_0xa7ba('0x8'),attributes,{'tableName':_0xa7ba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa7ba('0xa'),'collate':_0xa7ba('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index bdea0c7..0213702 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 _0x00af=['result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x5b02d6,_0x508ffe){var _0x2a0f6e=function(_0xf4bb4f){while(--_0xf4bb4f){_0x5b02d6['push'](_0x5b02d6['shift']());}};_0x2a0f6e(++_0x508ffe);}(_0x00af,0x182));var _0xf00a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x00af[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xf00a('0x0'));var util=require(_0xf00a('0x1'));var moment=require(_0xf00a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf00a('0x3'))['db'];var utils=require(_0xf00a('0x4'));var logger=require(_0xf00a('0x5'))(_0xf00a('0x6'));var config=require(_0xf00a('0x7'));var jayson=require(_0xf00a('0x8'));var client=jayson[_0xf00a('0x9')][_0xf00a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf00a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf00a('0xc'))(new Redis(config['redis']));require(_0xf00a('0xd'))['register'](socket);function respondWithRpcPromise(_0x3f9ade,_0x1dc18c,_0x5c01e5){return new BPromise(function(_0x31f5af,_0x56b63b){return client[_0xf00a('0xe')](_0x3f9ade,_0x5c01e5)[_0xf00a('0xf')](function(_0x436cfd){logger[_0xf00a('0x10')](_0xf00a('0x11'),_0x1dc18c,_0xf00a('0x12'));logger[_0xf00a('0x13')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x1dc18c,'request\x20sent',JSON['stringify'](_0x436cfd));if(_0x436cfd[_0xf00a('0x14')]){if(_0x436cfd[_0xf00a('0x14')]['code']===0x1f4){logger['error'](_0xf00a('0x11'),_0x1dc18c,_0x436cfd[_0xf00a('0x14')][_0xf00a('0x15')]);return _0x56b63b(_0x436cfd[_0xf00a('0x14')][_0xf00a('0x15')]);}logger[_0xf00a('0x14')](_0xf00a('0x11'),_0x1dc18c,_0x436cfd[_0xf00a('0x14')][_0xf00a('0x15')]);return _0x31f5af(_0x436cfd[_0xf00a('0x14')]['message']);}else{logger[_0xf00a('0x10')](_0xf00a('0x11'),_0x1dc18c,_0xf00a('0x12'));_0x31f5af(_0x436cfd[_0xf00a('0x16')][_0xf00a('0x15')]);}})[_0xf00a('0x17')](function(_0x225585){logger[_0xf00a('0x14')](_0xf00a('0x11'),_0x1dc18c,_0x225585);_0x56b63b(_0x225585);});});} \ No newline at end of file +var _0xaf8a=['localhost','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x31a938,_0x4daec6){var _0x1bf341=function(_0x514261){while(--_0x514261){_0x31a938['push'](_0x31a938['shift']());}};_0x1bf341(++_0x4daec6);}(_0xaf8a,0x1ee));var _0xaaf8=function(_0x49f8fa,_0x72260e){_0x49f8fa=_0x49f8fa-0x0;var _0x384b7c=_0xaf8a[_0x49f8fa];return _0x384b7c;};'use strict';var _=require(_0xaaf8('0x0'));var util=require(_0xaaf8('0x1'));var moment=require('moment');var BPromise=require(_0xaaf8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaaf8('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaaf8('0x4'));var config=require('../../config/environment');var jayson=require(_0xaaf8('0x5'));var client=jayson[_0xaaf8('0x6')][_0xaaf8('0x7')]({'port':0x232a});config[_0xaaf8('0x8')]=_[_0xaaf8('0x9')](config[_0xaaf8('0x8')],{'host':_0xaaf8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaaf8('0x8')]));require('./userNotification.socket')[_0xaaf8('0xb')](socket);function respondWithRpcPromise(_0xad5ad1,_0x544f90,_0x2567cd){return new BPromise(function(_0x3a813e,_0x121144){return client[_0xaaf8('0xc')](_0xad5ad1,_0x2567cd)[_0xaaf8('0xd')](function(_0x1a0b7c){logger['info'](_0xaaf8('0xe'),_0x544f90,_0xaaf8('0xf'));logger['debug'](_0xaaf8('0x10'),_0x544f90,_0xaaf8('0xf'),JSON[_0xaaf8('0x11')](_0x1a0b7c));if(_0x1a0b7c[_0xaaf8('0x12')]){if(_0x1a0b7c[_0xaaf8('0x12')][_0xaaf8('0x13')]===0x1f4){logger['error'](_0xaaf8('0xe'),_0x544f90,_0x1a0b7c[_0xaaf8('0x12')]['message']);return _0x121144(_0x1a0b7c[_0xaaf8('0x12')]['message']);}logger[_0xaaf8('0x12')](_0xaaf8('0xe'),_0x544f90,_0x1a0b7c[_0xaaf8('0x12')]['message']);return _0x3a813e(_0x1a0b7c[_0xaaf8('0x12')][_0xaaf8('0x14')]);}else{logger[_0xaaf8('0x15')](_0xaaf8('0xe'),_0x544f90,_0xaaf8('0xf'));_0x3a813e(_0x1a0b7c[_0xaaf8('0x16')][_0xaaf8('0x14')]);}})[_0xaaf8('0x17')](function(_0x3d9fbd){logger[_0xaaf8('0x12')](_0xaaf8('0xe'),_0x544f90,_0x3d9fbd);_0x121144(_0x3d9fbd);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 4ec1ef3..ff30f78 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 _0xe29f=['emit','removeListener','register','length','userNotification:','./userNotification.events','save','remove'];(function(_0x5d9d73,_0x4e566b){var _0x29ee78=function(_0x2e7365){while(--_0x2e7365){_0x5d9d73['push'](_0x5d9d73['shift']());}};_0x29ee78(++_0x4e566b);}(_0xe29f,0x125));var _0xfe29=function(_0x1773bb,_0x27c0b7){_0x1773bb=_0x1773bb-0x0;var _0x1a9f9b=_0xe29f[_0x1773bb];return _0x1a9f9b;};'use strict';var UserNotificationEvents=require(_0xfe29('0x0'));var events=[_0xfe29('0x1'),_0xfe29('0x2'),'update'];function createListener(_0x3f6d74,_0x10d710){return function(_0x5dad41){_0x10d710[_0xfe29('0x3')](_0x3f6d74,_0x5dad41);};}function removeListener(_0x2d5be5,_0xb066ec){return function(){UserNotificationEvents[_0xfe29('0x4')](_0x2d5be5,_0xb066ec);};}exports[_0xfe29('0x5')]=function(_0xa2c19e){for(var _0x3b3590=0x0,_0x5d3505=events[_0xfe29('0x6')];_0x3b3590<_0x5d3505;_0x3b3590++){var _0xaa0847=events[_0x3b3590];var _0xeeed9b=createListener(_0xfe29('0x7')+_0xaa0847,_0xa2c19e);UserNotificationEvents['on'](_0xaa0847,_0xeeed9b);}}; \ No newline at end of file +var _0x42ce=['userNotification:','./userNotification.events','save','remove','update','emit','removeListener','register','length'];(function(_0x26721d,_0x448ba5){var _0x1035c5=function(_0x1c1b86){while(--_0x1c1b86){_0x26721d['push'](_0x26721d['shift']());}};_0x1035c5(++_0x448ba5);}(_0x42ce,0xe2));var _0xe42c=function(_0x22664f,_0x5500d0){_0x22664f=_0x22664f-0x0;var _0xe96d8e=_0x42ce[_0x22664f];return _0xe96d8e;};'use strict';var UserNotificationEvents=require(_0xe42c('0x0'));var events=[_0xe42c('0x1'),_0xe42c('0x2'),_0xe42c('0x3')];function createListener(_0x19270e,_0x300853){return function(_0x501a78){_0x300853[_0xe42c('0x4')](_0x19270e,_0x501a78);};}function removeListener(_0x3b647d,_0x5240f0){return function(){UserNotificationEvents[_0xe42c('0x5')](_0x3b647d,_0x5240f0);};}exports[_0xe42c('0x6')]=function(_0x38f949){for(var _0x1dce62=0x0,_0x5ec08e=events[_0xe42c('0x7')];_0x1dce62<_0x5ec08e;_0x1dce62++){var _0x4b76f3=events[_0x1dce62];var _0x2de83b=createListener(_0xe42c('0x8')+_0x4b76f3,_0x38f949);UserNotificationEvents['on'](_0x4b76f3,_0x2de83b);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index c3795fa..717c941 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4659b1,_0x341ed5){var _0x2bf57b=function(_0x1da10f){while(--_0x1da10f){_0x4659b1['push'](_0x4659b1['shift']());}};_0x2bf57b(++_0x341ed5);}(_0xe706,0xa3));var _0x6e70=function(_0x288478,_0x23303e){_0x288478=_0x288478-0x0;var _0x234c05=_0xe706[_0x288478];return _0x234c05;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x345f86,_0x18d41e){var _0xdc32aa=function(_0x384f49){while(--_0x384f49){_0x345f86['push'](_0x345f86['shift']());}};_0xdc32aa(++_0x18d41e);}(_0xedd9,0xfc));var _0x9edd=function(_0x267311,_0x2bd543){_0x267311=_0x267311-0x0;var _0x2539b4=_0xedd9[_0x267311];return _0x2539b4;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 2c334f5..969726d 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 _0xf59f=['exports','INTEGER'];(function(_0x37178f,_0x294c89){var _0x58c310=function(_0x4bd0b3){while(--_0x4bd0b3){_0x37178f['push'](_0x37178f['shift']());}};_0x58c310(++_0x294c89);}(_0xf59f,0xb4));var _0xff59=function(_0x2440ec,_0x24981a){_0x2440ec=_0x2440ec-0x0;var _0xcdfe8=_0xf59f[_0x2440ec];return _0xcdfe8;};'use strict';var Sequelize=require('sequelize');module[_0xff59('0x0')]={'penalty':{'type':Sequelize[_0xff59('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3fb1=['exports','INTEGER','sequelize'];(function(_0x274f26,_0x1828b8){var _0x3b9a5=function(_0x504feb){while(--_0x504feb){_0x274f26['push'](_0x274f26['shift']());}};_0x3b9a5(++_0x1828b8);}(_0x3fb1,0x8c));var _0x13fb=function(_0x122bf1,_0x3da7c1){_0x122bf1=_0x122bf1-0x0;var _0x367fe4=_0x3fb1[_0x122bf1];return _0x367fe4;};'use strict';var Sequelize=require(_0x13fb('0x0'));module[_0x13fb('0x1')]={'penalty':{'type':Sequelize[_0x13fb('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index a86aead..b4b52e7 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 _0x438e=['user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x438e,0x196));var _0xe438=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x438e[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0xe438('0x0'));var util=require(_0xe438('0x1'));var logger=require(_0xe438('0x2'))(_0xe438('0x3'));var moment=require(_0xe438('0x4'));var BPromise=require(_0xe438('0x5'));var rp=require(_0xe438('0x6'));var fs=require('fs');var path=require(_0xe438('0x7'));var rimraf=require(_0xe438('0x8'));var config=require(_0xe438('0x9'));var attributes=require(_0xe438('0xa'));module[_0xe438('0xb')]=function(_0x1db4a0,_0x178b2c){return _0x1db4a0[_0xe438('0xc')](_0xe438('0xd'),attributes,{'tableName':_0xe438('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8402=['./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x14007a,_0x8b3fca){var _0x4592af=function(_0x596108){while(--_0x596108){_0x14007a['push'](_0x14007a['shift']());}};_0x4592af(++_0x8b3fca);}(_0x8402,0x71));var _0x2840=function(_0x91bfa8,_0x194aab){_0x91bfa8=_0x91bfa8-0x0;var _0xd88cd0=_0x8402[_0x91bfa8];return _0xd88cd0;};'use strict';var _=require(_0x2840('0x0'));var util=require(_0x2840('0x1'));var logger=require('../../config/logger')(_0x2840('0x2'));var moment=require(_0x2840('0x3'));var BPromise=require(_0x2840('0x4'));var rp=require(_0x2840('0x5'));var fs=require('fs');var path=require(_0x2840('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2840('0x7'));module[_0x2840('0x8')]=function(_0x480223,_0x59ce77){return _0x480223[_0x2840('0x9')](_0x2840('0xa'),attributes,{'tableName':_0x2840('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 12eb6b7..ce67883 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 _0xc6ef=['code','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x53bd7a,_0x252889){var _0x5e0b75=function(_0x56a6df){while(--_0x56a6df){_0x53bd7a['push'](_0x53bd7a['shift']());}};_0x5e0b75(++_0x252889);}(_0xc6ef,0x81));var _0xfc6e=function(_0x43d402,_0x55abeb){_0x43d402=_0x43d402-0x0;var _0x360d06=_0xc6ef[_0x43d402];return _0x360d06;};'use strict';var _=require(_0xfc6e('0x0'));var util=require(_0xfc6e('0x1'));var moment=require(_0xfc6e('0x2'));var BPromise=require(_0xfc6e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc6e('0x4'));var db=require(_0xfc6e('0x5'))['db'];var utils=require(_0xfc6e('0x6'));var logger=require(_0xfc6e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfc6e('0x8'));var client=jayson[_0xfc6e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23e70c,_0x4e71ca,_0xca5df8){return new BPromise(function(_0x2ca9a9,_0xfb4504){return client[_0xfc6e('0xa')](_0x23e70c,_0xca5df8)[_0xfc6e('0xb')](function(_0x497069){logger[_0xfc6e('0xc')](_0xfc6e('0xd'),_0x4e71ca,_0xfc6e('0xe'));logger[_0xfc6e('0xf')](_0xfc6e('0x10'),_0x4e71ca,_0xfc6e('0xe'),JSON[_0xfc6e('0x11')](_0x497069));if(_0x497069['error']){if(_0x497069['error'][_0xfc6e('0x12')]===0x1f4){logger[_0xfc6e('0x13')](_0xfc6e('0xd'),_0x4e71ca,_0x497069['error'][_0xfc6e('0x14')]);return _0xfb4504(_0x497069[_0xfc6e('0x13')][_0xfc6e('0x14')]);}logger[_0xfc6e('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4e71ca,_0x497069[_0xfc6e('0x13')][_0xfc6e('0x14')]);return _0x2ca9a9(_0x497069[_0xfc6e('0x13')][_0xfc6e('0x14')]);}else{logger[_0xfc6e('0xc')](_0xfc6e('0xd'),_0x4e71ca,_0xfc6e('0xe'));_0x2ca9a9(_0x497069['result'][_0xfc6e('0x14')]);}})['catch'](function(_0x5e6e4d){logger['error'](_0xfc6e('0xd'),_0x4e71ca,_0x5e6e4d);_0xfb4504(_0x5e6e4d);});});} \ No newline at end of file +var _0xb9f4=['lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x50971f,_0x16256c){var _0x466891=function(_0x1a5aca){while(--_0x1a5aca){_0x50971f['push'](_0x50971f['shift']());}};_0x466891(++_0x16256c);}(_0xb9f4,0xdc));var _0x4b9f=function(_0x592d5d,_0x17fc75){_0x592d5d=_0x592d5d-0x0;var _0x2fe551=_0xb9f4[_0x592d5d];return _0x2fe551;};'use strict';var _=require(_0x4b9f('0x0'));var util=require(_0x4b9f('0x1'));var moment=require(_0x4b9f('0x2'));var BPromise=require('bluebird');var rs=require(_0x4b9f('0x3'));var fs=require('fs');var Redis=require(_0x4b9f('0x4'));var db=require(_0x4b9f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4b9f('0x6'));var config=require(_0x4b9f('0x7'));var jayson=require(_0x4b9f('0x8'));var client=jayson[_0x4b9f('0x9')][_0x4b9f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4114fb,_0x1f272f,_0x3b7a69){return new BPromise(function(_0x3eada4,_0x4d299a){return client[_0x4b9f('0xb')](_0x4114fb,_0x3b7a69)['then'](function(_0x48601d){logger['info'](_0x4b9f('0xc'),_0x1f272f,_0x4b9f('0xd'));logger[_0x4b9f('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1f272f,_0x4b9f('0xd'),JSON[_0x4b9f('0xf')](_0x48601d));if(_0x48601d[_0x4b9f('0x10')]){if(_0x48601d[_0x4b9f('0x10')][_0x4b9f('0x11')]===0x1f4){logger[_0x4b9f('0x10')](_0x4b9f('0xc'),_0x1f272f,_0x48601d[_0x4b9f('0x10')][_0x4b9f('0x12')]);return _0x4d299a(_0x48601d[_0x4b9f('0x10')][_0x4b9f('0x12')]);}logger['error'](_0x4b9f('0xc'),_0x1f272f,_0x48601d[_0x4b9f('0x10')][_0x4b9f('0x12')]);return _0x3eada4(_0x48601d['error'][_0x4b9f('0x12')]);}else{logger['info'](_0x4b9f('0xc'),_0x1f272f,_0x4b9f('0xd'));_0x3eada4(_0x48601d['result']['message']);}})[_0x4b9f('0x13')](function(_0x1c5c78){logger[_0x4b9f('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1f272f,_0x1c5c78);_0x4d299a(_0x1c5c78);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 22ccfd9..f20ea78 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 _0xd2fa=['../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','getSections','/:id/resources','getResources','post','create','clone','addSections','addResources','put','update','delete','destroy','removeSections','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2c63b7,_0xd673d){var _0x38a828=function(_0x576e5a){while(--_0x576e5a){_0x2c63b7['push'](_0x2c63b7['shift']());}};_0x38a828(++_0xd673d);}(_0xd2fa,0x1ad));var _0xad2f=function(_0x4813ff,_0xa66ac7){_0x4813ff=_0x4813ff-0x0;var _0x1807aa=_0xd2fa[_0x4813ff];return _0x1807aa;};'use strict';var multer=require('multer');var util=require(_0xad2f('0x0'));var path=require(_0xad2f('0x1'));var timeout=require(_0xad2f('0x2'));var express=require('express');var router=express[_0xad2f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xad2f('0x4'));var interaction=require(_0xad2f('0x5'));var config=require(_0xad2f('0x6'));var controller=require(_0xad2f('0x7'));router[_0xad2f('0x8')]('/',auth[_0xad2f('0x9')](),controller[_0xad2f('0xa')]);router['get'](_0xad2f('0xb'),auth[_0xad2f('0x9')](),controller[_0xad2f('0xc')]);router[_0xad2f('0x8')](_0xad2f('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xad2f('0x8')](_0xad2f('0xe'),auth[_0xad2f('0x9')](),controller[_0xad2f('0xf')]);router[_0xad2f('0x8')](_0xad2f('0x10'),auth['isAuthenticated'](),controller[_0xad2f('0x11')]);router[_0xad2f('0x12')]('/',auth[_0xad2f('0x9')](),controller[_0xad2f('0x13')]);router['post']('/:id/clone',auth[_0xad2f('0x9')](),controller[_0xad2f('0x14')]);router[_0xad2f('0x12')]('/:id/sections',auth['isAuthenticated'](),controller[_0xad2f('0x15')]);router['post'](_0xad2f('0x10'),auth[_0xad2f('0x9')](),controller[_0xad2f('0x16')]);router[_0xad2f('0x17')](_0xad2f('0xd'),auth['isAuthenticated'](),controller[_0xad2f('0x18')]);router[_0xad2f('0x19')](_0xad2f('0xd'),auth['isAuthenticated'](),controller[_0xad2f('0x1a')]);router[_0xad2f('0x19')](_0xad2f('0xe'),auth[_0xad2f('0x9')](),controller[_0xad2f('0x1b')]);router[_0xad2f('0x19')](_0xad2f('0x10'),auth[_0xad2f('0x9')](),controller['removeResources']);module[_0xad2f('0x1c')]=router; \ No newline at end of file +var _0x9bfb=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','create','post','/:id/clone','addSections','addResources','put','update','delete','destroy','removeResources','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x43c0c7,_0x4739b6){var _0x3df9c9=function(_0x5c96a8){while(--_0x5c96a8){_0x43c0c7['push'](_0x43c0c7['shift']());}};_0x3df9c9(++_0x4739b6);}(_0x9bfb,0x12f));var _0xb9bf=function(_0x4d0d2d,_0x4b4ca1){_0x4d0d2d=_0x4d0d2d-0x0;var _0x1e1a80=_0x9bfb[_0x4d0d2d];return _0x1e1a80;};'use strict';var multer=require(_0xb9bf('0x0'));var util=require(_0xb9bf('0x1'));var path=require('path');var timeout=require(_0xb9bf('0x2'));var express=require(_0xb9bf('0x3'));var router=express['Router']();var fs_extra=require(_0xb9bf('0x4'));var auth=require(_0xb9bf('0x5'));var interaction=require(_0xb9bf('0x6'));var config=require(_0xb9bf('0x7'));var controller=require('./userProfile.controller');router[_0xb9bf('0x8')]('/',auth[_0xb9bf('0x9')](),controller['index']);router[_0xb9bf('0x8')]('/describe',auth[_0xb9bf('0x9')](),controller[_0xb9bf('0xa')]);router[_0xb9bf('0x8')](_0xb9bf('0xb'),auth[_0xb9bf('0x9')](),controller[_0xb9bf('0xc')]);router[_0xb9bf('0x8')](_0xb9bf('0xd'),auth[_0xb9bf('0x9')](),controller[_0xb9bf('0xe')]);router[_0xb9bf('0x8')](_0xb9bf('0xf'),auth['isAuthenticated'](),controller[_0xb9bf('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb9bf('0x11')]);router[_0xb9bf('0x12')](_0xb9bf('0x13'),auth[_0xb9bf('0x9')](),controller['clone']);router[_0xb9bf('0x12')](_0xb9bf('0xd'),auth[_0xb9bf('0x9')](),controller[_0xb9bf('0x14')]);router['post'](_0xb9bf('0xf'),auth[_0xb9bf('0x9')](),controller[_0xb9bf('0x15')]);router[_0xb9bf('0x16')](_0xb9bf('0xb'),auth[_0xb9bf('0x9')](),controller[_0xb9bf('0x17')]);router[_0xb9bf('0x18')](_0xb9bf('0xb'),auth[_0xb9bf('0x9')](),controller[_0xb9bf('0x19')]);router[_0xb9bf('0x18')](_0xb9bf('0xd'),auth[_0xb9bf('0x9')](),controller['removeSections']);router[_0xb9bf('0x18')](_0xb9bf('0xf'),auth[_0xb9bf('0x9')](),controller[_0xb9bf('0x1a')]);module[_0xb9bf('0x1b')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 0ffce4f..b1741fc 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 _0x5368=['exports','STRING','name','crudPermissions','split','BOOLEAN','sequelize'];(function(_0x249e96,_0x3ea39d){var _0x17444c=function(_0x1221d0){while(--_0x1221d0){_0x249e96['push'](_0x249e96['shift']());}};_0x17444c(++_0x3ea39d);}(_0x5368,0x110));var _0x8536=function(_0xeb19b8,_0xddc9f7){_0xeb19b8=_0xeb19b8-0x0;var _0x30c823=_0x5368[_0xeb19b8];return _0x30c823;};'use strict';var Sequelize=require(_0x8536('0x0'));module[_0x8536('0x1')]={'name':{'type':Sequelize[_0x8536('0x2')],'allowNull':![],'unique':_0x8536('0x3')},'crudPermissions':{'type':Sequelize[_0x8536('0x2')],'set':function(_0xc8c98a){this['setDataValue'](_0x8536('0x4'),_0xc8c98a?_0xc8c98a['join'](''):[]);},'get':function(){return this['getDataValue'](_0x8536('0x4'))?this['getDataValue']('crudPermissions')[_0x8536('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8536('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8536('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8536('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8536('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8536('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8536('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf7c4=['name','setDataValue','crudPermissions','join','getDataValue','BOOLEAN','sequelize','exports','STRING'];(function(_0x343595,_0x3c5e93){var _0x32c374=function(_0xfd07b){while(--_0xfd07b){_0x343595['push'](_0x343595['shift']());}};_0x32c374(++_0x3c5e93);}(_0xf7c4,0x15c));var _0x4f7c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf7c4[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x4f7c('0x0'));module[_0x4f7c('0x1')]={'name':{'type':Sequelize[_0x4f7c('0x2')],'allowNull':![],'unique':_0x4f7c('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2a5ed1){this[_0x4f7c('0x4')](_0x4f7c('0x5'),_0x2a5ed1?_0x2a5ed1[_0x4f7c('0x6')](''):[]);},'get':function(){return this[_0x4f7c('0x7')](_0x4f7c('0x5'))?this['getDataValue']('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x4f7c('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x4f7c('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x4f7c('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x4f7c('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4f7c('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x4f7c('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 03e0556..eddac67 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 _0x4d56=['body','createdAt','sequelize','transaction','get','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','describe','addSections','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','sendStatus','status','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','end','error','stack','name','map','UserProfile','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','where','filters','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','length','includeAll','find','create','clone','omit','updatedAt'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4d56,0x16a));var _0x64d5=function(_0x555e06,_0x599194){_0x555e06=_0x555e06-0x0;var _0x5944a8=_0x4d56[_0x555e06];return _0x5944a8;};'use strict';var emlformat=require(_0x64d5('0x0'));var rimraf=require(_0x64d5('0x1'));var zipdir=require(_0x64d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64d5('0x3'));var moment=require(_0x64d5('0x4'));var BPromise=require(_0x64d5('0x5'));var Mustache=require(_0x64d5('0x6'));var util=require(_0x64d5('0x7'));var path=require(_0x64d5('0x8'));var sox=require('sox');var csv=require(_0x64d5('0x9'));var ejs=require(_0x64d5('0xa'));var fs=require('fs');var fs_extra=require(_0x64d5('0xb'));var _=require('lodash');var squel=require(_0x64d5('0xc'));var crypto=require(_0x64d5('0xd'));var jsforce=require(_0x64d5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x64d5('0x9'));var querystring=require(_0x64d5('0xf'));var Papa=require(_0x64d5('0x10'));var Redis=require(_0x64d5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x64d5('0x12'));var as=require(_0x64d5('0x13'));var hardwareService=require(_0x64d5('0x14'));var logger=require(_0x64d5('0x15'))(_0x64d5('0x16'));var utils=require(_0x64d5('0x17'));var config=require(_0x64d5('0x18'));var licenseUtil=require(_0x64d5('0x19'));var db=require(_0x64d5('0x1a'))['db'];config[_0x64d5('0x1b')]=_['defaults'](config[_0x64d5('0x1b')],{'host':_0x64d5('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x64d5('0x1b')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x3d1286,_0x4fe764){_0x4fe764=_0x4fe764||0xcc;return function(_0x15cdf4){if(_0x15cdf4){return _0x3d1286[_0x64d5('0x1d')](_0x4fe764);}return _0x3d1286[_0x64d5('0x1e')](_0x4fe764)['end']();};}function respondWithResult(_0x31c9ba,_0x3ef206){_0x3ef206=_0x3ef206||0xc8;return function(_0x1dc9d2){if(_0x1dc9d2){return _0x31c9ba['status'](_0x3ef206)['json'](_0x1dc9d2);}};}function respondWithFilteredResult(_0x2f4f8c,_0x103025){return function(_0x1aeb8b){if(_0x1aeb8b){var _0xd3e206=typeof _0x103025[_0x64d5('0x1f')]===_0x64d5('0x20')&&typeof _0x103025['limit']==='undefined';var _0x2084c3=_0x1aeb8b['count'];var _0x1b22a3=_0xd3e206?0x0:_0x103025[_0x64d5('0x1f')];var _0x114125=_0xd3e206?_0x1aeb8b[_0x64d5('0x21')]:_0x103025[_0x64d5('0x1f')]+_0x103025[_0x64d5('0x22')];var _0x4961cc;if(_0x114125>=_0x2084c3){_0x114125=_0x2084c3;_0x4961cc=0xc8;}else{_0x4961cc=0xce;}_0x2f4f8c['status'](_0x4961cc);return _0x2f4f8c['set']('Content-Range',_0x1b22a3+'-'+_0x114125+'/'+_0x2084c3)[_0x64d5('0x23')](_0x1aeb8b);}return null;};}function patchUpdates(_0x1480b2){return function(_0x454c26){try{jsonpatch[_0x64d5('0x24')](_0x454c26,_0x1480b2,!![]);}catch(_0x30dcf7){return BPromise[_0x64d5('0x25')](_0x30dcf7);}return _0x454c26[_0x64d5('0x26')]();};}function saveUpdates(_0x1444ec,_0x36014b){return function(_0x128f53){if(_0x128f53){return _0x128f53[_0x64d5('0x27')](_0x1444ec)[_0x64d5('0x28')](function(_0x57f8ee){return _0x57f8ee;});}return null;};}function removeEntity(_0x312cf3,_0x4f8466){return function(_0x12da86){if(_0x12da86){return _0x12da86[_0x64d5('0x29')]()[_0x64d5('0x28')](function(){_0x312cf3[_0x64d5('0x1e')](0xcc)[_0x64d5('0x2a')]();});}};}function handleEntityNotFound(_0x276aeb,_0x28451b){return function(_0x945232){if(!_0x945232){_0x276aeb[_0x64d5('0x1d')](0x194);}return _0x945232;};}function handleError(_0x4c6be0,_0x517361){_0x517361=_0x517361||0x1f4;return function(_0x389532){logger[_0x64d5('0x2b')](_0x389532[_0x64d5('0x2c')]);if(_0x389532[_0x64d5('0x2d')]){delete _0x389532[_0x64d5('0x2d')];}_0x4c6be0[_0x64d5('0x1e')](_0x517361)['send'](_0x389532);};}exports['index']=function(_0x3b6dda,_0x30a851){var _0x142ff4={},_0x20f02d={},_0x2d4752={'count':0x0,'rows':[]};var _0x2645fb=_[_0x64d5('0x2e')](db[_0x64d5('0x2f')][_0x64d5('0x30')],function(_0x3ac4b6){return{'name':_0x3ac4b6[_0x64d5('0x31')],'type':_0x3ac4b6[_0x64d5('0x32')][_0x64d5('0x33')]};});_0x20f02d['model']=_['map'](_0x2645fb,_0x64d5('0x2d'));_0x20f02d['query']=_['keys'](_0x3b6dda[_0x64d5('0x34')]);_0x20f02d['filters']=_[_0x64d5('0x35')](_0x20f02d[_0x64d5('0x36')],_0x20f02d[_0x64d5('0x34')]);_0x142ff4[_0x64d5('0x37')]=_[_0x64d5('0x35')](_0x20f02d['model'],qs[_0x64d5('0x38')](_0x3b6dda[_0x64d5('0x34')][_0x64d5('0x38')]));_0x142ff4[_0x64d5('0x37')]=_0x142ff4[_0x64d5('0x37')]['length']?_0x142ff4[_0x64d5('0x37')]:_0x20f02d[_0x64d5('0x36')];if(!_0x3b6dda[_0x64d5('0x34')][_0x64d5('0x39')](_0x64d5('0x3a'))){_0x142ff4[_0x64d5('0x22')]=qs[_0x64d5('0x22')](_0x3b6dda[_0x64d5('0x34')][_0x64d5('0x22')]);_0x142ff4[_0x64d5('0x1f')]=qs['offset'](_0x3b6dda[_0x64d5('0x34')][_0x64d5('0x1f')]);}_0x142ff4['order']=qs['sort'](_0x3b6dda[_0x64d5('0x34')]['sort']);_0x142ff4[_0x64d5('0x3b')]=qs[_0x64d5('0x3c')](_['pick'](_0x3b6dda['query'],_0x20f02d[_0x64d5('0x3c')]),_0x2645fb);if(_0x3b6dda[_0x64d5('0x34')][_0x64d5('0x3d')]){_0x142ff4['where']=_[_0x64d5('0x3e')](_0x142ff4[_0x64d5('0x3b')],{'$or':_[_0x64d5('0x2e')](_0x2645fb,function(_0x4d8a71){if(_0x4d8a71[_0x64d5('0x32')]!==_0x64d5('0x3f')){var _0x4d8da1={};_0x4d8da1[_0x4d8a71[_0x64d5('0x2d')]]={'$like':'%'+_0x3b6dda[_0x64d5('0x34')][_0x64d5('0x3d')]+'%'};return _0x4d8da1;}})});}_0x142ff4=_[_0x64d5('0x3e')]({},_0x142ff4,_0x3b6dda[_0x64d5('0x40')]);var _0x226057={'where':_0x142ff4['where']};return db[_0x64d5('0x2f')][_0x64d5('0x21')](_0x226057)[_0x64d5('0x28')](function(_0xfec161){_0x2d4752[_0x64d5('0x21')]=_0xfec161;if(_0x3b6dda[_0x64d5('0x34')]['includeAll']){_0x142ff4[_0x64d5('0x41')]=[{'all':!![]}];}return db['UserProfile'][_0x64d5('0x42')](_0x142ff4);})[_0x64d5('0x28')](function(_0x233a54){_0x2d4752['rows']=_0x233a54;return _0x2d4752;})[_0x64d5('0x28')](respondWithFilteredResult(_0x30a851,_0x142ff4))[_0x64d5('0x43')](handleError(_0x30a851,null));};exports[_0x64d5('0x44')]=function(_0x3908e4,_0x18f731){var _0x202a1a={'raw':![],'where':{'id':_0x3908e4[_0x64d5('0x45')]['id']}},_0x265b33={};_0x265b33['model']=_[_0x64d5('0x46')](db[_0x64d5('0x2f')][_0x64d5('0x30')]);_0x265b33[_0x64d5('0x34')]=_[_0x64d5('0x46')](_0x3908e4['query']);_0x265b33[_0x64d5('0x3c')]=_[_0x64d5('0x35')](_0x265b33[_0x64d5('0x36')],_0x265b33[_0x64d5('0x34')]);_0x202a1a[_0x64d5('0x37')]=_[_0x64d5('0x35')](_0x265b33[_0x64d5('0x36')],qs[_0x64d5('0x38')](_0x3908e4[_0x64d5('0x34')]['fields']));_0x202a1a[_0x64d5('0x37')]=_0x202a1a[_0x64d5('0x37')][_0x64d5('0x47')]?_0x202a1a[_0x64d5('0x37')]:_0x265b33[_0x64d5('0x36')];if(_0x3908e4[_0x64d5('0x34')][_0x64d5('0x48')]){_0x202a1a[_0x64d5('0x41')]=[{'all':!![]}];}_0x202a1a=_[_0x64d5('0x3e')]({},_0x202a1a,_0x3908e4[_0x64d5('0x40')]);return db[_0x64d5('0x2f')][_0x64d5('0x49')](_0x202a1a)[_0x64d5('0x28')](handleEntityNotFound(_0x18f731,null))['then'](respondWithResult(_0x18f731,null))[_0x64d5('0x43')](handleError(_0x18f731,null));};exports[_0x64d5('0x4a')]=function(_0x2f0732,_0x36703d){return db['UserProfile']['create'](_0x2f0732['body'],{})[_0x64d5('0x28')](respondWithResult(_0x36703d,0xc9))[_0x64d5('0x43')](handleError(_0x36703d,null));};exports[_0x64d5('0x4b')]=function(_0x1834eb,_0xba3898){var _0x132c19={'where':{'id':_0x1834eb[_0x64d5('0x45')]['id']}},_0x3820cf={};_0x3820cf[_0x64d5('0x36')]=_[_0x64d5('0x46')](db['UserProfile'][_0x64d5('0x30')]);_0x132c19[_0x64d5('0x37')]=_[_0x64d5('0x35')](_0x3820cf[_0x64d5('0x36')],qs[_0x64d5('0x38')](_0x1834eb[_0x64d5('0x34')][_0x64d5('0x38')]));_0x132c19[_0x64d5('0x37')]=_0x132c19[_0x64d5('0x37')][_0x64d5('0x47')]?_0x132c19[_0x64d5('0x37')]:_0x3820cf['model'];if(_0x1834eb[_0x64d5('0x34')][_0x64d5('0x48')]){_0x132c19[_0x64d5('0x41')]=[{'all':!![]}];}_0x132c19=_['merge']({},_0x132c19,_0x1834eb[_0x64d5('0x40')]);return db['UserProfile']['find'](_0x132c19)[_0x64d5('0x28')](handleEntityNotFound(_0xba3898,null))[_0x64d5('0x28')](function(_0x24a11f){if(_0x24a11f){var _0x482452=_0x24a11f['get']({'plain':!![]});_0x482452=qs[_0x64d5('0x4c')](_0x482452,['id','createdAt',_0x64d5('0x4d'),'crudPermissions']);_0x1834eb[_0x64d5('0x4e')]=_[_0x64d5('0x4c')](_0x1834eb[_0x64d5('0x4e')],['id',_0x64d5('0x4f'),_0x64d5('0x4d')]);return db[_0x64d5('0x50')][_0x64d5('0x51')](function(_0x5ba306){return db[_0x64d5('0x2f')][_0x64d5('0x4a')](_['merge'](_0x482452,_0x1834eb[_0x64d5('0x4e')]),{'include':_0x1834eb[_0x64d5('0x34')][_0x64d5('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x5ba306})[_0x64d5('0x28')](function(_0x1947d0){var _0x5c5a34=_0x1947d0[_0x64d5('0x52')]({'plain':!![]});return db['UserProfileSection'][_0x64d5('0x42')]({'where':{'userProfileId':_0x1834eb[_0x64d5('0x45')]['id']},'raw':!![]})['then'](function(_0x5d2100){if(_0x5d2100){return BPromise[_0x64d5('0x53')](_0x5d2100,function(_0x6e8816){return new BPromise(function(_0x2019d5,_0x40d726){if(_0x6e8816[_0x64d5('0x54')]===null||_0x6e8816[_0x64d5('0x54')]===0x1)_0x2019d5(null);return db[_0x64d5('0x55')][_0x64d5('0x42')]({'where':{'sectionId':_0x6e8816['id']},'raw':!![]})[_0x64d5('0x28')](function(_0x5c1e1d){var _0x4ea107=_['map'](_0x5c1e1d,function(_0x15c6e9){return qs['omit'](_0x15c6e9,['id',_0x64d5('0x4f'),'updatedAt',_0x64d5('0x56')]);});_0x2019d5(_0x4ea107);})[_0x64d5('0x43')](function(_0x24a76a){_0x40d726(_0x24a76a);});})[_0x64d5('0x28')](function(_0x5d9510){var _0x833bc2=qs[_0x64d5('0x4c')](_0x6e8816,['id',_0x64d5('0x4f'),_0x64d5('0x4d')]);_0x833bc2[_0x64d5('0x57')]=_0x5c5a34['id'];if(_0x5d9510)_0x833bc2[_0x64d5('0x58')]=_0x5d9510;return _0x833bc2;})[_0x64d5('0x28')](function(_0x16faf3){return db[_0x64d5('0x59')][_0x64d5('0x4a')](_0x16faf3,{'include':[{'model':db[_0x64d5('0x55')],'as':_0x64d5('0x58')}],'raw':!![],'transaction':_0x5ba306});});})[_0x64d5('0x28')](function(){return _0x5c5a34;});}});});});}})[_0x64d5('0x28')](respondWithResult(_0xba3898,0xc9))['catch'](handleError(_0xba3898,null));};exports[_0x64d5('0x27')]=function(_0x150c98,_0x4911c0){if(_0x150c98['body']['id']){delete _0x150c98[_0x64d5('0x4e')]['id'];}return db['UserProfile'][_0x64d5('0x49')]({'where':{'id':_0x150c98[_0x64d5('0x45')]['id']}})[_0x64d5('0x28')](handleEntityNotFound(_0x4911c0,null))['then'](saveUpdates(_0x150c98[_0x64d5('0x4e')],null))[_0x64d5('0x28')](respondWithResult(_0x4911c0,null))['catch'](handleError(_0x4911c0,null));};exports[_0x64d5('0x29')]=function(_0x4f6c23,_0x2b0d13){return db[_0x64d5('0x2f')][_0x64d5('0x49')]({'where':{'id':_0x4f6c23[_0x64d5('0x45')]['id']}})[_0x64d5('0x28')](handleEntityNotFound(_0x2b0d13,null))['then'](removeEntity(_0x2b0d13,null))[_0x64d5('0x43')](handleError(_0x2b0d13,null));};exports['describe']=function(_0xaf3ca5,_0x190330){return db[_0x64d5('0x2f')][_0x64d5('0x5a')]()[_0x64d5('0x28')](respondWithResult(_0x190330,null))[_0x64d5('0x43')](handleError(_0x190330,null));};exports[_0x64d5('0x5b')]=function(_0x304e46,_0x5bc41e){var _0x3bbfaa=_0x304e46[_0x64d5('0x4e')];return db[_0x64d5('0x2f')]['find']({'where':{'id':_0x304e46['params']['id']}})[_0x64d5('0x28')](handleEntityNotFound(_0x5bc41e,null))['then'](function(_0x25ed1d){if(_0x25ed1d){return db[_0x64d5('0x50')][_0x64d5('0x51')](function(_0x5baae4){return db[_0x64d5('0x59')][_0x64d5('0x29')]({'where':{'userProfileId':_0x304e46[_0x64d5('0x45')]['id'],'sectionId':_[_0x64d5('0x2e')](_0x3bbfaa,function(_0x11c45d){return _0x11c45d[_0x64d5('0x56')];})},'transaction':_0x5baae4})[_0x64d5('0x28')](function(){var _0x3f16a1=_[_0x64d5('0x2e')](_0x3bbfaa,function(_0x4a3fab){_0x4a3fab[_0x64d5('0x57')]=_0x304e46['params']['id'];return _0x4a3fab;});var _0x1f262b=[];return BPromise[_0x64d5('0x53')](_0x3f16a1,function(_0x56282f){return db[_0x64d5('0x59')]['create'](_0x56282f,{'include':[{'model':db[_0x64d5('0x55')],'as':_0x64d5('0x58')}],'raw':!![],'transaction':_0x5baae4})[_0x64d5('0x28')](function(_0x4e31d4){_0x1f262b[_0x64d5('0x5c')](_0x4e31d4['get']({'plain':!![]}));});})[_0x64d5('0x28')](function(){return _0x1f262b;});});});}})[_0x64d5('0x28')](function(_0x5a073c){return _0x5a073c;})['then'](respondWithResult(_0x5bc41e,null))[_0x64d5('0x43')](handleError(_0x5bc41e,null));};exports[_0x64d5('0x5d')]=function(_0x48a09f,_0x1b371a){var _0x5c9aab;return db[_0x64d5('0x2f')][_0x64d5('0x49')]({'where':{'id':_0x48a09f[_0x64d5('0x45')]['id']},'attributes':['id',_0x64d5('0x2d')]})['then'](handleEntityNotFound(_0x1b371a,null))['then'](function(_0x3912a7){if(_0x3912a7){_0x5c9aab=_0x3912a7;return db['UserProfileSection'][_0x64d5('0x29')]({'where':{'userProfileId':_0x48a09f[_0x64d5('0x45')]['id'],'sectionId':_0x48a09f[_0x64d5('0x34')][_0x64d5('0x5e')]}});}})[_0x64d5('0x28')](function(){return _0x5c9aab;})['then'](respondWithStatusCode(_0x1b371a,null))[_0x64d5('0x43')](handleError(_0x1b371a,null));};exports[_0x64d5('0x5f')]=function(_0x2a3b72,_0x6a44c3){var _0x33f4b5=[];var _0x4f6fc7=[];return db[_0x64d5('0x59')][_0x64d5('0x42')]({'where':{'userProfileId':_0x2a3b72[_0x64d5('0x45')]['id']},'raw':!![]})['then'](function(_0x2a137f){_0x33f4b5=_[_0x64d5('0x3d')](_0x2a137f,function(_0x47b8b6){return _0x47b8b6[_0x64d5('0x60')]===0x1||_[_0x64d5('0x61')]([0x3eb,0x709],_0x47b8b6['sectionId']);});if(!_[_0x64d5('0x62')](_0x33f4b5)){return _['map'](_0x33f4b5,function(_0x5b3054){return _0x5b3054[_0x64d5('0x56')];});}else{return;}})[_0x64d5('0x28')](function(_0x3aa394){if(_0x3aa394)_0x4f6fc7=_0x3aa394;if(_['includes'](_0x4f6fc7,0x64)){var _0x3694f7=_[_0x64d5('0x49')](_0x33f4b5,{'sectionId':0x64});return hasDefaultDashboard(_0x3694f7)[_0x64d5('0x28')](function(_0x3f0b89){return _[_0x64d5('0x2e')](_0x33f4b5,function(_0x5c4591){if(_0x5c4591[_0x64d5('0x56')]===0x64){_0x5c4591[_0x64d5('0x63')]=_0x3f0b89;}return _0x5c4591;});});}else{return;}})[_0x64d5('0x28')](function(_0x36851b){if(_0x36851b)_0x33f4b5=_0x36851b;if(_[_0x64d5('0x61')](_0x4f6fc7,0x3eb)){var _0x3cf0ad=_[_0x64d5('0x49')](_0x33f4b5,{'sectionId':0x3eb});return getCustomDashboards(_0x3cf0ad)[_0x64d5('0x28')](function(_0x3d7130){return _[_0x64d5('0x2e')](_0x33f4b5,function(_0x1038fe){if(_0x3cf0ad[_0x64d5('0x60')]){if(_0x1038fe['sectionId']===0x3eb){_0x1038fe['subsections']=_0x3d7130;}}else{if(_0x1038fe['sectionId']===0x64){if(!_0x1038fe['subsections']){_0x1038fe[_0x64d5('0x63')]=[];}_0x1038fe[_0x64d5('0x63')]=_0x1038fe[_0x64d5('0x63')][_0x64d5('0x64')](_0x3d7130);}}return _0x1038fe;});});}else{return;}})['then'](function(_0x39d572){if(_0x39d572)_0x33f4b5=_0x39d572;if(_[_0x64d5('0x61')](_0x4f6fc7,0x709)){var _0x2d26a3=_['find'](_0x33f4b5,{'sectionId':0x709});return getPlugins(_0x2d26a3)[_0x64d5('0x28')](function(_0x1fd9f2){if(_0x2d26a3[_0x64d5('0x60')]){return _[_0x64d5('0x2e')](_0x33f4b5,function(_0x32db98){if(_0x32db98[_0x64d5('0x56')]===0x709){_0x32db98[_0x64d5('0x63')]=_0x1fd9f2;}return _0x32db98;});}else{var _0x4dc57d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1fd9f2};var _0x3d50d9=_[_0x64d5('0x2e')](_0x33f4b5);_0x3d50d9['push'](_0x4dc57d);return _0x3d50d9;}});}else{return;}})[_0x64d5('0x28')](function(_0x550e16){if(_0x550e16)_0x33f4b5=_0x550e16;return _[_0x64d5('0x3d')](_0x33f4b5,['enabled',0x1]);})[_0x64d5('0x28')](respondWithResult(_0x6a44c3,null))[_0x64d5('0x43')](handleError(_0x6a44c3,null));};function hasDefaultDashboard(_0x413eaa){var _0x1a4b45=[0x65];return new BPromise(function(_0x1e495a,_0x38052f){try{if(_0x413eaa[_0x64d5('0x54')]){_0x1e495a(_0x1a4b45);}else{return db[_0x64d5('0x55')][_0x64d5('0x65')]({'where':{'sectionId':_0x413eaa['id']},'raw':!![]})['then'](function(_0x492029){_0x492029?_0x1e495a(_0x1a4b45):_0x1e495a();});}}catch(_0xb3d402){_0x38052f(_0xb3d402);}});}function getCustomDashboards(_0x380ad9){var _0x5cc4d9=[];return new BPromise(function(_0x31170a,_0x4509d2){try{if(_0x380ad9['autoAssociation']){return db[_0x64d5('0x66')]['findAll']({'raw':!![]})[_0x64d5('0x28')](function(_0x120262){_0x120262[_0x64d5('0x67')](function(_0x2c1935){_0x5cc4d9['push'](_0x2c1935['id']+0x1869f);});_0x31170a(_0x5cc4d9);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x380ad9['id']},'raw':!![]})[_0x64d5('0x28')](function(_0x280ca0){_0x280ca0[_0x64d5('0x67')](function(_0x249ab1){_0x5cc4d9['push'](_0x249ab1[_0x64d5('0x68')]+0x1869f);});_0x31170a(_0x5cc4d9);});}}catch(_0x4ce255){_0x4509d2(_0x4ce255);}});}function getPlugins(_0x9320ff){var _0x48f258=[];return new BPromise(function(_0x5d7e15,_0x3ae764){try{if(_0x9320ff[_0x64d5('0x54')]){return db[_0x64d5('0x69')][_0x64d5('0x42')]({'raw':!![]})[_0x64d5('0x28')](function(_0xb574fe){_0xb574fe[_0x64d5('0x67')](function(_0x4a514d){_0x48f258[_0x64d5('0x5c')](_0x4a514d['id']+0x15b38);});_0x5d7e15(_0x48f258);});}else{return db['UserProfileResource'][_0x64d5('0x42')]({'where':{'sectionId':_0x9320ff['id']},'raw':!![]})['then'](function(_0x2feb55){_0x2feb55[_0x64d5('0x67')](function(_0x5d12f1){_0x48f258[_0x64d5('0x5c')](_0x5d12f1[_0x64d5('0x68')]+0x15b38);});_0x5d7e15(_0x48f258);});}}catch(_0x1805e7){_0x3ae764(_0x1805e7);}});}exports['addResources']=function(_0x5c570d,_0x2d9137){return db['UserProfile']['find']({'where':{'id':_0x5c570d[_0x64d5('0x45')]['id']}})[_0x64d5('0x28')](handleEntityNotFound(_0x2d9137,null))[_0x64d5('0x28')](function(_0x26f70d){if(_0x26f70d){return db[_0x64d5('0x50')][_0x64d5('0x51')](function(_0x4ed0c0){return db['UserProfileSection'][_0x64d5('0x42')]({'where':{'userProfileId':_0x5c570d['params']['id']},'attributes':['id'],'raw':!![]})[_0x64d5('0x28')](function(_0x1e2e06){if(_0x1e2e06){return db[_0x64d5('0x59')][_0x64d5('0x29')]({'where':{'userProfileId':_0x5c570d[_0x64d5('0x45')]['id'],'id':_[_0x64d5('0x2e')](_0x1e2e06,function(_0x4c6989){return _0x4c6989['id'];})},'transaction':_0x4ed0c0});}})[_0x64d5('0x28')](function(_0x1d299d){var _0x3ec3f6=_['map'](_0x5c570d[_0x64d5('0x4e')],function(_0x4bd684){_0x4bd684[_0x64d5('0x57')]=_0x5c570d[_0x64d5('0x45')]['id'];return _0x4bd684;});return db['UserProfileSection'][_0x64d5('0x6a')](_0x3ec3f6,{'raw':!![],'transaction':_0x4ed0c0});})['then'](function(_0x5d0aa9){var _0x3fc976=_['filter'](_['map'](_0x5d0aa9,function(_0x93843b){return _0x93843b[_0x64d5('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x3fc976){return db[_0x64d5('0x59')]['findAll']({'where':{'userProfileId':_0x5c570d[_0x64d5('0x45')]['id'],'sectionId':_[_0x64d5('0x2e')](_0x3fc976,function(_0x3d44e1){return _0x3d44e1['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x3e0860){var _0x342d04=_[_0x64d5('0x2e')](_0x5c570d[_0x64d5('0x4e')],function(_0x618376){_0x618376[_0x64d5('0x57')]=_0x5c570d[_0x64d5('0x45')]['id'];return _0x618376;});return db[_0x64d5('0x55')][_0x64d5('0x6a')](_0x342d04,{'raw':!![],'transaction':_0x4ed0c0});});}})['catch'](handleError(_0x2d9137,null));});}})[_0x64d5('0x28')](function(_0x574f61){var _0x2ff276=_[_0x64d5('0x2e')](_0x574f61,function(_0xea2594){return _0xea2594[_0x64d5('0x52')]({'plain':!![]});});})['then'](respondWithResult(_0x2d9137,null))[_0x64d5('0x43')](handleError(_0x2d9137,null));};exports['removeResources']=function(_0x3b2682,_0x46d3fc,_0x5bf719){return db[_0x64d5('0x2f')][_0x64d5('0x49')]({'where':{'id':_0x3b2682[_0x64d5('0x45')]['id']}})['then'](handleEntityNotFound(_0x46d3fc,null))[_0x64d5('0x28')](function(_0x5a1997){if(_0x5a1997){return _0x5a1997[_0x64d5('0x6b')](_0x3b2682[_0x64d5('0x34')][_0x64d5('0x5e')]);}})[_0x64d5('0x28')](respondWithStatusCode(_0x46d3fc,null))[_0x64d5('0x43')](handleError(_0x46d3fc,null));};exports['getResources']=function(_0x4d0408,_0x92a408){var _0x3eac64={};if(!_0x4d0408[_0x64d5('0x34')][_0x64d5('0x6c')])throw new Error('Missing\x20section\x20parameter');if(!_0x4d0408['query'][_0x64d5('0x39')](_0x64d5('0x3a'))){_0x3eac64[_0x64d5('0x22')]=qs[_0x64d5('0x22')](_0x4d0408[_0x64d5('0x34')][_0x64d5('0x22')]);_0x3eac64[_0x64d5('0x1f')]=qs['offset'](_0x4d0408[_0x64d5('0x34')][_0x64d5('0x1f')]);}return db[_0x64d5('0x2f')][_0x64d5('0x49')]({'where':{'id':_0x4d0408['params']['id']}})[_0x64d5('0x28')](function(_0x1fff50){if(!_0x1fff50)throw new Error(_0x64d5('0x6d')+_0x4d0408[_0x64d5('0x45')]['id']);return db[_0x64d5('0x2f')]['getResources'](_0x4d0408);})[_0x64d5('0x28')](respondWithFilteredResult(_0x92a408,_0x3eac64))[_0x64d5('0x43')](handleError(_0x92a408,null));}; \ No newline at end of file +var _0x8d0d=['options','includeAll','findAll','catch','show','params','find','create','clone','include','get','createdAt','updatedAt','crudPermissions','body','sequelize','UserProfileSection','autoAssociation','omit','sectionId','userProfileId','UserProfileResource','Resources','describe','addSections','transaction','each','push','removeSections','getSections','enabled','includes','subsections','concat','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','UserProfile','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x255543,_0xde9908){var _0x57cb50=function(_0x5c0e67){while(--_0x5c0e67){_0x255543['push'](_0x255543['shift']());}};_0x57cb50(++_0xde9908);}(_0x8d0d,0x184));var _0xd8d0=function(_0x2efcfa,_0x4f3277){_0x2efcfa=_0x2efcfa-0x0;var _0x5dfc72=_0x8d0d[_0x2efcfa];return _0x5dfc72;};'use strict';var emlformat=require(_0xd8d0('0x0'));var rimraf=require(_0xd8d0('0x1'));var zipdir=require(_0xd8d0('0x2'));var jsonpatch=require(_0xd8d0('0x3'));var rp=require(_0xd8d0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd8d0('0x5'));var util=require(_0xd8d0('0x6'));var path=require(_0xd8d0('0x7'));var sox=require(_0xd8d0('0x8'));var csv=require(_0xd8d0('0x9'));var ejs=require(_0xd8d0('0xa'));var fs=require('fs');var fs_extra=require(_0xd8d0('0xb'));var _=require('lodash');var squel=require(_0xd8d0('0xc'));var crypto=require(_0xd8d0('0xd'));var jsforce=require(_0xd8d0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd8d0('0x9'));var querystring=require(_0xd8d0('0xf'));var Papa=require(_0xd8d0('0x10'));var Redis=require(_0xd8d0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd8d0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd8d0('0x13'));var logger=require(_0xd8d0('0x14'))(_0xd8d0('0x15'));var utils=require(_0xd8d0('0x16'));var config=require(_0xd8d0('0x17'));var licenseUtil=require(_0xd8d0('0x18'));var db=require(_0xd8d0('0x19'))['db'];config['redis']=_[_0xd8d0('0x1a')](config[_0xd8d0('0x1b')],{'host':_0xd8d0('0x1c'),'port':0x18eb});var socket=require(_0xd8d0('0x1d'))(new Redis(config[_0xd8d0('0x1b')]));require(_0xd8d0('0x1e'))[_0xd8d0('0x1f')](socket);function respondWithStatusCode(_0x3f1374,_0x49ca3d){_0x49ca3d=_0x49ca3d||0xcc;return function(_0x308c8e){if(_0x308c8e){return _0x3f1374['sendStatus'](_0x49ca3d);}return _0x3f1374[_0xd8d0('0x20')](_0x49ca3d)['end']();};}function respondWithResult(_0x2114a5,_0x46fcb8){_0x46fcb8=_0x46fcb8||0xc8;return function(_0x3cc627){if(_0x3cc627){return _0x2114a5[_0xd8d0('0x20')](_0x46fcb8)['json'](_0x3cc627);}};}function respondWithFilteredResult(_0x31c645,_0x187f8c){return function(_0x14f324){if(_0x14f324){var _0x30bca4=typeof _0x187f8c[_0xd8d0('0x21')]===_0xd8d0('0x22')&&typeof _0x187f8c[_0xd8d0('0x23')]==='undefined';var _0x36d089=_0x14f324[_0xd8d0('0x24')];var _0x3929d8=_0x30bca4?0x0:_0x187f8c[_0xd8d0('0x21')];var _0x42a98c=_0x30bca4?_0x14f324['count']:_0x187f8c[_0xd8d0('0x21')]+_0x187f8c['limit'];var _0x44d5db;if(_0x42a98c>=_0x36d089){_0x42a98c=_0x36d089;_0x44d5db=0xc8;}else{_0x44d5db=0xce;}_0x31c645[_0xd8d0('0x20')](_0x44d5db);return _0x31c645['set'](_0xd8d0('0x25'),_0x3929d8+'-'+_0x42a98c+'/'+_0x36d089)[_0xd8d0('0x26')](_0x14f324);}return null;};}function patchUpdates(_0xe3f4f){return function(_0x1da953){try{jsonpatch['apply'](_0x1da953,_0xe3f4f,!![]);}catch(_0x4b73bf){return BPromise[_0xd8d0('0x27')](_0x4b73bf);}return _0x1da953[_0xd8d0('0x28')]();};}function saveUpdates(_0x5799d3,_0x31001f){return function(_0x3a6a36){if(_0x3a6a36){return _0x3a6a36[_0xd8d0('0x29')](_0x5799d3)[_0xd8d0('0x2a')](function(_0x4a1523){return _0x4a1523;});}return null;};}function removeEntity(_0x598652,_0x4e58ed){return function(_0x5dcbed){if(_0x5dcbed){return _0x5dcbed[_0xd8d0('0x2b')]()[_0xd8d0('0x2a')](function(){_0x598652[_0xd8d0('0x20')](0xcc)[_0xd8d0('0x2c')]();});}};}function handleEntityNotFound(_0xc9c277,_0x5987d7){return function(_0x22c47b){if(!_0x22c47b){_0xc9c277[_0xd8d0('0x2d')](0x194);}return _0x22c47b;};}function handleError(_0x506d54,_0x413b8f){_0x413b8f=_0x413b8f||0x1f4;return function(_0x80d81f){logger[_0xd8d0('0x2e')](_0x80d81f['stack']);if(_0x80d81f[_0xd8d0('0x2f')]){delete _0x80d81f[_0xd8d0('0x2f')];}_0x506d54[_0xd8d0('0x20')](_0x413b8f)[_0xd8d0('0x30')](_0x80d81f);};}exports[_0xd8d0('0x31')]=function(_0x57ed8e,_0x3ce804){var _0x27d9a4={},_0x34dafa={},_0x14f9a8={'count':0x0,'rows':[]};var _0x1d9a0d=_[_0xd8d0('0x32')](db[_0xd8d0('0x33')][_0xd8d0('0x34')],function(_0x270f68){return{'name':_0x270f68[_0xd8d0('0x35')],'type':_0x270f68[_0xd8d0('0x36')]['key']};});_0x34dafa[_0xd8d0('0x37')]=_[_0xd8d0('0x32')](_0x1d9a0d,_0xd8d0('0x2f'));_0x34dafa[_0xd8d0('0x38')]=_[_0xd8d0('0x39')](_0x57ed8e['query']);_0x34dafa[_0xd8d0('0x3a')]=_[_0xd8d0('0x3b')](_0x34dafa[_0xd8d0('0x37')],_0x34dafa[_0xd8d0('0x38')]);_0x27d9a4[_0xd8d0('0x3c')]=_[_0xd8d0('0x3b')](_0x34dafa['model'],qs['fields'](_0x57ed8e[_0xd8d0('0x38')][_0xd8d0('0x3d')]));_0x27d9a4['attributes']=_0x27d9a4[_0xd8d0('0x3c')][_0xd8d0('0x3e')]?_0x27d9a4[_0xd8d0('0x3c')]:_0x34dafa['model'];if(!_0x57ed8e[_0xd8d0('0x38')][_0xd8d0('0x3f')](_0xd8d0('0x40'))){_0x27d9a4[_0xd8d0('0x23')]=qs[_0xd8d0('0x23')](_0x57ed8e[_0xd8d0('0x38')][_0xd8d0('0x23')]);_0x27d9a4['offset']=qs[_0xd8d0('0x21')](_0x57ed8e[_0xd8d0('0x38')][_0xd8d0('0x21')]);}_0x27d9a4[_0xd8d0('0x41')]=qs[_0xd8d0('0x42')](_0x57ed8e['query'][_0xd8d0('0x42')]);_0x27d9a4[_0xd8d0('0x43')]=qs[_0xd8d0('0x3a')](_[_0xd8d0('0x44')](_0x57ed8e[_0xd8d0('0x38')],_0x34dafa[_0xd8d0('0x3a')]),_0x1d9a0d);if(_0x57ed8e['query'][_0xd8d0('0x45')]){_0x27d9a4[_0xd8d0('0x43')]=_[_0xd8d0('0x46')](_0x27d9a4[_0xd8d0('0x43')],{'$or':_[_0xd8d0('0x32')](_0x1d9a0d,function(_0x464cbc){if(_0x464cbc[_0xd8d0('0x36')]!==_0xd8d0('0x47')){var _0x58e746={};_0x58e746[_0x464cbc[_0xd8d0('0x2f')]]={'$like':'%'+_0x57ed8e[_0xd8d0('0x38')][_0xd8d0('0x45')]+'%'};return _0x58e746;}})});}_0x27d9a4=_[_0xd8d0('0x46')]({},_0x27d9a4,_0x57ed8e[_0xd8d0('0x48')]);var _0x1983ad={'where':_0x27d9a4[_0xd8d0('0x43')]};return db[_0xd8d0('0x33')][_0xd8d0('0x24')](_0x1983ad)[_0xd8d0('0x2a')](function(_0x4c1e0b){_0x14f9a8[_0xd8d0('0x24')]=_0x4c1e0b;if(_0x57ed8e[_0xd8d0('0x38')][_0xd8d0('0x49')]){_0x27d9a4['include']=[{'all':!![]}];}return db[_0xd8d0('0x33')][_0xd8d0('0x4a')](_0x27d9a4);})[_0xd8d0('0x2a')](function(_0x359819){_0x14f9a8['rows']=_0x359819;return _0x14f9a8;})[_0xd8d0('0x2a')](respondWithFilteredResult(_0x3ce804,_0x27d9a4))[_0xd8d0('0x4b')](handleError(_0x3ce804,null));};exports[_0xd8d0('0x4c')]=function(_0x32a011,_0x3602e7){var _0x15f911={'raw':![],'where':{'id':_0x32a011[_0xd8d0('0x4d')]['id']}},_0x42c2da={};_0x42c2da[_0xd8d0('0x37')]=_[_0xd8d0('0x39')](db[_0xd8d0('0x33')][_0xd8d0('0x34')]);_0x42c2da[_0xd8d0('0x38')]=_[_0xd8d0('0x39')](_0x32a011[_0xd8d0('0x38')]);_0x42c2da[_0xd8d0('0x3a')]=_[_0xd8d0('0x3b')](_0x42c2da[_0xd8d0('0x37')],_0x42c2da['query']);_0x15f911[_0xd8d0('0x3c')]=_['intersection'](_0x42c2da[_0xd8d0('0x37')],qs[_0xd8d0('0x3d')](_0x32a011[_0xd8d0('0x38')]['fields']));_0x15f911[_0xd8d0('0x3c')]=_0x15f911['attributes'][_0xd8d0('0x3e')]?_0x15f911['attributes']:_0x42c2da[_0xd8d0('0x37')];if(_0x32a011['query'][_0xd8d0('0x49')]){_0x15f911['include']=[{'all':!![]}];}_0x15f911=_['merge']({},_0x15f911,_0x32a011[_0xd8d0('0x48')]);return db[_0xd8d0('0x33')][_0xd8d0('0x4e')](_0x15f911)[_0xd8d0('0x2a')](handleEntityNotFound(_0x3602e7,null))['then'](respondWithResult(_0x3602e7,null))[_0xd8d0('0x4b')](handleError(_0x3602e7,null));};exports[_0xd8d0('0x4f')]=function(_0x15b4d1,_0x48cce0){return db[_0xd8d0('0x33')][_0xd8d0('0x4f')](_0x15b4d1['body'],{})['then'](respondWithResult(_0x48cce0,0xc9))[_0xd8d0('0x4b')](handleError(_0x48cce0,null));};exports[_0xd8d0('0x50')]=function(_0x2ec259,_0x49b061){var _0x465b5e={'where':{'id':_0x2ec259[_0xd8d0('0x4d')]['id']}},_0x4c5f3a={};_0x4c5f3a[_0xd8d0('0x37')]=_['keys'](db['UserProfile']['rawAttributes']);_0x465b5e[_0xd8d0('0x3c')]=_[_0xd8d0('0x3b')](_0x4c5f3a[_0xd8d0('0x37')],qs[_0xd8d0('0x3d')](_0x2ec259[_0xd8d0('0x38')]['fields']));_0x465b5e['attributes']=_0x465b5e[_0xd8d0('0x3c')][_0xd8d0('0x3e')]?_0x465b5e['attributes']:_0x4c5f3a[_0xd8d0('0x37')];if(_0x2ec259[_0xd8d0('0x38')][_0xd8d0('0x49')]){_0x465b5e[_0xd8d0('0x51')]=[{'all':!![]}];}_0x465b5e=_['merge']({},_0x465b5e,_0x2ec259[_0xd8d0('0x48')]);return db['UserProfile'][_0xd8d0('0x4e')](_0x465b5e)[_0xd8d0('0x2a')](handleEntityNotFound(_0x49b061,null))[_0xd8d0('0x2a')](function(_0x1af7d1){if(_0x1af7d1){var _0x311bee=_0x1af7d1[_0xd8d0('0x52')]({'plain':!![]});_0x311bee=qs['omit'](_0x311bee,['id',_0xd8d0('0x53'),_0xd8d0('0x54'),_0xd8d0('0x55')]);_0x2ec259[_0xd8d0('0x56')]=_['omit'](_0x2ec259[_0xd8d0('0x56')],['id',_0xd8d0('0x53'),_0xd8d0('0x54')]);return db[_0xd8d0('0x57')]['transaction'](function(_0x92f023){return db['UserProfile']['create'](_[_0xd8d0('0x46')](_0x311bee,_0x2ec259[_0xd8d0('0x56')]),{'include':_0x2ec259['query'][_0xd8d0('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x92f023})[_0xd8d0('0x2a')](function(_0x362819){var _0x256815=_0x362819[_0xd8d0('0x52')]({'plain':!![]});return db[_0xd8d0('0x58')]['findAll']({'where':{'userProfileId':_0x2ec259['params']['id']},'raw':!![]})[_0xd8d0('0x2a')](function(_0x1884ed){if(_0x1884ed){return BPromise['each'](_0x1884ed,function(_0x4e7a61){return new BPromise(function(_0x44db3d,_0x3da3b4){if(_0x4e7a61[_0xd8d0('0x59')]===null||_0x4e7a61[_0xd8d0('0x59')]===0x1)_0x44db3d(null);return db['UserProfileResource'][_0xd8d0('0x4a')]({'where':{'sectionId':_0x4e7a61['id']},'raw':!![]})['then'](function(_0xe1c30d){var _0x2c1cbc=_[_0xd8d0('0x32')](_0xe1c30d,function(_0x188134){return qs[_0xd8d0('0x5a')](_0x188134,['id','createdAt','updatedAt',_0xd8d0('0x5b')]);});_0x44db3d(_0x2c1cbc);})[_0xd8d0('0x4b')](function(_0x26f7a9){_0x3da3b4(_0x26f7a9);});})['then'](function(_0x4c3e5e){var _0x18ab8f=qs['omit'](_0x4e7a61,['id','createdAt',_0xd8d0('0x54')]);_0x18ab8f[_0xd8d0('0x5c')]=_0x256815['id'];if(_0x4c3e5e)_0x18ab8f['Resources']=_0x4c3e5e;return _0x18ab8f;})['then'](function(_0x3b937a){return db['UserProfileSection']['create'](_0x3b937a,{'include':[{'model':db[_0xd8d0('0x5d')],'as':_0xd8d0('0x5e')}],'raw':!![],'transaction':_0x92f023});});})[_0xd8d0('0x2a')](function(){return _0x256815;});}});});});}})['then'](respondWithResult(_0x49b061,0xc9))[_0xd8d0('0x4b')](handleError(_0x49b061,null));};exports[_0xd8d0('0x29')]=function(_0x2c8692,_0x5d146a){if(_0x2c8692['body']['id']){delete _0x2c8692[_0xd8d0('0x56')]['id'];}return db['UserProfile'][_0xd8d0('0x4e')]({'where':{'id':_0x2c8692['params']['id']}})['then'](handleEntityNotFound(_0x5d146a,null))['then'](saveUpdates(_0x2c8692[_0xd8d0('0x56')],null))['then'](respondWithResult(_0x5d146a,null))[_0xd8d0('0x4b')](handleError(_0x5d146a,null));};exports[_0xd8d0('0x2b')]=function(_0x5c9de4,_0x5bd041){return db[_0xd8d0('0x33')][_0xd8d0('0x4e')]({'where':{'id':_0x5c9de4['params']['id']}})[_0xd8d0('0x2a')](handleEntityNotFound(_0x5bd041,null))[_0xd8d0('0x2a')](removeEntity(_0x5bd041,null))[_0xd8d0('0x4b')](handleError(_0x5bd041,null));};exports['describe']=function(_0x34cdbb,_0x4b66d9){return db[_0xd8d0('0x33')][_0xd8d0('0x5f')]()[_0xd8d0('0x2a')](respondWithResult(_0x4b66d9,null))[_0xd8d0('0x4b')](handleError(_0x4b66d9,null));};exports[_0xd8d0('0x60')]=function(_0xfe2c9f,_0x39c821){var _0xf11469=_0xfe2c9f[_0xd8d0('0x56')];return db[_0xd8d0('0x33')][_0xd8d0('0x4e')]({'where':{'id':_0xfe2c9f['params']['id']}})['then'](handleEntityNotFound(_0x39c821,null))[_0xd8d0('0x2a')](function(_0x1ed444){if(_0x1ed444){return db[_0xd8d0('0x57')][_0xd8d0('0x61')](function(_0x33e600){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0xfe2c9f[_0xd8d0('0x4d')]['id'],'sectionId':_[_0xd8d0('0x32')](_0xf11469,function(_0x433f4b){return _0x433f4b[_0xd8d0('0x5b')];})},'transaction':_0x33e600})[_0xd8d0('0x2a')](function(){var _0x37bb4b=_['map'](_0xf11469,function(_0xe3fbfd){_0xe3fbfd[_0xd8d0('0x5c')]=_0xfe2c9f['params']['id'];return _0xe3fbfd;});var _0x5dcbe5=[];return BPromise[_0xd8d0('0x62')](_0x37bb4b,function(_0x30fffd){return db['UserProfileSection']['create'](_0x30fffd,{'include':[{'model':db[_0xd8d0('0x5d')],'as':'Resources'}],'raw':!![],'transaction':_0x33e600})['then'](function(_0x4d791f){_0x5dcbe5[_0xd8d0('0x63')](_0x4d791f[_0xd8d0('0x52')]({'plain':!![]}));});})[_0xd8d0('0x2a')](function(){return _0x5dcbe5;});});});}})[_0xd8d0('0x2a')](function(_0x21786d){return _0x21786d;})['then'](respondWithResult(_0x39c821,null))['catch'](handleError(_0x39c821,null));};exports[_0xd8d0('0x64')]=function(_0x44d301,_0x18a368){var _0x504faf;return db[_0xd8d0('0x33')][_0xd8d0('0x4e')]({'where':{'id':_0x44d301[_0xd8d0('0x4d')]['id']},'attributes':['id',_0xd8d0('0x2f')]})[_0xd8d0('0x2a')](handleEntityNotFound(_0x18a368,null))[_0xd8d0('0x2a')](function(_0x5dab6b){if(_0x5dab6b){_0x504faf=_0x5dab6b;return db['UserProfileSection'][_0xd8d0('0x2b')]({'where':{'userProfileId':_0x44d301[_0xd8d0('0x4d')]['id'],'sectionId':_0x44d301['query']['ids']}});}})[_0xd8d0('0x2a')](function(){return _0x504faf;})[_0xd8d0('0x2a')](respondWithStatusCode(_0x18a368,null))['catch'](handleError(_0x18a368,null));};exports[_0xd8d0('0x65')]=function(_0x499336,_0x3a6e6f){var _0x3a862f=[];var _0x26af3c=[];return db[_0xd8d0('0x58')]['findAll']({'where':{'userProfileId':_0x499336[_0xd8d0('0x4d')]['id']},'raw':!![]})[_0xd8d0('0x2a')](function(_0x1cbdb8){_0x3a862f=_[_0xd8d0('0x45')](_0x1cbdb8,function(_0x347f03){return _0x347f03[_0xd8d0('0x66')]===0x1||_[_0xd8d0('0x67')]([0x3eb,0x709],_0x347f03[_0xd8d0('0x5b')]);});if(!_['isEmpty'](_0x3a862f)){return _[_0xd8d0('0x32')](_0x3a862f,function(_0x6f9280){return _0x6f9280[_0xd8d0('0x5b')];});}else{return;}})[_0xd8d0('0x2a')](function(_0xd152a2){if(_0xd152a2)_0x26af3c=_0xd152a2;if(_[_0xd8d0('0x67')](_0x26af3c,0x64)){var _0x50fd2f=_[_0xd8d0('0x4e')](_0x3a862f,{'sectionId':0x64});return hasDefaultDashboard(_0x50fd2f)[_0xd8d0('0x2a')](function(_0x192be8){return _[_0xd8d0('0x32')](_0x3a862f,function(_0x59861a){if(_0x59861a['sectionId']===0x64){_0x59861a[_0xd8d0('0x68')]=_0x192be8;}return _0x59861a;});});}else{return;}})[_0xd8d0('0x2a')](function(_0x2e510e){if(_0x2e510e)_0x3a862f=_0x2e510e;if(_[_0xd8d0('0x67')](_0x26af3c,0x3eb)){var _0x3210d3=_[_0xd8d0('0x4e')](_0x3a862f,{'sectionId':0x3eb});return getCustomDashboards(_0x3210d3)['then'](function(_0xa68e12){return _[_0xd8d0('0x32')](_0x3a862f,function(_0xfedc0b){if(_0x3210d3['enabled']){if(_0xfedc0b['sectionId']===0x3eb){_0xfedc0b[_0xd8d0('0x68')]=_0xa68e12;}}else{if(_0xfedc0b[_0xd8d0('0x5b')]===0x64){if(!_0xfedc0b[_0xd8d0('0x68')]){_0xfedc0b[_0xd8d0('0x68')]=[];}_0xfedc0b[_0xd8d0('0x68')]=_0xfedc0b['subsections'][_0xd8d0('0x69')](_0xa68e12);}}return _0xfedc0b;});});}else{return;}})['then'](function(_0x4c4e88){if(_0x4c4e88)_0x3a862f=_0x4c4e88;if(_[_0xd8d0('0x67')](_0x26af3c,0x709)){var _0x446306=_[_0xd8d0('0x4e')](_0x3a862f,{'sectionId':0x709});return getPlugins(_0x446306)[_0xd8d0('0x2a')](function(_0x1773a0){if(_0x446306[_0xd8d0('0x66')]){return _[_0xd8d0('0x32')](_0x3a862f,function(_0x91f8f8){if(_0x91f8f8[_0xd8d0('0x5b')]===0x709){_0x91f8f8[_0xd8d0('0x68')]=_0x1773a0;}return _0x91f8f8;});}else{var _0x125c3c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1773a0};var _0x7d918c=_[_0xd8d0('0x32')](_0x3a862f);_0x7d918c[_0xd8d0('0x63')](_0x125c3c);return _0x7d918c;}});}else{return;}})[_0xd8d0('0x2a')](function(_0x586476){if(_0x586476)_0x3a862f=_0x586476;return _['filter'](_0x3a862f,[_0xd8d0('0x66'),0x1]);})[_0xd8d0('0x2a')](respondWithResult(_0x3a6e6f,null))[_0xd8d0('0x4b')](handleError(_0x3a6e6f,null));};function hasDefaultDashboard(_0x3d9a61){var _0x3f3aa4=[0x65];return new BPromise(function(_0x538039,_0x231d1c){try{if(_0x3d9a61[_0xd8d0('0x59')]){_0x538039(_0x3f3aa4);}else{return db[_0xd8d0('0x5d')]['findOne']({'where':{'sectionId':_0x3d9a61['id']},'raw':!![]})[_0xd8d0('0x2a')](function(_0x5be554){_0x5be554?_0x538039(_0x3f3aa4):_0x538039();});}}catch(_0x4716ff){_0x231d1c(_0x4716ff);}});}function getCustomDashboards(_0x558eef){var _0x5c29eb=[];return new BPromise(function(_0x982a6,_0x9050f2){try{if(_0x558eef[_0xd8d0('0x59')]){return db[_0xd8d0('0x6a')][_0xd8d0('0x4a')]({'raw':!![]})[_0xd8d0('0x2a')](function(_0x34dea5){_0x34dea5[_0xd8d0('0x6b')](function(_0x2e3896){_0x5c29eb[_0xd8d0('0x63')](_0x2e3896['id']+0x1869f);});_0x982a6(_0x5c29eb);});}else{return db[_0xd8d0('0x5d')][_0xd8d0('0x4a')]({'where':{'sectionId':_0x558eef['id']},'raw':!![]})['then'](function(_0x306c05){_0x306c05[_0xd8d0('0x6b')](function(_0x7f67df){_0x5c29eb['push'](_0x7f67df[_0xd8d0('0x6c')]+0x1869f);});_0x982a6(_0x5c29eb);});}}catch(_0x4e38fc){_0x9050f2(_0x4e38fc);}});}function getPlugins(_0x4f74f3){var _0x11bd38=[];return new BPromise(function(_0x37bfb1,_0x27b1da){try{if(_0x4f74f3[_0xd8d0('0x59')]){return db[_0xd8d0('0x6d')][_0xd8d0('0x4a')]({'raw':!![]})[_0xd8d0('0x2a')](function(_0x4a72bb){_0x4a72bb[_0xd8d0('0x6b')](function(_0x53d6a7){_0x11bd38[_0xd8d0('0x63')](_0x53d6a7['id']+0x15b38);});_0x37bfb1(_0x11bd38);});}else{return db[_0xd8d0('0x5d')][_0xd8d0('0x4a')]({'where':{'sectionId':_0x4f74f3['id']},'raw':!![]})[_0xd8d0('0x2a')](function(_0x3d08cf){_0x3d08cf[_0xd8d0('0x6b')](function(_0x72edf8){_0x11bd38[_0xd8d0('0x63')](_0x72edf8[_0xd8d0('0x6c')]+0x15b38);});_0x37bfb1(_0x11bd38);});}}catch(_0x27ba5){_0x27b1da(_0x27ba5);}});}exports[_0xd8d0('0x6e')]=function(_0x3be490,_0x20dfd7){return db[_0xd8d0('0x33')][_0xd8d0('0x4e')]({'where':{'id':_0x3be490['params']['id']}})[_0xd8d0('0x2a')](handleEntityNotFound(_0x20dfd7,null))[_0xd8d0('0x2a')](function(_0x2de811){if(_0x2de811){return db[_0xd8d0('0x57')][_0xd8d0('0x61')](function(_0x1c3201){return db[_0xd8d0('0x58')]['findAll']({'where':{'userProfileId':_0x3be490[_0xd8d0('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0xd8d0('0x2a')](function(_0x401280){if(_0x401280){return db[_0xd8d0('0x58')][_0xd8d0('0x2b')]({'where':{'userProfileId':_0x3be490[_0xd8d0('0x4d')]['id'],'id':_[_0xd8d0('0x32')](_0x401280,function(_0x4bce00){return _0x4bce00['id'];})},'transaction':_0x1c3201});}})[_0xd8d0('0x2a')](function(_0x4b3041){var _0x3b753d=_[_0xd8d0('0x32')](_0x3be490[_0xd8d0('0x56')],function(_0x17ad24){_0x17ad24[_0xd8d0('0x5c')]=_0x3be490['params']['id'];return _0x17ad24;});return db[_0xd8d0('0x58')][_0xd8d0('0x6f')](_0x3b753d,{'raw':!![],'transaction':_0x1c3201});})['then'](function(_0x234855){var _0x511e13=_[_0xd8d0('0x45')](_[_0xd8d0('0x32')](_0x234855,function(_0x42bcb3){return _0x42bcb3[_0xd8d0('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x511e13){return db[_0xd8d0('0x58')]['findAll']({'where':{'userProfileId':_0x3be490[_0xd8d0('0x4d')]['id'],'sectionId':_[_0xd8d0('0x32')](_0x511e13,function(_0x1efa9b){return _0x1efa9b[_0xd8d0('0x5b')];})},'attributes':['id',_0xd8d0('0x5b')],'raw':!![]})[_0xd8d0('0x2a')](function(_0xd7c54a){var _0x544733=_['map'](_0x3be490['body'],function(_0x4c389b){_0x4c389b[_0xd8d0('0x5c')]=_0x3be490[_0xd8d0('0x4d')]['id'];return _0x4c389b;});return db[_0xd8d0('0x5d')]['bulkCreate'](_0x544733,{'raw':!![],'transaction':_0x1c3201});});}})[_0xd8d0('0x4b')](handleError(_0x20dfd7,null));});}})[_0xd8d0('0x2a')](function(_0xd33841){var _0x4c7c45=_[_0xd8d0('0x32')](_0xd33841,function(_0x282cb6){return _0x282cb6[_0xd8d0('0x52')]({'plain':!![]});});})[_0xd8d0('0x2a')](respondWithResult(_0x20dfd7,null))[_0xd8d0('0x4b')](handleError(_0x20dfd7,null));};exports[_0xd8d0('0x70')]=function(_0x5690c4,_0x4eccd4,_0x39944a){return db[_0xd8d0('0x33')][_0xd8d0('0x4e')]({'where':{'id':_0x5690c4[_0xd8d0('0x4d')]['id']}})[_0xd8d0('0x2a')](handleEntityNotFound(_0x4eccd4,null))[_0xd8d0('0x2a')](function(_0xe684ec){if(_0xe684ec){return _0xe684ec[_0xd8d0('0x70')](_0x5690c4[_0xd8d0('0x38')]['ids']);}})[_0xd8d0('0x2a')](respondWithStatusCode(_0x4eccd4,null))['catch'](handleError(_0x4eccd4,null));};exports[_0xd8d0('0x71')]=function(_0x47d584,_0x548dac){var _0x4a1001={};if(!_0x47d584[_0xd8d0('0x38')]['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x47d584[_0xd8d0('0x38')][_0xd8d0('0x3f')](_0xd8d0('0x40'))){_0x4a1001['limit']=qs[_0xd8d0('0x23')](_0x47d584[_0xd8d0('0x38')][_0xd8d0('0x23')]);_0x4a1001[_0xd8d0('0x21')]=qs[_0xd8d0('0x21')](_0x47d584[_0xd8d0('0x38')][_0xd8d0('0x21')]);}return db[_0xd8d0('0x33')][_0xd8d0('0x4e')]({'where':{'id':_0x47d584['params']['id']}})[_0xd8d0('0x2a')](function(_0x5c9138){if(!_0x5c9138)throw new Error(_0xd8d0('0x72')+_0x47d584['params']['id']);return db[_0xd8d0('0x33')][_0xd8d0('0x71')](_0x47d584);})['then'](respondWithFilteredResult(_0x548dac,_0x4a1001))[_0xd8d0('0x4b')](handleError(_0x548dac,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 06caeb5..77ba138 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 _0x8f9d=['hasOwnProperty','hook','exports','events','UserProfile','save','update','remove','emit'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0x8f9d,0x93));var _0xd8f9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8f9d[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0xd8f9('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xd8f9('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd8f9('0x2'),'afterUpdate':_0xd8f9('0x3'),'afterDestroy':_0xd8f9('0x4')};function emitEvent(_0x354c26){return function(_0x1f9331,_0x1b82b8,_0x1d6420){UserProfileEvents['emit'](_0x354c26+':'+_0x1f9331['id'],_0x1f9331);UserProfileEvents[_0xd8f9('0x5')](_0x354c26,_0x1f9331);_0x1d6420(null);};}for(var e in events){if(events[_0xd8f9('0x6')](e)){var event=events[e];UserProfile[_0xd8f9('0x7')](e,emitEvent(event));}}module[_0xd8f9('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x82d8=['hasOwnProperty','hook','exports','events','UserProfile','update','emit'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x82d8,0xff));var _0x882d=function(_0x52834c,_0x19526d){_0x52834c=_0x52834c-0x0;var _0x4b380c=_0x82d8[_0x52834c];return _0x4b380c;};'use strict';var EventEmitter=require(_0x882d('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x882d('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x882d('0x2'),'afterDestroy':'remove'};function emitEvent(_0xd91d36){return function(_0x5d3b3f,_0x5d0953,_0x25747e){UserProfileEvents[_0x882d('0x3')](_0xd91d36+':'+_0x5d3b3f['id'],_0x5d3b3f);UserProfileEvents[_0x882d('0x3')](_0xd91d36,_0x5d3b3f);_0x25747e(null);};}for(var e in events){if(events[_0x882d('0x4')](e)){var event=events[e];UserProfile[_0x882d('0x5')](e,emitEvent(event));}}module[_0x882d('0x6')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 3fae916..9ae12ae 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 _0xbb21=['Variable','plugins','Plugin','extractedreports','Reports','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','from','_interactions','where','ui.UserId\x20=\x20?','query','OpenTabs','UserProfile','user_profiles','../../components/parsers/qs','raw','section','isEmpty','length','push','find','params','all','ignore','union','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','reportType','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','count','includeAll','include','Tags','color','ThroughTags','tag','openTabs','true','chat','dataValues','fax','mail','whatsapp','lodash','./userProfile.attributes','squel','exports','filter','field','value','findAll','then','associatedResources','map','model','name','AnalyticExtractedReport','resourceId','catch','toLowerCase','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','CmContact','parentSections','Lists','ListId','lists','CmList','CmCompany','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicerecordings','VoiceRecording','Agents','membername','User','agent','role','telephone','VoiceQueues','queue','VoiceQueue','type','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','teams','voicequeues','queuecampaigns','users','telephones','Users','admin','user','Telephones','zendeskaccounts','ZendeskAccount','freshdeskaccounts','sugarcrmaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xbb21,0x1cb));var _0x1bb2=function(_0x279f58,_0xb27c39){_0x279f58=_0x279f58-0x0;var _0x4eb37c=_0xbb21[_0x279f58];return _0x4eb37c;};'use strict';var _=require(_0x1bb2('0x0'));var attributes=require(_0x1bb2('0x1'));var squel=require(_0x1bb2('0x2'));module[_0x1bb2('0x3')]=function(_0x1dfeec){var _0x270be3=_0x1dfeec['models'];function _0x46a416(_0x587a24,_0xd49714){return new Promise(function(_0x5ec34a,_0x102b20){if(!_0xd49714)return _0x5ec34a(null);var _0x4f18ae=_0xd49714[_0x1bb2('0x4')]?{[_0xd49714[_0x1bb2('0x4')][_0x1bb2('0x5')]]:_0xd49714[_0x1bb2('0x4')][_0x1bb2('0x6')]}:undefined;return _0x270be3[_0x587a24][_0x1bb2('0x7')]({'where':_0x4f18ae,'raw':!![]})[_0x1bb2('0x8')](function(_0x456186){_0xd49714[_0x1bb2('0x9')]=_[_0x1bb2('0xa')](_0x456186,'id');_0x5ec34a(_0xd49714);})['catch'](function(_0x4ebcb6){_0x102b20(_0x4ebcb6);});});}function _0x39f19a(_0x11aacb,_0x40b4a9){return new Promise(function(_0x33cae5,_0x255ef2){var _0x1438a2=_0x11aacb[_0x1bb2('0x4')]?{[_0x11aacb[_0x1bb2('0x4')]['field']]:_0x11aacb[_0x1bb2('0x4')][_0x1bb2('0x6')]}:undefined;return _0x270be3[_0x11aacb[_0x1bb2('0xb')]][_0x1bb2('0x7')]({'where':_0x1438a2,'raw':!![]})[_0x1bb2('0x8')](function(_0x42d0c6){_0x40b4a9[_0x1bb2('0x9')]=_[_0x1bb2('0xa')](_0x42d0c6,function(_0x56dd4b){return _0x56dd4b[_0x1bb2('0xc')];});_0x33cae5(_0x40b4a9);})['catch'](function(_0x288af9){_0x255ef2(_0x288af9);});});}function _0x51b0f9(_0x185ee8,_0x290cfc,_0x254bf4){if(!_0x290cfc)return Promise['resolve'](null);return new Promise(function(_0x550bb9,_0x512640){return _0x270be3['UserProfileResource'][_0x1bb2('0x7')]({'where':{'sectionId':_0x290cfc['id']},'raw':!![]})[_0x1bb2('0x8')](function(_0x55019e){if(_0x185ee8[_0x1bb2('0x5')]&&_0x185ee8['field']!=='id'){_0x290cfc[_0x1bb2('0x9')]=_['map'](_0x55019e,function(_0x46c9b8){return _0x46c9b8[_0x185ee8[_0x1bb2('0x5')]];});}else{if(_0x254bf4===_0x1bb2('0xd')){_0x290cfc[_0x1bb2('0x9')]=_[_0x1bb2('0xa')](_0x55019e,function(_0xeecab2){return{'id':_0xeecab2[_0x1bb2('0xe')],'type':_0xeecab2['type']};});}else{_0x290cfc[_0x1bb2('0x9')]=_[_0x1bb2('0xa')](_0x55019e,function(_0x414e64){return _0x414e64[_0x1bb2('0xe')];});}}_0x550bb9(_0x290cfc);})[_0x1bb2('0xf')](function(_0x2bbfc9){_0x512640(_0x2bbfc9);});});}function _0x55e41f(_0x328600,_0x191b6c){var _0x191b6a={'parentSections':[]};switch(_0x328600[_0x1bb2('0x10')]()){case'squareprojects':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x12');break;case'odbc':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x13');break;case _0x1bb2('0x14'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x15');_0x191b6a['parentSections']=[{'name':_0x1bb2('0x16'),'field':_0x1bb2('0xc'),'foreignKey':_0x1bb2('0x17')}];break;case _0x1bb2('0x18'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x19');break;case'contacts':_0x191b6a['childModel']=_0x1bb2('0x1a');_0x191b6a[_0x1bb2('0x1b')]=[{'name':_0x1bb2('0x1c'),'field':'id','foreignKey':_0x1bb2('0x1d')}];break;case _0x1bb2('0x1e'):_0x191b6a['childModel']=_0x1bb2('0x1f');break;case'companies':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x20');break;case'globalcustomfields':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x21');break;case _0x1bb2('0x22'):_0x191b6a['childModel']='ChatQueue';break;case _0x1bb2('0x23'):_0x191b6a['childModel']=_0x1bb2('0x24');break;case _0x1bb2('0x25'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x26');break;case _0x1bb2('0x27'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x28');break;case _0x1bb2('0x29'):case _0x1bb2('0x2a'):case _0x1bb2('0x2b'):_0x191b6a['childModel']=_0x1bb2('0x2c');break;case _0x1bb2('0x2d'):_0x191b6a['childModel']=_0x1bb2('0x2e');break;case'voicemails':_0x191b6a[_0x1bb2('0x11')]='VoiceMail';break;case _0x1bb2('0x2f'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x30');_0x191b6a['parentSections']=[{'name':_0x1bb2('0x31'),'field':_0x1bb2('0xc'),'foreignKey':_0x1bb2('0x32'),'model':_0x1bb2('0x33'),'filter':{'field':'role','value':[_0x1bb2('0x34')]}},{'name':'Telephones','field':'name','foreignKey':_0x1bb2('0x32'),'model':_0x1bb2('0x33'),'filter':{'field':_0x1bb2('0x35'),'value':[_0x1bb2('0x36')]}},{'name':_0x1bb2('0x37'),'field':_0x1bb2('0xc'),'foreignKey':_0x1bb2('0x38'),'model':_0x1bb2('0x39'),'filter':{'field':_0x1bb2('0x3a'),'value':['inbound']}},{'name':_0x1bb2('0x3b'),'field':_0x1bb2('0xc'),'foreignKey':_0x1bb2('0x38'),'model':_0x1bb2('0x39'),'filter':{'field':_0x1bb2('0x3a'),'value':[_0x1bb2('0x3c')]}}];break;case'musiconholds':_0x191b6a['childModel']=_0x1bb2('0x3d');break;case _0x1bb2('0x3e'):_0x191b6a['childModel']=_0x1bb2('0x3f');break;case'voiceprefixes':_0x191b6a['childModel']='VoicePrefix';break;case _0x1bb2('0x40'):_0x191b6a['childModel']=_0x1bb2('0x41');break;case _0x1bb2('0x42'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x43');break;case _0x1bb2('0x44'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x45');break;case _0x1bb2('0x46'):_0x191b6a[_0x1bb2('0x11')]='MailSubstatus';break;case _0x1bb2('0x47'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x48');break;case _0x1bb2('0x49'):_0x191b6a['childModel']='OpenchannelAccount';break;case'smsqueues':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x4a');break;case _0x1bb2('0x4b'):_0x191b6a['childModel']=_0x1bb2('0x4c');break;case _0x1bb2('0x4d'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x4e');break;case'whatsappaccounts':_0x191b6a[_0x1bb2('0x11')]='WhatsappAccount';break;case _0x1bb2('0x4f'):_0x191b6a[_0x1bb2('0x11')]='Team';break;case _0x1bb2('0x50'):case _0x1bb2('0x51'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x39');if(_0x191b6c){_0x191b6a[_0x1bb2('0x1b')]=[{'name':_0x1bb2('0x37')},{'name':_0x1bb2('0x3b')}];}break;case _0x1bb2('0x52'):case'agents':case _0x1bb2('0x53'):_0x191b6a[_0x1bb2('0x11')]='User';if(_0x191b6c){_0x191b6a[_0x1bb2('0x1b')]=[{'name':_0x1bb2('0x54'),'filter':{'field':_0x1bb2('0x35'),'value':[_0x1bb2('0x55'),_0x1bb2('0x56')]},'ignore':!![]},{'name':'Agents'},{'name':_0x1bb2('0x57')}];}break;case _0x1bb2('0x58'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x59');break;case'salesforceaccounts':_0x191b6a[_0x1bb2('0x11')]='SalesforceAccount';break;case _0x1bb2('0x5a'):_0x191b6a[_0x1bb2('0x11')]='FreshdeskAccount';break;case _0x1bb2('0x5b'):_0x191b6a[_0x1bb2('0x11')]='SugarcrmAccount';break;case'deskaccounts':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x5c');break;case _0x1bb2('0x5d'):_0x191b6a[_0x1bb2('0x11')]='ZohoAccount';break;case _0x1bb2('0x5e'):_0x191b6a['childModel']=_0x1bb2('0x33');break;case _0x1bb2('0x5f'):_0x191b6a['childModel']=_0x1bb2('0x60');break;case _0x1bb2('0x61'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x62');break;case _0x1bb2('0x63'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x64');break;case _0x1bb2('0x65'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x66');break;case _0x1bb2('0x67'):_0x191b6a['childModel']='Pause';break;case _0x1bb2('0x68'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x69');break;case _0x1bb2('0x6a'):_0x191b6a['childModel']=_0x1bb2('0x6b');break;case _0x1bb2('0x6c'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x6d');break;case _0x1bb2('0x6e'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x6f');break;case _0x1bb2('0x70'):_0x191b6a['childModel']=_0x1bb2('0x71');break;case _0x1bb2('0x72'):_0x191b6a['childModel']=_0x1bb2('0x73');break;case _0x1bb2('0x74'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x75');break;case _0x1bb2('0x76'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x77');break;case _0x1bb2('0x78'):_0x191b6a['childModel']='AnalyticExtractedReport';_0x191b6a['parentSections']=[{'name':_0x1bb2('0x79'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x7a');break;}return _0x191b6a;}function _0x4c6afd(_0x4d073b,_0x3ebbfc){var _0x9cf70c=_0x4d073b['charAt'](0x0)[_0x1bb2('0x7b')]()+_0x4d073b[_0x1bb2('0x7c')](0x1);var _0x29ea18={'type':_0x270be3[_0x1bb2('0x7d')][_0x1bb2('0x7e')][_0x1bb2('0x7f')],'raw':!![]};return new Promise(function(_0x1e500e,_0x1c96f1){var _0x332dc4=squel[_0x1bb2('0x80')]()[_0x1bb2('0x5')](_0x1bb2('0x81')+_0x9cf70c+_0x1bb2('0x82'),'id')[_0x1bb2('0x5')]('ui.createdAt')[_0x1bb2('0x83')]('user_has_'+_0x4d073b+_0x1bb2('0x84'),'ui')[_0x1bb2('0x85')](_0x1bb2('0x86'),_0x3ebbfc['id']);return _0x270be3['sequelize'][_0x1bb2('0x87')](_0x332dc4['toString'](),_0x29ea18)[_0x1bb2('0x8')](function(_0x574977){_0x3ebbfc[_0x9cf70c+_0x1bb2('0x88')]=_0x574977;_0x1e500e(_0x574977);})[_0x1bb2('0xf')](function(_0x1dfae7){_0x1c96f1(_0x1dfae7);});});}return _0x1dfeec['define'](_0x1bb2('0x89'),attributes,{'tableName':_0x1bb2('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x220bd1){var _0x2a0e65=require(_0x1bb2('0x8b'));var _0xc9cb51={'raw':_0x220bd1['query'][_0x1bb2('0x8c')],'where':{}};var _0x244f94={};var _0x24ec13={'count':0x0,'rows':[]};var _0x4d1bc3=_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0x8d')];var _0x3daac9=_0x220bd1[_0x1bb2('0x87')]['mergeResources']||![];var _0x1e62ed=_0x55e41f(_0x4d1bc3,_0x3daac9);if(!_0x1e62ed[_0x1bb2('0x11')])throw new Error('Invalid\x20section\x20\x27'+_0x4d1bc3+'\x27');var _0x58b301=[{'name':_0x4d1bc3}];if(!_[_0x1bb2('0x8e')](_0x1e62ed[_0x1bb2('0x1b')]))_0x58b301=_0x1e62ed[_0x1bb2('0x1b')];var _0x5207ee=[];for(var _0x130837=0x0;_0x130837<_0x58b301[_0x1bb2('0x8f')];_0x130837++){_0x5207ee[_0x1bb2('0x90')](_0x270be3['UserProfileSection'][_0x1bb2('0x91')]({'where':{'userProfileId':_0x220bd1[_0x1bb2('0x92')]['id'],'name':_0x58b301[_0x130837][_0x1bb2('0xc')]},'raw':!![]}));}return Promise[_0x1bb2('0x93')](_0x5207ee)[_0x1bb2('0x8')](function(_0x11c616){var _0x118126=_[_0x1bb2('0x4')](_0x11c616,function(_0x20e775){return _0x20e775?_0x20e775:undefined;});var _0x2586fe=_[_0x1bb2('0x4')](_0x58b301,[_0x1bb2('0x94'),!![]]);var _0x1c3d09=_[_0x1bb2('0x8e')](_0x118126)&&_[_0x1bb2('0x8e')](_0x2586fe)?null:_[_0x1bb2('0x95')](_0x2586fe,_0x118126);if(!_0x1c3d09)return null;var _0x489128=[];for(var _0x3d43d0=0x0;_0x3d43d0<_0x1c3d09['length'];_0x3d43d0++){var _0x398cf3=_[_0x1bb2('0x91')](_0x58b301,function(_0x2e1a04){return _0x1c3d09[_0x3d43d0]?_0x2e1a04[_0x1bb2('0xc')]===_0x1c3d09[_0x3d43d0][_0x1bb2('0xc')]:null;});if(_0x398cf3){if(_0x1c3d09[_0x3d43d0][_0x1bb2('0x94')]){_0x489128[_0x1bb2('0x90')](_0x46a416(_0x1e62ed[_0x1bb2('0x11')],_0x1c3d09[_0x3d43d0]));}else{if(!_0x1c3d09[_0x3d43d0][_0x1bb2('0x96')]){_0x489128[_0x1bb2('0x90')](_0x51b0f9(_0x398cf3,_0x1c3d09[_0x3d43d0],_0x1e62ed['childModel']));}else{if(_0x398cf3[_0x1bb2('0xb')]){_0x489128[_0x1bb2('0x90')](_0x39f19a(_0x398cf3,_0x1c3d09[_0x3d43d0]));}}}}}return Promise[_0x1bb2('0x93')](_0x489128);})['then'](function(_0x1a4a64){var _0x3084ad=_0x1a4a64;var _0x3fca5b=null;if(_0x3084ad){_0x3fca5b=_0x3084ad[_0x1bb2('0x8f')]===0x1?_0x3084ad[0x0]:null;}if(!_0x3fca5b&&!_0x3084ad)return _0x24ec13;var _0x3924c8=_0x270be3[_0x1e62ed[_0x1bb2('0x11')]][_0x1bb2('0x97')];_0x244f94[_0x1bb2('0xb')]=_[_0x1bb2('0x98')](_0x3924c8);_0x244f94[_0x1bb2('0x87')]=_[_0x1bb2('0x98')](_0x220bd1[_0x1bb2('0x87')]);_0x244f94[_0x1bb2('0x99')]=_[_0x1bb2('0x9a')](_0x244f94[_0x1bb2('0xb')],_0x244f94[_0x1bb2('0x87')]);_0xc9cb51['attributes']=_['intersection'](_0x244f94[_0x1bb2('0xb')],_0x2a0e65[_0x1bb2('0x9b')](_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0x9b')]));_0xc9cb51[_0x1bb2('0x9c')]=_0xc9cb51['attributes'][_0x1bb2('0x8f')]?_0xc9cb51[_0x1bb2('0x9c')]:_0x244f94[_0x1bb2('0xb')];if(!_0x220bd1['query'][_0x1bb2('0x9d')](_0x1bb2('0x9e'))){_0xc9cb51[_0x1bb2('0x9f')]=_0x2a0e65[_0x1bb2('0x9f')](_0x220bd1[_0x1bb2('0x87')]['limit']);_0xc9cb51[_0x1bb2('0xa0')]=_0x2a0e65[_0x1bb2('0xa0')](_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xa0')]);}_0xc9cb51[_0x1bb2('0xa1')]=_0x2a0e65[_0x1bb2('0xa2')](_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xa2')]);_0xc9cb51[_0x1bb2('0x85')]=_0x2a0e65[_0x1bb2('0x99')](_['pick'](_0x220bd1['query'],_0x244f94[_0x1bb2('0x99')]));if(_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0x4')]){_0xc9cb51[_0x1bb2('0x85')]=_[_0x1bb2('0xa3')](_0xc9cb51['where'],{'$or':_['map'](_0x3924c8,function(_0x1212e4){if(_0x1212e4[_0x1bb2('0x3a')][_0x1bb2('0xa4')]!==_0x1bb2('0xa5')){var _0x140274={};_0x140274[_0x1212e4[_0x1bb2('0x5')]]={'$like':'%'+_0x220bd1['query'][_0x1bb2('0x4')]+'%'};return _0x140274;}})});}var _0x18d53b=[];var _0x423400=null;var _0x3647aa={};if(_0x3fca5b){_0x423400=_['find'](_0x58b301,[_0x1bb2('0xc'),_0x3fca5b[_0x1bb2('0xc')]]);if(_0x423400['field']){_0x3647aa={};if(_0x1e62ed['childModel']===_0x1bb2('0xd')){_0x3647aa[_0x423400[_0x1bb2('0xa6')]]=_[_0x1bb2('0xa')](_0x3fca5b['associatedResources'],'id');}else{_0x3647aa[_0x423400['foreignKey']]=_0x3fca5b[_0x1bb2('0x9')];}_0x18d53b[_0x1bb2('0x90')](_0x3647aa);}else{_0xc9cb51[_0x1bb2('0x85')]['id']=_0x3fca5b[_0x1bb2('0x9')];}}else{for(var _0x124d26=0x0;_0x124d26<_0x3084ad[_0x1bb2('0x8f')];_0x124d26++){_0x423400=_['find'](_0x58b301,[_0x1bb2('0xc'),_0x3084ad[_0x124d26][_0x1bb2('0xc')]]);if(_0x423400[_0x1bb2('0x5')]){_0x3647aa={};_0x3647aa[_0x423400[_0x1bb2('0xa6')]]=_0x3084ad[_0x124d26][_0x1bb2('0x9')];_0x18d53b['push'](_0x3647aa);}else{if(!_0xc9cb51[_0x1bb2('0x85')]['id'])_0xc9cb51[_0x1bb2('0x85')]['id']=[];_0x3084ad[_0x124d26]['associatedResources'][_0x1bb2('0xa7')](function(_0x2724da){_0xc9cb51[_0x1bb2('0x85')]['id']['push'](_0x2724da);});}}}if(!_[_0x1bb2('0x8e')](_0x18d53b)){_0xc9cb51[_0x1bb2('0x85')]=_[_0x1bb2('0xa3')](_0xc9cb51[_0x1bb2('0x85')],{'$and':{'$or':_0x18d53b}});}_0xc9cb51=_['merge']({},_0xc9cb51,_0x220bd1[_0x1bb2('0xa8')]);if(_0x3fca5b&&!_0x3fca5b[_0x1bb2('0x96')]&&_0x1e62ed['childModel']===_0x1bb2('0xd')){if(_0x220bd1[_0x1bb2('0x87')]['includeAll']){_0xc9cb51['include']=[{'all':!![]}];}return _0x270be3[_0x1e62ed['childModel']]['findAll'](_0xc9cb51)[_0x1bb2('0x8')](function(_0x19758d){var _0x25a448=[];_0x19758d[_0x1bb2('0xa7')](function(_0x245219){var _0x484bd6;switch(_0x245219[_0x1bb2('0xa9')]){case _0x1bb2('0xaa'):_0x484bd6=_[_0x1bb2('0x91')](_0x3fca5b['associatedResources'],function(_0x50ff7b){return _0x50ff7b['id']===_0x245219['reportId']&&_0x50ff7b[_0x1bb2('0x3a')]===_0x1bb2('0xab');});break;case _0x1bb2('0xac'):_0x484bd6=_[_0x1bb2('0x91')](_0x3fca5b[_0x1bb2('0x9')],function(_0x2a9729){return _0x2a9729['id']===_0x245219['reportId']&&_0x2a9729[_0x1bb2('0x3a')]===_0x1bb2('0xad');});break;}if(_0x484bd6)_0x25a448[_0x1bb2('0x90')](_0x245219);});_0x24ec13['count']=_0x25a448[_0x1bb2('0x8f')];_0x24ec13[_0x1bb2('0xae')]=_0x25a448;return _0x24ec13;});}else{if(!_[_0x1bb2('0x8e')](_0x220bd1['query'][_0x1bb2('0xaf')])){_0xc9cb51[_0x1bb2('0x85')]['id']=_0xc9cb51['where']['id']?_[_0x1bb2('0x9a')](_0xc9cb51[_0x1bb2('0x85')]['id'],_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xaf')]):_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xaf')];if(_0x220bd1['query'][_0x1bb2('0xb0')]){_0xc9cb51['order']=_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xb0')];}}if(_0x220bd1['query'][_0x1bb2('0xb1')]){_0xc9cb51[_0x1bb2('0x85')]=_['merge'](_0xc9cb51['where'],{'$and':_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xb1')]});}return _0x270be3[_0x1e62ed['childModel']][_0x1bb2('0xb2')]({'where':_0xc9cb51[_0x1bb2('0x85')]})[_0x1bb2('0x8')](function(_0xb733bc){_0x24ec13[_0x1bb2('0xb2')]=_0xb733bc;if(_0x220bd1['query'][_0x1bb2('0xb3')]){if(_0x1e62ed[_0x1bb2('0x11')]==='CmContact'){_0xc9cb51[_0x1bb2('0xb4')]=[{'model':_0x270be3[_0x1bb2('0x6d')],'as':_0x1bb2('0xb5'),'attributes':['id','name',_0x1bb2('0xb6')],'required':_0x220bd1['query']['tag']?!![]:![]},{'model':_0x270be3['Tag'],'as':_0x1bb2('0xb7'),'attributes':['id','name','color'],'through':_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xb8')]?{'attributes':[],'where':{'TagId':_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xb8')]||undefined}}:{},'required':_0x220bd1['query']['tag']?!![]:![]}];}else{_0xc9cb51[_0x1bb2('0xb4')]=[{'all':!![]}];}}return _0x270be3[_0x1e62ed[_0x1bb2('0x11')]][_0x1bb2('0x7')](_0xc9cb51);})[_0x1bb2('0x8')](function(_0x2808ac){_0x24ec13['rows']=_0x2808ac;if(_0x4d1bc3===_0x1bb2('0x31')&&_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xb9')]===_0x1bb2('0xba')){var _0x12817c=[];for(var _0x28d834=0x0;_0x28d834<_0x24ec13[_0x1bb2('0xae')][_0x1bb2('0x8f')];_0x28d834++){_0x12817c[_0x1bb2('0x90')](_0x4c6afd(_0x1bb2('0xbb'),_0x24ec13['rows'][_0x28d834][_0x1bb2('0xbc')]));_0x12817c[_0x1bb2('0x90')](_0x4c6afd('sms',_0x24ec13[_0x1bb2('0xae')][_0x28d834]['dataValues']));_0x12817c[_0x1bb2('0x90')](_0x4c6afd(_0x1bb2('0xbd'),_0x24ec13['rows'][_0x28d834][_0x1bb2('0xbc')]));_0x12817c[_0x1bb2('0x90')](_0x4c6afd(_0x1bb2('0xbe'),_0x24ec13['rows'][_0x28d834][_0x1bb2('0xbc')]));_0x12817c[_0x1bb2('0x90')](_0x4c6afd('openchannel',_0x24ec13[_0x1bb2('0xae')][_0x28d834][_0x1bb2('0xbc')]));_0x12817c['push'](_0x4c6afd(_0x1bb2('0xbf'),_0x24ec13[_0x1bb2('0xae')][_0x28d834][_0x1bb2('0xbc')]));}return Promise[_0x1bb2('0x93')](_0x12817c)['then'](function(){return _0x24ec13;});}return _0x24ec13;});}});}}});}; \ No newline at end of file +var _0xbca7=['SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','voicequeues','queuecampaigns','VoiceQueue','agents','telephones','Users','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','zohoaccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','AnalyticExtractedReport','Reports','metrics','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','user_profiles','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','find','params','all','ignore','isEmpty','union','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','VIRTUAL','foreignKey','forEach','merge','options','autoAssociation','includeAll','include','reportType','default','reportId','CustomReports','count','rows','ids','customSorting','Tags','tag','ThroughTags','color','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','filter','value','then','associatedResources','map','model','findAll','name','catch','field','resourceId','type','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','OpenchannelAccount','smsqueues','SmsQueue'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xbca7,0x12a));var _0x7bca=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xbca7[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x7bca('0x0'));var attributes=require(_0x7bca('0x1'));var squel=require(_0x7bca('0x2'));module[_0x7bca('0x3')]=function(_0x450401){var _0x138885=_0x450401['models'];function _0x2a9270(_0x40faa5,_0x4cab99){return new Promise(function(_0x1f99ad,_0x311566){if(!_0x4cab99)return _0x1f99ad(null);var _0x339359=_0x4cab99[_0x7bca('0x4')]?{[_0x4cab99[_0x7bca('0x4')]['field']]:_0x4cab99['filter'][_0x7bca('0x5')]}:undefined;return _0x138885[_0x40faa5]['findAll']({'where':_0x339359,'raw':!![]})[_0x7bca('0x6')](function(_0x42f557){_0x4cab99[_0x7bca('0x7')]=_[_0x7bca('0x8')](_0x42f557,'id');_0x1f99ad(_0x4cab99);})['catch'](function(_0x4b1043){_0x311566(_0x4b1043);});});}function _0x48aba4(_0x46deb8,_0x41484a){return new Promise(function(_0x4895a4,_0x32dbd4){var _0x3b6f47=_0x46deb8[_0x7bca('0x4')]?{[_0x46deb8['filter']['field']]:_0x46deb8[_0x7bca('0x4')]['value']}:undefined;return _0x138885[_0x46deb8[_0x7bca('0x9')]][_0x7bca('0xa')]({'where':_0x3b6f47,'raw':!![]})[_0x7bca('0x6')](function(_0x29774c){_0x41484a[_0x7bca('0x7')]=_[_0x7bca('0x8')](_0x29774c,function(_0x50f4bc){return _0x50f4bc[_0x7bca('0xb')];});_0x4895a4(_0x41484a);})[_0x7bca('0xc')](function(_0x39c515){_0x32dbd4(_0x39c515);});});}function _0x4db721(_0x4bca3c,_0x151c57,_0x479577){if(!_0x151c57)return Promise['resolve'](null);return new Promise(function(_0x1986c3,_0xc4ac8e){return _0x138885['UserProfileResource'][_0x7bca('0xa')]({'where':{'sectionId':_0x151c57['id']},'raw':!![]})['then'](function(_0x15d997){if(_0x4bca3c['field']&&_0x4bca3c[_0x7bca('0xd')]!=='id'){_0x151c57[_0x7bca('0x7')]=_['map'](_0x15d997,function(_0x3a2514){return _0x3a2514[_0x4bca3c['field']];});}else{if(_0x479577==='AnalyticExtractedReport'){_0x151c57[_0x7bca('0x7')]=_[_0x7bca('0x8')](_0x15d997,function(_0x4a5ab6){return{'id':_0x4a5ab6[_0x7bca('0xe')],'type':_0x4a5ab6[_0x7bca('0xf')]};});}else{_0x151c57[_0x7bca('0x7')]=_[_0x7bca('0x8')](_0x15d997,function(_0x4da835){return _0x4da835['resourceId'];});}}_0x1986c3(_0x151c57);})[_0x7bca('0xc')](function(_0x39babd){_0xc4ac8e(_0x39babd);});});}function _0x18f792(_0x42d1a8,_0x250da2){var _0x26e55b={'parentSections':[]};switch(_0x42d1a8['toLowerCase']()){case _0x7bca('0x10'):_0x26e55b[_0x7bca('0x11')]='SquareProject';break;case _0x7bca('0x12'):_0x26e55b['childModel']=_0x7bca('0x13');break;case _0x7bca('0x14'):_0x26e55b[_0x7bca('0x11')]='SquareRecording';_0x26e55b[_0x7bca('0x15')]=[{'name':_0x7bca('0x16'),'field':_0x7bca('0xb'),'foreignKey':_0x7bca('0x17')}];break;case'projects':_0x26e55b['childModel']='JscriptyProject';break;case'contacts':_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x18');_0x26e55b[_0x7bca('0x15')]=[{'name':_0x7bca('0x19'),'field':'id','foreignKey':'ListId'}];break;case _0x7bca('0x1a'):_0x26e55b['childModel']=_0x7bca('0x1b');break;case _0x7bca('0x1c'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x1d');break;case _0x7bca('0x1e'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x1f');break;case _0x7bca('0x20'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x21');break;case _0x7bca('0x22'):_0x26e55b['childModel']=_0x7bca('0x23');break;case _0x7bca('0x24'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x25');break;case _0x7bca('0x26'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x27');break;case _0x7bca('0x28'):case _0x7bca('0x29'):case _0x7bca('0x2a'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x2b');break;case _0x7bca('0x2c'):_0x26e55b[_0x7bca('0x11')]='VoiceContext';break;case'voicemails':_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x2d');break;case _0x7bca('0x2e'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x2f');_0x26e55b[_0x7bca('0x15')]=[{'name':_0x7bca('0x30'),'field':_0x7bca('0xb'),'foreignKey':_0x7bca('0x31'),'model':_0x7bca('0x32'),'filter':{'field':'role','value':[_0x7bca('0x33')]}},{'name':_0x7bca('0x34'),'field':'name','foreignKey':_0x7bca('0x31'),'model':'User','filter':{'field':_0x7bca('0x35'),'value':[_0x7bca('0x36')]}},{'name':_0x7bca('0x37'),'field':'name','foreignKey':_0x7bca('0x38'),'model':'VoiceQueue','filter':{'field':_0x7bca('0xf'),'value':['inbound']}},{'name':_0x7bca('0x39'),'field':_0x7bca('0xb'),'foreignKey':_0x7bca('0x38'),'model':'VoiceQueue','filter':{'field':_0x7bca('0xf'),'value':['outbound']}}];break;case _0x7bca('0x3a'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x3b');break;case _0x7bca('0x3c'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x3d');break;case _0x7bca('0x3e'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x3f');break;case _0x7bca('0x40'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x41');break;case _0x7bca('0x42'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x43');break;case _0x7bca('0x44'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x45');break;case'mailsubstatuses':_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x46');break;case'openchannelqueues':_0x26e55b[_0x7bca('0x11')]='OpenchannelQueue';break;case'openchannelaccounts':_0x26e55b['childModel']=_0x7bca('0x47');break;case _0x7bca('0x48'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x49');break;case'smsaccounts':_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x4a');break;case _0x7bca('0x4b'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x4c');break;case'whatsappaccounts':_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x4d');break;case'teams':_0x26e55b['childModel']=_0x7bca('0x4e');break;case _0x7bca('0x4f'):case _0x7bca('0x50'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x51');if(_0x250da2){_0x26e55b[_0x7bca('0x15')]=[{'name':_0x7bca('0x37')},{'name':_0x7bca('0x39')}];}break;case'users':case _0x7bca('0x52'):case _0x7bca('0x53'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x32');if(_0x250da2){_0x26e55b['parentSections']=[{'name':_0x7bca('0x54'),'filter':{'field':_0x7bca('0x35'),'value':['admin','user']},'ignore':!![]},{'name':'Agents'},{'name':_0x7bca('0x34')}];}break;case _0x7bca('0x55'):_0x26e55b[_0x7bca('0x11')]='ZendeskAccount';break;case _0x7bca('0x56'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x57');break;case _0x7bca('0x58'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x59');break;case'sugarcrmaccounts':_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x5a');break;case _0x7bca('0x5b'):_0x26e55b[_0x7bca('0x11')]='DeskAccount';break;case _0x7bca('0x5c'):_0x26e55b['childModel']='ZohoAccount';break;case'vtigeraccounts':_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x32');break;case'cannedanswers':_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x5d');break;case _0x7bca('0x5e'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x5f');break;case _0x7bca('0x60'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x61');break;case _0x7bca('0x62'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x63');break;case'pauses':_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x64');break;case _0x7bca('0x65'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x66');break;case _0x7bca('0x67'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x68');break;case _0x7bca('0x69'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x6a');break;case'templates':_0x26e55b[_0x7bca('0x11')]='Template';break;case _0x7bca('0x6b'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x6c');break;case _0x7bca('0x6d'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x6e');break;case _0x7bca('0x6f'):_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x70');break;case _0x7bca('0x71'):_0x26e55b['childModel']=_0x7bca('0x72');break;case'extractedreports':_0x26e55b[_0x7bca('0x11')]=_0x7bca('0x73');_0x26e55b['parentSections']=[{'name':_0x7bca('0x74'),'field':'id','foreignKey':'reportId'}];break;case _0x7bca('0x75'):_0x26e55b[_0x7bca('0x11')]='AnalyticMetric';break;}return _0x26e55b;}function _0x1d800b(_0x53b6a8,_0x225127){var _0x23302d=_0x53b6a8[_0x7bca('0x76')](0x0)[_0x7bca('0x77')]()+_0x53b6a8[_0x7bca('0x78')](0x1);var _0x5d0a22={'type':_0x138885[_0x7bca('0x79')]['QueryTypes'][_0x7bca('0x7a')],'raw':!![]};return new Promise(function(_0x5f41f3,_0x1ed7ec){var _0xd8aeaf=squel[_0x7bca('0x7b')]()['field'](_0x7bca('0x7c')+_0x23302d+'InteractionId','id')[_0x7bca('0xd')]('ui.createdAt')[_0x7bca('0x7d')](_0x7bca('0x7e')+_0x53b6a8+_0x7bca('0x7f'),'ui')[_0x7bca('0x80')]('ui.UserId\x20=\x20?',_0x225127['id']);return _0x138885[_0x7bca('0x81')][_0x7bca('0x82')](_0xd8aeaf[_0x7bca('0x83')](),_0x5d0a22)[_0x7bca('0x6')](function(_0x2b3677){_0x225127[_0x23302d+_0x7bca('0x84')]=_0x2b3677;_0x5f41f3(_0x2b3677);})[_0x7bca('0xc')](function(_0x321001){_0x1ed7ec(_0x321001);});});}return _0x450401[_0x7bca('0x85')]('UserProfile',attributes,{'tableName':_0x7bca('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x27c6c6){var _0x676673=require(_0x7bca('0x87'));var _0x1d902d={'raw':_0x27c6c6['query'][_0x7bca('0x88')],'where':{}};var _0x3db9dd={};var _0x1a3123={'count':0x0,'rows':[]};var _0x30b05c=_0x27c6c6[_0x7bca('0x82')][_0x7bca('0x89')];var _0x514173=_0x27c6c6[_0x7bca('0x82')][_0x7bca('0x8a')]||![];var _0x130b70=_0x18f792(_0x30b05c,_0x514173);if(!_0x130b70[_0x7bca('0x11')])throw new Error(_0x7bca('0x8b')+_0x30b05c+'\x27');var _0x5b6eca=[{'name':_0x30b05c}];if(!_['isEmpty'](_0x130b70['parentSections']))_0x5b6eca=_0x130b70[_0x7bca('0x15')];var _0x3ac379=[];for(var _0x5856c7=0x0;_0x5856c7<_0x5b6eca[_0x7bca('0x8c')];_0x5856c7++){_0x3ac379[_0x7bca('0x8d')](_0x138885['UserProfileSection'][_0x7bca('0x8e')]({'where':{'userProfileId':_0x27c6c6[_0x7bca('0x8f')]['id'],'name':_0x5b6eca[_0x5856c7][_0x7bca('0xb')]},'raw':!![]}));}return Promise[_0x7bca('0x90')](_0x3ac379)['then'](function(_0x2df59f){var _0x415cbb=_['filter'](_0x2df59f,function(_0x204354){return _0x204354?_0x204354:undefined;});var _0x2a8700=_[_0x7bca('0x4')](_0x5b6eca,[_0x7bca('0x91'),!![]]);var _0x3bf25b=_['isEmpty'](_0x415cbb)&&_[_0x7bca('0x92')](_0x2a8700)?null:_[_0x7bca('0x93')](_0x2a8700,_0x415cbb);if(!_0x3bf25b)return null;var _0x456f14=[];for(var _0x424867=0x0;_0x424867<_0x3bf25b[_0x7bca('0x8c')];_0x424867++){var _0x5fb2c8=_['find'](_0x5b6eca,function(_0x59f2cc){return _0x3bf25b[_0x424867]?_0x59f2cc[_0x7bca('0xb')]===_0x3bf25b[_0x424867][_0x7bca('0xb')]:null;});if(_0x5fb2c8){if(_0x3bf25b[_0x424867][_0x7bca('0x91')]){_0x456f14[_0x7bca('0x8d')](_0x2a9270(_0x130b70[_0x7bca('0x11')],_0x3bf25b[_0x424867]));}else{if(!_0x3bf25b[_0x424867]['autoAssociation']){_0x456f14[_0x7bca('0x8d')](_0x4db721(_0x5fb2c8,_0x3bf25b[_0x424867],_0x130b70['childModel']));}else{if(_0x5fb2c8['model']){_0x456f14[_0x7bca('0x8d')](_0x48aba4(_0x5fb2c8,_0x3bf25b[_0x424867]));}}}}}return Promise[_0x7bca('0x90')](_0x456f14);})[_0x7bca('0x6')](function(_0x221559){var _0x250cda=_0x221559;var _0x1a51d2=null;if(_0x250cda){_0x1a51d2=_0x250cda[_0x7bca('0x8c')]===0x1?_0x250cda[0x0]:null;}if(!_0x1a51d2&&!_0x250cda)return _0x1a3123;var _0xebfd4a=_0x138885[_0x130b70[_0x7bca('0x11')]][_0x7bca('0x94')];_0x3db9dd[_0x7bca('0x9')]=_['keys'](_0xebfd4a);_0x3db9dd['query']=_[_0x7bca('0x95')](_0x27c6c6[_0x7bca('0x82')]);_0x3db9dd[_0x7bca('0x96')]=_[_0x7bca('0x97')](_0x3db9dd['model'],_0x3db9dd['query']);_0x1d902d[_0x7bca('0x98')]=_[_0x7bca('0x97')](_0x3db9dd[_0x7bca('0x9')],_0x676673[_0x7bca('0x99')](_0x27c6c6['query']['fields']));_0x1d902d['attributes']=_0x1d902d[_0x7bca('0x98')][_0x7bca('0x8c')]?_0x1d902d[_0x7bca('0x98')]:_0x3db9dd[_0x7bca('0x9')];if(!_0x27c6c6[_0x7bca('0x82')][_0x7bca('0x9a')](_0x7bca('0x9b'))){_0x1d902d[_0x7bca('0x9c')]=_0x676673[_0x7bca('0x9c')](_0x27c6c6[_0x7bca('0x82')]['limit']);_0x1d902d['offset']=_0x676673[_0x7bca('0x9d')](_0x27c6c6[_0x7bca('0x82')][_0x7bca('0x9d')]);}_0x1d902d[_0x7bca('0x9e')]=_0x676673[_0x7bca('0x9f')](_0x27c6c6[_0x7bca('0x82')][_0x7bca('0x9f')]);_0x1d902d[_0x7bca('0x80')]=_0x676673[_0x7bca('0x96')](_['pick'](_0x27c6c6[_0x7bca('0x82')],_0x3db9dd['filters']));if(_0x27c6c6[_0x7bca('0x82')]['filter']){_0x1d902d[_0x7bca('0x80')]=_['merge'](_0x1d902d['where'],{'$or':_[_0x7bca('0x8')](_0xebfd4a,function(_0x3fc30d){if(_0x3fc30d[_0x7bca('0xf')]['key']!==_0x7bca('0xa0')){var _0x5ea78e={};_0x5ea78e[_0x3fc30d['field']]={'$like':'%'+_0x27c6c6[_0x7bca('0x82')][_0x7bca('0x4')]+'%'};return _0x5ea78e;}})});}var _0x3821fc=[];var _0x4c7b35=null;var _0x1cac1c={};if(_0x1a51d2){_0x4c7b35=_[_0x7bca('0x8e')](_0x5b6eca,['name',_0x1a51d2[_0x7bca('0xb')]]);if(_0x4c7b35[_0x7bca('0xd')]){_0x1cac1c={};if(_0x130b70[_0x7bca('0x11')]===_0x7bca('0x73')){_0x1cac1c[_0x4c7b35[_0x7bca('0xa1')]]=_['map'](_0x1a51d2[_0x7bca('0x7')],'id');}else{_0x1cac1c[_0x4c7b35[_0x7bca('0xa1')]]=_0x1a51d2['associatedResources'];}_0x3821fc[_0x7bca('0x8d')](_0x1cac1c);}else{_0x1d902d[_0x7bca('0x80')]['id']=_0x1a51d2[_0x7bca('0x7')];}}else{for(var _0x51826a=0x0;_0x51826a<_0x250cda[_0x7bca('0x8c')];_0x51826a++){_0x4c7b35=_[_0x7bca('0x8e')](_0x5b6eca,[_0x7bca('0xb'),_0x250cda[_0x51826a]['name']]);if(_0x4c7b35[_0x7bca('0xd')]){_0x1cac1c={};_0x1cac1c[_0x4c7b35[_0x7bca('0xa1')]]=_0x250cda[_0x51826a]['associatedResources'];_0x3821fc[_0x7bca('0x8d')](_0x1cac1c);}else{if(!_0x1d902d[_0x7bca('0x80')]['id'])_0x1d902d[_0x7bca('0x80')]['id']=[];_0x250cda[_0x51826a][_0x7bca('0x7')][_0x7bca('0xa2')](function(_0x211bb5){_0x1d902d[_0x7bca('0x80')]['id'][_0x7bca('0x8d')](_0x211bb5);});}}}if(!_['isEmpty'](_0x3821fc)){_0x1d902d[_0x7bca('0x80')]=_['merge'](_0x1d902d['where'],{'$and':{'$or':_0x3821fc}});}_0x1d902d=_[_0x7bca('0xa3')]({},_0x1d902d,_0x27c6c6[_0x7bca('0xa4')]);if(_0x1a51d2&&!_0x1a51d2[_0x7bca('0xa5')]&&_0x130b70[_0x7bca('0x11')]===_0x7bca('0x73')){if(_0x27c6c6[_0x7bca('0x82')][_0x7bca('0xa6')]){_0x1d902d[_0x7bca('0xa7')]=[{'all':!![]}];}return _0x138885[_0x130b70[_0x7bca('0x11')]][_0x7bca('0xa')](_0x1d902d)[_0x7bca('0x6')](function(_0xbd16dc){var _0x574558=[];_0xbd16dc[_0x7bca('0xa2')](function(_0x452aa5){var _0x215259;switch(_0x452aa5[_0x7bca('0xa8')]){case _0x7bca('0xa9'):_0x215259=_[_0x7bca('0x8e')](_0x1a51d2[_0x7bca('0x7')],function(_0x2b85f8){return _0x2b85f8['id']===_0x452aa5[_0x7bca('0xaa')]&&_0x2b85f8[_0x7bca('0xf')]==='DefaultReports';});break;case'custom':_0x215259=_['find'](_0x1a51d2['associatedResources'],function(_0x3aa1c0){return _0x3aa1c0['id']===_0x452aa5[_0x7bca('0xaa')]&&_0x3aa1c0[_0x7bca('0xf')]===_0x7bca('0xab');});break;}if(_0x215259)_0x574558[_0x7bca('0x8d')](_0x452aa5);});_0x1a3123[_0x7bca('0xac')]=_0x574558[_0x7bca('0x8c')];_0x1a3123[_0x7bca('0xad')]=_0x574558;return _0x1a3123;});}else{if(!_[_0x7bca('0x92')](_0x27c6c6[_0x7bca('0x82')][_0x7bca('0xae')])){_0x1d902d['where']['id']=_0x1d902d[_0x7bca('0x80')]['id']?_['intersection'](_0x1d902d[_0x7bca('0x80')]['id'],_0x27c6c6['query'][_0x7bca('0xae')]):_0x27c6c6[_0x7bca('0x82')]['ids'];if(_0x27c6c6['query'][_0x7bca('0xaf')]){_0x1d902d[_0x7bca('0x9e')]=_0x27c6c6[_0x7bca('0x82')][_0x7bca('0xaf')];}}if(_0x27c6c6[_0x7bca('0x82')]['extraQueryConditions']){_0x1d902d[_0x7bca('0x80')]=_[_0x7bca('0xa3')](_0x1d902d[_0x7bca('0x80')],{'$and':_0x27c6c6[_0x7bca('0x82')]['extraQueryConditions']});}return _0x138885[_0x130b70[_0x7bca('0x11')]][_0x7bca('0xac')]({'where':_0x1d902d[_0x7bca('0x80')]})[_0x7bca('0x6')](function(_0x3f17fb){_0x1a3123[_0x7bca('0xac')]=_0x3f17fb;if(_0x27c6c6['query']['includeAll']){if(_0x130b70[_0x7bca('0x11')]===_0x7bca('0x18')){_0x1d902d['include']=[{'model':_0x138885[_0x7bca('0x6a')],'as':_0x7bca('0xb0'),'attributes':['id',_0x7bca('0xb'),'color'],'required':_0x27c6c6[_0x7bca('0x82')][_0x7bca('0xb1')]?!![]:![]},{'model':_0x138885['Tag'],'as':_0x7bca('0xb2'),'attributes':['id','name',_0x7bca('0xb3')],'through':_0x27c6c6[_0x7bca('0x82')][_0x7bca('0xb1')]?{'attributes':[],'where':{'TagId':_0x27c6c6[_0x7bca('0x82')][_0x7bca('0xb1')]||undefined}}:{},'required':_0x27c6c6[_0x7bca('0x82')]['tag']?!![]:![]}];}else{_0x1d902d[_0x7bca('0xa7')]=[{'all':!![]}];}}return _0x138885[_0x130b70[_0x7bca('0x11')]][_0x7bca('0xa')](_0x1d902d);})[_0x7bca('0x6')](function(_0x1968e5){_0x1a3123[_0x7bca('0xad')]=_0x1968e5;if(_0x30b05c===_0x7bca('0x30')&&_0x27c6c6[_0x7bca('0x82')]['openTabs']==='true'){var _0x8a1458=[];for(var _0x59bb56=0x0;_0x59bb56<_0x1a3123[_0x7bca('0xad')][_0x7bca('0x8c')];_0x59bb56++){_0x8a1458[_0x7bca('0x8d')](_0x1d800b('chat',_0x1a3123['rows'][_0x59bb56][_0x7bca('0xb4')]));_0x8a1458[_0x7bca('0x8d')](_0x1d800b(_0x7bca('0xb5'),_0x1a3123[_0x7bca('0xad')][_0x59bb56][_0x7bca('0xb4')]));_0x8a1458['push'](_0x1d800b(_0x7bca('0xb6'),_0x1a3123[_0x7bca('0xad')][_0x59bb56][_0x7bca('0xb4')]));_0x8a1458['push'](_0x1d800b(_0x7bca('0xb7'),_0x1a3123[_0x7bca('0xad')][_0x59bb56][_0x7bca('0xb4')]));_0x8a1458[_0x7bca('0x8d')](_0x1d800b(_0x7bca('0xb8'),_0x1a3123[_0x7bca('0xad')][_0x59bb56][_0x7bca('0xb4')]));_0x8a1458['push'](_0x1d800b(_0x7bca('0xb9'),_0x1a3123['rows'][_0x59bb56][_0x7bca('0xb4')]));}return Promise[_0x7bca('0x90')](_0x8a1458)[_0x7bca('0x6')](function(){return _0x1a3123;});}return _0x1a3123;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 6b3a6b8..1df6af4 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 _0x3b74=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','UserProfile,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x3b74,0x80));var _0x43b7=function(_0x923452,_0x1540ca){_0x923452=_0x923452-0x0;var _0x66a740=_0x3b74[_0x923452];return _0x66a740;};'use strict';var _=require(_0x43b7('0x0'));var util=require(_0x43b7('0x1'));var moment=require(_0x43b7('0x2'));var BPromise=require(_0x43b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43b7('0x4'));var db=require(_0x43b7('0x5'))['db'];var utils=require(_0x43b7('0x6'));var logger=require(_0x43b7('0x7'))('rpc');var config=require(_0x43b7('0x8'));var jayson=require(_0x43b7('0x9'));var client=jayson[_0x43b7('0xa')][_0x43b7('0xb')]({'port':0x232a});config[_0x43b7('0xc')]=_[_0x43b7('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x43b7('0xe'))(new Redis(config[_0x43b7('0xc')]));require('./userProfile.socket')[_0x43b7('0xf')](socket);function respondWithRpcPromise(_0xfd03bc,_0x55ce4a,_0x446822){return new BPromise(function(_0x49bf6e,_0x446913){return client[_0x43b7('0x10')](_0xfd03bc,_0x446822)['then'](function(_0x536a25){logger[_0x43b7('0x11')](_0x43b7('0x12'),_0x55ce4a,'request\x20sent');logger[_0x43b7('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x55ce4a,_0x43b7('0x14'),JSON[_0x43b7('0x15')](_0x536a25));if(_0x536a25[_0x43b7('0x16')]){if(_0x536a25['error'][_0x43b7('0x17')]===0x1f4){logger[_0x43b7('0x16')](_0x43b7('0x12'),_0x55ce4a,_0x536a25[_0x43b7('0x16')][_0x43b7('0x18')]);return _0x446913(_0x536a25[_0x43b7('0x16')][_0x43b7('0x18')]);}logger[_0x43b7('0x16')]('UserProfile,\x20%s,\x20%s',_0x55ce4a,_0x536a25[_0x43b7('0x16')]['message']);return _0x49bf6e(_0x536a25[_0x43b7('0x16')][_0x43b7('0x18')]);}else{logger['info'](_0x43b7('0x12'),_0x55ce4a,_0x43b7('0x14'));_0x49bf6e(_0x536a25[_0x43b7('0x19')][_0x43b7('0x18')]);}})['catch'](function(_0x1c7385){logger[_0x43b7('0x16')](_0x43b7('0x12'),_0x55ce4a,_0x1c7385);_0x446913(_0x1c7385);});});} \ No newline at end of file +var _0xc319=['stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s'];(function(_0x5de270,_0x4d8489){var _0x53ad05=function(_0x3d8b66){while(--_0x3d8b66){_0x5de270['push'](_0x5de270['shift']());}};_0x53ad05(++_0x4d8489);}(_0xc319,0x12e));var _0x9c31=function(_0x5b85da,_0x86518d){_0x5b85da=_0x5b85da-0x0;var _0x425dc9=_0xc319[_0x5b85da];return _0x425dc9;};'use strict';var _=require(_0x9c31('0x0'));var util=require(_0x9c31('0x1'));var moment=require(_0x9c31('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c31('0x3'));var fs=require('fs');var Redis=require(_0x9c31('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c31('0x5'));var logger=require(_0x9c31('0x6'))(_0x9c31('0x7'));var config=require(_0x9c31('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9c31('0x9')][_0x9c31('0xa')]({'port':0x232a});config[_0x9c31('0xb')]=_[_0x9c31('0xc')](config[_0x9c31('0xb')],{'host':_0x9c31('0xd'),'port':0x18eb});var socket=require(_0x9c31('0xe'))(new Redis(config[_0x9c31('0xb')]));require(_0x9c31('0xf'))['register'](socket);function respondWithRpcPromise(_0x57a0b3,_0x5de62b,_0x1d8b8b){return new BPromise(function(_0x2c026b,_0x14a649){return client[_0x9c31('0x10')](_0x57a0b3,_0x1d8b8b)[_0x9c31('0x11')](function(_0x5eff74){logger[_0x9c31('0x12')](_0x9c31('0x13'),_0x5de62b,_0x9c31('0x14'));logger['debug'](_0x9c31('0x15'),_0x5de62b,_0x9c31('0x14'),JSON[_0x9c31('0x16')](_0x5eff74));if(_0x5eff74[_0x9c31('0x17')]){if(_0x5eff74[_0x9c31('0x17')]['code']===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x5de62b,_0x5eff74['error']['message']);return _0x14a649(_0x5eff74[_0x9c31('0x17')][_0x9c31('0x18')]);}logger['error'](_0x9c31('0x13'),_0x5de62b,_0x5eff74[_0x9c31('0x17')][_0x9c31('0x18')]);return _0x2c026b(_0x5eff74[_0x9c31('0x17')][_0x9c31('0x18')]);}else{logger['info'](_0x9c31('0x13'),_0x5de62b,'request\x20sent');_0x2c026b(_0x5eff74[_0x9c31('0x19')]['message']);}})[_0x9c31('0x1a')](function(_0x54c08a){logger[_0x9c31('0x17')](_0x9c31('0x13'),_0x5de62b,_0x54c08a);_0x14a649(_0x54c08a);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index fa6d30f..9918063 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 _0xc3c2=['remove','update','length','userProfile:','save'];(function(_0x27da9d,_0x39293a){var _0x21a7ab=function(_0xd243a1){while(--_0xd243a1){_0x27da9d['push'](_0x27da9d['shift']());}};_0x21a7ab(++_0x39293a);}(_0xc3c2,0x13f));var _0x2c3c=function(_0xa419b1,_0x263eb6){_0xa419b1=_0xa419b1-0x0;var _0x4b9756=_0xc3c2[_0xa419b1];return _0x4b9756;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x2c3c('0x0'),_0x2c3c('0x1'),_0x2c3c('0x2')];function createListener(_0x31774d,_0x5d8cbe){return function(_0x355ab3){_0x5d8cbe['emit'](_0x31774d,_0x355ab3);};}function removeListener(_0x529f68,_0x1120e3){return function(){UserProfileEvents['removeListener'](_0x529f68,_0x1120e3);};}exports['register']=function(_0xdc4aaa){for(var _0xbae52=0x0,_0x342630=events[_0x2c3c('0x3')];_0xbae52<_0x342630;_0xbae52++){var _0x428e58=events[_0xbae52];var _0x25f2b8=createListener(_0x2c3c('0x4')+_0x428e58,_0xdc4aaa);UserProfileEvents['on'](_0x428e58,_0x25f2b8);}}; \ No newline at end of file +var _0x8809=['./userProfile.events','save','remove','register','length','userProfile:'];(function(_0x4b2517,_0x58c49d){var _0xac2ae=function(_0x36ff5d){while(--_0x36ff5d){_0x4b2517['push'](_0x4b2517['shift']());}};_0xac2ae(++_0x58c49d);}(_0x8809,0x144));var _0x9880=function(_0x566633,_0x14fb5d){_0x566633=_0x566633-0x0;var _0x12b7f4=_0x8809[_0x566633];return _0x12b7f4;};'use strict';var UserProfileEvents=require(_0x9880('0x0'));var events=[_0x9880('0x1'),_0x9880('0x2'),'update'];function createListener(_0x5b284a,_0x2e9654){return function(_0x1469bd){_0x2e9654['emit'](_0x5b284a,_0x1469bd);};}function removeListener(_0x34dbb2,_0x12d5ab){return function(){UserProfileEvents['removeListener'](_0x34dbb2,_0x12d5ab);};}exports[_0x9880('0x3')]=function(_0x1c69b9){for(var _0x57b538=0x0,_0x29d46f=events[_0x9880('0x4')];_0x57b538<_0x29d46f;_0x57b538++){var _0x41696f=events[_0x57b538];var _0x210f90=createListener(_0x9880('0x5')+_0x41696f,_0x1c69b9);UserProfileEvents['on'](_0x41696f,_0x210f90);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 0c57b9a..3f8abbc 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 _0x12b1=['put','update','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x404dc8,_0x3245a5){var _0x4b1a99=function(_0x11e6a1){while(--_0x11e6a1){_0x404dc8['push'](_0x404dc8['shift']());}};_0x4b1a99(++_0x3245a5);}(_0x12b1,0x90));var _0x112b=function(_0x4cd226,_0x489a22){_0x4cd226=_0x4cd226-0x0;var _0x19c008=_0x12b1[_0x4cd226];return _0x19c008;};'use strict';var multer=require(_0x112b('0x0'));var util=require(_0x112b('0x1'));var path=require(_0x112b('0x2'));var timeout=require(_0x112b('0x3'));var express=require('express');var router=express[_0x112b('0x4')]();var fs_extra=require(_0x112b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x112b('0x6'));var config=require(_0x112b('0x7'));var controller=require('./userProfileResource.controller');router[_0x112b('0x8')]('/',auth[_0x112b('0x9')](),controller[_0x112b('0xa')]);router[_0x112b('0x8')](_0x112b('0xb'),auth[_0x112b('0x9')](),controller[_0x112b('0xc')]);router[_0x112b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x112b('0xd')]);router[_0x112b('0xe')]('/',auth['isAuthenticated'](),controller[_0x112b('0xf')]);router[_0x112b('0x10')]('/:id',auth[_0x112b('0x9')](),controller[_0x112b('0x11')]);router['delete'](_0x112b('0x12'),auth[_0x112b('0x9')](),controller['destroy']);module[_0x112b('0x13')]=router; \ No newline at end of file +var _0xd735=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router','../../components/interaction/service'];(function(_0x35f6af,_0x505074){var _0x4ae86a=function(_0x18af2e){while(--_0x18af2e){_0x35f6af['push'](_0x35f6af['shift']());}};_0x4ae86a(++_0x505074);}(_0xd735,0x19f));var _0x5d73=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd735[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x5d73('0x0'));var util=require('util');var path=require(_0x5d73('0x1'));var timeout=require('connect-timeout');var express=require(_0x5d73('0x2'));var router=express[_0x5d73('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5d73('0x4'));var config=require(_0x5d73('0x5'));var controller=require('./userProfileResource.controller');router[_0x5d73('0x6')]('/',auth[_0x5d73('0x7')](),controller[_0x5d73('0x8')]);router[_0x5d73('0x6')](_0x5d73('0x9'),auth[_0x5d73('0x7')](),controller[_0x5d73('0xa')]);router['get']('/:id',auth[_0x5d73('0x7')](),controller[_0x5d73('0xb')]);router[_0x5d73('0xc')]('/',auth['isAuthenticated'](),controller[_0x5d73('0xd')]);router[_0x5d73('0xe')](_0x5d73('0xf'),auth[_0x5d73('0x7')](),controller[_0x5d73('0x10')]);router[_0x5d73('0x11')](_0x5d73('0xf'),auth[_0x5d73('0x7')](),controller[_0x5d73('0x12')]);module[_0x5d73('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 100c5d5..d645015 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 _0x73f3=['STRING','INTEGER','sequelize','exports'];(function(_0x70e004,_0x47aaf2){var _0x2a034b=function(_0x120667){while(--_0x120667){_0x70e004['push'](_0x70e004['shift']());}};_0x2a034b(++_0x47aaf2);}(_0x73f3,0x66));var _0x373f=function(_0x234c23,_0x2b89f1){_0x234c23=_0x234c23-0x0;var _0x515db7=_0x73f3[_0x234c23];return _0x515db7;};'use strict';var Sequelize=require(_0x373f('0x0'));module[_0x373f('0x1')]={'name':{'type':Sequelize[_0x373f('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x373f('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xa2db=['sequelize','STRING'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0xa2db,0x118));var _0xba2d=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa2db[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0xba2d('0x0'));module['exports']={'name':{'type':Sequelize[_0xba2d('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index a72d5f7..1302c13 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 _0x7096=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','UserProfileResource','find','catch','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set'];(function(_0x36960d,_0x4ae00b){var _0x3bbcc3=function(_0xa166b8){while(--_0xa166b8){_0x36960d['push'](_0x36960d['shift']());}};_0x3bbcc3(++_0x4ae00b);}(_0x7096,0x10c));var _0x6709=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x7096[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['UserProfileResource'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['UserProfileResource'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['UserProfileResource'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['UserProfileResource']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['UserProfileResource'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));};exports[_0x6709('0x4a')]=function(_0x1015e0,_0x55188c){return db['UserProfileResource'][_0x6709('0x4a')]()['then'](respondWithResult(_0x55188c,null))['catch'](handleError(_0x55188c,null));}; \ No newline at end of file +var _0x7880=['destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then'];(function(_0x2526e3,_0x5f22f8){var _0xcf6f48=function(_0x284491){while(--_0x284491){_0x2526e3['push'](_0x2526e3['shift']());}};_0xcf6f48(++_0x5f22f8);}(_0x7880,0x1f4));var _0x0788=function(_0x1c3765,_0xc3b431){_0x1c3765=_0x1c3765-0x0;var _0x3ab003=_0x7880[_0x1c3765];return _0x3ab003;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];function respondWithStatusCode(_0x311729,_0xce4342){_0xce4342=_0xce4342||0xcc;return function(_0x261ebc){if(_0x261ebc){return _0x311729['sendStatus'](_0xce4342);}return _0x311729[_0x0788('0x1a')](_0xce4342)[_0x0788('0x1b')]();};}function respondWithResult(_0x3bdcdf,_0x13cf07){_0x13cf07=_0x13cf07||0xc8;return function(_0x51e5d3){if(_0x51e5d3){return _0x3bdcdf[_0x0788('0x1a')](_0x13cf07)['json'](_0x51e5d3);}};}function respondWithFilteredResult(_0x195f14,_0x170d56){return function(_0x3fd1e4){if(_0x3fd1e4){var _0xb406fb=typeof _0x170d56[_0x0788('0x1c')]===_0x0788('0x1d')&&typeof _0x170d56['limit']==='undefined';var _0x17d805=_0x3fd1e4[_0x0788('0x1e')];var _0x5b2bdc=_0xb406fb?0x0:_0x170d56[_0x0788('0x1c')];var _0x415f19=_0xb406fb?_0x3fd1e4[_0x0788('0x1e')]:_0x170d56['offset']+_0x170d56[_0x0788('0x1f')];var _0x3fb723;if(_0x415f19>=_0x17d805){_0x415f19=_0x17d805;_0x3fb723=0xc8;}else{_0x3fb723=0xce;}_0x195f14['status'](_0x3fb723);return _0x195f14[_0x0788('0x20')]('Content-Range',_0x5b2bdc+'-'+_0x415f19+'/'+_0x17d805)[_0x0788('0x21')](_0x3fd1e4);}return null;};}function patchUpdates(_0x48bc5f){return function(_0x17cca3){try{jsonpatch[_0x0788('0x22')](_0x17cca3,_0x48bc5f,!![]);}catch(_0x18ff22){return BPromise[_0x0788('0x23')](_0x18ff22);}return _0x17cca3[_0x0788('0x24')]();};}function saveUpdates(_0x4f0005,_0x48ec43){return function(_0x2270d4){if(_0x2270d4){return _0x2270d4[_0x0788('0x25')](_0x4f0005)[_0x0788('0x26')](function(_0x7a99a1){return _0x7a99a1;});}return null;};}function removeEntity(_0x5ba1da,_0x4d5c93){return function(_0x79204e){if(_0x79204e){return _0x79204e[_0x0788('0x27')]()[_0x0788('0x26')](function(){_0x5ba1da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x240459,_0xa1f7dc){return function(_0x5f2dda){if(!_0x5f2dda){_0x240459['sendStatus'](0x194);}return _0x5f2dda;};}function handleError(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0x1f4;return function(_0x57fda1){logger[_0x0788('0x28')](_0x57fda1[_0x0788('0x29')]);if(_0x57fda1[_0x0788('0x2a')]){delete _0x57fda1[_0x0788('0x2a')];}_0x5a54a5[_0x0788('0x1a')](_0x44798c)[_0x0788('0x2b')](_0x57fda1);};}exports[_0x0788('0x2c')]=function(_0x3ffe4f,_0x5b7594){var _0x5a5178={},_0x3c5246={},_0x40d345={'count':0x0,'rows':[]};var _0x54979a=_['map'](db[_0x0788('0x2d')][_0x0788('0x2e')],function(_0x20fcd8){return{'name':_0x20fcd8[_0x0788('0x2f')],'type':_0x20fcd8[_0x0788('0x30')][_0x0788('0x31')]};});_0x3c5246[_0x0788('0x32')]=_[_0x0788('0x33')](_0x54979a,_0x0788('0x2a'));_0x3c5246[_0x0788('0x34')]=_['keys'](_0x3ffe4f[_0x0788('0x34')]);_0x3c5246[_0x0788('0x35')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],_0x3c5246[_0x0788('0x34')]);_0x5a5178[_0x0788('0x37')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],qs[_0x0788('0x38')](_0x3ffe4f[_0x0788('0x34')]['fields']));_0x5a5178['attributes']=_0x5a5178['attributes']['length']?_0x5a5178['attributes']:_0x3c5246['model'];if(!_0x3ffe4f[_0x0788('0x34')][_0x0788('0x39')](_0x0788('0x3a'))){_0x5a5178['limit']=qs[_0x0788('0x1f')](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x1f')]);_0x5a5178[_0x0788('0x1c')]=qs['offset'](_0x3ffe4f[_0x0788('0x34')]['offset']);}_0x5a5178[_0x0788('0x3b')]=qs['sort'](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3c')]);_0x5a5178['where']=qs[_0x0788('0x35')](_[_0x0788('0x3d')](_0x3ffe4f['query'],_0x3c5246[_0x0788('0x35')]),_0x54979a);if(_0x3ffe4f['query'][_0x0788('0x3e')]){_0x5a5178['where']=_[_0x0788('0x3f')](_0x5a5178['where'],{'$or':_[_0x0788('0x33')](_0x54979a,function(_0x57fec9){if(_0x57fec9['type']!==_0x0788('0x40')){var _0x68d9d4={};_0x68d9d4[_0x57fec9[_0x0788('0x2a')]]={'$like':'%'+_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3e')]+'%'};return _0x68d9d4;}})});}_0x5a5178=_['merge']({},_0x5a5178,_0x3ffe4f['options']);var _0x530d83={'where':_0x5a5178['where']};return db[_0x0788('0x2d')][_0x0788('0x1e')](_0x530d83)[_0x0788('0x26')](function(_0x358a22){_0x40d345[_0x0788('0x1e')]=_0x358a22;if(_0x3ffe4f['query']['includeAll']){_0x5a5178[_0x0788('0x41')]=[{'all':!![]}];}return db[_0x0788('0x2d')][_0x0788('0x42')](_0x5a5178);})[_0x0788('0x26')](function(_0x236b63){_0x40d345[_0x0788('0x43')]=_0x236b63;return _0x40d345;})[_0x0788('0x26')](respondWithFilteredResult(_0x5b7594,_0x5a5178))[_0x0788('0x44')](handleError(_0x5b7594,null));};exports[_0x0788('0x45')]=function(_0x50e8f5,_0x5581e6){var _0x441aec={'raw':![],'where':{'id':_0x50e8f5[_0x0788('0x46')]['id']}},_0x1d579d={};_0x1d579d['model']=_['keys'](db['UserProfileResource'][_0x0788('0x2e')]);_0x1d579d[_0x0788('0x34')]=_[_0x0788('0x47')](_0x50e8f5[_0x0788('0x34')]);_0x1d579d[_0x0788('0x35')]=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],_0x1d579d[_0x0788('0x34')]);_0x441aec['attributes']=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],qs[_0x0788('0x38')](_0x50e8f5[_0x0788('0x34')]['fields']));_0x441aec[_0x0788('0x37')]=_0x441aec[_0x0788('0x37')]['length']?_0x441aec['attributes']:_0x1d579d['model'];if(_0x50e8f5[_0x0788('0x34')]['includeAll']){_0x441aec[_0x0788('0x41')]=[{'all':!![]}];}_0x441aec=_[_0x0788('0x3f')]({},_0x441aec,_0x50e8f5[_0x0788('0x48')]);return db[_0x0788('0x2d')][_0x0788('0x49')](_0x441aec)[_0x0788('0x26')](handleEntityNotFound(_0x5581e6,null))[_0x0788('0x26')](respondWithResult(_0x5581e6,null))[_0x0788('0x44')](handleError(_0x5581e6,null));};exports['create']=function(_0x4c6366,_0x39c3cc){return db[_0x0788('0x2d')][_0x0788('0x4a')](_0x4c6366['body'],{})[_0x0788('0x26')](respondWithResult(_0x39c3cc,0xc9))[_0x0788('0x44')](handleError(_0x39c3cc,null));};exports[_0x0788('0x25')]=function(_0x4563cd,_0x2395ad){if(_0x4563cd['body']['id']){delete _0x4563cd['body']['id'];}return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x4563cd['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x2395ad,null))['then'](saveUpdates(_0x4563cd[_0x0788('0x4b')],null))[_0x0788('0x26')](respondWithResult(_0x2395ad,null))[_0x0788('0x44')](handleError(_0x2395ad,null));};exports[_0x0788('0x27')]=function(_0x3c757a,_0x379928){return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x3c757a['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x379928,null))[_0x0788('0x26')](removeEntity(_0x379928,null))[_0x0788('0x44')](handleError(_0x379928,null));};exports['describe']=function(_0x1693d0,_0x5d32ae){return db['UserProfileResource'][_0x0788('0x4c')]()[_0x0788('0x26')](respondWithResult(_0x5d32ae,null))[_0x0788('0x44')](handleError(_0x5d32ae,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index b542b70..22f0dc6 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 _0xff4e=['api','bluebird','path','rimraf','./userProfileResource.attributes','define','UserProfileResource','compositeIndex','sectionId','lodash','util','../../config/logger'];(function(_0xa2c0a3,_0x5bbac0){var _0x52c618=function(_0x20f7fd){while(--_0x20f7fd){_0xa2c0a3['push'](_0xa2c0a3['shift']());}};_0x52c618(++_0x5bbac0);}(_0xff4e,0x1b9));var _0xeff4=function(_0x29d87d,_0x23dc31){_0x29d87d=_0x29d87d-0x0;var _0x1fd84b=_0xff4e[_0x29d87d];return _0x1fd84b;};'use strict';var _=require(_0xeff4('0x0'));var util=require(_0xeff4('0x1'));var logger=require(_0xeff4('0x2'))(_0xeff4('0x3'));var moment=require('moment');var BPromise=require(_0xeff4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeff4('0x5'));var rimraf=require(_0xeff4('0x6'));var config=require('../../config/environment');var attributes=require(_0xeff4('0x7'));module['exports']=function(_0x8c7774,_0x53095b){return _0x8c7774[_0xeff4('0x8')](_0xeff4('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xeff4('0xa'),'fields':['resourceId',_0xeff4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb85f=['exports','UserProfileResource','user_profile_has_resources','sectionId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userProfileResource.attributes'];(function(_0x1305e3,_0x43a724){var _0x1068e9=function(_0x1bc555){while(--_0x1bc555){_0x1305e3['push'](_0x1305e3['shift']());}};_0x1068e9(++_0x43a724);}(_0xb85f,0xba));var _0xfb85=function(_0x2274f2,_0x71d568){_0x2274f2=_0x2274f2-0x0;var _0x25fd42=_0xb85f[_0x2274f2];return _0x25fd42;};'use strict';var _=require(_0xfb85('0x0'));var util=require('util');var logger=require(_0xfb85('0x1'))(_0xfb85('0x2'));var moment=require(_0xfb85('0x3'));var BPromise=require(_0xfb85('0x4'));var rp=require(_0xfb85('0x5'));var fs=require('fs');var path=require(_0xfb85('0x6'));var rimraf=require(_0xfb85('0x7'));var config=require('../../config/environment');var attributes=require(_0xfb85('0x8'));module[_0xfb85('0x9')]=function(_0xca7638,_0x3680f8){return _0xca7638['define'](_0xfb85('0xa'),attributes,{'tableName':_0xfb85('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0xfb85('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 755c01e..da3d3ea 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 _0xca02=['../../config/logger','rpc','../../config/environment','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1e668a,_0x3ee7ed){var _0xc5dbb1=function(_0x116bef){while(--_0x116bef){_0x1e668a['push'](_0x1e668a['shift']());}};_0xc5dbb1(++_0x3ee7ed);}(_0xca02,0x1a9));var _0x2ca0=function(_0x4f7460,_0x363c2a){_0x4f7460=_0x4f7460-0x0;var _0x55b1a1=_0xca02[_0x4f7460];return _0x55b1a1;};'use strict';var _=require(_0x2ca0('0x0'));var util=require(_0x2ca0('0x1'));var moment=require(_0x2ca0('0x2'));var BPromise=require(_0x2ca0('0x3'));var rs=require(_0x2ca0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ca0('0x5'))['db'];var utils=require(_0x2ca0('0x6'));var logger=require(_0x2ca0('0x7'))(_0x2ca0('0x8'));var config=require(_0x2ca0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2ca0('0xa')][_0x2ca0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16c1e5,_0xc0b716,_0x53fe8c){return new BPromise(function(_0x1423ac,_0x10386d){return client[_0x2ca0('0xc')](_0x16c1e5,_0x53fe8c)[_0x2ca0('0xd')](function(_0x15dd57){logger['info'](_0x2ca0('0xe'),_0xc0b716,_0x2ca0('0xf'));logger[_0x2ca0('0x10')](_0x2ca0('0x11'),_0xc0b716,'request\x20sent',JSON[_0x2ca0('0x12')](_0x15dd57));if(_0x15dd57[_0x2ca0('0x13')]){if(_0x15dd57['error']['code']===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0xc0b716,_0x15dd57[_0x2ca0('0x13')][_0x2ca0('0x14')]);return _0x10386d(_0x15dd57['error'][_0x2ca0('0x14')]);}logger['error'](_0x2ca0('0xe'),_0xc0b716,_0x15dd57['error'][_0x2ca0('0x14')]);return _0x1423ac(_0x15dd57[_0x2ca0('0x13')]['message']);}else{logger[_0x2ca0('0x15')](_0x2ca0('0xe'),_0xc0b716,_0x2ca0('0xf'));_0x1423ac(_0x15dd57[_0x2ca0('0x16')][_0x2ca0('0x14')]);}})[_0x2ca0('0x17')](function(_0x28bdfb){logger['error'](_0x2ca0('0xe'),_0xc0b716,_0x28bdfb);_0x10386d(_0x28bdfb);});});} \ No newline at end of file +var _0x7ca7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7ca7,0xcf));var _0x77ca=function(_0x3816c2,_0xb221e1){_0x3816c2=_0x3816c2-0x0;var _0x144669=_0x7ca7[_0x3816c2];return _0x144669;};'use strict';var _=require(_0x77ca('0x0'));var util=require('util');var moment=require(_0x77ca('0x1'));var BPromise=require(_0x77ca('0x2'));var rs=require(_0x77ca('0x3'));var fs=require('fs');var Redis=require(_0x77ca('0x4'));var db=require(_0x77ca('0x5'))['db'];var utils=require(_0x77ca('0x6'));var logger=require('../../config/logger')(_0x77ca('0x7'));var config=require('../../config/environment');var jayson=require(_0x77ca('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x121e3a,_0x411929,_0x153a53){return new BPromise(function(_0x51a767,_0x176b04){return client[_0x77ca('0x9')](_0x121e3a,_0x153a53)[_0x77ca('0xa')](function(_0x56e6d4){logger[_0x77ca('0xb')](_0x77ca('0xc'),_0x411929,_0x77ca('0xd'));logger[_0x77ca('0xe')](_0x77ca('0xf'),_0x411929,'request\x20sent',JSON['stringify'](_0x56e6d4));if(_0x56e6d4[_0x77ca('0x10')]){if(_0x56e6d4['error'][_0x77ca('0x11')]===0x1f4){logger[_0x77ca('0x10')](_0x77ca('0xc'),_0x411929,_0x56e6d4['error'][_0x77ca('0x12')]);return _0x176b04(_0x56e6d4['error'][_0x77ca('0x12')]);}logger[_0x77ca('0x10')](_0x77ca('0xc'),_0x411929,_0x56e6d4[_0x77ca('0x10')][_0x77ca('0x12')]);return _0x51a767(_0x56e6d4['error']['message']);}else{logger[_0x77ca('0xb')](_0x77ca('0xc'),_0x411929,_0x77ca('0xd'));_0x51a767(_0x56e6d4['result'][_0x77ca('0x12')]);}})['catch'](function(_0xeeb2a){logger[_0x77ca('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x411929,_0xeeb2a);_0x176b04(_0xeeb2a);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 99d9469..00f16c7 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 _0x6f62=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./userProfileSection.controller','get','index','/describe','describe','isAuthenticated','show'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x6f62,0x1cc));var _0x26f6=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x6f62[_0xce6f11];return _0x35b709;};'use strict';var multer=require(_0x26f6('0x0'));var util=require(_0x26f6('0x1'));var path=require(_0x26f6('0x2'));var timeout=require(_0x26f6('0x3'));var express=require(_0x26f6('0x4'));var router=express[_0x26f6('0x5')]();var fs_extra=require(_0x26f6('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x26f6('0x7'));var controller=require(_0x26f6('0x8'));router[_0x26f6('0x9')]('/',auth['isAuthenticated'](),controller[_0x26f6('0xa')]);router[_0x26f6('0x9')](_0x26f6('0xb'),auth['isAuthenticated'](),controller[_0x26f6('0xc')]);router[_0x26f6('0x9')]('/:id',auth[_0x26f6('0xd')](),controller[_0x26f6('0xe')]);router['post']('/',auth[_0x26f6('0xd')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x26f6('0xf')]);router[_0x26f6('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x26f6('0x11')]);module[_0x26f6('0x12')]=router; \ No newline at end of file +var _0xd5ec=['index','/describe','isAuthenticated','describe','/:id','show','create','update','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x597723,_0x5a0148){var _0x41fd26=function(_0x23b011){while(--_0x23b011){_0x597723['push'](_0x597723['shift']());}};_0x41fd26(++_0x5a0148);}(_0xd5ec,0x127));var _0xcd5e=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0xd5ec[_0x57975f];return _0x4793b8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xcd5e('0x0'));var express=require(_0xcd5e('0x1'));var router=express[_0xcd5e('0x2')]();var fs_extra=require(_0xcd5e('0x3'));var auth=require(_0xcd5e('0x4'));var interaction=require(_0xcd5e('0x5'));var config=require(_0xcd5e('0x6'));var controller=require(_0xcd5e('0x7'));router[_0xcd5e('0x8')]('/',auth['isAuthenticated'](),controller[_0xcd5e('0x9')]);router[_0xcd5e('0x8')](_0xcd5e('0xa'),auth[_0xcd5e('0xb')](),controller[_0xcd5e('0xc')]);router[_0xcd5e('0x8')](_0xcd5e('0xd'),auth['isAuthenticated'](),controller[_0xcd5e('0xe')]);router['post']('/',auth[_0xcd5e('0xb')](),controller[_0xcd5e('0xf')]);router['put'](_0xcd5e('0xd'),auth['isAuthenticated'](),controller[_0xcd5e('0x10')]);router['delete'](_0xcd5e('0xd'),auth[_0xcd5e('0xb')](),controller[_0xcd5e('0x11')]);module[_0xcd5e('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index a052d83..de2142e 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 _0x58a4=['split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x4db473,_0x31dcd5){var _0x24c5db=function(_0xdd9d7f){while(--_0xdd9d7f){_0x4db473['push'](_0x4db473['shift']());}};_0x24c5db(++_0x31dcd5);}(_0x58a4,0xbf));var _0x458a=function(_0x3452a8,_0x4bfaa4){_0x3452a8=_0x3452a8-0x0;var _0x233814=_0x58a4[_0x3452a8];return _0x233814;};'use strict';var Sequelize=require(_0x458a('0x0'));module[_0x458a('0x1')]={'name':{'type':Sequelize[_0x458a('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x458a('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x458a('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x458a('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x458a('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x458a('0x2')],'set':function(_0x362079){this[_0x458a('0x5')](_0x458a('0x6'),_0x362079?_0x362079[_0x458a('0x7')](''):[]);},'get':function(){return this[_0x458a('0x8')]('crudPermissions')?this['getDataValue'](_0x458a('0x6'))[_0x458a('0x9')](''):[];}}}; \ No newline at end of file +var _0x6b20=['getDataValue','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x30317a,_0x12512f){var _0x48b0bd=function(_0x1cbccc){while(--_0x1cbccc){_0x30317a['push'](_0x30317a['shift']());}};_0x48b0bd(++_0x12512f);}(_0x6b20,0xd1));var _0x06b2=function(_0x46996e,_0x55e8b1){_0x46996e=_0x46996e-0x0;var _0x56adb2=_0x6b20[_0x46996e];return _0x56adb2;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x06b2('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x06b2('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x06b2('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x06b2('0x2')],'set':function(_0x5ba392){this[_0x06b2('0x4')](_0x06b2('0x5'),_0x5ba392?_0x5ba392[_0x06b2('0x6')](''):[]);},'get':function(){return this[_0x06b2('0x7')](_0x06b2('0x5'))?this[_0x06b2('0x7')](_0x06b2('0x5'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index fbc3766..1400507 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 _0x05d0=['../../mysqldb','sendStatus','end','status','json','undefined','offset','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','../../config/license/util'];(function(_0x444661,_0x1a5cf9){var _0x57f25e=function(_0x3a28e5){while(--_0x3a28e5){_0x444661['push'](_0x444661['shift']());}};_0x57f25e(++_0x1a5cf9);}(_0x05d0,0x1ee));var _0x005d=function(_0x450e85,_0x4e8804){_0x450e85=_0x450e85-0x0;var _0x3c63f5=_0x05d0[_0x450e85];return _0x3c63f5;};'use strict';var emlformat=require(_0x005d('0x0'));var rimraf=require(_0x005d('0x1'));var zipdir=require(_0x005d('0x2'));var jsonpatch=require(_0x005d('0x3'));var rp=require(_0x005d('0x4'));var moment=require('moment');var BPromise=require(_0x005d('0x5'));var Mustache=require(_0x005d('0x6'));var util=require('util');var path=require(_0x005d('0x7'));var sox=require(_0x005d('0x8'));var csv=require(_0x005d('0x9'));var ejs=require(_0x005d('0xa'));var fs=require('fs');var fs_extra=require(_0x005d('0xb'));var _=require(_0x005d('0xc'));var squel=require(_0x005d('0xd'));var crypto=require(_0x005d('0xe'));var jsforce=require(_0x005d('0xf'));var deskjs=require(_0x005d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x005d('0x11'));var Papa=require(_0x005d('0x12'));var Redis=require(_0x005d('0x13'));var authService=require(_0x005d('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x005d('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x005d('0x16'));var licenseUtil=require(_0x005d('0x17'));var db=require(_0x005d('0x18'))['db'];function respondWithStatusCode(_0x5408e0,_0x3c99d7){_0x3c99d7=_0x3c99d7||0xcc;return function(_0x3eaeb9){if(_0x3eaeb9){return _0x5408e0[_0x005d('0x19')](_0x3c99d7);}return _0x5408e0['status'](_0x3c99d7)[_0x005d('0x1a')]();};}function respondWithResult(_0x26af8b,_0x421d82){_0x421d82=_0x421d82||0xc8;return function(_0x103110){if(_0x103110){return _0x26af8b[_0x005d('0x1b')](_0x421d82)[_0x005d('0x1c')](_0x103110);}};}function respondWithFilteredResult(_0x1232c7,_0x2a07ba){return function(_0x5a5fde){if(_0x5a5fde){var _0x285d54=typeof _0x2a07ba['offset']===_0x005d('0x1d')&&typeof _0x2a07ba['limit']===_0x005d('0x1d');var _0x4dcec2=_0x5a5fde['count'];var _0xf3777a=_0x285d54?0x0:_0x2a07ba[_0x005d('0x1e')];var _0x88a557=_0x285d54?_0x5a5fde[_0x005d('0x1f')]:_0x2a07ba[_0x005d('0x1e')]+_0x2a07ba[_0x005d('0x20')];var _0x5e1ef3;if(_0x88a557>=_0x4dcec2){_0x88a557=_0x4dcec2;_0x5e1ef3=0xc8;}else{_0x5e1ef3=0xce;}_0x1232c7[_0x005d('0x1b')](_0x5e1ef3);return _0x1232c7['set'](_0x005d('0x21'),_0xf3777a+'-'+_0x88a557+'/'+_0x4dcec2)[_0x005d('0x1c')](_0x5a5fde);}return null;};}function patchUpdates(_0x4ca9b5){return function(_0x72d1f){try{jsonpatch[_0x005d('0x22')](_0x72d1f,_0x4ca9b5,!![]);}catch(_0x4b0d0b){return BPromise[_0x005d('0x23')](_0x4b0d0b);}return _0x72d1f['save']();};}function saveUpdates(_0x53b37d,_0xcd27a9){return function(_0x44d62c){if(_0x44d62c){return _0x44d62c[_0x005d('0x24')](_0x53b37d)[_0x005d('0x25')](function(_0x3da1d4){return _0x3da1d4;});}return null;};}function removeEntity(_0x32a419,_0x50ba39){return function(_0x28071e){if(_0x28071e){return _0x28071e[_0x005d('0x26')]()['then'](function(){_0x32a419[_0x005d('0x1b')](0xcc)[_0x005d('0x1a')]();});}};}function handleEntityNotFound(_0x357ba4,_0x3a56b2){return function(_0x3a09ca){if(!_0x3a09ca){_0x357ba4[_0x005d('0x19')](0x194);}return _0x3a09ca;};}function handleError(_0x48d666,_0x11906e){_0x11906e=_0x11906e||0x1f4;return function(_0x377d98){logger[_0x005d('0x27')](_0x377d98[_0x005d('0x28')]);if(_0x377d98[_0x005d('0x29')]){delete _0x377d98[_0x005d('0x29')];}_0x48d666[_0x005d('0x1b')](_0x11906e)[_0x005d('0x2a')](_0x377d98);};}exports['index']=function(_0x431c62,_0x446cc1){var _0x120094={},_0x596fa8={},_0x3aeaa9={'count':0x0,'rows':[]};var _0x4d1b19=_[_0x005d('0x2b')](db[_0x005d('0x2c')][_0x005d('0x2d')],function(_0x5eb8e1){return{'name':_0x5eb8e1[_0x005d('0x2e')],'type':_0x5eb8e1[_0x005d('0x2f')][_0x005d('0x30')]};});_0x596fa8[_0x005d('0x31')]=_[_0x005d('0x2b')](_0x4d1b19,'name');_0x596fa8[_0x005d('0x32')]=_[_0x005d('0x33')](_0x431c62[_0x005d('0x32')]);_0x596fa8['filters']=_[_0x005d('0x34')](_0x596fa8[_0x005d('0x31')],_0x596fa8[_0x005d('0x32')]);_0x120094[_0x005d('0x35')]=_['intersection'](_0x596fa8[_0x005d('0x31')],qs[_0x005d('0x36')](_0x431c62[_0x005d('0x32')][_0x005d('0x36')]));_0x120094[_0x005d('0x35')]=_0x120094['attributes'][_0x005d('0x37')]?_0x120094['attributes']:_0x596fa8['model'];if(!_0x431c62[_0x005d('0x32')]['hasOwnProperty'](_0x005d('0x38'))){_0x120094['limit']=qs[_0x005d('0x20')](_0x431c62['query'][_0x005d('0x20')]);_0x120094[_0x005d('0x1e')]=qs[_0x005d('0x1e')](_0x431c62[_0x005d('0x32')][_0x005d('0x1e')]);}_0x120094[_0x005d('0x39')]=qs['sort'](_0x431c62[_0x005d('0x32')][_0x005d('0x3a')]);_0x120094[_0x005d('0x3b')]=qs[_0x005d('0x3c')](_[_0x005d('0x3d')](_0x431c62[_0x005d('0x32')],_0x596fa8[_0x005d('0x3c')]),_0x4d1b19);if(_0x431c62['query'][_0x005d('0x3e')]){_0x120094['where']=_[_0x005d('0x3f')](_0x120094['where'],{'$or':_[_0x005d('0x2b')](_0x4d1b19,function(_0x463d2d){if(_0x463d2d[_0x005d('0x2f')]!=='VIRTUAL'){var _0x258781={};_0x258781[_0x463d2d[_0x005d('0x29')]]={'$like':'%'+_0x431c62['query']['filter']+'%'};return _0x258781;}})});}_0x120094=_[_0x005d('0x3f')]({},_0x120094,_0x431c62[_0x005d('0x40')]);var _0x23da7f={'where':_0x120094[_0x005d('0x3b')]};return db[_0x005d('0x2c')][_0x005d('0x1f')](_0x23da7f)[_0x005d('0x25')](function(_0x1173cb){_0x3aeaa9[_0x005d('0x1f')]=_0x1173cb;if(_0x431c62[_0x005d('0x32')][_0x005d('0x41')]){_0x120094[_0x005d('0x42')]=[{'all':!![]}];}return db[_0x005d('0x2c')][_0x005d('0x43')](_0x120094);})[_0x005d('0x25')](function(_0x40f955){_0x3aeaa9['rows']=_0x40f955;return _0x3aeaa9;})[_0x005d('0x25')](respondWithFilteredResult(_0x446cc1,_0x120094))[_0x005d('0x44')](handleError(_0x446cc1,null));};exports['show']=function(_0x2a6e72,_0x1ac69a){var _0x5aad03={'raw':![],'where':{'id':_0x2a6e72[_0x005d('0x45')]['id']}},_0x57b376={};_0x57b376[_0x005d('0x31')]=_[_0x005d('0x33')](db[_0x005d('0x2c')][_0x005d('0x2d')]);_0x57b376[_0x005d('0x32')]=_[_0x005d('0x33')](_0x2a6e72[_0x005d('0x32')]);_0x57b376[_0x005d('0x3c')]=_[_0x005d('0x34')](_0x57b376[_0x005d('0x31')],_0x57b376[_0x005d('0x32')]);_0x5aad03[_0x005d('0x35')]=_[_0x005d('0x34')](_0x57b376[_0x005d('0x31')],qs['fields'](_0x2a6e72[_0x005d('0x32')][_0x005d('0x36')]));_0x5aad03[_0x005d('0x35')]=_0x5aad03[_0x005d('0x35')][_0x005d('0x37')]?_0x5aad03['attributes']:_0x57b376['model'];if(_0x2a6e72[_0x005d('0x32')][_0x005d('0x41')]){_0x5aad03[_0x005d('0x42')]=[{'all':!![]}];}_0x5aad03=_[_0x005d('0x3f')]({},_0x5aad03,_0x2a6e72[_0x005d('0x40')]);return db['UserProfileSection'][_0x005d('0x46')](_0x5aad03)['then'](handleEntityNotFound(_0x1ac69a,null))['then'](respondWithResult(_0x1ac69a,null))[_0x005d('0x44')](handleError(_0x1ac69a,null));};exports[_0x005d('0x47')]=function(_0x2d30da,_0x52e159){return db[_0x005d('0x2c')][_0x005d('0x47')](_0x2d30da[_0x005d('0x48')],{})[_0x005d('0x25')](respondWithResult(_0x52e159,0xc9))[_0x005d('0x44')](handleError(_0x52e159,null));};exports['update']=function(_0x33de6b,_0x5bb851){if(_0x33de6b[_0x005d('0x48')]['id']){delete _0x33de6b[_0x005d('0x48')]['id'];}return db[_0x005d('0x2c')][_0x005d('0x46')]({'where':{'id':_0x33de6b[_0x005d('0x45')]['id']}})[_0x005d('0x25')](handleEntityNotFound(_0x5bb851,null))[_0x005d('0x25')](saveUpdates(_0x33de6b[_0x005d('0x48')],null))['then'](respondWithResult(_0x5bb851,null))[_0x005d('0x44')](handleError(_0x5bb851,null));};exports[_0x005d('0x26')]=function(_0x4e37c7,_0x48f89c){return db[_0x005d('0x2c')]['find']({'where':{'id':_0x4e37c7[_0x005d('0x45')]['id']}})['then'](handleEntityNotFound(_0x48f89c,null))['then'](removeEntity(_0x48f89c,null))[_0x005d('0x44')](handleError(_0x48f89c,null));};exports[_0x005d('0x49')]=function(_0x205edd,_0x55dd8e){return db[_0x005d('0x2c')]['describe']()[_0x005d('0x25')](respondWithResult(_0x55dd8e,null))['catch'](handleError(_0x55dd8e,null));}; \ No newline at end of file +var _0x10ef=['hasOwnProperty','offset','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length'];(function(_0x5538c4,_0x3d7977){var _0x4fc838=function(_0x56ac21){while(--_0x56ac21){_0x5538c4['push'](_0x5538c4['shift']());}};_0x4fc838(++_0x3d7977);}(_0x10ef,0x144));var _0xf10e=function(_0x1be1f6,_0x5e7089){_0x1be1f6=_0x1be1f6-0x0;var _0x2bd577=_0x10ef[_0x1be1f6];return _0x2bd577;};'use strict';var emlformat=require(_0xf10e('0x0'));var rimraf=require(_0xf10e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf10e('0x2'));var rp=require(_0xf10e('0x3'));var moment=require(_0xf10e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf10e('0x5'));var util=require('util');var path=require(_0xf10e('0x6'));var sox=require(_0xf10e('0x7'));var csv=require('to-csv');var ejs=require(_0xf10e('0x8'));var fs=require('fs');var fs_extra=require(_0xf10e('0x9'));var _=require(_0xf10e('0xa'));var squel=require(_0xf10e('0xb'));var crypto=require('crypto');var jsforce=require(_0xf10e('0xc'));var deskjs=require(_0xf10e('0xd'));var toCsv=require(_0xf10e('0xe'));var querystring=require('querystring');var Papa=require(_0xf10e('0xf'));var Redis=require('ioredis');var authService=require(_0xf10e('0x10'));var qs=require(_0xf10e('0x11'));var as=require(_0xf10e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf10e('0x13'))(_0xf10e('0x14'));var utils=require(_0xf10e('0x15'));var config=require(_0xf10e('0x16'));var licenseUtil=require(_0xf10e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd3a282,_0x4bd023){_0x4bd023=_0x4bd023||0xcc;return function(_0xdd6262){if(_0xdd6262){return _0xd3a282[_0xf10e('0x18')](_0x4bd023);}return _0xd3a282[_0xf10e('0x19')](_0x4bd023)[_0xf10e('0x1a')]();};}function respondWithResult(_0x23d74c,_0x8fbd91){_0x8fbd91=_0x8fbd91||0xc8;return function(_0xd5c2e5){if(_0xd5c2e5){return _0x23d74c[_0xf10e('0x19')](_0x8fbd91)[_0xf10e('0x1b')](_0xd5c2e5);}};}function respondWithFilteredResult(_0x513f45,_0x715cef){return function(_0x3c4649){if(_0x3c4649){var _0x445b8c=typeof _0x715cef['offset']===_0xf10e('0x1c')&&typeof _0x715cef[_0xf10e('0x1d')]==='undefined';var _0x123cb5=_0x3c4649[_0xf10e('0x1e')];var _0x458751=_0x445b8c?0x0:_0x715cef['offset'];var _0x590d06=_0x445b8c?_0x3c4649[_0xf10e('0x1e')]:_0x715cef['offset']+_0x715cef[_0xf10e('0x1d')];var _0x40ccc9;if(_0x590d06>=_0x123cb5){_0x590d06=_0x123cb5;_0x40ccc9=0xc8;}else{_0x40ccc9=0xce;}_0x513f45[_0xf10e('0x19')](_0x40ccc9);return _0x513f45[_0xf10e('0x1f')](_0xf10e('0x20'),_0x458751+'-'+_0x590d06+'/'+_0x123cb5)[_0xf10e('0x1b')](_0x3c4649);}return null;};}function patchUpdates(_0x5cc5e3){return function(_0xf0428){try{jsonpatch[_0xf10e('0x21')](_0xf0428,_0x5cc5e3,!![]);}catch(_0x285594){return BPromise[_0xf10e('0x22')](_0x285594);}return _0xf0428[_0xf10e('0x23')]();};}function saveUpdates(_0x3ca9b8,_0x2c8a78){return function(_0x5694d7){if(_0x5694d7){return _0x5694d7['update'](_0x3ca9b8)['then'](function(_0x1d7936){return _0x1d7936;});}return null;};}function removeEntity(_0x5802f2,_0x541ec5){return function(_0x4c319a){if(_0x4c319a){return _0x4c319a[_0xf10e('0x24')]()[_0xf10e('0x25')](function(){_0x5802f2[_0xf10e('0x19')](0xcc)[_0xf10e('0x1a')]();});}};}function handleEntityNotFound(_0xc08e1d,_0x56e7df){return function(_0x4c80fa){if(!_0x4c80fa){_0xc08e1d[_0xf10e('0x18')](0x194);}return _0x4c80fa;};}function handleError(_0xfc5dd5,_0x2385c5){_0x2385c5=_0x2385c5||0x1f4;return function(_0x240a6b){logger['error'](_0x240a6b[_0xf10e('0x26')]);if(_0x240a6b[_0xf10e('0x27')]){delete _0x240a6b['name'];}_0xfc5dd5[_0xf10e('0x19')](_0x2385c5)[_0xf10e('0x28')](_0x240a6b);};}exports[_0xf10e('0x29')]=function(_0x50e984,_0x4a3327){var _0x7555d0={},_0x2fb2a7={},_0x4ae8a7={'count':0x0,'rows':[]};var _0x482d63=_[_0xf10e('0x2a')](db[_0xf10e('0x2b')][_0xf10e('0x2c')],function(_0x3129ba){return{'name':_0x3129ba[_0xf10e('0x2d')],'type':_0x3129ba[_0xf10e('0x2e')][_0xf10e('0x2f')]};});_0x2fb2a7[_0xf10e('0x30')]=_[_0xf10e('0x2a')](_0x482d63,'name');_0x2fb2a7[_0xf10e('0x31')]=_[_0xf10e('0x32')](_0x50e984[_0xf10e('0x31')]);_0x2fb2a7[_0xf10e('0x33')]=_['intersection'](_0x2fb2a7[_0xf10e('0x30')],_0x2fb2a7[_0xf10e('0x31')]);_0x7555d0[_0xf10e('0x34')]=_[_0xf10e('0x35')](_0x2fb2a7[_0xf10e('0x30')],qs[_0xf10e('0x36')](_0x50e984['query'][_0xf10e('0x36')]));_0x7555d0[_0xf10e('0x34')]=_0x7555d0['attributes'][_0xf10e('0x37')]?_0x7555d0[_0xf10e('0x34')]:_0x2fb2a7[_0xf10e('0x30')];if(!_0x50e984[_0xf10e('0x31')][_0xf10e('0x38')]('nolimit')){_0x7555d0[_0xf10e('0x1d')]=qs[_0xf10e('0x1d')](_0x50e984[_0xf10e('0x31')]['limit']);_0x7555d0[_0xf10e('0x39')]=qs[_0xf10e('0x39')](_0x50e984['query'][_0xf10e('0x39')]);}_0x7555d0['order']=qs[_0xf10e('0x3a')](_0x50e984['query'][_0xf10e('0x3a')]);_0x7555d0[_0xf10e('0x3b')]=qs[_0xf10e('0x33')](_['pick'](_0x50e984[_0xf10e('0x31')],_0x2fb2a7[_0xf10e('0x33')]),_0x482d63);if(_0x50e984[_0xf10e('0x31')][_0xf10e('0x3c')]){_0x7555d0[_0xf10e('0x3b')]=_[_0xf10e('0x3d')](_0x7555d0['where'],{'$or':_['map'](_0x482d63,function(_0x5be6c2){if(_0x5be6c2['type']!==_0xf10e('0x3e')){var _0x1559d8={};_0x1559d8[_0x5be6c2[_0xf10e('0x27')]]={'$like':'%'+_0x50e984[_0xf10e('0x31')]['filter']+'%'};return _0x1559d8;}})});}_0x7555d0=_['merge']({},_0x7555d0,_0x50e984[_0xf10e('0x3f')]);var _0x5f9387={'where':_0x7555d0[_0xf10e('0x3b')]};return db[_0xf10e('0x2b')][_0xf10e('0x1e')](_0x5f9387)['then'](function(_0x1cd08a){_0x4ae8a7[_0xf10e('0x1e')]=_0x1cd08a;if(_0x50e984[_0xf10e('0x31')]['includeAll']){_0x7555d0[_0xf10e('0x40')]=[{'all':!![]}];}return db[_0xf10e('0x2b')][_0xf10e('0x41')](_0x7555d0);})[_0xf10e('0x25')](function(_0x15b477){_0x4ae8a7[_0xf10e('0x42')]=_0x15b477;return _0x4ae8a7;})[_0xf10e('0x25')](respondWithFilteredResult(_0x4a3327,_0x7555d0))[_0xf10e('0x43')](handleError(_0x4a3327,null));};exports[_0xf10e('0x44')]=function(_0x215e34,_0xde0f27){var _0xb157eb={'raw':![],'where':{'id':_0x215e34[_0xf10e('0x45')]['id']}},_0x560290={};_0x560290[_0xf10e('0x30')]=_['keys'](db[_0xf10e('0x2b')][_0xf10e('0x2c')]);_0x560290[_0xf10e('0x31')]=_['keys'](_0x215e34[_0xf10e('0x31')]);_0x560290['filters']=_[_0xf10e('0x35')](_0x560290[_0xf10e('0x30')],_0x560290[_0xf10e('0x31')]);_0xb157eb[_0xf10e('0x34')]=_['intersection'](_0x560290[_0xf10e('0x30')],qs[_0xf10e('0x36')](_0x215e34['query'][_0xf10e('0x36')]));_0xb157eb[_0xf10e('0x34')]=_0xb157eb[_0xf10e('0x34')]['length']?_0xb157eb['attributes']:_0x560290[_0xf10e('0x30')];if(_0x215e34[_0xf10e('0x31')][_0xf10e('0x46')]){_0xb157eb[_0xf10e('0x40')]=[{'all':!![]}];}_0xb157eb=_[_0xf10e('0x3d')]({},_0xb157eb,_0x215e34[_0xf10e('0x3f')]);return db['UserProfileSection'][_0xf10e('0x47')](_0xb157eb)[_0xf10e('0x25')](handleEntityNotFound(_0xde0f27,null))['then'](respondWithResult(_0xde0f27,null))[_0xf10e('0x43')](handleError(_0xde0f27,null));};exports[_0xf10e('0x48')]=function(_0x567bd4,_0x4a7182){return db[_0xf10e('0x2b')][_0xf10e('0x48')](_0x567bd4[_0xf10e('0x49')],{})[_0xf10e('0x25')](respondWithResult(_0x4a7182,0xc9))[_0xf10e('0x43')](handleError(_0x4a7182,null));};exports[_0xf10e('0x4a')]=function(_0x5026da,_0x5af306){if(_0x5026da[_0xf10e('0x49')]['id']){delete _0x5026da[_0xf10e('0x49')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x5026da[_0xf10e('0x45')]['id']}})['then'](handleEntityNotFound(_0x5af306,null))[_0xf10e('0x25')](saveUpdates(_0x5026da[_0xf10e('0x49')],null))[_0xf10e('0x25')](respondWithResult(_0x5af306,null))[_0xf10e('0x43')](handleError(_0x5af306,null));};exports['destroy']=function(_0x238a4c,_0x226b2e){return db[_0xf10e('0x2b')][_0xf10e('0x47')]({'where':{'id':_0x238a4c['params']['id']}})['then'](handleEntityNotFound(_0x226b2e,null))['then'](removeEntity(_0x226b2e,null))['catch'](handleError(_0x226b2e,null));};exports['describe']=function(_0x59a3ba,_0x256f29){return db[_0xf10e('0x2b')][_0xf10e('0x4b')]()[_0xf10e('0x25')](respondWithResult(_0x256f29,null))[_0xf10e('0x43')](handleError(_0x256f29,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 66c2c7a..aaa8b24 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 _0x5746=['UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports'];(function(_0x5cd3c1,_0x1b629a){var _0x53874d=function(_0x40a4cd){while(--_0x40a4cd){_0x5cd3c1['push'](_0x5cd3c1['shift']());}};_0x53874d(++_0x1b629a);}(_0x5746,0x1f2));var _0x6574=function(_0x40c884,_0x352bd8){_0x40c884=_0x40c884-0x0;var _0x40e0f5=_0x5746[_0x40c884];return _0x40e0f5;};'use strict';var _=require(_0x6574('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6574('0x1'));var moment=require(_0x6574('0x2'));var BPromise=require('bluebird');var rp=require(_0x6574('0x3'));var fs=require('fs');var path=require(_0x6574('0x4'));var rimraf=require(_0x6574('0x5'));var config=require(_0x6574('0x6'));var attributes=require(_0x6574('0x7'));module[_0x6574('0x8')]=function(_0x3b6ba1,_0x31ab50){return _0x3b6ba1['define'](_0x6574('0x9'),attributes,{'tableName':_0x6574('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x6574('0xb'),_0x6574('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc74c=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports'];(function(_0x10a212,_0x579d85){var _0x23c82b=function(_0x412ea9){while(--_0x412ea9){_0x10a212['push'](_0x10a212['shift']());}};_0x23c82b(++_0x579d85);}(_0xc74c,0x163));var _0xcc74=function(_0x11d5e3,_0x3a2727){_0x11d5e3=_0x11d5e3-0x0;var _0x579469=_0xc74c[_0x11d5e3];return _0x579469;};'use strict';var _=require(_0xcc74('0x0'));var util=require(_0xcc74('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcc74('0x2'));var BPromise=require(_0xcc74('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc74('0x4'));var rimraf=require(_0xcc74('0x5'));var config=require(_0xcc74('0x6'));var attributes=require(_0xcc74('0x7'));module[_0xcc74('0x8')]=function(_0x23c249,_0x425b73){return _0x23c249['define'](_0xcc74('0x9'),attributes,{'tableName':_0xcc74('0xa'),'paranoid':![],'indexes':[{'name':_0xcc74('0xb'),'fields':[_0xcc74('0xc'),_0xcc74('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 411ec83..125467d 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 _0x2c70=['../../config/logger','rpc','jayson/promise','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','ioredis'];(function(_0x48fe34,_0x126a26){var _0x298e35=function(_0x5a7c87){while(--_0x5a7c87){_0x48fe34['push'](_0x48fe34['shift']());}};_0x298e35(++_0x126a26);}(_0x2c70,0x19f));var _0x02c7=function(_0x51d5c6,_0xba25f1){_0x51d5c6=_0x51d5c6-0x0;var _0x199158=_0x2c70[_0x51d5c6];return _0x199158;};'use strict';var _=require(_0x02c7('0x0'));var util=require('util');var moment=require(_0x02c7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02c7('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x02c7('0x3'))(_0x02c7('0x4'));var config=require('../../config/environment');var jayson=require(_0x02c7('0x5'));var client=jayson[_0x02c7('0x6')][_0x02c7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2dc1e3,_0x1c124e,_0x44ffca){return new BPromise(function(_0x1b2139,_0x5a11bb){return client[_0x02c7('0x8')](_0x2dc1e3,_0x44ffca)['then'](function(_0x289007){logger[_0x02c7('0x9')](_0x02c7('0xa'),_0x1c124e,_0x02c7('0xb'));logger[_0x02c7('0xc')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x1c124e,'request\x20sent',JSON[_0x02c7('0xd')](_0x289007));if(_0x289007[_0x02c7('0xe')]){if(_0x289007[_0x02c7('0xe')][_0x02c7('0xf')]===0x1f4){logger[_0x02c7('0xe')](_0x02c7('0xa'),_0x1c124e,_0x289007[_0x02c7('0xe')][_0x02c7('0x10')]);return _0x5a11bb(_0x289007[_0x02c7('0xe')][_0x02c7('0x10')]);}logger[_0x02c7('0xe')](_0x02c7('0xa'),_0x1c124e,_0x289007[_0x02c7('0xe')][_0x02c7('0x10')]);return _0x1b2139(_0x289007['error'][_0x02c7('0x10')]);}else{logger[_0x02c7('0x9')](_0x02c7('0xa'),_0x1c124e,_0x02c7('0xb'));_0x1b2139(_0x289007[_0x02c7('0x11')][_0x02c7('0x10')]);}})[_0x02c7('0x12')](function(_0x508994){logger['error'](_0x02c7('0xa'),_0x1c124e,_0x508994);_0x5a11bb(_0x508994);});});} \ No newline at end of file +var _0x4eb7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring'];(function(_0x1a165f,_0xaf7889){var _0x17d3ae=function(_0x392130){while(--_0x392130){_0x1a165f['push'](_0x1a165f['shift']());}};_0x17d3ae(++_0xaf7889);}(_0x4eb7,0x183));var _0x74eb=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x4eb7[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0x74eb('0x0'));var util=require(_0x74eb('0x1'));var moment=require(_0x74eb('0x2'));var BPromise=require('bluebird');var rs=require(_0x74eb('0x3'));var fs=require('fs');var Redis=require(_0x74eb('0x4'));var db=require(_0x74eb('0x5'))['db'];var utils=require(_0x74eb('0x6'));var logger=require(_0x74eb('0x7'))(_0x74eb('0x8'));var config=require(_0x74eb('0x9'));var jayson=require(_0x74eb('0xa'));var client=jayson[_0x74eb('0xb')][_0x74eb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2efb67,_0x211086,_0x572866){return new BPromise(function(_0x970bb,_0x354212){return client[_0x74eb('0xd')](_0x2efb67,_0x572866)['then'](function(_0x4b6e7f){logger[_0x74eb('0xe')](_0x74eb('0xf'),_0x211086,_0x74eb('0x10'));logger['debug'](_0x74eb('0x11'),_0x211086,_0x74eb('0x10'),JSON[_0x74eb('0x12')](_0x4b6e7f));if(_0x4b6e7f[_0x74eb('0x13')]){if(_0x4b6e7f['error'][_0x74eb('0x14')]===0x1f4){logger[_0x74eb('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x211086,_0x4b6e7f['error'][_0x74eb('0x15')]);return _0x354212(_0x4b6e7f[_0x74eb('0x13')]['message']);}logger['error'](_0x74eb('0xf'),_0x211086,_0x4b6e7f[_0x74eb('0x13')][_0x74eb('0x15')]);return _0x970bb(_0x4b6e7f[_0x74eb('0x13')][_0x74eb('0x15')]);}else{logger['info'](_0x74eb('0xf'),_0x211086,'request\x20sent');_0x970bb(_0x4b6e7f[_0x74eb('0x16')][_0x74eb('0x15')]);}})['catch'](function(_0x3c9348){logger['error'](_0x74eb('0xf'),_0x211086,_0x3c9348);_0x354212(_0x3c9348);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 4914024..e9e3b78 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x36fa51,_0x55ad58){var _0x337877=function(_0xfde693){while(--_0xfde693){_0x36fa51['push'](_0x36fa51['shift']());}};_0x337877(++_0x55ad58);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x293007,_0x126511){var _0x23e2b6=function(_0x4d634){while(--_0x4d634){_0x293007['push'](_0x293007['shift']());}};_0x23e2b6(++_0x126511);}(_0x70e0,0x17b));var _0x070e=function(_0x1ec11d,_0x34e506){_0x1ec11d=_0x1ec11d-0x0;var _0xcc8886=_0x70e0[_0x1ec11d];return _0xcc8886;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 4fba7f8..0c8238c 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 _0x0631=['INTEGER','sequelize'];(function(_0x30cc9c,_0x168f6b){var _0x4d9280=function(_0x3e2f63){while(--_0x3e2f63){_0x30cc9c['push'](_0x30cc9c['shift']());}};_0x4d9280(++_0x168f6b);}(_0x0631,0xcd));var _0x1063=function(_0x266ad8,_0x45346d){_0x266ad8=_0x266ad8-0x0;var _0x45b7de=_0x0631[_0x266ad8];return _0x45b7de;};'use strict';var Sequelize=require(_0x1063('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1063('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8f19=['sequelize'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x8f19,0x98));var _0x98f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f19[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x98f1('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index f4ef8ec..f47661a 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 _0x9a5a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x9a5a,0x194));var _0xa9a5=function(_0x117c26,_0x1479cc){_0x117c26=_0x117c26-0x0;var _0x137b87=_0x9a5a[_0x117c26];return _0x137b87;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var logger=require(_0xa9a5('0x2'))(_0xa9a5('0x3'));var moment=require(_0xa9a5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9a5('0x5'));var fs=require('fs');var path=require(_0xa9a5('0x6'));var rimraf=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var attributes=require(_0xa9a5('0x9'));module[_0xa9a5('0xa')]=function(_0x4a73f4,_0xb0ccd9){return _0x4a73f4[_0xa9a5('0xb')](_0xa9a5('0xc'),attributes,{'tableName':_0xa9a5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue','lodash','util','../../config/logger','api','moment'];(function(_0x1a7357,_0x494c71){var _0x138419=function(_0x4e4f37){while(--_0x4e4f37){_0x1a7357['push'](_0x1a7357['shift']());}};_0x138419(++_0x494c71);}(_0x53ec,0x192));var _0xc53e=function(_0x19776e,_0x3690de){_0x19776e=_0x19776e-0x0;var _0xce4b5f=_0x53ec[_0x19776e];return _0xce4b5f;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'user_has_sms_queues','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 121bc80..2ac058c 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 _0xbe7c=['code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x49778a,_0x2a0b51){var _0x5daa0f=function(_0x26c47a){while(--_0x26c47a){_0x49778a['push'](_0x49778a['shift']());}};_0x5daa0f(++_0x2a0b51);}(_0xbe7c,0x18c));var _0xcbe7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbe7c[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xcbe7('0x0'));var moment=require(_0xcbe7('0x1'));var BPromise=require(_0xcbe7('0x2'));var rs=require(_0xcbe7('0x3'));var fs=require('fs');var Redis=require(_0xcbe7('0x4'));var db=require(_0xcbe7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbe7('0x6'))(_0xcbe7('0x7'));var config=require(_0xcbe7('0x8'));var jayson=require(_0xcbe7('0x9'));var client=jayson[_0xcbe7('0xa')][_0xcbe7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa28467,_0x28be8c,_0x25b1d6){return new BPromise(function(_0x2575d2,_0x3c8223){return client['request'](_0xa28467,_0x25b1d6)[_0xcbe7('0xc')](function(_0x3e8357){logger['info'](_0xcbe7('0xd'),_0x28be8c,_0xcbe7('0xe'));logger[_0xcbe7('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x28be8c,'request\x20sent',JSON[_0xcbe7('0x10')](_0x3e8357));if(_0x3e8357[_0xcbe7('0x11')]){if(_0x3e8357['error'][_0xcbe7('0x12')]===0x1f4){logger['error'](_0xcbe7('0xd'),_0x28be8c,_0x3e8357['error'][_0xcbe7('0x13')]);return _0x3c8223(_0x3e8357['error'][_0xcbe7('0x13')]);}logger['error'](_0xcbe7('0xd'),_0x28be8c,_0x3e8357[_0xcbe7('0x11')][_0xcbe7('0x13')]);return _0x2575d2(_0x3e8357['error'][_0xcbe7('0x13')]);}else{logger[_0xcbe7('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x28be8c,_0xcbe7('0xe'));_0x2575d2(_0x3e8357[_0xcbe7('0x15')][_0xcbe7('0x13')]);}})[_0xcbe7('0x16')](function(_0x58dd37){logger[_0xcbe7('0x11')](_0xcbe7('0xd'),_0x28be8c,_0x58dd37);_0x3c8223(_0x58dd37);});});} \ No newline at end of file +var _0x3775=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x352607,_0x6ac8fa){var _0x5fd4fa=function(_0x16cd1d){while(--_0x16cd1d){_0x352607['push'](_0x352607['shift']());}};_0x5fd4fa(++_0x6ac8fa);}(_0x3775,0x173));var _0x5377=function(_0xadd24b,_0x599a47){_0xadd24b=_0xadd24b-0x0;var _0x78d99b=_0x3775[_0xadd24b];return _0x78d99b;};'use strict';var _=require(_0x5377('0x0'));var util=require('util');var moment=require(_0x5377('0x1'));var BPromise=require(_0x5377('0x2'));var rs=require(_0x5377('0x3'));var fs=require('fs');var Redis=require(_0x5377('0x4'));var db=require(_0x5377('0x5'))['db'];var utils=require(_0x5377('0x6'));var logger=require(_0x5377('0x7'))(_0x5377('0x8'));var config=require(_0x5377('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5377('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x508c20,_0x269851,_0x456253){return new BPromise(function(_0x4c7856,_0x4033b3){return client[_0x5377('0xb')](_0x508c20,_0x456253)['then'](function(_0x4f95ae){logger[_0x5377('0xc')](_0x5377('0xd'),_0x269851,_0x5377('0xe'));logger[_0x5377('0xf')](_0x5377('0x10'),_0x269851,_0x5377('0xe'),JSON[_0x5377('0x11')](_0x4f95ae));if(_0x4f95ae[_0x5377('0x12')]){if(_0x4f95ae[_0x5377('0x12')][_0x5377('0x13')]===0x1f4){logger['error'](_0x5377('0xd'),_0x269851,_0x4f95ae['error'][_0x5377('0x14')]);return _0x4033b3(_0x4f95ae['error'][_0x5377('0x14')]);}logger[_0x5377('0x12')](_0x5377('0xd'),_0x269851,_0x4f95ae[_0x5377('0x12')][_0x5377('0x14')]);return _0x4c7856(_0x4f95ae[_0x5377('0x12')][_0x5377('0x14')]);}else{logger[_0x5377('0xc')](_0x5377('0xd'),_0x269851,'request\x20sent');_0x4c7856(_0x4f95ae[_0x5377('0x15')][_0x5377('0x14')]);}})[_0x5377('0x16')](function(_0x5d645f){logger[_0x5377('0x12')](_0x5377('0xd'),_0x269851,_0x5d645f);_0x4033b3(_0x5d645f);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 72a6110..43c8e29 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 _0x25ed=['sequelize','exports','INTEGER'];(function(_0x365170,_0x3d7a5d){var _0x18bac3=function(_0x1f19d8){while(--_0x1f19d8){_0x365170['push'](_0x365170['shift']());}};_0x18bac3(++_0x3d7a5d);}(_0x25ed,0x14a));var _0xd25e=function(_0x4eb0b1,_0x1621ac){_0x4eb0b1=_0x4eb0b1-0x0;var _0x1b58bd=_0x25ed[_0x4eb0b1];return _0x1b58bd;};'use strict';var Sequelize=require(_0xd25e('0x0'));module[_0xd25e('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xd25e('0x2')]}}; \ No newline at end of file +var _0xe0c6=['exports','INTEGER','sequelize'];(function(_0x8d8b6b,_0x23a601){var _0x149b54=function(_0xbf68ad){while(--_0xbf68ad){_0x8d8b6b['push'](_0x8d8b6b['shift']());}};_0x149b54(++_0x23a601);}(_0xe0c6,0x17c));var _0x6e0c=function(_0x33fc53,_0x40b3bf){_0x33fc53=_0x33fc53-0x0;var _0x1c36f8=_0xe0c6[_0x33fc53];return _0x1c36f8;};'use strict';var Sequelize=require(_0x6e0c('0x0'));module[_0x6e0c('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x6e0c('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 3c29eec..e9abf8d 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(_0x3a4143,_0x111446){var _0x368420=function(_0xd49847){while(--_0xd49847){_0x3a4143['push'](_0x3a4143['shift']());}};_0x368420(++_0x111446);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x510465,_0x1aac20){var _0x1584fa=function(_0x18fcd7){while(--_0x18fcd7){_0x510465['push'](_0x510465['shift']());}};_0x1584fa(++_0x1aac20);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 20d6c7e..2949377 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(_0x573f69,_0x2129c7){var _0x54b9a7=function(_0x76dfdc){while(--_0x76dfdc){_0x573f69['push'](_0x573f69['shift']());}};_0x54b9a7(++_0x2129c7);}(_0x70e0,0x17b));var _0x070e=function(_0x5cbe38,_0x5badcb){_0x5cbe38=_0x5cbe38-0x0;var _0x4cc3d8=_0x70e0[_0x5cbe38];return _0x4cc3d8;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x213980,_0x12e968){var _0x4ad801=function(_0x2f150d){while(--_0x2f150d){_0x213980['push'](_0x213980['shift']());}};_0x4ad801(++_0x12e968);}(_0x70e0,0x17b));var _0x070e=function(_0x3d4571,_0x1fac2f){_0x3d4571=_0x3d4571-0x0;var _0x172644=_0x70e0[_0x3d4571];return _0x172644;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index c8efb18..2680e8d 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 _0xd928=['exports'];(function(_0x275d85,_0x5a883e){var _0x3cd754=function(_0x209dee){while(--_0x209dee){_0x275d85['push'](_0x275d85['shift']());}};_0x3cd754(++_0x5a883e);}(_0xd928,0x85));var _0x8d92=function(_0x398bd9,_0x2a8369){_0x398bd9=_0x398bd9-0x0;var _0x1ac39c=_0xd928[_0x398bd9];return _0x1ac39c;};'use strict';var Sequelize=require('sequelize');module[_0x8d92('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xaf70=['sequelize','exports'];(function(_0x41a787,_0x1f22e1){var _0x5f392c=function(_0x25fdd2){while(--_0x25fdd2){_0x41a787['push'](_0x41a787['shift']());}};_0x5f392c(++_0x1f22e1);}(_0xaf70,0x17a));var _0x0af7=function(_0xb6e85f,_0x34683b){_0xb6e85f=_0xb6e85f-0x0;var _0x3697a0=_0xaf70[_0xb6e85f];return _0x3697a0;};'use strict';var Sequelize=require(_0x0af7('0x0'));module[_0x0af7('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 35898c9..ba23bce 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 _0x1771=['../../config/logger','api','bluebird','request-promise','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util'];(function(_0x1fef62,_0x2e27b9){var _0x54362e=function(_0x4af409){while(--_0x4af409){_0x1fef62['push'](_0x1fef62['shift']());}};_0x54362e(++_0x2e27b9);}(_0x1771,0x166));var _0x1177=function(_0x7756ab,_0x9d1050){_0x7756ab=_0x7756ab-0x0;var _0x405c4d=_0x1771[_0x7756ab];return _0x405c4d;};'use strict';var _=require(_0x1177('0x0'));var util=require(_0x1177('0x1'));var logger=require(_0x1177('0x2'))(_0x1177('0x3'));var moment=require('moment');var BPromise=require(_0x1177('0x4'));var rp=require(_0x1177('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1177('0x6'));module[_0x1177('0x7')]=function(_0x5629fe,_0x16f20a){return _0x5629fe['define'](_0x1177('0x8'),attributes,{'tableName':_0x1177('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0c7=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','lodash'];(function(_0x212a69,_0x4a4a67){var _0xe24b7f=function(_0x5778f8){while(--_0x5778f8){_0x212a69['push'](_0x212a69['shift']());}};_0xe24b7f(++_0x4a4a67);}(_0xd0c7,0x167));var _0x7d0c=function(_0xbd8fd5,_0x1020e9){_0xbd8fd5=_0xbd8fd5-0x0;var _0x37a06e=_0xd0c7[_0xbd8fd5];return _0x37a06e;};'use strict';var _=require(_0x7d0c('0x0'));var util=require(_0x7d0c('0x1'));var logger=require(_0x7d0c('0x2'))(_0x7d0c('0x3'));var moment=require(_0x7d0c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7d0c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d0c('0x6'));var config=require(_0x7d0c('0x7'));var attributes=require(_0x7d0c('0x8'));module[_0x7d0c('0x9')]=function(_0x31c226,_0x2753e2){return _0x31c226[_0x7d0c('0xa')]('UserVoiceQueue',attributes,{'tableName':_0x7d0c('0xb'),'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 8364a89..9c389de 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 _0x5e22=['http','request','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x3dbbb7,_0x9f32b8){var _0x1cf503=function(_0x3e4605){while(--_0x3e4605){_0x3dbbb7['push'](_0x3dbbb7['shift']());}};_0x1cf503(++_0x9f32b8);}(_0x5e22,0x1b0));var _0x25e2=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x5e22[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x25e2('0x0'));var util=require(_0x25e2('0x1'));var moment=require(_0x25e2('0x2'));var BPromise=require('bluebird');var rs=require(_0x25e2('0x3'));var fs=require('fs');var Redis=require(_0x25e2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x25e2('0x5'));var logger=require(_0x25e2('0x6'))(_0x25e2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25e2('0x8')][_0x25e2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x120b0b,_0x1d840a,_0x58d1c8){return new BPromise(function(_0x3ecd00,_0x5f0de2){return client[_0x25e2('0xa')](_0x120b0b,_0x58d1c8)['then'](function(_0x1acf58){logger['info'](_0x25e2('0xb'),_0x1d840a,_0x25e2('0xc'));logger[_0x25e2('0xd')](_0x25e2('0xe'),_0x1d840a,_0x25e2('0xc'),JSON[_0x25e2('0xf')](_0x1acf58));if(_0x1acf58[_0x25e2('0x10')]){if(_0x1acf58[_0x25e2('0x10')][_0x25e2('0x11')]===0x1f4){logger[_0x25e2('0x10')](_0x25e2('0xb'),_0x1d840a,_0x1acf58[_0x25e2('0x10')][_0x25e2('0x12')]);return _0x5f0de2(_0x1acf58[_0x25e2('0x10')][_0x25e2('0x12')]);}logger[_0x25e2('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x1d840a,_0x1acf58[_0x25e2('0x10')][_0x25e2('0x12')]);return _0x3ecd00(_0x1acf58[_0x25e2('0x10')][_0x25e2('0x12')]);}else{logger['info'](_0x25e2('0xb'),_0x1d840a,_0x25e2('0xc'));_0x3ecd00(_0x1acf58[_0x25e2('0x13')][_0x25e2('0x12')]);}})[_0x25e2('0x14')](function(_0x59c52e){logger[_0x25e2('0x10')](_0x25e2('0xb'),_0x1d840a,_0x59c52e);_0x5f0de2(_0x59c52e);});});} \ No newline at end of file +var _0x9fd2=['info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x175870,_0x538eb6){var _0x2b6bd9=function(_0x5990bc){while(--_0x5990bc){_0x175870['push'](_0x175870['shift']());}};_0x2b6bd9(++_0x538eb6);}(_0x9fd2,0xb3));var _0x29fd=function(_0x510efe,_0x11f9ad){_0x510efe=_0x510efe-0x0;var _0xfb0a7c=_0x9fd2[_0x510efe];return _0xfb0a7c;};'use strict';var _=require('lodash');var util=require(_0x29fd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x29fd('0x1'));var fs=require('fs');var Redis=require(_0x29fd('0x2'));var db=require(_0x29fd('0x3'))['db'];var utils=require(_0x29fd('0x4'));var logger=require(_0x29fd('0x5'))(_0x29fd('0x6'));var config=require(_0x29fd('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x29fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x589375,_0x41d2ac,_0x27a4f1){return new BPromise(function(_0x3a1568,_0x3c944e){return client[_0x29fd('0x9')](_0x589375,_0x27a4f1)['then'](function(_0x535a2d){logger[_0x29fd('0xa')](_0x29fd('0xb'),_0x41d2ac,_0x29fd('0xc'));logger[_0x29fd('0xd')](_0x29fd('0xe'),_0x41d2ac,_0x29fd('0xc'),JSON[_0x29fd('0xf')](_0x535a2d));if(_0x535a2d['error']){if(_0x535a2d['error'][_0x29fd('0x10')]===0x1f4){logger[_0x29fd('0x11')](_0x29fd('0xb'),_0x41d2ac,_0x535a2d['error'][_0x29fd('0x12')]);return _0x3c944e(_0x535a2d[_0x29fd('0x11')][_0x29fd('0x12')]);}logger[_0x29fd('0x11')](_0x29fd('0xb'),_0x41d2ac,_0x535a2d['error'][_0x29fd('0x12')]);return _0x3a1568(_0x535a2d[_0x29fd('0x11')][_0x29fd('0x12')]);}else{logger[_0x29fd('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x41d2ac,_0x29fd('0xc'));_0x3a1568(_0x535a2d[_0x29fd('0x13')][_0x29fd('0x12')]);}})[_0x29fd('0x14')](function(_0x2d175c){logger[_0x29fd('0x11')](_0x29fd('0xb'),_0x41d2ac,_0x2d175c);_0x3c944e(_0x2d175c);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 4342281..91d2171 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(_0x4f62c2,_0x3a089d){var _0x1e0e37=function(_0x4ce49d){while(--_0x4ce49d){_0x4f62c2['push'](_0x4f62c2['shift']());}};_0x1e0e37(++_0x3a089d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4406c5,_0x4a1ace){var _0xd56512=function(_0x5cd143){while(--_0x5cd143){_0x4406c5['push'](_0x4406c5['shift']());}};_0xd56512(++_0x4a1ace);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 27e6c8e..92b5d41 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 _0x1c6d=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x588466,_0x1b1bfa){var _0x596ec0=function(_0x495acf){while(--_0x495acf){_0x588466['push'](_0x588466['shift']());}};_0x596ec0(++_0x1b1bfa);}(_0x1c6d,0xff));var _0xd1c6=function(_0x45be52,_0x46d496){_0x45be52=_0x45be52-0x0;var _0x15294f=_0x1c6d[_0x45be52];return _0x15294f;};'use strict';var Sequelize=require('sequelize');module[_0xd1c6('0x0')]={'uniqueid':{'type':Sequelize[_0xd1c6('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xd1c6('0x2')},'membername':{'type':Sequelize[_0xd1c6('0x3')],'allowNull':![],'comment':_0xd1c6('0x2')},'UserId':{'type':Sequelize[_0xd1c6('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xd1c6('0x3')],'allowNull':![],'unique':_0xd1c6('0x4'),'comment':_0xd1c6('0x2')},'VoiceQueueId':{'type':Sequelize[_0xd1c6('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xd1c6('0x2')},'penalty':{'type':Sequelize[_0xd1c6('0x1')](0xb),'defaultValue':0x0,'comment':_0xd1c6('0x2')},'paused':{'type':Sequelize[_0xd1c6('0x1')](0xb),'defaultValue':0x0,'comment':_0xd1c6('0x2')}}; \ No newline at end of file +var _0xa39b=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','exports'];(function(_0x45a263,_0x2c0be7){var _0x337fe2=function(_0x2f1b46){while(--_0x2f1b46){_0x45a263['push'](_0x45a263['shift']());}};_0x337fe2(++_0x2c0be7);}(_0xa39b,0xf4));var _0xba39=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa39b[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module[_0xba39('0x0')]={'uniqueid':{'type':Sequelize[_0xba39('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xba39('0x2')},'membername':{'type':Sequelize[_0xba39('0x3')],'allowNull':![],'comment':_0xba39('0x2')},'UserId':{'type':Sequelize[_0xba39('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xba39('0x3')],'allowNull':![],'unique':_0xba39('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xba39('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xba39('0x2')},'penalty':{'type':Sequelize[_0xba39('0x1')](0xb),'defaultValue':0x0,'comment':_0xba39('0x2')},'paused':{'type':Sequelize[_0xba39('0x1')](0xb),'defaultValue':0x0,'comment':_0xba39('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index d9daa52..f19aa62 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 _0xc709=['save','update','emit','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x40782f,_0x3be4e0){var _0x48542b=function(_0x51042e){while(--_0x51042e){_0x40782f['push'](_0x40782f['shift']());}};_0x48542b(++_0x3be4e0);}(_0xc709,0x1e2));var _0x9c70=function(_0x2181b1,_0x569637){_0x2181b1=_0x2181b1-0x0;var _0x530548=_0xc709[_0x2181b1];return _0x530548;};'use strict';var EventEmitter=require(_0x9c70('0x0'));var UserVoiceQueueRt=require(_0x9c70('0x1'))['db'][_0x9c70('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9c70('0x3')](0x0);var events={'afterCreate':_0x9c70('0x4'),'afterUpdate':_0x9c70('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4fcc1c){return function(_0x595b31,_0x3654c6,_0x41b3f6){UserVoiceQueueRtEvents[_0x9c70('0x6')](_0x4fcc1c+':'+_0x595b31['id'],_0x595b31);UserVoiceQueueRtEvents[_0x9c70('0x6')](_0x4fcc1c,_0x595b31);_0x41b3f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x9c70('0x7')](e,emitEvent(event));}}module[_0x9c70('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x49f8=['hasOwnProperty','hook','events','UserVoiceQueueRt','update','emit'];(function(_0x5d8f,_0x14d9d3){var _0x252a50=function(_0x4b65e7){while(--_0x4b65e7){_0x5d8f['push'](_0x5d8f['shift']());}};_0x252a50(++_0x14d9d3);}(_0x49f8,0x158));var _0x849f=function(_0x5c0cf4,_0x265aa9){_0x5c0cf4=_0x5c0cf4-0x0;var _0x3d9f50=_0x49f8[_0x5c0cf4];return _0x3d9f50;};'use strict';var EventEmitter=require(_0x849f('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x849f('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x849f('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1e2add){return function(_0x5004a5,_0x268272,_0x3dc48f){UserVoiceQueueRtEvents[_0x849f('0x3')](_0x1e2add+':'+_0x5004a5['id'],_0x5004a5);UserVoiceQueueRtEvents[_0x849f('0x3')](_0x1e2add,_0x5004a5);_0x3dc48f(null);};}for(var e in events){if(events[_0x849f('0x4')](e)){var event=events[e];UserVoiceQueueRt[_0x849f('0x5')](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 3e7c0a4..d370b09 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 _0x21c7=['../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x21c7,0x17a));var _0x721c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21c7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x721c('0x0'));var logger=require(_0x721c('0x1'))(_0x721c('0x2'));var moment=require(_0x721c('0x3'));var BPromise=require(_0x721c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x721c('0x5'));var rimraf=require('rimraf');var config=require(_0x721c('0x6'));var attributes=require(_0x721c('0x7'));module[_0x721c('0x8')]=function(_0x395477,_0x523768){return _0x395477[_0x721c('0x9')](_0x721c('0xa'),attributes,{'tableName':_0x721c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x076c=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x44a2bd,_0x411814){var _0x4195c1=function(_0x307ffa){while(--_0x307ffa){_0x44a2bd['push'](_0x44a2bd['shift']());}};_0x4195c1(++_0x411814);}(_0x076c,0x157));var _0xc076=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0x076c[_0x22377a];return _0x36f105;};'use strict';var _=require(_0xc076('0x0'));var util=require(_0xc076('0x1'));var logger=require(_0xc076('0x2'))(_0xc076('0x3'));var moment=require(_0xc076('0x4'));var BPromise=require(_0xc076('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc076('0x6'));var rimraf=require('rimraf');var config=require(_0xc076('0x7'));var attributes=require(_0xc076('0x8'));module[_0xc076('0x9')]=function(_0x181db7,_0x2e9d0a){return _0x181db7[_0xc076('0xa')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index e5786e2..7bc6446 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 _0x0923=['`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0x0923,0x1bf));var _0x3092=function(_0xe91089,_0x387f2c){_0xe91089=_0xe91089-0x0;var _0x103491=_0x0923[_0xe91089];return _0x103491;};'use strict';var _=require(_0x3092('0x0'));var util=require(_0x3092('0x1'));var moment=require(_0x3092('0x2'));var BPromise=require(_0x3092('0x3'));var rs=require(_0x3092('0x4'));var fs=require('fs');var Redis=require(_0x3092('0x5'));var db=require(_0x3092('0x6'))['db'];var utils=require(_0x3092('0x7'));var logger=require(_0x3092('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3092('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x3092('0xa')]=_[_0x3092('0xb')](config[_0x3092('0xa')],{'host':_0x3092('0xc'),'port':0x18eb});var socket=require(_0x3092('0xd'))(new Redis(config['redis']));require(_0x3092('0xe'))['register'](socket);function respondWithRpcPromise(_0x3744eb,_0x358e9f,_0x70fd44){return new BPromise(function(_0x172e1e,_0x2a2956){return client[_0x3092('0xf')](_0x3744eb,_0x70fd44)[_0x3092('0x10')](function(_0x20ab70){logger[_0x3092('0x11')](_0x3092('0x12'),_0x358e9f,_0x3092('0x13'));logger['debug'](_0x3092('0x14'),_0x358e9f,_0x3092('0x13'),JSON[_0x3092('0x15')](_0x20ab70));if(_0x20ab70[_0x3092('0x16')]){if(_0x20ab70['error'][_0x3092('0x17')]===0x1f4){logger[_0x3092('0x16')](_0x3092('0x12'),_0x358e9f,_0x20ab70['error'][_0x3092('0x18')]);return _0x2a2956(_0x20ab70['error']['message']);}logger[_0x3092('0x16')](_0x3092('0x12'),_0x358e9f,_0x20ab70[_0x3092('0x16')][_0x3092('0x18')]);return _0x172e1e(_0x20ab70['error'][_0x3092('0x18')]);}else{logger[_0x3092('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x358e9f,_0x3092('0x13'));_0x172e1e(_0x20ab70[_0x3092('0x19')][_0x3092('0x18')]);}})[_0x3092('0x1a')](function(_0xcaa4f2){logger['error'](_0x3092('0x12'),_0x358e9f,_0xcaa4f2);_0x2a2956(_0xcaa4f2);});});}exports[_0x3092('0x1b')]=function(_0x14a699){var _0x554f7d=this;return new Promise(function(_0x21b24f,_0xe9631f){return db[_0x3092('0x1c')][_0x3092('0x1d')]({'raw':_0x14a699[_0x3092('0x1e')]?_0x14a699[_0x3092('0x1e')][_0x3092('0x1f')]===undefined?!![]:![]:!![],'where':_0x14a699['options']?_0x14a699['options'][_0x3092('0x20')]||null:null,'attributes':[[db[_0x3092('0x21')]['fn']('COUNT',db[_0x3092('0x21')]['fn']('IF',db[_0x3092('0x21')]['literal'](_0x3092('0x22')))),_0x3092('0x23')]]})[_0x3092('0x10')](function(_0x59b395){logger[_0x3092('0x11')](_0x3092('0x1b'),_0x14a699);logger[_0x3092('0x24')](_0x3092('0x1b'),_0x14a699,JSON[_0x3092('0x15')](_0x59b395));_0x21b24f(_0x59b395);})[_0x3092('0x1a')](function(_0xd15cea){logger[_0x3092('0x16')](_0x3092('0x1b'),_0xd15cea[_0x3092('0x18')],_0x14a699);_0xe9631f(_0x554f7d[_0x3092('0x16')](0x1f4,_0xd15cea[_0x3092('0x18')]));});});}; \ No newline at end of file +var _0x42aa=['debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','redis','defaults','localhost','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent'];(function(_0x267ace,_0x4e39f4){var _0x89a2c6=function(_0x2c1030){while(--_0x2c1030){_0x267ace['push'](_0x267ace['shift']());}};_0x89a2c6(++_0x4e39f4);}(_0x42aa,0x14e));var _0xa42a=function(_0x1eb6e0,_0x471f54){_0x1eb6e0=_0x1eb6e0-0x0;var _0x3d98ec=_0x42aa[_0x1eb6e0];return _0x3d98ec;};'use strict';var _=require(_0xa42a('0x0'));var util=require(_0xa42a('0x1'));var moment=require(_0xa42a('0x2'));var BPromise=require('bluebird');var rs=require(_0xa42a('0x3'));var fs=require('fs');var Redis=require(_0xa42a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa42a('0x5'));var logger=require('../../config/logger')(_0xa42a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xa42a('0x7')]=_[_0xa42a('0x8')](config[_0xa42a('0x7')],{'host':_0xa42a('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa42a('0xa'))[_0xa42a('0xb')](socket);function respondWithRpcPromise(_0x1e4888,_0x31655e,_0x271ed1){return new BPromise(function(_0x2ead2b,_0x3d123f){return client['request'](_0x1e4888,_0x271ed1)[_0xa42a('0xc')](function(_0x568dd3){logger[_0xa42a('0xd')](_0xa42a('0xe'),_0x31655e,_0xa42a('0xf'));logger[_0xa42a('0x10')](_0xa42a('0x11'),_0x31655e,_0xa42a('0xf'),JSON[_0xa42a('0x12')](_0x568dd3));if(_0x568dd3[_0xa42a('0x13')]){if(_0x568dd3[_0xa42a('0x13')][_0xa42a('0x14')]===0x1f4){logger[_0xa42a('0x13')](_0xa42a('0xe'),_0x31655e,_0x568dd3[_0xa42a('0x13')]['message']);return _0x3d123f(_0x568dd3[_0xa42a('0x13')][_0xa42a('0x15')]);}logger[_0xa42a('0x13')](_0xa42a('0xe'),_0x31655e,_0x568dd3[_0xa42a('0x13')][_0xa42a('0x15')]);return _0x2ead2b(_0x568dd3[_0xa42a('0x13')][_0xa42a('0x15')]);}else{logger['info'](_0xa42a('0xe'),_0x31655e,_0xa42a('0xf'));_0x2ead2b(_0x568dd3[_0xa42a('0x16')][_0xa42a('0x15')]);}})[_0xa42a('0x17')](function(_0x24f9b3){logger['error'](_0xa42a('0xe'),_0x31655e,_0x24f9b3);_0x3d123f(_0x24f9b3);});});}exports['GetVoiceQueueRtPauses']=function(_0x5bc11e){var _0x48c2d6=this;return new Promise(function(_0x33ccdd,_0x13b00a){return db[_0xa42a('0x18')][_0xa42a('0x19')]({'raw':_0x5bc11e[_0xa42a('0x1a')]?_0x5bc11e[_0xa42a('0x1a')][_0xa42a('0x1b')]===undefined?!![]:![]:!![],'where':_0x5bc11e[_0xa42a('0x1a')]?_0x5bc11e[_0xa42a('0x1a')][_0xa42a('0x1c')]||null:null,'attributes':[[db[_0xa42a('0x1d')]['fn'](_0xa42a('0x1e'),db[_0xa42a('0x1d')]['fn']('IF',db[_0xa42a('0x1d')][_0xa42a('0x1f')](_0xa42a('0x20')))),_0xa42a('0x21')]]})[_0xa42a('0xc')](function(_0x1e42f9){logger['info']('GetVoiceQueueRtPauses',_0x5bc11e);logger[_0xa42a('0x10')](_0xa42a('0x22'),_0x5bc11e,JSON['stringify'](_0x1e42f9));_0x33ccdd(_0x1e42f9);})[_0xa42a('0x17')](function(_0x4e2102){logger[_0xa42a('0x13')](_0xa42a('0x22'),_0x4e2102[_0xa42a('0x15')],_0x5bc11e);_0x13b00a(_0x48c2d6[_0xa42a('0x13')](0x1f4,_0x4e2102[_0xa42a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index fbe0970..32d397b 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 _0x0d4d=['remove','update','emit','removeListener','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0d4d,0x132));var _0xd0d4=function(_0xc5d594,_0x237dd2){_0xc5d594=_0xc5d594-0x0;var _0x3e408a=_0x0d4d[_0xc5d594];return _0x3e408a;};'use strict';var UserVoiceQueueRtEvents=require(_0xd0d4('0x0'));var events=[_0xd0d4('0x1'),_0xd0d4('0x2'),_0xd0d4('0x3')];function createListener(_0x1f74ab,_0x1515e0){return function(_0x4d5c19){_0x1515e0[_0xd0d4('0x4')](_0x1f74ab,_0x4d5c19);};}function removeListener(_0x58909f,_0x2e99ee){return function(){UserVoiceQueueRtEvents[_0xd0d4('0x5')](_0x58909f,_0x2e99ee);};}exports['register']=function(_0x34d93b){for(var _0x3db5ab=0x0,_0x1c5d01=events['length'];_0x3db5ab<_0x1c5d01;_0x3db5ab++){var _0x5bfae8=events[_0x3db5ab];var _0x5403c0=createListener(_0xd0d4('0x6')+_0x5bfae8,_0x34d93b);UserVoiceQueueRtEvents['on'](_0x5bfae8,_0x5403c0);}}; \ No newline at end of file +var _0x74f3=['save','remove','emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x568631,_0x4f40fa){var _0x4bd0ee=function(_0x1c3fd9){while(--_0x1c3fd9){_0x568631['push'](_0x568631['shift']());}};_0x4bd0ee(++_0x4f40fa);}(_0x74f3,0x164));var _0x374f=function(_0x5d9bfe,_0x5218e2){_0x5d9bfe=_0x5d9bfe-0x0;var _0x170274=_0x74f3[_0x5d9bfe];return _0x170274;};'use strict';var UserVoiceQueueRtEvents=require(_0x374f('0x0'));var events=[_0x374f('0x1'),_0x374f('0x2'),'update'];function createListener(_0x407670,_0x29c056){return function(_0x3dee9d){_0x29c056[_0x374f('0x3')](_0x407670,_0x3dee9d);};}function removeListener(_0x4a3be7,_0x3db0a){return function(){UserVoiceQueueRtEvents[_0x374f('0x4')](_0x4a3be7,_0x3db0a);};}exports['register']=function(_0x1292f2){for(var _0x1eb333=0x0,_0x405e93=events[_0x374f('0x5')];_0x1eb333<_0x405e93;_0x1eb333++){var _0x3bcc86=events[_0x1eb333];var _0x394073=createListener(_0x374f('0x6')+_0x3bcc86,_0x1292f2);UserVoiceQueueRtEvents['on'](_0x3bcc86,_0x394073);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index efdc37d..9900ba6 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2fd9e5,_0x43f94d){var _0x4f6c5a=function(_0x120afd){while(--_0x120afd){_0x2fd9e5['push'](_0x2fd9e5['shift']());}};_0x4f6c5a(++_0x43f94d);}(_0xe706,0xa3));var _0x6e70=function(_0x3a4c07,_0x18440c){_0x3a4c07=_0x3a4c07-0x0;var _0x5a4943=_0xe706[_0x3a4c07];return _0x5a4943;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x13c131,_0x14134b){var _0x30acb3=function(_0x18bcba){while(--_0x18bcba){_0x13c131['push'](_0x13c131['shift']());}};_0x30acb3(++_0x14134b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x60286b,_0x3247c1){_0x60286b=_0x60286b-0x0;var _0x5dff69=_0xcb91[_0x60286b];return _0x5dff69;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 11ae20e..d3b9462 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 _0x6068=['exports','INTEGER'];(function(_0x4bf565,_0x420d33){var _0x30e15f=function(_0x91a47f){while(--_0x91a47f){_0x4bf565['push'](_0x4bf565['shift']());}};_0x30e15f(++_0x420d33);}(_0x6068,0x134));var _0x8606=function(_0x2a3f50,_0x3bcfb8){_0x2a3f50=_0x2a3f50-0x0;var _0x5d44bd=_0x6068[_0x2a3f50];return _0x5d44bd;};'use strict';var Sequelize=require('sequelize');module[_0x8606('0x0')]={'penalty':{'type':Sequelize[_0x8606('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfd02=['INTEGER','sequelize'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xfd02,0xbd));var _0x2fd0=function(_0x4471b3,_0x511a9f){_0x4471b3=_0x4471b3-0x0;var _0x386593=_0xfd02[_0x4471b3];return _0x386593;};'use strict';var Sequelize=require(_0x2fd0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x2fd0('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 3854cb8..3480102 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 _0xf176=['user_has_whatsapp_queues','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','UserWhatsappQueue'];(function(_0x25df80,_0xa2aec5){var _0x17b6d0=function(_0x446155){while(--_0x446155){_0x25df80['push'](_0x25df80['shift']());}};_0x17b6d0(++_0xa2aec5);}(_0xf176,0x1a3));var _0x6f17=function(_0x35e540,_0x12673f){_0x35e540=_0x35e540-0x0;var _0xb61c64=_0xf176[_0x35e540];return _0xb61c64;};'use strict';var _=require('lodash');var util=require(_0x6f17('0x0'));var logger=require(_0x6f17('0x1'))('api');var moment=require(_0x6f17('0x2'));var BPromise=require(_0x6f17('0x3'));var rp=require(_0x6f17('0x4'));var fs=require('fs');var path=require(_0x6f17('0x5'));var rimraf=require('rimraf');var config=require(_0x6f17('0x6'));var attributes=require('./userWhatsappQueue.attributes');module[_0x6f17('0x7')]=function(_0x4d693f,_0x1e5301){return _0x4d693f[_0x6f17('0x8')](_0x6f17('0x9'),attributes,{'tableName':_0x6f17('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0952=['UserWhatsappQueue','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define'];(function(_0x5c954d,_0x4e2836){var _0x340d4f=function(_0x559ccf){while(--_0x559ccf){_0x5c954d['push'](_0x5c954d['shift']());}};_0x340d4f(++_0x4e2836);}(_0x0952,0x114));var _0x2095=function(_0x4273a9,_0x3a5da8){_0x4273a9=_0x4273a9-0x0;var _0x373c51=_0x0952[_0x4273a9];return _0x373c51;};'use strict';var _=require('lodash');var util=require(_0x2095('0x0'));var logger=require(_0x2095('0x1'))('api');var moment=require(_0x2095('0x2'));var BPromise=require(_0x2095('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2095('0x4'));var rimraf=require(_0x2095('0x5'));var config=require(_0x2095('0x6'));var attributes=require(_0x2095('0x7'));module[_0x2095('0x8')]=function(_0x5c4bb8,_0x411ab5){return _0x5c4bb8[_0x2095('0x9')](_0x2095('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 8bf09d4..7d82c7d 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 _0x2858=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x41264c,_0x1cb166){var _0x16d0cd=function(_0x2bfb9c){while(--_0x2bfb9c){_0x41264c['push'](_0x41264c['shift']());}};_0x16d0cd(++_0x1cb166);}(_0x2858,0x18e));var _0x8285=function(_0x2a96a3,_0x30383b){_0x2a96a3=_0x2a96a3-0x0;var _0x3df29c=_0x2858[_0x2a96a3];return _0x3df29c;};'use strict';var _=require(_0x8285('0x0'));var util=require('util');var moment=require(_0x8285('0x1'));var BPromise=require(_0x8285('0x2'));var rs=require(_0x8285('0x3'));var fs=require('fs');var Redis=require(_0x8285('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8285('0x5'))(_0x8285('0x6'));var config=require(_0x8285('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38848f,_0x4db90a,_0x29b7d4){return new BPromise(function(_0x278bc0,_0x4d44a9){return client[_0x8285('0x8')](_0x38848f,_0x29b7d4)['then'](function(_0xbff153){logger[_0x8285('0x9')](_0x8285('0xa'),_0x4db90a,_0x8285('0xb'));logger[_0x8285('0xc')](_0x8285('0xd'),_0x4db90a,_0x8285('0xb'),JSON['stringify'](_0xbff153));if(_0xbff153[_0x8285('0xe')]){if(_0xbff153[_0x8285('0xe')][_0x8285('0xf')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x4db90a,_0xbff153[_0x8285('0xe')][_0x8285('0x10')]);return _0x4d44a9(_0xbff153[_0x8285('0xe')][_0x8285('0x10')]);}logger[_0x8285('0xe')](_0x8285('0xa'),_0x4db90a,_0xbff153[_0x8285('0xe')][_0x8285('0x10')]);return _0x278bc0(_0xbff153[_0x8285('0xe')]['message']);}else{logger['info'](_0x8285('0xa'),_0x4db90a,_0x8285('0xb'));_0x278bc0(_0xbff153[_0x8285('0x11')]['message']);}})[_0x8285('0x12')](function(_0x442d61){logger[_0x8285('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4db90a,_0x442d61);_0x4d44a9(_0x442d61);});});} \ No newline at end of file +var _0xe7cf=['UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info'];(function(_0x131c5f,_0x595642){var _0x563bdd=function(_0x2ce64c){while(--_0x2ce64c){_0x131c5f['push'](_0x131c5f['shift']());}};_0x563bdd(++_0x595642);}(_0xe7cf,0x16a));var _0xfe7c=function(_0x3462ae,_0x225598){_0x3462ae=_0x3462ae-0x0;var _0x587dd6=_0xe7cf[_0x3462ae];return _0x587dd6;};'use strict';var _=require(_0xfe7c('0x0'));var util=require(_0xfe7c('0x1'));var moment=require('moment');var BPromise=require(_0xfe7c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe7c('0x3'));var db=require(_0xfe7c('0x4'))['db'];var utils=require(_0xfe7c('0x5'));var logger=require(_0xfe7c('0x6'))('rpc');var config=require(_0xfe7c('0x7'));var jayson=require(_0xfe7c('0x8'));var client=jayson[_0xfe7c('0x9')][_0xfe7c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27f134,_0x4bdd77,_0x46e16f){return new BPromise(function(_0x22d3bd,_0x448d6b){return client['request'](_0x27f134,_0x46e16f)['then'](function(_0x3a700c){logger[_0xfe7c('0xb')](_0xfe7c('0xc'),_0x4bdd77,_0xfe7c('0xd'));logger[_0xfe7c('0xe')](_0xfe7c('0xf'),_0x4bdd77,'request\x20sent',JSON[_0xfe7c('0x10')](_0x3a700c));if(_0x3a700c[_0xfe7c('0x11')]){if(_0x3a700c['error'][_0xfe7c('0x12')]===0x1f4){logger['error'](_0xfe7c('0xc'),_0x4bdd77,_0x3a700c[_0xfe7c('0x11')][_0xfe7c('0x13')]);return _0x448d6b(_0x3a700c['error'][_0xfe7c('0x13')]);}logger[_0xfe7c('0x11')](_0xfe7c('0xc'),_0x4bdd77,_0x3a700c[_0xfe7c('0x11')][_0xfe7c('0x13')]);return _0x22d3bd(_0x3a700c['error'][_0xfe7c('0x13')]);}else{logger[_0xfe7c('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4bdd77,_0xfe7c('0xd'));_0x22d3bd(_0x3a700c[_0xfe7c('0x14')]['message']);}})[_0xfe7c('0x15')](function(_0x137462){logger[_0xfe7c('0x11')](_0xfe7c('0xc'),_0x4bdd77,_0x137462);_0x448d6b(_0x137462);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 2a24123..9452f84 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 _0x26bc=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x4bab60,_0x168a38){var _0x2b9881=function(_0x2ffbd4){while(--_0x2ffbd4){_0x4bab60['push'](_0x4bab60['shift']());}};_0x2b9881(++_0x168a38);}(_0x26bc,0x162));var _0xc26b=function(_0x596092,_0x5af25a){_0x596092=_0x596092-0x0;var _0x2e4f0c=_0x26bc[_0x596092];return _0x2e4f0c;};'use strict';var multer=require(_0xc26b('0x0'));var util=require(_0xc26b('0x1'));var path=require(_0xc26b('0x2'));var timeout=require(_0xc26b('0x3'));var express=require(_0xc26b('0x4'));var router=express['Router']();var fs_extra=require(_0xc26b('0x5'));var auth=require(_0xc26b('0x6'));var interaction=require(_0xc26b('0x7'));var config=require('../../config/environment');var controller=require(_0xc26b('0x8'));router['get']('/',auth[_0xc26b('0x9')](),controller[_0xc26b('0xa')]);router[_0xc26b('0xb')]('/:id',auth[_0xc26b('0x9')](),controller[_0xc26b('0xc')]);router[_0xc26b('0xd')]('/',auth[_0xc26b('0x9')](),controller[_0xc26b('0xe')]);router[_0xc26b('0xf')](_0xc26b('0x10'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x11')]);router[_0xc26b('0x12')]('/:id',auth[_0xc26b('0x9')](),controller[_0xc26b('0x13')]);module[_0xc26b('0x14')]=router; \ No newline at end of file +var _0xf7f3=['get','index','isAuthenticated','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf7f3,0x12a));var _0x3f7f=function(_0x3d10e,_0x24d54a){_0x3d10e=_0x3d10e-0x0;var _0x27e52a=_0xf7f3[_0x3d10e];return _0x27e52a;};'use strict';var multer=require(_0x3f7f('0x0'));var util=require(_0x3f7f('0x1'));var path=require(_0x3f7f('0x2'));var timeout=require(_0x3f7f('0x3'));var express=require(_0x3f7f('0x4'));var router=express[_0x3f7f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3f7f('0x6'));var config=require(_0x3f7f('0x7'));var controller=require('./variable.controller');router[_0x3f7f('0x8')]('/',auth['isAuthenticated'](),controller[_0x3f7f('0x9')]);router[_0x3f7f('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x3f7f('0xa')](),controller[_0x3f7f('0xb')]);router[_0x3f7f('0xc')](_0x3f7f('0xd'),auth[_0x3f7f('0xa')](),controller[_0x3f7f('0xe')]);router[_0x3f7f('0xf')](_0x3f7f('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x3f7f('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 13d9629..6515755 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 _0x52e1=['STRING'];(function(_0x408098,_0x1808d8){var _0x1cb2bf=function(_0x95584){while(--_0x95584){_0x408098['push'](_0x408098['shift']());}};_0x1cb2bf(++_0x1808d8);}(_0x52e1,0xb9));var _0x152e=function(_0x1a13b1,_0x4d1d25){_0x1a13b1=_0x1a13b1-0x0;var _0x395e05=_0x52e1[_0x1a13b1];return _0x395e05;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x152e('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x152e('0x0')]}}; \ No newline at end of file +var _0xc4dd=['STRING','name','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc4dd,0x1cd));var _0xdc4d=function(_0x304b67,_0x49cf66){_0x304b67=_0x304b67-0x0;var _0x38bd65=_0xc4dd[_0x304b67];return _0x38bd65;};'use strict';var Sequelize=require('sequelize');module[_0xdc4d('0x0')]={'name':{'type':Sequelize[_0xdc4d('0x1')],'unique':_0xdc4d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 0cd3712..510606e 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 _0x2775=['save','update','then','destroy','Variables','UserProfileResource','sendStatus','error','stack','name','send','index','map','Variable','rawAttributes','type','key','model','query','attributes','fields','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','keys','intersection','length','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','end','status','json','offset','undefined','limit','count','Content-Range','reject'];(function(_0x55ba9a,_0x363d77){var _0x334b35=function(_0x1548a0){while(--_0x1548a0){_0x55ba9a['push'](_0x55ba9a['shift']());}};_0x334b35(++_0x363d77);}(_0x2775,0x113));var _0x5277=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x2775[_0x30c649];return _0x3edfb9;};'use strict';var emlformat=require(_0x5277('0x0'));var rimraf=require(_0x5277('0x1'));var zipdir=require(_0x5277('0x2'));var jsonpatch=require(_0x5277('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5277('0x4'));var Mustache=require(_0x5277('0x5'));var util=require(_0x5277('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5277('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5277('0x8'));var Papa=require(_0x5277('0x9'));var Redis=require(_0x5277('0xa'));var authService=require(_0x5277('0xb'));var qs=require(_0x5277('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5277('0xd'));var logger=require('../../config/logger')(_0x5277('0xe'));var utils=require('../../config/utils');var config=require(_0x5277('0xf'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5806dc,_0x56171c){_0x56171c=_0x56171c||0xcc;return function(_0x2dc4fe){if(_0x2dc4fe){return _0x5806dc['sendStatus'](_0x56171c);}return _0x5806dc['status'](_0x56171c)[_0x5277('0x10')]();};}function respondWithResult(_0x48fb1b,_0x4bc03f){_0x4bc03f=_0x4bc03f||0xc8;return function(_0x2a35a9){if(_0x2a35a9){return _0x48fb1b[_0x5277('0x11')](_0x4bc03f)[_0x5277('0x12')](_0x2a35a9);}};}function respondWithFilteredResult(_0x28f714,_0x475b89){return function(_0x4802e2){if(_0x4802e2){var _0x23f1c4=typeof _0x475b89[_0x5277('0x13')]===_0x5277('0x14')&&typeof _0x475b89[_0x5277('0x15')]===_0x5277('0x14');var _0x1917c8=_0x4802e2[_0x5277('0x16')];var _0x498f68=_0x23f1c4?0x0:_0x475b89[_0x5277('0x13')];var _0x12acf6=_0x23f1c4?_0x4802e2[_0x5277('0x16')]:_0x475b89[_0x5277('0x13')]+_0x475b89[_0x5277('0x15')];var _0x9a1278;if(_0x12acf6>=_0x1917c8){_0x12acf6=_0x1917c8;_0x9a1278=0xc8;}else{_0x9a1278=0xce;}_0x28f714['status'](_0x9a1278);return _0x28f714['set'](_0x5277('0x17'),_0x498f68+'-'+_0x12acf6+'/'+_0x1917c8)['json'](_0x4802e2);}return null;};}function patchUpdates(_0x31fedc){return function(_0x2751c6){try{jsonpatch['apply'](_0x2751c6,_0x31fedc,!![]);}catch(_0xf649d5){return BPromise[_0x5277('0x18')](_0xf649d5);}return _0x2751c6[_0x5277('0x19')]();};}function saveUpdates(_0x5dd51c,_0x31889a){return function(_0x38a204){if(_0x38a204){return _0x38a204[_0x5277('0x1a')](_0x5dd51c)[_0x5277('0x1b')](function(_0x583525){return _0x583525;});}return null;};}function removeEntity(_0x19d35b,_0x560911){return function(_0x1cfe34){if(_0x1cfe34){return _0x1cfe34[_0x5277('0x1c')]()[_0x5277('0x1b')](function(){var _0x3c99cd=_0x1cfe34['get']({'plain':!![]});var _0x52191a=_0x5277('0x1d');return db[_0x5277('0x1e')][_0x5277('0x1c')]({'where':{'type':_0x52191a,'resourceId':_0x3c99cd['id']}})[_0x5277('0x1b')](function(){return _0x1cfe34;});})[_0x5277('0x1b')](function(){_0x19d35b[_0x5277('0x11')](0xcc)[_0x5277('0x10')]();});}};}function handleEntityNotFound(_0x4e4237,_0x745305){return function(_0x5441d2){if(!_0x5441d2){_0x4e4237[_0x5277('0x1f')](0x194);}return _0x5441d2;};}function handleError(_0x3d8f31,_0x5cc81f){_0x5cc81f=_0x5cc81f||0x1f4;return function(_0x3e7b7e){logger[_0x5277('0x20')](_0x3e7b7e[_0x5277('0x21')]);if(_0x3e7b7e[_0x5277('0x22')]){delete _0x3e7b7e[_0x5277('0x22')];}_0x3d8f31[_0x5277('0x11')](_0x5cc81f)[_0x5277('0x23')](_0x3e7b7e);};}exports[_0x5277('0x24')]=function(_0x539345,_0x391d7c){var _0x15a426={},_0x389a55={},_0x4caeee={'count':0x0,'rows':[]};var _0x439ba7=_[_0x5277('0x25')](db[_0x5277('0x26')][_0x5277('0x27')],function(_0x2818e4){return{'name':_0x2818e4['fieldName'],'type':_0x2818e4[_0x5277('0x28')][_0x5277('0x29')]};});_0x389a55[_0x5277('0x2a')]=_[_0x5277('0x25')](_0x439ba7,_0x5277('0x22'));_0x389a55[_0x5277('0x2b')]=_['keys'](_0x539345[_0x5277('0x2b')]);_0x389a55['filters']=_['intersection'](_0x389a55[_0x5277('0x2a')],_0x389a55[_0x5277('0x2b')]);_0x15a426[_0x5277('0x2c')]=_['intersection'](_0x389a55[_0x5277('0x2a')],qs[_0x5277('0x2d')](_0x539345[_0x5277('0x2b')][_0x5277('0x2d')]));_0x15a426[_0x5277('0x2c')]=_0x15a426[_0x5277('0x2c')]['length']?_0x15a426['attributes']:_0x389a55[_0x5277('0x2a')];if(!_0x539345[_0x5277('0x2b')]['hasOwnProperty'](_0x5277('0x2e'))){_0x15a426['limit']=qs[_0x5277('0x15')](_0x539345[_0x5277('0x2b')][_0x5277('0x15')]);_0x15a426['offset']=qs[_0x5277('0x13')](_0x539345[_0x5277('0x2b')]['offset']);}_0x15a426[_0x5277('0x2f')]=qs['sort'](_0x539345[_0x5277('0x2b')][_0x5277('0x30')]);_0x15a426[_0x5277('0x31')]=qs[_0x5277('0x32')](_[_0x5277('0x33')](_0x539345[_0x5277('0x2b')],_0x389a55['filters']),_0x439ba7);if(_0x539345[_0x5277('0x2b')]['filter']){_0x15a426[_0x5277('0x31')]=_[_0x5277('0x34')](_0x15a426['where'],{'$or':_[_0x5277('0x25')](_0x439ba7,function(_0x3127a7){if(_0x3127a7[_0x5277('0x28')]!==_0x5277('0x35')){var _0x2221df={};_0x2221df[_0x3127a7[_0x5277('0x22')]]={'$like':'%'+_0x539345[_0x5277('0x2b')][_0x5277('0x36')]+'%'};return _0x2221df;}})});}_0x15a426=_[_0x5277('0x34')]({},_0x15a426,_0x539345[_0x5277('0x37')]);var _0x4ea794={'where':_0x15a426[_0x5277('0x31')]};return db[_0x5277('0x26')][_0x5277('0x16')](_0x4ea794)['then'](function(_0x5d63d9){_0x4caeee[_0x5277('0x16')]=_0x5d63d9;if(_0x539345[_0x5277('0x2b')]['includeAll']){_0x15a426[_0x5277('0x38')]=[{'all':!![]}];}return db[_0x5277('0x26')][_0x5277('0x39')](_0x15a426);})[_0x5277('0x1b')](function(_0x55ed45){_0x4caeee['rows']=_0x55ed45;return _0x4caeee;})['then'](respondWithFilteredResult(_0x391d7c,_0x15a426))[_0x5277('0x3a')](handleError(_0x391d7c,null));};exports[_0x5277('0x3b')]=function(_0x1f5f88,_0x2c4e44){var _0x594029={'raw':!![],'where':{'id':_0x1f5f88[_0x5277('0x3c')]['id']}},_0xdd850e={};_0xdd850e[_0x5277('0x2a')]=_[_0x5277('0x3d')](db['Variable'][_0x5277('0x27')]);_0xdd850e[_0x5277('0x2b')]=_['keys'](_0x1f5f88['query']);_0xdd850e[_0x5277('0x32')]=_[_0x5277('0x3e')](_0xdd850e[_0x5277('0x2a')],_0xdd850e[_0x5277('0x2b')]);_0x594029[_0x5277('0x2c')]=_[_0x5277('0x3e')](_0xdd850e[_0x5277('0x2a')],qs['fields'](_0x1f5f88[_0x5277('0x2b')][_0x5277('0x2d')]));_0x594029[_0x5277('0x2c')]=_0x594029[_0x5277('0x2c')][_0x5277('0x3f')]?_0x594029[_0x5277('0x2c')]:_0xdd850e['model'];if(_0x1f5f88['query'][_0x5277('0x40')]){_0x594029[_0x5277('0x38')]=[{'all':!![]}];}_0x594029=_[_0x5277('0x34')]({},_0x594029,_0x1f5f88['options']);return db[_0x5277('0x26')][_0x5277('0x41')](_0x594029)[_0x5277('0x1b')](handleEntityNotFound(_0x2c4e44,null))['then'](respondWithResult(_0x2c4e44,null))[_0x5277('0x3a')](handleError(_0x2c4e44,null));};exports[_0x5277('0x42')]=function(_0x446543,_0x1e8618){return db[_0x5277('0x26')][_0x5277('0x42')](_0x446543[_0x5277('0x43')],{})[_0x5277('0x1b')](function(_0x52a9ea){var _0x47b96b=_0x446543['user'][_0x5277('0x44')]({'plain':!![]});if(!_0x47b96b)throw new Error(_0x5277('0x45'));if(_0x47b96b[_0x5277('0x46')]===_0x5277('0x47')){var _0x2363cc=_0x52a9ea[_0x5277('0x44')]({'plain':!![]});var _0xca51d3=_0x5277('0x1d');return db[_0x5277('0x48')][_0x5277('0x41')]({'where':{'name':_0xca51d3,'userProfileId':_0x47b96b[_0x5277('0x49')]},'raw':!![]})[_0x5277('0x1b')](function(_0x5750c7){if(_0x5750c7&&_0x5750c7[_0x5277('0x4a')]===0x0){return db[_0x5277('0x1e')]['create']({'name':_0x2363cc[_0x5277('0x22')],'resourceId':_0x2363cc['id'],'type':_0x5750c7[_0x5277('0x22')],'sectionId':_0x5750c7['id']},{})[_0x5277('0x1b')](function(){return _0x52a9ea;});}else{return _0x52a9ea;}})[_0x5277('0x3a')](function(_0x35dc93){logger[_0x5277('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35dc93);throw _0x35dc93;});}return _0x52a9ea;})[_0x5277('0x1b')](respondWithResult(_0x1e8618,0xc9))['catch'](handleError(_0x1e8618,null));};exports[_0x5277('0x1a')]=function(_0x19cdad,_0x3c5cef){if(_0x19cdad['body']['id']){delete _0x19cdad[_0x5277('0x43')]['id'];}return db[_0x5277('0x26')]['find']({'where':{'id':_0x19cdad['params']['id']}})[_0x5277('0x1b')](handleEntityNotFound(_0x3c5cef,null))[_0x5277('0x1b')](saveUpdates(_0x19cdad[_0x5277('0x43')],null))['then'](respondWithResult(_0x3c5cef,null))[_0x5277('0x3a')](handleError(_0x3c5cef,null));};exports[_0x5277('0x1c')]=function(_0x2e92ce,_0x5aeb0a){return db[_0x5277('0x26')][_0x5277('0x41')]({'where':{'id':_0x2e92ce[_0x5277('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5aeb0a,null))['then'](removeEntity(_0x5aeb0a,null))['catch'](handleError(_0x5aeb0a,null));}; \ No newline at end of file +var _0x84ff=['end','status','json','undefined','count','limit','set','Content-Range','apply','reject','destroy','then','get','error','stack','name','send','index','map','Variable','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','VIRTUAL','merge','options','include','rows','catch','show','params','keys','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x10286e,_0x5d8bf9){var _0x30b39a=function(_0x151766){while(--_0x151766){_0x10286e['push'](_0x10286e['shift']());}};_0x30b39a(++_0x5d8bf9);}(_0x84ff,0x1cf));var _0xf84f=function(_0x4ea05a,_0x4e74f6){_0x4ea05a=_0x4ea05a-0x0;var _0x705283=_0x84ff[_0x4ea05a];return _0x705283;};'use strict';var emlformat=require(_0xf84f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf84f('0x1'));var moment=require(_0xf84f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf84f('0x3'));var util=require('util');var path=require('path');var sox=require(_0xf84f('0x4'));var csv=require(_0xf84f('0x5'));var ejs=require(_0xf84f('0x6'));var fs=require('fs');var fs_extra=require(_0xf84f('0x7'));var _=require('lodash');var squel=require(_0xf84f('0x8'));var crypto=require('crypto');var jsforce=require(_0xf84f('0x9'));var deskjs=require(_0xf84f('0xa'));var toCsv=require('to-csv');var querystring=require(_0xf84f('0xb'));var Papa=require(_0xf84f('0xc'));var Redis=require('ioredis');var authService=require(_0xf84f('0xd'));var qs=require(_0xf84f('0xe'));var as=require(_0xf84f('0xf'));var hardwareService=require(_0xf84f('0x10'));var logger=require(_0xf84f('0x11'))('api');var utils=require(_0xf84f('0x12'));var config=require(_0xf84f('0x13'));var licenseUtil=require(_0xf84f('0x14'));var db=require(_0xf84f('0x15'))['db'];function respondWithStatusCode(_0x3a2a80,_0x4ff428){_0x4ff428=_0x4ff428||0xcc;return function(_0x5eedf7){if(_0x5eedf7){return _0x3a2a80[_0xf84f('0x16')](_0x4ff428);}return _0x3a2a80['status'](_0x4ff428)[_0xf84f('0x17')]();};}function respondWithResult(_0x44c6dc,_0x2f3910){_0x2f3910=_0x2f3910||0xc8;return function(_0x56f47e){if(_0x56f47e){return _0x44c6dc[_0xf84f('0x18')](_0x2f3910)[_0xf84f('0x19')](_0x56f47e);}};}function respondWithFilteredResult(_0x28dadf,_0x447a48){return function(_0xee1926){if(_0xee1926){var _0x5e93ce=typeof _0x447a48['offset']===_0xf84f('0x1a')&&typeof _0x447a48['limit']==='undefined';var _0xf00e9a=_0xee1926[_0xf84f('0x1b')];var _0x5a6022=_0x5e93ce?0x0:_0x447a48['offset'];var _0x4b5a34=_0x5e93ce?_0xee1926['count']:_0x447a48['offset']+_0x447a48[_0xf84f('0x1c')];var _0x167e12;if(_0x4b5a34>=_0xf00e9a){_0x4b5a34=_0xf00e9a;_0x167e12=0xc8;}else{_0x167e12=0xce;}_0x28dadf[_0xf84f('0x18')](_0x167e12);return _0x28dadf[_0xf84f('0x1d')](_0xf84f('0x1e'),_0x5a6022+'-'+_0x4b5a34+'/'+_0xf00e9a)[_0xf84f('0x19')](_0xee1926);}return null;};}function patchUpdates(_0x25aee8){return function(_0x456332){try{jsonpatch[_0xf84f('0x1f')](_0x456332,_0x25aee8,!![]);}catch(_0x4f5d3e){return BPromise[_0xf84f('0x20')](_0x4f5d3e);}return _0x456332['save']();};}function saveUpdates(_0x2b53d3,_0x5e493a){return function(_0x5ad0f6){if(_0x5ad0f6){return _0x5ad0f6['update'](_0x2b53d3)['then'](function(_0x42fd77){return _0x42fd77;});}return null;};}function removeEntity(_0x544b10,_0xe510db){return function(_0x1b8338){if(_0x1b8338){return _0x1b8338[_0xf84f('0x21')]()[_0xf84f('0x22')](function(){var _0x18c47f=_0x1b8338[_0xf84f('0x23')]({'plain':!![]});var _0x55665a='Variables';return db['UserProfileResource'][_0xf84f('0x21')]({'where':{'type':_0x55665a,'resourceId':_0x18c47f['id']}})[_0xf84f('0x22')](function(){return _0x1b8338;});})[_0xf84f('0x22')](function(){_0x544b10[_0xf84f('0x18')](0xcc)[_0xf84f('0x17')]();});}};}function handleEntityNotFound(_0x49f7fb,_0x54dfa2){return function(_0x432694){if(!_0x432694){_0x49f7fb[_0xf84f('0x16')](0x194);}return _0x432694;};}function handleError(_0x386ba3,_0xc14cd3){_0xc14cd3=_0xc14cd3||0x1f4;return function(_0x1eb638){logger[_0xf84f('0x24')](_0x1eb638[_0xf84f('0x25')]);if(_0x1eb638[_0xf84f('0x26')]){delete _0x1eb638[_0xf84f('0x26')];}_0x386ba3[_0xf84f('0x18')](_0xc14cd3)[_0xf84f('0x27')](_0x1eb638);};}exports[_0xf84f('0x28')]=function(_0x42c3ae,_0x195dcd){var _0x12e32c={},_0x40427f={},_0x5e6720={'count':0x0,'rows':[]};var _0x41b000=_[_0xf84f('0x29')](db[_0xf84f('0x2a')][_0xf84f('0x2b')],function(_0x57785c){return{'name':_0x57785c['fieldName'],'type':_0x57785c[_0xf84f('0x2c')][_0xf84f('0x2d')]};});_0x40427f[_0xf84f('0x2e')]=_['map'](_0x41b000,_0xf84f('0x26'));_0x40427f[_0xf84f('0x2f')]=_['keys'](_0x42c3ae[_0xf84f('0x2f')]);_0x40427f[_0xf84f('0x30')]=_[_0xf84f('0x31')](_0x40427f[_0xf84f('0x2e')],_0x40427f[_0xf84f('0x2f')]);_0x12e32c[_0xf84f('0x32')]=_['intersection'](_0x40427f[_0xf84f('0x2e')],qs['fields'](_0x42c3ae[_0xf84f('0x2f')][_0xf84f('0x33')]));_0x12e32c[_0xf84f('0x32')]=_0x12e32c[_0xf84f('0x32')]['length']?_0x12e32c[_0xf84f('0x32')]:_0x40427f[_0xf84f('0x2e')];if(!_0x42c3ae[_0xf84f('0x2f')][_0xf84f('0x34')](_0xf84f('0x35'))){_0x12e32c[_0xf84f('0x1c')]=qs[_0xf84f('0x1c')](_0x42c3ae[_0xf84f('0x2f')][_0xf84f('0x1c')]);_0x12e32c[_0xf84f('0x36')]=qs[_0xf84f('0x36')](_0x42c3ae['query'][_0xf84f('0x36')]);}_0x12e32c[_0xf84f('0x37')]=qs[_0xf84f('0x38')](_0x42c3ae[_0xf84f('0x2f')][_0xf84f('0x38')]);_0x12e32c[_0xf84f('0x39')]=qs['filters'](_['pick'](_0x42c3ae[_0xf84f('0x2f')],_0x40427f[_0xf84f('0x30')]),_0x41b000);if(_0x42c3ae[_0xf84f('0x2f')]['filter']){_0x12e32c[_0xf84f('0x39')]=_['merge'](_0x12e32c[_0xf84f('0x39')],{'$or':_[_0xf84f('0x29')](_0x41b000,function(_0x2e6033){if(_0x2e6033[_0xf84f('0x2c')]!==_0xf84f('0x3a')){var _0x56d837={};_0x56d837[_0x2e6033[_0xf84f('0x26')]]={'$like':'%'+_0x42c3ae['query']['filter']+'%'};return _0x56d837;}})});}_0x12e32c=_[_0xf84f('0x3b')]({},_0x12e32c,_0x42c3ae[_0xf84f('0x3c')]);var _0x2ceca9={'where':_0x12e32c[_0xf84f('0x39')]};return db[_0xf84f('0x2a')][_0xf84f('0x1b')](_0x2ceca9)[_0xf84f('0x22')](function(_0xda08ac){_0x5e6720[_0xf84f('0x1b')]=_0xda08ac;if(_0x42c3ae[_0xf84f('0x2f')]['includeAll']){_0x12e32c[_0xf84f('0x3d')]=[{'all':!![]}];}return db[_0xf84f('0x2a')]['findAll'](_0x12e32c);})[_0xf84f('0x22')](function(_0x3f323f){_0x5e6720[_0xf84f('0x3e')]=_0x3f323f;return _0x5e6720;})[_0xf84f('0x22')](respondWithFilteredResult(_0x195dcd,_0x12e32c))[_0xf84f('0x3f')](handleError(_0x195dcd,null));};exports[_0xf84f('0x40')]=function(_0x371082,_0x477d6f){var _0x3903c6={'raw':!![],'where':{'id':_0x371082[_0xf84f('0x41')]['id']}},_0x195420={};_0x195420[_0xf84f('0x2e')]=_[_0xf84f('0x42')](db[_0xf84f('0x2a')]['rawAttributes']);_0x195420['query']=_[_0xf84f('0x42')](_0x371082['query']);_0x195420[_0xf84f('0x30')]=_[_0xf84f('0x31')](_0x195420['model'],_0x195420[_0xf84f('0x2f')]);_0x3903c6[_0xf84f('0x32')]=_[_0xf84f('0x31')](_0x195420[_0xf84f('0x2e')],qs['fields'](_0x371082[_0xf84f('0x2f')][_0xf84f('0x33')]));_0x3903c6[_0xf84f('0x32')]=_0x3903c6[_0xf84f('0x32')][_0xf84f('0x43')]?_0x3903c6[_0xf84f('0x32')]:_0x195420['model'];if(_0x371082[_0xf84f('0x2f')][_0xf84f('0x44')]){_0x3903c6[_0xf84f('0x3d')]=[{'all':!![]}];}_0x3903c6=_[_0xf84f('0x3b')]({},_0x3903c6,_0x371082[_0xf84f('0x3c')]);return db['Variable'][_0xf84f('0x45')](_0x3903c6)[_0xf84f('0x22')](handleEntityNotFound(_0x477d6f,null))['then'](respondWithResult(_0x477d6f,null))['catch'](handleError(_0x477d6f,null));};exports[_0xf84f('0x46')]=function(_0x547c3c,_0x29bd02){return db[_0xf84f('0x2a')]['create'](_0x547c3c[_0xf84f('0x47')],{})[_0xf84f('0x22')](function(_0x74f719){var _0x4d14de=_0x547c3c[_0xf84f('0x48')][_0xf84f('0x23')]({'plain':!![]});if(!_0x4d14de)throw new Error(_0xf84f('0x49'));if(_0x4d14de[_0xf84f('0x4a')]==='user'){var _0x4a1753=_0x74f719[_0xf84f('0x23')]({'plain':!![]});var _0x3db5d7=_0xf84f('0x4b');return db[_0xf84f('0x4c')][_0xf84f('0x45')]({'where':{'name':_0x3db5d7,'userProfileId':_0x4d14de[_0xf84f('0x4d')]},'raw':!![]})[_0xf84f('0x22')](function(_0x2775e3){if(_0x2775e3&&_0x2775e3[_0xf84f('0x4e')]===0x0){return db['UserProfileResource'][_0xf84f('0x46')]({'name':_0x4a1753[_0xf84f('0x26')],'resourceId':_0x4a1753['id'],'type':_0x2775e3[_0xf84f('0x26')],'sectionId':_0x2775e3['id']},{})[_0xf84f('0x22')](function(){return _0x74f719;});}else{return _0x74f719;}})[_0xf84f('0x3f')](function(_0x1b2aa7){logger[_0xf84f('0x24')](_0xf84f('0x4f'),_0x1b2aa7);throw _0x1b2aa7;});}return _0x74f719;})[_0xf84f('0x22')](respondWithResult(_0x29bd02,0xc9))[_0xf84f('0x3f')](handleError(_0x29bd02,null));};exports[_0xf84f('0x50')]=function(_0xf67946,_0x19ed45){if(_0xf67946[_0xf84f('0x47')]['id']){delete _0xf67946[_0xf84f('0x47')]['id'];}return db['Variable'][_0xf84f('0x45')]({'where':{'id':_0xf67946[_0xf84f('0x41')]['id']}})[_0xf84f('0x22')](handleEntityNotFound(_0x19ed45,null))[_0xf84f('0x22')](saveUpdates(_0xf67946[_0xf84f('0x47')],null))[_0xf84f('0x22')](respondWithResult(_0x19ed45,null))['catch'](handleError(_0x19ed45,null));};exports[_0xf84f('0x21')]=function(_0x58ae2a,_0x247a47){return db[_0xf84f('0x2a')][_0xf84f('0x45')]({'where':{'id':_0x58ae2a[_0xf84f('0x41')]['id']}})[_0xf84f('0x22')](handleEntityNotFound(_0x247a47,null))['then'](removeEntity(_0x247a47,null))[_0xf84f('0x3f')](handleError(_0x247a47,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index f419d8e..0944552 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 _0x5174=['../../config/environment','exports','define','Variable','lodash','api','moment','bluebird','request-promise','path'];(function(_0x185860,_0x5b276e){var _0x15bf16=function(_0x21751b){while(--_0x21751b){_0x185860['push'](_0x185860['shift']());}};_0x15bf16(++_0x5b276e);}(_0x5174,0x13a));var _0x4517=function(_0x4731b9,_0xa9cf5d){_0x4731b9=_0x4731b9-0x0;var _0x2a1b7e=_0x5174[_0x4731b9];return _0x2a1b7e;};'use strict';var _=require(_0x4517('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4517('0x1'));var moment=require(_0x4517('0x2'));var BPromise=require(_0x4517('0x3'));var rp=require(_0x4517('0x4'));var fs=require('fs');var path=require(_0x4517('0x5'));var rimraf=require('rimraf');var config=require(_0x4517('0x6'));var attributes=require('./variable.attributes');module[_0x4517('0x7')]=function(_0xf96ee5,_0x54a509){return _0xf96ee5[_0x4517('0x8')](_0x4517('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb34e=['define','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./variable.attributes','exports'];(function(_0x47fe2b,_0x506ccc){var _0x2b4135=function(_0x52d3b8){while(--_0x52d3b8){_0x47fe2b['push'](_0x47fe2b['shift']());}};_0x2b4135(++_0x506ccc);}(_0xb34e,0x12e));var _0xeb34=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xb34e[_0x424a9a];return _0xa7831c;};'use strict';var _=require(_0xeb34('0x0'));var util=require('util');var logger=require(_0xeb34('0x1'))(_0xeb34('0x2'));var moment=require(_0xeb34('0x3'));var BPromise=require(_0xeb34('0x4'));var rp=require(_0xeb34('0x5'));var fs=require('fs');var path=require(_0xeb34('0x6'));var rimraf=require(_0xeb34('0x7'));var config=require('../../config/environment');var attributes=require(_0xeb34('0x8'));module[_0xeb34('0x9')]=function(_0x395f6b,_0x166a72){return _0x395f6b[_0xeb34('0xa')](_0xeb34('0xb'),attributes,{'tableName':_0xeb34('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 c005e95..a105312 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 _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x3ed5fe,_0x4ccc75){var _0xe9656=function(_0x2c5463){while(--_0x2c5463){_0x3ed5fe['push'](_0x3ed5fe['shift']());}};_0xe9656(++_0x4ccc75);}(_0x814b,0x1a2));var _0xb814=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x814b[_0x556927];return _0x5f1235;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file +var _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x195270,_0x412abb){var _0x5398dd=function(_0x1deab2){while(--_0x1deab2){_0x195270['push'](_0x195270['shift']());}};_0x5398dd(++_0x412abb);}(_0x8ef6,0xf2));var _0x68ef=function(_0x17f1b7,_0x58ca82){_0x17f1b7=_0x17f1b7-0x0;var _0x444370=_0x8ef6[_0x17f1b7];return _0x444370;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 77b15be..0174677 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 _0xde16=['index','/fetch','isAuthenticated','canUpdate','fetch','/reset','/pull','pull','/restart','/migrations','exports','Router','../../components/auth/service','./version.controller','get'];(function(_0x2389c8,_0x39d57a){var _0x57493d=function(_0x539b83){while(--_0x539b83){_0x2389c8['push'](_0x2389c8['shift']());}};_0x57493d(++_0x39d57a);}(_0xde16,0x83));var _0x6de1=function(_0x285957,_0x2190f4){_0x285957=_0x285957-0x0;var _0x4c6d56=_0xde16[_0x285957];return _0x4c6d56;};'use strict';var express=require('express');var router=express[_0x6de1('0x0')]();var auth=require(_0x6de1('0x1'));var controller=require(_0x6de1('0x2'));router[_0x6de1('0x3')]('/',controller[_0x6de1('0x4')]);router[_0x6de1('0x3')](_0x6de1('0x5'),auth[_0x6de1('0x6')](),auth[_0x6de1('0x7')](),controller[_0x6de1('0x8')]);router[_0x6de1('0x3')](_0x6de1('0x9'),auth[_0x6de1('0x6')](),auth[_0x6de1('0x7')](),controller['reset']);router[_0x6de1('0x3')](_0x6de1('0xa'),auth[_0x6de1('0x6')](),auth[_0x6de1('0x7')](),controller[_0x6de1('0xb')]);router[_0x6de1('0x3')](_0x6de1('0xc'),auth[_0x6de1('0x6')](),controller['restart']);router['get'](_0x6de1('0xd'),controller['migrations']);module[_0x6de1('0xe')]=router; \ No newline at end of file +var _0xb44f=['/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','index','get','isAuthenticated','fetch','/reset','canUpdate','reset','/pull','pull','restart'];(function(_0x35ea44,_0x314ac5){var _0x432f30=function(_0x3f6dee){while(--_0x3f6dee){_0x35ea44['push'](_0x35ea44['shift']());}};_0x432f30(++_0x314ac5);}(_0xb44f,0xc3));var _0xfb44=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb44f[_0x3b380d];return _0x54502b;};'use strict';var express=require('express');var router=express[_0xfb44('0x0')]();var auth=require(_0xfb44('0x1'));var controller=require(_0xfb44('0x2'));router['get']('/',controller[_0xfb44('0x3')]);router[_0xfb44('0x4')]('/fetch',auth[_0xfb44('0x5')](),auth['canUpdate'](),controller[_0xfb44('0x6')]);router[_0xfb44('0x4')](_0xfb44('0x7'),auth['isAuthenticated'](),auth[_0xfb44('0x8')](),controller[_0xfb44('0x9')]);router[_0xfb44('0x4')](_0xfb44('0xa'),auth[_0xfb44('0x5')](),auth[_0xfb44('0x8')](),controller[_0xfb44('0xb')]);router[_0xfb44('0x4')]('/restart',auth[_0xfb44('0x5')](),controller[_0xfb44('0xc')]);router[_0xfb44('0x4')](_0xfb44('0xd'),controller[_0xfb44('0xe')]);module[_0xfb44('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 9e091d7..8a0fac5 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 _0xc5af=['Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','pkginfo','version','compare-versions','exec','../../config/environment','simple-git','root','index','exports','query','latest','fetch','2.0.0','status','json','origin','master','info','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','pull','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','server','map'];(function(_0x20598e,_0x559fa9){var _0x484c79=function(_0x286be0){while(--_0x286be0){_0x20598e['push'](_0x20598e['shift']());}};_0x484c79(++_0x559fa9);}(_0xc5af,0x146));var _0xfc5a=function(_0x3f4507,_0x2262c9){_0x3f4507=_0x3f4507-0x0;var _0x23a228=_0xc5af[_0x3f4507];return _0x23a228;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xfc5a('0x0'))(module,_0xfc5a('0x1'));var compareVersions=require(_0xfc5a('0x2'));var exec=require('child_process')[_0xfc5a('0x3')];var db=require('../../mysqldb')['db'];var config=require(_0xfc5a('0x4'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')('update');var git=require(_0xfc5a('0x5'))(config[_0xfc5a('0x6')]);exports[_0xfc5a('0x7')]=function(_0x1e9cc5,_0x229530){var _0x29bd1e={'current':module[_0xfc5a('0x8')][_0xfc5a('0x1')],'phonebar':0x2};if(_0x1e9cc5['query']&&_0x1e9cc5[_0xfc5a('0x9')][_0xfc5a('0xa')]){return git[_0xfc5a('0xb')]()['tags'](function(_0x2bad30,_0x24fbd1){_0x29bd1e[_0xfc5a('0xa')]=(_0x2bad30?module[_0xfc5a('0x8')]['version']:_0x24fbd1[_0xfc5a('0xa')])||_0xfc5a('0xc');return _0x229530[_0xfc5a('0xd')](0xc8)[_0xfc5a('0xe')](_0x29bd1e);});}else{return _0x229530[_0xfc5a('0xd')](0xc8)[_0xfc5a('0xe')](_0x29bd1e);}};exports[_0xfc5a('0xb')]=function(_0x268c5a,_0x4f2b61){return git[_0xfc5a('0xb')]([_0xfc5a('0xf'),_0xfc5a('0x10')],function(_0x52ecbb){if(_0x52ecbb){logger['error'](_0x52ecbb);return _0x4f2b61[_0xfc5a('0xd')](0x1f4)[_0xfc5a('0xe')](_0x52ecbb);}logger[_0xfc5a('0x11')]('git\x20fetch');return _0x4f2b61[_0xfc5a('0xd')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xfc5a('0x12')]=function(_0x159aca,_0x38a68b){return git['reset']([_0xfc5a('0x13'),_0xfc5a('0x14')],function(_0x2ea4b3){if(_0x2ea4b3){logger[_0xfc5a('0x15')](_0x2ea4b3);return _0x38a68b[_0xfc5a('0xd')](0x1f4)[_0xfc5a('0xe')](_0x2ea4b3);}logger[_0xfc5a('0x11')](_0xfc5a('0x16'));return _0x38a68b[_0xfc5a('0xd')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0xfc5a('0x17')]=function(_0x18dfec,_0x50b66a){exec('npm\x20install\x20--production',function(_0x48acab,_0x28f5fd,_0xa97d4e){logger[_0xfc5a('0x11')](_0x28f5fd);logger[_0xfc5a('0x11')](_0xa97d4e);if(_0x48acab){logger[_0xfc5a('0x15')](_0x48acab);return _0x50b66a[_0xfc5a('0xd')](0x1f4)[_0xfc5a('0xe')](_0x48acab);}return _0x50b66a['status'](0xc8)[_0xfc5a('0xe')]({'output':_0x28f5fd});});};exports['restart']=function(_0x10e0cf,_0x2a258c){return pm2['restart'](_0xfc5a('0x18'))[_0xfc5a('0x19')](function(_0x30cb13){logger[_0xfc5a('0x11')](_0xfc5a('0x1a'),_0x30cb13);return _0x2a258c[_0xfc5a('0xd')](0xc8)[_0xfc5a('0xe')]({'output':_0xfc5a('0x1b')});})[_0xfc5a('0x1c')](function(_0x2871cf){logger['error'](_0x2871cf);return _0x2a258c[_0xfc5a('0xd')](0x1f4)[_0xfc5a('0xe')](_0x2871cf);});};exports[_0xfc5a('0x1d')]=function(_0x129898,_0x2b0885){var _0x3ed714=fs[_0xfc5a('0x1e')](path[_0xfc5a('0x1f')](config[_0xfc5a('0x6')],'server',_0xfc5a('0x1d')));var _0x195a6e=[];for(var _0x23bd95=0x0;_0x23bd95<_0x3ed714[_0xfc5a('0x20')];_0x23bd95++){var _0x5defc1=_0x3ed714[_0x23bd95][_0xfc5a('0x21')](_0xfc5a('0x22'),'');if(compareVersions(module['exports'][_0xfc5a('0x1')],_0x5defc1)===-0x1){_0x195a6e[_0xfc5a('0x23')](_0x5defc1);}}if(_0x195a6e['length']){var _0x3d6797=_0x195a6e[_0xfc5a('0x24')](compareVersions);var _0x51336d=new Umzug({'storage':_0xfc5a('0x25'),'storageOptions':{'model':db[_0xfc5a('0x26')],'modelName':_0xfc5a('0x26'),'columnName':_0xfc5a('0x1')},'migrations':{'params':[db[_0xfc5a('0x25')][_0xfc5a('0x27')](),db[_0xfc5a('0x25')]['constructor'],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xfc5a('0x1f')](config['root'],_0xfc5a('0x28'),_0xfc5a('0x1d')),'pattern':/\.js$/}});_0x51336d['up']({'migrations':_[_0xfc5a('0x29')](_0x3d6797,function(_0x3023cf){return _0x3023cf+_0xfc5a('0x22');})})[_0xfc5a('0x19')](function(){return _0x2b0885[_0xfc5a('0xd')](0xc8)[_0xfc5a('0xe')]({'output':_0xfc5a('0x2a')+module['exports']['version']+_0xfc5a('0x2b')+_['last'](_0x3d6797),'migrations':_[_0xfc5a('0x1f')](_0x3d6797)});})[_0xfc5a('0x1c')](function(_0x4d3810){if(_0x4d3810 instanceof db[_0xfc5a('0x25')][_0xfc5a('0x2c')]){return _0x2b0885[_0xfc5a('0xd')](0xc8)[_0xfc5a('0xe')]({'output':_0xfc5a('0x2d')});}else{return _0x2b0885[_0xfc5a('0xd')](0x1f4)[_0xfc5a('0xe')](_0x4d3810);}});}else{return _0x2b0885[_0xfc5a('0xd')](0xc8)[_0xfc5a('0xe')]({'output':_0xfc5a('0x2d')});}}; \ No newline at end of file +var _0xc172=['FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','join','server','migrations','length','replace','.js','push','sort','Migration','sequelize','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','pkginfo','version','child_process','exec','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset'];(function(_0x5326ec,_0x2b7f6f){var _0x53094f=function(_0x3bac9c){while(--_0x3bac9c){_0x5326ec['push'](_0x5326ec['shift']());}};_0x53094f(++_0x2b7f6f);}(_0xc172,0x1d4));var _0x2c17=function(_0x4a05c3,_0x423285){_0x4a05c3=_0x4a05c3-0x0;var _0x3f4aa0=_0xc172[_0x4a05c3];return _0x3f4aa0;};'use strict';var Umzug=require('umzug');var path=require(_0x2c17('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x2c17('0x1'))(module,_0x2c17('0x2'));var compareVersions=require('compare-versions');var exec=require(_0x2c17('0x3'))[_0x2c17('0x4')];var db=require('../../mysqldb')['db'];var config=require(_0x2c17('0x5'));var pm2=require(_0x2c17('0x6'));var logger=require(_0x2c17('0x7'))(_0x2c17('0x8'));var git=require(_0x2c17('0x9'))(config[_0x2c17('0xa')]);exports[_0x2c17('0xb')]=function(_0x4243a6,_0x578421){var _0x3fc89f={'current':module[_0x2c17('0xc')]['version'],'phonebar':0x2};if(_0x4243a6[_0x2c17('0xd')]&&_0x4243a6[_0x2c17('0xd')][_0x2c17('0xe')]){return git[_0x2c17('0xf')]()[_0x2c17('0x10')](function(_0x6a8c78,_0x3b368c){_0x3fc89f[_0x2c17('0xe')]=(_0x6a8c78?module[_0x2c17('0xc')][_0x2c17('0x2')]:_0x3b368c['latest'])||_0x2c17('0x11');return _0x578421[_0x2c17('0x12')](0xc8)['json'](_0x3fc89f);});}else{return _0x578421[_0x2c17('0x12')](0xc8)[_0x2c17('0x13')](_0x3fc89f);}};exports[_0x2c17('0xf')]=function(_0x3e7d80,_0x28e9bc){return git[_0x2c17('0xf')]([_0x2c17('0x14'),_0x2c17('0x15')],function(_0x14dd68){if(_0x14dd68){logger[_0x2c17('0x16')](_0x14dd68);return _0x28e9bc[_0x2c17('0x12')](0x1f4)[_0x2c17('0x13')](_0x14dd68);}logger[_0x2c17('0x17')](_0x2c17('0x18'));return _0x28e9bc[_0x2c17('0x12')](0xc8)[_0x2c17('0x13')]({'output':_0x2c17('0x19')});});};exports[_0x2c17('0x1a')]=function(_0xbf425f,_0x2efe86){return git[_0x2c17('0x1a')](['--hard',_0x2c17('0x1b')],function(_0x3a8402){if(_0x3a8402){logger['error'](_0x3a8402);return _0x2efe86['status'](0x1f4)['json'](_0x3a8402);}logger[_0x2c17('0x17')](_0x2c17('0x1c'));return _0x2efe86[_0x2c17('0x12')](0xc8)['json']({'output':_0x2c17('0x1d')});});};exports[_0x2c17('0x1e')]=function(_0x5dd203,_0x3c73d1){exec(_0x2c17('0x1f'),function(_0x5d30e5,_0x42fea7,_0x23650c){logger[_0x2c17('0x17')](_0x42fea7);logger['info'](_0x23650c);if(_0x5d30e5){logger['error'](_0x5d30e5);return _0x3c73d1[_0x2c17('0x12')](0x1f4)['json'](_0x5d30e5);}return _0x3c73d1[_0x2c17('0x12')](0xc8)[_0x2c17('0x13')]({'output':_0x42fea7});});};exports[_0x2c17('0x20')]=function(_0x1ce7fa,_0x1968fb){return pm2[_0x2c17('0x20')]('motion2')[_0x2c17('0x21')](function(_0x3a2118){logger[_0x2c17('0x17')](_0x2c17('0x22'),_0x3a2118);return _0x1968fb[_0x2c17('0x12')](0xc8)[_0x2c17('0x13')]({'output':_0x2c17('0x23')});})[_0x2c17('0x24')](function(_0x37d2d7){logger[_0x2c17('0x16')](_0x37d2d7);return _0x1968fb[_0x2c17('0x12')](0x1f4)[_0x2c17('0x13')](_0x37d2d7);});};exports['migrations']=function(_0x3d1907,_0x99e72f){var _0x1b9c8e=fs['readdirSync'](path[_0x2c17('0x25')](config[_0x2c17('0xa')],_0x2c17('0x26'),_0x2c17('0x27')));var _0x4dc35c=[];for(var _0x10bbcd=0x0;_0x10bbcd<_0x1b9c8e[_0x2c17('0x28')];_0x10bbcd++){var _0x42663c=_0x1b9c8e[_0x10bbcd][_0x2c17('0x29')](_0x2c17('0x2a'),'');if(compareVersions(module['exports']['version'],_0x42663c)===-0x1){_0x4dc35c[_0x2c17('0x2b')](_0x42663c);}}if(_0x4dc35c[_0x2c17('0x28')]){var _0x43a2a9=_0x4dc35c[_0x2c17('0x2c')](compareVersions);var _0x300ac1=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x2c17('0x2d')],'modelName':'Migration','columnName':_0x2c17('0x2')},'migrations':{'params':[db[_0x2c17('0x2e')][_0x2c17('0x2f')](),db[_0x2c17('0x2e')]['constructor'],function(){throw new Error(_0x2c17('0x30'));}],'path':path['join'](config['root'],'server',_0x2c17('0x27')),'pattern':/\.js$/}});_0x300ac1['up']({'migrations':_[_0x2c17('0x31')](_0x43a2a9,function(_0x32b927){return _0x32b927+_0x2c17('0x2a');})})[_0x2c17('0x21')](function(){return _0x99e72f[_0x2c17('0x12')](0xc8)[_0x2c17('0x13')]({'output':_0x2c17('0x32')+module['exports'][_0x2c17('0x2')]+_0x2c17('0x33')+_[_0x2c17('0x34')](_0x43a2a9),'migrations':_[_0x2c17('0x25')](_0x43a2a9)});})[_0x2c17('0x24')](function(_0x39c46b){if(_0x39c46b instanceof db[_0x2c17('0x2e')][_0x2c17('0x35')]){return _0x99e72f[_0x2c17('0x12')](0xc8)[_0x2c17('0x13')]({'output':_0x2c17('0x36')});}else{return _0x99e72f['status'](0x1f4)[_0x2c17('0x13')](_0x39c46b);}});}else{return _0x99e72f[_0x2c17('0x12')](0xc8)['json']({'output':_0x2c17('0x36')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 04c0b6d..4833901 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 _0x4a87=['../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','create','/:id','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2b1612,_0x1d52ef){var _0x5ad967=function(_0x38fa64){while(--_0x38fa64){_0x2b1612['push'](_0x2b1612['shift']());}};_0x5ad967(++_0x1d52ef);}(_0x4a87,0x7a));var _0x74a8=function(_0x480fc0,_0x1e22b1){_0x480fc0=_0x480fc0-0x0;var _0x7eba29=_0x4a87[_0x480fc0];return _0x7eba29;};'use strict';var multer=require(_0x74a8('0x0'));var util=require(_0x74a8('0x1'));var path=require(_0x74a8('0x2'));var timeout=require(_0x74a8('0x3'));var express=require(_0x74a8('0x4'));var router=express[_0x74a8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x74a8('0x6'));var interaction=require(_0x74a8('0x7'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x74a8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x74a8('0x8')](_0x74a8('0x9'),auth[_0x74a8('0xa')](),controller[_0x74a8('0xb')]);router['get']('/:id',auth[_0x74a8('0xa')](),controller['show']);router['post']('/',auth[_0x74a8('0xa')](),controller[_0x74a8('0xc')]);router['put'](_0x74a8('0xd'),auth[_0x74a8('0xa')](),controller['update']);router[_0x74a8('0xe')](_0x74a8('0xd'),auth[_0x74a8('0xa')](),controller['destroy']);module[_0x74a8('0xf')]=router; \ No newline at end of file +var _0x6a0c=['isAuthenticated','get','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2bbb70,_0x5f8911){var _0x40719e=function(_0x35a0b6){while(--_0x35a0b6){_0x2bbb70['push'](_0x2bbb70['shift']());}};_0x40719e(++_0x5f8911);}(_0x6a0c,0x9e));var _0xc6a0=function(_0x1a2ada,_0x131eb4){_0x1a2ada=_0x1a2ada-0x0;var _0x1b513d=_0x6a0c[_0x1a2ada];return _0x1b513d;};'use strict';var multer=require(_0xc6a0('0x0'));var util=require(_0xc6a0('0x1'));var path=require(_0xc6a0('0x2'));var timeout=require(_0xc6a0('0x3'));var express=require(_0xc6a0('0x4'));var router=express[_0xc6a0('0x5')]();var fs_extra=require(_0xc6a0('0x6'));var auth=require(_0xc6a0('0x7'));var interaction=require(_0xc6a0('0x8'));var config=require(_0xc6a0('0x9'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0xc6a0('0xa')](),controller['index']);router[_0xc6a0('0xb')](_0xc6a0('0xc'),auth['isAuthenticated'](),controller[_0xc6a0('0xd')]);router[_0xc6a0('0xb')](_0xc6a0('0xe'),auth[_0xc6a0('0xa')](),controller[_0xc6a0('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc6a0('0x10')]);router[_0xc6a0('0x11')](_0xc6a0('0xe'),auth['isAuthenticated'](),controller[_0xc6a0('0x12')]);router[_0xc6a0('0x13')](_0xc6a0('0xe'),auth[_0xc6a0('0xa')](),controller['destroy']);module[_0xc6a0('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 6d1db28..a0c3868 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(_0x4448cf,_0x42cbcc){var _0x306054=function(_0x549181){while(--_0x549181){_0x4448cf['push'](_0x4448cf['shift']());}};_0x306054(++_0x42cbcc);}(_0xd237,0x14f));var _0x7d23=function(_0x475923,_0x25d9ec){_0x475923=_0x475923-0x0;var _0x374030=_0xd237[_0x475923];return _0x374030;};'use strict';var Sequelize=require(_0x7d23('0x0'));module[_0x7d23('0x1')]={'type':{'type':Sequelize[_0x7d23('0x2')]},'uniqueid':{'type':Sequelize[_0x7d23('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7d23('0x2')]},'queue':{'type':Sequelize[_0x7d23('0x2')]},'interface':{'type':Sequelize[_0x7d23('0x2')]},'membername':{'type':Sequelize[_0x7d23('0x2')]},'agentcalledAt':{'type':Sequelize[_0x7d23('0x3')]},'agentconnectAt':{'type':Sequelize[_0x7d23('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x7d23('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x7d23('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x7d23('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x7d23('0x5')]},'agentacw':{'type':Sequelize[_0x7d23('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7d23('0x5')]},'reason':{'type':Sequelize[_0x7d23('0x2')]},'lastevent':{'type':Sequelize[_0x7d23('0x2')]},'channel':{'type':Sequelize[_0x7d23('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7d23('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7d23('0x2')]},'connectedlinename':{'type':Sequelize[_0x7d23('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7d23('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7d23('0x2')]},'priority':{'type':Sequelize[_0x7d23('0x2')]},'destchannel':{'type':Sequelize[_0x7d23('0x2')]},'destchannelstate':{'type':Sequelize[_0x7d23('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x7d23('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7d23('0x2')]},'destcalleridname':{'type':Sequelize[_0x7d23('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x7d23('0x2')]},'destaccountcode':{'type':Sequelize[_0x7d23('0x2')]},'destcontext':{'type':Sequelize[_0x7d23('0x2')]},'destexten':{'type':Sequelize[_0x7d23('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x7d23('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x7d23('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7d23('0x2')],'comment':_0x7d23('0x6')},'transferexten':{'type':Sequelize[_0x7d23('0x2')]},'transferuniqueid':{'type':Sequelize[_0x7d23('0x2')]},'agententerreason':{'type':Sequelize[_0x7d23('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf7d9=['BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x252168,_0xdc7516){var _0x5922ad=function(_0x3def48){while(--_0x3def48){_0x252168['push'](_0x252168['shift']());}};_0x5922ad(++_0xdc7516);}(_0xf7d9,0x122));var _0x9f7d=function(_0xc86474,_0x57941c){_0xc86474=_0xc86474-0x0;var _0x3f5927=_0xf7d9[_0xc86474];return _0x3f5927;};'use strict';var Sequelize=require(_0x9f7d('0x0'));module[_0x9f7d('0x1')]={'type':{'type':Sequelize[_0x9f7d('0x2')]},'uniqueid':{'type':Sequelize[_0x9f7d('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9f7d('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9f7d('0x2')]},'agentcalledAt':{'type':Sequelize[_0x9f7d('0x3')]},'agentconnectAt':{'type':Sequelize[_0x9f7d('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x9f7d('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x9f7d('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x9f7d('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9f7d('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9f7d('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9f7d('0x5')]},'agentacw':{'type':Sequelize[_0x9f7d('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9f7d('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x9f7d('0x2')]},'channel':{'type':Sequelize[_0x9f7d('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9f7d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x9f7d('0x2')]},'connectedlinename':{'type':Sequelize[_0x9f7d('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9f7d('0x2')]},'context':{'type':Sequelize[_0x9f7d('0x2')]},'exten':{'type':Sequelize[_0x9f7d('0x2')]},'priority':{'type':Sequelize[_0x9f7d('0x2')]},'destchannel':{'type':Sequelize[_0x9f7d('0x2')]},'destchannelstate':{'type':Sequelize[_0x9f7d('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x9f7d('0x2')]},'destcalleridname':{'type':Sequelize[_0x9f7d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9f7d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x9f7d('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x9f7d('0x2')]},'destcontext':{'type':Sequelize[_0x9f7d('0x2')]},'destexten':{'type':Sequelize[_0x9f7d('0x2')]},'destpriority':{'type':Sequelize[_0x9f7d('0x2')]},'destuniqueid':{'type':Sequelize[_0x9f7d('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9f7d('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x9f7d('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9f7d('0x6')},'transferexten':{'type':Sequelize[_0x9f7d('0x2')]},'transferuniqueid':{'type':Sequelize[_0x9f7d('0x2')]},'agententerreason':{'type':Sequelize[_0x9f7d('0x5')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 8a8047b..8c07c54 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(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +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(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 058ad1f..ddd3d30 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 _0x1d25=['exports','define','report_agent','destuniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./voiceAgentReport.attributes'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x1d25,0xba));var _0x51d2=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0x1d25[_0x249e96];return _0x17444c;};'use strict';var _=require(_0x51d2('0x0'));var util=require(_0x51d2('0x1'));var logger=require(_0x51d2('0x2'))(_0x51d2('0x3'));var moment=require(_0x51d2('0x4'));var BPromise=require('bluebird');var rp=require(_0x51d2('0x5'));var fs=require('fs');var path=require(_0x51d2('0x6'));var rimraf=require('rimraf');var config=require(_0x51d2('0x7'));var attributes=require(_0x51d2('0x8'));module[_0x51d2('0x9')]=function(_0x407091,_0x449fec){return _0x407091[_0x51d2('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x51d2('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x51d2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe574=['../../config/environment','./voiceAgentReport.attributes','exports','report_agent','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x47c4d8,_0x3209ce){var _0xf388ed=function(_0x3d3d48){while(--_0x3d3d48){_0x47c4d8['push'](_0x47c4d8['shift']());}};_0xf388ed(++_0x3209ce);}(_0xe574,0x100));var _0x4e57=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe574[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x4e57('0x0'));var util=require('util');var logger=require(_0x4e57('0x1'))(_0x4e57('0x2'));var moment=require(_0x4e57('0x3'));var BPromise=require(_0x4e57('0x4'));var rp=require(_0x4e57('0x5'));var fs=require('fs');var path=require(_0x4e57('0x6'));var rimraf=require(_0x4e57('0x7'));var config=require(_0x4e57('0x8'));var attributes=require(_0x4e57('0x9'));module[_0x4e57('0xa')]=function(_0x436174,_0x2825a9){return _0x436174['define']('VoiceAgentReport',attributes,{'tableName':_0x4e57('0xb'),'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 93fe333..1c160aa 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 _0x3952=['message','result','catch','CreateVoiceAgentReport','body','options','raw','debug','stringify','UpdateVoiceAgentReport','VoiceAgentReport','update','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x8a19a4,_0x62ebbb){var _0x1492ee=function(_0x1528ae){while(--_0x1528ae){_0x8a19a4['push'](_0x8a19a4['shift']());}};_0x1492ee(++_0x62ebbb);}(_0x3952,0x97));var _0x2395=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x3952[_0x5f3f88];return _0xd08119;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2395('0x0'));var BPromise=require(_0x2395('0x1'));var rs=require(_0x2395('0x2'));var fs=require('fs');var Redis=require(_0x2395('0x3'));var db=require(_0x2395('0x4'))['db'];var utils=require(_0x2395('0x5'));var logger=require(_0x2395('0x6'))(_0x2395('0x7'));var config=require(_0x2395('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2395('0x9')][_0x2395('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x586367,_0x3897c1,_0x345055){return new BPromise(function(_0x1f8ffe,_0x97fdad){return client[_0x2395('0xb')](_0x586367,_0x345055)[_0x2395('0xc')](function(_0x43da98){logger[_0x2395('0xd')](_0x2395('0xe'),_0x3897c1,'request\x20sent');logger['debug'](_0x2395('0xf'),_0x3897c1,_0x2395('0x10'),JSON['stringify'](_0x43da98));if(_0x43da98[_0x2395('0x11')]){if(_0x43da98[_0x2395('0x11')][_0x2395('0x12')]===0x1f4){logger[_0x2395('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x3897c1,_0x43da98[_0x2395('0x11')][_0x2395('0x13')]);return _0x97fdad(_0x43da98[_0x2395('0x11')][_0x2395('0x13')]);}logger[_0x2395('0x11')](_0x2395('0xe'),_0x3897c1,_0x43da98['error'][_0x2395('0x13')]);return _0x1f8ffe(_0x43da98[_0x2395('0x11')][_0x2395('0x13')]);}else{logger[_0x2395('0xd')](_0x2395('0xe'),_0x3897c1,_0x2395('0x10'));_0x1f8ffe(_0x43da98[_0x2395('0x14')]['message']);}})[_0x2395('0x15')](function(_0x13cce2){logger[_0x2395('0x11')](_0x2395('0xe'),_0x3897c1,_0x13cce2);_0x97fdad(_0x13cce2);});});}exports[_0x2395('0x16')]=function(_0x4ba1a9){var _0x538279=this;return new Promise(function(_0x20fb23,_0x158eda){return db['VoiceAgentReport']['create'](_0x4ba1a9[_0x2395('0x17')],{'raw':_0x4ba1a9[_0x2395('0x18')]?_0x4ba1a9[_0x2395('0x18')][_0x2395('0x19')]===undefined?!![]:![]:!![]})[_0x2395('0xc')](function(_0x790c5a){logger[_0x2395('0xd')](_0x2395('0x16'),_0x4ba1a9);logger[_0x2395('0x1a')](_0x2395('0x16'),_0x4ba1a9,JSON[_0x2395('0x1b')](_0x790c5a));_0x20fb23(_0x790c5a);})[_0x2395('0x15')](function(_0x16f7e7){logger[_0x2395('0x11')](_0x2395('0x16'),_0x16f7e7['message'],_0x4ba1a9);_0x158eda(_0x538279[_0x2395('0x11')](0x1f4,_0x16f7e7[_0x2395('0x13')]));});});};exports[_0x2395('0x1c')]=function(_0x36cbd1){var _0x49b285=this;return new Promise(function(_0x19745e,_0x351a5e){return db[_0x2395('0x1d')][_0x2395('0x1e')](_0x36cbd1[_0x2395('0x17')],{'raw':_0x36cbd1[_0x2395('0x18')]?_0x36cbd1[_0x2395('0x18')][_0x2395('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36cbd1['options']?_0x36cbd1[_0x2395('0x18')][_0x2395('0x1f')]||null:null,'attributes':_0x36cbd1[_0x2395('0x18')]?_0x36cbd1['options'][_0x2395('0x20')]||null:null,'limit':_0x36cbd1['options']?_0x36cbd1[_0x2395('0x18')][_0x2395('0x21')]||null:null})[_0x2395('0xc')](function(_0x507ddf){logger[_0x2395('0xd')](_0x2395('0x1c'),_0x36cbd1);logger[_0x2395('0x1a')](_0x2395('0x1c'),_0x36cbd1,JSON['stringify'](_0x507ddf));_0x19745e(_0x507ddf);})[_0x2395('0x15')](function(_0x532038){logger['error']('UpdateVoiceAgentReport',_0x532038[_0x2395('0x13')],_0x36cbd1);_0x351a5e(_0x49b285[_0x2395('0x11')](0x1f4,_0x532038[_0x2395('0x13')]));});});}; \ No newline at end of file +var _0xba29=['CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba29,0x149));var _0x9ba2=function(_0x46f400,_0x3c0380){_0x46f400=_0x46f400-0x0;var _0x3faba7=_0xba29[_0x46f400];return _0x3faba7;};'use strict';var _=require(_0x9ba2('0x0'));var util=require(_0x9ba2('0x1'));var moment=require(_0x9ba2('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ba2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ba2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ba2('0x5'))(_0x9ba2('0x6'));var config=require(_0x9ba2('0x7'));var jayson=require(_0x9ba2('0x8'));var client=jayson[_0x9ba2('0x9')][_0x9ba2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20380d,_0x2d27ea,_0x1e5772){return new BPromise(function(_0x44966c,_0x541d4b){return client[_0x9ba2('0xb')](_0x20380d,_0x1e5772)[_0x9ba2('0xc')](function(_0x426d55){logger[_0x9ba2('0xd')](_0x9ba2('0xe'),_0x2d27ea,_0x9ba2('0xf'));logger[_0x9ba2('0x10')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x2d27ea,_0x9ba2('0xf'),JSON[_0x9ba2('0x11')](_0x426d55));if(_0x426d55[_0x9ba2('0x12')]){if(_0x426d55[_0x9ba2('0x12')][_0x9ba2('0x13')]===0x1f4){logger[_0x9ba2('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x2d27ea,_0x426d55[_0x9ba2('0x12')][_0x9ba2('0x14')]);return _0x541d4b(_0x426d55[_0x9ba2('0x12')][_0x9ba2('0x14')]);}logger['error'](_0x9ba2('0xe'),_0x2d27ea,_0x426d55['error'][_0x9ba2('0x14')]);return _0x44966c(_0x426d55['error'][_0x9ba2('0x14')]);}else{logger[_0x9ba2('0xd')](_0x9ba2('0xe'),_0x2d27ea,'request\x20sent');_0x44966c(_0x426d55[_0x9ba2('0x15')]['message']);}})[_0x9ba2('0x16')](function(_0x5c5f81){logger[_0x9ba2('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x2d27ea,_0x5c5f81);_0x541d4b(_0x5c5f81);});});}exports[_0x9ba2('0x17')]=function(_0x4b53dc){var _0x529f85=this;return new Promise(function(_0x429355,_0x53259c){return db[_0x9ba2('0x18')][_0x9ba2('0x19')](_0x4b53dc[_0x9ba2('0x1a')],{'raw':_0x4b53dc[_0x9ba2('0x1b')]?_0x4b53dc[_0x9ba2('0x1b')][_0x9ba2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2fe84c){logger[_0x9ba2('0xd')](_0x9ba2('0x17'),_0x4b53dc);logger[_0x9ba2('0x10')]('CreateVoiceAgentReport',_0x4b53dc,JSON[_0x9ba2('0x11')](_0x2fe84c));_0x429355(_0x2fe84c);})[_0x9ba2('0x16')](function(_0x9e5b79){logger[_0x9ba2('0x12')](_0x9ba2('0x17'),_0x9e5b79[_0x9ba2('0x14')],_0x4b53dc);_0x53259c(_0x529f85[_0x9ba2('0x12')](0x1f4,_0x9e5b79[_0x9ba2('0x14')]));});});};exports[_0x9ba2('0x1d')]=function(_0x2b3a23){var _0x5258bb=this;return new Promise(function(_0x494a01,_0x1865e8){return db['VoiceAgentReport']['update'](_0x2b3a23['body'],{'raw':_0x2b3a23[_0x9ba2('0x1b')]?_0x2b3a23[_0x9ba2('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b3a23['options']?_0x2b3a23[_0x9ba2('0x1b')]['where']||null:null,'attributes':_0x2b3a23[_0x9ba2('0x1b')]?_0x2b3a23[_0x9ba2('0x1b')][_0x9ba2('0x1e')]||null:null,'limit':_0x2b3a23[_0x9ba2('0x1b')]?_0x2b3a23[_0x9ba2('0x1b')][_0x9ba2('0x1f')]||null:null})['then'](function(_0x5d25fe){logger[_0x9ba2('0xd')]('UpdateVoiceAgentReport',_0x2b3a23);logger[_0x9ba2('0x10')](_0x9ba2('0x1d'),_0x2b3a23,JSON[_0x9ba2('0x11')](_0x5d25fe));_0x494a01(_0x5d25fe);})[_0x9ba2('0x16')](function(_0x23555c){logger[_0x9ba2('0x12')](_0x9ba2('0x1d'),_0x23555c['message'],_0x2b3a23);_0x1865e8(_0x5258bb['error'](0x1f4,_0x23555c[_0x9ba2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index fc24741..9e0ad52 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 _0x1e0f=['../../components/auth/service','get','isAuthenticated','index','/describe','show','post','put','/:id','update','/with-retry/:id','updateWithRetry','delete','destroy','exports','express','Router'];(function(_0x13a5e2,_0x4e2d46){var _0x42c586=function(_0x935b12){while(--_0x935b12){_0x13a5e2['push'](_0x13a5e2['shift']());}};_0x42c586(++_0x4e2d46);}(_0x1e0f,0x174));var _0xf1e0=function(_0x3cd546,_0x2f0f3f){_0x3cd546=_0x3cd546-0x0;var _0x14d27f=_0x1e0f[_0x3cd546];return _0x14d27f;};'use strict';var express=require(_0xf1e0('0x0'));var router=express[_0xf1e0('0x1')]();var auth=require(_0xf1e0('0x2'));var controller=require('./voiceCallReport.controller');router[_0xf1e0('0x3')]('/',auth[_0xf1e0('0x4')](),controller[_0xf1e0('0x5')]);router[_0xf1e0('0x3')](_0xf1e0('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0xf1e0('0x3')]('/:id',auth[_0xf1e0('0x4')](),controller[_0xf1e0('0x7')]);router[_0xf1e0('0x8')]('/',auth[_0xf1e0('0x4')](),controller['create']);router[_0xf1e0('0x9')](_0xf1e0('0xa'),auth['isAuthenticated'](),controller[_0xf1e0('0xb')]);router[_0xf1e0('0x9')](_0xf1e0('0xc'),auth[_0xf1e0('0x4')](),controller[_0xf1e0('0xd')]);router[_0xf1e0('0xe')](_0xf1e0('0xa'),auth[_0xf1e0('0x4')](),controller[_0xf1e0('0xf')]);module[_0xf1e0('0x10')]=router; \ No newline at end of file +var _0x8290=['post','create','update','put','/with-retry/:id','updateWithRetry','delete','destroy','exports','Router','../../components/auth/service','get','isAuthenticated','index','describe','/:id','show'];(function(_0x169e4c,_0x3ea606){var _0x485da1=function(_0xf6a3b7){while(--_0xf6a3b7){_0x169e4c['push'](_0x169e4c['shift']());}};_0x485da1(++_0x3ea606);}(_0x8290,0x1e5));var _0x0829=function(_0x277234,_0x228c78){_0x277234=_0x277234-0x0;var _0x20bafa=_0x8290[_0x277234];return _0x20bafa;};'use strict';var express=require('express');var router=express[_0x0829('0x0')]();var auth=require(_0x0829('0x1'));var controller=require('./voiceCallReport.controller');router[_0x0829('0x2')]('/',auth[_0x0829('0x3')](),controller[_0x0829('0x4')]);router[_0x0829('0x2')]('/describe',auth[_0x0829('0x3')](),controller[_0x0829('0x5')]);router[_0x0829('0x2')](_0x0829('0x6'),auth[_0x0829('0x3')](),controller[_0x0829('0x7')]);router[_0x0829('0x8')]('/',auth[_0x0829('0x3')](),controller[_0x0829('0x9')]);router['put'](_0x0829('0x6'),auth[_0x0829('0x3')](),controller[_0x0829('0xa')]);router[_0x0829('0xb')](_0x0829('0xc'),auth[_0x0829('0x3')](),controller[_0x0829('0xd')]);router[_0x0829('0xe')]('/:id',auth[_0x0829('0x3')](),controller[_0x0829('0xf')]);module[_0x0829('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index e0ee606..3f80e77 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 _0x5c3c=['STRING','ENUM','internal','outbound','inbound-fax','outbound-fax','dialer','DATE','INTEGER','sequelize','exports'];(function(_0x552dee,_0x1e45b0){var _0x30072e=function(_0x151eca){while(--_0x151eca){_0x552dee['push'](_0x552dee['shift']());}};_0x30072e(++_0x1e45b0);}(_0x5c3c,0x132));var _0xc5c3=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x5c3c[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require(_0xc5c3('0x0'));module[_0xc5c3('0x1')]={'uniqueid':{'type':Sequelize[_0xc5c3('0x2')]},'type':{'type':Sequelize[_0xc5c3('0x3')]('inbound',_0xc5c3('0x4'),_0xc5c3('0x5'),_0xc5c3('0x6'),_0xc5c3('0x7'),_0xc5c3('0x8'))},'tag':{'type':Sequelize[_0xc5c3('0x2')]},'accountcode':{'type':Sequelize[_0xc5c3('0x2')]},'source':{'type':Sequelize[_0xc5c3('0x2')]},'destination':{'type':Sequelize[_0xc5c3('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xc5c3('0x2')]},'lastapplication':{'type':Sequelize[_0xc5c3('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xc5c3('0x9')]},'systemanswertime':{'type':Sequelize[_0xc5c3('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc5c3('0x9')]},'duration':{'type':Sequelize[_0xc5c3('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xc5c3('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc5c3('0x2')]},'amaflags':{'type':Sequelize[_0xc5c3('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xc5c3('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xc5c3('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc5c3('0x2')]},'prefix':{'type':Sequelize[_0xc5c3('0x2')]},'routeid':{'type':Sequelize[_0xc5c3('0xa')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xea12=['dialer','TEXT','DATE','sequelize','exports','STRING','ENUM','internal','outbound','outbound-fax'];(function(_0x2c5255,_0x4340c3){var _0x30d0ea=function(_0x131ba1){while(--_0x131ba1){_0x2c5255['push'](_0x2c5255['shift']());}};_0x30d0ea(++_0x4340c3);}(_0xea12,0x1c5));var _0x2ea1=function(_0x57a44c,_0x1a41e3){_0x57a44c=_0x57a44c-0x0;var _0x3fd165=_0xea12[_0x57a44c];return _0x3fd165;};'use strict';var Sequelize=require(_0x2ea1('0x0'));module[_0x2ea1('0x1')]={'uniqueid':{'type':Sequelize[_0x2ea1('0x2')]},'type':{'type':Sequelize[_0x2ea1('0x3')]('inbound',_0x2ea1('0x4'),_0x2ea1('0x5'),'inbound-fax',_0x2ea1('0x6'),_0x2ea1('0x7'))},'tag':{'type':Sequelize[_0x2ea1('0x2')]},'accountcode':{'type':Sequelize[_0x2ea1('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x2ea1('0x2')]},'destinationcontext':{'type':Sequelize[_0x2ea1('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2ea1('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x2ea1('0x8')]},'starttime':{'type':Sequelize[_0x2ea1('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x2ea1('0x9')]},'endtime':{'type':Sequelize[_0x2ea1('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2ea1('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x2ea1('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x2ea1('0x2')]},'note':{'type':Sequelize[_0x2ea1('0x2')]},'prefix':{'type':Sequelize[_0x2ea1('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 9ee64a6..b6f7f3f 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 _0x757a=['undefined','limit','count','then','destroy','end','sendStatus','error','stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','fullname','alias','User','findAll','rows','show','params','includeAll','create','catch','find','describe','user','body','uniqueid','No\x20such\x20report','update','../../components/parsers/qs','../../config/logger','promise-retry','bluebird','status','offset'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x757a,0xde));var _0xa757=function(_0x4f3313,_0x464020){_0x4f3313=_0x4f3313-0x0;var _0x30a4ee=_0x757a[_0x4f3313];return _0x30a4ee;};'use strict';var _=require('lodash');var qs=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var db=require('../../mysqldb')['db'];var Promise=require('bluebird');const promiseRetry=require(_0xa757('0x2'));const {resolve}=require(_0xa757('0x3'));function respondWithResult(_0x1c2932,_0x453d07){_0x453d07=_0x453d07||0xc8;return function(_0x32630d){if(_0x32630d){return _0x1c2932[_0xa757('0x4')](_0x453d07)['json'](_0x32630d);}};}function respondWithFilteredResult(_0xae0e7c,_0x4343b6){return function(_0x53be0e){if(_0x53be0e){var _0x2930fa=typeof _0x4343b6[_0xa757('0x5')]===_0xa757('0x6')&&typeof _0x4343b6[_0xa757('0x7')]===_0xa757('0x6');var _0x5aef8a=_0x53be0e[_0xa757('0x8')];var _0x2ca96f=_0x2930fa?0x0:_0x4343b6[_0xa757('0x5')];var _0x3e2c9a=_0x2930fa?_0x53be0e[_0xa757('0x8')]:_0x4343b6[_0xa757('0x5')]+_0x4343b6[_0xa757('0x7')];var _0x483d77;if(_0x3e2c9a>=_0x5aef8a){_0x3e2c9a=_0x5aef8a;_0x483d77=0xc8;}else{_0x483d77=0xce;}_0xae0e7c['status'](_0x483d77);return _0xae0e7c['set']('Content-Range',_0x2ca96f+'-'+_0x3e2c9a+'/'+_0x5aef8a)['json'](_0x53be0e);}return null;};}function saveUpdates(_0x421040){return function(_0x544b45){if(_0x544b45){return _0x544b45['update'](_0x421040)[_0xa757('0x9')](function(_0x513b1f){return _0x513b1f;});}return null;};}function removeEntity(_0x481508){return function(_0x32112b){if(_0x32112b){return _0x32112b[_0xa757('0xa')]()[_0xa757('0x9')](function(){_0x481508[_0xa757('0x4')](0xcc)[_0xa757('0xb')]();});}};}function handleEntityNotFound(_0x31cfd2){return function(_0xf12b68){if(!_0xf12b68){_0x31cfd2[_0xa757('0xc')](0x194);}return _0xf12b68;};}function handleError(_0x185011,_0x3df1f9){_0x3df1f9=_0x3df1f9||0x1f4;return function(_0x50aac1){logger[_0xa757('0xd')](_0x50aac1[_0xa757('0xe')]);if(_0x50aac1[_0xa757('0xf')]){delete _0x50aac1['name'];}_0x185011['status'](_0x3df1f9)[_0xa757('0x10')](_0x50aac1);};}exports[_0xa757('0x11')]=function(_0x1bd14c,_0x340599){var _0x27f4ba={},_0xe2d567={},_0x4bd137={'count':0x0,'rows':[]};var _0x58954=_['map'](db[_0xa757('0x12')][_0xa757('0x13')],function(_0x14014c){return{'name':_0x14014c[_0xa757('0x14')],'type':_0x14014c['type']['key']};});_0xe2d567[_0xa757('0x15')]=_[_0xa757('0x16')](_0x58954,_0xa757('0xf'));_0xe2d567[_0xa757('0x17')]=_[_0xa757('0x18')](_0x1bd14c[_0xa757('0x17')]);_0xe2d567[_0xa757('0x19')]=_[_0xa757('0x1a')](_0xe2d567[_0xa757('0x15')],_0xe2d567['query']);_0x27f4ba[_0xa757('0x1b')]=_['intersection'](_0xe2d567[_0xa757('0x15')],qs['fields'](_0x1bd14c[_0xa757('0x17')][_0xa757('0x1c')]));_0x27f4ba[_0xa757('0x1b')]=_0x27f4ba['attributes'][_0xa757('0x1d')]?_0x27f4ba[_0xa757('0x1b')]:_0xe2d567[_0xa757('0x15')];if(!_0x1bd14c[_0xa757('0x17')]['hasOwnProperty'](_0xa757('0x1e'))){_0x27f4ba['limit']=qs['limit'](_0x1bd14c['query']['limit']);_0x27f4ba[_0xa757('0x5')]=qs['offset'](_0x1bd14c[_0xa757('0x17')][_0xa757('0x5')]);}_0x27f4ba['order']=qs[_0xa757('0x1f')](_0x1bd14c['query'][_0xa757('0x1f')]);_0x27f4ba[_0xa757('0x20')]=qs['filters'](_[_0xa757('0x21')](_0x1bd14c['query'],_0xe2d567[_0xa757('0x19')]),_0x58954);if(_0x1bd14c[_0xa757('0x17')][_0xa757('0x22')]){_0x27f4ba[_0xa757('0x20')]=_[_0xa757('0x23')](_0x27f4ba[_0xa757('0x20')],{'$or':_[_0xa757('0x16')](_0x58954,function(_0x2220df){if(_0x2220df[_0xa757('0x24')]!==_0xa757('0x25')){var _0x1f5d5a={};_0x1f5d5a[_0x2220df[_0xa757('0xf')]]={'$like':'%'+_0x1bd14c[_0xa757('0x17')][_0xa757('0x22')]+'%'};return _0x1f5d5a;}})});}_0x27f4ba=_[_0xa757('0x23')]({},_0x27f4ba,_0x1bd14c[_0xa757('0x26')]);var _0x3e64b7={'where':_0x27f4ba[_0xa757('0x20')]};return db[_0xa757('0x12')][_0xa757('0x8')](_0x3e64b7)[_0xa757('0x9')](function(_0x170aa9){_0x4bd137[_0xa757('0x8')]=_0x170aa9;if(_0x1bd14c[_0xa757('0x17')]['includeAll']){_0x27f4ba[_0xa757('0x27')]=[{'attributes':['id',_0xa757('0xf'),_0xa757('0x28'),_0xa757('0x29')],'model':db[_0xa757('0x2a')],'as':'User'}];}return db[_0xa757('0x12')][_0xa757('0x2b')](_0x27f4ba);})[_0xa757('0x9')](function(_0x2c34b1){_0x4bd137[_0xa757('0x2c')]=_0x2c34b1;return _0x4bd137;})[_0xa757('0x9')](respondWithFilteredResult(_0x340599,_0x27f4ba))['catch'](handleError(_0x340599,null));};exports[_0xa757('0x2d')]=function(_0x444639,_0x2cade7){var _0xc34409={'raw':!![],'where':{'id':_0x444639[_0xa757('0x2e')]['id']}},_0x3b5104={};_0x3b5104[_0xa757('0x15')]=_[_0xa757('0x18')](db[_0xa757('0x12')]['rawAttributes']);_0x3b5104[_0xa757('0x17')]=_[_0xa757('0x18')](_0x444639[_0xa757('0x17')]);_0x3b5104[_0xa757('0x19')]=_[_0xa757('0x1a')](_0x3b5104[_0xa757('0x15')],_0x3b5104['query']);_0xc34409[_0xa757('0x1b')]=_[_0xa757('0x1a')](_0x3b5104['model'],qs['fields'](_0x444639[_0xa757('0x17')][_0xa757('0x1c')]));_0xc34409['attributes']=_0xc34409['attributes'][_0xa757('0x1d')]?_0xc34409[_0xa757('0x1b')]:_0x3b5104[_0xa757('0x15')];if(_0x444639['query'][_0xa757('0x2f')]){_0xc34409[_0xa757('0x27')]=[{'all':!![]}];}_0xc34409=_[_0xa757('0x23')]({},_0xc34409,_0x444639[_0xa757('0x26')]);return db[_0xa757('0x12')]['find'](_0xc34409)[_0xa757('0x9')](handleEntityNotFound(_0x2cade7,null))['then'](respondWithResult(_0x2cade7,null))['catch'](handleError(_0x2cade7,null));};exports[_0xa757('0x30')]=function(_0x57298b,_0x373747){return db[_0xa757('0x12')][_0xa757('0x30')](_0x57298b['body'],{})['then'](respondWithResult(_0x373747,0xc9))[_0xa757('0x31')](handleError(_0x373747,null));};exports[_0xa757('0xa')]=function(_0x2b171c,_0xe03a3c){return db[_0xa757('0x12')][_0xa757('0x32')]({'where':{'id':_0x2b171c['params']['id']}})[_0xa757('0x9')](handleEntityNotFound(_0xe03a3c,null))[_0xa757('0x9')](removeEntity(_0xe03a3c,null))['catch'](handleError(_0xe03a3c,null));};exports[_0xa757('0x33')]=function(_0x515123,_0x2d111e){return db[_0xa757('0x12')]['describe']()[_0xa757('0x9')](respondWithResult(_0x2d111e,null))[_0xa757('0x31')](handleError(_0x2d111e,null));};function findForUpdate(_0x4bee69){return db[_0xa757('0x12')][_0xa757('0x32')]({'where':{'uniqueid':_0x4bee69[_0xa757('0x2e')]['id'],'UserId':{'$or':[null,_0x4bee69[_0xa757('0x34')]['id']]}}});}exports['update']=function(_0x199dc9,_0x1be3bb){if(_0x199dc9[_0xa757('0x35')][_0xa757('0x36')]){delete _0x199dc9['body'][_0xa757('0x36')];}return findForUpdate(_0x199dc9)['then'](handleEntityNotFound(_0x1be3bb,null))['then'](saveUpdates(_0x199dc9[_0xa757('0x35')],null))[_0xa757('0x9')](respondWithResult(_0x1be3bb,null))[_0xa757('0x31')](handleError(_0x1be3bb,null));};exports['updateWithRetry']=function(_0x421c65,_0x560c6c,_0x2ed63f){if(_0x421c65[_0xa757('0x35')][_0xa757('0x36')]){delete _0x421c65[_0xa757('0x35')][_0xa757('0x36')];}promiseRetry(function(){return new Promise(function(_0x1f21c0,_0x57bf73){findForUpdate(_0x421c65)[_0xa757('0x9')](function(_0x581e95){if(_0x581e95){_0x1f21c0(_0x581e95);}else _0x57bf73(_0xa757('0x37'));});});},{'retries':0x6,'minTimeout':0xfa})[_0xa757('0x9')](function(_0x33347a){if(!_0x33347a){return new Promise(function(_0x29434d){_0x29434d(handleEntityNotFound(_0x560c6c)());});}else{return _0x33347a[_0xa757('0x38')](_0x421c65[_0xa757('0x35')])[_0xa757('0x9')](function(_0x2c5b3c){return respondWithResult(_0x560c6c)(_0x2c5b3c);});}},function(){handleEntityNotFound(_0x560c6c)();});}; \ No newline at end of file +var _0x2032=['stack','name','send','map','VoiceCallReport','key','keys','intersection','model','query','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','count','includeAll','include','fullname','alias','rows','show','rawAttributes','catch','create','body','find','params','describe','user','update','uniqueid','updateWithRetry','../../components/parsers/qs','../../config/logger','api','bluebird','promise-retry','status','json','offset','undefined','set','Content-Range','destroy','then','end','sendStatus'];(function(_0x2514cf,_0x100247){var _0x29bc71=function(_0x383aa5){while(--_0x383aa5){_0x2514cf['push'](_0x2514cf['shift']());}};_0x29bc71(++_0x100247);}(_0x2032,0xd9));var _0x2203=function(_0x460fb0,_0x1b0f23){_0x460fb0=_0x460fb0-0x0;var _0x315d78=_0x2032[_0x460fb0];return _0x315d78;};'use strict';var _=require('lodash');var qs=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var db=require('../../mysqldb')['db'];var Promise=require(_0x2203('0x3'));const promiseRetry=require(_0x2203('0x4'));const {resolve}=require('bluebird');function respondWithResult(_0x46c49a,_0x880dcd){_0x880dcd=_0x880dcd||0xc8;return function(_0x44ccfd){if(_0x44ccfd){return _0x46c49a[_0x2203('0x5')](_0x880dcd)[_0x2203('0x6')](_0x44ccfd);}};}function respondWithFilteredResult(_0x13367a,_0x2e0f63){return function(_0x2676aa){if(_0x2676aa){var _0x18c4d6=typeof _0x2e0f63[_0x2203('0x7')]===_0x2203('0x8')&&typeof _0x2e0f63['limit']==='undefined';var _0x10f055=_0x2676aa['count'];var _0x27081c=_0x18c4d6?0x0:_0x2e0f63[_0x2203('0x7')];var _0x6339c4=_0x18c4d6?_0x2676aa['count']:_0x2e0f63[_0x2203('0x7')]+_0x2e0f63['limit'];var _0x3f690a;if(_0x6339c4>=_0x10f055){_0x6339c4=_0x10f055;_0x3f690a=0xc8;}else{_0x3f690a=0xce;}_0x13367a['status'](_0x3f690a);return _0x13367a[_0x2203('0x9')](_0x2203('0xa'),_0x27081c+'-'+_0x6339c4+'/'+_0x10f055)['json'](_0x2676aa);}return null;};}function saveUpdates(_0x583bc7){return function(_0x585c76){if(_0x585c76){return _0x585c76['update'](_0x583bc7)['then'](function(_0x238772){return _0x238772;});}return null;};}function removeEntity(_0x538b30){return function(_0x592e47){if(_0x592e47){return _0x592e47[_0x2203('0xb')]()[_0x2203('0xc')](function(){_0x538b30[_0x2203('0x5')](0xcc)[_0x2203('0xd')]();});}};}function handleEntityNotFound(_0x226209){return function(_0x3fe0a8){if(!_0x3fe0a8){_0x226209[_0x2203('0xe')](0x194);}return _0x3fe0a8;};}function handleError(_0x2c085c,_0xdf9d0b){_0xdf9d0b=_0xdf9d0b||0x1f4;return function(_0x3053f3){logger['error'](_0x3053f3[_0x2203('0xf')]);if(_0x3053f3[_0x2203('0x10')]){delete _0x3053f3['name'];}_0x2c085c[_0x2203('0x5')](_0xdf9d0b)[_0x2203('0x11')](_0x3053f3);};}exports['index']=function(_0x30c6f7,_0x5ee83c){var _0x2904ba={},_0x310b8c={},_0x3c8c34={'count':0x0,'rows':[]};var _0x3b4034=_[_0x2203('0x12')](db[_0x2203('0x13')]['rawAttributes'],function(_0x13d3f7){return{'name':_0x13d3f7['fieldName'],'type':_0x13d3f7['type'][_0x2203('0x14')]};});_0x310b8c['model']=_[_0x2203('0x12')](_0x3b4034,_0x2203('0x10'));_0x310b8c['query']=_[_0x2203('0x15')](_0x30c6f7['query']);_0x310b8c['filters']=_[_0x2203('0x16')](_0x310b8c[_0x2203('0x17')],_0x310b8c[_0x2203('0x18')]);_0x2904ba[_0x2203('0x19')]=_[_0x2203('0x16')](_0x310b8c[_0x2203('0x17')],qs[_0x2203('0x1a')](_0x30c6f7[_0x2203('0x18')]['fields']));_0x2904ba[_0x2203('0x19')]=_0x2904ba[_0x2203('0x19')][_0x2203('0x1b')]?_0x2904ba['attributes']:_0x310b8c[_0x2203('0x17')];if(!_0x30c6f7[_0x2203('0x18')]['hasOwnProperty'](_0x2203('0x1c'))){_0x2904ba[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x30c6f7[_0x2203('0x18')][_0x2203('0x1d')]);_0x2904ba[_0x2203('0x7')]=qs[_0x2203('0x7')](_0x30c6f7['query'][_0x2203('0x7')]);}_0x2904ba[_0x2203('0x1e')]=qs[_0x2203('0x1f')](_0x30c6f7[_0x2203('0x18')]['sort']);_0x2904ba[_0x2203('0x20')]=qs[_0x2203('0x21')](_[_0x2203('0x22')](_0x30c6f7[_0x2203('0x18')],_0x310b8c['filters']),_0x3b4034);if(_0x30c6f7[_0x2203('0x18')][_0x2203('0x23')]){_0x2904ba['where']=_['merge'](_0x2904ba[_0x2203('0x20')],{'$or':_['map'](_0x3b4034,function(_0x58b44d){if(_0x58b44d[_0x2203('0x24')]!==_0x2203('0x25')){var _0x191894={};_0x191894[_0x58b44d[_0x2203('0x10')]]={'$like':'%'+_0x30c6f7[_0x2203('0x18')]['filter']+'%'};return _0x191894;}})});}_0x2904ba=_[_0x2203('0x26')]({},_0x2904ba,_0x30c6f7[_0x2203('0x27')]);var _0x49caec={'where':_0x2904ba[_0x2203('0x20')]};return db[_0x2203('0x13')][_0x2203('0x28')](_0x49caec)[_0x2203('0xc')](function(_0x43fee1){_0x3c8c34[_0x2203('0x28')]=_0x43fee1;if(_0x30c6f7[_0x2203('0x18')][_0x2203('0x29')]){_0x2904ba[_0x2203('0x2a')]=[{'attributes':['id','name',_0x2203('0x2b'),_0x2203('0x2c')],'model':db['User'],'as':'User'}];}return db[_0x2203('0x13')]['findAll'](_0x2904ba);})[_0x2203('0xc')](function(_0x3b1eeb){_0x3c8c34[_0x2203('0x2d')]=_0x3b1eeb;return _0x3c8c34;})['then'](respondWithFilteredResult(_0x5ee83c,_0x2904ba))['catch'](handleError(_0x5ee83c,null));};exports[_0x2203('0x2e')]=function(_0x47c93a,_0x2d0365){var _0x5cfe5e={'raw':!![],'where':{'id':_0x47c93a['params']['id']}},_0x11451e={};_0x11451e[_0x2203('0x17')]=_[_0x2203('0x15')](db[_0x2203('0x13')][_0x2203('0x2f')]);_0x11451e[_0x2203('0x18')]=_['keys'](_0x47c93a['query']);_0x11451e['filters']=_[_0x2203('0x16')](_0x11451e[_0x2203('0x17')],_0x11451e[_0x2203('0x18')]);_0x5cfe5e[_0x2203('0x19')]=_[_0x2203('0x16')](_0x11451e[_0x2203('0x17')],qs[_0x2203('0x1a')](_0x47c93a['query'][_0x2203('0x1a')]));_0x5cfe5e[_0x2203('0x19')]=_0x5cfe5e[_0x2203('0x19')][_0x2203('0x1b')]?_0x5cfe5e['attributes']:_0x11451e['model'];if(_0x47c93a[_0x2203('0x18')]['includeAll']){_0x5cfe5e[_0x2203('0x2a')]=[{'all':!![]}];}_0x5cfe5e=_[_0x2203('0x26')]({},_0x5cfe5e,_0x47c93a[_0x2203('0x27')]);return db['VoiceCallReport']['find'](_0x5cfe5e)[_0x2203('0xc')](handleEntityNotFound(_0x2d0365,null))[_0x2203('0xc')](respondWithResult(_0x2d0365,null))[_0x2203('0x30')](handleError(_0x2d0365,null));};exports[_0x2203('0x31')]=function(_0x372709,_0x1fa734){return db['VoiceCallReport'][_0x2203('0x31')](_0x372709[_0x2203('0x32')],{})[_0x2203('0xc')](respondWithResult(_0x1fa734,0xc9))[_0x2203('0x30')](handleError(_0x1fa734,null));};exports[_0x2203('0xb')]=function(_0x36b99f,_0x5b4842){return db[_0x2203('0x13')][_0x2203('0x33')]({'where':{'id':_0x36b99f[_0x2203('0x34')]['id']}})['then'](handleEntityNotFound(_0x5b4842,null))[_0x2203('0xc')](removeEntity(_0x5b4842,null))[_0x2203('0x30')](handleError(_0x5b4842,null));};exports[_0x2203('0x35')]=function(_0x3b9981,_0x4c3259){return db['VoiceCallReport'][_0x2203('0x35')]()['then'](respondWithResult(_0x4c3259,null))[_0x2203('0x30')](handleError(_0x4c3259,null));};function findForUpdate(_0x15a8e8){return db[_0x2203('0x13')][_0x2203('0x33')]({'where':{'uniqueid':_0x15a8e8['params']['id'],'UserId':{'$or':[null,_0x15a8e8[_0x2203('0x36')]['id']]}}});}exports[_0x2203('0x37')]=function(_0x5cd8c6,_0x29bd91){if(_0x5cd8c6[_0x2203('0x32')][_0x2203('0x38')]){delete _0x5cd8c6[_0x2203('0x32')]['uniqueid'];}return findForUpdate(_0x5cd8c6)['then'](handleEntityNotFound(_0x29bd91,null))[_0x2203('0xc')](saveUpdates(_0x5cd8c6['body'],null))['then'](respondWithResult(_0x29bd91,null))[_0x2203('0x30')](handleError(_0x29bd91,null));};exports[_0x2203('0x39')]=function(_0x1a2665,_0x49823a,_0x4c1496){if(_0x1a2665[_0x2203('0x32')][_0x2203('0x38')]){delete _0x1a2665[_0x2203('0x32')][_0x2203('0x38')];}promiseRetry(function(){return new Promise(function(_0x225b0e,_0x21fd78){findForUpdate(_0x1a2665)['then'](function(_0x747dce){if(_0x747dce){_0x225b0e(_0x747dce);}else _0x21fd78('No\x20such\x20report');});});},{'retries':0x6,'minTimeout':0xfa})[_0x2203('0xc')](function(_0x39ff6f){if(!_0x39ff6f){return new Promise(function(_0x246aff){_0x246aff(handleEntityNotFound(_0x49823a)());});}else{return _0x39ff6f[_0x2203('0x37')](_0x1a2665['body'])['then'](function(_0x30d503){return respondWithResult(_0x49823a)(_0x30d503);});}},function(){handleEntityNotFound(_0x49823a)();});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 1a27571..568c9dc 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 _0x793b=['../../config/logger','api','request-promise','rimraf','./voiceCallReport.attributes','VoiceCallReport','report_call','uniqueid','lodash','util'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x793b,0x1f2));var _0xb793=function(_0x51a9cb,_0x21e94b){_0x51a9cb=_0x51a9cb-0x0;var _0x80089c=_0x793b[_0x51a9cb];return _0x80089c;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var logger=require(_0xb793('0x2'))(_0xb793('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb793('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb793('0x5'));var config=require('../../config/environment');var attributes=require(_0xb793('0x6'));module['exports']=function(_0x4ce4cd,_0x410084){return _0x4ce4cd['define'](_0xb793('0x7'),attributes,{'tableName':_0xb793('0x8'),'paranoid':![],'indexes':[{'fields':[_0xb793('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcab6=['bluebird','request-promise','path','../../config/environment','exports','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x3cd97d,_0x400ff2){var _0x54ac9a=function(_0x595018){while(--_0x595018){_0x3cd97d['push'](_0x3cd97d['shift']());}};_0x54ac9a(++_0x400ff2);}(_0xcab6,0xd4));var _0x6cab=function(_0x1e501c,_0x5b8286){_0x1e501c=_0x1e501c-0x0;var _0x15bb4c=_0xcab6[_0x1e501c];return _0x15bb4c;};'use strict';var _=require(_0x6cab('0x0'));var util=require('util');var logger=require(_0x6cab('0x1'))(_0x6cab('0x2'));var moment=require(_0x6cab('0x3'));var BPromise=require(_0x6cab('0x4'));var rp=require(_0x6cab('0x5'));var fs=require('fs');var path=require(_0x6cab('0x6'));var rimraf=require('rimraf');var config=require(_0x6cab('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0x6cab('0x8')]=function(_0x1953cd,_0x13464a){return _0x1953cd['define'](_0x6cab('0x9'),attributes,{'tableName':_0x6cab('0xa'),'paranoid':![],'indexes':[{'fields':[_0x6cab('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 602de01..1fa57ca 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 _0x438a=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','raw','options','where','attributes','limit','include','map','model','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','lodash','util','bluebird'];(function(_0x2bafdc,_0x3e5c3b){var _0x50ed6b=function(_0xb57f54){while(--_0xb57f54){_0x2bafdc['push'](_0x2bafdc['shift']());}};_0x50ed6b(++_0x3e5c3b);}(_0x438a,0x141));var _0xa438=function(_0x188408,_0x1b1ec5){_0x188408=_0x188408-0x0;var _0x4e6e3a=_0x438a[_0x188408];return _0x4e6e3a;};'use strict';var _=require(_0xa438('0x0'));var util=require(_0xa438('0x1'));var moment=require('moment');var BPromise=require(_0xa438('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa438('0x3'));var db=require(_0xa438('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa438('0x5'))(_0xa438('0x6'));var config=require('../../config/environment');var jayson=require(_0xa438('0x7'));var client=jayson['client'][_0xa438('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23223b,_0x357ac7,_0xd7b2bf){return new BPromise(function(_0x20a931,_0x277138){return client[_0xa438('0x9')](_0x23223b,_0xd7b2bf)[_0xa438('0xa')](function(_0x550ede){logger[_0xa438('0xb')](_0xa438('0xc'),_0x357ac7,'request\x20sent');logger[_0xa438('0xd')](_0xa438('0xe'),_0x357ac7,_0xa438('0xf'),JSON[_0xa438('0x10')](_0x550ede));if(_0x550ede[_0xa438('0x11')]){if(_0x550ede[_0xa438('0x11')]['code']===0x1f4){logger[_0xa438('0x11')](_0xa438('0xc'),_0x357ac7,_0x550ede['error'][_0xa438('0x12')]);return _0x277138(_0x550ede[_0xa438('0x11')][_0xa438('0x12')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x357ac7,_0x550ede[_0xa438('0x11')][_0xa438('0x12')]);return _0x20a931(_0x550ede[_0xa438('0x11')][_0xa438('0x12')]);}else{logger[_0xa438('0xb')](_0xa438('0xc'),_0x357ac7,_0xa438('0xf'));_0x20a931(_0x550ede[_0xa438('0x13')][_0xa438('0x12')]);}})[_0xa438('0x14')](function(_0xb345c1){logger[_0xa438('0x11')](_0xa438('0xc'),_0x357ac7,_0xb345c1);_0x277138(_0xb345c1);});});}exports[_0xa438('0x15')]=function(_0x296db1){var _0xe138b2=this;return new Promise(function(_0x2417fa,_0x161455){return db[_0xa438('0x16')][_0xa438('0x17')]({'raw':_0x296db1['options']?_0x296db1['options'][_0xa438('0x18')]===undefined?!![]:![]:!![],'where':_0x296db1[_0xa438('0x19')]?_0x296db1[_0xa438('0x19')][_0xa438('0x1a')]||null:null,'attributes':_0x296db1[_0xa438('0x19')]?_0x296db1[_0xa438('0x19')][_0xa438('0x1b')]||null:null,'limit':_0x296db1[_0xa438('0x19')]?_0x296db1[_0xa438('0x19')][_0xa438('0x1c')]||null:null,'include':_0x296db1[_0xa438('0x19')]?_0x296db1[_0xa438('0x19')][_0xa438('0x1d')]?_[_0xa438('0x1e')](_0x296db1[_0xa438('0x19')]['include'],function(_0x59de68){return{'model':db[_0x59de68[_0xa438('0x1f')]],'as':_0x59de68['as'],'attributes':_0x59de68[_0xa438('0x1b')],'include':_0x59de68['include']?_[_0xa438('0x1e')](_0x59de68[_0xa438('0x1d')],function(_0x579fb9){return{'model':db[_0x579fb9[_0xa438('0x1f')]],'as':_0x579fb9['as'],'attributes':_0x579fb9[_0xa438('0x1b')],'include':_0x579fb9[_0xa438('0x1d')]?_[_0xa438('0x1e')](_0x579fb9['include'],function(_0x2ff0bc){return{'model':db[_0x2ff0bc[_0xa438('0x1f')]],'as':_0x2ff0bc['as'],'attributes':_0x2ff0bc[_0xa438('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa438('0xa')](function(_0x2d3d8f){logger[_0xa438('0xb')]('GetVoiceCallReport',_0x296db1);logger[_0xa438('0xd')](_0xa438('0x15'),_0x296db1,JSON[_0xa438('0x10')](_0x2d3d8f));_0x2417fa(_0x2d3d8f);})['catch'](function(_0x3bb73e){logger['error'](_0xa438('0x15'),_0x3bb73e['message'],_0x296db1);_0x161455(_0xe138b2[_0xa438('0x11')](0x1f4,_0x3bb73e[_0xa438('0x12')]));});});};exports['CreateVoiceCallReport']=function(_0x20f64e){var _0x343785=this;return new Promise(function(_0xb861ab,_0x569236){return db['VoiceCallReport'][_0xa438('0x20')](_0x20f64e[_0xa438('0x21')],{'raw':_0x20f64e['options']?_0x20f64e[_0xa438('0x19')][_0xa438('0x18')]===undefined?!![]:![]:!![]})[_0xa438('0xa')](function(_0x39dc2e){logger['info'](_0xa438('0x22'),_0x20f64e);logger[_0xa438('0xd')](_0xa438('0x22'),_0x20f64e,JSON[_0xa438('0x10')](_0x39dc2e));_0xb861ab(_0x39dc2e);})[_0xa438('0x14')](function(_0x4b3046){logger[_0xa438('0x11')](_0xa438('0x22'),_0x4b3046['message'],_0x20f64e);_0x569236(_0x343785[_0xa438('0x11')](0x1f4,_0x4b3046['message']));});});};exports[_0xa438('0x23')]=function(_0x5c1d00){var _0x31ad20=this;return new Promise(function(_0x45119a,_0x3cac13){return db[_0xa438('0x16')]['update'](_0x5c1d00[_0xa438('0x21')],{'raw':_0x5c1d00[_0xa438('0x19')]?_0x5c1d00[_0xa438('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c1d00['options']?_0x5c1d00[_0xa438('0x19')][_0xa438('0x1a')]||null:null,'attributes':_0x5c1d00['options']?_0x5c1d00['options'][_0xa438('0x1b')]||null:null,'limit':_0x5c1d00['options']?_0x5c1d00[_0xa438('0x19')][_0xa438('0x1c')]||null:null})[_0xa438('0xa')](function(_0x34c39b){logger['info']('UpdateVoiceCallReport',_0x5c1d00);logger['debug'](_0xa438('0x23'),_0x5c1d00,JSON[_0xa438('0x10')](_0x34c39b));_0x45119a(_0x34c39b);})['catch'](function(_0x40c8ea){logger[_0xa438('0x11')](_0xa438('0x23'),_0x40c8ea[_0xa438('0x12')],_0x5c1d00);_0x3cac13(_0x31ad20[_0xa438('0x11')](0x1f4,_0x40c8ea[_0xa438('0x12')]));});});}; \ No newline at end of file +var _0xedfb=['body','UpdateVoiceCallReport','update','lodash','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','then','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','catch','VoiceCallReport','raw','options','where','limit','include','model','attributes','map','info','GetVoiceCallReport','CreateVoiceCallReport','create'];(function(_0x39bc4a,_0x595147){var _0x436b0d=function(_0x44e6eb){while(--_0x44e6eb){_0x39bc4a['push'](_0x39bc4a['shift']());}};_0x436b0d(++_0x595147);}(_0xedfb,0x1df));var _0xbedf=function(_0x41074d,_0x19b20f){_0x41074d=_0x41074d-0x0;var _0x1f61b9=_0xedfb[_0x41074d];return _0x1f61b9;};'use strict';var _=require(_0xbedf('0x0'));var util=require('util');var moment=require(_0xbedf('0x1'));var BPromise=require(_0xbedf('0x2'));var rs=require(_0xbedf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbedf('0x4'))('rpc');var config=require(_0xbedf('0x5'));var jayson=require(_0xbedf('0x6'));var client=jayson[_0xbedf('0x7')][_0xbedf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c5526,_0x290477,_0x426445){return new BPromise(function(_0x3aba94,_0x1b8564){return client['request'](_0x3c5526,_0x426445)[_0xbedf('0x9')](function(_0x5c38c9){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x290477,'request\x20sent');logger[_0xbedf('0xa')](_0xbedf('0xb'),_0x290477,'request\x20sent',JSON[_0xbedf('0xc')](_0x5c38c9));if(_0x5c38c9[_0xbedf('0xd')]){if(_0x5c38c9[_0xbedf('0xd')]['code']===0x1f4){logger[_0xbedf('0xd')](_0xbedf('0xe'),_0x290477,_0x5c38c9[_0xbedf('0xd')][_0xbedf('0xf')]);return _0x1b8564(_0x5c38c9['error'][_0xbedf('0xf')]);}logger[_0xbedf('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x290477,_0x5c38c9[_0xbedf('0xd')][_0xbedf('0xf')]);return _0x3aba94(_0x5c38c9[_0xbedf('0xd')][_0xbedf('0xf')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x290477,'request\x20sent');_0x3aba94(_0x5c38c9[_0xbedf('0x10')][_0xbedf('0xf')]);}})[_0xbedf('0x11')](function(_0x197406){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x290477,_0x197406);_0x1b8564(_0x197406);});});}exports['GetVoiceCallReport']=function(_0x50e42f){var _0x3284a8=this;return new Promise(function(_0x4c2e4e,_0x3dac74){return db[_0xbedf('0x12')]['findAll']({'raw':_0x50e42f['options']?_0x50e42f['options'][_0xbedf('0x13')]===undefined?!![]:![]:!![],'where':_0x50e42f[_0xbedf('0x14')]?_0x50e42f[_0xbedf('0x14')][_0xbedf('0x15')]||null:null,'attributes':_0x50e42f['options']?_0x50e42f[_0xbedf('0x14')]['attributes']||null:null,'limit':_0x50e42f[_0xbedf('0x14')]?_0x50e42f[_0xbedf('0x14')][_0xbedf('0x16')]||null:null,'include':_0x50e42f[_0xbedf('0x14')]?_0x50e42f['options'][_0xbedf('0x17')]?_['map'](_0x50e42f[_0xbedf('0x14')]['include'],function(_0x1ef9a6){return{'model':db[_0x1ef9a6[_0xbedf('0x18')]],'as':_0x1ef9a6['as'],'attributes':_0x1ef9a6[_0xbedf('0x19')],'include':_0x1ef9a6[_0xbedf('0x17')]?_['map'](_0x1ef9a6[_0xbedf('0x17')],function(_0x32ea2e){return{'model':db[_0x32ea2e[_0xbedf('0x18')]],'as':_0x32ea2e['as'],'attributes':_0x32ea2e[_0xbedf('0x19')],'include':_0x32ea2e[_0xbedf('0x17')]?_[_0xbedf('0x1a')](_0x32ea2e[_0xbedf('0x17')],function(_0x31bc4f){return{'model':db[_0x31bc4f[_0xbedf('0x18')]],'as':_0x31bc4f['as'],'attributes':_0x31bc4f[_0xbedf('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbedf('0x9')](function(_0x447f76){logger[_0xbedf('0x1b')]('GetVoiceCallReport',_0x50e42f);logger[_0xbedf('0xa')](_0xbedf('0x1c'),_0x50e42f,JSON[_0xbedf('0xc')](_0x447f76));_0x4c2e4e(_0x447f76);})['catch'](function(_0x2b0082){logger['error'](_0xbedf('0x1c'),_0x2b0082[_0xbedf('0xf')],_0x50e42f);_0x3dac74(_0x3284a8[_0xbedf('0xd')](0x1f4,_0x2b0082[_0xbedf('0xf')]));});});};exports[_0xbedf('0x1d')]=function(_0xc124fc){var _0x177325=this;return new Promise(function(_0x54d878,_0xaa4bb5){return db[_0xbedf('0x12')][_0xbedf('0x1e')](_0xc124fc[_0xbedf('0x1f')],{'raw':_0xc124fc[_0xbedf('0x14')]?_0xc124fc[_0xbedf('0x14')][_0xbedf('0x13')]===undefined?!![]:![]:!![]})[_0xbedf('0x9')](function(_0x51ab36){logger[_0xbedf('0x1b')](_0xbedf('0x1d'),_0xc124fc);logger[_0xbedf('0xa')](_0xbedf('0x1d'),_0xc124fc,JSON['stringify'](_0x51ab36));_0x54d878(_0x51ab36);})['catch'](function(_0x2c488e){logger['error'](_0xbedf('0x1d'),_0x2c488e['message'],_0xc124fc);_0xaa4bb5(_0x177325[_0xbedf('0xd')](0x1f4,_0x2c488e[_0xbedf('0xf')]));});});};exports[_0xbedf('0x20')]=function(_0x691ae9){var _0x238fda=this;return new Promise(function(_0x82af73,_0x3ccc2a){return db[_0xbedf('0x12')][_0xbedf('0x21')](_0x691ae9['body'],{'raw':_0x691ae9[_0xbedf('0x14')]?_0x691ae9[_0xbedf('0x14')][_0xbedf('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x691ae9['options']?_0x691ae9[_0xbedf('0x14')][_0xbedf('0x15')]||null:null,'attributes':_0x691ae9[_0xbedf('0x14')]?_0x691ae9[_0xbedf('0x14')][_0xbedf('0x19')]||null:null,'limit':_0x691ae9['options']?_0x691ae9[_0xbedf('0x14')][_0xbedf('0x16')]||null:null})[_0xbedf('0x9')](function(_0x414ec1){logger['info'](_0xbedf('0x20'),_0x691ae9);logger['debug']('UpdateVoiceCallReport',_0x691ae9,JSON['stringify'](_0x414ec1));_0x82af73(_0x414ec1);})['catch'](function(_0x176344){logger[_0xbedf('0xd')](_0xbedf('0x20'),_0x176344['message'],_0x691ae9);_0x3ccc2a(_0x238fda[_0xbedf('0xd')](0x1f4,_0x176344[_0xbedf('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 0d60990..f524089 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 _0xee37=['./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c47f6,_0x8fb731){var _0x92dd97=function(_0x34ac00){while(--_0x34ac00){_0x5c47f6['push'](_0x5c47f6['shift']());}};_0x92dd97(++_0x8fb731);}(_0xee37,0x174));var _0x7ee3=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xee37[_0x4c7935];return _0x30651d;};'use strict';var multer=require('multer');var util=require(_0x7ee3('0x0'));var path=require(_0x7ee3('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ee3('0x2'));var router=express[_0x7ee3('0x3')]();var fs_extra=require(_0x7ee3('0x4'));var auth=require(_0x7ee3('0x5'));var interaction=require(_0x7ee3('0x6'));var config=require(_0x7ee3('0x7'));var controller=require(_0x7ee3('0x8'));router[_0x7ee3('0x9')]('/',auth[_0x7ee3('0xa')](),controller[_0x7ee3('0xb')]);router[_0x7ee3('0x9')](_0x7ee3('0xc'),auth[_0x7ee3('0xa')](),controller[_0x7ee3('0xd')]);router[_0x7ee3('0xe')]('/',auth[_0x7ee3('0xa')](),controller[_0x7ee3('0xf')]);router[_0x7ee3('0x10')](_0x7ee3('0xc'),auth[_0x7ee3('0xa')](),controller['update']);router[_0x7ee3('0x11')]('/:id',auth[_0x7ee3('0xa')](),controller[_0x7ee3('0x12')]);module[_0x7ee3('0x13')]=router; \ No newline at end of file +var _0xfb93=['../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3fb9d7,_0x4367fd){var _0x5d5e93=function(_0x5daad6){while(--_0x5daad6){_0x3fb9d7['push'](_0x3fb9d7['shift']());}};_0x5d5e93(++_0x4367fd);}(_0xfb93,0x1b1));var _0x3fb9=function(_0x526801,_0x3b16ec){_0x526801=_0x526801-0x0;var _0x407391=_0xfb93[_0x526801];return _0x407391;};'use strict';var multer=require(_0x3fb9('0x0'));var util=require(_0x3fb9('0x1'));var path=require(_0x3fb9('0x2'));var timeout=require(_0x3fb9('0x3'));var express=require(_0x3fb9('0x4'));var router=express[_0x3fb9('0x5')]();var fs_extra=require(_0x3fb9('0x6'));var auth=require(_0x3fb9('0x7'));var interaction=require(_0x3fb9('0x8'));var config=require('../../config/environment');var controller=require(_0x3fb9('0x9'));router[_0x3fb9('0xa')]('/',auth[_0x3fb9('0xb')](),controller['index']);router[_0x3fb9('0xa')](_0x3fb9('0xc'),auth[_0x3fb9('0xb')](),controller[_0x3fb9('0xd')]);router[_0x3fb9('0xe')]('/',auth['isAuthenticated'](),controller[_0x3fb9('0xf')]);router[_0x3fb9('0x10')](_0x3fb9('0xc'),auth[_0x3fb9('0xb')](),controller[_0x3fb9('0x11')]);router['delete'](_0x3fb9('0xc'),auth[_0x3fb9('0xb')](),controller[_0x3fb9('0x12')]);module[_0x3fb9('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 3f5ac3c..18b5181 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 _0x22ee=['setDataValue','options','join','getDataValue','split','BOOLEAN','STRING','name'];(function(_0x2f5f64,_0x4fabef){var _0x391069=function(_0x5497ce){while(--_0x5497ce){_0x2f5f64['push'](_0x2f5f64['shift']());}};_0x391069(++_0x4fabef);}(_0x22ee,0xbe));var _0xe22e=function(_0x212b03,_0x1f1b50){_0x212b03=_0x212b03-0x0;var _0x423115=_0x22ee[_0x212b03];return _0x423115;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe22e('0x0')]},'prefix':{'type':Sequelize[_0xe22e('0x0')],'unique':_0xe22e('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0xe22e('0x0')],'set':function(_0x5b7ebd){this[_0xe22e('0x2')](_0xe22e('0x3'),_0x5b7ebd?_0x5b7ebd[_0xe22e('0x4')](''):[]);},'get':function(){return this[_0xe22e('0x5')](_0xe22e('0x3'))?this[_0xe22e('0x5')](_0xe22e('0x3'))[_0xe22e('0x6')](''):[];}},'auth':{'type':Sequelize[_0xe22e('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe22e('0x0')]},'description':{'type':Sequelize[_0xe22e('0x0')]}}; \ No newline at end of file +var _0xe35f=['setDataValue','options','join','getDataValue','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x145454,_0x153353){var _0x369e53=function(_0x3425ce){while(--_0x3425ce){_0x145454['push'](_0x145454['shift']());}};_0x369e53(++_0x153353);}(_0xe35f,0x164));var _0xfe35=function(_0x17b202,_0x1cbeee){_0x17b202=_0x17b202-0x0;var _0x29120b=_0xe35f[_0x17b202];return _0x29120b;};'use strict';var Sequelize=require(_0xfe35('0x0'));module[_0xfe35('0x1')]={'name':{'type':Sequelize[_0xfe35('0x2')]},'prefix':{'type':Sequelize[_0xfe35('0x2')],'unique':_0xfe35('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xfe35('0x2')],'set':function(_0x164634){this[_0xfe35('0x4')](_0xfe35('0x5'),_0x164634?_0x164634[_0xfe35('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xfe35('0x5'))?this[_0xfe35('0x7')](_0xfe35('0x5'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xfe35('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xfe35('0x2')]},'description':{'type':Sequelize[_0xfe35('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 5ab56a0..9143cb1 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 _0x2cbd=['fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','role','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','reject','save','update','then','destroy','get','ChanSpies','error','stack','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x2f269e,_0x59468c){var _0x1a1db0=function(_0xb7be84){while(--_0xb7be84){_0x2f269e['push'](_0x2f269e['shift']());}};_0x1a1db0(++_0x59468c);}(_0x2cbd,0x19e));var _0xd2cb=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0x2cbd[_0x37cc52];return _0x2b4a90;};'use strict';var emlformat=require(_0xd2cb('0x0'));var rimraf=require(_0xd2cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd2cb('0x2'));var rp=require(_0xd2cb('0x3'));var moment=require(_0xd2cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd2cb('0x5'));var util=require(_0xd2cb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd2cb('0x7'));var ejs=require(_0xd2cb('0x8'));var fs=require('fs');var fs_extra=require(_0xd2cb('0x9'));var _=require(_0xd2cb('0xa'));var squel=require('squel');var crypto=require(_0xd2cb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd2cb('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd2cb('0xd'));var Papa=require(_0xd2cb('0xe'));var Redis=require('ioredis');var authService=require(_0xd2cb('0xf'));var qs=require(_0xd2cb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd2cb('0x11'));var logger=require(_0xd2cb('0x12'))(_0xd2cb('0x13'));var utils=require(_0xd2cb('0x14'));var config=require(_0xd2cb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd2cb('0x16'))['db'];function respondWithStatusCode(_0x3f6903,_0x62c951){_0x62c951=_0x62c951||0xcc;return function(_0x1ae36a){if(_0x1ae36a){return _0x3f6903[_0xd2cb('0x17')](_0x62c951);}return _0x3f6903['status'](_0x62c951)[_0xd2cb('0x18')]();};}function respondWithResult(_0xd25e16,_0x1e1ad5){_0x1e1ad5=_0x1e1ad5||0xc8;return function(_0x57e0c9){if(_0x57e0c9){return _0xd25e16[_0xd2cb('0x19')](_0x1e1ad5)[_0xd2cb('0x1a')](_0x57e0c9);}};}function respondWithFilteredResult(_0x501e19,_0x33538d){return function(_0x4ef741){if(_0x4ef741){var _0x4e02f7=typeof _0x33538d[_0xd2cb('0x1b')]===_0xd2cb('0x1c')&&typeof _0x33538d[_0xd2cb('0x1d')]===_0xd2cb('0x1c');var _0x498e27=_0x4ef741['count'];var _0x2f41d1=_0x4e02f7?0x0:_0x33538d[_0xd2cb('0x1b')];var _0x5871e5=_0x4e02f7?_0x4ef741[_0xd2cb('0x1e')]:_0x33538d[_0xd2cb('0x1b')]+_0x33538d[_0xd2cb('0x1d')];var _0x5d385a;if(_0x5871e5>=_0x498e27){_0x5871e5=_0x498e27;_0x5d385a=0xc8;}else{_0x5d385a=0xce;}_0x501e19[_0xd2cb('0x19')](_0x5d385a);return _0x501e19['set']('Content-Range',_0x2f41d1+'-'+_0x5871e5+'/'+_0x498e27)[_0xd2cb('0x1a')](_0x4ef741);}return null;};}function patchUpdates(_0x190cbb){return function(_0x4643a0){try{jsonpatch['apply'](_0x4643a0,_0x190cbb,!![]);}catch(_0x34c00a){return BPromise[_0xd2cb('0x1f')](_0x34c00a);}return _0x4643a0[_0xd2cb('0x20')]();};}function saveUpdates(_0x4618f1,_0x27badc){return function(_0x43154a){if(_0x43154a){return _0x43154a[_0xd2cb('0x21')](_0x4618f1)[_0xd2cb('0x22')](function(_0x5d1499){return _0x5d1499;});}return null;};}function removeEntity(_0x37333a,_0x29f8f0){return function(_0x5dfca2){if(_0x5dfca2){return _0x5dfca2[_0xd2cb('0x23')]()[_0xd2cb('0x22')](function(){var _0x138498=_0x5dfca2[_0xd2cb('0x24')]({'plain':!![]});var _0x46a378=_0xd2cb('0x25');return db['UserProfileResource'][_0xd2cb('0x23')]({'where':{'type':_0x46a378,'resourceId':_0x138498['id']}})['then'](function(){return _0x5dfca2;});})['then'](function(){_0x37333a['status'](0xcc)[_0xd2cb('0x18')]();});}};}function handleEntityNotFound(_0x37cb5e,_0x35ac19){return function(_0x9b502c){if(!_0x9b502c){_0x37cb5e['sendStatus'](0x194);}return _0x9b502c;};}function handleError(_0x30214e,_0x45f762){_0x45f762=_0x45f762||0x1f4;return function(_0xd28ae7){logger[_0xd2cb('0x26')](_0xd28ae7[_0xd2cb('0x27')]);if(_0xd28ae7[_0xd2cb('0x28')]){delete _0xd28ae7[_0xd2cb('0x28')];}_0x30214e[_0xd2cb('0x19')](_0x45f762)[_0xd2cb('0x29')](_0xd28ae7);};}exports[_0xd2cb('0x2a')]=function(_0x568340,_0x3b4b77){var _0x2b6b77={},_0x58e894={},_0x1c3486={'count':0x0,'rows':[]};var _0xfe4dc3=_[_0xd2cb('0x2b')](db[_0xd2cb('0x2c')]['rawAttributes'],function(_0x5af5c8){return{'name':_0x5af5c8[_0xd2cb('0x2d')],'type':_0x5af5c8[_0xd2cb('0x2e')][_0xd2cb('0x2f')]};});_0x58e894[_0xd2cb('0x30')]=_[_0xd2cb('0x2b')](_0xfe4dc3,'name');_0x58e894[_0xd2cb('0x31')]=_[_0xd2cb('0x32')](_0x568340[_0xd2cb('0x31')]);_0x58e894[_0xd2cb('0x33')]=_[_0xd2cb('0x34')](_0x58e894[_0xd2cb('0x30')],_0x58e894[_0xd2cb('0x31')]);_0x2b6b77[_0xd2cb('0x35')]=_['intersection'](_0x58e894[_0xd2cb('0x30')],qs['fields'](_0x568340[_0xd2cb('0x31')][_0xd2cb('0x36')]));_0x2b6b77[_0xd2cb('0x35')]=_0x2b6b77[_0xd2cb('0x35')][_0xd2cb('0x37')]?_0x2b6b77[_0xd2cb('0x35')]:_0x58e894[_0xd2cb('0x30')];if(!_0x568340['query'][_0xd2cb('0x38')]('nolimit')){_0x2b6b77['limit']=qs[_0xd2cb('0x1d')](_0x568340[_0xd2cb('0x31')][_0xd2cb('0x1d')]);_0x2b6b77['offset']=qs[_0xd2cb('0x1b')](_0x568340['query'][_0xd2cb('0x1b')]);}_0x2b6b77['order']=qs['sort'](_0x568340[_0xd2cb('0x31')][_0xd2cb('0x39')]);_0x2b6b77[_0xd2cb('0x3a')]=qs[_0xd2cb('0x33')](_[_0xd2cb('0x3b')](_0x568340[_0xd2cb('0x31')],_0x58e894[_0xd2cb('0x33')]),_0xfe4dc3);if(_0x568340['query']['filter']){_0x2b6b77[_0xd2cb('0x3a')]=_[_0xd2cb('0x3c')](_0x2b6b77[_0xd2cb('0x3a')],{'$or':_[_0xd2cb('0x2b')](_0xfe4dc3,function(_0x3d6077){if(_0x3d6077['type']!==_0xd2cb('0x3d')){var _0x58bdbb={};_0x58bdbb[_0x3d6077['name']]={'$like':'%'+_0x568340[_0xd2cb('0x31')]['filter']+'%'};return _0x58bdbb;}})});}_0x2b6b77=_[_0xd2cb('0x3c')]({},_0x2b6b77,_0x568340[_0xd2cb('0x3e')]);var _0x5647b8={'where':_0x2b6b77[_0xd2cb('0x3a')]};return db[_0xd2cb('0x2c')][_0xd2cb('0x1e')](_0x5647b8)[_0xd2cb('0x22')](function(_0x260450){_0x1c3486['count']=_0x260450;if(_0x568340[_0xd2cb('0x31')][_0xd2cb('0x3f')]){_0x2b6b77[_0xd2cb('0x40')]=[{'all':!![]}];}return db[_0xd2cb('0x2c')][_0xd2cb('0x41')](_0x2b6b77);})[_0xd2cb('0x22')](function(_0x26e204){_0x1c3486[_0xd2cb('0x42')]=_0x26e204;return _0x1c3486;})['then'](respondWithFilteredResult(_0x3b4b77,_0x2b6b77))[_0xd2cb('0x43')](handleError(_0x3b4b77,null));};exports[_0xd2cb('0x44')]=function(_0x1f5621,_0x38733c){var _0x6a3c8d={'raw':![],'where':{'id':_0x1f5621[_0xd2cb('0x45')]['id']}},_0x11ccc5={};_0x11ccc5[_0xd2cb('0x30')]=_[_0xd2cb('0x32')](db['VoiceChanSpy'][_0xd2cb('0x46')]);_0x11ccc5[_0xd2cb('0x31')]=_[_0xd2cb('0x32')](_0x1f5621[_0xd2cb('0x31')]);_0x11ccc5[_0xd2cb('0x33')]=_['intersection'](_0x11ccc5[_0xd2cb('0x30')],_0x11ccc5[_0xd2cb('0x31')]);_0x6a3c8d[_0xd2cb('0x35')]=_[_0xd2cb('0x34')](_0x11ccc5['model'],qs[_0xd2cb('0x36')](_0x1f5621[_0xd2cb('0x31')][_0xd2cb('0x36')]));_0x6a3c8d['attributes']=_0x6a3c8d[_0xd2cb('0x35')][_0xd2cb('0x37')]?_0x6a3c8d[_0xd2cb('0x35')]:_0x11ccc5[_0xd2cb('0x30')];if(_0x1f5621[_0xd2cb('0x31')]['includeAll']){_0x6a3c8d[_0xd2cb('0x40')]=[{'all':!![]}];}_0x6a3c8d=_[_0xd2cb('0x3c')]({},_0x6a3c8d,_0x1f5621['options']);return db[_0xd2cb('0x2c')]['find'](_0x6a3c8d)[_0xd2cb('0x22')](handleEntityNotFound(_0x38733c,null))[_0xd2cb('0x22')](respondWithResult(_0x38733c,null))[_0xd2cb('0x43')](handleError(_0x38733c,null));};exports[_0xd2cb('0x47')]=function(_0x1e716b,_0x3d6d4d){return db[_0xd2cb('0x2c')]['create'](_0x1e716b['body'],{})['then'](function(_0x57bd98){var _0x1a57f0=_0x1e716b['user'][_0xd2cb('0x24')]({'plain':!![]});if(!_0x1a57f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a57f0[_0xd2cb('0x48')]===_0xd2cb('0x49')){var _0x2eea67=_0x57bd98[_0xd2cb('0x24')]({'plain':!![]});var _0x4bc134='ChanSpies';return db[_0xd2cb('0x4a')][_0xd2cb('0x4b')]({'where':{'name':_0x4bc134,'userProfileId':_0x1a57f0['userProfileId']},'raw':!![]})['then'](function(_0x3ec8a7){if(_0x3ec8a7&&_0x3ec8a7['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2eea67[_0xd2cb('0x28')],'resourceId':_0x2eea67['id'],'type':_0x3ec8a7[_0xd2cb('0x28')],'sectionId':_0x3ec8a7['id']},{})[_0xd2cb('0x22')](function(){return _0x57bd98;});}else{return _0x57bd98;}})[_0xd2cb('0x43')](function(_0xee02d4){logger[_0xd2cb('0x26')](_0xd2cb('0x4c'),_0xee02d4);throw _0xee02d4;});}return _0x57bd98;})[_0xd2cb('0x22')](respondWithResult(_0x3d6d4d,0xc9))[_0xd2cb('0x43')](handleError(_0x3d6d4d,null));};exports[_0xd2cb('0x21')]=function(_0x14dced,_0xd7af1f){if(_0x14dced['body']['id']){delete _0x14dced[_0xd2cb('0x4d')]['id'];}return db[_0xd2cb('0x2c')][_0xd2cb('0x4b')]({'where':{'id':_0x14dced[_0xd2cb('0x45')]['id']}})[_0xd2cb('0x22')](handleEntityNotFound(_0xd7af1f,null))[_0xd2cb('0x22')](saveUpdates(_0x14dced[_0xd2cb('0x4d')],null))['then'](respondWithResult(_0xd7af1f,null))[_0xd2cb('0x43')](handleError(_0xd7af1f,null));};exports[_0xd2cb('0x23')]=function(_0x280678,_0x47bad8){return db['VoiceChanSpy'][_0xd2cb('0x4b')]({'where':{'id':_0x280678[_0xd2cb('0x45')]['id']}})[_0xd2cb('0x22')](handleEntityNotFound(_0x47bad8,null))[_0xd2cb('0x22')](removeEntity(_0x47bad8,null))[_0xd2cb('0x43')](handleError(_0x47bad8,null));}; \ No newline at end of file +var _0x261b=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ChanSpies','error','name','index','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','eml-format','rimraf','bluebird','util','sox','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','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x49db15,_0x1f79a4){var _0x47792f=function(_0x3eea43){while(--_0x3eea43){_0x49db15['push'](_0x49db15['shift']());}};_0x47792f(++_0x1f79a4);}(_0x261b,0x15a));var _0xb261=function(_0x3d6ca9,_0x4ffec9){_0x3d6ca9=_0x3d6ca9-0x0;var _0x232dab=_0x261b[_0x3d6ca9];return _0x232dab;};'use strict';var emlformat=require(_0xb261('0x0'));var rimraf=require(_0xb261('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb261('0x2'));var Mustache=require('mustache');var util=require(_0xb261('0x3'));var path=require('path');var sox=require(_0xb261('0x4'));var csv=require('to-csv');var ejs=require(_0xb261('0x5'));var fs=require('fs');var fs_extra=require(_0xb261('0x6'));var _=require(_0xb261('0x7'));var squel=require(_0xb261('0x8'));var crypto=require('crypto');var jsforce=require(_0xb261('0x9'));var deskjs=require(_0xb261('0xa'));var toCsv=require(_0xb261('0xb'));var querystring=require(_0xb261('0xc'));var Papa=require('papaparse');var Redis=require(_0xb261('0xd'));var authService=require(_0xb261('0xe'));var qs=require(_0xb261('0xf'));var as=require(_0xb261('0x10'));var hardwareService=require(_0xb261('0x11'));var logger=require(_0xb261('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb261('0x13'));var db=require(_0xb261('0x14'))['db'];function respondWithStatusCode(_0x41d0b1,_0x12a127){_0x12a127=_0x12a127||0xcc;return function(_0x5bdd2f){if(_0x5bdd2f){return _0x41d0b1[_0xb261('0x15')](_0x12a127);}return _0x41d0b1['status'](_0x12a127)['end']();};}function respondWithResult(_0x37d9a1,_0x1d4733){_0x1d4733=_0x1d4733||0xc8;return function(_0x2eec26){if(_0x2eec26){return _0x37d9a1[_0xb261('0x16')](_0x1d4733)[_0xb261('0x17')](_0x2eec26);}};}function respondWithFilteredResult(_0x25d68c,_0x343e8f){return function(_0x1de1f1){if(_0x1de1f1){var _0x394e65=typeof _0x343e8f[_0xb261('0x18')]===_0xb261('0x19')&&typeof _0x343e8f[_0xb261('0x1a')]==='undefined';var _0x456c72=_0x1de1f1[_0xb261('0x1b')];var _0x416f96=_0x394e65?0x0:_0x343e8f[_0xb261('0x18')];var _0x53c7e3=_0x394e65?_0x1de1f1[_0xb261('0x1b')]:_0x343e8f[_0xb261('0x18')]+_0x343e8f[_0xb261('0x1a')];var _0x2a1afa;if(_0x53c7e3>=_0x456c72){_0x53c7e3=_0x456c72;_0x2a1afa=0xc8;}else{_0x2a1afa=0xce;}_0x25d68c[_0xb261('0x16')](_0x2a1afa);return _0x25d68c[_0xb261('0x1c')](_0xb261('0x1d'),_0x416f96+'-'+_0x53c7e3+'/'+_0x456c72)[_0xb261('0x17')](_0x1de1f1);}return null;};}function patchUpdates(_0x45f6d8){return function(_0x3681bc){try{jsonpatch[_0xb261('0x1e')](_0x3681bc,_0x45f6d8,!![]);}catch(_0x226a61){return BPromise[_0xb261('0x1f')](_0x226a61);}return _0x3681bc[_0xb261('0x20')]();};}function saveUpdates(_0x15a3ed,_0x2beab8){return function(_0x102664){if(_0x102664){return _0x102664['update'](_0x15a3ed)[_0xb261('0x21')](function(_0x576217){return _0x576217;});}return null;};}function removeEntity(_0x269301,_0x575119){return function(_0x1ddac9){if(_0x1ddac9){return _0x1ddac9[_0xb261('0x22')]()[_0xb261('0x21')](function(){var _0x1dbe11=_0x1ddac9[_0xb261('0x23')]({'plain':!![]});var _0x1d37a3=_0xb261('0x24');return db['UserProfileResource'][_0xb261('0x22')]({'where':{'type':_0x1d37a3,'resourceId':_0x1dbe11['id']}})[_0xb261('0x21')](function(){return _0x1ddac9;});})[_0xb261('0x21')](function(){_0x269301['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x165a2d,_0x1b9066){return function(_0x1d7bc3){if(!_0x1d7bc3){_0x165a2d[_0xb261('0x15')](0x194);}return _0x1d7bc3;};}function handleError(_0x1e72f0,_0x5ecfad){_0x5ecfad=_0x5ecfad||0x1f4;return function(_0x181ae8){logger[_0xb261('0x25')](_0x181ae8['stack']);if(_0x181ae8[_0xb261('0x26')]){delete _0x181ae8[_0xb261('0x26')];}_0x1e72f0[_0xb261('0x16')](_0x5ecfad)['send'](_0x181ae8);};}exports[_0xb261('0x27')]=function(_0x5279de,_0x3d45e7){var _0x2def32={},_0x2060dc={},_0x3a470a={'count':0x0,'rows':[]};var _0x2222a7=_[_0xb261('0x28')](db[_0xb261('0x29')][_0xb261('0x2a')],function(_0x349901){return{'name':_0x349901['fieldName'],'type':_0x349901[_0xb261('0x2b')][_0xb261('0x2c')]};});_0x2060dc[_0xb261('0x2d')]=_[_0xb261('0x28')](_0x2222a7,'name');_0x2060dc[_0xb261('0x2e')]=_[_0xb261('0x2f')](_0x5279de[_0xb261('0x2e')]);_0x2060dc[_0xb261('0x30')]=_['intersection'](_0x2060dc['model'],_0x2060dc[_0xb261('0x2e')]);_0x2def32['attributes']=_[_0xb261('0x31')](_0x2060dc[_0xb261('0x2d')],qs[_0xb261('0x32')](_0x5279de[_0xb261('0x2e')][_0xb261('0x32')]));_0x2def32[_0xb261('0x33')]=_0x2def32[_0xb261('0x33')][_0xb261('0x34')]?_0x2def32['attributes']:_0x2060dc[_0xb261('0x2d')];if(!_0x5279de[_0xb261('0x2e')]['hasOwnProperty'](_0xb261('0x35'))){_0x2def32['limit']=qs[_0xb261('0x1a')](_0x5279de[_0xb261('0x2e')][_0xb261('0x1a')]);_0x2def32[_0xb261('0x18')]=qs['offset'](_0x5279de[_0xb261('0x2e')][_0xb261('0x18')]);}_0x2def32[_0xb261('0x36')]=qs[_0xb261('0x37')](_0x5279de[_0xb261('0x2e')]['sort']);_0x2def32[_0xb261('0x38')]=qs[_0xb261('0x30')](_[_0xb261('0x39')](_0x5279de[_0xb261('0x2e')],_0x2060dc[_0xb261('0x30')]),_0x2222a7);if(_0x5279de[_0xb261('0x2e')]['filter']){_0x2def32[_0xb261('0x38')]=_['merge'](_0x2def32[_0xb261('0x38')],{'$or':_['map'](_0x2222a7,function(_0x35a238){if(_0x35a238[_0xb261('0x2b')]!==_0xb261('0x3a')){var _0x58bebd={};_0x58bebd[_0x35a238['name']]={'$like':'%'+_0x5279de[_0xb261('0x2e')]['filter']+'%'};return _0x58bebd;}})});}_0x2def32=_[_0xb261('0x3b')]({},_0x2def32,_0x5279de[_0xb261('0x3c')]);var _0x5ea3b9={'where':_0x2def32[_0xb261('0x38')]};return db['VoiceChanSpy'][_0xb261('0x1b')](_0x5ea3b9)[_0xb261('0x21')](function(_0x4824e1){_0x3a470a[_0xb261('0x1b')]=_0x4824e1;if(_0x5279de[_0xb261('0x2e')][_0xb261('0x3d')]){_0x2def32[_0xb261('0x3e')]=[{'all':!![]}];}return db[_0xb261('0x29')][_0xb261('0x3f')](_0x2def32);})[_0xb261('0x21')](function(_0x5ac809){_0x3a470a[_0xb261('0x40')]=_0x5ac809;return _0x3a470a;})['then'](respondWithFilteredResult(_0x3d45e7,_0x2def32))[_0xb261('0x41')](handleError(_0x3d45e7,null));};exports['show']=function(_0x16d53a,_0x41feee){var _0x929ce={'raw':![],'where':{'id':_0x16d53a[_0xb261('0x42')]['id']}},_0x3ae3b4={};_0x3ae3b4[_0xb261('0x2d')]=_['keys'](db[_0xb261('0x29')][_0xb261('0x2a')]);_0x3ae3b4['query']=_['keys'](_0x16d53a['query']);_0x3ae3b4[_0xb261('0x30')]=_['intersection'](_0x3ae3b4[_0xb261('0x2d')],_0x3ae3b4[_0xb261('0x2e')]);_0x929ce[_0xb261('0x33')]=_['intersection'](_0x3ae3b4[_0xb261('0x2d')],qs['fields'](_0x16d53a[_0xb261('0x2e')][_0xb261('0x32')]));_0x929ce[_0xb261('0x33')]=_0x929ce[_0xb261('0x33')][_0xb261('0x34')]?_0x929ce[_0xb261('0x33')]:_0x3ae3b4[_0xb261('0x2d')];if(_0x16d53a[_0xb261('0x2e')][_0xb261('0x3d')]){_0x929ce[_0xb261('0x3e')]=[{'all':!![]}];}_0x929ce=_[_0xb261('0x3b')]({},_0x929ce,_0x16d53a[_0xb261('0x3c')]);return db[_0xb261('0x29')]['find'](_0x929ce)['then'](handleEntityNotFound(_0x41feee,null))[_0xb261('0x21')](respondWithResult(_0x41feee,null))[_0xb261('0x41')](handleError(_0x41feee,null));};exports[_0xb261('0x43')]=function(_0x51bb24,_0x348c61){return db['VoiceChanSpy'][_0xb261('0x43')](_0x51bb24[_0xb261('0x44')],{})[_0xb261('0x21')](function(_0x18846e){var _0x32fa7e=_0x51bb24[_0xb261('0x45')][_0xb261('0x23')]({'plain':!![]});if(!_0x32fa7e)throw new Error(_0xb261('0x46'));if(_0x32fa7e[_0xb261('0x47')]===_0xb261('0x45')){var _0x4acf43=_0x18846e['get']({'plain':!![]});var _0x377628='ChanSpies';return db['UserProfileSection'][_0xb261('0x48')]({'where':{'name':_0x377628,'userProfileId':_0x32fa7e['userProfileId']},'raw':!![]})['then'](function(_0x3447c6){if(_0x3447c6&&_0x3447c6[_0xb261('0x49')]===0x0){return db['UserProfileResource'][_0xb261('0x43')]({'name':_0x4acf43['name'],'resourceId':_0x4acf43['id'],'type':_0x3447c6[_0xb261('0x26')],'sectionId':_0x3447c6['id']},{})['then'](function(){return _0x18846e;});}else{return _0x18846e;}})[_0xb261('0x41')](function(_0x4b1095){logger[_0xb261('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b1095);throw _0x4b1095;});}return _0x18846e;})[_0xb261('0x21')](respondWithResult(_0x348c61,0xc9))['catch'](handleError(_0x348c61,null));};exports['update']=function(_0x1f23cb,_0x165bdd){if(_0x1f23cb[_0xb261('0x44')]['id']){delete _0x1f23cb[_0xb261('0x44')]['id'];}return db['VoiceChanSpy'][_0xb261('0x48')]({'where':{'id':_0x1f23cb[_0xb261('0x42')]['id']}})[_0xb261('0x21')](handleEntityNotFound(_0x165bdd,null))[_0xb261('0x21')](saveUpdates(_0x1f23cb['body'],null))[_0xb261('0x21')](respondWithResult(_0x165bdd,null))[_0xb261('0x41')](handleError(_0x165bdd,null));};exports[_0xb261('0x22')]=function(_0x5076a0,_0x56eabc){return db['VoiceChanSpy'][_0xb261('0x48')]({'where':{'id':_0x5076a0[_0xb261('0x42')]['id']}})[_0xb261('0x21')](handleEntityNotFound(_0x56eabc,null))[_0xb261('0x21')](removeEntity(_0x56eabc,null))[_0xb261('0x41')](handleError(_0x56eabc,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 3ed4b63..0f2c3ce 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 _0xa0a3=['MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','name','options','join','StopMixMonitor','length','concat','internal','agent','then','catch','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','%s%s','prefix','push','merge','Set','format','CDR(type)=%s','chanspy','record'];(function(_0x1fc034,_0x56fd41){var _0xfbc45e=function(_0x103036){while(--_0x103036){_0x1fc034['push'](_0x1fc034['shift']());}};_0xfbc45e(++_0x56fd41);}(_0xa0a3,0x11a));var _0x3a0a=function(_0x5d0491,_0x102187){_0x5d0491=_0x5d0491-0x0;var _0x363aa9=_0xa0a3[_0x5d0491];return _0x363aa9;};'use strict';var _=require(_0x3a0a('0x0'));var util=require(_0x3a0a('0x1'));var BPromise=require(_0x3a0a('0x2'));var attributes=require(_0x3a0a('0x3'));var getUserApplications=function(_0x1167b9,_0x519ac0,_0x435561){var _0x5856f8=0x1;var _0x992af8=[];var _0x171e71={'context':_0x519ac0['context']||_0x3a0a('0x4'),'exten':util['format'](_0x3a0a('0x5'),_0x1167b9[_0x3a0a('0x6')],_0x435561),'type':'system','isApp':![],'ChanSpyId':_0x1167b9['id'],'UserId':_0x519ac0['id']};_0x992af8[_0x3a0a('0x7')](_[_0x3a0a('0x8')]({'app':_0x3a0a('0x9'),'appdata':util[_0x3a0a('0xa')](_0x3a0a('0xb'),_0x3a0a('0xc')),'priority':_0x5856f8++},_0x171e71));if(_0x1167b9[_0x3a0a('0xd')]){_0x992af8[_0x3a0a('0x7')](_[_0x3a0a('0x8')]({'app':_0x3a0a('0xe'),'appdata':util[_0x3a0a('0xa')](_0x3a0a('0xf'),_0x1167b9[_0x3a0a('0x10')]),'priority':_0x5856f8++},_0x171e71));}if(_0x1167b9[_0x3a0a('0x11')]){_0x992af8['push'](_[_0x3a0a('0x8')]({'app':_0x3a0a('0x12'),'appdata':_0x1167b9[_0x3a0a('0x13')],'priority':_0x5856f8++},_0x171e71));}_0x992af8[_0x3a0a('0x7')](_[_0x3a0a('0x8')]({'app':_0x3a0a('0x14'),'appdata':util[_0x3a0a('0xa')]('SIP/%s,%s',_0x519ac0[_0x3a0a('0x15')],_0x1167b9[_0x3a0a('0x16')]?_0x1167b9['options'][_0x3a0a('0x17')](''):''),'priority':_0x5856f8++},_0x171e71));if(_0x1167b9[_0x3a0a('0xd')]){_0x992af8[_0x3a0a('0x7')](_['merge']({'app':_0x3a0a('0x18'),'priority':_0x5856f8++},_0x171e71));}return _0x992af8;};var getChanSpyApplications=function(_0x359ba8,_0x4a69f7){var _0x20db10=[];for(var _0xd02082=0x0,_0x181be1=0x1;_0xd02082<_0x4a69f7[_0x3a0a('0x19')];_0xd02082++,_0x181be1=0x1){_0x20db10=_0x20db10[_0x3a0a('0x1a')](getUserApplications(_0x359ba8,_0x4a69f7[_0xd02082],_0x4a69f7[_0xd02082][_0x3a0a('0x1b')]));if(_0x4a69f7[_0xd02082][_0x3a0a('0x1b')]!=_0x4a69f7[_0xd02082][_0x3a0a('0x15')]){_0x20db10=_0x20db10[_0x3a0a('0x1a')](getUserApplications(_0x359ba8,_0x4a69f7[_0xd02082],_0x4a69f7[_0xd02082]['name']));}}return _0x20db10;};var getChanSpyPromise=function(_0xd15e78,_0x166a0c){return new BPromise(function(_0x3995ac,_0xfc295b){return _0xd15e78['User']['findAll']({'attributes':['id',_0x3a0a('0x15'),_0x3a0a('0x1b')],'where':{'role':_0x3a0a('0x1c'),'chanspy':!![]},'raw':!![]})[_0x3a0a('0x1d')](function(_0x76f423){if(_0x76f423){return _0x3995ac(getChanSpyApplications(_0x166a0c,_0x76f423));}return _0x3995ac([]);})[_0x3a0a('0x1e')](function(_0x50da79){_0xfc295b(_0x50da79);});});};module['exports']=function(_0x282b82,_0x376dd5){var _0x4af68c=_0x282b82['models'];return _0x282b82[_0x3a0a('0x1f')](_0x3a0a('0x20'),attributes,{'tableName':_0x3a0a('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b58cd,_0x2410ce,_0x380525){return getChanSpyPromise(_0x4af68c,_0x5b58cd)[_0x3a0a('0x1d')](function(_0x502024){if(_0x502024&&_0x502024[_0x3a0a('0x19')]){return _0x4af68c[_0x3a0a('0x22')][_0x3a0a('0x23')](_0x502024);}})['then'](function(){_0x380525();})[_0x3a0a('0x1e')](function(_0x27dd26){_0x380525(_0x27dd26);});},'afterUpdate':function(_0x8178a3,_0x3b73dc,_0x3db9ea){return _0x4af68c['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x8178a3['id']}})[_0x3a0a('0x1d')](function(){return getChanSpyPromise(_0x4af68c,_0x8178a3);})[_0x3a0a('0x1d')](function(_0x584bb3){if(_0x584bb3&&_0x584bb3['length']){return _0x4af68c[_0x3a0a('0x22')]['bulkCreate'](_0x584bb3);}})[_0x3a0a('0x1d')](function(){_0x3db9ea();})[_0x3a0a('0x1e')](function(_0x5c6c25){_0x3db9ea(_0x5c6c25);});},'afterDestroy':function(_0x18a22d,_0x41bcb8,_0x61a00a){return _0x4af68c[_0x3a0a('0x22')][_0x3a0a('0x24')]({'where':{'ChanSpyId':_0x18a22d['id']}})['then'](function(){_0x61a00a();})['catch'](function(_0x2d61a9){_0x61a00a(_0x2d61a9);});}}});}; \ No newline at end of file +var _0x86e3=['ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','define','voice_chanspy','VoiceExtension','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','merge','Set','CDR(type)=%s','record','push','${UNIQUEID}.%s,a','auth','Authenticate','password'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x86e3,0xf0));var _0x386e=function(_0x3d2ac7,_0x370d0d){_0x3d2ac7=_0x3d2ac7-0x0;var _0x5e1d92=_0x86e3[_0x3d2ac7];return _0x5e1d92;};'use strict';var _=require(_0x386e('0x0'));var util=require(_0x386e('0x1'));var BPromise=require(_0x386e('0x2'));var attributes=require(_0x386e('0x3'));var getUserApplications=function(_0x2182c7,_0x5ebf5c,_0x3d85ca){var _0x90eb66=0x1;var _0x52e3c0=[];var _0x2dcd28={'context':_0x5ebf5c[_0x386e('0x4')]||_0x386e('0x5'),'exten':util[_0x386e('0x6')](_0x386e('0x7'),_0x2182c7[_0x386e('0x8')],_0x3d85ca),'type':_0x386e('0x9'),'isApp':![],'ChanSpyId':_0x2182c7['id'],'UserId':_0x5ebf5c['id']};_0x52e3c0['push'](_[_0x386e('0xa')]({'app':_0x386e('0xb'),'appdata':util['format'](_0x386e('0xc'),'chanspy'),'priority':_0x90eb66++},_0x2dcd28));if(_0x2182c7[_0x386e('0xd')]){_0x52e3c0[_0x386e('0xe')](_[_0x386e('0xa')]({'app':'MixMonitor','appdata':util[_0x386e('0x6')](_0x386e('0xf'),_0x2182c7['recordingFormat']),'priority':_0x90eb66++},_0x2dcd28));}if(_0x2182c7[_0x386e('0x10')]){_0x52e3c0[_0x386e('0xe')](_['merge']({'app':_0x386e('0x11'),'appdata':_0x2182c7[_0x386e('0x12')],'priority':_0x90eb66++},_0x2dcd28));}_0x52e3c0[_0x386e('0xe')](_[_0x386e('0xa')]({'app':_0x386e('0x13'),'appdata':util[_0x386e('0x6')](_0x386e('0x14'),_0x5ebf5c[_0x386e('0x15')],_0x2182c7[_0x386e('0x16')]?_0x2182c7[_0x386e('0x16')][_0x386e('0x17')](''):''),'priority':_0x90eb66++},_0x2dcd28));if(_0x2182c7[_0x386e('0xd')]){_0x52e3c0[_0x386e('0xe')](_[_0x386e('0xa')]({'app':_0x386e('0x18'),'priority':_0x90eb66++},_0x2dcd28));}return _0x52e3c0;};var getChanSpyApplications=function(_0x4c053b,_0x42d8d5){var _0xca3d25=[];for(var _0x11b09d=0x0,_0xf37efa=0x1;_0x11b09d<_0x42d8d5[_0x386e('0x19')];_0x11b09d++,_0xf37efa=0x1){_0xca3d25=_0xca3d25[_0x386e('0x1a')](getUserApplications(_0x4c053b,_0x42d8d5[_0x11b09d],_0x42d8d5[_0x11b09d][_0x386e('0x1b')]));if(_0x42d8d5[_0x11b09d]['internal']!=_0x42d8d5[_0x11b09d]['name']){_0xca3d25=_0xca3d25['concat'](getUserApplications(_0x4c053b,_0x42d8d5[_0x11b09d],_0x42d8d5[_0x11b09d][_0x386e('0x15')]));}}return _0xca3d25;};var getChanSpyPromise=function(_0x32527e,_0x49ff5b){return new BPromise(function(_0x2b6253,_0x1eaaa8){return _0x32527e[_0x386e('0x1c')][_0x386e('0x1d')]({'attributes':['id','name','internal'],'where':{'role':_0x386e('0x1e'),'chanspy':!![]},'raw':!![]})[_0x386e('0x1f')](function(_0x412168){if(_0x412168){return _0x2b6253(getChanSpyApplications(_0x49ff5b,_0x412168));}return _0x2b6253([]);})[_0x386e('0x20')](function(_0xe03540){_0x1eaaa8(_0xe03540);});});};module[_0x386e('0x21')]=function(_0x56968f,_0x2adcf4){var _0x360de5=_0x56968f['models'];return _0x56968f[_0x386e('0x22')]('VoiceChanSpy',attributes,{'tableName':_0x386e('0x23'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x41aafc,_0x2a5c8d,_0x5abcc2){return getChanSpyPromise(_0x360de5,_0x41aafc)[_0x386e('0x1f')](function(_0x509642){if(_0x509642&&_0x509642[_0x386e('0x19')]){return _0x360de5[_0x386e('0x24')]['bulkCreate'](_0x509642);}})[_0x386e('0x1f')](function(){_0x5abcc2();})[_0x386e('0x20')](function(_0x3c3852){_0x5abcc2(_0x3c3852);});},'afterUpdate':function(_0x36e7df,_0x20397b,_0x556803){return _0x360de5['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x36e7df['id']}})[_0x386e('0x1f')](function(){return getChanSpyPromise(_0x360de5,_0x36e7df);})[_0x386e('0x1f')](function(_0x1e2b51){if(_0x1e2b51&&_0x1e2b51[_0x386e('0x19')]){return _0x360de5[_0x386e('0x24')]['bulkCreate'](_0x1e2b51);}})[_0x386e('0x1f')](function(){_0x556803();})[_0x386e('0x20')](function(_0x1b549b){_0x556803(_0x1b549b);});},'afterDestroy':function(_0x4a9828,_0x42f1af,_0x3c5fc1){return _0x360de5[_0x386e('0x24')]['destroy']({'where':{'ChanSpyId':_0x4a9828['id']}})['then'](function(){_0x3c5fc1();})[_0x386e('0x20')](function(_0x15a9fb){_0x3c5fc1(_0x15a9fb);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 7b45698..e6782a3 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 _0x2504=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x532268,_0x91703){var _0x5c8ef4=function(_0x4926aa){while(--_0x4926aa){_0x532268['push'](_0x532268['shift']());}};_0x5c8ef4(++_0x91703);}(_0x2504,0xee));var _0x4250=function(_0x165d12,_0x48ef85){_0x165d12=_0x165d12-0x0;var _0x5b2694=_0x2504[_0x165d12];return _0x5b2694;};'use strict';var _=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var moment=require(_0x4250('0x2'));var BPromise=require(_0x4250('0x3'));var rs=require(_0x4250('0x4'));var fs=require('fs');var Redis=require(_0x4250('0x5'));var db=require(_0x4250('0x6'))['db'];var utils=require(_0x4250('0x7'));var logger=require(_0x4250('0x8'))(_0x4250('0x9'));var config=require(_0x4250('0xa'));var jayson=require(_0x4250('0xb'));var client=jayson['client'][_0x4250('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e177e,_0x5a5286,_0x370998){return new BPromise(function(_0x477312,_0x1a3b57){return client[_0x4250('0xd')](_0x4e177e,_0x370998)[_0x4250('0xe')](function(_0x51ea6f){logger[_0x4250('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x5a5286,_0x4250('0x10'));logger[_0x4250('0x11')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x5a5286,_0x4250('0x10'),JSON['stringify'](_0x51ea6f));if(_0x51ea6f['error']){if(_0x51ea6f[_0x4250('0x12')][_0x4250('0x13')]===0x1f4){logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x51ea6f[_0x4250('0x12')]['message']);return _0x1a3b57(_0x51ea6f[_0x4250('0x12')][_0x4250('0x15')]);}logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x51ea6f[_0x4250('0x12')][_0x4250('0x15')]);return _0x477312(_0x51ea6f['error'][_0x4250('0x15')]);}else{logger[_0x4250('0xf')](_0x4250('0x14'),_0x5a5286,_0x4250('0x10'));_0x477312(_0x51ea6f[_0x4250('0x16')][_0x4250('0x15')]);}})[_0x4250('0x17')](function(_0x4e70fc){logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x4e70fc);_0x1a3b57(_0x4e70fc);});});} \ No newline at end of file +var _0x780f=['VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info'];(function(_0x5adb27,_0x40a12c){var _0x4903f5=function(_0xafb1b6){while(--_0xafb1b6){_0x5adb27['push'](_0x5adb27['shift']());}};_0x4903f5(++_0x40a12c);}(_0x780f,0x6c));var _0xf780=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0x780f[_0x5eef05];return _0x56d4b8;};'use strict';var _=require(_0xf780('0x0'));var util=require(_0xf780('0x1'));var moment=require(_0xf780('0x2'));var BPromise=require(_0xf780('0x3'));var rs=require(_0xf780('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf780('0x5'));var logger=require(_0xf780('0x6'))(_0xf780('0x7'));var config=require(_0xf780('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf780('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bd856,_0x93539d,_0x1c3fdc){return new BPromise(function(_0xa12d00,_0x44f14c){return client[_0xf780('0xa')](_0x1bd856,_0x1c3fdc)['then'](function(_0x2c8221){logger[_0xf780('0xb')](_0xf780('0xc'),_0x93539d,_0xf780('0xd'));logger[_0xf780('0xe')](_0xf780('0xf'),_0x93539d,_0xf780('0xd'),JSON['stringify'](_0x2c8221));if(_0x2c8221['error']){if(_0x2c8221[_0xf780('0x10')][_0xf780('0x11')]===0x1f4){logger[_0xf780('0x10')](_0xf780('0xc'),_0x93539d,_0x2c8221['error'][_0xf780('0x12')]);return _0x44f14c(_0x2c8221[_0xf780('0x10')][_0xf780('0x12')]);}logger[_0xf780('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x93539d,_0x2c8221[_0xf780('0x10')]['message']);return _0xa12d00(_0x2c8221[_0xf780('0x10')][_0xf780('0x12')]);}else{logger[_0xf780('0xb')](_0xf780('0xc'),_0x93539d,_0xf780('0xd'));_0xa12d00(_0x2c8221[_0xf780('0x13')][_0xf780('0x12')]);}})['catch'](function(_0x450198){logger[_0xf780('0x10')](_0xf780('0xc'),_0x93539d,_0x450198);_0x44f14c(_0x450198);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 0ffe5ac..b00e948 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 _0x7dd5=['create','/:id','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','show','post'];(function(_0x182454,_0x4c25dd){var _0x262191=function(_0x492c19){while(--_0x492c19){_0x182454['push'](_0x182454['shift']());}};_0x262191(++_0x4c25dd);}(_0x7dd5,0x1f2));var _0x57dd=function(_0x368550,_0x3a68e3){_0x368550=_0x368550-0x0;var _0xa32093=_0x7dd5[_0x368550];return _0xa32093;};'use strict';var multer=require(_0x57dd('0x0'));var util=require(_0x57dd('0x1'));var path=require(_0x57dd('0x2'));var timeout=require(_0x57dd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x57dd('0x4'));var auth=require(_0x57dd('0x5'));var interaction=require(_0x57dd('0x6'));var config=require('../../config/environment');var controller=require(_0x57dd('0x7'));router[_0x57dd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x57dd('0x8')]('/:id',auth[_0x57dd('0x9')](),controller[_0x57dd('0xa')]);router[_0x57dd('0xb')]('/',auth['isAuthenticated'](),controller[_0x57dd('0xc')]);router['put'](_0x57dd('0xd'),auth[_0x57dd('0x9')](),controller[_0x57dd('0xe')]);router[_0x57dd('0xf')](_0x57dd('0xd'),auth[_0x57dd('0x9')](),controller['destroy']);module[_0x57dd('0x10')]=router; \ No newline at end of file +var _0x063f=['fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router'];(function(_0x428a02,_0xa49307){var _0x58ade9=function(_0x323d2a){while(--_0x323d2a){_0x428a02['push'](_0x428a02['shift']());}};_0x58ade9(++_0xa49307);}(_0x063f,0x88));var _0xf063=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x063f[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0xf063('0x0'));var util=require(_0xf063('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf063('0x2'));var router=express[_0xf063('0x3')]();var fs_extra=require(_0xf063('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf063('0x5'));var config=require(_0xf063('0x6'));var controller=require(_0xf063('0x7'));router[_0xf063('0x8')]('/',auth['isAuthenticated'](),controller[_0xf063('0x9')]);router[_0xf063('0x8')](_0xf063('0xa'),auth[_0xf063('0xb')](),controller[_0xf063('0xc')]);router[_0xf063('0xd')]('/',auth[_0xf063('0xb')](),controller[_0xf063('0xe')]);router[_0xf063('0xf')](_0xf063('0xa'),auth[_0xf063('0xb')](),controller[_0xf063('0x10')]);router[_0xf063('0x11')](_0xf063('0xa'),auth[_0xf063('0xb')](),controller[_0xf063('0x12')]);module[_0xf063('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 93dc2be..e7adc7d 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 _0xa9cd=['sequelize','STRING','BOOLEAN'];(function(_0x49d7ca,_0x514fc4){var _0x12422f=function(_0x2bc407){while(--_0x2bc407){_0x49d7ca['push'](_0x49d7ca['shift']());}};_0x12422f(++_0x514fc4);}(_0xa9cd,0x171));var _0xda9c=function(_0x52f213,_0x12c342){_0x52f213=_0x52f213-0x0;var _0x3a555b=_0xa9cd[_0x52f213];return _0x3a555b;};'use strict';var Sequelize=require(_0xda9c('0x0'));module['exports']={'name':{'type':Sequelize[_0xda9c('0x1')],'unique':'name'},'description':{'type':Sequelize[_0xda9c('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xda9c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3f93=['exports','name','BOOLEAN','sequelize'];(function(_0x583da8,_0x150df0){var _0x174915=function(_0x13aeca){while(--_0x13aeca){_0x583da8['push'](_0x583da8['shift']());}};_0x174915(++_0x150df0);}(_0x3f93,0x18f));var _0x33f9=function(_0x3ee81e,_0x73781b){_0x3ee81e=_0x3ee81e-0x0;var _0x21b709=_0x3f93[_0x3ee81e];return _0x21b709;};'use strict';var Sequelize=require(_0x33f9('0x0'));module[_0x33f9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x33f9('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x33f9('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 0f21e32..cb8b495 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 _0xc440=['sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','then','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','VoiceContext','includeAll','rows','params','include','find','create','body','readFileSync','join','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','server/files/templates/context.ejs','render','Reload','utf8','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x490001,_0x383b57){var _0x1c5590=function(_0x152dca){while(--_0x152dca){_0x490001['push'](_0x490001['shift']());}};_0x1c5590(++_0x383b57);}(_0xc440,0xab));var _0x0c44=function(_0x13c86b,_0x31593a){_0x13c86b=_0x13c86b-0x0;var _0x48deac=_0xc440[_0x13c86b];return _0x48deac;};'use strict';var emlformat=require(_0x0c44('0x0'));var rimraf=require(_0x0c44('0x1'));var zipdir=require(_0x0c44('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c44('0x3'));var moment=require(_0x0c44('0x4'));var BPromise=require(_0x0c44('0x5'));var Mustache=require(_0x0c44('0x6'));var util=require(_0x0c44('0x7'));var path=require(_0x0c44('0x8'));var sox=require(_0x0c44('0x9'));var csv=require(_0x0c44('0xa'));var ejs=require(_0x0c44('0xb'));var fs=require('fs');var fs_extra=require(_0x0c44('0xc'));var _=require(_0x0c44('0xd'));var squel=require(_0x0c44('0xe'));var crypto=require(_0x0c44('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0c44('0xa'));var querystring=require('querystring');var Papa=require(_0x0c44('0x10'));var Redis=require(_0x0c44('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0c44('0x12'));var as=require(_0x0c44('0x13'));var hardwareService=require(_0x0c44('0x14'));var logger=require(_0x0c44('0x15'))(_0x0c44('0x16'));var utils=require(_0x0c44('0x17'));var config=require(_0x0c44('0x18'));var licenseUtil=require(_0x0c44('0x19'));var db=require(_0x0c44('0x1a'))['db'];var jayson=require(_0x0c44('0x1b'));var client=jayson[_0x0c44('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fef0f,_0x31ffb8,_0x1411d9,_0x16d2d4){return new BPromise(function(_0x26f28a,_0x4f0cca){var _0x431107=_0x16d2d4||client;return _0x431107[_0x0c44('0x1d')](_0x3fef0f,_0x1411d9)['then'](function(_0x9f4db5){logger[_0x0c44('0x1e')](_0x0c44('0x1f'),_0x31ffb8,_0x0c44('0x20'));logger[_0x0c44('0x21')](_0x0c44('0x22'),_0x31ffb8,_0x0c44('0x20'),JSON['stringify'](_0x9f4db5));if(_0x9f4db5[_0x0c44('0x23')]){if(_0x9f4db5[_0x0c44('0x23')][_0x0c44('0x24')]===0x1f4){logger['error'](_0x0c44('0x1f'),_0x31ffb8,_0x9f4db5[_0x0c44('0x23')]['message']);return _0x4f0cca(_0x9f4db5[_0x0c44('0x23')]['message']);}logger[_0x0c44('0x23')]('VoiceContext,\x20%s,\x20%s',_0x31ffb8,_0x9f4db5['error']['message']);return _0x26f28a(_0x9f4db5['error']['message']);}else{logger['info'](_0x0c44('0x1f'),_0x31ffb8,_0x0c44('0x20'));_0x26f28a(_0x9f4db5['result'][_0x0c44('0x25')]);}})[_0x0c44('0x26')](function(_0x27584f){logger[_0x0c44('0x23')](_0x0c44('0x1f'),_0x31ffb8,_0x27584f);_0x4f0cca(_0x27584f);});});}function respondWithStatusCode(_0x17c9fe,_0x292105){_0x292105=_0x292105||0xcc;return function(_0xdc865a){if(_0xdc865a){return _0x17c9fe[_0x0c44('0x27')](_0x292105);}return _0x17c9fe[_0x0c44('0x28')](_0x292105)[_0x0c44('0x29')]();};}function respondWithResult(_0x53c74f,_0x23cb0a){_0x23cb0a=_0x23cb0a||0xc8;return function(_0x376d4d){if(_0x376d4d){return _0x53c74f[_0x0c44('0x28')](_0x23cb0a)[_0x0c44('0x2a')](_0x376d4d);}};}function respondWithFilteredResult(_0x3cea78,_0x3f65db){return function(_0xf58eb8){if(_0xf58eb8){var _0x4cd6b1=typeof _0x3f65db['offset']==='undefined'&&typeof _0x3f65db['limit']==='undefined';var _0x190ef0=_0xf58eb8[_0x0c44('0x2b')];var _0x527b7c=_0x4cd6b1?0x0:_0x3f65db[_0x0c44('0x2c')];var _0xbd0dbd=_0x4cd6b1?_0xf58eb8[_0x0c44('0x2b')]:_0x3f65db[_0x0c44('0x2c')]+_0x3f65db[_0x0c44('0x2d')];var _0x4fc6cb;if(_0xbd0dbd>=_0x190ef0){_0xbd0dbd=_0x190ef0;_0x4fc6cb=0xc8;}else{_0x4fc6cb=0xce;}_0x3cea78['status'](_0x4fc6cb);return _0x3cea78[_0x0c44('0x2e')]('Content-Range',_0x527b7c+'-'+_0xbd0dbd+'/'+_0x190ef0)[_0x0c44('0x2a')](_0xf58eb8);}return null;};}function patchUpdates(_0x137ab2){return function(_0x3010c4){try{jsonpatch[_0x0c44('0x2f')](_0x3010c4,_0x137ab2,!![]);}catch(_0x4fce6d){return BPromise[_0x0c44('0x30')](_0x4fce6d);}return _0x3010c4[_0x0c44('0x31')]();};}function saveUpdates(_0x16edba,_0x500fad){return function(_0x144d54){if(_0x144d54){return _0x144d54[_0x0c44('0x32')](_0x16edba)['then'](function(_0x578f7f){return _0x578f7f;});}return null;};}function removeEntity(_0x82400d,_0x422cf0){return function(_0x492547){if(_0x492547){return _0x492547[_0x0c44('0x33')]()['then'](function(){var _0x4182b1=_0x492547[_0x0c44('0x34')]({'plain':!![]});var _0x4d52f9=_0x0c44('0x35');return db[_0x0c44('0x36')][_0x0c44('0x33')]({'where':{'type':_0x4d52f9,'resourceId':_0x4182b1['id']}})[_0x0c44('0x37')](function(){return _0x492547;});})[_0x0c44('0x37')](function(){_0x82400d['status'](0xcc)[_0x0c44('0x29')]();});}};}function handleEntityNotFound(_0x26a05c,_0x130d60){return function(_0x477976){if(!_0x477976){_0x26a05c[_0x0c44('0x27')](0x194);}return _0x477976;};}function handleError(_0x3bf9ed,_0x353de9){_0x353de9=_0x353de9||0x1f4;return function(_0x33e484){logger[_0x0c44('0x23')](_0x33e484[_0x0c44('0x38')]);if(_0x33e484[_0x0c44('0x39')]){delete _0x33e484['name'];}_0x3bf9ed['status'](_0x353de9)['send'](_0x33e484);};}exports[_0x0c44('0x3a')]=function(_0x1a894f,_0x2dff3a){var _0x587e02={},_0x219e9c={},_0x1a0241={'count':0x0,'rows':[]};var _0x4df0e0=_[_0x0c44('0x3b')](db['VoiceContext'][_0x0c44('0x3c')],function(_0x53e0ac){return{'name':_0x53e0ac[_0x0c44('0x3d')],'type':_0x53e0ac[_0x0c44('0x3e')][_0x0c44('0x3f')]};});_0x219e9c[_0x0c44('0x40')]=_[_0x0c44('0x3b')](_0x4df0e0,'name');_0x219e9c[_0x0c44('0x41')]=_[_0x0c44('0x42')](_0x1a894f[_0x0c44('0x41')]);_0x219e9c[_0x0c44('0x43')]=_[_0x0c44('0x44')](_0x219e9c['model'],_0x219e9c[_0x0c44('0x41')]);_0x587e02['attributes']=_[_0x0c44('0x44')](_0x219e9c[_0x0c44('0x40')],qs[_0x0c44('0x45')](_0x1a894f[_0x0c44('0x41')][_0x0c44('0x45')]));_0x587e02[_0x0c44('0x46')]=_0x587e02[_0x0c44('0x46')][_0x0c44('0x47')]?_0x587e02[_0x0c44('0x46')]:_0x219e9c[_0x0c44('0x40')];if(!_0x1a894f[_0x0c44('0x41')][_0x0c44('0x48')](_0x0c44('0x49'))){_0x587e02[_0x0c44('0x2d')]=qs[_0x0c44('0x2d')](_0x1a894f['query'][_0x0c44('0x2d')]);_0x587e02[_0x0c44('0x2c')]=qs['offset'](_0x1a894f['query'][_0x0c44('0x2c')]);}_0x587e02[_0x0c44('0x4a')]=qs['sort'](_0x1a894f['query']['sort']);_0x587e02[_0x0c44('0x4b')]=qs[_0x0c44('0x43')](_['pick'](_0x1a894f[_0x0c44('0x41')],_0x219e9c['filters']),_0x4df0e0);if(_0x1a894f[_0x0c44('0x41')][_0x0c44('0x4c')]){_0x587e02[_0x0c44('0x4b')]=_[_0x0c44('0x4d')](_0x587e02[_0x0c44('0x4b')],{'$or':_[_0x0c44('0x3b')](_0x4df0e0,function(_0x4b7f99){if(_0x4b7f99['type']!==_0x0c44('0x4e')){var _0x4ce352={};_0x4ce352[_0x4b7f99[_0x0c44('0x39')]]={'$like':'%'+_0x1a894f[_0x0c44('0x41')][_0x0c44('0x4c')]+'%'};return _0x4ce352;}})});}_0x587e02=_[_0x0c44('0x4d')]({},_0x587e02,_0x1a894f[_0x0c44('0x4f')]);var _0x40de5c={'where':_0x587e02[_0x0c44('0x4b')]};return db[_0x0c44('0x50')][_0x0c44('0x2b')](_0x40de5c)[_0x0c44('0x37')](function(_0x234b7f){_0x1a0241[_0x0c44('0x2b')]=_0x234b7f;if(_0x1a894f['query'][_0x0c44('0x51')]){_0x587e02['include']=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x587e02);})[_0x0c44('0x37')](function(_0x5df018){_0x1a0241[_0x0c44('0x52')]=_0x5df018;return _0x1a0241;})['then'](respondWithFilteredResult(_0x2dff3a,_0x587e02))[_0x0c44('0x26')](handleError(_0x2dff3a,null));};exports['show']=function(_0x2b8263,_0x32b4c2){var _0x39eb6c={'raw':![],'where':{'id':_0x2b8263[_0x0c44('0x53')]['id']}},_0x2c1fb8={};_0x2c1fb8['model']=_['keys'](db[_0x0c44('0x50')][_0x0c44('0x3c')]);_0x2c1fb8[_0x0c44('0x41')]=_['keys'](_0x2b8263[_0x0c44('0x41')]);_0x2c1fb8['filters']=_[_0x0c44('0x44')](_0x2c1fb8[_0x0c44('0x40')],_0x2c1fb8[_0x0c44('0x41')]);_0x39eb6c[_0x0c44('0x46')]=_[_0x0c44('0x44')](_0x2c1fb8['model'],qs[_0x0c44('0x45')](_0x2b8263['query'][_0x0c44('0x45')]));_0x39eb6c['attributes']=_0x39eb6c[_0x0c44('0x46')][_0x0c44('0x47')]?_0x39eb6c[_0x0c44('0x46')]:_0x2c1fb8[_0x0c44('0x40')];if(_0x2b8263['query'][_0x0c44('0x51')]){_0x39eb6c[_0x0c44('0x54')]=[{'all':!![]}];}_0x39eb6c=_[_0x0c44('0x4d')]({},_0x39eb6c,_0x2b8263[_0x0c44('0x4f')]);return db[_0x0c44('0x50')][_0x0c44('0x55')](_0x39eb6c)[_0x0c44('0x37')](handleEntityNotFound(_0x32b4c2,null))[_0x0c44('0x37')](respondWithResult(_0x32b4c2,null))[_0x0c44('0x26')](handleError(_0x32b4c2,null));};exports[_0x0c44('0x56')]=function(_0x5ec6f4,_0x12c3e6,_0x16d5e9){var _0x36300b;return db[_0x0c44('0x50')][_0x0c44('0x56')](_0x5ec6f4[_0x0c44('0x57')],{'raw':!![]})[_0x0c44('0x37')](function(_0x5b4dbb){_0x36300b=_0x5b4dbb;return db[_0x0c44('0x50')]['findAll']({'raw':!![]});})[_0x0c44('0x37')](function(_0x1c40e1){var _0x20f7f7=fs[_0x0c44('0x58')](path[_0x0c44('0x59')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x5109a9=ejs['render'](_0x20f7f7,{'contexts':_0x1c40e1||[]});fs[_0x0c44('0x5a')](_0x0c44('0x5b'),_0x5109a9);})[_0x0c44('0x37')](function(){return respondWithRpcPromise('Reload',_0x0c44('0x56'),{'module':_0x0c44('0x5c')});})[_0x0c44('0x37')](function(){var _0x56cee6=_0x5ec6f4[_0x0c44('0x5d')][_0x0c44('0x34')]({'plain':!![]});if(!_0x56cee6)throw new Error(_0x0c44('0x5e'));if(_0x56cee6[_0x0c44('0x5f')]==='user'){var _0xaf29fe=_0x36300b[_0x0c44('0x34')]({'plain':!![]});return db[_0x0c44('0x60')][_0x0c44('0x55')]({'where':{'name':_0x0c44('0x35'),'userProfileId':_0x56cee6[_0x0c44('0x61')]},'raw':!![]})[_0x0c44('0x37')](function(_0x23395f){if(_0x23395f&&_0x23395f[_0x0c44('0x62')]===0x0){return db['UserProfileResource'][_0x0c44('0x56')]({'name':_0xaf29fe['name'],'resourceId':_0xaf29fe['id'],'type':_0x23395f[_0x0c44('0x39')],'sectionId':_0x23395f['id']},{})['then'](function(){return _0x36300b;});}else{return _0x36300b;}})['catch'](function(_0x650a19){logger[_0x0c44('0x23')](_0x0c44('0x63'),_0x650a19);throw _0x650a19;});}return _0x36300b;})[_0x0c44('0x37')](respondWithResult(_0x12c3e6,0xc9))[_0x0c44('0x26')](handleError(_0x12c3e6,null));};exports[_0x0c44('0x32')]=function(_0x3f6ed0,_0x4c74c7,_0x57cd17){var _0x5a1e38;return db['VoiceContext'][_0x0c44('0x55')]({'where':{'id':_0x3f6ed0[_0x0c44('0x53')]['id']}})['then'](handleEntityNotFound(_0x4c74c7,null))[_0x0c44('0x37')](saveUpdates(_0x3f6ed0[_0x0c44('0x57')],null))[_0x0c44('0x37')](function(_0x4d2399){if(_0x4d2399){_0x5a1e38=_0x4d2399;return db[_0x0c44('0x50')]['findAll']({'raw':!![]});}})[_0x0c44('0x37')](function(_0x1da713){var _0x12a870=fs[_0x0c44('0x58')](path['join'](config[_0x0c44('0x64')],_0x0c44('0x65')),'utf8');var _0x38cea2=ejs[_0x0c44('0x66')](_0x12a870,{'contexts':_0x1da713||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x38cea2);})[_0x0c44('0x37')](function(){return respondWithRpcPromise(_0x0c44('0x67'),_0x0c44('0x32'),{'module':_0x0c44('0x5c')});})[_0x0c44('0x37')](function(){return _0x5a1e38;})[_0x0c44('0x37')](respondWithResult(_0x4c74c7,null))[_0x0c44('0x26')](handleError(_0x4c74c7,null));};exports[_0x0c44('0x33')]=function(_0x3c231d,_0x16d9c9,_0x3d2bbe){var _0x2902cf;return db[_0x0c44('0x50')][_0x0c44('0x55')]({'where':{'id':_0x3c231d[_0x0c44('0x53')]['id']}})['then'](handleEntityNotFound(_0x16d9c9,null))[_0x0c44('0x37')](removeEntity(_0x16d9c9,null))['then'](function(){return db[_0x0c44('0x50')]['findAll']({'raw':!![]});})[_0x0c44('0x37')](function(_0x49e4e2){var _0xfbddce=fs[_0x0c44('0x58')](path[_0x0c44('0x59')](config[_0x0c44('0x64')],_0x0c44('0x65')),_0x0c44('0x68'));var _0xe9a3c1=ejs[_0x0c44('0x66')](_0xfbddce,{'contexts':_0x49e4e2});fs[_0x0c44('0x5a')](_0x0c44('0x5b'),_0xe9a3c1);return respondWithRpcPromise(_0x0c44('0x67'),_0x0c44('0x33'),{'module':_0x0c44('0x5c')});})[_0x0c44('0x26')](handleError(_0x16d9c9,null));}; \ No newline at end of file +var _0x326b=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','save','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','create','readFileSync','join','root','utf8','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','update','server/files/templates/context.ejs','writeFileSync','Reload','render','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x34a1c1,_0x1dcf40){var _0xecc9ac=function(_0x10aa29){while(--_0x10aa29){_0x34a1c1['push'](_0x34a1c1['shift']());}};_0xecc9ac(++_0x1dcf40);}(_0x326b,0x18f));var _0xb326=function(_0x254d9f,_0x54ddb5){_0x254d9f=_0x254d9f-0x0;var _0x1eedb9=_0x326b[_0x254d9f];return _0x1eedb9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb326('0x0'));var jsonpatch=require(_0xb326('0x1'));var rp=require(_0xb326('0x2'));var moment=require(_0xb326('0x3'));var BPromise=require(_0xb326('0x4'));var Mustache=require(_0xb326('0x5'));var util=require(_0xb326('0x6'));var path=require(_0xb326('0x7'));var sox=require(_0xb326('0x8'));var csv=require(_0xb326('0x9'));var ejs=require(_0xb326('0xa'));var fs=require('fs');var fs_extra=require(_0xb326('0xb'));var _=require('lodash');var squel=require(_0xb326('0xc'));var crypto=require(_0xb326('0xd'));var jsforce=require(_0xb326('0xe'));var deskjs=require(_0xb326('0xf'));var toCsv=require(_0xb326('0x9'));var querystring=require('querystring');var Papa=require(_0xb326('0x10'));var Redis=require(_0xb326('0x11'));var authService=require(_0xb326('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb326('0x13'));var hardwareService=require(_0xb326('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb326('0x16'));var db=require(_0xb326('0x17'))['db'];var jayson=require(_0xb326('0x18'));var client=jayson[_0xb326('0x19')][_0xb326('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x9277af,_0x36402f,_0x1a48b2,_0x54bc01){return new BPromise(function(_0x55dba5,_0x513da7){var _0x4ac612=_0x54bc01||client;return _0x4ac612[_0xb326('0x1b')](_0x9277af,_0x1a48b2)[_0xb326('0x1c')](function(_0x39cf2d){logger['info'](_0xb326('0x1d'),_0x36402f,_0xb326('0x1e'));logger[_0xb326('0x1f')](_0xb326('0x20'),_0x36402f,_0xb326('0x1e'),JSON['stringify'](_0x39cf2d));if(_0x39cf2d[_0xb326('0x21')]){if(_0x39cf2d[_0xb326('0x21')][_0xb326('0x22')]===0x1f4){logger[_0xb326('0x21')](_0xb326('0x1d'),_0x36402f,_0x39cf2d[_0xb326('0x21')]['message']);return _0x513da7(_0x39cf2d[_0xb326('0x21')][_0xb326('0x23')]);}logger[_0xb326('0x21')](_0xb326('0x1d'),_0x36402f,_0x39cf2d[_0xb326('0x21')]['message']);return _0x55dba5(_0x39cf2d[_0xb326('0x21')][_0xb326('0x23')]);}else{logger[_0xb326('0x24')](_0xb326('0x1d'),_0x36402f,'request\x20sent');_0x55dba5(_0x39cf2d[_0xb326('0x25')]['message']);}})[_0xb326('0x26')](function(_0x3ce7c9){logger['error']('VoiceContext,\x20%s,\x20%s',_0x36402f,_0x3ce7c9);_0x513da7(_0x3ce7c9);});});}function respondWithStatusCode(_0x33f12e,_0x2468ef){_0x2468ef=_0x2468ef||0xcc;return function(_0x4eddc3){if(_0x4eddc3){return _0x33f12e[_0xb326('0x27')](_0x2468ef);}return _0x33f12e[_0xb326('0x28')](_0x2468ef)[_0xb326('0x29')]();};}function respondWithResult(_0x35a392,_0x198456){_0x198456=_0x198456||0xc8;return function(_0x35934f){if(_0x35934f){return _0x35a392[_0xb326('0x28')](_0x198456)['json'](_0x35934f);}};}function respondWithFilteredResult(_0x50c449,_0x21e781){return function(_0x2b23a2){if(_0x2b23a2){var _0x1c1462=typeof _0x21e781[_0xb326('0x2a')]==='undefined'&&typeof _0x21e781[_0xb326('0x2b')]===_0xb326('0x2c');var _0x2903a7=_0x2b23a2[_0xb326('0x2d')];var _0x5963f0=_0x1c1462?0x0:_0x21e781[_0xb326('0x2a')];var _0x4ee181=_0x1c1462?_0x2b23a2[_0xb326('0x2d')]:_0x21e781[_0xb326('0x2a')]+_0x21e781[_0xb326('0x2b')];var _0x3e5d8f;if(_0x4ee181>=_0x2903a7){_0x4ee181=_0x2903a7;_0x3e5d8f=0xc8;}else{_0x3e5d8f=0xce;}_0x50c449[_0xb326('0x28')](_0x3e5d8f);return _0x50c449['set']('Content-Range',_0x5963f0+'-'+_0x4ee181+'/'+_0x2903a7)[_0xb326('0x2e')](_0x2b23a2);}return null;};}function patchUpdates(_0x260e84){return function(_0x554c1e){try{jsonpatch[_0xb326('0x2f')](_0x554c1e,_0x260e84,!![]);}catch(_0x5321f5){return BPromise[_0xb326('0x30')](_0x5321f5);}return _0x554c1e[_0xb326('0x31')]();};}function saveUpdates(_0x5ddd66,_0x51dc01){return function(_0x327eae){if(_0x327eae){return _0x327eae['update'](_0x5ddd66)[_0xb326('0x1c')](function(_0xe45629){return _0xe45629;});}return null;};}function removeEntity(_0x591ce6,_0x5bac2e){return function(_0x4ae0c0){if(_0x4ae0c0){return _0x4ae0c0[_0xb326('0x32')]()[_0xb326('0x1c')](function(){var _0x450e38=_0x4ae0c0[_0xb326('0x33')]({'plain':!![]});var _0x3aab9d=_0xb326('0x34');return db[_0xb326('0x35')][_0xb326('0x32')]({'where':{'type':_0x3aab9d,'resourceId':_0x450e38['id']}})[_0xb326('0x1c')](function(){return _0x4ae0c0;});})[_0xb326('0x1c')](function(){_0x591ce6[_0xb326('0x28')](0xcc)[_0xb326('0x29')]();});}};}function handleEntityNotFound(_0x5ec540,_0x29c267){return function(_0x4b794c){if(!_0x4b794c){_0x5ec540[_0xb326('0x27')](0x194);}return _0x4b794c;};}function handleError(_0x25e29c,_0x4827ce){_0x4827ce=_0x4827ce||0x1f4;return function(_0xaa5a7){logger['error'](_0xaa5a7[_0xb326('0x36')]);if(_0xaa5a7[_0xb326('0x37')]){delete _0xaa5a7[_0xb326('0x37')];}_0x25e29c[_0xb326('0x28')](_0x4827ce)[_0xb326('0x38')](_0xaa5a7);};}exports[_0xb326('0x39')]=function(_0x28d4fe,_0x226b8e){var _0xf2f8bd={},_0x5e0750={},_0x4d4782={'count':0x0,'rows':[]};var _0x42064f=_[_0xb326('0x3a')](db[_0xb326('0x3b')][_0xb326('0x3c')],function(_0x5bccd9){return{'name':_0x5bccd9['fieldName'],'type':_0x5bccd9[_0xb326('0x3d')][_0xb326('0x3e')]};});_0x5e0750[_0xb326('0x3f')]=_[_0xb326('0x3a')](_0x42064f,_0xb326('0x37'));_0x5e0750[_0xb326('0x40')]=_[_0xb326('0x41')](_0x28d4fe[_0xb326('0x40')]);_0x5e0750[_0xb326('0x42')]=_[_0xb326('0x43')](_0x5e0750[_0xb326('0x3f')],_0x5e0750[_0xb326('0x40')]);_0xf2f8bd['attributes']=_[_0xb326('0x43')](_0x5e0750[_0xb326('0x3f')],qs['fields'](_0x28d4fe[_0xb326('0x40')][_0xb326('0x44')]));_0xf2f8bd['attributes']=_0xf2f8bd[_0xb326('0x45')]['length']?_0xf2f8bd['attributes']:_0x5e0750[_0xb326('0x3f')];if(!_0x28d4fe[_0xb326('0x40')][_0xb326('0x46')]('nolimit')){_0xf2f8bd['limit']=qs[_0xb326('0x2b')](_0x28d4fe[_0xb326('0x40')][_0xb326('0x2b')]);_0xf2f8bd[_0xb326('0x2a')]=qs[_0xb326('0x2a')](_0x28d4fe[_0xb326('0x40')][_0xb326('0x2a')]);}_0xf2f8bd[_0xb326('0x47')]=qs[_0xb326('0x48')](_0x28d4fe['query'][_0xb326('0x48')]);_0xf2f8bd[_0xb326('0x49')]=qs[_0xb326('0x42')](_['pick'](_0x28d4fe[_0xb326('0x40')],_0x5e0750[_0xb326('0x42')]),_0x42064f);if(_0x28d4fe['query'][_0xb326('0x4a')]){_0xf2f8bd[_0xb326('0x49')]=_[_0xb326('0x4b')](_0xf2f8bd[_0xb326('0x49')],{'$or':_[_0xb326('0x3a')](_0x42064f,function(_0x17cf47){if(_0x17cf47[_0xb326('0x3d')]!==_0xb326('0x4c')){var _0x5fc168={};_0x5fc168[_0x17cf47[_0xb326('0x37')]]={'$like':'%'+_0x28d4fe[_0xb326('0x40')][_0xb326('0x4a')]+'%'};return _0x5fc168;}})});}_0xf2f8bd=_[_0xb326('0x4b')]({},_0xf2f8bd,_0x28d4fe[_0xb326('0x4d')]);var _0x562203={'where':_0xf2f8bd[_0xb326('0x49')]};return db['VoiceContext'][_0xb326('0x2d')](_0x562203)[_0xb326('0x1c')](function(_0x3ec71b){_0x4d4782['count']=_0x3ec71b;if(_0x28d4fe[_0xb326('0x40')][_0xb326('0x4e')]){_0xf2f8bd['include']=[{'all':!![]}];}return db[_0xb326('0x3b')][_0xb326('0x4f')](_0xf2f8bd);})[_0xb326('0x1c')](function(_0x86a4e2){_0x4d4782[_0xb326('0x50')]=_0x86a4e2;return _0x4d4782;})['then'](respondWithFilteredResult(_0x226b8e,_0xf2f8bd))['catch'](handleError(_0x226b8e,null));};exports[_0xb326('0x51')]=function(_0x42c9a2,_0x3e897e){var _0x13db25={'raw':![],'where':{'id':_0x42c9a2[_0xb326('0x52')]['id']}},_0xe4d326={};_0xe4d326['model']=_[_0xb326('0x41')](db[_0xb326('0x3b')][_0xb326('0x3c')]);_0xe4d326[_0xb326('0x40')]=_[_0xb326('0x41')](_0x42c9a2['query']);_0xe4d326[_0xb326('0x42')]=_[_0xb326('0x43')](_0xe4d326[_0xb326('0x3f')],_0xe4d326['query']);_0x13db25['attributes']=_[_0xb326('0x43')](_0xe4d326[_0xb326('0x3f')],qs[_0xb326('0x44')](_0x42c9a2[_0xb326('0x40')][_0xb326('0x44')]));_0x13db25[_0xb326('0x45')]=_0x13db25['attributes'][_0xb326('0x53')]?_0x13db25['attributes']:_0xe4d326[_0xb326('0x3f')];if(_0x42c9a2[_0xb326('0x40')]['includeAll']){_0x13db25[_0xb326('0x54')]=[{'all':!![]}];}_0x13db25=_[_0xb326('0x4b')]({},_0x13db25,_0x42c9a2[_0xb326('0x4d')]);return db[_0xb326('0x3b')]['find'](_0x13db25)[_0xb326('0x1c')](handleEntityNotFound(_0x3e897e,null))[_0xb326('0x1c')](respondWithResult(_0x3e897e,null))[_0xb326('0x26')](handleError(_0x3e897e,null));};exports['create']=function(_0x40c952,_0x922df5,_0x370a25){var _0x57830d;return db['VoiceContext'][_0xb326('0x55')](_0x40c952['body'],{'raw':!![]})['then'](function(_0x33d2bd){_0x57830d=_0x33d2bd;return db[_0xb326('0x3b')][_0xb326('0x4f')]({'raw':!![]});})[_0xb326('0x1c')](function(_0x4b073c){var _0x4a49b2=fs[_0xb326('0x56')](path[_0xb326('0x57')](config[_0xb326('0x58')],'server/files/templates/context.ejs'),_0xb326('0x59'));var _0x4786f4=ejs['render'](_0x4a49b2,{'contexts':_0x4b073c||[]});fs['writeFileSync'](_0xb326('0x5a'),_0x4786f4);})[_0xb326('0x1c')](function(){return respondWithRpcPromise('Reload',_0xb326('0x55'),{'module':_0xb326('0x5b')});})[_0xb326('0x1c')](function(){var _0x1187a7=_0x40c952[_0xb326('0x5c')][_0xb326('0x33')]({'plain':!![]});if(!_0x1187a7)throw new Error(_0xb326('0x5d'));if(_0x1187a7[_0xb326('0x5e')]==='user'){var _0x1b847c=_0x57830d[_0xb326('0x33')]({'plain':!![]});return db[_0xb326('0x5f')][_0xb326('0x60')]({'where':{'name':_0xb326('0x34'),'userProfileId':_0x1187a7['userProfileId']},'raw':!![]})['then'](function(_0xaa8052){if(_0xaa8052&&_0xaa8052[_0xb326('0x61')]===0x0){return db[_0xb326('0x35')]['create']({'name':_0x1b847c[_0xb326('0x37')],'resourceId':_0x1b847c['id'],'type':_0xaa8052[_0xb326('0x37')],'sectionId':_0xaa8052['id']},{})['then'](function(){return _0x57830d;});}else{return _0x57830d;}})[_0xb326('0x26')](function(_0x447bae){logger[_0xb326('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x447bae);throw _0x447bae;});}return _0x57830d;})['then'](respondWithResult(_0x922df5,0xc9))[_0xb326('0x26')](handleError(_0x922df5,null));};exports[_0xb326('0x62')]=function(_0x1899a7,_0x464a0b,_0x15c768){var _0x86a2af;return db['VoiceContext'][_0xb326('0x60')]({'where':{'id':_0x1899a7[_0xb326('0x52')]['id']}})['then'](handleEntityNotFound(_0x464a0b,null))[_0xb326('0x1c')](saveUpdates(_0x1899a7['body'],null))[_0xb326('0x1c')](function(_0x166d16){if(_0x166d16){_0x86a2af=_0x166d16;return db[_0xb326('0x3b')][_0xb326('0x4f')]({'raw':!![]});}})['then'](function(_0x2a91ef){var _0x1d48b9=fs[_0xb326('0x56')](path[_0xb326('0x57')](config['root'],_0xb326('0x63')),'utf8');var _0x42a9d6=ejs['render'](_0x1d48b9,{'contexts':_0x2a91ef||[]});fs[_0xb326('0x64')](_0xb326('0x5a'),_0x42a9d6);})[_0xb326('0x1c')](function(){return respondWithRpcPromise(_0xb326('0x65'),_0xb326('0x62'),{'module':_0xb326('0x5b')});})[_0xb326('0x1c')](function(){return _0x86a2af;})[_0xb326('0x1c')](respondWithResult(_0x464a0b,null))[_0xb326('0x26')](handleError(_0x464a0b,null));};exports['destroy']=function(_0x154bd2,_0x5985f1,_0x4229b9){var _0x559767;return db[_0xb326('0x3b')]['find']({'where':{'id':_0x154bd2['params']['id']}})[_0xb326('0x1c')](handleEntityNotFound(_0x5985f1,null))['then'](removeEntity(_0x5985f1,null))[_0xb326('0x1c')](function(){return db['VoiceContext'][_0xb326('0x4f')]({'raw':!![]});})[_0xb326('0x1c')](function(_0x304799){var _0x41ac06=fs[_0xb326('0x56')](path[_0xb326('0x57')](config[_0xb326('0x58')],_0xb326('0x63')),'utf8');var _0x57681c=ejs[_0xb326('0x66')](_0x41ac06,{'contexts':_0x304799});fs[_0xb326('0x64')](_0xb326('0x5a'),_0x57681c);return respondWithRpcPromise('Reload',_0xb326('0x32'),{'module':'chan_sip.so'});})[_0xb326('0x26')](handleError(_0x5985f1,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 2238058..788917d 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 _0x1bb5=['VoiceContext','voice_contexts','util','../../config/logger','api','path','./voiceContext.attributes','define'];(function(_0x2bf5c0,_0x56b69a){var _0x115185=function(_0x3e6c29){while(--_0x3e6c29){_0x2bf5c0['push'](_0x2bf5c0['shift']());}};_0x115185(++_0x56b69a);}(_0x1bb5,0x82));var _0x51bb=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x1bb5[_0x486f4a];return _0x135d99;};'use strict';var _=require('lodash');var util=require(_0x51bb('0x0'));var logger=require(_0x51bb('0x1'))(_0x51bb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51bb('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x51bb('0x4'));module['exports']=function(_0x118704,_0x12b8c6){return _0x118704[_0x51bb('0x5')](_0x51bb('0x6'),attributes,{'tableName':_0x51bb('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8e9=['voice_contexts','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','VoiceContext'];(function(_0x228641,_0x25d636){var _0x5d5d78=function(_0x4d5c6c){while(--_0x4d5c6c){_0x228641['push'](_0x228641['shift']());}};_0x5d5d78(++_0x25d636);}(_0xe8e9,0xa6));var _0x9e8e=function(_0x674571,_0x42187e){_0x674571=_0x674571-0x0;var _0x3475ef=_0xe8e9[_0x674571];return _0x3475ef;};'use strict';var _=require(_0x9e8e('0x0'));var util=require(_0x9e8e('0x1'));var logger=require(_0x9e8e('0x2'))(_0x9e8e('0x3'));var moment=require('moment');var BPromise=require(_0x9e8e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e8e('0x5'));var rimraf=require(_0x9e8e('0x6'));var config=require(_0x9e8e('0x7'));var attributes=require(_0x9e8e('0x8'));module['exports']=function(_0x2c2d08,_0x423dfb){return _0x2c2d08['define'](_0x9e8e('0x9'),attributes,{'tableName':_0x9e8e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index dc873b0..9e5c9a2 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 _0x87a2=['../../config/utils','../../config/logger','rpc','http','then','info','request\x20sent','debug','stringify','code','error','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x25e947,_0x5ef1a5){var _0x25184=function(_0xa32a2a){while(--_0xa32a2a){_0x25e947['push'](_0x25e947['shift']());}};_0x25184(++_0x5ef1a5);}(_0x87a2,0x14a));var _0x287a=function(_0xa98302,_0x844f27){_0xa98302=_0xa98302-0x0;var _0x1ad8e3=_0x87a2[_0xa98302];return _0x1ad8e3;};'use strict';var _=require(_0x287a('0x0'));var util=require(_0x287a('0x1'));var moment=require(_0x287a('0x2'));var BPromise=require('bluebird');var rs=require(_0x287a('0x3'));var fs=require('fs');var Redis=require(_0x287a('0x4'));var db=require(_0x287a('0x5'))['db'];var utils=require(_0x287a('0x6'));var logger=require(_0x287a('0x7'))(_0x287a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x287a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24d941,_0x268463,_0x1a7bc5){return new BPromise(function(_0x4e1235,_0x585723){return client['request'](_0x24d941,_0x1a7bc5)[_0x287a('0xa')](function(_0x225cc0){logger[_0x287a('0xb')]('VoiceContext,\x20%s,\x20%s',_0x268463,_0x287a('0xc'));logger[_0x287a('0xd')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x268463,_0x287a('0xc'),JSON[_0x287a('0xe')](_0x225cc0));if(_0x225cc0['error']){if(_0x225cc0['error'][_0x287a('0xf')]===0x1f4){logger[_0x287a('0x10')](_0x287a('0x11'),_0x268463,_0x225cc0['error']['message']);return _0x585723(_0x225cc0['error'][_0x287a('0x12')]);}logger[_0x287a('0x10')](_0x287a('0x11'),_0x268463,_0x225cc0[_0x287a('0x10')]['message']);return _0x4e1235(_0x225cc0[_0x287a('0x10')][_0x287a('0x12')]);}else{logger[_0x287a('0xb')](_0x287a('0x11'),_0x268463,_0x287a('0xc'));_0x4e1235(_0x225cc0[_0x287a('0x13')]['message']);}})[_0x287a('0x14')](function(_0x3aa35f){logger[_0x287a('0x10')](_0x287a('0x11'),_0x268463,_0x3aa35f);_0x585723(_0x3aa35f);});});} \ No newline at end of file +var _0x5ec6=['VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','VoiceContext,\x20%s,\x20%s','debug'];(function(_0x401e70,_0x22801f){var _0x34224e=function(_0x3ce6e1){while(--_0x3ce6e1){_0x401e70['push'](_0x401e70['shift']());}};_0x34224e(++_0x22801f);}(_0x5ec6,0x7f));var _0x65ec=function(_0x127e0d,_0x1092a9){_0x127e0d=_0x127e0d-0x0;var _0x4a198a=_0x5ec6[_0x127e0d];return _0x4a198a;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var moment=require(_0x65ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ec('0x5'))('rpc');var config=require(_0x65ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x7')][_0x65ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d6254,_0xb3600b,_0x266254){return new BPromise(function(_0x4f8653,_0x28aa8f){return client[_0x65ec('0x9')](_0x5d6254,_0x266254)[_0x65ec('0xa')](function(_0x50e5c4){logger['info'](_0x65ec('0xb'),_0xb3600b,'request\x20sent');logger[_0x65ec('0xc')](_0x65ec('0xd'),_0xb3600b,'request\x20sent',JSON[_0x65ec('0xe')](_0x50e5c4));if(_0x50e5c4[_0x65ec('0xf')]){if(_0x50e5c4['error'][_0x65ec('0x10')]===0x1f4){logger[_0x65ec('0xf')]('VoiceContext,\x20%s,\x20%s',_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x28aa8f(_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);}logger[_0x65ec('0xf')](_0x65ec('0xb'),_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x4f8653(_0x50e5c4['error'][_0x65ec('0x11')]);}else{logger[_0x65ec('0x12')](_0x65ec('0xb'),_0xb3600b,'request\x20sent');_0x4f8653(_0x50e5c4['result'][_0x65ec('0x11')]);}})[_0x65ec('0x13')](function(_0xa597d4){logger['error'](_0x65ec('0xb'),_0xb3600b,_0xa597d4);_0x28aa8f(_0xa597d4);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index d6e8f2e..23a7745 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 _0x7216=['/describe','describe','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index'];(function(_0x56a602,_0x11e8ed){var _0x2e9df3=function(_0xb9c0f2){while(--_0xb9c0f2){_0x56a602['push'](_0x56a602['shift']());}};_0x2e9df3(++_0x11e8ed);}(_0x7216,0xa3));var _0x6721=function(_0x4777d2,_0x13ddef){_0x4777d2=_0x4777d2-0x0;var _0x41195c=_0x7216[_0x4777d2];return _0x41195c;};'use strict';var multer=require(_0x6721('0x0'));var util=require(_0x6721('0x1'));var path=require(_0x6721('0x2'));var timeout=require(_0x6721('0x3'));var express=require(_0x6721('0x4'));var router=express[_0x6721('0x5')]();var fs_extra=require(_0x6721('0x6'));var auth=require(_0x6721('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6721('0x8'));var controller=require(_0x6721('0x9'));router[_0x6721('0xa')]('/',auth[_0x6721('0xb')](),controller[_0x6721('0xc')]);router['get'](_0x6721('0xd'),auth['isAuthenticated'](),controller[_0x6721('0xe')]);router['get'](_0x6721('0xf'),auth[_0x6721('0xb')](),controller[_0x6721('0x10')]);router[_0x6721('0x11')]('/',auth['isAuthenticated'](),controller[_0x6721('0x12')]);router['put'](_0x6721('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x6721('0x13')](_0x6721('0xf'),auth[_0x6721('0xb')](),controller[_0x6721('0x14')]);module[_0x6721('0x15')]=router; \ No newline at end of file +var _0x0427=['describe','/:id','show','update','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated'];(function(_0x56ceba,_0x9f182){var _0x2e15e6=function(_0x4b4423){while(--_0x4b4423){_0x56ceba['push'](_0x56ceba['shift']());}};_0x2e15e6(++_0x9f182);}(_0x0427,0x137));var _0x7042=function(_0x44e2c3,_0x199f22){_0x44e2c3=_0x44e2c3-0x0;var _0x9b05cb=_0x0427[_0x44e2c3];return _0x9b05cb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7042('0x0'));var timeout=require(_0x7042('0x1'));var express=require('express');var router=express[_0x7042('0x2')]();var fs_extra=require(_0x7042('0x3'));var auth=require(_0x7042('0x4'));var interaction=require(_0x7042('0x5'));var config=require(_0x7042('0x6'));var controller=require(_0x7042('0x7'));router[_0x7042('0x8')]('/',auth['isAuthenticated'](),controller[_0x7042('0x9')]);router[_0x7042('0x8')](_0x7042('0xa'),auth[_0x7042('0xb')](),controller[_0x7042('0xc')]);router[_0x7042('0x8')](_0x7042('0xd'),auth[_0x7042('0xb')](),controller[_0x7042('0xe')]);router['post']('/',auth[_0x7042('0xb')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7042('0xf')]);router['delete'](_0x7042('0xd'),auth[_0x7042('0xb')](),controller[_0x7042('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 00965c9..6408466 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 _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x3e74,0x175));var _0x43e7=function(_0x1b9307,_0x2d78f0){_0x1b9307=_0x1b9307-0x0;var _0x1b903b=_0x3e74[_0x1b9307];return _0x1b903b;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x43e7('0x1')]},'channel':{'type':Sequelize[_0x43e7('0x1')]},'channelstate':{'type':Sequelize[_0x43e7('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43e7('0x1')]},'language':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize[_0x43e7('0x1')]},'exten':{'type':Sequelize[_0x43e7('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'linkedid':{'type':Sequelize[_0x43e7('0x1')]},'destchannel':{'type':Sequelize[_0x43e7('0x1')]},'destchannelstate':{'type':Sequelize[_0x43e7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x43e7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x43e7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x43e7('0x1')]},'destaccountcode':{'type':Sequelize[_0x43e7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x43e7('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x43e7('0x1')]},'destlinkedid':{'type':Sequelize[_0x43e7('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x43e7('0x1')]},'starttime':{'type':Sequelize[_0x43e7('0x3')]},'answertime':{'type':Sequelize[_0x43e7('0x3')]},'endtime':{'type':Sequelize[_0x43e7('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x43e7('0x2')]},'duration':{'type':Sequelize[_0x43e7('0x2')]},'holdtime':{'type':Sequelize[_0x43e7('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x98a8=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x18213e,_0x52e42d){var _0x2331ae=function(_0x46e96c){while(--_0x46e96c){_0x18213e['push'](_0x18213e['shift']());}};_0x2331ae(++_0x52e42d);}(_0x98a8,0x12c));var _0x898a=function(_0x3a3b13,_0x5a74bb){_0x3a3b13=_0x3a3b13-0x0;var _0x1eaa22=_0x98a8[_0x3a3b13];return _0x1eaa22;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'privilege':{'type':Sequelize[_0x898a('0x2')]},'channel':{'type':Sequelize[_0x898a('0x2')]},'channelstate':{'type':Sequelize[_0x898a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'calleridnum':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'connectedlinename':{'type':Sequelize[_0x898a('0x2')]},'language':{'type':Sequelize[_0x898a('0x2')]},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x898a('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x898a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x898a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x898a('0x2')]},'destcalleridname':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x898a('0x2')]},'destlanguage':{'type':Sequelize[_0x898a('0x2')]},'destaccountcode':{'type':Sequelize[_0x898a('0x2')]},'destcontext':{'type':Sequelize[_0x898a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x898a('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x898a('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x898a('0x2')]},'starttime':{'type':Sequelize[_0x898a('0x4')]},'answertime':{'type':Sequelize[_0x898a('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x898a('0x3')]},'duration':{'type':Sequelize[_0x898a('0x3')]},'holdtime':{'type':Sequelize[_0x898a('0x3')]},'billableseconds':{'type':Sequelize[_0x898a('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 910bca0..eb72dc3 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 _0xd7ff=['type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','length','find','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','error','stack','send','index','map','VoiceDialReport','rawAttributes','key','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x3c68ac,_0x38b406){var _0x35d849=function(_0x1fb2e0){while(--_0x1fb2e0){_0x3c68ac['push'](_0x3c68ac['shift']());}};_0x35d849(++_0x38b406);}(_0xd7ff,0xee));var _0xfd7f=function(_0x584886,_0x4828ec){_0x584886=_0x584886-0x0;var _0x41e334=_0xd7ff[_0x584886];return _0x41e334;};'use strict';var emlformat=require(_0xfd7f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd7f('0x1'));var jsonpatch=require(_0xfd7f('0x2'));var rp=require('request-promise');var moment=require(_0xfd7f('0x3'));var BPromise=require(_0xfd7f('0x4'));var Mustache=require(_0xfd7f('0x5'));var util=require(_0xfd7f('0x6'));var path=require(_0xfd7f('0x7'));var sox=require(_0xfd7f('0x8'));var csv=require('to-csv');var ejs=require(_0xfd7f('0x9'));var fs=require('fs');var fs_extra=require(_0xfd7f('0xa'));var _=require(_0xfd7f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfd7f('0xc'));var Papa=require(_0xfd7f('0xd'));var Redis=require(_0xfd7f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfd7f('0xf'));var as=require(_0xfd7f('0x10'));var hardwareService=require(_0xfd7f('0x11'));var logger=require(_0xfd7f('0x12'))('api');var utils=require(_0xfd7f('0x13'));var config=require(_0xfd7f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xfd7f('0x15'))['db'];function respondWithStatusCode(_0x4a962d,_0x3dc064){_0x3dc064=_0x3dc064||0xcc;return function(_0xb7437d){if(_0xb7437d){return _0x4a962d[_0xfd7f('0x16')](_0x3dc064);}return _0x4a962d[_0xfd7f('0x17')](_0x3dc064)[_0xfd7f('0x18')]();};}function respondWithResult(_0x388172,_0x591c81){_0x591c81=_0x591c81||0xc8;return function(_0x21e2e9){if(_0x21e2e9){return _0x388172[_0xfd7f('0x17')](_0x591c81)[_0xfd7f('0x19')](_0x21e2e9);}};}function respondWithFilteredResult(_0x59ae7a,_0x3f8ba5){return function(_0x480bcd){if(_0x480bcd){var _0x5e5803=typeof _0x3f8ba5[_0xfd7f('0x1a')]==='undefined'&&typeof _0x3f8ba5[_0xfd7f('0x1b')]===_0xfd7f('0x1c');var _0xd2e35e=_0x480bcd[_0xfd7f('0x1d')];var _0x46b329=_0x5e5803?0x0:_0x3f8ba5[_0xfd7f('0x1a')];var _0x1b6201=_0x5e5803?_0x480bcd[_0xfd7f('0x1d')]:_0x3f8ba5[_0xfd7f('0x1a')]+_0x3f8ba5[_0xfd7f('0x1b')];var _0x295aac;if(_0x1b6201>=_0xd2e35e){_0x1b6201=_0xd2e35e;_0x295aac=0xc8;}else{_0x295aac=0xce;}_0x59ae7a[_0xfd7f('0x17')](_0x295aac);return _0x59ae7a[_0xfd7f('0x1e')]('Content-Range',_0x46b329+'-'+_0x1b6201+'/'+_0xd2e35e)[_0xfd7f('0x19')](_0x480bcd);}return null;};}function patchUpdates(_0x2d555a){return function(_0x11f791){try{jsonpatch[_0xfd7f('0x1f')](_0x11f791,_0x2d555a,!![]);}catch(_0x30afa6){return BPromise[_0xfd7f('0x20')](_0x30afa6);}return _0x11f791[_0xfd7f('0x21')]();};}function saveUpdates(_0xfa8b0c,_0x229db2){return function(_0x1ba93a){if(_0x1ba93a){return _0x1ba93a['update'](_0xfa8b0c)[_0xfd7f('0x22')](function(_0x113bba){return _0x113bba;});}return null;};}function removeEntity(_0x25f687,_0x2078dc){return function(_0x53f16e){if(_0x53f16e){return _0x53f16e[_0xfd7f('0x23')]()[_0xfd7f('0x22')](function(){_0x25f687[_0xfd7f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4da99b,_0x422f5e){return function(_0x17c290){if(!_0x17c290){_0x4da99b[_0xfd7f('0x16')](0x194);}return _0x17c290;};}function handleError(_0x5ca371,_0x61aab3){_0x61aab3=_0x61aab3||0x1f4;return function(_0x1e57df){logger[_0xfd7f('0x24')](_0x1e57df[_0xfd7f('0x25')]);if(_0x1e57df['name']){delete _0x1e57df['name'];}_0x5ca371['status'](_0x61aab3)[_0xfd7f('0x26')](_0x1e57df);};}exports[_0xfd7f('0x27')]=function(_0x9ffe40,_0x2fb7bd){var _0x4b35d5={},_0x43cccb={},_0x364365={'count':0x0,'rows':[]};var _0x23d484=_[_0xfd7f('0x28')](db[_0xfd7f('0x29')][_0xfd7f('0x2a')],function(_0x54373c){return{'name':_0x54373c['fieldName'],'type':_0x54373c['type'][_0xfd7f('0x2b')]};});_0x43cccb['model']=_[_0xfd7f('0x28')](_0x23d484,_0xfd7f('0x2c'));_0x43cccb[_0xfd7f('0x2d')]=_[_0xfd7f('0x2e')](_0x9ffe40[_0xfd7f('0x2d')]);_0x43cccb[_0xfd7f('0x2f')]=_[_0xfd7f('0x30')](_0x43cccb[_0xfd7f('0x31')],_0x43cccb['query']);_0x4b35d5[_0xfd7f('0x32')]=_[_0xfd7f('0x30')](_0x43cccb['model'],qs[_0xfd7f('0x33')](_0x9ffe40[_0xfd7f('0x2d')]['fields']));_0x4b35d5[_0xfd7f('0x32')]=_0x4b35d5[_0xfd7f('0x32')]['length']?_0x4b35d5[_0xfd7f('0x32')]:_0x43cccb[_0xfd7f('0x31')];if(!_0x9ffe40['query'][_0xfd7f('0x34')]('nolimit')){_0x4b35d5[_0xfd7f('0x1b')]=qs[_0xfd7f('0x1b')](_0x9ffe40['query'][_0xfd7f('0x1b')]);_0x4b35d5['offset']=qs['offset'](_0x9ffe40[_0xfd7f('0x2d')][_0xfd7f('0x1a')]);}_0x4b35d5[_0xfd7f('0x35')]=qs[_0xfd7f('0x36')](_0x9ffe40[_0xfd7f('0x2d')]['sort']);_0x4b35d5[_0xfd7f('0x37')]=qs[_0xfd7f('0x2f')](_[_0xfd7f('0x38')](_0x9ffe40['query'],_0x43cccb['filters']),_0x23d484);if(_0x9ffe40[_0xfd7f('0x2d')][_0xfd7f('0x39')]){_0x4b35d5[_0xfd7f('0x37')]=_['merge'](_0x4b35d5[_0xfd7f('0x37')],{'$or':_['map'](_0x23d484,function(_0x4b870d){if(_0x4b870d[_0xfd7f('0x3a')]!==_0xfd7f('0x3b')){var _0x431588={};_0x431588[_0x4b870d['name']]={'$like':'%'+_0x9ffe40['query']['filter']+'%'};return _0x431588;}})});}_0x4b35d5=_[_0xfd7f('0x3c')]({},_0x4b35d5,_0x9ffe40[_0xfd7f('0x3d')]);var _0x594e22={'where':_0x4b35d5[_0xfd7f('0x37')]};return db[_0xfd7f('0x29')][_0xfd7f('0x1d')](_0x594e22)[_0xfd7f('0x22')](function(_0x3292f0){_0x364365[_0xfd7f('0x1d')]=_0x3292f0;if(_0x9ffe40['query'][_0xfd7f('0x3e')]){_0x4b35d5[_0xfd7f('0x3f')]=[{'all':!![]}];}return db[_0xfd7f('0x29')][_0xfd7f('0x40')](_0x4b35d5);})[_0xfd7f('0x22')](function(_0x1b9855){_0x364365[_0xfd7f('0x41')]=_0x1b9855;return _0x364365;})[_0xfd7f('0x22')](respondWithFilteredResult(_0x2fb7bd,_0x4b35d5))[_0xfd7f('0x42')](handleError(_0x2fb7bd,null));};exports['show']=function(_0xda0c7b,_0x196ab0){var _0x34f3db={'raw':!![],'where':{'id':_0xda0c7b['params']['id']}},_0x37823f={};_0x37823f[_0xfd7f('0x31')]=_[_0xfd7f('0x2e')](db[_0xfd7f('0x29')][_0xfd7f('0x2a')]);_0x37823f[_0xfd7f('0x2d')]=_['keys'](_0xda0c7b[_0xfd7f('0x2d')]);_0x37823f[_0xfd7f('0x2f')]=_[_0xfd7f('0x30')](_0x37823f[_0xfd7f('0x31')],_0x37823f[_0xfd7f('0x2d')]);_0x34f3db[_0xfd7f('0x32')]=_['intersection'](_0x37823f[_0xfd7f('0x31')],qs[_0xfd7f('0x33')](_0xda0c7b[_0xfd7f('0x2d')]['fields']));_0x34f3db[_0xfd7f('0x32')]=_0x34f3db[_0xfd7f('0x32')][_0xfd7f('0x43')]?_0x34f3db[_0xfd7f('0x32')]:_0x37823f[_0xfd7f('0x31')];if(_0xda0c7b[_0xfd7f('0x2d')][_0xfd7f('0x3e')]){_0x34f3db[_0xfd7f('0x3f')]=[{'all':!![]}];}_0x34f3db=_[_0xfd7f('0x3c')]({},_0x34f3db,_0xda0c7b['options']);return db[_0xfd7f('0x29')][_0xfd7f('0x44')](_0x34f3db)[_0xfd7f('0x22')](handleEntityNotFound(_0x196ab0,null))['then'](respondWithResult(_0x196ab0,null))[_0xfd7f('0x42')](handleError(_0x196ab0,null));};exports[_0xfd7f('0x45')]=function(_0x422e11,_0x51baf0){return db[_0xfd7f('0x29')][_0xfd7f('0x45')](_0x422e11[_0xfd7f('0x46')],{})[_0xfd7f('0x22')](respondWithResult(_0x51baf0,0xc9))[_0xfd7f('0x42')](handleError(_0x51baf0,null));};exports[_0xfd7f('0x47')]=function(_0x377717,_0x2c86de){if(_0x377717[_0xfd7f('0x46')]['id']){delete _0x377717[_0xfd7f('0x46')]['id'];}return db[_0xfd7f('0x29')][_0xfd7f('0x44')]({'where':{'id':_0x377717[_0xfd7f('0x48')]['id']}})[_0xfd7f('0x22')](handleEntityNotFound(_0x2c86de,null))[_0xfd7f('0x22')](saveUpdates(_0x377717[_0xfd7f('0x46')],null))[_0xfd7f('0x22')](respondWithResult(_0x2c86de,null))['catch'](handleError(_0x2c86de,null));};exports[_0xfd7f('0x23')]=function(_0x5c2aea,_0x4f0b58){return db['VoiceDialReport'][_0xfd7f('0x44')]({'where':{'id':_0x5c2aea[_0xfd7f('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f0b58,null))['then'](removeEntity(_0x4f0b58,null))[_0xfd7f('0x42')](handleError(_0x4f0b58,null));};exports['describe']=function(_0x152ea9,_0x34b406){return db[_0xfd7f('0x29')][_0xfd7f('0x49')]()[_0xfd7f('0x22')](respondWithResult(_0x34b406,null))[_0xfd7f('0x42')](handleError(_0x34b406,null));}; \ No newline at end of file +var _0xdf05=['to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','then','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','create','body','find','params','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox'];(function(_0x3149fb,_0x1a6e5a){var _0x14ea9a=function(_0x5f0fb8){while(--_0x5f0fb8){_0x3149fb['push'](_0x3149fb['shift']());}};_0x14ea9a(++_0x1a6e5a);}(_0xdf05,0xd7));var _0x5df0=function(_0x1cd65a,_0x29fa8f){_0x1cd65a=_0x1cd65a-0x0;var _0xf93849=_0xdf05[_0x1cd65a];return _0xf93849;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5df0('0x0'));var jsonpatch=require(_0x5df0('0x1'));var rp=require(_0x5df0('0x2'));var moment=require('moment');var BPromise=require(_0x5df0('0x3'));var Mustache=require(_0x5df0('0x4'));var util=require('util');var path=require(_0x5df0('0x5'));var sox=require(_0x5df0('0x6'));var csv=require(_0x5df0('0x7'));var ejs=require(_0x5df0('0x8'));var fs=require('fs');var fs_extra=require(_0x5df0('0x9'));var _=require(_0x5df0('0xa'));var squel=require(_0x5df0('0xb'));var crypto=require(_0x5df0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5df0('0xd'));var toCsv=require(_0x5df0('0x7'));var querystring=require('querystring');var Papa=require(_0x5df0('0xe'));var Redis=require(_0x5df0('0xf'));var authService=require(_0x5df0('0x10'));var qs=require(_0x5df0('0x11'));var as=require(_0x5df0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5df0('0x13'))('api');var utils=require(_0x5df0('0x14'));var config=require(_0x5df0('0x15'));var licenseUtil=require(_0x5df0('0x16'));var db=require(_0x5df0('0x17'))['db'];function respondWithStatusCode(_0x4fc172,_0xee107d){_0xee107d=_0xee107d||0xcc;return function(_0x7d14da){if(_0x7d14da){return _0x4fc172[_0x5df0('0x18')](_0xee107d);}return _0x4fc172['status'](_0xee107d)[_0x5df0('0x19')]();};}function respondWithResult(_0xdb4939,_0x1c1bdc){_0x1c1bdc=_0x1c1bdc||0xc8;return function(_0x1e0809){if(_0x1e0809){return _0xdb4939[_0x5df0('0x1a')](_0x1c1bdc)[_0x5df0('0x1b')](_0x1e0809);}};}function respondWithFilteredResult(_0xc3a0f,_0x4603d7){return function(_0x55bf25){if(_0x55bf25){var _0x1a9d82=typeof _0x4603d7['offset']===_0x5df0('0x1c')&&typeof _0x4603d7['limit']==='undefined';var _0x430e85=_0x55bf25[_0x5df0('0x1d')];var _0x3c624f=_0x1a9d82?0x0:_0x4603d7[_0x5df0('0x1e')];var _0x316289=_0x1a9d82?_0x55bf25[_0x5df0('0x1d')]:_0x4603d7['offset']+_0x4603d7[_0x5df0('0x1f')];var _0x956bae;if(_0x316289>=_0x430e85){_0x316289=_0x430e85;_0x956bae=0xc8;}else{_0x956bae=0xce;}_0xc3a0f[_0x5df0('0x1a')](_0x956bae);return _0xc3a0f[_0x5df0('0x20')](_0x5df0('0x21'),_0x3c624f+'-'+_0x316289+'/'+_0x430e85)['json'](_0x55bf25);}return null;};}function patchUpdates(_0x2abc9e){return function(_0x45a67f){try{jsonpatch[_0x5df0('0x22')](_0x45a67f,_0x2abc9e,!![]);}catch(_0x424cd0){return BPromise['reject'](_0x424cd0);}return _0x45a67f['save']();};}function saveUpdates(_0x2ab1d6,_0x589019){return function(_0x536674){if(_0x536674){return _0x536674[_0x5df0('0x23')](_0x2ab1d6)['then'](function(_0x4b5879){return _0x4b5879;});}return null;};}function removeEntity(_0x2af931,_0x5d3917){return function(_0x53c930){if(_0x53c930){return _0x53c930[_0x5df0('0x24')]()[_0x5df0('0x25')](function(){_0x2af931[_0x5df0('0x1a')](0xcc)[_0x5df0('0x19')]();});}};}function handleEntityNotFound(_0x2e4570,_0x29b954){return function(_0x22b217){if(!_0x22b217){_0x2e4570[_0x5df0('0x18')](0x194);}return _0x22b217;};}function handleError(_0xf6eff1,_0x2aed48){_0x2aed48=_0x2aed48||0x1f4;return function(_0x44a221){logger[_0x5df0('0x26')](_0x44a221['stack']);if(_0x44a221['name']){delete _0x44a221[_0x5df0('0x27')];}_0xf6eff1['status'](_0x2aed48)[_0x5df0('0x28')](_0x44a221);};}exports[_0x5df0('0x29')]=function(_0x5aeb54,_0xaf239b){var _0x9d7102={},_0x16259b={},_0x28f134={'count':0x0,'rows':[]};var _0x4d33c3=_[_0x5df0('0x2a')](db[_0x5df0('0x2b')][_0x5df0('0x2c')],function(_0x426a4d){return{'name':_0x426a4d[_0x5df0('0x2d')],'type':_0x426a4d['type'][_0x5df0('0x2e')]};});_0x16259b[_0x5df0('0x2f')]=_[_0x5df0('0x2a')](_0x4d33c3,_0x5df0('0x27'));_0x16259b['query']=_[_0x5df0('0x30')](_0x5aeb54[_0x5df0('0x31')]);_0x16259b[_0x5df0('0x32')]=_['intersection'](_0x16259b[_0x5df0('0x2f')],_0x16259b['query']);_0x9d7102['attributes']=_[_0x5df0('0x33')](_0x16259b[_0x5df0('0x2f')],qs[_0x5df0('0x34')](_0x5aeb54[_0x5df0('0x31')][_0x5df0('0x34')]));_0x9d7102[_0x5df0('0x35')]=_0x9d7102['attributes'][_0x5df0('0x36')]?_0x9d7102[_0x5df0('0x35')]:_0x16259b['model'];if(!_0x5aeb54[_0x5df0('0x31')]['hasOwnProperty'](_0x5df0('0x37'))){_0x9d7102[_0x5df0('0x1f')]=qs[_0x5df0('0x1f')](_0x5aeb54[_0x5df0('0x31')]['limit']);_0x9d7102[_0x5df0('0x1e')]=qs[_0x5df0('0x1e')](_0x5aeb54['query'][_0x5df0('0x1e')]);}_0x9d7102[_0x5df0('0x38')]=qs[_0x5df0('0x39')](_0x5aeb54['query'][_0x5df0('0x39')]);_0x9d7102[_0x5df0('0x3a')]=qs[_0x5df0('0x32')](_[_0x5df0('0x3b')](_0x5aeb54[_0x5df0('0x31')],_0x16259b[_0x5df0('0x32')]),_0x4d33c3);if(_0x5aeb54['query']['filter']){_0x9d7102['where']=_['merge'](_0x9d7102['where'],{'$or':_[_0x5df0('0x2a')](_0x4d33c3,function(_0xb49c3e){if(_0xb49c3e[_0x5df0('0x3c')]!==_0x5df0('0x3d')){var _0x493a82={};_0x493a82[_0xb49c3e[_0x5df0('0x27')]]={'$like':'%'+_0x5aeb54[_0x5df0('0x31')][_0x5df0('0x3e')]+'%'};return _0x493a82;}})});}_0x9d7102=_[_0x5df0('0x3f')]({},_0x9d7102,_0x5aeb54[_0x5df0('0x40')]);var _0x18e6a5={'where':_0x9d7102[_0x5df0('0x3a')]};return db[_0x5df0('0x2b')][_0x5df0('0x1d')](_0x18e6a5)['then'](function(_0x45c98f){_0x28f134[_0x5df0('0x1d')]=_0x45c98f;if(_0x5aeb54[_0x5df0('0x31')][_0x5df0('0x41')]){_0x9d7102[_0x5df0('0x42')]=[{'all':!![]}];}return db[_0x5df0('0x2b')][_0x5df0('0x43')](_0x9d7102);})[_0x5df0('0x25')](function(_0x5bc7e5){_0x28f134['rows']=_0x5bc7e5;return _0x28f134;})[_0x5df0('0x25')](respondWithFilteredResult(_0xaf239b,_0x9d7102))[_0x5df0('0x44')](handleError(_0xaf239b,null));};exports['show']=function(_0x221d2f,_0x4c64a8){var _0x3626a8={'raw':!![],'where':{'id':_0x221d2f['params']['id']}},_0x487d14={};_0x487d14[_0x5df0('0x2f')]=_[_0x5df0('0x30')](db['VoiceDialReport']['rawAttributes']);_0x487d14[_0x5df0('0x31')]=_[_0x5df0('0x30')](_0x221d2f[_0x5df0('0x31')]);_0x487d14[_0x5df0('0x32')]=_[_0x5df0('0x33')](_0x487d14[_0x5df0('0x2f')],_0x487d14[_0x5df0('0x31')]);_0x3626a8[_0x5df0('0x35')]=_[_0x5df0('0x33')](_0x487d14[_0x5df0('0x2f')],qs['fields'](_0x221d2f[_0x5df0('0x31')][_0x5df0('0x34')]));_0x3626a8[_0x5df0('0x35')]=_0x3626a8[_0x5df0('0x35')][_0x5df0('0x36')]?_0x3626a8[_0x5df0('0x35')]:_0x487d14[_0x5df0('0x2f')];if(_0x221d2f[_0x5df0('0x31')][_0x5df0('0x41')]){_0x3626a8[_0x5df0('0x42')]=[{'all':!![]}];}_0x3626a8=_[_0x5df0('0x3f')]({},_0x3626a8,_0x221d2f['options']);return db['VoiceDialReport']['find'](_0x3626a8)[_0x5df0('0x25')](handleEntityNotFound(_0x4c64a8,null))[_0x5df0('0x25')](respondWithResult(_0x4c64a8,null))[_0x5df0('0x44')](handleError(_0x4c64a8,null));};exports['create']=function(_0xc2f946,_0x348595){return db[_0x5df0('0x2b')][_0x5df0('0x45')](_0xc2f946[_0x5df0('0x46')],{})[_0x5df0('0x25')](respondWithResult(_0x348595,0xc9))['catch'](handleError(_0x348595,null));};exports[_0x5df0('0x23')]=function(_0x231b15,_0x3b8e28){if(_0x231b15[_0x5df0('0x46')]['id']){delete _0x231b15[_0x5df0('0x46')]['id'];}return db[_0x5df0('0x2b')][_0x5df0('0x47')]({'where':{'id':_0x231b15['params']['id']}})[_0x5df0('0x25')](handleEntityNotFound(_0x3b8e28,null))[_0x5df0('0x25')](saveUpdates(_0x231b15[_0x5df0('0x46')],null))['then'](respondWithResult(_0x3b8e28,null))[_0x5df0('0x44')](handleError(_0x3b8e28,null));};exports[_0x5df0('0x24')]=function(_0x4df470,_0x1a4889){return db['VoiceDialReport']['find']({'where':{'id':_0x4df470[_0x5df0('0x48')]['id']}})[_0x5df0('0x25')](handleEntityNotFound(_0x1a4889,null))[_0x5df0('0x25')](removeEntity(_0x1a4889,null))[_0x5df0('0x44')](handleError(_0x1a4889,null));};exports['describe']=function(_0x21923f,_0xa3b8cd){return db[_0x5df0('0x2b')][_0x5df0('0x49')]()[_0x5df0('0x25')](respondWithResult(_0xa3b8cd,null))[_0x5df0('0x44')](handleError(_0xa3b8cd,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 4deb643..e293299 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 _0x196e=['path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1a0d05,_0x5b4629){var _0x455f3f=function(_0x573aa4){while(--_0x573aa4){_0x1a0d05['push'](_0x1a0d05['shift']());}};_0x455f3f(++_0x5b4629);}(_0x196e,0xcc));var _0xe196=function(_0x210603,_0x4adbac){_0x210603=_0x210603-0x0;var _0x1bcb7d=_0x196e[_0x210603];return _0x1bcb7d;};'use strict';var _=require(_0xe196('0x0'));var util=require(_0xe196('0x1'));var logger=require(_0xe196('0x2'))(_0xe196('0x3'));var moment=require(_0xe196('0x4'));var BPromise=require(_0xe196('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe196('0x6'));var rimraf=require(_0xe196('0x7'));var config=require(_0xe196('0x8'));var attributes=require(_0xe196('0x9'));module[_0xe196('0xa')]=function(_0x38bb23,_0x1e464b){return _0x38bb23[_0xe196('0xb')]('VoiceDialReport',attributes,{'tableName':_0xe196('0xc'),'paranoid':![],'indexes':[{'fields':[_0xe196('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf5dc=['./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xf5dc,0x117));var _0xcf5d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf5dc[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcf5d('0x0'))(_0xcf5d('0x1'));var moment=require('moment');var BPromise=require(_0xcf5d('0x2'));var rp=require(_0xcf5d('0x3'));var fs=require('fs');var path=require(_0xcf5d('0x4'));var rimraf=require(_0xcf5d('0x5'));var config=require(_0xcf5d('0x6'));var attributes=require(_0xcf5d('0x7'));module[_0xcf5d('0x8')]=function(_0x1eae81,_0x31f5d0){return _0x1eae81[_0xcf5d('0x9')](_0xcf5d('0xa'),attributes,{'tableName':_0xcf5d('0xb'),'paranoid':![],'indexes':[{'fields':[_0xcf5d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 9396b6a..599f23c 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 _0xe95d=['message','request\x20sent','result','catch','CreateVoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x8ed2fe,_0x19ca78){var _0x23a751=function(_0x412f75){while(--_0x412f75){_0x8ed2fe['push'](_0x8ed2fe['shift']());}};_0x23a751(++_0x19ca78);}(_0xe95d,0x1a1));var _0xde95=function(_0x526fb1,_0x1d0359){_0x526fb1=_0x526fb1-0x0;var _0x33582f=_0xe95d[_0x526fb1];return _0x33582f;};'use strict';var _=require(_0xde95('0x0'));var util=require('util');var moment=require(_0xde95('0x1'));var BPromise=require(_0xde95('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde95('0x3'));var db=require(_0xde95('0x4'))['db'];var utils=require(_0xde95('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xde95('0x6'));var client=jayson[_0xde95('0x7')][_0xde95('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c6a53,_0x534ddd,_0x38c970){return new BPromise(function(_0x3d1017,_0x4b802a){return client[_0xde95('0x9')](_0x3c6a53,_0x38c970)[_0xde95('0xa')](function(_0x167df9){logger[_0xde95('0xb')](_0xde95('0xc'),_0x534ddd,'request\x20sent');logger[_0xde95('0xd')](_0xde95('0xe'),_0x534ddd,'request\x20sent',JSON[_0xde95('0xf')](_0x167df9));if(_0x167df9['error']){if(_0x167df9['error']['code']===0x1f4){logger['error'](_0xde95('0xc'),_0x534ddd,_0x167df9[_0xde95('0x10')]['message']);return _0x4b802a(_0x167df9[_0xde95('0x10')][_0xde95('0x11')]);}logger[_0xde95('0x10')](_0xde95('0xc'),_0x534ddd,_0x167df9['error']['message']);return _0x3d1017(_0x167df9[_0xde95('0x10')]['message']);}else{logger[_0xde95('0xb')](_0xde95('0xc'),_0x534ddd,_0xde95('0x12'));_0x3d1017(_0x167df9[_0xde95('0x13')]['message']);}})[_0xde95('0x14')](function(_0xc833b){logger[_0xde95('0x10')](_0xde95('0xc'),_0x534ddd,_0xc833b);_0x4b802a(_0xc833b);});});}exports[_0xde95('0x15')]=function(_0x42abeb){var _0x53c9d4=this;return new Promise(function(_0x19ea11,_0x30ec41){return db['VoiceDialReport'][_0xde95('0x16')](_0x42abeb[_0xde95('0x17')],{'raw':_0x42abeb[_0xde95('0x18')]?_0x42abeb[_0xde95('0x18')][_0xde95('0x19')]===undefined?!![]:![]:!![]})[_0xde95('0xa')](function(_0x1c5e46){logger['info'](_0xde95('0x15'),_0x42abeb);logger[_0xde95('0xd')](_0xde95('0x15'),_0x42abeb,JSON[_0xde95('0xf')](_0x1c5e46));_0x19ea11(_0x1c5e46);})['catch'](function(_0xb2682d){logger[_0xde95('0x10')](_0xde95('0x15'),_0xb2682d[_0xde95('0x11')],_0x42abeb);_0x30ec41(_0x53c9d4[_0xde95('0x10')](0x1f4,_0xb2682d[_0xde95('0x11')]));});});};exports[_0xde95('0x1a')]=function(_0x714377){var _0x2c01d9=this;return new Promise(function(_0xc91f66,_0x4dbf7c){return db['VoiceDialReport'][_0xde95('0x1b')](_0x714377['body'],{'raw':_0x714377[_0xde95('0x18')]?_0x714377[_0xde95('0x18')][_0xde95('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x714377[_0xde95('0x18')]?_0x714377[_0xde95('0x18')][_0xde95('0x1c')]||null:null,'attributes':_0x714377[_0xde95('0x18')]?_0x714377[_0xde95('0x18')][_0xde95('0x1d')]||null:null,'limit':_0x714377[_0xde95('0x18')]?_0x714377[_0xde95('0x18')][_0xde95('0x1e')]||null:null})[_0xde95('0xa')](function(_0x2173ad){logger[_0xde95('0xb')](_0xde95('0x1a'),_0x714377);logger['debug'](_0xde95('0x1a'),_0x714377,JSON[_0xde95('0xf')](_0x2173ad));_0xc91f66(_0x2173ad);})['catch'](function(_0x5a8953){logger[_0xde95('0x10')]('UpdateVoiceDialReport',_0x5a8953[_0xde95('0x11')],_0x714377);_0x4dbf7c(_0x2c01d9[_0xde95('0x10')](0x1f4,_0x5a8953[_0xde95('0x11')]));});});}; \ No newline at end of file +var _0x3af8=['../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceDialReport','create','body','options','stringify','UpdateVoiceDialReport','update','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4214af,_0x197efd){var _0x1f6b1e=function(_0x539bd0){while(--_0x539bd0){_0x4214af['push'](_0x4214af['shift']());}};_0x1f6b1e(++_0x197efd);}(_0x3af8,0xae));var _0x83af=function(_0xc0cf5,_0x42bd3f){_0xc0cf5=_0xc0cf5-0x0;var _0xe1f6bc=_0x3af8[_0xc0cf5];return _0xe1f6bc;};'use strict';var _=require(_0x83af('0x0'));var util=require(_0x83af('0x1'));var moment=require('moment');var BPromise=require(_0x83af('0x2'));var rs=require(_0x83af('0x3'));var fs=require('fs');var Redis=require(_0x83af('0x4'));var db=require(_0x83af('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x83af('0x6'))(_0x83af('0x7'));var config=require('../../config/environment');var jayson=require(_0x83af('0x8'));var client=jayson[_0x83af('0x9')][_0x83af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51f83a,_0x2fad60,_0x7c2974){return new BPromise(function(_0x11d1ba,_0x3c365c){return client['request'](_0x51f83a,_0x7c2974)[_0x83af('0xb')](function(_0x557136){logger[_0x83af('0xc')](_0x83af('0xd'),_0x2fad60,_0x83af('0xe'));logger[_0x83af('0xf')](_0x83af('0x10'),_0x2fad60,_0x83af('0xe'),JSON['stringify'](_0x557136));if(_0x557136[_0x83af('0x11')]){if(_0x557136['error'][_0x83af('0x12')]===0x1f4){logger['error'](_0x83af('0xd'),_0x2fad60,_0x557136['error']['message']);return _0x3c365c(_0x557136[_0x83af('0x11')][_0x83af('0x13')]);}logger[_0x83af('0x11')](_0x83af('0xd'),_0x2fad60,_0x557136[_0x83af('0x11')][_0x83af('0x13')]);return _0x11d1ba(_0x557136[_0x83af('0x11')]['message']);}else{logger[_0x83af('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x2fad60,_0x83af('0xe'));_0x11d1ba(_0x557136[_0x83af('0x14')][_0x83af('0x13')]);}})[_0x83af('0x15')](function(_0x2d013d){logger[_0x83af('0x11')](_0x83af('0xd'),_0x2fad60,_0x2d013d);_0x3c365c(_0x2d013d);});});}exports[_0x83af('0x16')]=function(_0x222ff5){var _0x1c95c2=this;return new Promise(function(_0x31a6b8,_0x26126b){return db['VoiceDialReport'][_0x83af('0x17')](_0x222ff5[_0x83af('0x18')],{'raw':_0x222ff5[_0x83af('0x19')]?_0x222ff5[_0x83af('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x83af('0xb')](function(_0x338119){logger[_0x83af('0xc')]('CreateVoiceDialReport',_0x222ff5);logger[_0x83af('0xf')](_0x83af('0x16'),_0x222ff5,JSON[_0x83af('0x1a')](_0x338119));_0x31a6b8(_0x338119);})['catch'](function(_0x56cbfa){logger['error'](_0x83af('0x16'),_0x56cbfa['message'],_0x222ff5);_0x26126b(_0x1c95c2[_0x83af('0x11')](0x1f4,_0x56cbfa[_0x83af('0x13')]));});});};exports[_0x83af('0x1b')]=function(_0x3dbe87){var _0x343858=this;return new Promise(function(_0x14f219,_0xec86e3){return db['VoiceDialReport'][_0x83af('0x1c')](_0x3dbe87[_0x83af('0x18')],{'raw':_0x3dbe87['options']?_0x3dbe87['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dbe87[_0x83af('0x19')]?_0x3dbe87['options']['where']||null:null,'attributes':_0x3dbe87[_0x83af('0x19')]?_0x3dbe87[_0x83af('0x19')]['attributes']||null:null,'limit':_0x3dbe87[_0x83af('0x19')]?_0x3dbe87[_0x83af('0x19')][_0x83af('0x1d')]||null:null})[_0x83af('0xb')](function(_0x51b37e){logger[_0x83af('0xc')](_0x83af('0x1b'),_0x3dbe87);logger['debug'](_0x83af('0x1b'),_0x3dbe87,JSON['stringify'](_0x51b37e));_0x14f219(_0x51b37e);})[_0x83af('0x15')](function(_0xd943c4){logger['error'](_0x83af('0x1b'),_0xd943c4['message'],_0x3dbe87);_0xec86e3(_0x343858[_0x83af('0x11')](0x1f4,_0xd943c4[_0x83af('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index ea15457..80dfcf1 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 _0x7e8c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','create','post','/:id/applications','addApplications','put','/:id','update','destroy','util','path'];(function(_0x39d90c,_0x1b7ea0){var _0x504875=function(_0x589909){while(--_0x589909){_0x39d90c['push'](_0x39d90c['shift']());}};_0x504875(++_0x1b7ea0);}(_0x7e8c,0x1f2));var _0xc7e8=function(_0x3abf76,_0x10cae0){_0x3abf76=_0x3abf76-0x0;var _0x1133cc=_0x7e8c[_0x3abf76];return _0x1133cc;};'use strict';var multer=require('multer');var util=require(_0xc7e8('0x0'));var path=require(_0xc7e8('0x1'));var timeout=require(_0xc7e8('0x2'));var express=require(_0xc7e8('0x3'));var router=express[_0xc7e8('0x4')]();var fs_extra=require(_0xc7e8('0x5'));var auth=require(_0xc7e8('0x6'));var interaction=require(_0xc7e8('0x7'));var config=require('../../config/environment');var controller=require(_0xc7e8('0x8'));router[_0xc7e8('0x9')]('/',auth[_0xc7e8('0xa')](),controller[_0xc7e8('0xb')]);router['get']('/:id',auth[_0xc7e8('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xc7e8('0xc')]);router[_0xc7e8('0xd')](_0xc7e8('0xe'),auth[_0xc7e8('0xa')](),controller[_0xc7e8('0xf')]);router[_0xc7e8('0x10')](_0xc7e8('0x11'),auth[_0xc7e8('0xa')](),controller[_0xc7e8('0x12')]);router['delete'](_0xc7e8('0x11'),auth['isAuthenticated'](),controller[_0xc7e8('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9638=['get','isAuthenticated','/:id','show','post','/:id/applications','put','update','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x9638,0x17f));var _0x8963=function(_0x2fdbf8,_0x461a51){_0x2fdbf8=_0x2fdbf8-0x0;var _0x5dc976=_0x9638[_0x2fdbf8];return _0x5dc976;};'use strict';var multer=require(_0x8963('0x0'));var util=require(_0x8963('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8963('0x2'));var router=express[_0x8963('0x3')]();var fs_extra=require(_0x8963('0x4'));var auth=require(_0x8963('0x5'));var interaction=require(_0x8963('0x6'));var config=require(_0x8963('0x7'));var controller=require('./voiceExtension.controller');router[_0x8963('0x8')]('/',auth[_0x8963('0x9')](),controller['index']);router[_0x8963('0x8')](_0x8963('0xa'),auth[_0x8963('0x9')](),controller[_0x8963('0xb')]);router[_0x8963('0xc')]('/',auth[_0x8963('0x9')](),controller['create']);router[_0x8963('0xc')](_0x8963('0xd'),auth[_0x8963('0x9')](),controller['addApplications']);router[_0x8963('0xe')](_0x8963('0xa'),auth[_0x8963('0x9')](),controller[_0x8963('0xf')]);router['delete']('/:id',auth[_0x8963('0x9')](),controller['destroy']);module[_0x8963('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 59e7391..58fa88a 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 _0xcb91=['outbound','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','STRING','compositeIndex','NoOp','inbound'];(function(_0x1a3212,_0x221431){var _0x53654e=function(_0x114f39){while(--_0x114f39){_0x1a3212['push'](_0x1a3212['shift']());}};_0x53654e(++_0x221431);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0xcb91[_0x38c652];return _0x218a37;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![],'unique':_0x1cb9('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![],'unique':_0x1cb9('0x1')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x1cb9('0x1')},'tag':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1cb9('0x2')},'appdata':{'type':Sequelize[_0x1cb9('0x0')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x1cb9('0x3'),_0x1cb9('0x4'),'internal',_0x1cb9('0x5'),_0x1cb9('0x6'),'system',_0x1cb9('0x7')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1cb9('0x8')},'IntervalId':{'type':Sequelize[_0x1cb9('0x9')]},'isApp':{'type':Sequelize[_0x1cb9('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x1cb9('0x0')],'defaultValue':null},'callerID':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x1cb9('0x9')]},'recordingFormat':{'type':Sequelize[_0x1cb9('0x0')],'defaultValue':_0x1cb9('0xb')},'answer':{'type':Sequelize[_0x1cb9('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x1cb9('0xc')],'get':function(){return this['getDataValue']('exten');}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x52753e,_0x1718bc){var _0x5b2cd5=function(_0x3e1c7c){while(--_0x3e1c7c){_0x52753e['push'](_0x52753e['shift']());}};_0x5b2cd5(++_0x1718bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index ca80cfe..b27f508 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 _0x8249=['merge','options','includeAll','include','VoiceExtension','rows','catch','show','params','keys','rawAttributes','intersection','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','ignore','value','includes','type','find','name','UserProfileResource','end','sendStatus','error','stack','send','index','map','fieldName','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8249,0xe7));var _0x9824=function(_0xc434e4,_0x470cae){_0xc434e4=_0xc434e4-0x0;var _0x21b400=_0x8249[_0xc434e4];return _0x21b400;};'use strict';var _=require(_0x9824('0x0'));var Redis=require('ioredis');var qs=require(_0x9824('0x1'));var logger=require(_0x9824('0x2'))('api');var config=require(_0x9824('0x3'));var db=require(_0x9824('0x4'))['db'];config[_0x9824('0x5')]=_[_0x9824('0x6')](config[_0x9824('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x9824('0x7'))(new Redis(config[_0x9824('0x5')]));require(_0x9824('0x8'))[_0x9824('0x9')](socket);function respondWithStatusCode(_0x26595a,_0x509887){_0x509887=_0x509887||0xcc;return function(_0x2f148c){if(_0x2f148c){return _0x26595a['sendStatus'](_0x509887);}return _0x26595a[_0x9824('0xa')](_0x509887)['end']();};}function respondWithResult(_0x55c610,_0x3fc2ce){_0x3fc2ce=_0x3fc2ce||0xc8;return function(_0xff2964){if(_0xff2964){return _0x55c610['status'](_0x3fc2ce)[_0x9824('0xb')](_0xff2964);}};}function respondWithFilteredResult(_0x5e4147,_0x5aaacf){return function(_0x16e068){if(_0x16e068){var _0x462848=typeof _0x5aaacf[_0x9824('0xc')]==='undefined'&&typeof _0x5aaacf['limit']===_0x9824('0xd');var _0x557129=_0x16e068[_0x9824('0xe')];var _0x248dd2=_0x462848?0x0:_0x5aaacf[_0x9824('0xc')];var _0x1cb21f=_0x462848?_0x16e068[_0x9824('0xe')]:_0x5aaacf[_0x9824('0xc')]+_0x5aaacf[_0x9824('0xf')];var _0x5c6f4c;if(_0x1cb21f>=_0x557129){_0x1cb21f=_0x557129;_0x5c6f4c=0xc8;}else{_0x5c6f4c=0xce;}_0x5e4147[_0x9824('0xa')](_0x5c6f4c);return _0x5e4147[_0x9824('0x10')](_0x9824('0x11'),_0x248dd2+'-'+_0x1cb21f+'/'+_0x557129)[_0x9824('0xb')](_0x16e068);}return null;};}function removeEntity(_0x3c6d2b){return function(_0x3b111b){if(_0x3b111b){return _0x3b111b[_0x9824('0x12')]()[_0x9824('0x13')](function(){var _0x3b88c2=_0x3b111b[_0x9824('0x14')]({'plain':!![]});var _0x59ee89=[{'name':_0x9824('0x15'),'value':_0x9824('0x16'),'ignore':![]},{'name':_0x9824('0x17'),'value':'outbound','ignore':![]},{'name':_0x9824('0x18'),'value':_0x9824('0x19'),'ignore':![]}];var _0x37d8d9=_(_0x59ee89)['filter'](_0x9824('0x1a'))['map'](_0x9824('0x1b'))[_0x9824('0x1b')]();if(_[_0x9824('0x1c')](_0x37d8d9,_0x3b88c2[_0x9824('0x1d')])){return;}var _0xcd3b25=_[_0x9824('0x1e')](_0x59ee89,['value',_0x3b88c2[_0x9824('0x1d')]])[_0x9824('0x1f')];return db[_0x9824('0x20')][_0x9824('0x12')]({'where':{'type':_0xcd3b25,'resourceId':_0x3b88c2['id']}})[_0x9824('0x13')](function(){return _0x3b111b;});})['then'](function(){_0x3c6d2b[_0x9824('0xa')](0xcc)[_0x9824('0x21')]();});}};}function handleEntityNotFound(_0x36ecdb){return function(_0x37e095){if(!_0x37e095){_0x36ecdb[_0x9824('0x22')](0x194);}return _0x37e095;};}function handleError(_0x18a2d4,_0x6c7602){_0x6c7602=_0x6c7602||0x1f4;return function(_0x402cb3){logger[_0x9824('0x23')](_0x402cb3[_0x9824('0x24')]);if(_0x402cb3[_0x9824('0x1f')]){delete _0x402cb3['name'];}_0x18a2d4[_0x9824('0xa')](_0x6c7602)[_0x9824('0x25')](_0x402cb3);};}exports[_0x9824('0x26')]=function(_0x1d0e8e,_0x4ea9a3){var _0xca93c1={},_0x51bd20={},_0x4e7029={'count':0x0,'rows':[]};var _0x214572=_[_0x9824('0x27')](db['VoiceExtension']['rawAttributes'],function(_0x480fd2){return{'name':_0x480fd2[_0x9824('0x28')],'type':_0x480fd2[_0x9824('0x1d')]['key']};});_0x51bd20[_0x9824('0x29')]=_['map'](_0x214572,_0x9824('0x1f'));_0x51bd20[_0x9824('0x2a')]=_['keys'](_0x1d0e8e[_0x9824('0x2a')]);_0x51bd20[_0x9824('0x2b')]=_['intersection'](_0x51bd20['model'],_0x51bd20[_0x9824('0x2a')]);_0xca93c1[_0x9824('0x2c')]=_['intersection'](_0x51bd20[_0x9824('0x29')],qs[_0x9824('0x2d')](_0x1d0e8e[_0x9824('0x2a')][_0x9824('0x2d')]));_0xca93c1[_0x9824('0x2c')]=_0xca93c1['attributes'][_0x9824('0x2e')]?_0xca93c1[_0x9824('0x2c')]:_0x51bd20[_0x9824('0x29')];if(!_0x1d0e8e[_0x9824('0x2a')][_0x9824('0x2f')]('nolimit')){_0xca93c1[_0x9824('0xf')]=qs['limit'](_0x1d0e8e[_0x9824('0x2a')][_0x9824('0xf')]);_0xca93c1[_0x9824('0xc')]=qs[_0x9824('0xc')](_0x1d0e8e['query'][_0x9824('0xc')]);}_0xca93c1[_0x9824('0x30')]=qs[_0x9824('0x31')](_0x1d0e8e[_0x9824('0x2a')][_0x9824('0x31')]);_0xca93c1[_0x9824('0x32')]=qs['filters'](_[_0x9824('0x33')](_0x1d0e8e[_0x9824('0x2a')],_0x51bd20[_0x9824('0x2b')]),_0x214572);if(_0x1d0e8e['query'][_0x9824('0x34')]){_0xca93c1[_0x9824('0x32')]=_['merge'](_0xca93c1[_0x9824('0x32')],{'$or':_[_0x9824('0x27')](_0x214572,function(_0x3d8d06){if(_0x3d8d06[_0x9824('0x1d')]!==_0x9824('0x35')){var _0xcada11={};_0xcada11[_0x3d8d06['name']]={'$like':'%'+_0x1d0e8e['query'][_0x9824('0x34')]+'%'};return _0xcada11;}})});}_0xca93c1=_[_0x9824('0x36')]({},_0xca93c1,_0x1d0e8e[_0x9824('0x37')]);var _0x10ef73={'where':_0xca93c1[_0x9824('0x32')]};return db['VoiceExtension'][_0x9824('0xe')](_0x10ef73)[_0x9824('0x13')](function(_0x37057f){_0x4e7029[_0x9824('0xe')]=_0x37057f;if(_0x1d0e8e[_0x9824('0x2a')][_0x9824('0x38')]){_0xca93c1[_0x9824('0x39')]=[{'all':!![]}];}return db[_0x9824('0x3a')]['findAll'](_0xca93c1);})['then'](function(_0x279343){_0x4e7029[_0x9824('0x3b')]=_0x279343;return _0x4e7029;})['then'](respondWithFilteredResult(_0x4ea9a3,_0xca93c1))[_0x9824('0x3c')](handleError(_0x4ea9a3,null));};exports[_0x9824('0x3d')]=function(_0x52ce4d,_0x15d1c0){var _0x49af6c={'raw':![],'where':{'id':_0x52ce4d[_0x9824('0x3e')]['id']}},_0x50431d={};_0x50431d[_0x9824('0x29')]=_[_0x9824('0x3f')](db[_0x9824('0x3a')][_0x9824('0x40')]);_0x50431d[_0x9824('0x2a')]=_[_0x9824('0x3f')](_0x52ce4d[_0x9824('0x2a')]);_0x50431d[_0x9824('0x2b')]=_['intersection'](_0x50431d[_0x9824('0x29')],_0x50431d[_0x9824('0x2a')]);_0x49af6c[_0x9824('0x2c')]=_[_0x9824('0x41')](_0x50431d['model'],qs[_0x9824('0x2d')](_0x52ce4d['query']['fields']));_0x49af6c[_0x9824('0x2c')]=_0x49af6c['attributes']['length']?_0x49af6c[_0x9824('0x2c')]:_0x50431d['model'];if(_0x52ce4d[_0x9824('0x2a')]['includeAll']){_0x49af6c[_0x9824('0x39')]=[{'all':!![]}];}_0x49af6c=_[_0x9824('0x36')]({},_0x49af6c,_0x52ce4d['options']);return db[_0x9824('0x3a')][_0x9824('0x1e')](_0x49af6c)['then'](handleEntityNotFound(_0x15d1c0,null))['then'](respondWithResult(_0x15d1c0,null))[_0x9824('0x3c')](handleError(_0x15d1c0,null));};exports[_0x9824('0x12')]=function(_0x2db5ea,_0x209a60){return db[_0x9824('0x3a')]['find']({'where':{'id':_0x2db5ea[_0x9824('0x3e')]['id']}})['then'](handleEntityNotFound(_0x209a60,null))[_0x9824('0x13')](removeEntity(_0x209a60,null))[_0x9824('0x3c')](handleError(_0x209a60,null));};exports[_0x9824('0x42')]=function(_0x3166b4,_0xff7eb0){if(_0x3166b4[_0x9824('0x43')][_0x9824('0x1d')]==='outbound'&&!_['startsWith'](_0x3166b4['body'][_0x9824('0x44')],'_')){_0x3166b4[_0x9824('0x43')][_0x9824('0x44')]='_'[_0x9824('0x45')](_0x3166b4[_0x9824('0x43')][_0x9824('0x44')]);}return db[_0x9824('0x3a')]['create'](_0x3166b4[_0x9824('0x43')],{'raw':![]})[_0x9824('0x13')](function(_0x301c0d){var _0x6764eb=_0x3166b4['user'][_0x9824('0x14')]({'plain':!![]});if(!_0x6764eb)throw new Error(_0x9824('0x46'));if(_0x6764eb['role']===_0x9824('0x47')){var _0xce5413=_0x301c0d[_0x9824('0x14')]({'plain':!![]});var _0x41aaab=[{'name':'InboundRoutes','value':_0x9824('0x16')},{'name':_0x9824('0x17'),'value':_0x9824('0x48')},{'name':_0x9824('0x18'),'value':'internal'}];var _0x464c30=_[_0x9824('0x1e')](_0x41aaab,['value',_0xce5413[_0x9824('0x1d')]])[_0x9824('0x1f')];return db[_0x9824('0x49')][_0x9824('0x1e')]({'where':{'name':_0x464c30,'userProfileId':_0x6764eb[_0x9824('0x4a')]},'raw':!![]})['then'](function(_0x5677b2){if(_0x5677b2&&_0x5677b2[_0x9824('0x4b')]===0x0){return db['UserProfileResource'][_0x9824('0x42')]({'name':_0xce5413[_0x9824('0x1f')],'resourceId':_0xce5413['id'],'type':_0x5677b2[_0x9824('0x1f')],'sectionId':_0x5677b2['id']},{})[_0x9824('0x13')](function(){return _0x301c0d;});}else{return _0x301c0d;}})[_0x9824('0x3c')](function(_0x1ceb5b){logger['error'](_0x9824('0x4c'),_0x1ceb5b);throw _0x1ceb5b;});}return _0x301c0d;})[_0x9824('0x13')](respondWithResult(_0xff7eb0,0xc9))[_0x9824('0x3c')](handleError(_0xff7eb0,null));};exports['update']=function(_0x1b7e6f,_0x204a80){if(_0x1b7e6f[_0x9824('0x43')]['id']){delete _0x1b7e6f['body']['id'];}return db[_0x9824('0x3a')][_0x9824('0x1e')]({'where':{'id':_0x1b7e6f['params']['id']}})[_0x9824('0x13')](handleEntityNotFound(_0x204a80,null))[_0x9824('0x13')](function(_0x44b543){if(_0x44b543){return db['VoiceExtension']['update'](_['pick'](_0x1b7e6f['body'],[_0x9824('0x44'),_0x9824('0x4d'),_0x9824('0x4e'),_0x9824('0x4f'),_0x9824('0x50'),_0x9824('0x51'),'alias']),{'where':{'context':_0x44b543[_0x9824('0x4d')],'exten':_0x44b543[_0x9824('0x44')]},'individualHooks':!![]})['then'](function(_0x33a1b3){return _0x33a1b3;});}return null;})['then'](respondWithStatusCode(_0x204a80,null))[_0x9824('0x3c')](handleError(_0x204a80,null));};exports[_0x9824('0x52')]=function(_0x3c5e07,_0x4eb7f1){var _0x467d25=_0x3c5e07[_0x9824('0x3e')]['id'];var _0x1b5540=_0x3c5e07[_0x9824('0x43')];var _0x950a89=0xc8;var _0x530fab=null;return db[_0x9824('0x53')][_0x9824('0x54')]({'isolationLevel':db[_0x9824('0x53')][_0x9824('0x55')][_0x9824('0x56')][_0x9824('0x57')]},function(_0x5bb046){return db['VoiceExtension'][_0x9824('0x58')]({'where':{'id':_0x467d25},'transaction':_0x5bb046})[_0x9824('0x13')](function(_0x10cd1f){if(_0x10cd1f){return db[_0x9824('0x3a')][_0x9824('0x12')]({'where':{'VoiceExtensionId':_0x467d25},'transaction':_0x5bb046})[_0x9824('0x13')](function(){var _0xd6aa09=_[_0x9824('0x27')](_0x1b5540,function(_0x1ecb9f){_0x1ecb9f[_0x9824('0x59')]=_0x467d25;_0x1ecb9f[_0x9824('0x5a')]=!![];return _0x1ecb9f;});return _0x10cd1f['createRouting'](_0xd6aa09);})[_0x9824('0x13')](function(_0x32d4f0){return db[_0x9824('0x3a')][_0x9824('0x5b')](_0x32d4f0,{'transaction':_0x5bb046});});}else{_0x950a89=0x194;_0x530fab=[];}});})[_0x9824('0x13')](function(){if(_0x950a89!==0x194){return db[_0x9824('0x3a')][_0x9824('0x5c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x467d25},'order':_0x9824('0x5d')})[_0x9824('0x13')](function(_0x3310d1){_0x530fab=_0x3310d1;});}})[_0x9824('0x3c')](function(_0x51d687){_0x950a89=0x1f4;logger['error'](_0x51d687[_0x9824('0x24')]);if(_0x51d687[_0x9824('0x1f')]){delete _0x51d687[_0x9824('0x1f')];}_0x530fab=_0x51d687;})[_0x9824('0x5e')](function(){if(_0x530fab===null){_0x4eb7f1[_0x9824('0x22')](_0x950a89);}else{if(_0x950a89===0x1f4){_0x4eb7f1[_0x9824('0xa')](_0x950a89)['send'](_0x530fab);}else{_0x4eb7f1['status'](_0x950a89)[_0x9824('0xb')](_0x530fab);}}});}; \ No newline at end of file +var _0x4fe9=['cast(priority\x20as\x20unsigned)','finally','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','destroy','then','get','InboundRoutes','inbound','outbound','internal','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','VoiceExtension','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','includeAll','catch','show','params','include','merge','create','startsWith','body','concat','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','InternalRoutes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','recordingFormat','cutdigits','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','findAndCountAll'];(function(_0xa8efed,_0x397a46){var _0x55604c=function(_0x6b0e62){while(--_0x6b0e62){_0xa8efed['push'](_0xa8efed['shift']());}};_0x55604c(++_0x397a46);}(_0x4fe9,0x1c4));var _0x94fe=function(_0x1df218,_0x5153cf){_0x1df218=_0x1df218-0x0;var _0xc8db46=_0x4fe9[_0x1df218];return _0xc8db46;};'use strict';var _=require(_0x94fe('0x0'));var Redis=require('ioredis');var qs=require(_0x94fe('0x1'));var logger=require(_0x94fe('0x2'))('api');var config=require(_0x94fe('0x3'));var db=require('../../mysqldb')['db'];config[_0x94fe('0x4')]=_['defaults'](config[_0x94fe('0x4')],{'host':_0x94fe('0x5'),'port':0x18eb});var socket=require(_0x94fe('0x6'))(new Redis(config[_0x94fe('0x4')]));require(_0x94fe('0x7'))['register'](socket);function respondWithStatusCode(_0x47743a,_0xff709e){_0xff709e=_0xff709e||0xcc;return function(_0x36260c){if(_0x36260c){return _0x47743a[_0x94fe('0x8')](_0xff709e);}return _0x47743a[_0x94fe('0x9')](_0xff709e)[_0x94fe('0xa')]();};}function respondWithResult(_0x3128e8,_0x4e7d36){_0x4e7d36=_0x4e7d36||0xc8;return function(_0x3160c3){if(_0x3160c3){return _0x3128e8['status'](_0x4e7d36)['json'](_0x3160c3);}};}function respondWithFilteredResult(_0xa51e93,_0xf0eea3){return function(_0x540603){if(_0x540603){var _0x2341d1=typeof _0xf0eea3[_0x94fe('0xb')]==='undefined'&&typeof _0xf0eea3[_0x94fe('0xc')]===_0x94fe('0xd');var _0x2fc0fd=_0x540603[_0x94fe('0xe')];var _0x1c92b8=_0x2341d1?0x0:_0xf0eea3[_0x94fe('0xb')];var _0x2ea297=_0x2341d1?_0x540603[_0x94fe('0xe')]:_0xf0eea3['offset']+_0xf0eea3['limit'];var _0x3ab6d2;if(_0x2ea297>=_0x2fc0fd){_0x2ea297=_0x2fc0fd;_0x3ab6d2=0xc8;}else{_0x3ab6d2=0xce;}_0xa51e93[_0x94fe('0x9')](_0x3ab6d2);return _0xa51e93[_0x94fe('0xf')](_0x94fe('0x10'),_0x1c92b8+'-'+_0x2ea297+'/'+_0x2fc0fd)[_0x94fe('0x11')](_0x540603);}return null;};}function removeEntity(_0x7bbd02){return function(_0x15d868){if(_0x15d868){return _0x15d868[_0x94fe('0x12')]()[_0x94fe('0x13')](function(){var _0x84f734=_0x15d868[_0x94fe('0x14')]({'plain':!![]});var _0x100d98=[{'name':_0x94fe('0x15'),'value':_0x94fe('0x16'),'ignore':![]},{'name':'OutboundRoutes','value':_0x94fe('0x17'),'ignore':![]},{'name':'InternalRoutes','value':_0x94fe('0x18'),'ignore':![]}];var _0x9b84de=_(_0x100d98)['filter'](_0x94fe('0x19'))[_0x94fe('0x1a')](_0x94fe('0x1b'))[_0x94fe('0x1b')]();if(_[_0x94fe('0x1c')](_0x9b84de,_0x84f734[_0x94fe('0x1d')])){return;}var _0x1c6893=_[_0x94fe('0x1e')](_0x100d98,[_0x94fe('0x1b'),_0x84f734[_0x94fe('0x1d')]])[_0x94fe('0x1f')];return db[_0x94fe('0x20')]['destroy']({'where':{'type':_0x1c6893,'resourceId':_0x84f734['id']}})[_0x94fe('0x13')](function(){return _0x15d868;});})['then'](function(){_0x7bbd02[_0x94fe('0x9')](0xcc)[_0x94fe('0xa')]();});}};}function handleEntityNotFound(_0xfc7bf9){return function(_0x15ea02){if(!_0x15ea02){_0xfc7bf9['sendStatus'](0x194);}return _0x15ea02;};}function handleError(_0x1b7730,_0xa27d58){_0xa27d58=_0xa27d58||0x1f4;return function(_0x177c3a){logger[_0x94fe('0x21')](_0x177c3a[_0x94fe('0x22')]);if(_0x177c3a[_0x94fe('0x1f')]){delete _0x177c3a[_0x94fe('0x1f')];}_0x1b7730['status'](_0xa27d58)[_0x94fe('0x23')](_0x177c3a);};}exports['index']=function(_0x8a24,_0x5b528b){var _0x17ab87={},_0x223141={},_0x54a83d={'count':0x0,'rows':[]};var _0x4873c4=_['map'](db[_0x94fe('0x24')][_0x94fe('0x25')],function(_0x3ef5f4){return{'name':_0x3ef5f4[_0x94fe('0x26')],'type':_0x3ef5f4[_0x94fe('0x1d')][_0x94fe('0x27')]};});_0x223141[_0x94fe('0x28')]=_[_0x94fe('0x1a')](_0x4873c4,'name');_0x223141['query']=_[_0x94fe('0x29')](_0x8a24['query']);_0x223141[_0x94fe('0x2a')]=_[_0x94fe('0x2b')](_0x223141[_0x94fe('0x28')],_0x223141[_0x94fe('0x2c')]);_0x17ab87[_0x94fe('0x2d')]=_['intersection'](_0x223141['model'],qs[_0x94fe('0x2e')](_0x8a24[_0x94fe('0x2c')][_0x94fe('0x2e')]));_0x17ab87[_0x94fe('0x2d')]=_0x17ab87['attributes'][_0x94fe('0x2f')]?_0x17ab87['attributes']:_0x223141[_0x94fe('0x28')];if(!_0x8a24[_0x94fe('0x2c')][_0x94fe('0x30')]('nolimit')){_0x17ab87[_0x94fe('0xc')]=qs[_0x94fe('0xc')](_0x8a24[_0x94fe('0x2c')]['limit']);_0x17ab87[_0x94fe('0xb')]=qs[_0x94fe('0xb')](_0x8a24[_0x94fe('0x2c')]['offset']);}_0x17ab87[_0x94fe('0x31')]=qs[_0x94fe('0x32')](_0x8a24[_0x94fe('0x2c')][_0x94fe('0x32')]);_0x17ab87[_0x94fe('0x33')]=qs[_0x94fe('0x2a')](_['pick'](_0x8a24['query'],_0x223141[_0x94fe('0x2a')]),_0x4873c4);if(_0x8a24[_0x94fe('0x2c')][_0x94fe('0x34')]){_0x17ab87[_0x94fe('0x33')]=_['merge'](_0x17ab87[_0x94fe('0x33')],{'$or':_[_0x94fe('0x1a')](_0x4873c4,function(_0x576d7a){if(_0x576d7a[_0x94fe('0x1d')]!==_0x94fe('0x35')){var _0x48a12e={};_0x48a12e[_0x576d7a[_0x94fe('0x1f')]]={'$like':'%'+_0x8a24[_0x94fe('0x2c')]['filter']+'%'};return _0x48a12e;}})});}_0x17ab87=_['merge']({},_0x17ab87,_0x8a24[_0x94fe('0x36')]);var _0x5cfd46={'where':_0x17ab87[_0x94fe('0x33')]};return db[_0x94fe('0x24')]['count'](_0x5cfd46)[_0x94fe('0x13')](function(_0x3d2b1a){_0x54a83d[_0x94fe('0xe')]=_0x3d2b1a;if(_0x8a24[_0x94fe('0x2c')][_0x94fe('0x37')]){_0x17ab87['include']=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x17ab87);})[_0x94fe('0x13')](function(_0x23e954){_0x54a83d['rows']=_0x23e954;return _0x54a83d;})[_0x94fe('0x13')](respondWithFilteredResult(_0x5b528b,_0x17ab87))[_0x94fe('0x38')](handleError(_0x5b528b,null));};exports[_0x94fe('0x39')]=function(_0x90fcd,_0xc22fb3){var _0x353e89={'raw':![],'where':{'id':_0x90fcd[_0x94fe('0x3a')]['id']}},_0xcdf56b={};_0xcdf56b[_0x94fe('0x28')]=_[_0x94fe('0x29')](db[_0x94fe('0x24')]['rawAttributes']);_0xcdf56b[_0x94fe('0x2c')]=_['keys'](_0x90fcd[_0x94fe('0x2c')]);_0xcdf56b['filters']=_[_0x94fe('0x2b')](_0xcdf56b[_0x94fe('0x28')],_0xcdf56b['query']);_0x353e89[_0x94fe('0x2d')]=_[_0x94fe('0x2b')](_0xcdf56b[_0x94fe('0x28')],qs[_0x94fe('0x2e')](_0x90fcd[_0x94fe('0x2c')]['fields']));_0x353e89[_0x94fe('0x2d')]=_0x353e89[_0x94fe('0x2d')][_0x94fe('0x2f')]?_0x353e89[_0x94fe('0x2d')]:_0xcdf56b[_0x94fe('0x28')];if(_0x90fcd[_0x94fe('0x2c')][_0x94fe('0x37')]){_0x353e89[_0x94fe('0x3b')]=[{'all':!![]}];}_0x353e89=_[_0x94fe('0x3c')]({},_0x353e89,_0x90fcd['options']);return db[_0x94fe('0x24')][_0x94fe('0x1e')](_0x353e89)[_0x94fe('0x13')](handleEntityNotFound(_0xc22fb3,null))['then'](respondWithResult(_0xc22fb3,null))['catch'](handleError(_0xc22fb3,null));};exports[_0x94fe('0x12')]=function(_0x430878,_0x32edef){return db[_0x94fe('0x24')]['find']({'where':{'id':_0x430878['params']['id']}})[_0x94fe('0x13')](handleEntityNotFound(_0x32edef,null))[_0x94fe('0x13')](removeEntity(_0x32edef,null))[_0x94fe('0x38')](handleError(_0x32edef,null));};exports[_0x94fe('0x3d')]=function(_0x47ce75,_0x19460b){if(_0x47ce75['body']['type']===_0x94fe('0x17')&&!_[_0x94fe('0x3e')](_0x47ce75[_0x94fe('0x3f')]['exten'],'_')){_0x47ce75['body']['exten']='_'[_0x94fe('0x40')](_0x47ce75[_0x94fe('0x3f')][_0x94fe('0x41')]);}return db[_0x94fe('0x24')][_0x94fe('0x3d')](_0x47ce75[_0x94fe('0x3f')],{'raw':![]})['then'](function(_0x5c5230){var _0x48ac97=_0x47ce75[_0x94fe('0x42')][_0x94fe('0x14')]({'plain':!![]});if(!_0x48ac97)throw new Error(_0x94fe('0x43'));if(_0x48ac97[_0x94fe('0x44')]===_0x94fe('0x42')){var _0x3b9531=_0x5c5230['get']({'plain':!![]});var _0x361375=[{'name':_0x94fe('0x15'),'value':_0x94fe('0x16')},{'name':_0x94fe('0x45'),'value':_0x94fe('0x17')},{'name':_0x94fe('0x46'),'value':_0x94fe('0x18')}];var _0xee1878=_[_0x94fe('0x1e')](_0x361375,[_0x94fe('0x1b'),_0x3b9531[_0x94fe('0x1d')]])[_0x94fe('0x1f')];return db[_0x94fe('0x47')][_0x94fe('0x1e')]({'where':{'name':_0xee1878,'userProfileId':_0x48ac97['userProfileId']},'raw':!![]})['then'](function(_0x5ad604){if(_0x5ad604&&_0x5ad604[_0x94fe('0x48')]===0x0){return db[_0x94fe('0x20')][_0x94fe('0x3d')]({'name':_0x3b9531[_0x94fe('0x1f')],'resourceId':_0x3b9531['id'],'type':_0x5ad604[_0x94fe('0x1f')],'sectionId':_0x5ad604['id']},{})[_0x94fe('0x13')](function(){return _0x5c5230;});}else{return _0x5c5230;}})[_0x94fe('0x38')](function(_0x52351a){logger[_0x94fe('0x21')](_0x94fe('0x49'),_0x52351a);throw _0x52351a;});}return _0x5c5230;})[_0x94fe('0x13')](respondWithResult(_0x19460b,0xc9))['catch'](handleError(_0x19460b,null));};exports[_0x94fe('0x4a')]=function(_0x53834c,_0x5b8dcf){if(_0x53834c[_0x94fe('0x3f')]['id']){delete _0x53834c[_0x94fe('0x3f')]['id'];}return db[_0x94fe('0x24')][_0x94fe('0x1e')]({'where':{'id':_0x53834c[_0x94fe('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5b8dcf,null))[_0x94fe('0x13')](function(_0x535f34){if(_0x535f34){return db[_0x94fe('0x24')][_0x94fe('0x4a')](_[_0x94fe('0x4b')](_0x53834c[_0x94fe('0x3f')],[_0x94fe('0x41'),_0x94fe('0x4c'),'description',_0x94fe('0x4d'),_0x94fe('0x4e'),'mandatoryDisposition','alias']),{'where':{'context':_0x535f34[_0x94fe('0x4c')],'exten':_0x535f34[_0x94fe('0x41')]},'individualHooks':!![]})[_0x94fe('0x13')](function(_0x56c804){return _0x56c804;});}return null;})['then'](respondWithStatusCode(_0x5b8dcf,null))['catch'](handleError(_0x5b8dcf,null));};exports[_0x94fe('0x4f')]=function(_0x22a6bf,_0x167d11){var _0x3a133c=_0x22a6bf[_0x94fe('0x3a')]['id'];var _0x631754=_0x22a6bf['body'];var _0x5c2d6c=0xc8;var _0x3d9e6b=null;return db[_0x94fe('0x50')]['transaction']({'isolationLevel':db[_0x94fe('0x50')][_0x94fe('0x51')][_0x94fe('0x52')][_0x94fe('0x53')]},function(_0x4a932b){return db[_0x94fe('0x24')][_0x94fe('0x54')]({'where':{'id':_0x3a133c},'transaction':_0x4a932b})[_0x94fe('0x13')](function(_0x5a1b9d){if(_0x5a1b9d){return db[_0x94fe('0x24')][_0x94fe('0x12')]({'where':{'VoiceExtensionId':_0x3a133c},'transaction':_0x4a932b})[_0x94fe('0x13')](function(){var _0x24d9e2=_[_0x94fe('0x1a')](_0x631754,function(_0x41c40b){_0x41c40b[_0x94fe('0x55')]=_0x3a133c;_0x41c40b[_0x94fe('0x56')]=!![];return _0x41c40b;});return _0x5a1b9d['createRouting'](_0x24d9e2);})[_0x94fe('0x13')](function(_0x4d2cb2){return db[_0x94fe('0x24')]['bulkCreate'](_0x4d2cb2,{'transaction':_0x4a932b});});}else{_0x5c2d6c=0x194;_0x3d9e6b=[];}});})[_0x94fe('0x13')](function(){if(_0x5c2d6c!==0x194){return db[_0x94fe('0x24')][_0x94fe('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3a133c},'order':_0x94fe('0x58')})[_0x94fe('0x13')](function(_0x476960){_0x3d9e6b=_0x476960;});}})[_0x94fe('0x38')](function(_0x19c531){_0x5c2d6c=0x1f4;logger[_0x94fe('0x21')](_0x19c531[_0x94fe('0x22')]);if(_0x19c531[_0x94fe('0x1f')]){delete _0x19c531[_0x94fe('0x1f')];}_0x3d9e6b=_0x19c531;})[_0x94fe('0x59')](function(){if(_0x3d9e6b===null){_0x167d11['sendStatus'](_0x5c2d6c);}else{if(_0x5c2d6c===0x1f4){_0x167d11[_0x94fe('0x9')](_0x5c2d6c)['send'](_0x3d9e6b);}else{_0x167d11[_0x94fe('0x9')](_0x5c2d6c)['json'](_0x3d9e6b);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index a072bc0..bf056c6 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 _0xaae3=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x3f2f70,_0x4958e5){var _0x37b99=function(_0x1677e0){while(--_0x1677e0){_0x3f2f70['push'](_0x3f2f70['shift']());}};_0x37b99(++_0x4958e5);}(_0xaae3,0xaa));var _0x3aae=function(_0x4d04d6,_0x38ae19){_0x4d04d6=_0x4d04d6-0x0;var _0x2e937a=_0xaae3[_0x4d04d6];return _0x2e937a;};'use strict';var EventEmitter=require(_0x3aae('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x3aae('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3aae('0x2')](0x0);var events={'afterCreate':_0x3aae('0x3'),'afterUpdate':_0x3aae('0x4'),'afterDestroy':_0x3aae('0x5')};function emitEvent(_0x5d06ba){return function(_0x48de29,_0x361ab7,_0x56bc0d){VoiceExtensionEvents[_0x3aae('0x6')](_0x5d06ba+':'+_0x48de29['id'],_0x48de29);VoiceExtensionEvents[_0x3aae('0x6')](_0x5d06ba,_0x48de29);_0x56bc0d(null);};}for(var e in events){if(events[_0x3aae('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x3aae('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xb490=['hasOwnProperty','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','update','remove','emit'];(function(_0x219c13,_0x5a926b){var _0x232d35=function(_0x3d9908){while(--_0x3d9908){_0x219c13['push'](_0x219c13['shift']());}};_0x232d35(++_0x5a926b);}(_0xb490,0xad));var _0x0b49=function(_0x4d7ab9,_0x1bff82){_0x4d7ab9=_0x4d7ab9-0x0;var _0x301c82=_0xb490[_0x4d7ab9];return _0x301c82;};'use strict';var EventEmitter=require(_0x0b49('0x0'));var VoiceExtension=require(_0x0b49('0x1'))['db'][_0x0b49('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x0b49('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0b49('0x4'),'afterDestroy':_0x0b49('0x5')};function emitEvent(_0x438ad5){return function(_0x46d27d,_0x7fc997,_0xc9f982){VoiceExtensionEvents[_0x0b49('0x6')](_0x438ad5+':'+_0x46d27d['id'],_0x46d27d);VoiceExtensionEvents[_0x0b49('0x6')](_0x438ad5,_0x46d27d);_0xc9f982(null);};}for(var e in events){if(events[_0x0b49('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x0b49('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 93a0ce9..7b3ff3a 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 _0xe9c2=['priority','concat','last','catch','define','VoiceExtension','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','outbound','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','split','length','name','param','phone','prefix','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','then','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','queue','includes','app','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9c2,0x14e));var _0x2e9c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe9c2[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x2e9c('0x0'));var attributes=require(_0x2e9c('0x1'));module['exports']=function(_0x1b5446){var _0x40109d=_0x1b5446[_0x2e9c('0x2')];function _0x116ab3(_0x1acb35){var _0x3b121a=0x2;var _0x38300c=[{'type':_0x1acb35[_0x2e9c('0x3')],'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x5')+_0x1acb35[_0x2e9c('0x3')],'context':_0x1acb35[_0x2e9c('0x6')],'exten':_0x1acb35[_0x2e9c('0x7')],'priority':_0x3b121a++,'VoiceExtensionId':_0x1acb35['id']}];if(_0x1acb35[_0x2e9c('0x3')]===_0x2e9c('0x8')){_0x38300c['push']({'type':'inbound','app':'Set','appdata':'CDR(routeid)='+_0x1acb35['id'],'context':_0x1acb35[_0x2e9c('0x6')],'exten':_0x1acb35[_0x2e9c('0x7')],'priority':_0x3b121a++,'VoiceExtensionId':_0x1acb35['id']});}_0x38300c[_0x2e9c('0x9')]({'type':_0x1acb35[_0x2e9c('0x3')],'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0xa'),'context':_0x1acb35[_0x2e9c('0x6')],'exten':_0x1acb35[_0x2e9c('0x7')],'priority':_0x3b121a++,'VoiceExtensionId':_0x1acb35['id']},{'type':_0x1acb35['type'],'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0xb'),'context':_0x1acb35[_0x2e9c('0x6')],'exten':_0x1acb35[_0x2e9c('0x7')],'priority':_0x3b121a++,'VoiceExtensionId':_0x1acb35['id']},{'type':_0x1acb35[_0x2e9c('0x3')],'app':'Set','appdata':_0x2e9c('0xc'),'context':_0x1acb35[_0x2e9c('0x6')],'exten':_0x1acb35['exten'],'priority':_0x3b121a++,'VoiceExtensionId':_0x1acb35['id']});return _0x38300c;}function _0x14d386(_0x5ca6ab){var _0x515299=0x2;var _0x32d579=[{'type':'outbound','app':_0x2e9c('0x4'),'appdata':_0x2e9c('0xd'),'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':'outbound','app':_0x2e9c('0x4'),'appdata':_0x2e9c('0xe')+(_0x5ca6ab[_0x2e9c('0xf')]?_0x2e9c('0x10')+_0x5ca6ab[_0x2e9c('0xf')]+'}':_0x2e9c('0x11')),'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab['exten'],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':_0x2e9c('0x12'),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x13')+_0x5ca6ab['id'],'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab['exten'],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':_0x2e9c('0x12'),'app':_0x2e9c('0x14'),'appdata':_0x2e9c('0x15')+(_0x515299+0x2)+_0x2e9c('0x16')+(_0x515299+0x1)+')','context':_0x5ca6ab['context'],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':'outbound','app':_0x2e9c('0x4'),'appdata':_0x5ca6ab[_0x2e9c('0xf')]?_0x2e9c('0x17')+_0x5ca6ab[_0x2e9c('0xf')]+'}':_0x2e9c('0x18'),'context':_0x5ca6ab['context'],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':'outbound','app':_0x2e9c('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':_0x2e9c('0x12'),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0xb'),'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':_0x2e9c('0x12'),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0xc'),'context':_0x5ca6ab['context'],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':_0x2e9c('0x12'),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x19')+_0x5ca6ab['id'],'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']}];if(_0x5ca6ab['hasOwnProperty'](_0x2e9c('0x1a'))&&_0x5ca6ab['recordingFormat']!==_0x2e9c('0x1b')){_0x32d579[_0x2e9c('0x9')]({'type':_0x2e9c('0x12'),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x1c'),'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':'outbound','app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x1d')+_0x5ca6ab[_0x2e9c('0x1a')]||_0x2e9c('0x1e'),'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab['exten'],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']});}return _0x32d579;}function _0x46845d(_0x5f591e,_0x411170){var _0x2f8547=[{'name':_0x2e9c('0x1f'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x2e9c('0x20'),'param':0x2},{'name':_0x2e9c('0x21'),'param':0x3}];var _0x4e5ea7={};var _0x1b9d16=_0x411170[_0x2e9c('0x22')](',');var _0x150247=[];for(var _0x2d4e0e=0x0;_0x2d4e0e<_0x2f8547[_0x2e9c('0x23')];_0x2d4e0e++){switch(_0x2f8547[_0x2d4e0e][_0x2e9c('0x24')]){case _0x2e9c('0x1f'):_0x4e5ea7[_0x2e9c('0x1f')]=_0x1b9d16[_0x2f8547[_0x2d4e0e][_0x2e9c('0x25')]][_0x2e9c('0x22')]('/')[0x1];_0x4e5ea7[_0x2e9c('0x26')]=_0x1b9d16[_0x2f8547[_0x2d4e0e][_0x2e9c('0x25')]][_0x2e9c('0x22')]('/')[0x2];_0x4e5ea7[_0x2e9c('0x27')]=_0x4e5ea7['phone']?_0x4e5ea7[_0x2e9c('0x26')][_0x2e9c('0x22')]('$')[0x0]:undefined;_0x4e5ea7[_0x2e9c('0x26')]=_0x5f591e[_0x2e9c('0xf')]?(_0x4e5ea7[_0x2e9c('0x27')]||'')+_0x2e9c('0x10')+_0x5f591e['cutdigits']+'}':(_0x4e5ea7['prefix']||'')+_0x2e9c('0x11');_0x150247[_0x2f8547[_0x2d4e0e]['param']]=['SIP',_0x4e5ea7['trunk'],_0x4e5ea7[_0x2e9c('0x26')]][_0x2e9c('0x28')]('/');break;case _0x2e9c('0x20'):_0x4e5ea7[_0x2e9c('0x20')]=_0x1b9d16[_0x2f8547[_0x2d4e0e][_0x2e9c('0x25')]];if(_0x5f591e[_0x2e9c('0x1a')]!==_0x2e9c('0x1b')){if(_0x4e5ea7[_0x2e9c('0x20')][_0x2e9c('0x29')](_0x2e9c('0x2a'))<0x0){_0x4e5ea7[_0x2e9c('0x20')]+=_0x2e9c('0x2a');}}else{_0x4e5ea7[_0x2e9c('0x20')]=_0x4e5ea7['options'][_0x2e9c('0x2b')]('U(xcally-mixmonitor-context)','');}_0x150247[_0x2f8547[_0x2d4e0e][_0x2e9c('0x25')]]=_0x4e5ea7[_0x2e9c('0x20')];break;default:_0x150247[_0x2f8547[_0x2d4e0e][_0x2e9c('0x25')]]=_0x1b9d16[_0x2f8547[_0x2d4e0e]['param']];}}return _0x150247[_0x2e9c('0x28')](',');}function _0x33b715(_0x29b367,_0x58fbb3,_0x2424f3){return new Promise(function(_0x4940c6,_0x9d0415){var _0x632d89=[];if(_[_0x2e9c('0x2c')](_0x58fbb3))return _0x4940c6(_0x632d89);_0x40109d[_0x2e9c('0x2d')][_0x2e9c('0x2e')]({'attributes':['id',_0x2e9c('0x2f'),'IntervalId'],'raw':!![]})[_0x2e9c('0x30')](function(_0x4bdf1e){for(var _0x1670bb=0x0,_0x46931d=0x0;_0x1670bb<_0x58fbb3[_0x2e9c('0x23')];_0x1670bb++,_0x46931d=0x0){var _0xa71056=_0x58fbb3[_0x1670bb];var _0x277ae1=[];var _0x54db0d=[];delete _0xa71056['id'];if(_0xa71056[_0x2e9c('0x2f')]!==_0x2e9c('0x31')){_0xa71056[_0x2e9c('0x32')]=[_0xa71056[_0x2e9c('0x2f')]];}else{_0xa71056[_0x2e9c('0x32')]=_0xa71056[_0x2e9c('0x33')]?_[_0x2e9c('0x34')](_[_0x2e9c('0x35')](_0x4bdf1e,{'IntervalId':_0xa71056[_0x2e9c('0x33')]}),'interval'):[];}_0xa71056['context']=_0x29b367[_0x2e9c('0x6')];_0xa71056[_0x2e9c('0x7')]=_0x29b367[_0x2e9c('0x7')];if(_0xa71056[_0x2e9c('0x3')])_0xa71056[_0x2e9c('0x3')]=_0xa71056[_0x2e9c('0x3')][_0x2e9c('0x36')]();if(_0x29b367[_0x2e9c('0x3')]===_0x2e9c('0x12')){if(_0xa71056[_0x2e9c('0x37')](_0x2e9c('0x38'))&&_0xa71056[_0x2e9c('0x38')]&&_0xa71056[_0x2e9c('0x38')]!=='--'){_0x277ae1[_0x2e9c('0x9')]({'type':_0xa71056['type'][_0x2e9c('0x36')](),'app':'Set','appdata':_0x2e9c('0x39')+_0xa71056[_0x2e9c('0x38')],'context':_0x29b367[_0x2e9c('0x6')],'exten':_0x29b367[_0x2e9c('0x7')],'priority':_0xa71056[_0x2e9c('0x32')][_0x2e9c('0x23')]+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});}_0x277ae1[_0x2e9c('0x9')]({'type':_0xa71056[_0x2e9c('0x3')][_0x2e9c('0x36')](),'app':_0x2e9c('0x14'),'appdata':_0x2e9c('0x3a')+(_0xa71056[_0x2e9c('0x3b')]?_0x2e9c('0x3c')+_0xa71056[_0x2e9c('0x3b')]+')':'NoOp(No\x20number\x20available)'),'context':_0x29b367[_0x2e9c('0x6')],'exten':_0x29b367['exten'],'priority':_0xa71056[_0x2e9c('0x32')][_0x2e9c('0x23')]+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});}else{if(_0xa71056[_0x2e9c('0x37')]('answer')){if([_0x2e9c('0x3d'),'playback'][_0x2e9c('0x3e')](_0xa71056[_0x2e9c('0x3f')][_0x2e9c('0x36')]())&&_0xa71056[_0x2e9c('0x40')]!=='custom'){if(_0xa71056[_0x2e9c('0x41')]){_0x277ae1[_0x2e9c('0x9')]({'type':_0xa71056['type']['toLowerCase'](),'app':_0x2e9c('0x14'),'appdata':_0x2e9c('0x42'),'context':_0x29b367[_0x2e9c('0x6')],'exten':_0x29b367[_0x2e9c('0x7')],'priority':_0xa71056['intervals'][_0x2e9c('0x23')]+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});_0x277ae1['push']({'type':_0xa71056['type'][_0x2e9c('0x36')](),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x43'),'context':_0x29b367['context'],'exten':_0x29b367[_0x2e9c('0x7')],'priority':_0xa71056[_0x2e9c('0x32')][_0x2e9c('0x23')]+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});}else{_0x277ae1[_0x2e9c('0x9')]({'type':_0xa71056[_0x2e9c('0x3')][_0x2e9c('0x36')](),'app':_0x2e9c('0x14'),'appdata':_0x2e9c('0x44'),'context':_0x29b367[_0x2e9c('0x6')],'exten':_0x29b367[_0x2e9c('0x7')],'priority':_0xa71056[_0x2e9c('0x32')]['length']+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});_0x277ae1[_0x2e9c('0x9')]({'type':_0xa71056[_0x2e9c('0x3')][_0x2e9c('0x36')](),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x45'),'context':_0x29b367[_0x2e9c('0x6')],'exten':_0x29b367[_0x2e9c('0x7')],'priority':_0xa71056['intervals'][_0x2e9c('0x23')]+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});}}}}for(var _0x16d84d=0x0;_0x16d84d<_0xa71056[_0x2e9c('0x32')][_0x2e9c('0x23')];_0x16d84d++){var _0x392e4f=_0x2424f3+_0xa71056['intervals'][_0x2e9c('0x23')];var _0x477a49=_0x16d84d===_0xa71056['intervals'][_0x2e9c('0x23')]-0x1?_0x2424f3+_0x277ae1[_0x2e9c('0x23')]+_0x54db0d[_0x2e9c('0x23')]+0x2:_0x2424f3+_0x16d84d+0x1;_0x277ae1[_0x2e9c('0x46')](_0x16d84d,0x0,{'type':_0x29b367['type'],'app':'GotoIfTime','appdata':_0xa71056[_0x2e9c('0x32')][_0x16d84d]+'?'+_0x29b367[_0x2e9c('0x6')]+_0x2e9c('0x47')+_0x392e4f+':'+_0x29b367[_0x2e9c('0x6')]+',${EXTEN},'+_0x477a49,'exten':_0x29b367[_0x2e9c('0x7')],'context':_0x29b367[_0x2e9c('0x6')],'priority':_0x2424f3+_0x16d84d,'VoiceExtensionId':_0x29b367['id']});}if(_0xa71056['appType']===_0x2e9c('0x48')){_0xa71056[_0x2e9c('0x49')]=_0x46845d(_0x29b367,_0xa71056[_0x2e9c('0x49')]);}if(_0xa71056[_0x2e9c('0x40')]===_0x2e9c('0x4a')){_0x277ae1[_0x2e9c('0x9')]({'type':_0xa71056[_0x2e9c('0x3')]['toLowerCase'](),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x4b'),'context':_0x29b367['context'],'exten':_0x29b367[_0x2e9c('0x7')],'priority':_0xa71056[_0x2e9c('0x32')][_0x2e9c('0x23')]+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});}_0xa71056['priority']=_0x277ae1[_0x2e9c('0x23')]?_['last'](_0x277ae1)[_0x2e9c('0x4c')]+0x1:_0x2424f3;_0x632d89=_[_0x2e9c('0x4d')](_0x632d89,_0x277ae1,[_0xa71056],_0x54db0d);_0x2424f3=_[_0x2e9c('0x4e')](_0x632d89)[_0x2e9c('0x4c')]+0x1;}return _0x4940c6(_0x632d89);})[_0x2e9c('0x4f')](function(_0x4c62d3){_0x9d0415(_0x4c62d3);});});}return _0x1b5446[_0x2e9c('0x50')](_0x2e9c('0x51'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5ad069){var _0x164ab9=this['get']({'plain':!![]});var _0xd3569f=_0x164ab9[_0x2e9c('0x3')]===_0x2e9c('0x12')?_0x14d386(_0x164ab9):_0x116ab3(_0x164ab9);return _0x33b715(_0x164ab9,_0x5ad069,_[_0x2e9c('0x4e')](_0xd3569f)[_0x2e9c('0x4c')]+0x1)[_0x2e9c('0x30')](function(_0x4d1c9b){var _0x20f5b7=_[_0x2e9c('0x4d')](_0xd3569f,_0x4d1c9b);_0x20f5b7[_0x2e9c('0x9')]({'type':_0x164ab9[_0x2e9c('0x3')],'app':'Hangup','exten':_0x164ab9[_0x2e9c('0x7')],'context':_0x164ab9['context'],'priority':_[_0x2e9c('0x4e')](_0x20f5b7)['priority']+0x1,'VoiceExtensionId':_0x164ab9['id']});return _0x20f5b7;});}}});}; \ No newline at end of file +var _0xb65b=['MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','cutdigits','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','hasOwnProperty','recordingFormat','none','push','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','split','length','param','phone','prefix','SIP','join','options','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','IntervalId','then','interval','intervals','filter','tag','toLowerCase','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','concat','catch','VoiceExtension','voice_extensions','get','last','Hangup','./voiceExtension.attributes','exports','models','Set','CDR(type)=','type','context','exten','inbound','XCALLY-MOTION-ANSWER=0'];(function(_0x185063,_0x3f0bb7){var _0x16d9d3=function(_0x1b3fe3){while(--_0x1b3fe3){_0x185063['push'](_0x185063['shift']());}};_0x16d9d3(++_0x3f0bb7);}(_0xb65b,0x1b8));var _0xbb65=function(_0x5d0946,_0x396ea7){_0x5d0946=_0x5d0946-0x0;var _0x1c4817=_0xb65b[_0x5d0946];return _0x1c4817;};'use strict';var _=require('lodash');var attributes=require(_0xbb65('0x0'));module[_0xbb65('0x1')]=function(_0xf2e229){var _0x115177=_0xf2e229[_0xbb65('0x2')];function _0x1ca203(_0x220a00){var _0x4d5342=0x2;var _0x4c9661=[{'type':_0x220a00['type'],'app':_0xbb65('0x3'),'appdata':_0xbb65('0x4')+_0x220a00[_0xbb65('0x5')],'context':_0x220a00[_0xbb65('0x6')],'exten':_0x220a00[_0xbb65('0x7')],'priority':_0x4d5342++,'VoiceExtensionId':_0x220a00['id']}];if(_0x220a00[_0xbb65('0x5')]===_0xbb65('0x8')){_0x4c9661['push']({'type':_0xbb65('0x8'),'app':_0xbb65('0x3'),'appdata':'CDR(routeid)='+_0x220a00['id'],'context':_0x220a00[_0xbb65('0x6')],'exten':_0x220a00[_0xbb65('0x7')],'priority':_0x4d5342++,'VoiceExtensionId':_0x220a00['id']});}_0x4c9661['push']({'type':_0x220a00[_0xbb65('0x5')],'app':_0xbb65('0x3'),'appdata':_0xbb65('0x9'),'context':_0x220a00[_0xbb65('0x6')],'exten':_0x220a00[_0xbb65('0x7')],'priority':_0x4d5342++,'VoiceExtensionId':_0x220a00['id']},{'type':_0x220a00['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x220a00[_0xbb65('0x6')],'exten':_0x220a00[_0xbb65('0x7')],'priority':_0x4d5342++,'VoiceExtensionId':_0x220a00['id']},{'type':_0x220a00[_0xbb65('0x5')],'app':_0xbb65('0x3'),'appdata':_0xbb65('0xa'),'context':_0x220a00['context'],'exten':_0x220a00[_0xbb65('0x7')],'priority':_0x4d5342++,'VoiceExtensionId':_0x220a00['id']});return _0x4c9661;}function _0x381571(_0x3b2264){var _0x2f5201=0x2;var _0x44c468=[{'type':'outbound','app':_0xbb65('0x3'),'appdata':_0xbb65('0xb'),'context':_0x3b2264[_0xbb65('0x6')],'exten':_0x3b2264[_0xbb65('0x7')],'priority':_0x2f5201++,'VoiceExtensionId':_0x3b2264['id']},{'type':_0xbb65('0xc'),'app':'Set','appdata':'CDR(destination)='+(_0x3b2264[_0xbb65('0xd')]?'${EXTEN:'+_0x3b2264[_0xbb65('0xd')]+'}':'${EXTEN}'),'context':_0x3b2264[_0xbb65('0x6')],'exten':_0x3b2264[_0xbb65('0x7')],'priority':_0x2f5201++,'VoiceExtensionId':_0x3b2264['id']},{'type':_0xbb65('0xc'),'app':_0xbb65('0x3'),'appdata':_0xbb65('0xe')+_0x3b2264['id'],'context':_0x3b2264[_0xbb65('0x6')],'exten':_0x3b2264['exten'],'priority':_0x2f5201++,'VoiceExtensionId':_0x3b2264['id']},{'type':'outbound','app':_0xbb65('0xf'),'appdata':_0xbb65('0x10')+(_0x2f5201+0x2)+'):Goto('+(_0x2f5201+0x1)+')','context':_0x3b2264[_0xbb65('0x6')],'exten':_0x3b2264['exten'],'priority':_0x2f5201++,'VoiceExtensionId':_0x3b2264['id']},{'type':'outbound','app':_0xbb65('0x3'),'appdata':_0x3b2264[_0xbb65('0xd')]?_0xbb65('0x11')+_0x3b2264[_0xbb65('0xd')]+'}':_0xbb65('0x12'),'context':_0x3b2264['context'],'exten':_0x3b2264['exten'],'priority':_0x2f5201++,'VoiceExtensionId':_0x3b2264['id']},{'type':_0xbb65('0xc'),'app':_0xbb65('0x3'),'appdata':_0xbb65('0x9'),'context':_0x3b2264[_0xbb65('0x6')],'exten':_0x3b2264[_0xbb65('0x7')],'priority':_0x2f5201++,'VoiceExtensionId':_0x3b2264['id']},{'type':_0xbb65('0xc'),'app':'Set','appdata':_0xbb65('0x13'),'context':_0x3b2264[_0xbb65('0x6')],'exten':_0x3b2264['exten'],'priority':_0x2f5201++,'VoiceExtensionId':_0x3b2264['id']},{'type':_0xbb65('0xc'),'app':_0xbb65('0x3'),'appdata':_0xbb65('0xa'),'context':_0x3b2264[_0xbb65('0x6')],'exten':_0x3b2264[_0xbb65('0x7')],'priority':_0x2f5201++,'VoiceExtensionId':_0x3b2264['id']},{'type':_0xbb65('0xc'),'app':_0xbb65('0x3'),'appdata':'outboundrouteid='+_0x3b2264['id'],'context':_0x3b2264['context'],'exten':_0x3b2264[_0xbb65('0x7')],'priority':_0x2f5201++,'VoiceExtensionId':_0x3b2264['id']}];if(_0x3b2264[_0xbb65('0x14')](_0xbb65('0x15'))&&_0x3b2264['recordingFormat']!==_0xbb65('0x16')){_0x44c468[_0xbb65('0x17')]({'type':_0xbb65('0xc'),'app':_0xbb65('0x3'),'appdata':_0xbb65('0x18'),'context':_0x3b2264['context'],'exten':_0x3b2264['exten'],'priority':_0x2f5201++,'VoiceExtensionId':_0x3b2264['id']},{'type':_0xbb65('0xc'),'app':_0xbb65('0x3'),'appdata':_0xbb65('0x19')+_0x3b2264[_0xbb65('0x15')]||'wav','context':_0x3b2264[_0xbb65('0x6')],'exten':_0x3b2264[_0xbb65('0x7')],'priority':_0x2f5201++,'VoiceExtensionId':_0x3b2264['id']});}return _0x44c468;}function _0x1e0f72(_0x169ea2,_0x49d753){var _0xbecabe=[{'name':_0xbb65('0x1a'),'param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x4bb0d1={};var _0x221116=_0x49d753[_0xbb65('0x1b')](',');var _0x6b020d=[];for(var _0x20168d=0x0;_0x20168d<_0xbecabe[_0xbb65('0x1c')];_0x20168d++){switch(_0xbecabe[_0x20168d]['name']){case _0xbb65('0x1a'):_0x4bb0d1[_0xbb65('0x1a')]=_0x221116[_0xbecabe[_0x20168d][_0xbb65('0x1d')]][_0xbb65('0x1b')]('/')[0x1];_0x4bb0d1[_0xbb65('0x1e')]=_0x221116[_0xbecabe[_0x20168d][_0xbb65('0x1d')]][_0xbb65('0x1b')]('/')[0x2];_0x4bb0d1['prefix']=_0x4bb0d1[_0xbb65('0x1e')]?_0x4bb0d1['phone']['split']('$')[0x0]:undefined;_0x4bb0d1['phone']=_0x169ea2['cutdigits']?(_0x4bb0d1[_0xbb65('0x1f')]||'')+'${EXTEN:'+_0x169ea2[_0xbb65('0xd')]+'}':(_0x4bb0d1[_0xbb65('0x1f')]||'')+'${EXTEN}';_0x6b020d[_0xbecabe[_0x20168d][_0xbb65('0x1d')]]=[_0xbb65('0x20'),_0x4bb0d1[_0xbb65('0x1a')],_0x4bb0d1[_0xbb65('0x1e')]][_0xbb65('0x21')]('/');break;case _0xbb65('0x22'):_0x4bb0d1['options']=_0x221116[_0xbecabe[_0x20168d][_0xbb65('0x1d')]];if(_0x169ea2[_0xbb65('0x15')]!=='none'){if(_0x4bb0d1[_0xbb65('0x22')]['indexOf'](_0xbb65('0x23'))<0x0){_0x4bb0d1[_0xbb65('0x22')]+=_0xbb65('0x23');}}else{_0x4bb0d1['options']=_0x4bb0d1[_0xbb65('0x22')][_0xbb65('0x24')](_0xbb65('0x23'),'');}_0x6b020d[_0xbecabe[_0x20168d][_0xbb65('0x1d')]]=_0x4bb0d1[_0xbb65('0x22')];break;default:_0x6b020d[_0xbecabe[_0x20168d]['param']]=_0x221116[_0xbecabe[_0x20168d][_0xbb65('0x1d')]];}}return _0x6b020d[_0xbb65('0x21')](',');}function _0x154245(_0x339429,_0x466869,_0x20ee7d){return new Promise(function(_0x10ac4a,_0x404df3){var _0x43b836=[];if(_[_0xbb65('0x25')](_0x466869))return _0x10ac4a(_0x43b836);_0x115177['Interval'][_0xbb65('0x26')]({'attributes':['id','interval',_0xbb65('0x27')],'raw':!![]})[_0xbb65('0x28')](function(_0x38b60d){for(var _0x935c42=0x0,_0x3584b5=0x0;_0x935c42<_0x466869['length'];_0x935c42++,_0x3584b5=0x0){var _0x21a744=_0x466869[_0x935c42];var _0x4991df=[];var _0x74d2fa=[];delete _0x21a744['id'];if(_0x21a744[_0xbb65('0x29')]!=='*,*,*,*'){_0x21a744[_0xbb65('0x2a')]=[_0x21a744['interval']];}else{_0x21a744[_0xbb65('0x2a')]=_0x21a744[_0xbb65('0x27')]?_['map'](_[_0xbb65('0x2b')](_0x38b60d,{'IntervalId':_0x21a744[_0xbb65('0x27')]}),_0xbb65('0x29')):[];}_0x21a744['context']=_0x339429[_0xbb65('0x6')];_0x21a744['exten']=_0x339429[_0xbb65('0x7')];if(_0x21a744[_0xbb65('0x5')])_0x21a744['type']=_0x21a744[_0xbb65('0x5')]['toLowerCase']();if(_0x339429[_0xbb65('0x5')]===_0xbb65('0xc')){if(_0x21a744[_0xbb65('0x14')]('tag')&&_0x21a744[_0xbb65('0x2c')]&&_0x21a744[_0xbb65('0x2c')]!=='--'){_0x4991df[_0xbb65('0x17')]({'type':_0x21a744[_0xbb65('0x5')][_0xbb65('0x2d')](),'app':_0xbb65('0x3'),'appdata':_0xbb65('0x2e')+_0x21a744['tag'],'context':_0x339429[_0xbb65('0x6')],'exten':_0x339429[_0xbb65('0x7')],'priority':_0x21a744['intervals'][_0xbb65('0x1c')]+_0x20ee7d+_0x3584b5++,'VoiceExtensionId':_0x339429['id']});}_0x4991df[_0xbb65('0x17')]({'type':_0x21a744[_0xbb65('0x5')][_0xbb65('0x2d')](),'app':_0xbb65('0xf'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x21a744[_0xbb65('0x2f')]?_0xbb65('0x30')+_0x21a744[_0xbb65('0x2f')]+')':_0xbb65('0x31')),'context':_0x339429[_0xbb65('0x6')],'exten':_0x339429[_0xbb65('0x7')],'priority':_0x21a744[_0xbb65('0x2a')][_0xbb65('0x1c')]+_0x20ee7d+_0x3584b5++,'VoiceExtensionId':_0x339429['id']});}else{if(_0x21a744[_0xbb65('0x14')]('answer')){if([_0xbb65('0x32'),'playback'][_0xbb65('0x33')](_0x21a744[_0xbb65('0x34')]['toLowerCase']())&&_0x21a744[_0xbb65('0x35')]!==_0xbb65('0x36')){if(_0x21a744[_0xbb65('0x37')]){_0x4991df['push']({'type':_0x21a744['type'][_0xbb65('0x2d')](),'app':_0xbb65('0xf'),'appdata':_0xbb65('0x38'),'context':_0x339429['context'],'exten':_0x339429[_0xbb65('0x7')],'priority':_0x21a744[_0xbb65('0x2a')][_0xbb65('0x1c')]+_0x20ee7d+_0x3584b5++,'VoiceExtensionId':_0x339429['id']});_0x4991df[_0xbb65('0x17')]({'type':_0x21a744[_0xbb65('0x5')][_0xbb65('0x2d')](),'app':_0xbb65('0x3'),'appdata':_0xbb65('0x39'),'context':_0x339429['context'],'exten':_0x339429[_0xbb65('0x7')],'priority':_0x21a744[_0xbb65('0x2a')]['length']+_0x20ee7d+_0x3584b5++,'VoiceExtensionId':_0x339429['id']});}else{_0x4991df['push']({'type':_0x21a744[_0xbb65('0x5')][_0xbb65('0x2d')](),'app':_0xbb65('0xf'),'appdata':_0xbb65('0x3a'),'context':_0x339429['context'],'exten':_0x339429[_0xbb65('0x7')],'priority':_0x21a744['intervals'][_0xbb65('0x1c')]+_0x20ee7d+_0x3584b5++,'VoiceExtensionId':_0x339429['id']});_0x4991df[_0xbb65('0x17')]({'type':_0x21a744['type'][_0xbb65('0x2d')](),'app':_0xbb65('0x3'),'appdata':_0xbb65('0x3b'),'context':_0x339429[_0xbb65('0x6')],'exten':_0x339429[_0xbb65('0x7')],'priority':_0x21a744[_0xbb65('0x2a')][_0xbb65('0x1c')]+_0x20ee7d+_0x3584b5++,'VoiceExtensionId':_0x339429['id']});}}}}for(var _0x266f7f=0x0;_0x266f7f<_0x21a744[_0xbb65('0x2a')][_0xbb65('0x1c')];_0x266f7f++){var _0x2b6f65=_0x20ee7d+_0x21a744[_0xbb65('0x2a')]['length'];var _0x2933e9=_0x266f7f===_0x21a744[_0xbb65('0x2a')]['length']-0x1?_0x20ee7d+_0x4991df[_0xbb65('0x1c')]+_0x74d2fa['length']+0x2:_0x20ee7d+_0x266f7f+0x1;_0x4991df[_0xbb65('0x3c')](_0x266f7f,0x0,{'type':_0x339429[_0xbb65('0x5')],'app':_0xbb65('0x3d'),'appdata':_0x21a744[_0xbb65('0x2a')][_0x266f7f]+'?'+_0x339429[_0xbb65('0x6')]+_0xbb65('0x3e')+_0x2b6f65+':'+_0x339429['context']+_0xbb65('0x3e')+_0x2933e9,'exten':_0x339429['exten'],'context':_0x339429[_0xbb65('0x6')],'priority':_0x20ee7d+_0x266f7f,'VoiceExtensionId':_0x339429['id']});}if(_0x21a744['appType']===_0xbb65('0x3f')){_0x21a744[_0xbb65('0x40')]=_0x1e0f72(_0x339429,_0x21a744[_0xbb65('0x40')]);}if(_0x21a744[_0xbb65('0x35')]===_0xbb65('0x41')){_0x4991df[_0xbb65('0x17')]({'type':_0x21a744[_0xbb65('0x5')][_0xbb65('0x2d')](),'app':_0xbb65('0x3'),'appdata':_0xbb65('0x42'),'context':_0x339429['context'],'exten':_0x339429[_0xbb65('0x7')],'priority':_0x21a744[_0xbb65('0x2a')][_0xbb65('0x1c')]+_0x20ee7d+_0x3584b5++,'VoiceExtensionId':_0x339429['id']});}_0x21a744[_0xbb65('0x43')]=_0x4991df[_0xbb65('0x1c')]?_['last'](_0x4991df)[_0xbb65('0x43')]+0x1:_0x20ee7d;_0x43b836=_[_0xbb65('0x44')](_0x43b836,_0x4991df,[_0x21a744],_0x74d2fa);_0x20ee7d=_['last'](_0x43b836)['priority']+0x1;}return _0x10ac4a(_0x43b836);})[_0xbb65('0x45')](function(_0xd333d0){_0x404df3(_0xd333d0);});});}return _0xf2e229['define'](_0xbb65('0x46'),attributes,{'tableName':_0xbb65('0x47'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x538631){var _0x3d8a02=this[_0xbb65('0x48')]({'plain':!![]});var _0x31289b=_0x3d8a02[_0xbb65('0x5')]===_0xbb65('0xc')?_0x381571(_0x3d8a02):_0x1ca203(_0x3d8a02);return _0x154245(_0x3d8a02,_0x538631,_[_0xbb65('0x49')](_0x31289b)['priority']+0x1)[_0xbb65('0x28')](function(_0x49ebb0){var _0x8d0bbd=_[_0xbb65('0x44')](_0x31289b,_0x49ebb0);_0x8d0bbd[_0xbb65('0x17')]({'type':_0x3d8a02['type'],'app':_0xbb65('0x4a'),'exten':_0x3d8a02[_0xbb65('0x7')],'context':_0x3d8a02['context'],'priority':_[_0xbb65('0x49')](_0x8d0bbd)[_0xbb65('0x43')]+0x1,'VoiceExtensionId':_0x3d8a02['id']});return _0x8d0bbd;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 218f1d5..073cbf9 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 _0xa751=['model','map','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','include'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xa751,0x175));var _0x1a75=function(_0x5c1a85,_0x2685dd){_0x5c1a85=_0x5c1a85-0x0;var _0x761e71=_0xa751[_0x5c1a85];return _0x761e71;};'use strict';var _=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var moment=require(_0x1a75('0x2'));var BPromise=require(_0x1a75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a75('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a75('0x5'));var logger=require(_0x1a75('0x6'))(_0x1a75('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a75('0x8'));var client=jayson[_0x1a75('0x9')][_0x1a75('0xa')]({'port':0x232a});config[_0x1a75('0xb')]=_[_0x1a75('0xc')](config[_0x1a75('0xb')],{'host':_0x1a75('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceExtension.socket')[_0x1a75('0xe')](socket);function respondWithRpcPromise(_0x377b3b,_0x1d7819,_0x271286){return new BPromise(function(_0x15b4cc,_0xd150fc){return client[_0x1a75('0xf')](_0x377b3b,_0x271286)[_0x1a75('0x10')](function(_0x5b615f){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x1d7819,_0x1a75('0x11'));logger[_0x1a75('0x12')](_0x1a75('0x13'),_0x1d7819,_0x1a75('0x11'),JSON['stringify'](_0x5b615f));if(_0x5b615f['error']){if(_0x5b615f[_0x1a75('0x14')][_0x1a75('0x15')]===0x1f4){logger['error'](_0x1a75('0x16'),_0x1d7819,_0x5b615f[_0x1a75('0x14')]['message']);return _0xd150fc(_0x5b615f[_0x1a75('0x14')][_0x1a75('0x17')]);}logger[_0x1a75('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x1d7819,_0x5b615f['error']['message']);return _0x15b4cc(_0x5b615f[_0x1a75('0x14')][_0x1a75('0x17')]);}else{logger[_0x1a75('0x18')](_0x1a75('0x16'),_0x1d7819,_0x1a75('0x11'));_0x15b4cc(_0x5b615f[_0x1a75('0x19')]['message']);}})[_0x1a75('0x1a')](function(_0x490e1f){logger['error'](_0x1a75('0x16'),_0x1d7819,_0x490e1f);_0xd150fc(_0x490e1f);});});}exports[_0x1a75('0x1b')]=function(_0x5ae0f4){var _0x42d283=this;return new Promise(function(_0x4d877c,_0x4699c9){return db[_0x1a75('0x1c')][_0x1a75('0x1d')]({'raw':_0x5ae0f4[_0x1a75('0x1e')]?_0x5ae0f4[_0x1a75('0x1e')][_0x1a75('0x1f')]===undefined?!![]:![]:!![],'where':_0x5ae0f4['options']?_0x5ae0f4[_0x1a75('0x1e')]['where']||null:null,'attributes':_0x5ae0f4[_0x1a75('0x1e')]?_0x5ae0f4[_0x1a75('0x1e')][_0x1a75('0x20')]||null:null,'limit':_0x5ae0f4['options']?_0x5ae0f4[_0x1a75('0x1e')]['limit']||null:null,'include':_0x5ae0f4[_0x1a75('0x1e')]?_0x5ae0f4[_0x1a75('0x1e')][_0x1a75('0x21')]?_['map'](_0x5ae0f4[_0x1a75('0x1e')][_0x1a75('0x21')],function(_0x4dec82){return{'model':db[_0x4dec82[_0x1a75('0x22')]],'as':_0x4dec82['as'],'attributes':_0x4dec82[_0x1a75('0x20')],'include':_0x4dec82['include']?_[_0x1a75('0x23')](_0x4dec82[_0x1a75('0x21')],function(_0x34c106){return{'model':db[_0x34c106[_0x1a75('0x22')]],'as':_0x34c106['as'],'attributes':_0x34c106['attributes'],'include':_0x34c106[_0x1a75('0x21')]?_[_0x1a75('0x23')](_0x34c106[_0x1a75('0x21')],function(_0x2f5ac9){return{'model':db[_0x2f5ac9[_0x1a75('0x22')]],'as':_0x2f5ac9['as'],'attributes':_0x2f5ac9[_0x1a75('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1a75('0x10')](function(_0x38e885){logger['info']('GetVoiceExtension',_0x5ae0f4);logger[_0x1a75('0x12')](_0x1a75('0x1b'),_0x5ae0f4,JSON[_0x1a75('0x24')](_0x38e885));_0x4d877c(_0x38e885);})[_0x1a75('0x1a')](function(_0x6f02dc){logger[_0x1a75('0x14')](_0x1a75('0x1b'),_0x6f02dc[_0x1a75('0x17')],_0x5ae0f4);_0x4699c9(_0x42d283['error'](0x1f4,_0x6f02dc['message']));});});}; \ No newline at end of file +var _0xdb8b=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','stringify','util','moment','bluebird'];(function(_0x1ca461,_0x14e1c8){var _0x23686d=function(_0x290fed){while(--_0x290fed){_0x1ca461['push'](_0x1ca461['shift']());}};_0x23686d(++_0x14e1c8);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x4ff679,_0x2272b4){_0x4ff679=_0x4ff679-0x0;var _0x4ab10f=_0xdb8b[_0x4ff679];return _0x4ab10f;};'use strict';var _=require('lodash');var util=require(_0xbdb8('0x0'));var moment=require(_0xbdb8('0x1'));var BPromise=require(_0xbdb8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbdb8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdb8('0x4'))(_0xbdb8('0x5'));var config=require(_0xbdb8('0x6'));var jayson=require(_0xbdb8('0x7'));var client=jayson['client'][_0xbdb8('0x8')]({'port':0x232a});config['redis']=_[_0xbdb8('0x9')](config[_0xbdb8('0xa')],{'host':_0xbdb8('0xb'),'port':0x18eb});var socket=require(_0xbdb8('0xc'))(new Redis(config[_0xbdb8('0xa')]));require(_0xbdb8('0xd'))['register'](socket);function respondWithRpcPromise(_0x3339c2,_0x176a31,_0x3cc8d1){return new BPromise(function(_0x682657,_0x2fba54){return client[_0xbdb8('0xe')](_0x3339c2,_0x3cc8d1)[_0xbdb8('0xf')](function(_0x55f17e){logger['info'](_0xbdb8('0x10'),_0x176a31,'request\x20sent');logger[_0xbdb8('0x11')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x176a31,_0xbdb8('0x12'),JSON['stringify'](_0x55f17e));if(_0x55f17e[_0xbdb8('0x13')]){if(_0x55f17e[_0xbdb8('0x13')][_0xbdb8('0x14')]===0x1f4){logger[_0xbdb8('0x13')](_0xbdb8('0x10'),_0x176a31,_0x55f17e[_0xbdb8('0x13')][_0xbdb8('0x15')]);return _0x2fba54(_0x55f17e[_0xbdb8('0x13')][_0xbdb8('0x15')]);}logger[_0xbdb8('0x13')](_0xbdb8('0x10'),_0x176a31,_0x55f17e[_0xbdb8('0x13')][_0xbdb8('0x15')]);return _0x682657(_0x55f17e['error'][_0xbdb8('0x15')]);}else{logger[_0xbdb8('0x16')](_0xbdb8('0x10'),_0x176a31,'request\x20sent');_0x682657(_0x55f17e['result'][_0xbdb8('0x15')]);}})['catch'](function(_0x37177b){logger[_0xbdb8('0x13')](_0xbdb8('0x10'),_0x176a31,_0x37177b);_0x2fba54(_0x37177b);});});}exports[_0xbdb8('0x17')]=function(_0x3a177d){var _0xb70cc8=this;return new Promise(function(_0x21c9bf,_0x437095){return db[_0xbdb8('0x18')][_0xbdb8('0x19')]({'raw':_0x3a177d[_0xbdb8('0x1a')]?_0x3a177d[_0xbdb8('0x1a')][_0xbdb8('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a177d[_0xbdb8('0x1a')]?_0x3a177d[_0xbdb8('0x1a')][_0xbdb8('0x1c')]||null:null,'attributes':_0x3a177d[_0xbdb8('0x1a')]?_0x3a177d[_0xbdb8('0x1a')][_0xbdb8('0x1d')]||null:null,'limit':_0x3a177d[_0xbdb8('0x1a')]?_0x3a177d[_0xbdb8('0x1a')][_0xbdb8('0x1e')]||null:null,'include':_0x3a177d[_0xbdb8('0x1a')]?_0x3a177d['options'][_0xbdb8('0x1f')]?_[_0xbdb8('0x20')](_0x3a177d['options'][_0xbdb8('0x1f')],function(_0x38709a){return{'model':db[_0x38709a['model']],'as':_0x38709a['as'],'attributes':_0x38709a[_0xbdb8('0x1d')],'include':_0x38709a[_0xbdb8('0x1f')]?_[_0xbdb8('0x20')](_0x38709a[_0xbdb8('0x1f')],function(_0x3dedcb){return{'model':db[_0x3dedcb[_0xbdb8('0x21')]],'as':_0x3dedcb['as'],'attributes':_0x3dedcb[_0xbdb8('0x1d')],'include':_0x3dedcb['include']?_[_0xbdb8('0x20')](_0x3dedcb['include'],function(_0x4d2103){return{'model':db[_0x4d2103[_0xbdb8('0x21')]],'as':_0x4d2103['as'],'attributes':_0x4d2103[_0xbdb8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbdb8('0xf')](function(_0x321139){logger['info'](_0xbdb8('0x17'),_0x3a177d);logger[_0xbdb8('0x11')](_0xbdb8('0x17'),_0x3a177d,JSON[_0xbdb8('0x22')](_0x321139));_0x21c9bf(_0x321139);})['catch'](function(_0x422f80){logger[_0xbdb8('0x13')](_0xbdb8('0x17'),_0x422f80[_0xbdb8('0x15')],_0x3a177d);_0x437095(_0xb70cc8[_0xbdb8('0x13')](0x1f4,_0x422f80[_0xbdb8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index a9ee0db..015ab7c 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2af0f7,_0x3d31f7){_0x2af0f7=_0x2af0f7-0x0;var _0x4c48ca=_0x1cb9[_0x2af0f7];return _0x4c48ca;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x4bd117,_0x5a6174){var _0x4b1af1=function(_0x20e164){while(--_0x20e164){_0x4bd117['push'](_0x4bd117['shift']());}};_0x4b1af1(++_0x5a6174);}(_0xf494,0x1c6));var _0x4f49=function(_0x322394,_0x18c0d9){_0x322394=_0x322394-0x0;var _0x16f8ab=_0xf494[_0x322394];return _0x16f8ab;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 796f892..b655e9d 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 _0x7bd0=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2b5526,_0x2fd2e0){var _0xb05466=function(_0x5e7afe){while(--_0x5e7afe){_0x2b5526['push'](_0x2b5526['shift']());}};_0xb05466(++_0x2fd2e0);}(_0x7bd0,0x111));var _0x07bd=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x7bd0[_0x29d915];return _0x160f86;};'use strict';var multer=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var path=require(_0x07bd('0x2'));var timeout=require(_0x07bd('0x3'));var express=require(_0x07bd('0x4'));var router=express[_0x07bd('0x5')]();var fs_extra=require(_0x07bd('0x6'));var auth=require(_0x07bd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x07bd('0x8'));var controller=require(_0x07bd('0x9'));router[_0x07bd('0xa')]('/',auth[_0x07bd('0xb')](),controller[_0x07bd('0xc')]);router[_0x07bd('0xa')](_0x07bd('0xd'),auth['isAuthenticated'](),controller[_0x07bd('0xe')]);router['get'](_0x07bd('0xf'),auth[_0x07bd('0xb')](),controller[_0x07bd('0x10')]);router['post']('/',auth[_0x07bd('0xb')](),controller[_0x07bd('0x11')]);router[_0x07bd('0x12')](_0x07bd('0xd'),auth['isAuthenticated'](),controller[_0x07bd('0x13')]);router[_0x07bd('0x14')](_0x07bd('0xd'),auth[_0x07bd('0xb')](),controller[_0x07bd('0x15')]);module[_0x07bd('0x16')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','/:id/messages','getMessages','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1238fc,_0x404d1f){var _0x66d410=function(_0x22b1bc){while(--_0x22b1bc){_0x1238fc['push'](_0x1238fc['shift']());}};_0x66d410(++_0x404d1f);}(_0x4975,0x86));var _0x5497=function(_0x35a197,_0x358910){_0x35a197=_0x35a197-0x0;var _0x1c9fd0=_0x4975[_0x35a197];return _0x1c9fd0;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('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 273d43f..10b94c1 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 _0x7162=['sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox'];(function(_0x25ee21,_0x2039f8){var _0x15b7cd=function(_0x56b849){while(--_0x56b849){_0x25ee21['push'](_0x25ee21['shift']());}};_0x15b7cd(++_0x2039f8);}(_0x7162,0x7e));var _0x2716=function(_0x31a7b5,_0x307d8a){_0x31a7b5=_0x31a7b5-0x0;var _0x3ed7c5=_0x7162[_0x31a7b5];return _0x3ed7c5;};'use strict';var Sequelize=require(_0x2716('0x0'));module[_0x2716('0x1')]={'customer_id':{'type':Sequelize[_0x2716('0x2')]},'context':{'type':Sequelize[_0x2716('0x2')],'defaultValue':_0x2716('0x3'),'unique':_0x2716('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x2716('0x4')},'password':{'type':Sequelize[_0x2716('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x171526){this[_0x2716('0x5')](_0x2716('0x6'),typeof _0x171526===_0x2716('0x7')&&_0x171526[_0x2716('0x8')]()?_0x171526[_0x2716('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x2716('0x2')],'defaultValue':_0x2716('0x9')},'attach':{'type':Sequelize['ENUM'](_0x2716('0xa'),'no'),'defaultValue':_0x2716('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x2716('0x2')]},'callback':{'type':Sequelize[_0x2716('0x2')]},'review':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x2716('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x2716('0xb')]('yes','no'),'defaultValue':_0x2716('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x2716('0x2')]},'maxsecs':{'type':Sequelize[_0x2716('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x2716('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x2716('0xe')],'get':function(){return this[_0x2716('0xf')]('fullname')+_0x2716('0x10')+this[_0x2716('0xf')](_0x2716('0x11'));}}}; \ No newline at end of file +var _0x3737=['yes','TIMESTAMP','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM'];(function(_0x10bad3,_0x1ba079){var _0x3af65b=function(_0x307b7e){while(--_0x307b7e){_0x10bad3['push'](_0x10bad3['shift']());}};_0x3af65b(++_0x1ba079);}(_0x3737,0x1c9));var _0x7373=function(_0x535a57,_0x12b87c){_0x535a57=_0x535a57-0x0;var _0x41de11=_0x3737[_0x535a57];return _0x41de11;};'use strict';var Sequelize=require(_0x7373('0x0'));module[_0x7373('0x1')]={'customer_id':{'type':Sequelize[_0x7373('0x2')]},'context':{'type':Sequelize[_0x7373('0x2')],'defaultValue':_0x7373('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x7373('0x4')},'password':{'type':Sequelize[_0x7373('0x2')]},'fullname':{'type':Sequelize[_0x7373('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x33d319){this[_0x7373('0x5')](_0x7373('0x6'),typeof _0x33d319===_0x7373('0x7')&&_0x33d319[_0x7373('0x8')]()?_0x33d319[_0x7373('0x8')]():null);}},'pager':{'type':Sequelize[_0x7373('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x7373('0x9')},'attach':{'type':Sequelize[_0x7373('0xa')](_0x7373('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x7373('0xa')](_0x7373('0xb'),'no'),'defaultValue':_0x7373('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7373('0x2')]},'callback':{'type':Sequelize[_0x7373('0x2')]},'review':{'type':Sequelize[_0x7373('0xa')](_0x7373('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7373('0xa')](_0x7373('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7373('0xa')](_0x7373('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x7373('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7373('0xa')](_0x7373('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7373('0xa')](_0x7373('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7373('0xa')](_0x7373('0xb'),'no'),'defaultValue':_0x7373('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7373('0xa')](_0x7373('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7373('0xa')](_0x7373('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7373('0xa')](_0x7373('0xb'),'no'),'defaultValue':_0x7373('0xb'),'allowNull':![]},'stamp':{'type':_0x7373('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x7373('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7373('0xd')],'get':function(){return this[_0x7373('0xe')](_0x7373('0xf'))+_0x7373('0x10')+this[_0x7373('0xe')](_0x7373('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 4fb2220..8a72f21 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 _0x16d2=['sort','pick','filter','where','merge','options','findAll','rows','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','userProfileId','UserProfileResource','catch','update','destroy','params','getMessages','findOne','VoiceMailMessage','nolimit','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order'];(function(_0x630bc3,_0x4f80c1){var _0x439f75=function(_0x3ba8a3){while(--_0x3ba8a3){_0x630bc3['push'](_0x630bc3['shift']());}};_0x439f75(++_0x4f80c1);}(_0x16d2,0x123));var _0x216d=function(_0x57eb22,_0x2544f5){_0x57eb22=_0x57eb22-0x0;var _0x182cdc=_0x16d2[_0x57eb22];return _0x182cdc;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require(_0x216d('0x3'));var rp=require(_0x216d('0x4'));var moment=require(_0x216d('0x5'));var BPromise=require(_0x216d('0x6'));var Mustache=require(_0x216d('0x7'));var util=require(_0x216d('0x8'));var path=require('path');var sox=require(_0x216d('0x9'));var csv=require(_0x216d('0xa'));var ejs=require(_0x216d('0xb'));var fs=require('fs');var fs_extra=require(_0x216d('0xc'));var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xa'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x216d('0x16'));var logger=require('../../config/logger')(_0x216d('0x17'));var utils=require(_0x216d('0x18'));var config=require(_0x216d('0x19'));var licenseUtil=require(_0x216d('0x1a'));var db=require(_0x216d('0x1b'))['db'];function respondWithStatusCode(_0x23ecf9,_0x4c92d9){_0x4c92d9=_0x4c92d9||0xcc;return function(_0xb36a43){if(_0xb36a43){return _0x23ecf9['sendStatus'](_0x4c92d9);}return _0x23ecf9[_0x216d('0x1c')](_0x4c92d9)[_0x216d('0x1d')]();};}function respondWithResult(_0x4dc2a2,_0x165c19){_0x165c19=_0x165c19||0xc8;return function(_0x322e4b){if(_0x322e4b){return _0x4dc2a2['status'](_0x165c19)[_0x216d('0x1e')](_0x322e4b);}};}function respondWithFilteredResult(_0x494e92,_0x448c0d){return function(_0xf571a4){if(_0xf571a4){var _0x4631b0=typeof _0x448c0d[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0x448c0d[_0x216d('0x21')]===_0x216d('0x20');var _0x1496fe=_0xf571a4[_0x216d('0x22')];var _0x53d464=_0x4631b0?0x0:_0x448c0d[_0x216d('0x1f')];var _0x5124ab=_0x4631b0?_0xf571a4['count']:_0x448c0d[_0x216d('0x1f')]+_0x448c0d[_0x216d('0x21')];var _0x574758;if(_0x5124ab>=_0x1496fe){_0x5124ab=_0x1496fe;_0x574758=0xc8;}else{_0x574758=0xce;}_0x494e92[_0x216d('0x1c')](_0x574758);return _0x494e92[_0x216d('0x23')]('Content-Range',_0x53d464+'-'+_0x5124ab+'/'+_0x1496fe)[_0x216d('0x1e')](_0xf571a4);}return null;};}function patchUpdates(_0x13b8e0){return function(_0x430e81){try{jsonpatch[_0x216d('0x24')](_0x430e81,_0x13b8e0,!![]);}catch(_0x5c3e03){return BPromise[_0x216d('0x25')](_0x5c3e03);}return _0x430e81[_0x216d('0x26')]();};}function saveUpdates(_0x10f299,_0x438981){return function(_0x206782){if(_0x206782){return _0x206782['update'](_0x10f299)[_0x216d('0x27')](function(_0x1bd4db){return _0x1bd4db;});}return null;};}function removeEntity(_0x188494,_0x2880c6){return function(_0x6fa4b3){if(_0x6fa4b3){return _0x6fa4b3['destroy']()[_0x216d('0x27')](function(){var _0xab672=_0x6fa4b3[_0x216d('0x28')]({'plain':!![]});var _0x5998a1='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x5998a1,'resourceId':_0xab672['id']}})['then'](function(){return _0x6fa4b3;});})[_0x216d('0x27')](function(){_0x188494[_0x216d('0x1c')](0xcc)[_0x216d('0x1d')]();});}};}function handleEntityNotFound(_0x73b509,_0x46d0ef){return function(_0x47fa6d){if(!_0x47fa6d){_0x73b509['sendStatus'](0x194);}return _0x47fa6d;};}function handleError(_0xa7624a,_0x51b2bd){_0x51b2bd=_0x51b2bd||0x1f4;return function(_0x23d1c3){logger[_0x216d('0x29')](_0x23d1c3[_0x216d('0x2a')]);if(_0x23d1c3[_0x216d('0x2b')]){delete _0x23d1c3[_0x216d('0x2b')];}_0xa7624a[_0x216d('0x1c')](_0x51b2bd)[_0x216d('0x2c')](_0x23d1c3);};}exports[_0x216d('0x2d')]=function(_0x169cfa,_0x28f56a){var _0x11be90={},_0x260134={},_0x4537fd={'count':0x0,'rows':[]};var _0x483324=_[_0x216d('0x2e')](db[_0x216d('0x2f')][_0x216d('0x30')],function(_0x510ad9){return{'name':_0x510ad9[_0x216d('0x31')],'type':_0x510ad9[_0x216d('0x32')][_0x216d('0x33')]};});_0x260134[_0x216d('0x34')]=_['map'](_0x483324,_0x216d('0x2b'));_0x260134[_0x216d('0x35')]=_[_0x216d('0x36')](_0x169cfa[_0x216d('0x35')]);_0x260134[_0x216d('0x37')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],_0x260134[_0x216d('0x35')]);_0x11be90[_0x216d('0x39')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],qs['fields'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3a')]));_0x11be90[_0x216d('0x39')]=_0x11be90['attributes'][_0x216d('0x3b')]?_0x11be90[_0x216d('0x39')]:_0x260134['model'];if(!_0x169cfa[_0x216d('0x35')]['hasOwnProperty']('nolimit')){_0x11be90[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x169cfa[_0x216d('0x35')][_0x216d('0x21')]);_0x11be90['offset']=qs['offset'](_0x169cfa['query'][_0x216d('0x1f')]);}_0x11be90[_0x216d('0x3c')]=qs['sort'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3d')]);_0x11be90['where']=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x169cfa[_0x216d('0x35')],_0x260134[_0x216d('0x37')]),_0x483324);if(_0x169cfa[_0x216d('0x35')][_0x216d('0x3f')]){_0x11be90[_0x216d('0x40')]=_[_0x216d('0x41')](_0x11be90['where'],{'$or':_['map'](_0x483324,function(_0x281a88){if(_0x281a88[_0x216d('0x32')]!=='VIRTUAL'){var _0xf33f9c={};_0xf33f9c[_0x281a88[_0x216d('0x2b')]]={'$like':'%'+_0x169cfa[_0x216d('0x35')]['filter']+'%'};return _0xf33f9c;}})});}_0x11be90=_[_0x216d('0x41')]({},_0x11be90,_0x169cfa[_0x216d('0x42')]);var _0x13d787={'where':_0x11be90[_0x216d('0x40')]};return db['VoiceMail'][_0x216d('0x22')](_0x13d787)[_0x216d('0x27')](function(_0x5665d7){_0x4537fd[_0x216d('0x22')]=_0x5665d7;if(_0x169cfa[_0x216d('0x35')]['includeAll']){_0x11be90['include']=[{'all':!![]}];}return db[_0x216d('0x2f')][_0x216d('0x43')](_0x11be90);})[_0x216d('0x27')](function(_0x498efe){_0x4537fd[_0x216d('0x44')]=_0x498efe;return _0x4537fd;})['then'](respondWithFilteredResult(_0x28f56a,_0x11be90))['catch'](handleError(_0x28f56a,null));};exports[_0x216d('0x45')]=function(_0x43336e,_0xac81f){var _0x5ddaeb={'raw':!![],'where':{'id':_0x43336e['params']['id']}},_0xaccf45={};_0xaccf45[_0x216d('0x34')]=_[_0x216d('0x36')](db[_0x216d('0x2f')]['rawAttributes']);_0xaccf45[_0x216d('0x35')]=_[_0x216d('0x36')](_0x43336e[_0x216d('0x35')]);_0xaccf45[_0x216d('0x37')]=_['intersection'](_0xaccf45['model'],_0xaccf45['query']);_0x5ddaeb[_0x216d('0x39')]=_[_0x216d('0x38')](_0xaccf45[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x43336e[_0x216d('0x35')][_0x216d('0x3a')]));_0x5ddaeb[_0x216d('0x39')]=_0x5ddaeb[_0x216d('0x39')]['length']?_0x5ddaeb[_0x216d('0x39')]:_0xaccf45[_0x216d('0x34')];if(_0x43336e[_0x216d('0x35')][_0x216d('0x46')]){_0x5ddaeb['include']=[{'all':!![]}];}_0x5ddaeb=_[_0x216d('0x41')]({},_0x5ddaeb,_0x43336e['options']);return db[_0x216d('0x2f')][_0x216d('0x47')](_0x5ddaeb)[_0x216d('0x27')](handleEntityNotFound(_0xac81f,null))['then'](respondWithResult(_0xac81f,null))['catch'](handleError(_0xac81f,null));};exports[_0x216d('0x48')]=function(_0x32d499,_0x3932a3){return db[_0x216d('0x2f')][_0x216d('0x48')](_0x32d499[_0x216d('0x49')],{})['then'](function(_0x4f9274){var _0x26209c=_0x32d499['user'][_0x216d('0x28')]({'plain':!![]});if(!_0x26209c)throw new Error(_0x216d('0x4a'));if(_0x26209c['role']==='user'){var _0x5f37e3=_0x4f9274['get']({'plain':!![]});var _0x1ae9b7=_0x216d('0x4b');return db[_0x216d('0x4c')][_0x216d('0x47')]({'where':{'name':_0x1ae9b7,'userProfileId':_0x26209c[_0x216d('0x4d')]},'raw':!![]})[_0x216d('0x27')](function(_0x29efa8){if(_0x29efa8&&_0x29efa8['autoAssociation']===0x0){return db[_0x216d('0x4e')][_0x216d('0x48')]({'name':_0x5f37e3[_0x216d('0x2b')],'resourceId':_0x5f37e3['id'],'type':_0x29efa8['name'],'sectionId':_0x29efa8['id']},{})[_0x216d('0x27')](function(){return _0x4f9274;});}else{return _0x4f9274;}})[_0x216d('0x4f')](function(_0x2c7c67){logger[_0x216d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c7c67);throw _0x2c7c67;});}return _0x4f9274;})[_0x216d('0x27')](respondWithResult(_0x3932a3,0xc9))[_0x216d('0x4f')](handleError(_0x3932a3,null));};exports[_0x216d('0x50')]=function(_0x1a4761,_0x4d7705){if(_0x1a4761[_0x216d('0x49')]['id']){delete _0x1a4761[_0x216d('0x49')]['id'];}return db['VoiceMail'][_0x216d('0x47')]({'where':{'id':_0x1a4761['params']['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4d7705,null))[_0x216d('0x27')](saveUpdates(_0x1a4761[_0x216d('0x49')],null))[_0x216d('0x27')](respondWithResult(_0x4d7705,null))[_0x216d('0x4f')](handleError(_0x4d7705,null));};exports[_0x216d('0x51')]=function(_0x24297f,_0x2c6cb6){return db[_0x216d('0x2f')]['find']({'where':{'id':_0x24297f[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x2c6cb6,null))['then'](removeEntity(_0x2c6cb6,null))[_0x216d('0x4f')](handleError(_0x2c6cb6,null));};exports[_0x216d('0x53')]=function(_0x59fa28,_0x4edf77,_0x3a0ee7){return db['VoiceMail'][_0x216d('0x54')]({'where':{'id':_0x59fa28[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4edf77,null))['then'](function(_0x3acd4b){var _0x5112ea;var _0x5d96b3={},_0x462225={};_0x462225[_0x216d('0x34')]=_['keys'](db[_0x216d('0x55')][_0x216d('0x30')]);_0x462225[_0x216d('0x35')]=_[_0x216d('0x36')](_0x59fa28[_0x216d('0x35')]);_0x462225[_0x216d('0x37')]=_['intersection'](_0x462225['model'],_0x462225[_0x216d('0x35')]);_0x5d96b3[_0x216d('0x39')]=_[_0x216d('0x38')](_0x462225[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3a')]));_0x5d96b3[_0x216d('0x39')]=_0x5d96b3[_0x216d('0x39')][_0x216d('0x3b')]?_0x5d96b3[_0x216d('0x39')]:_0x462225[_0x216d('0x34')];if(!_0x59fa28['query']['hasOwnProperty'](_0x216d('0x56'))){_0x5d96b3[_0x216d('0x21')]=qs['limit'](_0x59fa28[_0x216d('0x35')]['limit']);_0x5d96b3['offset']=qs[_0x216d('0x1f')](_0x59fa28[_0x216d('0x35')][_0x216d('0x1f')]);}_0x5d96b3[_0x216d('0x3c')]=qs[_0x216d('0x3d')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3d')]);_0x5d96b3[_0x216d('0x40')]=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x59fa28[_0x216d('0x35')],_0x462225[_0x216d('0x37')]));if(_0x59fa28[_0x216d('0x35')][_0x216d('0x3f')]){_0x5d96b3[_0x216d('0x40')]=_[_0x216d('0x41')](_0x5d96b3[_0x216d('0x40')],{'$or':_[_0x216d('0x2e')](_0x5d96b3[_0x216d('0x39')],function(_0x34540e){var _0xb9302={};_0xb9302[_0x34540e]={'$like':'%'+_0x59fa28[_0x216d('0x35')]['filter']+'%'};return _0xb9302;})});}_0x5d96b3[_0x216d('0x40')]=_['merge'](_0x5d96b3[_0x216d('0x40')],{'mailboxuser':_0x3acd4b['mailbox']});_0x5d96b3=_[_0x216d('0x41')]({},_0x5d96b3,_0x59fa28[_0x216d('0x42')]);return db['VoiceMailMessage'][_0x216d('0x57')](_0x5d96b3)[_0x216d('0x27')](respondWithFilteredResult(_0x4edf77,_0x5d96b3));})[_0x216d('0x4f')](handleError(_0x4edf77,null));}; \ No newline at end of file +var _0x04b8=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','Voicemails','error','stack','name','send','index','map','VoiceMail','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','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','update','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x20ba52,_0xacc64e){var _0x1c625e=function(_0x338a84){while(--_0x338a84){_0x20ba52['push'](_0x20ba52['shift']());}};_0x1c625e(++_0xacc64e);}(_0x04b8,0x159));var _0x804b=function(_0x44bcb6,_0x16e9a3){_0x44bcb6=_0x44bcb6-0x0;var _0x49ac0f=_0x04b8[_0x44bcb6];return _0x49ac0f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15a4eb,_0x5303cc){_0x5303cc=_0x5303cc||0xcc;return function(_0x23ee57){if(_0x23ee57){return _0x15a4eb[_0x804b('0x18')](_0x5303cc);}return _0x15a4eb[_0x804b('0x19')](_0x5303cc)[_0x804b('0x1a')]();};}function respondWithResult(_0x581fbf,_0x215825){_0x215825=_0x215825||0xc8;return function(_0x1b01a7){if(_0x1b01a7){return _0x581fbf[_0x804b('0x19')](_0x215825)[_0x804b('0x1b')](_0x1b01a7);}};}function respondWithFilteredResult(_0x4ff1be,_0x2fd593){return function(_0x8ccbe0){if(_0x8ccbe0){var _0x5e1cfe=typeof _0x2fd593[_0x804b('0x1c')]==='undefined'&&typeof _0x2fd593[_0x804b('0x1d')]===_0x804b('0x1e');var _0x13662e=_0x8ccbe0[_0x804b('0x1f')];var _0x3a05c0=_0x5e1cfe?0x0:_0x2fd593['offset'];var _0x871d6c=_0x5e1cfe?_0x8ccbe0['count']:_0x2fd593[_0x804b('0x1c')]+_0x2fd593[_0x804b('0x1d')];var _0x42cceb;if(_0x871d6c>=_0x13662e){_0x871d6c=_0x13662e;_0x42cceb=0xc8;}else{_0x42cceb=0xce;}_0x4ff1be[_0x804b('0x19')](_0x42cceb);return _0x4ff1be['set'](_0x804b('0x20'),_0x3a05c0+'-'+_0x871d6c+'/'+_0x13662e)[_0x804b('0x1b')](_0x8ccbe0);}return null;};}function patchUpdates(_0x427166){return function(_0x11eaf6){try{jsonpatch[_0x804b('0x21')](_0x11eaf6,_0x427166,!![]);}catch(_0x267878){return BPromise[_0x804b('0x22')](_0x267878);}return _0x11eaf6[_0x804b('0x23')]();};}function saveUpdates(_0xaa9521,_0x2b7271){return function(_0x1acc48){if(_0x1acc48){return _0x1acc48['update'](_0xaa9521)[_0x804b('0x24')](function(_0x5a77e0){return _0x5a77e0;});}return null;};}function removeEntity(_0x5585f8,_0x44a921){return function(_0x367024){if(_0x367024){return _0x367024[_0x804b('0x25')]()[_0x804b('0x24')](function(){var _0x9080c2=_0x367024['get']({'plain':!![]});var _0x2de812=_0x804b('0x26');return db['UserProfileResource'][_0x804b('0x25')]({'where':{'type':_0x2de812,'resourceId':_0x9080c2['id']}})[_0x804b('0x24')](function(){return _0x367024;});})[_0x804b('0x24')](function(){_0x5585f8[_0x804b('0x19')](0xcc)[_0x804b('0x1a')]();});}};}function handleEntityNotFound(_0x5cc1dd,_0x456580){return function(_0x22f822){if(!_0x22f822){_0x5cc1dd[_0x804b('0x18')](0x194);}return _0x22f822;};}function handleError(_0xe145e,_0x3d1ecc){_0x3d1ecc=_0x3d1ecc||0x1f4;return function(_0x4a6079){logger[_0x804b('0x27')](_0x4a6079[_0x804b('0x28')]);if(_0x4a6079[_0x804b('0x29')]){delete _0x4a6079['name'];}_0xe145e[_0x804b('0x19')](_0x3d1ecc)[_0x804b('0x2a')](_0x4a6079);};}exports[_0x804b('0x2b')]=function(_0x57b8da,_0x408857){var _0x471c04={},_0x5e8f85={},_0x391376={'count':0x0,'rows':[]};var _0x37dd3e=_[_0x804b('0x2c')](db[_0x804b('0x2d')][_0x804b('0x2e')],function(_0x241c96){return{'name':_0x241c96['fieldName'],'type':_0x241c96[_0x804b('0x2f')][_0x804b('0x30')]};});_0x5e8f85[_0x804b('0x31')]=_[_0x804b('0x2c')](_0x37dd3e,_0x804b('0x29'));_0x5e8f85[_0x804b('0x32')]=_[_0x804b('0x33')](_0x57b8da[_0x804b('0x32')]);_0x5e8f85[_0x804b('0x34')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],_0x5e8f85[_0x804b('0x32')]);_0x471c04[_0x804b('0x36')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],qs[_0x804b('0x37')](_0x57b8da[_0x804b('0x32')][_0x804b('0x37')]));_0x471c04[_0x804b('0x36')]=_0x471c04[_0x804b('0x36')][_0x804b('0x38')]?_0x471c04[_0x804b('0x36')]:_0x5e8f85[_0x804b('0x31')];if(!_0x57b8da[_0x804b('0x32')][_0x804b('0x39')]('nolimit')){_0x471c04['limit']=qs['limit'](_0x57b8da[_0x804b('0x32')][_0x804b('0x1d')]);_0x471c04[_0x804b('0x1c')]=qs['offset'](_0x57b8da['query']['offset']);}_0x471c04[_0x804b('0x3a')]=qs[_0x804b('0x3b')](_0x57b8da[_0x804b('0x32')][_0x804b('0x3b')]);_0x471c04[_0x804b('0x3c')]=qs[_0x804b('0x34')](_[_0x804b('0x3d')](_0x57b8da[_0x804b('0x32')],_0x5e8f85[_0x804b('0x34')]),_0x37dd3e);if(_0x57b8da[_0x804b('0x32')][_0x804b('0x3e')]){_0x471c04[_0x804b('0x3c')]=_[_0x804b('0x3f')](_0x471c04['where'],{'$or':_[_0x804b('0x2c')](_0x37dd3e,function(_0x4654f4){if(_0x4654f4[_0x804b('0x2f')]!==_0x804b('0x40')){var _0x62cfee={};_0x62cfee[_0x4654f4['name']]={'$like':'%'+_0x57b8da['query'][_0x804b('0x3e')]+'%'};return _0x62cfee;}})});}_0x471c04=_[_0x804b('0x3f')]({},_0x471c04,_0x57b8da[_0x804b('0x41')]);var _0x5206f9={'where':_0x471c04[_0x804b('0x3c')]};return db['VoiceMail'][_0x804b('0x1f')](_0x5206f9)[_0x804b('0x24')](function(_0x20ccc7){_0x391376[_0x804b('0x1f')]=_0x20ccc7;if(_0x57b8da[_0x804b('0x32')][_0x804b('0x42')]){_0x471c04[_0x804b('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x804b('0x44')](_0x471c04);})[_0x804b('0x24')](function(_0x1dcec8){_0x391376[_0x804b('0x45')]=_0x1dcec8;return _0x391376;})['then'](respondWithFilteredResult(_0x408857,_0x471c04))[_0x804b('0x46')](handleError(_0x408857,null));};exports[_0x804b('0x47')]=function(_0x1df519,_0x1c3d93){var _0x320aeb={'raw':!![],'where':{'id':_0x1df519[_0x804b('0x48')]['id']}},_0xbca498={};_0xbca498[_0x804b('0x31')]=_['keys'](db[_0x804b('0x2d')]['rawAttributes']);_0xbca498['query']=_['keys'](_0x1df519[_0x804b('0x32')]);_0xbca498['filters']=_[_0x804b('0x35')](_0xbca498[_0x804b('0x31')],_0xbca498[_0x804b('0x32')]);_0x320aeb[_0x804b('0x36')]=_['intersection'](_0xbca498[_0x804b('0x31')],qs[_0x804b('0x37')](_0x1df519[_0x804b('0x32')]['fields']));_0x320aeb[_0x804b('0x36')]=_0x320aeb[_0x804b('0x36')][_0x804b('0x38')]?_0x320aeb['attributes']:_0xbca498[_0x804b('0x31')];if(_0x1df519[_0x804b('0x32')][_0x804b('0x42')]){_0x320aeb[_0x804b('0x43')]=[{'all':!![]}];}_0x320aeb=_[_0x804b('0x3f')]({},_0x320aeb,_0x1df519[_0x804b('0x41')]);return db[_0x804b('0x2d')][_0x804b('0x49')](_0x320aeb)[_0x804b('0x24')](handleEntityNotFound(_0x1c3d93,null))[_0x804b('0x24')](respondWithResult(_0x1c3d93,null))[_0x804b('0x46')](handleError(_0x1c3d93,null));};exports[_0x804b('0x4a')]=function(_0x20862f,_0x2c1796){return db['VoiceMail']['create'](_0x20862f[_0x804b('0x4b')],{})[_0x804b('0x24')](function(_0x82fc71){var _0x53124f=_0x20862f[_0x804b('0x4c')]['get']({'plain':!![]});if(!_0x53124f)throw new Error(_0x804b('0x4d'));if(_0x53124f[_0x804b('0x4e')]===_0x804b('0x4c')){var _0x3ca9ff=_0x82fc71[_0x804b('0x4f')]({'plain':!![]});var _0x111e3f='Voicemails';return db['UserProfileSection'][_0x804b('0x49')]({'where':{'name':_0x111e3f,'userProfileId':_0x53124f[_0x804b('0x50')]},'raw':!![]})['then'](function(_0x5103b7){if(_0x5103b7&&_0x5103b7[_0x804b('0x51')]===0x0){return db[_0x804b('0x52')][_0x804b('0x4a')]({'name':_0x3ca9ff['name'],'resourceId':_0x3ca9ff['id'],'type':_0x5103b7[_0x804b('0x29')],'sectionId':_0x5103b7['id']},{})[_0x804b('0x24')](function(){return _0x82fc71;});}else{return _0x82fc71;}})['catch'](function(_0x2756de){logger['error'](_0x804b('0x53'),_0x2756de);throw _0x2756de;});}return _0x82fc71;})['then'](respondWithResult(_0x2c1796,0xc9))[_0x804b('0x46')](handleError(_0x2c1796,null));};exports[_0x804b('0x54')]=function(_0x47c835,_0x2f9360){if(_0x47c835['body']['id']){delete _0x47c835[_0x804b('0x4b')]['id'];}return db[_0x804b('0x2d')][_0x804b('0x49')]({'where':{'id':_0x47c835[_0x804b('0x48')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x2f9360,null))[_0x804b('0x24')](saveUpdates(_0x47c835[_0x804b('0x4b')],null))[_0x804b('0x24')](respondWithResult(_0x2f9360,null))[_0x804b('0x46')](handleError(_0x2f9360,null));};exports[_0x804b('0x25')]=function(_0x5d53f9,_0x53b91d){return db[_0x804b('0x2d')]['find']({'where':{'id':_0x5d53f9['params']['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x53b91d,null))[_0x804b('0x24')](removeEntity(_0x53b91d,null))[_0x804b('0x46')](handleError(_0x53b91d,null));};exports[_0x804b('0x55')]=function(_0x5a549f,_0x4f7cc4,_0x13fa81){return db[_0x804b('0x2d')][_0x804b('0x56')]({'where':{'id':_0x5a549f[_0x804b('0x48')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x4f7cc4,null))[_0x804b('0x24')](function(_0x24c9b0){var _0x3100aa;var _0x2c0ed4={},_0x3f0ca3={};_0x3f0ca3[_0x804b('0x31')]=_[_0x804b('0x33')](db[_0x804b('0x57')][_0x804b('0x2e')]);_0x3f0ca3[_0x804b('0x32')]=_[_0x804b('0x33')](_0x5a549f['query']);_0x3f0ca3[_0x804b('0x34')]=_[_0x804b('0x35')](_0x3f0ca3['model'],_0x3f0ca3[_0x804b('0x32')]);_0x2c0ed4[_0x804b('0x36')]=_[_0x804b('0x35')](_0x3f0ca3[_0x804b('0x31')],qs['fields'](_0x5a549f[_0x804b('0x32')][_0x804b('0x37')]));_0x2c0ed4['attributes']=_0x2c0ed4[_0x804b('0x36')][_0x804b('0x38')]?_0x2c0ed4[_0x804b('0x36')]:_0x3f0ca3['model'];if(!_0x5a549f[_0x804b('0x32')][_0x804b('0x39')](_0x804b('0x58'))){_0x2c0ed4[_0x804b('0x1d')]=qs[_0x804b('0x1d')](_0x5a549f['query'][_0x804b('0x1d')]);_0x2c0ed4[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x5a549f[_0x804b('0x32')]['offset']);}_0x2c0ed4['order']=qs[_0x804b('0x3b')](_0x5a549f['query'][_0x804b('0x3b')]);_0x2c0ed4[_0x804b('0x3c')]=qs[_0x804b('0x34')](_[_0x804b('0x3d')](_0x5a549f[_0x804b('0x32')],_0x3f0ca3['filters']));if(_0x5a549f[_0x804b('0x32')][_0x804b('0x3e')]){_0x2c0ed4[_0x804b('0x3c')]=_['merge'](_0x2c0ed4[_0x804b('0x3c')],{'$or':_[_0x804b('0x2c')](_0x2c0ed4['attributes'],function(_0xb9deae){var _0x481bcd={};_0x481bcd[_0xb9deae]={'$like':'%'+_0x5a549f[_0x804b('0x32')][_0x804b('0x3e')]+'%'};return _0x481bcd;})});}_0x2c0ed4['where']=_[_0x804b('0x3f')](_0x2c0ed4[_0x804b('0x3c')],{'mailboxuser':_0x24c9b0[_0x804b('0x59')]});_0x2c0ed4=_['merge']({},_0x2c0ed4,_0x5a549f[_0x804b('0x41')]);return db['VoiceMailMessage'][_0x804b('0x5a')](_0x2c0ed4)[_0x804b('0x24')](respondWithFilteredResult(_0x4f7cc4,_0x2c0ed4));})[_0x804b('0x46')](handleError(_0x4f7cc4,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 8dd6542..4837668 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 _0x86ac=['rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2577f7,_0x4e4781){var _0x55d372=function(_0x59b397){while(--_0x59b397){_0x2577f7['push'](_0x2577f7['shift']());}};_0x55d372(++_0x4e4781);}(_0x86ac,0x71));var _0xc86a=function(_0x45a978,_0x50385c){_0x45a978=_0x45a978-0x0;var _0x284685=_0x86ac[_0x45a978];return _0x284685;};'use strict';var _=require(_0xc86a('0x0'));var util=require(_0xc86a('0x1'));var logger=require(_0xc86a('0x2'))(_0xc86a('0x3'));var moment=require('moment');var BPromise=require(_0xc86a('0x4'));var rp=require(_0xc86a('0x5'));var fs=require('fs');var path=require(_0xc86a('0x6'));var rimraf=require(_0xc86a('0x7'));var config=require(_0xc86a('0x8'));var attributes=require(_0xc86a('0x9'));module[_0xc86a('0xa')]=function(_0x1d62cb,_0x41e334){return _0x1d62cb[_0xc86a('0xb')]('VoiceMail',attributes,{'tableName':_0xc86a('0xc'),'paranoid':![],'indexes':[{'name':_0xc86a('0xd'),'fields':[_0xc86a('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6a00=['../../config/environment','./voiceMail.attributes','VoiceMail','voice_voicemail','mailbox_context','context','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xd044c0,_0x451712){var _0x5eb75d=function(_0x443d32){while(--_0x443d32){_0xd044c0['push'](_0xd044c0['shift']());}};_0x5eb75d(++_0x451712);}(_0x6a00,0x165));var _0x06a0=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x6a00[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var util=require(_0x06a0('0x0'));var logger=require(_0x06a0('0x1'))('api');var moment=require(_0x06a0('0x2'));var BPromise=require(_0x06a0('0x3'));var rp=require(_0x06a0('0x4'));var fs=require('fs');var path=require(_0x06a0('0x5'));var rimraf=require(_0x06a0('0x6'));var config=require(_0x06a0('0x7'));var attributes=require(_0x06a0('0x8'));module['exports']=function(_0x219147,_0x57c1bf){return _0x219147['define'](_0x06a0('0x9'),attributes,{'tableName':_0x06a0('0xa'),'paranoid':![],'indexes':[{'name':_0x06a0('0xb'),'fields':['mailbox',_0x06a0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index b9f1c6d..399b1ca 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 _0x191f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x191f,0x147));var _0xf191=function(_0x37db91,_0x50c092){_0x37db91=_0x37db91-0x0;var _0xe060d2=_0x191f[_0x37db91];return _0xe060d2;};'use strict';var _=require('lodash');var util=require(_0xf191('0x0'));var moment=require(_0xf191('0x1'));var BPromise=require(_0xf191('0x2'));var rs=require(_0xf191('0x3'));var fs=require('fs');var Redis=require(_0xf191('0x4'));var db=require(_0xf191('0x5'))['db'];var utils=require(_0xf191('0x6'));var logger=require(_0xf191('0x7'))(_0xf191('0x8'));var config=require(_0xf191('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf191('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfdc2f9,_0x413232,_0x4bef0f){return new BPromise(function(_0x3d9c89,_0x33f9fb){return client[_0xf191('0xb')](_0xfdc2f9,_0x4bef0f)[_0xf191('0xc')](function(_0x43e114){logger[_0xf191('0xd')](_0xf191('0xe'),_0x413232,_0xf191('0xf'));logger[_0xf191('0x10')](_0xf191('0x11'),_0x413232,_0xf191('0xf'),JSON[_0xf191('0x12')](_0x43e114));if(_0x43e114[_0xf191('0x13')]){if(_0x43e114[_0xf191('0x13')]['code']===0x1f4){logger['error'](_0xf191('0xe'),_0x413232,_0x43e114[_0xf191('0x13')]['message']);return _0x33f9fb(_0x43e114[_0xf191('0x13')][_0xf191('0x14')]);}logger[_0xf191('0x13')](_0xf191('0xe'),_0x413232,_0x43e114['error'][_0xf191('0x14')]);return _0x3d9c89(_0x43e114[_0xf191('0x13')][_0xf191('0x14')]);}else{logger[_0xf191('0xd')](_0xf191('0xe'),_0x413232,'request\x20sent');_0x3d9c89(_0x43e114['result'][_0xf191('0x14')]);}})[_0xf191('0x15')](function(_0x509e8e){logger[_0xf191('0x13')](_0xf191('0xe'),_0x413232,_0x509e8e);_0x33f9fb(_0x509e8e);});});} \ No newline at end of file +var _0xdbff=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc'];(function(_0x20c7a8,_0x4719b7){var _0x145bb0=function(_0x997dc3){while(--_0x997dc3){_0x20c7a8['push'](_0x20c7a8['shift']());}};_0x145bb0(++_0x4719b7);}(_0xdbff,0x1ae));var _0xfdbf=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xdbff[_0x5a79e2];return _0x266c45;};'use strict';var _=require(_0xfdbf('0x0'));var util=require(_0xfdbf('0x1'));var moment=require(_0xfdbf('0x2'));var BPromise=require(_0xfdbf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfdbf('0x4'))['db'];var utils=require(_0xfdbf('0x5'));var logger=require('../../config/logger')(_0xfdbf('0x6'));var config=require(_0xfdbf('0x7'));var jayson=require(_0xfdbf('0x8'));var client=jayson[_0xfdbf('0x9')][_0xfdbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x540eef,_0x15019a,_0x3cd6a9){return new BPromise(function(_0x2368ec,_0xfa304a){return client[_0xfdbf('0xb')](_0x540eef,_0x3cd6a9)[_0xfdbf('0xc')](function(_0x515cc6){logger['info']('VoiceMail,\x20%s,\x20%s',_0x15019a,_0xfdbf('0xd'));logger[_0xfdbf('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x15019a,_0xfdbf('0xd'),JSON[_0xfdbf('0xf')](_0x515cc6));if(_0x515cc6['error']){if(_0x515cc6[_0xfdbf('0x10')][_0xfdbf('0x11')]===0x1f4){logger['error'](_0xfdbf('0x12'),_0x15019a,_0x515cc6[_0xfdbf('0x10')]['message']);return _0xfa304a(_0x515cc6[_0xfdbf('0x10')][_0xfdbf('0x13')]);}logger[_0xfdbf('0x10')](_0xfdbf('0x12'),_0x15019a,_0x515cc6['error'][_0xfdbf('0x13')]);return _0x2368ec(_0x515cc6[_0xfdbf('0x10')][_0xfdbf('0x13')]);}else{logger[_0xfdbf('0x14')]('VoiceMail,\x20%s,\x20%s',_0x15019a,_0xfdbf('0xd'));_0x2368ec(_0x515cc6[_0xfdbf('0x15')][_0xfdbf('0x13')]);}})[_0xfdbf('0x16')](function(_0x357e2c){logger[_0xfdbf('0x10')](_0xfdbf('0x12'),_0x15019a,_0x357e2c);_0xfa304a(_0x357e2c);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 9ac3a0d..16d6a72 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 _0xc405=['download','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x44606e,_0x2bf244){var _0xe68388=function(_0x488a30){while(--_0x488a30){_0x44606e['push'](_0x44606e['shift']());}};_0xe68388(++_0x2bf244);}(_0xc405,0x1d6));var _0x5c40=function(_0x8956db,_0x565a5f){_0x8956db=_0x8956db-0x0;var _0x175a41=_0xc405[_0x8956db];return _0x175a41;};'use strict';var multer=require(_0x5c40('0x0'));var util=require(_0x5c40('0x1'));var path=require(_0x5c40('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c40('0x3'));var router=express[_0x5c40('0x4')]();var fs_extra=require(_0x5c40('0x5'));var auth=require(_0x5c40('0x6'));var interaction=require(_0x5c40('0x7'));var config=require(_0x5c40('0x8'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0x5c40('0x9')](),controller[_0x5c40('0xa')]);router['get'](_0x5c40('0xb'),auth[_0x5c40('0x9')](),controller[_0x5c40('0xc')]);router['get'](_0x5c40('0xd'),auth[_0x5c40('0x9')](),controller[_0x5c40('0xe')]);router[_0x5c40('0xf')]('/',auth['isAuthenticated'](),controller[_0x5c40('0x10')]);router[_0x5c40('0x11')](_0x5c40('0xb'),auth['isAuthenticated'](),controller[_0x5c40('0x12')]);router[_0x5c40('0x13')](_0x5c40('0xb'),auth['isAuthenticated'](),controller[_0x5c40('0x14')]);module[_0x5c40('0x15')]=router; \ No newline at end of file +var _0x64a7=['../../config/environment','get','isAuthenticated','index','show','download','post','put','/:id','update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x64a7,0x1bb));var _0x764a=function(_0x1f22df,_0x3901d0){_0x1f22df=_0x1f22df-0x0;var _0x1212bf=_0x64a7[_0x1f22df];return _0x1212bf;};'use strict';var multer=require(_0x764a('0x0'));var util=require(_0x764a('0x1'));var path=require(_0x764a('0x2'));var timeout=require(_0x764a('0x3'));var express=require('express');var router=express[_0x764a('0x4')]();var fs_extra=require(_0x764a('0x5'));var auth=require(_0x764a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x764a('0x7'));var controller=require('./voiceMailMessage.controller');router[_0x764a('0x8')]('/',auth[_0x764a('0x9')](),controller[_0x764a('0xa')]);router[_0x764a('0x8')]('/:id',auth[_0x764a('0x9')](),controller[_0x764a('0xb')]);router[_0x764a('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x764a('0xc')]);router[_0x764a('0xd')]('/',auth[_0x764a('0x9')](),controller['create']);router[_0x764a('0xe')](_0x764a('0xf'),auth[_0x764a('0x9')](),controller[_0x764a('0x10')]);router['delete']('/:id',auth[_0x764a('0x9')](),controller[_0x764a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 6813e21..de626a2 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 _0x2bd4=['TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0xfedc72,_0x292f02){var _0x2c7c78=function(_0x12fbf1){while(--_0x12fbf1){_0xfedc72['push'](_0xfedc72['shift']());}};_0x2c7c78(++_0x292f02);}(_0x2bd4,0xda));var _0x42bd=function(_0x5d1be4,_0x11bf0a){_0x5d1be4=_0x5d1be4-0x0;var _0x30732a=_0x2bd4[_0x5d1be4];return _0x30732a;};'use strict';var Sequelize=require(_0x42bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x42bd('0x1')],'get':function(_0x44883a){return this[_0x42bd('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x42bd('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x42bd('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x42bd('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x42bd('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x42bd('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x42bd('0x5')](_0x42bd('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x42bd('0x4')],'defaultValue':''},'stamp':{'type':_0x42bd('0x7'),'defaultValue':Sequelize['literal'](_0x42bd('0x8'))}}; \ No newline at end of file +var _0x7917=['STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER'];(function(_0x203d57,_0x3c3d13){var _0x4940c0=function(_0x507c81){while(--_0x507c81){_0x203d57['push'](_0x203d57['shift']());}};_0x4940c0(++_0x3c3d13);}(_0x7917,0xff));var _0x7791=function(_0xb5f992,_0xd3893d){_0xb5f992=_0xb5f992-0x0;var _0x530070=_0x7917[_0xb5f992];return _0x530070;};'use strict';var Sequelize=require(_0x7791('0x0'));module[_0x7791('0x1')]={'name':{'type':Sequelize[_0x7791('0x2')],'get':function(_0x3908a3){return this[_0x7791('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x7791('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x7791('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x7791('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x7791('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x7791('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x7791('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x7791('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x7791('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x7791('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x7791('0x7'),'defaultValue':Sequelize[_0x7791('0x8')](_0x7791('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index ffbbc0b..4af93b3 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 _0x4b70=['index','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','merge','VIRTUAL','include','findAll','rows','show','params','length','options','find','catch','body','update','destroy','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','Content-Range','json','apply','reject','then','error','name'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x4b70,0x83));var _0x04b7=function(_0x255384,_0x558d2b){_0x255384=_0x255384-0x0;var _0x1500fd=_0x4b70[_0x255384];return _0x1500fd;};'use strict';var emlformat=require(_0x04b7('0x0'));var rimraf=require(_0x04b7('0x1'));var zipdir=require(_0x04b7('0x2'));var jsonpatch=require(_0x04b7('0x3'));var rp=require(_0x04b7('0x4'));var moment=require(_0x04b7('0x5'));var BPromise=require(_0x04b7('0x6'));var Mustache=require(_0x04b7('0x7'));var util=require('util');var path=require(_0x04b7('0x8'));var sox=require(_0x04b7('0x9'));var csv=require('to-csv');var ejs=require(_0x04b7('0xa'));var fs=require('fs');var fs_extra=require(_0x04b7('0xb'));var _=require(_0x04b7('0xc'));var squel=require(_0x04b7('0xd'));var crypto=require(_0x04b7('0xe'));var jsforce=require(_0x04b7('0xf'));var deskjs=require(_0x04b7('0x10'));var toCsv=require(_0x04b7('0x11'));var querystring=require(_0x04b7('0x12'));var Papa=require('papaparse');var Redis=require(_0x04b7('0x13'));var authService=require(_0x04b7('0x14'));var qs=require(_0x04b7('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04b7('0x16'));var logger=require(_0x04b7('0x17'))(_0x04b7('0x18'));var utils=require(_0x04b7('0x19'));var config=require(_0x04b7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x04b7('0x1b'))['db'];function respondWithStatusCode(_0x25c993,_0x32c6d8){_0x32c6d8=_0x32c6d8||0xcc;return function(_0x29558f){if(_0x29558f){return _0x25c993[_0x04b7('0x1c')](_0x32c6d8);}return _0x25c993[_0x04b7('0x1d')](_0x32c6d8)[_0x04b7('0x1e')]();};}function respondWithResult(_0x19c537,_0x54188c){_0x54188c=_0x54188c||0xc8;return function(_0x34b67d){if(_0x34b67d){return _0x19c537[_0x04b7('0x1d')](_0x54188c)['json'](_0x34b67d);}};}function respondWithFilteredResult(_0x3b681c,_0x541164){return function(_0x3d3bde){if(_0x3d3bde){var _0x42e0b5=typeof _0x541164['offset']===_0x04b7('0x1f')&&typeof _0x541164[_0x04b7('0x20')]==='undefined';var _0x54c052=_0x3d3bde[_0x04b7('0x21')];var _0x57ffe5=_0x42e0b5?0x0:_0x541164['offset'];var _0xc91c3f=_0x42e0b5?_0x3d3bde[_0x04b7('0x21')]:_0x541164['offset']+_0x541164[_0x04b7('0x20')];var _0x300802;if(_0xc91c3f>=_0x54c052){_0xc91c3f=_0x54c052;_0x300802=0xc8;}else{_0x300802=0xce;}_0x3b681c[_0x04b7('0x1d')](_0x300802);return _0x3b681c['set'](_0x04b7('0x22'),_0x57ffe5+'-'+_0xc91c3f+'/'+_0x54c052)[_0x04b7('0x23')](_0x3d3bde);}return null;};}function patchUpdates(_0x5a59b5){return function(_0x4306a9){try{jsonpatch[_0x04b7('0x24')](_0x4306a9,_0x5a59b5,!![]);}catch(_0x1bc61d){return BPromise[_0x04b7('0x25')](_0x1bc61d);}return _0x4306a9['save']();};}function saveUpdates(_0xf79739,_0xbfe00f){return function(_0xc183c1){if(_0xc183c1){return _0xc183c1['update'](_0xf79739)[_0x04b7('0x26')](function(_0x2349fd){return _0x2349fd;});}return null;};}function removeEntity(_0x5d3910,_0x19f873){return function(_0x3911ae){if(_0x3911ae){return _0x3911ae['destroy']()['then'](function(){_0x5d3910[_0x04b7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47daea,_0x45331c){return function(_0x50ae63){if(!_0x50ae63){_0x47daea[_0x04b7('0x1c')](0x194);}return _0x50ae63;};}function handleError(_0x36a5ba,_0x3d8824){_0x3d8824=_0x3d8824||0x1f4;return function(_0x4130c5){logger[_0x04b7('0x27')](_0x4130c5['stack']);if(_0x4130c5['name']){delete _0x4130c5[_0x04b7('0x28')];}_0x36a5ba['status'](_0x3d8824)['send'](_0x4130c5);};}exports[_0x04b7('0x29')]=function(_0x2a252b,_0x3feae4){var _0x73b9a5={},_0x3c072e={},_0x514a3a={'count':0x0,'rows':[]};var _0x556da0=_['map'](db[_0x04b7('0x2a')][_0x04b7('0x2b')],function(_0x26e776){return{'name':_0x26e776[_0x04b7('0x2c')],'type':_0x26e776[_0x04b7('0x2d')][_0x04b7('0x2e')]};});_0x3c072e['model']=_[_0x04b7('0x2f')](_[_0x04b7('0x30')](_0x556da0,'name'),[_0x04b7('0x28')]);_0x3c072e[_0x04b7('0x31')]=_[_0x04b7('0x32')](_0x2a252b['query']);_0x3c072e[_0x04b7('0x33')]=_[_0x04b7('0x34')](_0x3c072e[_0x04b7('0x35')],_0x3c072e[_0x04b7('0x31')]);_0x73b9a5[_0x04b7('0x36')]=_[_0x04b7('0x34')](_0x3c072e[_0x04b7('0x35')],qs[_0x04b7('0x37')](_0x2a252b[_0x04b7('0x31')][_0x04b7('0x37')]));_0x73b9a5[_0x04b7('0x36')]=_0x73b9a5[_0x04b7('0x36')]['length']?_0x73b9a5['attributes']:_0x3c072e[_0x04b7('0x35')];if(!_0x2a252b[_0x04b7('0x31')][_0x04b7('0x38')](_0x04b7('0x39'))){_0x73b9a5['limit']=qs[_0x04b7('0x20')](_0x2a252b[_0x04b7('0x31')]['limit']);_0x73b9a5[_0x04b7('0x3a')]=qs[_0x04b7('0x3a')](_0x2a252b['query'][_0x04b7('0x3a')]);}_0x73b9a5['order']=qs[_0x04b7('0x3b')](_0x2a252b['query'][_0x04b7('0x3b')]);_0x73b9a5[_0x04b7('0x3c')]=qs[_0x04b7('0x33')](_['pick'](_0x2a252b[_0x04b7('0x31')],_0x3c072e['filters']),_0x556da0);if(_0x2a252b['query'][_0x04b7('0x3d')]){_0x73b9a5[_0x04b7('0x3c')]=_[_0x04b7('0x3e')](_0x73b9a5[_0x04b7('0x3c')],{'$or':_[_0x04b7('0x30')](_0x556da0,function(_0x5d79f4){if(_0x5d79f4[_0x04b7('0x2d')]!==_0x04b7('0x3f')){var _0x19adf8={};_0x19adf8[_0x5d79f4[_0x04b7('0x28')]]={'$like':'%'+_0x2a252b[_0x04b7('0x31')][_0x04b7('0x3d')]+'%'};return _0x19adf8;}})});}_0x73b9a5=_[_0x04b7('0x3e')]({},_0x73b9a5,_0x2a252b['options']);var _0x4e85d7={'where':_0x73b9a5[_0x04b7('0x3c')]};return db[_0x04b7('0x2a')][_0x04b7('0x21')](_0x4e85d7)[_0x04b7('0x26')](function(_0x155db7){_0x514a3a[_0x04b7('0x21')]=_0x155db7;if(_0x2a252b[_0x04b7('0x31')]['includeAll']){_0x73b9a5[_0x04b7('0x40')]=[{'all':!![]}];}return db[_0x04b7('0x2a')][_0x04b7('0x41')](_0x73b9a5);})[_0x04b7('0x26')](function(_0x3703dc){_0x514a3a[_0x04b7('0x42')]=_0x3703dc;return _0x514a3a;})['then'](respondWithFilteredResult(_0x3feae4,_0x73b9a5))['catch'](handleError(_0x3feae4,null));};exports[_0x04b7('0x43')]=function(_0x2c620f,_0x2790e6){var _0x51694d={'raw':!![],'where':{'id':_0x2c620f[_0x04b7('0x44')]['id']}},_0x38a526={};_0x38a526[_0x04b7('0x35')]=_[_0x04b7('0x32')](db[_0x04b7('0x2a')][_0x04b7('0x2b')]);_0x38a526[_0x04b7('0x31')]=_[_0x04b7('0x32')](_0x2c620f['query']);_0x38a526[_0x04b7('0x33')]=_['intersection'](_0x38a526[_0x04b7('0x35')],_0x38a526[_0x04b7('0x31')]);_0x51694d[_0x04b7('0x36')]=_[_0x04b7('0x34')](_0x38a526[_0x04b7('0x35')],qs['fields'](_0x2c620f[_0x04b7('0x31')][_0x04b7('0x37')]));_0x51694d[_0x04b7('0x36')]=_0x51694d[_0x04b7('0x36')][_0x04b7('0x45')]?_0x51694d[_0x04b7('0x36')]:_0x38a526[_0x04b7('0x35')];if(_0x2c620f['query']['includeAll']){_0x51694d[_0x04b7('0x40')]=[{'all':!![]}];}_0x51694d=_[_0x04b7('0x3e')]({},_0x51694d,_0x2c620f[_0x04b7('0x46')]);return db['VoiceMailMessage'][_0x04b7('0x47')](_0x51694d)[_0x04b7('0x26')](handleEntityNotFound(_0x2790e6,null))[_0x04b7('0x26')](respondWithResult(_0x2790e6,null))[_0x04b7('0x48')](handleError(_0x2790e6,null));};exports['create']=function(_0x5f20c0,_0x20cc6c){return db['VoiceMailMessage']['create'](_0x5f20c0[_0x04b7('0x49')],{})[_0x04b7('0x26')](respondWithResult(_0x20cc6c,0xc9))[_0x04b7('0x48')](handleError(_0x20cc6c,null));};exports[_0x04b7('0x4a')]=function(_0x4664ee,_0x3b7695){if(_0x4664ee['body']['id']){delete _0x4664ee[_0x04b7('0x49')]['id'];}return db[_0x04b7('0x2a')][_0x04b7('0x47')]({'where':{'id':_0x4664ee[_0x04b7('0x44')]['id']}})[_0x04b7('0x26')](handleEntityNotFound(_0x3b7695,null))['then'](saveUpdates(_0x4664ee['body'],null))[_0x04b7('0x26')](respondWithResult(_0x3b7695,null))[_0x04b7('0x48')](handleError(_0x3b7695,null));};exports[_0x04b7('0x4b')]=function(_0x40e90c,_0x14f38c){return db[_0x04b7('0x2a')][_0x04b7('0x47')]({'where':{'id':_0x40e90c['params']['id']}})[_0x04b7('0x26')](handleEntityNotFound(_0x14f38c,null))['then'](removeEntity(_0x14f38c,null))['catch'](handleError(_0x14f38c,null));};exports[_0x04b7('0x4c')]=function(_0x406238,_0x328ab0,_0x1580e9){return db[_0x04b7('0x2a')][_0x04b7('0x47')]({'where':{'id':_0x406238[_0x04b7('0x44')]['id']},'attributes':['id',_0x04b7('0x4d'),_0x04b7('0x4e')]})[_0x04b7('0x26')](handleEntityNotFound(_0x328ab0,null))[_0x04b7('0x26')](function(_0x1db0f0){if(_0x1db0f0){if(!_0x1db0f0[_0x04b7('0x4d')]){throw new db[(_0x04b7('0x4f'))]['ValidationError'](_0x04b7('0x50'));}var _0x3ff243={'Content-Type':_0x04b7('0x51'),'Content-Disposition':_0x04b7('0x52')};if(_0x1db0f0[_0x04b7('0x4e')]){_0x3ff243['Content-Disposition']=_0x04b7('0x53')+_0x1db0f0[_0x04b7('0x4e')]+_0x04b7('0x54');}_0x328ab0['set'](_0x3ff243);return _0x328ab0[_0x04b7('0x55')](new Buffer(_0x1db0f0['recording']));}})[_0x04b7('0x48')](handleError(_0x328ab0,null));}; \ No newline at end of file +var _0x0137=['stack','name','send','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','keys','filters','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','then','error'];(function(_0x52c28e,_0x403f49){var _0x30c066=function(_0x4c0380){while(--_0x4c0380){_0x52c28e['push'](_0x52c28e['shift']());}};_0x30c066(++_0x403f49);}(_0x0137,0x126));var _0x7013=function(_0x1c6471,_0x29f86e){_0x1c6471=_0x1c6471-0x0;var _0x474a68=_0x0137[_0x1c6471];return _0x474a68;};'use strict';var emlformat=require(_0x7013('0x0'));var rimraf=require(_0x7013('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7013('0x2'));var rp=require(_0x7013('0x3'));var moment=require(_0x7013('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7013('0x5'));var util=require(_0x7013('0x6'));var path=require(_0x7013('0x7'));var sox=require('sox');var csv=require(_0x7013('0x8'));var ejs=require(_0x7013('0x9'));var fs=require('fs');var fs_extra=require(_0x7013('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7013('0xb'));var jsforce=require(_0x7013('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7013('0x8'));var querystring=require(_0x7013('0xd'));var Papa=require(_0x7013('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7013('0xf'));var as=require(_0x7013('0x10'));var hardwareService=require(_0x7013('0x11'));var logger=require(_0x7013('0x12'))(_0x7013('0x13'));var utils=require(_0x7013('0x14'));var config=require(_0x7013('0x15'));var licenseUtil=require(_0x7013('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a1bf2,_0x59ca0c){_0x59ca0c=_0x59ca0c||0xcc;return function(_0x4a721f){if(_0x4a721f){return _0x4a1bf2[_0x7013('0x17')](_0x59ca0c);}return _0x4a1bf2['status'](_0x59ca0c)[_0x7013('0x18')]();};}function respondWithResult(_0x51e44a,_0x425527){_0x425527=_0x425527||0xc8;return function(_0xead5e0){if(_0xead5e0){return _0x51e44a[_0x7013('0x19')](_0x425527)['json'](_0xead5e0);}};}function respondWithFilteredResult(_0x19ec8d,_0x543246){return function(_0x199486){if(_0x199486){var _0x411758=typeof _0x543246[_0x7013('0x1a')]===_0x7013('0x1b')&&typeof _0x543246[_0x7013('0x1c')]===_0x7013('0x1b');var _0x4534f3=_0x199486['count'];var _0x342ad1=_0x411758?0x0:_0x543246[_0x7013('0x1a')];var _0xe600b1=_0x411758?_0x199486[_0x7013('0x1d')]:_0x543246[_0x7013('0x1a')]+_0x543246[_0x7013('0x1c')];var _0x12035f;if(_0xe600b1>=_0x4534f3){_0xe600b1=_0x4534f3;_0x12035f=0xc8;}else{_0x12035f=0xce;}_0x19ec8d[_0x7013('0x19')](_0x12035f);return _0x19ec8d[_0x7013('0x1e')](_0x7013('0x1f'),_0x342ad1+'-'+_0xe600b1+'/'+_0x4534f3)[_0x7013('0x20')](_0x199486);}return null;};}function patchUpdates(_0x5445d1){return function(_0x188509){try{jsonpatch['apply'](_0x188509,_0x5445d1,!![]);}catch(_0x2e7751){return BPromise['reject'](_0x2e7751);}return _0x188509[_0x7013('0x21')]();};}function saveUpdates(_0x2edaab,_0x101187){return function(_0x1b85ae){if(_0x1b85ae){return _0x1b85ae[_0x7013('0x22')](_0x2edaab)['then'](function(_0x3a054e){return _0x3a054e;});}return null;};}function removeEntity(_0x18dfed,_0x5906a1){return function(_0x700d1f){if(_0x700d1f){return _0x700d1f[_0x7013('0x23')]()[_0x7013('0x24')](function(){_0x18dfed[_0x7013('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33917b,_0x2e3913){return function(_0x15f474){if(!_0x15f474){_0x33917b[_0x7013('0x17')](0x194);}return _0x15f474;};}function handleError(_0x2b72b0,_0x44ae3f){_0x44ae3f=_0x44ae3f||0x1f4;return function(_0xd11d87){logger[_0x7013('0x25')](_0xd11d87[_0x7013('0x26')]);if(_0xd11d87[_0x7013('0x27')]){delete _0xd11d87['name'];}_0x2b72b0[_0x7013('0x19')](_0x44ae3f)[_0x7013('0x28')](_0xd11d87);};}exports['index']=function(_0x1678ea,_0x593667){var _0x41cae4={},_0x4b725c={},_0x1623fa={'count':0x0,'rows':[]};var _0x8070cc=_[_0x7013('0x29')](db[_0x7013('0x2a')][_0x7013('0x2b')],function(_0x31a246){return{'name':_0x31a246['fieldName'],'type':_0x31a246[_0x7013('0x2c')][_0x7013('0x2d')]};});_0x4b725c[_0x7013('0x2e')]=_[_0x7013('0x2f')](_['map'](_0x8070cc,'name'),[_0x7013('0x27')]);_0x4b725c['query']=_[_0x7013('0x30')](_0x1678ea['query']);_0x4b725c[_0x7013('0x31')]=_['intersection'](_0x4b725c[_0x7013('0x2e')],_0x4b725c[_0x7013('0x32')]);_0x41cae4['attributes']=_[_0x7013('0x33')](_0x4b725c['model'],qs[_0x7013('0x34')](_0x1678ea[_0x7013('0x32')][_0x7013('0x34')]));_0x41cae4[_0x7013('0x35')]=_0x41cae4[_0x7013('0x35')][_0x7013('0x36')]?_0x41cae4[_0x7013('0x35')]:_0x4b725c[_0x7013('0x2e')];if(!_0x1678ea[_0x7013('0x32')]['hasOwnProperty'](_0x7013('0x37'))){_0x41cae4[_0x7013('0x1c')]=qs['limit'](_0x1678ea[_0x7013('0x32')][_0x7013('0x1c')]);_0x41cae4[_0x7013('0x1a')]=qs['offset'](_0x1678ea[_0x7013('0x32')][_0x7013('0x1a')]);}_0x41cae4[_0x7013('0x38')]=qs[_0x7013('0x39')](_0x1678ea['query'][_0x7013('0x39')]);_0x41cae4[_0x7013('0x3a')]=qs[_0x7013('0x31')](_[_0x7013('0x3b')](_0x1678ea[_0x7013('0x32')],_0x4b725c[_0x7013('0x31')]),_0x8070cc);if(_0x1678ea[_0x7013('0x32')][_0x7013('0x3c')]){_0x41cae4[_0x7013('0x3a')]=_[_0x7013('0x3d')](_0x41cae4[_0x7013('0x3a')],{'$or':_['map'](_0x8070cc,function(_0x5cfb26){if(_0x5cfb26[_0x7013('0x2c')]!==_0x7013('0x3e')){var _0x262ec5={};_0x262ec5[_0x5cfb26[_0x7013('0x27')]]={'$like':'%'+_0x1678ea['query'][_0x7013('0x3c')]+'%'};return _0x262ec5;}})});}_0x41cae4=_[_0x7013('0x3d')]({},_0x41cae4,_0x1678ea[_0x7013('0x3f')]);var _0x197263={'where':_0x41cae4[_0x7013('0x3a')]};return db[_0x7013('0x2a')][_0x7013('0x1d')](_0x197263)[_0x7013('0x24')](function(_0x585ad6){_0x1623fa[_0x7013('0x1d')]=_0x585ad6;if(_0x1678ea['query'][_0x7013('0x40')]){_0x41cae4[_0x7013('0x41')]=[{'all':!![]}];}return db[_0x7013('0x2a')][_0x7013('0x42')](_0x41cae4);})[_0x7013('0x24')](function(_0x4608b9){_0x1623fa[_0x7013('0x43')]=_0x4608b9;return _0x1623fa;})['then'](respondWithFilteredResult(_0x593667,_0x41cae4))[_0x7013('0x44')](handleError(_0x593667,null));};exports[_0x7013('0x45')]=function(_0x4b3674,_0x2e69da){var _0x4ec20a={'raw':!![],'where':{'id':_0x4b3674['params']['id']}},_0x3e7a56={};_0x3e7a56[_0x7013('0x2e')]=_[_0x7013('0x30')](db['VoiceMailMessage'][_0x7013('0x2b')]);_0x3e7a56[_0x7013('0x32')]=_[_0x7013('0x30')](_0x4b3674[_0x7013('0x32')]);_0x3e7a56[_0x7013('0x31')]=_[_0x7013('0x33')](_0x3e7a56[_0x7013('0x2e')],_0x3e7a56[_0x7013('0x32')]);_0x4ec20a[_0x7013('0x35')]=_[_0x7013('0x33')](_0x3e7a56['model'],qs['fields'](_0x4b3674['query'][_0x7013('0x34')]));_0x4ec20a[_0x7013('0x35')]=_0x4ec20a[_0x7013('0x35')]['length']?_0x4ec20a[_0x7013('0x35')]:_0x3e7a56[_0x7013('0x2e')];if(_0x4b3674[_0x7013('0x32')]['includeAll']){_0x4ec20a[_0x7013('0x41')]=[{'all':!![]}];}_0x4ec20a=_[_0x7013('0x3d')]({},_0x4ec20a,_0x4b3674[_0x7013('0x3f')]);return db[_0x7013('0x2a')][_0x7013('0x46')](_0x4ec20a)[_0x7013('0x24')](handleEntityNotFound(_0x2e69da,null))[_0x7013('0x24')](respondWithResult(_0x2e69da,null))[_0x7013('0x44')](handleError(_0x2e69da,null));};exports['create']=function(_0x183327,_0x1252d4){return db[_0x7013('0x2a')][_0x7013('0x47')](_0x183327['body'],{})['then'](respondWithResult(_0x1252d4,0xc9))[_0x7013('0x44')](handleError(_0x1252d4,null));};exports[_0x7013('0x22')]=function(_0x294a6d,_0x403f6c){if(_0x294a6d[_0x7013('0x48')]['id']){delete _0x294a6d['body']['id'];}return db[_0x7013('0x2a')][_0x7013('0x46')]({'where':{'id':_0x294a6d[_0x7013('0x49')]['id']}})[_0x7013('0x24')](handleEntityNotFound(_0x403f6c,null))[_0x7013('0x24')](saveUpdates(_0x294a6d[_0x7013('0x48')],null))['then'](respondWithResult(_0x403f6c,null))['catch'](handleError(_0x403f6c,null));};exports[_0x7013('0x23')]=function(_0x27993a,_0x211389){return db[_0x7013('0x2a')][_0x7013('0x46')]({'where':{'id':_0x27993a[_0x7013('0x49')]['id']}})['then'](handleEntityNotFound(_0x211389,null))['then'](removeEntity(_0x211389,null))[_0x7013('0x44')](handleError(_0x211389,null));};exports[_0x7013('0x4a')]=function(_0x34d8d0,_0x6b1a91,_0x1099ab){return db[_0x7013('0x2a')][_0x7013('0x46')]({'where':{'id':_0x34d8d0[_0x7013('0x49')]['id']},'attributes':['id',_0x7013('0x4b'),_0x7013('0x4c')]})[_0x7013('0x24')](handleEntityNotFound(_0x6b1a91,null))['then'](function(_0x56fc20){if(_0x56fc20){if(!_0x56fc20[_0x7013('0x4b')]){throw new db['Sequelize'][(_0x7013('0x4d'))](_0x7013('0x4e'));}var _0x12b894={'Content-Type':_0x7013('0x4f'),'Content-Disposition':_0x7013('0x50')};if(_0x56fc20['msg_id']){_0x12b894[_0x7013('0x51')]='attachment;\x20filename=\x22'+_0x56fc20[_0x7013('0x4c')]+_0x7013('0x52');}_0x6b1a91['set'](_0x12b894);return _0x6b1a91[_0x7013('0x28')](new Buffer(_0x56fc20[_0x7013('0x4b')]));}})[_0x7013('0x44')](handleError(_0x6b1a91,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 25317de..af34999 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 _0x8092=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','voice_voicemail_messages','dir'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0x8092,0xa9));var _0x2809=function(_0x57572c,_0x4a67ec){_0x57572c=_0x57572c-0x0;var _0x22b79e=_0x8092[_0x57572c];return _0x22b79e;};'use strict';var _=require(_0x2809('0x0'));var util=require(_0x2809('0x1'));var logger=require(_0x2809('0x2'))(_0x2809('0x3'));var moment=require('moment');var BPromise=require(_0x2809('0x4'));var rp=require(_0x2809('0x5'));var fs=require('fs');var path=require(_0x2809('0x6'));var rimraf=require(_0x2809('0x7'));var config=require(_0x2809('0x8'));var attributes=require(_0x2809('0x9'));module[_0x2809('0xa')]=function(_0x490ea3,_0x27d5d7){return _0x490ea3['define']('VoiceMailMessage',attributes,{'tableName':_0x2809('0xb'),'paranoid':![],'indexes':[{'name':_0x2809('0xc'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x98ed=['dir','../../config/logger','bluebird','path','rimraf','./voiceMailMessage.attributes','define'];(function(_0x2ff56d,_0x11356d){var _0x5d3213=function(_0x1e62f4){while(--_0x1e62f4){_0x2ff56d['push'](_0x2ff56d['shift']());}};_0x5d3213(++_0x11356d);}(_0x98ed,0x151));var _0xd98e=function(_0x4f096e,_0x30d3c3){_0x4f096e=_0x4f096e-0x0;var _0x4a33ce=_0x98ed[_0x4f096e];return _0x4a33ce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd98e('0x0'))('api');var moment=require('moment');var BPromise=require(_0xd98e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd98e('0x2'));var rimraf=require(_0xd98e('0x3'));var config=require('../../config/environment');var attributes=require(_0xd98e('0x4'));module['exports']=function(_0x25b020,_0x32556a){return _0x25b020[_0xd98e('0x5')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0xd98e('0x6')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 7ac4d06..67a4528 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 _0x5afd=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5afd,0x7f));var _0xd5af=function(_0x442dbf,_0x117087){_0x442dbf=_0x442dbf-0x0;var _0x294658=_0x5afd[_0x442dbf];return _0x294658;};'use strict';var _=require('lodash');var util=require(_0xd5af('0x0'));var moment=require(_0xd5af('0x1'));var BPromise=require(_0xd5af('0x2'));var rs=require(_0xd5af('0x3'));var fs=require('fs');var Redis=require(_0xd5af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd5af('0x5'));var logger=require(_0xd5af('0x6'))(_0xd5af('0x7'));var config=require(_0xd5af('0x8'));var jayson=require(_0xd5af('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1b43bf,_0x5ddd89,_0x104a1d){return new BPromise(function(_0x2a5ac6,_0x80e1cd){return client[_0xd5af('0xa')](_0x1b43bf,_0x104a1d)[_0xd5af('0xb')](function(_0x2db494){logger[_0xd5af('0xc')](_0xd5af('0xd'),_0x5ddd89,_0xd5af('0xe'));logger[_0xd5af('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x5ddd89,_0xd5af('0xe'),JSON[_0xd5af('0x10')](_0x2db494));if(_0x2db494['error']){if(_0x2db494[_0xd5af('0x11')]['code']===0x1f4){logger[_0xd5af('0x11')](_0xd5af('0xd'),_0x5ddd89,_0x2db494[_0xd5af('0x11')][_0xd5af('0x12')]);return _0x80e1cd(_0x2db494[_0xd5af('0x11')][_0xd5af('0x12')]);}logger[_0xd5af('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x5ddd89,_0x2db494['error'][_0xd5af('0x12')]);return _0x2a5ac6(_0x2db494[_0xd5af('0x11')]['message']);}else{logger[_0xd5af('0xc')](_0xd5af('0xd'),_0x5ddd89,'request\x20sent');_0x2a5ac6(_0x2db494['result']['message']);}})[_0xd5af('0x13')](function(_0x25306e){logger[_0xd5af('0x11')](_0xd5af('0xd'),_0x5ddd89,_0x25306e);_0x80e1cd(_0x25306e);});});} \ No newline at end of file +var _0xfe0e=['debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0xfe0e,0x183));var _0xefe0=function(_0x35fabd,_0x825452){_0x35fabd=_0x35fabd-0x0;var _0x61a8ee=_0xfe0e[_0x35fabd];return _0x61a8ee;};'use strict';var _=require(_0xefe0('0x0'));var util=require('util');var moment=require(_0xefe0('0x1'));var BPromise=require(_0xefe0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xefe0('0x3'));var logger=require(_0xefe0('0x4'))(_0xefe0('0x5'));var config=require(_0xefe0('0x6'));var jayson=require(_0xefe0('0x7'));var client=jayson['client'][_0xefe0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ea280,_0xb3362c,_0x25f2c9){return new BPromise(function(_0x36a4ac,_0x22e353){return client[_0xefe0('0x9')](_0x1ea280,_0x25f2c9)[_0xefe0('0xa')](function(_0x26ed94){logger['info'](_0xefe0('0xb'),_0xb3362c,_0xefe0('0xc'));logger[_0xefe0('0xd')](_0xefe0('0xe'),_0xb3362c,_0xefe0('0xc'),JSON[_0xefe0('0xf')](_0x26ed94));if(_0x26ed94['error']){if(_0x26ed94[_0xefe0('0x10')][_0xefe0('0x11')]===0x1f4){logger[_0xefe0('0x10')](_0xefe0('0xb'),_0xb3362c,_0x26ed94[_0xefe0('0x10')][_0xefe0('0x12')]);return _0x22e353(_0x26ed94[_0xefe0('0x10')][_0xefe0('0x12')]);}logger[_0xefe0('0x10')](_0xefe0('0xb'),_0xb3362c,_0x26ed94[_0xefe0('0x10')]['message']);return _0x36a4ac(_0x26ed94[_0xefe0('0x10')][_0xefe0('0x12')]);}else{logger[_0xefe0('0x13')](_0xefe0('0xb'),_0xb3362c,_0xefe0('0xc'));_0x36a4ac(_0x26ed94['result'][_0xefe0('0x12')]);}})['catch'](function(_0x2b373c){logger[_0xefe0('0x10')](_0xefe0('0xb'),_0xb3362c,_0x2b373c);_0x22e353(_0x2b373c);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index dd95d52..25d18c9 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 _0xd2a1=['../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','getSounds','post','/:id/sounds','addSound','put','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x5908d8,_0x2b839a){var _0x150f7c=function(_0x3a0756){while(--_0x3a0756){_0x5908d8['push'](_0x5908d8['shift']());}};_0x150f7c(++_0x2b839a);}(_0xd2a1,0xa1));var _0x1d2a=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0xd2a1[_0x18546c];return _0x46ef43;};'use strict';var multer=require(_0x1d2a('0x0'));var util=require(_0x1d2a('0x1'));var path=require(_0x1d2a('0x2'));var timeout=require(_0x1d2a('0x3'));var express=require(_0x1d2a('0x4'));var router=express['Router']();var fs_extra=require(_0x1d2a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1d2a('0x6'));var config=require(_0x1d2a('0x7'));var controller=require(_0x1d2a('0x8'));router[_0x1d2a('0x9')]('/',auth[_0x1d2a('0xa')](),controller[_0x1d2a('0xb')]);router['get'](_0x1d2a('0xc'),auth[_0x1d2a('0xa')](),controller[_0x1d2a('0xd')]);router[_0x1d2a('0x9')]('/:id/sounds',auth[_0x1d2a('0xa')](),controller[_0x1d2a('0xe')]);router[_0x1d2a('0xf')]('/',auth[_0x1d2a('0xa')](),controller['create']);router[_0x1d2a('0xf')](_0x1d2a('0x10'),auth[_0x1d2a('0xa')](),controller[_0x1d2a('0x11')]);router[_0x1d2a('0x12')]('/:id',auth[_0x1d2a('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1d2a('0x13')]);router[_0x1d2a('0x14')](_0x1d2a('0x15'),auth[_0x1d2a('0xa')](),controller[_0x1d2a('0x16')]);module[_0x1d2a('0x17')]=router; \ No newline at end of file +var _0x9346=['/:id','show','/:id/sounds','getSounds','post','create','put','update','delete','destroy','/:id/sounds/:id2','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x9346,0xb4));var _0x6934=function(_0x516e22,_0x596673){_0x516e22=_0x516e22-0x0;var _0xa531a4=_0x9346[_0x516e22];return _0xa531a4;};'use strict';var multer=require(_0x6934('0x0'));var util=require('util');var path=require(_0x6934('0x1'));var timeout=require('connect-timeout');var express=require(_0x6934('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6934('0x3'));var interaction=require(_0x6934('0x4'));var config=require(_0x6934('0x5'));var controller=require('./voiceMusicOnHold.controller');router[_0x6934('0x6')]('/',auth[_0x6934('0x7')](),controller[_0x6934('0x8')]);router[_0x6934('0x6')](_0x6934('0x9'),auth[_0x6934('0x7')](),controller[_0x6934('0xa')]);router[_0x6934('0x6')](_0x6934('0xb'),auth['isAuthenticated'](),controller[_0x6934('0xc')]);router[_0x6934('0xd')]('/',auth[_0x6934('0x7')](),controller[_0x6934('0xe')]);router[_0x6934('0xd')](_0x6934('0xb'),auth['isAuthenticated'](),controller['addSound']);router[_0x6934('0xf')](_0x6934('0x9'),auth[_0x6934('0x7')](),controller[_0x6934('0x10')]);router[_0x6934('0x11')]('/:id',auth[_0x6934('0x7')](),controller[_0x6934('0x12')]);router[_0x6934('0x11')](_0x6934('0x13'),auth[_0x6934('0x7')](),controller['removeSound']);module[_0x6934('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index cd1054a..596c8d0 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 _0x8408=['name','custom','files','mp3nb','quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x8408,0xc9));var _0x8840=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x8408[_0x2f3794];return _0x1c9fbe;};'use strict';var Sequelize=require(_0x8840('0x0'));module[_0x8840('0x1')]={'name':{'type':Sequelize[_0x8840('0x2')],'allowNull':![],'unique':_0x8840('0x3')},'mode':{'type':Sequelize['ENUM'](_0x8840('0x4'),_0x8840('0x5'),_0x8840('0x6'),_0x8840('0x7'),_0x8840('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0x8840('0x5')},'directory':{'type':Sequelize[_0x8840('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x8840('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8840('0x9')},'format':{'type':Sequelize[_0x8840('0x2')],'allowNull':!![]},'stamp':{'type':_0x8840('0xa')},'defaultEntry':{'type':Sequelize[_0x8840('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x36eb=['BOOLEAN','sequelize','exports','STRING','mp3nb','quietmp3nb','quietmp3','mp3','files','TIMESTAMP'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36eb,0xbf));var _0xb36e=function(_0x580aa0,_0x1535de){_0x580aa0=_0x580aa0-0x0;var _0x5e819b=_0x36eb[_0x580aa0];return _0x5e819b;};'use strict';var Sequelize=require(_0xb36e('0x0'));module[_0xb36e('0x1')]={'name':{'type':Sequelize[_0xb36e('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM']('custom','files',_0xb36e('0x3'),_0xb36e('0x4'),_0xb36e('0x5'),_0xb36e('0x6')),'allowNull':!![],'defaultValue':_0xb36e('0x7')},'directory':{'type':Sequelize[_0xb36e('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xb36e('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb36e('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xb36e('0x8')},'defaultEntry':{'type':Sequelize[_0xb36e('0x9')],'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 90e9c25..193a590 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 _0xaef3=['role','userProfileId','autoAssociation','sequelize','readdirSync','unlinkSync','Sequelize','message','Sound','save_name','format','%s.%s','basename','extname','converted_format','symlinkSync','ValidationError','removeSound','findOne','id2','createdAt','pick','getSounds','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','update','body','transaction','mode','files','directory','join','root','server/files/moh','create','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0xff9111,_0x289f3d){var _0x3fd55a=function(_0x145f0c){while(--_0x145f0c){_0xff9111['push'](_0xff9111['shift']());}};_0x3fd55a(++_0x289f3d);}(_0xaef3,0x1f4));var _0x3aef=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0xaef3[_0x3dfeb9];return _0x412314;};'use strict';var emlformat=require(_0x3aef('0x0'));var rimraf=require(_0x3aef('0x1'));var zipdir=require(_0x3aef('0x2'));var jsonpatch=require(_0x3aef('0x3'));var rp=require('request-promise');var moment=require(_0x3aef('0x4'));var BPromise=require(_0x3aef('0x5'));var Mustache=require(_0x3aef('0x6'));var util=require('util');var path=require(_0x3aef('0x7'));var sox=require(_0x3aef('0x8'));var csv=require('to-csv');var ejs=require(_0x3aef('0x9'));var fs=require('fs');var fs_extra=require(_0x3aef('0xa'));var _=require(_0x3aef('0xb'));var squel=require(_0x3aef('0xc'));var crypto=require(_0x3aef('0xd'));var jsforce=require(_0x3aef('0xe'));var deskjs=require(_0x3aef('0xf'));var toCsv=require(_0x3aef('0x10'));var querystring=require(_0x3aef('0x11'));var Papa=require(_0x3aef('0x12'));var Redis=require(_0x3aef('0x13'));var authService=require(_0x3aef('0x14'));var qs=require(_0x3aef('0x15'));var as=require(_0x3aef('0x16'));var hardwareService=require(_0x3aef('0x17'));var logger=require(_0x3aef('0x18'))(_0x3aef('0x19'));var utils=require(_0x3aef('0x1a'));var config=require(_0x3aef('0x1b'));var licenseUtil=require(_0x3aef('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x409ffd,_0x16c72f){_0x16c72f=_0x16c72f||0xcc;return function(_0x5ecaa5){if(_0x5ecaa5){return _0x409ffd[_0x3aef('0x1d')](_0x16c72f);}return _0x409ffd[_0x3aef('0x1e')](_0x16c72f)[_0x3aef('0x1f')]();};}function respondWithResult(_0xd6c179,_0x5c5ef9){_0x5c5ef9=_0x5c5ef9||0xc8;return function(_0x5cc42f){if(_0x5cc42f){return _0xd6c179[_0x3aef('0x1e')](_0x5c5ef9)[_0x3aef('0x20')](_0x5cc42f);}};}function respondWithFilteredResult(_0x322447,_0x5148ca){return function(_0x32aaa4){if(_0x32aaa4){var _0x5550e7=typeof _0x5148ca[_0x3aef('0x21')]==='undefined'&&typeof _0x5148ca[_0x3aef('0x22')]===_0x3aef('0x23');var _0x57760d=_0x32aaa4[_0x3aef('0x24')];var _0x56040b=_0x5550e7?0x0:_0x5148ca['offset'];var _0x1f99ce=_0x5550e7?_0x32aaa4[_0x3aef('0x24')]:_0x5148ca[_0x3aef('0x21')]+_0x5148ca[_0x3aef('0x22')];var _0x1b22d1;if(_0x1f99ce>=_0x57760d){_0x1f99ce=_0x57760d;_0x1b22d1=0xc8;}else{_0x1b22d1=0xce;}_0x322447['status'](_0x1b22d1);return _0x322447['set'](_0x3aef('0x25'),_0x56040b+'-'+_0x1f99ce+'/'+_0x57760d)['json'](_0x32aaa4);}return null;};}function patchUpdates(_0x361123){return function(_0x1f331f){try{jsonpatch[_0x3aef('0x26')](_0x1f331f,_0x361123,!![]);}catch(_0x2cc1c4){return BPromise[_0x3aef('0x27')](_0x2cc1c4);}return _0x1f331f[_0x3aef('0x28')]();};}function saveUpdates(_0x2567dc,_0x2a2bce){return function(_0x3f6a4a){if(_0x3f6a4a){return _0x3f6a4a['update'](_0x2567dc)[_0x3aef('0x29')](function(_0x171e58){return _0x171e58;});}return null;};}function removeEntity(_0xb786aa,_0x39b2ff){return function(_0xd021cd){if(_0xd021cd){return _0xd021cd[_0x3aef('0x2a')]()['then'](function(){var _0x5331eb=_0xd021cd[_0x3aef('0x2b')]({'plain':!![]});var _0x1b9cb7=_0x3aef('0x2c');return db[_0x3aef('0x2d')][_0x3aef('0x2a')]({'where':{'type':_0x1b9cb7,'resourceId':_0x5331eb['id']}})[_0x3aef('0x29')](function(){return _0xd021cd;});})[_0x3aef('0x29')](function(){_0xb786aa[_0x3aef('0x1e')](0xcc)[_0x3aef('0x1f')]();});}};}function handleEntityNotFound(_0x5094c6,_0xdbdb3f){return function(_0x3a86d8){if(!_0x3a86d8){_0x5094c6['sendStatus'](0x194);}return _0x3a86d8;};}function handleError(_0x517e91,_0x40787d){_0x40787d=_0x40787d||0x1f4;return function(_0x28ed76){logger[_0x3aef('0x2e')](_0x28ed76[_0x3aef('0x2f')]);if(_0x28ed76[_0x3aef('0x30')]){delete _0x28ed76[_0x3aef('0x30')];}_0x517e91[_0x3aef('0x1e')](_0x40787d)[_0x3aef('0x31')](_0x28ed76);};}exports[_0x3aef('0x32')]=function(_0x167d44,_0x32d8ba){var _0x9676a6={},_0x57e7d8={},_0x5130d4={'count':0x0,'rows':[]};var _0x41dc68=_[_0x3aef('0x33')](db[_0x3aef('0x34')][_0x3aef('0x35')],function(_0xc61a2e){return{'name':_0xc61a2e[_0x3aef('0x36')],'type':_0xc61a2e[_0x3aef('0x37')][_0x3aef('0x38')]};});_0x57e7d8['model']=_['map'](_0x41dc68,_0x3aef('0x30'));_0x57e7d8[_0x3aef('0x39')]=_[_0x3aef('0x3a')](_0x167d44[_0x3aef('0x39')]);_0x57e7d8['filters']=_[_0x3aef('0x3b')](_0x57e7d8[_0x3aef('0x3c')],_0x57e7d8['query']);_0x9676a6[_0x3aef('0x3d')]=_[_0x3aef('0x3b')](_0x57e7d8['model'],qs[_0x3aef('0x3e')](_0x167d44[_0x3aef('0x39')]['fields']));_0x9676a6[_0x3aef('0x3d')]=_0x9676a6['attributes'][_0x3aef('0x3f')]?_0x9676a6[_0x3aef('0x3d')]:_0x57e7d8[_0x3aef('0x3c')];if(!_0x167d44[_0x3aef('0x39')]['hasOwnProperty'](_0x3aef('0x40'))){_0x9676a6[_0x3aef('0x22')]=qs[_0x3aef('0x22')](_0x167d44['query'][_0x3aef('0x22')]);_0x9676a6[_0x3aef('0x21')]=qs[_0x3aef('0x21')](_0x167d44[_0x3aef('0x39')]['offset']);}_0x9676a6[_0x3aef('0x41')]=qs['sort'](_0x167d44['query'][_0x3aef('0x42')]);delete _0x167d44[_0x3aef('0x39')][_0x3aef('0x42')];_0x9676a6[_0x3aef('0x43')]=qs[_0x3aef('0x44')](_['pick'](_0x167d44['query'],_0x57e7d8[_0x3aef('0x44')]),_0x41dc68);if(_0x167d44[_0x3aef('0x39')][_0x3aef('0x45')]){_0x9676a6[_0x3aef('0x43')]=_[_0x3aef('0x46')](_0x9676a6[_0x3aef('0x43')],{'$or':_['map'](_0x41dc68,function(_0xf5b014){if(_0xf5b014[_0x3aef('0x37')]!==_0x3aef('0x47')){var _0x414cad={};_0x414cad[_0xf5b014[_0x3aef('0x30')]]={'$like':'%'+_0x167d44[_0x3aef('0x39')][_0x3aef('0x45')]+'%'};return _0x414cad;}})});}_0x9676a6=_['merge']({},_0x9676a6,_0x167d44[_0x3aef('0x48')]);var _0x4a7bff={'where':_0x9676a6[_0x3aef('0x43')]};return db['VoiceMusicOnHold'][_0x3aef('0x24')](_0x4a7bff)[_0x3aef('0x29')](function(_0x44957b){_0x5130d4[_0x3aef('0x24')]=_0x44957b;if(_0x167d44[_0x3aef('0x39')][_0x3aef('0x49')]){_0x9676a6[_0x3aef('0x4a')]=[{'all':!![]}];}return db[_0x3aef('0x34')][_0x3aef('0x4b')](_0x9676a6);})[_0x3aef('0x29')](function(_0x221fbf){_0x5130d4[_0x3aef('0x4c')]=_0x221fbf;return _0x5130d4;})[_0x3aef('0x29')](respondWithFilteredResult(_0x32d8ba,_0x9676a6))['catch'](handleError(_0x32d8ba,null));};exports[_0x3aef('0x4d')]=function(_0x3295e6,_0x4b9905){var _0x5abebb={'raw':![],'where':{'id':_0x3295e6[_0x3aef('0x4e')]['id']}},_0x3c6e2c={};_0x3c6e2c[_0x3aef('0x3c')]=_['keys'](db['VoiceMusicOnHold'][_0x3aef('0x35')]);_0x3c6e2c[_0x3aef('0x39')]=_['keys'](_0x3295e6[_0x3aef('0x39')]);_0x3c6e2c[_0x3aef('0x44')]=_[_0x3aef('0x3b')](_0x3c6e2c['model'],_0x3c6e2c[_0x3aef('0x39')]);_0x5abebb[_0x3aef('0x3d')]=_[_0x3aef('0x3b')](_0x3c6e2c['model'],qs[_0x3aef('0x3e')](_0x3295e6[_0x3aef('0x39')]['fields']));_0x5abebb[_0x3aef('0x3d')]=_0x5abebb[_0x3aef('0x3d')][_0x3aef('0x3f')]?_0x5abebb[_0x3aef('0x3d')]:_0x3c6e2c[_0x3aef('0x3c')];if(_0x3295e6[_0x3aef('0x39')][_0x3aef('0x49')]){_0x5abebb[_0x3aef('0x4a')]=[{'all':!![]}];}_0x5abebb=_[_0x3aef('0x46')]({},_0x5abebb,_0x3295e6[_0x3aef('0x48')]);return db[_0x3aef('0x34')][_0x3aef('0x4f')](_0x5abebb)[_0x3aef('0x29')](handleEntityNotFound(_0x4b9905,null))['then'](respondWithResult(_0x4b9905,null))[_0x3aef('0x50')](handleError(_0x4b9905,null));};exports[_0x3aef('0x51')]=function(_0x46283,_0x211016){if(_0x46283[_0x3aef('0x52')]['id']){delete _0x46283[_0x3aef('0x52')]['id'];}return db['VoiceMusicOnHold'][_0x3aef('0x4f')]({'where':{'id':_0x46283[_0x3aef('0x4e')]['id']}})['then'](handleEntityNotFound(_0x211016,null))['then'](saveUpdates(_0x46283[_0x3aef('0x52')],null))[_0x3aef('0x29')](respondWithResult(_0x211016,null))[_0x3aef('0x50')](handleError(_0x211016,null));};exports['create']=function(_0x3716c6,_0x156e79,_0x512934){return db['sequelize'][_0x3aef('0x53')](function(_0xeb8ac){if(_0x3716c6[_0x3aef('0x52')][_0x3aef('0x54')]===_0x3aef('0x55')){_0x3716c6['body'][_0x3aef('0x56')]=path[_0x3aef('0x57')](config[_0x3aef('0x58')],_0x3aef('0x59'),_0x3716c6[_0x3aef('0x52')]['name']);}return db['VoiceMusicOnHold'][_0x3aef('0x5a')](_0x3716c6[_0x3aef('0x52')],{'transaction':_0xeb8ac})[_0x3aef('0x29')](function(_0x582e57){if(_0x3716c6['body']['mode']==='files'){fs[_0x3aef('0x5b')](_0x582e57['directory'],parseInt(_0x3aef('0x5c'),0x8));}var _0x4c8258=_0x3716c6[_0x3aef('0x5d')]['get']({'plain':!![]});if(!_0x4c8258)throw new Error(_0x3aef('0x5e'));if(_0x4c8258[_0x3aef('0x5f')]==='user'){var _0x21773a=_0x582e57['get']({'plain':!![]});return db['UserProfileSection'][_0x3aef('0x4f')]({'where':{'name':_0x3aef('0x2c'),'userProfileId':_0x4c8258[_0x3aef('0x60')]},'raw':!![]})[_0x3aef('0x29')](function(_0x3fe20b){if(_0x3fe20b&&_0x3fe20b[_0x3aef('0x61')]===0x0){return db[_0x3aef('0x2d')]['create']({'name':_0x21773a[_0x3aef('0x30')],'resourceId':_0x21773a['id'],'type':_0x3fe20b[_0x3aef('0x30')],'sectionId':_0x3fe20b['id']},{})['then'](function(){return _0x582e57;});}else{return _0x582e57;}})[_0x3aef('0x50')](function(_0x301017){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x301017);});}return _0x582e57;});})[_0x3aef('0x29')](respondWithResult(_0x156e79,0xc9))[_0x3aef('0x50')](handleError(_0x156e79,null));};exports[_0x3aef('0x2a')]=function(_0x46d29f,_0x4e62bc,_0x295b9d){var _0x1e90b7;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x46d29f[_0x3aef('0x4e')]['id']}})[_0x3aef('0x29')](function(_0x2b7be0){if(_0x2b7be0){return db[_0x3aef('0x62')][_0x3aef('0x53')](function(_0x4a0aee){return _0x2b7be0[_0x3aef('0x2a')]({'transaction':_0x4a0aee,'raw':!![]})[_0x3aef('0x29')](function(_0x2b73e1){if(_0x2b73e1['directory']){fs[_0x3aef('0x63')](_0x2b73e1[_0x3aef('0x56')])['forEach'](function(_0x26f6c1){fs[_0x3aef('0x64')](path[_0x3aef('0x57')](_0x2b73e1[_0x3aef('0x56')],_0x26f6c1));});fs['rmdirSync'](_0x2b73e1[_0x3aef('0x56')]);}return _0x2b73e1;});})['catch'](function(_0x52b1d7){throw new db[(_0x3aef('0x65'))]['ValidationError'](_0x52b1d7[_0x3aef('0x66')]);});}})['then'](handleEntityNotFound(_0x4e62bc,null))[_0x3aef('0x29')](removeEntity(_0x4e62bc,null))[_0x3aef('0x50')](handleError(_0x4e62bc,null));};exports['addSound']=function(_0x48b59e,_0x44b90e,_0x3cac35){return db[_0x3aef('0x62')][_0x3aef('0x53')](function(_0x5ce101){var _0x16160e;return db[_0x3aef('0x34')][_0x3aef('0x4f')]({'where':{'id':_0x48b59e[_0x3aef('0x4e')]['id']}})[_0x3aef('0x29')](function(_0x59ff8c){if(_0x59ff8c){_0x16160e=_0x59ff8c;return _0x59ff8c['addSound'](_0x48b59e[_0x3aef('0x52')]['id'],{'transaction':_0x5ce101});}})['then'](function(_0x33b663){if(_0x33b663){return db[_0x3aef('0x67')]['findOne']({'where':{'id':_0x48b59e[_0x3aef('0x52')]['id']},'attributes':['id',_0x3aef('0x30'),_0x3aef('0x68'),'converted_format','createdAt'],'raw':!![]});}})[_0x3aef('0x29')](function(_0x3d12e5){if(_0x3d12e5){var _0x40db01=path['join'](config[_0x3aef('0x58')],'server/files/sounds/converted',util[_0x3aef('0x69')](_0x3aef('0x6a'),path[_0x3aef('0x6b')](_0x3d12e5[_0x3aef('0x68')],path[_0x3aef('0x6c')](_0x3d12e5[_0x3aef('0x68')])),_0x3d12e5[_0x3aef('0x6d')]));var _0x2c97b5=path[_0x3aef('0x57')](config[_0x3aef('0x58')],_0x3aef('0x59'),_0x16160e[_0x3aef('0x30')],util['format'](_0x3aef('0x6a'),_0x3d12e5[_0x3aef('0x30')],_0x3d12e5[_0x3aef('0x6d')]));fs[_0x3aef('0x6e')](_0x40db01,_0x2c97b5);return _0x3d12e5;}})['catch'](function(_0x32531a){throw new db['Sequelize'][(_0x3aef('0x6f'))](_0x32531a[_0x3aef('0x66')]);});})[_0x3aef('0x29')](handleEntityNotFound(_0x44b90e,null))[_0x3aef('0x29')](respondWithResult(_0x44b90e,0xc9))['catch'](handleError(_0x44b90e,null));};exports[_0x3aef('0x70')]=function(_0x439a4d,_0x5f45fe,_0x373563){return db['sequelize'][_0x3aef('0x53')](function(_0xf8d79a){var _0x539a8c;return db['VoiceMusicOnHold'][_0x3aef('0x71')]({'where':{'id':_0x439a4d['params']['id']}})[_0x3aef('0x29')](handleEntityNotFound(_0x5f45fe,null))['then'](function(_0x3b84a2){if(_0x3b84a2){_0x539a8c=_0x3b84a2;return _0x3b84a2[_0x3aef('0x70')](_0x439a4d[_0x3aef('0x4e')][_0x3aef('0x72')]);}})[_0x3aef('0x29')](function(_0x57ffc5){if(_0x57ffc5){return db['Sound']['findOne']({'where':{'id':_0x439a4d[_0x3aef('0x4e')][_0x3aef('0x72')]},'attributes':['id',_0x3aef('0x30'),_0x3aef('0x68'),_0x3aef('0x6d'),_0x3aef('0x73')],'raw':!![]});}})['then'](function(_0x42526e){if(_0x42526e){fs['unlinkSync'](path[_0x3aef('0x57')](_0x539a8c[_0x3aef('0x56')],util[_0x3aef('0x69')](_0x3aef('0x6a'),_0x42526e['name'],_0x42526e[_0x3aef('0x6d')])));return _0x42526e;}})['catch'](function(_0x57a0f4){throw new db['Sequelize'][(_0x3aef('0x6f'))](_0x57a0f4['message']);});})[_0x3aef('0x29')](handleEntityNotFound(_0x5f45fe,null))[_0x3aef('0x29')](respondWithStatusCode(_0x5f45fe,0xcc))[_0x3aef('0x50')](handleError(_0x5f45fe,null));};exports['getSounds']=function(_0x6686a4,_0x2b4fa7,_0x17b66a){var _0x12e89a={};var _0x248bba={};var _0x1ac48c;var _0x4a9081;return db[_0x3aef('0x34')][_0x3aef('0x71')]({'where':{'id':_0x6686a4[_0x3aef('0x4e')]['id']}})[_0x3aef('0x29')](handleEntityNotFound(_0x2b4fa7,null))['then'](function(_0x458178){if(_0x458178){_0x1ac48c=_0x458178;_0x248bba[_0x3aef('0x3c')]=_[_0x3aef('0x3a')](db[_0x3aef('0x67')][_0x3aef('0x35')]);_0x248bba[_0x3aef('0x39')]=_['keys'](_0x6686a4[_0x3aef('0x39')]);_0x248bba['filters']=_['intersection'](_0x248bba[_0x3aef('0x3c')],_0x248bba[_0x3aef('0x39')]);_0x12e89a['attributes']=_[_0x3aef('0x3b')](_0x248bba[_0x3aef('0x3c')],qs[_0x3aef('0x3e')](_0x6686a4[_0x3aef('0x39')][_0x3aef('0x3e')]));_0x12e89a[_0x3aef('0x3d')]=_0x12e89a[_0x3aef('0x3d')][_0x3aef('0x3f')]?_0x12e89a[_0x3aef('0x3d')]:_0x248bba[_0x3aef('0x3c')];_0x12e89a[_0x3aef('0x41')]=qs[_0x3aef('0x42')](_0x6686a4['query'][_0x3aef('0x42')]);_0x12e89a['where']=qs[_0x3aef('0x44')](_[_0x3aef('0x74')](_0x6686a4[_0x3aef('0x39')],_0x248bba[_0x3aef('0x44')]));if(_0x6686a4[_0x3aef('0x39')][_0x3aef('0x45')]){_0x12e89a['where']=_[_0x3aef('0x46')](_0x12e89a[_0x3aef('0x43')],{'$or':_[_0x3aef('0x33')](_0x12e89a['attributes'],function(_0x4f10ae){var _0xd8bfa5={};_0xd8bfa5[_0x4f10ae]={'$like':'%'+_0x6686a4[_0x3aef('0x39')]['filter']+'%'};return _0xd8bfa5;})});}_0x12e89a=_['merge']({},_0x12e89a,_0x6686a4[_0x3aef('0x48')]);return _0x1ac48c[_0x3aef('0x75')](_0x12e89a);}})['then'](function(_0x398686){if(_0x398686){_0x4a9081=_0x398686['length'];if(!_0x6686a4[_0x3aef('0x39')][_0x3aef('0x76')](_0x3aef('0x40'))){_0x12e89a[_0x3aef('0x22')]=qs[_0x3aef('0x22')](_0x6686a4[_0x3aef('0x39')][_0x3aef('0x22')]);_0x12e89a[_0x3aef('0x21')]=qs[_0x3aef('0x21')](_0x6686a4[_0x3aef('0x39')][_0x3aef('0x21')]);}return _0x1ac48c[_0x3aef('0x75')](_0x12e89a);}})['then'](function(_0x5686b7){if(_0x5686b7){return _0x5686b7?{'count':_0x4a9081,'rows':_0x5686b7}:null;}})[_0x3aef('0x29')](respondWithResult(_0x2b4fa7,null))['catch'](handleError(_0x2b4fa7,null));}; \ No newline at end of file +var _0x8967=['basename','extname','format','symlinkSync','Sequelize','removeSound','id2','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','sendStatus','error','name','send','map','VoiceMusicOnHold','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','options','includeAll','findAll','rows','params','rawAttributes','include','find','catch','body','mode','files','directory','join','root','server/files/moh','create','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','sequelize','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s'];(function(_0x668b56,_0x3798da){var _0x537529=function(_0x374874){while(--_0x374874){_0x668b56['push'](_0x668b56['shift']());}};_0x537529(++_0x3798da);}(_0x8967,0x1d8));var _0x7896=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x8967[_0x3f5dca];return _0x5b833a;};'use strict';var emlformat=require(_0x7896('0x0'));var rimraf=require(_0x7896('0x1'));var zipdir=require(_0x7896('0x2'));var jsonpatch=require(_0x7896('0x3'));var rp=require(_0x7896('0x4'));var moment=require(_0x7896('0x5'));var BPromise=require(_0x7896('0x6'));var Mustache=require(_0x7896('0x7'));var util=require('util');var path=require(_0x7896('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7896('0x9'));var fs=require('fs');var fs_extra=require(_0x7896('0xa'));var _=require(_0x7896('0xb'));var squel=require(_0x7896('0xc'));var crypto=require(_0x7896('0xd'));var jsforce=require(_0x7896('0xe'));var deskjs=require(_0x7896('0xf'));var toCsv=require(_0x7896('0x10'));var querystring=require(_0x7896('0x11'));var Papa=require('papaparse');var Redis=require(_0x7896('0x12'));var authService=require(_0x7896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7896('0x14'));var hardwareService=require(_0x7896('0x15'));var logger=require(_0x7896('0x16'))(_0x7896('0x17'));var utils=require(_0x7896('0x18'));var config=require(_0x7896('0x19'));var licenseUtil=require(_0x7896('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a7caa,_0x29505c){_0x29505c=_0x29505c||0xcc;return function(_0x2db94a){if(_0x2db94a){return _0x2a7caa['sendStatus'](_0x29505c);}return _0x2a7caa[_0x7896('0x1b')](_0x29505c)[_0x7896('0x1c')]();};}function respondWithResult(_0x3d42ce,_0x31ed0e){_0x31ed0e=_0x31ed0e||0xc8;return function(_0x129f5d){if(_0x129f5d){return _0x3d42ce[_0x7896('0x1b')](_0x31ed0e)[_0x7896('0x1d')](_0x129f5d);}};}function respondWithFilteredResult(_0x1fba04,_0x2b4c98){return function(_0x2725cd){if(_0x2725cd){var _0x2847a8=typeof _0x2b4c98[_0x7896('0x1e')]==='undefined'&&typeof _0x2b4c98[_0x7896('0x1f')]===_0x7896('0x20');var _0x44bd19=_0x2725cd['count'];var _0x4b4dc7=_0x2847a8?0x0:_0x2b4c98[_0x7896('0x1e')];var _0x529822=_0x2847a8?_0x2725cd[_0x7896('0x21')]:_0x2b4c98[_0x7896('0x1e')]+_0x2b4c98[_0x7896('0x1f')];var _0x170da6;if(_0x529822>=_0x44bd19){_0x529822=_0x44bd19;_0x170da6=0xc8;}else{_0x170da6=0xce;}_0x1fba04['status'](_0x170da6);return _0x1fba04[_0x7896('0x22')](_0x7896('0x23'),_0x4b4dc7+'-'+_0x529822+'/'+_0x44bd19)['json'](_0x2725cd);}return null;};}function patchUpdates(_0x4b7585){return function(_0x5cf194){try{jsonpatch[_0x7896('0x24')](_0x5cf194,_0x4b7585,!![]);}catch(_0x82fe9a){return BPromise[_0x7896('0x25')](_0x82fe9a);}return _0x5cf194[_0x7896('0x26')]();};}function saveUpdates(_0x24b2d4,_0x1894c3){return function(_0x2b450b){if(_0x2b450b){return _0x2b450b[_0x7896('0x27')](_0x24b2d4)[_0x7896('0x28')](function(_0xe0a0aa){return _0xe0a0aa;});}return null;};}function removeEntity(_0x338a0d,_0x2cdf2a){return function(_0x531c91){if(_0x531c91){return _0x531c91['destroy']()[_0x7896('0x28')](function(){var _0x278697=_0x531c91[_0x7896('0x29')]({'plain':!![]});var _0xc9395a=_0x7896('0x2a');return db[_0x7896('0x2b')][_0x7896('0x2c')]({'where':{'type':_0xc9395a,'resourceId':_0x278697['id']}})[_0x7896('0x28')](function(){return _0x531c91;});})[_0x7896('0x28')](function(){_0x338a0d['status'](0xcc)[_0x7896('0x1c')]();});}};}function handleEntityNotFound(_0x2f9e74,_0x1dbf79){return function(_0x83390d){if(!_0x83390d){_0x2f9e74[_0x7896('0x2d')](0x194);}return _0x83390d;};}function handleError(_0x1c6422,_0x472479){_0x472479=_0x472479||0x1f4;return function(_0x1d0c37){logger[_0x7896('0x2e')](_0x1d0c37['stack']);if(_0x1d0c37['name']){delete _0x1d0c37[_0x7896('0x2f')];}_0x1c6422['status'](_0x472479)[_0x7896('0x30')](_0x1d0c37);};}exports['index']=function(_0x3f2b58,_0x40a48b){var _0x19607a={},_0x304609={},_0x1d17af={'count':0x0,'rows':[]};var _0x57a1f1=_[_0x7896('0x31')](db[_0x7896('0x32')]['rawAttributes'],function(_0x92fac2){return{'name':_0x92fac2['fieldName'],'type':_0x92fac2['type'][_0x7896('0x33')]};});_0x304609[_0x7896('0x34')]=_[_0x7896('0x31')](_0x57a1f1,_0x7896('0x2f'));_0x304609[_0x7896('0x35')]=_[_0x7896('0x36')](_0x3f2b58['query']);_0x304609['filters']=_[_0x7896('0x37')](_0x304609['model'],_0x304609[_0x7896('0x35')]);_0x19607a[_0x7896('0x38')]=_[_0x7896('0x37')](_0x304609[_0x7896('0x34')],qs['fields'](_0x3f2b58[_0x7896('0x35')][_0x7896('0x39')]));_0x19607a[_0x7896('0x38')]=_0x19607a['attributes'][_0x7896('0x3a')]?_0x19607a[_0x7896('0x38')]:_0x304609[_0x7896('0x34')];if(!_0x3f2b58[_0x7896('0x35')][_0x7896('0x3b')](_0x7896('0x3c'))){_0x19607a[_0x7896('0x1f')]=qs[_0x7896('0x1f')](_0x3f2b58[_0x7896('0x35')][_0x7896('0x1f')]);_0x19607a['offset']=qs[_0x7896('0x1e')](_0x3f2b58[_0x7896('0x35')][_0x7896('0x1e')]);}_0x19607a[_0x7896('0x3d')]=qs[_0x7896('0x3e')](_0x3f2b58['query'][_0x7896('0x3e')]);delete _0x3f2b58['query'][_0x7896('0x3e')];_0x19607a[_0x7896('0x3f')]=qs[_0x7896('0x40')](_[_0x7896('0x41')](_0x3f2b58[_0x7896('0x35')],_0x304609[_0x7896('0x40')]),_0x57a1f1);if(_0x3f2b58['query']['filter']){_0x19607a['where']=_[_0x7896('0x42')](_0x19607a[_0x7896('0x3f')],{'$or':_['map'](_0x57a1f1,function(_0x4f64b5){if(_0x4f64b5[_0x7896('0x43')]!=='VIRTUAL'){var _0x111eea={};_0x111eea[_0x4f64b5[_0x7896('0x2f')]]={'$like':'%'+_0x3f2b58[_0x7896('0x35')][_0x7896('0x44')]+'%'};return _0x111eea;}})});}_0x19607a=_[_0x7896('0x42')]({},_0x19607a,_0x3f2b58[_0x7896('0x45')]);var _0xa38e9a={'where':_0x19607a[_0x7896('0x3f')]};return db[_0x7896('0x32')][_0x7896('0x21')](_0xa38e9a)[_0x7896('0x28')](function(_0x595d0e){_0x1d17af[_0x7896('0x21')]=_0x595d0e;if(_0x3f2b58[_0x7896('0x35')][_0x7896('0x46')]){_0x19607a['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x7896('0x47')](_0x19607a);})[_0x7896('0x28')](function(_0x19b38c){_0x1d17af[_0x7896('0x48')]=_0x19b38c;return _0x1d17af;})[_0x7896('0x28')](respondWithFilteredResult(_0x40a48b,_0x19607a))['catch'](handleError(_0x40a48b,null));};exports['show']=function(_0x421b02,_0x3e1175){var _0x4fde3d={'raw':![],'where':{'id':_0x421b02[_0x7896('0x49')]['id']}},_0xdef87f={};_0xdef87f[_0x7896('0x34')]=_[_0x7896('0x36')](db[_0x7896('0x32')][_0x7896('0x4a')]);_0xdef87f[_0x7896('0x35')]=_['keys'](_0x421b02[_0x7896('0x35')]);_0xdef87f['filters']=_[_0x7896('0x37')](_0xdef87f[_0x7896('0x34')],_0xdef87f[_0x7896('0x35')]);_0x4fde3d[_0x7896('0x38')]=_['intersection'](_0xdef87f[_0x7896('0x34')],qs[_0x7896('0x39')](_0x421b02[_0x7896('0x35')]['fields']));_0x4fde3d[_0x7896('0x38')]=_0x4fde3d[_0x7896('0x38')][_0x7896('0x3a')]?_0x4fde3d[_0x7896('0x38')]:_0xdef87f[_0x7896('0x34')];if(_0x421b02['query'][_0x7896('0x46')]){_0x4fde3d[_0x7896('0x4b')]=[{'all':!![]}];}_0x4fde3d=_[_0x7896('0x42')]({},_0x4fde3d,_0x421b02['options']);return db[_0x7896('0x32')][_0x7896('0x4c')](_0x4fde3d)['then'](handleEntityNotFound(_0x3e1175,null))[_0x7896('0x28')](respondWithResult(_0x3e1175,null))[_0x7896('0x4d')](handleError(_0x3e1175,null));};exports[_0x7896('0x27')]=function(_0x5762e9,_0xe66fcb){if(_0x5762e9[_0x7896('0x4e')]['id']){delete _0x5762e9[_0x7896('0x4e')]['id'];}return db[_0x7896('0x32')][_0x7896('0x4c')]({'where':{'id':_0x5762e9[_0x7896('0x49')]['id']}})[_0x7896('0x28')](handleEntityNotFound(_0xe66fcb,null))['then'](saveUpdates(_0x5762e9['body'],null))[_0x7896('0x28')](respondWithResult(_0xe66fcb,null))[_0x7896('0x4d')](handleError(_0xe66fcb,null));};exports['create']=function(_0x2106a0,_0x5709eb,_0x5cf8d8){return db['sequelize']['transaction'](function(_0x47b653){if(_0x2106a0[_0x7896('0x4e')][_0x7896('0x4f')]===_0x7896('0x50')){_0x2106a0[_0x7896('0x4e')][_0x7896('0x51')]=path[_0x7896('0x52')](config[_0x7896('0x53')],_0x7896('0x54'),_0x2106a0[_0x7896('0x4e')][_0x7896('0x2f')]);}return db[_0x7896('0x32')][_0x7896('0x55')](_0x2106a0[_0x7896('0x4e')],{'transaction':_0x47b653})[_0x7896('0x28')](function(_0x44d816){if(_0x2106a0[_0x7896('0x4e')][_0x7896('0x4f')]==='files'){fs[_0x7896('0x56')](_0x44d816[_0x7896('0x51')],parseInt(_0x7896('0x57'),0x8));}var _0x576b90=_0x2106a0[_0x7896('0x58')][_0x7896('0x29')]({'plain':!![]});if(!_0x576b90)throw new Error(_0x7896('0x59'));if(_0x576b90[_0x7896('0x5a')]===_0x7896('0x58')){var _0x29490d=_0x44d816[_0x7896('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x7896('0x4c')]({'where':{'name':_0x7896('0x2a'),'userProfileId':_0x576b90['userProfileId']},'raw':!![]})['then'](function(_0x5a5800){if(_0x5a5800&&_0x5a5800['autoAssociation']===0x0){return db[_0x7896('0x2b')][_0x7896('0x55')]({'name':_0x29490d[_0x7896('0x2f')],'resourceId':_0x29490d['id'],'type':_0x5a5800['name'],'sectionId':_0x5a5800['id']},{})[_0x7896('0x28')](function(){return _0x44d816;});}else{return _0x44d816;}})[_0x7896('0x4d')](function(_0x74edbe){logger['error'](_0x7896('0x5b'),_0x74edbe);});}return _0x44d816;});})[_0x7896('0x28')](respondWithResult(_0x5709eb,0xc9))['catch'](handleError(_0x5709eb,null));};exports[_0x7896('0x2c')]=function(_0x37eeda,_0x307f32,_0x27f2b0){var _0x5cfadc;return db[_0x7896('0x32')][_0x7896('0x4c')]({'where':{'id':_0x37eeda[_0x7896('0x49')]['id']}})[_0x7896('0x28')](function(_0x4da9de){if(_0x4da9de){return db['sequelize'][_0x7896('0x5c')](function(_0x6c6e39){return _0x4da9de[_0x7896('0x2c')]({'transaction':_0x6c6e39,'raw':!![]})[_0x7896('0x28')](function(_0x232d5f){if(_0x232d5f['directory']){fs[_0x7896('0x5d')](_0x232d5f['directory'])[_0x7896('0x5e')](function(_0x121b75){fs[_0x7896('0x5f')](path[_0x7896('0x52')](_0x232d5f[_0x7896('0x51')],_0x121b75));});fs[_0x7896('0x60')](_0x232d5f[_0x7896('0x51')]);}return _0x232d5f;});})[_0x7896('0x4d')](function(_0x14e2c4){throw new db['Sequelize'][(_0x7896('0x61'))](_0x14e2c4[_0x7896('0x62')]);});}})[_0x7896('0x28')](handleEntityNotFound(_0x307f32,null))[_0x7896('0x28')](removeEntity(_0x307f32,null))['catch'](handleError(_0x307f32,null));};exports[_0x7896('0x63')]=function(_0xc10da8,_0x21df86,_0x3c9a6f){return db[_0x7896('0x64')]['transaction'](function(_0x5d2f69){var _0x4b5408;return db[_0x7896('0x32')][_0x7896('0x4c')]({'where':{'id':_0xc10da8[_0x7896('0x49')]['id']}})[_0x7896('0x28')](function(_0x566c69){if(_0x566c69){_0x4b5408=_0x566c69;return _0x566c69[_0x7896('0x63')](_0xc10da8[_0x7896('0x4e')]['id'],{'transaction':_0x5d2f69});}})[_0x7896('0x28')](function(_0x128f8f){if(_0x128f8f){return db[_0x7896('0x65')][_0x7896('0x66')]({'where':{'id':_0xc10da8[_0x7896('0x4e')]['id']},'attributes':['id',_0x7896('0x2f'),_0x7896('0x67'),_0x7896('0x68'),_0x7896('0x69')],'raw':!![]});}})['then'](function(_0x21707c){if(_0x21707c){var _0x165a00=path[_0x7896('0x52')](config[_0x7896('0x53')],_0x7896('0x6a'),util['format'](_0x7896('0x6b'),path[_0x7896('0x6c')](_0x21707c[_0x7896('0x67')],path[_0x7896('0x6d')](_0x21707c[_0x7896('0x67')])),_0x21707c[_0x7896('0x68')]));var _0x5302d9=path[_0x7896('0x52')](config[_0x7896('0x53')],_0x7896('0x54'),_0x4b5408[_0x7896('0x2f')],util[_0x7896('0x6e')](_0x7896('0x6b'),_0x21707c[_0x7896('0x2f')],_0x21707c[_0x7896('0x68')]));fs[_0x7896('0x6f')](_0x165a00,_0x5302d9);return _0x21707c;}})[_0x7896('0x4d')](function(_0x2ec3fa){throw new db[(_0x7896('0x70'))][(_0x7896('0x61'))](_0x2ec3fa[_0x7896('0x62')]);});})[_0x7896('0x28')](handleEntityNotFound(_0x21df86,null))[_0x7896('0x28')](respondWithResult(_0x21df86,0xc9))['catch'](handleError(_0x21df86,null));};exports['removeSound']=function(_0x150d3f,_0x29d68d,_0x45d7aa){return db[_0x7896('0x64')][_0x7896('0x5c')](function(_0x3f205e){var _0x53e389;return db[_0x7896('0x32')][_0x7896('0x66')]({'where':{'id':_0x150d3f['params']['id']}})[_0x7896('0x28')](handleEntityNotFound(_0x29d68d,null))[_0x7896('0x28')](function(_0x5251c7){if(_0x5251c7){_0x53e389=_0x5251c7;return _0x5251c7[_0x7896('0x71')](_0x150d3f[_0x7896('0x49')][_0x7896('0x72')]);}})[_0x7896('0x28')](function(_0x5b0454){if(_0x5b0454){return db[_0x7896('0x65')][_0x7896('0x66')]({'where':{'id':_0x150d3f[_0x7896('0x49')][_0x7896('0x72')]},'attributes':['id',_0x7896('0x2f'),_0x7896('0x67'),_0x7896('0x68'),_0x7896('0x69')],'raw':!![]});}})[_0x7896('0x28')](function(_0x4f41e6){if(_0x4f41e6){fs['unlinkSync'](path['join'](_0x53e389[_0x7896('0x51')],util['format'](_0x7896('0x6b'),_0x4f41e6[_0x7896('0x2f')],_0x4f41e6[_0x7896('0x68')])));return _0x4f41e6;}})[_0x7896('0x4d')](function(_0x384b62){throw new db[(_0x7896('0x70'))][(_0x7896('0x61'))](_0x384b62[_0x7896('0x62')]);});})['then'](handleEntityNotFound(_0x29d68d,null))['then'](respondWithStatusCode(_0x29d68d,0xcc))[_0x7896('0x4d')](handleError(_0x29d68d,null));};exports[_0x7896('0x73')]=function(_0x4ea455,_0x495c41,_0xd8b4ae){var _0x57019e={};var _0x5c7ebc={};var _0x4313c7;var _0x60b63e;return db[_0x7896('0x32')]['findOne']({'where':{'id':_0x4ea455['params']['id']}})['then'](handleEntityNotFound(_0x495c41,null))[_0x7896('0x28')](function(_0x27579e){if(_0x27579e){_0x4313c7=_0x27579e;_0x5c7ebc[_0x7896('0x34')]=_[_0x7896('0x36')](db['Sound']['rawAttributes']);_0x5c7ebc[_0x7896('0x35')]=_['keys'](_0x4ea455[_0x7896('0x35')]);_0x5c7ebc['filters']=_['intersection'](_0x5c7ebc[_0x7896('0x34')],_0x5c7ebc[_0x7896('0x35')]);_0x57019e[_0x7896('0x38')]=_[_0x7896('0x37')](_0x5c7ebc['model'],qs[_0x7896('0x39')](_0x4ea455[_0x7896('0x35')][_0x7896('0x39')]));_0x57019e[_0x7896('0x38')]=_0x57019e[_0x7896('0x38')][_0x7896('0x3a')]?_0x57019e[_0x7896('0x38')]:_0x5c7ebc[_0x7896('0x34')];_0x57019e[_0x7896('0x3d')]=qs[_0x7896('0x3e')](_0x4ea455[_0x7896('0x35')][_0x7896('0x3e')]);_0x57019e[_0x7896('0x3f')]=qs[_0x7896('0x40')](_[_0x7896('0x41')](_0x4ea455[_0x7896('0x35')],_0x5c7ebc[_0x7896('0x40')]));if(_0x4ea455[_0x7896('0x35')][_0x7896('0x44')]){_0x57019e[_0x7896('0x3f')]=_[_0x7896('0x42')](_0x57019e[_0x7896('0x3f')],{'$or':_[_0x7896('0x31')](_0x57019e['attributes'],function(_0x1590c9){var _0x559b6c={};_0x559b6c[_0x1590c9]={'$like':'%'+_0x4ea455['query'][_0x7896('0x44')]+'%'};return _0x559b6c;})});}_0x57019e=_[_0x7896('0x42')]({},_0x57019e,_0x4ea455[_0x7896('0x45')]);return _0x4313c7[_0x7896('0x73')](_0x57019e);}})[_0x7896('0x28')](function(_0x5112bf){if(_0x5112bf){_0x60b63e=_0x5112bf[_0x7896('0x3a')];if(!_0x4ea455[_0x7896('0x35')][_0x7896('0x3b')](_0x7896('0x3c'))){_0x57019e[_0x7896('0x1f')]=qs[_0x7896('0x1f')](_0x4ea455['query'][_0x7896('0x1f')]);_0x57019e[_0x7896('0x1e')]=qs['offset'](_0x4ea455['query']['offset']);}return _0x4313c7['getSounds'](_0x57019e);}})['then'](function(_0x4a949f){if(_0x4a949f){return _0x4a949f?{'count':_0x60b63e,'rows':_0x4a949f}:null;}})[_0x7896('0x28')](respondWithResult(_0x495c41,null))['catch'](handleError(_0x495c41,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 51aa3fa..40273f4 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 _0xba3c=['./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','lodash','util','api','moment','path','../../config/environment'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xba3c,0xae));var _0xcba3=function(_0x158928,_0x5e50af){_0x158928=_0x158928-0x0;var _0xaaeaa1=_0xba3c[_0x158928];return _0xaaeaa1;};'use strict';var _=require(_0xcba3('0x0'));var util=require(_0xcba3('0x1'));var logger=require('../../config/logger')(_0xcba3('0x2'));var moment=require(_0xcba3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcba3('0x4'));var rimraf=require('rimraf');var config=require(_0xcba3('0x5'));var attributes=require(_0xcba3('0x6'));module[_0xcba3('0x7')]=function(_0x17fe3c,_0x2ea9e9){return _0x17fe3c['define'](_0xcba3('0x8'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92b3=['define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x547726,_0xd10e2a){var _0x3dfc8d=function(_0x5f4e2d){while(--_0x5f4e2d){_0x547726['push'](_0x547726['shift']());}};_0x3dfc8d(++_0xd10e2a);}(_0x92b3,0x9f));var _0x392b=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x92b3[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x392b('0x0'));var util=require(_0x392b('0x1'));var logger=require(_0x392b('0x2'))(_0x392b('0x3'));var moment=require(_0x392b('0x4'));var BPromise=require(_0x392b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x392b('0x6'));var rimraf=require(_0x392b('0x7'));var config=require(_0x392b('0x8'));var attributes=require(_0x392b('0x9'));module['exports']=function(_0x1cea59,_0x2cb56f){return _0x1cea59[_0x392b('0xa')](_0x392b('0xb'),attributes,{'tableName':_0x392b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 9b9bade..bd0d702 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1da97f,_0x5c73c8){var _0x444d51=function(_0x547987){while(--_0x547987){_0x1da97f['push'](_0x1da97f['shift']());}};_0x444d51(++_0x5c73c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x3e2709,_0x25d74e){var _0x125068=function(_0x2c8992){while(--_0x2c8992){_0x3e2709['push'](_0x3e2709['shift']());}};_0x125068(++_0x25d74e);}(_0xedd9,0xfc));var _0x9edd=function(_0x370281,_0x50b615){_0x370281=_0x370281-0x0;var _0x33a7ae=_0xedd9[_0x370281];return _0x33a7ae;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index f9ba2f9..1edfeed 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 _0xab33=['put','update','delete','destroy','removeTeams','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents'];(function(_0x51979e,_0x239714){var _0x327356=function(_0x2fff28){while(--_0x2fff28){_0x51979e['push'](_0x51979e['shift']());}};_0x327356(++_0x239714);}(_0xab33,0x1a3));var _0x3ab3=function(_0x41aab8,_0x2c74fe){_0x41aab8=_0x41aab8-0x0;var _0x5d9077=_0xab33[_0x41aab8];return _0x5d9077;};'use strict';var multer=require('multer');var util=require(_0x3ab3('0x0'));var path=require(_0x3ab3('0x1'));var timeout=require('connect-timeout');var express=require(_0x3ab3('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3ab3('0x3'));var interaction=require(_0x3ab3('0x4'));var config=require(_0x3ab3('0x5'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x3ab3('0x6')](),controller['index']);router[_0x3ab3('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x3ab3('0x8')]);router[_0x3ab3('0x7')](_0x3ab3('0x9'),auth[_0x3ab3('0x6')](),controller[_0x3ab3('0xa')]);router[_0x3ab3('0x7')](_0x3ab3('0xb'),auth['isAuthenticated'](),controller[_0x3ab3('0xc')]);router[_0x3ab3('0x7')](_0x3ab3('0xd'),auth[_0x3ab3('0x6')](),controller[_0x3ab3('0xe')]);router[_0x3ab3('0xf')]('/',auth['isAuthenticated'](),controller[_0x3ab3('0x10')]);router[_0x3ab3('0xf')](_0x3ab3('0xb'),auth[_0x3ab3('0x6')](),controller[_0x3ab3('0x11')]);router[_0x3ab3('0xf')](_0x3ab3('0xd'),auth[_0x3ab3('0x6')](),controller['addTeams']);router[_0x3ab3('0x12')](_0x3ab3('0x9'),auth['isAuthenticated'](),controller[_0x3ab3('0x13')]);router[_0x3ab3('0x14')](_0x3ab3('0x9'),auth[_0x3ab3('0x6')](),controller[_0x3ab3('0x15')]);router[_0x3ab3('0x14')](_0x3ab3('0xb'),auth[_0x3ab3('0x6')](),controller['removeAgents']);router[_0x3ab3('0x14')](_0x3ab3('0xd'),auth[_0x3ab3('0x6')](),controller[_0x3ab3('0x16')]);module['exports']=router; \ No newline at end of file +var _0xb673=['removeAgents','removeTeams','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','/:id/users','getAgents','/:id/teams','post','addAgents','addTeams','put','/:id','update','destroy','delete'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0xb673,0xa5));var _0x3b67=function(_0x497b1d,_0x106d9f){_0x497b1d=_0x497b1d-0x0;var _0x579b72=_0xb673[_0x497b1d];return _0x579b72;};'use strict';var multer=require(_0x3b67('0x0'));var util=require(_0x3b67('0x1'));var path=require('path');var timeout=require(_0x3b67('0x2'));var express=require(_0x3b67('0x3'));var router=express[_0x3b67('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b67('0x5'));var interaction=require(_0x3b67('0x6'));var config=require(_0x3b67('0x7'));var controller=require('./voicePrefix.controller');router[_0x3b67('0x8')]('/',auth['isAuthenticated'](),controller[_0x3b67('0x9')]);router[_0x3b67('0x8')](_0x3b67('0xa'),auth[_0x3b67('0xb')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3b67('0xc')]);router['get'](_0x3b67('0xd'),auth['isAuthenticated'](),controller[_0x3b67('0xe')]);router[_0x3b67('0x8')](_0x3b67('0xf'),auth[_0x3b67('0xb')](),controller['getTeams']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3b67('0x10')](_0x3b67('0xd'),auth['isAuthenticated'](),controller[_0x3b67('0x11')]);router[_0x3b67('0x10')]('/:id/teams',auth[_0x3b67('0xb')](),controller[_0x3b67('0x12')]);router[_0x3b67('0x13')](_0x3b67('0x14'),auth[_0x3b67('0xb')](),controller[_0x3b67('0x15')]);router['delete']('/:id',auth[_0x3b67('0xb')](),controller[_0x3b67('0x16')]);router[_0x3b67('0x17')](_0x3b67('0xd'),auth['isAuthenticated'](),controller[_0x3b67('0x18')]);router[_0x3b67('0x17')]('/:id/teams',auth[_0x3b67('0xb')](),controller[_0x3b67('0x19')]);module[_0x3b67('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index d495c42..95a229c 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 _0x0b8d=['STRING','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize'];(function(_0x20f27f,_0x2e9c80){var _0xd40638=function(_0x498958){while(--_0x498958){_0x20f27f['push'](_0x20f27f['shift']());}};_0xd40638(++_0x2e9c80);}(_0x0b8d,0x1e2));var _0xd0b8=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x0b8d[_0x5a79e2];return _0x266c45;};'use strict';var Sequelize=require(_0xd0b8('0x0'));module['exports']={'name':{'type':Sequelize[_0xd0b8('0x1')],'allowNull':![],'unique':_0xd0b8('0x2')},'prefix':{'type':Sequelize[_0xd0b8('0x3')],'get':function(_0x1a77da){return _0xd0b8('0x4')+this[_0xd0b8('0x5')](_0xd0b8('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xd0b8('0x6')]}}; \ No newline at end of file +var _0x6ae7=['getDataValue','INTEGER','sequelize','exports','name','VIRTUAL','system-'];(function(_0x1f3c34,_0xa712b9){var _0x55a860=function(_0x29b0f8){while(--_0x29b0f8){_0x1f3c34['push'](_0x1f3c34['shift']());}};_0x55a860(++_0xa712b9);}(_0x6ae7,0x72));var _0x76ae=function(_0x28eb1b,_0x38097d){_0x28eb1b=_0x28eb1b-0x0;var _0x293dc2=_0x6ae7[_0x28eb1b];return _0x293dc2;};'use strict';var Sequelize=require(_0x76ae('0x0'));module[_0x76ae('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x76ae('0x2')},'prefix':{'type':Sequelize[_0x76ae('0x3')],'get':function(_0x3db841){return _0x76ae('0x4')+this[_0x76ae('0x5')](_0x76ae('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x76ae('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 77fd3db..6f07a6b 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 _0x5b12=['QueryTypes','SELECT','TeamId','includes','all','union','compact','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','options','VoicePrefix','includeAll','include','findAll','rows','catch','show','fields','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','context','from-sip','exten','app','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','findOne','merge','getTeams','Team','User','online','flatMap','Agents','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b12,0xa3));var _0x25b1=function(_0x9229ce,_0x14842b){_0x9229ce=_0x9229ce-0x0;var _0x4b9343=_0x5b12[_0x9229ce];return _0x4b9343;};'use strict';var emlformat=require(_0x25b1('0x0'));var rimraf=require(_0x25b1('0x1'));var zipdir=require(_0x25b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25b1('0x3'));var moment=require('moment');var BPromise=require(_0x25b1('0x4'));var Mustache=require(_0x25b1('0x5'));var util=require('util');var path=require(_0x25b1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25b1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25b1('0x8'));var crypto=require(_0x25b1('0x9'));var jsforce=require(_0x25b1('0xa'));var deskjs=require(_0x25b1('0xb'));var toCsv=require(_0x25b1('0xc'));var querystring=require(_0x25b1('0xd'));var Papa=require(_0x25b1('0xe'));var Redis=require(_0x25b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b1('0x10'));var as=require(_0x25b1('0x11'));var hardwareService=require(_0x25b1('0x12'));var logger=require(_0x25b1('0x13'))(_0x25b1('0x14'));var utils=require(_0x25b1('0x15'));var config=require(_0x25b1('0x16'));var licenseUtil=require(_0x25b1('0x17'));var db=require(_0x25b1('0x18'))['db'];config[_0x25b1('0x19')]=_[_0x25b1('0x1a')](config[_0x25b1('0x19')],{'host':_0x25b1('0x1b'),'port':0x18eb});var socket=require(_0x25b1('0x1c'))(new Redis(config[_0x25b1('0x19')]));require(_0x25b1('0x1d'))['register'](socket);function respondWithStatusCode(_0x2c337a,_0x2559a1){_0x2559a1=_0x2559a1||0xcc;return function(_0x4de13f){if(_0x4de13f){return _0x2c337a[_0x25b1('0x1e')](_0x2559a1);}return _0x2c337a[_0x25b1('0x1f')](_0x2559a1)[_0x25b1('0x20')]();};}function respondWithResult(_0x4a5a58,_0x593165){_0x593165=_0x593165||0xc8;return function(_0x7b50ab){if(_0x7b50ab){return _0x4a5a58['status'](_0x593165)[_0x25b1('0x21')](_0x7b50ab);}};}function respondWithFilteredResult(_0x2ca567,_0x1be2d8){return function(_0x27ccc9){if(_0x27ccc9){var _0x1f78c2=typeof _0x1be2d8[_0x25b1('0x22')]===_0x25b1('0x23')&&typeof _0x1be2d8[_0x25b1('0x24')]==='undefined';var _0x4ecff1=_0x27ccc9[_0x25b1('0x25')];var _0x501dc8=_0x1f78c2?0x0:_0x1be2d8[_0x25b1('0x22')];var _0x50ae0f=_0x1f78c2?_0x27ccc9[_0x25b1('0x25')]:_0x1be2d8['offset']+_0x1be2d8[_0x25b1('0x24')];var _0x529310;if(_0x50ae0f>=_0x4ecff1){_0x50ae0f=_0x4ecff1;_0x529310=0xc8;}else{_0x529310=0xce;}_0x2ca567[_0x25b1('0x1f')](_0x529310);return _0x2ca567['set']('Content-Range',_0x501dc8+'-'+_0x50ae0f+'/'+_0x4ecff1)['json'](_0x27ccc9);}return null;};}function patchUpdates(_0x3bca9f){return function(_0x150436){try{jsonpatch['apply'](_0x150436,_0x3bca9f,!![]);}catch(_0x19bab8){return BPromise[_0x25b1('0x26')](_0x19bab8);}return _0x150436[_0x25b1('0x27')]();};}function saveUpdates(_0x246acd,_0x1aabbb){return function(_0x5e6b6b){if(_0x5e6b6b){return _0x5e6b6b[_0x25b1('0x28')](_0x246acd)[_0x25b1('0x29')](function(_0xd22469){return _0xd22469;});}return null;};}function removeEntity(_0x282187,_0x1f37ed){return function(_0x1292bf){if(_0x1292bf){return _0x1292bf['destroy']()[_0x25b1('0x29')](function(){var _0x27dd68=_0x1292bf[_0x25b1('0x2a')]({'plain':!![]});var _0x5bc8fc=_0x25b1('0x2b');return db[_0x25b1('0x2c')][_0x25b1('0x2d')]({'where':{'type':_0x5bc8fc,'resourceId':_0x27dd68['id']}})['then'](function(){return _0x1292bf;});})[_0x25b1('0x29')](function(){_0x282187['status'](0xcc)[_0x25b1('0x20')]();});}};}function handleEntityNotFound(_0x3febb8,_0x3a4475){return function(_0x293413){if(!_0x293413){_0x3febb8[_0x25b1('0x1e')](0x194);}return _0x293413;};}function handleError(_0x300a14,_0x46e429){_0x46e429=_0x46e429||0x1f4;return function(_0x4cd825){logger[_0x25b1('0x2e')](_0x4cd825[_0x25b1('0x2f')]);if(_0x4cd825[_0x25b1('0x30')]){delete _0x4cd825[_0x25b1('0x30')];}_0x300a14[_0x25b1('0x1f')](_0x46e429)['send'](_0x4cd825);};}exports[_0x25b1('0x31')]=function(_0x548dd0,_0x42441d){var _0x1622e8={},_0x1e1796={},_0x5a4234={'count':0x0,'rows':[]};var _0x5cbde5=_[_0x25b1('0x32')](db['VoicePrefix'][_0x25b1('0x33')],function(_0x391713){return{'name':_0x391713[_0x25b1('0x34')],'type':_0x391713['type']['key']};});_0x1e1796[_0x25b1('0x35')]=_[_0x25b1('0x32')](_0x5cbde5,_0x25b1('0x30'));_0x1e1796['query']=_[_0x25b1('0x36')](_0x548dd0[_0x25b1('0x37')]);_0x1e1796[_0x25b1('0x38')]=_[_0x25b1('0x39')](_0x1e1796['model'],_0x1e1796[_0x25b1('0x37')]);_0x1622e8[_0x25b1('0x3a')]=_[_0x25b1('0x39')](_0x1e1796['model'],qs['fields'](_0x548dd0[_0x25b1('0x37')]['fields']));_0x1622e8[_0x25b1('0x3a')]=_0x1622e8[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x1622e8[_0x25b1('0x3a')]:_0x1e1796[_0x25b1('0x35')];if(!_0x548dd0[_0x25b1('0x37')][_0x25b1('0x3c')](_0x25b1('0x3d'))){_0x1622e8[_0x25b1('0x24')]=qs[_0x25b1('0x24')](_0x548dd0[_0x25b1('0x37')][_0x25b1('0x24')]);_0x1622e8[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x548dd0[_0x25b1('0x37')]['offset']);}_0x1622e8[_0x25b1('0x3e')]=qs[_0x25b1('0x3f')](_0x548dd0['query'][_0x25b1('0x3f')]);_0x1622e8[_0x25b1('0x40')]=qs[_0x25b1('0x38')](_[_0x25b1('0x41')](_0x548dd0[_0x25b1('0x37')],_0x1e1796['filters']),_0x5cbde5);if(_0x548dd0[_0x25b1('0x37')]['filter']){_0x1622e8[_0x25b1('0x40')]=_['merge'](_0x1622e8[_0x25b1('0x40')],{'$or':_[_0x25b1('0x32')](_0x5cbde5,function(_0x1b354e){if(_0x1b354e[_0x25b1('0x42')]!==_0x25b1('0x43')){var _0x45713f={};_0x45713f[_0x1b354e[_0x25b1('0x30')]]={'$like':'%'+_0x548dd0[_0x25b1('0x37')][_0x25b1('0x44')]+'%'};return _0x45713f;}})});}_0x1622e8=_['merge']({},_0x1622e8,_0x548dd0[_0x25b1('0x45')]);var _0x585c37={'where':_0x1622e8[_0x25b1('0x40')]};return db[_0x25b1('0x46')]['count'](_0x585c37)[_0x25b1('0x29')](function(_0x39b4c7){_0x5a4234[_0x25b1('0x25')]=_0x39b4c7;if(_0x548dd0[_0x25b1('0x37')][_0x25b1('0x47')]){_0x1622e8[_0x25b1('0x48')]=[{'all':!![]}];}return db[_0x25b1('0x46')][_0x25b1('0x49')](_0x1622e8);})[_0x25b1('0x29')](function(_0x453352){_0x5a4234[_0x25b1('0x4a')]=_0x453352;return _0x5a4234;})[_0x25b1('0x29')](respondWithFilteredResult(_0x42441d,_0x1622e8))[_0x25b1('0x4b')](handleError(_0x42441d,null));};exports[_0x25b1('0x4c')]=function(_0x21242a,_0x210cef){var _0x103953={'raw':![],'where':{'id':_0x21242a['params']['id']}},_0x210a13={};_0x210a13['model']=_['keys'](db[_0x25b1('0x46')]['rawAttributes']);_0x210a13[_0x25b1('0x37')]=_['keys'](_0x21242a[_0x25b1('0x37')]);_0x210a13[_0x25b1('0x38')]=_[_0x25b1('0x39')](_0x210a13[_0x25b1('0x35')],_0x210a13[_0x25b1('0x37')]);_0x103953[_0x25b1('0x3a')]=_['intersection'](_0x210a13[_0x25b1('0x35')],qs[_0x25b1('0x4d')](_0x21242a[_0x25b1('0x37')][_0x25b1('0x4d')]));_0x103953['attributes']=_0x103953[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x103953[_0x25b1('0x3a')]:_0x210a13['model'];if(_0x21242a[_0x25b1('0x37')]['includeAll']){_0x103953[_0x25b1('0x48')]=[{'all':!![]}];}_0x103953=_['merge']({},_0x103953,_0x21242a['options']);return db[_0x25b1('0x46')][_0x25b1('0x4e')](_0x103953)[_0x25b1('0x29')](handleEntityNotFound(_0x210cef,null))[_0x25b1('0x29')](respondWithResult(_0x210cef,null))['catch'](handleError(_0x210cef,null));};exports[_0x25b1('0x2d')]=function(_0x58e612,_0x7c30da){return db['VoicePrefix'][_0x25b1('0x4e')]({'where':{'id':_0x58e612[_0x25b1('0x4f')]['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x7c30da,null))['then'](removeEntity(_0x7c30da,null))[_0x25b1('0x4b')](handleError(_0x7c30da,null));};exports[_0x25b1('0x50')]=function(_0x354294,_0xf38a9e){return db[_0x25b1('0x46')][_0x25b1('0x50')]()['then'](respondWithResult(_0xf38a9e,null))[_0x25b1('0x4b')](handleError(_0xf38a9e,null));};exports[_0x25b1('0x51')]=function(_0x168931,_0x2311da){var _0x5e367;return db[_0x25b1('0x52')][_0x25b1('0x53')](function(_0x40d574){return db[_0x25b1('0x46')][_0x25b1('0x51')](_0x168931[_0x25b1('0x54')],{'transaction':_0x40d574})[_0x25b1('0x29')](function(_0x4190a1){_0x5e367=_0x4190a1[_0x25b1('0x2a')]({'plain':!![]});return db[_0x25b1('0x55')][_0x25b1('0x4e')]({'where':{'id':_0x5e367[_0x25b1('0x56')]},'raw':!![]})[_0x25b1('0x29')](function(_0x5732a1){return createVoicePrefixExtensions(_0x5e367,_0x5732a1,_0x40d574);});});})[_0x25b1('0x29')](function(){var _0x16e61e=_0x168931[_0x25b1('0x57')][_0x25b1('0x2a')]({'plain':!![]});if(!_0x16e61e)throw new Error(_0x25b1('0x58'));if(_0x16e61e[_0x25b1('0x59')]==='user'){var _0x105587=_0x5e367;return db[_0x25b1('0x5a')][_0x25b1('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x16e61e[_0x25b1('0x5b')]},'raw':!![]})['then'](function(_0x5bd36b){if(_0x5bd36b&&_0x5bd36b['autoAssociation']===0x0){return db['UserProfileResource'][_0x25b1('0x51')]({'name':_0x105587['name'],'resourceId':_0x105587['id'],'type':_0x5bd36b[_0x25b1('0x30')],'sectionId':_0x5bd36b['id']},{})[_0x25b1('0x29')](function(){return _0x5e367;});}else{return _0x5e367;}})[_0x25b1('0x4b')](function(_0x439bab){logger[_0x25b1('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x439bab);throw _0x439bab;});}return _0x5e367;})[_0x25b1('0x29')](respondWithResult(_0x2311da,null))[_0x25b1('0x4b')](handleError(_0x2311da,null));};function Extension(_0x37b58d,_0x400ec9,_0x5ecc36,_0xcca343){this[_0x25b1('0x5c')]=_0x25b1('0x5d');this[_0x25b1('0x5e')]=_0x37b58d;this[_0x25b1('0x5f')]=_0x5ecc36;this[_0x25b1('0x42')]='system';this[_0x25b1('0x60')]='Voice\x20Prefix\x20Extension';this[_0x25b1('0x61')]=_0x400ec9;this[_0x25b1('0x62')]=_0xcca343;}function createVoicePrefixExtensions(_0x49052b,_0x42a81f,_0x3d8d33){return new BPromise(function(_0x551bed,_0x1351ea){var _0x303049=new Extension(formatPrefixName(_0x49052b[_0x25b1('0x63')]),0x1,_0x25b1('0x64'),_0x25b1('0x65'));_0x303049[_0x25b1('0x66')]=_0x49052b['id'];return db[_0x25b1('0x55')][_0x25b1('0x51')](_0x303049,{'transaction':_0x3d8d33})['then'](function(_0x6f1b1f){var _0x1e2dcb=_0x6f1b1f[_0x25b1('0x2a')]({'plain':!![]});var _0x1da588=_[_0x25b1('0x32')](addVoicePrefixExtensions(_0x49052b,_0x42a81f),function(_0x2b9223){_0x2b9223[_0x25b1('0x56')]=_0x1e2dcb['id'];_0x2b9223[_0x25b1('0x66')]=_0x49052b['id'];return _0x2b9223;});return db['VoiceExtension'][_0x25b1('0x67')](_0x1da588,{'transaction':_0x3d8d33})[_0x25b1('0x29')](function(_0x51f922){if(!_0x51f922){return _0x1351ea(_0x25b1('0x68'));}else{return _0x551bed(_0x51f922);}})[_0x25b1('0x4b')](function(_0x5b71e5){return _0x1351ea(_0x5b71e5);});});;});};function addVoicePrefixExtensions(_0x26e90c,_0x498aca){var _0x44aa87=[];var _0x4e62b5=formatPrefixName(_0x26e90c[_0x25b1('0x63')]);_0x44aa87['push'](new Extension(_0x4e62b5,0x2,_0x25b1('0x69'),_0x25b1('0x6a')+_0x26e90c[_0x25b1('0x30')]));if(_0x26e90c['callerIdAll']){_0x44aa87['push'](new Extension(_0x4e62b5,0x3,_0x25b1('0x69'),_0x25b1('0x6b')+_0x26e90c[_0x25b1('0x6c')]));}else{_0x44aa87[_0x25b1('0x6d')](new Extension(_0x4e62b5,0x3,_0x25b1('0x64'),_0x25b1('0x6e')));}_0x44aa87[_0x25b1('0x6d')](new Extension(_0x4e62b5,0x4,_0x25b1('0x6f'),_0x498aca[_0x25b1('0x5c')]+','+_0x25b1('0x70')+(0x8+_0x26e90c[_0x25b1('0x30')][_0x25b1('0x3b')])+'}'+','+0x1));return _0x44aa87;}function formatPrefixName(_0x3d06ab){var _0x975b85='_';for(var _0x1c22c4=0x0;_0x1c22c4<_0x3d06ab[_0x25b1('0x3b')];_0x1c22c4++){if(_0x3d06ab[_0x25b1('0x71')](_0x1c22c4)=='-'){_0x975b85+=_0x3d06ab[_0x25b1('0x71')](_0x1c22c4);}else{_0x975b85+='['+_0x3d06ab[_0x25b1('0x71')](_0x1c22c4)+']';}}_0x975b85+='.';return _0x975b85;}exports[_0x25b1('0x28')]=function(_0x15272b,_0x2fe4a5,_0x584499){var _0x1a3368=_0x15272b['body'];_0x1a3368[_0x25b1('0x63')]=_0x25b1('0x72')+_0x1a3368[_0x25b1('0x30')]+'-';return db['sequelize']['transaction'](function(_0x3f9ca7){return db[_0x25b1('0x46')]['update'](_0x1a3368,{'where':{'id':_0x1a3368['id']},'transaction':_0x3f9ca7})[_0x25b1('0x29')](function(){return db[_0x25b1('0x55')][_0x25b1('0x2d')]({'where':{'VoicePrefixId':_0x1a3368['id']},'transaction':_0x3f9ca7})['then'](function(){return db[_0x25b1('0x55')][_0x25b1('0x4e')]({'where':{'id':_0x1a3368[_0x25b1('0x56')]},'raw':!![]})[_0x25b1('0x29')](function(_0x5f1fef){return createVoicePrefixExtensions(_0x1a3368,_0x5f1fef,_0x3f9ca7);});});});})[_0x25b1('0x29')](function(){return db[_0x25b1('0x46')][_0x25b1('0x73')](_0x1a3368['id']);})[_0x25b1('0x29')](respondWithResult(_0x2fe4a5,null))[_0x25b1('0x4b')](handleError(_0x2fe4a5,null));};exports[_0x25b1('0x74')]=function(_0x4a9fbf,_0x40400e,_0x3f77e0){return db['VoicePrefix']['find']({'where':{'id':_0x4a9fbf[_0x25b1('0x4f')]['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x40400e,null))[_0x25b1('0x29')](function(_0x3ff99d){if(_0x3ff99d){return _0x3ff99d[_0x25b1('0x74')](_0x4a9fbf[_0x25b1('0x54')][_0x25b1('0x75')],_['omit'](_0x4a9fbf[_0x25b1('0x54')],[_0x25b1('0x75'),'id'])||{})[_0x25b1('0x76')](function(_0x49fac2){for(var _0x1bbb9b=0x0;_0x1bbb9b<_0x4a9fbf[_0x25b1('0x54')][_0x25b1('0x75')]['length'];_0x1bbb9b+=0x1){socket[_0x25b1('0x77')](_0x25b1('0x78'),{'UserId':Number(_0x4a9fbf[_0x25b1('0x54')][_0x25b1('0x75')][_0x1bbb9b]),'VoicePrefixId':Number(_0x4a9fbf[_0x25b1('0x4f')]['id'])});}return _0x49fac2;});}})[_0x25b1('0x29')](respondWithResult(_0x40400e,null))[_0x25b1('0x4b')](handleError(_0x40400e,null));};exports[_0x25b1('0x79')]=function(_0x1a07cb,_0x18021f,_0x20b43f){return db['VoicePrefix'][_0x25b1('0x4e')]({'where':{'id':_0x1a07cb[_0x25b1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x18021f,null))[_0x25b1('0x29')](function(_0x45804b){if(_0x45804b){return _0x45804b[_0x25b1('0x79')](_0x1a07cb[_0x25b1('0x37')][_0x25b1('0x75')])['then'](function(){if(_['isArray'](_0x1a07cb[_0x25b1('0x37')]['ids'])){for(var _0x3e7f2b=0x0;_0x3e7f2b<_0x1a07cb[_0x25b1('0x37')][_0x25b1('0x75')][_0x25b1('0x3b')];_0x3e7f2b+=0x1){socket[_0x25b1('0x77')](_0x25b1('0x7a'),{'UserId':Number(_0x1a07cb['query'][_0x25b1('0x75')][_0x3e7f2b]),'VoicePrefixId':Number(_0x1a07cb[_0x25b1('0x4f')]['id'])});}}else{socket[_0x25b1('0x77')](_0x25b1('0x7a'),{'UserId':Number(_0x1a07cb['query']['ids']),'VoicePrefixId':Number(_0x1a07cb['params']['id'])});}});}})[_0x25b1('0x29')](respondWithStatusCode(_0x18021f,null))[_0x25b1('0x4b')](handleError(_0x18021f,null));};exports['getAgents']=function(_0x49c2d3,_0x271837,_0x102b85){var _0x6bbd44={};var _0x67a4b7={};var _0x54e1a6;var _0x10409f;return db[_0x25b1('0x46')][_0x25b1('0x7b')]({'where':{'id':_0x49c2d3[_0x25b1('0x4f')]['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x271837,null))[_0x25b1('0x29')](function(_0x175c72){if(_0x175c72){_0x54e1a6=_0x175c72;_0x67a4b7[_0x25b1('0x35')]=_['keys'](db['User'][_0x25b1('0x33')]);_0x67a4b7[_0x25b1('0x37')]=_['keys'](_0x49c2d3['query']);_0x67a4b7[_0x25b1('0x38')]=_[_0x25b1('0x39')](_0x67a4b7['model'],_0x67a4b7[_0x25b1('0x37')]);_0x6bbd44[_0x25b1('0x3a')]=_[_0x25b1('0x39')](_0x67a4b7[_0x25b1('0x35')],qs[_0x25b1('0x4d')](_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x4d')]));_0x6bbd44['attributes']=_0x6bbd44[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x6bbd44[_0x25b1('0x3a')]:_0x67a4b7['model'];_0x6bbd44['order']=qs['sort'](_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x3f')]);_0x6bbd44[_0x25b1('0x40')]=qs['filters'](_['pick'](_0x49c2d3[_0x25b1('0x37')],_0x67a4b7[_0x25b1('0x38')]));if(_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x44')]){_0x6bbd44[_0x25b1('0x40')]=_[_0x25b1('0x7c')](_0x6bbd44[_0x25b1('0x40')],{'$or':_[_0x25b1('0x32')](_0x6bbd44[_0x25b1('0x3a')],function(_0x4c74f8){var _0xb7494b={};_0xb7494b[_0x4c74f8]={'$like':'%'+_0x49c2d3[_0x25b1('0x37')]['filter']+'%'};return _0xb7494b;})});}_0x6bbd44=_['merge']({},_0x6bbd44,_0x49c2d3[_0x25b1('0x45')]);return _0x54e1a6['getAgents'](_0x6bbd44);}})[_0x25b1('0x29')](function(_0x133a5d){if(_0x133a5d){_0x10409f=_0x133a5d[_0x25b1('0x3b')];if(!_0x49c2d3['query']['hasOwnProperty']('nolimit')){_0x6bbd44[_0x25b1('0x24')]=qs[_0x25b1('0x24')](_0x49c2d3['query'][_0x25b1('0x24')]);_0x6bbd44[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x22')]);}return _0x54e1a6['getAgents'](_0x6bbd44);}})[_0x25b1('0x29')](function(_0x954de5){if(_0x954de5){return _0x954de5?{'count':_0x10409f,'rows':_0x954de5}:null;}})['then'](respondWithResult(_0x271837,null))[_0x25b1('0x4b')](handleError(_0x271837,null));};exports['getTeams']=function(_0x198561,_0x4c2b9f,_0x5c7849){var _0x92b5d6={};var _0x1958c0={};var _0x4428d2;var _0x12e63d;return db[_0x25b1('0x46')]['findOne']({'where':{'id':_0x198561['params']['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x4c2b9f,null))['then'](function(_0x2890c1){if(_0x2890c1){_0x4428d2=_0x2890c1;_0x1958c0[_0x25b1('0x35')]=_[_0x25b1('0x36')](db['Team'][_0x25b1('0x33')]);_0x1958c0['query']=_['keys'](_0x198561['query']);_0x1958c0[_0x25b1('0x38')]=_['intersection'](_0x1958c0[_0x25b1('0x35')],_0x1958c0[_0x25b1('0x37')]);_0x92b5d6[_0x25b1('0x3a')]=_[_0x25b1('0x39')](_0x1958c0[_0x25b1('0x35')],qs[_0x25b1('0x4d')](_0x198561[_0x25b1('0x37')][_0x25b1('0x4d')]));_0x92b5d6[_0x25b1('0x3a')]=_0x92b5d6[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x92b5d6[_0x25b1('0x3a')]:_0x1958c0[_0x25b1('0x35')];_0x92b5d6[_0x25b1('0x3e')]=qs[_0x25b1('0x3f')](_0x198561[_0x25b1('0x37')][_0x25b1('0x3f')]);_0x92b5d6['where']=qs[_0x25b1('0x38')](_['pick'](_0x198561[_0x25b1('0x37')],_0x1958c0[_0x25b1('0x38')]));if(_0x198561[_0x25b1('0x37')][_0x25b1('0x44')]){_0x92b5d6[_0x25b1('0x40')]=_['merge'](_0x92b5d6[_0x25b1('0x40')],{'$or':_[_0x25b1('0x32')](_0x92b5d6[_0x25b1('0x3a')],function(_0x5af2b6){var _0x339e82={};_0x339e82[_0x5af2b6]={'$like':'%'+_0x198561[_0x25b1('0x37')][_0x25b1('0x44')]+'%'};return _0x339e82;})});}_0x92b5d6=_[_0x25b1('0x7c')]({},_0x92b5d6,_0x198561['options']);return _0x4428d2[_0x25b1('0x7d')](_0x92b5d6);}})[_0x25b1('0x29')](function(_0x270f00){if(_0x270f00){_0x12e63d=_0x270f00['length'];if(!_0x198561[_0x25b1('0x37')][_0x25b1('0x3c')](_0x25b1('0x3d'))){_0x92b5d6['limit']=qs[_0x25b1('0x24')](_0x198561[_0x25b1('0x37')]['limit']);_0x92b5d6[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x198561['query'][_0x25b1('0x22')]);}return _0x4428d2[_0x25b1('0x7d')](_0x92b5d6);}})[_0x25b1('0x29')](function(_0x14b909){if(_0x14b909){return _0x14b909?{'count':_0x12e63d,'rows':_0x14b909}:null;}})[_0x25b1('0x29')](respondWithResult(_0x4c2b9f,null))[_0x25b1('0x4b')](handleError(_0x4c2b9f,null));};exports['addTeams']=function(_0x3496a9,_0x30f1e9,_0x18211a){var _0x3038be=_0x3496a9[_0x25b1('0x54')][_0x25b1('0x75')];var _0x310a32;return db[_0x25b1('0x7e')][_0x25b1('0x49')]({'where':{'id':_0x3038be},'attributes':['id'],'include':[{'model':db[_0x25b1('0x7f')],'as':'Agents','attributes':['id',_0x25b1('0x30'),_0x25b1('0x80'),'voicePause','interface'],'raw':!![]}]})[_0x25b1('0x29')](function(_0x96a1b0){if(_0x96a1b0){_0x310a32=_0x96a1b0;var _0x2db4a9=_[_0x25b1('0x81')](_0x96a1b0,function(_0x58e166){var _0x4c6181=_0x58e166['get']({'plain':!![]});return _0x4c6181[_0x25b1('0x82')];});return db[_0x25b1('0x46')][_0x25b1('0x4e')]({'where':{'id':_0x3496a9['params']['id']}})['then'](function(_0x16702d){return db[_0x25b1('0x52')][_0x25b1('0x53')](function(_0x55f740){return _0x16702d[_0x25b1('0x83')](_0x3038be,{'transaction':_0x55f740})[_0x25b1('0x29')](function(){return BPromise[_0x25b1('0x84')](_0x310a32,function(_0x2da0d9){return db[_0x25b1('0x85')][_0x25b1('0x86')]({'TeamId':_0x2da0d9['id'],'VoicePrefixId':_0x3496a9[_0x25b1('0x4f')]['id']},{'transaction':_0x55f740});});})[_0x25b1('0x29')](function(){return BPromise[_0x25b1('0x84')](_0x2db4a9,function(_0x5c515b){return db[_0x25b1('0x87')][_0x25b1('0x88')]({'where':{'UserId':_0x5c515b['id'],'VoicePrefixId':_0x3496a9[_0x25b1('0x4f')]['id']},'transaction':_0x55f740});});})[_0x25b1('0x29')](function(){_0x2db4a9[_0x25b1('0x89')](function(_0x3c8c4e){socket[_0x25b1('0x77')]('userVoicePrefix:save',{'UserId':_0x3c8c4e['id'],'VoicePrefixId':_0x16702d['id']});});});});});}})[_0x25b1('0x29')](respondWithStatusCode(_0x30f1e9,null))['catch'](handleError(_0x30f1e9,null));};exports[_0x25b1('0x8a')]=function(_0x469405,_0x1010c4,_0x22d3e4){return db['Team']['findAll']({'where':{'id':_0x469405[_0x25b1('0x37')][_0x25b1('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1010c4,null))[_0x25b1('0x29')](function(_0xd05872){var _0x25c07f=_[_0x25b1('0x32')](_0xd05872,'id');var _0x1041d1=[];var _0x1f1160=[];var _0x29d8fe=squel[_0x25b1('0x8b')]();_0x29d8fe[_0x25b1('0x8c')](_0x25b1('0x8d'))[_0x25b1('0x8e')](_0x25b1('0x8f'),'tq')['join'](_0x25b1('0x90'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x25b1('0x40')](_0x25b1('0x91'),_0x469405[_0x25b1('0x4f')]['id']);for(var _0x1354c3=0x0;_0x1354c3<_0xd05872[_0x25b1('0x3b')];_0x1354c3+=0x1){let _0x3ccdab=_0xd05872[_0x1354c3];for(var _0x381a62=0x0;_0x381a62<_0x3ccdab[_0x25b1('0x82')]['length'];_0x381a62+=0x1){let _0x330ae7=_0x3ccdab[_0x25b1('0x82')][_0x381a62];var _0xbe6572=_0x29d8fe[_0x25b1('0x92')]();_0xbe6572[_0x25b1('0x40')](_0x25b1('0x93'),_0x330ae7['id']);_0x1f1160[_0x25b1('0x6d')](db['sequelize'][_0x25b1('0x37')](_0xbe6572[_0x25b1('0x94')](),{'type':db[_0x25b1('0x52')][_0x25b1('0x95')][_0x25b1('0x96')]})['then'](function(_0x4edb48){if(_0x4edb48[_0x25b1('0x3b')]===0x1){return _0x330ae7['id'];}else{var _0x2e924b=_['every'](_['map'](_0x4edb48,_0x25b1('0x97')),function(_0x16d969){return _[_0x25b1('0x98')](_0x25c07f,_0x16d969);});if(_0x2e924b){return _0x330ae7['id'];}}}));}}return BPromise[_0x25b1('0x99')](_0x1f1160)[_0x25b1('0x29')](function(_0x3128bd){_0x1041d1=_(_0x1041d1)[_0x25b1('0x9a')](_0x3128bd)[_0x25b1('0x9b')]()['value']();return db[_0x25b1('0x46')]['find']({'where':{'id':_0x469405['params']['id']}})[_0x25b1('0x29')](function(_0x4cf3e6){return db[_0x25b1('0x52')][_0x25b1('0x53')](function(_0x2c0147){return _0x4cf3e6[_0x25b1('0x8a')](_0x469405[_0x25b1('0x37')][_0x25b1('0x75')],{'transaction':_0x2c0147})[_0x25b1('0x29')](function(){if(!_['isEmpty'](_0x1041d1)){return _0x4cf3e6[_0x25b1('0x79')](_0x1041d1,{'transaction':_0x2c0147});}})[_0x25b1('0x29')](function(){_0x1041d1[_0x25b1('0x89')](function(_0x220f92){socket[_0x25b1('0x77')](_0x25b1('0x7a'),{'UserId':_0x220f92,'VoicePrefixId':_0x4cf3e6['id']});});});});});});})[_0x25b1('0x29')](respondWithStatusCode(_0x1010c4,null))[_0x25b1('0x4b')](handleError(_0x1010c4,null));}; \ No newline at end of file +var _0x0b0e=['length','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','params','find','describe','sequelize','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','create','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','prefix','push','Set','CDR(prefix)=','callerIdAll','goto','charAt','findById','addAgents','omit','ids','spread','emit','isArray','userVoicePrefix:remove','findOne','User','order','getAgents','nolimit','Team','getTeams','addTeams','Agents','online','voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','all','compact','value','isEmpty','removeAgents','eml-format','zip-dir','request-promise','moment','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','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','end','json','undefined','offset','limit','status','set','apply','save','update','destroy','get','VoicePrefixes','UserProfileResource','then','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x444909,_0x2d90e8){var _0x3f4682=function(_0x47ffa1){while(--_0x47ffa1){_0x444909['push'](_0x444909['shift']());}};_0x3f4682(++_0x2d90e8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x32b3c2,_0xe56fd){_0x32b3c2=_0x32b3c2-0x0;var _0x40a313=_0x0b0e[_0x32b3c2];return _0x40a313;};'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'];config[_0xe0b0('0x18')]=_[_0xe0b0('0x19')](config[_0xe0b0('0x18')],{'host':_0xe0b0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe0b0('0x18')]));require(_0xe0b0('0x1b'))[_0xe0b0('0x1c')](socket);function respondWithStatusCode(_0x24babd,_0x177c24){_0x177c24=_0x177c24||0xcc;return function(_0x55d884){if(_0x55d884){return _0x24babd[_0xe0b0('0x1d')](_0x177c24);}return _0x24babd['status'](_0x177c24)[_0xe0b0('0x1e')]();};}function respondWithResult(_0xadee6e,_0x519ae8){_0x519ae8=_0x519ae8||0xc8;return function(_0x11fdca){if(_0x11fdca){return _0xadee6e['status'](_0x519ae8)[_0xe0b0('0x1f')](_0x11fdca);}};}function respondWithFilteredResult(_0x100204,_0x56bcc7){return function(_0x54a3eb){if(_0x54a3eb){var _0x46bb44=typeof _0x56bcc7['offset']==='undefined'&&typeof _0x56bcc7['limit']===_0xe0b0('0x20');var _0x50fa4a=_0x54a3eb['count'];var _0x10cde1=_0x46bb44?0x0:_0x56bcc7['offset'];var _0x472286=_0x46bb44?_0x54a3eb['count']:_0x56bcc7[_0xe0b0('0x21')]+_0x56bcc7[_0xe0b0('0x22')];var _0x3e10b3;if(_0x472286>=_0x50fa4a){_0x472286=_0x50fa4a;_0x3e10b3=0xc8;}else{_0x3e10b3=0xce;}_0x100204[_0xe0b0('0x23')](_0x3e10b3);return _0x100204[_0xe0b0('0x24')]('Content-Range',_0x10cde1+'-'+_0x472286+'/'+_0x50fa4a)['json'](_0x54a3eb);}return null;};}function patchUpdates(_0x2fa820){return function(_0x5512bb){try{jsonpatch[_0xe0b0('0x25')](_0x5512bb,_0x2fa820,!![]);}catch(_0x31b5f8){return BPromise['reject'](_0x31b5f8);}return _0x5512bb[_0xe0b0('0x26')]();};}function saveUpdates(_0x503883,_0x2208d0){return function(_0x49a727){if(_0x49a727){return _0x49a727[_0xe0b0('0x27')](_0x503883)['then'](function(_0x3e5c88){return _0x3e5c88;});}return null;};}function removeEntity(_0x4de537,_0x4700cc){return function(_0x4aafbe){if(_0x4aafbe){return _0x4aafbe[_0xe0b0('0x28')]()['then'](function(){var _0x362aba=_0x4aafbe[_0xe0b0('0x29')]({'plain':!![]});var _0x1f1ebd=_0xe0b0('0x2a');return db[_0xe0b0('0x2b')][_0xe0b0('0x28')]({'where':{'type':_0x1f1ebd,'resourceId':_0x362aba['id']}})['then'](function(){return _0x4aafbe;});})[_0xe0b0('0x2c')](function(){_0x4de537[_0xe0b0('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15e13b,_0x419b1f){return function(_0x36d137){if(!_0x36d137){_0x15e13b[_0xe0b0('0x1d')](0x194);}return _0x36d137;};}function handleError(_0x3cdbd5,_0x254cad){_0x254cad=_0x254cad||0x1f4;return function(_0x136bd4){logger['error'](_0x136bd4[_0xe0b0('0x2d')]);if(_0x136bd4[_0xe0b0('0x2e')]){delete _0x136bd4['name'];}_0x3cdbd5['status'](_0x254cad)[_0xe0b0('0x2f')](_0x136bd4);};}exports[_0xe0b0('0x30')]=function(_0x422575,_0x3f81d5){var _0x2ab1b1={},_0x5866e5={},_0x32acfe={'count':0x0,'rows':[]};var _0x3231fc=_[_0xe0b0('0x31')](db[_0xe0b0('0x32')][_0xe0b0('0x33')],function(_0x4fe835){return{'name':_0x4fe835[_0xe0b0('0x34')],'type':_0x4fe835[_0xe0b0('0x35')][_0xe0b0('0x36')]};});_0x5866e5[_0xe0b0('0x37')]=_[_0xe0b0('0x31')](_0x3231fc,_0xe0b0('0x2e'));_0x5866e5[_0xe0b0('0x38')]=_[_0xe0b0('0x39')](_0x422575[_0xe0b0('0x38')]);_0x5866e5[_0xe0b0('0x3a')]=_[_0xe0b0('0x3b')](_0x5866e5[_0xe0b0('0x37')],_0x5866e5[_0xe0b0('0x38')]);_0x2ab1b1[_0xe0b0('0x3c')]=_[_0xe0b0('0x3b')](_0x5866e5['model'],qs[_0xe0b0('0x3d')](_0x422575[_0xe0b0('0x38')][_0xe0b0('0x3d')]));_0x2ab1b1[_0xe0b0('0x3c')]=_0x2ab1b1[_0xe0b0('0x3c')][_0xe0b0('0x3e')]?_0x2ab1b1[_0xe0b0('0x3c')]:_0x5866e5['model'];if(!_0x422575['query']['hasOwnProperty']('nolimit')){_0x2ab1b1[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x422575[_0xe0b0('0x38')]['limit']);_0x2ab1b1[_0xe0b0('0x21')]=qs[_0xe0b0('0x21')](_0x422575[_0xe0b0('0x38')][_0xe0b0('0x21')]);}_0x2ab1b1['order']=qs[_0xe0b0('0x3f')](_0x422575[_0xe0b0('0x38')][_0xe0b0('0x3f')]);_0x2ab1b1[_0xe0b0('0x40')]=qs[_0xe0b0('0x3a')](_[_0xe0b0('0x41')](_0x422575[_0xe0b0('0x38')],_0x5866e5[_0xe0b0('0x3a')]),_0x3231fc);if(_0x422575[_0xe0b0('0x38')]['filter']){_0x2ab1b1[_0xe0b0('0x40')]=_['merge'](_0x2ab1b1[_0xe0b0('0x40')],{'$or':_[_0xe0b0('0x31')](_0x3231fc,function(_0x46c4ea){if(_0x46c4ea[_0xe0b0('0x35')]!=='VIRTUAL'){var _0x3e1b6b={};_0x3e1b6b[_0x46c4ea[_0xe0b0('0x2e')]]={'$like':'%'+_0x422575[_0xe0b0('0x38')][_0xe0b0('0x42')]+'%'};return _0x3e1b6b;}})});}_0x2ab1b1=_[_0xe0b0('0x43')]({},_0x2ab1b1,_0x422575[_0xe0b0('0x44')]);var _0x3ad564={'where':_0x2ab1b1[_0xe0b0('0x40')]};return db['VoicePrefix'][_0xe0b0('0x45')](_0x3ad564)[_0xe0b0('0x2c')](function(_0x528818){_0x32acfe['count']=_0x528818;if(_0x422575[_0xe0b0('0x38')][_0xe0b0('0x46')]){_0x2ab1b1['include']=[{'all':!![]}];}return db[_0xe0b0('0x32')][_0xe0b0('0x47')](_0x2ab1b1);})[_0xe0b0('0x2c')](function(_0x1c869d){_0x32acfe[_0xe0b0('0x48')]=_0x1c869d;return _0x32acfe;})['then'](respondWithFilteredResult(_0x3f81d5,_0x2ab1b1))['catch'](handleError(_0x3f81d5,null));};exports['show']=function(_0xc3235b,_0x38e715){var _0x5c2f3b={'raw':![],'where':{'id':_0xc3235b[_0xe0b0('0x49')]['id']}},_0x9f7459={};_0x9f7459[_0xe0b0('0x37')]=_[_0xe0b0('0x39')](db[_0xe0b0('0x32')]['rawAttributes']);_0x9f7459['query']=_[_0xe0b0('0x39')](_0xc3235b[_0xe0b0('0x38')]);_0x9f7459[_0xe0b0('0x3a')]=_[_0xe0b0('0x3b')](_0x9f7459[_0xe0b0('0x37')],_0x9f7459['query']);_0x5c2f3b[_0xe0b0('0x3c')]=_[_0xe0b0('0x3b')](_0x9f7459['model'],qs['fields'](_0xc3235b['query'][_0xe0b0('0x3d')]));_0x5c2f3b[_0xe0b0('0x3c')]=_0x5c2f3b[_0xe0b0('0x3c')][_0xe0b0('0x3e')]?_0x5c2f3b['attributes']:_0x9f7459[_0xe0b0('0x37')];if(_0xc3235b[_0xe0b0('0x38')]['includeAll']){_0x5c2f3b['include']=[{'all':!![]}];}_0x5c2f3b=_[_0xe0b0('0x43')]({},_0x5c2f3b,_0xc3235b[_0xe0b0('0x44')]);return db['VoicePrefix'][_0xe0b0('0x4a')](_0x5c2f3b)[_0xe0b0('0x2c')](handleEntityNotFound(_0x38e715,null))['then'](respondWithResult(_0x38e715,null))['catch'](handleError(_0x38e715,null));};exports[_0xe0b0('0x28')]=function(_0x511679,_0x165dc8){return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x511679[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0x165dc8,null))[_0xe0b0('0x2c')](removeEntity(_0x165dc8,null))['catch'](handleError(_0x165dc8,null));};exports['describe']=function(_0x2ef908,_0x5d380a){return db['VoicePrefix'][_0xe0b0('0x4b')]()[_0xe0b0('0x2c')](respondWithResult(_0x5d380a,null))['catch'](handleError(_0x5d380a,null));};exports['create']=function(_0x13adfb,_0x10b5a6){var _0x17b09f;return db[_0xe0b0('0x4c')][_0xe0b0('0x4d')](function(_0x24115f){return db[_0xe0b0('0x32')]['create'](_0x13adfb[_0xe0b0('0x4e')],{'transaction':_0x24115f})['then'](function(_0x17b3d4){_0x17b09f=_0x17b3d4['get']({'plain':!![]});return db['VoiceExtension'][_0xe0b0('0x4a')]({'where':{'id':_0x17b09f[_0xe0b0('0x4f')]},'raw':!![]})[_0xe0b0('0x2c')](function(_0x2f1712){return createVoicePrefixExtensions(_0x17b09f,_0x2f1712,_0x24115f);});});})[_0xe0b0('0x2c')](function(){var _0x2a588d=_0x13adfb[_0xe0b0('0x50')][_0xe0b0('0x29')]({'plain':!![]});if(!_0x2a588d)throw new Error(_0xe0b0('0x51'));if(_0x2a588d['role']===_0xe0b0('0x50')){var _0x57ccc9=_0x17b09f;return db[_0xe0b0('0x52')][_0xe0b0('0x4a')]({'where':{'name':_0xe0b0('0x2a'),'userProfileId':_0x2a588d[_0xe0b0('0x53')]},'raw':!![]})[_0xe0b0('0x2c')](function(_0x3bdb25){if(_0x3bdb25&&_0x3bdb25['autoAssociation']===0x0){return db[_0xe0b0('0x2b')][_0xe0b0('0x54')]({'name':_0x57ccc9[_0xe0b0('0x2e')],'resourceId':_0x57ccc9['id'],'type':_0x3bdb25[_0xe0b0('0x2e')],'sectionId':_0x3bdb25['id']},{})[_0xe0b0('0x2c')](function(){return _0x17b09f;});}else{return _0x17b09f;}})[_0xe0b0('0x55')](function(_0x234cb7){logger[_0xe0b0('0x56')](_0xe0b0('0x57'),_0x234cb7);throw _0x234cb7;});}return _0x17b09f;})[_0xe0b0('0x2c')](respondWithResult(_0x10b5a6,null))[_0xe0b0('0x55')](handleError(_0x10b5a6,null));};function Extension(_0x18ab99,_0xc719d2,_0x10eb99,_0xcdf97){this[_0xe0b0('0x58')]=_0xe0b0('0x59');this[_0xe0b0('0x5a')]=_0x18ab99;this['app']=_0x10eb99;this[_0xe0b0('0x35')]=_0xe0b0('0x5b');this[_0xe0b0('0x5c')]=_0xe0b0('0x5d');this[_0xe0b0('0x5e')]=_0xc719d2;this[_0xe0b0('0x5f')]=_0xcdf97;}function createVoicePrefixExtensions(_0x2bdb59,_0x4f818b,_0x47dcc4){return new BPromise(function(_0x139014,_0x2a0415){var _0x157556=new Extension(formatPrefixName(_0x2bdb59['prefix']),0x1,_0xe0b0('0x60'),_0xe0b0('0x61'));_0x157556[_0xe0b0('0x62')]=_0x2bdb59['id'];return db[_0xe0b0('0x63')][_0xe0b0('0x54')](_0x157556,{'transaction':_0x47dcc4})['then'](function(_0x370f8c){var _0x242120=_0x370f8c[_0xe0b0('0x29')]({'plain':!![]});var _0x54b5d6=_[_0xe0b0('0x31')](addVoicePrefixExtensions(_0x2bdb59,_0x4f818b),function(_0x30b3ae){_0x30b3ae['VoiceExtensionId']=_0x242120['id'];_0x30b3ae[_0xe0b0('0x62')]=_0x2bdb59['id'];return _0x30b3ae;});return db['VoiceExtension']['bulkCreate'](_0x54b5d6,{'transaction':_0x47dcc4})[_0xe0b0('0x2c')](function(_0x57b51e){if(!_0x57b51e){return _0x2a0415('Extensions\x20creation\x20failed');}else{return _0x139014(_0x57b51e);}})[_0xe0b0('0x55')](function(_0xd750b4){return _0x2a0415(_0xd750b4);});});;});};function addVoicePrefixExtensions(_0x2d91f1,_0x1a4fad){var _0x5a7913=[];var _0x3679e0=formatPrefixName(_0x2d91f1[_0xe0b0('0x64')]);_0x5a7913[_0xe0b0('0x65')](new Extension(_0x3679e0,0x2,_0xe0b0('0x66'),_0xe0b0('0x67')+_0x2d91f1[_0xe0b0('0x2e')]));if(_0x2d91f1[_0xe0b0('0x68')]){_0x5a7913[_0xe0b0('0x65')](new Extension(_0x3679e0,0x3,'Set','PREFIX-CALLERIDALL='+_0x2d91f1[_0xe0b0('0x68')]));}else{_0x5a7913[_0xe0b0('0x65')](new Extension(_0x3679e0,0x3,_0xe0b0('0x60'),'No\x20callerid\x20available'));}_0x5a7913['push'](new Extension(_0x3679e0,0x4,_0xe0b0('0x69'),_0x1a4fad[_0xe0b0('0x58')]+','+'${EXTEN:'+(0x8+_0x2d91f1['name'][_0xe0b0('0x3e')])+'}'+','+0x1));return _0x5a7913;}function formatPrefixName(_0x42b2d3){var _0x38eb8e='_';for(var _0x29175a=0x0;_0x29175a<_0x42b2d3[_0xe0b0('0x3e')];_0x29175a++){if(_0x42b2d3[_0xe0b0('0x6a')](_0x29175a)=='-'){_0x38eb8e+=_0x42b2d3[_0xe0b0('0x6a')](_0x29175a);}else{_0x38eb8e+='['+_0x42b2d3[_0xe0b0('0x6a')](_0x29175a)+']';}}_0x38eb8e+='.';return _0x38eb8e;}exports['update']=function(_0x1daff7,_0x12e245,_0x1673bc){var _0x494420=_0x1daff7['body'];_0x494420['prefix']='system-'+_0x494420['name']+'-';return db['sequelize'][_0xe0b0('0x4d')](function(_0x51b492){return db['VoicePrefix'][_0xe0b0('0x27')](_0x494420,{'where':{'id':_0x494420['id']},'transaction':_0x51b492})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x63')][_0xe0b0('0x28')]({'where':{'VoicePrefixId':_0x494420['id']},'transaction':_0x51b492})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x63')][_0xe0b0('0x4a')]({'where':{'id':_0x494420[_0xe0b0('0x4f')]},'raw':!![]})['then'](function(_0x3097fb){return createVoicePrefixExtensions(_0x494420,_0x3097fb,_0x51b492);});});});})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x32')][_0xe0b0('0x6b')](_0x494420['id']);})[_0xe0b0('0x2c')](respondWithResult(_0x12e245,null))[_0xe0b0('0x55')](handleError(_0x12e245,null));};exports[_0xe0b0('0x6c')]=function(_0x5e3e28,_0xaf2607,_0x5981a3){return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x5e3e28[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0xaf2607,null))['then'](function(_0x311f79){if(_0x311f79){return _0x311f79[_0xe0b0('0x6c')](_0x5e3e28['body']['ids'],_[_0xe0b0('0x6d')](_0x5e3e28[_0xe0b0('0x4e')],[_0xe0b0('0x6e'),'id'])||{})[_0xe0b0('0x6f')](function(_0x8b1390){for(var _0x31dd21=0x0;_0x31dd21<_0x5e3e28[_0xe0b0('0x4e')][_0xe0b0('0x6e')][_0xe0b0('0x3e')];_0x31dd21+=0x1){socket[_0xe0b0('0x70')]('userVoicePrefix:save',{'UserId':Number(_0x5e3e28['body'][_0xe0b0('0x6e')][_0x31dd21]),'VoicePrefixId':Number(_0x5e3e28['params']['id'])});}return _0x8b1390;});}})['then'](respondWithResult(_0xaf2607,null))['catch'](handleError(_0xaf2607,null));};exports['removeAgents']=function(_0x55f064,_0x584350,_0x654d2b){return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x55f064[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0x584350,null))[_0xe0b0('0x2c')](function(_0x948708){if(_0x948708){return _0x948708['removeAgents'](_0x55f064[_0xe0b0('0x38')][_0xe0b0('0x6e')])[_0xe0b0('0x2c')](function(){if(_[_0xe0b0('0x71')](_0x55f064[_0xe0b0('0x38')]['ids'])){for(var _0x55d3f8=0x0;_0x55d3f8<_0x55f064['query']['ids']['length'];_0x55d3f8+=0x1){socket[_0xe0b0('0x70')]('userVoicePrefix:remove',{'UserId':Number(_0x55f064[_0xe0b0('0x38')]['ids'][_0x55d3f8]),'VoicePrefixId':Number(_0x55f064[_0xe0b0('0x49')]['id'])});}}else{socket[_0xe0b0('0x70')](_0xe0b0('0x72'),{'UserId':Number(_0x55f064[_0xe0b0('0x38')][_0xe0b0('0x6e')]),'VoicePrefixId':Number(_0x55f064[_0xe0b0('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x584350,null))['catch'](handleError(_0x584350,null));};exports['getAgents']=function(_0x58e0e3,_0xc1919f,_0x261381){var _0x264363={};var _0x4377f7={};var _0x2c1149;var _0x534881;return db[_0xe0b0('0x32')][_0xe0b0('0x73')]({'where':{'id':_0x58e0e3[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0xc1919f,null))[_0xe0b0('0x2c')](function(_0x2a5082){if(_0x2a5082){_0x2c1149=_0x2a5082;_0x4377f7[_0xe0b0('0x37')]=_[_0xe0b0('0x39')](db[_0xe0b0('0x74')]['rawAttributes']);_0x4377f7['query']=_[_0xe0b0('0x39')](_0x58e0e3[_0xe0b0('0x38')]);_0x4377f7['filters']=_[_0xe0b0('0x3b')](_0x4377f7[_0xe0b0('0x37')],_0x4377f7[_0xe0b0('0x38')]);_0x264363[_0xe0b0('0x3c')]=_[_0xe0b0('0x3b')](_0x4377f7[_0xe0b0('0x37')],qs[_0xe0b0('0x3d')](_0x58e0e3[_0xe0b0('0x38')]['fields']));_0x264363['attributes']=_0x264363['attributes'][_0xe0b0('0x3e')]?_0x264363[_0xe0b0('0x3c')]:_0x4377f7['model'];_0x264363[_0xe0b0('0x75')]=qs[_0xe0b0('0x3f')](_0x58e0e3[_0xe0b0('0x38')][_0xe0b0('0x3f')]);_0x264363['where']=qs['filters'](_['pick'](_0x58e0e3[_0xe0b0('0x38')],_0x4377f7[_0xe0b0('0x3a')]));if(_0x58e0e3['query'][_0xe0b0('0x42')]){_0x264363[_0xe0b0('0x40')]=_['merge'](_0x264363['where'],{'$or':_[_0xe0b0('0x31')](_0x264363['attributes'],function(_0x251195){var _0x5f06c0={};_0x5f06c0[_0x251195]={'$like':'%'+_0x58e0e3[_0xe0b0('0x38')][_0xe0b0('0x42')]+'%'};return _0x5f06c0;})});}_0x264363=_[_0xe0b0('0x43')]({},_0x264363,_0x58e0e3[_0xe0b0('0x44')]);return _0x2c1149[_0xe0b0('0x76')](_0x264363);}})[_0xe0b0('0x2c')](function(_0x434dfa){if(_0x434dfa){_0x534881=_0x434dfa[_0xe0b0('0x3e')];if(!_0x58e0e3[_0xe0b0('0x38')]['hasOwnProperty'](_0xe0b0('0x77'))){_0x264363[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x58e0e3['query'][_0xe0b0('0x22')]);_0x264363['offset']=qs[_0xe0b0('0x21')](_0x58e0e3[_0xe0b0('0x38')]['offset']);}return _0x2c1149[_0xe0b0('0x76')](_0x264363);}})['then'](function(_0x528932){if(_0x528932){return _0x528932?{'count':_0x534881,'rows':_0x528932}:null;}})[_0xe0b0('0x2c')](respondWithResult(_0xc1919f,null))['catch'](handleError(_0xc1919f,null));};exports['getTeams']=function(_0x4f027c,_0x1e4bfb,_0x238979){var _0x9e8b9c={};var _0x42b591={};var _0x3da0ce;var _0x4e0429;return db[_0xe0b0('0x32')][_0xe0b0('0x73')]({'where':{'id':_0x4f027c[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e4bfb,null))[_0xe0b0('0x2c')](function(_0x447641){if(_0x447641){_0x3da0ce=_0x447641;_0x42b591['model']=_['keys'](db[_0xe0b0('0x78')]['rawAttributes']);_0x42b591[_0xe0b0('0x38')]=_[_0xe0b0('0x39')](_0x4f027c[_0xe0b0('0x38')]);_0x42b591[_0xe0b0('0x3a')]=_[_0xe0b0('0x3b')](_0x42b591[_0xe0b0('0x37')],_0x42b591[_0xe0b0('0x38')]);_0x9e8b9c['attributes']=_[_0xe0b0('0x3b')](_0x42b591[_0xe0b0('0x37')],qs[_0xe0b0('0x3d')](_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x3d')]));_0x9e8b9c['attributes']=_0x9e8b9c['attributes'][_0xe0b0('0x3e')]?_0x9e8b9c[_0xe0b0('0x3c')]:_0x42b591[_0xe0b0('0x37')];_0x9e8b9c[_0xe0b0('0x75')]=qs[_0xe0b0('0x3f')](_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x3f')]);_0x9e8b9c[_0xe0b0('0x40')]=qs[_0xe0b0('0x3a')](_[_0xe0b0('0x41')](_0x4f027c['query'],_0x42b591[_0xe0b0('0x3a')]));if(_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x42')]){_0x9e8b9c[_0xe0b0('0x40')]=_['merge'](_0x9e8b9c[_0xe0b0('0x40')],{'$or':_[_0xe0b0('0x31')](_0x9e8b9c[_0xe0b0('0x3c')],function(_0x116c16){var _0x476763={};_0x476763[_0x116c16]={'$like':'%'+_0x4f027c['query'][_0xe0b0('0x42')]+'%'};return _0x476763;})});}_0x9e8b9c=_['merge']({},_0x9e8b9c,_0x4f027c[_0xe0b0('0x44')]);return _0x3da0ce[_0xe0b0('0x79')](_0x9e8b9c);}})[_0xe0b0('0x2c')](function(_0x23c448){if(_0x23c448){_0x4e0429=_0x23c448[_0xe0b0('0x3e')];if(!_0x4f027c['query']['hasOwnProperty'](_0xe0b0('0x77'))){_0x9e8b9c['limit']=qs[_0xe0b0('0x22')](_0x4f027c['query'][_0xe0b0('0x22')]);_0x9e8b9c[_0xe0b0('0x21')]=qs[_0xe0b0('0x21')](_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x21')]);}return _0x3da0ce[_0xe0b0('0x79')](_0x9e8b9c);}})[_0xe0b0('0x2c')](function(_0x5d7cee){if(_0x5d7cee){return _0x5d7cee?{'count':_0x4e0429,'rows':_0x5d7cee}:null;}})['then'](respondWithResult(_0x1e4bfb,null))[_0xe0b0('0x55')](handleError(_0x1e4bfb,null));};exports[_0xe0b0('0x7a')]=function(_0x184938,_0x20d6bd,_0xd83992){var _0x2b4d49=_0x184938[_0xe0b0('0x4e')][_0xe0b0('0x6e')];var _0x1bbb0d;return db[_0xe0b0('0x78')]['findAll']({'where':{'id':_0x2b4d49},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x7b'),'attributes':['id',_0xe0b0('0x2e'),_0xe0b0('0x7c'),_0xe0b0('0x7d'),_0xe0b0('0x7e')],'raw':!![]}]})[_0xe0b0('0x2c')](function(_0x33b67a){if(_0x33b67a){_0x1bbb0d=_0x33b67a;var _0x51995b=_['flatMap'](_0x33b67a,function(_0x302f9f){var _0x1ea4d5=_0x302f9f[_0xe0b0('0x29')]({'plain':!![]});return _0x1ea4d5[_0xe0b0('0x7b')];});return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x184938[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](function(_0x6ef3b2){return db[_0xe0b0('0x4c')]['transaction'](function(_0x46b247){return _0x6ef3b2[_0xe0b0('0x7a')](_0x2b4d49,{'transaction':_0x46b247})['then'](function(){return BPromise[_0xe0b0('0x7f')](_0x1bbb0d,function(_0x4250f4){return db[_0xe0b0('0x80')][_0xe0b0('0x81')]({'TeamId':_0x4250f4['id'],'VoicePrefixId':_0x184938[_0xe0b0('0x49')]['id']},{'transaction':_0x46b247});});})['then'](function(){return BPromise[_0xe0b0('0x7f')](_0x51995b,function(_0x38f9af){return db[_0xe0b0('0x82')][_0xe0b0('0x83')]({'where':{'UserId':_0x38f9af['id'],'VoicePrefixId':_0x184938[_0xe0b0('0x49')]['id']},'transaction':_0x46b247});});})['then'](function(){_0x51995b[_0xe0b0('0x84')](function(_0x58d61b){socket[_0xe0b0('0x70')](_0xe0b0('0x85'),{'UserId':_0x58d61b['id'],'VoicePrefixId':_0x6ef3b2['id']});});});});});}})[_0xe0b0('0x2c')](respondWithStatusCode(_0x20d6bd,null))['catch'](handleError(_0x20d6bd,null));};exports['removeTeams']=function(_0x45ae1a,_0x2349df,_0x619226){return db['Team']['findAll']({'where':{'id':_0x45ae1a['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe0b0('0x2c')](handleEntityNotFound(_0x2349df,null))[_0xe0b0('0x2c')](function(_0x5ac132){var _0x121257=_[_0xe0b0('0x31')](_0x5ac132,'id');var _0xfd746a=[];var _0xd73b8a=[];var _0x437588=squel['select']();_0x437588['field'](_0xe0b0('0x86'))[_0xe0b0('0x87')](_0xe0b0('0x88'),'tq')['join'](_0xe0b0('0x89'),'ut',_0xe0b0('0x8a'))[_0xe0b0('0x40')](_0xe0b0('0x8b'),_0x45ae1a[_0xe0b0('0x49')]['id']);for(var _0x1b8d4a=0x0;_0x1b8d4a<_0x5ac132['length'];_0x1b8d4a+=0x1){let _0x581848=_0x5ac132[_0x1b8d4a];for(var _0x495635=0x0;_0x495635<_0x581848[_0xe0b0('0x7b')][_0xe0b0('0x3e')];_0x495635+=0x1){let _0x9f9d8d=_0x581848[_0xe0b0('0x7b')][_0x495635];var _0x266cb5=_0x437588[_0xe0b0('0x8c')]();_0x266cb5[_0xe0b0('0x40')](_0xe0b0('0x8d'),_0x9f9d8d['id']);_0xd73b8a['push'](db['sequelize'][_0xe0b0('0x38')](_0x266cb5[_0xe0b0('0x8e')](),{'type':db[_0xe0b0('0x4c')]['QueryTypes'][_0xe0b0('0x8f')]})[_0xe0b0('0x2c')](function(_0x9f1fb){if(_0x9f1fb['length']===0x1){return _0x9f9d8d['id'];}else{var _0x36fa1f=_['every'](_[_0xe0b0('0x31')](_0x9f1fb,_0xe0b0('0x90')),function(_0x1e74a0){return _[_0xe0b0('0x91')](_0x121257,_0x1e74a0);});if(_0x36fa1f){return _0x9f9d8d['id'];}}}));}}return BPromise[_0xe0b0('0x92')](_0xd73b8a)[_0xe0b0('0x2c')](function(_0x12e46f){_0xfd746a=_(_0xfd746a)['union'](_0x12e46f)[_0xe0b0('0x93')]()[_0xe0b0('0x94')]();return db['VoicePrefix'][_0xe0b0('0x4a')]({'where':{'id':_0x45ae1a[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](function(_0x4dbb7b){return db[_0xe0b0('0x4c')][_0xe0b0('0x4d')](function(_0x221e96){return _0x4dbb7b['removeTeams'](_0x45ae1a[_0xe0b0('0x38')][_0xe0b0('0x6e')],{'transaction':_0x221e96})[_0xe0b0('0x2c')](function(){if(!_[_0xe0b0('0x95')](_0xfd746a)){return _0x4dbb7b[_0xe0b0('0x96')](_0xfd746a,{'transaction':_0x221e96});}})[_0xe0b0('0x2c')](function(){_0xfd746a['forEach'](function(_0x44da91){socket[_0xe0b0('0x70')](_0xe0b0('0x72'),{'UserId':_0x44da91,'VoicePrefixId':_0x4dbb7b['id']});});});});});});})[_0xe0b0('0x2c')](respondWithStatusCode(_0x2349df,null))[_0xe0b0('0x55')](handleError(_0x2349df,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 7f1016d..c72fe4f 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 _0xaee8=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x5715a4,_0x33f690){var _0x24d5fd=function(_0x2a3119){while(--_0x2a3119){_0x5715a4['push'](_0x5715a4['shift']());}};_0x24d5fd(++_0x33f690);}(_0xaee8,0x1af));var _0x8aee=function(_0x4e1857,_0x2a6ccc){_0x4e1857=_0x4e1857-0x0;var _0x2ddd26=_0xaee8[_0x4e1857];return _0x2ddd26;};'use strict';var EventEmitter=require(_0x8aee('0x0'));var VoicePrefix=require(_0x8aee('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8aee('0x2')](0x0);var events={'afterCreate':_0x8aee('0x3'),'afterUpdate':_0x8aee('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1cf4d5){return function(_0x41051f,_0x260be7,_0x1a04cb){VoicePrefixEvents[_0x8aee('0x5')](_0x1cf4d5+':'+_0x41051f['id'],_0x41051f);VoicePrefixEvents[_0x8aee('0x5')](_0x1cf4d5,_0x41051f);_0x1a04cb(null);};}for(var e in events){if(events[_0x8aee('0x6')](e)){var event=events[e];VoicePrefix[_0x8aee('0x7')](e,emitEvent(event));}}module[_0x8aee('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x23a1=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','exports','events'];(function(_0x4be2d8,_0xa56c28){var _0x4812af=function(_0x58a064){while(--_0x58a064){_0x4be2d8['push'](_0x4be2d8['shift']());}};_0x4812af(++_0xa56c28);}(_0x23a1,0x137));var _0x123a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x23a1[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x123a('0x0'));var VoicePrefix=require(_0x123a('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x123a('0x2')](0x0);var events={'afterCreate':_0x123a('0x3'),'afterUpdate':_0x123a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x32bfd9){return function(_0x5a5f27,_0xd2131d,_0x1cb525){VoicePrefixEvents[_0x123a('0x5')](_0x32bfd9+':'+_0x5a5f27['id'],_0x5a5f27);VoicePrefixEvents[_0x123a('0x5')](_0x32bfd9,_0x5a5f27);_0x1cb525(null);};}for(var e in events){if(events[_0x123a('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x123a('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index a16f6c4..88698aa 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 _0xf572=['request-promise','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x303e55,_0x309d5e){var _0xf8a2b9=function(_0x3e7f90){while(--_0x3e7f90){_0x303e55['push'](_0x303e55['shift']());}};_0xf8a2b9(++_0x309d5e);}(_0xf572,0x9a));var _0x2f57=function(_0x5dcf1d,_0x3ae4c1){_0x5dcf1d=_0x5dcf1d-0x0;var _0x54cb5f=_0xf572[_0x5dcf1d];return _0x54cb5f;};'use strict';var _=require(_0x2f57('0x0'));var util=require(_0x2f57('0x1'));var logger=require(_0x2f57('0x2'))(_0x2f57('0x3'));var moment=require(_0x2f57('0x4'));var BPromise=require(_0x2f57('0x5'));var rp=require(_0x2f57('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2f57('0x7'));var attributes=require('./voicePrefix.attributes');module[_0x2f57('0x8')]=function(_0x599028,_0xbdadf5){return _0x599028[_0x2f57('0x9')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc437=['util','../../config/logger','moment','bluebird','request-promise','rimraf','exports','VoicePrefix','lodash'];(function(_0x469d14,_0x190354){var _0x163f05=function(_0x34e556){while(--_0x34e556){_0x469d14['push'](_0x469d14['shift']());}};_0x163f05(++_0x190354);}(_0xc437,0xe0));var _0x7c43=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc437[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7c43('0x0'));var util=require(_0x7c43('0x1'));var logger=require(_0x7c43('0x2'))('api');var moment=require(_0x7c43('0x3'));var BPromise=require(_0x7c43('0x4'));var rp=require(_0x7c43('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c43('0x6'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0x7c43('0x7')]=function(_0x36fc69,_0x4ff769){return _0x36fc69['define'](_0x7c43('0x8'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 2d07519..2a94e0f 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 _0x0a05=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x0a05,0x9e));var _0x50a0=function(_0x21233e,_0x2d39c1){_0x21233e=_0x21233e-0x0;var _0x3752c9=_0x0a05[_0x21233e];return _0x3752c9;};'use strict';var _=require(_0x50a0('0x0'));var util=require(_0x50a0('0x1'));var moment=require(_0x50a0('0x2'));var BPromise=require(_0x50a0('0x3'));var rs=require(_0x50a0('0x4'));var fs=require('fs');var Redis=require(_0x50a0('0x5'));var db=require(_0x50a0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x50a0('0x7'))('rpc');var config=require(_0x50a0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x50a0('0x9')][_0x50a0('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x50a0('0xb')],{'host':_0x50a0('0xc'),'port':0x18eb});var socket=require(_0x50a0('0xd'))(new Redis(config[_0x50a0('0xb')]));require('./voicePrefix.socket')[_0x50a0('0xe')](socket);function respondWithRpcPromise(_0x4bdc66,_0x41bd7b,_0x136e4b){return new BPromise(function(_0x39a17e,_0x4efc6b){return client[_0x50a0('0xf')](_0x4bdc66,_0x136e4b)['then'](function(_0x58080b){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x41bd7b,_0x50a0('0x10'));logger[_0x50a0('0x11')](_0x50a0('0x12'),_0x41bd7b,_0x50a0('0x10'),JSON[_0x50a0('0x13')](_0x58080b));if(_0x58080b['error']){if(_0x58080b[_0x50a0('0x14')][_0x50a0('0x15')]===0x1f4){logger[_0x50a0('0x14')](_0x50a0('0x16'),_0x41bd7b,_0x58080b[_0x50a0('0x14')]['message']);return _0x4efc6b(_0x58080b['error']['message']);}logger['error'](_0x50a0('0x16'),_0x41bd7b,_0x58080b[_0x50a0('0x14')][_0x50a0('0x17')]);return _0x39a17e(_0x58080b[_0x50a0('0x14')][_0x50a0('0x17')]);}else{logger[_0x50a0('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x41bd7b,'request\x20sent');_0x39a17e(_0x58080b[_0x50a0('0x19')][_0x50a0('0x17')]);}})[_0x50a0('0x1a')](function(_0x19bff7){logger[_0x50a0('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x41bd7b,_0x19bff7);_0x4efc6b(_0x19bff7);});});} \ No newline at end of file +var _0xf7f7=['request','then','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','VoicePrefix,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./voicePrefix.socket'];(function(_0x58010d,_0x49b16a){var _0x4f93db=function(_0xa7546d){while(--_0xa7546d){_0x58010d['push'](_0x58010d['shift']());}};_0x4f93db(++_0x49b16a);}(_0xf7f7,0x192));var _0x7f7f=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0xf7f7[_0x349148];return _0x2f2b0f;};'use strict';var _=require(_0x7f7f('0x0'));var util=require(_0x7f7f('0x1'));var moment=require(_0x7f7f('0x2'));var BPromise=require(_0x7f7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f7f('0x4'))['db'];var utils=require(_0x7f7f('0x5'));var logger=require(_0x7f7f('0x6'))(_0x7f7f('0x7'));var config=require('../../config/environment');var jayson=require(_0x7f7f('0x8'));var client=jayson[_0x7f7f('0x9')][_0x7f7f('0xa')]({'port':0x232a});config[_0x7f7f('0xb')]=_['defaults'](config[_0x7f7f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f7f('0xc'))(new Redis(config['redis']));require(_0x7f7f('0xd'))['register'](socket);function respondWithRpcPromise(_0x237049,_0x167cba,_0x297ab0){return new BPromise(function(_0x478b9e,_0x88b55d){return client[_0x7f7f('0xe')](_0x237049,_0x297ab0)[_0x7f7f('0xf')](function(_0x5946fa){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x167cba,_0x7f7f('0x10'));logger[_0x7f7f('0x11')](_0x7f7f('0x12'),_0x167cba,_0x7f7f('0x10'),JSON['stringify'](_0x5946fa));if(_0x5946fa['error']){if(_0x5946fa[_0x7f7f('0x13')][_0x7f7f('0x14')]===0x1f4){logger[_0x7f7f('0x13')](_0x7f7f('0x15'),_0x167cba,_0x5946fa[_0x7f7f('0x13')][_0x7f7f('0x16')]);return _0x88b55d(_0x5946fa[_0x7f7f('0x13')][_0x7f7f('0x16')]);}logger[_0x7f7f('0x13')](_0x7f7f('0x15'),_0x167cba,_0x5946fa[_0x7f7f('0x13')][_0x7f7f('0x16')]);return _0x478b9e(_0x5946fa[_0x7f7f('0x13')][_0x7f7f('0x16')]);}else{logger[_0x7f7f('0x17')](_0x7f7f('0x15'),_0x167cba,_0x7f7f('0x10'));_0x478b9e(_0x5946fa[_0x7f7f('0x18')][_0x7f7f('0x16')]);}})[_0x7f7f('0x19')](function(_0x4313c6){logger['error'](_0x7f7f('0x15'),_0x167cba,_0x4313c6);_0x88b55d(_0x4313c6);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index e9fca90..1e3d847 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 _0xab26=['./voicePrefix.events','save','remove','removeListener','register','length','voicePrefix:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xab26,0xd2));var _0x6ab2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xab26[_0x4565bf];return _0x5610ba;};'use strict';var VoicePrefixEvents=require(_0x6ab2('0x0'));var events=[_0x6ab2('0x1'),_0x6ab2('0x2'),'update'];function createListener(_0x2dfe5c,_0x2a9ffe){return function(_0x5ac05e){_0x2a9ffe['emit'](_0x2dfe5c,_0x5ac05e);};}function removeListener(_0x4c8cf,_0x51bdcd){return function(){VoicePrefixEvents[_0x6ab2('0x3')](_0x4c8cf,_0x51bdcd);};}exports[_0x6ab2('0x4')]=function(_0x31c9f1){for(var _0x56dc80=0x0,_0x41643a=events[_0x6ab2('0x5')];_0x56dc80<_0x41643a;_0x56dc80++){var _0x54bf93=events[_0x56dc80];var _0x140cc1=createListener(_0x6ab2('0x6')+_0x54bf93,_0x31c9f1);VoicePrefixEvents['on'](_0x54bf93,_0x140cc1);}}; \ No newline at end of file +var _0x1a5c=['emit','register','length','voicePrefix:','./voicePrefix.events','save','remove','update'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1a5c,0x12c));var _0xc1a5=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x1a5c[_0x4b2863];return _0x567d67;};'use strict';var VoicePrefixEvents=require(_0xc1a5('0x0'));var events=[_0xc1a5('0x1'),_0xc1a5('0x2'),_0xc1a5('0x3')];function createListener(_0x38b8dd,_0x1da808){return function(_0x36a64){_0x1da808[_0xc1a5('0x4')](_0x38b8dd,_0x36a64);};}function removeListener(_0x2b324b,_0x22243f){return function(){VoicePrefixEvents['removeListener'](_0x2b324b,_0x22243f);};}exports[_0xc1a5('0x5')]=function(_0x1c9b90){for(var _0x411612=0x0,_0x510cf3=events[_0xc1a5('0x6')];_0x411612<_0x510cf3;_0x411612++){var _0x1cf3d7=events[_0x411612];var _0x369ea7=createListener(_0xc1a5('0x7')+_0x1cf3d7,_0x1c9b90);VoicePrefixEvents['on'](_0x1cf3d7,_0x369ea7);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 75ba977..5a374ce 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x55e088,_0x334a90){var _0x3065d4=function(_0x27e222){while(--_0x27e222){_0x55e088['push'](_0x55e088['shift']());}};_0x3065d4(++_0x334a90);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x1c0ac3,_0x361ad7){var _0x51d874=function(_0x4002c4){while(--_0x4002c4){_0x1c0ac3['push'](_0x1c0ac3['shift']());}};_0x51d874(++_0x361ad7);}(_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/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index e8fed57..4f82fad 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 _0x48ce=['outbound','preview','includes','INTEGER','yes','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','booked','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','exports','STRING','ENUM','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','getDataValue','type','dialMethod','strategy'];(function(_0x5b5b0a,_0x3c9aa6){var _0x53ddbc=function(_0x3eec5b){while(--_0x3eec5b){_0x5b5b0a['push'](_0x5b5b0a['shift']());}};_0x53ddbc(++_0x3c9aa6);}(_0x48ce,0xd3));var _0xe48c=function(_0x10699a,_0x3ba4b3){_0x10699a=_0x10699a-0x0;var _0x107477=_0x48ce[_0x10699a];return _0x107477;};'use strict';var Sequelize=require('sequelize');module[_0xe48c('0x0')]={'name':{'type':Sequelize[_0xe48c('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x3'),'outbound'),'allowNull':![],'defaultValue':_0xe48c('0x3')},'musiconhold':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':_0xe48c('0x4')},'announce':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xe48c('0x2')]('rr',_0xe48c('0x5'),_0xe48c('0x6'),_0xe48c('0x7'),_0xe48c('0x8'),_0xe48c('0x9'),_0xe48c('0xa'),_0xe48c('0xb'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x3e6fa4){this[_0xe48c('0xc')]('strategy',_0x3e6fa4?_0x3e6fa4:_0xe48c('0x9'));},'get':function(){var _0x2566f0=this[_0xe48c('0xd')](_0xe48c('0xe'));var _0x5c9ac7=this[_0xe48c('0xd')](_0xe48c('0xf'));var _0x1a8f25=this['getDataValue'](_0xe48c('0x10'));if(_0x2566f0===_0xe48c('0x11')){if(_0x5c9ac7===_0xe48c('0x12')){return null;}if(_0x5c9ac7==='booked'&&!['rrmemory','roundrobin'][_0xe48c('0x13')](_0x1a8f25)){this[_0xe48c('0xc')](_0xe48c('0x10'),_0xe48c('0x9'));}}return _0x1a8f25;}},'servicelevel':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xe48c('0x14')](0xb)},'timeout':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xe48c('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xe48c('0x15')},'autopause':{'type':Sequelize[_0xe48c('0x2')]('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xe48c('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xe48c('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xe48c('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xe48c('0x2')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xe48c('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xe48c('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xe48c('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xe48c('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xe48c('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe48c('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xe48c('0x1')]},'queue_quantity1':{'type':Sequelize[_0xe48c('0x1')]},'queue_quantity2':{'type':Sequelize[_0xe48c('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xe48c('0x1')]},'queue_less_than':{'type':Sequelize[_0xe48c('0x1')]},'periodic_announce':{'type':Sequelize[_0xe48c('0x16')],'set':function(_0x4e633f){this[_0xe48c('0xc')]('periodic_announce',_0x4e633f?_0x4e633f['join'](','):[]);},'get':function(){return this[_0xe48c('0xd')](_0xe48c('0x17'))?this[_0xe48c('0xd')](_0xe48c('0x17'))[_0xe48c('0x18')](','):[];}},'joinempty':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':_0xe48c('0x15'),'set':function(_0x3a1fa6){this[_0xe48c('0xc')](_0xe48c('0x19'),_0x3a1fa6?_0x3a1fa6[_0xe48c('0x1a')](','):undefined);},'get':function(){return this[_0xe48c('0xd')](_0xe48c('0x19'))?this[_0xe48c('0xd')](_0xe48c('0x19'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x5c025e){this[_0xe48c('0xc')](_0xe48c('0x1b'),_0x5c025e?_0x5c025e['join'](','):undefined);},'get':function(){return this[_0xe48c('0xd')](_0xe48c('0x1b'))?this[_0xe48c('0xd')]('leavewhenempty')[_0xe48c('0x18')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xe48c('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xe48c('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe48c('0x1')]},'description':{'type':Sequelize[_0xe48c('0x1')]},'acw':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':0x0,'set':function(_0x4133cb){this[_0xe48c('0xc')](_0xe48c('0x1d'),_0x4133cb);if(_0x4133cb){if(this[_0xe48c('0xd')](_0xe48c('0x1e'))<0x2){this['setDataValue'](_0xe48c('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe48c('0x1f')},'dialMethod':{'type':Sequelize[_0xe48c('0x2')]('preview',_0xe48c('0x20'),_0xe48c('0x21'),_0xe48c('0x22'),_0xe48c('0x23')),'defaultValue':_0xe48c('0x20'),'comment':_0xe48c('0x24')},'dialLimitChannel':{'type':Sequelize[_0xe48c('0x14')](0x4)[_0xe48c('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xe48c('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe48c('0x26')},'dialPowerLevel':{'type':Sequelize[_0xe48c('0x27')](0x2)[_0xe48c('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xe48c('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x29'),'dropRate'),'defaultValue':_0xe48c('0x2a'),'comment':_0xe48c('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xe48c('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xe48c('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xe48c('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe48c('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe48c('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':_0xe48c('0x2f'),'comment':_0xe48c('0x30')},'dialQueueTimeout':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x31')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xe48c('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe48c('0x14')](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe48c('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'comment':_0xe48c('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe48c('0x36')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe48c('0x2')]('always',_0xe48c('0x37'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':0x0,'comment':_0xe48c('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0xe48c('0x14')](0x9)[_0xe48c('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xe48c('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe48c('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe48c('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe48c('0x14')](0x9)[_0xe48c('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xe48c('0x14')](0x9)[_0xe48c('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe48c('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe48c('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe48c('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe48c('0x14')](0x9)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe48c('0x14')](0x5)[_0xe48c('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe48c('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe48c('0x14')](0x9)[_0xe48c('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe48c('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0xe48c('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':0x0,'comment':_0xe48c('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x3f'),'ASC'),'defaultValue':_0xe48c('0x3f')},'dialQueueProject2':{'type':Sequelize[_0xe48c('0x1')],'comment':_0xe48c('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe48c('0x40')},'dialCutDigit':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe48c('0x41')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe48c('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe48c('0x14')](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe48c('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0xe48c('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe48c('0x14')](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe48c('0x45')},'dialMachineMaxRetry':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x46')},'dialMachineRetryFrequency':{'type':Sequelize[_0xe48c('0x14')](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe48c('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe48c('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe48c('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':![],'comment':_0xe48c('0x4a'),'set':function(_0x1f12ce){if(!_0x1f12ce)this[_0xe48c('0xc')](_0xe48c('0x4b'),null);this[_0xe48c('0xc')]('mandatoryDisposition',_0x1f12ce);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xe48c('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':![]}}; \ No newline at end of file +var _0x8c63=['Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\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','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','sequelize','exports','STRING','name','ENUM','inbound','default','ringall','leastrecent','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','type','dialMethod','getDataValue','preview','booked','roundrobin','includes','INTEGER','yes','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','wrapuptime','progressive','power','UNSIGNED'];(function(_0x5246e5,_0x31e9a2){var _0x599ddc=function(_0x262039){while(--_0x262039){_0x5246e5['push'](_0x5246e5['shift']());}};_0x599ddc(++_0x31e9a2);}(_0x8c63,0x1a9));var _0x38c6=function(_0x1d6d34,_0x27e0f1){_0x1d6d34=_0x1d6d34-0x0;var _0x18eca4=_0x8c63[_0x1d6d34];return _0x18eca4;};'use strict';var Sequelize=require(_0x38c6('0x0'));module[_0x38c6('0x1')]={'name':{'type':Sequelize[_0x38c6('0x2')],'allowNull':![],'unique':_0x38c6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x38c6('0x4')](_0x38c6('0x5'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x38c6('0x6')},'announce':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x38c6('0x4')]('rr',_0x38c6('0x7'),_0x38c6('0x8'),'fewestcalls',_0x38c6('0x9'),_0x38c6('0xa'),_0x38c6('0xb'),_0x38c6('0xc'),_0x38c6('0xd')),'allowNull':![],'defaultValue':_0x38c6('0x7'),'set':function(_0x16a275){this[_0x38c6('0xe')](_0x38c6('0xf'),_0x16a275?_0x16a275:_0x38c6('0xa'));},'get':function(){var _0x46a203=this['getDataValue'](_0x38c6('0x10'));var _0x27ccb5=this['getDataValue'](_0x38c6('0x11'));var _0x5e9dd0=this[_0x38c6('0x12')](_0x38c6('0xf'));if(_0x46a203==='outbound'){if(_0x27ccb5===_0x38c6('0x13')){return null;}if(_0x27ccb5===_0x38c6('0x14')&&!['rrmemory',_0x38c6('0x15')][_0x38c6('0x16')](_0x5e9dd0)){this[_0x38c6('0xe')](_0x38c6('0xf'),_0x38c6('0xa'));}}return _0x5e9dd0;}},'servicelevel':{'type':Sequelize[_0x38c6('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x38c6('0x17')](0xb)},'timeout':{'type':Sequelize[_0x38c6('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x38c6('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x38c6('0x2')]},'weight':{'type':Sequelize[_0x38c6('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x38c6('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x38c6('0x4')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x38c6('0x4')](_0x38c6('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x38c6('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x38c6('0x4')](_0x38c6('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x38c6('0x4')](_0x38c6('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x38c6('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x38c6('0x4')](_0x38c6('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x38c6('0x4')](_0x38c6('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x38c6('0x4')](_0x38c6('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x38c6('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x38c6('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x38c6('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x38c6('0x4')](_0x38c6('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x38c6('0x18'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0x38c6('0x18'),'no',_0x38c6('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x38c6('0x4')](_0x38c6('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x38c6('0x2')]},'queue_youarenext':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x38c6('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x38c6('0x2')]},'queue_quantity1':{'type':Sequelize[_0x38c6('0x2')]},'queue_quantity2':{'type':Sequelize[_0x38c6('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x38c6('0x2')]},'periodic_announce':{'type':Sequelize[_0x38c6('0x1a')],'set':function(_0x4e3477){this[_0x38c6('0xe')]('periodic_announce',_0x4e3477?_0x4e3477['join'](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this['getDataValue'](_0x38c6('0x1b'))[_0x38c6('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':_0x38c6('0x18'),'set':function(_0x4cdf22){this[_0x38c6('0xe')]('joinempty',_0x4cdf22?_0x4cdf22['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x38c6('0x1d'))?this[_0x38c6('0x12')]('joinempty')[_0x38c6('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x478cd8){this['setDataValue']('leavewhenempty',_0x478cd8?_0x478cd8[_0x38c6('0x1e')](','):undefined);},'get':function(){return this[_0x38c6('0x12')](_0x38c6('0x1f'))?this['getDataValue'](_0x38c6('0x1f'))[_0x38c6('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x38c6('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x38c6('0x4')](_0x38c6('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x38c6('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x38c6('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x38c6('0x2')]},'description':{'type':Sequelize[_0x38c6('0x2')]},'acw':{'type':Sequelize[_0x38c6('0x20')],'defaultValue':0x0,'set':function(_0x2312a2){this[_0x38c6('0xe')]('acw',_0x2312a2);if(_0x2312a2){if(this['getDataValue']('wrapuptime')<0x2){this[_0x38c6('0xe')](_0x38c6('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x38c6('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x38c6('0x4')](_0x38c6('0x13'),_0x38c6('0x22'),_0x38c6('0x23'),'predictive',_0x38c6('0x14')),'defaultValue':_0x38c6('0x22'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x38c6('0x17')](0x4)[_0x38c6('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x38c6('0x25')},'dialLimitQueue':{'type':Sequelize[_0x38c6('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x38c6('0x26')](0x2)[_0x38c6('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x38c6('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x38c6('0x4')]('agentBusyFactor',_0x38c6('0x28')),'defaultValue':_0x38c6('0x28'),'comment':_0x38c6('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x38c6('0x26')](0x2)[_0x38c6('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x38c6('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x38c6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x38c6('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38c6('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':'tTxX','comment':_0x38c6('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x38c6('0x17')](0x3)[_0x38c6('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38c6('0x2d')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x38c6('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38c6('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x38c6('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38c6('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x38c6('0x17')](0x3)[_0x38c6('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x38c6('0x17')](0x5)[_0x38c6('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38c6('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x38c6('0x17')](0x3)[_0x38c6('0x24')],'defaultValue':0x3,'comment':_0x38c6('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x38c6('0x17')](0x5)[_0x38c6('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38c6('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x38c6('0x17')](0x3)[_0x38c6('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x38c6('0x34')},'dialTimezone':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x38c6('0x35')},'dialPrefix':{'type':Sequelize[_0x38c6('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x38c6('0x4')]('always',_0x38c6('0x36'),_0x38c6('0x37')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x38c6('0x20')],'defaultValue':0x0,'comment':_0x38c6('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x38c6('0x17')](0x9)[_0x38c6('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x38c6('0x17')](0x9)[_0x38c6('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x38c6('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x38c6('0x17')](0x9)[_0x38c6('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x38c6('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x38c6('0x17')](0x9)[_0x38c6('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x38c6('0x17')](0x9)[_0x38c6('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x38c6('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x38c6('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x38c6('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x38c6('0x17')](0x9)[_0x38c6('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x38c6('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x38c6('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x38c6('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x38c6('0x17')](0x9)[_0x38c6('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x38c6('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x38c6('0x17')](0x5)[_0x38c6('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x38c6('0x40')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x38c6('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x38c6('0x4')](_0x38c6('0x42'),_0x38c6('0x43')),'defaultValue':_0x38c6('0x42')},'dialQueueProject2':{'type':Sequelize[_0x38c6('0x2')],'comment':_0x38c6('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x38c6('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x38c6('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x38c6('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x38c6('0x44')},'dialCutDigit':{'type':Sequelize[_0x38c6('0x17')](0x3)[_0x38c6('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x38c6('0x17')](0x3)[_0x38c6('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38c6('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x38c6('0x17')](0x5)[_0x38c6('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38c6('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x38c6('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x38c6('0x17')](0x5)[_0x38c6('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x38c6('0x17')](0x3)[_0x38c6('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38c6('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x38c6('0x17')](0x5)[_0x38c6('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38c6('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x38c6('0x17')](0x3)[_0x38c6('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38c6('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x38c6('0x17')](0x5)[_0x38c6('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38c6('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x38c6('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x38c6('0x17')](0x5)[_0x38c6('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38c6('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x38c6('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x221f86){if(!_0x221f86)this['setDataValue'](_0x38c6('0x4c'),null);this[_0x38c6('0xe')]('mandatoryDisposition',_0x221f86);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x38c6('0x17')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x38c6('0x17')](0x3)[_0x38c6('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x38c6('0x20')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x38c6('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x38c6('0x20')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 33f9f28..0835af4 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 _0x55ca=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','merge','omit','createdAt','updatedAt','VoiceQueues','UserProfileResource','findOne','CmHopper','hasOwnProperty','nolimit','limit','order','sort','where','rows','getHopperHistories','CmHopperHistory','pick','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','penalty','sequelize','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','interface','format','SIP/%s','forEach','emit','userVoiceQueue:save','removeTeams','select','tq.TeamId','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','union','transaction','isEmpty','userVoiceQueue:remove','addAgents','ids','spread','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','ContactId','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','COALESCE(phone,\x27\x27)','push','cm_hopper_additional_phones','CmHopperId','h.id','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','phone\x20IS\x20NOT\x20NULL','removeBlackLists','moment','bluebird','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','status','end','json','undefined','count','offset','set','Content-Range','update','then','destroy','get','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','sendStatus','error','stack','name','send','index','map','VoiceQueue','key','getOptions','include','query','findAll','catch','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','options'];(function(_0x2185fd,_0x1a7450){var _0x1e5e58=function(_0x2470e9){while(--_0x2470e9){_0x2185fd['push'](_0x2185fd['shift']());}};_0x1e5e58(++_0x1a7450);}(_0x55ca,0x126));var _0xa55c=function(_0x24b53b,_0x57c20d){_0x24b53b=_0x24b53b-0x0;var _0x3b5c00=_0x55ca[_0x24b53b];return _0x3b5c00;};'use strict';var moment=require(_0xa55c('0x0'));var BPromise=require(_0xa55c('0x1'));var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require(_0xa55c('0x2'));var qs=require(_0xa55c('0x3'));var logger=require('../../config/logger')(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var db=require(_0xa55c('0x6'))['db'];config[_0xa55c('0x7')]=_[_0xa55c('0x8')](config[_0xa55c('0x7')],{'host':_0xa55c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa55c('0x7')]));require(_0xa55c('0xa'))['register'](socket);function respondWithStatusCode(_0x291996,_0x290d28){_0x290d28=_0x290d28||0xcc;return function(_0x52a3bc){if(_0x52a3bc){return _0x291996['sendStatus'](_0x290d28);}return _0x291996[_0xa55c('0xb')](_0x290d28)[_0xa55c('0xc')]();};}function respondWithResult(_0x381d07,_0x5d8e5a){_0x5d8e5a=_0x5d8e5a||0xc8;return function(_0x31646d){if(_0x31646d){return _0x381d07[_0xa55c('0xb')](_0x5d8e5a)[_0xa55c('0xd')](_0x31646d);}};}function respondWithFilteredResult(_0x70c2de,_0x3998f7){return function(_0x15eec8){if(_0x15eec8){var _0x5d47ff=typeof _0x3998f7['offset']===_0xa55c('0xe')&&typeof _0x3998f7['limit']==='undefined';var _0x59ea8d=_0x15eec8[_0xa55c('0xf')];var _0x3930e4=_0x5d47ff?0x0:_0x3998f7[_0xa55c('0x10')];var _0x938bd6=_0x5d47ff?_0x15eec8[_0xa55c('0xf')]:_0x3998f7[_0xa55c('0x10')]+_0x3998f7['limit'];var _0x3ccf65;if(_0x938bd6>=_0x59ea8d){_0x938bd6=_0x59ea8d;_0x3ccf65=0xc8;}else{_0x3ccf65=0xce;}_0x70c2de[_0xa55c('0xb')](_0x3ccf65);return _0x70c2de[_0xa55c('0x11')](_0xa55c('0x12'),_0x3930e4+'-'+_0x938bd6+'/'+_0x59ea8d)[_0xa55c('0xd')](_0x15eec8);}return null;};}function saveUpdates(_0x3ae86b){return function(_0x51590e){if(_0x51590e){return _0x51590e[_0xa55c('0x13')](_0x3ae86b)[_0xa55c('0x14')](function(_0x4cee3c){return _0x4cee3c;});}return null;};}function removeEntity(_0x3d4c9e){return function(_0x104a99){if(_0x104a99){return _0x104a99[_0xa55c('0x15')]()[_0xa55c('0x14')](function(){var _0x23a1ae=_0x104a99[_0xa55c('0x16')]({'plain':!![]});var _0x4c0daf=[{'name':'VoiceQueues','value':_0xa55c('0x17'),'ignore':![]},{'name':_0xa55c('0x18'),'value':_0xa55c('0x19'),'ignore':![]}];var _0x4cfe10=_(_0x4c0daf)[_0xa55c('0x1a')](_0xa55c('0x1b'))['map'](_0xa55c('0x1c'))[_0xa55c('0x1c')]();if(_[_0xa55c('0x1d')](_0x4cfe10,_0x23a1ae[_0xa55c('0x1e')])){return;}var _0x234372=_['find'](_0x4c0daf,[_0xa55c('0x1c'),_0x23a1ae['type']])['name'];return db['UserProfileResource'][_0xa55c('0x15')]({'where':{'type':_0x234372,'resourceId':_0x23a1ae['id']}})['then'](function(){return _0x104a99;});})[_0xa55c('0x14')](function(){_0x3d4c9e[_0xa55c('0xb')](0xcc)[_0xa55c('0xc')]();});}};}function handleEntityNotFound(_0xf0e574){return function(_0x2313a9){if(!_0x2313a9){_0xf0e574[_0xa55c('0x1f')](0x194);}return _0x2313a9;};}function handleError(_0x1da633,_0x11e7f7){_0x11e7f7=_0x11e7f7||0x1f4;return function(_0x192df2){logger[_0xa55c('0x20')](_0x192df2[_0xa55c('0x21')]);if(_0x192df2['name']){delete _0x192df2[_0xa55c('0x22')];}_0x1da633[_0xa55c('0xb')](_0x11e7f7)[_0xa55c('0x23')](_0x192df2);};}exports[_0xa55c('0x24')]=function(_0x5d940d,_0x1377b0){var _0x22f6b6={};var _0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x25')](db[_0xa55c('0x26')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x1e')][_0xa55c('0x27')]};});_0x22f6b6=qs[_0xa55c('0x28')](_0x201941,_0x5d940d);var _0x223813={'where':_0x22f6b6['where']};return db[_0xa55c('0x26')][_0xa55c('0xf')](_0x223813)[_0xa55c('0x14')](function(_0x20da31){_0x1b8388[_0xa55c('0xf')]=_0x20da31;_0x22f6b6[_0xa55c('0x29')]=qs[_0xa55c('0x29')](_0x5d940d[_0xa55c('0x2a')]);return db[_0xa55c('0x26')][_0xa55c('0x2b')](_0x22f6b6);})[_0xa55c('0x14')](function(_0x4eb7c4){_0x1b8388['rows']=_0x4eb7c4;return _0x1b8388;})[_0xa55c('0x14')](respondWithFilteredResult(_0x1377b0,_0x22f6b6))[_0xa55c('0x2c')](handleError(_0x1377b0,null));};exports['show']=function(_0x30fadd,_0x2f0110){var _0x2e9623={'raw':![],'where':{'id':_0x30fadd[_0xa55c('0x2d')]['id']}},_0x1839ac={};_0x1839ac[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x26')][_0xa55c('0x30')]);_0x1839ac['query']=_['keys'](_0x30fadd['query']);_0x1839ac[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x1839ac[_0xa55c('0x2e')],_0x1839ac['query']);_0x2e9623[_0xa55c('0x33')]=_['intersection'](_0x1839ac[_0xa55c('0x2e')],qs['fields'](_0x30fadd[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x2e9623[_0xa55c('0x33')]=_0x2e9623['attributes'][_0xa55c('0x35')]?_0x2e9623[_0xa55c('0x33')]:_0x1839ac['model'];if(_0x30fadd[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x2e9623['include']=[{'all':!![]}];}_0x2e9623=_['merge']({},_0x2e9623,_0x30fadd[_0xa55c('0x37')]);return db['VoiceQueue'][_0xa55c('0x38')](_0x2e9623)[_0xa55c('0x14')](handleEntityNotFound(_0x2f0110,null))['then'](respondWithResult(_0x2f0110,null))['catch'](handleError(_0x2f0110,null));};exports['create']=function(_0x4de781,_0x3b3308){return db[_0xa55c('0x26')][_0xa55c('0x39')](_0x4de781[_0xa55c('0x3a')],{})[_0xa55c('0x14')](function(_0x56d17c){var _0x3d52d8=_0x4de781[_0xa55c('0x3b')][_0xa55c('0x16')]({'plain':!![]});if(!_0x3d52d8)throw new Error(_0xa55c('0x3c'));if(_0x3d52d8[_0xa55c('0x3d')]===_0xa55c('0x3b')){var _0x554620=_0x56d17c[_0xa55c('0x16')]({'plain':!![]});var _0x5ee63d=[{'name':'VoiceQueues','value':_0xa55c('0x17')},{'name':_0xa55c('0x18'),'value':'outbound'}];var _0x2bd98b=_['find'](_0x5ee63d,['value',_0x554620[_0xa55c('0x1e')]])[_0xa55c('0x22')];return db[_0xa55c('0x3e')]['find']({'where':{'name':_0x2bd98b,'userProfileId':_0x3d52d8[_0xa55c('0x3f')]},'raw':!![]})[_0xa55c('0x14')](function(_0x5d9d5d){if(_0x5d9d5d&&_0x5d9d5d[_0xa55c('0x40')]===0x0){return db['UserProfileResource'][_0xa55c('0x39')]({'name':_0x554620[_0xa55c('0x22')],'resourceId':_0x554620['id'],'type':_0x5d9d5d['name'],'sectionId':_0x5d9d5d['id']},{})[_0xa55c('0x14')](function(){return _0x56d17c;});}else{return _0x56d17c;}})[_0xa55c('0x2c')](function(_0x5d834d){logger[_0xa55c('0x20')](_0xa55c('0x41'),_0x5d834d);throw _0x5d834d;});}return _0x56d17c;})[_0xa55c('0x14')](respondWithResult(_0x3b3308,0xc9))['catch'](handleError(_0x3b3308,null));};exports[_0xa55c('0x42')]=function(_0x582901,_0x2f9717){var _0x3a8af4={'where':{'id':_0x582901['params']['id']}},_0x451269={};_0x451269[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db['VoiceQueue'][_0xa55c('0x30')]);_0x3a8af4[_0xa55c('0x33')]=_['intersection'](_0x451269[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x582901['query'][_0xa55c('0x34')]));_0x3a8af4[_0xa55c('0x33')]=_0x3a8af4[_0xa55c('0x33')][_0xa55c('0x35')]?_0x3a8af4['attributes']:_0x451269[_0xa55c('0x2e')];if(_0x582901['query'][_0xa55c('0x36')]){_0x3a8af4[_0xa55c('0x29')]=[{'all':!![]}];}_0x3a8af4=_[_0xa55c('0x43')]({},_0x3a8af4,_0x582901['options']);return db[_0xa55c('0x26')][_0xa55c('0x38')](_0x3a8af4)['then'](handleEntityNotFound(_0x2f9717,null))[_0xa55c('0x14')](function(_0x34de95){if(_0x34de95){var _0x3822b7=_0x34de95[_0xa55c('0x16')]({'plain':!![]});_0x3822b7=qs[_0xa55c('0x44')](_0x3822b7,['id',_0xa55c('0x45'),_0xa55c('0x46')]);_0x582901[_0xa55c('0x3a')]=_[_0xa55c('0x44')](_0x582901[_0xa55c('0x3a')],['id','createdAt',_0xa55c('0x46')]);return db[_0xa55c('0x26')][_0xa55c('0x39')](_['merge'](_0x3822b7,_0x582901[_0xa55c('0x3a')]),{'include':_0x582901[_0xa55c('0x2a')]['includeAll']?[{'all':!![]}]:undefined})[_0xa55c('0x14')](function(_0x4fa412){var _0x2b6a0e=_0x582901[_0xa55c('0x3b')][_0xa55c('0x16')]({'plain':!![]});if(!_0x2b6a0e)throw new Error(_0xa55c('0x3c'));if(_0x2b6a0e[_0xa55c('0x3d')]==='user'){var _0x44b7c1=_0x4fa412[_0xa55c('0x16')]({'plain':!![]});var _0x4b85cc=[{'name':_0xa55c('0x47'),'value':_0xa55c('0x17')},{'name':_0xa55c('0x18'),'value':_0xa55c('0x19')}];var _0x50176b=_['find'](_0x4b85cc,[_0xa55c('0x1c'),_0x44b7c1[_0xa55c('0x1e')]])[_0xa55c('0x22')];return db[_0xa55c('0x3e')]['find']({'where':{'name':_0x50176b,'userProfileId':_0x2b6a0e[_0xa55c('0x3f')]},'raw':!![]})['then'](function(_0x2742e4){if(_0x2742e4&&_0x2742e4[_0xa55c('0x40')]===0x0){return db[_0xa55c('0x48')][_0xa55c('0x39')]({'name':_0x44b7c1[_0xa55c('0x22')],'resourceId':_0x44b7c1['id'],'type':_0x2742e4['name'],'sectionId':_0x2742e4['id']},{})[_0xa55c('0x14')](function(){return _0x4fa412;});}else{return _0x4fa412;}})['catch'](function(_0x23f67f){logger[_0xa55c('0x20')](_0xa55c('0x41'),_0x23f67f);throw _0x23f67f;});}return _0x4fa412;});}})[_0xa55c('0x14')](respondWithResult(_0x2f9717,0xc9))[_0xa55c('0x2c')](handleError(_0x2f9717,null));};exports[_0xa55c('0x13')]=function(_0x5d14e0,_0x53e2be){if(_0x5d14e0[_0xa55c('0x3a')]['id']){delete _0x5d14e0[_0xa55c('0x3a')]['id'];}return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x5d14e0[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x53e2be,null))[_0xa55c('0x14')](saveUpdates(_0x5d14e0[_0xa55c('0x3a')],null))[_0xa55c('0x14')](respondWithResult(_0x53e2be,null))[_0xa55c('0x2c')](handleError(_0x53e2be,null));};exports[_0xa55c('0x15')]=function(_0x493f51,_0xdd92c1){return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x493f51[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0xdd92c1,null))['then'](removeEntity(_0xdd92c1,null))[_0xa55c('0x2c')](handleError(_0xdd92c1,null));};exports['getHoppers']=function(_0x2e482a,_0x5e3a28){var _0x3495a7={'raw':![],'where':{}};var _0x5a8897={};var _0x34edc5={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x2e482a[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x5e3a28,null))[_0xa55c('0x14')](function(_0xafaf8c){if(_0xafaf8c){_0x5a8897[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x4a')]['rawAttributes']);_0x5a8897[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x2e482a['query']);_0x5a8897[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x5a8897[_0xa55c('0x2e')],_0x5a8897[_0xa55c('0x2a')]);_0x3495a7[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x5a8897[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x2e482a['query'][_0xa55c('0x34')]));_0x3495a7[_0xa55c('0x33')]=_0x3495a7[_0xa55c('0x33')][_0xa55c('0x35')]?_0x3495a7[_0xa55c('0x33')]:_0x5a8897[_0xa55c('0x2e')];if(!_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x3495a7['limit']=qs[_0xa55c('0x4d')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x3495a7[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x10')]);}_0x3495a7[_0xa55c('0x4e')]=qs[_0xa55c('0x4f')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x3495a7['where']=qs[_0xa55c('0x31')](_['pick'](_0x2e482a[_0xa55c('0x2a')],_0x5a8897[_0xa55c('0x31')]));_0x3495a7[_0xa55c('0x50')]['VoiceQueueId']=_0xafaf8c['id'];if(_0x2e482a['query'][_0xa55c('0x1a')]){_0x3495a7[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x3495a7[_0xa55c('0x50')],{'$or':_['map'](_0x3495a7[_0xa55c('0x33')],function(_0xd02251){var _0x8ea1c6={};_0x8ea1c6[_0xd02251]={'$like':'%'+_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x8ea1c6;})});}_0x3495a7=_['merge']({},_0x3495a7,_0x2e482a['options']);return db[_0xa55c('0x4a')][_0xa55c('0xf')]({'where':_0x3495a7[_0xa55c('0x50')]})[_0xa55c('0x14')](function(_0x1af9d5){_0x34edc5['count']=_0x1af9d5;if(_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x3495a7['include']=[{'all':!![]}];}return db[_0xa55c('0x4a')][_0xa55c('0x2b')](_0x3495a7);})[_0xa55c('0x14')](function(_0x4dcb93){_0x34edc5[_0xa55c('0x51')]=_0x4dcb93;return _0x34edc5;});}})[_0xa55c('0x14')](respondWithFilteredResult(_0x5e3a28,_0x3495a7))[_0xa55c('0x2c')](handleError(_0x5e3a28,null));};exports[_0xa55c('0x52')]=function(_0x232143,_0x506f74){var _0x25bd5b={'raw':!![],'where':{}};var _0x2e2cf6={};var _0x4bf233={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x232143['params']['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x506f74,null))[_0xa55c('0x14')](function(_0x2f13db){if(_0x2f13db){_0x2e2cf6[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x53')][_0xa55c('0x30')]);_0x2e2cf6[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x232143['query']);_0x2e2cf6[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x2e2cf6[_0xa55c('0x2e')],_0x2e2cf6[_0xa55c('0x2a')]);_0x25bd5b['attributes']=_[_0xa55c('0x32')](_0x2e2cf6[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x232143[_0xa55c('0x2a')]['fields']));_0x25bd5b['attributes']=_0x25bd5b[_0xa55c('0x33')][_0xa55c('0x35')]?_0x25bd5b[_0xa55c('0x33')]:_0x2e2cf6[_0xa55c('0x2e')];if(!_0x232143['query']['hasOwnProperty'](_0xa55c('0x4c'))){_0x25bd5b[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x232143[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x25bd5b[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x232143['query'][_0xa55c('0x10')]);}_0x25bd5b['order']=qs[_0xa55c('0x4f')](_0x232143['query'][_0xa55c('0x4f')]);_0x25bd5b[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x232143[_0xa55c('0x2a')],_0x2e2cf6[_0xa55c('0x31')]));_0x25bd5b[_0xa55c('0x50')][_0xa55c('0x55')]=_0x2f13db['id'];if(_0x232143['query']['filter']){_0x25bd5b[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x25bd5b[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x25bd5b[_0xa55c('0x33')],function(_0x137728){var _0x47e8e2={};_0x47e8e2[_0x137728]={'$like':'%'+_0x232143[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x47e8e2;})});}_0x25bd5b=_[_0xa55c('0x43')]({},_0x25bd5b,_0x232143[_0xa55c('0x37')]);return db[_0xa55c('0x53')][_0xa55c('0xf')]({'where':_0x25bd5b[_0xa55c('0x50')]})[_0xa55c('0x14')](function(_0x58b670){_0x4bf233[_0xa55c('0xf')]=_0x58b670;if(_0x232143[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x25bd5b[_0xa55c('0x29')]=[{'all':!![]}];}return db[_0xa55c('0x53')]['findAll'](_0x25bd5b);})[_0xa55c('0x14')](function(_0x2ab1f2){_0x4bf233['rows']=_0x2ab1f2;return _0x4bf233;});}})['then'](respondWithFilteredResult(_0x506f74,_0x25bd5b))[_0xa55c('0x2c')](handleError(_0x506f74,null));};exports[_0xa55c('0x56')]=function(_0x5c2229,_0x559e71){var _0x579726={'raw':!![],'where':{}};var _0x5ab79e={};var _0xf8e295={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x5c2229[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x559e71,null))[_0xa55c('0x14')](function(_0x568a5b){if(_0x568a5b){_0x5ab79e[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x57')][_0xa55c('0x30')]);_0x5ab79e['query']=_[_0xa55c('0x2f')](_0x5c2229[_0xa55c('0x2a')]);_0x5ab79e[_0xa55c('0x31')]=_['intersection'](_0x5ab79e[_0xa55c('0x2e')],_0x5ab79e['query']);_0x579726['attributes']=_[_0xa55c('0x32')](_0x5ab79e[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x579726[_0xa55c('0x33')]=_0x579726[_0xa55c('0x33')]['length']?_0x579726['attributes']:_0x5ab79e[_0xa55c('0x2e')];if(!_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x579726[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x579726[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x5c2229['query'][_0xa55c('0x10')]);}_0x579726[_0xa55c('0x4e')]=qs['sort'](_0x5c2229[_0xa55c('0x2a')]['sort']);_0x579726[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x5c2229[_0xa55c('0x2a')],_0x5ab79e[_0xa55c('0x31')]));_0x579726['where'][_0xa55c('0x55')]=_0x568a5b['id'];if(_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x579726[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x579726[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x579726['attributes'],function(_0x49a307){var _0x5c08e5={};_0x5c08e5[_0x49a307]={'$like':'%'+_0x5c2229[_0xa55c('0x2a')]['filter']+'%'};return _0x5c08e5;})});}_0x579726=_[_0xa55c('0x43')]({},_0x579726,_0x5c2229[_0xa55c('0x37')]);return db[_0xa55c('0x57')][_0xa55c('0xf')]({'where':_0x579726[_0xa55c('0x50')]})['then'](function(_0x253d7a){_0xf8e295['count']=_0x253d7a;if(_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x579726[_0xa55c('0x29')]=[{'all':!![]}];}return db[_0xa55c('0x57')]['findAll'](_0x579726);})[_0xa55c('0x14')](function(_0x46f8ab){_0xf8e295[_0xa55c('0x51')]=_0x46f8ab;return _0xf8e295;});}})[_0xa55c('0x14')](respondWithFilteredResult(_0x559e71,_0x579726))[_0xa55c('0x2c')](handleError(_0x559e71,null));};exports[_0xa55c('0x58')]=function(_0x270bd0,_0x472c73){var _0x5bae40={'raw':!![],'where':{}};var _0x147962={};var _0x1538dc={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x270bd0[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x472c73,null))['then'](function(_0x46124b){if(_0x46124b){_0x147962['model']=_[_0xa55c('0x2f')](db['CmHopperBlack'][_0xa55c('0x30')]);_0x147962[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x270bd0['query']);_0x147962[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x147962[_0xa55c('0x2e')],_0x147962['query']);_0x5bae40[_0xa55c('0x33')]=_['intersection'](_0x147962[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x270bd0['query'][_0xa55c('0x34')]));_0x5bae40['attributes']=_0x5bae40[_0xa55c('0x33')][_0xa55c('0x35')]?_0x5bae40['attributes']:_0x147962[_0xa55c('0x2e')];if(!_0x270bd0[_0xa55c('0x2a')]['hasOwnProperty'](_0xa55c('0x4c'))){_0x5bae40[_0xa55c('0x4d')]=qs['limit'](_0x270bd0[_0xa55c('0x2a')]['limit']);_0x5bae40['offset']=qs[_0xa55c('0x10')](_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x10')]);}_0x5bae40[_0xa55c('0x4e')]=qs['sort'](_0x270bd0[_0xa55c('0x2a')]['sort']);_0x5bae40[_0xa55c('0x50')]=qs['filters'](_['pick'](_0x270bd0['query'],_0x147962[_0xa55c('0x31')]));_0x5bae40['where']['VoiceQueueId']=_0x46124b['id'];if(_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x5bae40[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x5bae40[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x5bae40[_0xa55c('0x33')],function(_0x9225d9){var _0x465801={};_0x465801[_0x9225d9]={'$like':'%'+_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x465801;})});}_0x5bae40=_[_0xa55c('0x43')]({},_0x5bae40,_0x270bd0[_0xa55c('0x37')]);return db['CmHopperBlack'][_0xa55c('0xf')]({'where':_0x5bae40['where']})['then'](function(_0x5c8003){_0x1538dc[_0xa55c('0xf')]=_0x5c8003;if(_0x270bd0['query'][_0xa55c('0x36')]){_0x5bae40['include']=[{'all':!![]}];}return db[_0xa55c('0x59')]['findAll'](_0x5bae40);})['then'](function(_0xfb1954){_0x1538dc['rows']=_0xfb1954;return _0x1538dc;});}})['then'](respondWithFilteredResult(_0x472c73,_0x5bae40))[_0xa55c('0x2c')](handleError(_0x472c73,null));};exports[_0xa55c('0x5a')]=function(_0x4ba496,_0x11349d){var _0x55caeb={};var _0x294e54={};var _0x403dff;var _0x1dcd8a;return db['VoiceQueue']['findOne']({'where':{'id':_0x4ba496[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x11349d,null))[_0xa55c('0x14')](function(_0xfda07f){if(_0xfda07f){_0x403dff=_0xfda07f;_0x294e54[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x5b')][_0xa55c('0x30')]);_0x294e54['query']=_[_0xa55c('0x2f')](_0x4ba496[_0xa55c('0x2a')]);_0x294e54[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x294e54[_0xa55c('0x2e')],_0x294e54[_0xa55c('0x2a')]);_0x55caeb[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x294e54[_0xa55c('0x2e')],qs['fields'](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x55caeb[_0xa55c('0x33')]=_0x55caeb['attributes']['length']?_0x55caeb['attributes']:_0x294e54[_0xa55c('0x2e')];_0x55caeb['order']=qs[_0xa55c('0x4f')](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x55caeb[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x4ba496[_0xa55c('0x2a')],_0x294e54[_0xa55c('0x31')]));if(_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x55caeb[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x55caeb[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x55caeb[_0xa55c('0x33')],function(_0x1c7aec){var _0xf0bcac={};_0xf0bcac[_0x1c7aec]={'$like':'%'+_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0xf0bcac;})});}_0x55caeb=_[_0xa55c('0x43')]({},_0x55caeb,_0x4ba496[_0xa55c('0x37')]);return _0x403dff[_0xa55c('0x5a')](_0x55caeb);}})[_0xa55c('0x14')](function(_0x168b3f){if(_0x168b3f){_0x1dcd8a=_0x168b3f['length'];if(!_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4b')]('nolimit')){_0x55caeb[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x55caeb[_0xa55c('0x10')]=qs['offset'](_0x4ba496[_0xa55c('0x2a')]['offset']);}return _0x403dff['getTeams'](_0x55caeb);}})[_0xa55c('0x14')](function(_0x1c9903){if(_0x1c9903){return _0x1c9903?{'count':_0x1dcd8a,'rows':_0x1c9903}:null;}})[_0xa55c('0x14')](respondWithResult(_0x11349d,null))[_0xa55c('0x2c')](handleError(_0x11349d,null));};exports[_0xa55c('0x5c')]=function(_0x23b513,_0x1e4464){var _0xd9f634=_0x23b513[_0xa55c('0x3a')][_0xa55c('0x5d')];var _0x1036b3=_[_0xa55c('0x25')](_0xd9f634,'id');return db[_0xa55c('0x5b')][_0xa55c('0x2b')]({'where':{'id':_0x1036b3},'attributes':['id'],'include':[{'model':db[_0xa55c('0x5e')],'as':_0xa55c('0x5f'),'attributes':['id',_0xa55c('0x22'),_0xa55c('0x60'),_0xa55c('0x61'),'interface'],'raw':!![]}]})['then'](function(_0x55a98d){if(_0x55a98d){var _0x200c28=_[_0xa55c('0x62')](_0x55a98d,function(_0x5e41b3){var _0x45b329=_0x5e41b3['get']({'plain':!![]});_0x45b329[_0xa55c('0x5f')]['forEach'](function(_0x3060f2){_0x3060f2[_0xa55c('0x63')]=_[_0xa55c('0x38')](_0xd9f634,{'id':_0x45b329['id']})[_0xa55c('0x63')];});return _0x45b329[_0xa55c('0x5f')];});return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x23b513[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(_0x665054){return db[_0xa55c('0x64')]['transaction'](function(_0x59f3a4){return _0x665054[_0xa55c('0x5c')](_0x1036b3,{'transaction':_0x59f3a4})['then'](function(){return BPromise[_0xa55c('0x65')](_0xd9f634,function(_0x5447a4){return db[_0xa55c('0x66')][_0xa55c('0x67')]({'TeamId':_0x5447a4['id'],'VoiceQueueId':_0x23b513[_0xa55c('0x2d')]['id'],'penalty':_0x5447a4['penalty']},{'transaction':_0x59f3a4});});})[_0xa55c('0x14')](function(){return BPromise[_0xa55c('0x65')](_0x200c28,function(_0x130c5f){return db['UserVoiceQueue'][_0xa55c('0x68')]({'where':{'UserId':_0x130c5f['id'],'VoiceQueueId':_0x23b513['params']['id']},'defaults':{'penalty':_0x130c5f[_0xa55c('0x63')]},'transaction':_0x59f3a4});});})['then'](function(){return BPromise['each'](_[_0xa55c('0x1a')](_0x200c28,{'online':!![]}),function(_0x40e121){return db[_0xa55c('0x69')]['upsert']({'membername':_0x40e121[_0xa55c('0x22')],'UserId':_0x40e121['id'],'queue_name':_0x665054[_0xa55c('0x22')],'VoiceQueueId':_0x665054['id'],'interface':_[_0xa55c('0x6a')](_0x40e121[_0xa55c('0x6b')])?util[_0xa55c('0x6c')](_0xa55c('0x6d'),_0x40e121[_0xa55c('0x22')]):_0x40e121[_0xa55c('0x6b')],'paused':_0x40e121['voicePause']||![],'penalty':_0x40e121[_0xa55c('0x63')]},{'transaction':_0x59f3a4});});})[_0xa55c('0x14')](function(){_0x200c28[_0xa55c('0x6e')](function(_0x151533){socket[_0xa55c('0x6f')](_0xa55c('0x70'),{'UserId':_0x151533['id'],'VoiceQueueId':_0x665054['id']});});});});});}})[_0xa55c('0x14')](respondWithStatusCode(_0x1e4464,null))[_0xa55c('0x2c')](handleError(_0x1e4464,null));};exports[_0xa55c('0x71')]=function(_0x261087,_0x2ef9dd){return db['Team'][_0xa55c('0x2b')]({'where':{'id':_0x261087['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xa55c('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa55c('0x14')](handleEntityNotFound(_0x2ef9dd,null))['then'](function(_0x302284){var _0x231499=_[_0xa55c('0x25')](_0x302284,'id');var _0x2d3e42=[];var _0x97275b=[];var _0x5c7c60=squel[_0xa55c('0x72')]();_0x5c7c60['field'](_0xa55c('0x73'))['from']('team_has_voice_queues','tq')[_0xa55c('0x74')](_0xa55c('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa55c('0x50')](_0xa55c('0x76'),_0x261087[_0xa55c('0x2d')]['id']);for(var _0x485652=0x0;_0x485652<_0x302284['length'];_0x485652+=0x1){let _0x57a1fc=_0x302284[_0x485652];for(var _0x50018c=0x0;_0x50018c<_0x57a1fc[_0xa55c('0x5f')][_0xa55c('0x35')];_0x50018c+=0x1){let _0x4c77c4=_0x57a1fc[_0xa55c('0x5f')][_0x50018c];var _0x1322a0=_0x5c7c60[_0xa55c('0x42')]();_0x1322a0['where'](_0xa55c('0x77'),_0x4c77c4['id']);_0x97275b['push'](db['sequelize']['query'](_0x1322a0[_0xa55c('0x78')](),{'type':db['sequelize'][_0xa55c('0x79')]['SELECT']})[_0xa55c('0x14')](function(_0x21e529){if(_0x21e529[_0xa55c('0x35')]===0x1){return _0x4c77c4['id'];}else{var _0x5063e7=_[_0xa55c('0x7a')](_[_0xa55c('0x25')](_0x21e529,_0xa55c('0x7b')),function(_0x16401f){return _[_0xa55c('0x1d')](_0x231499,_0x16401f);});if(_0x5063e7){return _0x4c77c4['id'];}}}));}}return BPromise[_0xa55c('0x7c')](_0x97275b)[_0xa55c('0x14')](function(_0x34d755){_0x2d3e42=_(_0x2d3e42)[_0xa55c('0x7d')](_0x34d755)['compact']()[_0xa55c('0x1c')]();return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x261087[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(_0x2c0b71){return db['sequelize'][_0xa55c('0x7e')](function(_0x5bae58){return _0x2c0b71[_0xa55c('0x71')](_0x261087[_0xa55c('0x2a')]['ids'],{'transaction':_0x5bae58})[_0xa55c('0x14')](function(){if(!_[_0xa55c('0x7f')](_0x2d3e42)){return _0x2c0b71['removeAgents'](_0x2d3e42,{'transaction':_0x5bae58})['then'](function(){return db[_0xa55c('0x69')][_0xa55c('0x15')]({'where':{'VoiceQueueId':_0x261087[_0xa55c('0x2d')]['id'],'UserId':_0x2d3e42},'transaction':_0x5bae58});});}})[_0xa55c('0x14')](function(){_0x2d3e42[_0xa55c('0x6e')](function(_0x1a335b){socket[_0xa55c('0x6f')](_0xa55c('0x80'),{'UserId':_0x1a335b,'VoiceQueueId':_0x2c0b71['id']});});});});});});})['then'](respondWithStatusCode(_0x2ef9dd,null))[_0xa55c('0x2c')](handleError(_0x2ef9dd,null));};exports[_0xa55c('0x81')]=function(_0xc8cd97,_0x21a206){var _0x29469d,_0x59a69d;return db[_0xa55c('0x26')]['find']({'where':{'id':_0xc8cd97['params']['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x21a206,null))[_0xa55c('0x14')](function(_0x6fcc){if(_0x6fcc){_0x59a69d=_0x6fcc;return _0x6fcc[_0xa55c('0x81')](_0xc8cd97['body'][_0xa55c('0x82')],_[_0xa55c('0x44')](_0xc8cd97[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{})[_0xa55c('0x83')](function(_0x4295c1){for(var _0x37f242=0x0;_0x37f242<_0xc8cd97[_0xa55c('0x3a')]['ids'][_0xa55c('0x35')];_0x37f242+=0x1){socket[_0xa55c('0x6f')](_0xa55c('0x70'),{'UserId':Number(_0xc8cd97[_0xa55c('0x3a')]['ids'][_0x37f242]),'VoiceQueueId':Number(_0xc8cd97[_0xa55c('0x2d')]['id'])});}return _0x4295c1;});}})[_0xa55c('0x14')](function(_0x65c752){_0x29469d=_0x65c752||[];if(_0x59a69d){return db['User'][_0xa55c('0x2b')]({'where':{'id':_0xc8cd97[_0xa55c('0x3a')][_0xa55c('0x82')]},'attributes':['id',_0xa55c('0x22'),_0xa55c('0x60'),_0xa55c('0x61'),_0xa55c('0x6b')],'raw':!![]});}})['then'](function(_0xcd4f3a){if(!_[_0xa55c('0x7f')](_0xcd4f3a)){var _0x496e8c=[];for(var _0x1c930b=0x0;_0x1c930b<_0xcd4f3a[_0xa55c('0x35')];_0x1c930b++){if(_0xcd4f3a[_0x1c930b][_0xa55c('0x60')]){_0x496e8c['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0xcd4f3a[_0x1c930b][_0xa55c('0x22')],'UserId':_0xcd4f3a[_0x1c930b]['id'],'queue_name':_0x59a69d[_0xa55c('0x22')],'VoiceQueueId':_0x59a69d['id'],'interface':_['isNil'](_0xcd4f3a[_0x1c930b]['interface'])?util[_0xa55c('0x6c')](_0xa55c('0x6d'),_0xcd4f3a[_0x1c930b]['name']):_0xcd4f3a[_0x1c930b]['interface'],'paused':_0xcd4f3a[_0x1c930b][_0xa55c('0x61')]||![],'penalty':_0xc8cd97[_0xa55c('0x3a')][_0xa55c('0x63')]||0x0}));}}return BPromise['all'](_0x496e8c);}})['then'](function(){return _0x29469d;})[_0xa55c('0x14')](respondWithResult(_0x21a206,null))['catch'](handleError(_0x21a206,null));};exports[_0xa55c('0x84')]=function(_0xe0a356,_0x5a4e69){return db[_0xa55c('0x26')]['find']({'where':{'id':_0xe0a356['params']['id']}})['then'](handleEntityNotFound(_0x5a4e69,null))['then'](function(_0x527669){if(_0x527669){return _0x527669[_0xa55c('0x84')](_0xe0a356['query'][_0xa55c('0x82')])[_0xa55c('0x14')](function(){if(_[_0xa55c('0x85')](_0xe0a356['query'][_0xa55c('0x82')])){for(var _0x111ff8=0x0;_0x111ff8<_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')][_0xa55c('0x35')];_0x111ff8+=0x1){socket[_0xa55c('0x6f')](_0xa55c('0x80'),{'UserId':Number(_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')][_0x111ff8]),'VoiceQueueId':Number(_0xe0a356[_0xa55c('0x2d')]['id'])});}}else{socket['emit'](_0xa55c('0x80'),{'UserId':Number(_0xe0a356[_0xa55c('0x2a')]['ids']),'VoiceQueueId':Number(_0xe0a356[_0xa55c('0x2d')]['id'])});}});}})[_0xa55c('0x14')](function(_0x940871){return db[_0xa55c('0x69')][_0xa55c('0x15')]({'where':{'VoiceQueueId':_0xe0a356[_0xa55c('0x2d')]['id'],'UserId':_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')]}})[_0xa55c('0x14')](function(){return _0x940871;});})[_0xa55c('0x14')](respondWithStatusCode(_0x5a4e69,null))[_0xa55c('0x2c')](handleError(_0x5a4e69,null));};exports[_0xa55c('0x86')]=function(_0x262d72,_0x228d12){var _0x16e229={};var _0x5c8713={};var _0x2d03b2;var _0x4b2e75;return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x262d72[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x228d12,null))['then'](function(_0x537011){if(_0x537011){_0x2d03b2=_0x537011;_0x5c8713[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db['User'][_0xa55c('0x30')]);_0x5c8713[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x262d72['query']);_0x5c8713[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x5c8713[_0xa55c('0x2e')],_0x5c8713['query']);_0x16e229[_0xa55c('0x33')]=_['intersection'](_0x5c8713[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x16e229[_0xa55c('0x33')]=_0x16e229['attributes'][_0xa55c('0x35')]?_0x16e229[_0xa55c('0x33')]:_0x5c8713[_0xa55c('0x2e')];_0x16e229['order']=qs[_0xa55c('0x4f')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x16e229['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x262d72[_0xa55c('0x2a')],_0x5c8713[_0xa55c('0x31')]));if(_0x262d72[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x16e229[_0xa55c('0x50')]=_['merge'](_0x16e229[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x16e229[_0xa55c('0x33')],function(_0x100ccb){var _0x531e60={};_0x531e60[_0x100ccb]={'$like':'%'+_0x262d72[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x531e60;})});}_0x16e229=_[_0xa55c('0x43')]({},_0x16e229,_0x262d72[_0xa55c('0x37')]);return _0x2d03b2[_0xa55c('0x86')](_0x16e229);}})[_0xa55c('0x14')](function(_0x243cf3){if(_0x243cf3){_0x4b2e75=_0x243cf3['length'];if(!_0x262d72[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x16e229[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x262d72['query']['limit']);_0x16e229['offset']=qs[_0xa55c('0x10')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x2d03b2[_0xa55c('0x86')](_0x16e229);}})[_0xa55c('0x14')](function(_0xb22076){if(_0xb22076){return _0xb22076?{'count':_0x4b2e75,'rows':_0xb22076}:null;}})[_0xa55c('0x14')](respondWithResult(_0x228d12,null))[_0xa55c('0x2c')](handleError(_0x228d12,null));};exports['getMembers']=function(_0x35c42c,_0x3b2174){var _0x35375e={};var _0x19a5f1={};var _0x3e7cfa;var _0xd511c0;return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x35c42c['params']['id']}})['then'](handleEntityNotFound(_0x3b2174,null))['then'](function(_0x58831d){if(_0x58831d){_0x3e7cfa=_0x58831d;_0x19a5f1[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x69')][_0xa55c('0x30')]);_0x19a5f1[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x35c42c[_0xa55c('0x2a')]);_0x19a5f1[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x19a5f1[_0xa55c('0x2e')],_0x19a5f1[_0xa55c('0x2a')]);_0x35375e['attributes']=_['intersection'](_0x19a5f1[_0xa55c('0x2e')],qs['fields'](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x35375e[_0xa55c('0x33')]=_0x35375e[_0xa55c('0x33')][_0xa55c('0x35')]?_0x35375e[_0xa55c('0x33')]:_0x19a5f1[_0xa55c('0x2e')];_0x35375e[_0xa55c('0x4e')]=qs[_0xa55c('0x4f')](_0x35c42c['query'][_0xa55c('0x4f')]);_0x35375e[_0xa55c('0x50')]=qs['filters'](_['pick'](_0x35c42c[_0xa55c('0x2a')],_0x19a5f1[_0xa55c('0x31')]));if(_0x35c42c[_0xa55c('0x2a')]['filter']){_0x35375e[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x35375e[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x35375e['attributes'],function(_0x55459c){var _0x33d58c={};_0x33d58c[_0x55459c]={'$like':'%'+_0x35c42c['query']['filter']+'%'};return _0x33d58c;})});}_0x35375e=_[_0xa55c('0x43')]({},_0x35375e,_0x35c42c[_0xa55c('0x37')]);return _0x3e7cfa[_0xa55c('0x87')](_0x35375e);}})[_0xa55c('0x14')](function(_0x5184ea){if(_0x5184ea){_0xd511c0=_0x5184ea[_0xa55c('0x35')];if(!_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x35375e[_0xa55c('0x4d')]=qs['limit'](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x35375e[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x3e7cfa[_0xa55c('0x87')](_0x35375e);}})['then'](function(_0x2d5e0e){return _0x2d5e0e?{'count':_0xd511c0,'rows':_0x2d5e0e}:null;})['then'](respondWithResult(_0x3b2174,null))[_0xa55c('0x2c')](handleError(_0x3b2174,null));};exports[_0xa55c('0x88')]=function(_0x3755a7,_0x50663f){var _0x50b42f={};var _0x307b39={};var _0x1319c6;var _0x536e1d;return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x3755a7[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x50663f,null))[_0xa55c('0x14')](function(_0x568a42){if(_0x568a42){_0x1319c6=_0x568a42;_0x307b39[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x89')][_0xa55c('0x30')]);_0x307b39['query']=_[_0xa55c('0x2f')](_0x3755a7[_0xa55c('0x2a')]);_0x307b39[_0xa55c('0x31')]=_['intersection'](_0x307b39['model'],_0x307b39[_0xa55c('0x2a')]);_0x50b42f['attributes']=_['intersection'](_0x307b39[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x50b42f[_0xa55c('0x33')]=_0x50b42f[_0xa55c('0x33')][_0xa55c('0x35')]?_0x50b42f[_0xa55c('0x33')]:_0x307b39[_0xa55c('0x2e')];_0x50b42f[_0xa55c('0x4e')]=qs['sort'](_0x3755a7['query'][_0xa55c('0x4f')]);_0x50b42f[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x3755a7['query'],_0x307b39[_0xa55c('0x31')]));if(_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x50b42f[_0xa55c('0x50')]=_['merge'](_0x50b42f[_0xa55c('0x50')],{'$or':_['map'](_0x50b42f['attributes'],function(_0x545806){var _0x4fbb59={};_0x4fbb59[_0x545806]={'$like':'%'+_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x4fbb59;})});}_0x50b42f=_['merge']({},_0x50b42f,_0x3755a7[_0xa55c('0x37')]);return _0x1319c6[_0xa55c('0x88')](_0x50b42f);}})[_0xa55c('0x14')](function(_0x3899bd){if(_0x3899bd){_0x536e1d=_0x3899bd[_0xa55c('0x35')];if(!_0x3755a7[_0xa55c('0x2a')]['hasOwnProperty'](_0xa55c('0x4c'))){_0x50b42f[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x3755a7[_0xa55c('0x2a')]['limit']);_0x50b42f['offset']=qs['offset'](_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x1319c6[_0xa55c('0x88')](_0x50b42f);}})[_0xa55c('0x14')](function(_0x1205cb){if(_0x1205cb){return _0x1205cb?{'count':_0x536e1d,'rows':_0x1205cb}:null;}})[_0xa55c('0x14')](respondWithResult(_0x50663f,null))[_0xa55c('0x2c')](handleError(_0x50663f,null));};exports[_0xa55c('0x8a')]=function(_0x499008,_0x4ef239){var _0x3e3208=moment()[_0xa55c('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1e19d6,_0x286b33;return db['VoiceQueue']['find']({'where':{'id':_0x499008[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x4ef239,null))[_0xa55c('0x14')](function(_0x236015){if(_0x236015){_0x286b33=_0x236015;return _0x236015['addLists'](_0x499008['body'][_0xa55c('0x82')],_[_0xa55c('0x44')](_0x499008[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{});}return null;})[_0xa55c('0x83')](function(_0x18e4fd){var _0x185c5b;_0x1e19d6=_0x18e4fd||[];var _0x2511fe=[];if(_0x18e4fd){for(var _0x3ba948=0x0;_0x3ba948<_0x18e4fd[_0xa55c('0x35')];_0x3ba948+=0x1){var _0x5e83e9=_0x18e4fd[_0x3ba948][_0xa55c('0x16')]({'plain':!![]});_0x286b33['dialCheckDuplicateType']=_0x499008[_0xa55c('0x3a')][_0xa55c('0x8b')]?_0x499008[_0xa55c('0x3a')][_0xa55c('0x8b')]:_0x286b33[_0xa55c('0x8b')];switch(_0x286b33[_0xa55c('0x8b')]){case _0xa55c('0x8c'):_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),'ContactId',_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')]('phone',_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','scheduledAt')[_0xa55c('0x94')]('id',_0xa55c('0x95'))['field'](_0x5e83e9[_0xa55c('0x96')]['toString'](),_0xa55c('0x93'))[_0xa55c('0x94')](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x45'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x46'))[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')]['toString']())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL')[_0xa55c('0x50')](_0xa55c('0x9b'),squel[_0xa55c('0x72')]()['field'](_0xa55c('0x9c'))[_0xa55c('0x97')](_0xa55c('0x9d'))[_0xa55c('0x50')]('VoiceQueueId\x20=\x20?',_0x499008['params']['id'][_0xa55c('0x78')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa55c('0x72')]()[_0xa55c('0x94')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xa55c('0x50')](_0xa55c('0x76'),_0x499008['params']['id'][_0xa55c('0x78')]())))[_0xa55c('0x78')]();break;case _0xa55c('0x9e'):_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),_0xa55c('0x95'),_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x92'))[_0xa55c('0x94')]('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x5e83e9['CmListId']['toString'](),_0xa55c('0x93'))[_0xa55c('0x94')](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))['field']('\x27'+_0x3e3208+'\x27',_0xa55c('0x45'))['field']('\x27'+_0x3e3208+'\x27','updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))['where'](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')][_0xa55c('0x78')]())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL')[_0xa55c('0x50')](_0xa55c('0x9b'),squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x9f'))[_0xa55c('0x97')](_0xa55c('0x8f'))[_0xa55c('0x50')](_0xa55c('0x76'),_0x499008[_0xa55c('0x2d')]['id']['toString']())))[_0xa55c('0x78')]();break;default:_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),_0xa55c('0x95'),_0xa55c('0x93'),'VoiceQueueId',_0xa55c('0x45'),'updatedAt'],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x92'))[_0xa55c('0x94')]('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x5e83e9['CmListId']['toString'](),_0xa55c('0x93'))['field'](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','createdAt')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')][_0xa55c('0x78')]())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL'))[_0xa55c('0x78')]();}_0x2511fe[_0xa55c('0xa0')](db[_0xa55c('0x64')]['query'](_0x185c5b));}return BPromise[_0xa55c('0x7c')](_0x2511fe);}})[_0xa55c('0x14')](function(){var _0x4457e9=[];var _0x456cb9=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0xa1'))[_0xa55c('0x90')]([_0xa55c('0xa2'),_0xa55c('0x91'),'OrderBy',_0xa55c('0x45'),_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0xa3'))['field']('ci.item')['field']('ci.OrderBy+1')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','createdAt')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x46'))[_0xa55c('0x97')](_0xa55c('0xa4'),'ci')[_0xa55c('0x74')](_0xa55c('0x8f'),'h',_0xa55c('0xa5'))[_0xa55c('0x50')](_0xa55c('0xa6'),_0x3e3208)[_0xa55c('0x50')](_0xa55c('0xa7'),'PHONE'))[_0xa55c('0x78')]();_0x4457e9[_0xa55c('0xa0')](db[_0xa55c('0x64')]['query'](_0x456cb9));return BPromise['all'](_0x4457e9);})['then'](function(){return _0x1e19d6;})[_0xa55c('0x14')](respondWithResult(_0x4ef239,null))[_0xa55c('0x2c')](handleError(_0x4ef239,null));};exports[_0xa55c('0xa8')]=function(_0x27cd1b,_0x3ed3a5){return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x27cd1b[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x3ed3a5,null))[_0xa55c('0x14')](function(_0x3def57){if(_0x3def57){return _0x3def57[_0xa55c('0xa8')](_0x27cd1b[_0xa55c('0x2a')][_0xa55c('0x82')]);}})[_0xa55c('0x14')](function(_0x4f5f1a){if(_0x4f5f1a){return db[_0xa55c('0x4a')]['destroy']({'where':{'ListId':_0x27cd1b[_0xa55c('0x2a')][_0xa55c('0x82')],'VoiceQueueId':_0x27cd1b[_0xa55c('0x2d')]['id']}})['then'](function(){return _0x4f5f1a;});}})['then'](respondWithStatusCode(_0x3ed3a5,null))[_0xa55c('0x2c')](handleError(_0x3ed3a5,null));};exports[_0xa55c('0xa9')]=function(_0x30af02,_0x5ebd8a){var _0x2420da={};var _0x2a4b78={};var _0x1e4c2d;var _0x2bf777;return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x30af02[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5ebd8a,null))[_0xa55c('0x14')](function(_0x266b12){if(_0x266b12){_0x1e4c2d=_0x266b12;_0x2a4b78[_0xa55c('0x2e')]=_['keys'](db[_0xa55c('0x89')]['rawAttributes']);_0x2a4b78[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x30af02['query']);_0x2a4b78[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x2a4b78[_0xa55c('0x2e')],_0x2a4b78['query']);_0x2420da[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x2a4b78['model'],qs['fields'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x2420da[_0xa55c('0x33')]=_0x2420da[_0xa55c('0x33')][_0xa55c('0x35')]?_0x2420da['attributes']:_0x2a4b78[_0xa55c('0x2e')];_0x2420da['order']=qs['sort'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x2420da['where']=qs[_0xa55c('0x31')](_['pick'](_0x30af02[_0xa55c('0x2a')],_0x2a4b78[_0xa55c('0x31')]));if(_0x30af02['query'][_0xa55c('0x1a')]){_0x2420da[_0xa55c('0x50')]=_['merge'](_0x2420da[_0xa55c('0x50')],{'$or':_['map'](_0x2420da['attributes'],function(_0x37273b){var _0x1cd529={};_0x1cd529[_0x37273b]={'$like':'%'+_0x30af02[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x1cd529;})});}_0x2420da=_[_0xa55c('0x43')]({},_0x2420da,_0x30af02[_0xa55c('0x37')]);return _0x1e4c2d[_0xa55c('0xa9')](_0x2420da);}})['then'](function(_0x27e791){if(_0x27e791){_0x2bf777=_0x27e791[_0xa55c('0x35')];if(!_0x30af02['query'][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x2420da['limit']=qs[_0xa55c('0x4d')](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x2420da[_0xa55c('0x10')]=qs['offset'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x1e4c2d[_0xa55c('0xa9')](_0x2420da);}})[_0xa55c('0x14')](function(_0x365331){if(_0x365331){return _0x365331?{'count':_0x2bf777,'rows':_0x365331}:null;}})[_0xa55c('0x14')](respondWithResult(_0x5ebd8a,null))['catch'](handleError(_0x5ebd8a,null));};exports[_0xa55c('0xaa')]=function(_0x4d7cd6,_0x1ca9bd){var _0x2bf932;return db['VoiceQueue']['find']({'where':{'id':_0x4d7cd6[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x1ca9bd,null))[_0xa55c('0x14')](function(_0x3c9d2b){if(_0x3c9d2b){return _0x3c9d2b[_0xa55c('0xaa')](_0x4d7cd6[_0xa55c('0x3a')][_0xa55c('0x82')],_['omit'](_0x4d7cd6[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{});}return null;})[_0xa55c('0x83')](function(_0x158b01){var _0x19f576;_0x2bf932=_0x158b01||[];var _0x10da4b=[];if(_0x158b01){for(var _0x3320ab=0x0;_0x3320ab<_0x158b01[_0xa55c('0x35')];_0x3320ab+=0x1){var _0x298cf5=_0x158b01[_0x3320ab][_0xa55c('0x16')]({'plain':!![]});_0x19f576=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0xab'))['fromQuery']([_0xa55c('0x91'),'ContactId',_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))['field']('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x298cf5[_0xa55c('0x96')]['toString'](),'ListId')['field'](_0x4d7cd6[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),'VoiceQueueId')[_0xa55c('0x94')](_0xa55c('0xac'),_0xa55c('0x45'))[_0xa55c('0x94')](_0xa55c('0xac'),'updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')]('ListId\x20=\x20?',_0x298cf5['CmListId'][_0xa55c('0x78')]())[_0xa55c('0x50')](_0xa55c('0xad')))['toString']();_0x10da4b[_0xa55c('0xa0')](db[_0xa55c('0x64')][_0xa55c('0x2a')](_0x19f576));}return BPromise[_0xa55c('0x7c')](_0x10da4b);}})[_0xa55c('0x14')](function(){return _0x2bf932;})[_0xa55c('0x14')](respondWithResult(_0x1ca9bd,null))[_0xa55c('0x2c')](handleError(_0x1ca9bd,null));};exports[_0xa55c('0xae')]=function(_0x23862a,_0xb432d1){return db['VoiceQueue'][_0xa55c('0x38')]({'where':{'id':_0x23862a[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0xb432d1,null))[_0xa55c('0x14')](function(_0x5bc270){if(_0x5bc270){return _0x5bc270[_0xa55c('0xae')](_0x23862a[_0xa55c('0x2a')][_0xa55c('0x82')]);}})[_0xa55c('0x14')](function(_0x543b4a){if(_0x543b4a){return db[_0xa55c('0x59')]['destroy']({'where':{'ListId':_0x23862a[_0xa55c('0x2a')][_0xa55c('0x82')],'VoiceQueueId':_0x23862a[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(){return _0x543b4a;});}})[_0xa55c('0x14')](respondWithStatusCode(_0xb432d1,null))['catch'](handleError(_0xb432d1,null));}; \ No newline at end of file +var _0x5fc3=['redis','localhost','./voiceQueue.socket','register','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','UserProfileResource','destroy','stack','name','index','VoiceQueue','fieldName','getOptions','where','include','findAll','rows','catch','show','params','model','keys','query','intersection','attributes','length','includeAll','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','rawAttributes','fields','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','filters','nolimit','order','sort','pick','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','hasOwnProperty','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','online','voicePause','interface','flatMap','forEach','penalty','Agents','sequelize','transaction','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','emit','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','User','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','moment','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x20fc55,_0x2ce9c6){var _0x3af523=function(_0x372d6b){while(--_0x372d6b){_0x20fc55['push'](_0x20fc55['shift']());}};_0x3af523(++_0x2ce9c6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0x5fc3[_0x21205e];return _0x136ebb;};'use strict';var moment=require(_0x35fc('0x0'));var BPromise=require(_0x35fc('0x1'));var util=require('util');var _=require(_0x35fc('0x2'));var squel=require(_0x35fc('0x3'));var Redis=require(_0x35fc('0x4'));var qs=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('api');var config=require(_0x35fc('0x7'));var db=require(_0x35fc('0x8'))['db'];config[_0x35fc('0x9')]=_['defaults'](config['redis'],{'host':_0x35fc('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35fc('0x9')]));require(_0x35fc('0xb'))[_0x35fc('0xc')](socket);function respondWithStatusCode(_0x1e5f90,_0x34ff19){_0x34ff19=_0x34ff19||0xcc;return function(_0xf9d3a6){if(_0xf9d3a6){return _0x1e5f90[_0x35fc('0xd')](_0x34ff19);}return _0x1e5f90['status'](_0x34ff19)[_0x35fc('0xe')]();};}function respondWithResult(_0x2a1084,_0x4fdca1){_0x4fdca1=_0x4fdca1||0xc8;return function(_0x471549){if(_0x471549){return _0x2a1084[_0x35fc('0xf')](_0x4fdca1)['json'](_0x471549);}};}function respondWithFilteredResult(_0xda83fb,_0x1a9f2b){return function(_0x5469f5){if(_0x5469f5){var _0x4cbe74=typeof _0x1a9f2b[_0x35fc('0x10')]==='undefined'&&typeof _0x1a9f2b[_0x35fc('0x11')]===_0x35fc('0x12');var _0x2a6ad2=_0x5469f5[_0x35fc('0x13')];var _0x38d9f2=_0x4cbe74?0x0:_0x1a9f2b['offset'];var _0x59507a=_0x4cbe74?_0x5469f5['count']:_0x1a9f2b['offset']+_0x1a9f2b[_0x35fc('0x11')];var _0x229d56;if(_0x59507a>=_0x2a6ad2){_0x59507a=_0x2a6ad2;_0x229d56=0xc8;}else{_0x229d56=0xce;}_0xda83fb[_0x35fc('0xf')](_0x229d56);return _0xda83fb[_0x35fc('0x14')](_0x35fc('0x15'),_0x38d9f2+'-'+_0x59507a+'/'+_0x2a6ad2)[_0x35fc('0x16')](_0x5469f5);}return null;};}function saveUpdates(_0x480851){return function(_0x26ba54){if(_0x26ba54){return _0x26ba54[_0x35fc('0x17')](_0x480851)['then'](function(_0x41e165){return _0x41e165;});}return null;};}function removeEntity(_0x363e47){return function(_0x2e513b){if(_0x2e513b){return _0x2e513b['destroy']()[_0x35fc('0x18')](function(){var _0x3c58ea=_0x2e513b[_0x35fc('0x19')]({'plain':!![]});var _0x488234=[{'name':_0x35fc('0x1a'),'value':_0x35fc('0x1b'),'ignore':![]},{'name':_0x35fc('0x1c'),'value':_0x35fc('0x1d'),'ignore':![]}];var _0x20ffde=_(_0x488234)[_0x35fc('0x1e')](_0x35fc('0x1f'))[_0x35fc('0x20')](_0x35fc('0x21'))[_0x35fc('0x21')]();if(_['includes'](_0x20ffde,_0x3c58ea[_0x35fc('0x22')])){return;}var _0xd5399f=_[_0x35fc('0x23')](_0x488234,[_0x35fc('0x21'),_0x3c58ea[_0x35fc('0x22')]])['name'];return db[_0x35fc('0x24')][_0x35fc('0x25')]({'where':{'type':_0xd5399f,'resourceId':_0x3c58ea['id']}})['then'](function(){return _0x2e513b;});})[_0x35fc('0x18')](function(){_0x363e47[_0x35fc('0xf')](0xcc)[_0x35fc('0xe')]();});}};}function handleEntityNotFound(_0x51cfec){return function(_0x4086e9){if(!_0x4086e9){_0x51cfec['sendStatus'](0x194);}return _0x4086e9;};}function handleError(_0x1bf180,_0xdfab9f){_0xdfab9f=_0xdfab9f||0x1f4;return function(_0x5cb986){logger['error'](_0x5cb986[_0x35fc('0x26')]);if(_0x5cb986['name']){delete _0x5cb986[_0x35fc('0x27')];}_0x1bf180[_0x35fc('0xf')](_0xdfab9f)['send'](_0x5cb986);};}exports[_0x35fc('0x28')]=function(_0x645eac,_0x383837){var _0x9f3c8a={};var _0x3735da={'count':0x0,'rows':[]};var _0x134dfa=_[_0x35fc('0x20')](db[_0x35fc('0x29')]['rawAttributes'],function(_0x1cd1ae){return{'name':_0x1cd1ae[_0x35fc('0x2a')],'type':_0x1cd1ae[_0x35fc('0x22')]['key']};});_0x9f3c8a=qs[_0x35fc('0x2b')](_0x134dfa,_0x645eac);var _0x16f067={'where':_0x9f3c8a[_0x35fc('0x2c')]};return db[_0x35fc('0x29')][_0x35fc('0x13')](_0x16f067)[_0x35fc('0x18')](function(_0x222ddb){_0x3735da[_0x35fc('0x13')]=_0x222ddb;_0x9f3c8a[_0x35fc('0x2d')]=qs[_0x35fc('0x2d')](_0x645eac['query']);return db['VoiceQueue'][_0x35fc('0x2e')](_0x9f3c8a);})['then'](function(_0x37b394){_0x3735da[_0x35fc('0x2f')]=_0x37b394;return _0x3735da;})[_0x35fc('0x18')](respondWithFilteredResult(_0x383837,_0x9f3c8a))[_0x35fc('0x30')](handleError(_0x383837,null));};exports[_0x35fc('0x31')]=function(_0x12e78f,_0x4e43b4){var _0x3fe193={'raw':![],'where':{'id':_0x12e78f[_0x35fc('0x32')]['id']}},_0x330a14={};_0x330a14[_0x35fc('0x33')]=_[_0x35fc('0x34')](db[_0x35fc('0x29')]['rawAttributes']);_0x330a14[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x12e78f[_0x35fc('0x35')]);_0x330a14['filters']=_[_0x35fc('0x36')](_0x330a14['model'],_0x330a14[_0x35fc('0x35')]);_0x3fe193[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x330a14[_0x35fc('0x33')],qs['fields'](_0x12e78f['query']['fields']));_0x3fe193[_0x35fc('0x37')]=_0x3fe193['attributes'][_0x35fc('0x38')]?_0x3fe193['attributes']:_0x330a14[_0x35fc('0x33')];if(_0x12e78f[_0x35fc('0x35')][_0x35fc('0x39')]){_0x3fe193[_0x35fc('0x2d')]=[{'all':!![]}];}_0x3fe193=_[_0x35fc('0x3a')]({},_0x3fe193,_0x12e78f[_0x35fc('0x3b')]);return db[_0x35fc('0x29')]['find'](_0x3fe193)[_0x35fc('0x18')](handleEntityNotFound(_0x4e43b4,null))[_0x35fc('0x18')](respondWithResult(_0x4e43b4,null))['catch'](handleError(_0x4e43b4,null));};exports[_0x35fc('0x3c')]=function(_0x1ccc41,_0x1aac67){return db[_0x35fc('0x29')][_0x35fc('0x3c')](_0x1ccc41[_0x35fc('0x3d')],{})['then'](function(_0x3f6480){var _0x267858=_0x1ccc41[_0x35fc('0x3e')]['get']({'plain':!![]});if(!_0x267858)throw new Error(_0x35fc('0x3f'));if(_0x267858[_0x35fc('0x40')]==='user'){var _0x237548=_0x3f6480[_0x35fc('0x19')]({'plain':!![]});var _0x43b77c=[{'name':_0x35fc('0x1a'),'value':_0x35fc('0x1b')},{'name':_0x35fc('0x1c'),'value':_0x35fc('0x1d')}];var _0x3ec51f=_['find'](_0x43b77c,['value',_0x237548[_0x35fc('0x22')]])[_0x35fc('0x27')];return db['UserProfileSection']['find']({'where':{'name':_0x3ec51f,'userProfileId':_0x267858['userProfileId']},'raw':!![]})[_0x35fc('0x18')](function(_0x10f98b){if(_0x10f98b&&_0x10f98b['autoAssociation']===0x0){return db[_0x35fc('0x24')][_0x35fc('0x3c')]({'name':_0x237548[_0x35fc('0x27')],'resourceId':_0x237548['id'],'type':_0x10f98b[_0x35fc('0x27')],'sectionId':_0x10f98b['id']},{})['then'](function(){return _0x3f6480;});}else{return _0x3f6480;}})['catch'](function(_0x5bf2f4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bf2f4);throw _0x5bf2f4;});}return _0x3f6480;})[_0x35fc('0x18')](respondWithResult(_0x1aac67,0xc9))[_0x35fc('0x30')](handleError(_0x1aac67,null));};exports['clone']=function(_0x119925,_0x56cf1f){var _0x13d16c={'where':{'id':_0x119925[_0x35fc('0x32')]['id']}},_0x40797d={};_0x40797d[_0x35fc('0x33')]=_[_0x35fc('0x34')](db['VoiceQueue'][_0x35fc('0x41')]);_0x13d16c[_0x35fc('0x37')]=_['intersection'](_0x40797d[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x119925[_0x35fc('0x35')][_0x35fc('0x42')]));_0x13d16c['attributes']=_0x13d16c[_0x35fc('0x37')]['length']?_0x13d16c['attributes']:_0x40797d[_0x35fc('0x33')];if(_0x119925[_0x35fc('0x35')][_0x35fc('0x39')]){_0x13d16c[_0x35fc('0x2d')]=[{'all':!![]}];}_0x13d16c=_[_0x35fc('0x3a')]({},_0x13d16c,_0x119925[_0x35fc('0x3b')]);return db[_0x35fc('0x29')][_0x35fc('0x23')](_0x13d16c)['then'](handleEntityNotFound(_0x56cf1f,null))[_0x35fc('0x18')](function(_0x91d7c0){if(_0x91d7c0){var _0xeca02e=_0x91d7c0[_0x35fc('0x19')]({'plain':!![]});_0xeca02e=qs[_0x35fc('0x43')](_0xeca02e,['id',_0x35fc('0x44'),_0x35fc('0x45')]);_0x119925[_0x35fc('0x3d')]=_[_0x35fc('0x43')](_0x119925[_0x35fc('0x3d')],['id',_0x35fc('0x44'),_0x35fc('0x45')]);return db[_0x35fc('0x29')][_0x35fc('0x3c')](_['merge'](_0xeca02e,_0x119925['body']),{'include':_0x119925[_0x35fc('0x35')][_0x35fc('0x39')]?[{'all':!![]}]:undefined})[_0x35fc('0x18')](function(_0x2bf0b0){var _0x3ee296=_0x119925[_0x35fc('0x3e')]['get']({'plain':!![]});if(!_0x3ee296)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ee296[_0x35fc('0x40')]===_0x35fc('0x3e')){var _0x395d63=_0x2bf0b0[_0x35fc('0x19')]({'plain':!![]});var _0x5b2595=[{'name':_0x35fc('0x1a'),'value':_0x35fc('0x1b')},{'name':'QueueCampaigns','value':_0x35fc('0x1d')}];var _0x2536d3=_['find'](_0x5b2595,[_0x35fc('0x21'),_0x395d63[_0x35fc('0x22')]])[_0x35fc('0x27')];return db[_0x35fc('0x46')]['find']({'where':{'name':_0x2536d3,'userProfileId':_0x3ee296['userProfileId']},'raw':!![]})['then'](function(_0x240338){if(_0x240338&&_0x240338[_0x35fc('0x47')]===0x0){return db['UserProfileResource'][_0x35fc('0x3c')]({'name':_0x395d63[_0x35fc('0x27')],'resourceId':_0x395d63['id'],'type':_0x240338[_0x35fc('0x27')],'sectionId':_0x240338['id']},{})[_0x35fc('0x18')](function(){return _0x2bf0b0;});}else{return _0x2bf0b0;}})[_0x35fc('0x30')](function(_0x538be0){logger[_0x35fc('0x48')](_0x35fc('0x49'),_0x538be0);throw _0x538be0;});}return _0x2bf0b0;});}})[_0x35fc('0x18')](respondWithResult(_0x56cf1f,0xc9))['catch'](handleError(_0x56cf1f,null));};exports[_0x35fc('0x17')]=function(_0x1dbf5a,_0x47fb1a){if(_0x1dbf5a[_0x35fc('0x3d')]['id']){delete _0x1dbf5a[_0x35fc('0x3d')]['id'];}return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0x1dbf5a[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x47fb1a,null))[_0x35fc('0x18')](saveUpdates(_0x1dbf5a[_0x35fc('0x3d')],null))['then'](respondWithResult(_0x47fb1a,null))[_0x35fc('0x30')](handleError(_0x47fb1a,null));};exports[_0x35fc('0x25')]=function(_0x303927,_0x4fabd4){return db[_0x35fc('0x29')]['find']({'where':{'id':_0x303927['params']['id']}})['then'](handleEntityNotFound(_0x4fabd4,null))[_0x35fc('0x18')](removeEntity(_0x4fabd4,null))[_0x35fc('0x30')](handleError(_0x4fabd4,null));};exports[_0x35fc('0x4a')]=function(_0x13901c,_0x3d06b8){var _0x4bbea0={'raw':![],'where':{}};var _0x579f5a={};var _0x5353ea={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x13901c[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x3d06b8,null))[_0x35fc('0x18')](function(_0x3ef680){if(_0x3ef680){_0x579f5a['model']=_[_0x35fc('0x34')](db[_0x35fc('0x4b')][_0x35fc('0x41')]);_0x579f5a[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x13901c[_0x35fc('0x35')]);_0x579f5a[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x579f5a[_0x35fc('0x33')],_0x579f5a['query']);_0x4bbea0[_0x35fc('0x37')]=_['intersection'](_0x579f5a[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x13901c[_0x35fc('0x35')][_0x35fc('0x42')]));_0x4bbea0['attributes']=_0x4bbea0[_0x35fc('0x37')]['length']?_0x4bbea0['attributes']:_0x579f5a['model'];if(!_0x13901c[_0x35fc('0x35')]['hasOwnProperty'](_0x35fc('0x4d'))){_0x4bbea0['limit']=qs[_0x35fc('0x11')](_0x13901c['query'][_0x35fc('0x11')]);_0x4bbea0[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x13901c[_0x35fc('0x35')]['offset']);}_0x4bbea0[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x13901c[_0x35fc('0x35')]['sort']);_0x4bbea0[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x13901c[_0x35fc('0x35')],_0x579f5a[_0x35fc('0x4c')]));_0x4bbea0[_0x35fc('0x2c')][_0x35fc('0x51')]=_0x3ef680['id'];if(_0x13901c[_0x35fc('0x35')]['filter']){_0x4bbea0[_0x35fc('0x2c')]=_[_0x35fc('0x3a')](_0x4bbea0[_0x35fc('0x2c')],{'$or':_['map'](_0x4bbea0[_0x35fc('0x37')],function(_0x1b76f0){var _0x586729={};_0x586729[_0x1b76f0]={'$like':'%'+_0x13901c['query'][_0x35fc('0x1e')]+'%'};return _0x586729;})});}_0x4bbea0=_['merge']({},_0x4bbea0,_0x13901c[_0x35fc('0x3b')]);return db[_0x35fc('0x4b')][_0x35fc('0x13')]({'where':_0x4bbea0[_0x35fc('0x2c')]})[_0x35fc('0x18')](function(_0x20ddc6){_0x5353ea[_0x35fc('0x13')]=_0x20ddc6;if(_0x13901c[_0x35fc('0x35')][_0x35fc('0x39')]){_0x4bbea0[_0x35fc('0x2d')]=[{'all':!![]}];}return db[_0x35fc('0x4b')][_0x35fc('0x2e')](_0x4bbea0);})[_0x35fc('0x18')](function(_0x9f034e){_0x5353ea[_0x35fc('0x2f')]=_0x9f034e;return _0x5353ea;});}})[_0x35fc('0x18')](respondWithFilteredResult(_0x3d06b8,_0x4bbea0))[_0x35fc('0x30')](handleError(_0x3d06b8,null));};exports[_0x35fc('0x52')]=function(_0x3b2160,_0x3f3f36){var _0x4ba1b0={'raw':!![],'where':{}};var _0x1797d0={};var _0x55cb69={'count':0x0,'rows':[]};return db[_0x35fc('0x29')][_0x35fc('0x53')]({'where':{'id':_0x3b2160[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x3f3f36,null))[_0x35fc('0x18')](function(_0x3f56f4){if(_0x3f56f4){_0x1797d0[_0x35fc('0x33')]=_[_0x35fc('0x34')](db[_0x35fc('0x54')][_0x35fc('0x41')]);_0x1797d0[_0x35fc('0x35')]=_['keys'](_0x3b2160[_0x35fc('0x35')]);_0x1797d0[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x1797d0[_0x35fc('0x33')],_0x1797d0[_0x35fc('0x35')]);_0x4ba1b0[_0x35fc('0x37')]=_['intersection'](_0x1797d0[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x3b2160[_0x35fc('0x35')][_0x35fc('0x42')]));_0x4ba1b0[_0x35fc('0x37')]=_0x4ba1b0[_0x35fc('0x37')][_0x35fc('0x38')]?_0x4ba1b0[_0x35fc('0x37')]:_0x1797d0[_0x35fc('0x33')];if(!_0x3b2160['query'][_0x35fc('0x55')]('nolimit')){_0x4ba1b0[_0x35fc('0x11')]=qs[_0x35fc('0x11')](_0x3b2160['query'][_0x35fc('0x11')]);_0x4ba1b0[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x3b2160[_0x35fc('0x35')][_0x35fc('0x10')]);}_0x4ba1b0[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x3b2160[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x4ba1b0['where']=qs['filters'](_['pick'](_0x3b2160['query'],_0x1797d0[_0x35fc('0x4c')]));_0x4ba1b0[_0x35fc('0x2c')][_0x35fc('0x51')]=_0x3f56f4['id'];if(_0x3b2160[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x4ba1b0['where']=_[_0x35fc('0x3a')](_0x4ba1b0[_0x35fc('0x2c')],{'$or':_[_0x35fc('0x20')](_0x4ba1b0[_0x35fc('0x37')],function(_0x584a58){var _0x15e936={};_0x15e936[_0x584a58]={'$like':'%'+_0x3b2160[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x15e936;})});}_0x4ba1b0=_['merge']({},_0x4ba1b0,_0x3b2160[_0x35fc('0x3b')]);return db[_0x35fc('0x54')][_0x35fc('0x13')]({'where':_0x4ba1b0[_0x35fc('0x2c')]})[_0x35fc('0x18')](function(_0x31d276){_0x55cb69[_0x35fc('0x13')]=_0x31d276;if(_0x3b2160[_0x35fc('0x35')]['includeAll']){_0x4ba1b0[_0x35fc('0x2d')]=[{'all':!![]}];}return db[_0x35fc('0x54')][_0x35fc('0x2e')](_0x4ba1b0);})[_0x35fc('0x18')](function(_0x221c5b){_0x55cb69[_0x35fc('0x2f')]=_0x221c5b;return _0x55cb69;});}})['then'](respondWithFilteredResult(_0x3f3f36,_0x4ba1b0))[_0x35fc('0x30')](handleError(_0x3f3f36,null));};exports['getHopperFinals']=function(_0x4855ee,_0x1a2da0){var _0x597670={'raw':!![],'where':{}};var _0x1246c7={};var _0x233b7d={'count':0x0,'rows':[]};return db[_0x35fc('0x29')]['findOne']({'where':{'id':_0x4855ee[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x1a2da0,null))[_0x35fc('0x18')](function(_0x1beb46){if(_0x1beb46){_0x1246c7[_0x35fc('0x33')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x1246c7[_0x35fc('0x35')]=_['keys'](_0x4855ee[_0x35fc('0x35')]);_0x1246c7[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x1246c7[_0x35fc('0x33')],_0x1246c7['query']);_0x597670[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x1246c7[_0x35fc('0x33')],qs['fields'](_0x4855ee[_0x35fc('0x35')][_0x35fc('0x42')]));_0x597670[_0x35fc('0x37')]=_0x597670['attributes']['length']?_0x597670['attributes']:_0x1246c7[_0x35fc('0x33')];if(!_0x4855ee[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x597670['limit']=qs[_0x35fc('0x11')](_0x4855ee[_0x35fc('0x35')]['limit']);_0x597670['offset']=qs[_0x35fc('0x10')](_0x4855ee[_0x35fc('0x35')][_0x35fc('0x10')]);}_0x597670['order']=qs['sort'](_0x4855ee[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x597670['where']=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x4855ee[_0x35fc('0x35')],_0x1246c7['filters']));_0x597670[_0x35fc('0x2c')][_0x35fc('0x51')]=_0x1beb46['id'];if(_0x4855ee[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x597670['where']=_[_0x35fc('0x3a')](_0x597670[_0x35fc('0x2c')],{'$or':_[_0x35fc('0x20')](_0x597670['attributes'],function(_0x96dfc){var _0x26d242={};_0x26d242[_0x96dfc]={'$like':'%'+_0x4855ee[_0x35fc('0x35')]['filter']+'%'};return _0x26d242;})});}_0x597670=_[_0x35fc('0x3a')]({},_0x597670,_0x4855ee[_0x35fc('0x3b')]);return db['CmHopperFinal'][_0x35fc('0x13')]({'where':_0x597670[_0x35fc('0x2c')]})[_0x35fc('0x18')](function(_0x45eaae){_0x233b7d[_0x35fc('0x13')]=_0x45eaae;if(_0x4855ee[_0x35fc('0x35')][_0x35fc('0x39')]){_0x597670[_0x35fc('0x2d')]=[{'all':!![]}];}return db[_0x35fc('0x56')]['findAll'](_0x597670);})[_0x35fc('0x18')](function(_0x3fc6cc){_0x233b7d[_0x35fc('0x2f')]=_0x3fc6cc;return _0x233b7d;});}})[_0x35fc('0x18')](respondWithFilteredResult(_0x1a2da0,_0x597670))['catch'](handleError(_0x1a2da0,null));};exports[_0x35fc('0x57')]=function(_0x1808a3,_0x209d7a){var _0x7b633a={'raw':!![],'where':{}};var _0x4684b6={};var _0x319998={'count':0x0,'rows':[]};return db[_0x35fc('0x29')][_0x35fc('0x53')]({'where':{'id':_0x1808a3['params']['id']}})['then'](handleEntityNotFound(_0x209d7a,null))[_0x35fc('0x18')](function(_0xafa771){if(_0xafa771){_0x4684b6[_0x35fc('0x33')]=_['keys'](db[_0x35fc('0x58')][_0x35fc('0x41')]);_0x4684b6[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x1808a3['query']);_0x4684b6['filters']=_[_0x35fc('0x36')](_0x4684b6['model'],_0x4684b6[_0x35fc('0x35')]);_0x7b633a[_0x35fc('0x37')]=_['intersection'](_0x4684b6['model'],qs[_0x35fc('0x42')](_0x1808a3[_0x35fc('0x35')][_0x35fc('0x42')]));_0x7b633a['attributes']=_0x7b633a[_0x35fc('0x37')][_0x35fc('0x38')]?_0x7b633a[_0x35fc('0x37')]:_0x4684b6['model'];if(!_0x1808a3[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x7b633a[_0x35fc('0x11')]=qs['limit'](_0x1808a3[_0x35fc('0x35')][_0x35fc('0x11')]);_0x7b633a[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x1808a3[_0x35fc('0x35')][_0x35fc('0x10')]);}_0x7b633a['order']=qs[_0x35fc('0x4f')](_0x1808a3[_0x35fc('0x35')]['sort']);_0x7b633a[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_['pick'](_0x1808a3[_0x35fc('0x35')],_0x4684b6[_0x35fc('0x4c')]));_0x7b633a[_0x35fc('0x2c')][_0x35fc('0x51')]=_0xafa771['id'];if(_0x1808a3[_0x35fc('0x35')]['filter']){_0x7b633a[_0x35fc('0x2c')]=_[_0x35fc('0x3a')](_0x7b633a[_0x35fc('0x2c')],{'$or':_['map'](_0x7b633a[_0x35fc('0x37')],function(_0x5a8641){var _0x58d3d5={};_0x58d3d5[_0x5a8641]={'$like':'%'+_0x1808a3[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x58d3d5;})});}_0x7b633a=_[_0x35fc('0x3a')]({},_0x7b633a,_0x1808a3[_0x35fc('0x3b')]);return db[_0x35fc('0x58')]['count']({'where':_0x7b633a[_0x35fc('0x2c')]})[_0x35fc('0x18')](function(_0x44683e){_0x319998['count']=_0x44683e;if(_0x1808a3[_0x35fc('0x35')][_0x35fc('0x39')]){_0x7b633a[_0x35fc('0x2d')]=[{'all':!![]}];}return db[_0x35fc('0x58')][_0x35fc('0x2e')](_0x7b633a);})['then'](function(_0x1a2d73){_0x319998[_0x35fc('0x2f')]=_0x1a2d73;return _0x319998;});}})['then'](respondWithFilteredResult(_0x209d7a,_0x7b633a))['catch'](handleError(_0x209d7a,null));};exports[_0x35fc('0x59')]=function(_0x44b356,_0x207336){var _0x2b16b2={};var _0x405a43={};var _0x2b2a87;var _0x8c80ca;return db['VoiceQueue']['findOne']({'where':{'id':_0x44b356[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x207336,null))[_0x35fc('0x18')](function(_0x1a92fa){if(_0x1a92fa){_0x2b2a87=_0x1a92fa;_0x405a43[_0x35fc('0x33')]=_['keys'](db['Team'][_0x35fc('0x41')]);_0x405a43[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x44b356[_0x35fc('0x35')]);_0x405a43['filters']=_['intersection'](_0x405a43[_0x35fc('0x33')],_0x405a43[_0x35fc('0x35')]);_0x2b16b2[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x405a43['model'],qs['fields'](_0x44b356[_0x35fc('0x35')][_0x35fc('0x42')]));_0x2b16b2['attributes']=_0x2b16b2[_0x35fc('0x37')][_0x35fc('0x38')]?_0x2b16b2[_0x35fc('0x37')]:_0x405a43[_0x35fc('0x33')];_0x2b16b2[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x44b356[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x2b16b2[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x44b356[_0x35fc('0x35')],_0x405a43[_0x35fc('0x4c')]));if(_0x44b356[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x2b16b2[_0x35fc('0x2c')]=_['merge'](_0x2b16b2[_0x35fc('0x2c')],{'$or':_['map'](_0x2b16b2[_0x35fc('0x37')],function(_0x5d677a){var _0x5aa072={};_0x5aa072[_0x5d677a]={'$like':'%'+_0x44b356[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x5aa072;})});}_0x2b16b2=_[_0x35fc('0x3a')]({},_0x2b16b2,_0x44b356['options']);return _0x2b2a87[_0x35fc('0x59')](_0x2b16b2);}})[_0x35fc('0x18')](function(_0xe9c7c2){if(_0xe9c7c2){_0x8c80ca=_0xe9c7c2[_0x35fc('0x38')];if(!_0x44b356[_0x35fc('0x35')][_0x35fc('0x55')]('nolimit')){_0x2b16b2['limit']=qs[_0x35fc('0x11')](_0x44b356['query']['limit']);_0x2b16b2[_0x35fc('0x10')]=qs['offset'](_0x44b356['query']['offset']);}return _0x2b2a87[_0x35fc('0x59')](_0x2b16b2);}})['then'](function(_0x355154){if(_0x355154){return _0x355154?{'count':_0x8c80ca,'rows':_0x355154}:null;}})[_0x35fc('0x18')](respondWithResult(_0x207336,null))[_0x35fc('0x30')](handleError(_0x207336,null));};exports[_0x35fc('0x5a')]=function(_0x392212,_0x201dfa){var _0x4ab6f9=_0x392212['body'][_0x35fc('0x5b')];var _0x5994ec=_[_0x35fc('0x20')](_0x4ab6f9,'id');return db[_0x35fc('0x5c')]['findAll']({'where':{'id':_0x5994ec},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x35fc('0x27'),_0x35fc('0x5d'),_0x35fc('0x5e'),_0x35fc('0x5f')],'raw':!![]}]})[_0x35fc('0x18')](function(_0x28525f){if(_0x28525f){var _0x9116b1=_[_0x35fc('0x60')](_0x28525f,function(_0x4818ea){var _0x5436a3=_0x4818ea['get']({'plain':!![]});_0x5436a3['Agents'][_0x35fc('0x61')](function(_0x4c9c90){_0x4c9c90[_0x35fc('0x62')]=_['find'](_0x4ab6f9,{'id':_0x5436a3['id']})[_0x35fc('0x62')];});return _0x5436a3[_0x35fc('0x63')];});return db['VoiceQueue']['find']({'where':{'id':_0x392212[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](function(_0x10ef95){return db[_0x35fc('0x64')][_0x35fc('0x65')](function(_0x4ff80c){return _0x10ef95['addTeams'](_0x5994ec,{'transaction':_0x4ff80c})[_0x35fc('0x18')](function(){return BPromise['each'](_0x4ab6f9,function(_0x15b6be){return db['TeamVoiceQueue'][_0x35fc('0x66')]({'TeamId':_0x15b6be['id'],'VoiceQueueId':_0x392212[_0x35fc('0x32')]['id'],'penalty':_0x15b6be[_0x35fc('0x62')]},{'transaction':_0x4ff80c});});})[_0x35fc('0x18')](function(){return BPromise['each'](_0x9116b1,function(_0x29a77a){return db['UserVoiceQueue'][_0x35fc('0x67')]({'where':{'UserId':_0x29a77a['id'],'VoiceQueueId':_0x392212['params']['id']},'defaults':{'penalty':_0x29a77a['penalty']},'transaction':_0x4ff80c});});})[_0x35fc('0x18')](function(){return BPromise['each'](_[_0x35fc('0x1e')](_0x9116b1,{'online':!![]}),function(_0x2c8361){return db[_0x35fc('0x68')][_0x35fc('0x66')]({'membername':_0x2c8361[_0x35fc('0x27')],'UserId':_0x2c8361['id'],'queue_name':_0x10ef95[_0x35fc('0x27')],'VoiceQueueId':_0x10ef95['id'],'interface':_[_0x35fc('0x69')](_0x2c8361[_0x35fc('0x5f')])?util[_0x35fc('0x6a')]('SIP/%s',_0x2c8361[_0x35fc('0x27')]):_0x2c8361[_0x35fc('0x5f')],'paused':_0x2c8361[_0x35fc('0x5e')]||![],'penalty':_0x2c8361[_0x35fc('0x62')]},{'transaction':_0x4ff80c});});})[_0x35fc('0x18')](function(){_0x9116b1[_0x35fc('0x61')](function(_0x4020ae){socket[_0x35fc('0x6b')]('userVoiceQueue:save',{'UserId':_0x4020ae['id'],'VoiceQueueId':_0x10ef95['id']});});});});});}})['then'](respondWithStatusCode(_0x201dfa,null))['catch'](handleError(_0x201dfa,null));};exports['removeTeams']=function(_0x5c8419,_0x271087){return db[_0x35fc('0x5c')][_0x35fc('0x2e')]({'where':{'id':_0x5c8419[_0x35fc('0x35')][_0x35fc('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x35fc('0x63'),'attributes':['id'],'raw':!![]}]})[_0x35fc('0x18')](handleEntityNotFound(_0x271087,null))[_0x35fc('0x18')](function(_0x2f450e){var _0x370e99=_['map'](_0x2f450e,'id');var _0x195ca3=[];var _0x398359=[];var _0x4188bc=squel['select']();_0x4188bc[_0x35fc('0x6d')](_0x35fc('0x6e'))[_0x35fc('0x6f')](_0x35fc('0x70'),'tq')[_0x35fc('0x71')](_0x35fc('0x72'),'ut',_0x35fc('0x73'))[_0x35fc('0x2c')](_0x35fc('0x74'),_0x5c8419[_0x35fc('0x32')]['id']);for(var _0x3aba1c=0x0;_0x3aba1c<_0x2f450e[_0x35fc('0x38')];_0x3aba1c+=0x1){let _0x225eb1=_0x2f450e[_0x3aba1c];for(var _0x206f0b=0x0;_0x206f0b<_0x225eb1[_0x35fc('0x63')]['length'];_0x206f0b+=0x1){let _0x4ae3d8=_0x225eb1[_0x35fc('0x63')][_0x206f0b];var _0x6a0c44=_0x4188bc[_0x35fc('0x75')]();_0x6a0c44[_0x35fc('0x2c')](_0x35fc('0x76'),_0x4ae3d8['id']);_0x398359[_0x35fc('0x77')](db[_0x35fc('0x64')][_0x35fc('0x35')](_0x6a0c44[_0x35fc('0x78')](),{'type':db[_0x35fc('0x64')][_0x35fc('0x79')][_0x35fc('0x7a')]})[_0x35fc('0x18')](function(_0x336c4a){if(_0x336c4a[_0x35fc('0x38')]===0x1){return _0x4ae3d8['id'];}else{var _0x5824a0=_[_0x35fc('0x7b')](_[_0x35fc('0x20')](_0x336c4a,_0x35fc('0x7c')),function(_0x34e007){return _[_0x35fc('0x7d')](_0x370e99,_0x34e007);});if(_0x5824a0){return _0x4ae3d8['id'];}}}));}}return BPromise[_0x35fc('0x7e')](_0x398359)[_0x35fc('0x18')](function(_0xa4c51a){_0x195ca3=_(_0x195ca3)['union'](_0xa4c51a)['compact']()[_0x35fc('0x21')]();return db[_0x35fc('0x29')]['find']({'where':{'id':_0x5c8419[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](function(_0x43a794){return db[_0x35fc('0x64')]['transaction'](function(_0x42912c){return _0x43a794[_0x35fc('0x7f')](_0x5c8419[_0x35fc('0x35')][_0x35fc('0x6c')],{'transaction':_0x42912c})['then'](function(){if(!_[_0x35fc('0x80')](_0x195ca3)){return _0x43a794[_0x35fc('0x81')](_0x195ca3,{'transaction':_0x42912c})['then'](function(){return db[_0x35fc('0x68')][_0x35fc('0x25')]({'where':{'VoiceQueueId':_0x5c8419[_0x35fc('0x32')]['id'],'UserId':_0x195ca3},'transaction':_0x42912c});});}})['then'](function(){_0x195ca3[_0x35fc('0x61')](function(_0x4de072){socket[_0x35fc('0x6b')](_0x35fc('0x82'),{'UserId':_0x4de072,'VoiceQueueId':_0x43a794['id']});});});});});});})['then'](respondWithStatusCode(_0x271087,null))[_0x35fc('0x30')](handleError(_0x271087,null));};exports[_0x35fc('0x83')]=function(_0x139065,_0x25aedf){var _0x316d37,_0x3fd897;return db[_0x35fc('0x29')]['find']({'where':{'id':_0x139065['params']['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x25aedf,null))[_0x35fc('0x18')](function(_0x2463dd){if(_0x2463dd){_0x3fd897=_0x2463dd;return _0x2463dd[_0x35fc('0x83')](_0x139065[_0x35fc('0x3d')][_0x35fc('0x6c')],_[_0x35fc('0x43')](_0x139065['body'],[_0x35fc('0x6c'),'id'])||{})[_0x35fc('0x84')](function(_0x46b9b6){for(var _0x4cdc31=0x0;_0x4cdc31<_0x139065[_0x35fc('0x3d')][_0x35fc('0x6c')][_0x35fc('0x38')];_0x4cdc31+=0x1){socket[_0x35fc('0x6b')](_0x35fc('0x85'),{'UserId':Number(_0x139065[_0x35fc('0x3d')][_0x35fc('0x6c')][_0x4cdc31]),'VoiceQueueId':Number(_0x139065[_0x35fc('0x32')]['id'])});}return _0x46b9b6;});}})[_0x35fc('0x18')](function(_0x14e414){_0x316d37=_0x14e414||[];if(_0x3fd897){return db[_0x35fc('0x86')][_0x35fc('0x2e')]({'where':{'id':_0x139065[_0x35fc('0x3d')][_0x35fc('0x6c')]},'attributes':['id',_0x35fc('0x27'),_0x35fc('0x5d'),_0x35fc('0x5e'),_0x35fc('0x5f')],'raw':!![]});}})[_0x35fc('0x18')](function(_0x4949ed){if(!_[_0x35fc('0x80')](_0x4949ed)){var _0x4f74ff=[];for(var _0x28cbc8=0x0;_0x28cbc8<_0x4949ed[_0x35fc('0x38')];_0x28cbc8++){if(_0x4949ed[_0x28cbc8]['online']){_0x4f74ff[_0x35fc('0x77')](db[_0x35fc('0x68')][_0x35fc('0x66')]({'membername':_0x4949ed[_0x28cbc8][_0x35fc('0x27')],'UserId':_0x4949ed[_0x28cbc8]['id'],'queue_name':_0x3fd897[_0x35fc('0x27')],'VoiceQueueId':_0x3fd897['id'],'interface':_[_0x35fc('0x69')](_0x4949ed[_0x28cbc8][_0x35fc('0x5f')])?util[_0x35fc('0x6a')]('SIP/%s',_0x4949ed[_0x28cbc8][_0x35fc('0x27')]):_0x4949ed[_0x28cbc8][_0x35fc('0x5f')],'paused':_0x4949ed[_0x28cbc8][_0x35fc('0x5e')]||![],'penalty':_0x139065[_0x35fc('0x3d')]['penalty']||0x0}));}}return BPromise['all'](_0x4f74ff);}})['then'](function(){return _0x316d37;})['then'](respondWithResult(_0x25aedf,null))[_0x35fc('0x30')](handleError(_0x25aedf,null));};exports['removeAgents']=function(_0xcbabdf,_0x2475d6){return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0xcbabdf[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x2475d6,null))[_0x35fc('0x18')](function(_0x41cbaa){if(_0x41cbaa){return _0x41cbaa[_0x35fc('0x81')](_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')])[_0x35fc('0x18')](function(){if(_[_0x35fc('0x87')](_0xcbabdf['query'][_0x35fc('0x6c')])){for(var _0x3e8580=0x0;_0x3e8580<_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')]['length'];_0x3e8580+=0x1){socket[_0x35fc('0x6b')](_0x35fc('0x82'),{'UserId':Number(_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')][_0x3e8580]),'VoiceQueueId':Number(_0xcbabdf[_0x35fc('0x32')]['id'])});}}else{socket[_0x35fc('0x6b')](_0x35fc('0x82'),{'UserId':Number(_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')]),'VoiceQueueId':Number(_0xcbabdf[_0x35fc('0x32')]['id'])});}});}})[_0x35fc('0x18')](function(_0xa39c4c){return db[_0x35fc('0x68')][_0x35fc('0x25')]({'where':{'VoiceQueueId':_0xcbabdf[_0x35fc('0x32')]['id'],'UserId':_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')]}})[_0x35fc('0x18')](function(){return _0xa39c4c;});})[_0x35fc('0x18')](respondWithStatusCode(_0x2475d6,null))[_0x35fc('0x30')](handleError(_0x2475d6,null));};exports[_0x35fc('0x88')]=function(_0x11d0f4,_0x4f150a){var _0x12238e={};var _0x16b52f={};var _0x238242;var _0x452f30;return db[_0x35fc('0x29')]['findOne']({'where':{'id':_0x11d0f4[_0x35fc('0x32')]['id']}})['then'](handleEntityNotFound(_0x4f150a,null))[_0x35fc('0x18')](function(_0x156c24){if(_0x156c24){_0x238242=_0x156c24;_0x16b52f[_0x35fc('0x33')]=_[_0x35fc('0x34')](db[_0x35fc('0x86')][_0x35fc('0x41')]);_0x16b52f[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x11d0f4[_0x35fc('0x35')]);_0x16b52f[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x16b52f[_0x35fc('0x33')],_0x16b52f[_0x35fc('0x35')]);_0x12238e[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x16b52f[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x42')]));_0x12238e[_0x35fc('0x37')]=_0x12238e['attributes'][_0x35fc('0x38')]?_0x12238e[_0x35fc('0x37')]:_0x16b52f[_0x35fc('0x33')];_0x12238e['order']=qs[_0x35fc('0x4f')](_0x11d0f4[_0x35fc('0x35')]['sort']);_0x12238e['where']=qs['filters'](_[_0x35fc('0x50')](_0x11d0f4[_0x35fc('0x35')],_0x16b52f['filters']));if(_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x12238e[_0x35fc('0x2c')]=_[_0x35fc('0x3a')](_0x12238e[_0x35fc('0x2c')],{'$or':_[_0x35fc('0x20')](_0x12238e['attributes'],function(_0x13534c){var _0x3be339={};_0x3be339[_0x13534c]={'$like':'%'+_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x3be339;})});}_0x12238e=_[_0x35fc('0x3a')]({},_0x12238e,_0x11d0f4['options']);return _0x238242[_0x35fc('0x88')](_0x12238e);}})[_0x35fc('0x18')](function(_0x52f355){if(_0x52f355){_0x452f30=_0x52f355[_0x35fc('0x38')];if(!_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x12238e[_0x35fc('0x11')]=qs[_0x35fc('0x11')](_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x11')]);_0x12238e[_0x35fc('0x10')]=qs['offset'](_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x10')]);}return _0x238242['getAgents'](_0x12238e);}})[_0x35fc('0x18')](function(_0x4ffbf9){if(_0x4ffbf9){return _0x4ffbf9?{'count':_0x452f30,'rows':_0x4ffbf9}:null;}})[_0x35fc('0x18')](respondWithResult(_0x4f150a,null))[_0x35fc('0x30')](handleError(_0x4f150a,null));};exports[_0x35fc('0x89')]=function(_0x206491,_0x536837){var _0x3cfbd4={};var _0x3ac7fb={};var _0x3916e7;var _0x4bcc53;return db[_0x35fc('0x29')]['findOne']({'where':{'id':_0x206491[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x536837,null))[_0x35fc('0x18')](function(_0x3da024){if(_0x3da024){_0x3916e7=_0x3da024;_0x3ac7fb[_0x35fc('0x33')]=_[_0x35fc('0x34')](db[_0x35fc('0x68')][_0x35fc('0x41')]);_0x3ac7fb[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x206491[_0x35fc('0x35')]);_0x3ac7fb[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x3ac7fb[_0x35fc('0x33')],_0x3ac7fb[_0x35fc('0x35')]);_0x3cfbd4['attributes']=_[_0x35fc('0x36')](_0x3ac7fb[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x206491[_0x35fc('0x35')][_0x35fc('0x42')]));_0x3cfbd4[_0x35fc('0x37')]=_0x3cfbd4[_0x35fc('0x37')]['length']?_0x3cfbd4['attributes']:_0x3ac7fb['model'];_0x3cfbd4['order']=qs[_0x35fc('0x4f')](_0x206491['query'][_0x35fc('0x4f')]);_0x3cfbd4[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x206491[_0x35fc('0x35')],_0x3ac7fb[_0x35fc('0x4c')]));if(_0x206491['query'][_0x35fc('0x1e')]){_0x3cfbd4['where']=_[_0x35fc('0x3a')](_0x3cfbd4['where'],{'$or':_['map'](_0x3cfbd4[_0x35fc('0x37')],function(_0x472e13){var _0x2d0512={};_0x2d0512[_0x472e13]={'$like':'%'+_0x206491['query']['filter']+'%'};return _0x2d0512;})});}_0x3cfbd4=_['merge']({},_0x3cfbd4,_0x206491['options']);return _0x3916e7[_0x35fc('0x89')](_0x3cfbd4);}})[_0x35fc('0x18')](function(_0x131db6){if(_0x131db6){_0x4bcc53=_0x131db6[_0x35fc('0x38')];if(!_0x206491[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x3cfbd4[_0x35fc('0x11')]=qs[_0x35fc('0x11')](_0x206491['query']['limit']);_0x3cfbd4[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x206491[_0x35fc('0x35')][_0x35fc('0x10')]);}return _0x3916e7[_0x35fc('0x89')](_0x3cfbd4);}})[_0x35fc('0x18')](function(_0x4f4c68){return _0x4f4c68?{'count':_0x4bcc53,'rows':_0x4f4c68}:null;})[_0x35fc('0x18')](respondWithResult(_0x536837,null))[_0x35fc('0x30')](handleError(_0x536837,null));};exports[_0x35fc('0x8a')]=function(_0x4f9a00,_0x5c097d){var _0x11c117={};var _0x26b1cb={};var _0x84e749;var _0x4f9685;return db[_0x35fc('0x29')][_0x35fc('0x53')]({'where':{'id':_0x4f9a00[_0x35fc('0x32')]['id']}})['then'](handleEntityNotFound(_0x5c097d,null))[_0x35fc('0x18')](function(_0x546d2e){if(_0x546d2e){_0x84e749=_0x546d2e;_0x26b1cb[_0x35fc('0x33')]=_['keys'](db[_0x35fc('0x8b')][_0x35fc('0x41')]);_0x26b1cb['query']=_[_0x35fc('0x34')](_0x4f9a00[_0x35fc('0x35')]);_0x26b1cb['filters']=_[_0x35fc('0x36')](_0x26b1cb[_0x35fc('0x33')],_0x26b1cb[_0x35fc('0x35')]);_0x11c117[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x26b1cb[_0x35fc('0x33')],qs['fields'](_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x42')]));_0x11c117[_0x35fc('0x37')]=_0x11c117[_0x35fc('0x37')][_0x35fc('0x38')]?_0x11c117['attributes']:_0x26b1cb[_0x35fc('0x33')];_0x11c117[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x11c117[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x4f9a00[_0x35fc('0x35')],_0x26b1cb['filters']));if(_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x11c117[_0x35fc('0x2c')]=_['merge'](_0x11c117[_0x35fc('0x2c')],{'$or':_['map'](_0x11c117[_0x35fc('0x37')],function(_0x413a4b){var _0x599121={};_0x599121[_0x413a4b]={'$like':'%'+_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x599121;})});}_0x11c117=_[_0x35fc('0x3a')]({},_0x11c117,_0x4f9a00[_0x35fc('0x3b')]);return _0x84e749[_0x35fc('0x8a')](_0x11c117);}})[_0x35fc('0x18')](function(_0x411d09){if(_0x411d09){_0x4f9685=_0x411d09['length'];if(!_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x11c117['limit']=qs['limit'](_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x11')]);_0x11c117[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x10')]);}return _0x84e749[_0x35fc('0x8a')](_0x11c117);}})[_0x35fc('0x18')](function(_0x214f01){if(_0x214f01){return _0x214f01?{'count':_0x4f9685,'rows':_0x214f01}:null;}})[_0x35fc('0x18')](respondWithResult(_0x5c097d,null))[_0x35fc('0x30')](handleError(_0x5c097d,null));};exports[_0x35fc('0x8c')]=function(_0xae43b4,_0x3c5524){var _0x2ceb04=moment()[_0x35fc('0x6a')](_0x35fc('0x8d'));var _0x605f3b,_0x43bb43;return db['VoiceQueue'][_0x35fc('0x23')]({'where':{'id':_0xae43b4['params']['id']}})['then'](handleEntityNotFound(_0x3c5524,null))[_0x35fc('0x18')](function(_0x1d7881){if(_0x1d7881){_0x43bb43=_0x1d7881;return _0x1d7881[_0x35fc('0x8c')](_0xae43b4[_0x35fc('0x3d')][_0x35fc('0x6c')],_[_0x35fc('0x43')](_0xae43b4[_0x35fc('0x3d')],[_0x35fc('0x6c'),'id'])||{});}return null;})[_0x35fc('0x84')](function(_0x3e0ebb){var _0x138fe5;_0x605f3b=_0x3e0ebb||[];var _0x3033a0=[];if(_0x3e0ebb){for(var _0x228bb9=0x0;_0x228bb9<_0x3e0ebb[_0x35fc('0x38')];_0x228bb9+=0x1){var _0x163afe=_0x3e0ebb[_0x228bb9][_0x35fc('0x19')]({'plain':!![]});_0x43bb43[_0x35fc('0x8e')]=_0xae43b4[_0x35fc('0x3d')][_0x35fc('0x8e')]?_0xae43b4[_0x35fc('0x3d')]['dialCheckDuplicateType']:_0x43bb43[_0x35fc('0x8e')];switch(_0x43bb43[_0x35fc('0x8e')]){case _0x35fc('0x8f'):_0x138fe5=squel['insert']()[_0x35fc('0x90')](_0x35fc('0x91'))[_0x35fc('0x92')](['phone',_0x35fc('0x93'),_0x35fc('0x94'),_0x35fc('0x95'),'VoiceQueueId',_0x35fc('0x44'),_0x35fc('0x45')],squel['select']()[_0x35fc('0x6d')](_0x35fc('0x96'),_0x35fc('0x96'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27','scheduledAt')['field']('id','ContactId')[_0x35fc('0x6d')](_0x163afe[_0x35fc('0x97')]['toString'](),_0x35fc('0x95'))[_0x35fc('0x6d')](_0xae43b4[_0x35fc('0x32')]['id'][_0x35fc('0x78')](),_0x35fc('0x51'))['field']('\x27'+_0x2ceb04+'\x27',_0x35fc('0x44'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27','updatedAt')[_0x35fc('0x6f')](_0x35fc('0x98'))[_0x35fc('0x2c')](_0x35fc('0x99'))[_0x35fc('0x2c')](_0x35fc('0x9a'),_0x163afe[_0x35fc('0x97')][_0x35fc('0x78')]())['where'](_0x35fc('0x9b'))['where'](_0x35fc('0x9c'),squel[_0x35fc('0x9d')]()[_0x35fc('0x6d')](_0x35fc('0x9e'))[_0x35fc('0x6f')](_0x35fc('0x9f'))['where']('VoiceQueueId\x20=\x20?',_0xae43b4['params']['id'][_0x35fc('0x78')]()))[_0x35fc('0x2c')](_0x35fc('0x9c'),squel['select']()[_0x35fc('0x6d')](_0x35fc('0xa0'))[_0x35fc('0x6f')](_0x35fc('0x91'))[_0x35fc('0x2c')](_0x35fc('0x74'),_0xae43b4[_0x35fc('0x32')]['id'][_0x35fc('0x78')]())))[_0x35fc('0x78')]();break;case _0x35fc('0xa1'):_0x138fe5=squel[_0x35fc('0xa2')]()['into'](_0x35fc('0x91'))[_0x35fc('0x92')](['phone',_0x35fc('0x93'),_0x35fc('0x94'),'ListId','VoiceQueueId',_0x35fc('0x44'),_0x35fc('0x45')],squel[_0x35fc('0x9d')]()[_0x35fc('0x6d')](_0x35fc('0x96'),_0x35fc('0x96'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x93'))['field']('id',_0x35fc('0x94'))[_0x35fc('0x6d')](_0x163afe[_0x35fc('0x97')]['toString'](),_0x35fc('0x95'))['field'](_0xae43b4[_0x35fc('0x32')]['id'][_0x35fc('0x78')](),_0x35fc('0x51'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x44'))['field']('\x27'+_0x2ceb04+'\x27',_0x35fc('0x45'))['from']('cm_contacts')[_0x35fc('0x2c')](_0x35fc('0x99'))[_0x35fc('0x2c')]('ListId\x20=\x20?',_0x163afe[_0x35fc('0x97')][_0x35fc('0x78')]())[_0x35fc('0x2c')](_0x35fc('0x9b'))[_0x35fc('0x2c')](_0x35fc('0x9c'),squel[_0x35fc('0x9d')]()['field']('COALESCE(phone,\x27\x27)')[_0x35fc('0x6f')](_0x35fc('0x91'))['where'](_0x35fc('0x74'),_0xae43b4['params']['id'][_0x35fc('0x78')]())))[_0x35fc('0x78')]();break;default:_0x138fe5=squel[_0x35fc('0xa2')]()[_0x35fc('0x90')]('cm_hopper')[_0x35fc('0x92')](['phone',_0x35fc('0x93'),_0x35fc('0x94'),_0x35fc('0x95'),'VoiceQueueId',_0x35fc('0x44'),_0x35fc('0x45')],squel[_0x35fc('0x9d')]()[_0x35fc('0x6d')](_0x35fc('0x96'),_0x35fc('0x96'))['field']('\x27'+_0x2ceb04+'\x27',_0x35fc('0x93'))[_0x35fc('0x6d')]('id','ContactId')[_0x35fc('0x6d')](_0x163afe['CmListId']['toString'](),'ListId')[_0x35fc('0x6d')](_0xae43b4[_0x35fc('0x32')]['id'][_0x35fc('0x78')](),_0x35fc('0x51'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x44'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x45'))[_0x35fc('0x6f')](_0x35fc('0x98'))[_0x35fc('0x2c')](_0x35fc('0x99'))['where'](_0x35fc('0x9a'),_0x163afe[_0x35fc('0x97')][_0x35fc('0x78')]())[_0x35fc('0x2c')](_0x35fc('0x9b')))[_0x35fc('0x78')]();}_0x3033a0[_0x35fc('0x77')](db['sequelize'][_0x35fc('0x35')](_0x138fe5));}return BPromise['all'](_0x3033a0);}})[_0x35fc('0x18')](function(){var _0x477d70=[];var _0x28533f=squel['insert']()[_0x35fc('0x90')](_0x35fc('0xa3'))[_0x35fc('0x92')]([_0x35fc('0xa4'),_0x35fc('0x96'),_0x35fc('0xa5'),'createdAt',_0x35fc('0x45')],squel['select']()[_0x35fc('0x6d')]('h.id')['field'](_0x35fc('0xa6'))[_0x35fc('0x6d')]('ci.OrderBy+1')[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x44'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27','updatedAt')[_0x35fc('0x6f')](_0x35fc('0xa7'),'ci')[_0x35fc('0x71')]('cm_hopper','h',_0x35fc('0xa8'))[_0x35fc('0x2c')](_0x35fc('0xa9'),_0x2ceb04)[_0x35fc('0x2c')](_0x35fc('0xaa'),_0x35fc('0xab')))[_0x35fc('0x78')]();_0x477d70[_0x35fc('0x77')](db[_0x35fc('0x64')][_0x35fc('0x35')](_0x28533f));return BPromise[_0x35fc('0x7e')](_0x477d70);})[_0x35fc('0x18')](function(){return _0x605f3b;})[_0x35fc('0x18')](respondWithResult(_0x3c5524,null))[_0x35fc('0x30')](handleError(_0x3c5524,null));};exports['removeLists']=function(_0x57b3f1,_0x8fa3cf){return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0x57b3f1[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x8fa3cf,null))[_0x35fc('0x18')](function(_0x293c2d){if(_0x293c2d){return _0x293c2d[_0x35fc('0xac')](_0x57b3f1[_0x35fc('0x35')][_0x35fc('0x6c')]);}})['then'](function(_0x4860b4){if(_0x4860b4){return db[_0x35fc('0x4b')][_0x35fc('0x25')]({'where':{'ListId':_0x57b3f1[_0x35fc('0x35')][_0x35fc('0x6c')],'VoiceQueueId':_0x57b3f1[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](function(){return _0x4860b4;});}})[_0x35fc('0x18')](respondWithStatusCode(_0x8fa3cf,null))[_0x35fc('0x30')](handleError(_0x8fa3cf,null));};exports[_0x35fc('0xad')]=function(_0x55d140,_0x488cea){var _0x1a5f12={};var _0x4c40e5={};var _0x3afdf3;var _0x3b64de;return db['VoiceQueue'][_0x35fc('0x53')]({'where':{'id':_0x55d140['params']['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x488cea,null))[_0x35fc('0x18')](function(_0xa46452){if(_0xa46452){_0x3afdf3=_0xa46452;_0x4c40e5[_0x35fc('0x33')]=_[_0x35fc('0x34')](db['CmList'][_0x35fc('0x41')]);_0x4c40e5[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x55d140['query']);_0x4c40e5[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x4c40e5[_0x35fc('0x33')],_0x4c40e5['query']);_0x1a5f12[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x4c40e5[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x55d140[_0x35fc('0x35')][_0x35fc('0x42')]));_0x1a5f12[_0x35fc('0x37')]=_0x1a5f12[_0x35fc('0x37')][_0x35fc('0x38')]?_0x1a5f12[_0x35fc('0x37')]:_0x4c40e5[_0x35fc('0x33')];_0x1a5f12[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x55d140[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x1a5f12[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x55d140[_0x35fc('0x35')],_0x4c40e5[_0x35fc('0x4c')]));if(_0x55d140['query'][_0x35fc('0x1e')]){_0x1a5f12[_0x35fc('0x2c')]=_['merge'](_0x1a5f12[_0x35fc('0x2c')],{'$or':_[_0x35fc('0x20')](_0x1a5f12[_0x35fc('0x37')],function(_0x55c126){var _0x9e7561={};_0x9e7561[_0x55c126]={'$like':'%'+_0x55d140[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x9e7561;})});}_0x1a5f12=_[_0x35fc('0x3a')]({},_0x1a5f12,_0x55d140[_0x35fc('0x3b')]);return _0x3afdf3[_0x35fc('0xad')](_0x1a5f12);}})[_0x35fc('0x18')](function(_0x5545e9){if(_0x5545e9){_0x3b64de=_0x5545e9[_0x35fc('0x38')];if(!_0x55d140[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x1a5f12[_0x35fc('0x11')]=qs[_0x35fc('0x11')](_0x55d140[_0x35fc('0x35')][_0x35fc('0x11')]);_0x1a5f12['offset']=qs['offset'](_0x55d140[_0x35fc('0x35')][_0x35fc('0x10')]);}return _0x3afdf3['getBlackLists'](_0x1a5f12);}})[_0x35fc('0x18')](function(_0x2c1181){if(_0x2c1181){return _0x2c1181?{'count':_0x3b64de,'rows':_0x2c1181}:null;}})[_0x35fc('0x18')](respondWithResult(_0x488cea,null))[_0x35fc('0x30')](handleError(_0x488cea,null));};exports[_0x35fc('0xae')]=function(_0x3f7fd7,_0x5e16f1){var _0xa46ffd;return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0x3f7fd7[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x5e16f1,null))[_0x35fc('0x18')](function(_0x4abeb5){if(_0x4abeb5){return _0x4abeb5[_0x35fc('0xae')](_0x3f7fd7[_0x35fc('0x3d')][_0x35fc('0x6c')],_[_0x35fc('0x43')](_0x3f7fd7[_0x35fc('0x3d')],[_0x35fc('0x6c'),'id'])||{});}return null;})[_0x35fc('0x84')](function(_0x4007f9){var _0x58d0b1;_0xa46ffd=_0x4007f9||[];var _0x4bf83e=[];if(_0x4007f9){for(var _0x1afe94=0x0;_0x1afe94<_0x4007f9[_0x35fc('0x38')];_0x1afe94+=0x1){var _0x108366=_0x4007f9[_0x1afe94][_0x35fc('0x19')]({'plain':!![]});_0x58d0b1=squel['insert']()[_0x35fc('0x90')]('cm_hopper_black')['fromQuery']([_0x35fc('0x96'),_0x35fc('0x94'),_0x35fc('0x95'),_0x35fc('0x51'),_0x35fc('0x44'),_0x35fc('0x45')],squel[_0x35fc('0x9d')]()['field'](_0x35fc('0x96'),_0x35fc('0x96'))[_0x35fc('0x6d')]('id',_0x35fc('0x94'))['field'](_0x108366[_0x35fc('0x97')][_0x35fc('0x78')](),_0x35fc('0x95'))[_0x35fc('0x6d')](_0x3f7fd7[_0x35fc('0x32')]['id']['toString'](),_0x35fc('0x51'))[_0x35fc('0x6d')](_0x35fc('0xaf'),_0x35fc('0x44'))[_0x35fc('0x6d')]('NOW()','updatedAt')[_0x35fc('0x6f')](_0x35fc('0x98'))[_0x35fc('0x2c')](_0x35fc('0x99'))[_0x35fc('0x2c')](_0x35fc('0x9a'),_0x108366[_0x35fc('0x97')]['toString']())[_0x35fc('0x2c')](_0x35fc('0x9b')))['toString']();_0x4bf83e[_0x35fc('0x77')](db[_0x35fc('0x64')][_0x35fc('0x35')](_0x58d0b1));}return BPromise[_0x35fc('0x7e')](_0x4bf83e);}})[_0x35fc('0x18')](function(){return _0xa46ffd;})[_0x35fc('0x18')](respondWithResult(_0x5e16f1,null))[_0x35fc('0x30')](handleError(_0x5e16f1,null));};exports[_0x35fc('0xb0')]=function(_0x4fd3d4,_0x2dff64){return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0x4fd3d4['params']['id']}})['then'](handleEntityNotFound(_0x2dff64,null))[_0x35fc('0x18')](function(_0x409a32){if(_0x409a32){return _0x409a32['removeBlackLists'](_0x4fd3d4[_0x35fc('0x35')][_0x35fc('0x6c')]);}})[_0x35fc('0x18')](function(_0x2c0bf5){if(_0x2c0bf5){return db['CmHopperBlack'][_0x35fc('0x25')]({'where':{'ListId':_0x4fd3d4['query']['ids'],'VoiceQueueId':_0x4fd3d4[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](function(){return _0x2c0bf5;});}})[_0x35fc('0x18')](respondWithStatusCode(_0x2dff64,null))[_0x35fc('0x30')](handleError(_0x2dff64,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 13138c8..8349a17 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 _0x1f82=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3fc21a,_0x2f8657){var _0x1bcc00=function(_0x1b6212){while(--_0x1b6212){_0x3fc21a['push'](_0x3fc21a['shift']());}};_0x1bcc00(++_0x2f8657);}(_0x1f82,0x12d));var _0x21f8=function(_0x5d2f39,_0x11e2f4){_0x5d2f39=_0x5d2f39-0x0;var _0x3df8f6=_0x1f82[_0x5d2f39];return _0x3df8f6;};'use strict';var EventEmitter=require(_0x21f8('0x0'));var VoiceQueue=require(_0x21f8('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x21f8('0x2')](0x0);var events={'afterCreate':_0x21f8('0x3'),'afterUpdate':_0x21f8('0x4'),'afterDestroy':_0x21f8('0x5')};function emitEvent(_0x4b88f5){return function(_0x501fdc,_0x430520,_0x42cef4){VoiceQueueEvents[_0x21f8('0x6')](_0x4b88f5+':'+_0x501fdc['id'],_0x501fdc);VoiceQueueEvents[_0x21f8('0x6')](_0x4b88f5,_0x501fdc);_0x42cef4(null);};}for(var e in events){if(events[_0x21f8('0x7')](e)){var event=events[e];VoiceQueue[_0x21f8('0x8')](e,emitEvent(event));}}module[_0x21f8('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x6bdd=['VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x2390d9,_0x33b8c9){var _0x5a785e=function(_0x3f8404){while(--_0x3f8404){_0x2390d9['push'](_0x2390d9['shift']());}};_0x5a785e(++_0x33b8c9);}(_0x6bdd,0x11f));var _0xd6bd=function(_0x98459f,_0x4dfb55){_0x98459f=_0x98459f-0x0;var _0x128f94=_0x6bdd[_0x98459f];return _0x128f94;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xd6bd('0x0'))['db'][_0xd6bd('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xd6bd('0x2')](0x0);var events={'afterCreate':_0xd6bd('0x3'),'afterUpdate':_0xd6bd('0x4'),'afterDestroy':_0xd6bd('0x5')};function emitEvent(_0xbfd98d){return function(_0x3f69b7,_0xc49a81,_0x3afb30){VoiceQueueEvents[_0xd6bd('0x6')](_0xbfd98d+':'+_0x3f69b7['id'],_0x3f69b7);VoiceQueueEvents[_0xd6bd('0x6')](_0xbfd98d,_0x3f69b7);_0x3afb30(null);};}for(var e in events){if(events[_0xd6bd('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xd6bd('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index f490ffb..cb255ec 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 _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x34dccc,_0x169ee1){var _0x41158d=function(_0x541ddc){while(--_0x541ddc){_0x34dccc['push'](_0x34dccc['shift']());}};_0x41158d(++_0x169ee1);}(_0x34e8,0x12c));var _0x834e=function(_0x565e8a,_0x5198b3){_0x565e8a=_0x565e8a-0x0;var _0x57063d=_0x34e8[_0x565e8a];return _0x57063d;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x53341d,_0x1236f3){var _0x971a27=function(_0x2d740a){while(--_0x2d740a){_0x53341d['push'](_0x53341d['shift']());}};_0x971a27(++_0x1236f3);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 3cd37e1..5de2b6f 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 _0xda98=['register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceQueue','findAll','options','raw','where','attributes','include','model','map','GetVoiceQueue','ShowVoiceQueue','find','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x3c485c,_0x308577){var _0xe47499=function(_0x297a31){while(--_0x297a31){_0x3c485c['push'](_0x3c485c['shift']());}};_0xe47499(++_0x308577);}(_0xda98,0xdc));var _0x8da9=function(_0x5cb367,_0x27ec9d){_0x5cb367=_0x5cb367-0x0;var _0x279365=_0xda98[_0x5cb367];return _0x279365;};'use strict';var _=require(_0x8da9('0x0'));var util=require('util');var moment=require(_0x8da9('0x1'));var BPromise=require(_0x8da9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8da9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8da9('0x4'));var logger=require(_0x8da9('0x5'))(_0x8da9('0x6'));var config=require(_0x8da9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8da9('0x8')][_0x8da9('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8da9('0xa')],{'host':_0x8da9('0xb'),'port':0x18eb});var socket=require(_0x8da9('0xc'))(new Redis(config[_0x8da9('0xa')]));require(_0x8da9('0xd'))[_0x8da9('0xe')](socket);function respondWithRpcPromise(_0x7fbb7,_0x18d083,_0x24a8b1){return new BPromise(function(_0x2fc782,_0x35d3b6){return client[_0x8da9('0xf')](_0x7fbb7,_0x24a8b1)[_0x8da9('0x10')](function(_0x3455d0){logger[_0x8da9('0x11')](_0x8da9('0x12'),_0x18d083,_0x8da9('0x13'));logger[_0x8da9('0x14')](_0x8da9('0x15'),_0x18d083,_0x8da9('0x13'),JSON[_0x8da9('0x16')](_0x3455d0));if(_0x3455d0[_0x8da9('0x17')]){if(_0x3455d0[_0x8da9('0x17')][_0x8da9('0x18')]===0x1f4){logger['error'](_0x8da9('0x12'),_0x18d083,_0x3455d0[_0x8da9('0x17')][_0x8da9('0x19')]);return _0x35d3b6(_0x3455d0[_0x8da9('0x17')][_0x8da9('0x19')]);}logger[_0x8da9('0x17')](_0x8da9('0x12'),_0x18d083,_0x3455d0['error'][_0x8da9('0x19')]);return _0x2fc782(_0x3455d0['error']['message']);}else{logger[_0x8da9('0x11')](_0x8da9('0x12'),_0x18d083,_0x8da9('0x13'));_0x2fc782(_0x3455d0['result']['message']);}})[_0x8da9('0x1a')](function(_0x970c62){logger['error'](_0x8da9('0x12'),_0x18d083,_0x970c62);_0x35d3b6(_0x970c62);});});}exports['GetVoiceQueue']=function(_0x33e440){var _0x4305e9=this;return new Promise(function(_0x26d922,_0x193ce4){return db[_0x8da9('0x1b')][_0x8da9('0x1c')]({'raw':_0x33e440[_0x8da9('0x1d')]?_0x33e440[_0x8da9('0x1d')][_0x8da9('0x1e')]===undefined?!![]:![]:!![],'where':_0x33e440[_0x8da9('0x1d')]?_0x33e440[_0x8da9('0x1d')][_0x8da9('0x1f')]||null:null,'attributes':_0x33e440[_0x8da9('0x1d')]?_0x33e440[_0x8da9('0x1d')][_0x8da9('0x20')]||null:null,'limit':_0x33e440[_0x8da9('0x1d')]?_0x33e440['options']['limit']||null:null,'include':_0x33e440[_0x8da9('0x1d')]?_0x33e440[_0x8da9('0x1d')][_0x8da9('0x21')]?_['map'](_0x33e440[_0x8da9('0x1d')][_0x8da9('0x21')],function(_0x2886a3){return{'model':db[_0x2886a3[_0x8da9('0x22')]],'as':_0x2886a3['as'],'attributes':_0x2886a3[_0x8da9('0x20')],'include':_0x2886a3['include']?_[_0x8da9('0x23')](_0x2886a3[_0x8da9('0x21')],function(_0x4e6c25){return{'model':db[_0x4e6c25[_0x8da9('0x22')]],'as':_0x4e6c25['as'],'attributes':_0x4e6c25[_0x8da9('0x20')],'include':_0x4e6c25[_0x8da9('0x21')]?_[_0x8da9('0x23')](_0x4e6c25['include'],function(_0x2d7caa){return{'model':db[_0x2d7caa[_0x8da9('0x22')]],'as':_0x2d7caa['as'],'attributes':_0x2d7caa[_0x8da9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8da9('0x10')](function(_0x1bc8f7){logger[_0x8da9('0x11')](_0x8da9('0x24'),_0x33e440);logger['debug'](_0x8da9('0x24'),_0x33e440,JSON[_0x8da9('0x16')](_0x1bc8f7));_0x26d922(_0x1bc8f7);})[_0x8da9('0x1a')](function(_0x35a7d4){logger[_0x8da9('0x17')](_0x8da9('0x24'),_0x35a7d4[_0x8da9('0x19')],_0x33e440);_0x193ce4(_0x4305e9[_0x8da9('0x17')](0x1f4,_0x35a7d4['message']));});});};exports[_0x8da9('0x25')]=function(_0x3f9749){var _0x357944=this;return new Promise(function(_0x433261,_0x3d2103){return db[_0x8da9('0x1b')][_0x8da9('0x26')]({'raw':_0x3f9749[_0x8da9('0x1d')]?_0x3f9749['options'][_0x8da9('0x1e')]===undefined?!![]:![]:!![],'where':_0x3f9749[_0x8da9('0x1d')]?_0x3f9749['options'][_0x8da9('0x1f')]||null:null,'attributes':_0x3f9749[_0x8da9('0x1d')]?_0x3f9749[_0x8da9('0x1d')][_0x8da9('0x20')]||null:null,'include':_0x3f9749[_0x8da9('0x1d')]?_0x3f9749[_0x8da9('0x1d')][_0x8da9('0x21')]?_[_0x8da9('0x23')](_0x3f9749[_0x8da9('0x1d')]['include'],function(_0x343e52){return{'model':db[_0x343e52['model']],'as':_0x343e52['as'],'attributes':_0x343e52[_0x8da9('0x20')],'include':_0x343e52['include']?_[_0x8da9('0x23')](_0x343e52[_0x8da9('0x21')],function(_0x27ed61){return{'model':db[_0x27ed61[_0x8da9('0x22')]],'as':_0x27ed61['as'],'attributes':_0x27ed61[_0x8da9('0x20')],'include':_0x27ed61[_0x8da9('0x21')]?_[_0x8da9('0x23')](_0x27ed61[_0x8da9('0x21')],function(_0x1785b2){return{'model':db[_0x1785b2[_0x8da9('0x22')]],'as':_0x1785b2['as'],'attributes':_0x1785b2[_0x8da9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8da9('0x10')](function(_0x264986){logger[_0x8da9('0x11')]('ShowVoiceQueue',_0x3f9749);logger[_0x8da9('0x14')](_0x8da9('0x25'),_0x3f9749,JSON[_0x8da9('0x16')](_0x264986));_0x433261(_0x264986);})[_0x8da9('0x1a')](function(_0x48f231){logger[_0x8da9('0x17')]('ShowVoiceQueue',_0x48f231[_0x8da9('0x19')],_0x3f9749);_0x3d2103(_0x357944[_0x8da9('0x17')](0x1f4,_0x48f231['message']));});});}; \ No newline at end of file +var _0x727b=['debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowVoiceQueue','find','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','VoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x4ff605,_0x4942c2){var _0x1e69cc=function(_0x18fa11){while(--_0x18fa11){_0x4ff605['push'](_0x4ff605['shift']());}};_0x1e69cc(++_0x4942c2);}(_0x727b,0x191));var _0xb727=function(_0x67dbf9,_0x2ef1b1){_0x67dbf9=_0x67dbf9-0x0;var _0x59ba9f=_0x727b[_0x67dbf9];return _0x59ba9f;};'use strict';var _=require(_0xb727('0x0'));var util=require(_0xb727('0x1'));var moment=require('moment');var BPromise=require(_0xb727('0x2'));var rs=require(_0xb727('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb727('0x4'))['db'];var utils=require(_0xb727('0x5'));var logger=require(_0xb727('0x6'))(_0xb727('0x7'));var config=require(_0xb727('0x8'));var jayson=require(_0xb727('0x9'));var client=jayson['client'][_0xb727('0xa')]({'port':0x232a});config[_0xb727('0xb')]=_['defaults'](config[_0xb727('0xb')],{'host':_0xb727('0xc'),'port':0x18eb});var socket=require(_0xb727('0xd'))(new Redis(config['redis']));require(_0xb727('0xe'))[_0xb727('0xf')](socket);function respondWithRpcPromise(_0x36d678,_0x390c98,_0x5ee4ce){return new BPromise(function(_0x41330d,_0x58bc67){return client[_0xb727('0x10')](_0x36d678,_0x5ee4ce)['then'](function(_0x3dc968){logger['info'](_0xb727('0x11'),_0x390c98,_0xb727('0x12'));logger[_0xb727('0x13')](_0xb727('0x14'),_0x390c98,_0xb727('0x12'),JSON[_0xb727('0x15')](_0x3dc968));if(_0x3dc968['error']){if(_0x3dc968['error'][_0xb727('0x16')]===0x1f4){logger[_0xb727('0x17')](_0xb727('0x11'),_0x390c98,_0x3dc968[_0xb727('0x17')]['message']);return _0x58bc67(_0x3dc968[_0xb727('0x17')][_0xb727('0x18')]);}logger[_0xb727('0x17')](_0xb727('0x11'),_0x390c98,_0x3dc968[_0xb727('0x17')]['message']);return _0x41330d(_0x3dc968['error'][_0xb727('0x18')]);}else{logger[_0xb727('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x390c98,_0xb727('0x12'));_0x41330d(_0x3dc968[_0xb727('0x1a')][_0xb727('0x18')]);}})[_0xb727('0x1b')](function(_0x26ba05){logger[_0xb727('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x390c98,_0x26ba05);_0x58bc67(_0x26ba05);});});}exports[_0xb727('0x1c')]=function(_0x5bfa21){var _0x6236af=this;return new Promise(function(_0x22eb64,_0x37a7f8){return db[_0xb727('0x1d')][_0xb727('0x1e')]({'raw':_0x5bfa21[_0xb727('0x1f')]?_0x5bfa21[_0xb727('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5bfa21[_0xb727('0x1f')]?_0x5bfa21[_0xb727('0x1f')][_0xb727('0x20')]||null:null,'attributes':_0x5bfa21['options']?_0x5bfa21['options'][_0xb727('0x21')]||null:null,'limit':_0x5bfa21[_0xb727('0x1f')]?_0x5bfa21['options'][_0xb727('0x22')]||null:null,'include':_0x5bfa21[_0xb727('0x1f')]?_0x5bfa21[_0xb727('0x1f')][_0xb727('0x23')]?_[_0xb727('0x24')](_0x5bfa21[_0xb727('0x1f')][_0xb727('0x23')],function(_0x520119){return{'model':db[_0x520119[_0xb727('0x25')]],'as':_0x520119['as'],'attributes':_0x520119[_0xb727('0x21')],'include':_0x520119[_0xb727('0x23')]?_[_0xb727('0x24')](_0x520119[_0xb727('0x23')],function(_0x266569){return{'model':db[_0x266569[_0xb727('0x25')]],'as':_0x266569['as'],'attributes':_0x266569[_0xb727('0x21')],'include':_0x266569[_0xb727('0x23')]?_[_0xb727('0x24')](_0x266569[_0xb727('0x23')],function(_0x1f7a85){return{'model':db[_0x1f7a85[_0xb727('0x25')]],'as':_0x1f7a85['as'],'attributes':_0x1f7a85['attributes']};}):[]};}):[]};}):[]:[]})[_0xb727('0x26')](function(_0x2da3ea){logger['info']('GetVoiceQueue',_0x5bfa21);logger['debug'](_0xb727('0x1c'),_0x5bfa21,JSON[_0xb727('0x15')](_0x2da3ea));_0x22eb64(_0x2da3ea);})['catch'](function(_0x5578bc){logger[_0xb727('0x17')](_0xb727('0x1c'),_0x5578bc[_0xb727('0x18')],_0x5bfa21);_0x37a7f8(_0x6236af[_0xb727('0x17')](0x1f4,_0x5578bc[_0xb727('0x18')]));});});};exports[_0xb727('0x27')]=function(_0x7ff7d0){var _0x5313ef=this;return new Promise(function(_0x5d608e,_0x5e90ea){return db[_0xb727('0x1d')][_0xb727('0x28')]({'raw':_0x7ff7d0[_0xb727('0x1f')]?_0x7ff7d0[_0xb727('0x1f')][_0xb727('0x29')]===undefined?!![]:![]:!![],'where':_0x7ff7d0[_0xb727('0x1f')]?_0x7ff7d0[_0xb727('0x1f')]['where']||null:null,'attributes':_0x7ff7d0[_0xb727('0x1f')]?_0x7ff7d0[_0xb727('0x1f')][_0xb727('0x21')]||null:null,'include':_0x7ff7d0[_0xb727('0x1f')]?_0x7ff7d0['options']['include']?_['map'](_0x7ff7d0['options'][_0xb727('0x23')],function(_0x2a9bb3){return{'model':db[_0x2a9bb3[_0xb727('0x25')]],'as':_0x2a9bb3['as'],'attributes':_0x2a9bb3[_0xb727('0x21')],'include':_0x2a9bb3[_0xb727('0x23')]?_[_0xb727('0x24')](_0x2a9bb3['include'],function(_0x4c6bf8){return{'model':db[_0x4c6bf8[_0xb727('0x25')]],'as':_0x4c6bf8['as'],'attributes':_0x4c6bf8[_0xb727('0x21')],'include':_0x4c6bf8[_0xb727('0x23')]?_[_0xb727('0x24')](_0x4c6bf8['include'],function(_0x5ad3fa){return{'model':db[_0x5ad3fa[_0xb727('0x25')]],'as':_0x5ad3fa['as'],'attributes':_0x5ad3fa['attributes']};}):[]};}):[]};}):[]:[]})[_0xb727('0x26')](function(_0x49efb5){logger[_0xb727('0x19')](_0xb727('0x27'),_0x7ff7d0);logger['debug'](_0xb727('0x27'),_0x7ff7d0,JSON[_0xb727('0x15')](_0x49efb5));_0x5d608e(_0x49efb5);})['catch'](function(_0x205d92){logger[_0xb727('0x17')](_0xb727('0x27'),_0x205d92['message'],_0x7ff7d0);_0x5e90ea(_0x5313ef[_0xb727('0x17')](0x1f4,_0x205d92[_0xb727('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 9806904..6c5997d 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 _0x27e9=['./voiceQueue.events','save','remove','emit','register','voiceQueue:'];(function(_0x538929,_0x1fde6e){var _0x17bd8d=function(_0x4087e9){while(--_0x4087e9){_0x538929['push'](_0x538929['shift']());}};_0x17bd8d(++_0x1fde6e);}(_0x27e9,0x10e));var _0x927e=function(_0x5c2389,_0x4e6faa){_0x5c2389=_0x5c2389-0x0;var _0x2e31e4=_0x27e9[_0x5c2389];return _0x2e31e4;};'use strict';var VoiceQueueEvents=require(_0x927e('0x0'));var events=[_0x927e('0x1'),_0x927e('0x2'),'update'];function createListener(_0x316860,_0x182955){return function(_0x599f0b){_0x182955[_0x927e('0x3')](_0x316860,_0x599f0b);};}function removeListener(_0x190bdc,_0x1b6c5d){return function(){VoiceQueueEvents['removeListener'](_0x190bdc,_0x1b6c5d);};}exports[_0x927e('0x4')]=function(_0x5e45e9){for(var _0xa5cd21=0x0,_0x37a6d7=events['length'];_0xa5cd21<_0x37a6d7;_0xa5cd21++){var _0x3ee226=events[_0xa5cd21];var _0x563604=createListener(_0x927e('0x5')+_0x3ee226,_0x5e45e9);VoiceQueueEvents['on'](_0x3ee226,_0x563604);}}; \ No newline at end of file +var _0xffd0=['register','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x353c9b,_0x963d4b){var _0x37b8f4=function(_0x56d4ee){while(--_0x56d4ee){_0x353c9b['push'](_0x353c9b['shift']());}};_0x37b8f4(++_0x963d4b);}(_0xffd0,0xd2));var _0x0ffd=function(_0x2a13f1,_0x5acb4e){_0x2a13f1=_0x2a13f1-0x0;var _0x51c04d=_0xffd0[_0x2a13f1];return _0x51c04d;};'use strict';var VoiceQueueEvents=require(_0x0ffd('0x0'));var events=[_0x0ffd('0x1'),_0x0ffd('0x2'),_0x0ffd('0x3')];function createListener(_0x24cdff,_0x3e48e7){return function(_0x5d5b72){_0x3e48e7[_0x0ffd('0x4')](_0x24cdff,_0x5d5b72);};}function removeListener(_0x37d072,_0x1197f1){return function(){VoiceQueueEvents[_0x0ffd('0x5')](_0x37d072,_0x1197f1);};}exports[_0x0ffd('0x6')]=function(_0x489cdf){for(var _0x5032de=0x0,_0x2b3466=events[_0x0ffd('0x7')];_0x5032de<_0x2b3466;_0x5032de++){var _0x2a1b44=events[_0x5032de];var _0x484e22=createListener(_0x0ffd('0x8')+_0x2a1b44,_0x489cdf);VoiceQueueEvents['on'](_0x2a1b44,_0x484e22);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 4c38272..62312b2 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 _0xa668=['/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','getVoiceQueuesReport'];(function(_0x5acaaf,_0xbbf334){var _0x47b05c=function(_0xa669ba){while(--_0xa669ba){_0x5acaaf['push'](_0x5acaaf['shift']());}};_0x47b05c(++_0xbbf334);}(_0xa668,0x188));var _0x8a66=function(_0x2cec39,_0x1893aa){_0x2cec39=_0x2cec39-0x0;var _0x3a4ea6=_0xa668[_0x2cec39];return _0x3a4ea6;};'use strict';var multer=require(_0x8a66('0x0'));var util=require(_0x8a66('0x1'));var path=require(_0x8a66('0x2'));var timeout=require('connect-timeout');var express=require(_0x8a66('0x3'));var router=express[_0x8a66('0x4')]();var fs_extra=require(_0x8a66('0x5'));var auth=require(_0x8a66('0x6'));var interaction=require(_0x8a66('0x7'));var config=require(_0x8a66('0x8'));var controller=require(_0x8a66('0x9'));router[_0x8a66('0xa')]('/',auth[_0x8a66('0xb')](),controller[_0x8a66('0xc')]);router[_0x8a66('0xa')](_0x8a66('0xd'),auth[_0x8a66('0xb')](),controller['describe']);router[_0x8a66('0xa')](_0x8a66('0xe'),auth[_0x8a66('0xb')](),controller[_0x8a66('0xf')]);router[_0x8a66('0xa')](_0x8a66('0x10'),auth['isAuthenticated'](),controller['show']);router[_0x8a66('0x11')]('/',auth[_0x8a66('0xb')](),controller[_0x8a66('0x12')]);router[_0x8a66('0x13')](_0x8a66('0x10'),auth[_0x8a66('0xb')](),controller[_0x8a66('0x14')]);router[_0x8a66('0x15')](_0x8a66('0x10'),auth['isAuthenticated'](),controller[_0x8a66('0x16')]);module[_0x8a66('0x17')]=router; \ No newline at end of file +var _0x5821=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x50445f,_0x1eb575){var _0x3e5096=function(_0x508bc3){while(--_0x508bc3){_0x50445f['push'](_0x50445f['shift']());}};_0x3e5096(++_0x1eb575);}(_0x5821,0x1af));var _0x1582=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5821[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x1582('0x0'));var util=require('util');var path=require(_0x1582('0x1'));var timeout=require(_0x1582('0x2'));var express=require(_0x1582('0x3'));var router=express[_0x1582('0x4')]();var fs_extra=require(_0x1582('0x5'));var auth=require(_0x1582('0x6'));var interaction=require(_0x1582('0x7'));var config=require(_0x1582('0x8'));var controller=require(_0x1582('0x9'));router[_0x1582('0xa')]('/',auth[_0x1582('0xb')](),controller['index']);router['get'](_0x1582('0xc'),auth[_0x1582('0xb')](),controller[_0x1582('0xd')]);router[_0x1582('0xa')](_0x1582('0xe'),auth[_0x1582('0xb')](),controller[_0x1582('0xf')]);router[_0x1582('0xa')](_0x1582('0x10'),auth[_0x1582('0xb')](),controller['show']);router[_0x1582('0x11')]('/',auth[_0x1582('0xb')](),controller[_0x1582('0x12')]);router[_0x1582('0x13')](_0x1582('0x10'),auth['isAuthenticated'](),controller[_0x1582('0x14')]);router['delete'](_0x1582('0x10'),auth[_0x1582('0xb')](),controller[_0x1582('0x15')]);module[_0x1582('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 62c27a0..072feeb 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 _0x914c=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','DATE','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x290df5,_0x2cc0cb){var _0x27c215=function(_0x39645a){while(--_0x39645a){_0x290df5['push'](_0x290df5['shift']());}};_0x27c215(++_0x2cc0cb);}(_0x914c,0x151));var _0xc914=function(_0x5e8c7c,_0x3429c6){_0x5e8c7c=_0x5e8c7c-0x0;var _0x48f7bd=_0x914c[_0x5e8c7c];return _0x48f7bd;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xc914('0x0')]={'type':{'type':Sequelize[_0xc914('0x1')]},'uniqueid':{'type':Sequelize[_0xc914('0x1')]},'calleridnum':{'type':Sequelize[_0xc914('0x1')]},'calleridname':{'type':Sequelize[_0xc914('0x1')]},'queue':{'type':Sequelize[_0xc914('0x1')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1fd40c){var _0x5908fa=moment(_0x1fd40c);var _0x513059=moment(this[_0xc914('0x2')]('queuecallerjoinAt'))[_0xc914('0x3')](_0xc914('0x4'));var _0x32c021=_0x5908fa[_0xc914('0x5')](_0x513059,'seconds');this['setDataValue'](_0xc914('0x6'),_0x1fd40c);this[_0xc914('0x7')](_0xc914('0x8'),_0x32c021||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xc914('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xc914('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xc914('0xb')]},'queuecallercomplete':{'type':Sequelize[_0xc914('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xc914('0xb')]},'queuecallerexitreason':{'type':Sequelize[_0xc914('0x1')],'comment':_0xc914('0xc')},'originalposition':{'type':Sequelize[_0xc914('0x9')]},'channel':{'type':Sequelize[_0xc914('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xc914('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc914('0x1')]},'exten':{'type':Sequelize[_0xc914('0x1')]},'priority':{'type':Sequelize[_0xc914('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc914('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xc914('0x1')]},'transfer':{'type':Sequelize[_0xc914('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc914('0x1')],'comment':_0xc914('0xd')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xc914('0x1')]},'disposition':{'type':Sequelize[_0xc914('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc914('0x1')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0xc914('0x1')]}}; \ No newline at end of file +var _0x81a9=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports'];(function(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0x81a9,0x1a1));var _0x981a=function(_0x19ccc5,_0x42b683){_0x19ccc5=_0x19ccc5-0x0;var _0x584e58=_0x81a9[_0x19ccc5];return _0x584e58;};'use strict';var Sequelize=require(_0x981a('0x0'));var moment=require(_0x981a('0x1'));module[_0x981a('0x2')]={'type':{'type':Sequelize[_0x981a('0x3')]},'uniqueid':{'type':Sequelize[_0x981a('0x3')]},'calleridnum':{'type':Sequelize[_0x981a('0x3')]},'calleridname':{'type':Sequelize[_0x981a('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x981a('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x981a('0x4')],'set':function(_0x238a43){var _0x3b1e60=moment(_0x238a43);var _0x11449e=moment(this['getDataValue']('queuecallerjoinAt'))[_0x981a('0x5')](_0x981a('0x6'));var _0x1bce80=_0x3b1e60['diff'](_0x11449e,_0x981a('0x7'));this[_0x981a('0x8')](_0x981a('0x9'),_0x238a43);this['setDataValue']('holdtime',_0x1bce80||null);}},'position':{'type':Sequelize[_0x981a('0xa')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x981a('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x981a('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x981a('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x981a('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x981a('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x981a('0x3')],'comment':_0x981a('0xc')},'originalposition':{'type':Sequelize[_0x981a('0xa')]},'channel':{'type':Sequelize[_0x981a('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x981a('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x981a('0x3')]},'priority':{'type':Sequelize[_0x981a('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x981a('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x981a('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x981a('0x3')],'comment':_0x981a('0xd')},'transferexten':{'type':Sequelize[_0x981a('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x981a('0x3')]},'thirdDisposition':{'type':Sequelize[_0x981a('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x981a('0xa')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 45f8476..7747c9a 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 _0x9b11=['attributes','fields','length','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','show','params','options','create','catch','update','body','find','describe','hasOwnProperty','rows','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','key','model','keys','query','intersection'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9b11,0x1b5));var _0x19b1=function(_0x5d31f3,_0x4239b0){_0x5d31f3=_0x5d31f3-0x0;var _0x1cc88c=_0x9b11[_0x5d31f3];return _0x1cc88c;};'use strict';var emlformat=require(_0x19b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x19b1('0x1'));var jsonpatch=require(_0x19b1('0x2'));var rp=require(_0x19b1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x19b1('0x4'));var util=require(_0x19b1('0x5'));var path=require(_0x19b1('0x6'));var sox=require(_0x19b1('0x7'));var csv=require(_0x19b1('0x8'));var ejs=require(_0x19b1('0x9'));var fs=require('fs');var fs_extra=require(_0x19b1('0xa'));var _=require(_0x19b1('0xb'));var squel=require(_0x19b1('0xc'));var crypto=require(_0x19b1('0xd'));var jsforce=require(_0x19b1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x19b1('0xf'));var authService=require(_0x19b1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x19b1('0x11'));var hardwareService=require(_0x19b1('0x12'));var logger=require(_0x19b1('0x13'))(_0x19b1('0x14'));var utils=require(_0x19b1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x19b1('0x16'));var db=require('../../mysqldb')['db'];config[_0x19b1('0x17')]=_[_0x19b1('0x18')](config[_0x19b1('0x17')],{'host':_0x19b1('0x19'),'port':0x18eb});var socket=require(_0x19b1('0x1a'))(new Redis(config[_0x19b1('0x17')]));require(_0x19b1('0x1b'))[_0x19b1('0x1c')](socket);function respondWithStatusCode(_0x20ce15,_0x32ea54){_0x32ea54=_0x32ea54||0xcc;return function(_0x4918e2){if(_0x4918e2){return _0x20ce15[_0x19b1('0x1d')](_0x32ea54);}return _0x20ce15[_0x19b1('0x1e')](_0x32ea54)[_0x19b1('0x1f')]();};}function respondWithResult(_0x16eaf4,_0x3b7af8){_0x3b7af8=_0x3b7af8||0xc8;return function(_0x2e28b3){if(_0x2e28b3){return _0x16eaf4[_0x19b1('0x1e')](_0x3b7af8)[_0x19b1('0x20')](_0x2e28b3);}};}function respondWithFilteredResult(_0x152f68,_0x4beb59){return function(_0x580d0f){if(_0x580d0f){var _0x2c9e86=typeof _0x4beb59[_0x19b1('0x21')]==='undefined'&&typeof _0x4beb59[_0x19b1('0x22')]===_0x19b1('0x23');var _0x55ff46=_0x580d0f[_0x19b1('0x24')];var _0x329848=_0x2c9e86?0x0:_0x4beb59[_0x19b1('0x21')];var _0x373b7c=_0x2c9e86?_0x580d0f[_0x19b1('0x24')]:_0x4beb59[_0x19b1('0x21')]+_0x4beb59[_0x19b1('0x22')];var _0x126b12;if(_0x373b7c>=_0x55ff46){_0x373b7c=_0x55ff46;_0x126b12=0xc8;}else{_0x126b12=0xce;}_0x152f68[_0x19b1('0x1e')](_0x126b12);return _0x152f68[_0x19b1('0x25')]('Content-Range',_0x329848+'-'+_0x373b7c+'/'+_0x55ff46)['json'](_0x580d0f);}return null;};}function patchUpdates(_0x374fc1){return function(_0x29a98e){try{jsonpatch['apply'](_0x29a98e,_0x374fc1,!![]);}catch(_0x19bff4){return BPromise[_0x19b1('0x26')](_0x19bff4);}return _0x29a98e[_0x19b1('0x27')]();};}function saveUpdates(_0x38fc1e,_0x59e796){return function(_0x9d65aa){if(_0x9d65aa){return _0x9d65aa['update'](_0x38fc1e)[_0x19b1('0x28')](function(_0x38390a){return _0x38390a;});}return null;};}function removeEntity(_0x22fb0d,_0x3719b1){return function(_0x443a0b){if(_0x443a0b){return _0x443a0b[_0x19b1('0x29')]()[_0x19b1('0x28')](function(){_0x22fb0d[_0x19b1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24662f,_0x52bdfe){return function(_0x37ce18){if(!_0x37ce18){_0x24662f[_0x19b1('0x1d')](0x194);}return _0x37ce18;};}function handleError(_0x4fed7b,_0xe2776e){_0xe2776e=_0xe2776e||0x1f4;return function(_0x29004f){logger[_0x19b1('0x2a')](_0x29004f[_0x19b1('0x2b')]);if(_0x29004f['name']){delete _0x29004f[_0x19b1('0x2c')];}_0x4fed7b[_0x19b1('0x1e')](_0xe2776e)[_0x19b1('0x2d')](_0x29004f);};}exports[_0x19b1('0x2e')]=function(_0x2cc466,_0x1bf92c){var _0x61ebb0={},_0x765343={},_0x2f8cf2={'count':0x0,'rows':[]};var _0x15ad54=_[_0x19b1('0x2f')](db[_0x19b1('0x30')][_0x19b1('0x31')],function(_0x1d13d8){return{'name':_0x1d13d8['fieldName'],'type':_0x1d13d8['type'][_0x19b1('0x32')]};});_0x765343[_0x19b1('0x33')]=_[_0x19b1('0x2f')](_0x15ad54,'name');_0x765343['query']=_[_0x19b1('0x34')](_0x2cc466[_0x19b1('0x35')]);_0x765343['filters']=_[_0x19b1('0x36')](_0x765343['model'],_0x765343[_0x19b1('0x35')]);_0x61ebb0[_0x19b1('0x37')]=_[_0x19b1('0x36')](_0x765343[_0x19b1('0x33')],qs[_0x19b1('0x38')](_0x2cc466[_0x19b1('0x35')][_0x19b1('0x38')]));_0x61ebb0[_0x19b1('0x37')]=_0x61ebb0['attributes'][_0x19b1('0x39')]?_0x61ebb0['attributes']:_0x765343['model'];if(!_0x2cc466['query']['hasOwnProperty'](_0x19b1('0x3a'))){_0x61ebb0[_0x19b1('0x22')]=qs[_0x19b1('0x22')](_0x2cc466[_0x19b1('0x35')][_0x19b1('0x22')]);_0x61ebb0['offset']=qs[_0x19b1('0x21')](_0x2cc466[_0x19b1('0x35')][_0x19b1('0x21')]);}_0x61ebb0[_0x19b1('0x3b')]=qs[_0x19b1('0x3c')](_0x2cc466[_0x19b1('0x35')][_0x19b1('0x3c')]);_0x61ebb0['where']=qs[_0x19b1('0x3d')](_[_0x19b1('0x3e')](_0x2cc466[_0x19b1('0x35')],_0x765343[_0x19b1('0x3d')]),_0x15ad54);if(_0x2cc466[_0x19b1('0x35')][_0x19b1('0x3f')]){_0x61ebb0['where']=_[_0x19b1('0x40')](_0x61ebb0[_0x19b1('0x41')],{'$or':_[_0x19b1('0x2f')](_0x15ad54,function(_0x331278){if(_0x331278['type']!==_0x19b1('0x42')){var _0x2066fb={};_0x2066fb[_0x331278[_0x19b1('0x2c')]]={'$like':'%'+_0x2cc466[_0x19b1('0x35')][_0x19b1('0x3f')]+'%'};return _0x2066fb;}})});}_0x61ebb0=_['merge']({},_0x61ebb0,_0x2cc466['options']);var _0x2bac36={'where':_0x61ebb0[_0x19b1('0x41')]};return db['VoiceQueueReport']['count'](_0x2bac36)['then'](function(_0x4e41e3){_0x2f8cf2['count']=_0x4e41e3;if(_0x2cc466[_0x19b1('0x35')][_0x19b1('0x43')]){_0x61ebb0[_0x19b1('0x44')]=[{'all':!![]}];}return db[_0x19b1('0x30')][_0x19b1('0x45')](_0x61ebb0);})['then'](function(_0x343dce){_0x2f8cf2['rows']=_0x343dce;return _0x2f8cf2;})[_0x19b1('0x28')](respondWithFilteredResult(_0x1bf92c,_0x61ebb0))['catch'](handleError(_0x1bf92c,null));};exports[_0x19b1('0x46')]=function(_0x128037,_0x4d11d6){var _0x1c7a5f={'raw':![],'where':{'id':_0x128037[_0x19b1('0x47')]['id']}},_0x59c389={};_0x59c389[_0x19b1('0x33')]=_['keys'](db['VoiceQueueReport'][_0x19b1('0x31')]);_0x59c389[_0x19b1('0x35')]=_[_0x19b1('0x34')](_0x128037[_0x19b1('0x35')]);_0x59c389[_0x19b1('0x3d')]=_[_0x19b1('0x36')](_0x59c389[_0x19b1('0x33')],_0x59c389[_0x19b1('0x35')]);_0x1c7a5f[_0x19b1('0x37')]=_['intersection'](_0x59c389[_0x19b1('0x33')],qs[_0x19b1('0x38')](_0x128037[_0x19b1('0x35')][_0x19b1('0x38')]));_0x1c7a5f[_0x19b1('0x37')]=_0x1c7a5f[_0x19b1('0x37')][_0x19b1('0x39')]?_0x1c7a5f['attributes']:_0x59c389[_0x19b1('0x33')];if(_0x128037['query'][_0x19b1('0x43')]){_0x1c7a5f[_0x19b1('0x44')]=[{'all':!![]}];}_0x1c7a5f=_[_0x19b1('0x40')]({},_0x1c7a5f,_0x128037[_0x19b1('0x48')]);return db[_0x19b1('0x30')]['find'](_0x1c7a5f)['then'](handleEntityNotFound(_0x4d11d6,null))[_0x19b1('0x28')](respondWithResult(_0x4d11d6,null))['catch'](handleError(_0x4d11d6,null));};exports[_0x19b1('0x49')]=function(_0x1cc1dd,_0x288d95){return db['VoiceQueueReport'][_0x19b1('0x49')](_0x1cc1dd['body'],{})['then'](respondWithResult(_0x288d95,0xc9))[_0x19b1('0x4a')](handleError(_0x288d95,null));};exports[_0x19b1('0x4b')]=function(_0x1e8a4e,_0x399108){if(_0x1e8a4e[_0x19b1('0x4c')]['id']){delete _0x1e8a4e[_0x19b1('0x4c')]['id'];}return db[_0x19b1('0x30')][_0x19b1('0x4d')]({'where':{'id':_0x1e8a4e[_0x19b1('0x47')]['id']}})[_0x19b1('0x28')](handleEntityNotFound(_0x399108,null))[_0x19b1('0x28')](saveUpdates(_0x1e8a4e['body'],null))[_0x19b1('0x28')](respondWithResult(_0x399108,null))[_0x19b1('0x4a')](handleError(_0x399108,null));};exports[_0x19b1('0x29')]=function(_0x1dc47d,_0x2ec8bf){return db[_0x19b1('0x30')]['find']({'where':{'id':_0x1dc47d['params']['id']}})['then'](handleEntityNotFound(_0x2ec8bf,null))[_0x19b1('0x28')](removeEntity(_0x2ec8bf,null))[_0x19b1('0x4a')](handleError(_0x2ec8bf,null));};exports[_0x19b1('0x4e')]=function(_0x211493,_0x21bb83){return db[_0x19b1('0x30')][_0x19b1('0x4e')]()[_0x19b1('0x28')](respondWithResult(_0x21bb83,null))[_0x19b1('0x4a')](handleError(_0x21bb83,null));};exports['getVoiceQueuesReport']=function(_0x26e8ce,_0x203409){var _0x4b934c={},_0x481c1a={},_0x3fa164={'count':0x0,'rows':[]};_0x481c1a[_0x19b1('0x33')]=_[_0x19b1('0x34')](db[_0x19b1('0x30')][_0x19b1('0x31')]);_0x481c1a['query']=_[_0x19b1('0x34')](_0x26e8ce[_0x19b1('0x35')]);_0x481c1a[_0x19b1('0x3d')]=_[_0x19b1('0x36')](_0x481c1a[_0x19b1('0x33')],_0x481c1a[_0x19b1('0x35')]);_0x4b934c[_0x19b1('0x37')]=_[_0x19b1('0x36')](_0x481c1a[_0x19b1('0x33')],qs[_0x19b1('0x38')](_0x26e8ce[_0x19b1('0x35')][_0x19b1('0x38')]));_0x4b934c[_0x19b1('0x37')]=_0x4b934c[_0x19b1('0x37')][_0x19b1('0x39')]?_0x4b934c[_0x19b1('0x37')]:_0x481c1a[_0x19b1('0x33')];if(!_0x26e8ce['query'][_0x19b1('0x4f')](_0x19b1('0x3a'))){_0x4b934c[_0x19b1('0x22')]=qs[_0x19b1('0x22')](_0x26e8ce[_0x19b1('0x35')][_0x19b1('0x22')]);_0x4b934c[_0x19b1('0x21')]=qs[_0x19b1('0x21')](_0x26e8ce[_0x19b1('0x35')][_0x19b1('0x21')]);}_0x4b934c[_0x19b1('0x3b')]=qs[_0x19b1('0x3c')](_0x26e8ce[_0x19b1('0x35')]['sort']);_0x4b934c[_0x19b1('0x41')]=qs['filters'](_['pick'](_0x26e8ce['query'],_0x481c1a[_0x19b1('0x3d')]));if(_0x26e8ce['query']['filter']){_0x4b934c['where']=_[_0x19b1('0x40')](_0x4b934c[_0x19b1('0x41')],{'$or':_['map'](_0x4b934c['attributes'],function(_0x135a86){var _0x50049c={};_0x50049c[_0x135a86]={'$like':'%'+_0x26e8ce[_0x19b1('0x35')][_0x19b1('0x3f')]+'%'};return _0x50049c;})});}_0x4b934c=_[_0x19b1('0x40')]({},_0x4b934c,_0x26e8ce[_0x19b1('0x48')]);var _0x440af6={'where':_0x4b934c['where']};return db[_0x19b1('0x30')][_0x19b1('0x24')](_0x440af6)[_0x19b1('0x28')](function(_0x56212e){_0x3fa164[_0x19b1('0x24')]=_0x56212e;if(_0x26e8ce[_0x19b1('0x35')][_0x19b1('0x43')]){_0x4b934c['include']=[{'all':!![]}];}return db[_0x19b1('0x30')]['findAll'](_0x4b934c);})['then'](function(_0x541930){_0x3fa164[_0x19b1('0x50')]=_0x541930;return _0x3fa164;})[_0x19b1('0x28')](respondWithFilteredResult(_0x203409,_0x4b934c,_0x19b1('0x51')))[_0x19b1('0x4a')](handleError(_0x203409,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0xdeba=['params','rawAttributes','find','create','body','update','catch','describe','getVoiceQueuesReport','order','rows','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','sendStatus','error','stack','name','index','map','VoiceQueueReport','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show'];(function(_0x295342,_0x56a8ce){var _0x21d2af=function(_0x29bd8a){while(--_0x29bd8a){_0x295342['push'](_0x295342['shift']());}};_0x21d2af(++_0x56a8ce);}(_0xdeba,0x107));var _0xadeb=function(_0xf2eb59,_0x491f9b){_0xf2eb59=_0xf2eb59-0x0;var _0x2b1f10=_0xdeba[_0xf2eb59];return _0x2b1f10;};'use strict';var emlformat=require(_0xadeb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xadeb('0x1'));var jsonpatch=require(_0xadeb('0x2'));var rp=require(_0xadeb('0x3'));var moment=require(_0xadeb('0x4'));var BPromise=require(_0xadeb('0x5'));var Mustache=require(_0xadeb('0x6'));var util=require(_0xadeb('0x7'));var path=require(_0xadeb('0x8'));var sox=require('sox');var csv=require(_0xadeb('0x9'));var ejs=require(_0xadeb('0xa'));var fs=require('fs');var fs_extra=require(_0xadeb('0xb'));var _=require('lodash');var squel=require(_0xadeb('0xc'));var crypto=require(_0xadeb('0xd'));var jsforce=require(_0xadeb('0xe'));var deskjs=require(_0xadeb('0xf'));var toCsv=require(_0xadeb('0x9'));var querystring=require(_0xadeb('0x10'));var Papa=require(_0xadeb('0x11'));var Redis=require(_0xadeb('0x12'));var authService=require(_0xadeb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xadeb('0x14'));var hardwareService=require(_0xadeb('0x15'));var logger=require(_0xadeb('0x16'))(_0xadeb('0x17'));var utils=require(_0xadeb('0x18'));var config=require(_0xadeb('0x19'));var licenseUtil=require(_0xadeb('0x1a'));var db=require(_0xadeb('0x1b'))['db'];config['redis']=_[_0xadeb('0x1c')](config[_0xadeb('0x1d')],{'host':_0xadeb('0x1e'),'port':0x18eb});var socket=require(_0xadeb('0x1f'))(new Redis(config['redis']));require(_0xadeb('0x20'))[_0xadeb('0x21')](socket);function respondWithStatusCode(_0x56ffda,_0x447390){_0x447390=_0x447390||0xcc;return function(_0x32b412){if(_0x32b412){return _0x56ffda['sendStatus'](_0x447390);}return _0x56ffda['status'](_0x447390)[_0xadeb('0x22')]();};}function respondWithResult(_0x5775ff,_0x169a89){_0x169a89=_0x169a89||0xc8;return function(_0x2ef927){if(_0x2ef927){return _0x5775ff[_0xadeb('0x23')](_0x169a89)[_0xadeb('0x24')](_0x2ef927);}};}function respondWithFilteredResult(_0x56ae50,_0x301a90){return function(_0x528fd3){if(_0x528fd3){var _0x5bfc26=typeof _0x301a90[_0xadeb('0x25')]===_0xadeb('0x26')&&typeof _0x301a90[_0xadeb('0x27')]===_0xadeb('0x26');var _0x14a443=_0x528fd3[_0xadeb('0x28')];var _0x27f04e=_0x5bfc26?0x0:_0x301a90[_0xadeb('0x25')];var _0xe1c0dc=_0x5bfc26?_0x528fd3[_0xadeb('0x28')]:_0x301a90[_0xadeb('0x25')]+_0x301a90['limit'];var _0x5dbfc5;if(_0xe1c0dc>=_0x14a443){_0xe1c0dc=_0x14a443;_0x5dbfc5=0xc8;}else{_0x5dbfc5=0xce;}_0x56ae50['status'](_0x5dbfc5);return _0x56ae50[_0xadeb('0x29')](_0xadeb('0x2a'),_0x27f04e+'-'+_0xe1c0dc+'/'+_0x14a443)[_0xadeb('0x24')](_0x528fd3);}return null;};}function patchUpdates(_0xbfdb29){return function(_0x3772a2){try{jsonpatch['apply'](_0x3772a2,_0xbfdb29,!![]);}catch(_0x3bb214){return BPromise['reject'](_0x3bb214);}return _0x3772a2['save']();};}function saveUpdates(_0xe5ee22,_0x38750b){return function(_0x466744){if(_0x466744){return _0x466744['update'](_0xe5ee22)[_0xadeb('0x2b')](function(_0x246b8b){return _0x246b8b;});}return null;};}function removeEntity(_0x2c9a28,_0x262831){return function(_0x35ea47){if(_0x35ea47){return _0x35ea47[_0xadeb('0x2c')]()[_0xadeb('0x2b')](function(){_0x2c9a28[_0xadeb('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d1f70,_0x20a33f){return function(_0xfcecc3){if(!_0xfcecc3){_0x2d1f70[_0xadeb('0x2d')](0x194);}return _0xfcecc3;};}function handleError(_0x5d3f15,_0x2e71d0){_0x2e71d0=_0x2e71d0||0x1f4;return function(_0x4b2086){logger[_0xadeb('0x2e')](_0x4b2086[_0xadeb('0x2f')]);if(_0x4b2086[_0xadeb('0x30')]){delete _0x4b2086[_0xadeb('0x30')];}_0x5d3f15['status'](_0x2e71d0)['send'](_0x4b2086);};}exports[_0xadeb('0x31')]=function(_0xf26501,_0x19132b){var _0x1ddb3d={},_0x314c7a={},_0x30e93b={'count':0x0,'rows':[]};var _0x44db18=_[_0xadeb('0x32')](db[_0xadeb('0x33')]['rawAttributes'],function(_0x43ebc){return{'name':_0x43ebc['fieldName'],'type':_0x43ebc['type'][_0xadeb('0x34')]};});_0x314c7a[_0xadeb('0x35')]=_['map'](_0x44db18,'name');_0x314c7a[_0xadeb('0x36')]=_[_0xadeb('0x37')](_0xf26501[_0xadeb('0x36')]);_0x314c7a['filters']=_[_0xadeb('0x38')](_0x314c7a[_0xadeb('0x35')],_0x314c7a[_0xadeb('0x36')]);_0x1ddb3d[_0xadeb('0x39')]=_[_0xadeb('0x38')](_0x314c7a[_0xadeb('0x35')],qs[_0xadeb('0x3a')](_0xf26501['query']['fields']));_0x1ddb3d[_0xadeb('0x39')]=_0x1ddb3d[_0xadeb('0x39')][_0xadeb('0x3b')]?_0x1ddb3d['attributes']:_0x314c7a[_0xadeb('0x35')];if(!_0xf26501[_0xadeb('0x36')][_0xadeb('0x3c')]('nolimit')){_0x1ddb3d[_0xadeb('0x27')]=qs[_0xadeb('0x27')](_0xf26501[_0xadeb('0x36')]['limit']);_0x1ddb3d[_0xadeb('0x25')]=qs['offset'](_0xf26501[_0xadeb('0x36')][_0xadeb('0x25')]);}_0x1ddb3d['order']=qs[_0xadeb('0x3d')](_0xf26501[_0xadeb('0x36')]['sort']);_0x1ddb3d['where']=qs[_0xadeb('0x3e')](_[_0xadeb('0x3f')](_0xf26501['query'],_0x314c7a[_0xadeb('0x3e')]),_0x44db18);if(_0xf26501['query'][_0xadeb('0x40')]){_0x1ddb3d[_0xadeb('0x41')]=_[_0xadeb('0x42')](_0x1ddb3d['where'],{'$or':_[_0xadeb('0x32')](_0x44db18,function(_0x2c685f){if(_0x2c685f['type']!==_0xadeb('0x43')){var _0x56e204={};_0x56e204[_0x2c685f[_0xadeb('0x30')]]={'$like':'%'+_0xf26501['query'][_0xadeb('0x40')]+'%'};return _0x56e204;}})});}_0x1ddb3d=_[_0xadeb('0x42')]({},_0x1ddb3d,_0xf26501[_0xadeb('0x44')]);var _0x135992={'where':_0x1ddb3d[_0xadeb('0x41')]};return db['VoiceQueueReport'][_0xadeb('0x28')](_0x135992)[_0xadeb('0x2b')](function(_0x375fca){_0x30e93b[_0xadeb('0x28')]=_0x375fca;if(_0xf26501[_0xadeb('0x36')][_0xadeb('0x45')]){_0x1ddb3d[_0xadeb('0x46')]=[{'all':!![]}];}return db[_0xadeb('0x33')][_0xadeb('0x47')](_0x1ddb3d);})[_0xadeb('0x2b')](function(_0x2af962){_0x30e93b['rows']=_0x2af962;return _0x30e93b;})[_0xadeb('0x2b')](respondWithFilteredResult(_0x19132b,_0x1ddb3d))['catch'](handleError(_0x19132b,null));};exports[_0xadeb('0x48')]=function(_0x5ba164,_0x3d60b9){var _0x4e5558={'raw':![],'where':{'id':_0x5ba164[_0xadeb('0x49')]['id']}},_0x49176d={};_0x49176d[_0xadeb('0x35')]=_[_0xadeb('0x37')](db[_0xadeb('0x33')][_0xadeb('0x4a')]);_0x49176d[_0xadeb('0x36')]=_[_0xadeb('0x37')](_0x5ba164[_0xadeb('0x36')]);_0x49176d['filters']=_['intersection'](_0x49176d[_0xadeb('0x35')],_0x49176d['query']);_0x4e5558[_0xadeb('0x39')]=_[_0xadeb('0x38')](_0x49176d[_0xadeb('0x35')],qs[_0xadeb('0x3a')](_0x5ba164['query']['fields']));_0x4e5558[_0xadeb('0x39')]=_0x4e5558[_0xadeb('0x39')]['length']?_0x4e5558['attributes']:_0x49176d[_0xadeb('0x35')];if(_0x5ba164[_0xadeb('0x36')][_0xadeb('0x45')]){_0x4e5558['include']=[{'all':!![]}];}_0x4e5558=_[_0xadeb('0x42')]({},_0x4e5558,_0x5ba164['options']);return db[_0xadeb('0x33')][_0xadeb('0x4b')](_0x4e5558)[_0xadeb('0x2b')](handleEntityNotFound(_0x3d60b9,null))[_0xadeb('0x2b')](respondWithResult(_0x3d60b9,null))['catch'](handleError(_0x3d60b9,null));};exports[_0xadeb('0x4c')]=function(_0x262b4c,_0x18e41d){return db['VoiceQueueReport'][_0xadeb('0x4c')](_0x262b4c[_0xadeb('0x4d')],{})[_0xadeb('0x2b')](respondWithResult(_0x18e41d,0xc9))['catch'](handleError(_0x18e41d,null));};exports[_0xadeb('0x4e')]=function(_0x42e162,_0x3bc1e6){if(_0x42e162[_0xadeb('0x4d')]['id']){delete _0x42e162[_0xadeb('0x4d')]['id'];}return db[_0xadeb('0x33')][_0xadeb('0x4b')]({'where':{'id':_0x42e162[_0xadeb('0x49')]['id']}})['then'](handleEntityNotFound(_0x3bc1e6,null))[_0xadeb('0x2b')](saveUpdates(_0x42e162[_0xadeb('0x4d')],null))['then'](respondWithResult(_0x3bc1e6,null))[_0xadeb('0x4f')](handleError(_0x3bc1e6,null));};exports[_0xadeb('0x2c')]=function(_0x3b6e02,_0x16faaf){return db[_0xadeb('0x33')][_0xadeb('0x4b')]({'where':{'id':_0x3b6e02[_0xadeb('0x49')]['id']}})[_0xadeb('0x2b')](handleEntityNotFound(_0x16faaf,null))[_0xadeb('0x2b')](removeEntity(_0x16faaf,null))[_0xadeb('0x4f')](handleError(_0x16faaf,null));};exports[_0xadeb('0x50')]=function(_0x3050f1,_0x8c2696){return db[_0xadeb('0x33')][_0xadeb('0x50')]()[_0xadeb('0x2b')](respondWithResult(_0x8c2696,null))['catch'](handleError(_0x8c2696,null));};exports[_0xadeb('0x51')]=function(_0x379988,_0x52498a){var _0x565e1e={},_0x4be21b={},_0x1171ff={'count':0x0,'rows':[]};_0x4be21b[_0xadeb('0x35')]=_['keys'](db[_0xadeb('0x33')][_0xadeb('0x4a')]);_0x4be21b[_0xadeb('0x36')]=_[_0xadeb('0x37')](_0x379988[_0xadeb('0x36')]);_0x4be21b['filters']=_[_0xadeb('0x38')](_0x4be21b[_0xadeb('0x35')],_0x4be21b['query']);_0x565e1e['attributes']=_[_0xadeb('0x38')](_0x4be21b[_0xadeb('0x35')],qs[_0xadeb('0x3a')](_0x379988[_0xadeb('0x36')][_0xadeb('0x3a')]));_0x565e1e[_0xadeb('0x39')]=_0x565e1e[_0xadeb('0x39')][_0xadeb('0x3b')]?_0x565e1e[_0xadeb('0x39')]:_0x4be21b['model'];if(!_0x379988[_0xadeb('0x36')][_0xadeb('0x3c')]('nolimit')){_0x565e1e[_0xadeb('0x27')]=qs['limit'](_0x379988[_0xadeb('0x36')][_0xadeb('0x27')]);_0x565e1e['offset']=qs[_0xadeb('0x25')](_0x379988['query'][_0xadeb('0x25')]);}_0x565e1e[_0xadeb('0x52')]=qs[_0xadeb('0x3d')](_0x379988[_0xadeb('0x36')][_0xadeb('0x3d')]);_0x565e1e[_0xadeb('0x41')]=qs['filters'](_[_0xadeb('0x3f')](_0x379988[_0xadeb('0x36')],_0x4be21b[_0xadeb('0x3e')]));if(_0x379988[_0xadeb('0x36')][_0xadeb('0x40')]){_0x565e1e[_0xadeb('0x41')]=_[_0xadeb('0x42')](_0x565e1e['where'],{'$or':_[_0xadeb('0x32')](_0x565e1e['attributes'],function(_0xbf59ca){var _0x2702d3={};_0x2702d3[_0xbf59ca]={'$like':'%'+_0x379988['query'][_0xadeb('0x40')]+'%'};return _0x2702d3;})});}_0x565e1e=_['merge']({},_0x565e1e,_0x379988[_0xadeb('0x44')]);var _0x9524f3={'where':_0x565e1e[_0xadeb('0x41')]};return db['VoiceQueueReport'][_0xadeb('0x28')](_0x9524f3)[_0xadeb('0x2b')](function(_0x183375){_0x1171ff[_0xadeb('0x28')]=_0x183375;if(_0x379988['query']['includeAll']){_0x565e1e['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xadeb('0x47')](_0x565e1e);})[_0xadeb('0x2b')](function(_0xa66e12){_0x1171ff[_0xadeb('0x53')]=_0xa66e12;return _0x1171ff;})[_0xadeb('0x2b')](respondWithFilteredResult(_0x52498a,_0x565e1e,_0xadeb('0x51')))[_0xadeb('0x4f')](handleError(_0x52498a,null,_0xadeb('0x51')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 5e15e62..af9afba 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 _0xae95=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','emit','hook','exports','events'];(function(_0xa4f075,_0x1c15db){var _0x42b259=function(_0x3c8d6f){while(--_0x3c8d6f){_0xa4f075['push'](_0xa4f075['shift']());}};_0x42b259(++_0x1c15db);}(_0xae95,0x8f));var _0x5ae9=function(_0x2ff298,_0x3532b5){_0x2ff298=_0x2ff298-0x0;var _0xd99565=_0xae95[_0x2ff298];return _0xd99565;};'use strict';var EventEmitter=require(_0x5ae9('0x0'));var VoiceQueueReport=require(_0x5ae9('0x1'))['db'][_0x5ae9('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5ae9('0x3')](0x0);var events={'afterCreate':_0x5ae9('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2a6003){return function(_0x213bb8,_0x12daa2,_0xf8c75c){VoiceQueueReportEvents['emit'](_0x2a6003+':'+_0x213bb8['id'],_0x213bb8);VoiceQueueReportEvents[_0x5ae9('0x5')](_0x2a6003,_0x213bb8);_0xf8c75c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x5ae9('0x6')](e,emitEvent(event));}}module[_0x5ae9('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xf46c=['exports','events','../../mysqldb','save','update','emit'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf46c,0xe5));var _0xcf46=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf46c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xcf46('0x0'));var VoiceQueueReport=require(_0xcf46('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcf46('0x2'),'afterUpdate':_0xcf46('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5da762){return function(_0x57c451,_0x4a740a,_0x3700ca){VoiceQueueReportEvents[_0xcf46('0x4')](_0x5da762+':'+_0x57c451['id'],_0x57c451);VoiceQueueReportEvents[_0xcf46('0x4')](_0x5da762,_0x57c451);_0x3700ca(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xcf46('0x5')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index f1c020a..b3194e4 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 _0x7edb=['exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','api','moment','bluebird','path','./voiceQueueReport.attributes'];(function(_0x2b15b5,_0x5ded20){var _0x50a223=function(_0x47cd96){while(--_0x47cd96){_0x2b15b5['push'](_0x2b15b5['shift']());}};_0x50a223(++_0x5ded20);}(_0x7edb,0x158));var _0xb7ed=function(_0x1a424d,_0x25282f){_0x1a424d=_0x1a424d-0x0;var _0x13bde7=_0x7edb[_0x1a424d];return _0x13bde7;};'use strict';var _=require('lodash');var util=require(_0xb7ed('0x0'));var logger=require(_0xb7ed('0x1'))(_0xb7ed('0x2'));var moment=require(_0xb7ed('0x3'));var BPromise=require(_0xb7ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7ed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb7ed('0x6'));module[_0xb7ed('0x7')]=function(_0x2aa67d,_0x246cfa){return _0x2aa67d[_0xb7ed('0x8')](_0xb7ed('0x9'),attributes,{'tableName':_0xb7ed('0xa'),'paranoid':![],'indexes':[{'fields':[_0xb7ed('0xb')]},{'fields':[_0xb7ed('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cec=['calleridnum','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes','VoiceQueueReport','report_queue'];(function(_0x340fc7,_0x12a901){var _0x586c93=function(_0xc3a679){while(--_0xc3a679){_0x340fc7['push'](_0x340fc7['shift']());}};_0x586c93(++_0x12a901);}(_0x1cec,0x12a));var _0xc1ce=function(_0x35e0e7,_0x5d159f){_0x35e0e7=_0x35e0e7-0x0;var _0x4e1ccd=_0x1cec[_0x35e0e7];return _0x4e1ccd;};'use strict';var _=require(_0xc1ce('0x0'));var util=require('util');var logger=require(_0xc1ce('0x1'))('api');var moment=require(_0xc1ce('0x2'));var BPromise=require(_0xc1ce('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1ce('0x4'));var rimraf=require(_0xc1ce('0x5'));var config=require(_0xc1ce('0x6'));var attributes=require(_0xc1ce('0x7'));module['exports']=function(_0x2f671c,_0x4a7b2a){return _0x2f671c['define'](_0xc1ce('0x8'),attributes,{'tableName':_0xc1ce('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xc1ce('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 69199db..1abde81 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 _0xa358=['then','debug','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','request','info','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa358,0xdd));var _0x8a35=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa358[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8a35('0x0'));var util=require(_0x8a35('0x1'));var moment=require(_0x8a35('0x2'));var BPromise=require(_0x8a35('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a35('0x4'));var db=require(_0x8a35('0x5'))['db'];var utils=require(_0x8a35('0x6'));var logger=require(_0x8a35('0x7'))('rpc');var config=require(_0x8a35('0x8'));var jayson=require(_0x8a35('0x9'));var client=jayson['client'][_0x8a35('0xa')]({'port':0x232a});config[_0x8a35('0xb')]=_[_0x8a35('0xc')](config[_0x8a35('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8a35('0xd'))(new Redis(config[_0x8a35('0xb')]));require(_0x8a35('0xe'))['register'](socket);function respondWithRpcPromise(_0x18095f,_0x344f62,_0x5dba9b){return new BPromise(function(_0x699e7f,_0x4e1019){return client[_0x8a35('0xf')](_0x18095f,_0x5dba9b)['then'](function(_0x1d5bbd){logger[_0x8a35('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x344f62,_0x8a35('0x11'));logger['debug'](_0x8a35('0x12'),_0x344f62,_0x8a35('0x11'),JSON[_0x8a35('0x13')](_0x1d5bbd));if(_0x1d5bbd[_0x8a35('0x14')]){if(_0x1d5bbd[_0x8a35('0x14')][_0x8a35('0x15')]===0x1f4){logger[_0x8a35('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x344f62,_0x1d5bbd[_0x8a35('0x14')][_0x8a35('0x16')]);return _0x4e1019(_0x1d5bbd[_0x8a35('0x14')]['message']);}logger['error'](_0x8a35('0x17'),_0x344f62,_0x1d5bbd['error'][_0x8a35('0x16')]);return _0x699e7f(_0x1d5bbd[_0x8a35('0x14')][_0x8a35('0x16')]);}else{logger['info'](_0x8a35('0x17'),_0x344f62,'request\x20sent');_0x699e7f(_0x1d5bbd[_0x8a35('0x18')][_0x8a35('0x16')]);}})[_0x8a35('0x19')](function(_0x9e5400){logger[_0x8a35('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x344f62,_0x9e5400);_0x4e1019(_0x9e5400);});});}exports[_0x8a35('0x1a')]=function(_0x10d205){var _0x41a35d=this;return new Promise(function(_0x270de0,_0x14d007){return db[_0x8a35('0x1b')][_0x8a35('0x1c')]({'raw':_0x10d205[_0x8a35('0x1d')]?_0x10d205[_0x8a35('0x1d')][_0x8a35('0x1e')]===undefined?!![]:![]:!![],'where':_0x10d205['options']?_0x10d205['options'][_0x8a35('0x1f')]||null:null,'attributes':_0x10d205[_0x8a35('0x1d')]?_0x10d205['options'][_0x8a35('0x20')]||null:null,'limit':_0x10d205[_0x8a35('0x1d')]?_0x10d205['options'][_0x8a35('0x21')]||null:null,'include':_0x10d205['options']?_0x10d205[_0x8a35('0x1d')]['include']?_['map'](_0x10d205[_0x8a35('0x1d')][_0x8a35('0x22')],function(_0x19b46c){return{'model':db[_0x19b46c[_0x8a35('0x23')]],'as':_0x19b46c['as'],'attributes':_0x19b46c[_0x8a35('0x20')],'include':_0x19b46c[_0x8a35('0x22')]?_[_0x8a35('0x24')](_0x19b46c['include'],function(_0x37e4e3){return{'model':db[_0x37e4e3[_0x8a35('0x23')]],'as':_0x37e4e3['as'],'attributes':_0x37e4e3['attributes'],'include':_0x37e4e3[_0x8a35('0x22')]?_['map'](_0x37e4e3[_0x8a35('0x22')],function(_0x4321fb){return{'model':db[_0x4321fb[_0x8a35('0x23')]],'as':_0x4321fb['as'],'attributes':_0x4321fb[_0x8a35('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8a35('0x25')](function(_0x287193){logger[_0x8a35('0x10')]('GetVoiceQueueReport',_0x10d205);logger[_0x8a35('0x26')]('GetVoiceQueueReport',_0x10d205,JSON[_0x8a35('0x13')](_0x287193));_0x270de0(_0x287193);})['catch'](function(_0x1e7273){logger['error'](_0x8a35('0x1a'),_0x1e7273['message'],_0x10d205);_0x14d007(_0x41a35d[_0x8a35('0x14')](0x1f4,_0x1e7273[_0x8a35('0x16')]));});});};exports[_0x8a35('0x27')]=function(_0x39c049){var _0x3da02f=this;return new Promise(function(_0x2f2e66,_0x174c0e){return db['VoiceQueueReport'][_0x8a35('0x28')](_0x39c049[_0x8a35('0x29')],{'raw':_0x39c049[_0x8a35('0x1d')]?_0x39c049[_0x8a35('0x1d')][_0x8a35('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x52319c){logger[_0x8a35('0x10')](_0x8a35('0x27'),_0x39c049);logger['debug']('CreateVoiceQueueReport',_0x39c049,JSON[_0x8a35('0x13')](_0x52319c));_0x2f2e66(_0x52319c);})[_0x8a35('0x19')](function(_0x5eac09){logger[_0x8a35('0x14')](_0x8a35('0x27'),_0x5eac09[_0x8a35('0x16')],_0x39c049);_0x174c0e(_0x3da02f['error'](0x1f4,_0x5eac09['message']));});});};exports[_0x8a35('0x2a')]=function(_0xeb2f7f){var _0x1924c9=this;return new Promise(function(_0x53688c,_0x5b7489){return db[_0x8a35('0x1b')]['update'](_0xeb2f7f[_0x8a35('0x29')],{'raw':_0xeb2f7f[_0x8a35('0x1d')]?_0xeb2f7f[_0x8a35('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeb2f7f[_0x8a35('0x1d')]?_0xeb2f7f['options'][_0x8a35('0x1f')]||null:null,'attributes':_0xeb2f7f[_0x8a35('0x1d')]?_0xeb2f7f[_0x8a35('0x1d')][_0x8a35('0x20')]||null:null,'limit':_0xeb2f7f[_0x8a35('0x1d')]?_0xeb2f7f[_0x8a35('0x1d')][_0x8a35('0x21')]||null:null})[_0x8a35('0x25')](function(_0x495099){logger[_0x8a35('0x10')]('UpdateVoiceQueueReport',_0xeb2f7f);logger[_0x8a35('0x26')](_0x8a35('0x2a'),_0xeb2f7f,JSON[_0x8a35('0x13')](_0x495099));_0x53688c(_0x495099);})[_0x8a35('0x19')](function(_0x534b4a){logger[_0x8a35('0x14')](_0x8a35('0x2a'),_0x534b4a[_0x8a35('0x16')],_0xeb2f7f);_0x5b7489(_0x1924c9['error'](0x1f4,_0x534b4a[_0x8a35('0x16')]));});});}; \ No newline at end of file +var _0x8638=['http','redis','defaults','register','request','then','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','include','model','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update','where','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x337466,_0x5ed75e){var _0x3a4f30=function(_0xa739f0){while(--_0xa739f0){_0x337466['push'](_0x337466['shift']());}};_0x3a4f30(++_0x5ed75e);}(_0x8638,0x17e));var _0x8863=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x8638[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x8863('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8863('0x1'));var rs=require(_0x8863('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8863('0x3'));var logger=require(_0x8863('0x4'))(_0x8863('0x5'));var config=require(_0x8863('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8863('0x7')][_0x8863('0x8')]({'port':0x232a});config[_0x8863('0x9')]=_[_0x8863('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8863('0x9')]));require('./voiceQueueReport.socket')[_0x8863('0xb')](socket);function respondWithRpcPromise(_0xdd234f,_0x16f158,_0x59d003){return new BPromise(function(_0x58c5d9,_0x59fed7){return client[_0x8863('0xc')](_0xdd234f,_0x59d003)[_0x8863('0xd')](function(_0x1a9dd6){logger['info'](_0x8863('0xe'),_0x16f158,'request\x20sent');logger[_0x8863('0xf')](_0x8863('0x10'),_0x16f158,_0x8863('0x11'),JSON[_0x8863('0x12')](_0x1a9dd6));if(_0x1a9dd6['error']){if(_0x1a9dd6['error'][_0x8863('0x13')]===0x1f4){logger['error'](_0x8863('0xe'),_0x16f158,_0x1a9dd6[_0x8863('0x14')][_0x8863('0x15')]);return _0x59fed7(_0x1a9dd6[_0x8863('0x14')][_0x8863('0x15')]);}logger[_0x8863('0x14')](_0x8863('0xe'),_0x16f158,_0x1a9dd6['error'][_0x8863('0x15')]);return _0x58c5d9(_0x1a9dd6['error'][_0x8863('0x15')]);}else{logger[_0x8863('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x16f158,_0x8863('0x11'));_0x58c5d9(_0x1a9dd6[_0x8863('0x17')][_0x8863('0x15')]);}})[_0x8863('0x18')](function(_0x14bc3a){logger['error'](_0x8863('0xe'),_0x16f158,_0x14bc3a);_0x59fed7(_0x14bc3a);});});}exports[_0x8863('0x19')]=function(_0x1f6118){var _0x327ed5=this;return new Promise(function(_0x210b13,_0x4bba07){return db[_0x8863('0x1a')][_0x8863('0x1b')]({'raw':_0x1f6118[_0x8863('0x1c')]?_0x1f6118[_0x8863('0x1c')][_0x8863('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f6118['options']?_0x1f6118['options']['where']||null:null,'attributes':_0x1f6118['options']?_0x1f6118[_0x8863('0x1c')][_0x8863('0x1e')]||null:null,'limit':_0x1f6118['options']?_0x1f6118['options'][_0x8863('0x1f')]||null:null,'include':_0x1f6118[_0x8863('0x1c')]?_0x1f6118['options']['include']?_['map'](_0x1f6118[_0x8863('0x1c')][_0x8863('0x20')],function(_0x4c3669){return{'model':db[_0x4c3669[_0x8863('0x21')]],'as':_0x4c3669['as'],'attributes':_0x4c3669[_0x8863('0x1e')],'include':_0x4c3669[_0x8863('0x20')]?_['map'](_0x4c3669[_0x8863('0x20')],function(_0x477338){return{'model':db[_0x477338[_0x8863('0x21')]],'as':_0x477338['as'],'attributes':_0x477338[_0x8863('0x1e')],'include':_0x477338[_0x8863('0x20')]?_['map'](_0x477338[_0x8863('0x20')],function(_0x2036a9){return{'model':db[_0x2036a9[_0x8863('0x21')]],'as':_0x2036a9['as'],'attributes':_0x2036a9[_0x8863('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8863('0xd')](function(_0x5c4a2d){logger[_0x8863('0x16')](_0x8863('0x19'),_0x1f6118);logger[_0x8863('0xf')](_0x8863('0x19'),_0x1f6118,JSON[_0x8863('0x12')](_0x5c4a2d));_0x210b13(_0x5c4a2d);})['catch'](function(_0x351df1){logger['error'](_0x8863('0x19'),_0x351df1[_0x8863('0x15')],_0x1f6118);_0x4bba07(_0x327ed5['error'](0x1f4,_0x351df1[_0x8863('0x15')]));});});};exports[_0x8863('0x22')]=function(_0x3eeedb){var _0x316d91=this;return new Promise(function(_0x3567fa,_0x2e80be){return db['VoiceQueueReport']['create'](_0x3eeedb[_0x8863('0x23')],{'raw':_0x3eeedb[_0x8863('0x1c')]?_0x3eeedb['options'][_0x8863('0x1d')]===undefined?!![]:![]:!![]})[_0x8863('0xd')](function(_0x54c503){logger[_0x8863('0x16')](_0x8863('0x22'),_0x3eeedb);logger['debug'](_0x8863('0x22'),_0x3eeedb,JSON[_0x8863('0x12')](_0x54c503));_0x3567fa(_0x54c503);})[_0x8863('0x18')](function(_0x5584a0){logger['error']('CreateVoiceQueueReport',_0x5584a0[_0x8863('0x15')],_0x3eeedb);_0x2e80be(_0x316d91['error'](0x1f4,_0x5584a0['message']));});});};exports[_0x8863('0x24')]=function(_0x5c7684){var _0xe1df4=this;return new Promise(function(_0x3c542a,_0x1fc57d){return db[_0x8863('0x1a')][_0x8863('0x25')](_0x5c7684[_0x8863('0x23')],{'raw':_0x5c7684[_0x8863('0x1c')]?_0x5c7684[_0x8863('0x1c')][_0x8863('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c7684[_0x8863('0x1c')]?_0x5c7684[_0x8863('0x1c')][_0x8863('0x26')]||null:null,'attributes':_0x5c7684[_0x8863('0x1c')]?_0x5c7684[_0x8863('0x1c')][_0x8863('0x1e')]||null:null,'limit':_0x5c7684[_0x8863('0x1c')]?_0x5c7684[_0x8863('0x1c')][_0x8863('0x1f')]||null:null})['then'](function(_0x31c56c){logger[_0x8863('0x16')](_0x8863('0x24'),_0x5c7684);logger[_0x8863('0xf')](_0x8863('0x24'),_0x5c7684,JSON[_0x8863('0x12')](_0x31c56c));_0x3c542a(_0x31c56c);})['catch'](function(_0x10e5a8){logger[_0x8863('0x14')](_0x8863('0x24'),_0x10e5a8[_0x8863('0x15')],_0x5c7684);_0x1fc57d(_0xe1df4[_0x8863('0x14')](0x1f4,_0x10e5a8['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 92d9b52..d2a87fd 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 _0xe06f=['removeListener','length','voiceQueueReport:','./voiceQueueReport.events','save','update','emit'];(function(_0x47f1cd,_0x387d6a){var _0x9ed116=function(_0x4f79cd){while(--_0x4f79cd){_0x47f1cd['push'](_0x47f1cd['shift']());}};_0x9ed116(++_0x387d6a);}(_0xe06f,0x65));var _0xfe06=function(_0x38b982,_0x2075b8){_0x38b982=_0x38b982-0x0;var _0x10ae6f=_0xe06f[_0x38b982];return _0x10ae6f;};'use strict';var VoiceQueueReportEvents=require(_0xfe06('0x0'));var events=[_0xfe06('0x1'),'remove',_0xfe06('0x2')];function createListener(_0x5d1104,_0x36858d){return function(_0x1a1da0){_0x36858d[_0xfe06('0x3')](_0x5d1104,_0x1a1da0);};}function removeListener(_0x1f0dec,_0x3a07cc){return function(){VoiceQueueReportEvents[_0xfe06('0x4')](_0x1f0dec,_0x3a07cc);};}exports['register']=function(_0x4b4be6){for(var _0x530973=0x0,_0x4446e9=events[_0xfe06('0x5')];_0x530973<_0x4446e9;_0x530973++){var _0x408027=events[_0x530973];var _0xb4d67a=createListener(_0xfe06('0x6')+_0x408027,_0x4b4be6);VoiceQueueReportEvents['on'](_0x408027,_0xb4d67a);}}; \ No newline at end of file +var _0x567b=['update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','remove'];(function(_0x321478,_0x2683ec){var _0x2a635b=function(_0x427c70){while(--_0x427c70){_0x321478['push'](_0x321478['shift']());}};_0x2a635b(++_0x2683ec);}(_0x567b,0x6e));var _0xb567=function(_0x42b337,_0xa1b951){_0x42b337=_0x42b337-0x0;var _0x46b793=_0x567b[_0x42b337];return _0x46b793;};'use strict';var VoiceQueueReportEvents=require(_0xb567('0x0'));var events=['save',_0xb567('0x1'),_0xb567('0x2')];function createListener(_0x4143e8,_0x37dfd4){return function(_0x51d876){_0x37dfd4[_0xb567('0x3')](_0x4143e8,_0x51d876);};}function removeListener(_0x41ee11,_0x198851){return function(){VoiceQueueReportEvents[_0xb567('0x4')](_0x41ee11,_0x198851);};}exports[_0xb567('0x5')]=function(_0x3a8d39){for(var _0xb9a4ed=0x0,_0x50b00a=events[_0xb567('0x6')];_0xb9a4ed<_0x50b00a;_0xb9a4ed++){var _0x10514e=events[_0xb9a4ed];var _0x45973b=createListener(_0xb567('0x7')+_0x10514e,_0x3a8d39);VoiceQueueReportEvents['on'](_0x10514e,_0x45973b);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 0a998b2..7ce5de5 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 _0xe528=['Router','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','post','create','delete','destroy','path','connect-timeout','express'];(function(_0x38be,_0x2edf24){var _0x49c1ac=function(_0xb9ff24){while(--_0xb9ff24){_0x38be['push'](_0x38be['shift']());}};_0x49c1ac(++_0x2edf24);}(_0xe528,0x9d));var _0x8e52=function(_0x211b7a,_0x864ee2){_0x211b7a=_0x211b7a-0x0;var _0x22d5f5=_0xe528[_0x211b7a];return _0x22d5f5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8e52('0x0'));var timeout=require(_0x8e52('0x1'));var express=require(_0x8e52('0x2'));var router=express[_0x8e52('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8e52('0x4'));var config=require(_0x8e52('0x5'));var controller=require(_0x8e52('0x6'));router[_0x8e52('0x7')]('/',auth['isAuthenticated'](),controller[_0x8e52('0x8')]);router[_0x8e52('0x7')](_0x8e52('0x9'),auth[_0x8e52('0xa')](),controller[_0x8e52('0xb')]);router[_0x8e52('0xc')]('/',auth[_0x8e52('0xa')](),controller[_0x8e52('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8e52('0xe')](_0x8e52('0x9'),auth[_0x8e52('0xa')](),controller[_0x8e52('0xf')]);module['exports']=router; \ No newline at end of file +var _0x95b3=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','Router'];(function(_0x5c7a41,_0x5d44d9){var _0x4fbc70=function(_0x3a51c4){while(--_0x3a51c4){_0x5c7a41['push'](_0x5c7a41['shift']());}};_0x4fbc70(++_0x5d44d9);}(_0x95b3,0x1d6));var _0x395b=function(_0x2929ed,_0x3dad3b){_0x2929ed=_0x2929ed-0x0;var _0x10be3f=_0x95b3[_0x2929ed];return _0x10be3f;};'use strict';var multer=require(_0x395b('0x0'));var util=require(_0x395b('0x1'));var path=require(_0x395b('0x2'));var timeout=require(_0x395b('0x3'));var express=require('express');var router=express[_0x395b('0x4')]();var fs_extra=require(_0x395b('0x5'));var auth=require(_0x395b('0x6'));var interaction=require(_0x395b('0x7'));var config=require(_0x395b('0x8'));var controller=require(_0x395b('0x9'));router[_0x395b('0xa')]('/',auth[_0x395b('0xb')](),controller['index']);router[_0x395b('0xa')]('/:id',auth[_0x395b('0xb')](),controller[_0x395b('0xc')]);router[_0x395b('0xd')]('/',auth[_0x395b('0xb')](),controller[_0x395b('0xe')]);router[_0x395b('0xf')](_0x395b('0x10'),auth[_0x395b('0xb')](),controller[_0x395b('0x11')]);router[_0x395b('0x12')](_0x395b('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 97d4b17..b11c7d2 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 _0xcd95=['DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcd95,0x13e));var _0x5cd9=function(_0x551bc1,_0x47cff3){_0x551bc1=_0x551bc1-0x0;var _0x12ea5e=_0xcd95[_0x551bc1];return _0x12ea5e;};'use strict';var Sequelize=require(_0x5cd9('0x0'));var moment=require(_0x5cd9('0x1'));module[_0x5cd9('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5cd9('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x5cd9('0x5')](_0x5cd9('0x6'))}}; \ No newline at end of file +var _0x332d=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','STRING','DATE'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x332d,0x1d6));var _0xd332=function(_0xe6c2fb,_0x443a2a){_0xe6c2fb=_0xe6c2fb-0x0;var _0x2ec689=_0x332d[_0xe6c2fb];return _0x2ec689;};'use strict';var Sequelize=require(_0xd332('0x0'));var moment=require(_0xd332('0x1'));module['exports']={'time':{'type':Sequelize[_0xd332('0x2')]},'callid':{'type':Sequelize[_0xd332('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd332('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xd332('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xd332('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xd332('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xd332('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd332('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd332('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xd332('0x4')](_0xd332('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 952948c..9149654 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 _0x6cd7=['reject','save','update','then','destroy','end','sendStatus','stack','name','send','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x10f3f2,_0x3b6b94){var _0x4cb63b=function(_0x4f3ec2){while(--_0x4f3ec2){_0x10f3f2['push'](_0x10f3f2['shift']());}};_0x4cb63b(++_0x3b6b94);}(_0x6cd7,0xbf));var _0x76cd=function(_0x3a1dec,_0x1f943f){_0x3a1dec=_0x3a1dec-0x0;var _0x60ede0=_0x6cd7[_0x3a1dec];return _0x60ede0;};'use strict';var emlformat=require(_0x76cd('0x0'));var rimraf=require(_0x76cd('0x1'));var zipdir=require(_0x76cd('0x2'));var jsonpatch=require(_0x76cd('0x3'));var rp=require('request-promise');var moment=require(_0x76cd('0x4'));var BPromise=require(_0x76cd('0x5'));var Mustache=require('mustache');var util=require(_0x76cd('0x6'));var path=require(_0x76cd('0x7'));var sox=require('sox');var csv=require(_0x76cd('0x8'));var ejs=require(_0x76cd('0x9'));var fs=require('fs');var fs_extra=require(_0x76cd('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x76cd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76cd('0xc'));var toCsv=require(_0x76cd('0x8'));var querystring=require(_0x76cd('0xd'));var Papa=require('papaparse');var Redis=require(_0x76cd('0xe'));var authService=require(_0x76cd('0xf'));var qs=require(_0x76cd('0x10'));var as=require(_0x76cd('0x11'));var hardwareService=require(_0x76cd('0x12'));var logger=require(_0x76cd('0x13'))(_0x76cd('0x14'));var utils=require(_0x76cd('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x76cd('0x16'))['db'];function respondWithStatusCode(_0x49895d,_0x3f743a){_0x3f743a=_0x3f743a||0xcc;return function(_0x2d7b12){if(_0x2d7b12){return _0x49895d['sendStatus'](_0x3f743a);}return _0x49895d[_0x76cd('0x17')](_0x3f743a)['end']();};}function respondWithResult(_0x1cd628,_0x1bc85c){_0x1bc85c=_0x1bc85c||0xc8;return function(_0x54090d){if(_0x54090d){return _0x1cd628['status'](_0x1bc85c)['json'](_0x54090d);}};}function respondWithFilteredResult(_0x36ef3b,_0x213a96){return function(_0x4f3a95){if(_0x4f3a95){var _0x58f3b4=typeof _0x213a96[_0x76cd('0x18')]===_0x76cd('0x19')&&typeof _0x213a96[_0x76cd('0x1a')]===_0x76cd('0x19');var _0x4636fb=_0x4f3a95[_0x76cd('0x1b')];var _0x3decc6=_0x58f3b4?0x0:_0x213a96[_0x76cd('0x18')];var _0x12071a=_0x58f3b4?_0x4f3a95[_0x76cd('0x1b')]:_0x213a96['offset']+_0x213a96['limit'];var _0x55f5b5;if(_0x12071a>=_0x4636fb){_0x12071a=_0x4636fb;_0x55f5b5=0xc8;}else{_0x55f5b5=0xce;}_0x36ef3b[_0x76cd('0x17')](_0x55f5b5);return _0x36ef3b[_0x76cd('0x1c')](_0x76cd('0x1d'),_0x3decc6+'-'+_0x12071a+'/'+_0x4636fb)['json'](_0x4f3a95);}return null;};}function patchUpdates(_0x252852){return function(_0x24c6bd){try{jsonpatch[_0x76cd('0x1e')](_0x24c6bd,_0x252852,!![]);}catch(_0x30eee8){return BPromise[_0x76cd('0x1f')](_0x30eee8);}return _0x24c6bd[_0x76cd('0x20')]();};}function saveUpdates(_0x52e8d4,_0x5fa0e7){return function(_0x2100e1){if(_0x2100e1){return _0x2100e1[_0x76cd('0x21')](_0x52e8d4)[_0x76cd('0x22')](function(_0x9e1afa){return _0x9e1afa;});}return null;};}function removeEntity(_0x37d283,_0x3b1395){return function(_0x8f5c8e){if(_0x8f5c8e){return _0x8f5c8e[_0x76cd('0x23')]()[_0x76cd('0x22')](function(){_0x37d283[_0x76cd('0x17')](0xcc)[_0x76cd('0x24')]();});}};}function handleEntityNotFound(_0x50d580,_0x1f88cd){return function(_0x49d335){if(!_0x49d335){_0x50d580[_0x76cd('0x25')](0x194);}return _0x49d335;};}function handleError(_0x12c529,_0xfc0cc0){_0xfc0cc0=_0xfc0cc0||0x1f4;return function(_0x3b5ff3){logger['error'](_0x3b5ff3[_0x76cd('0x26')]);if(_0x3b5ff3['name']){delete _0x3b5ff3[_0x76cd('0x27')];}_0x12c529[_0x76cd('0x17')](_0xfc0cc0)[_0x76cd('0x28')](_0x3b5ff3);};}exports['index']=function(_0x58847e,_0x1561fc){var _0x315ff1={},_0x446ab1={},_0x1a36f3={'count':0x0,'rows':[]};var _0x27bd6d=_['map'](db[_0x76cd('0x29')][_0x76cd('0x2a')],function(_0x45feca){return{'name':_0x45feca[_0x76cd('0x2b')],'type':_0x45feca[_0x76cd('0x2c')][_0x76cd('0x2d')]};});_0x446ab1[_0x76cd('0x2e')]=_[_0x76cd('0x2f')](_0x27bd6d,'name');_0x446ab1[_0x76cd('0x30')]=_[_0x76cd('0x31')](_0x58847e[_0x76cd('0x30')]);_0x446ab1['filters']=_[_0x76cd('0x32')](_0x446ab1[_0x76cd('0x2e')],_0x446ab1[_0x76cd('0x30')]);_0x315ff1[_0x76cd('0x33')]=_[_0x76cd('0x32')](_0x446ab1[_0x76cd('0x2e')],qs['fields'](_0x58847e[_0x76cd('0x30')][_0x76cd('0x34')]));_0x315ff1[_0x76cd('0x33')]=_0x315ff1['attributes'][_0x76cd('0x35')]?_0x315ff1[_0x76cd('0x33')]:_0x446ab1[_0x76cd('0x2e')];if(!_0x58847e[_0x76cd('0x30')][_0x76cd('0x36')](_0x76cd('0x37'))){_0x315ff1[_0x76cd('0x1a')]=qs[_0x76cd('0x1a')](_0x58847e[_0x76cd('0x30')][_0x76cd('0x1a')]);_0x315ff1[_0x76cd('0x18')]=qs[_0x76cd('0x18')](_0x58847e['query'][_0x76cd('0x18')]);}_0x315ff1[_0x76cd('0x38')]=qs[_0x76cd('0x39')](_0x58847e[_0x76cd('0x30')][_0x76cd('0x39')]);_0x315ff1['where']=qs[_0x76cd('0x3a')](_['pick'](_0x58847e[_0x76cd('0x30')],_0x446ab1[_0x76cd('0x3a')]),_0x27bd6d);if(_0x58847e[_0x76cd('0x30')][_0x76cd('0x3b')]){_0x315ff1[_0x76cd('0x3c')]=_['merge'](_0x315ff1[_0x76cd('0x3c')],{'$or':_['map'](_0x27bd6d,function(_0x3d58f3){if(_0x3d58f3['type']!==_0x76cd('0x3d')){var _0x19e8fe={};_0x19e8fe[_0x3d58f3[_0x76cd('0x27')]]={'$like':'%'+_0x58847e[_0x76cd('0x30')][_0x76cd('0x3b')]+'%'};return _0x19e8fe;}})});}_0x315ff1=_[_0x76cd('0x3e')]({},_0x315ff1,_0x58847e[_0x76cd('0x3f')]);var _0x45f568={'where':_0x315ff1['where']};return db[_0x76cd('0x29')]['count'](_0x45f568)[_0x76cd('0x22')](function(_0x2873f1){_0x1a36f3['count']=_0x2873f1;if(_0x58847e['query'][_0x76cd('0x40')]){_0x315ff1['include']=[{'all':!![]}];}return db[_0x76cd('0x29')][_0x76cd('0x41')](_0x315ff1);})[_0x76cd('0x22')](function(_0x18ea69){_0x1a36f3[_0x76cd('0x42')]=_0x18ea69;return _0x1a36f3;})[_0x76cd('0x22')](respondWithFilteredResult(_0x1561fc,_0x315ff1))[_0x76cd('0x43')](handleError(_0x1561fc,null));};exports[_0x76cd('0x44')]=function(_0x100620,_0x3d2a73){var _0x4393b5={'raw':!![],'where':{'id':_0x100620['params']['id']}},_0x3dfacf={};_0x3dfacf[_0x76cd('0x2e')]=_[_0x76cd('0x31')](db['VoiceQueuesLog']['rawAttributes']);_0x3dfacf[_0x76cd('0x30')]=_['keys'](_0x100620[_0x76cd('0x30')]);_0x3dfacf[_0x76cd('0x3a')]=_['intersection'](_0x3dfacf[_0x76cd('0x2e')],_0x3dfacf['query']);_0x4393b5['attributes']=_[_0x76cd('0x32')](_0x3dfacf[_0x76cd('0x2e')],qs['fields'](_0x100620[_0x76cd('0x30')]['fields']));_0x4393b5[_0x76cd('0x33')]=_0x4393b5[_0x76cd('0x33')][_0x76cd('0x35')]?_0x4393b5[_0x76cd('0x33')]:_0x3dfacf[_0x76cd('0x2e')];if(_0x100620[_0x76cd('0x30')][_0x76cd('0x40')]){_0x4393b5[_0x76cd('0x45')]=[{'all':!![]}];}_0x4393b5=_[_0x76cd('0x3e')]({},_0x4393b5,_0x100620[_0x76cd('0x3f')]);return db[_0x76cd('0x29')][_0x76cd('0x46')](_0x4393b5)[_0x76cd('0x22')](handleEntityNotFound(_0x3d2a73,null))[_0x76cd('0x22')](respondWithResult(_0x3d2a73,null))[_0x76cd('0x43')](handleError(_0x3d2a73,null));};exports['create']=function(_0x286a66,_0xdea6c1){return db['VoiceQueuesLog'][_0x76cd('0x47')](_0x286a66[_0x76cd('0x48')],{})[_0x76cd('0x22')](respondWithResult(_0xdea6c1,0xc9))[_0x76cd('0x43')](handleError(_0xdea6c1,null));};exports['update']=function(_0x3ca7ef,_0x392593){if(_0x3ca7ef['body']['id']){delete _0x3ca7ef[_0x76cd('0x48')]['id'];}return db[_0x76cd('0x29')]['find']({'where':{'id':_0x3ca7ef[_0x76cd('0x49')]['id']}})[_0x76cd('0x22')](handleEntityNotFound(_0x392593,null))[_0x76cd('0x22')](saveUpdates(_0x3ca7ef[_0x76cd('0x48')],null))['then'](respondWithResult(_0x392593,null))['catch'](handleError(_0x392593,null));};exports['destroy']=function(_0x21fdb4,_0x484e55){return db[_0x76cd('0x29')][_0x76cd('0x46')]({'where':{'id':_0x21fdb4['params']['id']}})['then'](handleEntityNotFound(_0x484e55,null))[_0x76cd('0x22')](removeEntity(_0x484e55,null))['catch'](handleError(_0x484e55,null));}; \ No newline at end of file +var _0x2346=['end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','VoiceQueuesLog','findAll','rows','catch','show','params','find','create','body','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status'];(function(_0x4e87ba,_0x2d95f9){var _0x212b08=function(_0x763e51){while(--_0x763e51){_0x4e87ba['push'](_0x4e87ba['shift']());}};_0x212b08(++_0x2d95f9);}(_0x2346,0x1b2));var _0x6234=function(_0xb87f20,_0x4ae8f5){_0xb87f20=_0xb87f20-0x0;var _0x5e02bb=_0x2346[_0xb87f20];return _0x5e02bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6234('0x0'));var zipdir=require(_0x6234('0x1'));var jsonpatch=require(_0x6234('0x2'));var rp=require(_0x6234('0x3'));var moment=require(_0x6234('0x4'));var BPromise=require(_0x6234('0x5'));var Mustache=require(_0x6234('0x6'));var util=require(_0x6234('0x7'));var path=require(_0x6234('0x8'));var sox=require(_0x6234('0x9'));var csv=require(_0x6234('0xa'));var ejs=require(_0x6234('0xb'));var fs=require('fs');var fs_extra=require(_0x6234('0xc'));var _=require(_0x6234('0xd'));var squel=require(_0x6234('0xe'));var crypto=require(_0x6234('0xf'));var jsforce=require(_0x6234('0x10'));var deskjs=require(_0x6234('0x11'));var toCsv=require(_0x6234('0xa'));var querystring=require(_0x6234('0x12'));var Papa=require(_0x6234('0x13'));var Redis=require('ioredis');var authService=require(_0x6234('0x14'));var qs=require(_0x6234('0x15'));var as=require(_0x6234('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6234('0x17'))('api');var utils=require(_0x6234('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6234('0x19'));var db=require(_0x6234('0x1a'))['db'];function respondWithStatusCode(_0x3cbf91,_0x96a638){_0x96a638=_0x96a638||0xcc;return function(_0x1ad686){if(_0x1ad686){return _0x3cbf91['sendStatus'](_0x96a638);}return _0x3cbf91[_0x6234('0x1b')](_0x96a638)[_0x6234('0x1c')]();};}function respondWithResult(_0x3d8d62,_0x2e52a2){_0x2e52a2=_0x2e52a2||0xc8;return function(_0x11ce36){if(_0x11ce36){return _0x3d8d62['status'](_0x2e52a2)['json'](_0x11ce36);}};}function respondWithFilteredResult(_0x5b1dca,_0x4bf180){return function(_0x368e45){if(_0x368e45){var _0x3df78c=typeof _0x4bf180[_0x6234('0x1d')]===_0x6234('0x1e')&&typeof _0x4bf180[_0x6234('0x1f')]===_0x6234('0x1e');var _0x51b952=_0x368e45[_0x6234('0x20')];var _0x1e2e61=_0x3df78c?0x0:_0x4bf180[_0x6234('0x1d')];var _0x112b0c=_0x3df78c?_0x368e45[_0x6234('0x20')]:_0x4bf180[_0x6234('0x1d')]+_0x4bf180['limit'];var _0x1d2971;if(_0x112b0c>=_0x51b952){_0x112b0c=_0x51b952;_0x1d2971=0xc8;}else{_0x1d2971=0xce;}_0x5b1dca[_0x6234('0x1b')](_0x1d2971);return _0x5b1dca[_0x6234('0x21')](_0x6234('0x22'),_0x1e2e61+'-'+_0x112b0c+'/'+_0x51b952)['json'](_0x368e45);}return null;};}function patchUpdates(_0x4258ba){return function(_0x2cfb56){try{jsonpatch[_0x6234('0x23')](_0x2cfb56,_0x4258ba,!![]);}catch(_0x442283){return BPromise['reject'](_0x442283);}return _0x2cfb56[_0x6234('0x24')]();};}function saveUpdates(_0x2a49c3,_0x3787cc){return function(_0x2dc8c0){if(_0x2dc8c0){return _0x2dc8c0[_0x6234('0x25')](_0x2a49c3)[_0x6234('0x26')](function(_0x50c8db){return _0x50c8db;});}return null;};}function removeEntity(_0x314e17,_0x206fbb){return function(_0x4807c3){if(_0x4807c3){return _0x4807c3[_0x6234('0x27')]()[_0x6234('0x26')](function(){_0x314e17['status'](0xcc)[_0x6234('0x1c')]();});}};}function handleEntityNotFound(_0x5566c2,_0x360879){return function(_0x4c4905){if(!_0x4c4905){_0x5566c2[_0x6234('0x28')](0x194);}return _0x4c4905;};}function handleError(_0x8d6498,_0x2a5c00){_0x2a5c00=_0x2a5c00||0x1f4;return function(_0x2119a0){logger[_0x6234('0x29')](_0x2119a0[_0x6234('0x2a')]);if(_0x2119a0[_0x6234('0x2b')]){delete _0x2119a0['name'];}_0x8d6498[_0x6234('0x1b')](_0x2a5c00)[_0x6234('0x2c')](_0x2119a0);};}exports[_0x6234('0x2d')]=function(_0x569752,_0x368ce6){var _0x2823ec={},_0x5acbfa={},_0x4a2d06={'count':0x0,'rows':[]};var _0x169dfb=_[_0x6234('0x2e')](db['VoiceQueuesLog']['rawAttributes'],function(_0x12a471){return{'name':_0x12a471['fieldName'],'type':_0x12a471[_0x6234('0x2f')]['key']};});_0x5acbfa[_0x6234('0x30')]=_[_0x6234('0x2e')](_0x169dfb,_0x6234('0x2b'));_0x5acbfa[_0x6234('0x31')]=_[_0x6234('0x32')](_0x569752['query']);_0x5acbfa['filters']=_[_0x6234('0x33')](_0x5acbfa['model'],_0x5acbfa[_0x6234('0x31')]);_0x2823ec['attributes']=_[_0x6234('0x33')](_0x5acbfa['model'],qs['fields'](_0x569752[_0x6234('0x31')][_0x6234('0x34')]));_0x2823ec[_0x6234('0x35')]=_0x2823ec[_0x6234('0x35')][_0x6234('0x36')]?_0x2823ec['attributes']:_0x5acbfa['model'];if(!_0x569752[_0x6234('0x31')][_0x6234('0x37')](_0x6234('0x38'))){_0x2823ec[_0x6234('0x1f')]=qs['limit'](_0x569752[_0x6234('0x31')][_0x6234('0x1f')]);_0x2823ec[_0x6234('0x1d')]=qs[_0x6234('0x1d')](_0x569752[_0x6234('0x31')][_0x6234('0x1d')]);}_0x2823ec[_0x6234('0x39')]=qs[_0x6234('0x3a')](_0x569752[_0x6234('0x31')][_0x6234('0x3a')]);_0x2823ec[_0x6234('0x3b')]=qs[_0x6234('0x3c')](_[_0x6234('0x3d')](_0x569752[_0x6234('0x31')],_0x5acbfa['filters']),_0x169dfb);if(_0x569752[_0x6234('0x31')][_0x6234('0x3e')]){_0x2823ec[_0x6234('0x3b')]=_[_0x6234('0x3f')](_0x2823ec[_0x6234('0x3b')],{'$or':_['map'](_0x169dfb,function(_0x50efcb){if(_0x50efcb[_0x6234('0x2f')]!==_0x6234('0x40')){var _0x30944d={};_0x30944d[_0x50efcb[_0x6234('0x2b')]]={'$like':'%'+_0x569752[_0x6234('0x31')]['filter']+'%'};return _0x30944d;}})});}_0x2823ec=_['merge']({},_0x2823ec,_0x569752[_0x6234('0x41')]);var _0x3b8230={'where':_0x2823ec[_0x6234('0x3b')]};return db['VoiceQueuesLog']['count'](_0x3b8230)[_0x6234('0x26')](function(_0x764f60){_0x4a2d06[_0x6234('0x20')]=_0x764f60;if(_0x569752[_0x6234('0x31')][_0x6234('0x42')]){_0x2823ec[_0x6234('0x43')]=[{'all':!![]}];}return db[_0x6234('0x44')][_0x6234('0x45')](_0x2823ec);})[_0x6234('0x26')](function(_0x4436b7){_0x4a2d06[_0x6234('0x46')]=_0x4436b7;return _0x4a2d06;})[_0x6234('0x26')](respondWithFilteredResult(_0x368ce6,_0x2823ec))[_0x6234('0x47')](handleError(_0x368ce6,null));};exports[_0x6234('0x48')]=function(_0x52cee7,_0x42527a){var _0x44ffc4={'raw':!![],'where':{'id':_0x52cee7[_0x6234('0x49')]['id']}},_0x3786f5={};_0x3786f5[_0x6234('0x30')]=_['keys'](db['VoiceQueuesLog']['rawAttributes']);_0x3786f5[_0x6234('0x31')]=_[_0x6234('0x32')](_0x52cee7[_0x6234('0x31')]);_0x3786f5['filters']=_[_0x6234('0x33')](_0x3786f5[_0x6234('0x30')],_0x3786f5['query']);_0x44ffc4[_0x6234('0x35')]=_[_0x6234('0x33')](_0x3786f5[_0x6234('0x30')],qs[_0x6234('0x34')](_0x52cee7['query'][_0x6234('0x34')]));_0x44ffc4[_0x6234('0x35')]=_0x44ffc4[_0x6234('0x35')][_0x6234('0x36')]?_0x44ffc4[_0x6234('0x35')]:_0x3786f5[_0x6234('0x30')];if(_0x52cee7[_0x6234('0x31')][_0x6234('0x42')]){_0x44ffc4[_0x6234('0x43')]=[{'all':!![]}];}_0x44ffc4=_[_0x6234('0x3f')]({},_0x44ffc4,_0x52cee7[_0x6234('0x41')]);return db[_0x6234('0x44')][_0x6234('0x4a')](_0x44ffc4)[_0x6234('0x26')](handleEntityNotFound(_0x42527a,null))[_0x6234('0x26')](respondWithResult(_0x42527a,null))[_0x6234('0x47')](handleError(_0x42527a,null));};exports[_0x6234('0x4b')]=function(_0x3289c4,_0x52031a){return db[_0x6234('0x44')][_0x6234('0x4b')](_0x3289c4['body'],{})[_0x6234('0x26')](respondWithResult(_0x52031a,0xc9))[_0x6234('0x47')](handleError(_0x52031a,null));};exports['update']=function(_0x34934d,_0x4fba1b){if(_0x34934d['body']['id']){delete _0x34934d[_0x6234('0x4c')]['id'];}return db[_0x6234('0x44')][_0x6234('0x4a')]({'where':{'id':_0x34934d['params']['id']}})[_0x6234('0x26')](handleEntityNotFound(_0x4fba1b,null))[_0x6234('0x26')](saveUpdates(_0x34934d['body'],null))[_0x6234('0x26')](respondWithResult(_0x4fba1b,null))['catch'](handleError(_0x4fba1b,null));};exports[_0x6234('0x27')]=function(_0x4beed2,_0x399f79){return db[_0x6234('0x44')][_0x6234('0x4a')]({'where':{'id':_0x4beed2[_0x6234('0x49')]['id']}})[_0x6234('0x26')](handleEntityNotFound(_0x399f79,null))[_0x6234('0x26')](removeEntity(_0x399f79,null))[_0x6234('0x47')](handleError(_0x399f79,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index fd82752..ac5faa3 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 _0xb622=['./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb622,0x1e7));var _0x2b62=function(_0x5eabbf,_0x3542c6){_0x5eabbf=_0x5eabbf-0x0;var _0x35d418=_0xb622[_0x5eabbf];return _0x35d418;};'use strict';var _=require('lodash');var util=require(_0x2b62('0x0'));var logger=require(_0x2b62('0x1'))(_0x2b62('0x2'));var moment=require(_0x2b62('0x3'));var BPromise=require(_0x2b62('0x4'));var rp=require(_0x2b62('0x5'));var fs=require('fs');var path=require(_0x2b62('0x6'));var rimraf=require(_0x2b62('0x7'));var config=require(_0x2b62('0x8'));var attributes=require(_0x2b62('0x9'));module[_0x2b62('0xa')]=function(_0x23a401,_0x467837){return _0x23a401[_0x2b62('0xb')](_0x2b62('0xc'),attributes,{'tableName':_0x2b62('0xd'),'paranoid':![],'indexes':[{'name':_0x2b62('0xe'),'fields':['event',_0x2b62('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0xdc32=['exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x2d6100,_0x58890f){var _0x18c6ea=function(_0x2b90e3){while(--_0x2b90e3){_0x2d6100['push'](_0x2d6100['shift']());}};_0x18c6ea(++_0x58890f);}(_0xdc32,0x149));var _0x2dc3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdc32[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2dc3('0x0'));var util=require(_0x2dc3('0x1'));var logger=require('../../config/logger')(_0x2dc3('0x2'));var moment=require(_0x2dc3('0x3'));var BPromise=require(_0x2dc3('0x4'));var rp=require(_0x2dc3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2dc3('0x6'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0x2dc3('0x7')]=function(_0x319357,_0x42ed74){return _0x319357[_0x2dc3('0x8')](_0x2dc3('0x9'),attributes,{'tableName':_0x2dc3('0xa'),'paranoid':![],'indexes':[{'name':_0x2dc3('0xb'),'fields':[_0x2dc3('0xc'),_0x2dc3('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index b571bb1..8d0414a 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 _0x2948=['then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x2dab94,_0x30caba){var _0x5bd5fe=function(_0xbf09ab){while(--_0xbf09ab){_0x2dab94['push'](_0x2dab94['shift']());}};_0x5bd5fe(++_0x30caba);}(_0x2948,0xcb));var _0x8294=function(_0x581ec8,_0x5584f6){_0x581ec8=_0x581ec8-0x0;var _0x5974bd=_0x2948[_0x581ec8];return _0x5974bd;};'use strict';var _=require(_0x8294('0x0'));var util=require(_0x8294('0x1'));var moment=require(_0x8294('0x2'));var BPromise=require(_0x8294('0x3'));var rs=require(_0x8294('0x4'));var fs=require('fs');var Redis=require(_0x8294('0x5'));var db=require(_0x8294('0x6'))['db'];var utils=require(_0x8294('0x7'));var logger=require(_0x8294('0x8'))('rpc');var config=require(_0x8294('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8294('0xa')][_0x8294('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39aa65,_0x514609,_0x5a7135){return new BPromise(function(_0x56f7c8,_0x530786){return client[_0x8294('0xc')](_0x39aa65,_0x5a7135)[_0x8294('0xd')](function(_0x545613){logger[_0x8294('0xe')](_0x8294('0xf'),_0x514609,_0x8294('0x10'));logger[_0x8294('0x11')](_0x8294('0x12'),_0x514609,_0x8294('0x10'),JSON['stringify'](_0x545613));if(_0x545613[_0x8294('0x13')]){if(_0x545613[_0x8294('0x13')][_0x8294('0x14')]===0x1f4){logger[_0x8294('0x13')](_0x8294('0xf'),_0x514609,_0x545613[_0x8294('0x13')][_0x8294('0x15')]);return _0x530786(_0x545613[_0x8294('0x13')]['message']);}logger[_0x8294('0x13')](_0x8294('0xf'),_0x514609,_0x545613[_0x8294('0x13')]['message']);return _0x56f7c8(_0x545613['error']['message']);}else{logger[_0x8294('0xe')](_0x8294('0xf'),_0x514609,_0x8294('0x10'));_0x56f7c8(_0x545613[_0x8294('0x16')][_0x8294('0x15')]);}})[_0x8294('0x17')](function(_0x2a501a){logger[_0x8294('0x13')](_0x8294('0xf'),_0x514609,_0x2a501a);_0x530786(_0x2a501a);});});} \ No newline at end of file +var _0x048c=['info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x23ddb4,_0x319eaa){var _0x3eab6c=function(_0x24b795){while(--_0x24b795){_0x23ddb4['push'](_0x23ddb4['shift']());}};_0x3eab6c(++_0x319eaa);}(_0x048c,0xdb));var _0xc048=function(_0x206aeb,_0x4aad3d){_0x206aeb=_0x206aeb-0x0;var _0x1ddbcb=_0x048c[_0x206aeb];return _0x1ddbcb;};'use strict';var _=require(_0xc048('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc048('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc048('0x2'));var db=require(_0xc048('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc048('0x4'))(_0xc048('0x5'));var config=require(_0xc048('0x6'));var jayson=require(_0xc048('0x7'));var client=jayson[_0xc048('0x8')][_0xc048('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbfb080,_0x3550a8,_0x5597fe){return new BPromise(function(_0xe3f589,_0x3d4f95){return client[_0xc048('0xa')](_0xbfb080,_0x5597fe)[_0xc048('0xb')](function(_0x28fc92){logger[_0xc048('0xc')](_0xc048('0xd'),_0x3550a8,_0xc048('0xe'));logger['debug'](_0xc048('0xf'),_0x3550a8,_0xc048('0xe'),JSON[_0xc048('0x10')](_0x28fc92));if(_0x28fc92[_0xc048('0x11')]){if(_0x28fc92['error'][_0xc048('0x12')]===0x1f4){logger['error'](_0xc048('0xd'),_0x3550a8,_0x28fc92['error'][_0xc048('0x13')]);return _0x3d4f95(_0x28fc92[_0xc048('0x11')][_0xc048('0x13')]);}logger[_0xc048('0x11')](_0xc048('0xd'),_0x3550a8,_0x28fc92[_0xc048('0x11')][_0xc048('0x13')]);return _0xe3f589(_0x28fc92[_0xc048('0x11')][_0xc048('0x13')]);}else{logger[_0xc048('0xc')](_0xc048('0xd'),_0x3550a8,_0xc048('0xe'));_0xe3f589(_0x28fc92[_0xc048('0x14')]['message']);}})['catch'](function(_0x341ae7){logger[_0xc048('0x11')](_0xc048('0xd'),_0x3550a8,_0x341ae7);_0x3d4f95(_0x341ae7);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 4f7ae0b..af6ae4d 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 _0x9c1a=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x2620e1,_0x155788){var _0x12e4d4=function(_0x3dd78f){while(--_0x3dd78f){_0x2620e1['push'](_0x2620e1['shift']());}};_0x12e4d4(++_0x155788);}(_0x9c1a,0xee));var _0xa9c1=function(_0x173c92,_0x1215b7){_0x173c92=_0x173c92-0x0;var _0x5b1687=_0x9c1a[_0x173c92];return _0x5b1687;};'use strict';var multer=require(_0xa9c1('0x0'));var util=require(_0xa9c1('0x1'));var path=require(_0xa9c1('0x2'));var timeout=require('connect-timeout');var express=require(_0xa9c1('0x3'));var router=express[_0xa9c1('0x4')]();var fs_extra=require(_0xa9c1('0x5'));var auth=require(_0xa9c1('0x6'));var interaction=require(_0xa9c1('0x7'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0xa9c1('0x8')]('/',auth[_0xa9c1('0x9')](),controller[_0xa9c1('0xa')]);router[_0xa9c1('0x8')]('/describe',auth[_0xa9c1('0x9')](),controller[_0xa9c1('0xb')]);router[_0xa9c1('0x8')](_0xa9c1('0xc'),auth[_0xa9c1('0x9')](),controller[_0xa9c1('0xd')]);router[_0xa9c1('0x8')](_0xa9c1('0xe'),auth['isAuthenticated'](),controller[_0xa9c1('0xf')]);router[_0xa9c1('0x8')](_0xa9c1('0x10'),controller['downloads']);router[_0xa9c1('0x8')](_0xa9c1('0x11'),auth['isAuthenticated'](),controller[_0xa9c1('0x12')]);router[_0xa9c1('0x13')]('/',auth[_0xa9c1('0x9')](),controller[_0xa9c1('0x14')]);router[_0xa9c1('0x13')](_0xa9c1('0x11'),auth[_0xa9c1('0x9')](),controller[_0xa9c1('0x15')]);router[_0xa9c1('0x16')](_0xa9c1('0xc'),auth[_0xa9c1('0x9')](),controller[_0xa9c1('0x17')]);router[_0xa9c1('0x18')]('/:id',auth[_0xa9c1('0x9')](),controller[_0xa9c1('0x19')]);module[_0xa9c1('0x1a')]=router; \ No newline at end of file +var _0xd480=['put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id/download','download','/:id/transcribe','downloadTranscribe','post','create'];(function(_0x52eeab,_0x548873){var _0x413345=function(_0x2e1719){while(--_0x2e1719){_0x52eeab['push'](_0x52eeab['shift']());}};_0x413345(++_0x548873);}(_0xd480,0xa6));var _0x0d48=function(_0x326309,_0x555f89){_0x326309=_0x326309-0x0;var _0x14263e=_0xd480[_0x326309];return _0x14263e;};'use strict';var multer=require(_0x0d48('0x0'));var util=require(_0x0d48('0x1'));var path=require(_0x0d48('0x2'));var timeout=require('connect-timeout');var express=require(_0x0d48('0x3'));var router=express[_0x0d48('0x4')]();var fs_extra=require(_0x0d48('0x5'));var auth=require(_0x0d48('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0d48('0x7'));var controller=require('./voiceRecording.controller');router[_0x0d48('0x8')]('/',auth[_0x0d48('0x9')](),controller[_0x0d48('0xa')]);router['get']('/describe',auth[_0x0d48('0x9')](),controller[_0x0d48('0xb')]);router[_0x0d48('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0d48('0x8')](_0x0d48('0xc'),auth[_0x0d48('0x9')](),controller[_0x0d48('0xd')]);router[_0x0d48('0x8')]('/:id/downloads',controller['downloads']);router[_0x0d48('0x8')](_0x0d48('0xe'),auth[_0x0d48('0x9')](),controller[_0x0d48('0xf')]);router[_0x0d48('0x10')]('/',auth[_0x0d48('0x9')](),controller[_0x0d48('0x11')]);router['post']('/:id/transcribe',auth['isAuthenticated'](),controller['runTranscribe']);router[_0x0d48('0x12')](_0x0d48('0x13'),auth[_0x0d48('0x9')](),controller[_0x0d48('0x14')]);router[_0x0d48('0x15')](_0x0d48('0x13'),auth[_0x0d48('0x9')](),controller['destroy']);module[_0x0d48('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 8affed2..9283f9b 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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +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(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 cd57007..540cde2 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 _0x0920=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','sendStatus','error','stack','name','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','include','findAll','rows','params','find','catch','create','body','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','message','send','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','ValidationError','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','../../components/encryptor','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','querystring'];(function(_0x4641a1,_0x4e9f45){var _0xc92e1a=function(_0x3e91a8){while(--_0x3e91a8){_0x4641a1['push'](_0x4641a1['shift']());}};_0xc92e1a(++_0x4e9f45);}(_0x0920,0x1c3));var _0x0092=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x0920[_0x3c4dad];return _0x1a4f49;};'use strict';var emlformat=require(_0x0092('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0092('0x1'));var jsonpatch=require(_0x0092('0x2'));var rp=require(_0x0092('0x3'));var moment=require(_0x0092('0x4'));var BPromise=require(_0x0092('0x5'));var Mustache=require(_0x0092('0x6'));var util=require(_0x0092('0x7'));var path=require(_0x0092('0x8'));var sox=require(_0x0092('0x9'));var csv=require(_0x0092('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0092('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0092('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0092('0xd'));var Papa=require(_0x0092('0xe'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x0092('0xf'));var authService=require(_0x0092('0x10'));var qs=require(_0x0092('0x11'));var as=require(_0x0092('0x12'));var hardwareService=require(_0x0092('0x13'));var logger=require(_0x0092('0x14'))(_0x0092('0x15'));var utils=require('../../config/utils');var config=require(_0x0092('0x16'));var licenseUtil=require(_0x0092('0x17'));var db=require(_0x0092('0x18'))['db'];function respondWithStatusCode(_0xed9d00,_0x22c16c){_0x22c16c=_0x22c16c||0xcc;return function(_0x323473){if(_0x323473){return _0xed9d00['sendStatus'](_0x22c16c);}return _0xed9d00[_0x0092('0x19')](_0x22c16c)[_0x0092('0x1a')]();};}function respondWithResult(_0x3936f4,_0x552a4b){_0x552a4b=_0x552a4b||0xc8;return function(_0x184874){if(_0x184874){return _0x3936f4[_0x0092('0x19')](_0x552a4b)[_0x0092('0x1b')](_0x184874);}};}function respondWithFilteredResult(_0x16f43b,_0x4213c5){return function(_0x43b1a8){if(_0x43b1a8){var _0x2aceb5=typeof _0x4213c5[_0x0092('0x1c')]===_0x0092('0x1d')&&typeof _0x4213c5[_0x0092('0x1e')]==='undefined';var _0x2681a9=_0x43b1a8[_0x0092('0x1f')];var _0x20ef94=_0x2aceb5?0x0:_0x4213c5[_0x0092('0x1c')];var _0xc448b6=_0x2aceb5?_0x43b1a8[_0x0092('0x1f')]:_0x4213c5[_0x0092('0x1c')]+_0x4213c5['limit'];var _0x151eda;if(_0xc448b6>=_0x2681a9){_0xc448b6=_0x2681a9;_0x151eda=0xc8;}else{_0x151eda=0xce;}_0x16f43b[_0x0092('0x19')](_0x151eda);return _0x16f43b[_0x0092('0x20')](_0x0092('0x21'),_0x20ef94+'-'+_0xc448b6+'/'+_0x2681a9)[_0x0092('0x1b')](_0x43b1a8);}return null;};}function patchUpdates(_0x23cb01){return function(_0x4723ad){try{jsonpatch['apply'](_0x4723ad,_0x23cb01,!![]);}catch(_0x5d25eb){return BPromise[_0x0092('0x22')](_0x5d25eb);}return _0x4723ad[_0x0092('0x23')]();};}function saveUpdates(_0x2fbe37,_0x3fe297){return function(_0x5d663d){if(_0x5d663d){return _0x5d663d['update'](_0x2fbe37)[_0x0092('0x24')](function(_0x54686){return _0x54686;});}return null;};}function removeEntity(_0x204cd9,_0x59013d){return function(_0x39aa14){if(_0x39aa14){return _0x39aa14['destroy']()[_0x0092('0x24')](function(){_0x204cd9[_0x0092('0x19')](0xcc)[_0x0092('0x1a')]();});}};}function handleEntityNotFound(_0x34097d,_0x300fef){return function(_0x1911b1){if(!_0x1911b1){_0x34097d[_0x0092('0x25')](0x194);}return _0x1911b1;};}function handleError(_0x57742d,_0x440167){_0x440167=_0x440167||0x1f4;return function(_0x56f1c0){logger[_0x0092('0x26')](_0x56f1c0[_0x0092('0x27')]);if(_0x56f1c0[_0x0092('0x28')]){delete _0x56f1c0[_0x0092('0x28')];}_0x57742d[_0x0092('0x19')](_0x440167)['send'](_0x56f1c0);};}exports['index']=function(_0x577df1,_0x5a6ca5){var _0x462387={},_0x2d5310={},_0x131e75={'count':0x0,'rows':[]};var _0x740006=_[_0x0092('0x29')](db[_0x0092('0x2a')][_0x0092('0x2b')],function(_0x524db9){return{'name':_0x524db9[_0x0092('0x2c')],'type':_0x524db9[_0x0092('0x2d')][_0x0092('0x2e')]};});_0x2d5310[_0x0092('0x2f')]=_[_0x0092('0x30')](_['map'](_0x740006,_0x0092('0x28')),[_0x0092('0x31')]);_0x2d5310[_0x0092('0x32')]=_[_0x0092('0x33')](_0x577df1[_0x0092('0x32')]);_0x2d5310[_0x0092('0x34')]=_[_0x0092('0x35')](_0x2d5310[_0x0092('0x2f')],_0x2d5310[_0x0092('0x32')]);_0x462387[_0x0092('0x36')]=_['intersection'](_0x2d5310['model'],qs['fields'](_0x577df1['query'][_0x0092('0x37')]));_0x462387[_0x0092('0x36')]=_0x462387[_0x0092('0x36')][_0x0092('0x38')]?_0x462387[_0x0092('0x36')]:_0x2d5310[_0x0092('0x2f')];if(!_0x577df1[_0x0092('0x32')]['hasOwnProperty']('nolimit')){_0x462387[_0x0092('0x1e')]=qs[_0x0092('0x1e')](_0x577df1['query']['limit']);_0x462387['offset']=qs[_0x0092('0x1c')](_0x577df1[_0x0092('0x32')][_0x0092('0x1c')]);}_0x462387[_0x0092('0x39')]=qs[_0x0092('0x3a')](_0x577df1[_0x0092('0x32')]['sort']);_0x462387[_0x0092('0x3b')]=qs[_0x0092('0x34')](_[_0x0092('0x3c')](_0x577df1[_0x0092('0x32')],_0x2d5310[_0x0092('0x34')]),_0x740006);if(_0x577df1[_0x0092('0x32')][_0x0092('0x3d')]){_0x462387['where']=_[_0x0092('0x3e')](_0x462387[_0x0092('0x3b')],{'$or':_[_0x0092('0x29')](_0x740006,function(_0x40bca4){if(_0x40bca4[_0x0092('0x2d')]!=='VIRTUAL'){var _0x57dc5a={};_0x57dc5a[_0x40bca4[_0x0092('0x28')]]={'$like':'%'+_0x577df1['query'][_0x0092('0x3d')]+'%'};return _0x57dc5a;}})});}_0x462387=_['merge']({},_0x462387,_0x577df1[_0x0092('0x3f')]);var _0x204787={'where':_0x462387[_0x0092('0x3b')]};return db[_0x0092('0x2a')][_0x0092('0x1f')](_0x204787)[_0x0092('0x24')](function(_0x478151){_0x131e75[_0x0092('0x1f')]=_0x478151;if(_0x577df1[_0x0092('0x32')]['includeAll']){_0x462387[_0x0092('0x40')]=[{'all':!![]}];}return db[_0x0092('0x2a')][_0x0092('0x41')](_0x462387);})[_0x0092('0x24')](function(_0x4934e8){_0x131e75[_0x0092('0x42')]=_0x4934e8;return _0x131e75;})[_0x0092('0x24')](respondWithFilteredResult(_0x5a6ca5,_0x462387))['catch'](handleError(_0x5a6ca5,null));};exports['show']=function(_0x96f1a1,_0x63fe21){var _0x5adb82={'raw':![],'where':{'id':_0x96f1a1[_0x0092('0x43')]['id']}},_0x2f1355={};_0x2f1355[_0x0092('0x2f')]=_[_0x0092('0x33')](db['VoiceRecording']['rawAttributes']);_0x2f1355[_0x0092('0x32')]=_[_0x0092('0x33')](_0x96f1a1[_0x0092('0x32')]);_0x2f1355['filters']=_[_0x0092('0x35')](_0x2f1355[_0x0092('0x2f')],_0x2f1355[_0x0092('0x32')]);_0x5adb82[_0x0092('0x36')]=_[_0x0092('0x35')](_0x2f1355[_0x0092('0x2f')],qs[_0x0092('0x37')](_0x96f1a1[_0x0092('0x32')]['fields']));_0x5adb82[_0x0092('0x36')]=_0x5adb82[_0x0092('0x36')][_0x0092('0x38')]?_0x5adb82[_0x0092('0x36')]:_0x2f1355[_0x0092('0x2f')];if(_0x96f1a1[_0x0092('0x32')]['includeAll']){_0x5adb82[_0x0092('0x40')]=[{'all':!![]}];}_0x5adb82=_[_0x0092('0x3e')]({},_0x5adb82,_0x96f1a1['options']);return db[_0x0092('0x2a')][_0x0092('0x44')](_0x5adb82)[_0x0092('0x24')](handleEntityNotFound(_0x63fe21,null))['then'](respondWithResult(_0x63fe21,null))[_0x0092('0x45')](handleError(_0x63fe21,null));};exports[_0x0092('0x46')]=function(_0x19fa98,_0x914a64){return db['VoiceRecording'][_0x0092('0x46')](_0x19fa98[_0x0092('0x47')],{})[_0x0092('0x24')](respondWithResult(_0x914a64,0xc9))['catch'](handleError(_0x914a64,null));};exports['update']=function(_0xa6fbc1,_0x56540c){if(_0xa6fbc1['body']['id']){delete _0xa6fbc1[_0x0092('0x47')]['id'];}return db[_0x0092('0x2a')][_0x0092('0x44')]({'where':{'id':_0xa6fbc1[_0x0092('0x43')]['id']}})['then'](handleEntityNotFound(_0x56540c,null))['then'](saveUpdates(_0xa6fbc1[_0x0092('0x47')],null))[_0x0092('0x24')](respondWithResult(_0x56540c,null))[_0x0092('0x45')](handleError(_0x56540c,null));};exports['describe']=function(_0x5127ce,_0x1c30e1){return db['VoiceRecording'][_0x0092('0x48')]()[_0x0092('0x24')](respondWithResult(_0x1c30e1,null))['catch'](handleError(_0x1c30e1,null));};exports[_0x0092('0x49')]=function(_0x5c7e36,_0x5c2707,_0x3da631){var _0x175c0b=require('../../components/encryptor');var _0xc7a54c=![];var _0x26eb06={};if(_0x5c7e36[_0x0092('0x32')][_0x0092('0x2d')]&&_0x5c7e36['query'][_0x0092('0x2d')]===_0x0092('0x4a')){_0x26eb06['uniqueid']=_0x5c7e36[_0x0092('0x43')]['id'];}else{_0x26eb06['id']=_0x5c7e36[_0x0092('0x43')]['id'];}return db[_0x0092('0x2a')][_0x0092('0x44')]({'where':_0x26eb06,'attributes':['id',_0x0092('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x5c2707,null))[_0x0092('0x24')](function(_0x38a9cc){if(_0x38a9cc){var _0x5c17e6=_0x38a9cc[_0x0092('0x4b')];var _0x4c99cd=util[_0x0092('0x31')](_0x0092('0x4c'),_0x5c17e6);if(fs[_0x0092('0x4d')](_0x4c99cd)){_0xc7a54c=!![];return _0x175c0b[_0x0092('0x4e')](_0x4c99cd,_0x5c17e6,config[_0x0092('0x4f')][_0x0092('0x50')])[_0x0092('0x24')](function(){return _0x38a9cc;});}return _0x38a9cc;}})['then'](function(_0x4e7c30){if(_0x4e7c30){var _0xde9e1a=_0x4e7c30[_0x0092('0x4b')];if(!fs[_0x0092('0x4d')](_0xde9e1a)){throw new db[(_0x0092('0x51'))]['ValidationError'](_0x0092('0x52'));}if(_0x4e7c30[_0x0092('0x53')]){return _0x5c2707['download'](_0xde9e1a,_0x4e7c30[_0x0092('0x53')]+path['extname'](_0xde9e1a),function(){if(_0xc7a54c){fs[_0x0092('0x54')](_0xde9e1a);}});}else{return _0x5c2707[_0x0092('0x49')](_0xde9e1a,function(_0x44f3b8){if(_0xc7a54c){fs['unlink'](_0xde9e1a);}});}}})[_0x0092('0x45')](function(_0x45a2c2){if(_0x45a2c2[_0x0092('0x55')]==='VoiceRecording\x20not\x20found'){_0x5c2707['status'](0x194)[_0x0092('0x56')](_0x0092('0x57'));}else{return handleError(_0x5c2707,null);}});};exports[_0x0092('0x58')]=function(_0x5a37e5,_0x132ec8,_0xa8c00b){var _0x1b24c7=require('../../components/encryptor');var _0x6d1b65=![];var _0x30184d={'$and':[db[_0x0092('0x59')][_0x0092('0x3b')](db['sequelize']['fn'](_0x0092('0x5a'),db['sequelize'][_0x0092('0x5b')](_0x0092('0x4a'))),_0x5a37e5['query'][_0x0092('0x5c')])]};if(_0x5a37e5[_0x0092('0x32')]['type']&&_0x5a37e5[_0x0092('0x32')][_0x0092('0x2d')]===_0x0092('0x4a')){_0x30184d[_0x0092('0x5d')][_0x0092('0x5e')]({'uniqueid':_0x5a37e5[_0x0092('0x43')]['id']});}else{_0x30184d[_0x0092('0x5d')][_0x0092('0x5e')]({'id':_0x5a37e5[_0x0092('0x43')]['id']});}return db[_0x0092('0x2a')][_0x0092('0x44')]({'where':_0x30184d,'attributes':['id','value'],'raw':!![]})[_0x0092('0x24')](handleEntityNotFound(_0x132ec8,null))[_0x0092('0x24')](function(_0x7efe13){if(_0x7efe13){var _0x3f7a4d=util[_0x0092('0x31')](_0x0092('0x4c'),_0x7efe13[_0x0092('0x4b')]);if(fs[_0x0092('0x4d')](_0x3f7a4d)){_0x6d1b65=!![];return _0x1b24c7[_0x0092('0x4e')](_0x3f7a4d,_0x7efe13[_0x0092('0x4b')],config[_0x0092('0x4f')]['recording'])[_0x0092('0x24')](function(){return _0x7efe13;});}return _0x7efe13;}})[_0x0092('0x24')](function(_0x5ac5f6){if(_0x5ac5f6){if(!fs[_0x0092('0x4d')](_0x5ac5f6[_0x0092('0x4b')])){throw new db[(_0x0092('0x51'))][(_0x0092('0x5f'))](_0x0092('0x52'));}if(_0x5ac5f6[_0x0092('0x53')]){return _0x132ec8[_0x0092('0x49')](_0x5ac5f6[_0x0092('0x4b')],_0x5ac5f6[_0x0092('0x53')]+path['extname'](_0x5ac5f6[_0x0092('0x4b')]),function(){if(_0x6d1b65){fs['unlink'](_0x5ac5f6[_0x0092('0x4b')]);}});}else{return _0x132ec8['download'](_0x5ac5f6['value'],function(_0xd15ecc){if(_0x6d1b65){fs['unlink'](_0x5ac5f6[_0x0092('0x4b')]);}});}}})[_0x0092('0x45')](handleError(_0x132ec8,null));};exports[_0x0092('0x60')]=function(_0x5456fc,_0x18d3ce){return db[_0x0092('0x2a')]['find']({'where':{'id':_0x5456fc[_0x0092('0x43')]['id']}})[_0x0092('0x24')](function(_0x5f3c45){if(_['isNil'](_0x5f3c45)){throw new ReferenceError(_0x0092('0x61'));}return _0x5f3c45;})['then'](function(_0xed0995){var _0x353570=_0xed0995[_0x0092('0x4b')];logger[_0x0092('0x62')](_0x0092('0x63'),_0x353570);if(!_[_0x0092('0x64')](_0xed0995[_0x0092('0x4b')])&&fs['existsSync'](_0x353570)){logger[_0x0092('0x62')](_0x0092('0x65')+_0x353570+_0x0092('0x66'));fs[_0x0092('0x67')](_0x353570);}_0x353570=_0x353570+'.cypher';if(!_[_0x0092('0x64')](_0xed0995['value'])&&fs['existsSync'](_0x353570)){logger[_0x0092('0x62')](_0x0092('0x65')+_0x353570+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x353570);}return _0xed0995;})[_0x0092('0x24')](function(_0x4bda79){if(!_0x4bda79)throw new InternalError();return _0x4bda79[_0x0092('0x60')]();})['then'](function(){_0x18d3ce[_0x0092('0x19')](0xcc)['end']();})[_0x0092('0x45')](handleError(_0x18d3ce,null));};function getBucketslist(_0x44f9d5,_0x21835e,_0x3defd4){return new Promise(function(_0x18b7a4,_0x2673ed){var _0x5c9ea7=new AWS['S3']({'accessKeyId':_0x21835e,'secretAccessKey':_0x44f9d5,'region':_0x3defd4});_0x5c9ea7[_0x0092('0x68')]({},function(_0x107102,_0x54a0be){if(_0x107102){return _0x2673ed(_0x107102);}else{return _0x18b7a4(_0x54a0be);}});});}function createBucket(_0x20ea4f,_0x32f747,_0x5d1460,_0x251f3a){return new Promise(function(_0x3fd654,_0x5114a5){var _0x63412e=new AWS['S3']({'accessKeyId':_0x32f747,'secretAccessKey':_0x20ea4f,'region':_0x5d1460});_0x63412e[_0x0092('0x69')]({'Bucket':_0x251f3a},function(_0x55826f,_0x4a8809){if(_0x55826f){return _0x5114a5(_0x55826f);}else{return _0x3fd654(_0x4a8809);}});});}function uploadFile(_0x6bfdde,_0x16db63,_0x2c6a8a,_0x38132c,_0x478fd6,_0x65401b){return new Promise(function(_0x5c9e37,_0x1388c5){var _0x9914ec=new AWS['S3']({'accessKeyId':_0x16db63,'secretAccessKey':_0x6bfdde,'region':_0x2c6a8a});_0x9914ec[_0x0092('0x6a')]({'Bucket':_0x38132c,'Key':_0x478fd6,'Body':_0x65401b},function(_0x41ab8b,_0x214657){if(_0x41ab8b){return _0x1388c5(_0x41ab8b);}else{return _0x5c9e37(_0x214657);}});});}function startTranscribe(_0xa90841,_0x37df9c,_0x2b279f,_0x2601ad,_0x269698,_0x5eca18){return new Promise(function(_0x96737a,_0x36a914){var _0x16a17a=new AWS['TranscribeService']({'accessKeyId':_0x37df9c,'secretAccessKey':_0xa90841,'region':_0x2b279f});_0x16a17a[_0x0092('0x6b')]({'TranscriptionJobName':_0x2601ad,'LanguageCode':_0x269698,'Media':{'MediaFileUri':_0x5eca18}},function(_0x4abb43,_0x8a53fe){if(_0x4abb43){return _0x36a914(_0x4abb43);}else{return _0x96737a(_0x8a53fe);}});});}function transcribe(_0x4efeca,_0x25ed77,_0x19e3cf,_0x24d6bf,_0x1a41de,_0x358d40,_0x33a4ce){return new Promise(function(_0x28170f,_0x4b025e){var _0x23961c={};logger['info'](util[_0x0092('0x31')](_0x0092('0x6c'),_0x4efeca,_0x1a41de));return uploadFile(_0x25ed77,_0x19e3cf,_0x24d6bf,_0x1a41de,path['basename'](_0x358d40),fs[_0x0092('0x6d')](_0x358d40))[_0x0092('0x24')](function(_0x5528f4){logger[_0x0092('0x62')](util[_0x0092('0x31')](_0x0092('0x6e'),_0x4efeca,_0x1a41de,_0x5528f4[_0x0092('0x6f')]));_0x23961c[_0x0092('0x70')]=_0x5528f4[_0x0092('0x71')];_0x23961c[_0x0092('0x72')]=_0x5528f4[_0x0092('0x6f')];logger[_0x0092('0x62')](util[_0x0092('0x31')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x4efeca));return startTranscribe(_0x25ed77,_0x19e3cf,_0x24d6bf,uuidv4(),_0x33a4ce,_0x5528f4[_0x0092('0x6f')]);})[_0x0092('0x24')](function(_0x50bc94){logger[_0x0092('0x62')](util[_0x0092('0x31')](_0x0092('0x73'),_0x4efeca,_0x50bc94[_0x0092('0x74')]['TranscriptionJobName']));_0x23961c[_0x0092('0x75')]=_0x50bc94[_0x0092('0x74')][_0x0092('0x76')];_0x23961c[_0x0092('0x77')]=_0x50bc94['TranscriptionJob'][_0x0092('0x78')];return _0x28170f(_0x23961c);})[_0x0092('0x45')](function(_0x5ac7e0){return _0x4b025e(_0x5ac7e0);});});}exports[_0x0092('0x79')]=function(_0x5827a9,_0x28c4ca,_0x251766){var _0x470c7a;var _0x202345;var _0x1a2803;var _0x4d5fae=require(_0x0092('0x7a'));return db[_0x0092('0x2a')]['findOne']({'where':{'id':_0x5827a9['params']['id']}})[_0x0092('0x24')](function(_0x1c9e4e){if(_0x1c9e4e){var _0x3bbf3a=util[_0x0092('0x31')](_0x0092('0x4c'),_0x1c9e4e[_0x0092('0x4b')]);if(fs[_0x0092('0x4d')](_0x3bbf3a)){cypher=!![];return _0x4d5fae[_0x0092('0x4e')](_0x3bbf3a,_0x1c9e4e[_0x0092('0x4b')],config['secrets']['recording'])['then'](function(){return _0x1c9e4e;});}return _0x1c9e4e;}})[_0x0092('0x24')](function(_0x2a74e3){if(!_0x2a74e3){throw new db[(_0x0092('0x51'))]['ValidationError'](_0x0092('0x7b'));}_0x202345=_0x2a74e3;return db[_0x0092('0x7c')][_0x0092('0x7d')]({'where':{'id':0x1}});})[_0x0092('0x24')](handleEntityNotFound(_0x28c4ca,null))[_0x0092('0x24')](function(_0x565478){if(_0x565478){_0x470c7a=_0x565478;if(!_0x470c7a[_0x0092('0x7e')]||!_0x470c7a[_0x0092('0x7f')]||!_0x470c7a['transcribeRegion']||!_0x470c7a[_0x0092('0x80')]||!_0x470c7a[_0x0092('0x70')]){throw new db[(_0x0092('0x51'))][(_0x0092('0x5f'))](_0x0092('0x81'));}if(_0x5827a9['body'][_0x0092('0x82')]&&(!_0x470c7a[_0x0092('0x83')]||!_0x470c7a[_0x0092('0x84')]||!_0x470c7a[_0x0092('0x85')]||!_0x470c7a[_0x0092('0x80')]||!_0x470c7a[_0x0092('0x70')])){throw new db[(_0x0092('0x51'))][(_0x0092('0x5f'))](_0x0092('0x86'));}return db['CloudProvider'][_0x0092('0x7d')]({'where':{'id':_0x470c7a['transcribeAccountId']}});}})[_0x0092('0x24')](function(_0x1646fe){if(!_0x1646fe){throw new db[(_0x0092('0x51'))][(_0x0092('0x5f'))](_0x0092('0x87'));}if(!_0x1646fe[_0x0092('0x88')]||!_0x1646fe[_0x0092('0x89')]){throw new db[(_0x0092('0x51'))]['ValidationError'](_0x0092('0x8a'));}_0x1a2803=_0x1646fe;return getBucketslist(_0x1a2803[_0x0092('0x88')],_0x1a2803[_0x0092('0x89')],_0x470c7a[_0x0092('0x8b')]);})['then'](function(_0x4d6873){if(_0x4d6873&&_0x4d6873['Buckets']){var _0x4bed88=_['find'](_0x4d6873[_0x0092('0x8c')],function(_0x2ca7df){return _0x2ca7df['Name']===_0x470c7a[_0x0092('0x70')];});if(!_0x4bed88){logger[_0x0092('0x62')](util[_0x0092('0x31')](_0x0092('0x8d'),_0x5827a9[_0x0092('0x43')]['id'],_0x470c7a[_0x0092('0x70')]));return createBucket(_0x1a2803[_0x0092('0x88')],_0x1a2803['data2'],_0x470c7a[_0x0092('0x8b')],_0x470c7a[_0x0092('0x70')]);}logger[_0x0092('0x62')](util['format'](_0x0092('0x8e'),_0x5827a9['params']['id'],_0x470c7a[_0x0092('0x70')]));return;}})['then'](function(_0x314412){if(_0x202345[_0x0092('0x77')]===_0x0092('0x8f')){return transcribe(_0x5827a9[_0x0092('0x43')]['id'],_0x1a2803['data1'],_0x1a2803['data2'],_0x470c7a['transcribeRegion'],_0x470c7a[_0x0092('0x70')],_0x202345[_0x0092('0x4b')],_0x470c7a['language']);}else{logger[_0x0092('0x62')](util[_0x0092('0x31')](_0x0092('0x90'),_0x5827a9[_0x0092('0x43')]['id']));return{'transcribeStatus':_0x0092('0x91')};}})[_0x0092('0x24')](function(_0x4075f7){if(_0x4075f7){_0x4075f7[_0x0092('0x92')]=_0x5827a9[_0x0092('0x47')][_0x0092('0x82')];return _0x202345[_0x0092('0x93')](_0x4075f7);}})[_0x0092('0x24')](respondWithResult(_0x28c4ca,null))['catch'](handleError(_0x28c4ca,null));};function writeFile(_0x2414fc,_0x1c0db4){return new Promise(function(_0x192663,_0x15ce97){fs[_0x0092('0x94')](_0x1c0db4,_0x2414fc,function(_0x2da39b,_0x252010){if(_0x2da39b){return _0x15ce97(_0x2da39b);}else{return _0x192663(_0x252010);}});});}exports[_0x0092('0x95')]=function(_0x143583,_0x48e4bf,_0x2a6b5e){return db[_0x0092('0x2a')][_0x0092('0x7d')]({'where':{'id':_0x143583[_0x0092('0x43')]['id']}})[_0x0092('0x24')](handleEntityNotFound(_0x48e4bf))['then'](function(_0x21ba98){if(_0x21ba98&&_0x21ba98[_0x0092('0x96')]){var _0x1e482e=_0x21ba98[_0x0092('0x96')];var _0x70231e=config[_0x0092('0x97')]+_0x0092('0x98')+_0x21ba98['id']+_0x0092('0x99');if(fs[_0x0092('0x4d')](_0x70231e)){return _0x70231e;}return writeFile(_0x1e482e,_0x70231e)[_0x0092('0x24')](function(){return _0x70231e;});}else{throw new db[(_0x0092('0x51'))][(_0x0092('0x5f'))](_0x0092('0x9a'));}})['then'](function(_0x173bb8){return _0x48e4bf[_0x0092('0x49')](_0x173bb8);})[_0x0092('0x45')](handleError(_0x48e4bf));}; \ No newline at end of file +var _0xa19d=['push','$and','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','upload','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','runSentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','map','format','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','findAll','catch','show','intersection','includeAll','include','find','create','body','params','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','col','token'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xa19d,0xd2));var _0xda19=function(_0x203860,_0xb97085){_0x203860=_0x203860-0x0;var _0x2df4e0=_0xa19d[_0x203860];return _0x2df4e0;};'use strict';var emlformat=require(_0xda19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda19('0x1'));var jsonpatch=require(_0xda19('0x2'));var rp=require(_0xda19('0x3'));var moment=require(_0xda19('0x4'));var BPromise=require(_0xda19('0x5'));var Mustache=require(_0xda19('0x6'));var util=require(_0xda19('0x7'));var path=require(_0xda19('0x8'));var sox=require(_0xda19('0x9'));var csv=require(_0xda19('0xa'));var ejs=require(_0xda19('0xb'));var fs=require('fs');var fs_extra=require(_0xda19('0xc'));var _=require(_0xda19('0xd'));var squel=require(_0xda19('0xe'));var crypto=require(_0xda19('0xf'));var jsforce=require(_0xda19('0x10'));var deskjs=require(_0xda19('0x11'));var toCsv=require(_0xda19('0xa'));var querystring=require('querystring');var Papa=require(_0xda19('0x12'));var AWS=require(_0xda19('0x13'));var uuidv4=require('uuid/v4');var Redis=require(_0xda19('0x14'));var authService=require(_0xda19('0x15'));var qs=require(_0xda19('0x16'));var as=require(_0xda19('0x17'));var hardwareService=require(_0xda19('0x18'));var logger=require(_0xda19('0x19'))('api');var utils=require('../../config/utils');var config=require(_0xda19('0x1a'));var licenseUtil=require(_0xda19('0x1b'));var db=require(_0xda19('0x1c'))['db'];function respondWithStatusCode(_0x346892,_0x16429d){_0x16429d=_0x16429d||0xcc;return function(_0x5f3569){if(_0x5f3569){return _0x346892['sendStatus'](_0x16429d);}return _0x346892['status'](_0x16429d)[_0xda19('0x1d')]();};}function respondWithResult(_0x40c024,_0x247fc3){_0x247fc3=_0x247fc3||0xc8;return function(_0x469c6d){if(_0x469c6d){return _0x40c024[_0xda19('0x1e')](_0x247fc3)[_0xda19('0x1f')](_0x469c6d);}};}function respondWithFilteredResult(_0x32b41e,_0x51b629){return function(_0x581b6f){if(_0x581b6f){var _0xb80ba=typeof _0x51b629[_0xda19('0x20')]===_0xda19('0x21')&&typeof _0x51b629[_0xda19('0x22')]==='undefined';var _0x19a08e=_0x581b6f['count'];var _0x2d32c1=_0xb80ba?0x0:_0x51b629[_0xda19('0x20')];var _0x36c3e7=_0xb80ba?_0x581b6f['count']:_0x51b629[_0xda19('0x20')]+_0x51b629['limit'];var _0x14b67e;if(_0x36c3e7>=_0x19a08e){_0x36c3e7=_0x19a08e;_0x14b67e=0xc8;}else{_0x14b67e=0xce;}_0x32b41e[_0xda19('0x1e')](_0x14b67e);return _0x32b41e[_0xda19('0x23')](_0xda19('0x24'),_0x2d32c1+'-'+_0x36c3e7+'/'+_0x19a08e)['json'](_0x581b6f);}return null;};}function patchUpdates(_0x4077fc){return function(_0x3ac085){try{jsonpatch[_0xda19('0x25')](_0x3ac085,_0x4077fc,!![]);}catch(_0x2e4aa0){return BPromise[_0xda19('0x26')](_0x2e4aa0);}return _0x3ac085[_0xda19('0x27')]();};}function saveUpdates(_0x592162,_0x443570){return function(_0x5951f9){if(_0x5951f9){return _0x5951f9[_0xda19('0x28')](_0x592162)[_0xda19('0x29')](function(_0x19c7ff){return _0x19c7ff;});}return null;};}function removeEntity(_0x328c4f,_0x4c5023){return function(_0x309ab2){if(_0x309ab2){return _0x309ab2[_0xda19('0x2a')]()[_0xda19('0x29')](function(){_0x328c4f[_0xda19('0x1e')](0xcc)[_0xda19('0x1d')]();});}};}function handleEntityNotFound(_0x564b85,_0x268e9e){return function(_0x53fb96){if(!_0x53fb96){_0x564b85[_0xda19('0x2b')](0x194);}return _0x53fb96;};}function handleError(_0x44d939,_0x86a8cb){_0x86a8cb=_0x86a8cb||0x1f4;return function(_0x25c680){logger[_0xda19('0x2c')](_0x25c680['stack']);if(_0x25c680[_0xda19('0x2d')]){delete _0x25c680[_0xda19('0x2d')];}_0x44d939['status'](_0x86a8cb)[_0xda19('0x2e')](_0x25c680);};}exports[_0xda19('0x2f')]=function(_0x45c172,_0x1c68c3){var _0x5694ed={},_0x3e2792={},_0xf00831={'count':0x0,'rows':[]};var _0x2e0dd3=_['map'](db[_0xda19('0x30')][_0xda19('0x31')],function(_0x5a3e7c){return{'name':_0x5a3e7c[_0xda19('0x32')],'type':_0x5a3e7c[_0xda19('0x33')][_0xda19('0x34')]};});_0x3e2792[_0xda19('0x35')]=_[_0xda19('0x36')](_[_0xda19('0x37')](_0x2e0dd3,_0xda19('0x2d')),[_0xda19('0x38')]);_0x3e2792['query']=_[_0xda19('0x39')](_0x45c172[_0xda19('0x3a')]);_0x3e2792[_0xda19('0x3b')]=_['intersection'](_0x3e2792[_0xda19('0x35')],_0x3e2792[_0xda19('0x3a')]);_0x5694ed[_0xda19('0x3c')]=_['intersection'](_0x3e2792['model'],qs[_0xda19('0x3d')](_0x45c172[_0xda19('0x3a')]['fields']));_0x5694ed[_0xda19('0x3c')]=_0x5694ed[_0xda19('0x3c')][_0xda19('0x3e')]?_0x5694ed[_0xda19('0x3c')]:_0x3e2792[_0xda19('0x35')];if(!_0x45c172[_0xda19('0x3a')]['hasOwnProperty'](_0xda19('0x3f'))){_0x5694ed['limit']=qs['limit'](_0x45c172[_0xda19('0x3a')][_0xda19('0x22')]);_0x5694ed[_0xda19('0x20')]=qs[_0xda19('0x20')](_0x45c172[_0xda19('0x3a')]['offset']);}_0x5694ed[_0xda19('0x40')]=qs[_0xda19('0x41')](_0x45c172[_0xda19('0x3a')][_0xda19('0x41')]);_0x5694ed[_0xda19('0x42')]=qs[_0xda19('0x3b')](_[_0xda19('0x43')](_0x45c172[_0xda19('0x3a')],_0x3e2792['filters']),_0x2e0dd3);if(_0x45c172['query'][_0xda19('0x44')]){_0x5694ed[_0xda19('0x42')]=_[_0xda19('0x45')](_0x5694ed['where'],{'$or':_[_0xda19('0x37')](_0x2e0dd3,function(_0x5e1558){if(_0x5e1558[_0xda19('0x33')]!==_0xda19('0x46')){var _0x314688={};_0x314688[_0x5e1558[_0xda19('0x2d')]]={'$like':'%'+_0x45c172[_0xda19('0x3a')]['filter']+'%'};return _0x314688;}})});}_0x5694ed=_[_0xda19('0x45')]({},_0x5694ed,_0x45c172[_0xda19('0x47')]);var _0x560337={'where':_0x5694ed[_0xda19('0x42')]};return db['VoiceRecording'][_0xda19('0x48')](_0x560337)[_0xda19('0x29')](function(_0x21ea86){_0xf00831[_0xda19('0x48')]=_0x21ea86;if(_0x45c172[_0xda19('0x3a')]['includeAll']){_0x5694ed['include']=[{'all':!![]}];}return db[_0xda19('0x30')][_0xda19('0x49')](_0x5694ed);})[_0xda19('0x29')](function(_0x10b9d5){_0xf00831['rows']=_0x10b9d5;return _0xf00831;})[_0xda19('0x29')](respondWithFilteredResult(_0x1c68c3,_0x5694ed))[_0xda19('0x4a')](handleError(_0x1c68c3,null));};exports[_0xda19('0x4b')]=function(_0x53667b,_0x4c5f35){var _0x5df210={'raw':![],'where':{'id':_0x53667b['params']['id']}},_0x45f736={};_0x45f736[_0xda19('0x35')]=_[_0xda19('0x39')](db['VoiceRecording'][_0xda19('0x31')]);_0x45f736[_0xda19('0x3a')]=_[_0xda19('0x39')](_0x53667b[_0xda19('0x3a')]);_0x45f736[_0xda19('0x3b')]=_[_0xda19('0x4c')](_0x45f736['model'],_0x45f736[_0xda19('0x3a')]);_0x5df210[_0xda19('0x3c')]=_['intersection'](_0x45f736[_0xda19('0x35')],qs['fields'](_0x53667b[_0xda19('0x3a')]['fields']));_0x5df210[_0xda19('0x3c')]=_0x5df210['attributes'][_0xda19('0x3e')]?_0x5df210[_0xda19('0x3c')]:_0x45f736[_0xda19('0x35')];if(_0x53667b[_0xda19('0x3a')][_0xda19('0x4d')]){_0x5df210[_0xda19('0x4e')]=[{'all':!![]}];}_0x5df210=_[_0xda19('0x45')]({},_0x5df210,_0x53667b[_0xda19('0x47')]);return db['VoiceRecording'][_0xda19('0x4f')](_0x5df210)[_0xda19('0x29')](handleEntityNotFound(_0x4c5f35,null))[_0xda19('0x29')](respondWithResult(_0x4c5f35,null))[_0xda19('0x4a')](handleError(_0x4c5f35,null));};exports[_0xda19('0x50')]=function(_0x1ce275,_0x27e540){return db[_0xda19('0x30')][_0xda19('0x50')](_0x1ce275[_0xda19('0x51')],{})[_0xda19('0x29')](respondWithResult(_0x27e540,0xc9))[_0xda19('0x4a')](handleError(_0x27e540,null));};exports[_0xda19('0x28')]=function(_0x1f8123,_0x900fca){if(_0x1f8123['body']['id']){delete _0x1f8123[_0xda19('0x51')]['id'];}return db['VoiceRecording'][_0xda19('0x4f')]({'where':{'id':_0x1f8123[_0xda19('0x52')]['id']}})[_0xda19('0x29')](handleEntityNotFound(_0x900fca,null))[_0xda19('0x29')](saveUpdates(_0x1f8123[_0xda19('0x51')],null))[_0xda19('0x29')](respondWithResult(_0x900fca,null))[_0xda19('0x4a')](handleError(_0x900fca,null));};exports['describe']=function(_0x47a0e7,_0x37f037){return db[_0xda19('0x30')]['describe']()[_0xda19('0x29')](respondWithResult(_0x37f037,null))[_0xda19('0x4a')](handleError(_0x37f037,null));};exports[_0xda19('0x53')]=function(_0xc0d5ee,_0x19ebdf,_0x360c45){var _0x261308=require(_0xda19('0x54'));var _0x58d463=![];var _0xcfdff7={};if(_0xc0d5ee[_0xda19('0x3a')][_0xda19('0x33')]&&_0xc0d5ee['query'][_0xda19('0x33')]===_0xda19('0x55')){_0xcfdff7['uniqueid']=_0xc0d5ee[_0xda19('0x52')]['id'];}else{_0xcfdff7['id']=_0xc0d5ee[_0xda19('0x52')]['id'];}return db['VoiceRecording'][_0xda19('0x4f')]({'where':_0xcfdff7,'attributes':['id',_0xda19('0x56')],'raw':!![]})[_0xda19('0x29')](handleEntityNotFound(_0x19ebdf,null))['then'](function(_0x373cc8){if(_0x373cc8){var _0x1a1402=_0x373cc8[_0xda19('0x56')];var _0x13946a=util[_0xda19('0x38')](_0xda19('0x57'),_0x1a1402);if(fs['existsSync'](_0x13946a)){_0x58d463=!![];return _0x261308[_0xda19('0x58')](_0x13946a,_0x1a1402,config[_0xda19('0x59')][_0xda19('0x5a')])[_0xda19('0x29')](function(){return _0x373cc8;});}return _0x373cc8;}})[_0xda19('0x29')](function(_0x2cdf51){if(_0x2cdf51){var _0x40de12=_0x2cdf51['value'];if(!fs[_0xda19('0x5b')](_0x40de12)){throw new db[(_0xda19('0x5c'))][(_0xda19('0x5d'))](_0xda19('0x5e'));}if(_0x2cdf51[_0xda19('0x5f')]){return _0x19ebdf[_0xda19('0x53')](_0x40de12,_0x2cdf51[_0xda19('0x5f')]+path[_0xda19('0x60')](_0x40de12),function(){if(_0x58d463){fs[_0xda19('0x61')](_0x40de12);}});}else{return _0x19ebdf['download'](_0x40de12,function(_0x3e24bf){if(_0x58d463){fs[_0xda19('0x61')](_0x40de12);}});}}})[_0xda19('0x4a')](function(_0x3289b6){if(_0x3289b6[_0xda19('0x62')]==='VoiceRecording\x20not\x20found'){_0x19ebdf['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x19ebdf,null);}});};exports[_0xda19('0x63')]=function(_0x3cd80a,_0x2db5cc,_0x2b9cde){var _0x5bc2aa=require(_0xda19('0x54'));var _0x13181e=![];var _0x1b620b={'$and':[db[_0xda19('0x64')][_0xda19('0x42')](db[_0xda19('0x64')]['fn'](_0xda19('0x65'),db[_0xda19('0x64')][_0xda19('0x66')](_0xda19('0x55'))),_0x3cd80a[_0xda19('0x3a')][_0xda19('0x67')])]};if(_0x3cd80a[_0xda19('0x3a')][_0xda19('0x33')]&&_0x3cd80a['query'][_0xda19('0x33')]==='uniqueid'){_0x1b620b['$and'][_0xda19('0x68')]({'uniqueid':_0x3cd80a[_0xda19('0x52')]['id']});}else{_0x1b620b[_0xda19('0x69')][_0xda19('0x68')]({'id':_0x3cd80a[_0xda19('0x52')]['id']});}return db[_0xda19('0x30')][_0xda19('0x4f')]({'where':_0x1b620b,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x2db5cc,null))['then'](function(_0x338451){if(_0x338451){var _0xb6d24b=util[_0xda19('0x38')](_0xda19('0x57'),_0x338451[_0xda19('0x56')]);if(fs[_0xda19('0x5b')](_0xb6d24b)){_0x13181e=!![];return _0x5bc2aa[_0xda19('0x58')](_0xb6d24b,_0x338451[_0xda19('0x56')],config[_0xda19('0x59')]['recording'])[_0xda19('0x29')](function(){return _0x338451;});}return _0x338451;}})[_0xda19('0x29')](function(_0x3daa8e){if(_0x3daa8e){if(!fs['existsSync'](_0x3daa8e[_0xda19('0x56')])){throw new db[(_0xda19('0x5c'))][(_0xda19('0x5d'))](_0xda19('0x5e'));}if(_0x3daa8e[_0xda19('0x5f')]){return _0x2db5cc[_0xda19('0x53')](_0x3daa8e[_0xda19('0x56')],_0x3daa8e[_0xda19('0x5f')]+path[_0xda19('0x60')](_0x3daa8e['value']),function(){if(_0x13181e){fs[_0xda19('0x61')](_0x3daa8e[_0xda19('0x56')]);}});}else{return _0x2db5cc['download'](_0x3daa8e[_0xda19('0x56')],function(_0xbb0774){if(_0x13181e){fs['unlink'](_0x3daa8e[_0xda19('0x56')]);}});}}})[_0xda19('0x4a')](handleError(_0x2db5cc,null));};exports[_0xda19('0x2a')]=function(_0xb9809,_0x44cfcb){return db['VoiceRecording']['find']({'where':{'id':_0xb9809[_0xda19('0x52')]['id']}})[_0xda19('0x29')](function(_0x169c00){if(_[_0xda19('0x6a')](_0x169c00)){throw new ReferenceError(_0xda19('0x6b'));}return _0x169c00;})[_0xda19('0x29')](function(_0x2316f7){var _0x5eaed6=_0x2316f7[_0xda19('0x56')];logger[_0xda19('0x6c')](_0xda19('0x6d'),_0x5eaed6);if(!_[_0xda19('0x6a')](_0x2316f7['value'])&&fs[_0xda19('0x5b')](_0x5eaed6)){logger[_0xda19('0x6c')](_0xda19('0x6e')+_0x5eaed6+_0xda19('0x6f'));fs['unlinkSync'](_0x5eaed6);}_0x5eaed6=_0x5eaed6+_0xda19('0x70');if(!_[_0xda19('0x6a')](_0x2316f7[_0xda19('0x56')])&&fs[_0xda19('0x5b')](_0x5eaed6)){logger[_0xda19('0x6c')](_0xda19('0x6e')+_0x5eaed6+_0xda19('0x6f'));fs[_0xda19('0x71')](_0x5eaed6);}return _0x2316f7;})[_0xda19('0x29')](function(_0x44c19e){if(!_0x44c19e)throw new InternalError();return _0x44c19e[_0xda19('0x2a')]();})[_0xda19('0x29')](function(){_0x44cfcb[_0xda19('0x1e')](0xcc)[_0xda19('0x1d')]();})[_0xda19('0x4a')](handleError(_0x44cfcb,null));};function getBucketslist(_0x40df0c,_0x4aeaef,_0x14b489){return new Promise(function(_0x15c719,_0x555011){var _0x46217e=new AWS['S3']({'accessKeyId':_0x4aeaef,'secretAccessKey':_0x40df0c,'region':_0x14b489});_0x46217e[_0xda19('0x72')]({},function(_0x499bfd,_0x1875b4){if(_0x499bfd){return _0x555011(_0x499bfd);}else{return _0x15c719(_0x1875b4);}});});}function createBucket(_0x4cc136,_0x5cce21,_0x8ec5f5,_0x58360b){return new Promise(function(_0x353588,_0x2102a9){var _0x50b08a=new AWS['S3']({'accessKeyId':_0x5cce21,'secretAccessKey':_0x4cc136,'region':_0x8ec5f5});_0x50b08a['createBucket']({'Bucket':_0x58360b},function(_0x35f5a1,_0x4e8ff2){if(_0x35f5a1){return _0x2102a9(_0x35f5a1);}else{return _0x353588(_0x4e8ff2);}});});}function uploadFile(_0x4f9d77,_0x5a674c,_0x599a05,_0xbe4df8,_0x5584b3,_0x31efc7){return new Promise(function(_0x5d2f9f,_0x28a7b2){var _0x1adc91=new AWS['S3']({'accessKeyId':_0x5a674c,'secretAccessKey':_0x4f9d77,'region':_0x599a05});_0x1adc91[_0xda19('0x73')]({'Bucket':_0xbe4df8,'Key':_0x5584b3,'Body':_0x31efc7},function(_0x463c33,_0x39c071){if(_0x463c33){return _0x28a7b2(_0x463c33);}else{return _0x5d2f9f(_0x39c071);}});});}function startTranscribe(_0x5153b1,_0x1403b4,_0x440eb6,_0x1e0106,_0x48591c,_0x342fc7){return new Promise(function(_0x378f43,_0x29646f){var _0x274915=new AWS['TranscribeService']({'accessKeyId':_0x1403b4,'secretAccessKey':_0x5153b1,'region':_0x440eb6});_0x274915[_0xda19('0x74')]({'TranscriptionJobName':_0x1e0106,'LanguageCode':_0x48591c,'Media':{'MediaFileUri':_0x342fc7}},function(_0x499735,_0x34dcf7){if(_0x499735){return _0x29646f(_0x499735);}else{return _0x378f43(_0x34dcf7);}});});}function transcribe(_0x2b5a16,_0x2490f6,_0x290d9,_0x53b850,_0x5b0748,_0x3599a1,_0xcb267d){return new Promise(function(_0x1f90cd,_0xe94556){var _0x587501={};logger[_0xda19('0x6c')](util[_0xda19('0x38')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x2b5a16,_0x5b0748));return uploadFile(_0x2490f6,_0x290d9,_0x53b850,_0x5b0748,path[_0xda19('0x75')](_0x3599a1),fs[_0xda19('0x76')](_0x3599a1))['then'](function(_0x3b9d9b){logger[_0xda19('0x6c')](util[_0xda19('0x38')](_0xda19('0x77'),_0x2b5a16,_0x5b0748,_0x3b9d9b[_0xda19('0x78')]));_0x587501[_0xda19('0x79')]=_0x3b9d9b[_0xda19('0x7a')];_0x587501['location']=_0x3b9d9b[_0xda19('0x78')];logger[_0xda19('0x6c')](util['format'](_0xda19('0x7b'),_0x2b5a16));return startTranscribe(_0x2490f6,_0x290d9,_0x53b850,uuidv4(),_0xcb267d,_0x3b9d9b[_0xda19('0x78')]);})[_0xda19('0x29')](function(_0xcb09ad){logger['info'](util['format'](_0xda19('0x7c'),_0x2b5a16,_0xcb09ad[_0xda19('0x7d')]['TranscriptionJobName']));_0x587501[_0xda19('0x7e')]=_0xcb09ad[_0xda19('0x7d')]['TranscriptionJobName'];_0x587501[_0xda19('0x7f')]=_0xcb09ad[_0xda19('0x7d')][_0xda19('0x80')];return _0x1f90cd(_0x587501);})['catch'](function(_0x4de803){return _0xe94556(_0x4de803);});});}exports['runTranscribe']=function(_0xacff2b,_0x47ba90,_0x360110){var _0x5c5b49;var _0x44a3a5;var _0x5c2995;var _0x3feaca=require(_0xda19('0x54'));return db[_0xda19('0x30')][_0xda19('0x81')]({'where':{'id':_0xacff2b[_0xda19('0x52')]['id']}})['then'](function(_0x5cbfd2){if(_0x5cbfd2){var _0x12500a=util[_0xda19('0x38')](_0xda19('0x57'),_0x5cbfd2[_0xda19('0x56')]);if(fs[_0xda19('0x5b')](_0x12500a)){cypher=!![];return _0x3feaca[_0xda19('0x58')](_0x12500a,_0x5cbfd2[_0xda19('0x56')],config['secrets'][_0xda19('0x5a')])[_0xda19('0x29')](function(){return _0x5cbfd2;});}return _0x5cbfd2;}})[_0xda19('0x29')](function(_0x44521d){if(!_0x44521d){throw new db[(_0xda19('0x5c'))][(_0xda19('0x5d'))](_0xda19('0x82'));}_0x44a3a5=_0x44521d;return db[_0xda19('0x83')][_0xda19('0x81')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x47ba90,null))[_0xda19('0x29')](function(_0x22c62c){if(_0x22c62c){_0x5c5b49=_0x22c62c;if(!_0x5c5b49[_0xda19('0x84')]||!_0x5c5b49[_0xda19('0x85')]||!_0x5c5b49['transcribeRegion']||!_0x5c5b49[_0xda19('0x86')]||!_0x5c5b49[_0xda19('0x79')]){throw new db[(_0xda19('0x5c'))]['ValidationError']('Transcribe\x20not\x20configured');}if(_0xacff2b['body'][_0xda19('0x87')]&&(!_0x5c5b49['sentiment']||!_0x5c5b49[_0xda19('0x88')]||!_0x5c5b49['sentimentRegion']||!_0x5c5b49[_0xda19('0x86')]||!_0x5c5b49['bucket'])){throw new db[(_0xda19('0x5c'))][(_0xda19('0x5d'))](_0xda19('0x89'));}return db[_0xda19('0x8a')][_0xda19('0x81')]({'where':{'id':_0x5c5b49['transcribeAccountId']}});}})[_0xda19('0x29')](function(_0x466a5a){if(!_0x466a5a){throw new db[(_0xda19('0x5c'))][(_0xda19('0x5d'))](_0xda19('0x8b'));}if(!_0x466a5a[_0xda19('0x8c')]||!_0x466a5a[_0xda19('0x8d')]){throw new db[(_0xda19('0x5c'))]['ValidationError'](_0xda19('0x8e'));}_0x5c2995=_0x466a5a;return getBucketslist(_0x5c2995['data1'],_0x5c2995[_0xda19('0x8d')],_0x5c5b49[_0xda19('0x8f')]);})[_0xda19('0x29')](function(_0x4abe0d){if(_0x4abe0d&&_0x4abe0d[_0xda19('0x90')]){var _0x2a8d64=_[_0xda19('0x4f')](_0x4abe0d['Buckets'],function(_0x152eb7){return _0x152eb7['Name']===_0x5c5b49[_0xda19('0x79')];});if(!_0x2a8d64){logger[_0xda19('0x6c')](util[_0xda19('0x38')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xacff2b[_0xda19('0x52')]['id'],_0x5c5b49['bucket']));return createBucket(_0x5c2995['data1'],_0x5c2995[_0xda19('0x8d')],_0x5c5b49['transcribeRegion'],_0x5c5b49[_0xda19('0x79')]);}logger[_0xda19('0x6c')](util[_0xda19('0x38')](_0xda19('0x91'),_0xacff2b[_0xda19('0x52')]['id'],_0x5c5b49[_0xda19('0x79')]));return;}})[_0xda19('0x29')](function(_0x28eeb8){if(_0x44a3a5[_0xda19('0x7f')]===_0xda19('0x92')){return transcribe(_0xacff2b[_0xda19('0x52')]['id'],_0x5c2995[_0xda19('0x8c')],_0x5c2995[_0xda19('0x8d')],_0x5c5b49[_0xda19('0x8f')],_0x5c5b49[_0xda19('0x79')],_0x44a3a5['value'],_0x5c5b49[_0xda19('0x86')]);}else{logger['info'](util[_0xda19('0x38')](_0xda19('0x93'),_0xacff2b[_0xda19('0x52')]['id']));return{'transcribeStatus':_0xda19('0x94')};}})[_0xda19('0x29')](function(_0xa6fdf5){if(_0xa6fdf5){_0xa6fdf5[_0xda19('0x95')]=_0xacff2b[_0xda19('0x51')][_0xda19('0x87')];return _0x44a3a5[_0xda19('0x96')](_0xa6fdf5);}})['then'](respondWithResult(_0x47ba90,null))[_0xda19('0x4a')](handleError(_0x47ba90,null));};function writeFile(_0x535b64,_0x512aab){return new Promise(function(_0x1ec9af,_0x57bd50){fs['writeFile'](_0x512aab,_0x535b64,function(_0x46544c,_0x2c500c){if(_0x46544c){return _0x57bd50(_0x46544c);}else{return _0x1ec9af(_0x2c500c);}});});}exports[_0xda19('0x97')]=function(_0x18c2e0,_0x2d79c3,_0x49afc5){return db['VoiceRecording'][_0xda19('0x81')]({'where':{'id':_0x18c2e0['params']['id']}})[_0xda19('0x29')](handleEntityNotFound(_0x2d79c3))['then'](function(_0x2d5630){if(_0x2d5630&&_0x2d5630['fileText']){var _0x39008f=_0x2d5630[_0xda19('0x98')];var _0x473fd1=config[_0xda19('0x99')]+_0xda19('0x9a')+_0x2d5630['id']+_0xda19('0x9b');if(fs[_0xda19('0x5b')](_0x473fd1)){return _0x473fd1;}return writeFile(_0x39008f,_0x473fd1)[_0xda19('0x29')](function(){return _0x473fd1;});}else{throw new db['Sequelize']['ValidationError'](_0xda19('0x9c'));}})[_0xda19('0x29')](function(_0x274f93){return _0x2d79c3[_0xda19('0x53')](_0x274f93);})['catch'](handleError(_0x2d79c3));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index e4beba3..b0c04a4 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 _0x9585=['uniqueid','transcribeStatus','exports','define','VoiceRecording','voice_recordings'];(function(_0x568528,_0x7dbd5){var _0x503dd6=function(_0x5f8f8d){while(--_0x5f8f8d){_0x568528['push'](_0x568528['shift']());}};_0x503dd6(++_0x7dbd5);}(_0x9585,0x15e));var _0x5958=function(_0x53d473,_0x5dc4a2){_0x53d473=_0x53d473-0x0;var _0x4a3bbe=_0x9585[_0x53d473];return _0x4a3bbe;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x5958('0x0')]=function(_0x57d84d,_0x35702f){return _0x57d84d[_0x5958('0x1')](_0x5958('0x2'),attributes,{'tableName':_0x5958('0x3'),'paranoid':![],'indexes':[{'name':_0x5958('0x4'),'fields':[_0x5958('0x4')]},{'name':_0x5958('0x5'),'fields':[_0x5958('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3074=['uniqueid','transcribeStatus','./voiceRecording.attributes','define','voice_recordings'];(function(_0x3d5342,_0x4b7737){var _0x5e003e=function(_0x11ed01){while(--_0x11ed01){_0x3d5342['push'](_0x3d5342['shift']());}};_0x5e003e(++_0x4b7737);}(_0x3074,0x1dd));var _0x4307=function(_0x296b9c,_0x10f865){_0x296b9c=_0x296b9c-0x0;var _0x582f3c=_0x3074[_0x296b9c];return _0x582f3c;};'use strict';var attributes=require(_0x4307('0x0'));module['exports']=function(_0x24f815,_0x393d68){return _0x24f815[_0x4307('0x1')]('VoiceRecording',attributes,{'tableName':_0x4307('0x2'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x4307('0x3')]},{'name':_0x4307('0x4'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 1902d10..dff2da7 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 _0x32f4=['unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','../../components/encryptor','findOne','callRecordingEncryption','existsSync','format','encryptFile','value','secrets','recording'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x32f4,0x154));var _0x432f=function(_0x33621f,_0x4abb3c){_0x33621f=_0x33621f-0x0;var _0x49013f=_0x32f4[_0x33621f];return _0x49013f;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});}exports[_0x432f('0x16')]=function(_0x243cf){var _0x3cd5da=this;return new Promise(function(_0x129582,_0x5ae24e){return db[_0x432f('0x17')]['update'](_0x243cf[_0x432f('0x18')],{'raw':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1b')]||null:null,'attributes':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1c')]||null:null,'limit':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')]['limit']||null:null})['then'](function(_0x343d13){logger['info'](_0x432f('0x16'),_0x243cf);logger['debug'](_0x432f('0x16'),_0x243cf,JSON[_0x432f('0x10')](_0x343d13));_0x129582(_0x343d13);})[_0x432f('0x15')](function(_0x89ea50){logger[_0x432f('0x11')](_0x432f('0x16'),_0x89ea50['message'],_0x243cf);_0x5ae24e(_0x3cd5da[_0x432f('0x11')](0x1f4,_0x89ea50[_0x432f('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x2cbde9){var _0x3e37ec=this;return new Promise(function(_0x2bcbb4,_0x23347e){var _0x44839=require(_0x432f('0x1d'));var _0x138a6a;return db['Setting'][_0x432f('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x432f('0xb')](function(_0x573cc5){_0x138a6a=_0x573cc5;return db[_0x432f('0x17')]['create'](_0x2cbde9[_0x432f('0x18')]);})['then'](function(_0x325a9c){if(_0x138a6a[_0x432f('0x1f')]&&fs[_0x432f('0x20')](_0x325a9c['value'])){var _0x6a116e=util[_0x432f('0x21')]('%s.cypher',_0x325a9c['value']);return _0x44839[_0x432f('0x22')](_0x325a9c[_0x432f('0x23')],_0x6a116e,config[_0x432f('0x24')][_0x432f('0x25')])[_0x432f('0xb')](function(){fs[_0x432f('0x26')](_0x325a9c['value']);logger['info'](_0x432f('0x27'));return _0x325a9c;});}return _0x325a9c;})[_0x432f('0xb')](function(_0x184203){logger['info'](_0x432f('0x28'),_0x2cbde9);logger[_0x432f('0x29')](_0x432f('0x28'),_0x2cbde9,JSON[_0x432f('0x10')](_0x184203));_0x2bcbb4(_0x184203);})[_0x432f('0x15')](function(_0x3ad632){logger[_0x432f('0x11')](_0x432f('0x28'),_0x3ad632['message'],_0x2cbde9);_0x23347e(_0x3e37ec['error'](0x1f4,_0x3ad632[_0x432f('0x13')]));});});}; \ No newline at end of file +var _0x7b84=['VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','recording','unlink','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7b84,0x17c));var _0x47b8=function(_0x3b1c3f,_0x12c51c){_0x3b1c3f=_0x3b1c3f-0x0;var _0xdeb841=_0x7b84[_0x3b1c3f];return _0xdeb841;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('VoiceRecording,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});}exports['UpdateVoiceRecording']=function(_0x4f7317){var _0x299195=this;return new Promise(function(_0x36faf1,_0x2797ac){return db['VoiceRecording']['update'](_0x4f7317['body'],{'raw':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317['options'][_0x47b8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1c')]||null:null,'attributes':_0x4f7317['options']?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1d')]||null:null,'limit':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1e')]||null:null})[_0x47b8('0xe')](function(_0x54f6bc){logger[_0x47b8('0xf')](_0x47b8('0x1f'),_0x4f7317);logger['debug'](_0x47b8('0x1f'),_0x4f7317,JSON[_0x47b8('0x14')](_0x54f6bc));_0x36faf1(_0x54f6bc);})[_0x47b8('0x19')](function(_0x142fb6){logger['error'](_0x47b8('0x1f'),_0x142fb6[_0x47b8('0x17')],_0x4f7317);_0x2797ac(_0x299195[_0x47b8('0x15')](0x1f4,_0x142fb6[_0x47b8('0x17')]));});});};exports[_0x47b8('0x20')]=function(_0xbf5ce9){var _0x40918f=this;return new Promise(function(_0x568c1e,_0x43fd49){var _0x1f719a=require('../../components/encryptor');var _0x195a66;return db[_0x47b8('0x21')][_0x47b8('0x22')]({'attributes':['id',_0x47b8('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x162d96){_0x195a66=_0x162d96;return db['VoiceRecording'][_0x47b8('0x24')](_0xbf5ce9[_0x47b8('0x25')]);})[_0x47b8('0xe')](function(_0x2e540d){if(_0x195a66['callRecordingEncryption']&&fs[_0x47b8('0x26')](_0x2e540d[_0x47b8('0x27')])){var _0x402e7c=util[_0x47b8('0x28')](_0x47b8('0x29'),_0x2e540d[_0x47b8('0x27')]);return _0x1f719a['encryptFile'](_0x2e540d['value'],_0x402e7c,config['secrets'][_0x47b8('0x2a')])[_0x47b8('0xe')](function(){fs[_0x47b8('0x2b')](_0x2e540d['value']);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x2e540d;});}return _0x2e540d;})['then'](function(_0x347769){logger[_0x47b8('0xf')](_0x47b8('0x20'),_0xbf5ce9);logger[_0x47b8('0x12')](_0x47b8('0x20'),_0xbf5ce9,JSON[_0x47b8('0x14')](_0x347769));_0x568c1e(_0x347769);})[_0x47b8('0x19')](function(_0x460dcc){logger[_0x47b8('0x15')]('CreateVoiceRecording',_0x460dcc['message'],_0xbf5ce9);_0x43fd49(_0x40918f[_0x47b8('0x15')](0x1f4,_0x460dcc[_0x47b8('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index f3aca77..7a162f6 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 _0x709f=['../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','destroy','exports','multer','path','connect-timeout','fs-extra'];(function(_0x591680,_0x262c13){var _0x1d62bd=function(_0x7b1fd3){while(--_0x7b1fd3){_0x591680['push'](_0x591680['shift']());}};_0x1d62bd(++_0x262c13);}(_0x709f,0x152));var _0xf709=function(_0x565c4e,_0x1e77f9){_0x565c4e=_0x565c4e-0x0;var _0x4a167f=_0x709f[_0x565c4e];return _0x4a167f;};'use strict';var multer=require(_0xf709('0x0'));var util=require('util');var path=require(_0xf709('0x1'));var timeout=require(_0xf709('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf709('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf709('0x4'));var config=require(_0xf709('0x5'));var controller=require(_0xf709('0x6'));router[_0xf709('0x7')]('/',auth[_0xf709('0x8')](),controller[_0xf709('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf709('0xa')]);router['get'](_0xf709('0xb'),auth[_0xf709('0x8')](),controller[_0xf709('0xc')]);router[_0xf709('0xd')]('/',auth[_0xf709('0x8')](),controller[_0xf709('0xe')]);router[_0xf709('0xf')]('/:id',auth[_0xf709('0x8')](),controller['update']);router['delete'](_0xf709('0xb'),auth[_0xf709('0x8')](),controller[_0xf709('0x10')]);module[_0xf709('0x11')]=router; \ No newline at end of file +var _0xe1b9=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','util'];(function(_0x55cec3,_0x2babdc){var _0x1e8a4a=function(_0x336e1e){while(--_0x336e1e){_0x55cec3['push'](_0x55cec3['shift']());}};_0x1e8a4a(++_0x2babdc);}(_0xe1b9,0x7c));var _0x9e1b=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xe1b9[_0x599f41];return _0x2e4d58;};'use strict';var multer=require(_0x9e1b('0x0'));var util=require(_0x9e1b('0x1'));var path=require(_0x9e1b('0x2'));var timeout=require(_0x9e1b('0x3'));var express=require('express');var router=express[_0x9e1b('0x4')]();var fs_extra=require(_0x9e1b('0x5'));var auth=require(_0x9e1b('0x6'));var interaction=require(_0x9e1b('0x7'));var config=require(_0x9e1b('0x8'));var controller=require(_0x9e1b('0x9'));router[_0x9e1b('0xa')]('/',auth['isAuthenticated'](),controller[_0x9e1b('0xb')]);router[_0x9e1b('0xa')]('/describe',auth[_0x9e1b('0xc')](),controller[_0x9e1b('0xd')]);router['get'](_0x9e1b('0xe'),auth[_0x9e1b('0xc')](),controller[_0x9e1b('0xf')]);router[_0x9e1b('0x10')]('/',auth[_0x9e1b('0xc')](),controller[_0x9e1b('0x11')]);router['put']('/:id',auth[_0x9e1b('0xc')](),controller[_0x9e1b('0x12')]);router[_0x9e1b('0x13')](_0x9e1b('0xe'),auth[_0x9e1b('0xc')](),controller[_0x9e1b('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index b112490..8064c0b 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 _0x8aac=['sequelize','moment','exports','blind','attended','STRING','ENUM'];(function(_0x6f984c,_0x70b507){var _0x44f6f2=function(_0xb7c35a){while(--_0xb7c35a){_0x6f984c['push'](_0x6f984c['shift']());}};_0x44f6f2(++_0x70b507);}(_0x8aac,0x1b2));var _0xc8aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aac[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc8aa('0x0'));var moment=require(_0xc8aa('0x1'));module[_0xc8aa('0x2')]={'type':{'type':Sequelize['ENUM'](_0xc8aa('0x3'),_0xc8aa('0x4'))},'result':{'type':Sequelize[_0xc8aa('0x5')]},'transfererchannel':{'type':Sequelize[_0xc8aa('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xc8aa('0x5')]},'transferercalleridname':{'type':Sequelize[_0xc8aa('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xc8aa('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xc8aa('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xc8aa('0x5')]},'transferercontext':{'type':Sequelize[_0xc8aa('0x5')]},'transfererexten':{'type':Sequelize[_0xc8aa('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xc8aa('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xc8aa('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xc8aa('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xc8aa('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xc8aa('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xc8aa('0x5')]},'transfereeexten':{'type':Sequelize[_0xc8aa('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xc8aa('0x5')]},'isexternal':{'type':Sequelize[_0xc8aa('0x6')]('Yes','No')},'context':{'type':Sequelize[_0xc8aa('0x5')]},'extension':{'type':Sequelize[_0xc8aa('0x5')]}}; \ No newline at end of file +var _0x6a56=['blind','STRING','Yes'];(function(_0x5025f1,_0x1b9cc3){var _0x3e6315=function(_0x111a32){while(--_0x111a32){_0x5025f1['push'](_0x5025f1['shift']());}};_0x3e6315(++_0x1b9cc3);}(_0x6a56,0x162));var _0x66a5=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0x6a56[_0x5179a5];return _0x15c8ce;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize['ENUM'](_0x66a5('0x0'),'attended')},'result':{'type':Sequelize[_0x66a5('0x1')]},'transfererchannel':{'type':Sequelize[_0x66a5('0x1')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x66a5('0x1')]},'transfererconnectedlinenum':{'type':Sequelize[_0x66a5('0x1')]},'transfererconnectedlinename':{'type':Sequelize[_0x66a5('0x1')]},'transfereraccountcode':{'type':Sequelize[_0x66a5('0x1')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x66a5('0x1')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x66a5('0x1')]},'transfereecalleridnum':{'type':Sequelize[_0x66a5('0x1')]},'transfereecalleridname':{'type':Sequelize[_0x66a5('0x1')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x66a5('0x1')]},'transfereeconnectedlinename':{'type':Sequelize[_0x66a5('0x1')]},'transfereeaccountcode':{'type':Sequelize[_0x66a5('0x1')]},'transfereecontext':{'type':Sequelize[_0x66a5('0x1')]},'transfereeexten':{'type':Sequelize[_0x66a5('0x1')]},'transfereelinkedid':{'type':Sequelize[_0x66a5('0x1')]},'isexternal':{'type':Sequelize['ENUM'](_0x66a5('0x2'),'No')},'context':{'type':Sequelize[_0x66a5('0x1')]},'extension':{'type':Sequelize[_0x66a5('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index f8ac393..dd58b65 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 _0x5bba=['pick','filter','where','VIRTUAL','merge','options','VoiceTransferReport','includeAll','include','rows','catch','show','params','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x5bba,0x1d4));var _0xa5bb=function(_0x340199,_0x1028b0){_0x340199=_0x340199-0x0;var _0x40c7cc=_0x5bba[_0x340199];return _0x40c7cc;};'use strict';var emlformat=require(_0xa5bb('0x0'));var rimraf=require(_0xa5bb('0x1'));var zipdir=require(_0xa5bb('0x2'));var jsonpatch=require(_0xa5bb('0x3'));var rp=require(_0xa5bb('0x4'));var moment=require('moment');var BPromise=require(_0xa5bb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa5bb('0x6'));var csv=require('to-csv');var ejs=require(_0xa5bb('0x7'));var fs=require('fs');var fs_extra=require(_0xa5bb('0x8'));var _=require(_0xa5bb('0x9'));var squel=require(_0xa5bb('0xa'));var crypto=require(_0xa5bb('0xb'));var jsforce=require(_0xa5bb('0xc'));var deskjs=require(_0xa5bb('0xd'));var toCsv=require(_0xa5bb('0xe'));var querystring=require(_0xa5bb('0xf'));var Papa=require(_0xa5bb('0x10'));var Redis=require(_0xa5bb('0x11'));var authService=require(_0xa5bb('0x12'));var qs=require(_0xa5bb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5bb('0x14'))(_0xa5bb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa5bb('0x16'));var db=require(_0xa5bb('0x17'))['db'];function respondWithStatusCode(_0x1daf07,_0x4f8986){_0x4f8986=_0x4f8986||0xcc;return function(_0x53600e){if(_0x53600e){return _0x1daf07[_0xa5bb('0x18')](_0x4f8986);}return _0x1daf07[_0xa5bb('0x19')](_0x4f8986)['end']();};}function respondWithResult(_0x47bfc6,_0x505c22){_0x505c22=_0x505c22||0xc8;return function(_0x1faa31){if(_0x1faa31){return _0x47bfc6[_0xa5bb('0x19')](_0x505c22)[_0xa5bb('0x1a')](_0x1faa31);}};}function respondWithFilteredResult(_0x3dfaef,_0x376355){return function(_0x4cc8bb){if(_0x4cc8bb){var _0x13693e=typeof _0x376355[_0xa5bb('0x1b')]===_0xa5bb('0x1c')&&typeof _0x376355[_0xa5bb('0x1d')]==='undefined';var _0x35267b=_0x4cc8bb[_0xa5bb('0x1e')];var _0x509190=_0x13693e?0x0:_0x376355[_0xa5bb('0x1b')];var _0xa273e1=_0x13693e?_0x4cc8bb[_0xa5bb('0x1e')]:_0x376355['offset']+_0x376355[_0xa5bb('0x1d')];var _0x18af72;if(_0xa273e1>=_0x35267b){_0xa273e1=_0x35267b;_0x18af72=0xc8;}else{_0x18af72=0xce;}_0x3dfaef['status'](_0x18af72);return _0x3dfaef[_0xa5bb('0x1f')](_0xa5bb('0x20'),_0x509190+'-'+_0xa273e1+'/'+_0x35267b)['json'](_0x4cc8bb);}return null;};}function patchUpdates(_0x4893c7){return function(_0xd5732f){try{jsonpatch['apply'](_0xd5732f,_0x4893c7,!![]);}catch(_0x37a4e6){return BPromise[_0xa5bb('0x21')](_0x37a4e6);}return _0xd5732f[_0xa5bb('0x22')]();};}function saveUpdates(_0x32dc28,_0x2dcab9){return function(_0x4a17cb){if(_0x4a17cb){return _0x4a17cb['update'](_0x32dc28)[_0xa5bb('0x23')](function(_0x25ce13){return _0x25ce13;});}return null;};}function removeEntity(_0x400690,_0x10c22c){return function(_0x37bf1e){if(_0x37bf1e){return _0x37bf1e[_0xa5bb('0x24')]()[_0xa5bb('0x23')](function(){_0x400690[_0xa5bb('0x19')](0xcc)[_0xa5bb('0x25')]();});}};}function handleEntityNotFound(_0x250057,_0x27cf4e){return function(_0x3724cc){if(!_0x3724cc){_0x250057[_0xa5bb('0x18')](0x194);}return _0x3724cc;};}function handleError(_0x5e334e,_0x3e777f){_0x3e777f=_0x3e777f||0x1f4;return function(_0x5e170a){logger['error'](_0x5e170a[_0xa5bb('0x26')]);if(_0x5e170a['name']){delete _0x5e170a[_0xa5bb('0x27')];}_0x5e334e[_0xa5bb('0x19')](_0x3e777f)['send'](_0x5e170a);};}exports[_0xa5bb('0x28')]=function(_0x126fdb,_0x2f546f){var _0x5d450a={},_0x317311={},_0x124aa8={'count':0x0,'rows':[]};var _0x41003b=_[_0xa5bb('0x29')](db['VoiceTransferReport'][_0xa5bb('0x2a')],function(_0x53edf4){return{'name':_0x53edf4[_0xa5bb('0x2b')],'type':_0x53edf4[_0xa5bb('0x2c')][_0xa5bb('0x2d')]};});_0x317311['model']=_['map'](_0x41003b,_0xa5bb('0x27'));_0x317311[_0xa5bb('0x2e')]=_[_0xa5bb('0x2f')](_0x126fdb[_0xa5bb('0x2e')]);_0x317311[_0xa5bb('0x30')]=_[_0xa5bb('0x31')](_0x317311[_0xa5bb('0x32')],_0x317311[_0xa5bb('0x2e')]);_0x5d450a[_0xa5bb('0x33')]=_[_0xa5bb('0x31')](_0x317311[_0xa5bb('0x32')],qs[_0xa5bb('0x34')](_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x34')]));_0x5d450a[_0xa5bb('0x33')]=_0x5d450a[_0xa5bb('0x33')][_0xa5bb('0x35')]?_0x5d450a[_0xa5bb('0x33')]:_0x317311['model'];if(!_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x36')]('nolimit')){_0x5d450a[_0xa5bb('0x1d')]=qs[_0xa5bb('0x1d')](_0x126fdb[_0xa5bb('0x2e')]['limit']);_0x5d450a['offset']=qs[_0xa5bb('0x1b')](_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x1b')]);}_0x5d450a[_0xa5bb('0x37')]=qs[_0xa5bb('0x38')](_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x38')]);_0x5d450a['where']=qs[_0xa5bb('0x30')](_[_0xa5bb('0x39')](_0x126fdb[_0xa5bb('0x2e')],_0x317311['filters']),_0x41003b);if(_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x3a')]){_0x5d450a[_0xa5bb('0x3b')]=_['merge'](_0x5d450a[_0xa5bb('0x3b')],{'$or':_[_0xa5bb('0x29')](_0x41003b,function(_0x3974eb){if(_0x3974eb['type']!==_0xa5bb('0x3c')){var _0x9a05b2={};_0x9a05b2[_0x3974eb['name']]={'$like':'%'+_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x3a')]+'%'};return _0x9a05b2;}})});}_0x5d450a=_[_0xa5bb('0x3d')]({},_0x5d450a,_0x126fdb[_0xa5bb('0x3e')]);var _0x1ca7d4={'where':_0x5d450a[_0xa5bb('0x3b')]};return db[_0xa5bb('0x3f')][_0xa5bb('0x1e')](_0x1ca7d4)['then'](function(_0xea9a24){_0x124aa8[_0xa5bb('0x1e')]=_0xea9a24;if(_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x40')]){_0x5d450a[_0xa5bb('0x41')]=[{'all':!![]}];}return db[_0xa5bb('0x3f')]['findAll'](_0x5d450a);})['then'](function(_0x51c53e){_0x124aa8[_0xa5bb('0x42')]=_0x51c53e;return _0x124aa8;})[_0xa5bb('0x23')](respondWithFilteredResult(_0x2f546f,_0x5d450a))[_0xa5bb('0x43')](handleError(_0x2f546f,null));};exports[_0xa5bb('0x44')]=function(_0x5fd942,_0x152ab5){var _0xf9e077={'raw':!![],'where':{'id':_0x5fd942[_0xa5bb('0x45')]['id']}},_0xef0f5f={};_0xef0f5f[_0xa5bb('0x32')]=_[_0xa5bb('0x2f')](db[_0xa5bb('0x3f')][_0xa5bb('0x2a')]);_0xef0f5f[_0xa5bb('0x2e')]=_[_0xa5bb('0x2f')](_0x5fd942[_0xa5bb('0x2e')]);_0xef0f5f[_0xa5bb('0x30')]=_[_0xa5bb('0x31')](_0xef0f5f[_0xa5bb('0x32')],_0xef0f5f[_0xa5bb('0x2e')]);_0xf9e077[_0xa5bb('0x33')]=_['intersection'](_0xef0f5f[_0xa5bb('0x32')],qs[_0xa5bb('0x34')](_0x5fd942[_0xa5bb('0x2e')]['fields']));_0xf9e077[_0xa5bb('0x33')]=_0xf9e077['attributes'][_0xa5bb('0x35')]?_0xf9e077[_0xa5bb('0x33')]:_0xef0f5f['model'];if(_0x5fd942[_0xa5bb('0x2e')][_0xa5bb('0x40')]){_0xf9e077['include']=[{'all':!![]}];}_0xf9e077=_['merge']({},_0xf9e077,_0x5fd942[_0xa5bb('0x3e')]);return db[_0xa5bb('0x3f')]['find'](_0xf9e077)[_0xa5bb('0x23')](handleEntityNotFound(_0x152ab5,null))['then'](respondWithResult(_0x152ab5,null))[_0xa5bb('0x43')](handleError(_0x152ab5,null));};exports[_0xa5bb('0x46')]=function(_0x402c05,_0x319064){return db[_0xa5bb('0x3f')][_0xa5bb('0x46')](_0x402c05[_0xa5bb('0x47')],{})[_0xa5bb('0x23')](respondWithResult(_0x319064,0xc9))[_0xa5bb('0x43')](handleError(_0x319064,null));};exports[_0xa5bb('0x48')]=function(_0x1e3f5e,_0x59b5a5){if(_0x1e3f5e['body']['id']){delete _0x1e3f5e[_0xa5bb('0x47')]['id'];}return db[_0xa5bb('0x3f')][_0xa5bb('0x49')]({'where':{'id':_0x1e3f5e[_0xa5bb('0x45')]['id']}})[_0xa5bb('0x23')](handleEntityNotFound(_0x59b5a5,null))['then'](saveUpdates(_0x1e3f5e[_0xa5bb('0x47')],null))[_0xa5bb('0x23')](respondWithResult(_0x59b5a5,null))['catch'](handleError(_0x59b5a5,null));};exports['destroy']=function(_0x1499cd,_0x3a588){return db[_0xa5bb('0x3f')][_0xa5bb('0x49')]({'where':{'id':_0x1499cd[_0xa5bb('0x45')]['id']}})[_0xa5bb('0x23')](handleEntityNotFound(_0x3a588,null))[_0xa5bb('0x23')](removeEntity(_0x3a588,null))[_0xa5bb('0x43')](handleError(_0x3a588,null));};exports[_0xa5bb('0x4a')]=function(_0x46a811,_0x3aadf3){return db[_0xa5bb('0x3f')][_0xa5bb('0x4a')]()[_0xa5bb('0x23')](respondWithResult(_0x3aadf3,null))[_0xa5bb('0x43')](handleError(_0x3aadf3,null));}; \ No newline at end of file +var _0xd766=['sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x58c66a,_0x76a652){var _0x1cd537=function(_0xcaf626){while(--_0xcaf626){_0x58c66a['push'](_0x58c66a['shift']());}};_0x1cd537(++_0x76a652);}(_0xd766,0x126));var _0x6d76=function(_0x274f14,_0x27dd7f){_0x274f14=_0x274f14-0x0;var _0x13b97e=_0xd766[_0x274f14];return _0x13b97e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6d76('0x0'));var jsonpatch=require(_0x6d76('0x1'));var rp=require(_0x6d76('0x2'));var moment=require(_0x6d76('0x3'));var BPromise=require(_0x6d76('0x4'));var Mustache=require('mustache');var util=require(_0x6d76('0x5'));var path=require('path');var sox=require(_0x6d76('0x6'));var csv=require(_0x6d76('0x7'));var ejs=require(_0x6d76('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d76('0x9'));var squel=require(_0x6d76('0xa'));var crypto=require(_0x6d76('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6d76('0xc'));var toCsv=require(_0x6d76('0x7'));var querystring=require('querystring');var Papa=require(_0x6d76('0xd'));var Redis=require(_0x6d76('0xe'));var authService=require(_0x6d76('0xf'));var qs=require(_0x6d76('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d76('0x11'))(_0x6d76('0x12'));var utils=require('../../config/utils');var config=require(_0x6d76('0x13'));var licenseUtil=require(_0x6d76('0x14'));var db=require(_0x6d76('0x15'))['db'];function respondWithStatusCode(_0x18fbe4,_0x3c9353){_0x3c9353=_0x3c9353||0xcc;return function(_0x18de7d){if(_0x18de7d){return _0x18fbe4[_0x6d76('0x16')](_0x3c9353);}return _0x18fbe4[_0x6d76('0x17')](_0x3c9353)[_0x6d76('0x18')]();};}function respondWithResult(_0x2de3c3,_0x46be82){_0x46be82=_0x46be82||0xc8;return function(_0x42bfb9){if(_0x42bfb9){return _0x2de3c3[_0x6d76('0x17')](_0x46be82)[_0x6d76('0x19')](_0x42bfb9);}};}function respondWithFilteredResult(_0x39e11e,_0x1dab83){return function(_0x334ac2){if(_0x334ac2){var _0x265566=typeof _0x1dab83[_0x6d76('0x1a')]===_0x6d76('0x1b')&&typeof _0x1dab83[_0x6d76('0x1c')]==='undefined';var _0x1fc6e4=_0x334ac2[_0x6d76('0x1d')];var _0x47784f=_0x265566?0x0:_0x1dab83[_0x6d76('0x1a')];var _0x7ff910=_0x265566?_0x334ac2[_0x6d76('0x1d')]:_0x1dab83[_0x6d76('0x1a')]+_0x1dab83['limit'];var _0x38bdb5;if(_0x7ff910>=_0x1fc6e4){_0x7ff910=_0x1fc6e4;_0x38bdb5=0xc8;}else{_0x38bdb5=0xce;}_0x39e11e[_0x6d76('0x17')](_0x38bdb5);return _0x39e11e[_0x6d76('0x1e')](_0x6d76('0x1f'),_0x47784f+'-'+_0x7ff910+'/'+_0x1fc6e4)['json'](_0x334ac2);}return null;};}function patchUpdates(_0x1ce6a0){return function(_0x49d218){try{jsonpatch[_0x6d76('0x20')](_0x49d218,_0x1ce6a0,!![]);}catch(_0x45a6e3){return BPromise[_0x6d76('0x21')](_0x45a6e3);}return _0x49d218[_0x6d76('0x22')]();};}function saveUpdates(_0x3b5b8e,_0x387ca1){return function(_0x5d1cc1){if(_0x5d1cc1){return _0x5d1cc1[_0x6d76('0x23')](_0x3b5b8e)[_0x6d76('0x24')](function(_0x3e01a7){return _0x3e01a7;});}return null;};}function removeEntity(_0xc0e606,_0x3fdfb6){return function(_0x3c1173){if(_0x3c1173){return _0x3c1173['destroy']()[_0x6d76('0x24')](function(){_0xc0e606[_0x6d76('0x17')](0xcc)[_0x6d76('0x18')]();});}};}function handleEntityNotFound(_0x2ba852,_0x5b01bf){return function(_0x2496c1){if(!_0x2496c1){_0x2ba852[_0x6d76('0x16')](0x194);}return _0x2496c1;};}function handleError(_0x549425,_0x241852){_0x241852=_0x241852||0x1f4;return function(_0x236e4d){logger['error'](_0x236e4d[_0x6d76('0x25')]);if(_0x236e4d['name']){delete _0x236e4d['name'];}_0x549425[_0x6d76('0x17')](_0x241852)[_0x6d76('0x26')](_0x236e4d);};}exports[_0x6d76('0x27')]=function(_0x568c0a,_0x54412f){var _0x433455={},_0x137b96={},_0x391c50={'count':0x0,'rows':[]};var _0x1a0ae3=_[_0x6d76('0x28')](db[_0x6d76('0x29')][_0x6d76('0x2a')],function(_0xddccc5){return{'name':_0xddccc5[_0x6d76('0x2b')],'type':_0xddccc5[_0x6d76('0x2c')][_0x6d76('0x2d')]};});_0x137b96[_0x6d76('0x2e')]=_[_0x6d76('0x28')](_0x1a0ae3,_0x6d76('0x2f'));_0x137b96['query']=_[_0x6d76('0x30')](_0x568c0a[_0x6d76('0x31')]);_0x137b96[_0x6d76('0x32')]=_['intersection'](_0x137b96[_0x6d76('0x2e')],_0x137b96[_0x6d76('0x31')]);_0x433455['attributes']=_[_0x6d76('0x33')](_0x137b96['model'],qs[_0x6d76('0x34')](_0x568c0a[_0x6d76('0x31')][_0x6d76('0x34')]));_0x433455[_0x6d76('0x35')]=_0x433455[_0x6d76('0x35')][_0x6d76('0x36')]?_0x433455['attributes']:_0x137b96[_0x6d76('0x2e')];if(!_0x568c0a[_0x6d76('0x31')][_0x6d76('0x37')]('nolimit')){_0x433455['limit']=qs[_0x6d76('0x1c')](_0x568c0a['query'][_0x6d76('0x1c')]);_0x433455[_0x6d76('0x1a')]=qs[_0x6d76('0x1a')](_0x568c0a[_0x6d76('0x31')][_0x6d76('0x1a')]);}_0x433455[_0x6d76('0x38')]=qs['sort'](_0x568c0a['query'][_0x6d76('0x39')]);_0x433455['where']=qs[_0x6d76('0x32')](_['pick'](_0x568c0a[_0x6d76('0x31')],_0x137b96['filters']),_0x1a0ae3);if(_0x568c0a[_0x6d76('0x31')][_0x6d76('0x3a')]){_0x433455[_0x6d76('0x3b')]=_[_0x6d76('0x3c')](_0x433455[_0x6d76('0x3b')],{'$or':_[_0x6d76('0x28')](_0x1a0ae3,function(_0x59fced){if(_0x59fced[_0x6d76('0x2c')]!==_0x6d76('0x3d')){var _0x1fc804={};_0x1fc804[_0x59fced[_0x6d76('0x2f')]]={'$like':'%'+_0x568c0a[_0x6d76('0x31')]['filter']+'%'};return _0x1fc804;}})});}_0x433455=_[_0x6d76('0x3c')]({},_0x433455,_0x568c0a[_0x6d76('0x3e')]);var _0xed07cd={'where':_0x433455[_0x6d76('0x3b')]};return db[_0x6d76('0x29')][_0x6d76('0x1d')](_0xed07cd)['then'](function(_0x74a849){_0x391c50[_0x6d76('0x1d')]=_0x74a849;if(_0x568c0a[_0x6d76('0x31')][_0x6d76('0x3f')]){_0x433455[_0x6d76('0x40')]=[{'all':!![]}];}return db[_0x6d76('0x29')][_0x6d76('0x41')](_0x433455);})[_0x6d76('0x24')](function(_0x327dc1){_0x391c50[_0x6d76('0x42')]=_0x327dc1;return _0x391c50;})['then'](respondWithFilteredResult(_0x54412f,_0x433455))[_0x6d76('0x43')](handleError(_0x54412f,null));};exports[_0x6d76('0x44')]=function(_0x1aedf4,_0x576d7c){var _0x310b53={'raw':!![],'where':{'id':_0x1aedf4[_0x6d76('0x45')]['id']}},_0x4bcf15={};_0x4bcf15['model']=_[_0x6d76('0x30')](db['VoiceTransferReport']['rawAttributes']);_0x4bcf15[_0x6d76('0x31')]=_['keys'](_0x1aedf4[_0x6d76('0x31')]);_0x4bcf15['filters']=_['intersection'](_0x4bcf15[_0x6d76('0x2e')],_0x4bcf15['query']);_0x310b53[_0x6d76('0x35')]=_['intersection'](_0x4bcf15[_0x6d76('0x2e')],qs[_0x6d76('0x34')](_0x1aedf4[_0x6d76('0x31')]['fields']));_0x310b53[_0x6d76('0x35')]=_0x310b53[_0x6d76('0x35')]['length']?_0x310b53[_0x6d76('0x35')]:_0x4bcf15[_0x6d76('0x2e')];if(_0x1aedf4['query'][_0x6d76('0x3f')]){_0x310b53[_0x6d76('0x40')]=[{'all':!![]}];}_0x310b53=_[_0x6d76('0x3c')]({},_0x310b53,_0x1aedf4[_0x6d76('0x3e')]);return db['VoiceTransferReport'][_0x6d76('0x46')](_0x310b53)[_0x6d76('0x24')](handleEntityNotFound(_0x576d7c,null))[_0x6d76('0x24')](respondWithResult(_0x576d7c,null))[_0x6d76('0x43')](handleError(_0x576d7c,null));};exports[_0x6d76('0x47')]=function(_0x852516,_0x3eb040){return db[_0x6d76('0x29')]['create'](_0x852516[_0x6d76('0x48')],{})[_0x6d76('0x24')](respondWithResult(_0x3eb040,0xc9))[_0x6d76('0x43')](handleError(_0x3eb040,null));};exports[_0x6d76('0x23')]=function(_0x361db5,_0x13da8b){if(_0x361db5[_0x6d76('0x48')]['id']){delete _0x361db5[_0x6d76('0x48')]['id'];}return db[_0x6d76('0x29')]['find']({'where':{'id':_0x361db5[_0x6d76('0x45')]['id']}})[_0x6d76('0x24')](handleEntityNotFound(_0x13da8b,null))[_0x6d76('0x24')](saveUpdates(_0x361db5['body'],null))['then'](respondWithResult(_0x13da8b,null))['catch'](handleError(_0x13da8b,null));};exports[_0x6d76('0x49')]=function(_0x3de353,_0x2c5e85){return db[_0x6d76('0x29')][_0x6d76('0x46')]({'where':{'id':_0x3de353['params']['id']}})[_0x6d76('0x24')](handleEntityNotFound(_0x2c5e85,null))['then'](removeEntity(_0x2c5e85,null))[_0x6d76('0x43')](handleError(_0x2c5e85,null));};exports[_0x6d76('0x4a')]=function(_0x3aca69,_0x14847d){return db[_0x6d76('0x29')][_0x6d76('0x4a')]()[_0x6d76('0x24')](respondWithResult(_0x14847d,null))[_0x6d76('0x43')](handleError(_0x14847d,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 1dc6e7f..c1f331e 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 _0xa781=['bluebird','path','../../config/environment','exports','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment'];(function(_0x159846,_0x4c0673){var _0x55f12b=function(_0x1f500e){while(--_0x1f500e){_0x159846['push'](_0x159846['shift']());}};_0x55f12b(++_0x4c0673);}(_0xa781,0x1b3));var _0x1a78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa781[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1a78('0x0'));var util=require(_0x1a78('0x1'));var logger=require(_0x1a78('0x2'))(_0x1a78('0x3'));var moment=require(_0x1a78('0x4'));var BPromise=require(_0x1a78('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a78('0x6'));var rimraf=require('rimraf');var config=require(_0x1a78('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x1a78('0x8')]=function(_0xb6dd0,_0x28b9c4){return _0xb6dd0['define'](_0x1a78('0x9'),attributes,{'tableName':_0x1a78('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b02=['../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3311ae,_0x362cee){var _0x107949=function(_0x2082a3){while(--_0x2082a3){_0x3311ae['push'](_0x3311ae['shift']());}};_0x107949(++_0x362cee);}(_0x3b02,0xae));var _0x23b0=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3b02[_0x432682];return _0x463d05;};'use strict';var _=require(_0x23b0('0x0'));var util=require(_0x23b0('0x1'));var logger=require(_0x23b0('0x2'))('api');var moment=require(_0x23b0('0x3'));var BPromise=require(_0x23b0('0x4'));var rp=require(_0x23b0('0x5'));var fs=require('fs');var path=require(_0x23b0('0x6'));var rimraf=require(_0x23b0('0x7'));var config=require(_0x23b0('0x8'));var attributes=require(_0x23b0('0x9'));module[_0x23b0('0xa')]=function(_0x3cd1a8,_0x1cd835){return _0x3cd1a8[_0x23b0('0xb')](_0x23b0('0xc'),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 f439582..978ff7b 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 _0xfe8f=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','lodash','util','moment','bluebird'];(function(_0x241424,_0x25eb5d){var _0x3da798=function(_0x415153){while(--_0x415153){_0x241424['push'](_0x241424['shift']());}};_0x3da798(++_0x25eb5d);}(_0xfe8f,0x11e));var _0xffe8=function(_0x5b5b05,_0x1c52b6){_0x5b5b05=_0x5b5b05-0x0;var _0x31363d=_0xfe8f[_0x5b5b05];return _0x31363d;};'use strict';var _=require(_0xffe8('0x0'));var util=require(_0xffe8('0x1'));var moment=require(_0xffe8('0x2'));var BPromise=require(_0xffe8('0x3'));var rs=require(_0xffe8('0x4'));var fs=require('fs');var Redis=require(_0xffe8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xffe8('0x6'));var logger=require(_0xffe8('0x7'))(_0xffe8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xffe8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b03ae,_0x17fcdb,_0x37bc41){return new BPromise(function(_0x1b99f4,_0x3719fe){return client[_0xffe8('0xa')](_0x1b03ae,_0x37bc41)['then'](function(_0x523076){logger['info'](_0xffe8('0xb'),_0x17fcdb,_0xffe8('0xc'));logger[_0xffe8('0xd')](_0xffe8('0xe'),_0x17fcdb,_0xffe8('0xc'),JSON[_0xffe8('0xf')](_0x523076));if(_0x523076[_0xffe8('0x10')]){if(_0x523076[_0xffe8('0x10')][_0xffe8('0x11')]===0x1f4){logger[_0xffe8('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x17fcdb,_0x523076[_0xffe8('0x10')][_0xffe8('0x12')]);return _0x3719fe(_0x523076[_0xffe8('0x10')][_0xffe8('0x12')]);}logger['error'](_0xffe8('0xb'),_0x17fcdb,_0x523076[_0xffe8('0x10')][_0xffe8('0x12')]);return _0x1b99f4(_0x523076[_0xffe8('0x10')][_0xffe8('0x12')]);}else{logger[_0xffe8('0x13')](_0xffe8('0xb'),_0x17fcdb,'request\x20sent');_0x1b99f4(_0x523076[_0xffe8('0x14')][_0xffe8('0x12')]);}})[_0xffe8('0x15')](function(_0x4f1e14){logger[_0xffe8('0x10')](_0xffe8('0xb'),_0x17fcdb,_0x4f1e14);_0x3719fe(_0x4f1e14);});});}exports[_0xffe8('0x16')]=function(_0x2510c8){var _0x5cb7a4=this;return new Promise(function(_0xbef534,_0x3daab7){return db[_0xffe8('0x17')][_0xffe8('0x18')](_0x2510c8[_0xffe8('0x19')],{'raw':_0x2510c8[_0xffe8('0x1a')]?_0x2510c8['options'][_0xffe8('0x1b')]===undefined?!![]:![]:!![]})[_0xffe8('0x1c')](function(_0x200988){logger['info'](_0xffe8('0x16'),_0x2510c8);logger[_0xffe8('0xd')](_0xffe8('0x16'),_0x2510c8,JSON['stringify'](_0x200988));_0xbef534(_0x200988);})[_0xffe8('0x15')](function(_0x22b219){logger[_0xffe8('0x10')](_0xffe8('0x16'),_0x22b219[_0xffe8('0x12')],_0x2510c8);_0x3daab7(_0x5cb7a4[_0xffe8('0x10')](0x1f4,_0x22b219[_0xffe8('0x12')]));});});}; \ No newline at end of file +var _0x9556=['options','raw','then','debug','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceTransferReport','create','body'];(function(_0x23b8c3,_0x45fb28){var _0x4a98d9=function(_0x327782){while(--_0x327782){_0x23b8c3['push'](_0x23b8c3['shift']());}};_0x4a98d9(++_0x45fb28);}(_0x9556,0x9a));var _0x6955=function(_0x3c1d51,_0x36fb91){_0x3c1d51=_0x3c1d51-0x0;var _0x4ca9ea=_0x9556[_0x3c1d51];return _0x4ca9ea;};'use strict';var _=require('lodash');var util=require(_0x6955('0x0'));var moment=require(_0x6955('0x1'));var BPromise=require(_0x6955('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6955('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6955('0x4'));var logger=require('../../config/logger')(_0x6955('0x5'));var config=require(_0x6955('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6955('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37a730,_0x1e0123,_0x5ded76){return new BPromise(function(_0x5effa3,_0x2be23a){return client[_0x6955('0x8')](_0x37a730,_0x5ded76)['then'](function(_0x13472f){logger[_0x6955('0x9')](_0x6955('0xa'),_0x1e0123,'request\x20sent');logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x1e0123,_0x6955('0xb'),JSON[_0x6955('0xc')](_0x13472f));if(_0x13472f[_0x6955('0xd')]){if(_0x13472f[_0x6955('0xd')][_0x6955('0xe')]===0x1f4){logger[_0x6955('0xd')](_0x6955('0xa'),_0x1e0123,_0x13472f[_0x6955('0xd')][_0x6955('0xf')]);return _0x2be23a(_0x13472f[_0x6955('0xd')]['message']);}logger[_0x6955('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x1e0123,_0x13472f['error'][_0x6955('0xf')]);return _0x5effa3(_0x13472f['error'][_0x6955('0xf')]);}else{logger[_0x6955('0x9')](_0x6955('0xa'),_0x1e0123,_0x6955('0xb'));_0x5effa3(_0x13472f[_0x6955('0x10')]['message']);}})[_0x6955('0x11')](function(_0x329005){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x1e0123,_0x329005);_0x2be23a(_0x329005);});});}exports[_0x6955('0x12')]=function(_0x2194f2){var _0x3e299d=this;return new Promise(function(_0x381061,_0x442d83){return db['VoiceTransferReport'][_0x6955('0x13')](_0x2194f2[_0x6955('0x14')],{'raw':_0x2194f2[_0x6955('0x15')]?_0x2194f2['options'][_0x6955('0x16')]===undefined?!![]:![]:!![]})[_0x6955('0x17')](function(_0x347832){logger[_0x6955('0x9')](_0x6955('0x12'),_0x2194f2);logger[_0x6955('0x18')](_0x6955('0x12'),_0x2194f2,JSON['stringify'](_0x347832));_0x381061(_0x347832);})[_0x6955('0x11')](function(_0x4f31dd){logger[_0x6955('0xd')](_0x6955('0x12'),_0x4f31dd['message'],_0x2194f2);_0x442d83(_0x3e299d[_0x6955('0xd')](0x1f4,_0x4f31dd[_0x6955('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 7041099..e8e663c 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 _0x70e0=['unhold','/calls','calls','/transfer','transfer','express','Router','../../components/auth/service','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','answer','post','/hold','/unhold'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x70e0,0x17b));var _0x070e=function(_0x448615,_0x4b48f7){_0x448615=_0x448615-0x0;var _0x271bc1=_0x70e0[_0x448615];return _0x271bc1;};'use strict';var express=require(_0x070e('0x0'));var router=express[_0x070e('0x1')]();var auth=require(_0x070e('0x2'));var controller=require('./webbar.controller');router['post'](_0x070e('0x3'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x6')]);router['post'](_0x070e('0x7'),auth['isAuthenticated'](),auth[_0x070e('0x5')](),controller['hangup']);router['post']('/answer',auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x8')]);router[_0x070e('0x9')](_0x070e('0xa'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller['hold']);router['post'](_0x070e('0xb'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xc')]);router[_0x070e('0x9')](_0x070e('0xd'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xe')]);router[_0x070e('0x9')](_0x070e('0xf'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x070e('0x10')]);module['exports']=router; \ No newline at end of file +var _0xbec5=['exports','express','Router','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup','/answer','answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer'];(function(_0x37d185,_0x25aa22){var _0x24112e=function(_0x2b860d){while(--_0x2b860d){_0x37d185['push'](_0x37d185['shift']());}};_0x24112e(++_0x25aa22);}(_0xbec5,0xe5));var _0x5bec=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0xbec5[_0x215dc8];return _0x583ea3;};'use strict';var express=require(_0x5bec('0x0'));var router=express[_0x5bec('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5bec('0x2'));router[_0x5bec('0x3')](_0x5bec('0x4'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller['originate']);router[_0x5bec('0x3')](_0x5bec('0x7'),auth[_0x5bec('0x5')](),auth['isWebrtcLicence'](),controller[_0x5bec('0x8')]);router[_0x5bec('0x3')](_0x5bec('0x9'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller[_0x5bec('0xa')]);router[_0x5bec('0x3')](_0x5bec('0xb'),auth['isAuthenticated'](),auth[_0x5bec('0x6')](),controller['hold']);router[_0x5bec('0x3')](_0x5bec('0xc'),auth[_0x5bec('0x5')](),auth['isWebrtcLicence'](),controller[_0x5bec('0xd')]);router[_0x5bec('0x3')](_0x5bec('0xe'),auth['isAuthenticated'](),auth[_0x5bec('0x6')](),controller[_0x5bec('0xf')]);router['post'](_0x5bec('0x10'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller[_0x5bec('0x11')]);module[_0x5bec('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index c9d201d..a1efdac 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 _0x2e3e=['error','name','status','send','NotFound','request','then','code','message','result','catch','findOne','agent','all','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','filter','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','info','stringify','log','handleError:'];(function(_0x16ff0e,_0x4e7dc6){var _0x95bd68=function(_0x2b39ba){while(--_0x2b39ba){_0x16ff0e['push'](_0x16ff0e['shift']());}};_0x95bd68(++_0x4e7dc6);}(_0x2e3e,0x1b0));var _0xe2e3=function(_0x5b1aa0,_0xed786a){_0x5b1aa0=_0x5b1aa0-0x0;var _0x111084=_0x2e3e[_0x5b1aa0];return _0x111084;};'use strict';var path=require(_0xe2e3('0x0'));var fs=require('fs');var _=require(_0xe2e3('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xe2e3('0x2'));var util=require(_0xe2e3('0x3'));var BPromise=require(_0xe2e3('0x4'));var jayson=require(_0xe2e3('0x5'));var amiClient=jayson[_0xe2e3('0x6')][_0xe2e3('0x7')]({'port':0x232a});var logger=require(_0xe2e3('0x8'))('webbarapi');var Redis=require(_0xe2e3('0x9'));config[_0xe2e3('0xa')]=_[_0xe2e3('0xb')](config['redis'],{'host':_0xe2e3('0xc'),'port':0x18eb});var io=require(_0xe2e3('0xd'))(new Redis(config[_0xe2e3('0xa')]));var Schema=require(_0xe2e3('0xe'));var originateValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xe2e3('0x10'),'required':[!![],_0xe2e3('0x11')]},'callerId':{'type':_0xe2e3('0x10')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],_0xe2e3('0x12')]},'sessionId':{'type':_0xe2e3('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],_0xe2e3('0x12')]},'sessionId':{'type':_0xe2e3('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],_0xe2e3('0x12')]},'sessionId':{'type':_0xe2e3('0x10'),'required':[!![],_0xe2e3('0x13')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],_0xe2e3('0x12')]},'sessionId':{'type':_0xe2e3('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xe2e3('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe2e3('0x12')]}});var conferenceValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],_0xe2e3('0x12')]}});function emit(_0x54a830,_0x31dd25,_0x2e40a3){logger[_0xe2e3('0x14')](_0x54a830,_0x31dd25,JSON[_0xe2e3('0x15')](_0x2e40a3));io['to'](_0x54a830)['emit'](_0x31dd25,_0x2e40a3);}function handleError(_0x5904af){return function(_0x51d87d){console[_0xe2e3('0x16')](_0xe2e3('0x17'),_0x51d87d,_0x51d87d instanceof RangeError);logger[_0xe2e3('0x18')](_0x51d87d['stack']);if(_0x51d87d instanceof RangeError){if(_0x51d87d[_0xe2e3('0x19')]){delete _0x51d87d[_0xe2e3('0x19')];}_0x5904af[_0xe2e3('0x1a')](0x194)[_0xe2e3('0x1b')](_0x51d87d);}else{if(_0x51d87d[_0xe2e3('0x19')]){delete _0x51d87d[_0xe2e3('0x19')];}_0x5904af[_0xe2e3('0x1a')](0x1f4)[_0xe2e3('0x1b')](_0x51d87d);}};}function checkError(){return function(_0x242ace){if(!_0x242ace){throw new RangeError(_0xe2e3('0x1c'));}return _0x242ace;};}function respondWithRpcPromise(_0x261e9f,_0x976fb3){return new BPromise(function(_0x266d05,_0x412483){var _0x451f84=amiClient;return _0x451f84[_0xe2e3('0x1d')](_0x261e9f,_0x976fb3)[_0xe2e3('0x1e')](function(_0x104342){if(_0x104342['error']){if(_0x104342[_0xe2e3('0x18')][_0xe2e3('0x1f')]===0x1f4){return _0x412483(_0x104342[_0xe2e3('0x18')][_0xe2e3('0x20')]);}return _0x266d05(_0x104342[_0xe2e3('0x18')][_0xe2e3('0x20')]);}else{_0x266d05(_0x104342[_0xe2e3('0x21')]);}})[_0xe2e3('0x22')](function(_0x112ec3){_0x412483(_0x112ec3);});});}function getAgent(_0x1966f1){return db['User'][_0xe2e3('0x23')]({'where':{'id':_0x1966f1,'role':_0xe2e3('0x24')}})[_0xe2e3('0x1e')](checkError());}function getAgentCheckSession(_0x4736a5,_0x2d0a5c){return new BPromise(function(_0x147ca5,_0x7c77a2){var _0x2979fe=respondWithRpcPromise('VoiceChannels');var _0x1bbb5e=getAgent(_0x4736a5);Promise[_0xe2e3('0x25')]([_0x2979fe,_0x1bbb5e])[_0xe2e3('0x1e')](function(_0x578bd8){var _0x14fa29=_0x578bd8[0x0];var _0x12cca4=_0x578bd8[0x1];var _0x5076a6=_['filter'](_0x14fa29[_0xe2e3('0x26')],function(_0x45e2db){return _0x45e2db[_0xe2e3('0x27')]==_0x12cca4['id']&&_0x45e2db[_0xe2e3('0x28')]==_0x2d0a5c;});if(_0x5076a6[_0xe2e3('0x29')]==0x1){_0x147ca5(_0x12cca4);}else{_0x7c77a2(new RangeError(_0xe2e3('0x2a')+_0x2d0a5c+_0xe2e3('0x2b')));}});});}exports['originate']=function(_0x56e6e8,_0x67a9e3){logger['info']('originate\x20fired:',_0x56e6e8[_0xe2e3('0x2c')]);var _0x537453=originateValidation[_0xe2e3('0xe')](_0x56e6e8[_0xe2e3('0x2c')]);if(_0x537453[_0xe2e3('0x29')]>0x0){return _0x67a9e3[_0xe2e3('0x1a')](0x190)[_0xe2e3('0x2d')](_0x537453);}var _0x2e9001=_0x56e6e8[_0xe2e3('0x2c')][_0xe2e3('0x2e')];var _0x118137=_0x56e6e8[_0xe2e3('0x2c')][_0xe2e3('0x2f')];var _0x26b4b9=_0x56e6e8[_0xe2e3('0x2c')][_0xe2e3('0x30')];var _0x41ad56=_0x56e6e8[_0xe2e3('0x2c')][_0xe2e3('0x31')];return getAgent(_0x2e9001)[_0xe2e3('0x1e')](function(_0x2a1baa){logger[_0xe2e3('0x14')](_0xe2e3('0x32'),_0x2a1baa[_0xe2e3('0x19')]);emit(util[_0xe2e3('0x33')](_0xe2e3('0x34'),_0x2a1baa[_0xe2e3('0x19')]),'webbar:originate',{'callNumber':_0x118137,'callerId':_0x26b4b9,'callbackUrl':_0x41ad56});return _0x67a9e3['status'](0xc8)[_0xe2e3('0x2d')]({'error':![],'message':_0xe2e3('0x35')});})[_0xe2e3('0x22')](handleError(_0x67a9e3));};exports[_0xe2e3('0x36')]=function(_0x1e57f2,_0x1a823e){logger['info'](_0xe2e3('0x37'),_0x1e57f2[_0xe2e3('0x2c')]);var _0x5bd17b=hangupValidation[_0xe2e3('0xe')](_0x1e57f2[_0xe2e3('0x2c')]);if(_0x5bd17b['length']>0x0){return _0x1a823e[_0xe2e3('0x1a')](0x190)[_0xe2e3('0x2d')](_0x5bd17b);}var _0x450ee9=_0x1e57f2[_0xe2e3('0x2c')]['userId'];var _0x436b63=_0x1e57f2[_0xe2e3('0x2c')][_0xe2e3('0x28')];return getAgent(_0x450ee9)[_0xe2e3('0x1e')](function(_0x2c4120){logger['info']('entityFound:',_0x2c4120[_0xe2e3('0x19')]);emit(util[_0xe2e3('0x33')](_0xe2e3('0x34'),_0x2c4120[_0xe2e3('0x19')]),_0xe2e3('0x38'),{'sessionId':_0x436b63});return _0x1a823e[_0xe2e3('0x1a')](0xc8)[_0xe2e3('0x2d')]({'error':![],'message':_0xe2e3('0x39')});})[_0xe2e3('0x22')](handleError(_0x1a823e));};exports['answer']=function(_0x33e7d3,_0x2df7d5){logger[_0xe2e3('0x14')]('answer\x20fired:',_0x33e7d3[_0xe2e3('0x2c')]);var _0x27781e=answerValidation[_0xe2e3('0xe')](_0x33e7d3['body']);if(_0x27781e['length']>0x0){return _0x2df7d5[_0xe2e3('0x1a')](0x190)['json'](_0x27781e);}var _0x5e8298=_0x33e7d3[_0xe2e3('0x2c')][_0xe2e3('0x2e')];var _0x39cd14=_0x33e7d3[_0xe2e3('0x2c')][_0xe2e3('0x28')];return getAgent(_0x5e8298)[_0xe2e3('0x1e')](function(_0x5696d9){logger[_0xe2e3('0x14')](_0xe2e3('0x32'),_0x5696d9[_0xe2e3('0x19')]);emit(util[_0xe2e3('0x33')](_0xe2e3('0x34'),_0x5696d9[_0xe2e3('0x19')]),_0xe2e3('0x3a'),{'sessionId':_0x39cd14});return _0x2df7d5[_0xe2e3('0x1a')](0xc8)['json']({'error':![],'message':_0xe2e3('0x3b')});})[_0xe2e3('0x22')](handleError(_0x2df7d5));};exports[_0xe2e3('0x3c')]=function(_0x13d73d,_0x573d07){logger[_0xe2e3('0x14')](_0xe2e3('0x3d'),_0x13d73d[_0xe2e3('0x2c')]);var _0xa3371f=holdValidation[_0xe2e3('0xe')](_0x13d73d[_0xe2e3('0x2c')]);if(_0xa3371f[_0xe2e3('0x29')]>0x0){return _0x573d07[_0xe2e3('0x1a')](0x190)['json'](_0xa3371f);}var _0x677ae0=_0x13d73d[_0xe2e3('0x2c')]['userId'];var _0x3ee08f=_0x13d73d['body'][_0xe2e3('0x28')];return getAgent(_0x677ae0)[_0xe2e3('0x1e')](function(_0x2b4ddd){logger[_0xe2e3('0x14')](_0xe2e3('0x32'),_0x2b4ddd[_0xe2e3('0x19')]);emit(util[_0xe2e3('0x33')](_0xe2e3('0x34'),_0x2b4ddd[_0xe2e3('0x19')]),_0xe2e3('0x3e'),{'sessionId':_0x3ee08f});return _0x573d07[_0xe2e3('0x1a')](0xc8)[_0xe2e3('0x2d')]({'error':![],'message':'hold\x20executed!'});})[_0xe2e3('0x22')](handleError(_0x573d07));};exports['unhold']=function(_0x485bb3,_0x46d994){logger[_0xe2e3('0x14')](_0xe2e3('0x3f'),_0x485bb3[_0xe2e3('0x2c')]);var _0x38802b=unholdValidation[_0xe2e3('0xe')](_0x485bb3['body']);if(_0x38802b[_0xe2e3('0x29')]>0x0){return _0x46d994[_0xe2e3('0x1a')](0x190)[_0xe2e3('0x2d')](_0x38802b);}var _0x13dc06=_0x485bb3[_0xe2e3('0x2c')]['userId'];var _0x1eb1b5=_0x485bb3[_0xe2e3('0x2c')][_0xe2e3('0x28')];return getAgent(_0x13dc06)['then'](function(_0x70144){logger[_0xe2e3('0x14')](_0xe2e3('0x32'),_0x70144['name']);emit(util['format']('user:%s',_0x70144[_0xe2e3('0x19')]),_0xe2e3('0x40'),{'sessionId':_0x1eb1b5});return _0x46d994[_0xe2e3('0x1a')](0xc8)[_0xe2e3('0x2d')]({'error':![],'message':_0xe2e3('0x41')});})[_0xe2e3('0x22')](handleError(_0x46d994));};exports[_0xe2e3('0x42')]=function(_0xfbc148,_0x5342e4){logger['info'](_0xe2e3('0x43'),_0x5342e4['body']);var _0x240cb1=callsValidation['validate'](_0xfbc148['body']);if(_0x240cb1[_0xe2e3('0x29')]>0x0){return _0x5342e4['status'](0x190)[_0xe2e3('0x2d')](_0x240cb1);}var _0x199465=_0xfbc148[_0xe2e3('0x2c')][_0xe2e3('0x2e')];var _0x1f9221=respondWithRpcPromise('VoiceChannels');var _0x2777d3=getAgent(_0x199465);return Promise[_0xe2e3('0x25')]([_0x1f9221,_0x2777d3])[_0xe2e3('0x1e')](function(_0x20712b){var _0x43d4ce=_0x20712b[0x0];var _0x1592d1=_0x20712b[0x1];var _0x29dabd=_[_0xe2e3('0x44')](_0x43d4ce[_0xe2e3('0x26')],function(_0x3833bc){return _0x3833bc[_0xe2e3('0x27')]==_0x1592d1['id'];});return _0x5342e4['status'](0xc8)['json']({'count':_0x29dabd[_0xe2e3('0x29')],'rows':_0x29dabd});})[_0xe2e3('0x22')](handleError(_0x5342e4));};exports['conference']=function(_0x564b55,_0x53dffe){logger[_0xe2e3('0x14')](_0xe2e3('0x45'),_0x564b55['body']);var _0x517f2b=conferenceValidation[_0xe2e3('0xe')](_0x564b55[_0xe2e3('0x2c')]);if(_0x517f2b[_0xe2e3('0x29')]>0x0){return _0x53dffe[_0xe2e3('0x1a')](0x190)[_0xe2e3('0x2d')](_0x517f2b);}var _0x1d3673=_0x564b55['body']['userId'];return getAgent(_0x1d3673)['then'](function(_0x28b858){logger[_0xe2e3('0x14')](_0xe2e3('0x32'),_0x28b858[_0xe2e3('0x19')]);emit(util[_0xe2e3('0x33')](_0xe2e3('0x34'),_0x28b858[_0xe2e3('0x19')]),_0xe2e3('0x46'));return _0x53dffe[_0xe2e3('0x1a')](0xc8)[_0xe2e3('0x2d')]({'error':![],'message':_0xe2e3('0x47')});})['catch'](handleError(_0x53dffe));};exports[_0xe2e3('0x48')]=function(_0x25ae98,_0x36f86e){logger['info'](_0xe2e3('0x49'),_0x25ae98[_0xe2e3('0x2c')]);var _0x17616f=transferValidation[_0xe2e3('0xe')](_0x25ae98[_0xe2e3('0x2c')]);if(_0x17616f[_0xe2e3('0x29')]>0x0){return _0x36f86e[_0xe2e3('0x1a')](0x190)[_0xe2e3('0x2d')](_0x17616f);}var _0x1aa8ea=_0x25ae98['body']['userId'];var _0x6b783f=_0x25ae98[_0xe2e3('0x2c')]['sessionId'];var _0x3036ef=_0x25ae98[_0xe2e3('0x2c')][_0xe2e3('0x4a')];return getAgent(_0x1aa8ea)['then'](function(_0x2ecab9){logger[_0xe2e3('0x14')](_0xe2e3('0x32'),_0x2ecab9[_0xe2e3('0x19')]);emit(util[_0xe2e3('0x33')](_0xe2e3('0x34'),_0x2ecab9[_0xe2e3('0x19')]),'webbar:transfer',{'sessionId':_0x6b783f,'transferNumber':_0x3036ef});return _0x36f86e[_0xe2e3('0x1a')](0xc8)[_0xe2e3('0x2d')]({'error':![],'message':_0xe2e3('0x4b')});})['catch'](handleError(_0x36f86e));}; \ No newline at end of file +var _0x9d3f=['unhold\x20executed!','calls','calls\x20fired:','filter','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../config/environment','util','bluebird','http','../../config/logger','webbarapi','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','handleError:','error','stack','name','send','status','NotFound','then','code','message','result','catch','User','findOne','VoiceChannels','all','rows','UserId','sessionId','length','sessionId\x20','originate','body','json','userId','callNumber','callerId','info','format','originate\x20executed!','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x9d3f,0x18e));var _0xf9d3=function(_0x5ea678,_0x3b84d8){_0x5ea678=_0x5ea678-0x0;var _0x31cba3=_0x9d3f[_0x5ea678];return _0x31cba3;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xf9d3('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0xf9d3('0x1'));var util=require(_0xf9d3('0x2'));var BPromise=require(_0xf9d3('0x3'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0xf9d3('0x4')]({'port':0x232a});var logger=require(_0xf9d3('0x5'))(_0xf9d3('0x6'));var Redis=require('ioredis');config[_0xf9d3('0x7')]=_[_0xf9d3('0x8')](config[_0xf9d3('0x7')],{'host':_0xf9d3('0x9'),'port':0x18eb});var io=require(_0xf9d3('0xa'))(new Redis(config[_0xf9d3('0x7')]));var Schema=require(_0xf9d3('0xb'));var originateValidation=new Schema({'userId':{'type':_0xf9d3('0xc'),'required':[!![],_0xf9d3('0xd')]},'callNumber':{'type':_0xf9d3('0xe'),'required':[!![],_0xf9d3('0xf')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xf9d3('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xf9d3('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xf9d3('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf9d3('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf9d3('0xc'),'required':[!![],_0xf9d3('0xd')]},'sessionId':{'type':'string','required':[!![],_0xf9d3('0x10')]},'transferNumber':{'type':_0xf9d3('0xe'),'required':[!![],_0xf9d3('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xf9d3('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf9d3('0xc'),'required':[!![],_0xf9d3('0xd')]},'sessionId':{'type':_0xf9d3('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf9d3('0xc'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xf9d3('0xc'),'required':[!![],_0xf9d3('0xd')]}});function emit(_0x567306,_0x107203,_0x4d0c9c){logger['info'](_0x567306,_0x107203,JSON[_0xf9d3('0x12')](_0x4d0c9c));io['to'](_0x567306)[_0xf9d3('0x13')](_0x107203,_0x4d0c9c);}function handleError(_0x225439){return function(_0x5db1ca){console['log'](_0xf9d3('0x14'),_0x5db1ca,_0x5db1ca instanceof RangeError);logger[_0xf9d3('0x15')](_0x5db1ca[_0xf9d3('0x16')]);if(_0x5db1ca instanceof RangeError){if(_0x5db1ca['name']){delete _0x5db1ca[_0xf9d3('0x17')];}_0x225439['status'](0x194)[_0xf9d3('0x18')](_0x5db1ca);}else{if(_0x5db1ca[_0xf9d3('0x17')]){delete _0x5db1ca['name'];}_0x225439[_0xf9d3('0x19')](0x1f4)[_0xf9d3('0x18')](_0x5db1ca);}};}function checkError(){return function(_0x3e2d33){if(!_0x3e2d33){throw new RangeError(_0xf9d3('0x1a'));}return _0x3e2d33;};}function respondWithRpcPromise(_0x276600,_0x9519d7){return new BPromise(function(_0x3c67db,_0x3645e5){var _0x35d044=amiClient;return _0x35d044['request'](_0x276600,_0x9519d7)[_0xf9d3('0x1b')](function(_0x587451){if(_0x587451[_0xf9d3('0x15')]){if(_0x587451['error'][_0xf9d3('0x1c')]===0x1f4){return _0x3645e5(_0x587451[_0xf9d3('0x15')]['message']);}return _0x3c67db(_0x587451['error'][_0xf9d3('0x1d')]);}else{_0x3c67db(_0x587451[_0xf9d3('0x1e')]);}})[_0xf9d3('0x1f')](function(_0x35c896){_0x3645e5(_0x35c896);});});}function getAgent(_0x36b7e1){return db[_0xf9d3('0x20')][_0xf9d3('0x21')]({'where':{'id':_0x36b7e1,'role':'agent'}})[_0xf9d3('0x1b')](checkError());}function getAgentCheckSession(_0x1a8ca7,_0x205042){return new BPromise(function(_0x4483bd,_0x501553){var _0x208860=respondWithRpcPromise(_0xf9d3('0x22'));var _0x2c5bd5=getAgent(_0x1a8ca7);Promise[_0xf9d3('0x23')]([_0x208860,_0x2c5bd5])[_0xf9d3('0x1b')](function(_0x302d50){var _0x1d7959=_0x302d50[0x0];var _0x3aa0d7=_0x302d50[0x1];var _0x52f568=_['filter'](_0x1d7959[_0xf9d3('0x24')],function(_0x7215d7){return _0x7215d7[_0xf9d3('0x25')]==_0x3aa0d7['id']&&_0x7215d7[_0xf9d3('0x26')]==_0x205042;});if(_0x52f568[_0xf9d3('0x27')]==0x1){_0x4483bd(_0x3aa0d7);}else{_0x501553(new RangeError(_0xf9d3('0x28')+_0x205042+'\x20not\x20found!'));}});});}exports[_0xf9d3('0x29')]=function(_0x388f9d,_0x195a42){logger['info']('originate\x20fired:',_0x388f9d[_0xf9d3('0x2a')]);var _0x3fdd79=originateValidation[_0xf9d3('0xb')](_0x388f9d[_0xf9d3('0x2a')]);if(_0x3fdd79[_0xf9d3('0x27')]>0x0){return _0x195a42[_0xf9d3('0x19')](0x190)[_0xf9d3('0x2b')](_0x3fdd79);}var _0x4245f9=_0x388f9d[_0xf9d3('0x2a')][_0xf9d3('0x2c')];var _0x21dd01=_0x388f9d[_0xf9d3('0x2a')][_0xf9d3('0x2d')];var _0x599de1=_0x388f9d[_0xf9d3('0x2a')][_0xf9d3('0x2e')];var _0x24078d=_0x388f9d[_0xf9d3('0x2a')]['callbackUrl'];return getAgent(_0x4245f9)[_0xf9d3('0x1b')](function(_0x351650){logger[_0xf9d3('0x2f')]('entityFound:',_0x351650[_0xf9d3('0x17')]);emit(util[_0xf9d3('0x30')]('user:%s',_0x351650[_0xf9d3('0x17')]),'webbar:originate',{'callNumber':_0x21dd01,'callerId':_0x599de1,'callbackUrl':_0x24078d});return _0x195a42[_0xf9d3('0x19')](0xc8)[_0xf9d3('0x2b')]({'error':![],'message':_0xf9d3('0x31')});})[_0xf9d3('0x1f')](handleError(_0x195a42));};exports['hangup']=function(_0xf327,_0x41c08c){logger[_0xf9d3('0x2f')]('hangup\x20fired:',_0xf327[_0xf9d3('0x2a')]);var _0x3d5f71=hangupValidation[_0xf9d3('0xb')](_0xf327[_0xf9d3('0x2a')]);if(_0x3d5f71[_0xf9d3('0x27')]>0x0){return _0x41c08c[_0xf9d3('0x19')](0x190)[_0xf9d3('0x2b')](_0x3d5f71);}var _0x3a01d6=_0xf327[_0xf9d3('0x2a')][_0xf9d3('0x2c')];var _0x4fa3fd=_0xf327['body']['sessionId'];return getAgent(_0x3a01d6)[_0xf9d3('0x1b')](function(_0x447170){logger[_0xf9d3('0x2f')]('entityFound:',_0x447170['name']);emit(util[_0xf9d3('0x30')](_0xf9d3('0x32'),_0x447170['name']),_0xf9d3('0x33'),{'sessionId':_0x4fa3fd});return _0x41c08c[_0xf9d3('0x19')](0xc8)[_0xf9d3('0x2b')]({'error':![],'message':_0xf9d3('0x34')});})['catch'](handleError(_0x41c08c));};exports[_0xf9d3('0x35')]=function(_0x4a0ee6,_0x1fc5ae){logger[_0xf9d3('0x2f')](_0xf9d3('0x36'),_0x4a0ee6[_0xf9d3('0x2a')]);var _0xa8f870=answerValidation[_0xf9d3('0xb')](_0x4a0ee6[_0xf9d3('0x2a')]);if(_0xa8f870[_0xf9d3('0x27')]>0x0){return _0x1fc5ae[_0xf9d3('0x19')](0x190)[_0xf9d3('0x2b')](_0xa8f870);}var _0x32ad1c=_0x4a0ee6[_0xf9d3('0x2a')][_0xf9d3('0x2c')];var _0x2dc54c=_0x4a0ee6[_0xf9d3('0x2a')][_0xf9d3('0x26')];return getAgent(_0x32ad1c)[_0xf9d3('0x1b')](function(_0x5f758c){logger['info'](_0xf9d3('0x37'),_0x5f758c[_0xf9d3('0x17')]);emit(util[_0xf9d3('0x30')](_0xf9d3('0x32'),_0x5f758c['name']),_0xf9d3('0x38'),{'sessionId':_0x2dc54c});return _0x1fc5ae[_0xf9d3('0x19')](0xc8)['json']({'error':![],'message':_0xf9d3('0x39')});})['catch'](handleError(_0x1fc5ae));};exports[_0xf9d3('0x3a')]=function(_0x4077c3,_0x36efc3){logger[_0xf9d3('0x2f')](_0xf9d3('0x3b'),_0x4077c3[_0xf9d3('0x2a')]);var _0x48d295=holdValidation['validate'](_0x4077c3[_0xf9d3('0x2a')]);if(_0x48d295['length']>0x0){return _0x36efc3[_0xf9d3('0x19')](0x190)[_0xf9d3('0x2b')](_0x48d295);}var _0x498984=_0x4077c3['body']['userId'];var _0x266af1=_0x4077c3[_0xf9d3('0x2a')]['sessionId'];return getAgent(_0x498984)[_0xf9d3('0x1b')](function(_0x16a614){logger[_0xf9d3('0x2f')](_0xf9d3('0x37'),_0x16a614[_0xf9d3('0x17')]);emit(util['format']('user:%s',_0x16a614[_0xf9d3('0x17')]),_0xf9d3('0x3c'),{'sessionId':_0x266af1});return _0x36efc3[_0xf9d3('0x19')](0xc8)['json']({'error':![],'message':_0xf9d3('0x3d')});})[_0xf9d3('0x1f')](handleError(_0x36efc3));};exports[_0xf9d3('0x3e')]=function(_0x1e8a7f,_0x1859ea){logger['info'](_0xf9d3('0x3f'),_0x1e8a7f[_0xf9d3('0x2a')]);var _0x32131c=unholdValidation[_0xf9d3('0xb')](_0x1e8a7f[_0xf9d3('0x2a')]);if(_0x32131c[_0xf9d3('0x27')]>0x0){return _0x1859ea['status'](0x190)['json'](_0x32131c);}var _0x114d5b=_0x1e8a7f['body']['userId'];var _0x1d7933=_0x1e8a7f[_0xf9d3('0x2a')][_0xf9d3('0x26')];return getAgent(_0x114d5b)[_0xf9d3('0x1b')](function(_0x484533){logger['info'](_0xf9d3('0x37'),_0x484533[_0xf9d3('0x17')]);emit(util['format'](_0xf9d3('0x32'),_0x484533[_0xf9d3('0x17')]),'webbar:unhold',{'sessionId':_0x1d7933});return _0x1859ea[_0xf9d3('0x19')](0xc8)[_0xf9d3('0x2b')]({'error':![],'message':_0xf9d3('0x40')});})['catch'](handleError(_0x1859ea));};exports[_0xf9d3('0x41')]=function(_0x1fbb06,_0x90c98){logger['info'](_0xf9d3('0x42'),_0x90c98['body']);var _0x1585cd=callsValidation[_0xf9d3('0xb')](_0x1fbb06['body']);if(_0x1585cd[_0xf9d3('0x27')]>0x0){return _0x90c98['status'](0x190)[_0xf9d3('0x2b')](_0x1585cd);}var _0x1b4aa5=_0x1fbb06[_0xf9d3('0x2a')][_0xf9d3('0x2c')];var _0x4fb9e2=respondWithRpcPromise('VoiceChannels');var _0x49ed30=getAgent(_0x1b4aa5);return Promise['all']([_0x4fb9e2,_0x49ed30])['then'](function(_0x58b73a){var _0x57b482=_0x58b73a[0x0];var _0x1a68fe=_0x58b73a[0x1];var _0x58b133=_[_0xf9d3('0x43')](_0x57b482['rows'],function(_0x784d13){return _0x784d13[_0xf9d3('0x25')]==_0x1a68fe['id'];});return _0x90c98[_0xf9d3('0x19')](0xc8)[_0xf9d3('0x2b')]({'count':_0x58b133[_0xf9d3('0x27')],'rows':_0x58b133});})[_0xf9d3('0x1f')](handleError(_0x90c98));};exports[_0xf9d3('0x44')]=function(_0x396e62,_0x1ee69d){logger['info'](_0xf9d3('0x45'),_0x396e62[_0xf9d3('0x2a')]);var _0x56f1d6=conferenceValidation[_0xf9d3('0xb')](_0x396e62['body']);if(_0x56f1d6[_0xf9d3('0x27')]>0x0){return _0x1ee69d[_0xf9d3('0x19')](0x190)[_0xf9d3('0x2b')](_0x56f1d6);}var _0x1504c4=_0x396e62[_0xf9d3('0x2a')][_0xf9d3('0x2c')];return getAgent(_0x1504c4)[_0xf9d3('0x1b')](function(_0x2aa519){logger['info'](_0xf9d3('0x37'),_0x2aa519[_0xf9d3('0x17')]);emit(util[_0xf9d3('0x30')]('user:%s',_0x2aa519[_0xf9d3('0x17')]),_0xf9d3('0x46'));return _0x1ee69d[_0xf9d3('0x19')](0xc8)['json']({'error':![],'message':_0xf9d3('0x47')});})[_0xf9d3('0x1f')](handleError(_0x1ee69d));};exports[_0xf9d3('0x48')]=function(_0x2c0aa6,_0x4b3a17){logger[_0xf9d3('0x2f')](_0xf9d3('0x49'),_0x2c0aa6['body']);var _0x4b2e85=transferValidation[_0xf9d3('0xb')](_0x2c0aa6['body']);if(_0x4b2e85[_0xf9d3('0x27')]>0x0){return _0x4b3a17[_0xf9d3('0x19')](0x190)[_0xf9d3('0x2b')](_0x4b2e85);}var _0x5626af=_0x2c0aa6[_0xf9d3('0x2a')]['userId'];var _0x3a4e7c=_0x2c0aa6[_0xf9d3('0x2a')]['sessionId'];var _0xf1e4fe=_0x2c0aa6[_0xf9d3('0x2a')][_0xf9d3('0x4a')];return getAgent(_0x5626af)['then'](function(_0x5cf45f){logger['info'](_0xf9d3('0x37'),_0x5cf45f[_0xf9d3('0x17')]);emit(util[_0xf9d3('0x30')]('user:%s',_0x5cf45f[_0xf9d3('0x17')]),_0xf9d3('0x4b'),{'sessionId':_0x3a4e7c,'transferNumber':_0xf1e4fe});return _0x4b3a17['status'](0xc8)[_0xf9d3('0x2b')]({'error':![],'message':_0xf9d3('0x4c')});})[_0xf9d3('0x1f')](handleError(_0x4b3a17));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 89fdaba..ba8693a 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 _0xd4f3=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','/:id/send','send','put','delete','destroy','removeAnswers','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4f3,0x1c8));var _0x3d4f=function(_0x3b55f1,_0x2ba8dc){_0x3b55f1=_0x3b55f1-0x0;var _0x4510e3=_0xd4f3[_0x3b55f1];return _0x4510e3;};'use strict';var multer=require(_0x3d4f('0x0'));var util=require(_0x3d4f('0x1'));var path=require(_0x3d4f('0x2'));var timeout=require(_0x3d4f('0x3'));var express=require(_0x3d4f('0x4'));var router=express[_0x3d4f('0x5')]();var fs_extra=require(_0x3d4f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3d4f('0x7'));var config=require(_0x3d4f('0x8'));var controller=require('./whatsappAccount.controller');router[_0x3d4f('0x9')]('/',auth[_0x3d4f('0xa')](),controller[_0x3d4f('0xb')]);router['get'](_0x3d4f('0xc'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0xd')]);router[_0x3d4f('0x9')](_0x3d4f('0xe'),auth['isAuthenticated'](),controller[_0x3d4f('0xf')]);router[_0x3d4f('0x9')](_0x3d4f('0x10'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x11')]);router[_0x3d4f('0x9')]('/:id/canned_answers',auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x12')]);router[_0x3d4f('0x9')](_0x3d4f('0x13'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x14')]);router['get'](_0x3d4f('0x15'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x16')]);router[_0x3d4f('0x17')]('/',auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x18')]);router[_0x3d4f('0x17')](_0x3d4f('0x10'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x19')]);router[_0x3d4f('0x17')](_0x3d4f('0x1a'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x1b')]);router[_0x3d4f('0x17')](_0x3d4f('0x13'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x1c')]);router[_0x3d4f('0x17')]('/:id/applications',auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x1d')]);router[_0x3d4f('0x17')](_0x3d4f('0x1e'),controller['notify']);router[_0x3d4f('0x17')](_0x3d4f('0x1f'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x20')]);router[_0x3d4f('0x21')](_0x3d4f('0xe'),auth[_0x3d4f('0xa')](),controller['update']);router[_0x3d4f('0x22')](_0x3d4f('0xe'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x23')]);router['delete'](_0x3d4f('0x10'),auth[_0x3d4f('0xa')](),controller['removeDispositions']);router[_0x3d4f('0x22')](_0x3d4f('0x1a'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x24')]);router['delete'](_0x3d4f('0x13'),auth[_0x3d4f('0xa')](),controller['removeAgents']);module[_0x3d4f('0x25')]=router; \ No newline at end of file +var _0xcfe4=['delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','isAuthenticated','index','get','/describe','show','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','/:id/users','addApplications','/:id/notify','notify','send','put','/:id','update','destroy'];(function(_0x33af1f,_0x5e825b){var _0x222f17=function(_0x52072b){while(--_0x52072b){_0x33af1f['push'](_0x33af1f['shift']());}};_0x222f17(++_0x5e825b);}(_0xcfe4,0xe2));var _0x4cfe=function(_0x3391fb,_0x1450b6){_0x3391fb=_0x3391fb-0x0;var _0x162fb2=_0xcfe4[_0x3391fb];return _0x162fb2;};'use strict';var multer=require(_0x4cfe('0x0'));var util=require(_0x4cfe('0x1'));var path=require(_0x4cfe('0x2'));var timeout=require(_0x4cfe('0x3'));var express=require(_0x4cfe('0x4'));var router=express[_0x4cfe('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4cfe('0x6'));var interaction=require(_0x4cfe('0x7'));var config=require('../../config/environment');var controller=require(_0x4cfe('0x8'));router['get']('/',auth[_0x4cfe('0x9')](),controller[_0x4cfe('0xa')]);router[_0x4cfe('0xb')](_0x4cfe('0xc'),auth[_0x4cfe('0x9')](),controller['describe']);router[_0x4cfe('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x4cfe('0xd')]);router['get'](_0x4cfe('0xe'),auth[_0x4cfe('0x9')](),controller[_0x4cfe('0xf')]);router[_0x4cfe('0xb')]('/:id/canned_answers',auth[_0x4cfe('0x9')](),controller[_0x4cfe('0x10')]);router[_0x4cfe('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0x4cfe('0x11')]);router['get'](_0x4cfe('0x12'),auth[_0x4cfe('0x9')](),controller[_0x4cfe('0x13')]);router[_0x4cfe('0x14')]('/',auth['isAuthenticated'](),controller[_0x4cfe('0x15')]);router[_0x4cfe('0x14')](_0x4cfe('0xe'),auth[_0x4cfe('0x9')](),controller[_0x4cfe('0x16')]);router[_0x4cfe('0x14')](_0x4cfe('0x17'),auth[_0x4cfe('0x9')](),controller['addAnswer']);router[_0x4cfe('0x14')](_0x4cfe('0x18'),auth[_0x4cfe('0x9')](),controller['addAgents']);router[_0x4cfe('0x14')](_0x4cfe('0x12'),auth[_0x4cfe('0x9')](),controller[_0x4cfe('0x19')]);router['post'](_0x4cfe('0x1a'),controller[_0x4cfe('0x1b')]);router['post']('/:id/send',auth[_0x4cfe('0x9')](),controller[_0x4cfe('0x1c')]);router[_0x4cfe('0x1d')](_0x4cfe('0x1e'),auth[_0x4cfe('0x9')](),controller[_0x4cfe('0x1f')]);router['delete'](_0x4cfe('0x1e'),auth[_0x4cfe('0x9')](),controller[_0x4cfe('0x20')]);router[_0x4cfe('0x21')](_0x4cfe('0xe'),auth[_0x4cfe('0x9')](),controller[_0x4cfe('0x22')]);router[_0x4cfe('0x21')](_0x4cfe('0x17'),auth[_0x4cfe('0x9')](),controller[_0x4cfe('0x23')]);router['delete'](_0x4cfe('0x18'),auth[_0x4cfe('0x9')](),controller[_0x4cfe('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index d8ad02f..8ad30ce 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 _0xaa88=['TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate','twilio','sinch'];(function(_0x2976ce,_0x25343f){var _0x1a5dc4=function(_0x1df787){while(--_0x1df787){_0x2976ce['push'](_0x2976ce['shift']());}};_0x1a5dc4(++_0x25343f);}(_0xaa88,0x124));var _0x8aa8=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0xaa88[_0x3f2228];return _0x285ae4;};'use strict';var Sequelize=require(_0x8aa8('0x0'));var rs=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'name':{'type':Sequelize[_0x8aa8('0x3')],'unique':_0x8aa8('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8aa8('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x6'),_0x8aa8('0x7'))},'accountSid':{'type':Sequelize[_0x8aa8('0x3')]},'baseUrl':{'type':Sequelize[_0x8aa8('0x3')]},'authToken':{'type':Sequelize[_0x8aa8('0x3')]},'notificationTemplate':{'type':Sequelize[_0x8aa8('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8aa8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8aa8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8aa8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8aa8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8aa8('0xa')],'comment':_0x8aa8('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![],'comment':_0x8aa8('0xc'),'set':function(_0x4ac3eb){if(!_0x4ac3eb){this[_0x8aa8('0xd')](_0x8aa8('0xe'),null);}this['setDataValue']('mandatoryDisposition',_0x4ac3eb);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd241=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x43f6a0,_0xe9102c){var _0x58a774=function(_0x28d30a){while(--_0x28d30a){_0x43f6a0['push'](_0x43f6a0['shift']());}};_0x58a774(++_0xe9102c);}(_0xd241,0x101));var _0x1d24=function(_0x32abba,_0x3c05a2){_0x32abba=_0x32abba-0x0;var _0x21e82e=_0xd241[_0x32abba];return _0x21e82e;};'use strict';var Sequelize=require(_0x1d24('0x0'));var rs=require('randomstring');module[_0x1d24('0x1')]={'name':{'type':Sequelize[_0x1d24('0x2')],'unique':_0x1d24('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x1d24('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x1d24('0x2')],'defaultValue':function(){return rs[_0x1d24('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1d24('0x5'),'sinch')},'accountSid':{'type':Sequelize[_0x1d24('0x2')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x1d24('0x2')]},'notificationTemplate':{'type':Sequelize[_0x1d24('0x6')],'defaultValue':function(){return _0x1d24('0x7');}},'notificationSound':{'type':Sequelize[_0x1d24('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x1d24('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1d24('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1d24('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1d24('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1d24('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x1d24('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x1d24('0x8')],'defaultValue':![],'comment':_0x1d24('0xb'),'set':function(_0x5036eb){if(!_0x5036eb){this[_0x1d24('0xc')](_0x1d24('0xd'),null);}this['setDataValue'](_0x1d24('0xe'),_0x5036eb);}},'description':{'type':Sequelize[_0x1d24('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 71450ad..52e958d 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 _0xca79=['CmList','DESC','Contacts','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','WhatsappMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','waitForTheAssignedQueue','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','ListId','out','Messages','dataValues','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','WhatsappAccount','includeAll','include','findAll','rows','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','transaction','Transaction','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','Applications','account','sinch','statuses','read','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','Body','messageId','MessageSid','notifications','message_id','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x13e230,_0x4135ce){var _0x20ef25=function(_0x2004eb){while(--_0x2004eb){_0x13e230['push'](_0x13e230['shift']());}};_0x20ef25(++_0x4135ce);}(_0xca79,0xe4));var _0x9ca7=function(_0x4670c6,_0x11721d){_0x4670c6=_0x4670c6-0x0;var _0x37be44=_0xca79[_0x4670c6];return _0x37be44;};'use strict';var emlformat=require(_0x9ca7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9ca7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ca7('0x2'));var moment=require('moment');var BPromise=require(_0x9ca7('0x3'));var Mustache=require(_0x9ca7('0x4'));var util=require(_0x9ca7('0x5'));var path=require(_0x9ca7('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9ca7('0x7'));var fs=require('fs');var fs_extra=require(_0x9ca7('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9ca7('0x9'));var jsforce=require(_0x9ca7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9ca7('0xb'));var querystring=require(_0x9ca7('0xc'));var Papa=require('papaparse');var Redis=require(_0x9ca7('0xd'));var authService=require(_0x9ca7('0xe'));var qs=require(_0x9ca7('0xf'));var as=require(_0x9ca7('0x10'));var hardwareService=require(_0x9ca7('0x11'));var logger=require(_0x9ca7('0x12'))(_0x9ca7('0x13'));var utils=require(_0x9ca7('0x14'));var config=require(_0x9ca7('0x15'));var licenseUtil=require(_0x9ca7('0x16'));var db=require('../../mysqldb')['db'];config[_0x9ca7('0x17')]=_[_0x9ca7('0x18')](config[_0x9ca7('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x9ca7('0x19'))(new Redis(config[_0x9ca7('0x17')]));require(_0x9ca7('0x1a'))['register'](socket);var jayson=require(_0x9ca7('0x1b'));var client=jayson[_0x9ca7('0x1c')][_0x9ca7('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x150043,_0x1ba420,_0x14ac06,_0x432738){return new BPromise(function(_0x2d0518,_0x5de2d7){var _0x3b4c26=_0x432738||client;return _0x3b4c26[_0x9ca7('0x1e')](_0x150043,_0x14ac06)[_0x9ca7('0x1f')](function(_0x149f1b){logger[_0x9ca7('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x1ba420,'request\x20sent');logger[_0x9ca7('0x21')](_0x9ca7('0x22'),_0x1ba420,_0x9ca7('0x23'),JSON['stringify'](_0x149f1b));if(_0x149f1b[_0x9ca7('0x24')]){if(_0x149f1b[_0x9ca7('0x24')]['code']===0x1f4){logger['error'](_0x9ca7('0x25'),_0x1ba420,_0x149f1b[_0x9ca7('0x24')][_0x9ca7('0x26')]);return _0x5de2d7(_0x149f1b[_0x9ca7('0x24')][_0x9ca7('0x26')]);}logger[_0x9ca7('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x1ba420,_0x149f1b[_0x9ca7('0x24')]['message']);return _0x2d0518(_0x149f1b[_0x9ca7('0x24')][_0x9ca7('0x26')]);}else{logger[_0x9ca7('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x1ba420,_0x9ca7('0x23'));_0x2d0518(_0x149f1b[_0x9ca7('0x27')][_0x9ca7('0x26')]);}})[_0x9ca7('0x28')](function(_0xeaf484){logger[_0x9ca7('0x24')](_0x9ca7('0x25'),_0x1ba420,_0xeaf484);_0x5de2d7(_0xeaf484);});});}function respondWithStatusCode(_0x149c48,_0x32cb7c){_0x32cb7c=_0x32cb7c||0xcc;return function(_0x3b7135){if(_0x3b7135){return _0x149c48[_0x9ca7('0x29')](_0x32cb7c);}return _0x149c48[_0x9ca7('0x2a')](_0x32cb7c)[_0x9ca7('0x2b')]();};}function respondWithResult(_0x2581d9,_0x1806e9){_0x1806e9=_0x1806e9||0xc8;return function(_0x316ebb){if(_0x316ebb){return _0x2581d9[_0x9ca7('0x2a')](_0x1806e9)[_0x9ca7('0x2c')](_0x316ebb);}};}function respondWithFilteredResult(_0x4842e4,_0x4676bb){return function(_0x5ea6d0){if(_0x5ea6d0){var _0x2b18f9=typeof _0x4676bb[_0x9ca7('0x2d')]===_0x9ca7('0x2e')&&typeof _0x4676bb[_0x9ca7('0x2f')]===_0x9ca7('0x2e');var _0x4a01f5=_0x5ea6d0[_0x9ca7('0x30')];var _0x233ceb=_0x2b18f9?0x0:_0x4676bb[_0x9ca7('0x2d')];var _0x64e5f4=_0x2b18f9?_0x5ea6d0[_0x9ca7('0x30')]:_0x4676bb[_0x9ca7('0x2d')]+_0x4676bb[_0x9ca7('0x2f')];var _0x3f6d63;if(_0x64e5f4>=_0x4a01f5){_0x64e5f4=_0x4a01f5;_0x3f6d63=0xc8;}else{_0x3f6d63=0xce;}_0x4842e4[_0x9ca7('0x2a')](_0x3f6d63);return _0x4842e4['set'](_0x9ca7('0x31'),_0x233ceb+'-'+_0x64e5f4+'/'+_0x4a01f5)['json'](_0x5ea6d0);}return null;};}function patchUpdates(_0x527a1f){return function(_0x3e58e1){try{jsonpatch[_0x9ca7('0x32')](_0x3e58e1,_0x527a1f,!![]);}catch(_0x2c04b8){return BPromise['reject'](_0x2c04b8);}return _0x3e58e1['save']();};}function saveUpdates(_0x24f627,_0x30ab11){return function(_0x594670){if(_0x594670){return _0x594670[_0x9ca7('0x33')](_0x24f627)['then'](function(_0x58c3fd){return _0x58c3fd;});}return null;};}function removeEntity(_0x2aaf17,_0x189aec){return function(_0x1a2ad2){if(_0x1a2ad2){return _0x1a2ad2[_0x9ca7('0x34')]()[_0x9ca7('0x1f')](function(){var _0x3a9699=_0x1a2ad2[_0x9ca7('0x35')]({'plain':!![]});var _0x448dbc=_0x9ca7('0x36');return db[_0x9ca7('0x37')][_0x9ca7('0x34')]({'where':{'type':_0x448dbc,'resourceId':_0x3a9699['id']}})[_0x9ca7('0x1f')](function(){return _0x1a2ad2;});})[_0x9ca7('0x1f')](function(){_0x2aaf17[_0x9ca7('0x2a')](0xcc)[_0x9ca7('0x2b')]();});}};}function handleEntityNotFound(_0x2e26df,_0x3a323c){return function(_0x43eaa4){if(!_0x43eaa4){_0x2e26df['sendStatus'](0x194);}return _0x43eaa4;};}function handleError(_0x9064bf,_0x134ba2){_0x134ba2=_0x134ba2||0x1f4;return function(_0x438c8a){logger[_0x9ca7('0x24')](_0x438c8a[_0x9ca7('0x38')]);if(_0x438c8a['name']){delete _0x438c8a[_0x9ca7('0x39')];}_0x9064bf[_0x9ca7('0x2a')](_0x134ba2)[_0x9ca7('0x3a')](_0x438c8a);};}exports[_0x9ca7('0x3b')]=function(_0x16a4e2,_0x207d43){var _0x3aebf0={'include':[{'model':db[_0x9ca7('0x3c')],'as':'mandatoryDispositionPause'}]},_0x53b255={},_0x1e8a27={'count':0x0,'rows':[]};var _0x4cea8f=_[_0x9ca7('0x3d')](db['WhatsappAccount'][_0x9ca7('0x3e')],function(_0x3eff42){return{'name':_0x3eff42[_0x9ca7('0x3f')],'type':_0x3eff42[_0x9ca7('0x40')][_0x9ca7('0x41')]};});_0x53b255[_0x9ca7('0x42')]=_[_0x9ca7('0x3d')](_0x4cea8f,_0x9ca7('0x39'));_0x53b255[_0x9ca7('0x43')]=_[_0x9ca7('0x44')](_0x16a4e2[_0x9ca7('0x43')]);_0x53b255[_0x9ca7('0x45')]=_[_0x9ca7('0x46')](_0x53b255[_0x9ca7('0x42')],_0x53b255[_0x9ca7('0x43')]);_0x3aebf0['attributes']=_[_0x9ca7('0x46')](_0x53b255['model'],qs[_0x9ca7('0x47')](_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x47')]));_0x3aebf0[_0x9ca7('0x48')]=_0x3aebf0[_0x9ca7('0x48')][_0x9ca7('0x49')]?_0x3aebf0['attributes']:_0x53b255[_0x9ca7('0x42')];if(!_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x4a')](_0x9ca7('0x4b'))){_0x3aebf0[_0x9ca7('0x2f')]=qs[_0x9ca7('0x2f')](_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x2f')]);_0x3aebf0[_0x9ca7('0x2d')]=qs[_0x9ca7('0x2d')](_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x2d')]);}_0x3aebf0[_0x9ca7('0x4c')]=qs[_0x9ca7('0x4d')](_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x4d')]);_0x3aebf0[_0x9ca7('0x4e')]=qs['filters'](_['pick'](_0x16a4e2[_0x9ca7('0x43')],_0x53b255['filters']),_0x4cea8f);if(_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x4f')]){_0x3aebf0[_0x9ca7('0x4e')]=_[_0x9ca7('0x50')](_0x3aebf0[_0x9ca7('0x4e')],{'$or':_[_0x9ca7('0x3d')](_0x4cea8f,function(_0x52ba65){if(_0x52ba65[_0x9ca7('0x40')]!=='VIRTUAL'){var _0xa9c9a={};_0xa9c9a[_0x52ba65[_0x9ca7('0x39')]]={'$like':'%'+_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x4f')]+'%'};return _0xa9c9a;}})});}_0x3aebf0=_[_0x9ca7('0x50')]({},_0x3aebf0,_0x16a4e2[_0x9ca7('0x51')]);var _0x9cf980={'where':_0x3aebf0['where']};return db[_0x9ca7('0x52')]['count'](_0x9cf980)[_0x9ca7('0x1f')](function(_0x18efb7){_0x1e8a27[_0x9ca7('0x30')]=_0x18efb7;if(_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x53')]){_0x3aebf0[_0x9ca7('0x54')]=[{'all':!![]}];}return db[_0x9ca7('0x52')][_0x9ca7('0x55')](_0x3aebf0);})[_0x9ca7('0x1f')](function(_0x59df3e){_0x1e8a27[_0x9ca7('0x56')]=_0x59df3e;return _0x1e8a27;})[_0x9ca7('0x1f')](respondWithFilteredResult(_0x207d43,_0x3aebf0))[_0x9ca7('0x28')](handleError(_0x207d43,null));};exports['show']=function(_0x5e42bd,_0x579f94){var _0x423ea2={'raw':![],'where':{'id':_0x5e42bd[_0x9ca7('0x57')]['id']},'include':[{'model':db[_0x9ca7('0x3c')],'as':'mandatoryDispositionPause'}]},_0x2493f3={};_0x2493f3[_0x9ca7('0x42')]=_[_0x9ca7('0x44')](db[_0x9ca7('0x52')][_0x9ca7('0x3e')]);_0x2493f3[_0x9ca7('0x43')]=_[_0x9ca7('0x44')](_0x5e42bd[_0x9ca7('0x43')]);_0x2493f3[_0x9ca7('0x45')]=_[_0x9ca7('0x46')](_0x2493f3[_0x9ca7('0x42')],_0x2493f3[_0x9ca7('0x43')]);_0x423ea2[_0x9ca7('0x48')]=_['intersection'](_0x2493f3['model'],qs[_0x9ca7('0x47')](_0x5e42bd['query'][_0x9ca7('0x47')]));_0x423ea2[_0x9ca7('0x48')]=_0x423ea2[_0x9ca7('0x48')][_0x9ca7('0x49')]?_0x423ea2[_0x9ca7('0x48')]:_0x2493f3['model'];if(_0x5e42bd['query'][_0x9ca7('0x53')]){_0x423ea2[_0x9ca7('0x54')]=[{'all':!![]}];}_0x423ea2=_[_0x9ca7('0x50')]({},_0x423ea2,_0x5e42bd[_0x9ca7('0x51')]);return db[_0x9ca7('0x52')][_0x9ca7('0x58')](_0x423ea2)[_0x9ca7('0x1f')](handleEntityNotFound(_0x579f94,null))[_0x9ca7('0x1f')](respondWithResult(_0x579f94,null))[_0x9ca7('0x28')](handleError(_0x579f94,null));};exports[_0x9ca7('0x59')]=function(_0x3caf17,_0x35df13){return db[_0x9ca7('0x52')][_0x9ca7('0x59')](_0x3caf17['body'],{})[_0x9ca7('0x1f')](function(_0x4cb09f){var _0x5e720b=_0x3caf17['user'][_0x9ca7('0x35')]({'plain':!![]});if(!_0x5e720b)throw new Error(_0x9ca7('0x5a'));if(_0x5e720b[_0x9ca7('0x5b')]===_0x9ca7('0x5c')){var _0x1c301d=_0x4cb09f[_0x9ca7('0x35')]({'plain':!![]});var _0xaf810a=_0x9ca7('0x36');return db[_0x9ca7('0x5d')][_0x9ca7('0x58')]({'where':{'name':_0xaf810a,'userProfileId':_0x5e720b['userProfileId']},'raw':!![]})[_0x9ca7('0x1f')](function(_0x58cb65){if(_0x58cb65&&_0x58cb65[_0x9ca7('0x5e')]===0x0){return db['UserProfileResource'][_0x9ca7('0x59')]({'name':_0x1c301d['name'],'resourceId':_0x1c301d['id'],'type':_0x58cb65['name'],'sectionId':_0x58cb65['id']},{})[_0x9ca7('0x1f')](function(){return _0x4cb09f;});}else{return _0x4cb09f;}})[_0x9ca7('0x28')](function(_0x408551){logger[_0x9ca7('0x24')](_0x9ca7('0x5f'),_0x408551);throw _0x408551;});}return _0x4cb09f;})['then'](respondWithResult(_0x35df13,0xc9))['catch'](handleError(_0x35df13,null));};exports['update']=function(_0x144683,_0x29d6b9){if(_0x144683['body']['id']){delete _0x144683['body']['id'];}return db[_0x9ca7('0x52')]['find']({'where':{'id':_0x144683[_0x9ca7('0x57')]['id']},'include':[{'model':db[_0x9ca7('0x3c')],'as':_0x9ca7('0x60')}]})[_0x9ca7('0x1f')](handleEntityNotFound(_0x29d6b9,null))[_0x9ca7('0x1f')](saveUpdates(_0x144683[_0x9ca7('0x61')],null))[_0x9ca7('0x1f')](respondWithResult(_0x29d6b9,null))['catch'](handleError(_0x29d6b9,null));};exports[_0x9ca7('0x34')]=function(_0x4d2aac,_0x1e0a0f){return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x4d2aac[_0x9ca7('0x57')]['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x1e0a0f,null))[_0x9ca7('0x1f')](removeEntity(_0x1e0a0f,null))['catch'](handleError(_0x1e0a0f,null));};exports[_0x9ca7('0x62')]=function(_0x131096,_0x457ab5){return db[_0x9ca7('0x52')]['describe']()[_0x9ca7('0x1f')](respondWithResult(_0x457ab5,null))[_0x9ca7('0x28')](handleError(_0x457ab5,null));};exports[_0x9ca7('0x63')]=function(_0x43a370,_0x441ffd,_0x524198){if(_0x43a370['body']['id']){delete _0x43a370[_0x9ca7('0x61')]['id'];}return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x43a370[_0x9ca7('0x57')]['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x441ffd,null))[_0x9ca7('0x1f')](function(_0x3c4344){if(_0x3c4344){_0x43a370[_0x9ca7('0x61')][_0x9ca7('0x64')]=_0x3c4344['id'];return db[_0x9ca7('0x65')][_0x9ca7('0x59')](_0x43a370[_0x9ca7('0x61')]);}})[_0x9ca7('0x1f')](respondWithResult(_0x441ffd,null))['catch'](handleError(_0x441ffd,null));};exports[_0x9ca7('0x66')]=function(_0x540ac9,_0x3f4938,_0x5a2f3b){var _0x7a5ea={'raw':![],'where':{}};var _0x1b7641={};var _0x5a0ffc={'count':0x0,'rows':[]};return db[_0x9ca7('0x52')][_0x9ca7('0x67')]({'where':{'id':_0x540ac9[_0x9ca7('0x57')]['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x3f4938,null))[_0x9ca7('0x1f')](function(_0xf1e5c6){if(_0xf1e5c6){_0x1b7641[_0x9ca7('0x42')]=_[_0x9ca7('0x44')](db['Disposition']['rawAttributes']);_0x1b7641[_0x9ca7('0x43')]=_['keys'](_0x540ac9['query']);_0x1b7641[_0x9ca7('0x45')]=_[_0x9ca7('0x46')](_0x1b7641[_0x9ca7('0x42')],_0x1b7641['query']);_0x7a5ea[_0x9ca7('0x48')]=_[_0x9ca7('0x46')](_0x1b7641[_0x9ca7('0x42')],qs[_0x9ca7('0x47')](_0x540ac9['query']['fields']));_0x7a5ea[_0x9ca7('0x48')]=_0x7a5ea['attributes'][_0x9ca7('0x49')]?_0x7a5ea[_0x9ca7('0x48')]:_0x1b7641[_0x9ca7('0x42')];if(!_0x540ac9[_0x9ca7('0x43')]['hasOwnProperty'](_0x9ca7('0x4b'))){_0x7a5ea['limit']=qs['limit'](_0x540ac9[_0x9ca7('0x43')][_0x9ca7('0x2f')]);_0x7a5ea[_0x9ca7('0x2d')]=qs[_0x9ca7('0x2d')](_0x540ac9[_0x9ca7('0x43')][_0x9ca7('0x2d')]);}_0x7a5ea['order']=qs[_0x9ca7('0x4d')](_0x540ac9[_0x9ca7('0x43')]['sort']);_0x7a5ea[_0x9ca7('0x4e')]=qs[_0x9ca7('0x45')](_[_0x9ca7('0x68')](_0x540ac9[_0x9ca7('0x43')],_0x1b7641[_0x9ca7('0x45')]));_0x7a5ea[_0x9ca7('0x4e')]['WhatsappAccountId']=_0xf1e5c6['id'];if(_0x540ac9['query'][_0x9ca7('0x4f')]){_0x7a5ea[_0x9ca7('0x4e')]=_['merge'](_0x7a5ea[_0x9ca7('0x4e')],{'$or':_[_0x9ca7('0x3d')](_0x7a5ea[_0x9ca7('0x48')],function(_0x5c2dab){var _0xf23af4={};_0xf23af4[_0x5c2dab]={'$like':'%'+_0x540ac9[_0x9ca7('0x43')][_0x9ca7('0x4f')]+'%'};return _0xf23af4;})});}_0x7a5ea=_[_0x9ca7('0x50')]({},_0x7a5ea,_0x540ac9['options']);return db[_0x9ca7('0x65')][_0x9ca7('0x30')]({'where':_0x7a5ea[_0x9ca7('0x4e')]})[_0x9ca7('0x1f')](function(_0x5c3de2){_0x5a0ffc['count']=_0x5c3de2;if(_0x540ac9[_0x9ca7('0x43')]['includeAll']){_0x7a5ea[_0x9ca7('0x54')]=[{'all':!![]}];}return db[_0x9ca7('0x65')]['findAll'](_0x7a5ea);})[_0x9ca7('0x1f')](function(_0x16336a){_0x5a0ffc[_0x9ca7('0x56')]=_0x16336a;return _0x5a0ffc;});}})[_0x9ca7('0x1f')](respondWithFilteredResult(_0x3f4938,_0x7a5ea))[_0x9ca7('0x28')](handleError(_0x3f4938,null));};exports[_0x9ca7('0x69')]=function(_0x3c198e,_0x468711,_0x449849){return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x3c198e['params']['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x468711,null))[_0x9ca7('0x1f')](function(_0x3df678){if(_0x3df678){return _0x3df678[_0x9ca7('0x69')](_0x3c198e[_0x9ca7('0x43')][_0x9ca7('0x6a')]);}})['then'](respondWithStatusCode(_0x468711,null))[_0x9ca7('0x28')](handleError(_0x468711,null));};exports[_0x9ca7('0x6b')]=function(_0x51e894,_0x345a90,_0x1ba1fa){if(_0x51e894[_0x9ca7('0x61')]['id']){delete _0x51e894['body']['id'];}return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x51e894[_0x9ca7('0x57')]['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x345a90,null))[_0x9ca7('0x1f')](function(_0x5aafb0){if(_0x5aafb0){_0x51e894[_0x9ca7('0x61')][_0x9ca7('0x64')]=_0x5aafb0['id'];return db[_0x9ca7('0x6c')][_0x9ca7('0x59')](_0x51e894[_0x9ca7('0x61')]);}})[_0x9ca7('0x1f')](respondWithResult(_0x345a90,null))[_0x9ca7('0x28')](handleError(_0x345a90,null));};exports[_0x9ca7('0x6d')]=function(_0x3b3795,_0x523c08,_0x43ea5f){var _0x22df56={'raw':![],'where':{}};var _0xeac2bb={};var _0x6852ab={'count':0x0,'rows':[]};return db[_0x9ca7('0x52')][_0x9ca7('0x67')]({'where':{'id':_0x3b3795['params']['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x523c08,null))[_0x9ca7('0x1f')](function(_0x566e8b){if(_0x566e8b){_0xeac2bb[_0x9ca7('0x42')]=_[_0x9ca7('0x44')](db['CannedAnswer'][_0x9ca7('0x3e')]);_0xeac2bb['query']=_[_0x9ca7('0x44')](_0x3b3795[_0x9ca7('0x43')]);_0xeac2bb[_0x9ca7('0x45')]=_[_0x9ca7('0x46')](_0xeac2bb[_0x9ca7('0x42')],_0xeac2bb['query']);_0x22df56[_0x9ca7('0x48')]=_['intersection'](_0xeac2bb[_0x9ca7('0x42')],qs[_0x9ca7('0x47')](_0x3b3795[_0x9ca7('0x43')][_0x9ca7('0x47')]));_0x22df56['attributes']=_0x22df56[_0x9ca7('0x48')]['length']?_0x22df56[_0x9ca7('0x48')]:_0xeac2bb[_0x9ca7('0x42')];if(!_0x3b3795[_0x9ca7('0x43')][_0x9ca7('0x4a')](_0x9ca7('0x4b'))){_0x22df56['limit']=qs[_0x9ca7('0x2f')](_0x3b3795[_0x9ca7('0x43')][_0x9ca7('0x2f')]);_0x22df56[_0x9ca7('0x2d')]=qs[_0x9ca7('0x2d')](_0x3b3795[_0x9ca7('0x43')][_0x9ca7('0x2d')]);}_0x22df56[_0x9ca7('0x4c')]=qs[_0x9ca7('0x4d')](_0x3b3795['query'][_0x9ca7('0x4d')]);_0x22df56[_0x9ca7('0x4e')]=qs[_0x9ca7('0x45')](_[_0x9ca7('0x68')](_0x3b3795[_0x9ca7('0x43')],_0xeac2bb[_0x9ca7('0x45')]));_0x22df56[_0x9ca7('0x4e')][_0x9ca7('0x64')]=_0x566e8b['id'];if(_0x3b3795[_0x9ca7('0x43')]['filter']){_0x22df56[_0x9ca7('0x4e')]=_[_0x9ca7('0x50')](_0x22df56[_0x9ca7('0x4e')],{'$or':_[_0x9ca7('0x3d')](_0x22df56[_0x9ca7('0x48')],function(_0x41eecd){var _0x47bb7f={};_0x47bb7f[_0x41eecd]={'$like':'%'+_0x3b3795[_0x9ca7('0x43')]['filter']+'%'};return _0x47bb7f;})});}_0x22df56=_[_0x9ca7('0x50')]({},_0x22df56,_0x3b3795[_0x9ca7('0x51')]);return db[_0x9ca7('0x6c')][_0x9ca7('0x30')]({'where':_0x22df56[_0x9ca7('0x4e')]})[_0x9ca7('0x1f')](function(_0x15b5a9){_0x6852ab[_0x9ca7('0x30')]=_0x15b5a9;if(_0x3b3795['query'][_0x9ca7('0x53')]){_0x22df56[_0x9ca7('0x54')]=[{'all':!![]}];}return db[_0x9ca7('0x6c')][_0x9ca7('0x55')](_0x22df56);})[_0x9ca7('0x1f')](function(_0x57cec6){_0x6852ab[_0x9ca7('0x56')]=_0x57cec6;return _0x6852ab;});}})[_0x9ca7('0x1f')](respondWithFilteredResult(_0x523c08,_0x22df56))[_0x9ca7('0x28')](handleError(_0x523c08,null));};exports[_0x9ca7('0x6e')]=function(_0x45c22b,_0x5e11e8,_0x279a2b){return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x45c22b[_0x9ca7('0x57')]['id']}})['then'](handleEntityNotFound(_0x5e11e8,null))[_0x9ca7('0x1f')](function(_0x247801){if(_0x247801){return _0x247801[_0x9ca7('0x6e')](_0x45c22b[_0x9ca7('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x5e11e8,null))[_0x9ca7('0x28')](handleError(_0x5e11e8,null));};exports['addAgents']=function(_0x1651c4,_0x5394c7,_0x306293){return db[_0x9ca7('0x52')]['find']({'where':{'id':_0x1651c4[_0x9ca7('0x57')]['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x5394c7,null))[_0x9ca7('0x1f')](function(_0x3c84d7){if(_0x3c84d7){return _0x3c84d7[_0x9ca7('0x6f')](_0x1651c4[_0x9ca7('0x61')]['ids'],_[_0x9ca7('0x70')](_0x1651c4['body'],[_0x9ca7('0x6a'),'id'])||{})['spread'](function(_0x7cf4ac){for(var _0x15f619=0x0;_0x15f619<_0x1651c4[_0x9ca7('0x61')][_0x9ca7('0x6a')][_0x9ca7('0x49')];_0x15f619+=0x1){socket[_0x9ca7('0x71')]('userWhatsappAccount:save',{'UserId':Number(_0x1651c4[_0x9ca7('0x61')][_0x9ca7('0x6a')][_0x15f619]),'WhatsappAccountId':Number(_0x1651c4[_0x9ca7('0x57')]['id'])});}return _0x7cf4ac;});}})[_0x9ca7('0x1f')](respondWithResult(_0x5394c7,null))[_0x9ca7('0x28')](handleError(_0x5394c7,null));};exports[_0x9ca7('0x72')]=function(_0x2b85ce,_0x79fee3,_0x400c30){return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x2b85ce['params']['id']}})['then'](handleEntityNotFound(_0x79fee3,null))[_0x9ca7('0x1f')](function(_0x545369){if(_0x545369){return _0x545369[_0x9ca7('0x72')](_0x2b85ce[_0x9ca7('0x43')][_0x9ca7('0x6a')])[_0x9ca7('0x1f')](function(){if(_[_0x9ca7('0x73')](_0x2b85ce[_0x9ca7('0x43')][_0x9ca7('0x6a')])){for(var _0x1241d1=0x0;_0x1241d1<_0x2b85ce[_0x9ca7('0x43')][_0x9ca7('0x6a')][_0x9ca7('0x49')];_0x1241d1+=0x1){socket[_0x9ca7('0x71')](_0x9ca7('0x74'),{'UserId':Number(_0x2b85ce[_0x9ca7('0x43')][_0x9ca7('0x6a')][_0x1241d1]),'WhatsappAccountId':Number(_0x2b85ce['params']['id'])});}}else{socket['emit'](_0x9ca7('0x74'),{'UserId':Number(_0x2b85ce[_0x9ca7('0x43')][_0x9ca7('0x6a')]),'WhatsappAccountId':Number(_0x2b85ce['params']['id'])});}});}})[_0x9ca7('0x1f')](respondWithStatusCode(_0x79fee3,null))[_0x9ca7('0x28')](handleError(_0x79fee3,null));};exports['getAgents']=function(_0x29571d,_0x512de6,_0x3c137b){var _0x350137={};var _0x2da659={};var _0x4fbaad;var _0x425afe;return db[_0x9ca7('0x52')][_0x9ca7('0x67')]({'where':{'id':_0x29571d[_0x9ca7('0x57')]['id']}})['then'](handleEntityNotFound(_0x512de6,null))['then'](function(_0x4465c9){if(_0x4465c9){_0x4fbaad=_0x4465c9;_0x2da659[_0x9ca7('0x42')]=_[_0x9ca7('0x44')](db[_0x9ca7('0x75')]['rawAttributes']);_0x2da659[_0x9ca7('0x43')]=_[_0x9ca7('0x44')](_0x29571d[_0x9ca7('0x43')]);_0x2da659[_0x9ca7('0x45')]=_['intersection'](_0x2da659[_0x9ca7('0x42')],_0x2da659['query']);_0x350137[_0x9ca7('0x48')]=_[_0x9ca7('0x46')](_0x2da659[_0x9ca7('0x42')],qs[_0x9ca7('0x47')](_0x29571d[_0x9ca7('0x43')][_0x9ca7('0x47')]));_0x350137[_0x9ca7('0x48')]=_0x350137['attributes'][_0x9ca7('0x49')]?_0x350137[_0x9ca7('0x48')]:_0x2da659['model'];_0x350137[_0x9ca7('0x4c')]=qs[_0x9ca7('0x4d')](_0x29571d[_0x9ca7('0x43')][_0x9ca7('0x4d')]);_0x350137['where']=qs[_0x9ca7('0x45')](_[_0x9ca7('0x68')](_0x29571d[_0x9ca7('0x43')],_0x2da659['filters']));if(_0x29571d['query'][_0x9ca7('0x4f')]){_0x350137[_0x9ca7('0x4e')]=_[_0x9ca7('0x50')](_0x350137[_0x9ca7('0x4e')],{'$or':_[_0x9ca7('0x3d')](_0x350137[_0x9ca7('0x48')],function(_0x14a8f8){var _0x3c660b={};_0x3c660b[_0x14a8f8]={'$like':'%'+_0x29571d[_0x9ca7('0x43')][_0x9ca7('0x4f')]+'%'};return _0x3c660b;})});}_0x350137=_[_0x9ca7('0x50')]({},_0x350137,_0x29571d[_0x9ca7('0x51')]);return _0x4fbaad[_0x9ca7('0x76')](_0x350137);}})['then'](function(_0x4989d7){if(_0x4989d7){_0x425afe=_0x4989d7[_0x9ca7('0x49')];if(!_0x29571d[_0x9ca7('0x43')][_0x9ca7('0x4a')](_0x9ca7('0x4b'))){_0x350137[_0x9ca7('0x2f')]=qs['limit'](_0x29571d[_0x9ca7('0x43')][_0x9ca7('0x2f')]);_0x350137[_0x9ca7('0x2d')]=qs[_0x9ca7('0x2d')](_0x29571d[_0x9ca7('0x43')][_0x9ca7('0x2d')]);}return _0x4fbaad[_0x9ca7('0x76')](_0x350137);}})[_0x9ca7('0x1f')](function(_0xd6e84){if(_0xd6e84){return _0xd6e84?{'count':_0x425afe,'rows':_0xd6e84}:null;}})['then'](respondWithResult(_0x512de6,null))[_0x9ca7('0x28')](handleError(_0x512de6,null));};exports[_0x9ca7('0x77')]=function(_0x3a3976,_0x1417fd){var _0x4b618e=_0x3a3976['params']['id'];var _0x44868d=_0x3a3976[_0x9ca7('0x61')];var _0x5ab5e3=0xc8;var _0x4aa75d=null;return db['sequelize'][_0x9ca7('0x78')]({'isolationLevel':db['sequelize'][_0x9ca7('0x79')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x220cc5){return db[_0x9ca7('0x52')]['findOne']({'where':{'id':_0x4b618e},'transaction':_0x220cc5})[_0x9ca7('0x1f')](function(_0x5069b4){if(_0x5069b4){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x4b618e},'transaction':_0x220cc5})[_0x9ca7('0x1f')](function(){var _0x1878af=_['map'](_0x44868d,function(_0x463a96){_0x463a96[_0x9ca7('0x64')]=_0x4b618e;return _0x463a96;});return db[_0x9ca7('0x7a')]['bulkCreate'](_0x1878af,{'transaction':_0x220cc5});});}else{_0x5ab5e3=0x194;_0x4aa75d=[];}});})[_0x9ca7('0x1f')](function(){if(_0x5ab5e3!==0x194){return db[_0x9ca7('0x7a')][_0x9ca7('0x7b')]({'where':{'WhatsappAccountId':_0x4b618e},'order':_0x9ca7('0x7c')})[_0x9ca7('0x1f')](function(_0x185bc0){_0x4aa75d=_0x185bc0;});}})[_0x9ca7('0x28')](function(_0x17e0c1){_0x5ab5e3=0x1f4;logger[_0x9ca7('0x24')](_0x17e0c1[_0x9ca7('0x38')]);if(_0x17e0c1[_0x9ca7('0x39')]){delete _0x17e0c1[_0x9ca7('0x39')];}_0x4aa75d=_0x17e0c1;})[_0x9ca7('0x7d')](function(){if(_0x4aa75d===null){_0x1417fd[_0x9ca7('0x29')](_0x5ab5e3);}else{if(_0x5ab5e3===0x1f4){_0x1417fd[_0x9ca7('0x2a')](_0x5ab5e3)[_0x9ca7('0x3a')](_0x4aa75d);}else{_0x1417fd[_0x9ca7('0x2a')](_0x5ab5e3)[_0x9ca7('0x2c')](_0x4aa75d);}}});};exports[_0x9ca7('0x7e')]=function(_0x5a9013,_0x426c32,_0x1113ba){var _0x1284e2={};var _0x3371a9={};var _0x2ad2b1;var _0x3f6159;return db[_0x9ca7('0x52')][_0x9ca7('0x67')]({'where':{'id':_0x5a9013['params']['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x426c32,null))[_0x9ca7('0x1f')](function(_0x71fe9c){if(_0x71fe9c){_0x2ad2b1=_0x71fe9c;_0x3371a9['model']=_[_0x9ca7('0x44')](db['WhatsappApplication']['rawAttributes']);_0x3371a9[_0x9ca7('0x43')]=_[_0x9ca7('0x44')](_0x5a9013[_0x9ca7('0x43')]);_0x3371a9[_0x9ca7('0x45')]=_[_0x9ca7('0x46')](_0x3371a9[_0x9ca7('0x42')],_0x3371a9[_0x9ca7('0x43')]);_0x1284e2[_0x9ca7('0x48')]=_[_0x9ca7('0x46')](_0x3371a9[_0x9ca7('0x42')],qs['fields'](_0x5a9013[_0x9ca7('0x43')]['fields']));_0x1284e2[_0x9ca7('0x48')]=_0x1284e2[_0x9ca7('0x48')][_0x9ca7('0x49')]?_0x1284e2['attributes']:_0x3371a9[_0x9ca7('0x42')];_0x1284e2['order']=qs[_0x9ca7('0x4d')](_0x5a9013[_0x9ca7('0x43')][_0x9ca7('0x4d')]);_0x1284e2[_0x9ca7('0x4e')]=qs[_0x9ca7('0x45')](_[_0x9ca7('0x68')](_0x5a9013[_0x9ca7('0x43')],_0x3371a9[_0x9ca7('0x45')]));if(_0x5a9013['query']['filter']){_0x1284e2[_0x9ca7('0x4e')]=_[_0x9ca7('0x50')](_0x1284e2[_0x9ca7('0x4e')],{'$or':_[_0x9ca7('0x3d')](_0x1284e2[_0x9ca7('0x48')],function(_0x2454b5){var _0x110bde={};_0x110bde[_0x2454b5]={'$like':'%'+_0x5a9013[_0x9ca7('0x43')][_0x9ca7('0x4f')]+'%'};return _0x110bde;})});}_0x1284e2=_[_0x9ca7('0x50')]({},_0x1284e2,_0x5a9013[_0x9ca7('0x51')]);return _0x2ad2b1[_0x9ca7('0x7e')](_0x1284e2);}})[_0x9ca7('0x1f')](function(_0x518805){if(_0x518805){_0x3f6159=_0x518805[_0x9ca7('0x49')];if(!_0x5a9013[_0x9ca7('0x43')][_0x9ca7('0x4a')](_0x9ca7('0x4b'))){_0x1284e2[_0x9ca7('0x2f')]=qs[_0x9ca7('0x2f')](_0x5a9013[_0x9ca7('0x43')][_0x9ca7('0x2f')]);_0x1284e2[_0x9ca7('0x2d')]=qs[_0x9ca7('0x2d')](_0x5a9013['query'][_0x9ca7('0x2d')]);}return _0x2ad2b1[_0x9ca7('0x7e')](_0x1284e2);}})[_0x9ca7('0x1f')](function(_0x438a9f){if(_0x438a9f){return _0x438a9f?{'count':_0x3f6159,'rows':_0x438a9f}:null;}})[_0x9ca7('0x1f')](respondWithResult(_0x426c32,null))[_0x9ca7('0x28')](handleError(_0x426c32,null));};exports[_0x9ca7('0x7f')]=function(_0x3d741f,_0x16da25,_0x803430){var _0xafbb0c={'channel':'whatsapp'};var _0x4134c7=[];var _0x464e67=[];var _0x1e195b={};return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x3d741f[_0x9ca7('0x57')]['id']},'include':[{'model':db[_0x9ca7('0x7a')],'as':_0x9ca7('0x80')}]})[_0x9ca7('0x1f')](handleEntityNotFound(_0x16da25,null))[_0x9ca7('0x1f')](function(_0x36d3d6){_0xafbb0c[_0x9ca7('0x81')]=_0x36d3d6;if(_0xafbb0c[_0x9ca7('0x81')]&&_0xafbb0c[_0x9ca7('0x81')][_0x9ca7('0x40')]===_0x9ca7('0x82')&&_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x83')]){if(_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x83')][_0x9ca7('0x49')]===0x0)return;if(_0x3d741f[_0x9ca7('0x61')]['statuses'][0x0]['state']!==_0x9ca7('0x84'))return;return db['WhatsappMessage'][_0x9ca7('0x33')]({'read':!![],'readAt':_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x83')][0x0]['timestamp']},{'where':{'messageId':_0x3d741f[_0x9ca7('0x61')]['statuses'][0x0]['message_id']},'individualHooks':!![]})[_0x9ca7('0x1f')](function(_0x56b93d){return _0x16da25[_0x9ca7('0x2a')](0xc8)[_0x9ca7('0x2c')](_0x56b93d);});}_0xafbb0c[_0x9ca7('0x85')]=_['orderBy'](_0x36d3d6[_0x9ca7('0x80')],[_0x9ca7('0x7c')],[_0x9ca7('0x86')]);if(_0xafbb0c[_0x9ca7('0x81')]['Applications']){delete _0xafbb0c[_0x9ca7('0x81')][_0x9ca7('0x80')];}return db[_0x9ca7('0x87')]['describe']()[_0x9ca7('0x1f')](function(_0x24a7d0){if(!_0x24a7d0){throw new db[(_0x9ca7('0x88'))][(_0x9ca7('0x89'))](_0x9ca7('0x8a'));}_0x4134c7=_[_0x9ca7('0x8b')](_[_0x9ca7('0x44')](_0x24a7d0),[_0x9ca7('0x8c'),_0x9ca7('0x8d')]);_0x464e67=_[_0x9ca7('0x8b')](_[_0x9ca7('0x44')](_0x24a7d0),[_0x9ca7('0x8c'),_0x9ca7('0x8d'),_0x9ca7('0x8e'),'ListId']);_0xafbb0c[_0x9ca7('0x61')]={'mapKey':_0x9ca7('0x8f')};if(_0xafbb0c[_0x9ca7('0x81')]&&_0xafbb0c['account'][_0x9ca7('0x40')]===_0x9ca7('0x90')){_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x91')]=_0x3d741f[_0x9ca7('0x61')]['From']['replace']('whatsapp:','');_0xafbb0c['body'][_0x9ca7('0x61')]=_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x92')];_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x93')]=_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x94')];}if(_0xafbb0c[_0x9ca7('0x81')]&&_0xafbb0c[_0x9ca7('0x81')][_0x9ca7('0x40')]===_0x9ca7('0x82')){_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x91')]=_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x95')][0x0][_0x9ca7('0x91')];_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x61')]=_0x3d741f[_0x9ca7('0x61')]['notifications'][0x0]['message']['body'];_0xafbb0c['body'][_0x9ca7('0x93')]=_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x95')][0x0][_0x9ca7('0x96')];}if(_0xafbb0c['body']['id']){delete _0xafbb0c[_0x9ca7('0x61')]['id'];}if(_[_0x9ca7('0x97')](_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x91')])){throw new db[(_0x9ca7('0x88'))][(_0x9ca7('0x89'))](_0x9ca7('0x98'));}if(_[_0x9ca7('0x97')](_0xafbb0c[_0x9ca7('0x61')]['body'])||_0xafbb0c[_0x9ca7('0x61')]['body']===''){throw new db[(_0x9ca7('0x88'))][(_0x9ca7('0x89'))](_0x9ca7('0x99'));}if(_[_0x9ca7('0x97')](_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x9a')])){throw new db[(_0x9ca7('0x88'))][(_0x9ca7('0x89'))](_0x9ca7('0x9b')+_0x464e67);}if(!_[_0x9ca7('0x9c')](_0x464e67,_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x9a')])){throw new db[(_0x9ca7('0x88'))][(_0x9ca7('0x89'))](_0x9ca7('0x9d')+_0x464e67);}_0x1e195b[_0xafbb0c[_0x9ca7('0x61')]['mapKey']]=_0xafbb0c[_0x9ca7('0x61')]['from'];return db[_0x9ca7('0x9e')][_0x9ca7('0x58')]({'where':{'id':_0xafbb0c[_0x9ca7('0x81')]['ListId']},'include':[{'model':db[_0x9ca7('0x87')],'as':'Contacts','where':_0x1e195b,'limit':0x1,'order':[['updatedAt',_0x9ca7('0x9f')]]}]});})[_0x9ca7('0x1f')](handleEntityNotFound(_0x16da25,null))[_0x9ca7('0x1f')](function(_0x4d86d2){if(_0x4d86d2){_0xafbb0c['list']=_[_0x9ca7('0x70')](_0x4d86d2,['Contacts']);if(_0x4d86d2[_0x9ca7('0xa0')]['length']){return _0x4d86d2[_0x9ca7('0xa0')][0x0];}var _0x15a165=_[_0x9ca7('0x18')](_0xafbb0c[_0x9ca7('0x61')],{'firstName':_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x91')],'ListId':_0x4d86d2['id']});_0x15a165[_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x9a')]]=_0xafbb0c['body']['from'];return db[_0x9ca7('0x87')][_0x9ca7('0x59')](_0x15a165,{'fields':_0x4134c7,'raw':!![]});}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x16da25,null))[_0x9ca7('0x1f')](function(_0x3cc35e){if(_0x3cc35e){_0xafbb0c[_0x9ca7('0xa1')]=_0x3cc35e;var _0x4f3e0c={'ContactId':_0x3cc35e['id'],'phone':_0xafbb0c['body'][_0x9ca7('0x91')],'WhatsappAccountId':_0x3d741f[_0x9ca7('0x57')]['id']};var _0x2cd740={'ContactId':_0x3cc35e['id'],'WhatsappAccountId':_0x3d741f['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0x9ca7('0x58')]({'where':_0x2cd740})[_0x9ca7('0x1f')](function(_0x4143fa){if(_0x4143fa){return[_0x4143fa,![]];}return db[_0x9ca7('0xa2')][_0x9ca7('0x59')](_0x4f3e0c)[_0x9ca7('0x1f')](function(_0x77e6d5){return[_0x77e6d5,!![]];});});}})['spread'](function(_0x225935,_0x52dcc8){_0xafbb0c[_0x9ca7('0xa3')]=_0x225935[_0x9ca7('0x35')]({'plain':!![]});_0xafbb0c['interaction']['created']=![];if(_0x52dcc8){if(_0xafbb0c[_0x9ca7('0x81')][_0x9ca7('0xa4')]){_0xafbb0c[_0x9ca7('0x85')][_0x9ca7('0xa5')]({'id':0x0,'priority':_0xafbb0c['applications'][_0x9ca7('0x49')]+0x1,'app':_0x9ca7('0xa6'),'appdata':_0x9ca7('0xa7'),'interval':_0x9ca7('0xa8')});}_0xafbb0c['interaction'][_0x9ca7('0xa9')]=!![];}return db[_0x9ca7('0xaa')][_0x9ca7('0x59')]({'phone':_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x91')],'messageId':_0xafbb0c['body'][_0x9ca7('0x93')],'body':_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x61')],'WhatsappAccountId':_0x3d741f[_0x9ca7('0x57')]['id'],'WhatsappInteractionId':_0x225935['id'],'direction':'in','ContactId':_0x225935[_0x9ca7('0xab')],'AttachmentId':_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0xac')]});})[_0x9ca7('0x1f')](function(_0x18324e){_0xafbb0c[_0x9ca7('0x26')]=_0x18324e;if(!_0xafbb0c[_0x9ca7('0xa3')][_0x9ca7('0xad')])return;return db[_0x9ca7('0x75')][_0x9ca7('0x58')]({'attributes':['id',_0x9ca7('0x39')],'where':{'id':_0xafbb0c[_0x9ca7('0xa3')][_0x9ca7('0xad')]}});})[_0x9ca7('0x1f')](function(_0x365779){if(_0x365779){_0xafbb0c[_0x9ca7('0x85')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9ca7('0xae'),'appdata':_0x365779['name']+','+(_0xafbb0c[_0x9ca7('0x81')][_0x9ca7('0xaf')]||0xa),'interval':_0x9ca7('0xa8')});}if(!_0xafbb0c['interaction'][_0x9ca7('0xb0')])return;return db[_0x9ca7('0xb1')][_0x9ca7('0x58')]({'attributes':['id',_0x9ca7('0x39')],'where':{'id':_0xafbb0c[_0x9ca7('0xa3')][_0x9ca7('0xb0')]}});})[_0x9ca7('0x1f')](function(_0x1ccaaa){if(_0x1ccaaa){_0xafbb0c[_0x9ca7('0x85')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1ccaaa[_0x9ca7('0x39')]+','+(_0xafbb0c[_0x9ca7('0x81')][_0x9ca7('0xb2')]||0x12c),'interval':_0x9ca7('0xa8')});}return respondWithRpcPromise('Start',_0x9ca7('0xb3'),_0xafbb0c);})[_0x9ca7('0x1f')](function(_0x2f7e2c){if(_0x2f7e2c){var _0x36bd70=0xc8;var _0x43c2d4=_0x9ca7('0xb4');logger[_0x9ca7('0x20')](_0x9ca7('0x22'),_0x43c2d4,_0x36bd70,_0x9ca7('0xb5'));logger['debug'](_0x9ca7('0xb6'),_0x43c2d4,_0x36bd70,_0x9ca7('0xb5'),JSON['stringify'](_0x2f7e2c));if(_0xafbb0c[_0x9ca7('0x81')]['type']===_0x9ca7('0x90')){return _0x16da25[_0x9ca7('0x2a')](_0x36bd70)[_0x9ca7('0xb7')](_0x9ca7('0xb8'),_0x9ca7('0xb9'))[_0x9ca7('0x3a')](_0x9ca7('0xba'));}else{return _0x16da25[_0x9ca7('0x2a')](_0x36bd70)[_0x9ca7('0x2c')](_0x2f7e2c);}}});})[_0x9ca7('0x28')](handleError(_0x16da25,null));};exports[_0x9ca7('0x3a')]=function(_0x20f0a8,_0x4f3516,_0x28d9af){var _0xbb3579,_0x3d98db,_0x49cfe9;if(_['isNil'](_0x20f0a8[_0x9ca7('0x61')][_0x9ca7('0x61')])||_0x20f0a8['body'][_0x9ca7('0x61')]===''){throw new db['Sequelize'][(_0x9ca7('0x89'))](_0x9ca7('0x99'));}if(_[_0x9ca7('0x97')](_0x20f0a8[_0x9ca7('0x61')]['to'])){throw new db[(_0x9ca7('0x88'))][(_0x9ca7('0x89'))](_0x9ca7('0xbb'));}_0xbb3579=_0x20f0a8[_0x9ca7('0x61')]['to'];return db['WhatsappAccount'][_0x9ca7('0x58')]({'where':{'id':_0x20f0a8[_0x9ca7('0x57')]['id']},'include':[{'model':db[_0x9ca7('0x9e')],'as':_0x9ca7('0xbc'),'include':[{'model':db[_0x9ca7('0x87')],'as':_0x9ca7('0xa0'),'where':{'mobile':_0xbb3579},'limit':0x1,'order':[[_0x9ca7('0x8d'),'DESC']]}]}]})[_0x9ca7('0x1f')](handleEntityNotFound(_0x4f3516,null))['then'](function(_0x1ee35b){if(_0x1ee35b&&_0x1ee35b[_0x9ca7('0xbc')]){_0x3d98db=_0x1ee35b[_0x9ca7('0x35')]({'plain':!![]});if(_0x3d98db[_0x9ca7('0xbc')]&&_0x3d98db['List'][_0x9ca7('0xa0')][_0x9ca7('0x49')]){return _0x3d98db['List']['Contacts'][0x0];}return db['CmContact'][_0x9ca7('0x59')](_[_0x9ca7('0x18')](_0x20f0a8[_0x9ca7('0x61')],{'firstName':_0xbb3579,'mobile':_0xbb3579,'phone':_0xbb3579,'ListId':_0x3d98db[_0x9ca7('0xbd')]}));}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x4f3516,null))[_0x9ca7('0x1f')](function(_0x2b5812){if(_0x2b5812){_0x49cfe9=_0x2b5812;return db[_0x9ca7('0xa2')]['find']({'where':{'ContactId':_0x49cfe9['id'],'closed':![],'WhatsappAccountId':_0x3d98db['id']}})[_0x9ca7('0x1f')](function(_0x1e1fbc){if(_0x1e1fbc){return[_0x1e1fbc,![]];}return db[_0x9ca7('0xa2')][_0x9ca7('0x59')]({'UserId':_0x20f0a8['user']['id'],'ContactId':_0x49cfe9['id'],'WhatsappAccountId':_0x3d98db['id'],'phone':_0xbb3579,'firstMsgDirection':_0x9ca7('0xbe'),'Messages':[_[_0x9ca7('0x50')](_0x20f0a8[_0x9ca7('0x61')],{'read':![],'body':_0x20f0a8[_0x9ca7('0x61')][_0x9ca7('0x61')],'phone':_0xbb3579,'WhatsappAccountId':_0x3d98db['id'],'UserId':_0x20f0a8[_0x9ca7('0x5c')]['id'],'ContactId':_0x49cfe9['id']})]},{'include':[{'model':db[_0x9ca7('0xaa')],'as':_0x9ca7('0xbf')}]})[_0x9ca7('0x1f')](function(_0xecd670){return[_0xecd670,!![]];});});}})['spread'](function(_0x37c6ce,_0x2669b7){if(_0x2669b7){return _0x37c6ce;}return db['WhatsappMessage'][_0x9ca7('0x59')](_[_0x9ca7('0x50')](_0x20f0a8[_0x9ca7('0x61')],{'read':![],'body':_0x20f0a8[_0x9ca7('0x61')][_0x9ca7('0x61')],'phone':_0xbb3579,'WhatsappAccountId':_0x3d98db['id'],'WhatsappInteractionId':_0x37c6ce['id'],'UserId':_0x20f0a8[_0x9ca7('0x5c')]['id'],'ContactId':_0x49cfe9['id']}))[_0x9ca7('0x1f')](function(_0x3788e1){_0x37c6ce[_0x9ca7('0xc0')][_0x9ca7('0xbf')]=[];_0x37c6ce['dataValues']['Messages'][_0x9ca7('0xa5')](_0x3788e1[_0x9ca7('0xc0')]);return _0x37c6ce;});})['then'](respondWithResult(_0x4f3516,null))[_0x9ca7('0x28')](handleError(_0x4f3516,null));}; \ No newline at end of file +var _0x0701=['client','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','get','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','WhatsappAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','stack','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','orderBy','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','From','replace','whatsapp:','messageId','MessageSid','from','notifications','message_id','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','Contacts','defaults','contact','WhatsappInteraction','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','waitForTheAssignedAgent','queueId','waitForTheAssignedQueue','Start','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','twilio','Content-Type','\x0a','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./whatsappAccount.socket','register','jayson/promise'];(function(_0x2a7d56,_0x502e65){var _0x28400e=function(_0x47bd12){while(--_0x47bd12){_0x2a7d56['push'](_0x2a7d56['shift']());}};_0x28400e(++_0x502e65);}(_0x0701,0x166));var _0x1070=function(_0xe39d29,_0x15504f){_0xe39d29=_0xe39d29-0x0;var _0xfa1639=_0x0701[_0xe39d29];return _0xfa1639;};'use strict';var emlformat=require(_0x1070('0x0'));var rimraf=require(_0x1070('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1070('0x2'));var rp=require(_0x1070('0x3'));var moment=require(_0x1070('0x4'));var BPromise=require(_0x1070('0x5'));var Mustache=require(_0x1070('0x6'));var util=require(_0x1070('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x1070('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1070('0x9'));var squel=require(_0x1070('0xa'));var crypto=require('crypto');var jsforce=require(_0x1070('0xb'));var deskjs=require(_0x1070('0xc'));var toCsv=require(_0x1070('0x8'));var querystring=require(_0x1070('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1070('0xe'));var qs=require(_0x1070('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1070('0x10'));var logger=require(_0x1070('0x11'))('api');var utils=require(_0x1070('0x12'));var config=require(_0x1070('0x13'));var licenseUtil=require(_0x1070('0x14'));var db=require(_0x1070('0x15'))['db'];config[_0x1070('0x16')]=_['defaults'](config[_0x1070('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1070('0x17'))[_0x1070('0x18')](socket);var jayson=require(_0x1070('0x19'));var client=jayson[_0x1070('0x1a')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5eb416,_0x452658,_0x18b056,_0x30b86a){return new BPromise(function(_0x56e1ca,_0x2f98ca){var _0xec4621=_0x30b86a||client;return _0xec4621['request'](_0x5eb416,_0x18b056)[_0x1070('0x1b')](function(_0x18750d){logger[_0x1070('0x1c')](_0x1070('0x1d'),_0x452658,_0x1070('0x1e'));logger['debug'](_0x1070('0x1f'),_0x452658,'request\x20sent',JSON['stringify'](_0x18750d));if(_0x18750d['error']){if(_0x18750d[_0x1070('0x20')][_0x1070('0x21')]===0x1f4){logger['error'](_0x1070('0x1d'),_0x452658,_0x18750d[_0x1070('0x20')]['message']);return _0x2f98ca(_0x18750d[_0x1070('0x20')][_0x1070('0x22')]);}logger[_0x1070('0x20')](_0x1070('0x1d'),_0x452658,_0x18750d[_0x1070('0x20')][_0x1070('0x22')]);return _0x56e1ca(_0x18750d[_0x1070('0x20')]['message']);}else{logger['info'](_0x1070('0x1d'),_0x452658,'request\x20sent');_0x56e1ca(_0x18750d[_0x1070('0x23')][_0x1070('0x22')]);}})[_0x1070('0x24')](function(_0x2f6ce1){logger[_0x1070('0x20')](_0x1070('0x1d'),_0x452658,_0x2f6ce1);_0x2f98ca(_0x2f6ce1);});});}function respondWithStatusCode(_0x5134bc,_0x31593e){_0x31593e=_0x31593e||0xcc;return function(_0x336865){if(_0x336865){return _0x5134bc[_0x1070('0x25')](_0x31593e);}return _0x5134bc[_0x1070('0x26')](_0x31593e)[_0x1070('0x27')]();};}function respondWithResult(_0x37c215,_0x26e8d4){_0x26e8d4=_0x26e8d4||0xc8;return function(_0x233088){if(_0x233088){return _0x37c215[_0x1070('0x26')](_0x26e8d4)['json'](_0x233088);}};}function respondWithFilteredResult(_0x3c1aec,_0x3629e8){return function(_0x2455e6){if(_0x2455e6){var _0x3062bf=typeof _0x3629e8[_0x1070('0x28')]===_0x1070('0x29')&&typeof _0x3629e8[_0x1070('0x2a')]==='undefined';var _0x521335=_0x2455e6[_0x1070('0x2b')];var _0x4e62a3=_0x3062bf?0x0:_0x3629e8['offset'];var _0x110f11=_0x3062bf?_0x2455e6['count']:_0x3629e8[_0x1070('0x28')]+_0x3629e8[_0x1070('0x2a')];var _0x722e76;if(_0x110f11>=_0x521335){_0x110f11=_0x521335;_0x722e76=0xc8;}else{_0x722e76=0xce;}_0x3c1aec[_0x1070('0x26')](_0x722e76);return _0x3c1aec[_0x1070('0x2c')]('Content-Range',_0x4e62a3+'-'+_0x110f11+'/'+_0x521335)[_0x1070('0x2d')](_0x2455e6);}return null;};}function patchUpdates(_0x1b9284){return function(_0x1ba69b){try{jsonpatch[_0x1070('0x2e')](_0x1ba69b,_0x1b9284,!![]);}catch(_0x10aef9){return BPromise[_0x1070('0x2f')](_0x10aef9);}return _0x1ba69b[_0x1070('0x30')]();};}function saveUpdates(_0x55092b,_0x572fdf){return function(_0x21536b){if(_0x21536b){return _0x21536b[_0x1070('0x31')](_0x55092b)[_0x1070('0x1b')](function(_0x1c1828){return _0x1c1828;});}return null;};}function removeEntity(_0xe17dd2,_0x16034b){return function(_0x4a5ea9){if(_0x4a5ea9){return _0x4a5ea9[_0x1070('0x32')]()[_0x1070('0x1b')](function(){var _0xe1f3ae=_0x4a5ea9[_0x1070('0x33')]({'plain':!![]});var _0x37e817='WhatsappAccounts';return db[_0x1070('0x34')][_0x1070('0x32')]({'where':{'type':_0x37e817,'resourceId':_0xe1f3ae['id']}})[_0x1070('0x1b')](function(){return _0x4a5ea9;});})['then'](function(){_0xe17dd2['status'](0xcc)[_0x1070('0x27')]();});}};}function handleEntityNotFound(_0x5cc504,_0x11cd6d){return function(_0x3ba097){if(!_0x3ba097){_0x5cc504[_0x1070('0x25')](0x194);}return _0x3ba097;};}function handleError(_0x20dc4f,_0xa85162){_0xa85162=_0xa85162||0x1f4;return function(_0x1a197f){logger[_0x1070('0x20')](_0x1a197f['stack']);if(_0x1a197f[_0x1070('0x35')]){delete _0x1a197f['name'];}_0x20dc4f[_0x1070('0x26')](_0xa85162)[_0x1070('0x36')](_0x1a197f);};}exports[_0x1070('0x37')]=function(_0xe7a387,_0x3be2ee){var _0x1209f0={'include':[{'model':db[_0x1070('0x38')],'as':_0x1070('0x39')}]},_0x596289={},_0x377156={'count':0x0,'rows':[]};var _0x3f5efc=_[_0x1070('0x3a')](db[_0x1070('0x3b')][_0x1070('0x3c')],function(_0x4ef007){return{'name':_0x4ef007['fieldName'],'type':_0x4ef007[_0x1070('0x3d')]['key']};});_0x596289[_0x1070('0x3e')]=_[_0x1070('0x3a')](_0x3f5efc,_0x1070('0x35'));_0x596289[_0x1070('0x3f')]=_[_0x1070('0x40')](_0xe7a387['query']);_0x596289[_0x1070('0x41')]=_[_0x1070('0x42')](_0x596289[_0x1070('0x3e')],_0x596289['query']);_0x1209f0[_0x1070('0x43')]=_['intersection'](_0x596289['model'],qs[_0x1070('0x44')](_0xe7a387[_0x1070('0x3f')][_0x1070('0x44')]));_0x1209f0['attributes']=_0x1209f0['attributes']['length']?_0x1209f0[_0x1070('0x43')]:_0x596289[_0x1070('0x3e')];if(!_0xe7a387[_0x1070('0x3f')][_0x1070('0x45')](_0x1070('0x46'))){_0x1209f0[_0x1070('0x2a')]=qs[_0x1070('0x2a')](_0xe7a387['query'][_0x1070('0x2a')]);_0x1209f0[_0x1070('0x28')]=qs[_0x1070('0x28')](_0xe7a387[_0x1070('0x3f')][_0x1070('0x28')]);}_0x1209f0[_0x1070('0x47')]=qs[_0x1070('0x48')](_0xe7a387['query']['sort']);_0x1209f0[_0x1070('0x49')]=qs[_0x1070('0x41')](_[_0x1070('0x4a')](_0xe7a387['query'],_0x596289[_0x1070('0x41')]),_0x3f5efc);if(_0xe7a387['query'][_0x1070('0x4b')]){_0x1209f0[_0x1070('0x49')]=_[_0x1070('0x4c')](_0x1209f0['where'],{'$or':_[_0x1070('0x3a')](_0x3f5efc,function(_0x2a3eb7){if(_0x2a3eb7[_0x1070('0x3d')]!==_0x1070('0x4d')){var _0x472560={};_0x472560[_0x2a3eb7[_0x1070('0x35')]]={'$like':'%'+_0xe7a387['query']['filter']+'%'};return _0x472560;}})});}_0x1209f0=_[_0x1070('0x4c')]({},_0x1209f0,_0xe7a387[_0x1070('0x4e')]);var _0x13c2b4={'where':_0x1209f0[_0x1070('0x49')]};return db[_0x1070('0x3b')][_0x1070('0x2b')](_0x13c2b4)['then'](function(_0x25603b){_0x377156[_0x1070('0x2b')]=_0x25603b;if(_0xe7a387[_0x1070('0x3f')][_0x1070('0x4f')]){_0x1209f0[_0x1070('0x50')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x1070('0x51')](_0x1209f0);})[_0x1070('0x1b')](function(_0x48f73c){_0x377156['rows']=_0x48f73c;return _0x377156;})['then'](respondWithFilteredResult(_0x3be2ee,_0x1209f0))[_0x1070('0x24')](handleError(_0x3be2ee,null));};exports[_0x1070('0x52')]=function(_0x216241,_0x26c931){var _0x31eb99={'raw':![],'where':{'id':_0x216241[_0x1070('0x53')]['id']},'include':[{'model':db[_0x1070('0x38')],'as':_0x1070('0x39')}]},_0x3d200d={};_0x3d200d[_0x1070('0x3e')]=_[_0x1070('0x40')](db[_0x1070('0x3b')]['rawAttributes']);_0x3d200d['query']=_[_0x1070('0x40')](_0x216241[_0x1070('0x3f')]);_0x3d200d[_0x1070('0x41')]=_[_0x1070('0x42')](_0x3d200d[_0x1070('0x3e')],_0x3d200d['query']);_0x31eb99[_0x1070('0x43')]=_[_0x1070('0x42')](_0x3d200d['model'],qs[_0x1070('0x44')](_0x216241['query'][_0x1070('0x44')]));_0x31eb99[_0x1070('0x43')]=_0x31eb99['attributes'][_0x1070('0x54')]?_0x31eb99[_0x1070('0x43')]:_0x3d200d['model'];if(_0x216241[_0x1070('0x3f')][_0x1070('0x4f')]){_0x31eb99[_0x1070('0x50')]=[{'all':!![]}];}_0x31eb99=_[_0x1070('0x4c')]({},_0x31eb99,_0x216241[_0x1070('0x4e')]);return db[_0x1070('0x3b')][_0x1070('0x55')](_0x31eb99)['then'](handleEntityNotFound(_0x26c931,null))[_0x1070('0x1b')](respondWithResult(_0x26c931,null))['catch'](handleError(_0x26c931,null));};exports[_0x1070('0x56')]=function(_0x147cb2,_0x1bd1ce){return db['WhatsappAccount'][_0x1070('0x56')](_0x147cb2['body'],{})[_0x1070('0x1b')](function(_0x115a7b){var _0x2d8b1d=_0x147cb2['user'][_0x1070('0x33')]({'plain':!![]});if(!_0x2d8b1d)throw new Error(_0x1070('0x57'));if(_0x2d8b1d['role']===_0x1070('0x58')){var _0x55af83=_0x115a7b[_0x1070('0x33')]({'plain':!![]});var _0xb67d5e=_0x1070('0x59');return db[_0x1070('0x5a')]['find']({'where':{'name':_0xb67d5e,'userProfileId':_0x2d8b1d[_0x1070('0x5b')]},'raw':!![]})[_0x1070('0x1b')](function(_0x3f2206){if(_0x3f2206&&_0x3f2206['autoAssociation']===0x0){return db[_0x1070('0x34')][_0x1070('0x56')]({'name':_0x55af83[_0x1070('0x35')],'resourceId':_0x55af83['id'],'type':_0x3f2206[_0x1070('0x35')],'sectionId':_0x3f2206['id']},{})[_0x1070('0x1b')](function(){return _0x115a7b;});}else{return _0x115a7b;}})[_0x1070('0x24')](function(_0x303202){logger[_0x1070('0x20')](_0x1070('0x5c'),_0x303202);throw _0x303202;});}return _0x115a7b;})[_0x1070('0x1b')](respondWithResult(_0x1bd1ce,0xc9))[_0x1070('0x24')](handleError(_0x1bd1ce,null));};exports[_0x1070('0x31')]=function(_0x49b276,_0x267b92){if(_0x49b276[_0x1070('0x5d')]['id']){delete _0x49b276['body']['id'];}return db[_0x1070('0x3b')][_0x1070('0x55')]({'where':{'id':_0x49b276[_0x1070('0x53')]['id']},'include':[{'model':db[_0x1070('0x38')],'as':_0x1070('0x39')}]})[_0x1070('0x1b')](handleEntityNotFound(_0x267b92,null))[_0x1070('0x1b')](saveUpdates(_0x49b276[_0x1070('0x5d')],null))[_0x1070('0x1b')](respondWithResult(_0x267b92,null))[_0x1070('0x24')](handleError(_0x267b92,null));};exports[_0x1070('0x32')]=function(_0x36d7fe,_0x593e48){return db[_0x1070('0x3b')]['find']({'where':{'id':_0x36d7fe['params']['id']}})[_0x1070('0x1b')](handleEntityNotFound(_0x593e48,null))[_0x1070('0x1b')](removeEntity(_0x593e48,null))[_0x1070('0x24')](handleError(_0x593e48,null));};exports[_0x1070('0x5e')]=function(_0x5a5ab0,_0x5b522f){return db[_0x1070('0x3b')][_0x1070('0x5e')]()[_0x1070('0x1b')](respondWithResult(_0x5b522f,null))['catch'](handleError(_0x5b522f,null));};exports[_0x1070('0x5f')]=function(_0x3ff143,_0x34bb8f,_0x130c06){if(_0x3ff143[_0x1070('0x5d')]['id']){delete _0x3ff143['body']['id'];}return db[_0x1070('0x3b')]['find']({'where':{'id':_0x3ff143['params']['id']}})[_0x1070('0x1b')](handleEntityNotFound(_0x34bb8f,null))[_0x1070('0x1b')](function(_0x1d7bc1){if(_0x1d7bc1){_0x3ff143['body'][_0x1070('0x60')]=_0x1d7bc1['id'];return db[_0x1070('0x61')][_0x1070('0x56')](_0x3ff143[_0x1070('0x5d')]);}})[_0x1070('0x1b')](respondWithResult(_0x34bb8f,null))[_0x1070('0x24')](handleError(_0x34bb8f,null));};exports['getDispositions']=function(_0x3dd297,_0x322c2f,_0x291dcb){var _0x4691ce={'raw':![],'where':{}};var _0x1b19ad={};var _0x264b71={'count':0x0,'rows':[]};return db[_0x1070('0x3b')][_0x1070('0x62')]({'where':{'id':_0x3dd297[_0x1070('0x53')]['id']}})[_0x1070('0x1b')](handleEntityNotFound(_0x322c2f,null))[_0x1070('0x1b')](function(_0x29baad){if(_0x29baad){_0x1b19ad[_0x1070('0x3e')]=_[_0x1070('0x40')](db[_0x1070('0x61')][_0x1070('0x3c')]);_0x1b19ad[_0x1070('0x3f')]=_[_0x1070('0x40')](_0x3dd297['query']);_0x1b19ad[_0x1070('0x41')]=_[_0x1070('0x42')](_0x1b19ad[_0x1070('0x3e')],_0x1b19ad[_0x1070('0x3f')]);_0x4691ce['attributes']=_[_0x1070('0x42')](_0x1b19ad[_0x1070('0x3e')],qs['fields'](_0x3dd297[_0x1070('0x3f')][_0x1070('0x44')]));_0x4691ce[_0x1070('0x43')]=_0x4691ce[_0x1070('0x43')]['length']?_0x4691ce[_0x1070('0x43')]:_0x1b19ad[_0x1070('0x3e')];if(!_0x3dd297['query'][_0x1070('0x45')](_0x1070('0x46'))){_0x4691ce[_0x1070('0x2a')]=qs[_0x1070('0x2a')](_0x3dd297[_0x1070('0x3f')][_0x1070('0x2a')]);_0x4691ce[_0x1070('0x28')]=qs[_0x1070('0x28')](_0x3dd297[_0x1070('0x3f')][_0x1070('0x28')]);}_0x4691ce['order']=qs[_0x1070('0x48')](_0x3dd297[_0x1070('0x3f')][_0x1070('0x48')]);_0x4691ce[_0x1070('0x49')]=qs['filters'](_[_0x1070('0x4a')](_0x3dd297[_0x1070('0x3f')],_0x1b19ad[_0x1070('0x41')]));_0x4691ce[_0x1070('0x49')][_0x1070('0x60')]=_0x29baad['id'];if(_0x3dd297[_0x1070('0x3f')][_0x1070('0x4b')]){_0x4691ce[_0x1070('0x49')]=_[_0x1070('0x4c')](_0x4691ce[_0x1070('0x49')],{'$or':_[_0x1070('0x3a')](_0x4691ce[_0x1070('0x43')],function(_0x4c5f14){var _0x5a47d5={};_0x5a47d5[_0x4c5f14]={'$like':'%'+_0x3dd297['query'][_0x1070('0x4b')]+'%'};return _0x5a47d5;})});}_0x4691ce=_['merge']({},_0x4691ce,_0x3dd297[_0x1070('0x4e')]);return db['Disposition'][_0x1070('0x2b')]({'where':_0x4691ce[_0x1070('0x49')]})[_0x1070('0x1b')](function(_0x30465e){_0x264b71[_0x1070('0x2b')]=_0x30465e;if(_0x3dd297['query']['includeAll']){_0x4691ce[_0x1070('0x50')]=[{'all':!![]}];}return db[_0x1070('0x61')][_0x1070('0x51')](_0x4691ce);})[_0x1070('0x1b')](function(_0x44aede){_0x264b71[_0x1070('0x63')]=_0x44aede;return _0x264b71;});}})[_0x1070('0x1b')](respondWithFilteredResult(_0x322c2f,_0x4691ce))[_0x1070('0x24')](handleError(_0x322c2f,null));};exports['removeDispositions']=function(_0x2115b6,_0x31a3d5,_0xd81193){return db[_0x1070('0x3b')][_0x1070('0x55')]({'where':{'id':_0x2115b6[_0x1070('0x53')]['id']}})[_0x1070('0x1b')](handleEntityNotFound(_0x31a3d5,null))['then'](function(_0x3ce94d){if(_0x3ce94d){return _0x3ce94d[_0x1070('0x64')](_0x2115b6[_0x1070('0x3f')][_0x1070('0x65')]);}})[_0x1070('0x1b')](respondWithStatusCode(_0x31a3d5,null))[_0x1070('0x24')](handleError(_0x31a3d5,null));};exports[_0x1070('0x66')]=function(_0x193016,_0x386910,_0x400095){if(_0x193016[_0x1070('0x5d')]['id']){delete _0x193016['body']['id'];}return db[_0x1070('0x3b')][_0x1070('0x55')]({'where':{'id':_0x193016[_0x1070('0x53')]['id']}})[_0x1070('0x1b')](handleEntityNotFound(_0x386910,null))[_0x1070('0x1b')](function(_0x393be0){if(_0x393be0){_0x193016['body']['WhatsappAccountId']=_0x393be0['id'];return db[_0x1070('0x67')][_0x1070('0x56')](_0x193016[_0x1070('0x5d')]);}})[_0x1070('0x1b')](respondWithResult(_0x386910,null))[_0x1070('0x24')](handleError(_0x386910,null));};exports['getAnswers']=function(_0xf6c472,_0x4a46bc,_0x1c55a1){var _0x2cde4a={'raw':![],'where':{}};var _0x3d49cd={};var _0x2d75ca={'count':0x0,'rows':[]};return db[_0x1070('0x3b')][_0x1070('0x62')]({'where':{'id':_0xf6c472[_0x1070('0x53')]['id']}})[_0x1070('0x1b')](handleEntityNotFound(_0x4a46bc,null))['then'](function(_0x259387){if(_0x259387){_0x3d49cd['model']=_[_0x1070('0x40')](db[_0x1070('0x67')][_0x1070('0x3c')]);_0x3d49cd[_0x1070('0x3f')]=_['keys'](_0xf6c472[_0x1070('0x3f')]);_0x3d49cd[_0x1070('0x41')]=_[_0x1070('0x42')](_0x3d49cd[_0x1070('0x3e')],_0x3d49cd[_0x1070('0x3f')]);_0x2cde4a[_0x1070('0x43')]=_[_0x1070('0x42')](_0x3d49cd[_0x1070('0x3e')],qs['fields'](_0xf6c472[_0x1070('0x3f')]['fields']));_0x2cde4a['attributes']=_0x2cde4a['attributes'][_0x1070('0x54')]?_0x2cde4a['attributes']:_0x3d49cd[_0x1070('0x3e')];if(!_0xf6c472[_0x1070('0x3f')][_0x1070('0x45')](_0x1070('0x46'))){_0x2cde4a[_0x1070('0x2a')]=qs[_0x1070('0x2a')](_0xf6c472[_0x1070('0x3f')][_0x1070('0x2a')]);_0x2cde4a['offset']=qs[_0x1070('0x28')](_0xf6c472['query'][_0x1070('0x28')]);}_0x2cde4a[_0x1070('0x47')]=qs['sort'](_0xf6c472[_0x1070('0x3f')][_0x1070('0x48')]);_0x2cde4a[_0x1070('0x49')]=qs[_0x1070('0x41')](_[_0x1070('0x4a')](_0xf6c472[_0x1070('0x3f')],_0x3d49cd[_0x1070('0x41')]));_0x2cde4a[_0x1070('0x49')][_0x1070('0x60')]=_0x259387['id'];if(_0xf6c472[_0x1070('0x3f')][_0x1070('0x4b')]){_0x2cde4a[_0x1070('0x49')]=_[_0x1070('0x4c')](_0x2cde4a[_0x1070('0x49')],{'$or':_[_0x1070('0x3a')](_0x2cde4a[_0x1070('0x43')],function(_0x2eafca){var _0x45edf8={};_0x45edf8[_0x2eafca]={'$like':'%'+_0xf6c472['query']['filter']+'%'};return _0x45edf8;})});}_0x2cde4a=_[_0x1070('0x4c')]({},_0x2cde4a,_0xf6c472[_0x1070('0x4e')]);return db[_0x1070('0x67')][_0x1070('0x2b')]({'where':_0x2cde4a[_0x1070('0x49')]})[_0x1070('0x1b')](function(_0x41bd65){_0x2d75ca[_0x1070('0x2b')]=_0x41bd65;if(_0xf6c472['query']['includeAll']){_0x2cde4a[_0x1070('0x50')]=[{'all':!![]}];}return db[_0x1070('0x67')][_0x1070('0x51')](_0x2cde4a);})[_0x1070('0x1b')](function(_0x25bd87){_0x2d75ca[_0x1070('0x63')]=_0x25bd87;return _0x2d75ca;});}})[_0x1070('0x1b')](respondWithFilteredResult(_0x4a46bc,_0x2cde4a))[_0x1070('0x24')](handleError(_0x4a46bc,null));};exports[_0x1070('0x68')]=function(_0x366406,_0x441fd0,_0x163972){return db[_0x1070('0x3b')][_0x1070('0x55')]({'where':{'id':_0x366406['params']['id']}})[_0x1070('0x1b')](handleEntityNotFound(_0x441fd0,null))[_0x1070('0x1b')](function(_0x1a1ece){if(_0x1a1ece){return _0x1a1ece[_0x1070('0x68')](_0x366406[_0x1070('0x3f')][_0x1070('0x65')]);}})[_0x1070('0x1b')](respondWithStatusCode(_0x441fd0,null))[_0x1070('0x24')](handleError(_0x441fd0,null));};exports['addAgents']=function(_0x21407c,_0x3bbd49,_0x5173c1){return db[_0x1070('0x3b')][_0x1070('0x55')]({'where':{'id':_0x21407c[_0x1070('0x53')]['id']}})[_0x1070('0x1b')](handleEntityNotFound(_0x3bbd49,null))[_0x1070('0x1b')](function(_0x2772f9){if(_0x2772f9){return _0x2772f9[_0x1070('0x69')](_0x21407c['body'][_0x1070('0x65')],_[_0x1070('0x6a')](_0x21407c['body'],[_0x1070('0x65'),'id'])||{})[_0x1070('0x6b')](function(_0x36b6c1){for(var _0x15d1c4=0x0;_0x15d1c4<_0x21407c[_0x1070('0x5d')][_0x1070('0x65')]['length'];_0x15d1c4+=0x1){socket[_0x1070('0x6c')]('userWhatsappAccount:save',{'UserId':Number(_0x21407c[_0x1070('0x5d')]['ids'][_0x15d1c4]),'WhatsappAccountId':Number(_0x21407c['params']['id'])});}return _0x36b6c1;});}})[_0x1070('0x1b')](respondWithResult(_0x3bbd49,null))['catch'](handleError(_0x3bbd49,null));};exports[_0x1070('0x6d')]=function(_0x5c2a1f,_0x3f4e68,_0x566c74){return db[_0x1070('0x3b')][_0x1070('0x55')]({'where':{'id':_0x5c2a1f[_0x1070('0x53')]['id']}})[_0x1070('0x1b')](handleEntityNotFound(_0x3f4e68,null))[_0x1070('0x1b')](function(_0x30984b){if(_0x30984b){return _0x30984b[_0x1070('0x6d')](_0x5c2a1f['query'][_0x1070('0x65')])[_0x1070('0x1b')](function(){if(_[_0x1070('0x6e')](_0x5c2a1f[_0x1070('0x3f')][_0x1070('0x65')])){for(var _0x5bd9e5=0x0;_0x5bd9e5<_0x5c2a1f['query'][_0x1070('0x65')][_0x1070('0x54')];_0x5bd9e5+=0x1){socket[_0x1070('0x6c')](_0x1070('0x6f'),{'UserId':Number(_0x5c2a1f[_0x1070('0x3f')][_0x1070('0x65')][_0x5bd9e5]),'WhatsappAccountId':Number(_0x5c2a1f[_0x1070('0x53')]['id'])});}}else{socket[_0x1070('0x6c')](_0x1070('0x6f'),{'UserId':Number(_0x5c2a1f[_0x1070('0x3f')][_0x1070('0x65')]),'WhatsappAccountId':Number(_0x5c2a1f['params']['id'])});}});}})[_0x1070('0x1b')](respondWithStatusCode(_0x3f4e68,null))['catch'](handleError(_0x3f4e68,null));};exports[_0x1070('0x70')]=function(_0x282ea5,_0x4c6bb4,_0x48272c){var _0x2e9c84={};var _0x3452b4={};var _0x20acbd;var _0x31d112;return db[_0x1070('0x3b')][_0x1070('0x62')]({'where':{'id':_0x282ea5['params']['id']}})[_0x1070('0x1b')](handleEntityNotFound(_0x4c6bb4,null))['then'](function(_0x20f1a1){if(_0x20f1a1){_0x20acbd=_0x20f1a1;_0x3452b4[_0x1070('0x3e')]=_['keys'](db['User']['rawAttributes']);_0x3452b4[_0x1070('0x3f')]=_[_0x1070('0x40')](_0x282ea5['query']);_0x3452b4[_0x1070('0x41')]=_[_0x1070('0x42')](_0x3452b4[_0x1070('0x3e')],_0x3452b4[_0x1070('0x3f')]);_0x2e9c84['attributes']=_[_0x1070('0x42')](_0x3452b4['model'],qs[_0x1070('0x44')](_0x282ea5[_0x1070('0x3f')][_0x1070('0x44')]));_0x2e9c84[_0x1070('0x43')]=_0x2e9c84[_0x1070('0x43')][_0x1070('0x54')]?_0x2e9c84[_0x1070('0x43')]:_0x3452b4[_0x1070('0x3e')];_0x2e9c84[_0x1070('0x47')]=qs[_0x1070('0x48')](_0x282ea5[_0x1070('0x3f')][_0x1070('0x48')]);_0x2e9c84['where']=qs[_0x1070('0x41')](_[_0x1070('0x4a')](_0x282ea5['query'],_0x3452b4['filters']));if(_0x282ea5[_0x1070('0x3f')][_0x1070('0x4b')]){_0x2e9c84[_0x1070('0x49')]=_[_0x1070('0x4c')](_0x2e9c84[_0x1070('0x49')],{'$or':_[_0x1070('0x3a')](_0x2e9c84[_0x1070('0x43')],function(_0x4f4f45){var _0x4041a7={};_0x4041a7[_0x4f4f45]={'$like':'%'+_0x282ea5[_0x1070('0x3f')][_0x1070('0x4b')]+'%'};return _0x4041a7;})});}_0x2e9c84=_[_0x1070('0x4c')]({},_0x2e9c84,_0x282ea5[_0x1070('0x4e')]);return _0x20acbd[_0x1070('0x70')](_0x2e9c84);}})[_0x1070('0x1b')](function(_0x1b2f76){if(_0x1b2f76){_0x31d112=_0x1b2f76[_0x1070('0x54')];if(!_0x282ea5[_0x1070('0x3f')][_0x1070('0x45')](_0x1070('0x46'))){_0x2e9c84[_0x1070('0x2a')]=qs['limit'](_0x282ea5['query']['limit']);_0x2e9c84[_0x1070('0x28')]=qs[_0x1070('0x28')](_0x282ea5[_0x1070('0x3f')]['offset']);}return _0x20acbd[_0x1070('0x70')](_0x2e9c84);}})[_0x1070('0x1b')](function(_0x5e55d0){if(_0x5e55d0){return _0x5e55d0?{'count':_0x31d112,'rows':_0x5e55d0}:null;}})[_0x1070('0x1b')](respondWithResult(_0x4c6bb4,null))['catch'](handleError(_0x4c6bb4,null));};exports[_0x1070('0x71')]=function(_0x31abda,_0xfb7c00){var _0x23cd82=_0x31abda['params']['id'];var _0x33e376=_0x31abda[_0x1070('0x5d')];var _0x2ce676=0xc8;var _0x1bec6e=null;return db[_0x1070('0x72')]['transaction']({'isolationLevel':db[_0x1070('0x72')][_0x1070('0x73')][_0x1070('0x74')][_0x1070('0x75')]},function(_0x41be20){return db['WhatsappAccount'][_0x1070('0x62')]({'where':{'id':_0x23cd82},'transaction':_0x41be20})[_0x1070('0x1b')](function(_0x105b07){if(_0x105b07){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x23cd82},'transaction':_0x41be20})['then'](function(){var _0x4ef81f=_['map'](_0x33e376,function(_0x30b8a3){_0x30b8a3[_0x1070('0x60')]=_0x23cd82;return _0x30b8a3;});return db[_0x1070('0x76')][_0x1070('0x77')](_0x4ef81f,{'transaction':_0x41be20});});}else{_0x2ce676=0x194;_0x1bec6e=[];}});})['then'](function(){if(_0x2ce676!==0x194){return db[_0x1070('0x76')][_0x1070('0x78')]({'where':{'WhatsappAccountId':_0x23cd82},'order':'priority'})[_0x1070('0x1b')](function(_0x3cfb36){_0x1bec6e=_0x3cfb36;});}})[_0x1070('0x24')](function(_0x46fa34){_0x2ce676=0x1f4;logger['error'](_0x46fa34[_0x1070('0x79')]);if(_0x46fa34['name']){delete _0x46fa34['name'];}_0x1bec6e=_0x46fa34;})[_0x1070('0x7a')](function(){if(_0x1bec6e===null){_0xfb7c00['sendStatus'](_0x2ce676);}else{if(_0x2ce676===0x1f4){_0xfb7c00[_0x1070('0x26')](_0x2ce676)[_0x1070('0x36')](_0x1bec6e);}else{_0xfb7c00[_0x1070('0x26')](_0x2ce676)[_0x1070('0x2d')](_0x1bec6e);}}});};exports[_0x1070('0x7b')]=function(_0x8f3ecd,_0x4fc334,_0xf54426){var _0x2e989a={};var _0x417d82={};var _0x4644c3;var _0x22dc14;return db[_0x1070('0x3b')][_0x1070('0x62')]({'where':{'id':_0x8f3ecd[_0x1070('0x53')]['id']}})[_0x1070('0x1b')](handleEntityNotFound(_0x4fc334,null))[_0x1070('0x1b')](function(_0x85ae62){if(_0x85ae62){_0x4644c3=_0x85ae62;_0x417d82['model']=_['keys'](db['WhatsappApplication'][_0x1070('0x3c')]);_0x417d82[_0x1070('0x3f')]=_['keys'](_0x8f3ecd[_0x1070('0x3f')]);_0x417d82[_0x1070('0x41')]=_[_0x1070('0x42')](_0x417d82[_0x1070('0x3e')],_0x417d82[_0x1070('0x3f')]);_0x2e989a[_0x1070('0x43')]=_['intersection'](_0x417d82[_0x1070('0x3e')],qs[_0x1070('0x44')](_0x8f3ecd[_0x1070('0x3f')][_0x1070('0x44')]));_0x2e989a[_0x1070('0x43')]=_0x2e989a[_0x1070('0x43')][_0x1070('0x54')]?_0x2e989a[_0x1070('0x43')]:_0x417d82[_0x1070('0x3e')];_0x2e989a['order']=qs[_0x1070('0x48')](_0x8f3ecd['query'][_0x1070('0x48')]);_0x2e989a[_0x1070('0x49')]=qs[_0x1070('0x41')](_[_0x1070('0x4a')](_0x8f3ecd[_0x1070('0x3f')],_0x417d82[_0x1070('0x41')]));if(_0x8f3ecd[_0x1070('0x3f')]['filter']){_0x2e989a['where']=_['merge'](_0x2e989a[_0x1070('0x49')],{'$or':_[_0x1070('0x3a')](_0x2e989a[_0x1070('0x43')],function(_0x42d4e4){var _0x306fe6={};_0x306fe6[_0x42d4e4]={'$like':'%'+_0x8f3ecd[_0x1070('0x3f')][_0x1070('0x4b')]+'%'};return _0x306fe6;})});}_0x2e989a=_[_0x1070('0x4c')]({},_0x2e989a,_0x8f3ecd[_0x1070('0x4e')]);return _0x4644c3[_0x1070('0x7b')](_0x2e989a);}})[_0x1070('0x1b')](function(_0x51a35c){if(_0x51a35c){_0x22dc14=_0x51a35c[_0x1070('0x54')];if(!_0x8f3ecd[_0x1070('0x3f')][_0x1070('0x45')](_0x1070('0x46'))){_0x2e989a[_0x1070('0x2a')]=qs[_0x1070('0x2a')](_0x8f3ecd['query']['limit']);_0x2e989a[_0x1070('0x28')]=qs['offset'](_0x8f3ecd[_0x1070('0x3f')]['offset']);}return _0x4644c3[_0x1070('0x7b')](_0x2e989a);}})['then'](function(_0x5901dd){if(_0x5901dd){return _0x5901dd?{'count':_0x22dc14,'rows':_0x5901dd}:null;}})[_0x1070('0x1b')](respondWithResult(_0x4fc334,null))['catch'](handleError(_0x4fc334,null));};exports[_0x1070('0x7c')]=function(_0xcaf685,_0x1192e1,_0x3aa2ba){var _0x218301={'channel':_0x1070('0x7d')};var _0x2f2697=[];var _0x3659bd=[];var _0x525870={};return db[_0x1070('0x3b')][_0x1070('0x55')]({'where':{'id':_0xcaf685[_0x1070('0x53')]['id']},'include':[{'model':db[_0x1070('0x76')],'as':_0x1070('0x7e')}]})['then'](handleEntityNotFound(_0x1192e1,null))[_0x1070('0x1b')](function(_0x376a3d){_0x218301[_0x1070('0x7f')]=_0x376a3d;if(_0x218301[_0x1070('0x7f')]&&_0x218301[_0x1070('0x7f')][_0x1070('0x3d')]===_0x1070('0x80')&&_0xcaf685[_0x1070('0x5d')][_0x1070('0x81')]){if(_0xcaf685[_0x1070('0x5d')][_0x1070('0x81')][_0x1070('0x54')]===0x0)return;if(_0xcaf685[_0x1070('0x5d')][_0x1070('0x81')][0x0][_0x1070('0x82')]!==_0x1070('0x83'))return;return db[_0x1070('0x84')]['update']({'read':!![],'readAt':_0xcaf685[_0x1070('0x5d')][_0x1070('0x81')][0x0]['timestamp']},{'where':{'messageId':_0xcaf685[_0x1070('0x5d')][_0x1070('0x81')][0x0]['message_id']},'individualHooks':!![]})[_0x1070('0x1b')](function(_0x464413){return _0x1192e1[_0x1070('0x26')](0xc8)['json'](_0x464413);});}_0x218301['applications']=_[_0x1070('0x85')](_0x376a3d[_0x1070('0x7e')],['priority'],['asc']);if(_0x218301[_0x1070('0x7f')]['Applications']){delete _0x218301[_0x1070('0x7f')][_0x1070('0x7e')];}return db[_0x1070('0x86')][_0x1070('0x5e')]()[_0x1070('0x1b')](function(_0x202751){if(!_0x202751){throw new db[(_0x1070('0x87'))][(_0x1070('0x88'))](_0x1070('0x89'));}_0x2f2697=_[_0x1070('0x8a')](_[_0x1070('0x40')](_0x202751),[_0x1070('0x8b'),_0x1070('0x8c')]);_0x3659bd=_[_0x1070('0x8a')](_[_0x1070('0x40')](_0x202751),[_0x1070('0x8b'),_0x1070('0x8c'),'CompanyId',_0x1070('0x8d')]);_0x218301[_0x1070('0x5d')]={'mapKey':_0x1070('0x8e')};if(_0x218301[_0x1070('0x7f')]&&_0x218301['account']['type']==='twilio'){_0x218301[_0x1070('0x5d')]['from']=_0xcaf685[_0x1070('0x5d')][_0x1070('0x8f')][_0x1070('0x90')](_0x1070('0x91'),'');_0x218301[_0x1070('0x5d')][_0x1070('0x5d')]=_0xcaf685[_0x1070('0x5d')]['Body'];_0x218301['body'][_0x1070('0x92')]=_0xcaf685[_0x1070('0x5d')][_0x1070('0x93')];}if(_0x218301[_0x1070('0x7f')]&&_0x218301[_0x1070('0x7f')][_0x1070('0x3d')]===_0x1070('0x80')){_0x218301[_0x1070('0x5d')][_0x1070('0x94')]=_0xcaf685[_0x1070('0x5d')]['notifications'][0x0][_0x1070('0x94')];_0x218301[_0x1070('0x5d')]['body']=_0xcaf685[_0x1070('0x5d')][_0x1070('0x95')][0x0]['message']['body'];_0x218301[_0x1070('0x5d')][_0x1070('0x92')]=_0xcaf685[_0x1070('0x5d')][_0x1070('0x95')][0x0][_0x1070('0x96')];}if(_0x218301[_0x1070('0x5d')]['id']){delete _0x218301['body']['id'];}if(_[_0x1070('0x97')](_0x218301[_0x1070('0x5d')][_0x1070('0x94')])){throw new db[(_0x1070('0x87'))]['ValidationError'](_0x1070('0x98'));}if(_[_0x1070('0x97')](_0x218301[_0x1070('0x5d')][_0x1070('0x5d')])||_0x218301['body'][_0x1070('0x5d')]===''){throw new db[(_0x1070('0x87'))][(_0x1070('0x88'))](_0x1070('0x99'));}if(_['isNil'](_0x218301[_0x1070('0x5d')][_0x1070('0x9a')])){throw new db[(_0x1070('0x87'))][(_0x1070('0x88'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3659bd);}if(!_[_0x1070('0x9b')](_0x3659bd,_0x218301[_0x1070('0x5d')]['mapKey'])){throw new db[(_0x1070('0x87'))][(_0x1070('0x88'))](_0x1070('0x9c')+_0x3659bd);}_0x525870[_0x218301[_0x1070('0x5d')]['mapKey']]=_0x218301['body']['from'];return db[_0x1070('0x9d')][_0x1070('0x55')]({'where':{'id':_0x218301[_0x1070('0x7f')][_0x1070('0x8d')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x525870,'limit':0x1,'order':[[_0x1070('0x8c'),'DESC']]}]});})[_0x1070('0x1b')](handleEntityNotFound(_0x1192e1,null))[_0x1070('0x1b')](function(_0x4acf52){if(_0x4acf52){_0x218301[_0x1070('0x9e')]=_[_0x1070('0x6a')](_0x4acf52,[_0x1070('0x9f')]);if(_0x4acf52['Contacts'][_0x1070('0x54')]){return _0x4acf52[_0x1070('0x9f')][0x0];}var _0x962b69=_[_0x1070('0xa0')](_0x218301['body'],{'firstName':_0x218301[_0x1070('0x5d')][_0x1070('0x94')],'ListId':_0x4acf52['id']});_0x962b69[_0x218301['body'][_0x1070('0x9a')]]=_0x218301['body'][_0x1070('0x94')];return db['CmContact'][_0x1070('0x56')](_0x962b69,{'fields':_0x2f2697,'raw':!![]});}})['then'](handleEntityNotFound(_0x1192e1,null))[_0x1070('0x1b')](function(_0x48ea55){if(_0x48ea55){_0x218301[_0x1070('0xa1')]=_0x48ea55;var _0x325609={'ContactId':_0x48ea55['id'],'phone':_0x218301[_0x1070('0x5d')][_0x1070('0x94')],'WhatsappAccountId':_0xcaf685[_0x1070('0x53')]['id']};var _0x2cdb64={'ContactId':_0x48ea55['id'],'WhatsappAccountId':_0xcaf685[_0x1070('0x53')]['id'],'closed':![]};return db[_0x1070('0xa2')][_0x1070('0x55')]({'where':_0x2cdb64})['then'](function(_0x45af8c){if(_0x45af8c){return[_0x45af8c,![]];}return db[_0x1070('0xa2')][_0x1070('0x56')](_0x325609)['then'](function(_0xf9a6c6){return[_0xf9a6c6,!![]];});});}})[_0x1070('0x6b')](function(_0x17ef28,_0x5a0082){_0x218301[_0x1070('0xa3')]=_0x17ef28[_0x1070('0x33')]({'plain':!![]});_0x218301[_0x1070('0xa3')][_0x1070('0xa4')]=![];if(_0x5a0082){if(_0x218301[_0x1070('0x7f')][_0x1070('0xa5')]){_0x218301[_0x1070('0xa6')][_0x1070('0xa7')]({'id':0x0,'priority':_0x218301['applications']['length']+0x1,'app':_0x1070('0xa8'),'appdata':_0x1070('0xa9'),'interval':_0x1070('0xaa')});}_0x218301['interaction'][_0x1070('0xa4')]=!![];}return db['WhatsappMessage'][_0x1070('0x56')]({'phone':_0x218301['body']['from'],'messageId':_0x218301[_0x1070('0x5d')][_0x1070('0x92')],'body':_0x218301[_0x1070('0x5d')][_0x1070('0x5d')],'WhatsappAccountId':_0xcaf685[_0x1070('0x53')]['id'],'WhatsappInteractionId':_0x17ef28['id'],'direction':'in','ContactId':_0x17ef28['ContactId'],'AttachmentId':_0x218301[_0x1070('0x5d')][_0x1070('0xab')]});})[_0x1070('0x1b')](function(_0xfb2289){_0x218301[_0x1070('0x22')]=_0xfb2289;if(!_0x218301[_0x1070('0xa3')][_0x1070('0xac')])return;return db['User'][_0x1070('0x55')]({'attributes':['id',_0x1070('0x35')],'where':{'id':_0x218301[_0x1070('0xa3')]['UserId']}});})['then'](function(_0x2c5bf3){if(_0x2c5bf3){_0x218301[_0x1070('0xa6')][_0x1070('0xad')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2c5bf3[_0x1070('0x35')]+','+(_0x218301[_0x1070('0x7f')][_0x1070('0xae')]||0xa),'interval':_0x1070('0xaa')});}if(!_0x218301['interaction'][_0x1070('0xaf')])return;return db['WhatsappQueue'][_0x1070('0x55')]({'attributes':['id',_0x1070('0x35')],'where':{'id':_0x218301[_0x1070('0xa3')][_0x1070('0xaf')]}});})[_0x1070('0x1b')](function(_0x1245a5){if(_0x1245a5){_0x218301[_0x1070('0xa6')][_0x1070('0xad')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1245a5[_0x1070('0x35')]+','+(_0x218301['account'][_0x1070('0xb0')]||0x12c),'interval':_0x1070('0xaa')});}return respondWithRpcPromise(_0x1070('0xb1'),'startRouting',_0x218301);})[_0x1070('0x1b')](function(_0x19261a){if(_0x19261a){var _0x3a0d9a=0xc8;var _0x27491e=_0x1070('0xb2');logger[_0x1070('0x1c')](_0x1070('0x1f'),_0x27491e,_0x3a0d9a,_0x1070('0xb3'));logger[_0x1070('0xb4')](_0x1070('0xb5'),_0x27491e,_0x3a0d9a,_0x1070('0xb3'),JSON[_0x1070('0xb6')](_0x19261a));if(_0x218301[_0x1070('0x7f')][_0x1070('0x3d')]===_0x1070('0xb7')){return _0x1192e1[_0x1070('0x26')](_0x3a0d9a)[_0x1070('0x2c')](_0x1070('0xb8'),'text/xml')['send'](_0x1070('0xb9'));}else{return _0x1192e1['status'](_0x3a0d9a)[_0x1070('0x2d')](_0x19261a);}}});})['catch'](handleError(_0x1192e1,null));};exports[_0x1070('0x36')]=function(_0x593021,_0x48a577,_0x142b53){var _0xad3b6b,_0x29f145,_0x1f3689;if(_[_0x1070('0x97')](_0x593021[_0x1070('0x5d')]['body'])||_0x593021['body']['body']===''){throw new db[(_0x1070('0x87'))][(_0x1070('0x88'))](_0x1070('0x99'));}if(_['isNil'](_0x593021[_0x1070('0x5d')]['to'])){throw new db[(_0x1070('0x87'))][(_0x1070('0x88'))](_0x1070('0xba'));}_0xad3b6b=_0x593021['body']['to'];return db[_0x1070('0x3b')][_0x1070('0x55')]({'where':{'id':_0x593021['params']['id']},'include':[{'model':db[_0x1070('0x9d')],'as':_0x1070('0xbb'),'include':[{'model':db[_0x1070('0x86')],'as':_0x1070('0x9f'),'where':{'mobile':_0xad3b6b},'limit':0x1,'order':[['updatedAt',_0x1070('0xbc')]]}]}]})['then'](handleEntityNotFound(_0x48a577,null))[_0x1070('0x1b')](function(_0x4b5fe8){if(_0x4b5fe8&&_0x4b5fe8['List']){_0x29f145=_0x4b5fe8[_0x1070('0x33')]({'plain':!![]});if(_0x29f145[_0x1070('0xbb')]&&_0x29f145['List'][_0x1070('0x9f')][_0x1070('0x54')]){return _0x29f145[_0x1070('0xbb')][_0x1070('0x9f')][0x0];}return db['CmContact']['create'](_[_0x1070('0xa0')](_0x593021[_0x1070('0x5d')],{'firstName':_0xad3b6b,'mobile':_0xad3b6b,'phone':_0xad3b6b,'ListId':_0x29f145[_0x1070('0x8d')]}));}})['then'](handleEntityNotFound(_0x48a577,null))['then'](function(_0x3b7f8d){if(_0x3b7f8d){_0x1f3689=_0x3b7f8d;return db[_0x1070('0xa2')][_0x1070('0x55')]({'where':{'ContactId':_0x1f3689['id'],'closed':![],'WhatsappAccountId':_0x29f145['id']}})[_0x1070('0x1b')](function(_0x5d0d5e){if(_0x5d0d5e){return[_0x5d0d5e,![]];}return db[_0x1070('0xa2')]['create']({'UserId':_0x593021[_0x1070('0x58')]['id'],'ContactId':_0x1f3689['id'],'WhatsappAccountId':_0x29f145['id'],'phone':_0xad3b6b,'firstMsgDirection':_0x1070('0xbd'),'Messages':[_[_0x1070('0x4c')](_0x593021[_0x1070('0x5d')],{'read':![],'body':_0x593021[_0x1070('0x5d')]['body'],'phone':_0xad3b6b,'WhatsappAccountId':_0x29f145['id'],'UserId':_0x593021[_0x1070('0x58')]['id'],'ContactId':_0x1f3689['id']})]},{'include':[{'model':db[_0x1070('0x84')],'as':_0x1070('0xbe')}]})[_0x1070('0x1b')](function(_0x1dadc7){return[_0x1dadc7,!![]];});});}})[_0x1070('0x6b')](function(_0x5a8a8f,_0x14dbce){if(_0x14dbce){return _0x5a8a8f;}return db[_0x1070('0x84')][_0x1070('0x56')](_['merge'](_0x593021[_0x1070('0x5d')],{'read':![],'body':_0x593021['body'][_0x1070('0x5d')],'phone':_0xad3b6b,'WhatsappAccountId':_0x29f145['id'],'WhatsappInteractionId':_0x5a8a8f['id'],'UserId':_0x593021['user']['id'],'ContactId':_0x1f3689['id']}))[_0x1070('0x1b')](function(_0x216628){_0x5a8a8f[_0x1070('0xbf')][_0x1070('0xbe')]=[];_0x5a8a8f[_0x1070('0xbf')][_0x1070('0xbe')][_0x1070('0xa7')](_0x216628[_0x1070('0xbf')]);return _0x5a8a8f;});})[_0x1070('0x1b')](respondWithResult(_0x48a577,null))[_0x1070('0x24')](handleError(_0x48a577,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 57333e6..f2f2a39 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 _0x3df5=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x50a189,_0x1688c0){var _0x4f6779=function(_0x420b5d){while(--_0x420b5d){_0x50a189['push'](_0x50a189['shift']());}};_0x4f6779(++_0x1688c0);}(_0x3df5,0x72));var _0x53df=function(_0x2c6f84,_0x2d6ffe){_0x2c6f84=_0x2c6f84-0x0;var _0x4862d5=_0x3df5[_0x2c6f84];return _0x4862d5;};'use strict';var EventEmitter=require(_0x53df('0x0'));var WhatsappAccount=require(_0x53df('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x53df('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x53df('0x3'),'afterDestroy':_0x53df('0x4')};function emitEvent(_0x49298b){return function(_0x595c9c,_0xf7bddf,_0x5e9669){WhatsappAccountEvents['emit'](_0x49298b+':'+_0x595c9c['id'],_0x595c9c);WhatsappAccountEvents[_0x53df('0x5')](_0x49298b,_0x595c9c);_0x5e9669(null);};}for(var e in events){if(events[_0x53df('0x6')](e)){var event=events[e];WhatsappAccount[_0x53df('0x7')](e,emitEvent(event));}}module[_0x53df('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xc846=['hasOwnProperty','hook','events','../../mysqldb','save','update','remove','emit'];(function(_0x3f1fc0,_0x275cf1){var _0x5d52a3=function(_0xa9bd3a){while(--_0xa9bd3a){_0x3f1fc0['push'](_0x3f1fc0['shift']());}};_0x5d52a3(++_0x275cf1);}(_0xc846,0x1a2));var _0x6c84=function(_0x38d2a6,_0x5bf364){_0x38d2a6=_0x38d2a6-0x0;var _0xbc5b11=_0xc846[_0x38d2a6];return _0xbc5b11;};'use strict';var EventEmitter=require(_0x6c84('0x0'));var WhatsappAccount=require(_0x6c84('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6c84('0x2'),'afterUpdate':_0x6c84('0x3'),'afterDestroy':_0x6c84('0x4')};function emitEvent(_0x2446a1){return function(_0x44687a,_0x582105,_0x106871){WhatsappAccountEvents[_0x6c84('0x5')](_0x2446a1+':'+_0x44687a['id'],_0x44687a);WhatsappAccountEvents[_0x6c84('0x5')](_0x2446a1,_0x44687a);_0x106871(null);};}for(var e in events){if(events[_0x6c84('0x6')](e)){var event=events[e];WhatsappAccount[_0x6c84('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 623d04d..db75e13 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 _0x8046=['bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','api'];(function(_0x316816,_0x53a2c4){var _0x1419df=function(_0x4e54f8){while(--_0x4e54f8){_0x316816['push'](_0x316816['shift']());}};_0x1419df(++_0x53a2c4);}(_0x8046,0x148));var _0x6804=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x8046[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x6804('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6804('0x1'));var moment=require('moment');var BPromise=require(_0x6804('0x2'));var rp=require(_0x6804('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6804('0x4'));var config=require(_0x6804('0x5'));var attributes=require(_0x6804('0x6'));module[_0x6804('0x7')]=function(_0x1f5e89,_0x168b5f){return _0x1f5e89[_0x6804('0x8')](_0x6804('0x9'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51c8=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappAccount','lodash','util','api','moment'];(function(_0x4e2b8c,_0x44294c){var _0x134ec3=function(_0x2621f6){while(--_0x2621f6){_0x4e2b8c['push'](_0x4e2b8c['shift']());}};_0x134ec3(++_0x44294c);}(_0x51c8,0x1ac));var _0x851c=function(_0x4478ca,_0xd3b387){_0x4478ca=_0x4478ca-0x0;var _0x3c6ab6=_0x51c8[_0x4478ca];return _0x3c6ab6;};'use strict';var _=require(_0x851c('0x0'));var util=require(_0x851c('0x1'));var logger=require('../../config/logger')(_0x851c('0x2'));var moment=require(_0x851c('0x3'));var BPromise=require(_0x851c('0x4'));var rp=require(_0x851c('0x5'));var fs=require('fs');var path=require(_0x851c('0x6'));var rimraf=require(_0x851c('0x7'));var config=require(_0x851c('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0x851c('0x9')]=function(_0x162d38,_0x420b0d){return _0x162d38[_0x851c('0xa')](_0x851c('0xb'),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 3483d3c..53a728b 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 _0x457b=['result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','map','include','attributes','model','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x303d08,_0x55b25b){var _0x23ba8f=function(_0x9af715){while(--_0x9af715){_0x303d08['push'](_0x303d08['shift']());}};_0x23ba8f(++_0x55b25b);}(_0x457b,0xca));var _0xb457=function(_0x3cb300,_0x4d7a99){_0x3cb300=_0x3cb300-0x0;var _0x3e0cd9=_0x457b[_0x3cb300];return _0x3e0cd9;};'use strict';var _=require(_0xb457('0x0'));var util=require(_0xb457('0x1'));var moment=require('moment');var BPromise=require(_0xb457('0x2'));var rs=require(_0xb457('0x3'));var fs=require('fs');var Redis=require(_0xb457('0x4'));var db=require(_0xb457('0x5'))['db'];var utils=require(_0xb457('0x6'));var logger=require('../../config/logger')(_0xb457('0x7'));var config=require(_0xb457('0x8'));var jayson=require(_0xb457('0x9'));var client=jayson[_0xb457('0xa')][_0xb457('0xb')]({'port':0x232a});config['redis']=_[_0xb457('0xc')](config[_0xb457('0xd')],{'host':_0xb457('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb457('0xf'))[_0xb457('0x10')](socket);function respondWithRpcPromise(_0x537ec4,_0x19afe8,_0x1cc258){return new BPromise(function(_0x810aed,_0x485de2){return client[_0xb457('0x11')](_0x537ec4,_0x1cc258)[_0xb457('0x12')](function(_0x3c9eb3){logger[_0xb457('0x13')](_0xb457('0x14'),_0x19afe8,'request\x20sent');logger['debug'](_0xb457('0x15'),_0x19afe8,_0xb457('0x16'),JSON[_0xb457('0x17')](_0x3c9eb3));if(_0x3c9eb3[_0xb457('0x18')]){if(_0x3c9eb3[_0xb457('0x18')]['code']===0x1f4){logger['error'](_0xb457('0x14'),_0x19afe8,_0x3c9eb3[_0xb457('0x18')][_0xb457('0x19')]);return _0x485de2(_0x3c9eb3[_0xb457('0x18')]['message']);}logger[_0xb457('0x18')](_0xb457('0x14'),_0x19afe8,_0x3c9eb3[_0xb457('0x18')][_0xb457('0x19')]);return _0x810aed(_0x3c9eb3[_0xb457('0x18')][_0xb457('0x19')]);}else{logger[_0xb457('0x13')](_0xb457('0x14'),_0x19afe8,'request\x20sent');_0x810aed(_0x3c9eb3[_0xb457('0x1a')][_0xb457('0x19')]);}})[_0xb457('0x1b')](function(_0x554c8a){logger['error'](_0xb457('0x14'),_0x19afe8,_0x554c8a);_0x485de2(_0x554c8a);});});}exports[_0xb457('0x1c')]=function(_0x2745d7){var _0x32e825=this;return new Promise(function(_0xd73923,_0x383706){return db[_0xb457('0x1d')]['find']({'raw':_0x2745d7['options']?_0x2745d7[_0xb457('0x1e')][_0xb457('0x1f')]===undefined?!![]:![]:!![],'where':_0x2745d7[_0xb457('0x1e')]?_0x2745d7['options'][_0xb457('0x20')]||null:null,'attributes':_0x2745d7[_0xb457('0x1e')]?_0x2745d7[_0xb457('0x1e')]['attributes']||null:null,'include':_0x2745d7['options']?_0x2745d7[_0xb457('0x1e')]['include']?_[_0xb457('0x21')](_0x2745d7[_0xb457('0x1e')][_0xb457('0x22')],function(_0x1990c2){return{'model':db[_0x1990c2['model']],'as':_0x1990c2['as'],'attributes':_0x1990c2[_0xb457('0x23')],'include':_0x1990c2[_0xb457('0x22')]?_['map'](_0x1990c2[_0xb457('0x22')],function(_0x7ebca){return{'model':db[_0x7ebca[_0xb457('0x24')]],'as':_0x7ebca['as'],'attributes':_0x7ebca[_0xb457('0x23')],'include':_0x7ebca[_0xb457('0x22')]?_[_0xb457('0x21')](_0x7ebca[_0xb457('0x22')],function(_0x51041b){return{'model':db[_0x51041b[_0xb457('0x24')]],'as':_0x51041b['as'],'attributes':_0x51041b[_0xb457('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xaaf240){logger[_0xb457('0x13')](_0xb457('0x1c'),_0x2745d7);logger[_0xb457('0x25')](_0xb457('0x1c'),_0x2745d7,JSON['stringify'](_0xaaf240));_0xd73923(_0xaaf240);})[_0xb457('0x1b')](function(_0x518ff0){logger[_0xb457('0x18')](_0xb457('0x1c'),_0x518ff0['message'],_0x2745d7);_0x383706(_0x32e825[_0xb457('0x18')](0x1f4,_0x518ff0[_0xb457('0x19')]));});});}; \ No newline at end of file +var _0xe76a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','include','map','model','attributes','then','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x132fcf,_0x4968f2){var _0x4f80f9=function(_0x248b8a){while(--_0x248b8a){_0x132fcf['push'](_0x132fcf['shift']());}};_0x4f80f9(++_0x4968f2);}(_0xe76a,0x177));var _0xae76=function(_0x59e4f5,_0x3fd4ab){_0x59e4f5=_0x59e4f5-0x0;var _0x4ced86=_0xe76a[_0x59e4f5];return _0x4ced86;};'use strict';var _=require(_0xae76('0x0'));var util=require(_0xae76('0x1'));var moment=require('moment');var BPromise=require(_0xae76('0x2'));var rs=require(_0xae76('0x3'));var fs=require('fs');var Redis=require(_0xae76('0x4'));var db=require(_0xae76('0x5'))['db'];var utils=require(_0xae76('0x6'));var logger=require(_0xae76('0x7'))(_0xae76('0x8'));var config=require(_0xae76('0x9'));var jayson=require(_0xae76('0xa'));var client=jayson[_0xae76('0xb')][_0xae76('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xae76('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xae76('0xe'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0xae76('0xf')](socket);function respondWithRpcPromise(_0x525891,_0x77778f,_0x2b726b){return new BPromise(function(_0x1d451a,_0x764c84){return client[_0xae76('0x10')](_0x525891,_0x2b726b)['then'](function(_0x2cf55d){logger[_0xae76('0x11')](_0xae76('0x12'),_0x77778f,_0xae76('0x13'));logger[_0xae76('0x14')](_0xae76('0x15'),_0x77778f,_0xae76('0x13'),JSON[_0xae76('0x16')](_0x2cf55d));if(_0x2cf55d[_0xae76('0x17')]){if(_0x2cf55d[_0xae76('0x17')][_0xae76('0x18')]===0x1f4){logger[_0xae76('0x17')](_0xae76('0x12'),_0x77778f,_0x2cf55d[_0xae76('0x17')][_0xae76('0x19')]);return _0x764c84(_0x2cf55d[_0xae76('0x17')]['message']);}logger['error'](_0xae76('0x12'),_0x77778f,_0x2cf55d[_0xae76('0x17')]['message']);return _0x1d451a(_0x2cf55d[_0xae76('0x17')][_0xae76('0x19')]);}else{logger[_0xae76('0x11')](_0xae76('0x12'),_0x77778f,'request\x20sent');_0x1d451a(_0x2cf55d['result'][_0xae76('0x19')]);}})['catch'](function(_0x525d67){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x77778f,_0x525d67);_0x764c84(_0x525d67);});});}exports[_0xae76('0x1a')]=function(_0x3fe9c5){var _0x2759ae=this;return new Promise(function(_0x3cb679,_0x9783c2){return db[_0xae76('0x1b')][_0xae76('0x1c')]({'raw':_0x3fe9c5[_0xae76('0x1d')]?_0x3fe9c5[_0xae76('0x1d')][_0xae76('0x1e')]===undefined?!![]:![]:!![],'where':_0x3fe9c5[_0xae76('0x1d')]?_0x3fe9c5[_0xae76('0x1d')][_0xae76('0x1f')]||null:null,'attributes':_0x3fe9c5['options']?_0x3fe9c5[_0xae76('0x1d')]['attributes']||null:null,'include':_0x3fe9c5[_0xae76('0x1d')]?_0x3fe9c5[_0xae76('0x1d')][_0xae76('0x20')]?_[_0xae76('0x21')](_0x3fe9c5[_0xae76('0x1d')][_0xae76('0x20')],function(_0x3117c1){return{'model':db[_0x3117c1[_0xae76('0x22')]],'as':_0x3117c1['as'],'attributes':_0x3117c1[_0xae76('0x23')],'include':_0x3117c1['include']?_[_0xae76('0x21')](_0x3117c1['include'],function(_0x372408){return{'model':db[_0x372408[_0xae76('0x22')]],'as':_0x372408['as'],'attributes':_0x372408['attributes'],'include':_0x372408[_0xae76('0x20')]?_[_0xae76('0x21')](_0x372408['include'],function(_0xb8a1c6){return{'model':db[_0xb8a1c6[_0xae76('0x22')]],'as':_0xb8a1c6['as'],'attributes':_0xb8a1c6[_0xae76('0x23')]};}):[]};}):[]};}):[]:[]})[_0xae76('0x24')](function(_0xa77e0e){logger[_0xae76('0x11')](_0xae76('0x1a'),_0x3fe9c5);logger[_0xae76('0x14')](_0xae76('0x1a'),_0x3fe9c5,JSON['stringify'](_0xa77e0e));_0x3cb679(_0xa77e0e);})[_0xae76('0x25')](function(_0x35cbc0){logger['error']('ShowWhatsappAccount',_0x35cbc0[_0xae76('0x19')],_0x3fe9c5);_0x9783c2(_0x2759ae[_0xae76('0x17')](0x1f4,_0x35cbc0['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 19b4f94..89dee53 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 _0x458a=['register','length','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener'];(function(_0x53781f,_0xa86c3c){var _0x45ab83=function(_0x3a557a){while(--_0x3a557a){_0x53781f['push'](_0x53781f['shift']());}};_0x45ab83(++_0xa86c3c);}(_0x458a,0x108));var _0xa458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x458a[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappAccountEvents=require(_0xa458('0x0'));var events=[_0xa458('0x1'),_0xa458('0x2'),_0xa458('0x3')];function createListener(_0x2fd1b2,_0x8fca31){return function(_0xb4d968){_0x8fca31[_0xa458('0x4')](_0x2fd1b2,_0xb4d968);};}function removeListener(_0x5d9d83,_0x552a74){return function(){WhatsappAccountEvents[_0xa458('0x5')](_0x5d9d83,_0x552a74);};}exports[_0xa458('0x6')]=function(_0x33518c){for(var _0x1ddbeb=0x0,_0x511d=events[_0xa458('0x7')];_0x1ddbeb<_0x511d;_0x1ddbeb++){var _0x1c22a3=events[_0x1ddbeb];var _0x46305b=createListener(_0xa458('0x8')+_0x1c22a3,_0x33518c);WhatsappAccountEvents['on'](_0x1c22a3,_0x46305b);}}; \ No newline at end of file +var _0xa5c3=['length','whatsappAccount:','save','remove','removeListener'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0xa5c3,0x151));var _0x3a5c=function(_0x23f3cb,_0x1273c7){_0x23f3cb=_0x23f3cb-0x0;var _0x1e7263=_0xa5c3[_0x23f3cb];return _0x1e7263;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x3a5c('0x0'),_0x3a5c('0x1'),'update'];function createListener(_0x77018f,_0x22d1ea){return function(_0x932d1c){_0x22d1ea['emit'](_0x77018f,_0x932d1c);};}function removeListener(_0x386290,_0x44e002){return function(){WhatsappAccountEvents[_0x3a5c('0x2')](_0x386290,_0x44e002);};}exports['register']=function(_0x552446){for(var _0x255b86=0x0,_0x42db7d=events[_0x3a5c('0x3')];_0x255b86<_0x42db7d;_0x255b86++){var _0x3c719b=events[_0x255b86];var _0x1e3b2d=createListener(_0x3a5c('0x4')+_0x3c719b,_0x552446);WhatsappAccountEvents['on'](_0x3c719b,_0x1e3b2d);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index bdc721d..fd02794 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 _0x6f22=['post','create','put','update','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show'];(function(_0x3cdc51,_0x123911){var _0x132c33=function(_0x5a017b){while(--_0x5a017b){_0x3cdc51['push'](_0x3cdc51['shift']());}};_0x132c33(++_0x123911);}(_0x6f22,0x159));var _0x26f2=function(_0x13cab2,_0x148058){_0x13cab2=_0x13cab2-0x0;var _0x292c90=_0x6f22[_0x13cab2];return _0x292c90;};'use strict';var multer=require('multer');var util=require(_0x26f2('0x0'));var path=require(_0x26f2('0x1'));var timeout=require('connect-timeout');var express=require(_0x26f2('0x2'));var router=express[_0x26f2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x26f2('0x4'));var interaction=require(_0x26f2('0x5'));var config=require('../../config/environment');var controller=require(_0x26f2('0x6'));router['get']('/',auth[_0x26f2('0x7')](),controller[_0x26f2('0x8')]);router[_0x26f2('0x9')](_0x26f2('0xa'),auth[_0x26f2('0x7')](),controller[_0x26f2('0xb')]);router[_0x26f2('0xc')]('/',auth[_0x26f2('0x7')](),controller[_0x26f2('0xd')]);router[_0x26f2('0xe')](_0x26f2('0xa'),auth[_0x26f2('0x7')](),controller[_0x26f2('0xf')]);router['delete'](_0x26f2('0xa'),auth[_0x26f2('0x7')](),controller[_0x26f2('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4534=['Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x1eb347,_0x40ad66){var _0x154749=function(_0x21f3e0){while(--_0x21f3e0){_0x1eb347['push'](_0x1eb347['shift']());}};_0x154749(++_0x40ad66);}(_0x4534,0x119));var _0x4453=function(_0xd03c85,_0xb43610){_0xd03c85=_0xd03c85-0x0;var _0x53ffb5=_0x4534[_0xd03c85];return _0x53ffb5;};'use strict';var multer=require(_0x4453('0x0'));var util=require(_0x4453('0x1'));var path=require(_0x4453('0x2'));var timeout=require(_0x4453('0x3'));var express=require('express');var router=express[_0x4453('0x4')]();var fs_extra=require(_0x4453('0x5'));var auth=require(_0x4453('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4453('0x7'));var controller=require(_0x4453('0x8'));router[_0x4453('0x9')]('/',auth[_0x4453('0xa')](),controller[_0x4453('0xb')]);router[_0x4453('0x9')](_0x4453('0xc'),auth[_0x4453('0xa')](),controller[_0x4453('0xd')]);router['post']('/',auth[_0x4453('0xa')](),controller[_0x4453('0xe')]);router[_0x4453('0xf')](_0x4453('0xc'),auth[_0x4453('0xa')](),controller[_0x4453('0x10')]);router[_0x4453('0x11')](_0x4453('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x4453('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 7f543db..9940250 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 _0xd137=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x391154,_0x40fb12){var _0x4b7767=function(_0x3b1573){while(--_0x3b1573){_0x391154['push'](_0x391154['shift']());}};_0x4b7767(++_0x40fb12);}(_0xd137,0x1f1));var _0x7d13=function(_0x343ac5,_0x305ee3){_0x343ac5=_0x343ac5-0x0;var _0x50e0d6=_0xd137[_0x343ac5];return _0x50e0d6;};'use strict';var Sequelize=require(_0x7d13('0x0'));module[_0x7d13('0x1')]={'priority':{'type':Sequelize[_0x7d13('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7d13('0x3')],'allowNull':![],'defaultValue':_0x7d13('0x4')},'appdata':{'type':Sequelize[_0x7d13('0x5')]()},'description':{'type':Sequelize[_0x7d13('0x3')]},'interval':{'type':Sequelize[_0x7d13('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x6231=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6231,0xd5));var _0x1623=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6231[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x1623('0x0'));module[_0x1623('0x1')]={'priority':{'type':Sequelize[_0x1623('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1623('0x3')],'allowNull':![],'defaultValue':_0x1623('0x4')},'appdata':{'type':Sequelize[_0x1623('0x5')]()},'description':{'type':Sequelize[_0x1623('0x3')]},'interval':{'type':Sequelize[_0x1623('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 8f8cecb..0bad663 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 _0xd991=['limit','count','json','apply','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','intersection','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x25d0d6,_0x3a724f){var _0x2342af=function(_0x792fe9){while(--_0x792fe9){_0x25d0d6['push'](_0x25d0d6['shift']());}};_0x2342af(++_0x3a724f);}(_0xd991,0x115));var _0x1d99=function(_0x101f4a,_0x4ec352){_0x101f4a=_0x101f4a-0x0;var _0xc9c822=_0xd991[_0x101f4a];return _0xc9c822;};'use strict';var emlformat=require(_0x1d99('0x0'));var rimraf=require(_0x1d99('0x1'));var zipdir=require(_0x1d99('0x2'));var jsonpatch=require(_0x1d99('0x3'));var rp=require(_0x1d99('0x4'));var moment=require('moment');var BPromise=require(_0x1d99('0x5'));var Mustache=require(_0x1d99('0x6'));var util=require(_0x1d99('0x7'));var path=require(_0x1d99('0x8'));var sox=require(_0x1d99('0x9'));var csv=require(_0x1d99('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d99('0xb'));var _=require(_0x1d99('0xc'));var squel=require('squel');var crypto=require(_0x1d99('0xd'));var jsforce=require(_0x1d99('0xe'));var deskjs=require(_0x1d99('0xf'));var toCsv=require(_0x1d99('0xa'));var querystring=require(_0x1d99('0x10'));var Papa=require(_0x1d99('0x11'));var Redis=require(_0x1d99('0x12'));var authService=require(_0x1d99('0x13'));var qs=require(_0x1d99('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d99('0x15'));var logger=require(_0x1d99('0x16'))('api');var utils=require(_0x1d99('0x17'));var config=require(_0x1d99('0x18'));var licenseUtil=require(_0x1d99('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x442843,_0xf7b799){_0xf7b799=_0xf7b799||0xcc;return function(_0x3c87e3){if(_0x3c87e3){return _0x442843[_0x1d99('0x1a')](_0xf7b799);}return _0x442843[_0x1d99('0x1b')](_0xf7b799)[_0x1d99('0x1c')]();};}function respondWithResult(_0x5f57a8,_0x35dd66){_0x35dd66=_0x35dd66||0xc8;return function(_0x5ad75d){if(_0x5ad75d){return _0x5f57a8[_0x1d99('0x1b')](_0x35dd66)['json'](_0x5ad75d);}};}function respondWithFilteredResult(_0x2f8738,_0x1b2c78){return function(_0x3ac89a){if(_0x3ac89a){var _0x8903f2=typeof _0x1b2c78[_0x1d99('0x1d')]===_0x1d99('0x1e')&&typeof _0x1b2c78[_0x1d99('0x1f')]===_0x1d99('0x1e');var _0x5c31c3=_0x3ac89a[_0x1d99('0x20')];var _0x4da463=_0x8903f2?0x0:_0x1b2c78[_0x1d99('0x1d')];var _0x1a51a4=_0x8903f2?_0x3ac89a[_0x1d99('0x20')]:_0x1b2c78[_0x1d99('0x1d')]+_0x1b2c78[_0x1d99('0x1f')];var _0x5044a7;if(_0x1a51a4>=_0x5c31c3){_0x1a51a4=_0x5c31c3;_0x5044a7=0xc8;}else{_0x5044a7=0xce;}_0x2f8738['status'](_0x5044a7);return _0x2f8738['set']('Content-Range',_0x4da463+'-'+_0x1a51a4+'/'+_0x5c31c3)[_0x1d99('0x21')](_0x3ac89a);}return null;};}function patchUpdates(_0x20af77){return function(_0x234b4b){try{jsonpatch[_0x1d99('0x22')](_0x234b4b,_0x20af77,!![]);}catch(_0x1863c0){return BPromise['reject'](_0x1863c0);}return _0x234b4b[_0x1d99('0x23')]();};}function saveUpdates(_0x2e6c35,_0x4a72ac){return function(_0x25bd22){if(_0x25bd22){return _0x25bd22[_0x1d99('0x24')](_0x2e6c35)[_0x1d99('0x25')](function(_0x3e7160){return _0x3e7160;});}return null;};}function removeEntity(_0x42e482,_0x8273bb){return function(_0x54a295){if(_0x54a295){return _0x54a295[_0x1d99('0x26')]()[_0x1d99('0x25')](function(){_0x42e482['status'](0xcc)[_0x1d99('0x1c')]();});}};}function handleEntityNotFound(_0x31e70e,_0x5b5fd){return function(_0x30a1ef){if(!_0x30a1ef){_0x31e70e['sendStatus'](0x194);}return _0x30a1ef;};}function handleError(_0x27d9d9,_0x50c51e){_0x50c51e=_0x50c51e||0x1f4;return function(_0x150569){logger[_0x1d99('0x27')](_0x150569[_0x1d99('0x28')]);if(_0x150569[_0x1d99('0x29')]){delete _0x150569['name'];}_0x27d9d9[_0x1d99('0x1b')](_0x50c51e)[_0x1d99('0x2a')](_0x150569);};}exports[_0x1d99('0x2b')]=function(_0x37f7b1,_0x11bff3){var _0x1aaf2b={},_0x5c0c0a={},_0x273f41={'count':0x0,'rows':[]};var _0x16cc9f=_[_0x1d99('0x2c')](db[_0x1d99('0x2d')][_0x1d99('0x2e')],function(_0x4b5c90){return{'name':_0x4b5c90[_0x1d99('0x2f')],'type':_0x4b5c90[_0x1d99('0x30')][_0x1d99('0x31')]};});_0x5c0c0a[_0x1d99('0x32')]=_[_0x1d99('0x2c')](_0x16cc9f,_0x1d99('0x29'));_0x5c0c0a[_0x1d99('0x33')]=_[_0x1d99('0x34')](_0x37f7b1[_0x1d99('0x33')]);_0x5c0c0a[_0x1d99('0x35')]=_['intersection'](_0x5c0c0a[_0x1d99('0x32')],_0x5c0c0a[_0x1d99('0x33')]);_0x1aaf2b[_0x1d99('0x36')]=_['intersection'](_0x5c0c0a[_0x1d99('0x32')],qs[_0x1d99('0x37')](_0x37f7b1['query'][_0x1d99('0x37')]));_0x1aaf2b[_0x1d99('0x36')]=_0x1aaf2b[_0x1d99('0x36')][_0x1d99('0x38')]?_0x1aaf2b[_0x1d99('0x36')]:_0x5c0c0a['model'];if(!_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x39')](_0x1d99('0x3a'))){_0x1aaf2b[_0x1d99('0x1f')]=qs[_0x1d99('0x1f')](_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x1f')]);_0x1aaf2b['offset']=qs['offset'](_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x1d')]);}_0x1aaf2b[_0x1d99('0x3b')]=qs[_0x1d99('0x3c')](_0x37f7b1[_0x1d99('0x33')]['sort']);_0x1aaf2b[_0x1d99('0x3d')]=qs[_0x1d99('0x35')](_[_0x1d99('0x3e')](_0x37f7b1[_0x1d99('0x33')],_0x5c0c0a[_0x1d99('0x35')]),_0x16cc9f);if(_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x3f')]){_0x1aaf2b[_0x1d99('0x3d')]=_['merge'](_0x1aaf2b[_0x1d99('0x3d')],{'$or':_[_0x1d99('0x2c')](_0x16cc9f,function(_0x43b5cb){if(_0x43b5cb['type']!==_0x1d99('0x40')){var _0x478624={};_0x478624[_0x43b5cb['name']]={'$like':'%'+_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x3f')]+'%'};return _0x478624;}})});}_0x1aaf2b=_[_0x1d99('0x41')]({},_0x1aaf2b,_0x37f7b1[_0x1d99('0x42')]);var _0x59c119={'where':_0x1aaf2b[_0x1d99('0x3d')]};return db[_0x1d99('0x2d')][_0x1d99('0x20')](_0x59c119)[_0x1d99('0x25')](function(_0x17d969){_0x273f41['count']=_0x17d969;if(_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x43')]){_0x1aaf2b[_0x1d99('0x44')]=[{'all':!![]}];}return db[_0x1d99('0x2d')][_0x1d99('0x45')](_0x1aaf2b);})[_0x1d99('0x25')](function(_0x107f3c){_0x273f41['rows']=_0x107f3c;return _0x273f41;})[_0x1d99('0x25')](respondWithFilteredResult(_0x11bff3,_0x1aaf2b))[_0x1d99('0x46')](handleError(_0x11bff3,null));};exports[_0x1d99('0x47')]=function(_0x41dc0e,_0x16a423){var _0x3b6b66={'raw':!![],'where':{'id':_0x41dc0e[_0x1d99('0x48')]['id']}},_0x280937={};_0x280937[_0x1d99('0x32')]=_[_0x1d99('0x34')](db[_0x1d99('0x2d')]['rawAttributes']);_0x280937['query']=_[_0x1d99('0x34')](_0x41dc0e['query']);_0x280937[_0x1d99('0x35')]=_[_0x1d99('0x49')](_0x280937[_0x1d99('0x32')],_0x280937[_0x1d99('0x33')]);_0x3b6b66[_0x1d99('0x36')]=_[_0x1d99('0x49')](_0x280937[_0x1d99('0x32')],qs['fields'](_0x41dc0e['query']['fields']));_0x3b6b66[_0x1d99('0x36')]=_0x3b6b66[_0x1d99('0x36')][_0x1d99('0x38')]?_0x3b6b66[_0x1d99('0x36')]:_0x280937[_0x1d99('0x32')];if(_0x41dc0e['query'][_0x1d99('0x43')]){_0x3b6b66[_0x1d99('0x44')]=[{'all':!![]}];}_0x3b6b66=_[_0x1d99('0x41')]({},_0x3b6b66,_0x41dc0e['options']);return db[_0x1d99('0x2d')]['find'](_0x3b6b66)[_0x1d99('0x25')](handleEntityNotFound(_0x16a423,null))[_0x1d99('0x25')](respondWithResult(_0x16a423,null))[_0x1d99('0x46')](handleError(_0x16a423,null));};exports[_0x1d99('0x4a')]=function(_0x9e43b6,_0x437f13){return db['WhatsappApplication'][_0x1d99('0x4a')](_0x9e43b6[_0x1d99('0x4b')],{})[_0x1d99('0x25')](respondWithResult(_0x437f13,0xc9))[_0x1d99('0x46')](handleError(_0x437f13,null));};exports[_0x1d99('0x24')]=function(_0x5e458b,_0x48affc){if(_0x5e458b['body']['id']){delete _0x5e458b[_0x1d99('0x4b')]['id'];}return db[_0x1d99('0x2d')]['find']({'where':{'id':_0x5e458b['params']['id']}})[_0x1d99('0x25')](handleEntityNotFound(_0x48affc,null))[_0x1d99('0x25')](saveUpdates(_0x5e458b[_0x1d99('0x4b')],null))[_0x1d99('0x25')](respondWithResult(_0x48affc,null))[_0x1d99('0x46')](handleError(_0x48affc,null));};exports[_0x1d99('0x26')]=function(_0x10d644,_0x184f0e){return db[_0x1d99('0x2d')][_0x1d99('0x4c')]({'where':{'id':_0x10d644[_0x1d99('0x48')]['id']}})[_0x1d99('0x25')](handleEntityNotFound(_0x184f0e,null))[_0x1d99('0x25')](removeEntity(_0x184f0e,null))[_0x1d99('0x46')](handleError(_0x184f0e,null));}; \ No newline at end of file +var _0x75dc=['query','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','WhatsappApplication','fieldName','type','keys'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x75dc,0x1d7));var _0xc75d=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x75dc[_0x13b8f3];return _0x1a6d06;};'use strict';var emlformat=require(_0xc75d('0x0'));var rimraf=require(_0xc75d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc75d('0x2'));var BPromise=require(_0xc75d('0x3'));var Mustache=require(_0xc75d('0x4'));var util=require(_0xc75d('0x5'));var path=require(_0xc75d('0x6'));var sox=require(_0xc75d('0x7'));var csv=require('to-csv');var ejs=require(_0xc75d('0x8'));var fs=require('fs');var fs_extra=require(_0xc75d('0x9'));var _=require(_0xc75d('0xa'));var squel=require('squel');var crypto=require(_0xc75d('0xb'));var jsforce=require(_0xc75d('0xc'));var deskjs=require(_0xc75d('0xd'));var toCsv=require(_0xc75d('0xe'));var querystring=require('querystring');var Papa=require(_0xc75d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc75d('0x10'));var as=require(_0xc75d('0x11'));var hardwareService=require(_0xc75d('0x12'));var logger=require(_0xc75d('0x13'))('api');var utils=require(_0xc75d('0x14'));var config=require(_0xc75d('0x15'));var licenseUtil=require(_0xc75d('0x16'));var db=require(_0xc75d('0x17'))['db'];function respondWithStatusCode(_0x1a7984,_0x2521fd){_0x2521fd=_0x2521fd||0xcc;return function(_0xd5e22b){if(_0xd5e22b){return _0x1a7984['sendStatus'](_0x2521fd);}return _0x1a7984[_0xc75d('0x18')](_0x2521fd)[_0xc75d('0x19')]();};}function respondWithResult(_0x3f01a0,_0x421b53){_0x421b53=_0x421b53||0xc8;return function(_0x5171a2){if(_0x5171a2){return _0x3f01a0['status'](_0x421b53)[_0xc75d('0x1a')](_0x5171a2);}};}function respondWithFilteredResult(_0x182f56,_0x174998){return function(_0x1b0bfc){if(_0x1b0bfc){var _0x1d49b9=typeof _0x174998[_0xc75d('0x1b')]===_0xc75d('0x1c')&&typeof _0x174998['limit']===_0xc75d('0x1c');var _0x1fe446=_0x1b0bfc[_0xc75d('0x1d')];var _0x389804=_0x1d49b9?0x0:_0x174998[_0xc75d('0x1b')];var _0x47f6b6=_0x1d49b9?_0x1b0bfc[_0xc75d('0x1d')]:_0x174998['offset']+_0x174998['limit'];var _0x3933c5;if(_0x47f6b6>=_0x1fe446){_0x47f6b6=_0x1fe446;_0x3933c5=0xc8;}else{_0x3933c5=0xce;}_0x182f56[_0xc75d('0x18')](_0x3933c5);return _0x182f56[_0xc75d('0x1e')](_0xc75d('0x1f'),_0x389804+'-'+_0x47f6b6+'/'+_0x1fe446)[_0xc75d('0x1a')](_0x1b0bfc);}return null;};}function patchUpdates(_0x576117){return function(_0x3d4141){try{jsonpatch[_0xc75d('0x20')](_0x3d4141,_0x576117,!![]);}catch(_0x208f36){return BPromise[_0xc75d('0x21')](_0x208f36);}return _0x3d4141[_0xc75d('0x22')]();};}function saveUpdates(_0x1b614f,_0x2181e1){return function(_0x2327ec){if(_0x2327ec){return _0x2327ec['update'](_0x1b614f)[_0xc75d('0x23')](function(_0x296456){return _0x296456;});}return null;};}function removeEntity(_0x18589b,_0x4314cc){return function(_0x5ef8d0){if(_0x5ef8d0){return _0x5ef8d0[_0xc75d('0x24')]()[_0xc75d('0x23')](function(){_0x18589b[_0xc75d('0x18')](0xcc)[_0xc75d('0x19')]();});}};}function handleEntityNotFound(_0xae25c2,_0x2e1687){return function(_0x478787){if(!_0x478787){_0xae25c2[_0xc75d('0x25')](0x194);}return _0x478787;};}function handleError(_0x39ab16,_0x56f6f8){_0x56f6f8=_0x56f6f8||0x1f4;return function(_0x4dcda0){logger[_0xc75d('0x26')](_0x4dcda0[_0xc75d('0x27')]);if(_0x4dcda0[_0xc75d('0x28')]){delete _0x4dcda0[_0xc75d('0x28')];}_0x39ab16[_0xc75d('0x18')](_0x56f6f8)[_0xc75d('0x29')](_0x4dcda0);};}exports['index']=function(_0x56fe50,_0x3d8329){var _0x17f45b={},_0x50a7be={},_0x2ba845={'count':0x0,'rows':[]};var _0x19cd53=_[_0xc75d('0x2a')](db[_0xc75d('0x2b')]['rawAttributes'],function(_0x3f285a){return{'name':_0x3f285a[_0xc75d('0x2c')],'type':_0x3f285a[_0xc75d('0x2d')]['key']};});_0x50a7be['model']=_[_0xc75d('0x2a')](_0x19cd53,_0xc75d('0x28'));_0x50a7be['query']=_[_0xc75d('0x2e')](_0x56fe50[_0xc75d('0x2f')]);_0x50a7be[_0xc75d('0x30')]=_[_0xc75d('0x31')](_0x50a7be[_0xc75d('0x32')],_0x50a7be[_0xc75d('0x2f')]);_0x17f45b[_0xc75d('0x33')]=_[_0xc75d('0x31')](_0x50a7be[_0xc75d('0x32')],qs[_0xc75d('0x34')](_0x56fe50[_0xc75d('0x2f')][_0xc75d('0x34')]));_0x17f45b[_0xc75d('0x33')]=_0x17f45b['attributes'][_0xc75d('0x35')]?_0x17f45b[_0xc75d('0x33')]:_0x50a7be[_0xc75d('0x32')];if(!_0x56fe50[_0xc75d('0x2f')]['hasOwnProperty'](_0xc75d('0x36'))){_0x17f45b[_0xc75d('0x37')]=qs[_0xc75d('0x37')](_0x56fe50['query']['limit']);_0x17f45b['offset']=qs['offset'](_0x56fe50[_0xc75d('0x2f')][_0xc75d('0x1b')]);}_0x17f45b['order']=qs[_0xc75d('0x38')](_0x56fe50[_0xc75d('0x2f')][_0xc75d('0x38')]);_0x17f45b[_0xc75d('0x39')]=qs[_0xc75d('0x30')](_[_0xc75d('0x3a')](_0x56fe50[_0xc75d('0x2f')],_0x50a7be[_0xc75d('0x30')]),_0x19cd53);if(_0x56fe50[_0xc75d('0x2f')][_0xc75d('0x3b')]){_0x17f45b['where']=_['merge'](_0x17f45b[_0xc75d('0x39')],{'$or':_[_0xc75d('0x2a')](_0x19cd53,function(_0xd13743){if(_0xd13743[_0xc75d('0x2d')]!==_0xc75d('0x3c')){var _0x530f36={};_0x530f36[_0xd13743[_0xc75d('0x28')]]={'$like':'%'+_0x56fe50[_0xc75d('0x2f')][_0xc75d('0x3b')]+'%'};return _0x530f36;}})});}_0x17f45b=_[_0xc75d('0x3d')]({},_0x17f45b,_0x56fe50[_0xc75d('0x3e')]);var _0x5ea99f={'where':_0x17f45b[_0xc75d('0x39')]};return db[_0xc75d('0x2b')]['count'](_0x5ea99f)['then'](function(_0x3eab05){_0x2ba845[_0xc75d('0x1d')]=_0x3eab05;if(_0x56fe50[_0xc75d('0x2f')][_0xc75d('0x3f')]){_0x17f45b[_0xc75d('0x40')]=[{'all':!![]}];}return db[_0xc75d('0x2b')][_0xc75d('0x41')](_0x17f45b);})['then'](function(_0x1a5698){_0x2ba845[_0xc75d('0x42')]=_0x1a5698;return _0x2ba845;})['then'](respondWithFilteredResult(_0x3d8329,_0x17f45b))['catch'](handleError(_0x3d8329,null));};exports[_0xc75d('0x43')]=function(_0x1eebcc,_0xd0160b){var _0x5cc989={'raw':!![],'where':{'id':_0x1eebcc[_0xc75d('0x44')]['id']}},_0x22d4d9={};_0x22d4d9[_0xc75d('0x32')]=_[_0xc75d('0x2e')](db[_0xc75d('0x2b')][_0xc75d('0x45')]);_0x22d4d9['query']=_['keys'](_0x1eebcc[_0xc75d('0x2f')]);_0x22d4d9[_0xc75d('0x30')]=_[_0xc75d('0x31')](_0x22d4d9[_0xc75d('0x32')],_0x22d4d9[_0xc75d('0x2f')]);_0x5cc989[_0xc75d('0x33')]=_[_0xc75d('0x31')](_0x22d4d9[_0xc75d('0x32')],qs[_0xc75d('0x34')](_0x1eebcc[_0xc75d('0x2f')][_0xc75d('0x34')]));_0x5cc989[_0xc75d('0x33')]=_0x5cc989[_0xc75d('0x33')][_0xc75d('0x35')]?_0x5cc989[_0xc75d('0x33')]:_0x22d4d9[_0xc75d('0x32')];if(_0x1eebcc[_0xc75d('0x2f')][_0xc75d('0x3f')]){_0x5cc989[_0xc75d('0x40')]=[{'all':!![]}];}_0x5cc989=_['merge']({},_0x5cc989,_0x1eebcc[_0xc75d('0x3e')]);return db[_0xc75d('0x2b')][_0xc75d('0x46')](_0x5cc989)['then'](handleEntityNotFound(_0xd0160b,null))['then'](respondWithResult(_0xd0160b,null))[_0xc75d('0x47')](handleError(_0xd0160b,null));};exports['create']=function(_0x58f81d,_0x255225){return db[_0xc75d('0x2b')][_0xc75d('0x48')](_0x58f81d[_0xc75d('0x49')],{})['then'](respondWithResult(_0x255225,0xc9))[_0xc75d('0x47')](handleError(_0x255225,null));};exports['update']=function(_0x1d2c6d,_0x17d063){if(_0x1d2c6d[_0xc75d('0x49')]['id']){delete _0x1d2c6d[_0xc75d('0x49')]['id'];}return db[_0xc75d('0x2b')][_0xc75d('0x46')]({'where':{'id':_0x1d2c6d['params']['id']}})['then'](handleEntityNotFound(_0x17d063,null))[_0xc75d('0x23')](saveUpdates(_0x1d2c6d[_0xc75d('0x49')],null))['then'](respondWithResult(_0x17d063,null))[_0xc75d('0x47')](handleError(_0x17d063,null));};exports['destroy']=function(_0x240887,_0x369191){return db[_0xc75d('0x2b')][_0xc75d('0x46')]({'where':{'id':_0x240887['params']['id']}})[_0xc75d('0x23')](handleEntityNotFound(_0x369191,null))['then'](removeEntity(_0x369191,null))[_0xc75d('0x47')](handleError(_0x369191,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 7a70886..83a4395 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 _0x20ce=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0x20ce,0x10d));var _0xe20c=function(_0x4fd12d,_0x407c88){_0x4fd12d=_0x4fd12d-0x0;var _0x1a97e2=_0x20ce[_0x4fd12d];return _0x1a97e2;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var logger=require(_0xe20c('0x2'))('api');var moment=require(_0xe20c('0x3'));var BPromise=require(_0xe20c('0x4'));var rp=require(_0xe20c('0x5'));var fs=require('fs');var path=require(_0xe20c('0x6'));var rimraf=require(_0xe20c('0x7'));var config=require(_0xe20c('0x8'));var attributes=require(_0xe20c('0x9'));module[_0xe20c('0xa')]=function(_0x373f9f,_0x2c9e6a){return _0x373f9f[_0xe20c('0xb')](_0xe20c('0xc'),attributes,{'tableName':_0xe20c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe20c('0xe'),'collate':_0xe20c('0xf')});}; \ No newline at end of file +var _0x35aa=['path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise'];(function(_0x2ed458,_0x4a2813){var _0x1589fc=function(_0x421fa2){while(--_0x421fa2){_0x2ed458['push'](_0x2ed458['shift']());}};_0x1589fc(++_0x4a2813);}(_0x35aa,0xbe));var _0xa35a=function(_0x5e844d,_0x1a2af2){_0x5e844d=_0x5e844d-0x0;var _0x7760f1=_0x35aa[_0x5e844d];return _0x7760f1;};'use strict';var _=require('lodash');var util=require(_0xa35a('0x0'));var logger=require(_0xa35a('0x1'))(_0xa35a('0x2'));var moment=require(_0xa35a('0x3'));var BPromise=require('bluebird');var rp=require(_0xa35a('0x4'));var fs=require('fs');var path=require(_0xa35a('0x5'));var rimraf=require(_0xa35a('0x6'));var config=require(_0xa35a('0x7'));var attributes=require(_0xa35a('0x8'));module[_0xa35a('0x9')]=function(_0x449cfe,_0x10917d){return _0x449cfe['define'](_0xa35a('0xa'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa35a('0xb'),'collate':_0xa35a('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index bbd6e68..4ca7f2d 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 _0x5636=['code','WhatsappApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5636,0x102));var _0x6563=function(_0x419cdc,_0x15c1ff){_0x419cdc=_0x419cdc-0x0;var _0x59113a=_0x5636[_0x419cdc];return _0x59113a;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});} \ No newline at end of file +var _0x9a19=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xb6a965,_0x5c5ace){var _0x51d37d=function(_0x1c7c0d){while(--_0x1c7c0d){_0xb6a965['push'](_0xb6a965['shift']());}};_0x51d37d(++_0x5c5ace);}(_0x9a19,0x114));var _0x99a1=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0x9a19[_0x53bcc3];return _0x47c959;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var moment=require(_0x99a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x99a1('0x3'));var fs=require('fs');var Redis=require(_0x99a1('0x4'));var db=require(_0x99a1('0x5'))['db'];var utils=require(_0x99a1('0x6'));var logger=require(_0x99a1('0x7'))(_0x99a1('0x8'));var config=require(_0x99a1('0x9'));var jayson=require(_0x99a1('0xa'));var client=jayson[_0x99a1('0xb')][_0x99a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x65045d,_0x523b9e,_0x4d2a5c){return new BPromise(function(_0x5aa6c2,_0x56f50){return client[_0x99a1('0xd')](_0x65045d,_0x4d2a5c)['then'](function(_0x5874fc){logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));logger[_0x99a1('0x11')](_0x99a1('0x12'),_0x523b9e,'request\x20sent',JSON[_0x99a1('0x13')](_0x5874fc));if(_0x5874fc[_0x99a1('0x14')]){if(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x15')]===0x1f4){logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x56f50(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);}logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x5aa6c2(_0x5874fc[_0x99a1('0x14')]['message']);}else{logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));_0x5aa6c2(_0x5874fc[_0x99a1('0x17')][_0x99a1('0x16')]);}})[_0x99a1('0x18')](function(_0x1ca878){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x523b9e,_0x1ca878);_0x56f50(_0x1ca878);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 4d5e2c9..f7561ad 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 _0xbff5=['addTags','put','tracked','whatsapp','update','delete','whatsappinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','post','addMessage','/:id/tags','whatsappinteraction:addtags'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbff5,0x1bc));var _0x5bff=function(_0x4884e3,_0xad95a){_0x4884e3=_0x4884e3-0x0;var _0x693c7=_0xbff5[_0x4884e3];return _0x693c7;};'use strict';var multer=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var path=require(_0x5bff('0x2'));var timeout=require(_0x5bff('0x3'));var express=require(_0x5bff('0x4'));var router=express[_0x5bff('0x5')]();var fs_extra=require(_0x5bff('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5bff('0x7'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x5bff('0x8')]('/',auth[_0x5bff('0x9')](),controller[_0x5bff('0xa')]);router[_0x5bff('0x8')](_0x5bff('0xb'),auth[_0x5bff('0x9')](),controller[_0x5bff('0xc')]);router[_0x5bff('0x8')](_0x5bff('0xd'),auth['isAuthenticated'](),controller[_0x5bff('0xe')]);router['get'](_0x5bff('0xf'),auth[_0x5bff('0x9')](),controller['getMessages']);router[_0x5bff('0x8')]('/:id/download',auth[_0x5bff('0x9')](),controller['download']);router[_0x5bff('0x10')]('/',auth[_0x5bff('0x9')](),controller['create']);router[_0x5bff('0x10')]('/:id/messages',auth[_0x5bff('0x9')](),controller[_0x5bff('0x11')]);router['post'](_0x5bff('0x12'),auth[_0x5bff('0x9')](),interaction['tracked']('whatsapp',_0x5bff('0x13')),controller[_0x5bff('0x14')]);router[_0x5bff('0x15')]('/:id',auth[_0x5bff('0x9')](),interaction[_0x5bff('0x16')](_0x5bff('0x17'),'whatsappinteraction:update'),controller[_0x5bff('0x18')]);router[_0x5bff('0x19')](_0x5bff('0xd'),auth['isAuthenticated'](),interaction[_0x5bff('0x16')](_0x5bff('0x17'),_0x5bff('0x1a')),controller[_0x5bff('0x1b')]);router['delete'](_0x5bff('0x12'),auth['isAuthenticated'](),controller[_0x5bff('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xb934=['addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download','download','post','create'];(function(_0x34265e,_0x53819f){var _0x240f38=function(_0x300450){while(--_0x300450){_0x34265e['push'](_0x34265e['shift']());}};_0x240f38(++_0x53819f);}(_0xb934,0x92));var _0x4b93=function(_0x4919ed,_0x5d0ccb){_0x4919ed=_0x4919ed-0x0;var _0x28ff7b=_0xb934[_0x4919ed];return _0x28ff7b;};'use strict';var multer=require(_0x4b93('0x0'));var util=require(_0x4b93('0x1'));var path=require(_0x4b93('0x2'));var timeout=require('connect-timeout');var express=require(_0x4b93('0x3'));var router=express[_0x4b93('0x4')]();var fs_extra=require(_0x4b93('0x5'));var auth=require(_0x4b93('0x6'));var interaction=require(_0x4b93('0x7'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x4b93('0x8')]('/',auth[_0x4b93('0x9')](),controller[_0x4b93('0xa')]);router[_0x4b93('0x8')]('/describe',auth[_0x4b93('0x9')](),controller[_0x4b93('0xb')]);router[_0x4b93('0x8')](_0x4b93('0xc'),auth[_0x4b93('0x9')](),controller[_0x4b93('0xd')]);router[_0x4b93('0x8')](_0x4b93('0xe'),auth[_0x4b93('0x9')](),controller['getMessages']);router[_0x4b93('0x8')](_0x4b93('0xf'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x10')]);router[_0x4b93('0x11')]('/',auth[_0x4b93('0x9')](),controller[_0x4b93('0x12')]);router[_0x4b93('0x11')](_0x4b93('0xe'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x13')]);router[_0x4b93('0x11')](_0x4b93('0x14'),auth[_0x4b93('0x9')](),interaction[_0x4b93('0x15')]('whatsapp',_0x4b93('0x16')),controller[_0x4b93('0x17')]);router[_0x4b93('0x18')]('/:id',auth[_0x4b93('0x9')](),interaction[_0x4b93('0x15')](_0x4b93('0x19'),_0x4b93('0x1a')),controller[_0x4b93('0x1b')]);router['delete'](_0x4b93('0xc'),auth[_0x4b93('0x9')](),interaction['tracked']('whatsapp',_0x4b93('0x1c')),controller[_0x4b93('0x1d')]);router[_0x4b93('0x1e')](_0x4b93('0x14'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x1f')]);module[_0x4b93('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 81b5576..fbc3229 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 _0xfa94=['BOOLEAN','sequelize','exports','DATE','STRING','ENUM','out'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0xfa94,0xef));var _0x4fa9=function(_0x287528,_0x2fbba7){_0x287528=_0x287528-0x0;var _0xc05e28=_0xfa94[_0x287528];return _0xc05e28;};'use strict';var Sequelize=require(_0x4fa9('0x0'));var moment=require('moment');module[_0x4fa9('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4fa9('0x2')]},'disposition':{'type':Sequelize[_0x4fa9('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4fa9('0x3')]},'note':{'type':Sequelize[_0x4fa9('0x3')]},'phone':{'type':Sequelize[_0x4fa9('0x3')]},'read1stAt':{'type':Sequelize[_0x4fa9('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x4fa9('0x4')]('in',_0x4fa9('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4fa9('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4fa9('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4fa9('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1f75=['STRING','ENUM','out','INTEGER','moment','exports','BOOLEAN','DATE'];(function(_0x5df259,_0x141a31){var _0x1b3d8d=function(_0x1dfe07){while(--_0x1dfe07){_0x5df259['push'](_0x5df259['shift']());}};_0x1b3d8d(++_0x141a31);}(_0x1f75,0x13c));var _0x51f7=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x1f75[_0x4d07cc];return _0x42de3b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x51f7('0x0'));module[_0x51f7('0x1')]={'closed':{'type':Sequelize[_0x51f7('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x51f7('0x3')]},'disposition':{'type':Sequelize[_0x51f7('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x51f7('0x4')]},'note':{'type':Sequelize[_0x51f7('0x4')]},'phone':{'type':Sequelize[_0x51f7('0x4')]},'read1stAt':{'type':Sequelize[_0x51f7('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x51f7('0x5')]('in',_0x51f7('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x51f7('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x51f7('0x5')]('in',_0x51f7('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x51f7('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x51f7('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 24c6e7c..1484c2f 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 _0x1387=['moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','whatsapp','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','WhatsappInteraction','find','create','body','describe','addMessage','WhatsappMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','where','pick','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','unix','toString','server','files','tmp','join','root','attachments','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','closedAt','disposition','basename','createReadStream','out','System','direction','renderFile','views','downloadInteraction.ejs','.pdf','log','err','unlinkSync','rimraf','zip-dir'];(function(_0x5b9e83,_0x53f77c){var _0x5c1cba=function(_0x48de96){while(--_0x48de96){_0x5b9e83['push'](_0x5b9e83['shift']());}};_0x5c1cba(++_0x53f77c);}(_0x1387,0x7c));var _0x7138=function(_0x15b6fb,_0x226c53){_0x15b6fb=_0x15b6fb-0x0;var _0xb94054=_0x1387[_0x15b6fb];return _0xb94054;};'use strict';var rimraf=require(_0x7138('0x0'));var zipdir=require(_0x7138('0x1'));var moment=require(_0x7138('0x2'));var BPromise=require(_0x7138('0x3'));var util=require(_0x7138('0x4'));var path=require('path');var ejs=require(_0x7138('0x5'));var fs=require('fs');var _=require(_0x7138('0x6'));var Redis=require(_0x7138('0x7'));var interaction=require(_0x7138('0x8'));var qs=require(_0x7138('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')('api');var config=require(_0x7138('0xa'));var db=require(_0x7138('0xb'))['db'];config[_0x7138('0xc')]=_[_0x7138('0xd')](config['redis'],{'host':_0x7138('0xe'),'port':0x18eb});var socket=require(_0x7138('0xf'))(new Redis(config[_0x7138('0xc')]));require(_0x7138('0x10'))[_0x7138('0x11')](socket);function respondWithStatusCode(_0x425af3,_0x3cedb6){_0x3cedb6=_0x3cedb6||0xcc;return function(_0x1ee846){if(_0x1ee846){return _0x425af3[_0x7138('0x12')](_0x3cedb6);}return _0x425af3[_0x7138('0x13')](_0x3cedb6)[_0x7138('0x14')]();};}function respondWithResult(_0x3b3851,_0x12877f){_0x12877f=_0x12877f||0xc8;return function(_0x796bb4){if(_0x796bb4){return _0x3b3851[_0x7138('0x13')](_0x12877f)[_0x7138('0x15')](_0x796bb4);}};}function respondWithFilteredResult(_0x4156ea,_0x39d798){return function(_0x337db9){if(_0x337db9){var _0x39707b=typeof _0x39d798[_0x7138('0x16')]===_0x7138('0x17')&&typeof _0x39d798[_0x7138('0x18')]===_0x7138('0x17');var _0x55c506=_0x337db9[_0x7138('0x19')];var _0xfc6962=_0x39707b?0x0:_0x39d798[_0x7138('0x16')];var _0x52be73=_0x39707b?_0x337db9[_0x7138('0x19')]:_0x39d798['offset']+_0x39d798[_0x7138('0x18')];var _0x14d4f2;if(_0x52be73>=_0x55c506){_0x52be73=_0x55c506;_0x14d4f2=0xc8;}else{_0x14d4f2=0xce;}_0x4156ea[_0x7138('0x13')](_0x14d4f2);return _0x4156ea['set'](_0x7138('0x1a'),_0xfc6962+'-'+_0x52be73+'/'+_0x55c506)['json'](_0x337db9);}return null;};}function saveUpdates(_0x1f8085){return function(_0x24ba84){if(_0x24ba84){return _0x24ba84[_0x7138('0x1b')](_0x1f8085)[_0x7138('0x1c')](function(_0x4f6a24){return _0x4f6a24;});}return null;};}function removeEntity(_0x2aa959){return function(_0x58fd78){if(_0x58fd78){return _0x58fd78[_0x7138('0x1d')]()['then'](function(){_0x2aa959['status'](0xcc)[_0x7138('0x14')]();});}};}function handleEntityNotFound(_0x33c23a){return function(_0x43bc59){if(!_0x43bc59){_0x33c23a[_0x7138('0x12')](0x194);}return _0x43bc59;};}function handleError(_0x201a59,_0x4dcc42){_0x4dcc42=_0x4dcc42||0x1f4;return function(_0x8a1c65){logger[_0x7138('0x1e')](_0x8a1c65[_0x7138('0x1f')]);if(_0x8a1c65[_0x7138('0x20')]){delete _0x8a1c65['name'];}_0x201a59['status'](_0x4dcc42)[_0x7138('0x21')](_0x8a1c65);};}exports[_0x7138('0x22')]=function(_0x3ba8fe,_0x213709){var _0x4ef358={};var _0x30e8d2=_[_0x7138('0x23')](db['WhatsappInteraction'][_0x7138('0x24')],function(_0x3ed920){return{'name':_0x3ed920[_0x7138('0x25')],'type':_0x3ed920[_0x7138('0x26')][_0x7138('0x27')]};});_0x4ef358=qs['getOptions'](_0x30e8d2,_0x3ba8fe);return interaction['findAll'](_0x7138('0x28'),_0x3ba8fe[_0x7138('0x29')],_0x3ba8fe[_0x7138('0x2a')],_0x4ef358,_0x30e8d2)['then'](respondWithFilteredResult(_0x213709,_0x4ef358))[_0x7138('0x2b')](handleError(_0x213709,null));};exports[_0x7138('0x2c')]=function(_0x18d7f4,_0x1c3510){var _0x3234c6={'raw':![],'where':{'id':_0x18d7f4[_0x7138('0x2d')]['id']}},_0x21bae1={};_0x21bae1[_0x7138('0x2e')]=_[_0x7138('0x2f')](db['WhatsappInteraction'][_0x7138('0x24')]);_0x21bae1[_0x7138('0x29')]=_['keys'](_0x18d7f4[_0x7138('0x29')]);_0x21bae1[_0x7138('0x30')]=_[_0x7138('0x31')](_0x21bae1[_0x7138('0x2e')],_0x21bae1[_0x7138('0x29')]);_0x3234c6[_0x7138('0x32')]=_[_0x7138('0x31')](_0x21bae1[_0x7138('0x2e')],qs[_0x7138('0x33')](_0x18d7f4['query'][_0x7138('0x33')]));_0x3234c6[_0x7138('0x32')]=_0x3234c6[_0x7138('0x32')][_0x7138('0x34')]?_0x3234c6[_0x7138('0x32')]:_0x21bae1['model'];if(_0x18d7f4[_0x7138('0x29')][_0x7138('0x35')]){_0x3234c6['include']=[{'all':!![]}];}_0x3234c6=_[_0x7138('0x36')]({},_0x3234c6,_0x18d7f4[_0x7138('0x37')]);return db[_0x7138('0x38')][_0x7138('0x39')](_0x3234c6)[_0x7138('0x1c')](handleEntityNotFound(_0x1c3510,null))[_0x7138('0x1c')](respondWithResult(_0x1c3510,null))[_0x7138('0x2b')](handleError(_0x1c3510,null));};exports[_0x7138('0x3a')]=function(_0xd34574,_0x443fd8){return db[_0x7138('0x38')][_0x7138('0x3a')](_0xd34574[_0x7138('0x3b')],{})['then'](respondWithResult(_0x443fd8,0xc9))[_0x7138('0x2b')](handleError(_0x443fd8,null));};exports[_0x7138('0x1b')]=function(_0x2bf2ec,_0x510a46){if(_0x2bf2ec[_0x7138('0x3b')]['id']){delete _0x2bf2ec[_0x7138('0x3b')]['id'];}return db[_0x7138('0x38')][_0x7138('0x39')]({'where':{'id':_0x2bf2ec[_0x7138('0x2d')]['id']}})[_0x7138('0x1c')](handleEntityNotFound(_0x510a46,null))[_0x7138('0x1c')](saveUpdates(_0x2bf2ec[_0x7138('0x3b')],null))[_0x7138('0x1c')](respondWithResult(_0x510a46,null))[_0x7138('0x2b')](handleError(_0x510a46,null));};exports['destroy']=function(_0x1ef7d5,_0x48e950){return db[_0x7138('0x38')][_0x7138('0x39')]({'where':{'id':_0x1ef7d5[_0x7138('0x2d')]['id']}})[_0x7138('0x1c')](handleEntityNotFound(_0x48e950,null))[_0x7138('0x1c')](removeEntity(_0x48e950,null))[_0x7138('0x2b')](handleError(_0x48e950,null));};exports[_0x7138('0x3c')]=function(_0xf3ed29,_0x462173){return db[_0x7138('0x38')][_0x7138('0x3c')]()[_0x7138('0x1c')](respondWithResult(_0x462173,null))['catch'](handleError(_0x462173,null));};exports[_0x7138('0x3d')]=function(_0x14fff0,_0x481124){return db[_0x7138('0x3e')][_0x7138('0x39')]({'where':{'id':_0x14fff0[_0x7138('0x2d')]['id']}})[_0x7138('0x1c')](handleEntityNotFound(_0x481124,null))[_0x7138('0x1c')](function(_0x3f77f4){if(_0x3f77f4){return _0x3f77f4[_0x7138('0x3d')](_0x14fff0['body'][_0x7138('0x3f')],_[_0x7138('0x40')](_0x14fff0[_0x7138('0x3b')],[_0x7138('0x3f'),'id'])||{});}})[_0x7138('0x1c')](respondWithResult(_0x481124,null))['catch'](handleError(_0x481124,null));};exports['getMessages']=function(_0x136ad4,_0x52de68){var _0x292938={'raw':![],'where':{}};var _0x15045b={};var _0x4a4ad8={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x7138('0x41')]({'where':{'id':_0x136ad4[_0x7138('0x2d')]['id']}})[_0x7138('0x1c')](handleEntityNotFound(_0x52de68,null))[_0x7138('0x1c')](function(_0x58de21){if(_0x58de21){_0x15045b[_0x7138('0x2e')]=_[_0x7138('0x2f')](db[_0x7138('0x3e')][_0x7138('0x24')]);_0x15045b[_0x7138('0x29')]=_[_0x7138('0x2f')](_0x136ad4[_0x7138('0x29')]);_0x15045b['filters']=_[_0x7138('0x31')](_0x15045b['model'],_0x15045b[_0x7138('0x29')]);_0x292938[_0x7138('0x32')]=_[_0x7138('0x31')](_0x15045b[_0x7138('0x2e')],qs[_0x7138('0x33')](_0x136ad4[_0x7138('0x29')]['fields']));_0x292938[_0x7138('0x32')]=_0x292938['attributes'][_0x7138('0x34')]?_0x292938[_0x7138('0x32')]:_0x15045b['model'];if(!_0x136ad4[_0x7138('0x29')][_0x7138('0x42')](_0x7138('0x43'))){_0x292938[_0x7138('0x18')]=qs[_0x7138('0x18')](_0x136ad4[_0x7138('0x29')]['limit']);_0x292938[_0x7138('0x16')]=qs[_0x7138('0x16')](_0x136ad4['query'][_0x7138('0x16')]);}_0x292938[_0x7138('0x44')]=qs['sort'](_0x136ad4[_0x7138('0x29')]['sort']);_0x292938[_0x7138('0x45')]=qs['filters'](_[_0x7138('0x46')](_0x136ad4[_0x7138('0x29')],_0x15045b[_0x7138('0x30')]));_0x292938[_0x7138('0x45')][_0x7138('0x47')]=_0x58de21['id'];if(_0x136ad4[_0x7138('0x29')][_0x7138('0x48')]){_0x292938[_0x7138('0x45')]=_[_0x7138('0x36')](_0x292938[_0x7138('0x45')],{'$or':_[_0x7138('0x23')](_0x292938['attributes'],function(_0x19b58b){var _0x369edf={};_0x369edf[_0x19b58b]={'$like':'%'+_0x136ad4['query']['filter']+'%'};return _0x369edf;})});}if(_0x136ad4[_0x7138('0x29')][_0x7138('0x49')]){var _0x24cf08=_0x136ad4[_0x7138('0x29')][_0x7138('0x49')]['split'](',');var _0x1da0dd={};_0x1da0dd[_0x24cf08[0x0]]={'$gte':moment(_0x24cf08[0x1])[_0x7138('0x4a')](_0x7138('0x4b'))};_0x292938[_0x7138('0x45')]=_[_0x7138('0x36')](_0x292938[_0x7138('0x45')],_0x1da0dd);}_0x292938=_[_0x7138('0x36')]({},_0x292938,_0x136ad4[_0x7138('0x37')]);return db[_0x7138('0x3e')][_0x7138('0x19')]({'where':_0x292938['where']})[_0x7138('0x1c')](function(_0x5f47b5){_0x4a4ad8['count']=_0x5f47b5;if(_0x136ad4[_0x7138('0x29')][_0x7138('0x35')]){_0x292938[_0x7138('0x4c')]=[{'all':!![]}];}return db[_0x7138('0x3e')][_0x7138('0x4d')](_0x292938);})[_0x7138('0x1c')](function(_0x29abf){_0x4a4ad8[_0x7138('0x4e')]=_0x29abf;return _0x4a4ad8;});}})['then'](respondWithFilteredResult(_0x52de68,_0x292938))['catch'](handleError(_0x52de68,null));};exports['addTags']=function(_0x3768d9,_0x13ae96){return db[_0x7138('0x38')][_0x7138('0x39')]({'where':{'id':_0x3768d9[_0x7138('0x2d')]['id']}})[_0x7138('0x1c')](handleEntityNotFound(_0x13ae96,null))[_0x7138('0x1c')](function(_0x45add0){if(_0x45add0){return _0x45add0[_0x7138('0x4f')](_0x3768d9[_0x7138('0x3b')]['ids'],_[_0x7138('0x40')](_0x3768d9['body'],[_0x7138('0x3f'),'id'])||{})[_0x7138('0x50')](function(){return db[_0x7138('0x51')]['findAll']({'attributes':['id','name',_0x7138('0x52')],'where':{'id':_0x3768d9[_0x7138('0x3b')][_0x7138('0x3f')]}});})[_0x7138('0x1c')](function(_0x1be48e){socket[_0x7138('0x53')](_0x7138('0x54'),{'id':Number(_0x3768d9['params']['id']),'tags':_0x1be48e||[]});return{'id':Number(_0x3768d9[_0x7138('0x2d')]['id']),'tags':_0x1be48e||[]};});}})['then'](respondWithResult(_0x13ae96,null))[_0x7138('0x2b')](handleError(_0x13ae96,null));};exports[_0x7138('0x55')]=function(_0x258dbb,_0x544c4f){return db['WhatsappInteraction']['find']({'where':{'id':_0x258dbb[_0x7138('0x2d')]['id']}})[_0x7138('0x1c')](handleEntityNotFound(_0x544c4f,null))[_0x7138('0x1c')](function(_0x5ebca1){if(_0x5ebca1){return _0x5ebca1['removeTags'](_0x258dbb[_0x7138('0x29')][_0x7138('0x3f')]);}})['then'](respondWithStatusCode(_0x544c4f,null))[_0x7138('0x2b')](handleError(_0x544c4f,null));};exports['download']=function(_0x57a9ab,_0x26e41f){var _0xdec74e=moment()[_0x7138('0x56')]()[_0x7138('0x57')]();var _0x20c597=path['join'](config['root'],_0x7138('0x58'),_0x7138('0x59'),_0x7138('0x5a'));var _0xbc861c=path[_0x7138('0x5b')](config[_0x7138('0x5c')],_0x7138('0x58'),'files',_0x7138('0x5d'));var _0xf9a924=path[_0x7138('0x5b')](_0x20c597,_0xdec74e);var _0xdd4bf8=util[_0x7138('0x4a')]('transcript-%d-%s.zip',_0x57a9ab[_0x7138('0x2d')]['id'],_0xdec74e);var _0x5123a5=path[_0x7138('0x5b')](_0x20c597,_0xdd4bf8);var _0x2152c8=[];_0x2152c8[_0x7138('0x5e')]({'model':db[_0x7138('0x5f')],'as':_0x7138('0x5f'),'attributes':['id',_0x7138('0x60')],'raw':!![]});_0x2152c8[_0x7138('0x5e')]({'model':db[_0x7138('0x61')],'as':_0x7138('0x62'),'attributes':['id',_0x7138('0x63'),_0x7138('0x64')],'raw':!![]});if(_0x57a9ab['query'][_0x7138('0x5d')]){_0x2152c8['push']({'model':db[_0x7138('0x65')],'as':_0x7138('0x65'),'raw':!![]});}var _0x1fe59b=[{'model':db[_0x7138('0x3e')],'as':_0x7138('0x66'),'attributes':['id',_0x7138('0x3b'),_0x7138('0x67'),'direction',_0x7138('0x68'),_0x7138('0x69')],'include':_0x2152c8}];_0x1fe59b[_0x7138('0x5e')]({'model':db[_0x7138('0x6a')],'as':_0x7138('0x6b'),'attributes':['id',_0x7138('0x20')]});_0x1fe59b[_0x7138('0x5e')]({'model':db[_0x7138('0x5f')],'as':_0x7138('0x6c'),'attributes':['id',_0x7138('0x60')]});return db[_0x7138('0x38')][_0x7138('0x39')]({'where':{'id':_0x57a9ab[_0x7138('0x2d')]['id']},'include':_0x1fe59b})['then'](handleEntityNotFound(_0x26e41f,null))[_0x7138('0x1c')](function(_0x5abd7d){if(_0x5abd7d){var _0x4d8ad7=_0x5abd7d[_0x7138('0x6d')]({'plain':!![]});fs[_0x7138('0x6e')](_0xf9a924);var _0x3a1ec6={'channel':_0x7138('0x6f'),'account':_0x4d8ad7[_0x7138('0x6b')][_0x7138('0x20')],'agent':_0x4d8ad7[_0x7138('0x6c')]?_0x4d8ad7[_0x7138('0x6c')][_0x7138('0x60')]:'N.A.','createdAt':moment(_0x4d8ad7[_0x7138('0x67')])[_0x7138('0x4a')](_0x7138('0x4b'))[_0x7138('0x57')](),'closedAt':_0x4d8ad7['closed']?moment(_0x4d8ad7[_0x7138('0x70')])['format'](_0x7138('0x4b'))[_0x7138('0x57')]():'','disposition':_0x4d8ad7[_0x7138('0x71')],'messages':_(_0x4d8ad7[_0x7138('0x66')])['filter']({'secret':![]})[_0x7138('0x23')](function(_0x3d9c2f){if(_0x3d9c2f[_0x7138('0x65')]){var _0x31922f=path['join'](_0xbc861c,_0x3d9c2f[_0x7138('0x65')][_0x7138('0x72')]);if(fs['existsSync'](_0x31922f)){fs[_0x7138('0x73')](_0x31922f)['pipe'](fs['createWriteStream'](path[_0x7138('0x5b')](_0xf9a924,_0x3d9c2f[_0x7138('0x65')][_0x7138('0x72')])));}}return{'date':moment(_0x3d9c2f[_0x7138('0x67')])[_0x7138('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x3d9c2f['direction']===_0x7138('0x74')?_0x3d9c2f['User']?_0x3d9c2f['User'][_0x7138('0x60')]:_0x7138('0x75'):_0x3d9c2f['Contact'][_0x7138('0x63')]+(_0x3d9c2f['Contact'][_0x7138('0x64')]?'\x20'+_0x3d9c2f['Contact'][_0x7138('0x64')]:''),'body':_0x3d9c2f[_0x7138('0x65')]?_0x3d9c2f[_0x7138('0x65')][_0x7138('0x72')]:_0x3d9c2f[_0x7138('0x3b')],'direction':_0x3d9c2f[_0x7138('0x76')]===_0x7138('0x74')?'A':'C','secret':_0x3d9c2f[_0x7138('0x68')],'read':_0x3d9c2f[_0x7138('0x69')],'attachment':_0x3d9c2f[_0x7138('0x65')]};})['value']()};return ejs[_0x7138('0x77')](path[_0x7138('0x5b')](config[_0x7138('0x5c')],_0x7138('0x58'),_0x7138('0x78'),_0x7138('0x79')),{'interaction':_0x3a1ec6})[_0x7138('0x1c')](function(_0x4d6c2c){var _0x5650a2=path[_0x7138('0x5b')](_0xf9a924,'transcript-'+_0x4d8ad7['id']+'-'+_0xdec74e+_0x7138('0x7a'));var _0x5694d5={'path':_0x5650a2,'channel':_0x7138('0x6f'),'interactionId':_0x4d8ad7['id']};return pdf['createPdfFromHTML'](_0x4d6c2c,_0x5694d5);})[_0x7138('0x1c')](function(){return new BPromise(function(_0x3d7466,_0x3fc176){zipdir(_0xf9a924,{'saveTo':_0x5123a5},function(_0x390a4f,_0x481cde){if(_0x390a4f)return _0x3fc176(_0x390a4f);return _0x3d7466(_0x481cde);});})['then'](function(){return new BPromise(function(_0x115580,_0x5d0714){rimraf(_0xf9a924,function(_0x231a06){if(_0x231a06)_0x5d0714(_0x231a06);return _0x115580();});});})[_0x7138('0x1c')](function(){return _0x26e41f['download'](_0x5123a5,_0xdd4bf8,function(_0x5ab82c){if(_0x5ab82c){console[_0x7138('0x7b')](_0x7138('0x7c'),_0x5ab82c);}else{fs[_0x7138('0x7d')](_0x5123a5);}});});});}else{return _0x26e41f['sendStatus'](0xc8);}})[_0x7138('0x2b')](handleError(_0x26e41f,null));}; \ No newline at end of file +var _0xa96e=['files','tmp','root','format','transcript-%d-%s.zip','User','fullname','firstName','attachments','push','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Owner','mkdirSync','Whatsapp','Account','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','moment','bluebird','util','path','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./whatsappInteraction.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','update','then','destroy','error','stack','name','map','WhatsappInteraction','rawAttributes','fieldName','key','findAll','whatsapp','query','catch','show','params','model','keys','filters','intersection','attributes','fields','includeAll','include','options','create','body','find','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','nolimit','order','sort','pick','where','WhatsappInteractionId','filter','$gte','split','merge','rows','addTags','spread','Tag','color','whatsappInteractionTags:save','removeTags','download','unix','toString','join','server'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa96e,0x127));var _0xea96=function(_0x29c948,_0x178fe4){_0x29c948=_0x29c948-0x0;var _0x175f09=_0xa96e[_0x29c948];return _0x175f09;};'use strict';var rimraf=require(_0xea96('0x0'));var zipdir=require('zip-dir');var moment=require(_0xea96('0x1'));var BPromise=require(_0xea96('0x2'));var util=require(_0xea96('0x3'));var path=require(_0xea96('0x4'));var ejs=require(_0xea96('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xea96('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xea96('0x7'));var pdf=require(_0xea96('0x8'));var logger=require(_0xea96('0x9'))(_0xea96('0xa'));var config=require(_0xea96('0xb'));var db=require(_0xea96('0xc'))['db'];config['redis']=_['defaults'](config[_0xea96('0xd')],{'host':_0xea96('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xea96('0xf'))[_0xea96('0x10')](socket);function respondWithStatusCode(_0x11f8fe,_0xf3d01c){_0xf3d01c=_0xf3d01c||0xcc;return function(_0x139b5b){if(_0x139b5b){return _0x11f8fe[_0xea96('0x11')](_0xf3d01c);}return _0x11f8fe[_0xea96('0x12')](_0xf3d01c)['end']();};}function respondWithResult(_0x26a122,_0x1e8ff0){_0x1e8ff0=_0x1e8ff0||0xc8;return function(_0x4fe8b8){if(_0x4fe8b8){return _0x26a122[_0xea96('0x12')](_0x1e8ff0)[_0xea96('0x13')](_0x4fe8b8);}};}function respondWithFilteredResult(_0x2f4873,_0x3fcbd4){return function(_0x2edaf8){if(_0x2edaf8){var _0xe5070d=typeof _0x3fcbd4[_0xea96('0x14')]==='undefined'&&typeof _0x3fcbd4[_0xea96('0x15')]===_0xea96('0x16');var _0x5c8da8=_0x2edaf8['count'];var _0x5c71cd=_0xe5070d?0x0:_0x3fcbd4[_0xea96('0x14')];var _0x43e2bf=_0xe5070d?_0x2edaf8[_0xea96('0x17')]:_0x3fcbd4[_0xea96('0x14')]+_0x3fcbd4[_0xea96('0x15')];var _0x2c587a;if(_0x43e2bf>=_0x5c8da8){_0x43e2bf=_0x5c8da8;_0x2c587a=0xc8;}else{_0x2c587a=0xce;}_0x2f4873[_0xea96('0x12')](_0x2c587a);return _0x2f4873[_0xea96('0x18')]('Content-Range',_0x5c71cd+'-'+_0x43e2bf+'/'+_0x5c8da8)[_0xea96('0x13')](_0x2edaf8);}return null;};}function saveUpdates(_0x34a04c){return function(_0x435be7){if(_0x435be7){return _0x435be7[_0xea96('0x19')](_0x34a04c)[_0xea96('0x1a')](function(_0x286da3){return _0x286da3;});}return null;};}function removeEntity(_0x3f32c3){return function(_0x333afd){if(_0x333afd){return _0x333afd[_0xea96('0x1b')]()[_0xea96('0x1a')](function(){_0x3f32c3[_0xea96('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2abc46){return function(_0x1d6b46){if(!_0x1d6b46){_0x2abc46[_0xea96('0x11')](0x194);}return _0x1d6b46;};}function handleError(_0x35e2ee,_0xda0ba2){_0xda0ba2=_0xda0ba2||0x1f4;return function(_0x391ba5){logger[_0xea96('0x1c')](_0x391ba5[_0xea96('0x1d')]);if(_0x391ba5[_0xea96('0x1e')]){delete _0x391ba5[_0xea96('0x1e')];}_0x35e2ee[_0xea96('0x12')](_0xda0ba2)['send'](_0x391ba5);};}exports['index']=function(_0x3af11c,_0x26ea70){var _0x57f829={};var _0x212ad7=_[_0xea96('0x1f')](db[_0xea96('0x20')][_0xea96('0x21')],function(_0x545344){return{'name':_0x545344[_0xea96('0x22')],'type':_0x545344['type'][_0xea96('0x23')]};});_0x57f829=qs['getOptions'](_0x212ad7,_0x3af11c);return interaction[_0xea96('0x24')](_0xea96('0x25'),_0x3af11c[_0xea96('0x26')],_0x3af11c['user'],_0x57f829,_0x212ad7)[_0xea96('0x1a')](respondWithFilteredResult(_0x26ea70,_0x57f829))[_0xea96('0x27')](handleError(_0x26ea70,null));};exports[_0xea96('0x28')]=function(_0x1890a7,_0x4976f5){var _0x9d36e2={'raw':![],'where':{'id':_0x1890a7[_0xea96('0x29')]['id']}},_0x433974={};_0x433974[_0xea96('0x2a')]=_['keys'](db[_0xea96('0x20')][_0xea96('0x21')]);_0x433974[_0xea96('0x26')]=_[_0xea96('0x2b')](_0x1890a7[_0xea96('0x26')]);_0x433974[_0xea96('0x2c')]=_[_0xea96('0x2d')](_0x433974[_0xea96('0x2a')],_0x433974['query']);_0x9d36e2[_0xea96('0x2e')]=_[_0xea96('0x2d')](_0x433974[_0xea96('0x2a')],qs[_0xea96('0x2f')](_0x1890a7[_0xea96('0x26')][_0xea96('0x2f')]));_0x9d36e2[_0xea96('0x2e')]=_0x9d36e2[_0xea96('0x2e')]['length']?_0x9d36e2[_0xea96('0x2e')]:_0x433974['model'];if(_0x1890a7[_0xea96('0x26')][_0xea96('0x30')]){_0x9d36e2[_0xea96('0x31')]=[{'all':!![]}];}_0x9d36e2=_['merge']({},_0x9d36e2,_0x1890a7[_0xea96('0x32')]);return db['WhatsappInteraction']['find'](_0x9d36e2)['then'](handleEntityNotFound(_0x4976f5,null))[_0xea96('0x1a')](respondWithResult(_0x4976f5,null))[_0xea96('0x27')](handleError(_0x4976f5,null));};exports[_0xea96('0x33')]=function(_0x310d11,_0x51341e){return db[_0xea96('0x20')][_0xea96('0x33')](_0x310d11[_0xea96('0x34')],{})[_0xea96('0x1a')](respondWithResult(_0x51341e,0xc9))[_0xea96('0x27')](handleError(_0x51341e,null));};exports[_0xea96('0x19')]=function(_0x5afd5c,_0x223310){if(_0x5afd5c['body']['id']){delete _0x5afd5c[_0xea96('0x34')]['id'];}return db[_0xea96('0x20')][_0xea96('0x35')]({'where':{'id':_0x5afd5c[_0xea96('0x29')]['id']}})[_0xea96('0x1a')](handleEntityNotFound(_0x223310,null))[_0xea96('0x1a')](saveUpdates(_0x5afd5c[_0xea96('0x34')],null))[_0xea96('0x1a')](respondWithResult(_0x223310,null))[_0xea96('0x27')](handleError(_0x223310,null));};exports[_0xea96('0x1b')]=function(_0x45dd2b,_0x274db2){return db[_0xea96('0x20')]['find']({'where':{'id':_0x45dd2b[_0xea96('0x29')]['id']}})['then'](handleEntityNotFound(_0x274db2,null))['then'](removeEntity(_0x274db2,null))[_0xea96('0x27')](handleError(_0x274db2,null));};exports['describe']=function(_0x201b4f,_0x388a38){return db[_0xea96('0x20')][_0xea96('0x36')]()[_0xea96('0x1a')](respondWithResult(_0x388a38,null))[_0xea96('0x27')](handleError(_0x388a38,null));};exports[_0xea96('0x37')]=function(_0x14d224,_0x25b5fc){return db[_0xea96('0x38')]['find']({'where':{'id':_0x14d224[_0xea96('0x29')]['id']}})[_0xea96('0x1a')](handleEntityNotFound(_0x25b5fc,null))[_0xea96('0x1a')](function(_0x35a3e3){if(_0x35a3e3){return _0x35a3e3[_0xea96('0x37')](_0x14d224[_0xea96('0x34')][_0xea96('0x39')],_[_0xea96('0x3a')](_0x14d224[_0xea96('0x34')],[_0xea96('0x39'),'id'])||{});}})[_0xea96('0x1a')](respondWithResult(_0x25b5fc,null))[_0xea96('0x27')](handleError(_0x25b5fc,null));};exports[_0xea96('0x3b')]=function(_0x332432,_0x3d306b){var _0xc2f15={'raw':![],'where':{}};var _0x5bd6c4={};var _0x5727da={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xea96('0x3c')]({'where':{'id':_0x332432[_0xea96('0x29')]['id']}})['then'](handleEntityNotFound(_0x3d306b,null))[_0xea96('0x1a')](function(_0x41adf8){if(_0x41adf8){_0x5bd6c4['model']=_[_0xea96('0x2b')](db[_0xea96('0x38')][_0xea96('0x21')]);_0x5bd6c4[_0xea96('0x26')]=_[_0xea96('0x2b')](_0x332432[_0xea96('0x26')]);_0x5bd6c4[_0xea96('0x2c')]=_[_0xea96('0x2d')](_0x5bd6c4[_0xea96('0x2a')],_0x5bd6c4[_0xea96('0x26')]);_0xc2f15[_0xea96('0x2e')]=_[_0xea96('0x2d')](_0x5bd6c4['model'],qs[_0xea96('0x2f')](_0x332432[_0xea96('0x26')][_0xea96('0x2f')]));_0xc2f15[_0xea96('0x2e')]=_0xc2f15['attributes']['length']?_0xc2f15[_0xea96('0x2e')]:_0x5bd6c4[_0xea96('0x2a')];if(!_0x332432[_0xea96('0x26')]['hasOwnProperty'](_0xea96('0x3d'))){_0xc2f15[_0xea96('0x15')]=qs[_0xea96('0x15')](_0x332432[_0xea96('0x26')]['limit']);_0xc2f15[_0xea96('0x14')]=qs[_0xea96('0x14')](_0x332432['query'][_0xea96('0x14')]);}_0xc2f15[_0xea96('0x3e')]=qs[_0xea96('0x3f')](_0x332432['query'][_0xea96('0x3f')]);_0xc2f15['where']=qs[_0xea96('0x2c')](_[_0xea96('0x40')](_0x332432[_0xea96('0x26')],_0x5bd6c4['filters']));_0xc2f15[_0xea96('0x41')][_0xea96('0x42')]=_0x41adf8['id'];if(_0x332432['query']['filter']){_0xc2f15['where']=_['merge'](_0xc2f15[_0xea96('0x41')],{'$or':_[_0xea96('0x1f')](_0xc2f15[_0xea96('0x2e')],function(_0x1c47a5){var _0x372142={};_0x372142[_0x1c47a5]={'$like':'%'+_0x332432[_0xea96('0x26')][_0xea96('0x43')]+'%'};return _0x372142;})});}if(_0x332432[_0xea96('0x26')][_0xea96('0x44')]){var _0x61a0c4=_0x332432['query'][_0xea96('0x44')][_0xea96('0x45')](',');var _0x3504c8={};_0x3504c8[_0x61a0c4[0x0]]={'$gte':moment(_0x61a0c4[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xc2f15['where']=_['merge'](_0xc2f15['where'],_0x3504c8);}_0xc2f15=_[_0xea96('0x46')]({},_0xc2f15,_0x332432[_0xea96('0x32')]);return db['WhatsappMessage']['count']({'where':_0xc2f15[_0xea96('0x41')]})[_0xea96('0x1a')](function(_0x2d3032){_0x5727da[_0xea96('0x17')]=_0x2d3032;if(_0x332432['query']['includeAll']){_0xc2f15['include']=[{'all':!![]}];}return db[_0xea96('0x38')][_0xea96('0x24')](_0xc2f15);})[_0xea96('0x1a')](function(_0x33f9e0){_0x5727da[_0xea96('0x47')]=_0x33f9e0;return _0x5727da;});}})[_0xea96('0x1a')](respondWithFilteredResult(_0x3d306b,_0xc2f15))[_0xea96('0x27')](handleError(_0x3d306b,null));};exports[_0xea96('0x48')]=function(_0x687637,_0x3e2841){return db[_0xea96('0x20')][_0xea96('0x35')]({'where':{'id':_0x687637[_0xea96('0x29')]['id']}})[_0xea96('0x1a')](handleEntityNotFound(_0x3e2841,null))['then'](function(_0x268e8c){if(_0x268e8c){return _0x268e8c['setTags'](_0x687637[_0xea96('0x34')][_0xea96('0x39')],_[_0xea96('0x3a')](_0x687637[_0xea96('0x34')],[_0xea96('0x39'),'id'])||{})[_0xea96('0x49')](function(){return db[_0xea96('0x4a')]['findAll']({'attributes':['id',_0xea96('0x1e'),_0xea96('0x4b')],'where':{'id':_0x687637[_0xea96('0x34')][_0xea96('0x39')]}});})['then'](function(_0x405ca2){socket['emit'](_0xea96('0x4c'),{'id':Number(_0x687637[_0xea96('0x29')]['id']),'tags':_0x405ca2||[]});return{'id':Number(_0x687637[_0xea96('0x29')]['id']),'tags':_0x405ca2||[]};});}})[_0xea96('0x1a')](respondWithResult(_0x3e2841,null))[_0xea96('0x27')](handleError(_0x3e2841,null));};exports[_0xea96('0x4d')]=function(_0x2b1826,_0x3e6790){return db['WhatsappInteraction']['find']({'where':{'id':_0x2b1826[_0xea96('0x29')]['id']}})[_0xea96('0x1a')](handleEntityNotFound(_0x3e6790,null))[_0xea96('0x1a')](function(_0x4e6caf){if(_0x4e6caf){return _0x4e6caf[_0xea96('0x4d')](_0x2b1826[_0xea96('0x26')][_0xea96('0x39')]);}})[_0xea96('0x1a')](respondWithStatusCode(_0x3e6790,null))[_0xea96('0x27')](handleError(_0x3e6790,null));};exports[_0xea96('0x4e')]=function(_0x23ee0b,_0x50840e){var _0x5272d3=moment()[_0xea96('0x4f')]()[_0xea96('0x50')]();var _0x187b15=path[_0xea96('0x51')](config['root'],_0xea96('0x52'),_0xea96('0x53'),_0xea96('0x54'));var _0x3cd5a6=path['join'](config[_0xea96('0x55')],_0xea96('0x52'),_0xea96('0x53'),'attachments');var _0x4faebb=path[_0xea96('0x51')](_0x187b15,_0x5272d3);var _0x116f11=util[_0xea96('0x56')](_0xea96('0x57'),_0x23ee0b[_0xea96('0x29')]['id'],_0x5272d3);var _0x3ef5e8=path[_0xea96('0x51')](_0x187b15,_0x116f11);var _0x41a5ba=[];_0x41a5ba['push']({'model':db[_0xea96('0x58')],'as':_0xea96('0x58'),'attributes':['id',_0xea96('0x59')],'raw':!![]});_0x41a5ba['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xea96('0x5a'),'lastName'],'raw':!![]});if(_0x23ee0b[_0xea96('0x26')][_0xea96('0x5b')]){_0x41a5ba[_0xea96('0x5c')]({'model':db[_0xea96('0x5d')],'as':_0xea96('0x5d'),'raw':!![]});}var _0x383f75=[{'model':db[_0xea96('0x38')],'as':_0xea96('0x5e'),'attributes':['id',_0xea96('0x34'),_0xea96('0x5f'),_0xea96('0x60'),_0xea96('0x61'),_0xea96('0x62')],'include':_0x41a5ba}];_0x383f75['push']({'model':db[_0xea96('0x63')],'as':'Account','attributes':['id',_0xea96('0x1e')]});_0x383f75['push']({'model':db[_0xea96('0x58')],'as':_0xea96('0x64'),'attributes':['id',_0xea96('0x59')]});return db[_0xea96('0x20')]['find']({'where':{'id':_0x23ee0b[_0xea96('0x29')]['id']},'include':_0x383f75})[_0xea96('0x1a')](handleEntityNotFound(_0x50840e,null))[_0xea96('0x1a')](function(_0x246175){if(_0x246175){var _0x8241ce=_0x246175['get']({'plain':!![]});fs[_0xea96('0x65')](_0x4faebb);var _0x55514d={'channel':_0xea96('0x66'),'account':_0x8241ce[_0xea96('0x67')][_0xea96('0x1e')],'agent':_0x8241ce[_0xea96('0x64')]?_0x8241ce[_0xea96('0x64')][_0xea96('0x59')]:'N.A.','createdAt':moment(_0x8241ce[_0xea96('0x5f')])[_0xea96('0x56')]('YYYY-MM-DD\x20HH:mm:ss')[_0xea96('0x50')](),'closedAt':_0x8241ce[_0xea96('0x68')]?moment(_0x8241ce[_0xea96('0x69')])[_0xea96('0x56')](_0xea96('0x6a'))[_0xea96('0x50')]():'','disposition':_0x8241ce[_0xea96('0x6b')],'messages':_(_0x8241ce['Messages'])[_0xea96('0x43')]({'secret':![]})['map'](function(_0x2338d0){if(_0x2338d0['Attachment']){var _0x401726=path[_0xea96('0x51')](_0x3cd5a6,_0x2338d0[_0xea96('0x5d')][_0xea96('0x6c')]);if(fs[_0xea96('0x6d')](_0x401726)){fs[_0xea96('0x6e')](_0x401726)[_0xea96('0x6f')](fs[_0xea96('0x70')](path['join'](_0x4faebb,_0x2338d0[_0xea96('0x5d')][_0xea96('0x6c')])));}}return{'date':moment(_0x2338d0[_0xea96('0x5f')])['format'](_0xea96('0x6a'))[_0xea96('0x50')](),'sender':_0x2338d0['direction']===_0xea96('0x71')?_0x2338d0[_0xea96('0x58')]?_0x2338d0[_0xea96('0x58')][_0xea96('0x59')]:_0xea96('0x72'):_0x2338d0[_0xea96('0x73')][_0xea96('0x5a')]+(_0x2338d0[_0xea96('0x73')][_0xea96('0x74')]?'\x20'+_0x2338d0[_0xea96('0x73')][_0xea96('0x74')]:''),'body':_0x2338d0[_0xea96('0x5d')]?_0x2338d0['Attachment'][_0xea96('0x6c')]:_0x2338d0[_0xea96('0x34')],'direction':_0x2338d0[_0xea96('0x60')]===_0xea96('0x71')?'A':'C','secret':_0x2338d0[_0xea96('0x61')],'read':_0x2338d0[_0xea96('0x62')],'attachment':_0x2338d0[_0xea96('0x5d')]};})[_0xea96('0x75')]()};return ejs[_0xea96('0x76')](path[_0xea96('0x51')](config[_0xea96('0x55')],_0xea96('0x52'),_0xea96('0x77'),_0xea96('0x78')),{'interaction':_0x55514d})[_0xea96('0x1a')](function(_0x518890){var _0xb00cdc=path[_0xea96('0x51')](_0x4faebb,_0xea96('0x79')+_0x8241ce['id']+'-'+_0x5272d3+'.pdf');var _0x8f47c5={'path':_0xb00cdc,'channel':'Whatsapp','interactionId':_0x8241ce['id']};return pdf[_0xea96('0x7a')](_0x518890,_0x8f47c5);})[_0xea96('0x1a')](function(){return new BPromise(function(_0x60cdc4,_0x4b3d3a){zipdir(_0x4faebb,{'saveTo':_0x3ef5e8},function(_0x3e41e3,_0x5acf72){if(_0x3e41e3)return _0x4b3d3a(_0x3e41e3);return _0x60cdc4(_0x5acf72);});})['then'](function(){return new BPromise(function(_0x2bd798,_0x5bd0c8){rimraf(_0x4faebb,function(_0x5a3d2b){if(_0x5a3d2b)_0x5bd0c8(_0x5a3d2b);return _0x2bd798();});});})['then'](function(){return _0x50840e[_0xea96('0x4e')](_0x3ef5e8,_0x116f11,function(_0x3f837b){if(_0x3f837b){console[_0xea96('0x7b')](_0xea96('0x7c'),_0x3f837b);}else{fs[_0xea96('0x7d')](_0x3ef5e8);}});});});}else{return _0x50840e['sendStatus'](0xc8);}})['catch'](handleError(_0x50840e,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index e95264d..20dda29 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 _0xee4f=['length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','setDataValue','Users','findAll','then'];(function(_0xcf02ce,_0x30e982){var _0x1d8b7c=function(_0x401af3){while(--_0x401af3){_0xcf02ce['push'](_0xcf02ce['shift']());}};_0x1d8b7c(++_0x30e982);}(_0xee4f,0xad));var _0xfee4=function(_0x4bf497,_0x30f242){_0x4bf497=_0x4bf497-0x0;var _0xb5f818=_0xee4f[_0x4bf497];return _0xb5f818;};'use strict';var EventEmitter=require(_0xfee4('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xfee4('0x1'))['db'][_0xfee4('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xfee4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfee4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x27874a){return function(_0x505b55,_0x4da9b6,_0x1c39b1){_0x505b55['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2fb1b3){_0x505b55[_0xfee4('0x5')](_0xfee4('0x6'),_0x2fb1b3['map'](function(_0x52fc6e){return{'id':_0x52fc6e['id']};}));return WhatsappMessage[_0xfee4('0x7')]({'where':{'WhatsappInteractionId':_0x505b55['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfee4('0x8')](function(_0xa77876){_0x505b55['setDataValue']('unreadMessages',_0xa77876[_0xfee4('0x9')]);WhatsappInteractionEvents[_0xfee4('0xa')](_0x27874a+':'+_0x505b55['id'],_0x505b55);WhatsappInteractionEvents[_0xfee4('0xa')](_0x27874a,_0x505b55);_0x1c39b1(null);})['catch'](_0x1c39b1(null));};}for(var e in events){if(events[_0xfee4('0xb')](e)){var event=events[e];WhatsappInteraction[_0xfee4('0xc')](e,emitEvent(event));}}module[_0xfee4('0xd')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x1bca=['getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','../../mysqldb','WhatsappMessage','save','update','remove'];(function(_0xd2ef80,_0x2d546f){var _0x53d69e=function(_0xcc8fde){while(--_0xcc8fde){_0xd2ef80['push'](_0xd2ef80['shift']());}};_0x53d69e(++_0x2d546f);}(_0x1bca,0xb6));var _0xa1bc=function(_0x5a7cf0,_0x5f49fa){_0x5a7cf0=_0x5a7cf0-0x0;var _0x36aa88=_0x1bca[_0x5a7cf0];return _0x36aa88;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xa1bc('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0xa1bc('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa1bc('0x2'),'afterUpdate':_0xa1bc('0x3'),'afterDestroy':_0xa1bc('0x4')};function emitEvent(_0x543df3){return function(_0x268282,_0x462dc2,_0x168b44){_0x268282[_0xa1bc('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x43a67){_0x268282[_0xa1bc('0x6')](_0xa1bc('0x7'),_0x43a67[_0xa1bc('0x8')](function(_0x16b36f){return{'id':_0x16b36f['id']};}));return WhatsappMessage[_0xa1bc('0x9')]({'where':{'WhatsappInteractionId':_0x268282['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa1bc('0xa')](function(_0x4b2e4e){_0x268282[_0xa1bc('0x6')](_0xa1bc('0xb'),_0x4b2e4e[_0xa1bc('0xc')]);WhatsappInteractionEvents[_0xa1bc('0xd')](_0x543df3+':'+_0x268282['id'],_0x268282);WhatsappInteractionEvents[_0xa1bc('0xd')](_0x543df3,_0x268282);_0x168b44(null);})[_0xa1bc('0xe')](_0x168b44(null));};}for(var e in events){if(events[_0xa1bc('0xf')](e)){var event=events[e];WhatsappInteraction[_0xa1bc('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 25dd97a..14557a5 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 _0x9c87=['define','WhatsappInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x27c24e,_0x5db1c7){var _0x39004a=function(_0x44286d){while(--_0x44286d){_0x27c24e['push'](_0x27c24e['shift']());}};_0x39004a(++_0x5db1c7);}(_0x9c87,0x86));var _0x79c8=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x9c87[_0x616290];return _0x453879;};'use strict';var _=require(_0x79c8('0x0'));var util=require(_0x79c8('0x1'));var logger=require(_0x79c8('0x2'))(_0x79c8('0x3'));var moment=require(_0x79c8('0x4'));var BPromise=require(_0x79c8('0x5'));var rp=require(_0x79c8('0x6'));var fs=require('fs');var path=require(_0x79c8('0x7'));var rimraf=require('rimraf');var config=require(_0x79c8('0x8'));var attributes=require('./whatsappInteraction.attributes');module[_0x79c8('0x9')]=function(_0x1b0ec7,_0x606086){return _0x1b0ec7[_0x79c8('0xa')](_0x79c8('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5eae1e,_0xa413fb,_0x4ef00c){if(_0x5eae1e[_0x79c8('0xc')]('closed')){_0x5eae1e[_0x79c8('0xd')]=moment()[_0x79c8('0xe')](_0x79c8('0xf'));}_0x4ef00c(null,_0x5eae1e);}}});}; \ No newline at end of file +var _0x223e=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x1f44e4,_0x22d9fd){var _0x591989=function(_0x3aeb88){while(--_0x3aeb88){_0x1f44e4['push'](_0x1f44e4['shift']());}};_0x591989(++_0x22d9fd);}(_0x223e,0x1b1));var _0xe223=function(_0x179b53,_0x31f6fe){_0x179b53=_0x179b53-0x0;var _0x38a146=_0x223e[_0x179b53];return _0x38a146;};'use strict';var _=require(_0xe223('0x0'));var util=require(_0xe223('0x1'));var logger=require(_0xe223('0x2'))('api');var moment=require(_0xe223('0x3'));var BPromise=require(_0xe223('0x4'));var rp=require(_0xe223('0x5'));var fs=require('fs');var path=require(_0xe223('0x6'));var rimraf=require(_0xe223('0x7'));var config=require(_0xe223('0x8'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x3084b0,_0xde7d70){return _0x3084b0['define'](_0xe223('0x9'),attributes,{'tableName':_0xe223('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4cffbb,_0x4370e1,_0x2a818e){if(_0x4cffbb[_0xe223('0xb')](_0xe223('0xc'))){_0x4cffbb[_0xe223('0xd')]=moment()['format'](_0xe223('0xe'));}_0x2a818e(null,_0x4cffbb);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 98bd5a5..0d8fab7 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 _0xff25=['defaults','redis','socket.io-emitter','./whatsappInteraction.socket','register','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','WhatsappInteraction','update','body','options','raw','where','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','ids','omit','spread','AddTags','stringify','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x50da74,_0x5286e8){var _0x3b8327=function(_0x51c62e){while(--_0x51c62e){_0x50da74['push'](_0x50da74['shift']());}};_0x3b8327(++_0x5286e8);}(_0xff25,0xe6));var _0x5ff2=function(_0x5e7c2b,_0x1b0a26){_0x5e7c2b=_0x5e7c2b-0x0;var _0xd7c8cf=_0xff25[_0x5e7c2b];return _0xd7c8cf;};'use strict';var _=require(_0x5ff2('0x0'));var util=require('util');var moment=require(_0x5ff2('0x1'));var BPromise=require(_0x5ff2('0x2'));var rs=require(_0x5ff2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ff2('0x4'))['db'];var utils=require(_0x5ff2('0x5'));var logger=require('../../config/logger')(_0x5ff2('0x6'));var config=require(_0x5ff2('0x7'));var jayson=require(_0x5ff2('0x8'));var client=jayson[_0x5ff2('0x9')]['http']({'port':0x232a});config['redis']=_[_0x5ff2('0xa')](config[_0x5ff2('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ff2('0xc'))(new Redis(config[_0x5ff2('0xb')]));require(_0x5ff2('0xd'))[_0x5ff2('0xe')](socket);function respondWithRpcPromise(_0x2d16b8,_0x208d2e,_0x54b8fe){return new BPromise(function(_0x574601,_0x4b6808){return client['request'](_0x2d16b8,_0x54b8fe)[_0x5ff2('0xf')](function(_0x9f9f33){logger['info'](_0x5ff2('0x10'),_0x208d2e,_0x5ff2('0x11'));logger[_0x5ff2('0x12')](_0x5ff2('0x13'),_0x208d2e,_0x5ff2('0x11'),JSON['stringify'](_0x9f9f33));if(_0x9f9f33[_0x5ff2('0x14')]){if(_0x9f9f33[_0x5ff2('0x14')]['code']===0x1f4){logger[_0x5ff2('0x14')](_0x5ff2('0x10'),_0x208d2e,_0x9f9f33[_0x5ff2('0x14')][_0x5ff2('0x15')]);return _0x4b6808(_0x9f9f33[_0x5ff2('0x14')][_0x5ff2('0x15')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x208d2e,_0x9f9f33[_0x5ff2('0x14')]['message']);return _0x574601(_0x9f9f33[_0x5ff2('0x14')][_0x5ff2('0x15')]);}else{logger[_0x5ff2('0x16')](_0x5ff2('0x10'),_0x208d2e,_0x5ff2('0x11'));_0x574601(_0x9f9f33[_0x5ff2('0x17')][_0x5ff2('0x15')]);}})['catch'](function(_0x40fe58){logger['error'](_0x5ff2('0x10'),_0x208d2e,_0x40fe58);_0x4b6808(_0x40fe58);});});}exports['UpdateWhatsappInteraction']=function(_0x28bc91){var _0x4fff98=this;return new Promise(function(_0x304a54,_0x4fd331){return db[_0x5ff2('0x18')][_0x5ff2('0x19')](_0x28bc91[_0x5ff2('0x1a')],{'raw':_0x28bc91['options']?_0x28bc91[_0x5ff2('0x1b')][_0x5ff2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28bc91[_0x5ff2('0x1b')]?_0x28bc91[_0x5ff2('0x1b')][_0x5ff2('0x1d')]||null:null,'attributes':_0x28bc91[_0x5ff2('0x1b')]?_0x28bc91['options']['attributes']||null:null,'limit':_0x28bc91[_0x5ff2('0x1b')]?_0x28bc91[_0x5ff2('0x1b')][_0x5ff2('0x1e')]||null:null})[_0x5ff2('0xf')](function(_0x4878a0){logger['info'](_0x5ff2('0x1f'),_0x28bc91);logger[_0x5ff2('0x12')](_0x5ff2('0x1f'),_0x28bc91,JSON['stringify'](_0x4878a0));_0x304a54(_0x4878a0);})['catch'](function(_0x58a570){logger[_0x5ff2('0x14')](_0x5ff2('0x1f'),_0x58a570[_0x5ff2('0x15')],_0x28bc91);_0x4fd331(_0x4fff98[_0x5ff2('0x14')](0x1f4,_0x58a570[_0x5ff2('0x15')]));});});};exports[_0x5ff2('0x20')]=function(_0x60122e){return new Promise(function(_0x1aae3f,_0x3ff3a7){return db[_0x5ff2('0x18')][_0x5ff2('0x21')]({'where':_0x60122e['options']?_0x60122e[_0x5ff2('0x1b')][_0x5ff2('0x1d')]||null:null})['then'](function(_0x17590f){if(_0x17590f){return _0x17590f['addTags'](_0x60122e[_0x5ff2('0x1a')][_0x5ff2('0x22')],_[_0x5ff2('0x23')](_0x60122e[_0x5ff2('0x1a')],[_0x5ff2('0x22'),'id'])||{});}})[_0x5ff2('0x24')](function(_0x230382){logger[_0x5ff2('0x16')](_0x5ff2('0x25'),_0x60122e);logger[_0x5ff2('0x12')]('AddTags',_0x60122e,JSON[_0x5ff2('0x26')](_0x230382));_0x1aae3f(_0x230382);})[_0x5ff2('0x27')](function(_0x1f9275){logger[_0x5ff2('0x14')](_0x5ff2('0x25'),_0x1f9275[_0x5ff2('0x15')],_0x60122e);_0x3ff3a7(_this[_0x5ff2('0x14')](0x1f4,_0x1f9275[_0x5ff2('0x15')]));});});}; \ No newline at end of file +var _0x3605=['AddTagsToWhatsappInteraction','ids','AddTags','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','limit'];(function(_0x282714,_0x3f3e67){var _0x2dfb1e=function(_0x3db3d3){while(--_0x3db3d3){_0x282714['push'](_0x282714['shift']());}};_0x2dfb1e(++_0x3f3e67);}(_0x3605,0x9f));var _0x5360=function(_0x1d3dcd,_0x5e1e91){_0x1d3dcd=_0x1d3dcd-0x0;var _0x3bcc68=_0x3605[_0x1d3dcd];return _0x3bcc68;};'use strict';var _=require(_0x5360('0x0'));var util=require(_0x5360('0x1'));var moment=require(_0x5360('0x2'));var BPromise=require(_0x5360('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5360('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5360('0x5'))(_0x5360('0x6'));var config=require(_0x5360('0x7'));var jayson=require(_0x5360('0x8'));var client=jayson[_0x5360('0x9')][_0x5360('0xa')]({'port':0x232a});config['redis']=_[_0x5360('0xb')](config[_0x5360('0xc')],{'host':_0x5360('0xd'),'port':0x18eb});var socket=require(_0x5360('0xe'))(new Redis(config[_0x5360('0xc')]));require(_0x5360('0xf'))['register'](socket);function respondWithRpcPromise(_0x48d1f7,_0x45372b,_0x99bf7){return new BPromise(function(_0x2e1183,_0x2750ba){return client['request'](_0x48d1f7,_0x99bf7)[_0x5360('0x10')](function(_0x42c9d0){logger[_0x5360('0x11')](_0x5360('0x12'),_0x45372b,'request\x20sent');logger[_0x5360('0x13')](_0x5360('0x14'),_0x45372b,_0x5360('0x15'),JSON[_0x5360('0x16')](_0x42c9d0));if(_0x42c9d0[_0x5360('0x17')]){if(_0x42c9d0['error'][_0x5360('0x18')]===0x1f4){logger[_0x5360('0x17')](_0x5360('0x12'),_0x45372b,_0x42c9d0['error'][_0x5360('0x19')]);return _0x2750ba(_0x42c9d0['error']['message']);}logger[_0x5360('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x45372b,_0x42c9d0[_0x5360('0x17')][_0x5360('0x19')]);return _0x2e1183(_0x42c9d0[_0x5360('0x17')][_0x5360('0x19')]);}else{logger['info'](_0x5360('0x12'),_0x45372b,_0x5360('0x15'));_0x2e1183(_0x42c9d0[_0x5360('0x1a')][_0x5360('0x19')]);}})[_0x5360('0x1b')](function(_0x102fe5){logger[_0x5360('0x17')](_0x5360('0x12'),_0x45372b,_0x102fe5);_0x2750ba(_0x102fe5);});});}exports[_0x5360('0x1c')]=function(_0x27ff71){var _0x74d214=this;return new Promise(function(_0x1f06d6,_0x5943dc){return db[_0x5360('0x1d')][_0x5360('0x1e')](_0x27ff71[_0x5360('0x1f')],{'raw':_0x27ff71[_0x5360('0x20')]?_0x27ff71[_0x5360('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27ff71[_0x5360('0x20')]?_0x27ff71[_0x5360('0x20')][_0x5360('0x21')]||null:null,'attributes':_0x27ff71[_0x5360('0x20')]?_0x27ff71[_0x5360('0x20')][_0x5360('0x22')]||null:null,'limit':_0x27ff71[_0x5360('0x20')]?_0x27ff71[_0x5360('0x20')][_0x5360('0x23')]||null:null})[_0x5360('0x10')](function(_0x337fca){logger[_0x5360('0x11')]('UpdateWhatsappInteraction',_0x27ff71);logger[_0x5360('0x13')](_0x5360('0x1c'),_0x27ff71,JSON[_0x5360('0x16')](_0x337fca));_0x1f06d6(_0x337fca);})[_0x5360('0x1b')](function(_0x495980){logger['error'](_0x5360('0x1c'),_0x495980[_0x5360('0x19')],_0x27ff71);_0x5943dc(_0x74d214[_0x5360('0x17')](0x1f4,_0x495980[_0x5360('0x19')]));});});};exports[_0x5360('0x24')]=function(_0x2fc908){return new Promise(function(_0x1eb946,_0x221b65){return db[_0x5360('0x1d')]['find']({'where':_0x2fc908[_0x5360('0x20')]?_0x2fc908[_0x5360('0x20')][_0x5360('0x21')]||null:null})[_0x5360('0x10')](function(_0x3554eb){if(_0x3554eb){return _0x3554eb['addTags'](_0x2fc908[_0x5360('0x1f')][_0x5360('0x25')],_['omit'](_0x2fc908[_0x5360('0x1f')],[_0x5360('0x25'),'id'])||{});}})['spread'](function(_0x30956b){logger['info'](_0x5360('0x26'),_0x2fc908);logger['debug'](_0x5360('0x26'),_0x2fc908,JSON[_0x5360('0x16')](_0x30956b));_0x1eb946(_0x30956b);})[_0x5360('0x1b')](function(_0x51d864){logger[_0x5360('0x17')](_0x5360('0x26'),_0x51d864[_0x5360('0x19')],_0x2fc908);_0x221b65(_this['error'](0x1f4,_0x51d864[_0x5360('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index bf04d77..14d57f3 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 _0xf70f=['length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener'];(function(_0x4e4a68,_0x193c05){var _0x4e2ff3=function(_0x44b73f){while(--_0x44b73f){_0x4e4a68['push'](_0x4e4a68['shift']());}};_0x4e2ff3(++_0x193c05);}(_0xf70f,0xaa));var _0xff70=function(_0x3c989b,_0x53999a){_0x3c989b=_0x3c989b-0x0;var _0x1c68d2=_0xf70f[_0x3c989b];return _0x1c68d2;};'use strict';var WhatsappInteractionEvents=require(_0xff70('0x0'));var events=[_0xff70('0x1'),_0xff70('0x2'),_0xff70('0x3')];function createListener(_0x1e8eed,_0x17bc5f){return function(_0x49b7e0){_0x17bc5f[_0xff70('0x4')](_0x1e8eed,_0x49b7e0);};}function removeListener(_0xd2aa7d,_0x10cc40){return function(){WhatsappInteractionEvents[_0xff70('0x5')](_0xd2aa7d,_0x10cc40);};}exports['register']=function(_0x5e2115){for(var _0x2c87a6=0x0,_0x30e1aa=events[_0xff70('0x6')];_0x2c87a6<_0x30e1aa;_0x2c87a6++){var _0xa07c6c=events[_0x2c87a6];var _0x48e3cb=createListener(_0xff70('0x7')+_0xa07c6c,_0x5e2115);WhatsappInteractionEvents['on'](_0xa07c6c,_0x48e3cb);}}; \ No newline at end of file +var _0x497f=['remove','update','emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x1aa46d,_0x27c35a){var _0x5cb299=function(_0x4ba19f){while(--_0x4ba19f){_0x1aa46d['push'](_0x1aa46d['shift']());}};_0x5cb299(++_0x27c35a);}(_0x497f,0x1f0));var _0xf497=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0x497f[_0x4d674b];return _0x535a1f;};'use strict';var WhatsappInteractionEvents=require(_0xf497('0x0'));var events=['save',_0xf497('0x1'),_0xf497('0x2')];function createListener(_0x5c83e5,_0x4cc07a){return function(_0x39bfbc){_0x4cc07a[_0xf497('0x3')](_0x5c83e5,_0x39bfbc);};}function removeListener(_0x448986,_0x3b3067){return function(){WhatsappInteractionEvents[_0xf497('0x4')](_0x448986,_0x3b3067);};}exports['register']=function(_0x448457){for(var _0x201f4e=0x0,_0x46e248=events[_0xf497('0x5')];_0x201f4e<_0x46e248;_0x201f4e++){var _0x50a7af=events[_0x201f4e];var _0x41aeb6=createListener(_0xf497('0x6')+_0x50a7af,_0x448457);WhatsappInteractionEvents['on'](_0x50a7af,_0x41aeb6);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 301b41a..3fa6733 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 _0xd1ab=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','whatsapp','/:id/status','status','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path'];(function(_0x4b4777,_0x1d952e){var _0x2b9427=function(_0x408dbb){while(--_0x408dbb){_0x4b4777['push'](_0x4b4777['shift']());}};_0x2b9427(++_0x1d952e);}(_0xd1ab,0x71));var _0xbd1a=function(_0x4ac99f,_0x3a20d3){_0x4ac99f=_0x4ac99f-0x0;var _0x271bda=_0xd1ab[_0x4ac99f];return _0x271bda;};'use strict';var multer=require(_0xbd1a('0x0'));var util=require(_0xbd1a('0x1'));var path=require(_0xbd1a('0x2'));var timeout=require(_0xbd1a('0x3'));var express=require(_0xbd1a('0x4'));var router=express[_0xbd1a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbd1a('0x6'));var interaction=require(_0xbd1a('0x7'));var config=require(_0xbd1a('0x8'));var controller=require(_0xbd1a('0x9'));router[_0xbd1a('0xa')]('/',auth[_0xbd1a('0xb')](),controller[_0xbd1a('0xc')]);router[_0xbd1a('0xa')](_0xbd1a('0xd'),auth[_0xbd1a('0xb')](),controller[_0xbd1a('0xe')]);router[_0xbd1a('0xa')]('/:id',auth[_0xbd1a('0xb')](),controller[_0xbd1a('0xf')]);router[_0xbd1a('0x10')]('/',auth[_0xbd1a('0xb')](),interaction['tracked'](_0xbd1a('0x11'),'whatsappmessage:create'),controller['create']);router[_0xbd1a('0x10')](_0xbd1a('0x12'),controller[_0xbd1a('0x13')]);router[_0xbd1a('0x14')](_0xbd1a('0x15'),auth['isAuthenticated'](),controller['update']);router[_0xbd1a('0x14')](_0xbd1a('0x16'),auth[_0xbd1a('0xb')](),controller[_0xbd1a('0x17')]);router[_0xbd1a('0x14')](_0xbd1a('0x18'),auth[_0xbd1a('0xb')](),controller[_0xbd1a('0x19')]);router[_0xbd1a('0x1a')](_0xbd1a('0x15'),auth[_0xbd1a('0xb')](),controller[_0xbd1a('0x1b')]);module[_0xbd1a('0x1c')]=router; \ No newline at end of file +var _0xb026=['put','update','/:id/accept','/:id/reject','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','tracked','whatsapp','whatsappmessage:create','create','post','status'];(function(_0xf66c15,_0xf099e5){var _0x506314=function(_0xea3841){while(--_0xea3841){_0xf66c15['push'](_0xf66c15['shift']());}};_0x506314(++_0xf099e5);}(_0xb026,0x118));var _0x6b02=function(_0x3ed4d7,_0x3783e0){_0x3ed4d7=_0x3ed4d7-0x0;var _0x2be1a4=_0xb026[_0x3ed4d7];return _0x2be1a4;};'use strict';var multer=require('multer');var util=require(_0x6b02('0x0'));var path=require(_0x6b02('0x1'));var timeout=require(_0x6b02('0x2'));var express=require(_0x6b02('0x3'));var router=express[_0x6b02('0x4')]();var fs_extra=require(_0x6b02('0x5'));var auth=require(_0x6b02('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6b02('0x7'));var controller=require('./whatsappMessage.controller');router[_0x6b02('0x8')]('/',auth[_0x6b02('0x9')](),controller[_0x6b02('0xa')]);router[_0x6b02('0x8')](_0x6b02('0xb'),auth[_0x6b02('0x9')](),controller[_0x6b02('0xc')]);router[_0x6b02('0x8')](_0x6b02('0xd'),auth[_0x6b02('0x9')](),controller['show']);router['post']('/',auth[_0x6b02('0x9')](),interaction[_0x6b02('0xe')](_0x6b02('0xf'),_0x6b02('0x10')),controller[_0x6b02('0x11')]);router[_0x6b02('0x12')]('/:id/status',controller[_0x6b02('0x13')]);router[_0x6b02('0x14')]('/:id',auth[_0x6b02('0x9')](),controller[_0x6b02('0x15')]);router['put'](_0x6b02('0x16'),auth['isAuthenticated'](),controller['accept']);router[_0x6b02('0x14')](_0x6b02('0x17'),auth[_0x6b02('0x9')](),controller['reject']);router['delete'](_0x6b02('0xd'),auth['isAuthenticated'](),controller[_0x6b02('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 58776de..6904dd6 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 _0x64c4=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3d85ac,_0x382718){var _0x365e04=function(_0x4e8d27){while(--_0x4e8d27){_0x3d85ac['push'](_0x3d85ac['shift']());}};_0x365e04(++_0x382718);}(_0x64c4,0x11b));var _0x464c=function(_0x42ec59,_0x14c6e9){_0x42ec59=_0x42ec59-0x0;var _0x348275=_0x64c4[_0x42ec59];return _0x348275;};'use strict';var Sequelize=require(_0x464c('0x0'));module[_0x464c('0x1')]={'body':{'type':Sequelize[_0x464c('0x2')](_0x464c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x464c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x464c('0x5')]('in',_0x464c('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x464c('0x7')](0xbe)},'phone':{'type':Sequelize[_0x464c('0x7')]},'readAt':{'type':Sequelize[_0x464c('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x464c('0x2')]}}; \ No newline at end of file +var _0x7250=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0x7250,0x1b1));var _0x0725=function(_0x1de9e0,_0x2944b1){_0x1de9e0=_0x1de9e0-0x0;var _0x49474a=_0x7250[_0x1de9e0];return _0x49474a;};'use strict';var Sequelize=require(_0x0725('0x0'));module[_0x0725('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0725('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0725('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0725('0x4')]('in',_0x0725('0x5')),'defaultValue':_0x0725('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0725('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x0725('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x0725('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index abfa98d..71b1965 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 _0x8407=['WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','MessageStatus','twilio','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','name','map','WhatsappMessage','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','merge','includeAll','findAll','rows','show','keys','rawAttributes','fields','create','body','find','destroy','params','describe','whatsapp-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','WhatsappInteractionId','isNil','interaction','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','user','channel','event','EventManager','acceptmessage','whatsapp','WhatsappInteraction','ContactId','Sequelize','internal','motionChannel','rejectmessage'];(function(_0x14a120,_0x342cc3){var _0x198999=function(_0x1a4cf0){while(--_0x1a4cf0){_0x14a120['push'](_0x14a120['shift']());}};_0x198999(++_0x342cc3);}(_0x8407,0x10d));var _0x7840=function(_0x1ee990,_0x3d42c2){_0x1ee990=_0x1ee990-0x0;var _0x5adb49=_0x8407[_0x1ee990];return _0x5adb49;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7840('0x0'));var jsonpatch=require(_0x7840('0x1'));var rp=require(_0x7840('0x2'));var moment=require(_0x7840('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7840('0x4'));var path=require(_0x7840('0x5'));var sox=require(_0x7840('0x6'));var csv=require('to-csv');var ejs=require(_0x7840('0x7'));var fs=require('fs');var fs_extra=require(_0x7840('0x8'));var _=require(_0x7840('0x9'));var squel=require(_0x7840('0xa'));var crypto=require(_0x7840('0xb'));var jsforce=require(_0x7840('0xc'));var deskjs=require(_0x7840('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7840('0xe'));var Papa=require(_0x7840('0xf'));var Redis=require(_0x7840('0x10'));var authService=require(_0x7840('0x11'));var qs=require(_0x7840('0x12'));var as=require(_0x7840('0x13'));var hardwareService=require(_0x7840('0x14'));var logger=require(_0x7840('0x15'))(_0x7840('0x16'));var utils=require('../../config/utils');var config=require(_0x7840('0x17'));var licenseUtil=require(_0x7840('0x18'));var db=require(_0x7840('0x19'))['db'];config['redis']=_[_0x7840('0x1a')](config[_0x7840('0x1b')],{'host':_0x7840('0x1c'),'port':0x18eb});var socket=require(_0x7840('0x1d'))(new Redis(config[_0x7840('0x1b')]));require('./whatsappMessage.socket')[_0x7840('0x1e')](socket);var jayson=require(_0x7840('0x1f'));var client=jayson[_0x7840('0x20')][_0x7840('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x7840('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x132a79,_0x1892ef,_0x3a127c,_0x5ece03){return new BPromise(function(_0x135dc6,_0x5984a6){var _0x428351=_0x5ece03||client;return _0x428351[_0x7840('0x22')](_0x132a79,_0x3a127c)[_0x7840('0x23')](function(_0x19dbbe){logger[_0x7840('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x1892ef,'request\x20sent');logger[_0x7840('0x25')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1892ef,_0x7840('0x26'),JSON[_0x7840('0x27')](_0x19dbbe));if(_0x19dbbe[_0x7840('0x28')]){if(_0x19dbbe['error'][_0x7840('0x29')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1892ef,_0x19dbbe[_0x7840('0x28')][_0x7840('0x2a')]);return _0x5984a6(_0x19dbbe[_0x7840('0x28')][_0x7840('0x2a')]);}logger[_0x7840('0x28')](_0x7840('0x2b'),_0x1892ef,_0x19dbbe['error'][_0x7840('0x2a')]);return _0x135dc6(_0x19dbbe[_0x7840('0x28')]['message']);}else{logger[_0x7840('0x24')](_0x7840('0x2b'),_0x1892ef,_0x7840('0x26'));_0x135dc6(_0x19dbbe[_0x7840('0x2c')][_0x7840('0x2a')]);}})[_0x7840('0x2d')](function(_0x27870b){logger[_0x7840('0x28')](_0x7840('0x2b'),_0x1892ef,_0x27870b);_0x5984a6(_0x27870b);});});}function respondWithStatusCode(_0x24e16c,_0x1a1e2e){_0x1a1e2e=_0x1a1e2e||0xcc;return function(_0x262744){if(_0x262744){return _0x24e16c[_0x7840('0x2e')](_0x1a1e2e);}return _0x24e16c[_0x7840('0x2f')](_0x1a1e2e)[_0x7840('0x30')]();};}function respondWithResult(_0x360079,_0x412f15){_0x412f15=_0x412f15||0xc8;return function(_0x1b82c9){if(_0x1b82c9){return _0x360079[_0x7840('0x2f')](_0x412f15)[_0x7840('0x31')](_0x1b82c9);}};}function respondWithFilteredResult(_0x373b24,_0x3f76f7){return function(_0x474d2d){if(_0x474d2d){var _0x261504=typeof _0x3f76f7[_0x7840('0x32')]===_0x7840('0x33')&&typeof _0x3f76f7['limit']===_0x7840('0x33');var _0x2b3a21=_0x474d2d['count'];var _0x547420=_0x261504?0x0:_0x3f76f7[_0x7840('0x32')];var _0x3cc536=_0x261504?_0x474d2d[_0x7840('0x34')]:_0x3f76f7[_0x7840('0x32')]+_0x3f76f7['limit'];var _0x21ded3;if(_0x3cc536>=_0x2b3a21){_0x3cc536=_0x2b3a21;_0x21ded3=0xc8;}else{_0x21ded3=0xce;}_0x373b24['status'](_0x21ded3);return _0x373b24['set'](_0x7840('0x35'),_0x547420+'-'+_0x3cc536+'/'+_0x2b3a21)[_0x7840('0x31')](_0x474d2d);}return null;};}function patchUpdates(_0x33a826){return function(_0x116ed9){try{jsonpatch[_0x7840('0x36')](_0x116ed9,_0x33a826,!![]);}catch(_0x55cc5a){return BPromise[_0x7840('0x37')](_0x55cc5a);}return _0x116ed9[_0x7840('0x38')]();};}function saveUpdates(_0xd363b4,_0x4f132d){return function(_0x44f834){if(_0x44f834){return _0x44f834[_0x7840('0x39')](_0xd363b4)[_0x7840('0x23')](function(_0x5786ce){return _0x5786ce;});}return null;};}function removeEntity(_0x18515a,_0x3d2f44){return function(_0x546c40){if(_0x546c40){return _0x546c40['destroy']()['then'](function(){_0x18515a['status'](0xcc)[_0x7840('0x30')]();});}};}function handleEntityNotFound(_0x18c3d9,_0x387b26){return function(_0xbbf11c){if(!_0xbbf11c){_0x18c3d9[_0x7840('0x2e')](0x194);}return _0xbbf11c;};}function handleError(_0x39c7e0,_0x351f90){_0x351f90=_0x351f90||0x1f4;return function(_0xfac70f){logger[_0x7840('0x28')](_0xfac70f['stack']);if(_0xfac70f[_0x7840('0x3a')]){delete _0xfac70f[_0x7840('0x3a')];}_0x39c7e0[_0x7840('0x2f')](_0x351f90)['send'](_0xfac70f);};}exports['index']=function(_0x3d225d,_0x24d71d){var _0xc8f3f2={},_0x571924={},_0x18b7bd={'count':0x0,'rows':[]};var _0x1d437a=_[_0x7840('0x3b')](db[_0x7840('0x3c')]['rawAttributes'],function(_0x5df1ea){return{'name':_0x5df1ea[_0x7840('0x3d')],'type':_0x5df1ea[_0x7840('0x3e')]['key']};});_0x571924[_0x7840('0x3f')]=_[_0x7840('0x3b')](_0x1d437a,_0x7840('0x3a'));_0x571924[_0x7840('0x40')]=_['keys'](_0x3d225d[_0x7840('0x40')]);_0x571924[_0x7840('0x41')]=_[_0x7840('0x42')](_0x571924['model'],_0x571924[_0x7840('0x40')]);_0xc8f3f2[_0x7840('0x43')]=_['intersection'](_0x571924[_0x7840('0x3f')],qs['fields'](_0x3d225d[_0x7840('0x40')]['fields']));_0xc8f3f2['attributes']=_0xc8f3f2[_0x7840('0x43')][_0x7840('0x44')]?_0xc8f3f2['attributes']:_0x571924[_0x7840('0x3f')];if(!_0x3d225d[_0x7840('0x40')][_0x7840('0x45')](_0x7840('0x46'))){_0xc8f3f2[_0x7840('0x47')]=qs[_0x7840('0x47')](_0x3d225d[_0x7840('0x40')][_0x7840('0x47')]);_0xc8f3f2[_0x7840('0x32')]=qs[_0x7840('0x32')](_0x3d225d[_0x7840('0x40')][_0x7840('0x32')]);}_0xc8f3f2[_0x7840('0x48')]=qs[_0x7840('0x49')](_0x3d225d[_0x7840('0x40')][_0x7840('0x49')]);_0xc8f3f2[_0x7840('0x4a')]=qs[_0x7840('0x41')](_[_0x7840('0x4b')](_0x3d225d[_0x7840('0x40')],_0x571924[_0x7840('0x41')]),_0x1d437a);if(_0x3d225d[_0x7840('0x40')]['filter']){_0xc8f3f2[_0x7840('0x4a')]=_['merge'](_0xc8f3f2[_0x7840('0x4a')],{'$or':_[_0x7840('0x3b')](_0x1d437a,function(_0x12fdd5){if(_0x12fdd5[_0x7840('0x3e')]!==_0x7840('0x4c')){var _0x53c6b7={};_0x53c6b7[_0x12fdd5[_0x7840('0x3a')]]={'$like':'%'+_0x3d225d['query']['filter']+'%'};return _0x53c6b7;}})});}_0xc8f3f2=_[_0x7840('0x4d')]({},_0xc8f3f2,_0x3d225d['options']);var _0x26c012={'where':_0xc8f3f2[_0x7840('0x4a')]};return db[_0x7840('0x3c')]['count'](_0x26c012)[_0x7840('0x23')](function(_0x169e7e){_0x18b7bd['count']=_0x169e7e;if(_0x3d225d['query'][_0x7840('0x4e')]){_0xc8f3f2['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x7840('0x4f')](_0xc8f3f2);})['then'](function(_0x33a95){_0x18b7bd[_0x7840('0x50')]=_0x33a95;return _0x18b7bd;})['then'](respondWithFilteredResult(_0x24d71d,_0xc8f3f2))[_0x7840('0x2d')](handleError(_0x24d71d,null));};exports[_0x7840('0x51')]=function(_0x571aa1,_0x232090){var _0x5eac0f={'raw':!![],'where':{'id':_0x571aa1['params']['id']}},_0x426c04={};_0x426c04[_0x7840('0x3f')]=_[_0x7840('0x52')](db[_0x7840('0x3c')][_0x7840('0x53')]);_0x426c04[_0x7840('0x40')]=_['keys'](_0x571aa1['query']);_0x426c04[_0x7840('0x41')]=_[_0x7840('0x42')](_0x426c04[_0x7840('0x3f')],_0x426c04[_0x7840('0x40')]);_0x5eac0f['attributes']=_[_0x7840('0x42')](_0x426c04[_0x7840('0x3f')],qs[_0x7840('0x54')](_0x571aa1[_0x7840('0x40')][_0x7840('0x54')]));_0x5eac0f[_0x7840('0x43')]=_0x5eac0f['attributes'][_0x7840('0x44')]?_0x5eac0f[_0x7840('0x43')]:_0x426c04[_0x7840('0x3f')];if(_0x571aa1[_0x7840('0x40')]['includeAll']){_0x5eac0f['include']=[{'all':!![]}];}_0x5eac0f=_['merge']({},_0x5eac0f,_0x571aa1['options']);return db[_0x7840('0x3c')]['find'](_0x5eac0f)['then'](handleEntityNotFound(_0x232090,null))[_0x7840('0x23')](respondWithResult(_0x232090,null))[_0x7840('0x2d')](handleError(_0x232090,null));};exports[_0x7840('0x55')]=function(_0xc23627,_0x3b3051){return db[_0x7840('0x3c')][_0x7840('0x55')](_0xc23627['body'],{})[_0x7840('0x23')](respondWithResult(_0x3b3051,0xc9))[_0x7840('0x2d')](handleError(_0x3b3051,null));};exports['update']=function(_0x3562e4,_0x51df87){if(_0x3562e4[_0x7840('0x56')]['id']){delete _0x3562e4[_0x7840('0x56')]['id'];}return db[_0x7840('0x3c')][_0x7840('0x57')]({'where':{'id':_0x3562e4['params']['id']}})[_0x7840('0x23')](handleEntityNotFound(_0x51df87,null))[_0x7840('0x23')](saveUpdates(_0x3562e4[_0x7840('0x56')],null))[_0x7840('0x23')](respondWithResult(_0x51df87,null))[_0x7840('0x2d')](handleError(_0x51df87,null));};exports[_0x7840('0x58')]=function(_0x6eb77f,_0x460269){return db[_0x7840('0x3c')][_0x7840('0x57')]({'where':{'id':_0x6eb77f[_0x7840('0x59')]['id']}})[_0x7840('0x23')](handleEntityNotFound(_0x460269,null))[_0x7840('0x23')](removeEntity(_0x460269,null))[_0x7840('0x2d')](handleError(_0x460269,null));};exports[_0x7840('0x5a')]=function(_0x2ff0a7,_0x84a981){return db['WhatsappMessage']['describe']()[_0x7840('0x23')](respondWithResult(_0x84a981,null))[_0x7840('0x2d')](handleError(_0x84a981,null));};var interaction_log=require(_0x7840('0x15'))(_0x7840('0x5b'));exports[_0x7840('0x5c')]=function(_0x453bd5,_0x4aad03,_0x2fa497){var _0x5396d8={'agent':{},'channel':'whatsapp'};if(_0x453bd5[_0x7840('0x56')]['id']){delete _0x453bd5[_0x7840('0x56')]['id'];}_0x453bd5['body'][_0x7840('0x5d')]=!![];_0x453bd5['body'][_0x7840('0x5e')]=moment()[_0x7840('0x5f')](_0x7840('0x60'));_0x453bd5[_0x7840('0x56')][_0x7840('0x61')]=_0x453bd5['body']['UserId']||_0x453bd5['user']['id'];_0x5396d8['agent']['id']=_0x453bd5[_0x7840('0x56')][_0x7840('0x61')];return db['WhatsappMessage']['find']({'where':{'id':_0x453bd5[_0x7840('0x59')]['id'],'UserId':null}})[_0x7840('0x23')](handleEntityNotFound(_0x4aad03,null))[_0x7840('0x23')](saveUpdates(_0x453bd5['body'],null))['then'](function(_0xaff311){if(_0xaff311){_0x5396d8[_0x7840('0x2a')]=_0xaff311[_0x7840('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0x7840('0x57')]({'where':{'id':_0xaff311[_0x7840('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x4aad03,null))[_0x7840('0x23')](function(_0x503db1){if(_0x503db1){return _0x503db1[_0x7840('0x39')]({'UserId':_0x453bd5[_0x7840('0x56')][_0x7840('0x61')],'read1stAt':_[_0x7840('0x64')](_0x503db1['read1stAt'])?moment()[_0x7840('0x5f')](_0x7840('0x60')):undefined});}return null;})[_0x7840('0x23')](function(_0x182dc1){if(_0x182dc1){_0x5396d8[_0x7840('0x65')]=_0x182dc1['get']({'plain':!![]});interaction_log[_0x7840('0x24')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x453bd5['user']['id'],_0x453bd5['user'][_0x7840('0x3a')],_0x453bd5['user'][_0x7840('0x66')],_0x5396d8[_0x7840('0x65')]['id'],_0x453bd5[_0x7840('0x56')]?JSON[_0x7840('0x27')](_0x453bd5[_0x7840('0x56')]):_0x7840('0x67'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5396d8);}return null;})[_0x7840('0x23')](function(_0x16e8e1){var _0x4c7137=_0x7840('0x68')+_0x16e8e1[_0x7840('0x2a')]['ContactId'];return db['sequelize'][_0x7840('0x40')](_0x4c7137,{'type':db['Sequelize'][_0x7840('0x69')][_0x7840('0x6a')],'raw':!![]})[_0x7840('0x23')](function(_0x5bfeeb){return _0x5bfeeb;});})[_0x7840('0x23')](function(_0x49b346){if(_0x49b346){_0x5396d8['message'][_0x7840('0x6b')]=_0x49b346[0x0];if(!_0x453bd5[_0x7840('0x56')][_0x7840('0x61')])return;return db[_0x7840('0x6c')][_0x7840('0x57')]({'where':{'id':_0x453bd5[_0x7840('0x56')][_0x7840('0x61')],'role':_0x7840('0x6d')},'attributes':['id',_0x7840('0x3a'),_0x7840('0x6e'),_0x7840('0x6f'),'internal'],'raw':!![]});}return null;})[_0x7840('0x23')](function(_0x481c5f){if(!_0x481c5f)return null;_0x5396d8[_0x7840('0x2a')]['agent']=_0x481c5f;return _0x5396d8;})['then'](function(_0x1abb17){if(_0x1abb17){if(_0x453bd5[_0x7840('0x56')][_0x7840('0x70')]){_0x5396d8[_0x7840('0x2a')][_0x7840('0x71')]=util['format'](_0x7840('0x72'),_0x453bd5[_0x7840('0x73')]['name']);_0x5396d8[_0x7840('0x2a')][_0x7840('0x74')]=_0x5396d8[_0x7840('0x74')];_0x5396d8[_0x7840('0x2a')]['motionChannel']=_0x5396d8[_0x7840('0x74')];_0x5396d8[_0x7840('0x2a')][_0x7840('0x75')]='accept';return respondWithRpcPromise(_0x7840('0x76'),'EventManager',{'event':_0x7840('0x77'),'message':_0x5396d8[_0x7840('0x2a')]},client9002)[_0x7840('0x23')](function(){return _0x5396d8;});}return _0x5396d8;}return null;})[_0x7840('0x23')](respondWithResult(_0x4aad03,null))[_0x7840('0x2d')](handleError(_0x4aad03,null));};var interaction_log=require(_0x7840('0x15'))(_0x7840('0x5b'));exports[_0x7840('0x37')]=function(_0x422194,_0x3a1af8,_0x339a6a){var _0x4cd963={'agent':{},'channel':_0x7840('0x78')};if(_0x422194['body']['id']){delete _0x422194[_0x7840('0x56')]['id'];}_0x422194[_0x7840('0x56')][_0x7840('0x61')]=_0x422194['body'][_0x7840('0x61')]||_0x422194['user']['id'];_0x4cd963[_0x7840('0x6d')]['id']=_0x422194[_0x7840('0x56')][_0x7840('0x61')];return db[_0x7840('0x3c')][_0x7840('0x57')]({'where':{'id':_0x422194[_0x7840('0x59')]['id'],'UserId':null}})[_0x7840('0x23')](handleEntityNotFound(_0x3a1af8,null))[_0x7840('0x23')](function(_0x329b70){if(_0x329b70){_0x4cd963[_0x7840('0x2a')]=_0x329b70[_0x7840('0x62')]({'plain':!![]});return db[_0x7840('0x79')]['find']({'where':{'id':_0x329b70[_0x7840('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x3a1af8,null))[_0x7840('0x23')](function(_0x1b8b99){if(_0x1b8b99){_0x4cd963[_0x7840('0x65')]=_0x1b8b99[_0x7840('0x62')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x422194[_0x7840('0x73')]['id'],_0x422194[_0x7840('0x73')]['name'],_0x422194[_0x7840('0x73')][_0x7840('0x66')],_0x4cd963[_0x7840('0x65')]['id'],_0x422194[_0x7840('0x56')]?JSON['stringify'](_0x422194[_0x7840('0x56')]):_0x7840('0x67'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x4cd963);}return null;})[_0x7840('0x23')](function(_0x20835f){var _0xea4742='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20835f[_0x7840('0x2a')][_0x7840('0x7a')];return db['sequelize'][_0x7840('0x40')](_0xea4742,{'type':db[_0x7840('0x7b')][_0x7840('0x69')]['SELECT'],'raw':!![]})[_0x7840('0x23')](function(_0x583100){return _0x583100;});})[_0x7840('0x23')](function(_0x3fb6a6){if(_0x3fb6a6){_0x4cd963['message']['contact']=_0x3fb6a6[0x0];if(!_0x422194[_0x7840('0x56')][_0x7840('0x61')])return;return db[_0x7840('0x6c')][_0x7840('0x57')]({'where':{'id':_0x422194[_0x7840('0x56')][_0x7840('0x61')],'role':_0x7840('0x6d')},'attributes':['id',_0x7840('0x3a'),_0x7840('0x6e'),_0x7840('0x6f'),_0x7840('0x7c')],'raw':!![]});}return null;})[_0x7840('0x23')](function(_0xd98b05){if(!_0xd98b05)return null;_0x4cd963[_0x7840('0x2a')][_0x7840('0x6d')]=_0xd98b05;return _0x4cd963;})[_0x7840('0x23')](function(_0x1a31bc){if(_0x1a31bc){_0x1a31bc['message'][_0x7840('0x71')]=util[_0x7840('0x5f')](_0x7840('0x72'),_0x422194[_0x7840('0x73')][_0x7840('0x3a')]);_0x1a31bc['message'][_0x7840('0x74')]=_0x4cd963[_0x7840('0x74')];_0x1a31bc[_0x7840('0x2a')][_0x7840('0x7d')]=_0x4cd963[_0x7840('0x74')];_0x1a31bc[_0x7840('0x2a')][_0x7840('0x75')]=_0x7840('0x37');respondWithRpcPromise(_0x7840('0x76'),'EventManager',{'event':_0x7840('0x7e'),'message':_0x1a31bc['message']},client9002);return _0x4cd963;}return null;})[_0x7840('0x23')](respondWithResult(_0x3a1af8,null))['catch'](handleError(_0x3a1af8,null));};exports['status']=function(_0x459d91,_0x8bef4f,_0x59fbdb){if(_0x459d91[_0x7840('0x56')]['id']){delete _0x459d91[_0x7840('0x56')]['id'];}var _0x3c0082;return db['WhatsappMessage'][_0x7840('0x57')]({'where':{'id':_0x459d91['params']['id']}})[_0x7840('0x23')](handleEntityNotFound(_0x8bef4f,null))[_0x7840('0x23')](function(_0x467b39){if(_0x467b39){_0x3c0082=_0x467b39;return db['WhatsappAccount']['find']({'where':{'id':_0x467b39[_0x7840('0x7f')]}});}})[_0x7840('0x23')](handleEntityNotFound(_0x8bef4f,null))[_0x7840('0x23')](function(_0x255356){if(_0x255356){logger[_0x7840('0x25')](_0x7840('0x80'),'status','received\x20delivery\x20report\x20from',_0x255356[_0x7840('0x3e')],util[_0x7840('0x81')](_0x459d91['body'],{'showHidden':![],'depth':null}));switch(_0x255356[_0x7840('0x3e')]){case'twilio':if(_0x459d91[_0x7840('0x56')]['MessageSid']&&_0x459d91['body']['MessageSid']===_0x3c0082['messageId']&&_0x459d91['body']['MessageStatus']&&_0x459d91[_0x7840('0x56')][_0x7840('0x82')]==='read'){return _0x3c0082[_0x7840('0x39')]({'read':!![]});}else{logger[_0x7840('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x7840('0x2f'),_0x7840('0x83'),util[_0x7840('0x81')](_0x459d91[_0x7840('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x3c0082;}})[_0x7840('0x23')](respondWithResult(_0x8bef4f,null))[_0x7840('0x2d')](handleError(_0x8bef4f,null));}; \ No newline at end of file +var _0x3d03=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','then','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','keys','length','find','create','update','body','params','describe','accept','whatsapp','read','readAt','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','sequelize','Sequelize','EventManager','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x3d03,0x18b));var _0x33d0=function(_0x139485,_0x2d0aac){_0x139485=_0x139485-0x0;var _0x221cb9=_0x3d03[_0x139485];return _0x221cb9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x33d0('0x0'));var rp=require(_0x33d0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x33d0('0x2'));var util=require(_0x33d0('0x3'));var path=require('path');var sox=require(_0x33d0('0x4'));var csv=require(_0x33d0('0x5'));var ejs=require(_0x33d0('0x6'));var fs=require('fs');var fs_extra=require(_0x33d0('0x7'));var _=require(_0x33d0('0x8'));var squel=require(_0x33d0('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x33d0('0xa'));var toCsv=require(_0x33d0('0x5'));var querystring=require(_0x33d0('0xb'));var Papa=require('papaparse');var Redis=require(_0x33d0('0xc'));var authService=require(_0x33d0('0xd'));var qs=require(_0x33d0('0xe'));var as=require(_0x33d0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33d0('0x10'))(_0x33d0('0x11'));var utils=require(_0x33d0('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x33d0('0x13'));var db=require('../../mysqldb')['db'];config[_0x33d0('0x14')]=_[_0x33d0('0x15')](config[_0x33d0('0x14')],{'host':_0x33d0('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33d0('0x14')]));require('./whatsappMessage.socket')[_0x33d0('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0x33d0('0x18')][_0x33d0('0x19')]({'port':0x232c});var client9002=jayson[_0x33d0('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x234dfa,_0x449fa3,_0xfd80dc,_0x3d0d6d){return new BPromise(function(_0x4230c5,_0x187c52){var _0x310c4d=_0x3d0d6d||client;return _0x310c4d[_0x33d0('0x1a')](_0x234dfa,_0xfd80dc)['then'](function(_0x1bdf02){logger[_0x33d0('0x1b')](_0x33d0('0x1c'),_0x449fa3,_0x33d0('0x1d'));logger['debug'](_0x33d0('0x1e'),_0x449fa3,_0x33d0('0x1d'),JSON[_0x33d0('0x1f')](_0x1bdf02));if(_0x1bdf02[_0x33d0('0x20')]){if(_0x1bdf02[_0x33d0('0x20')]['code']===0x1f4){logger[_0x33d0('0x20')](_0x33d0('0x1c'),_0x449fa3,_0x1bdf02[_0x33d0('0x20')][_0x33d0('0x21')]);return _0x187c52(_0x1bdf02[_0x33d0('0x20')][_0x33d0('0x21')]);}logger[_0x33d0('0x20')](_0x33d0('0x1c'),_0x449fa3,_0x1bdf02[_0x33d0('0x20')][_0x33d0('0x21')]);return _0x4230c5(_0x1bdf02[_0x33d0('0x20')][_0x33d0('0x21')]);}else{logger['info'](_0x33d0('0x1c'),_0x449fa3,_0x33d0('0x1d'));_0x4230c5(_0x1bdf02[_0x33d0('0x22')][_0x33d0('0x21')]);}})[_0x33d0('0x23')](function(_0x7139b4){logger[_0x33d0('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x449fa3,_0x7139b4);_0x187c52(_0x7139b4);});});}function respondWithStatusCode(_0x402b1c,_0x506295){_0x506295=_0x506295||0xcc;return function(_0x24a967){if(_0x24a967){return _0x402b1c[_0x33d0('0x24')](_0x506295);}return _0x402b1c[_0x33d0('0x25')](_0x506295)[_0x33d0('0x26')]();};}function respondWithResult(_0x10e11c,_0x130f36){_0x130f36=_0x130f36||0xc8;return function(_0x19cb7b){if(_0x19cb7b){return _0x10e11c[_0x33d0('0x25')](_0x130f36)[_0x33d0('0x27')](_0x19cb7b);}};}function respondWithFilteredResult(_0x3e16d7,_0x592c63){return function(_0x5301aa){if(_0x5301aa){var _0xf35590=typeof _0x592c63['offset']===_0x33d0('0x28')&&typeof _0x592c63[_0x33d0('0x29')]===_0x33d0('0x28');var _0x4c7d81=_0x5301aa['count'];var _0x38ee53=_0xf35590?0x0:_0x592c63['offset'];var _0x636cef=_0xf35590?_0x5301aa[_0x33d0('0x2a')]:_0x592c63[_0x33d0('0x2b')]+_0x592c63[_0x33d0('0x29')];var _0x82ea26;if(_0x636cef>=_0x4c7d81){_0x636cef=_0x4c7d81;_0x82ea26=0xc8;}else{_0x82ea26=0xce;}_0x3e16d7[_0x33d0('0x25')](_0x82ea26);return _0x3e16d7[_0x33d0('0x2c')](_0x33d0('0x2d'),_0x38ee53+'-'+_0x636cef+'/'+_0x4c7d81)[_0x33d0('0x27')](_0x5301aa);}return null;};}function patchUpdates(_0x35be3c){return function(_0x2c2ba5){try{jsonpatch[_0x33d0('0x2e')](_0x2c2ba5,_0x35be3c,!![]);}catch(_0xe152d9){return BPromise[_0x33d0('0x2f')](_0xe152d9);}return _0x2c2ba5['save']();};}function saveUpdates(_0x35d6d3,_0x1b37a6){return function(_0x2275e7){if(_0x2275e7){return _0x2275e7['update'](_0x35d6d3)['then'](function(_0x2c6f72){return _0x2c6f72;});}return null;};}function removeEntity(_0x104ed1,_0x496777){return function(_0x2208f6){if(_0x2208f6){return _0x2208f6[_0x33d0('0x30')]()[_0x33d0('0x31')](function(){_0x104ed1[_0x33d0('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58d861,_0x42e558){return function(_0x297c9){if(!_0x297c9){_0x58d861[_0x33d0('0x24')](0x194);}return _0x297c9;};}function handleError(_0x1ce324,_0x58fe19){_0x58fe19=_0x58fe19||0x1f4;return function(_0xb00743){logger[_0x33d0('0x20')](_0xb00743[_0x33d0('0x32')]);if(_0xb00743['name']){delete _0xb00743[_0x33d0('0x33')];}_0x1ce324[_0x33d0('0x25')](_0x58fe19)[_0x33d0('0x34')](_0xb00743);};}exports[_0x33d0('0x35')]=function(_0xd6ade0,_0x551598){var _0x181fbb={},_0x5bd65d={},_0xf9e9b3={'count':0x0,'rows':[]};var _0x562763=_[_0x33d0('0x36')](db[_0x33d0('0x37')][_0x33d0('0x38')],function(_0xac674a){return{'name':_0xac674a[_0x33d0('0x39')],'type':_0xac674a[_0x33d0('0x3a')]['key']};});_0x5bd65d['model']=_['map'](_0x562763,'name');_0x5bd65d[_0x33d0('0x3b')]=_['keys'](_0xd6ade0[_0x33d0('0x3b')]);_0x5bd65d['filters']=_[_0x33d0('0x3c')](_0x5bd65d[_0x33d0('0x3d')],_0x5bd65d[_0x33d0('0x3b')]);_0x181fbb[_0x33d0('0x3e')]=_[_0x33d0('0x3c')](_0x5bd65d[_0x33d0('0x3d')],qs[_0x33d0('0x3f')](_0xd6ade0[_0x33d0('0x3b')][_0x33d0('0x3f')]));_0x181fbb['attributes']=_0x181fbb['attributes']['length']?_0x181fbb['attributes']:_0x5bd65d[_0x33d0('0x3d')];if(!_0xd6ade0['query']['hasOwnProperty']('nolimit')){_0x181fbb[_0x33d0('0x29')]=qs[_0x33d0('0x29')](_0xd6ade0['query']['limit']);_0x181fbb[_0x33d0('0x2b')]=qs[_0x33d0('0x2b')](_0xd6ade0['query']['offset']);}_0x181fbb[_0x33d0('0x40')]=qs[_0x33d0('0x41')](_0xd6ade0['query'][_0x33d0('0x41')]);_0x181fbb[_0x33d0('0x42')]=qs['filters'](_[_0x33d0('0x43')](_0xd6ade0['query'],_0x5bd65d[_0x33d0('0x44')]),_0x562763);if(_0xd6ade0[_0x33d0('0x3b')]['filter']){_0x181fbb[_0x33d0('0x42')]=_[_0x33d0('0x45')](_0x181fbb[_0x33d0('0x42')],{'$or':_[_0x33d0('0x36')](_0x562763,function(_0x26dbae){if(_0x26dbae['type']!==_0x33d0('0x46')){var _0x4249e2={};_0x4249e2[_0x26dbae[_0x33d0('0x33')]]={'$like':'%'+_0xd6ade0['query'][_0x33d0('0x47')]+'%'};return _0x4249e2;}})});}_0x181fbb=_[_0x33d0('0x45')]({},_0x181fbb,_0xd6ade0[_0x33d0('0x48')]);var _0x9983d={'where':_0x181fbb[_0x33d0('0x42')]};return db['WhatsappMessage'][_0x33d0('0x2a')](_0x9983d)['then'](function(_0x5a1c42){_0xf9e9b3[_0x33d0('0x2a')]=_0x5a1c42;if(_0xd6ade0[_0x33d0('0x3b')][_0x33d0('0x49')]){_0x181fbb[_0x33d0('0x4a')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x33d0('0x4b')](_0x181fbb);})[_0x33d0('0x31')](function(_0x46ce6f){_0xf9e9b3['rows']=_0x46ce6f;return _0xf9e9b3;})[_0x33d0('0x31')](respondWithFilteredResult(_0x551598,_0x181fbb))[_0x33d0('0x23')](handleError(_0x551598,null));};exports[_0x33d0('0x4c')]=function(_0x3c013d,_0x4dc07c){var _0x8d1c95={'raw':!![],'where':{'id':_0x3c013d['params']['id']}},_0x59c126={};_0x59c126[_0x33d0('0x3d')]=_[_0x33d0('0x4d')](db['WhatsappMessage'][_0x33d0('0x38')]);_0x59c126['query']=_['keys'](_0x3c013d[_0x33d0('0x3b')]);_0x59c126['filters']=_[_0x33d0('0x3c')](_0x59c126[_0x33d0('0x3d')],_0x59c126['query']);_0x8d1c95['attributes']=_['intersection'](_0x59c126[_0x33d0('0x3d')],qs[_0x33d0('0x3f')](_0x3c013d[_0x33d0('0x3b')]['fields']));_0x8d1c95[_0x33d0('0x3e')]=_0x8d1c95[_0x33d0('0x3e')][_0x33d0('0x4e')]?_0x8d1c95[_0x33d0('0x3e')]:_0x59c126[_0x33d0('0x3d')];if(_0x3c013d[_0x33d0('0x3b')]['includeAll']){_0x8d1c95[_0x33d0('0x4a')]=[{'all':!![]}];}_0x8d1c95=_[_0x33d0('0x45')]({},_0x8d1c95,_0x3c013d['options']);return db[_0x33d0('0x37')][_0x33d0('0x4f')](_0x8d1c95)['then'](handleEntityNotFound(_0x4dc07c,null))[_0x33d0('0x31')](respondWithResult(_0x4dc07c,null))[_0x33d0('0x23')](handleError(_0x4dc07c,null));};exports[_0x33d0('0x50')]=function(_0x7fa31b,_0x3c7ff2){return db[_0x33d0('0x37')][_0x33d0('0x50')](_0x7fa31b['body'],{})['then'](respondWithResult(_0x3c7ff2,0xc9))[_0x33d0('0x23')](handleError(_0x3c7ff2,null));};exports[_0x33d0('0x51')]=function(_0x40068d,_0xe091cf){if(_0x40068d[_0x33d0('0x52')]['id']){delete _0x40068d[_0x33d0('0x52')]['id'];}return db['WhatsappMessage'][_0x33d0('0x4f')]({'where':{'id':_0x40068d[_0x33d0('0x53')]['id']}})['then'](handleEntityNotFound(_0xe091cf,null))[_0x33d0('0x31')](saveUpdates(_0x40068d[_0x33d0('0x52')],null))[_0x33d0('0x31')](respondWithResult(_0xe091cf,null))['catch'](handleError(_0xe091cf,null));};exports['destroy']=function(_0x890a00,_0x36bad1){return db[_0x33d0('0x37')][_0x33d0('0x4f')]({'where':{'id':_0x890a00[_0x33d0('0x53')]['id']}})['then'](handleEntityNotFound(_0x36bad1,null))[_0x33d0('0x31')](removeEntity(_0x36bad1,null))[_0x33d0('0x23')](handleError(_0x36bad1,null));};exports['describe']=function(_0x1c058a,_0x3a71a5){return db[_0x33d0('0x37')][_0x33d0('0x54')]()[_0x33d0('0x31')](respondWithResult(_0x3a71a5,null))[_0x33d0('0x23')](handleError(_0x3a71a5,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x33d0('0x55')]=function(_0x442f5f,_0x350a0e,_0x14ce69){var _0x12323a={'agent':{},'channel':_0x33d0('0x56')};if(_0x442f5f[_0x33d0('0x52')]['id']){delete _0x442f5f[_0x33d0('0x52')]['id'];}_0x442f5f[_0x33d0('0x52')][_0x33d0('0x57')]=!![];_0x442f5f[_0x33d0('0x52')][_0x33d0('0x58')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x442f5f[_0x33d0('0x52')][_0x33d0('0x59')]=_0x442f5f[_0x33d0('0x52')]['UserId']||_0x442f5f[_0x33d0('0x5a')]['id'];_0x12323a[_0x33d0('0x5b')]['id']=_0x442f5f[_0x33d0('0x52')][_0x33d0('0x59')];return db[_0x33d0('0x37')][_0x33d0('0x4f')]({'where':{'id':_0x442f5f[_0x33d0('0x53')]['id'],'UserId':null}})[_0x33d0('0x31')](handleEntityNotFound(_0x350a0e,null))[_0x33d0('0x31')](saveUpdates(_0x442f5f[_0x33d0('0x52')],null))[_0x33d0('0x31')](function(_0x4d50bd){if(_0x4d50bd){_0x12323a[_0x33d0('0x21')]=_0x4d50bd[_0x33d0('0x5c')]({'plain':!![]});return db[_0x33d0('0x5d')][_0x33d0('0x4f')]({'where':{'id':_0x4d50bd[_0x33d0('0x5e')]}});}return null;})[_0x33d0('0x31')](handleEntityNotFound(_0x350a0e,null))[_0x33d0('0x31')](function(_0x4429e5){if(_0x4429e5){return _0x4429e5['update']({'UserId':_0x442f5f[_0x33d0('0x52')][_0x33d0('0x59')],'read1stAt':_[_0x33d0('0x5f')](_0x4429e5[_0x33d0('0x60')])?moment()['format'](_0x33d0('0x61')):undefined});}return null;})[_0x33d0('0x31')](function(_0x2e0ecf){if(_0x2e0ecf){_0x12323a[_0x33d0('0x62')]=_0x2e0ecf['get']({'plain':!![]});interaction_log[_0x33d0('0x1b')](_0x33d0('0x63'),_0x442f5f[_0x33d0('0x5a')]['id'],_0x442f5f['user'][_0x33d0('0x33')],_0x442f5f['user'][_0x33d0('0x64')],_0x12323a[_0x33d0('0x62')]['id'],_0x442f5f[_0x33d0('0x52')]?JSON[_0x33d0('0x1f')](_0x442f5f['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x33d0('0x65'),_0x12323a);}return null;})[_0x33d0('0x31')](function(_0x8db30e){var _0x3d00b2=_0x33d0('0x66')+_0x8db30e['message']['ContactId'];return db['sequelize'][_0x33d0('0x3b')](_0x3d00b2,{'type':db['Sequelize'][_0x33d0('0x67')][_0x33d0('0x68')],'raw':!![]})[_0x33d0('0x31')](function(_0x28a0d7){return _0x28a0d7;});})['then'](function(_0x508774){if(_0x508774){_0x12323a['message'][_0x33d0('0x69')]=_0x508774[0x0];if(!_0x442f5f[_0x33d0('0x52')][_0x33d0('0x59')])return;return db['User'][_0x33d0('0x4f')]({'where':{'id':_0x442f5f[_0x33d0('0x52')]['UserId'],'role':_0x33d0('0x5b')},'attributes':['id','name',_0x33d0('0x6a'),_0x33d0('0x6b'),_0x33d0('0x6c')],'raw':!![]});}return null;})['then'](function(_0xf72d09){if(!_0xf72d09)return null;_0x12323a[_0x33d0('0x21')][_0x33d0('0x5b')]=_0xf72d09;return _0x12323a;})[_0x33d0('0x31')](function(_0x18ac80){if(_0x18ac80){if(_0x442f5f[_0x33d0('0x52')][_0x33d0('0x6d')]){_0x12323a['message'][_0x33d0('0x6e')]=util[_0x33d0('0x6f')](_0x33d0('0x70'),_0x442f5f[_0x33d0('0x5a')][_0x33d0('0x33')]);_0x12323a[_0x33d0('0x21')]['channel']=_0x12323a[_0x33d0('0x71')];_0x12323a[_0x33d0('0x21')][_0x33d0('0x72')]=_0x12323a['channel'];_0x12323a[_0x33d0('0x21')][_0x33d0('0x73')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x33d0('0x74'),'message':_0x12323a[_0x33d0('0x21')]},client9002)[_0x33d0('0x31')](function(){return _0x12323a;});}return _0x12323a;}return null;})[_0x33d0('0x31')](respondWithResult(_0x350a0e,null))[_0x33d0('0x23')](handleError(_0x350a0e,null));};var interaction_log=require(_0x33d0('0x10'))(_0x33d0('0x75'));exports[_0x33d0('0x2f')]=function(_0x19c4e8,_0x396806,_0x4d1a78){var _0x160c8a={'agent':{},'channel':'whatsapp'};if(_0x19c4e8[_0x33d0('0x52')]['id']){delete _0x19c4e8[_0x33d0('0x52')]['id'];}_0x19c4e8[_0x33d0('0x52')][_0x33d0('0x59')]=_0x19c4e8[_0x33d0('0x52')][_0x33d0('0x59')]||_0x19c4e8[_0x33d0('0x5a')]['id'];_0x160c8a[_0x33d0('0x5b')]['id']=_0x19c4e8[_0x33d0('0x52')][_0x33d0('0x59')];return db[_0x33d0('0x37')]['find']({'where':{'id':_0x19c4e8[_0x33d0('0x53')]['id'],'UserId':null}})[_0x33d0('0x31')](handleEntityNotFound(_0x396806,null))['then'](function(_0x42fcdb){if(_0x42fcdb){_0x160c8a[_0x33d0('0x21')]=_0x42fcdb[_0x33d0('0x5c')]({'plain':!![]});return db[_0x33d0('0x5d')]['find']({'where':{'id':_0x42fcdb[_0x33d0('0x5e')]}});}return null;})[_0x33d0('0x31')](handleEntityNotFound(_0x396806,null))[_0x33d0('0x31')](function(_0x1b65b6){if(_0x1b65b6){_0x160c8a[_0x33d0('0x62')]=_0x1b65b6[_0x33d0('0x5c')]({'plain':!![]});interaction_log[_0x33d0('0x1b')](_0x33d0('0x76'),_0x19c4e8[_0x33d0('0x5a')]['id'],_0x19c4e8[_0x33d0('0x5a')][_0x33d0('0x33')],_0x19c4e8[_0x33d0('0x5a')]['role'],_0x160c8a[_0x33d0('0x62')]['id'],_0x19c4e8[_0x33d0('0x52')]?JSON[_0x33d0('0x1f')](_0x19c4e8[_0x33d0('0x52')]):_0x33d0('0x77'));return respondWithRpcPromise(_0x33d0('0x78'),'rejectMessage',_0x160c8a);}return null;})[_0x33d0('0x31')](function(_0x17f4bd){var _0x4f2904=_0x33d0('0x66')+_0x17f4bd[_0x33d0('0x21')]['ContactId'];return db[_0x33d0('0x79')]['query'](_0x4f2904,{'type':db[_0x33d0('0x7a')][_0x33d0('0x67')][_0x33d0('0x68')],'raw':!![]})[_0x33d0('0x31')](function(_0x21050e){return _0x21050e;});})[_0x33d0('0x31')](function(_0x52da1f){if(_0x52da1f){_0x160c8a['message'][_0x33d0('0x69')]=_0x52da1f[0x0];if(!_0x19c4e8[_0x33d0('0x52')][_0x33d0('0x59')])return;return db['User']['find']({'where':{'id':_0x19c4e8[_0x33d0('0x52')]['UserId'],'role':_0x33d0('0x5b')},'attributes':['id',_0x33d0('0x33'),_0x33d0('0x6a'),_0x33d0('0x6b'),_0x33d0('0x6c')],'raw':!![]});}return null;})[_0x33d0('0x31')](function(_0x1a4d76){if(!_0x1a4d76)return null;_0x160c8a[_0x33d0('0x21')][_0x33d0('0x5b')]=_0x1a4d76;return _0x160c8a;})[_0x33d0('0x31')](function(_0x2b8a5c){if(_0x2b8a5c){_0x2b8a5c['message']['interface']=util[_0x33d0('0x6f')](_0x33d0('0x70'),_0x19c4e8[_0x33d0('0x5a')][_0x33d0('0x33')]);_0x2b8a5c[_0x33d0('0x21')]['channel']=_0x160c8a[_0x33d0('0x71')];_0x2b8a5c['message'][_0x33d0('0x72')]=_0x160c8a['channel'];_0x2b8a5c[_0x33d0('0x21')]['event']=_0x33d0('0x2f');respondWithRpcPromise('EventManager',_0x33d0('0x7b'),{'event':'rejectmessage','message':_0x2b8a5c[_0x33d0('0x21')]},client9002);return _0x160c8a;}return null;})['then'](respondWithResult(_0x396806,null))[_0x33d0('0x23')](handleError(_0x396806,null));};exports[_0x33d0('0x25')]=function(_0x3fc693,_0xbb3e01,_0x46b4aa){if(_0x3fc693[_0x33d0('0x52')]['id']){delete _0x3fc693['body']['id'];}var _0xec6487;return db[_0x33d0('0x37')]['find']({'where':{'id':_0x3fc693[_0x33d0('0x53')]['id']}})[_0x33d0('0x31')](handleEntityNotFound(_0xbb3e01,null))[_0x33d0('0x31')](function(_0x1c4adb){if(_0x1c4adb){_0xec6487=_0x1c4adb;return db[_0x33d0('0x7c')]['find']({'where':{'id':_0x1c4adb[_0x33d0('0x7d')]}});}})['then'](handleEntityNotFound(_0xbb3e01,null))[_0x33d0('0x31')](function(_0x11734e){if(_0x11734e){logger[_0x33d0('0x7e')](_0x33d0('0x7f'),_0x33d0('0x25'),_0x33d0('0x80'),_0x11734e[_0x33d0('0x3a')],util[_0x33d0('0x81')](_0x3fc693[_0x33d0('0x52')],{'showHidden':![],'depth':null}));switch(_0x11734e[_0x33d0('0x3a')]){case _0x33d0('0x82'):if(_0x3fc693['body'][_0x33d0('0x83')]&&_0x3fc693[_0x33d0('0x52')][_0x33d0('0x83')]===_0xec6487[_0x33d0('0x84')]&&_0x3fc693[_0x33d0('0x52')]['MessageStatus']&&_0x3fc693[_0x33d0('0x52')][_0x33d0('0x85')]===_0x33d0('0x57')){return _0xec6487[_0x33d0('0x51')]({'read':!![]});}else{logger[_0x33d0('0x20')](_0x33d0('0x86'),_0x33d0('0x25'),_0x33d0('0x82'),util[_0x33d0('0x81')](_0x3fc693[_0x33d0('0x52')],{'showHidden':![],'depth':null}));}break;}return _0xec6487;}})[_0x33d0('0x31')](respondWithResult(_0xbb3e01,null))[_0x33d0('0x23')](handleError(_0xbb3e01,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 15e0043..3460c50 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 _0x5423=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5423,0xe3));var _0x3542=function(_0x7d3e40,_0x2e6e6){_0x7d3e40=_0x7d3e40-0x0;var _0x5b011a=_0x5423[_0x7d3e40];return _0x5b011a;};'use strict';var EventEmitter=require(_0x3542('0x0'));var WhatsappMessage=require(_0x3542('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x3542('0x2')](0x0);var events={'afterCreate':_0x3542('0x3'),'afterUpdate':'update','afterDestroy':_0x3542('0x4')};function emitEvent(_0x1202d5){return function(_0xf0835,_0x2a1864,_0x54ea2f){WhatsappMessageEvents[_0x3542('0x5')](_0x1202d5+':'+_0xf0835['id'],_0xf0835);WhatsappMessageEvents[_0x3542('0x5')](_0x1202d5,_0xf0835);_0x54ea2f(null);};}for(var e in events){if(events[_0x3542('0x6')](e)){var event=events[e];WhatsappMessage[_0x3542('0x7')](e,emitEvent(event));}}module[_0x3542('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0x0abf=['hook','events','WhatsappMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x244607,_0x3994fe){var _0x2915d8=function(_0x567067){while(--_0x567067){_0x244607['push'](_0x244607['shift']());}};_0x2915d8(++_0x3994fe);}(_0x0abf,0xe8));var _0xf0ab=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0abf[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0xf0ab('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xf0ab('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf0ab('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf0ab('0x3')};function emitEvent(_0x4889fb){return function(_0x7ea4e0,_0x3be05e,_0x2efe43){WhatsappMessageEvents[_0xf0ab('0x4')](_0x4889fb+':'+_0x7ea4e0['id'],_0x7ea4e0);WhatsappMessageEvents[_0xf0ab('0x4')](_0x4889fb,_0x7ea4e0);_0x2efe43(null);};}for(var e in events){if(events[_0xf0ab('0x5')](e)){var event=events[e];WhatsappMessage[_0xf0ab('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 7eb6e16..18c927f 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 _0xd467=['path','rimraf','./whatsappMessage.attributes','exports','define','fti_whatsapp_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','update','createdAt','catch','error','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','create','body','whatsapp:','remote','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0xd467,0x13e));var _0x7d46=function(_0x1fa849,_0x335135){_0x1fa849=_0x1fa849-0x0;var _0x497726=_0xd467[_0x1fa849];return _0x497726;};'use strict';var _=require(_0x7d46('0x0'));var util=require(_0x7d46('0x1'));var logger=require(_0x7d46('0x2'))(_0x7d46('0x3'));var moment=require(_0x7d46('0x4'));var BPromise=require('bluebird');var rp=require(_0x7d46('0x5'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x7d46('0x6'));var rimraf=require(_0x7d46('0x7'));var config=require('../../config/environment');var attributes=require(_0x7d46('0x8'));module[_0x7d46('0x9')]=function(_0x53f639,_0x4800bb){return _0x53f639[_0x7d46('0xa')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x7d46('0xb'),'fields':['body'],'type':_0x7d46('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x435483,_0x58f1e2,_0x55f907){var _0x403fb7=_0x53f639['models'];var _0x1fa290=_0x435483[_0x7d46('0xd')]({'plain':!![]});if(_0x1fa290[_0x7d46('0xe')][_0x7d46('0xf')]()==='in'||_0x1fa290['direction'][_0x7d46('0xf')]()===_0x7d46('0x10')&&!_0x1fa290[_0x7d46('0x11')]&&!_[_0x7d46('0x12')](_0x1fa290[_0x7d46('0x13')])){_0x403fb7[_0x7d46('0x14')]['findOne']({'where':{'id':_0x1fa290[_0x7d46('0x15')]}})['then'](function(_0x3d3783){if(_0x3d3783){_0x3d3783[_0x7d46('0x16')]({'lastMsgAt':_0x1fa290[_0x7d46('0x17')],'lastMsgDirection':_0x1fa290['direction'][_0x7d46('0xf')]()});}})[_0x7d46('0x18')](function(_0x558247){console[_0x7d46('0x19')](_0x558247);});}if(_0x1fa290[_0x7d46('0xe')]===_0x7d46('0x10')&&!_0x1fa290[_0x7d46('0x11')]){var _0x45cff0;_0x403fb7['WhatsappAccount'][_0x7d46('0x1a')]({'where':{'id':_0x1fa290[_0x7d46('0x1b')]},'raw':!![]})[_0x7d46('0x1c')](function(_0x19abe4){_0x45cff0=_0x19abe4;if(_0x45cff0&&_0x45cff0['type']){switch(_0x45cff0[_0x7d46('0x1d')]){case _0x7d46('0x1e'):var _0xa86da7=require('twilio');if(_0x45cff0[_0x7d46('0x1f')]&&_0x45cff0[_0x7d46('0x20')]&&_0x45cff0[_0x7d46('0x21')]){var _0xab1b88=new _0xa86da7(_0x45cff0[_0x7d46('0x1f')],_0x45cff0['authToken']);_0xab1b88['messages'][_0x7d46('0x22')]({'body':_0x1fa290[_0x7d46('0x23')],'to':'whatsapp:'+_0x1fa290[_0x7d46('0x21')],'from':_0x7d46('0x24')+_0x45cff0[_0x7d46('0x21')],'statusCallback':_0x45cff0[_0x7d46('0x25')]+_0x7d46('0x26')+_0x1fa290['id']+'/status?token='+_0x45cff0[_0x7d46('0x27')]})['then'](function(_0x326d3d){if(_0x326d3d[_0x7d46('0x28')]){return _0x435483['update']({'messageId':_0x326d3d[_0x7d46('0x28')]});}})[_0x7d46('0x18')](function(_0x382253){logger[_0x7d46('0x19')](_0x7d46('0x29'),_0x7d46('0x2a'),_0x7d46('0x1e'),util[_0x7d46('0x2b')](_0x382253,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7d46('0x29'),_0x7d46('0x2a'),_0x7d46('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x225ae6=_0x45cff0[_0x7d46('0x1f')];var _0xceffd1=_0x45cff0[_0x7d46('0x20')];var _0x45f934=_0x45cff0[_0x7d46('0x2c')]+_0x7d46('0x2d')+_0x225ae6+_0x7d46('0x2e');var _0x1e3f9c={'to':[_0x1fa290['phone']],'message':{'type':_0x7d46('0x2f'),'text':_0x1fa290['body']}};var _0x319906={'method':_0x7d46('0x30'),'uri':_0x45f934,'headers':{'Authorization':_0x7d46('0x31')+_0xceffd1,'Content-Type':'application/json'},'body':_0x1e3f9c,'json':!![]};rp(_0x319906)['then'](function(_0x2e756f){if(_0x2e756f[_0x7d46('0x32')][0x0][_0x7d46('0x33')]){return _0x435483[_0x7d46('0x16')]({'messageId':_0x2e756f[_0x7d46('0x32')][0x0][_0x7d46('0x33')]});}})[_0x7d46('0x18')](function(_0x3b922c){logger['err']('WhatsappMessage,\x20%s',_0x3b922c);});break;}}})['finally'](function(){_0x55f907();});}else{_0x55f907();}}},'charset':_0x7d46('0x34'),'collate':_0x7d46('0x35')});}; \ No newline at end of file +var _0x9ebf=['catch','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','application/json','message_id','err','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','WhatsappInteractionId','update','createdAt'];(function(_0x40c4ca,_0x4277fc){var _0x3a0c0e=function(_0x10dccd){while(--_0x10dccd){_0x40c4ca['push'](_0x40c4ca['shift']());}};_0x3a0c0e(++_0x4277fc);}(_0x9ebf,0x18f));var _0xf9eb=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9ebf[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf9eb('0x0'));var util=require(_0xf9eb('0x1'));var logger=require(_0xf9eb('0x2'))(_0xf9eb('0x3'));var moment=require(_0xf9eb('0x4'));var BPromise=require(_0xf9eb('0x5'));var rp=require(_0xf9eb('0x6'));var fetch=require(_0xf9eb('0x7'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf9eb('0x8'));var config=require(_0xf9eb('0x9'));var attributes=require(_0xf9eb('0xa'));module[_0xf9eb('0xb')]=function(_0x3b3a89,_0x2aa143){return _0x3b3a89[_0xf9eb('0xc')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xf9eb('0xd'),'fields':[_0xf9eb('0xd')]},{'name':_0xf9eb('0xe'),'fields':[_0xf9eb('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2253f4,_0x201e6c,_0x36ea57){var _0x270131=_0x3b3a89[_0xf9eb('0x10')];var _0x591ce0=_0x2253f4[_0xf9eb('0x11')]({'plain':!![]});if(_0x591ce0[_0xf9eb('0x12')][_0xf9eb('0x13')]()==='in'||_0x591ce0[_0xf9eb('0x12')]['toLowerCase']()===_0xf9eb('0x14')&&!_0x591ce0[_0xf9eb('0x15')]&&!_[_0xf9eb('0x16')](_0x591ce0[_0xf9eb('0x17')])){_0x270131['WhatsappInteraction'][_0xf9eb('0x18')]({'where':{'id':_0x591ce0[_0xf9eb('0x19')]}})['then'](function(_0x427ecc){if(_0x427ecc){_0x427ecc[_0xf9eb('0x1a')]({'lastMsgAt':_0x591ce0[_0xf9eb('0x1b')],'lastMsgDirection':_0x591ce0['direction'][_0xf9eb('0x13')]()});}})[_0xf9eb('0x1c')](function(_0x418cec){console[_0xf9eb('0x1d')](_0x418cec);});}if(_0x591ce0[_0xf9eb('0x12')]===_0xf9eb('0x14')&&!_0x591ce0[_0xf9eb('0x15')]){var _0x37e659;_0x270131[_0xf9eb('0x1e')][_0xf9eb('0x1f')]({'where':{'id':_0x591ce0[_0xf9eb('0x20')]},'raw':!![]})[_0xf9eb('0x21')](function(_0x2fef7b){_0x37e659=_0x2fef7b;if(_0x37e659&&_0x37e659[_0xf9eb('0x22')]){switch(_0x37e659[_0xf9eb('0x22')]){case _0xf9eb('0x23'):var _0x1b2b28=require(_0xf9eb('0x23'));if(_0x37e659[_0xf9eb('0x24')]&&_0x37e659[_0xf9eb('0x25')]&&_0x37e659[_0xf9eb('0x26')]){var _0x35062a=new _0x1b2b28(_0x37e659[_0xf9eb('0x24')],_0x37e659[_0xf9eb('0x25')]);_0x35062a[_0xf9eb('0x27')][_0xf9eb('0x28')]({'body':_0x591ce0[_0xf9eb('0xf')],'to':_0xf9eb('0x29')+_0x591ce0[_0xf9eb('0x26')],'from':_0xf9eb('0x29')+_0x37e659['phone'],'statusCallback':_0x37e659[_0xf9eb('0x2a')]+_0xf9eb('0x2b')+_0x591ce0['id']+_0xf9eb('0x2c')+_0x37e659[_0xf9eb('0x2d')]})[_0xf9eb('0x21')](function(_0x557a9e){if(_0x557a9e[_0xf9eb('0x2e')]){return _0x2253f4[_0xf9eb('0x1a')]({'messageId':_0x557a9e['sid']});}})['catch'](function(_0x44bd47){logger[_0xf9eb('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xf9eb('0x2f'),_0xf9eb('0x23'),util[_0xf9eb('0x30')](_0x44bd47,{'showHidden':![],'depth':null}));});}else{logger[_0xf9eb('0x1d')](_0xf9eb('0x31'),_0xf9eb('0x2f'),_0xf9eb('0x23'),_0xf9eb('0x32'));}break;case _0xf9eb('0x33'):var _0x4352c6=_0x37e659['accountSid'];var _0x581898=_0x37e659['authToken'];var _0x5b88c4=_0x37e659[_0xf9eb('0x34')]+_0xf9eb('0x35')+_0x4352c6+_0xf9eb('0x36');var _0x1115ff={'to':[_0x591ce0[_0xf9eb('0x26')]],'message':{'type':'text','text':_0x591ce0[_0xf9eb('0xf')]}};var _0x5ca1e8={'method':_0xf9eb('0x37'),'uri':_0x5b88c4,'headers':{'Authorization':'Bearer\x20'+_0x581898,'Content-Type':_0xf9eb('0x38')},'body':_0x1115ff,'json':!![]};rp(_0x5ca1e8)[_0xf9eb('0x21')](function(_0x483645){if(_0x483645['statuses'][0x0][_0xf9eb('0x39')]){return _0x2253f4['update']({'messageId':_0x483645['statuses'][0x0][_0xf9eb('0x39')]});}})[_0xf9eb('0x1c')](function(_0x267091){logger[_0xf9eb('0x3a')]('WhatsappMessage,\x20%s',_0x267091);});break;}}})[_0xf9eb('0x3b')](function(){_0x36ea57();});}else{_0x36ea57();}}},'charset':_0xf9eb('0x3c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 0e8caaa..3369e62 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 _0x06a5=['error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','info','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x06a5,0xfa));var _0x506a=function(_0x36f688,_0x136a34){_0x36f688=_0x36f688-0x0;var _0x5483e4=_0x06a5[_0x36f688];return _0x5483e4;};'use strict';var _=require(_0x506a('0x0'));var util=require(_0x506a('0x1'));var moment=require(_0x506a('0x2'));var BPromise=require(_0x506a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x506a('0x4'))['db'];var utils=require(_0x506a('0x5'));var logger=require(_0x506a('0x6'))(_0x506a('0x7'));var config=require(_0x506a('0x8'));var jayson=require(_0x506a('0x9'));var client=jayson[_0x506a('0xa')]['http']({'port':0x232a});config[_0x506a('0xb')]=_[_0x506a('0xc')](config['redis'],{'host':_0x506a('0xd'),'port':0x18eb});var socket=require(_0x506a('0xe'))(new Redis(config[_0x506a('0xb')]));require('./whatsappMessage.socket')[_0x506a('0xf')](socket);function respondWithRpcPromise(_0x3e3bda,_0x22e7fe,_0x55a041){return new BPromise(function(_0x1c5d0d,_0x13777b){return client['request'](_0x3e3bda,_0x55a041)[_0x506a('0x10')](function(_0x460e4e){logger['info'](_0x506a('0x11'),_0x22e7fe,'request\x20sent');logger[_0x506a('0x12')](_0x506a('0x13'),_0x22e7fe,_0x506a('0x14'),JSON[_0x506a('0x15')](_0x460e4e));if(_0x460e4e[_0x506a('0x16')]){if(_0x460e4e[_0x506a('0x16')][_0x506a('0x17')]===0x1f4){logger['error'](_0x506a('0x11'),_0x22e7fe,_0x460e4e['error'][_0x506a('0x18')]);return _0x13777b(_0x460e4e['error'][_0x506a('0x18')]);}logger[_0x506a('0x16')](_0x506a('0x11'),_0x22e7fe,_0x460e4e[_0x506a('0x16')][_0x506a('0x18')]);return _0x1c5d0d(_0x460e4e[_0x506a('0x16')]['message']);}else{logger['info'](_0x506a('0x11'),_0x22e7fe,_0x506a('0x14'));_0x1c5d0d(_0x460e4e[_0x506a('0x19')][_0x506a('0x18')]);}})[_0x506a('0x1a')](function(_0x44f002){logger[_0x506a('0x16')](_0x506a('0x11'),_0x22e7fe,_0x44f002);_0x13777b(_0x44f002);});});}exports[_0x506a('0x1b')]=function(_0x18ea7d){var _0x4d498b=this;return new Promise(function(_0x307bb5,_0x4b91f3){return db[_0x506a('0x1c')][_0x506a('0x1d')](_0x18ea7d[_0x506a('0x1e')],{'raw':_0x18ea7d[_0x506a('0x1f')]?_0x18ea7d[_0x506a('0x1f')][_0x506a('0x20')]===undefined?!![]:![]:!![]})[_0x506a('0x10')](function(_0x341704){logger[_0x506a('0x21')](_0x506a('0x1b'),_0x18ea7d);logger[_0x506a('0x12')](_0x506a('0x1b'),_0x18ea7d,JSON['stringify'](_0x341704));_0x307bb5(_0x341704);})[_0x506a('0x1a')](function(_0x389e1c){logger[_0x506a('0x16')](_0x506a('0x1b'),_0x389e1c[_0x506a('0x18')],_0x18ea7d);_0x4b91f3(_0x4d498b[_0x506a('0x16')](0x1f4,_0x389e1c[_0x506a('0x18')]));});});}; \ No newline at end of file +var _0x6f20=['http','redis','socket.io-emitter','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','WhatsappMessage','create','options','raw','CreateWhatsappMessage','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x4004bc,_0x515a4a){var _0x3a31dd=function(_0x525f5c){while(--_0x525f5c){_0x4004bc['push'](_0x4004bc['shift']());}};_0x3a31dd(++_0x515a4a);}(_0x6f20,0x19a));var _0x06f2=function(_0x47bc5e,_0x6fc500){_0x47bc5e=_0x47bc5e-0x0;var _0x323a59=_0x6f20[_0x47bc5e];return _0x323a59;};'use strict';var _=require(_0x06f2('0x0'));var util=require(_0x06f2('0x1'));var moment=require('moment');var BPromise=require(_0x06f2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06f2('0x3'));var db=require(_0x06f2('0x4'))['db'];var utils=require(_0x06f2('0x5'));var logger=require('../../config/logger')(_0x06f2('0x6'));var config=require(_0x06f2('0x7'));var jayson=require(_0x06f2('0x8'));var client=jayson[_0x06f2('0x9')][_0x06f2('0xa')]({'port':0x232a});config[_0x06f2('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x06f2('0xc'))(new Redis(config[_0x06f2('0xb')]));require('./whatsappMessage.socket')[_0x06f2('0xd')](socket);function respondWithRpcPromise(_0x5f0963,_0x5c3cab,_0x2a1c76){return new BPromise(function(_0x5944e4,_0x32950d){return client[_0x06f2('0xe')](_0x5f0963,_0x2a1c76)[_0x06f2('0xf')](function(_0x34afad){logger['info'](_0x06f2('0x10'),_0x5c3cab,_0x06f2('0x11'));logger['debug'](_0x06f2('0x12'),_0x5c3cab,_0x06f2('0x11'),JSON[_0x06f2('0x13')](_0x34afad));if(_0x34afad[_0x06f2('0x14')]){if(_0x34afad[_0x06f2('0x14')][_0x06f2('0x15')]===0x1f4){logger['error'](_0x06f2('0x10'),_0x5c3cab,_0x34afad['error'][_0x06f2('0x16')]);return _0x32950d(_0x34afad[_0x06f2('0x14')][_0x06f2('0x16')]);}logger['error'](_0x06f2('0x10'),_0x5c3cab,_0x34afad[_0x06f2('0x14')][_0x06f2('0x16')]);return _0x5944e4(_0x34afad[_0x06f2('0x14')]['message']);}else{logger[_0x06f2('0x17')](_0x06f2('0x10'),_0x5c3cab,_0x06f2('0x11'));_0x5944e4(_0x34afad['result'][_0x06f2('0x16')]);}})['catch'](function(_0x2d5f6b){logger['error'](_0x06f2('0x10'),_0x5c3cab,_0x2d5f6b);_0x32950d(_0x2d5f6b);});});}exports['CreateWhatsappMessage']=function(_0x12e04f){var _0x142396=this;return new Promise(function(_0x1ba3fa,_0x1bf7c4){return db[_0x06f2('0x18')][_0x06f2('0x19')](_0x12e04f['body'],{'raw':_0x12e04f[_0x06f2('0x1a')]?_0x12e04f[_0x06f2('0x1a')][_0x06f2('0x1b')]===undefined?!![]:![]:!![]})[_0x06f2('0xf')](function(_0x46bb1e){logger['info'](_0x06f2('0x1c'),_0x12e04f);logger[_0x06f2('0x1d')](_0x06f2('0x1c'),_0x12e04f,JSON['stringify'](_0x46bb1e));_0x1ba3fa(_0x46bb1e);})['catch'](function(_0x5d03ab){logger[_0x06f2('0x14')](_0x06f2('0x1c'),_0x5d03ab['message'],_0x12e04f);_0x1bf7c4(_0x142396[_0x06f2('0x14')](0x1f4,_0x5d03ab[_0x06f2('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 7d8dd22..57e06f3 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 _0x8342=['save','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8342,0x1e2));var _0x2834=function(_0x2e14f2,_0x377d0d){_0x2e14f2=_0x2e14f2-0x0;var _0x12cc03=_0x8342[_0x2e14f2];return _0x12cc03;};'use strict';var WhatsappMessageEvents=require(_0x2834('0x0'));var events=[_0x2834('0x1'),'remove','update'];function createListener(_0x36af0c,_0x266bee){return function(_0x1d20e1){_0x266bee[_0x2834('0x2')](_0x36af0c,_0x1d20e1);};}function removeListener(_0x2bccdf,_0x435013){return function(){WhatsappMessageEvents[_0x2834('0x3')](_0x2bccdf,_0x435013);};}exports[_0x2834('0x4')]=function(_0x7ac971){for(var _0x24ea1f=0x0,_0x3a7e07=events[_0x2834('0x5')];_0x24ea1f<_0x3a7e07;_0x24ea1f++){var _0x46ba75=events[_0x24ea1f];var _0x153e4c=createListener(_0x2834('0x6')+_0x46ba75,_0x7ac971);WhatsappMessageEvents['on'](_0x46ba75,_0x153e4c);}}; \ No newline at end of file +var _0x0bf2=['whatsappMessage:','save','remove','emit','removeListener','register'];(function(_0x3c504b,_0x437693){var _0x2e5354=function(_0x456709){while(--_0x456709){_0x3c504b['push'](_0x3c504b['shift']());}};_0x2e5354(++_0x437693);}(_0x0bf2,0x1e1));var _0x20bf=function(_0x173cf6,_0x111b73){_0x173cf6=_0x173cf6-0x0;var _0x2cfb3c=_0x0bf2[_0x173cf6];return _0x2cfb3c;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x20bf('0x0'),_0x20bf('0x1'),'update'];function createListener(_0x31cbda,_0x593114){return function(_0x52e089){_0x593114[_0x20bf('0x2')](_0x31cbda,_0x52e089);};}function removeListener(_0x1f680c,_0x2376fb){return function(){WhatsappMessageEvents[_0x20bf('0x3')](_0x1f680c,_0x2376fb);};}exports[_0x20bf('0x4')]=function(_0x23a962){for(var _0x207a46=0x0,_0x39bf42=events['length'];_0x207a46<_0x39bf42;_0x207a46++){var _0x9f26bd=events[_0x207a46];var _0xca5895=createListener(_0x20bf('0x5')+_0x9f26bd,_0x23a962);WhatsappMessageEvents['on'](_0x9f26bd,_0xca5895);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index b664d74..d5940c9 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 _0x8b4c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','update','delete','destroy','removeTeams','multer','util','path','connect-timeout','express'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0x8b4c,0x87));var _0xc8b4=function(_0x1b3c43,_0x2fcc2c){_0x1b3c43=_0x1b3c43-0x0;var _0x31cf0b=_0x8b4c[_0x1b3c43];return _0x31cf0b;};'use strict';var multer=require(_0xc8b4('0x0'));var util=require(_0xc8b4('0x1'));var path=require(_0xc8b4('0x2'));var timeout=require(_0xc8b4('0x3'));var express=require(_0xc8b4('0x4'));var router=express[_0xc8b4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc8b4('0x6'));var interaction=require(_0xc8b4('0x7'));var config=require(_0xc8b4('0x8'));var controller=require(_0xc8b4('0x9'));router[_0xc8b4('0xa')]('/',auth[_0xc8b4('0xb')](),controller[_0xc8b4('0xc')]);router[_0xc8b4('0xa')]('/describe',auth[_0xc8b4('0xb')](),controller['describe']);router['get'](_0xc8b4('0xd'),auth[_0xc8b4('0xb')](),controller[_0xc8b4('0xe')]);router[_0xc8b4('0xa')](_0xc8b4('0xf'),auth['isAuthenticated'](),controller[_0xc8b4('0x10')]);router[_0xc8b4('0xa')](_0xc8b4('0x11'),auth['isAuthenticated'](),controller[_0xc8b4('0x12')]);router[_0xc8b4('0xa')](_0xc8b4('0x13'),auth[_0xc8b4('0xb')](),controller['getAgents']);router[_0xc8b4('0x14')]('/',auth['isAuthenticated'](),controller[_0xc8b4('0x15')]);router['post'](_0xc8b4('0x11'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0xc8b4('0x13'),auth[_0xc8b4('0xb')](),controller[_0xc8b4('0x16')]);router[_0xc8b4('0x17')](_0xc8b4('0xd'),auth['isAuthenticated'](),controller[_0xc8b4('0x18')]);router[_0xc8b4('0x19')](_0xc8b4('0xd'),auth[_0xc8b4('0xb')](),controller[_0xc8b4('0x1a')]);router[_0xc8b4('0x19')](_0xc8b4('0x11'),auth['isAuthenticated'](),controller[_0xc8b4('0x1b')]);router[_0xc8b4('0x19')]('/:id/users',auth[_0xc8b4('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x2bc2=['create','post','addAgents','update','delete','destroy','removeTeams','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x3a0c6b,_0x41ae2a){var _0x56f4fc=function(_0x1ecbe7){while(--_0x1ecbe7){_0x3a0c6b['push'](_0x3a0c6b['shift']());}};_0x56f4fc(++_0x41ae2a);}(_0x2bc2,0x7c));var _0x22bc=function(_0x4dcf64,_0x2bc0c2){_0x4dcf64=_0x4dcf64-0x0;var _0x10bb29=_0x2bc2[_0x4dcf64];return _0x10bb29;};'use strict';var multer=require(_0x22bc('0x0'));var util=require(_0x22bc('0x1'));var path=require('path');var timeout=require(_0x22bc('0x2'));var express=require(_0x22bc('0x3'));var router=express[_0x22bc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x22bc('0x5'));var interaction=require(_0x22bc('0x6'));var config=require(_0x22bc('0x7'));var controller=require(_0x22bc('0x8'));router[_0x22bc('0x9')]('/',auth[_0x22bc('0xa')](),controller[_0x22bc('0xb')]);router[_0x22bc('0x9')](_0x22bc('0xc'),auth['isAuthenticated'](),controller[_0x22bc('0xd')]);router[_0x22bc('0x9')](_0x22bc('0xe'),auth[_0x22bc('0xa')](),controller[_0x22bc('0xf')]);router[_0x22bc('0x9')]('/:id/members',auth[_0x22bc('0xa')](),controller[_0x22bc('0x10')]);router[_0x22bc('0x9')](_0x22bc('0x11'),auth[_0x22bc('0xa')](),controller[_0x22bc('0x12')]);router[_0x22bc('0x9')](_0x22bc('0x13'),auth[_0x22bc('0xa')](),controller[_0x22bc('0x14')]);router['post']('/',auth[_0x22bc('0xa')](),controller[_0x22bc('0x15')]);router[_0x22bc('0x16')]('/:id/teams',auth[_0x22bc('0xa')](),controller['addTeams']);router[_0x22bc('0x16')](_0x22bc('0x13'),auth[_0x22bc('0xa')](),controller[_0x22bc('0x17')]);router['put']('/:id',auth[_0x22bc('0xa')](),controller[_0x22bc('0x18')]);router[_0x22bc('0x19')](_0x22bc('0xe'),auth[_0x22bc('0xa')](),controller[_0x22bc('0x1a')]);router[_0x22bc('0x19')](_0x22bc('0x11'),auth['isAuthenticated'](),controller[_0x22bc('0x1b')]);router[_0x22bc('0x19')]('/:id/users',auth[_0x22bc('0xa')](),controller['removeAgents']);module[_0x22bc('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 0a4fca5..3321883 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 _0x25b5=['sequelize','exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x3187b0,_0x4cee2a){var _0x12c691=function(_0x25f27c){while(--_0x25f27c){_0x3187b0['push'](_0x3187b0['shift']());}};_0x12c691(++_0x4cee2a);}(_0x25b5,0x198));var _0x525b=function(_0x426018,_0x5001bc){_0x426018=_0x426018-0x0;var _0x589e07=_0x25b5[_0x426018];return _0x589e07;};'use strict';var Sequelize=require(_0x525b('0x0'));module[_0x525b('0x1')]={'name':{'type':Sequelize[_0x525b('0x2')],'unique':_0x525b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x525b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x525b('0x5'),_0x525b('0x6'),_0x525b('0x7'))},'description':{'type':Sequelize[_0x525b('0x2')]}}; \ No newline at end of file +var _0x453b=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x49f8c9,_0x39de7a){var _0xcd08fe=function(_0x6d2a28){while(--_0x6d2a28){_0x49f8c9['push'](_0x49f8c9['shift']());}};_0xcd08fe(++_0x39de7a);}(_0x453b,0x164));var _0xb453=function(_0x5743e3,_0x4a2aab){_0x5743e3=_0x5743e3-0x0;var _0x24d100=_0x453b[_0x5743e3];return _0x24d100;};'use strict';var Sequelize=require(_0xb453('0x0'));module[_0xb453('0x1')]={'name':{'type':Sequelize[_0xb453('0x2')],'unique':_0xb453('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb453('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb453('0x5')](_0xb453('0x6'),_0xb453('0x7'),_0xb453('0x8'))},'description':{'type':Sequelize[_0xb453('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 54bcc2e..102d538 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 _0x9850=['getAgents','bluebird','util','lodash','squel','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappQueue.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','get','WhatsappQueues','sendStatus','error','name','send','map','WhatsappQueue','rawAttributes','fieldName','key','getOptions','where','include','findAll','catch','model','keys','query','filters','intersection','attributes','fields','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','params','describe','length','hasOwnProperty','order','sort','pick','WhatsappQueueId','filter','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','format','updatedAt','findOne','Team','nolimit','getTeams','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit'];(function(_0x1525b4,_0x40eabb){var _0x5ca076=function(_0x83beaa){while(--_0x83beaa){_0x1525b4['push'](_0x1525b4['shift']());}};_0x5ca076(++_0x40eabb);}(_0x9850,0x160));var _0x0985=function(_0x193875,_0x2e81c2){_0x193875=_0x193875-0x0;var _0x2a0f4e=_0x9850[_0x193875];return _0x2a0f4e;};'use strict';var BPromise=require(_0x0985('0x0'));var util=require(_0x0985('0x1'));var _=require(_0x0985('0x2'));var squel=require(_0x0985('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x0985('0x4'))(_0x0985('0x5'));var config=require(_0x0985('0x6'));var db=require(_0x0985('0x7'))['db'];config[_0x0985('0x8')]=_['defaults'](config[_0x0985('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x0985('0x9'))(new Redis(config[_0x0985('0x8')]));require(_0x0985('0xa'))[_0x0985('0xb')](socket);function respondWithStatusCode(_0x418fef,_0x583bc0){_0x583bc0=_0x583bc0||0xcc;return function(_0x2208d5){if(_0x2208d5){return _0x418fef['sendStatus'](_0x583bc0);}return _0x418fef[_0x0985('0xc')](_0x583bc0)[_0x0985('0xd')]();};}function respondWithResult(_0x33450c,_0xb0082f){_0xb0082f=_0xb0082f||0xc8;return function(_0x2d679f){if(_0x2d679f){return _0x33450c['status'](_0xb0082f)[_0x0985('0xe')](_0x2d679f);}};}function respondWithFilteredResult(_0x55ae10,_0x3ab91e){return function(_0x874fb1){if(_0x874fb1){var _0x441968=typeof _0x3ab91e[_0x0985('0xf')]===_0x0985('0x10')&&typeof _0x3ab91e['limit']===_0x0985('0x10');var _0x633e15=_0x874fb1[_0x0985('0x11')];var _0xeb8e2e=_0x441968?0x0:_0x3ab91e[_0x0985('0xf')];var _0x58eadc=_0x441968?_0x874fb1['count']:_0x3ab91e[_0x0985('0xf')]+_0x3ab91e[_0x0985('0x12')];var _0x4604e8;if(_0x58eadc>=_0x633e15){_0x58eadc=_0x633e15;_0x4604e8=0xc8;}else{_0x4604e8=0xce;}_0x55ae10['status'](_0x4604e8);return _0x55ae10[_0x0985('0x13')](_0x0985('0x14'),_0xeb8e2e+'-'+_0x58eadc+'/'+_0x633e15)['json'](_0x874fb1);}return null;};}function saveUpdates(_0x3d3208){return function(_0x143ed3){if(_0x143ed3){return _0x143ed3['update'](_0x3d3208)[_0x0985('0x15')](function(_0x196dae){return _0x196dae;});}return null;};}function removeEntity(_0x27ad66){return function(_0x40e053){if(_0x40e053){return _0x40e053[_0x0985('0x16')]()['then'](function(){var _0x13066b=_0x40e053[_0x0985('0x17')]({'plain':!![]});var _0x732f5b=_0x0985('0x18');return db['UserProfileResource']['destroy']({'where':{'type':_0x732f5b,'resourceId':_0x13066b['id']}})['then'](function(){return _0x40e053;});})[_0x0985('0x15')](function(){_0x27ad66[_0x0985('0xc')](0xcc)[_0x0985('0xd')]();});}};}function handleEntityNotFound(_0x44c111){return function(_0x182a31){if(!_0x182a31){_0x44c111[_0x0985('0x19')](0x194);}return _0x182a31;};}function handleError(_0x1e03a7,_0x1ae8e5){_0x1ae8e5=_0x1ae8e5||0x1f4;return function(_0x441f34){logger[_0x0985('0x1a')](_0x441f34['stack']);if(_0x441f34[_0x0985('0x1b')]){delete _0x441f34['name'];}_0x1e03a7[_0x0985('0xc')](_0x1ae8e5)[_0x0985('0x1c')](_0x441f34);};}exports['index']=function(_0x5cf27d,_0x210707){var _0x17c839={};var _0x531b89={'count':0x0,'rows':[]};var _0x5e6525=_[_0x0985('0x1d')](db[_0x0985('0x1e')][_0x0985('0x1f')],function(_0x23fcc9){return{'name':_0x23fcc9[_0x0985('0x20')],'type':_0x23fcc9['type'][_0x0985('0x21')]};});_0x17c839=qs[_0x0985('0x22')](_0x5e6525,_0x5cf27d);var _0x126077={'where':_0x17c839[_0x0985('0x23')]};return db[_0x0985('0x1e')]['count'](_0x126077)['then'](function(_0x5b5527){_0x531b89[_0x0985('0x11')]=_0x5b5527;_0x17c839['include']=qs[_0x0985('0x24')](_0x5cf27d['query']);return db[_0x0985('0x1e')][_0x0985('0x25')](_0x17c839);})[_0x0985('0x15')](function(_0x347ccb){_0x531b89['rows']=_0x347ccb;return _0x531b89;})['then'](respondWithFilteredResult(_0x210707,_0x17c839))[_0x0985('0x26')](handleError(_0x210707,null));};exports['show']=function(_0x2cfd65,_0x5ddd28){var _0x24f935={'raw':!![],'where':{'id':_0x2cfd65['params']['id']}},_0x1d3b2d={};_0x1d3b2d[_0x0985('0x27')]=_[_0x0985('0x28')](db[_0x0985('0x1e')]['rawAttributes']);_0x1d3b2d[_0x0985('0x29')]=_[_0x0985('0x28')](_0x2cfd65['query']);_0x1d3b2d[_0x0985('0x2a')]=_[_0x0985('0x2b')](_0x1d3b2d[_0x0985('0x27')],_0x1d3b2d[_0x0985('0x29')]);_0x24f935[_0x0985('0x2c')]=_[_0x0985('0x2b')](_0x1d3b2d[_0x0985('0x27')],qs[_0x0985('0x2d')](_0x2cfd65[_0x0985('0x29')][_0x0985('0x2d')]));_0x24f935['attributes']=_0x24f935[_0x0985('0x2c')]['length']?_0x24f935[_0x0985('0x2c')]:_0x1d3b2d[_0x0985('0x27')];if(_0x2cfd65[_0x0985('0x29')]['includeAll']){_0x24f935['include']=[{'all':!![]}];}_0x24f935=_[_0x0985('0x2e')]({},_0x24f935,_0x2cfd65[_0x0985('0x2f')]);return db[_0x0985('0x1e')][_0x0985('0x30')](_0x24f935)['then'](handleEntityNotFound(_0x5ddd28,null))[_0x0985('0x15')](respondWithResult(_0x5ddd28,null))[_0x0985('0x26')](handleError(_0x5ddd28,null));};exports[_0x0985('0x31')]=function(_0x258d41,_0x2140b0){return db[_0x0985('0x1e')][_0x0985('0x31')](_0x258d41[_0x0985('0x32')],{})[_0x0985('0x15')](function(_0x560d28){var _0x1ffcdb=_0x258d41['user'][_0x0985('0x17')]({'plain':!![]});if(!_0x1ffcdb)throw new Error(_0x0985('0x33'));if(_0x1ffcdb['role']===_0x0985('0x34')){var _0x3e5061=_0x560d28[_0x0985('0x17')]({'plain':!![]});var _0x345e0a=_0x0985('0x18');return db[_0x0985('0x35')][_0x0985('0x30')]({'where':{'name':_0x345e0a,'userProfileId':_0x1ffcdb['userProfileId']},'raw':!![]})[_0x0985('0x15')](function(_0x2a2b09){if(_0x2a2b09&&_0x2a2b09[_0x0985('0x36')]===0x0){return db[_0x0985('0x37')]['create']({'name':_0x3e5061[_0x0985('0x1b')],'resourceId':_0x3e5061['id'],'type':_0x2a2b09[_0x0985('0x1b')],'sectionId':_0x2a2b09['id']},{})[_0x0985('0x15')](function(){return _0x560d28;});}else{return _0x560d28;}})[_0x0985('0x26')](function(_0x4e59d2){logger[_0x0985('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e59d2);throw _0x4e59d2;});}return _0x560d28;})[_0x0985('0x15')](respondWithResult(_0x2140b0,0xc9))[_0x0985('0x26')](handleError(_0x2140b0,null));};exports['update']=function(_0x58aeb9,_0x585c64){if(_0x58aeb9['body']['id']){delete _0x58aeb9[_0x0985('0x32')]['id'];}return db[_0x0985('0x1e')][_0x0985('0x30')]({'where':{'id':_0x58aeb9[_0x0985('0x38')]['id']}})[_0x0985('0x15')](handleEntityNotFound(_0x585c64,null))[_0x0985('0x15')](saveUpdates(_0x58aeb9['body'],null))[_0x0985('0x15')](respondWithResult(_0x585c64,null))[_0x0985('0x26')](handleError(_0x585c64,null));};exports[_0x0985('0x16')]=function(_0x428fac,_0x2a14cf){return db[_0x0985('0x1e')][_0x0985('0x30')]({'where':{'id':_0x428fac['params']['id']}})[_0x0985('0x15')](handleEntityNotFound(_0x2a14cf,null))[_0x0985('0x15')](removeEntity(_0x2a14cf,null))[_0x0985('0x26')](handleError(_0x2a14cf,null));};exports['describe']=function(_0xb8d158,_0x7eedd4){return db[_0x0985('0x1e')][_0x0985('0x39')]()[_0x0985('0x15')](respondWithResult(_0x7eedd4,null))[_0x0985('0x26')](handleError(_0x7eedd4,null));};exports['getMembers']=function(_0x3f09fe,_0x5f0988){var _0x61f11c={'raw':!![],'where':{}},_0x5de111={},_0x4cc6a8;return db[_0x0985('0x1e')]['findOne']({'where':{'id':_0x3f09fe['params']['id']}})[_0x0985('0x15')](handleEntityNotFound(_0x5f0988,null))[_0x0985('0x15')](function(_0x8b1f6a){if(_0x8b1f6a){_0x4cc6a8=_0x8b1f6a[_0x0985('0x17')]({'plain':!![]});_0x5de111[_0x0985('0x27')]=_['keys'](db['UserWhatsappQueue']['rawAttributes']);_0x5de111[_0x0985('0x29')]=_['keys'](_0x3f09fe['query']);_0x5de111[_0x0985('0x2a')]=_[_0x0985('0x2b')](_0x5de111[_0x0985('0x27')],_0x5de111[_0x0985('0x29')]);_0x61f11c['attributes']=_['intersection'](_0x5de111[_0x0985('0x27')],qs[_0x0985('0x2d')](_0x3f09fe[_0x0985('0x29')][_0x0985('0x2d')]));_0x61f11c[_0x0985('0x2c')]=_0x61f11c[_0x0985('0x2c')][_0x0985('0x3a')]?_0x61f11c[_0x0985('0x2c')]:_0x5de111['model'];if(!_0x3f09fe['query'][_0x0985('0x3b')]('nolimit')){_0x61f11c[_0x0985('0x12')]=qs[_0x0985('0x12')](_0x3f09fe[_0x0985('0x29')][_0x0985('0x12')]);_0x61f11c[_0x0985('0xf')]=qs[_0x0985('0xf')](_0x3f09fe[_0x0985('0x29')][_0x0985('0xf')]);}_0x61f11c[_0x0985('0x3c')]=qs[_0x0985('0x3d')](_0x3f09fe['query']['sort']);_0x61f11c[_0x0985('0x23')]=qs[_0x0985('0x2a')](_[_0x0985('0x3e')](_0x3f09fe[_0x0985('0x29')],_0x5de111['filters']));_0x61f11c[_0x0985('0x23')][_0x0985('0x3f')]=_0x8b1f6a['id'];if(_0x3f09fe[_0x0985('0x29')][_0x0985('0x40')]){_0x61f11c[_0x0985('0x23')]=_[_0x0985('0x2e')](_0x61f11c[_0x0985('0x23')],{'$or':_[_0x0985('0x1d')](_0x61f11c['attributes'],function(_0x136239){var _0xb145bc={};_0xb145bc[_0x136239]={'$like':'%'+_0x3f09fe[_0x0985('0x29')][_0x0985('0x40')]+'%'};return _0xb145bc;})});}_0x61f11c=_[_0x0985('0x2e')]({},_0x61f11c,_0x3f09fe[_0x0985('0x2f')]);return db[_0x0985('0x41')][_0x0985('0x25')](_0x61f11c);}})[_0x0985('0x15')](function(_0x538af0){if(_0x538af0){return db[_0x0985('0x42')][_0x0985('0x43')]({'where':{'id':_[_0x0985('0x1d')](_0x538af0,_0x0985('0x44')),'role':_0x0985('0x45')},'attributes':['id',_0x0985('0x1b'),_0x0985('0x46'),'updatedAt',_0x0985('0x47')]});}})[_0x0985('0x15')](function(_0x4b804f){if(_0x4b804f){return{'count':_0x4b804f['count'],'rows':_['map'](_0x4b804f['rows'],function(_0xe8cb63){return{'membername':_0xe8cb63[_0x0985('0x1b')],'UserId':_0xe8cb63['id'],'queue_name':_0x4cc6a8[_0x0985('0x1b')],'WhatsappQueueId':_0x4cc6a8['id'],'interface':util[_0x0985('0x48')]('%s/%s','SIP',_0xe8cb63[_0x0985('0x1b')]),'penalty':0x0,'paused':_0xe8cb63[_0x0985('0x46')],'createdAt':_0xe8cb63[_0x0985('0x47')],'updatedAt':_0xe8cb63[_0x0985('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5f0988,_0x61f11c))[_0x0985('0x26')](handleError(_0x5f0988,null));};exports['getTeams']=function(_0x5bd4df,_0x163700){var _0x2a8834={};var _0x145569={};var _0x53a560;var _0x54e13a;return db[_0x0985('0x1e')][_0x0985('0x4a')]({'where':{'id':_0x5bd4df[_0x0985('0x38')]['id']}})[_0x0985('0x15')](handleEntityNotFound(_0x163700,null))[_0x0985('0x15')](function(_0x5dab30){if(_0x5dab30){_0x53a560=_0x5dab30;_0x145569['model']=_['keys'](db[_0x0985('0x4b')]['rawAttributes']);_0x145569[_0x0985('0x29')]=_['keys'](_0x5bd4df[_0x0985('0x29')]);_0x145569[_0x0985('0x2a')]=_['intersection'](_0x145569['model'],_0x145569[_0x0985('0x29')]);_0x2a8834['attributes']=_[_0x0985('0x2b')](_0x145569['model'],qs[_0x0985('0x2d')](_0x5bd4df[_0x0985('0x29')][_0x0985('0x2d')]));_0x2a8834['attributes']=_0x2a8834[_0x0985('0x2c')][_0x0985('0x3a')]?_0x2a8834[_0x0985('0x2c')]:_0x145569[_0x0985('0x27')];_0x2a8834[_0x0985('0x3c')]=qs[_0x0985('0x3d')](_0x5bd4df[_0x0985('0x29')][_0x0985('0x3d')]);_0x2a8834[_0x0985('0x23')]=qs['filters'](_['pick'](_0x5bd4df['query'],_0x145569[_0x0985('0x2a')]));if(_0x5bd4df['query']['filter']){_0x2a8834[_0x0985('0x23')]=_[_0x0985('0x2e')](_0x2a8834[_0x0985('0x23')],{'$or':_[_0x0985('0x1d')](_0x2a8834[_0x0985('0x2c')],function(_0x118067){var _0x229082={};_0x229082[_0x118067]={'$like':'%'+_0x5bd4df[_0x0985('0x29')][_0x0985('0x40')]+'%'};return _0x229082;})});}_0x2a8834=_[_0x0985('0x2e')]({},_0x2a8834,_0x5bd4df['options']);return _0x53a560['getTeams'](_0x2a8834);}})[_0x0985('0x15')](function(_0xb91037){if(_0xb91037){_0x54e13a=_0xb91037[_0x0985('0x3a')];if(!_0x5bd4df[_0x0985('0x29')][_0x0985('0x3b')](_0x0985('0x4c'))){_0x2a8834['limit']=qs[_0x0985('0x12')](_0x5bd4df['query']['limit']);_0x2a8834[_0x0985('0xf')]=qs['offset'](_0x5bd4df[_0x0985('0x29')]['offset']);}return _0x53a560[_0x0985('0x4d')](_0x2a8834);}})['then'](function(_0x43d91c){if(_0x43d91c){return _0x43d91c?{'count':_0x54e13a,'rows':_0x43d91c}:null;}})[_0x0985('0x15')](respondWithResult(_0x163700,null))[_0x0985('0x26')](handleError(_0x163700,null));};exports[_0x0985('0x4e')]=function(_0x4ad54a,_0xdf9295){var _0x1ce5e7=_0x4ad54a[_0x0985('0x32')][_0x0985('0x4f')];return db['Team'][_0x0985('0x25')]({'where':{'id':_0x1ce5e7},'attributes':['id'],'include':[{'model':db[_0x0985('0x42')],'as':'Agents','attributes':['id',_0x0985('0x1b'),_0x0985('0x50'),_0x0985('0x51'),_0x0985('0x52')],'raw':!![]}]})[_0x0985('0x15')](function(_0x273f9e){if(_0x273f9e){var _0x19b532=_[_0x0985('0x53')](_0x273f9e,function(_0x274cea){var _0x5540cc=_0x274cea[_0x0985('0x17')]({'plain':!![]});return _0x5540cc[_0x0985('0x54')];});return db[_0x0985('0x1e')][_0x0985('0x30')]({'where':{'id':_0x4ad54a['params']['id']}})[_0x0985('0x15')](function(_0x2f6903){return db[_0x0985('0x55')]['transaction'](function(_0x51467b){return _0x2f6903[_0x0985('0x4e')](_0x1ce5e7,{'transaction':_0x51467b})[_0x0985('0x15')](function(){return BPromise[_0x0985('0x56')](_0x19b532,function(_0x10ec6c){return db[_0x0985('0x41')][_0x0985('0x57')]({'where':{'UserId':_0x10ec6c['id'],'WhatsappQueueId':_0x4ad54a[_0x0985('0x38')]['id']},'transaction':_0x51467b});});})[_0x0985('0x15')](function(){_0x19b532[_0x0985('0x58')](function(_0x4089e9){socket[_0x0985('0x59')]('userWhatsappQueue:save',{'UserId':_0x4089e9['id'],'WhatsappQueueId':_0x2f6903['id']});});});});});}})[_0x0985('0x15')](respondWithStatusCode(_0xdf9295,null))['catch'](handleError(_0xdf9295,null));};exports[_0x0985('0x5a')]=function(_0x478b8a,_0x4f4e71){return db[_0x0985('0x4b')][_0x0985('0x25')]({'where':{'id':_0x478b8a[_0x0985('0x29')][_0x0985('0x4f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0985('0x15')](handleEntityNotFound(_0x4f4e71,null))[_0x0985('0x15')](function(_0x25f555){var _0x45d204=_[_0x0985('0x1d')](_0x25f555,'id');var _0x3707db=[];var _0x52f7be=[];var _0x41dfb0=squel[_0x0985('0x5b')]();_0x41dfb0[_0x0985('0x5c')](_0x0985('0x5d'))[_0x0985('0x5e')]('team_has_whatsapp_queues','tq')[_0x0985('0x5f')](_0x0985('0x60'),'ut',_0x0985('0x61'))[_0x0985('0x23')](_0x0985('0x62'),_0x478b8a[_0x0985('0x38')]['id']);for(var _0x23552a=0x0;_0x23552a<_0x25f555['length'];_0x23552a+=0x1){let _0x1ae661=_0x25f555[_0x23552a];for(var _0x2f0ccd=0x0;_0x2f0ccd<_0x1ae661[_0x0985('0x54')][_0x0985('0x3a')];_0x2f0ccd+=0x1){let _0x284516=_0x1ae661[_0x0985('0x54')][_0x2f0ccd];var _0x32e60a=_0x41dfb0[_0x0985('0x63')]();_0x32e60a[_0x0985('0x23')](_0x0985('0x64'),_0x284516['id']);_0x52f7be['push'](db['sequelize'][_0x0985('0x29')](_0x32e60a[_0x0985('0x65')](),{'type':db[_0x0985('0x55')]['QueryTypes'][_0x0985('0x66')]})[_0x0985('0x15')](function(_0x1f626a){if(_0x1f626a[_0x0985('0x3a')]===0x1){return _0x284516['id'];}else{var _0x24d417=_[_0x0985('0x67')](_[_0x0985('0x1d')](_0x1f626a,_0x0985('0x68')),function(_0x31b9d4){return _[_0x0985('0x69')](_0x45d204,_0x31b9d4);});if(_0x24d417){return _0x284516['id'];}}}));}}return BPromise[_0x0985('0x6a')](_0x52f7be)[_0x0985('0x15')](function(_0x5b955f){_0x3707db=_(_0x3707db)[_0x0985('0x6b')](_0x5b955f)[_0x0985('0x6c')]()[_0x0985('0x6d')]();return db[_0x0985('0x1e')][_0x0985('0x30')]({'where':{'id':_0x478b8a[_0x0985('0x38')]['id']}})[_0x0985('0x15')](function(_0x7aa633){return db[_0x0985('0x55')][_0x0985('0x6e')](function(_0x13e56e){return _0x7aa633['removeTeams'](_0x478b8a['query']['ids'],{'transaction':_0x13e56e})['then'](function(){if(!_[_0x0985('0x6f')](_0x3707db)){return _0x7aa633[_0x0985('0x70')](_0x3707db,{'transaction':_0x13e56e});}})[_0x0985('0x15')](function(){_0x3707db[_0x0985('0x58')](function(_0x5d0a4f){socket[_0x0985('0x59')](_0x0985('0x71'),{'UserId':_0x5d0a4f,'WhatsappQueueId':_0x7aa633['id']});});});});});});})['then'](respondWithStatusCode(_0x4f4e71,null))['catch'](handleError(_0x4f4e71,null));};exports[_0x0985('0x72')]=function(_0x5b32fc,_0xf88253){return db[_0x0985('0x1e')][_0x0985('0x30')]({'where':{'id':_0x5b32fc[_0x0985('0x38')]['id']}})[_0x0985('0x15')](handleEntityNotFound(_0xf88253,null))[_0x0985('0x15')](function(_0x2e89cc){if(_0x2e89cc){return _0x2e89cc[_0x0985('0x72')](_0x5b32fc[_0x0985('0x32')][_0x0985('0x4f')],_[_0x0985('0x73')](_0x5b32fc['body'],['ids','id'])||{})['spread'](function(_0x3861dc){for(var _0x55d3cc=0x0;_0x55d3cc<_0x5b32fc[_0x0985('0x32')][_0x0985('0x4f')][_0x0985('0x3a')];_0x55d3cc+=0x1){socket[_0x0985('0x59')]('userWhatsappQueue:save',{'UserId':Number(_0x5b32fc[_0x0985('0x32')][_0x0985('0x4f')][_0x55d3cc]),'WhatsappQueueId':Number(_0x5b32fc[_0x0985('0x38')]['id'])});}return _0x3861dc;});}})[_0x0985('0x15')](respondWithResult(_0xf88253,null))['catch'](handleError(_0xf88253,null));};exports[_0x0985('0x70')]=function(_0x356a73,_0x3b6a13){return db[_0x0985('0x1e')]['find']({'where':{'id':_0x356a73['params']['id']}})[_0x0985('0x15')](handleEntityNotFound(_0x3b6a13,null))['then'](function(_0x3cf94f){if(_0x3cf94f){return _0x3cf94f[_0x0985('0x70')](_0x356a73['query']['ids'])['then'](function(){if(_['isArray'](_0x356a73[_0x0985('0x29')][_0x0985('0x4f')])){for(var _0xb03a61=0x0;_0xb03a61<_0x356a73[_0x0985('0x29')][_0x0985('0x4f')]['length'];_0xb03a61+=0x1){socket[_0x0985('0x59')]('userWhatsappQueue:remove',{'UserId':Number(_0x356a73[_0x0985('0x29')][_0x0985('0x4f')][_0xb03a61]),'WhatsappQueueId':Number(_0x356a73[_0x0985('0x38')]['id'])});}}else{socket['emit'](_0x0985('0x71'),{'UserId':Number(_0x356a73[_0x0985('0x29')][_0x0985('0x4f')]),'WhatsappQueueId':Number(_0x356a73[_0x0985('0x38')]['id'])});}});}})[_0x0985('0x15')](respondWithStatusCode(_0x3b6a13,null))['catch'](handleError(_0x3b6a13,null));};exports[_0x0985('0x74')]=function(_0x39dfd,_0x58c711){var _0x292bc0={};var _0x12d37a={};var _0x572a99;var _0x1de813;return db[_0x0985('0x1e')][_0x0985('0x4a')]({'where':{'id':_0x39dfd[_0x0985('0x38')]['id']}})[_0x0985('0x15')](handleEntityNotFound(_0x58c711,null))[_0x0985('0x15')](function(_0x4aae8e){if(_0x4aae8e){_0x572a99=_0x4aae8e;_0x12d37a[_0x0985('0x27')]=_[_0x0985('0x28')](db[_0x0985('0x42')][_0x0985('0x1f')]);_0x12d37a[_0x0985('0x29')]=_['keys'](_0x39dfd['query']);_0x12d37a[_0x0985('0x2a')]=_[_0x0985('0x2b')](_0x12d37a[_0x0985('0x27')],_0x12d37a[_0x0985('0x29')]);_0x292bc0[_0x0985('0x2c')]=_[_0x0985('0x2b')](_0x12d37a['model'],qs[_0x0985('0x2d')](_0x39dfd[_0x0985('0x29')][_0x0985('0x2d')]));_0x292bc0[_0x0985('0x2c')]=_0x292bc0['attributes'][_0x0985('0x3a')]?_0x292bc0['attributes']:_0x12d37a[_0x0985('0x27')];_0x292bc0[_0x0985('0x3c')]=qs[_0x0985('0x3d')](_0x39dfd[_0x0985('0x29')][_0x0985('0x3d')]);_0x292bc0[_0x0985('0x23')]=qs[_0x0985('0x2a')](_[_0x0985('0x3e')](_0x39dfd[_0x0985('0x29')],_0x12d37a[_0x0985('0x2a')]));if(_0x39dfd[_0x0985('0x29')][_0x0985('0x40')]){_0x292bc0[_0x0985('0x23')]=_['merge'](_0x292bc0[_0x0985('0x23')],{'$or':_['map'](_0x292bc0['attributes'],function(_0x47b28c){var _0x4c5888={};_0x4c5888[_0x47b28c]={'$like':'%'+_0x39dfd[_0x0985('0x29')][_0x0985('0x40')]+'%'};return _0x4c5888;})});}_0x292bc0=_['merge']({},_0x292bc0,_0x39dfd[_0x0985('0x2f')]);return _0x572a99[_0x0985('0x74')](_0x292bc0);}})[_0x0985('0x15')](function(_0x56e0eb){if(_0x56e0eb){_0x1de813=_0x56e0eb[_0x0985('0x3a')];if(!_0x39dfd[_0x0985('0x29')][_0x0985('0x3b')](_0x0985('0x4c'))){_0x292bc0[_0x0985('0x12')]=qs['limit'](_0x39dfd[_0x0985('0x29')][_0x0985('0x12')]);_0x292bc0[_0x0985('0xf')]=qs[_0x0985('0xf')](_0x39dfd['query'][_0x0985('0xf')]);}return _0x572a99[_0x0985('0x74')](_0x292bc0);}})[_0x0985('0x15')](function(_0x2f4be9){if(_0x2f4be9){return _0x2f4be9?{'count':_0x1de813,'rows':_0x2f4be9}:null;}})['then'](respondWithResult(_0x58c711,null))[_0x0985('0x26')](handleError(_0x58c711,null));}; \ No newline at end of file +var _0x6bf4=['sequelize','transaction','each','forEach','userWhatsappQueue:save','ids','select','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','push','QueryTypes','every','includes','all','union','compact','value','removeTeams','emit','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','pick','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','json','undefined','count','offset','limit','set','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','rawAttributes','type','key','getOptions','include','findAll','catch','show','params','model','keys','query','filters','intersection','fields','attributes','length','includeAll','merge','options','create','WhatsappQueue','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','find','userProfileId','autoAssociation','error','describe','getMembers','UserWhatsappQueue','hasOwnProperty','nolimit','order','where','WhatsappQueueId','filter','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','sort','addTeams','Agents','online','voicePause'];(function(_0x24d42a,_0x72537){var _0x2d9f0c=function(_0x109a08){while(--_0x109a08){_0x24d42a['push'](_0x24d42a['shift']());}};_0x2d9f0c(++_0x72537);}(_0x6bf4,0x106));var _0x46bf=function(_0x4bf0f7,_0x2578fc){_0x4bf0f7=_0x4bf0f7-0x0;var _0x59fcd1=_0x6bf4[_0x4bf0f7];return _0x59fcd1;};'use strict';var BPromise=require(_0x46bf('0x0'));var util=require(_0x46bf('0x1'));var _=require(_0x46bf('0x2'));var squel=require(_0x46bf('0x3'));var Redis=require('ioredis');var qs=require(_0x46bf('0x4'));var logger=require(_0x46bf('0x5'))(_0x46bf('0x6'));var config=require(_0x46bf('0x7'));var db=require(_0x46bf('0x8'))['db'];config['redis']=_[_0x46bf('0x9')](config['redis'],{'host':_0x46bf('0xa'),'port':0x18eb});var socket=require(_0x46bf('0xb'))(new Redis(config['redis']));require(_0x46bf('0xc'))['register'](socket);function respondWithStatusCode(_0x1c4f37,_0x19fa1a){_0x19fa1a=_0x19fa1a||0xcc;return function(_0x2f929e){if(_0x2f929e){return _0x1c4f37[_0x46bf('0xd')](_0x19fa1a);}return _0x1c4f37[_0x46bf('0xe')](_0x19fa1a)['end']();};}function respondWithResult(_0xb1cf93,_0x4475a5){_0x4475a5=_0x4475a5||0xc8;return function(_0x3c17a7){if(_0x3c17a7){return _0xb1cf93[_0x46bf('0xe')](_0x4475a5)[_0x46bf('0xf')](_0x3c17a7);}};}function respondWithFilteredResult(_0xea661b,_0x274bba){return function(_0x9929e7){if(_0x9929e7){var _0x24df44=typeof _0x274bba['offset']===_0x46bf('0x10')&&typeof _0x274bba['limit']===_0x46bf('0x10');var _0x1ef019=_0x9929e7[_0x46bf('0x11')];var _0x5edd57=_0x24df44?0x0:_0x274bba[_0x46bf('0x12')];var _0x34bc68=_0x24df44?_0x9929e7['count']:_0x274bba[_0x46bf('0x12')]+_0x274bba[_0x46bf('0x13')];var _0x335a8d;if(_0x34bc68>=_0x1ef019){_0x34bc68=_0x1ef019;_0x335a8d=0xc8;}else{_0x335a8d=0xce;}_0xea661b[_0x46bf('0xe')](_0x335a8d);return _0xea661b[_0x46bf('0x14')]('Content-Range',_0x5edd57+'-'+_0x34bc68+'/'+_0x1ef019)[_0x46bf('0xf')](_0x9929e7);}return null;};}function saveUpdates(_0x3a4307){return function(_0x51ad59){if(_0x51ad59){return _0x51ad59['update'](_0x3a4307)[_0x46bf('0x15')](function(_0x432a1f){return _0x432a1f;});}return null;};}function removeEntity(_0xc4559f){return function(_0x1efba7){if(_0x1efba7){return _0x1efba7[_0x46bf('0x16')]()[_0x46bf('0x15')](function(){var _0x51e4d1=_0x1efba7[_0x46bf('0x17')]({'plain':!![]});var _0x21ff06='WhatsappQueues';return db[_0x46bf('0x18')][_0x46bf('0x16')]({'where':{'type':_0x21ff06,'resourceId':_0x51e4d1['id']}})[_0x46bf('0x15')](function(){return _0x1efba7;});})['then'](function(){_0xc4559f[_0x46bf('0xe')](0xcc)[_0x46bf('0x19')]();});}};}function handleEntityNotFound(_0x225214){return function(_0x1c5eaf){if(!_0x1c5eaf){_0x225214['sendStatus'](0x194);}return _0x1c5eaf;};}function handleError(_0x4d6d77,_0x9b04e0){_0x9b04e0=_0x9b04e0||0x1f4;return function(_0x482f6b){logger['error'](_0x482f6b[_0x46bf('0x1a')]);if(_0x482f6b[_0x46bf('0x1b')]){delete _0x482f6b[_0x46bf('0x1b')];}_0x4d6d77[_0x46bf('0xe')](_0x9b04e0)[_0x46bf('0x1c')](_0x482f6b);};}exports[_0x46bf('0x1d')]=function(_0x3988a2,_0x1f7edc){var _0x5a129c={};var _0x5cd650={'count':0x0,'rows':[]};var _0x5a38dc=_[_0x46bf('0x1e')](db['WhatsappQueue'][_0x46bf('0x1f')],function(_0x2ed8f9){return{'name':_0x2ed8f9['fieldName'],'type':_0x2ed8f9[_0x46bf('0x20')][_0x46bf('0x21')]};});_0x5a129c=qs[_0x46bf('0x22')](_0x5a38dc,_0x3988a2);var _0x163f3e={'where':_0x5a129c['where']};return db['WhatsappQueue'][_0x46bf('0x11')](_0x163f3e)[_0x46bf('0x15')](function(_0x266f9f){_0x5cd650['count']=_0x266f9f;_0x5a129c[_0x46bf('0x23')]=qs[_0x46bf('0x23')](_0x3988a2['query']);return db['WhatsappQueue'][_0x46bf('0x24')](_0x5a129c);})[_0x46bf('0x15')](function(_0x99bbb4){_0x5cd650['rows']=_0x99bbb4;return _0x5cd650;})[_0x46bf('0x15')](respondWithFilteredResult(_0x1f7edc,_0x5a129c))[_0x46bf('0x25')](handleError(_0x1f7edc,null));};exports[_0x46bf('0x26')]=function(_0x49e6fe,_0x2f8c78){var _0x368bf0={'raw':!![],'where':{'id':_0x49e6fe[_0x46bf('0x27')]['id']}},_0x5818a2={};_0x5818a2[_0x46bf('0x28')]=_[_0x46bf('0x29')](db['WhatsappQueue'][_0x46bf('0x1f')]);_0x5818a2[_0x46bf('0x2a')]=_[_0x46bf('0x29')](_0x49e6fe[_0x46bf('0x2a')]);_0x5818a2[_0x46bf('0x2b')]=_['intersection'](_0x5818a2[_0x46bf('0x28')],_0x5818a2[_0x46bf('0x2a')]);_0x368bf0['attributes']=_[_0x46bf('0x2c')](_0x5818a2[_0x46bf('0x28')],qs[_0x46bf('0x2d')](_0x49e6fe['query'][_0x46bf('0x2d')]));_0x368bf0[_0x46bf('0x2e')]=_0x368bf0['attributes'][_0x46bf('0x2f')]?_0x368bf0['attributes']:_0x5818a2[_0x46bf('0x28')];if(_0x49e6fe['query'][_0x46bf('0x30')]){_0x368bf0[_0x46bf('0x23')]=[{'all':!![]}];}_0x368bf0=_[_0x46bf('0x31')]({},_0x368bf0,_0x49e6fe[_0x46bf('0x32')]);return db['WhatsappQueue']['find'](_0x368bf0)[_0x46bf('0x15')](handleEntityNotFound(_0x2f8c78,null))[_0x46bf('0x15')](respondWithResult(_0x2f8c78,null))[_0x46bf('0x25')](handleError(_0x2f8c78,null));};exports[_0x46bf('0x33')]=function(_0x180353,_0x266963){return db[_0x46bf('0x34')][_0x46bf('0x33')](_0x180353[_0x46bf('0x35')],{})[_0x46bf('0x15')](function(_0x256c0f){var _0x8be14c=_0x180353[_0x46bf('0x36')][_0x46bf('0x17')]({'plain':!![]});if(!_0x8be14c)throw new Error(_0x46bf('0x37'));if(_0x8be14c[_0x46bf('0x38')]===_0x46bf('0x36')){var _0x1691c4=_0x256c0f[_0x46bf('0x17')]({'plain':!![]});var _0x1f5481=_0x46bf('0x39');return db[_0x46bf('0x3a')][_0x46bf('0x3b')]({'where':{'name':_0x1f5481,'userProfileId':_0x8be14c[_0x46bf('0x3c')]},'raw':!![]})[_0x46bf('0x15')](function(_0x64bce9){if(_0x64bce9&&_0x64bce9[_0x46bf('0x3d')]===0x0){return db[_0x46bf('0x18')][_0x46bf('0x33')]({'name':_0x1691c4['name'],'resourceId':_0x1691c4['id'],'type':_0x64bce9[_0x46bf('0x1b')],'sectionId':_0x64bce9['id']},{})[_0x46bf('0x15')](function(){return _0x256c0f;});}else{return _0x256c0f;}})[_0x46bf('0x25')](function(_0x19c993){logger[_0x46bf('0x3e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19c993);throw _0x19c993;});}return _0x256c0f;})[_0x46bf('0x15')](respondWithResult(_0x266963,0xc9))[_0x46bf('0x25')](handleError(_0x266963,null));};exports['update']=function(_0x4a9b48,_0xd07285){if(_0x4a9b48[_0x46bf('0x35')]['id']){delete _0x4a9b48['body']['id'];}return db[_0x46bf('0x34')][_0x46bf('0x3b')]({'where':{'id':_0x4a9b48['params']['id']}})[_0x46bf('0x15')](handleEntityNotFound(_0xd07285,null))[_0x46bf('0x15')](saveUpdates(_0x4a9b48[_0x46bf('0x35')],null))[_0x46bf('0x15')](respondWithResult(_0xd07285,null))['catch'](handleError(_0xd07285,null));};exports[_0x46bf('0x16')]=function(_0x5f27d7,_0xf759aa){return db[_0x46bf('0x34')]['find']({'where':{'id':_0x5f27d7['params']['id']}})[_0x46bf('0x15')](handleEntityNotFound(_0xf759aa,null))[_0x46bf('0x15')](removeEntity(_0xf759aa,null))[_0x46bf('0x25')](handleError(_0xf759aa,null));};exports[_0x46bf('0x3f')]=function(_0xfd49db,_0x3fa853){return db['WhatsappQueue']['describe']()[_0x46bf('0x15')](respondWithResult(_0x3fa853,null))[_0x46bf('0x25')](handleError(_0x3fa853,null));};exports[_0x46bf('0x40')]=function(_0x5c24a6,_0x364206){var _0x4a50a2={'raw':!![],'where':{}},_0x3f846={},_0x5a3222;return db[_0x46bf('0x34')]['findOne']({'where':{'id':_0x5c24a6[_0x46bf('0x27')]['id']}})['then'](handleEntityNotFound(_0x364206,null))[_0x46bf('0x15')](function(_0x4821bc){if(_0x4821bc){_0x5a3222=_0x4821bc['get']({'plain':!![]});_0x3f846[_0x46bf('0x28')]=_[_0x46bf('0x29')](db[_0x46bf('0x41')][_0x46bf('0x1f')]);_0x3f846[_0x46bf('0x2a')]=_[_0x46bf('0x29')](_0x5c24a6[_0x46bf('0x2a')]);_0x3f846[_0x46bf('0x2b')]=_['intersection'](_0x3f846[_0x46bf('0x28')],_0x3f846[_0x46bf('0x2a')]);_0x4a50a2[_0x46bf('0x2e')]=_[_0x46bf('0x2c')](_0x3f846[_0x46bf('0x28')],qs[_0x46bf('0x2d')](_0x5c24a6[_0x46bf('0x2a')]['fields']));_0x4a50a2[_0x46bf('0x2e')]=_0x4a50a2[_0x46bf('0x2e')][_0x46bf('0x2f')]?_0x4a50a2[_0x46bf('0x2e')]:_0x3f846['model'];if(!_0x5c24a6[_0x46bf('0x2a')][_0x46bf('0x42')](_0x46bf('0x43'))){_0x4a50a2[_0x46bf('0x13')]=qs[_0x46bf('0x13')](_0x5c24a6[_0x46bf('0x2a')][_0x46bf('0x13')]);_0x4a50a2['offset']=qs[_0x46bf('0x12')](_0x5c24a6[_0x46bf('0x2a')][_0x46bf('0x12')]);}_0x4a50a2[_0x46bf('0x44')]=qs['sort'](_0x5c24a6[_0x46bf('0x2a')]['sort']);_0x4a50a2[_0x46bf('0x45')]=qs[_0x46bf('0x2b')](_['pick'](_0x5c24a6[_0x46bf('0x2a')],_0x3f846[_0x46bf('0x2b')]));_0x4a50a2['where'][_0x46bf('0x46')]=_0x4821bc['id'];if(_0x5c24a6[_0x46bf('0x2a')][_0x46bf('0x47')]){_0x4a50a2[_0x46bf('0x45')]=_[_0x46bf('0x31')](_0x4a50a2[_0x46bf('0x45')],{'$or':_[_0x46bf('0x1e')](_0x4a50a2[_0x46bf('0x2e')],function(_0x54059c){var _0x7568c4={};_0x7568c4[_0x54059c]={'$like':'%'+_0x5c24a6[_0x46bf('0x2a')][_0x46bf('0x47')]+'%'};return _0x7568c4;})});}_0x4a50a2=_[_0x46bf('0x31')]({},_0x4a50a2,_0x5c24a6[_0x46bf('0x32')]);return db[_0x46bf('0x41')][_0x46bf('0x24')](_0x4a50a2);}})[_0x46bf('0x15')](function(_0x551cef){if(_0x551cef){return db[_0x46bf('0x48')][_0x46bf('0x49')]({'where':{'id':_[_0x46bf('0x1e')](_0x551cef,_0x46bf('0x4a')),'role':_0x46bf('0x4b')},'attributes':['id',_0x46bf('0x1b'),_0x46bf('0x4c'),_0x46bf('0x4d'),_0x46bf('0x4e')]});}})[_0x46bf('0x15')](function(_0x3cbd1e){if(_0x3cbd1e){return{'count':_0x3cbd1e[_0x46bf('0x11')],'rows':_[_0x46bf('0x1e')](_0x3cbd1e['rows'],function(_0x195f54){return{'membername':_0x195f54[_0x46bf('0x1b')],'UserId':_0x195f54['id'],'queue_name':_0x5a3222['name'],'WhatsappQueueId':_0x5a3222['id'],'interface':util['format'](_0x46bf('0x4f'),_0x46bf('0x50'),_0x195f54[_0x46bf('0x1b')]),'penalty':0x0,'paused':_0x195f54[_0x46bf('0x4c')],'createdAt':_0x195f54['createdAt'],'updatedAt':_0x195f54['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x46bf('0x15')](respondWithFilteredResult(_0x364206,_0x4a50a2))[_0x46bf('0x25')](handleError(_0x364206,null));};exports[_0x46bf('0x51')]=function(_0x6a4a5f,_0x3d4bac){var _0x4b9251={};var _0x321ce4={};var _0x24b253;var _0xeed486;return db[_0x46bf('0x34')][_0x46bf('0x52')]({'where':{'id':_0x6a4a5f[_0x46bf('0x27')]['id']}})[_0x46bf('0x15')](handleEntityNotFound(_0x3d4bac,null))[_0x46bf('0x15')](function(_0x49364f){if(_0x49364f){_0x24b253=_0x49364f;_0x321ce4['model']=_[_0x46bf('0x29')](db[_0x46bf('0x53')][_0x46bf('0x1f')]);_0x321ce4[_0x46bf('0x2a')]=_[_0x46bf('0x29')](_0x6a4a5f[_0x46bf('0x2a')]);_0x321ce4[_0x46bf('0x2b')]=_[_0x46bf('0x2c')](_0x321ce4['model'],_0x321ce4[_0x46bf('0x2a')]);_0x4b9251['attributes']=_[_0x46bf('0x2c')](_0x321ce4[_0x46bf('0x28')],qs[_0x46bf('0x2d')](_0x6a4a5f[_0x46bf('0x2a')][_0x46bf('0x2d')]));_0x4b9251['attributes']=_0x4b9251['attributes'][_0x46bf('0x2f')]?_0x4b9251[_0x46bf('0x2e')]:_0x321ce4[_0x46bf('0x28')];_0x4b9251[_0x46bf('0x44')]=qs[_0x46bf('0x54')](_0x6a4a5f[_0x46bf('0x2a')]['sort']);_0x4b9251['where']=qs[_0x46bf('0x2b')](_['pick'](_0x6a4a5f[_0x46bf('0x2a')],_0x321ce4['filters']));if(_0x6a4a5f[_0x46bf('0x2a')][_0x46bf('0x47')]){_0x4b9251[_0x46bf('0x45')]=_[_0x46bf('0x31')](_0x4b9251[_0x46bf('0x45')],{'$or':_[_0x46bf('0x1e')](_0x4b9251[_0x46bf('0x2e')],function(_0x3b9fa1){var _0x1b29d7={};_0x1b29d7[_0x3b9fa1]={'$like':'%'+_0x6a4a5f[_0x46bf('0x2a')][_0x46bf('0x47')]+'%'};return _0x1b29d7;})});}_0x4b9251=_[_0x46bf('0x31')]({},_0x4b9251,_0x6a4a5f[_0x46bf('0x32')]);return _0x24b253[_0x46bf('0x51')](_0x4b9251);}})[_0x46bf('0x15')](function(_0xf817f4){if(_0xf817f4){_0xeed486=_0xf817f4[_0x46bf('0x2f')];if(!_0x6a4a5f['query']['hasOwnProperty']('nolimit')){_0x4b9251[_0x46bf('0x13')]=qs['limit'](_0x6a4a5f[_0x46bf('0x2a')][_0x46bf('0x13')]);_0x4b9251[_0x46bf('0x12')]=qs['offset'](_0x6a4a5f['query'][_0x46bf('0x12')]);}return _0x24b253[_0x46bf('0x51')](_0x4b9251);}})[_0x46bf('0x15')](function(_0x346ea8){if(_0x346ea8){return _0x346ea8?{'count':_0xeed486,'rows':_0x346ea8}:null;}})[_0x46bf('0x15')](respondWithResult(_0x3d4bac,null))['catch'](handleError(_0x3d4bac,null));};exports[_0x46bf('0x55')]=function(_0x86741e,_0x52a736){var _0x492959=_0x86741e[_0x46bf('0x35')]['ids'];return db[_0x46bf('0x53')][_0x46bf('0x24')]({'where':{'id':_0x492959},'attributes':['id'],'include':[{'model':db[_0x46bf('0x48')],'as':_0x46bf('0x56'),'attributes':['id',_0x46bf('0x1b'),_0x46bf('0x57'),_0x46bf('0x58'),'interface'],'raw':!![]}]})['then'](function(_0xcf9697){if(_0xcf9697){var _0x3fbbf5=_['flatMap'](_0xcf9697,function(_0x453c0c){var _0x5e54c0=_0x453c0c[_0x46bf('0x17')]({'plain':!![]});return _0x5e54c0[_0x46bf('0x56')];});return db['WhatsappQueue'][_0x46bf('0x3b')]({'where':{'id':_0x86741e[_0x46bf('0x27')]['id']}})[_0x46bf('0x15')](function(_0x163dc6){return db[_0x46bf('0x59')][_0x46bf('0x5a')](function(_0x167c0d){return _0x163dc6[_0x46bf('0x55')](_0x492959,{'transaction':_0x167c0d})[_0x46bf('0x15')](function(){return BPromise[_0x46bf('0x5b')](_0x3fbbf5,function(_0x13cc4d){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x13cc4d['id'],'WhatsappQueueId':_0x86741e[_0x46bf('0x27')]['id']},'transaction':_0x167c0d});});})[_0x46bf('0x15')](function(){_0x3fbbf5[_0x46bf('0x5c')](function(_0x172cbb){socket['emit'](_0x46bf('0x5d'),{'UserId':_0x172cbb['id'],'WhatsappQueueId':_0x163dc6['id']});});});});});}})[_0x46bf('0x15')](respondWithStatusCode(_0x52a736,null))[_0x46bf('0x25')](handleError(_0x52a736,null));};exports['removeTeams']=function(_0x316db8,_0x5df50d){return db[_0x46bf('0x53')][_0x46bf('0x24')]({'where':{'id':_0x316db8['query'][_0x46bf('0x5e')]},'attributes':['id'],'include':[{'model':db[_0x46bf('0x48')],'as':_0x46bf('0x56'),'attributes':['id'],'raw':!![]}]})[_0x46bf('0x15')](handleEntityNotFound(_0x5df50d,null))[_0x46bf('0x15')](function(_0x394dd2){var _0x395b0c=_[_0x46bf('0x1e')](_0x394dd2,'id');var _0x55d89d=[];var _0x1afd00=[];var _0x22d72b=squel[_0x46bf('0x5f')]();_0x22d72b[_0x46bf('0x60')](_0x46bf('0x61'))['from']('team_has_whatsapp_queues','tq')[_0x46bf('0x62')]('user_has_teams','ut',_0x46bf('0x63'))[_0x46bf('0x45')]('WhatsappQueueId\x20=\x20?',_0x316db8[_0x46bf('0x27')]['id']);for(var _0x2979c2=0x0;_0x2979c2<_0x394dd2[_0x46bf('0x2f')];_0x2979c2+=0x1){let _0x502156=_0x394dd2[_0x2979c2];for(var _0x12264f=0x0;_0x12264f<_0x502156[_0x46bf('0x56')][_0x46bf('0x2f')];_0x12264f+=0x1){let _0xc43991=_0x502156[_0x46bf('0x56')][_0x12264f];var _0x1d38bc=_0x22d72b['clone']();_0x1d38bc[_0x46bf('0x45')]('ut.UserId\x20=\x20?',_0xc43991['id']);_0x1afd00[_0x46bf('0x64')](db[_0x46bf('0x59')][_0x46bf('0x2a')](_0x1d38bc['toString'](),{'type':db[_0x46bf('0x59')][_0x46bf('0x65')]['SELECT']})[_0x46bf('0x15')](function(_0x5ef4f6){if(_0x5ef4f6[_0x46bf('0x2f')]===0x1){return _0xc43991['id'];}else{var _0x3c0250=_[_0x46bf('0x66')](_[_0x46bf('0x1e')](_0x5ef4f6,'TeamId'),function(_0x8a4747){return _[_0x46bf('0x67')](_0x395b0c,_0x8a4747);});if(_0x3c0250){return _0xc43991['id'];}}}));}}return BPromise[_0x46bf('0x68')](_0x1afd00)[_0x46bf('0x15')](function(_0x501420){_0x55d89d=_(_0x55d89d)[_0x46bf('0x69')](_0x501420)[_0x46bf('0x6a')]()[_0x46bf('0x6b')]();return db[_0x46bf('0x34')][_0x46bf('0x3b')]({'where':{'id':_0x316db8[_0x46bf('0x27')]['id']}})[_0x46bf('0x15')](function(_0x2a7b6d){return db[_0x46bf('0x59')][_0x46bf('0x5a')](function(_0x42027f){return _0x2a7b6d[_0x46bf('0x6c')](_0x316db8[_0x46bf('0x2a')][_0x46bf('0x5e')],{'transaction':_0x42027f})[_0x46bf('0x15')](function(){if(!_['isEmpty'](_0x55d89d)){return _0x2a7b6d['removeAgents'](_0x55d89d,{'transaction':_0x42027f});}})[_0x46bf('0x15')](function(){_0x55d89d['forEach'](function(_0x42f056){socket[_0x46bf('0x6d')](_0x46bf('0x6e'),{'UserId':_0x42f056,'WhatsappQueueId':_0x2a7b6d['id']});});});});});});})['then'](respondWithStatusCode(_0x5df50d,null))[_0x46bf('0x25')](handleError(_0x5df50d,null));};exports['addAgents']=function(_0x370e62,_0x16621d){return db['WhatsappQueue'][_0x46bf('0x3b')]({'where':{'id':_0x370e62[_0x46bf('0x27')]['id']}})[_0x46bf('0x15')](handleEntityNotFound(_0x16621d,null))[_0x46bf('0x15')](function(_0x3df78b){if(_0x3df78b){return _0x3df78b[_0x46bf('0x6f')](_0x370e62[_0x46bf('0x35')][_0x46bf('0x5e')],_[_0x46bf('0x70')](_0x370e62[_0x46bf('0x35')],[_0x46bf('0x5e'),'id'])||{})[_0x46bf('0x71')](function(_0x14a16a){for(var _0x34b698=0x0;_0x34b698<_0x370e62[_0x46bf('0x35')][_0x46bf('0x5e')][_0x46bf('0x2f')];_0x34b698+=0x1){socket[_0x46bf('0x6d')](_0x46bf('0x5d'),{'UserId':Number(_0x370e62['body'][_0x46bf('0x5e')][_0x34b698]),'WhatsappQueueId':Number(_0x370e62['params']['id'])});}return _0x14a16a;});}})[_0x46bf('0x15')](respondWithResult(_0x16621d,null))[_0x46bf('0x25')](handleError(_0x16621d,null));};exports['removeAgents']=function(_0x85e5d,_0x231b0d){return db['WhatsappQueue'][_0x46bf('0x3b')]({'where':{'id':_0x85e5d[_0x46bf('0x27')]['id']}})[_0x46bf('0x15')](handleEntityNotFound(_0x231b0d,null))[_0x46bf('0x15')](function(_0x5600f2){if(_0x5600f2){return _0x5600f2['removeAgents'](_0x85e5d[_0x46bf('0x2a')]['ids'])[_0x46bf('0x15')](function(){if(_[_0x46bf('0x72')](_0x85e5d['query'][_0x46bf('0x5e')])){for(var _0x5f1e6e=0x0;_0x5f1e6e<_0x85e5d[_0x46bf('0x2a')]['ids'][_0x46bf('0x2f')];_0x5f1e6e+=0x1){socket[_0x46bf('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x85e5d[_0x46bf('0x2a')][_0x46bf('0x5e')][_0x5f1e6e]),'WhatsappQueueId':Number(_0x85e5d[_0x46bf('0x27')]['id'])});}}else{socket[_0x46bf('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x85e5d[_0x46bf('0x2a')][_0x46bf('0x5e')]),'WhatsappQueueId':Number(_0x85e5d[_0x46bf('0x27')]['id'])});}});}})[_0x46bf('0x15')](respondWithStatusCode(_0x231b0d,null))['catch'](handleError(_0x231b0d,null));};exports[_0x46bf('0x73')]=function(_0x1b8d6c,_0x482f39){var _0x5ce04e={};var _0x1d4216={};var _0x19edfb;var _0x50a3f2;return db[_0x46bf('0x34')]['findOne']({'where':{'id':_0x1b8d6c['params']['id']}})[_0x46bf('0x15')](handleEntityNotFound(_0x482f39,null))[_0x46bf('0x15')](function(_0x3e0d60){if(_0x3e0d60){_0x19edfb=_0x3e0d60;_0x1d4216['model']=_[_0x46bf('0x29')](db[_0x46bf('0x48')][_0x46bf('0x1f')]);_0x1d4216[_0x46bf('0x2a')]=_[_0x46bf('0x29')](_0x1b8d6c[_0x46bf('0x2a')]);_0x1d4216[_0x46bf('0x2b')]=_[_0x46bf('0x2c')](_0x1d4216[_0x46bf('0x28')],_0x1d4216[_0x46bf('0x2a')]);_0x5ce04e[_0x46bf('0x2e')]=_[_0x46bf('0x2c')](_0x1d4216[_0x46bf('0x28')],qs[_0x46bf('0x2d')](_0x1b8d6c[_0x46bf('0x2a')][_0x46bf('0x2d')]));_0x5ce04e[_0x46bf('0x2e')]=_0x5ce04e[_0x46bf('0x2e')][_0x46bf('0x2f')]?_0x5ce04e[_0x46bf('0x2e')]:_0x1d4216['model'];_0x5ce04e['order']=qs['sort'](_0x1b8d6c[_0x46bf('0x2a')][_0x46bf('0x54')]);_0x5ce04e[_0x46bf('0x45')]=qs[_0x46bf('0x2b')](_[_0x46bf('0x74')](_0x1b8d6c[_0x46bf('0x2a')],_0x1d4216[_0x46bf('0x2b')]));if(_0x1b8d6c['query']['filter']){_0x5ce04e['where']=_[_0x46bf('0x31')](_0x5ce04e[_0x46bf('0x45')],{'$or':_[_0x46bf('0x1e')](_0x5ce04e[_0x46bf('0x2e')],function(_0x53b8dc){var _0x2f4a7a={};_0x2f4a7a[_0x53b8dc]={'$like':'%'+_0x1b8d6c['query'][_0x46bf('0x47')]+'%'};return _0x2f4a7a;})});}_0x5ce04e=_[_0x46bf('0x31')]({},_0x5ce04e,_0x1b8d6c[_0x46bf('0x32')]);return _0x19edfb[_0x46bf('0x73')](_0x5ce04e);}})[_0x46bf('0x15')](function(_0x4f5acc){if(_0x4f5acc){_0x50a3f2=_0x4f5acc[_0x46bf('0x2f')];if(!_0x1b8d6c['query'][_0x46bf('0x42')]('nolimit')){_0x5ce04e[_0x46bf('0x13')]=qs['limit'](_0x1b8d6c[_0x46bf('0x2a')][_0x46bf('0x13')]);_0x5ce04e[_0x46bf('0x12')]=qs[_0x46bf('0x12')](_0x1b8d6c['query'][_0x46bf('0x12')]);}return _0x19edfb['getAgents'](_0x5ce04e);}})['then'](function(_0x22fad6){if(_0x22fad6){return _0x22fad6?{'count':_0x50a3f2,'rows':_0x22fad6}:null;}})[_0x46bf('0x15')](respondWithResult(_0x482f39,null))[_0x46bf('0x25')](handleError(_0x482f39,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 7b7b0cb..1d23609 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 _0x3c53=['hasOwnProperty','hook','exports','events','WhatsappQueue','setMaxListeners','update','emit'];(function(_0x5b8dea,_0x289a9e){var _0x88c89=function(_0x4ade6e){while(--_0x4ade6e){_0x5b8dea['push'](_0x5b8dea['shift']());}};_0x88c89(++_0x289a9e);}(_0x3c53,0x163));var _0x33c5=function(_0x316297,_0x348e82){_0x316297=_0x316297-0x0;var _0x1dcc78=_0x3c53[_0x316297];return _0x1dcc78;};'use strict';var EventEmitter=require(_0x33c5('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x33c5('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x33c5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x33c5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x38b84b){return function(_0x1b8742,_0x4df7d9,_0x4e3ce6){WhatsappQueueEvents[_0x33c5('0x4')](_0x38b84b+':'+_0x1b8742['id'],_0x1b8742);WhatsappQueueEvents['emit'](_0x38b84b,_0x1b8742);_0x4e3ce6(null);};}for(var e in events){if(events[_0x33c5('0x5')](e)){var event=events[e];WhatsappQueue[_0x33c5('0x6')](e,emitEvent(event));}}module[_0x33c5('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xc048=['remove','emit','hasOwnProperty','hook','events','WhatsappQueue','setMaxListeners','save'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xc048,0xf4));var _0x8c04=function(_0x5ef98d,_0x2e4452){_0x5ef98d=_0x5ef98d-0x0;var _0x1c50a3=_0xc048[_0x5ef98d];return _0x1c50a3;};'use strict';var EventEmitter=require(_0x8c04('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x8c04('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8c04('0x2')](0x0);var events={'afterCreate':_0x8c04('0x3'),'afterUpdate':'update','afterDestroy':_0x8c04('0x4')};function emitEvent(_0x50c4d2){return function(_0x2c8064,_0x2c166f,_0x1f659b){WhatsappQueueEvents[_0x8c04('0x5')](_0x50c4d2+':'+_0x2c8064['id'],_0x2c8064);WhatsappQueueEvents[_0x8c04('0x5')](_0x50c4d2,_0x2c8064);_0x1f659b(null);};}for(var e in events){if(events[_0x8c04('0x6')](e)){var event=events[e];WhatsappQueue[_0x8c04('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 1637a5f..7353a4f 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 _0xb7b4=['api','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger'];(function(_0x36c87d,_0x2ab247){var _0x54dc55=function(_0x2b4112){while(--_0x2b4112){_0x36c87d['push'](_0x36c87d['shift']());}};_0x54dc55(++_0x2ab247);}(_0xb7b4,0x150));var _0x4b7b=function(_0x10971c,_0x4286dd){_0x10971c=_0x10971c-0x0;var _0x3e579f=_0xb7b4[_0x10971c];return _0x3e579f;};'use strict';var _=require(_0x4b7b('0x0'));var util=require('util');var logger=require(_0x4b7b('0x1'))(_0x4b7b('0x2'));var moment=require(_0x4b7b('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b7b('0x4'));var fs=require('fs');var path=require(_0x4b7b('0x5'));var rimraf=require(_0x4b7b('0x6'));var config=require(_0x4b7b('0x7'));var attributes=require(_0x4b7b('0x8'));module[_0x4b7b('0x9')]=function(_0x38bbd9,_0x4b8df9){return _0x38bbd9[_0x4b7b('0xa')](_0x4b7b('0xb'),attributes,{'tableName':_0x4b7b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb9d=['WhatsappQueue','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','define'];(function(_0x150397,_0x258581){var _0x5cadab=function(_0x3052d6){while(--_0x3052d6){_0x150397['push'](_0x150397['shift']());}};_0x5cadab(++_0x258581);}(_0xdb9d,0x6f));var _0xddb9=function(_0x42cc1f,_0xe9eb20){_0x42cc1f=_0x42cc1f-0x0;var _0x175df5=_0xdb9d[_0x42cc1f];return _0x175df5;};'use strict';var _=require(_0xddb9('0x0'));var util=require(_0xddb9('0x1'));var logger=require(_0xddb9('0x2'))(_0xddb9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xddb9('0x4'));var fs=require('fs');var path=require(_0xddb9('0x5'));var rimraf=require('rimraf');var config=require(_0xddb9('0x6'));var attributes=require(_0xddb9('0x7'));module[_0xddb9('0x8')]=function(_0x2eb778,_0x447d25){return _0x2eb778[_0xddb9('0x9')](_0xddb9('0xa'),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 e9429d0..6b3791e 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 _0x72bc=['limit','include','map','model','attributes','then','catch','ShowWhatsappQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x72bc,0xa5));var _0xc72b=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x72bc[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');var util=require(_0xc72b('0x0'));var moment=require(_0xc72b('0x1'));var BPromise=require('bluebird');var rs=require(_0xc72b('0x2'));var fs=require('fs');var Redis=require(_0xc72b('0x3'));var db=require(_0xc72b('0x4'))['db'];var utils=require(_0xc72b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc72b('0x6'));var jayson=require(_0xc72b('0x7'));var client=jayson[_0xc72b('0x8')]['http']({'port':0x232a});config[_0xc72b('0x9')]=_[_0xc72b('0xa')](config[_0xc72b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc72b('0xb'))(new Redis(config[_0xc72b('0x9')]));require(_0xc72b('0xc'))[_0xc72b('0xd')](socket);function respondWithRpcPromise(_0xd6ff4b,_0x3ac496,_0x119120){return new BPromise(function(_0x2ad75e,_0x140e3a){return client[_0xc72b('0xe')](_0xd6ff4b,_0x119120)['then'](function(_0x3295eb){logger[_0xc72b('0xf')](_0xc72b('0x10'),_0x3ac496,'request\x20sent');logger[_0xc72b('0x11')](_0xc72b('0x12'),_0x3ac496,_0xc72b('0x13'),JSON[_0xc72b('0x14')](_0x3295eb));if(_0x3295eb[_0xc72b('0x15')]){if(_0x3295eb[_0xc72b('0x15')][_0xc72b('0x16')]===0x1f4){logger['error'](_0xc72b('0x10'),_0x3ac496,_0x3295eb['error'][_0xc72b('0x17')]);return _0x140e3a(_0x3295eb[_0xc72b('0x15')][_0xc72b('0x17')]);}logger['error'](_0xc72b('0x10'),_0x3ac496,_0x3295eb['error'][_0xc72b('0x17')]);return _0x2ad75e(_0x3295eb[_0xc72b('0x15')][_0xc72b('0x17')]);}else{logger[_0xc72b('0xf')](_0xc72b('0x10'),_0x3ac496,_0xc72b('0x13'));_0x2ad75e(_0x3295eb['result'][_0xc72b('0x17')]);}})['catch'](function(_0x95376d){logger[_0xc72b('0x15')](_0xc72b('0x10'),_0x3ac496,_0x95376d);_0x140e3a(_0x95376d);});});}exports[_0xc72b('0x18')]=function(_0x462cdd){var _0x46bd9a=this;return new Promise(function(_0x2299e2,_0x54d538){return db[_0xc72b('0x19')][_0xc72b('0x1a')]({'raw':_0x462cdd[_0xc72b('0x1b')]?_0x462cdd[_0xc72b('0x1b')][_0xc72b('0x1c')]===undefined?!![]:![]:!![],'where':_0x462cdd[_0xc72b('0x1b')]?_0x462cdd[_0xc72b('0x1b')][_0xc72b('0x1d')]||null:null,'attributes':_0x462cdd['options']?_0x462cdd[_0xc72b('0x1b')]['attributes']||null:null,'limit':_0x462cdd[_0xc72b('0x1b')]?_0x462cdd[_0xc72b('0x1b')][_0xc72b('0x1e')]||null:null,'include':_0x462cdd[_0xc72b('0x1b')]?_0x462cdd[_0xc72b('0x1b')][_0xc72b('0x1f')]?_[_0xc72b('0x20')](_0x462cdd[_0xc72b('0x1b')][_0xc72b('0x1f')],function(_0x3ed069){return{'model':db[_0x3ed069[_0xc72b('0x21')]],'as':_0x3ed069['as'],'attributes':_0x3ed069[_0xc72b('0x22')],'include':_0x3ed069[_0xc72b('0x1f')]?_[_0xc72b('0x20')](_0x3ed069[_0xc72b('0x1f')],function(_0x3cf1f4){return{'model':db[_0x3cf1f4[_0xc72b('0x21')]],'as':_0x3cf1f4['as'],'attributes':_0x3cf1f4[_0xc72b('0x22')],'include':_0x3cf1f4[_0xc72b('0x1f')]?_['map'](_0x3cf1f4[_0xc72b('0x1f')],function(_0x2b3034){return{'model':db[_0x2b3034['model']],'as':_0x2b3034['as'],'attributes':_0x2b3034[_0xc72b('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc72b('0x23')](function(_0x572908){logger[_0xc72b('0xf')](_0xc72b('0x18'),_0x462cdd);logger['debug'](_0xc72b('0x18'),_0x462cdd,JSON['stringify'](_0x572908));_0x2299e2(_0x572908);})[_0xc72b('0x24')](function(_0x4d1bf5){logger[_0xc72b('0x15')](_0xc72b('0x18'),_0x4d1bf5[_0xc72b('0x17')],_0x462cdd);_0x54d538(_0x46bd9a[_0xc72b('0x15')](0x1f4,_0x4d1bf5[_0xc72b('0x17')]));});});};exports[_0xc72b('0x25')]=function(_0x32f43e){var _0x6772b3=this;return new Promise(function(_0x3ad9db,_0x45a6d7){return db[_0xc72b('0x19')][_0xc72b('0x26')]({'raw':_0x32f43e[_0xc72b('0x1b')]?_0x32f43e[_0xc72b('0x1b')][_0xc72b('0x1c')]===undefined?!![]:![]:!![],'where':_0x32f43e['options']?_0x32f43e[_0xc72b('0x1b')][_0xc72b('0x1d')]||null:null,'attributes':_0x32f43e[_0xc72b('0x1b')]?_0x32f43e[_0xc72b('0x1b')][_0xc72b('0x22')]||null:null,'include':_0x32f43e[_0xc72b('0x1b')]?_0x32f43e['options'][_0xc72b('0x1f')]?_['map'](_0x32f43e['options'][_0xc72b('0x1f')],function(_0x58cf39){return{'model':db[_0x58cf39[_0xc72b('0x21')]],'as':_0x58cf39['as'],'attributes':_0x58cf39[_0xc72b('0x22')],'include':_0x58cf39[_0xc72b('0x1f')]?_[_0xc72b('0x20')](_0x58cf39[_0xc72b('0x1f')],function(_0x82f142){return{'model':db[_0x82f142['model']],'as':_0x82f142['as'],'attributes':_0x82f142[_0xc72b('0x22')],'include':_0x82f142['include']?_[_0xc72b('0x20')](_0x82f142['include'],function(_0x301ad3){return{'model':db[_0x301ad3[_0xc72b('0x21')]],'as':_0x301ad3['as'],'attributes':_0x301ad3[_0xc72b('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc72b('0x23')](function(_0x44bff7){logger[_0xc72b('0xf')](_0xc72b('0x25'),_0x32f43e);logger[_0xc72b('0x11')](_0xc72b('0x25'),_0x32f43e,JSON['stringify'](_0x44bff7));_0x3ad9db(_0x44bff7);})['catch'](function(_0x22b820){logger[_0xc72b('0x15')]('ShowWhatsappQueue',_0x22b820['message'],_0x32f43e);_0x45a6d7(_0x6772b3[_0xc72b('0x15')](0x1f4,_0x22b820[_0xc72b('0x17')]));});});}; \ No newline at end of file +var _0xe0a7=['attributes','model','then','ShowWhatsappQueue','find','where','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','include','map'];(function(_0x991413,_0x2faf1b){var _0x48c190=function(_0x35f03f){while(--_0x35f03f){_0x991413['push'](_0x991413['shift']());}};_0x48c190(++_0x2faf1b);}(_0xe0a7,0xf0));var _0x7e0a=function(_0x2b4599,_0x56b740){_0x2b4599=_0x2b4599-0x0;var _0xad7159=_0xe0a7[_0x2b4599];return _0xad7159;};'use strict';var _=require('lodash');var util=require(_0x7e0a('0x0'));var moment=require(_0x7e0a('0x1'));var BPromise=require(_0x7e0a('0x2'));var rs=require(_0x7e0a('0x3'));var fs=require('fs');var Redis=require(_0x7e0a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e0a('0x5'));var logger=require(_0x7e0a('0x6'))('rpc');var config=require(_0x7e0a('0x7'));var jayson=require(_0x7e0a('0x8'));var client=jayson[_0x7e0a('0x9')]['http']({'port':0x232a});config[_0x7e0a('0xa')]=_[_0x7e0a('0xb')](config[_0x7e0a('0xa')],{'host':_0x7e0a('0xc'),'port':0x18eb});var socket=require(_0x7e0a('0xd'))(new Redis(config[_0x7e0a('0xa')]));require(_0x7e0a('0xe'))[_0x7e0a('0xf')](socket);function respondWithRpcPromise(_0x5cc3f2,_0x448905,_0x90b96){return new BPromise(function(_0x30b85d,_0x39cc4b){return client[_0x7e0a('0x10')](_0x5cc3f2,_0x90b96)['then'](function(_0x1207b7){logger[_0x7e0a('0x11')](_0x7e0a('0x12'),_0x448905,_0x7e0a('0x13'));logger[_0x7e0a('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x448905,'request\x20sent',JSON[_0x7e0a('0x15')](_0x1207b7));if(_0x1207b7[_0x7e0a('0x16')]){if(_0x1207b7[_0x7e0a('0x16')][_0x7e0a('0x17')]===0x1f4){logger[_0x7e0a('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x448905,_0x1207b7['error'][_0x7e0a('0x18')]);return _0x39cc4b(_0x1207b7['error'][_0x7e0a('0x18')]);}logger[_0x7e0a('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x448905,_0x1207b7['error'][_0x7e0a('0x18')]);return _0x30b85d(_0x1207b7['error']['message']);}else{logger[_0x7e0a('0x11')](_0x7e0a('0x12'),_0x448905,'request\x20sent');_0x30b85d(_0x1207b7[_0x7e0a('0x19')][_0x7e0a('0x18')]);}})[_0x7e0a('0x1a')](function(_0x33879a){logger[_0x7e0a('0x16')](_0x7e0a('0x12'),_0x448905,_0x33879a);_0x39cc4b(_0x33879a);});});}exports[_0x7e0a('0x1b')]=function(_0x5ee42f){var _0x1a3f50=this;return new Promise(function(_0x46487d,_0x256f70){return db[_0x7e0a('0x1c')]['findAll']({'raw':_0x5ee42f[_0x7e0a('0x1d')]?_0x5ee42f[_0x7e0a('0x1d')][_0x7e0a('0x1e')]===undefined?!![]:![]:!![],'where':_0x5ee42f[_0x7e0a('0x1d')]?_0x5ee42f['options']['where']||null:null,'attributes':_0x5ee42f[_0x7e0a('0x1d')]?_0x5ee42f['options']['attributes']||null:null,'limit':_0x5ee42f['options']?_0x5ee42f['options']['limit']||null:null,'include':_0x5ee42f[_0x7e0a('0x1d')]?_0x5ee42f[_0x7e0a('0x1d')][_0x7e0a('0x1f')]?_[_0x7e0a('0x20')](_0x5ee42f[_0x7e0a('0x1d')]['include'],function(_0x50f506){return{'model':db[_0x50f506['model']],'as':_0x50f506['as'],'attributes':_0x50f506[_0x7e0a('0x21')],'include':_0x50f506[_0x7e0a('0x1f')]?_[_0x7e0a('0x20')](_0x50f506[_0x7e0a('0x1f')],function(_0x177f07){return{'model':db[_0x177f07[_0x7e0a('0x22')]],'as':_0x177f07['as'],'attributes':_0x177f07[_0x7e0a('0x21')],'include':_0x177f07[_0x7e0a('0x1f')]?_['map'](_0x177f07[_0x7e0a('0x1f')],function(_0x14eb08){return{'model':db[_0x14eb08[_0x7e0a('0x22')]],'as':_0x14eb08['as'],'attributes':_0x14eb08['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e0a('0x23')](function(_0x2eb335){logger['info'](_0x7e0a('0x1b'),_0x5ee42f);logger[_0x7e0a('0x14')](_0x7e0a('0x1b'),_0x5ee42f,JSON[_0x7e0a('0x15')](_0x2eb335));_0x46487d(_0x2eb335);})[_0x7e0a('0x1a')](function(_0xf7416a){logger[_0x7e0a('0x16')](_0x7e0a('0x1b'),_0xf7416a['message'],_0x5ee42f);_0x256f70(_0x1a3f50[_0x7e0a('0x16')](0x1f4,_0xf7416a['message']));});});};exports[_0x7e0a('0x24')]=function(_0x20af0b){var _0x1c5036=this;return new Promise(function(_0x35b070,_0x33952d){return db[_0x7e0a('0x1c')][_0x7e0a('0x25')]({'raw':_0x20af0b[_0x7e0a('0x1d')]?_0x20af0b[_0x7e0a('0x1d')][_0x7e0a('0x1e')]===undefined?!![]:![]:!![],'where':_0x20af0b[_0x7e0a('0x1d')]?_0x20af0b['options'][_0x7e0a('0x26')]||null:null,'attributes':_0x20af0b[_0x7e0a('0x1d')]?_0x20af0b[_0x7e0a('0x1d')][_0x7e0a('0x21')]||null:null,'include':_0x20af0b['options']?_0x20af0b[_0x7e0a('0x1d')][_0x7e0a('0x1f')]?_[_0x7e0a('0x20')](_0x20af0b[_0x7e0a('0x1d')][_0x7e0a('0x1f')],function(_0x866062){return{'model':db[_0x866062[_0x7e0a('0x22')]],'as':_0x866062['as'],'attributes':_0x866062[_0x7e0a('0x21')],'include':_0x866062[_0x7e0a('0x1f')]?_[_0x7e0a('0x20')](_0x866062['include'],function(_0xca9f8){return{'model':db[_0xca9f8[_0x7e0a('0x22')]],'as':_0xca9f8['as'],'attributes':_0xca9f8[_0x7e0a('0x21')],'include':_0xca9f8['include']?_[_0x7e0a('0x20')](_0xca9f8['include'],function(_0x81f849){return{'model':db[_0x81f849['model']],'as':_0x81f849['as'],'attributes':_0x81f849[_0x7e0a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7e0a('0x23')](function(_0x535027){logger[_0x7e0a('0x11')](_0x7e0a('0x24'),_0x20af0b);logger[_0x7e0a('0x14')](_0x7e0a('0x24'),_0x20af0b,JSON[_0x7e0a('0x15')](_0x535027));_0x35b070(_0x535027);})[_0x7e0a('0x1a')](function(_0x54ae43){logger[_0x7e0a('0x16')](_0x7e0a('0x24'),_0x54ae43['message'],_0x20af0b);_0x33952d(_0x1c5036[_0x7e0a('0x16')](0x1f4,_0x54ae43[_0x7e0a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index c473e21..9f1e62e 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 _0xfcfb=['remove','update','emit','removeListener','register','./whatsappQueue.events'];(function(_0x293490,_0x389352){var _0x240e5f=function(_0x33805d){while(--_0x33805d){_0x293490['push'](_0x293490['shift']());}};_0x240e5f(++_0x389352);}(_0xfcfb,0x173));var _0xbfcf=function(_0x2ab5d7,_0x1243d9){_0x2ab5d7=_0x2ab5d7-0x0;var _0x516388=_0xfcfb[_0x2ab5d7];return _0x516388;};'use strict';var WhatsappQueueEvents=require(_0xbfcf('0x0'));var events=['save',_0xbfcf('0x1'),_0xbfcf('0x2')];function createListener(_0x234ed9,_0x383bd1){return function(_0x7d30f){_0x383bd1[_0xbfcf('0x3')](_0x234ed9,_0x7d30f);};}function removeListener(_0x1a16ed,_0x4c3e3c){return function(){WhatsappQueueEvents[_0xbfcf('0x4')](_0x1a16ed,_0x4c3e3c);};}exports[_0xbfcf('0x5')]=function(_0x46676f){for(var _0x4846ad=0x0,_0x2dc8eb=events['length'];_0x4846ad<_0x2dc8eb;_0x4846ad++){var _0x7fdd9a=events[_0x4846ad];var _0x85f47e=createListener('whatsappQueue:'+_0x7fdd9a,_0x46676f);WhatsappQueueEvents['on'](_0x7fdd9a,_0x85f47e);}}; \ No newline at end of file +var _0xebbe=['emit','length','whatsappQueue:','./whatsappQueue.events','save','update'];(function(_0x1cabbc,_0x300e7e){var _0x5c4427=function(_0x3e78d1){while(--_0x3e78d1){_0x1cabbc['push'](_0x1cabbc['shift']());}};_0x5c4427(++_0x300e7e);}(_0xebbe,0x1d1));var _0xeebb=function(_0x2a5840,_0x86c865){_0x2a5840=_0x2a5840-0x0;var _0x4933d2=_0xebbe[_0x2a5840];return _0x4933d2;};'use strict';var WhatsappQueueEvents=require(_0xeebb('0x0'));var events=[_0xeebb('0x1'),'remove',_0xeebb('0x2')];function createListener(_0x2b2030,_0x5b6a11){return function(_0x187417){_0x5b6a11[_0xeebb('0x3')](_0x2b2030,_0x187417);};}function removeListener(_0x1cad78,_0x1684d4){return function(){WhatsappQueueEvents['removeListener'](_0x1cad78,_0x1684d4);};}exports['register']=function(_0x1b7b83){for(var _0x24982c=0x0,_0x3f657d=events[_0xeebb('0x4')];_0x24982c<_0x3f657d;_0x24982c++){var _0x303d74=events[_0x24982c];var _0x28bbdb=createListener(_0xeebb('0x5')+_0x303d74,_0x1b7b83);WhatsappQueueEvents['on'](_0x303d74,_0x28bbdb);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 2367193..930f90b 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 _0xd5b4=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','describe'];(function(_0x294615,_0x54f6e){var _0x60f0e=function(_0x5d2366){while(--_0x5d2366){_0x294615['push'](_0x294615['shift']());}};_0x60f0e(++_0x54f6e);}(_0xd5b4,0x12f));var _0x4d5b=function(_0x2a5c43,_0x550d45){_0x2a5c43=_0x2a5c43-0x0;var _0x14a343=_0xd5b4[_0x2a5c43];return _0x14a343;};'use strict';var multer=require(_0x4d5b('0x0'));var util=require(_0x4d5b('0x1'));var path=require(_0x4d5b('0x2'));var timeout=require(_0x4d5b('0x3'));var express=require('express');var router=express[_0x4d5b('0x4')]();var fs_extra=require(_0x4d5b('0x5'));var auth=require(_0x4d5b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4d5b('0x7'));var controller=require(_0x4d5b('0x8'));router[_0x4d5b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4d5b('0x9')]('/describe',auth[_0x4d5b('0xa')](),controller[_0x4d5b('0xb')]);router[_0x4d5b('0x9')](_0x4d5b('0xc'),auth[_0x4d5b('0xa')](),controller[_0x4d5b('0xd')]);router[_0x4d5b('0xe')]('/',auth[_0x4d5b('0xa')](),controller[_0x4d5b('0xf')]);router[_0x4d5b('0x10')](_0x4d5b('0xc'),auth['isAuthenticated'](),controller[_0x4d5b('0x11')]);router[_0x4d5b('0x12')](_0x4d5b('0xc'),auth[_0x4d5b('0xa')](),controller[_0x4d5b('0x13')]);module[_0x4d5b('0x14')]=router; \ No newline at end of file +var _0x1b68=['/:id','show','post','create','put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','/describe'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x1b68,0xe4));var _0x81b6=function(_0x5d17e0,_0x5940ba){_0x5d17e0=_0x5d17e0-0x0;var _0x3cd085=_0x1b68[_0x5d17e0];return _0x3cd085;};'use strict';var multer=require(_0x81b6('0x0'));var util=require('util');var path=require(_0x81b6('0x1'));var timeout=require('connect-timeout');var express=require(_0x81b6('0x2'));var router=express[_0x81b6('0x3')]();var fs_extra=require(_0x81b6('0x4'));var auth=require(_0x81b6('0x5'));var interaction=require(_0x81b6('0x6'));var config=require(_0x81b6('0x7'));var controller=require(_0x81b6('0x8'));router[_0x81b6('0x9')]('/',auth[_0x81b6('0xa')](),controller['index']);router[_0x81b6('0x9')](_0x81b6('0xb'),auth[_0x81b6('0xa')](),controller['describe']);router[_0x81b6('0x9')](_0x81b6('0xc'),auth[_0x81b6('0xa')](),controller[_0x81b6('0xd')]);router[_0x81b6('0xe')]('/',auth[_0x81b6('0xa')](),controller[_0x81b6('0xf')]);router[_0x81b6('0x10')](_0x81b6('0xc'),auth[_0x81b6('0xa')](),controller['update']);router[_0x81b6('0x11')]('/:id',auth[_0x81b6('0xa')](),controller[_0x81b6('0x12')]);module[_0x81b6('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index f18e845..c563b1d 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(_0x3cc315,_0x553a78){var _0x21b545=function(_0xc3692d){while(--_0xc3692d){_0x3cc315['push'](_0x3cc315['shift']());}};_0x21b545(++_0x553a78);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x56d33e,_0x138c19){var _0x13728e=function(_0x50bb5e){while(--_0x50bb5e){_0x56d33e['push'](_0x56d33e['shift']());}};_0x13728e(++_0x138c19);}(_0x7a54,0x106));var _0x47a5=function(_0x5e277f,_0x3d1bb9){_0x5e277f=_0x5e277f-0x0;var _0x1fd10a=_0x7a54[_0x5e277f];return _0x1fd10a;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 046491a..503f231 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 _0x36ee=['describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','WhatsappQueueReport','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];function respondWithStatusCode(_0x4fbdb2,_0x32981d){_0x32981d=_0x32981d||0xcc;return function(_0x27841e){if(_0x27841e){return _0x4fbdb2[_0xe36e('0x19')](_0x32981d);}return _0x4fbdb2[_0xe36e('0x1a')](_0x32981d)['end']();};}function respondWithResult(_0x3e264a,_0x521afa){_0x521afa=_0x521afa||0xc8;return function(_0x525155){if(_0x525155){return _0x3e264a[_0xe36e('0x1a')](_0x521afa)[_0xe36e('0x1b')](_0x525155);}};}function respondWithFilteredResult(_0x26fb37,_0x278135){return function(_0xd6828e){if(_0xd6828e){var _0x924cd5=typeof _0x278135[_0xe36e('0x1c')]===_0xe36e('0x1d')&&typeof _0x278135[_0xe36e('0x1e')]===_0xe36e('0x1d');var _0x5792e8=_0xd6828e[_0xe36e('0x1f')];var _0x2184ae=_0x924cd5?0x0:_0x278135['offset'];var _0x21d9a3=_0x924cd5?_0xd6828e['count']:_0x278135[_0xe36e('0x1c')]+_0x278135[_0xe36e('0x1e')];var _0x5e15f5;if(_0x21d9a3>=_0x5792e8){_0x21d9a3=_0x5792e8;_0x5e15f5=0xc8;}else{_0x5e15f5=0xce;}_0x26fb37[_0xe36e('0x1a')](_0x5e15f5);return _0x26fb37[_0xe36e('0x20')](_0xe36e('0x21'),_0x2184ae+'-'+_0x21d9a3+'/'+_0x5792e8)['json'](_0xd6828e);}return null;};}function patchUpdates(_0x21e95e){return function(_0x21bcf9){try{jsonpatch[_0xe36e('0x22')](_0x21bcf9,_0x21e95e,!![]);}catch(_0x3c4017){return BPromise[_0xe36e('0x23')](_0x3c4017);}return _0x21bcf9[_0xe36e('0x24')]();};}function saveUpdates(_0x4f438a,_0xd71137){return function(_0x4f214a){if(_0x4f214a){return _0x4f214a[_0xe36e('0x25')](_0x4f438a)[_0xe36e('0x26')](function(_0x437f3f){return _0x437f3f;});}return null;};}function removeEntity(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(_0x4749a8){return _0x4749a8[_0xe36e('0x27')]()[_0xe36e('0x26')](function(){_0x53e13a[_0xe36e('0x1a')](0xcc)[_0xe36e('0x28')]();});}};}function handleEntityNotFound(_0x1507f9,_0x1a045c){return function(_0x5ac484){if(!_0x5ac484){_0x1507f9[_0xe36e('0x19')](0x194);}return _0x5ac484;};}function handleError(_0x35f9e7,_0x10597f){_0x10597f=_0x10597f||0x1f4;return function(_0x262caa){logger['error'](_0x262caa[_0xe36e('0x29')]);if(_0x262caa['name']){delete _0x262caa[_0xe36e('0x2a')];}_0x35f9e7['status'](_0x10597f)[_0xe36e('0x2b')](_0x262caa);};}exports['index']=function(_0x410504,_0x4c5d98){var _0x3b1045={},_0x59548b={},_0x4bb75b={'count':0x0,'rows':[]};var _0x5d8fd8=_['map'](db[_0xe36e('0x2c')][_0xe36e('0x2d')],function(_0x4cf185){return{'name':_0x4cf185['fieldName'],'type':_0x4cf185[_0xe36e('0x2e')][_0xe36e('0x2f')]};});_0x59548b[_0xe36e('0x30')]=_[_0xe36e('0x31')](_0x5d8fd8,_0xe36e('0x2a'));_0x59548b[_0xe36e('0x32')]=_['keys'](_0x410504[_0xe36e('0x32')]);_0x59548b[_0xe36e('0x33')]=_['intersection'](_0x59548b[_0xe36e('0x30')],_0x59548b[_0xe36e('0x32')]);_0x3b1045[_0xe36e('0x34')]=_[_0xe36e('0x35')](_0x59548b[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x410504[_0xe36e('0x32')][_0xe36e('0x36')]));_0x3b1045[_0xe36e('0x34')]=_0x3b1045[_0xe36e('0x34')][_0xe36e('0x37')]?_0x3b1045['attributes']:_0x59548b[_0xe36e('0x30')];if(!_0x410504['query']['hasOwnProperty'](_0xe36e('0x38'))){_0x3b1045['limit']=qs[_0xe36e('0x1e')](_0x410504[_0xe36e('0x32')][_0xe36e('0x1e')]);_0x3b1045[_0xe36e('0x1c')]=qs['offset'](_0x410504['query'][_0xe36e('0x1c')]);}_0x3b1045[_0xe36e('0x39')]=qs[_0xe36e('0x3a')](_0x410504[_0xe36e('0x32')]['sort']);_0x3b1045[_0xe36e('0x3b')]=qs[_0xe36e('0x33')](_[_0xe36e('0x3c')](_0x410504['query'],_0x59548b[_0xe36e('0x33')]),_0x5d8fd8);if(_0x410504[_0xe36e('0x32')]['filter']){_0x3b1045[_0xe36e('0x3b')]=_[_0xe36e('0x3d')](_0x3b1045[_0xe36e('0x3b')],{'$or':_[_0xe36e('0x31')](_0x5d8fd8,function(_0xeadfa6){if(_0xeadfa6[_0xe36e('0x2e')]!==_0xe36e('0x3e')){var _0x20877d={};_0x20877d[_0xeadfa6[_0xe36e('0x2a')]]={'$like':'%'+_0x410504[_0xe36e('0x32')][_0xe36e('0x3f')]+'%'};return _0x20877d;}})});}_0x3b1045=_[_0xe36e('0x3d')]({},_0x3b1045,_0x410504[_0xe36e('0x40')]);var _0x5f396c={'where':_0x3b1045[_0xe36e('0x3b')]};return db[_0xe36e('0x2c')][_0xe36e('0x1f')](_0x5f396c)[_0xe36e('0x26')](function(_0x295feb){_0x4bb75b['count']=_0x295feb;if(_0x410504['query'][_0xe36e('0x41')]){_0x3b1045[_0xe36e('0x42')]=[{'all':!![]}];}return db[_0xe36e('0x2c')][_0xe36e('0x43')](_0x3b1045);})[_0xe36e('0x26')](function(_0x34a1ba){_0x4bb75b[_0xe36e('0x44')]=_0x34a1ba;return _0x4bb75b;})[_0xe36e('0x26')](respondWithFilteredResult(_0x4c5d98,_0x3b1045))['catch'](handleError(_0x4c5d98,null));};exports[_0xe36e('0x45')]=function(_0x2d392c,_0x4788a0){var _0x21dc35={'raw':!![],'where':{'id':_0x2d392c[_0xe36e('0x46')]['id']}},_0x5ef3e4={};_0x5ef3e4[_0xe36e('0x30')]=_[_0xe36e('0x47')](db[_0xe36e('0x2c')][_0xe36e('0x2d')]);_0x5ef3e4['query']=_[_0xe36e('0x47')](_0x2d392c[_0xe36e('0x32')]);_0x5ef3e4[_0xe36e('0x33')]=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],_0x5ef3e4[_0xe36e('0x32')]);_0x21dc35['attributes']=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x2d392c[_0xe36e('0x32')][_0xe36e('0x36')]));_0x21dc35['attributes']=_0x21dc35[_0xe36e('0x34')][_0xe36e('0x37')]?_0x21dc35[_0xe36e('0x34')]:_0x5ef3e4[_0xe36e('0x30')];if(_0x2d392c[_0xe36e('0x32')][_0xe36e('0x41')]){_0x21dc35[_0xe36e('0x42')]=[{'all':!![]}];}_0x21dc35=_[_0xe36e('0x3d')]({},_0x21dc35,_0x2d392c[_0xe36e('0x40')]);return db['WhatsappQueueReport']['find'](_0x21dc35)[_0xe36e('0x26')](handleEntityNotFound(_0x4788a0,null))['then'](respondWithResult(_0x4788a0,null))[_0xe36e('0x48')](handleError(_0x4788a0,null));};exports[_0xe36e('0x49')]=function(_0x38b93f,_0x25aa09){return db['WhatsappQueueReport'][_0xe36e('0x49')](_0x38b93f[_0xe36e('0x4a')],{})['then'](respondWithResult(_0x25aa09,0xc9))[_0xe36e('0x48')](handleError(_0x25aa09,null));};exports[_0xe36e('0x25')]=function(_0x2c26e6,_0x42eae5){if(_0x2c26e6[_0xe36e('0x4a')]['id']){delete _0x2c26e6[_0xe36e('0x4a')]['id'];}return db[_0xe36e('0x2c')][_0xe36e('0x4b')]({'where':{'id':_0x2c26e6[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x42eae5,null))[_0xe36e('0x26')](saveUpdates(_0x2c26e6[_0xe36e('0x4a')],null))[_0xe36e('0x26')](respondWithResult(_0x42eae5,null))[_0xe36e('0x48')](handleError(_0x42eae5,null));};exports[_0xe36e('0x27')]=function(_0x5678d3,_0x3262bf){return db['WhatsappQueueReport']['find']({'where':{'id':_0x5678d3[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x3262bf,null))['then'](removeEntity(_0x3262bf,null))[_0xe36e('0x48')](handleError(_0x3262bf,null));};exports[_0xe36e('0x4c')]=function(_0x8a767a,_0x1f4a5d){return db[_0xe36e('0x2c')][_0xe36e('0x4c')]()[_0xe36e('0x26')](respondWithResult(_0x1f4a5d,null))[_0xe36e('0x48')](handleError(_0x1f4a5d,null));}; \ No newline at end of file +var _0x58a4=['key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','sendStatus','error','name','index','map','WhatsappQueueReport','fieldName'];(function(_0x13e758,_0x317d23){var _0x5b53c3=function(_0x103e80){while(--_0x103e80){_0x13e758['push'](_0x13e758['shift']());}};_0x5b53c3(++_0x317d23);}(_0x58a4,0xbf));var _0x458a=function(_0x2ee20d,_0x354e70){_0x2ee20d=_0x2ee20d-0x0;var _0xade530=_0x58a4[_0x2ee20d];return _0xade530;};'use strict';var emlformat=require(_0x458a('0x0'));var rimraf=require(_0x458a('0x1'));var zipdir=require(_0x458a('0x2'));var jsonpatch=require(_0x458a('0x3'));var rp=require(_0x458a('0x4'));var moment=require(_0x458a('0x5'));var BPromise=require(_0x458a('0x6'));var Mustache=require(_0x458a('0x7'));var util=require(_0x458a('0x8'));var path=require(_0x458a('0x9'));var sox=require(_0x458a('0xa'));var csv=require(_0x458a('0xb'));var ejs=require(_0x458a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x458a('0xd'));var crypto=require(_0x458a('0xe'));var jsforce=require(_0x458a('0xf'));var deskjs=require(_0x458a('0x10'));var toCsv=require(_0x458a('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x458a('0x11'));var authService=require(_0x458a('0x12'));var qs=require(_0x458a('0x13'));var as=require(_0x458a('0x14'));var hardwareService=require(_0x458a('0x15'));var logger=require('../../config/logger')(_0x458a('0x16'));var utils=require(_0x458a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x458a('0x18'));var db=require(_0x458a('0x19'))['db'];function respondWithStatusCode(_0xee09c6,_0x2a4934){_0x2a4934=_0x2a4934||0xcc;return function(_0x2e788b){if(_0x2e788b){return _0xee09c6['sendStatus'](_0x2a4934);}return _0xee09c6['status'](_0x2a4934)[_0x458a('0x1a')]();};}function respondWithResult(_0x56436f,_0x2c7528){_0x2c7528=_0x2c7528||0xc8;return function(_0x44f683){if(_0x44f683){return _0x56436f[_0x458a('0x1b')](_0x2c7528)[_0x458a('0x1c')](_0x44f683);}};}function respondWithFilteredResult(_0xad80f9,_0x29acee){return function(_0x507b0f){if(_0x507b0f){var _0x4b26be=typeof _0x29acee['offset']===_0x458a('0x1d')&&typeof _0x29acee[_0x458a('0x1e')]===_0x458a('0x1d');var _0x5c5b41=_0x507b0f[_0x458a('0x1f')];var _0x260c87=_0x4b26be?0x0:_0x29acee[_0x458a('0x20')];var _0x392986=_0x4b26be?_0x507b0f[_0x458a('0x1f')]:_0x29acee['offset']+_0x29acee['limit'];var _0x178db9;if(_0x392986>=_0x5c5b41){_0x392986=_0x5c5b41;_0x178db9=0xc8;}else{_0x178db9=0xce;}_0xad80f9['status'](_0x178db9);return _0xad80f9[_0x458a('0x21')](_0x458a('0x22'),_0x260c87+'-'+_0x392986+'/'+_0x5c5b41)['json'](_0x507b0f);}return null;};}function patchUpdates(_0x468416){return function(_0x55a588){try{jsonpatch[_0x458a('0x23')](_0x55a588,_0x468416,!![]);}catch(_0x1c79cb){return BPromise['reject'](_0x1c79cb);}return _0x55a588[_0x458a('0x24')]();};}function saveUpdates(_0xead884,_0x5a2bcb){return function(_0xa6b8ff){if(_0xa6b8ff){return _0xa6b8ff['update'](_0xead884)[_0x458a('0x25')](function(_0x5bca42){return _0x5bca42;});}return null;};}function removeEntity(_0x4080fc,_0x5dfc6c){return function(_0x36b08e){if(_0x36b08e){return _0x36b08e[_0x458a('0x26')]()[_0x458a('0x25')](function(){_0x4080fc[_0x458a('0x1b')](0xcc)[_0x458a('0x1a')]();});}};}function handleEntityNotFound(_0x19bd5,_0x340375){return function(_0x3012c7){if(!_0x3012c7){_0x19bd5[_0x458a('0x27')](0x194);}return _0x3012c7;};}function handleError(_0xfc6b24,_0x52efed){_0x52efed=_0x52efed||0x1f4;return function(_0x327fcb){logger[_0x458a('0x28')](_0x327fcb['stack']);if(_0x327fcb[_0x458a('0x29')]){delete _0x327fcb[_0x458a('0x29')];}_0xfc6b24['status'](_0x52efed)['send'](_0x327fcb);};}exports[_0x458a('0x2a')]=function(_0x596fe2,_0x33c5d8){var _0x29f9b5={},_0x223f73={},_0x4a49e4={'count':0x0,'rows':[]};var _0xa6fdf=_[_0x458a('0x2b')](db[_0x458a('0x2c')]['rawAttributes'],function(_0x47e20d){return{'name':_0x47e20d[_0x458a('0x2d')],'type':_0x47e20d['type'][_0x458a('0x2e')]};});_0x223f73['model']=_[_0x458a('0x2b')](_0xa6fdf,_0x458a('0x29'));_0x223f73['query']=_[_0x458a('0x2f')](_0x596fe2[_0x458a('0x30')]);_0x223f73[_0x458a('0x31')]=_['intersection'](_0x223f73[_0x458a('0x32')],_0x223f73[_0x458a('0x30')]);_0x29f9b5[_0x458a('0x33')]=_[_0x458a('0x34')](_0x223f73[_0x458a('0x32')],qs['fields'](_0x596fe2[_0x458a('0x30')][_0x458a('0x35')]));_0x29f9b5[_0x458a('0x33')]=_0x29f9b5[_0x458a('0x33')][_0x458a('0x36')]?_0x29f9b5[_0x458a('0x33')]:_0x223f73['model'];if(!_0x596fe2[_0x458a('0x30')][_0x458a('0x37')](_0x458a('0x38'))){_0x29f9b5[_0x458a('0x1e')]=qs[_0x458a('0x1e')](_0x596fe2[_0x458a('0x30')][_0x458a('0x1e')]);_0x29f9b5[_0x458a('0x20')]=qs[_0x458a('0x20')](_0x596fe2['query'][_0x458a('0x20')]);}_0x29f9b5[_0x458a('0x39')]=qs[_0x458a('0x3a')](_0x596fe2[_0x458a('0x30')][_0x458a('0x3a')]);_0x29f9b5[_0x458a('0x3b')]=qs[_0x458a('0x31')](_[_0x458a('0x3c')](_0x596fe2[_0x458a('0x30')],_0x223f73[_0x458a('0x31')]),_0xa6fdf);if(_0x596fe2[_0x458a('0x30')][_0x458a('0x3d')]){_0x29f9b5[_0x458a('0x3b')]=_[_0x458a('0x3e')](_0x29f9b5[_0x458a('0x3b')],{'$or':_['map'](_0xa6fdf,function(_0x226cf0){if(_0x226cf0[_0x458a('0x3f')]!==_0x458a('0x40')){var _0x12dad4={};_0x12dad4[_0x226cf0[_0x458a('0x29')]]={'$like':'%'+_0x596fe2[_0x458a('0x30')][_0x458a('0x3d')]+'%'};return _0x12dad4;}})});}_0x29f9b5=_[_0x458a('0x3e')]({},_0x29f9b5,_0x596fe2[_0x458a('0x41')]);var _0x44c5ba={'where':_0x29f9b5[_0x458a('0x3b')]};return db['WhatsappQueueReport'][_0x458a('0x1f')](_0x44c5ba)[_0x458a('0x25')](function(_0x5da57a){_0x4a49e4[_0x458a('0x1f')]=_0x5da57a;if(_0x596fe2[_0x458a('0x30')][_0x458a('0x42')]){_0x29f9b5['include']=[{'all':!![]}];}return db[_0x458a('0x2c')][_0x458a('0x43')](_0x29f9b5);})[_0x458a('0x25')](function(_0x1e51d2){_0x4a49e4[_0x458a('0x44')]=_0x1e51d2;return _0x4a49e4;})[_0x458a('0x25')](respondWithFilteredResult(_0x33c5d8,_0x29f9b5))[_0x458a('0x45')](handleError(_0x33c5d8,null));};exports[_0x458a('0x46')]=function(_0x5883ab,_0x296385){var _0x145e3c={'raw':!![],'where':{'id':_0x5883ab['params']['id']}},_0x2b9030={};_0x2b9030[_0x458a('0x32')]=_[_0x458a('0x2f')](db['WhatsappQueueReport'][_0x458a('0x47')]);_0x2b9030[_0x458a('0x30')]=_[_0x458a('0x2f')](_0x5883ab[_0x458a('0x30')]);_0x2b9030[_0x458a('0x31')]=_['intersection'](_0x2b9030['model'],_0x2b9030[_0x458a('0x30')]);_0x145e3c[_0x458a('0x33')]=_[_0x458a('0x34')](_0x2b9030[_0x458a('0x32')],qs['fields'](_0x5883ab[_0x458a('0x30')][_0x458a('0x35')]));_0x145e3c['attributes']=_0x145e3c[_0x458a('0x33')]['length']?_0x145e3c[_0x458a('0x33')]:_0x2b9030[_0x458a('0x32')];if(_0x5883ab[_0x458a('0x30')]['includeAll']){_0x145e3c[_0x458a('0x48')]=[{'all':!![]}];}_0x145e3c=_[_0x458a('0x3e')]({},_0x145e3c,_0x5883ab[_0x458a('0x41')]);return db['WhatsappQueueReport']['find'](_0x145e3c)[_0x458a('0x25')](handleEntityNotFound(_0x296385,null))[_0x458a('0x25')](respondWithResult(_0x296385,null))[_0x458a('0x45')](handleError(_0x296385,null));};exports['create']=function(_0x5e7a64,_0x3a7005){return db[_0x458a('0x2c')][_0x458a('0x49')](_0x5e7a64[_0x458a('0x4a')],{})[_0x458a('0x25')](respondWithResult(_0x3a7005,0xc9))[_0x458a('0x45')](handleError(_0x3a7005,null));};exports[_0x458a('0x4b')]=function(_0x30cdaf,_0xb22232){if(_0x30cdaf[_0x458a('0x4a')]['id']){delete _0x30cdaf[_0x458a('0x4a')]['id'];}return db[_0x458a('0x2c')][_0x458a('0x4c')]({'where':{'id':_0x30cdaf[_0x458a('0x4d')]['id']}})[_0x458a('0x25')](handleEntityNotFound(_0xb22232,null))[_0x458a('0x25')](saveUpdates(_0x30cdaf['body'],null))[_0x458a('0x25')](respondWithResult(_0xb22232,null))[_0x458a('0x45')](handleError(_0xb22232,null));};exports[_0x458a('0x26')]=function(_0x396bb3,_0x44670a){return db['WhatsappQueueReport']['find']({'where':{'id':_0x396bb3['params']['id']}})[_0x458a('0x25')](handleEntityNotFound(_0x44670a,null))['then'](removeEntity(_0x44670a,null))[_0x458a('0x45')](handleError(_0x44670a,null));};exports[_0x458a('0x4e')]=function(_0x2a35a9,_0x649553){return db[_0x458a('0x2c')]['describe']()['then'](respondWithResult(_0x649553,null))[_0x458a('0x45')](handleError(_0x649553,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 5ed462d..1be19ff 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 _0xb026=['uniqueid','util','api','moment','request-promise','rimraf','../../config/environment','exports','WhatsappQueueReport'];(function(_0x23e67d,_0x50ae17){var _0x57a2c2=function(_0x282ae9){while(--_0x282ae9){_0x23e67d['push'](_0x23e67d['shift']());}};_0x57a2c2(++_0x50ae17);}(_0xb026,0xf4));var _0x6b02=function(_0x4216ba,_0x5739c5){_0x4216ba=_0x4216ba-0x0;var _0x2592ca=_0xb026[_0x4216ba];return _0x2592ca;};'use strict';var _=require('lodash');var util=require(_0x6b02('0x0'));var logger=require('../../config/logger')(_0x6b02('0x1'));var moment=require(_0x6b02('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b02('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b02('0x4'));var config=require(_0x6b02('0x5'));var attributes=require('./whatsappQueueReport.attributes');module[_0x6b02('0x6')]=function(_0x403de8,_0x1f325a){return _0x403de8['define'](_0x6b02('0x7'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x6b02('0x8'),'fields':[_0x6b02('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd7c2=['./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x36c0f5,_0x12f277){var _0x41498b=function(_0x1a3a9d){while(--_0x1a3a9d){_0x36c0f5['push'](_0x36c0f5['shift']());}};_0x41498b(++_0x12f277);}(_0xd7c2,0x1c7));var _0x2d7c=function(_0x6d8620,_0x4e79b3){_0x6d8620=_0x6d8620-0x0;var _0x139f06=_0xd7c2[_0x6d8620];return _0x139f06;};'use strict';var _=require(_0x2d7c('0x0'));var util=require(_0x2d7c('0x1'));var logger=require(_0x2d7c('0x2'))(_0x2d7c('0x3'));var moment=require(_0x2d7c('0x4'));var BPromise=require(_0x2d7c('0x5'));var rp=require(_0x2d7c('0x6'));var fs=require('fs');var path=require(_0x2d7c('0x7'));var rimraf=require(_0x2d7c('0x8'));var config=require(_0x2d7c('0x9'));var attributes=require(_0x2d7c('0xa'));module[_0x2d7c('0xb')]=function(_0x316553,_0x3bdb78){return _0x316553[_0x2d7c('0xc')](_0x2d7c('0xd'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x2d7c('0xe'),'fields':[_0x2d7c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 4136175..4b6822f 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 _0xe5c2=['client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','UpdateWhatsappQueueReport','where','attributes','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x11b0cc,_0x4df2e1){var _0x17f510=function(_0x1d7cc8){while(--_0x1d7cc8){_0x11b0cc['push'](_0x11b0cc['shift']());}};_0x17f510(++_0x4df2e1);}(_0xe5c2,0xe0));var _0x2e5c=function(_0x2dba16,_0x495033){_0x2dba16=_0x2dba16-0x0;var _0x44d63c=_0xe5c2[_0x2dba16];return _0x44d63c;};'use strict';var _=require(_0x2e5c('0x0'));var util=require('util');var moment=require(_0x2e5c('0x1'));var BPromise=require('bluebird');var rs=require(_0x2e5c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e5c('0x3'))['db'];var utils=require(_0x2e5c('0x4'));var logger=require('../../config/logger')(_0x2e5c('0x5'));var config=require(_0x2e5c('0x6'));var jayson=require(_0x2e5c('0x7'));var client=jayson[_0x2e5c('0x8')][_0x2e5c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x547700,_0x25377e,_0x44ec9f){return new BPromise(function(_0x51ea30,_0x43b70a){return client[_0x2e5c('0xa')](_0x547700,_0x44ec9f)[_0x2e5c('0xb')](function(_0x914f8b){logger[_0x2e5c('0xc')](_0x2e5c('0xd'),_0x25377e,_0x2e5c('0xe'));logger[_0x2e5c('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x25377e,_0x2e5c('0xe'),JSON[_0x2e5c('0x10')](_0x914f8b));if(_0x914f8b[_0x2e5c('0x11')]){if(_0x914f8b[_0x2e5c('0x11')]['code']===0x1f4){logger[_0x2e5c('0x11')](_0x2e5c('0xd'),_0x25377e,_0x914f8b[_0x2e5c('0x11')]['message']);return _0x43b70a(_0x914f8b[_0x2e5c('0x11')]['message']);}logger[_0x2e5c('0x11')](_0x2e5c('0xd'),_0x25377e,_0x914f8b[_0x2e5c('0x11')][_0x2e5c('0x12')]);return _0x51ea30(_0x914f8b[_0x2e5c('0x11')]['message']);}else{logger[_0x2e5c('0xc')](_0x2e5c('0xd'),_0x25377e,_0x2e5c('0xe'));_0x51ea30(_0x914f8b[_0x2e5c('0x13')][_0x2e5c('0x12')]);}})[_0x2e5c('0x14')](function(_0x5b1c47){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x25377e,_0x5b1c47);_0x43b70a(_0x5b1c47);});});}exports[_0x2e5c('0x15')]=function(_0x55cdfa){var _0x5316ec=this;return new Promise(function(_0x502575,_0x3a09c1){return db[_0x2e5c('0x16')][_0x2e5c('0x17')](_0x55cdfa['body'],{'raw':_0x55cdfa[_0x2e5c('0x18')]?_0x55cdfa[_0x2e5c('0x18')][_0x2e5c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4a5d70){logger[_0x2e5c('0xc')](_0x2e5c('0x15'),_0x55cdfa);logger[_0x2e5c('0xf')]('CreateWhatsappQueueReport',_0x55cdfa,JSON[_0x2e5c('0x10')](_0x4a5d70));_0x502575(_0x4a5d70);})[_0x2e5c('0x14')](function(_0x291702){logger[_0x2e5c('0x11')](_0x2e5c('0x15'),_0x291702['message'],_0x55cdfa);_0x3a09c1(_0x5316ec[_0x2e5c('0x11')](0x1f4,_0x291702[_0x2e5c('0x12')]));});});};exports[_0x2e5c('0x1a')]=function(_0x59df2e){var _0x22e0ab=this;return new Promise(function(_0x495564,_0x2b3ae5){return db[_0x2e5c('0x16')]['update'](_0x59df2e['body'],{'raw':_0x59df2e[_0x2e5c('0x18')]?_0x59df2e[_0x2e5c('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59df2e[_0x2e5c('0x18')]?_0x59df2e[_0x2e5c('0x18')][_0x2e5c('0x1b')]||null:null,'attributes':_0x59df2e[_0x2e5c('0x18')]?_0x59df2e[_0x2e5c('0x18')][_0x2e5c('0x1c')]||null:null,'limit':_0x59df2e[_0x2e5c('0x18')]?_0x59df2e[_0x2e5c('0x18')]['limit']||null:null})[_0x2e5c('0xb')](function(_0x40ddbc){logger[_0x2e5c('0xc')](_0x2e5c('0x1a'),_0x59df2e);logger['debug'](_0x2e5c('0x1a'),_0x59df2e,JSON['stringify'](_0x40ddbc));_0x495564(_0x40ddbc);})[_0x2e5c('0x14')](function(_0x5894bd){logger[_0x2e5c('0x11')]('UpdateWhatsappQueueReport',_0x5894bd[_0x2e5c('0x12')],_0x59df2e);_0x2b3ae5(_0x22e0ab[_0x2e5c('0x11')](0x1f4,_0x5894bd[_0x2e5c('0x12')]));});});}; \ No newline at end of file +var _0x6e07=['jayson/promise','client','http','request','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','body','options','raw','then','info','stringify','where','attributes','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x82a071,_0x252266){var _0x15dda9=function(_0x3f73b0){while(--_0x3f73b0){_0x82a071['push'](_0x82a071['shift']());}};_0x15dda9(++_0x252266);}(_0x6e07,0x12e));var _0x76e0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e07[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x76e0('0x0'));var util=require(_0x76e0('0x1'));var moment=require(_0x76e0('0x2'));var BPromise=require(_0x76e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76e0('0x4'));var db=require(_0x76e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x76e0('0x6'))('rpc');var config=require(_0x76e0('0x7'));var jayson=require(_0x76e0('0x8'));var client=jayson[_0x76e0('0x9')][_0x76e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f9374,_0x9f570d,_0x5c675b){return new BPromise(function(_0xee7354,_0x368d6d){return client[_0x76e0('0xb')](_0x1f9374,_0x5c675b)['then'](function(_0x5ef6d5){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x9f570d,_0x76e0('0xc'));logger[_0x76e0('0xd')](_0x76e0('0xe'),_0x9f570d,'request\x20sent',JSON['stringify'](_0x5ef6d5));if(_0x5ef6d5[_0x76e0('0xf')]){if(_0x5ef6d5[_0x76e0('0xf')][_0x76e0('0x10')]===0x1f4){logger['error'](_0x76e0('0x11'),_0x9f570d,_0x5ef6d5[_0x76e0('0xf')][_0x76e0('0x12')]);return _0x368d6d(_0x5ef6d5[_0x76e0('0xf')][_0x76e0('0x12')]);}logger[_0x76e0('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x9f570d,_0x5ef6d5[_0x76e0('0xf')][_0x76e0('0x12')]);return _0xee7354(_0x5ef6d5[_0x76e0('0xf')][_0x76e0('0x12')]);}else{logger['info'](_0x76e0('0x11'),_0x9f570d,_0x76e0('0xc'));_0xee7354(_0x5ef6d5[_0x76e0('0x13')]['message']);}})[_0x76e0('0x14')](function(_0x5273d0){logger[_0x76e0('0xf')](_0x76e0('0x11'),_0x9f570d,_0x5273d0);_0x368d6d(_0x5273d0);});});}exports[_0x76e0('0x15')]=function(_0x4b6881){var _0xea3fa4=this;return new Promise(function(_0x28d24f,_0x3272b6){return db['WhatsappQueueReport']['create'](_0x4b6881[_0x76e0('0x16')],{'raw':_0x4b6881[_0x76e0('0x17')]?_0x4b6881[_0x76e0('0x17')][_0x76e0('0x18')]===undefined?!![]:![]:!![]})[_0x76e0('0x19')](function(_0x5bb263){logger[_0x76e0('0x1a')](_0x76e0('0x15'),_0x4b6881);logger[_0x76e0('0xd')](_0x76e0('0x15'),_0x4b6881,JSON[_0x76e0('0x1b')](_0x5bb263));_0x28d24f(_0x5bb263);})['catch'](function(_0x2bbf60){logger['error'](_0x76e0('0x15'),_0x2bbf60[_0x76e0('0x12')],_0x4b6881);_0x3272b6(_0xea3fa4['error'](0x1f4,_0x2bbf60[_0x76e0('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x6bce3d){var _0x34586d=this;return new Promise(function(_0x57a701,_0x220217){return db['WhatsappQueueReport']['update'](_0x6bce3d['body'],{'raw':_0x6bce3d[_0x76e0('0x17')]?_0x6bce3d[_0x76e0('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6bce3d['options']?_0x6bce3d[_0x76e0('0x17')][_0x76e0('0x1c')]||null:null,'attributes':_0x6bce3d[_0x76e0('0x17')]?_0x6bce3d[_0x76e0('0x17')][_0x76e0('0x1d')]||null:null,'limit':_0x6bce3d[_0x76e0('0x17')]?_0x6bce3d['options']['limit']||null:null})[_0x76e0('0x19')](function(_0x56c532){logger[_0x76e0('0x1a')](_0x76e0('0x1e'),_0x6bce3d);logger['debug']('UpdateWhatsappQueueReport',_0x6bce3d,JSON[_0x76e0('0x1b')](_0x56c532));_0x57a701(_0x56c532);})['catch'](function(_0x164276){logger[_0x76e0('0xf')](_0x76e0('0x1e'),_0x164276[_0x76e0('0x12')],_0x6bce3d);_0x220217(_0x34586d['error'](0x1f4,_0x164276[_0x76e0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index d9325d2..d5e0ec6 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 _0xe662=['fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x34afec,_0x467638){var _0x2e5fab=function(_0x34f41f){while(--_0x34f41f){_0x34afec['push'](_0x34afec['shift']());}};_0x2e5fab(++_0x467638);}(_0xe662,0x100));var _0x2e66=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe662[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x2e66('0x0'));var util=require(_0x2e66('0x1'));var path=require(_0x2e66('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e66('0x3'));var router=express['Router']();var fs_extra=require(_0x2e66('0x4'));var auth=require(_0x2e66('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0x2e66('0x6')]('/',auth[_0x2e66('0x7')](),controller[_0x2e66('0x8')]);router[_0x2e66('0x6')](_0x2e66('0x9'),auth[_0x2e66('0x7')](),controller[_0x2e66('0xa')]);router[_0x2e66('0x6')](_0x2e66('0xb'),auth['isAuthenticated'](),controller[_0x2e66('0xc')]);router[_0x2e66('0xd')]('/',auth[_0x2e66('0x7')](),controller[_0x2e66('0xe')]);router[_0x2e66('0xf')](_0x2e66('0xb'),auth['isAuthenticated'](),controller[_0x2e66('0x10')]);router[_0x2e66('0x11')]('/:id',auth[_0x2e66('0x7')](),controller[_0x2e66('0x12')]);module[_0x2e66('0x13')]=router; \ No newline at end of file +var _0x4aa7=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','show','create','delete','/:id','destroy','exports','multer','util'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4aa7,0x1f2));var _0x74aa=function(_0x9f7958,_0x496d9f){_0x9f7958=_0x9f7958-0x0;var _0x53d281=_0x4aa7[_0x9f7958];return _0x53d281;};'use strict';var multer=require(_0x74aa('0x0'));var util=require(_0x74aa('0x1'));var path=require(_0x74aa('0x2'));var timeout=require(_0x74aa('0x3'));var express=require('express');var router=express[_0x74aa('0x4')]();var fs_extra=require(_0x74aa('0x5'));var auth=require(_0x74aa('0x6'));var interaction=require(_0x74aa('0x7'));var config=require(_0x74aa('0x8'));var controller=require(_0x74aa('0x9'));router[_0x74aa('0xa')]('/',auth[_0x74aa('0xb')](),controller[_0x74aa('0xc')]);router[_0x74aa('0xa')](_0x74aa('0xd'),auth[_0x74aa('0xb')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x74aa('0xe')]);router['post']('/',auth[_0x74aa('0xb')](),controller[_0x74aa('0xf')]);router['put']('/:id',auth[_0x74aa('0xb')](),controller['update']);router[_0x74aa('0x10')](_0x74aa('0x11'),auth[_0x74aa('0xb')](),controller[_0x74aa('0x12')]);module[_0x74aa('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index dcaa319..9081adc 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 _0xaebd=['account','agent','queue','sequelize','STRING','ENUM'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x3b6479,_0x111a58){_0x3b6479=_0x3b6479-0x0;var _0x470707=_0xaebd[_0x3b6479];return _0x470707;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xdaeb('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xdaeb('0x2')](_0xdaeb('0x3'),_0xdaeb('0x4'),_0xdaeb('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x0c3a=['STRING','ENUM','account','agent','queue','sequelize','exports'];(function(_0x1f0a19,_0x162805){var _0x20229a=function(_0x414fe2){while(--_0x414fe2){_0x1f0a19['push'](_0x1f0a19['shift']());}};_0x20229a(++_0x162805);}(_0x0c3a,0x171));var _0xa0c3=function(_0x1c71d2,_0x459cbe){_0x1c71d2=_0x1c71d2-0x0;var _0x2df03f=_0x0c3a[_0x1c71d2];return _0x2df03f;};'use strict';var Sequelize=require(_0xa0c3('0x0'));module[_0xa0c3('0x1')]={'uniqueid':{'type':Sequelize[_0xa0c3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa0c3('0x3')](_0xa0c3('0x4'),_0xa0c3('0x5'),_0xa0c3('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 213bced..f2e6922 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 _0x9e42=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','describe','rimraf','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash'];(function(_0x312371,_0x168bca){var _0x11e3d1=function(_0x68c10e){while(--_0x68c10e){_0x312371['push'](_0x312371['shift']());}};_0x11e3d1(++_0x168bca);}(_0x9e42,0x169));var _0x29e4=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0x9e42[_0x3c22e0];return _0x215811;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29e4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x29e4('0x1'));var moment=require(_0x29e4('0x2'));var BPromise=require(_0x29e4('0x3'));var Mustache=require('mustache');var util=require(_0x29e4('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x29e4('0x5'));var ejs=require(_0x29e4('0x6'));var fs=require('fs');var fs_extra=require(_0x29e4('0x7'));var _=require(_0x29e4('0x8'));var squel=require(_0x29e4('0x9'));var crypto=require(_0x29e4('0xa'));var jsforce=require(_0x29e4('0xb'));var deskjs=require(_0x29e4('0xc'));var toCsv=require(_0x29e4('0x5'));var querystring=require(_0x29e4('0xd'));var Papa=require(_0x29e4('0xe'));var Redis=require(_0x29e4('0xf'));var authService=require(_0x29e4('0x10'));var qs=require(_0x29e4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x29e4('0x12'))(_0x29e4('0x13'));var utils=require(_0x29e4('0x14'));var config=require(_0x29e4('0x15'));var licenseUtil=require(_0x29e4('0x16'));var db=require(_0x29e4('0x17'))['db'];function respondWithStatusCode(_0x24038a,_0x557c57){_0x557c57=_0x557c57||0xcc;return function(_0x3307d0){if(_0x3307d0){return _0x24038a[_0x29e4('0x18')](_0x557c57);}return _0x24038a[_0x29e4('0x19')](_0x557c57)['end']();};}function respondWithResult(_0x3df4ed,_0x5c22b9){_0x5c22b9=_0x5c22b9||0xc8;return function(_0xaa0701){if(_0xaa0701){return _0x3df4ed['status'](_0x5c22b9)[_0x29e4('0x1a')](_0xaa0701);}};}function respondWithFilteredResult(_0xe60b94,_0x168d03){return function(_0x3de48a){if(_0x3de48a){var _0x7627=typeof _0x168d03[_0x29e4('0x1b')]===_0x29e4('0x1c')&&typeof _0x168d03[_0x29e4('0x1d')]===_0x29e4('0x1c');var _0x3295c1=_0x3de48a['count'];var _0x109268=_0x7627?0x0:_0x168d03['offset'];var _0xf4e150=_0x7627?_0x3de48a[_0x29e4('0x1e')]:_0x168d03[_0x29e4('0x1b')]+_0x168d03['limit'];var _0x36c143;if(_0xf4e150>=_0x3295c1){_0xf4e150=_0x3295c1;_0x36c143=0xc8;}else{_0x36c143=0xce;}_0xe60b94[_0x29e4('0x19')](_0x36c143);return _0xe60b94['set'](_0x29e4('0x1f'),_0x109268+'-'+_0xf4e150+'/'+_0x3295c1)[_0x29e4('0x1a')](_0x3de48a);}return null;};}function patchUpdates(_0x5106a1){return function(_0x295512){try{jsonpatch[_0x29e4('0x20')](_0x295512,_0x5106a1,!![]);}catch(_0x3df096){return BPromise[_0x29e4('0x21')](_0x3df096);}return _0x295512[_0x29e4('0x22')]();};}function saveUpdates(_0x17a6ed,_0x1fc3d1){return function(_0x177cce){if(_0x177cce){return _0x177cce[_0x29e4('0x23')](_0x17a6ed)[_0x29e4('0x24')](function(_0x4c45a2){return _0x4c45a2;});}return null;};}function removeEntity(_0x44a50c,_0x1cbf5f){return function(_0x4f801a){if(_0x4f801a){return _0x4f801a[_0x29e4('0x25')]()[_0x29e4('0x24')](function(){_0x44a50c[_0x29e4('0x19')](0xcc)[_0x29e4('0x26')]();});}};}function handleEntityNotFound(_0x2a0838,_0x4ce082){return function(_0x49ea72){if(!_0x49ea72){_0x2a0838[_0x29e4('0x18')](0x194);}return _0x49ea72;};}function handleError(_0x28923b,_0x15eeb9){_0x15eeb9=_0x15eeb9||0x1f4;return function(_0x532d8c){logger['error'](_0x532d8c[_0x29e4('0x27')]);if(_0x532d8c[_0x29e4('0x28')]){delete _0x532d8c[_0x29e4('0x28')];}_0x28923b[_0x29e4('0x19')](_0x15eeb9)[_0x29e4('0x29')](_0x532d8c);};}exports['index']=function(_0x37ccbf,_0x1be8e5){var _0x5e3597={},_0x56d3e4={},_0x1b8f6e={'count':0x0,'rows':[]};var _0x83e599=_[_0x29e4('0x2a')](db[_0x29e4('0x2b')][_0x29e4('0x2c')],function(_0x2daf09){return{'name':_0x2daf09[_0x29e4('0x2d')],'type':_0x2daf09[_0x29e4('0x2e')]['key']};});_0x56d3e4[_0x29e4('0x2f')]=_['map'](_0x83e599,'name');_0x56d3e4[_0x29e4('0x30')]=_[_0x29e4('0x31')](_0x37ccbf['query']);_0x56d3e4[_0x29e4('0x32')]=_[_0x29e4('0x33')](_0x56d3e4[_0x29e4('0x2f')],_0x56d3e4['query']);_0x5e3597[_0x29e4('0x34')]=_['intersection'](_0x56d3e4[_0x29e4('0x2f')],qs['fields'](_0x37ccbf[_0x29e4('0x30')][_0x29e4('0x35')]));_0x5e3597[_0x29e4('0x34')]=_0x5e3597[_0x29e4('0x34')]['length']?_0x5e3597[_0x29e4('0x34')]:_0x56d3e4[_0x29e4('0x2f')];if(!_0x37ccbf['query']['hasOwnProperty'](_0x29e4('0x36'))){_0x5e3597['limit']=qs[_0x29e4('0x1d')](_0x37ccbf[_0x29e4('0x30')][_0x29e4('0x1d')]);_0x5e3597[_0x29e4('0x1b')]=qs[_0x29e4('0x1b')](_0x37ccbf[_0x29e4('0x30')][_0x29e4('0x1b')]);}_0x5e3597[_0x29e4('0x37')]=qs[_0x29e4('0x38')](_0x37ccbf['query'][_0x29e4('0x38')]);_0x5e3597['where']=qs[_0x29e4('0x32')](_['pick'](_0x37ccbf[_0x29e4('0x30')],_0x56d3e4[_0x29e4('0x32')]),_0x83e599);if(_0x37ccbf[_0x29e4('0x30')][_0x29e4('0x39')]){_0x5e3597[_0x29e4('0x3a')]=_['merge'](_0x5e3597['where'],{'$or':_['map'](_0x83e599,function(_0x1e1608){if(_0x1e1608[_0x29e4('0x2e')]!==_0x29e4('0x3b')){var _0x630ed={};_0x630ed[_0x1e1608[_0x29e4('0x28')]]={'$like':'%'+_0x37ccbf[_0x29e4('0x30')][_0x29e4('0x39')]+'%'};return _0x630ed;}})});}_0x5e3597=_[_0x29e4('0x3c')]({},_0x5e3597,_0x37ccbf[_0x29e4('0x3d')]);var _0x5c8fd0={'where':_0x5e3597[_0x29e4('0x3a')]};return db[_0x29e4('0x2b')][_0x29e4('0x1e')](_0x5c8fd0)[_0x29e4('0x24')](function(_0x1153f9){_0x1b8f6e[_0x29e4('0x1e')]=_0x1153f9;if(_0x37ccbf[_0x29e4('0x30')]['includeAll']){_0x5e3597[_0x29e4('0x3e')]=[{'all':!![]}];}return db[_0x29e4('0x2b')][_0x29e4('0x3f')](_0x5e3597);})[_0x29e4('0x24')](function(_0x33b813){_0x1b8f6e[_0x29e4('0x40')]=_0x33b813;return _0x1b8f6e;})[_0x29e4('0x24')](respondWithFilteredResult(_0x1be8e5,_0x5e3597))[_0x29e4('0x41')](handleError(_0x1be8e5,null));};exports[_0x29e4('0x42')]=function(_0xba2345,_0x342fec){var _0x2415a9={'raw':!![],'where':{'id':_0xba2345[_0x29e4('0x43')]['id']}},_0x189f28={};_0x189f28[_0x29e4('0x2f')]=_[_0x29e4('0x31')](db['WhatsappTransferReport']['rawAttributes']);_0x189f28[_0x29e4('0x30')]=_[_0x29e4('0x31')](_0xba2345[_0x29e4('0x30')]);_0x189f28['filters']=_[_0x29e4('0x33')](_0x189f28[_0x29e4('0x2f')],_0x189f28[_0x29e4('0x30')]);_0x2415a9[_0x29e4('0x34')]=_[_0x29e4('0x33')](_0x189f28[_0x29e4('0x2f')],qs['fields'](_0xba2345[_0x29e4('0x30')][_0x29e4('0x35')]));_0x2415a9[_0x29e4('0x34')]=_0x2415a9[_0x29e4('0x34')][_0x29e4('0x44')]?_0x2415a9[_0x29e4('0x34')]:_0x189f28[_0x29e4('0x2f')];if(_0xba2345[_0x29e4('0x30')][_0x29e4('0x45')]){_0x2415a9[_0x29e4('0x3e')]=[{'all':!![]}];}_0x2415a9=_['merge']({},_0x2415a9,_0xba2345[_0x29e4('0x3d')]);return db['WhatsappTransferReport']['find'](_0x2415a9)[_0x29e4('0x24')](handleEntityNotFound(_0x342fec,null))[_0x29e4('0x24')](respondWithResult(_0x342fec,null))[_0x29e4('0x41')](handleError(_0x342fec,null));};exports[_0x29e4('0x46')]=function(_0x5011fa,_0x465623){return db[_0x29e4('0x2b')][_0x29e4('0x46')](_0x5011fa['body'],{})[_0x29e4('0x24')](respondWithResult(_0x465623,0xc9))[_0x29e4('0x41')](handleError(_0x465623,null));};exports[_0x29e4('0x23')]=function(_0x30698a,_0x269244){if(_0x30698a['body']['id']){delete _0x30698a[_0x29e4('0x47')]['id'];}return db[_0x29e4('0x2b')][_0x29e4('0x48')]({'where':{'id':_0x30698a['params']['id']}})[_0x29e4('0x24')](handleEntityNotFound(_0x269244,null))[_0x29e4('0x24')](saveUpdates(_0x30698a['body'],null))['then'](respondWithResult(_0x269244,null))[_0x29e4('0x41')](handleError(_0x269244,null));};exports[_0x29e4('0x25')]=function(_0x44540c,_0x4ce21b){return db[_0x29e4('0x2b')]['find']({'where':{'id':_0x44540c[_0x29e4('0x43')]['id']}})[_0x29e4('0x24')](handleEntityNotFound(_0x4ce21b,null))[_0x29e4('0x24')](removeEntity(_0x4ce21b,null))[_0x29e4('0x41')](handleError(_0x4ce21b,null));};exports[_0x29e4('0x49')]=function(_0x3fba3e,_0x5d193a){return db[_0x29e4('0x2b')][_0x29e4('0x49')]()[_0x29e4('0x24')](respondWithResult(_0x5d193a,null))[_0x29e4('0x41')](handleError(_0x5d193a,null));}; \ No newline at end of file +var _0xd3a2=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','apply','reject','update','then','destroy','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','fieldName','type','map','query','keys','model','attributes','intersection','fields','length','sort','where','filters','pick','filter','options','includeAll','include','findAll','catch','show','params','merge','find','create','body','describe','rimraf','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd3a2,0x7c));var _0x2d3a=function(_0x331c7f,_0x3182be){_0x331c7f=_0x331c7f-0x0;var _0x1f9cf5=_0xd3a2[_0x331c7f];return _0x1f9cf5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d3a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2d3a('0x1'));var moment=require('moment');var BPromise=require(_0x2d3a('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2d3a('0x3'));var sox=require(_0x2d3a('0x4'));var csv=require(_0x2d3a('0x5'));var ejs=require(_0x2d3a('0x6'));var fs=require('fs');var fs_extra=require(_0x2d3a('0x7'));var _=require('lodash');var squel=require(_0x2d3a('0x8'));var crypto=require('crypto');var jsforce=require(_0x2d3a('0x9'));var deskjs=require(_0x2d3a('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2d3a('0xb'));var authService=require(_0x2d3a('0xc'));var qs=require(_0x2d3a('0xd'));var as=require(_0x2d3a('0xe'));var hardwareService=require(_0x2d3a('0xf'));var logger=require(_0x2d3a('0x10'))(_0x2d3a('0x11'));var utils=require(_0x2d3a('0x12'));var config=require(_0x2d3a('0x13'));var licenseUtil=require(_0x2d3a('0x14'));var db=require(_0x2d3a('0x15'))['db'];function respondWithStatusCode(_0x417e19,_0x21bc31){_0x21bc31=_0x21bc31||0xcc;return function(_0x234d89){if(_0x234d89){return _0x417e19['sendStatus'](_0x21bc31);}return _0x417e19['status'](_0x21bc31)[_0x2d3a('0x16')]();};}function respondWithResult(_0x249aaf,_0x352127){_0x352127=_0x352127||0xc8;return function(_0x5d6e53){if(_0x5d6e53){return _0x249aaf['status'](_0x352127)[_0x2d3a('0x17')](_0x5d6e53);}};}function respondWithFilteredResult(_0x272006,_0x3d8b73){return function(_0x783914){if(_0x783914){var _0x2049a0=typeof _0x3d8b73[_0x2d3a('0x18')]===_0x2d3a('0x19')&&typeof _0x3d8b73[_0x2d3a('0x1a')]==='undefined';var _0x341c07=_0x783914[_0x2d3a('0x1b')];var _0x150867=_0x2049a0?0x0:_0x3d8b73['offset'];var _0x49bd34=_0x2049a0?_0x783914['count']:_0x3d8b73[_0x2d3a('0x18')]+_0x3d8b73[_0x2d3a('0x1a')];var _0x416cfb;if(_0x49bd34>=_0x341c07){_0x49bd34=_0x341c07;_0x416cfb=0xc8;}else{_0x416cfb=0xce;}_0x272006[_0x2d3a('0x1c')](_0x416cfb);return _0x272006[_0x2d3a('0x1d')]('Content-Range',_0x150867+'-'+_0x49bd34+'/'+_0x341c07)[_0x2d3a('0x17')](_0x783914);}return null;};}function patchUpdates(_0x5116c8){return function(_0x5e60d7){try{jsonpatch[_0x2d3a('0x1e')](_0x5e60d7,_0x5116c8,!![]);}catch(_0x34434d){return BPromise[_0x2d3a('0x1f')](_0x34434d);}return _0x5e60d7['save']();};}function saveUpdates(_0xb164f2,_0x5eda23){return function(_0x281daa){if(_0x281daa){return _0x281daa[_0x2d3a('0x20')](_0xb164f2)[_0x2d3a('0x21')](function(_0x294b23){return _0x294b23;});}return null;};}function removeEntity(_0x6b8ca,_0x4fad85){return function(_0x408f12){if(_0x408f12){return _0x408f12[_0x2d3a('0x22')]()['then'](function(){_0x6b8ca['status'](0xcc)[_0x2d3a('0x16')]();});}};}function handleEntityNotFound(_0x5da2de,_0x217d8e){return function(_0x480636){if(!_0x480636){_0x5da2de['sendStatus'](0x194);}return _0x480636;};}function handleError(_0x335dd0,_0x3481fd){_0x3481fd=_0x3481fd||0x1f4;return function(_0x386f11){logger[_0x2d3a('0x23')](_0x386f11[_0x2d3a('0x24')]);if(_0x386f11[_0x2d3a('0x25')]){delete _0x386f11[_0x2d3a('0x25')];}_0x335dd0['status'](_0x3481fd)[_0x2d3a('0x26')](_0x386f11);};}exports[_0x2d3a('0x27')]=function(_0x216951,_0x3e47d3){var _0x5f1cc2={},_0x33650b={},_0x4e6525={'count':0x0,'rows':[]};var _0x16f7e4=_['map'](db[_0x2d3a('0x28')][_0x2d3a('0x29')],function(_0x2fa806){return{'name':_0x2fa806[_0x2d3a('0x2a')],'type':_0x2fa806[_0x2d3a('0x2b')]['key']};});_0x33650b['model']=_[_0x2d3a('0x2c')](_0x16f7e4,_0x2d3a('0x25'));_0x33650b[_0x2d3a('0x2d')]=_[_0x2d3a('0x2e')](_0x216951[_0x2d3a('0x2d')]);_0x33650b['filters']=_['intersection'](_0x33650b[_0x2d3a('0x2f')],_0x33650b[_0x2d3a('0x2d')]);_0x5f1cc2[_0x2d3a('0x30')]=_[_0x2d3a('0x31')](_0x33650b[_0x2d3a('0x2f')],qs[_0x2d3a('0x32')](_0x216951['query'][_0x2d3a('0x32')]));_0x5f1cc2[_0x2d3a('0x30')]=_0x5f1cc2['attributes'][_0x2d3a('0x33')]?_0x5f1cc2[_0x2d3a('0x30')]:_0x33650b[_0x2d3a('0x2f')];if(!_0x216951[_0x2d3a('0x2d')]['hasOwnProperty']('nolimit')){_0x5f1cc2[_0x2d3a('0x1a')]=qs[_0x2d3a('0x1a')](_0x216951[_0x2d3a('0x2d')][_0x2d3a('0x1a')]);_0x5f1cc2[_0x2d3a('0x18')]=qs[_0x2d3a('0x18')](_0x216951[_0x2d3a('0x2d')]['offset']);}_0x5f1cc2['order']=qs[_0x2d3a('0x34')](_0x216951['query'][_0x2d3a('0x34')]);_0x5f1cc2[_0x2d3a('0x35')]=qs[_0x2d3a('0x36')](_[_0x2d3a('0x37')](_0x216951[_0x2d3a('0x2d')],_0x33650b[_0x2d3a('0x36')]),_0x16f7e4);if(_0x216951[_0x2d3a('0x2d')]['filter']){_0x5f1cc2[_0x2d3a('0x35')]=_['merge'](_0x5f1cc2[_0x2d3a('0x35')],{'$or':_[_0x2d3a('0x2c')](_0x16f7e4,function(_0x5beb6e){if(_0x5beb6e[_0x2d3a('0x2b')]!=='VIRTUAL'){var _0x5de148={};_0x5de148[_0x5beb6e['name']]={'$like':'%'+_0x216951[_0x2d3a('0x2d')][_0x2d3a('0x38')]+'%'};return _0x5de148;}})});}_0x5f1cc2=_['merge']({},_0x5f1cc2,_0x216951[_0x2d3a('0x39')]);var _0x5bf6e5={'where':_0x5f1cc2[_0x2d3a('0x35')]};return db[_0x2d3a('0x28')][_0x2d3a('0x1b')](_0x5bf6e5)[_0x2d3a('0x21')](function(_0x5a0a80){_0x4e6525['count']=_0x5a0a80;if(_0x216951['query'][_0x2d3a('0x3a')]){_0x5f1cc2[_0x2d3a('0x3b')]=[{'all':!![]}];}return db[_0x2d3a('0x28')][_0x2d3a('0x3c')](_0x5f1cc2);})[_0x2d3a('0x21')](function(_0x3f713e){_0x4e6525['rows']=_0x3f713e;return _0x4e6525;})[_0x2d3a('0x21')](respondWithFilteredResult(_0x3e47d3,_0x5f1cc2))[_0x2d3a('0x3d')](handleError(_0x3e47d3,null));};exports[_0x2d3a('0x3e')]=function(_0x11e922,_0x181a68){var _0x391a52={'raw':!![],'where':{'id':_0x11e922[_0x2d3a('0x3f')]['id']}},_0x424abb={};_0x424abb['model']=_['keys'](db[_0x2d3a('0x28')][_0x2d3a('0x29')]);_0x424abb[_0x2d3a('0x2d')]=_[_0x2d3a('0x2e')](_0x11e922[_0x2d3a('0x2d')]);_0x424abb[_0x2d3a('0x36')]=_[_0x2d3a('0x31')](_0x424abb[_0x2d3a('0x2f')],_0x424abb[_0x2d3a('0x2d')]);_0x391a52[_0x2d3a('0x30')]=_[_0x2d3a('0x31')](_0x424abb[_0x2d3a('0x2f')],qs[_0x2d3a('0x32')](_0x11e922[_0x2d3a('0x2d')][_0x2d3a('0x32')]));_0x391a52['attributes']=_0x391a52['attributes'][_0x2d3a('0x33')]?_0x391a52['attributes']:_0x424abb[_0x2d3a('0x2f')];if(_0x11e922[_0x2d3a('0x2d')]['includeAll']){_0x391a52[_0x2d3a('0x3b')]=[{'all':!![]}];}_0x391a52=_[_0x2d3a('0x40')]({},_0x391a52,_0x11e922[_0x2d3a('0x39')]);return db['WhatsappTransferReport'][_0x2d3a('0x41')](_0x391a52)['then'](handleEntityNotFound(_0x181a68,null))['then'](respondWithResult(_0x181a68,null))[_0x2d3a('0x3d')](handleError(_0x181a68,null));};exports['create']=function(_0xa50da9,_0x11896d){return db['WhatsappTransferReport'][_0x2d3a('0x42')](_0xa50da9[_0x2d3a('0x43')],{})['then'](respondWithResult(_0x11896d,0xc9))[_0x2d3a('0x3d')](handleError(_0x11896d,null));};exports[_0x2d3a('0x20')]=function(_0xd1978a,_0x7100bd){if(_0xd1978a[_0x2d3a('0x43')]['id']){delete _0xd1978a[_0x2d3a('0x43')]['id'];}return db[_0x2d3a('0x28')][_0x2d3a('0x41')]({'where':{'id':_0xd1978a[_0x2d3a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x7100bd,null))[_0x2d3a('0x21')](saveUpdates(_0xd1978a['body'],null))['then'](respondWithResult(_0x7100bd,null))['catch'](handleError(_0x7100bd,null));};exports[_0x2d3a('0x22')]=function(_0x3c6f93,_0x254eb7){return db[_0x2d3a('0x28')][_0x2d3a('0x41')]({'where':{'id':_0x3c6f93[_0x2d3a('0x3f')]['id']}})[_0x2d3a('0x21')](handleEntityNotFound(_0x254eb7,null))[_0x2d3a('0x21')](removeEntity(_0x254eb7,null))[_0x2d3a('0x3d')](handleError(_0x254eb7,null));};exports[_0x2d3a('0x44')]=function(_0x5a1d92,_0x455151){return db['WhatsappTransferReport'][_0x2d3a('0x44')]()[_0x2d3a('0x21')](respondWithResult(_0x455151,null))[_0x2d3a('0x3d')](handleError(_0x455151,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index ab0bbec..4ed032f 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 _0xd7cc=['api','moment','request-promise','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0xc86474,_0x57941c){var _0x3f5927=function(_0x3e7666){while(--_0x3e7666){_0xc86474['push'](_0xc86474['shift']());}};_0x3f5927(++_0x57941c);}(_0xd7cc,0x8c));var _0xcd7c=function(_0x400082,_0x46e27f){_0x400082=_0x400082-0x0;var _0xac278e=_0xd7cc[_0x400082];return _0xac278e;};'use strict';var _=require(_0xcd7c('0x0'));var util=require(_0xcd7c('0x1'));var logger=require(_0xcd7c('0x2'))(_0xcd7c('0x3'));var moment=require(_0xcd7c('0x4'));var BPromise=require('bluebird');var rp=require(_0xcd7c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd7c('0x6'));var config=require('../../config/environment');var attributes=require(_0xcd7c('0x7'));module[_0xcd7c('0x8')]=function(_0x425267,_0xf3f8ff){return _0x425267[_0xcd7c('0x9')](_0xcd7c('0xa'),attributes,{'tableName':_0xcd7c('0xb'),'paranoid':![],'indexes':[{'name':_0xcd7c('0xc'),'fields':[_0xcd7c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba71=['report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','./whatsappTransferReport.attributes','define','WhatsappTransferReport'];(function(_0x1e3621,_0x311da9){var _0x2cd41b=function(_0x310beb){while(--_0x310beb){_0x1e3621['push'](_0x1e3621['shift']());}};_0x2cd41b(++_0x311da9);}(_0xba71,0xaa));var _0x1ba7=function(_0xa34fa6,_0x43bff6){_0xa34fa6=_0xa34fa6-0x0;var _0xc3250c=_0xba71[_0xa34fa6];return _0xc3250c;};'use strict';var _=require(_0x1ba7('0x0'));var util=require(_0x1ba7('0x1'));var logger=require(_0x1ba7('0x2'))(_0x1ba7('0x3'));var moment=require(_0x1ba7('0x4'));var BPromise=require(_0x1ba7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ba7('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1ba7('0x7'));module['exports']=function(_0x1e0a80,_0x188a8d){return _0x1e0a80[_0x1ba7('0x8')](_0x1ba7('0x9'),attributes,{'tableName':_0x1ba7('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1ba7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index fb2b965..d44105e 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 _0x2a4c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','lodash'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x2a4c,0x1b4));var _0xc2a4=function(_0x4f9d6f,_0x23ffda){_0x4f9d6f=_0x4f9d6f-0x0;var _0x550084=_0x2a4c[_0x4f9d6f];return _0x550084;};'use strict';var _=require(_0xc2a4('0x0'));var util=require(_0xc2a4('0x1'));var moment=require(_0xc2a4('0x2'));var BPromise=require(_0xc2a4('0x3'));var rs=require(_0xc2a4('0x4'));var fs=require('fs');var Redis=require(_0xc2a4('0x5'));var db=require(_0xc2a4('0x6'))['db'];var utils=require(_0xc2a4('0x7'));var logger=require('../../config/logger')(_0xc2a4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc2a4('0x9')][_0xc2a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x172388,_0x559021,_0x18792e){return new BPromise(function(_0x2d67d8,_0x510a30){return client[_0xc2a4('0xb')](_0x172388,_0x18792e)['then'](function(_0x1063d4){logger[_0xc2a4('0xc')](_0xc2a4('0xd'),_0x559021,'request\x20sent');logger[_0xc2a4('0xe')](_0xc2a4('0xf'),_0x559021,_0xc2a4('0x10'),JSON['stringify'](_0x1063d4));if(_0x1063d4[_0xc2a4('0x11')]){if(_0x1063d4[_0xc2a4('0x11')]['code']===0x1f4){logger[_0xc2a4('0x11')](_0xc2a4('0xd'),_0x559021,_0x1063d4[_0xc2a4('0x11')][_0xc2a4('0x12')]);return _0x510a30(_0x1063d4['error'][_0xc2a4('0x12')]);}logger['error'](_0xc2a4('0xd'),_0x559021,_0x1063d4[_0xc2a4('0x11')][_0xc2a4('0x12')]);return _0x2d67d8(_0x1063d4['error'][_0xc2a4('0x12')]);}else{logger[_0xc2a4('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x559021,_0xc2a4('0x10'));_0x2d67d8(_0x1063d4['result']['message']);}})['catch'](function(_0x35ecec){logger['error'](_0xc2a4('0xd'),_0x559021,_0x35ecec);_0x510a30(_0x35ecec);});});} \ No newline at end of file +var _0x801b=['WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/environment','client','request','then','info','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x801b,0x15d));var _0xb801=function(_0x8ad3ea,_0x57e304){_0x8ad3ea=_0x8ad3ea-0x0;var _0x4fec3e=_0x801b[_0x8ad3ea];return _0x4fec3e;};'use strict';var _=require(_0xb801('0x0'));var util=require(_0xb801('0x1'));var moment=require('moment');var BPromise=require(_0xb801('0x2'));var rs=require(_0xb801('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb801('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb801('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb801('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d5205,_0x1e104a,_0x1c7747){return new BPromise(function(_0x37377f,_0x209192){return client[_0xb801('0x7')](_0x1d5205,_0x1c7747)[_0xb801('0x8')](function(_0xe710c4){logger[_0xb801('0x9')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1e104a,_0xb801('0xa'));logger[_0xb801('0xb')](_0xb801('0xc'),_0x1e104a,_0xb801('0xa'),JSON[_0xb801('0xd')](_0xe710c4));if(_0xe710c4[_0xb801('0xe')]){if(_0xe710c4['error'][_0xb801('0xf')]===0x1f4){logger[_0xb801('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1e104a,_0xe710c4[_0xb801('0xe')][_0xb801('0x10')]);return _0x209192(_0xe710c4['error'][_0xb801('0x10')]);}logger[_0xb801('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1e104a,_0xe710c4[_0xb801('0xe')][_0xb801('0x10')]);return _0x37377f(_0xe710c4[_0xb801('0xe')][_0xb801('0x10')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x1e104a,_0xb801('0xa'));_0x37377f(_0xe710c4[_0xb801('0x11')][_0xb801('0x10')]);}})[_0xb801('0x12')](function(_0x3a33bd){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x1e104a,_0x3a33bd);_0x209192(_0x3a33bd);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index e1143c1..868ccee 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09f4=['join','map','status','online','None','App\x20Ready!','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','sequelize','sync','then','seedDB','default','start','info','filter','exitCode','number','length','name','Online\x20apps:'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x09f4,0xe4));var _0x409f=function(_0x1ae585,_0x5ea5b5){_0x1ae585=_0x1ae585-0x0;var _0x209a9b=_0x09f4[_0x1ae585];return _0x209a9b;};'use strict';var _=require('lodash');var db=require('./mysqldb')['db'];var seedDb=require(_0x409f('0x0'));var checkLicense=require(_0x409f('0x1'));var rpc=require(_0x409f('0x2'));var config=require(_0x409f('0x3'));var logger=require(_0x409f('0x4'))(_0x409f('0x5'));var pm2=require(_0x409f('0x6'));var pm2Config=require(_0x409f('0x7'));var schedule=require(_0x409f('0x8'));var chat=require(_0x409f('0x9'));var whatsapp=require(_0x409f('0xa'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x409f('0xb')][_0x409f('0xc')]()[_0x409f('0xd')](function(){if(config[_0x409f('0xe')]){return seedDb[_0x409f('0xf')]();}})[_0x409f('0xd')](function(){return checkLicense[_0x409f('0xf')]();})[_0x409f('0xd')](function(){return rpc['listen']();})[_0x409f('0xd')](function(_0x4a8658){logger['info'](_0x4a8658);return chat[_0x409f('0x10')]();})[_0x409f('0xd')](function(){return whatsapp[_0x409f('0x10')]();})['then'](function(){return schedule['start']();})[_0x409f('0xd')](function(){return transcribe[_0x409f('0x10')]();})[_0x409f('0xd')](function(){return provider[_0x409f('0x10')]();})[_0x409f('0xd')](function(_0x3234c3){logger[_0x409f('0x11')](_0x3234c3);return pm2['start'](pm2Config);})[_0x409f('0xd')](function(_0x55e557){var _0x3ec157=_0x55e557[_0x409f('0x12')](function(_0x5edeaf){return typeof _0x5edeaf[_0x409f('0x13')]===_0x409f('0x14')&&_0x5edeaf[_0x409f('0x13')]>=0x0;});if(_0x3ec157[_0x409f('0x15')]>0x0){throw new Error(_0x3ec157[_0x409f('0x15')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x3ec157,function(_0x54b98a){return'\x22'+_0x54b98a['pm2_env'][_0x409f('0x16')]+'\x22';}));}logger[_0x409f('0x11')](_0x409f('0x17'),_['map'](_[_0x409f('0x12')](_0x55e557,{'status':'online'}),_0x409f('0x16'))[_0x409f('0x18')]());logger['info']('Offline\x20apps:',_[_0x409f('0x19')](_['filter'](_0x55e557,function(_0x4098f3){return _0x4098f3[_0x409f('0x1a')]!==_0x409f('0x1b');}),'name')[_0x409f('0x18')]()||_0x409f('0x1c'));console['log'](_0x409f('0x1d'));})[_0x409f('0x1e')](function(_0x477c97){console[_0x409f('0x1f')](_0x409f('0x20'),_0x477c97);logger[_0x409f('0x21')](_0x409f('0x22'),_0x477c97);process[_0x409f('0x23')](0x1);});}main(); \ No newline at end of file +var _0xd5da=['./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','default','start','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','info','Online\x20apps:','online','join','filter','name','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/license','./rpc','./config/environment','app'];(function(_0x48d218,_0x38ae7b){var _0x5d86c7=function(_0x362ae9){while(--_0x362ae9){_0x48d218['push'](_0x48d218['shift']());}};_0x5d86c7(++_0x38ae7b);}(_0xd5da,0x9f));var _0xad5d=function(_0xeea013,_0x3332c8){_0xeea013=_0xeea013-0x0;var _0x555d2e=_0xd5da[_0xeea013];return _0x555d2e;};'use strict';var _=require(_0xad5d('0x0'));var db=require(_0xad5d('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xad5d('0x2'));var rpc=require(_0xad5d('0x3'));var config=require(_0xad5d('0x4'));var logger=require('./config/logger')(_0xad5d('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0xad5d('0x6'));var schedule=require(_0xad5d('0x7'));var chat=require(_0xad5d('0x8'));var whatsapp=require(_0xad5d('0x9'));var transcribe=require(_0xad5d('0xa'));var provider=require(_0xad5d('0xb'));function main(){return db[_0xad5d('0xc')][_0xad5d('0xd')]()[_0xad5d('0xe')](function(){if(config['seedDB']){return seedDb[_0xad5d('0xf')]();}})[_0xad5d('0xe')](function(){return checkLicense['default']();})[_0xad5d('0xe')](function(){return rpc['listen']();})[_0xad5d('0xe')](function(_0xf1b97c){logger['info'](_0xf1b97c);return chat[_0xad5d('0x10')]();})[_0xad5d('0xe')](function(){return whatsapp['start']();})[_0xad5d('0xe')](function(){return schedule[_0xad5d('0x10')]();})['then'](function(){return transcribe[_0xad5d('0x10')]();})['then'](function(){return provider[_0xad5d('0x10')]();})['then'](function(_0x37921f){logger['info'](_0x37921f);return pm2[_0xad5d('0x10')](pm2Config);})['then'](function(_0x16ef55){var _0x2dbf2d=_0x16ef55['filter'](function(_0x4bb9e5){return typeof _0x4bb9e5[_0xad5d('0x11')]==='number'&&_0x4bb9e5['exitCode']>=0x0;});if(_0x2dbf2d['length']>0x0){throw new Error(_0x2dbf2d[_0xad5d('0x12')]+_0xad5d('0x13')+_[_0xad5d('0x14')](_0x2dbf2d,function(_0x4c706e){return'\x22'+_0x4c706e['pm2_env']['name']+'\x22';}));}logger[_0xad5d('0x15')](_0xad5d('0x16'),_['map'](_['filter'](_0x16ef55,{'status':_0xad5d('0x17')}),'name')[_0xad5d('0x18')]());logger[_0xad5d('0x15')]('Offline\x20apps:',_[_0xad5d('0x14')](_[_0xad5d('0x19')](_0x16ef55,function(_0x41061d){return _0x41061d['status']!==_0xad5d('0x17');}),_0xad5d('0x1a'))[_0xad5d('0x18')]()||_0xad5d('0x1b'));console[_0xad5d('0x1c')]('App\x20Ready!');})[_0xad5d('0x1d')](function(_0x40b72c){console[_0xad5d('0x1c')](_0xad5d('0x1e'),_0x40b72c);logger[_0xad5d('0x1f')](_0xad5d('0x20'),_0x40b72c);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 9c0753c..03d212c 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 _0xa724=['split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','promisify','secret','payload','options','verify','randomBytes','hex','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','util','moment','secrets','session','role','internal','userpic','permissions','voicePause','chatPause','mailPause','smsPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','query','forceDownload','status','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','startsWith','authorization','Basic','find','name','then','authenticate','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','allowedLoginAttempts','isEqual','apiKeyNonce','disabled','Invalid\x20API\x20access\x20key','blockDuration','blockedAt','User','User\x20not\x20found.','User\x20object\x20not\x20found.','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString'];(function(_0x5e7a1c,_0x55a07d){var _0x30da92=function(_0x30f4fd){while(--_0x30f4fd){_0x5e7a1c['push'](_0x5e7a1c['shift']());}};_0x30da92(++_0x55a07d);}(_0xa724,0x19a));var _0x4a72=function(_0x4c1cea,_0x3716e8){_0x4c1cea=_0x4c1cea-0x0;var _0x314b86=_0xa724[_0x4c1cea];return _0x314b86;};'use strict';var db=require(_0x4a72('0x0'))['db'];var config=require(_0x4a72('0x1'));var hardwareConf=require(_0x4a72('0x2'));var licenseUtil=require(_0x4a72('0x3'));var encryptor=require('../encryptor');var _=require(_0x4a72('0x4'));var jwt=require(_0x4a72('0x5'));var expressJwt=require(_0x4a72('0x6'));var compose=require('composable-middleware');var basicAuth=require(_0x4a72('0x7'));var crypto=require(_0x4a72('0x8'));var BPromise=require('bluebird');var util=require(_0x4a72('0x9'));var moment=require(_0x4a72('0xa'));var validateJwt=expressJwt({'secret':config[_0x4a72('0xb')][_0x4a72('0xc')]});var userAttributes=['id',_0x4a72('0xd'),'fullname','name',_0x4a72('0xe'),'email',_0x4a72('0xf'),_0x4a72('0x10'),'md5secret',_0x4a72('0x11'),_0x4a72('0x12'),_0x4a72('0x13'),'faxPause',_0x4a72('0x14'),'openchannelPause','pauseType',_0x4a72('0x15'),_0x4a72('0x16'),_0x4a72('0x17'),_0x4a72('0x18'),_0x4a72('0x19'),_0x4a72('0x1a'),_0x4a72('0x1b'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay',_0x4a72('0x1c'),_0x4a72('0x1d'),_0x4a72('0x1e'),'phoneBarEnableSettings',_0x4a72('0x1f'),_0x4a72('0x20'),_0x4a72('0x21'),'phoneBarRemoteControlPort',_0x4a72('0x22'),_0x4a72('0x23'),'userProfileId','privacyEnabled',_0x4a72('0x24'),'wssPort',_0x4a72('0x25'),_0x4a72('0x26'),'downloadAttachments',_0x4a72('0x27'),'selectRecallMeCampaign',_0x4a72('0x28'),_0x4a72('0x29'),_0x4a72('0x2a'),_0x4a72('0x2b'),_0x4a72('0x2c'),_0x4a72('0x2d'),'openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer',_0x4a72('0x2e'),_0x4a72('0x2f')];exports[_0x4a72('0x30')]=function(){return this[_0x4a72('0x31')](!![])[_0x4a72('0x32')](function(_0x1742e4,_0x335670,_0x532214){if(_0x1742e4[_0x4a72('0x33')]){_0x532214();}else{return db[_0x4a72('0x34')][_0x4a72('0x35')]({'where':{'id':_0x1742e4['params']['id']},'attributes':['id',_0x4a72('0x36'),_0x4a72('0x37')],'raw':!![]})['then'](function(_0x1b48a4){if(_0x1b48a4&&_0x1b48a4['closed']&&!_0x1742e4[_0x4a72('0x38')][_0x4a72('0x39')]){return _0x335670[_0x4a72('0x3a')](_0x1b48a4[_0x4a72('0x37')]===_0x4a72('0x3b')?0x195:0x193)[_0x4a72('0x3c')]({'message':_0x1b48a4['disposition']===_0x4a72('0x3b')?_0x4a72('0x3d'):_0x4a72('0x3e')});}else{_0x532214();}})[_0x4a72('0x3f')](function(_0x4978cc){_0x532214(_0x4978cc);});}});};exports[_0x4a72('0x31')]=function isAuthenticated(_0x2fa329){return compose()[_0x4a72('0x32')](function(_0x583c15,_0xcf8828,_0x1ca088){var _0x27f241;if(_0x583c15[_0x4a72('0x40')]['authorization']){if(_[_0x4a72('0x41')](_0x583c15[_0x4a72('0x40')][_0x4a72('0x42')],_0x4a72('0x43'))){var _0x12266c=basicAuth(_0x583c15);db['User'][_0x4a72('0x44')]({'where':{'name':_0x12266c[_0x4a72('0x45')]}})[_0x4a72('0x46')](function(_0x1ff7b4){if(!_0x1ff7b4||!_0x1ff7b4[_0x4a72('0x47')](_0x12266c['pass'])){return _0xcf8828[_0x4a72('0x3a')](0x191)[_0x4a72('0x3c')]({'message':_0x4a72('0x48')});}_0x583c15['user']={'id':_0x1ff7b4['id']};_0x1ca088();})[_0x4a72('0x3f')](function(_0x3ee605){_0x1ca088(_0x3ee605);});}else if(_[_0x4a72('0x41')](_0x583c15[_0x4a72('0x40')][_0x4a72('0x42')],_0x4a72('0x49'))){validateJwt(_0x583c15,_0xcf8828,_0x1ca088);}else{if(_0x2fa329){_0x1ca088();}else{return _0xcf8828['status'](0x193)[_0x4a72('0x3c')]({'message':_0x4a72('0x4a')});}}}else if(_0x583c15[_0x4a72('0x38')][_0x4a72('0x4b')]){try{var _0x553557={'audience':hardwareConf[_0x4a72('0x4c')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x583c15[_0x4a72('0x38')][_0x4a72('0x4b')],_0x553557)[_0x4a72('0x46')](function(_0x376f2c){return db['User'][_0x4a72('0x44')]({'where':{'id':_0x376f2c['sub']}})[_0x4a72('0x46')](function(_0x5f7c56){_0x27f241=_0x5f7c56;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x4a72('0x4d'),'blockDuration'],'raw':!![]});})[_0x4a72('0x46')](function(_0xf27b98){if(!_0x27f241||!_[_0x4a72('0x4e')](_0x27f241[_0x4a72('0x4f')],_0x376f2c['nonce'])){return _0xcf8828[_0x4a72('0x3a')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x27f241[_0x4a72('0x50')]){return _0xcf8828['status'](0x191)[_0x4a72('0x3c')]({'message':_0x4a72('0x51')});}if(_0x27f241['blocked']){if(_0xf27b98[_0x4a72('0x52')]>0x0){if(moment(_0x27f241[_0x4a72('0x53')])['add'](_0xf27b98[_0x4a72('0x52')],'minutes')>moment()){return _0xcf8828[_0x4a72('0x3a')](0x191)[_0x4a72('0x3c')]({'message':_0x4a72('0x51')});}}else{return _0xcf8828[_0x4a72('0x3a')](0x191)[_0x4a72('0x3c')]({'message':_0x4a72('0x51')});}}_0x583c15['user']={'id':_0x27f241['id']};_0x1ca088();});})[_0x4a72('0x3f')](function(){return _0xcf8828['status'](0x191)['json']({'message':_0x4a72('0x51')});});}catch(_0x47a674){_0x1ca088(_0x47a674);}}else if(_0x2fa329){_0x1ca088();}else{return _0xcf8828[_0x4a72('0x3a')](0x193)[_0x4a72('0x3c')]({'message':'Unknown\x20authorization\x20format'});}})[_0x4a72('0x32')](function(_0xe94b10,_0x1ba4ba,_0x211ff7){if(_0xe94b10['user']){db[_0x4a72('0x54')]['find']({'where':{'id':_0xe94b10[_0x4a72('0x33')]['id']},'attributes':userAttributes})[_0x4a72('0x46')](function(_0x91606e){if(!_0x91606e){return _0x1ba4ba[_0x4a72('0x3a')](0x194)[_0x4a72('0x3c')]({'message':_0x4a72('0x55')});}_0xe94b10[_0x4a72('0x33')]=_0x91606e;_0x211ff7();})[_0x4a72('0x3f')](function(_0x346e0d){_0x211ff7(_0x346e0d);});}else if(_0x2fa329){_0x211ff7();}else{return _0x1ba4ba[_0x4a72('0x3a')](0x194)['json']({'message':_0x4a72('0x56')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x58fb6d,_0x2a1147,_0x2208f1){return licenseUtil['getLicense']()[_0x4a72('0x46')](function(_0x366b59){if(_0x366b59['update']){_0x2208f1();}else{return _0x2a1147[_0x4a72('0x3a')](0x193)['json']({'message':_0x4a72('0x57')});}})[_0x4a72('0x3f')](function(_0x300223){_0x2208f1(_0x300223);});});};exports[_0x4a72('0x58')]=function isWebrtcLicence(){return compose()[_0x4a72('0x32')](function(_0x41b357,_0x3da5ee,_0x2a13fb){return licenseUtil[_0x4a72('0x59')]()[_0x4a72('0x46')](function(_0x4270e4){if(_0x4270e4[_0x4a72('0x5a')]){_0x2a13fb();}else{return _0x3da5ee[_0x4a72('0x3a')](0x193)['json']({'message':_0x4a72('0x57')});}})[_0x4a72('0x3f')](function(_0x2bc1cf){_0x2a13fb(_0x2bc1cf);});});};exports[_0x4a72('0x5b')]=function(_0x263733,_0x3eaf80,_0x2f6e47){_0x263733[_0x4a72('0x5b')]=!![];return _0x2f6e47();};exports[_0x4a72('0x5c')]=function signToken(_0x6536b8){return signJwt(_0x6536b8);};exports[_0x4a72('0x5d')]=function(_0x3c39bd,_0x5c7c76){if(!_0x3c39bd[_0x4a72('0x33')]){return _0x5c7c76[_0x4a72('0x3a')](0x194)[_0x4a72('0x3c')]({'message':_0x4a72('0x5e')});}var _0x29c529={'payload':{'id':_0x3c39bd[_0x4a72('0x33')]['id'],'role':_0x3c39bd['user'][_0x4a72('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x29c529)[_0x4a72('0x46')](function(_0xec1204){_0x5c7c76['cookie'](_0x4a72('0x5f'),_0xec1204);_0x5c7c76[_0x4a72('0x60')](_0x4a72('0x61'));})['catch'](function(_0x49d7a4){return _0x5c7c76[_0x4a72('0x3a')](0x1f4)[_0x4a72('0x62')](_0x49d7a4);});};exports['retrieveApiKey']=function(_0x8bc530){if(_[_0x4a72('0x63')](_0x8bc530[_0x4a72('0x4f')])||_['isNil'](_0x8bc530[_0x4a72('0x64')])){return null;}else{return createJwt(_0x8bc530);}};exports['generateApiKey']=function(_0xa643fb){_0xa643fb['apiKeyNonce']=generateNonce();_0xa643fb[_0x4a72('0x64')]=generateIssuedAt();return createJwt(_0xa643fb);};exports[_0x4a72('0x65')]=function(_0x1df0ce,_0x4a8989){var _0x33340c=_0x1df0ce[_0x4a72('0x38')][_0x4a72('0x4b')];if(_0x33340c){var _0x53e3e4={'nonce':_0x4a8989['apiKeyNonce'],'iat':_0x4a8989['apiKeyIat'],'audience':hardwareConf[_0x4a72('0x4c')](),'issuer':hardwareConf[_0x4a72('0x4c')]()};return verifyJwt(_0x33340c,_0x53e3e4)[_0x4a72('0x46')](function(){return generateApiKey(_0x4a8989);});}else{throw{'message':_0x4a72('0x66')};}};exports[_0x4a72('0x67')]=function(_0x41a4a9){var _0x1ba8b2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1ba8b2[_0x4a72('0x68')](_0x41a4a9))throw new db[(_0x4a72('0x69'))][(_0x4a72('0x6a'))](_0x4a72('0x6b'));return;};exports[_0x4a72('0x6c')]=function(_0x472cfd,_0x28fad9,_0x41d20a){var _0x3db261=encryptor[_0x4a72('0x6d')](_0x28fad9)[_0x4a72('0x6e')](',');for(var _0x2872b1=0x0;_0x2872b1<_0x41d20a;_0x2872b1++){if(!_0x3db261[_0x2872b1])break;if(_0x472cfd['toLowerCase']()===_0x3db261[_0x2872b1][_0x4a72('0x6f')]()){var _0x41cae4=util[_0x4a72('0x70')](_0x4a72('0x71'),_0x41d20a);if(_0x41d20a===0x1){_0x41cae4='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize'][(_0x4a72('0x6a'))](_0x41cae4);}}return;};exports[_0x4a72('0x72')]=function(_0x2af177,_0x3c191a){var _0x466c69=_0x3c191a?encryptor[_0x4a72('0x6d')](_0x3c191a)[_0x4a72('0x6e')](','):[];if(_0x466c69[_0x4a72('0x73')]===0x5){_0x466c69['splice'](-0x1,0x1);}_0x466c69[_0x4a72('0x74')](_0x2af177);return encryptor[_0x4a72('0x75')](_0x466c69[_0x4a72('0x76')](','));};function signJwt(_0x27bc00){var _0x3548ab=BPromise[_0x4a72('0x77')](jwt['sign'],{'context':jwt});var _0x12a861=_0x27bc00[_0x4a72('0x78')]||config[_0x4a72('0xb')][_0x4a72('0xc')];return new BPromise(function(_0x110b2f,_0x4403db){_0x3548ab(_0x27bc00[_0x4a72('0x79')],_0x12a861,_0x27bc00[_0x4a72('0x7a')])[_0x4a72('0x46')](function(_0x1b72e5){_0x110b2f(_0x1b72e5);})[_0x4a72('0x3f')](function(_0x4a78e1){_0x4403db(_0x4a78e1);});});}function verifyJwt(_0x24fbc4,_0x6ebedb,_0x45d558){var _0x27d34e=BPromise['promisify'](jwt[_0x4a72('0x7b')],{'context':jwt});var _0x20d32e=_0x45d558||config[_0x4a72('0xb')][_0x4a72('0xc')];return new BPromise(function(_0x32ba86,_0x18f0ab){_0x27d34e(_0x24fbc4,_0x20d32e,_0x6ebedb)['then'](function(_0x5bcf20){_0x32ba86(_0x5bcf20);})['catch'](function(_0x49bb86){_0x18f0ab(_0x49bb86);});});}function generateNonce(){return crypto[_0x4a72('0x7c')](0x10)['toString'](_0x4a72('0x7d'));}function generateIssuedAt(){return Math[_0x4a72('0x7e')](Date[_0x4a72('0x7f')]()/0x3e8)[_0x4a72('0x80')]();}function createJwt(_0x48d67c){var _0x4c6cc2={'payload':{'iat':_0x48d67c[_0x4a72('0x64')],'nonce':_0x48d67c[_0x4a72('0x4f')]},'options':{'algorithm':_0x4a72('0x81'),'subject':_0x48d67c['id'][_0x4a72('0x80')](),'issuer':hardwareConf[_0x4a72('0x4c')](),'audience':hardwareConf[_0x4a72('0x4c')]()}};return signJwt(_0x4c6cc2)[_0x4a72('0x46')](function(_0x19ca33){return{'iat':_0x48d67c[_0x4a72('0x64')],'nonce':_0x48d67c[_0x4a72('0x4f')],'token':_0x19ca33};});} \ No newline at end of file +var _0x052b=['Unmanaged.','Forbidden.','headers','authorization','startsWith','Basic','find','authenticate','pass','status','Wrong\x20credentials.','catch','Unknown\x20authorization\x20format','query','apikey','getUuid','User','Setting','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','length','splice','unshift','encryptString','join','promisify','sign','secret','options','toString','hex','now','HS512','../../mysqldb','../../config/environment','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','name','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','then','forceDownload','disposition','unmanaged','json'];(function(_0x21e9e4,_0x1c67b1){var _0x360674=function(_0x2566fc){while(--_0x2566fc){_0x21e9e4['push'](_0x21e9e4['shift']());}};_0x360674(++_0x1c67b1);}(_0x052b,0xdf));var _0xb052=function(_0x1d7169,_0x57a88c){_0x1d7169=_0x1d7169-0x0;var _0x3f8f5a=_0x052b[_0x1d7169];return _0x3f8f5a;};'use strict';var db=require(_0xb052('0x0'))['db'];var config=require(_0xb052('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xb052('0x2'));var encryptor=require('../encryptor');var _=require(_0xb052('0x3'));var jwt=require(_0xb052('0x4'));var expressJwt=require(_0xb052('0x5'));var compose=require(_0xb052('0x6'));var basicAuth=require(_0xb052('0x7'));var crypto=require(_0xb052('0x8'));var BPromise=require(_0xb052('0x9'));var util=require(_0xb052('0xa'));var moment=require(_0xb052('0xb'));var validateJwt=expressJwt({'secret':config[_0xb052('0xc')]['session']});var userAttributes=['id',_0xb052('0xd'),_0xb052('0xe'),_0xb052('0xf'),_0xb052('0x10'),_0xb052('0x11'),'userpic',_0xb052('0x12'),_0xb052('0x13'),_0xb052('0x14'),_0xb052('0x15'),_0xb052('0x16'),_0xb052('0x17'),_0xb052('0x18'),_0xb052('0x19'),_0xb052('0x1a'),_0xb052('0x1b'),_0xb052('0x1c'),_0xb052('0x1d'),_0xb052('0x1e'),_0xb052('0x1f'),_0xb052('0x20'),_0xb052('0x21'),_0xb052('0x22'),_0xb052('0x23'),_0xb052('0x24'),_0xb052('0x25'),_0xb052('0x26'),_0xb052('0x27'),_0xb052('0x28'),_0xb052('0x29'),_0xb052('0x2a'),_0xb052('0x2b'),'hotdesk',_0xb052('0x2c'),_0xb052('0x2d'),_0xb052('0x2e'),_0xb052('0x2f'),_0xb052('0x30'),_0xb052('0x31'),_0xb052('0x32'),_0xb052('0x33'),_0xb052('0x34'),'selectRecallMeCampaign',_0xb052('0x35'),_0xb052('0x36'),_0xb052('0x37'),_0xb052('0x38'),_0xb052('0x39'),_0xb052('0x3a'),_0xb052('0x3b'),_0xb052('0x3c'),_0xb052('0x3d'),'faxAutoanswerDelay',_0xb052('0x3e'),'whatsappAutoanswerDelay',_0xb052('0x3f')];exports[_0xb052('0x40')]=function(){return this[_0xb052('0x41')](!![])[_0xb052('0x42')](function(_0x1f1681,_0x36415a,_0x3ecba6){if(_0x1f1681[_0xb052('0x43')]){_0x3ecba6();}else{return db[_0xb052('0x44')][_0xb052('0x45')]({'where':{'id':_0x1f1681[_0xb052('0x46')]['id']},'attributes':['id',_0xb052('0x47'),'disposition'],'raw':!![]})[_0xb052('0x48')](function(_0x114c4b){if(_0x114c4b&&_0x114c4b[_0xb052('0x47')]&&!_0x1f1681['query'][_0xb052('0x49')]){return _0x36415a['status'](_0x114c4b[_0xb052('0x4a')]===_0xb052('0x4b')?0x195:0x193)[_0xb052('0x4c')]({'message':_0x114c4b['disposition']==='unmanaged'?_0xb052('0x4d'):_0xb052('0x4e')});}else{_0x3ecba6();}})['catch'](function(_0x4ee4d6){_0x3ecba6(_0x4ee4d6);});}});};exports['isAuthenticated']=function isAuthenticated(_0x2942ea){return compose()['use'](function(_0x5bf700,_0x559049,_0x3f6da5){var _0x562557;if(_0x5bf700[_0xb052('0x4f')][_0xb052('0x50')]){if(_[_0xb052('0x51')](_0x5bf700[_0xb052('0x4f')][_0xb052('0x50')],_0xb052('0x52'))){var _0x29f010=basicAuth(_0x5bf700);db['User'][_0xb052('0x53')]({'where':{'name':_0x29f010[_0xb052('0xf')]}})[_0xb052('0x48')](function(_0xc84484){if(!_0xc84484||!_0xc84484[_0xb052('0x54')](_0x29f010[_0xb052('0x55')])){return _0x559049[_0xb052('0x56')](0x191)[_0xb052('0x4c')]({'message':_0xb052('0x57')});}_0x5bf700[_0xb052('0x43')]={'id':_0xc84484['id']};_0x3f6da5();})[_0xb052('0x58')](function(_0x1dade4){_0x3f6da5(_0x1dade4);});}else if(_[_0xb052('0x51')](_0x5bf700[_0xb052('0x4f')][_0xb052('0x50')],'Bearer')){validateJwt(_0x5bf700,_0x559049,_0x3f6da5);}else{if(_0x2942ea){_0x3f6da5();}else{return _0x559049[_0xb052('0x56')](0x193)['json']({'message':_0xb052('0x59')});}}}else if(_0x5bf700[_0xb052('0x5a')][_0xb052('0x5b')]){try{var _0x37fd26={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb052('0x5c')]()};verifyJwt(_0x5bf700[_0xb052('0x5a')][_0xb052('0x5b')],_0x37fd26)['then'](function(_0x1a2826){return db[_0xb052('0x5d')][_0xb052('0x53')]({'where':{'id':_0x1a2826['sub']}})['then'](function(_0x177d41){_0x562557=_0x177d41;return db[_0xb052('0x5e')][_0xb052('0x45')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})[_0xb052('0x48')](function(_0x312203){if(!_0x562557||!_[_0xb052('0x5f')](_0x562557[_0xb052('0x60')],_0x1a2826[_0xb052('0x61')])){return _0x559049['status'](0x191)[_0xb052('0x4c')]({'message':_0xb052('0x62')});}if(_0x562557[_0xb052('0x63')]){return _0x559049[_0xb052('0x56')](0x191)[_0xb052('0x4c')]({'message':_0xb052('0x64')});}if(_0x562557[_0xb052('0x65')]){if(_0x312203[_0xb052('0x66')]>0x0){if(moment(_0x562557[_0xb052('0x67')])[_0xb052('0x68')](_0x312203[_0xb052('0x66')],'minutes')>moment()){return _0x559049[_0xb052('0x56')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x559049[_0xb052('0x56')](0x191)[_0xb052('0x4c')]({'message':_0xb052('0x64')});}}_0x5bf700['user']={'id':_0x562557['id']};_0x3f6da5();});})['catch'](function(){return _0x559049[_0xb052('0x56')](0x191)[_0xb052('0x4c')]({'message':_0xb052('0x64')});});}catch(_0x238a10){_0x3f6da5(_0x238a10);}}else if(_0x2942ea){_0x3f6da5();}else{return _0x559049[_0xb052('0x56')](0x193)[_0xb052('0x4c')]({'message':'Unknown\x20authorization\x20format'});}})[_0xb052('0x42')](function(_0x3cda07,_0x1dfee8,_0x31cd62){if(_0x3cda07[_0xb052('0x43')]){db[_0xb052('0x5d')]['find']({'where':{'id':_0x3cda07['user']['id']},'attributes':userAttributes})[_0xb052('0x48')](function(_0x4a3cc8){if(!_0x4a3cc8){return _0x1dfee8[_0xb052('0x56')](0x194)['json']({'message':_0xb052('0x69')});}_0x3cda07['user']=_0x4a3cc8;_0x31cd62();})['catch'](function(_0x4c6a1c){_0x31cd62(_0x4c6a1c);});}else if(_0x2942ea){_0x31cd62();}else{return _0x1dfee8[_0xb052('0x56')](0x194)[_0xb052('0x4c')]({'message':_0xb052('0x6a')});}});};exports[_0xb052('0x6b')]=function canUpdate(){return compose()[_0xb052('0x42')](function(_0x209a1b,_0x44aa4f,_0x707db7){return licenseUtil[_0xb052('0x6c')]()['then'](function(_0x1e4c8f){if(_0x1e4c8f[_0xb052('0x6d')]){_0x707db7();}else{return _0x44aa4f[_0xb052('0x56')](0x193)[_0xb052('0x4c')]({'message':_0xb052('0x6e')});}})['catch'](function(_0x293827){_0x707db7(_0x293827);});});};exports[_0xb052('0x6f')]=function isWebrtcLicence(){return compose()[_0xb052('0x42')](function(_0x2f7e67,_0xa36ca5,_0xffc33c){return licenseUtil[_0xb052('0x6c')]()['then'](function(_0x1d7648){if(_0x1d7648[_0xb052('0x70')]){_0xffc33c();}else{return _0xa36ca5[_0xb052('0x56')](0x193)[_0xb052('0x4c')]({'message':'Forbidden'});}})['catch'](function(_0xfef567){_0xffc33c(_0xfef567);});});};exports['isMiddleware']=function(_0x5b06ba,_0x2d95e1,_0x56120f){_0x5b06ba[_0xb052('0x71')]=!![];return _0x56120f();};exports[_0xb052('0x72')]=function signToken(_0x563c41){return signJwt(_0x563c41);};exports[_0xb052('0x73')]=function(_0x15955d,_0x3c122f){if(!_0x15955d[_0xb052('0x43')]){return _0x3c122f['status'](0x194)[_0xb052('0x4c')]({'message':_0xb052('0x74')});}var _0x1bcb6d={'payload':{'id':_0x15955d[_0xb052('0x43')]['id'],'role':_0x15955d[_0xb052('0x43')][_0xb052('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x1bcb6d)[_0xb052('0x48')](function(_0x218c5d){_0x3c122f[_0xb052('0x75')](_0xb052('0x76'),_0x218c5d);_0x3c122f[_0xb052('0x77')]('/dashboards/general');})['catch'](function(_0x212922){return _0x3c122f[_0xb052('0x56')](0x1f4)[_0xb052('0x78')](_0x212922);});};exports[_0xb052('0x79')]=function(_0x5329af){if(_[_0xb052('0x7a')](_0x5329af[_0xb052('0x60')])||_['isNil'](_0x5329af[_0xb052('0x7b')])){return null;}else{return createJwt(_0x5329af);}};exports[_0xb052('0x7c')]=function(_0x656917){_0x656917['apiKeyNonce']=generateNonce();_0x656917[_0xb052('0x7b')]=generateIssuedAt();return createJwt(_0x656917);};exports[_0xb052('0x7d')]=function(_0x4d56fd,_0x1d9c57){var _0x3b506f=_0x4d56fd[_0xb052('0x5a')][_0xb052('0x5b')];if(_0x3b506f){var _0x1d1433={'nonce':_0x1d9c57['apiKeyNonce'],'iat':_0x1d9c57[_0xb052('0x7b')],'audience':hardwareConf[_0xb052('0x5c')](),'issuer':hardwareConf[_0xb052('0x5c')]()};return verifyJwt(_0x3b506f,_0x1d1433)[_0xb052('0x48')](function(){return generateApiKey(_0x1d9c57);});}else{throw{'message':_0xb052('0x7e')};}};exports[_0xb052('0x7f')]=function(_0x9eaff2){var _0x4262fa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4262fa[_0xb052('0x80')](_0x9eaff2))throw new db[(_0xb052('0x81'))][(_0xb052('0x82'))](_0xb052('0x83'));return;};exports[_0xb052('0x84')]=function(_0x106fc3,_0x76de33,_0x19a23d){var _0x3201ee=encryptor[_0xb052('0x85')](_0x76de33)[_0xb052('0x86')](',');for(var _0x1ceef6=0x0;_0x1ceef6<_0x19a23d;_0x1ceef6++){if(!_0x3201ee[_0x1ceef6])break;if(_0x106fc3[_0xb052('0x87')]()===_0x3201ee[_0x1ceef6][_0xb052('0x87')]()){var _0x2abc86=util[_0xb052('0x88')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x19a23d);if(_0x19a23d===0x1){_0x2abc86='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xb052('0x81'))]['ValidationError'](_0x2abc86);}}return;};exports['updatePasswordsHistory']=function(_0x8305a9,_0x689964){var _0x159fd2=_0x689964?encryptor[_0xb052('0x85')](_0x689964)[_0xb052('0x86')](','):[];if(_0x159fd2[_0xb052('0x89')]===0x5){_0x159fd2[_0xb052('0x8a')](-0x1,0x1);}_0x159fd2[_0xb052('0x8b')](_0x8305a9);return encryptor[_0xb052('0x8c')](_0x159fd2[_0xb052('0x8d')](','));};function signJwt(_0xf38eac){var _0x3d6fb0=BPromise[_0xb052('0x8e')](jwt[_0xb052('0x8f')],{'context':jwt});var _0x2f16d3=_0xf38eac[_0xb052('0x90')]||config[_0xb052('0xc')]['session'];return new BPromise(function(_0x5f1bdc,_0x7736c4){_0x3d6fb0(_0xf38eac['payload'],_0x2f16d3,_0xf38eac[_0xb052('0x91')])[_0xb052('0x48')](function(_0x955a35){_0x5f1bdc(_0x955a35);})['catch'](function(_0x3aa820){_0x7736c4(_0x3aa820);});});}function verifyJwt(_0x1cc976,_0x539ea9,_0x4f23ba){var _0x113810=BPromise[_0xb052('0x8e')](jwt['verify'],{'context':jwt});var _0x3b78af=_0x4f23ba||config[_0xb052('0xc')]['session'];return new BPromise(function(_0x2ca9d6,_0x2aeabe){_0x113810(_0x1cc976,_0x3b78af,_0x539ea9)[_0xb052('0x48')](function(_0x31b770){_0x2ca9d6(_0x31b770);})[_0xb052('0x58')](function(_0x229628){_0x2aeabe(_0x229628);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xb052('0x92')](_0xb052('0x93'));}function generateIssuedAt(){return Math['floor'](Date[_0xb052('0x94')]()/0x3e8)[_0xb052('0x92')]();}function createJwt(_0x223596){var _0x3129d8={'payload':{'iat':_0x223596['apiKeyIat'],'nonce':_0x223596[_0xb052('0x60')]},'options':{'algorithm':_0xb052('0x95'),'subject':_0x223596['id'][_0xb052('0x92')](),'issuer':hardwareConf[_0xb052('0x5c')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x3129d8)[_0xb052('0x48')](function(_0x2b8a52){return{'iat':_0x223596['apiKeyIat'],'nonce':_0x223596[_0xb052('0x60')],'token':_0x2b8a52};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index d0bf6fa..739ef62 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47ed=['catch','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','filter','user','skip','checkListsRestrictions','ids','tag','countFilteredContacts','User','buildContactsQuery','fields','clause','getFilteredContacts','describe','CmContact','cf_','map','CmCustomField','slice','all','length','fieldType','type','keys'];(function(_0x5e9913,_0x4552cc){var _0x4ac3f2=function(_0x4cdfcb){while(--_0x4cdfcb){_0x5e9913['push'](_0x5e9913['shift']());}};_0x4ac3f2(++_0x4552cc);}(_0x47ed,0x1e2));var _0xd47e=function(_0x1ab21c,_0x446e99){_0x1ab21c=_0x1ab21c-0x0;var _0x53dcb1=_0x47ed[_0x1ab21c];return _0x53dcb1;};'use strict';var _=require(_0xd47e('0x0'));var sqlUtils=require(_0xd47e('0x1'));var db=require(_0xd47e('0x2'))['db'];exports[_0xd47e('0x3')]=function(_0x40f67a,_0x1734f1,_0x33d320,_0xeeb84e){var _0x266da5={'count':0x0,'rows':[]};var _0x2ac598=sqlUtils[_0xd47e('0x4')](_0x1734f1,_0x40f67a);if(_0x2ac598){return Promise[_0xd47e('0x5')](_0x266da5);}var _0x4be455=sqlUtils[_0xd47e('0x6')]();var _0x154cdb={};var _0x28a96c=![];var _0x574edb=![];return Promise[_0xd47e('0x5')]()[_0xd47e('0x7')](function(){if(_0x40f67a[_0xd47e('0x8')]){return sqlUtils[_0xd47e('0x9')](_0x40f67a[_0xd47e('0x8')],_0xeeb84e);}else{return sqlUtils[_0xd47e('0xa')](_0x40f67a,_0xeeb84e);}})[_0xd47e('0x7')](function(_0x6a0755){_0x4be455[_0xd47e('0xb')](_0x6a0755[_0xd47e('0xc')]);_0x4be455[_0xd47e('0xb')](_0x6a0755['fields']);_0x4be455['where'](_0x6a0755[_0xd47e('0xd')]);_0x4be455[_0xd47e('0xb')](_0x6a0755[_0xd47e('0xe')]['clause']);_0x154cdb=_0x6a0755['tags'];_0x574edb=_0x6a0755[_0xd47e('0xe')][_0xd47e('0xf')];return sqlUtils[_0xd47e('0x10')](_0x1734f1,_0x40f67a,_0x574edb);})[_0xd47e('0x7')](function(_0x55ff51){_0x4be455[_0xd47e('0xb')](_0x55ff51);var _0x370a75=_0x40f67a[_0xd47e('0x8')]?_0x154cdb[_0xd47e('0x11')]:_0x40f67a[_0xd47e('0x12')];_0x28a96c=_0x370a75?!![]:![];return sqlUtils[_0xd47e('0x13')](_0x4be455,_0x370a75);})[_0xd47e('0x7')](function(_0x13e0e6){_0x266da5['count']=_0x13e0e6;if(_0x266da5['count']===0x0){return;}if(_0x40f67a[_0xd47e('0x14')]){_0x574edb=!![];}return sqlUtils[_0xd47e('0x15')](_0x4be455,_0x40f67a[_0xd47e('0x16')],_0x33d320,_0x28a96c,_0x154cdb[_0xd47e('0x17')],_0x574edb);})['then'](function(_0xfc8223){if(!_0xfc8223){return[];}return sqlUtils[_0xd47e('0x18')](_0xfc8223,_0x40f67a,_0x33d320);})['then'](function(_0x1230fd){_0x266da5['rows']=_0x1230fd;return _0x266da5;})['catch'](function(_0x3c0647){throw _0x3c0647;});};exports[_0xd47e('0x19')]=function(){var _0x252991={};var _0x381306=[];return db[_0xd47e('0x1a')][_0xd47e('0x19')]()[_0xd47e('0x7')](function(_0x1c762b){_0x252991=_0x1c762b;var _0x45ce8f=Object['keys'](_0x252991)[_0xd47e('0xd')](function(_0x5d1c55){return _['startsWith'](_0x5d1c55,_0xd47e('0x1b'))?_0x5d1c55:undefined;});var _0x51e90d=_0x45ce8f[_0xd47e('0x1c')](function(_0x2b0ace){return db[_0xd47e('0x1d')]['findOne']({'where':{'id':_0x2b0ace[_0xd47e('0x1e')](0x3)},'raw':!![]});});return Promise[_0xd47e('0x1f')](_0x51e90d);})[_0xd47e('0x7')](function(_0x2591ea){for(var _0x4644a4=0x0;_0x4644a4<_0x2591ea[_0xd47e('0x20')];_0x4644a4++){if(_0x2591ea[_0x4644a4]){var _0x560018=_0xd47e('0x1b')+_0x2591ea[_0x4644a4]['id'];_0x252991[_0x560018][_0xd47e('0x21')]=_0x2591ea[_0x4644a4][_0xd47e('0x22')];}}_0x381306=_['map'](Object[_0xd47e('0x23')](_0x252991),function(_0x2670e0){return{'name':_0x2670e0,'type':_0x252991[_0x2670e0][_0xd47e('0x22')]};});return _0x381306;})[_0xd47e('0x24')](function(_0x2c766c){throw _0x2c766c;});}; \ No newline at end of file +var _0x6472=['then','where','fields','filter','user','clause','skip','checkListsRestrictions','ids','tag','count','User','buildContactsQuery','rows','catch','describe','keys','cf_','map','CmCustomField','findOne','slice','all','length','fieldType','type','lodash','./sql-utils','../../mysqldb','skipContactsQuery','getContactsSubquery','resolve','parseAdvancedSearchFilter','search','parseQueryParameters'];(function(_0x5cde61,_0x5aab83){var _0x626d0=function(_0x500bac){while(--_0x500bac){_0x5cde61['push'](_0x5cde61['shift']());}};_0x626d0(++_0x5aab83);}(_0x6472,0x1e1));var _0x2647=function(_0x245632,_0x5b9277){_0x245632=_0x245632-0x0;var _0x32da6d=_0x6472[_0x245632];return _0x32da6d;};'use strict';var _=require(_0x2647('0x0'));var sqlUtils=require(_0x2647('0x1'));var db=require(_0x2647('0x2'))['db'];exports['findAll']=function(_0x19eccc,_0x3052a0,_0x44dac5,_0x5416d8){var _0x5833b8={'count':0x0,'rows':[]};var _0x125880=sqlUtils[_0x2647('0x3')](_0x3052a0,_0x19eccc);if(_0x125880){return Promise['resolve'](_0x5833b8);}var _0x515418=sqlUtils[_0x2647('0x4')]();var _0x2b5a55={};var _0x459203=![];var _0x35c806=![];return Promise[_0x2647('0x5')]()['then'](function(){if(_0x19eccc['search']){return sqlUtils[_0x2647('0x6')](_0x19eccc[_0x2647('0x7')],_0x5416d8);}else{return sqlUtils[_0x2647('0x8')](_0x19eccc,_0x5416d8);}})[_0x2647('0x9')](function(_0xe88d0c){_0x515418[_0x2647('0xa')](_0xe88d0c['default']);_0x515418[_0x2647('0xa')](_0xe88d0c[_0x2647('0xb')]);_0x515418[_0x2647('0xa')](_0xe88d0c[_0x2647('0xc')]);_0x515418[_0x2647('0xa')](_0xe88d0c[_0x2647('0xd')][_0x2647('0xe')]);_0x2b5a55=_0xe88d0c['tags'];_0x35c806=_0xe88d0c[_0x2647('0xd')][_0x2647('0xf')];return sqlUtils[_0x2647('0x10')](_0x3052a0,_0x19eccc,_0x35c806);})['then'](function(_0x5f5ca7){_0x515418[_0x2647('0xa')](_0x5f5ca7);var _0x794ff1=_0x19eccc[_0x2647('0x7')]?_0x2b5a55[_0x2647('0x11')]:_0x19eccc[_0x2647('0x12')];_0x459203=_0x794ff1?!![]:![];return sqlUtils['countFilteredContacts'](_0x515418,_0x794ff1);})[_0x2647('0x9')](function(_0x2b12eb){_0x5833b8[_0x2647('0x13')]=_0x2b12eb;if(_0x5833b8[_0x2647('0x13')]===0x0){return;}if(_0x19eccc[_0x2647('0x14')]){_0x35c806=!![];}return sqlUtils[_0x2647('0x15')](_0x515418,_0x19eccc[_0x2647('0xb')],_0x44dac5,_0x459203,_0x2b5a55[_0x2647('0xe')],_0x35c806);})[_0x2647('0x9')](function(_0x581d85){if(!_0x581d85){return[];}return sqlUtils['getFilteredContacts'](_0x581d85,_0x19eccc,_0x44dac5);})[_0x2647('0x9')](function(_0xd3aec1){_0x5833b8[_0x2647('0x16')]=_0xd3aec1;return _0x5833b8;})[_0x2647('0x17')](function(_0x1e1a3c){throw _0x1e1a3c;});};exports['describe']=function(){var _0x5eb4bc={};var _0x3f7de9=[];return db['CmContact'][_0x2647('0x18')]()[_0x2647('0x9')](function(_0x7749ba){_0x5eb4bc=_0x7749ba;var _0x24f444=Object[_0x2647('0x19')](_0x5eb4bc)[_0x2647('0xc')](function(_0x4f2d71){return _['startsWith'](_0x4f2d71,_0x2647('0x1a'))?_0x4f2d71:undefined;});var _0x46c89b=_0x24f444[_0x2647('0x1b')](function(_0x5edf27){return db[_0x2647('0x1c')][_0x2647('0x1d')]({'where':{'id':_0x5edf27[_0x2647('0x1e')](0x3)},'raw':!![]});});return Promise[_0x2647('0x1f')](_0x46c89b);})['then'](function(_0x153466){for(var _0x8174ce=0x0;_0x8174ce<_0x153466[_0x2647('0x20')];_0x8174ce++){if(_0x153466[_0x8174ce]){var _0x40c5f9=_0x2647('0x1a')+_0x153466[_0x8174ce]['id'];_0x5eb4bc[_0x40c5f9][_0x2647('0x21')]=_0x153466[_0x8174ce][_0x2647('0x22')];}}_0x3f7de9=_[_0x2647('0x1b')](Object[_0x2647('0x19')](_0x5eb4bc),function(_0x442376){return{'name':_0x442376,'type':_0x5eb4bc[_0x442376][_0x2647('0x22')]};});return _0x3f7de9;})[_0x2647('0x17')](function(_0x3a1909){throw _0x3a1909;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index b193f14..4ed479b 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10b5=['group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','Sequelize','QueryTypes','query','toString','Tags','clone','where','t.id\x20IN\x20?','sequelize','exports','lodash','squel','../parsers/qs','role','agent','ListId','autocomplete','select','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','fax','email','CompanyId','createdAt','updatedAt','deletedAt','includes','push','TagIds','field','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','getFullTextValue','c.id\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','text','value','start','end','Tag','split','tags','clause','ids','User','user','and','uc.UserId\x20=\x20?','skip','keys','map','some','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','filter','search'];(function(_0xd28d86,_0x3aa4af){var _0x2da14d=function(_0x282981){while(--_0x282981){_0xd28d86['push'](_0xd28d86['shift']());}};_0x2da14d(++_0x3aa4af);}(_0x10b5,0x79));var _0x510b=function(_0x3ed110,_0x2708e6){_0x3ed110=_0x3ed110-0x0;var _0x43acfa=_0x10b5[_0x3ed110];return _0x43acfa;};'use strict';var _=require(_0x510b('0x0'));var squel=require(_0x510b('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x510b('0x2'));var utils=require('../interaction/utils');var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x48b0ef,_0x42dde5){var _0x384071=![];if(_0x48b0ef[_0x510b('0x3')]===_0x510b('0x4')&&!_0x42dde5['search']&&!_0x42dde5[_0x510b('0x5')]&&_0x42dde5[_0x510b('0x6')]!=='true'){_0x384071=!![];}return _0x384071;}function getContactsSubquery(){return squel[_0x510b('0x7')]()[_0x510b('0x8')](_0x510b('0x9'),'c')['where'](_0x510b('0xa'));}function applyJoinClauses(_0x1e937d,_0x82e006){var _0x2ec2bd=_0x82e006?'c':_0x510b('0xb');_0x1e937d['left_join'](_0x510b('0xc'),'uc',_0x510b('0xd')+_0x2ec2bd+_0x510b('0xe'))[_0x510b('0xf')](_0x510b('0x10'),'ct',_0x510b('0x11')+_0x2ec2bd+_0x510b('0xe'))[_0x510b('0xf')]('tools_tags','t','t.id\x20=\x20ct.TagId');return _0x1e937d;}function addFieldsToQuery(_0x2a3029,_0x592a92,_0x107978,_0x4d1c68,_0x3c5e2e){var _0x2f408f=_0x3c5e2e?'c':_0x510b('0xb');if(!_0x592a92){_0x592a92=['id','firstName','lastName','phone','mobile',_0x510b('0x12'),_0x510b('0x13'),_0x510b('0x5'),_0x510b('0x14'),_0x510b('0x15'),_0x510b('0x16'),_0x510b('0x17'),'TagIds'];}else if(!_0x592a92[_0x510b('0x18')]('id')){_0x592a92[_0x510b('0x19')]('id');}var _0x4538bf=_0x107978&&_0x3c5e2e||!_0x107978&&!_0x3c5e2e;if(_0x4d1c68){_0x4538bf=_0x4d1c68&&_0x3c5e2e||!_0x4d1c68&&!_0x3c5e2e;}_0x592a92['forEach'](function(_0x2df70c){if(_0x2df70c===_0x510b('0x1a')){if(_0x4538bf){_0x2a3029[_0x510b('0x1b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2df70c);}else if(_0x107978||_0x4d1c68){_0x2a3029['field'](_0x2f408f+'.'+_0x2df70c);}}else{_0x2a3029[_0x510b('0x1b')](_0x2f408f+'.'+_0x2df70c);}});return _0x2a3029;}function getSqlClauses(){var _0x4a47ba={'default':squel[_0x510b('0x1c')](),'fields':squel[_0x510b('0x1c')](),'filter':squel['expr'](),'tags':{'clause':squel[_0x510b('0x1c')](),'ids':null},'user':{'clause':squel[_0x510b('0x1c')](),'skip':![]}};return _0x4a47ba;}function parseTagParameter(_0xc8b7bf){var _0x536ac0=squel[_0x510b('0x1c')]();if(_0xc8b7bf){var _0x57e8aa=utils[_0x510b('0x1d')](_0xc8b7bf);_0x57e8aa[_0x510b('0x1e')](function(_0x36065b){_0x536ac0['or'](_0x510b('0x1f'),'%,'+_0x36065b+',%');});}return _0x536ac0;}function parseSearchFilter(_0x584ac9){var _0x4c1312=squel[_0x510b('0x1c')]();if(_0x584ac9){var _0x18a795=_0x584ac9['replace']('\x5c','\x5c\x5c')[_0x510b('0x20')](/'/g,'\x27\x27');if(_0x18a795['split']('\x20')['length']>0x1){_0x4c1312['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x510b('0x21')](_0x18a795,!![]),null);}else{if(qs['isNumeric'](_0x18a795)){_0x4c1312['or'](_0x510b('0x22'),_0x18a795+'%');_0x4c1312['or']('c.phone\x20LIKE\x20?',_0x18a795+'%');_0x4c1312['or']('c.mobile\x20LIKE\x20?',_0x18a795+'%');_0x4c1312['or'](_0x510b('0x23'),_0x18a795+'%');}else if(qs[_0x510b('0x24')](_0x18a795)){_0x4c1312['or']('c.email\x20LIKE\x20?',_0x18a795+'%');}else{_0x4c1312['or']('c.firstName\x20LIKE\x20?','%'+_0x18a795+'%');_0x4c1312['or'](_0x510b('0x25'),'%'+_0x18a795+'%');_0x4c1312['or'](_0x510b('0x26'),'%'+_0x18a795+'%');}}}return _0x4c1312;}function parseAdvancedSearchFilter(_0x289369,_0x564588){var _0x329f96=getSqlClauses();var _0x3a7334=as[_0x510b('0x27')](_0x289369);var _0x51d582=_0x3a7334[_0x510b('0x28')];for(var _0x19921c=0x0;_0x19921c<_0x3a7334[_0x510b('0x29')][_0x510b('0x2a')];_0x19921c++){var _0x3e82c6=_0x3a7334[_0x510b('0x29')][_0x19921c];var _0x5510e1='c';var _0x3da683=_[_0x510b('0x2b')](_0x564588,[_0x510b('0x2c'),_0x3e82c6[_0x510b('0x1b')]]);if(_0x3da683){if(_0x3e82c6[_0x510b('0x1b')]===_0x510b('0x2d')||_0x3da683[_0x510b('0x2e')]===_0x510b('0x2f')){_0x3e82c6[_0x510b('0x30')]=_0x510b('0x31');}var _0x10bf20=as[_0x510b('0x32')](_0x5510e1,_0x3da683['type'],_0x3e82c6);_0x329f96['default'][_0x51d582](_0x10bf20[_0x510b('0x33')],_0x10bf20[_0x510b('0x34')][_0x510b('0x35')],_0x10bf20[_0x510b('0x34')][_0x510b('0x36')]);}else{if(_0x3e82c6[_0x510b('0x1b')]===_0x510b('0x37')){var _0x99bb37=_0x3e82c6[_0x510b('0x34')][_0x510b('0x38')](',')['map'](function(_0x354276){return Number(_0x354276);});var _0x5e6744=parseTagParameter(_0x99bb37);_0x329f96[_0x510b('0x39')][_0x510b('0x3a')]['and'](_0x5e6744);_0x329f96[_0x510b('0x39')][_0x510b('0x3b')]=_0x99bb37;}else if(_0x3e82c6[_0x510b('0x1b')]===_0x510b('0x3c')){_0x329f96[_0x510b('0x3d')][_0x510b('0x3a')][_0x510b('0x3e')](_0x510b('0x3f'),_0x3e82c6[_0x510b('0x34')]);_0x329f96[_0x510b('0x3d')][_0x510b('0x40')]=!![];}}}return _0x329f96;}function parseModelFields(_0x30bea7,_0x5b282b){var _0x63e7b7=squel[_0x510b('0x1c')]();var _0x55bbb3=_(_0x30bea7)[_0x510b('0x41')]()[_0x510b('0x42')](function(_0x3eb679){return _[_0x510b('0x43')](_0x5b282b,['name',_0x3eb679])?_0x3eb679:undefined;})[_0x510b('0x44')]()['value']();if(_0x30bea7[_0x510b('0x45')]){_0x55bbb3[_0x510b('0x19')]('Contact');}if(_0x30bea7[_0x510b('0x3c')]){_0x55bbb3['push'](_0x510b('0x3c'));}if(_0x55bbb3['length']>0x0){_0x55bbb3[_0x510b('0x1e')](function(_0x4fbe1e){if(_0x4fbe1e===_0x510b('0x5')){_0x63e7b7[_0x510b('0x3e')](_0x510b('0x46'),[][_0x510b('0x47')](_0x30bea7[_0x4fbe1e]));}else if(_0x4fbe1e==='Contact'){var _0x18b5ad='%'+_0x30bea7[_0x4fbe1e]+'%';_0x63e7b7[_0x510b('0x3e')](_0x510b('0x48'),_0x18b5ad);}else if(_0x4fbe1e===_0x510b('0x3c')){_0x63e7b7[_0x510b('0x3e')]('uc.UserId\x20=\x20?',_0x30bea7[_0x4fbe1e]);}else{_0x63e7b7[_0x510b('0x3e')]('c.'+_0x4fbe1e+_0x510b('0x49'),_0x30bea7[_0x4fbe1e]);}});}return _0x63e7b7;}function parseQueryParameters(_0x405787,_0x5b7a4f){var _0x2dcc91=getSqlClauses();return Promise[_0x510b('0x4a')]()[_0x510b('0x4b')](function(){return parseModelFields(_0x405787,_0x5b7a4f);})[_0x510b('0x4b')](function(_0x1ab7b6){_0x2dcc91[_0x510b('0x4c')][_0x510b('0x3e')](_0x1ab7b6);return parseTagParameter(_0x405787['tag']);})['then'](function(_0x2e4cde){_0x2dcc91[_0x510b('0x39')][_0x510b('0x3a')][_0x510b('0x3e')](_0x2e4cde);return parseSearchFilter(_0x405787[_0x510b('0x4d')]);})[_0x510b('0x4b')](function(_0x375496){_0x2dcc91[_0x510b('0x4d')]=_0x375496;return _0x2dcc91;});}function checkListsRestrictions(_0x1ba3de,_0x479bcc,_0x49f625){var _0x2cbbaa=squel[_0x510b('0x1c')]();return Promise[_0x510b('0x4a')]()['then'](function(){if(_0x479bcc[_0x510b('0x4e')]&&_0x1ba3de['role']==='agent'&&!_0x49f625){return _0x1ba3de['getLists']({'attributes':['id'],'raw':!![]});}})[_0x510b('0x4b')](function(_0x5a6b73){if(_0x5a6b73){if(_0x5a6b73[_0x510b('0x2a')]===0x0){_0x2cbbaa[_0x510b('0x3e')]('c.ListId\x20IS\x20NULL');}else{_0x2cbbaa[_0x510b('0x3e')](_0x510b('0x46'),_[_0x510b('0x42')](_0x5a6b73,'id'));}}})[_0x510b('0x4b')](function(){return _0x2cbbaa;});}function buildContactsQuery(_0x157107,_0xfbf116,_0x51588b,_0x28fa1a,_0x452e57,_0x58042a){if(_0xfbf116){_0xfbf116=_0x51588b['attributes'];}_0x157107=addFieldsToQuery(_0x157107,_0xfbf116,_0x28fa1a,_0x58042a,!![]);var _0x4f4e1d=squel[_0x510b('0x7')]();_0x4f4e1d=addFieldsToQuery(_0x4f4e1d,_0xfbf116,_0x28fa1a,_0x58042a,![]);if(_0x28fa1a||_0x58042a){_0x157107=applyJoinClauses(_0x157107,!![]);_0x157107[_0x510b('0x4f')](_0x510b('0x50'));if(_0x51588b[_0x510b('0x51')]){_0x4f4e1d[_0x510b('0x51')](_0x51588b[_0x510b('0x51')]);}if(_0x51588b[_0x510b('0x52')]){_0x4f4e1d[_0x510b('0x52')](_0x51588b[_0x510b('0x52')]);}}else{_0x4f4e1d=applyJoinClauses(_0x4f4e1d,![]);_0x4f4e1d['group'](_0x510b('0x53'));if(_0x51588b[_0x510b('0x51')]){_0x157107['limit'](_0x51588b[_0x510b('0x51')]);}if(_0x51588b[_0x510b('0x52')]){_0x157107['offset'](_0x51588b[_0x510b('0x52')]);}}_0x4f4e1d[_0x510b('0x54')](_0x452e57);if(_0x51588b[_0x510b('0x55')]){_0x51588b[_0x510b('0x55')][_0x510b('0x1e')](function(_0x56f52b){_0x157107['order']('c.'+_0x56f52b[0x0],_0x56f52b[0x1]===_0x510b('0x56')?![]:!![]);_0x4f4e1d[_0x510b('0x55')](_0x510b('0x57')+_0x56f52b[0x0],_0x56f52b[0x1]===_0x510b('0x56')?![]:!![]);});}_0x4f4e1d['from'](_0x157107,'subqry');return _0x4f4e1d;}function getFilteredContacts(_0x1f98eb){var _0x4c9f69=[];return db['Tag'][_0x510b('0x58')]({'attributes':['id',_0x510b('0x2c'),_0x510b('0x59')],'raw':!![]})[_0x510b('0x4b')](function(_0x58c5b){_0x4c9f69=_['keyBy'](_0x58c5b,'id');var _0x165f31={'type':db[_0x510b('0x5a')][_0x510b('0x5b')]['SELECT'],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x510b('0x5c')](_0x1f98eb[_0x510b('0x5d')](),_0x165f31);})[_0x510b('0x4b')](function(_0x331ee2){_0x331ee2[_0x510b('0x1e')](function(_0x432168){if(_0x432168[_0x510b('0x1a')]){_0x432168[_0x510b('0x5e')]=[];_0x432168['TagIds'][_0x510b('0x38')](',')[_0x510b('0x1e')](function(_0x501afe){_0x432168[_0x510b('0x5e')][_0x510b('0x19')](_0x4c9f69[_0x501afe]);});}delete _0x432168[_0x510b('0x1a')];});return _0x331ee2;});}function countFilteredContacts(_0x8f935c,_0x36c7ae){var _0x4a17dc=_0x8f935c[_0x510b('0x5f')]();_0x4a17dc[_0x510b('0x1b')]('COUNT(*)');_0x4a17dc=applyJoinClauses(_0x4a17dc,!![]);_0x8f935c[_0x510b('0x4f')](_0x510b('0x50'));var _0xa7ef7=utils[_0x510b('0x1d')](_0x36c7ae);if(!_['isEmpty'](_0xa7ef7)){_0x4a17dc[_0x510b('0x60')](_0x510b('0x61'),_0xa7ef7);}var _0x348949={'type':db[_0x510b('0x5a')][_0x510b('0x5b')]['SELECT'],'raw':!![]};return db[_0x510b('0x62')]['query'](_0x4a17dc[_0x510b('0x5d')](),_0x348949)[_0x510b('0x4b')](function(_0x19c73a){return _0x19c73a[0x0]['COUNT(*)'];});}module[_0x510b('0x63')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xbf2f=['getLists','c.ListId\x20IS\x20NULL','attributes','c.id','limit','offset','group','subqry.id','order','DESC','subqry.','findAll','color','keyBy','QueryTypes','SELECT','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','where','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','ListId','autocomplete','true','select','from','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','split','length','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','find','name','fieldType','datetime','castTo','default','text','value','start','end','Tag','map','tags','and','User','user','clause','uc.UserId\x20=\x20?','keys','some','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter'];(function(_0x282fac,_0x1eece8){var _0x2a7e45=function(_0x3d17ce){while(--_0x3d17ce){_0x282fac['push'](_0x282fac['shift']());}};_0x2a7e45(++_0x1eece8);}(_0xbf2f,0xf1));var _0xfbf2=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbf2f[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xfbf2('0x0'));var squel=require(_0xfbf2('0x1'));var as=require(_0xfbf2('0x2'));var qs=require(_0xfbf2('0x3'));var utils=require(_0xfbf2('0x4'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x2c09fd,_0x4677a7){var _0x441926=![];if(_0x2c09fd[_0xfbf2('0x5')]===_0xfbf2('0x6')&&!_0x4677a7[_0xfbf2('0x7')]&&!_0x4677a7[_0xfbf2('0x8')]&&_0x4677a7[_0xfbf2('0x9')]!==_0xfbf2('0xa')){_0x441926=!![];}return _0x441926;}function getContactsSubquery(){return squel[_0xfbf2('0xb')]()[_0xfbf2('0xc')]('cm_contacts','c')['where'](_0xfbf2('0xd'));}function applyJoinClauses(_0x3b5135,_0xdb5387){var _0x64790a=_0xdb5387?'c':_0xfbf2('0xe');_0x3b5135['left_join'](_0xfbf2('0xf'),'uc',_0xfbf2('0x10')+_0x64790a+_0xfbf2('0x11'))[_0xfbf2('0x12')](_0xfbf2('0x13'),'ct',_0xfbf2('0x14')+_0x64790a+_0xfbf2('0x11'))['left_join']('tools_tags','t',_0xfbf2('0x15'));return _0x3b5135;}function addFieldsToQuery(_0x5b66ad,_0x263ac6,_0x14a4d1,_0x3071c9,_0x245d43){var _0x3386f7=_0x245d43?'c':_0xfbf2('0xe');if(!_0x263ac6){_0x263ac6=['id',_0xfbf2('0x16'),_0xfbf2('0x17'),_0xfbf2('0x18'),_0xfbf2('0x19'),_0xfbf2('0x1a'),_0xfbf2('0x1b'),'ListId',_0xfbf2('0x1c'),_0xfbf2('0x1d'),_0xfbf2('0x1e'),_0xfbf2('0x1f'),_0xfbf2('0x20')];}else if(!_0x263ac6[_0xfbf2('0x21')]('id')){_0x263ac6[_0xfbf2('0x22')]('id');}var _0x20e3f0=_0x14a4d1&&_0x245d43||!_0x14a4d1&&!_0x245d43;if(_0x3071c9){_0x20e3f0=_0x3071c9&&_0x245d43||!_0x3071c9&&!_0x245d43;}_0x263ac6[_0xfbf2('0x23')](function(_0x17ec6b){if(_0x17ec6b==='TagIds'){if(_0x20e3f0){_0x5b66ad[_0xfbf2('0x24')](_0xfbf2('0x25'),_0x17ec6b);}else if(_0x14a4d1||_0x3071c9){_0x5b66ad['field'](_0x3386f7+'.'+_0x17ec6b);}}else{_0x5b66ad[_0xfbf2('0x24')](_0x3386f7+'.'+_0x17ec6b);}});return _0x5b66ad;}function getSqlClauses(){var _0x16f420={'default':squel[_0xfbf2('0x26')](),'fields':squel[_0xfbf2('0x26')](),'filter':squel[_0xfbf2('0x26')](),'tags':{'clause':squel[_0xfbf2('0x26')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x16f420;}function parseTagParameter(_0x5c0698){var _0xbd2b2d=squel['expr']();if(_0x5c0698){var _0x3b3b13=utils[_0xfbf2('0x27')](_0x5c0698);_0x3b3b13[_0xfbf2('0x23')](function(_0x5515db){_0xbd2b2d['or'](_0xfbf2('0x28'),'%,'+_0x5515db+',%');});}return _0xbd2b2d;}function parseSearchFilter(_0x578fdf){var _0x1eda1a=squel[_0xfbf2('0x26')]();if(_0x578fdf){var _0x55c19c=_0x578fdf['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x55c19c[_0xfbf2('0x29')]('\x20')[_0xfbf2('0x2a')]>0x1){_0x1eda1a['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x55c19c,!![]),null);}else{if(qs[_0xfbf2('0x2b')](_0x55c19c)){_0x1eda1a['or']('c.id\x20LIKE\x20?',_0x55c19c+'%');_0x1eda1a['or'](_0xfbf2('0x2c'),_0x55c19c+'%');_0x1eda1a['or'](_0xfbf2('0x2d'),_0x55c19c+'%');_0x1eda1a['or']('c.fax\x20LIKE\x20?',_0x55c19c+'%');}else if(qs[_0xfbf2('0x2e')](_0x55c19c)){_0x1eda1a['or'](_0xfbf2('0x2f'),_0x55c19c+'%');}else{_0x1eda1a['or'](_0xfbf2('0x30'),'%'+_0x55c19c+'%');_0x1eda1a['or'](_0xfbf2('0x31'),'%'+_0x55c19c+'%');_0x1eda1a['or'](_0xfbf2('0x2f'),'%'+_0x55c19c+'%');}}}return _0x1eda1a;}function parseAdvancedSearchFilter(_0x317f1a,_0x22b1e5){var _0x344e1b=getSqlClauses();var _0x200784=as[_0xfbf2('0x32')](_0x317f1a);var _0x48ac35=_0x200784['sqlOperator'];for(var _0x470f3b=0x0;_0x470f3b<_0x200784[_0xfbf2('0x33')][_0xfbf2('0x2a')];_0x470f3b++){var _0x1cf3da=_0x200784[_0xfbf2('0x33')][_0x470f3b];var _0x2b673b='c';var _0x4953d5=_[_0xfbf2('0x34')](_0x22b1e5,[_0xfbf2('0x35'),_0x1cf3da['field']]);if(_0x4953d5){if(_0x1cf3da['field']==='dateOfBirth'||_0x4953d5[_0xfbf2('0x36')]===_0xfbf2('0x37')){_0x1cf3da[_0xfbf2('0x38')]='DATE';}var _0x294991=as['buildExpression'](_0x2b673b,_0x4953d5['type'],_0x1cf3da);_0x344e1b[_0xfbf2('0x39')][_0x48ac35](_0x294991[_0xfbf2('0x3a')],_0x294991[_0xfbf2('0x3b')][_0xfbf2('0x3c')],_0x294991[_0xfbf2('0x3b')][_0xfbf2('0x3d')]);}else{if(_0x1cf3da[_0xfbf2('0x24')]===_0xfbf2('0x3e')){var _0x5a1b45=_0x1cf3da[_0xfbf2('0x3b')][_0xfbf2('0x29')](',')[_0xfbf2('0x3f')](function(_0xaf4c41){return Number(_0xaf4c41);});var _0x269dc6=parseTagParameter(_0x5a1b45);_0x344e1b[_0xfbf2('0x40')]['clause'][_0xfbf2('0x41')](_0x269dc6);_0x344e1b[_0xfbf2('0x40')]['ids']=_0x5a1b45;}else if(_0x1cf3da[_0xfbf2('0x24')]===_0xfbf2('0x42')){_0x344e1b[_0xfbf2('0x43')][_0xfbf2('0x44')]['and'](_0xfbf2('0x45'),_0x1cf3da['value']);_0x344e1b[_0xfbf2('0x43')]['skip']=!![];}}}return _0x344e1b;}function parseModelFields(_0x2a3795,_0x428c38){var _0xc1b2f3=squel['expr']();var _0xb085a3=_(_0x2a3795)[_0xfbf2('0x46')]()[_0xfbf2('0x3f')](function(_0x5b44d0){return _[_0xfbf2('0x47')](_0x428c38,[_0xfbf2('0x35'),_0x5b44d0])?_0x5b44d0:undefined;})[_0xfbf2('0x48')]()[_0xfbf2('0x3b')]();if(_0x2a3795[_0xfbf2('0x49')]){_0xb085a3[_0xfbf2('0x22')](_0xfbf2('0x49'));}if(_0x2a3795[_0xfbf2('0x42')]){_0xb085a3[_0xfbf2('0x22')](_0xfbf2('0x42'));}if(_0xb085a3['length']>0x0){_0xb085a3[_0xfbf2('0x23')](function(_0x3aa6c6){if(_0x3aa6c6===_0xfbf2('0x8')){_0xc1b2f3[_0xfbf2('0x41')](_0xfbf2('0x4a'),[][_0xfbf2('0x4b')](_0x2a3795[_0x3aa6c6]));}else if(_0x3aa6c6===_0xfbf2('0x49')){var _0x491125='%'+_0x2a3795[_0x3aa6c6]+'%';_0xc1b2f3['and'](_0xfbf2('0x4c'),_0x491125);}else if(_0x3aa6c6===_0xfbf2('0x42')){_0xc1b2f3[_0xfbf2('0x41')](_0xfbf2('0x45'),_0x2a3795[_0x3aa6c6]);}else{_0xc1b2f3[_0xfbf2('0x41')]('c.'+_0x3aa6c6+_0xfbf2('0x4d'),_0x2a3795[_0x3aa6c6]);}});}return _0xc1b2f3;}function parseQueryParameters(_0x482d9e,_0x495fb3){var _0x1bb5f=getSqlClauses();return Promise[_0xfbf2('0x4e')]()[_0xfbf2('0x4f')](function(){return parseModelFields(_0x482d9e,_0x495fb3);})[_0xfbf2('0x4f')](function(_0x45d9f8){_0x1bb5f[_0xfbf2('0x50')][_0xfbf2('0x41')](_0x45d9f8);return parseTagParameter(_0x482d9e[_0xfbf2('0x51')]);})[_0xfbf2('0x4f')](function(_0x23436d){_0x1bb5f[_0xfbf2('0x40')][_0xfbf2('0x44')][_0xfbf2('0x41')](_0x23436d);return parseSearchFilter(_0x482d9e['filter']);})[_0xfbf2('0x4f')](function(_0x5ea307){_0x1bb5f[_0xfbf2('0x52')]=_0x5ea307;return _0x1bb5f;});}function checkListsRestrictions(_0x11f659,_0x5c67c9,_0x26d031){var _0x583e1c=squel[_0xfbf2('0x26')]();return Promise[_0xfbf2('0x4e')]()[_0xfbf2('0x4f')](function(){if(_0x5c67c9[_0xfbf2('0x7')]&&_0x11f659[_0xfbf2('0x5')]===_0xfbf2('0x6')&&!_0x26d031){return _0x11f659[_0xfbf2('0x53')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x3512a6){if(_0x3512a6){if(_0x3512a6[_0xfbf2('0x2a')]===0x0){_0x583e1c['and'](_0xfbf2('0x54'));}else{_0x583e1c[_0xfbf2('0x41')](_0xfbf2('0x4a'),_['map'](_0x3512a6,'id'));}}})[_0xfbf2('0x4f')](function(){return _0x583e1c;});}function buildContactsQuery(_0x39dc71,_0x1b603a,_0x3bd7b6,_0x43d786,_0x3adfc4,_0x2e12b9){if(_0x1b603a){_0x1b603a=_0x3bd7b6[_0xfbf2('0x55')];}_0x39dc71=addFieldsToQuery(_0x39dc71,_0x1b603a,_0x43d786,_0x2e12b9,!![]);var _0x150560=squel['select']();_0x150560=addFieldsToQuery(_0x150560,_0x1b603a,_0x43d786,_0x2e12b9,![]);if(_0x43d786||_0x2e12b9){_0x39dc71=applyJoinClauses(_0x39dc71,!![]);_0x39dc71['group'](_0xfbf2('0x56'));if(_0x3bd7b6[_0xfbf2('0x57')]){_0x150560[_0xfbf2('0x57')](_0x3bd7b6[_0xfbf2('0x57')]);}if(_0x3bd7b6[_0xfbf2('0x58')]){_0x150560[_0xfbf2('0x58')](_0x3bd7b6[_0xfbf2('0x58')]);}}else{_0x150560=applyJoinClauses(_0x150560,![]);_0x150560[_0xfbf2('0x59')](_0xfbf2('0x5a'));if(_0x3bd7b6[_0xfbf2('0x57')]){_0x39dc71['limit'](_0x3bd7b6[_0xfbf2('0x57')]);}if(_0x3bd7b6[_0xfbf2('0x58')]){_0x39dc71[_0xfbf2('0x58')](_0x3bd7b6[_0xfbf2('0x58')]);}}_0x150560['having'](_0x3adfc4);if(_0x3bd7b6['order']){_0x3bd7b6[_0xfbf2('0x5b')][_0xfbf2('0x23')](function(_0x370443){_0x39dc71[_0xfbf2('0x5b')]('c.'+_0x370443[0x0],_0x370443[0x1]===_0xfbf2('0x5c')?![]:!![]);_0x150560[_0xfbf2('0x5b')](_0xfbf2('0x5d')+_0x370443[0x0],_0x370443[0x1]===_0xfbf2('0x5c')?![]:!![]);});}_0x150560[_0xfbf2('0xc')](_0x39dc71,_0xfbf2('0xe'));return _0x150560;}function getFilteredContacts(_0x32ad18){var _0x5a8266=[];return db['Tag'][_0xfbf2('0x5e')]({'attributes':['id',_0xfbf2('0x35'),_0xfbf2('0x5f')],'raw':!![]})[_0xfbf2('0x4f')](function(_0xd52de2){_0x5a8266=_[_0xfbf2('0x60')](_0xd52de2,'id');var _0x435447={'type':db['Sequelize'][_0xfbf2('0x61')][_0xfbf2('0x62')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xfbf2('0x63')][_0xfbf2('0x64')](_0x32ad18[_0xfbf2('0x65')](),_0x435447);})[_0xfbf2('0x4f')](function(_0x1f347b){_0x1f347b['forEach'](function(_0x47d461){if(_0x47d461[_0xfbf2('0x20')]){_0x47d461[_0xfbf2('0x66')]=[];_0x47d461[_0xfbf2('0x20')][_0xfbf2('0x29')](',')[_0xfbf2('0x23')](function(_0x1d4ff2){_0x47d461[_0xfbf2('0x66')][_0xfbf2('0x22')](_0x5a8266[_0x1d4ff2]);});}delete _0x47d461[_0xfbf2('0x20')];});return _0x1f347b;});}function countFilteredContacts(_0x53411a,_0x2f17f2){var _0x3b3bff=_0x53411a[_0xfbf2('0x67')]();_0x3b3bff[_0xfbf2('0x24')](_0xfbf2('0x68'));_0x3b3bff=applyJoinClauses(_0x3b3bff,!![]);_0x53411a[_0xfbf2('0x59')](_0xfbf2('0x56'));var _0x4b5b16=utils['getSelectedTags'](_0x2f17f2);if(!_[_0xfbf2('0x69')](_0x4b5b16)){_0x3b3bff[_0xfbf2('0x6a')]('t.id\x20IN\x20?',_0x4b5b16);}var _0x5bd818={'type':db['Sequelize'][_0xfbf2('0x61')]['SELECT'],'raw':!![]};return db[_0xfbf2('0x63')][_0xfbf2('0x64')](_0x3b3bff['toString'](),_0x5bd818)[_0xfbf2('0x4f')](function(_0xa5588b){return _0xa5588b[0x0][_0xfbf2('0x68')];});}module[_0xfbf2('0x6b')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 1f0d32d..533dd38 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 _0xa754=['binary','write','final','end','unlink','decryptFile','createWriteStream','createDecipher','close','encryptString','secret','createCipher','utf8','base64','decryptString','crypto','lodash','../../config/environment','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','data','update'];(function(_0x25a49d,_0x173409){var _0x412009=function(_0x3f63c7){while(--_0x3f63c7){_0x25a49d['push'](_0x25a49d['shift']());}};_0x412009(++_0x173409);}(_0xa754,0x7e));var _0x4a75=function(_0x188379,_0x7fa345){_0x188379=_0x188379-0x0;var _0x3d8a8f=_0xa754[_0x188379];return _0x3d8a8f;};'use strict';var crypto=require(_0x4a75('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x4a75('0x1'));var config=require(_0x4a75('0x2'));var logger=require('../../config/logger')(_0x4a75('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4a75('0x4')][_0x4a75('0x5')],'algorithm':_0x4a75('0x6')};const fileOptions={'algorithm':_0x4a75('0x7')};if(config[_0x4a75('0x8')]&&config[_0x4a75('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt'][_0x4a75('0x9')]);if(isSupported){fileOptions[_0x4a75('0x9')]=config[_0x4a75('0x8')][_0x4a75('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x4a75('0xa')](',\x20');logger[_0x4a75('0xb')](config[_0x4a75('0x8')][_0x4a75('0x9')],_0x4a75('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0xcd3cdc){return AES_SUPPORTED_RX[_0x4a75('0xd')](_0xcd3cdc);}function getSupportedCiphers(){return crypto[_0x4a75('0xe')]()[_0x4a75('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x30a84d){return getSupportedCiphers()[_0x4a75('0x10')](_0x30a84d)>-0x1;}function combineOptions(_0x4735c8){var _0x250150={};for(var _0x239727 in fileOptions){if(fileOptions[_0x4a75('0x11')](_0x239727)){_0x250150[_0x239727]=fileOptions[_0x239727];}}if(_0x4735c8){for(var _0x2a3798 in _0x4735c8){if(_0x4735c8[_0x4a75('0x11')](_0x2a3798)){_0x250150[_0x2a3798]=_0x4735c8[_0x2a3798];}}}return _0x250150;}exports[_0x4a75('0x12')]=function(_0x4ad6f0,_0x29172c,_0x4a5c06,_0x4bac4e){return new BPromise(function(_0x4e516b,_0x5ea47c){_0x4bac4e=combineOptions(_0x4bac4e);var _0x409770=new Buffer(_0x4a5c06);var _0x1cdc14=fs[_0x4a75('0x13')](_0x4ad6f0);var _0x3e8998=fs['createWriteStream'](_0x29172c);var _0xc6dbf3=crypto['createCipher'](_0x4bac4e[_0x4a75('0x9')],_0x409770);_0x1cdc14['on'](_0x4a75('0x14'),function(_0x3b8eef){var _0x52f20b=new Buffer(_0xc6dbf3[_0x4a75('0x15')](_0x3b8eef),_0x4a75('0x16'));_0x3e8998[_0x4a75('0x17')](_0x52f20b);});_0x1cdc14['on']('end',function(){try{var _0x692b83=new Buffer(_0xc6dbf3[_0x4a75('0x18')](_0x4a75('0x16')),_0x4a75('0x16'));_0x3e8998[_0x4a75('0x17')](_0x692b83);_0x3e8998[_0x4a75('0x19')]();_0x3e8998['on']('close',function(){return _0x4e516b(_0x29172c);});}catch(_0x43b8a3){fs[_0x4a75('0x1a')](_0x29172c);return _0x5ea47c(_0x43b8a3);}});});};exports[_0x4a75('0x1b')]=function(_0x2a50b8,_0x13ce8c,_0x153f6e,_0x485258){return new BPromise(function(_0x31d810,_0x481c7d){_0x485258=combineOptions(_0x485258);var _0x2ed9dd=new Buffer(_0x153f6e);var _0x1a6092=fs[_0x4a75('0x13')](_0x2a50b8);var _0x6e8d06=fs[_0x4a75('0x1c')](_0x13ce8c);var _0x4619ed=crypto[_0x4a75('0x1d')](_0x485258[_0x4a75('0x9')],_0x2ed9dd);_0x1a6092['on'](_0x4a75('0x14'),function(_0x202a24){var _0x320d92=new Buffer(_0x4619ed['update'](_0x202a24),'binary');_0x6e8d06[_0x4a75('0x17')](_0x320d92);});_0x1a6092['on']('end',function(){try{var _0x3e0de4=new Buffer(_0x4619ed[_0x4a75('0x18')]('binary'),_0x4a75('0x16'));_0x6e8d06[_0x4a75('0x17')](_0x3e0de4);_0x6e8d06[_0x4a75('0x19')]();_0x6e8d06['on'](_0x4a75('0x1e'),function(){return _0x31d810(_0x13ce8c);});}catch(_0x155add){fs['unlink'](_0x13ce8c);return _0x481c7d(_0x155add);}});});};exports[_0x4a75('0x1f')]=function(_0x18576b,_0x4a4805,_0x5ef29){var _0x18a5e9=_0x5ef29||stringOptions['algorithm'];var _0x349b60=_0x4a4805||stringOptions[_0x4a75('0x20')];var _0x37aaf8=crypto[_0x4a75('0x21')](_0x18a5e9,_0x349b60);var _0x4de633=_0x37aaf8[_0x4a75('0x15')](_0x18576b,_0x4a75('0x22'),_0x4a75('0x23'));_0x4de633+=_0x37aaf8[_0x4a75('0x18')](_0x4a75('0x23'));return _0x4de633;};exports[_0x4a75('0x24')]=function(_0x5e9eb4,_0x10303d,_0x92e822){var _0x40a338=_0x92e822||stringOptions[_0x4a75('0x9')];var _0x7304d7=_0x10303d||stringOptions[_0x4a75('0x20')];var _0x233c4c=crypto[_0x4a75('0x1d')](_0x40a338,_0x7304d7);var _0x40a5c6=_0x233c4c[_0x4a75('0x15')](_0x5e9eb4,_0x4a75('0x23'),_0x4a75('0x22'));_0x40a5c6+=_0x233c4c[_0x4a75('0x18')](_0x4a75('0x22'));return _0x40a5c6;}; \ No newline at end of file +var _0xc347=['aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','binary','final','end','close','unlink','decryptFile','createReadStream','createDecipher','update','write','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/logger','app','session','aes-256-ctr'];(function(_0x5c4d27,_0x5b0822){var _0x1dda1a=function(_0x5ea638){while(--_0x5ea638){_0x5c4d27['push'](_0x5c4d27['shift']());}};_0x1dda1a(++_0x5b0822);}(_0xc347,0x89));var _0x7c34=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xc347[_0x1facfa];return _0x9ec701;};'use strict';var crypto=require(_0x7c34('0x0'));var fs=require('fs');var BPromise=require(_0x7c34('0x1'));var _=require(_0x7c34('0x2'));var config=require('../../config/environment');var logger=require(_0x7c34('0x3'))(_0x7c34('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x7c34('0x5')],'algorithm':_0x7c34('0x6')};const fileOptions={'algorithm':_0x7c34('0x7')};if(config[_0x7c34('0x8')]&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config[_0x7c34('0x8')][_0x7c34('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0x7c34('0x8')][_0x7c34('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x7c34('0xa')](',\x20');logger[_0x7c34('0xb')](config[_0x7c34('0x8')]['algorithm'],_0x7c34('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x156da4){return AES_SUPPORTED_RX[_0x7c34('0xd')](_0x156da4);}function getSupportedCiphers(){return crypto[_0x7c34('0xe')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x15e4f5){return getSupportedCiphers()[_0x7c34('0xf')](_0x15e4f5)>-0x1;}function combineOptions(_0x17d04e){var _0x51b6e7={};for(var _0xc35960 in fileOptions){if(fileOptions['hasOwnProperty'](_0xc35960)){_0x51b6e7[_0xc35960]=fileOptions[_0xc35960];}}if(_0x17d04e){for(var _0x44dea3 in _0x17d04e){if(_0x17d04e[_0x7c34('0x10')](_0x44dea3)){_0x51b6e7[_0x44dea3]=_0x17d04e[_0x44dea3];}}}return _0x51b6e7;}exports[_0x7c34('0x11')]=function(_0x2f08fc,_0x3b851d,_0x30187c,_0x5185ac){return new BPromise(function(_0x13197a,_0xa8bcc3){_0x5185ac=combineOptions(_0x5185ac);var _0x25f675=new Buffer(_0x30187c);var _0x3c4362=fs['createReadStream'](_0x2f08fc);var _0x4d8f56=fs[_0x7c34('0x12')](_0x3b851d);var _0x2528e5=crypto[_0x7c34('0x13')](_0x5185ac[_0x7c34('0x9')],_0x25f675);_0x3c4362['on'](_0x7c34('0x14'),function(_0x1669d6){var _0x10fbaa=new Buffer(_0x2528e5['update'](_0x1669d6),_0x7c34('0x15'));_0x4d8f56['write'](_0x10fbaa);});_0x3c4362['on']('end',function(){try{var _0x423839=new Buffer(_0x2528e5[_0x7c34('0x16')](_0x7c34('0x15')),_0x7c34('0x15'));_0x4d8f56['write'](_0x423839);_0x4d8f56[_0x7c34('0x17')]();_0x4d8f56['on'](_0x7c34('0x18'),function(){return _0x13197a(_0x3b851d);});}catch(_0x5f7742){fs[_0x7c34('0x19')](_0x3b851d);return _0xa8bcc3(_0x5f7742);}});});};exports[_0x7c34('0x1a')]=function(_0x538c5a,_0x3c3893,_0x5664c7,_0x136d94){return new BPromise(function(_0x14f642,_0x2fb015){_0x136d94=combineOptions(_0x136d94);var _0x4e1a7f=new Buffer(_0x5664c7);var _0x1fab56=fs[_0x7c34('0x1b')](_0x538c5a);var _0x5a5a76=fs[_0x7c34('0x12')](_0x3c3893);var _0x19fbde=crypto[_0x7c34('0x1c')](_0x136d94[_0x7c34('0x9')],_0x4e1a7f);_0x1fab56['on'](_0x7c34('0x14'),function(_0x5d6442){var _0x1c2bc6=new Buffer(_0x19fbde[_0x7c34('0x1d')](_0x5d6442),_0x7c34('0x15'));_0x5a5a76[_0x7c34('0x1e')](_0x1c2bc6);});_0x1fab56['on'](_0x7c34('0x17'),function(){try{var _0x4a5b2e=new Buffer(_0x19fbde[_0x7c34('0x16')](_0x7c34('0x15')),_0x7c34('0x15'));_0x5a5a76[_0x7c34('0x1e')](_0x4a5b2e);_0x5a5a76[_0x7c34('0x17')]();_0x5a5a76['on']('close',function(){return _0x14f642(_0x3c3893);});}catch(_0x44c892){fs['unlink'](_0x3c3893);return _0x2fb015(_0x44c892);}});});};exports[_0x7c34('0x1f')]=function(_0x487171,_0x3fe986,_0x2d2f89){var _0x507932=_0x2d2f89||stringOptions['algorithm'];var _0x3578f8=_0x3fe986||stringOptions[_0x7c34('0x20')];var _0x5739a5=crypto['createCipher'](_0x507932,_0x3578f8);var _0x59e689=_0x5739a5[_0x7c34('0x1d')](_0x487171,_0x7c34('0x21'),_0x7c34('0x22'));_0x59e689+=_0x5739a5[_0x7c34('0x16')](_0x7c34('0x22'));return _0x59e689;};exports[_0x7c34('0x23')]=function(_0x40579d,_0xc2760d,_0x7495d7){var _0x2d9b80=_0x7495d7||stringOptions['algorithm'];var _0x4066d8=_0xc2760d||stringOptions[_0x7c34('0x20')];var _0x3c129d=crypto[_0x7c34('0x1c')](_0x2d9b80,_0x4066d8);var _0x1a5b45=_0x3c129d['update'](_0x40579d,_0x7c34('0x22'),_0x7c34('0x21'));_0x1a5b45+=_0x3c129d[_0x7c34('0x16')](_0x7c34('0x21'));return _0x1a5b45;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 29c165b..d56c384 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 _0xbcc7=['length','range','push','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','.csv','existsSync','join','each','%s%d.%s','%s.%s','csv','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','lodash','bluebird','zip-dir','rimraf','../../mysqldb','argv','savename','AnalyticExtractedReport','info','format','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT','num'];(function(_0x304bbf,_0x3aa159){var _0x4a01a8=function(_0x1c1b2e){while(--_0x1c1b2e){_0x304bbf['push'](_0x304bbf['shift']());}};_0x4a01a8(++_0x3aa159);}(_0xbcc7,0x6a));var _0x7bcc=function(_0x5abe93,_0x12e222){_0x5abe93=_0x5abe93-0x0;var _0x1e6598=_0xbcc7[_0x5abe93];return _0x1e6598;};'use strict';var util=require(_0x7bcc('0x0'));var path=require('path');var _=require(_0x7bcc('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x7bcc('0x2'));var zipdir=require(_0x7bcc('0x3'));var rimraf=require(_0x7bcc('0x4'));var db=require(_0x7bcc('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x7bcc('0x6')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x7bcc('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xad1f6b,_0x3485f4){var _0x103cbb={'status':_0xad1f6b};var _0x12a1ad={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3485f4){_0x103cbb[_0x7bcc('0x7')]=_0x3485f4;}return db[_0x7bcc('0x8')]['update'](_0x103cbb,_0x12a1ad);}function main(){var _0x546108=0x1388;var _0xc6f6d9;logger[_0x7bcc('0x9')](util[_0x7bcc('0xa')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0x7bcc('0xb')][_0x7bcc('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7bcc('0xd'),_0x7bcc('0xe')]})[_0x7bcc('0xf')](function(_0x2e8829){if(_0x2e8829){_0xc6f6d9=_0x2e8829;_0x546108=_0xc6f6d9[_0x7bcc('0xe')]||0x1388;}})['then'](function(){return dbH[_0x7bcc('0x10')][_0x7bcc('0x11')](util[_0x7bcc('0xa')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x7bcc('0x10')]['QueryTypes'][_0x7bcc('0x12')]});})[_0x7bcc('0xf')](function(_0x5ef6b4){if(!_0x5ef6b4[0x0][_0x7bcc('0x13')]){return analyticExtractedReport('Empty');}var _0x350ed8=[];var _0x40c52b=0x0;if(_0xc6f6d9['split']){if(_0x5ef6b4&&_0x5ef6b4[_0x7bcc('0x14')]){var _0x55e3ce=_[_0x7bcc('0x15')](_0x5ef6b4[0x0]['num']/_0x546108);var _0x1f34c7=Number['isInteger'](_0x5ef6b4[0x0][_0x7bcc('0x13')]/_0x546108)?_0x5ef6b4[0x0][_0x7bcc('0x13')]%_0x546108:0x0;_0x55e3ce['forEach'](function(_0x4cadb6){if(_0x4cadb6>0x0){_0x40c52b+=_0x546108;}_0x350ed8[_0x7bcc('0x16')](dbH['sequelize'][_0x7bcc('0x11')](util[_0x7bcc('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x546108,_0x40c52b),{'type':dbH[_0x7bcc('0x10')][_0x7bcc('0x17')][_0x7bcc('0x12')]}));});if(_0x1f34c7>0x0){_0x40c52b+=_0x546108;_0x350ed8['push'](dbH[_0x7bcc('0x10')]['query'](util[_0x7bcc('0xa')](_0x7bcc('0x18'),QUERY,_0x1f34c7,_0x40c52b),{'type':dbH[_0x7bcc('0x10')][_0x7bcc('0x17')][_0x7bcc('0x12')]}));}}}else{_0x350ed8['push'](dbH[_0x7bcc('0x10')]['query'](QUERY,{'type':dbH[_0x7bcc('0x10')]['QueryTypes'][_0x7bcc('0x12')]}));}var _0x859b99=path['dirname'](PATH);var _0x41bc81=path['basename'](PATH,_0x7bcc('0x19'));var _0x17fb32=_0xc6f6d9['split']&&_0x350ed8[_0x7bcc('0x14')]>0x1;var _0x40e090=[];if(!fs[_0x7bcc('0x1a')](path[_0x7bcc('0x1b')](_0x859b99,_0x41bc81))&&_0x17fb32){fs['mkdirSync'](path[_0x7bcc('0x1b')](_0x859b99,_0x41bc81));}return BPromise[_0x7bcc('0x1c')](_0x350ed8,function(_0x276175){_0x40e090['push'](_0x276175);})[_0x7bcc('0xf')](function(){for(var _0x1977c3=0x0;_0x1977c3<_0x40e090['length'];_0x1977c3+=0x1){var _0x2934f3;var _0x117af3=_0x40e090[_0x1977c3];if(_0x17fb32){_0x2934f3=path['join'](_0x859b99,_0x41bc81,util[_0x7bcc('0xa')](_0x7bcc('0x1d'),_0x41bc81,_0x1977c3,'csv'));}else{_0x2934f3=path[_0x7bcc('0x1b')](_0x859b99,util[_0x7bcc('0xa')](_0x7bcc('0x1e'),_0x41bc81,_0x7bcc('0x1f')));}fs[_0x7bcc('0x20')](_0x2934f3,csv(_0x117af3));}})[_0x7bcc('0xf')](function(){if(_0x17fb32){return new Promise(function(_0x11e66a){zipdir(path['join'](_0x859b99,_0x41bc81),{'saveTo':path[_0x7bcc('0x1b')](_0x859b99,util[_0x7bcc('0xa')](_0x7bcc('0x1e'),_0x41bc81,'zip'))},function(_0x5058ec,_0x11ac93){rimraf(path[_0x7bcc('0x1b')](_0x859b99,_0x41bc81),function(){});_0x11e66a('zip\x20finished');});});}})[_0x7bcc('0xf')](function(){logger[_0x7bcc('0x9')](util[_0x7bcc('0xa')](_0x7bcc('0x21'),EXTRACTED_REPORT_ID,_0x7bcc('0x22')));return analyticExtractedReport(_0x7bcc('0x23'),_0x17fb32?util[_0x7bcc('0xa')](_0x7bcc('0x1e'),_0x41bc81,_0x17fb32?_0x7bcc('0x24'):_0x7bcc('0x1f')):null);});})[_0x7bcc('0x25')](function(_0x438da4){logger[_0x7bcc('0x9')](util[_0x7bcc('0xa')](_0x7bcc('0x26'),EXTRACTED_REPORT_ID,'CSV'),util[_0x7bcc('0x27')](_0x438da4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7bcc('0x28'));})[_0x7bcc('0x29')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x9015=['info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','then','splitSizeCsv','sequelize','QueryTypes','SELECT','Empty','num','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','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','exit','util','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update'];(function(_0x1ac692,_0x4bc484){var _0x3969b7=function(_0x42803f){while(--_0x42803f){_0x1ac692['push'](_0x1ac692['shift']());}};_0x3969b7(++_0x4bc484);}(_0x9015,0xbc));var _0x5901=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x9015[_0x45d3f0];return _0x314b79;};'use strict';var util=require(_0x5901('0x0'));var path=require('path');var _=require(_0x5901('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x5901('0x2'));var zipdir=require(_0x5901('0x3'));var rimraf=require(_0x5901('0x4'));var db=require(_0x5901('0x5'))['db'];var dbH=require(_0x5901('0x5'))[_0x5901('0x6')];var logger=require(_0x5901('0x7'))(_0x5901('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x5901('0x9')][0x2]);var QUERY=process[_0x5901('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x42c4b3,_0x2ed57d){var _0x5697ee={'status':_0x42c4b3};var _0x16ed11={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ed57d){_0x5697ee['savename']=_0x2ed57d;}return db[_0x5901('0xa')][_0x5901('0xb')](_0x5697ee,_0x16ed11);}function main(){var _0xbf602e=0x1388;var _0x1ed9f5;logger[_0x5901('0xc')](util[_0x5901('0xd')](_0x5901('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x5901('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5901('0x10'),'splitSizeCsv']})[_0x5901('0x11')](function(_0x3e6125){if(_0x3e6125){_0x1ed9f5=_0x3e6125;_0xbf602e=_0x1ed9f5[_0x5901('0x12')]||0x1388;}})[_0x5901('0x11')](function(){return dbH['sequelize']['query'](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x5901('0x13')][_0x5901('0x14')][_0x5901('0x15')]});})[_0x5901('0x11')](function(_0x2cde1a){if(!_0x2cde1a[0x0]['num']){return analyticExtractedReport(_0x5901('0x16'));}var _0x2c87d2=[];var _0xf3609f=0x0;if(_0x1ed9f5[_0x5901('0x10')]){if(_0x2cde1a&&_0x2cde1a['length']){var _0x43b2e8=_['range'](_0x2cde1a[0x0][_0x5901('0x17')]/_0xbf602e);var _0x4c7bca=Number['isInteger'](_0x2cde1a[0x0]['num']/_0xbf602e)?_0x2cde1a[0x0][_0x5901('0x17')]%_0xbf602e:0x0;_0x43b2e8[_0x5901('0x18')](function(_0x2b9985){if(_0x2b9985>0x0){_0xf3609f+=_0xbf602e;}_0x2c87d2[_0x5901('0x19')](dbH[_0x5901('0x13')][_0x5901('0x1a')](util['format'](_0x5901('0x1b'),QUERY,_0xbf602e,_0xf3609f),{'type':dbH[_0x5901('0x13')][_0x5901('0x14')][_0x5901('0x15')]}));});if(_0x4c7bca>0x0){_0xf3609f+=_0xbf602e;_0x2c87d2[_0x5901('0x19')](dbH[_0x5901('0x13')]['query'](util[_0x5901('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4c7bca,_0xf3609f),{'type':dbH[_0x5901('0x13')][_0x5901('0x14')]['SELECT']}));}}}else{_0x2c87d2['push'](dbH[_0x5901('0x13')]['query'](QUERY,{'type':dbH[_0x5901('0x13')]['QueryTypes'][_0x5901('0x15')]}));}var _0x4e102a=path[_0x5901('0x1c')](PATH);var _0x4b3d12=path[_0x5901('0x1d')](PATH,_0x5901('0x1e'));var _0x5b8ee3=_0x1ed9f5['split']&&_0x2c87d2[_0x5901('0x1f')]>0x1;var _0x2c4113=[];if(!fs[_0x5901('0x20')](path[_0x5901('0x21')](_0x4e102a,_0x4b3d12))&&_0x5b8ee3){fs[_0x5901('0x22')](path['join'](_0x4e102a,_0x4b3d12));}return BPromise[_0x5901('0x23')](_0x2c87d2,function(_0x30ce3d){_0x2c4113[_0x5901('0x19')](_0x30ce3d);})[_0x5901('0x11')](function(){for(var _0xaef6a7=0x0;_0xaef6a7<_0x2c4113['length'];_0xaef6a7+=0x1){var _0x500a85;var _0x3648db=_0x2c4113[_0xaef6a7];if(_0x5b8ee3){_0x500a85=path[_0x5901('0x21')](_0x4e102a,_0x4b3d12,util[_0x5901('0xd')](_0x5901('0x24'),_0x4b3d12,_0xaef6a7,'csv'));}else{_0x500a85=path[_0x5901('0x21')](_0x4e102a,util[_0x5901('0xd')](_0x5901('0x25'),_0x4b3d12,_0x5901('0x26')));}fs[_0x5901('0x27')](_0x500a85,csv(_0x3648db));}})['then'](function(){if(_0x5b8ee3){return new Promise(function(_0x31f8cc){zipdir(path[_0x5901('0x21')](_0x4e102a,_0x4b3d12),{'saveTo':path[_0x5901('0x21')](_0x4e102a,util[_0x5901('0xd')]('%s.%s',_0x4b3d12,_0x5901('0x28')))},function(_0x3c8e9f,_0x3fb109){rimraf(path[_0x5901('0x21')](_0x4e102a,_0x4b3d12),function(){});_0x31f8cc(_0x5901('0x29'));});});}})['then'](function(){logger[_0x5901('0xc')](util[_0x5901('0xd')](_0x5901('0x2a'),EXTRACTED_REPORT_ID,_0x5901('0x2b')));return analyticExtractedReport(_0x5901('0x2c'),_0x5b8ee3?util[_0x5901('0xd')](_0x5901('0x25'),_0x4b3d12,_0x5b8ee3?_0x5901('0x28'):_0x5901('0x26')):null);});})[_0x5901('0x2d')](function(_0x597512){logger[_0x5901('0xc')](util[_0x5901('0xd')](_0x5901('0x2e'),EXTRACTED_REPORT_ID,_0x5901('0x2b')),util[_0x5901('0x2f')](_0x597512,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5901('0x30'));})['finally'](function(){process[_0x5901('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 99bcd91..24f2253 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 _0x1b99=['tableHeader','map','pick','toString','value','length','body','push','concat','chunk','keys','forEach','format','name','startDate','endDate','pageBreak','before','landscape','\x20/\x20','footer','Arial','right','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','existsSync','mkdirSync','join','each','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','center','header','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update'];(function(_0x5473a5,_0x38fc6b){var _0x58be1f=function(_0x554385){while(--_0x554385){_0x5473a5['push'](_0x5473a5['shift']());}};_0x58be1f(++_0x38fc6b);}(_0x1b99,0x1c9));var _0x91b9=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0x1b99[_0x434783];return _0x13efcf;};'use strict';var _=require(_0x91b9('0x0'));var fs=require('fs');var util=require(_0x91b9('0x1'));var path=require(_0x91b9('0x2'));var moment=require(_0x91b9('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x91b9('0x4'));var zipdir=require(_0x91b9('0x5'));var rimraf=require(_0x91b9('0x6'));var JSDOM=require(_0x91b9('0x7'))[_0x91b9('0x8')];var window=new JSDOM('')[_0x91b9('0x9')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0x91b9('0xa'))[_0x91b9('0xb')];var logger=require(_0x91b9('0xc'))(_0x91b9('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x91b9('0xe')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x91b9('0xe')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x91b9('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1143bd,_0x429530){var _0x1ef85e={'status':_0x1143bd};var _0x53138c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x429530){_0x1ef85e[_0x91b9('0x10')]=_0x429530;}return db['AnalyticExtractedReport'][_0x91b9('0x11')](_0x1ef85e,_0x53138c);}function getHeaders(_0x186ec7){return _['map'](_0x186ec7,function(_0x26e0aa){return{'text':_0x26e0aa,'style':_0x91b9('0x12')};});}function getRows(_0x4d6dbf,_0x39c391){return _[_0x91b9('0x13')](_0x39c391,function(_0x330423){return _(_0x330423)[_0x91b9('0x14')](_0x4d6dbf)[_0x91b9('0x13')](function(_0x54db66){return _0x54db66?_[_0x91b9('0x15')](_0x54db66):'';})[_0x91b9('0x16')]();});}function createTable(_0x3ce0fc,_0x4f4019){var _0x50d009={'widths':_['fill'](Array(_0x3ce0fc[_0x91b9('0x17')]),0x91),'heights':function(_0x38c4b2){return _0x38c4b2===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x238f4a=getHeaders(_0x3ce0fc);_0x50d009[_0x91b9('0x18')][_0x91b9('0x19')](_0x238f4a);var _0x54d1a5=getRows(_0x3ce0fc,_0x4f4019);_0x50d009[_0x91b9('0x18')]=_0x50d009[_0x91b9('0x18')][_0x91b9('0x1a')](_0x54d1a5);return _0x50d009;}function createTables(_0x466ee5){var _0x6566bf=[];var _0x5dbd48=_[_0x91b9('0x1b')](Object[_0x91b9('0x1c')](_0x466ee5[0x0]),0x5);_0x5dbd48[_0x91b9('0x1d')](function(_0x13b601){_0x6566bf[_0x91b9('0x19')](createTable(_0x13b601,_0x466ee5));});return _0x6566bf;}function getPDFDocDefinition(_0x2c6ceb){var _0x2feb4d=util[_0x91b9('0x1e')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x91b9('0x1f')],moment(EXTRACTED_REPORT[_0x91b9('0x20')])[_0x91b9('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0x91b9('0x21')])[_0x91b9('0x1e')](FORMAT));var _0x6824c7=[];for(var _0x382e8b=0x0;_0x382e8b<_0x2c6ceb[_0x91b9('0x17')];_0x382e8b++){var _0x51d269=[];if(_0x382e8b===0x0){_0x51d269['push']({'text':_0x2feb4d,'style':'header'});}var _0x1ef8dc={'table':_0x2c6ceb[_0x382e8b]};if(_0x382e8b>0x0){_0x1ef8dc[_0x91b9('0x22')]=_0x91b9('0x23');_0x1ef8dc['margin']=[0x0,0x46,0x0,0x0];}_0x51d269[_0x91b9('0x19')](_0x1ef8dc);_0x6824c7['push'](_0x51d269);}return{'pageSize':'A4','pageOrientation':_0x91b9('0x24'),'content':_0x6824c7,'footer':function(_0xbb9d4f,_0x31f21f){return{'text':_0xbb9d4f[_0x91b9('0x15')]()+_0x91b9('0x25')+_0x31f21f,'style':_0x91b9('0x26')};},'defaultStyle':{'font':_0x91b9('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x91b9('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1b352b){var _0x208356=0x1388;var _0x3c0369;if(!_0x1b352b[0x0][_0x91b9('0x29')]){return analyticExtractedReport(_0x91b9('0x2a'));}return db[_0x91b9('0x2b')][_0x91b9('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})['then'](function(_0x1bac17){if(_0x1bac17){_0x3c0369=_0x1bac17;_0x208356=_0x3c0369[_0x91b9('0x2d')]||0x3e8;}})[_0x91b9('0x2e')](function(){var _0x3a4f7e=[];var _0x55afba=0x0;if(_0x3c0369[_0x91b9('0x2f')]){if(_0x1b352b&&_0x1b352b['length']){var _0x5ba50e=_[_0x91b9('0x30')](_0x1b352b[0x0][_0x91b9('0x29')]/_0x208356);var _0x17f9f8=Number[_0x91b9('0x31')](_0x1b352b[0x0]['num']/_0x208356)?_0x1b352b[0x0][_0x91b9('0x29')]%_0x208356:0x0;_0x5ba50e[_0x91b9('0x1d')](function(_0x32f9f5){if(_0x32f9f5>0x0){_0x55afba+=_0x208356;}_0x3a4f7e['push'](dbH[_0x91b9('0x32')][_0x91b9('0x33')](util[_0x91b9('0x1e')](_0x91b9('0x34'),QUERY,_0x208356,_0x55afba),{'type':dbH[_0x91b9('0x32')][_0x91b9('0x35')][_0x91b9('0x36')]}));});if(_0x17f9f8>0x0){_0x55afba+=_0x208356;_0x3a4f7e[_0x91b9('0x19')](dbH[_0x91b9('0x32')][_0x91b9('0x33')](util[_0x91b9('0x1e')](_0x91b9('0x34'),QUERY,_0x17f9f8,_0x55afba),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0x3a4f7e[_0x91b9('0x19')](dbH['sequelize'][_0x91b9('0x33')](QUERY,{'type':dbH[_0x91b9('0x32')][_0x91b9('0x35')][_0x91b9('0x36')]}));}var _0x5b2ad3=path['dirname'](PATH);var _0x268156=path[_0x91b9('0x37')](PATH,_0x91b9('0x38'));var _0x50d616=_0x3c0369['split']&&_0x3a4f7e[_0x91b9('0x17')]>0x1;var _0x36a077=[];if(!fs[_0x91b9('0x39')](path['join'](_0x5b2ad3,_0x268156))&&_0x50d616){fs[_0x91b9('0x3a')](path[_0x91b9('0x3b')](_0x5b2ad3,_0x268156));}return BPromise[_0x91b9('0x3c')](_0x3a4f7e,function(_0x323859){_0x36a077[_0x91b9('0x19')](_0x323859);})[_0x91b9('0x2e')](function(){var _0x54e353=[];for(var _0x212a9a=0x0;_0x212a9a<_0x36a077[_0x91b9('0x17')];_0x212a9a+=0x1){var _0x47ac8a=_0x36a077[_0x212a9a];var _0x3cceec=createTables(_['flatten'](_0x47ac8a));var _0xa94569;var _0x3feb08=getPDFDocDefinition(_0x3cceec);var _0x5c2ef1=getPDFPrinter();var _0xc7c00=_0x5c2ef1[_0x91b9('0x3d')](_0x3feb08);if(_0x50d616){_0xa94569=path[_0x91b9('0x3b')](_0x5b2ad3,_0x268156,util[_0x91b9('0x1e')](_0x91b9('0x3e'),_0x268156,_0x212a9a,_0x91b9('0x3f')));}else{_0xa94569=path[_0x91b9('0x3b')](_0x5b2ad3,util['format'](_0x91b9('0x40'),_0x268156,_0x91b9('0x3f')));}_0x54e353[_0x91b9('0x19')](writePDFDocument(_0xc7c00,_0xa94569));}return Promise['all'](_0x54e353);})['then'](function(){if(_0x50d616){return new Promise(function(_0xc59f1d){zipdir(path[_0x91b9('0x3b')](_0x5b2ad3,_0x268156),{'saveTo':path['join'](_0x5b2ad3,util[_0x91b9('0x1e')]('%s.%s',_0x268156,'zip'))},function(){rimraf(path[_0x91b9('0x3b')](_0x5b2ad3,_0x268156),function(){});_0xc59f1d(_0x91b9('0x41'));});});}})[_0x91b9('0x2e')](function(){if(!_0x50d616)return;rimraf(path[_0x91b9('0x3b')](_0x5b2ad3,_0x268156),function(){});})[_0x91b9('0x2e')](function(){logger[_0x91b9('0x42')](util[_0x91b9('0x1e')](_0x91b9('0x43'),EXTRACTED_REPORT_ID,_0x91b9('0x44')));return analyticExtractedReport(_0x91b9('0x45'),_0x50d616?util[_0x91b9('0x1e')](_0x91b9('0x40'),_0x268156,_0x50d616?_0x91b9('0x46'):_0x91b9('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x91b9('0x42')](util[_0x91b9('0x1e')](_0x91b9('0x47'),EXTRACTED_REPORT_ID,_0x91b9('0x44')));return db[_0x91b9('0x48')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x91b9('0x2e')](function(_0x28e991){EXTRACTED_REPORT=_0x28e991;return dbH[_0x91b9('0x32')][_0x91b9('0x33')](util[_0x91b9('0x1e')](_0x91b9('0x49'),QUERY),{'type':dbH[_0x91b9('0x32')][_0x91b9('0x35')][_0x91b9('0x36')]});})[_0x91b9('0x2e')](extractReport)[_0x91b9('0x4a')](function(_0x36cb09){logger[_0x91b9('0x42')](util['format'](_0x91b9('0x4b'),EXTRACTED_REPORT_ID,_0x91b9('0x44')),util[_0x91b9('0x4c')](_0x36cb09,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x91b9('0x4d'));})[_0x91b9('0x4e')](function(){process[_0x91b9('0x4f')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3342cc=new PdfPrinter({'Arial':{'normal':__dirname+_0x91b9('0x50'),'bold':__dirname+_0x91b9('0x51'),'italics':__dirname+_0x91b9('0x52'),'bolditalics':__dirname+_0x91b9('0x53')}});return _0x3342cc;}function getPDFDocDefinitionFromHTML(_0x4f7cfe,_0x360ad3){var _0x5f5979=util['format'](_0x91b9('0x54'),_0x360ad3[_0x91b9('0x55')],_0x360ad3[_0x91b9('0x56')]);var _0x1a8943=moment()[_0x91b9('0x1e')]('YYYY-MM-DD')[_0x91b9('0x15')]();var _0x5ccf6e=htmlToPdfmake(_0x4f7cfe,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5ccf6e],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x91b9('0x57'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x91b9('0x57')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x91b9('0x58')}];},'footer':function(_0x227220,_0x291b42){return[{'text':util[_0x91b9('0x1e')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x5f5979,_0x227220,_0x291b42,_0x1a8943),'style':_0x91b9('0x26')}];}};}function writePDFDocument(_0x519782,_0x345812){return new Promise(function(_0x356cb3,_0x1371ae){var _0x54e1c4=_0x519782[_0x91b9('0x59')](fs[_0x91b9('0x5a')](_0x345812));_0x54e1c4['on'](_0x91b9('0x5b'),function(){_0x356cb3(_0x91b9('0x5b'));});_0x54e1c4['on'](_0x91b9('0x5c'),function(_0x3323b4){_0x1371ae(_0x3323b4);});_0x519782[_0x91b9('0x5d')]();});}exports[_0x91b9('0x5e')]=function(_0x24cb55,_0x170d77){var _0x3e354d=getPDFPrinter();var _0x15c88f=getPDFDocDefinitionFromHTML(_0x24cb55,_0x170d77);var _0x15dc0b=_0x3e354d[_0x91b9('0x3d')](_0x15c88f);return writePDFDocument(_0x15dc0b,_0x170d77[_0x91b9('0x2')])[_0x91b9('0x4a')](function(_0x46f784){throw _0x46f784;});}; \ No newline at end of file +var _0x2830=['all','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','createPdfFromHTML','lodash','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','JSDOM','window','bluebird','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','toString','value','length','auto','body','concat','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','Arial','Setting','find','splitSizePdf','then','split','range','num','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf'];(function(_0x3c401b,_0x5c9d17){var _0x296052=function(_0xa68836){while(--_0xa68836){_0x3c401b['push'](_0x3c401b['shift']());}};_0x296052(++_0x5c9d17);}(_0x2830,0x128));var _0x0283=function(_0x38fef2,_0x398e8){_0x38fef2=_0x38fef2-0x0;var _0x404ca8=_0x2830[_0x38fef2];return _0x404ca8;};'use strict';var _=require(_0x0283('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x0283('0x1'));var moment=require(_0x0283('0x2'));var htmlToPdfmake=require(_0x0283('0x3'));var PdfPrinter=require(_0x0283('0x4'));var zipdir=require(_0x0283('0x5'));var rimraf=require(_0x0283('0x6'));var JSDOM=require('jsdom')[_0x0283('0x7')];var window=new JSDOM('')[_0x0283('0x8')];var BPromise=require(_0x0283('0x9'));var db=require(_0x0283('0xa'))['db'];var dbH=require(_0x0283('0xa'))['dbH'];var logger=require(_0x0283('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x0283('0xc')][0x3];var PATH=process[_0x0283('0xc')][0x4];var NAME=process[_0x0283('0xc')][0x5];var FORMAT=_0x0283('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3ecbd6,_0x267c0c){var _0x41b61a={'status':_0x3ecbd6};var _0x3e39b5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x267c0c){_0x41b61a[_0x0283('0xe')]=_0x267c0c;}return db[_0x0283('0xf')][_0x0283('0x10')](_0x41b61a,_0x3e39b5);}function getHeaders(_0x9ec582){return _[_0x0283('0x11')](_0x9ec582,function(_0x262a8e){return{'text':_0x262a8e,'style':'tableHeader'};});}function getRows(_0x7543f1,_0x26d173){return _['map'](_0x26d173,function(_0x3bb00a){return _(_0x3bb00a)['pick'](_0x7543f1)['map'](function(_0x175cd7){return _0x175cd7?_[_0x0283('0x12')](_0x175cd7):'';})[_0x0283('0x13')]();});}function createTable(_0x1ff7ec,_0x41207c){var _0x257cbe={'widths':_['fill'](Array(_0x1ff7ec[_0x0283('0x14')]),0x91),'heights':function(_0x217780){return _0x217780===0x0?_0x0283('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2b18d8=getHeaders(_0x1ff7ec);_0x257cbe[_0x0283('0x16')]['push'](_0x2b18d8);var _0x29e560=getRows(_0x1ff7ec,_0x41207c);_0x257cbe[_0x0283('0x16')]=_0x257cbe['body'][_0x0283('0x17')](_0x29e560);return _0x257cbe;}function createTables(_0x3776dc){var _0x1f09b2=[];var _0x6a712d=_['chunk'](Object['keys'](_0x3776dc[0x0]),0x5);_0x6a712d[_0x0283('0x18')](function(_0x4e1b5e){_0x1f09b2[_0x0283('0x19')](createTable(_0x4e1b5e,_0x3776dc));});return _0x1f09b2;}function getPDFDocDefinition(_0x80b0ea){var _0x27da1b=util[_0x0283('0x1a')](_0x0283('0x1b'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x0283('0x1c')])[_0x0283('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x0283('0x1d')])[_0x0283('0x1a')](FORMAT));var _0x3bcbaf=[];for(var _0x2f07b6=0x0;_0x2f07b6<_0x80b0ea[_0x0283('0x14')];_0x2f07b6++){var _0x4967b8=[];if(_0x2f07b6===0x0){_0x4967b8[_0x0283('0x19')]({'text':_0x27da1b,'style':_0x0283('0x1e')});}var _0x475317={'table':_0x80b0ea[_0x2f07b6]};if(_0x2f07b6>0x0){_0x475317[_0x0283('0x1f')]=_0x0283('0x20');_0x475317[_0x0283('0x21')]=[0x0,0x46,0x0,0x0];}_0x4967b8[_0x0283('0x19')](_0x475317);_0x3bcbaf[_0x0283('0x19')](_0x4967b8);}return{'pageSize':'A4','pageOrientation':_0x0283('0x22'),'content':_0x3bcbaf,'footer':function(_0x3b476d,_0x4e60a0){return{'text':_0x3b476d['toString']()+_0x0283('0x23')+_0x4e60a0,'style':'footer'};},'defaultStyle':{'font':_0x0283('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3abe5a){var _0x73cbaf=0x1388;var _0x3d9f92;if(!_0x3abe5a[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0x0283('0x25')][_0x0283('0x26')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x0283('0x27')]})['then'](function(_0x30e28b){if(_0x30e28b){_0x3d9f92=_0x30e28b;_0x73cbaf=_0x3d9f92['splitSizePdf']||0x3e8;}})[_0x0283('0x28')](function(){var _0x2ec39a=[];var _0x1c8b7f=0x0;if(_0x3d9f92[_0x0283('0x29')]){if(_0x3abe5a&&_0x3abe5a[_0x0283('0x14')]){var _0x5cd0be=_[_0x0283('0x2a')](_0x3abe5a[0x0]['num']/_0x73cbaf);var _0x2ef848=Number['isInteger'](_0x3abe5a[0x0][_0x0283('0x2b')]/_0x73cbaf)?_0x3abe5a[0x0][_0x0283('0x2b')]%_0x73cbaf:0x0;_0x5cd0be['forEach'](function(_0x4f2e0c){if(_0x4f2e0c>0x0){_0x1c8b7f+=_0x73cbaf;}_0x2ec39a['push'](dbH[_0x0283('0x2c')][_0x0283('0x2d')](util[_0x0283('0x1a')](_0x0283('0x2e'),QUERY,_0x73cbaf,_0x1c8b7f),{'type':dbH['sequelize'][_0x0283('0x2f')][_0x0283('0x30')]}));});if(_0x2ef848>0x0){_0x1c8b7f+=_0x73cbaf;_0x2ec39a['push'](dbH[_0x0283('0x2c')]['query'](util[_0x0283('0x1a')](_0x0283('0x2e'),QUERY,_0x2ef848,_0x1c8b7f),{'type':dbH[_0x0283('0x2c')][_0x0283('0x2f')][_0x0283('0x30')]}));}}}else{_0x2ec39a[_0x0283('0x19')](dbH[_0x0283('0x2c')]['query'](QUERY,{'type':dbH['sequelize'][_0x0283('0x2f')][_0x0283('0x30')]}));}var _0x685c31=path[_0x0283('0x31')](PATH);var _0x8df0c6=path[_0x0283('0x32')](PATH,_0x0283('0x33'));var _0x447a2a=_0x3d9f92['split']&&_0x2ec39a['length']>0x1;var _0x153aac=[];if(!fs[_0x0283('0x34')](path[_0x0283('0x35')](_0x685c31,_0x8df0c6))&&_0x447a2a){fs[_0x0283('0x36')](path[_0x0283('0x35')](_0x685c31,_0x8df0c6));}return BPromise[_0x0283('0x37')](_0x2ec39a,function(_0x54d041){_0x153aac[_0x0283('0x19')](_0x54d041);})[_0x0283('0x28')](function(){var _0x3dd39a=[];for(var _0x4cebbf=0x0;_0x4cebbf<_0x153aac['length'];_0x4cebbf+=0x1){var _0x4824f9=_0x153aac[_0x4cebbf];var _0x20d22d=createTables(_[_0x0283('0x38')](_0x4824f9));var _0x51b003;var _0x38962c=getPDFDocDefinition(_0x20d22d);var _0x2a78c4=getPDFPrinter();var _0x228873=_0x2a78c4[_0x0283('0x39')](_0x38962c);if(_0x447a2a){_0x51b003=path[_0x0283('0x35')](_0x685c31,_0x8df0c6,util[_0x0283('0x1a')](_0x0283('0x3a'),_0x8df0c6,_0x4cebbf,_0x0283('0x3b')));}else{_0x51b003=path[_0x0283('0x35')](_0x685c31,util[_0x0283('0x1a')]('%s.%s',_0x8df0c6,'pdf'));}_0x3dd39a[_0x0283('0x19')](writePDFDocument(_0x228873,_0x51b003));}return Promise[_0x0283('0x3c')](_0x3dd39a);})['then'](function(){if(_0x447a2a){return new Promise(function(_0x302095){zipdir(path[_0x0283('0x35')](_0x685c31,_0x8df0c6),{'saveTo':path['join'](_0x685c31,util[_0x0283('0x1a')](_0x0283('0x3d'),_0x8df0c6,_0x0283('0x3e')))},function(){rimraf(path[_0x0283('0x35')](_0x685c31,_0x8df0c6),function(){});_0x302095(_0x0283('0x3f'));});});}})[_0x0283('0x28')](function(){if(!_0x447a2a)return;rimraf(path[_0x0283('0x35')](_0x685c31,_0x8df0c6),function(){});})[_0x0283('0x28')](function(){logger[_0x0283('0x40')](util[_0x0283('0x1a')](_0x0283('0x41'),EXTRACTED_REPORT_ID,_0x0283('0x42')));return analyticExtractedReport('Completed',_0x447a2a?util['format'](_0x0283('0x3d'),_0x8df0c6,_0x447a2a?_0x0283('0x3e'):_0x0283('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0x0283('0x43'),EXTRACTED_REPORT_ID,_0x0283('0x42')));return db[_0x0283('0xf')][_0x0283('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x0283('0x28')](function(_0x306774){EXTRACTED_REPORT=_0x306774;return dbH[_0x0283('0x2c')][_0x0283('0x2d')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0283('0x2c')][_0x0283('0x2f')]['SELECT']});})[_0x0283('0x28')](extractReport)[_0x0283('0x45')](function(_0x1fa963){logger[_0x0283('0x40')](util[_0x0283('0x1a')](_0x0283('0x46'),EXTRACTED_REPORT_ID,'PDF'),util[_0x0283('0x47')](_0x1fa963,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0283('0x48'));})['finally'](function(){process[_0x0283('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x6dc420=new PdfPrinter({'Arial':{'normal':__dirname+_0x0283('0x4a'),'bold':__dirname+_0x0283('0x4b'),'italics':__dirname+_0x0283('0x4c'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x6dc420;}function getPDFDocDefinitionFromHTML(_0x385860,_0x40316c){var _0x41018f=util[_0x0283('0x1a')]('%s\x20#%d',_0x40316c[_0x0283('0x4d')],_0x40316c[_0x0283('0x4e')]);var _0x1f827b=moment()[_0x0283('0x1a')](_0x0283('0x4f'))[_0x0283('0x12')]();var _0x40fdee=htmlToPdfmake(_0x385860,{'window':window,'tableAutoSize':!![]});return{'content':[_0x40fdee],'defaultStyle':{'font':_0x0283('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x0283('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x0283('0x50')}},'header':function(){return[{'text':_0x0283('0x51'),'style':_0x0283('0x1e')}];},'footer':function(_0x56369b,_0x5c4920){return[{'text':util[_0x0283('0x1a')](_0x0283('0x52'),_0x41018f,_0x56369b,_0x5c4920,_0x1f827b),'style':_0x0283('0x53')}];}};}function writePDFDocument(_0x2b2e39,_0x159212){return new Promise(function(_0x1f71e1,_0x2fc394){var _0x5aa82e=_0x2b2e39[_0x0283('0x54')](fs[_0x0283('0x55')](_0x159212));_0x5aa82e['on'](_0x0283('0x56'),function(){_0x1f71e1(_0x0283('0x56'));});_0x5aa82e['on'](_0x0283('0x57'),function(_0x5d95bc){_0x2fc394(_0x5d95bc);});_0x2b2e39['end']();});}exports[_0x0283('0x58')]=function(_0x431e3a,_0x5c14b7){var _0x20f53e=getPDFPrinter();var _0xe7bdc5=getPDFDocDefinitionFromHTML(_0x431e3a,_0x5c14b7);var _0x1db45c=_0x20f53e[_0x0283('0x39')](_0xe7bdc5);return writePDFDocument(_0x1db45c,_0x5c14b7[_0x0283('0x1')])[_0x0283('0x45')](function(_0x138508){throw _0x138508;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index d9ece03..8620e0b 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 _0x7e83=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','path','lodash','json2xls','bluebird','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','then','sequelize','query'];(function(_0x17a0a0,_0x1befaa){var _0x4da752=function(_0x429829){while(--_0x429829){_0x17a0a0['push'](_0x17a0a0['shift']());}};_0x4da752(++_0x1befaa);}(_0x7e83,0x7c));var _0x37e8=function(_0x5c52a3,_0x13c8d5){_0x5c52a3=_0x5c52a3-0x0;var _0x5537b9=_0x7e83[_0x5c52a3];return _0x5537b9;};'use strict';var util=require(_0x37e8('0x0'));var path=require(_0x37e8('0x1'));var _=require(_0x37e8('0x2'));var fs=require('fs');var json2xls=require(_0x37e8('0x3'));var BPromise=require(_0x37e8('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x37e8('0x5'))['db'];var dbH=require(_0x37e8('0x5'))[_0x37e8('0x6')];var logger=require('../../config/logger')(_0x37e8('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x37e8('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x37e8('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2d4f25,_0x4a669c){var _0x18c5ed={'status':_0x2d4f25};var _0x396fdf={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4a669c){_0x18c5ed[_0x37e8('0x9')]=_0x4a669c;}return db[_0x37e8('0xa')]['update'](_0x18c5ed,_0x396fdf);}function main(){var _0x789f38=0x1388;var _0x5659a6;logger[_0x37e8('0xb')](util[_0x37e8('0xc')](_0x37e8('0xd'),EXTRACTED_REPORT_ID,_0x37e8('0xe')));return db['Setting'][_0x37e8('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x37e8('0x10'),'splitSizeXlsx']})[_0x37e8('0x11')](function(_0x4ed71b){if(_0x4ed71b){_0x5659a6=_0x4ed71b;_0x789f38=_0x5659a6['splitSizeXlsx']||0x1388;}})[_0x37e8('0x11')](function(){return dbH[_0x37e8('0x12')][_0x37e8('0x13')](util[_0x37e8('0xc')](_0x37e8('0x14'),QUERY),{'type':dbH['sequelize'][_0x37e8('0x15')][_0x37e8('0x16')]});})['then'](function(_0x585078){if(!_0x585078[0x0][_0x37e8('0x17')]){return analyticExtractedReport(_0x37e8('0x18'));}var _0x28c189=[];var _0xe5a147=0x0;if(_0x5659a6[_0x37e8('0x10')]){if(_0x585078&&_0x585078[_0x37e8('0x19')]){var _0xe8fd43=_[_0x37e8('0x1a')](_0x585078[0x0][_0x37e8('0x17')]/_0x789f38);var _0x51b772=Number['isInteger'](_0x585078[0x0][_0x37e8('0x17')]/_0x789f38)?_0x585078[0x0][_0x37e8('0x17')]%_0x789f38:0x0;_0xe8fd43[_0x37e8('0x1b')](function(_0x17a335){if(_0x17a335>0x0){_0xe5a147+=_0x789f38;}_0x28c189[_0x37e8('0x1c')](dbH[_0x37e8('0x12')][_0x37e8('0x13')](util[_0x37e8('0xc')](_0x37e8('0x1d'),QUERY,_0x789f38,_0xe5a147),{'type':dbH[_0x37e8('0x12')]['QueryTypes']['SELECT']}));});if(_0x51b772>0x0){_0xe5a147+=_0x789f38;_0x28c189[_0x37e8('0x1c')](dbH[_0x37e8('0x12')][_0x37e8('0x13')](util[_0x37e8('0xc')](_0x37e8('0x1d'),QUERY,_0x51b772,_0xe5a147),{'type':dbH[_0x37e8('0x12')]['QueryTypes'][_0x37e8('0x16')]}));}}}else{_0x28c189[_0x37e8('0x1c')](dbH[_0x37e8('0x12')][_0x37e8('0x13')](QUERY,{'type':dbH[_0x37e8('0x12')][_0x37e8('0x15')][_0x37e8('0x16')]}));}var _0x3cc5ae=path['dirname'](PATH);var _0x3e117c=path[_0x37e8('0x1e')](PATH,_0x37e8('0x1f'));var _0x448d8a=_0x5659a6['split']&&_0x28c189[_0x37e8('0x19')]>0x1;var _0x5d2e34=[];if(!fs[_0x37e8('0x20')](path[_0x37e8('0x21')](_0x3cc5ae,_0x3e117c))&&_0x448d8a){fs[_0x37e8('0x22')](path[_0x37e8('0x21')](_0x3cc5ae,_0x3e117c));}return BPromise[_0x37e8('0x23')](_0x28c189,function(_0x388cbc){_0x5d2e34['push'](_0x388cbc);})['then'](function(){for(var _0x151e6d=0x0;_0x151e6d<_0x5d2e34[_0x37e8('0x19')];_0x151e6d+=0x1){var _0x432e1e;var _0x2445f2=_0x5d2e34[_0x151e6d];if(_0x448d8a){_0x432e1e=path[_0x37e8('0x21')](_0x3cc5ae,_0x3e117c,util['format'](_0x37e8('0x24'),_0x3e117c,_0x151e6d,_0x37e8('0x25')));}else{_0x432e1e=path[_0x37e8('0x21')](_0x3cc5ae,util['format'](_0x37e8('0x26'),_0x3e117c,'xlsx'));}fs[_0x37e8('0x27')](_0x432e1e,json2xls(_0x2445f2),_0x37e8('0x28'));}})[_0x37e8('0x11')](function(){if(_0x448d8a){return new Promise(function(_0x4b7fae){zipdir(path[_0x37e8('0x21')](_0x3cc5ae,_0x3e117c),{'saveTo':path[_0x37e8('0x21')](_0x3cc5ae,util[_0x37e8('0xc')](_0x37e8('0x26'),_0x3e117c,_0x37e8('0x29')))},function(_0x4fc5d5,_0x2676dd){rimraf(path[_0x37e8('0x21')](_0x3cc5ae,_0x3e117c),function(){});_0x4b7fae('zip\x20finished');});});}})[_0x37e8('0x11')](function(){logger[_0x37e8('0xb')](util['format'](_0x37e8('0x2a'),EXTRACTED_REPORT_ID,_0x37e8('0xe')));return analyticExtractedReport(_0x37e8('0x2b'),_0x448d8a?util[_0x37e8('0xc')]('%s.%s',_0x3e117c,_0x448d8a?_0x37e8('0x29'):'xlsx'):null);});})[_0x37e8('0x2c')](function(_0xd5f29){logger[_0x37e8('0xb')](util[_0x37e8('0xc')](_0x37e8('0x2d'),EXTRACTED_REPORT_ID,_0x37e8('0xe')),util['inspect'](_0xd5f29,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x37e8('0x2e'));})[_0x37e8('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x0aa8=['length','existsSync','mkdirSync','each','join','%s%d.%s','xlsx','writeFileSync','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','json2xls','zip-dir','rimraf','dbH','analytics','argv','savename','AnalyticExtractedReport','info','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','SELECT','num','Empty','range','isInteger','forEach','format','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename'];(function(_0x355121,_0x145912){var _0x2143dc=function(_0x34ef1a){while(--_0x34ef1a){_0x355121['push'](_0x355121['shift']());}};_0x2143dc(++_0x145912);}(_0x0aa8,0xae));var _0x80aa=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x0aa8[_0x28d18d];return _0x470640;};'use strict';var util=require(_0x80aa('0x0'));var path=require(_0x80aa('0x1'));var _=require(_0x80aa('0x2'));var fs=require('fs');var json2xls=require(_0x80aa('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x80aa('0x4'));var rimraf=require(_0x80aa('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x80aa('0x6')];var logger=require('../../config/logger')(_0x80aa('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x80aa('0x8')][0x2]);var QUERY=process[_0x80aa('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x312016,_0x5b2f56){var _0x4da1eb={'status':_0x312016};var _0xab34e0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5b2f56){_0x4da1eb[_0x80aa('0x9')]=_0x5b2f56;}return db[_0x80aa('0xa')]['update'](_0x4da1eb,_0xab34e0);}function main(){var _0x57cf56=0x1388;var _0x595aa7;logger[_0x80aa('0xb')](util['format'](_0x80aa('0xc'),EXTRACTED_REPORT_ID,_0x80aa('0xd')));return db[_0x80aa('0xe')][_0x80aa('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x80aa('0x10'),_0x80aa('0x11')]})[_0x80aa('0x12')](function(_0xdc2918){if(_0xdc2918){_0x595aa7=_0xdc2918;_0x57cf56=_0x595aa7[_0x80aa('0x11')]||0x1388;}})[_0x80aa('0x12')](function(){return dbH[_0x80aa('0x13')][_0x80aa('0x14')](util['format'](_0x80aa('0x15'),QUERY),{'type':dbH[_0x80aa('0x13')][_0x80aa('0x16')][_0x80aa('0x17')]});})[_0x80aa('0x12')](function(_0x2d4bfd){if(!_0x2d4bfd[0x0][_0x80aa('0x18')]){return analyticExtractedReport(_0x80aa('0x19'));}var _0x219697=[];var _0x4bdc10=0x0;if(_0x595aa7[_0x80aa('0x10')]){if(_0x2d4bfd&&_0x2d4bfd['length']){var _0x209cd9=_[_0x80aa('0x1a')](_0x2d4bfd[0x0]['num']/_0x57cf56);var _0x456ae2=Number[_0x80aa('0x1b')](_0x2d4bfd[0x0][_0x80aa('0x18')]/_0x57cf56)?_0x2d4bfd[0x0][_0x80aa('0x18')]%_0x57cf56:0x0;_0x209cd9[_0x80aa('0x1c')](function(_0x51b624){if(_0x51b624>0x0){_0x4bdc10+=_0x57cf56;}_0x219697['push'](dbH[_0x80aa('0x13')][_0x80aa('0x14')](util[_0x80aa('0x1d')](_0x80aa('0x1e'),QUERY,_0x57cf56,_0x4bdc10),{'type':dbH[_0x80aa('0x13')][_0x80aa('0x16')][_0x80aa('0x17')]}));});if(_0x456ae2>0x0){_0x4bdc10+=_0x57cf56;_0x219697[_0x80aa('0x1f')](dbH[_0x80aa('0x13')]['query'](util[_0x80aa('0x1d')](_0x80aa('0x1e'),QUERY,_0x456ae2,_0x4bdc10),{'type':dbH['sequelize'][_0x80aa('0x16')]['SELECT']}));}}}else{_0x219697[_0x80aa('0x1f')](dbH[_0x80aa('0x13')][_0x80aa('0x14')](QUERY,{'type':dbH['sequelize'][_0x80aa('0x16')][_0x80aa('0x17')]}));}var _0x2d6d2d=path[_0x80aa('0x20')](PATH);var _0x137fe3=path[_0x80aa('0x21')](PATH,'.xlsx');var _0xf7163e=_0x595aa7['split']&&_0x219697[_0x80aa('0x22')]>0x1;var _0x45f21e=[];if(!fs[_0x80aa('0x23')](path['join'](_0x2d6d2d,_0x137fe3))&&_0xf7163e){fs[_0x80aa('0x24')](path['join'](_0x2d6d2d,_0x137fe3));}return BPromise[_0x80aa('0x25')](_0x219697,function(_0x367944){_0x45f21e[_0x80aa('0x1f')](_0x367944);})['then'](function(){for(var _0x5a36a6=0x0;_0x5a36a6<_0x45f21e[_0x80aa('0x22')];_0x5a36a6+=0x1){var _0x1042d8;var _0x7fcc0a=_0x45f21e[_0x5a36a6];if(_0xf7163e){_0x1042d8=path[_0x80aa('0x26')](_0x2d6d2d,_0x137fe3,util[_0x80aa('0x1d')](_0x80aa('0x27'),_0x137fe3,_0x5a36a6,_0x80aa('0x28')));}else{_0x1042d8=path[_0x80aa('0x26')](_0x2d6d2d,util['format']('%s.%s',_0x137fe3,'xlsx'));}fs[_0x80aa('0x29')](_0x1042d8,json2xls(_0x7fcc0a),'binary');}})[_0x80aa('0x12')](function(){if(_0xf7163e){return new Promise(function(_0x325fd1){zipdir(path[_0x80aa('0x26')](_0x2d6d2d,_0x137fe3),{'saveTo':path[_0x80aa('0x26')](_0x2d6d2d,util[_0x80aa('0x1d')](_0x80aa('0x2a'),_0x137fe3,_0x80aa('0x2b')))},function(_0x18fca0,_0x3856a){rimraf(path[_0x80aa('0x26')](_0x2d6d2d,_0x137fe3),function(){});_0x325fd1(_0x80aa('0x2c'));});});}})['then'](function(){logger[_0x80aa('0xb')](util[_0x80aa('0x1d')](_0x80aa('0x2d'),EXTRACTED_REPORT_ID,_0x80aa('0xd')));return analyticExtractedReport(_0x80aa('0x2e'),_0xf7163e?util[_0x80aa('0x1d')]('%s.%s',_0x137fe3,_0xf7163e?_0x80aa('0x2b'):_0x80aa('0x28')):null);});})[_0x80aa('0x2f')](function(_0x62bb2c){logger['info'](util['format'](_0x80aa('0x30'),EXTRACTED_REPORT_ID,_0x80aa('0xd')),util['inspect'](_0x62bb2c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x80aa('0x31'));})[_0x80aa('0x32')](function(){process[_0x80aa('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index b093953..8d7196c 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 _0xec27=['lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extension','extensions','push','type','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','indexOf','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy','catch','error','rewrite'];(function(_0x5c66c3,_0xeff750){var _0x186410=function(_0x216e8e){while(--_0x216e8e){_0x5c66c3['push'](_0x5c66c3['shift']());}};_0x186410(++_0xeff750);}(_0xec27,0x92));var _0x7ec2=function(_0x4d4c6d,_0xa9e7fb){_0x4d4c6d=_0x4d4c6d-0x0;var _0x53b539=_0xec27[_0x4d4c6d];return _0x53b539;};'use strict';var _=require(_0x7ec2('0x0'));var util=require(_0x7ec2('0x1'));function rewrite(_0x2acaf5,_0x2c1765){var _0x14be94=this;return _0x2acaf5[_0x7ec2('0x2')][_0x7ec2('0x3')][_0x7ec2('0x4')]({'raw':!![]})[_0x7ec2('0x5')](function(_0x4561db){_0x14be94[_0x7ec2('0x6')]=_0x4561db;return _0x2acaf5['models'][_0x7ec2('0x7')][_0x7ec2('0x4')]({'where':{'IntervalId':_0x2c1765[_0x7ec2('0x8')]},'raw':!![]});})[_0x7ec2('0x5')](function(_0x17961f){return _0x2acaf5[_0x7ec2('0x2')]['VoiceExtension'][_0x7ec2('0x4')]({'where':{'exten':{'$in':_[_0x7ec2('0x9')](_[_0x7ec2('0xa')](_0x17961f,_0x7ec2('0xb')))}},'order':[{'raw':_0x7ec2('0xc')}],'raw':!![]});})[_0x7ec2('0x5')](function(_0x25dc64){var _0x139abb=_[_0x7ec2('0xd')](_0x25dc64,{'priority':'1'});var _0x21be48=_[_0x7ec2('0xd')](_0x25dc64,{'isApp':0x1});var _0x2dac45=_[_0x7ec2('0xe')](_0x21be48,'exten');var _0x1ed400=[_0x7ec2('0xf'),_0x7ec2('0x10')];var _0x355b45=[];var _0x4231e4=[];for(var _0x905cc1 in _0x2dac45){if(_0x2dac45[_0x7ec2('0x11')](_0x905cc1)){_0x14be94['priority']=0x2;_0x14be94['extensions']=[];_0x14be94[_0x7ec2('0x12')]=_['find'](_0x139abb,{'exten':_0x2dac45[_0x905cc1][0x0]['exten']});_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':_0x7ec2('0x16'),'appdata':util[_0x7ec2('0x17')](_0x7ec2('0x18'),_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')]),'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0]['exten'],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});if(_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')]===_0x7ec2('0x1c')){_0x14be94[_0x7ec2('0x13')]['push']({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':'Set','appdata':_0x7ec2('0x1d')+_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')],'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});}else if(_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')]===_0x7ec2('0x1e')){if(_0x14be94[_0x7ec2('0x12')]){_0x14be94['extensions'][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':_0x7ec2('0x16'),'appdata':_0x7ec2('0x1f')+(_0x14be94[_0x7ec2('0x12')][_0x7ec2('0x20')]?_0x7ec2('0x21')+_0x14be94[_0x7ec2('0x12')][_0x7ec2('0x20')]+'}':_0x7ec2('0x22')),'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94['priority']++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});}_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':_0x7ec2('0x16'),'appdata':_0x7ec2('0x1d')+_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')],'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94['priority']++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});var _0x3cee8a=_0x14be94[_0x7ec2('0x1a')]++;_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':_0x7ec2('0x23'),'appdata':_0x7ec2('0x24')+(_0x3cee8a+0x2)+'):Goto('+(_0x3cee8a+0x1)+')','context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x3cee8a,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});if(_0x14be94[_0x7ec2('0x12')]){_0x14be94['extensions'][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0]['type'],'app':_0x7ec2('0x16'),'appdata':_0x14be94[_0x7ec2('0x12')][_0x7ec2('0x20')]?_0x7ec2('0x25')+_0x14be94[_0x7ec2('0x12')][_0x7ec2('0x20')]+'}':'CDR(prefix)=noprefix','context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});}_0x14be94['extensions'][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0]['type'],'app':_0x7ec2('0x16'),'appdata':'outboundrouteid='+_0x2dac45[_0x905cc1][0x0]['VoiceExtensionId'],'context':_0x2dac45[_0x905cc1][0x0]['context'],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});if(_0x14be94[_0x7ec2('0x12')]&&_0x14be94[_0x7ec2('0x12')]['hasOwnProperty'](_0x7ec2('0x26'))&&_0x14be94[_0x7ec2('0x12')][_0x7ec2('0x26')]!==_0x7ec2('0x27')){_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':_0x7ec2('0x16'),'appdata':_0x7ec2('0x28'),'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0]['exten'],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0]['VoiceExtensionId']});_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':'Set','appdata':_0x7ec2('0x29')+_0x14be94[_0x7ec2('0x12')][_0x7ec2('0x26')]||_0x7ec2('0x2a'),'context':_0x2dac45[_0x905cc1][0x0]['context'],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94['priority']++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0]['VoiceExtensionId']});}}_0x14be94[_0x7ec2('0x13')]['push']({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':'Set','appdata':_0x7ec2('0x2b'),'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0]['exten'],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0]['type'],'app':'Set','appdata':_0x7ec2('0x2c'),'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94['priority']++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0]['VoiceExtensionId']});_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':'Set','appdata':_0x7ec2('0x2d'),'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});for(var _0x14295f=0x0,_0x404db8=0x0;_0x14295f<_0x2dac45[_0x905cc1][_0x7ec2('0x2e')];_0x14295f+=0x1,_0x404db8=0x0){var _0x1f1e2b=_0x2dac45[_0x905cc1][_0x14295f];if(_0x1f1e2b[_0x7ec2('0x15')]){_0x1f1e2b['type']=_0x1f1e2b['type'][_0x7ec2('0x2f')]();}var _0x4373f2=[];var _0x3322a6=[];delete _0x1f1e2b['id'];delete _0x1f1e2b['createdAt'];delete _0x1f1e2b[_0x7ec2('0x30')];var _0x201820=_0x1f1e2b[_0x7ec2('0x31')]!==_0x7ec2('0x32')?[_0x1f1e2b['interval']]:_0x1f1e2b[_0x7ec2('0x8')]?_[_0x7ec2('0xa')](_[_0x7ec2('0xd')](_0x14be94[_0x7ec2('0x6')],{'IntervalId':_0x1f1e2b[_0x7ec2('0x8')]}),'interval'):[];if(_0x1f1e2b[_0x7ec2('0x11')](_0x7ec2('0x33'))){if(_0x1f1e2b[_0x7ec2('0x33')]&&_0x1f1e2b['tag']!=='--'){_0x4373f2['push']({'type':_0x1f1e2b['type'],'app':_0x7ec2('0x16'),'appdata':'CDR(tag)='+_0x1f1e2b[_0x7ec2('0x33')],'context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b[_0x7ec2('0xb')],'priority':_0x201820[_0x7ec2('0x2e')]+_0x14be94[_0x7ec2('0x1a')]+_0x404db8++,'VoiceExtensionId':_0x1f1e2b[_0x7ec2('0x1b')]});}}if(_0x1f1e2b[_0x7ec2('0x15')]===_0x7ec2('0x1e')&&_0x1f1e2b[_0x7ec2('0x11')]('callerID')){if(_0x1f1e2b[_0x7ec2('0x34')]){_0x4373f2['push']({'type':_0x1f1e2b[_0x7ec2('0x15')],'app':_0x7ec2('0x23'),'appdata':_0x7ec2('0x35')+_0x1f1e2b[_0x7ec2('0x34')]+')','context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b[_0x7ec2('0xb')],'priority':_0x201820[_0x7ec2('0x2e')]+_0x14be94[_0x7ec2('0x1a')]+_0x404db8++,'VoiceExtensionId':_0x1f1e2b[_0x7ec2('0x1b')]});}else{_0x4373f2[_0x7ec2('0x14')]({'type':_0x1f1e2b[_0x7ec2('0x15')],'app':_0x7ec2('0x23'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b['exten'],'priority':_0x201820[_0x7ec2('0x2e')]+_0x14be94[_0x7ec2('0x1a')]+_0x404db8++,'VoiceExtensionId':_0x1f1e2b[_0x7ec2('0x1b')]});}}if(_0x1f1e2b[_0x7ec2('0x11')]('answer')){if(_0x1ed400[_0x7ec2('0x36')](_0x1f1e2b['app'][_0x7ec2('0x2f')]())>=0x0&&_0x1f1e2b[_0x7ec2('0x37')]!==_0x7ec2('0x38')){if(_0x1f1e2b[_0x7ec2('0x39')]){_0x4373f2[_0x7ec2('0x14')]({'type':_0x1f1e2b[_0x7ec2('0x15')],'app':_0x7ec2('0x23'),'appdata':_0x7ec2('0x3a'),'context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b[_0x7ec2('0xb')],'priority':_0x201820[_0x7ec2('0x2e')]+_0x14be94[_0x7ec2('0x1a')]+_0x404db8++,'VoiceExtensionId':_0x1f1e2b[_0x7ec2('0x1b')]});_0x4373f2[_0x7ec2('0x14')]({'type':_0x1f1e2b['type'],'app':'Set','appdata':_0x7ec2('0x3b'),'context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b[_0x7ec2('0xb')],'priority':_0x201820['length']+_0x14be94[_0x7ec2('0x1a')]+_0x404db8++,'VoiceExtensionId':_0x1f1e2b[_0x7ec2('0x1b')]});}else{_0x4373f2[_0x7ec2('0x14')]({'type':_0x1f1e2b['type'],'app':_0x7ec2('0x23'),'appdata':_0x7ec2('0x3c'),'context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b['exten'],'priority':_0x201820[_0x7ec2('0x2e')]+_0x14be94[_0x7ec2('0x1a')]+_0x404db8++,'VoiceExtensionId':_0x1f1e2b[_0x7ec2('0x1b')]});_0x4373f2[_0x7ec2('0x14')]({'type':_0x1f1e2b[_0x7ec2('0x15')],'app':_0x7ec2('0x16'),'appdata':_0x7ec2('0x3d'),'context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b[_0x7ec2('0xb')],'priority':_0x201820['length']+_0x14be94['priority']+_0x404db8++,'VoiceExtensionId':_0x1f1e2b['VoiceExtensionId']});}}}for(var _0x3b2fe5=0x0;_0x3b2fe5<_0x201820['length'];_0x3b2fe5+=0x1){var _0x4812ec=_0x14be94[_0x7ec2('0x1a')]+_0x201820[_0x7ec2('0x2e')];var _0x2f4e05=_0x3b2fe5===_0x201820['length']-0x1?_0x14be94['priority']+_0x4373f2[_0x7ec2('0x2e')]+_0x3322a6[_0x7ec2('0x2e')]+0x2:_0x14be94['priority']+_0x3b2fe5+0x1;_0x4373f2['splice'](_0x3b2fe5,0x0,{'type':_0x1f1e2b[_0x7ec2('0x15')],'app':_0x7ec2('0x3e'),'appdata':_0x201820[_0x3b2fe5]+'?'+_0x1f1e2b[_0x7ec2('0x19')]+',${EXTEN},'+_0x4812ec+':'+_0x1f1e2b[_0x7ec2('0x19')]+_0x7ec2('0x3f')+_0x2f4e05,'exten':_0x1f1e2b[_0x7ec2('0xb')],'context':_0x1f1e2b[_0x7ec2('0x19')],'priority':_0x14be94['priority']+_0x3b2fe5,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});}_0x1f1e2b[_0x7ec2('0x1a')]=_0x4373f2[_0x7ec2('0x2e')]?_['last'](_0x4373f2)[_0x7ec2('0x1a')]+0x1:_0x14be94[_0x7ec2('0x1a')];_0x14be94['priority']=(_0x3322a6['length']?_[_0x7ec2('0x40')](_0x3322a6)[_0x7ec2('0x1a')]:_0x1f1e2b[_0x7ec2('0x1a')])+0x1;_0x14be94[_0x7ec2('0x13')]=_[_0x7ec2('0x41')](_0x14be94[_0x7ec2('0x13')],_0x4373f2,[_0x1f1e2b],_0x3322a6);}_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':_0x7ec2('0x42'),'exten':_0x2dac45[_0x905cc1][0x0]['exten'],'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'priority':_0x14be94['priority'],'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});_0x355b45[_0x7ec2('0x14')](_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]);_0x4231e4=_['concat'](_0x4231e4,_0x14be94[_0x7ec2('0x13')]);}}return _0x2acaf5['transaction'](function(_0x1f29c9){return _0x2acaf5[_0x7ec2('0x2')][_0x7ec2('0x7')][_0x7ec2('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x355b45}},'transaction':_0x1f29c9})['then'](function(_0x4d712e){return _0x2acaf5[_0x7ec2('0x2')][_0x7ec2('0x7')][_0x7ec2('0x44')](_[_0x7ec2('0x45')](_0x4231e4,_0x7ec2('0x1a')),{'transaction':_0x1f29c9});});});})[_0x7ec2('0x46')](function(_0x3fd955){console[_0x7ec2('0x47')](_0x3fd955);});}exports[_0x7ec2('0x48')]=rewrite; \ No newline at end of file +var _0xd5cc=['updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','length','outbound','callerID','ExecIf','$[${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=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','sortBy','catch','error','rewrite','util','models','findAll','then','intervals','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','CDR(routeid)=','VoiceExtensionId','CDR(destination)=','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','toLowerCase'];(function(_0x59066c,_0x1bb5d7){var _0xc96584=function(_0x318fa4){while(--_0x318fa4){_0x59066c['push'](_0x59066c['shift']());}};_0xc96584(++_0x1bb5d7);}(_0xd5cc,0x1d6));var _0xcd5c=function(_0x1ec34a,_0x12bcbb){_0x1ec34a=_0x1ec34a-0x0;var _0x13bcf0=_0xd5cc[_0x1ec34a];return _0x13bcf0;};'use strict';var _=require('lodash');var util=require(_0xcd5c('0x0'));function rewrite(_0x294e72,_0x2b5157){var _0x31d7dc=this;return _0x294e72[_0xcd5c('0x1')]['Interval'][_0xcd5c('0x2')]({'raw':!![]})[_0xcd5c('0x3')](function(_0x5dab60){_0x31d7dc[_0xcd5c('0x4')]=_0x5dab60;return _0x294e72[_0xcd5c('0x1')][_0xcd5c('0x5')][_0xcd5c('0x2')]({'where':{'IntervalId':_0x2b5157['IntervalId']},'raw':!![]});})[_0xcd5c('0x3')](function(_0x44ccc0){return _0x294e72[_0xcd5c('0x1')][_0xcd5c('0x5')][_0xcd5c('0x2')]({'where':{'exten':{'$in':_[_0xcd5c('0x6')](_[_0xcd5c('0x7')](_0x44ccc0,'exten'))}},'order':[{'raw':_0xcd5c('0x8')}],'raw':!![]});})[_0xcd5c('0x3')](function(_0x5c7860){var _0x1a401b=_[_0xcd5c('0x9')](_0x5c7860,{'priority':'1'});var _0x337fdf=_[_0xcd5c('0x9')](_0x5c7860,{'isApp':0x1});var _0x2b4658=_[_0xcd5c('0xa')](_0x337fdf,_0xcd5c('0xb'));var _0x34c670=[_0xcd5c('0xc'),_0xcd5c('0xd')];var _0x2c510c=[];var _0x7d6973=[];for(var _0x372955 in _0x2b4658){if(_0x2b4658['hasOwnProperty'](_0x372955)){_0x31d7dc[_0xcd5c('0xe')]=0x2;_0x31d7dc[_0xcd5c('0xf')]=[];_0x31d7dc[_0xcd5c('0x10')]=_[_0xcd5c('0x11')](_0x1a401b,{'exten':_0x2b4658[_0x372955][0x0][_0xcd5c('0xb')]});_0x31d7dc[_0xcd5c('0xf')][_0xcd5c('0x12')]({'type':_0x2b4658[_0x372955][0x0][_0xcd5c('0x13')],'app':_0xcd5c('0x14'),'appdata':util[_0xcd5c('0x15')](_0xcd5c('0x16'),_0x2b4658[_0x372955][0x0][_0xcd5c('0x13')]),'context':_0x2b4658[_0x372955][0x0][_0xcd5c('0x17')],'exten':_0x2b4658[_0x372955][0x0][_0xcd5c('0xb')],'priority':_0x31d7dc[_0xcd5c('0xe')]++,'VoiceExtensionId':_0x2b4658[_0x372955][0x0]['VoiceExtensionId']});if(_0x2b4658[_0x372955][0x0][_0xcd5c('0x13')]==='inbound'){_0x31d7dc[_0xcd5c('0xf')][_0xcd5c('0x12')]({'type':_0x2b4658[_0x372955][0x0][_0xcd5c('0x13')],'app':_0xcd5c('0x14'),'appdata':_0xcd5c('0x18')+_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')],'context':_0x2b4658[_0x372955][0x0]['context'],'exten':_0x2b4658[_0x372955][0x0]['exten'],'priority':_0x31d7dc[_0xcd5c('0xe')]++,'VoiceExtensionId':_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')]});}else if(_0x2b4658[_0x372955][0x0][_0xcd5c('0x13')]==='outbound'){if(_0x31d7dc[_0xcd5c('0x10')]){_0x31d7dc['extensions'][_0xcd5c('0x12')]({'type':_0x2b4658[_0x372955][0x0][_0xcd5c('0x13')],'app':'Set','appdata':_0xcd5c('0x1a')+(_0x31d7dc[_0xcd5c('0x10')][_0xcd5c('0x1b')]?'${EXTEN:'+_0x31d7dc['extension'][_0xcd5c('0x1b')]+'}':_0xcd5c('0x1c')),'context':_0x2b4658[_0x372955][0x0][_0xcd5c('0x17')],'exten':_0x2b4658[_0x372955][0x0][_0xcd5c('0xb')],'priority':_0x31d7dc[_0xcd5c('0xe')]++,'VoiceExtensionId':_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')]});}_0x31d7dc[_0xcd5c('0xf')][_0xcd5c('0x12')]({'type':_0x2b4658[_0x372955][0x0][_0xcd5c('0x13')],'app':_0xcd5c('0x14'),'appdata':_0xcd5c('0x18')+_0x2b4658[_0x372955][0x0]['VoiceExtensionId'],'context':_0x2b4658[_0x372955][0x0][_0xcd5c('0x17')],'exten':_0x2b4658[_0x372955][0x0][_0xcd5c('0xb')],'priority':_0x31d7dc[_0xcd5c('0xe')]++,'VoiceExtensionId':_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')]});var _0x22600b=_0x31d7dc['priority']++;_0x31d7dc[_0xcd5c('0xf')][_0xcd5c('0x12')]({'type':_0x2b4658[_0x372955][0x0][_0xcd5c('0x13')],'app':'ExecIf','appdata':_0xcd5c('0x1d')+(_0x22600b+0x2)+'):Goto('+(_0x22600b+0x1)+')','context':_0x2b4658[_0x372955][0x0][_0xcd5c('0x17')],'exten':_0x2b4658[_0x372955][0x0][_0xcd5c('0xb')],'priority':_0x22600b,'VoiceExtensionId':_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')]});if(_0x31d7dc[_0xcd5c('0x10')]){_0x31d7dc[_0xcd5c('0xf')]['push']({'type':_0x2b4658[_0x372955][0x0][_0xcd5c('0x13')],'app':_0xcd5c('0x14'),'appdata':_0x31d7dc[_0xcd5c('0x10')][_0xcd5c('0x1b')]?_0xcd5c('0x1e')+_0x31d7dc[_0xcd5c('0x10')][_0xcd5c('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x2b4658[_0x372955][0x0][_0xcd5c('0x17')],'exten':_0x2b4658[_0x372955][0x0][_0xcd5c('0xb')],'priority':_0x31d7dc[_0xcd5c('0xe')]++,'VoiceExtensionId':_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')]});}_0x31d7dc[_0xcd5c('0xf')][_0xcd5c('0x12')]({'type':_0x2b4658[_0x372955][0x0][_0xcd5c('0x13')],'app':'Set','appdata':_0xcd5c('0x1f')+_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')],'context':_0x2b4658[_0x372955][0x0]['context'],'exten':_0x2b4658[_0x372955][0x0][_0xcd5c('0xb')],'priority':_0x31d7dc[_0xcd5c('0xe')]++,'VoiceExtensionId':_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')]});if(_0x31d7dc['extension']&&_0x31d7dc[_0xcd5c('0x10')][_0xcd5c('0x20')]('recordingFormat')&&_0x31d7dc[_0xcd5c('0x10')]['recordingFormat']!==_0xcd5c('0x21')){_0x31d7dc[_0xcd5c('0xf')][_0xcd5c('0x12')]({'type':_0x2b4658[_0x372955][0x0][_0xcd5c('0x13')],'app':_0xcd5c('0x14'),'appdata':_0xcd5c('0x22'),'context':_0x2b4658[_0x372955][0x0][_0xcd5c('0x17')],'exten':_0x2b4658[_0x372955][0x0][_0xcd5c('0xb')],'priority':_0x31d7dc[_0xcd5c('0xe')]++,'VoiceExtensionId':_0x2b4658[_0x372955][0x0]['VoiceExtensionId']});_0x31d7dc[_0xcd5c('0xf')][_0xcd5c('0x12')]({'type':_0x2b4658[_0x372955][0x0]['type'],'app':_0xcd5c('0x14'),'appdata':_0xcd5c('0x23')+_0x31d7dc[_0xcd5c('0x10')][_0xcd5c('0x24')]||_0xcd5c('0x25'),'context':_0x2b4658[_0x372955][0x0]['context'],'exten':_0x2b4658[_0x372955][0x0][_0xcd5c('0xb')],'priority':_0x31d7dc[_0xcd5c('0xe')]++,'VoiceExtensionId':_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')]});}}_0x31d7dc[_0xcd5c('0xf')][_0xcd5c('0x12')]({'type':_0x2b4658[_0x372955][0x0]['type'],'app':'Set','appdata':_0xcd5c('0x26'),'context':_0x2b4658[_0x372955][0x0][_0xcd5c('0x17')],'exten':_0x2b4658[_0x372955][0x0][_0xcd5c('0xb')],'priority':_0x31d7dc[_0xcd5c('0xe')]++,'VoiceExtensionId':_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')]});_0x31d7dc[_0xcd5c('0xf')][_0xcd5c('0x12')]({'type':_0x2b4658[_0x372955][0x0][_0xcd5c('0x13')],'app':_0xcd5c('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2b4658[_0x372955][0x0][_0xcd5c('0x17')],'exten':_0x2b4658[_0x372955][0x0]['exten'],'priority':_0x31d7dc['priority']++,'VoiceExtensionId':_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')]});_0x31d7dc['extensions'][_0xcd5c('0x12')]({'type':_0x2b4658[_0x372955][0x0][_0xcd5c('0x13')],'app':_0xcd5c('0x14'),'appdata':_0xcd5c('0x27'),'context':_0x2b4658[_0x372955][0x0][_0xcd5c('0x17')],'exten':_0x2b4658[_0x372955][0x0][_0xcd5c('0xb')],'priority':_0x31d7dc['priority']++,'VoiceExtensionId':_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')]});for(var _0x48bbf0=0x0,_0x512c6d=0x0;_0x48bbf0<_0x2b4658[_0x372955]['length'];_0x48bbf0+=0x1,_0x512c6d=0x0){var _0x2d52aa=_0x2b4658[_0x372955][_0x48bbf0];if(_0x2d52aa[_0xcd5c('0x13')]){_0x2d52aa[_0xcd5c('0x13')]=_0x2d52aa[_0xcd5c('0x13')][_0xcd5c('0x28')]();}var _0x4c35bf=[];var _0x1fbcba=[];delete _0x2d52aa['id'];delete _0x2d52aa['createdAt'];delete _0x2d52aa[_0xcd5c('0x29')];var _0x29016f=_0x2d52aa[_0xcd5c('0x2a')]!==_0xcd5c('0x2b')?[_0x2d52aa[_0xcd5c('0x2a')]]:_0x2d52aa[_0xcd5c('0x2c')]?_[_0xcd5c('0x7')](_[_0xcd5c('0x9')](_0x31d7dc[_0xcd5c('0x4')],{'IntervalId':_0x2d52aa[_0xcd5c('0x2c')]}),'interval'):[];if(_0x2d52aa['hasOwnProperty'](_0xcd5c('0x2d'))){if(_0x2d52aa[_0xcd5c('0x2d')]&&_0x2d52aa[_0xcd5c('0x2d')]!=='--'){_0x4c35bf['push']({'type':_0x2d52aa['type'],'app':_0xcd5c('0x14'),'appdata':_0xcd5c('0x2e')+_0x2d52aa[_0xcd5c('0x2d')],'context':_0x2d52aa[_0xcd5c('0x17')],'exten':_0x2d52aa[_0xcd5c('0xb')],'priority':_0x29016f[_0xcd5c('0x2f')]+_0x31d7dc[_0xcd5c('0xe')]+_0x512c6d++,'VoiceExtensionId':_0x2d52aa[_0xcd5c('0x19')]});}}if(_0x2d52aa['type']===_0xcd5c('0x30')&&_0x2d52aa[_0xcd5c('0x20')](_0xcd5c('0x31'))){if(_0x2d52aa['callerID']){_0x4c35bf[_0xcd5c('0x12')]({'type':_0x2d52aa[_0xcd5c('0x13')],'app':_0xcd5c('0x32'),'appdata':_0xcd5c('0x33')+_0x2d52aa['callerID']+')','context':_0x2d52aa['context'],'exten':_0x2d52aa['exten'],'priority':_0x29016f[_0xcd5c('0x2f')]+_0x31d7dc[_0xcd5c('0xe')]+_0x512c6d++,'VoiceExtensionId':_0x2d52aa[_0xcd5c('0x19')]});}else{_0x4c35bf[_0xcd5c('0x12')]({'type':_0x2d52aa[_0xcd5c('0x13')],'app':_0xcd5c('0x32'),'appdata':_0xcd5c('0x34'),'context':_0x2d52aa[_0xcd5c('0x17')],'exten':_0x2d52aa[_0xcd5c('0xb')],'priority':_0x29016f[_0xcd5c('0x2f')]+_0x31d7dc[_0xcd5c('0xe')]+_0x512c6d++,'VoiceExtensionId':_0x2d52aa[_0xcd5c('0x19')]});}}if(_0x2d52aa[_0xcd5c('0x20')](_0xcd5c('0x35'))){if(_0x34c670[_0xcd5c('0x36')](_0x2d52aa[_0xcd5c('0x37')]['toLowerCase']())>=0x0&&_0x2d52aa[_0xcd5c('0x38')]!==_0xcd5c('0x39')){if(_0x2d52aa[_0xcd5c('0x35')]){_0x4c35bf['push']({'type':_0x2d52aa[_0xcd5c('0x13')],'app':_0xcd5c('0x32'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2d52aa[_0xcd5c('0x17')],'exten':_0x2d52aa[_0xcd5c('0xb')],'priority':_0x29016f[_0xcd5c('0x2f')]+_0x31d7dc[_0xcd5c('0xe')]+_0x512c6d++,'VoiceExtensionId':_0x2d52aa[_0xcd5c('0x19')]});_0x4c35bf['push']({'type':_0x2d52aa[_0xcd5c('0x13')],'app':'Set','appdata':_0xcd5c('0x3a'),'context':_0x2d52aa['context'],'exten':_0x2d52aa[_0xcd5c('0xb')],'priority':_0x29016f[_0xcd5c('0x2f')]+_0x31d7dc[_0xcd5c('0xe')]+_0x512c6d++,'VoiceExtensionId':_0x2d52aa[_0xcd5c('0x19')]});}else{_0x4c35bf['push']({'type':_0x2d52aa[_0xcd5c('0x13')],'app':_0xcd5c('0x32'),'appdata':_0xcd5c('0x3b'),'context':_0x2d52aa['context'],'exten':_0x2d52aa['exten'],'priority':_0x29016f[_0xcd5c('0x2f')]+_0x31d7dc['priority']+_0x512c6d++,'VoiceExtensionId':_0x2d52aa[_0xcd5c('0x19')]});_0x4c35bf[_0xcd5c('0x12')]({'type':_0x2d52aa['type'],'app':_0xcd5c('0x14'),'appdata':_0xcd5c('0x3c'),'context':_0x2d52aa['context'],'exten':_0x2d52aa['exten'],'priority':_0x29016f[_0xcd5c('0x2f')]+_0x31d7dc[_0xcd5c('0xe')]+_0x512c6d++,'VoiceExtensionId':_0x2d52aa[_0xcd5c('0x19')]});}}}for(var _0x1325bf=0x0;_0x1325bf<_0x29016f[_0xcd5c('0x2f')];_0x1325bf+=0x1){var _0x4c81ea=_0x31d7dc[_0xcd5c('0xe')]+_0x29016f[_0xcd5c('0x2f')];var _0x2404ea=_0x1325bf===_0x29016f[_0xcd5c('0x2f')]-0x1?_0x31d7dc[_0xcd5c('0xe')]+_0x4c35bf['length']+_0x1fbcba['length']+0x2:_0x31d7dc[_0xcd5c('0xe')]+_0x1325bf+0x1;_0x4c35bf[_0xcd5c('0x3d')](_0x1325bf,0x0,{'type':_0x2d52aa[_0xcd5c('0x13')],'app':_0xcd5c('0x3e'),'appdata':_0x29016f[_0x1325bf]+'?'+_0x2d52aa[_0xcd5c('0x17')]+_0xcd5c('0x3f')+_0x4c81ea+':'+_0x2d52aa[_0xcd5c('0x17')]+_0xcd5c('0x3f')+_0x2404ea,'exten':_0x2d52aa[_0xcd5c('0xb')],'context':_0x2d52aa[_0xcd5c('0x17')],'priority':_0x31d7dc[_0xcd5c('0xe')]+_0x1325bf,'VoiceExtensionId':_0x2b4658[_0x372955][0x0]['VoiceExtensionId']});}_0x2d52aa[_0xcd5c('0xe')]=_0x4c35bf[_0xcd5c('0x2f')]?_[_0xcd5c('0x40')](_0x4c35bf)[_0xcd5c('0xe')]+0x1:_0x31d7dc[_0xcd5c('0xe')];_0x31d7dc[_0xcd5c('0xe')]=(_0x1fbcba[_0xcd5c('0x2f')]?_['last'](_0x1fbcba)[_0xcd5c('0xe')]:_0x2d52aa[_0xcd5c('0xe')])+0x1;_0x31d7dc['extensions']=_['concat'](_0x31d7dc['extensions'],_0x4c35bf,[_0x2d52aa],_0x1fbcba);}_0x31d7dc[_0xcd5c('0xf')][_0xcd5c('0x12')]({'type':_0x2b4658[_0x372955][0x0]['type'],'app':_0xcd5c('0x41'),'exten':_0x2b4658[_0x372955][0x0]['exten'],'context':_0x2b4658[_0x372955][0x0][_0xcd5c('0x17')],'priority':_0x31d7dc[_0xcd5c('0xe')],'VoiceExtensionId':_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')]});_0x2c510c[_0xcd5c('0x12')](_0x2b4658[_0x372955][0x0][_0xcd5c('0x19')]);_0x7d6973=_[_0xcd5c('0x42')](_0x7d6973,_0x31d7dc['extensions']);}}return _0x294e72[_0xcd5c('0x43')](function(_0x51be8e){return _0x294e72[_0xcd5c('0x1')][_0xcd5c('0x5')][_0xcd5c('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x2c510c}},'transaction':_0x51be8e})['then'](function(_0x48892d){return _0x294e72[_0xcd5c('0x1')][_0xcd5c('0x5')]['bulkCreate'](_[_0xcd5c('0x45')](_0x7d6973,_0xcd5c('0xe')),{'transaction':_0x51be8e});});});})[_0xcd5c('0x46')](function(_0x4f62cd){console[_0xcd5c('0x47')](_0x4f62cd);});}exports[_0xcd5c('0x48')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 4f17331..ae09a10 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 _0x6b5e=['redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','data','firstName','phone','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','create','keys','then','pick','catch','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','from','\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','cm_hopper_black','outbound','CmList','Lists','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','resume','resolve','emit','contact:csv_','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','split','CmContact','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b5e,0x19f));var _0xe6b5=function(_0x28cf4f,_0x3394c0){_0x28cf4f=_0x28cf4f-0x0;var _0xe29521=_0x6b5e[_0x28cf4f];return _0xe29521;};'use strict';var BPromise=require(_0xe6b5('0x0'));var util=require(_0xe6b5('0x1'));var _=require(_0xe6b5('0x2'));var fs=require('fs');var squel=require(_0xe6b5('0x3'));var Papa=require(_0xe6b5('0x4'));var Redis=require('ioredis');var db=require(_0xe6b5('0x5'))['db'];var config=require(_0xe6b5('0x6'));var logger=require(_0xe6b5('0x7'))(_0xe6b5('0x8'));config[_0xe6b5('0x9')]=_[_0xe6b5('0xa')](config[_0xe6b5('0x9')],{'host':_0xe6b5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe6b5('0x9')]));require(_0xe6b5('0xc'))[_0xe6b5('0xd')](socket);try{if(!process[_0xe6b5('0xe')][0x2]||process[_0xe6b5('0xe')][0x2]===_0xe6b5('0xf')||process[_0xe6b5('0xe')][0x2]===_0xe6b5('0x10')){throw new Error(_0xe6b5('0x11'));}var FILEPATH=process[_0xe6b5('0xe')][0x2];if(!process[_0xe6b5('0xe')][0x3]||process[_0xe6b5('0xe')][0x3]===_0xe6b5('0xf')||process[_0xe6b5('0xe')][0x3]===_0xe6b5('0x10')||!process[_0xe6b5('0xe')][0x4]||process[_0xe6b5('0xe')][0x4]===_0xe6b5('0xf')||process[_0xe6b5('0xe')][0x4]==='null'){throw new Error(_0xe6b5('0x12'));}var FIELDS=_[_0xe6b5('0x13')](process[_0xe6b5('0xe')][0x3]['split'](','),process[_0xe6b5('0xe')][0x4]['split'](','));if(!process['argv'][0x5]||process[_0xe6b5('0xe')][0x5]===_0xe6b5('0xf')||process[_0xe6b5('0xe')][0x5]===_0xe6b5('0x10')){throw new Error(_0xe6b5('0x14'));}var LISTID=process[_0xe6b5('0xe')][0x5];var COMPANYID=process[_0xe6b5('0xe')][0x6]&&process[_0xe6b5('0xe')][0x6]!==_0xe6b5('0xf')&&process['argv'][0x6]!==_0xe6b5('0x10')?process[_0xe6b5('0xe')][0x6]:null;var DUPLICATES=process[_0xe6b5('0xe')][0x7]&&process[_0xe6b5('0xe')][0x7]!==_0xe6b5('0xf')&&process[_0xe6b5('0xe')][0x7]!==_0xe6b5('0x10')?process[_0xe6b5('0xe')][0x7]:null;if(!process[_0xe6b5('0xe')][0x8]||process[_0xe6b5('0xe')][0x8]===_0xe6b5('0xf')||process[_0xe6b5('0xe')][0x8]===_0xe6b5('0x10')){throw new Error(_0xe6b5('0x15'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x42333c){logger['error'](_0x42333c);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0xf7f9cc,_0x11d3a1,_0x4129da,_0x5342a4){var _0x4dcc8d={'message':_0x11d3a1};_0x4dcc8d[_0xf7f9cc]=!![];if(_0x4129da){_0x4dcc8d[_0xe6b5('0x16')]=_0x4129da;}if(_0x5342a4){_0x4dcc8d[_0xe6b5('0x17')]=_0x5342a4;}return _0x4dcc8d;}function isEmail(_0x4e9016){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x4e9016);}function checkRow(_0x18206c,_0x8b10c5,_0x1a937e){return new BPromise(function(_0x52fed9,_0x4872cf){if(_[_0xe6b5('0x18')](_0x18206c)){return _0x4872cf(handleCheckRowError(_0xe6b5('0x19'),_0xe6b5('0x1a'),null,_0x1a937e));}if(_0x18206c[_0xe6b5('0x1b')]&&_0x18206c[_0xe6b5('0x1b')][_0xe6b5('0x1c')]){var _0x3709c8=_['map'](_0x18206c[_0xe6b5('0x1b')],_0xe6b5('0x1d'))['join'](';');return _0x4872cf(handleCheckRowError(_0xe6b5('0x19'),_0x3709c8,null,_0x1a937e));}var _0x3d1be2={};for(var _0x2f6373 in FIELDS){if(FIELDS['hasOwnProperty'](_0x2f6373)&&FIELDS[_0x2f6373]){_0x3d1be2[_0x2f6373]=_0x18206c['data'][0x0][FIELDS[_0x2f6373]]||_0x18206c[_0xe6b5('0x1e')][0x0]['\ufeff'+FIELDS[_0x2f6373]];}}if(!_0x3d1be2[_0xe6b5('0x1f')]){return _0x4872cf(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x1a937e));}if(!_0x3d1be2[_0xe6b5('0x20')]){return _0x4872cf(handleCheckRowError(_0xe6b5('0x19'),'phone\x20not\x20specified!',null,_0x1a937e));}if(_0x3d1be2['birthDate']){var _0x9bbced=moment(_0x3d1be2[_0xe6b5('0x21')],'YYYY-MM-DD');if(!_0x9bbced['isValid']()){return _0x4872cf(handleCheckRowError(_0xe6b5('0x19'),_0xe6b5('0x22'),null,_0x1a937e));}}if(_0x3d1be2[_0xe6b5('0x23')]){if(!isEmail(_0x3d1be2[_0xe6b5('0x23')])){return _0x4872cf(handleCheckRowError(_0xe6b5('0x19'),_0xe6b5('0x24'),null,_0x1a937e));}}_0x3d1be2[_0xe6b5('0x25')]=LISTID;_0x3d1be2[_0xe6b5('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xe6b5('0x1c')]&&_0x8b10c5){var _0x471821={};for(var _0x56864b=0x0,_0x5693c3=DUPLICATES[_0xe6b5('0x1c')];_0x56864b<_0x5693c3;_0x56864b+=0x1){_0x471821[DUPLICATES[_0x56864b]]=_0x3d1be2[DUPLICATES[_0x56864b]];}var _0x48040b=_[_0xe6b5('0x27')](_0x8b10c5,_0x471821);if(_0x48040b){return _0x4872cf(handleCheckRowError(_0xe6b5('0x28'),'Duplicate\x20Contact',_0x48040b,_0x1a937e));}}return db['CmContact'][_0xe6b5('0x29')](_0x3d1be2,{'raw':!![],'hooks':![],'fields':_[_0xe6b5('0x2a')](_0x3d1be2)})[_0xe6b5('0x2b')](function(_0x106508){if(DUPLICATES&&DUPLICATES['length']&&_0x8b10c5){_0x8b10c5['push'](_[_0xe6b5('0x2c')](_0x3d1be2,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x106508['id'];return _0x52fed9();})[_0xe6b5('0x2d')](function(_0xb6c7cb){return _0x4872cf(handleCheckRowError(_0xe6b5('0x19'),'Error\x20while\x20creating\x20contact:\x20'+(_0xb6c7cb['message']||JSON[_0xe6b5('0x2e')](_0xb6c7cb)),null,_0x1a937e));});});}function checkHopper(){function _0x3e795c(){return function(_0x26bf16){logger['error'](_0xe6b5('0x2f'),_0xe6b5('0x30'),util[_0xe6b5('0x31')](_0x26bf16,{'showHidden':![],'depth':null}));};}var _0x27b55d=function(_0x16b666,_0x588394){var _0x1dd935=squel[_0xe6b5('0x32')]()[_0xe6b5('0x33')](_0xe6b5('0x34'))[_0xe6b5('0x35')]([_0xe6b5('0x20'),_0xe6b5('0x36'),_0xe6b5('0x37'),_0xe6b5('0x25'),_0x588394,_0xe6b5('0x38'),_0xe6b5('0x39')],squel[_0xe6b5('0x3a')]()[_0xe6b5('0x3b')](_0xe6b5('0x20'),_0xe6b5('0x20'))[_0xe6b5('0x3b')](_0xe6b5('0x3c'),'scheduledAt')[_0xe6b5('0x3b')]('id','ContactId')[_0xe6b5('0x3b')](LISTID[_0xe6b5('0x3d')](),'ListId')[_0xe6b5('0x3b')](_0x16b666['id'][_0xe6b5('0x3d')](),_0x588394)[_0xe6b5('0x3b')](_0xe6b5('0x3c'),_0xe6b5('0x38'))[_0xe6b5('0x3b')](_0xe6b5('0x3c'),_0xe6b5('0x39'))['from'](_0xe6b5('0x3e'))[_0xe6b5('0x3f')](_0xe6b5('0x40'))[_0xe6b5('0x3f')](_0xe6b5('0x41'),LISTID['toString']())[_0xe6b5('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0xe6b5('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xe6b5('0x3a')]()['field'](_0xe6b5('0x20'))[_0xe6b5('0x42')](_0xe6b5('0x34'))[_0xe6b5('0x3f')](_0x588394+_0xe6b5('0x43'),_0x16b666['id']['toString']())))['toString']();return _0x1dd935;};var _0x201a13=function(_0x516f0a,_0x1d3bcb){var _0x32209e=squel[_0xe6b5('0x32')]()['into'](_0xe6b5('0x34'))[_0xe6b5('0x35')]([_0xe6b5('0x20'),_0xe6b5('0x36'),'ContactId','ListId',_0x1d3bcb,_0xe6b5('0x38'),_0xe6b5('0x39')],squel[_0xe6b5('0x3a')]()['field'](_0xe6b5('0x20'),_0xe6b5('0x20'))['field'](_0xe6b5('0x3c'),_0xe6b5('0x36'))['field']('id',_0xe6b5('0x37'))[_0xe6b5('0x3b')](LISTID[_0xe6b5('0x3d')](),'ListId')['field'](_0x516f0a['id'][_0xe6b5('0x3d')](),_0x1d3bcb)[_0xe6b5('0x3b')](_0xe6b5('0x3c'),_0xe6b5('0x38'))[_0xe6b5('0x3b')](_0xe6b5('0x3c'),_0xe6b5('0x39'))[_0xe6b5('0x42')]('cm_contacts')['where'](_0xe6b5('0x40'))['where'](_0xe6b5('0x41'),LISTID[_0xe6b5('0x3d')]())[_0xe6b5('0x3f')](_0xe6b5('0x44'),squel[_0xe6b5('0x45')](hopperContacts))[_0xe6b5('0x3f')](_0xe6b5('0x46'))[_0xe6b5('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xe6b5('0x3a')]()[_0xe6b5('0x3b')]('calleridnum')[_0xe6b5('0x42')](_0xe6b5('0x47'))[_0xe6b5('0x3f')](_0x1d3bcb+'\x20=\x20?',_0x516f0a['id']['toString']()))['where'](_0xe6b5('0x48'),squel['select']()['field'](_0xe6b5('0x20'))[_0xe6b5('0x42')](_0xe6b5('0x34'))[_0xe6b5('0x3f')](_0x1d3bcb+_0xe6b5('0x43'),_0x516f0a['id'][_0xe6b5('0x3d')]())))[_0xe6b5('0x3d')]();return _0x32209e;};function _0x57d3b6(_0x3b9608,_0x120ec0){var _0x4ca592=squel['insert']()[_0xe6b5('0x33')](_0xe6b5('0x34'))['fromQuery'](['phone',_0xe6b5('0x36'),'ContactId',_0xe6b5('0x25'),_0x120ec0,_0xe6b5('0x38'),_0xe6b5('0x39')],squel[_0xe6b5('0x3a')]()[_0xe6b5('0x3b')](_0xe6b5('0x20'),_0xe6b5('0x20'))[_0xe6b5('0x3b')]('NOW()',_0xe6b5('0x36'))[_0xe6b5('0x3b')]('id',_0xe6b5('0x37'))[_0xe6b5('0x3b')](LISTID['toString'](),_0xe6b5('0x25'))[_0xe6b5('0x3b')](_0x3b9608['id'][_0xe6b5('0x3d')](),_0x120ec0)[_0xe6b5('0x3b')](_0xe6b5('0x3c'),_0xe6b5('0x38'))['field'](_0xe6b5('0x3c'),_0xe6b5('0x39'))[_0xe6b5('0x42')]('cm_contacts')['where'](_0xe6b5('0x40'))[_0xe6b5('0x3f')](_0xe6b5('0x41'),LISTID['toString']())[_0xe6b5('0x3f')](_0xe6b5('0x44'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xe6b5('0x3d')]();return _0x4ca592;}function _0x53894f(_0x3a75c4,_0x149fd9){var _0xcc313e=squel[_0xe6b5('0x32')]()[_0xe6b5('0x33')](_0xe6b5('0x49'))[_0xe6b5('0x35')]([_0xe6b5('0x20'),_0xe6b5('0x37'),'ListId',_0x149fd9,_0xe6b5('0x38'),'updatedAt'],squel[_0xe6b5('0x3a')]()['field'](_0xe6b5('0x20'),'phone')[_0xe6b5('0x3b')]('id',_0xe6b5('0x37'))[_0xe6b5('0x3b')](LISTID[_0xe6b5('0x3d')](),_0xe6b5('0x25'))[_0xe6b5('0x3b')](_0x3a75c4['id'][_0xe6b5('0x3d')](),_0x149fd9)[_0xe6b5('0x3b')](_0xe6b5('0x3c'),'createdAt')[_0xe6b5('0x3b')](_0xe6b5('0x3c'),_0xe6b5('0x39'))[_0xe6b5('0x42')]('cm_contacts')['where'](_0xe6b5('0x40'))[_0xe6b5('0x3f')](_0xe6b5('0x41'),LISTID[_0xe6b5('0x3d')]())[_0xe6b5('0x3f')](_0xe6b5('0x44'),squel[_0xe6b5('0x45')](hopperContacts))[_0xe6b5('0x3f')](_0xe6b5('0x46')))[_0xe6b5('0x3d')]();return _0xcc313e;}return db['VoiceQueue']['findAll']({'where':{'type':_0xe6b5('0x4a')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xe6b5('0x4b')],'as':_0xe6b5('0x4c'),'where':{'id':LISTID}}]})['then'](function(_0x5b6dbe){var _0x2d5493=[];if(_0x5b6dbe){var _0x3d2dd8;for(var _0x4429b3=0x0,_0x1e6062;_0x4429b3<_0x5b6dbe['length'];_0x4429b3+=0x1){_0x1e6062=_0x5b6dbe[_0x4429b3][_0xe6b5('0x4d')]({'plain':!![]});switch(_0x1e6062[_0xe6b5('0x4e')]){case _0xe6b5('0x4f'):_0x2d5493['push'](db[_0xe6b5('0x50')][_0xe6b5('0x51')](_0x201a13(_0x1e6062,_0xe6b5('0x52')))[_0xe6b5('0x2b')](function(){})[_0xe6b5('0x2d')](_0x3e795c()));break;case _0xe6b5('0x53'):_0x2d5493[_0xe6b5('0x54')](db[_0xe6b5('0x50')]['query'](_0x27b55d(_0x1e6062,'VoiceQueueId'))['then'](function(){})['catch'](_0x3e795c()));break;default:_0x2d5493[_0xe6b5('0x54')](db[_0xe6b5('0x50')][_0xe6b5('0x51')](_0x57d3b6(_0x1e6062,_0xe6b5('0x52')))['then'](function(){})['catch'](_0x3e795c()));}}}return _0x2d5493;})[_0xe6b5('0x55')]()[_0xe6b5('0x2b')](function(){return db['VoiceQueue'][_0xe6b5('0x56')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xe6b5('0x4b')],'as':_0xe6b5('0x57'),'where':{'id':LISTID}}]})[_0xe6b5('0x2b')](function(_0x36815d){var _0x23682c=[];if(_0x36815d){var _0x2570da;for(var _0x353846=0x0,_0x4b4425;_0x353846<_0x36815d[_0xe6b5('0x1c')];_0x353846+=0x1){_0x4b4425=_0x36815d[_0x353846][_0xe6b5('0x4d')]({'plain':!![]});_0x23682c['push'](db['sequelize'][_0xe6b5('0x51')](_0x53894f(_0x4b4425,_0xe6b5('0x52')))[_0xe6b5('0x2b')](function(){})[_0xe6b5('0x2d')](_0x3e795c()));}}return _0x23682c;})[_0xe6b5('0x55')]();})[_0xe6b5('0x2b')](function(){return db[_0xe6b5('0x58')]['findAll']({'attributes':['id',_0xe6b5('0x4e')],'include':[{'model':db[_0xe6b5('0x4b')],'as':'Lists','where':{'id':LISTID}}]})[_0xe6b5('0x2b')](function(_0x4ce3be){var _0x4a3e6f=[];if(_0x4ce3be){for(var _0x3586d8=0x0,_0x228b33;_0x3586d8<_0x4ce3be[_0xe6b5('0x1c')];_0x3586d8+=0x1){_0x228b33=_0x4ce3be[_0x3586d8][_0xe6b5('0x4d')]({'plain':!![]});switch(_0x228b33[_0xe6b5('0x4e')]){case _0xe6b5('0x4f'):_0x4a3e6f[_0xe6b5('0x54')](db[_0xe6b5('0x50')][_0xe6b5('0x51')](_0x201a13(_0x228b33,'CampaignId'))[_0xe6b5('0x2b')](function(){})[_0xe6b5('0x2d')](_0x3e795c()));break;case _0xe6b5('0x53'):_0x4a3e6f[_0xe6b5('0x54')](db[_0xe6b5('0x50')][_0xe6b5('0x51')](_0x27b55d(_0x228b33,'CampaignId'))['then'](function(){})[_0xe6b5('0x2d')](_0x3e795c()));break;default:_0x4a3e6f[_0xe6b5('0x54')](db[_0xe6b5('0x50')][_0xe6b5('0x51')](_0x57d3b6(_0x228b33,'CampaignId'))['then'](function(){})[_0xe6b5('0x2d')](_0x3e795c()));}}}return _0x4a3e6f;})[_0xe6b5('0x55')]();})[_0xe6b5('0x2b')](function(){return db[_0xe6b5('0x58')][_0xe6b5('0x56')]({'attributes':['id'],'include':[{'model':db[_0xe6b5('0x4b')],'as':_0xe6b5('0x57'),'where':{'id':LISTID}}]})[_0xe6b5('0x2b')](function(_0x50473b){var _0x311e4f=[];if(_0x50473b){for(var _0x319f19=0x0,_0x524029;_0x319f19<_0x50473b['length'];_0x319f19+=0x1){_0x524029=_0x50473b[_0x319f19][_0xe6b5('0x4d')]({'plain':!![]});_0x311e4f[_0xe6b5('0x54')](db['sequelize'][_0xe6b5('0x51')](_0x53894f(_0x524029,_0xe6b5('0x59')))[_0xe6b5('0x2b')](function(){})[_0xe6b5('0x2d')](_0x3e795c()));}}return _0x311e4f;})['all']();})[_0xe6b5('0x2d')](function(_0xe203a4){logger[_0xe6b5('0x19')](_0xe6b5('0x5a'),_0xe6b5('0x5b'),_0xe203a4[_0xe6b5('0x1d')]);});}var processPromises=function(_0x565225){return BPromise[_0xe6b5('0x55')](promises)[_0xe6b5('0x2b')](function(_0x12dbbb){})[_0xe6b5('0x2d')](function(_0x4e9442){logger['error'](_0xe6b5('0x5c'),JSON[_0xe6b5('0x2e')](_0x4e9442));})[_0xe6b5('0x5d')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x565225){return _0x565225[_0xe6b5('0x5e')]();}});};var endCsv=function(){return BPromise[_0xe6b5('0x5f')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xe6b5('0x2b')](function(){socket[_0xe6b5('0x60')](_0xe6b5('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x34e6ea){logger[_0xe6b5('0x19')](_0xe6b5('0x62'),JSON[_0xe6b5('0x2e')](_0x34e6ea));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0xe6b5('0x63')](_0xe6b5('0x64'));endCsv();});function main(){return BPromise[_0xe6b5('0x5f')]()[_0xe6b5('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe6b5('0x65')](',');return db[_0xe6b5('0x66')][_0xe6b5('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x3428a1){var _0x55a934=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x55a934,{'header':!![],'skipEmptyLines':!![],'step':function(_0x13c1e0,_0x3355dc){total+=0x1;var _0x54b601=total;promises[_0xe6b5('0x54')](checkRow(_0x13c1e0,_0x3428a1,_0x54b601)[_0xe6b5('0x2b')](function(){success+=0x1;})[_0xe6b5('0x2d')](function(_0xbe6819){if(_0xbe6819[_0xe6b5('0x19')]){errors+=0x1;delete _0xbe6819['error'];}else if(_0xbe6819['duplicate']){duplicates+=0x1;delete _0xbe6819[_0xe6b5('0x28')];}rows[_0xe6b5('0x54')](_0xbe6819);}));if(total%0xc8===0x0){_0x3355dc['pause']();return processPromises(_0x3355dc);}},'complete':function(){return processPromises()['then'](function(){logger[_0xe6b5('0x63')](_0xe6b5('0x67'));endCsv();});},'error':function(_0x30fb63,_0x2c8e2c){logger[_0xe6b5('0x63')](_0xe6b5('0x68'),JSON[_0xe6b5('0x2e')](_0x30fb63));endCsv();}});})[_0xe6b5('0x2d')](function(_0x82b128){logger[_0xe6b5('0x19')](_0xe6b5('0x69'),JSON[_0xe6b5('0x2e')](_0x82b128));});}main(); \ No newline at end of file +var _0xbba1=['bluebird','util','lodash','squel','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','message','data','firstName','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','email','ListId','length','find','duplicate','Duplicate\x20Contact','CmContact','keys','pick','catch','stringify','inspect','insert','into','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','updatedAt','from','deletedAt\x20IS\x20NULL','where','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','toString','createdAt','cm_contacts','ListId\x20=\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','query','then','onlyIfOpen','push','sequelize','get','VoiceQueueId','all','Campaign','dialCheckDuplicateType','always','CampaignId','BlackLists','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','resolve','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbba1,0x69));var _0x1bba=function(_0x553c47,_0x4d8a7a){_0x553c47=_0x553c47-0x0;var _0x12b661=_0xbba1[_0x553c47];return _0x12b661;};'use strict';var BPromise=require(_0x1bba('0x0'));var util=require(_0x1bba('0x1'));var _=require(_0x1bba('0x2'));var fs=require('fs');var squel=require(_0x1bba('0x3'));var Papa=require('papaparse');var Redis=require(_0x1bba('0x4'));var db=require(_0x1bba('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x1bba('0x6'))(_0x1bba('0x7'));config[_0x1bba('0x8')]=_[_0x1bba('0x9')](config[_0x1bba('0x8')],{'host':_0x1bba('0xa'),'port':0x18eb});var socket=require(_0x1bba('0xb'))(new Redis(config[_0x1bba('0x8')]));require(_0x1bba('0xc'))[_0x1bba('0xd')](socket);try{if(!process[_0x1bba('0xe')][0x2]||process[_0x1bba('0xe')][0x2]===_0x1bba('0xf')||process[_0x1bba('0xe')][0x2]===_0x1bba('0x10')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x1bba('0xe')][0x3]===_0x1bba('0xf')||process[_0x1bba('0xe')][0x3]===_0x1bba('0x10')||!process[_0x1bba('0xe')][0x4]||process[_0x1bba('0xe')][0x4]===_0x1bba('0xf')||process[_0x1bba('0xe')][0x4]===_0x1bba('0x10')){throw new Error(_0x1bba('0x11'));}var FIELDS=_[_0x1bba('0x12')](process[_0x1bba('0xe')][0x3][_0x1bba('0x13')](','),process[_0x1bba('0xe')][0x4][_0x1bba('0x13')](','));if(!process[_0x1bba('0xe')][0x5]||process[_0x1bba('0xe')][0x5]==='undefined'||process[_0x1bba('0xe')][0x5]===_0x1bba('0x10')){throw new Error(_0x1bba('0x14'));}var LISTID=process[_0x1bba('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!==_0x1bba('0xf')&&process['argv'][0x6]!==_0x1bba('0x10')?process[_0x1bba('0xe')][0x6]:null;var DUPLICATES=process[_0x1bba('0xe')][0x7]&&process[_0x1bba('0xe')][0x7]!=='undefined'&&process['argv'][0x7]!=='null'?process[_0x1bba('0xe')][0x7]:null;if(!process['argv'][0x8]||process[_0x1bba('0xe')][0x8]===_0x1bba('0xf')||process['argv'][0x8]===_0x1bba('0x10')){throw new Error(_0x1bba('0x15'));}var SOCKET_TIMESTAMP=process[_0x1bba('0xe')][0x8];}catch(_0x161753){logger[_0x1bba('0x16')](_0x161753);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(_0x132a63,_0x2c7204,_0x2aa2d3,_0x59f535){var _0x24add7={'message':_0x2c7204};_0x24add7[_0x132a63]=!![];if(_0x2aa2d3){_0x24add7[_0x1bba('0x17')]=_0x2aa2d3;}if(_0x59f535){_0x24add7[_0x1bba('0x18')]=_0x59f535;}return _0x24add7;}function isEmail(_0x267042){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))*$/[_0x1bba('0x19')](_0x267042);}function checkRow(_0x2f9cdc,_0xa8e5dc,_0x4684b5){return new BPromise(function(_0x1a8da6,_0x59bfd1){if(_[_0x1bba('0x1a')](_0x2f9cdc)){return _0x59bfd1(handleCheckRowError(_0x1bba('0x16'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x4684b5));}if(_0x2f9cdc[_0x1bba('0x1b')]&&_0x2f9cdc[_0x1bba('0x1b')]['length']){var _0x240419=_['map'](_0x2f9cdc[_0x1bba('0x1b')],_0x1bba('0x1c'))['join'](';');return _0x59bfd1(handleCheckRowError(_0x1bba('0x16'),_0x240419,null,_0x4684b5));}var _0x369983={};for(var _0x54c8fa in FIELDS){if(FIELDS['hasOwnProperty'](_0x54c8fa)&&FIELDS[_0x54c8fa]){_0x369983[_0x54c8fa]=_0x2f9cdc['data'][0x0][FIELDS[_0x54c8fa]]||_0x2f9cdc[_0x1bba('0x1d')][0x0]['\ufeff'+FIELDS[_0x54c8fa]];}}if(!_0x369983[_0x1bba('0x1e')]){return _0x59bfd1(handleCheckRowError(_0x1bba('0x16'),'firstName\x20not\x20specified!',null,_0x4684b5));}if(!_0x369983['phone']){return _0x59bfd1(handleCheckRowError(_0x1bba('0x16'),_0x1bba('0x1f'),null,_0x4684b5));}if(_0x369983[_0x1bba('0x20')]){var _0x22bc68=moment(_0x369983[_0x1bba('0x20')],_0x1bba('0x21'));if(!_0x22bc68['isValid']()){return _0x59bfd1(handleCheckRowError(_0x1bba('0x16'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4684b5));}}if(_0x369983[_0x1bba('0x22')]){if(!isEmail(_0x369983[_0x1bba('0x22')])){return _0x59bfd1(handleCheckRowError(_0x1bba('0x16'),'email\x20format\x20is\x20not\x20valid!',null,_0x4684b5));}}_0x369983[_0x1bba('0x23')]=LISTID;_0x369983['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1bba('0x24')]&&_0xa8e5dc){var _0x13e47a={};for(var _0xf615f5=0x0,_0x40c5d4=DUPLICATES[_0x1bba('0x24')];_0xf615f5<_0x40c5d4;_0xf615f5+=0x1){_0x13e47a[DUPLICATES[_0xf615f5]]=_0x369983[DUPLICATES[_0xf615f5]];}var _0x39e188=_[_0x1bba('0x25')](_0xa8e5dc,_0x13e47a);if(_0x39e188){return _0x59bfd1(handleCheckRowError(_0x1bba('0x26'),_0x1bba('0x27'),_0x39e188,_0x4684b5));}}return db[_0x1bba('0x28')]['create'](_0x369983,{'raw':!![],'hooks':![],'fields':_[_0x1bba('0x29')](_0x369983)})['then'](function(_0x1c85aa){if(DUPLICATES&&DUPLICATES[_0x1bba('0x24')]&&_0xa8e5dc){_0xa8e5dc['push'](_[_0x1bba('0x2a')](_0x369983,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1c85aa['id'];return _0x1a8da6();})[_0x1bba('0x2b')](function(_0x1f7e0b){return _0x59bfd1(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x1f7e0b['message']||JSON[_0x1bba('0x2c')](_0x1f7e0b)),null,_0x4684b5));});});}function checkHopper(){function _0x3dffa9(){return function(_0x492256){logger['error']('cmContact','checkHopper',util[_0x1bba('0x2d')](_0x492256,{'showHidden':![],'depth':null}));};}var _0x3102c0=function(_0x38ed25,_0x39a2be){var _0x5df2de=squel[_0x1bba('0x2e')]()[_0x1bba('0x2f')]('cm_hopper')[_0x1bba('0x30')]([_0x1bba('0x31'),_0x1bba('0x32'),_0x1bba('0x33'),_0x1bba('0x23'),_0x39a2be,'createdAt','updatedAt'],squel[_0x1bba('0x34')]()[_0x1bba('0x35')](_0x1bba('0x31'),'phone')[_0x1bba('0x35')](_0x1bba('0x36'),_0x1bba('0x32'))[_0x1bba('0x35')]('id','ContactId')[_0x1bba('0x35')](LISTID['toString'](),'ListId')[_0x1bba('0x35')](_0x38ed25['id']['toString'](),_0x39a2be)[_0x1bba('0x35')](_0x1bba('0x36'),'createdAt')[_0x1bba('0x35')](_0x1bba('0x36'),_0x1bba('0x37'))[_0x1bba('0x38')]('cm_contacts')['where'](_0x1bba('0x39'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0x1bba('0x3a')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x1bba('0x3b'),squel['select']()[_0x1bba('0x35')](_0x1bba('0x31'))[_0x1bba('0x38')](_0x1bba('0x3c'))[_0x1bba('0x3a')](_0x39a2be+_0x1bba('0x3d'),_0x38ed25['id'][_0x1bba('0x3e')]())))['toString']();return _0x5df2de;};var _0x1bd322=function(_0x33b4d8,_0x600e1e){var _0x4ba27d=squel[_0x1bba('0x2e')]()[_0x1bba('0x2f')](_0x1bba('0x3c'))[_0x1bba('0x30')]([_0x1bba('0x31'),'scheduledAt','ContactId',_0x1bba('0x23'),_0x600e1e,'createdAt',_0x1bba('0x37')],squel[_0x1bba('0x34')]()[_0x1bba('0x35')](_0x1bba('0x31'),'phone')[_0x1bba('0x35')](_0x1bba('0x36'),_0x1bba('0x32'))[_0x1bba('0x35')]('id',_0x1bba('0x33'))['field'](LISTID[_0x1bba('0x3e')](),_0x1bba('0x23'))['field'](_0x33b4d8['id'][_0x1bba('0x3e')](),_0x600e1e)[_0x1bba('0x35')](_0x1bba('0x36'),_0x1bba('0x3f'))['field']('NOW()',_0x1bba('0x37'))[_0x1bba('0x38')](_0x1bba('0x40'))[_0x1bba('0x3a')](_0x1bba('0x39'))[_0x1bba('0x3a')](_0x1bba('0x41'),LISTID[_0x1bba('0x3e')]())[_0x1bba('0x3a')]('id\x20IN\x20?',squel[_0x1bba('0x42')](hopperContacts))['where'](_0x1bba('0x43'))[_0x1bba('0x3a')](_0x1bba('0x3b'),squel[_0x1bba('0x34')]()[_0x1bba('0x35')](_0x1bba('0x44'))[_0x1bba('0x38')](_0x1bba('0x45'))[_0x1bba('0x3a')](_0x600e1e+_0x1bba('0x3d'),_0x33b4d8['id'][_0x1bba('0x3e')]()))[_0x1bba('0x3a')](_0x1bba('0x3b'),squel['select']()['field'](_0x1bba('0x31'))[_0x1bba('0x38')](_0x1bba('0x3c'))[_0x1bba('0x3a')](_0x600e1e+_0x1bba('0x3d'),_0x33b4d8['id'][_0x1bba('0x3e')]())))[_0x1bba('0x3e')]();return _0x4ba27d;};function _0x28d037(_0x570c99,_0x2836a0){var _0xd8f211=squel['insert']()[_0x1bba('0x2f')](_0x1bba('0x3c'))[_0x1bba('0x30')]([_0x1bba('0x31'),'scheduledAt',_0x1bba('0x33'),_0x1bba('0x23'),_0x2836a0,_0x1bba('0x3f'),_0x1bba('0x37')],squel[_0x1bba('0x34')]()[_0x1bba('0x35')](_0x1bba('0x31'),_0x1bba('0x31'))[_0x1bba('0x35')](_0x1bba('0x36'),_0x1bba('0x32'))[_0x1bba('0x35')]('id',_0x1bba('0x33'))['field'](LISTID['toString'](),'ListId')[_0x1bba('0x35')](_0x570c99['id'][_0x1bba('0x3e')](),_0x2836a0)[_0x1bba('0x35')](_0x1bba('0x36'),_0x1bba('0x3f'))[_0x1bba('0x35')](_0x1bba('0x36'),_0x1bba('0x37'))['from'](_0x1bba('0x40'))[_0x1bba('0x3a')]('deletedAt\x20IS\x20NULL')[_0x1bba('0x3a')](_0x1bba('0x41'),LISTID[_0x1bba('0x3e')]())[_0x1bba('0x3a')](_0x1bba('0x46'),squel['str'](hopperContacts))[_0x1bba('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x1bba('0x3e')]();return _0xd8f211;}function _0x210f56(_0x1d9f18,_0x2d02e3){var _0x471e4f=squel[_0x1bba('0x2e')]()['into'](_0x1bba('0x47'))[_0x1bba('0x30')]([_0x1bba('0x31'),_0x1bba('0x33'),_0x1bba('0x23'),_0x2d02e3,_0x1bba('0x3f'),_0x1bba('0x37')],squel[_0x1bba('0x34')]()[_0x1bba('0x35')](_0x1bba('0x31'),_0x1bba('0x31'))['field']('id',_0x1bba('0x33'))[_0x1bba('0x35')](LISTID[_0x1bba('0x3e')](),'ListId')['field'](_0x1d9f18['id'][_0x1bba('0x3e')](),_0x2d02e3)[_0x1bba('0x35')](_0x1bba('0x36'),_0x1bba('0x3f'))[_0x1bba('0x35')](_0x1bba('0x36'),_0x1bba('0x37'))['from'](_0x1bba('0x40'))['where'](_0x1bba('0x39'))[_0x1bba('0x3a')](_0x1bba('0x41'),LISTID[_0x1bba('0x3e')]())[_0x1bba('0x3a')](_0x1bba('0x46'),squel[_0x1bba('0x42')](hopperContacts))['where'](_0x1bba('0x43')))[_0x1bba('0x3e')]();return _0x471e4f;}return db[_0x1bba('0x48')][_0x1bba('0x49')]({'where':{'type':_0x1bba('0x4a')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x1bba('0x4b')],'as':_0x1bba('0x4c'),'where':{'id':LISTID}}]})['then'](function(_0x19f156){var _0x133511=[];if(_0x19f156){var _0x42628a;for(var _0x59caaf=0x0,_0xb271eb;_0x59caaf<_0x19f156[_0x1bba('0x24')];_0x59caaf+=0x1){_0xb271eb=_0x19f156[_0x59caaf]['get']({'plain':!![]});switch(_0xb271eb['dialCheckDuplicateType']){case'always':_0x133511['push'](db['sequelize'][_0x1bba('0x4d')](_0x1bd322(_0xb271eb,'VoiceQueueId'))[_0x1bba('0x4e')](function(){})['catch'](_0x3dffa9()));break;case _0x1bba('0x4f'):_0x133511[_0x1bba('0x50')](db[_0x1bba('0x51')][_0x1bba('0x4d')](_0x3102c0(_0xb271eb,'VoiceQueueId'))[_0x1bba('0x4e')](function(){})[_0x1bba('0x2b')](_0x3dffa9()));break;default:_0x133511[_0x1bba('0x50')](db['sequelize']['query'](_0x28d037(_0xb271eb,'VoiceQueueId'))['then'](function(){})[_0x1bba('0x2b')](_0x3dffa9()));}}}return _0x133511;})['all']()[_0x1bba('0x4e')](function(){return db[_0x1bba('0x48')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x1bba('0x4b')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x1bba('0x4e')](function(_0x24b6b7){var _0x26da52=[];if(_0x24b6b7){var _0x1d9baf;for(var _0x5b088f=0x0,_0x1b0f1c;_0x5b088f<_0x24b6b7['length'];_0x5b088f+=0x1){_0x1b0f1c=_0x24b6b7[_0x5b088f][_0x1bba('0x52')]({'plain':!![]});_0x26da52[_0x1bba('0x50')](db[_0x1bba('0x51')][_0x1bba('0x4d')](_0x210f56(_0x1b0f1c,_0x1bba('0x53')))[_0x1bba('0x4e')](function(){})[_0x1bba('0x2b')](_0x3dffa9()));}}return _0x26da52;})[_0x1bba('0x54')]();})['then'](function(){return db[_0x1bba('0x55')][_0x1bba('0x49')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x1bba('0x4b')],'as':'Lists','where':{'id':LISTID}}]})[_0x1bba('0x4e')](function(_0x143f18){var _0x40537c=[];if(_0x143f18){for(var _0x41661f=0x0,_0x5d24fc;_0x41661f<_0x143f18[_0x1bba('0x24')];_0x41661f+=0x1){_0x5d24fc=_0x143f18[_0x41661f][_0x1bba('0x52')]({'plain':!![]});switch(_0x5d24fc[_0x1bba('0x56')]){case _0x1bba('0x57'):_0x40537c[_0x1bba('0x50')](db[_0x1bba('0x51')]['query'](_0x1bd322(_0x5d24fc,_0x1bba('0x58')))[_0x1bba('0x4e')](function(){})['catch'](_0x3dffa9()));break;case _0x1bba('0x4f'):_0x40537c['push'](db[_0x1bba('0x51')][_0x1bba('0x4d')](_0x3102c0(_0x5d24fc,'CampaignId'))['then'](function(){})[_0x1bba('0x2b')](_0x3dffa9()));break;default:_0x40537c[_0x1bba('0x50')](db[_0x1bba('0x51')][_0x1bba('0x4d')](_0x28d037(_0x5d24fc,_0x1bba('0x58')))[_0x1bba('0x4e')](function(){})[_0x1bba('0x2b')](_0x3dffa9()));}}}return _0x40537c;})['all']();})['then'](function(){return db[_0x1bba('0x55')][_0x1bba('0x49')]({'attributes':['id'],'include':[{'model':db[_0x1bba('0x4b')],'as':_0x1bba('0x59'),'where':{'id':LISTID}}]})[_0x1bba('0x4e')](function(_0x528bdb){var _0x2aea5b=[];if(_0x528bdb){for(var _0x58f5d3=0x0,_0x3139d;_0x58f5d3<_0x528bdb[_0x1bba('0x24')];_0x58f5d3+=0x1){_0x3139d=_0x528bdb[_0x58f5d3][_0x1bba('0x52')]({'plain':!![]});_0x2aea5b[_0x1bba('0x50')](db[_0x1bba('0x51')][_0x1bba('0x4d')](_0x210f56(_0x3139d,_0x1bba('0x58')))[_0x1bba('0x4e')](function(){})[_0x1bba('0x2b')](_0x3dffa9()));}}return _0x2aea5b;})[_0x1bba('0x54')]();})[_0x1bba('0x2b')](function(_0x32c6ee){logger[_0x1bba('0x16')]('cmContact,\x20%s,\x20%s',_0x1bba('0x5a'),_0x32c6ee['message']);});}var processPromises=function(_0x51d60a){return BPromise[_0x1bba('0x54')](promises)[_0x1bba('0x4e')](function(_0x3ebd77){})['catch'](function(_0x20a300){logger[_0x1bba('0x16')](_0x1bba('0x5b'),JSON[_0x1bba('0x2c')](_0x20a300));})[_0x1bba('0x5c')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x51d60a){return _0x51d60a['resume']();}});};var endCsv=function(){return BPromise[_0x1bba('0x5d')]()[_0x1bba('0x4e')](function(){if(hopperContacts){return checkHopper();}})[_0x1bba('0x4e')](function(){socket[_0x1bba('0x5e')](_0x1bba('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1bba('0x60')](FILEPATH);}catch(_0x3827d2){logger['error'](_0x1bba('0x61'),JSON['stringify'](_0x3827d2));}finally{process['exit'](0x0);}});};process['on'](_0x1bba('0x62'),function(){logger[_0x1bba('0x63')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x1bba('0x5d')]()[_0x1bba('0x4e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1bba('0x13')](',');return db[_0x1bba('0x28')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1bba('0x4e')](function(_0x32d1de){var _0x39e047=fs[_0x1bba('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x1bba('0x65')](_0x39e047,{'header':!![],'skipEmptyLines':!![],'step':function(_0x542da8,_0x1e9cdb){total+=0x1;var _0x5bcc3e=total;promises[_0x1bba('0x50')](checkRow(_0x542da8,_0x32d1de,_0x5bcc3e)[_0x1bba('0x4e')](function(){success+=0x1;})['catch'](function(_0x23f2bc){if(_0x23f2bc[_0x1bba('0x16')]){errors+=0x1;delete _0x23f2bc[_0x1bba('0x16')];}else if(_0x23f2bc['duplicate']){duplicates+=0x1;delete _0x23f2bc[_0x1bba('0x26')];}rows[_0x1bba('0x50')](_0x23f2bc);}));if(total%0xc8===0x0){_0x1e9cdb[_0x1bba('0x66')]();return processPromises(_0x1e9cdb);}},'complete':function(){return processPromises()[_0x1bba('0x4e')](function(){logger[_0x1bba('0x63')](_0x1bba('0x67'));endCsv();});},'error':function(_0xae388e,_0x2cfb82){logger['info']('CSV\x20parse\x20error',JSON[_0x1bba('0x2c')](_0xae388e));endCsv();}});})[_0x1bba('0x2b')](function(_0x22c307){logger[_0x1bba('0x16')](_0x1bba('0x68'),JSON[_0x1bba('0x2c')](_0x22c307));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 123a74d..8a04746 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 _0xc015=['trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','timezones','\x20not\x20specified','hasOwnProperty','itemTypeId','description','SystemRow','rows','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','each','contactId','orderBy','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','campaigns_has_cm_lists','finish','affectedRows','emit','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','path','lodash','papaparse','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','field','phone','from','.id\x20=\x20','where','\x20=\x20','join','CmContact','findAll','AdditionalPhones','then','length','push','all','split','isNil','CmContactHasItem','update','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','into','cm_hopper_black','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','select','\x22onlyIfOpen\x22','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','error','exit','errors','code','message','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','dialTimezone','set','offset','stringify','send','start','binding','clone','root','server/files/tmp','.csv','keys','name','_description','header','parse','createReadStream','data','find'];(function(_0x44c38e,_0x467161){var _0x16b05b=function(_0x5717f0){while(--_0x5717f0){_0x44c38e['push'](_0x44c38e['shift']());}};_0x16b05b(++_0x467161);}(_0xc015,0xe6));var _0x5c01=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0xc015[_0xe6e78c];return _0x2a09c8;};'use strict';var fs=require('fs');var path=require(_0x5c01('0x0'));var _=require(_0x5c01('0x1'));var Papa=require(_0x5c01('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x5c01('0x3'));var squel=require(_0x5c01('0x4'));var Redis=require(_0x5c01('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x5c01('0x6'));var shared=require(_0x5c01('0x7'));var logger=require(_0x5c01('0x8'))(_0x5c01('0x9'));config[_0x5c01('0xa')]=_[_0x5c01('0xb')](config[_0x5c01('0xa')],{'host':_0x5c01('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c01('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x5c01('0xd')](_0x5c01('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x5c01('0xd')](_0x5c01('0xe'));function isEmail(_0x3daf3e){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3daf3e);}function selectNotIn(_0x2f02ee,_0xd1886d,_0x46b077,_0xe8d921,_0x4efedb){return squel['select']()[_0x5c01('0xf')](_0x5c01('0x10'))[_0x5c01('0x11')](_0xe8d921)['join'](_0xd1886d,null,_0xd1886d+_0x5c01('0x12')+_0xe8d921+'.'+_0x46b077)[_0x5c01('0x13')](_0xe8d921+'.'+_0x46b077+_0x5c01('0x14')+_0x2f02ee+'.'+_0x46b077)[_0x5c01('0x13')](_0xd1886d+'.dialCheckDuplicateType\x20IN\x20('+_0x4efedb[_0x5c01('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1b534a,_0xb0711c){promisesAdditionalPhones=[];return db[_0x5c01('0x16')][_0x5c01('0x17')]({'raw':!![],'attributes':['id',_0x5c01('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x5c01('0x19')](function(_0xc8b6b2){if(_0xc8b6b2!==null){var _0x77914=[];for(var _0xeac742=0x0;_0xeac742<_0xc8b6b2[_0x5c01('0x1a')];_0xeac742++){var _0x3e1a11=_0xc8b6b2[_0xeac742];_0x77914[_0x5c01('0x1b')](insertAdditionalPhones(_0x3e1a11));}}Promise[_0x5c01('0x1c')](_0x77914)[_0x5c01('0x19')](function(){_0x1b534a({'val':0x1});});});});}function insertAdditionalPhones(_0x293905){return new Promise(function(_0x21157a,_0x51926e){var _0x29369f=_0x293905[_0x5c01('0x18')];var _0x41c04d=_0x29369f[_0x5c01('0x1d')](';');var _0x2cb379=[];orderBy=0x0;for(var _0x442fa7=0x0;_0x442fa7<_0x41c04d[_0x5c01('0x1a')];_0x442fa7++){_0x2cb379[_0x5c01('0x1b')](splitAdditionalPhone(_0x293905['id'],_0x41c04d[_0x442fa7]));}Promise[_0x5c01('0x1c')](_0x2cb379)[_0x5c01('0x19')](function(){_0x21157a({'val':_0x41c04d[_0x5c01('0x1a')]});});});}function splitAdditionalPhone(_0x94ba1d,_0x526a50){return new Promise(function(_0x2408b6,_0x4c1ee4){var _0x38ebb6=_0x526a50[_0x5c01('0x1d')](':');var _0xebc5eb=_0x38ebb6[0x0];var _0x4607fe=_0x38ebb6[0x1];if(!_[_0x5c01('0x1e')](_0x4607fe)){var _0x43da18=_0x4607fe['split']('|');var _0x9c9457=[];for(var _0x2ea39c=0x0;_0x2ea39c<_0x43da18[_0x5c01('0x1a')];_0x2ea39c++){if(_0x43da18[_0x2ea39c]!==''){var _0x24e56e=_['filter'](promisesAdditionalPhones,{'contactId':_0x94ba1d,'phone':_0x43da18[_0x2ea39c]});if(_0x24e56e[_0x5c01('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x5c01('0x1b')]({'contactId':_0x94ba1d,'contactTypeId':_0xebc5eb,'phone':_0x43da18[_0x2ea39c],'orderBy':orderBy});}}}_0x2408b6({'ok':0x1});}else _0x2408b6({'res':0x0});});}function createAdditionalPhone(_0x5d852c,_0xbe890b,_0x4ac693,_0x3ee457){var _0x5e0228='';var _0x54a5c0='';var _0x291b83=_0x4ac693[_0x5c01('0x1d')]('§');_0x5e0228=_0x291b83[0x0];if(_0x291b83[_0x5c01('0x1a')]==0x2)_0x54a5c0=_0x291b83[0x1];return new Promise(function(_0x1984d7,_0x51343b){return db[_0x5c01('0x1f')]['findOne']({'where':{'CmContactId':_0x5d852c,'item':_0x5e0228}})[_0x5c01('0x19')](function(_0x206c8f){if(_0x206c8f){return db[_0x5c01('0x1f')][_0x5c01('0x20')]({'ItemTypeId':_0xbe890b,'description':_0x54a5c0,'OrderBy':_0x3ee457},{'where':{'CmContactId':_0x5d852c,'item':_0x5e0228}})[_0x5c01('0x19')](function(_0x504bae){_0x1984d7({'res':'updated'});});}else{return db[_0x5c01('0x1f')]['create']({'CmContactId':_0x5d852c,'item':_0x5e0228,'description':_0x54a5c0,'ItemTypeId':_0xbe890b,'OrderBy':_0x3ee457,'ItemClass':_0x5c01('0x21')})[_0x5c01('0x19')](function(_0x54868c){_0x1984d7({'res':'inserted'});});}});});}function insertCmHopper(_0x246d81,_0x18619c,_0x435fea,_0x527dec,_0x5b2a1b){var _0x482aeb=[_0x5c01('0x22'),_0x5c01('0x23'),_0x5c01('0x24'),_0x5c01('0x25'),_0x18619c+'.'+_0x527dec,_0x5c01('0x26'),_0x5c01('0x27'),'cm_contacts.priority',_0x5c01('0x28'),'\x22'+_0x5b2a1b+'\x22'];return squel[_0x5c01('0x29')]()['into']('cm_hopper')[_0x5c01('0x2a')](['phone',_0x5c01('0x2b'),_0x5c01('0x2c'),_0x5c01('0x2d'),_0x527dec,_0x5c01('0x2e'),_0x5c01('0x2f'),_0x5c01('0x30'),_0x5c01('0x31'),_0x5c01('0x32')],squel['select']()[_0x5c01('0x33')](_0x482aeb)[_0x5c01('0x11')](_0x18619c)['join'](_0x5c01('0x34'),null,_0x5c01('0x35')+_0x18619c+_0x5c01('0x36'))[_0x5c01('0x15')](_0x435fea,null,_0x435fea+_0x5c01('0x12')+_0x18619c+'.'+_0x527dec)[_0x5c01('0x13')](_0x18619c+_0x5c01('0x37'),_0x246d81)[_0x5c01('0x13')](_0x5c01('0x38'),NOW)[_0x5c01('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x18619c,_0x435fea,_0x527dec,_0x5c01('0x39'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x5c01('0x13')](_0x5c01('0x3a'),selectNotIn(_0x18619c,_0x435fea,_0x527dec,_0x5c01('0x39'),['\x22always\x22'])))[_0x5c01('0x3b')]();}function insertCmHopperBlack(_0x5ada36,_0x557b1e,_0x3a3d18,_0x3e5249){var _0x4a9fa7=[_0x5c01('0x22'),_0x5c01('0x24'),_0x5c01('0x25'),_0x557b1e+'.'+_0x3e5249,_0x5c01('0x26'),_0x5c01('0x27')];return squel[_0x5c01('0x29')]()[_0x5c01('0x3c')](_0x5c01('0x3d'))[_0x5c01('0x2a')]([_0x5c01('0x10'),_0x5c01('0x2c'),_0x5c01('0x2d'),_0x3e5249,_0x5c01('0x2e'),_0x5c01('0x2f')],squel['select']()[_0x5c01('0x33')](_0x4a9fa7)[_0x5c01('0x11')](_0x557b1e)[_0x5c01('0x15')](_0x5c01('0x34'),null,_0x5c01('0x35')+_0x557b1e+_0x5c01('0x36'))[_0x5c01('0x15')](_0x3a3d18,null,_0x3a3d18+_0x5c01('0x12')+_0x557b1e+'.'+_0x3e5249)[_0x5c01('0x13')](_0x557b1e+_0x5c01('0x37'),_0x5ada36)[_0x5c01('0x13')](_0x5c01('0x38'),NOW)[_0x5c01('0x13')](_0x5c01('0x3a'),squel['select']()['field']('phone')[_0x5c01('0x11')](_0x5c01('0x3d'))[_0x5c01('0x13')](_0x5c01('0x3e'),_0x5ada36)[_0x5c01('0x13')](_0x3e5249+_0x5c01('0x14')+_0x557b1e+'.'+_0x3e5249)))[_0x5c01('0x3b')]();}function insertTzCmHopper(_0x2797db,_0x11ef88,_0x2e60b7,_0x5bf857,_0x14048b,_0x3ae9d1){var _0x2a9152=[_0x5c01('0x22'),_0x5c01('0x3f')+_0x3ae9d1+_0x5c01('0x40'),_0x5c01('0x24'),_0x5c01('0x25'),_0x11ef88+'.'+_0x5bf857,'cm_contacts.createdAt',_0x5c01('0x27'),_0x5c01('0x41'),_0x5c01('0x28'),'\x22'+_0x14048b+'\x22'];var _0x303f6d=squel['insert']()[_0x5c01('0x3c')](_0x5c01('0x39'))[_0x5c01('0x2a')]([_0x5c01('0x10'),_0x5c01('0x2b'),_0x5c01('0x2c'),_0x5c01('0x2d'),_0x5bf857,_0x5c01('0x2e'),_0x5c01('0x2f'),_0x5c01('0x30'),_0x5c01('0x31'),'recallme'],squel[_0x5c01('0x42')]()[_0x5c01('0x33')](_0x2a9152)['from'](_0x11ef88)[_0x5c01('0x15')]('cm_contacts',null,_0x5c01('0x35')+_0x11ef88+_0x5c01('0x36'))['join'](_0x2e60b7,null,_0x2e60b7+_0x5c01('0x12')+_0x11ef88+'.'+_0x5bf857)[_0x5c01('0x15')](_0x3ae9d1,null,_0x3ae9d1+_0x5c01('0x12')+_0x11ef88+'.'+_0x5bf857)[_0x5c01('0x13')](_0x11ef88+_0x5c01('0x37'),_0x2797db)[_0x5c01('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5c01('0x13')](_0x5c01('0x3a'),selectNotIn(_0x11ef88,_0x2e60b7,_0x5bf857,'cm_hopper',['\x22always\x22',_0x5c01('0x43')]))[_0x5c01('0x13')](_0x5c01('0x3a'),selectNotIn(_0x11ef88,_0x2e60b7,_0x5bf857,'cm_hopper',['\x22always\x22'])))['toString']();return _0x303f6d;}function insertTzCmHopperBlack(_0x5ad106,_0x45bfd1,_0x4418fb,_0x16c05c){var _0x2fd20a=[_0x5c01('0x22'),_0x5c01('0x24'),_0x5c01('0x25'),_0x45bfd1+'.'+_0x16c05c,_0x5c01('0x26'),_0x5c01('0x27')];return squel[_0x5c01('0x29')]()[_0x5c01('0x3c')](_0x5c01('0x3d'))[_0x5c01('0x2a')]([_0x5c01('0x10'),_0x5c01('0x2c'),_0x5c01('0x2d'),_0x16c05c,_0x5c01('0x2e'),_0x5c01('0x2f')],squel['select']()[_0x5c01('0x33')](_0x2fd20a)['from'](_0x45bfd1)[_0x5c01('0x15')](_0x5c01('0x34'),null,_0x5c01('0x35')+_0x45bfd1+'.CmListId')[_0x5c01('0x15')](_0x4418fb,null,_0x4418fb+_0x5c01('0x12')+_0x45bfd1+'.'+_0x16c05c)['where'](_0x45bfd1+_0x5c01('0x37'),_0x5ad106)[_0x5c01('0x13')](_0x5c01('0x38'),NOW)[_0x5c01('0x13')](_0x5c01('0x3a'),squel[_0x5c01('0x42')]()[_0x5c01('0xf')](_0x5c01('0x10'))[_0x5c01('0x11')](_0x5c01('0x3d'))[_0x5c01('0x13')]('ListId\x20=\x20?',_0x5ad106)[_0x5c01('0x13')](_0x16c05c+_0x5c01('0x14')+_0x45bfd1+'.'+_0x16c05c)))[_0x5c01('0x3b')]();}function insertCmHopperAdditionalPhones(_0x543d5f){var _0x4bc8d4=[_0x5c01('0x44'),_0x5c01('0x45'),_0x5c01('0x46'),_0x5c01('0x47'),_0x5c01('0x48')];return squel[_0x5c01('0x29')]()['into'](_0x5c01('0x49'))['fromQuery'](['CmHopperId',_0x5c01('0x10'),'OrderBy',_0x5c01('0x2e'),'updatedAt'],squel[_0x5c01('0x42')]()['fields'](_0x4bc8d4)[_0x5c01('0x11')](_0x5c01('0x39'))[_0x5c01('0x15')]('cm_contacts',null,_0x5c01('0x4a'))['join']('cm_contact_has_items',null,_0x5c01('0x4b'))['where'](_0x5c01('0x4c'),_0x543d5f)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x5c01('0x3b')]();}function insertCmContact(_0x26775f,_0x2dc027,_0x40c87d,_0x415651){var _0x34ecc5=_['concat'](_['keys'](_0x415651),[_0x5c01('0x2d'),'CompanyId','createdAt',_0x5c01('0x2f'),'scheduledAt']);return squel['insert']()[_0x5c01('0x3c')]('cm_contacts')[_0x5c01('0x2a')](_0x34ecc5,squel['select']()['fields'](_0x34ecc5)['from'](_0x2dc027)[_0x5c01('0x13')]('('+_0x40c87d[_0x5c01('0x15')](',')+_0x5c01('0x4d'),squel[_0x5c01('0x42')]()[_0x5c01('0x33')](_0x40c87d)['from'](_0x5c01('0x34'))[_0x5c01('0x13')](_0x5c01('0x3e'),_0x26775f)[_0x5c01('0x13')]('deletedAt\x20IS\x20NULL'))[_0x5c01('0x13')](_0x5c01('0x4e'),squel[_0x5c01('0x42')]()['field'](_0x5c01('0x4f'),_0x5c01('0x50'))[_0x5c01('0x11')](_0x2dc027)[_0x5c01('0x51')](_0x40c87d['join'](','))))['toString']();}function handleStop(){logger[_0x5c01('0x52')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x22851e){logger[_0x5c01('0x53')](_0x22851e['message']);process[_0x5c01('0x54')](0x1);}function handleError(_0x53b992,_0x368d09){stats[_0x5c01('0x55')][_0x5c01('0x1b')]({'name':_0x368d09[_0x5c01('0x56')],'message':_0x368d09[_0x5c01('0x57')],'row':_0x53b992});}function handleQuery(_0x58fc17){logger[_0x5c01('0x52')](_0x58fc17);return db[_0x5c01('0x58')][_0x5c01('0x59')](_0x58fc17)[_0x5c01('0x5a')](function(_0x34cb66){results[_0x5c01('0x1b')](_0x34cb66);})[_0x5c01('0x5b')](function(_0x467221){logger['error'](_0x467221[_0x5c01('0x57')]);});}function updateTzCampaigns(_0x27f1f9){return new Promise(function(_0x372b9d,_0x20bd64){var _0x30f821=squel[_0x5c01('0x42')]()[_0x5c01('0x33')]([_0x5c01('0x5c'),_0x5c01('0x5d')])[_0x5c01('0x11')](_0x5c01('0x5e'))[_0x5c01('0x15')]('campaigns_has_cm_lists',null,_0x5c01('0x5f'))['where'](_0x5c01('0x60')+_0x27f1f9);db[_0x5c01('0x58')][_0x5c01('0x59')](_0x30f821[_0x5c01('0x3b')]())['spread'](function(_0x480f11){var _0x25482d=[];for(var _0x163e24=0x0;_0x163e24<_0x480f11[_0x5c01('0x1a')];_0x163e24++){_0x25482d[_0x5c01('0x1b')](getTimezoneData(_0x480f11[_0x163e24],tmp_campaigns));}BPromise[_0x5c01('0x1c')](_0x25482d)['then'](function(){_0x372b9d({'val':0x1});});})[_0x5c01('0x5b')](function(_0x546b09){logger[_0x5c01('0x53')](_0x546b09['message']);_0x372b9d({'val':0x0});});});}function updateTzVoiceQueues(_0x4e6ca7){return new Promise(function(_0x5b9748,_0x16b31f){var _0x390f24=squel['select']()[_0x5c01('0x33')]([_0x5c01('0x61'),_0x5c01('0x62')])[_0x5c01('0x11')](_0x5c01('0x63'))[_0x5c01('0x15')](_0x5c01('0x64'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x5c01('0x13')]('voice_queues_has_cm_lists.CmListId='+_0x4e6ca7);db[_0x5c01('0x58')][_0x5c01('0x59')](_0x390f24[_0x5c01('0x3b')]())[_0x5c01('0x5a')](function(_0x584773){var _0x24a683=[];for(var _0x6ad4df=0x0;_0x6ad4df<_0x584773['length'];_0x6ad4df++){_0x24a683[_0x5c01('0x1b')](getTimezoneData(_0x584773[_0x6ad4df],tmp_voice_queues));}BPromise[_0x5c01('0x1c')](_0x24a683)[_0x5c01('0x19')](function(){_0x5b9748({'val':0x1});});})[_0x5c01('0x5b')](function(_0x2afe22){logger[_0x5c01('0x53')](_0x2afe22[_0x5c01('0x57')]);_0x5b9748({'val':0x0});});});}function getTimezoneData(_0x5d8b30,_0x5997af){return new Promise(function(_0x13f8f1,_0xce9cf8){var _0x25a5ac=shared['timezones'];var _0x283534=_0x25a5ac[_0x5d8b30[_0x5c01('0x65')]];if(_[_0x5c01('0x1e')](_0x283534)){_0x13f8f1({'ret':0x1});}else{var _0x137d4c=_0x283534['utcOffset'];var _0x5445ce=squel[_0x5c01('0x29')]()[_0x5c01('0x3c')](_0x5997af)[_0x5c01('0x66')]('id',_0x5d8b30['id'])['set'](_0x5c01('0x67'),_0x137d4c)['set'](_0x5c01('0x65'),_0x5d8b30[_0x5c01('0x65')])[_0x5c01('0x3b')]();return db[_0x5c01('0x58')][_0x5c01('0x59')](_0x5445ce)['spread'](function(_0x57530e){_0x13f8f1({'ret':0x1});})['catch'](function(_0x2bc2cc){logger[_0x5c01('0x53')](_0x2bc2cc[_0x5c01('0x57')]);_0xce9cf8({'ret':0x1});});}});}function handleTZQuery(_0x139a72){logger[_0x5c01('0x52')](_0x139a72);return db['sequelize'][_0x5c01('0x59')](_0x139a72)[_0x5c01('0x5a')](function(_0x4069c3){})[_0x5c01('0x5b')](function(_0x4b76f4){logger[_0x5c01('0x53')](_0x4b76f4[_0x5c01('0x57')]);});}function main(_0x26e881,_0x1edc46,_0x3fa8ed,_0x1932f6){logger[_0x5c01('0x52')]('main',_0x26e881,JSON[_0x5c01('0x68')](_0x1edc46));process[_0x5c01('0x69')](_0x5c01('0x6a'));var _0x5edcd8=_0x1edc46[_0x5c01('0x6b')];var _0x47cc7e=_[_0x5c01('0x6c')](_0x5edcd8);var _0x511b0f=_0x1edc46['socket_timestamp'];var _0x15e2a5=path[_0x5c01('0x15')](config[_0x5c01('0x6d')],_0x5c01('0x6e'),_0x511b0f+_0x5c01('0x6f'));hasTZ=_[_0x5c01('0x70')](_0x5edcd8)['includes']('dialTimezone');var _0x20583b=_['keys'](_0x5edcd8)[_0x5c01('0x15')]();logger[_0x5c01('0x52')]('header',_0x20583b);db['ContactItemType'][_0x5c01('0x17')]({'raw':!![],'attributes':['id',_0x5c01('0x71')]})[_0x5c01('0x19')](function(_0x399c8b){for(var _0x233d32=0x0;_0x233d32<_0x399c8b[_0x5c01('0x1a')];_0x233d32++){if(_0x399c8b[_0x233d32][_0x5c01('0x71')]in _0x5edcd8){contactItemTypes[_0x5c01('0x1b')](_0x399c8b[_0x233d32]);delete _0x47cc7e[_0x399c8b[_0x233d32][_0x5c01('0x71')]];hasAdditionalPhones=!![];}for(var _0xb301d3 in _0x5edcd8){if(_0x399c8b[_0x233d32][_0x5c01('0x71')]+_0x5c01('0x72')===_0xb301d3){phoneDescriptions[_0x5c01('0x1b')]({'itemTypeId':_0x399c8b[_0x233d32]['id'],'description':_0xb301d3});delete _0x47cc7e[_0xb301d3];}}}if(hasAdditionalPhones)_0x47cc7e[_0x5c01('0x18')]='';var _0x5900de=_[_0x5c01('0x70')](_0x47cc7e)[_0x5c01('0x15')]();logger[_0x5c01('0x52')](_0x5c01('0x73'),_0x5900de);fs['writeFileSync'](_0x15e2a5,_0x5900de+'\x0a');Papa[_0x5c01('0x74')](fs[_0x5c01('0x75')](_0x26e881),{'header':!![],'skipEmptyLines':!![],'step':function(_0x182fe9,_0x2ca6b6){try{for(var _0x1f4613=0x0,_0x47207e=[];_0x1f4613<_0x182fe9[_0x5c01('0x76')][_0x5c01('0x1a')];_0x1f4613++){stats['rows']+=0x1;if(_0x182fe9['errors'][_0x1f4613]){handleError(_0x182fe9[_0x5c01('0x76')][_0x1f4613],_0x182fe9[_0x5c01('0x55')][_0x1f4613]);}else{var _0x1e690c=[];var _0x5c2b8e=[];var _0x429545={};for(var _0x36b510 in _0x5edcd8){let _0x31ae83=contactItemTypes[_0x5c01('0x77')](_0x1cf171=>_0x1cf171[_0x5c01('0x71')]===_0x36b510);let _0x19fc60=contactItemTypes[_0x5c01('0x77')](_0x5e72d5=>_0x5e72d5['name']+'_description'===_0x36b510);if(_[_0x5c01('0x1e')](_0x31ae83)&&_[_0x5c01('0x1e')](_0x19fc60)){if(_0x5edcd8['hasOwnProperty'](_0x36b510)){if(_0x182fe9[_0x5c01('0x76')][_0x1f4613][_0x5edcd8[_0x36b510]]){var _0x58ee2c=_[_0x5c01('0x78')](_0x182fe9[_0x5c01('0x76')][_0x1f4613][_0x5edcd8[_0x36b510]][_0x5c01('0x79')](/"/g,'\x27'));switch(_0x36b510){case _0x5c01('0x2b'):var _0x34d87e=moment(_0x58ee2c,_0x5c01('0xe'),!![]);if(_0x34d87e[_0x5c01('0x7a')]()){_0x47207e[_0x5c01('0x1b')]('\x22'+_0x58ee2c+'\x22');}else{_0x1e690c['push'](_0x5c01('0x7b'));}break;case'priority':var _0x376fe0=parseInt(_0x58ee2c);_0x58ee2c=_[_0x5c01('0x7c')](_0x376fe0)||_0x376fe0<0x0||_0x376fe0>0x4?_0x1932f6?0x3:0x2:_0x376fe0;_0x47207e[_0x5c01('0x1b')]('\x22'+_0x58ee2c+'\x22');break;case _0x5c01('0x31'):var _0xa782ad=parseInt(_0x58ee2c);if(_[_0x5c01('0x7d')](_0xa782ad)&&_[_0x5c01('0x7e')](_0x3fa8ed,_0xa782ad)){_0x47207e['push']('\x22'+_0xa782ad+'\x22');}else{_0x1e690c[_0x5c01('0x1b')](_0x5c01('0x7f'));}break;case'email':if(isEmail(_0x58ee2c)){_0x47207e[_0x5c01('0x1b')]('\x22'+_0x58ee2c+'\x22');}else{_0x1e690c[_0x5c01('0x1b')](_0x5c01('0x80'));}break;case'dateOfBirth':var _0x6f5ac2=moment(_0x58ee2c,_0x5c01('0x81'),!![]);if(_0x6f5ac2[_0x5c01('0x7a')]()){_0x47207e[_0x5c01('0x1b')]('\x22'+_0x58ee2c+'\x22');}else{_0x1e690c[_0x5c01('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x5c01('0x65'):var _0x2165d0=shared[_0x5c01('0x82')];var _0x1d470b=_0x2165d0[_0x58ee2c];if(!_[_0x5c01('0x1e')](_0x1d470b)){var _0xb9f1b9=_0x1d470b['utcOffset'];_0x47207e['push']('\x22'+_0x58ee2c+'\x22');_0x47207e[_0x5c01('0x1b')]('\x22'+_0xb9f1b9+'\x22');}break;default:_0x47207e[_0x5c01('0x1b')]('\x22'+_0x58ee2c+'\x22');}}else{switch(_0x36b510){case'firstName':case'phone':_0x1e690c[_0x5c01('0x1b')](_0x36b510+_0x5c01('0x83'));break;default:_0x47207e['push']('\x22\x22');}}}}else{var _0x46351f='';if(!_[_0x5c01('0x1e')](_0x31ae83)){if(!_0x429545[_0x5c01('0x84')](_0x31ae83['id'])){if(!_[_0x5c01('0x1e')](_0x182fe9[_0x5c01('0x76')][_0x1f4613][_0x5edcd8[_0x36b510]])){var _0x58ee2c=_[_0x5c01('0x78')](_0x182fe9[_0x5c01('0x76')][_0x1f4613][_0x5edcd8[_0x36b510]][_0x5c01('0x79')](/"/g,'\x27'));var _0x4120d5=phoneDescriptions[_0x5c01('0x77')](_0x3c5b60=>_0x3c5b60[_0x5c01('0x85')]===_0x31ae83['id']);if(!_[_0x5c01('0x1e')](_0x4120d5)){var _0x1e323e=_['trim'](_0x182fe9['data'][_0x1f4613][_0x5edcd8[_0x4120d5[_0x5c01('0x86')]]][_0x5c01('0x79')](/"/g,'\x27'));if(!_[_0x5c01('0x1e')](_0x1e323e))_0x58ee2c=_0x58ee2c+'§'+_0x1e323e;}if(_0x46351f=='')_0x46351f=_0x58ee2c;else _0x46351f+='|'+_0x58ee2c;}_0x5c2b8e['push'](_0x31ae83['id']+':'+_0x46351f);_0x429545[_0x31ae83['id']]=0x1;}}}}if(hasAdditionalPhones){_0x47207e['push']('\x22'+_0x5c2b8e[_0x5c01('0x15')](';')+'\x22');}if(_0x1e690c[_0x5c01('0x1a')]){handleError(_0x182fe9['data'][_0x1f4613],{'code':_0x5c01('0x87'),'message':_0x1e690c['join']()});}else{fs['appendFileSync'](_0x15e2a5,_0x47207e[_0x5c01('0x15')]()+'\x0a');}_0x47207e=[];}if(!(stats[_0x5c01('0x88')]%0xc8)){socket['emit'](_0x5c01('0x89')+_0x511b0f,stats);stats[_0x5c01('0x55')]=[];}}if(stopped){logger[_0x5c01('0x52')]('Abort\x20parser');_0x2ca6b6[_0x5c01('0x8a')]();}}catch(_0x576a42){handleError(_0x182fe9[_0x5c01('0x76')][_0x1f4613],{'code':_0x5c01('0x8b'),'message':_0x576a42[_0x5c01('0x57')]});logger['error'](_0x5c01('0x8c'),_0x576a42[_0x5c01('0x57')]);}},'complete':function(){try{var _0x1b9e20=[];var _0x251b5e=[];var _0x23afba=_0x5c01('0x34');if(_0x1edc46[_0x5c01('0x8d')]&&_0x1edc46[_0x5c01('0x8d')][_0x5c01('0x1a')]){_0x23afba=_0x5c01('0x8e')+_0x511b0f;_0x1b9e20[_0x5c01('0x1b')](_0x5c01('0x8f')+_0x23afba+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x5c01('0x90')+_0x511b0f;tmp_voice_queues='voice_queues_'+_0x511b0f;_0x251b5e[_0x5c01('0x1b')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x5c01('0x91'));_0x251b5e[_0x5c01('0x1b')](_0x5c01('0x8f')+tmp_voice_queues+_0x5c01('0x91'));BPromise['each'](_0x251b5e,handleTZQuery)[_0x5c01('0x19')](function(_0x4af42f){updateTzCampaigns(_0x1edc46[_0x5c01('0x2d')])[_0x5c01('0x19')](function(_0x5d66d3){updateTzVoiceQueues(_0x1edc46[_0x5c01('0x2d')])[_0x5c01('0x19')](function(_0x23f1e5){if(hasTZ)_0x5900de=_0x5900de[_0x5c01('0x79')]('dialTimezone',_0x5c01('0x92'));var _0x3c8ccb=util[_0x5c01('0xd')](_0x5c01('0x93'),_0x15e2a5,_0x23afba,_0x5900de,_0x1edc46[_0x5c01('0x2d')],_0x1edc46[_0x5c01('0x94')]||null,NOW,NOW);if(_[_0x5c01('0x1e')](_0x5edcd8[_0x5c01('0x2b')])){_0x3c8ccb+=_0x5c01('0x95');}_0x1b9e20[_0x5c01('0x1b')](_0x3c8ccb);if(_0x1edc46[_0x5c01('0x8d')]&&_0x1edc46[_0x5c01('0x8d')][_0x5c01('0x1a')]){_0x1b9e20[_0x5c01('0x1b')](insertCmContact(_0x1edc46[_0x5c01('0x2d')],_0x23afba,_0x1edc46[_0x5c01('0x8d')],_0x5edcd8));_0x1b9e20[_0x5c01('0x1b')](_0x5c01('0x96')+_0x23afba+';');}BPromise[_0x5c01('0x97')](_0x1b9e20,handleQuery)[_0x5c01('0x19')](function(_0x259a20){BPromise['all']([handleAdditionalPhones()])[_0x5c01('0x19')](function(){_0x1b9e20=[];for(var _0x27309f=0x0;_0x27309f\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','argv','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','then','length'];(function(_0x4b84a6,_0x3deb4c){var _0x1532b2=function(_0x429cf7){while(--_0x429cf7){_0x4b84a6['push'](_0x4b84a6['shift']());}};_0x1532b2(++_0x3deb4c);}(_0x06fa,0x150));var _0xa06f=function(_0x32672c,_0xe823d){_0x32672c=_0x32672c-0x0;var _0x32a8ed=_0x06fa[_0x32672c];return _0x32a8ed;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xa06f('0x0'));var Papa=require(_0xa06f('0x1'));var util=require(_0xa06f('0x2'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0xa06f('0x3'));var Redis=require(_0xa06f('0x4'));var db=require(_0xa06f('0x5'))['db'];var config=require(_0xa06f('0x6'));var shared=require(_0xa06f('0x7'));var logger=require(_0xa06f('0x8'))(_0xa06f('0x9'));config[_0xa06f('0xa')]=_[_0xa06f('0xb')](config[_0xa06f('0xa')],{'host':_0xa06f('0xc'),'port':0x18eb});var socket=require(_0xa06f('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xa06f('0xe')](_0xa06f('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xa06f('0xe')](_0xa06f('0xf'));function isEmail(_0x59b2cb){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))*$/[_0xa06f('0x10')](_0x59b2cb);}function selectNotIn(_0x349a4e,_0x1103e7,_0x23b3c4,_0x3aa878,_0x5ced3b){return squel['select']()[_0xa06f('0x11')](_0xa06f('0x12'))[_0xa06f('0x13')](_0x3aa878)[_0xa06f('0x14')](_0x1103e7,null,_0x1103e7+_0xa06f('0x15')+_0x3aa878+'.'+_0x23b3c4)[_0xa06f('0x16')](_0x3aa878+'.'+_0x23b3c4+'\x20=\x20'+_0x349a4e+'.'+_0x23b3c4)[_0xa06f('0x16')](_0x1103e7+_0xa06f('0x17')+_0x5ced3b[_0xa06f('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x28f3d1,_0x2f97cd){promisesAdditionalPhones=[];return db[_0xa06f('0x18')][_0xa06f('0x19')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xa06f('0x1a')](function(_0x3f4fa8){if(_0x3f4fa8!==null){var _0x42b96a=[];for(var _0x1d794f=0x0;_0x1d794f<_0x3f4fa8[_0xa06f('0x1b')];_0x1d794f++){var _0x3cab14=_0x3f4fa8[_0x1d794f];_0x42b96a[_0xa06f('0x1c')](insertAdditionalPhones(_0x3cab14));}}Promise[_0xa06f('0x1d')](_0x42b96a)[_0xa06f('0x1a')](function(){_0x28f3d1({'val':0x1});});});});}function insertAdditionalPhones(_0x4c212e){return new Promise(function(_0x574bf9,_0x376e18){var _0x3e09d8=_0x4c212e['AdditionalPhones'];var _0x5856e7=_0x3e09d8['split'](';');var _0x404a7c=[];orderBy=0x0;for(var _0x6b9315=0x0;_0x6b9315<_0x5856e7[_0xa06f('0x1b')];_0x6b9315++){_0x404a7c[_0xa06f('0x1c')](splitAdditionalPhone(_0x4c212e['id'],_0x5856e7[_0x6b9315]));}Promise['all'](_0x404a7c)[_0xa06f('0x1a')](function(){_0x574bf9({'val':_0x5856e7[_0xa06f('0x1b')]});});});}function splitAdditionalPhone(_0x3f9c7d,_0x298bb5){return new Promise(function(_0x14e87a,_0x455328){var _0x4a7c14=_0x298bb5[_0xa06f('0x1e')](':');var _0x2720fe=_0x4a7c14[0x0];var _0x10d62d=_0x4a7c14[0x1];if(!_[_0xa06f('0x1f')](_0x10d62d)){var _0x4ac4e5=_0x10d62d[_0xa06f('0x1e')]('|');var _0x26b5c1=[];for(var _0x49cae4=0x0;_0x49cae4<_0x4ac4e5[_0xa06f('0x1b')];_0x49cae4++){if(_0x4ac4e5[_0x49cae4]!==''){var _0x5cd6a5=_[_0xa06f('0x20')](promisesAdditionalPhones,{'contactId':_0x3f9c7d,'phone':_0x4ac4e5[_0x49cae4]});if(_0x5cd6a5[_0xa06f('0x1b')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x3f9c7d,'contactTypeId':_0x2720fe,'phone':_0x4ac4e5[_0x49cae4],'orderBy':orderBy});}}}_0x14e87a({'ok':0x1});}else _0x14e87a({'res':0x0});});}function createAdditionalPhone(_0x5f2448,_0x134239,_0x3cd68b,_0x3dce8a){var _0xf4142='';var _0x412863='';var _0x430137=_0x3cd68b['split']('§');_0xf4142=_0x430137[0x0];if(_0x430137[_0xa06f('0x1b')]==0x2)_0x412863=_0x430137[0x1];return new Promise(function(_0x516099,_0x2e2bd6){return db[_0xa06f('0x21')][_0xa06f('0x22')]({'where':{'CmContactId':_0x5f2448,'item':_0xf4142}})['then'](function(_0x4577f5){if(_0x4577f5){return db[_0xa06f('0x21')][_0xa06f('0x23')]({'ItemTypeId':_0x134239,'description':_0x412863,'OrderBy':_0x3dce8a},{'where':{'CmContactId':_0x5f2448,'item':_0xf4142}})[_0xa06f('0x1a')](function(_0x535e4d){_0x516099({'res':_0xa06f('0x24')});});}else{return db['CmContactHasItem'][_0xa06f('0x25')]({'CmContactId':_0x5f2448,'item':_0xf4142,'description':_0x412863,'ItemTypeId':_0x134239,'OrderBy':_0x3dce8a,'ItemClass':_0xa06f('0x26')})[_0xa06f('0x1a')](function(_0x3c38ca){_0x516099({'res':_0xa06f('0x27')});});}});});}function insertCmHopper(_0x3d5671,_0x4d581d,_0x176497,_0x57a2f4,_0x52f7fc){var _0x9c67aa=[_0xa06f('0x28'),'cm_contacts.scheduledat',_0xa06f('0x29'),_0xa06f('0x2a'),_0x4d581d+'.'+_0x57a2f4,_0xa06f('0x2b'),'cm_contacts.updatedAt',_0xa06f('0x2c'),_0xa06f('0x2d'),'\x22'+_0x52f7fc+'\x22'];return squel[_0xa06f('0x2e')]()[_0xa06f('0x2f')](_0xa06f('0x30'))[_0xa06f('0x31')]([_0xa06f('0x12'),'scheduledat','ContactId','ListId',_0x57a2f4,_0xa06f('0x32'),_0xa06f('0x33'),'priority',_0xa06f('0x34'),_0xa06f('0x35')],squel['select']()['fields'](_0x9c67aa)[_0xa06f('0x13')](_0x4d581d)[_0xa06f('0x14')]('cm_contacts',null,_0xa06f('0x36')+_0x4d581d+_0xa06f('0x37'))[_0xa06f('0x14')](_0x176497,null,_0x176497+_0xa06f('0x15')+_0x4d581d+'.'+_0x57a2f4)[_0xa06f('0x16')](_0x4d581d+_0xa06f('0x38'),_0x3d5671)['where'](_0xa06f('0x39'),NOW)[_0xa06f('0x16')](_0xa06f('0x3a'),selectNotIn(_0x4d581d,_0x176497,_0x57a2f4,'cm_hopper',[_0xa06f('0x3b'),_0xa06f('0x3c')]))[_0xa06f('0x16')](_0xa06f('0x3a'),selectNotIn(_0x4d581d,_0x176497,_0x57a2f4,_0xa06f('0x30'),[_0xa06f('0x3b')])))[_0xa06f('0x3d')]();}function insertCmHopperBlack(_0x2c984a,_0x1a09c2,_0x3fea63,_0xde1fb8){var _0x57fd84=[_0xa06f('0x28'),_0xa06f('0x29'),'cm_contacts.ListId',_0x1a09c2+'.'+_0xde1fb8,'cm_contacts.createdAt',_0xa06f('0x3e')];return squel[_0xa06f('0x2e')]()['into']('cm_hopper_black')['fromQuery']([_0xa06f('0x12'),_0xa06f('0x3f'),_0xa06f('0x40'),_0xde1fb8,'createdAt',_0xa06f('0x33')],squel[_0xa06f('0x41')]()['fields'](_0x57fd84)[_0xa06f('0x13')](_0x1a09c2)[_0xa06f('0x14')](_0xa06f('0x42'),null,'cm_contacts.ListId\x20=\x20'+_0x1a09c2+_0xa06f('0x37'))[_0xa06f('0x14')](_0x3fea63,null,_0x3fea63+_0xa06f('0x15')+_0x1a09c2+'.'+_0xde1fb8)['where'](_0x1a09c2+'.CmListId\x20=\x20?',_0x2c984a)['where'](_0xa06f('0x39'),NOW)[_0xa06f('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xa06f('0x11')](_0xa06f('0x12'))['from']('cm_hopper_black')['where']('ListId\x20=\x20?',_0x2c984a)[_0xa06f('0x16')](_0xde1fb8+_0xa06f('0x43')+_0x1a09c2+'.'+_0xde1fb8)))['toString']();}function insertTzCmHopper(_0x1ac418,_0x5b306f,_0x4ba556,_0x78d765,_0x57efcb,_0x46bca6){var _0x468662=[_0xa06f('0x28'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x46bca6+_0xa06f('0x44'),'cm_contacts.id','cm_contacts.ListId',_0x5b306f+'.'+_0x78d765,_0xa06f('0x2b'),'cm_contacts.updatedAt','cm_contacts.priority',_0xa06f('0x2d'),'\x22'+_0x57efcb+'\x22'];var _0x400e30=squel[_0xa06f('0x2e')]()[_0xa06f('0x2f')](_0xa06f('0x30'))[_0xa06f('0x31')]([_0xa06f('0x12'),_0xa06f('0x45'),'ContactId',_0xa06f('0x40'),_0x78d765,_0xa06f('0x32'),'updatedAt',_0xa06f('0x46'),_0xa06f('0x34'),_0xa06f('0x35')],squel['select']()[_0xa06f('0x47')](_0x468662)[_0xa06f('0x13')](_0x5b306f)[_0xa06f('0x14')]('cm_contacts',null,_0xa06f('0x36')+_0x5b306f+_0xa06f('0x37'))[_0xa06f('0x14')](_0x4ba556,null,_0x4ba556+_0xa06f('0x15')+_0x5b306f+'.'+_0x78d765)[_0xa06f('0x14')](_0x46bca6,null,_0x46bca6+_0xa06f('0x15')+_0x5b306f+'.'+_0x78d765)['where'](_0x5b306f+_0xa06f('0x38'),_0x1ac418)['where'](_0xa06f('0x39'),NOW)['where'](_0xa06f('0x3a'),selectNotIn(_0x5b306f,_0x4ba556,_0x78d765,_0xa06f('0x30'),['\x22always\x22',_0xa06f('0x3c')]))[_0xa06f('0x16')](_0xa06f('0x3a'),selectNotIn(_0x5b306f,_0x4ba556,_0x78d765,_0xa06f('0x30'),[_0xa06f('0x3b')])))['toString']();return _0x400e30;}function insertTzCmHopperBlack(_0x5f011d,_0x410721,_0x5c02cf,_0x1401e1){var _0xd9d22=[_0xa06f('0x28'),_0xa06f('0x29'),'cm_contacts.ListId',_0x410721+'.'+_0x1401e1,_0xa06f('0x2b'),_0xa06f('0x3e')];return squel[_0xa06f('0x2e')]()['into']('cm_hopper_black')[_0xa06f('0x31')]([_0xa06f('0x12'),_0xa06f('0x3f'),_0xa06f('0x40'),_0x1401e1,_0xa06f('0x32'),_0xa06f('0x33')],squel[_0xa06f('0x41')]()['fields'](_0xd9d22)[_0xa06f('0x13')](_0x410721)[_0xa06f('0x14')](_0xa06f('0x42'),null,_0xa06f('0x36')+_0x410721+_0xa06f('0x37'))[_0xa06f('0x14')](_0x5c02cf,null,_0x5c02cf+'.id\x20=\x20'+_0x410721+'.'+_0x1401e1)['where'](_0x410721+_0xa06f('0x38'),_0x5f011d)[_0xa06f('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xa06f('0x16')](_0xa06f('0x3a'),squel[_0xa06f('0x41')]()[_0xa06f('0x11')](_0xa06f('0x12'))[_0xa06f('0x13')](_0xa06f('0x48'))[_0xa06f('0x16')](_0xa06f('0x49'),_0x5f011d)[_0xa06f('0x16')](_0x1401e1+_0xa06f('0x43')+_0x410721+'.'+_0x1401e1)))[_0xa06f('0x3d')]();}function insertCmHopperAdditionalPhones(_0x96d08c){var _0x15d3da=[_0xa06f('0x4a'),_0xa06f('0x4b'),_0xa06f('0x4c'),'cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt'];return squel[_0xa06f('0x2e')]()[_0xa06f('0x2f')](_0xa06f('0x4d'))[_0xa06f('0x31')]([_0xa06f('0x4e'),_0xa06f('0x12'),_0xa06f('0x4f'),_0xa06f('0x32'),_0xa06f('0x33')],squel[_0xa06f('0x41')]()[_0xa06f('0x47')](_0x15d3da)[_0xa06f('0x13')](_0xa06f('0x30'))[_0xa06f('0x14')](_0xa06f('0x42'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xa06f('0x14')]('cm_contact_has_items',null,_0xa06f('0x50'))['where'](_0xa06f('0x51'),_0x96d08c)[_0xa06f('0x16')](_0xa06f('0x39'),NOW))['toString']();}function insertCmContact(_0x4f6f3e,_0x24f7e5,_0x367f0c,_0x57fa34){var _0x4c1e19=_[_0xa06f('0x52')](_['keys'](_0x57fa34),[_0xa06f('0x40'),'CompanyId',_0xa06f('0x32'),'updatedAt',_0xa06f('0x53')]);return squel[_0xa06f('0x2e')]()[_0xa06f('0x2f')]('cm_contacts')[_0xa06f('0x31')](_0x4c1e19,squel[_0xa06f('0x41')]()[_0xa06f('0x47')](_0x4c1e19)[_0xa06f('0x13')](_0x24f7e5)[_0xa06f('0x16')]('('+_0x367f0c[_0xa06f('0x14')](',')+_0xa06f('0x54'),squel[_0xa06f('0x41')]()['fields'](_0x367f0c)[_0xa06f('0x13')](_0xa06f('0x42'))[_0xa06f('0x16')](_0xa06f('0x49'),_0x4f6f3e)['where'](_0xa06f('0x55')))['where'](_0xa06f('0x56'),squel[_0xa06f('0x41')]()[_0xa06f('0x11')]('MIN(id)',_0xa06f('0x57'))[_0xa06f('0x13')](_0x24f7e5)[_0xa06f('0x58')](_0x367f0c[_0xa06f('0x14')](','))))[_0xa06f('0x3d')]();}function handleStop(){logger[_0xa06f('0x59')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x54a5aa){logger[_0xa06f('0x5a')](_0x54a5aa[_0xa06f('0x5b')]);process['exit'](0x1);}function handleError(_0x400fd8,_0x26d49a){stats['errors'][_0xa06f('0x1c')]({'name':_0x26d49a['code'],'message':_0x26d49a[_0xa06f('0x5b')],'row':_0x400fd8});}function handleQuery(_0x1d66ad){logger[_0xa06f('0x59')](_0x1d66ad);return db[_0xa06f('0x5c')]['query'](_0x1d66ad)[_0xa06f('0x5d')](function(_0x1cbdc2){results[_0xa06f('0x1c')](_0x1cbdc2);})[_0xa06f('0x5e')](function(_0x65e970){logger[_0xa06f('0x5a')](_0x65e970['message']);});}function updateTzCampaigns(_0x3f5508){return new Promise(function(_0x1c82fa,_0x1dcdd0){var _0x39fe32=squel[_0xa06f('0x41')]()['fields'](['campaigns.id',_0xa06f('0x5f')])[_0xa06f('0x13')]('campaigns')['join'](_0xa06f('0x60'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0xa06f('0x16')](_0xa06f('0x61')+_0x3f5508);db['sequelize']['query'](_0x39fe32[_0xa06f('0x3d')]())[_0xa06f('0x5d')](function(_0x57f83e){var _0x2580ba=[];for(var _0x3359ad=0x0;_0x3359ad<_0x57f83e[_0xa06f('0x1b')];_0x3359ad++){_0x2580ba[_0xa06f('0x1c')](getTimezoneData(_0x57f83e[_0x3359ad],tmp_campaigns));}BPromise[_0xa06f('0x1d')](_0x2580ba)[_0xa06f('0x1a')](function(){_0x1c82fa({'val':0x1});});})[_0xa06f('0x5e')](function(_0xa77a9b){logger[_0xa06f('0x5a')](_0xa77a9b['message']);_0x1c82fa({'val':0x0});});});}function updateTzVoiceQueues(_0x51fca0){return new Promise(function(_0x4b112b,_0x3d9fa4){var _0x481ff1=squel['select']()[_0xa06f('0x47')]([_0xa06f('0x62'),'voice_queues.dialTimezone'])[_0xa06f('0x13')](_0xa06f('0x63'))[_0xa06f('0x14')](_0xa06f('0x64'),null,_0xa06f('0x65'))[_0xa06f('0x16')]('voice_queues_has_cm_lists.CmListId='+_0x51fca0);db['sequelize'][_0xa06f('0x66')](_0x481ff1[_0xa06f('0x3d')]())['spread'](function(_0x460528){var _0x1a28b6=[];for(var _0x472646=0x0;_0x472646<_0x460528[_0xa06f('0x1b')];_0x472646++){_0x1a28b6['push'](getTimezoneData(_0x460528[_0x472646],tmp_voice_queues));}BPromise[_0xa06f('0x1d')](_0x1a28b6)[_0xa06f('0x1a')](function(){_0x4b112b({'val':0x1});});})[_0xa06f('0x5e')](function(_0x512100){logger['error'](_0x512100[_0xa06f('0x5b')]);_0x4b112b({'val':0x0});});});}function getTimezoneData(_0x4ca4a8,_0x5b235f){return new Promise(function(_0x31e84d,_0x366536){var _0x4ca3a3=shared[_0xa06f('0x67')];var _0x3f17f8=_0x4ca3a3[_0x4ca4a8[_0xa06f('0x68')]];if(_[_0xa06f('0x1f')](_0x3f17f8)){_0x31e84d({'ret':0x1});}else{var _0x205943=_0x3f17f8[_0xa06f('0x69')];var _0x2243ab=squel[_0xa06f('0x2e')]()[_0xa06f('0x2f')](_0x5b235f)[_0xa06f('0x6a')]('id',_0x4ca4a8['id'])[_0xa06f('0x6a')](_0xa06f('0x6b'),_0x205943)[_0xa06f('0x6a')](_0xa06f('0x68'),_0x4ca4a8['dialTimezone'])[_0xa06f('0x3d')]();return db[_0xa06f('0x5c')][_0xa06f('0x66')](_0x2243ab)['spread'](function(_0x5ad758){_0x31e84d({'ret':0x1});})[_0xa06f('0x5e')](function(_0x29b54e){logger[_0xa06f('0x5a')](_0x29b54e['message']);_0x366536({'ret':0x1});});}});}function handleTZQuery(_0x336cc5){logger['info'](_0x336cc5);return db[_0xa06f('0x5c')][_0xa06f('0x66')](_0x336cc5)[_0xa06f('0x5d')](function(_0x2b756e){})[_0xa06f('0x5e')](function(_0x446eb3){logger[_0xa06f('0x5a')](_0x446eb3['message']);});}function main(_0x5d9f63,_0x5722a5,_0x10347a,_0xa9540b){logger[_0xa06f('0x59')](_0xa06f('0x6c'),_0x5d9f63,JSON[_0xa06f('0x6d')](_0x5722a5));process[_0xa06f('0x6e')]('start');var _0x4912e2=_0x5722a5[_0xa06f('0x6f')];var _0x5a0812=_[_0xa06f('0x70')](_0x4912e2);var _0x10ab40=_0x5722a5['socket_timestamp'];var _0x270efd=path[_0xa06f('0x14')](config['root'],_0xa06f('0x71'),_0x10ab40+_0xa06f('0x72'));hasTZ=_[_0xa06f('0x73')](_0x4912e2)[_0xa06f('0x74')]('dialTimezone');var _0x31d0f7=_[_0xa06f('0x73')](_0x4912e2)[_0xa06f('0x14')]();logger[_0xa06f('0x59')]('header',_0x31d0f7);db[_0xa06f('0x75')][_0xa06f('0x19')]({'raw':!![],'attributes':['id',_0xa06f('0x76')]})[_0xa06f('0x1a')](function(_0x21328a){for(var _0x522830=0x0;_0x522830<_0x21328a[_0xa06f('0x1b')];_0x522830++){if(_0x21328a[_0x522830][_0xa06f('0x76')]in _0x4912e2){contactItemTypes['push'](_0x21328a[_0x522830]);delete _0x5a0812[_0x21328a[_0x522830][_0xa06f('0x76')]];hasAdditionalPhones=!![];}for(var _0x54154d in _0x4912e2){if(_0x21328a[_0x522830][_0xa06f('0x76')]+'_description'===_0x54154d){phoneDescriptions['push']({'itemTypeId':_0x21328a[_0x522830]['id'],'description':_0x54154d});delete _0x5a0812[_0x54154d];}}}if(hasAdditionalPhones)_0x5a0812['AdditionalPhones']='';var _0xe9a84a=_[_0xa06f('0x73')](_0x5a0812)[_0xa06f('0x14')]();logger[_0xa06f('0x59')](_0xa06f('0x77'),_0xe9a84a);fs[_0xa06f('0x78')](_0x270efd,_0xe9a84a+'\x0a');Papa['parse'](fs['createReadStream'](_0x5d9f63),{'header':!![],'skipEmptyLines':!![],'step':function(_0x209676,_0x4bbc71){try{for(var _0x3b71ae=0x0,_0x4e056a=[];_0x3b71ae<_0x209676['data'][_0xa06f('0x1b')];_0x3b71ae++){stats[_0xa06f('0x79')]+=0x1;if(_0x209676[_0xa06f('0x7a')][_0x3b71ae]){handleError(_0x209676[_0xa06f('0x7b')][_0x3b71ae],_0x209676[_0xa06f('0x7a')][_0x3b71ae]);}else{var _0x339190=[];var _0x175bc5=[];var _0x5c39c4={};for(var _0x4c0516 in _0x4912e2){let _0x489696=contactItemTypes['find'](_0x36a59b=>_0x36a59b[_0xa06f('0x76')]===_0x4c0516);let _0x2a85f8=contactItemTypes[_0xa06f('0x7c')](_0x1b5f30=>_0x1b5f30[_0xa06f('0x76')]+'_description'===_0x4c0516);if(_['isNil'](_0x489696)&&_['isNil'](_0x2a85f8)){if(_0x4912e2['hasOwnProperty'](_0x4c0516)){if(_0x209676[_0xa06f('0x7b')][_0x3b71ae][_0x4912e2[_0x4c0516]]){var _0xbcead8=_[_0xa06f('0x7d')](_0x209676[_0xa06f('0x7b')][_0x3b71ae][_0x4912e2[_0x4c0516]]['replace'](/"/g,'\x27'));switch(_0x4c0516){case'scheduledat':var _0x2756ea=moment(_0xbcead8,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x2756ea[_0xa06f('0x7e')]()){_0x4e056a['push']('\x22'+_0xbcead8+'\x22');}else{_0x339190[_0xa06f('0x1c')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xa06f('0x46'):var _0x18062b=parseInt(_0xbcead8);_0xbcead8=_[_0xa06f('0x7f')](_0x18062b)||_0x18062b<0x0||_0x18062b>0x4?_0xa9540b?0x3:0x2:_0x18062b;_0x4e056a[_0xa06f('0x1c')]('\x22'+_0xbcead8+'\x22');break;case _0xa06f('0x34'):var _0xe2ec94=parseInt(_0xbcead8);if(_[_0xa06f('0x80')](_0xe2ec94)&&_[_0xa06f('0x74')](_0x10347a,_0xe2ec94)){_0x4e056a['push']('\x22'+_0xe2ec94+'\x22');}else{_0x339190['push'](_0xa06f('0x81'));}break;case _0xa06f('0x82'):if(isEmail(_0xbcead8)){_0x4e056a['push']('\x22'+_0xbcead8+'\x22');}else{_0x339190[_0xa06f('0x1c')](_0xa06f('0x83'));}break;case _0xa06f('0x84'):var _0x426a7f=moment(_0xbcead8,_0xa06f('0x85'),!![]);if(_0x426a7f['isValid']()){_0x4e056a[_0xa06f('0x1c')]('\x22'+_0xbcead8+'\x22');}else{_0x339190[_0xa06f('0x1c')](_0xa06f('0x86'));}break;case _0xa06f('0x68'):var _0xd18435=shared[_0xa06f('0x67')];var _0x14aedf=_0xd18435[_0xbcead8];if(!_[_0xa06f('0x1f')](_0x14aedf)){var _0x1d7bd6=_0x14aedf[_0xa06f('0x69')];_0x4e056a[_0xa06f('0x1c')]('\x22'+_0xbcead8+'\x22');_0x4e056a[_0xa06f('0x1c')]('\x22'+_0x1d7bd6+'\x22');}break;default:_0x4e056a['push']('\x22'+_0xbcead8+'\x22');}}else{switch(_0x4c0516){case _0xa06f('0x87'):case'phone':_0x339190[_0xa06f('0x1c')](_0x4c0516+_0xa06f('0x88'));break;default:_0x4e056a[_0xa06f('0x1c')]('\x22\x22');}}}}else{var _0xecc765='';if(!_[_0xa06f('0x1f')](_0x489696)){if(!_0x5c39c4[_0xa06f('0x89')](_0x489696['id'])){if(!_[_0xa06f('0x1f')](_0x209676['data'][_0x3b71ae][_0x4912e2[_0x4c0516]])){var _0xbcead8=_['trim'](_0x209676['data'][_0x3b71ae][_0x4912e2[_0x4c0516]][_0xa06f('0x8a')](/"/g,'\x27'));var _0x3e4b45=phoneDescriptions['find'](_0x3ced0d=>_0x3ced0d[_0xa06f('0x8b')]===_0x489696['id']);if(!_[_0xa06f('0x1f')](_0x3e4b45)){var _0x5c2fbd=_[_0xa06f('0x7d')](_0x209676[_0xa06f('0x7b')][_0x3b71ae][_0x4912e2[_0x3e4b45[_0xa06f('0x8c')]]]['replace'](/"/g,'\x27'));if(!_[_0xa06f('0x1f')](_0x5c2fbd))_0xbcead8=_0xbcead8+'§'+_0x5c2fbd;}if(_0xecc765=='')_0xecc765=_0xbcead8;else _0xecc765+='|'+_0xbcead8;}_0x175bc5[_0xa06f('0x1c')](_0x489696['id']+':'+_0xecc765);_0x5c39c4[_0x489696['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4e056a[_0xa06f('0x1c')]('\x22'+_0x175bc5[_0xa06f('0x14')](';')+'\x22');}if(_0x339190[_0xa06f('0x1b')]){handleError(_0x209676[_0xa06f('0x7b')][_0x3b71ae],{'code':'SystemRow','message':_0x339190[_0xa06f('0x14')]()});}else{fs[_0xa06f('0x8d')](_0x270efd,_0x4e056a[_0xa06f('0x14')]()+'\x0a');}_0x4e056a=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0xa06f('0x8e')+_0x10ab40,stats);stats[_0xa06f('0x7a')]=[];}}if(stopped){logger[_0xa06f('0x59')](_0xa06f('0x8f'));_0x4bbc71[_0xa06f('0x90')]();}}catch(_0x1f817c){handleError(_0x209676[_0xa06f('0x7b')][_0x3b71ae],{'code':_0xa06f('0x91'),'message':_0x1f817c[_0xa06f('0x5b')]});logger[_0xa06f('0x5a')](_0xa06f('0x92'),_0x1f817c[_0xa06f('0x5b')]);}},'complete':function(){try{var _0x291430=[];var _0x38f17d=[];var _0x581194=_0xa06f('0x42');if(_0x5722a5['duplicates']&&_0x5722a5[_0xa06f('0x93')][_0xa06f('0x1b')]){_0x581194=_0xa06f('0x94')+_0x10ab40;_0x291430[_0xa06f('0x1c')](_0xa06f('0x95')+_0x581194+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xa06f('0x96')+_0x10ab40;tmp_voice_queues=_0xa06f('0x97')+_0x10ab40;_0x38f17d[_0xa06f('0x1c')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0xa06f('0x98'));_0x38f17d[_0xa06f('0x1c')]('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xa06f('0x99')](_0x38f17d,handleTZQuery)['then'](function(_0x33ac14){updateTzCampaigns(_0x5722a5[_0xa06f('0x40')])[_0xa06f('0x1a')](function(_0x1b3a67){updateTzVoiceQueues(_0x5722a5[_0xa06f('0x40')])[_0xa06f('0x1a')](function(_0x31228a){if(hasTZ)_0xe9a84a=_0xe9a84a['replace'](_0xa06f('0x68'),_0xa06f('0x9a'));var _0x12d431=util['format'](_0xa06f('0x9b'),_0x270efd,_0x581194,_0xe9a84a,_0x5722a5['ListId'],_0x5722a5[_0xa06f('0x9c')]||null,NOW,NOW);if(_[_0xa06f('0x1f')](_0x4912e2['scheduledat'])){_0x12d431+=_0xa06f('0x9d');}_0x291430[_0xa06f('0x1c')](_0x12d431);if(_0x5722a5['duplicates']&&_0x5722a5[_0xa06f('0x93')][_0xa06f('0x1b')]){_0x291430[_0xa06f('0x1c')](insertCmContact(_0x5722a5[_0xa06f('0x40')],_0x581194,_0x5722a5[_0xa06f('0x93')],_0x4912e2));_0x291430[_0xa06f('0x1c')](_0xa06f('0x9e')+_0x581194+';');}BPromise['each'](_0x291430,handleQuery)[_0xa06f('0x1a')](function(_0x51b9ee){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x291430=[];for(var _0x3a29f0=0x0;_0x3a29f0\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','format','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','.id\x20=\x20','join','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','catch','error','message','then','split','CmContactHasItem','findOne','update','PHONE','inserted'];(function(_0x56db09,_0x5017a6){var _0x5999a2=function(_0x20363f){while(--_0x20363f){_0x56db09['push'](_0x56db09['shift']());}};_0x5999a2(++_0x5017a6);}(_0x4c4d,0x1a2));var _0xd4c4=function(_0x4d4248,_0x12d6ba){_0x4d4248=_0x4d4248-0x0;var _0x386343=_0x4c4d[_0x4d4248];return _0x386343;};'use strict';var fs=require('fs');var path=require(_0xd4c4('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require('util');var BPromise=require('bluebird');var moment=require(_0xd4c4('0x1'));var squel=require('squel');var Redis=require(_0xd4c4('0x2'));var db=require(_0xd4c4('0x3'))['db'];var config=require(_0xd4c4('0x4'));var logger=require(_0xd4c4('0x5'))(_0xd4c4('0x6'));config[_0xd4c4('0x7')]=_['defaults'](config[_0xd4c4('0x7')],{'host':_0xd4c4('0x8'),'port':0x18eb});var socket=require(_0xd4c4('0x9'))(new Redis(config[_0xd4c4('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xd4c4('0xa')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0xd4c4('0xb')+moment()[_0xd4c4('0xa')](_0xd4c4('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x32370d){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xd4c4('0xd')](_0x32370d);}function selectNotIn(_0x2e6360,_0x1696bf,_0x266f66,_0x794e78,_0x49a291){return squel[_0xd4c4('0xe')]()['field'](_0xd4c4('0xf'))[_0xd4c4('0x10')](_0x794e78)['join'](_0x1696bf,null,_0x1696bf+_0xd4c4('0x11')+_0x794e78+'.'+_0x266f66)['where'](_0x794e78+'.'+_0x266f66+'\x20=\x20'+_0x2e6360+'.'+_0x266f66)['where'](_0x1696bf+'.dialCheckDuplicateType\x20IN\x20('+_0x49a291[_0xd4c4('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3c52b0,_0x55fbc9){promisesAdditionalPhones=[];promisesContact=[];return db[_0xd4c4('0x13')][_0xd4c4('0x14')](_0xd4c4('0x15')+tempTableName)[_0xd4c4('0x16')](function(_0x3851cf){if(_0x3851cf!==null){var _0x11318b=[];for(var _0x213926=0x0;_0x213926<_0x3851cf[_0xd4c4('0x17')];_0x213926++){var _0x1915ac=_0x3851cf[_0x213926];if(!_['isNil'](_0x1915ac['phone'])){if(!_[_0xd4c4('0x18')](_0x1915ac[_0xd4c4('0x19')]))_0x11318b[_0xd4c4('0x1a')](insertAdditionalPhones(_0x1915ac));promisesContact[_0xd4c4('0x1a')]({'contact':_0x1915ac});}}}Promise[_0xd4c4('0x1b')](_0x11318b)['then'](function(){_0x3c52b0({'val':0x1});});})[_0xd4c4('0x1c')](function(_0x5df304){logger[_0xd4c4('0x1d')](_0x5df304[_0xd4c4('0x1e')]);});});}function insertAdditionalPhones(_0x579554){return new Promise(function(_0x20224b,_0xc197d8){var _0x5be52d=_0x579554[_0xd4c4('0x19')];if(_[_0xd4c4('0x18')](_0x5be52d))_0xc197d8({'val':0x0});else{var _0x92a2ec=_0x5be52d['split'](';');var _0x29ea89=[];orderBy=0x0;for(var _0xe7d09c=0x0;_0xe7d09c<_0x92a2ec['length'];_0xe7d09c++){_0x29ea89['push'](splitAdditionalPhone(_0x579554['id'],_0x92a2ec[_0xe7d09c]));}Promise[_0xd4c4('0x1b')](_0x29ea89)[_0xd4c4('0x1f')](function(){_0x20224b({'val':_0x92a2ec['length']});});}});}function splitAdditionalPhone(_0x1c1a00,_0x15114a){return new Promise(function(_0x4979e6,_0xbf1e3c){var _0x59aade=_0x15114a[_0xd4c4('0x20')](':');var _0x337bd4=_0x59aade[0x0];var _0x2cb2db=_0x59aade[0x1];if(_0x2cb2db!==''){var _0x5f48a1=_0x2cb2db[_0xd4c4('0x20')]('|');var _0x5cc6fe=[];for(var _0x491417=0x0;_0x491417<_0x5f48a1[_0xd4c4('0x17')];_0x491417++){if(_0x5f48a1[_0x491417]!==''){var _0x5781ed=_['filter'](promisesAdditionalPhones,{'contactId':_0x1c1a00,'phone':_0x5f48a1[_0x491417]});if(_0x5781ed['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x1c1a00,'contactTypeId':_0x337bd4,'phone':_0x5f48a1[_0x491417],'orderBy':orderBy});}}}_0x4979e6({'ok':0x1});}else _0x4979e6({'res':0x0});});}function createAdditionalPhone(_0x1c768f,_0x127f03,_0x416c3f,_0x52a0f8){var _0x49c734='';var _0x530e28='';var _0x2c7654=_0x416c3f[_0xd4c4('0x20')]('§');_0x49c734=_0x2c7654[0x0];if(_0x2c7654[_0xd4c4('0x17')]==0x2)_0x530e28=_0x2c7654[0x1];return new Promise(function(_0x26b87f,_0x5f4e8d){return db[_0xd4c4('0x21')][_0xd4c4('0x22')]({'where':{'CmContactId':_0x1c768f,'item':_0x49c734}})['then'](function(_0x5bf9eb){if(_0x5bf9eb){return db['CmContactHasItem'][_0xd4c4('0x23')]({'ItemTypeId':_0x127f03,'description':_0x530e28,'OrderBy':_0x52a0f8},{'where':{'CmContactId':_0x1c768f,'item':_0x49c734}})['then'](function(_0x1c6b2e){_0x26b87f({'res':'updated'});});}else{return db[_0xd4c4('0x21')]['create']({'CmContactId':_0x1c768f,'item':_0x49c734,'ItemTypeId':_0x127f03,'description':_0x530e28,'OrderBy':_0x52a0f8,'ItemClass':_0xd4c4('0x24')})[_0xd4c4('0x1f')](function(_0x1a35cc){_0x26b87f({'res':_0xd4c4('0x25')});});}});});}function updateContact(_0xaa5b57){return new Promise(function(_0x230ec8,_0x1ef1f8){var _0x4a4be1=_0xaa5b57['id'];delete _0xaa5b57['id'];return db['CmContact'][_0xd4c4('0x23')](_0xaa5b57,{'where':{'id':_0x4a4be1}})[_0xd4c4('0x1f')](function(_0x255b29){updatedRows+=0x1;return db[_0xd4c4('0x26')]['update']({'phone':_0xaa5b57['phone']},{'where':{'ContactId':_0x4a4be1}})[_0xd4c4('0x1f')](function(_0x4a556a){_0x230ec8({'ret':'OK'});});});});}function insertCmHopper(_0x4b46ba,_0x3e79f1,_0x3cdb33,_0x203e7f,_0x4a5bbe){var _0x51aa5e=[_0xd4c4('0x27'),'cm_contacts.scheduledat','cm_contacts.id',_0xd4c4('0x28'),_0x3e79f1+'.'+_0x203e7f,_0xd4c4('0x29'),_0xd4c4('0x2a'),_0xd4c4('0x2b'),_0xd4c4('0x2c'),'\x22'+_0x4a5bbe+'\x22'];return squel['insert']()[_0xd4c4('0x2d')](_0xd4c4('0x2e'))[_0xd4c4('0x2f')]([_0xd4c4('0xf'),'scheduledat',_0xd4c4('0x30'),'ListId',_0x203e7f,_0xd4c4('0x31'),_0xd4c4('0x32'),'priority',_0xd4c4('0x33'),'recallme'],squel[_0xd4c4('0xe')]()['fields'](_0x51aa5e)[_0xd4c4('0x10')](_0x3e79f1)[_0xd4c4('0x12')](_0xd4c4('0x34'),null,_0xd4c4('0x35')+_0x3e79f1+_0xd4c4('0x36'))[_0xd4c4('0x12')](_0x3cdb33,null,_0x3cdb33+_0xd4c4('0x11')+_0x3e79f1+'.'+_0x203e7f)[_0xd4c4('0x37')](_0x3e79f1+'.CmListId\x20=\x20?',_0x4b46ba)[_0xd4c4('0x37')](_0xd4c4('0x38'),NOW)[_0xd4c4('0x37')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3e79f1,_0x3cdb33,_0x203e7f,_0xd4c4('0x2e'),[_0xd4c4('0x39'),_0xd4c4('0x3a')]))[_0xd4c4('0x37')](_0xd4c4('0x3b'),selectNotIn(_0x3e79f1,_0x3cdb33,_0x203e7f,_0xd4c4('0x2e'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x2ec298,_0x3e8ee2,_0x5542e7,_0x509f35){var _0x20def6=['cm_contacts.phone',_0xd4c4('0x3c'),'cm_contacts.ListId',_0x3e8ee2+'.'+_0x509f35,_0xd4c4('0x29'),_0xd4c4('0x2a')];return squel[_0xd4c4('0x3d')]()[_0xd4c4('0x2d')](_0xd4c4('0x3e'))[_0xd4c4('0x2f')]([_0xd4c4('0xf'),_0xd4c4('0x30'),_0xd4c4('0x3f'),_0x509f35,_0xd4c4('0x31'),_0xd4c4('0x32')],squel[_0xd4c4('0xe')]()[_0xd4c4('0x40')](_0x20def6)[_0xd4c4('0x10')](_0x3e8ee2)[_0xd4c4('0x12')](_0xd4c4('0x34'),null,_0xd4c4('0x35')+_0x3e8ee2+_0xd4c4('0x36'))[_0xd4c4('0x12')](_0x5542e7,null,_0x5542e7+_0xd4c4('0x11')+_0x3e8ee2+'.'+_0x509f35)['where'](_0x3e8ee2+_0xd4c4('0x41'),_0x2ec298)[_0xd4c4('0x37')](_0xd4c4('0x38'),NOW)[_0xd4c4('0x37')](_0xd4c4('0x3b'),squel[_0xd4c4('0xe')]()[_0xd4c4('0x42')]('phone')['from']('cm_hopper_black')[_0xd4c4('0x37')](_0xd4c4('0x43'),_0x2ec298)[_0xd4c4('0x37')](_0x509f35+_0xd4c4('0x44'),_0x3e8ee2+'.'+_0x509f35)))[_0xd4c4('0x45')]();}function insertCmHopperAdditionalPhones(_0x195a8c){var _0x45f0fa=[_0xd4c4('0x46'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0xd4c4('0x47'),_0xd4c4('0x48')];return squel[_0xd4c4('0x3d')]()['into'](_0xd4c4('0x49'))[_0xd4c4('0x2f')]([_0xd4c4('0x4a'),_0xd4c4('0xf'),_0xd4c4('0x4b'),'createdAt',_0xd4c4('0x32')],squel[_0xd4c4('0xe')]()['fields'](_0x45f0fa)['from'](_0xd4c4('0x2e'))['join'](_0xd4c4('0x34'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xd4c4('0x12')](_0xd4c4('0x4c'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xd4c4('0x37')](_0xd4c4('0x4d'),_0x195a8c)[_0xd4c4('0x37')](_0xd4c4('0x38'),NOW))[_0xd4c4('0x45')]();}function insertCmContact(_0x85c9a7,_0x565785,_0x37efd7,_0x50ae4f){var _0x2d67d3=_[_0xd4c4('0x4e')](_[_0xd4c4('0x4f')](_0x50ae4f),[_0xd4c4('0x3f'),_0xd4c4('0x50'),'createdAt',_0xd4c4('0x32')]);return squel['insert']()[_0xd4c4('0x2d')](_0xd4c4('0x34'))['fromQuery'](_0x2d67d3,squel['select']()[_0xd4c4('0x40')](_0x2d67d3)[_0xd4c4('0x10')](_0x565785)[_0xd4c4('0x37')]('('+_0x37efd7[_0xd4c4('0x12')](',')+_0xd4c4('0x51'),squel[_0xd4c4('0xe')]()[_0xd4c4('0x40')](_0x37efd7)[_0xd4c4('0x10')](_0xd4c4('0x34'))[_0xd4c4('0x37')](_0xd4c4('0x43'),_0x85c9a7))[_0xd4c4('0x37')](_0xd4c4('0x52'),squel[_0xd4c4('0xe')]()[_0xd4c4('0x42')](_0xd4c4('0x53'),_0xd4c4('0x54'))[_0xd4c4('0x10')](_0x565785)['group'](_0x37efd7[_0xd4c4('0x12')](','))))[_0xd4c4('0x45')]();}function handleStop(){logger[_0xd4c4('0x55')](_0xd4c4('0x56'));stopped=!![];}function handleUncaughtException(_0xaddb06){logger['error'](_0xaddb06['message']);process['exit'](0x1);}function handleError(_0x244718,_0x2c3059){stats[_0xd4c4('0x57')]['push']({'name':_0x2c3059[_0xd4c4('0x58')],'message':_0x2c3059[_0xd4c4('0x1e')],'row':_0x244718});}function handleQuery(_0x3fadba){logger[_0xd4c4('0x55')](_0x3fadba);return db[_0xd4c4('0x13')][_0xd4c4('0x14')](_0x3fadba)[_0xd4c4('0x16')](function(_0x35a52e){results[_0xd4c4('0x1a')](_0x35a52e);})[_0xd4c4('0x1c')](function(_0x40b531){logger[_0xd4c4('0x1d')](_0x40b531[_0xd4c4('0x1e')]);});}function main(_0x9acc7f,_0x14acc9,_0x469464,_0x1fee3a){logger[_0xd4c4('0x55')]('main',_0x9acc7f,JSON['stringify'](_0x14acc9));process['send'](_0xd4c4('0x59'));var _0x262950=_0x14acc9[_0xd4c4('0x5a')];var _0x3af90b=_[_0xd4c4('0x5b')](_0x262950);var _0x13b7aa=_0x14acc9[_0xd4c4('0x5c')];var _0x2752b5=path[_0xd4c4('0x12')](config['root'],_0xd4c4('0x5d'),_0x13b7aa+_0xd4c4('0x5e'));logger['info'](_0xd4c4('0x5f'),_0x14acc9);db[_0xd4c4('0x60')]['findAll']({'raw':!![],'attributes':['id',_0xd4c4('0x61')]})[_0xd4c4('0x1f')](function(_0xd5c2cf){for(var _0x475708=0x0;_0x475708<_0xd5c2cf[_0xd4c4('0x17')];_0x475708++){if(_0xd5c2cf[_0x475708][_0xd4c4('0x61')]in _0x262950){contactItemTypes[_0xd4c4('0x1a')](_0xd5c2cf[_0x475708]);delete _0x3af90b[_0xd5c2cf[_0x475708][_0xd4c4('0x61')]];hasAdditionalPhones=!![];}for(var _0x3acc58 in _0x262950){if(_0xd5c2cf[_0x475708][_0xd4c4('0x61')]+_0xd4c4('0x62')===_0x3acc58){phoneDescriptions[_0xd4c4('0x1a')]({'itemTypeId':_0xd5c2cf[_0x475708]['id'],'description':_0x3acc58});delete _0x3af90b[_0x3acc58];}}}if(hasAdditionalPhones)_0x3af90b[_0xd4c4('0x19')]='';var _0x1bc37f=_['keys'](_0x3af90b)['join']();logger[_0xd4c4('0x55')](_0xd4c4('0x63'),_0x1bc37f);fs[_0xd4c4('0x64')](_0x2752b5,_0x1bc37f+'\x0a');Papa[_0xd4c4('0x65')](fs[_0xd4c4('0x66')](_0x9acc7f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x524765,_0x100aed){try{for(var _0x1c6ad3=0x0,_0x1964ff=[];_0x1c6ad3<_0x524765['data']['length'];_0x1c6ad3++){stats['rows']+=0x1;if(_0x524765[_0xd4c4('0x57')][_0x1c6ad3]){handleError(_0x524765['data'][_0x1c6ad3],_0x524765[_0xd4c4('0x57')][_0x1c6ad3]);}else{var _0x19b89b=[];var _0x222116=[];var _0x44bccf={};for(var _0xae270b in _0x262950){let _0x24eea4=contactItemTypes['find'](_0x3e5604=>_0x3e5604['name']===_0xae270b);let _0x137107=contactItemTypes[_0xd4c4('0x67')](_0x39b41a=>_0x39b41a[_0xd4c4('0x61')]+_0xd4c4('0x62')===_0xae270b);if(_[_0xd4c4('0x18')](_0x24eea4)&&_[_0xd4c4('0x18')](_0x137107)){if(_0x262950[_0xd4c4('0x68')](_0xae270b)){if(_0x524765['data'][_0x1c6ad3][_0x262950[_0xae270b]]){var _0x593e53=_[_0xd4c4('0x69')](_0x524765['data'][_0x1c6ad3][_0x262950[_0xae270b]]['replace'](/"/g,'\x27'));switch(_0xae270b){case _0xd4c4('0x6a'):var _0x5a6a88=moment(_0x593e53,_0xd4c4('0x6b'),!![]);if(_0x5a6a88[_0xd4c4('0x6c')]()){_0x1964ff[_0xd4c4('0x1a')]('\x22'+_0x593e53+'\x22');}else{_0x19b89b[_0xd4c4('0x1a')](_0xd4c4('0x6d'));}break;case _0xd4c4('0x6e'):var _0x448546=parseInt(_0x593e53);_0x593e53=_[_0xd4c4('0x6f')](_0x448546)||_0x448546<0x0||_0x448546>0x4?_0x1fee3a?0x3:0x2:_0x448546;_0x1964ff[_0xd4c4('0x1a')]('\x22'+_0x593e53+'\x22');break;case _0xd4c4('0x33'):var _0xa23b8a=parseInt(_0x593e53);if(_['isNumber'](_0xa23b8a)&&_[_0xd4c4('0x70')](_0x469464,_0xa23b8a)){_0x1964ff[_0xd4c4('0x1a')]('\x22'+_0xa23b8a+'\x22');}else{_0x19b89b[_0xd4c4('0x1a')](_0xd4c4('0x71'));}break;case _0xd4c4('0x72'):if(isEmail(_0x593e53)){_0x1964ff['push']('\x22'+_0x593e53+'\x22');}else{_0x19b89b['push']('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x4a1f17=moment(_0x593e53,_0xd4c4('0x73'),!![]);if(_0x4a1f17['isValid']()){_0x1964ff[_0xd4c4('0x1a')]('\x22'+_0x593e53+'\x22');}else{_0x19b89b['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x1964ff[_0xd4c4('0x1a')]('\x22'+_0x593e53+'\x22');}}else{switch(_0xae270b){case'firstName':case _0xd4c4('0xf'):_0x19b89b[_0xd4c4('0x1a')](_0xae270b+'\x20not\x20specified');break;default:_0x1964ff['push']('\x22\x22');}}}}else{var _0x4783fc='';if(!_[_0xd4c4('0x18')](_0x24eea4)){if(!_0x44bccf[_0xd4c4('0x68')](_0x24eea4['id'])){for(var _0x49fef7=0x0;_0x49fef7<_0x262950[_0xae270b][_0xd4c4('0x17')];_0x49fef7++){var _0x593e53=_[_0xd4c4('0x69')](_0x524765[_0xd4c4('0x74')][_0x1c6ad3][_0x262950[_0xae270b][_0x49fef7]]['replace'](/"/g,'\x27'));var _0x449c11=phoneDescriptions[_0xd4c4('0x67')](_0x2c4bbd=>_0x2c4bbd[_0xd4c4('0x75')]===_0x24eea4['id']);if(!_[_0xd4c4('0x18')](_0x449c11)){var _0x31cf97=_[_0xd4c4('0x69')](_0x524765['data'][_0x1c6ad3][_0x262950[_0x449c11[_0xd4c4('0x76')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xd4c4('0x18')](_0x31cf97))_0x593e53=_0x593e53+'§'+_0x31cf97;}if(_0x4783fc=='')_0x4783fc=_0x593e53;else _0x4783fc+='|'+_0x593e53;}_0x222116[_0xd4c4('0x1a')](_0x24eea4['id']+':'+_0x4783fc);_0x44bccf[_0x24eea4['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1964ff[_0xd4c4('0x1a')]('\x22'+_0x222116[_0xd4c4('0x12')](';')+'\x22');}if(_0x19b89b['length']){handleError(_0x524765[_0xd4c4('0x74')][_0x1c6ad3],{'code':_0xd4c4('0x77'),'message':_0x19b89b['join']()});}else{fs[_0xd4c4('0x78')](_0x2752b5,_0x1964ff['join']()+'\x0a');}_0x1964ff=[];}if(!(stats[_0xd4c4('0x79')]%0xc8)){socket[_0xd4c4('0x7a')](_0xd4c4('0x7b')+_0x13b7aa,stats);stats[_0xd4c4('0x57')]=[];}}if(stopped){logger[_0xd4c4('0x55')](_0xd4c4('0x7c'));_0x100aed[_0xd4c4('0x7d')]();}}catch(_0xfa735d){handleError(_0x524765['data'][_0x1c6ad3],{'code':_0xd4c4('0x7e'),'message':_0xfa735d['message']});logger[_0xd4c4('0x1d')]('step',_0xfa735d['message']);}},'complete':function(){try{var _0x5bf846=[];var _0x6a3e92=tempTableName;_0x5bf846[_0xd4c4('0x1a')](_0xd4c4('0x7f')+_0x6a3e92+_0xd4c4('0x80'));logger['info'](_0xd4c4('0x81'),contactItemTypes[_0xd4c4('0x17')]);var _0x4ac5e1=util[_0xd4c4('0xa')](_0xd4c4('0x82'),_0x2752b5,_0x6a3e92,_0x1bc37f,_0x14acc9[_0xd4c4('0x3f')],_0x14acc9['CompanyId']||null,NOW,NOW);if(_[_0xd4c4('0x18')](_0x262950[_0xd4c4('0x6a')])){_0x4ac5e1+=_0xd4c4('0x83');}_0x5bf846[_0xd4c4('0x1a')](_0x4ac5e1);BPromise[_0xd4c4('0x84')](_0x5bf846,handleQuery)[_0xd4c4('0x1f')](function(_0x497bee){BPromise[_0xd4c4('0x1b')]([handleAdditionalPhones()])[_0xd4c4('0x1f')](function(){_0x5bf846=[];for(var _0x517a44=0x0;_0x517a44\x20\x20','root','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','select','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','query','select\x20*\x20from\x20','spread','length'];(function(_0x409186,_0x4b8b73){var _0x3deb43=function(_0x358728){while(--_0x358728){_0x409186['push'](_0x409186['shift']());}};_0x3deb43(++_0x4b8b73);}(_0xa6ea,0x122));var _0xaa6e=function(_0x1f624b,_0x30b688){_0x1f624b=_0x1f624b-0x0;var _0x41890e=_0xa6ea[_0x1f624b];return _0x41890e;};'use strict';var fs=require('fs');var path=require(_0xaa6e('0x0'));var _=require(_0xaa6e('0x1'));var Papa=require(_0xaa6e('0x2'));var util=require(_0xaa6e('0x3'));var BPromise=require(_0xaa6e('0x4'));var moment=require(_0xaa6e('0x5'));var squel=require(_0xaa6e('0x6'));var Redis=require('ioredis');var db=require(_0xaa6e('0x7'))['db'];var config=require(_0xaa6e('0x8'));var logger=require(_0xaa6e('0x9'))(_0xaa6e('0xa'));config[_0xaa6e('0xb')]=_['defaults'](config['redis'],{'host':_0xaa6e('0xc'),'port':0x18eb});var socket=require(_0xaa6e('0xd'))(new Redis(config[_0xaa6e('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xaa6e('0xe')](_0xaa6e('0xf'));var tempTableName=_0xaa6e('0x10')+moment()[_0xaa6e('0xe')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x357240){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'](_0x357240);}function selectNotIn(_0x534cb5,_0x3fc93b,_0x4d4a7f,_0x58acab,_0x3fbdc5){return squel[_0xaa6e('0x11')]()['field'](_0xaa6e('0x12'))['from'](_0x58acab)[_0xaa6e('0x13')](_0x3fc93b,null,_0x3fc93b+_0xaa6e('0x14')+_0x58acab+'.'+_0x4d4a7f)[_0xaa6e('0x15')](_0x58acab+'.'+_0x4d4a7f+_0xaa6e('0x16')+_0x534cb5+'.'+_0x4d4a7f)[_0xaa6e('0x15')](_0x3fc93b+_0xaa6e('0x17')+_0x3fbdc5[_0xaa6e('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1da120,_0x45ccb7){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0xaa6e('0x18')](_0xaa6e('0x19')+tempTableName)[_0xaa6e('0x1a')](function(_0x49f9b6){if(_0x49f9b6!==null){var _0x3cd02f=[];for(var _0x427655=0x0;_0x427655<_0x49f9b6[_0xaa6e('0x1b')];_0x427655++){var _0x228eb5=_0x49f9b6[_0x427655];if(!_['isNil'](_0x228eb5[_0xaa6e('0x12')])){if(!_[_0xaa6e('0x1c')](_0x228eb5[_0xaa6e('0x1d')]))_0x3cd02f[_0xaa6e('0x1e')](insertAdditionalPhones(_0x228eb5));promisesContact[_0xaa6e('0x1e')]({'contact':_0x228eb5});}}}Promise[_0xaa6e('0x1f')](_0x3cd02f)['then'](function(){_0x1da120({'val':0x1});});})[_0xaa6e('0x20')](function(_0x7a30d5){logger[_0xaa6e('0x21')](_0x7a30d5['message']);});});}function insertAdditionalPhones(_0x22d985){return new Promise(function(_0x1c517c,_0x1b6afa){var _0x5c90af=_0x22d985[_0xaa6e('0x1d')];if(_[_0xaa6e('0x1c')](_0x5c90af))_0x1b6afa({'val':0x0});else{var _0x4b8cf0=_0x5c90af['split'](';');var _0x4ba839=[];orderBy=0x0;for(var _0x1ae8f5=0x0;_0x1ae8f5<_0x4b8cf0[_0xaa6e('0x1b')];_0x1ae8f5++){_0x4ba839[_0xaa6e('0x1e')](splitAdditionalPhone(_0x22d985['id'],_0x4b8cf0[_0x1ae8f5]));}Promise[_0xaa6e('0x1f')](_0x4ba839)['then'](function(){_0x1c517c({'val':_0x4b8cf0[_0xaa6e('0x1b')]});});}});}function splitAdditionalPhone(_0x1699b5,_0x40e705){return new Promise(function(_0x336ad0,_0x18b2c7){var _0x1143dc=_0x40e705[_0xaa6e('0x22')](':');var _0x1aef51=_0x1143dc[0x0];var _0x116c92=_0x1143dc[0x1];if(_0x116c92!==''){var _0x2467c8=_0x116c92['split']('|');var _0x268f1f=[];for(var _0x31db4d=0x0;_0x31db4d<_0x2467c8[_0xaa6e('0x1b')];_0x31db4d++){if(_0x2467c8[_0x31db4d]!==''){var _0x521402=_['filter'](promisesAdditionalPhones,{'contactId':_0x1699b5,'phone':_0x2467c8[_0x31db4d]});if(_0x521402[_0xaa6e('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0xaa6e('0x1e')]({'contactId':_0x1699b5,'contactTypeId':_0x1aef51,'phone':_0x2467c8[_0x31db4d],'orderBy':orderBy});}}}_0x336ad0({'ok':0x1});}else _0x336ad0({'res':0x0});});}function createAdditionalPhone(_0x111d6c,_0x30cb38,_0x40c76a,_0x1a9c35){var _0x4cbd6a='';var _0x6e60e1='';var _0x21262a=_0x40c76a['split']('§');_0x4cbd6a=_0x21262a[0x0];if(_0x21262a[_0xaa6e('0x1b')]==0x2)_0x6e60e1=_0x21262a[0x1];return new Promise(function(_0x1d41d7,_0x571c28){return db[_0xaa6e('0x23')][_0xaa6e('0x24')]({'where':{'CmContactId':_0x111d6c,'item':_0x4cbd6a}})[_0xaa6e('0x25')](function(_0x518e6b){if(_0x518e6b){return db[_0xaa6e('0x23')][_0xaa6e('0x26')]({'ItemTypeId':_0x30cb38,'description':_0x6e60e1,'OrderBy':_0x1a9c35},{'where':{'CmContactId':_0x111d6c,'item':_0x4cbd6a}})[_0xaa6e('0x25')](function(_0x46cc37){_0x1d41d7({'res':'updated'});});}else{return db[_0xaa6e('0x23')][_0xaa6e('0x27')]({'CmContactId':_0x111d6c,'item':_0x4cbd6a,'ItemTypeId':_0x30cb38,'description':_0x6e60e1,'OrderBy':_0x1a9c35,'ItemClass':_0xaa6e('0x28')})[_0xaa6e('0x25')](function(_0x7b4e60){_0x1d41d7({'res':_0xaa6e('0x29')});});}});});}function updateContact(_0x11deaf){return new Promise(function(_0x50899e,_0x3d4fea){var _0x3a931c=_0x11deaf['id'];delete _0x11deaf['id'];return db[_0xaa6e('0x2a')][_0xaa6e('0x26')](_0x11deaf,{'where':{'id':_0x3a931c}})[_0xaa6e('0x25')](function(_0x1764f6){updatedRows+=0x1;return db[_0xaa6e('0x2b')][_0xaa6e('0x26')]({'phone':_0x11deaf[_0xaa6e('0x12')]},{'where':{'ContactId':_0x3a931c}})[_0xaa6e('0x25')](function(_0x5cf3f6){_0x50899e({'ret':'OK'});});});});}function insertCmHopper(_0x25d7d0,_0x888a23,_0x2e9911,_0x1e8436,_0x3cf18f){var _0x1547dd=['cm_contacts.phone',_0xaa6e('0x2c'),_0xaa6e('0x2d'),_0xaa6e('0x2e'),_0x888a23+'.'+_0x1e8436,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0xaa6e('0x2f'),'\x22'+_0x3cf18f+'\x22'];return squel['insert']()[_0xaa6e('0x30')](_0xaa6e('0x31'))['fromQuery']([_0xaa6e('0x12'),'scheduledat',_0xaa6e('0x32'),_0xaa6e('0x33'),_0x1e8436,_0xaa6e('0x34'),'updatedAt',_0xaa6e('0x35'),_0xaa6e('0x36'),_0xaa6e('0x37')],squel[_0xaa6e('0x11')]()[_0xaa6e('0x38')](_0x1547dd)['from'](_0x888a23)[_0xaa6e('0x13')]('cm_contacts',null,_0xaa6e('0x39')+_0x888a23+_0xaa6e('0x3a'))[_0xaa6e('0x13')](_0x2e9911,null,_0x2e9911+_0xaa6e('0x14')+_0x888a23+'.'+_0x1e8436)['where'](_0x888a23+_0xaa6e('0x3b'),_0x25d7d0)[_0xaa6e('0x15')](_0xaa6e('0x3c'),NOW)[_0xaa6e('0x15')](_0xaa6e('0x3d'),selectNotIn(_0x888a23,_0x2e9911,_0x1e8436,'cm_hopper',[_0xaa6e('0x3e'),_0xaa6e('0x3f')]))[_0xaa6e('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x888a23,_0x2e9911,_0x1e8436,_0xaa6e('0x31'),[_0xaa6e('0x3e')])))[_0xaa6e('0x40')]();}function insertCmHopperBlack(_0x3e8f1b,_0x524b8a,_0x91c365,_0x3a65f3){var _0x1805c9=[_0xaa6e('0x41'),_0xaa6e('0x2d'),_0xaa6e('0x2e'),_0x524b8a+'.'+_0x3a65f3,_0xaa6e('0x42'),'cm_contacts.updatedAt'];return squel['insert']()['into']('cm_hopper_black')[_0xaa6e('0x43')]([_0xaa6e('0x12'),_0xaa6e('0x32'),_0xaa6e('0x33'),_0x3a65f3,_0xaa6e('0x34'),'updatedAt'],squel[_0xaa6e('0x11')]()['fields'](_0x1805c9)[_0xaa6e('0x44')](_0x524b8a)[_0xaa6e('0x13')]('cm_contacts',null,_0xaa6e('0x39')+_0x524b8a+'.CmListId')['join'](_0x91c365,null,_0x91c365+_0xaa6e('0x14')+_0x524b8a+'.'+_0x3a65f3)[_0xaa6e('0x15')](_0x524b8a+_0xaa6e('0x3b'),_0x3e8f1b)[_0xaa6e('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xaa6e('0x15')](_0xaa6e('0x3d'),squel[_0xaa6e('0x11')]()[_0xaa6e('0x45')](_0xaa6e('0x12'))['from'](_0xaa6e('0x46'))[_0xaa6e('0x15')](_0xaa6e('0x47'),_0x3e8f1b)[_0xaa6e('0x15')](_0x3a65f3+'\x20=\x20?',_0x524b8a+'.'+_0x3a65f3)))[_0xaa6e('0x40')]();}function insertCmHopperAdditionalPhones(_0x1cbdcf){var _0x1b932b=[_0xaa6e('0x48'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0xaa6e('0x49')];return squel[_0xaa6e('0x4a')]()[_0xaa6e('0x30')](_0xaa6e('0x4b'))[_0xaa6e('0x43')]([_0xaa6e('0x4c'),'phone',_0xaa6e('0x4d'),'createdAt',_0xaa6e('0x4e')],squel['select']()[_0xaa6e('0x38')](_0x1b932b)[_0xaa6e('0x44')](_0xaa6e('0x31'))[_0xaa6e('0x13')](_0xaa6e('0x4f'),null,_0xaa6e('0x50'))['join'](_0xaa6e('0x51'),null,_0xaa6e('0x52'))[_0xaa6e('0x15')](_0xaa6e('0x53'),_0x1cbdcf)[_0xaa6e('0x15')](_0xaa6e('0x3c'),NOW))[_0xaa6e('0x40')]();}function insertCmContact(_0x3159f1,_0x4e562c,_0x16a129,_0x1545b7){var _0x10c410=_['concat'](_[_0xaa6e('0x54')](_0x1545b7),['ListId',_0xaa6e('0x55'),_0xaa6e('0x34'),'updatedAt']);return squel['insert']()[_0xaa6e('0x30')](_0xaa6e('0x4f'))[_0xaa6e('0x43')](_0x10c410,squel[_0xaa6e('0x11')]()['fields'](_0x10c410)[_0xaa6e('0x44')](_0x4e562c)[_0xaa6e('0x15')]('('+_0x16a129['join'](',')+_0xaa6e('0x56'),squel['select']()['fields'](_0x16a129)[_0xaa6e('0x44')](_0xaa6e('0x4f'))['where'](_0xaa6e('0x47'),_0x3159f1))[_0xaa6e('0x15')](_0xaa6e('0x57'),squel['select']()[_0xaa6e('0x45')](_0xaa6e('0x58'),_0xaa6e('0x59'))[_0xaa6e('0x44')](_0x4e562c)['group'](_0x16a129[_0xaa6e('0x13')](','))))[_0xaa6e('0x40')]();}function handleStop(){logger[_0xaa6e('0x5a')](_0xaa6e('0x5b'));stopped=!![];}function handleUncaughtException(_0xbe85cd){logger[_0xaa6e('0x21')](_0xbe85cd[_0xaa6e('0x5c')]);process[_0xaa6e('0x5d')](0x1);}function handleError(_0x2bc25b,_0x9d925f){stats[_0xaa6e('0x5e')][_0xaa6e('0x1e')]({'name':_0x9d925f[_0xaa6e('0x5f')],'message':_0x9d925f[_0xaa6e('0x5c')],'row':_0x2bc25b});}function handleQuery(_0x4e0130){logger[_0xaa6e('0x5a')](_0x4e0130);return db['sequelize']['query'](_0x4e0130)['spread'](function(_0x3d8ec3){results['push'](_0x3d8ec3);})[_0xaa6e('0x20')](function(_0x2ad02c){logger['error'](_0x2ad02c['message']);});}function main(_0x2085cc,_0x10353b,_0x8ed16e,_0x8ced2f){logger['info']('main',_0x2085cc,JSON[_0xaa6e('0x60')](_0x10353b));process[_0xaa6e('0x61')]('start');var _0x1d1376=_0x10353b[_0xaa6e('0x62')];var _0x22cf31=_[_0xaa6e('0x63')](_0x1d1376);var _0x46fb6a=_0x10353b[_0xaa6e('0x64')];var _0x5f7387=path['join'](config['root'],_0xaa6e('0x65'),_0x46fb6a+_0xaa6e('0x66'));logger[_0xaa6e('0x5a')]('body',_0x10353b);db[_0xaa6e('0x67')][_0xaa6e('0x68')]({'raw':!![],'attributes':['id',_0xaa6e('0x69')]})['then'](function(_0xe8951e){for(var _0x8990d2=0x0;_0x8990d2<_0xe8951e[_0xaa6e('0x1b')];_0x8990d2++){if(_0xe8951e[_0x8990d2][_0xaa6e('0x69')]in _0x1d1376){contactItemTypes[_0xaa6e('0x1e')](_0xe8951e[_0x8990d2]);delete _0x22cf31[_0xe8951e[_0x8990d2][_0xaa6e('0x69')]];hasAdditionalPhones=!![];}for(var _0x50ddf8 in _0x1d1376){if(_0xe8951e[_0x8990d2][_0xaa6e('0x69')]+_0xaa6e('0x6a')===_0x50ddf8){phoneDescriptions[_0xaa6e('0x1e')]({'itemTypeId':_0xe8951e[_0x8990d2]['id'],'description':_0x50ddf8});delete _0x22cf31[_0x50ddf8];}}}if(hasAdditionalPhones)_0x22cf31[_0xaa6e('0x1d')]='';var _0x276771=_[_0xaa6e('0x54')](_0x22cf31)[_0xaa6e('0x13')]();logger[_0xaa6e('0x5a')](_0xaa6e('0x6b'),_0x276771);fs[_0xaa6e('0x6c')](_0x5f7387,_0x276771+'\x0a');Papa[_0xaa6e('0x6d')](fs[_0xaa6e('0x6e')](_0x2085cc),{'header':!![],'skipEmptyLines':!![],'step':function(_0xdb3698,_0x48d139){try{for(var _0x50312c=0x0,_0x355349=[];_0x50312c<_0xdb3698[_0xaa6e('0x6f')][_0xaa6e('0x1b')];_0x50312c++){stats[_0xaa6e('0x70')]+=0x1;if(_0xdb3698[_0xaa6e('0x5e')][_0x50312c]){handleError(_0xdb3698[_0xaa6e('0x6f')][_0x50312c],_0xdb3698[_0xaa6e('0x5e')][_0x50312c]);}else{var _0x20c2e9=[];var _0x59d6e9=[];var _0xda43ce={};for(var _0x598bd7 in _0x1d1376){let _0xa75b4b=contactItemTypes[_0xaa6e('0x71')](_0x43754c=>_0x43754c[_0xaa6e('0x69')]===_0x598bd7);let _0x3916a8=contactItemTypes[_0xaa6e('0x71')](_0x57a1e8=>_0x57a1e8['name']+_0xaa6e('0x6a')===_0x598bd7);if(_[_0xaa6e('0x1c')](_0xa75b4b)&&_[_0xaa6e('0x1c')](_0x3916a8)){if(_0x1d1376[_0xaa6e('0x72')](_0x598bd7)){if(_0xdb3698['data'][_0x50312c][_0x1d1376[_0x598bd7]]){var _0x275337=_[_0xaa6e('0x73')](_0xdb3698[_0xaa6e('0x6f')][_0x50312c][_0x1d1376[_0x598bd7]]['replace'](/"/g,'\x27'));switch(_0x598bd7){case _0xaa6e('0x74'):var _0x4dacbb=moment(_0x275337,_0xaa6e('0xf'),!![]);if(_0x4dacbb[_0xaa6e('0x75')]()){_0x355349[_0xaa6e('0x1e')]('\x22'+_0x275337+'\x22');}else{_0x20c2e9[_0xaa6e('0x1e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xaa6e('0x35'):var _0x18e740=parseInt(_0x275337);_0x275337=_[_0xaa6e('0x76')](_0x18e740)||_0x18e740<0x0||_0x18e740>0x4?_0x8ced2f?0x3:0x2:_0x18e740;_0x355349['push']('\x22'+_0x275337+'\x22');break;case _0xaa6e('0x36'):var _0x44ee4c=parseInt(_0x275337);if(_[_0xaa6e('0x77')](_0x44ee4c)&&_[_0xaa6e('0x78')](_0x8ed16e,_0x44ee4c)){_0x355349[_0xaa6e('0x1e')]('\x22'+_0x44ee4c+'\x22');}else{_0x20c2e9[_0xaa6e('0x1e')](_0xaa6e('0x79'));}break;case _0xaa6e('0x7a'):if(isEmail(_0x275337)){_0x355349[_0xaa6e('0x1e')]('\x22'+_0x275337+'\x22');}else{_0x20c2e9[_0xaa6e('0x1e')](_0xaa6e('0x7b'));}break;case _0xaa6e('0x7c'):var _0x433636=moment(_0x275337,'YYYY-MM-DD',!![]);if(_0x433636[_0xaa6e('0x75')]()){_0x355349['push']('\x22'+_0x275337+'\x22');}else{_0x20c2e9[_0xaa6e('0x1e')](_0xaa6e('0x7d'));}break;default:_0x355349[_0xaa6e('0x1e')]('\x22'+_0x275337+'\x22');}}else{switch(_0x598bd7){case _0xaa6e('0x7e'):case'phone':_0x20c2e9[_0xaa6e('0x1e')](_0x598bd7+_0xaa6e('0x7f'));break;default:_0x355349[_0xaa6e('0x1e')]('\x22\x22');}}}}else{var _0x4e8cfa='';if(!_[_0xaa6e('0x1c')](_0xa75b4b)){if(!_0xda43ce[_0xaa6e('0x72')](_0xa75b4b['id'])){for(var _0x249a62=0x0;_0x249a62<_0x1d1376[_0x598bd7][_0xaa6e('0x1b')];_0x249a62++){var _0x275337=_[_0xaa6e('0x73')](_0xdb3698[_0xaa6e('0x6f')][_0x50312c][_0x1d1376[_0x598bd7][_0x249a62]][_0xaa6e('0x80')](/"/g,'\x27'));var _0x223953=phoneDescriptions[_0xaa6e('0x71')](_0x5be83d=>_0x5be83d[_0xaa6e('0x81')]===_0xa75b4b['id']);if(!_[_0xaa6e('0x1c')](_0x223953)){var _0x185272=_[_0xaa6e('0x73')](_0xdb3698['data'][_0x50312c][_0x1d1376[_0x223953[_0xaa6e('0x82')]][0x0]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x185272))_0x275337=_0x275337+'§'+_0x185272;}if(_0x4e8cfa=='')_0x4e8cfa=_0x275337;else _0x4e8cfa+='|'+_0x275337;}_0x59d6e9['push'](_0xa75b4b['id']+':'+_0x4e8cfa);_0xda43ce[_0xa75b4b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x355349[_0xaa6e('0x1e')]('\x22'+_0x59d6e9['join'](';')+'\x22');}if(_0x20c2e9[_0xaa6e('0x1b')]){handleError(_0xdb3698[_0xaa6e('0x6f')][_0x50312c],{'code':_0xaa6e('0x83'),'message':_0x20c2e9[_0xaa6e('0x13')]()});}else{fs[_0xaa6e('0x84')](_0x5f7387,_0x355349[_0xaa6e('0x13')]()+'\x0a');}_0x355349=[];}if(!(stats[_0xaa6e('0x70')]%0xc8)){socket[_0xaa6e('0x85')](_0xaa6e('0x86')+_0x46fb6a,stats);stats['errors']=[];}}if(stopped){logger[_0xaa6e('0x5a')](_0xaa6e('0x87'));_0x48d139[_0xaa6e('0x88')]();}}catch(_0x226bff){handleError(_0xdb3698[_0xaa6e('0x6f')][_0x50312c],{'code':_0xaa6e('0x89'),'message':_0x226bff[_0xaa6e('0x5c')]});logger[_0xaa6e('0x21')](_0xaa6e('0x8a'),_0x226bff[_0xaa6e('0x5c')]);}},'complete':function(){try{var _0x481162=[];var _0x5bf77b=tempTableName;_0x481162[_0xaa6e('0x1e')](_0xaa6e('0x8b')+_0x5bf77b+_0xaa6e('0x8c'));logger[_0xaa6e('0x5a')](_0xaa6e('0x8d'),contactItemTypes[_0xaa6e('0x1b')]);var _0x26b62f=util['format'](_0xaa6e('0x8e'),_0x5f7387,_0x5bf77b,_0x276771,_0x10353b[_0xaa6e('0x33')],_0x10353b[_0xaa6e('0x55')]||null,NOW,NOW);if(_[_0xaa6e('0x1c')](_0x1d1376[_0xaa6e('0x74')])){_0x26b62f+=',\x20scheduledAt\x20=\x20NOW()';}_0x481162['push'](_0x26b62f);BPromise['each'](_0x481162,handleQuery)[_0xaa6e('0x25')](function(_0x316edf){BPromise['all']([handleAdditionalPhones()])[_0xaa6e('0x25')](function(){_0x481162=[];for(var _0xed3853=0x0;_0xed3853\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','lodash','squel','./update-interaction','updateInteraction','./utils','getAccountFK','role','agent','select','field','name','color','tools_tags','user_has_','u.id','u.fullname','ui.','from','left_join','u.id\x20=\x20ui.UserId'];(function(_0x25abea,_0x395d0f){var _0x26ea45=function(_0x4605f7){while(--_0x4605f7){_0x25abea['push'](_0x25abea['shift']());}};_0x26ea45(++_0x395d0f);}(_0xfd00,0x12e));var _0x0fd0=function(_0x19e769,_0xbb18dd){_0x19e769=_0x19e769-0x0;var _0x3b8913=_0xfd00[_0x19e769];return _0x3b8913;};'use strict';var _=require(_0x0fd0('0x0'));var squel=require(_0x0fd0('0x1'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require(_0x0fd0('0x2'))[_0x0fd0('0x3')];var utils=require(_0x0fd0('0x4'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x20212f,_0x21d817,_0x476dbd){var _0x18dcce=![];var _0x342b7e=utils[_0x0fd0('0x5')](_0x20212f);if(_0x21d817[_0x0fd0('0x6')]===_0x0fd0('0x7')&&!_0x476dbd['search']&&!_0x476dbd[_0x342b7e]){_0x18dcce=!![];}return _0x18dcce;}function getTagsQuery(){return squel[_0x0fd0('0x8')]()[_0x0fd0('0x9')]('id')[_0x0fd0('0x9')](_0x0fd0('0xa'))[_0x0fd0('0x9')](_0x0fd0('0xb'))['from'](_0x0fd0('0xc'));}function getUsersQuery(_0x64cdbe,_0x4aebfc){var _0x541d93=utils['getInteractionFK'](_0x64cdbe);var _0x29525d=_0x0fd0('0xd')+_0x64cdbe+'_interactions';var _0x5d6d6b=squel[_0x0fd0('0x8')]()['field'](_0x0fd0('0xe'))[_0x0fd0('0x9')](_0x0fd0('0xf'))[_0x0fd0('0x9')](_0x0fd0('0x10')+_0x541d93)[_0x0fd0('0x11')](_0x29525d,'ui')[_0x0fd0('0x12')]('users','u',_0x0fd0('0x13'));if(_0x4aebfc[_0x0fd0('0x14')]>0x0){_0x5d6d6b[_0x0fd0('0x15')](_0x0fd0('0x10')+_0x541d93+_0x0fd0('0x16'),_['map'](_0x4aebfc,'id'));}return _0x5d6d6b;}function getInteractionsQuery(_0x4e8124){var _0x3dde93=utils[_0x0fd0('0x17')](_0x4e8124);var _0x8db7b7=utils[_0x0fd0('0x5')](_0x4e8124);var _0x10ed08=utils['getInteractionFK'](_0x4e8124);return squel[_0x0fd0('0x8')]()['from'](_0x3dde93[_0x0fd0('0x18')],'i')['left_join'](_0x0fd0('0x19'),'c',_0x0fd0('0x1a'))['left_join'](_0x0fd0('0x1b'),'o',_0x0fd0('0x1c'))[_0x0fd0('0x12')](_0x3dde93[_0x0fd0('0x1d')],'a',_0x0fd0('0x1e')+_0x8db7b7)[_0x0fd0('0x12')](_0x3dde93[_0x0fd0('0x1f')],'me','me.'+_0x10ed08+'\x20=\x20i.id')[_0x0fd0('0x12')](_0x3dde93[_0x0fd0('0x20')],'it',_0x0fd0('0x21')+_0x10ed08+_0x0fd0('0x22'))[_0x0fd0('0x12')](_0x0fd0('0xc'),'t',_0x0fd0('0x23'));}function getSqlClauses(){var _0x11664b={'body':squel['expr'](),'contact':squel[_0x0fd0('0x24')](),'default':squel[_0x0fd0('0x24')](),'fields':squel[_0x0fd0('0x24')](),'filter':squel['expr'](),'read':squel[_0x0fd0('0x24')](),'tags':{'clause':squel[_0x0fd0('0x24')](),'ids':null},'user':squel[_0x0fd0('0x24')]()};return _0x11664b;}function parseTagParameter(_0x2f3131){var _0x106b98=squel[_0x0fd0('0x24')]();if(_0x2f3131){var _0x5c5a82=utils[_0x0fd0('0x25')](_0x2f3131);_0x5c5a82['forEach'](function(_0x48563d){_0x106b98['or'](_0x0fd0('0x26'),'%,'+_0x48563d+',%');});}return _0x106b98;}function parseReadParameter(_0x424a4f){var _0x31dfef='';if(_0x424a4f){_0x31dfef=_0x0fd0('0x27');if(_0x424a4f==='1'){_0x31dfef=_0x31dfef[_0x0fd0('0x28')]('{OPERATOR}','=');}else{_0x31dfef=_0x31dfef[_0x0fd0('0x28')](_0x0fd0('0x29'),'>');}}return _0x31dfef;}function parseSearchFilter(_0x49b958,_0x2d60bc){var _0x40995c=squel[_0x0fd0('0x24')]();if(_0x2d60bc){var _0x5434b1=_0x2d60bc['replace']('\x5c','\x5c\x5c')[_0x0fd0('0x28')](/'/g,'\x27\x27');if(qs[_0x0fd0('0x2a')](_0x5434b1)){_0x40995c['or']('i.id\x20LIKE\x20?',_0x5434b1+'%');if([_0x0fd0('0x2b'),'whatsapp'][_0x0fd0('0x2c')](_0x49b958)){_0x40995c['or'](_0x0fd0('0x2d'),_0x5434b1+'%');}else if(_0x49b958===_0x0fd0('0x2e')){_0x40995c['or'](_0x0fd0('0x2f'),_0x5434b1+'%');}else if(_0x49b958===_0x0fd0('0x30')){_0x40995c['or'](_0x0fd0('0x31'),_0x5434b1+'%');}}else if(_0x49b958===_0x0fd0('0x32')&&qs[_0x0fd0('0x33')](_0x5434b1)){_0x40995c['or']('c.email\x20LIKE\x20?',_0x5434b1+'%');}else{if(_0x49b958===_0x0fd0('0x32')){_0x40995c['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5434b1,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0fd0('0x34')](_0x5434b1));}else if(_0x49b958!==_0x0fd0('0x2e')){_0x40995c['or'](_0x0fd0('0x35'),qs[_0x0fd0('0x34')](_0x5434b1));}_0x40995c['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0fd0('0x34')](_0x5434b1,!![]),null);}}return _0x40995c;}function parseAdvancedSearchFilter(_0x495d30,_0x1f6828){var _0x594324=getSqlClauses();var _0x4229bd=as['parseSearch'](_0x495d30);var _0x53e13a=_0x4229bd[_0x0fd0('0x36')];for(var _0x2c5e70=0x0;_0x2c5e70<_0x4229bd[_0x0fd0('0x37')][_0x0fd0('0x14')];_0x2c5e70++){var _0x1cd9c2=_0x4229bd[_0x0fd0('0x37')][_0x2c5e70];var _0x2b30ee='i';var _0x29f3d0=_[_0x0fd0('0x38')](_0x1f6828,[_0x0fd0('0xa'),_0x1cd9c2[_0x0fd0('0x9')]]);if(_0x29f3d0){var _0xaa7efb=as[_0x0fd0('0x39')](_0x2b30ee,_0x29f3d0[_0x0fd0('0x3a')],_0x1cd9c2);_0x594324['default'][_0x53e13a](_0xaa7efb['text'],_0xaa7efb[_0x0fd0('0x3b')][_0x0fd0('0x3c')],_0xaa7efb[_0x0fd0('0x3b')][_0x0fd0('0x3d')]);}else{switch(_0x1cd9c2['field']){case _0x0fd0('0x3e'):var _0x5197a8=parseReadParameter(_0x1cd9c2[_0x0fd0('0x3b')]);_0x594324[_0x0fd0('0x3f')][_0x0fd0('0x40')](_0x5197a8);break;case'Contact':if(_0x1cd9c2[_0x0fd0('0x41')]===_0x0fd0('0x42')){if(_0x1cd9c2[_0x0fd0('0x3b')][_0x0fd0('0x43')]('\x20')['length']>0x1){_0x594324['contact'][_0x53e13a](_0x0fd0('0x44'),qs[_0x0fd0('0x34')](_0x1cd9c2['value'],!![]),null);}else{var _0x57829d='%'+_0x1cd9c2['value']+'%';_0x594324[_0x0fd0('0x45')][_0x53e13a](_0x0fd0('0x46'),_0x57829d,_0x57829d,_0x57829d);}}else{_0x29f3d0=_[_0x0fd0('0x38')](_0x1f6828,['name',_0x0fd0('0x47')]);_0x1cd9c2['field']='ContactId';_0xaa7efb=as[_0x0fd0('0x39')](_0x2b30ee,_0x29f3d0[_0x0fd0('0x3a')],_0x1cd9c2);_0x594324[_0x0fd0('0x45')][_0x53e13a](_0xaa7efb[_0x0fd0('0x48')],_0xaa7efb['value']['start'],_0xaa7efb[_0x0fd0('0x3b')]['end']);}break;case _0x0fd0('0x49'):var _0x5524cc=_0x1cd9c2[_0x0fd0('0x3b')][_0x0fd0('0x43')](',')['map'](function(_0x2d403c){return Number(_0x2d403c);});var _0x427fb8=parseTagParameter(_0x5524cc);_0x594324[_0x0fd0('0x4a')][_0x0fd0('0x4b')][_0x0fd0('0x40')](_0x427fb8);_0x594324[_0x0fd0('0x4a')][_0x0fd0('0x4c')]=_0x5524cc;break;case _0x0fd0('0x4d'):if(_0x1cd9c2[_0x0fd0('0x41')]===_0x0fd0('0x42')){_0x594324[_0x0fd0('0x4e')][_0x53e13a](_0x0fd0('0x4f'),'%'+_0x1cd9c2['value']+'%',null);}else{_0x29f3d0=_[_0x0fd0('0x38')](_0x1f6828,['name','UserId']);_0x1cd9c2[_0x0fd0('0x9')]='UserId';_0xaa7efb=as[_0x0fd0('0x39')](_0x2b30ee,_0x29f3d0[_0x0fd0('0x3a')],_0x1cd9c2);_0x594324[_0x0fd0('0x4e')][_0x53e13a](_0xaa7efb['text'],_0xaa7efb[_0x0fd0('0x3b')][_0x0fd0('0x3c')],_0xaa7efb['value'][_0x0fd0('0x3d')]);}break;case _0x0fd0('0x50'):case'plainBody':_0xaa7efb=as['buildExpression']('me',null,_0x1cd9c2);_0x594324['body'][_0x53e13a](_0xaa7efb['text'],_0xaa7efb[_0x0fd0('0x3b')][_0x0fd0('0x3c')],_0xaa7efb['value'][_0x0fd0('0x3d')]);break;}}}return _0x594324;}function parseModelFields(_0x478dd6,_0x4b39b7,_0x25f9a4){var _0x2d8350=utils['getAccountFK'](_0x478dd6);var _0x2d88ab=squel['expr']();var _0x29d01b=_(_0x4b39b7)[_0x0fd0('0x51')]()[_0x0fd0('0x52')](function(_0x512390){return _['some'](_0x25f9a4,[_0x0fd0('0xa'),_0x512390])?_0x512390:undefined;})[_0x0fd0('0x53')]()[_0x0fd0('0x3b')]();if(_0x29d01b[_0x0fd0('0x14')]>0x0){_0x29d01b[_0x0fd0('0x54')](function(_0x56dbaf){if(_0x56dbaf===_0x2d8350){_0x2d88ab[_0x0fd0('0x40')]('i.'+_0x2d8350+_0x0fd0('0x16'),[][_0x0fd0('0x55')](_0x4b39b7[_0x56dbaf]));}else if(_0x56dbaf===_0x0fd0('0x56')){var _0x5d2656=JSON['parse'](_0x4b39b7[_0x56dbaf])['$gte'];var _0x4bb5af=JSON[_0x0fd0('0x57')](_0x4b39b7[_0x56dbaf])['$lte'];_0x2d88ab[_0x0fd0('0x40')](_0x0fd0('0x58'),_0x5d2656,_0x4bb5af);}else{if(_0x4b39b7[_0x56dbaf]===_0x0fd0('0x59')){_0x2d88ab['and']('i.'+_0x56dbaf+'\x20IS\x20NULL');}else{_0x2d88ab[_0x0fd0('0x40')]('i.'+_0x56dbaf+_0x0fd0('0x5a'),_0x4b39b7[_0x56dbaf]);}}});}return _0x2d88ab;}function parseQueryParameters(_0x12395e,_0x5d0ee7,_0x1f4c9f){var _0x29e283=getSqlClauses();return Promise['resolve']()[_0x0fd0('0x5b')](function(){return parseModelFields(_0x12395e,_0x5d0ee7,_0x1f4c9f);})['then'](function(_0x97be57){_0x29e283['fields'][_0x0fd0('0x40')](_0x97be57);return parseReadParameter(_0x5d0ee7[_0x0fd0('0x3f')]);})[_0x0fd0('0x5b')](function(_0x39df1f){_0x29e283[_0x0fd0('0x3f')][_0x0fd0('0x40')](_0x39df1f);return parseTagParameter(_0x5d0ee7[_0x0fd0('0x5c')]);})[_0x0fd0('0x5b')](function(_0x16cb30){_0x29e283[_0x0fd0('0x4a')][_0x0fd0('0x4b')][_0x0fd0('0x40')](_0x16cb30);return parseSearchFilter(_0x12395e,_0x5d0ee7['filter']);})[_0x0fd0('0x5b')](function(_0x41e1f6){_0x29e283[_0x0fd0('0x5d')]=_0x41e1f6;return _0x29e283;});}function checkAccountsRestrictions(_0x1b95a8,_0x4594df,_0x333d4f){var _0xee1bf8=utils['getAccountFK'](_0x1b95a8);var _0x37edf0=_0x0fd0('0x5e')+_[_0x0fd0('0x5f')](_0x1b95a8)+(_0x1b95a8===_0x0fd0('0x60')?'Websites':_0x0fd0('0x61'));var _0x26d573=squel['expr']();return Promise[_0x0fd0('0x62')]()[_0x0fd0('0x5b')](function(){if(_0x333d4f[_0x0fd0('0x63')]&&_0x4594df[_0x0fd0('0x6')]===_0x0fd0('0x7')){return _0x4594df[_0x37edf0]({'attributes':['id'],'raw':!![]});}})[_0x0fd0('0x5b')](function(_0xc11c17){if(_0xc11c17){if(_0xc11c17[_0x0fd0('0x14')]===0x0){_0x26d573[_0x0fd0('0x40')]('i.'+_0xee1bf8+_0x0fd0('0x64'));}else{_0x26d573[_0x0fd0('0x40')]('i.'+_0xee1bf8+_0x0fd0('0x16'),_['map'](_0xc11c17,'id'));}}else if(!_0x333d4f[_0xee1bf8]){_0x26d573['and']('i.'+_0xee1bf8+_0x0fd0('0x65'));}})['then'](function(){return _0x26d573;});}function getClosedOrderClause(_0xde2dfe,_0x203c4f){var _0x248b9a='';var _0x17be6b=[_0x0fd0('0x66'),_0x0fd0('0x67'),_0x0fd0('0x68')];if(_0xde2dfe===_0x0fd0('0x32')){_0x17be6b[_0x0fd0('0x69')]('i.substatus');}if(_0x203c4f[_0x0fd0('0x6a')]==='0'&&_0xde2dfe===_0x0fd0('0x32')){_0x248b9a=_0x0fd0('0x6b');}else{if(_0x203c4f[_0x0fd0('0x6a')]==='1'){_0x17be6b[_0x0fd0('0x6c')]();}_0x248b9a='CONCAT_WS(\x27\x27,\x20'+_0x17be6b['join'](',\x20')+')';}return _0x248b9a;}function getFilteredInteractions(_0x23d49e,_0x38d224,_0x136feb,_0x1ea38f){var _0x51abb4=utils[_0x0fd0('0x6d')](_0x23d49e);var _0x4111ba=_[_0x0fd0('0x5f')](_0x23d49e)+_0x0fd0('0x6e');var _0x2cfde0=[];var _0x1555fd=getTagsQuery();var _0x1c360e={'type':db['Sequelize']['QueryTypes'][_0x0fd0('0x6f')],'raw':!![]};var _0x44b194=[];var _0x523758=[];return db[_0x0fd0('0x70')][_0x0fd0('0x71')](_0x1555fd[_0x0fd0('0x72')](),_0x1c360e)[_0x0fd0('0x5b')](function(_0x167657){_0x2cfde0=_[_0x0fd0('0x73')](_0x167657,'id');_0x1c360e=_[_0x0fd0('0x74')](_0x1c360e,{'model':db[_0x4111ba],'mapToModel':!![],'nest':!![]});if(_0x136feb[_0x0fd0('0x75')]){_0x1ea38f[_0x0fd0('0x76')][_0x0fd0('0x54')](function(_0x140378){_0x38d224['field']('i.'+_0x140378);});}else{_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x77'),_0x0fd0('0x3e'));_0x38d224[_0x0fd0('0x9')]('a.key',_0x0fd0('0x78'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x79'),_0x0fd0('0x7a'));if(_0x23d49e===_0x0fd0('0x32')){_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x7b'),_0x0fd0('0x7c'));_0x38d224[_0x0fd0('0x9')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x7d'));_0x38d224['field']('i.createdAt');_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x7e'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x7f'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x80'));_0x38d224[_0x0fd0('0x9')]('i.attach');_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x81'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x82'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x83'));_0x38d224[_0x0fd0('0x9')]('i.disposition');_0x38d224['field'](_0x0fd0('0x67'));_0x38d224[_0x0fd0('0x9')]('i.thirdDisposition');_0x38d224['field']('i.substatus');_0x38d224[_0x0fd0('0x9')]('i.to');_0x38d224['field'](_0x0fd0('0x84'));_0x38d224[_0x0fd0('0x9')]('i.MailAccountId');_0x38d224['field'](_0x0fd0('0x85'));}else if(_0x23d49e===_0x0fd0('0x30')){_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x86'),_0x0fd0('0x87'));}else{_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x88'),_0x0fd0('0x87'));}if(_0x23d49e!=='mail'){_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x89'));}_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x8a'),_0x0fd0('0x8b'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x8c'),_0x0fd0('0x8d'));_0x38d224[_0x0fd0('0x9')]('c.email',_0x0fd0('0x8e'));_0x38d224['field'](_0x0fd0('0x8f'),_0x0fd0('0x90'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x91'),'Contact.mobile');_0x38d224[_0x0fd0('0x9')]('c.fax',_0x0fd0('0x92'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x93'),'Owner.fullname');_0x38d224['field'](_0x0fd0('0x94'),'Owner.internal');_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x95'),_0x0fd0('0x96'));}if(_0x1ea38f['limit']){_0x38d224[_0x0fd0('0x97')](_0x1ea38f[_0x0fd0('0x97')]);}if(_0x1ea38f['offset']){_0x38d224[_0x0fd0('0x98')](_0x1ea38f['offset']);}return db[_0x0fd0('0x70')][_0x0fd0('0x71')](_0x38d224[_0x0fd0('0x72')](),_0x1c360e);})[_0x0fd0('0x5b')](function(_0x419494){_0x44b194=_0x419494;var _0x49417e=getUsersQuery(_0x23d49e,_0x44b194);return db[_0x0fd0('0x70')][_0x0fd0('0x71')](_0x49417e['toString'](),_0x1c360e);})[_0x0fd0('0x5b')](function(_0x599ab9){_0x523758=_[_0x0fd0('0x99')](_0x599ab9,_0x51abb4);if(_0x23d49e===_0x0fd0('0x32')){return db['Setting'][_0x0fd0('0x9a')]({'attributes':[_0x0fd0('0x9b')],'raw':!![]});}})[_0x0fd0('0x5b')](function(_0x252b87){var _0x328ee3=_0x252b87?_0x252b87[_0x0fd0('0x9b')]:undefined;var _0x13db56=_0x44b194['map'](function(_0x1008f8){return updateInteraction(_0x1008f8,_0x2cfde0,_0x523758,_0x328ee3);});return Promise[_0x0fd0('0x9c')](_0x13db56);});}function countFilteredInteractions(_0x346437,_0xbe1bc9){var _0x5c12b2=_0x346437[_0x0fd0('0x9d')]();_0x5c12b2[_0x0fd0('0x9')](_0x0fd0('0x9e'));_0x5c12b2[_0x0fd0('0x9')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0fd0('0x3e'));var _0x27a8dd=utils[_0x0fd0('0x25')](_0xbe1bc9);if(!_[_0x0fd0('0x9f')](_0x27a8dd)){_0x5c12b2[_0x0fd0('0x15')](_0x0fd0('0xa0'),_0x27a8dd);}var _0x3ff9e4={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};return db[_0x0fd0('0x70')][_0x0fd0('0x71')](_0x5c12b2[_0x0fd0('0x72')](),_0x3ff9e4);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xcb3d=['shift','capitalize','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','attributes','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.id','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.UserId','contactName','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','color','from','getInteractionFK','user_has_','u.id','u.fullname','ui.','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','getInteractionsTables','interactions','left_join','cm_contacts','users','accounts','messages','me.','interactionsTags','tools_tags','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','replace','{OPERATOR}','i.id\x20LIKE\x20?','whatsapp','includes','i.phone\x20LIKE\x20?','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','fax','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','type','default','text','value','start','end','unreadMessages','and','Contact','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','name','ContactId','buildExpression','Tag','map','tags','ids','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','plainBody','body','keys','compact','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','read','tag','filter','get','chat','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed'];(function(_0x42b552,_0x40cf05){var _0x520bca=function(_0x9cd2c9){while(--_0x9cd2c9){_0x42b552['push'](_0x42b552['shift']());}};_0x520bca(++_0x40cf05);}(_0xcb3d,0xda));var _0xdcb3=function(_0x489735,_0x10a225){_0x489735=_0x489735-0x0;var _0x56558b=_0xcb3d[_0x489735];return _0x56558b;};'use strict';var _=require(_0xdcb3('0x0'));var squel=require(_0xdcb3('0x1'));var as=require(_0xdcb3('0x2'));var qs=require(_0xdcb3('0x3'));var updateInteraction=require(_0xdcb3('0x4'))['updateInteraction'];var utils=require(_0xdcb3('0x5'));var db=require(_0xdcb3('0x6'))['db'];function skipInteractionsQuery(_0x3c50b2,_0x24685a,_0xf26c7b){var _0x5a6717=![];var _0x6d1554=utils[_0xdcb3('0x7')](_0x3c50b2);if(_0x24685a[_0xdcb3('0x8')]===_0xdcb3('0x9')&&!_0xf26c7b[_0xdcb3('0xa')]&&!_0xf26c7b[_0x6d1554]){_0x5a6717=!![];}return _0x5a6717;}function getTagsQuery(){return squel[_0xdcb3('0xb')]()['field']('id')[_0xdcb3('0xc')]('name')[_0xdcb3('0xc')](_0xdcb3('0xd'))[_0xdcb3('0xe')]('tools_tags');}function getUsersQuery(_0x2b7611,_0x57b65e){var _0x5283f2=utils[_0xdcb3('0xf')](_0x2b7611);var _0x5aeac9=_0xdcb3('0x10')+_0x2b7611+'_interactions';var _0x11ce2a=squel[_0xdcb3('0xb')]()[_0xdcb3('0xc')](_0xdcb3('0x11'))[_0xdcb3('0xc')](_0xdcb3('0x12'))[_0xdcb3('0xc')](_0xdcb3('0x13')+_0x5283f2)['from'](_0x5aeac9,'ui')['left_join']('users','u',_0xdcb3('0x14'));if(_0x57b65e[_0xdcb3('0x15')]>0x0){_0x11ce2a[_0xdcb3('0x16')](_0xdcb3('0x13')+_0x5283f2+_0xdcb3('0x17'),_['map'](_0x57b65e,'id'));}return _0x11ce2a;}function getInteractionsQuery(_0x4d3da4){var _0x4ce7ce=utils[_0xdcb3('0x18')](_0x4d3da4);var _0x2ccd07=utils[_0xdcb3('0x7')](_0x4d3da4);var _0x1f4b66=utils[_0xdcb3('0xf')](_0x4d3da4);return squel[_0xdcb3('0xb')]()[_0xdcb3('0xe')](_0x4ce7ce[_0xdcb3('0x19')],'i')[_0xdcb3('0x1a')](_0xdcb3('0x1b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xdcb3('0x1a')](_0xdcb3('0x1c'),'o','o.id\x20=\x20i.UserId')[_0xdcb3('0x1a')](_0x4ce7ce[_0xdcb3('0x1d')],'a','a.id\x20=\x20i.'+_0x2ccd07)[_0xdcb3('0x1a')](_0x4ce7ce[_0xdcb3('0x1e')],'me',_0xdcb3('0x1f')+_0x1f4b66+'\x20=\x20i.id')[_0xdcb3('0x1a')](_0x4ce7ce[_0xdcb3('0x20')],'it','it.'+_0x1f4b66+'\x20=\x20i.id')[_0xdcb3('0x1a')](_0xdcb3('0x21'),'t',_0xdcb3('0x22'));}function getSqlClauses(){var _0x418192={'body':squel[_0xdcb3('0x23')](),'contact':squel[_0xdcb3('0x23')](),'default':squel[_0xdcb3('0x23')](),'fields':squel[_0xdcb3('0x23')](),'filter':squel[_0xdcb3('0x23')](),'read':squel['expr'](),'tags':{'clause':squel[_0xdcb3('0x23')](),'ids':null},'user':squel[_0xdcb3('0x23')]()};return _0x418192;}function parseTagParameter(_0x4b7e17){var _0x310f74=squel[_0xdcb3('0x23')]();if(_0x4b7e17){var _0x1d717f=utils[_0xdcb3('0x24')](_0x4b7e17);_0x1d717f[_0xdcb3('0x25')](function(_0x254b7f){_0x310f74['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x254b7f+',%');});}return _0x310f74;}function parseReadParameter(_0x2cff4b){var _0x522ea9='';if(_0x2cff4b){_0x522ea9='unreadMessages\x20{OPERATOR}\x200';if(_0x2cff4b==='1'){_0x522ea9=_0x522ea9[_0xdcb3('0x26')](_0xdcb3('0x27'),'=');}else{_0x522ea9=_0x522ea9[_0xdcb3('0x26')](_0xdcb3('0x27'),'>');}}return _0x522ea9;}function parseSearchFilter(_0x530ee6,_0x3783f9){var _0x3d85a7=squel[_0xdcb3('0x23')]();if(_0x3783f9){var _0x3d6e50=_0x3783f9['replace']('\x5c','\x5c\x5c')[_0xdcb3('0x26')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3d6e50)){_0x3d85a7['or'](_0xdcb3('0x28'),_0x3d6e50+'%');if(['sms',_0xdcb3('0x29')][_0xdcb3('0x2a')](_0x530ee6)){_0x3d85a7['or'](_0xdcb3('0x2b'),_0x3d6e50+'%');}else if(_0x530ee6==='fax'){_0x3d85a7['or'](_0xdcb3('0x2c'),_0x3d6e50+'%');}else if(_0x530ee6===_0xdcb3('0x2d')){_0x3d85a7['or'](_0xdcb3('0x2e'),_0x3d6e50+'%');}}else if(_0x530ee6===_0xdcb3('0x2f')&&qs[_0xdcb3('0x30')](_0x3d6e50)){_0x3d85a7['or'](_0xdcb3('0x31'),_0x3d6e50+'%');}else{if(_0x530ee6===_0xdcb3('0x2f')){_0x3d85a7['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xdcb3('0x32')](_0x3d6e50,!![]))['or'](_0xdcb3('0x33'),qs['getFullTextValue'](_0x3d6e50));}else if(_0x530ee6!==_0xdcb3('0x34')){_0x3d85a7['or'](_0xdcb3('0x35'),qs[_0xdcb3('0x32')](_0x3d6e50));}_0x3d85a7['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xdcb3('0x32')](_0x3d6e50,!![]),null);}}return _0x3d85a7;}function parseAdvancedSearchFilter(_0x428fc7,_0x338bcd){var _0x3f9660=getSqlClauses();var _0x4242db=as[_0xdcb3('0x36')](_0x428fc7);var _0x5588c4=_0x4242db[_0xdcb3('0x37')];for(var _0x4416a8=0x0;_0x4416a8<_0x4242db[_0xdcb3('0x38')]['length'];_0x4416a8++){var _0x5ae3c=_0x4242db['conditions'][_0x4416a8];var _0x2a9579='i';var _0xd06a1d=_[_0xdcb3('0x39')](_0x338bcd,['name',_0x5ae3c[_0xdcb3('0xc')]]);if(_0xd06a1d){var _0x72ad8a=as['buildExpression'](_0x2a9579,_0xd06a1d[_0xdcb3('0x3a')],_0x5ae3c);_0x3f9660[_0xdcb3('0x3b')][_0x5588c4](_0x72ad8a[_0xdcb3('0x3c')],_0x72ad8a[_0xdcb3('0x3d')][_0xdcb3('0x3e')],_0x72ad8a[_0xdcb3('0x3d')][_0xdcb3('0x3f')]);}else{switch(_0x5ae3c['field']){case _0xdcb3('0x40'):var _0xcd2d14=parseReadParameter(_0x5ae3c[_0xdcb3('0x3d')]);_0x3f9660['read'][_0xdcb3('0x41')](_0xcd2d14);break;case _0xdcb3('0x42'):if(_0x5ae3c['operator']===_0xdcb3('0x43')){if(_0x5ae3c[_0xdcb3('0x3d')][_0xdcb3('0x44')]('\x20')['length']>0x1){_0x3f9660[_0xdcb3('0x45')][_0x5588c4](_0xdcb3('0x46'),qs['getFullTextValue'](_0x5ae3c[_0xdcb3('0x3d')],!![]),null);}else{var _0x31fd60='%'+_0x5ae3c[_0xdcb3('0x3d')]+'%';_0x3f9660[_0xdcb3('0x45')][_0x5588c4]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x31fd60,_0x31fd60,_0x31fd60);}}else{_0xd06a1d=_[_0xdcb3('0x39')](_0x338bcd,[_0xdcb3('0x47'),_0xdcb3('0x48')]);_0x5ae3c[_0xdcb3('0xc')]=_0xdcb3('0x48');_0x72ad8a=as[_0xdcb3('0x49')](_0x2a9579,_0xd06a1d[_0xdcb3('0x3a')],_0x5ae3c);_0x3f9660[_0xdcb3('0x45')][_0x5588c4](_0x72ad8a[_0xdcb3('0x3c')],_0x72ad8a[_0xdcb3('0x3d')][_0xdcb3('0x3e')],_0x72ad8a[_0xdcb3('0x3d')][_0xdcb3('0x3f')]);}break;case _0xdcb3('0x4a'):var _0x164065=_0x5ae3c[_0xdcb3('0x3d')]['split'](',')[_0xdcb3('0x4b')](function(_0x539e7f){return Number(_0x539e7f);});var _0x31a48d=parseTagParameter(_0x164065);_0x3f9660[_0xdcb3('0x4c')]['clause'][_0xdcb3('0x41')](_0x31a48d);_0x3f9660[_0xdcb3('0x4c')][_0xdcb3('0x4d')]=_0x164065;break;case _0xdcb3('0x4e'):if(_0x5ae3c[_0xdcb3('0x4f')]===_0xdcb3('0x43')){_0x3f9660['user'][_0x5588c4](_0xdcb3('0x50'),'%'+_0x5ae3c['value']+'%',null);}else{_0xd06a1d=_[_0xdcb3('0x39')](_0x338bcd,['name',_0xdcb3('0x51')]);_0x5ae3c['field']=_0xdcb3('0x51');_0x72ad8a=as[_0xdcb3('0x49')](_0x2a9579,_0xd06a1d[_0xdcb3('0x3a')],_0x5ae3c);_0x3f9660[_0xdcb3('0x52')][_0x5588c4](_0x72ad8a['text'],_0x72ad8a['value'][_0xdcb3('0x3e')],_0x72ad8a[_0xdcb3('0x3d')][_0xdcb3('0x3f')]);}break;case'body':case _0xdcb3('0x53'):_0x72ad8a=as['buildExpression']('me',null,_0x5ae3c);_0x3f9660[_0xdcb3('0x54')][_0x5588c4](_0x72ad8a[_0xdcb3('0x3c')],_0x72ad8a[_0xdcb3('0x3d')][_0xdcb3('0x3e')],_0x72ad8a[_0xdcb3('0x3d')]['end']);break;}}}return _0x3f9660;}function parseModelFields(_0x11af48,_0x46fa0f,_0x585e9a){var _0x3bb64e=utils[_0xdcb3('0x7')](_0x11af48);var _0x589b4f=squel['expr']();var _0x13ee51=_(_0x46fa0f)[_0xdcb3('0x55')]()[_0xdcb3('0x4b')](function(_0x30aed8){return _['some'](_0x585e9a,[_0xdcb3('0x47'),_0x30aed8])?_0x30aed8:undefined;})[_0xdcb3('0x56')]()[_0xdcb3('0x3d')]();if(_0x13ee51['length']>0x0){_0x13ee51[_0xdcb3('0x25')](function(_0x389958){if(_0x389958===_0x3bb64e){_0x589b4f[_0xdcb3('0x41')]('i.'+_0x3bb64e+'\x20IN\x20?',[][_0xdcb3('0x57')](_0x46fa0f[_0x389958]));}else if(_0x389958===_0xdcb3('0x58')){var _0x518f19=JSON[_0xdcb3('0x59')](_0x46fa0f[_0x389958])[_0xdcb3('0x5a')];var _0x1d9376=JSON['parse'](_0x46fa0f[_0x389958])[_0xdcb3('0x5b')];_0x589b4f['and']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x518f19,_0x1d9376);}else{if(_0x46fa0f[_0x389958]===_0xdcb3('0x5c')){_0x589b4f['and']('i.'+_0x389958+_0xdcb3('0x5d'));}else{_0x589b4f[_0xdcb3('0x41')]('i.'+_0x389958+_0xdcb3('0x5e'),_0x46fa0f[_0x389958]);}}});}return _0x589b4f;}function parseQueryParameters(_0x576684,_0x329d0b,_0x211533){var _0x1fc8c9=getSqlClauses();return Promise[_0xdcb3('0x5f')]()[_0xdcb3('0x60')](function(){return parseModelFields(_0x576684,_0x329d0b,_0x211533);})[_0xdcb3('0x60')](function(_0x378390){_0x1fc8c9[_0xdcb3('0x61')][_0xdcb3('0x41')](_0x378390);return parseReadParameter(_0x329d0b[_0xdcb3('0x62')]);})[_0xdcb3('0x60')](function(_0x101e07){_0x1fc8c9[_0xdcb3('0x62')]['and'](_0x101e07);return parseTagParameter(_0x329d0b[_0xdcb3('0x63')]);})[_0xdcb3('0x60')](function(_0x58ed7c){_0x1fc8c9[_0xdcb3('0x4c')]['clause'][_0xdcb3('0x41')](_0x58ed7c);return parseSearchFilter(_0x576684,_0x329d0b[_0xdcb3('0x64')]);})['then'](function(_0x246cc9){_0x1fc8c9[_0xdcb3('0x64')]=_0x246cc9;return _0x1fc8c9;});}function checkAccountsRestrictions(_0x4d0c22,_0x26c621,_0xf22310){var _0x2466ae=utils[_0xdcb3('0x7')](_0x4d0c22);var _0x38efbd=_0xdcb3('0x65')+_['capitalize'](_0x4d0c22)+(_0x4d0c22===_0xdcb3('0x66')?'Websites':'Accounts');var _0x69c50a=squel['expr']();return Promise[_0xdcb3('0x5f')]()[_0xdcb3('0x60')](function(){if(_0xf22310[_0xdcb3('0xa')]&&_0x26c621[_0xdcb3('0x8')]===_0xdcb3('0x9')){return _0x26c621[_0x38efbd]({'attributes':['id'],'raw':!![]});}})[_0xdcb3('0x60')](function(_0x52b505){if(_0x52b505){if(_0x52b505[_0xdcb3('0x15')]===0x0){_0x69c50a[_0xdcb3('0x41')]('i.'+_0x2466ae+_0xdcb3('0x5d'));}else{_0x69c50a[_0xdcb3('0x41')]('i.'+_0x2466ae+_0xdcb3('0x17'),_[_0xdcb3('0x4b')](_0x52b505,'id'));}}else if(!_0xf22310[_0x2466ae]){_0x69c50a[_0xdcb3('0x41')]('i.'+_0x2466ae+_0xdcb3('0x67'));}})[_0xdcb3('0x60')](function(){return _0x69c50a;});}function getClosedOrderClause(_0x53d83a,_0x227d7c){var _0x254373='';var _0x5e1126=[_0xdcb3('0x68'),_0xdcb3('0x69'),_0xdcb3('0x6a')];if(_0x53d83a===_0xdcb3('0x2f')){_0x5e1126[_0xdcb3('0x6b')](_0xdcb3('0x6c'));}if(_0x227d7c[_0xdcb3('0x6d')]==='0'&&_0x53d83a===_0xdcb3('0x2f')){_0x254373=_0xdcb3('0x6c');}else{if(_0x227d7c[_0xdcb3('0x6d')]==='1'){_0x5e1126[_0xdcb3('0x6e')]();}_0x254373='CONCAT_WS(\x27\x27,\x20'+_0x5e1126['join'](',\x20')+')';}return _0x254373;}function getFilteredInteractions(_0xb61e5b,_0x5bc99c,_0x5ded8c,_0x4f7dc5){var _0x41fc7f=utils['getInteractionFK'](_0xb61e5b);var _0x478053=_[_0xdcb3('0x6f')](_0xb61e5b)+_0xdcb3('0x70');var _0x102bf3=[];var _0xd4da1f=getTagsQuery();var _0x58bbad={'type':db[_0xdcb3('0x71')][_0xdcb3('0x72')][_0xdcb3('0x73')],'raw':!![]};var _0x1f6aa8=[];var _0x4efd3b=[];return db[_0xdcb3('0x74')][_0xdcb3('0x75')](_0xd4da1f[_0xdcb3('0x76')](),_0x58bbad)['then'](function(_0xaa0ccf){_0x102bf3=_['keyBy'](_0xaa0ccf,'id');_0x58bbad=_['merge'](_0x58bbad,{'model':db[_0x478053],'mapToModel':!![],'nest':!![]});if(_0x5ded8c[_0xdcb3('0x61')]){_0x4f7dc5[_0xdcb3('0x77')][_0xdcb3('0x25')](function(_0x3b5283){_0x5bc99c['field']('i.'+_0x3b5283);});}else{_0x5bc99c[_0xdcb3('0xc')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xdcb3('0x40'));_0x5bc99c[_0xdcb3('0xc')]('a.key',_0xdcb3('0x78'));_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x79'),_0xdcb3('0x7a'));if(_0xb61e5b===_0xdcb3('0x2f')){_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x7b'),_0xdcb3('0x7c'));_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x7d'),'contactName');_0x5bc99c['field'](_0xdcb3('0x7e'));_0x5bc99c[_0xdcb3('0xc')]('i.createdAt');_0x5bc99c['field'](_0xdcb3('0x7f'));_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x80'));_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x81'));_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x82'));_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x83'));_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x84'));_0x5bc99c['field'](_0xdcb3('0x85'));_0x5bc99c['field'](_0xdcb3('0x6a'));_0x5bc99c['field'](_0xdcb3('0x69'));_0x5bc99c['field']('i.thirdDisposition');_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x6c'));_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x86'));_0x5bc99c['field'](_0xdcb3('0x87'));_0x5bc99c[_0xdcb3('0xc')]('i.MailAccountId');_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x88'));}else if(_0xb61e5b===_0xdcb3('0x2d')){_0x5bc99c[_0xdcb3('0xc')]('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',_0xdcb3('0x89'));}else{_0x5bc99c[_0xdcb3('0xc')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}if(_0xb61e5b!==_0xdcb3('0x2f')){_0x5bc99c[_0xdcb3('0xc')]('i.*');}_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x8a'),_0xdcb3('0x8b'));_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x8c'),_0xdcb3('0x8d'));_0x5bc99c[_0xdcb3('0xc')]('c.email','Contact.email');_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x8e'),_0xdcb3('0x8f'));_0x5bc99c['field'](_0xdcb3('0x90'),'Contact.mobile');_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x91'),_0xdcb3('0x92'));_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x93'),'Owner.fullname');_0x5bc99c['field'](_0xdcb3('0x94'),_0xdcb3('0x95'));_0x5bc99c[_0xdcb3('0xc')](_0xdcb3('0x96'),_0xdcb3('0x97'));}if(_0x4f7dc5[_0xdcb3('0x98')]){_0x5bc99c[_0xdcb3('0x98')](_0x4f7dc5[_0xdcb3('0x98')]);}if(_0x4f7dc5[_0xdcb3('0x99')]){_0x5bc99c[_0xdcb3('0x99')](_0x4f7dc5[_0xdcb3('0x99')]);}return db[_0xdcb3('0x74')][_0xdcb3('0x75')](_0x5bc99c[_0xdcb3('0x76')](),_0x58bbad);})[_0xdcb3('0x60')](function(_0x568eb6){_0x1f6aa8=_0x568eb6;var _0x3c99bc=getUsersQuery(_0xb61e5b,_0x1f6aa8);return db['sequelize'][_0xdcb3('0x75')](_0x3c99bc[_0xdcb3('0x76')](),_0x58bbad);})[_0xdcb3('0x60')](function(_0x4942b7){_0x4efd3b=_[_0xdcb3('0x9a')](_0x4942b7,_0x41fc7f);if(_0xb61e5b===_0xdcb3('0x2f')){return db[_0xdcb3('0x9b')][_0xdcb3('0x9c')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0xdcb3('0x60')](function(_0x206c9a){var _0x13c1f7=_0x206c9a?_0x206c9a[_0xdcb3('0x9d')]:undefined;var _0x2f564c=_0x1f6aa8[_0xdcb3('0x4b')](function(_0x2279f6){return updateInteraction(_0x2279f6,_0x102bf3,_0x4efd3b,_0x13c1f7);});return Promise[_0xdcb3('0x9e')](_0x2f564c);});}function countFilteredInteractions(_0x2406fd,_0x431ff7){var _0x2e38cc=_0x2406fd[_0xdcb3('0x9f')]();_0x2e38cc[_0xdcb3('0xc')](_0xdcb3('0xa0'));_0x2e38cc['field'](_0xdcb3('0xa1'),'unreadMessages');var _0x5a23c7=utils[_0xdcb3('0x24')](_0x431ff7);if(!_[_0xdcb3('0xa2')](_0x5a23c7)){_0x2e38cc[_0xdcb3('0x16')]('t.id\x20IN\x20?',_0x5a23c7);}var _0x461f1f={'type':db[_0xdcb3('0x71')][_0xdcb3('0x72')][_0xdcb3('0x73')],'raw':!![]};return db[_0xdcb3('0x74')][_0xdcb3('0x75')](_0x2e38cc[_0xdcb3('0x76')](),_0x461f1f);}module[_0xdcb3('0xa3')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 4db9c0c..e262c04 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa45a=['total','closed','disposition','UserId','findOne','plainBody','-id','updateInteraction','then','Users','TagIds','Tags','catch','lodash','../../mysqldb','map','fullname','split','forEach','waiting','talking','answered','unmanaged','abandoned'];(function(_0x53a453,_0xfbe94d){var _0x4ba28b=function(_0x10c1b9){while(--_0x10c1b9){_0x53a453['push'](_0x53a453['shift']());}};_0x4ba28b(++_0xfbe94d);}(_0xa45a,0x145));var _0xaa45=function(_0x64d881,_0x1e95b0){_0x64d881=_0x64d881-0x0;var _0x53eb8f=_0xa45a[_0x64d881];return _0x53eb8f;};'use strict';var _=require(_0xaa45('0x0'));var db=require(_0xaa45('0x1'))['db'];function getInteractionUsers(_0x38e74,_0x3a84fc){return new Promise(function(_0x586f95,_0xe64234){try{var _0x40bf97=[];if(_0x3a84fc[_0x38e74]){_0x40bf97=_0x3a84fc[_0x38e74][_0xaa45('0x2')](function(_0x44f0ac){return{'id':_0x44f0ac['id'],'fullname':_0x44f0ac[_0xaa45('0x3')]};});}return _0x586f95(_0x40bf97);}catch(_0xc3be8e){_0xe64234(_0xc3be8e);}});}function getInteractionTags(_0x3598c2,_0x172c92){var _0x2be6c6=[];if(_0x3598c2){_0x3598c2[_0xaa45('0x4')](',')[_0xaa45('0x5')](function(_0x5cdbb9){_0x2be6c6['push'](_0x172c92[_0x5cdbb9]);});}return _0x2be6c6;}function updateWaitingCounter(_0x5eb04f){if(_0x5eb04f[_0xaa45('0x6')]){_0x5eb04f[_0xaa45('0x6')]-=0x1;}}function updateInteractionCounters(_0x16541b){_0x16541b[_0xaa45('0x6')]=0x0;_0x16541b[_0xaa45('0x7')]=0x0;_0x16541b[_0xaa45('0x8')]=0x0;_0x16541b[_0xaa45('0x9')]=0x0;_0x16541b[_0xaa45('0xa')]=0x0;_0x16541b[_0xaa45('0xb')]=0x0;if(_0x16541b[_0xaa45('0xc')]){if(_0x16541b[_0xaa45('0xd')]===_0xaa45('0xa')){_0x16541b[_0xaa45('0xa')]+=0x1;updateWaitingCounter(_0x16541b);}if(_0x16541b[_0xaa45('0xe')]){_0x16541b[_0xaa45('0x8')]+=0x1;if(_0x16541b[_0xaa45('0x7')]){_0x16541b['talking']-=0x1;}}else{if(_0x16541b['disposition']){_0x16541b[_0xaa45('0x9')]+=0x1;updateWaitingCounter(_0x16541b);}}}else{if(!_0x16541b[_0xaa45('0xe')]){_0x16541b[_0xaa45('0x6')]+=0x1;}if(_0x16541b['UserId']){_0x16541b[_0xaa45('0x7')]+=0x1;updateWaitingCounter(_0x16541b);}}_0x16541b[_0xaa45('0xb')]+=0x1;return _0x16541b;}function getLastMessageText(_0x2d5b75){return db['MailMessage'][_0xaa45('0xf')]({'where':{'$and':[{'MailInteractionId':_0x2d5b75['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xaa45('0x10')],'order':_0xaa45('0x11'),'raw':!![]})['then'](function(_0x2f243c){if(_0x2f243c&&_0x2f243c[_0xaa45('0x10')]){_0x2d5b75['lastMsgText']=_['trimStart'](_0x2f243c[_0xaa45('0x10')]);}return _0x2d5b75;})['catch'](function(_0x6cf2d6){throw _0x6cf2d6;});}exports[_0xaa45('0x12')]=function(_0x380a8d,_0x260505,_0x5051e5,_0x54b471){return new Promise(function(_0x574b16,_0x52ee44){return getInteractionUsers(_0x380a8d['id'],_0x5051e5)[_0xaa45('0x13')](function(_0x45312a){_0x380a8d[_0xaa45('0x14')]=_0x45312a;return getInteractionTags(_0x380a8d[_0xaa45('0x15')],_0x260505);})[_0xaa45('0x13')](function(_0x50f4dd){_0x380a8d[_0xaa45('0x16')]=_0x50f4dd;delete _0x380a8d['TagIds'];return updateInteractionCounters(_0x380a8d);})[_0xaa45('0x13')](function(_0x2037df){if(_0x54b471){return getLastMessageText(_0x2037df);}else{return _0x2037df;}})[_0xaa45('0x13')](function(_0xaa106b){_0x574b16(_0xaa106b);})[_0xaa45('0x17')](function(_0x2da25a){_0x52ee44(_0x2da25a);});});}; \ No newline at end of file +var _0x8ef2=['lodash','../../mysqldb','fullname','forEach','push','waiting','talking','abandoned','total','closed','disposition','UserId','answered','unmanaged','MailMessage','findOne','out','plainBody','catch','updateInteraction','then','Users','Tags'];(function(_0x3122bc,_0x27ebe8){var _0x116b76=function(_0x510199){while(--_0x510199){_0x3122bc['push'](_0x3122bc['shift']());}};_0x116b76(++_0x27ebe8);}(_0x8ef2,0x159));var _0x28ef=function(_0x4fe5b5,_0x41efab){_0x4fe5b5=_0x4fe5b5-0x0;var _0x221fbe=_0x8ef2[_0x4fe5b5];return _0x221fbe;};'use strict';var _=require(_0x28ef('0x0'));var db=require(_0x28ef('0x1'))['db'];function getInteractionUsers(_0x3b1559,_0x5d636e){return new Promise(function(_0x1ba23f,_0x8e70be){try{var _0x5de854=[];if(_0x5d636e[_0x3b1559]){_0x5de854=_0x5d636e[_0x3b1559]['map'](function(_0x14487b){return{'id':_0x14487b['id'],'fullname':_0x14487b[_0x28ef('0x2')]};});}return _0x1ba23f(_0x5de854);}catch(_0xdc0f11){_0x8e70be(_0xdc0f11);}});}function getInteractionTags(_0x4b170c,_0xc885d3){var _0x147824=[];if(_0x4b170c){_0x4b170c['split'](',')[_0x28ef('0x3')](function(_0x52b461){_0x147824[_0x28ef('0x4')](_0xc885d3[_0x52b461]);});}return _0x147824;}function updateWaitingCounter(_0xcb9dea){if(_0xcb9dea['waiting']){_0xcb9dea['waiting']-=0x1;}}function updateInteractionCounters(_0x5ebe56){_0x5ebe56[_0x28ef('0x5')]=0x0;_0x5ebe56[_0x28ef('0x6')]=0x0;_0x5ebe56['answered']=0x0;_0x5ebe56['unmanaged']=0x0;_0x5ebe56[_0x28ef('0x7')]=0x0;_0x5ebe56[_0x28ef('0x8')]=0x0;if(_0x5ebe56[_0x28ef('0x9')]){if(_0x5ebe56[_0x28ef('0xa')]==='abandoned'){_0x5ebe56['abandoned']+=0x1;updateWaitingCounter(_0x5ebe56);}if(_0x5ebe56[_0x28ef('0xb')]){_0x5ebe56[_0x28ef('0xc')]+=0x1;if(_0x5ebe56[_0x28ef('0x6')]){_0x5ebe56[_0x28ef('0x6')]-=0x1;}}else{if(_0x5ebe56[_0x28ef('0xa')]){_0x5ebe56[_0x28ef('0xd')]+=0x1;updateWaitingCounter(_0x5ebe56);}}}else{if(!_0x5ebe56['UserId']){_0x5ebe56[_0x28ef('0x5')]+=0x1;}if(_0x5ebe56[_0x28ef('0xb')]){_0x5ebe56[_0x28ef('0x6')]+=0x1;updateWaitingCounter(_0x5ebe56);}}_0x5ebe56[_0x28ef('0x8')]+=0x1;return _0x5ebe56;}function getLastMessageText(_0x102e96){return db[_0x28ef('0xe')][_0x28ef('0xf')]({'where':{'$and':[{'MailInteractionId':_0x102e96['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x28ef('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x28ef('0x11')],'order':'-id','raw':!![]})['then'](function(_0x520342){if(_0x520342&&_0x520342[_0x28ef('0x11')]){_0x102e96['lastMsgText']=_['trimStart'](_0x520342[_0x28ef('0x11')]);}return _0x102e96;})[_0x28ef('0x12')](function(_0x105060){throw _0x105060;});}exports[_0x28ef('0x13')]=function(_0x22f0e5,_0x79d817,_0x300457,_0x3ff1ad){return new Promise(function(_0x2310ef,_0x2ff644){return getInteractionUsers(_0x22f0e5['id'],_0x300457)[_0x28ef('0x14')](function(_0x31e209){_0x22f0e5[_0x28ef('0x15')]=_0x31e209;return getInteractionTags(_0x22f0e5['TagIds'],_0x79d817);})[_0x28ef('0x14')](function(_0x3aa382){_0x22f0e5[_0x28ef('0x16')]=_0x3aa382;delete _0x22f0e5['TagIds'];return updateInteractionCounters(_0x22f0e5);})[_0x28ef('0x14')](function(_0x48b627){if(_0x3ff1ad){return getLastMessageText(_0x48b627);}else{return _0x48b627;}})[_0x28ef('0x14')](function(_0x3b6077){_0x2310ef(_0x3b6077);})['catch'](function(_0x41a031){_0x2ff644(_0x41a031);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 526b733..78e2557 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x179c=['Website','Account','upperFirst','InteractionId','websites','accounts','_interaction_has_tags','_messages','user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','then','update','info','catch','error','exports','lodash','openchannel-interactions','mail-interactions','../../config/logger','chat-interactions','whatsapp-interactions','capitalize','chat'];(function(_0x461eaa,_0x5b9604){var _0x3f2756=function(_0xddf81a){while(--_0xddf81a){_0x461eaa['push'](_0x461eaa['shift']());}};_0x3f2756(++_0x5b9604);}(_0x179c,0x198));var _0xc179=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0x179c[_0x277107];return _0x1da046;};'use strict';var _=require(_0xc179('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0xc179('0x1')),'mail':require('../../config/logger')(_0xc179('0x2')),'fax':require(_0xc179('0x3'))('fax-interactions'),'sms':require(_0xc179('0x3'))('sms-interactions'),'chat':require('../../config/logger')(_0xc179('0x4')),'whatsapp':require(_0xc179('0x3'))(_0xc179('0x5'))};function getAccountFK(_0x14b933){return _[_0xc179('0x6')](_0x14b933)+(_0x14b933===_0xc179('0x7')?_0xc179('0x8'):_0xc179('0x9'))+'Id';}function getInteractionFK(_0x4678d3){return _[_0xc179('0x6')](_0x4678d3)+'InteractionId';}function getInteractionId(_0x53dad7,_0x1d123e,_0x4f6139){if(_0x53dad7&&_0x53dad7[_[_0xc179('0xa')](_0x4f6139)+_0xc179('0xb')]){return _0x53dad7[_[_0xc179('0xa')](_0x4f6139)+_0xc179('0xb')];}else if(_0x53dad7&&_0x53dad7['id']){return _0x53dad7['id'];}else if(_0x1d123e&&_0x1d123e['id']){return _0x1d123e['id'];}else{return'unknown';}}function getInteractionsTables(_0x485af9){return{'accounts':_0x485af9+'_'+(_0x485af9==='chat'?_0xc179('0xc'):_0xc179('0xd')),'interactions':_0x485af9+'_interactions','interactionsTags':_0x485af9+_0xc179('0xe'),'messages':_0x485af9+_0xc179('0xf'),'userInteractions':_0xc179('0x10')+_0x485af9+_0xc179('0x11')};}function getSelectedTags(_0x3a54f2){var _0x301d94=[];if(_0x3a54f2){_0x301d94=Array[_0xc179('0x12')](_0x3a54f2)?_0x3a54f2:[_0x3a54f2];}return _0x301d94;}function log(_0x138e04,_0x56a300,_0xef7277,_0x2472dc,_0x496ea7,_0x565db0){loggers[_0x496ea7[_0xc179('0x13')]()][_0x138e04](_0xc179('0x14'),_0x565db0[_0xc179('0x15')](),_0x56a300?_0x56a300['id']:null,_0x56a300?_0x56a300[_0xc179('0x16')]:null,_0x56a300?_0x56a300['role']:null,getInteractionId(_0xef7277,_0x2472dc,_0x496ea7),_0xef7277?JSON[_0xc179('0x17')](_0xef7277):_0xc179('0x18'));}function updateUser(_0x176aa2,_0x5af16e,_0x3c837b,_0x38ebe2,_0x57c053){db[_[_0xc179('0xa')](_0x38ebe2)+_0xc179('0x19')]['findOne']({'where':{'id':getInteractionId(_0x5af16e,_0x3c837b,_0x38ebe2)}})[_0xc179('0x1a')](function(_0x2acbfd){if(_0x2acbfd){return _0x2acbfd[_0xc179('0x1b')]({'UserId':_0x176aa2?_0x176aa2['id']:null});}})[_0xc179('0x1a')](function(_0x358f39){if(_0x358f39){log(_0xc179('0x1c'),_0x176aa2,_0x5af16e,_0x3c837b,_0x38ebe2,_0x57c053);}})[_0xc179('0x1d')](function(){log(_0xc179('0x1e'),_0x176aa2,_0x5af16e,_0x3c837b,_0x38ebe2,_0x57c053);});}module[_0xc179('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xd427=['whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','accounts','_interactions','_interaction_has_tags','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','Interaction','findOne','then','update','info','catch','exports','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions'];(function(_0x3e2d5f,_0x12b652){var _0x417688=function(_0x50aaa4){while(--_0x50aaa4){_0x3e2d5f['push'](_0x3e2d5f['shift']());}};_0x417688(++_0x12b652);}(_0xd427,0x1bb));var _0x7d42=function(_0x4a87e8,_0x1a4911){_0x4a87e8=_0x4a87e8-0x0;var _0x33f4cf=_0xd427[_0x4a87e8];return _0x33f4cf;};'use strict';var _=require(_0x7d42('0x0'));var db=require(_0x7d42('0x1'))['db'];var loggers={'openchannel':require(_0x7d42('0x2'))('openchannel-interactions'),'mail':require(_0x7d42('0x2'))(_0x7d42('0x3')),'fax':require(_0x7d42('0x2'))(_0x7d42('0x4')),'sms':require(_0x7d42('0x2'))('sms-interactions'),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0x7d42('0x2'))(_0x7d42('0x5'))};function getAccountFK(_0x3c72ea){return _[_0x7d42('0x6')](_0x3c72ea)+(_0x3c72ea===_0x7d42('0x7')?_0x7d42('0x8'):_0x7d42('0x9'))+'Id';}function getInteractionFK(_0x1d9b35){return _[_0x7d42('0x6')](_0x1d9b35)+_0x7d42('0xa');}function getInteractionId(_0x5bf7c1,_0x62d302,_0x4a697e){if(_0x5bf7c1&&_0x5bf7c1[_[_0x7d42('0xb')](_0x4a697e)+_0x7d42('0xa')]){return _0x5bf7c1[_[_0x7d42('0xb')](_0x4a697e)+_0x7d42('0xa')];}else if(_0x5bf7c1&&_0x5bf7c1['id']){return _0x5bf7c1['id'];}else if(_0x62d302&&_0x62d302['id']){return _0x62d302['id'];}else{return'unknown';}}function getInteractionsTables(_0x2774ed){return{'accounts':_0x2774ed+'_'+(_0x2774ed===_0x7d42('0x7')?'websites':_0x7d42('0xc')),'interactions':_0x2774ed+_0x7d42('0xd'),'interactionsTags':_0x2774ed+_0x7d42('0xe'),'messages':_0x2774ed+'_messages','userInteractions':_0x7d42('0xf')+_0x2774ed+'_interactions'};}function getSelectedTags(_0xb216c7){var _0xed3ef9=[];if(_0xb216c7){_0xed3ef9=Array[_0x7d42('0x10')](_0xb216c7)?_0xb216c7:[_0xb216c7];}return _0xed3ef9;}function log(_0x268afa,_0x1a5ed8,_0x213606,_0x16612d,_0x2463b4,_0x4e1187){loggers[_0x2463b4[_0x7d42('0x11')]()][_0x268afa](_0x7d42('0x12'),_0x4e1187[_0x7d42('0x13')](),_0x1a5ed8?_0x1a5ed8['id']:null,_0x1a5ed8?_0x1a5ed8['name']:null,_0x1a5ed8?_0x1a5ed8['role']:null,getInteractionId(_0x213606,_0x16612d,_0x2463b4),_0x213606?JSON[_0x7d42('0x14')](_0x213606):'null');}function updateUser(_0x35be77,_0x388bc1,_0x967e5d,_0x161243,_0x4f5d3b){db[_[_0x7d42('0xb')](_0x161243)+_0x7d42('0x15')][_0x7d42('0x16')]({'where':{'id':getInteractionId(_0x388bc1,_0x967e5d,_0x161243)}})[_0x7d42('0x17')](function(_0x1c0205){if(_0x1c0205){return _0x1c0205[_0x7d42('0x18')]({'UserId':_0x35be77?_0x35be77['id']:null});}})[_0x7d42('0x17')](function(_0x1e881d){if(_0x1e881d){log(_0x7d42('0x19'),_0x35be77,_0x388bc1,_0x967e5d,_0x161243,_0x4f5d3b);}})[_0x7d42('0x1a')](function(){log('error',_0x35be77,_0x388bc1,_0x967e5d,_0x161243,_0x4f5d3b);});}module[_0x7d42('0x1b')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index fc45bed..2758567 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 _0xd6c6=['utf8','final','use','findOne','then','count','status','json','catch','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64'];(function(_0x5ad127,_0x47f978){var _0x25ef58=function(_0x43bb69){while(--_0x43bb69){_0x5ad127['push'](_0x5ad127['shift']());}};_0x25ef58(++_0x47f978);}(_0xd6c6,0x136));var _0x6d6c=function(_0x94c8e2,_0x4fe767){_0x94c8e2=_0x94c8e2-0x0;var _0x25b67c=_0xd6c6[_0x94c8e2];return _0x25b67c;};'use strict';var crypto=require(_0x6d6c('0x0'));var util=require(_0x6d6c('0x1'));var compose=require(_0x6d6c('0x2'));var db=require(_0x6d6c('0x3'))['db'];var config=require(_0x6d6c('0x4'));function getValueFromLicense(_0x4fc719,_0x1c9d32){if(_0x4fc719&&_0x1c9d32){if(_0x1c9d32['data1']&&_0x1c9d32[_0x6d6c('0x5')]){var _0xed96c0=_0x1c9d32[_0x6d6c('0x6')];var _0x3ba04c=_0x1c9d32[_0x6d6c('0x5')];var _0x58c409=_0xed96c0[_0x6d6c('0x7')]('-')[0x4];var _0x43c7f2=_0xed96c0[_0x6d6c('0x7')]('-')[0x0];var _0x4fd878=crypto[_0x6d6c('0x8')](_0x6d6c('0x9'),util[_0x6d6c('0xa')](_0x6d6c('0xb'),_0x58c409,_0xed96c0,_0x43c7f2));var _0x538687=_0x4fd878[_0x6d6c('0xc')](_0x3ba04c,_0x6d6c('0xd'),_0x6d6c('0xe'));_0x538687+=_0x4fd878[_0x6d6c('0xf')](_0x6d6c('0xe'));var _0xd99765=JSON['parse'](_0x538687);return _0xd99765['hasOwnProperty'](_0x4fc719)?_0xd99765[_0x4fc719]:null;}}return null;}function isLimit(_0x39bf0b,_0x4c4ee3,_0x23ac13,_0x4f477b){var _0x3502ae=_0x4c4ee3;return compose()[_0x6d6c('0x10')](function(_0x4cdcad,_0x22452a,_0x15faa3){return db['License'][_0x6d6c('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x6d6c('0x12')](function(_0x1082de){var _0x1eeec0=getValueFromLicense(_0x39bf0b,_0x1082de);return _0x1eeec0?_0x1eeec0:_0x3502ae;})[_0x6d6c('0x12')](function(_0x23957b){_0x3502ae=_0x23957b;return _0x23ac13[_0x6d6c('0x13')](_0x4f477b);})[_0x6d6c('0x12')](function(_0x2bb1b4){if(_0x2bb1b4>=_0x3502ae){return _0x22452a[_0x6d6c('0x14')](0x193)[_0x6d6c('0x15')]({'message':util[_0x6d6c('0xa')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x39bf0b)});}_0x15faa3();})[_0x6d6c('0x16')](function(_0x5ac4a5){_0x15faa3(_0x5ac4a5);});});}function isUserLimit(){return isLimit(_0x6d6c('0x17'),0x1,db[_0x6d6c('0x18')],{'where':{'$or':[{'role':_0x6d6c('0x19')},{'role':_0x6d6c('0x1a')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xc4c5=['utf8','final','parse','hasOwnProperty','use','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','base64'];(function(_0x52b722,_0xb322e3){var _0x1a4440=function(_0x578c2d){while(--_0x578c2d){_0x52b722['push'](_0x52b722['shift']());}};_0x1a4440(++_0xb322e3);}(_0xc4c5,0x1a4));var _0x5c4c=function(_0x4336ca,_0x8fcc0d){_0x4336ca=_0x4336ca-0x0;var _0x12b96e=_0xc4c5[_0x4336ca];return _0x12b96e;};'use strict';var crypto=require(_0x5c4c('0x0'));var util=require(_0x5c4c('0x1'));var compose=require('composable-middleware');var db=require(_0x5c4c('0x2'))['db'];var config=require(_0x5c4c('0x3'));function getValueFromLicense(_0x2102c3,_0x16e26b){if(_0x2102c3&&_0x16e26b){if(_0x16e26b[_0x5c4c('0x4')]&&_0x16e26b[_0x5c4c('0x5')]){var _0x30d777=_0x16e26b[_0x5c4c('0x4')];var _0xb25b7a=_0x16e26b['license'];var _0x1f2734=_0x30d777[_0x5c4c('0x6')]('-')[0x4];var _0x518cb7=_0x30d777['split']('-')[0x0];var _0x443255=crypto[_0x5c4c('0x7')]('aes-256-ctr',util[_0x5c4c('0x8')](_0x5c4c('0x9'),_0x1f2734,_0x30d777,_0x518cb7));var _0x49412e=_0x443255[_0x5c4c('0xa')](_0xb25b7a,_0x5c4c('0xb'),_0x5c4c('0xc'));_0x49412e+=_0x443255[_0x5c4c('0xd')]('utf8');var _0x97b4a7=JSON[_0x5c4c('0xe')](_0x49412e);return _0x97b4a7[_0x5c4c('0xf')](_0x2102c3)?_0x97b4a7[_0x2102c3]:null;}}return null;}function isLimit(_0x34dd3e,_0xf17cd5,_0x19a050,_0x2b5062){var _0x11b145=_0xf17cd5;return compose()[_0x5c4c('0x10')](function(_0x441d2e,_0x3c558a,_0x43cd6f){return db['License'][_0x5c4c('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x5c4c('0x12')](function(_0x4f981e){var _0x349222=getValueFromLicense(_0x34dd3e,_0x4f981e);return _0x349222?_0x349222:_0x11b145;})['then'](function(_0x4db656){_0x11b145=_0x4db656;return _0x19a050[_0x5c4c('0x13')](_0x2b5062);})['then'](function(_0x4141a0){if(_0x4141a0>=_0x11b145){return _0x3c558a[_0x5c4c('0x14')](0x193)[_0x5c4c('0x15')]({'message':util['format'](_0x5c4c('0x16'),_0x34dd3e)});}_0x43cd6f();})[_0x5c4c('0x17')](function(_0x3f4228){_0x43cd6f(_0x3f4228);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0x5c4c('0x18')},{'role':_0x5c4c('0x19')}]}});}exports[_0x5c4c('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 3160288..fc5dff9 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 _0xce53=['=\x20?','$ne','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','utcOffset','format','hours','minutes','lodash','moment','parseSearch','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','buildExpression','DATE','operator','$eq','$between','value','$gt','$lte','add','days','castTo','text','CAST(','field','\x20AS\x20','includes','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','$notIn','NOT\x20IN\x20?'];(function(_0x579c69,_0x31d32e){var _0x294362=function(_0x5619b6){while(--_0x5619b6){_0x579c69['push'](_0x579c69['shift']());}};_0x294362(++_0x31d32e);}(_0xce53,0x1c0));var _0x3ce5=function(_0x2c292a,_0x5b92f5){_0x2c292a=_0x2c292a-0x0;var _0x2c3036=_0xce53[_0x2c292a];return _0x2c3036;};'use strict';var _=require(_0x3ce5('0x0'));var moment=require(_0x3ce5('0x1'));exports[_0x3ce5('0x2')]=function(_0x26fa10){var _0x2f04f4={'conditions':[]};_0x2f04f4['sqlOperator']=_['startsWith'](_0x26fa10,_0x3ce5('0x3'))?'or':_0x3ce5('0x4');var _0x552559=_0x26fa10[_0x3ce5('0x5')](_0x3ce5('0x6'),'')[_0x3ce5('0x5')](_0x3ce5('0x3'),'')[_0x3ce5('0x7')]('||');for(var _0x27e835=0x0;_0x27e835<_0x552559[_0x3ce5('0x8')];_0x27e835++){var _0x4fa8ca=_0x552559[_0x27e835]['split'](':=');var _0x20dfba=_0x4fa8ca[0x0];var _0x542374=_0x4fa8ca[_0x3ce5('0x9')](0x1);_0x542374[_0x3ce5('0xa')](function(_0x4ba66e){var _0x179411=_0x4ba66e['split']('[')[_0x3ce5('0xb')]();var _0x3528ab=_0x4ba66e[_0x3ce5('0xc')](/\[(.*?)\]/g);_0x3528ab[_0x3ce5('0xa')](function(_0x2997f0){var _0x161039=_0x2997f0[_0x3ce5('0x7')]('[')[_0x3ce5('0xd')](function(_0x14a5e0){return _0x14a5e0[_0x3ce5('0xe')](']')>-0x1;})[_0x3ce5('0xf')](function(_0x1f0daa){return _0x1f0daa['split'](']')[0x0];})[0x0];_0x2f04f4[_0x3ce5('0x10')]['push']({'field':_0x20dfba,'operator':_0x179411,'value':_0x161039});});});}return _0x2f04f4;};exports[_0x3ce5('0x11')]=function(_0xbac89d,_0x56ba9f,_0x449be0){var _0x21c577={};if(_0x56ba9f===_0x3ce5('0x12')){if(_0x449be0[_0x3ce5('0x13')]===_0x3ce5('0x14')){_0x449be0[_0x3ce5('0x13')]=_0x3ce5('0x15');_0x449be0[_0x3ce5('0x16')]+=','+_0x449be0[_0x3ce5('0x16')];}else if(_['includes']([_0x3ce5('0x17'),_0x3ce5('0x18')],_0x449be0[_0x3ce5('0x13')])){_0x449be0[_0x3ce5('0x16')]=moment(_0x449be0[_0x3ce5('0x16')])[_0x3ce5('0x19')](0x1,_0x3ce5('0x1a'))['format']('YYYY-MM-DD');}}if(_0x449be0[_0x3ce5('0x1b')]){_0x56ba9f=_0x449be0[_0x3ce5('0x1b')];_0x21c577[_0x3ce5('0x1c')]=_0x3ce5('0x1d')+_0xbac89d+'.'+_0x449be0[_0x3ce5('0x1e')]+_0x3ce5('0x1f')+_0x449be0[_0x3ce5('0x1b')]+')\x20'+parseOperator(_0x449be0[_0x3ce5('0x13')]);}else{_0x21c577[_0x3ce5('0x1c')]=_0xbac89d+'.'+_0x449be0[_0x3ce5('0x1e')]+'\x20'+parseOperator(_0x449be0['operator']);}if(_[_0x3ce5('0x20')](['$ne','$notIn'],_0x449be0[_0x3ce5('0x13')]))_0x21c577[_0x3ce5('0x1c')]='('+_0x21c577[_0x3ce5('0x1c')]+_0x3ce5('0x21')+_0xbac89d+'.'+_0x449be0[_0x3ce5('0x1e')]+_0x3ce5('0x22');_0x21c577['value']=parseValue(_0x56ba9f,_0x449be0[_0x3ce5('0x13')],_0x449be0[_0x3ce5('0x16')]);return _0x21c577;};function parseOperator(_0x4e9ff1){var _0x3d6d2c;switch(_0x4e9ff1){case'$in':_0x3d6d2c=_0x3ce5('0x23');break;case _0x3ce5('0x24'):_0x3d6d2c=_0x3ce5('0x25');break;case _0x3ce5('0x14'):_0x3d6d2c=_0x3ce5('0x26');break;case _0x3ce5('0x27'):_0x3d6d2c=_0x3ce5('0x28');break;case _0x3ce5('0x29'):case'$startsWith':case _0x3ce5('0x2a'):_0x3d6d2c=_0x3ce5('0x2b');break;case'$lt':_0x3d6d2c=_0x3ce5('0x2c');break;case _0x3ce5('0x17'):_0x3d6d2c='>\x20?';break;case _0x3ce5('0x18'):_0x3d6d2c='<=\x20?';break;case _0x3ce5('0x2d'):_0x3d6d2c=_0x3ce5('0x2e');break;case _0x3ce5('0x15'):_0x3d6d2c=_0x3ce5('0x2f');break;}return _0x3d6d2c;}function parseValue(_0x4629d4,_0x38d662,_0x583768){var _0x1278ab={'start':undefined,'end':undefined};switch(_0x38d662){case _0x3ce5('0x30'):case'$notIn':_0x1278ab['start']=_0x583768[_0x3ce5('0x7')](',');break;case _0x3ce5('0x29'):_0x1278ab[_0x3ce5('0x31')]='%'+_0x583768+'%';break;case'$startsWith':_0x1278ab[_0x3ce5('0x31')]=_0x583768+'%';break;case _0x3ce5('0x2a'):_0x1278ab[_0x3ce5('0x31')]='%'+_0x583768;break;case _0x3ce5('0x15'):var _0x3c1073=_0x583768['split'](',');var _0x583768=_0x3c1073['shift']();var _0x129082=_0x3c1073['pop']();if(_0x4629d4===_0x3ce5('0x12')){_0x583768=moment(_0x583768)[_0x3ce5('0x32')](0x0,!![])[_0x3ce5('0x33')]();_0x129082=moment(_0x129082)['utcOffset'](0x0,!![])[_0x3ce5('0x19')](0x17,_0x3ce5('0x34'))[_0x3ce5('0x19')](0x3b,_0x3ce5('0x35'))[_0x3ce5('0x19')](0x3b,'seconds')[_0x3ce5('0x33')]();}_0x1278ab={'start':_0x583768,'end':_0x129082};break;default:_0x1278ab['start']=_0x583768;break;}return _0x1278ab;} \ No newline at end of file +var _0xe543=['start','utcOffset','hours','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','and','[$and]','[$or]','length','split','slice','shift','match','forEach','indexOf','conditions','DATE','$eq','operator','$between','value','includes','$gt','$lte','add','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?'];(function(_0x2f5c9c,_0x1f01db){var _0x169999=function(_0x564864){while(--_0x564864){_0x2f5c9c['push'](_0x2f5c9c['shift']());}};_0x169999(++_0x1f01db);}(_0xe543,0x113));var _0x3e54=function(_0x373641,_0x131c20){_0x373641=_0x373641-0x0;var _0x2832b0=_0xe543[_0x373641];return _0x2832b0;};'use strict';var _=require('lodash');var moment=require(_0x3e54('0x0'));exports[_0x3e54('0x1')]=function(_0x13bf53){var _0x28dc26={'conditions':[]};_0x28dc26[_0x3e54('0x2')]=_[_0x3e54('0x3')](_0x13bf53,'[$or]')?'or':_0x3e54('0x4');var _0x405aa7=_0x13bf53['replace'](_0x3e54('0x5'),'')['replace'](_0x3e54('0x6'),'')['split']('||');for(var _0x4caa98=0x0;_0x4caa98<_0x405aa7[_0x3e54('0x7')];_0x4caa98++){var _0x2e4553=_0x405aa7[_0x4caa98][_0x3e54('0x8')](':=');var _0xa19d9=_0x2e4553[0x0];var _0x449dba=_0x2e4553[_0x3e54('0x9')](0x1);_0x449dba['forEach'](function(_0x4a7b68){var _0x218e3d=_0x4a7b68[_0x3e54('0x8')]('[')[_0x3e54('0xa')]();var _0x17e2c4=_0x4a7b68[_0x3e54('0xb')](/\[(.*?)\]/g);_0x17e2c4[_0x3e54('0xc')](function(_0x9bcf7c){var _0x1ff94a=_0x9bcf7c[_0x3e54('0x8')]('[')['filter'](function(_0xd4e75c){return _0xd4e75c[_0x3e54('0xd')](']')>-0x1;})['map'](function(_0x5598b1){return _0x5598b1[_0x3e54('0x8')](']')[0x0];})[0x0];_0x28dc26[_0x3e54('0xe')]['push']({'field':_0xa19d9,'operator':_0x218e3d,'value':_0x1ff94a});});});}return _0x28dc26;};exports['buildExpression']=function(_0x40d3b0,_0x43e152,_0x951a4b){var _0x3e1b74={};if(_0x43e152===_0x3e54('0xf')){if(_0x951a4b['operator']===_0x3e54('0x10')){_0x951a4b[_0x3e54('0x11')]=_0x3e54('0x12');_0x951a4b['value']+=','+_0x951a4b[_0x3e54('0x13')];}else if(_[_0x3e54('0x14')]([_0x3e54('0x15'),_0x3e54('0x16')],_0x951a4b['operator'])){_0x951a4b[_0x3e54('0x13')]=moment(_0x951a4b[_0x3e54('0x13')])[_0x3e54('0x17')](0x1,'days')[_0x3e54('0x18')](_0x3e54('0x19'));}}if(_0x951a4b[_0x3e54('0x1a')]){_0x43e152=_0x951a4b[_0x3e54('0x1a')];_0x3e1b74[_0x3e54('0x1b')]=_0x3e54('0x1c')+_0x40d3b0+'.'+_0x951a4b[_0x3e54('0x1d')]+_0x3e54('0x1e')+_0x951a4b[_0x3e54('0x1a')]+')\x20'+parseOperator(_0x951a4b['operator']);}else{_0x3e1b74['text']=_0x40d3b0+'.'+_0x951a4b[_0x3e54('0x1d')]+'\x20'+parseOperator(_0x951a4b[_0x3e54('0x11')]);}if(_[_0x3e54('0x14')]([_0x3e54('0x1f'),_0x3e54('0x20')],_0x951a4b[_0x3e54('0x11')]))_0x3e1b74[_0x3e54('0x1b')]='('+_0x3e1b74[_0x3e54('0x1b')]+_0x3e54('0x21')+_0x40d3b0+'.'+_0x951a4b['field']+_0x3e54('0x22');_0x3e1b74[_0x3e54('0x13')]=parseValue(_0x43e152,_0x951a4b[_0x3e54('0x11')],_0x951a4b[_0x3e54('0x13')]);return _0x3e1b74;};function parseOperator(_0x1e1fad){var _0x475d11;switch(_0x1e1fad){case _0x3e54('0x23'):_0x475d11='IN\x20?';break;case'$notIn':_0x475d11=_0x3e54('0x24');break;case'$eq':_0x475d11=_0x3e54('0x25');break;case _0x3e54('0x1f'):_0x475d11='<>\x20?';break;case _0x3e54('0x26'):case _0x3e54('0x27'):case _0x3e54('0x28'):_0x475d11=_0x3e54('0x29');break;case _0x3e54('0x2a'):_0x475d11=_0x3e54('0x2b');break;case _0x3e54('0x15'):_0x475d11=_0x3e54('0x2c');break;case _0x3e54('0x16'):_0x475d11=_0x3e54('0x2d');break;case _0x3e54('0x2e'):_0x475d11=_0x3e54('0x2f');break;case _0x3e54('0x12'):_0x475d11=_0x3e54('0x30');break;}return _0x475d11;}function parseValue(_0x5ad361,_0x563ec8,_0xc1c655){var _0x555bcb={'start':undefined,'end':undefined};switch(_0x563ec8){case _0x3e54('0x23'):case _0x3e54('0x20'):_0x555bcb['start']=_0xc1c655[_0x3e54('0x8')](',');break;case _0x3e54('0x26'):_0x555bcb['start']='%'+_0xc1c655+'%';break;case _0x3e54('0x27'):_0x555bcb[_0x3e54('0x31')]=_0xc1c655+'%';break;case'$endsWith':_0x555bcb['start']='%'+_0xc1c655;break;case _0x3e54('0x12'):var _0x24411f=_0xc1c655['split'](',');var _0xc1c655=_0x24411f[_0x3e54('0xa')]();var _0x4b70b3=_0x24411f['pop']();if(_0x5ad361===_0x3e54('0xf')){_0xc1c655=moment(_0xc1c655)['utcOffset'](0x0,!![])[_0x3e54('0x18')]();_0x4b70b3=moment(_0x4b70b3)[_0x3e54('0x32')](0x0,!![])[_0x3e54('0x17')](0x17,_0x3e54('0x33'))[_0x3e54('0x17')](0x3b,_0x3e54('0x34'))[_0x3e54('0x17')](0x3b,_0x3e54('0x35'))[_0x3e54('0x18')]();}_0x555bcb={'start':_0xc1c655,'end':_0x4b70b3};break;default:_0x555bcb[_0x3e54('0x31')]=_0xc1c655;break;}return _0x555bcb;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 5fe6ac8..9d6cf19 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 _0x28e3=['format','YYYY-MM-DD','utc','$lte','subtract','name','isArray','limit','offset','sort','map','indexOf','priority','unsigned','substr','DESC','col','ASC','omit','isObject','isString','length','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','{EXPR}','push','replace','join','getOptions','$id','query','model','intersection','attributes','nolimit','order','where','pick','filter','columns','value','merge','type','VIRTUAL','lower','options','include','includeAll','lodash','sequelize','moment','../../mysqldb','parse','keys','includes','alias','fields','raw','split','filters','isEmpty','forOwn','find','DATE','isPlainObject','$gte'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x28e3,0x106));var _0x328e=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x28e3[_0x725a4c];return _0x37b2cc;};'use strict';var _=require(_0x328e('0x0'));var sequelize=require(_0x328e('0x1'));var moment=require(_0x328e('0x2'));var db=require(_0x328e('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x499442){var _0x5f1520=['ne'];try{var _0x392b85=JSON[_0x328e('0x4')](_0x499442);var _0x168893=Object[_0x328e('0x5')](_0x392b85)[0x0];return _0x5f1520[_0x328e('0x6')](_0x168893);}catch(_0xe03ffa){return![];}}function getOperatorValue(_0x439182){var _0x5e5bcf=JSON['parse'](_0x439182);var _0x58885f=Object[_0x328e('0x5')](_0x5e5bcf)[0x0];var _0x3696b6=_0x5e5bcf[_0x58885f];return{['$'+_0x58885f]:_0x3696b6};}function parseIncludeModel(_0x3467ee){var _0x6a5414=JSON[_0x328e('0x4')](_0x3467ee);return{'model':db[_0x6a5414['model']],'as':_0x6a5414[_0x328e('0x7')],'attributes':_0x6a5414[_0x328e('0x8')],'raw':_0x6a5414[_0x328e('0x9')]};}exports['fields']=function(_0x509c4d){var _0x4c366c=null;if(_0x509c4d){_0x4c366c=_0x509c4d[_0x328e('0xa')](',');}return _0x4c366c;};exports[_0x328e('0xb')]=function(_0x33f277,_0x1c7294){var _0x32e15b={};if(!_[_0x328e('0xc')](_0x33f277)){_[_0x328e('0xd')](_0x33f277,function(_0x39338e,_0x1d3e4a){try{if(_0x1c7294){var _0x96f79a=_[_0x328e('0xe')](_0x1c7294,{'name':_0x1d3e4a})||{};if(hasSequelizeOperator(_0x39338e)){_0x32e15b[_0x1d3e4a]=getOperatorValue(_0x39338e);}else if(_0x96f79a['type']===_0x328e('0xf')&&_[_0x328e('0x10')](_0x39338e)){var _0x1552ce=JSON[_0x328e('0x4')](_0x39338e);var _0x29f8bf={'$gte':moment(moment(_0x1552ce[_0x328e('0x11')])[_0x328e('0x12')](_0x328e('0x13')))[_0x328e('0x14')]()['format'](),'$lte':moment(moment(_0x1552ce[_0x328e('0x15')])[_0x328e('0x12')](_0x328e('0x13')))[_0x328e('0x14')]()[_0x328e('0x16')](0x1,'s')[_0x328e('0x12')]()};_0x32e15b[_0x1d3e4a]=_0x29f8bf;}else if(_0x96f79a[_0x328e('0x17')]==='uniqueid'){_0x32e15b[_0x1d3e4a]=_0x39338e;}else{_0x32e15b[_0x1d3e4a]=_[_0x328e('0x18')](_0x39338e)?_0x39338e:JSON[_0x328e('0x4')](_0x39338e);}}else{_0x32e15b[_0x1d3e4a]=_[_0x328e('0x18')](_0x39338e)?_0x39338e:JSON[_0x328e('0x4')](_0x39338e);}}catch(_0x2af341){_0x32e15b[_0x1d3e4a]=_0x39338e['split'](',');}});}return _0x32e15b;};exports[_0x328e('0x19')]=function(_0x1c5551){_0x1c5551=parseInt(_0x1c5551,0xa);if(!_0x1c5551||_0x1c5551<0x0){_0x1c5551=LIMIT_VALUE;}return _0x1c5551;};exports[_0x328e('0x1a')]=function(_0x5dcfaa){_0x5dcfaa=parseInt(_0x5dcfaa,0xa);if(!_0x5dcfaa||_0x5dcfaa<0x0){_0x5dcfaa=0x0;}return _0x5dcfaa;};exports[_0x328e('0x1b')]=function(_0x3bafb1){var _0x39a9e2,_0x273b45=null;if(_0x3bafb1){_0x39a9e2=_0x3bafb1[_0x328e('0xa')](',');_0x273b45=_[_0x328e('0x1c')](_0x39a9e2,function(_0x725a1){if(_0x725a1[_0x328e('0x1d')]('-')===0x0){return[_0x725a1===_0x328e('0x1e')?sequelize['cast'](sequelize['col'](_0x328e('0x1e')),_0x328e('0x1f')):_0x725a1[_0x328e('0x20')](0x1),_0x328e('0x21')];}else{return[_0x725a1===_0x328e('0x1e')?sequelize['cast'](sequelize[_0x328e('0x22')]('priority'),_0x328e('0x1f')):_0x725a1,_0x328e('0x23')];}});}return _0x273b45;};exports[_0x328e('0x24')]=function(_0x2fab5a,_0x108f0d){if(_['isEmpty'](_0x2fab5a)){return _0x2fab5a;}if(_['isArray'](_0x2fab5a)){for(var _0x3bd897=0x0;_0x3bd897<_0x2fab5a['length'];_0x3bd897+=0x1){_0x2fab5a[_0x3bd897]=this['omit'](_0x2fab5a[_0x3bd897],_0x108f0d);}return _0x2fab5a;}if(!_[_0x328e('0x25')](_0x2fab5a)){return _0x2fab5a;}if(_[_0x328e('0x26')](_0x108f0d)){_0x108f0d=[_0x108f0d];}if(!_[_0x328e('0x18')](_0x108f0d)){return _0x2fab5a;}for(var _0x232ec7=0x0;_0x232ec7<_0x108f0d[_0x328e('0x27')];_0x232ec7+=0x1){_['unset'](_0x2fab5a,_0x108f0d[_0x232ec7]);}for(var _0x26a204 in _0x2fab5a){if(_0x2fab5a[_0x328e('0x28')](_0x26a204)){_0x2fab5a[_0x26a204]=this[_0x328e('0x24')](_0x2fab5a[_0x26a204],_0x108f0d);}}return _0x2fab5a;};exports[_0x328e('0x29')]=function(_0x24702c){return _0x24702c['match'](RegExp(_0x328e('0x2a')))?!![]:![];};exports[_0x328e('0x2b')]=function(_0x3da580){return _0x3da580[_0x328e('0x2c')](/^\S+@\S+$/)?!![]:![];};exports[_0x328e('0x2d')]=function(_0x10a004,_0x37ba2e){var _0x123099=[];var _0xeb04ba=/[ `!@#$%^&*()_\-?~]/;var _0x56a1ea=_0x37ba2e?'\x22{EXPR}\x22':_0x328e('0x2e');_0x10a004[_0x328e('0xa')](/[ ,]+/)['forEach'](function(_0x514304){_0x514304=_0x514304['replace'](/([^:]")"+/g,'$1');_0x514304='+'+_0x514304+'*';var _0xba5335=_0x514304[_0x328e('0x2c')](_0xeb04ba);if(_0xba5335){_0x514304='\x22'+_0x514304+'\x22';}_0x123099[_0x328e('0x2f')](_0x514304);});_0x56a1ea=_0x56a1ea[_0x328e('0x30')](_0x328e('0x2e'),_0x123099[_0x328e('0x31')]('\x20'));return _0x56a1ea;};exports[_0x328e('0x32')]=function(_0x50fdad,_0x27ed20,_0x5c67e4){var _0x479550={},_0x25f1ba={};if(_0x27ed20['query'][_0x328e('0x33')]){_0x27ed20[_0x328e('0x34')]['id']=_0x27ed20[_0x328e('0x34')]['$id'];delete _0x27ed20[_0x328e('0x34')]['$id'];}_0x479550[_0x328e('0x35')]=_[_0x328e('0x1c')](_0x50fdad,_0x328e('0x17'));_0x479550[_0x328e('0x34')]=_['keys'](_0x27ed20[_0x328e('0x34')]);_0x479550['filters']=_[_0x328e('0x36')](_0x479550['model'],_0x479550['query']);_0x25f1ba[_0x328e('0x37')]=_['intersection'](_0x479550[_0x328e('0x35')],this[_0x328e('0x8')](_0x27ed20[_0x328e('0x34')][_0x328e('0x8')]));_0x25f1ba['attributes']=_0x25f1ba[_0x328e('0x37')][_0x328e('0x27')]?_0x25f1ba[_0x328e('0x37')]:_0x479550[_0x328e('0x35')];if(!_0x27ed20[_0x328e('0x34')]['hasOwnProperty'](_0x328e('0x38'))){_0x25f1ba[_0x328e('0x19')]=this[_0x328e('0x19')](_0x27ed20['query']['limit']);_0x25f1ba['offset']=this[_0x328e('0x1a')](_0x27ed20['query'][_0x328e('0x1a')]);}_0x25f1ba[_0x328e('0x39')]=this['sort'](_0x27ed20['query'][_0x328e('0x1b')]);_0x25f1ba[_0x328e('0x3a')]=this[_0x328e('0xb')](_[_0x328e('0x3b')](_0x27ed20[_0x328e('0x34')],_0x479550[_0x328e('0xb')]),_0x50fdad);if(_0x27ed20[_0x328e('0x34')][_0x328e('0x3c')]){var _0x2a823e=_0x50fdad;var _0xdf4229=_0x27ed20[_0x328e('0x34')][_0x328e('0x3c')];if(typeof _0xdf4229==='object'){_0x2a823e=_[_0x328e('0x3c')](_0x50fdad,function(_0x4f3687){return _['includes'](_0xdf4229[_0x328e('0x3d')],_0x4f3687[_0x328e('0x17')]);});_0xdf4229=_0xdf4229[_0x328e('0x3e')];}_0x25f1ba['where']=_[_0x328e('0x3f')](_0x25f1ba[_0x328e('0x3a')],{'$or':_[_0x328e('0x1c')](_0x2a823e,function(_0x414874){if(_0x414874[_0x328e('0x40')]!==_0x328e('0x41')){if(_0x5c67e4){return sequelize[_0x328e('0x3a')](sequelize['fn']('lower',sequelize['col'](_0x414874[_0x328e('0x17')])),{'$like':sequelize['fn'](_0x328e('0x42'),'%'+_0x27ed20['query'][_0x328e('0x3c')]+'%')});}else{var _0x22c843={};_0x22c843[_0x414874[_0x328e('0x17')]]={'$like':'%'+_0x27ed20['query'][_0x328e('0x3c')]+'%'};return _0x22c843;}}})});}_0x25f1ba=_[_0x328e('0x3f')]({},_0x25f1ba,_0x27ed20[_0x328e('0x43')]);return _0x25f1ba;};exports[_0x328e('0x44')]=function(_0x36f2b8){var _0x2ef923=[];if(_0x36f2b8[_0x328e('0x45')]){_0x2ef923['push']({'all':!![]});}else if(_0x36f2b8[_0x328e('0x44')]){if(Array[_0x328e('0x18')](_0x36f2b8[_0x328e('0x44')])){_0x2ef923=Object['keys'](_0x36f2b8[_0x328e('0x44')])[_0x328e('0x1c')](function(_0xf05042){return parseIncludeModel(_0x36f2b8[_0x328e('0x44')][_0xf05042]);});}else{var _0x1532d7=parseIncludeModel(_0x36f2b8[_0x328e('0x44')]);_0x2ef923[_0x328e('0x2f')](_0x1532d7);}}return _0x2ef923;}; \ No newline at end of file +var _0x1c45=['DATE','YYYY-MM-DD','utc','format','$lte','subtract','isArray','limit','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','\x22{EXPR}\x22','{EXPR}','forEach','replace','join','getOptions','query','$id','name','intersection','attributes','nolimit','offset','order','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','options','include','includeAll','push','lodash','sequelize','moment','../../mysqldb','keys','includes','parse','model','fields','raw','split','filters','forOwn','find','type'];(function(_0xd5e247,_0x1310e8){var _0x5c4136=function(_0x591860){while(--_0x591860){_0xd5e247['push'](_0xd5e247['shift']());}};_0x5c4136(++_0x1310e8);}(_0x1c45,0x7f));var _0x51c4=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1c45[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x51c4('0x0'));var sequelize=require(_0x51c4('0x1'));var moment=require(_0x51c4('0x2'));var db=require(_0x51c4('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4dc25e){var _0x4b7552=['ne'];try{var _0x4ac259=JSON['parse'](_0x4dc25e);var _0x4c1fc6=Object[_0x51c4('0x4')](_0x4ac259)[0x0];return _0x4b7552[_0x51c4('0x5')](_0x4c1fc6);}catch(_0x4db08f){return![];}}function getOperatorValue(_0x43fc53){var _0xf6b361=JSON[_0x51c4('0x6')](_0x43fc53);var _0x4ef66d=Object['keys'](_0xf6b361)[0x0];var _0x58e2a2=_0xf6b361[_0x4ef66d];return{['$'+_0x4ef66d]:_0x58e2a2};}function parseIncludeModel(_0x188d9b){var _0x2986cb=JSON[_0x51c4('0x6')](_0x188d9b);return{'model':db[_0x2986cb[_0x51c4('0x7')]],'as':_0x2986cb['alias'],'attributes':_0x2986cb[_0x51c4('0x8')],'raw':_0x2986cb[_0x51c4('0x9')]};}exports[_0x51c4('0x8')]=function(_0x1c9cce){var _0x2597b0=null;if(_0x1c9cce){_0x2597b0=_0x1c9cce[_0x51c4('0xa')](',');}return _0x2597b0;};exports[_0x51c4('0xb')]=function(_0x43e364,_0x3e5635){var _0x1bc161={};if(!_['isEmpty'](_0x43e364)){_[_0x51c4('0xc')](_0x43e364,function(_0x1de156,_0x3ca9d7){try{if(_0x3e5635){var _0x33693e=_[_0x51c4('0xd')](_0x3e5635,{'name':_0x3ca9d7})||{};if(hasSequelizeOperator(_0x1de156)){_0x1bc161[_0x3ca9d7]=getOperatorValue(_0x1de156);}else if(_0x33693e[_0x51c4('0xe')]===_0x51c4('0xf')&&_['isPlainObject'](_0x1de156)){var _0xf61be8=JSON[_0x51c4('0x6')](_0x1de156);var _0x2f7c46={'$gte':moment(moment(_0xf61be8['$gte'])['format'](_0x51c4('0x10')))[_0x51c4('0x11')]()[_0x51c4('0x12')](),'$lte':moment(moment(_0xf61be8[_0x51c4('0x13')])[_0x51c4('0x12')](_0x51c4('0x10')))['utc']()[_0x51c4('0x14')](0x1,'s')[_0x51c4('0x12')]()};_0x1bc161[_0x3ca9d7]=_0x2f7c46;}else if(_0x33693e['name']==='uniqueid'){_0x1bc161[_0x3ca9d7]=_0x1de156;}else{_0x1bc161[_0x3ca9d7]=_['isArray'](_0x1de156)?_0x1de156:JSON[_0x51c4('0x6')](_0x1de156);}}else{_0x1bc161[_0x3ca9d7]=_[_0x51c4('0x15')](_0x1de156)?_0x1de156:JSON['parse'](_0x1de156);}}catch(_0x352b44){_0x1bc161[_0x3ca9d7]=_0x1de156[_0x51c4('0xa')](',');}});}return _0x1bc161;};exports[_0x51c4('0x16')]=function(_0x558e14){_0x558e14=parseInt(_0x558e14,0xa);if(!_0x558e14||_0x558e14<0x0){_0x558e14=LIMIT_VALUE;}return _0x558e14;};exports['offset']=function(_0x21b7fc){_0x21b7fc=parseInt(_0x21b7fc,0xa);if(!_0x21b7fc||_0x21b7fc<0x0){_0x21b7fc=0x0;}return _0x21b7fc;};exports[_0x51c4('0x17')]=function(_0x59ff23){var _0x579dae,_0x1e8d13=null;if(_0x59ff23){_0x579dae=_0x59ff23[_0x51c4('0xa')](',');_0x1e8d13=_[_0x51c4('0x18')](_0x579dae,function(_0x5bdd64){if(_0x5bdd64[_0x51c4('0x19')]('-')===0x0){return[_0x5bdd64===_0x51c4('0x1a')?sequelize[_0x51c4('0x1b')](sequelize[_0x51c4('0x1c')]('priority'),_0x51c4('0x1d')):_0x5bdd64[_0x51c4('0x1e')](0x1),_0x51c4('0x1f')];}else{return[_0x5bdd64===_0x51c4('0x1a')?sequelize[_0x51c4('0x1b')](sequelize['col'](_0x51c4('0x1a')),_0x51c4('0x1d')):_0x5bdd64,_0x51c4('0x20')];}});}return _0x1e8d13;};exports[_0x51c4('0x21')]=function(_0x1bf5ef,_0x5ab8a9){if(_[_0x51c4('0x22')](_0x1bf5ef)){return _0x1bf5ef;}if(_[_0x51c4('0x15')](_0x1bf5ef)){for(var _0x574652=0x0;_0x574652<_0x1bf5ef[_0x51c4('0x23')];_0x574652+=0x1){_0x1bf5ef[_0x574652]=this[_0x51c4('0x21')](_0x1bf5ef[_0x574652],_0x5ab8a9);}return _0x1bf5ef;}if(!_[_0x51c4('0x24')](_0x1bf5ef)){return _0x1bf5ef;}if(_[_0x51c4('0x25')](_0x5ab8a9)){_0x5ab8a9=[_0x5ab8a9];}if(!_[_0x51c4('0x15')](_0x5ab8a9)){return _0x1bf5ef;}for(var _0x1d5053=0x0;_0x1d5053<_0x5ab8a9[_0x51c4('0x23')];_0x1d5053+=0x1){_[_0x51c4('0x26')](_0x1bf5ef,_0x5ab8a9[_0x1d5053]);}for(var _0x289216 in _0x1bf5ef){if(_0x1bf5ef[_0x51c4('0x27')](_0x289216)){_0x1bf5ef[_0x289216]=this[_0x51c4('0x21')](_0x1bf5ef[_0x289216],_0x5ab8a9);}}return _0x1bf5ef;};exports[_0x51c4('0x28')]=function(_0x153ff2){return _0x153ff2[_0x51c4('0x29')](RegExp(_0x51c4('0x2a')))?!![]:![];};exports[_0x51c4('0x2b')]=function(_0x110ac4){return _0x110ac4['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x6d55f1,_0x106886){var _0x3e40a2=[];var _0x499d8d=/[ `!@#$%^&*()_\-?~]/;var _0x1768cf=_0x106886?_0x51c4('0x2c'):_0x51c4('0x2d');_0x6d55f1[_0x51c4('0xa')](/[ ,]+/)[_0x51c4('0x2e')](function(_0x110443){_0x110443=_0x110443[_0x51c4('0x2f')](/([^:]")"+/g,'$1');_0x110443='+'+_0x110443+'*';var _0x32f498=_0x110443['match'](_0x499d8d);if(_0x32f498){_0x110443='\x22'+_0x110443+'\x22';}_0x3e40a2['push'](_0x110443);});_0x1768cf=_0x1768cf[_0x51c4('0x2f')]('{EXPR}',_0x3e40a2[_0x51c4('0x30')]('\x20'));return _0x1768cf;};exports[_0x51c4('0x31')]=function(_0x12c6c3,_0x16b18a,_0x1cab14){var _0xa6afb9={},_0x2c1953={};if(_0x16b18a[_0x51c4('0x32')][_0x51c4('0x33')]){_0x16b18a['query']['id']=_0x16b18a[_0x51c4('0x32')][_0x51c4('0x33')];delete _0x16b18a[_0x51c4('0x32')][_0x51c4('0x33')];}_0xa6afb9[_0x51c4('0x7')]=_[_0x51c4('0x18')](_0x12c6c3,_0x51c4('0x34'));_0xa6afb9[_0x51c4('0x32')]=_[_0x51c4('0x4')](_0x16b18a['query']);_0xa6afb9[_0x51c4('0xb')]=_[_0x51c4('0x35')](_0xa6afb9['model'],_0xa6afb9[_0x51c4('0x32')]);_0x2c1953[_0x51c4('0x36')]=_[_0x51c4('0x35')](_0xa6afb9[_0x51c4('0x7')],this[_0x51c4('0x8')](_0x16b18a[_0x51c4('0x32')][_0x51c4('0x8')]));_0x2c1953['attributes']=_0x2c1953[_0x51c4('0x36')][_0x51c4('0x23')]?_0x2c1953['attributes']:_0xa6afb9[_0x51c4('0x7')];if(!_0x16b18a['query'][_0x51c4('0x27')](_0x51c4('0x37'))){_0x2c1953['limit']=this[_0x51c4('0x16')](_0x16b18a[_0x51c4('0x32')][_0x51c4('0x16')]);_0x2c1953[_0x51c4('0x38')]=this[_0x51c4('0x38')](_0x16b18a[_0x51c4('0x32')]['offset']);}_0x2c1953[_0x51c4('0x39')]=this['sort'](_0x16b18a[_0x51c4('0x32')][_0x51c4('0x17')]);_0x2c1953[_0x51c4('0x3a')]=this[_0x51c4('0xb')](_[_0x51c4('0x3b')](_0x16b18a[_0x51c4('0x32')],_0xa6afb9[_0x51c4('0xb')]),_0x12c6c3);if(_0x16b18a[_0x51c4('0x32')]['filter']){var _0xd77fff=_0x12c6c3;var _0x271ec2=_0x16b18a[_0x51c4('0x32')][_0x51c4('0x3c')];if(typeof _0x271ec2===_0x51c4('0x3d')){_0xd77fff=_['filter'](_0x12c6c3,function(_0x4c889b){return _['includes'](_0x271ec2[_0x51c4('0x3e')],_0x4c889b[_0x51c4('0x34')]);});_0x271ec2=_0x271ec2[_0x51c4('0x3f')];}_0x2c1953[_0x51c4('0x3a')]=_[_0x51c4('0x40')](_0x2c1953['where'],{'$or':_[_0x51c4('0x18')](_0xd77fff,function(_0x2c51f4){if(_0x2c51f4[_0x51c4('0xe')]!==_0x51c4('0x41')){if(_0x1cab14){return sequelize[_0x51c4('0x3a')](sequelize['fn'](_0x51c4('0x42'),sequelize[_0x51c4('0x1c')](_0x2c51f4[_0x51c4('0x34')])),{'$like':sequelize['fn'](_0x51c4('0x42'),'%'+_0x16b18a[_0x51c4('0x32')][_0x51c4('0x3c')]+'%')});}else{var _0x2a0046={};_0x2a0046[_0x2c51f4[_0x51c4('0x34')]]={'$like':'%'+_0x16b18a[_0x51c4('0x32')][_0x51c4('0x3c')]+'%'};return _0x2a0046;}}})});}_0x2c1953=_[_0x51c4('0x40')]({},_0x2c1953,_0x16b18a[_0x51c4('0x43')]);return _0x2c1953;};exports[_0x51c4('0x44')]=function(_0x206d99){var _0x32f398=[];if(_0x206d99[_0x51c4('0x45')]){_0x32f398['push']({'all':!![]});}else if(_0x206d99['include']){if(Array[_0x51c4('0x15')](_0x206d99[_0x51c4('0x44')])){_0x32f398=Object['keys'](_0x206d99[_0x51c4('0x44')])[_0x51c4('0x18')](function(_0x3e545d){return parseIncludeModel(_0x206d99['include'][_0x3e545d]);});}else{var _0x328f6e=parseIncludeModel(_0x206d99[_0x51c4('0x44')]);_0x32f398[_0x51c4('0x46')](_0x328f6e);}}return _0x32f398;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 7d073c5..3618822 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2f3=['findOne','getAgents','flatten','getAgentIdsByQueues','includes','User','name','fullname','pauseType','find','getSortedAgentsIdsByStatus','split','fields','startsWith','DESC','getUpdatedSortOptions','fullname,internal','internal','indexOf','validateSortParameter','sort','globalStatus','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatus','chatStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','omit','pick','filterAgentAttributes','mailStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxCapacity','mailCapacity','chatCurrentCapacity','phoneBarEnableAutomaticScreenRecording','screenrecording','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','voicePause','pause','every','chatStatus','faxStatus','mailStatus','smsStatus','whatsappStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','map'];(function(_0x131536,_0x4aab80){var _0x1c4de5=function(_0x286227){while(--_0x286227){_0x131536['push'](_0x131536['shift']());}};_0x1c4de5(++_0x4aab80);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xb2f3[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x3b2f('0x0'));var jayson=require(_0x3b2f('0x1'));var db=require(_0x3b2f('0x2'))['db'];var amiClient=jayson[_0x3b2f('0x3')][_0x3b2f('0x4')]({'port':0x232a});var routingClient=jayson[_0x3b2f('0x3')][_0x3b2f('0x4')]({'port':0x232c});function isAgentPaused(_0x4f9278,_0x6748ce){var _0x3e35a1=[_0x4f9278[_0x3b2f('0x5')],_0x4f9278[_0x3b2f('0x6')],_0x4f9278[_0x3b2f('0x7')],_0x4f9278[_0x3b2f('0x8')],_0x4f9278[_0x3b2f('0x9')],_0x4f9278['voicePause'],_0x4f9278[_0x3b2f('0xa')]];if(!_0x6748ce)return _['every'](_0x3e35a1);var _0x266ed2=_[_0x3b2f('0xb')](_0x3e35a1);return _0x266ed2[_0x3b2f('0xc')]>0x0&&_0x266ed2[_0x3b2f('0xc')]<_0x3e35a1['length']?!![]:![];}function isIdle(_0x4ee831){return _0x4ee831===_0x3b2f('0xd')||_0x4ee831===_0x3b2f('0xe')||_0x4ee831===_0x3b2f('0xf')||_0x4ee831===_0x3b2f('0x10')||_[_0x3b2f('0x11')](_0x4ee831);}function isAgentIdle(_0x3feb27){if(_0x3feb27[_0x3b2f('0x12')]!==_0x3b2f('0xd')&&_0x3feb27[_0x3b2f('0x13')]){_0x3feb27[_0x3b2f('0x12')]=_0x3b2f('0x14');return![];}return _[_0x3b2f('0x15')]([_0x3feb27[_0x3b2f('0x16')],_0x3feb27[_0x3b2f('0x17')],_0x3feb27[_0x3b2f('0x18')],_0x3feb27['openchannelStatus'],_0x3feb27[_0x3b2f('0x19')],_0x3feb27['voiceStatus'],_0x3feb27[_0x3b2f('0x1a')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x3b2f('0x1b')]('Agents',{})[_0x3b2f('0x1c')](function(_0x4c028a){if(_0x4c028a[_0x3b2f('0x1d')]){throw new Error(_0x3b2f('0x1e'));}var _0xd5a583=_0x4c028a[_0x3b2f('0x1f')];return routingClient['request']('Agents',{})[_0x3b2f('0x1c')](function(_0x6d8948){if(_0x6d8948[_0x3b2f('0x1d')]){throw new Error(_0x3b2f('0x20'));}var _0x3dea8b=_0x6d8948[_0x3b2f('0x1f')];return _[_0x3b2f('0x21')]({},_0xd5a583,_0x3dea8b);});})[_0x3b2f('0x22')](function(_0x1a93b3){throw _0x1a93b3;});}exports[_0x3b2f('0x23')]=getRealtimeAgents;function getAgentStatus(_0x9d7819){var _0x2116aa=_0x3b2f('0xe');if(isAgentPaused(_0x9d7819))_0x2116aa=_0x3b2f('0x14');else if(isAgentPaused(_0x9d7819,!![]))_0x2116aa='*pause';else if(isAgentIdle(_0x9d7819))_0x2116aa=_0x3b2f('0xd');else _0x2116aa=_0x3b2f('0x24');return _0x2116aa;}exports[_0x3b2f('0x25')]=getAgentStatus;function getAgentIdsByQueues(_0xef73a0,_0x57e96a){var _0x1476a0=_[_0x3b2f('0x26')](_0xef73a0)?_0xef73a0:[_0xef73a0];var _0x5ed7bd=_[_0x3b2f('0x27')](_0x57e96a)+'Queue';var _0x28ef68=_[_0x3b2f('0x28')](_0x1476a0,function(_0x267fa5){return db[_0x5ed7bd][_0x3b2f('0x29')]({'where':{'id':_0x267fa5}})['then'](function(_0x36f73b){if(!_0x36f73b)return[];return _0x36f73b[_0x3b2f('0x2a')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x28ef68)['then'](function(_0x11e9e7){var _0x44fa57=_(_0x11e9e7)[_0x3b2f('0x2b')]()[_0x3b2f('0x28')]('id')['uniq']()['value']();return _0x44fa57;});}exports[_0x3b2f('0x2c')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5a39f0,_0xd3e5b2,_0x2a9afe){try{if(_0xd3e5b2['length']>0x0){_0x5a39f0=_0x5a39f0[_0x3b2f('0xb')](function(_0x4b76ea){return _0xd3e5b2[_0x3b2f('0x2d')](_0x4b76ea['id']);});}var _0x21c8a4=_0x5a39f0[_0x3b2f('0xb')](function(_0x469fc9){var _0x3f4bd2=_0x3b2f('0x24');if(isAgentIdle(_0x469fc9)){_0x3f4bd2='idle';}return _0x3f4bd2===_0x2a9afe;});return _[_0x3b2f('0x28')](_0x21c8a4,'id');}catch(_0x335e75){throw _0x335e75;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x500e82,_0x450080,_0x3380d4){return Promise['resolve']()['then'](function(){if(_0x450080[_0x3b2f('0xc')]>0x0){_0x500e82=_0x500e82[_0x3b2f('0xb')](function(_0x2bab13){return _0x450080[_0x3b2f('0x2d')](_0x2bab13['id']);});}return _0x500e82;})[_0x3b2f('0x1c')](function(){return db[_0x3b2f('0x2e')]['findAll']({'attributes':['id',_0x3b2f('0x2f'),_0x3b2f('0x30'),'chatPause',_0x3b2f('0x6'),_0x3b2f('0x7'),_0x3b2f('0x8'),_0x3b2f('0x9'),'voicePause',_0x3b2f('0xa'),_0x3b2f('0x31')],'where':{'id':{'$in':_[_0x3b2f('0x28')](_0x500e82,'id')}},'raw':!![]});})[_0x3b2f('0x1c')](function(_0x500b73){return _0x500b73['map'](function(_0x2421ce){var _0x30214f=_[_0x3b2f('0x32')](_0x500e82,['id',_0x2421ce['id']]);var _0xf0f1c=filterAgentAttributes(_0x30214f);_[_0x3b2f('0x21')](_0x2421ce,_0xf0f1c);_0x2421ce['globalStatus']=getAgentStatus(_0x2421ce);return _0x2421ce;});})['then'](function(_0xf7fb3){var _0x1af83a=sortAgentsByStatus(_0xf7fb3,_0x3380d4);return _[_0x3b2f('0x28')](_0x1af83a,'id');})['catch'](function(_0x296d4e){throw _0x296d4e;});}exports[_0x3b2f('0x33')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2e50f4){var _0x5e1cde={'fields':[],'order':null};var _0x29eddb=_0x2e50f4[_0x3b2f('0x34')](',');_0x5e1cde[_0x3b2f('0x35')]=_['filter'](_0x29eddb,function(_0x51bdef){if(!_0x51bdef[_0x3b2f('0x2d')]('globalStatus')){return!![];}_0x5e1cde['order']=_[_0x3b2f('0x36')](_0x51bdef,'-')?_0x3b2f('0x37'):'ASC';return![];});return _0x5e1cde;}exports[_0x3b2f('0x38')]=getUpdatedSortOptions;function validateSortParameter(_0x39bf5){if(!_0x39bf5){_0x39bf5=_0x3b2f('0x39');}if(_0x39bf5[_0x3b2f('0x2d')](_0x3b2f('0x30'))&&!_0x39bf5[_0x3b2f('0x2d')](_0x3b2f('0x3a'))){var _0x1b0e8e=_0x39bf5['substring'](0x0,_0x39bf5[_0x3b2f('0x3b')](_0x3b2f('0x30')));_0x39bf5+=','+_0x1b0e8e+_0x3b2f('0x3a');}return _0x39bf5;}exports[_0x3b2f('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0x2f3691,_0x3fbc7e){var _0x24981f=_0x2f3691[_0x3b2f('0x3d')](function(_0x21acde,_0x507813){if(_0x21acde[_0x3b2f('0x3e')]===_0x507813[_0x3b2f('0x3e')]){if(_0x21acde[_0x3b2f('0x3e')]==='pause'){if(_0x3fbc7e===_0x3b2f('0x37')){return(_0x21acde['pauseType']||'')<(_0x507813[_0x3b2f('0x31')]||'')||_0x21acde[_0x3b2f('0x30')][_0x3b2f('0x3f')]()>_0x507813[_0x3b2f('0x30')][_0x3b2f('0x3f')]()?0x1:-0x1;}else{return(_0x21acde[_0x3b2f('0x31')]||'')<(_0x507813['pauseType']||'')||_0x21acde[_0x3b2f('0x30')]['toLowerCase']()>_0x507813[_0x3b2f('0x30')][_0x3b2f('0x3f')]()?-0x1:0x1;}}else{if(_0x3fbc7e==='DESC'){return _0x21acde[_0x3b2f('0x30')][_0x3b2f('0x3f')]()<_0x507813[_0x3b2f('0x30')][_0x3b2f('0x3f')]()?0x1:-0x1;}else{return _0x21acde[_0x3b2f('0x30')]['toLowerCase']()<_0x507813['fullname'][_0x3b2f('0x3f')]()?-0x1:0x1;}}}else{if(_0x3fbc7e==='DESC'){return _0x21acde[_0x3b2f('0x3e')]<_0x507813['globalStatus']?0x1:-0x1;}else{return _0x21acde[_0x3b2f('0x3e')]<_0x507813[_0x3b2f('0x3e')]?-0x1:0x1;}}});return _0x24981f;}exports[_0x3b2f('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x1d6ce0){var _0x4e6557=[_0x3b2f('0x41'),_0x3b2f('0x42'),_0x3b2f('0x43'),'lastPauseAt',_0x3b2f('0x31'),_0x3b2f('0x44'),_0x3b2f('0x3a'),_0x3b2f('0x45'),'chatPause',_0x3b2f('0x8'),_0x3b2f('0x7'),_0x3b2f('0x9'),_0x3b2f('0xa'),_0x3b2f('0x6'),_0x3b2f('0x13'),_0x3b2f('0x46'),_0x3b2f('0x47'),'mailCapacity',_0x3b2f('0x48'),_0x3b2f('0x49'),'faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity',_0x3b2f('0x4a'),_0x3b2f('0x4b'),_0x3b2f('0x4c'),_0x3b2f('0x4d'),'chatStatus',_0x3b2f('0x4e'),_0x3b2f('0x18'),'smsStatus','whatsappStatus','faxStatus',_0x3b2f('0x12'),_0x3b2f('0x4f'),'openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime',_0x3b2f('0x50'),_0x3b2f('0x51'),_0x3b2f('0x52'),_0x3b2f('0x53'),'screenrecording',_0x3b2f('0x54'),'phoneBarEnableAutomaticScreenRecording'];var _0x35c68a=[_0x3b2f('0x5'),_0x3b2f('0x8'),_0x3b2f('0x7'),'smsPause','whatsappPause','faxPause','voicePause',_0x3b2f('0x42')];var _0x56e5c9=_(_0x1d6ce0)[_0x3b2f('0x55')](_0x35c68a)[_0x3b2f('0x56')](_0x4e6557)['value']();return _0x56e5c9;}exports[_0x3b2f('0x57')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x3b2f('0x2f'),_0x3b2f('0x30'),'role',_0x3b2f('0x3a'),_0x3b2f('0x42'),'globalStatus','userpic',_0x3b2f('0x43'),_0x3b2f('0x31'),_0x3b2f('0x44'),_0x3b2f('0x6'),'chatPause',_0x3b2f('0x7'),'openchannelPause',_0x3b2f('0x9'),'voicePause',_0x3b2f('0xa'),_0x3b2f('0x16'),'faxStatus',_0x3b2f('0x18'),_0x3b2f('0x4e'),_0x3b2f('0x19'),'voiceStatus','whatsappStatus',_0x3b2f('0x4f'),_0x3b2f('0x50'),_0x3b2f('0x58'),_0x3b2f('0x59'),_0x3b2f('0x5a'),'voiceStatusTime',_0x3b2f('0x5b'),_0x3b2f('0x46'),_0x3b2f('0x5c'),_0x3b2f('0x5d'),_0x3b2f('0x47'),_0x3b2f('0x48'),'whatsappCapacity',_0x3b2f('0x5e'),'faxCurrentCapacity',_0x3b2f('0x4a'),'openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','phoneBarEnableScreenRecordingByAgent',_0x3b2f('0x5f'),_0x3b2f('0x53'),'onhold',_0x3b2f('0x52'),_0x3b2f('0x60')];}exports[_0x3b2f('0x61')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x9563=['isArray','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','fullname','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','startsWith','DESC','ASC','getUpdatedSortOptions','fullname,internal','internal','substring','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','address','chatPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','faxCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatus','whatsappStatus','faxStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','name','role','mailStatus','faxStatusTime','smsStatusTime','whatsappCapacity','openchannelCurrentCapacity','phoneBarEnableScreenRecordingByAgent','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','client','http','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','every','filter','length','idle','unknown','unavailable','isNil','voiceStatus','voicePause','pause','chatStatus','smsStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','busy','getAgentStatus'];(function(_0x139468,_0x12f145){var _0x121e76=function(_0x16ded0){while(--_0x16ded0){_0x139468['push'](_0x139468['shift']());}};_0x121e76(++_0x12f145);}(_0x9563,0x1e7));var _0x3956=function(_0x17198c,_0x1d6134){_0x17198c=_0x17198c-0x0;var _0xac0b0d=_0x9563[_0x17198c];return _0xac0b0d;};'use strict';var _=require(_0x3956('0x0'));var jayson=require(_0x3956('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x3956('0x2')][_0x3956('0x3')]({'port':0x232a});var routingClient=jayson[_0x3956('0x2')][_0x3956('0x3')]({'port':0x232c});function isAgentPaused(_0x5c89e9,_0x58382b){var _0x11ded2=[_0x5c89e9['chatPause'],_0x5c89e9[_0x3956('0x4')],_0x5c89e9[_0x3956('0x5')],_0x5c89e9[_0x3956('0x6')],_0x5c89e9[_0x3956('0x7')],_0x5c89e9['voicePause'],_0x5c89e9[_0x3956('0x8')]];if(!_0x58382b)return _[_0x3956('0x9')](_0x11ded2);var _0x2863cd=_[_0x3956('0xa')](_0x11ded2);return _0x2863cd[_0x3956('0xb')]>0x0&&_0x2863cd['length']<_0x11ded2['length']?!![]:![];}function isIdle(_0x3cc5cc){return _0x3cc5cc===_0x3956('0xc')||_0x3cc5cc===_0x3956('0xd')||_0x3cc5cc===_0x3956('0xe')||_0x3cc5cc==='ringing'||_[_0x3956('0xf')](_0x3cc5cc);}function isAgentIdle(_0x19019b){if(_0x19019b[_0x3956('0x10')]!==_0x3956('0xc')&&_0x19019b[_0x3956('0x11')]){_0x19019b[_0x3956('0x10')]=_0x3956('0x12');return![];}return _[_0x3956('0x9')]([_0x19019b[_0x3956('0x13')],_0x19019b['faxStatus'],_0x19019b['mailStatus'],_0x19019b['openchannelStatus'],_0x19019b[_0x3956('0x14')],_0x19019b[_0x3956('0x10')],_0x19019b['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0x3956('0x15')](_0x3956('0x16'),{})[_0x3956('0x17')](function(_0x19bd9c){if(_0x19bd9c[_0x3956('0x18')]){throw new Error(_0x3956('0x19'));}var _0x429d28=_0x19bd9c[_0x3956('0x1a')];return routingClient[_0x3956('0x15')](_0x3956('0x16'),{})[_0x3956('0x17')](function(_0x189e6c){if(_0x189e6c[_0x3956('0x18')]){throw new Error(_0x3956('0x1b'));}var _0x3a90b2=_0x189e6c[_0x3956('0x1a')];return _[_0x3956('0x1c')]({},_0x429d28,_0x3a90b2);});})[_0x3956('0x1d')](function(_0x31552d){throw _0x31552d;});}exports[_0x3956('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x4b9acc){var _0x3be8ab=_0x3956('0xd');if(isAgentPaused(_0x4b9acc))_0x3be8ab='pause';else if(isAgentPaused(_0x4b9acc,!![]))_0x3be8ab='*pause';else if(isAgentIdle(_0x4b9acc))_0x3be8ab='idle';else _0x3be8ab=_0x3956('0x1f');return _0x3be8ab;}exports[_0x3956('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x4e7e56,_0x2f9bb5){var _0x5b2fdd=_[_0x3956('0x21')](_0x4e7e56)?_0x4e7e56:[_0x4e7e56];var _0x49758f=_[_0x3956('0x22')](_0x2f9bb5)+_0x3956('0x23');var _0x1395d4=_[_0x3956('0x24')](_0x5b2fdd,function(_0x31b849){return db[_0x49758f][_0x3956('0x25')]({'where':{'id':_0x31b849}})['then'](function(_0x5a6339){if(!_0x5a6339)return[];return _0x5a6339[_0x3956('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x3956('0x27')](_0x1395d4)['then'](function(_0x51a47c){var _0x10c67b=_(_0x51a47c)[_0x3956('0x28')]()['map']('id')[_0x3956('0x29')]()[_0x3956('0x2a')]();return _0x10c67b;});}exports[_0x3956('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x98bbcf,_0x2a1bdd,_0x4389be){try{if(_0x2a1bdd['length']>0x0){_0x98bbcf=_0x98bbcf[_0x3956('0xa')](function(_0x222986){return _0x2a1bdd[_0x3956('0x2c')](_0x222986['id']);});}var _0x5e680c=_0x98bbcf[_0x3956('0xa')](function(_0x3956f5){var _0x113f5d='busy';if(isAgentIdle(_0x3956f5)){_0x113f5d=_0x3956('0xc');}return _0x113f5d===_0x4389be;});return _[_0x3956('0x24')](_0x5e680c,'id');}catch(_0x8d5bdb){throw _0x8d5bdb;}}exports[_0x3956('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xef1b56,_0x2e60f9,_0x424f67){return Promise[_0x3956('0x2e')]()[_0x3956('0x17')](function(){if(_0x2e60f9[_0x3956('0xb')]>0x0){_0xef1b56=_0xef1b56['filter'](function(_0x17e769){return _0x2e60f9[_0x3956('0x2c')](_0x17e769['id']);});}return _0xef1b56;})['then'](function(){return db[_0x3956('0x2f')][_0x3956('0x30')]({'attributes':['id','name',_0x3956('0x31'),'chatPause',_0x3956('0x4'),_0x3956('0x5'),_0x3956('0x6'),'smsPause','voicePause',_0x3956('0x8'),_0x3956('0x32')],'where':{'id':{'$in':_['map'](_0xef1b56,'id')}},'raw':!![]});})[_0x3956('0x17')](function(_0x4f2eb1){return _0x4f2eb1[_0x3956('0x24')](function(_0x221eaf){var _0x265eb5=_[_0x3956('0x33')](_0xef1b56,['id',_0x221eaf['id']]);var _0x35e10e=filterAgentAttributes(_0x265eb5);_[_0x3956('0x1c')](_0x221eaf,_0x35e10e);_0x221eaf[_0x3956('0x34')]=getAgentStatus(_0x221eaf);return _0x221eaf;});})[_0x3956('0x17')](function(_0x5c6e67){var _0x2bbc96=sortAgentsByStatus(_0x5c6e67,_0x424f67);return _['map'](_0x2bbc96,'id');})[_0x3956('0x1d')](function(_0x389787){throw _0x389787;});}exports[_0x3956('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2577bf){var _0x1d8604={'fields':[],'order':null};var _0x1980e6=_0x2577bf[_0x3956('0x36')](',');_0x1d8604[_0x3956('0x37')]=_[_0x3956('0xa')](_0x1980e6,function(_0x210eff){if(!_0x210eff[_0x3956('0x2c')](_0x3956('0x34'))){return!![];}_0x1d8604['order']=_[_0x3956('0x38')](_0x210eff,'-')?_0x3956('0x39'):_0x3956('0x3a');return![];});return _0x1d8604;}exports[_0x3956('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x4145cf){if(!_0x4145cf){_0x4145cf=_0x3956('0x3c');}if(_0x4145cf[_0x3956('0x2c')](_0x3956('0x31'))&&!_0x4145cf['includes'](_0x3956('0x3d'))){var _0xbddef1=_0x4145cf[_0x3956('0x3e')](0x0,_0x4145cf['indexOf'](_0x3956('0x31')));_0x4145cf+=','+_0xbddef1+_0x3956('0x3d');}return _0x4145cf;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x4774c6,_0x267e1a){var _0x3ba20b=_0x4774c6['sort'](function(_0x116aef,_0x3e7e2e){if(_0x116aef['globalStatus']===_0x3e7e2e['globalStatus']){if(_0x116aef[_0x3956('0x34')]===_0x3956('0x12')){if(_0x267e1a===_0x3956('0x39')){return(_0x116aef[_0x3956('0x32')]||'')<(_0x3e7e2e[_0x3956('0x32')]||'')||_0x116aef['fullname'][_0x3956('0x3f')]()>_0x3e7e2e['fullname'][_0x3956('0x3f')]()?0x1:-0x1;}else{return(_0x116aef[_0x3956('0x32')]||'')<(_0x3e7e2e['pauseType']||'')||_0x116aef[_0x3956('0x31')]['toLowerCase']()>_0x3e7e2e[_0x3956('0x31')][_0x3956('0x3f')]()?-0x1:0x1;}}else{if(_0x267e1a===_0x3956('0x39')){return _0x116aef[_0x3956('0x31')][_0x3956('0x3f')]()<_0x3e7e2e[_0x3956('0x31')][_0x3956('0x3f')]()?0x1:-0x1;}else{return _0x116aef[_0x3956('0x31')][_0x3956('0x3f')]()<_0x3e7e2e['fullname'][_0x3956('0x3f')]()?-0x1:0x1;}}}else{if(_0x267e1a==='DESC'){return _0x116aef[_0x3956('0x34')]<_0x3e7e2e[_0x3956('0x34')]?0x1:-0x1;}else{return _0x116aef[_0x3956('0x34')]<_0x3e7e2e['globalStatus']?-0x1:0x1;}}});return _0x3ba20b;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x4e628b){var _0x337f27=[_0x3956('0x40'),_0x3956('0x41'),_0x3956('0x42'),'lastPauseAt',_0x3956('0x32'),_0x3956('0x43'),_0x3956('0x3d'),_0x3956('0x44'),_0x3956('0x45'),_0x3956('0x6'),_0x3956('0x5'),_0x3956('0x7'),_0x3956('0x8'),'faxPause','voicePause',_0x3956('0x46'),_0x3956('0x47'),_0x3956('0x48'),_0x3956('0x49'),'whatsappCapacity',_0x3956('0x4a'),'chatCurrentCapacity','openchannelCurrentCapacity',_0x3956('0x4b'),_0x3956('0x4c'),_0x3956('0x4d'),_0x3956('0x4e'),_0x3956('0x13'),_0x3956('0x4f'),'mailStatus',_0x3956('0x14'),_0x3956('0x50'),_0x3956('0x51'),'voiceStatus',_0x3956('0x52'),_0x3956('0x53'),_0x3956('0x54'),'smsStatusTime',_0x3956('0x55'),'faxStatusTime',_0x3956('0x56'),_0x3956('0x57'),_0x3956('0x58'),_0x3956('0x59'),'phoneBarEnableScreenRecordingByAgent',_0x3956('0x5a')];var _0x37ae0d=[_0x3956('0x45'),_0x3956('0x6'),_0x3956('0x5'),_0x3956('0x7'),'whatsappPause',_0x3956('0x4'),_0x3956('0x11'),_0x3956('0x41')];var _0x42f699=_(_0x4e628b)[_0x3956('0x5b')](_0x37ae0d)[_0x3956('0x5c')](_0x337f27)[_0x3956('0x2a')]();return _0x42f699;}exports[_0x3956('0x5d')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x3956('0x5e'),_0x3956('0x31'),_0x3956('0x5f'),_0x3956('0x3d'),'online',_0x3956('0x34'),'userpic','lastLoginAt',_0x3956('0x32'),_0x3956('0x43'),'faxPause',_0x3956('0x45'),_0x3956('0x5'),_0x3956('0x6'),'smsPause',_0x3956('0x11'),_0x3956('0x8'),'chatStatus','faxStatus',_0x3956('0x60'),_0x3956('0x4f'),_0x3956('0x14'),_0x3956('0x10'),_0x3956('0x50'),'chatStatusTime',_0x3956('0x61'),'mailStatusTime',_0x3956('0x53'),_0x3956('0x62'),_0x3956('0x56'),'whatsappStatusTime',_0x3956('0x46'),_0x3956('0x4a'),'mailCapacity',_0x3956('0x47'),'smsCapacity',_0x3956('0x63'),'chatCurrentCapacity',_0x3956('0x4e'),_0x3956('0x4b'),_0x3956('0x64'),_0x3956('0x4c'),'whatsappCurrentCapacity',_0x3956('0x65'),'phoneBarEnableAutomaticScreenRecording',_0x3956('0x58'),_0x3956('0x66'),_0x3956('0x57'),_0x3956('0x59')];}exports[_0x3956('0x67')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index cdb93cd..cdf6ca7 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7aa=['predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','startCase','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues','inbound','concat','outbound','pTalking','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','paused','waiting','busy','invalid','loggedInDb','onHold','ringing','ringInUse','talking','unavailable','unknown','originated','message','statusMessage','dialActive','dialMethod','startPredictive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe7aa,0x107));var _0xae7a=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xe7aa[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0xae7a('0x0'));var jayson=require(_0xae7a('0x1'));var util=require(_0xae7a('0x2'));var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0xae7a('0x3')][_0xae7a('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xae7a('0x5'),_0xae7a('0x6'),_0xae7a('0x7'),_0xae7a('0x8')];var VOICE_QUEUE_ATTRIBUTES=[_0xae7a('0x9'),'inUse',_0xae7a('0xa'),_0xae7a('0xb'),'notInUse',_0xae7a('0xc'),_0xae7a('0xd'),_0xae7a('0xe'),_0xae7a('0xf'),_0xae7a('0x10'),_0xae7a('0x11')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0xae7a('0x12'),_0xae7a('0x13'),_0xae7a('0x14'),_0xae7a('0x15'),_0xae7a('0x16'),'Trunk',_0xae7a('0x17'),'startProgressive','erlangCalls',_0xae7a('0x18'),_0xae7a('0x19'),_0xae7a('0x1a'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0xae7a('0x1b'),'predictiveIntervalTotalCalls',_0xae7a('0x1c'),_0xae7a('0x1d'),_0xae7a('0x1e'),_0xae7a('0x1f'),_0xae7a('0x20')];function getRealtimeQueues(_0xa2ef64,_0x34b3b2){var _0x14883a=_0x34b3b2===_0xae7a('0x21')?amiClient:routingClient;return _0x14883a['request'](_[_0xae7a('0x22')](_0x34b3b2)+_0xae7a('0x23'),_0xa2ef64)['then'](function(_0x502f87){if(_0x502f87[_0xae7a('0x24')])throw new Error(util[_0xae7a('0x25')](_0xae7a('0x26'),_0x34b3b2));return _0x502f87['result'];})[_0xae7a('0x27')](function(_0x27e81e){throw _0x27e81e;});}exports[_0xae7a('0x28')]=getRealtimeQueues;function initializeQueues(_0x5f4547,_0x4e3bcf,_0x34f21c,_0x341a0f){var _0x4c70ad=DEFAULT_QUEUE_ATTRIBUTES;if(_0x34f21c===_0xae7a('0x21')){if(_0x341a0f===_0xae7a('0x29')){_0x4c70ad=_0x4c70ad[_0xae7a('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x341a0f===_0xae7a('0x2b')){_0x4c70ad=_0x4c70ad['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x5f4547['map'](function(_0x31defb){var _0x1d9c50=_0x31defb['get']({'plain':!![]});_0x1d9c50[_0xae7a('0x7')]=0x0;_0x1d9c50['loggedInDb']=0x0;_0x1d9c50[_0xae7a('0x6')]=0x0;_0x1d9c50[_0xae7a('0x5')]=0x0;_0x1d9c50[_0xae7a('0x8')]=0x0;if(_0x34f21c===_0xae7a('0x21')){_0x1d9c50[_0xae7a('0xf')]=0x0;_0x1d9c50[_0xae7a('0x9')]=0x0;if(_0x341a0f===_0xae7a('0x2b')){_0x1d9c50[_0xae7a('0x2c')]=0x0;_0x1d9c50['originated']=0x0;}}var _0x3d861e=_[_0xae7a('0x2d')](_0x4e3bcf,['id',_0x1d9c50['id']]);if(_0x3d861e){_[_0xae7a('0x2e')](_0x1d9c50,_[_0xae7a('0x2f')](_0x3d861e,_0x4c70ad));}return _0x1d9c50;});}exports[_0xae7a('0x30')]=initializeQueues; \ No newline at end of file +var _0xe3fb=['voice','request','startCase','Queues','then','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map','paused','talking','pick','jayson/promise','client','http','waiting','busy','inUse','loggedInDb','notInUse','onHold','ringing','ringInUse','unavailable','unknown','pTalking','originated','message','dialActive','dialMethod','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime'];(function(_0x52a620,_0x56986b){var _0x263684=function(_0x31df87){while(--_0x31df87){_0x52a620['push'](_0x52a620['shift']());}};_0x263684(++_0x56986b);}(_0xe3fb,0xa4));var _0xbe3f=function(_0x31bcbe,_0x4ce65b){_0x31bcbe=_0x31bcbe-0x0;var _0x485320=_0xe3fb[_0x31bcbe];return _0x485320;};'use strict';var _=require('lodash');var jayson=require(_0xbe3f('0x0'));var util=require('util');var amiClient=jayson[_0xbe3f('0x1')][_0xbe3f('0x2')]({'port':0x232a});var routingClient=jayson[_0xbe3f('0x1')][_0xbe3f('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available','loggedIn','paused',_0xbe3f('0x3')];var VOICE_QUEUE_ATTRIBUTES=[_0xbe3f('0x4'),_0xbe3f('0x5'),'invalid',_0xbe3f('0x6'),_0xbe3f('0x7'),_0xbe3f('0x8'),_0xbe3f('0x9'),_0xbe3f('0xa'),'talking',_0xbe3f('0xb'),_0xbe3f('0xc')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xbe3f('0xd'),_0xbe3f('0xe'),_0xbe3f('0xf'),'statusMessage',_0xbe3f('0x10'),_0xbe3f('0x11'),'Trunk',_0xbe3f('0x12'),_0xbe3f('0x13'),_0xbe3f('0x14'),_0xbe3f('0x15'),_0xbe3f('0x16'),_0xbe3f('0x17'),_0xbe3f('0x18'),_0xbe3f('0x19'),_0xbe3f('0x1a'),_0xbe3f('0x1b'),_0xbe3f('0x1c'),'predictiveIntervalAnsweredCalls',_0xbe3f('0x1d'),_0xbe3f('0x1e'),'predictiveIntervalAvgHoldtime',_0xbe3f('0x1f')];function getRealtimeQueues(_0x40b7ab,_0x1e4712){var _0x54b121=_0x1e4712===_0xbe3f('0x20')?amiClient:routingClient;return _0x54b121[_0xbe3f('0x21')](_[_0xbe3f('0x22')](_0x1e4712)+_0xbe3f('0x23'),_0x40b7ab)[_0xbe3f('0x24')](function(_0x1c4086){if(_0x1c4086[_0xbe3f('0x25')])throw new Error(util['format'](_0xbe3f('0x26'),_0x1e4712));return _0x1c4086[_0xbe3f('0x27')];})[_0xbe3f('0x28')](function(_0x26f729){throw _0x26f729;});}exports[_0xbe3f('0x29')]=getRealtimeQueues;function initializeQueues(_0x40d403,_0x3847d6,_0x21e6cf,_0x2c811f){var _0x3b8d3e=DEFAULT_QUEUE_ATTRIBUTES;if(_0x21e6cf==='voice'){if(_0x2c811f===_0xbe3f('0x2a')){_0x3b8d3e=_0x3b8d3e[_0xbe3f('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x2c811f===_0xbe3f('0x2c')){_0x3b8d3e=_0x3b8d3e['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x40d403[_0xbe3f('0x2d')](function(_0x562020){var _0xef0cb8=_0x562020['get']({'plain':!![]});_0xef0cb8[_0xbe3f('0x2e')]=0x0;_0xef0cb8['loggedInDb']=0x0;_0xef0cb8['loggedIn']=0x0;_0xef0cb8['available']=0x0;_0xef0cb8[_0xbe3f('0x3')]=0x0;if(_0x21e6cf===_0xbe3f('0x20')){_0xef0cb8[_0xbe3f('0x2f')]=0x0;_0xef0cb8[_0xbe3f('0x4')]=0x0;if(_0x2c811f===_0xbe3f('0x2c')){_0xef0cb8['pTalking']=0x0;_0xef0cb8[_0xbe3f('0xe')]=0x0;}}var _0x3c162d=_['find'](_0x3847d6,['id',_0xef0cb8['id']]);if(_0x3c162d){_['merge'](_0xef0cb8,_[_0xbe3f('0x30')](_0x3c162d,_0x3b8d3e));}return _0xef0cb8;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index c809a2b..cb27e56 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x19eb1c,_0xd78b93){var _0x107257=function(_0x386e80){while(--_0x386e80){_0x19eb1c['push'](_0x19eb1c['shift']());}};_0x107257(++_0xd78b93);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x4f4757,_0x44241a){var _0x549c37=function(_0x3c3cfb){while(--_0x3c3cfb){_0x4f4757['push'](_0x4f4757['shift']());}};_0x549c37(++_0x44241a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 0e974d2..b01f5e4 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 _0x0b3c=['utf8','replace','hostname','md5','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','family','IPv4','head','mac','00:00:00:00:00:00','127.0.0.1','getFirstInterface','map','model','join','createHash','update','digest','hex','getUuid','licenseToken','test'];(function(_0x34859a,_0x3de4f5){var _0xbe0a03=function(_0x216094){while(--_0x216094){_0x34859a['push'](_0x34859a['shift']());}};_0xbe0a03(++_0x3de4f5);}(_0x0b3c,0x18b));var _0xc0b3=function(_0x5f79cb,_0x4b2c88){_0x5f79cb=_0x5f79cb-0x0;var _0x3580bc=_0x0b3c[_0x5f79cb];return _0x3580bc;};'use strict';var _=require(_0xc0b3('0x0'));var os=require('os');var crypto=require(_0xc0b3('0x1'));var machine=require(_0xc0b3('0x2'));var exec=require(_0xc0b3('0x3'))['execSync'];var config=require(_0xc0b3('0x4'));function getInterfaces(){var _0x45549c=[];var _0x38f9d0=os[_0xc0b3('0x5')]();var _0x290e59=_[_0xc0b3('0x6')](_[_0xc0b3('0x7')](_0x38f9d0));for(var _0x145342=0x0;_0x145342<_0x290e59['length'];_0x145342++){var _0x14a9a8=_0x38f9d0[_0x290e59[_0x145342]]['filter'](function(_0x4ff120){return _0x4ff120[_0xc0b3('0x8')]===_0xc0b3('0x9')&&_0x4ff120['internal']===![];});_0x45549c=_0x45549c['concat'](_0x14a9a8);}return _0x45549c;}function getFirstInterface(){var _0xe174b6=_[_0xc0b3('0xa')](getInterfaces());return{'macAddress':_0xe174b6&&_0xe174b6['mac']?_0xe174b6[_0xc0b3('0xb')]:_0xc0b3('0xc'),'ipAddress':_0xe174b6&&_0xe174b6['address']?_0xe174b6['address']:_0xc0b3('0xd')};}exports[_0xc0b3('0xe')]=getFirstInterface;function getCPUhash(){var _0x38c333=_[_0xc0b3('0x6')](os['cpus']()[_0xc0b3('0xf')](function(_0x40d921){return _0x40d921[_0xc0b3('0x10')];}))[_0xc0b3('0x11')](':');return crypto[_0xc0b3('0x12')]('md5')[_0xc0b3('0x13')](_0x38c333)[_0xc0b3('0x14')](_0xc0b3('0x15'));}exports[_0xc0b3('0x16')]=function(){var _0x86caea=os['platform']();var _0x3bcab4=/[0-9a-f-]{36}/;if(config[_0xc0b3('0x17')]&&_0x3bcab4[_0xc0b3('0x18')](config[_0xc0b3('0x17')])){return config[_0xc0b3('0x17')];}else if(_0x86caea==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xc0b3('0x19')})[_0xc0b3('0x1a')]('\x0d\x0a','');}else{var _0x3fe438=getFirstInterface();var _0x1127b5=getCPUhash();var _0x148662=_0x1127b5+'|'+os[_0xc0b3('0x1b')]()+'|'+_0x3fe438['macAddress']+'|'+_0x3fe438['ipAddress'];var _0x2a3dc2=crypto[_0xc0b3('0x12')](_0xc0b3('0x1c'))['update'](_0x148662)[_0xc0b3('0x14')](_0xc0b3('0x15'));return _0x2a3dc2[_0xc0b3('0x1d')](0x0,0x8)+'-'+_0x2a3dc2[_0xc0b3('0x1d')](0x8,0xc)+'-'+_0x2a3dc2[_0xc0b3('0x1d')](0xc,0x10)+'-'+_0x2a3dc2[_0xc0b3('0x1d')](0x10,0x14)+'-'+_0x2a3dc2[_0xc0b3('0x1d')](0x14);}}; \ No newline at end of file +var _0x2aff=['hex','getUuid','platform','licenseToken','win32','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','../environment','networkInterfaces','orderBy','length','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','join','createHash','md5','update','digest'];(function(_0x20507c,_0x164a33){var _0x369fc1=function(_0x44ee7e){while(--_0x44ee7e){_0x20507c['push'](_0x20507c['shift']());}};_0x369fc1(++_0x164a33);}(_0x2aff,0xeb));var _0xf2af=function(_0x2bed29,_0x367b7e){_0x2bed29=_0x2bed29-0x0;var _0x10e2da=_0x2aff[_0x2bed29];return _0x10e2da;};'use strict';var _=require(_0xf2af('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require('child_process')['execSync'];var config=require(_0xf2af('0x1'));function getInterfaces(){var _0x6fb96a=[];var _0x5471ef=os[_0xf2af('0x2')]();var _0x54a11a=_[_0xf2af('0x3')](_['keys'](_0x5471ef));for(var _0x2e87f7=0x0;_0x2e87f7<_0x54a11a[_0xf2af('0x4')];_0x2e87f7++){var _0x4f9fdc=_0x5471ef[_0x54a11a[_0x2e87f7]][_0xf2af('0x5')](function(_0x15c21e){return _0x15c21e[_0xf2af('0x6')]==='IPv4'&&_0x15c21e[_0xf2af('0x7')]===![];});_0x6fb96a=_0x6fb96a[_0xf2af('0x8')](_0x4f9fdc);}return _0x6fb96a;}function getFirstInterface(){var _0x258bdd=_[_0xf2af('0x9')](getInterfaces());return{'macAddress':_0x258bdd&&_0x258bdd[_0xf2af('0xa')]?_0x258bdd[_0xf2af('0xa')]:_0xf2af('0xb'),'ipAddress':_0x258bdd&&_0x258bdd[_0xf2af('0xc')]?_0x258bdd[_0xf2af('0xc')]:'127.0.0.1'};}exports[_0xf2af('0xd')]=getFirstInterface;function getCPUhash(){var _0x3dfde0=_[_0xf2af('0x3')](os[_0xf2af('0xe')]()[_0xf2af('0xf')](function(_0x19ba47){return _0x19ba47['model'];}))[_0xf2af('0x10')](':');return crypto[_0xf2af('0x11')](_0xf2af('0x12'))[_0xf2af('0x13')](_0x3dfde0)[_0xf2af('0x14')](_0xf2af('0x15'));}exports[_0xf2af('0x16')]=function(){var _0x49bd72=os[_0xf2af('0x17')]();var _0xb140ce=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0xb140ce['test'](config[_0xf2af('0x18')])){return config[_0xf2af('0x18')];}else if(_0x49bd72===_0xf2af('0x19')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xf2af('0x1a')})[_0xf2af('0x1b')]('\x0d\x0a','');}else{var _0x4377f3=getFirstInterface();var _0x528e7c=getCPUhash();var _0x5f020d=_0x528e7c+'|'+os[_0xf2af('0x1c')]()+'|'+_0x4377f3[_0xf2af('0x1d')]+'|'+_0x4377f3[_0xf2af('0x1e')];var _0xfc8401=crypto[_0xf2af('0x11')](_0xf2af('0x12'))[_0xf2af('0x13')](_0x5f020d)[_0xf2af('0x14')]('hex');return _0xfc8401[_0xf2af('0x1f')](0x0,0x8)+'-'+_0xfc8401['substring'](0x8,0xc)+'-'+_0xfc8401[_0xf2af('0x1f')](0xc,0x10)+'-'+_0xfc8401[_0xf2af('0x1f')](0x10,0x14)+'-'+_0xfc8401[_0xf2af('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 2063187..56ad857 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 _0x535a=['decryptString','DEMO\x20START\x20AT\x20%s','catch','error','getUuid','findOrCreate','spread','message','default','util','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','version','GET','then','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','update','encryptString','diff'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x535a,0x75));var _0xa535=function(_0x27ffff,_0x357274){_0x27ffff=_0x27ffff-0x0;var _0x55e384=_0x535a[_0x27ffff];return _0x55e384;};'use strict';var util=require(_0xa535('0x0'));var moment=require('moment');var rp=require(_0xa535('0x1'));var BPromise=require(_0xa535('0x2'));var pkginfo=require(_0xa535('0x3'))(module,'version');var db=require(_0xa535('0x4'))['db'];var encryptor=require(_0xa535('0x5'));var hardware=require('./hardware');var logger=require(_0xa535('0x6'))(_0xa535('0x7'));var HOST=_0xa535('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5197e1){return new BPromise(function(_0xe37f26,_0x366638){var _0x49edbc=util['format'](_0xa535('0x9'),HOST,_0x5197e1,module[_0xa535('0xa')]['version']);if(oldToken){_0x49edbc=util[_0xa535('0xb')](_0xa535('0xc'),HOST,_0x5197e1,module[_0xa535('0xa')][_0xa535('0xd')],oldToken);}var _0x3a2566={'uri':_0x49edbc,'method':_0xa535('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x3a2566)[_0xa535('0xf')](function(_0x980fe7){_0xe37f26(_0x980fe7);})['catch'](function(_0x59d93b){_0x366638(_0x59d93b);});});}function manageLicense(_0x41369c,_0x284836){var _0x30b63a=_0x284836['get']({'plain':!![]});if(!isOldTokenSent&&_0x30b63a[_0xa535('0x10')]!==_0x41369c&&!_0x30b63a[_0xa535('0x11')]){oldToken=_0x30b63a['data1'];}httpRequest(_0x41369c)[_0xa535('0xf')](function(_0x25e51d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x25e51d[_0xa535('0x12')]){isOldTokenSent=![];if(!_0x30b63a[_0xa535('0x7')]&&_0x30b63a[_0xa535('0x7')]!=_0x25e51d[_0xa535('0x7')]||_0x30b63a[_0xa535('0x7')]&&_0x30b63a[_0xa535('0x11')]){logger[_0xa535('0x13')](_0xa535('0x14'));}if(_0x30b63a[_0xa535('0x7')]&&!_0x30b63a[_0xa535('0x11')]&&_0x30b63a[_0xa535('0x7')]!=_0x25e51d[_0xa535('0x7')]){logger[_0xa535('0x13')](_0xa535('0x15'));}if(_0x30b63a['license']&&!_0x30b63a['data2']&&_0x30b63a[_0xa535('0x7')]==_0x25e51d['license']){return _0x284836;}return _0x284836['update']({'data1':_0x41369c,'data2':null,'license':_0x25e51d[_0xa535('0x7')]});}else{if(_0x25e51d[_0xa535('0x7')]||_0x30b63a[_0xa535('0x7')]){if(!_0x30b63a['data2']){if(_0x30b63a[_0xa535('0x10')]==_0x41369c){GRAY_PERIOD_REASON='Disabled';logger[_0xa535('0x13')](_0xa535('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0xa535('0x17'),_0x30b63a[_0xa535('0x10')],_0x41369c);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xa535('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x284836[_0xa535('0x18')]({'data2':encryptor[_0xa535('0x19')](moment()[_0xa535('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xa535('0x1a')](encryptor[_0xa535('0x1b')](_0x30b63a['data2']),'days')>DAYS){logger[_0xa535('0x13')](_0xa535('0x1c'),moment()[_0xa535('0xb')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x284836[_0xa535('0x18')]({'data1':_0x41369c,'data2':null,'license':null});}}}else{if(_0x30b63a[_0xa535('0x10')]!=_0x41369c){logger[_0xa535('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x30b63a[_0xa535('0x10')],_0x41369c);return _0x284836[_0xa535('0x18')]({'data1':_0x41369c,'data2':null,'license':null});}}}return _0x284836;})[_0xa535('0xf')](function(_0x4d5fdf){_0x284836=_0x4d5fdf;})[_0xa535('0x1d')](function(_0x1ce209){logger[_0xa535('0x1e')](_0x1ce209['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xa535('0x1f')](),_0x284836);},TIME);});}function defaultLicense(){var _0x31116a=hardware[_0xa535('0x1f')]();if(_0x31116a){return db['License'][_0xa535('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x31116a}})[_0xa535('0x21')](function(_0x360642,_0x366006){logger[_0xa535('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x31116a);manageLicense(_0x31116a,_0x360642);})['catch'](function(_0x20fe83){logger[_0xa535('0x1e')](_0x20fe83[_0xa535('0x22')]);});}}exports[_0xa535('0x23')]=defaultLicense; \ No newline at end of file +var _0x0922=['toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data2','data1','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed'];(function(_0x82d4e3,_0x46fb1f){var _0x2a08fa=function(_0x36ddbb){while(--_0x36ddbb){_0x82d4e3['push'](_0x82d4e3['shift']());}};_0x2a08fa(++_0x46fb1f);}(_0x0922,0x193));var _0x2092=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x0922[_0x204eb7];return _0x37e444;};'use strict';var util=require(_0x2092('0x0'));var moment=require(_0x2092('0x1'));var rp=require(_0x2092('0x2'));var BPromise=require(_0x2092('0x3'));var pkginfo=require(_0x2092('0x4'))(module,_0x2092('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x2092('0x6'));var hardware=require(_0x2092('0x7'));var logger=require(_0x2092('0x8'))(_0x2092('0x9'));var HOST=_0x2092('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x410948){return new BPromise(function(_0x3df9f4,_0x58aa4e){var _0x183b6c=util[_0x2092('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x410948,module['exports'][_0x2092('0x5')]);if(oldToken){_0x183b6c=util[_0x2092('0xb')](_0x2092('0xc'),HOST,_0x410948,module['exports'][_0x2092('0x5')],oldToken);}var _0x390471={'uri':_0x183b6c,'method':_0x2092('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x390471)['then'](function(_0x522ba6){_0x3df9f4(_0x522ba6);})[_0x2092('0xe')](function(_0x34a509){_0x58aa4e(_0x34a509);});});}function manageLicense(_0x2d9875,_0x25e974){var _0x4ee85d=_0x25e974[_0x2092('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x4ee85d['data1']!==_0x2d9875&&!_0x4ee85d[_0x2092('0x10')]){oldToken=_0x4ee85d[_0x2092('0x11')];}httpRequest(_0x2d9875)[_0x2092('0x12')](function(_0x3976fc){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3976fc[_0x2092('0x13')]){isOldTokenSent=![];if(!_0x4ee85d['license']&&_0x4ee85d[_0x2092('0x9')]!=_0x3976fc['license']||_0x4ee85d[_0x2092('0x9')]&&_0x4ee85d[_0x2092('0x10')]){logger[_0x2092('0x14')](_0x2092('0x15'));}if(_0x4ee85d['license']&&!_0x4ee85d[_0x2092('0x10')]&&_0x4ee85d['license']!=_0x3976fc[_0x2092('0x9')]){logger[_0x2092('0x14')](_0x2092('0x16'));}if(_0x4ee85d[_0x2092('0x9')]&&!_0x4ee85d[_0x2092('0x10')]&&_0x4ee85d['license']==_0x3976fc[_0x2092('0x9')]){return _0x25e974;}return _0x25e974[_0x2092('0x17')]({'data1':_0x2d9875,'data2':null,'license':_0x3976fc[_0x2092('0x9')]});}else{if(_0x3976fc[_0x2092('0x9')]||_0x4ee85d[_0x2092('0x9')]){if(!_0x4ee85d[_0x2092('0x10')]){if(_0x4ee85d[_0x2092('0x11')]==_0x2d9875){GRAY_PERIOD_REASON=_0x2092('0x18');logger[_0x2092('0x14')](_0x2092('0x19'));}else{GRAY_PERIOD_REASON=_0x2092('0x1a');logger[_0x2092('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4ee85d['data1'],_0x2d9875);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x2092('0x1b')](),moment()[_0x2092('0xb')](_0x2092('0x1c')));return _0x25e974[_0x2092('0x17')]({'data2':encryptor[_0x2092('0x1d')](moment()[_0x2092('0xb')](_0x2092('0x1c')))});}else{if(moment()[_0x2092('0x1e')](encryptor[_0x2092('0x1f')](_0x4ee85d[_0x2092('0x10')]),_0x2092('0x20'))>DAYS){logger['info'](_0x2092('0x21'),moment()['format'](_0x2092('0x1c')));isOldTokenSent=![];return _0x25e974[_0x2092('0x17')]({'data1':_0x2d9875,'data2':null,'license':null});}}}else{if(_0x4ee85d['data1']!=_0x2d9875){logger[_0x2092('0x14')](_0x2092('0x22'),_0x4ee85d[_0x2092('0x11')],_0x2d9875);return _0x25e974['update']({'data1':_0x2d9875,'data2':null,'license':null});}}}return _0x25e974;})[_0x2092('0x12')](function(_0x3a2e88){_0x25e974=_0x3a2e88;})[_0x2092('0xe')](function(_0xff51fd){logger[_0x2092('0x23')](_0xff51fd[_0x2092('0x24')]);})[_0x2092('0x25')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x25e974);},TIME);});}function defaultLicense(){var _0x4baca3=hardware[_0x2092('0x26')]();if(_0x4baca3){return db['License'][_0x2092('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x4baca3}})[_0x2092('0x28')](function(_0x595131,_0x1da172){logger[_0x2092('0x14')](_0x2092('0x29'),_0x4baca3);manageLicense(_0x4baca3,_0x595131);})[_0x2092('0xe')](function(_0x27d704){logger[_0x2092('0x23')](_0x27d704[_0x2092('0x24')]);});}}exports[_0x2092('0x2a')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 2601ee5..d7da2f4 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 _0xeedd=['license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','parse','demo','decryptString','gray','deadline','days','grayReason','machineUuid','changed','message','User','findAll','sequelize','COUNT','col','role','count','admin','user','telephone','users','forEach','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','defaults','then','catch','uuid','data1'];(function(_0x12012d,_0x46e1f6){var _0x2ccaf1=function(_0x3a9488){while(--_0x3a9488){_0x12012d['push'](_0x12012d['shift']());}};_0x2ccaf1(++_0x46e1f6);}(_0xeedd,0xf5));var _0xdeed=function(_0x2742e0,_0x496bec){_0x2742e0=_0x2742e0-0x0;var _0x2ab6d1=_0xeedd[_0x2742e0];return _0x2ab6d1;};'use strict';var util=require(_0xdeed('0x0'));var _=require(_0xdeed('0x1'));var moment=require(_0xdeed('0x2'));var BPromise=require('bluebird');var hardware=require(_0xdeed('0x3'));var encryptor=require(_0xdeed('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdeed('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xdeed('0x6'),'machineUuid':hardware[_0xdeed('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1762d5){return new BPromise(function(_0x3fb86d,_0x5976bd){return db['License']['find'](_[_0xdeed('0x8')](_0x1762d5,{'raw':!![],'where':{'id':0x1}}))[_0xdeed('0x9')](function(_0x549bf3){return checkLicense(_0x549bf3,null);})[_0xdeed('0x9')](function(_0x185a02){_0x3fb86d(_0x185a02);return;})[_0xdeed('0xa')](function(_0x396f8c){_0x5976bd(_0x396f8c);});});}function checkLicense(_0x31c088,_0x1ff01e){if(!_0x31c088){demoLicense[_0xdeed('0xb')]=_0x31c088[_0xdeed('0xc')];return demoLicense;}try{var _0x543bee=_0x1ff01e||_0x31c088[_0xdeed('0xd')];if(_[_0xdeed('0xe')](_0x543bee)){throw new Error(_0xdeed('0xf'));}var _0x58532f=_0x31c088[_0xdeed('0xc')];var _0x4015c6=_0x31c088[_0xdeed('0x10')];var _0x43f333=_0x58532f[_0xdeed('0x11')]('-')[0x4];var _0x17beef=_0x58532f[_0xdeed('0x11')]('-')[0x0];var _0x26f85c=encryptor['decryptString'](_0x543bee,util[_0xdeed('0x12')]('%s:%s:%s',_0x43f333,_0x58532f,_0x17beef));var _0x577c4d=JSON[_0xdeed('0x13')](_0x26f85c);_0x577c4d[_0xdeed('0x14')]=![];_0x577c4d[_0xdeed('0xb')]=_0x58532f;_0x577c4d['machineUuid']=hardware[_0xdeed('0x7')]();if(_0x4015c6){var _0x33822a=encryptor[_0xdeed('0x15')](_0x4015c6);_0x577c4d[_0xdeed('0x16')]=_0x33822a;_0x577c4d[_0xdeed('0x17')]=moment(_0x33822a)['add'](0x7,_0xdeed('0x18'))[_0xdeed('0x12')]();_0x577c4d[_0xdeed('0x19')]=_0x577c4d[_0xdeed('0xb')]!=_0x577c4d[_0xdeed('0x1a')]?_0xdeed('0x1b'):'disabled';}return _0x577c4d;}catch(_0x3b243f){breakingLicense[_0xdeed('0xb')]=_0x31c088['data1'];breakingLicense[_0xdeed('0x1c')]=_0x3b243f[_0xdeed('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3d6043,_0x5344af){getLicense()['then'](function(_0x2649f9){return db[_0xdeed('0x1d')][_0xdeed('0x1e')]({'attributes':['role',[db[_0xdeed('0x1f')]['fn'](_0xdeed('0x20'),db[_0xdeed('0x1f')][_0xdeed('0x21')](_0xdeed('0x22'))),_0xdeed('0x23')]],'group':_0xdeed('0x22'),'where':{'role':{'$or':[_0xdeed('0x24'),_0xdeed('0x25'),_0xdeed('0x26')]}},'raw':!![]})[_0xdeed('0x9')](function(_0x163161){var _0x2d903a={'user':_0x2649f9[_0xdeed('0x27')]||0x0,'telephone':_0x2649f9['telephones']||0x0};_0x163161[_0xdeed('0x28')](function(_0x55c32a){var _0x4ecabd=_0x55c32a[_0xdeed('0x22')]===_0xdeed('0x24')?_0xdeed('0x25'):_0x55c32a['role'];_0x2d903a[_0x4ecabd]-=_0x55c32a['count'];if(_0x2d903a[_0x4ecabd]<0x0)_0x2d903a[_0x4ecabd]=0x0;});_0x3d6043(_0x2d903a);return;});})['catch'](function(_0x286360){_0x5344af(_0x286360);});});}function checkUserLimits(_0x3161cf){return new BPromise(function(_0x2f774b,_0x5d00a9){getLimits()[_0xdeed('0x9')](function(_0x2b641){var _0x20b8c3=_['pick'](_['countBy'](_0x3161cf,_0xdeed('0x22')),['admin',_0xdeed('0x25'),_0xdeed('0x26')]);var _0x1ed891=(_0x20b8c3[_0xdeed('0x24')]||0x0)+(_0x20b8c3[_0xdeed('0x25')]||0x0);var _0x4c82e5=_0x20b8c3[_0xdeed('0x26')]||0x0;if(_0x1ed891>_0x2b641['user'])return _0x5d00a9(_0xdeed('0x29'));if(_0x4c82e5>_0x2b641[_0xdeed('0x26')])return _0x5d00a9('License\x20limit\x20reached\x20for\x20telephones');return _0x2f774b();})[_0xdeed('0xa')](function(_0x11ca5d){_0x5d00a9(_0x11ca5d);});});}module[_0xdeed('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xb071=['isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','grayReason','changed','disabled','message','User','findAll','COUNT','sequelize','col','role','count','admin','user','telephone','users','telephones','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','defaults','then','catch','uuid','data1'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb071,0x111));var _0x1b07=function(_0x40f095,_0x5ed119){_0x40f095=_0x40f095-0x0;var _0x53c87b=_0xb071[_0x40f095];return _0x53c87b;};'use strict';var util=require(_0x1b07('0x0'));var _=require(_0x1b07('0x1'));var moment=require(_0x1b07('0x2'));var BPromise=require(_0x1b07('0x3'));var hardware=require(_0x1b07('0x4'));var encryptor=require(_0x1b07('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1b07('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x1b07('0x7'),'machineUuid':hardware[_0x1b07('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1b07('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x1b07('0x9'),'machineUuid':hardware[_0x1b07('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x494112){return new BPromise(function(_0x3a253f,_0x13d920){return db['License']['find'](_[_0x1b07('0xa')](_0x494112,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x132412){return checkLicense(_0x132412,null);})[_0x1b07('0xb')](function(_0x212a5b){_0x3a253f(_0x212a5b);return;})[_0x1b07('0xc')](function(_0x1124b5){_0x13d920(_0x1124b5);});});}function checkLicense(_0x24895f,_0x98df9c){if(!_0x24895f){demoLicense[_0x1b07('0xd')]=_0x24895f[_0x1b07('0xe')];return demoLicense;}try{var _0x5c3e93=_0x98df9c||_0x24895f['license'];if(_[_0x1b07('0xf')](_0x5c3e93)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x10d481=_0x24895f[_0x1b07('0xe')];var _0x233af5=_0x24895f[_0x1b07('0x10')];var _0x4094fe=_0x10d481[_0x1b07('0x11')]('-')[0x4];var _0x2ab5f7=_0x10d481['split']('-')[0x0];var _0x5276ef=encryptor[_0x1b07('0x12')](_0x5c3e93,util[_0x1b07('0x13')](_0x1b07('0x14'),_0x4094fe,_0x10d481,_0x2ab5f7));var _0x4df8ab=JSON[_0x1b07('0x15')](_0x5276ef);_0x4df8ab[_0x1b07('0x16')]=![];_0x4df8ab[_0x1b07('0xd')]=_0x10d481;_0x4df8ab[_0x1b07('0x17')]=hardware[_0x1b07('0x8')]();if(_0x233af5){var _0x476198=encryptor['decryptString'](_0x233af5);_0x4df8ab[_0x1b07('0x18')]=_0x476198;_0x4df8ab[_0x1b07('0x19')]=moment(_0x476198)[_0x1b07('0x1a')](0x7,_0x1b07('0x1b'))[_0x1b07('0x13')]();_0x4df8ab[_0x1b07('0x1c')]=_0x4df8ab[_0x1b07('0xd')]!=_0x4df8ab['machineUuid']?_0x1b07('0x1d'):_0x1b07('0x1e');}return _0x4df8ab;}catch(_0x1e7ad9){breakingLicense[_0x1b07('0xd')]=_0x24895f['data1'];breakingLicense[_0x1b07('0x1f')]=_0x1e7ad9[_0x1b07('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xb35ebe,_0x28deed){getLicense()[_0x1b07('0xb')](function(_0x36c0dd){return db[_0x1b07('0x20')][_0x1b07('0x21')]({'attributes':['role',[db['sequelize']['fn'](_0x1b07('0x22'),db[_0x1b07('0x23')][_0x1b07('0x24')](_0x1b07('0x25'))),_0x1b07('0x26')]],'group':'role','where':{'role':{'$or':[_0x1b07('0x27'),_0x1b07('0x28'),_0x1b07('0x29')]}},'raw':!![]})['then'](function(_0x4f3bae){var _0x383f12={'user':_0x36c0dd[_0x1b07('0x2a')]||0x0,'telephone':_0x36c0dd[_0x1b07('0x2b')]||0x0};_0x4f3bae['forEach'](function(_0x2eb88a){var _0x2935c8=_0x2eb88a['role']===_0x1b07('0x27')?_0x1b07('0x28'):_0x2eb88a[_0x1b07('0x25')];_0x383f12[_0x2935c8]-=_0x2eb88a[_0x1b07('0x26')];if(_0x383f12[_0x2935c8]<0x0)_0x383f12[_0x2935c8]=0x0;});_0xb35ebe(_0x383f12);return;});})[_0x1b07('0xc')](function(_0x51c157){_0x28deed(_0x51c157);});});}function checkUserLimits(_0x51f3b4){return new BPromise(function(_0x506188,_0x53af67){getLimits()['then'](function(_0x807c11){var _0x4d4d95=_[_0x1b07('0x2c')](_['countBy'](_0x51f3b4,_0x1b07('0x25')),[_0x1b07('0x27'),_0x1b07('0x28'),_0x1b07('0x29')]);var _0x399885=(_0x4d4d95[_0x1b07('0x27')]||0x0)+(_0x4d4d95['user']||0x0);var _0x341493=_0x4d4d95['telephone']||0x0;if(_0x399885>_0x807c11['user'])return _0x53af67(_0x1b07('0x2d'));if(_0x341493>_0x807c11[_0x1b07('0x29')])return _0x53af67(_0x1b07('0x2e'));return _0x506188();})[_0x1b07('0xc')](function(_0x90ed75){_0x53af67(_0x90ed75);});});}module[_0x1b07('0x2f')]={'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 4b2a821..158666b 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 _0xc2c7=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x2bcc88,_0x3071aa){var _0x50594f=function(_0x5dfae2){while(--_0x5dfae2){_0x2bcc88['push'](_0x2bcc88['shift']());}};_0x50594f(++_0x3071aa);}(_0xc2c7,0x134));var _0x7c2c=function(_0xf3c114,_0x1984fb){_0xf3c114=_0xf3c114-0x0;var _0x3de5a6=_0xc2c7[_0xf3c114];return _0x3de5a6;};'use strict';module['exports']={'DOMAIN':_0x7c2c('0x0'),'SESSION_SECRET':_0x7c2c('0x1'),'GOOGLE_ID':_0x7c2c('0x2'),'GOOGLE_SECRET':_0x7c2c('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xab40=['http://localhost:9000','exports'];(function(_0xac6303,_0x110b8e){var _0x39c79d=function(_0x2b7136){while(--_0x2b7136){_0xac6303['push'](_0xac6303['shift']());}};_0x39c79d(++_0x110b8e);}(_0xab40,0xcd));var _0x0ab4=function(_0x322039,_0x4b80b0){_0x322039=_0x322039-0x0;var _0x20f44d=_0xab40[_0x322039];return _0x20f44d;};'use strict';module[_0x0ab4('0x0')]={'DOMAIN':_0x0ab4('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index d68ec05..99df424 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52e8=['fileLogger','exports','../utils/loggers'];(function(_0x2ba127,_0x2c0174){var _0x8d107a=function(_0x36ff7b){while(--_0x36ff7b){_0x2ba127['push'](_0x2ba127['shift']());}};_0x8d107a(++_0x2c0174);}(_0x52e8,0x7d));var _0x852e=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0x52e8[_0x4bd950];return _0x5dc59a;};'use strict';var fileLogger=require(_0x852e('0x0'))[_0x852e('0x1')];module[_0x852e('0x2')]=fileLogger; \ No newline at end of file +var _0xa340=['../utils/loggers','exports'];(function(_0x3d5071,_0x1ac4e7){var _0x55c25c=function(_0x55c62c){while(--_0x55c62c){_0x3d5071['push'](_0x3d5071['shift']());}};_0x55c25c(++_0x1ac4e7);}(_0xa340,0x8e));var _0x0a34=function(_0x5f21aa,_0x3b79af){_0x5f21aa=_0x5f21aa-0x0;var _0x3d621c=_0xa340[_0x5f21aa];return _0x3d621c;};'use strict';var fileLogger=require(_0x0a34('0x0'))['fileLogger'];module[_0x0a34('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index c4f4a35..ac89137 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 _0xbb15=['legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','../../config/environment','resolve','join','root'];(function(_0x3667d8,_0x343668){var _0x1ed880=function(_0x4bd34e){while(--_0x4bd34e){_0x3667d8['push'](_0x3667d8['shift']());}};_0x1ed880(++_0x343668);}(_0xbb15,0x11c));var _0x5bb1=function(_0x543984,_0x251a39){_0x543984=_0x543984-0x0;var _0x183652=_0xbb15[_0x543984];return _0x183652;};'use strict';var path=require(_0x5bb1('0x0'));var cfg=require(_0x5bb1('0x1'));var env={'NODE_PATH':path[_0x5bb1('0x2')](path[_0x5bb1('0x3')](cfg[_0x5bb1('0x4')],_0x5bb1('0x5')))};var pm2config={'apps':[{'name':_0x5bb1('0x6'),'script':path['join'](__dirname,_0x5bb1('0x7')),'env':env},{'name':_0x5bb1('0x8'),'script':path[_0x5bb1('0x3')](__dirname,_0x5bb1('0x9')),'env':env},{'name':'agi','script':path['join'](__dirname,_0x5bb1('0xa')),'env':env},{'name':'email','script':path[_0x5bb1('0x3')](__dirname,_0x5bb1('0xb')),'env':env},{'name':_0x5bb1('0xc'),'script':path[_0x5bb1('0x3')](__dirname,_0x5bb1('0xd')),'env':env},{'name':_0x5bb1('0xe'),'script':path[_0x5bb1('0x3')](__dirname,_0x5bb1('0xf')),'env':env}]};module[_0x5bb1('0x10')]=pm2config; \ No newline at end of file +var _0x8502=['resolve','join','root','legacy-libs','express','ami','../../services/agi/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x4dbebd,_0x29dbd3){var _0x52395f=function(_0x4d4806){while(--_0x4d4806){_0x4dbebd['push'](_0x4dbebd['shift']());}};_0x52395f(++_0x29dbd3);}(_0x8502,0x1e0));var _0x2850=function(_0x4fa0ea,_0x2cd534){_0x4fa0ea=_0x4fa0ea-0x0;var _0x51d027=_0x8502[_0x4fa0ea];return _0x51d027;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0x2850('0x0')](path[_0x2850('0x1')](cfg[_0x2850('0x2')],_0x2850('0x3')))};var pm2config={'apps':[{'name':_0x2850('0x4'),'script':path['join'](__dirname,'../../services/express/index.js'),'env':env},{'name':_0x2850('0x5'),'script':path[_0x2850('0x1')](__dirname,'../../services/ami/index.js'),'env':env},{'name':'agi','script':path[_0x2850('0x1')](__dirname,_0x2850('0x6')),'env':env},{'name':'email','script':path[_0x2850('0x1')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0x2850('0x7'),'script':path[_0x2850('0x1')](__dirname,_0x2850('0x8')),'env':env},{'name':_0x2850('0x9'),'script':path[_0x2850('0x1')](__dirname,_0x2850('0xa')),'env':env}]};module[_0x2850('0xb')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index b590e76..a6007a8 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 _0x4581=['dump','saved','pm2','bluebird','./config','connect','connected','then','start','disconnect','stop','restart','list','describe','delete'];(function(_0x88e4c3,_0x3eb1a2){var _0x1faf24=function(_0x404eb2){while(--_0x404eb2){_0x88e4c3['push'](_0x88e4c3['shift']());}};_0x1faf24(++_0x3eb1a2);}(_0x4581,0x1f1));var _0x1458=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4581[_0x20a584];return _0x4b41a8;};'use strict';var pm2=require(_0x1458('0x0'));var BPromise=require(_0x1458('0x1'));var config=require(_0x1458('0x2'));function connect(){return new BPromise(function(_0x2de094,_0x390249){return pm2[_0x1458('0x3')](function(_0x2e5a65){if(_0x2e5a65){return _0x390249(_0x2e5a65);}return _0x2de094(_0x1458('0x4'));});});};exports['start']=function(_0x1d18c2){return connect()[_0x1458('0x5')](function(){return new BPromise(function(_0x3514ff,_0x10162b){return pm2[_0x1458('0x6')](_0x1d18c2,function(_0x3ba98b,_0x13e82f){if(_0x3ba98b){return _0x10162b(_0x3ba98b);}pm2[_0x1458('0x7')]();return _0x3514ff(_0x13e82f);});});});};exports['stop']=function(_0x5b9774){return connect()[_0x1458('0x5')](function(){return new BPromise(function(_0x28e270,_0x41c695){return pm2[_0x1458('0x8')](_0x5b9774,function(_0x1cad20,_0x3246eb){if(_0x1cad20){return _0x41c695(_0x1cad20);}pm2['disconnect']();return _0x28e270(_0x3246eb);});});});};exports[_0x1458('0x9')]=function(_0x1c5968){return connect()[_0x1458('0x5')](function(){return new BPromise(function(_0x278344,_0x153753){return pm2[_0x1458('0x9')](_0x1c5968,function(_0x3f20dd,_0x27c14f){if(_0x3f20dd){return _0x153753(_0x3f20dd);}pm2[_0x1458('0x7')]();return _0x278344(_0x27c14f);});});});};exports[_0x1458('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x58604a,_0x21fa7f){return pm2[_0x1458('0xa')](function(_0x31d698,_0x16dab0){if(_0x31d698){return _0x21fa7f(_0x31d698);}pm2[_0x1458('0x7')]();return _0x58604a(_0x16dab0);});});});};exports['describe']=function(_0x1a1591){return connect()['then'](function(){return new BPromise(function(_0x2aa722,_0x3baf53){return pm2[_0x1458('0xb')](_0x1a1591,function(_0x1509cf,_0x2c7790){if(_0x1509cf){return _0x3baf53(_0x1509cf);}pm2[_0x1458('0x7')]();return _0x2aa722(_0x2c7790);});});});};exports[_0x1458('0xc')]=function(_0x7ce237){return connect()['then'](function(){return new BPromise(function(_0x1057f4,_0x3b2f95){return pm2[_0x1458('0xc')](_0x7ce237,function(_0x14d69c,_0xb8872f){if(_0x14d69c){return _0x3b2f95(_0x14d69c);}pm2['disconnect']();return _0x1057f4(_0xb8872f);});});});};exports[_0x1458('0xd')]=function(){return connect()[_0x1458('0x5')](function(){return new BPromise(function(_0x338cf4,_0x464228){return pm2[_0x1458('0xd')](function(_0x2dff45){if(_0x2dff45){return _0x464228(_0x2dff45);}return _0x338cf4(_0x1458('0xe'));});});});}; \ No newline at end of file +var _0xae8d=['pm2','bluebird','./config','connect','connected','then','start','disconnect','stop','restart','list','describe','delete','dump','saved'];(function(_0x4667b2,_0x135b67){var _0x1070f2=function(_0xa72ca5){while(--_0xa72ca5){_0x4667b2['push'](_0x4667b2['shift']());}};_0x1070f2(++_0x135b67);}(_0xae8d,0xb4));var _0xdae8=function(_0x833809,_0x577960){_0x833809=_0x833809-0x0;var _0x142842=_0xae8d[_0x833809];return _0x142842;};'use strict';var pm2=require(_0xdae8('0x0'));var BPromise=require(_0xdae8('0x1'));var config=require(_0xdae8('0x2'));function connect(){return new BPromise(function(_0x41c009,_0x151fb6){return pm2[_0xdae8('0x3')](function(_0x58c35c){if(_0x58c35c){return _0x151fb6(_0x58c35c);}return _0x41c009(_0xdae8('0x4'));});});};exports['start']=function(_0x3f418f){return connect()[_0xdae8('0x5')](function(){return new BPromise(function(_0x25cf6a,_0x454f1d){return pm2[_0xdae8('0x6')](_0x3f418f,function(_0x4103e4,_0x10216e){if(_0x4103e4){return _0x454f1d(_0x4103e4);}pm2[_0xdae8('0x7')]();return _0x25cf6a(_0x10216e);});});});};exports[_0xdae8('0x8')]=function(_0x4eedae){return connect()['then'](function(){return new BPromise(function(_0x488822,_0x294386){return pm2[_0xdae8('0x8')](_0x4eedae,function(_0x4d396e,_0x4d8378){if(_0x4d396e){return _0x294386(_0x4d396e);}pm2['disconnect']();return _0x488822(_0x4d8378);});});});};exports['restart']=function(_0x5071a1){return connect()[_0xdae8('0x5')](function(){return new BPromise(function(_0x853892,_0x20fa00){return pm2[_0xdae8('0x9')](_0x5071a1,function(_0x284151,_0x54a945){if(_0x284151){return _0x20fa00(_0x284151);}pm2['disconnect']();return _0x853892(_0x54a945);});});});};exports[_0xdae8('0xa')]=function(){return connect()[_0xdae8('0x5')](function(){return new BPromise(function(_0x398f50,_0xef9843){return pm2[_0xdae8('0xa')](function(_0x25dafb,_0x57e849){if(_0x25dafb){return _0xef9843(_0x25dafb);}pm2[_0xdae8('0x7')]();return _0x398f50(_0x57e849);});});});};exports['describe']=function(_0x285383){return connect()['then'](function(){return new BPromise(function(_0x55f872,_0x2bfe35){return pm2[_0xdae8('0xb')](_0x285383,function(_0x285aef,_0x2edeb4){if(_0x285aef){return _0x2bfe35(_0x285aef);}pm2[_0xdae8('0x7')]();return _0x55f872(_0x2edeb4);});});});};exports[_0xdae8('0xc')]=function(_0x4867b8){return connect()[_0xdae8('0x5')](function(){return new BPromise(function(_0x130e48,_0x2ecac7){return pm2[_0xdae8('0xc')](_0x4867b8,function(_0x2f26b4,_0x31e00c){if(_0x2f26b4){return _0x2ecac7(_0x2f26b4);}pm2[_0xdae8('0x7')]();return _0x130e48(_0x31e00c);});});});};exports[_0xdae8('0xd')]=function(){return connect()[_0xdae8('0x5')](function(){return new BPromise(function(_0x405448,_0x4905a4){return pm2['dump'](function(_0x33eb08){if(_0x33eb08){return _0x4905a4(_0x33eb08);}return _0x405448(_0xdae8('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 8c506fd..385b869 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 _0x0090=['YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','../../config/environment','../../mysqldb','redis','defaults','localhost','Setting','find','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','format'];(function(_0x16bd4f,_0x3e0e12){var _0x13e0cd=function(_0x408c87){while(--_0x408c87){_0x16bd4f['push'](_0x16bd4f['shift']());}};_0x13e0cd(++_0x3e0e12);}(_0x0090,0xf1));var _0x0009=function(_0x32222e,_0x764af1){_0x32222e=_0x32222e-0x0;var _0x622df=_0x0090[_0x32222e];return _0x622df;};'use strict';var _=require(_0x0009('0x0'));var moment=require('moment');var Redis=require(_0x0009('0x1'));var util=require('util');var config=require(_0x0009('0x2'));var db=require(_0x0009('0x3'))['db'];var logger=require('../logger')('schedule');config[_0x0009('0x4')]=_[_0x0009('0x5')](config[_0x0009('0x4')],{'host':_0x0009('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0009('0x4')]));function closeInteractions(){var _0x149204=0x0;var _0x3cfc18=[];return db[_0x0009('0x7')][_0x0009('0x8')]({'raw':!![],'attributes':['id',_0x0009('0x9')],'where':{'id':0x1}})[_0x0009('0xa')](function(_0x4f2836){_0x149204=_0x4f2836[_0x0009('0x9')];if(_0x149204){return db[_0x0009('0xb')][_0x0009('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0009('0xd')](_0x4f2836[_0x0009('0x9')],_0x0009('0xe'))}}});}else{return[];}})[_0x0009('0xa')](function(_0x3d7a81){if(_0x3d7a81&&_0x3d7a81['length']){_0x3cfc18=_['map'](_0x3d7a81||[],'id');logger[_0x0009('0xf')](_0x0009('0x10'),_0x3cfc18[_0x0009('0x11')]());return db[_0x0009('0xb')]['update']({'closeReason':_0x0009('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x0009('0x13')](_0x0009('0x14'))},{'where':{'id':_0x3cfc18}});}})['then'](function(){if(_0x3cfc18&&_0x3cfc18['length']){logger[_0x0009('0xf')](_0x0009('0x15'),_0x3cfc18['join']());for(var _0x2fac55=0x0;_0x2fac55<_0x3cfc18['length'];_0x2fac55++){io[_0x0009('0x16')](_0x0009('0x17'),{'id':_0x3cfc18[_0x2fac55],'closed':!![]});}}})[_0x0009('0x18')](function(_0x212cbc){logger[_0x0009('0x19')](_0x0009('0x1a'),_0x212cbc?util[_0x0009('0x1b')](_0x212cbc,{'showHidden':![],'depth':null}):'');});}exports[_0x0009('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x7f4f=['error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update'];(function(_0x183303,_0x227ffb){var _0x4310a0=function(_0x4728c2){while(--_0x4728c2){_0x183303['push'](_0x183303['shift']());}};_0x4310a0(++_0x227ffb);}(_0x7f4f,0x163));var _0xf7f4=function(_0x212537,_0x64c7f5){_0x212537=_0x212537-0x0;var _0x233b98=_0x7f4f[_0x212537];return _0x233b98;};'use strict';var _=require(_0xf7f4('0x0'));var moment=require(_0xf7f4('0x1'));var Redis=require(_0xf7f4('0x2'));var util=require(_0xf7f4('0x3'));var config=require(_0xf7f4('0x4'));var db=require(_0xf7f4('0x5'))['db'];var logger=require('../logger')(_0xf7f4('0x6'));config[_0xf7f4('0x7')]=_[_0xf7f4('0x8')](config[_0xf7f4('0x7')],{'host':_0xf7f4('0x9'),'port':0x18eb});var io=require(_0xf7f4('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x30d8b8=0x0;var _0x1a67a8=[];return db[_0xf7f4('0xb')][_0xf7f4('0xc')]({'raw':!![],'attributes':['id',_0xf7f4('0xd')],'where':{'id':0x1}})[_0xf7f4('0xe')](function(_0x28061b){_0x30d8b8=_0x28061b[_0xf7f4('0xd')];if(_0x30d8b8){return db['ChatInteraction'][_0xf7f4('0xf')]({'raw':!![],'attributes':['id',_0xf7f4('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x28061b[_0xf7f4('0xd')],_0xf7f4('0x11'))}}});}else{return[];}})[_0xf7f4('0xe')](function(_0x35318c){if(_0x35318c&&_0x35318c[_0xf7f4('0x12')]){_0x1a67a8=_[_0xf7f4('0x13')](_0x35318c||[],'id');logger[_0xf7f4('0x14')](_0xf7f4('0x15'),_0x1a67a8[_0xf7f4('0x16')]());return db['ChatInteraction'][_0xf7f4('0x17')]({'closeReason':_0xf7f4('0x18'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xf7f4('0x19'))},{'where':{'id':_0x1a67a8}});}})[_0xf7f4('0xe')](function(){if(_0x1a67a8&&_0x1a67a8[_0xf7f4('0x12')]){logger['info'](_0xf7f4('0x1a'),_0x1a67a8[_0xf7f4('0x16')]());for(var _0x2b8049=0x0;_0x2b8049<_0x1a67a8['length'];_0x2b8049++){io[_0xf7f4('0x1b')](_0xf7f4('0x1c'),{'id':_0x1a67a8[_0x2b8049],'closed':!![]});}}})['catch'](function(_0x2f6080){logger[_0xf7f4('0x1d')](_0xf7f4('0x1e'),_0x2f6080?util['inspect'](_0x2f6080,{'showHidden':![],'depth':null}):'');});}exports[_0xf7f4('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 273f396..641c877 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd051=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x41b62f,_0x247a1a){var _0x52f12f=function(_0x14dd6a){while(--_0x14dd6a){_0x41b62f['push'](_0x41b62f['shift']());}};_0x52f12f(++_0x247a1a);}(_0xd051,0x6d));var _0x1d05=function(_0x354df6,_0x4fb714){_0x354df6=_0x354df6-0x0;var _0x3b8676=_0xd051[_0x354df6];return _0x3b8676;};'use strict';function start(){var _0x54a364=require(_0x1d05('0x0'));return _0x54a364[_0x1d05('0x1')]();}module[_0x1d05('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xd299=['../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x2ae241,_0x1dfb42){var _0x5b6d54=function(_0x2560c9){while(--_0x2560c9){_0x2ae241['push'](_0x2ae241['shift']());}};_0x5b6d54(++_0x1dfb42);}(_0xd299,0x197));var _0x9d29=function(_0x170b4a,_0x561ed5){_0x170b4a=_0x170b4a-0x0;var _0x4351a1=_0xd299[_0x170b4a];return _0x4351a1;};'use strict';function start(){var _0x4cb975=require(_0x9d29('0x0'));return _0x4cb975['startAllRefreshIntervals']();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 05698ba..892215b 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 _0x22c9=['scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','jobs','map','toString','difference','intersection','length','deleteJob','toRun','resolve','run\x20job','cron','active','isBetween','startAt','endAt','start','add\x20cron','exists','stop\x20cron','update','update\x20cron','run','util','path','lodash','cron-job-manager','bluebird','../logger','../../mysqldb','retry','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','number','AnalyticExtractedReport','findOne','catch','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','email','bcc','format','Report\x20%s\x20last\x20%s\x20%s','join','../../files/reports','savename','basename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Empty','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Loading','Report\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Completed','Failed','Report\x20extraction\x20procedure\x20has\x20run\x20into\x20an\x20unexpected\x20error.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','case\x20loading','currentAttempt','retryOptions','retries','data','stop','operation','still\x20loading','case\x20completed','job','case\x20failed','Unrecognized\x20status:','dataValues','Job\x20ID\x20','\x20Attempt\x20#:','report\x20status:','sendMail','Smtp','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xda6b7d,_0x5e4ca7){var _0x4ae723=function(_0x3b1b08){while(--_0x3b1b08){_0xda6b7d['push'](_0xda6b7d['shift']());}};_0x4ae723(++_0x5e4ca7);}(_0x22c9,0x102));var _0x922c=function(_0x51d92a,_0x49d811){_0x51d92a=_0x51d92a-0x0;var _0x1236b0=_0x22c9[_0x51d92a];return _0x1236b0;};'use strict';var fs=require('fs');var util=require(_0x922c('0x0'));var path=require(_0x922c('0x1'));var _=require(_0x922c('0x2'));var moment=require('moment');var CronJobManager=require(_0x922c('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0x922c('0x4'));var logger=require(_0x922c('0x5'))('schedule');var db=require(_0x922c('0x6'))['db'];const retry=require(_0x922c('0x7'));var analyticCustomReportController=require(_0x922c('0x8'));var analyticDefaultReportController=require(_0x922c('0x9'));var client=jayson[_0x922c('0xa')][_0x922c('0xb')]({'port':0x232b});var manager=new CronJobManager();function getReportData(_0x11c531){const _0x4ff2d5={};if(typeof _0x11c531===_0x922c('0xc')){_0x4ff2d5['id']=_0x11c531;}return db[_0x922c('0xd')][_0x922c('0xe')]({'where':_0x4ff2d5})['then'](function(_0x1e41c5){return _0x1e41c5;})[_0x922c('0xf')](function(_0x2028d6){logger['error'](_0x2028d6);});}function handleSendEmail(_0x41474d,_0x1052d7){logger[_0x922c('0x10')](_0x922c('0x11'),_0x41474d['email']);var _0x1d374a=!![];var _0x153f8a=_0x41474d[_0x922c('0x12')][_0x922c('0x13')]();var _0x4de285={'account':_0x153f8a,'message':{'from':util['format'](_0x922c('0x14'),_0x41474d[_0x922c('0x12')][_0x922c('0x15')],_0x41474d['MailAccount'][_0x922c('0x16')]||_0x41474d[_0x922c('0x12')]['Smtp']['user']),'to':_0x41474d[_0x922c('0x16')],'cc':_0x41474d['cc'],'bcc':_0x41474d[_0x922c('0x17')],'subject':util[_0x922c('0x18')](_0x922c('0x19'),_0x1052d7[_0x922c('0x15')],_0x41474d['subtractNumber'],_0x41474d['subtractUnit'])}};var _0x4760ba=path[_0x922c('0x1a')](__dirname,_0x922c('0x1b'));var _0x11eb6e=_0x1052d7[_0x922c('0x1c')];var _0x3fd897=util[_0x922c('0x18')]('%s.%s',path[_0x922c('0x1d')](_0x1052d7['savename'],path[_0x922c('0x1e')](_0x1052d7[_0x922c('0x1c')])),_0x922c('0x1f'));var _0x14199e=path[_0x922c('0x1a')](_0x4760ba,_0x11eb6e);var _0x3da02b=path['join'](_0x4760ba,_0x3fd897);if(fs[_0x922c('0x20')](_0x14199e)){_0x1052d7[_0x922c('0x21')]=_0x922c('0x22');_0x4de285[_0x922c('0x23')][_0x922c('0x24')]=[{'filename':_0x11eb6e,'path':_0x14199e}];_0x4de285[_0x922c('0x23')][_0x922c('0x25')]=util['format'](_0x922c('0x26'),JSON['stringify'](_0x1052d7,null,0x2));}else if(fs[_0x922c('0x20')](_0x3da02b)){_0x1052d7[_0x922c('0x21')]=_0x922c('0x22');_0x4de285[_0x922c('0x23')][_0x922c('0x24')]=[{'filename':_0x3fd897,'path':_0x3da02b}];}else{if(_0x1052d7[_0x922c('0x21')]===_0x922c('0x27')){_0x4de285['message'][_0x922c('0x25')]=_0x922c('0x28');if(!_0x41474d['sendIfEmpty']){_0x1d374a=![];logger[_0x922c('0x10')]('empty\x20file,\x20email\x20not\x20sent');}}else if(_0x1052d7[_0x922c('0x21')]===_0x922c('0x29')){_0x4de285['message'][_0x922c('0x25')]=_0x922c('0x2a');}else if(_0x1052d7[_0x922c('0x21')]===_0x922c('0x2b')){_0x4de285[_0x922c('0x23')][_0x922c('0x25')]='Report\x20file\x20creation\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';}else if(_0x1052d7[_0x922c('0x21')]===_0x922c('0x2c')){_0x4de285[_0x922c('0x23')]['text']=_0x922c('0x2d');}else{logger['error']('[handleSendEmail]\x20Unrecognized\x20status:',_0x1052d7[_0x922c('0x21')]);}}if(_0x1d374a){return client[_0x922c('0x2e')](_0x922c('0x2f'),_0x4de285)[_0x922c('0x30')](function(_0x321692){if(_0x321692[_0x922c('0x31')]){return logger[_0x922c('0x31')](_0x922c('0x32'),JSON[_0x922c('0x33')](_0x321692));}return logger[_0x922c('0x10')](_0x922c('0x34'));})['catch'](function(_0x145279){return logger[_0x922c('0x31')](_0x922c('0x32'),JSON['stringify'](_0x145279));});}}function handleError(){return function(_0x144e38){return logger[_0x922c('0x31')](JSON[_0x922c('0x33')](_0x144e38));};}function loading(_0x45abdf){logger['info'](_0x922c('0x35'));if(_0x45abdf[_0x922c('0x36')]===_0x45abdf[_0x922c('0x37')][_0x922c('0x38')]){handleSendEmail(_0x45abdf['job'],_0x45abdf[_0x922c('0x39')]);_0x45abdf['operation'][_0x922c('0x3a')]();}else{_0x45abdf[_0x922c('0x3b')]['retry'](_0x922c('0x3c'));}}function completed(_0x15dc1c){logger['info'](_0x922c('0x3d'));handleSendEmail(_0x15dc1c['job'],_0x15dc1c['data']);_0x15dc1c['operation'][_0x922c('0x3a')]();}function empty(_0x3cb21c){logger[_0x922c('0x10')]('case\x20empty');handleSendEmail(_0x3cb21c[_0x922c('0x3e')],_0x3cb21c[_0x922c('0x39')]);_0x3cb21c[_0x922c('0x3b')]['stop']();}function failed(_0x51d607){logger[_0x922c('0x10')](_0x922c('0x3f'));handleSendEmail(_0x51d607[_0x922c('0x3e')],_0x51d607['data']);_0x51d607[_0x922c('0x3b')][_0x922c('0x3a')]();}function urecognized(_0x5a9a9d){logger[_0x922c('0x31')](_0x922c('0x40'),_0x5a9a9d['entity'][_0x922c('0x41')]['status']);_0x5a9a9d[_0x922c('0x3b')][_0x922c('0x3a')]();}const reportStatusStrategies={'Loading':loading,'Completed':completed,'Empty':empty,'Failed':failed,'Unrecognized':urecognized};function retryer(_0x1f22f6,_0xc6998c){const _0x58d957={'retries':0x3,'factor':0x2,'minTimeout':0x5b*0x3e8,'maxTimeout':0xa*0x3c*0x3e8};const _0x271e3e=retry[_0x922c('0x3b')](_0x58d957);_0x271e3e['attempt'](_0xd072b4=>{logger[_0x922c('0x10')](_0x922c('0x42')+_0x1f22f6['id']+_0x922c('0x43')+_0xd072b4);try{getReportData(_0xc6998c['id'])['then'](function(_0x30ebda){_0xc6998c=_0x30ebda;logger[_0x922c('0x10')]('report\x20status:',_0x30ebda['dataValues'][_0x922c('0x21')]);if(!reportStatusStrategies[_0x30ebda['dataValues'][_0x922c('0x21')]]){logger[_0x922c('0x31')](_0x922c('0x44'),_0x30ebda[_0x922c('0x41')][_0x922c('0x21')]);_0x271e3e[_0x922c('0x7')]();}reportStatusStrategies[_0x30ebda[_0x922c('0x41')][_0x922c('0x21')]]({'operation':_0x271e3e,'currentAttempt':_0xd072b4,'retryOptions':_0x58d957,'job':_0x1f22f6,'data':_0xc6998c,'entity':_0x30ebda});});}catch(_0x5664e9){_0x271e3e[_0x922c('0x7')](_0x5664e9);}});}function handleResult(_0x1326d4){return function(_0x49eea8){if(_0x1326d4[_0x922c('0x45')]&&_0x1326d4['MailAccount']&&_0x1326d4['MailAccount'][_0x922c('0x46')]&&!_[_0x922c('0x47')](_0x1326d4[_0x922c('0x16')])){retryer(_0x1326d4,_0x49eea8);}};}function handleJob(_0x4c6599){return function(){try{if(_[_0x922c('0x47')](_0x4c6599[_0x922c('0x48')])){return logger['info'](_0x922c('0x49'));}if(_[_0x922c('0x47')](_0x4c6599[_0x922c('0x4a')])){return logger[_0x922c('0x10')](_0x922c('0x4b'));}var _0x85ab8c={'startDate':moment()[_0x922c('0x4c')](_0x4c6599[_0x922c('0x48')],_0x4c6599[_0x922c('0x4a')])[_0x922c('0x18')](_0x922c('0x4d')),'endDate':moment()['format'](_0x922c('0x4d')),'type':_0x922c('0x4e'),'output':_0x4c6599[_0x922c('0x4f')],'name':_0x4c6599['name']};if(!_[_0x922c('0x47')](_0x4c6599['DefaultReportId'])){logger[_0x922c('0x10')](_0x922c('0x50'),_0x4c6599[_0x922c('0x51')]);return analyticDefaultReportController[_0x922c('0x52')]({'id':_0x4c6599[_0x922c('0x51')]},_0x85ab8c)[_0x922c('0x30')](handleResult(_0x4c6599))[_0x922c('0xf')](handleError());}if(!_[_0x922c('0x47')](_0x4c6599[_0x922c('0x53')])){logger['info'](_0x922c('0x54'),_0x4c6599[_0x922c('0x53')]);return analyticCustomReportController[_0x922c('0x52')]({'id':_0x4c6599[_0x922c('0x53')]},_0x85ab8c)[_0x922c('0x30')](handleResult(_0x4c6599))[_0x922c('0xf')](handleError());}}catch(_0x4ea8de){logger[_0x922c('0x31')](JSON[_0x922c('0x33')](_0x4ea8de));}return logger[_0x922c('0x10')](_0x922c('0x55'));};}function getJobs(_0x459209){var _0x3c3038={};if(_0x459209){_0x3c3038['id']=_0x459209;}return db[_0x922c('0x56')][_0x922c('0x57')]({'where':_0x3c3038,'include':[{'model':db[_0x922c('0x12')],'attributes':['id',_0x922c('0x15'),_0x922c('0x16')],'include':[{'model':db[_0x922c('0x58')],'as':_0x922c('0x46'),'include':[{'model':db['CloudProvider'],'as':_0x922c('0x59')}]}]}]})[_0x922c('0x30')](function(_0x4bc087){var _0x232d2f=_['keys'](manager[_0x922c('0x5a')]);var _0x353274=_[_0x922c('0x5b')](_0x4bc087,function(_0x3ec307){return _0x3ec307['id'][_0x922c('0x5c')]();});var _0x260946=_['keyBy'](_0x4bc087,function(_0x5619a1){return _0x5619a1['id']['toString']();});var _0x2a228d=_0x459209?_0x353274:_[_0x922c('0x5d')](_0x353274,_0x232d2f);var _0x445704=_[_0x922c('0x5e')](_0x353274,_0x232d2f);var _0x144dca=_[_0x922c('0x5d')](_0x232d2f,_0x353274);var _0x536e53;var _0x255fd0;for(_0x536e53=0x0;_0x536e53<_0x144dca[_0x922c('0x5f')]&&!_0x459209;_0x536e53+=0x1){_0x255fd0=_0x144dca[_0x536e53][_0x922c('0x5c')]();if(manager['exists'](_0x255fd0)){manager['stop'](_0x255fd0);manager[_0x922c('0x60')](_0x255fd0);logger[_0x922c('0x10')]('delete\x20cron',_0x255fd0);}}logger[_0x922c('0x10')](_0x922c('0x61'),JSON[_0x922c('0x33')](_0x2a228d));for(_0x536e53=0x0;_0x536e53<_0x2a228d[_0x922c('0x5f')];_0x536e53+=0x1){_0x255fd0=_0x2a228d[_0x536e53][_0x922c('0x5c')]();if(_0x459209){logger['info'](JSON[_0x922c('0x33')](_0x260946[_0x255fd0]));BPromise[_0x922c('0x62')]()[_0x922c('0x30')](handleJob(_0x260946[_0x255fd0]));logger[_0x922c('0x10')](_0x922c('0x63'),_0x260946[_0x255fd0]['name'],_0x260946[_0x255fd0][_0x922c('0x64')]);}else if(_0x260946[_0x255fd0][_0x922c('0x64')]&&_0x260946[_0x255fd0][_0x922c('0x65')]&&moment()[_0x922c('0x66')](_0x260946[_0x255fd0][_0x922c('0x67')],_0x260946[_0x255fd0][_0x922c('0x68')])){manager['add'](_0x255fd0,_0x260946[_0x255fd0][_0x922c('0x64')],handleJob(_0x260946[_0x255fd0]));manager[_0x922c('0x69')](_0x255fd0);logger['info'](_0x922c('0x6a'),_0x260946[_0x255fd0]['name'],_0x260946[_0x255fd0][_0x922c('0x64')]);}else if(manager[_0x922c('0x6b')](_0x255fd0)){manager[_0x922c('0x3a')](_0x255fd0);manager[_0x922c('0x60')](_0x255fd0);logger['info'](_0x922c('0x6c'),_0x260946[_0x255fd0][_0x922c('0x15')],_0x260946[_0x255fd0][_0x922c('0x64')]);}}for(_0x536e53=0x0,_0x255fd0;_0x536e53<_0x445704[_0x922c('0x5f')]&&!_0x459209;_0x536e53+=0x1){_0x255fd0=_0x445704[_0x536e53]['toString']();if(manager['exists'](_0x255fd0)){if(_0x260946[_0x255fd0]['cron']&&_0x260946[_0x255fd0][_0x922c('0x65')]&&moment()['isBetween'](_0x260946[_0x255fd0][_0x922c('0x67')],_0x260946[_0x255fd0][_0x922c('0x68')])){manager[_0x922c('0x6d')](_0x255fd0,_0x260946[_0x255fd0][_0x922c('0x64')],handleJob(_0x260946[_0x255fd0]));logger[_0x922c('0x10')](_0x922c('0x6e'),_0x260946[_0x255fd0][_0x922c('0x15')],_0x260946[_0x255fd0][_0x922c('0x64')]);}else{manager['stop'](_0x255fd0);manager[_0x922c('0x60')](_0x255fd0);logger[_0x922c('0x10')](_0x922c('0x6c'),_0x260946[_0x255fd0][_0x922c('0x15')],_0x260946[_0x255fd0][_0x922c('0x64')]);}}}})[_0x922c('0xf')](function(_0x51173a){logger[_0x922c('0x31')](JSON['stringify'](_0x51173a));});}exports[_0x922c('0x6f')]=function(_0x105f58){return getJobs(_0x105f58);};exports[_0x922c('0x69')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x88dd=['retryOptions','job','operation','stop','still\x20loading','case\x20completed','data','case\x20failed','Unrecognized\x20status:','entity','dataValues','attempt','\x20Attempt\x20#:','report\x20status:','retry','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','intersection','difference','exists','deleteJob','delete\x20cron','length','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','stop\x20cron','update\x20cron','run','util','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','number','AnalyticExtractedReport','findOne','then','catch','error','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','user','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','savename','%s.%s','basename','join','existsSync','status','attachments','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Sent','Empty','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','Loading','Report\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Completed','Report\x20file\x20creation\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Failed','Report\x20extraction\x20procedure\x20has\x20run\x20into\x20an\x20unexpected\x20error.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','SendMail','email\x20sent','stringify','case\x20loading','currentAttempt'];(function(_0x5beb32,_0x1112f4){var _0x28b56c=function(_0x3ff3f9){while(--_0x3ff3f9){_0x5beb32['push'](_0x5beb32['shift']());}};_0x28b56c(++_0x1112f4);}(_0x88dd,0x111));var _0xd88d=function(_0x15f041,_0x1737c9){_0x15f041=_0x15f041-0x0;var _0x4ca9a9=_0x88dd[_0x15f041];return _0x4ca9a9;};'use strict';var fs=require('fs');var util=require(_0xd88d('0x0'));var path=require(_0xd88d('0x1'));var _=require('lodash');var moment=require(_0xd88d('0x2'));var CronJobManager=require(_0xd88d('0x3'));var jayson=require(_0xd88d('0x4'));var BPromise=require(_0xd88d('0x5'));var logger=require(_0xd88d('0x6'))(_0xd88d('0x7'));var db=require(_0xd88d('0x8'))['db'];const retry=require('retry');var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xd88d('0x9'));var client=jayson[_0xd88d('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function getReportData(_0x5f4552){const _0x1ea364={};if(typeof _0x5f4552===_0xd88d('0xb')){_0x1ea364['id']=_0x5f4552;}return db[_0xd88d('0xc')][_0xd88d('0xd')]({'where':_0x1ea364})[_0xd88d('0xe')](function(_0x1852ba){return _0x1852ba;})[_0xd88d('0xf')](function(_0x113262){logger[_0xd88d('0x10')](_0x113262);});}function handleSendEmail(_0x273aa3,_0x5c5ecb){logger[_0xd88d('0x11')](_0xd88d('0x12'),_0x273aa3['email']);var _0x134f68=!![];var _0x2e4fb8=_0x273aa3[_0xd88d('0x13')][_0xd88d('0x14')]();var _0x4693a0={'account':_0x2e4fb8,'message':{'from':util[_0xd88d('0x15')](_0xd88d('0x16'),_0x273aa3[_0xd88d('0x13')][_0xd88d('0x17')],_0x273aa3[_0xd88d('0x13')]['email']||_0x273aa3['MailAccount'][_0xd88d('0x18')][_0xd88d('0x19')]),'to':_0x273aa3[_0xd88d('0x1a')],'cc':_0x273aa3['cc'],'bcc':_0x273aa3[_0xd88d('0x1b')],'subject':util['format'](_0xd88d('0x1c'),_0x5c5ecb[_0xd88d('0x17')],_0x273aa3[_0xd88d('0x1d')],_0x273aa3['subtractUnit'])}};var _0x5a220c=path['join'](__dirname,'../../files/reports');var _0x2f4d33=_0x5c5ecb[_0xd88d('0x1e')];var _0x3d779b=util[_0xd88d('0x15')](_0xd88d('0x1f'),path[_0xd88d('0x20')](_0x5c5ecb[_0xd88d('0x1e')],path['extname'](_0x5c5ecb['savename'])),'zip');var _0x37a66d=path[_0xd88d('0x21')](_0x5a220c,_0x2f4d33);var _0x5d0564=path['join'](_0x5a220c,_0x3d779b);if(fs[_0xd88d('0x22')](_0x37a66d)){_0x5c5ecb[_0xd88d('0x23')]='Sent';_0x4693a0['message'][_0xd88d('0x24')]=[{'filename':_0x2f4d33,'path':_0x37a66d}];_0x4693a0[_0xd88d('0x25')]['text']=util['format'](_0xd88d('0x26'),JSON['stringify'](_0x5c5ecb,null,0x2));}else if(fs[_0xd88d('0x22')](_0x5d0564)){_0x5c5ecb[_0xd88d('0x23')]=_0xd88d('0x27');_0x4693a0['message']['attachments']=[{'filename':_0x3d779b,'path':_0x5d0564}];}else{if(_0x5c5ecb[_0xd88d('0x23')]===_0xd88d('0x28')){_0x4693a0[_0xd88d('0x25')][_0xd88d('0x29')]=_0xd88d('0x2a');if(!_0x273aa3[_0xd88d('0x2b')]){_0x134f68=![];logger[_0xd88d('0x11')](_0xd88d('0x2c'));}}else if(_0x5c5ecb[_0xd88d('0x23')]===_0xd88d('0x2d')){_0x4693a0['message'][_0xd88d('0x29')]=_0xd88d('0x2e');}else if(_0x5c5ecb['status']===_0xd88d('0x2f')){_0x4693a0[_0xd88d('0x25')][_0xd88d('0x29')]=_0xd88d('0x30');}else if(_0x5c5ecb[_0xd88d('0x23')]===_0xd88d('0x31')){_0x4693a0[_0xd88d('0x25')][_0xd88d('0x29')]=_0xd88d('0x32');}else{logger[_0xd88d('0x10')]('[handleSendEmail]\x20Unrecognized\x20status:',_0x5c5ecb[_0xd88d('0x23')]);}}if(_0x134f68){return client[_0xd88d('0x33')](_0xd88d('0x34'),_0x4693a0)['then'](function(_0x4705e4){if(_0x4705e4[_0xd88d('0x10')]){return logger[_0xd88d('0x10')]('error\x20mail',JSON['stringify'](_0x4705e4));}return logger[_0xd88d('0x11')](_0xd88d('0x35'));})[_0xd88d('0xf')](function(_0x454b4d){return logger[_0xd88d('0x10')]('error\x20mail',JSON[_0xd88d('0x36')](_0x454b4d));});}}function handleError(){return function(_0x1a94a0){return logger['error'](JSON['stringify'](_0x1a94a0));};}function loading(_0x5a4fd7){logger[_0xd88d('0x11')](_0xd88d('0x37'));if(_0x5a4fd7[_0xd88d('0x38')]===_0x5a4fd7[_0xd88d('0x39')]['retries']){handleSendEmail(_0x5a4fd7[_0xd88d('0x3a')],_0x5a4fd7['data']);_0x5a4fd7[_0xd88d('0x3b')][_0xd88d('0x3c')]();}else{_0x5a4fd7[_0xd88d('0x3b')]['retry'](_0xd88d('0x3d'));}}function completed(_0x4ca553){logger[_0xd88d('0x11')](_0xd88d('0x3e'));handleSendEmail(_0x4ca553[_0xd88d('0x3a')],_0x4ca553[_0xd88d('0x3f')]);_0x4ca553[_0xd88d('0x3b')][_0xd88d('0x3c')]();}function empty(_0x47bed2){logger[_0xd88d('0x11')]('case\x20empty');handleSendEmail(_0x47bed2[_0xd88d('0x3a')],_0x47bed2[_0xd88d('0x3f')]);_0x47bed2[_0xd88d('0x3b')]['stop']();}function failed(_0x2a63da){logger[_0xd88d('0x11')](_0xd88d('0x40'));handleSendEmail(_0x2a63da['job'],_0x2a63da[_0xd88d('0x3f')]);_0x2a63da[_0xd88d('0x3b')][_0xd88d('0x3c')]();}function urecognized(_0x1a2b22){logger[_0xd88d('0x10')](_0xd88d('0x41'),_0x1a2b22[_0xd88d('0x42')][_0xd88d('0x43')]['status']);_0x1a2b22['operation'][_0xd88d('0x3c')]();}const reportStatusStrategies={'Loading':loading,'Completed':completed,'Empty':empty,'Failed':failed,'Unrecognized':urecognized};function retryer(_0x4ee4de,_0xbaca98){const _0x45746c={'retries':0x3,'factor':0x2,'minTimeout':0x5b*0x3e8,'maxTimeout':0xa*0x3c*0x3e8};const _0xb8d443=retry[_0xd88d('0x3b')](_0x45746c);_0xb8d443[_0xd88d('0x44')](_0x305382=>{logger[_0xd88d('0x11')]('Job\x20ID\x20'+_0x4ee4de['id']+_0xd88d('0x45')+_0x305382);try{getReportData(_0xbaca98['id'])[_0xd88d('0xe')](function(_0x23459d){_0xbaca98=_0x23459d;logger[_0xd88d('0x11')](_0xd88d('0x46'),_0x23459d[_0xd88d('0x43')][_0xd88d('0x23')]);if(!reportStatusStrategies[_0x23459d['dataValues']['status']]){logger['error']('report\x20status:',_0x23459d[_0xd88d('0x43')][_0xd88d('0x23')]);_0xb8d443[_0xd88d('0x47')]();}reportStatusStrategies[_0x23459d[_0xd88d('0x43')][_0xd88d('0x23')]]({'operation':_0xb8d443,'currentAttempt':_0x305382,'retryOptions':_0x45746c,'job':_0x4ee4de,'data':_0xbaca98,'entity':_0x23459d});});}catch(_0x570357){_0xb8d443[_0xd88d('0x47')](_0x570357);}});}function handleResult(_0x5e3bd0){return function(_0x60adbe){if(_0x5e3bd0['sendMail']&&_0x5e3bd0[_0xd88d('0x13')]&&_0x5e3bd0[_0xd88d('0x13')]['Smtp']&&!_[_0xd88d('0x48')](_0x5e3bd0[_0xd88d('0x1a')])){retryer(_0x5e3bd0,_0x60adbe);}};}function handleJob(_0x33a3d7){return function(){try{if(_[_0xd88d('0x48')](_0x33a3d7['subtractNumber'])){return logger['info'](_0xd88d('0x49'));}if(_[_0xd88d('0x48')](_0x33a3d7[_0xd88d('0x4a')])){return logger[_0xd88d('0x11')](_0xd88d('0x4b'));}var _0x352387={'startDate':moment()['subtract'](_0x33a3d7[_0xd88d('0x1d')],_0x33a3d7[_0xd88d('0x4a')])[_0xd88d('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0xd88d('0x4c')),'type':_0xd88d('0x4d'),'output':_0x33a3d7[_0xd88d('0x4e')],'name':_0x33a3d7[_0xd88d('0x17')]};if(!_[_0xd88d('0x48')](_0x33a3d7[_0xd88d('0x4f')])){logger[_0xd88d('0x11')](_0xd88d('0x50'),_0x33a3d7[_0xd88d('0x4f')]);return analyticDefaultReportController['runReport']({'id':_0x33a3d7[_0xd88d('0x4f')]},_0x352387)[_0xd88d('0xe')](handleResult(_0x33a3d7))['catch'](handleError());}if(!_[_0xd88d('0x48')](_0x33a3d7[_0xd88d('0x51')])){logger[_0xd88d('0x11')](_0xd88d('0x52'),_0x33a3d7[_0xd88d('0x51')]);return analyticCustomReportController[_0xd88d('0x53')]({'id':_0x33a3d7[_0xd88d('0x51')]},_0x352387)[_0xd88d('0xe')](handleResult(_0x33a3d7))[_0xd88d('0xf')](handleError());}}catch(_0x1fcba2){logger[_0xd88d('0x10')](JSON[_0xd88d('0x36')](_0x1fcba2));}return logger[_0xd88d('0x11')](_0xd88d('0x54'));};}function getJobs(_0x48a2e9){var _0x1459aa={};if(_0x48a2e9){_0x1459aa['id']=_0x48a2e9;}return db[_0xd88d('0x55')][_0xd88d('0x56')]({'where':_0x1459aa,'include':[{'model':db[_0xd88d('0x13')],'attributes':['id',_0xd88d('0x17'),'email'],'include':[{'model':db[_0xd88d('0x57')],'as':_0xd88d('0x18'),'include':[{'model':db[_0xd88d('0x58')],'as':_0xd88d('0x58')}]}]}]})[_0xd88d('0xe')](function(_0x1ccf66){var _0x412462=_[_0xd88d('0x59')](manager[_0xd88d('0x5a')]);var _0x46f434=_[_0xd88d('0x5b')](_0x1ccf66,function(_0x248c8f){return _0x248c8f['id'][_0xd88d('0x5c')]();});var _0x54609f=_['keyBy'](_0x1ccf66,function(_0x42ed56){return _0x42ed56['id']['toString']();});var _0xdbcded=_0x48a2e9?_0x46f434:_['difference'](_0x46f434,_0x412462);var _0x48266a=_[_0xd88d('0x5d')](_0x46f434,_0x412462);var _0x4355a2=_[_0xd88d('0x5e')](_0x412462,_0x46f434);var _0x16443b;var _0x507660;for(_0x16443b=0x0;_0x16443b<_0x4355a2['length']&&!_0x48a2e9;_0x16443b+=0x1){_0x507660=_0x4355a2[_0x16443b][_0xd88d('0x5c')]();if(manager[_0xd88d('0x5f')](_0x507660)){manager[_0xd88d('0x3c')](_0x507660);manager[_0xd88d('0x60')](_0x507660);logger[_0xd88d('0x11')](_0xd88d('0x61'),_0x507660);}}logger[_0xd88d('0x11')]('toRun',JSON[_0xd88d('0x36')](_0xdbcded));for(_0x16443b=0x0;_0x16443b<_0xdbcded[_0xd88d('0x62')];_0x16443b+=0x1){_0x507660=_0xdbcded[_0x16443b][_0xd88d('0x5c')]();if(_0x48a2e9){logger[_0xd88d('0x11')](JSON[_0xd88d('0x36')](_0x54609f[_0x507660]));BPromise['resolve']()[_0xd88d('0xe')](handleJob(_0x54609f[_0x507660]));logger[_0xd88d('0x11')](_0xd88d('0x63'),_0x54609f[_0x507660][_0xd88d('0x17')],_0x54609f[_0x507660]['cron']);}else if(_0x54609f[_0x507660][_0xd88d('0x64')]&&_0x54609f[_0x507660][_0xd88d('0x65')]&&moment()[_0xd88d('0x66')](_0x54609f[_0x507660][_0xd88d('0x67')],_0x54609f[_0x507660]['endAt'])){manager[_0xd88d('0x68')](_0x507660,_0x54609f[_0x507660]['cron'],handleJob(_0x54609f[_0x507660]));manager[_0xd88d('0x69')](_0x507660);logger['info'](_0xd88d('0x6a'),_0x54609f[_0x507660][_0xd88d('0x17')],_0x54609f[_0x507660][_0xd88d('0x64')]);}else if(manager[_0xd88d('0x5f')](_0x507660)){manager['stop'](_0x507660);manager['deleteJob'](_0x507660);logger[_0xd88d('0x11')](_0xd88d('0x6b'),_0x54609f[_0x507660][_0xd88d('0x17')],_0x54609f[_0x507660][_0xd88d('0x64')]);}}for(_0x16443b=0x0,_0x507660;_0x16443b<_0x48266a['length']&&!_0x48a2e9;_0x16443b+=0x1){_0x507660=_0x48266a[_0x16443b][_0xd88d('0x5c')]();if(manager[_0xd88d('0x5f')](_0x507660)){if(_0x54609f[_0x507660][_0xd88d('0x64')]&&_0x54609f[_0x507660][_0xd88d('0x65')]&&moment()['isBetween'](_0x54609f[_0x507660][_0xd88d('0x67')],_0x54609f[_0x507660]['endAt'])){manager['update'](_0x507660,_0x54609f[_0x507660][_0xd88d('0x64')],handleJob(_0x54609f[_0x507660]));logger['info'](_0xd88d('0x6c'),_0x54609f[_0x507660][_0xd88d('0x17')],_0x54609f[_0x507660]['cron']);}else{manager['stop'](_0x507660);manager[_0xd88d('0x60')](_0x507660);logger[_0xd88d('0x11')](_0xd88d('0x6b'),_0x54609f[_0x507660]['name'],_0x54609f[_0x507660][_0xd88d('0x64')]);}}}})[_0xd88d('0xf')](function(_0x253c36){logger[_0xd88d('0x10')](JSON[_0xd88d('0x36')](_0x253c36));});}exports[_0xd88d('0x6d')]=function(_0x35b4ef){return getJobs(_0x35b4ef);};exports[_0xd88d('0x69')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 07e5b76..4337906 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 _0x68b7=['../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','format','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','sentiment','sentimentRegion','language','bucket','Sequelize','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','update','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','Sentiment\x20Analysis\x20not\x20requested','Sentiment\x20Analysis\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Negative','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push','all','lodash','request-promise','util','bluebird'];(function(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0x68b7,0x8c));var _0x768b=function(_0x277a88,_0xa478ed){_0x277a88=_0x277a88-0x0;var _0x334ad1=_0x68b7[_0x277a88];return _0x334ad1;};var _=require(_0x768b('0x0'));var AWS=require('aws-sdk');var rp=require(_0x768b('0x1'));var util=require(_0x768b('0x2'));var BPromise=require(_0x768b('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x768b('0x4'))(_0x768b('0x5'));function getTranscriptionJob(_0xd48c9a,_0x569819,_0x1d3573,_0x1dc0e1){return new Promise(function(_0x18aaaa,_0x31aba4){var _0xba88ed=new AWS[(_0x768b('0x6'))]({'accessKeyId':_0x569819,'secretAccessKey':_0xd48c9a,'region':_0x1d3573});_0xba88ed[_0x768b('0x7')]({'TranscriptionJobName':_0x1dc0e1},function(_0x48405c,_0x441e3a){if(_0x48405c){return _0x31aba4(_0x48405c);}else{return _0x18aaaa(_0x441e3a);}});});}function sentiment(_0x47c2ea,_0x30fccf,_0x192508,_0x3ebfe5,_0x17f241){return new Promise(function(_0x40c6d3,_0x2d4edc){var _0x494750=new AWS[(_0x768b('0x8'))]({'accessKeyId':_0x30fccf,'secretAccessKey':_0x47c2ea,'region':_0x192508});_0x494750[_0x768b('0x9')]({'Text':_0x3ebfe5,'LanguageCode':_0x17f241['substring'](0x0,0x2)},function(_0x5b90ca,_0x46b23b){if(_0x5b90ca){return _0x2d4edc(_0x5b90ca);}else{return _0x40c6d3(_0x46b23b);}});});}function checkTranscribeJob(_0x1e26bd,_0x35689d,_0x9c3671){var _0x8fa3e6;return new BPromise(function(_0x2948b1,_0x9dae76){logger[_0x768b('0xa')](util[_0x768b('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x1e26bd['id'],_0x1e26bd[_0x768b('0xc')]));return getTranscriptionJob(_0x9c3671[_0x768b('0xd')],_0x9c3671[_0x768b('0xe')],_0x35689d[_0x768b('0xf')],_0x1e26bd[_0x768b('0xc')])['then'](function(_0x17078f){logger[_0x768b('0xa')](util[_0x768b('0xb')](_0x768b('0x10'),_0x1e26bd['id'],_0x1e26bd[_0x768b('0xc')],_0x17078f[_0x768b('0x11')][_0x768b('0x12')]));if(!_0x1e26bd[_0x768b('0x13')]){switch(_0x17078f[_0x768b('0x11')][_0x768b('0x12')]){case _0x768b('0x14'):var _0x21aaa6={'transcribeStatus':_0x17078f['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x17078f[_0x768b('0x11')][_0x768b('0x15')]['TranscriptFileUri']};logger[_0x768b('0xa')](util[_0x768b('0xb')]('[RECORDING:%d]\x20Get\x20transcript',_0x1e26bd['id']));return rp({'uri':_0x17078f[_0x768b('0x11')][_0x768b('0x15')][_0x768b('0x16')],'json':!![]})[_0x768b('0x17')](function(_0xaa1538){logger['info'](util['format'](_0x768b('0x18'),_0x1e26bd['id']));if(_0xaa1538&&_0xaa1538[_0x768b('0x19')]&&_0xaa1538[_0x768b('0x19')][_0x768b('0x1a')]&&_0xaa1538[_0x768b('0x19')][_0x768b('0x1a')][_0x768b('0x1b')]){_0x21aaa6[_0x768b('0x13')]='';for(var _0x1a1733=0x0;_0x1a1733<_0xaa1538[_0x768b('0x19')][_0x768b('0x1a')][_0x768b('0x1b')];_0x1a1733++){_0x21aaa6[_0x768b('0x13')]+=_0xaa1538[_0x768b('0x19')]['transcripts'][_0x1a1733][_0x768b('0x1c')]+'';}}return _0x1e26bd['update'](_0x21aaa6);})['then'](function(){logger['info'](util['format'](_0x768b('0x1d'),_0x1e26bd['id']));if(!_0x1e26bd[_0x768b('0x1e')]){throw new db['Sequelize'][(_0x768b('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x35689d[_0x768b('0x20')]||!_0x35689d['sentimentAccountId']||!_0x35689d[_0x768b('0x21')]||!_0x35689d[_0x768b('0x22')]||!_0x35689d[_0x768b('0x23')]){throw new db[(_0x768b('0x24'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x21aaa6['fileText']){throw new Error(_0x768b('0x25'));}if(_0x35689d[_0x768b('0x26')]===_0x9c3671['id']){return _0x9c3671;}else{return db[_0x768b('0x27')][_0x768b('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x768b('0x17')](function(_0x293ffd){if(!_0x293ffd){throw new db['Sequelize']['ValidationError'](_0x768b('0x29'));}if(!_0x293ffd[_0x768b('0xd')]||!_0x293ffd['data2']){throw new db[(_0x768b('0x24'))][(_0x768b('0x1f'))](_0x768b('0x2a'));}_0x8fa3e6=_0x293ffd;logger[_0x768b('0xa')](util[_0x768b('0xb')](_0x768b('0x2b'),_0x1e26bd['id']));return sentiment(_0x8fa3e6['data1'],_0x8fa3e6[_0x768b('0xe')],_0x35689d[_0x768b('0x21')],_0x21aaa6[_0x768b('0x13')],_0x35689d['language']);})[_0x768b('0x17')](function(_0x24383f){logger[_0x768b('0xa')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1e26bd['id']));return _0x1e26bd[_0x768b('0x2c')]({'sentiment':_0x24383f[_0x768b('0x2d')],'sPositive':_0x24383f[_0x768b('0x2e')][_0x768b('0x2f')],'sNegative':_0x24383f[_0x768b('0x2e')]['Negative'],'sMixed':_0x24383f[_0x768b('0x2e')][_0x768b('0x30')],'sNeutral':_0x24383f[_0x768b('0x2e')][_0x768b('0x31')]});})[_0x768b('0x17')](function(){logger[_0x768b('0xa')](util[_0x768b('0xb')](_0x768b('0x1d'),_0x1e26bd['id']));_0x2948b1();});case _0x768b('0x32'):return _0x1e26bd['update']({'transcribeStatus':_0x768b('0x32'),'failureReason':_0x17078f[_0x768b('0x11')][_0x768b('0x33')]})[_0x768b('0x17')](function(){logger[_0x768b('0xa')](util['format'](_0x768b('0x1d'),_0x1e26bd['id']));_0x2948b1();});default:logger[_0x768b('0xa')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1e26bd['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x1e26bd[_0x768b('0x1e')]){throw new db[(_0x768b('0x24'))][(_0x768b('0x1f'))](_0x768b('0x34'));}if(!_0x35689d[_0x768b('0x20')]||!_0x35689d['sentimentAccountId']||!_0x35689d[_0x768b('0x21')]||!_0x35689d['language']||!_0x35689d['bucket']){throw new db[(_0x768b('0x24'))][(_0x768b('0x1f'))](_0x768b('0x35'));}if(!_0x1e26bd[_0x768b('0x13')]){throw new Error(_0x768b('0x25'));}if(_0x35689d[_0x768b('0x26')]===_0x9c3671['id']){return _0x9c3671;}else{return db[_0x768b('0x27')][_0x768b('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x768b('0x17')](function(_0x3519da){if(!_0x3519da){throw new db[(_0x768b('0x24'))][(_0x768b('0x1f'))](_0x768b('0x29'));}if(!_0x3519da['data1']||!_0x3519da['data2']){throw new db['Sequelize'][(_0x768b('0x1f'))](_0x768b('0x2a'));}_0x8fa3e6=_0x3519da;logger[_0x768b('0xa')](util[_0x768b('0xb')](_0x768b('0x2b'),_0x1e26bd['id']));return sentiment(_0x8fa3e6[_0x768b('0xd')],_0x8fa3e6[_0x768b('0xe')],_0x35689d['sentimentRegion'],_0x1e26bd['fileText'],_0x35689d[_0x768b('0x22')]);})[_0x768b('0x17')](function(_0x2aff3d){logger[_0x768b('0xa')](util[_0x768b('0xb')](_0x768b('0x36'),_0x1e26bd['id']));return _0x1e26bd[_0x768b('0x2c')]({'sentiment':_0x2aff3d['Sentiment'],'sPositive':_0x2aff3d[_0x768b('0x2e')][_0x768b('0x2f')],'sNegative':_0x2aff3d[_0x768b('0x2e')][_0x768b('0x37')],'sMixed':_0x2aff3d[_0x768b('0x2e')][_0x768b('0x30')],'sNeutral':_0x2aff3d[_0x768b('0x2e')][_0x768b('0x31')],'transcribeStatus':_0x768b('0x14')});})[_0x768b('0x17')](function(){logger[_0x768b('0xa')](util[_0x768b('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1e26bd['id']));_0x2948b1();});}})[_0x768b('0x38')](function(_0x1a2ad0){if(_0x1a2ad0){if(!_0x1a2ad0[_0x768b('0x39')]||_0x1a2ad0[_0x768b('0x39')]!==_0x768b('0x3a')){logger[_0x768b('0x3b')](util[_0x768b('0xb')](_0x768b('0x3c'),_0x1e26bd['id']),util[_0x768b('0x3d')](_0x1a2ad0,{'showHidden':![],'depth':null}));}}_0x2948b1();});});}function checkTranscribe(){var _0x2e4f69;var _0x27c62a;var _0x17fb3c;return db[_0x768b('0x3e')][_0x768b('0x3f')]({'where':{'transcribeStatus':_0x768b('0x40')}})[_0x768b('0x17')](function(_0x4a1407){if(!_0x4a1407||!_0x4a1407[_0x768b('0x1b')]){throw new db[(_0x768b('0x24'))][(_0x768b('0x1f'))](_0x768b('0x41'));}_0x2e4f69=_0x4a1407;return db[_0x768b('0x42')][_0x768b('0x28')]({'where':{'id':0x1}});})[_0x768b('0x17')](function(_0x4ef9ce){if(!_0x4ef9ce){throw new db[(_0x768b('0x24'))]['ValidationError'](_0x768b('0x43'));}_0x27c62a=_0x4ef9ce;if(!_0x27c62a[_0x768b('0x5')]||!_0x27c62a['transcribeAccountId']||!_0x27c62a[_0x768b('0xf')]||!_0x27c62a[_0x768b('0x22')]||!_0x27c62a[_0x768b('0x23')]){throw new db['Sequelize'][(_0x768b('0x1f'))]('Transcribe\x20not\x20configured');}return db['CloudProvider']['findOne']({'where':{'id':_0x27c62a[_0x768b('0x44')]}});})['then'](function(_0x3e4f3c){if(!_0x3e4f3c){throw new db['Sequelize'][(_0x768b('0x1f'))](_0x768b('0x29'));}if(!_0x3e4f3c['data1']||!_0x3e4f3c[_0x768b('0xe')]){throw new db[(_0x768b('0x24'))][(_0x768b('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x17fb3c=_0x3e4f3c;var _0x620c2f=[];_0x2e4f69[_0x768b('0x45')](function(_0x1fba37){_0x620c2f[_0x768b('0x46')](checkTranscribeJob(_0x1fba37,_0x27c62a,_0x17fb3c));});return BPromise[_0x768b('0x47')](_0x620c2f);})[_0x768b('0x38')](function(_0x52d061){if(_0x52d061){if(!_0x52d061[_0x768b('0x39')]||_0x52d061[_0x768b('0x39')]!==_0x768b('0x3a')){logger[_0x768b('0x3b')](util[_0x768b('0x3d')](_0x52d061,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xa45c=['sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Negative','SentimentScore','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','resolve','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','bucket','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Positive','Mixed','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','all','start','lodash','aws-sdk','bluebird','../../config/logger','getTranscriptionJob','Comprehend','detectSentiment','format','transcribeName','data1','data2','transcribeRegion','then','TranscriptionJob','TranscriptionJobStatus','TranscriptFileUri','info','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','tempSentiment','Sequelize','ValidationError'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa45c,0x6d));var _0xca45=function(_0x360eb9,_0x4544ce){_0x360eb9=_0x360eb9-0x0;var _0x26ebe9=_0xa45c[_0x360eb9];return _0x26ebe9;};var _=require(_0xca45('0x0'));var AWS=require(_0xca45('0x1'));var rp=require('request-promise');var util=require('util');var BPromise=require(_0xca45('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xca45('0x3'))('transcribe');function getTranscriptionJob(_0x16a36c,_0x47d8b9,_0x4d45e6,_0x33a162){return new Promise(function(_0x3803d6,_0x18d789){var _0x15628b=new AWS['TranscribeService']({'accessKeyId':_0x47d8b9,'secretAccessKey':_0x16a36c,'region':_0x4d45e6});_0x15628b[_0xca45('0x4')]({'TranscriptionJobName':_0x33a162},function(_0x276897,_0x7ceab1){if(_0x276897){return _0x18d789(_0x276897);}else{return _0x3803d6(_0x7ceab1);}});});}function sentiment(_0x307649,_0x312400,_0x5c18b9,_0xeb0cd9,_0x342542){return new Promise(function(_0x32afdc,_0x151691){var _0x3a551=new AWS[(_0xca45('0x5'))]({'accessKeyId':_0x312400,'secretAccessKey':_0x307649,'region':_0x5c18b9});_0x3a551[_0xca45('0x6')]({'Text':_0xeb0cd9,'LanguageCode':_0x342542['substring'](0x0,0x2)},function(_0x643942,_0x360ee9){if(_0x643942){return _0x151691(_0x643942);}else{return _0x32afdc(_0x360ee9);}});});}function checkTranscribeJob(_0x44a6cc,_0x17ebf7,_0x580c43){var _0x3044b1;return new BPromise(function(_0x711b03,_0x26f5a0){logger['info'](util[_0xca45('0x7')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x44a6cc['id'],_0x44a6cc[_0xca45('0x8')]));return getTranscriptionJob(_0x580c43[_0xca45('0x9')],_0x580c43[_0xca45('0xa')],_0x17ebf7[_0xca45('0xb')],_0x44a6cc[_0xca45('0x8')])[_0xca45('0xc')](function(_0x18dd61){logger['info'](util[_0xca45('0x7')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x44a6cc['id'],_0x44a6cc['transcribeName'],_0x18dd61[_0xca45('0xd')][_0xca45('0xe')]));if(!_0x44a6cc['fileText']){switch(_0x18dd61[_0xca45('0xd')][_0xca45('0xe')]){case'COMPLETED':var _0x40540f={'transcribeStatus':_0x18dd61[_0xca45('0xd')][_0xca45('0xe')],'fileUri':_0x18dd61[_0xca45('0xd')]['Transcript'][_0xca45('0xf')]};logger[_0xca45('0x10')](util[_0xca45('0x7')](_0xca45('0x11'),_0x44a6cc['id']));return rp({'uri':_0x18dd61['TranscriptionJob'][_0xca45('0x12')][_0xca45('0xf')],'json':!![]})[_0xca45('0xc')](function(_0x34bb8d){logger[_0xca45('0x10')](util[_0xca45('0x7')](_0xca45('0x13'),_0x44a6cc['id']));if(_0x34bb8d&&_0x34bb8d[_0xca45('0x14')]&&_0x34bb8d[_0xca45('0x14')]['transcripts']&&_0x34bb8d[_0xca45('0x14')][_0xca45('0x15')][_0xca45('0x16')]){_0x40540f[_0xca45('0x17')]='';for(var _0x242cb1=0x0;_0x242cb1<_0x34bb8d['results']['transcripts']['length'];_0x242cb1++){_0x40540f[_0xca45('0x17')]+=_0x34bb8d['results']['transcripts'][_0x242cb1][_0xca45('0x18')]+'';}}return _0x44a6cc[_0xca45('0x19')](_0x40540f);})[_0xca45('0xc')](function(){logger[_0xca45('0x10')](util[_0xca45('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x44a6cc['id']));if(!_0x44a6cc[_0xca45('0x1a')]){throw new db[(_0xca45('0x1b'))][(_0xca45('0x1c'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x17ebf7['sentiment']||!_0x17ebf7['sentimentAccountId']||!_0x17ebf7[_0xca45('0x1d')]||!_0x17ebf7[_0xca45('0x1e')]||!_0x17ebf7['bucket']){throw new db[(_0xca45('0x1b'))][(_0xca45('0x1c'))](_0xca45('0x1f'));}if(!_0x40540f[_0xca45('0x17')]){throw new Error('Transcript\x20not\x20available');}if(_0x17ebf7['sentimentAccountId']===_0x580c43['id']){return _0x580c43;}else{return db['CloudProvider'][_0xca45('0x20')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x4adb91){if(!_0x4adb91){throw new db[(_0xca45('0x1b'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x4adb91[_0xca45('0x9')]||!_0x4adb91[_0xca45('0xa')]){throw new db[(_0xca45('0x1b'))]['ValidationError'](_0xca45('0x21'));}_0x3044b1=_0x4adb91;logger[_0xca45('0x10')](util['format'](_0xca45('0x22'),_0x44a6cc['id']));return sentiment(_0x3044b1[_0xca45('0x9')],_0x3044b1[_0xca45('0xa')],_0x17ebf7[_0xca45('0x1d')],_0x40540f[_0xca45('0x17')],_0x17ebf7[_0xca45('0x1e')]);})[_0xca45('0xc')](function(_0x291dd6){logger[_0xca45('0x10')](util[_0xca45('0x7')](_0xca45('0x23'),_0x44a6cc['id']));return _0x44a6cc[_0xca45('0x19')]({'sentiment':_0x291dd6[_0xca45('0x24')],'sPositive':_0x291dd6['SentimentScore']['Positive'],'sNegative':_0x291dd6['SentimentScore'][_0xca45('0x25')],'sMixed':_0x291dd6[_0xca45('0x26')]['Mixed'],'sNeutral':_0x291dd6['SentimentScore'][_0xca45('0x27')]});})['then'](function(){logger[_0xca45('0x10')](util['format'](_0xca45('0x28'),_0x44a6cc['id']));_0x711b03();});case _0xca45('0x29'):return _0x44a6cc[_0xca45('0x19')]({'transcribeStatus':_0xca45('0x29'),'failureReason':_0x18dd61[_0xca45('0xd')]['FailureReason']})[_0xca45('0xc')](function(){logger['info'](util[_0xca45('0x7')](_0xca45('0x28'),_0x44a6cc['id']));_0x711b03();});default:logger[_0xca45('0x10')](util[_0xca45('0x7')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x44a6cc['id']));break;}}else{return BPromise[_0xca45('0x2a')]()[_0xca45('0xc')](function(){if(!_0x44a6cc[_0xca45('0x1a')]){throw new db['Sequelize']['ValidationError'](_0xca45('0x2b'));}if(!_0x17ebf7[_0xca45('0x2c')]||!_0x17ebf7[_0xca45('0x2d')]||!_0x17ebf7[_0xca45('0x1d')]||!_0x17ebf7[_0xca45('0x1e')]||!_0x17ebf7[_0xca45('0x2e')]){throw new db[(_0xca45('0x1b'))][(_0xca45('0x1c'))](_0xca45('0x1f'));}if(!_0x44a6cc[_0xca45('0x17')]){throw new Error(_0xca45('0x2f'));}if(_0x17ebf7[_0xca45('0x2d')]===_0x580c43['id']){return _0x580c43;}else{return db[_0xca45('0x30')][_0xca45('0x20')]({'where':{'id':_settings[_0xca45('0x2d')]}});}})[_0xca45('0xc')](function(_0x288d8c){if(!_0x288d8c){throw new db[(_0xca45('0x1b'))]['ValidationError'](_0xca45('0x31'));}if(!_0x288d8c[_0xca45('0x9')]||!_0x288d8c[_0xca45('0xa')]){throw new db['Sequelize'][(_0xca45('0x1c'))](_0xca45('0x21'));}_0x3044b1=_0x288d8c;logger[_0xca45('0x10')](util[_0xca45('0x7')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x44a6cc['id']));return sentiment(_0x3044b1[_0xca45('0x9')],_0x3044b1[_0xca45('0xa')],_0x17ebf7[_0xca45('0x1d')],_0x44a6cc[_0xca45('0x17')],_0x17ebf7[_0xca45('0x1e')]);})[_0xca45('0xc')](function(_0x447057){logger[_0xca45('0x10')](util[_0xca45('0x7')](_0xca45('0x23'),_0x44a6cc['id']));return _0x44a6cc[_0xca45('0x19')]({'sentiment':_0x447057[_0xca45('0x24')],'sPositive':_0x447057[_0xca45('0x26')][_0xca45('0x32')],'sNegative':_0x447057[_0xca45('0x26')][_0xca45('0x25')],'sMixed':_0x447057[_0xca45('0x26')][_0xca45('0x33')],'sNeutral':_0x447057[_0xca45('0x26')]['Neutral'],'transcribeStatus':_0xca45('0x34')});})[_0xca45('0xc')](function(){logger[_0xca45('0x10')](util[_0xca45('0x7')](_0xca45('0x28'),_0x44a6cc['id']));_0x711b03();});}})[_0xca45('0x35')](function(_0x3dadb2){if(_0x3dadb2){if(!_0x3dadb2[_0xca45('0x36')]||_0x3dadb2[_0xca45('0x36')]!==_0xca45('0x37')){logger[_0xca45('0x38')](util[_0xca45('0x7')](_0xca45('0x39'),_0x44a6cc['id']),util[_0xca45('0x3a')](_0x3dadb2,{'showHidden':![],'depth':null}));}}_0x711b03();});});}function checkTranscribe(){var _0x5b1c63;var _0x386463;var _0x457008;return db[_0xca45('0x3b')][_0xca45('0x3c')]({'where':{'transcribeStatus':_0xca45('0x3d')}})[_0xca45('0xc')](function(_0x43fd72){if(!_0x43fd72||!_0x43fd72[_0xca45('0x16')]){throw new db[(_0xca45('0x1b'))][(_0xca45('0x1c'))](_0xca45('0x3e'));}_0x5b1c63=_0x43fd72;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0xca45('0xc')](function(_0x1b15be){if(!_0x1b15be){throw new db['Sequelize'][(_0xca45('0x1c'))](_0xca45('0x3f'));}_0x386463=_0x1b15be;if(!_0x386463[_0xca45('0x40')]||!_0x386463[_0xca45('0x41')]||!_0x386463[_0xca45('0xb')]||!_0x386463[_0xca45('0x1e')]||!_0x386463[_0xca45('0x2e')]){throw new db[(_0xca45('0x1b'))][(_0xca45('0x1c'))](_0xca45('0x42'));}return db[_0xca45('0x30')][_0xca45('0x20')]({'where':{'id':_0x386463[_0xca45('0x41')]}});})['then'](function(_0x45de07){if(!_0x45de07){throw new db[(_0xca45('0x1b'))][(_0xca45('0x1c'))](_0xca45('0x31'));}if(!_0x45de07[_0xca45('0x9')]||!_0x45de07[_0xca45('0xa')]){throw new db[(_0xca45('0x1b'))][(_0xca45('0x1c'))](_0xca45('0x21'));}_0x457008=_0x45de07;var _0x48b492=[];_0x5b1c63['forEach'](function(_0x4cb20b){_0x48b492['push'](checkTranscribeJob(_0x4cb20b,_0x386463,_0x457008));});return BPromise[_0xca45('0x43')](_0x48b492);})[_0xca45('0x35')](function(_0x3827fa){if(_0x3827fa){if(!_0x3827fa[_0xca45('0x36')]||_0x3827fa['name']!==_0xca45('0x37')){logger[_0xca45('0x38')](util['inspect'](_0x3827fa,{'showHidden':![],'depth':null}));}}});}exports[_0xca45('0x44')]=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 2be7c0b..9582d8e 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 _0xbb29=['../../config/environment','../logger','schedule','redis','defaults','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util'];(function(_0x280820,_0xce9bc7){var _0x474787=function(_0x3d224e){while(--_0x3d224e){_0x280820['push'](_0x280820['shift']());}};_0x474787(++_0xce9bc7);}(_0xbb29,0x78));var _0x9bb2=function(_0x530376,_0x5a6e7d){_0x530376=_0x530376-0x0;var _0x30ee50=_0xbb29[_0x530376];return _0x30ee50;};'use strict';var _=require(_0x9bb2('0x0'));var moment=require(_0x9bb2('0x1'));var Redis=require(_0x9bb2('0x2'));var util=require(_0x9bb2('0x3'));var config=require(_0x9bb2('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x9bb2('0x5'))(_0x9bb2('0x6'));config[_0x9bb2('0x7')]=_[_0x9bb2('0x8')](config[_0x9bb2('0x7')],{'host':_0x9bb2('0x9'),'port':0x18eb});var io=require(_0x9bb2('0xa'))(new Redis(config[_0x9bb2('0x7')]));function closeInteractions(){var _0x577d3d=[];return db['WhatsappInteraction'][_0x9bb2('0xb')]({'raw':!![],'attributes':['id',_0x9bb2('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x9bb2('0xd')](0x18,_0x9bb2('0xe'))}}})[_0x9bb2('0xf')](function(_0x37a8d5){if(_0x37a8d5&&_0x37a8d5[_0x9bb2('0x10')]){_0x577d3d=_[_0x9bb2('0x11')](_0x37a8d5||[],'id');logger[_0x9bb2('0x12')](_0x9bb2('0x13'),_0x577d3d[_0x9bb2('0x14')]());return db[_0x9bb2('0x15')][_0x9bb2('0x16')]({'closeReason':'system','disposition':_0x9bb2('0x17'),'closed':!![],'closedAt':moment()[_0x9bb2('0x18')](_0x9bb2('0x19'))},{'where':{'id':_0x577d3d}});}})[_0x9bb2('0xf')](function(){if(_0x577d3d&&_0x577d3d[_0x9bb2('0x10')]){logger['info'](_0x9bb2('0x1a'),_0x577d3d[_0x9bb2('0x14')]());for(var _0x4e75ac=0x0;_0x4e75ac<_0x577d3d[_0x9bb2('0x10')];_0x4e75ac++){io['emit'](_0x9bb2('0x1b'),{'id':_0x577d3d[_0x4e75ac],'closed':!![]});}}})[_0x9bb2('0x1c')](function(_0x4a0929){logger['error'](_0x9bb2('0x1d'),_0x4a0929?util['inspect'](_0x4a0929,{'showHidden':![],'depth':null}):'');});}exports[_0x9bb2('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe130=['WhatsappInteraction','findAll','lastMsgAt','subtract','then','[WHATSAPP]\x20Interactions\x20to\x20close:','system','timeout','format','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','length','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','util','schedule','redis','localhost','socket.io-emitter'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0xe130,0x18a));var _0x0e13=function(_0x1c1a09,_0x417b54){_0x1c1a09=_0x1c1a09-0x0;var _0x2209e2=_0xe130[_0x1c1a09];return _0x2209e2;};'use strict';var _=require('lodash');var moment=require(_0x0e13('0x0'));var Redis=require('ioredis');var util=require(_0x0e13('0x1'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x0e13('0x2'));config[_0x0e13('0x3')]=_['defaults'](config[_0x0e13('0x3')],{'host':_0x0e13('0x4'),'port':0x18eb});var io=require(_0x0e13('0x5'))(new Redis(config[_0x0e13('0x3')]));function closeInteractions(){var _0x1878d5=[];return db[_0x0e13('0x6')][_0x0e13('0x7')]({'raw':!![],'attributes':['id',_0x0e13('0x8')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0e13('0x9')](0x18,'hours')}}})[_0x0e13('0xa')](function(_0x1ebe95){if(_0x1ebe95&&_0x1ebe95['length']){_0x1878d5=_['map'](_0x1ebe95||[],'id');logger['info'](_0x0e13('0xb'),_0x1878d5['join']());return db[_0x0e13('0x6')]['update']({'closeReason':_0x0e13('0xc'),'disposition':_0x0e13('0xd'),'closed':!![],'closedAt':moment()[_0x0e13('0xe')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1878d5}});}})[_0x0e13('0xa')](function(){if(_0x1878d5&&_0x1878d5['length']){logger[_0x0e13('0xf')](_0x0e13('0x10'),_0x1878d5[_0x0e13('0x11')]());for(var _0x402913=0x0;_0x402913<_0x1878d5[_0x0e13('0x12')];_0x402913++){io[_0x0e13('0x13')](_0x0e13('0x14'),{'id':_0x1878d5[_0x402913],'closed':!![]});}}})[_0x0e13('0x15')](function(_0x4e5b93){logger['error'](_0x0e13('0x16'),_0x4e5b93?util[_0x0e13('0x17')](_0x4e5b93,{'showHidden':![],'depth':null}):'');});}exports[_0x0e13('0x18')]=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 94e6f40..8541be2 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bb3=['destroy','then','bulkCreate','log','contacts1','CmHopper','finished\x20populating','hopper1','hopper2','catch','util','push','Innocenzo','Biondo','@xcally.com','now','CmContact'];(function(_0x1cddd4,_0x4a2f08){var _0x5d7bce=function(_0x9c71c0){while(--_0x9c71c0){_0x1cddd4['push'](_0x1cddd4['shift']());}};_0x5d7bce(++_0x4a2f08);}(_0x9bb3,0x14d));var _0x39bb=function(_0x4423d7,_0x367621){_0x4423d7=_0x4423d7-0x0;var _0x1ecad3=_0x9bb3[_0x4423d7];return _0x1ecad3;};'use strict';var util=require(_0x39bb('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x39bb('0x1')]({'id':i,'firstName':_0x39bb('0x2')+i,'lastName':_0x39bb('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x39bb('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x39bb('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x39bb('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x39bb('0x5')](),'updatedAt':Date[_0x39bb('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x39bb('0x1')]({'id':i,'firstName':_0x39bb('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x39bb('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x39bb('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x39bb('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x39bb('0x5')]()});}db[_0x39bb('0x6')][_0x39bb('0x7')]({'where':{}})[_0x39bb('0x8')](function(){return db['CmContact'][_0x39bb('0x9')](contacts);})['then'](function(){console[_0x39bb('0xa')]('finished\x20populating',_0x39bb('0xb'));return db['CmHopper'][_0x39bb('0x7')]({'where':{}});})[_0x39bb('0x8')](function(){return db[_0x39bb('0xc')]['bulkCreate'](hopper);})[_0x39bb('0x8')](function(){console[_0x39bb('0xa')](_0x39bb('0xd'),_0x39bb('0xe'));return db[_0x39bb('0x6')]['bulkCreate'](contacts2);})['then'](function(){console[_0x39bb('0xa')](_0x39bb('0xd'),'contacts2');return db[_0x39bb('0xc')][_0x39bb('0x9')](hopper2);})[_0x39bb('0x8')](function(){console['log']('finished\x20populating',_0x39bb('0xf'));})[_0x39bb('0x10')](function(_0x5b7950){console[_0x39bb('0xa')](_0x5b7950);}); \ No newline at end of file +var _0x009c=['hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','finished\x20populating','contacts1','log','hopper1','bulkCreate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x009c,0x122));var _0xc009=function(_0x5b2fcd,_0x206187){_0x5b2fcd=_0x5b2fcd-0x0;var _0x5ddb3b=_0x009c[_0x5b2fcd];return _0x5ddb3b;};'use strict';var util=require(_0xc009('0x0'));var db=require(_0xc009('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc009('0x2')]({'id':i,'firstName':_0xc009('0x3')+i,'lastName':_0xc009('0x4')+i,'phone':0xf879fb460+i,'email':_0xc009('0x5')+i+_0xc009('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xc009('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc009('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc009('0x7')](),'updatedAt':Date[_0xc009('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc009('0x2')]({'id':i,'firstName':_0xc009('0x3')+i,'lastName':_0xc009('0x4')+i,'phone':0xf879fb460+i,'email':_0xc009('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc009('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc009('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xc009('0x7')]()});}db[_0xc009('0x8')][_0xc009('0x9')]({'where':{}})[_0xc009('0xa')](function(){return db[_0xc009('0x8')]['bulkCreate'](contacts);})[_0xc009('0xa')](function(){console['log'](_0xc009('0xb'),_0xc009('0xc'));return db['CmHopper'][_0xc009('0x9')]({'where':{}});})[_0xc009('0xa')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0xc009('0xa')](function(){console[_0xc009('0xd')]('finished\x20populating',_0xc009('0xe'));return db['CmContact'][_0xc009('0xf')](contacts2);})['then'](function(){console[_0xc009('0xd')]('finished\x20populating','contacts2');return db['CmHopper'][_0xc009('0xf')](hopper2);})[_0xc009('0xa')](function(){console[_0xc009('0xd')]('finished\x20populating',_0xc009('0x10'));})[_0xc009('0x11')](function(_0x3eccd5){console[_0xc009('0xd')](_0x3eccd5);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index f0859f2..8b0c503 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2bb=['User','bulkCreate','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass'];(function(_0x10eb69,_0xd421ab){var _0xf6d50d=function(_0x5c76db){while(--_0x5c76db){_0x10eb69['push'](_0x10eb69['shift']());}};_0xf6d50d(++_0xd421ab);}(_0xf2bb,0x1d1));var _0xbf2b=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xf2bb[_0x2283dc];return _0x16db90;};'use strict';var util=require(_0xbf2b('0x0'));var db=require(_0xbf2b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xbf2b('0x2')]({'name':util[_0xbf2b('0x3')](_0xbf2b('0x4'),_0xbf2b('0x5'),i),'fullname':util[_0xbf2b('0x3')]('%s%s',_0xbf2b('0x5'),i),'email':util[_0xbf2b('0x3')](_0xbf2b('0x6'),_0xbf2b('0x5'),i),'role':_0xbf2b('0x5'),'password':'password','internal':0xfa0+i,'type':_0xbf2b('0x7'),'transport':[_0xbf2b('0x8'),'ws','wss'],'disallow':[_0xbf2b('0x9')],'allow':[_0xbf2b('0xa')],'defaultuser':util['format'](_0xbf2b('0x4'),'agent',i),'encryption':_0xbf2b('0xb'),'avpf':_0xbf2b('0xb'),'force_avp':_0xbf2b('0xb'),'icesupport':_0xbf2b('0xb'),'dtlsenable':_0xbf2b('0xb'),'dtlsverify':'no','dtlscertfile':_0xbf2b('0xc'),'dtlsprivatekey':_0xbf2b('0xd'),'dtlssetup':_0xbf2b('0xe'),'callerid':util[_0xbf2b('0x3')]('\x22%s\x22\x20<%s>',util['format'](_0xbf2b('0x4'),_0xbf2b('0x5'),i),0xfa0+i)});}db[_0xbf2b('0xf')][_0xbf2b('0x10')](users)['then'](function(){console[_0xbf2b('0x11')](_0xbf2b('0x12'));})[_0xbf2b('0x13')](function(_0x11d1e7){console[_0xbf2b('0x11')](_0x11d1e7);}); \ No newline at end of file +var _0x80df=['catch','log','util','../mysqldb','push','format','%s%s','%s%s@xcally.com','agent','friend','udp','all','yes','/etc/pki/tls/certs/motion.crt','actpass','User'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80df,0x182));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xf80d('0x0'));var db=require(_0xf80d('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf80d('0x2')]({'name':util[_0xf80d('0x3')](_0xf80d('0x4'),'agent',i),'fullname':util[_0xf80d('0x3')](_0xf80d('0x4'),'agent',i),'email':util[_0xf80d('0x3')](_0xf80d('0x5'),_0xf80d('0x6'),i),'role':_0xf80d('0x6'),'password':'password','internal':0xfa0+i,'type':_0xf80d('0x7'),'transport':[_0xf80d('0x8'),'ws','wss'],'disallow':[_0xf80d('0x9')],'allow':['ulaw'],'defaultuser':util[_0xf80d('0x3')](_0xf80d('0x4'),_0xf80d('0x6'),i),'encryption':'yes','avpf':'yes','force_avp':_0xf80d('0xa'),'icesupport':_0xf80d('0xa'),'dtlsenable':_0xf80d('0xa'),'dtlsverify':'no','dtlscertfile':_0xf80d('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xf80d('0xc'),'callerid':util[_0xf80d('0x3')]('\x22%s\x22\x20<%s>',util[_0xf80d('0x3')](_0xf80d('0x4'),_0xf80d('0x6'),i),0xfa0+i)});}db[_0xf80d('0xd')]['bulkCreate'](users)['then'](function(){console['log']('add\x20user');})[_0xf80d('0xe')](function(_0x370558){console[_0xf80d('0xf')](_0x370558);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index d828879..321844b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd69e=['ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','VoiceQueues','OpenchannelQueues','OpenchannelQueue','Trunk','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','voice','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','leave','emit','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','name','agent','ivr','findOne','then','autoAssociation','ChatQueues','FaxQueues','MailQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','map','resourceId','User','where','role','telephone','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','userProfileId'];(function(_0x5c3d9b,_0x1dd32e){var _0x3d3d5d=function(_0x3688ef){while(--_0x3688ef){_0x5c3d9b['push'](_0x5c3d9b['shift']());}};_0x3d3d5d(++_0x1dd32e);}(_0xd69e,0xa0));var _0xed69=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xd69e[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0xed69('0x0'));var util=require(_0xed69('0x1'));var BPromise=require(_0xed69('0x2'));var db=require('../mysqldb')['db'];var config=require(_0xed69('0x3'));var queryQueues={'attributes':['id',_0xed69('0x4')],'include':[{'as':'Agents','model':db['User'],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0xed69('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xed69('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xed69('0x4')],'where':{'role':_0xed69('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xed69('0x4'),'type'],'where':{'type':_0xed69('0x6')}};function getAssociatedResources(_0x54ca2a,_0x31dbb0,_0x42c0b0){return db['UserProfileSection'][_0xed69('0x7')]({'where':{'name':_0x54ca2a,'userProfileId':_0x31dbb0},'raw':!![]})[_0xed69('0x8')](function(_0x4ebc85){if(_0x4ebc85){if(_0x4ebc85[_0xed69('0x9')]){switch(_0x54ca2a){case'VoiceQueues':case _0xed69('0xa'):case _0xed69('0xb'):case'SmsQueues':case _0xed69('0xc'):case'OpenchannelQueues':case _0xed69('0xd'):return db[_0x42c0b0][_0xed69('0xe')](queryQueues);case _0xed69('0xf'):return db[_0x42c0b0]['findAll'](queryTelephones);case'Trunks':return db[_0x42c0b0][_0xed69('0xe')](queryTrunks);case _0xed69('0x10'):return db[_0x42c0b0][_0xed69('0xe')](queryCampaigns);}}else{return db[_0xed69('0x11')][_0xed69('0xe')]({'attributes':['resourceId'],'where':{'sectionId':_0x4ebc85['id']},'raw':!![]})[_0xed69('0x8')](function(_0x1e318a){if(_0x1e318a){var _0x19af14={'where':{'id':_[_0xed69('0x12')](_0x1e318a,_0xed69('0x13'))},'raw':!![]};switch(_0x42c0b0){case _0xed69('0x14'):_0x19af14[_0xed69('0x15')][_0xed69('0x16')]=_0xed69('0x17');break;case _0xed69('0x18'):_0x19af14['where']['type']='ivr';break;}return db[_0x42c0b0][_0xed69('0xe')](_0x19af14);}else{return[];}});}}else{return[];}})[_0xed69('0x8')](function(_0x387cec){return _0x387cec;});}function joinOrLeaveQueues(_0x576a71,_0x237759,_0x11c1fc,_0x589f07){_0x576a71[_0x237759](util[_0xed69('0x19')](_0xed69('0x1a'),_0x11c1fc,_0x589f07[_0xed69('0x4')]));if(_0x589f07[_0xed69('0x1b')]){for(var _0x4ef2fe=0x0;_0x4ef2fe<_0x589f07[_0xed69('0x1b')][_0xed69('0x1c')];_0x4ef2fe+=0x1){_0x576a71[_0x237759](util['format'](_0xed69('0x1d'),_0x589f07[_0xed69('0x1b')][_0x4ef2fe][_0xed69('0x4')]));}}}function joinOrLeave(_0x176fd1,_0xa3486a,_0x169398){var _0x513337;if(_0x176fd1[_0xed69('0x1e')][_0xed69('0x1f')]['id']){db[_0xed69('0x14')][_0xed69('0x20')]({'attributes':['id',_0xed69('0x4'),_0xed69('0x16'),_0xed69('0x21')],'where':{'id':_0x176fd1[_0xed69('0x1e')][_0xed69('0x1f')]['id']},'include':[{'model':db[_0xed69('0x22')],'as':_0xed69('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xed69('0x24')],'as':_0xed69('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xed69('0x26')],'as':_0xed69('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xed69('0x28')],'as':_0xed69('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xed69('0x2a')],'as':_0xed69('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xed69('0x8')](function(_0x1b24d7){if(_0x1b24d7){_0x513337=_0x1b24d7;_0x176fd1[_0xa3486a](util['format']('user:%s',_0x1b24d7[_0xed69('0x4')]));var _0x54474b=[];switch(_0x1b24d7[_0xed69('0x16')]){case _0xed69('0x2c'):_0x176fd1[_0xa3486a](_0xed69('0x2d'));_0x176fd1[_0xa3486a](_0xed69('0x2e'));if(queryQueues[_0xed69('0x2f')](_0xed69('0x30'))){delete queryQueues[_0xed69('0x30')];}_0x54474b['push'](db[_0xed69('0x31')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x33')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x34')]['findAll'](queryQueues));_0x54474b['push'](db[_0xed69('0x35')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x36')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db['OpenchannelQueue'][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x37')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x14')]['findAll'](queryTelephones));_0x54474b['push'](db['Trunk'][_0xed69('0xe')](queryTrunks));_0x54474b[_0xed69('0x32')](db[_0xed69('0x18')][_0xed69('0xe')](queryCampaigns));_0x54474b['push'](db[_0xed69('0x14')][_0xed69('0xe')](queryAgents));break;case'user':_0x176fd1[_0xa3486a](_0xed69('0x2d'));_0x176fd1[_0xa3486a](_0xed69('0x2e'));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0x38'),_0x1b24d7['userProfileId'],_0xed69('0x31')));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0xa'),_0x1b24d7[_0xed69('0x21')],_0xed69('0x33')));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0xb'),_0x1b24d7[_0xed69('0x21')],'FaxQueue'));_0x54474b[_0xed69('0x32')](getAssociatedResources('SmsQueues',_0x1b24d7[_0xed69('0x21')],_0xed69('0x35')));_0x54474b[_0xed69('0x32')](getAssociatedResources('MailQueues',_0x1b24d7[_0xed69('0x21')],'MailQueue'));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0x39'),_0x1b24d7[_0xed69('0x21')],_0xed69('0x3a')));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0xd'),_0x1b24d7[_0xed69('0x21')],'WhatsappQueue'));_0x54474b['push'](getAssociatedResources(_0xed69('0xf'),_0x1b24d7[_0xed69('0x21')],_0xed69('0x14')));_0x54474b[_0xed69('0x32')](getAssociatedResources('Trunks',_0x1b24d7[_0xed69('0x21')],_0xed69('0x3b')));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0x10'),_0x1b24d7[_0xed69('0x21')],_0xed69('0x18')));_0x54474b[_0xed69('0x32')](db[_0xed69('0x14')]['findAll'](queryAgents));break;case'agent':_0x176fd1[_0xa3486a](_0xed69('0x2d'));_0x176fd1[_0xa3486a](_0xed69('0x2e'));_0x54474b[_0xed69('0x32')](_0x1b24d7['getVoiceQueues']({'attributes':['id',_0xed69('0x4')]}));_0x54474b[_0xed69('0x32')](_0x1b24d7[_0xed69('0x3c')]({'attributes':['id',_0xed69('0x4')]}));_0x54474b[_0xed69('0x32')](_0x1b24d7[_0xed69('0x3d')]({'attributes':['id',_0xed69('0x4')]}));_0x54474b[_0xed69('0x32')](_0x1b24d7['getSmsQueues']({'attributes':['id',_0xed69('0x4')]}));_0x54474b['push'](_0x1b24d7[_0xed69('0x3e')]({'attributes':['id','name']}));_0x54474b[_0xed69('0x32')](_0x1b24d7[_0xed69('0x3f')]({'attributes':['id',_0xed69('0x4')]}));_0x54474b[_0xed69('0x32')](_0x1b24d7['getWhatsappQueues']({'attributes':['id',_0xed69('0x4')]}));break;}return BPromise['all'](_0x54474b);}})[_0xed69('0x8')](function(_0x22b575){if(_0x22b575&&_0x22b575[_0xed69('0x1c')]){for(var _0x187cef=0x0;_0x187cef<_0x22b575[_0xed69('0x1c')];_0x187cef+=0x1){for(var _0x2227d1=0x0;_0x2227d1<_0x22b575[_0x187cef][_0xed69('0x1c')];_0x2227d1+=0x1){switch(_0x187cef){case 0x0:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x40'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x1:joinOrLeaveQueues(_0x176fd1,_0xa3486a,'chat',_0x22b575[_0x187cef][_0x2227d1]);break;case 0x2:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x41'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x3:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x42'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x4:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x43'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x5:joinOrLeaveQueues(_0x176fd1,_0xa3486a,'openchannel',_0x22b575[_0x187cef][_0x2227d1]);break;case 0x6:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x44'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x7:if(_0x513337['role']!==_0xed69('0x5'))_0x176fd1[_0xa3486a](util[_0xed69('0x19')](_0xed69('0x45'),_0x22b575[_0x187cef][_0x2227d1][_0xed69('0x4')]));break;case 0x8:if(_0x513337[_0xed69('0x16')]!=='agent')_0x176fd1[_0xa3486a](util[_0xed69('0x19')](_0xed69('0x46'),_0x22b575[_0x187cef][_0x2227d1]['name']));break;case 0x9:if(_0x513337[_0xed69('0x16')]!==_0xed69('0x5'))_0x176fd1[_0xa3486a](util[_0xed69('0x19')]('campaign:%s:%s',_0x22b575[_0x187cef][_0x2227d1]['type'],_0x22b575[_0x187cef][_0x2227d1]['name']));break;case 0xa:_0x176fd1[_0xa3486a](util['format'](_0xed69('0x1d'),_0x22b575[_0x187cef][_0x2227d1][_0xed69('0x4')]));break;}}}}})[_0xed69('0x8')](function(){if(_0xa3486a===_0xed69('0x47')){var _0x4afc79=_[_0xed69('0x12')](_0x513337['ChatInteractions'],'id');return _0x513337['removeChatInteractions'](_0x4afc79)[_0xed69('0x8')](function(){for(var _0x1e2c03=0x0;_0x1e2c03<_0x4afc79[_0xed69('0x1c')];_0x1e2c03+=0x1){_0x169398[_0xed69('0x48')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x4afc79[_0x1e2c03]),'UserId':Number(_0x513337['id'])});}});}})['then'](function(){if(_0xa3486a===_0xed69('0x47')){var _0x4ed824=_[_0xed69('0x12')](_0x513337[_0xed69('0x49')],'id');return _0x513337[_0xed69('0x4a')](_0x4ed824)['then'](function(){for(var _0x1644b9=0x0;_0x1644b9<_0x4ed824[_0xed69('0x1c')];_0x1644b9+=0x1){_0x169398['emit'](_0xed69('0x4b'),{'MailInteractionId':Number(_0x4ed824[_0x1644b9]),'UserId':Number(_0x513337['id'])});}});}})[_0xed69('0x8')](function(){if(_0xa3486a===_0xed69('0x47')){var _0x44cd99=_['map'](_0x513337[_0xed69('0x25')],'id');return _0x513337['removeFaxInteractions'](_0x44cd99)['then'](function(){for(var _0xa6647b=0x0;_0xa6647b<_0x44cd99[_0xed69('0x1c')];_0xa6647b+=0x1){_0x169398[_0xed69('0x48')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x44cd99[_0xa6647b]),'UserId':Number(_0x513337['id'])});}});}})['then'](function(){if(_0xa3486a===_0xed69('0x47')){var _0x3093a3=_['map'](_0x513337['SmsInteractions'],'id');return _0x513337[_0xed69('0x4c')](_0x3093a3)[_0xed69('0x8')](function(){for(var _0x179566=0x0;_0x179566<_0x3093a3[_0xed69('0x1c')];_0x179566+=0x1){_0x169398[_0xed69('0x48')](_0xed69('0x4d'),{'SmsInteractionId':Number(_0x3093a3[_0x179566]),'UserId':Number(_0x513337['id'])});}});}})[_0xed69('0x8')](function(){if(_0xa3486a===_0xed69('0x47')){var _0x5bf1c6=_['map'](_0x513337[_0xed69('0x29')],'id');return _0x513337[_0xed69('0x4e')](_0x5bf1c6)[_0xed69('0x8')](function(){for(var _0x285867=0x0;_0x285867<_0x5bf1c6['length'];_0x285867+=0x1){_0x169398[_0xed69('0x48')](_0xed69('0x4f'),{'OpenchannelInteractionId':Number(_0x5bf1c6[_0x285867]),'UserId':Number(_0x513337['id'])});}});}})[_0xed69('0x8')](function(){if(_0xa3486a===_0xed69('0x47')){var _0x11dfa4=_[_0xed69('0x12')](_0x513337['WhatsappInteractions'],'id');return _0x513337[_0xed69('0x50')](_0x11dfa4)[_0xed69('0x8')](function(){for(var _0x4d229f=0x0;_0x4d229f<_0x11dfa4[_0xed69('0x1c')];_0x4d229f+=0x1){_0x169398[_0xed69('0x48')](_0xed69('0x51'),{'WhatsappInteractionId':Number(_0x11dfa4[_0x4d229f]),'UserId':Number(_0x513337['id'])});}});}})[_0xed69('0x52')](function(_0x2bffca){_0x176fd1[_0xed69('0x53')](_0x2bffca);});}}function onDisconnect(_0x2aae2b,_0x182471){joinOrLeave(_0x2aae2b,_0xed69('0x47'),_0x182471);}function onConnect(_0x2c3138){joinOrLeave(_0x2c3138,_0xed69('0x54'));}exports[_0xed69('0x55')]=function(_0x1d16ab){_0x1d16ab['on'](_0xed69('0x56'),function(_0xcb2bc3){_0xcb2bc3[_0xed69('0x57')](0x0);_0xcb2bc3[_0xed69('0x58')]=_0xcb2bc3[_0xed69('0x59')]['connection']['remoteAddress']+':'+_0xcb2bc3[_0xed69('0x59')][_0xed69('0x56')][_0xed69('0x5a')];_0xcb2bc3[_0xed69('0x5b')]=new Date();_0xcb2bc3['log']=function(_0x498229){console[_0xed69('0x53')](_0xed69('0x5c')+_0xcb2bc3[_0xed69('0x5d')][_0xed69('0x4')]+'['+_0xcb2bc3[_0xed69('0x58')]+']',_0x498229);};_0xcb2bc3['on'](_0xed69('0x5e'),function(){onDisconnect(_0xcb2bc3,_0x1d16ab);_0xcb2bc3['log'](_0xed69('0x5f'));});onConnect(_0xcb2bc3);_0xcb2bc3[_0xed69('0x53')](_0xed69('0x60'));});}; \ No newline at end of file +var _0xa30a=['user_has_whatsapp_interactions:remove','log','join','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','name','Agents','User','role','agent','telephone','ivr','UserProfileSection','findOne','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','Campaign','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','Trunk','user','VoiceQueues','MailQueue','OpenchannelQueues','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','all','voice','chat','sms','mail','whatsapp','trunk:%s','type','map','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var BPromise=require(_0xaa30('0x2'));var db=require('../mysqldb')['db'];var config=require(_0xaa30('0x3'));var queryQueues={'attributes':['id',_0xaa30('0x4')],'include':[{'as':_0xaa30('0x5'),'model':db[_0xaa30('0x6')],'attributes':['id',_0xaa30('0x4'),_0xaa30('0x7')],'raw':!![],'where':{'role':_0xaa30('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xaa30('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xaa30('0x4')],'where':{'role':_0xaa30('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xaa30('0x4'),'type'],'where':{'type':_0xaa30('0xa')}};function getAssociatedResources(_0x40dbda,_0x2febdd,_0x59d028){return db[_0xaa30('0xb')][_0xaa30('0xc')]({'where':{'name':_0x40dbda,'userProfileId':_0x2febdd},'raw':!![]})['then'](function(_0x5afbf5){if(_0x5afbf5){if(_0x5afbf5[_0xaa30('0xd')]){switch(_0x40dbda){case'VoiceQueues':case _0xaa30('0xe'):case _0xaa30('0xf'):case _0xaa30('0x10'):case _0xaa30('0x11'):case'OpenchannelQueues':case _0xaa30('0x12'):return db[_0x59d028][_0xaa30('0x13')](queryQueues);case _0xaa30('0x14'):return db[_0x59d028]['findAll'](queryTelephones);case _0xaa30('0x15'):return db[_0x59d028][_0xaa30('0x13')](queryTrunks);case _0xaa30('0x16'):return db[_0x59d028][_0xaa30('0x13')](queryCampaigns);}}else{return db[_0xaa30('0x17')][_0xaa30('0x13')]({'attributes':[_0xaa30('0x18')],'where':{'sectionId':_0x5afbf5['id']},'raw':!![]})[_0xaa30('0x19')](function(_0x2e37af){if(_0x2e37af){var _0xfae724={'where':{'id':_['map'](_0x2e37af,_0xaa30('0x18'))},'raw':!![]};switch(_0x59d028){case'User':_0xfae724['where'][_0xaa30('0x7')]=_0xaa30('0x9');break;case _0xaa30('0x1a'):_0xfae724['where']['type']='ivr';break;}return db[_0x59d028][_0xaa30('0x13')](_0xfae724);}else{return[];}});}}else{return[];}})['then'](function(_0xfb02ab){return _0xfb02ab;});}function joinOrLeaveQueues(_0x332a0a,_0x48561d,_0x4e29f9,_0x520abb){_0x332a0a[_0x48561d](util[_0xaa30('0x1b')](_0xaa30('0x1c'),_0x4e29f9,_0x520abb[_0xaa30('0x4')]));if(_0x520abb[_0xaa30('0x5')]){for(var _0x43a526=0x0;_0x43a526<_0x520abb['Agents'][_0xaa30('0x1d')];_0x43a526+=0x1){_0x332a0a[_0x48561d](util[_0xaa30('0x1b')](_0xaa30('0x1e'),_0x520abb[_0xaa30('0x5')][_0x43a526][_0xaa30('0x4')]));}}}function joinOrLeave(_0x5885fe,_0x325b42,_0x13128a){var _0x2fecdd;if(_0x5885fe[_0xaa30('0x1f')]['query']['id']){db[_0xaa30('0x6')][_0xaa30('0x20')]({'attributes':['id',_0xaa30('0x4'),_0xaa30('0x7'),_0xaa30('0x21')],'where':{'id':_0x5885fe[_0xaa30('0x1f')]['query']['id']},'include':[{'model':db[_0xaa30('0x22')],'as':_0xaa30('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xaa30('0x24'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xaa30('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xaa30('0x26')],'as':_0xaa30('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xaa30('0x28')],'as':_0xaa30('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xaa30('0x2a')],'as':_0xaa30('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xaa30('0x19')](function(_0x1f288c){if(_0x1f288c){_0x2fecdd=_0x1f288c;_0x5885fe[_0x325b42](util[_0xaa30('0x1b')](_0xaa30('0x1e'),_0x1f288c[_0xaa30('0x4')]));var _0x2038a6=[];switch(_0x1f288c[_0xaa30('0x7')]){case _0xaa30('0x2c'):_0x5885fe[_0x325b42](_0xaa30('0x2d'));_0x5885fe[_0x325b42](_0xaa30('0x2e'));if(queryQueues[_0xaa30('0x2f')]('include')){delete queryQueues[_0xaa30('0x30')];}_0x2038a6[_0xaa30('0x31')](db[_0xaa30('0x32')][_0xaa30('0x13')](queryQueues));_0x2038a6[_0xaa30('0x31')](db[_0xaa30('0x33')]['findAll'](queryQueues));_0x2038a6['push'](db['FaxQueue'][_0xaa30('0x13')](queryQueues));_0x2038a6[_0xaa30('0x31')](db[_0xaa30('0x34')][_0xaa30('0x13')](queryQueues));_0x2038a6[_0xaa30('0x31')](db['MailQueue']['findAll'](queryQueues));_0x2038a6[_0xaa30('0x31')](db[_0xaa30('0x35')]['findAll'](queryQueues));_0x2038a6[_0xaa30('0x31')](db['WhatsappQueue'][_0xaa30('0x13')](queryQueues));_0x2038a6['push'](db[_0xaa30('0x6')][_0xaa30('0x13')](queryTelephones));_0x2038a6['push'](db[_0xaa30('0x36')][_0xaa30('0x13')](queryTrunks));_0x2038a6[_0xaa30('0x31')](db[_0xaa30('0x1a')][_0xaa30('0x13')](queryCampaigns));_0x2038a6[_0xaa30('0x31')](db['User'][_0xaa30('0x13')](queryAgents));break;case _0xaa30('0x37'):_0x5885fe[_0x325b42]('voice:inbound');_0x5885fe[_0x325b42](_0xaa30('0x2e'));_0x2038a6[_0xaa30('0x31')](getAssociatedResources(_0xaa30('0x38'),_0x1f288c['userProfileId'],'VoiceQueue'));_0x2038a6[_0xaa30('0x31')](getAssociatedResources(_0xaa30('0xe'),_0x1f288c[_0xaa30('0x21')],_0xaa30('0x33')));_0x2038a6[_0xaa30('0x31')](getAssociatedResources(_0xaa30('0xf'),_0x1f288c['userProfileId'],'FaxQueue'));_0x2038a6[_0xaa30('0x31')](getAssociatedResources(_0xaa30('0x10'),_0x1f288c[_0xaa30('0x21')],'SmsQueue'));_0x2038a6[_0xaa30('0x31')](getAssociatedResources(_0xaa30('0x11'),_0x1f288c[_0xaa30('0x21')],_0xaa30('0x39')));_0x2038a6['push'](getAssociatedResources(_0xaa30('0x3a'),_0x1f288c[_0xaa30('0x21')],_0xaa30('0x35')));_0x2038a6[_0xaa30('0x31')](getAssociatedResources(_0xaa30('0x12'),_0x1f288c['userProfileId'],_0xaa30('0x3b')));_0x2038a6[_0xaa30('0x31')](getAssociatedResources(_0xaa30('0x14'),_0x1f288c[_0xaa30('0x21')],_0xaa30('0x6')));_0x2038a6[_0xaa30('0x31')](getAssociatedResources(_0xaa30('0x15'),_0x1f288c[_0xaa30('0x21')],'Trunk'));_0x2038a6['push'](getAssociatedResources(_0xaa30('0x16'),_0x1f288c['userProfileId'],'Campaign'));_0x2038a6['push'](db[_0xaa30('0x6')]['findAll'](queryAgents));break;case _0xaa30('0x8'):_0x5885fe[_0x325b42]('voice:inbound');_0x5885fe[_0x325b42](_0xaa30('0x2e'));_0x2038a6[_0xaa30('0x31')](_0x1f288c[_0xaa30('0x3c')]({'attributes':['id',_0xaa30('0x4')]}));_0x2038a6[_0xaa30('0x31')](_0x1f288c[_0xaa30('0x3d')]({'attributes':['id',_0xaa30('0x4')]}));_0x2038a6[_0xaa30('0x31')](_0x1f288c[_0xaa30('0x3e')]({'attributes':['id',_0xaa30('0x4')]}));_0x2038a6[_0xaa30('0x31')](_0x1f288c['getSmsQueues']({'attributes':['id',_0xaa30('0x4')]}));_0x2038a6[_0xaa30('0x31')](_0x1f288c[_0xaa30('0x3f')]({'attributes':['id',_0xaa30('0x4')]}));_0x2038a6[_0xaa30('0x31')](_0x1f288c['getOpenchannelQueues']({'attributes':['id','name']}));_0x2038a6[_0xaa30('0x31')](_0x1f288c['getWhatsappQueues']({'attributes':['id',_0xaa30('0x4')]}));break;}return BPromise[_0xaa30('0x40')](_0x2038a6);}})[_0xaa30('0x19')](function(_0xb29ccc){if(_0xb29ccc&&_0xb29ccc[_0xaa30('0x1d')]){for(var _0x3ec15b=0x0;_0x3ec15b<_0xb29ccc[_0xaa30('0x1d')];_0x3ec15b+=0x1){for(var _0x535ce2=0x0;_0x535ce2<_0xb29ccc[_0x3ec15b][_0xaa30('0x1d')];_0x535ce2+=0x1){switch(_0x3ec15b){case 0x0:joinOrLeaveQueues(_0x5885fe,_0x325b42,_0xaa30('0x41'),_0xb29ccc[_0x3ec15b][_0x535ce2]);break;case 0x1:joinOrLeaveQueues(_0x5885fe,_0x325b42,_0xaa30('0x42'),_0xb29ccc[_0x3ec15b][_0x535ce2]);break;case 0x2:joinOrLeaveQueues(_0x5885fe,_0x325b42,'fax',_0xb29ccc[_0x3ec15b][_0x535ce2]);break;case 0x3:joinOrLeaveQueues(_0x5885fe,_0x325b42,_0xaa30('0x43'),_0xb29ccc[_0x3ec15b][_0x535ce2]);break;case 0x4:joinOrLeaveQueues(_0x5885fe,_0x325b42,_0xaa30('0x44'),_0xb29ccc[_0x3ec15b][_0x535ce2]);break;case 0x5:joinOrLeaveQueues(_0x5885fe,_0x325b42,'openchannel',_0xb29ccc[_0x3ec15b][_0x535ce2]);break;case 0x6:joinOrLeaveQueues(_0x5885fe,_0x325b42,_0xaa30('0x45'),_0xb29ccc[_0x3ec15b][_0x535ce2]);break;case 0x7:if(_0x2fecdd['role']!==_0xaa30('0x8'))_0x5885fe[_0x325b42](util['format']('telephone:%s',_0xb29ccc[_0x3ec15b][_0x535ce2][_0xaa30('0x4')]));break;case 0x8:if(_0x2fecdd['role']!=='agent')_0x5885fe[_0x325b42](util[_0xaa30('0x1b')](_0xaa30('0x46'),_0xb29ccc[_0x3ec15b][_0x535ce2][_0xaa30('0x4')]));break;case 0x9:if(_0x2fecdd[_0xaa30('0x7')]!==_0xaa30('0x8'))_0x5885fe[_0x325b42](util[_0xaa30('0x1b')]('campaign:%s:%s',_0xb29ccc[_0x3ec15b][_0x535ce2][_0xaa30('0x47')],_0xb29ccc[_0x3ec15b][_0x535ce2][_0xaa30('0x4')]));break;case 0xa:_0x5885fe[_0x325b42](util[_0xaa30('0x1b')]('user:%s',_0xb29ccc[_0x3ec15b][_0x535ce2]['name']));break;}}}}})['then'](function(){if(_0x325b42==='leave'){var _0x998162=_[_0xaa30('0x48')](_0x2fecdd[_0xaa30('0x23')],'id');return _0x2fecdd[_0xaa30('0x49')](_0x998162)[_0xaa30('0x19')](function(){for(var _0x1ed257=0x0;_0x1ed257<_0x998162['length'];_0x1ed257+=0x1){_0x13128a[_0xaa30('0x4a')](_0xaa30('0x4b'),{'ChatInteractionId':Number(_0x998162[_0x1ed257]),'UserId':Number(_0x2fecdd['id'])});}});}})[_0xaa30('0x19')](function(){if(_0x325b42===_0xaa30('0x4c')){var _0x5328c3=_[_0xaa30('0x48')](_0x2fecdd[_0xaa30('0x24')],'id');return _0x2fecdd[_0xaa30('0x4d')](_0x5328c3)[_0xaa30('0x19')](function(){for(var _0x245d35=0x0;_0x245d35<_0x5328c3['length'];_0x245d35+=0x1){_0x13128a['emit'](_0xaa30('0x4e'),{'MailInteractionId':Number(_0x5328c3[_0x245d35]),'UserId':Number(_0x2fecdd['id'])});}});}})[_0xaa30('0x19')](function(){if(_0x325b42===_0xaa30('0x4c')){var _0x5e7032=_[_0xaa30('0x48')](_0x2fecdd['FaxInteractions'],'id');return _0x2fecdd[_0xaa30('0x4f')](_0x5e7032)[_0xaa30('0x19')](function(){for(var _0x483a01=0x0;_0x483a01<_0x5e7032[_0xaa30('0x1d')];_0x483a01+=0x1){_0x13128a[_0xaa30('0x4a')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x5e7032[_0x483a01]),'UserId':Number(_0x2fecdd['id'])});}});}})[_0xaa30('0x19')](function(){if(_0x325b42==='leave'){var _0x5b227d=_[_0xaa30('0x48')](_0x2fecdd[_0xaa30('0x27')],'id');return _0x2fecdd[_0xaa30('0x50')](_0x5b227d)['then'](function(){for(var _0x411216=0x0;_0x411216<_0x5b227d[_0xaa30('0x1d')];_0x411216+=0x1){_0x13128a[_0xaa30('0x4a')](_0xaa30('0x51'),{'SmsInteractionId':Number(_0x5b227d[_0x411216]),'UserId':Number(_0x2fecdd['id'])});}});}})[_0xaa30('0x19')](function(){if(_0x325b42===_0xaa30('0x4c')){var _0x429ac8=_[_0xaa30('0x48')](_0x2fecdd[_0xaa30('0x29')],'id');return _0x2fecdd[_0xaa30('0x52')](_0x429ac8)[_0xaa30('0x19')](function(){for(var _0x2f84fa=0x0;_0x2f84fa<_0x429ac8[_0xaa30('0x1d')];_0x2f84fa+=0x1){_0x13128a['emit'](_0xaa30('0x53'),{'OpenchannelInteractionId':Number(_0x429ac8[_0x2f84fa]),'UserId':Number(_0x2fecdd['id'])});}});}})[_0xaa30('0x19')](function(){if(_0x325b42===_0xaa30('0x4c')){var _0x5b6e3d=_[_0xaa30('0x48')](_0x2fecdd[_0xaa30('0x2b')],'id');return _0x2fecdd[_0xaa30('0x54')](_0x5b6e3d)[_0xaa30('0x19')](function(){for(var _0x9ee658=0x0;_0x9ee658<_0x5b6e3d[_0xaa30('0x1d')];_0x9ee658+=0x1){_0x13128a['emit'](_0xaa30('0x55'),{'WhatsappInteractionId':Number(_0x5b6e3d[_0x9ee658]),'UserId':Number(_0x2fecdd['id'])});}});}})['catch'](function(_0x36242e){_0x5885fe[_0xaa30('0x56')](_0x36242e);});}}function onDisconnect(_0x315303,_0x17155a){joinOrLeave(_0x315303,'leave',_0x17155a);}function onConnect(_0x2cbea3){joinOrLeave(_0x2cbea3,_0xaa30('0x57'));}exports['default']=function(_0x26f6f9){_0x26f6f9['on'](_0xaa30('0x58'),function(_0x1aa115){_0x1aa115[_0xaa30('0x59')](0x0);_0x1aa115[_0xaa30('0x5a')]=_0x1aa115[_0xaa30('0x5b')]['connection'][_0xaa30('0x5c')]+':'+_0x1aa115[_0xaa30('0x5b')][_0xaa30('0x58')][_0xaa30('0x5d')];_0x1aa115[_0xaa30('0x5e')]=new Date();_0x1aa115[_0xaa30('0x56')]=function(_0x8bda4f){console[_0xaa30('0x56')](_0xaa30('0x5f')+_0x1aa115[_0xaa30('0x60')][_0xaa30('0x4')]+'['+_0x1aa115[_0xaa30('0x5a')]+']',_0x8bda4f);};_0x1aa115['on'](_0xaa30('0x61'),function(){onDisconnect(_0x1aa115,_0x26f6f9);_0x1aa115['log'](_0xaa30('0x62'));});onConnect(_0x1aa115);_0x1aa115['log'](_0xaa30('0x63'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 16faa61..8d14ae6 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 _0x0854=['AfterCreate','changed','closed','substatus','AfterUpdate','User','find','fullname','email','internal','default','hasOwnProperty','model','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','triggers','client','http','Chat','ChatInteraction','afterCreate','afterUpdate','closedinteraction','newmessage','ChatOfflineMessage','Sms','SmsInteraction','newinteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','then','info','Trigger,\x20%s','EventManager','error','code','catch','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','name','outgoingmessage','AfterCreateMessage','get','agent'];(function(_0xff7c9a,_0x4a347f){var _0x47ee61=function(_0x5ec0e7){while(--_0x5ec0e7){_0xff7c9a['push'](_0xff7c9a['shift']());}};_0x47ee61(++_0x4a347f);}(_0x0854,0x134));var _0x4085=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0854[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x4085('0x0'));var db=require(_0x4085('0x1'))['db'];var jayson=require(_0x4085('0x2'));var logger=require('../logger')(_0x4085('0x3'));var client=jayson[_0x4085('0x4')][_0x4085('0x5')]({'port':0x232a});var triggers=[{'channel':_0x4085('0x6'),'model':_0x4085('0x7'),'event':_0x4085('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4085('0x6'),'model':_0x4085('0x7'),'event':_0x4085('0x9'),'condition':_0x4085('0xa'),'callback':afterUpdate},{'channel':_0x4085('0x6'),'model':'ChatMessage','event':'afterCreate','condition':_0x4085('0xb'),'callback':afterCreateMessage},{'channel':'Chat','model':_0x4085('0xc'),'event':'afterCreate','condition':_0x4085('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0x4085('0xd'),'model':_0x4085('0xe'),'event':'afterCreate','condition':_0x4085('0xf'),'callback':afterCreate},{'channel':_0x4085('0xd'),'model':_0x4085('0xe'),'event':'afterUpdate','condition':_0x4085('0xa'),'callback':afterUpdate},{'channel':_0x4085('0xd'),'model':'SmsMessage','event':_0x4085('0x8'),'condition':_0x4085('0xb'),'callback':afterCreateMessage},{'channel':_0x4085('0x10'),'model':_0x4085('0x11'),'event':_0x4085('0x8'),'condition':_0x4085('0xf'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x4085('0x11'),'event':'afterUpdate','condition':_0x4085('0xa'),'callback':afterUpdate},{'channel':_0x4085('0x10'),'model':_0x4085('0x12'),'event':_0x4085('0x8'),'condition':_0x4085('0xb'),'callback':afterCreateMessage},{'channel':_0x4085('0x13'),'model':'FaxInteraction','event':_0x4085('0x8'),'condition':_0x4085('0xf'),'callback':afterCreate},{'channel':'Fax','model':_0x4085('0x14'),'event':_0x4085('0x9'),'condition':_0x4085('0xa'),'callback':afterUpdate},{'channel':'Fax','model':_0x4085('0x15'),'event':_0x4085('0x8'),'condition':_0x4085('0xb'),'callback':afterCreateMessage},{'channel':_0x4085('0x16'),'model':_0x4085('0x17'),'event':_0x4085('0x8'),'condition':_0x4085('0xf'),'callback':afterCreate},{'channel':'Mail','model':_0x4085('0x17'),'event':_0x4085('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4085('0x16'),'model':_0x4085('0x18'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4085('0x19'),'model':_0x4085('0x1a'),'event':_0x4085('0x8'),'condition':_0x4085('0xf'),'callback':afterCreate},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0x4085('0x9'),'condition':_0x4085('0xa'),'callback':afterUpdate},{'channel':'Openchannel','model':'OpenchannelMessage','event':_0x4085('0x8'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x5772e3){return client['request']('EventManager',_0x5772e3)[_0x4085('0x1b')](function(_0x195746){logger[_0x4085('0x1c')](_0x4085('0x1d'),_0x4085('0x1e'),_0x195746);if(_0x195746[_0x4085('0x1f')]){if(_0x195746[_0x4085('0x1f')][_0x4085('0x20')]===0x1f4){logger[_0x4085('0x1f')](_0x4085('0x1d'),_0x4085('0x1e'),_0x195746[_0x4085('0x1f')]);}}})[_0x4085('0x21')](function(_0x3caf9a){logger[_0x4085('0x1f')](_0x4085('0x1d'),'EventManager',_0x3caf9a);});}function afterCreateMessage(_0x825231){return function(_0x1595c8){_0x1595c8=_0x1595c8['get']({'plain':!![]});_0x1595c8[_0x4085('0x22')]=_0x825231;_0x1595c8[_0x4085('0x23')]=_0x825231;_0x1595c8[_0x4085('0x24')]=_0x1595c8[_0x4085('0x25')];Promise[_0x4085('0x26')]()[_0x4085('0x1b')](function(){if(typeof _0x1595c8[_0x4085('0x27')]===_0x4085('0x28'))return null;var _0x5c3dad=_0x4085('0x29')+_0x1595c8[_0x4085('0x27')];return db[_0x4085('0x2a')][_0x4085('0x2b')](_0x5c3dad,{'type':db[_0x4085('0x2c')][_0x4085('0x2d')][_0x4085('0x2e')],'raw':!![]});})[_0x4085('0x1b')](function(_0x333d32){if(_0x333d32){_0x1595c8[_0x4085('0x2f')]=_0x333d32[0x0];}if(typeof _0x1595c8[_0x4085('0x30')]===_0x4085('0x28'))return;return getAgent(_0x1595c8[_0x4085('0x30')]);})[_0x4085('0x1b')](function(_0x13cca2){if(_0x13cca2){_0x1595c8[_0x4085('0x31')]=util[_0x4085('0x32')](_0x4085('0x33'),_0x13cca2[_0x4085('0x34')]);_0x1595c8['agent']=_0x13cca2;_0x1595c8[_0x4085('0x22')]=_0x825231;return request({'event':'incomingmessage','message':_0x1595c8});}else{return request({'event':_0x4085('0x35'),'message':_0x1595c8});}})[_0x4085('0x21')](function(_0x323321){logger[_0x4085('0x1f')]('Trigger,\x20%s',_0x4085('0x36'),_0x323321);});};}function afterCreateOfflineMessage(_0x347f05){return function(_0x3c3a71){_0x3c3a71=_0x3c3a71[_0x4085('0x37')]({'plain':!![]});_0x3c3a71[_0x4085('0x22')]=_0x347f05;_0x3c3a71[_0x4085('0x23')]=_0x347f05;_0x3c3a71[_0x4085('0x24')]='offlineMessage';return request({'event':_0x3c3a71['event'],'message':_0x3c3a71});};}function afterCreate(_0x3fb111,_0x14cf77){return function(_0x594b43){_0x594b43=_0x594b43[_0x4085('0x37')]({'plain':!![]});_0x594b43['channel']=_0x3fb111;_0x594b43['motionChannel']=_0x3fb111;_0x594b43[_0x4085('0x24')]='opened';Promise['resolve']()[_0x4085('0x1b')](function(){var _0x57c5b4=_0x4085('0x29')+_0x594b43[_0x4085('0x27')];return db[_0x4085('0x2a')][_0x4085('0x2b')](_0x57c5b4,{'type':db[_0x4085('0x2c')][_0x4085('0x2d')][_0x4085('0x2e')],'raw':!![]});})[_0x4085('0x1b')](function(_0x70ab35){if(_0x70ab35){_0x594b43['contact']=_0x70ab35[0x0];}if(typeof _0x594b43[_0x4085('0x30')]==='undefined')return;return getAgent(_0x594b43['UserId']);})[_0x4085('0x1b')](function(_0x49b62f){if(_0x49b62f){_0x594b43[_0x4085('0x31')]=util['format'](_0x4085('0x33'),_0x49b62f[_0x4085('0x34')]);_0x594b43[_0x4085('0x38')]=_0x49b62f;}return request({'event':_0x14cf77,'message':_0x594b43});})[_0x4085('0x21')](function(_0x29d6d8){logger['error'](_0x4085('0x1d'),_0x4085('0x39'),_0x29d6d8);});};}function afterUpdate(_0x15d060){return function(_0x5ba0e8){var _0x272394=_0x5ba0e8[_0x4085('0x3a')](_0x4085('0x3b'))&&_0x5ba0e8['closed'];var _0x3cc1fc=_0x5ba0e8[_0x4085('0x3a')](_0x4085('0x3c'));if(_0x272394||_0x3cc1fc){var _0x536b4b=_0x272394?'closedinteraction':_0x4085('0x3c');var _0x165bed=_0x5ba0e8[_0x4085('0x37')]({'plain':!![]});_0x165bed[_0x4085('0x22')]=_0x15d060;_0x165bed['motionChannel']=_0x15d060;_0x165bed[_0x4085('0x24')]=_0x272394?'closed':_0x4085('0x3c');var _0x5432bc=_0x4085('0x29')+_0x165bed[_0x4085('0x27')];return db['sequelize'][_0x4085('0x2b')](_0x5432bc,{'type':db[_0x4085('0x2c')][_0x4085('0x2d')][_0x4085('0x2e')],'raw':!![]})[_0x4085('0x1b')](function(_0x57a57f){if(_0x57a57f){_0x165bed[_0x4085('0x2f')]=_0x57a57f[0x0];}if(typeof _0x165bed[_0x4085('0x30')]===_0x4085('0x28'))return;return getAgent(_0x165bed['UserId']);})[_0x4085('0x1b')](function(_0x4cecb4){if(_0x4cecb4){_0x165bed[_0x4085('0x31')]=util[_0x4085('0x32')](_0x4085('0x33'),_0x4cecb4[_0x4085('0x34')]);_0x165bed[_0x4085('0x38')]=_0x4cecb4;}return request({'event':_0x536b4b,'message':_0x165bed});})[_0x4085('0x21')](function(_0x33b42d){logger[_0x4085('0x1f')](_0x4085('0x1d'),_0x4085('0x3d'),_0x33b42d);});}};}function getAgent(_0x540eb6){return db[_0x4085('0x3e')][_0x4085('0x3f')]({'where':{'id':_0x540eb6},'attributes':['id',_0x4085('0x34'),_0x4085('0x40'),_0x4085('0x41'),_0x4085('0x42')],'raw':!![]})['then'](function(_0x1915c7){return _0x1915c7;});}exports[_0x4085('0x43')]=function(){for(var _0x1792f7=0x0;_0x1792f7=_0xf80a4e[_0x849f('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x1ccadd(_0x195e82);})[_0x849f('0x15')](function(_0x24fa7b){_0x2d3b8b(_0x24fa7b);});});}; \ No newline at end of file +var _0xfee0=['Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','mail','chat','fax','sms','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','count','then','agents'];(function(_0x53a8d3,_0x1a0799){var _0x15e434=function(_0x21f7ac){while(--_0x21f7ac){_0x53a8d3['push'](_0x53a8d3['shift']());}};_0x15e434(++_0x1a0799);}(_0xfee0,0x98));var _0x0fee=function(_0x8e9597,_0x2aa555){_0x8e9597=_0x8e9597-0x0;var _0x3be06a=_0xfee0[_0x8e9597];return _0x3be06a;};'use strict';var _=require(_0x0fee('0x0'));var BPromise=require(_0x0fee('0x1'));var db=require(_0x0fee('0x2'))['db'];var util=require(_0x0fee('0x3'));var channels=['voice',_0x0fee('0x4'),_0x0fee('0x5'),_0x0fee('0x6'),_0x0fee('0x7'),'whatsapp',_0x0fee('0x8')];exports[_0x0fee('0x9')]=function(){return channels;};exports[_0x0fee('0xa')]=function(_0x403c75){_0x403c75=_0x403c75[_0x0fee('0xb')]();return _[_0x0fee('0xc')](channels,_0x403c75);};exports[_0x0fee('0xd')]=function(_0x38c3f6,_0x237ca5,_0x6831a0,_0x185f3d){var _0x4968fd={'loginAttempts':_0x237ca5,'blocked':_0x6831a0};if(!_[_0x0fee('0xe')](_0x185f3d)){_0x4968fd[_0x0fee('0xf')]=_0x185f3d;}return _0x38c3f6[_0x0fee('0x10')](_0x4968fd);};exports[_0x0fee('0x11')]=function(_0x5b6860){return new BPromise(function(_0x5f1bfb,_0x1b42e9){var _0x51065b=0x0;if(_0x5b6860[_0x0fee('0x12')]!==_0x0fee('0x13')){_0x5f1bfb(_0x5b6860);}db['User'][_0x0fee('0x14')]({'where':{'role':_0x0fee('0x13'),'online':!![],'id':{'$ne':_0x5b6860['id']}}})['then'](function(_0x282a2b){_0x51065b=_0x282a2b;return util[_0x0fee('0x11')]();})[_0x0fee('0x15')](function(_0x1bdd19){if(_0x1bdd19&&_0x1bdd19[_0x0fee('0x16')]&&_0x51065b>=_0x1bdd19['agents']){throw Error(_0x0fee('0x17'));}_0x5f1bfb(_0x5b6860);})[_0x0fee('0x18')](function(_0x476738){_0x1b42e9(_0x476738);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index fb5d50a..e51e7c8 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x153a=['api','message','name','Error','inherits','Bad\x20Request','Forbidden','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','details','OutOfInterval','Resource\x20Conflict','Conflict','error','stack','statusMessage','status','send','../config/logger'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x153a,0xaf));var _0xa153=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x153a[_0x5cb1af];return _0x8d7940;};'use strict';var util=require('util');var logger=require(_0xa153('0x0'))(_0xa153('0x1'));var APIError=function(_0x530df0,_0x12ca30){this[_0xa153('0x2')]=_0x530df0||'Internal\x20Server\x20Error';this[_0xa153('0x3')]=_0x12ca30||_0xa153('0x4');util[_0xa153('0x5')](APIError,Error);};var APIBadRequestError=function(_0xb40f4e){this[_0xa153('0x2')]=_0xb40f4e||_0xa153('0x6');this[_0xa153('0x3')]=_0xa153('0x6');util['inherits'](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x41cb5f){this[_0xa153('0x2')]=_0x41cb5f||_0xa153('0x7');this[_0xa153('0x3')]=_0xa153('0x7');util['inherits'](APIForbiddenError,APIError);};var APINotFoundError=function(_0x38babf){this[_0xa153('0x2')]=_0x38babf||_0xa153('0x8');this['name']=_0xa153('0x9');util[_0xa153('0x5')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x537948){this[_0xa153('0x2')]=_0x537948||_0xa153('0xa');this[_0xa153('0x3')]=_0xa153('0xb');this[_0xa153('0xc')]=0x193;this[_0xa153('0xd')]={'type':_0xa153('0xe')};util[_0xa153('0x5')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x20f1f9){this['message']=_0x20f1f9||_0xa153('0xf');this[_0xa153('0x3')]='Conflict';util['inherits'](APIBadRequestError,APIError);};function getStatusCode(_0x56a416){switch(_0x56a416){case _0xa153('0x6'):return 0x190;case _0xa153('0x7'),_0xa153('0xb'):return 0x193;case'Not\x20Found':return 0x194;case _0xa153('0x10'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x581318){if(_0x581318===_0xa153('0xb'))return _0x581318;return null;}function handleError(_0x358bc7){return function(_0x3a759e){logger[_0xa153('0x11')](_0x3a759e[_0xa153('0x12')]);var _0x70b2=getStatusCode(_0x3a759e[_0xa153('0x3')]);var _0x30460c=getCustomStatusMessage(_0x3a759e['name']);if(_0x3a759e[_0xa153('0x3')]){delete _0x3a759e['name'];}if(_0x30460c){_0x358bc7[_0xa153('0x13')]=_0x30460c;}return _0x358bc7[_0xa153('0x14')](_0x70b2)[_0xa153('0x15')](_0x3a759e);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0xf3e4=['Not\x20Found','Out\x20Of\x20Interval','Resource\x20Conflict','Conflict','error','stack','status','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','inherits','name','Bad\x20Request','Forbidden','Entity\x20not\x20found'];(function(_0x2b58f8,_0x14f865){var _0x2af05b=function(_0x2c2bf3){while(--_0x2c2bf3){_0x2b58f8['push'](_0x2b58f8['shift']());}};_0x2af05b(++_0x14f865);}(_0xf3e4,0x74));var _0x4f3e=function(_0x85f220,_0x1b3f1f){_0x85f220=_0x85f220-0x0;var _0x62a369=_0xf3e4[_0x85f220];return _0x62a369;};'use strict';var util=require(_0x4f3e('0x0'));var logger=require(_0x4f3e('0x1'))(_0x4f3e('0x2'));var APIError=function(_0x4cd389,_0x2d097d){this[_0x4f3e('0x3')]=_0x4cd389||_0x4f3e('0x4');this['name']=_0x2d097d||'Error';util[_0x4f3e('0x5')](APIError,Error);};var APIBadRequestError=function(_0x3c6b12){this['message']=_0x3c6b12||'Bad\x20Request';this[_0x4f3e('0x6')]=_0x4f3e('0x7');util[_0x4f3e('0x5')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x1ad18a){this['message']=_0x1ad18a||_0x4f3e('0x8');this[_0x4f3e('0x6')]=_0x4f3e('0x8');util[_0x4f3e('0x5')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x264a65){this[_0x4f3e('0x3')]=_0x264a65||_0x4f3e('0x9');this[_0x4f3e('0x6')]=_0x4f3e('0xa');util[_0x4f3e('0x5')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x143ee2){this[_0x4f3e('0x3')]=_0x143ee2||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this['name']=_0x4f3e('0xb');this['code']=0x193;this['details']={'type':'OutOfInterval'};util[_0x4f3e('0x5')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x3be87f){this[_0x4f3e('0x3')]=_0x3be87f||_0x4f3e('0xc');this[_0x4f3e('0x6')]=_0x4f3e('0xd');util['inherits'](APIBadRequestError,APIError);};function getStatusCode(_0xd2270a){switch(_0xd2270a){case'Bad\x20Request':return 0x190;case'Forbidden','Out\x20Of\x20Interval':return 0x193;case _0x4f3e('0xa'):return 0x194;case _0x4f3e('0xd'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x21342f){if(_0x21342f==='Out\x20Of\x20Interval')return _0x21342f;return null;}function handleError(_0x460817){return function(_0x39e28f){logger[_0x4f3e('0xe')](_0x39e28f[_0x4f3e('0xf')]);var _0x482f4a=getStatusCode(_0x39e28f['name']);var _0x257ea4=getCustomStatusMessage(_0x39e28f[_0x4f3e('0x6')]);if(_0x39e28f['name']){delete _0x39e28f['name'];}if(_0x257ea4){_0x460817['statusMessage']=_0x257ea4;}return _0x460817[_0x4f3e('0x10')](_0x482f4a)['send'](_0x39e28f);};}module[_0x4f3e('0x11')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 03a1115..2a84352 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a0b=['status','render','json','send','404'];(function(_0x3f6c23,_0x436877){var _0x1fe8b1=function(_0x3ac58f){while(--_0x3ac58f){_0x3f6c23['push'](_0x3f6c23['shift']());}};_0x1fe8b1(++_0x436877);}(_0x9a0b,0x1f3));var _0xb9a0=function(_0x5cc716,_0x385daf){_0x5cc716=_0x5cc716-0x0;var _0x54c1c8=_0x9a0b[_0x5cc716];return _0x54c1c8;};'use strict';module['exports'][0x194]=function pageNotFound(_0x3668a7,_0x3d99f0){var _0x23d8c7=_0xb9a0('0x0');var _0xaf57a4=0x194;var _0x557c4c={'status':_0xaf57a4};_0x3d99f0[_0xb9a0('0x1')](_0x557c4c[_0xb9a0('0x1')]);_0x3d99f0[_0xb9a0('0x2')](_0x23d8c7,{},function(_0x594155,_0x5d288f){if(_0x594155){return _0x3d99f0[_0xb9a0('0x1')](_0x557c4c[_0xb9a0('0x1')])[_0xb9a0('0x3')](_0x557c4c);}_0x3d99f0[_0xb9a0('0x4')](_0x5d288f);});}; \ No newline at end of file +var _0xc73d=['404','status','json','send','exports'];(function(_0x5ba3d3,_0xba46c7){var _0x4fe918=function(_0x47063c){while(--_0x47063c){_0x5ba3d3['push'](_0x5ba3d3['shift']());}};_0x4fe918(++_0xba46c7);}(_0xc73d,0x9f));var _0xdc73=function(_0x1aa47b,_0x4a2efe){_0x1aa47b=_0x1aa47b-0x0;var _0x157d98=_0xc73d[_0x1aa47b];return _0x157d98;};'use strict';module[_0xdc73('0x0')][0x194]=function pageNotFound(_0x4e8a7b,_0x75a5fa){var _0x3c530b=_0xdc73('0x1');var _0x342deb=0x194;var _0x491b7e={'status':_0x342deb};_0x75a5fa[_0xdc73('0x2')](_0x491b7e[_0xdc73('0x2')]);_0x75a5fa['render'](_0x3c530b,{},function(_0x40af25,_0x1117c2){if(_0x40af25){return _0x75a5fa[_0xdc73('0x2')](_0x491b7e['status'])[_0xdc73('0x3')](_0x491b7e);}_0x75a5fa[_0xdc73('0x4')](_0x1117c2);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 993c016..e87b3cf 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4f2=['../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','ChatQueueReport','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','VoiceMail','cascade','UserId','userSetting','hasMany','Recordings','UserVoiceQueueRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','SenderId','Hoppers','SET\x20NULL','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','OpenchannelInteractions','user_has_openchannel_interactions','VoiceQueues','VoicePrefixes','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsite','ChatWebsites','FaxAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','Applications','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','voice_queues_has_cm_lists','Agents','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','CloudProviderId','MailAccountId','Smtp','Dispositions','MailMessage','Interactions','List','Template','mandatoryDispositionPause','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','Teams','MailInteractionId','Account','Tags','mail_interaction_has_tags','ThroughTags','Attachment','Attachments','ChatWebsiteId','ChatOfflineMessageId','restrict','ListId','DashboardItem','Items','FaxAccountId','Answers','FaxMessage','FaxInteractionId','Owner','fax_interaction_has_tags','Users','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','user_has_sms_accounts','TagId','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','Interaction','team_has_openchannel_queues','ChatProactiveAction','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','CmCompany','Phones','CmContactId','CmHopper','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','OwnerId','CampaignId','All','OneAll','Automation','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','MailApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','ItemTypeId','Hopper','CmHopperId','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','SugarcrmAccount','Description','int_desk_configuration_has_tags','VariableId','ZendeskAccount','Subjects','int_freshdesk_configuration_has_tags','FromId','ToId','JscriptyQuestionReport','SessionId','JscriptyAnswerReport','JscriptyProject','ProjectId','MailQueues','team_has_whatsapp_queues','VoicePrefix','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_lists','FromAccount','FromUserId','FromAgent','ToUserId','ToQueue','ToAccount','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','userProfileId','UserProfileSection','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Imap','exports','../config/environment','sequelize','jstz','determine','defaultsDeep','xC@LL1234','utf8mb4','name','utf8_general_ci','sequelizeHistory','motion2','xcall','127.0.0.1','mysql','utf8','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount'];(function(_0x31ef50,_0x5edc2d){var _0x3855ae=function(_0x497d38){while(--_0x497d38){_0x31ef50['push'](_0x31ef50['shift']());}};_0x3855ae(++_0x5edc2d);}(_0xf4f2,0x12e));var _0x2f4f=function(_0x366ba1,_0x374fc4){_0x366ba1=_0x366ba1-0x0;var _0x17dcc4=_0xf4f2[_0x366ba1];return _0x17dcc4;};'use strict';var config=require(_0x2f4f('0x0'));var Sequelize=require(_0x2f4f('0x1'));var _=require('lodash');var jstz=require(_0x2f4f('0x2'));var timezone=jstz[_0x2f4f('0x3')]();config['sequelize']=_[_0x2f4f('0x4')](config['sequelize'],{'database':'motion2','username':'xcall','password':_0x2f4f('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x2f4f('0x6')},'logging':![],'timezone':timezone[_0x2f4f('0x7')](),'define':{'charset':'utf8','collate':_0x2f4f('0x8')}}});config[_0x2f4f('0x9')]=_[_0x2f4f('0x4')](config[_0x2f4f('0x9')],{'database':_0x2f4f('0xa'),'username':_0x2f4f('0xb'),'password':_0x2f4f('0x5'),'options':{'host':_0x2f4f('0xc'),'port':0xcea,'dialect':_0x2f4f('0xd'),'dialectOptions':{'charset':_0x2f4f('0x6')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x2f4f('0xe'),'collate':_0x2f4f('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2f4f('0x1')][_0x2f4f('0xf')],config[_0x2f4f('0x1')][_0x2f4f('0x10')],config[_0x2f4f('0x1')][_0x2f4f('0x11')],config[_0x2f4f('0x1')][_0x2f4f('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2f4f('0x9')]['database'],config[_0x2f4f('0x9')][_0x2f4f('0x10')],config['sequelizeHistory'][_0x2f4f('0x11')],config['sequelizeHistory'][_0x2f4f('0x12')])};db[_0x2f4f('0x13')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x15'));db['VoiceChanSpy']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x16'));db[_0x2f4f('0x17')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x18'));db[_0x2f4f('0x19')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x1a'));db[_0x2f4f('0x1b')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x2f4f('0x1c')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x1d'));db[_0x2f4f('0x1e')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x1f'));db[_0x2f4f('0x20')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x21'));db[_0x2f4f('0x22')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x23'));db[_0x2f4f('0x24')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/voiceCallReport/voiceCallReport.model');db[_0x2f4f('0x25')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x26'));db['VoiceAgentReport']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x27'));db['VoiceQueueReport']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x28'));db['MemberReport']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x29'));db[_0x2f4f('0x2a')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x2b'));db['VoiceTransferReport']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x2c'));db['UserVoiceQueueRt']=db['sequelize'][_0x2f4f('0x14')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x2f4f('0x2d')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x2f4f('0x2e')]=db['sequelize']['import'](_0x2f4f('0x2f'));db[_0x2f4f('0x30')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x31'));db[_0x2f4f('0x32')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0x2f4f('0x33')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/userSmsQueue/userSmsQueue.model');db[_0x2f4f('0x34')]=db[_0x2f4f('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x2f4f('0x35')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x36'));db[_0x2f4f('0x37')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x2f4f('0x38')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x39'));db[_0x2f4f('0x3a')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x3b'));db[_0x2f4f('0x3c')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x3d'));db[_0x2f4f('0x3e')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x3f'));db[_0x2f4f('0x40')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/mailMessage/mailMessage.model');db[_0x2f4f('0x41')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x42'));db[_0x2f4f('0x43')]=db[_0x2f4f('0x1')]['import']('../api/mailQueueReport/mailQueueReport.model');db[_0x2f4f('0x44')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x45'));db['DashboardItem']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x46'));db[_0x2f4f('0x47')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x48'));db[_0x2f4f('0x49')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x4a'));db[_0x2f4f('0x4b')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x4c'));db['FaxMessage']=db['sequelize']['import'](_0x2f4f('0x4d'));db[_0x2f4f('0x4e')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x4f'));db[_0x2f4f('0x50')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x51'));db[_0x2f4f('0x52')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x53'));db[_0x2f4f('0x54')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/smsApplication/smsApplication.model');db[_0x2f4f('0x55')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/smsMessage/smsMessage.model');db[_0x2f4f('0x56')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x57'));db[_0x2f4f('0x58')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x59'));db[_0x2f4f('0x5a')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x5b'));db[_0x2f4f('0x5c')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x5d'));db[_0x2f4f('0x5e')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x5f'));db[_0x2f4f('0x60')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db['sequelize']['import'](_0x2f4f('0x61'));db[_0x2f4f('0x62')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x63'));db[_0x2f4f('0x64')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x65'));db[_0x2f4f('0x66')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x67'));db[_0x2f4f('0x68')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/chatMessage/chatMessage.model');db[_0x2f4f('0x69')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x6a'));db[_0x2f4f('0x6b')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x6c'));db[_0x2f4f('0x6d')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x6e'));db['ChatProactiveAction']=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x6f'));db['CmCompany']=db['sequelize'][_0x2f4f('0x14')]('../api/cmCompany/cmCompany.model');db[_0x2f4f('0x70')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x71'));db[_0x2f4f('0x72')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x2f4f('0x73')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x74'));db['CmHopperHistory']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x75'));db[_0x2f4f('0x76')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x77'));db[_0x2f4f('0x78')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x79'));db[_0x2f4f('0x7a')]=db['sequelize'][_0x2f4f('0x14')]('../api/action/action.model');db['Automation']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x7b'));db[_0x2f4f('0x7c')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x7d'));db[_0x2f4f('0x7e')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x7f'));db[_0x2f4f('0x80')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/condition/condition.model');db[_0x2f4f('0x81')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x82'));db[_0x2f4f('0x83')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x84'));db[_0x2f4f('0x85')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x86'));db[_0x2f4f('0x87')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x88'));db[_0x2f4f('0x89')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/schedule/schedule.model');db[_0x2f4f('0x8a')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x8b'));db[_0x2f4f('0x8c')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x8d'));db[_0x2f4f('0x8e')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x8f'));db[_0x2f4f('0x90')]=db[_0x2f4f('0x1')]['import']('../api/cmContactHasItem/cmContactHasItem.model');db['CmHopperAdditionalPhone']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x91'));db['Template']=db['sequelize']['import'](_0x2f4f('0x92'));db[_0x2f4f('0x93')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x94'));db[_0x2f4f('0x95')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/variable/variable.model');db[_0x2f4f('0x96')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x97'));db[_0x2f4f('0x98')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x99'));db[_0x2f4f('0x9a')]=db[_0x2f4f('0x1')]['import']('../api/analyticCustomReport/analyticCustomReport.model');db[_0x2f4f('0x9b')]=db['sequelize'][_0x2f4f('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x2f4f('0x9c')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x2f4f('0x9d')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x9e'));db[_0x2f4f('0x9f')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xa0'));db[_0x2f4f('0xa1')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xa2'));db['SalesforceAccount']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xa3'));db[_0x2f4f('0xa4')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xa5'));db['SalesforceField']=db['sequelize']['import'](_0x2f4f('0xa6'));db['SugarcrmAccount']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xa7'));db[_0x2f4f('0xa8')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xa9'));db[_0x2f4f('0xaa')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xab'));db[_0x2f4f('0xac')]=db['sequelize'][_0x2f4f('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x2f4f('0xad')]=db['sequelize'][_0x2f4f('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x2f4f('0xae')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xaf'));db[_0x2f4f('0xb0')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xb1'));db[_0x2f4f('0xb2')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xb3'));db[_0x2f4f('0xb4')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xb5'));db['ZendeskAccount']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xb6'));db[_0x2f4f('0xb7')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x2f4f('0xb8')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xb9'));db[_0x2f4f('0xba')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xbb'));db[_0x2f4f('0xbc')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xbd'));db[_0x2f4f('0xbe')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xbf'));db[_0x2f4f('0xc0')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xc1'));db[_0x2f4f('0xc2')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xc3'));db[_0x2f4f('0xc4')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xc5'));db[_0x2f4f('0xc6')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xc7'));db[_0x2f4f('0xc8')]=db['sequelize']['import'](_0x2f4f('0xc9'));db[_0x2f4f('0xca')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xcb'));db[_0x2f4f('0xcc')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xcd'));db[_0x2f4f('0xce')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xcf'));db[_0x2f4f('0xd0')]=db['sequelize'][_0x2f4f('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x2f4f('0xd1')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xd2'));db[_0x2f4f('0xd3')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xd4'));db[_0x2f4f('0xd5')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x97'));db[_0x2f4f('0xd6')]=db[_0x2f4f('0x1')]['import']('../api/network/network.model');db[_0x2f4f('0xd7')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x2f4f('0xd8')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xd9'));db['JscriptyQuestionReport']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xda'));db[_0x2f4f('0xdb')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x2f4f('0xdc')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xdd'));db['SquareReport']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xde'));db[_0x2f4f('0xdf')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xe0'));db['JscriptyProject']=db[_0x2f4f('0x1')]['import']('../api/jscriptyProject/jscriptyProject.model');db[_0x2f4f('0xe1')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xe2'));db[_0x2f4f('0xe3')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xe4'));db[_0x2f4f('0xe5')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xe6'));db[_0x2f4f('0xe7')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xe8'));db['Team']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xe9'));db[_0x2f4f('0xea')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xeb'));db[_0x2f4f('0xec')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xed'));db['Migration']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xee'));db['Attachment']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xef'));db[_0x2f4f('0xf0')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xf1'));db[_0x2f4f('0xf2')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xf3'));db[_0x2f4f('0xf4')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xf5'));db['FaxTransferReport']=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/faxTransferReport/faxTransferReport.model');db[_0x2f4f('0xf6')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xf7'));db[_0x2f4f('0xf8')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xf9'));db['CmList']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xfa'));db['VoicePrefix']=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/voicePrefix/voicePrefix.model');db[_0x2f4f('0xfb')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xfc'));db['UserProfileSection']=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/userProfileSection/userProfileSection.model');db[_0x2f4f('0xfd')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xfe'));db[_0x2f4f('0xff')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x100'));db[_0x2f4f('0x101')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x102'));db[_0x2f4f('0x103')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x104'));db[_0x2f4f('0x105')]=db['sequelize'][_0x2f4f('0x14')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x2f4f('0x106')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x107'));db[_0x2f4f('0x108')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x109'));db[_0x2f4f('0x10a')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x10b'));db[_0x2f4f('0x10c')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x10d'));db[_0x2f4f('0x10e')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x10f'));db[_0x2f4f('0x110')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x111'));db['TeamVoicePrefix']=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x2f4f('0x112')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x113'));db[_0x2f4f('0x114')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x115'));db[_0x2f4f('0x116')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x117'));db['User'][_0x2f4f('0x118')](db[_0x2f4f('0x119')],{'as':_0x2f4f('0x119'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')][_0x2f4f('0x118')](db[_0x2f4f('0x114')],{'as':_0x2f4f('0x11c'),'onDelete':'cascade','foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db[_0x2f4f('0x1e')],{'as':_0x2f4f('0x11e'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')]['hasMany'](db[_0x2f4f('0x11f')],{'as':'VoiceQueuesRt','foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db[_0x2f4f('0x19')],{'as':_0x2f4f('0x120'),'onDelete':'cascade','hooks':!![]});db['User'][_0x2f4f('0x11d')](db[_0x2f4f('0x73')],{'as':_0x2f4f('0x121'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')]['hasMany'](db[_0x2f4f('0x122')],{'as':_0x2f4f('0x123'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db['ReportAgentPreview'],{'as':_0x2f4f('0x76'),'foreignKey':'UserId'});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db[_0x2f4f('0x5c')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db['User'][_0x2f4f('0x11d')](db[_0x2f4f('0x66')],{'as':_0x2f4f('0x124'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')]['hasMany'](db[_0x2f4f('0x55')],{'as':_0x2f4f('0x125'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db[_0x2f4f('0x4b')],{'as':_0x2f4f('0x126'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db[_0x2f4f('0x40')],{'as':_0x2f4f('0x127'),'foreignKey':'UserId'});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db[_0x2f4f('0x105')],{'as':_0x2f4f('0x128'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')]['hasMany'](db[_0x2f4f('0xff')],{'as':'UserNotifications','foreignKey':_0x2f4f('0x129')});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db['CmHopper'],{'as':_0x2f4f('0x12a'),'foreignKey':_0x2f4f('0x11b'),'onDelete':_0x2f4f('0x12b')});db['User'][_0x2f4f('0x12c')](db['UserProfile'],{'as':_0x2f4f('0xfb'),'foreignKey':'userProfileId'});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db['ChatGroup'],{'as':_0x2f4f('0x12e'),'through':_0x2f4f('0x12f')});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db['CmContact'],{'as':_0x2f4f('0x130'),'through':_0x2f4f('0x131')});db['User'][_0x2f4f('0x12d')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x133'),'through':_0x2f4f('0x134')});db['User']['belongsToMany'](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x136')});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x40')],{'as':_0x2f4f('0x127'),'through':_0x2f4f('0x137')});db['User'][_0x2f4f('0x12d')](db[_0x2f4f('0x66')],{'as':_0x2f4f('0x124'),'through':'user_has_chat_interactions'});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db['FaxInteraction'],{'as':_0x2f4f('0x126'),'through':_0x2f4f('0x138')});db['User']['belongsToMany'](db[_0x2f4f('0x55')],{'as':_0x2f4f('0x125'),'through':'user_has_sms_interactions'});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db['OpenchannelInteraction'],{'as':_0x2f4f('0x139'),'through':_0x2f4f('0x13a')});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x105')],{'as':_0x2f4f('0x128'),'through':'user_has_whatsapp_interactions'});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x1c')],{'as':_0x2f4f('0x13b'),'through':_0x2f4f('0x2d'),'required':![]});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db['VoicePrefix'],{'as':_0x2f4f('0x13c'),'through':_0x2f4f('0x112'),'required':![]});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x3c')],{'as':'MailQueues','through':_0x2f4f('0x30'),'required':![]});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x6b')],{'as':_0x2f4f('0x13d'),'through':_0x2f4f('0x2e'),'required':![],'hooks':!![]});db['User'][_0x2f4f('0x12d')](db[_0x2f4f('0x4e')],{'as':_0x2f4f('0x13e'),'through':_0x2f4f('0x32'),'required':![]});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x56')],{'as':_0x2f4f('0x13f'),'through':'UserSmsQueue','required':![]});db[_0x2f4f('0x13')]['belongsToMany'](db[_0x2f4f('0x60')],{'as':_0x2f4f('0x140'),'through':_0x2f4f('0x34'),'required':![]});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x10c')],{'as':_0x2f4f('0x141'),'through':_0x2f4f('0x35'),'required':![]});db[_0x2f4f('0x13')]['belongsToMany'](db[_0x2f4f('0x132')],{'through':_0x2f4f('0x134')});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x142')],{'as':_0x2f4f('0x143'),'through':'user_has_chat_websites'});db['User'][_0x2f4f('0x12d')](db[_0x2f4f('0x47')],{'as':_0x2f4f('0x144'),'through':'user_has_fax_accounts'});db['User'][_0x2f4f('0x12d')](db[_0x2f4f('0x3a')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x58')],{'as':_0x2f4f('0x145'),'through':_0x2f4f('0x146')});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x52')],{'as':_0x2f4f('0x147'),'through':'user_has_sms_accounts'});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x101')],{'as':_0x2f4f('0x148'),'through':_0x2f4f('0x149')});db['VoiceChanSpy'][_0x2f4f('0x11d')](db[_0x2f4f('0x19')],{'as':_0x2f4f('0x14a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':'ChanSpyId'});db[_0x2f4f('0x17')][_0x2f4f('0x11d')](db['VoiceExtension'],{'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x19')][_0x2f4f('0x11d')](db[_0x2f4f('0x19')],{'as':_0x2f4f('0x14b'),'onDelete':'cascade'});db[_0x2f4f('0x1b')][_0x2f4f('0x12d')](db['Sound'],{'as':'Sounds','through':_0x2f4f('0x14c')});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db['UserVoiceQueueRt'],{'as':_0x2f4f('0x14d'),'foreignKey':'VoiceQueueId'});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db['CmHopper'],{'as':_0x2f4f('0x12a'),'foreignKey':_0x2f4f('0x14e')});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db[_0x2f4f('0x73')],{'as':_0x2f4f('0x121'),'foreignKey':_0x2f4f('0x14e')});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db[_0x2f4f('0x122')],{'as':_0x2f4f('0x14f'),'foreignKey':'VoiceQueueId'});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db[_0x2f4f('0x76')],{'as':'ReportAgentPreview','foreignKey':_0x2f4f('0x14e')});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db[_0x2f4f('0x72')],{'as':_0x2f4f('0x150'),'foreignKey':_0x2f4f('0x14e')});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db[_0x2f4f('0xdb')],{'as':_0x2f4f('0x151'),'foreignKey':'VoiceQueueId'});db[_0x2f4f('0x1c')]['belongsTo'](db[_0x2f4f('0x2a')],{'as':_0x2f4f('0x2a'),'foreignKey':_0x2f4f('0x152')});db[_0x2f4f('0x1c')][_0x2f4f('0x12c')](db['Trunk'],{'as':_0x2f4f('0x153'),'foreignKey':_0x2f4f('0x154')});db[_0x2f4f('0x1c')][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'as':_0x2f4f('0x81'),'foreignKey':_0x2f4f('0x155')});db['VoiceQueue'][_0x2f4f('0x12c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x2f4f('0x1c')][_0x2f4f('0x12d')](db['CmList'],{'as':_0x2f4f('0x133'),'through':_0x2f4f('0x156')});db[_0x2f4f('0x1c')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x2d')});db['VoiceQueue']['belongsToMany'](db[_0x2f4f('0x135')],{'as':'Teams','through':'TeamVoiceQueue'});db['VoiceQueue'][_0x2f4f('0x12d')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x158'),'through':_0x2f4f('0x159')});db[_0x2f4f('0x1e')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x13'),'foreignKey':'UserId'});db['ScreenRecording']['belongsTo'](db[_0x2f4f('0x13')],{'as':'User','foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x119')][_0x2f4f('0x11d')](db[_0x2f4f('0x22')],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x15b'),'sourceKey':_0x2f4f('0x15c')});db[_0x2f4f('0x22')][_0x2f4f('0x12c')](db['VoiceMail'],{'foreignKey':_0x2f4f('0x15b'),'targetKey':_0x2f4f('0x15c')});db[_0x2f4f('0x24')][_0x2f4f('0x11d')](db[_0x2f4f('0x15d')],{'as':_0x2f4f('0x15e'),'foreignKey':_0x2f4f('0x15f'),'constraints':![]});db['VoiceCallReport'][_0x2f4f('0x11d')](db[_0x2f4f('0x160')],{'as':_0x2f4f('0x161'),'foreignKey':_0x2f4f('0x15f'),'constraints':![]});db['VoiceCallReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x13'),'foreignKey':_0x2f4f('0x11b')});db['VoiceCallReport'][_0x2f4f('0x12c')](db['CmContact'],{'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x37')][_0x2f4f('0x12c')](db['MailAccount'],{'as':_0x2f4f('0x3a'),'foreignKey':'MailAccountId'});db[_0x2f4f('0x37')][_0x2f4f('0x12c')](db[_0x2f4f('0x10e')],{'as':_0x2f4f('0x10e'),'foreignKey':_0x2f4f('0x164'),'onDelete':'restrict'});db[_0x2f4f('0x38')]['belongsTo'](db['MailAccount'],{'as':_0x2f4f('0x3a'),'foreignKey':_0x2f4f('0x165')});db[_0x2f4f('0x38')][_0x2f4f('0x12c')](db[_0x2f4f('0x10e')],{'as':_0x2f4f('0x10e'),'foreignKey':_0x2f4f('0x164'),'onDelete':'restrict'});db[_0x2f4f('0x3a')]['hasOne'](db[_0x2f4f('0x37')],{'as':'Imap','onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x3a')]['hasOne'](db[_0x2f4f('0x38')],{'as':_0x2f4f('0x166'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x3a')]['hasMany'](db[_0x2f4f('0x7e')],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x165'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x3a')][_0x2f4f('0x11d')](db[_0x2f4f('0x7c')],{'as':'Answers','foreignKey':_0x2f4f('0x165')});db[_0x2f4f('0x3a')][_0x2f4f('0x11d')](db[_0x2f4f('0x168')],{'as':_0x2f4f('0x15a'),'foreignKey':_0x2f4f('0x165')});db[_0x2f4f('0x3a')][_0x2f4f('0x11d')](db['MailInteraction'],{'as':_0x2f4f('0x169')});db[_0x2f4f('0x3a')][_0x2f4f('0x11d')](db[_0x2f4f('0x41')],{'as':_0x2f4f('0x14b'),'foreignKey':_0x2f4f('0x165'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x3a')]['belongsTo'](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':'ListId'});db[_0x2f4f('0x3a')][_0x2f4f('0x12c')](db[_0x2f4f('0x16b')],{'as':_0x2f4f('0x16b'),'foreignKey':'TemplateId'});db[_0x2f4f('0x3a')][_0x2f4f('0x12c')](db[_0x2f4f('0x83')],{'as':_0x2f4f('0x16c'),'foreignKey':_0x2f4f('0x16d')});db[_0x2f4f('0x3a')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Agents','through':_0x2f4f('0x16e')});db['MailQueue'][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Agents','through':_0x2f4f('0x30')});db['MailQueue'][_0x2f4f('0x12d')](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x16f'),'as':_0x2f4f('0x170')});db[_0x2f4f('0x40')]['hasMany'](db[_0x2f4f('0x168')],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x171')});db[_0x2f4f('0x40')][_0x2f4f('0x12c')](db[_0x2f4f('0x3a')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x165')});db[_0x2f4f('0x40')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x40')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':'Owner','foreignKey':_0x2f4f('0x11b')});db['MailInteraction'][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':'mail_interaction_has_tags','as':_0x2f4f('0x173')});db[_0x2f4f('0x40')][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x174'),'as':_0x2f4f('0x175')});db[_0x2f4f('0x40')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Users','through':_0x2f4f('0x137'),'foreignKey':_0x2f4f('0x171')});db[_0x2f4f('0x168')][_0x2f4f('0x11d')](db[_0x2f4f('0x176')],{'as':_0x2f4f('0x177'),'onDelete':_0x2f4f('0x11a')});db['MailMessage'][_0x2f4f('0x12c')](db['User'],{'as':_0x2f4f('0x13')});db[_0x2f4f('0x168')][_0x2f4f('0x12c')](db['CmContact'],{'onDelete':_0x2f4f('0x11a'),'as':_0x2f4f('0x162')});db['MailMessage']['belongsTo'](db['MailInteraction'],{'as':'Interaction','foreignKey':'MailInteractionId'});db['MailMessage'][_0x2f4f('0x12c')](db[_0x2f4f('0x3a')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x165')});db[_0x2f4f('0x168')]['belongsTo'](db[_0x2f4f('0x142')],{'as':_0x2f4f('0x142'),'foreignKey':_0x2f4f('0x178')});db[_0x2f4f('0x168')][_0x2f4f('0x12c')](db[_0x2f4f('0x69')],{'as':_0x2f4f('0x69'),'foreignKey':_0x2f4f('0x179')});db[_0x2f4f('0x41')]['belongsTo'](db[_0x2f4f('0x13')],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x41')][_0x2f4f('0x12c')](db[_0x2f4f('0x3c')],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x41')][_0x2f4f('0x12c')](db[_0x2f4f('0x3a')],{'onDelete':_0x2f4f('0x17a')});db['MailApplication'][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x2f4f('0x41')][_0x2f4f('0x12c')](db[_0x2f4f('0x8c')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':'TagId'});db[_0x2f4f('0x43')]['belongsTo'](db[_0x2f4f('0x3a')],{});db['MailQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x43')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db[_0x2f4f('0x43')][_0x2f4f('0x12c')](db[_0x2f4f('0x40')],{});db['MailQueueReport'][_0x2f4f('0x12c')](db['MailMessage'],{});db['MailQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{});db[_0x2f4f('0x43')]['belongsTo'](db[_0x2f4f('0x3c')],{});db[_0x2f4f('0x44')]['hasMany'](db[_0x2f4f('0x17c')],{'as':_0x2f4f('0x17d'),'onDelete':'cascade'});db[_0x2f4f('0x47')][_0x2f4f('0x11d')](db['Disposition'],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x17e'),'onDelete':_0x2f4f('0x11a')});db['FaxAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0x7c')],{'as':_0x2f4f('0x17f'),'foreignKey':_0x2f4f('0x17e')});db[_0x2f4f('0x47')][_0x2f4f('0x11d')](db[_0x2f4f('0x4b')],{'as':'Interactions'});db['FaxAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0x49')],{'as':_0x2f4f('0x14b'),'foreignKey':_0x2f4f('0x17e'),'onDelete':'cascade'});db[_0x2f4f('0x47')][_0x2f4f('0x11d')](db['VoiceExtension'],{'as':'Exntensions','onDelete':'cascade'});db[_0x2f4f('0x47')]['hasMany'](db[_0x2f4f('0x180')],{'as':_0x2f4f('0x15a')});db[_0x2f4f('0x47')]['belongsTo'](db[_0x2f4f('0x2a')],{'as':'Trunk'});db[_0x2f4f('0x47')][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b')});db['FaxAccount'][_0x2f4f('0x12c')](db[_0x2f4f('0x83')],{'as':_0x2f4f('0x16c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x2f4f('0x47')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0x2f4f('0x49')]['belongsTo'](db['User'],{'onDelete':_0x2f4f('0x17a')});db['FaxApplication'][_0x2f4f('0x12c')](db[_0x2f4f('0x4e')],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x49')][_0x2f4f('0x12c')](db['FaxAccount'],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x49')][_0x2f4f('0x12c')](db[_0x2f4f('0x8c')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':'TagId'});db['FaxInteraction'][_0x2f4f('0x11d')](db['FaxMessage'],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x181')});db[_0x2f4f('0x4b')]['belongsTo'](db[_0x2f4f('0x47')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x17e')});db[_0x2f4f('0x4b')]['belongsTo'](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db[_0x2f4f('0x4b')]['belongsTo'](db['User'],{'as':_0x2f4f('0x182'),'foreignKey':_0x2f4f('0x11b')});db['FaxInteraction'][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x183'),'as':_0x2f4f('0x173')});db[_0x2f4f('0x4b')]['belongsToMany'](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x183'),'as':_0x2f4f('0x175')});db[_0x2f4f('0x4b')]['belongsToMany'](db['User'],{'as':_0x2f4f('0x184'),'through':_0x2f4f('0x138'),'foreignKey':_0x2f4f('0x181')});db['FaxMessage'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'onDelete':'cascade','as':_0x2f4f('0x13')});db[_0x2f4f('0x180')][_0x2f4f('0x12c')](db[_0x2f4f('0x4b')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db[_0x2f4f('0x180')]['belongsTo'](db[_0x2f4f('0x70')],{'onDelete':'cascade','as':'Contact'});db[_0x2f4f('0x180')]['belongsTo'](db[_0x2f4f('0x176')],{'as':'Attachment','foreignKey':_0x2f4f('0x185')});db[_0x2f4f('0x180')][_0x2f4f('0x12c')](db[_0x2f4f('0x47')],{'as':'Account','foreignKey':_0x2f4f('0x17e')});db[_0x2f4f('0x4e')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x157'),'through':'UserFaxQueue'});db[_0x2f4f('0x4e')][_0x2f4f('0x12d')](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x186'),'as':_0x2f4f('0x170')});db[_0x2f4f('0x50')]['belongsTo'](db[_0x2f4f('0x47')],{});db[_0x2f4f('0x50')][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':'ListId'});db['FaxQueueReport'][_0x2f4f('0x12c')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x2f4f('0x50')][_0x2f4f('0x12c')](db[_0x2f4f('0x4b')],{});db['FaxQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x180')],{});db[_0x2f4f('0x50')]['belongsTo'](db['User'],{});db[_0x2f4f('0x50')][_0x2f4f('0x12c')](db['FaxQueue'],{});db['SmsAccount']['hasMany'](db[_0x2f4f('0x7e')],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x187'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x52')][_0x2f4f('0x11d')](db[_0x2f4f('0x7c')],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0x2f4f('0x52')][_0x2f4f('0x11d')](db[_0x2f4f('0x188')],{'as':'Messages','foreignKey':_0x2f4f('0x187')});db[_0x2f4f('0x52')][_0x2f4f('0x11d')](db[_0x2f4f('0x55')],{'as':_0x2f4f('0x169')});db[_0x2f4f('0x52')][_0x2f4f('0x11d')](db['SmsApplication'],{'as':'Applications','foreignKey':_0x2f4f('0x187'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x52')]['belongsTo'](db[_0x2f4f('0x132')],{'as':'List','foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x52')][_0x2f4f('0x12c')](db[_0x2f4f('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0x2f4f('0x16d')});db[_0x2f4f('0x52')]['belongsToMany'](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x189')});db[_0x2f4f('0x54')]['belongsTo'](db['User'],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x54')][_0x2f4f('0x12c')](db[_0x2f4f('0x56')],{'onDelete':'restrict'});db['SmsApplication'][_0x2f4f('0x12c')](db[_0x2f4f('0x52')],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x54')][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':_0x2f4f('0x155')});db[_0x2f4f('0x54')][_0x2f4f('0x12c')](db[_0x2f4f('0x8c')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':_0x2f4f('0x18a')});db[_0x2f4f('0x55')]['hasMany'](db[_0x2f4f('0x188')],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x18b')});db['SmsInteraction'][_0x2f4f('0x12c')](db[_0x2f4f('0x52')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x187')});db[_0x2f4f('0x55')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db['SmsInteraction'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x182'),'foreignKey':'UserId'});db[_0x2f4f('0x55')]['belongsToMany'](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x18c'),'as':'Tags'});db[_0x2f4f('0x55')]['belongsToMany'](db['Tag'],{'through':_0x2f4f('0x18c'),'as':'ThroughTags'});db[_0x2f4f('0x55')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x184'),'through':_0x2f4f('0x18d'),'foreignKey':_0x2f4f('0x18b')});db[_0x2f4f('0x188')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x13')});db['SmsMessage'][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'onDelete':'cascade','as':_0x2f4f('0x162')});db[_0x2f4f('0x188')]['belongsTo'](db[_0x2f4f('0x55')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x2f4f('0x18b')});db[_0x2f4f('0x188')][_0x2f4f('0x12c')](db[_0x2f4f('0x52')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x187')});db[_0x2f4f('0x56')][_0x2f4f('0x12d')](db['User'],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x33'),'foreignKey':_0x2f4f('0x18e')});db[_0x2f4f('0x56')][_0x2f4f('0x12d')](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x18f'),'as':_0x2f4f('0x170')});db[_0x2f4f('0x58')][_0x2f4f('0x11d')](db['Disposition'],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x190'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x58')][_0x2f4f('0x11d')](db['CannedAnswer'],{'as':_0x2f4f('0x17f'),'foreignKey':_0x2f4f('0x190')});db[_0x2f4f('0x58')][_0x2f4f('0x11d')](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0x5e')],{'as':_0x2f4f('0x15a'),'foreignKey':'OpenchannelAccountId'});db[_0x2f4f('0x58')][_0x2f4f('0x11d')](db[_0x2f4f('0x5a')],{'as':_0x2f4f('0x14b'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db[_0x2f4f('0x58')]['belongsTo'](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0x2f4f('0x12c')](db[_0x2f4f('0x83')],{'as':_0x2f4f('0x16c'),'foreignKey':_0x2f4f('0x16d')});db[_0x2f4f('0x58')]['belongsToMany'](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x146')});db[_0x2f4f('0x5a')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'onDelete':'restrict'});db[_0x2f4f('0x5a')]['belongsTo'](db[_0x2f4f('0x60')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':'OpenchannelQueueId'});db[_0x2f4f('0x5a')][_0x2f4f('0x12c')](db['OpenchannelAccount'],{'onDelete':_0x2f4f('0x17a'),'foreignKey':_0x2f4f('0x190')});db['OpenchannelApplication'][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':_0x2f4f('0x155')});db[_0x2f4f('0x5a')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0x2f4f('0x18a')});db[_0x2f4f('0x5c')][_0x2f4f('0x11d')](db[_0x2f4f('0x5e')],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x191')});db[_0x2f4f('0x5c')]['belongsTo'](db[_0x2f4f('0x58')],{'as':'Account','foreignKey':_0x2f4f('0x190')});db[_0x2f4f('0x5c')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':'Contact','foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x5c')]['belongsTo'](db[_0x2f4f('0x13')],{'as':'Owner','foreignKey':_0x2f4f('0x11b')});db['OpenchannelInteraction'][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x192'),'as':'Tags'});db[_0x2f4f('0x5c')][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x192'),'as':_0x2f4f('0x175')});db[_0x2f4f('0x5c')][_0x2f4f('0x12d')](db['User'],{'as':_0x2f4f('0x184'),'through':_0x2f4f('0x13a'),'foreignKey':_0x2f4f('0x191')});db[_0x2f4f('0x5e')][_0x2f4f('0x12c')](db['User'],{'onDelete':'cascade','as':_0x2f4f('0x13')});db[_0x2f4f('0x5e')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'onDelete':'cascade','as':_0x2f4f('0x162')});db[_0x2f4f('0x5e')][_0x2f4f('0x12c')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x2f4f('0x193'),'foreignKey':_0x2f4f('0x191')});db['OpenchannelMessage']['belongsTo'](db[_0x2f4f('0x176')],{'as':'Attachment','foreignKey':_0x2f4f('0x185')});db[_0x2f4f('0x5e')][_0x2f4f('0x12c')](db[_0x2f4f('0x58')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x190')});db['OpenchannelQueue'][_0x2f4f('0x12d')](db['User'],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0x2f4f('0x12d')](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x194'),'as':_0x2f4f('0x170')});db[_0x2f4f('0x142')]['hasMany'](db[_0x2f4f('0x7e')],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x178'),'onDelete':_0x2f4f('0x11a')});db['ChatWebsite']['hasMany'](db['CannedAnswer'],{'as':_0x2f4f('0x17f'),'foreignKey':'ChatWebsiteId'});db[_0x2f4f('0x142')][_0x2f4f('0x11d')](db[_0x2f4f('0x195')],{'as':'ProactiveActions'});db[_0x2f4f('0x142')][_0x2f4f('0x11d')](db[_0x2f4f('0x66')],{'as':'Interactions'});db[_0x2f4f('0x142')][_0x2f4f('0x11d')](db['ChatApplication'],{'as':_0x2f4f('0x14b'),'foreignKey':_0x2f4f('0x178'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x142')][_0x2f4f('0x11d')](db[_0x2f4f('0x68')],{'as':_0x2f4f('0x15a')});db[_0x2f4f('0x142')]['belongsTo'](db[_0x2f4f('0x132')],{'as':'List','foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x142')][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'as':_0x2f4f('0x81'),'foreignKey':_0x2f4f('0x155')});db['ChatWebsite'][_0x2f4f('0x12c')](db[_0x2f4f('0x3a')],{'as':_0x2f4f('0x3a'),'foreignKey':_0x2f4f('0x165')});db[_0x2f4f('0x142')]['belongsTo'](db['Pause'],{'as':_0x2f4f('0x16c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x2f4f('0x142')][_0x2f4f('0x12d')](db['User'],{'as':_0x2f4f('0x157'),'through':'user_has_chat_websites'});db[_0x2f4f('0x62')][_0x2f4f('0x12c')](db[_0x2f4f('0x58')],{});db['OpenchannelQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x62')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db[_0x2f4f('0x62')][_0x2f4f('0x12c')](db[_0x2f4f('0x5c')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x2f4f('0x5e')],{});db[_0x2f4f('0x62')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelQueue'],{});db[_0x2f4f('0x64')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x196'),'foreignKey':_0x2f4f('0x11b'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x64')][_0x2f4f('0x12c')](db[_0x2f4f('0x6b')],{'as':_0x2f4f('0x197'),'foreignKey':_0x2f4f('0x198'),'onDelete':_0x2f4f('0x17a')});db['ChatApplication'][_0x2f4f('0x12c')](db[_0x2f4f('0x142')],{'as':_0x2f4f('0x199'),'foreignKey':_0x2f4f('0x178'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x64')][_0x2f4f('0x12c')](db[_0x2f4f('0x8c')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':_0x2f4f('0x18a')});db[_0x2f4f('0x66')][_0x2f4f('0x11d')](db[_0x2f4f('0x68')],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x19a')});db[_0x2f4f('0x66')]['belongsTo'](db[_0x2f4f('0x142')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x178')});db[_0x2f4f('0x66')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x66')]['belongsTo'](db[_0x2f4f('0x13')],{'as':'Owner','foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x66')][_0x2f4f('0x12d')](db['Tag'],{'through':_0x2f4f('0x19b'),'as':'Tags'});db['ChatInteraction'][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x19b'),'as':_0x2f4f('0x175')});db['ChatInteraction'][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Users','through':_0x2f4f('0x19c'),'foreignKey':_0x2f4f('0x19a')});db[_0x2f4f('0x68')][_0x2f4f('0x12c')](db['User'],{'onDelete':_0x2f4f('0x11a'),'as':_0x2f4f('0x13')});db[_0x2f4f('0x68')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'onDelete':'cascade','as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db[_0x2f4f('0x68')]['belongsTo'](db[_0x2f4f('0x66')],{'onDelete':_0x2f4f('0x11a'),'as':'Interaction','foreignKey':_0x2f4f('0x19a')});db[_0x2f4f('0x68')]['belongsTo'](db[_0x2f4f('0x176')],{'as':_0x2f4f('0x176'),'foreignKey':'AttachmentId'});db['ChatMessage'][_0x2f4f('0x12c')](db[_0x2f4f('0x142')],{'as':'Account','foreignKey':_0x2f4f('0x178')});db[_0x2f4f('0x69')][_0x2f4f('0x11d')](db[_0x2f4f('0x176')],{'as':_0x2f4f('0x177'),'foreignKey':_0x2f4f('0x179'),'onDelete':'cascade','hooks':!![]});db[_0x2f4f('0x69')]['belongsTo'](db[_0x2f4f('0x70')],{'onDelete':_0x2f4f('0x11a'),'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x69')][_0x2f4f('0x12c')](db['ChatWebsite'],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x178')});db['ChatQueue'][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x2e'),'hooks':!![]});db[_0x2f4f('0x6b')][_0x2f4f('0x12d')](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x19d'),'as':_0x2f4f('0x170')});db[_0x2f4f('0x6d')]['hasMany'](db[_0x2f4f('0xd8')],{'as':_0x2f4f('0x15a'),'foreignKey':_0x2f4f('0x19e'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x6d')]['belongsToMany'](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x14d'),'through':'chat_group_has_users'});db[_0x2f4f('0x195')]['belongsTo'](db['ChatWebsite'],{'as':_0x2f4f('0x199'),'foreignKey':_0x2f4f('0x178')});db[_0x2f4f('0x19f')]['hasMany'](db['CmContact'],{'as':'Contacts','foreignKey':'CompanyId'});db[_0x2f4f('0x70')][_0x2f4f('0x11d')](db[_0x2f4f('0x90')],{'as':_0x2f4f('0x1a0'),'foreignKey':_0x2f4f('0x1a1')});db['CmContact'][_0x2f4f('0x11d')](db[_0x2f4f('0x1a2')],{'as':_0x2f4f('0x12a'),'foreignKey':'ContactId'});db[_0x2f4f('0x70')]['hasMany'](db[_0x2f4f('0x73')],{'as':'HopperFinals','foreignKey':_0x2f4f('0x163')});db['CmContact'][_0x2f4f('0x11d')](db['CmHopperHistory'],{'as':_0x2f4f('0x14f'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x70')]['hasMany'](db['ReportAgentPreview'],{'as':_0x2f4f('0x76'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x70')]['hasMany'](db[_0x2f4f('0xdb')],{'as':_0x2f4f('0x151'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x70')]['hasMany'](db[_0x2f4f('0x5c')],{'as':_0x2f4f('0x139'),'foreignKey':_0x2f4f('0x163'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x70')]['hasMany'](db['ChatInteraction'],{'as':_0x2f4f('0x124'),'foreignKey':_0x2f4f('0x163'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x70')][_0x2f4f('0x11d')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x2f4f('0x163'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x70')][_0x2f4f('0x11d')](db[_0x2f4f('0x4b')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x2f4f('0x70')][_0x2f4f('0x11d')](db['MailInteraction'],{'as':_0x2f4f('0x127'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x2f4f('0x70')][_0x2f4f('0x12c')](db[_0x2f4f('0x19f')],{'as':_0x2f4f('0x1a3'),'foreignKey':'CompanyId'});db[_0x2f4f('0x70')]['belongsTo'](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x70')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Users','through':_0x2f4f('0x131')});db['CmContact'][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'as':'Tags','through':'cm_contact_has_tags'});db['CmContact'][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x1a4'),'as':_0x2f4f('0x175')});db['CmHopper'][_0x2f4f('0x11d')](db[_0x2f4f('0x1a5')],{'as':_0x2f4f('0x1a6'),'foreignKey':'CmHopperId'});db[_0x2f4f('0x1a2')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':'Contact','foreignKey':_0x2f4f('0x163'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x1a2')][_0x2f4f('0x12c')](db['CmList'],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x1a2')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x196'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x1a2')][_0x2f4f('0x12c')](db[_0x2f4f('0x1c')],{'as':_0x2f4f('0x197'),'foreignKey':_0x2f4f('0x14e'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x1a2')][_0x2f4f('0x12c')](db[_0x2f4f('0xec')],{'as':_0x2f4f('0xec'),'foreignKey':'CampaignId','onDelete':_0x2f4f('0x11a')});db['CmHopper'][_0x2f4f('0x12c')](db['User'],{'as':'Owner','foreignKey':_0x2f4f('0x1a7')});db[_0x2f4f('0x72')][_0x2f4f('0x12c')](db['CmContact'],{'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x72')][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x2f4f('0x72')]['belongsTo'](db[_0x2f4f('0x1c')],{'as':_0x2f4f('0x197'),'foreignKey':_0x2f4f('0x14e'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x72')]['belongsTo'](db['Campaign'],{'as':'Campaign','foreignKey':_0x2f4f('0x1a8'),'onDelete':_0x2f4f('0x11a')});db['Automation'][_0x2f4f('0x11d')](db[_0x2f4f('0x80')],{'as':{'plural':_0x2f4f('0x1a9'),'singular':_0x2f4f('0x1aa')},'foreignKey':'AutomationAllId','onDelete':_0x2f4f('0x11a'),'hooks':!![]});db[_0x2f4f('0x1ab')][_0x2f4f('0x11d')](db[_0x2f4f('0x80')],{'as':{'plural':'Any','singular':_0x2f4f('0x1ac')},'foreignKey':_0x2f4f('0x1ad'),'onDelete':'cascade','hooks':!![]});db[_0x2f4f('0x1ab')]['hasMany'](db[_0x2f4f('0x7a')],{'as':_0x2f4f('0x1ae'),'foreignKey':_0x2f4f('0x1af'),'onDelete':'cascade','hooks':!![]});db[_0x2f4f('0x7e')][_0x2f4f('0x11d')](db[_0x2f4f('0x7e')],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x1b0'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x81')]['hasMany'](db[_0x2f4f('0x81')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0x2f4f('0x81')]['hasMany'](db['VoiceExtension'],{'as':_0x2f4f('0x120'),'foreignKey':_0x2f4f('0x155'),'onDelete':'restrict'});db[_0x2f4f('0x81')][_0x2f4f('0x11d')](db[_0x2f4f('0x41')],{'as':_0x2f4f('0x1b1'),'foreignKey':_0x2f4f('0x155')});db[_0x2f4f('0x81')]['hasMany'](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0x2f4f('0x155')});db['Interval']['hasMany'](db[_0x2f4f('0x49')],{'as':'FaxApplications','foreignKey':_0x2f4f('0x155')});db[_0x2f4f('0x81')]['hasMany'](db[_0x2f4f('0x54')],{'as':_0x2f4f('0x1b2'),'foreignKey':'IntervalId'});db[_0x2f4f('0x89')][_0x2f4f('0x12c')](db[_0x2f4f('0x3a')],{});db[_0x2f4f('0x89')][_0x2f4f('0x12c')](db[_0x2f4f('0x9b')],{'foreignKey':_0x2f4f('0x1b3')});db[_0x2f4f('0x89')]['belongsTo'](db[_0x2f4f('0x9a')],{'foreignKey':_0x2f4f('0x1b4')});db[_0x2f4f('0x8a')][_0x2f4f('0x12d')](db['VoiceMusicOnHold'],{'as':_0x2f4f('0x1b5'),'through':_0x2f4f('0x14c'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x8c')]['belongsToMany'](db['CmContact'],{'through':_0x2f4f('0x1a4')});db[_0x2f4f('0x8c')]['belongsToMany'](db[_0x2f4f('0x66')],{'through':_0x2f4f('0x19b')});db['Tag'][_0x2f4f('0x12d')](db[_0x2f4f('0x40')],{'through':_0x2f4f('0x174')});db[_0x2f4f('0x8c')]['belongsToMany'](db[_0x2f4f('0x55')],{'through':_0x2f4f('0x18c')});db['Tag'][_0x2f4f('0x12d')](db[_0x2f4f('0x4b')],{'through':'fax_interaction_has_tags'});db['Tag'][_0x2f4f('0x12d')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0x2f4f('0x8c')][_0x2f4f('0x12d')](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0x2f4f('0x90')][_0x2f4f('0x12c')](db['ContactItemType'],{'as':'ItemType','foreignKey':_0x2f4f('0x1b6')});db[_0x2f4f('0x1a5')]['belongsTo'](db[_0x2f4f('0x1a2')],{'as':_0x2f4f('0x1b7'),'foreignKey':_0x2f4f('0x1b8')});db['CmContactHasItem'][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':'Contact','foreignKey':_0x2f4f('0x1a1')});db['Trigger'][_0x2f4f('0x11d')](db[_0x2f4f('0x80')],{'as':{'plural':_0x2f4f('0x1b9'),'singular':_0x2f4f('0x1ba')},'foreignKey':_0x2f4f('0x1bb'),'onDelete':_0x2f4f('0x11a'),'hooks':!![]});db[_0x2f4f('0x93')][_0x2f4f('0x11d')](db[_0x2f4f('0x80')],{'as':{'plural':_0x2f4f('0x1bc'),'singular':'AnyCondition'},'foreignKey':_0x2f4f('0x1bd'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x2f4f('0x11d')](db[_0x2f4f('0x7a')],{'as':_0x2f4f('0x1ae'),'foreignKey':_0x2f4f('0x1be'),'onDelete':'cascade','hooks':!![]});db[_0x2f4f('0x9a')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x2f4f('0x1bf'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1b4'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0x2f4f('0x9f')],{'as':_0x2f4f('0x1bf'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1b3')});db[_0x2f4f('0x9d')][_0x2f4f('0x11d')](db['AnalyticFieldReport'],{'as':_0x2f4f('0x1bf'),'onDelete':'cascade','foreignKey':_0x2f4f('0x1c0')});db[_0x2f4f('0x9f')][_0x2f4f('0x12c')](db[_0x2f4f('0x9d')],{'foreignKey':_0x2f4f('0x1c0')});db[_0x2f4f('0x1c1')]['hasMany'](db[_0x2f4f('0xa4')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c3')});db['SalesforceConfiguration'][_0x2f4f('0x11d')](db[_0x2f4f('0x1c4')],{'as':'Subjects','onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xa4')]['hasMany'](db['SalesforceField'],{'as':_0x2f4f('0x1c6'),'onDelete':'cascade','foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xa4')][_0x2f4f('0x11d')](db[_0x2f4f('0x1c4')],{'as':_0x2f4f('0x1bf'),'onDelete':'cascade','foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xa4')][_0x2f4f('0x12c')](db[_0x2f4f('0x1c1')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0x1c4')][_0x2f4f('0x11d')](db['SalesforceField'],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0x1c4')]['hasMany'](db['SalesforceField'],{'as':'Description','foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0x1c4')][_0x2f4f('0x11d')](db[_0x2f4f('0x1c4')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db['SalesforceField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x2f4f('0x1cb')][_0x2f4f('0x11d')](db['SugarcrmConfiguration'],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':'AccountId'});db[_0x2f4f('0xa8')][_0x2f4f('0x11d')](db[_0x2f4f('0xaa')],{'as':'Subjects','onDelete':_0x2f4f('0x11a'),'foreignKey':'SubjectId'});db[_0x2f4f('0xa8')][_0x2f4f('0x11d')](db[_0x2f4f('0xaa')],{'as':_0x2f4f('0x1c6'),'onDelete':'cascade','foreignKey':_0x2f4f('0x1c7')});db['SugarcrmConfiguration']['hasMany'](db[_0x2f4f('0xaa')],{'as':'Fields','onDelete':_0x2f4f('0x11a'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0x2f4f('0x12c')](db[_0x2f4f('0x1cb')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x1c3')});db['SugarcrmField'][_0x2f4f('0x11d')](db['SugarcrmField'],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db['SugarcrmField'][_0x2f4f('0x11d')](db[_0x2f4f('0xaa')],{'as':_0x2f4f('0x1cc'),'foreignKey':_0x2f4f('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xaa')][_0x2f4f('0x12c')](db[_0x2f4f('0x95')],{'as':_0x2f4f('0x95'),'foreignKey':'VariableId'});db[_0x2f4f('0xac')][_0x2f4f('0x11d')](db[_0x2f4f('0xad')],{'as':_0x2f4f('0x1c2'),'onDelete':'cascade','foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0xad')][_0x2f4f('0x11d')](db['DeskField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['DeskConfiguration'][_0x2f4f('0x11d')](db[_0x2f4f('0xae')],{'as':'Descriptions','onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xad')]['hasMany'](db[_0x2f4f('0xae')],{'as':_0x2f4f('0x1bf'),'onDelete':_0x2f4f('0x11a'),'foreignKey':'FieldId'});db[_0x2f4f('0xad')][_0x2f4f('0x12c')](db[_0x2f4f('0xac')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0xad')][_0x2f4f('0x12d')](db['Tag'],{'through':_0x2f4f('0x1cd')});db[_0x2f4f('0xae')][_0x2f4f('0x11d')](db[_0x2f4f('0xae')],{'as':_0x2f4f('0x1c9'),'foreignKey':'SubjectId'});db['DeskField']['hasMany'](db[_0x2f4f('0xae')],{'as':_0x2f4f('0x1cc'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xae')][_0x2f4f('0x11d')](db[_0x2f4f('0xae')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db['DeskField'][_0x2f4f('0x12c')](db['Variable'],{'as':'Variable','foreignKey':_0x2f4f('0x1ce')});db[_0x2f4f('0xb0')]['hasMany'](db[_0x2f4f('0xb2')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':'AccountId'});db[_0x2f4f('0xb2')][_0x2f4f('0x11d')](db[_0x2f4f('0xb4')],{'as':'Subjects','onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xb2')][_0x2f4f('0x11d')](db[_0x2f4f('0xb4')],{'as':_0x2f4f('0x1c6'),'onDelete':_0x2f4f('0x11a'),'foreignKey':'DescriptionId'});db[_0x2f4f('0xb2')][_0x2f4f('0x11d')](db[_0x2f4f('0xb4')],{'as':_0x2f4f('0x1bf'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xb2')][_0x2f4f('0x12c')](db[_0x2f4f('0xb0')],{'as':'Account','foreignKey':'AccountId'});db[_0x2f4f('0xb4')]['hasMany'](db['ZohoField'],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xb4')][_0x2f4f('0x11d')](db['ZohoField'],{'as':_0x2f4f('0x1cc'),'foreignKey':_0x2f4f('0x1c7')});db['ZohoField'][_0x2f4f('0x11d')](db[_0x2f4f('0xb4')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xb4')]['belongsTo'](db[_0x2f4f('0x95')],{'as':_0x2f4f('0x95'),'foreignKey':_0x2f4f('0x1ce')});db[_0x2f4f('0x1cf')]['hasMany'](db[_0x2f4f('0xb7')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0xb7')][_0x2f4f('0x11d')](db[_0x2f4f('0xb8')],{'as':_0x2f4f('0x1d0'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xb7')][_0x2f4f('0x11d')](db[_0x2f4f('0xb8')],{'as':_0x2f4f('0x1c6'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xb7')][_0x2f4f('0x11d')](db['ZendeskField'],{'as':_0x2f4f('0x1bf'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xb7')][_0x2f4f('0x12c')](db[_0x2f4f('0x1cf')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0xb7')][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':'int_zendesk_configuration_has_tags'});db[_0x2f4f('0xb8')]['hasMany'](db['ZendeskField'],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xb8')][_0x2f4f('0x11d')](db['ZendeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['ZendeskField'][_0x2f4f('0x11d')](db[_0x2f4f('0xb8')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db['ZendeskField'][_0x2f4f('0x12c')](db['Variable'],{'as':_0x2f4f('0x95'),'foreignKey':_0x2f4f('0x1ce')});db['FreshdeskAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0xbc')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c3')});db['FreshdeskConfiguration'][_0x2f4f('0x11d')](db[_0x2f4f('0xbe')],{'as':_0x2f4f('0x1d0'),'onDelete':_0x2f4f('0x11a'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x2f4f('0x11d')](db[_0x2f4f('0xbe')],{'as':_0x2f4f('0x1c6'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xbc')][_0x2f4f('0x11d')](db[_0x2f4f('0xbe')],{'as':_0x2f4f('0x1bf'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xbc')][_0x2f4f('0x12c')](db['FreshdeskAccount'],{'as':_0x2f4f('0x172'),'foreignKey':'AccountId'});db[_0x2f4f('0xbc')][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x1d1')});db['FreshdeskField']['hasMany'](db[_0x2f4f('0xbe')],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xbe')][_0x2f4f('0x11d')](db[_0x2f4f('0xbe')],{'as':_0x2f4f('0x1cc'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xbe')][_0x2f4f('0x11d')](db[_0x2f4f('0xbe')],{'as':'Field','foreignKey':'FieldId'});db[_0x2f4f('0xbe')][_0x2f4f('0x12c')](db[_0x2f4f('0x95')],{'as':_0x2f4f('0x95'),'foreignKey':'VariableId'});db['VtigerAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0xc2')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c3')});db['VtigerConfiguration'][_0x2f4f('0x11d')](db[_0x2f4f('0xc4')],{'as':'Subjects','foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xc2')][_0x2f4f('0x11d')](db[_0x2f4f('0xc4')],{'as':'Descriptions','foreignKey':_0x2f4f('0x1c7')});db['VtigerConfiguration'][_0x2f4f('0x11d')](db['VtigerField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x2f4f('0xc2')]['belongsTo'](db['VtigerAccount'],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x1c3')});db['VtigerField']['hasMany'](db[_0x2f4f('0xc4')],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db['VtigerField'][_0x2f4f('0x11d')](db[_0x2f4f('0xc4')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x2f4f('0xc4')][_0x2f4f('0x11d')](db[_0x2f4f('0xc4')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xc4')][_0x2f4f('0x12c')](db['Variable'],{'as':_0x2f4f('0x95'),'foreignKey':_0x2f4f('0x1ce')});db['ServicenowAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0xc8')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c3')});db['ServicenowConfiguration'][_0x2f4f('0x11d')](db['ServicenowField'],{'as':_0x2f4f('0x1d0'),'foreignKey':'SubjectId'});db['ServicenowConfiguration']['hasMany'](db[_0x2f4f('0xca')],{'as':_0x2f4f('0x1c6'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xc8')][_0x2f4f('0x11d')](db[_0x2f4f('0xca')],{'as':'Fields','foreignKey':'FieldId'});db[_0x2f4f('0xc8')][_0x2f4f('0x12c')](db[_0x2f4f('0xc6')],{'as':'Account','foreignKey':_0x2f4f('0x1c3')});db['ServicenowField'][_0x2f4f('0x11d')](db['ServicenowField'],{'as':'Subject','foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xca')][_0x2f4f('0x11d')](db[_0x2f4f('0xca')],{'as':'Description','foreignKey':_0x2f4f('0x1c7')});db['ServicenowField'][_0x2f4f('0x11d')](db[_0x2f4f('0xca')],{'as':_0x2f4f('0x1ca'),'foreignKey':'FieldId'});db['ServicenowField'][_0x2f4f('0x12c')](db['Variable'],{'as':_0x2f4f('0x95'),'foreignKey':_0x2f4f('0x1ce')});db[_0x2f4f('0xcc')][_0x2f4f('0x11d')](db['Dynamics365Configuration'],{'as':_0x2f4f('0x1c2'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x2f4f('0xcc')][_0x2f4f('0x12c')](db['CloudProvider'],{'as':_0x2f4f('0x10e'),'foreignKey':_0x2f4f('0x164')});db[_0x2f4f('0xce')][_0x2f4f('0x11d')](db[_0x2f4f('0xd0')],{'as':_0x2f4f('0x1d0'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xce')][_0x2f4f('0x11d')](db[_0x2f4f('0xd0')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xce')][_0x2f4f('0x11d')](db[_0x2f4f('0xd0')],{'as':_0x2f4f('0x1bf'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xce')][_0x2f4f('0x12c')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x2f4f('0x1c3')});db['Dynamics365Field']['hasMany'](db[_0x2f4f('0xd0')],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xd0')]['hasMany'](db['Dynamics365Field'],{'as':_0x2f4f('0x1cc'),'foreignKey':'DescriptionId'});db['Dynamics365Field']['hasMany'](db[_0x2f4f('0xd0')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xd0')][_0x2f4f('0x12c')](db[_0x2f4f('0x95')],{'as':_0x2f4f('0x95'),'foreignKey':_0x2f4f('0x1ce')});db['FreshsalesAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0xd3')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0xd3')][_0x2f4f('0x11d')](db[_0x2f4f('0xd5')],{'as':_0x2f4f('0x1d0'),'foreignKey':_0x2f4f('0x1c5')});db['FreshsalesConfiguration'][_0x2f4f('0x11d')](db['FreshsalesField'],{'as':_0x2f4f('0x1c6'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xd3')][_0x2f4f('0x11d')](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x2f4f('0x1c8')});db['FreshsalesConfiguration']['belongsTo'](db[_0x2f4f('0xd1')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0xd5')]['hasMany'](db['FreshsalesField'],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xd5')][_0x2f4f('0x11d')](db[_0x2f4f('0xd5')],{'as':_0x2f4f('0x1cc'),'foreignKey':'DescriptionId'});db[_0x2f4f('0xd5')][_0x2f4f('0x11d')](db[_0x2f4f('0xd5')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xd5')]['belongsTo'](db[_0x2f4f('0x95')],{'as':_0x2f4f('0x95'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x142')],{});db[_0x2f4f('0xd7')]['belongsTo'](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0xd7')][_0x2f4f('0x12c')](db['CmContact'],{'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163')});db['ChatQueueReport'][_0x2f4f('0x12c')](db['ChatInteraction'],{});db[_0x2f4f('0xd7')][_0x2f4f('0x12c')](db[_0x2f4f('0x68')],{});db['ChatQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{});db['ChatQueueReport']['belongsTo'](db[_0x2f4f('0x6b')],{});db[_0x2f4f('0xd8')]['belongsTo'](db[_0x2f4f('0x13')],{'onDelete':'cascade','foreignKey':_0x2f4f('0x1d2')});db['ChatInternalMessage']['belongsTo'](db[_0x2f4f('0x13')],{'onDelete':'cascade','foreignKey':_0x2f4f('0x1d3')});db['JscriptySessionReport'][_0x2f4f('0x11d')](db[_0x2f4f('0x1d4')],{'foreignKey':_0x2f4f('0x1d5'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0xdb')][_0x2f4f('0x11d')](db[_0x2f4f('0x1d6')],{'foreignKey':'SessionId','onDelete':_0x2f4f('0x11a')});db['SmsQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x52')],{});db[_0x2f4f('0xdc')][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b')});db['SmsQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0xdc')]['belongsTo'](db[_0x2f4f('0x55')],{});db[_0x2f4f('0xdc')][_0x2f4f('0x12c')](db[_0x2f4f('0x188')],{});db[_0x2f4f('0xdc')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{});db[_0x2f4f('0xdc')][_0x2f4f('0x12c')](db[_0x2f4f('0x56')],{});db[_0x2f4f('0x1d7')][_0x2f4f('0x11d')](db[_0x2f4f('0xdb')],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x2f4f('0x1d8')});db[_0x2f4f('0x1d7')]['hasMany'](db[_0x2f4f('0x1d6')],{'foreignKey':_0x2f4f('0x1d8')});db['Team'][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x136')});db['Team'][_0x2f4f('0x12d')](db['VoiceQueue'],{'through':_0x2f4f('0x110'),'as':_0x2f4f('0x13b')});db[_0x2f4f('0x135')][_0x2f4f('0x12d')](db[_0x2f4f('0x3c')],{'through':'team_has_mail_queues','as':_0x2f4f('0x1d9')});db[_0x2f4f('0x135')]['belongsToMany'](db[_0x2f4f('0x6b')],{'through':_0x2f4f('0x19d'),'as':_0x2f4f('0x13d')});db[_0x2f4f('0x135')][_0x2f4f('0x12d')](db[_0x2f4f('0x4e')],{'through':_0x2f4f('0x186'),'as':'FaxQueues'});db['Team'][_0x2f4f('0x12d')](db[_0x2f4f('0x56')],{'through':_0x2f4f('0x18f'),'as':_0x2f4f('0x13f')});db['Team'][_0x2f4f('0x12d')](db['OpenchannelQueue'],{'through':_0x2f4f('0x194'),'as':'OpenchannelQueues'});db[_0x2f4f('0x135')][_0x2f4f('0x12d')](db[_0x2f4f('0x10c')],{'through':_0x2f4f('0x1da'),'as':_0x2f4f('0x141')});db['Team'][_0x2f4f('0x12d')](db[_0x2f4f('0x1db')],{'through':_0x2f4f('0x1dc'),'as':_0x2f4f('0x13c')});db['Campaign']['hasMany'](db[_0x2f4f('0x1a2')],{'as':_0x2f4f('0x12a'),'foreignKey':_0x2f4f('0x1a8')});db[_0x2f4f('0xec')]['hasMany'](db[_0x2f4f('0x73')],{'as':_0x2f4f('0x121'),'foreignKey':_0x2f4f('0x1a8')});db[_0x2f4f('0xec')][_0x2f4f('0x11d')](db[_0x2f4f('0x122')],{'as':_0x2f4f('0x14f'),'foreignKey':_0x2f4f('0x1a8')});db[_0x2f4f('0xec')][_0x2f4f('0x11d')](db[_0x2f4f('0x72')],{'as':_0x2f4f('0x150'),'foreignKey':_0x2f4f('0x1a8')});db['Campaign'][_0x2f4f('0x12c')](db[_0x2f4f('0x2a')],{'as':_0x2f4f('0x2a'),'foreignKey':_0x2f4f('0x152')});db[_0x2f4f('0xec')][_0x2f4f('0x12c')](db[_0x2f4f('0x2a')],{'as':_0x2f4f('0x153'),'foreignKey':_0x2f4f('0x154')});db[_0x2f4f('0xec')][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'as':'Interval','foreignKey':_0x2f4f('0x155')});db[_0x2f4f('0xec')][_0x2f4f('0x12c')](db[_0x2f4f('0xe5')],{'as':_0x2f4f('0xe5'),'foreignKey':_0x2f4f('0x1dd')});db[_0x2f4f('0xec')]['belongsToMany'](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x133'),'through':_0x2f4f('0x1de')});db[_0x2f4f('0xec')][_0x2f4f('0x12d')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x158'),'through':'campaigns_has_cm_blacklists'});db[_0x2f4f('0x176')][_0x2f4f('0x12c')](db['ChatOfflineMessage'],{'as':_0x2f4f('0x69'),'foreignKey':_0x2f4f('0x179')});db[_0x2f4f('0xf2')]['belongsTo'](db[_0x2f4f('0x168')],{});db['MailTransferReport'][_0x2f4f('0x12c')](db['MailInteraction'],{});db[_0x2f4f('0xf2')]['belongsTo'](db[_0x2f4f('0x3a')],{'foreignKey':'FromMailAccountId','as':_0x2f4f('0x1df')});db[_0x2f4f('0xf2')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e0'),'as':_0x2f4f('0x1e1')});db[_0x2f4f('0xf2')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e2'),'as':'ToAgent'});db['MailTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x3c')],{'foreignKey':'ToMailQueueId','as':_0x2f4f('0x1e3')});db[_0x2f4f('0xf2')]['belongsTo'](db[_0x2f4f('0x3a')],{'foreignKey':'ToMailAccountId','as':_0x2f4f('0x1e4')});db['ChatTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x68')],{});db[_0x2f4f('0xf4')][_0x2f4f('0x12c')](db['ChatInteraction'],{});db[_0x2f4f('0xf4')][_0x2f4f('0x12c')](db[_0x2f4f('0x142')],{'foreignKey':_0x2f4f('0x1e5'),'as':_0x2f4f('0x1df')});db[_0x2f4f('0xf4')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e0'),'as':_0x2f4f('0x1e1')});db[_0x2f4f('0xf4')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e2'),'as':_0x2f4f('0x1e6')});db['ChatTransferReport']['belongsTo'](db[_0x2f4f('0x6b')],{'foreignKey':_0x2f4f('0x1e7'),'as':_0x2f4f('0x1e3')});db['ChatTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x142')],{'foreignKey':_0x2f4f('0x1e8'),'as':_0x2f4f('0x1e4')});db[_0x2f4f('0x1e9')]['belongsTo'](db[_0x2f4f('0x180')],{});db[_0x2f4f('0x1e9')][_0x2f4f('0x12c')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x47')],{'foreignKey':_0x2f4f('0x1ea'),'as':'FromAccount'});db['FaxTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':'FromUserId','as':_0x2f4f('0x1e1')});db[_0x2f4f('0x1e9')]['belongsTo'](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e2'),'as':_0x2f4f('0x1e6')});db['FaxTransferReport']['belongsTo'](db[_0x2f4f('0x4e')],{'foreignKey':_0x2f4f('0x1eb'),'as':'ToQueue'});db[_0x2f4f('0x1e9')][_0x2f4f('0x12c')](db[_0x2f4f('0x47')],{'foreignKey':_0x2f4f('0x1ec'),'as':_0x2f4f('0x1e4')});db[_0x2f4f('0xf6')][_0x2f4f('0x12c')](db[_0x2f4f('0x5e')],{});db[_0x2f4f('0xf6')][_0x2f4f('0x12c')](db[_0x2f4f('0x5c')],{});db[_0x2f4f('0xf6')][_0x2f4f('0x12c')](db[_0x2f4f('0x58')],{'foreignKey':_0x2f4f('0x1ed'),'as':_0x2f4f('0x1df')});db['OpenchannelTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':'FromUserId','as':_0x2f4f('0x1e1')});db[_0x2f4f('0xf6')][_0x2f4f('0x12c')](db['User'],{'foreignKey':_0x2f4f('0x1e2'),'as':'ToAgent'});db[_0x2f4f('0xf6')][_0x2f4f('0x12c')](db[_0x2f4f('0x60')],{'foreignKey':'ToOpenchannelQueueId','as':_0x2f4f('0x1e3')});db['OpenchannelTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x58')],{'foreignKey':_0x2f4f('0x1ee'),'as':'ToAccount'});db[_0x2f4f('0xf8')]['belongsTo'](db[_0x2f4f('0x188')],{});db[_0x2f4f('0xf8')][_0x2f4f('0x12c')](db['SmsInteraction'],{});db[_0x2f4f('0xf8')]['belongsTo'](db[_0x2f4f('0x52')],{'foreignKey':_0x2f4f('0x1ef'),'as':_0x2f4f('0x1df')});db[_0x2f4f('0xf8')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e0'),'as':_0x2f4f('0x1e1')});db[_0x2f4f('0xf8')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e2'),'as':_0x2f4f('0x1e6')});db[_0x2f4f('0xf8')]['belongsTo'](db[_0x2f4f('0x56')],{'foreignKey':_0x2f4f('0x1f0'),'as':_0x2f4f('0x1e3')});db[_0x2f4f('0xf8')][_0x2f4f('0x12c')](db[_0x2f4f('0x52')],{'foreignKey':_0x2f4f('0x1f1'),'as':_0x2f4f('0x1e4')});db[_0x2f4f('0x132')][_0x2f4f('0x11d')](db[_0x2f4f('0x7e')],{'as':_0x2f4f('0x167'),'foreignKey':'ListId','onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x132')][_0x2f4f('0x11d')](db['CmCustomField'],{'as':'CustomFields','foreignKey':'ListId'});db[_0x2f4f('0x132')][_0x2f4f('0x11d')](db['CmContact'],{'as':_0x2f4f('0x130'),'onDelete':'cascade','foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x132')][_0x2f4f('0x11d')](db[_0x2f4f('0x73')],{'as':_0x2f4f('0x121'),'foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x132')][_0x2f4f('0x11d')](db[_0x2f4f('0x122')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0x2f4f('0x132')]['hasMany'](db['ReportAgentPreview'],{'as':_0x2f4f('0x76'),'foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x132')][_0x2f4f('0x12d')](db[_0x2f4f('0x1c')],{'as':'Queues','through':_0x2f4f('0x156')});db[_0x2f4f('0x132')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Agents','through':'cm_user_has_lists'});db[_0x2f4f('0x1db')]['hasMany'](db[_0x2f4f('0x19')],{'as':'Extensions','onDelete':'cascade'});db['VoicePrefix'][_0x2f4f('0x12d')](db['User'],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x112')});db['VoicePrefix'][_0x2f4f('0x12d')](db['Team'],{'through':_0x2f4f('0x1dc'),'as':_0x2f4f('0x170')});db[_0x2f4f('0xfb')][_0x2f4f('0x11d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x184'),'foreignKey':_0x2f4f('0x1f2')});db[_0x2f4f('0xfb')]['hasMany'](db[_0x2f4f('0x1f3')],{'as':'UserProfileSections','foreignKey':_0x2f4f('0x1f2'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x1f3')][_0x2f4f('0x11d')](db[_0x2f4f('0xfd')],{'as':_0x2f4f('0x1f4'),'foreignKey':_0x2f4f('0x1f5'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x101')]['hasMany'](db[_0x2f4f('0x7e')],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x1f6'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x101')]['hasMany'](db[_0x2f4f('0x7c')],{'as':_0x2f4f('0x17f'),'foreignKey':_0x2f4f('0x1f6')});db[_0x2f4f('0x101')][_0x2f4f('0x11d')](db[_0x2f4f('0x106')],{'as':'Messages','foreignKey':_0x2f4f('0x1f6')});db[_0x2f4f('0x101')][_0x2f4f('0x11d')](db[_0x2f4f('0x105')],{'as':_0x2f4f('0x169')});db[_0x2f4f('0x101')][_0x2f4f('0x11d')](db[_0x2f4f('0x103')],{'as':'Applications','foreignKey':_0x2f4f('0x1f6'),'onDelete':'cascade'});db[_0x2f4f('0x101')]['belongsTo'](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x101')][_0x2f4f('0x12c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x2f4f('0x16d')});db[_0x2f4f('0x101')][_0x2f4f('0x12d')](db['User'],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x149')});db[_0x2f4f('0x103')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x103')][_0x2f4f('0x12c')](db[_0x2f4f('0x10c')],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x103')][_0x2f4f('0x12c')](db['WhatsappAccount'],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x103')][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'onDelete':'restrict','foreignKey':_0x2f4f('0x155')});db[_0x2f4f('0x103')]['belongsTo'](db[_0x2f4f('0x8c')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':_0x2f4f('0x18a')});db[_0x2f4f('0x105')][_0x2f4f('0x11d')](db['WhatsappMessage'],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1f7')});db[_0x2f4f('0x105')][_0x2f4f('0x12c')](db[_0x2f4f('0x101')],{'as':_0x2f4f('0x172'),'foreignKey':'WhatsappAccountId'});db[_0x2f4f('0x105')]['belongsTo'](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db[_0x2f4f('0x105')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':'Owner','foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x105')]['belongsToMany'](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x1f8'),'as':_0x2f4f('0x173')});db[_0x2f4f('0x105')][_0x2f4f('0x12d')](db['Tag'],{'through':_0x2f4f('0x1f8'),'as':_0x2f4f('0x175')});db['WhatsappInteraction'][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x184'),'through':'user_has_whatsapp_interactions','foreignKey':_0x2f4f('0x1f7')});db[_0x2f4f('0x106')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':'User'});db[_0x2f4f('0x106')][_0x2f4f('0x12c')](db['CmContact'],{'onDelete':_0x2f4f('0x11a'),'as':_0x2f4f('0x162')});db['WhatsappMessage'][_0x2f4f('0x12c')](db['WhatsappInteraction'],{'onDelete':_0x2f4f('0x11a'),'as':_0x2f4f('0x193'),'foreignKey':'WhatsappInteractionId'});db[_0x2f4f('0x106')]['belongsTo'](db[_0x2f4f('0x101')],{'as':'Account','foreignKey':_0x2f4f('0x1f6')});db['WhatsappQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x101')],{});db[_0x2f4f('0x108')][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':'ListId'});db[_0x2f4f('0x108')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db[_0x2f4f('0x108')][_0x2f4f('0x12c')](db['WhatsappInteraction'],{});db[_0x2f4f('0x108')][_0x2f4f('0x12c')](db[_0x2f4f('0x10c')],{});db[_0x2f4f('0x108')]['belongsTo'](db[_0x2f4f('0x106')],{});db['WhatsappQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{});db[_0x2f4f('0x10a')][_0x2f4f('0x12c')](db[_0x2f4f('0x106')],{});db[_0x2f4f('0x10a')][_0x2f4f('0x12c')](db[_0x2f4f('0x105')],{});db[_0x2f4f('0x10a')][_0x2f4f('0x12c')](db[_0x2f4f('0x101')],{'foreignKey':_0x2f4f('0x1f9'),'as':'FromAccount'});db['WhatsappTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x101')],{'foreignKey':_0x2f4f('0x1fa'),'as':'ToAccount'});db['WhatsappTransferReport'][_0x2f4f('0x12c')](db['WhatsappQueue'],{'foreignKey':_0x2f4f('0x1fb'),'as':_0x2f4f('0x1e3')});db['WhatsappTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':'FromUserId','as':_0x2f4f('0x1e1')});db['WhatsappTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e2'),'as':_0x2f4f('0x1e6')});db[_0x2f4f('0x10c')][_0x2f4f('0x12d')](db['User'],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x35'),'foreignKey':_0x2f4f('0x1fc')});db['WhatsappQueue'][_0x2f4f('0x12d')](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x1da'),'as':'Teams'});db[_0x2f4f('0x114')]['belongsTo'](db['User'],{'as':_0x2f4f('0x1fd'),'foreignKey':_0x2f4f('0x11b'),'onDelete':_0x2f4f('0x11a'),'hooks':!![]});db[_0x2f4f('0x10e')][_0x2f4f('0x118')](db[_0x2f4f('0xcc')],{'as':_0x2f4f('0xcc'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x10e')]['hasOne'](db[_0x2f4f('0x37')],{'as':_0x2f4f('0x1fe'),'onDelete':'restrict'});db[_0x2f4f('0x10e')][_0x2f4f('0x118')](db[_0x2f4f('0x38')],{'as':_0x2f4f('0x166'),'onDelete':_0x2f4f('0x17a')});module[_0x2f4f('0x1ff')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa508=['../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','Network','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','UserSetting','userSetting','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperHistory','ReportAgentPreview','SmsInteractions','FaxInteractions','MailInteractions','UserNotifications','SenderId','Hoppers','SET\x20NULL','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','cm_user_has_contacts','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_whatsapp_interactions','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','cm_user_has_lists','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SpiedAgents','VoiceContext','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperFinals','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessionReport','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','Messages','mailboxuser','VoiceMailMessage','mailbox','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','CloudProvider','CloudProviderId','MailServerOut','restrict','Smtp','Dispositions','Answers','Interactions','List','ListId','Template','user_has_mail_accounts','team_has_mail_queues','Account','ContactId','mail_interaction_has_tags','Tags','Users','MailInteractionId','Attachments','ChatWebsiteId','ChatOfflineMessageId','TagId','Items','FaxAccountId','FaxApplication','Applications','Exntensions','FaxInteractionId','Owner','fax_interaction_has_tags','user_has_fax_interactions','Interaction','AttachmentId','SmsMessage','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelApplication','OpenchannelInteractionId','openchannel_interaction_has_tags','ThroughTags','OpenchannelQueueId','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','Contacts','CompanyId','CmContactId','ChatInteractions','Company','cm_contact_has_tags','CmHopperId','Campaign','CampaignId','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','Mohs','whatsapp_interaction_has_tags','ItemType','CmHopperAdditionalPhone','Hopper','AllCondition','TriggerAllId','AnyConditions','Fields','CustomReportId','AnalyticMetric','MetricId','Configurations','AccountId','SalesforceConfiguration','Subjects','Descriptions','DescriptionId','FieldId','Subject','Description','VariableId','SugarcrmAccount','SubjectId','SugarcrmField','Field','DeskAccount','DeskConfiguration','ZohoConfiguration','ZendeskConfiguration','FreshdeskField','FreshdeskAccount','int_freshdesk_configuration_has_tags','ServicenowField','FreshsalesField','ChatQueueReport','FromId','ToId','SessionId','SmsQueueReport','ProjectId','VoiceQueues','team_has_fax_queues','team_has_sms_queues','team_has_openchannel_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsAccountId','CustomFields','UserProfileSection','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','user','exports','../config/environment','sequelize','jstz','determine','motion2','xcall','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xC@LL1234','name','password','options','database','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../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','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa508,0x187));var _0x8a50=function(_0x172b7a,_0xead108){_0x172b7a=_0x172b7a-0x0;var _0x42c484=_0xa508[_0x172b7a];return _0x42c484;};'use strict';var config=require(_0x8a50('0x0'));var Sequelize=require(_0x8a50('0x1'));var _=require('lodash');var jstz=require(_0x8a50('0x2'));var timezone=jstz[_0x8a50('0x3')]();config['sequelize']=_['defaultsDeep'](config[_0x8a50('0x1')],{'database':_0x8a50('0x4'),'username':_0x8a50('0x5'),'password':'xC@LL1234','options':{'host':_0x8a50('0x6'),'port':0xcea,'dialect':_0x8a50('0x7'),'dialectOptions':{'charset':_0x8a50('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x8a50('0x9'),'collate':_0x8a50('0xa')}}});config[_0x8a50('0xb')]=_['defaultsDeep'](config[_0x8a50('0xb')],{'database':_0x8a50('0x4'),'username':_0x8a50('0x5'),'password':_0x8a50('0xc'),'options':{'host':_0x8a50('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x8a50('0x8')},'logging':![],'timezone':timezone[_0x8a50('0xd')](),'define':{'charset':_0x8a50('0x9'),'collate':_0x8a50('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8a50('0x1')]['database'],config[_0x8a50('0x1')]['username'],config[_0x8a50('0x1')][_0x8a50('0xe')],config[_0x8a50('0x1')][_0x8a50('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x8a50('0x10')],config[_0x8a50('0xb')][_0x8a50('0x11')],config['sequelizeHistory'][_0x8a50('0xe')],config[_0x8a50('0xb')][_0x8a50('0xf')])};db[_0x8a50('0x12')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x14'));db[_0x8a50('0x15')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x16'));db['VoiceContext']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x17'));db[_0x8a50('0x18')]=db['sequelize']['import'](_0x8a50('0x19'));db[_0x8a50('0x1a')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x1b'));db[_0x8a50('0x1c')]=db['sequelize']['import'](_0x8a50('0x1d'));db[_0x8a50('0x1e')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x1f'));db['ScreenRecording']=db[_0x8a50('0x1')]['import'](_0x8a50('0x20'));db[_0x8a50('0x21')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x22'));db['VoiceMailMessage']=db[_0x8a50('0x1')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0x8a50('0x23')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x24'));db[_0x8a50('0x25')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x26'));db[_0x8a50('0x27')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x28'));db['VoiceQueueReport']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x29'));db[_0x8a50('0x2a')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x2b'));db['Trunk']=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db['sequelize'][_0x8a50('0x13')](_0x8a50('0x2c'));db['UserVoiceQueueRt']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x2d'));db[_0x8a50('0x2e')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x2f'));db['UserChatQueue']=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x8a50('0x1')]['import'](_0x8a50('0x30'));db[_0x8a50('0x31')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x32'));db[_0x8a50('0x33')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x34'));db['UserOpenchannelQueue']=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x8a50('0x35')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x36'));db[_0x8a50('0x37')]=db[_0x8a50('0x1')]['import']('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x38'));db[_0x8a50('0x39')]=db['sequelize']['import'](_0x8a50('0x3a'));db[_0x8a50('0x3b')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x3c'));db[_0x8a50('0x3d')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x3e'));db[_0x8a50('0x3f')]=db[_0x8a50('0x1')]['import']('../api/mailInteraction/mailInteraction.model');db[_0x8a50('0x40')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x41'));db[_0x8a50('0x42')]=db['sequelize'][_0x8a50('0x13')](_0x8a50('0x43'));db[_0x8a50('0x44')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x45'));db[_0x8a50('0x46')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x47'));db['DashboardItem']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x48'));db[_0x8a50('0x49')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x4a'));db['FaxApplication']=db[_0x8a50('0x1')]['import'](_0x8a50('0x4b'));db[_0x8a50('0x4c')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x4d'));db[_0x8a50('0x4e')]=db['sequelize'][_0x8a50('0x13')]('../api/faxMessage/faxMessage.model');db[_0x8a50('0x4f')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x50'));db[_0x8a50('0x51')]=db['sequelize'][_0x8a50('0x13')]('../api/faxQueueReport/faxQueueReport.model');db[_0x8a50('0x52')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/smsAccount/smsAccount.model');db[_0x8a50('0x53')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x54'));db[_0x8a50('0x55')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x56'));db['SmsMessage']=db['sequelize'][_0x8a50('0x13')](_0x8a50('0x57'));db[_0x8a50('0x58')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x59'));db[_0x8a50('0x5a')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x5b'));db[_0x8a50('0x5c')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x5d'));db[_0x8a50('0x5e')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x5f'));db[_0x8a50('0x60')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x61'));db['ChatWebsite']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x62'));db[_0x8a50('0x63')]=db['sequelize'][_0x8a50('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x8a50('0x64')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x65'));db[_0x8a50('0x66')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x67'));db[_0x8a50('0x68')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x69'));db[_0x8a50('0x6a')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x6b'));db[_0x8a50('0x6c')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/chatQueue/chatQueue.model');db[_0x8a50('0x6d')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x6e'));db[_0x8a50('0x6f')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x70'));db[_0x8a50('0x71')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x72'));db[_0x8a50('0x73')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x74'));db[_0x8a50('0x75')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x76'));db['CmHopperBlack']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x77'));db[_0x8a50('0x78')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x79'));db[_0x8a50('0x7a')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x7b'));db['ReportAgentPreview']=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x8a50('0x7c')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x7d'));db[_0x8a50('0x7e')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x7f'));db[_0x8a50('0x80')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/automation/automation.model');db[_0x8a50('0x81')]=db['sequelize'][_0x8a50('0x13')](_0x8a50('0x82'));db[_0x8a50('0x83')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x84'));db['Condition']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x85'));db[_0x8a50('0x86')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x87'));db[_0x8a50('0x88')]=db['sequelize'][_0x8a50('0x13')](_0x8a50('0x89'));db[_0x8a50('0x8a')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x8b'));db[_0x8a50('0x8c')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x8d'));db[_0x8a50('0x8e')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x8f'));db[_0x8a50('0x90')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/tag/tag.model');db[_0x8a50('0x91')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/contactItemType/contactItemType.model');db[_0x8a50('0x92')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x93'));db['CmHopperAdditionalPhone']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x94'));db['Template']=db['sequelize'][_0x8a50('0x13')]('../api/template/template.model');db[_0x8a50('0x95')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x96'));db[_0x8a50('0x97')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x98'));db[_0x8a50('0x99')]=db['sequelize'][_0x8a50('0x13')]('../api/integration/integration.model');db[_0x8a50('0x9a')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/integrationReport/integrationReport.model');db[_0x8a50('0x9b')]=db['sequelize'][_0x8a50('0x13')](_0x8a50('0x9c'));db[_0x8a50('0x9d')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x8a50('0x9e')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x9f'));db['AnalyticMetric']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xa0'));db[_0x8a50('0xa1')]=db['sequelize'][_0x8a50('0x13')](_0x8a50('0xa2'));db[_0x8a50('0xa3')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xa4'));db[_0x8a50('0xa5')]=db['sequelize']['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xa6'));db[_0x8a50('0xa7')]=db[_0x8a50('0x1')]['import']('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x8a50('0xa8')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xa9'));db['SugarcrmField']=db['sequelize'][_0x8a50('0x13')](_0x8a50('0xaa'));db['DeskAccount']=db['sequelize'][_0x8a50('0x13')](_0x8a50('0xab'));db['DeskConfiguration']=db['sequelize'][_0x8a50('0x13')](_0x8a50('0xac'));db[_0x8a50('0xad')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/intDeskField/intDeskField.model');db[_0x8a50('0xae')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xaf'));db[_0x8a50('0xb0')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xb1'));db[_0x8a50('0xb2')]=db['sequelize'][_0x8a50('0x13')](_0x8a50('0xb3'));db['ZendeskConfiguration']=db['sequelize'][_0x8a50('0x13')](_0x8a50('0xb4'));db[_0x8a50('0xb5')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xb6'));db['FreshdeskAccount']=db[_0x8a50('0x1')]['import'](_0x8a50('0xb7'));db[_0x8a50('0xb8')]=db['sequelize'][_0x8a50('0x13')](_0x8a50('0xb9'));db['FreshdeskField']=db['sequelize']['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0x8a50('0xba')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xbb'));db[_0x8a50('0xbc')]=db[_0x8a50('0x1')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x8a50('0xbd')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xbe'));db[_0x8a50('0xbf')]=db['sequelize'][_0x8a50('0x13')](_0x8a50('0xc0'));db[_0x8a50('0xc1')]=db[_0x8a50('0x1')]['import'](_0x8a50('0xc2'));db['ServicenowField']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xc3'));db[_0x8a50('0xc4')]=db[_0x8a50('0x1')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0x8a50('0xc5')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xc6'));db[_0x8a50('0xc7')]=db['sequelize']['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x8a50('0xc8')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xc9'));db[_0x8a50('0xca')]=db[_0x8a50('0x1')]['import'](_0x8a50('0xcb'));db['FreshsalesField']=db[_0x8a50('0x1')]['import']('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0x8a50('0x1')]['import']('../api/integration/integration.model');db[_0x8a50('0xcc')]=db['sequelize'][_0x8a50('0x13')]('../api/network/network.model');db['ChatQueueReport']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xcd'));db[_0x8a50('0xce')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xcf'));db[_0x8a50('0xd0')]=db[_0x8a50('0x1')]['import'](_0x8a50('0xd1'));db[_0x8a50('0xd2')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xd3'));db['JscriptySessionReport']=db['sequelize'][_0x8a50('0x13')](_0x8a50('0xd4'));db['SmsQueueReport']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xd5'));db['SquareReport']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xd6'));db[_0x8a50('0xd7')]=db['sequelize'][_0x8a50('0x13')](_0x8a50('0xd8'));db[_0x8a50('0xd9')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xda'));db[_0x8a50('0xdb')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xdc'));db[_0x8a50('0xdd')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xde'));db[_0x8a50('0xdf')]=db['sequelize']['import'](_0x8a50('0xe0'));db[_0x8a50('0xe1')]=db[_0x8a50('0x1')]['import']('../api/squareRecording/squareRecording.model');db[_0x8a50('0xe2')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xe3'));db['Team']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xe4'));db[_0x8a50('0xe5')]=db['sequelize'][_0x8a50('0x13')](_0x8a50('0xe6'));db['Campaign']=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xe7'));db[_0x8a50('0xe8')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/migration/migration.model');db[_0x8a50('0xe9')]=db[_0x8a50('0x1')]['import'](_0x8a50('0xea'));db[_0x8a50('0xeb')]=db[_0x8a50('0x1')]['import']('../api/plugin/plugin.model');db[_0x8a50('0xec')]=db[_0x8a50('0x1')]['import'](_0x8a50('0xed'));db[_0x8a50('0xee')]=db[_0x8a50('0x1')]['import'](_0x8a50('0xef'));db[_0x8a50('0xf0')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xf1'));db[_0x8a50('0xf2')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xf3'));db[_0x8a50('0xf4')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xf5'));db[_0x8a50('0xf6')]=db['sequelize']['import']('../api/cmList/cmList.model');db[_0x8a50('0xf7')]=db['sequelize'][_0x8a50('0x13')](_0x8a50('0xf8'));db[_0x8a50('0xf9')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xfa'));db['UserProfileSection']=db[_0x8a50('0x1')]['import'](_0x8a50('0xfb'));db[_0x8a50('0xfc')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0xfd'));db[_0x8a50('0xfe')]=db[_0x8a50('0x1')]['import'](_0x8a50('0xff'));db[_0x8a50('0x100')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x101'));db[_0x8a50('0x102')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x103'));db[_0x8a50('0x104')]=db[_0x8a50('0x1')]['import'](_0x8a50('0x105'));db[_0x8a50('0x106')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/whatsappMessage/whatsappMessage.model');db[_0x8a50('0x107')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x8a50('0x108')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x8a50('0x109')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x10a'));db['CloudProvider']=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0x8a50('0x10b')]=db[_0x8a50('0x1')][_0x8a50('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x8a50('0x10c')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x10d'));db[_0x8a50('0x10e')]=db[_0x8a50('0x1')][_0x8a50('0x13')](_0x8a50('0x10f'));db['UserSetting']=db[_0x8a50('0x1')]['import'](_0x8a50('0x110'));db[_0x8a50('0x111')]=db['sequelize'][_0x8a50('0x13')](_0x8a50('0x112'));db[_0x8a50('0x12')][_0x8a50('0x113')](db[_0x8a50('0x21')],{'as':_0x8a50('0x21'),'onDelete':'cascade','foreignKey':'UserId'});db[_0x8a50('0x12')][_0x8a50('0x113')](db[_0x8a50('0x114')],{'as':_0x8a50('0x115'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x117')});db[_0x8a50('0x12')][_0x8a50('0x118')](db[_0x8a50('0x1e')],{'as':_0x8a50('0x119'),'foreignKey':_0x8a50('0x117')});db[_0x8a50('0x12')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0x8a50('0x11a'),'foreignKey':_0x8a50('0x117')});db[_0x8a50('0x12')][_0x8a50('0x118')](db[_0x8a50('0x18')],{'as':_0x8a50('0x11b'),'onDelete':_0x8a50('0x116'),'hooks':!![]});db[_0x8a50('0x12')][_0x8a50('0x118')](db[_0x8a50('0x78')],{'as':'HopperFinals','foreignKey':_0x8a50('0x117')});db[_0x8a50('0x12')][_0x8a50('0x118')](db[_0x8a50('0x7a')],{'as':_0x8a50('0x11c'),'foreignKey':_0x8a50('0x117')});db[_0x8a50('0x12')][_0x8a50('0x118')](db['ReportAgentPreview'],{'as':_0x8a50('0x11d'),'foreignKey':_0x8a50('0x117')});db[_0x8a50('0x12')][_0x8a50('0x118')](db[_0x8a50('0x5c')],{'as':'OpenchannelInteractions','foreignKey':_0x8a50('0x117')});db[_0x8a50('0x12')][_0x8a50('0x118')](db[_0x8a50('0x66')],{'as':'ChatInteractions','foreignKey':_0x8a50('0x117')});db[_0x8a50('0x12')]['hasMany'](db[_0x8a50('0x55')],{'as':_0x8a50('0x11e'),'foreignKey':_0x8a50('0x117')});db[_0x8a50('0x12')][_0x8a50('0x118')](db[_0x8a50('0x4c')],{'as':_0x8a50('0x11f'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x8a50('0x3f')],{'as':_0x8a50('0x120'),'foreignKey':_0x8a50('0x117')});db[_0x8a50('0x12')][_0x8a50('0x118')](db[_0x8a50('0x104')],{'as':'WhatsappInteractions','foreignKey':_0x8a50('0x117')});db['User'][_0x8a50('0x118')](db['UserNotification'],{'as':_0x8a50('0x121'),'foreignKey':_0x8a50('0x122')});db[_0x8a50('0x12')]['hasMany'](db[_0x8a50('0x75')],{'as':_0x8a50('0x123'),'foreignKey':'UserId','onDelete':_0x8a50('0x124')});db[_0x8a50('0x12')][_0x8a50('0x125')](db['UserProfile'],{'as':_0x8a50('0xf9'),'foreignKey':_0x8a50('0x126')});db[_0x8a50('0x12')]['belongsToMany'](db[_0x8a50('0x6d')],{'as':_0x8a50('0x127'),'through':_0x8a50('0x128')});db['User'][_0x8a50('0x129')](db['CmContact'],{'as':'Contacts','through':_0x8a50('0x12a')});db['User'][_0x8a50('0x129')](db['CmList'],{'as':'Lists','through':'cm_user_has_lists'});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x12b')],{'through':_0x8a50('0x12c')});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x3f')],{'as':'MailInteractions','through':_0x8a50('0x12d')});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x66')],{'as':'ChatInteractions','through':_0x8a50('0x12e')});db['User'][_0x8a50('0x129')](db[_0x8a50('0x4c')],{'as':_0x8a50('0x11f'),'through':'user_has_fax_interactions'});db['User'][_0x8a50('0x129')](db[_0x8a50('0x55')],{'as':_0x8a50('0x11e'),'through':_0x8a50('0x12f')});db[_0x8a50('0x12')][_0x8a50('0x129')](db['OpenchannelInteraction'],{'as':_0x8a50('0x130'),'through':'user_has_openchannel_interactions'});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x104')],{'as':'WhatsappInteractions','through':_0x8a50('0x131')});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x1c')],{'as':'VoiceQueues','through':_0x8a50('0x2e'),'required':![]});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0xf7')],{'as':_0x8a50('0x132'),'through':_0x8a50('0x10e'),'required':![]});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x3b')],{'as':_0x8a50('0x133'),'through':_0x8a50('0x134'),'required':![]});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x6c')],{'as':_0x8a50('0x135'),'through':_0x8a50('0x136'),'required':![],'hooks':!![]});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x4f')],{'as':_0x8a50('0x137'),'through':'UserFaxQueue','required':![]});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x58')],{'as':_0x8a50('0x138'),'through':_0x8a50('0x33'),'required':![]});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x60')],{'as':_0x8a50('0x139'),'through':_0x8a50('0x13a'),'required':![]});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x109')],{'as':_0x8a50('0x13b'),'through':_0x8a50('0x35'),'required':![]});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0xf6')],{'through':_0x8a50('0x13c')});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x13d')],{'as':_0x8a50('0x13e'),'through':_0x8a50('0x13f')});db[_0x8a50('0x12')][_0x8a50('0x129')](db['FaxAccount'],{'as':_0x8a50('0x140'),'through':_0x8a50('0x141')});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x39')],{'as':_0x8a50('0x142'),'through':'user_has_mail_accounts'});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x5a')],{'as':'OpenchannelAccounts','through':_0x8a50('0x143')});db[_0x8a50('0x12')]['belongsToMany'](db['SmsAccount'],{'as':_0x8a50('0x144'),'through':_0x8a50('0x145')});db[_0x8a50('0x12')][_0x8a50('0x129')](db[_0x8a50('0x100')],{'as':_0x8a50('0x146'),'through':'user_has_whatsapp_accounts'});db[_0x8a50('0x15')]['hasMany'](db['VoiceExtension'],{'as':_0x8a50('0x147'),'onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0x8a50('0x148')][_0x8a50('0x118')](db[_0x8a50('0x18')],{'onDelete':_0x8a50('0x116')});db[_0x8a50('0x18')][_0x8a50('0x118')](db[_0x8a50('0x18')],{'as':'Applications','onDelete':'cascade'});db['VoiceMusicOnHold'][_0x8a50('0x129')](db['Sound'],{'as':_0x8a50('0x149'),'through':_0x8a50('0x14a')});db['VoiceQueue'][_0x8a50('0x118')](db['UserVoiceQueueRt'],{'as':_0x8a50('0x14b'),'foreignKey':_0x8a50('0x14c')});db[_0x8a50('0x1c')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x8a50('0x14c')});db['VoiceQueue']['hasMany'](db[_0x8a50('0x78')],{'as':_0x8a50('0x14d'),'foreignKey':_0x8a50('0x14c')});db[_0x8a50('0x1c')][_0x8a50('0x118')](db[_0x8a50('0x7a')],{'as':_0x8a50('0x14e'),'foreignKey':'VoiceQueueId'});db[_0x8a50('0x1c')][_0x8a50('0x118')](db[_0x8a50('0x11d')],{'as':_0x8a50('0x11d'),'foreignKey':_0x8a50('0x14c')});db['VoiceQueue'][_0x8a50('0x118')](db[_0x8a50('0x14f')],{'as':_0x8a50('0x150'),'foreignKey':_0x8a50('0x14c')});db['VoiceQueue']['hasMany'](db[_0x8a50('0x151')],{'as':_0x8a50('0x152'),'foreignKey':_0x8a50('0x14c')});db[_0x8a50('0x1c')][_0x8a50('0x125')](db[_0x8a50('0x153')],{'as':_0x8a50('0x153'),'foreignKey':_0x8a50('0x154')});db[_0x8a50('0x1c')][_0x8a50('0x125')](db[_0x8a50('0x153')],{'as':_0x8a50('0x155'),'foreignKey':_0x8a50('0x156')});db['VoiceQueue'][_0x8a50('0x125')](db[_0x8a50('0x86')],{'as':'Interval','foreignKey':_0x8a50('0x157')});db[_0x8a50('0x1c')]['belongsTo'](db[_0x8a50('0x88')],{'as':_0x8a50('0x158'),'foreignKey':_0x8a50('0x159')});db[_0x8a50('0x1c')][_0x8a50('0x129')](db['CmList'],{'as':_0x8a50('0x15a'),'through':_0x8a50('0x15b')});db[_0x8a50('0x1c')][_0x8a50('0x129')](db[_0x8a50('0x12')],{'as':_0x8a50('0x15c'),'through':_0x8a50('0x2e')});db[_0x8a50('0x1c')][_0x8a50('0x129')](db[_0x8a50('0x12b')],{'as':_0x8a50('0x15d'),'through':'TeamVoiceQueue'});db[_0x8a50('0x1c')][_0x8a50('0x129')](db[_0x8a50('0xf6')],{'as':_0x8a50('0x15e'),'through':'voice_queues_has_cm_blacklists'});db[_0x8a50('0x1e')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'as':_0x8a50('0x12'),'foreignKey':_0x8a50('0x117')});db['ScreenRecording'][_0x8a50('0x125')](db[_0x8a50('0x12')],{'as':_0x8a50('0x12'),'foreignKey':_0x8a50('0x117')});db['VoiceMail']['hasMany'](db['VoiceMailMessage'],{'as':_0x8a50('0x15f'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x160'),'sourceKey':'mailbox'});db[_0x8a50('0x161')][_0x8a50('0x125')](db[_0x8a50('0x21')],{'foreignKey':_0x8a50('0x160'),'targetKey':_0x8a50('0x162')});db['VoiceCallReport'][_0x8a50('0x118')](db[_0x8a50('0x163')],{'as':_0x8a50('0x164'),'foreignKey':_0x8a50('0x165'),'constraints':![]});db[_0x8a50('0x23')][_0x8a50('0x118')](db['VoiceAgentReport'],{'as':_0x8a50('0x166'),'foreignKey':_0x8a50('0x165'),'constraints':![]});db[_0x8a50('0x23')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'as':_0x8a50('0x12'),'foreignKey':_0x8a50('0x117')});db['VoiceCallReport'][_0x8a50('0x125')](db[_0x8a50('0x73')],{'as':_0x8a50('0x167'),'foreignKey':'ContactId'});db[_0x8a50('0x37')]['belongsTo'](db[_0x8a50('0x39')],{'as':_0x8a50('0x39'),'foreignKey':_0x8a50('0x168')});db[_0x8a50('0x37')][_0x8a50('0x125')](db[_0x8a50('0x169')],{'as':'CloudProvider','foreignKey':_0x8a50('0x16a'),'onDelete':'restrict'});db[_0x8a50('0x16b')][_0x8a50('0x125')](db[_0x8a50('0x39')],{'as':_0x8a50('0x39'),'foreignKey':_0x8a50('0x168')});db[_0x8a50('0x16b')][_0x8a50('0x125')](db[_0x8a50('0x169')],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0x8a50('0x16c')});db[_0x8a50('0x39')][_0x8a50('0x113')](db['MailServerIn'],{'as':'Imap','onDelete':'cascade'});db[_0x8a50('0x39')][_0x8a50('0x113')](db['MailServerOut'],{'as':_0x8a50('0x16d'),'onDelete':'cascade'});db[_0x8a50('0x39')][_0x8a50('0x118')](db[_0x8a50('0x83')],{'as':_0x8a50('0x16e'),'foreignKey':_0x8a50('0x168'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x39')][_0x8a50('0x118')](db[_0x8a50('0x81')],{'as':_0x8a50('0x16f'),'foreignKey':_0x8a50('0x168')});db[_0x8a50('0x39')][_0x8a50('0x118')](db[_0x8a50('0x40')],{'as':'Messages','foreignKey':_0x8a50('0x168')});db[_0x8a50('0x39')][_0x8a50('0x118')](db[_0x8a50('0x3f')],{'as':_0x8a50('0x170')});db[_0x8a50('0x39')]['hasMany'](db[_0x8a50('0x42')],{'as':'Applications','foreignKey':_0x8a50('0x168'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x39')][_0x8a50('0x125')](db['CmList'],{'as':_0x8a50('0x171'),'foreignKey':_0x8a50('0x172')});db[_0x8a50('0x39')][_0x8a50('0x125')](db['Template'],{'as':_0x8a50('0x173'),'foreignKey':'TemplateId'});db[_0x8a50('0x39')][_0x8a50('0x125')](db[_0x8a50('0x88')],{'as':_0x8a50('0x158'),'foreignKey':_0x8a50('0x159')});db['MailAccount'][_0x8a50('0x129')](db['User'],{'as':_0x8a50('0x15c'),'through':_0x8a50('0x174')});db[_0x8a50('0x3b')][_0x8a50('0x129')](db[_0x8a50('0x12')],{'as':_0x8a50('0x15c'),'through':_0x8a50('0x134')});db['MailQueue'][_0x8a50('0x129')](db[_0x8a50('0x12b')],{'through':_0x8a50('0x175'),'as':_0x8a50('0x15d')});db[_0x8a50('0x3f')][_0x8a50('0x118')](db[_0x8a50('0x40')],{'as':'Messages','onDelete':_0x8a50('0x116'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0x8a50('0x125')](db[_0x8a50('0x39')],{'as':_0x8a50('0x176'),'foreignKey':'MailAccountId'});db[_0x8a50('0x3f')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'as':_0x8a50('0x167'),'foreignKey':_0x8a50('0x177')});db[_0x8a50('0x3f')][_0x8a50('0x125')](db['User'],{'as':'Owner','foreignKey':_0x8a50('0x117')});db[_0x8a50('0x3f')]['belongsToMany'](db[_0x8a50('0x90')],{'through':_0x8a50('0x178'),'as':_0x8a50('0x179')});db[_0x8a50('0x3f')][_0x8a50('0x129')](db[_0x8a50('0x90')],{'through':_0x8a50('0x178'),'as':'ThroughTags'});db['MailInteraction']['belongsToMany'](db[_0x8a50('0x12')],{'as':_0x8a50('0x17a'),'through':_0x8a50('0x12d'),'foreignKey':_0x8a50('0x17b')});db['MailMessage'][_0x8a50('0x118')](db[_0x8a50('0xe9')],{'as':_0x8a50('0x17c'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x40')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'as':_0x8a50('0x12')});db[_0x8a50('0x40')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'onDelete':_0x8a50('0x116'),'as':_0x8a50('0x167')});db[_0x8a50('0x40')][_0x8a50('0x125')](db[_0x8a50('0x3f')],{'as':'Interaction','foreignKey':_0x8a50('0x17b')});db[_0x8a50('0x40')]['belongsTo'](db[_0x8a50('0x39')],{'as':'Account','foreignKey':_0x8a50('0x168')});db[_0x8a50('0x40')][_0x8a50('0x125')](db[_0x8a50('0x13d')],{'as':_0x8a50('0x13d'),'foreignKey':_0x8a50('0x17d')});db[_0x8a50('0x40')][_0x8a50('0x125')](db[_0x8a50('0x6a')],{'as':_0x8a50('0x6a'),'foreignKey':_0x8a50('0x17e')});db[_0x8a50('0x42')]['belongsTo'](db[_0x8a50('0x12')],{'onDelete':_0x8a50('0x16c')});db[_0x8a50('0x42')][_0x8a50('0x125')](db[_0x8a50('0x3b')],{'onDelete':_0x8a50('0x16c')});db[_0x8a50('0x42')][_0x8a50('0x125')](db[_0x8a50('0x39')],{'onDelete':_0x8a50('0x16c')});db[_0x8a50('0x42')][_0x8a50('0x125')](db[_0x8a50('0x86')],{'onDelete':_0x8a50('0x16c'),'foreignKey':'IntervalId'});db['MailApplication'][_0x8a50('0x125')](db[_0x8a50('0x90')],{'onDelete':_0x8a50('0x16c'),'foreignKey':_0x8a50('0x17f')});db[_0x8a50('0x44')][_0x8a50('0x125')](db['MailAccount'],{});db[_0x8a50('0x44')][_0x8a50('0x125')](db[_0x8a50('0xf6')],{'as':_0x8a50('0x171'),'foreignKey':_0x8a50('0x172')});db[_0x8a50('0x44')][_0x8a50('0x125')](db['CmContact'],{'as':_0x8a50('0x167'),'foreignKey':'ContactId'});db[_0x8a50('0x44')][_0x8a50('0x125')](db['MailInteraction'],{});db['MailQueueReport'][_0x8a50('0x125')](db['MailMessage'],{});db[_0x8a50('0x44')][_0x8a50('0x125')](db[_0x8a50('0x12')],{});db[_0x8a50('0x44')][_0x8a50('0x125')](db[_0x8a50('0x3b')],{});db[_0x8a50('0x46')][_0x8a50('0x118')](db['DashboardItem'],{'as':_0x8a50('0x180'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x49')][_0x8a50('0x118')](db[_0x8a50('0x83')],{'as':_0x8a50('0x16e'),'foreignKey':_0x8a50('0x181'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x49')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x8a50('0x181')});db['FaxAccount']['hasMany'](db[_0x8a50('0x4c')],{'as':_0x8a50('0x170')});db[_0x8a50('0x49')][_0x8a50('0x118')](db[_0x8a50('0x182')],{'as':_0x8a50('0x183'),'foreignKey':'FaxAccountId','onDelete':_0x8a50('0x116')});db[_0x8a50('0x49')][_0x8a50('0x118')](db[_0x8a50('0x18')],{'as':_0x8a50('0x184'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x49')][_0x8a50('0x118')](db['FaxMessage'],{'as':'Messages'});db[_0x8a50('0x49')]['belongsTo'](db[_0x8a50('0x153')],{'as':_0x8a50('0x153')});db['FaxAccount'][_0x8a50('0x125')](db[_0x8a50('0xf6')],{'as':_0x8a50('0x171'),'foreignKey':_0x8a50('0x172')});db['FaxAccount'][_0x8a50('0x125')](db[_0x8a50('0x88')],{'as':_0x8a50('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8a50('0x49')][_0x8a50('0x129')](db[_0x8a50('0x12')],{'as':'Agents','through':_0x8a50('0x141')});db[_0x8a50('0x182')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'onDelete':_0x8a50('0x16c')});db[_0x8a50('0x182')][_0x8a50('0x125')](db['FaxQueue'],{'onDelete':_0x8a50('0x16c')});db[_0x8a50('0x182')][_0x8a50('0x125')](db['FaxAccount'],{'onDelete':_0x8a50('0x16c')});db[_0x8a50('0x182')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0x8a50('0x17f')});db[_0x8a50('0x4c')][_0x8a50('0x118')](db[_0x8a50('0x4e')],{'as':_0x8a50('0x15f'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x185')});db['FaxInteraction'][_0x8a50('0x125')](db[_0x8a50('0x49')],{'as':_0x8a50('0x176'),'foreignKey':_0x8a50('0x181')});db[_0x8a50('0x4c')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'as':_0x8a50('0x167'),'foreignKey':_0x8a50('0x177')});db[_0x8a50('0x4c')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'as':_0x8a50('0x186'),'foreignKey':_0x8a50('0x117')});db[_0x8a50('0x4c')][_0x8a50('0x129')](db[_0x8a50('0x90')],{'through':_0x8a50('0x187'),'as':_0x8a50('0x179')});db[_0x8a50('0x4c')]['belongsToMany'](db['Tag'],{'through':_0x8a50('0x187'),'as':'ThroughTags'});db[_0x8a50('0x4c')][_0x8a50('0x129')](db[_0x8a50('0x12')],{'as':_0x8a50('0x17a'),'through':_0x8a50('0x188'),'foreignKey':_0x8a50('0x185')});db[_0x8a50('0x4e')]['belongsTo'](db[_0x8a50('0x12')],{'onDelete':_0x8a50('0x116'),'as':_0x8a50('0x12')});db['FaxMessage'][_0x8a50('0x125')](db[_0x8a50('0x4c')],{'as':_0x8a50('0x189'),'foreignKey':'FaxInteractionId'});db[_0x8a50('0x4e')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'onDelete':'cascade','as':'Contact'});db['FaxMessage'][_0x8a50('0x125')](db[_0x8a50('0xe9')],{'as':'Attachment','foreignKey':_0x8a50('0x18a')});db[_0x8a50('0x4e')]['belongsTo'](db[_0x8a50('0x49')],{'as':_0x8a50('0x176'),'foreignKey':_0x8a50('0x181')});db[_0x8a50('0x4f')]['belongsToMany'](db[_0x8a50('0x12')],{'as':_0x8a50('0x15c'),'through':_0x8a50('0x31')});db[_0x8a50('0x4f')][_0x8a50('0x129')](db['Team'],{'through':'team_has_fax_queues','as':_0x8a50('0x15d')});db['FaxQueueReport']['belongsTo'](db['FaxAccount'],{});db[_0x8a50('0x51')]['belongsTo'](db[_0x8a50('0xf6')],{'as':_0x8a50('0x171'),'foreignKey':_0x8a50('0x172')});db[_0x8a50('0x51')]['belongsTo'](db[_0x8a50('0x73')],{'as':'Contact','foreignKey':_0x8a50('0x177')});db[_0x8a50('0x51')][_0x8a50('0x125')](db[_0x8a50('0x4c')],{});db[_0x8a50('0x51')][_0x8a50('0x125')](db[_0x8a50('0x4e')],{});db[_0x8a50('0x51')]['belongsTo'](db[_0x8a50('0x12')],{});db['FaxQueueReport'][_0x8a50('0x125')](db[_0x8a50('0x4f')],{});db[_0x8a50('0x52')]['hasMany'](db[_0x8a50('0x83')],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':_0x8a50('0x116')});db[_0x8a50('0x52')][_0x8a50('0x118')](db[_0x8a50('0x81')],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0x8a50('0x52')][_0x8a50('0x118')](db[_0x8a50('0x18b')],{'as':'Messages','foreignKey':_0x8a50('0x18c')});db[_0x8a50('0x52')][_0x8a50('0x118')](db[_0x8a50('0x55')],{'as':_0x8a50('0x170')});db[_0x8a50('0x52')][_0x8a50('0x118')](db[_0x8a50('0x53')],{'as':_0x8a50('0x183'),'foreignKey':_0x8a50('0x18c'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x52')]['belongsTo'](db['CmList'],{'as':_0x8a50('0x171'),'foreignKey':'ListId'});db[_0x8a50('0x52')][_0x8a50('0x125')](db[_0x8a50('0x88')],{'as':_0x8a50('0x158'),'foreignKey':_0x8a50('0x159')});db[_0x8a50('0x52')][_0x8a50('0x129')](db[_0x8a50('0x12')],{'as':_0x8a50('0x15c'),'through':_0x8a50('0x145')});db[_0x8a50('0x53')]['belongsTo'](db[_0x8a50('0x12')],{'onDelete':'restrict'});db['SmsApplication'][_0x8a50('0x125')](db['SmsQueue'],{'onDelete':_0x8a50('0x16c')});db[_0x8a50('0x53')][_0x8a50('0x125')](db[_0x8a50('0x52')],{'onDelete':'restrict'});db[_0x8a50('0x53')][_0x8a50('0x125')](db[_0x8a50('0x86')],{'onDelete':_0x8a50('0x16c'),'foreignKey':_0x8a50('0x157')});db[_0x8a50('0x53')][_0x8a50('0x125')](db[_0x8a50('0x90')],{'onDelete':_0x8a50('0x16c'),'foreignKey':_0x8a50('0x17f')});db[_0x8a50('0x55')][_0x8a50('0x118')](db[_0x8a50('0x18b')],{'as':_0x8a50('0x15f'),'onDelete':_0x8a50('0x116'),'foreignKey':'SmsInteractionId'});db[_0x8a50('0x55')][_0x8a50('0x125')](db[_0x8a50('0x52')],{'as':_0x8a50('0x176'),'foreignKey':_0x8a50('0x18c')});db[_0x8a50('0x55')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'as':_0x8a50('0x167'),'foreignKey':_0x8a50('0x177')});db[_0x8a50('0x55')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'as':_0x8a50('0x186'),'foreignKey':'UserId'});db[_0x8a50('0x55')][_0x8a50('0x129')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x8a50('0x179')});db['SmsInteraction'][_0x8a50('0x129')](db['Tag'],{'through':_0x8a50('0x18d'),'as':'ThroughTags'});db[_0x8a50('0x55')][_0x8a50('0x129')](db[_0x8a50('0x12')],{'as':'Users','through':_0x8a50('0x12f'),'foreignKey':_0x8a50('0x18e')});db[_0x8a50('0x18b')]['belongsTo'](db[_0x8a50('0x12')],{'as':_0x8a50('0x12')});db[_0x8a50('0x18b')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'onDelete':_0x8a50('0x116'),'as':_0x8a50('0x167')});db[_0x8a50('0x18b')][_0x8a50('0x125')](db[_0x8a50('0x55')],{'onDelete':_0x8a50('0x116'),'as':_0x8a50('0x189'),'foreignKey':_0x8a50('0x18e')});db[_0x8a50('0x18b')][_0x8a50('0x125')](db[_0x8a50('0x52')],{'as':_0x8a50('0x176'),'foreignKey':_0x8a50('0x18c')});db[_0x8a50('0x58')][_0x8a50('0x129')](db[_0x8a50('0x12')],{'as':_0x8a50('0x15c'),'through':_0x8a50('0x33'),'foreignKey':_0x8a50('0x18f')});db['SmsQueue'][_0x8a50('0x129')](db[_0x8a50('0x12b')],{'through':'team_has_sms_queues','as':_0x8a50('0x15d')});db[_0x8a50('0x5a')]['hasMany'](db[_0x8a50('0x83')],{'as':_0x8a50('0x16e'),'foreignKey':_0x8a50('0x190'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x5a')][_0x8a50('0x118')](db[_0x8a50('0x81')],{'as':_0x8a50('0x16f'),'foreignKey':'OpenchannelAccountId'});db[_0x8a50('0x5a')][_0x8a50('0x118')](db[_0x8a50('0x5c')],{'as':_0x8a50('0x170'),'foreignKey':_0x8a50('0x190')});db['OpenchannelAccount'][_0x8a50('0x118')](db[_0x8a50('0x5e')],{'as':_0x8a50('0x15f'),'foreignKey':_0x8a50('0x190')});db['OpenchannelAccount'][_0x8a50('0x118')](db['OpenchannelApplication'],{'as':_0x8a50('0x183'),'foreignKey':'OpenchannelAccountId','onDelete':_0x8a50('0x116')});db['OpenchannelAccount']['belongsTo'](db[_0x8a50('0xf6')],{'as':_0x8a50('0x171'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0x8a50('0x125')](db[_0x8a50('0x88')],{'as':_0x8a50('0x158'),'foreignKey':_0x8a50('0x159')});db[_0x8a50('0x5a')]['belongsToMany'](db['User'],{'as':_0x8a50('0x15c'),'through':'user_has_openchannel_accounts'});db[_0x8a50('0x191')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'onDelete':_0x8a50('0x16c')});db[_0x8a50('0x191')][_0x8a50('0x125')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0x8a50('0x191')][_0x8a50('0x125')](db[_0x8a50('0x5a')],{'onDelete':_0x8a50('0x16c'),'foreignKey':'OpenchannelAccountId'});db[_0x8a50('0x191')][_0x8a50('0x125')](db[_0x8a50('0x86')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x8a50('0x191')][_0x8a50('0x125')](db[_0x8a50('0x90')],{'onDelete':_0x8a50('0x16c'),'foreignKey':_0x8a50('0x17f')});db[_0x8a50('0x5c')][_0x8a50('0x118')](db['OpenchannelMessage'],{'as':'Messages','onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x192')});db[_0x8a50('0x5c')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x8a50('0x176'),'foreignKey':_0x8a50('0x190')});db[_0x8a50('0x5c')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'as':'Contact','foreignKey':_0x8a50('0x177')});db['OpenchannelInteraction']['belongsTo'](db['User'],{'as':_0x8a50('0x186'),'foreignKey':'UserId'});db[_0x8a50('0x5c')][_0x8a50('0x129')](db[_0x8a50('0x90')],{'through':_0x8a50('0x193'),'as':'Tags'});db['OpenchannelInteraction']['belongsToMany'](db[_0x8a50('0x90')],{'through':_0x8a50('0x193'),'as':_0x8a50('0x194')});db[_0x8a50('0x5c')][_0x8a50('0x129')](db[_0x8a50('0x12')],{'as':_0x8a50('0x17a'),'through':'user_has_openchannel_interactions','foreignKey':_0x8a50('0x192')});db[_0x8a50('0x5e')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'onDelete':_0x8a50('0x116'),'as':_0x8a50('0x12')});db[_0x8a50('0x5e')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'onDelete':'cascade','as':_0x8a50('0x167')});db[_0x8a50('0x5e')]['belongsTo'](db[_0x8a50('0x5c')],{'onDelete':'cascade','as':_0x8a50('0x189'),'foreignKey':_0x8a50('0x192')});db[_0x8a50('0x5e')][_0x8a50('0x125')](db['Attachment'],{'as':_0x8a50('0xe9'),'foreignKey':'AttachmentId'});db['OpenchannelMessage']['belongsTo'](db[_0x8a50('0x5a')],{'as':_0x8a50('0x176'),'foreignKey':_0x8a50('0x190')});db[_0x8a50('0x60')][_0x8a50('0x129')](db[_0x8a50('0x12')],{'as':_0x8a50('0x15c'),'through':_0x8a50('0x13a'),'foreignKey':_0x8a50('0x195')});db['OpenchannelQueue'][_0x8a50('0x129')](db['Team'],{'through':'team_has_openchannel_queues','as':_0x8a50('0x15d')});db[_0x8a50('0x13d')]['hasMany'](db[_0x8a50('0x83')],{'as':'Dispositions','foreignKey':_0x8a50('0x17d'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x13d')][_0x8a50('0x118')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x8a50('0x17d')});db[_0x8a50('0x13d')][_0x8a50('0x118')](db['ChatProactiveAction'],{'as':_0x8a50('0x196')});db[_0x8a50('0x13d')][_0x8a50('0x118')](db[_0x8a50('0x66')],{'as':'Interactions'});db[_0x8a50('0x13d')][_0x8a50('0x118')](db[_0x8a50('0x64')],{'as':_0x8a50('0x183'),'foreignKey':_0x8a50('0x17d'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x13d')][_0x8a50('0x118')](db[_0x8a50('0x68')],{'as':_0x8a50('0x15f')});db[_0x8a50('0x13d')]['belongsTo'](db['CmList'],{'as':_0x8a50('0x171'),'foreignKey':_0x8a50('0x172')});db[_0x8a50('0x13d')][_0x8a50('0x125')](db[_0x8a50('0x86')],{'as':'Interval','foreignKey':_0x8a50('0x157')});db['ChatWebsite'][_0x8a50('0x125')](db[_0x8a50('0x39')],{'as':_0x8a50('0x39'),'foreignKey':_0x8a50('0x168')});db['ChatWebsite']['belongsTo'](db[_0x8a50('0x88')],{'as':_0x8a50('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8a50('0x13d')][_0x8a50('0x129')](db[_0x8a50('0x12')],{'as':_0x8a50('0x15c'),'through':_0x8a50('0x13f')});db['OpenchannelQueueReport'][_0x8a50('0x125')](db[_0x8a50('0x5a')],{});db['OpenchannelQueueReport'][_0x8a50('0x125')](db[_0x8a50('0xf6')],{'as':_0x8a50('0x171'),'foreignKey':_0x8a50('0x172')});db[_0x8a50('0x63')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'as':_0x8a50('0x167'),'foreignKey':'ContactId'});db[_0x8a50('0x63')]['belongsTo'](db[_0x8a50('0x5c')],{});db[_0x8a50('0x63')][_0x8a50('0x125')](db[_0x8a50('0x5e')],{});db[_0x8a50('0x63')][_0x8a50('0x125')](db[_0x8a50('0x12')],{});db[_0x8a50('0x63')][_0x8a50('0x125')](db[_0x8a50('0x60')],{});db['ChatApplication'][_0x8a50('0x125')](db[_0x8a50('0x12')],{'as':_0x8a50('0x197'),'foreignKey':'UserId','onDelete':_0x8a50('0x16c')});db[_0x8a50('0x64')][_0x8a50('0x125')](db['ChatQueue'],{'as':_0x8a50('0x198'),'foreignKey':_0x8a50('0x199'),'onDelete':'restrict'});db['ChatApplication'][_0x8a50('0x125')](db[_0x8a50('0x13d')],{'as':_0x8a50('0x19a'),'foreignKey':_0x8a50('0x17d'),'onDelete':_0x8a50('0x16c')});db['ChatApplication'][_0x8a50('0x125')](db[_0x8a50('0x90')],{'onDelete':_0x8a50('0x16c'),'foreignKey':_0x8a50('0x17f')});db[_0x8a50('0x66')][_0x8a50('0x118')](db['ChatMessage'],{'as':_0x8a50('0x15f'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x19b')});db[_0x8a50('0x66')]['belongsTo'](db['ChatWebsite'],{'as':_0x8a50('0x176'),'foreignKey':_0x8a50('0x17d')});db[_0x8a50('0x66')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'as':_0x8a50('0x167'),'foreignKey':_0x8a50('0x177')});db[_0x8a50('0x66')]['belongsTo'](db[_0x8a50('0x12')],{'as':_0x8a50('0x186'),'foreignKey':'UserId'});db['ChatInteraction'][_0x8a50('0x129')](db['Tag'],{'through':_0x8a50('0x19c'),'as':_0x8a50('0x179')});db[_0x8a50('0x66')][_0x8a50('0x129')](db[_0x8a50('0x90')],{'through':_0x8a50('0x19c'),'as':_0x8a50('0x194')});db['ChatInteraction'][_0x8a50('0x129')](db[_0x8a50('0x12')],{'as':_0x8a50('0x17a'),'through':_0x8a50('0x12e'),'foreignKey':_0x8a50('0x19b')});db[_0x8a50('0x68')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'onDelete':_0x8a50('0x116'),'as':_0x8a50('0x12')});db[_0x8a50('0x68')]['belongsTo'](db['CmContact'],{'onDelete':_0x8a50('0x116'),'as':_0x8a50('0x167'),'foreignKey':'ContactId'});db['ChatMessage'][_0x8a50('0x125')](db[_0x8a50('0x66')],{'onDelete':_0x8a50('0x116'),'as':'Interaction','foreignKey':_0x8a50('0x19b')});db[_0x8a50('0x68')][_0x8a50('0x125')](db[_0x8a50('0xe9')],{'as':_0x8a50('0xe9'),'foreignKey':_0x8a50('0x18a')});db[_0x8a50('0x68')]['belongsTo'](db[_0x8a50('0x13d')],{'as':_0x8a50('0x176'),'foreignKey':_0x8a50('0x17d')});db['ChatOfflineMessage'][_0x8a50('0x118')](db['Attachment'],{'as':'Attachments','foreignKey':_0x8a50('0x17e'),'onDelete':_0x8a50('0x116'),'hooks':!![]});db['ChatOfflineMessage'][_0x8a50('0x125')](db[_0x8a50('0x73')],{'onDelete':'cascade','as':_0x8a50('0x167'),'foreignKey':_0x8a50('0x177')});db[_0x8a50('0x6a')][_0x8a50('0x125')](db['ChatWebsite'],{'as':_0x8a50('0x176'),'foreignKey':'ChatWebsiteId'});db[_0x8a50('0x6c')][_0x8a50('0x129')](db[_0x8a50('0x12')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db[_0x8a50('0x6c')]['belongsToMany'](db['Team'],{'through':'team_has_chat_queues','as':_0x8a50('0x15d')});db[_0x8a50('0x6d')]['hasMany'](db['ChatInternalMessage'],{'as':_0x8a50('0x15f'),'foreignKey':_0x8a50('0x19d'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x6d')][_0x8a50('0x129')](db['User'],{'as':_0x8a50('0x14b'),'through':_0x8a50('0x128')});db[_0x8a50('0x6f')][_0x8a50('0x125')](db[_0x8a50('0x13d')],{'as':_0x8a50('0x19a'),'foreignKey':_0x8a50('0x17d')});db['CmCompany'][_0x8a50('0x118')](db[_0x8a50('0x73')],{'as':_0x8a50('0x19e'),'foreignKey':_0x8a50('0x19f')});db[_0x8a50('0x73')][_0x8a50('0x118')](db[_0x8a50('0x92')],{'as':'Phones','foreignKey':_0x8a50('0x1a0')});db[_0x8a50('0x73')]['hasMany'](db[_0x8a50('0x75')],{'as':_0x8a50('0x123'),'foreignKey':_0x8a50('0x177')});db[_0x8a50('0x73')][_0x8a50('0x118')](db[_0x8a50('0x78')],{'as':_0x8a50('0x14d'),'foreignKey':_0x8a50('0x177')});db['CmContact'][_0x8a50('0x118')](db[_0x8a50('0x7a')],{'as':_0x8a50('0x14e'),'foreignKey':_0x8a50('0x177')});db['CmContact'][_0x8a50('0x118')](db['ReportAgentPreview'],{'as':_0x8a50('0x11d'),'foreignKey':_0x8a50('0x177')});db[_0x8a50('0x73')]['hasMany'](db[_0x8a50('0x151')],{'as':_0x8a50('0x152'),'foreignKey':_0x8a50('0x177')});db[_0x8a50('0x73')][_0x8a50('0x118')](db[_0x8a50('0x5c')],{'as':_0x8a50('0x130'),'foreignKey':'ContactId','onDelete':_0x8a50('0x16c')});db[_0x8a50('0x73')][_0x8a50('0x118')](db[_0x8a50('0x66')],{'as':_0x8a50('0x1a1'),'foreignKey':_0x8a50('0x177'),'onDelete':'restrict'});db[_0x8a50('0x73')]['hasMany'](db[_0x8a50('0x55')],{'as':'SmsInteractions','foreignKey':_0x8a50('0x177'),'onDelete':'restrict'});db[_0x8a50('0x73')][_0x8a50('0x118')](db[_0x8a50('0x4c')],{'as':_0x8a50('0x11f'),'foreignKey':_0x8a50('0x177'),'onDelete':_0x8a50('0x16c')});db['CmContact'][_0x8a50('0x118')](db[_0x8a50('0x3f')],{'as':_0x8a50('0x120'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x8a50('0x73')]['belongsTo'](db[_0x8a50('0x71')],{'as':_0x8a50('0x1a2'),'foreignKey':_0x8a50('0x19f')});db[_0x8a50('0x73')][_0x8a50('0x125')](db['CmList'],{'as':_0x8a50('0x171'),'foreignKey':_0x8a50('0x172'),'onDelete':'cascade'});db[_0x8a50('0x73')][_0x8a50('0x129')](db[_0x8a50('0x12')],{'as':_0x8a50('0x17a'),'through':_0x8a50('0x12a')});db[_0x8a50('0x73')][_0x8a50('0x129')](db[_0x8a50('0x90')],{'as':_0x8a50('0x179'),'through':_0x8a50('0x1a3')});db[_0x8a50('0x73')][_0x8a50('0x129')](db[_0x8a50('0x90')],{'through':_0x8a50('0x1a3'),'as':_0x8a50('0x194')});db['CmHopper']['hasMany'](db['CmHopperAdditionalPhone'],{'as':'AdditionalPhones','foreignKey':_0x8a50('0x1a4')});db[_0x8a50('0x75')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'as':_0x8a50('0x167'),'foreignKey':_0x8a50('0x177'),'onDelete':'cascade'});db['CmHopper'][_0x8a50('0x125')](db['CmList'],{'as':'List','foreignKey':_0x8a50('0x172'),'onDelete':'cascade'});db[_0x8a50('0x75')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'as':'Agent','foreignKey':_0x8a50('0x117')});db[_0x8a50('0x75')][_0x8a50('0x125')](db[_0x8a50('0x1c')],{'as':_0x8a50('0x198'),'foreignKey':_0x8a50('0x14c'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x75')][_0x8a50('0x125')](db[_0x8a50('0x1a5')],{'as':_0x8a50('0x1a5'),'foreignKey':_0x8a50('0x1a6'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x75')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'as':'Owner','foreignKey':'OwnerId'});db[_0x8a50('0x14f')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'as':_0x8a50('0x167'),'foreignKey':'ContactId','onDelete':_0x8a50('0x116')});db['CmHopperBlack'][_0x8a50('0x125')](db[_0x8a50('0xf6')],{'as':_0x8a50('0x171'),'foreignKey':_0x8a50('0x172'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0x8a50('0x1c')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0x8a50('0x116')});db[_0x8a50('0x14f')][_0x8a50('0x125')](db[_0x8a50('0x1a5')],{'as':_0x8a50('0x1a5'),'foreignKey':_0x8a50('0x1a6'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x80')]['hasMany'](db[_0x8a50('0x1a7')],{'as':{'plural':_0x8a50('0x1a8'),'singular':_0x8a50('0x1a9')},'foreignKey':_0x8a50('0x1aa'),'onDelete':_0x8a50('0x116'),'hooks':!![]});db[_0x8a50('0x80')][_0x8a50('0x118')](db[_0x8a50('0x1a7')],{'as':{'plural':_0x8a50('0x1ab'),'singular':_0x8a50('0x1ac')},'foreignKey':_0x8a50('0x1ad'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x8a50('0x118')](db[_0x8a50('0x7e')],{'as':_0x8a50('0x1ae'),'foreignKey':_0x8a50('0x1af'),'onDelete':_0x8a50('0x116'),'hooks':!![]});db[_0x8a50('0x83')][_0x8a50('0x118')](db[_0x8a50('0x83')],{'as':_0x8a50('0x16e'),'foreignKey':'ParentId','onDelete':_0x8a50('0x116')});db[_0x8a50('0x86')]['hasMany'](db['Interval'],{'as':'Intervals','foreignKey':_0x8a50('0x157'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x8a50('0x86')][_0x8a50('0x118')](db[_0x8a50('0x18')],{'as':_0x8a50('0x11b'),'foreignKey':'IntervalId','onDelete':_0x8a50('0x16c')});db[_0x8a50('0x86')][_0x8a50('0x118')](db[_0x8a50('0x42')],{'as':_0x8a50('0x1b0'),'foreignKey':_0x8a50('0x157')});db[_0x8a50('0x86')][_0x8a50('0x118')](db[_0x8a50('0x64')],{'as':_0x8a50('0x1b1'),'foreignKey':_0x8a50('0x157')});db[_0x8a50('0x86')][_0x8a50('0x118')](db[_0x8a50('0x182')],{'as':_0x8a50('0x1b2'),'foreignKey':_0x8a50('0x157')});db[_0x8a50('0x86')][_0x8a50('0x118')](db['SmsApplication'],{'as':_0x8a50('0x1b3'),'foreignKey':_0x8a50('0x157')});db[_0x8a50('0x1b4')][_0x8a50('0x125')](db[_0x8a50('0x39')],{});db[_0x8a50('0x1b4')][_0x8a50('0x125')](db['AnalyticDefaultReport'],{'foreignKey':_0x8a50('0x1b5')});db[_0x8a50('0x1b4')][_0x8a50('0x125')](db[_0x8a50('0x9b')],{'foreignKey':'CustomReportId'});db[_0x8a50('0x8e')]['belongsToMany'](db[_0x8a50('0x1a')],{'as':_0x8a50('0x1b6'),'through':'moh_has_sounds','onDelete':_0x8a50('0x16c')});db[_0x8a50('0x90')][_0x8a50('0x129')](db[_0x8a50('0x73')],{'through':_0x8a50('0x1a3')});db['Tag'][_0x8a50('0x129')](db[_0x8a50('0x66')],{'through':_0x8a50('0x19c')});db[_0x8a50('0x90')][_0x8a50('0x129')](db[_0x8a50('0x3f')],{'through':_0x8a50('0x178')});db[_0x8a50('0x90')][_0x8a50('0x129')](db[_0x8a50('0x55')],{'through':'sms_interaction_has_tags'});db['Tag'][_0x8a50('0x129')](db[_0x8a50('0x4c')],{'through':_0x8a50('0x187')});db['Tag']['belongsToMany'](db[_0x8a50('0x5c')],{'through':'openchannel_interaction_has_tags'});db[_0x8a50('0x90')][_0x8a50('0x129')](db['WhatsappInteraction'],{'through':_0x8a50('0x1b7')});db[_0x8a50('0x92')]['belongsTo'](db[_0x8a50('0x91')],{'as':_0x8a50('0x1b8'),'foreignKey':'ItemTypeId'});db[_0x8a50('0x1b9')][_0x8a50('0x125')](db['CmHopper'],{'as':_0x8a50('0x1ba'),'foreignKey':'CmHopperId'});db[_0x8a50('0x92')][_0x8a50('0x125')](db['CmContact'],{'as':_0x8a50('0x167'),'foreignKey':_0x8a50('0x1a0')});db[_0x8a50('0x95')]['hasMany'](db[_0x8a50('0x1a7')],{'as':{'plural':'AllConditions','singular':_0x8a50('0x1bb')},'foreignKey':_0x8a50('0x1bc'),'onDelete':_0x8a50('0x116'),'hooks':!![]});db[_0x8a50('0x95')]['hasMany'](db[_0x8a50('0x1a7')],{'as':{'plural':_0x8a50('0x1bd'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0x8a50('0x116'),'hooks':!![]});db[_0x8a50('0x95')][_0x8a50('0x118')](db['Action'],{'as':_0x8a50('0x1ae'),'foreignKey':'TriggerId','onDelete':_0x8a50('0x116'),'hooks':!![]});db[_0x8a50('0x9b')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x8a50('0x1be'),'onDelete':'cascade','foreignKey':_0x8a50('0x1bf'),'hooks':!![]});db[_0x8a50('0x9d')][_0x8a50('0x118')](db['AnalyticFieldReport'],{'as':_0x8a50('0x1be'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x8a50('0x1c0')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1c1')});db[_0x8a50('0xa1')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x8a50('0xa5')]['hasMany'](db['SalesforceConfiguration'],{'as':_0x8a50('0x1c2'),'onDelete':'cascade','foreignKey':_0x8a50('0x1c3')});db[_0x8a50('0x1c4')]['hasMany'](db['SalesforceField'],{'as':_0x8a50('0x1c5'),'onDelete':_0x8a50('0x116'),'foreignKey':'SubjectId'});db[_0x8a50('0x1c4')]['hasMany'](db[_0x8a50('0xa7')],{'as':_0x8a50('0x1c6'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1c7')});db[_0x8a50('0x1c4')]['hasMany'](db['SalesforceField'],{'as':_0x8a50('0x1be'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1c8')});db[_0x8a50('0x1c4')][_0x8a50('0x125')](db[_0x8a50('0xa5')],{'as':_0x8a50('0x176'),'foreignKey':_0x8a50('0x1c3')});db[_0x8a50('0xa7')]['hasMany'](db[_0x8a50('0xa7')],{'as':_0x8a50('0x1c9'),'foreignKey':'SubjectId'});db[_0x8a50('0xa7')][_0x8a50('0x118')](db['SalesforceField'],{'as':_0x8a50('0x1ca'),'foreignKey':_0x8a50('0x1c7')});db[_0x8a50('0xa7')][_0x8a50('0x118')](db[_0x8a50('0xa7')],{'as':'Field','foreignKey':_0x8a50('0x1c8')});db['SalesforceField'][_0x8a50('0x125')](db['Variable'],{'as':_0x8a50('0x97'),'foreignKey':_0x8a50('0x1cb')});db[_0x8a50('0x1cc')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0x8a50('0x1c2'),'onDelete':_0x8a50('0x116'),'foreignKey':'AccountId'});db[_0x8a50('0xa8')][_0x8a50('0x118')](db['SugarcrmField'],{'as':_0x8a50('0x1c5'),'onDelete':'cascade','foreignKey':_0x8a50('0x1cd')});db[_0x8a50('0xa8')][_0x8a50('0x118')](db[_0x8a50('0x1ce')],{'as':_0x8a50('0x1c6'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1c7')});db[_0x8a50('0xa8')][_0x8a50('0x118')](db[_0x8a50('0x1ce')],{'as':_0x8a50('0x1be'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1c8')});db[_0x8a50('0xa8')][_0x8a50('0x125')](db[_0x8a50('0x1cc')],{'as':_0x8a50('0x176'),'foreignKey':_0x8a50('0x1c3')});db[_0x8a50('0x1ce')][_0x8a50('0x118')](db[_0x8a50('0x1ce')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8a50('0x1ce')][_0x8a50('0x118')](db[_0x8a50('0x1ce')],{'as':_0x8a50('0x1ca'),'foreignKey':_0x8a50('0x1c7')});db[_0x8a50('0x1ce')]['hasMany'](db[_0x8a50('0x1ce')],{'as':_0x8a50('0x1cf'),'foreignKey':_0x8a50('0x1c8')});db[_0x8a50('0x1ce')][_0x8a50('0x125')](db[_0x8a50('0x97')],{'as':_0x8a50('0x97'),'foreignKey':'VariableId'});db[_0x8a50('0x1d0')]['hasMany'](db[_0x8a50('0x1d1')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['DeskConfiguration'][_0x8a50('0x118')](db[_0x8a50('0xad')],{'as':_0x8a50('0x1c5'),'onDelete':_0x8a50('0x116'),'foreignKey':'SubjectId'});db[_0x8a50('0x1d1')][_0x8a50('0x118')](db[_0x8a50('0xad')],{'as':_0x8a50('0x1c6'),'onDelete':'cascade','foreignKey':_0x8a50('0x1c7')});db[_0x8a50('0x1d1')][_0x8a50('0x118')](db[_0x8a50('0xad')],{'as':'Fields','onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1c8')});db['DeskConfiguration']['belongsTo'](db[_0x8a50('0x1d0')],{'as':'Account','foreignKey':_0x8a50('0x1c3')});db['DeskConfiguration']['belongsToMany'](db[_0x8a50('0x90')],{'through':'int_desk_configuration_has_tags'});db[_0x8a50('0xad')][_0x8a50('0x118')](db[_0x8a50('0xad')],{'as':'Subject','foreignKey':_0x8a50('0x1cd')});db['DeskField'][_0x8a50('0x118')](db[_0x8a50('0xad')],{'as':'Description','foreignKey':_0x8a50('0x1c7')});db[_0x8a50('0xad')]['hasMany'](db[_0x8a50('0xad')],{'as':_0x8a50('0x1cf'),'foreignKey':_0x8a50('0x1c8')});db[_0x8a50('0xad')][_0x8a50('0x125')](db['Variable'],{'as':_0x8a50('0x97'),'foreignKey':_0x8a50('0x1cb')});db[_0x8a50('0xae')]['hasMany'](db[_0x8a50('0x1d2')],{'as':_0x8a50('0x1c2'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1c3')});db[_0x8a50('0x1d2')]['hasMany'](db[_0x8a50('0xb0')],{'as':_0x8a50('0x1c5'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1cd')});db[_0x8a50('0x1d2')][_0x8a50('0x118')](db['ZohoField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x8a50('0x1c7')});db['ZohoConfiguration'][_0x8a50('0x118')](db[_0x8a50('0xb0')],{'as':_0x8a50('0x1be'),'onDelete':'cascade','foreignKey':_0x8a50('0x1c8')});db[_0x8a50('0x1d2')][_0x8a50('0x125')](db[_0x8a50('0xae')],{'as':_0x8a50('0x176'),'foreignKey':'AccountId'});db[_0x8a50('0xb0')][_0x8a50('0x118')](db['ZohoField'],{'as':_0x8a50('0x1c9'),'foreignKey':_0x8a50('0x1cd')});db[_0x8a50('0xb0')][_0x8a50('0x118')](db['ZohoField'],{'as':'Description','foreignKey':_0x8a50('0x1c7')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':'Field','foreignKey':'FieldId'});db[_0x8a50('0xb0')][_0x8a50('0x125')](db['Variable'],{'as':_0x8a50('0x97'),'foreignKey':_0x8a50('0x1cb')});db[_0x8a50('0xb2')][_0x8a50('0x118')](db[_0x8a50('0x1d3')],{'as':_0x8a50('0x1c2'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1c3')});db['ZendeskConfiguration'][_0x8a50('0x118')](db['ZendeskField'],{'as':_0x8a50('0x1c5'),'foreignKey':_0x8a50('0x1cd')});db[_0x8a50('0x1d3')][_0x8a50('0x118')](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x8a50('0x1c7')});db[_0x8a50('0x1d3')][_0x8a50('0x118')](db[_0x8a50('0xb5')],{'as':_0x8a50('0x1be'),'foreignKey':_0x8a50('0x1c8')});db[_0x8a50('0x1d3')][_0x8a50('0x125')](db[_0x8a50('0xb2')],{'as':'Account','foreignKey':_0x8a50('0x1c3')});db['ZendeskConfiguration']['belongsToMany'](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0x8a50('0xb5')]['hasMany'](db[_0x8a50('0xb5')],{'as':_0x8a50('0x1c9'),'foreignKey':_0x8a50('0x1cd')});db[_0x8a50('0xb5')][_0x8a50('0x118')](db[_0x8a50('0xb5')],{'as':'Description','foreignKey':_0x8a50('0x1c7')});db[_0x8a50('0xb5')][_0x8a50('0x118')](db[_0x8a50('0xb5')],{'as':_0x8a50('0x1cf'),'foreignKey':'FieldId'});db[_0x8a50('0xb5')][_0x8a50('0x125')](db[_0x8a50('0x97')],{'as':_0x8a50('0x97'),'foreignKey':_0x8a50('0x1cb')});db['FreshdeskAccount'][_0x8a50('0x118')](db[_0x8a50('0xb8')],{'as':_0x8a50('0x1c2'),'onDelete':_0x8a50('0x116'),'foreignKey':'AccountId'});db[_0x8a50('0xb8')][_0x8a50('0x118')](db[_0x8a50('0x1d4')],{'as':_0x8a50('0x1c5'),'onDelete':_0x8a50('0x116'),'foreignKey':'SubjectId'});db[_0x8a50('0xb8')][_0x8a50('0x118')](db[_0x8a50('0x1d4')],{'as':_0x8a50('0x1c6'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x8a50('0xb8')]['hasMany'](db['FreshdeskField'],{'as':_0x8a50('0x1be'),'onDelete':_0x8a50('0x116'),'foreignKey':'FieldId'});db[_0x8a50('0xb8')][_0x8a50('0x125')](db[_0x8a50('0x1d5')],{'as':_0x8a50('0x176'),'foreignKey':_0x8a50('0x1c3')});db[_0x8a50('0xb8')][_0x8a50('0x129')](db[_0x8a50('0x90')],{'through':_0x8a50('0x1d6')});db[_0x8a50('0x1d4')][_0x8a50('0x118')](db['FreshdeskField'],{'as':_0x8a50('0x1c9'),'foreignKey':_0x8a50('0x1cd')});db['FreshdeskField']['hasMany'](db[_0x8a50('0x1d4')],{'as':_0x8a50('0x1ca'),'foreignKey':_0x8a50('0x1c7')});db['FreshdeskField'][_0x8a50('0x118')](db[_0x8a50('0x1d4')],{'as':_0x8a50('0x1cf'),'foreignKey':_0x8a50('0x1c8')});db[_0x8a50('0x1d4')][_0x8a50('0x125')](db[_0x8a50('0x97')],{'as':'Variable','foreignKey':'VariableId'});db['VtigerAccount'][_0x8a50('0x118')](db[_0x8a50('0xbc')],{'as':_0x8a50('0x1c2'),'onDelete':'cascade','foreignKey':_0x8a50('0x1c3')});db['VtigerConfiguration'][_0x8a50('0x118')](db[_0x8a50('0xbd')],{'as':_0x8a50('0x1c5'),'foreignKey':_0x8a50('0x1cd')});db[_0x8a50('0xbc')]['hasMany'](db['VtigerField'],{'as':_0x8a50('0x1c6'),'foreignKey':_0x8a50('0x1c7')});db[_0x8a50('0xbc')][_0x8a50('0x118')](db[_0x8a50('0xbd')],{'as':'Fields','foreignKey':_0x8a50('0x1c8')});db[_0x8a50('0xbc')][_0x8a50('0x125')](db[_0x8a50('0xba')],{'as':'Account','foreignKey':_0x8a50('0x1c3')});db[_0x8a50('0xbd')][_0x8a50('0x118')](db[_0x8a50('0xbd')],{'as':_0x8a50('0x1c9'),'foreignKey':_0x8a50('0x1cd')});db[_0x8a50('0xbd')][_0x8a50('0x118')](db[_0x8a50('0xbd')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x8a50('0xbd')][_0x8a50('0x118')](db[_0x8a50('0xbd')],{'as':'Field','foreignKey':_0x8a50('0x1c8')});db[_0x8a50('0xbd')]['belongsTo'](db[_0x8a50('0x97')],{'as':_0x8a50('0x97'),'foreignKey':_0x8a50('0x1cb')});db[_0x8a50('0xbf')][_0x8a50('0x118')](db['ServicenowConfiguration'],{'as':_0x8a50('0x1c2'),'onDelete':_0x8a50('0x116'),'foreignKey':'AccountId'});db[_0x8a50('0xc1')]['hasMany'](db[_0x8a50('0x1d7')],{'as':_0x8a50('0x1c5'),'foreignKey':_0x8a50('0x1cd')});db[_0x8a50('0xc1')][_0x8a50('0x118')](db[_0x8a50('0x1d7')],{'as':_0x8a50('0x1c6'),'foreignKey':_0x8a50('0x1c7')});db[_0x8a50('0xc1')][_0x8a50('0x118')](db[_0x8a50('0x1d7')],{'as':'Fields','foreignKey':_0x8a50('0x1c8')});db[_0x8a50('0xc1')]['belongsTo'](db[_0x8a50('0xbf')],{'as':'Account','foreignKey':'AccountId'});db['ServicenowField'][_0x8a50('0x118')](db[_0x8a50('0x1d7')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8a50('0x1d7')][_0x8a50('0x118')](db['ServicenowField'],{'as':'Description','foreignKey':_0x8a50('0x1c7')});db[_0x8a50('0x1d7')][_0x8a50('0x118')](db['ServicenowField'],{'as':_0x8a50('0x1cf'),'foreignKey':_0x8a50('0x1c8')});db[_0x8a50('0x1d7')]['belongsTo'](db[_0x8a50('0x97')],{'as':'Variable','foreignKey':_0x8a50('0x1cb')});db['Dynamics365Account']['hasMany'](db[_0x8a50('0xc5')],{'as':_0x8a50('0x1c2'),'onDelete':'cascade','foreignKey':_0x8a50('0x1c3')});db[_0x8a50('0xc4')][_0x8a50('0x125')](db[_0x8a50('0x169')],{'as':_0x8a50('0x169'),'foreignKey':_0x8a50('0x16a')});db[_0x8a50('0xc5')][_0x8a50('0x118')](db[_0x8a50('0xc7')],{'as':_0x8a50('0x1c5'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1cd')});db[_0x8a50('0xc5')][_0x8a50('0x118')](db[_0x8a50('0xc7')],{'as':'Descriptions','onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1c7')});db[_0x8a50('0xc5')][_0x8a50('0x118')](db[_0x8a50('0xc7')],{'as':_0x8a50('0x1be'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1c8')});db['Dynamics365Configuration']['belongsTo'](db[_0x8a50('0xc4')],{'as':_0x8a50('0x176'),'foreignKey':_0x8a50('0x1c3')});db[_0x8a50('0xc7')][_0x8a50('0x118')](db[_0x8a50('0xc7')],{'as':_0x8a50('0x1c9'),'foreignKey':_0x8a50('0x1cd')});db[_0x8a50('0xc7')]['hasMany'](db['Dynamics365Field'],{'as':_0x8a50('0x1ca'),'foreignKey':_0x8a50('0x1c7')});db['Dynamics365Field'][_0x8a50('0x118')](db[_0x8a50('0xc7')],{'as':_0x8a50('0x1cf'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0x8a50('0x125')](db[_0x8a50('0x97')],{'as':'Variable','foreignKey':_0x8a50('0x1cb')});db[_0x8a50('0xc8')][_0x8a50('0x118')](db[_0x8a50('0xca')],{'as':_0x8a50('0x1c2'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1c3')});db[_0x8a50('0xca')]['hasMany'](db[_0x8a50('0x1d8')],{'as':_0x8a50('0x1c5'),'foreignKey':_0x8a50('0x1cd')});db[_0x8a50('0xca')]['hasMany'](db[_0x8a50('0x1d8')],{'as':'Descriptions','foreignKey':_0x8a50('0x1c7')});db[_0x8a50('0xca')]['hasMany'](db[_0x8a50('0x1d8')],{'as':_0x8a50('0x1be'),'foreignKey':'FieldId'});db['FreshsalesConfiguration']['belongsTo'](db[_0x8a50('0xc8')],{'as':_0x8a50('0x176'),'foreignKey':_0x8a50('0x1c3')});db[_0x8a50('0x1d8')][_0x8a50('0x118')](db['FreshsalesField'],{'as':'Subject','foreignKey':_0x8a50('0x1cd')});db['FreshsalesField']['hasMany'](db[_0x8a50('0x1d8')],{'as':_0x8a50('0x1ca'),'foreignKey':_0x8a50('0x1c7')});db['FreshsalesField'][_0x8a50('0x118')](db[_0x8a50('0x1d8')],{'as':_0x8a50('0x1cf'),'foreignKey':_0x8a50('0x1c8')});db[_0x8a50('0x1d8')][_0x8a50('0x125')](db[_0x8a50('0x97')],{'as':_0x8a50('0x97'),'foreignKey':_0x8a50('0x1cb')});db[_0x8a50('0x1d9')]['belongsTo'](db[_0x8a50('0x13d')],{});db[_0x8a50('0x1d9')]['belongsTo'](db[_0x8a50('0xf6')],{'as':_0x8a50('0x171'),'foreignKey':_0x8a50('0x172')});db['ChatQueueReport'][_0x8a50('0x125')](db['CmContact'],{'as':_0x8a50('0x167'),'foreignKey':_0x8a50('0x177')});db[_0x8a50('0x1d9')][_0x8a50('0x125')](db[_0x8a50('0x66')],{});db[_0x8a50('0x1d9')][_0x8a50('0x125')](db[_0x8a50('0x68')],{});db['ChatQueueReport'][_0x8a50('0x125')](db[_0x8a50('0x12')],{});db[_0x8a50('0x1d9')][_0x8a50('0x125')](db[_0x8a50('0x6c')],{});db[_0x8a50('0xce')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1da')});db['ChatInternalMessage'][_0x8a50('0x125')](db[_0x8a50('0x12')],{'onDelete':'cascade','foreignKey':_0x8a50('0x1db')});db[_0x8a50('0x151')][_0x8a50('0x118')](db[_0x8a50('0xd2')],{'foreignKey':_0x8a50('0x1dc'),'onDelete':'cascade'});db[_0x8a50('0x151')][_0x8a50('0x118')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x8a50('0x1dd')]['belongsTo'](db[_0x8a50('0x52')],{});db[_0x8a50('0x1dd')][_0x8a50('0x125')](db['CmList'],{'as':_0x8a50('0x171'),'foreignKey':_0x8a50('0x172')});db[_0x8a50('0x1dd')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'as':_0x8a50('0x167'),'foreignKey':_0x8a50('0x177')});db[_0x8a50('0x1dd')][_0x8a50('0x125')](db[_0x8a50('0x55')],{});db[_0x8a50('0x1dd')]['belongsTo'](db[_0x8a50('0x18b')],{});db[_0x8a50('0x1dd')][_0x8a50('0x125')](db[_0x8a50('0x12')],{});db[_0x8a50('0x1dd')][_0x8a50('0x125')](db[_0x8a50('0x58')],{});db[_0x8a50('0xd9')][_0x8a50('0x118')](db[_0x8a50('0x151')],{'foreignKey':_0x8a50('0x1de')});db['JscriptyProject']['hasMany'](db[_0x8a50('0xd2')],{'foreignKey':_0x8a50('0x1de')});db[_0x8a50('0xd9')][_0x8a50('0x118')](db[_0x8a50('0xd0')],{'foreignKey':'ProjectId'});db[_0x8a50('0x12b')]['belongsToMany'](db[_0x8a50('0x12')],{'as':_0x8a50('0x15c'),'through':_0x8a50('0x12c')});db[_0x8a50('0x12b')][_0x8a50('0x129')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0x8a50('0x1df')});db[_0x8a50('0x12b')]['belongsToMany'](db['MailQueue'],{'through':_0x8a50('0x175'),'as':'MailQueues'});db[_0x8a50('0x12b')][_0x8a50('0x129')](db[_0x8a50('0x6c')],{'through':'team_has_chat_queues','as':_0x8a50('0x135')});db[_0x8a50('0x12b')][_0x8a50('0x129')](db[_0x8a50('0x4f')],{'through':_0x8a50('0x1e0'),'as':_0x8a50('0x137')});db[_0x8a50('0x12b')][_0x8a50('0x129')](db[_0x8a50('0x58')],{'through':_0x8a50('0x1e1'),'as':_0x8a50('0x138')});db['Team'][_0x8a50('0x129')](db['OpenchannelQueue'],{'through':_0x8a50('0x1e2'),'as':_0x8a50('0x139')});db[_0x8a50('0x12b')][_0x8a50('0x129')](db[_0x8a50('0x109')],{'through':'team_has_whatsapp_queues','as':_0x8a50('0x13b')});db['Team'][_0x8a50('0x129')](db[_0x8a50('0xf7')],{'through':_0x8a50('0x10c'),'as':_0x8a50('0x132')});db[_0x8a50('0x1a5')][_0x8a50('0x118')](db[_0x8a50('0x75')],{'as':_0x8a50('0x123'),'foreignKey':_0x8a50('0x1a6')});db[_0x8a50('0x1a5')][_0x8a50('0x118')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x8a50('0x1a6')});db['Campaign'][_0x8a50('0x118')](db[_0x8a50('0x7a')],{'as':'HopperHistories','foreignKey':_0x8a50('0x1a6')});db[_0x8a50('0x1a5')][_0x8a50('0x118')](db[_0x8a50('0x14f')],{'as':_0x8a50('0x150'),'foreignKey':_0x8a50('0x1a6')});db[_0x8a50('0x1a5')][_0x8a50('0x125')](db[_0x8a50('0x153')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x8a50('0x1a5')][_0x8a50('0x125')](db['Trunk'],{'as':_0x8a50('0x155'),'foreignKey':_0x8a50('0x156')});db[_0x8a50('0x1a5')][_0x8a50('0x125')](db[_0x8a50('0x86')],{'as':_0x8a50('0x86'),'foreignKey':_0x8a50('0x157')});db[_0x8a50('0x1a5')]['belongsTo'](db['SquareProject'],{'as':'SquareProject','foreignKey':_0x8a50('0x1e3')});db[_0x8a50('0x1a5')][_0x8a50('0x129')](db['CmList'],{'as':_0x8a50('0x15a'),'through':_0x8a50('0x1e4')});db[_0x8a50('0x1a5')][_0x8a50('0x129')](db[_0x8a50('0xf6')],{'as':_0x8a50('0x15e'),'through':_0x8a50('0x1e5')});db['Attachment']['belongsTo'](db[_0x8a50('0x6a')],{'as':'ChatOfflineMessage','foreignKey':_0x8a50('0x17e')});db[_0x8a50('0xec')][_0x8a50('0x125')](db[_0x8a50('0x40')],{});db[_0x8a50('0xec')][_0x8a50('0x125')](db[_0x8a50('0x3f')],{});db[_0x8a50('0xec')][_0x8a50('0x125')](db[_0x8a50('0x39')],{'foreignKey':_0x8a50('0x1e6'),'as':_0x8a50('0x1e7')});db[_0x8a50('0xec')][_0x8a50('0x125')](db['User'],{'foreignKey':_0x8a50('0x1e8'),'as':_0x8a50('0x1e9')});db['MailTransferReport'][_0x8a50('0x125')](db[_0x8a50('0x12')],{'foreignKey':_0x8a50('0x1ea'),'as':_0x8a50('0x1eb')});db[_0x8a50('0xec')][_0x8a50('0x125')](db[_0x8a50('0x3b')],{'foreignKey':_0x8a50('0x1ec'),'as':_0x8a50('0x1ed')});db[_0x8a50('0xec')][_0x8a50('0x125')](db[_0x8a50('0x39')],{'foreignKey':'ToMailAccountId','as':_0x8a50('0x1ee')});db[_0x8a50('0xee')]['belongsTo'](db[_0x8a50('0x68')],{});db[_0x8a50('0xee')]['belongsTo'](db[_0x8a50('0x66')],{});db[_0x8a50('0xee')][_0x8a50('0x125')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x8a50('0x1e7')});db[_0x8a50('0xee')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'foreignKey':'FromUserId','as':_0x8a50('0x1e9')});db[_0x8a50('0xee')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'foreignKey':'ToUserId','as':_0x8a50('0x1eb')});db[_0x8a50('0xee')][_0x8a50('0x125')](db[_0x8a50('0x6c')],{'foreignKey':'ToChatQueueId','as':_0x8a50('0x1ed')});db['ChatTransferReport']['belongsTo'](db[_0x8a50('0x13d')],{'foreignKey':_0x8a50('0x1ef'),'as':_0x8a50('0x1ee')});db[_0x8a50('0xf0')][_0x8a50('0x125')](db[_0x8a50('0x4e')],{});db[_0x8a50('0xf0')][_0x8a50('0x125')](db[_0x8a50('0x4c')],{});db[_0x8a50('0xf0')][_0x8a50('0x125')](db[_0x8a50('0x49')],{'foreignKey':'FromFaxAccountId','as':_0x8a50('0x1e7')});db[_0x8a50('0xf0')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'foreignKey':_0x8a50('0x1e8'),'as':_0x8a50('0x1e9')});db['FaxTransferReport']['belongsTo'](db[_0x8a50('0x12')],{'foreignKey':_0x8a50('0x1ea'),'as':_0x8a50('0x1eb')});db['FaxTransferReport'][_0x8a50('0x125')](db[_0x8a50('0x4f')],{'foreignKey':_0x8a50('0x1f0'),'as':_0x8a50('0x1ed')});db[_0x8a50('0xf0')][_0x8a50('0x125')](db[_0x8a50('0x49')],{'foreignKey':_0x8a50('0x1f1'),'as':_0x8a50('0x1ee')});db[_0x8a50('0xf2')][_0x8a50('0x125')](db[_0x8a50('0x5e')],{});db[_0x8a50('0xf2')]['belongsTo'](db[_0x8a50('0x5c')],{});db[_0x8a50('0xf2')][_0x8a50('0x125')](db[_0x8a50('0x5a')],{'foreignKey':_0x8a50('0x1f2'),'as':_0x8a50('0x1e7')});db['OpenchannelTransferReport']['belongsTo'](db[_0x8a50('0x12')],{'foreignKey':_0x8a50('0x1e8'),'as':_0x8a50('0x1e9')});db['OpenchannelTransferReport'][_0x8a50('0x125')](db[_0x8a50('0x12')],{'foreignKey':'ToUserId','as':_0x8a50('0x1eb')});db[_0x8a50('0xf2')]['belongsTo'](db[_0x8a50('0x60')],{'foreignKey':_0x8a50('0x1f3'),'as':_0x8a50('0x1ed')});db[_0x8a50('0xf2')][_0x8a50('0x125')](db[_0x8a50('0x5a')],{'foreignKey':_0x8a50('0x1f4'),'as':_0x8a50('0x1ee')});db[_0x8a50('0xf4')]['belongsTo'](db[_0x8a50('0x18b')],{});db[_0x8a50('0xf4')]['belongsTo'](db[_0x8a50('0x55')],{});db[_0x8a50('0xf4')][_0x8a50('0x125')](db[_0x8a50('0x52')],{'foreignKey':'FromSmsAccountId','as':_0x8a50('0x1e7')});db[_0x8a50('0xf4')][_0x8a50('0x125')](db[_0x8a50('0x12')],{'foreignKey':_0x8a50('0x1e8'),'as':_0x8a50('0x1e9')});db[_0x8a50('0xf4')]['belongsTo'](db[_0x8a50('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x8a50('0xf4')][_0x8a50('0x125')](db[_0x8a50('0x58')],{'foreignKey':'ToSmsQueueId','as':_0x8a50('0x1ed')});db['SmsTransferReport'][_0x8a50('0x125')](db['SmsAccount'],{'foreignKey':_0x8a50('0x1f5'),'as':'ToAccount'});db[_0x8a50('0xf6')][_0x8a50('0x118')](db[_0x8a50('0x83')],{'as':_0x8a50('0x16e'),'foreignKey':_0x8a50('0x172'),'onDelete':'cascade'});db[_0x8a50('0xf6')]['hasMany'](db[_0x8a50('0x7c')],{'as':_0x8a50('0x1f6'),'foreignKey':_0x8a50('0x172')});db['CmList']['hasMany'](db['CmContact'],{'as':_0x8a50('0x19e'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x172')});db[_0x8a50('0xf6')][_0x8a50('0x118')](db[_0x8a50('0x78')],{'as':_0x8a50('0x14d'),'foreignKey':_0x8a50('0x172')});db[_0x8a50('0xf6')][_0x8a50('0x118')](db[_0x8a50('0x7a')],{'as':_0x8a50('0x11c'),'foreignKey':'ListId'});db['CmList'][_0x8a50('0x118')](db[_0x8a50('0x11d')],{'as':_0x8a50('0x11d'),'foreignKey':'ListId'});db[_0x8a50('0xf6')][_0x8a50('0x129')](db[_0x8a50('0x1c')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0x8a50('0xf6')]['belongsToMany'](db['User'],{'as':_0x8a50('0x15c'),'through':_0x8a50('0x13c')});db['VoicePrefix'][_0x8a50('0x118')](db[_0x8a50('0x18')],{'as':_0x8a50('0x11b'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0xf7')][_0x8a50('0x129')](db['User'],{'as':_0x8a50('0x15c'),'through':_0x8a50('0x10e')});db[_0x8a50('0xf7')][_0x8a50('0x129')](db[_0x8a50('0x12b')],{'through':_0x8a50('0x10c'),'as':_0x8a50('0x15d')});db[_0x8a50('0xf9')][_0x8a50('0x118')](db[_0x8a50('0x12')],{'as':_0x8a50('0x17a'),'foreignKey':'userProfileId'});db[_0x8a50('0xf9')][_0x8a50('0x118')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0x8a50('0x126'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x1f7')][_0x8a50('0x118')](db['UserProfileResource'],{'as':'Resources','foreignKey':'sectionId','onDelete':_0x8a50('0x116')});db[_0x8a50('0x100')][_0x8a50('0x118')](db[_0x8a50('0x83')],{'as':'Dispositions','foreignKey':_0x8a50('0x1f8'),'onDelete':_0x8a50('0x116')});db[_0x8a50('0x100')][_0x8a50('0x118')](db[_0x8a50('0x81')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0x8a50('0x100')]['hasMany'](db['WhatsappMessage'],{'as':_0x8a50('0x15f'),'foreignKey':_0x8a50('0x1f8')});db['WhatsappAccount'][_0x8a50('0x118')](db[_0x8a50('0x104')],{'as':_0x8a50('0x170')});db[_0x8a50('0x100')][_0x8a50('0x118')](db[_0x8a50('0x102')],{'as':_0x8a50('0x183'),'foreignKey':_0x8a50('0x1f8'),'onDelete':'cascade'});db['WhatsappAccount']['belongsTo'](db[_0x8a50('0xf6')],{'as':_0x8a50('0x171'),'foreignKey':_0x8a50('0x172')});db[_0x8a50('0x100')][_0x8a50('0x125')](db[_0x8a50('0x88')],{'as':_0x8a50('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8a50('0x100')]['belongsToMany'](db[_0x8a50('0x12')],{'as':_0x8a50('0x15c'),'through':_0x8a50('0x1f9')});db['WhatsappApplication']['belongsTo'](db[_0x8a50('0x12')],{'onDelete':'restrict'});db[_0x8a50('0x102')][_0x8a50('0x125')](db[_0x8a50('0x109')],{'onDelete':_0x8a50('0x16c')});db[_0x8a50('0x102')][_0x8a50('0x125')](db[_0x8a50('0x100')],{'onDelete':'restrict'});db[_0x8a50('0x102')]['belongsTo'](db[_0x8a50('0x86')],{'onDelete':'restrict','foreignKey':_0x8a50('0x157')});db['WhatsappApplication']['belongsTo'](db[_0x8a50('0x90')],{'onDelete':_0x8a50('0x16c'),'foreignKey':_0x8a50('0x17f')});db[_0x8a50('0x104')][_0x8a50('0x118')](db[_0x8a50('0x106')],{'as':_0x8a50('0x15f'),'onDelete':_0x8a50('0x116'),'foreignKey':_0x8a50('0x1fa')});db['WhatsappInteraction'][_0x8a50('0x125')](db[_0x8a50('0x100')],{'as':_0x8a50('0x176'),'foreignKey':'WhatsappAccountId'});db[_0x8a50('0x104')]['belongsTo'](db[_0x8a50('0x73')],{'as':_0x8a50('0x167'),'foreignKey':'ContactId'});db['WhatsappInteraction']['belongsTo'](db['User'],{'as':_0x8a50('0x186'),'foreignKey':'UserId'});db[_0x8a50('0x104')][_0x8a50('0x129')](db[_0x8a50('0x90')],{'through':_0x8a50('0x1b7'),'as':_0x8a50('0x179')});db[_0x8a50('0x104')]['belongsToMany'](db[_0x8a50('0x90')],{'through':_0x8a50('0x1b7'),'as':_0x8a50('0x194')});db[_0x8a50('0x104')]['belongsToMany'](db[_0x8a50('0x12')],{'as':_0x8a50('0x17a'),'through':_0x8a50('0x131'),'foreignKey':_0x8a50('0x1fa')});db[_0x8a50('0x106')]['belongsTo'](db[_0x8a50('0x12')],{'as':_0x8a50('0x12')});db[_0x8a50('0x106')]['belongsTo'](db[_0x8a50('0x73')],{'onDelete':_0x8a50('0x116'),'as':_0x8a50('0x167')});db[_0x8a50('0x106')][_0x8a50('0x125')](db[_0x8a50('0x104')],{'onDelete':_0x8a50('0x116'),'as':_0x8a50('0x189'),'foreignKey':_0x8a50('0x1fa')});db[_0x8a50('0x106')]['belongsTo'](db[_0x8a50('0x100')],{'as':'Account','foreignKey':_0x8a50('0x1f8')});db[_0x8a50('0x107')][_0x8a50('0x125')](db['WhatsappAccount'],{});db[_0x8a50('0x107')][_0x8a50('0x125')](db[_0x8a50('0xf6')],{'as':_0x8a50('0x171'),'foreignKey':_0x8a50('0x172')});db[_0x8a50('0x107')][_0x8a50('0x125')](db[_0x8a50('0x73')],{'as':'Contact','foreignKey':_0x8a50('0x177')});db[_0x8a50('0x107')][_0x8a50('0x125')](db[_0x8a50('0x104')],{});db[_0x8a50('0x107')]['belongsTo'](db[_0x8a50('0x109')],{});db[_0x8a50('0x107')]['belongsTo'](db['WhatsappMessage'],{});db[_0x8a50('0x107')][_0x8a50('0x125')](db[_0x8a50('0x12')],{});db[_0x8a50('0x108')]['belongsTo'](db[_0x8a50('0x106')],{});db['WhatsappTransferReport'][_0x8a50('0x125')](db[_0x8a50('0x104')],{});db['WhatsappTransferReport'][_0x8a50('0x125')](db[_0x8a50('0x100')],{'foreignKey':_0x8a50('0x1fb'),'as':_0x8a50('0x1e7')});db[_0x8a50('0x108')]['belongsTo'](db[_0x8a50('0x100')],{'foreignKey':_0x8a50('0x1fc'),'as':_0x8a50('0x1ee')});db[_0x8a50('0x108')][_0x8a50('0x125')](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0x8a50('0x1ed')});db['WhatsappTransferReport'][_0x8a50('0x125')](db[_0x8a50('0x12')],{'foreignKey':_0x8a50('0x1e8'),'as':'FromAgent'});db[_0x8a50('0x108')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db['WhatsappQueue'][_0x8a50('0x129')](db['User'],{'as':'Agents','through':_0x8a50('0x35'),'foreignKey':_0x8a50('0x1fd')});db[_0x8a50('0x109')][_0x8a50('0x129')](db[_0x8a50('0x12b')],{'through':'team_has_whatsapp_queues','as':'Teams'});db[_0x8a50('0x114')]['belongsTo'](db['User'],{'as':_0x8a50('0x1fe'),'foreignKey':_0x8a50('0x117'),'onDelete':_0x8a50('0x116'),'hooks':!![]});db[_0x8a50('0x169')][_0x8a50('0x113')](db[_0x8a50('0xc4')],{'as':_0x8a50('0xc4'),'onDelete':'restrict'});db[_0x8a50('0x169')][_0x8a50('0x113')](db[_0x8a50('0x37')],{'as':'Imap','onDelete':_0x8a50('0x16c')});db[_0x8a50('0x169')][_0x8a50('0x113')](db['MailServerOut'],{'as':'Smtp','onDelete':_0x8a50('0x16c')});module[_0x8a50('0x1ff')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 22b22d9..b66983f 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3564=['./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.9.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','route','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/contactItemType','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts'];(function(_0x5413ee,_0x1d0618){var _0x33f555=function(_0x4d61a7){while(--_0x4d61a7){_0x5413ee['push'](_0x5413ee['shift']());}};_0x33f555(++_0x1d0618);}(_0x3564,0x14f));var _0x4356=function(_0xd06b24,_0x1ed7dc){_0xd06b24=_0xd06b24-0x0;var _0x26df93=_0x3564[_0xd06b24];return _0x26df93;};'use strict';var path=require(_0x4356('0x0'));var express=require(_0x4356('0x1'));var errors=require(_0x4356('0x2'));var config=require(_0x4356('0x3'));var setupLoggers=require(_0x4356('0x4'))[_0x4356('0x5')];var clientSideLogs=require(_0x4356('0x6'));exports[_0x4356('0x7')]=function(_0x55c78f){return setupLoggers(_0x55c78f)[_0x4356('0x8')](function(){_0x55c78f[_0x4356('0x9')](_0x4356('0xa'),require(_0x4356('0xb')));_0x55c78f['use'](_0x4356('0xc'),require('./api/voiceChanSpy'));_0x55c78f[_0x4356('0x9')](_0x4356('0xd'),require('./api/voiceContext'));_0x55c78f['use']('/api/voice/extensions',require(_0x4356('0xe')));_0x55c78f[_0x4356('0x9')](_0x4356('0xf'),require(_0x4356('0x10')));_0x55c78f[_0x4356('0x9')](_0x4356('0x11'),require(_0x4356('0x12')));_0x55c78f[_0x4356('0x9')](_0x4356('0x13'),require(_0x4356('0x14')));_0x55c78f['use']('/api/screen/recordings',require(_0x4356('0x15')));_0x55c78f[_0x4356('0x9')](_0x4356('0x16'),require(_0x4356('0x17')));_0x55c78f[_0x4356('0x9')]('/api/voice/mails/messages',require(_0x4356('0x18')));_0x55c78f[_0x4356('0x9')](_0x4356('0x19'),require(_0x4356('0x1a')));_0x55c78f[_0x4356('0x9')](_0x4356('0x1b'),require('./api/voiceDialReport'));_0x55c78f[_0x4356('0x9')](_0x4356('0x1c'),require(_0x4356('0x1d')));_0x55c78f[_0x4356('0x9')](_0x4356('0x1e'),require(_0x4356('0x1f')));_0x55c78f['use'](_0x4356('0x20'),require(_0x4356('0x21')));_0x55c78f['use'](_0x4356('0x22'),require(_0x4356('0x23')));_0x55c78f['use'](_0x4356('0x24'),require('./api/voiceTransferReport'));_0x55c78f[_0x4356('0x9')]('/api/mail/out_servers',require(_0x4356('0x25')));_0x55c78f['use'](_0x4356('0x26'),require(_0x4356('0x27')));_0x55c78f[_0x4356('0x9')](_0x4356('0x28'),require('./api/mailQueue'));_0x55c78f[_0x4356('0x9')](_0x4356('0x29'),require('./api/mailSubstatus'));_0x55c78f[_0x4356('0x9')](_0x4356('0x2a'),require(_0x4356('0x2b')));_0x55c78f[_0x4356('0x9')]('/api/mail/messages',require(_0x4356('0x2c')));_0x55c78f['use'](_0x4356('0x2d'),require('./api/mailApplication'));_0x55c78f[_0x4356('0x9')]('/api/mail/reports/queue',require(_0x4356('0x2e')));_0x55c78f[_0x4356('0x9')](_0x4356('0x2f'),require(_0x4356('0x30')));_0x55c78f['use'](_0x4356('0x31'),require(_0x4356('0x32')));_0x55c78f[_0x4356('0x9')](_0x4356('0x33'),require(_0x4356('0x34')));_0x55c78f[_0x4356('0x9')](_0x4356('0x35'),require(_0x4356('0x36')));_0x55c78f[_0x4356('0x9')](_0x4356('0x37'),require(_0x4356('0x38')));_0x55c78f['use'](_0x4356('0x39'),require(_0x4356('0x3a')));_0x55c78f[_0x4356('0x9')]('/api/fax/queues',require(_0x4356('0x3b')));_0x55c78f[_0x4356('0x9')](_0x4356('0x3c'),require(_0x4356('0x3d')));_0x55c78f[_0x4356('0x9')]('/api/sms/accounts',require(_0x4356('0x3e')));_0x55c78f[_0x4356('0x9')](_0x4356('0x3f'),require(_0x4356('0x40')));_0x55c78f[_0x4356('0x9')](_0x4356('0x41'),require(_0x4356('0x42')));_0x55c78f['use'](_0x4356('0x43'),require('./api/smsMessage'));_0x55c78f[_0x4356('0x9')](_0x4356('0x44'),require('./api/smsQueue'));_0x55c78f[_0x4356('0x9')]('/api/openchannel/accounts',require(_0x4356('0x45')));_0x55c78f['use'](_0x4356('0x46'),require(_0x4356('0x47')));_0x55c78f['use'](_0x4356('0x48'),require(_0x4356('0x49')));_0x55c78f['use'](_0x4356('0x4a'),require('./api/openchannelMessage'));_0x55c78f[_0x4356('0x9')](_0x4356('0x4b'),require(_0x4356('0x4c')));_0x55c78f[_0x4356('0x9')]('/api/chat/websites',require('./api/chatWebsite'));_0x55c78f['use'](_0x4356('0x4d'),require(_0x4356('0x4e')));_0x55c78f[_0x4356('0x9')](_0x4356('0x4f'),require(_0x4356('0x50')));_0x55c78f[_0x4356('0x9')](_0x4356('0x51'),require('./api/chatInteraction'));_0x55c78f['use'](_0x4356('0x52'),require('./api/chatMessage'));_0x55c78f[_0x4356('0x9')](_0x4356('0x53'),require(_0x4356('0x54')));_0x55c78f[_0x4356('0x9')]('/api/chat/queues',require(_0x4356('0x55')));_0x55c78f[_0x4356('0x9')](_0x4356('0x56'),require(_0x4356('0x57')));_0x55c78f[_0x4356('0x9')](_0x4356('0x58'),require(_0x4356('0x59')));_0x55c78f[_0x4356('0x9')]('/api/cm/companies',require(_0x4356('0x5a')));_0x55c78f[_0x4356('0x9')](_0x4356('0x5b'),require(_0x4356('0x5c')));_0x55c78f[_0x4356('0x9')]('/api/cm/hopper',require(_0x4356('0x5d')));_0x55c78f[_0x4356('0x9')]('/api/cm/hopper_black',require(_0x4356('0x5e')));_0x55c78f[_0x4356('0x9')](_0x4356('0x5f'),require(_0x4356('0x60')));_0x55c78f[_0x4356('0x9')](_0x4356('0x61'),require(_0x4356('0x62')));_0x55c78f[_0x4356('0x9')](_0x4356('0x63'),require(_0x4356('0x64')));_0x55c78f[_0x4356('0x9')](_0x4356('0x65'),require(_0x4356('0x66')));_0x55c78f[_0x4356('0x9')](_0x4356('0x67'),require(_0x4356('0x68')));_0x55c78f[_0x4356('0x9')](_0x4356('0x69'),require(_0x4356('0x6a')));_0x55c78f['use'](_0x4356('0x6b'),require(_0x4356('0x6c')));_0x55c78f[_0x4356('0x9')](_0x4356('0x6d'),require(_0x4356('0x6e')));_0x55c78f[_0x4356('0x9')](_0x4356('0x6f'),require(_0x4356('0x70')));_0x55c78f[_0x4356('0x9')](_0x4356('0x71'),require('./api/pause'));_0x55c78f[_0x4356('0x9')](_0x4356('0x72'),require(_0x4356('0x73')));_0x55c78f[_0x4356('0x9')](_0x4356('0x74'),require(_0x4356('0x75')));_0x55c78f[_0x4356('0x9')](_0x4356('0x76'),require(_0x4356('0x77')));_0x55c78f[_0x4356('0x9')](_0x4356('0x78'),require(_0x4356('0x79')));_0x55c78f[_0x4356('0x9')](_0x4356('0x7a'),require('./api/tag'));_0x55c78f[_0x4356('0x9')]('/api/contact_item_types',require(_0x4356('0x7b')));_0x55c78f[_0x4356('0x9')]('/api/cm_contact_has_items',require('./api/cmContactHasItem'));_0x55c78f[_0x4356('0x9')](_0x4356('0x7c'),require(_0x4356('0x7d')));_0x55c78f[_0x4356('0x9')](_0x4356('0x7e'),require(_0x4356('0x7f')));_0x55c78f[_0x4356('0x9')](_0x4356('0x80'),require('./api/trigger'));_0x55c78f[_0x4356('0x9')](_0x4356('0x81'),require(_0x4356('0x82')));_0x55c78f[_0x4356('0x9')](_0x4356('0x83'),require(_0x4356('0x84')));_0x55c78f['use'](_0x4356('0x85'),require('./api/integrationReport'));_0x55c78f['use'](_0x4356('0x86'),require(_0x4356('0x87')));_0x55c78f['use'](_0x4356('0x88'),require(_0x4356('0x89')));_0x55c78f[_0x4356('0x9')](_0x4356('0x8a'),require(_0x4356('0x8b')));_0x55c78f[_0x4356('0x9')](_0x4356('0x8c'),require(_0x4356('0x8d')));_0x55c78f[_0x4356('0x9')](_0x4356('0x8e'),require(_0x4356('0x8f')));_0x55c78f[_0x4356('0x9')](_0x4356('0x90'),require('./api/analyticTreeReport'));_0x55c78f[_0x4356('0x9')](_0x4356('0x91'),require('./api/intSalesforceAccount'));_0x55c78f[_0x4356('0x9')]('/api/integrations/salesforce/configurations',require(_0x4356('0x92')));_0x55c78f[_0x4356('0x9')](_0x4356('0x93'),require(_0x4356('0x94')));_0x55c78f[_0x4356('0x9')](_0x4356('0x95'),require('./api/intSugarcrmAccount'));_0x55c78f[_0x4356('0x9')]('/api/integrations/sugarcrm/configurations',require(_0x4356('0x96')));_0x55c78f[_0x4356('0x9')](_0x4356('0x97'),require(_0x4356('0x98')));_0x55c78f[_0x4356('0x9')](_0x4356('0x99'),require(_0x4356('0x9a')));_0x55c78f['use'](_0x4356('0x9b'),require(_0x4356('0x9c')));_0x55c78f[_0x4356('0x9')]('/api/integrations/desk/fields',require(_0x4356('0x9d')));_0x55c78f[_0x4356('0x9')](_0x4356('0x9e'),require(_0x4356('0x9f')));_0x55c78f[_0x4356('0x9')](_0x4356('0xa0'),require(_0x4356('0xa1')));_0x55c78f[_0x4356('0x9')](_0x4356('0xa2'),require(_0x4356('0xa3')));_0x55c78f[_0x4356('0x9')](_0x4356('0xa4'),require(_0x4356('0xa5')));_0x55c78f[_0x4356('0x9')](_0x4356('0xa6'),require('./api/intZendeskConfiguration'));_0x55c78f[_0x4356('0x9')](_0x4356('0xa7'),require(_0x4356('0xa8')));_0x55c78f[_0x4356('0x9')](_0x4356('0xa9'),require(_0x4356('0xaa')));_0x55c78f[_0x4356('0x9')](_0x4356('0xab'),require(_0x4356('0xac')));_0x55c78f[_0x4356('0x9')]('/api/integrations/freshdesk/fields',require(_0x4356('0xad')));_0x55c78f['use']('/api/integrations/vtiger/accounts',require(_0x4356('0xae')));_0x55c78f[_0x4356('0x9')](_0x4356('0xaf'),require(_0x4356('0xb0')));_0x55c78f['use']('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x55c78f[_0x4356('0x9')](_0x4356('0xb1'),require(_0x4356('0xb2')));_0x55c78f[_0x4356('0x9')](_0x4356('0xb3'),require(_0x4356('0xb4')));_0x55c78f[_0x4356('0x9')](_0x4356('0xb5'),require(_0x4356('0xb6')));_0x55c78f[_0x4356('0x9')](_0x4356('0xb7'),require('./api/intDynamics365Account'));_0x55c78f['use'](_0x4356('0xb8'),require(_0x4356('0xb9')));_0x55c78f['use'](_0x4356('0xba'),require(_0x4356('0xbb')));_0x55c78f['use']('/api/integrations/freshsales/accounts',require(_0x4356('0xbc')));_0x55c78f[_0x4356('0x9')](_0x4356('0xbd'),require('./api/intFreshsalesConfiguration'));_0x55c78f[_0x4356('0x9')](_0x4356('0xbe'),require(_0x4356('0xbf')));_0x55c78f[_0x4356('0x9')](_0x4356('0xc0'),require('./api/network'));_0x55c78f[_0x4356('0x9')]('/api/chat/reports/queue',require(_0x4356('0xc1')));_0x55c78f[_0x4356('0x9')](_0x4356('0xc2'),require(_0x4356('0xc3')));_0x55c78f[_0x4356('0x9')](_0x4356('0xc4'),require(_0x4356('0xc5')));_0x55c78f[_0x4356('0x9')](_0x4356('0xc6'),require('./api/jscriptyQuestionReport'));_0x55c78f['use'](_0x4356('0xc7'),require(_0x4356('0xc8')));_0x55c78f[_0x4356('0x9')](_0x4356('0xc9'),require(_0x4356('0xca')));_0x55c78f[_0x4356('0x9')](_0x4356('0xcb'),require('./api/squareReport'));_0x55c78f[_0x4356('0x9')](_0x4356('0xcc'),require(_0x4356('0xcd')));_0x55c78f[_0x4356('0x9')](_0x4356('0xce'),require(_0x4356('0xcf')));_0x55c78f[_0x4356('0x9')](_0x4356('0xd0'),require(_0x4356('0xd1')));_0x55c78f['use'](_0x4356('0xd2'),require(_0x4356('0xd3')));_0x55c78f['use']('/api/square/projects',require('./api/squareProject'));_0x55c78f[_0x4356('0x9')](_0x4356('0xd4'),require(_0x4356('0xd5')));_0x55c78f[_0x4356('0x9')](_0x4356('0xd6'),require(_0x4356('0xd7')));_0x55c78f['use']('/api/teams',require('./api/team'));_0x55c78f[_0x4356('0x9')](_0x4356('0xd8'),require('./api/license'));_0x55c78f[_0x4356('0x9')](_0x4356('0xd9'),require(_0x4356('0xda')));_0x55c78f[_0x4356('0x9')](_0x4356('0xdb'),require('./api/migration'));_0x55c78f[_0x4356('0x9')](_0x4356('0xdc'),require('./api/attachment'));_0x55c78f[_0x4356('0x9')]('/api/plugins',require('./api/plugin'));_0x55c78f[_0x4356('0x9')](_0x4356('0xdd'),require(_0x4356('0xde')));_0x55c78f[_0x4356('0x9')](_0x4356('0xdf'),require(_0x4356('0xe0')));_0x55c78f[_0x4356('0x9')](_0x4356('0xe1'),require(_0x4356('0xe2')));_0x55c78f[_0x4356('0x9')]('/api/openchannel/reports/transfer',require(_0x4356('0xe3')));_0x55c78f[_0x4356('0x9')]('/api/sms/reports/transfer',require(_0x4356('0xe4')));_0x55c78f[_0x4356('0x9')](_0x4356('0xe5'),require(_0x4356('0xe6')));_0x55c78f['use'](_0x4356('0xe7'),require(_0x4356('0xe8')));_0x55c78f[_0x4356('0x9')]('/api/userProfiles',require(_0x4356('0xe9')));_0x55c78f[_0x4356('0x9')]('/api/userProfile/sections',require(_0x4356('0xea')));_0x55c78f[_0x4356('0x9')](_0x4356('0xeb'),require('./api/userProfileResource'));_0x55c78f['use'](_0x4356('0xec'),require(_0x4356('0xed')));_0x55c78f[_0x4356('0x9')](_0x4356('0xee'),require(_0x4356('0xef')));_0x55c78f[_0x4356('0x9')](_0x4356('0xf0'),require(_0x4356('0xf1')));_0x55c78f[_0x4356('0x9')]('/api/whatsapp/interactions',require(_0x4356('0xf2')));_0x55c78f[_0x4356('0x9')]('/api/whatsapp/messages',require(_0x4356('0xf3')));_0x55c78f[_0x4356('0x9')]('/api/whatsapp/reports/queue',require(_0x4356('0xf4')));_0x55c78f[_0x4356('0x9')](_0x4356('0xf5'),require('./api/whatsappTransferReport'));_0x55c78f[_0x4356('0x9')](_0x4356('0xf6'),require('./api/whatsappQueue'));_0x55c78f[_0x4356('0x9')](_0x4356('0xf7'),require(_0x4356('0xf8')));_0x55c78f[_0x4356('0x9')](_0x4356('0xf9'),require('./api/realtime'));_0x55c78f[_0x4356('0x9')](_0x4356('0xfa'),require(_0x4356('0xfb')));_0x55c78f[_0x4356('0x9')](_0x4356('0xfc'),require(_0x4356('0xfd')));_0x55c78f['use'](_0x4356('0xfe'),require(_0x4356('0xff')));_0x55c78f[_0x4356('0x9')](_0x4356('0x100'),require('./api/authGoogle'));_0x55c78f[_0x4356('0x9')](_0x4356('0x101'),require(_0x4356('0x102')));_0x55c78f[_0x4356('0x9')](_0x4356('0x103'),require('./api/jira'));_0x55c78f[_0x4356('0x9')](_0x4356('0x104'),require('./api/rpc'));_0x55c78f[_0x4356('0x9')](_0x4356('0x105'),require(_0x4356('0x106')));_0x55c78f[_0x4356('0x9')]('/api/system',require(_0x4356('0x107')));_0x55c78f[_0x4356('0x9')](_0x4356('0x108'),require(_0x4356('0x109')));_0x55c78f[_0x4356('0x9')](_0x4356('0x10a'),require(_0x4356('0x10b')));_0x55c78f[_0x4356('0x9')](_0x4356('0x10c'),clientSideLogs);_0x55c78f['use'](_0x4356('0x10d'),express[_0x4356('0x10e')](path['join'](config[_0x4356('0x10f')],_0x4356('0x10d'))));_0x55c78f[_0x4356('0x9')](_0x4356('0x110'),express['static'](path[_0x4356('0x111')](config[_0x4356('0x10f')],_0x4356('0x110'))));_0x55c78f[_0x4356('0x9')](_0x4356('0x112'),express[_0x4356('0x10e')](path[_0x4356('0x111')](config[_0x4356('0x10f')],_0x4356('0x112'))));_0x55c78f[_0x4356('0x9')](_0x4356('0x113'),express[_0x4356('0x10e')](path[_0x4356('0x111')](config[_0x4356('0x10f')],_0x4356('0x114'),_0x4356('0x115'))));_0x55c78f[_0x4356('0x9')](_0x4356('0x116'),express[_0x4356('0x10e')](path[_0x4356('0x111')](config[_0x4356('0x10f')],_0x4356('0x117'))));_0x55c78f['route'](_0x4356('0x118'))['get'](errors[0x194]);_0x55c78f[_0x4356('0x119')]('/*')[_0x4356('0x11a')](function(_0x320e48,_0x51341e){_0x51341e[_0x4356('0x11b')](path[_0x4356('0x11c')](_0x55c78f[_0x4356('0x11a')](_0x4356('0x11d'))+_0x4356('0x11e')));});return _0x55c78f;});}; \ No newline at end of file +var _0x0258=['/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/sessions/reports','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/mail_interaction_has_tags','/api/auth/local','./api/authLocal','./api/authGoogle','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','path','express','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup'];(function(_0x1be9ea,_0xa10273){var _0x2b240d=function(_0x30b599){while(--_0x30b599){_0x1be9ea['push'](_0x1be9ea['shift']());}};_0x2b240d(++_0xa10273);}(_0x0258,0x1d8));var _0x8025=function(_0x443e8f,_0x2e2d4d){_0x443e8f=_0x443e8f-0x0;var _0x563fa2=_0x0258[_0x443e8f];return _0x563fa2;};'use strict';var path=require(_0x8025('0x0'));var express=require(_0x8025('0x1'));var errors=require('./errors');var config=require(_0x8025('0x2'));var setupLoggers=require(_0x8025('0x3'))[_0x8025('0x4')];var clientSideLogs=require(_0x8025('0x5'));exports[_0x8025('0x6')]=function(_0x2b0b16){return setupLoggers(_0x2b0b16)[_0x8025('0x7')](function(){_0x2b0b16[_0x8025('0x8')](_0x8025('0x9'),require(_0x8025('0xa')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xb'),require('./api/voiceChanSpy'));_0x2b0b16['use']('/api/voice/contexts',require(_0x8025('0xc')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xd'),require('./api/voiceExtension'));_0x2b0b16['use'](_0x8025('0xe'),require('./api/voiceMusicOnHold'));_0x2b0b16[_0x8025('0x8')](_0x8025('0xf'),require('./api/voiceQueue'));_0x2b0b16[_0x8025('0x8')](_0x8025('0x10'),require(_0x8025('0x11')));_0x2b0b16[_0x8025('0x8')]('/api/screen/recordings',require(_0x8025('0x12')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x13'),require(_0x8025('0x14')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x15'),require(_0x8025('0x16')));_0x2b0b16[_0x8025('0x8')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x2b0b16[_0x8025('0x8')](_0x8025('0x17'),require(_0x8025('0x18')));_0x2b0b16['use'](_0x8025('0x19'),require(_0x8025('0x1a')));_0x2b0b16[_0x8025('0x8')]('/api/voice/queues/reports',require(_0x8025('0x1b')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x1c'),require(_0x8025('0x1d')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x1e'),require(_0x8025('0x1f')));_0x2b0b16[_0x8025('0x8')]('/api/voice/transfers/reports',require(_0x8025('0x20')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x21'),require(_0x8025('0x22')));_0x2b0b16[_0x8025('0x8')]('/api/mail/accounts',require('./api/mailAccount'));_0x2b0b16[_0x8025('0x8')]('/api/mail/queues',require('./api/mailQueue'));_0x2b0b16['use'](_0x8025('0x23'),require(_0x8025('0x24')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x25'),require(_0x8025('0x26')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x27'),require(_0x8025('0x28')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x29'),require(_0x8025('0x2a')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x2b'),require(_0x8025('0x2c')));_0x2b0b16[_0x8025('0x8')]('/api/dashboards',require(_0x8025('0x2d')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x2e'),require(_0x8025('0x2f')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x30'),require(_0x8025('0x31')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x32'),require(_0x8025('0x33')));_0x2b0b16[_0x8025('0x8')]('/api/fax/interactions',require('./api/faxInteraction'));_0x2b0b16[_0x8025('0x8')](_0x8025('0x34'),require('./api/faxMessage'));_0x2b0b16[_0x8025('0x8')]('/api/fax/queues',require(_0x8025('0x35')));_0x2b0b16['use'](_0x8025('0x36'),require('./api/faxQueueReport'));_0x2b0b16[_0x8025('0x8')]('/api/sms/accounts',require('./api/smsAccount'));_0x2b0b16[_0x8025('0x8')]('/api/sms/applications',require('./api/smsApplication'));_0x2b0b16[_0x8025('0x8')](_0x8025('0x37'),require(_0x8025('0x38')));_0x2b0b16['use'](_0x8025('0x39'),require(_0x8025('0x3a')));_0x2b0b16[_0x8025('0x8')]('/api/sms/queues',require(_0x8025('0x3b')));_0x2b0b16['use'](_0x8025('0x3c'),require(_0x8025('0x3d')));_0x2b0b16[_0x8025('0x8')]('/api/openchannel/applications',require(_0x8025('0x3e')));_0x2b0b16['use'](_0x8025('0x3f'),require(_0x8025('0x40')));_0x2b0b16[_0x8025('0x8')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x2b0b16[_0x8025('0x8')](_0x8025('0x41'),require(_0x8025('0x42')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x43'),require(_0x8025('0x44')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x45'),require(_0x8025('0x46')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x47'),require(_0x8025('0x48')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x49'),require(_0x8025('0x4a')));_0x2b0b16[_0x8025('0x8')]('/api/chat/messages',require('./api/chatMessage'));_0x2b0b16[_0x8025('0x8')](_0x8025('0x4b'),require(_0x8025('0x4c')));_0x2b0b16['use'](_0x8025('0x4d'),require(_0x8025('0x4e')));_0x2b0b16['use']('/api/chat/groups',require(_0x8025('0x4f')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x50'),require(_0x8025('0x51')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x52'),require(_0x8025('0x53')));_0x2b0b16['use'](_0x8025('0x54'),require(_0x8025('0x55')));_0x2b0b16['use'](_0x8025('0x56'),require(_0x8025('0x57')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x58'),require(_0x8025('0x59')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x5a'),require('./api/cmHopperFinal'));_0x2b0b16['use'](_0x8025('0x5b'),require(_0x8025('0x5c')));_0x2b0b16['use']('/api/cm/custom_fields',require(_0x8025('0x5d')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x5e'),require(_0x8025('0x5f')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x60'),require(_0x8025('0x61')));_0x2b0b16[_0x8025('0x8')]('/api/canned_answers',require(_0x8025('0x62')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x63'),require(_0x8025('0x64')));_0x2b0b16[_0x8025('0x8')]('/api/conditions',require(_0x8025('0x65')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x66'),require('./api/interval'));_0x2b0b16['use'](_0x8025('0x67'),require(_0x8025('0x68')));_0x2b0b16[_0x8025('0x8')]('/api/cdr',require(_0x8025('0x69')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x6a'),require(_0x8025('0x6b')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x6c'),require('./api/schedule'));_0x2b0b16['use'](_0x8025('0x6d'),require(_0x8025('0x6e')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x6f'),require(_0x8025('0x70')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x71'),require(_0x8025('0x72')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x73'),require('./api/cmContactHasItem'));_0x2b0b16['use'](_0x8025('0x74'),require(_0x8025('0x75')));_0x2b0b16['use'](_0x8025('0x76'),require('./api/template'));_0x2b0b16[_0x8025('0x8')](_0x8025('0x77'),require(_0x8025('0x78')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x79'),require(_0x8025('0x7a')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x7b'),require(_0x8025('0x7c')));_0x2b0b16[_0x8025('0x8')]('/api/integrations/reports',require(_0x8025('0x7d')));_0x2b0b16['use'](_0x8025('0x7e'),require(_0x8025('0x7f')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x80'),require(_0x8025('0x81')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x82'),require(_0x8025('0x83')));_0x2b0b16['use'](_0x8025('0x84'),require(_0x8025('0x85')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x86'),require(_0x8025('0x87')));_0x2b0b16['use'](_0x8025('0x88'),require(_0x8025('0x89')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x8a'),require(_0x8025('0x8b')));_0x2b0b16['use'](_0x8025('0x8c'),require('./api/intSalesforceConfiguration'));_0x2b0b16['use'](_0x8025('0x8d'),require(_0x8025('0x8e')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x8f'),require(_0x8025('0x90')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x91'),require(_0x8025('0x92')));_0x2b0b16['use'](_0x8025('0x93'),require(_0x8025('0x94')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x95'),require('./api/intDeskAccount'));_0x2b0b16[_0x8025('0x8')](_0x8025('0x96'),require('./api/intDeskConfiguration'));_0x2b0b16['use'](_0x8025('0x97'),require('./api/intDeskField'));_0x2b0b16[_0x8025('0x8')](_0x8025('0x98'),require(_0x8025('0x99')));_0x2b0b16[_0x8025('0x8')]('/api/integrations/zoho/configurations',require(_0x8025('0x9a')));_0x2b0b16[_0x8025('0x8')]('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x2b0b16[_0x8025('0x8')](_0x8025('0x9b'),require('./api/intZendeskAccount'));_0x2b0b16[_0x8025('0x8')](_0x8025('0x9c'),require(_0x8025('0x9d')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x9e'),require(_0x8025('0x9f')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xa0'),require('./api/intFreshdeskAccount'));_0x2b0b16[_0x8025('0x8')](_0x8025('0xa1'),require(_0x8025('0xa2')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xa3'),require(_0x8025('0xa4')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xa5'),require(_0x8025('0xa6')));_0x2b0b16['use'](_0x8025('0xa7'),require(_0x8025('0xa8')));_0x2b0b16[_0x8025('0x8')]('/api/integrations/vtiger/fields',require(_0x8025('0xa9')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xaa'),require(_0x8025('0xab')));_0x2b0b16['use'](_0x8025('0xac'),require(_0x8025('0xad')));_0x2b0b16['use'](_0x8025('0xae'),require(_0x8025('0xaf')));_0x2b0b16['use'](_0x8025('0xb0'),require(_0x8025('0xb1')));_0x2b0b16['use'](_0x8025('0xb2'),require(_0x8025('0xb3')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xb4'),require(_0x8025('0xb5')));_0x2b0b16[_0x8025('0x8')]('/api/integrations/freshsales/accounts',require(_0x8025('0xb6')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xb7'),require(_0x8025('0xb8')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xb9'),require('./api/intFreshsalesField'));_0x2b0b16['use'](_0x8025('0xba'),require('./api/network'));_0x2b0b16[_0x8025('0x8')](_0x8025('0xbb'),require(_0x8025('0xbc')));_0x2b0b16['use'](_0x8025('0xbd'),require('./api/chatInternalMessage'));_0x2b0b16[_0x8025('0x8')](_0x8025('0xbe'),require('./api/jscriptyAnswerReport'));_0x2b0b16[_0x8025('0x8')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x2b0b16[_0x8025('0x8')](_0x8025('0xbf'),require('./api/jscriptySessionReport'));_0x2b0b16['use']('/api/sms/reports/queue',require(_0x8025('0xc0')));_0x2b0b16['use'](_0x8025('0xc1'),require(_0x8025('0xc2')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xc3'),require(_0x8025('0xc4')));_0x2b0b16['use']('/api/jscripty/projects',require(_0x8025('0xc5')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xc6'),require(_0x8025('0xc7')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xc8'),require(_0x8025('0xc9')));_0x2b0b16['use']('/api/square/projects',require(_0x8025('0xca')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xcb'),require(_0x8025('0xcc')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xcd'),require(_0x8025('0xce')));_0x2b0b16['use'](_0x8025('0xcf'),require(_0x8025('0xd0')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xd1'),require('./api/license'));_0x2b0b16[_0x8025('0x8')]('/api/campaigns',require('./api/campaign'));_0x2b0b16[_0x8025('0x8')]('/api/migrations',require(_0x8025('0xd2')));_0x2b0b16['use'](_0x8025('0xd3'),require('./api/attachment'));_0x2b0b16[_0x8025('0x8')](_0x8025('0xd4'),require(_0x8025('0xd5')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xd6'),require(_0x8025('0xd7')));_0x2b0b16[_0x8025('0x8')]('/api/chat/reports/transfer',require(_0x8025('0xd8')));_0x2b0b16['use']('/api/fax/reports/transfer',require(_0x8025('0xd9')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xda'),require('./api/openchannelTransferReport'));_0x2b0b16[_0x8025('0x8')](_0x8025('0xdb'),require(_0x8025('0xdc')));_0x2b0b16[_0x8025('0x8')]('/api/cm/lists',require(_0x8025('0xdd')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xde'),require(_0x8025('0xdf')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xe0'),require(_0x8025('0xe1')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xe2'),require('./api/userProfileSection'));_0x2b0b16[_0x8025('0x8')](_0x8025('0xe3'),require(_0x8025('0xe4')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xe5'),require(_0x8025('0xe6')));_0x2b0b16['use'](_0x8025('0xe7'),require(_0x8025('0xe8')));_0x2b0b16[_0x8025('0x8')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x2b0b16[_0x8025('0x8')](_0x8025('0xe9'),require(_0x8025('0xea')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xeb'),require(_0x8025('0xec')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xed'),require(_0x8025('0xee')));_0x2b0b16['use']('/api/whatsapp/reports/transfer',require(_0x8025('0xef')));_0x2b0b16['use']('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x2b0b16[_0x8025('0x8')]('/api/cloudProviders',require(_0x8025('0xf0')));_0x2b0b16['use'](_0x8025('0xf1'),require(_0x8025('0xf2')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xf3'),require(_0x8025('0xf4')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xf5'),require('./api/mailInteractionHasTag'));_0x2b0b16[_0x8025('0x8')](_0x8025('0xf6'),require(_0x8025('0xf7')));_0x2b0b16[_0x8025('0x8')]('/api/auth/google',require(_0x8025('0xf8')));_0x2b0b16[_0x8025('0x8')]('/api/auth/activedirectory',require(_0x8025('0xf9')));_0x2b0b16['use']('/api/jira',require(_0x8025('0xfa')));_0x2b0b16['use'](_0x8025('0xfb'),require(_0x8025('0xfc')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xfd'),require(_0x8025('0xfe')));_0x2b0b16[_0x8025('0x8')](_0x8025('0xff'),require(_0x8025('0x100')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x101'),require(_0x8025('0x102')));_0x2b0b16[_0x8025('0x8')](_0x8025('0x103'),require('./api/webbar'));_0x2b0b16[_0x8025('0x8')](_0x8025('0x104'),clientSideLogs);_0x2b0b16[_0x8025('0x8')](_0x8025('0x105'),express[_0x8025('0x106')](path[_0x8025('0x107')](config[_0x8025('0x108')],_0x8025('0x105'))));_0x2b0b16['use'](_0x8025('0x109'),express[_0x8025('0x106')](path[_0x8025('0x107')](config[_0x8025('0x108')],_0x8025('0x109'))));_0x2b0b16['use'](_0x8025('0x10a'),express['static'](path['join'](config[_0x8025('0x108')],'/demo')));_0x2b0b16['use'](_0x8025('0x10b'),express[_0x8025('0x106')](path[_0x8025('0x107')](config['root'],_0x8025('0x10c'),'3.9.0')));_0x2b0b16['use'](_0x8025('0x10d'),express['static'](path[_0x8025('0x107')](config[_0x8025('0x108')],'/server/files/plugins')));_0x2b0b16[_0x8025('0x10e')](_0x8025('0x10f'))['get'](errors[0x194]);_0x2b0b16[_0x8025('0x10e')]('/*')[_0x8025('0x110')](function(_0x4d9265,_0xd61db6){_0xd61db6[_0x8025('0x111')](path[_0x8025('0x112')](_0x2b0b16['get'](_0x8025('0x113'))+'/index.html'));});return _0x2b0b16;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index ec0a7b7..6d5ca0c 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d01=['../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','rpc','port','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0x1d01,0xb7));var _0x11d0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1d01[_0x2641f9];return _0x585741;};'use strict';var jayson=require(_0x11d0('0x0'));var _=require(_0x11d0('0x1'));var config=require(_0x11d0('0x2'));exports[_0x11d0('0x3')]=function(){return new Promise(function(_0x222d4a,_0x1580f7){var _0x467b74={};_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x5')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x6')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x7')));_0x467b74=_['merge'](_0x467b74,require('../api/voiceRecording/voiceRecording.rpc'));_0x467b74=_['merge'](_0x467b74,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x467b74=_['merge'](_0x467b74,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x8')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x9')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0xa')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/trunk/trunk.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0xb')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/mailServerIn/mailServerIn.rpc'));_0x467b74=_['merge'](_0x467b74,require('../api/mailAccount/mailAccount.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0xc')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0xd')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0xe')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0xf')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x10')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x11')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x12')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x13')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x14')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x15')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x16')));_0x467b74=_['merge'](_0x467b74,require('../api/smsAccount/smsAccount.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/smsInteraction/smsInteraction.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x17')));_0x467b74=_['merge'](_0x467b74,require('../api/smsQueue/smsQueue.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x18')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x19')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x1a')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x1b')));_0x467b74=_['merge'](_0x467b74,require('../api/chatInteraction/chatInteraction.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x1c')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x1d')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x1e')));_0x467b74=_['merge'](_0x467b74,require('../api/cmHopper/cmHopper.rpc'));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x1f')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x20')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x21')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x22')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x23')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x24')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x25')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x26')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x27')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x28')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x29')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x2a')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x2b')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x2c')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x2d')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x2e')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x2f')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x30')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x31')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x32')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x33')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x34')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/setting/setting.rpc'));_0x467b74=_['merge'](_0x467b74,require('../api/squareOdbc/squareOdbc.rpc'));_0x467b74=_['merge'](_0x467b74,require('../api/squareProject/squareProject.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x35')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x36')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x37')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x38')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x39')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x3a')));_0x467b74=_['merge'](_0x467b74,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x3b')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x3c')));var _0xb03c61=jayson['server'](_0x467b74)['http']();var _0x1b7862=config[_0x11d0('0x3d')][_0x11d0('0x3e')]||config['port']+0x1;var _0x9eef2=config[_0x11d0('0x3d')]['ip']||'localhost';_0xb03c61['on']('error',function(_0x49f365){return _0x1580f7(_0x49f365);});_0xb03c61[_0x11d0('0x3')](_0x1b7862,_0x9eef2,function(){console[_0x11d0('0x3f')](_0x11d0('0x40'),_0x9eef2,_0x1b7862);require(_0x11d0('0x41'))[_0x11d0('0x42')]();return _0x222d4a(_0x11d0('0x43')+_0x9eef2+':'+_0x1b7862);});});}; \ No newline at end of file +var _0xdc1b=['../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xdc1b,0x161));var _0xbdc1=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xdc1b[_0x556bb1];return _0x45455f;};'use strict';var jayson=require('jayson/promise');var _=require('lodash');var config=require(_0xbdc1('0x0'));exports['listen']=function(){return new Promise(function(_0x2f52fa,_0x2b2a6f){var _0x12a990={};_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x2')));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0x3')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x4')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/voiceRecording/voiceRecording.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x5')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0x6')));_0x12a990=_['merge'](_0x12a990,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x7')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x8')));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0x9')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0xa')));_0x12a990=_['merge'](_0x12a990,require('../api/mailServerIn/mailServerIn.rpc'));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0xb')));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0xc')));_0x12a990=_['merge'](_0x12a990,require('../api/mailInteraction/mailInteraction.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/mailMessage/mailMessage.rpc'));_0x12a990=_['merge'](_0x12a990,require('../api/mailApplication/mailApplication.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0xd')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0xe')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0xf')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/faxInteraction/faxInteraction.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/faxMessage/faxMessage.rpc'));_0x12a990=_['merge'](_0x12a990,require('../api/faxQueue/faxQueue.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0x10')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x11')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/smsMessage/smsMessage.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x12')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x13')));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0x14')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x15')));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0x16')));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0x17')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x18')));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0x19')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x1a')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x1b')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x1c')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x1d')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x1e')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x1f')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x20')));_0x12a990=_['merge'](_0x12a990,require('../api/pause/pause.rpc'));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0x21')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x12a990=_['merge'](_0x12a990,require('../api/template/template.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/trigger/trigger.rpc'));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0x22')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x23')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x24')));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0x25')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x26')));_0x12a990=_['merge'](_0x12a990,require(_0xbdc1('0x27')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x28')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x29')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x2a')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x2b')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x2c')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x2d')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x2e')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x2f')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/squareProject/squareProject.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x30')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x31')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x32')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x33')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/plugin/plugin.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x34')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x35')));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x12a990=_[_0xbdc1('0x1')](_0x12a990,require(_0xbdc1('0x36')));var _0x3c2189=jayson[_0xbdc1('0x37')](_0x12a990)[_0xbdc1('0x38')]();var _0x286b21=config[_0xbdc1('0x39')][_0xbdc1('0x3a')]||config['port']+0x1;var _0x41fe52=config[_0xbdc1('0x39')]['ip']||_0xbdc1('0x3b');_0x3c2189['on'](_0xbdc1('0x3c'),function(_0x1ea48e){return _0x2b2a6f(_0x1ea48e);});_0x3c2189['listen'](_0x286b21,_0x41fe52,function(){console[_0xbdc1('0x3d')](_0xbdc1('0x3e'),_0x41fe52,_0x286b21);require(_0xbdc1('0x3f'))[_0xbdc1('0x40')]();return _0x2f52fa(_0xbdc1('0x41')+_0x41fe52+':'+_0x286b21);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index e85608e..268c94b 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 _0xa899=['code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','function','write','prototype','command','sync','answer','sendRequest','ANSWER','getData','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','noop','GOTO\x20%s\x20%s\x20%s','recordFile','BEEP','streamFile','agi','AGI','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','emit','line','toLowerCase','hangup','substring','520-Invalid','search','replace','result=','substr','indexOf','startsWith','split','length','error'];(function(_0xaa804,_0x1c07b6){var _0x1617f1=function(_0x16b13a){while(--_0x16b13a){_0xaa804['push'](_0xaa804['shift']());}};_0x1617f1(++_0x1c07b6);}(_0xa899,0x155));var _0x9a89=function(_0x3050ca,_0x3e36b0){_0x3050ca=_0x3050ca-0x0;var _0x1eed1d=_0xa899[_0x3050ca];return _0x1eed1d;};'use strict';var util=require(_0x9a89('0x0'));var _=require(_0x9a89('0x1'));var EventEmitter=require(_0x9a89('0x2'))['EventEmitter'];var AGIReply=require(_0x9a89('0x3'));var AGIError=require(_0x9a89('0x4'));function AGIChannel(_0x2bc02a){var _0x45233c=this,_0x405c47=new AGIReply(),_0x15c431=![],_0x105758={};EventEmitter[_0x9a89('0x5')](_0x45233c);_0x2bc02a[_0x9a89('0x6')](_0x9a89('0x7'));_0x2bc02a[_0x9a89('0x8')](0x8*0x3c*0x3c*0x3e8);_0x405c47[_0x9a89('0x6')](_0x9a89('0x7'));_0x405c47['on']('headers',function(_0x4d2b72){for(var _0xe61171 in _0x4d2b72){_0x45233c[_0xe61171]=_0x4d2b72[_0xe61171];}_0x45233c[_0x9a89('0x9')]('ready');});_0x405c47['on'](_0x9a89('0xa'),function(_0x4f487d){if(_0x4f487d[_0x9a89('0xb')]()==_0x9a89('0xc')){_0x45233c[_0x9a89('0x9')](_0x9a89('0xc'));return;}if(_0x4f487d[_0x9a89('0xd')](0x0,0xb)==_0x9a89('0xe')){_0x15c431=!![];}if(_0x15c431){_0x105758['rx']+=_0x4f487d+'\x0a';if(_0x4f487d[_0x9a89('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x15c431=![];}}else{_0x105758['rx']=_0x4f487d;}if(_0x15c431){return;}if(typeof _0x105758['cb']=='function'){var _0x4342c8=_0x105758['rx']['substring'](0x0,0x3),_0x8b7403=null,_0x2bdb0d=null;_0x4342c8=parseInt(_0x4342c8);if(isNaN(_0x4342c8)){_0x105758['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x4342c8!=0xc8){_0x105758['cb'](null,{'code':_0x4342c8,'result':-0x1,'extra':'KO'});return;}_0x8b7403=_0x105758['rx']['substring'](0x4)[_0x9a89('0x10')](_0x9a89('0x11'),'');if(_0x8b7403['indexOf']('\x20')!=-0x1){_0x8b7403=_0x8b7403[_0x9a89('0x12')](0x0,_0x8b7403[_0x9a89('0x13')]('\x20'));}if(_[_0x9a89('0x14')](_0x8b7403,'-1')){_0x8b7403=parseInt(_0x8b7403);}_0x2bdb0d=_0x105758['rx'][_0x9a89('0x15')]('\x20');if(_0x2bdb0d['length']==0x3){_0x2bdb0d=_0x2bdb0d[0x2][_0x9a89('0xd')](0x1,_0x2bdb0d[0x2][_0x9a89('0x16')]-0x1);}else if(_0x2bdb0d['length']>0x3){var _0x4fe73e=/\((.+)\)/;var _0x35221f=_0x105758['rx']['match'](_0x4fe73e);if(_0x35221f){_0x2bdb0d=_0x35221f[0x1];}else{_0x2bdb0d=null;}}else{_0x2bdb0d=null;}_0x105758['cb'](null,{'code':_0x4342c8,'result':_0x8b7403,'extra':_0x2bdb0d});}});_0x2bc02a['on'](_0x9a89('0x17'),function(_0x334725){_0x45233c['emit'](_0x9a89('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x334725[_0x9a89('0x18')]));});_0x2bc02a['on'](_0x9a89('0x19'),function(){_0x45233c['emit'](_0x9a89('0x19'),new AGIError(_0x9a89('0x1a')));});_0x2bc02a['on'](_0x9a89('0x1b'),function(){_0x45233c[_0x9a89('0x9')](_0x9a89('0x1b'),new AGIError(_0x9a89('0x1c')));_0x2bc02a[_0x9a89('0x1d')]();});_0x2bc02a[_0x9a89('0x1e')](_0x405c47);this['command']=function(_0x51618d,_0x1ef5ef){var _0x51618d=_0x51618d||'',_0x1ef5ef=typeof _0x1ef5ef==_0x9a89('0x1f')?_0x1ef5ef:new Function();_0x105758={'tx':_0x51618d,'rx':'','cb':_0x1ef5ef};_0x2bc02a[_0x9a89('0x20')](_0x51618d+'\x0a');},this[_0x9a89('0x19')]=function(){_0x2bc02a['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x9a89('0x21')]['sendRequest']=function(_0x3f5723){return this[_0x9a89('0x22')][_0x9a89('0x23')](this,_0x3f5723);};AGIChannel[_0x9a89('0x21')][_0x9a89('0x24')]=function(){return this[_0x9a89('0x25')](_0x9a89('0x26'));};AGIChannel['prototype'][_0x9a89('0x27')]=function(_0x5002a2,_0xd64312,_0x5a888b){_0x5002a2=_0x5002a2===undefined?'beep':_0x5002a2;_0xd64312=_0xd64312===undefined?'5':_0xd64312;_0x5a888b=_0x5a888b===undefined?'1':_0x5a888b;return this[_0x9a89('0x25')](util[_0x9a89('0x28')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x5002a2,_0xd64312*0x3e8,_0x5a888b));};AGIChannel[_0x9a89('0x21')]['noop']=function(_0x27f442){_0x27f442=_0x27f442||_0x9a89('0x29');return this[_0x9a89('0x25')](util[_0x9a89('0x28')](_0x9a89('0x2a'),_0x27f442));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x2b')]=function(_0x5e5751,_0x4df9f2){if(_['isArray'](_0x4df9f2)){return this[_0x9a89('0x25')](util['format'](_0x9a89('0x2c'),_0x5e5751,_0x4df9f2[_0x9a89('0x2d')](',')));}return this[_0x9a89('0x25')](util['format'](_0x9a89('0x2c'),_0x5e5751,_0x4df9f2));};AGIChannel['prototype'][_0x9a89('0x2e')]=function(_0x2102db){return this[_0x9a89('0x25')](util[_0x9a89('0x28')](_0x9a89('0x2f'),_0x2102db));};AGIChannel['prototype'][_0x9a89('0x30')]=function(_0x163055){return this[_0x9a89('0x25')](util[_0x9a89('0x28')](_0x9a89('0x31'),_0x163055));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x32')]=function(_0x238bd8){return this[_0x9a89('0x25')](util['format'](_0x9a89('0x33'),_0x238bd8));};AGIChannel[_0x9a89('0x21')][_0x9a89('0xc')]=function(){return this[_0x9a89('0x25')](_0x9a89('0x34'));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x35')]=function(_0x18304a,_0x394d2c){var _0x36f1b0=_['isBoolean'](_0x394d2c)||_[_0x9a89('0x36')](_0x394d2c)?_0x394d2c[_0x9a89('0x37')]():_0x394d2c;return this[_0x9a89('0x25')](util[_0x9a89('0x28')](_0x9a89('0x38'),_0x18304a,_0x36f1b0?_0x36f1b0[_0x9a89('0x37')]()[_0x9a89('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x39')]=function(_0x77fa47,_0x404511){return this[_0x9a89('0x25')](util['format'](_0x9a89('0x3a'),_0x77fa47,_0x404511));};AGIChannel['prototype'][_0x9a89('0x3b')]=function(_0x2c9cff,_0x26112d){return this[_0x9a89('0x25')](util[_0x9a89('0x28')](_0x9a89('0x3c'),_0x2c9cff,_0x26112d));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x3d')]=function(_0x192138,_0x53c4a7){return this[_0x9a89('0x25')](util[_0x9a89('0x28')](_0x9a89('0x3e'),_0x192138,_0x53c4a7));};AGIChannel[_0x9a89('0x21')]['continueAt']=function(_0x496244,_0x46c1f9,_0x500ab3){_0x46c1f9=_0x46c1f9||this[_0x9a89('0x3f')];_0x500ab3=_0x500ab3||0x1;this[_0x9a89('0x2e')](_0x496244);this[_0x9a89('0x30')](_0x46c1f9);this[_0x9a89('0x32')](_0x500ab3);return this[_0x9a89('0x40')](util[_0x9a89('0x28')](_0x9a89('0x41'),_0x496244,_0x46c1f9,_0x500ab3));};AGIChannel[_0x9a89('0x21')]['getVariable']=function(_0x4c4f2c){return this['sendRequest'](util[_0x9a89('0x28')]('GET\x20VARIABLE\x20\x22%s\x22',_0x4c4f2c));};AGIChannel['prototype'][_0x9a89('0x42')]=function(_0x355006,_0x240887,_0x5e2662,_0x439089,_0x515370,_0xd3d7df){_0x240887=_0x240887||'wav';_0x5e2662=_0x5e2662||'';_0x439089=_0x439089===undefined?-0x1:_0x439089==='-1'?-0x1:_0x439089*0x3e8;_0x515370=_0x515370===undefined?'':'s='+_0x515370;_0xd3d7df=_0xd3d7df?_0x9a89('0x43'):'';return this[_0x9a89('0x25')](util[_0x9a89('0x28')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x355006,_0x240887,_0x5e2662,_0x439089,_0xd3d7df,_0x515370));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x44')]=function(_0x39c745,_0x582837){_0x582837=_0x582837||'';return this['sendRequest'](util[_0x9a89('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x39c745,_0x582837));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x45')]=function(_0x533cbd){return this[_0x9a89('0x2b')](_0x9a89('0x46'),_0x533cbd);};AGIChannel['prototype']['wait']=function(_0x338559){return this[_0x9a89('0x2b')]('WAIT',_0x338559);};AGIChannel[_0x9a89('0x21')]['error']=function(_0x55e1dd,_0x2d58d4){this[_0x9a89('0x40')](util[_0x9a89('0x28')](_0x9a89('0x47'),_0x55e1dd['id'],_0x55e1dd['label'],_0x2d58d4));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9a89('0x48')]=AGIChannel; \ No newline at end of file +var _0x43c4=['SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setPriority','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','exports','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','headers','emit','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','write','destroy','inherits','prototype','sendRequest','command','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber'];(function(_0x540513,_0x48f00c){var _0x5e2580=function(_0xce2a94){while(--_0xce2a94){_0x540513['push'](_0x540513['shift']());}};_0x5e2580(++_0x48f00c);}(_0x43c4,0xf7));var _0x443c=function(_0x519add,_0x186dbb){_0x519add=_0x519add-0x0;var _0x11f87b=_0x43c4[_0x519add];return _0x11f87b;};'use strict';var util=require('util');var _=require(_0x443c('0x0'));var EventEmitter=require(_0x443c('0x1'))[_0x443c('0x2')];var AGIReply=require(_0x443c('0x3'));var AGIError=require(_0x443c('0x4'));function AGIChannel(_0x316773){var _0x946a91=this,_0x8dcaf2=new AGIReply(),_0x362c49=![],_0x56a8c4={};EventEmitter[_0x443c('0x5')](_0x946a91);_0x316773[_0x443c('0x6')]('utf8');_0x316773[_0x443c('0x7')](0x8*0x3c*0x3c*0x3e8);_0x8dcaf2['setEncoding']('utf8');_0x8dcaf2['on'](_0x443c('0x8'),function(_0x1892b9){for(var _0x7813bb in _0x1892b9){_0x946a91[_0x7813bb]=_0x1892b9[_0x7813bb];}_0x946a91[_0x443c('0x9')]('ready');});_0x8dcaf2['on'](_0x443c('0xa'),function(_0x339834){if(_0x339834['toLowerCase']()==_0x443c('0xb')){_0x946a91[_0x443c('0x9')](_0x443c('0xb'));return;}if(_0x339834[_0x443c('0xc')](0x0,0xb)==_0x443c('0xd')){_0x362c49=!![];}if(_0x362c49){_0x56a8c4['rx']+=_0x339834+'\x0a';if(_0x339834[_0x443c('0xe')](_0x443c('0xf'))!=-0x1){_0x362c49=![];}}else{_0x56a8c4['rx']=_0x339834;}if(_0x362c49){return;}if(typeof _0x56a8c4['cb']==_0x443c('0x10')){var _0x4a6524=_0x56a8c4['rx'][_0x443c('0xc')](0x0,0x3),_0x313d5a=null,_0x5175a1=null;_0x4a6524=parseInt(_0x4a6524);if(isNaN(_0x4a6524)){_0x56a8c4['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x443c('0x11')});return;}if(_0x4a6524!=0xc8){_0x56a8c4['cb'](null,{'code':_0x4a6524,'result':-0x1,'extra':'KO'});return;}_0x313d5a=_0x56a8c4['rx'][_0x443c('0xc')](0x4)[_0x443c('0x12')](_0x443c('0x13'),'');if(_0x313d5a[_0x443c('0x14')]('\x20')!=-0x1){_0x313d5a=_0x313d5a['substr'](0x0,_0x313d5a[_0x443c('0x14')]('\x20'));}if(_[_0x443c('0x15')](_0x313d5a,'-1')){_0x313d5a=parseInt(_0x313d5a);}_0x5175a1=_0x56a8c4['rx'][_0x443c('0x16')]('\x20');if(_0x5175a1[_0x443c('0x17')]==0x3){_0x5175a1=_0x5175a1[0x2][_0x443c('0xc')](0x1,_0x5175a1[0x2][_0x443c('0x17')]-0x1);}else if(_0x5175a1[_0x443c('0x17')]>0x3){var _0x6ed874=/\((.+)\)/;var _0x4722d3=_0x56a8c4['rx'][_0x443c('0x18')](_0x6ed874);if(_0x4722d3){_0x5175a1=_0x4722d3[0x1];}else{_0x5175a1=null;}}else{_0x5175a1=null;}_0x56a8c4['cb'](null,{'code':_0x4a6524,'result':_0x313d5a,'extra':_0x5175a1});}});_0x316773['on'](_0x443c('0x19'),function(_0x4e2662){_0x946a91['emit'](_0x443c('0x19'),new AGIError('E_AGI_SOCKET_ERROR',_0x4e2662[_0x443c('0x1a')]));});_0x316773['on'](_0x443c('0x1b'),function(){_0x946a91[_0x443c('0x9')](_0x443c('0x1b'),new AGIError(_0x443c('0x1c')));});_0x316773['on'](_0x443c('0x1d'),function(){_0x946a91[_0x443c('0x9')](_0x443c('0x1d'),new AGIError(_0x443c('0x1e')));_0x316773['destroy']();});_0x316773['pipe'](_0x8dcaf2);this['command']=function(_0x575589,_0x3c55bd){var _0x575589=_0x575589||'',_0x3c55bd=typeof _0x3c55bd=='function'?_0x3c55bd:new Function();_0x56a8c4={'tx':_0x575589,'rx':'','cb':_0x3c55bd};_0x316773[_0x443c('0x1f')](_0x575589+'\x0a');},this['close']=function(){_0x316773[_0x443c('0x20')]();};}util[_0x443c('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x443c('0x22')][_0x443c('0x23')]=function(_0x290f83){return this[_0x443c('0x24')]['sync'](this,_0x290f83);};AGIChannel[_0x443c('0x22')]['answer']=function(){return this[_0x443c('0x23')](_0x443c('0x25'));};AGIChannel[_0x443c('0x22')][_0x443c('0x26')]=function(_0x285c74,_0x3ba588,_0x38af0a){_0x285c74=_0x285c74===undefined?_0x443c('0x27'):_0x285c74;_0x3ba588=_0x3ba588===undefined?'5':_0x3ba588;_0x38af0a=_0x38af0a===undefined?'1':_0x38af0a;return this[_0x443c('0x23')](util['format'](_0x443c('0x28'),_0x285c74,_0x3ba588*0x3e8,_0x38af0a));};AGIChannel[_0x443c('0x22')][_0x443c('0x29')]=function(_0x12f2f3){_0x12f2f3=_0x12f2f3||_0x443c('0x2a');return this[_0x443c('0x23')](util[_0x443c('0x2b')](_0x443c('0x2c'),_0x12f2f3));};AGIChannel[_0x443c('0x22')][_0x443c('0x2d')]=function(_0x491ca2,_0x25a9d9){if(_['isArray'](_0x25a9d9)){return this[_0x443c('0x23')](util[_0x443c('0x2b')]('EXEC\x20%s\x20%s',_0x491ca2,_0x25a9d9[_0x443c('0x2e')](',')));}return this[_0x443c('0x23')](util[_0x443c('0x2b')](_0x443c('0x2f'),_0x491ca2,_0x25a9d9));};AGIChannel[_0x443c('0x22')][_0x443c('0x30')]=function(_0x5606de){return this[_0x443c('0x23')](util['format'](_0x443c('0x31'),_0x5606de));};AGIChannel[_0x443c('0x22')][_0x443c('0x32')]=function(_0x48fa3a){return this[_0x443c('0x23')](util[_0x443c('0x2b')](_0x443c('0x33'),_0x48fa3a));};AGIChannel[_0x443c('0x22')]['setPriority']=function(_0x153c5f){return this[_0x443c('0x23')](util[_0x443c('0x2b')](_0x443c('0x34'),_0x153c5f));};AGIChannel[_0x443c('0x22')][_0x443c('0xb')]=function(){return this[_0x443c('0x23')](_0x443c('0x35'));};AGIChannel[_0x443c('0x22')][_0x443c('0x36')]=function(_0x3ef3e2,_0x458df2){var _0x5345c4=_[_0x443c('0x37')](_0x458df2)||_[_0x443c('0x38')](_0x458df2)?_0x458df2['toString']():_0x458df2;return this[_0x443c('0x23')](util['format'](_0x443c('0x39'),_0x3ef3e2,_0x5345c4?_0x5345c4[_0x443c('0x3a')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x443c('0x22')][_0x443c('0x3b')]=function(_0x572e0a,_0x15266c){return this[_0x443c('0x23')](util[_0x443c('0x2b')](_0x443c('0x3c'),_0x572e0a,_0x15266c));};AGIChannel[_0x443c('0x22')][_0x443c('0x3d')]=function(_0x45f195,_0x68bffc){return this[_0x443c('0x23')](util[_0x443c('0x2b')]('SAY\x20DIGITS\x20%s\x20%s',_0x45f195,_0x68bffc));};AGIChannel[_0x443c('0x22')][_0x443c('0x3e')]=function(_0x5d18e6,_0x1b8715){return this['sendRequest'](util['format'](_0x443c('0x3f'),_0x5d18e6,_0x1b8715));};AGIChannel[_0x443c('0x22')]['continueAt']=function(_0x483028,_0x2487c2,_0xaf0647){_0x2487c2=_0x2487c2||this[_0x443c('0x40')];_0xaf0647=_0xaf0647||0x1;this[_0x443c('0x30')](_0x483028);this['setExtension'](_0x2487c2);this[_0x443c('0x41')](_0xaf0647);return this[_0x443c('0x29')](util['format'](_0x443c('0x42'),_0x483028,_0x2487c2,_0xaf0647));};AGIChannel[_0x443c('0x22')][_0x443c('0x43')]=function(_0x4220c2){return this[_0x443c('0x23')](util[_0x443c('0x2b')](_0x443c('0x44'),_0x4220c2));};AGIChannel[_0x443c('0x22')][_0x443c('0x45')]=function(_0x53285e,_0x1c9ed8,_0x3c17d9,_0x4650d0,_0x25ddcb,_0x56c44d){_0x1c9ed8=_0x1c9ed8||'wav';_0x3c17d9=_0x3c17d9||'';_0x4650d0=_0x4650d0===undefined?-0x1:_0x4650d0==='-1'?-0x1:_0x4650d0*0x3e8;_0x25ddcb=_0x25ddcb===undefined?'':'s='+_0x25ddcb;_0x56c44d=_0x56c44d?'BEEP':'';return this['sendRequest'](util[_0x443c('0x2b')](_0x443c('0x46'),_0x53285e,_0x1c9ed8,_0x3c17d9,_0x4650d0,_0x56c44d,_0x25ddcb));};AGIChannel[_0x443c('0x22')][_0x443c('0x47')]=function(_0x3a8962,_0x223010){_0x223010=_0x223010||'';return this[_0x443c('0x23')](util[_0x443c('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3a8962,_0x223010));};AGIChannel['prototype'][_0x443c('0x48')]=function(_0x421cc6){return this[_0x443c('0x2d')]('AGI',_0x421cc6);};AGIChannel[_0x443c('0x22')][_0x443c('0x49')]=function(_0x1f3e2e){return this[_0x443c('0x2d')](_0x443c('0x4a'),_0x1f3e2e);};AGIChannel[_0x443c('0x22')]['error']=function(_0x12ecf3,_0x23b19c){this[_0x443c('0x29')](util[_0x443c('0x2b')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x12ecf3['id'],_0x12ecf3['label'],_0x23b19c));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x443c('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 4c86926..0528b8e 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 _0xe1c7=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','E_AGI_UNDEFINED','push','format','message','name','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x5abd75,_0x240b60){var _0x3aabb2=function(_0x5b576d){while(--_0x5b576d){_0x5abd75['push'](_0x5abd75['shift']());}};_0x3aabb2(++_0x240b60);}(_0xe1c7,0x174));var _0x7e1c=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0xe1c7[_0x2d344f];return _0x2e796b;};'use strict';var util=require(_0x7e1c('0x0'));var error={'E_AGI_UNDEFINED':_0x7e1c('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x7e1c('0x2'),'E_AGI_SERVER_CLOSE':_0x7e1c('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x7e1c('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x7e1c('0x5'),'E_AGI_SOCKET_ERROR':_0x7e1c('0x6'),'E_AGI_SOCKET_CLOSE':_0x7e1c('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x7e1c('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x5bbabd){var _0x5bbabd=_0x5bbabd||null,_0x4d13d6=_0x4d13d6||[],_0x117c26=0x1,_0x540219='';if(!error[_0x5bbabd]){_0x5bbabd=_0x7e1c('0x9');}_0x4d13d6[_0x7e1c('0xa')](error[_0x5bbabd]);while(arguments[_0x117c26]){_0x4d13d6[_0x7e1c('0xa')](arguments[_0x117c26]);_0x117c26++;}_0x540219=util[_0x7e1c('0xb')]['apply'](util,_0x4d13d6);this[_0x7e1c('0xc')]=_0x540219;this[_0x7e1c('0xd')]=_0x5bbabd;}module['exports']=AGIError; \ No newline at end of file +var _0x49c1=['util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','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','apply','message','name','exports'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0x49c1,0x176));var _0x149c=function(_0x518a31,_0x45a321){_0x518a31=_0x518a31-0x0;var _0x5a281f=_0x49c1[_0x518a31];return _0x5a281f;};'use strict';var util=require(_0x149c('0x0'));var error={'E_AGI_UNDEFINED':_0x149c('0x1'),'E_AGI_ARGUMENT_PORT':_0x149c('0x2'),'E_AGI_SERVER_ERROR':_0x149c('0x3'),'E_AGI_SERVER_CLOSE':_0x149c('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x149c('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x149c('0x6'),'E_AGI_SOCKET_CLOSE':_0x149c('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x149c('0x8'),'E_AGI_COMMAND_EMPTY':_0x149c('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x149c('0xa'),'E_AGI_IVR_ENTRY':_0x149c('0xb')};function AGIError(_0x18de49){var _0x18de49=_0x18de49||null,_0x87be12=_0x87be12||[],_0x4d9037=0x1,_0x6c6f97='';if(!error[_0x18de49]){_0x18de49='E_AGI_UNDEFINED';}_0x87be12['push'](error[_0x18de49]);while(arguments[_0x4d9037]){_0x87be12[_0x149c('0xc')](arguments[_0x4d9037]);_0x4d9037++;}_0x6c6f97=util['format'][_0x149c('0xd')](util,_0x87be12);this[_0x149c('0xe')]=_0x6c6f97;this[_0x149c('0xf')]=_0x18de49;}module[_0x149c('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 93ae9d3..76c6121 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d45=['exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','defaults','redis','subscribe','emit','error','message','agi','parse','projectUpdate','E_AGI_SERVER_ERROR'];(function(_0x50701f,_0xae209e){var _0x3d63a8=function(_0x3f0915){while(--_0x3f0915){_0x50701f['push'](_0x50701f['shift']());}};_0x3d63a8(++_0xae209e);}(_0x5d45,0x1ee));var _0x55d4=function(_0x998913,_0x13949a){_0x998913=_0x998913-0x0;var _0x523b55=_0x5d45[_0x998913];return _0x523b55;};'use strict';var _=require(_0x55d4('0x0'));var EventEmitter=require(_0x55d4('0x1'))[_0x55d4('0x2')];var Redis=require(_0x55d4('0x3'));var AGIError=require(_0x55d4('0x4'));var config=require(_0x55d4('0x5'));config['redis']=_[_0x55d4('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x55d4('0x7')]);sub[_0x55d4('0x8')]('agi',function(_0x5a52bf){if(_0x5a52bf)return eventEmitter[_0x55d4('0x9')](_0x55d4('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0x5a52bf));});sub['on'](_0x55d4('0xb'),function(_0x1f96d4,_0x1cf3d5){if(_0x1f96d4!==_0x55d4('0xc'))return;try{var _0x2e6061=JSON[_0x55d4('0xd')](_0x1cf3d5);eventEmitter['emit'](_0x55d4('0xe'),_0x2e6061);}catch(_0x21e2c6){eventEmitter[_0x55d4('0x9')](_0x55d4('0xa'),new AGIError(_0x55d4('0xf'),_0x21e2c6));}});module[_0x55d4('0x10')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x491c=['localhost','subscribe','emit','error','E_AGI_SERVER_ERROR','agi','parse','projectUpdate','EventEmitter','./error','../../config/environment','redis','defaults'];(function(_0x3d90b4,_0x1e2fc6){var _0x4c65d3=function(_0x311abc){while(--_0x311abc){_0x3d90b4['push'](_0x3d90b4['shift']());}};_0x4c65d3(++_0x1e2fc6);}(_0x491c,0x119));var _0xc491=function(_0x232817,_0x21590f){_0x232817=_0x232817-0x0;var _0x314a37=_0x491c[_0x232817];return _0x314a37;};'use strict';var _=require('lodash');var EventEmitter=require('events')[_0xc491('0x0')];var Redis=require('ioredis');var AGIError=require(_0xc491('0x1'));var config=require(_0xc491('0x2'));config[_0xc491('0x3')]=_[_0xc491('0x4')](config[_0xc491('0x3')],{'host':_0xc491('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xc491('0x3')]);sub[_0xc491('0x6')]('agi',function(_0x1dbdcb){if(_0x1dbdcb)return eventEmitter[_0xc491('0x7')](_0xc491('0x8'),new AGIError(_0xc491('0x9'),_0x1dbdcb));});sub['on']('message',function(_0x55ef10,_0x43d8a4){if(_0x55ef10!==_0xc491('0xa'))return;try{var _0x37c3a2=JSON[_0xc491('0xb')](_0x43d8a4);eventEmitter[_0xc491('0x7')](_0xc491('0xc'),_0x37c3a2);}catch(_0x1f5085){eventEmitter[_0xc491('0x7')](_0xc491('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x1f5085));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 9c5d48f..c979e57 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 _0x0b95=['max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addEdge','size','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','condition','agicommand','vswitch','default','target','invalid','default\x20on\x20switch\x20not\x20found'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x0b95,0x198));var _0x50b9=function(_0x10a60a,_0x268002){_0x10a60a=_0x10a60a-0x0;var _0x5c3b81=_0x0b95[_0x10a60a];return _0x5c3b81;};'use strict';var _=require('lodash');var logger=require(_0x50b9('0x0'))(_0x50b9('0x1'));var verticesWithRetry=[_0x50b9('0x2'),_0x50b9('0x3'),_0x50b9('0x4')];var Graph=function(){this[_0x50b9('0x5')]={};this[_0x50b9('0x6')]={};this[_0x50b9('0x7')]=0x0;};Graph['prototype']['addVertex']=function(_0x557f40){this[_0x50b9('0x5')][_0x557f40['id']]=_0x557f40;this[_0x50b9('0x6')][_0x557f40['id']]=[];};Graph[_0x50b9('0x8')][_0x50b9('0x9')]=function(_0x4ffdd8,_0x2b5fbb,_0x57c525){this['edges'][_0x4ffdd8]['push']({'target':_0x2b5fbb,'condition':_0x57c525});this[_0x50b9('0x7')]+=0x1;};Graph['prototype'][_0x50b9('0xa')]=function(){return _[_0x50b9('0xa')](this['vertices']);};Graph[_0x50b9('0x8')]['relations']=function(){return this[_0x50b9('0x7')];};Graph[_0x50b9('0x8')][_0x50b9('0xb')]=function(_0xf0801b){return this[_0x50b9('0x5')][_0xf0801b];};Graph[_0x50b9('0x8')][_0x50b9('0xc')]=function(_0x16e909,_0x4a8b47){if(!this[_0x50b9('0x5')][_0x16e909]){return logger[_0x50b9('0xd')](_0x50b9('0xe'));}var _0x305aeb=_0x4a8b47(this[_0x50b9('0x5')][_0x16e909]);if(!_0x305aeb){return logger['info'](_0x50b9('0xf'));}if(this['edges'][_0x16e909][_0x50b9('0x10')]===0x0){return logger[_0x50b9('0xd')]('no\x20edge/s\x20available');}for(var _0x5cc064=0x0,_0x1faff5=[],_0x4f2fd2=![];_0x5cc064\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','evtHangup','createSquareReport','catch','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find','handleNotFound','production','initialize','then','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','finally','connection','lodash','../../config/environment','../../config/logger','../../config/license/util','./project','./events'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xfc67,0x1c5));var _0x7fc6=function(_0x2511c6,_0x5859ca){_0x2511c6=_0x2511c6-0x0;var _0x10a803=_0xfc67[_0x2511c6];return _0x10a803;};'use strict';var _=require(_0x7fc6('0x0'));var syncho=require('syncho');var util=require('util');var config=require(_0x7fc6('0x1'));var logger=require(_0x7fc6('0x2'))('agi');var utilLicense=require(_0x7fc6('0x3'));var rpc=require('./rpc');var Project=require(_0x7fc6('0x4'));var AGIEmitter=require(_0x7fc6('0x5'))[_0x7fc6('0x6')];var projects=[];config[_0x7fc6('0x7')]=_['defaults'](config[_0x7fc6('0x7')],{'ip':_0x7fc6('0x8'),'port':0x11dd});AGIEmitter['on'](_0x7fc6('0x9'),projectUpdateHandler);function connectionHandler(_0x468fe9){process[_0x7fc6('0xa')](function(){syncho(function(){try{setChannelVariables(_0x468fe9);agiHandler(_0x468fe9);}catch(_0x9a0492){logger[_0x7fc6('0xb')](_0x9a0492[_0x7fc6('0xc')]);}});});}function projectUpdateHandler(_0x2aa0f7){try{var _0x3e80c1=_[_0x7fc6('0xd')](projects,['id',_0x2aa0f7['id']]);if(_0x3e80c1>-0x1){if(_0x2aa0f7['deleted']===!![]){projects[_0x7fc6('0xe')](_0x3e80c1,0x1);}else{projects[_0x3e80c1]=_0x2aa0f7;}}else{projects[_0x7fc6('0xf')](_0x2aa0f7);}}catch(_0x37f836){logger[_0x7fc6('0xb')](_0x37f836[_0x7fc6('0xc')]);}}function listeningHandler(){console['log'](_0x7fc6('0x10'),config[_0x7fc6('0x7')][_0x7fc6('0x11')]);logger[_0x7fc6('0x12')](util['format'](_0x7fc6('0x13'),config[_0x7fc6('0x7')]['ip'],config[_0x7fc6('0x7')]['port']));}function errorHandler(_0x47c567){if(_0x47c567&&_0x47c567['name']&&_0x47c567[_0x7fc6('0x14')]){logger['error'](util[_0x7fc6('0x15')](_0x7fc6('0x16'),_0x47c567['name'],_0x47c567['message']));}else{logger['error'](util['format'](_0x7fc6('0x17'),_0x47c567[_0x7fc6('0xc')]));}}function closeHandler(){logger['info'](util[_0x7fc6('0x15')](_0x7fc6('0x18'),this[_0x7fc6('0x19')],this[_0x7fc6('0x1a')],this[_0x7fc6('0x1b')],this['dnid'],this[_0x7fc6('0x1c')]));try{createSquareReport(this);}catch(_0x398196){logger[_0x7fc6('0xb')](_0x398196[_0x7fc6('0xc')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x7fc6('0x19')],this['calleridname'],this[_0x7fc6('0x1b')],this['dnid'],this[_0x7fc6('0x1c')]));}function hangupHandler(){logger[_0x7fc6('0x12')](util[_0x7fc6('0x15')](_0x7fc6('0x1d'),this[_0x7fc6('0x19')],this[_0x7fc6('0x1a')],this['callerid'],this[_0x7fc6('0x1e')],this[_0x7fc6('0x1c')]));this[_0x7fc6('0x1f')]=!![];}function createSquareReport(_0x56e73f,_0x410c7f){rpc[_0x7fc6('0x20')](_0x56e73f)['then'](function(_0x2bf48a){if(_0x410c7f){_0x410c7f(null,_0x2bf48a);}})[_0x7fc6('0x21')](function(_0x753225){if(_0x410c7f){_0x410c7f(null,_0x753225);}});}function setChannelVariables(_0x14f26c){for(var _0x46cc06 in _0x14f26c){if(_0x14f26c['hasOwnProperty'](_0x46cc06)){if(_0x46cc06['indexOf']('agi_')===0x0){_0x14f26c[_0x46cc06[_0x7fc6('0x22')](0x4)]=_0x14f26c[_0x46cc06];delete _0x14f26c[_0x46cc06];}}}}function agiHandler(_0x2624c4){logger[_0x7fc6('0x23')](_0x7fc6('0x24'),JSON[_0x7fc6('0x25')](_0x2624c4,null,0x2));logger['info'](util[_0x7fc6('0x15')](_0x7fc6('0x26'),_0x2624c4[_0x7fc6('0x19')],_0x2624c4[_0x7fc6('0x1a')],_0x2624c4[_0x7fc6('0x1b')],_0x2624c4[_0x7fc6('0x1e')],_0x2624c4[_0x7fc6('0x1c')]));_0x2624c4['on'](_0x7fc6('0xb'),errorHandler);_0x2624c4['on'](_0x7fc6('0x27'),closeHandler);_0x2624c4['on'](_0x7fc6('0x28'),timeoutHandler);_0x2624c4[_0x7fc6('0x1f')]=![];_0x2624c4['on']('hangup',hangupHandler);var _0x539c7f=_[_0x7fc6('0x29')](projects,['name',_0x2624c4[_0x7fc6('0x19')]]);if(!_0x539c7f)return Project[_0x7fc6('0x2a')](_0x2624c4);if(!_0x539c7f[_0x7fc6('0x2b')])return Project['handleUnpublished'](_0x2624c4);return Project[_0x7fc6('0x2c')](_0x539c7f,_0x2624c4);}function main(){var _0x4383d2;return utilLicense['getLicense']()[_0x7fc6('0x2d')](function(_0x56429b){if(!_0x56429b)return;if(_0x56429b['voice']){if(_0x56429b[_0x7fc6('0x2e')]&&_0x56429b[_0x7fc6('0x2e')]>0x0){logger[_0x7fc6('0x12')](util[_0x7fc6('0x15')](_0x7fc6('0x2f'),_0x56429b[_0x7fc6('0x2e')]));_0x4383d2=_0x56429b[_0x7fc6('0x2e')];}else{logger[_0x7fc6('0x12')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0x7fc6('0x30'));_0x4383d2=-0x1;}})[_0x7fc6('0x2d')](function(){return Project['getAll']();})[_0x7fc6('0x2d')](function(_0x450e99){projects=_0x450e99;return;})[_0x7fc6('0x21')](function(_0x39537d){logger[_0x7fc6('0xb')]('[LICENSE]',_0x39537d['stack']);})[_0x7fc6('0x31')](function(){var _0x3bc9e3=require('./server')(config['agi']['port'],config[_0x7fc6('0x7')]['ip'],_0x4383d2);_0x3bc9e3['on']('error',errorHandler);_0x3bc9e3['on']('listening',listeningHandler);_0x3bc9e3['on'](_0x7fc6('0x32'),connectionHandler);_0x3bc9e3['on'](_0x7fc6('0x27'),closeHandler);});}main(); \ No newline at end of file +var _0xaaf3=['./events','127.0.0.1','projectUpdate','nextTick','error','findIndex','deleted','splice','push','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','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','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','substring','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','finally','./server','connection','close','lodash','syncho','util','../../config/environment','agi','./rpc','./project'];(function(_0x1057c1,_0x304451){var _0x4d46b2=function(_0x25913c){while(--_0x25913c){_0x1057c1['push'](_0x1057c1['shift']());}};_0x4d46b2(++_0x304451);}(_0xaaf3,0x6d));var _0x3aaf=function(_0x37e8db,_0x408563){_0x37e8db=_0x37e8db-0x0;var _0x1d6ad2=_0xaaf3[_0x37e8db];return _0x1d6ad2;};'use strict';var _=require(_0x3aaf('0x0'));var syncho=require(_0x3aaf('0x1'));var util=require(_0x3aaf('0x2'));var config=require(_0x3aaf('0x3'));var logger=require('../../config/logger')(_0x3aaf('0x4'));var utilLicense=require('../../config/license/util');var rpc=require(_0x3aaf('0x5'));var Project=require(_0x3aaf('0x6'));var AGIEmitter=require(_0x3aaf('0x7'))['EventEmitter'];var projects=[];config[_0x3aaf('0x4')]=_['defaults'](config[_0x3aaf('0x4')],{'ip':_0x3aaf('0x8'),'port':0x11dd});AGIEmitter['on'](_0x3aaf('0x9'),projectUpdateHandler);function connectionHandler(_0x40e905){process[_0x3aaf('0xa')](function(){syncho(function(){try{setChannelVariables(_0x40e905);agiHandler(_0x40e905);}catch(_0x435060){logger[_0x3aaf('0xb')](_0x435060['stack']);}});});}function projectUpdateHandler(_0x21d829){try{var _0x3f6129=_[_0x3aaf('0xc')](projects,['id',_0x21d829['id']]);if(_0x3f6129>-0x1){if(_0x21d829[_0x3aaf('0xd')]===!![]){projects[_0x3aaf('0xe')](_0x3f6129,0x1);}else{projects[_0x3f6129]=_0x21d829;}}else{projects[_0x3aaf('0xf')](_0x21d829);}}catch(_0x5b38e2){logger[_0x3aaf('0xb')](_0x5b38e2[_0x3aaf('0x10')]);}}function listeningHandler(){console[_0x3aaf('0x11')](_0x3aaf('0x12'),config[_0x3aaf('0x4')]['port']);logger['info'](util[_0x3aaf('0x13')](_0x3aaf('0x14'),config[_0x3aaf('0x4')]['ip'],config[_0x3aaf('0x4')][_0x3aaf('0x15')]));}function errorHandler(_0x12250e){if(_0x12250e&&_0x12250e[_0x3aaf('0x16')]&&_0x12250e['message']){logger[_0x3aaf('0xb')](util[_0x3aaf('0x13')]('[%s]\x20%s',_0x12250e[_0x3aaf('0x16')],_0x12250e['message']));}else{logger[_0x3aaf('0xb')](util['format'](_0x3aaf('0x17'),_0x12250e[_0x3aaf('0x10')]));}}function closeHandler(){logger[_0x3aaf('0x18')](util[_0x3aaf('0x13')](_0x3aaf('0x19'),this[_0x3aaf('0x1a')],this[_0x3aaf('0x1b')],this[_0x3aaf('0x1c')],this[_0x3aaf('0x1d')],this[_0x3aaf('0x1e')]));try{createSquareReport(this);}catch(_0x2491b8){logger[_0x3aaf('0xb')](_0x2491b8[_0x3aaf('0x10')]);}}function timeoutHandler(){logger[_0x3aaf('0x18')](util[_0x3aaf('0x13')](_0x3aaf('0x1f'),this['arg_1'],this[_0x3aaf('0x1b')],this['callerid'],this['dnid'],this[_0x3aaf('0x1e')]));}function hangupHandler(){logger[_0x3aaf('0x18')](util[_0x3aaf('0x13')](_0x3aaf('0x20'),this['arg_1'],this[_0x3aaf('0x1b')],this[_0x3aaf('0x1c')],this[_0x3aaf('0x1d')],this[_0x3aaf('0x1e')]));this[_0x3aaf('0x21')]=!![];}function createSquareReport(_0x3e3d8e,_0x339d1c){rpc[_0x3aaf('0x22')](_0x3e3d8e)[_0x3aaf('0x23')](function(_0x23dc3e){if(_0x339d1c){_0x339d1c(null,_0x23dc3e);}})[_0x3aaf('0x24')](function(_0x188123){if(_0x339d1c){_0x339d1c(null,_0x188123);}});}function setChannelVariables(_0x41dc8c){for(var _0x35b9b4 in _0x41dc8c){if(_0x41dc8c[_0x3aaf('0x25')](_0x35b9b4)){if(_0x35b9b4[_0x3aaf('0x26')]('agi_')===0x0){_0x41dc8c[_0x35b9b4[_0x3aaf('0x27')](0x4)]=_0x41dc8c[_0x35b9b4];delete _0x41dc8c[_0x35b9b4];}}}}function agiHandler(_0x5482c9){logger['debug']('variables',JSON[_0x3aaf('0x28')](_0x5482c9,null,0x2));logger['info'](util[_0x3aaf('0x13')](_0x3aaf('0x29'),_0x5482c9[_0x3aaf('0x1a')],_0x5482c9['calleridname'],_0x5482c9[_0x3aaf('0x1c')],_0x5482c9[_0x3aaf('0x1d')],_0x5482c9['uniqueid']));_0x5482c9['on'](_0x3aaf('0xb'),errorHandler);_0x5482c9['on']('close',closeHandler);_0x5482c9['on'](_0x3aaf('0x2a'),timeoutHandler);_0x5482c9[_0x3aaf('0x21')]=![];_0x5482c9['on'](_0x3aaf('0x2b'),hangupHandler);var _0x5629d8=_[_0x3aaf('0x2c')](projects,[_0x3aaf('0x16'),_0x5482c9[_0x3aaf('0x1a')]]);if(!_0x5629d8)return Project[_0x3aaf('0x2d')](_0x5482c9);if(!_0x5629d8[_0x3aaf('0x2e')])return Project[_0x3aaf('0x2f')](_0x5482c9);return Project[_0x3aaf('0x30')](_0x5629d8,_0x5482c9);}function main(){var _0x3eb681;return utilLicense[_0x3aaf('0x31')]()[_0x3aaf('0x23')](function(_0x7a76d5){if(!_0x7a76d5)return;if(_0x7a76d5[_0x3aaf('0x32')]){if(_0x7a76d5[_0x3aaf('0x33')]&&_0x7a76d5[_0x3aaf('0x33')]>0x0){logger[_0x3aaf('0x18')](util[_0x3aaf('0x13')](_0x3aaf('0x34'),_0x7a76d5[_0x3aaf('0x33')]));_0x3eb681=_0x7a76d5['callysquare'];}else{logger[_0x3aaf('0x18')](_0x3aaf('0x35'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x3eb681=-0x1;}})['then'](function(){return Project['getAll']();})[_0x3aaf('0x23')](function(_0x424799){projects=_0x424799;return;})[_0x3aaf('0x24')](function(_0x472a63){logger[_0x3aaf('0xb')]('[LICENSE]',_0x472a63[_0x3aaf('0x10')]);})[_0x3aaf('0x36')](function(){var _0x48752e=require(_0x3aaf('0x37'))(config[_0x3aaf('0x4')][_0x3aaf('0x15')],config[_0x3aaf('0x4')]['ip'],_0x3eb681);_0x48752e['on'](_0x3aaf('0xb'),errorHandler);_0x48752e['on']('listening',listeningHandler);_0x48752e['on'](_0x3aaf('0x38'),connectionHandler);_0x48752e['on'](_0x3aaf('0x39'),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 2597da5..c657412 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 _0x3937=['error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then'];(function(_0x4f5c7b,_0xdc310e){var _0x317aee=function(_0x53b241){while(--_0x53b241){_0x4f5c7b['push'](_0x4f5c7b['shift']());}};_0x317aee(++_0xdc310e);}(_0x3937,0x11a));var _0x7393=function(_0x292250,_0x978c7a){_0x292250=_0x292250-0x0;var _0x49be41=_0x3937[_0x292250];return _0x49be41;};'use strict';var BPromise=require(_0x7393('0x0'));var jayson=require(_0x7393('0x1'));var client=jayson[_0x7393('0x2')][_0x7393('0x3')]({'port':0x232b});function request(_0x287bd1,_0x3bf2f0){return new BPromise(function(_0x5aa9ef,_0x3fcf70){return client[_0x7393('0x4')](_0x287bd1,_0x3bf2f0)[_0x7393('0x5')](function(_0x463067){if(_0x463067[_0x7393('0x6')]){return _0x3fcf70(_0x463067[_0x7393('0x6')][_0x7393('0x7')]);}else{return _0x5aa9ef(_0x463067[_0x7393('0x8')]);}})[_0x7393('0x9')](function(_0x586378){return _0x3fcf70(_0x586378);});});}exports[_0x7393('0xa')]=function(_0x4ce57c,_0x164781){return request(_0x7393('0xb'),{'account':_0x4ce57c,'message':_0x164781});}; \ No newline at end of file +var _0x17b6=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','then','error'];(function(_0x4f164a,_0x2a04c4){var _0x33b855=function(_0x2be19c){while(--_0x2be19c){_0x4f164a['push'](_0x4f164a['shift']());}};_0x33b855(++_0x2a04c4);}(_0x17b6,0x1eb));var _0x617b=function(_0x5af30f,_0x2cbc64){_0x5af30f=_0x5af30f-0x0;var _0x44113e=_0x17b6[_0x5af30f];return _0x44113e;};'use strict';var BPromise=require(_0x617b('0x0'));var jayson=require(_0x617b('0x1'));var client=jayson[_0x617b('0x2')]['http']({'port':0x232b});function request(_0x55f502,_0x5b673d){return new BPromise(function(_0x18c63a,_0xf3460){return client['request'](_0x55f502,_0x5b673d)[_0x617b('0x3')](function(_0x33c036){if(_0x33c036[_0x617b('0x4')]){return _0xf3460(_0x33c036[_0x617b('0x4')]['message']);}else{return _0x18c63a(_0x33c036['result']);}})[_0x617b('0x5')](function(_0x447715){return _0xf3460(_0x447715);});});}exports[_0x617b('0x6')]=function(_0x52aac5,_0x5c4b74){return request(_0x617b('0x7'),{'account':_0x52aac5,'message':_0x5c4b74});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index c9720f6..0028573 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4a9=['calleridname','callerid','dnid','uniqueid','traverseBFS','clear','stringify','gotoc','context','extension','response','result','evtHangup','isUndefined','toString','error','finally','vertex','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','priority','continueAt','close','lodash','util','../../config/logger','agi','./rpc','./graph','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','debug','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info'];(function(_0xfe1732,_0x3f89e9){var _0x5cb5e7=function(_0x45a1dd){while(--_0x45a1dd){_0xfe1732['push'](_0xfe1732['shift']());}};_0x5cb5e7(++_0x3f89e9);}(_0xd4a9,0x1b6));var _0x9d4a=function(_0x204806,_0x47e015){_0x204806=_0x204806-0x0;var _0x53e807=_0xd4a9[_0x204806];return _0x53e807;};'use strict';var _=require(_0x9d4a('0x0'));var moment=require('moment');var parser=require('xml2json');var util=require(_0x9d4a('0x1'));var logger=require(_0x9d4a('0x2'))(_0x9d4a('0x3'));var rpc=require(_0x9d4a('0x4'));var mailRpc=require('./mailRpc');var Graph=require(_0x9d4a('0x5'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x9d4a('0x6')]()[_0x9d4a('0x7')](function(_0x10c7e4){logger['error'](_0x9d4a('0x8'),_0x10c7e4[_0x9d4a('0x9')]);return[];});}function addVertex(_0xcf4fef,_0x2232f9,_0x5a7fa9){_0x2232f9[_0x9d4a('0xa')]=_0x5a7fa9;if(_0x2232f9['hasOwnProperty'](_0x9d4a('0xb'))){_0x2232f9[_0x9d4a('0xc')]=parseInt(_0x2232f9[_0x9d4a('0xb')],0xa);}_0xcf4fef[_0x9d4a('0xd')](_[_0x9d4a('0xe')](_0x2232f9,_0x9d4a('0xf')));}function initGraph(_0x393931,_0x4c5f27){var _0x4bc83d=new Graph();for(var _0x32b28c in _0x393931){if(_0x393931[_0x9d4a('0x10')](_0x32b28c)){if(_[_0x9d4a('0x11')](_0x393931[_0x32b28c])){for(var _0x547e06=0x0;_0x547e06<_0x393931[_0x32b28c]['length'];_0x547e06+=0x1){addVertex(_0x4bc83d,_0x393931[_0x32b28c][_0x547e06],_0x32b28c);}}else{addVertex(_0x4bc83d,_0x393931[_0x32b28c],_0x32b28c);}}}for(var _0x47fb1e=0x0;_0x47fb1e<_0x4c5f27[_0x9d4a('0x12')];_0x47fb1e+=0x1){if(_0x4c5f27[_0x47fb1e][_0x9d4a('0x13')]&&_0x4c5f27[_0x47fb1e][_0x9d4a('0x14')]){_0x4bc83d[_0x9d4a('0x15')](_0x4c5f27[_0x47fb1e][_0x9d4a('0x13')],_0x4c5f27[_0x47fb1e]['target'],_0x4c5f27[_0x47fb1e][_0x9d4a('0x16')]);}}return _0x4bc83d;}function getRoot(_0x4bb728){return parser[_0x9d4a('0x17')](_0x4bb728,{'object':!![]})[_0x9d4a('0x18')][_0x9d4a('0x19')];}function inspect(_0x329051){return util[_0x9d4a('0x1a')](_0x329051,{'showHidden':![],'depth':null});}function initialize(_0x42dd0e,_0x3a13a7){var _0x34e293=getRoot(_0x42dd0e[_0x9d4a('0x1b')]);if(!_0x34e293||!_0x34e293[_0x9d4a('0x1c')])return;var _0x3076f6,_0x321c45,_0x383679;logger[_0x9d4a('0x1d')](_0x9d4a('0x19'),JSON['stringify'](_0x34e293,null,0x2));_0x3a13a7[_0x9d4a('0x1e')]=moment()[_0x9d4a('0x1f')](_0x9d4a('0x20'));_0x3076f6=initGraph(_[_0x9d4a('0xe')](_0x34e293,_0x9d4a('0xf')),_0x34e293['mxCell']);_0x321c45=new Vertices(_0x3a13a7,rpc,mailRpc);logger[_0x9d4a('0x21')](util[_0x9d4a('0x1f')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3a13a7['arg_1'],_0x3a13a7[_0x9d4a('0x22')],_0x3a13a7[_0x9d4a('0x23')],_0x3a13a7[_0x9d4a('0x24')],_0x3a13a7[_0x9d4a('0x25')]));_0x3076f6[_0x9d4a('0x26')](_0x34e293['start']['id'],function(_0x551a74){try{_0x551a74=_0x321c45[_0x9d4a('0x27')](_0x551a74);logger[_0x9d4a('0x1d')]('vertex',JSON[_0x9d4a('0x28')](_0x551a74,null,0x2));if(_0x551a74[_0x9d4a('0xa')]===_0x9d4a('0x29')){logger[_0x9d4a('0x21')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x3a13a7[_0x9d4a('0x2a')]=_0x551a74[_0x9d4a('0x2a')]||_0x3a13a7['context'];_0x3a13a7[_0x9d4a('0x2b')]=_0x551a74['extension'];_0x3a13a7['priority']=_0x551a74['priority']?_0x551a74['priority']-0x1:0x1;return null;}else if(_0x551a74&&_0x321c45[_0x551a74['agicommand']]){_0x383679=_0x321c45[_0x551a74[_0x9d4a('0xa')]](_0x551a74);logger[_0x9d4a('0x21')](_0x9d4a('0x2c'),JSON[_0x9d4a('0x28')](_0x383679,null,0x2));if(_0x383679&&_0x383679['code']===AGI_CODE_SUCCESS&&_0x383679[_0x9d4a('0x2d')]!==AGI_RESULT_ERROR&&!_0x3a13a7[_0x9d4a('0x2e')]){logger[_0x9d4a('0x1d')](_0x9d4a('0x2c'),inspect(_0x383679));return _[_0x9d4a('0x2f')](_0x383679['result'])?null:_0x383679[_0x9d4a('0x2d')][_0x9d4a('0x30')]();}else{logger['error']('response',inspect(_0x383679));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x5672ec){logger[_0x9d4a('0x31')](_0x5672ec[_0x9d4a('0x9')]);return null;}});if(_0x34e293[_0x9d4a('0x32')]){logger[_0x9d4a('0x21')](util[_0x9d4a('0x1f')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3a13a7['arg_1'],_0x3a13a7[_0x9d4a('0x22')],_0x3a13a7[_0x9d4a('0x23')],_0x3a13a7[_0x9d4a('0x24')],_0x3a13a7['uniqueid']));_0x3076f6[_0x9d4a('0x26')](_0x34e293['finally']['id'],function(_0xf41596){try{_0xf41596=_0x321c45[_0x9d4a('0x27')](_0xf41596);logger[_0x9d4a('0x1d')](_0x9d4a('0x33'),JSON[_0x9d4a('0x28')](_0xf41596,null,0x2));if(_0xf41596&&_0x321c45[_0xf41596[_0x9d4a('0xa')]]){_0x383679=_0x321c45[_0xf41596[_0x9d4a('0xa')]](_0xf41596);if(_0x383679){logger[_0x9d4a('0x1d')](_0x9d4a('0x2c'),inspect(_0x383679));return _['isUndefined'](_0x383679['result'])?null:_0x383679[_0x9d4a('0x2d')][_0x9d4a('0x30')]();}else{logger['error'](_0x9d4a('0x2c'),inspect(_0x383679));return null;}}else{logger[_0x9d4a('0x31')](_0x9d4a('0x34'));return null;}}catch(_0x206949){logger[_0x9d4a('0x31')](_0x206949[_0x9d4a('0x9')]);return null;}});}logger[_0x9d4a('0x21')](util['format'](_0x9d4a('0x35'),_0x3a13a7[_0x9d4a('0x36')],_0x3a13a7['calleridname'],_0x3a13a7[_0x9d4a('0x23')],_0x3a13a7[_0x9d4a('0x24')],_0x3a13a7[_0x9d4a('0x25')]));logger[_0x9d4a('0x21')](util['format'](_0x9d4a('0x37'),_0x3a13a7[_0x9d4a('0x2a')],_0x3a13a7[_0x9d4a('0x2b')],parseInt(_0x3a13a7[_0x9d4a('0x38')],0xa)+0x1));_0x3a13a7[_0x9d4a('0x39')](_0x3a13a7['context'],_0x3a13a7[_0x9d4a('0x2b')],parseInt(_0x3a13a7[_0x9d4a('0x38')],0xa)+0x1);_0x3a13a7[_0x9d4a('0x3a')]();}function handleNotFound(_0x572c7e){logger['error'](util[_0x9d4a('0x1f')]('Project\x20%s\x20not\x20found',_0x572c7e['arg_1']));_0x572c7e[_0x9d4a('0x39')](_0x572c7e[_0x9d4a('0x2a')],_0x572c7e[_0x9d4a('0x2b')],parseInt(_0x572c7e[_0x9d4a('0x38')],0xa)+0x1);_0x572c7e[_0x9d4a('0x3a')]();}function handleUnpublished(_0x80e56d){logger['error'](util[_0x9d4a('0x1f')]('Project\x20%s\x20not\x20published',_0x80e56d[_0x9d4a('0x36')]));_0x80e56d[_0x9d4a('0x39')](_0x80e56d[_0x9d4a('0x2a')],_0x80e56d['extension'],parseInt(_0x80e56d[_0x9d4a('0x38')],0xa)+0x1);_0x80e56d[_0x9d4a('0x3a')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x9873=['./graph','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','stringify','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','isUndefined','result','toString','error','agicommand\x20not\x20found','finally','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','util','./rpc'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x9873,0xb0));var _0x3987=function(_0x25734e,_0x3abe26){_0x25734e=_0x25734e-0x0;var _0x270e59=_0x9873[_0x25734e];return _0x270e59;};'use strict';var _=require(_0x3987('0x0'));var moment=require(_0x3987('0x1'));var parser=require('xml2json');var util=require(_0x3987('0x2'));var logger=require('../../config/logger')('agi');var rpc=require(_0x3987('0x3'));var mailRpc=require('./mailRpc');var Graph=require(_0x3987('0x4'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x3987('0x5')]()[_0x3987('0x6')](function(_0xfa698e){logger['error'](_0x3987('0x7'),_0xfa698e[_0x3987('0x8')]);return[];});}function addVertex(_0x54af28,_0x3f11b9,_0x4eeebb){_0x3f11b9[_0x3987('0x9')]=_0x4eeebb;if(_0x3f11b9[_0x3987('0xa')]('retry')){_0x3f11b9[_0x3987('0xb')]=parseInt(_0x3f11b9[_0x3987('0xc')],0xa);}_0x54af28[_0x3987('0xd')](_[_0x3987('0xe')](_0x3f11b9,_0x3987('0xf')));}function initGraph(_0x3acb53,_0x1484b0){var _0x57f622=new Graph();for(var _0x457625 in _0x3acb53){if(_0x3acb53[_0x3987('0xa')](_0x457625)){if(_[_0x3987('0x10')](_0x3acb53[_0x457625])){for(var _0x78cd9e=0x0;_0x78cd9e<_0x3acb53[_0x457625]['length'];_0x78cd9e+=0x1){addVertex(_0x57f622,_0x3acb53[_0x457625][_0x78cd9e],_0x457625);}}else{addVertex(_0x57f622,_0x3acb53[_0x457625],_0x457625);}}}for(var _0x328895=0x0;_0x328895<_0x1484b0['length'];_0x328895+=0x1){if(_0x1484b0[_0x328895][_0x3987('0x11')]&&_0x1484b0[_0x328895][_0x3987('0x12')]){_0x57f622[_0x3987('0x13')](_0x1484b0[_0x328895][_0x3987('0x11')],_0x1484b0[_0x328895][_0x3987('0x12')],_0x1484b0[_0x328895][_0x3987('0x14')]);}}return _0x57f622;}function getRoot(_0x20e7f4){return parser[_0x3987('0x15')](_0x20e7f4,{'object':!![]})[_0x3987('0x16')][_0x3987('0x17')];}function inspect(_0x4e3657){return util[_0x3987('0x18')](_0x4e3657,{'showHidden':![],'depth':null});}function initialize(_0x3fc05d,_0x2bfa53){var _0x278835=getRoot(_0x3fc05d[_0x3987('0x19')]);if(!_0x278835||!_0x278835[_0x3987('0x1a')])return;var _0xfe39e,_0x2a15da,_0x2f5c80;logger[_0x3987('0x1b')](_0x3987('0x17'),JSON['stringify'](_0x278835,null,0x2));_0x2bfa53[_0x3987('0x1c')]=moment()['format'](_0x3987('0x1d'));_0xfe39e=initGraph(_[_0x3987('0xe')](_0x278835,_0x3987('0xf')),_0x278835[_0x3987('0xf')]);_0x2a15da=new Vertices(_0x2bfa53,rpc,mailRpc);logger[_0x3987('0x1e')](util[_0x3987('0x1f')](_0x3987('0x20'),_0x2bfa53[_0x3987('0x21')],_0x2bfa53[_0x3987('0x22')],_0x2bfa53[_0x3987('0x23')],_0x2bfa53[_0x3987('0x24')],_0x2bfa53[_0x3987('0x25')]));_0xfe39e[_0x3987('0x26')](_0x278835[_0x3987('0x1a')]['id'],function(_0x13b678){try{_0x13b678=_0x2a15da[_0x3987('0x27')](_0x13b678);logger[_0x3987('0x1b')](_0x3987('0x28'),JSON[_0x3987('0x29')](_0x13b678,null,0x2));if(_0x13b678[_0x3987('0x9')]===_0x3987('0x2a')){logger[_0x3987('0x1e')](_0x3987('0x2b'));_0x2bfa53[_0x3987('0x2c')]=_0x13b678[_0x3987('0x2c')]||_0x2bfa53[_0x3987('0x2c')];_0x2bfa53['extension']=_0x13b678[_0x3987('0x2d')];_0x2bfa53[_0x3987('0x2e')]=_0x13b678['priority']?_0x13b678[_0x3987('0x2e')]-0x1:0x1;return null;}else if(_0x13b678&&_0x2a15da[_0x13b678[_0x3987('0x9')]]){_0x2f5c80=_0x2a15da[_0x13b678['agicommand']](_0x13b678);logger[_0x3987('0x1e')](_0x3987('0x2f'),JSON[_0x3987('0x29')](_0x2f5c80,null,0x2));if(_0x2f5c80&&_0x2f5c80[_0x3987('0x30')]===AGI_CODE_SUCCESS&&_0x2f5c80['result']!==AGI_RESULT_ERROR&&!_0x2bfa53['evtHangup']){logger[_0x3987('0x1b')](_0x3987('0x2f'),inspect(_0x2f5c80));return _[_0x3987('0x31')](_0x2f5c80[_0x3987('0x32')])?null:_0x2f5c80[_0x3987('0x32')][_0x3987('0x33')]();}else{logger[_0x3987('0x34')]('response',inspect(_0x2f5c80));return null;}}else{logger[_0x3987('0x34')](_0x3987('0x35'));return null;}}catch(_0x405e7e){logger[_0x3987('0x34')](_0x405e7e['stack']);return null;}});if(_0x278835[_0x3987('0x36')]){logger[_0x3987('0x1e')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2bfa53['arg_1'],_0x2bfa53[_0x3987('0x22')],_0x2bfa53['callerid'],_0x2bfa53['dnid'],_0x2bfa53['uniqueid']));_0xfe39e[_0x3987('0x26')](_0x278835[_0x3987('0x36')]['id'],function(_0x118bdd){try{_0x118bdd=_0x2a15da[_0x3987('0x27')](_0x118bdd);logger[_0x3987('0x1b')]('vertex',JSON[_0x3987('0x29')](_0x118bdd,null,0x2));if(_0x118bdd&&_0x2a15da[_0x118bdd[_0x3987('0x9')]]){_0x2f5c80=_0x2a15da[_0x118bdd[_0x3987('0x9')]](_0x118bdd);if(_0x2f5c80){logger[_0x3987('0x1b')](_0x3987('0x2f'),inspect(_0x2f5c80));return _[_0x3987('0x31')](_0x2f5c80[_0x3987('0x32')])?null:_0x2f5c80['result'][_0x3987('0x33')]();}else{logger['error'](_0x3987('0x2f'),inspect(_0x2f5c80));return null;}}else{logger[_0x3987('0x34')](_0x3987('0x35'));return null;}}catch(_0x557a10){logger[_0x3987('0x34')](_0x557a10[_0x3987('0x8')]);return null;}});}logger[_0x3987('0x1e')](util[_0x3987('0x1f')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2bfa53[_0x3987('0x21')],_0x2bfa53['calleridname'],_0x2bfa53['callerid'],_0x2bfa53[_0x3987('0x24')],_0x2bfa53[_0x3987('0x25')]));logger[_0x3987('0x1e')](util[_0x3987('0x1f')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x2bfa53[_0x3987('0x2c')],_0x2bfa53[_0x3987('0x2d')],parseInt(_0x2bfa53[_0x3987('0x2e')],0xa)+0x1));_0x2bfa53[_0x3987('0x37')](_0x2bfa53[_0x3987('0x2c')],_0x2bfa53[_0x3987('0x2d')],parseInt(_0x2bfa53[_0x3987('0x2e')],0xa)+0x1);_0x2bfa53[_0x3987('0x38')]();}function handleNotFound(_0x328245){logger[_0x3987('0x34')](util[_0x3987('0x1f')](_0x3987('0x39'),_0x328245['arg_1']));_0x328245['continueAt'](_0x328245[_0x3987('0x2c')],_0x328245[_0x3987('0x2d')],parseInt(_0x328245[_0x3987('0x2e')],0xa)+0x1);_0x328245['close']();}function handleUnpublished(_0x1034f4){logger[_0x3987('0x34')](util[_0x3987('0x1f')](_0x3987('0x3a'),_0x1034f4[_0x3987('0x21')]));_0x1034f4[_0x3987('0x37')](_0x1034f4[_0x3987('0x2c')],_0x1034f4[_0x3987('0x2d')],parseInt(_0x1034f4[_0x3987('0x2e')],0xa)+0x1);_0x1034f4['close']();}module[_0x3987('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index d6c42ec..3cd8d89 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 _0x32ee=['indexOf','substring','length','split','slice','trim','emit','headers','line','exports','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString'];(function(_0x1d3a5d,_0x17fc32){var _0x257078=function(_0x482f3a){while(--_0x482f3a){_0x1d3a5d['push'](_0x1d3a5d['shift']());}};_0x257078(++_0x17fc32);}(_0x32ee,0x10e));var _0xe32e=function(_0x4503c2,_0x50c48b){_0x4503c2=_0x4503c2-0x0;var _0x3a7951=_0x32ee[_0x4503c2];return _0x3a7951;};'use strict';var util=require('util');var Transform=require(_0xe32e('0x0'))[_0xe32e('0x1')];function AGIReply(_0x5da788){Transform[_0xe32e('0x2')](this,_0x5da788);this[_0xe32e('0x3')]='';this[_0xe32e('0x4')]=![];}util[_0xe32e('0x5')](AGIReply,Transform);AGIReply[_0xe32e('0x6')][_0xe32e('0x7')]=function(_0x3efc32,_0xf9ee27,_0x2ccbd8){var _0x5fbbf7='\x0a',_0x5dc66d=['\x0a\x0a',_0xe32e('0x8')],_0x29110a=-0x1,_0x5d610d=-0x1,_0x5a63b0='',_0x29bddf=0x0,_0x456970='',_0x4c99b8='';this['_localBuffer']+=_0x3efc32[_0xe32e('0x9')]();_0x456970=this['_localBuffer'];if(!this['_inBody']){_0x29bddf=0x0;while(_0x5dc66d[_0x29bddf]){while((_0x5d610d=_0x456970[_0xe32e('0xa')](_0x5dc66d[_0x29bddf]))!=-0x1){_0x5a63b0=_0x5dc66d[_0x29bddf];_0x4c99b8=_0x456970[_0xe32e('0xb')](0x0,_0x5d610d);_0x456970=_0x456970[_0xe32e('0xb')](_0x5d610d+_0x5a63b0[_0xe32e('0xc')]);var _0x596633=_0x4c99b8[_0xe32e('0xd')](_0x5fbbf7),_0xfb181d=0x0,_0x1a6681={},_0x24f014='',_0x3f8cad='',_0x4cf21e=-0x1;while(_0x596633[_0xfb181d]){_0x4cf21e=_0x596633[_0xfb181d]['indexOf'](':');if(_0x4cf21e!=-0x1){_0x24f014=_0x596633[_0xfb181d][_0xe32e('0xe')](0x0,_0x4cf21e)['trim']();_0x3f8cad=_0x596633[_0xfb181d][_0xe32e('0xe')](_0x4cf21e+0x1)[_0xe32e('0xf')]();if(_0x24f014['length']>0x0){_0x1a6681[_0x24f014]=_0x3f8cad;}}else{}_0xfb181d++;}this[_0xe32e('0x10')](_0xe32e('0x11'),_0x1a6681);this[_0xe32e('0x4')]=!![];}_0x29bddf++;}this[_0xe32e('0x3')]=_0x456970;}else{while((_0x29110a=_0x456970[_0xe32e('0xa')](_0x5fbbf7))!=-0x1){_0x4c99b8=_0x456970[_0xe32e('0xb')](0x0,_0x29110a);this[_0xe32e('0x10')](_0xe32e('0x12'),_0x4c99b8);_0x456970=_0x456970['substring'](_0x29110a+_0x5fbbf7[_0xe32e('0xc')]);}this[_0xe32e('0x3')]=_0x456970;}_0x2ccbd8();};module[_0xe32e('0x13')]=AGIReply; \ No newline at end of file +var _0x48a1=['Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','slice','trim','emit','headers','line','util','stream'];(function(_0x1a156e,_0x4e3646){var _0x2a7230=function(_0x7a72a8){while(--_0x7a72a8){_0x1a156e['push'](_0x1a156e['shift']());}};_0x2a7230(++_0x4e3646);}(_0x48a1,0xf5));var _0x148a=function(_0x41e9c8,_0xf6587b){_0x41e9c8=_0x41e9c8-0x0;var _0x117d36=_0x48a1[_0x41e9c8];return _0x117d36;};'use strict';var util=require(_0x148a('0x0'));var Transform=require(_0x148a('0x1'))[_0x148a('0x2')];function AGIReply(_0x26f9ea){Transform[_0x148a('0x3')](this,_0x26f9ea);this[_0x148a('0x4')]='';this[_0x148a('0x5')]=![];}util[_0x148a('0x6')](AGIReply,Transform);AGIReply[_0x148a('0x7')][_0x148a('0x8')]=function(_0x123e48,_0x30b8db,_0x4f3872){var _0x3503cc='\x0a',_0x527eed=['\x0a\x0a',_0x148a('0x9')],_0x5cc5ad=-0x1,_0xac85d4=-0x1,_0x521509='',_0x4c91da=0x0,_0x2b6dba='',_0x65123c='';this['_localBuffer']+=_0x123e48[_0x148a('0xa')]();_0x2b6dba=this[_0x148a('0x4')];if(!this['_inBody']){_0x4c91da=0x0;while(_0x527eed[_0x4c91da]){while((_0xac85d4=_0x2b6dba[_0x148a('0xb')](_0x527eed[_0x4c91da]))!=-0x1){_0x521509=_0x527eed[_0x4c91da];_0x65123c=_0x2b6dba['substring'](0x0,_0xac85d4);_0x2b6dba=_0x2b6dba[_0x148a('0xc')](_0xac85d4+_0x521509[_0x148a('0xd')]);var _0x1bcb08=_0x65123c['split'](_0x3503cc),_0x4402ce=0x0,_0x4dbbb8={},_0x267dae='',_0x15a8f2='',_0x102a05=-0x1;while(_0x1bcb08[_0x4402ce]){_0x102a05=_0x1bcb08[_0x4402ce][_0x148a('0xb')](':');if(_0x102a05!=-0x1){_0x267dae=_0x1bcb08[_0x4402ce][_0x148a('0xe')](0x0,_0x102a05)[_0x148a('0xf')]();_0x15a8f2=_0x1bcb08[_0x4402ce][_0x148a('0xe')](_0x102a05+0x1)[_0x148a('0xf')]();if(_0x267dae['length']>0x0){_0x4dbbb8[_0x267dae]=_0x15a8f2;}}else{}_0x4402ce++;}this[_0x148a('0x10')](_0x148a('0x11'),_0x4dbbb8);this[_0x148a('0x5')]=!![];}_0x4c91da++;}this[_0x148a('0x4')]=_0x2b6dba;}else{while((_0x5cc5ad=_0x2b6dba[_0x148a('0xb')](_0x3503cc))!=-0x1){_0x65123c=_0x2b6dba[_0x148a('0xc')](0x0,_0x5cc5ad);this[_0x148a('0x10')](_0x148a('0x12'),_0x65123c);_0x2b6dba=_0x2b6dba[_0x148a('0xc')](_0x5cc5ad+_0x3503cc['length']);}this[_0x148a('0x4')]=_0x2b6dba;}_0x4f3872();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 21885f6..c1f8a46 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 _0x7579=['merge','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','message','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7579,0x1e2));var _0x9757=function(_0x50f859,_0x54cefa){_0x50f859=_0x50f859-0x0;var _0x4710bd=_0x7579[_0x50f859];return _0x4710bd;};'use strict';var _=require(_0x9757('0x0'));var moment=require(_0x9757('0x1'));var jayson=require(_0x9757('0x2'));var client=jayson[_0x9757('0x3')][_0x9757('0x4')]({'port':0x2329});function request(_0x304b14,_0x5a7bc9){return new Promise(function(_0x399165,_0x231ca6){return client[_0x9757('0x5')](_0x304b14,_0x5a7bc9)[_0x9757('0x6')](function(_0x4c1a67){if(_0x4c1a67[_0x9757('0x7')]){return _0x231ca6(_0x4c1a67[_0x9757('0x7')][_0x9757('0x8')]);}else{return _0x399165(_0x4c1a67['result']);}})[_0x9757('0x9')](function(_0x51a1c8){return _0x231ca6(_0x51a1c8);});});}exports[_0x9757('0xa')]=function(){return request(_0x9757('0xb'),{'options':{'raw':![],'attributes':['id',_0x9757('0xc'),'production']}});};exports[_0x9757('0xd')]=function(_0x13f01a){return request(_0x9757('0xe'),{'options':{'raw':![],'where':{'name':_0x13f01a},'attributes':[_0x9757('0xf')]}});};exports[_0x9757('0x10')]=function(_0x399cca){return request(_0x9757('0x11'),{'options':{'raw':![],'where':{'id':_0x399cca},'include':[{'model':_0x9757('0x12'),'as':_0x9757('0x13'),'include':[{'model':_0x9757('0x14'),'as':_0x9757('0x14')}]}],'attributes':['id','name',_0x9757('0x15')],'smtp':!![]}});};exports[_0x9757('0x16')]=function(_0x2c2af0){return request('ShowSquareProject',{'options':{'where':{'id':_0x2c2af0},'attributes':[_0x9757('0xc')]}});};exports[_0x9757('0x17')]=function(_0x413d55){return request(_0x9757('0x18'),{'options':{'where':{'id':_0x413d55},'attributes':[_0x9757('0xc')]}});};exports[_0x9757('0x19')]=function(_0x105e56){return request('ShowVariable',{'options':{'where':{'id':_0x105e56},'attributes':[_0x9757('0xc')]}});};exports['getSquareOdbcById']=function(_0x17ab45){return request(_0x9757('0x1a'),{'options':{'where':{'id':_0x17ab45},'attributes':[_0x9757('0x1b')]}});};exports[_0x9757('0x1c')]=function(_0x3f6be9){return request(_0x9757('0x1d'),{'options':{'where':{'id':_0x3f6be9},'attributes':['name']}});};exports[_0x9757('0x1e')]=function(_0x2aa360){return request(_0x9757('0x1f'),{'options':{'where':{'phone':_0x2aa360[_0x9757('0x20')]},'attributes':['id']}});};exports[_0x9757('0x21')]=function(_0xd2306b){return request(_0x9757('0x22'),{'options':{'where':{'id':_0xd2306b},'attributes':['name']}});};exports[_0x9757('0x23')]=function(_0x4c1b66){return request('ShowSound',{'options':{'where':{'id':_0x4c1b66},'attributes':[_0x9757('0x24')]}});};exports[_0x9757('0x25')]=function(_0x1443a9){return request(_0x9757('0x26'),{'options':{'raw':![],'where':{'id':_0x1443a9},'include':[{'model':'Interval','as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x73dac4){return request(_0x9757('0x27'),{'options':{'where':{'id':_0x73dac4},'attributes':['id',_0x9757('0xc')]}});};exports[_0x9757('0x28')]=function(_0x5dc2fa){return request(_0x9757('0x29'),{'body':_0x5dc2fa});};exports[_0x9757('0x2a')]=function(_0x5d6554){return request(_0x9757('0x2b'),{'body':_0x5d6554});};exports[_0x9757('0x2c')]=function(_0x58caa8){return request(_0x9757('0x2d'),{'body':_[_0x9757('0x2e')](_0x58caa8,{'project_name':_0x58caa8[_0x9757('0x2f')],'prev_project_name':_0x58caa8[_0x9757('0x30')]||'','is_subproject':_0x58caa8[_0x9757('0x30')]?!![]:![],'leaveAt':moment()[_0x9757('0x31')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x9757('0x32')]=function(_0x57c770){return request(_0x9757('0x33'),{'body':_0x57c770});};exports[_0x9757('0x34')]=function(_0x58ae5e){return request('CreateSquareMessage',{'body':_0x58ae5e});};exports[_0x9757('0x35')]=function(_0x21a4bd){return request(_0x9757('0x36'),{'options':{'raw':![],'where':{'phone':_0x21a4bd[_0x9757('0x20')],'ListId':_0x21a4bd['ListId']}}})[_0x9757('0x6')](function(_0xecf119){if(_0xecf119){return _0xecf119;}return request(_0x9757('0x37'),{'body':_0x21a4bd});});};exports[_0x9757('0x38')]=function(_0x815c25){return request(_0x9757('0x39'),{'options':{'where':{'id':_0x815c25},'attributes':['name']}});};exports[_0x9757('0x3a')]=function(_0x3aebbe,_0x36eb37){return request(_0x9757('0x3b'),{'body':{'interface':_0x36eb37},'options':{'where':_0x3aebbe}});};exports[_0x9757('0x3c')]=function(_0x328c9e,_0x115d93,_0x586e71){return request(_0x9757('0x3d'),{'body':{'type':_0x115d93,'uniqueid':_0x586e71},'options':{'where':_0x328c9e}});};exports[_0x9757('0x3e')]=function(_0x4622d0){return request(_0x9757('0x3f'),{'body':{},'options':{'where':_0x4622d0}});};exports[_0x9757('0x40')]=function(_0x1e9aca){return request(_0x9757('0x41'),{'body':{},'options':{'where':_0x1e9aca}});}; \ No newline at end of file +var _0x0f9f=['LogoutUser','moment','jayson/promise','client','request','then','error','message','catch','GetSquareProjects','name','production','ShowSquareProject','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','ShowTrunk','getSoundById','ShowInterval','Interval','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','CreateSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','PauseUser','agentUnpause','agentLogout'];(function(_0x4cbd28,_0x244839){var _0x51622e=function(_0x368809){while(--_0x368809){_0x4cbd28['push'](_0x4cbd28['shift']());}};_0x51622e(++_0x244839);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x3815b2,_0xdeaa84){_0x3815b2=_0x3815b2-0x0;var _0x2ebd79=_0x0f9f[_0x3815b2];return _0x2ebd79;};'use strict';var _=require('lodash');var moment=require(_0xf0f9('0x0'));var jayson=require(_0xf0f9('0x1'));var client=jayson[_0xf0f9('0x2')]['http']({'port':0x2329});function request(_0x5cf55e,_0x45cc98){return new Promise(function(_0x257b44,_0x17eab4){return client[_0xf0f9('0x3')](_0x5cf55e,_0x45cc98)[_0xf0f9('0x4')](function(_0x192d43){if(_0x192d43[_0xf0f9('0x5')]){return _0x17eab4(_0x192d43[_0xf0f9('0x5')][_0xf0f9('0x6')]);}else{return _0x257b44(_0x192d43['result']);}})[_0xf0f9('0x7')](function(_0x294b42){return _0x17eab4(_0x294b42);});});}exports['getSquareProjects']=function(){return request(_0xf0f9('0x8'),{'options':{'raw':![],'attributes':['id',_0xf0f9('0x9'),_0xf0f9('0xa')]}});};exports['getSquareProject']=function(_0x196f21){return request(_0xf0f9('0xb'),{'options':{'raw':![],'where':{'name':_0x196f21},'attributes':[_0xf0f9('0xa')]}});};exports['getMailAccountById']=function(_0x5ded1c){return request(_0xf0f9('0xc'),{'options':{'raw':![],'where':{'id':_0x5ded1c},'include':[{'model':_0xf0f9('0xd'),'as':_0xf0f9('0xe'),'include':[{'model':_0xf0f9('0xf'),'as':_0xf0f9('0xf')}]}],'attributes':['id',_0xf0f9('0x9'),_0xf0f9('0x10')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x2910f2){return request(_0xf0f9('0xb'),{'options':{'where':{'id':_0x2910f2},'attributes':[_0xf0f9('0x9')]}});};exports[_0xf0f9('0x11')]=function(_0x524169){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x524169},'attributes':[_0xf0f9('0x9')]}});};exports[_0xf0f9('0x12')]=function(_0xa7d48c){return request(_0xf0f9('0x13'),{'options':{'where':{'id':_0xa7d48c},'attributes':[_0xf0f9('0x9')]}});};exports[_0xf0f9('0x14')]=function(_0x2f75da){return request(_0xf0f9('0x15'),{'options':{'where':{'id':_0x2f75da},'attributes':[_0xf0f9('0x16')]}});};exports[_0xf0f9('0x17')]=function(_0x4d3534){return request('ShowUser',{'options':{'where':{'id':_0x4d3534},'attributes':[_0xf0f9('0x9')]}});};exports[_0xf0f9('0x18')]=function(_0x4c4e17){return request(_0xf0f9('0x19'),{'options':{'where':{'phone':_0x4c4e17['phone']},'attributes':['id']}});};exports['getTrunkById']=function(_0x42c157){return request(_0xf0f9('0x1a'),{'options':{'where':{'id':_0x42c157},'attributes':[_0xf0f9('0x9')]}});};exports[_0xf0f9('0x1b')]=function(_0x3c7b6f){return request('ShowSound',{'options':{'where':{'id':_0x3c7b6f},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x102336){return request(_0xf0f9('0x1c'),{'options':{'raw':![],'where':{'id':_0x102336},'include':[{'model':_0xf0f9('0x1d'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x209cd4){return request('ShowSmsAccount',{'options':{'where':{'id':_0x209cd4},'attributes':['id',_0xf0f9('0x9')]}});};exports[_0xf0f9('0x1e')]=function(_0x173c79){return request('CreateSmsMessage',{'body':_0x173c79});};exports[_0xf0f9('0x1f')]=function(_0x1061ca){return request(_0xf0f9('0x20'),{'body':_0x1061ca});};exports['createSquareReport']=function(_0x384594){return request(_0xf0f9('0x21'),{'body':_[_0xf0f9('0x22')](_0x384594,{'project_name':_0x384594[_0xf0f9('0x23')],'prev_project_name':_0x384594[_0xf0f9('0x24')]||'','is_subproject':_0x384594[_0xf0f9('0x24')]?!![]:![],'leaveAt':moment()['format'](_0xf0f9('0x25'))})});};exports['createSquareRecording']=function(_0x1288e0){return request(_0xf0f9('0x26'),{'body':_0x1288e0});};exports['createSquareMessage']=function(_0x4b75b2){return request(_0xf0f9('0x27'),{'body':_0x4b75b2});};exports['createCmContact']=function(_0x2121b8){return request(_0xf0f9('0x28'),{'options':{'raw':![],'where':{'phone':_0x2121b8[_0xf0f9('0x29')],'ListId':_0x2121b8[_0xf0f9('0x2a')]}}})[_0xf0f9('0x4')](function(_0x39cd34){if(_0x39cd34){return _0x39cd34;}return request(_0xf0f9('0x2b'),{'body':_0x2121b8});});};exports[_0xf0f9('0x2c')]=function(_0x37c093){return request('ShowPause',{'options':{'where':{'id':_0x37c093},'attributes':[_0xf0f9('0x9')]}});};exports[_0xf0f9('0x2d')]=function(_0x534083,_0x48ef2a){return request(_0xf0f9('0x2e'),{'body':{'interface':_0x48ef2a},'options':{'where':_0x534083}});};exports['agentPause']=function(_0x483a8c,_0x14f3cb,_0x490e91){return request(_0xf0f9('0x2f'),{'body':{'type':_0x14f3cb,'uniqueid':_0x490e91},'options':{'where':_0x483a8c}});};exports[_0xf0f9('0x30')]=function(_0x5305e0){return request('UnpauseUser',{'body':{},'options':{'where':_0x5305e0}});};exports[_0xf0f9('0x31')]=function(_0x5721a){return request(_0xf0f9('0x32'),{'body':{},'options':{'where':_0x5721a}});}; \ 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 28cfe96..7affd29 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 polly=require('./polly');var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xfb15=['./polly','./lex','exports'];(function(_0x4cdb32,_0x2769af){var _0x5d22a9=function(_0x30dc0b){while(--_0x30dc0b){_0x4cdb32['push'](_0x4cdb32['shift']());}};_0x5d22a9(++_0x2769af);}(_0xfb15,0x12f));var _0x5fb1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xfb15[_0xbca1b1];return _0x4e1686;};var polly=require(_0x5fb1('0x0'));var lex=require(_0x5fb1('0x1'));module[_0x5fb1('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index cc29574..c7edd44 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 _0x9c00=['./lib/api','exports'];(function(_0x38d8bc,_0x19cb01){var _0x2ff5b8=function(_0x5ba65f){while(--_0x5ba65f){_0x38d8bc['push'](_0x38d8bc['shift']());}};_0x2ff5b8(++_0x19cb01);}(_0x9c00,0x1a0));var _0x09c0=function(_0x7b7f5f,_0x2d472b){_0x7b7f5f=_0x7b7f5f-0x0;var _0x35e97f=_0x9c00[_0x7b7f5f];return _0x35e97f;};'use strict';var lex=require(_0x09c0('0x0'));module[_0x09c0('0x1')]=function(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c){return lex(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c);}; \ No newline at end of file +var _0xa75b=['./lib/api'];(function(_0x1795fa,_0x23d168){var _0x292bc0=function(_0xfacb81){while(--_0xfacb81){_0x1795fa['push'](_0x1795fa['shift']());}};_0x292bc0(++_0x23d168);}(_0xa75b,0x170));var _0xba75=function(_0x493db7,_0x5b8901){_0x493db7=_0x493db7-0x0;var _0x437102=_0xa75b[_0x493db7];return _0x437102;};'use strict';var lex=require(_0xba75('0x0'));module['exports']=function(_0x546e14,_0x10c0dd,_0x39dc19,_0x17b666,_0x3cde96,_0x1760c0){return lex(_0x546e14,_0x10c0dd,_0x39dc19,_0x17b666,_0x3cde96,_0x1760c0);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index d9b8b51..81b1fc2 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(_0x1c9fba,_0x52db43){var _0x27687e=function(_0x368af0){while(--_0x368af0){_0x1c9fba['push'](_0x1c9fba['shift']());}};_0x27687e(++_0x52db43);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0xb3706b,_0xfc29f5){var _0x5a8f6c=function(_0xb9290e){while(--_0xb9290e){_0xb3706b['push'](_0xb3706b['shift']());}};_0x5a8f6c(++_0xfc29f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 05f3e38..e24a53f 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0f5=['exports'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xf0f5,0x1cc));var _0x5f0f=function(_0xa72931,_0x37d87a){_0xa72931=_0xa72931-0x0;var _0x13b2f5=_0xf0f5[_0xa72931];return _0x13b2f5;};'use strict';var polly=require('./lib/api');module[_0x5f0f('0x0')]=function(_0xdb12a6,_0x486abc,_0x26d802,_0x2eef70,_0x1b7651,_0x56f21d,_0x2da53f){return polly(_0xdb12a6,_0x486abc,_0x26d802,_0x2eef70,_0x1b7651,_0x56f21d,_0x2da53f);}; \ No newline at end of file +var _0x5571=['exports','./lib/api'];(function(_0x2a1f80,_0xccd024){var _0x54f352=function(_0x53538a){while(--_0x53538a){_0x2a1f80['push'](_0x2a1f80['shift']());}};_0x54f352(++_0xccd024);}(_0x5571,0x185));var _0x1557=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x5571[_0x5ac84c];return _0x3c53d2;};'use strict';var polly=require(_0x1557('0x0'));module[_0x1557('0x1')]=function(_0x5c4ade,_0x22b092,_0x3ab729,_0x1a04f3,_0x509597,_0x1f045b,_0x43f701){return polly(_0x5c4ade,_0x22b092,_0x3ab729,_0x1a04f3,_0x509597,_0x1f045b,_0x43f701);}; \ 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 32a51e6..7c4edeb 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 _0x7fd1=['path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x4edc6c,_0x376629){var _0x31edc7=function(_0x28792b){while(--_0x28792b){_0x4edc6c['push'](_0x4edc6c['shift']());}};_0x31edc7(++_0x376629);}(_0x7fd1,0xfd));var _0x17fd=function(_0x1fd26d,_0x549292){_0x1fd26d=_0x1fd26d-0x0;var _0x145ffc=_0x7fd1[_0x1fd26d];return _0x145ffc;};'use strict';var fs=require('fs');var path=require(_0x17fd('0x0'));var BPromise=require(_0x17fd('0x1'));var rs=require(_0x17fd('0x2'));var AWS=require(_0x17fd('0x3'));function pollyResult(_0x467982,_0x5b87f3,_0x5842df){return new BPromise(function(_0x4c2922,_0x17b809){_0x467982[_0x17fd('0x4')](_0x5b87f3,function(_0x199a36,_0x456f72){if(_0x199a36){_0x17b809(_0x199a36);}else if(_0x456f72){if(_0x456f72[_0x17fd('0x5')]instanceof Buffer){fs['writeFile'](_0x5842df,_0x456f72[_0x17fd('0x5')],function(_0x4ca30){if(_0x4ca30){_0x17b809(_0x4ca30);}else{_0x4c2922();}});}else{_0x17b809(new Error(_0x17fd('0x6')));}}else{_0x17b809(new Error(_0x17fd('0x7')));}});});}module[_0x17fd('0x8')]=function(_0x47abae,_0x343e24,_0x25d3ae,_0x1621a9,_0x1ea737,_0x3cbfa0,_0x5805c8){var _0x542e65=new AWS[(_0x17fd('0x9'))]({'accessKeyId':_0x47abae,'secretAccessKey':_0x343e24,'region':_0x25d3ae});var _0x36fc4a={'Text':_0x1ea737,'TextType':_0x3cbfa0||_0x17fd('0xa'),'OutputFormat':'mp3','VoiceId':_0x1621a9};return pollyResult(_0x542e65,_0x36fc4a,_0x5805c8);}; \ No newline at end of file +var _0xe7a5=['mp3','path','bluebird','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x140c6d,_0x54af36){var _0x40323b=function(_0xa05839){while(--_0xa05839){_0x140c6d['push'](_0x140c6d['shift']());}};_0x40323b(++_0x54af36);}(_0xe7a5,0x7a));var _0x5e7a=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0xe7a5[_0xfcbcb8];return _0x1b1f97;};'use strict';var fs=require('fs');var path=require(_0x5e7a('0x0'));var BPromise=require(_0x5e7a('0x1'));var rs=require('randomstring');var AWS=require(_0x5e7a('0x2'));function pollyResult(_0x4074db,_0x465b63,_0x4aa81b){return new BPromise(function(_0x194e2a,_0x4f05ef){_0x4074db['synthesizeSpeech'](_0x465b63,function(_0x1b3c4c,_0x2bc855){if(_0x1b3c4c){_0x4f05ef(_0x1b3c4c);}else if(_0x2bc855){if(_0x2bc855[_0x5e7a('0x3')]instanceof Buffer){fs[_0x5e7a('0x4')](_0x4aa81b,_0x2bc855[_0x5e7a('0x3')],function(_0x3988fd){if(_0x3988fd){_0x4f05ef(_0x3988fd);}else{_0x194e2a();}});}else{_0x4f05ef(new Error(_0x5e7a('0x5')));}}else{_0x4f05ef(new Error(_0x5e7a('0x6')));}});});}module[_0x5e7a('0x7')]=function(_0x5cbbbe,_0x161ed7,_0x20c565,_0x3ebd54,_0x116ae5,_0x527a19,_0x3a1a91){var _0x3c4f08=new AWS[(_0x5e7a('0x8'))]({'accessKeyId':_0x5cbbbe,'secretAccessKey':_0x161ed7,'region':_0x20c565});var _0x1be663={'Text':_0x116ae5,'TextType':_0x527a19||_0x5e7a('0x9'),'OutputFormat':_0x5e7a('0xa'),'VoiceId':_0x3ebd54};return pollyResult(_0x3c4f08,_0x1be663,_0x3a1a91);}; \ 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 96dd901..c9fbc14 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 _0x12d4=['exports','./lib/api'];(function(_0x504e8f,_0x46c3a5){var _0xf914fb=function(_0x19f937){while(--_0x19f937){_0x504e8f['push'](_0x504e8f['shift']());}};_0xf914fb(++_0x46c3a5);}(_0x12d4,0xdd));var _0x412d=function(_0x58fc2f,_0x111399){_0x58fc2f=_0x58fc2f-0x0;var _0x3a1312=_0x12d4[_0x58fc2f];return _0x3a1312;};'use strict';var asr=require(_0x412d('0x0'));module[_0x412d('0x1')]=function(_0x3efb15,_0x1a5d43,_0x1b3f2a,_0x1155db){return asr(_0x3efb15,_0x1a5d43,_0x1b3f2a);}; \ No newline at end of file +var _0x9e31=['./lib/api','exports'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9e31,0x154));var _0x19e3=function(_0x334af8,_0x447043){_0x334af8=_0x334af8-0x0;var _0x43e1a1=_0x9e31[_0x334af8];return _0x43e1a1;};'use strict';var asr=require(_0x19e3('0x0'));module[_0x19e3('0x1')]=function(_0x465ff9,_0x579e47,_0x2321f8,_0x234324){return asr(_0x465ff9,_0x579e47,_0x2321f8);}; \ 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 c137b0b..e7e19c3 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 _0xad8a=['string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports'];(function(_0x1be42a,_0x531555){var _0xae4a2d=function(_0x579636){while(--_0x579636){_0x1be42a['push'](_0x1be42a['shift']());}};_0xae4a2d(++_0x531555);}(_0xad8a,0xb0));var _0xaad8=function(_0x512c27,_0x292143){_0x512c27=_0x512c27-0x0;var _0x298d01=_0xad8a[_0x512c27];return _0x298d01;};'use strict';var url=require(_0xaad8('0x0'));var BPromise=require(_0xaad8('0x1'));var fs=require('fs');var host=_0xaad8('0x2');module[_0xaad8('0x3')]=function(_0x158aa2,_0x4848a7,_0x201fbe){return new BPromise(function(_0x42b1d7,_0x398fde){var _0x58f2c5;if(typeof _0x158aa2!==_0xaad8('0x4')||_0x158aa2[_0xaad8('0x5')]===0x0){return _0x398fde(_0xaad8('0x6'));}if(typeof _0x4848a7!==_0xaad8('0x4')||_0x4848a7[_0xaad8('0x5')]===0x0){return _0x398fde(_0xaad8('0x7'));}if(typeof _0x201fbe!==_0xaad8('0x8')&&(typeof _0x201fbe!==_0xaad8('0x4')||_0x201fbe[_0xaad8('0x5')]===0x0)){return _0x398fde(_0xaad8('0x9'));}try{_0x58f2c5=fs['readFileSync'](_0x158aa2)['toString'](_0xaad8('0xa'));}catch(_0x3a5f81){return _0x398fde(_0x3a5f81);}return _0x42b1d7({'method':_0xaad8('0xb'),'uri':host+_0xaad8('0xc')+_0x4848a7,'body':{'config':{'encoding':_0xaad8('0xd'),'sampleRateHertz':_0xaad8('0xe'),'languageCode':_0x201fbe},'audio':{'content':_0x58f2c5}},'json':!![]});});}; \ No newline at end of file +var _0xf9f7=['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','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url'];(function(_0x3dc2fd,_0x4f8f8d){var _0x3c671d=function(_0x331851){while(--_0x331851){_0x3dc2fd['push'](_0x3dc2fd['shift']());}};_0x3c671d(++_0x4f8f8d);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x291c1b,_0x5216a6){_0x291c1b=_0x291c1b-0x0;var _0x2109c9=_0xf9f7[_0x291c1b];return _0x2109c9;};'use strict';var url=require(_0x7f9f('0x0'));var BPromise=require(_0x7f9f('0x1'));var fs=require('fs');var host=_0x7f9f('0x2');module[_0x7f9f('0x3')]=function(_0x37f0ee,_0x9aac07,_0x47f4a7){return new BPromise(function(_0x5c456a,_0x440672){var _0x439585;if(typeof _0x37f0ee!==_0x7f9f('0x4')||_0x37f0ee[_0x7f9f('0x5')]===0x0){return _0x440672(_0x7f9f('0x6'));}if(typeof _0x9aac07!==_0x7f9f('0x4')||_0x9aac07['length']===0x0){return _0x440672(_0x7f9f('0x7'));}if(typeof _0x47f4a7!==_0x7f9f('0x8')&&(typeof _0x47f4a7!==_0x7f9f('0x4')||_0x47f4a7[_0x7f9f('0x5')]===0x0)){return _0x440672(_0x7f9f('0x9'));}try{_0x439585=fs['readFileSync'](_0x37f0ee)[_0x7f9f('0xa')](_0x7f9f('0xb'));}catch(_0x39d8a2){return _0x440672(_0x39d8a2);}return _0x5c456a({'method':_0x7f9f('0xc'),'uri':host+_0x7f9f('0xd')+_0x9aac07,'body':{'config':{'encoding':_0x7f9f('0xe'),'sampleRateHertz':_0x7f9f('0xf'),'languageCode':_0x47f4a7},'audio':{'content':_0x439585}},'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 8140dec..f6bb26b 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 _0x8e2f=['./asr','exports'];(function(_0x8fd745,_0x3be743){var _0x66647=function(_0x8443c9){while(--_0x8443c9){_0x8fd745['push'](_0x8fd745['shift']());}};_0x66647(++_0x3be743);}(_0x8e2f,0x1e8));var _0xf8e2=function(_0x34cc9f,_0x4d891a){_0x34cc9f=_0x34cc9f-0x0;var _0x1991d3=_0x8e2f[_0x34cc9f];return _0x1991d3;};var asr=require(_0xf8e2('0x0'));module[_0xf8e2('0x1')]={'asr':asr}; \ No newline at end of file +var _0xa311=['exports','./asr'];(function(_0x434a2a,_0xd54e15){var _0x1d7eec=function(_0x3a1132){while(--_0x3a1132){_0x434a2a['push'](_0x434a2a['shift']());}};_0x1d7eec(++_0xd54e15);}(_0xa311,0x16d));var _0x1a31=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa311[_0x46aff0];return _0x9d78cf;};var asr=require(_0x1a31('0x0'));module[_0x1a31('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 d554fc1..81508bf 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 _0x2f3e=['data','length','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','source','result','resolvedQuery','fulfillment','speech','score','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','detectIntent','queryResult','action','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','http','https','md5','path','querystring','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','protocol','https:','WHAT_EVER','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','host','transcode','wav','error\x20convert','start','resolve','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','text:synthesize','POST','.mp3','writeFile','tmp','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','jQ1olc','stringify','null','generic'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x2f3e,0x147));var _0xe2f3=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0x2f3e[_0x35d4e9];return _0x5c2770;};'use strict';var apiai=require(_0xe2f3('0x0'));var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xe2f3('0x1'));var https=require(_0xe2f3('0x2'));var md5=require(_0xe2f3('0x3'));var path=require(_0xe2f3('0x4'));var querystring=require(_0xe2f3('0x5'));var rp=require('request-promise');var rs=require(_0xe2f3('0x6'));var sox=require(_0xe2f3('0x7'));var tts=require(_0xe2f3('0x8'));var urlParse=require(_0xe2f3('0x9'))[_0xe2f3('0xa')];var util=require(_0xe2f3('0xb'));var aws=require(_0xe2f3('0xc'));var google=require(_0xe2f3('0xd'));var sestek=require(_0xe2f3('0xe'));var tilde=require(_0xe2f3('0xf'));var logger=require(_0xe2f3('0x10'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x1b01ed,_0x1a9eff){return new BPromise(function(_0x53628b,_0x27f87a){var _0x533ea3=urlParse(_0x1b01ed);var _0x2481be=_0x533ea3[_0xe2f3('0x11')]===_0xe2f3('0x12')?https:http;var _0x116db5={'host':_0x533ea3['host'],'path':_0x533ea3[_0xe2f3('0x4')],'headers':{'user-agent':_0xe2f3('0x13')}};_0x2481be['get'](_0x116db5,function(_0x6698bf){if(_0x6698bf[_0xe2f3('0x14')]!==0xc8){logger[_0xe2f3('0x15')]('request\x20to\x20'+_0x1b01ed+_0xe2f3('0x16')+_0x6698bf['statusCode']+'\x20('+_0x6698bf[_0xe2f3('0x17')]+')');_0x27f87a(new Error(_0xe2f3('0x18')+_0x1b01ed+_0xe2f3('0x16')+_0x6698bf['statusCode']+'\x20('+_0x6698bf[_0xe2f3('0x17')]+')'));return;}var _0x57af1e=fs['createWriteStream'](_0x1a9eff);_0x57af1e['on'](_0xe2f3('0x19'),function(){logger[_0xe2f3('0x1a')](_0xe2f3('0x1b'));_0x57af1e[_0xe2f3('0x1c')](_0x53628b);});_0x57af1e['on']('error',function(_0x4f0a5c){fs[_0xe2f3('0x1d')](_0x1a9eff);logger[_0xe2f3('0x15')](_0xe2f3('0x1e'),_0x4f0a5c);_0x27f87a(_0x4f0a5c);});_0x6698bf[_0xe2f3('0x1f')](_0x57af1e);})['on'](_0xe2f3('0x15'),function(_0x996e4f){logger['error'](_0x996e4f);_0x27f87a(_0x996e4f);})[_0xe2f3('0x20')]();});}function uploadFile(_0x3e47d9){return new BPromise(function(_0x585592,_0x581a7d){var _0x11c460=urlParse(_0x3e47d9);var _0x48724c=_0x11c460[_0xe2f3('0x11')]===_0xe2f3('0x12')?https:http;var _0x4cc0e9={'host':_0x11c460[_0xe2f3('0x21')],'path':_0x11c460[_0xe2f3('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x48724c['get'](_0x4cc0e9,function(_0x6d0356){if(_0x6d0356[_0xe2f3('0x14')]!==0xc8){_0x581a7d(new Error(_0xe2f3('0x18')+_0x3e47d9+_0xe2f3('0x16')+_0x6d0356[_0xe2f3('0x14')]+'\x20('+_0x6d0356[_0xe2f3('0x17')]+')'));return;}var _0x17c78d='';_0x6d0356['on']('data',function(_0xeebff0){_0x17c78d+=_0xeebff0;});_0x6d0356['on'](_0xe2f3('0x20'),function(){_0x585592(_0x17c78d);});})['on'](_0xe2f3('0x15'),function(_0xbd5792){_0x581a7d(_0xbd5792);})[_0xe2f3('0x20')]();});}function convertFile(_0x41643c,_0x19e1e9){return new BPromise(function(_0x4a5494,_0x12a8ff){var _0x4b5c99=sox[_0xe2f3('0x22')](_0x41643c,_0x19e1e9,{'sampleRate':0x1f40,'format':_0xe2f3('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4b5c99['on'](_0xe2f3('0x15'),function(_0x11fb3c){logger[_0xe2f3('0x15')](_0xe2f3('0x24'),_0x11fb3c);_0x12a8ff(_0x11fb3c);});_0x4b5c99['on'](_0xe2f3('0x20'),function(){logger[_0xe2f3('0x1a')]('finish\x20to\x20convert');_0x4a5494();});_0x4b5c99[_0xe2f3('0x25')]();});}function base64Decode(_0xca7000,_0x16799f){var _0x3756a7=path[_0xe2f3('0x26')](__dirname,'tmp',rs[_0xe2f3('0x27')](0x4)+_0xe2f3('0x28'));fs[_0xe2f3('0x29')](_0x3756a7,_0xca7000,_0xe2f3('0x2a'));return convertFile(_0x3756a7,_0x16799f)[_0xe2f3('0x2b')](function(){try{fs['unlink'](_0x3756a7);fs[_0xe2f3('0x2c')](_0x16799f,_0xe2f3('0x2d'));}catch(_0x44ce9c){logger[_0xe2f3('0x15')](_0x44ce9c);}return _0x16799f[_0xe2f3('0x2e')]('.')[0x0];});}function base64Encode(_0x21ea83){var _0xe6a624=fs[_0xe2f3('0x2f')](_0x21ea83);return new Buffer(_0xe6a624)[_0xe2f3('0x30')]('base64');}exports[_0xe2f3('0x31')]=function(_0x3cce8c,_0x5352f9,_0x54bc7b,_0x543959,_0x5507df,_0x47dc42){var _0x5a99eb,_0x3af10a;var _0xe6a1e5=_0xe2f3('0x32');var _0x2dd199=_0xe2f3('0x33')+_0x3cce8c;var _0x14751f={};if(_0x5352f9===_0xe2f3('0x34')){_0x14751f['input']={'ssml':_0x54bc7b};}else{_0x14751f[_0xe2f3('0x35')]={'text':_0x54bc7b};};_0x14751f[_0xe2f3('0x36')]={'languageCode':_0x543959,'ssmlGender':_0x5507df};_0x14751f[_0xe2f3('0x37')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x3bb7e2={'url':_0xe6a1e5+_0xe2f3('0x38')+_0x2dd199,'method':_0xe2f3('0x39'),'json':!![],'body':_0x14751f};return rp(_0x3bb7e2)[_0xe2f3('0x2b')](function(_0x134520){return new BPromise(function(_0x405271,_0x2da7d5){_0x5a99eb=path[_0xe2f3('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0xe2f3('0x3a'));var _0x3f9290=Buffer['from'](_0x134520['audioContent'],'base64');return fs[_0xe2f3('0x3b')](_0x5a99eb,_0x3f9290,function(_0x190b8c){_0x2da7d5(_0x190b8c);},function(_0x1d01b2){fs[_0xe2f3('0x2c')](_0x5a99eb,_0xe2f3('0x2d'));_0x405271(_0x1d01b2);});});})['then'](function(_0x3427e1){_0x3af10a=path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs[_0xe2f3('0x27')](0x4)+_0xe2f3('0x28'));return convertFile(_0x5a99eb,_0x3af10a);})[_0xe2f3('0x2b')](function(){try{fs['unlink'](_0x5a99eb);fs['chmodSync'](_0x3af10a,_0xe2f3('0x2d'));}catch(_0x17f67a){logger[_0xe2f3('0x15')](_0x17f67a);}logger[_0xe2f3('0x1a')]('googleCloudTTS\x20path',_0x3af10a['split']('.')[0x0]);return _0x3af10a[_0xe2f3('0x2e')]('.')[0x0];});};exports[_0xe2f3('0x3d')]=function(_0x24d6ae,_0x54b6cd){var _0x1ac0f4=_0xe2f3('0x3e');var _0x19c105,_0x41c421;var _0x4521ea;var _0x3781cd={'encoding':_0xe2f3('0x3f'),'method':_0xe2f3('0x39'),'timeout':0x2710,'url':_0x1ac0f4,'headers':{'Content-Type':_0xe2f3('0x40')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0xe2f3('0x41'),JSON[_0xe2f3('0x42')]([_0x24d6ae,_0x54b6cd||'en',![],_0xe2f3('0x43')]),null,_0xe2f3('0x44')]]]))};return rp(_0x3781cd)['then'](function(_0x126323){try{_0x4521ea=eval(_0x126323['slice'](0x5))[0x0][0x2];}catch(_0x4150eb){throw new Error('parse\x20response\x20failed:\x0a'+_0x126323[_0xe2f3('0x45')]);}if(!_0x4521ea){if(_0x24d6ae[_0xe2f3('0x46')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xe2f3('0x47')+_0x54b6cd+_0xe2f3('0x48'));}}try{_0x4521ea=eval(_0x4521ea)[0x0];}catch(_0x3443ac){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xe2f3('0x45')]);}const _0x39bc94=_0x4521ea;_0x19c105=path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs['generate'](0x4)+_0xe2f3('0x3a'));fs[_0xe2f3('0x29')](_0x19c105,_0x4521ea,{'encoding':_0xe2f3('0x2a')});_0x41c421=path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs['generate'](0x4)+_0xe2f3('0x28'));return convertFile(_0x19c105,_0x41c421);})[_0xe2f3('0x2b')](function(){try{fs[_0xe2f3('0x1d')](_0x19c105);fs[_0xe2f3('0x2c')](_0x41c421,_0xe2f3('0x2d'));}catch(_0x1bcd12){logger[_0xe2f3('0x15')](_0x1bcd12);}logger[_0xe2f3('0x1a')]('goggleTTS\x20path',_0x41c421[_0xe2f3('0x2e')]('.')[0x0]);return _0x41c421[_0xe2f3('0x2e')]('.')[0x0];});};exports[_0xe2f3('0x49')]=function(_0x5acc3c,_0x2e4a9a,_0x5b13a9){return google['asr'](_0x5acc3c,_0x2e4a9a,_0x5b13a9)[_0xe2f3('0x2b')](function(_0x569694){logger[_0xe2f3('0x1a')](_0x569694[_0xe2f3('0x4a')]);return rp(_0x569694);})[_0xe2f3('0x2b')](function(_0x5e9cb5){var _0x563ec5='';var _0x3a4722=0x0;try{fs[_0xe2f3('0x1d')](_0x5acc3c);}catch(_0x18a36a){logger[_0xe2f3('0x15')](_0x18a36a);}if(_0x5e9cb5&&_0x5e9cb5[_0xe2f3('0x4b')]){_0x563ec5=_0x5e9cb5[_0xe2f3('0x4b')][_0xe2f3('0x4c')](function(_0x1ff093){return _0x1ff093&&_0x1ff093[_0xe2f3('0x4d')][0x0]&&_0x1ff093[_0xe2f3('0x4d')][0x0]['transcript']?_0x1ff093[_0xe2f3('0x4d')][0x0][_0xe2f3('0x4e')]:'';})[_0xe2f3('0x4f')]('\x0a');_0x3a4722=_0x5e9cb5[_0xe2f3('0x4b')][_0xe2f3('0x4c')](function(_0x33faca){return _0x33faca&&_0x33faca['alternatives'][0x0]&&_0x33faca[_0xe2f3('0x4d')][0x0][_0xe2f3('0x50')]?_0x33faca[_0xe2f3('0x4d')][0x0][_0xe2f3('0x50')]:0x0;})['join']('\x0a');}logger[_0xe2f3('0x1a')](_0xe2f3('0x51'),_0x563ec5);logger[_0xe2f3('0x1a')](_0xe2f3('0x52'),_0x3a4722);return{'transcript':_0x563ec5,'confidence':_0x3a4722};})[_0xe2f3('0x53')](function(_0x512ed9){logger[_0xe2f3('0x15')](_0xe2f3('0x54'),_0x512ed9['statusCode'],_0x512ed9[_0xe2f3('0x55')],_0x512ed9[_0xe2f3('0x56')]);});};exports['googleDialogflow']=function(_0x5644f6,_0x591098,_0x10f670,_0x2a8549){var _0x31a75b=apiai(_0x591098,{'language':_0x2a8549||'en'});return _0x31a75b[_0xe2f3('0x57')](_0x10f670,{'sessionId':md5(_0x5644f6)})['then'](function(_0x3fe458){logger['info'](JSON[_0xe2f3('0x42')](_0x3fe458));return{'source':_0x3fe458['result'][_0xe2f3('0x58')],'resolvedQuery':_0x3fe458[_0xe2f3('0x59')][_0xe2f3('0x5a')],'action':_0x3fe458[_0xe2f3('0x59')]['action'],'actionIncomplete':_0x3fe458[_0xe2f3('0x59')]['actionIncomplete'],'speech':_0x3fe458[_0xe2f3('0x59')][_0xe2f3('0x5b')][_0xe2f3('0x5c')],'score':_0x3fe458[_0xe2f3('0x59')][_0xe2f3('0x5d')],'statusCode':_0x3fe458['status']['code'],'endConversation':_0x3fe458[_0xe2f3('0x59')][_0xe2f3('0x5e')][_0xe2f3('0x5f')]||![],'isFallbackIntent':_0x3fe458[_0xe2f3('0x59')][_0xe2f3('0x5e')][_0xe2f3('0x60')]};});};exports[_0xe2f3('0x61')]=function(_0x9c8860,_0x26ded4,_0x12135f,_0x2d09f8,_0x8840d3,_0x609402){var _0x44b795=_0x2d09f8[_0xe2f3('0x62')](/\\n/g,'\x0a');var _0x289480={'credentials':{'private_key':_0x44b795,'client_email':_0x12135f}};var _0xadd4b3=new dialogflow['SessionsClient'](_0x289480);var _0x6e917=_0xadd4b3['sessionPath'](_0x26ded4,md5(_0x9c8860));var _0x363562={'session':_0x6e917,'queryInput':{'text':{'text':_0x8840d3,'languageCode':_0x609402}}};return _0xadd4b3[_0xe2f3('0x63')](_0x363562)[_0xe2f3('0x2b')](function(_0x79bc55){if(_0x79bc55&&_0x79bc55[_0xe2f3('0x46')]){logger[_0xe2f3('0x1a')]('Dialogflow\x20V2\x20response:',JSON[_0xe2f3('0x42')](_0x79bc55));var _0x254016=_0x79bc55[0x0];if(_0x254016){var _0x208f50={'action':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x65')],'allRequiredParamsPresent':_0x254016[_0xe2f3('0x64')]['allRequiredParamsPresent'],'endConversation':_0x254016['queryResult'][_0xe2f3('0x66')]&&_0x254016[_0xe2f3('0x64')][_0xe2f3('0x66')][_0xe2f3('0x67')]?_0x254016[_0xe2f3('0x64')][_0xe2f3('0x66')][_0xe2f3('0x67')][_0xe2f3('0x68')][_0xe2f3('0x69')]:![],'fulfillmentText':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x6a')],'intentName':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x6b')][_0xe2f3('0x55')],'intentDisplayName':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x6b')][_0xe2f3('0x6c')],'isFallbackIntent':_0x254016[_0xe2f3('0x64')]['intent'][_0xe2f3('0x6d')],'languageCode':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x6e')],'queryText':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x6f')],'responseId':_0x254016['responseId'],'score':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x70')],'speech':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x6a')],'providerResponse':JSON[_0xe2f3('0x42')](_0x79bc55)};return _0x208f50;}}});};exports[_0xe2f3('0x71')]=function(_0xebc14b,_0x1251e4,_0x1c6ad,_0x13baa9){return tilde['asr'](_0xebc14b,_0x1251e4,_0x1c6ad,_0x13baa9)['then'](function(_0x34f693){try{fs[_0xe2f3('0x1d')](_0xebc14b);}catch(_0x162298){logger[_0xe2f3('0x15')](_0x162298);}logger['info'](_0xe2f3('0x72'),_0x34f693['transcript']);logger[_0xe2f3('0x1a')](_0xe2f3('0x73'),_0x34f693[_0xe2f3('0x50')]);return _0x34f693;});};exports[_0xe2f3('0x74')]=function(_0x1644d5,_0x537ad0,_0x295978,_0x37c94c,_0x22a99e,_0x3039a8){var _0x3b53c4=path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs[_0xe2f3('0x27')](0x4)+_0xe2f3('0x3a'));var _0x470d69;return aws[_0xe2f3('0x75')](_0x1644d5,_0x537ad0,_0x295978,_0x37c94c,_0x22a99e,_0x3039a8,_0x3b53c4)[_0xe2f3('0x2b')](function(){_0x470d69=path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs[_0xe2f3('0x27')](0x4)+'.wav');return convertFile(_0x3b53c4,_0x470d69);})[_0xe2f3('0x2b')](function(){try{fs[_0xe2f3('0x1d')](_0x3b53c4);fs[_0xe2f3('0x2c')](_0x470d69,_0xe2f3('0x2d'));}catch(_0x30e23c){logger[_0xe2f3('0x15')](_0x30e23c);}return _0x470d69[_0xe2f3('0x2e')]('.')[0x0];});};exports['awsLex']=function(_0x1676b2,_0x5b2584,_0x3aa611,_0x36bd13,_0x4b4e1,_0x415a95){return aws['lex'](_0x1676b2,_0x5b2584,_0x3aa611,_0x36bd13,_0x4b4e1,_0x415a95)[_0xe2f3('0x2b')](function(_0x128937){logger[_0xe2f3('0x1a')](JSON[_0xe2f3('0x42')](_0x128937));return _0x128937;});};exports[_0xe2f3('0x76')]=function(_0x1a274d,_0x13fe1e,_0x22f8fc,_0x3d973d){var _0xba6811=util[_0xe2f3('0x77')](_0xe2f3('0x78'),ISPEECH_API,_0x1a274d,encodeURIComponent(_0x13fe1e),_0x22f8fc,_0x3d973d);var _0x57d2c5=path[_0xe2f3('0x26')](__dirname,'tmp',rs[_0xe2f3('0x27')](0x4)+_0xe2f3('0x3a'));var _0x2b248d;return downloadFile(_0xba6811,_0x57d2c5)[_0xe2f3('0x2b')](function(){_0x2b248d=path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs[_0xe2f3('0x27')](0x4)+_0xe2f3('0x28'));return convertFile(_0x57d2c5,_0x2b248d);})[_0xe2f3('0x2b')](function(){try{fs['unlink'](_0x57d2c5);fs['chmodSync'](_0x2b248d,_0xe2f3('0x2d'));}catch(_0x30f787){logger[_0xe2f3('0x15')](_0x30f787);}return _0x2b248d[_0xe2f3('0x2e')]('.')[0x0];});};exports[_0xe2f3('0x79')]=function(_0x8a85a,_0x2a19e4,_0x189af4,_0x48ae80){var _0x184eb3=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x2a19e4,_0x189af4,base64Encode(_0x8a85a),_0x48ae80?util[_0xe2f3('0x77')]('model=%s',encodeURIComponent(_0x48ae80)):_0xe2f3('0x7a'));return uploadFile(_0x184eb3)[_0xe2f3('0x2b')](function(_0x51039e){return querystring[_0xe2f3('0xa')](_0x51039e);});};exports[_0xe2f3('0x7b')]=function(_0x298921,_0x186698){return sestek[_0xe2f3('0x7c')](_0x298921,_0x186698)[_0xe2f3('0x2b')](function(_0x2b2762){logger[_0xe2f3('0x1a')](JSON[_0xe2f3('0x42')](_0x2b2762));var _0xdd5f98={'speech':_0x2b2762[_0xe2f3('0x7d')],'action':_0x2b2762[_0xe2f3('0x7e')]?_0x2b2762[_0xe2f3('0x7e')]['CustomAction']:undefined,'actiondata':_0x2b2762[_0xe2f3('0x7e')]?_0x2b2762[_0xe2f3('0x7e')][_0xe2f3('0x7f')]:undefined};if(_0x2b2762[_0xe2f3('0x7e')]&&_0x2b2762[_0xe2f3('0x7e')][_0xe2f3('0x80')]){return base64Decode(_0x2b2762['channelData'][_0xe2f3('0x80')][_0xe2f3('0x81')],path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs[_0xe2f3('0x27')](0x4)+_0xe2f3('0x28')))[_0xe2f3('0x2b')](function(_0x53b202){_0xdd5f98[_0xe2f3('0x82')]=_0x53b202;return _0xdd5f98;});}return _0xdd5f98;});};exports[_0xe2f3('0x83')]=function(){return __dirname;}; \ No newline at end of file +var _0x8545=['code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','dialogflow','https','path','request-promise','randomstring','sox','google-tts-api','url','util','./aws','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','WHAT_EVER','data','transcode','error\x20convert','finish\x20to\x20convert','resolve','generate','writeFileSync','base64','split','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','tmp','.mp3','from','audioContent','chmodSync','.wav','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','confidence','join','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score'];(function(_0x53072e,_0x9d6991){var _0x63791c=function(_0x546ce0){while(--_0x546ce0){_0x53072e['push'](_0x53072e['shift']());}};_0x63791c(++_0x9d6991);}(_0x8545,0xba));var _0x5854=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x8545[_0x5a776b];return _0xbbef59;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x5854('0x0'));var dialogflow=require(_0x5854('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x5854('0x2'));var md5=require('md5');var path=require(_0x5854('0x3'));var querystring=require('querystring');var rp=require(_0x5854('0x4'));var rs=require(_0x5854('0x5'));var sox=require(_0x5854('0x6'));var tts=require(_0x5854('0x7'));var urlParse=require(_0x5854('0x8'))['parse'];var util=require(_0x5854('0x9'));var aws=require(_0x5854('0xa'));var google=require(_0x5854('0xb'));var sestek=require(_0x5854('0xc'));var tilde=require('./tilde');var logger=require(_0x5854('0xd'))(_0x5854('0xe'));var ISPEECH_API=_0x5854('0xf');function downloadFile(_0x1a3859,_0x592641){return new BPromise(function(_0x16440c,_0x305da8){var _0x32297f=urlParse(_0x1a3859);var _0x1ec997=_0x32297f[_0x5854('0x10')]==='https:'?https:http;var _0x41d472={'host':_0x32297f[_0x5854('0x11')],'path':_0x32297f[_0x5854('0x3')],'headers':{'user-agent':'WHAT_EVER'}};_0x1ec997[_0x5854('0x12')](_0x41d472,function(_0x126b08){if(_0x126b08[_0x5854('0x13')]!==0xc8){logger[_0x5854('0x14')]('request\x20to\x20'+_0x1a3859+_0x5854('0x15')+_0x126b08[_0x5854('0x13')]+'\x20('+_0x126b08[_0x5854('0x16')]+')');_0x305da8(new Error(_0x5854('0x17')+_0x1a3859+'\x20failed,\x20status\x20code\x20=\x20'+_0x126b08[_0x5854('0x13')]+'\x20('+_0x126b08['statusMessage']+')'));return;}var _0x193cd1=fs[_0x5854('0x18')](_0x592641);_0x193cd1['on'](_0x5854('0x19'),function(){logger[_0x5854('0x1a')](_0x5854('0x1b'));_0x193cd1[_0x5854('0x1c')](_0x16440c);});_0x193cd1['on'](_0x5854('0x14'),function(_0x5bfab4){fs[_0x5854('0x1d')](_0x592641);logger[_0x5854('0x14')](_0x5854('0x1e'),_0x5bfab4);_0x305da8(_0x5bfab4);});_0x126b08[_0x5854('0x1f')](_0x193cd1);})['on']('error',function(_0x352dee){logger['error'](_0x352dee);_0x305da8(_0x352dee);})[_0x5854('0x20')]();});}function uploadFile(_0x35d5e4){return new BPromise(function(_0x390166,_0x477965){var _0x3fd45c=urlParse(_0x35d5e4);var _0xac1758=_0x3fd45c['protocol']===_0x5854('0x21')?https:http;var _0x58a3a0={'host':_0x3fd45c[_0x5854('0x11')],'path':_0x3fd45c[_0x5854('0x3')],'headers':{'user-agent':_0x5854('0x22')}};_0xac1758[_0x5854('0x12')](_0x58a3a0,function(_0x4fcf00){if(_0x4fcf00[_0x5854('0x13')]!==0xc8){_0x477965(new Error(_0x5854('0x17')+_0x35d5e4+_0x5854('0x15')+_0x4fcf00[_0x5854('0x13')]+'\x20('+_0x4fcf00[_0x5854('0x16')]+')'));return;}var _0x435e93='';_0x4fcf00['on'](_0x5854('0x23'),function(_0x4871a3){_0x435e93+=_0x4871a3;});_0x4fcf00['on'](_0x5854('0x20'),function(){_0x390166(_0x435e93);});})['on'](_0x5854('0x14'),function(_0x49cd29){_0x477965(_0x49cd29);})[_0x5854('0x20')]();});}function convertFile(_0x2785fd,_0x46d6d3){return new BPromise(function(_0x4e19b7,_0x181649){var _0x3e4d49=sox[_0x5854('0x24')](_0x2785fd,_0x46d6d3,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3e4d49['on'](_0x5854('0x14'),function(_0x341350){logger[_0x5854('0x14')](_0x5854('0x25'),_0x341350);_0x181649(_0x341350);});_0x3e4d49['on'](_0x5854('0x20'),function(){logger[_0x5854('0x1a')](_0x5854('0x26'));_0x4e19b7();});_0x3e4d49['start']();});}function base64Decode(_0x34302c,_0xc51cbe){var _0x4e5c1f=path[_0x5854('0x27')](__dirname,'tmp',rs[_0x5854('0x28')](0x4)+'.wav');fs[_0x5854('0x29')](_0x4e5c1f,_0x34302c,_0x5854('0x2a'));return convertFile(_0x4e5c1f,_0xc51cbe)['then'](function(){try{fs[_0x5854('0x1d')](_0x4e5c1f);fs['chmodSync'](_0xc51cbe,'777');}catch(_0x4a2223){logger[_0x5854('0x14')](_0x4a2223);}return _0xc51cbe[_0x5854('0x2b')]('.')[0x0];});}function base64Encode(_0x77193e){var _0x1531a9=fs[_0x5854('0x2c')](_0x77193e);return new Buffer(_0x1531a9)['toString']('base64');}exports['googleCloudTTS']=function(_0x5f5ca7,_0x420483,_0x1be75c,_0x4579ed,_0x5cdc48,_0x2fcec8){var _0xe0bbe9,_0x4722c3;var _0x3f62a3=_0x5854('0x2d');var _0xc5c6bb=_0x5854('0x2e')+_0x5f5ca7;var _0x63494f={};if(_0x420483===_0x5854('0x2f')){_0x63494f[_0x5854('0x30')]={'ssml':_0x1be75c};}else{_0x63494f[_0x5854('0x30')]={'text':_0x1be75c};};_0x63494f[_0x5854('0x31')]={'languageCode':_0x4579ed,'ssmlGender':_0x5cdc48};_0x63494f[_0x5854('0x32')]={'audioEncoding':_0x5854('0x33'),'sampleRateHertz':0x1f40};var _0x31b5ef={'url':_0x3f62a3+_0x5854('0x34')+_0xc5c6bb,'method':_0x5854('0x35'),'json':!![],'body':_0x63494f};return rp(_0x31b5ef)[_0x5854('0x36')](function(_0x411445){return new BPromise(function(_0x1fee16,_0x769999){_0xe0bbe9=path[_0x5854('0x27')](__dirname,_0x5854('0x37'),rs[_0x5854('0x28')](0x4)+_0x5854('0x38'));var _0x374415=Buffer[_0x5854('0x39')](_0x411445[_0x5854('0x3a')],_0x5854('0x2a'));return fs['writeFile'](_0xe0bbe9,_0x374415,function(_0x152a91){_0x769999(_0x152a91);},function(_0x1a9f5e){fs[_0x5854('0x3b')](_0xe0bbe9,'777');_0x1fee16(_0x1a9f5e);});});})[_0x5854('0x36')](function(_0x30152b){_0x4722c3=path[_0x5854('0x27')](__dirname,'tmp',rs[_0x5854('0x28')](0x4)+_0x5854('0x3c'));return convertFile(_0xe0bbe9,_0x4722c3);})['then'](function(){try{fs[_0x5854('0x1d')](_0xe0bbe9);fs[_0x5854('0x3b')](_0x4722c3,_0x5854('0x3d'));}catch(_0x1f4db2){logger[_0x5854('0x14')](_0x1f4db2);}logger[_0x5854('0x1a')](_0x5854('0x3e'),_0x4722c3['split']('.')[0x0]);return _0x4722c3[_0x5854('0x2b')]('.')[0x0];});};exports[_0x5854('0x3f')]=function(_0x2028d4,_0xbf1f2e){var _0x30650e=_0x5854('0x40');var _0x454124,_0x2704b8;var _0x4d58ef;var _0x51cbca={'encoding':_0x5854('0x41'),'method':_0x5854('0x35'),'timeout':0x2710,'url':_0x30650e,'headers':{'Content-Type':_0x5854('0x42')},'body':'f.req='+encodeURIComponent(JSON[_0x5854('0x43')]([[[_0x5854('0x44'),JSON[_0x5854('0x43')]([_0x2028d4,_0xbf1f2e||'en',![],_0x5854('0x45')]),null,_0x5854('0x46')]]]))};return rp(_0x51cbca)['then'](function(_0x4d0846){try{_0x4d58ef=eval(_0x4d0846[_0x5854('0x47')](0x5))[0x0][0x2];}catch(_0x5404ad){throw new Error(_0x5854('0x48')+_0x4d0846[_0x5854('0x23')]);}if(!_0x4d58ef){if(_0x2028d4[_0x5854('0x49')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x5854('0x4a')+_0xbf1f2e+_0x5854('0x4b'));}}try{_0x4d58ef=eval(_0x4d58ef)[0x0];}catch(_0x29efc7){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x5854('0x23')]);}const _0x53dc8f=_0x4d58ef;_0x454124=path[_0x5854('0x27')](__dirname,_0x5854('0x37'),rs[_0x5854('0x28')](0x4)+'.mp3');fs[_0x5854('0x29')](_0x454124,_0x4d58ef,{'encoding':_0x5854('0x2a')});_0x2704b8=path[_0x5854('0x27')](__dirname,_0x5854('0x37'),rs['generate'](0x4)+_0x5854('0x3c'));return convertFile(_0x454124,_0x2704b8);})['then'](function(){try{fs[_0x5854('0x1d')](_0x454124);fs['chmodSync'](_0x2704b8,_0x5854('0x3d'));}catch(_0x5b9bfb){logger[_0x5854('0x14')](_0x5b9bfb);}logger[_0x5854('0x1a')](_0x5854('0x4c'),_0x2704b8[_0x5854('0x2b')]('.')[0x0]);return _0x2704b8[_0x5854('0x2b')]('.')[0x0];});};exports[_0x5854('0x4d')]=function(_0xe8675e,_0x1fbb91,_0x217588){return google[_0x5854('0x4e')](_0xe8675e,_0x1fbb91,_0x217588)[_0x5854('0x36')](function(_0x41f263){logger[_0x5854('0x1a')](_0x41f263[_0x5854('0x4f')]);return rp(_0x41f263);})[_0x5854('0x36')](function(_0x17cc5c){var _0x5dcea1='';var _0x5c412f=0x0;try{fs[_0x5854('0x1d')](_0xe8675e);}catch(_0x1dba62){logger['error'](_0x1dba62);}if(_0x17cc5c&&_0x17cc5c[_0x5854('0x50')]){_0x5dcea1=_0x17cc5c[_0x5854('0x50')][_0x5854('0x51')](function(_0x27c688){return _0x27c688&&_0x27c688['alternatives'][0x0]&&_0x27c688['alternatives'][0x0]['transcript']?_0x27c688['alternatives'][0x0]['transcript']:'';})['join']('\x0a');_0x5c412f=_0x17cc5c[_0x5854('0x50')][_0x5854('0x51')](function(_0x19b5d4){return _0x19b5d4&&_0x19b5d4[_0x5854('0x52')][0x0]&&_0x19b5d4[_0x5854('0x52')][0x0][_0x5854('0x53')]?_0x19b5d4[_0x5854('0x52')][0x0]['confidence']:0x0;})[_0x5854('0x54')]('\x0a');}logger[_0x5854('0x1a')](_0x5854('0x55'),_0x5dcea1);logger[_0x5854('0x1a')]('googleASR\x20confidence',_0x5c412f);return{'transcript':_0x5dcea1,'confidence':_0x5c412f};})[_0x5854('0x56')](function(_0x1622b9){logger['error'](_0x5854('0x57'),_0x1622b9[_0x5854('0x13')],_0x1622b9[_0x5854('0x58')],_0x1622b9['message']);});};exports['googleDialogflow']=function(_0x289e1e,_0x50fb9d,_0x224557,_0x81be47){var _0x4a05c2=apiai(_0x50fb9d,{'language':_0x81be47||'en'});return _0x4a05c2[_0x5854('0x59')](_0x224557,{'sessionId':md5(_0x289e1e)})[_0x5854('0x36')](function(_0x29e82a){logger[_0x5854('0x1a')](JSON['stringify'](_0x29e82a));return{'source':_0x29e82a['result'][_0x5854('0x5a')],'resolvedQuery':_0x29e82a[_0x5854('0x5b')][_0x5854('0x5c')],'action':_0x29e82a[_0x5854('0x5b')][_0x5854('0x5d')],'actionIncomplete':_0x29e82a['result'][_0x5854('0x5e')],'speech':_0x29e82a[_0x5854('0x5b')][_0x5854('0x5f')][_0x5854('0x60')],'score':_0x29e82a[_0x5854('0x5b')][_0x5854('0x61')],'statusCode':_0x29e82a['status'][_0x5854('0x62')],'endConversation':_0x29e82a[_0x5854('0x5b')][_0x5854('0x63')][_0x5854('0x64')]||![],'isFallbackIntent':_0x29e82a[_0x5854('0x5b')][_0x5854('0x63')][_0x5854('0x65')]};});};exports[_0x5854('0x66')]=function(_0x40bedc,_0x5d225f,_0x2df9a1,_0x4ce0df,_0x30f0c7,_0x16e2ad){var _0x28a527=_0x4ce0df[_0x5854('0x67')](/\\n/g,'\x0a');var _0x1de40d={'credentials':{'private_key':_0x28a527,'client_email':_0x2df9a1}};var _0x57bc6d=new dialogflow[(_0x5854('0x68'))](_0x1de40d);var _0x44bcca=_0x57bc6d[_0x5854('0x69')](_0x5d225f,md5(_0x40bedc));var _0x51a213={'session':_0x44bcca,'queryInput':{'text':{'text':_0x30f0c7,'languageCode':_0x16e2ad}}};return _0x57bc6d[_0x5854('0x6a')](_0x51a213)[_0x5854('0x36')](function(_0x5d9cac){if(_0x5d9cac&&_0x5d9cac['length']){logger[_0x5854('0x1a')](_0x5854('0x6b'),JSON[_0x5854('0x43')](_0x5d9cac));var _0x2113e4=_0x5d9cac[0x0];if(_0x2113e4){var _0x2c1fc6={'action':_0x2113e4['queryResult'][_0x5854('0x5d')],'allRequiredParamsPresent':_0x2113e4[_0x5854('0x6c')][_0x5854('0x6d')],'endConversation':_0x2113e4[_0x5854('0x6c')][_0x5854('0x6e')]&&_0x2113e4[_0x5854('0x6c')]['diagnosticInfo']['fields']?_0x2113e4[_0x5854('0x6c')][_0x5854('0x6e')][_0x5854('0x6f')][_0x5854('0x70')][_0x5854('0x71')]:![],'fulfillmentText':_0x2113e4[_0x5854('0x6c')][_0x5854('0x72')],'intentName':_0x2113e4[_0x5854('0x6c')][_0x5854('0x73')][_0x5854('0x58')],'intentDisplayName':_0x2113e4['queryResult']['intent'][_0x5854('0x74')],'isFallbackIntent':_0x2113e4['queryResult']['intent'][_0x5854('0x75')],'languageCode':_0x2113e4[_0x5854('0x6c')][_0x5854('0x76')],'queryText':_0x2113e4['queryResult']['queryText'],'responseId':_0x2113e4[_0x5854('0x77')],'score':_0x2113e4[_0x5854('0x6c')][_0x5854('0x78')],'speech':_0x2113e4[_0x5854('0x6c')][_0x5854('0x72')],'providerResponse':JSON[_0x5854('0x43')](_0x5d9cac)};return _0x2c1fc6;}}});};exports[_0x5854('0x79')]=function(_0x50548e,_0x5290bc,_0xab1c0f,_0xcf18db){return tilde[_0x5854('0x4e')](_0x50548e,_0x5290bc,_0xab1c0f,_0xcf18db)[_0x5854('0x36')](function(_0x4c76e8){try{fs[_0x5854('0x1d')](_0x50548e);}catch(_0x536cca){logger[_0x5854('0x14')](_0x536cca);}logger['info'](_0x5854('0x7a'),_0x4c76e8['transcript']);logger[_0x5854('0x1a')](_0x5854('0x7b'),_0x4c76e8[_0x5854('0x53')]);return _0x4c76e8;});};exports[_0x5854('0x7c')]=function(_0x2262b2,_0x18134d,_0x58facc,_0x5ce0d0,_0x308296,_0x10ea83){var _0x270ef6=path[_0x5854('0x27')](__dirname,_0x5854('0x37'),rs[_0x5854('0x28')](0x4)+_0x5854('0x38'));var _0xa15bbd;return aws['polly'](_0x2262b2,_0x18134d,_0x58facc,_0x5ce0d0,_0x308296,_0x10ea83,_0x270ef6)[_0x5854('0x36')](function(){_0xa15bbd=path[_0x5854('0x27')](__dirname,_0x5854('0x37'),rs[_0x5854('0x28')](0x4)+_0x5854('0x3c'));return convertFile(_0x270ef6,_0xa15bbd);})['then'](function(){try{fs['unlink'](_0x270ef6);fs[_0x5854('0x3b')](_0xa15bbd,_0x5854('0x3d'));}catch(_0x156cd6){logger['error'](_0x156cd6);}return _0xa15bbd[_0x5854('0x2b')]('.')[0x0];});};exports[_0x5854('0x7d')]=function(_0x364f40,_0x509df8,_0x1f387c,_0x169cf2,_0x730702,_0x21530f){return aws['lex'](_0x364f40,_0x509df8,_0x1f387c,_0x169cf2,_0x730702,_0x21530f)[_0x5854('0x36')](function(_0x1a9e28){logger['info'](JSON[_0x5854('0x43')](_0x1a9e28));return _0x1a9e28;});};exports[_0x5854('0x7e')]=function(_0x257f76,_0x4fb339,_0x59512d,_0x33eea2){var _0x1f2c42=util[_0x5854('0x7f')](_0x5854('0x80'),ISPEECH_API,_0x257f76,encodeURIComponent(_0x4fb339),_0x59512d,_0x33eea2);var _0x4e93db=path[_0x5854('0x27')](__dirname,_0x5854('0x37'),rs['generate'](0x4)+_0x5854('0x38'));var _0x4cfbdd;return downloadFile(_0x1f2c42,_0x4e93db)[_0x5854('0x36')](function(){_0x4cfbdd=path[_0x5854('0x27')](__dirname,_0x5854('0x37'),rs[_0x5854('0x28')](0x4)+_0x5854('0x3c'));return convertFile(_0x4e93db,_0x4cfbdd);})[_0x5854('0x36')](function(){try{fs['unlink'](_0x4e93db);fs[_0x5854('0x3b')](_0x4cfbdd,_0x5854('0x3d'));}catch(_0x24bb12){logger[_0x5854('0x14')](_0x24bb12);}return _0x4cfbdd['split']('.')[0x0];});};exports['ispeechASR']=function(_0x43df79,_0x45b029,_0x4cf5bf,_0x52287a){var _0x5b22af=util[_0x5854('0x7f')](_0x5854('0x81'),ISPEECH_API,_0x45b029,_0x4cf5bf,base64Encode(_0x43df79),_0x52287a?util[_0x5854('0x7f')](_0x5854('0x82'),encodeURIComponent(_0x52287a)):_0x5854('0x83'));return uploadFile(_0x5b22af)[_0x5854('0x36')](function(_0x2ab341){return querystring[_0x5854('0x84')](_0x2ab341);});};exports[_0x5854('0x85')]=function(_0x2f1845,_0x3619b5){return sestek[_0x5854('0x86')](_0x2f1845,_0x3619b5)[_0x5854('0x36')](function(_0x1b6541){logger['info'](JSON[_0x5854('0x43')](_0x1b6541));var _0x272650={'speech':_0x1b6541[_0x5854('0x87')],'action':_0x1b6541[_0x5854('0x88')]?_0x1b6541[_0x5854('0x88')]['CustomAction']:undefined,'actiondata':_0x1b6541[_0x5854('0x88')]?_0x1b6541[_0x5854('0x88')][_0x5854('0x89')]:undefined};if(_0x1b6541[_0x5854('0x88')]&&_0x1b6541['channelData']['AudioFromTts']){return base64Decode(_0x1b6541[_0x5854('0x88')][_0x5854('0x8a')][_0x5854('0x8b')],path[_0x5854('0x27')](__dirname,_0x5854('0x37'),rs[_0x5854('0x28')](0x4)+_0x5854('0x3c')))[_0x5854('0x36')](function(_0x2476d6){_0x272650[_0x5854('0x8c')]=_0x2476d6;return _0x272650;});}return _0x272650;});};exports[_0x5854('0x8d')]=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 a58a94e..65f5543 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 _0xfd7d=['./nda','exports'];(function(_0x2ac7e7,_0x25a63c){var _0x3707ba=function(_0x46c114){while(--_0x46c114){_0x2ac7e7['push'](_0x2ac7e7['shift']());}};_0x3707ba(++_0x25a63c);}(_0xfd7d,0x19a));var _0xdfd7=function(_0x1261c2,_0x3ef819){_0x1261c2=_0x1261c2-0x0;var _0x3aabd2=_0xfd7d[_0x1261c2];return _0x3aabd2;};var nda=require(_0xdfd7('0x0'));module[_0xdfd7('0x1')]={'nda':nda}; \ No newline at end of file +var _0xea6b=['exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xea6b,0x1de));var _0xbea6=function(_0x50523e,_0x1b6840){_0x50523e=_0x50523e-0x0;var _0x429325=_0xea6b[_0x50523e];return _0x429325;};var nda=require('./nda');module[_0xbea6('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 884547c..efab1ab 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 _0xa5fa=['ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username','then','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','dnid','text','Bearer\x20','access_token','project','body','ProjectName'];(function(_0x5ec655,_0x1b7d41){var _0x144c58=function(_0x4285dd){while(--_0x4285dd){_0x5ec655['push'](_0x5ec655['shift']());}};_0x144c58(++_0x1b7d41);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x11167c,_0xb0ff07){_0x11167c=_0x11167c-0x0;var _0x34bdb0=_0xa5fa[_0x11167c];return _0x34bdb0;};'use strict';var rp=require('request-promise');var url=require(_0xaa5f('0x0'));var logger=require(_0xaa5f('0x1'))(_0xaa5f('0x2'));module[_0xaa5f('0x3')]=function(_0x499d69,_0x3e56f9){var _0x106128={'method':'POST','uri':url[_0xaa5f('0x4')](_0x3e56f9[_0xaa5f('0x5')],_0xaa5f('0x6')),'form':{'grant_type':_0xaa5f('0x7'),'username':_0x3e56f9[_0xaa5f('0x8')],'password':_0x3e56f9[_0xaa5f('0x7')]},'json':!![]};return rp(_0x106128)[_0xaa5f('0x9')](function(_0xc326df){var _0x74f64f={'method':_0xaa5f('0xa'),'uri':url[_0xaa5f('0x4')](_0x3e56f9['ndassistant_url'],_0xaa5f('0xb')),'body':{'type':_0x3e56f9[_0xaa5f('0xc')]||'message','channelId':'Nda','conversation':{'id':_0x499d69[_0xaa5f('0xd')]},'from':{'id':_0x499d69['callerid'],'name':_0x499d69['calleridname']},'recipient':{'id':_0x499d69[_0xaa5f('0xe')],'name':_0x499d69['extension']},'text':_0x3e56f9[_0xaa5f('0xf')],'channelData':{}},'headers':{'Authorization':_0xaa5f('0x10')+_0xc326df[_0xaa5f('0x11')]},'json':!![]};if(_0x3e56f9[_0xaa5f('0x12')]){_0x74f64f[_0xaa5f('0x13')]['channelData'][_0xaa5f('0x14')]=_0x3e56f9['project'];}if(_0x3e56f9[_0xaa5f('0x15')]=='1'){_0x74f64f[_0xaa5f('0x13')][_0xaa5f('0x16')][_0xaa5f('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xaa5f('0x18')};}if(_0x3e56f9['custom_action']){_0x74f64f['body'][_0xaa5f('0x16')][_0xaa5f('0x19')]=_0x3e56f9[_0xaa5f('0x1a')];if(_0x3e56f9[_0xaa5f('0x1b')]){_0x74f64f[_0xaa5f('0x13')][_0xaa5f('0x16')][_0xaa5f('0x1c')]=_0x3e56f9[_0xaa5f('0x1b')];}}logger[_0xaa5f('0x1d')](JSON[_0xaa5f('0x1e')](_0x74f64f));return rp(_0x74f64f);});}; \ No newline at end of file +var _0x3a25=['agi','exports','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','text','Bearer\x20','channelData','ProjectName','project','AudioOutputSettings','audio/wav','custom_action','body','CustomAction','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger'];(function(_0x5acd63,_0x1c2edb){var _0x3ba438=function(_0x39b681){while(--_0x39b681){_0x5acd63['push'](_0x5acd63['shift']());}};_0x3ba438(++_0x1c2edb);}(_0x3a25,0x15d));var _0x53a2=function(_0x38d4eb,_0x2ff249){_0x38d4eb=_0x38d4eb-0x0;var _0x43fadf=_0x3a25[_0x38d4eb];return _0x43fadf;};'use strict';var rp=require(_0x53a2('0x0'));var url=require(_0x53a2('0x1'));var logger=require(_0x53a2('0x2'))(_0x53a2('0x3'));module[_0x53a2('0x4')]=function(_0x8efef2,_0x119389){var _0x1f138b={'method':_0x53a2('0x5'),'uri':url[_0x53a2('0x6')](_0x119389[_0x53a2('0x7')],_0x53a2('0x8')),'form':{'grant_type':_0x53a2('0x9'),'username':_0x119389[_0x53a2('0xa')],'password':_0x119389[_0x53a2('0x9')]},'json':!![]};return rp(_0x1f138b)['then'](function(_0x3ee956){var _0x5dc70e={'method':_0x53a2('0x5'),'uri':url[_0x53a2('0x6')](_0x119389[_0x53a2('0xb')],_0x53a2('0xc')),'body':{'type':_0x119389[_0x53a2('0xd')]||_0x53a2('0xe'),'channelId':_0x53a2('0xf'),'conversation':{'id':_0x8efef2[_0x53a2('0x10')]},'from':{'id':_0x8efef2[_0x53a2('0x11')],'name':_0x8efef2[_0x53a2('0x12')]},'recipient':{'id':_0x8efef2['dnid'],'name':_0x8efef2['extension']},'text':_0x119389[_0x53a2('0x13')],'channelData':{}},'headers':{'Authorization':_0x53a2('0x14')+_0x3ee956['access_token']},'json':!![]};if(_0x119389['project']){_0x5dc70e['body'][_0x53a2('0x15')][_0x53a2('0x16')]=_0x119389[_0x53a2('0x17')];}if(_0x119389['ndagenerate_audio']=='1'){_0x5dc70e['body']['channelData'][_0x53a2('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x53a2('0x19')};}if(_0x119389[_0x53a2('0x1a')]){_0x5dc70e[_0x53a2('0x1b')]['channelData'][_0x53a2('0x1c')]=_0x119389[_0x53a2('0x1a')];if(_0x119389[_0x53a2('0x1d')]){_0x5dc70e[_0x53a2('0x1b')][_0x53a2('0x15')]['CustomActionData']=_0x119389['custom_action_data'];}}logger[_0x53a2('0x1e')](JSON[_0x53a2('0x1f')](_0x5dc70e));return rp(_0x5dc70e);});}; \ 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 d7bba86..c97c313 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 _0x8a24=['exports','./lib/api'];(function(_0x270e5b,_0x5095e8){var _0x6eaf1d=function(_0x189cb6){while(--_0x189cb6){_0x270e5b['push'](_0x270e5b['shift']());}};_0x6eaf1d(++_0x5095e8);}(_0x8a24,0x151));var _0x48a2=function(_0x1c1006,_0x52d7c1){_0x1c1006=_0x1c1006-0x0;var _0x1b9cb9=_0x8a24[_0x1c1006];return _0x1b9cb9;};'use strict';var asr=require(_0x48a2('0x0'));module[_0x48a2('0x1')]=function(_0x41a5df,_0x38bb29,_0x1029b3,_0x355823){return asr(_0x41a5df,_0x38bb29,_0x1029b3,_0x355823);}; \ No newline at end of file +var _0xc014=['exports','./lib/api'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc014,0x1d5));var _0x4c01=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xc014[_0x2080a3];return _0x8d7d17;};'use strict';var asr=require(_0x4c01('0x0'));module[_0x4c01('0x1')]=function(_0x48bd5d,_0xbfe92d,_0x388108,_0x3a90d5){return asr(_0x48bd5d,_0xbfe92d,_0x388108,_0x3a90d5);}; \ 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 1906624..04829fd 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 _0x2a71=['digest','info','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','transcript','Success.','terminate','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x2a71,0x18d));var _0x12a7=function(_0x5012e0,_0x47a186){_0x5012e0=_0x5012e0-0x0;var _0x72706d=_0x2a71[_0x5012e0];return _0x72706d;};'use strict';var BPromise=require(_0x12a7('0x0'));var _=require(_0x12a7('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x12a7('0x2'));var logger=require(_0x12a7('0x3'))(_0x12a7('0x4'));module[_0x12a7('0x5')]=function(_0x410120,_0x3503ff,_0x468d70,_0x14c6a9){return new BPromise(function(_0x2cf050,_0x51c3eb){logger['info']('Tilde\x20URI',_0x14c6a9||_0x12a7('0x6'));var _0x370f37=new WebSocket(_0x14c6a9||_0x12a7('0x6'),{'perMessageDeflate':![]});var _0x26e36e='';var _0xb35666='0';var _0x4eabe9='1';var _0x4126db=_0x12a7('0x7');function _0x5bd052(_0x5375e2){var _0x4f8c6a=crypto[_0x12a7('0x8')]('sha1');_0x4f8c6a[_0x12a7('0x9')](_0x5375e2);return _0x4f8c6a[_0x12a7('0xa')]('hex');}function _0x9fef46(){try{logger[_0x12a7('0xb')]('Open\x20Tilde\x20ASR\x20socket');var _0x572951=moment()[_0x12a7('0xc')]();var _0x2f9dab=_0x5bd052(_0x572951+_0x3503ff+_0x468d70);_0x370f37[_0x12a7('0xd')](JSON[_0x12a7('0xe')]({'appID':_0x3503ff,'timestamp':_0x572951,'appKey':_0x2f9dab}));var _0x4cdd0d=fs[_0x12a7('0xf')](_0x410120);_0x4cdd0d['on'](_0x12a7('0x10'),function(_0x4ddd1e){_0x370f37[_0x12a7('0xd')](_0x4ddd1e);});_0x4cdd0d['on'](_0x12a7('0x11'),function(){_0x370f37[_0x12a7('0xd')](_0x12a7('0x12'));});}catch(_0x5c6d65){logger[_0x12a7('0x13')](_0x12a7('0x14'),JSON['stringify'](_0x5c6d65));_0x370f37['terminate']();}}function _0x15a9e5(_0x5cb6e5){try{if(_0x5cb6e5){var _0x565c96=JSON[_0x12a7('0x15')](_0x5cb6e5);switch(_0x565c96[_0x12a7('0x16')]){case 0x0:if(_0x565c96['result']){if(_0x565c96[_0x12a7('0x17')][_0x12a7('0x18')]){logger[_0x12a7('0xb')]('Tilde\x20ASR\x20hypoteses',JSON[_0x12a7('0xe')](_0x565c96[_0x12a7('0x17')]['hypotheses']));_0x26e36e=_0x565c96[_0x12a7('0x17')]['hypotheses'][0x0][_0x12a7('0x19')];_0xb35666=_0x565c96[_0x12a7('0x17')]['hypotheses'][0x0]['likelihood'];_0x4eabe9='0';_0x4126db=_0x12a7('0x1a');_0x370f37[_0x12a7('0x1b')]();}}break;case 0x1:logger['info'](_0x12a7('0x7'));_0x4eabe9='1';_0x4126db=_0x12a7('0x7');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x4eabe9='2';_0x4126db='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x12a7('0xb')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x4eabe9='9';_0x4126db=_0x12a7('0x1c');break;case 0xa:logger['info'](_0x12a7('0x1d'));_0x4eabe9='10';_0x4126db='Authentication\x20failed.';break;case 0xb:logger[_0x12a7('0xb')](_0x12a7('0x1e'));_0x4eabe9='11';_0x4126db=_0x12a7('0x1e');}}}catch(_0x3f5c96){logger[_0x12a7('0x13')](_0x12a7('0x1f'),JSON['stringify'](_0x3f5c96));_0x370f37['terminate']();}}function _0x5d1929(){logger[_0x12a7('0xb')](_0x12a7('0x20'));_0x2cf050({'transcript':_0x26e36e,'confidence':_0xb35666,'status':_0x4eabe9,'status_message':_0x4126db});}function _0x3b6a3a(_0x2917b9){logger['error'](_0x12a7('0x21'));if(!_[_0x12a7('0x22')](_0x2917b9)){logger['error'](_[_0x12a7('0x23')](_0x2917b9)?JSON[_0x12a7('0xe')](_0x2917b9):_0x2917b9);}}_0x370f37['on'](_0x12a7('0x24'),_0x9fef46);_0x370f37['on']('message',_0x15a9e5);_0x370f37['on'](_0x12a7('0x11'),_0x5d1929);_0x370f37['on'](_0x12a7('0x13'),_0x3b6a3a);});}; \ No newline at end of file +var _0x62d3=['Authentication\x20failed.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','agi','exports','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','info','Open\x20Tilde\x20ASR\x20socket','createReadStream','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.'];(function(_0x55789e,_0x2ae417){var _0x4c752b=function(_0x312420){while(--_0x312420){_0x55789e['push'](_0x55789e['shift']());}};_0x4c752b(++_0x2ae417);}(_0x62d3,0x15e));var _0x362d=function(_0x1ec118,_0x1c0df2){_0x1ec118=_0x1ec118-0x0;var _0x35408e=_0x62d3[_0x1ec118];return _0x35408e;};'use strict';var BPromise=require(_0x362d('0x0'));var _=require(_0x362d('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0x362d('0x2'));module[_0x362d('0x3')]=function(_0x4e0a7e,_0x57dccc,_0x375e53,_0x2fa460){return new BPromise(function(_0x50c5b4,_0x3d760c){logger['info']('Tilde\x20URI',_0x2fa460||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x238652=new WebSocket(_0x2fa460||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x475a5c='';var _0x14b49e='0';var _0x2aad36='1';var _0xd1bdfa=_0x362d('0x4');function _0x2760ae(_0x1498c8){var _0x4c75eb=crypto[_0x362d('0x5')]('sha1');_0x4c75eb[_0x362d('0x6')](_0x1498c8);return _0x4c75eb[_0x362d('0x7')]('hex');}function _0x4f4999(){try{logger[_0x362d('0x8')](_0x362d('0x9'));var _0x246756=moment()['unix']();var _0x6175e3=_0x2760ae(_0x246756+_0x57dccc+_0x375e53);_0x238652['send'](JSON['stringify']({'appID':_0x57dccc,'timestamp':_0x246756,'appKey':_0x6175e3}));var _0x55be2a=fs[_0x362d('0xa')](_0x4e0a7e);_0x55be2a['on'](_0x362d('0xb'),function(_0x1b94e4){_0x238652[_0x362d('0xc')](_0x1b94e4);});_0x55be2a['on'](_0x362d('0xd'),function(){_0x238652[_0x362d('0xc')](_0x362d('0xe'));});}catch(_0x2f13d8){logger[_0x362d('0xf')](_0x362d('0x10'),JSON[_0x362d('0x11')](_0x2f13d8));_0x238652[_0x362d('0x12')]();}}function _0x5a0786(_0x97054d){try{if(_0x97054d){var _0x54edec=JSON[_0x362d('0x13')](_0x97054d);switch(_0x54edec[_0x362d('0x14')]){case 0x0:if(_0x54edec[_0x362d('0x15')]){if(_0x54edec[_0x362d('0x15')][_0x362d('0x16')]){logger[_0x362d('0x8')](_0x362d('0x17'),JSON[_0x362d('0x11')](_0x54edec[_0x362d('0x15')]['hypotheses']));_0x475a5c=_0x54edec['result'][_0x362d('0x18')][0x0][_0x362d('0x19')];_0x14b49e=_0x54edec['result'][_0x362d('0x18')][0x0][_0x362d('0x1a')];_0x2aad36='0';_0xd1bdfa=_0x362d('0x1b');_0x238652['terminate']();}}break;case 0x1:logger[_0x362d('0x8')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x2aad36='1';_0xd1bdfa=_0x362d('0x4');break;case 0x2:logger[_0x362d('0x8')](_0x362d('0x1c'));_0x2aad36='2';_0xd1bdfa='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x2aad36='9';_0xd1bdfa=_0x362d('0x1d');break;case 0xa:logger[_0x362d('0x8')](_0x362d('0x1e'));_0x2aad36='10';_0xd1bdfa=_0x362d('0x1e');break;case 0xb:logger[_0x362d('0x8')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x2aad36='11';_0xd1bdfa='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0xb88beb){logger['error'](_0x362d('0x1f'),JSON[_0x362d('0x11')](_0xb88beb));_0x238652[_0x362d('0x12')]();}}function _0x40c2bb(){logger[_0x362d('0x8')](_0x362d('0x20'));_0x50c5b4({'transcript':_0x475a5c,'confidence':_0x14b49e,'status':_0x2aad36,'status_message':_0xd1bdfa});}function _0x36eb58(_0x566ec2){logger[_0x362d('0xf')](_0x362d('0x21'));if(!_[_0x362d('0x22')](_0x566ec2)){logger[_0x362d('0xf')](_[_0x362d('0x23')](_0x566ec2)?JSON['stringify'](_0x566ec2):_0x566ec2);}}_0x238652['on'](_0x362d('0x24'),_0x4f4999);_0x238652['on'](_0x362d('0x25'),_0x5a0786);_0x238652['on']('close',_0x40c2bb);_0x238652['on'](_0x362d('0xf'),_0x36eb58);});}; \ 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 f09aa1c..fb0c1c0 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 _0x4b09=['./asr'];(function(_0x28acd0,_0x2d97e7){var _0x320376=function(_0x5d3656){while(--_0x5d3656){_0x28acd0['push'](_0x28acd0['shift']());}};_0x320376(++_0x2d97e7);}(_0x4b09,0x1d4));var _0x94b0=function(_0x4fdcc0,_0x560a01){_0x4fdcc0=_0x4fdcc0-0x0;var _0xc0ce94=_0x4b09[_0x4fdcc0];return _0xc0ce94;};var asr=require(_0x94b0('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xc63d=['exports','./asr'];(function(_0x4c24d8,_0x432ee4){var _0x14a371=function(_0x2371a0){while(--_0x2371a0){_0x4c24d8['push'](_0x4c24d8['shift']());}};_0x14a371(++_0x432ee4);}(_0xc63d,0x167));var _0xdc63=function(_0x2a1c55,_0x15199e){_0x2a1c55=_0x2a1c55-0x0;var _0x159e1e=_0xc63d[_0x2a1c55];return _0x159e1e;};var asr=require(_0xdc63('0x0'));module[_0xdc63('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 08bd206..b2a08a3 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x38d8e2,_0x48603c){var _0x5afbee=function(_0x2eca5e){while(--_0x2eca5e){_0x38d8e2['push'](_0x38d8e2['shift']());}};_0x5afbee(++_0x48603c);}(_0xe706,0xa3));var _0x6e70=function(_0x55555f,_0x505b88){_0x55555f=_0x55555f-0x0;var _0x208602=_0xe706[_0x55555f];return _0x208602;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index d98307d..bb6ee44 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 _0xbd50=['uniqueid','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isNil','isEmpty','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','tildeASR','appid','appsecret','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','%s.%s','length','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','query','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','PLAYBACK','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusCode','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','mailRpc','prototype','getVariableById','then','catch','getVoiceQueue','rpc','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','callerid','createSquareRecording'];(function(_0x2eefeb,_0x2924c2){var _0x522442=function(_0x2c99e4){while(--_0x2c99e4){_0x2eefeb['push'](_0x2eefeb['shift']());}};_0x522442(++_0x2924c2);}(_0xbd50,0x196));var _0x0bd5=function(_0x192de5,_0x48058f){_0x192de5=_0x192de5-0x0;var _0x2ec949=_0xbd50[_0x192de5];return _0x2ec949;};'use strict';var fs=require('fs');var util=require(_0x0bd5('0x0'));var _=require(_0x0bd5('0x1'));var sh=require(_0x0bd5('0x2'));var odbc=require('odbc')();var rs=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var Mustache=require(_0x0bd5('0x5'));var rp=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('agi');var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0x0bd5('0x8');var recursiveMapAttributes=[_0x0bd5('0x9'),_0x0bd5('0xa')];var verticesWithRetry=[_0x0bd5('0xb'),_0x0bd5('0xc'),'getsecretdigits'];var AGIVertices=function(_0x47e78d,_0x1a5cb9,_0x25e31e){this[_0x0bd5('0xd')]=_0x47e78d;this['rpc']=_0x1a5cb9;this[_0x0bd5('0xe')]=_0x25e31e;};AGIVertices[_0x0bd5('0xf')]['getVariable']=function(_0x210f45,_0x7db86e){this['rpc'][_0x0bd5('0x10')](_0x210f45)[_0x0bd5('0x11')](function(_0x1aa818){_0x7db86e(null,_0x1aa818?_0x1aa818['name']:![]);})[_0x0bd5('0x12')](function(_0x23982f){_0x7db86e(_0x23982f);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x13')]=function(_0xfa1eed,_0x557be0){this[_0x0bd5('0x14')][_0x0bd5('0x15')](_0xfa1eed)['then'](function(_0x78f9b8){_0x557be0(null,_0x78f9b8?_0x78f9b8[_0x0bd5('0x16')]:![]);})['catch'](function(_0x31349f){_0x557be0(_0x31349f);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x17')]=function(_0xc22553,_0x55d565){this[_0x0bd5('0x14')][_0x0bd5('0x18')](_0xc22553)[_0x0bd5('0x11')](function(_0x277b32){_0x55d565(null,_0x277b32?_0x277b32[_0x0bd5('0x16')]:![]);})[_0x0bd5('0x12')](function(_0xc58e12){_0x55d565(_0xc58e12);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x19')]=function(_0x20c667,_0x27bc1e){this[_0x0bd5('0x14')][_0x0bd5('0x1a')](_0x20c667)[_0x0bd5('0x11')](function(_0x527c37){_0x27bc1e(null,_0x527c37?_0x527c37['dsn']:![]);})['catch'](function(_0x4ed64e){_0x27bc1e(_0x4ed64e);});};AGIVertices['prototype'][_0x0bd5('0x1b')]=function(_0x86381d,_0x13ce46){this[_0x0bd5('0x14')][_0x0bd5('0x1c')](_0x86381d)['then'](function(_0x440f85){_0x13ce46(null,_0x440f85?_0x440f85[_0x0bd5('0x16')]:![]);})[_0x0bd5('0x12')](function(_0x5a8139){_0x13ce46(_0x5a8139);});};AGIVertices[_0x0bd5('0xf')]['getTrunk']=function(_0x4969e6,_0x14c319){this[_0x0bd5('0x14')][_0x0bd5('0x1d')](_0x4969e6)['then'](function(_0x42428c){_0x14c319(null,_0x42428c?_0x42428c['name']:![]);})[_0x0bd5('0x12')](function(_0x3ffb08){_0x14c319(_0x3ffb08);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1e')]=function(_0x3ff237,_0x2023d5){var _0x19bb5e=this;this[_0x0bd5('0x14')][_0x0bd5('0x1f')](_0x3ff237)[_0x0bd5('0x11')](function(_0x15561b){_0x2023d5(null,_0x15561b?_0x19bb5e[_0x0bd5('0x20')](_0x15561b[_0x0bd5('0x21')]):![]);})[_0x0bd5('0x12')](function(_0x5e5a33){_0x2023d5(_0x5e5a33);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x22')]=function(_0x4c799f,_0x20e6c3){this[_0x0bd5('0x14')]['getMailAccountById'](_0x4c799f)[_0x0bd5('0x11')](function(_0x1b7cf4){_0x20e6c3(null,_0x1b7cf4?_0x1b7cf4:![]);})[_0x0bd5('0x12')](function(_0x25a35b){_0x20e6c3(_0x25a35b);});};AGIVertices['prototype'][_0x0bd5('0x23')]=function(_0x366e8c,_0x622d46,_0x24ef4a){this[_0x0bd5('0xe')][_0x0bd5('0x23')](_0x366e8c,_0x622d46)['then'](function(){_0x24ef4a(null);})[_0x0bd5('0x12')](function(_0x589ea2){_0x24ef4a(_0x589ea2);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x24')]=function(_0x444ddb,_0x132e02){this[_0x0bd5('0x14')][_0x0bd5('0x25')](_0x444ddb)[_0x0bd5('0x11')](function(_0x24f7d5){if(_0x24f7d5){if(_0x24f7d5[_0x0bd5('0x26')]){_0x132e02(null,[_0x24f7d5[_0x0bd5('0x27')]]);}else{_0x132e02(null,_[_0x0bd5('0x28')](_0x24f7d5[_0x0bd5('0x29')],_0x0bd5('0x27')));}}else{_0x132e02(null,![]);}})['catch'](function(_0x3e153a){_0x132e02(_0x3e153a);});};AGIVertices[_0x0bd5('0xf')]['getSoundPath']=function(_0x50b9ce){return util[_0x0bd5('0x2a')](_0x0bd5('0x2b'),FILES_PATH,_0x50b9ce);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x2c')]=function(_0x1dd2e1,_0x387e24,_0x22c10c){odbc[_0x0bd5('0x2d')](_0x1dd2e1,function(_0x44b2ce){if(_0x44b2ce){logger[_0x0bd5('0x2e')](_0x0bd5('0x2f'),_0x44b2ce);_0x22c10c(_0x44b2ce);}else{logger[_0x0bd5('0x30')](_0x0bd5('0x31'));odbc['query'](_0x387e24,function(_0x109f54,_0x5b915c){if(_0x109f54){logger[_0x0bd5('0x30')](_0x0bd5('0x32'),_0x387e24);_0x22c10c(_0x109f54);}else{logger[_0x0bd5('0x30')](_0x0bd5('0x33'),_0x387e24);odbc[_0x0bd5('0x34')](function(_0x18e408){if(_0x18e408){logger['error'](_0x0bd5('0x35'),_0x18e408);}_0x22c10c(null,_0x5b915c);});}});}});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x36')]=function(_0x1a9dda,_0x1c73be){this[_0x0bd5('0x14')][_0x0bd5('0x37')](_0x1a9dda)[_0x0bd5('0x11')](function(_0x1c2ef8){_0x1c73be(null,_0x1c2ef8?_0x1c2ef8:![]);})['catch'](function(_0x177aa3){_0x1c73be(_0x177aa3);});};AGIVertices['prototype'][_0x0bd5('0x38')]=function(_0xc17464,_0x480b8b){this[_0x0bd5('0x14')][_0x0bd5('0x38')](_0xc17464)[_0x0bd5('0x11')](function(_0x3ec4b0){_0x480b8b(null,_0x3ec4b0);})[_0x0bd5('0x12')](function(_0x1a8d55){_0x480b8b(_0x1a8d55);});};AGIVertices[_0x0bd5('0xf')]['createSquareDetailsReport']=function(_0x4d3ca5,_0x994f24,_0x545b63){this['rpc'][_0x0bd5('0x39')]({'uniqueid':this[_0x0bd5('0xd')]['uniqueid'],'node':_0x4d3ca5['label'],'application':_0x4d3ca5['agicommand'],'data':_0x994f24||null,'project_name':this[_0x0bd5('0xd')]['arg_1'],'callerid':this['channel'][_0x0bd5('0x3a')]})[_0x0bd5('0x11')](function(_0x49e46a){if(_0x545b63){_0x545b63(null,_0x49e46a);}})['catch'](function(_0xb46d84){if(_0x545b63){_0x545b63(_0xb46d84);}});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x3b')]=function(_0xa36962,_0x56a702,_0x290342,_0x44f485){this[_0x0bd5('0x14')][_0x0bd5('0x3b')]({'uniqueid':this[_0x0bd5('0xd')][_0x0bd5('0x3c')],'callerid':this['channel'][_0x0bd5('0x3a')],'calleridname':this[_0x0bd5('0xd')][_0x0bd5('0x3d')],'context':this['channel'][_0x0bd5('0x3e')],'extension':this[_0x0bd5('0xd')][_0x0bd5('0x3f')],'priority':this['channel'][_0x0bd5('0x40')],'accountcode':this[_0x0bd5('0xd')][_0x0bd5('0x41')],'dnid':this[_0x0bd5('0xd')][_0x0bd5('0x42')],'projectName':this['channel'][_0x0bd5('0x43')],'saveName':_0x56a702,'filename':_0xa36962[_0x0bd5('0x44')]||_0x56a702,'savePath':_0x290342})['then'](function(_0x2db9b0){_0x44f485(null,_0x2db9b0);})[_0x0bd5('0x12')](function(_0x146bdc){_0x44f485(_0x146bdc);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x45')]=function(_0x508aa8,_0x109793,_0x128df9,_0x5cd889,_0x70d7ce){this['rpc'][_0x0bd5('0x45')]({'uniqueid':this[_0x0bd5('0xd')][_0x0bd5('0x3c')],'body':_0x508aa8,'direction':_0x109793,'providerName':_0x128df9,'providerResponse':_0x5cd889})[_0x0bd5('0x11')](function(_0x5f54bb){if(_0x70d7ce){_0x70d7ce(null,_0x5f54bb);}})[_0x0bd5('0x12')](function(_0x4cb674){if(_0x70d7ce){_0x70d7ce(_0x4cb674);}});};AGIVertices['prototype'][_0x0bd5('0x46')]=function(_0x1b473f,_0x172393){this['rpc'][_0x0bd5('0x46')]({'firstName':_['isEmpty'](_0x1b473f[_0x0bd5('0x16')])||_[_0x0bd5('0x47')](_0x1b473f[_0x0bd5('0x16')])?'callback_'+Math['random']():_0x1b473f['name'],'lastName':_[_0x0bd5('0x48')](_0x1b473f[_0x0bd5('0x49')])||_[_0x0bd5('0x47')](_0x1b473f['lastName'])?null:_0x1b473f[_0x0bd5('0x49')],'phone':_0x1b473f[_0x0bd5('0x4a')],'ListId':_0x1b473f['list_id'],'scheduledat':_0x1b473f[_0x0bd5('0x4b')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x0bd5('0x4c'),'description':_0x0bd5('0x4d')+_0x1b473f[_0x0bd5('0x4b')][_0x0bd5('0x4e')](),'priority':_0x1b473f['callback_priority']})[_0x0bd5('0x11')](function(_0x3316ba){_0x172393(null,_0x3316ba);})[_0x0bd5('0x12')](function(_0x5cf2f2){_0x172393(_0x5cf2f2);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x4f')]=function(_0x374701,_0x4851fb){this['rpc'][_0x0bd5('0x50')](_0x374701)['then'](function(_0x3e20e9){_0x4851fb(null,_0x3e20e9?_0x3e20e9[_0x0bd5('0x16')]:![]);})[_0x0bd5('0x12')](function(_0x5e7bcd){_0x4851fb(_0x5e7bcd);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x51')]=function(_0x3eaea6,_0x38aae5,_0x5e93fa){var _0x3c0d59={'role':_0x0bd5('0x52')};_0x3c0d59[_0x3eaea6]=this[_0x0bd5('0xd')][_0x0bd5('0x3a')];this[_0x0bd5('0x14')]['agentPause'](_0x3c0d59,_0x38aae5,this[_0x0bd5('0xd')]['uniqueid'])[_0x0bd5('0x11')](function(_0x5d6cb3){_0x5e93fa(null,_['isNil'](_0x5d6cb3)?![]:!![]);})[_0x0bd5('0x12')](function(_0x55883d){logger[_0x0bd5('0x2e')](_0x55883d);_0x5e93fa(null,![]);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x53')]=function(_0x5c84f9,_0x4f7e86){var _0x27609f={'role':'agent'};_0x27609f[_0x5c84f9]=this[_0x0bd5('0xd')][_0x0bd5('0x3a')];this['rpc'][_0x0bd5('0x53')](_0x27609f)['then'](function(_0x45ccf5){_0x4f7e86(null,_[_0x0bd5('0x47')](_0x45ccf5)?![]:!![]);})[_0x0bd5('0x12')](function(_0x18cb9b){logger[_0x0bd5('0x2e')](_0x18cb9b);_0x4f7e86(null,![]);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x54')]=function(_0x4ad449,_0x33ad3f){var _0x1e5e7d={'role':_0x0bd5('0x52')};_0x1e5e7d[_0x4ad449]=this['channel']['callerid'];this[_0x0bd5('0x14')][_0x0bd5('0x54')](_0x1e5e7d)[_0x0bd5('0x11')](function(_0x42dc72){_0x33ad3f(null,_[_0x0bd5('0x47')](_0x42dc72)?![]:!![]);})[_0x0bd5('0x12')](function(_0x1db7f2){logger[_0x0bd5('0x2e')](_0x1db7f2);_0x33ad3f(null,![]);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x55')]=function(_0x11c266,_0x377869){var _0x30b87e={'role':_0x0bd5('0x52')};_0x30b87e[_0x11c266]=this[_0x0bd5('0xd')][_0x0bd5('0x3a')];var _0x29d9d8=_0x11c266!=_0x0bd5('0x56')?util['format'](_0x0bd5('0x57'),_0x0bd5('0x58'),this['channel'][_0x0bd5('0x3a')]):undefined;this['rpc'][_0x0bd5('0x55')](_0x30b87e,_0x29d9d8)[_0x0bd5('0x11')](function(_0x4f7170){_0x377869(null,_[_0x0bd5('0x47')](_0x4f7170)?![]:!![]);})[_0x0bd5('0x12')](function(_0x1510bd){logger[_0x0bd5('0x2e')](_0x1510bd);_0x377869(null,![]);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x59')]=function(_0x2fbea8,_0x1a5708){sh[_0x0bd5('0x5a')](_['trim'](_0x2fbea8),function(_0x196c1c,_0x3be572){var _0x583835=_0x3be572[_0x0bd5('0x5b')](/(\r\n|\n|\r)/gm,'');_0x1a5708(null,_0x583835);});};AGIVertices[_0x0bd5('0xf')]['googleCloudTTS']=function(_0x215491,_0x333303){scripts['googleCloudTTS'](_0x215491[_0x0bd5('0x5c')],_0x215491['google_cloud_tts_text_type']||_0x0bd5('0x5d'),_0x215491[_0x0bd5('0x5d')],_0x215491[_0x0bd5('0x5e')]||_0x0bd5('0x5f'),_0x215491[_0x0bd5('0x60')]||_0x0bd5('0x61'),_0x215491[_0x0bd5('0x62')]||_0x0bd5('0x63'))[_0x0bd5('0x11')](function(_0x1812a4){_0x333303(null,_0x1812a4);})[_0x0bd5('0x12')](function(_0x1182b4){_0x333303(_0x1182b4);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x64')]=function(_0x580a90,_0x2707f7){scripts[_0x0bd5('0x64')](_0x580a90[_0x0bd5('0x5d')],_0x580a90[_0x0bd5('0x65')]||'en',0x1)[_0x0bd5('0x11')](function(_0xf5ef66){_0x2707f7(null,_0xf5ef66);})['catch'](function(_0x1500f2){_0x2707f7(_0x1500f2);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x66')]=function(_0x371b77,_0x3bc8cc){var _0x116e67={'uri':_0x371b77[_0x0bd5('0x67')],'method':_0x371b77['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x371b77['timeout'])==='number'&&parseInt(_0x371b77[_0x0bd5('0x68')])>=0x1?parseInt(_0x371b77[_0x0bd5('0x68')])*0x3e8:0x5*0x3e8};if(_[_0x0bd5('0x69')]([_0x0bd5('0x6a'),_0x0bd5('0x6b')],_0x116e67['method'][_0x0bd5('0x6c')]())){try{_0x116e67[_0x0bd5('0x6d')]=_0x371b77['rawBody']?JSON[_0x0bd5('0x6e')](_0x371b77[_0x0bd5('0xa')]):{};}catch(_0x1a812e){logger[_0x0bd5('0x2e')](_0x0bd5('0x6f'),_0x1a812e);}}try{_0x116e67[_0x0bd5('0x70')]=_0x371b77[_0x0bd5('0x9')]?JSON[_0x0bd5('0x6e')](_0x371b77[_0x0bd5('0x9')]):{};}catch(_0x32110c){logger[_0x0bd5('0x2e')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x32110c);}if(_0x371b77[_0x0bd5('0x71')]){try{var _0x3a0719=require(_0x371b77[_0x0bd5('0x71')])[_0x0bd5('0x72')](this,_0x116e67);_0x116e67[_0x0bd5('0x73')]=Mustache['render'](_0x371b77[_0x0bd5('0x67')],_0x3a0719,{},['$$','$$']);if(_0x116e67[_0x0bd5('0x70')]){_0x116e67[_0x0bd5('0x70')]=JSON[_0x0bd5('0x6e')](Mustache[_0x0bd5('0x74')](JSON[_0x0bd5('0x75')](_0x116e67[_0x0bd5('0x70')]),_0x3a0719,{},['$$','$$']));}if(_0x116e67[_0x0bd5('0x6d')]){_0x116e67[_0x0bd5('0x6d')]=JSON[_0x0bd5('0x6e')](Mustache[_0x0bd5('0x74')](JSON[_0x0bd5('0x75')](_0x116e67[_0x0bd5('0x6d')]),_0x3a0719,{},['$$','$$']));}}catch(_0xcbb2fc){logger[_0x0bd5('0x2e')](_0x0bd5('0x76'),_0xcbb2fc);}}rp(_0x116e67)[_0x0bd5('0x11')](function(_0x14653e){var _0x6afdff={'statusCode':_0x14653e['statusCode']||0xc8,'statusMessage':_0x14653e['statusMessage']||'OK','headers':_0x14653e[_0x0bd5('0x70')]||{},'body':_0x14653e[_0x0bd5('0x6d')]||{}};_0x3bc8cc(null,_0x6afdff);})[_0x0bd5('0x12')](function(_0xc53281){var _0x25b65b={'statusCode':_0xc53281['statusCode']||0x1f4,'statusMessage':_0xc53281[_0x0bd5('0x77')]||_0x0bd5('0x78'),'headers':_0xc53281[_0x0bd5('0x79')][_0x0bd5('0x70')]||{},'body':_0xc53281[_0x0bd5('0x79')]['body']||{}};_0x3bc8cc(null,_0x25b65b);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x7a')]=function(_0x7c1d11,_0x200df8){scripts[_0x0bd5('0x7a')](this[_0x0bd5('0xd')][_0x0bd5('0x3c')],_0x7c1d11[_0x0bd5('0x7b')],_0x7c1d11[_0x0bd5('0x5d')],_0x7c1d11[_0x0bd5('0x7c')]||'en')[_0x0bd5('0x11')](function(_0x48a77d){_0x200df8(null,_0x48a77d);})[_0x0bd5('0x12')](function(_0x26ad0c){_0x200df8(_0x26ad0c);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x7d')]=function(_0x2c77eb,_0x46a5ee){scripts[_0x0bd5('0x7d')](this[_0x0bd5('0xd')]['uniqueid'],_0x2c77eb[_0x0bd5('0x7e')],_0x2c77eb[_0x0bd5('0x7f')],_0x2c77eb[_0x0bd5('0x80')],_0x2c77eb[_0x0bd5('0x5d')],_0x2c77eb[_0x0bd5('0x81')]||'en')[_0x0bd5('0x11')](function(_0x3ee6bf){_0x46a5ee(null,_0x3ee6bf);})[_0x0bd5('0x12')](function(_0x97d31b){_0x46a5ee(_0x97d31b);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x82')]=function(_0x112e85,_0x23a041){scripts[_0x0bd5('0x82')](this[_0x0bd5('0xd')],_0x112e85)[_0x0bd5('0x11')](function(_0x54ba20){_0x23a041(null,_0x54ba20);})[_0x0bd5('0x12')](function(_0x331841){_0x23a041(_0x331841);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x83')]=function(_0x323f48,_0x2cd599){scripts[_0x0bd5('0x83')](_0x323f48[_0x0bd5('0x7b')],_0x323f48[_0x0bd5('0x5d')],_0x323f48['ispeech_tts_language']||_0x0bd5('0x5f'),_0x323f48[_0x0bd5('0x84')])[_0x0bd5('0x11')](function(_0x505d41){_0x2cd599(null,_0x505d41);})[_0x0bd5('0x12')](function(_0x1d5c3a){_0x2cd599(_0x1d5c3a);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x85')]=function(_0x1e7d05,_0x2fd908,_0x533297){scripts[_0x0bd5('0x85')](_0x2fd908,_0x1e7d05['key'],_0x1e7d05[_0x0bd5('0x86')]||'en-US',this['isConfigured'](_0x1e7d05[_0x0bd5('0x87')])?_0x1e7d05[_0x0bd5('0x87')]:undefined)[_0x0bd5('0x11')](function(_0x1e0a98){_0x533297(null,_0x1e0a98);})['catch'](function(_0xb303d9){_0x533297(_0xb303d9);});};AGIVertices[_0x0bd5('0xf')]['awsPolly']=function(_0x8e94cf,_0x3609db){scripts[_0x0bd5('0x88')](_0x8e94cf[_0x0bd5('0x89')],_0x8e94cf[_0x0bd5('0x8a')],_0x8e94cf[_0x0bd5('0x8b')],_0x8e94cf[_0x0bd5('0x8c')]||_0x0bd5('0x8d'),_0x8e94cf[_0x0bd5('0x5d')],_0x8e94cf[_0x0bd5('0x8e')]||_0x0bd5('0x5d'))[_0x0bd5('0x11')](function(_0xaea5ef){_0x3609db(null,_0xaea5ef);})[_0x0bd5('0x12')](function(_0x2220f5){_0x3609db(_0x2220f5);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x8f')]=function(_0x12da8d,_0x2eee49){scripts[_0x0bd5('0x8f')](this[_0x0bd5('0xd')][_0x0bd5('0x3c')],_0x12da8d[_0x0bd5('0x89')],_0x12da8d[_0x0bd5('0x8a')],_0x12da8d[_0x0bd5('0x90')],_0x12da8d[_0x0bd5('0x5d')],_0x12da8d['aws_bot_name'])[_0x0bd5('0x11')](function(_0x4b65f6){_0x2eee49(null,_0x4b65f6);})[_0x0bd5('0x12')](function(_0x467a37){_0x2eee49(_0x467a37);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x91')]=function(_0x105048,_0xeffd4d,_0x1fa5c7){scripts[_0x0bd5('0x91')](_0xeffd4d,_0x105048[_0x0bd5('0x7b')],_0x105048['google_asr_language']||'en-US')[_0x0bd5('0x11')](function(_0x392bdc){_0x1fa5c7(null,_0x392bdc);})['catch'](function(_0x3771b7){_0x1fa5c7(_0x3771b7);});};AGIVertices['prototype'][_0x0bd5('0x92')]=function(_0x1e754a,_0x240ed8,_0x40a5d0){scripts['tildeASR'](_0x240ed8,_0x1e754a[_0x0bd5('0x93')],_0x1e754a[_0x0bd5('0x94')],_0x1e754a[_0x0bd5('0x73')])[_0x0bd5('0x11')](function(_0x5d2896){_0x40a5d0(null,_0x5d2896);})[_0x0bd5('0x12')](function(_0x327708){_0x40a5d0(_0x327708);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x95')]=function(_0x31d2e0){var _0x32c424=_[_0x0bd5('0x69')](verticesWithRetry,_0x31d2e0[_0x0bd5('0x96')])?_0x31d2e0:_[_0x0bd5('0x97')](_0x31d2e0);for(var _0x42a7b0 in _0x32c424){if(_0x32c424[_0x0bd5('0x98')](_0x42a7b0)){if(_0x32c424[_0x42a7b0]&&_[_0x0bd5('0x99')](_0x32c424[_0x42a7b0])){if(_['includes'](recursiveMapAttributes,_0x42a7b0)){_0x32c424[_0x42a7b0]=this[_0x0bd5('0x9a')](_0x32c424[_0x42a7b0]);}else{_0x32c424[_0x42a7b0]=this[_0x0bd5('0x9b')](_0x32c424[_0x42a7b0]);}}}}return _0x32c424;};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x9c')]=function(_0x29db27){for(var _0x74b27 in _0x29db27){if(_0x29db27[_0x0bd5('0x98')](_0x74b27)){if(_[_0x0bd5('0x9d')](_0x29db27[_0x74b27])){this[_0x0bd5('0x9c')](_0x29db27[_0x74b27]);}else if(_[_0x0bd5('0x9e')](_0x29db27[_0x74b27])){for(var _0x2a05bc=0x0;_0x2a05bc<_0x29db27[_0x74b27]['length'];_0x2a05bc++){this[_0x0bd5('0x9c')](_0x29db27[_0x74b27][_0x2a05bc]);}}else if(_['isString'](_0x29db27[_0x74b27])){_0x29db27[_0x74b27]=this[_0x0bd5('0x9b')](_0x29db27[_0x74b27]);}}}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x9f')]=function(_0x57e61b,_0x509e4d){for(var _0x57d9dd in _0x57e61b){if(_0x57e61b[_0x0bd5('0x98')](_0x57d9dd)){if(_[_0x0bd5('0x9d')](_0x57e61b[_0x57d9dd])){if(!_[_0x0bd5('0x48')](_0x57e61b[_0x57d9dd])){this[_0x0bd5('0x9f')](_0x57e61b[_0x57d9dd],util[_0x0bd5('0x2a')](_0x0bd5('0xa0'),_0x509e4d,_0x57d9dd));}}else if(_[_0x0bd5('0x9e')](_0x57e61b[_0x57d9dd])){for(var _0xe74312=0x0;_0xe74312<_0x57e61b[_0x57d9dd][_0x0bd5('0xa1')];_0xe74312++){this[_0x0bd5('0x9f')](_0x57e61b[_0x57d9dd][_0xe74312],util[_0x0bd5('0x2a')]('%s.%s',_0x509e4d,_0x57d9dd+'['+_0xe74312+']'));}}else{if(!_[_0x0bd5('0x47')](_0x57e61b[_0x57d9dd])){this[_0x0bd5('0xd')]['setVariable'](util['format'](_0x0bd5('0xa0'),_0x509e4d,_0x57d9dd),_0x57e61b[_0x57d9dd]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x4145b8){try{var _0x26c6db=JSON[_0x0bd5('0x6e')](_0x4145b8);this[_0x0bd5('0x9c')](_0x26c6db);return JSON[_0x0bd5('0x75')](_0x26c6db);}catch(_0x36e17c){return this[_0x0bd5('0x9b')](_0x4145b8);}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x9b')]=function(_0xa965e5){var _0xa2096c=_0xa965e5['split']('{');for(var _0x137649=0x1;_0x137649<_0xa2096c[_0x0bd5('0xa1')];_0x137649+=0x1){var _0x41aeec=_0xa2096c[_0x137649][_0x0bd5('0xa2')]('}');if(_0x41aeec[_0x0bd5('0xa1')]>0x1){_0xa965e5=_0xa965e5[_0x0bd5('0xa3')]('{'+_0x41aeec[0x0]+'}',this[_0x0bd5('0xd')][_0x0bd5('0xa4')](_0x41aeec[0x0])[_0x0bd5('0xa5')]||_0x41aeec[0x0]);}}if(_0xa2096c[_0x0bd5('0xa1')]===0x1){return _0xa965e5[_0x0bd5('0x4e')]();}return this[_0x0bd5('0x9b')](_0xa965e5);};AGIVertices['prototype'][_0x0bd5('0xa6')]=function(_0x5d8f36,_0x337ed1){var _0x4b24f2=this[_0x0bd5('0xd')][_0x0bd5('0xa4')](_0x5d8f36);if(_0x4b24f2[_0x0bd5('0xa7')]===-0x1){return _0x4b24f2;}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xa8'),_0x337ed1,_0x4b24f2[_0x0bd5('0xa5')]));return this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0x337ed1,_0x4b24f2[_0x0bd5('0xa5')]);};AGIVertices['prototype'][_0x0bd5('0xaa')]=function(_0x365b22){return _0x365b22&&_0x365b22!=='0'&&_0x365b22!=='-1'&&_0x365b22!=='';};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xab')]=function(_0x26c4c5){this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x26c4c5,'-');_0x26c4c5[_0x0bd5('0xac')]=_0x26c4c5[_0x0bd5('0xab')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xad')]=function(_0x315e4a){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xae'),_0x315e4a[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x315e4a['text'])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}var _0x2a8c09='\x22'+_0x315e4a['text']+'\x22';if(this[_0x0bd5('0xaa')](_0x315e4a[_0x0bd5('0x79')])){_0x2a8c09+=','+_0x315e4a[_0x0bd5('0x79')];}var _0x545fde=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xb2'),_0x2a8c09);if(_0x545fde[_0x0bd5('0xa7')]===-0x1){return _0x545fde;}return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2a8c09));};AGIVertices[_0x0bd5('0xf')]['mrcprecog']=function(_0x39a94f){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xb3'),_0x39a94f[_0x0bd5('0xaf')]));if(!this['isConfigured'](_0x39a94f[_0x0bd5('0xb4')])){return this['channel'][_0x0bd5('0xb0')]('no\x20grammar\x20configured');}var _0x5807ba=_0x39a94f[_0x0bd5('0xb4')];if(this[_0x0bd5('0xaa')](_0x39a94f[_0x0bd5('0x79')])){_0x5807ba+=','+_0x39a94f[_0x0bd5('0x79')];}var _0x4f9dd1=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xb5'),_0x5807ba);if(_0x4f9dd1[_0x0bd5('0xa7')]===-0x1){return _0x4f9dd1;}var _0x5a05b4=this[_0x0bd5('0xa6')](_0x0bd5('0xb6'),_0x0bd5('0xb7'));if(_0x5a05b4[_0x0bd5('0xa7')]===-0x1){return _0x5a05b4;}var _0x20c7c6=this[_0x0bd5('0xa6')](_0x0bd5('0xb8'),_0x0bd5('0xb9'));if(_0x20c7c6[_0x0bd5('0xa7')]===-0x1){return _0x20c7c6;}var _0x466e41=this['getAndSetVariable'](_0x0bd5('0xba'),'MRCP_RECOG_INSTANCE');if(_0x466e41[_0x0bd5('0xa7')]===-0x1){return _0x466e41;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xbb'),_0x5807ba));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xbc')]=function(_0x4b656e){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0xbd'),_0x4b656e[_0x0bd5('0xaf')]));return this['channel'][_0x0bd5('0xbc')]([_0x4b656e[_0x0bd5('0xbe')],_0x4b656e[_0x0bd5('0xbf')]]);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xc0')]=function(_0x20ff57){logger['info'](util['format'](_0x0bd5('0xc1'),_0x20ff57['label']));if(this[_0x0bd5('0xaa')](_0x20ff57[_0x0bd5('0x68')])){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xc2'),_0x20ff57[_0x0bd5('0x68')]));var _0x3da9b5=this[_0x0bd5('0xd')][_0x0bd5('0xc3')](_0x20ff57[_0x0bd5('0x68')]);if(_0x3da9b5[_0x0bd5('0xa7')]===-0x1){return _0x3da9b5;}}return this['channel'][_0x0bd5('0xc0')]();};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x4c')]=function(_0x2f1461){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xc4'),_0x2f1461[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x2f1461[_0x0bd5('0xc5')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x2f1461,_0x0bd5('0xc6'));}_0x2f1461[_0x0bd5('0x4b')]=moment();if(this[_0x0bd5('0xaa')](_0x2f1461[_0x0bd5('0xc7')])){_0x2f1461[_0x0bd5('0x4b')]=moment()[_0x0bd5('0xc8')](_0x2f1461[_0x0bd5('0xc7')],_0x0bd5('0xc9'));}if(!this[_0x0bd5('0xaa')](_0x2f1461['callback_priority'])){_0x2f1461[_0x0bd5('0xca')]=0x2;}this[_0x0bd5('0x46')][_0x0bd5('0x72')](this,_0x2f1461);return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xcb'),_0x2f1461[_0x0bd5('0x4a')],_0x2f1461[_0x0bd5('0xc5')],_0x2f1461['scheduledAt']));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xcc')]=function(_0x3263a7){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0xcd'),_0x3263a7['label']));var _0x2a50a2=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x3263a7['application'],_0x3263a7[_0x0bd5('0x79')]);if(_0x2a50a2[_0x0bd5('0xa7')]===-0x1){return _0x2a50a2;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xce'),_0x3263a7[_0x0bd5('0xcf')],_0x3263a7[_0x0bd5('0x79')]));};AGIVertices[_0x0bd5('0xf')]['lumenvoxtts']=function(_0x1a5c39){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0xd0'),_0x1a5c39[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x1a5c39['text'])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xb1'));}var _0x4996fc='\x22'+_0x1a5c39['text']+'\x22';if(this['isConfigured'](_0x1a5c39[_0x0bd5('0x79')])){_0x4996fc+=','+_0x1a5c39[_0x0bd5('0x79')];}var _0x3e7ce1=this[_0x0bd5('0xd')][_0x0bd5('0x5a')]('MRCPSynth',_0x4996fc);if(_0x3e7ce1[_0x0bd5('0xa7')]===-0x1){return _0x3e7ce1;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4996fc));};AGIVertices['prototype']['sestektts']=function(_0x394de9){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0xd1'),_0x394de9['label']));if(!this[_0x0bd5('0xaa')](_0x394de9[_0x0bd5('0x5d')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}var _0x3b617f='\x22'+_0x394de9['text']+'\x22';if(this[_0x0bd5('0xaa')](_0x394de9[_0x0bd5('0x79')])){_0x3b617f+=','+_0x394de9[_0x0bd5('0x79')];}var _0x4a3e68=this['channel'][_0x0bd5('0x5a')](_0x0bd5('0xb2'),_0x3b617f);if(_0x4a3e68[_0x0bd5('0xa7')]===-0x1){return _0x4a3e68;}return this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xd2'),_0x3b617f));};AGIVertices['prototype'][_0x0bd5('0xd3')]=function(_0x277dbe){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xd4'),_0x277dbe[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x277dbe['grammar'])){return this[_0x0bd5('0xd')]['noop']('no\x20grammar\x20configured');}var _0x2f066b=_0x277dbe[_0x0bd5('0xb4')];if(this[_0x0bd5('0xaa')](_0x277dbe[_0x0bd5('0x79')])){_0x2f066b+=','+_0x277dbe[_0x0bd5('0x79')];}var _0x221cf6=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xb5'),_0x2f066b);if(_0x221cf6[_0x0bd5('0xa7')]===-0x1){return _0x221cf6;}var _0x30ffcc=this['getAndSetVariable'](_0x0bd5('0xb6'),_0x0bd5('0xd5'));if(_0x30ffcc['result']===-0x1){return _0x30ffcc;}var _0x3ac7da=this[_0x0bd5('0xa6')](_0x0bd5('0xb8'),_0x0bd5('0xd6'));if(_0x3ac7da[_0x0bd5('0xa7')]===-0x1){return _0x3ac7da;}var _0x163832=this['getAndSetVariable'](_0x0bd5('0xba'),_0x0bd5('0xd7'));if(_0x163832[_0x0bd5('0xa7')]===-0x1){return _0x163832;}return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0xbb'),_0x2f066b));};AGIVertices['prototype'][_0x0bd5('0xd8')]=function(_0x3d3073){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0xd9'),_0x3d3073['label']));if(!this['isConfigured'](_0x3d3073[_0x0bd5('0xb4')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xda'));}var _0x56a475=_0x3d3073['grammar'];if(this[_0x0bd5('0xaa')](_0x3d3073[_0x0bd5('0x79')])){_0x56a475+=','+_0x3d3073[_0x0bd5('0x79')];}var _0x440d03=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xb5'),_0x56a475);if(_0x440d03['result']===-0x1){return _0x440d03;}var _0xf69970=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x0bd5('0xdb'));if(_0xf69970[_0x0bd5('0xa7')]===-0x1){return _0xf69970;}var _0x101ada=this[_0x0bd5('0xa6')]('RECOG_INPUT()',_0x0bd5('0xdc'));if(_0x101ada[_0x0bd5('0xa7')]===-0x1){return _0x101ada;}var _0xb325b7=this[_0x0bd5('0xa6')](_0x0bd5('0xba'),_0x0bd5('0xdd'));if(_0xb325b7[_0x0bd5('0xa7')]===-0x1){return _0xb325b7;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0xbb'),_0x56a475));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xde')]=function(_0x17a446){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xdf'),_0x17a446[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x17a446['odbc_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x17a446,_0x0bd5('0xe0'));}var _0x8628fd=this[_0x0bd5('0x19')][_0x0bd5('0x72')](this,_0x17a446[_0x0bd5('0xe1')]);if(!_0x8628fd){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x17a446,'no\x20odbc\x20database\x20found');}if(!this[_0x0bd5('0xaa')](_0x17a446[_0x0bd5('0xe2')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x17a446,_0x0bd5('0xe3'));}var _0x284fbf=_0x17a446['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('query:\x20%s',_0x284fbf));var _0x187367=this[_0x0bd5('0x2c')][_0x0bd5('0x72')](this,_0x8628fd,_0x284fbf);this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x17a446,_0x284fbf);if(!this[_0x0bd5('0xaa')](_0x17a446[_0x0bd5('0xe4')])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0xe5'));}var _0x4fd105=this[_0x0bd5('0xa4')]['sync'](this,_0x17a446[_0x0bd5('0xe4')]);if(!_0x4fd105){return this['channel']['error'](_0x17a446,_0x0bd5('0xe6'));}var _0x2a3d44=this;_0x187367[_0x0bd5('0xe7')](function(_0x7e0bac,_0x303cbb){Object[_0x0bd5('0xe8')](_0x7e0bac)[_0x0bd5('0xe7')](function(_0xd0cf36){_0x2a3d44['channel'][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0xe9'),_0x4fd105,_0x303cbb,_0xd0cf36),_0x7e0bac[_0xd0cf36]);});});this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0xea'),_0x4fd105),_0x187367['length']);return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xeb'),_0x4fd105));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xec')]=function(_0x49363b){logger[_0x0bd5('0xed')](util['format'](_0x0bd5('0xee'),_0x49363b[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x49363b[_0x0bd5('0xef')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x49363b,'no\x20user\x20selected');}var _0x48a214=this[_0x0bd5('0x1b')][_0x0bd5('0x72')](this,_0x49363b[_0x0bd5('0xef')]);if(!_0x48a214){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x49363b,_0x0bd5('0xf0'));}var _0x5e6752=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xf1'),[util['format'](_0x0bd5('0xf2'),_0x48a214),_0x49363b['timeout'],_0x49363b['opts'],_0x49363b[_0x0bd5('0x67')]]);if(_0x5e6752[_0x0bd5('0xa7')]===-0x1){return _0x5e6752;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format']('Executed\x20command\x20%s',_0x0bd5('0xf1')));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xf3')]=function(_0x207acf){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x207acf[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x207acf['key'])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xf4'));}if(!this[_0x0bd5('0xaa')](_0x207acf['text'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xf5')]=!![];this['createSquareDetailsReport'](_0x207acf);this[_0x0bd5('0x45')](_0x207acf[_0x0bd5('0x5d')],'in','','');this['channel']['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0xf6'),_0x207acf[_0x0bd5('0x5d')]));var _0x24da0a=this[_0x0bd5('0x7a')][_0x0bd5('0x72')](this,_0x207acf);if(_0x24da0a){for(var _0x214875 in _0x24da0a){if(_0x24da0a['hasOwnProperty'](_0x214875)){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0xf7'),_0x214875[_0x0bd5('0x6c')]()),_0x24da0a[_0x214875]);}}this[_0x0bd5('0x45')](_0x24da0a[_0x0bd5('0xf8')],_0x0bd5('0xf9'),_0x0bd5('0xf3'),'');return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0xfa'),_0x24da0a[_0x0bd5('0xf8')]));}return this[_0x0bd5('0xd')]['error'](_0x207acf,_0x0bd5('0xfb'));};AGIVertices[_0x0bd5('0xf')]['dialogflowV2']=function(_0x2b61e7){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xfc'),_0x2b61e7[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x2b61e7[_0x0bd5('0x7e')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xfd'));}if(!this[_0x0bd5('0xaa')](_0x2b61e7[_0x0bd5('0x7f')])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xfe'));}if(!this[_0x0bd5('0xaa')](_0x2b61e7[_0x0bd5('0x80')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xff'));}if(!this[_0x0bd5('0xaa')](_0x2b61e7[_0x0bd5('0x81')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x100'));}if(!this['isConfigured'](_0x2b61e7['text'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x2b61e7);this[_0x0bd5('0x45')](_0x2b61e7[_0x0bd5('0x5d')],'in','','');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x101'),_0x2b61e7[_0x0bd5('0x5d')]));var _0x27e296=this[_0x0bd5('0x7d')][_0x0bd5('0x72')](this,_0x2b61e7);if(_0x27e296){for(var _0x70396c in _0x27e296){if(_0x27e296[_0x0bd5('0x98')](_0x70396c)){if(_0x70396c!==_0x0bd5('0x102')){this['channel'][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0xf7'),_0x70396c[_0x0bd5('0x6c')]()),_0x27e296[_0x70396c]);}}}this[_0x0bd5('0x45')](_0x27e296[_0x0bd5('0xf8')],_0x0bd5('0xf9'),_0x0bd5('0x103'),_0x27e296[_0x0bd5('0x102')]);return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0x104'),_0x27e296[_0x0bd5('0xf8')]));}return this[_0x0bd5('0xd')]['error'](_0x2b61e7,_0x0bd5('0x105'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x106')]=function(_0x47fc7a){logger['info'](util['format'](_0x0bd5('0x107'),_0x47fc7a[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x47fc7a['ndauth_url'])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x108'));}if(!this[_0x0bd5('0xaa')](_0x47fc7a['username'])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0x109'));}if(!this[_0x0bd5('0xaa')](_0x47fc7a[_0x0bd5('0x10a')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x10b'));}if(!this['isConfigured'](_0x47fc7a[_0x0bd5('0x10c')])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xb1'));}this['channel']['bot']=!![];this[_0x0bd5('0x39')](_0x47fc7a);this[_0x0bd5('0x45')](_0x47fc7a[_0x0bd5('0x5d')],'in','','');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x10d'),_0x47fc7a[_0x0bd5('0x5d')]));var _0x85338b=this[_0x0bd5('0x82')][_0x0bd5('0x72')](this,_0x47fc7a);if(_0x85338b){for(var _0xbf22de in _0x85338b){if(_0x85338b['hasOwnProperty'](_0xbf22de)){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0x10e'),_0xbf22de[_0x0bd5('0x6c')]()),_0x85338b[_0xbf22de]);}}this[_0x0bd5('0x45')](_0x85338b[_0x0bd5('0xf8')],'out','sesteknda','');if(_0x85338b[_0x0bd5('0x10f')]){this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0x110'),_0x85338b['audiofile']));var _0x2c67b1=this[_0x0bd5('0xd')][_0x0bd5('0x111')](_0x85338b[_0x0bd5('0x10f')]);try{fs['unlink'](_0x85338b[_0x0bd5('0x10f')]+'.wav');}catch(_0x27fe1e){logger[_0x0bd5('0x2e')](_0x27fe1e);}return _0x2c67b1;}else{return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x112'),_0x85338b['speech']));}}return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x47fc7a,_0x0bd5('0x113'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x114')]=function(_0x1c44b6){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x115'),_0x1c44b6['label']));return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x114'));};AGIVertices['prototype'][_0x0bd5('0x116')]=function(_0xfa2e4d){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x117'),_0xfa2e4d[_0x0bd5('0xaf')]));var _0x32d781='';if(_0xfa2e4d[_0x0bd5('0x118')]){if(!this[_0x0bd5('0xaa')](_0xfa2e4d['trunk_id'])){return this[_0x0bd5('0xd')]['error'](_0xfa2e4d,_0x0bd5('0x119'));}else{var _0x4a43d6=parseInt(_0xfa2e4d['trunk_id'],0xa);if(isNaN(_0x4a43d6)){_0x32d781=_0xfa2e4d[_0x0bd5('0x118')];}else{_0x32d781=this[_0x0bd5('0x11a')][_0x0bd5('0x72')](this,_0xfa2e4d[_0x0bd5('0x118')]);if(!_0x32d781){return this[_0x0bd5('0xd')]['error'](_0xfa2e4d,_0x0bd5('0x11b'));}}}}else if(_0xfa2e4d[_0x0bd5('0x11c')]){_0x32d781=_0xfa2e4d[_0x0bd5('0x11c')];}else{return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0xfa2e4d,'no\x20trunk\x20selected');}var _0x57dd7c=this[_0x0bd5('0xd')][_0x0bd5('0x5a')]('DIAL',[util[_0x0bd5('0x2a')](_0x0bd5('0x11d'),_0x32d781,_0xfa2e4d['phone']),_0xfa2e4d['timeout'],_0xfa2e4d[_0x0bd5('0x11e')],_0xfa2e4d[_0x0bd5('0x67')]]);if(_0x57dd7c[_0x0bd5('0xa7')]===-0x1){return _0x57dd7c;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x11f'),_0x0bd5('0xf1')));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x120')]=function(_0x3aa0a8){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x121'),_0x3aa0a8['label']));return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x120'));};AGIVertices['prototype'][_0x0bd5('0xc')]=function(_0x1a15f1){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x1a15f1[_0x0bd5('0xaf')]));if(_0x1a15f1[_0x0bd5('0xac')]===0x0){return this['maxRetry'](_0x1a15f1);}_0x1a15f1[_0x0bd5('0xac')]-=0x1;if(!this[_0x0bd5('0xaa')](_0x1a15f1[_0x0bd5('0x122')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1a15f1,_0x0bd5('0x123'));}var _0x5b19d3=this['getSound'][_0x0bd5('0x72')](this,_0x1a15f1['file_id']);if(!_0x5b19d3){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1a15f1,_0x0bd5('0x124'));}if(!this['isConfigured'](_0x1a15f1['variable_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x0bd5('0xe5'));}var _0x4989be=this[_0x0bd5('0xd')][_0x0bd5('0x125')](_0x5b19d3,_0x1a15f1[_0x0bd5('0x126')],_0x1a15f1['maxdigit']);var _0x2add71=_0x4989be[_0x0bd5('0xa7')]?_0x4989be[_0x0bd5('0xa7')][_0x0bd5('0x4e')]():'';logger['info'](_0x0bd5('0x127'),JSON[_0x0bd5('0x75')](_0x4989be));if(_0x4989be['result']===-0x1){this['createSquareDetailsReport'][_0x0bd5('0x72')](this,_0x1a15f1,_0x2add71);return _0x4989be;}else if(_0x4989be['extra']===_0x0bd5('0x68')){_0x4989be[_0x0bd5('0xa7')]=_0x2add71[_0x0bd5('0xa1')]>=parseInt(_0x1a15f1[_0x0bd5('0x128')])?'x':'i';}else{_0x4989be[_0x0bd5('0xa7')]=_0x2add71[_0x0bd5('0xa1')]>=parseInt(_0x1a15f1[_0x0bd5('0x128')])&&_0x2add71[_0x0bd5('0xa1')]<=parseInt(_0x1a15f1[_0x0bd5('0x129')])?'x':'i';}var _0x54738d=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0x1a15f1[_0x0bd5('0xe4')]);if(!_0x54738d){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1a15f1,'no\x20variable\x20found');}this['channel'][_0x0bd5('0xa9')](_0x54738d,_0x2add71);if(this[_0x0bd5('0xaa')](_0x1a15f1[_0x0bd5('0x12a')])){var _0x173e0b=parseInt(_0x1a15f1[_0x0bd5('0x12a')],0xa);var _0xaf06bd=rs[_0x0bd5('0x12b')]({'charset':'*','length':_0x173e0b});var _0x183052=_0x2add71[_0x0bd5('0xa1')];if(_0x183052>0x0){if(_0x183052>_0x173e0b){this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x1a15f1,_0x1a15f1[_0x0bd5('0x12c')]===_0x0bd5('0x12d')?_0xaf06bd+_0x2add71[_0x0bd5('0x12e')](_0x173e0b):_0x2add71[_0x0bd5('0x12e')](0x0,_0x183052-_0x173e0b)+_0xaf06bd);}else{this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x1a15f1,rs['generate']({'charset':'*','length':_0x183052}));}}else{this[_0x0bd5('0x39')]['sync'](this,_0x1a15f1,'');}}else{this[_0x0bd5('0x39')]['sync'](this,_0x1a15f1,_0x2add71);}return _0x4989be;};AGIVertices['prototype'][_0x0bd5('0x12f')]=function(_0x259463){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x259463[_0x0bd5('0xaf')]));return this['getdigits'](_0x259463);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x130')]=function(_0x5e5211){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x131'),_0x5e5211[_0x0bd5('0xaf')]));this[_0x0bd5('0x39')]['sync'](this,_0x5e5211,_0x5e5211['goalname']);return this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('GOAL\x20%s',_0x5e5211['goalname']));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x132')]=function(_0x284191){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x284191[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x284191['aws_access_key_id'])||!this[_0x0bd5('0xaa')](_0x284191[_0x0bd5('0x8a')])){return this['channel'][_0x0bd5('0xb0')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x0bd5('0xaa')](_0x284191['text'])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x133'),_0x284191['text']));var _0x194aca=this[_0x0bd5('0x88')][_0x0bd5('0x72')](this,_0x284191);if(_0x194aca){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x134'),_0x194aca));var _0x4f0c4b=this['channel'][_0x0bd5('0x111')](_0x194aca);try{fs[_0x0bd5('0x135')](_0x194aca+_0x0bd5('0x136'));}catch(_0x5e84a1){logger['error'](_0x5e84a1);}return _0x4f0c4b;}return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x284191,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x137')]=function(_0x4c522d){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x138'),_0x4c522d[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x4c522d['aws_access_key_id'])||!this['isConfigured'](_0x4c522d[_0x0bd5('0x8a')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x0bd5('0xaa')](_0x4c522d[_0x0bd5('0x139')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x13a'));}if(!this['isConfigured'](_0x4c522d[_0x0bd5('0x5d')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this['channel'][_0x0bd5('0xf5')]=!![];this[_0x0bd5('0x39')](_0x4c522d);this[_0x0bd5('0x45')](_0x4c522d[_0x0bd5('0x5d')],'in','','');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('Trying\x20Amazon\x20Lex:\x20%s',_0x4c522d[_0x0bd5('0x5d')]));var _0x309a34=this[_0x0bd5('0x8f')][_0x0bd5('0x72')](this,_0x4c522d);if(_0x309a34){for(var _0x3810ff in _0x309a34){if(_0x309a34[_0x0bd5('0x98')](_0x3810ff)&&_[_0x0bd5('0x99')](_0x309a34[_0x3810ff])){this[_0x0bd5('0xd')]['setVariable'](util[_0x0bd5('0x2a')](_0x0bd5('0x13b'),_0x3810ff[_0x0bd5('0x6c')]()),_0x309a34[_0x3810ff]);}}if(_[_0x0bd5('0x47')](_0x309a34[_0x0bd5('0x77')])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x13c'));}else{this['createSquareMessage'](_0x309a34[_0x0bd5('0x77')],_0x0bd5('0xf9'),_0x0bd5('0x13d'),'');return this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x13e'),_0x309a34[_0x0bd5('0x77')]));}}return this[_0x0bd5('0xd')]['error'](_0x4c522d,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x13f')]=function(_0x25f5c4){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x140'),_0x25f5c4[_0x0bd5('0xaf')],_0x25f5c4[_0x0bd5('0x68')]));if(!this[_0x0bd5('0xaa')](_0x25f5c4[_0x0bd5('0x7b')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xf4'));}var _0xd23950=_0x0bd5('0x141');var _0x2e48f6=util[_0x0bd5('0x2a')](_0x0bd5('0x142'),FILES_PATH,rs[_0x0bd5('0x12b')](0x4));var _0x3ff8e9=util[_0x0bd5('0x2a')](_0x0bd5('0xa0'),_0x2e48f6,_0xd23950);var _0x1b9646=!![];if(_0x25f5c4[_0x0bd5('0x143')]===_0x0bd5('0x144')){_0x1b9646=![];}var _0x1e63e9=this[_0x0bd5('0xd')][_0x0bd5('0x145')](_0x2e48f6,_0xd23950,_0x25f5c4[_0x0bd5('0x146')],_0x25f5c4[_0x0bd5('0x68')],undefined,_0x1b9646);if(_0x1e63e9['result']!==-0x1){this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x147'),_0x3ff8e9));var _0x2c8810=this['googleASR']['sync'](this,_0x25f5c4,_0x3ff8e9);if(_0x2c8810){for(var _0x419a33 in _0x2c8810){if(_0x2c8810['hasOwnProperty'](_0x419a33)){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util['format'](_0x0bd5('0x148'),_0x419a33[_0x0bd5('0x6c')]()),_0x2c8810[_0x419a33]);}}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x149'),JSON[_0x0bd5('0x75')](_0x2c8810)));}}return _0x1e63e9;};AGIVertices['prototype'][_0x0bd5('0x14a')]=function(_0x3c245c){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x3c245c[_0x0bd5('0xaf')]));if(!this['isConfigured'](_0x3c245c[_0x0bd5('0x93')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x14b'));}if(!this[_0x0bd5('0xaa')](_0x3c245c[_0x0bd5('0x94')])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0x14c'));}var _0x48bd5d='wav';var _0x2c810e=util['format'](_0x0bd5('0x142'),FILES_PATH,rs[_0x0bd5('0x12b')](0x4));var _0xa8847=util[_0x0bd5('0x2a')](_0x0bd5('0xa0'),_0x2c810e,_0x48bd5d);var _0x112958=!![];if(_0x3c245c[_0x0bd5('0x143')]==='NOBEEP'){_0x112958=![];}var _0x463f05=this[_0x0bd5('0xd')][_0x0bd5('0x145')](_0x2c810e,_0x48bd5d,_0x3c245c['intKey'],_0x3c245c['timeout'],undefined,_0x112958);if(_0x463f05[_0x0bd5('0xa7')]!==-0x1){this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')]('tilde\x20%s\x20file\x20created',_0xa8847));var _0x376080=this[_0x0bd5('0x92')][_0x0bd5('0x72')](this,_0x3c245c,_0xa8847);if(_0x376080){for(var _0x44b594 in _0x376080){if(_0x376080[_0x0bd5('0x98')](_0x44b594)){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0x14d'),_0x44b594[_0x0bd5('0x6c')]()),_0x376080[_0x44b594]);}}return this['channel']['noop'](util['format'](_0x0bd5('0x14e'),JSON['stringify'](_0x376080)));}}return _0x463f05;};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x14f')]=function(_0x4087bb){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x150'),_0x4087bb[_0x0bd5('0xaf')]));return this[_0x0bd5('0xd')][_0x0bd5('0x151')](_0x4087bb[_0x0bd5('0x3e')],_0x4087bb[_0x0bd5('0x3f')],_0x4087bb[_0x0bd5('0x40')]);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x152')]=function(_0x14f58f){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x14f58f[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x14f58f[_0x0bd5('0x153')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x14f58f,'no\x20condition\x20configured');}try{var _0x44bde8=eval(_0x14f58f[_0x0bd5('0x153')])?_0x0bd5('0x154'):_0x0bd5('0x155');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x156'),_0x14f58f[_0x0bd5('0x153')],_0x44bde8));return{'code':0xc8,'result':_0x44bde8};}catch(_0x4f063e){return{'code':0xc8,'result':_0x0bd5('0x155')};}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x157')]=function(_0x1f6da5){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x1f6da5[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x1f6da5[_0x0bd5('0x158')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1f6da5,_0x0bd5('0x159'));}var _0x3936a2=this['getIntervals']['sync'](this,_0x1f6da5[_0x0bd5('0x158')]);if(!_0x3936a2){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1f6da5,'no\x20intervals\x20found');}for(var _0x2e50ca=0x0;_0x2e50ca<_0x3936a2[_0x0bd5('0xa1')];_0x2e50ca+=0x1){var _0x26c6d7=this[_0x0bd5('0xd')][_0x0bd5('0xa4')](util[_0x0bd5('0x2a')](_0x0bd5('0x15a'),_0x3936a2[_0x2e50ca]));if(_0x26c6d7[_0x0bd5('0xa7')]===-0x1){return _0x26c6d7;}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x15b'),_0x3936a2[_0x2e50ca],_0x26c6d7[_0x0bd5('0xa5')]));if(_0x26c6d7[_0x0bd5('0xa5')]===_0x0bd5('0x154')){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x15b'),_0x3936a2[_0x2e50ca],_0x0bd5('0x154')));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x15b'),_0x3936a2[_0x2e50ca],_0x0bd5('0x154')));return{'code':0xc8,'result':_0x0bd5('0x154')};}else{logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x15b'),_0x3936a2[_0x2e50ca],'false'));this['channel'][_0x0bd5('0xb0')](util['format']('IFTIME\x20%s\x20%s',_0x3936a2[_0x2e50ca],_0x0bd5('0x155')));}}return{'code':0xc8,'result':_0x0bd5('0x155')};};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x15c')]=function(_0x7463ae){logger['info'](util[_0x0bd5('0x2a')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x7463ae[_0x0bd5('0xaf')]));return this['channel'][_0x0bd5('0x15c')]();};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x15d')]=function(_0x592215){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x15e'),_0x592215[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x592215[_0x0bd5('0x7b')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xf4'));}var _0x33f0c0=_0x0bd5('0x141');var _0x6e88fa=util['format'](_0x0bd5('0x142'),FILES_PATH,rs[_0x0bd5('0x12b')](0x4));var _0x4faba1=util['format'](_0x0bd5('0xa0'),_0x6e88fa,_0x33f0c0);var _0x18009d=!![];if(_0x592215[_0x0bd5('0x143')]===_0x0bd5('0x144')){_0x18009d=![];}var _0x597660=this['channel'][_0x0bd5('0x145')](_0x6e88fa,_0x33f0c0,_0x592215[_0x0bd5('0x146')],_0x592215[_0x0bd5('0x68')],undefined,_0x18009d);if(_0x597660['result']!==-0x1){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('ispeech\x20%s\x20file\x20created',_0x4faba1));var _0x43faa5=this[_0x0bd5('0x85')][_0x0bd5('0x72')](this,_0x592215,_0x4faba1);if(_0x43faa5){for(var _0x9605c1 in _0x43faa5){if(_0x43faa5['hasOwnProperty'](_0x9605c1)){this['channel'][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0x15f'),_0x9605c1[_0x0bd5('0x6c')]()),_0x43faa5[_0x9605c1]);}}return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0x160'),JSON['stringify'](_0x43faa5)));}}return _0x597660;};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x161')]=function(_0x277363){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x277363[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x277363[_0x0bd5('0x7b')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xf4'));}if(!this['isConfigured'](_0x277363['text'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x162'),_0x277363['text']));var _0xb64926=this['ispeechTTS'][_0x0bd5('0x72')](this,_0x277363);if(_0xb64926){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x163'),_0xb64926));var _0x3af7b0=this['channel'][_0x0bd5('0x111')](_0xb64926,_0x277363['intKey']);try{fs[_0x0bd5('0x135')](_0xb64926+_0x0bd5('0x136'));}catch(_0x41adb7){logger[_0x0bd5('0x2e')](_0x41adb7);}return _0x3af7b0;}return this['channel'][_0x0bd5('0x2e')](_0x277363,_0x0bd5('0x164'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x165')]=function(_0x357f6c){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x166'),_0x357f6c[_0x0bd5('0xaf')]));if(!this['isConfigured'](_0x357f6c[_0x0bd5('0x167')])){return this[_0x0bd5('0xd')]['error'](_0x357f6c,_0x0bd5('0x168'));}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x169'),this[_0x0bd5('0xd')]['callerid'],_0x357f6c['findBy']));var _0x3017d9=this[_0x0bd5('0x55')]['sync'](this,_0x357f6c[_0x0bd5('0x167')]);if(_0x3017d9){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x16a'),this['channel'][_0x0bd5('0x3a')],_0x357f6c['findBy']));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x16a'),this[_0x0bd5('0xd')]['callerid'],_0x357f6c[_0x0bd5('0x167')]));return{'code':0xc8,'result':'success'};}else{logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x16b'),this[_0x0bd5('0xd')]['callerid'],_0x357f6c[_0x0bd5('0x167')]));this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this['channel']['callerid'],_0x357f6c['findBy']));return{'code':0xc8,'result':_0x0bd5('0x16c')};}};AGIVertices[_0x0bd5('0xf')]['logout']=function(_0x43c805){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x43c805[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x43c805[_0x0bd5('0x167')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x43c805,_0x0bd5('0x168'));}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x169'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x43c805[_0x0bd5('0x167')]));var _0x145e75=this['agentLogout'][_0x0bd5('0x72')](this,_0x43c805['findBy']);if(_0x145e75){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x16a'),this['channel'][_0x0bd5('0x3a')],_0x43c805[_0x0bd5('0x167')]));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x16a'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x43c805[_0x0bd5('0x167')]));return{'code':0xc8,'result':_0x0bd5('0x16d')};}else{logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x43c805['findBy']));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this['channel'][_0x0bd5('0x3a')],_0x43c805['findBy']));return{'code':0xc8,'result':_0x0bd5('0x16c')};}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x16e')]=function(_0x3f907d){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x16f'),_0x3f907d['label']));if(!this[_0x0bd5('0xaa')](_0x3f907d[_0x0bd5('0x170')])){return this['channel'][_0x0bd5('0x2e')](_0x3f907d,'no\x20operation\x20configured');}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x171'),_0x3f907d['operation']));var _0x171751=eval(_0x3f907d[_0x0bd5('0x170')]);if(!this[_0x0bd5('0xaa')](_0x3f907d[_0x0bd5('0xe4')])){return this['channel'][_0x0bd5('0xb0')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1bf149=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0x3f907d[_0x0bd5('0xe4')]);if(!_0x1bf149){return this['channel'][_0x0bd5('0x2e')](_0x3f907d,_0x0bd5('0xe6'));}if(_[_0x0bd5('0x9e')](_0x171751)){var _0x7109de=this;_0x171751[_0x0bd5('0xe7')](function(_0x4213e9,_0x406e53){_0x7109de['channel'][_0x0bd5('0xa9')](util['format'](_0x0bd5('0x172'),_0x1bf149,_0x406e53),_0x4213e9);});return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x173'),_0x1bf149));}else{return this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0x1bf149,_0x171751);}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xb')]=function(_0x536b9f){logger['info'](util['format'](_0x0bd5('0x174'),_0x536b9f[_0x0bd5('0xaf')]));if(_0x536b9f[_0x0bd5('0xac')]===0x0){return this[_0x0bd5('0xab')](_0x536b9f);}_0x536b9f['retry']-=0x1;if(!this[_0x0bd5('0xaa')](_0x536b9f[_0x0bd5('0x122')])){return this['channel'][_0x0bd5('0x2e')](_0x536b9f,_0x0bd5('0x123'));}var _0x2a2059=this[_0x0bd5('0x1e')]['sync'](this,_0x536b9f[_0x0bd5('0x122')]);if(!_0x2a2059){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x536b9f,'no\x20file\x20audio\x20found');}var _0x1f6463=this[_0x0bd5('0xd')]['getData'](_0x2a2059,_0x536b9f[_0x0bd5('0x126')],_0x536b9f['digit']);var _0x3e3704=_0x1f6463[_0x0bd5('0xa7')];if(_0x1f6463[_0x0bd5('0xa7')]===-0x1){this['createSquareDetailsReport'][_0x0bd5('0x72')](this,_0x536b9f,'-1');return _0x1f6463;}else if(_0x1f6463[_0x0bd5('0xa5')]===_0x0bd5('0x68')){_0x1f6463[_0x0bd5('0xa7')]=_0x1f6463['result'][_0x0bd5('0xa1')]>0x0?_0x1f6463[_0x0bd5('0xa7')]:'t';}else if(_[_0x0bd5('0x48')](_0x1f6463[_0x0bd5('0xa7')])){_0x1f6463[_0x0bd5('0xa7')]='#';_0x3e3704='#';}if(!this['isConfigured'](_0x536b9f[_0x0bd5('0xe4')])){this[_0x0bd5('0xd')][_0x0bd5('0xb0')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x4bec93=this['getVariable'][_0x0bd5('0x72')](this,_0x536b9f[_0x0bd5('0xe4')]);if(!_0x4bec93){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x536b9f,_0x0bd5('0xe6'));}this['channel'][_0x0bd5('0xa9')](_0x4bec93,_0x3e3704);}this[_0x0bd5('0x39')]['sync'](this,_0x536b9f,_0x3e3704);return _0x1f6463;};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xb0')]=function(_0x12d23d){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x175'),_0x12d23d['label']));return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x12d23d[_0x0bd5('0x176')]||_0x12d23d['label']);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x177')]=function(_0x4b91aa){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x178'),_0x4b91aa[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x4b91aa['findBy'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x4b91aa,_0x0bd5('0x168'));}logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x169'),this[_0x0bd5('0xd')]['callerid'],_0x4b91aa[_0x0bd5('0x167')]));var _0x2b99b6=this[_0x0bd5('0x4f')]['sync'](this,_0x4b91aa[_0x0bd5('0x179')]);var _0x23e35a=this[_0x0bd5('0x51')][_0x0bd5('0x72')](this,_0x4b91aa[_0x0bd5('0x167')],_0x2b99b6);if(_0x23e35a){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x16a'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x4b91aa[_0x0bd5('0x167')]));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x4b91aa[_0x0bd5('0x167')]));return{'code':0xc8,'result':_0x0bd5('0x16d')};}else{logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this[_0x0bd5('0xd')]['callerid'],_0x4b91aa[_0x0bd5('0x167')]));this['channel'][_0x0bd5('0xb0')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x0bd5('0x3a')],_0x4b91aa['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0bd5('0xf')]['playback']=function(_0x3d96fc){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x3d96fc['label']));if(!this[_0x0bd5('0xaa')](_0x3d96fc['file_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x3d96fc,'no\x20file\x20audio\x20selected');}var _0x4b3285=this[_0x0bd5('0x1e')][_0x0bd5('0x72')](this,_0x3d96fc[_0x0bd5('0x122')]);if(!_0x4b3285){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x3d96fc,_0x0bd5('0x124'));}var _0x1504e5=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0x17a'),[_0x4b3285,_0x3d96fc[_0x0bd5('0x11e')]]);if(_0x1504e5['result']===-0x1){return _0x1504e5;}return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0xce'),'PLAYBACK',_0x4b3285));};AGIVertices['prototype']['queue']=function(_0x465452){logger['info'](util[_0x0bd5('0x2a')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x465452[_0x0bd5('0xaf')]));if(!this['isConfigured'](_0x465452['queue_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x465452,_0x0bd5('0x17b'));}var _0x316e4c='';var _0x4edadd=parseInt(_0x465452[_0x0bd5('0x17c')],0xa);if(isNaN(_0x4edadd)){_0x316e4c=_0x465452[_0x0bd5('0x17c')];}else{_0x316e4c=this[_0x0bd5('0x13')][_0x0bd5('0x72')](this,_0x465452['queue_id']);if(!_0x316e4c){return this[_0x0bd5('0xd')]['error'](_0x465452,'no\x20queue\x20found');}}var _0x4010d7='';if(this[_0x0bd5('0xaa')](_0x465452['file_id'])){var _0x31beee=this[_0x0bd5('0x1e')][_0x0bd5('0x72')](this,_0x465452[_0x0bd5('0x122')]);if(_0x31beee){_0x4010d7=_0x31beee;}}this[_0x0bd5('0x39')]['sync'](this,_0x465452,_0x316e4c);if(_0x465452[_0x0bd5('0x11e')]['indexOf']('x')<0x0){_0x465452['opts']+='x';}if(_0x465452['opts'][_0x0bd5('0x17d')]('X')<0x0){_0x465452[_0x0bd5('0x11e')]+='X';}this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0x0bd5('0x17e'),_0x316e4c?_0x316e4c['toLowerCase']():'');var _0x1a22db=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0x17f'),[_0x316e4c,_0x465452[_0x0bd5('0x11e')],_0x465452[_0x0bd5('0x67')],_0x4010d7,_0x465452[_0x0bd5('0x68')],_0x465452[_0x0bd5('0xbc')],_0x465452[_0x0bd5('0x180')],_0x465452[_0x0bd5('0x181')],'',_0x465452[_0x0bd5('0x182')]]);if(_0x1a22db['result']===-0x1){return _0x1a22db;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xce'),_0x0bd5('0x17f'),_0x316e4c));};AGIVertices[_0x0bd5('0xf')]['record']=function(_0x28d03a){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x183'),_0x28d03a[_0x0bd5('0xaf')]));var _0x4655f1=_0x28d03a[_0x0bd5('0x184')]||_0x0bd5('0x141');var _0x5ba2ec=util[_0x0bd5('0x2a')](_0x0bd5('0x185'),this[_0x0bd5('0xd')][_0x0bd5('0x3c')],rs[_0x0bd5('0x12b')](0x5));var _0x4e77c9=util[_0x0bd5('0x2a')](_0x0bd5('0x186'),FILES_PATH,_0x5ba2ec,_0x4655f1);var _0x38f391=util[_0x0bd5('0x2a')]('%s/recordings/%s',FILES_PATH,_0x5ba2ec);this[_0x0bd5('0x3b')][_0x0bd5('0x72')](this,_0x28d03a,_0x5ba2ec,_0x4e77c9);this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0x0bd5('0x187'),_0x5ba2ec);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x38f391,_0x4655f1,_0x28d03a[_0x0bd5('0x188')],_0x28d03a[_0x0bd5('0x68')]);return this[_0x0bd5('0xd')]['recordFile'](_0x38f391,_0x4655f1,_0x28d03a[_0x0bd5('0x188')],_0x28d03a[_0x0bd5('0x68')],undefined,!![]);};AGIVertices[_0x0bd5('0xf')]['restapi']=function(_0xb556c6){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x189'),_0xb556c6[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0xb556c6['url'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x18a'));}var _0x3c45bf=this[_0x0bd5('0x66')][_0x0bd5('0x72')](this,_0xb556c6);logger['info'](util[_0x0bd5('0x2a')]('Response:',util[_0x0bd5('0x18b')](_0x3c45bf,{'showHidden':![],'depth':null})));if(!this[_0x0bd5('0xaa')](_0xb556c6[_0x0bd5('0xe4')])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x18c'));}var _0x118a01=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0xb556c6[_0x0bd5('0xe4')]);if(!_0x118a01){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0xb556c6,_0x0bd5('0xe6'));}this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util['format'](_0x0bd5('0x18d'),_0x118a01),_0x3c45bf[_0x0bd5('0x18e')]?_0x3c45bf[_0x0bd5('0x18e')]:_0x0bd5('0x18f'));this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util['format'](_0x0bd5('0x190'),_0x118a01),_0x3c45bf[_0x0bd5('0x191')]?_0x3c45bf[_0x0bd5('0x191')]:'OK');if(_0x3c45bf[_0x0bd5('0x6d')]){try{this[_0x0bd5('0x9f')](_0x3c45bf['body'],_0x118a01);}catch(_0x2be7e2){logger[_0x0bd5('0x2e')](util[_0x0bd5('0x2a')](_0x0bd5('0x192'),_0x118a01));}}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0xeb'),_0x118a01));};AGIVertices[_0x0bd5('0xf')]['saydigits']=function(_0x23bfb7){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x193'),_0x23bfb7['label']));return this[_0x0bd5('0xd')][_0x0bd5('0x194')](_0x23bfb7['digits']['replace'](/\s+/g,''),_0x23bfb7[_0x0bd5('0x188')]);};AGIVertices[_0x0bd5('0xf')]['saynumber']=function(_0x497cdf){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x195'),_0x497cdf['label']));return this[_0x0bd5('0xd')]['sayNumber'](_0x497cdf['number'][_0x0bd5('0x5b')](/\s+/g,''),_0x497cdf[_0x0bd5('0x188')]);};AGIVertices[_0x0bd5('0xf')]['sayphonetic']=function(_0x4cbb81){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x196'),_0x4cbb81[_0x0bd5('0xaf')]));return this[_0x0bd5('0xd')]['sayPhonetic'](_0x4cbb81[_0x0bd5('0x5d')],_0x4cbb81[_0x0bd5('0x188')]);};AGIVertices[_0x0bd5('0xf')]['sendMail']=function(_0x1827f9){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x197'),_0x1827f9['label']));if(!this[_0x0bd5('0xaa')](_0x1827f9[_0x0bd5('0x198')])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0x199'));}var _0x14dbae=this[_0x0bd5('0x22')][_0x0bd5('0x72')](this,_0x1827f9[_0x0bd5('0x198')]);if(!_0x14dbae||!_0x14dbae[_0x0bd5('0x19a')]){return this[_0x0bd5('0xd')]['error'](_0x1827f9,_0x0bd5('0x19b'));}var _0x41215a={'from':util[_0x0bd5('0x2a')](_0x0bd5('0x19c'),_0x14dbae['name'],_0x14dbae[_0x0bd5('0x19d')]||_0x14dbae['Smtp']['user']),'to':_0x1827f9['to']||'','cc':_0x1827f9['cc']||'','bcc':_0x1827f9['bcc']||'','subject':_0x1827f9['subject'],'html':_0x1827f9[_0x0bd5('0x5d')],'text':_0x1827f9[_0x0bd5('0x5d')]};if(this[_0x0bd5('0xaa')](_0x1827f9[_0x0bd5('0x19e')])){}logger[_0x0bd5('0xed')](_0x0bd5('0x19f'),JSON[_0x0bd5('0x75')](_0x41215a));this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x1827f9,_0x1827f9[_0x0bd5('0x198')]);this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1a0'),_0x14dbae[_0x0bd5('0x16')]));this['sendMailMessage'][_0x0bd5('0x72')](this,_0x14dbae[_0x0bd5('0x1a1')],_0x41215a);return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0x1a2'));};AGIVertices[_0x0bd5('0xf')]['sendFax']=function(_0x1d1b6f){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x1a3'),_0x1d1b6f[_0x0bd5('0xaf')]));return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1a4'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1a5')]=function(_0x23ce8c){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x23ce8c['label']));if(!this[_0x0bd5('0xaa')](_0x23ce8c['sms_account_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1a6'));}var _0x3f0cd7=this[_0x0bd5('0x36')][_0x0bd5('0x72')](this,_0x23ce8c[_0x0bd5('0x1a7')]);if(!_0x3f0cd7){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x23ce8c,_0x0bd5('0x1a8'));}var _0x42dd38={'body':_0x23ce8c[_0x0bd5('0x1a9')],'phone':_0x23ce8c['to']||'','SmsAccountId':_0x3f0cd7['id']};logger[_0x0bd5('0xed')]('sendSMS\x20message',JSON['stringify'](_0x42dd38));this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x23ce8c,_0x23ce8c[_0x0bd5('0x1a7')]);this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1aa'),_0x3f0cd7['name']));this[_0x0bd5('0x38')][_0x0bd5('0x72')](this,_0x42dd38);return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1ab'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1ac')]=function(_0x15add0){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x15add0[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x15add0[_0x0bd5('0xe4')])){return this[_0x0bd5('0xd')]['error'](_0x15add0,_0x0bd5('0x1ad'));}var _0x536880=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0x15add0[_0x0bd5('0xe4')]);if(!_0x536880){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x15add0,_0x0bd5('0xe6'));}return this['channel'][_0x0bd5('0xa9')](_0x536880,_0x15add0['variable_value']);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1ae')]=function(_0x3a412b){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x1af'),_0x3a412b['label']));this[_0x0bd5('0xd')][_0x0bd5('0xb0')]('START\x20CALLY\x20SQUARE');var _0x41b6df=this['channel'][_0x0bd5('0xa4')]('XMCS-UNIQUEID');if(!_['isEmpty'](_0x41b6df[_0x0bd5('0xa5')])){this[_0x0bd5('0xd')][_0x0bd5('0x3c')]=_0x41b6df[_0x0bd5('0xa5')];}if(_0x3a412b[_0x0bd5('0xc0')]===_0x0bd5('0x1b0')){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1b1'));return this[_0x0bd5('0xd')]['answer']();}return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x1b2'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1b3')]=function(_0x282953){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x1b4'),_0x282953['label']));if(!this[_0x0bd5('0xaa')](_0x282953['project_id'])){return this[_0x0bd5('0xd')]['error'](_0x282953,_0x0bd5('0x1b5'));}var _0x3c24d2=this['getSquareProject'][_0x0bd5('0x72')](this,_0x282953['project_id']);if(!this['isConfigured'](_0x3c24d2)){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x282953,util['format'](_0x0bd5('0x1b6'),_0x282953[_0x0bd5('0x1b7')]));}if(_0x3c24d2===this[_0x0bd5('0xd')]['arg_1']){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x282953,_0x0bd5('0x1b8'));}this['createSquareDetailsReport']['sync'](this,_0x282953,_0x3c24d2);var _0xdb0a02=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0x1b9'),util[_0x0bd5('0x2a')](_0x0bd5('0x1ba'),config[_0x0bd5('0xbc')]['host']||_0x0bd5('0x1bb'),_0x3c24d2,this[_0x0bd5('0xd')][_0x0bd5('0x43')]));if(_0xdb0a02['result']===-0x1){return _0xdb0a02;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('Executed\x20command\x20%s\x20%s',_0x0bd5('0x1b9'),_0x3c24d2));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1bc')]=function(_0x3797c2){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x1bd'),_0x3797c2[_0x0bd5('0xaf')]));var _0x50d6d4=this[_0x0bd5('0x59')]['sync'](this,_0x3797c2['command']);this['createSquareDetailsReport'][_0x0bd5('0x72')](this,_0x3797c2,_0x3797c2[_0x0bd5('0xbe')]);if(this[_0x0bd5('0xaa')](_0x3797c2[_0x0bd5('0xe4')])){var _0xa4bc74=this[_0x0bd5('0xa4')]['sync'](this,_0x3797c2[_0x0bd5('0xe4')]);if(_0xa4bc74){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0xa4bc74,_0x50d6d4);return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1be'),_0x3797c2[_0x0bd5('0xbe')],_0xa4bc74));}}return this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1bf'),_0x3797c2[_0x0bd5('0xbe')]));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1c0')]=function(_0xf92b03){logger['info'](util['format'](_0x0bd5('0x1c1'),_0xf92b03[_0x0bd5('0xaf')]));_0xf92b03[_0x0bd5('0x5d')]=_0xf92b03[_0x0bd5('0x5d')][_0x0bd5('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0bd5('0xaa')](_0xf92b03[_0x0bd5('0x5c')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1c2'));}if(!this[_0x0bd5('0xaa')](_0xf92b03[_0x0bd5('0x5d')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1c3'),_0xf92b03[_0x0bd5('0x5d')]));var _0x452a90=this['googleCloudTTS'][_0x0bd5('0x72')](this,_0xf92b03);if(_0x452a90){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x1c4'),_0x452a90));var _0x3ba9eb=this['channel'][_0x0bd5('0x111')](_0x452a90);try{fs[_0x0bd5('0x135')](_0x452a90+_0x0bd5('0x136'));}catch(_0x2aae79){logger[_0x0bd5('0x2e')](_0x2aae79);}return _0x3ba9eb;}return this[_0x0bd5('0xd')]['error'](_0xf92b03,_0x0bd5('0x1c5'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1c6')]=function(_0x27cdf0){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x1c7'),_0x27cdf0[_0x0bd5('0xaf')]));_0x27cdf0[_0x0bd5('0x5d')]=_0x27cdf0[_0x0bd5('0x5d')][_0x0bd5('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0bd5('0xaa')](_0x27cdf0[_0x0bd5('0x5d')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x1c8'),_0x27cdf0[_0x0bd5('0x5d')]));var _0x3f8b2f=this[_0x0bd5('0x64')]['sync'](this,_0x27cdf0);if(_0x3f8b2f){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1c9'),_0x3f8b2f));var _0x75e291=this['channel'][_0x0bd5('0x111')](_0x3f8b2f);try{fs[_0x0bd5('0x135')](_0x3f8b2f+'.wav');}catch(_0x4c23a4){logger[_0x0bd5('0x2e')](_0x4c23a4);}return _0x75e291;}return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x27cdf0,_0x0bd5('0x1ca'));};AGIVertices['prototype'][_0x0bd5('0x1cb')]=function(_0x1685b4){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x1685b4[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x1685b4[_0x0bd5('0x167')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1685b4,_0x0bd5('0x168'));}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x169'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x1685b4[_0x0bd5('0x167')]));var _0x2e3f18=this[_0x0bd5('0x53')][_0x0bd5('0x72')](this,_0x1685b4[_0x0bd5('0x167')]);if(_0x2e3f18){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x16a'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x1685b4[_0x0bd5('0x167')]));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x16a'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x1685b4[_0x0bd5('0x167')]));return{'code':0xc8,'result':_0x0bd5('0x16d')};}else{logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x0bd5('0x3a')],_0x1685b4[_0x0bd5('0x167')]));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x1685b4['findBy']));return{'code':0xc8,'result':_0x0bd5('0x16c')};}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1cc')]=function(_0x50911a){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x50911a[_0x0bd5('0xaf')]));var _0x2f083b=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0x1cd'),[_0x50911a[_0x0bd5('0x1ce')],_0x50911a[_0x0bd5('0x79')]]);if(_0x2f083b['result']===-0x1){return _0x2f083b;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xce'),_0x0bd5('0x1cd'),_0x50911a[_0x0bd5('0x1ce')]));};AGIVertices[_0x0bd5('0xf')]['vswitch']=function(_0x31e58e){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x1cf'),_0x31e58e[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x31e58e['variable_id'])){return this[_0x0bd5('0xd')]['error'](_0x31e58e,_0x0bd5('0x1ad'));}var _0x49077c=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0x31e58e[_0x0bd5('0xe4')]);if(!_0x49077c){return this[_0x0bd5('0xd')]['error'](_0x31e58e,_0x0bd5('0xe6'));}var _0x161c39=this[_0x0bd5('0xd')][_0x0bd5('0xa4')](_0x49077c);return{'code':0xc8,'result':_0x161c39[_0x0bd5('0xa5')]?_0x161c39[_0x0bd5('0xa5')]:'-'};};String[_0x0bd5('0xf')][_0x0bd5('0xa3')]=function(_0x6d1308,_0x1c8003){return this['split'](_0x6d1308)[_0x0bd5('0x1d0')](_0x1c8003);};module[_0x0bd5('0x1d1')]=AGIVertices; \ No newline at end of file +var _0x4fef=['MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','wait','callback','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Executed\x20command\x20%s\x20%s','lumenvoxtts','no\x20text\x20configured','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','sip_id','no\x20user\x20selected','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','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','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','DIAL','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','maxRetry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goalname','awspolly','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','NOBEEP','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','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','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','streamFile','.wav','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','sendMail\x20message','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','answer','yes','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getSound','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','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','calleridname','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','parse','stringify','statusMessage','statusCode','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','dialogflowV2_language','sestekNDA','ispeechTTS','ispeechASR','ispeech_asr_language','isConfigured','awsPolly','aws_access_key_id','aws_polly_voice','Amy','awsLex','aws_secret_access_key','googleASR','tildeASR','appid','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','result','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT'];(function(_0x1fd3e2,_0x1a6772){var _0x5a9210=function(_0x37e9c3){while(--_0x37e9c3){_0x1fd3e2['push'](_0x1fd3e2['shift']());}};_0x5a9210(++_0x1a6772);}(_0x4fef,0x10f));var _0xf4fe=function(_0x187a4a,_0xca17e3){_0x187a4a=_0x187a4a-0x0;var _0x1ef09b=_0x4fef[_0x187a4a];return _0x1ef09b;};'use strict';var fs=require('fs');var util=require(_0xf4fe('0x0'));var _=require(_0xf4fe('0x1'));var sh=require('shelljs');var odbc=require(_0xf4fe('0x2'))();var rs=require('randomstring');var moment=require(_0xf4fe('0x3'));var Mustache=require(_0xf4fe('0x4'));var rp=require(_0xf4fe('0x5'));var logger=require(_0xf4fe('0x6'))(_0xf4fe('0x7'));var config=require(_0xf4fe('0x8'));var scripts=require(_0xf4fe('0x9'));var FILES_PATH=_0xf4fe('0xa');var recursiveMapAttributes=['rawHeaders',_0xf4fe('0xb')];var verticesWithRetry=[_0xf4fe('0xc'),'getdigits',_0xf4fe('0xd')];var AGIVertices=function(_0x1e858f,_0x37b8e3,_0x2952d7){this[_0xf4fe('0xe')]=_0x1e858f;this[_0xf4fe('0xf')]=_0x37b8e3;this[_0xf4fe('0x10')]=_0x2952d7;};AGIVertices[_0xf4fe('0x11')]['getVariable']=function(_0x2cf2fd,_0x49d480){this[_0xf4fe('0xf')][_0xf4fe('0x12')](_0x2cf2fd)[_0xf4fe('0x13')](function(_0x2f8576){_0x49d480(null,_0x2f8576?_0x2f8576[_0xf4fe('0x14')]:![]);})['catch'](function(_0x1ca9d3){_0x49d480(_0x1ca9d3);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x15')]=function(_0x578a99,_0x158f17){this['rpc'][_0xf4fe('0x16')](_0x578a99)[_0xf4fe('0x13')](function(_0x316685){_0x158f17(null,_0x316685?_0x316685['name']:![]);})[_0xf4fe('0x17')](function(_0x3442f1){_0x158f17(_0x3442f1);});};AGIVertices['prototype'][_0xf4fe('0x18')]=function(_0x362e4d,_0x3493cd){this['rpc']['getSquareProjectById'](_0x362e4d)[_0xf4fe('0x13')](function(_0x225eee){_0x3493cd(null,_0x225eee?_0x225eee['name']:![]);})['catch'](function(_0x24c818){_0x3493cd(_0x24c818);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x19')]=function(_0x4111f7,_0x364aa6){this[_0xf4fe('0xf')][_0xf4fe('0x1a')](_0x4111f7)[_0xf4fe('0x13')](function(_0x2bffcf){_0x364aa6(null,_0x2bffcf?_0x2bffcf[_0xf4fe('0x1b')]:![]);})[_0xf4fe('0x17')](function(_0x3c09d0){_0x364aa6(_0x3c09d0);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x1c')]=function(_0x554eae,_0x3e1d03){this['rpc']['getUserById'](_0x554eae)['then'](function(_0x1aa7d0){_0x3e1d03(null,_0x1aa7d0?_0x1aa7d0['name']:![]);})['catch'](function(_0xd3bfb3){_0x3e1d03(_0xd3bfb3);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x1d')]=function(_0xbea9a,_0x1756f9){this[_0xf4fe('0xf')]['getTrunkById'](_0xbea9a)[_0xf4fe('0x13')](function(_0x5ca51d){_0x1756f9(null,_0x5ca51d?_0x5ca51d[_0xf4fe('0x14')]:![]);})[_0xf4fe('0x17')](function(_0x4141ec){_0x1756f9(_0x4141ec);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x1e')]=function(_0x5790f9,_0x35ae34){var _0x112b80=this;this[_0xf4fe('0xf')]['getSoundById'](_0x5790f9)['then'](function(_0x2c94c9){_0x35ae34(null,_0x2c94c9?_0x112b80['getSoundPath'](_0x2c94c9['save_name']):![]);})[_0xf4fe('0x17')](function(_0xcfc7b5){_0x35ae34(_0xcfc7b5);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x1f')]=function(_0x5e7988,_0x50a6a3){this[_0xf4fe('0xf')][_0xf4fe('0x20')](_0x5e7988)['then'](function(_0x89403c){_0x50a6a3(null,_0x89403c?_0x89403c:![]);})[_0xf4fe('0x17')](function(_0x394785){_0x50a6a3(_0x394785);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x21')]=function(_0x3a0109,_0x16d3f7,_0x638217){this[_0xf4fe('0x10')][_0xf4fe('0x21')](_0x3a0109,_0x16d3f7)[_0xf4fe('0x13')](function(){_0x638217(null);})[_0xf4fe('0x17')](function(_0x4d7535){_0x638217(_0x4d7535);});};AGIVertices['prototype'][_0xf4fe('0x22')]=function(_0x13de6a,_0x527fae){this[_0xf4fe('0xf')][_0xf4fe('0x23')](_0x13de6a)['then'](function(_0x229773){if(_0x229773){if(_0x229773[_0xf4fe('0x24')]){_0x527fae(null,[_0x229773[_0xf4fe('0x25')]]);}else{_0x527fae(null,_[_0xf4fe('0x26')](_0x229773[_0xf4fe('0x27')],_0xf4fe('0x25')));}}else{_0x527fae(null,![]);}})['catch'](function(_0x35d03a){_0x527fae(_0x35d03a);});};AGIVertices[_0xf4fe('0x11')]['getSoundPath']=function(_0x21034d){return util[_0xf4fe('0x28')](_0xf4fe('0x29'),FILES_PATH,_0x21034d);};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x2a')]=function(_0x5cc938,_0x572a19,_0x40d1b3){odbc[_0xf4fe('0x2b')](_0x5cc938,function(_0x50d0e9){if(_0x50d0e9){logger[_0xf4fe('0x2c')](_0xf4fe('0x2d'),_0x50d0e9);_0x40d1b3(_0x50d0e9);}else{logger['info'](_0xf4fe('0x2e'));odbc['query'](_0x572a19,function(_0x5511a8,_0x392729){if(_0x5511a8){logger[_0xf4fe('0x2f')](_0xf4fe('0x30'),_0x572a19);_0x40d1b3(_0x5511a8);}else{logger['info'](_0xf4fe('0x31'),_0x572a19);odbc[_0xf4fe('0x32')](function(_0x29396a){if(_0x29396a){logger[_0xf4fe('0x2c')](_0xf4fe('0x33'),_0x29396a);}_0x40d1b3(null,_0x392729);});}});}});};AGIVertices['prototype'][_0xf4fe('0x34')]=function(_0x4ffacf,_0x5e4c6c){this[_0xf4fe('0xf')][_0xf4fe('0x35')](_0x4ffacf)[_0xf4fe('0x13')](function(_0x13fffe){_0x5e4c6c(null,_0x13fffe?_0x13fffe:![]);})['catch'](function(_0x2679c6){_0x5e4c6c(_0x2679c6);});};AGIVertices[_0xf4fe('0x11')]['createSmsMessage']=function(_0x43a3ba,_0x2bf789){this[_0xf4fe('0xf')][_0xf4fe('0x36')](_0x43a3ba)['then'](function(_0xb25f9e){_0x2bf789(null,_0xb25f9e);})[_0xf4fe('0x17')](function(_0xd8d5e1){_0x2bf789(_0xd8d5e1);});};AGIVertices['prototype'][_0xf4fe('0x37')]=function(_0x25c098,_0x240379,_0x2e49ef){this['rpc'][_0xf4fe('0x37')]({'uniqueid':this[_0xf4fe('0xe')][_0xf4fe('0x38')],'node':_0x25c098[_0xf4fe('0x39')],'application':_0x25c098[_0xf4fe('0x3a')],'data':_0x240379||null,'project_name':this['channel'][_0xf4fe('0x3b')],'callerid':this[_0xf4fe('0xe')][_0xf4fe('0x3c')]})[_0xf4fe('0x13')](function(_0x3e7abc){if(_0x2e49ef){_0x2e49ef(null,_0x3e7abc);}})[_0xf4fe('0x17')](function(_0x5b7823){if(_0x2e49ef){_0x2e49ef(_0x5b7823);}});};AGIVertices[_0xf4fe('0x11')]['createSquareRecording']=function(_0x37579c,_0x4bd0e2,_0x264a1e,_0x468f06){this[_0xf4fe('0xf')]['createSquareRecording']({'uniqueid':this[_0xf4fe('0xe')][_0xf4fe('0x38')],'callerid':this[_0xf4fe('0xe')][_0xf4fe('0x3c')],'calleridname':this['channel'][_0xf4fe('0x3d')],'context':this['channel'][_0xf4fe('0x3e')],'extension':this[_0xf4fe('0xe')][_0xf4fe('0x3f')],'priority':this[_0xf4fe('0xe')][_0xf4fe('0x40')],'accountcode':this['channel'][_0xf4fe('0x41')],'dnid':this['channel'][_0xf4fe('0x42')],'projectName':this[_0xf4fe('0xe')][_0xf4fe('0x3b')],'saveName':_0x4bd0e2,'filename':_0x37579c['file']||_0x4bd0e2,'savePath':_0x264a1e})['then'](function(_0x59dcdf){_0x468f06(null,_0x59dcdf);})[_0xf4fe('0x17')](function(_0x33f85b){_0x468f06(_0x33f85b);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x43')]=function(_0x6cdec6,_0x2d8597,_0x2aeb8e,_0x57acfa,_0x2e491a){this[_0xf4fe('0xf')][_0xf4fe('0x43')]({'uniqueid':this['channel'][_0xf4fe('0x38')],'body':_0x6cdec6,'direction':_0x2d8597,'providerName':_0x2aeb8e,'providerResponse':_0x57acfa})[_0xf4fe('0x13')](function(_0x478edc){if(_0x2e491a){_0x2e491a(null,_0x478edc);}})[_0xf4fe('0x17')](function(_0x17f367){if(_0x2e491a){_0x2e491a(_0x17f367);}});};AGIVertices[_0xf4fe('0x11')]['createCmContact']=function(_0x56d5ad,_0x3afd74){this[_0xf4fe('0xf')][_0xf4fe('0x44')]({'firstName':_[_0xf4fe('0x45')](_0x56d5ad['name'])||_[_0xf4fe('0x46')](_0x56d5ad[_0xf4fe('0x14')])?_0xf4fe('0x47')+Math[_0xf4fe('0x48')]():_0x56d5ad[_0xf4fe('0x14')],'lastName':_[_0xf4fe('0x45')](_0x56d5ad['lastName'])||_[_0xf4fe('0x46')](_0x56d5ad[_0xf4fe('0x49')])?null:_0x56d5ad['lastName'],'phone':_0x56d5ad[_0xf4fe('0x4a')],'ListId':_0x56d5ad[_0xf4fe('0x4b')],'scheduledat':_0x56d5ad[_0xf4fe('0x4c')],'callbackUniqueid':this[_0xf4fe('0xe')]['uniqueid'],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x56d5ad[_0xf4fe('0x4c')][_0xf4fe('0x4d')](),'priority':_0x56d5ad['callback_priority']})[_0xf4fe('0x13')](function(_0x67a86e){_0x3afd74(null,_0x67a86e);})[_0xf4fe('0x17')](function(_0x3747ca){_0x3afd74(_0x3747ca);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x4e')]=function(_0x25c1c1,_0x5d1268){this[_0xf4fe('0xf')][_0xf4fe('0x4f')](_0x25c1c1)['then'](function(_0x385d17){_0x5d1268(null,_0x385d17?_0x385d17['name']:![]);})[_0xf4fe('0x17')](function(_0x492983){_0x5d1268(_0x492983);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x50')]=function(_0x36f2bc,_0x45f666,_0x28e559){var _0x252d77={'role':_0xf4fe('0x51')};_0x252d77[_0x36f2bc]=this[_0xf4fe('0xe')][_0xf4fe('0x3c')];this['rpc']['agentPause'](_0x252d77,_0x45f666,this[_0xf4fe('0xe')][_0xf4fe('0x38')])[_0xf4fe('0x13')](function(_0x525375){_0x28e559(null,_[_0xf4fe('0x46')](_0x525375)?![]:!![]);})[_0xf4fe('0x17')](function(_0x2b7ff1){logger[_0xf4fe('0x2c')](_0x2b7ff1);_0x28e559(null,![]);});};AGIVertices['prototype'][_0xf4fe('0x52')]=function(_0x2386be,_0xea110b){var _0x5e35ba={'role':'agent'};_0x5e35ba[_0x2386be]=this[_0xf4fe('0xe')][_0xf4fe('0x3c')];this[_0xf4fe('0xf')]['agentUnpause'](_0x5e35ba)['then'](function(_0x2b457b){_0xea110b(null,_[_0xf4fe('0x46')](_0x2b457b)?![]:!![]);})[_0xf4fe('0x17')](function(_0x1c7124){logger[_0xf4fe('0x2c')](_0x1c7124);_0xea110b(null,![]);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x53')]=function(_0x2f7a02,_0x4defbd){var _0xedd522={'role':_0xf4fe('0x51')};_0xedd522[_0x2f7a02]=this['channel']['callerid'];this[_0xf4fe('0xf')][_0xf4fe('0x53')](_0xedd522)[_0xf4fe('0x13')](function(_0x3efa3a){_0x4defbd(null,_['isNil'](_0x3efa3a)?![]:!![]);})[_0xf4fe('0x17')](function(_0x499235){logger[_0xf4fe('0x2c')](_0x499235);_0x4defbd(null,![]);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x54')]=function(_0x4b0f3d,_0x511e24){var _0x54148f={'role':_0xf4fe('0x51')};_0x54148f[_0x4b0f3d]=this[_0xf4fe('0xe')][_0xf4fe('0x3c')];var _0x4d770f=_0x4b0f3d!=_0xf4fe('0x55')?util[_0xf4fe('0x28')](_0xf4fe('0x56'),_0xf4fe('0x57'),this[_0xf4fe('0xe')][_0xf4fe('0x3c')]):undefined;this['rpc'][_0xf4fe('0x54')](_0x54148f,_0x4d770f)[_0xf4fe('0x13')](function(_0x4ea291){_0x511e24(null,_['isNil'](_0x4ea291)?![]:!![]);})['catch'](function(_0x48b160){logger[_0xf4fe('0x2c')](_0x48b160);_0x511e24(null,![]);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x58')]=function(_0x377f19,_0x3c1cd0){sh[_0xf4fe('0x59')](_['trim'](_0x377f19),function(_0x13751a,_0x16969d){var _0x1651c1=_0x16969d[_0xf4fe('0x5a')](/(\r\n|\n|\r)/gm,'');_0x3c1cd0(null,_0x1651c1);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x5b')]=function(_0x194573,_0x5230cf){scripts[_0xf4fe('0x5b')](_0x194573['apiKey'],_0x194573[_0xf4fe('0x5c')]||'text',_0x194573[_0xf4fe('0x5d')],_0x194573[_0xf4fe('0x5e')]||_0xf4fe('0x5f'),_0x194573[_0xf4fe('0x60')]||_0xf4fe('0x61'),_0x194573['audioEncoding']||_0xf4fe('0x62'))[_0xf4fe('0x13')](function(_0x560cbb){_0x5230cf(null,_0x560cbb);})[_0xf4fe('0x17')](function(_0x5a9cbd){_0x5230cf(_0x5a9cbd);});};AGIVertices['prototype'][_0xf4fe('0x63')]=function(_0x4580f8,_0x648b14){scripts[_0xf4fe('0x63')](_0x4580f8['text'],_0x4580f8[_0xf4fe('0x64')]||'en',0x1)[_0xf4fe('0x13')](function(_0xf1858e){_0x648b14(null,_0xf1858e);})['catch'](function(_0x3056f5){_0x648b14(_0x3056f5);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x65')]=function(_0x23a22a,_0xb57828){var _0x455c2d={'uri':_0x23a22a[_0xf4fe('0x66')],'method':_0x23a22a[_0xf4fe('0x67')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x23a22a[_0xf4fe('0x68')])===_0xf4fe('0x69')&&parseInt(_0x23a22a[_0xf4fe('0x68')])>=0x1?parseInt(_0x23a22a['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xf4fe('0x6a')]([_0xf4fe('0x6b'),'PUT'],_0x455c2d['method'][_0xf4fe('0x6c')]())){try{_0x455c2d[_0xf4fe('0x6d')]=_0x23a22a[_0xf4fe('0xb')]?JSON['parse'](_0x23a22a[_0xf4fe('0xb')]):{};}catch(_0x511a06){logger[_0xf4fe('0x2c')](_0xf4fe('0x6e'),_0x511a06);}}try{_0x455c2d['headers']=_0x23a22a[_0xf4fe('0x6f')]?JSON['parse'](_0x23a22a['rawHeaders']):{};}catch(_0x154282){logger['error'](_0xf4fe('0x70'),_0x154282);}if(_0x23a22a['computedVariables']){try{var _0x467b11=require(_0x23a22a[_0xf4fe('0x71')])[_0xf4fe('0x72')](this,_0x455c2d);_0x455c2d[_0xf4fe('0x73')]=Mustache[_0xf4fe('0x74')](_0x23a22a[_0xf4fe('0x66')],_0x467b11,{},['$$','$$']);if(_0x455c2d[_0xf4fe('0x75')]){_0x455c2d[_0xf4fe('0x75')]=JSON['parse'](Mustache[_0xf4fe('0x74')](JSON['stringify'](_0x455c2d[_0xf4fe('0x75')]),_0x467b11,{},['$$','$$']));}if(_0x455c2d['body']){_0x455c2d[_0xf4fe('0x6d')]=JSON[_0xf4fe('0x76')](Mustache[_0xf4fe('0x74')](JSON[_0xf4fe('0x77')](_0x455c2d['body']),_0x467b11,{},['$$','$$']));}}catch(_0x11ff8d){logger[_0xf4fe('0x2c')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x11ff8d);}}rp(_0x455c2d)[_0xf4fe('0x13')](function(_0x1eecf2){var _0x181e51={'statusCode':_0x1eecf2['statusCode']||0xc8,'statusMessage':_0x1eecf2[_0xf4fe('0x78')]||'OK','headers':_0x1eecf2['headers']||{},'body':_0x1eecf2[_0xf4fe('0x6d')]||{}};_0xb57828(null,_0x181e51);})[_0xf4fe('0x17')](function(_0x3dcf0b){var _0x110058={'statusCode':_0x3dcf0b[_0xf4fe('0x79')]||0x1f4,'statusMessage':_0x3dcf0b[_0xf4fe('0x7a')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x3dcf0b[_0xf4fe('0x7b')][_0xf4fe('0x75')]||{},'body':_0x3dcf0b['options'][_0xf4fe('0x6d')]||{}};_0xb57828(null,_0x110058);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x7c')]=function(_0x39cc6e,_0x154079){scripts['googleDialogflow'](this[_0xf4fe('0xe')][_0xf4fe('0x38')],_0x39cc6e[_0xf4fe('0x7d')],_0x39cc6e[_0xf4fe('0x5d')],_0x39cc6e[_0xf4fe('0x7e')]||'en')[_0xf4fe('0x13')](function(_0x307b03){_0x154079(null,_0x307b03);})[_0xf4fe('0x17')](function(_0x35440f){_0x154079(_0x35440f);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x7f')]=function(_0x5955dd,_0x238d90){scripts[_0xf4fe('0x7f')](this[_0xf4fe('0xe')][_0xf4fe('0x38')],_0x5955dd[_0xf4fe('0x80')],_0x5955dd['client_email'],_0x5955dd['private_key'],_0x5955dd['text'],_0x5955dd[_0xf4fe('0x81')]||'en')[_0xf4fe('0x13')](function(_0x201c81){_0x238d90(null,_0x201c81);})[_0xf4fe('0x17')](function(_0x1f0e49){_0x238d90(_0x1f0e49);});};AGIVertices[_0xf4fe('0x11')]['sestekNDA']=function(_0x1febc1,_0x5b449a){scripts[_0xf4fe('0x82')](this[_0xf4fe('0xe')],_0x1febc1)[_0xf4fe('0x13')](function(_0x1c4cd6){_0x5b449a(null,_0x1c4cd6);})[_0xf4fe('0x17')](function(_0x295c8d){_0x5b449a(_0x295c8d);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x83')]=function(_0xaaec4,_0x9e3b84){scripts[_0xf4fe('0x83')](_0xaaec4[_0xf4fe('0x7d')],_0xaaec4[_0xf4fe('0x5d')],_0xaaec4['ispeech_tts_language']||'en-US',_0xaaec4['speed'])['then'](function(_0x291682){_0x9e3b84(null,_0x291682);})['catch'](function(_0x1a93a0){_0x9e3b84(_0x1a93a0);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x84')]=function(_0x87c11c,_0x122b5f,_0x5485e1){scripts[_0xf4fe('0x84')](_0x122b5f,_0x87c11c['key'],_0x87c11c[_0xf4fe('0x85')]||_0xf4fe('0x5f'),this[_0xf4fe('0x86')](_0x87c11c['model'])?_0x87c11c['model']:undefined)[_0xf4fe('0x13')](function(_0x39681d){_0x5485e1(null,_0x39681d);})[_0xf4fe('0x17')](function(_0x57d80b){_0x5485e1(_0x57d80b);});};AGIVertices['prototype'][_0xf4fe('0x87')]=function(_0x2454b5,_0x5e342a){scripts[_0xf4fe('0x87')](_0x2454b5[_0xf4fe('0x88')],_0x2454b5['aws_secret_access_key'],_0x2454b5['aws_polly_region'],_0x2454b5[_0xf4fe('0x89')]||_0xf4fe('0x8a'),_0x2454b5[_0xf4fe('0x5d')],_0x2454b5['aws_text_type']||'text')[_0xf4fe('0x13')](function(_0x1ea9c8){_0x5e342a(null,_0x1ea9c8);})[_0xf4fe('0x17')](function(_0x1a2a1b){_0x5e342a(_0x1a2a1b);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x8b')]=function(_0x44f33f,_0x12a27d){scripts['awsLex'](this[_0xf4fe('0xe')][_0xf4fe('0x38')],_0x44f33f[_0xf4fe('0x88')],_0x44f33f[_0xf4fe('0x8c')],_0x44f33f['aws_lex_region'],_0x44f33f['text'],_0x44f33f['aws_bot_name'])[_0xf4fe('0x13')](function(_0x40789d){_0x12a27d(null,_0x40789d);})['catch'](function(_0x4d1637){_0x12a27d(_0x4d1637);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x8d')]=function(_0x4a40cb,_0x3ae89b,_0xf1ca46){scripts['googleASR'](_0x3ae89b,_0x4a40cb[_0xf4fe('0x7d')],_0x4a40cb['google_asr_language']||'en-US')[_0xf4fe('0x13')](function(_0x4e34e7){_0xf1ca46(null,_0x4e34e7);})['catch'](function(_0x54da75){_0xf1ca46(_0x54da75);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x8e')]=function(_0x36dbfa,_0x26f6bf,_0x4edc69){scripts[_0xf4fe('0x8e')](_0x26f6bf,_0x36dbfa[_0xf4fe('0x8f')],_0x36dbfa['appsecret'],_0x36dbfa[_0xf4fe('0x73')])[_0xf4fe('0x13')](function(_0x54947c){_0x4edc69(null,_0x54947c);})[_0xf4fe('0x17')](function(_0x682dbc){_0x4edc69(_0x682dbc);});};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x90')]=function(_0x13ae81){var _0x28f0a1=_[_0xf4fe('0x6a')](verticesWithRetry,_0x13ae81[_0xf4fe('0x3a')])?_0x13ae81:_['clone'](_0x13ae81);for(var _0x3da659 in _0x28f0a1){if(_0x28f0a1[_0xf4fe('0x91')](_0x3da659)){if(_0x28f0a1[_0x3da659]&&_[_0xf4fe('0x92')](_0x28f0a1[_0x3da659])){if(_[_0xf4fe('0x6a')](recursiveMapAttributes,_0x3da659)){_0x28f0a1[_0x3da659]=this[_0xf4fe('0x93')](_0x28f0a1[_0x3da659]);}else{_0x28f0a1[_0x3da659]=this[_0xf4fe('0x94')](_0x28f0a1[_0x3da659]);}}}}return _0x28f0a1;};AGIVertices['prototype'][_0xf4fe('0x95')]=function(_0x318c62){for(var _0x69fb70 in _0x318c62){if(_0x318c62['hasOwnProperty'](_0x69fb70)){if(_['isPlainObject'](_0x318c62[_0x69fb70])){this[_0xf4fe('0x95')](_0x318c62[_0x69fb70]);}else if(_[_0xf4fe('0x96')](_0x318c62[_0x69fb70])){for(var _0x505dde=0x0;_0x505dde<_0x318c62[_0x69fb70][_0xf4fe('0x97')];_0x505dde++){this[_0xf4fe('0x95')](_0x318c62[_0x69fb70][_0x505dde]);}}else if(_['isString'](_0x318c62[_0x69fb70])){_0x318c62[_0x69fb70]=this[_0xf4fe('0x94')](_0x318c62[_0x69fb70]);}}}};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x98')]=function(_0x57fe8d,_0x5c5c10){for(var _0x8c52d3 in _0x57fe8d){if(_0x57fe8d['hasOwnProperty'](_0x8c52d3)){if(_[_0xf4fe('0x99')](_0x57fe8d[_0x8c52d3])){if(!_[_0xf4fe('0x45')](_0x57fe8d[_0x8c52d3])){this[_0xf4fe('0x98')](_0x57fe8d[_0x8c52d3],util['format'](_0xf4fe('0x9a'),_0x5c5c10,_0x8c52d3));}}else if(_[_0xf4fe('0x96')](_0x57fe8d[_0x8c52d3])){for(var _0x4923d7=0x0;_0x4923d7<_0x57fe8d[_0x8c52d3]['length'];_0x4923d7++){this['saveRestApiResult'](_0x57fe8d[_0x8c52d3][_0x4923d7],util[_0xf4fe('0x28')](_0xf4fe('0x9a'),_0x5c5c10,_0x8c52d3+'['+_0x4923d7+']'));}}else{if(!_[_0xf4fe('0x46')](_0x57fe8d[_0x8c52d3])){this['channel'][_0xf4fe('0x9b')](util[_0xf4fe('0x28')](_0xf4fe('0x9a'),_0x5c5c10,_0x8c52d3),_0x57fe8d[_0x8c52d3]);}}}}};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x93')]=function(_0x2045b1){try{var _0x58faf8=JSON[_0xf4fe('0x76')](_0x2045b1);this['recursiveNodeIndex'](_0x58faf8);return JSON[_0xf4fe('0x77')](_0x58faf8);}catch(_0xaa0a71){return this['replaceAllVariables'](_0x2045b1);}};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x94')]=function(_0x577c75){var _0x415daa=_0x577c75[_0xf4fe('0x9c')]('{');for(var _0x29f278=0x1;_0x29f278<_0x415daa[_0xf4fe('0x97')];_0x29f278+=0x1){var _0xa3b113=_0x415daa[_0x29f278][_0xf4fe('0x9c')]('}');if(_0xa3b113[_0xf4fe('0x97')]>0x1){_0x577c75=_0x577c75[_0xf4fe('0x9d')]('{'+_0xa3b113[0x0]+'}',this['channel'][_0xf4fe('0x9e')](_0xa3b113[0x0])[_0xf4fe('0x9f')]||_0xa3b113[0x0]);}}if(_0x415daa['length']===0x1){return _0x577c75[_0xf4fe('0x4d')]();}return this[_0xf4fe('0x94')](_0x577c75);};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0xa0')]=function(_0x40341e,_0x31c4aa){var _0x16dd29=this[_0xf4fe('0xe')][_0xf4fe('0x9e')](_0x40341e);if(_0x16dd29[_0xf4fe('0xa1')]===-0x1){return _0x16dd29;}logger[_0xf4fe('0x2f')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x31c4aa,_0x16dd29[_0xf4fe('0x9f')]));return this[_0xf4fe('0xe')][_0xf4fe('0x9b')](_0x31c4aa,_0x16dd29[_0xf4fe('0x9f')]);};AGIVertices['prototype'][_0xf4fe('0x86')]=function(_0x26e5b1){return _0x26e5b1&&_0x26e5b1!=='0'&&_0x26e5b1!=='-1'&&_0x26e5b1!=='';};AGIVertices[_0xf4fe('0x11')]['maxRetry']=function(_0x513d90){this[_0xf4fe('0x37')][_0xf4fe('0x72')](this,_0x513d90,'-');_0x513d90[_0xf4fe('0xa2')]=_0x513d90['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0xa3')]=function(_0x321ebd){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0xa4'),_0x321ebd[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x321ebd['text'])){return this[_0xf4fe('0xe')]['noop']('no\x20text\x20configured');}var _0x1521e5='\x22'+_0x321ebd['text']+'\x22';if(this[_0xf4fe('0x86')](_0x321ebd[_0xf4fe('0x7b')])){_0x1521e5+=','+_0x321ebd[_0xf4fe('0x7b')];}var _0x5ce0d0=this[_0xf4fe('0xe')][_0xf4fe('0x59')](_0xf4fe('0xa5'),_0x1521e5);if(_0x5ce0d0[_0xf4fe('0xa1')]===-0x1){return _0x5ce0d0;}return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util['format'](_0xf4fe('0xa7'),_0x1521e5));};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0xa8')]=function(_0x331243){logger['info'](util[_0xf4fe('0x28')](_0xf4fe('0xa9'),_0x331243[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x331243[_0xf4fe('0xaa')])){return this[_0xf4fe('0xe')]['noop'](_0xf4fe('0xab'));}var _0xb51840=_0x331243[_0xf4fe('0xaa')];if(this[_0xf4fe('0x86')](_0x331243[_0xf4fe('0x7b')])){_0xb51840+=','+_0x331243['options'];}var _0x38d73a=this[_0xf4fe('0xe')][_0xf4fe('0x59')](_0xf4fe('0xac'),_0xb51840);if(_0x38d73a['result']===-0x1){return _0x38d73a;}var _0x14b228=this[_0xf4fe('0xa0')]('RECOG_CONFIDENCE()',_0xf4fe('0xad'));if(_0x14b228[_0xf4fe('0xa1')]===-0x1){return _0x14b228;}var _0x4c1297=this[_0xf4fe('0xa0')]('RECOG_INPUT()',_0xf4fe('0xae'));if(_0x4c1297[_0xf4fe('0xa1')]===-0x1){return _0x4c1297;}var _0x721b33=this[_0xf4fe('0xa0')]('RECOG_INSTANCE()',_0xf4fe('0xaf'));if(_0x721b33[_0xf4fe('0xa1')]===-0x1){return _0x721b33;}return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0xb51840));};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x7')]=function(_0x476a6f){logger[_0xf4fe('0x2f')](util['format'](_0xf4fe('0xb0'),_0x476a6f['label']));return this[_0xf4fe('0xe')][_0xf4fe('0x7')]([_0x476a6f[_0xf4fe('0xb1')],_0x476a6f[_0xf4fe('0xb2')]]);};AGIVertices[_0xf4fe('0x11')]['answer']=function(_0xc5586e){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0xc5586e[_0xf4fe('0x39')]));if(this[_0xf4fe('0x86')](_0xc5586e[_0xf4fe('0x68')])){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')]('Wait\x20%s\x20seconds\x20before\x20answer',_0xc5586e['timeout']));var _0x2e78c0=this['channel'][_0xf4fe('0xb3')](_0xc5586e[_0xf4fe('0x68')]);if(_0x2e78c0[_0xf4fe('0xa1')]===-0x1){return _0x2e78c0;}}return this['channel']['answer']();};AGIVertices['prototype'][_0xf4fe('0xb4')]=function(_0x5b18fa){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5b18fa[_0xf4fe('0x39')]));if(!this['isConfigured'](_0x5b18fa[_0xf4fe('0x4b')])){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x5b18fa,'no\x20list\x20selected');}_0x5b18fa[_0xf4fe('0x4c')]=moment();if(this[_0xf4fe('0x86')](_0x5b18fa['delay'])){_0x5b18fa[_0xf4fe('0x4c')]=moment()['add'](_0x5b18fa[_0xf4fe('0xb5')],_0xf4fe('0xb6'));}if(!this['isConfigured'](_0x5b18fa['callback_priority'])){_0x5b18fa[_0xf4fe('0xb7')]=0x2;}this[_0xf4fe('0x44')][_0xf4fe('0x72')](this,_0x5b18fa);return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0xb8'),_0x5b18fa[_0xf4fe('0x4a')],_0x5b18fa[_0xf4fe('0x4b')],_0x5b18fa['scheduledAt']));};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0xb9')]=function(_0x3f89f2){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x3f89f2[_0xf4fe('0x39')]));var _0x36f0da=this[_0xf4fe('0xe')][_0xf4fe('0x59')](_0x3f89f2['application'],_0x3f89f2['options']);if(_0x36f0da[_0xf4fe('0xa1')]===-0x1){return _0x36f0da;}return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0xba'),_0x3f89f2['application'],_0x3f89f2[_0xf4fe('0x7b')]));};AGIVertices['prototype'][_0xf4fe('0xbb')]=function(_0x2466d7){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x2466d7[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x2466d7[_0xf4fe('0x5d')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xbc'));}var _0xe5ba9c='\x22'+_0x2466d7[_0xf4fe('0x5d')]+'\x22';if(this[_0xf4fe('0x86')](_0x2466d7['options'])){_0xe5ba9c+=','+_0x2466d7[_0xf4fe('0x7b')];}var _0x5351b0=this[_0xf4fe('0xe')][_0xf4fe('0x59')]('MRCPSynth',_0xe5ba9c);if(_0x5351b0[_0xf4fe('0xa1')]===-0x1){return _0x5351b0;}return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util['format'](_0xf4fe('0xa7'),_0xe5ba9c));};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0xbd')]=function(_0x4df0d5){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x4df0d5[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x4df0d5[_0xf4fe('0x5d')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xbc'));}var _0x433287='\x22'+_0x4df0d5['text']+'\x22';if(this[_0xf4fe('0x86')](_0x4df0d5[_0xf4fe('0x7b')])){_0x433287+=','+_0x4df0d5[_0xf4fe('0x7b')];}var _0x15da22=this['channel'][_0xf4fe('0x59')](_0xf4fe('0xa5'),_0x433287);if(_0x15da22['result']===-0x1){return _0x15da22;}return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0xa7'),_0x433287));};AGIVertices['prototype'][_0xf4fe('0xbe')]=function(_0x2b9976){logger[_0xf4fe('0x2f')](util['format'](_0xf4fe('0xbf'),_0x2b9976['label']));if(!this[_0xf4fe('0x86')](_0x2b9976[_0xf4fe('0xaa')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xab'));}var _0x5a48cb=_0x2b9976[_0xf4fe('0xaa')];if(this[_0xf4fe('0x86')](_0x2b9976[_0xf4fe('0x7b')])){_0x5a48cb+=','+_0x2b9976[_0xf4fe('0x7b')];}var _0x4effc5=this[_0xf4fe('0xe')][_0xf4fe('0x59')]('MRCPRecog',_0x5a48cb);if(_0x4effc5[_0xf4fe('0xa1')]===-0x1){return _0x4effc5;}var _0x4fa064=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xf4fe('0xc0'));if(_0x4fa064['result']===-0x1){return _0x4fa064;}var _0x26d8e6=this[_0xf4fe('0xa0')]('RECOG_INPUT()',_0xf4fe('0xc1'));if(_0x26d8e6['result']===-0x1){return _0x26d8e6;}var _0x3d53d8=this[_0xf4fe('0xa0')]('RECOG_INSTANCE()',_0xf4fe('0xc2'));if(_0x3d53d8[_0xf4fe('0xa1')]===-0x1){return _0x3d53d8;}return this['channel'][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0xc3'),_0x5a48cb));};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0xc4')]=function(_0x1aaa0f){logger['info'](util[_0xf4fe('0x28')](_0xf4fe('0xc5'),_0x1aaa0f[_0xf4fe('0x39')]));if(!this['isConfigured'](_0x1aaa0f[_0xf4fe('0xaa')])){return this['channel'][_0xf4fe('0xa6')]('no\x20grammar\x20configured');}var _0x306042=_0x1aaa0f[_0xf4fe('0xaa')];if(this['isConfigured'](_0x1aaa0f[_0xf4fe('0x7b')])){_0x306042+=','+_0x1aaa0f[_0xf4fe('0x7b')];}var _0x39b29b=this[_0xf4fe('0xe')][_0xf4fe('0x59')]('MRCPRecog',_0x306042);if(_0x39b29b[_0xf4fe('0xa1')]===-0x1){return _0x39b29b;}var _0xa217b8=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xf4fe('0xc6'));if(_0xa217b8[_0xf4fe('0xa1')]===-0x1){return _0xa217b8;}var _0x312176=this[_0xf4fe('0xa0')](_0xf4fe('0xc7'),'SESTEK_ASR_TRANSCRIPT');if(_0x312176['result']===-0x1){return _0x312176;}var _0xc9c255=this[_0xf4fe('0xa0')]('RECOG_INSTANCE()',_0xf4fe('0xc8'));if(_0xc9c255['result']===-0x1){return _0xc9c255;}return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0xc3'),_0x306042));};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0xc9')]=function(_0x46c55e){logger[_0xf4fe('0x2f')](util['format'](_0xf4fe('0xca'),_0x46c55e[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x46c55e[_0xf4fe('0xcb')])){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x46c55e,'no\x20database\x20selected');}var _0x2dbe2e=this[_0xf4fe('0x19')][_0xf4fe('0x72')](this,_0x46c55e[_0xf4fe('0xcb')]);if(!_0x2dbe2e){return this['channel'][_0xf4fe('0x2c')](_0x46c55e,_0xf4fe('0xcc'));}if(!this[_0xf4fe('0x86')](_0x46c55e['query'])){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x46c55e,_0xf4fe('0xcd'));}var _0x4bcc1b=_0x46c55e['query'][_0xf4fe('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0xf4fe('0x28')](_0xf4fe('0xce'),_0x4bcc1b));var _0x241d56=this['getQueryOdbc'][_0xf4fe('0x72')](this,_0x2dbe2e,_0x4bcc1b);this[_0xf4fe('0x37')]['sync'](this,_0x46c55e,_0x4bcc1b);if(!this['isConfigured'](_0x46c55e[_0xf4fe('0xcf')])){return this[_0xf4fe('0xe')]['noop'](_0xf4fe('0xd0'));}var _0x5b6b20=this['getVariable'][_0xf4fe('0x72')](this,_0x46c55e['variable_id']);if(!_0x5b6b20){return this['channel'][_0xf4fe('0x2c')](_0x46c55e,_0xf4fe('0xd1'));}var _0x5a7f15=this;_0x241d56[_0xf4fe('0xd2')](function(_0x9fd6f3,_0x44981e){Object[_0xf4fe('0xd3')](_0x9fd6f3)[_0xf4fe('0xd2')](function(_0x39e7c7){_0x5a7f15[_0xf4fe('0xe')][_0xf4fe('0x9b')](util[_0xf4fe('0x28')](_0xf4fe('0xd4'),_0x5b6b20,_0x44981e,_0x39e7c7),_0x9fd6f3[_0x39e7c7]);});});this[_0xf4fe('0xe')][_0xf4fe('0x9b')](util[_0xf4fe('0x28')](_0xf4fe('0xd5'),_0x5b6b20),_0x241d56[_0xf4fe('0x97')]);return this['channel'][_0xf4fe('0xa6')](util['format'](_0xf4fe('0xd6'),_0x5b6b20));};AGIVertices[_0xf4fe('0x11')]['dial']=function(_0x5eb9d6){logger[_0xf4fe('0xd7')](util[_0xf4fe('0x28')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x5eb9d6[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x5eb9d6[_0xf4fe('0xd8')])){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x5eb9d6,_0xf4fe('0xd9'));}var _0x2a5c6b=this[_0xf4fe('0x1c')][_0xf4fe('0x72')](this,_0x5eb9d6['sip_id']);if(!_0x2a5c6b){return this[_0xf4fe('0xe')]['error'](_0x5eb9d6,'no\x20user\x20found');}var _0xf23aa2=this[_0xf4fe('0xe')][_0xf4fe('0x59')]('DIAL',[util[_0xf4fe('0x28')]('SIP/%s',_0x2a5c6b),_0x5eb9d6['timeout'],_0x5eb9d6[_0xf4fe('0xda')],_0x5eb9d6[_0xf4fe('0x66')]]);if(_0xf23aa2['result']===-0x1){return _0xf23aa2;}return this['channel'][_0xf4fe('0xa6')](util['format'](_0xf4fe('0xdb'),'DIAL'));};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0xdc')]=function(_0x4180bb){logger['info'](util[_0xf4fe('0x28')](_0xf4fe('0xdd'),_0x4180bb[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x4180bb[_0xf4fe('0x7d')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xde'));}if(!this[_0xf4fe('0x86')](_0x4180bb[_0xf4fe('0x5d')])){return this['channel'][_0xf4fe('0xa6')]('no\x20text\x20configured');}this[_0xf4fe('0xe')][_0xf4fe('0xdf')]=!![];this[_0xf4fe('0x37')](_0x4180bb);this[_0xf4fe('0x43')](_0x4180bb['text'],'in','','');this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0xe0'),_0x4180bb[_0xf4fe('0x5d')]));var _0x23a334=this[_0xf4fe('0x7c')][_0xf4fe('0x72')](this,_0x4180bb);if(_0x23a334){for(var _0x4bf37a in _0x23a334){if(_0x23a334[_0xf4fe('0x91')](_0x4bf37a)){this[_0xf4fe('0xe')]['setVariable'](util[_0xf4fe('0x28')](_0xf4fe('0xe1'),_0x4bf37a[_0xf4fe('0x6c')]()),_0x23a334[_0x4bf37a]);}}this[_0xf4fe('0x43')](_0x23a334[_0xf4fe('0xe2')],_0xf4fe('0xe3'),_0xf4fe('0xdc'),'');return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0xe4'),_0x23a334[_0xf4fe('0xe2')]));}return this[_0xf4fe('0xe')]['error'](_0x4180bb,_0xf4fe('0xe5'));};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0xe6')]=function(_0x116421){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0xe7'),_0x116421[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x116421[_0xf4fe('0x80')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xe8'));}if(!this[_0xf4fe('0x86')](_0x116421[_0xf4fe('0xe9')])){return this['channel'][_0xf4fe('0xa6')](_0xf4fe('0xea'));}if(!this[_0xf4fe('0x86')](_0x116421[_0xf4fe('0xeb')])){return this[_0xf4fe('0xe')]['noop'](_0xf4fe('0xec'));}if(!this[_0xf4fe('0x86')](_0x116421[_0xf4fe('0x81')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xed'));}if(!this[_0xf4fe('0x86')](_0x116421['text'])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xbc'));}this[_0xf4fe('0xe')][_0xf4fe('0xdf')]=!![];this[_0xf4fe('0x37')](_0x116421);this[_0xf4fe('0x43')](_0x116421[_0xf4fe('0x5d')],'in','','');this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0xee'),_0x116421[_0xf4fe('0x5d')]));var _0x28a948=this['googleDialogflowV2'][_0xf4fe('0x72')](this,_0x116421);if(_0x28a948){for(var _0x19f60e in _0x28a948){if(_0x28a948[_0xf4fe('0x91')](_0x19f60e)){if(_0x19f60e!==_0xf4fe('0xef')){this[_0xf4fe('0xe')]['setVariable'](util['format']('DIALOGFLOW_%s',_0x19f60e['toUpperCase']()),_0x28a948[_0x19f60e]);}}}this[_0xf4fe('0x43')](_0x28a948[_0xf4fe('0xe2')],_0xf4fe('0xe3'),'dialogflowV2',_0x28a948['providerResponse']);return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')]('DialogflowV2\x20Result\x20%s',_0x28a948[_0xf4fe('0xe2')]));}return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x116421,_0xf4fe('0xf0'));};AGIVertices['prototype'][_0xf4fe('0xf1')]=function(_0x4c72b0){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0xf2'),_0x4c72b0[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x4c72b0[_0xf4fe('0xf3')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xf4'));}if(!this[_0xf4fe('0x86')](_0x4c72b0[_0xf4fe('0xf5')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xf6'));}if(!this['isConfigured'](_0x4c72b0[_0xf4fe('0xf7')])){return this['channel']['noop']('no\x20password\x20configured');}if(!this[_0xf4fe('0x86')](_0x4c72b0['ndassistant_url'])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xbc'));}this[_0xf4fe('0xe')]['bot']=!![];this[_0xf4fe('0x37')](_0x4c72b0);this['createSquareMessage'](_0x4c72b0[_0xf4fe('0x5d')],'in','','');this[_0xf4fe('0xe')]['noop'](util[_0xf4fe('0x28')](_0xf4fe('0xf8'),_0x4c72b0[_0xf4fe('0x5d')]));var _0x3c139a=this[_0xf4fe('0x82')]['sync'](this,_0x4c72b0);if(_0x3c139a){for(var _0x3702ca in _0x3c139a){if(_0x3c139a['hasOwnProperty'](_0x3702ca)){this[_0xf4fe('0xe')][_0xf4fe('0x9b')](util[_0xf4fe('0x28')](_0xf4fe('0xf9'),_0x3702ca[_0xf4fe('0x6c')]()),_0x3c139a[_0x3702ca]);}}this[_0xf4fe('0x43')](_0x3c139a['speech'],_0xf4fe('0xe3'),'sesteknda','');if(_0x3c139a['audiofile']){this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0xfa'),_0x3c139a['audiofile']));var _0x1869a8=this[_0xf4fe('0xe')]['streamFile'](_0x3c139a[_0xf4fe('0xfb')]);try{fs['unlink'](_0x3c139a[_0xf4fe('0xfb')]+'.wav');}catch(_0x87f059){logger[_0xf4fe('0x2c')](_0x87f059);}return _0x1869a8;}else{return this[_0xf4fe('0xe')]['noop'](util['format'](_0xf4fe('0xfc'),_0x3c139a[_0xf4fe('0xe2')]));}}return this['channel'][_0xf4fe('0x2c')](_0x4c72b0,_0xf4fe('0xfd'));};AGIVertices[_0xf4fe('0x11')]['end']=function(_0x59c53d){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0xfe'),_0x59c53d[_0xf4fe('0x39')]));return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xff'));};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x100')]=function(_0x6fb0ee){logger[_0xf4fe('0x2f')](util['format'](_0xf4fe('0x101'),_0x6fb0ee[_0xf4fe('0x39')]));var _0x2c7587='';if(_0x6fb0ee[_0xf4fe('0x102')]){if(!this['isConfigured'](_0x6fb0ee[_0xf4fe('0x102')])){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x6fb0ee,_0xf4fe('0x103'));}else{var _0x55418e=parseInt(_0x6fb0ee['trunk_id'],0xa);if(isNaN(_0x55418e)){_0x2c7587=_0x6fb0ee['trunk_id'];}else{_0x2c7587=this[_0xf4fe('0x1d')][_0xf4fe('0x72')](this,_0x6fb0ee['trunk_id']);if(!_0x2c7587){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x6fb0ee,'no\x20trunk\x20found');}}}}else if(_0x6fb0ee[_0xf4fe('0x104')]){_0x2c7587=_0x6fb0ee[_0xf4fe('0x104')];}else{return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x6fb0ee,'no\x20trunk\x20selected');}var _0x324755=this['channel'][_0xf4fe('0x59')](_0xf4fe('0x105'),[util[_0xf4fe('0x28')](_0xf4fe('0x106'),_0x2c7587,_0x6fb0ee['phone']),_0x6fb0ee[_0xf4fe('0x68')],_0x6fb0ee[_0xf4fe('0xda')],_0x6fb0ee[_0xf4fe('0x66')]]);if(_0x324755['result']===-0x1){return _0x324755;}return this['channel'][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0xdb'),_0xf4fe('0x105')));};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x107')]=function(_0x102f86){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x108'),_0x102f86[_0xf4fe('0x39')]));return this['channel'][_0xf4fe('0xa6')]('finally');};AGIVertices['prototype'][_0xf4fe('0x109')]=function(_0x427b83){logger[_0xf4fe('0x2f')](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x427b83[_0xf4fe('0x39')]));if(_0x427b83[_0xf4fe('0xa2')]===0x0){return this[_0xf4fe('0x10a')](_0x427b83);}_0x427b83['retry']-=0x1;if(!this[_0xf4fe('0x86')](_0x427b83[_0xf4fe('0x10b')])){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x427b83,_0xf4fe('0x10c'));}var _0x14dee5=this['getSound']['sync'](this,_0x427b83['file_id']);if(!_0x14dee5){return this['channel']['error'](_0x427b83,_0xf4fe('0x10d'));}if(!this['isConfigured'](_0x427b83[_0xf4fe('0xcf')])){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0xf4fe('0xd0'));}var _0x2dd607=this[_0xf4fe('0xe')][_0xf4fe('0x10e')](_0x14dee5,_0x427b83[_0xf4fe('0x10f')],_0x427b83[_0xf4fe('0x110')]);var _0x1f29bf=_0x2dd607['result']?_0x2dd607[_0xf4fe('0xa1')][_0xf4fe('0x4d')]():'';logger[_0xf4fe('0x2f')](_0xf4fe('0x111'),JSON[_0xf4fe('0x77')](_0x2dd607));if(_0x2dd607[_0xf4fe('0xa1')]===-0x1){this[_0xf4fe('0x37')][_0xf4fe('0x72')](this,_0x427b83,_0x1f29bf);return _0x2dd607;}else if(_0x2dd607[_0xf4fe('0x9f')]==='timeout'){_0x2dd607['result']=_0x1f29bf['length']>=parseInt(_0x427b83[_0xf4fe('0x112')])?'x':'i';}else{_0x2dd607[_0xf4fe('0xa1')]=_0x1f29bf[_0xf4fe('0x97')]>=parseInt(_0x427b83[_0xf4fe('0x112')])&&_0x1f29bf[_0xf4fe('0x97')]<=parseInt(_0x427b83['maxdigit'])?'x':'i';}var _0x180ad5=this[_0xf4fe('0x9e')][_0xf4fe('0x72')](this,_0x427b83[_0xf4fe('0xcf')]);if(!_0x180ad5){return this[_0xf4fe('0xe')]['error'](_0x427b83,_0xf4fe('0xd1'));}this[_0xf4fe('0xe')][_0xf4fe('0x9b')](_0x180ad5,_0x1f29bf);if(this['isConfigured'](_0x427b83['hiddendigitsnum'])){var _0x5bd3fc=parseInt(_0x427b83[_0xf4fe('0x113')],0xa);var _0x97d150=rs[_0xf4fe('0x114')]({'charset':'*','length':_0x5bd3fc});var _0x302ce3=_0x1f29bf[_0xf4fe('0x97')];if(_0x302ce3>0x0){if(_0x302ce3>_0x5bd3fc){this['createSquareDetailsReport'][_0xf4fe('0x72')](this,_0x427b83,_0x427b83['hiddendigitspos']==='first'?_0x97d150+_0x1f29bf[_0xf4fe('0x115')](_0x5bd3fc):_0x1f29bf['substr'](0x0,_0x302ce3-_0x5bd3fc)+_0x97d150);}else{this['createSquareDetailsReport']['sync'](this,_0x427b83,rs[_0xf4fe('0x114')]({'charset':'*','length':_0x302ce3}));}}else{this[_0xf4fe('0x37')][_0xf4fe('0x72')](this,_0x427b83,'');}}else{this[_0xf4fe('0x37')][_0xf4fe('0x72')](this,_0x427b83,_0x1f29bf);}return _0x2dd607;};AGIVertices[_0xf4fe('0x11')]['getsecretdigits']=function(_0x2dbfff){logger['info'](util[_0xf4fe('0x28')](_0xf4fe('0x116'),_0x2dbfff[_0xf4fe('0x39')]));return this[_0xf4fe('0x109')](_0x2dbfff);};AGIVertices[_0xf4fe('0x11')]['goal']=function(_0x1457ac){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x1457ac[_0xf4fe('0x39')]));this[_0xf4fe('0x37')]['sync'](this,_0x1457ac,_0x1457ac[_0xf4fe('0x117')]);return this[_0xf4fe('0xe')]['noop'](util['format']('GOAL\x20%s',_0x1457ac[_0xf4fe('0x117')]));};AGIVertices['prototype'][_0xf4fe('0x118')]=function(_0x21e95d){logger[_0xf4fe('0x2f')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x21e95d['label']));if(!this[_0xf4fe('0x86')](_0x21e95d[_0xf4fe('0x88')])||!this['isConfigured'](_0x21e95d['aws_secret_access_key'])){return this[_0xf4fe('0xe')]['noop'](_0xf4fe('0x119'));}if(!this[_0xf4fe('0x86')](_0x21e95d[_0xf4fe('0x5d')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xbc'));}this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')]('Trying\x20aws\x20Polly\x20%s',_0x21e95d['text']));var _0xf6c30=this['awsPolly'][_0xf4fe('0x72')](this,_0x21e95d);if(_0xf6c30){this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util['format'](_0xf4fe('0x11a'),_0xf6c30));var _0x30c137=this[_0xf4fe('0xe')]['streamFile'](_0xf6c30);try{fs[_0xf4fe('0x11b')](_0xf6c30+'.wav');}catch(_0xcf4d1e){logger[_0xf4fe('0x2c')](_0xcf4d1e);}return _0x30c137;}return this['channel']['error'](_0x21e95d,_0xf4fe('0x11c'));};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x11d')]=function(_0x27cc8d){logger['info'](util[_0xf4fe('0x28')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x27cc8d[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x27cc8d['aws_access_key_id'])||!this[_0xf4fe('0x86')](_0x27cc8d[_0xf4fe('0x8c')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0x119'));}if(!this[_0xf4fe('0x86')](_0x27cc8d[_0xf4fe('0x11e')])){return this['channel'][_0xf4fe('0xa6')](_0xf4fe('0x11f'));}if(!this[_0xf4fe('0x86')](_0x27cc8d[_0xf4fe('0x5d')])){return this[_0xf4fe('0xe')]['noop'](_0xf4fe('0xbc'));}this[_0xf4fe('0xe')][_0xf4fe('0xdf')]=!![];this[_0xf4fe('0x37')](_0x27cc8d);this['createSquareMessage'](_0x27cc8d[_0xf4fe('0x5d')],'in','','');this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0x120'),_0x27cc8d[_0xf4fe('0x5d')]));var _0x503932=this[_0xf4fe('0x8b')]['sync'](this,_0x27cc8d);if(_0x503932){for(var _0x5c5be4 in _0x503932){if(_0x503932[_0xf4fe('0x91')](_0x5c5be4)&&_[_0xf4fe('0x92')](_0x503932[_0x5c5be4])){this[_0xf4fe('0xe')][_0xf4fe('0x9b')](util['format']('AWS_LEX_%s',_0x5c5be4[_0xf4fe('0x6c')]()),_0x503932[_0x5c5be4]);}}if(_[_0xf4fe('0x46')](_0x503932[_0xf4fe('0x7a')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xf4fe('0x43')](_0x503932['message'],'out',_0xf4fe('0x121'),'');return this['channel'][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0x122'),_0x503932[_0xf4fe('0x7a')]));}}return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x27cc8d,_0xf4fe('0x123'));};AGIVertices['prototype'][_0xf4fe('0x124')]=function(_0x5f4aee){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x125'),_0x5f4aee[_0xf4fe('0x39')],_0x5f4aee[_0xf4fe('0x68')]));if(!this['isConfigured'](_0x5f4aee[_0xf4fe('0x7d')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xde'));}var _0x1332ee='wav';var _0x4279b4=util[_0xf4fe('0x28')](_0xf4fe('0x126'),FILES_PATH,rs[_0xf4fe('0x114')](0x4));var _0x32c03e=util[_0xf4fe('0x28')](_0xf4fe('0x9a'),_0x4279b4,_0x1332ee);var _0x1fad3b=!![];if(_0x5f4aee[_0xf4fe('0x127')]==='NOBEEP'){_0x1fad3b=![];}var _0x3bf410=this[_0xf4fe('0xe')]['recordFile'](_0x4279b4,_0x1332ee,_0x5f4aee[_0xf4fe('0x128')],_0x5f4aee['timeout'],undefined,_0x1fad3b);if(_0x3bf410[_0xf4fe('0xa1')]!==-0x1){this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0x129'),_0x32c03e));var _0x401baa=this[_0xf4fe('0x8d')][_0xf4fe('0x72')](this,_0x5f4aee,_0x32c03e);if(_0x401baa){for(var _0x71e002 in _0x401baa){if(_0x401baa[_0xf4fe('0x91')](_0x71e002)){this[_0xf4fe('0xe')][_0xf4fe('0x9b')](util['format'](_0xf4fe('0x12a'),_0x71e002[_0xf4fe('0x6c')]()),_0x401baa[_0x71e002]);}}return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0x12b'),JSON['stringify'](_0x401baa)));}}return _0x3bf410;};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x12c')]=function(_0x329f7b){logger[_0xf4fe('0x2f')](util['format'](_0xf4fe('0x12d'),_0x329f7b[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x329f7b[_0xf4fe('0x8f')])){return this['channel'][_0xf4fe('0xa6')](_0xf4fe('0x12e'));}if(!this[_0xf4fe('0x86')](_0x329f7b[_0xf4fe('0x12f')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0x130'));}var _0x2767ba=_0xf4fe('0x131');var _0x48dfe1=util[_0xf4fe('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0xf4fe('0x114')](0x4));var _0x33fe07=util[_0xf4fe('0x28')]('%s.%s',_0x48dfe1,_0x2767ba);var _0x1869af=!![];if(_0x329f7b['beep']===_0xf4fe('0x132')){_0x1869af=![];}var _0x2aa037=this[_0xf4fe('0xe')][_0xf4fe('0x133')](_0x48dfe1,_0x2767ba,_0x329f7b[_0xf4fe('0x128')],_0x329f7b[_0xf4fe('0x68')],undefined,_0x1869af);if(_0x2aa037[_0xf4fe('0xa1')]!==-0x1){this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0x134'),_0x33fe07));var _0xe09d78=this[_0xf4fe('0x8e')][_0xf4fe('0x72')](this,_0x329f7b,_0x33fe07);if(_0xe09d78){for(var _0x44dc68 in _0xe09d78){if(_0xe09d78[_0xf4fe('0x91')](_0x44dc68)){this[_0xf4fe('0xe')][_0xf4fe('0x9b')](util[_0xf4fe('0x28')](_0xf4fe('0x135'),_0x44dc68[_0xf4fe('0x6c')]()),_0xe09d78[_0x44dc68]);}}return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0x136'),JSON['stringify'](_0xe09d78)));}}return _0x2aa037;};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x137')]=function(_0x4dc133){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x138'),_0x4dc133[_0xf4fe('0x39')]));return this['channel'][_0xf4fe('0x139')](_0x4dc133[_0xf4fe('0x3e')],_0x4dc133[_0xf4fe('0x3f')],_0x4dc133[_0xf4fe('0x40')]);};AGIVertices['prototype']['gotoif']=function(_0x13b093){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x13a'),_0x13b093[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x13b093[_0xf4fe('0x13b')])){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x13b093,_0xf4fe('0x13c'));}try{var _0x3def7b=eval(_0x13b093[_0xf4fe('0x13b')])?_0xf4fe('0x13d'):_0xf4fe('0x13e');this[_0xf4fe('0xe')]['noop'](util['format'](_0xf4fe('0x13f'),_0x13b093['condition'],_0x3def7b));return{'code':0xc8,'result':_0x3def7b};}catch(_0x55d9b2){return{'code':0xc8,'result':_0xf4fe('0x13e')};}};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x140')]=function(_0x2340a2){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x141'),_0x2340a2[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x2340a2[_0xf4fe('0x142')])){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x2340a2,_0xf4fe('0x143'));}var _0xdd6ce1=this[_0xf4fe('0x22')][_0xf4fe('0x72')](this,_0x2340a2[_0xf4fe('0x142')]);if(!_0xdd6ce1){return this['channel'][_0xf4fe('0x2c')](_0x2340a2,_0xf4fe('0x144'));}for(var _0x4dd962=0x0;_0x4dd962<_0xdd6ce1[_0xf4fe('0x97')];_0x4dd962+=0x1){var _0x4af9a8=this[_0xf4fe('0xe')][_0xf4fe('0x9e')](util[_0xf4fe('0x28')](_0xf4fe('0x145'),_0xdd6ce1[_0x4dd962]));if(_0x4af9a8[_0xf4fe('0xa1')]===-0x1){return _0x4af9a8;}logger['info'](util['format'](_0xf4fe('0x146'),_0xdd6ce1[_0x4dd962],_0x4af9a8[_0xf4fe('0x9f')]));if(_0x4af9a8['extra']==='true'){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x146'),_0xdd6ce1[_0x4dd962],_0xf4fe('0x13d')));this[_0xf4fe('0xe')]['noop'](util[_0xf4fe('0x28')](_0xf4fe('0x146'),_0xdd6ce1[_0x4dd962],_0xf4fe('0x13d')));return{'code':0xc8,'result':'true'};}else{logger['info'](util['format'](_0xf4fe('0x146'),_0xdd6ce1[_0x4dd962],_0xf4fe('0x13e')));this[_0xf4fe('0xe')]['noop'](util[_0xf4fe('0x28')](_0xf4fe('0x146'),_0xdd6ce1[_0x4dd962],'false'));}}return{'code':0xc8,'result':_0xf4fe('0x13e')};};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x147')]=function(_0xf8c442){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x148'),_0xf8c442['label']));return this[_0xf4fe('0xe')][_0xf4fe('0x147')]();};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x149')]=function(_0x5c8d2d){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x14a'),_0x5c8d2d[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x5c8d2d[_0xf4fe('0x7d')])){return this[_0xf4fe('0xe')]['noop'](_0xf4fe('0xde'));}var _0x1badde=_0xf4fe('0x131');var _0x4a5fa4=util[_0xf4fe('0x28')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x231bd0=util[_0xf4fe('0x28')]('%s.%s',_0x4a5fa4,_0x1badde);var _0x51f77d=!![];if(_0x5c8d2d[_0xf4fe('0x127')]===_0xf4fe('0x132')){_0x51f77d=![];}var _0x2286da=this[_0xf4fe('0xe')][_0xf4fe('0x133')](_0x4a5fa4,_0x1badde,_0x5c8d2d[_0xf4fe('0x128')],_0x5c8d2d[_0xf4fe('0x68')],undefined,_0x51f77d);if(_0x2286da[_0xf4fe('0xa1')]!==-0x1){this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')]('ispeech\x20%s\x20file\x20created',_0x231bd0));var _0x3e7510=this[_0xf4fe('0x84')][_0xf4fe('0x72')](this,_0x5c8d2d,_0x231bd0);if(_0x3e7510){for(var _0x55fbca in _0x3e7510){if(_0x3e7510[_0xf4fe('0x91')](_0x55fbca)){this[_0xf4fe('0xe')][_0xf4fe('0x9b')](util[_0xf4fe('0x28')](_0xf4fe('0x14b'),_0x55fbca[_0xf4fe('0x6c')]()),_0x3e7510[_0x55fbca]);}}return this[_0xf4fe('0xe')]['noop'](util[_0xf4fe('0x28')]('IspeechASR\x20Result\x20%s',JSON[_0xf4fe('0x77')](_0x3e7510)));}}return _0x2286da;};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x14c')]=function(_0x18ffbc){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x14d'),_0x18ffbc[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x18ffbc[_0xf4fe('0x7d')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xde'));}if(!this[_0xf4fe('0x86')](_0x18ffbc[_0xf4fe('0x5d')])){return this['channel'][_0xf4fe('0xa6')](_0xf4fe('0xbc'));}this[_0xf4fe('0xe')]['noop'](util['format'](_0xf4fe('0x14e'),_0x18ffbc[_0xf4fe('0x5d')]));var _0x33f98c=this[_0xf4fe('0x83')][_0xf4fe('0x72')](this,_0x18ffbc);if(_0x33f98c){this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util['format'](_0xf4fe('0x14f'),_0x33f98c));var _0x341534=this[_0xf4fe('0xe')][_0xf4fe('0x150')](_0x33f98c,_0x18ffbc[_0xf4fe('0x128')]);try{fs['unlink'](_0x33f98c+_0xf4fe('0x151'));}catch(_0x114f38){logger['error'](_0x114f38);}return _0x341534;}return this['channel'][_0xf4fe('0x2c')](_0x18ffbc,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xf4fe('0x152')]=function(_0x2d4092){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x153'),_0x2d4092['label']));if(!this[_0xf4fe('0x86')](_0x2d4092[_0xf4fe('0x154')])){return this[_0xf4fe('0xe')]['error'](_0x2d4092,_0xf4fe('0x155'));}logger['info'](util[_0xf4fe('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf4fe('0xe')]['callerid'],_0x2d4092[_0xf4fe('0x154')]));var _0x6d5ec3=this['agentLogin']['sync'](this,_0x2d4092[_0xf4fe('0x154')]);if(_0x6d5ec3){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x156'),this['channel'][_0xf4fe('0x3c')],_0x2d4092[_0xf4fe('0x154')]));this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf4fe('0xe')][_0xf4fe('0x3c')],_0x2d4092['findBy']));return{'code':0xc8,'result':_0xf4fe('0x157')};}else{logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x158'),this[_0xf4fe('0xe')][_0xf4fe('0x3c')],_0x2d4092[_0xf4fe('0x154')]));this['channel'][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0x158'),this[_0xf4fe('0xe')]['callerid'],_0x2d4092['findBy']));return{'code':0xc8,'result':_0xf4fe('0x159')};}};AGIVertices['prototype'][_0xf4fe('0x15a')]=function(_0x4d17c9){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x15b'),_0x4d17c9[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x4d17c9['findBy'])){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x4d17c9,_0xf4fe('0x155'));}logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x15c'),this[_0xf4fe('0xe')]['callerid'],_0x4d17c9[_0xf4fe('0x154')]));var _0x176a44=this[_0xf4fe('0x53')][_0xf4fe('0x72')](this,_0x4d17c9['findBy']);if(_0x176a44){logger['info'](util[_0xf4fe('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf4fe('0xe')][_0xf4fe('0x3c')],_0x4d17c9['findBy']));this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util['format'](_0xf4fe('0x156'),this['channel'][_0xf4fe('0x3c')],_0x4d17c9[_0xf4fe('0x154')]));return{'code':0xc8,'result':_0xf4fe('0x157')};}else{logger[_0xf4fe('0x2f')](util['format'](_0xf4fe('0x158'),this[_0xf4fe('0xe')][_0xf4fe('0x3c')],_0x4d17c9[_0xf4fe('0x154')]));this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util['format'](_0xf4fe('0x158'),this[_0xf4fe('0xe')][_0xf4fe('0x3c')],_0x4d17c9[_0xf4fe('0x154')]));return{'code':0xc8,'result':_0xf4fe('0x159')};}};AGIVertices[_0xf4fe('0x11')]['math']=function(_0x771793){logger['info'](util[_0xf4fe('0x28')](_0xf4fe('0x15d'),_0x771793[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x771793[_0xf4fe('0x15e')])){return this['channel']['error'](_0x771793,_0xf4fe('0x15f'));}this[_0xf4fe('0xe')]['noop'](util[_0xf4fe('0x28')](_0xf4fe('0x160'),_0x771793[_0xf4fe('0x15e')]));var _0x50312d=eval(_0x771793[_0xf4fe('0x15e')]);if(!this[_0xf4fe('0x86')](_0x771793['variable_id'])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xd0'));}var _0x8d975=this[_0xf4fe('0x9e')]['sync'](this,_0x771793[_0xf4fe('0xcf')]);if(!_0x8d975){return this[_0xf4fe('0xe')]['error'](_0x771793,'no\x20variable\x20found');}if(_[_0xf4fe('0x96')](_0x50312d)){var _0x34ae24=this;_0x50312d[_0xf4fe('0xd2')](function(_0x4ba109,_0x363c55){_0x34ae24['channel'][_0xf4fe('0x9b')](util[_0xf4fe('0x28')](_0xf4fe('0x161'),_0x8d975,_0x363c55),_0x4ba109);});return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util['format']('variable\x20%s[key]\x20set',_0x8d975));}else{return this[_0xf4fe('0xe')][_0xf4fe('0x9b')](_0x8d975,_0x50312d);}};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0xc')]=function(_0x234c29){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x162'),_0x234c29[_0xf4fe('0x39')]));if(_0x234c29['retry']===0x0){return this['maxRetry'](_0x234c29);}_0x234c29['retry']-=0x1;if(!this[_0xf4fe('0x86')](_0x234c29['file_id'])){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x234c29,_0xf4fe('0x10c'));}var _0x44edac=this['getSound'][_0xf4fe('0x72')](this,_0x234c29['file_id']);if(!_0x44edac){return this[_0xf4fe('0xe')]['error'](_0x234c29,_0xf4fe('0x10d'));}var _0x4346bd=this[_0xf4fe('0xe')][_0xf4fe('0x10e')](_0x44edac,_0x234c29['response'],_0x234c29['digit']);var _0x5c57e3=_0x4346bd[_0xf4fe('0xa1')];if(_0x4346bd[_0xf4fe('0xa1')]===-0x1){this[_0xf4fe('0x37')][_0xf4fe('0x72')](this,_0x234c29,'-1');return _0x4346bd;}else if(_0x4346bd['extra']==='timeout'){_0x4346bd[_0xf4fe('0xa1')]=_0x4346bd['result']['length']>0x0?_0x4346bd[_0xf4fe('0xa1')]:'t';}else if(_['isEmpty'](_0x4346bd[_0xf4fe('0xa1')])){_0x4346bd['result']='#';_0x5c57e3='#';}if(!this[_0xf4fe('0x86')](_0x234c29[_0xf4fe('0xcf')])){this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xd0'));}else{var _0x17c34b=this['getVariable'][_0xf4fe('0x72')](this,_0x234c29['variable_id']);if(!_0x17c34b){return this[_0xf4fe('0xe')]['error'](_0x234c29,_0xf4fe('0xd1'));}this['channel']['setVariable'](_0x17c34b,_0x5c57e3);}this['createSquareDetailsReport'][_0xf4fe('0x72')](this,_0x234c29,_0x5c57e3);return _0x4346bd;};AGIVertices[_0xf4fe('0x11')]['noop']=function(_0x19903f){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x163'),_0x19903f[_0xf4fe('0x39')]));return this[_0xf4fe('0xe')]['noop'](_0x19903f[_0xf4fe('0x164')]||_0x19903f['label']);};AGIVertices['prototype'][_0xf4fe('0x165')]=function(_0x28d786){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x28d786[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x28d786['findBy'])){return this[_0xf4fe('0xe')]['error'](_0x28d786,_0xf4fe('0x155'));}logger[_0xf4fe('0x2f')](util['format'](_0xf4fe('0x15c'),this[_0xf4fe('0xe')][_0xf4fe('0x3c')],_0x28d786['findBy']));var _0xa5eb31=this[_0xf4fe('0x4e')]['sync'](this,_0x28d786[_0xf4fe('0x166')]);var _0x454534=this[_0xf4fe('0x50')][_0xf4fe('0x72')](this,_0x28d786[_0xf4fe('0x154')],_0xa5eb31);if(_0x454534){logger['info'](util[_0xf4fe('0x28')](_0xf4fe('0x156'),this['channel'][_0xf4fe('0x3c')],_0x28d786[_0xf4fe('0x154')]));this['channel'][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0x156'),this[_0xf4fe('0xe')][_0xf4fe('0x3c')],_0x28d786['findBy']));return{'code':0xc8,'result':_0xf4fe('0x157')};}else{logger['info'](util['format'](_0xf4fe('0x158'),this['channel']['callerid'],_0x28d786[_0xf4fe('0x154')]));this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util['format'](_0xf4fe('0x156'),this['channel'][_0xf4fe('0x3c')],_0x28d786[_0xf4fe('0x154')]));return{'code':0xc8,'result':_0xf4fe('0x159')};}};AGIVertices['prototype'][_0xf4fe('0x167')]=function(_0x4a9039){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x4a9039[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x4a9039[_0xf4fe('0x10b')])){return this[_0xf4fe('0xe')]['error'](_0x4a9039,_0xf4fe('0x10c'));}var _0x47fa74=this['getSound'][_0xf4fe('0x72')](this,_0x4a9039[_0xf4fe('0x10b')]);if(!_0x47fa74){return this[_0xf4fe('0xe')]['error'](_0x4a9039,_0xf4fe('0x10d'));}var _0x563ed5=this[_0xf4fe('0xe')]['exec'](_0xf4fe('0x168'),[_0x47fa74,_0x4a9039[_0xf4fe('0xda')]]);if(_0x563ed5[_0xf4fe('0xa1')]===-0x1){return _0x563ed5;}return this['channel']['noop'](util[_0xf4fe('0x28')](_0xf4fe('0xba'),_0xf4fe('0x168'),_0x47fa74));};AGIVertices['prototype']['queue']=function(_0x54a241){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x169'),_0x54a241[_0xf4fe('0x39')]));if(!this['isConfigured'](_0x54a241['queue_id'])){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x54a241,'no\x20queue\x20selected');}var _0x589b7c='';var _0x194f84=parseInt(_0x54a241['queue_id'],0xa);if(isNaN(_0x194f84)){_0x589b7c=_0x54a241[_0xf4fe('0x16a')];}else{_0x589b7c=this[_0xf4fe('0x15')][_0xf4fe('0x72')](this,_0x54a241['queue_id']);if(!_0x589b7c){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x54a241,'no\x20queue\x20found');}}var _0xcdbc97='';if(this['isConfigured'](_0x54a241[_0xf4fe('0x10b')])){var _0x17641c=this['getSound'][_0xf4fe('0x72')](this,_0x54a241[_0xf4fe('0x10b')]);if(_0x17641c){_0xcdbc97=_0x17641c;}}this[_0xf4fe('0x37')][_0xf4fe('0x72')](this,_0x54a241,_0x589b7c);if(_0x54a241['opts'][_0xf4fe('0x16b')]('x')<0x0){_0x54a241[_0xf4fe('0xda')]+='x';}if(_0x54a241[_0xf4fe('0xda')][_0xf4fe('0x16b')]('X')<0x0){_0x54a241['opts']+='X';}this['channel'][_0xf4fe('0x9b')](_0xf4fe('0x16c'),_0x589b7c?_0x589b7c[_0xf4fe('0x16d')]():'');var _0x41b9b8=this[_0xf4fe('0xe')]['exec'](_0xf4fe('0x16e'),[_0x589b7c,_0x54a241[_0xf4fe('0xda')],_0x54a241[_0xf4fe('0x66')],_0xcdbc97,_0x54a241[_0xf4fe('0x68')],_0x54a241[_0xf4fe('0x7')],_0x54a241['macro'],_0x54a241[_0xf4fe('0x16f')],'',_0x54a241[_0xf4fe('0x170')]]);if(_0x41b9b8[_0xf4fe('0xa1')]===-0x1){return _0x41b9b8;}return this['channel'][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0xba'),_0xf4fe('0x16e'),_0x589b7c));};AGIVertices[_0xf4fe('0x11')]['record']=function(_0x1a737e){logger[_0xf4fe('0x2f')](util['format'](_0xf4fe('0x171'),_0x1a737e['label']));var _0x494e9b=_0x1a737e[_0xf4fe('0x172')]||'wav';var _0x370e4b=util[_0xf4fe('0x28')]('%s_%s',this['channel'][_0xf4fe('0x38')],rs[_0xf4fe('0x114')](0x5));var _0x3c5b90=util[_0xf4fe('0x28')]('%s/recordings/%s.%s',FILES_PATH,_0x370e4b,_0x494e9b);var _0x5123bb=util[_0xf4fe('0x28')](_0xf4fe('0x126'),FILES_PATH,_0x370e4b);this['createSquareRecording']['sync'](this,_0x1a737e,_0x370e4b,_0x3c5b90);this[_0xf4fe('0xe')][_0xf4fe('0x9b')](_0xf4fe('0x173'),_0x370e4b);logger[_0xf4fe('0x2f')](_0xf4fe('0x174'),_0x5123bb,_0x494e9b,_0x1a737e['escape_digits'],_0x1a737e[_0xf4fe('0x68')]);return this[_0xf4fe('0xe')][_0xf4fe('0x133')](_0x5123bb,_0x494e9b,_0x1a737e[_0xf4fe('0x175')],_0x1a737e[_0xf4fe('0x68')],undefined,!![]);};AGIVertices['prototype'][_0xf4fe('0x176')]=function(_0x2d4711){logger['info'](util[_0xf4fe('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x2d4711[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x2d4711[_0xf4fe('0x66')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')]('no\x20url\x20configured');}var _0xdd0d70=this[_0xf4fe('0x65')][_0xf4fe('0x72')](this,_0x2d4711);logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x177'),util[_0xf4fe('0x178')](_0xdd0d70,{'showHidden':![],'depth':null})));if(!this[_0xf4fe('0x86')](_0x2d4711[_0xf4fe('0xcf')])){return this[_0xf4fe('0xe')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x27fa37=this[_0xf4fe('0x9e')][_0xf4fe('0x72')](this,_0x2d4711['variable_id']);if(!_0x27fa37){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x2d4711,_0xf4fe('0xd1'));}this[_0xf4fe('0xe')]['setVariable'](util[_0xf4fe('0x28')](_0xf4fe('0x179'),_0x27fa37),_0xdd0d70['statusCode']?_0xdd0d70[_0xf4fe('0x79')]:_0xf4fe('0x17a'));this['channel'][_0xf4fe('0x9b')](util[_0xf4fe('0x28')](_0xf4fe('0x17b'),_0x27fa37),_0xdd0d70['statusMessage']?_0xdd0d70[_0xf4fe('0x78')]:'OK');if(_0xdd0d70[_0xf4fe('0x6d')]){try{this[_0xf4fe('0x98')](_0xdd0d70[_0xf4fe('0x6d')],_0x27fa37);}catch(_0x14389c){logger[_0xf4fe('0x2c')](util[_0xf4fe('0x28')](_0xf4fe('0x17c'),_0x27fa37));}}return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')]('variable\x20%s\x20set',_0x27fa37));};AGIVertices['prototype']['saydigits']=function(_0x2968e1){logger['info'](util[_0xf4fe('0x28')](_0xf4fe('0x17d'),_0x2968e1[_0xf4fe('0x39')]));return this[_0xf4fe('0xe')]['sayDigits'](_0x2968e1[_0xf4fe('0x17e')][_0xf4fe('0x5a')](/\s+/g,''),_0x2968e1['escape_digits']);};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x17f')]=function(_0x436fec){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x436fec[_0xf4fe('0x39')]));return this['channel']['sayNumber'](_0x436fec[_0xf4fe('0x69')]['replace'](/\s+/g,''),_0x436fec[_0xf4fe('0x175')]);};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x180')]=function(_0x854ad5){logger['info'](util['format'](_0xf4fe('0x181'),_0x854ad5[_0xf4fe('0x39')]));return this[_0xf4fe('0xe')][_0xf4fe('0x182')](_0x854ad5[_0xf4fe('0x5d')],_0x854ad5[_0xf4fe('0x175')]);};AGIVertices['prototype'][_0xf4fe('0x183')]=function(_0x190d0a){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x184'),_0x190d0a['label']));if(!this[_0xf4fe('0x86')](_0x190d0a[_0xf4fe('0x185')])){return this[_0xf4fe('0xe')]['noop'](_0xf4fe('0x186'));}var _0x31ba21=this[_0xf4fe('0x1f')][_0xf4fe('0x72')](this,_0x190d0a['account_id']);if(!_0x31ba21||!_0x31ba21[_0xf4fe('0x187')]){return this[_0xf4fe('0xe')]['error'](_0x190d0a,_0xf4fe('0x188'));}var _0x47c654={'from':util[_0xf4fe('0x28')](_0xf4fe('0x189'),_0x31ba21['name'],_0x31ba21['email']||_0x31ba21[_0xf4fe('0x187')][_0xf4fe('0x18a')]),'to':_0x190d0a['to']||'','cc':_0x190d0a['cc']||'','bcc':_0x190d0a[_0xf4fe('0x18b')]||'','subject':_0x190d0a[_0xf4fe('0x18c')],'html':_0x190d0a[_0xf4fe('0x5d')],'text':_0x190d0a[_0xf4fe('0x5d')]};if(this[_0xf4fe('0x86')](_0x190d0a['template_id'])){}logger[_0xf4fe('0xd7')](_0xf4fe('0x18d'),JSON['stringify'](_0x47c654));this['createSquareDetailsReport']['sync'](this,_0x190d0a,_0x190d0a[_0xf4fe('0x185')]);this['channel']['noop'](util[_0xf4fe('0x28')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x31ba21[_0xf4fe('0x14')]));this[_0xf4fe('0x21')]['sync'](this,_0x31ba21[_0xf4fe('0x18e')],_0x47c654);return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0x18f'));};AGIVertices[_0xf4fe('0x11')]['sendFax']=function(_0x13625e){logger['info'](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x13625e['label']));return this[_0xf4fe('0xe')]['noop'](_0xf4fe('0x190'));};AGIVertices['prototype'][_0xf4fe('0x191')]=function(_0x1d798a){logger['info'](util[_0xf4fe('0x28')](_0xf4fe('0x192'),_0x1d798a['label']));if(!this[_0xf4fe('0x86')](_0x1d798a['sms_account_id'])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')]('no\x20sms\x20account\x20configured');}var _0x2c78dc=this['getSmsAccount']['sync'](this,_0x1d798a['sms_account_id']);if(!_0x2c78dc){return this[_0xf4fe('0xe')]['error'](_0x1d798a,_0xf4fe('0x193'));}var _0x281839={'body':_0x1d798a[_0xf4fe('0x194')],'phone':_0x1d798a['to']||'','SmsAccountId':_0x2c78dc['id']};logger['debug'](_0xf4fe('0x195'),JSON[_0xf4fe('0x77')](_0x281839));this[_0xf4fe('0x37')][_0xf4fe('0x72')](this,_0x1d798a,_0x1d798a['sms_account_id']);this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0x196'),_0x2c78dc['name']));this[_0xf4fe('0x36')][_0xf4fe('0x72')](this,_0x281839);return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0x197'));};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x198')]=function(_0x4200ff){logger[_0xf4fe('0x2f')](util['format'](_0xf4fe('0x199'),_0x4200ff['label']));if(!this[_0xf4fe('0x86')](_0x4200ff[_0xf4fe('0xcf')])){return this['channel'][_0xf4fe('0x2c')](_0x4200ff,_0xf4fe('0x19a'));}var _0x4e5f18=this[_0xf4fe('0x9e')][_0xf4fe('0x72')](this,_0x4200ff[_0xf4fe('0xcf')]);if(!_0x4e5f18){return this[_0xf4fe('0xe')]['error'](_0x4200ff,_0xf4fe('0xd1'));}return this[_0xf4fe('0xe')][_0xf4fe('0x9b')](_0x4e5f18,_0x4200ff[_0xf4fe('0x19b')]);};AGIVertices[_0xf4fe('0x11')]['start']=function(_0x597d58){logger[_0xf4fe('0x2f')](util['format'](_0xf4fe('0x19c'),_0x597d58[_0xf4fe('0x39')]));this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0x19d'));var _0x3cca0f=this['channel'][_0xf4fe('0x9e')](_0xf4fe('0x19e'));if(!_[_0xf4fe('0x45')](_0x3cca0f[_0xf4fe('0x9f')])){this[_0xf4fe('0xe')][_0xf4fe('0x38')]=_0x3cca0f['extra'];}if(_0x597d58[_0xf4fe('0x19f')]===_0xf4fe('0x1a0')){this['channel'][_0xf4fe('0xa6')]('Answer');return this[_0xf4fe('0xe')][_0xf4fe('0x19f')]();}return this['channel'][_0xf4fe('0xa6')]('Skipped\x20Answer');};AGIVertices['prototype'][_0xf4fe('0x1a1')]=function(_0x111c4c){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x1a2'),_0x111c4c[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x111c4c['project_id'])){return this['channel'][_0xf4fe('0x2c')](_0x111c4c,_0xf4fe('0x1a3'));}var _0x17cf06=this[_0xf4fe('0x18')][_0xf4fe('0x72')](this,_0x111c4c['project_id']);if(!this[_0xf4fe('0x86')](_0x17cf06)){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x111c4c,util[_0xf4fe('0x28')](_0xf4fe('0x1a4'),_0x111c4c[_0xf4fe('0x1a5')]));}if(_0x17cf06===this['channel'][_0xf4fe('0x3b')]){return this['channel'][_0xf4fe('0x2c')](_0x111c4c,_0xf4fe('0x1a6'));}this['createSquareDetailsReport'][_0xf4fe('0x72')](this,_0x111c4c,_0x17cf06);var _0x82419b=this['channel'][_0xf4fe('0x59')](_0xf4fe('0x1a7'),util[_0xf4fe('0x28')](_0xf4fe('0x1a8'),config[_0xf4fe('0x7')][_0xf4fe('0x1a9')]||_0xf4fe('0x1aa'),_0x17cf06,this[_0xf4fe('0xe')]['arg_1']));if(_0x82419b['result']===-0x1){return _0x82419b;}return this[_0xf4fe('0xe')]['noop'](util[_0xf4fe('0x28')]('Executed\x20command\x20%s\x20%s',_0xf4fe('0x1a7'),_0x17cf06));};AGIVertices[_0xf4fe('0x11')]['system']=function(_0x6079ee){logger['info'](util[_0xf4fe('0x28')](_0xf4fe('0x1ab'),_0x6079ee[_0xf4fe('0x39')]));var _0x53c5f2=this['shellCommand'][_0xf4fe('0x72')](this,_0x6079ee[_0xf4fe('0xb1')]);this[_0xf4fe('0x37')]['sync'](this,_0x6079ee,_0x6079ee[_0xf4fe('0xb1')]);if(this[_0xf4fe('0x86')](_0x6079ee[_0xf4fe('0xcf')])){var _0x395c77=this[_0xf4fe('0x9e')][_0xf4fe('0x72')](this,_0x6079ee[_0xf4fe('0xcf')]);if(_0x395c77){this['channel'][_0xf4fe('0x9b')](_0x395c77,_0x53c5f2);return this[_0xf4fe('0xe')]['noop'](util['format'](_0xf4fe('0x1ac'),_0x6079ee[_0xf4fe('0xb1')],_0x395c77));}}return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0x1ad'),_0x6079ee[_0xf4fe('0xb1')]));};AGIVertices[_0xf4fe('0x11')][_0xf4fe('0x1ae')]=function(_0x16a951){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x1af'),_0x16a951['label']));_0x16a951[_0xf4fe('0x5d')]=_0x16a951[_0xf4fe('0x5d')][_0xf4fe('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf4fe('0x86')](_0x16a951[_0xf4fe('0x1b0')])){return this['channel'][_0xf4fe('0xa6')](_0xf4fe('0x1b1'));}if(!this['isConfigured'](_0x16a951[_0xf4fe('0x5d')])){return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](_0xf4fe('0xbc'));}this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0x1b2'),_0x16a951[_0xf4fe('0x5d')]));var _0x5d83e9=this['googleCloudTTS'][_0xf4fe('0x72')](this,_0x16a951);if(_0x5d83e9){this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0x1b3'),_0x5d83e9));var _0x373686=this['channel'][_0xf4fe('0x150')](_0x5d83e9);try{fs['unlink'](_0x5d83e9+'.wav');}catch(_0xb611bb){logger['error'](_0xb611bb);}return _0x373686;}return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x16a951,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xf4fe('0x11')]['tts']=function(_0xc12cba){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x1b4'),_0xc12cba['label']));_0xc12cba[_0xf4fe('0x5d')]=_0xc12cba[_0xf4fe('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf4fe('0x86')](_0xc12cba[_0xf4fe('0x5d')])){return this['channel'][_0xf4fe('0xa6')](_0xf4fe('0xbc'));}this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')](_0xf4fe('0x1b5'),_0xc12cba[_0xf4fe('0x5d')]));var _0x1f4748=this[_0xf4fe('0x63')]['sync'](this,_0xc12cba);if(_0x1f4748){this['channel']['noop'](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x1f4748));var _0x1fd1fa=this['channel'][_0xf4fe('0x150')](_0x1f4748);try{fs[_0xf4fe('0x11b')](_0x1f4748+_0xf4fe('0x151'));}catch(_0x564e84){logger['error'](_0x564e84);}return _0x1fd1fa;}return this['channel']['error'](_0xc12cba,_0xf4fe('0x1b6'));};AGIVertices[_0xf4fe('0x11')]['unpause']=function(_0x3cb03c){logger['info'](util[_0xf4fe('0x28')](_0xf4fe('0x1b7'),_0x3cb03c[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x3cb03c[_0xf4fe('0x154')])){return this[_0xf4fe('0xe')][_0xf4fe('0x2c')](_0x3cb03c,'no\x20find\x20by\x20configured');}logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x15c'),this[_0xf4fe('0xe')]['callerid'],_0x3cb03c['findBy']));var _0x5dfec1=this[_0xf4fe('0x52')][_0xf4fe('0x72')](this,_0x3cb03c[_0xf4fe('0x154')]);if(_0x5dfec1){logger['info'](util[_0xf4fe('0x28')](_0xf4fe('0x156'),this[_0xf4fe('0xe')]['callerid'],_0x3cb03c[_0xf4fe('0x154')]));this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf4fe('0xe')][_0xf4fe('0x3c')],_0x3cb03c[_0xf4fe('0x154')]));return{'code':0xc8,'result':_0xf4fe('0x157')};}else{logger[_0xf4fe('0x2f')](util['format'](_0xf4fe('0x158'),this[_0xf4fe('0xe')][_0xf4fe('0x3c')],_0x3cb03c[_0xf4fe('0x154')]));this[_0xf4fe('0xe')]['noop'](util[_0xf4fe('0x28')](_0xf4fe('0x158'),this[_0xf4fe('0xe')][_0xf4fe('0x3c')],_0x3cb03c['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['voicemail']=function(_0x126e8d){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x126e8d['label']));var _0x31aeb7=this['channel']['exec'](_0xf4fe('0x1b8'),[_0x126e8d['mailbox'],_0x126e8d[_0xf4fe('0x7b')]]);if(_0x31aeb7[_0xf4fe('0xa1')]===-0x1){return _0x31aeb7;}return this[_0xf4fe('0xe')][_0xf4fe('0xa6')](util[_0xf4fe('0x28')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x126e8d[_0xf4fe('0x1b9')]));};AGIVertices['prototype'][_0xf4fe('0x1ba')]=function(_0x3899c7){logger[_0xf4fe('0x2f')](util[_0xf4fe('0x28')](_0xf4fe('0x1bb'),_0x3899c7[_0xf4fe('0x39')]));if(!this[_0xf4fe('0x86')](_0x3899c7[_0xf4fe('0xcf')])){return this[_0xf4fe('0xe')]['error'](_0x3899c7,_0xf4fe('0x19a'));}var _0x14345a=this[_0xf4fe('0x9e')][_0xf4fe('0x72')](this,_0x3899c7['variable_id']);if(!_0x14345a){return this['channel'][_0xf4fe('0x2c')](_0x3899c7,_0xf4fe('0xd1'));}var _0x3aca0e=this[_0xf4fe('0xe')][_0xf4fe('0x9e')](_0x14345a);return{'code':0xc8,'result':_0x3aca0e['extra']?_0x3aca0e[_0xf4fe('0x9f')]:'-'};};String[_0xf4fe('0x11')][_0xf4fe('0x9d')]=function(_0x4de649,_0xe9360){return this[_0xf4fe('0x9c')](_0x4de649)[_0xf4fe('0x1bc')](_0xe9360);};module[_0xf4fe('0x1bd')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index b98648b..41f96ca 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 _0x34b9=['error','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','startAcw','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','../ami','../../../config/logger','../rpc/user','agents','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','diff','seconds','prototype','timers','lastPauseAt','timer','update','uniqueid','then','info','catch','[%s][UPDATE][ERRORS:%s]','finally','interface','voiceQueues','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0x34b9,0x120));var _0x934b=function(_0x651087,_0x1b1fcf){_0x651087=_0x651087-0x0;var _0x7ffe33=_0x34b9[_0x651087];return _0x7ffe33;};'use strict';var _=require(_0x934b('0x0'));var moment=require('moment');var ami=require(_0x934b('0x1'));var logger=require(_0x934b('0x2'))('acw');var RpcUser=require(_0x934b('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x405c1d){this['voiceQueues']=_0x405c1d['voiceQueues'];this[_0x934b('0x4')]=_0x405c1d[_0x934b('0x4')];this['timers']=_0x405c1d['timers'];this[_0x934b('0x5')]={};ami['on']('agentconnect',this[_0x934b('0x6')][_0x934b('0x7')](this));ami['on'](_0x934b('0x8'),this[_0x934b('0x9')][_0x934b('0x7')](this));ami['on']('hangup',this[_0x934b('0xa')]['bind'](this));ami['on'](_0x934b('0xb'),this[_0x934b('0xc')]['bind'](this));ami['on']('attendedtransfer',this[_0x934b('0xd')][_0x934b('0x7')](this));ami['on'](_0x934b('0xe'),this[_0x934b('0xf')][_0x934b('0x7')](this));ami['on']('custom:agentConnectPreview',this[_0x934b('0x10')]['bind'](this));}function getDiff(_0x3e056c){var _0x34485f=moment()['milliseconds'](0x0);var _0x5494fe=moment(_0x3e056c)['milliseconds'](0x0);return _0x34485f[_0x934b('0x11')](_0x5494fe,_0x934b('0x12'));}Acw[_0x934b('0x13')]['updateAcw']=function(_0x168e65,_0x1bfb2f){var _0x25acb7=this;var _0xdb4194=getDiff(_0x25acb7[_0x934b('0x14')][_0x168e65][_0x934b('0x15')]);clearTimeout(_0x25acb7[_0x934b('0x14')][_0x168e65][_0x934b('0x16')]);_0x25acb7[_0x934b('0x14')][_0x168e65]['timer']=![];return RpcVoiceAgentReport[_0x934b('0x17')]({'acwtime':_0xdb4194},_0x25acb7[_0x934b('0x14')][_0x168e65][_0x934b('0x18')],_0x168e65)[_0x934b('0x19')](function(_0x49abb8){logger[_0x934b('0x1a')]('[%s][UPDATE][ACWTIME:%s]',_0x1bfb2f,_0xdb4194,_0x49abb8);})[_0x934b('0x1b')](function(_0x567adb){logger['error'](_0x934b('0x1c'),_0x1bfb2f,_0x567adb);})[_0x934b('0x1d')](function(){delete _0x25acb7['timers'][_0x168e65];});};Acw[_0x934b('0x13')]['startAcw']=function(_0x35790c){try{var _0x200663=this;var _0x4ed087=this[_0x934b('0x5')][_0x35790c][_0x934b('0x1e')];var _0x520254=this[_0x934b('0x5')][_0x35790c]['queue'];var _0x175643=this[_0x934b('0x1f')][_0x520254];var _0x3f8922=![];var _0x5da6e3=_0x934b('0x20');if(_0x175643[_0x934b('0x21')]&&_0x175643[_0x934b('0x22')]['name']){_0x3f8922=!![];_0x5da6e3=_0x175643[_0x934b('0x22')][_0x934b('0x23')];}return ami[_0x934b('0x24')]({'action':_0x934b('0x25'),'interface':_0x4ed087,'paused':!![],'reason':_0x5da6e3})['then'](function(){if(_0x200663['agents'][_0x4ed087]){return RpcUser[_0x934b('0x26')](_0x200663[_0x934b('0x4')][_0x4ed087]['id'])[_0x934b('0x19')](function(_0x27a0d9){if(!_0x27a0d9||_0x27a0d9['voicePause']){logger[_0x934b('0x1a')](_0x934b('0x27'),_0x35790c,_0x4ed087,_0x520254);return;}logger[_0x934b('0x1a')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x35790c,_0x4ed087,_0x520254);var _0xe1564=_0x200663[_0x934b('0x5')][_0x35790c][_0x934b('0x28')]&&_0x200663[_0x934b('0x5')][_0x35790c][_0x934b('0x29')]?_0x200663[_0x934b('0x5')][_0x35790c][_0x934b('0x29')]:_0x35790c;return RpcUser[_0x934b('0x2a')](_0x200663['agents'][_0x4ed087],_0x5da6e3,_0xe1564)[_0x934b('0x19')](function(_0x26cd01){_0x200663['voiceQueues'][_0x520254][_0x934b('0x2b')]-=0x1;_0x200663[_0x934b('0x1f')][_0x520254][_0x934b('0x2c')]+=0x1;return _0x26cd01;});})['then'](function(_0x7a1be2){if(_0x3f8922||!_0x7a1be2){return;}_0x200663['timers'][_0x4ed087]={};logger[_0x934b('0x1a')](_0x934b('0x2d'),_0x35790c,_0x200663[_0x934b('0x1f')][_0x520254][_0x934b('0x2e')],_0x4ed087,_0x520254);_0x200663[_0x934b('0x14')][_0x4ed087]['timer']=setTimeout(_0x200663[_0x934b('0x2f')]['bind'](_0x200663,_0x4ed087),_0x200663[_0x934b('0x1f')][_0x520254][_0x934b('0x2e')]*0x3e8);_0x200663[_0x934b('0x14')][_0x4ed087]['lastPauseAt']=moment()[_0x934b('0x30')](_0x934b('0x31'));_0x200663[_0x934b('0x14')][_0x4ed087][_0x934b('0x18')]=_0x35790c;_0x200663['timers'][_0x4ed087][_0x934b('0x32')]=_0x520254;_0x200663[_0x934b('0x14')][_0x4ed087][_0x934b('0x33')]=_0x200663['updateAcw']['bind'](_0x200663,_0x4ed087,_0x35790c);});}})[_0x934b('0x1b')](function(){logger[_0x934b('0x34')](_0x934b('0x2d'),_0x35790c,_0x200663[_0x934b('0x1f')][_0x520254]['acwTimeout'],_0x4ed087,_0x520254);})[_0x934b('0x1d')](function(){delete _0x200663[_0x934b('0x5')][_0x35790c];});}catch(_0x101a7e){logger[_0x934b('0x34')](_0x934b('0x35'),_0x101a7e[_0x934b('0x36')]);}};Acw[_0x934b('0x13')][_0x934b('0x2f')]=function(_0x590983){try{var _0xf41b9f=this;if(_0xf41b9f[_0x934b('0x14')][_0x590983]){_0xf41b9f[_0x934b('0x14')][_0x590983]['timer']=![];var _0x152818=_0xf41b9f['timers'][_0x590983][_0x934b('0x18')];var _0x43ecdb=_0xf41b9f[_0x934b('0x14')][_0x590983]['queue'];var _0x55880e=_0xf41b9f[_0x934b('0x1f')][_0x43ecdb][_0x934b('0x2e')];logger[_0x934b('0x1a')](_0x934b('0x37'),_0x152818,_0x590983);RpcUser[_0x934b('0x26')](this[_0x934b('0x4')][_0x590983]['id'])[_0x934b('0x19')](function(_0x5cc77c){if(_0x5cc77c['pauseType']===_0x934b('0x20')){return RpcUser['saveUnpause'](_0xf41b9f['agents'][_0x590983]);}});RpcVoiceAgentReport[_0x934b('0x17')]({'acwtime':_0x55880e,'agentacw':!![]},_0x152818,_0x590983)[_0x934b('0x19')](function(_0x462ec0){logger[_0x934b('0x1a')](_0x934b('0x38'),_0x152818,_0x55880e,_0x462ec0);})[_0x934b('0x1b')](function(_0x3d8d4c){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x152818,_0x3d8d4c);});}else{logger[_0x934b('0x34')](_0x934b('0x39'),_0x590983);if(_0xf41b9f[_0x934b('0x14')]){logger[_0x934b('0x1a')](_0x934b('0x3a'),JSON['stringify'](_0xf41b9f[_0x934b('0x14')]));}}}catch(_0x5a35f2){logger[_0x934b('0x34')]('[ACW][STOP]\x20%s',_0x5a35f2[_0x934b('0x36')]);}};Acw[_0x934b('0x13')][_0x934b('0x6')]=function(_0x4b0a8c){try{if(this[_0x934b('0x1f')][_0x4b0a8c[_0x934b('0x32')]]&&(this[_0x934b('0x1f')][_0x4b0a8c['queue']][_0x934b('0x3b')]||this[_0x934b('0x1f')][_0x4b0a8c[_0x934b('0x32')]]['mandatoryDisposition'])){if(this[_0x934b('0x4')][_0x4b0a8c[_0x934b('0x1e')]]){this[_0x934b('0x5')][_0x4b0a8c['uniqueid']]={'queue':_0x4b0a8c['queue'],'interface':_0x4b0a8c['interface'],'destlinkedid':_0x4b0a8c[_0x934b('0x29')]};}}}catch(_0x207fa){logger['error'](_0x934b('0x3c'),_0x207fa[_0x934b('0x36')]);}};Acw[_0x934b('0x13')][_0x934b('0x10')]=function(_0x201012){try{if(this['voiceQueues'][_0x201012[_0x934b('0x32')]]&&(this['voiceQueues'][_0x201012[_0x934b('0x32')]]['acw']||this[_0x934b('0x1f')][_0x201012[_0x934b('0x32')]]['mandatoryDisposition'])){if(this[_0x934b('0x4')][_0x201012['interface']]){this['channels'][_0x201012[_0x934b('0x18')]]={'queue':_0x201012[_0x934b('0x32')],'interface':_0x201012[_0x934b('0x1e')]};}}}catch(_0x58ae1d){logger[_0x934b('0x34')](_0x934b('0x3d'),_0x58ae1d[_0x934b('0x36')]);}};Acw['prototype'][_0x934b('0x9')]=function(_0x555c05){try{if(this[_0x934b('0x5')][_0x555c05[_0x934b('0x18')]]&&_['isUndefined'](this[_0x934b('0x5')][_0x555c05[_0x934b('0x18')]][_0x934b('0x28')])){logger[_0x934b('0x1a')]('[%s][HANGUP:UNIQUEID]',_0x555c05['uniqueid']);this[_0x934b('0x3e')](_0x555c05[_0x934b('0x18')]);}else if(this['channels'][_0x555c05[_0x934b('0x3f')]]&&_[_0x934b('0x40')](this['channels'][_0x555c05[_0x934b('0x3f')]]['attended'])){logger[_0x934b('0x1a')](_0x934b('0x41'),_0x555c05['linkedid']);this[_0x934b('0x3e')](_0x555c05[_0x934b('0x3f')]);}}catch(_0x1de08b){logger['error'](_0x934b('0x42'),_0x1de08b[_0x934b('0x36')]);}};Acw[_0x934b('0x13')]['syncHangup']=function(_0x156296){try{if(this['channels'][_0x156296[_0x934b('0x18')]]&&this[_0x934b('0x5')][_0x156296[_0x934b('0x18')]]['attended']){logger[_0x934b('0x1a')](_0x934b('0x43'),_0x156296['uniqueid']);this[_0x934b('0x3e')](_0x156296[_0x934b('0x18')]);}else if(this[_0x934b('0x5')][_0x156296[_0x934b('0x3f')]]&&this[_0x934b('0x5')][_0x156296['linkedid']]['attended']){logger['info'](_0x934b('0x44'),_0x156296[_0x934b('0x3f')]);this[_0x934b('0x3e')](_0x156296[_0x934b('0x3f')]);}}catch(_0x4b1282){logger[_0x934b('0x34')](_0x934b('0x45'),_0x4b1282[_0x934b('0x36')]);}};Acw[_0x934b('0x13')][_0x934b('0xd')]=function(_0x9d8f51){try{if(!_[_0x934b('0x46')](this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x47')]])){this[_0x934b('0x3e')](_0x9d8f51[_0x934b('0x47')]);if(this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x48')]]){this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x48')]][_0x934b('0x28')]=!![];this[_0x934b('0x5')][_0x9d8f51['transfertargetuniqueid']]=this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x48')]];delete this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x48')]];}}else if(!_[_0x934b('0x46')](this[_0x934b('0x5')][_0x9d8f51['transfertargetuniqueid']])){this[_0x934b('0x3e')](_0x9d8f51[_0x934b('0x49')]);if(this['channels'][_0x9d8f51[_0x934b('0x4a')]]){this[_0x934b('0x5')][_0x9d8f51['origtransfereruniqueid']]['attended']=!![];this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x47')]]=this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x4a')]];delete this['channels'][_0x9d8f51[_0x934b('0x4a')]];}}}catch(_0x490a96){logger[_0x934b('0x34')]('[ACW][syncAttendedTransfer]\x20%s',_0x490a96[_0x934b('0x36')]);}};Acw[_0x934b('0x13')]['syncBlindTransfer']=function(_0x4a5d5b){try{if(this['channels'][_0x4a5d5b['transfereruniqueid']]){logger[_0x934b('0x1a')](_0x934b('0x4b'),JSON[_0x934b('0x4c')](_0x4a5d5b[_0x934b('0x4d')]));this['startAcw'](_0x4a5d5b[_0x934b('0x4d')]);}else if(this[_0x934b('0x5')][_0x4a5d5b[_0x934b('0x4e')]]){logger['info'](_0x934b('0x4f'),JSON[_0x934b('0x4c')](_0x4a5d5b[_0x934b('0x4e')]));this[_0x934b('0x3e')](_0x4a5d5b[_0x934b('0x4e')]);}}catch(_0x5671b5){logger[_0x934b('0x34')](_0x934b('0x50'),_0x5671b5[_0x934b('0x36')]);}};Acw['prototype'][_0x934b('0xc')]=function(_0x414c72){try{if(this['voiceQueues'][_0x414c72[_0x934b('0x32')]]&&this['voiceQueues'][_0x414c72[_0x934b('0x32')]]['autopause']===_0x934b('0x51')){if(this[_0x934b('0x4')][_0x414c72['interface']]){logger[_0x934b('0x1a')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x414c72[_0x934b('0x18')],_0x414c72[_0x934b('0x1e')],_0x414c72[_0x934b('0x32')]);return RpcUser[_0x934b('0x2a')](this[_0x934b('0x4')][_0x414c72['interface']],_0x934b('0x52'),_0x414c72[_0x934b('0x18')]);}}}catch(_0x2b3d93){logger[_0x934b('0x34')](_0x934b('0x53'),_0x2b3d93['message']);}};module[_0x934b('0x54')]=Acw; \ No newline at end of file +var _0xfac1=['mandatoryDispositionPause','name','Action','attended','destlinkedid','savePause','available','paused','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','getAgent','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','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]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','updateAcw','timer','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','queue','ACW'];(function(_0x13843f,_0x50422d){var _0x1063ae=function(_0x12fd6b){while(--_0x12fd6b){_0x13843f['push'](_0x13843f['shift']());}};_0x1063ae(++_0x50422d);}(_0xfac1,0x140));var _0x1fac=function(_0x11f1cf,_0x4cee87){_0x11f1cf=_0x11f1cf-0x0;var _0x22695a=_0xfac1[_0x11f1cf];return _0x22695a;};'use strict';var _=require('lodash');var moment=require(_0x1fac('0x0'));var ami=require(_0x1fac('0x1'));var logger=require('../../../config/logger')(_0x1fac('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x1fac('0x3'));function Acw(_0xe336cd){this[_0x1fac('0x4')]=_0xe336cd[_0x1fac('0x4')];this['agents']=_0xe336cd[_0x1fac('0x5')];this[_0x1fac('0x6')]=_0xe336cd[_0x1fac('0x6')];this[_0x1fac('0x7')]={};ami['on'](_0x1fac('0x8'),this['syncAgentConnect'][_0x1fac('0x9')](this));ami['on']('hanguprequest',this[_0x1fac('0xa')][_0x1fac('0x9')](this));ami['on'](_0x1fac('0xb'),this[_0x1fac('0xc')][_0x1fac('0x9')](this));ami['on']('agentringnoanswer',this[_0x1fac('0xd')][_0x1fac('0x9')](this));ami['on'](_0x1fac('0xe'),this[_0x1fac('0xf')]['bind'](this));ami['on'](_0x1fac('0x10'),this[_0x1fac('0x11')][_0x1fac('0x9')](this));ami['on'](_0x1fac('0x12'),this[_0x1fac('0x13')][_0x1fac('0x9')](this));}function getDiff(_0x2e441b){var _0x5093d6=moment()[_0x1fac('0x14')](0x0);var _0x23bdae=moment(_0x2e441b)['milliseconds'](0x0);return _0x5093d6[_0x1fac('0x15')](_0x23bdae,_0x1fac('0x16'));}Acw['prototype'][_0x1fac('0x17')]=function(_0x1aa03e,_0x2821e5){var _0x485b48=this;var _0x2e35b0=getDiff(_0x485b48['timers'][_0x1aa03e]['lastPauseAt']);clearTimeout(_0x485b48[_0x1fac('0x6')][_0x1aa03e]['timer']);_0x485b48[_0x1fac('0x6')][_0x1aa03e][_0x1fac('0x18')]=![];return RpcVoiceAgentReport['update']({'acwtime':_0x2e35b0},_0x485b48[_0x1fac('0x6')][_0x1aa03e][_0x1fac('0x19')],_0x1aa03e)[_0x1fac('0x1a')](function(_0x4520e3){logger[_0x1fac('0x1b')](_0x1fac('0x1c'),_0x2821e5,_0x2e35b0,_0x4520e3);})[_0x1fac('0x1d')](function(_0x2ab91f){logger[_0x1fac('0x1e')](_0x1fac('0x1f'),_0x2821e5,_0x2ab91f);})[_0x1fac('0x20')](function(){delete _0x485b48[_0x1fac('0x6')][_0x1aa03e];});};Acw['prototype'][_0x1fac('0x21')]=function(_0x1e0d6d){try{var _0x28dd06=this;var _0x1c7f0d=this[_0x1fac('0x7')][_0x1e0d6d]['interface'];var _0x1985fa=this['channels'][_0x1e0d6d][_0x1fac('0x22')];var _0x35a25c=this['voiceQueues'][_0x1985fa];var _0x22ab17=![];var _0x28a8fd=_0x1fac('0x23');if(_0x35a25c['mandatoryDisposition']&&_0x35a25c[_0x1fac('0x24')][_0x1fac('0x25')]){_0x22ab17=!![];_0x28a8fd=_0x35a25c['mandatoryDispositionPause'][_0x1fac('0x25')];}return ami[_0x1fac('0x26')]({'action':'QueuePause','interface':_0x1c7f0d,'paused':!![],'reason':_0x28a8fd})[_0x1fac('0x1a')](function(){if(_0x28dd06[_0x1fac('0x5')][_0x1c7f0d]){return RpcUser['getAgent'](_0x28dd06[_0x1fac('0x5')][_0x1c7f0d]['id'])[_0x1fac('0x1a')](function(_0x47b60a){if(!_0x47b60a||_0x47b60a['voicePause']){logger[_0x1fac('0x1b')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x1e0d6d,_0x1c7f0d,_0x1985fa);return;}logger[_0x1fac('0x1b')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x1e0d6d,_0x1c7f0d,_0x1985fa);var _0x86d387=_0x28dd06[_0x1fac('0x7')][_0x1e0d6d][_0x1fac('0x27')]&&_0x28dd06['channels'][_0x1e0d6d][_0x1fac('0x28')]?_0x28dd06[_0x1fac('0x7')][_0x1e0d6d]['destlinkedid']:_0x1e0d6d;return RpcUser[_0x1fac('0x29')](_0x28dd06[_0x1fac('0x5')][_0x1c7f0d],_0x28a8fd,_0x86d387)[_0x1fac('0x1a')](function(_0x298205){_0x28dd06[_0x1fac('0x4')][_0x1985fa][_0x1fac('0x2a')]-=0x1;_0x28dd06[_0x1fac('0x4')][_0x1985fa][_0x1fac('0x2b')]+=0x1;return _0x298205;});})['then'](function(_0xb995c8){if(_0x22ab17||!_0xb995c8){return;}_0x28dd06[_0x1fac('0x6')][_0x1c7f0d]={};logger[_0x1fac('0x1b')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x1e0d6d,_0x28dd06[_0x1fac('0x4')][_0x1985fa][_0x1fac('0x2c')],_0x1c7f0d,_0x1985fa);_0x28dd06[_0x1fac('0x6')][_0x1c7f0d][_0x1fac('0x18')]=setTimeout(_0x28dd06[_0x1fac('0x2d')]['bind'](_0x28dd06,_0x1c7f0d),_0x28dd06['voiceQueues'][_0x1985fa][_0x1fac('0x2c')]*0x3e8);_0x28dd06[_0x1fac('0x6')][_0x1c7f0d]['lastPauseAt']=moment()[_0x1fac('0x2e')](_0x1fac('0x2f'));_0x28dd06[_0x1fac('0x6')][_0x1c7f0d]['uniqueid']=_0x1e0d6d;_0x28dd06['timers'][_0x1c7f0d][_0x1fac('0x22')]=_0x1985fa;_0x28dd06[_0x1fac('0x6')][_0x1c7f0d][_0x1fac('0x17')]=_0x28dd06[_0x1fac('0x17')]['bind'](_0x28dd06,_0x1c7f0d,_0x1e0d6d);});}})[_0x1fac('0x1d')](function(){logger['error'](_0x1fac('0x30'),_0x1e0d6d,_0x28dd06[_0x1fac('0x4')][_0x1985fa][_0x1fac('0x2c')],_0x1c7f0d,_0x1985fa);})[_0x1fac('0x20')](function(){delete _0x28dd06[_0x1fac('0x7')][_0x1e0d6d];});}catch(_0x3aa5ed){logger[_0x1fac('0x1e')](_0x1fac('0x31'),_0x3aa5ed[_0x1fac('0x32')]);}};Acw[_0x1fac('0x33')]['stopAcw']=function(_0x38402d){try{var _0x58d245=this;if(_0x58d245['timers'][_0x38402d]){_0x58d245[_0x1fac('0x6')][_0x38402d][_0x1fac('0x18')]=![];var _0x3ca1b0=_0x58d245['timers'][_0x38402d][_0x1fac('0x19')];var _0x1568a6=_0x58d245[_0x1fac('0x6')][_0x38402d][_0x1fac('0x22')];var _0x1d1e80=_0x58d245[_0x1fac('0x4')][_0x1568a6][_0x1fac('0x2c')];logger['info'](_0x1fac('0x34'),_0x3ca1b0,_0x38402d);RpcUser[_0x1fac('0x35')](this[_0x1fac('0x5')][_0x38402d]['id'])[_0x1fac('0x1a')](function(_0x4a0322){if(_0x4a0322['pauseType']===_0x1fac('0x23')){return RpcUser[_0x1fac('0x36')](_0x58d245[_0x1fac('0x5')][_0x38402d]);}});RpcVoiceAgentReport[_0x1fac('0x37')]({'acwtime':_0x1d1e80,'agentacw':!![]},_0x3ca1b0,_0x38402d)[_0x1fac('0x1a')](function(_0x5b996d){logger[_0x1fac('0x1b')](_0x1fac('0x1c'),_0x3ca1b0,_0x1d1e80,_0x5b996d);})[_0x1fac('0x1d')](function(_0x295ef4){logger[_0x1fac('0x1e')]('[%s][UPDATE][ERRORS:%s]',_0x3ca1b0,_0x295ef4);});}else{logger[_0x1fac('0x1e')](_0x1fac('0x38'),_0x38402d);if(_0x58d245['timers']){logger['info'](_0x1fac('0x39'),JSON[_0x1fac('0x3a')](_0x58d245[_0x1fac('0x6')]));}}}catch(_0x2fc2b0){logger[_0x1fac('0x1e')](_0x1fac('0x3b'),_0x2fc2b0[_0x1fac('0x32')]);}};Acw['prototype'][_0x1fac('0x3c')]=function(_0x22fed3){try{if(this[_0x1fac('0x4')][_0x22fed3['queue']]&&(this[_0x1fac('0x4')][_0x22fed3[_0x1fac('0x22')]][_0x1fac('0x2')]||this[_0x1fac('0x4')][_0x22fed3[_0x1fac('0x22')]][_0x1fac('0x3d')])){if(this[_0x1fac('0x5')][_0x22fed3[_0x1fac('0x3e')]]){this[_0x1fac('0x7')][_0x22fed3[_0x1fac('0x19')]]={'queue':_0x22fed3[_0x1fac('0x22')],'interface':_0x22fed3[_0x1fac('0x3e')],'destlinkedid':_0x22fed3[_0x1fac('0x28')]};}}}catch(_0x376aba){logger[_0x1fac('0x1e')](_0x1fac('0x3f'),_0x376aba[_0x1fac('0x32')]);}};Acw['prototype'][_0x1fac('0x13')]=function(_0x4a9b21){try{if(this['voiceQueues'][_0x4a9b21[_0x1fac('0x22')]]&&(this['voiceQueues'][_0x4a9b21[_0x1fac('0x22')]]['acw']||this['voiceQueues'][_0x4a9b21['queue']]['mandatoryDisposition'])){if(this[_0x1fac('0x5')][_0x4a9b21['interface']]){this[_0x1fac('0x7')][_0x4a9b21[_0x1fac('0x19')]]={'queue':_0x4a9b21[_0x1fac('0x22')],'interface':_0x4a9b21[_0x1fac('0x3e')]};}}}catch(_0x46c42d){logger[_0x1fac('0x1e')](_0x1fac('0x40'),_0x46c42d[_0x1fac('0x32')]);}};Acw['prototype'][_0x1fac('0xa')]=function(_0x117131){try{if(this[_0x1fac('0x7')][_0x117131[_0x1fac('0x19')]]&&_[_0x1fac('0x41')](this[_0x1fac('0x7')][_0x117131['uniqueid']][_0x1fac('0x27')])){logger[_0x1fac('0x1b')](_0x1fac('0x42'),_0x117131[_0x1fac('0x19')]);this[_0x1fac('0x21')](_0x117131[_0x1fac('0x19')]);}else if(this[_0x1fac('0x7')][_0x117131[_0x1fac('0x43')]]&&_[_0x1fac('0x41')](this[_0x1fac('0x7')][_0x117131[_0x1fac('0x43')]][_0x1fac('0x27')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x117131[_0x1fac('0x43')]);this[_0x1fac('0x21')](_0x117131[_0x1fac('0x43')]);}}catch(_0x46b871){logger[_0x1fac('0x1e')](_0x1fac('0x44'),_0x46b871[_0x1fac('0x32')]);}};Acw['prototype'][_0x1fac('0xc')]=function(_0x4b33e7){try{if(this[_0x1fac('0x7')][_0x4b33e7['uniqueid']]&&this['channels'][_0x4b33e7['uniqueid']][_0x1fac('0x27')]){logger[_0x1fac('0x1b')](_0x1fac('0x45'),_0x4b33e7['uniqueid']);this[_0x1fac('0x21')](_0x4b33e7[_0x1fac('0x19')]);}else if(this[_0x1fac('0x7')][_0x4b33e7[_0x1fac('0x43')]]&&this[_0x1fac('0x7')][_0x4b33e7[_0x1fac('0x43')]][_0x1fac('0x27')]){logger[_0x1fac('0x1b')](_0x1fac('0x46'),_0x4b33e7['linkedid']);this[_0x1fac('0x21')](_0x4b33e7[_0x1fac('0x43')]);}}catch(_0x40e511){logger[_0x1fac('0x1e')](_0x1fac('0x47'),_0x40e511[_0x1fac('0x32')]);}};Acw[_0x1fac('0x33')][_0x1fac('0xf')]=function(_0x48ea5c){try{if(!_[_0x1fac('0x48')](this[_0x1fac('0x7')][_0x48ea5c[_0x1fac('0x49')]])){this[_0x1fac('0x21')](_0x48ea5c[_0x1fac('0x49')]);if(this[_0x1fac('0x7')][_0x48ea5c[_0x1fac('0x4a')]]){this['channels'][_0x48ea5c[_0x1fac('0x4a')]][_0x1fac('0x27')]=!![];this['channels'][_0x48ea5c[_0x1fac('0x4b')]]=this[_0x1fac('0x7')][_0x48ea5c[_0x1fac('0x4a')]];delete this[_0x1fac('0x7')][_0x48ea5c[_0x1fac('0x4a')]];}}else if(!_[_0x1fac('0x48')](this[_0x1fac('0x7')][_0x48ea5c[_0x1fac('0x4b')]])){this[_0x1fac('0x21')](_0x48ea5c['transfertargetuniqueid']);if(this['channels'][_0x48ea5c[_0x1fac('0x4c')]]){this[_0x1fac('0x7')][_0x48ea5c[_0x1fac('0x4c')]][_0x1fac('0x27')]=!![];this[_0x1fac('0x7')][_0x48ea5c['transfereeuniqueid']]=this[_0x1fac('0x7')][_0x48ea5c[_0x1fac('0x4c')]];delete this[_0x1fac('0x7')][_0x48ea5c[_0x1fac('0x4c')]];}}}catch(_0x5ddea1){logger[_0x1fac('0x1e')](_0x1fac('0x4d'),_0x5ddea1[_0x1fac('0x32')]);}};Acw[_0x1fac('0x33')][_0x1fac('0x11')]=function(_0x1edcc4){try{if(this['channels'][_0x1edcc4[_0x1fac('0x4e')]]){logger[_0x1fac('0x1b')](_0x1fac('0x4f'),JSON[_0x1fac('0x3a')](_0x1edcc4['transfereruniqueid']));this['startAcw'](_0x1edcc4['transfereruniqueid']);}else if(this[_0x1fac('0x7')][_0x1edcc4[_0x1fac('0x50')]]){logger[_0x1fac('0x1b')](_0x1fac('0x51'),JSON[_0x1fac('0x3a')](_0x1edcc4[_0x1fac('0x50')]));this[_0x1fac('0x21')](_0x1edcc4[_0x1fac('0x50')]);}}catch(_0x235a99){logger[_0x1fac('0x1e')](_0x1fac('0x52'),_0x235a99[_0x1fac('0x32')]);}};Acw['prototype'][_0x1fac('0xd')]=function(_0xab5cea){try{if(this['voiceQueues'][_0xab5cea[_0x1fac('0x22')]]&&this[_0x1fac('0x4')][_0xab5cea[_0x1fac('0x22')]][_0x1fac('0x53')]===_0x1fac('0x54')){if(this[_0x1fac('0x5')][_0xab5cea[_0x1fac('0x3e')]]){logger[_0x1fac('0x1b')](_0x1fac('0x55'),_0xab5cea[_0x1fac('0x19')],_0xab5cea[_0x1fac('0x3e')],_0xab5cea[_0x1fac('0x22')]);return RpcUser['savePause'](this[_0x1fac('0x5')][_0xab5cea[_0x1fac('0x3e')]],_0x1fac('0x56'),_0xab5cea[_0x1fac('0x19')]);}}}catch(_0x1bca72){logger[_0x1fac('0x1e')](_0x1fac('0x57'),_0x1bca72[_0x1fac('0x32')]);}};module[_0x1fac('0x58')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 16dbbc6..792380f 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 _0xc0f0=['Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','catch','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown'];(function(_0x1f5268,_0x513614){var _0x3532ef=function(_0xdf8826){while(--_0xdf8826){_0x1f5268['push'](_0x1f5268['shift']());}};_0x3532ef(++_0x513614);}(_0xc0f0,0x1e0));var _0x0c0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0f0[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require(_0x0c0f('0x0'));var BPromise=require(_0x0c0f('0x1'));var util=require('util');var logger=require(_0x0c0f('0x2'))(_0x0c0f('0x3'));var config=require(_0x0c0f('0x4'));var ami=new Manager(config[_0x0c0f('0x5')]['port'],config[_0x0c0f('0x5')]['ip'],config[_0x0c0f('0x5')]['username'],config[_0x0c0f('0x5')]['password'],!![]);ami['keepConnected']();ami['Action']=BPromise['promisify'](ami[_0x0c0f('0x6')]);function error(_0x20342d){logger[_0x0c0f('0x7')](util[_0x0c0f('0x8')](_0x0c0f('0x9'),config['asterisk']['username'],config[_0x0c0f('0x5')]['ip'],config[_0x0c0f('0x5')][_0x0c0f('0xa')],util[_0x0c0f('0xb')](_0x20342d,![],null)));}function close(){logger['error'](util[_0x0c0f('0x8')](_0x0c0f('0xc'),config[_0x0c0f('0x5')][_0x0c0f('0xd')],config['asterisk']['ip'],config['asterisk'][_0x0c0f('0xa')]));}ami[_0x0c0f('0xe')]=function(){return function(){return ami[_0x0c0f('0xf')]({'action':_0x0c0f('0x10')});};};ami[_0x0c0f('0x11')]=function(){return function(){return ami['Action']({'action':_0x0c0f('0x12')});};};ami[_0x0c0f('0x13')]=function(){return function(){return ami[_0x0c0f('0xf')]({'action':_0x0c0f('0x14')});};};ami[_0x0c0f('0x15')]=function(){return function(){return ami[_0x0c0f('0xf')]({'action':_0x0c0f('0x16')});};};ami[_0x0c0f('0x17')]=function(){return function(){return ami[_0x0c0f('0xf')]({'action':_0x0c0f('0x18')});};};function connect(){logger[_0x0c0f('0x19')](util['format'](_0x0c0f('0x1a'),config['asterisk'][_0x0c0f('0xd')],config[_0x0c0f('0x5')]['ip'],config[_0x0c0f('0x5')][_0x0c0f('0xa')]));ami[_0x0c0f('0x1b')]('error',error);ami[_0x0c0f('0x1b')](_0x0c0f('0x1c'),close);}ami['on']('connect',connect);ami['on'](_0x0c0f('0x1d'),function(_0x3334f9){logger[_0x0c0f('0x19')](util[_0x0c0f('0x8')](_0x0c0f('0x1e'),config[_0x0c0f('0x5')][_0x0c0f('0xd')],config['asterisk']['ip'],config[_0x0c0f('0x5')][_0x0c0f('0xa')],util[_0x0c0f('0xb')](_0x3334f9,![],null)));});ami['on']('fullybooted',function(){logger[_0x0c0f('0x19')](util[_0x0c0f('0x8')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0c0f('0x5')][_0x0c0f('0xd')],config['asterisk']['ip'],config[_0x0c0f('0x5')]['port']));return Promise['resolve']()[_0x0c0f('0x1f')](ami[_0x0c0f('0xe')]())[_0x0c0f('0x1f')](ami[_0x0c0f('0x11')]())[_0x0c0f('0x1f')](ami[_0x0c0f('0x13')]())[_0x0c0f('0x1f')](ami[_0x0c0f('0x15')]())[_0x0c0f('0x1f')](ami['actionCoreShowChannels']())[_0x0c0f('0x20')](function(_0x493efb){logger['error']('[ami.js][fullybooted]',util[_0x0c0f('0xb')](_0x493efb,{'showHidden':![],'depth':null}));});});ami[_0x0c0f('0x1b')]('error',error);ami['once'](_0x0c0f('0x1c'),close);module[_0x0c0f('0x21')]=ami; \ No newline at end of file +var _0x44fd=['catch','exports','asterisk-manager','bluebird','util','../../config/environment','asterisk','username','Action','action','format','port','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','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','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44fd,0x183));var _0xd44f=function(_0x40a77f,_0x1d5f8d){_0x40a77f=_0x40a77f-0x0;var _0x415aa1=_0x44fd[_0x40a77f];return _0x415aa1;};'use strict';var Manager=require(_0xd44f('0x0'));var BPromise=require(_0xd44f('0x1'));var util=require(_0xd44f('0x2'));var logger=require('../../config/logger')('ami');var config=require(_0xd44f('0x3'));var ami=new Manager(config['asterisk']['port'],config[_0xd44f('0x4')]['ip'],config[_0xd44f('0x4')][_0xd44f('0x5')],config[_0xd44f('0x4')]['password'],!![]);ami['keepConnected']();ami[_0xd44f('0x6')]=BPromise['promisify'](ami[_0xd44f('0x7')]);function error(_0x45ec64){logger['error'](util[_0xd44f('0x8')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xd44f('0x5')],config[_0xd44f('0x4')]['ip'],config[_0xd44f('0x4')][_0xd44f('0x9')],util[_0xd44f('0xa')](_0x45ec64,![],null)));}function close(){logger[_0xd44f('0xb')](util[_0xd44f('0x8')](_0xd44f('0xc'),config[_0xd44f('0x4')][_0xd44f('0x5')],config[_0xd44f('0x4')]['ip'],config[_0xd44f('0x4')][_0xd44f('0x9')]));}ami[_0xd44f('0xd')]=function(){return function(){return ami[_0xd44f('0x6')]({'action':_0xd44f('0xe')});};};ami[_0xd44f('0xf')]=function(){return function(){return ami['Action']({'action':_0xd44f('0x10')});};};ami[_0xd44f('0x11')]=function(){return function(){return ami['Action']({'action':_0xd44f('0x12')});};};ami[_0xd44f('0x13')]=function(){return function(){return ami[_0xd44f('0x6')]({'action':_0xd44f('0x14')});};};ami[_0xd44f('0x15')]=function(){return function(){return ami[_0xd44f('0x6')]({'action':_0xd44f('0x16')});};};function connect(){logger[_0xd44f('0x17')](util[_0xd44f('0x8')](_0xd44f('0x18'),config[_0xd44f('0x4')][_0xd44f('0x5')],config[_0xd44f('0x4')]['ip'],config[_0xd44f('0x4')][_0xd44f('0x9')]));ami[_0xd44f('0x19')]('error',error);ami[_0xd44f('0x19')](_0xd44f('0x1a'),close);}ami['on'](_0xd44f('0x1b'),connect);ami['on'](_0xd44f('0x1c'),function(_0x3d7b4c){logger[_0xd44f('0x17')](util['format'](_0xd44f('0x1d'),config[_0xd44f('0x4')][_0xd44f('0x5')],config[_0xd44f('0x4')]['ip'],config[_0xd44f('0x4')]['port'],util['inspect'](_0x3d7b4c,![],null)));});ami['on'](_0xd44f('0x1e'),function(){logger[_0xd44f('0x17')](util[_0xd44f('0x8')](_0xd44f('0x1f'),config['asterisk'][_0xd44f('0x5')],config['asterisk']['ip'],config[_0xd44f('0x4')][_0xd44f('0x9')]));return Promise['resolve']()['then'](ami[_0xd44f('0xd')]())['then'](ami[_0xd44f('0xf')]())[_0xd44f('0x20')](ami[_0xd44f('0x11')]())[_0xd44f('0x20')](ami[_0xd44f('0x13')]())[_0xd44f('0x20')](ami[_0xd44f('0x15')]())[_0xd44f('0x21')](function(_0x40128b){logger[_0xd44f('0xb')]('[ami.js][fullybooted]',util['inspect'](_0x40128b,{'showHidden':![],'depth':null}));});});ami[_0xd44f('0x19')]('error',error);ami[_0xd44f('0x19')](_0xd44f('0x1a'),close);module[_0xd44f('0x22')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 14c68da..ffbadc5 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 _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x4bf29c,_0x3d437b){var _0x87e844=function(_0x3f856d){while(--_0x3f856d){_0x4bf29c['push'](_0x4bf29c['shift']());}};_0x87e844(++_0x3d437b);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x16de43,_0x2bb75f){_0x16de43=_0x16de43-0x0;var _0x2aaa5d=_0xbdb7[_0x16de43];return _0x2aaa5d;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file +var _0xd8b0=['message','result','catch','exports','jayson/promise','bluebird','http','Request','then','debug','memberReport','error','rpc'];(function(_0xe513fe,_0x5756a1){var _0x3a07c2=function(_0x9ff7d4){while(--_0x9ff7d4){_0xe513fe['push'](_0xe513fe['shift']());}};_0x3a07c2(++_0x5756a1);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var jayson=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('ami');var client=jayson['client'][_0x0d8b('0x2')]({'port':0x2329});client[_0x0d8b('0x3')]=function(_0x43bca1,_0x364286){return new BPromise(function(_0x8196ed,_0x577834){return client['request'](_0x43bca1,_0x364286)[_0x0d8b('0x4')](function(_0x227c63){logger[_0x0d8b('0x5')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x364286,_0x227c63);if(_0x227c63[_0x0d8b('0x7')]){logger['error'](_0x0d8b('0x8'),_0x0d8b('0x6'),_0x43bca1,_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')],_0x364286);return _0x577834(_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')]);}else{return _0x8196ed(_0x227c63[_0x0d8b('0xa')]);}})[_0x0d8b('0xb')](function(_0x48fa16){logger[_0x0d8b('0x7')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x48fa16,_0x364286);return _0x577834(_0x48fa16);});});};module[_0x0d8b('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 26573f4..855541b 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 _0xd655=['outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','name','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','starttime','stringify','pick','queueStatusComplete','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','campaign:ivr:%s','sendMessageOneNotActive','originated','INACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','ifTime','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','isArray','length','push','Action','command','iftime\x20%s,%s','interval','indexOf','true','catch','content','all','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Failure','Global:\x20','syncCampaigns','isIVRCampaign','resolve','checkIfTime','dialTimezone','launchHandleIvr','dialMethod','handlePower','power','booked','Queue','method\x20not\x20recognized','dialGlobalInterval','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_INTERVAL','\x20Interval\x20is\x20overtime:\x20','isGlobal','AMI\x20IfTime','[ifTime][Action]','voiceQueues','queue','uniqueid','ivr','YYYY-MM-DD\x20HH:mm:ss','type','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','droptime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','countdropretry','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','callAdditionalPhoneAfterMin','countabandonedretry','add','dialAbandonedRetryFrequency','Abandoned','channel','actionid','rrmemory','isNil','locked','stateinterface','idHopper','paused','strategy','roundrobin','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','outboundAnswerAgiCallsDay','countmachineretry','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','[syncAgentComplete][createHistory][0]','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','cause-txt','Normal\x20Clearing','Unknow','queuesSummary','running','statusMessage','available','inUse','talking','ACTIVE','checkDialMethod','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','throttle','filter','online','handlePreviewRecallNotifications','user:%s','clearZombieChannels','[uniqueid]','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','callerid','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','object','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','reason','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','congestion','[syncAgentComplete][createHistory][8]','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','outboundUnknownCallsDay','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','dialPredictiveInterval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','dialPredictiveOptimization','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','getSeconds','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','handleIvr','limitCalls','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','getContactDialer','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','checkIsBlackList','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','util','lodash','uuid','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','emit'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0xd655,0x1ca));var _0x5d65=function(_0x257495,_0x18269b){_0x257495=_0x257495-0x0;var _0x3849aa=_0xd655[_0x257495];return _0x3849aa;};'use strict';var util=require(_0x5d65('0x0'));var _=require(_0x5d65('0x1'));var uuid=require(_0x5d65('0x2'));var moment=require('moment');var rr=require('rr');var Redis=require(_0x5d65('0x3'));var utils=require(_0x5d65('0x4'));var hopperUtils=require('./utils/hopper');var ut=require(_0x5d65('0x5'));var config=require(_0x5d65('0x6'));var logger=require(_0x5d65('0x7'))(_0x5d65('0x8'));var loggerBooked=require(_0x5d65('0x7'))('booked');var loggerPredictive=require(_0x5d65('0x7'))(_0x5d65('0x9'));var loggerPredictiveCalls=require(_0x5d65('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x5d65('0x7'))(_0x5d65('0xa'));var ami=require(_0x5d65('0xb'));config[_0x5d65('0xc')]=_['defaults'](config[_0x5d65('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x5d65('0xd'))(new Redis(config[_0x5d65('0xc')]));var cmHopper=require(_0x5d65('0xe'));var voiceQueueRt=require(_0x5d65('0xf'));var RpcSetting=require(_0x5d65('0x10'));var Interval=require('../rpc/interval');var Action=require(_0x5d65('0x11'));var History=require(_0x5d65('0x12'));var Final=require(_0x5d65('0x13'));var AgentComplete=require(_0x5d65('0x14'));var QueueCallerAbandon=require(_0x5d65('0x15'));var Hangup=require('./models/hangup');var ipAgi=process[_0x5d65('0x16')][_0x5d65('0x17')]||_0x5d65('0x18');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x5d65('0x19')][_0x5d65('0x1a')]=function(_0x54b8ef){this[_0x5d65('0x1b')]=this[_0x5d65('0x1b')]?this[_0x5d65('0x1b')][_0x5d65('0x1c')](_0x54b8ef):_0x54b8ef();};function Dialer(_0x21e225,_0x509743){this[_0x5d65('0x1d')]=new Sequence();this[_0x5d65('0x1e')]=_0x509743;this['voiceQueues']=_0x21e225['voiceQueues'];this[_0x5d65('0x1f')]=_0x21e225[_0x5d65('0x1f')];this[_0x5d65('0x20')]=_0x21e225[_0x5d65('0x20')];this[_0x5d65('0x21')]=_0x21e225[_0x5d65('0x21')];this[_0x5d65('0x22')]=config['maxNumberOriginate']||0x2;this[_0x5d65('0x23')]={};this[_0x5d65('0x24')]={};this[_0x5d65('0x25')]={};this[_0x5d65('0x26')]={};this[_0x5d65('0x27')]={};this[_0x5d65('0x28')]={};this[_0x5d65('0x29')]={};this[_0x5d65('0x2a')]={};this[_0x5d65('0x2b')]={};this[_0x5d65('0x2c')]={};this['queuesSummary']={};ami['on'](_0x5d65('0x2d'),this[_0x5d65('0x2e')][_0x5d65('0x2f')](this));ami['on']('queuecallerabandon',this[_0x5d65('0x30')][_0x5d65('0x2f')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x5d65('0x2f')](this));ami['on'](_0x5d65('0x31'),this[_0x5d65('0x32')]['bind'](this));ami['on']('custom:queuesummary',this[_0x5d65('0xa')]['bind'](this));ami['on'](_0x5d65('0x33'),this[_0x5d65('0x34')][_0x5d65('0x2f')](this));ami['on'](_0x5d65('0x35'),this[_0x5d65('0x36')]['bind'](this));ami['on'](_0x5d65('0x37'),this[_0x5d65('0x38')]['bind'](this));ami['on'](_0x5d65('0x39'),this[_0x5d65('0x3a')]['bind'](this));ami['on'](_0x5d65('0x3b'),this[_0x5d65('0x3c')]['bind'](this));ami['on'](_0x5d65('0x3d'),this[_0x5d65('0x3e')]['bind'](this));this[_0x5d65('0x3f')]();this[_0x5d65('0x40')]();RpcSetting[_0x5d65('0x41')]()[_0x5d65('0x42')](function(_0x4e6a16){previewRecallmeReminderInterval=_0x4e6a16['previewRecallmeReminderInterval'];});}function isNotNull(_0x365d72){return _0x365d72!==null&&!_[_0x5d65('0x43')](_0x365d72);}function msgResponse(_0x31f6a5,_0x207363,_0x2b67fa){return{'action':_0x31f6a5,'response':_0x207363,'message':_0x2b67fa,'stack':_0x2b67fa};}function emit(_0x41cebd,_0x1f0575,_0x1eb2ec){io['to'](_0x41cebd)[_0x5d65('0x44')](_0x1f0575,_0x1eb2ec);}function emitOutboundVoiceQueueSummary(_0x4cfc84){if(_0x4cfc84['type']===_0x5d65('0x45')){logger[_0x5d65('0x46')](_0x5d65('0x47'),util[_0x5d65('0x48')](_0x4cfc84,{'showHidden':![],'depth':null}));emit(util[_0x5d65('0x49')]('voice:queue:%s',_0x4cfc84[_0x5d65('0x4a')]),_0x5d65('0x4b'),_0x4cfc84);}}function checkGetDataPredictive(_0x403d76){if(isNotNull(_0x403d76)&&!_[_0x5d65('0x4c')](_0x403d76)){loggerPredictive['info'](_0x5d65('0x4d'));loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x4f'),_0x403d76[_0x5d65('0x50')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x403d76[_0x5d65('0x51')]);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x52'),_0x403d76[_0x5d65('0x53')]);loggerPredictive['info'](_0x5d65('0x54'),_0x403d76[_0x5d65('0x55')]);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x56'),_0x403d76['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x5d65('0x4e')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x403d76[_0x5d65('0x57')]);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x58'));if(_0x403d76[_0x5d65('0x50')]>0x0){if(!_['isUndefined'](_0x403d76[_0x5d65('0x57')])&&_0x403d76[_0x5d65('0x57')]>0x0){return!![];}loggerPredictive['info'](_0x5d65('0x59'));if(!_[_0x5d65('0x43')](_0x403d76['predictiveIntervalAvgHoldtime'])&&_0x403d76[_0x5d65('0x5a')]>0x0){return!![];}loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x5b'));}else{loggerPredictive['info'](_0x5d65('0x5c'));}}else{loggerPredictive[_0x5d65('0x4e')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x25b93b){return function(_0x44a3d2){loggerPredictive[_0x5d65('0x4e')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x5d65('0x4e')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44a3d2[_0x5d65('0x5d')]);loggerPredictive[_0x5d65('0x4e')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44a3d2[_0x5d65('0x5e')]);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x5f'),_0x44a3d2[_0x5d65('0x60')]);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x61'),_0x44a3d2['erlangBusyFactor']);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x5f'),_0x44a3d2['erlangAbandonmentRate']);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x58'));_[_0x5d65('0x62')](_0x25b93b,_0x44a3d2);};}function ifInterval(_0x5416bf,_0x2c3cae){if(_[_0x5d65('0x43')](_0x2c3cae)){return![];}return utils['getSeconds'](undefined,_0x2c3cae)<_0x5416bf*0x3c;}function clearPredictiveAttributes(_0x32a2b1){if(_0x32a2b1[_0x5d65('0x29')]){_0x32a2b1[_0x5d65('0x29')]=undefined;loggerPredictive[_0x5d65('0x46')](_0x32a2b1[_0x5d65('0x4a')],_0x5d65('0x63'));}if(_0x32a2b1[_0x5d65('0x28')]){_0x32a2b1[_0x5d65('0x28')]=undefined;loggerPredictive[_0x5d65('0x46')](_0x32a2b1[_0x5d65('0x4a')],_0x5d65('0x64'));}if(_0x32a2b1[_0x5d65('0x65')]){clearInterval(_0x32a2b1['handlePredictive']);_0x32a2b1[_0x5d65('0x65')]=undefined;loggerPredictive['debug'](_0x32a2b1['name'],_0x5d65('0x66'));}}function loggerCatchPredictive(_0x1f514a,_0x3f27dc){return function(_0x2be936){loggerPredictive[_0x5d65('0x67')](_0x3f27dc[_0x5d65('0x4a')],_0x1f514a);loggerPredictive[_0x5d65('0x67')](_0x2be936[_0x5d65('0x68')]);clearPredictiveAttributes(_0x3f27dc);};}function loggerCatch(_0x3d6988){return function(_0x4efe6a){logger[_0x5d65('0x67')](_0x3d6988,util['inspect'](_0x4efe6a,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x538f9b,_0x4f15cd,_0x4d0ea9){return function(_0x180a54){utils[_0x5d65('0x69')](_0x4f15cd,_0x4d0ea9,0x0);_0x4f15cd[_0x5d65('0x6a')]=0x0;logger[_0x5d65('0x67')](_0x538f9b,util[_0x5d65('0x48')](_0x180a54,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x235160){return function(_0x199b5a){if(isNotNull(_0x199b5a)&&isNotNull(_0x199b5a[0x0])){if(_0x199b5a[0x0][_0x5d65('0x6b')]>0x0){_0x235160[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x6e')];logger[_0x5d65('0x4e')](_0x5d65('0x6f')+_0x235160['name'],_0x199b5a[0x0][_0x5d65('0x6b')],'contacts');}else{_0x235160[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x70')];logger[_0x5d65('0x4e')]('[getContactDialer2][Empty]'+_0x235160[_0x5d65('0x4a')]);}}};}function createObjHistory(_0x23eb6a,_0x54015a,_0x4e1695,_0x770aed,_0x510312){_0x23eb6a['message']=_0x4e1695;var _0x25da15=new Action(_0x23eb6a,_0x54015a);var _0x4d18cb=new History(_0x25da15);_0x4d18cb[_0x5d65('0x71')]=_0x770aed;_0x4d18cb[_0x5d65('0x72')]=_0x510312;_0x4d18cb[_0x5d65('0x73')]=_0x25da15[_0x5d65('0x74')];return _0x4d18cb;}function unlockQueueStatus(_0x1fd9b4,_0xf582f4){setTimeout(function(){if(_[_0x5d65('0x43')](_0x1fd9b4['queueStatusComplete'])){loggerBooked[_0x5d65('0x67')]('[unlockQueueStatus][undefined]',_0xf582f4);}_0x1fd9b4['queueStatusComplete']=!![];loggerBooked[_0x5d65('0x4e')]('[booked][unlockQueueStatus]',_0xf582f4,JSON[_0x5d65('0x75')](_[_0x5d65('0x76')](_0x1fd9b4,[_0x5d65('0x4a'),_0x5d65('0x77')])));},0x1f3);}function checkInterval(_0xc5621e){return function(){if(!isNotNull(_0xc5621e[_0x5d65('0x78')])){_0xc5621e['message']=utils[_0x5d65('0x6d')][_0x5d65('0x79')];throw _0xc5621e[_0x5d65('0x4a')]+_0x5d65('0x7a');}if(!isNotNull(_0xc5621e['Interval']['Intervals'])){_0xc5621e[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x79')];throw _0xc5621e[_0x5d65('0x4a')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x5d65('0x4c')](_0xc5621e['Interval'][_0x5d65('0x7b')]))){_0xc5621e[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')]['NULL_INTERVAL'];throw _0xc5621e['name']+_0x5d65('0x7a');}};}function checkIsIVRCampaignActive(_0x106f31){return function(){if(!utils[_0x5d65('0x7c')](_0x106f31)){_0x106f31[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')]['INACTIVE'];throw _0x106f31[_0x5d65('0x4a')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x42ef11){if(utils['isIVRCampaign'](_0x42ef11)){emit(util[_0x5d65('0x49')](_0x5d65('0x7d'),_0x42ef11[_0x5d65('0x4a')]),'campaign:save',_0x42ef11);}}function loggerCatchQueueSummary(_0x51f985,_0x2c1a82){return function(_0x4ab95a){clearPredictiveAttributes(_0x2c1a82);emitCampaignSummary(_0x2c1a82);loggerSyncQueueSummary[_0x5d65('0x46')](_0x51f985,util[_0x5d65('0x48')](_0x4ab95a,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x441dfa){if(_0x441dfa[_0x5d65('0x7e')]){if(_0x441dfa[_0x5d65('0x7f')]===0x0){_0x441dfa['sendMessageOneNotActive']=![];_0x441dfa[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x80')];loggerSyncQueueSummary[_0x5d65('0x46')](_0x5d65('0x81'),_0x441dfa[_0x5d65('0x4a')],_0x5d65('0x82'));}else{_0x441dfa[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x83')];loggerSyncQueueSummary[_0x5d65('0x46')](_0x5d65('0x81'),_0x441dfa[_0x5d65('0x4a')],_0x5d65('0x84'));}emitCampaignSummary(_0x441dfa);}}function myreject(_0x2d6361){return function(_0x562fc2){return _0x2d6361(msgResponse('[ifTime][Action]',_0x5d65('0x85'),JSON[_0x5d65('0x75')](_0x562fc2)));};}Dialer['prototype'][_0x5d65('0x86')]=function(_0x2e0aab){return!_[_0x5d65('0x43')](_0x2e0aab)&&_0x2e0aab&&!_[_0x5d65('0x43')](_0x2e0aab[_0x5d65('0x4a')])&&!_[_0x5d65('0x43')](_0x2e0aab['active'])&&_0x2e0aab[_0x5d65('0x87')]&&(this['trunks'][util['format'](_0x5d65('0x88'),_0x2e0aab[_0x5d65('0x4a')])][_0x5d65('0x89')]===_0x5d65('0x8a')||this[_0x5d65('0x21')][util[_0x5d65('0x49')](_0x5d65('0x88'),_0x2e0aab[_0x5d65('0x4a')])][_0x5d65('0x89')]===_0x5d65('0x8b'));};Dialer['prototype'][_0x5d65('0x8c')]=function(_0x2258ce){var _0xdff586=this;return function(){if(!_0xdff586[_0x5d65('0x86')](_0x2258ce[_0x5d65('0x8d')])){if(!_0xdff586['isTrunkReachable'](_0x2258ce[_0x5d65('0x8e')])){_0x2258ce[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x8f')];throw _0x2258ce[_0x5d65('0x4a')]+_0x5d65('0x90');}}};};Dialer[_0x5d65('0x19')]['checkIfTime']=function(_0xb1b5d9,_0x935893,_0xe0cabc,_0x2b8ae3){var _0x30c45c=this;return function(){var _0xd8f8e3=!![];return _0x30c45c[_0x5d65('0x91')](_0xb1b5d9,_0x935893,_0xe0cabc,_0x2b8ae3,_0xd8f8e3);};};Dialer['prototype'][_0x5d65('0x92')]=function(_0x32ccd9,_0x3a4d7e,_0x4b7295,_0x28137a){var _0x5e85f4=this;return function(){var _0x1a9724=![];return _0x5e85f4[_0x5d65('0x91')](_0x32ccd9[_0x5d65('0x7b')],_0x3a4d7e,_0x4b7295,_0x28137a,_0x1a9724);};};Dialer[_0x5d65('0x19')][_0x5d65('0x91')]=function(_0x2064c4,_0x30a2ce,_0x1a689a,_0x1ed2d0,_0x248d55){var _0x7e657e=[];return new Promise(function(_0x2a5f57,_0x561e66){if(!isNotNull(_0x2064c4)){_0x1ed2d0[_0x5d65('0x6c')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x561e66(msgResponse(_0x5d65('0x93'),'Failure',_0x1a689a+_0x5d65('0x94')));}if(_[_0x5d65('0x4c')](_0x2064c4)){_0x1ed2d0['message']=utils[_0x5d65('0x6d')][_0x5d65('0x95')];return _0x561e66(msgResponse('ifTime','Failure',_0x1a689a+_0x5d65('0x96')));}if(_0x30a2ce&&_['isUndefined'](config[_0x5d65('0x97')][_0x30a2ce])){_0x1ed2d0['message']=utils[_0x5d65('0x6d')]['UNKNOWN_TIMEZONE'];return _0x561e66(msgResponse('ifTime','Failure',_0x1a689a+'\x20Timezone\x20unknow\x20'+_0x30a2ce));}if(_[_0x5d65('0x98')](_0x2064c4)){for(var _0x1f9926=0x0;_0x1f9926<_0x2064c4[_0x5d65('0x99')];_0x1f9926+=0x1){_0x7e657e[_0x5d65('0x9a')](ami[_0x5d65('0x9b')]({'action':_0x5d65('0x9c'),'command':util[_0x5d65('0x49')](_0x5d65('0x9d'),_0x2064c4[_0x1f9926][_0x5d65('0x9e')],!_[_0x5d65('0x43')](config[_0x5d65('0x97')][_0x30a2ce])?_0x30a2ce:'')})['then'](function(_0x4770fb){return _0x4770fb['content'][_0x5d65('0x9f')](_0x5d65('0xa0'))>=0x0;})[_0x5d65('0xa1')](myreject(_0x561e66)));}}else{_0x7e657e[_0x5d65('0x9a')](ami[_0x5d65('0x9b')]({'action':_0x5d65('0x9c'),'command':util[_0x5d65('0x49')](_0x5d65('0x9d'),_0x2064c4,!_[_0x5d65('0x43')](config[_0x5d65('0x97')][_0x30a2ce])?_0x30a2ce:'')})[_0x5d65('0x42')](function(_0x5e5fd2){return _0x5e5fd2[_0x5d65('0xa2')][_0x5d65('0x9f')](_0x5d65('0xa0'))>=0x0;})[_0x5d65('0xa1')](myreject(_0x561e66)));}Promise[_0x5d65('0xa3')](_0x7e657e)[_0x5d65('0x42')](function(_0x6418df){var _0x2f9675=_['some'](_0x6418df);if(_0x2f9675){return _0x2a5f57(_0x2f9675);}else{_0x1ed2d0[_0x5d65('0x6c')]=_0x248d55?utils[_0x5d65('0x6d')][_0x5d65('0xa4')]:utils[_0x5d65('0x6d')]['OVERTIME_INTERVAL'];return _0x561e66(msgResponse(_0x5d65('0xa5'),_0x5d65('0xa6'),_0x5d65('0xa7')+_0x248d55+'\x20'+_0x1a689a+'\x20Interval\x20is\x20overtime:\x20'+util[_0x5d65('0x48')](_0x2064c4,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x30a2ce));}})[_0x5d65('0xa1')](function(_0x19b649){return _0x561e66(msgResponse(_0x5d65('0x93'),_0x5d65('0xa6'),JSON[_0x5d65('0x75')](_0x19b649)));});});};Dialer[_0x5d65('0x19')][_0x5d65('0x3f')]=function(){var _0x132dad=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0x5d65('0x42')](function(){setInterval(function(){_0x132dad[_0x5d65('0xa8')]();},0x3e8);});};Dialer[_0x5d65('0x19')][_0x5d65('0xa8')]=function(){var _0x4809dd=this;var _0xdc7453;for(var _0x31807e in this[_0x5d65('0x1f')]){if(typeof this[_0x5d65('0x1f')][_0x31807e]!=='undefined'){_0xdc7453=this[_0x5d65('0x1f')][_0x31807e];if(utils[_0x5d65('0xa9')](_0xdc7453)&&utils['isIVRCampaignActive'](_0xdc7453)){_0xdc7453[_0x5d65('0x7e')]=!![];Promise[_0x5d65('0xaa')]()[_0x5d65('0x42')](checkIsIVRCampaignActive(_0xdc7453))[_0x5d65('0x42')](checkInterval(_0xdc7453))[_0x5d65('0x42')](_0x4809dd[_0x5d65('0x8c')](_0xdc7453))[_0x5d65('0x42')](_0x4809dd[_0x5d65('0xab')](_0xdc7453['dialGlobalInterval'],_0xdc7453[_0x5d65('0xac')],_0xdc7453['name'],_0xdc7453))[_0x5d65('0x42')](_0x4809dd[_0x5d65('0x92')](_0xdc7453[_0x5d65('0x78')],_0xdc7453[_0x5d65('0xac')],_0xdc7453['name'],_0xdc7453))[_0x5d65('0x42')](_0x4809dd[_0x5d65('0xad')](_0xdc7453))[_0x5d65('0xa1')](loggerCatchQueueSummary('[syncCampaigns]',_0xdc7453));}else{notSendMessagesCampaign(_0xdc7453);}}}};Dialer['prototype']['checkDialMethod']=function(_0x16bb18){if(_0x16bb18['dialMethod']!==_0x5d65('0x9')){clearPredictiveAttributes(_0x16bb18);}switch(_0x16bb18[_0x5d65('0xae')]){case'progressive':this[_0x5d65('0xaf')](_0x16bb18,0x1);break;case _0x5d65('0xb0'):this[_0x5d65('0xaf')](_0x16bb18,_0x16bb18['dialPowerLevel']);break;case _0x5d65('0x9'):this[_0x5d65('0x9')](_0x16bb18);break;case _0x5d65('0xb1'):this['handlePower'](_0x16bb18,0x1);break;default:logger[_0x5d65('0x67')](_0x5d65('0xb2'),_0x16bb18['name'],_0x5d65('0xb3'));}};Dialer[_0x5d65('0x19')][_0x5d65('0x93')]=function(_0x4b5ea4,_0x183c95){var _0x5979f5=_0x4b5ea4[_0x5d65('0xac')];var _0x1236b=_0x183c95?_0x4b5ea4[_0x5d65('0xb4')]:_0x4b5ea4['Interval'][_0x5d65('0x7b')];logger[_0x5d65('0xb5')](_0x5d65('0xb6'),_0x1236b,_0x5979f5,_0x4b5ea4['name'],util[_0x5d65('0x49')](_0x5d65('0xb7'),_0x4b5ea4['name'],_0x4b5ea4['id']));var _0x4810c9=null;return Interval[_0x5d65('0xb8')](_0x1236b,_0x5979f5)['then'](function(_0x59d9c9){if(_0x59d9c9===!![]){return _0x59d9c9;}else{_0x4b5ea4[_0x5d65('0x6c')]=_0x183c95?utils[_0x5d65('0x6d')][_0x5d65('0xa4')]:utils['CAMPAIGN_STATUS'][_0x5d65('0xb9')];_0x4810c9=msgResponse('[ifTime][promiseAll]',_0x5d65('0xa6'),_0x5d65('0xa7')+_0x183c95+'\x20'+_0x4b5ea4[_0x5d65('0x4a')]+_0x5d65('0xba')+util[_0x5d65('0x48')](_0x1236b,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x5979f5);}if(_0x4810c9!==null){logger[_0x5d65('0xb5')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x4810c9);_0x4810c9[_0x5d65('0xbb')]=_0x183c95;throw _0x4810c9;}})['catch'](function(_0x4f64f5){logger[_0x5d65('0x67')](_0x5d65('0xbc'),_0x4f64f5);throw msgResponse(_0x5d65('0xbd'),_0x5d65('0x85'),util[_0x5d65('0x48')](_0x4f64f5,{'showHidden':![],'depth':null}));});};Dialer[_0x5d65('0x19')][_0x5d65('0x2e')]=function(_0x3f4470){if(this[_0x5d65('0xbe')][_0x3f4470[_0x5d65('0xbf')]]){if(this[_0x5d65('0x26')][_0x3f4470[_0x5d65('0xc0')]]&&this['uniqueId'][_0x3f4470[_0x5d65('0xc0')]]['type']!==_0x5d65('0xc1')){this['updateOriginated'](this[_0x5d65('0xbe')][_0x3f4470[_0x5d65('0xbf')]]);this[_0x5d65('0x26')][_0x3f4470[_0x5d65('0xc0')]]['answertime']=moment()[_0x5d65('0x49')](_0x5d65('0xc2'));}}};Dialer[_0x5d65('0x19')][_0x5d65('0x32')]=function(_0x31731f){var _0x7277=this[_0x5d65('0x26')][_0x31731f[_0x5d65('0xc0')]];if(this[_0x5d65('0xbe')][_0x31731f['queue']]){if(_0x7277&&_0x7277[_0x5d65('0xc3')]!=='ivr'){delete this['uniqueId'][_0x31731f['uniqueid']];this[_0x5d65('0xbe')][_0x31731f['queue']][_0x5d65('0xc4')]+=0x1;var _0x2656b2=new AgentComplete(_0x7277,_0x31731f);if(_0x31731f['reason']===_0x5d65('0xc5')){_0x2656b2[_0x5d65('0xc6')]=this['voiceQueues'][_0x31731f['queue']][_0x5d65('0xc7')]&&this['voiceQueues'][_0x31731f[_0x5d65('0xbf')]][_0x5d65('0xc8')]?moment()[_0x5d65('0x49')](_0x5d65('0xc2')):undefined;}hopperUtils[_0x5d65('0xc9')](_0x2656b2)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xca')));hopperUtils[_0x5d65('0xcb')](_0x2656b2)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xcc')));}}};Dialer[_0x5d65('0x19')][_0x5d65('0x30')]=function(_0x27ec40){var _0x44b613=this[_0x5d65('0x26')][_0x27ec40['uniqueid']];var _0x4845a7=this;var _0x40a955=![];var _0x5988cd;var _0x590bad;if(this[_0x5d65('0xbe')][_0x27ec40['queue']]){if(_0x44b613&&_0x44b613['type']!==_0x5d65('0xc1')){delete this[_0x5d65('0x26')][_0x27ec40['uniqueid']];this[_0x5d65('0xcd')](this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]]);_0x44b613['droptime']=moment()['format'](_0x5d65('0xc2'));var _0x8dce99=new QueueCallerAbandon(_0x44b613,_0x27ec40);if(utils['getSeconds'](_0x44b613[_0x5d65('0xce')],_0x44b613['responsetime'])>=_0x44b613['dialQueueTimeout']){this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0x53')]+=0x1;this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xcf')]+=0x1;this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xd0')]+=0x1;_0x8dce99[_0x5d65('0x71')]=0xa;_0x8dce99[_0x5d65('0x72')]='Drop';_0x8dce99[_0x5d65('0xd1')]='TIMEOUT';_0x8dce99[_0x5d65('0xc6')]=this['voiceQueues'][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xc7')]?moment()[_0x5d65('0x49')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x8dce99['countdropretry']+=0x1;_0x8dce99[_0x5d65('0xd2')]+=0x1;_0x5988cd=this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xd3')];_0x590bad=this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x5d65('0xd4')](_0x8dce99,_0x8dce99[_0x5d65('0x71')],_0x44b613[_0x5d65('0xd5')])[_0x5d65('0x42')](function(_0x27c42c){_0x40a955=_0x27c42c[_0x5d65('0xd6')]==0x1;if(_0x8dce99['countdropretry']>=_0x4845a7[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]]['dialDropMaxRetry']){_0x4845a7[_0x5d65('0xd7')](_0x8dce99,_0x27c42c['additional']);}else{hopperUtils[_0x5d65('0xd8')]({'active':![],'countdropretry':_0x8dce99[_0x5d65('0xd9')],'scheduledat':moment()['add'](_0x4845a7['voiceQueues'][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xd3')],_0x5d65('0xda'))[_0x5d65('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x44b613[_0x5d65('0xdb')],'ListId':_0x44b613[_0x5d65('0xdc')],'VoiceQueueId':_0x44b613[_0x5d65('0xdd')]||undefined,'CampaignId':_0x44b613[_0x5d65('0xde')]||undefined})['catch'](loggerCatch(_0x5d65('0xdf')));var _0x192ba2=new History(_0x8dce99);_0x192ba2['state']=0xa;_0x192ba2['statedesc']=_0x5d65('0xe0');_0x192ba2['starttime']=moment()[_0x5d65('0x49')](_0x5d65('0xc2'));_0x192ba2['endtime']=_0x192ba2[_0x5d65('0x74')];_0x192ba2[_0x5d65('0xe1')]=_0x8dce99[_0x5d65('0xe1')];_0x192ba2[_0x5d65('0xe2')]=_0x8dce99[_0x5d65('0xe2')];hopperUtils[_0x5d65('0xc9')](_0x192ba2)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xe3')));}})[_0x5d65('0x42')](function(){if(_0x40a955)hopperUtils[_0x5d65('0xe4')](_0x8dce99,_0x5988cd,_0x590bad)[_0x5d65('0x42')](function(){return 0x1;});});}else{this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xe5')]+=0x1;_0x8dce99[_0x5d65('0x71')]=0xb;_0x8dce99[_0x5d65('0x72')]='Abandoned';_0x8dce99[_0x5d65('0xd1')]='CALLEREXIT';_0x8dce99['countabandonedretry']+=0x1;_0x8dce99[_0x5d65('0xd2')]+=0x1;_0x5988cd=this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]]['dialAbandonedRetryFrequency'];_0x590bad=this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xe6')];hopperUtils[_0x5d65('0xd4')](_0x8dce99,_0x8dce99[_0x5d65('0x71')],_0x44b613[_0x5d65('0xd5')])[_0x5d65('0x42')](function(_0x5a71b8){if(_0x8dce99['countabandonedretry']>=_0x4845a7[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]]['dialAbandonedMaxRetry']){_0x4845a7[_0x5d65('0xd7')](_0x8dce99,_0x5a71b8[_0x5d65('0xd6')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x8dce99[_0x5d65('0xe7')],'scheduledat':moment()[_0x5d65('0xe8')](_0x4845a7[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xe9')],_0x5d65('0xda'))[_0x5d65('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x44b613[_0x5d65('0xdb')],'ListId':_0x44b613[_0x5d65('0xdc')],'VoiceQueueId':_0x44b613[_0x5d65('0xdd')]||undefined,'CampaignId':_0x44b613['CampaignId']||undefined})[_0x5d65('0xa1')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x29f35b=new History(_0x8dce99);_0x29f35b[_0x5d65('0x71')]=0xb;_0x29f35b[_0x5d65('0x72')]=_0x5d65('0xea');_0x29f35b[_0x5d65('0x74')]=moment()['format'](_0x5d65('0xc2'));_0x29f35b[_0x5d65('0x73')]=_0x29f35b[_0x5d65('0x74')];_0x29f35b[_0x5d65('0xe1')]=_0x8dce99[_0x5d65('0xe1')];_0x29f35b['calleridnum']=_0x8dce99[_0x5d65('0xe2')];hopperUtils[_0x5d65('0xc9')](_0x29f35b)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0x40a955)hopperUtils[_0x5d65('0xe4')](_0x8dce99,_0x5988cd,_0x590bad)[_0x5d65('0x42')](function(){return 0x1;});});}}}};Dialer[_0x5d65('0x19')][_0x5d65('0x38')]=function(_0xd2a08b){if(this['actions'][_0xd2a08b[_0x5d65('0xc0')]]){this['actions'][_0xd2a08b[_0x5d65('0xc0')]]['channel']=_0xd2a08b[_0x5d65('0xeb')];}if(this[_0x5d65('0x26')][_0xd2a08b[_0x5d65('0xc0')]]){this[_0x5d65('0x26')][_0xd2a08b['uniqueid']][_0x5d65('0xeb')]=_0xd2a08b[_0x5d65('0xeb')];}};Dialer[_0x5d65('0x19')][_0x5d65('0x3c')]=function(_0x165fe0){if(!this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]]){return;}var _0x5e9220=this[_0x5d65('0xbe')][this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]][_0x5d65('0xbf')]]['strategy']||_0x5d65('0xed');if(_0x5e9220==='roundrobin'){if(this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]]&&_[_0x5d65('0xee')](this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]][_0x5d65('0xef')])&&_0x165fe0[_0x5d65('0x89')]==='1'&&_0x165fe0['paused']==='0'){if(this['agents'][_0x165fe0[_0x5d65('0xf0')]]){if(!this['agents'][_0x165fe0['stateinterface']][_0x5d65('0xef')]){this['agents'][_0x165fe0[_0x5d65('0xf0')]][_0x5d65('0xef')]=!![];this[_0x5d65('0x24')][_0x165fe0['actionid']][_0x5d65('0xef')]=!![];this[_0x5d65('0x24')][_0x165fe0['actionid']][_0x5d65('0xf0')]=_0x165fe0[_0x5d65('0xf0')];}}}}else if(_0x5e9220===_0x5d65('0xed')){if(this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]]){if(this['agents'][_0x165fe0[_0x5d65('0xf0')]]){this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]][_0x5d65('0xf0')]=_0x165fe0[_0x5d65('0xf0')];if(_[_0x5d65('0xee')](this[_0x5d65('0x2b')][this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]]['queue']])){this[_0x5d65('0x2b')][this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]]['queue']]=[];}this['queueBooked'][this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]][_0x5d65('0xbf')]]['push'](_[_0x5d65('0x62')](_[_0x5d65('0x76')](this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]],[_0x5d65('0xf1'),'stateinterface']),{'status':_0x165fe0[_0x5d65('0x89')],'paused':_0x165fe0[_0x5d65('0xf2')]}));}}}};Dialer[_0x5d65('0x19')]['syncQueueStatusComplete']=function(_0x35d2e9){if(!this['actions'][_0x35d2e9[_0x5d65('0xec')]]){return;}var _0x81308b=this;var _0x5c0d1c=this[_0x5d65('0xbe')][this[_0x5d65('0x24')][_0x35d2e9['actionid']]['queue']];var _0x59ecd0=_0x5c0d1c[_0x5d65('0xf3')]||_0x5d65('0xed');if(_0x59ecd0===_0x5d65('0xf4')){if(this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]]&&this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xf0')]){this[_0x5d65('0x1e')]['run'](this['actions'][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xf1')],this[_0x5d65('0x24')][_0x35d2e9['actionid']][_0x5d65('0xf0')])[_0x5d65('0xa1')](function(_0x38b441){logger[_0x5d65('0x67')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x38b441,{'showHidden':![],'depth':null}));})['finally'](function(){_0x81308b['updateOriginated'](_0x81308b[_0x5d65('0xbe')][_0x81308b[_0x5d65('0x24')][_0x35d2e9['actionid']][_0x5d65('0xbf')]]);_0x81308b['agents'][_0x81308b[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]]['stateinterface']][_0x5d65('0xef')]=![];delete _0x81308b[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]];unlockQueueStatus(_0x5c0d1c);});}else{this[_0x5d65('0xcd')](this[_0x5d65('0xbe')][this[_0x5d65('0x24')][_0x35d2e9['actionid']][_0x5d65('0xbf')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xdb')],'ListId':this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xdc')],'VoiceQueueId':this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xdd')]||undefined,'CampaignId':this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xf5')));delete this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]];unlockQueueStatus(_0x5c0d1c);}}else if(_0x59ecd0===_0x5d65('0xed')){var _0x10dbf7;if(this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]]&&!_[_0x5d65('0x4c')](this[_0x5d65('0x2b')][this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]]['queue']])){if(this['queueBookedRR'][_0x81308b[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xbf')]]){this[_0x5d65('0x2c')][_0x81308b[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xbf')]]=this[_0x5d65('0x2c')][this[_0x5d65('0x24')][_0x35d2e9['actionid']][_0x5d65('0xbf')]]?this[_0x5d65('0x2c')][this[_0x5d65('0x24')][_0x35d2e9['actionid']][_0x5d65('0xbf')]]:this['queueBooked'][this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xbf')]]?this[_0x5d65('0x2b')][this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]]['queue']][_0x5d65('0xf6')]||0x0:0x0;}this[_0x5d65('0x2b')][this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xbf')]][_0x5d65('0xf6')]=this[_0x5d65('0x2c')][this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xbf')]];for(var _0x54e81f=0x0;_0x54e81f=_0x8ded4b[_0x5d65('0x11b')]){_0x1ae820[_0x5d65('0x11c')](_0x5d6d62,_0x2e0ee5,_0x57867c,_0x5d65('0x11d'));}else{if(_0x5d6d62[_0x5d65('0x114')]>=_0x8ded4b[_0x5d65('0x11e')]){_0x1ae820['createStateFinal'](_0x5d6d62,_0x2e0ee5,_0x57867c,_0x5d65('0x11f'));}else{hopperUtils[_0x5d65('0xd8')]({'active':![],'countmachineretry':_0x5d6d62['countmachineretry'],'scheduledat':moment()[_0x5d65('0xe8')](_0x8ded4b[_0x5d65('0x120')],'minutes')[_0x5d65('0x49')](_0x5d65('0xc2')),'ContactId':_0x5d6d62[_0x5d65('0xdb')],'ListId':_0x5d6d62[_0x5d65('0xdc')],'VoiceQueueId':_0x5d6d62[_0x5d65('0xdd')]||undefined,'CampaignId':_0x5d6d62['CampaignId']||undefined})[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x121')));_0x2e0ee5({'reschedule':0x1});}}});}if(_0x919e1b['type']===_0x5d65('0xc1')&&this['campaigns'][_0x919e1b[_0x5d65('0xbf')]][_0x5d65('0x108')]&&_0x1b419c[_0x5d65('0x109')]===_0x5d65('0x10a')){delete this[_0x5d65('0x26')][_0x1b419c[_0x5d65('0xc0')]];this[_0x5d65('0xcd')](this[_0x5d65('0x1f')][_0x919e1b['queue']]);_0x259b9b=new Hangup(_0x919e1b,_0x1b419c);_0x259b9b[_0x5d65('0x71')]=0x12;_0x259b9b[_0x5d65('0x72')]=_0x5d65('0x10b');_0x259b9b[_0x5d65('0x10c')]='AMD';ami[_0x5d65('0x44')](_0x5d65('0x10e'),ut[_0x5d65('0x10f')](_0x259b9b,_0x5d65('0x115')));this['saveInDb'](_0x259b9b,_0x5d65('0x122'),_0x5d65('0x123'));}if(_0x919e1b[_0x5d65('0xc3')]===_0x5d65('0xc1')&&this[_0x5d65('0x1f')][_0x919e1b[_0x5d65('0xbf')]][_0x5d65('0x108')]&&_0x1b419c['value']===_0x5d65('0x124')){return new Promise(function(_0x5324ea,_0x594449){delete _0x1ae820[_0x5d65('0x26')][_0x1b419c['uniqueid']];_0x1ae820[_0x5d65('0xcd')](_0x1ae820['campaigns'][_0x919e1b['queue']]);_0x1ae820[_0x5d65('0x1f')][_0x919e1b[_0x5d65('0xbf')]]['outboundAnswerCallsDay']+=0x1;_0x1ae820[_0x5d65('0x1f')][_0x919e1b[_0x5d65('0xbf')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x4a2c37=_0x1ae820[_0x5d65('0x1f')][_0x919e1b['queue']];var _0xce8d31=new Hangup(_0x919e1b,_0x1b419c);_0xce8d31[_0x5d65('0x71')]=0x13;_0xce8d31['statedesc']='Machine';_0xce8d31[_0x5d65('0x10c')]=_0x5d65('0x10d');_0xce8d31['countmachineretry']+=0x1;_0xce8d31['countglobal']+=0x1;_0xce8d31['amd']=!![];ami[_0x5d65('0x44')](_0x5d65('0x10e'),ut[_0x5d65('0x10f')](_0xce8d31,'amd'));hopperUtils[_0x5d65('0xc9')](_0xce8d31)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x125')));if(_0xce8d31[_0x5d65('0x116')]+_0xce8d31['countcongestionretry']+_0xce8d31[_0x5d65('0x118')]+_0xce8d31[_0x5d65('0x119')]+_0xce8d31[_0x5d65('0xd9')]+_0xce8d31[_0x5d65('0xe7')]+_0xce8d31[_0x5d65('0x114')]+_0xce8d31[_0x5d65('0x11a')]>=_0x4a2c37[_0x5d65('0x11b')]){_0x1ae820[_0x5d65('0x11c')](_0xce8d31,_0x5324ea,_0x594449,_0x5d65('0x11d'));}else{if(_0xce8d31[_0x5d65('0x114')]>=_0x4a2c37[_0x5d65('0x11e')]){_0x1ae820[_0x5d65('0x126')](_0xce8d31,_0x5324ea,_0x594449,_0x5d65('0x11f'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0xce8d31[_0x5d65('0x114')],'scheduledat':moment()['add'](_0x4a2c37[_0x5d65('0x120')],_0x5d65('0xda'))[_0x5d65('0x49')](_0x5d65('0xc2')),'ContactId':_0xce8d31[_0x5d65('0xdb')],'ListId':_0xce8d31['ListId'],'VoiceQueueId':_0xce8d31['VoiceQueueId']||undefined,'CampaignId':_0xce8d31[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch('[rescheduleContact][Machine]'));_0x5324ea({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x5d65('0x36')]=function(_0x5e6b43){var _0x18f922=this[_0x5d65('0x26')][_0x5e6b43[_0x5d65('0xc0')]];var _0x5c6430;if(_0x18f922&&_0x18f922[_0x5d65('0xc3')]===_0x5d65('0xc1')){delete this[_0x5d65('0x26')][_0x5e6b43[_0x5d65('0xc0')]];this[_0x5d65('0xcd')](this[_0x5d65('0x1f')][_0x18f922[_0x5d65('0xbf')]]);this[_0x5d65('0x1f')][_0x18f922[_0x5d65('0xbf')]][_0x5d65('0x127')]+=0x1;_0x5c6430=new Hangup(_0x18f922,_0x5e6b43);hopperUtils[_0x5d65('0xc9')](_0x5c6430)[_0x5d65('0xa1')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x5c6430)['catch'](loggerCatch(_0x5d65('0x128')));}if(_0x18f922&&_0x18f922[_0x5d65('0xc3')]!==_0x5d65('0xc1')&&isNotNull(this['voiceQueues'][_0x18f922[_0x5d65('0xbf')]][_0x5d65('0x129')])){delete this['uniqueId'][_0x5e6b43['uniqueid']];this['updateOriginated'](this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]]);this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]][_0x5d65('0xc4')]+=0x1;this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]][_0x5d65('0x113')]+=0x1;_0x5c6430=new Hangup(_0x18f922,_0x5e6b43);_0x5c6430[_0x5d65('0x71')]=0x10;_0x5c6430[_0x5d65('0x72')]=_0x5d65('0x12a');_0x5c6430['membername']=_0x5d65('0x12b');hopperUtils[_0x5d65('0xc9')](_0x5c6430)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x12c')));hopperUtils[_0x5d65('0xcb')](_0x5c6430)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x128')));}if(_0x18f922&&_0x18f922[_0x5d65('0xc3')]!==_0x5d65('0xc1')&&!isNotNull(this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]]['dialQueueProject'])){if(_0x5e6b43[_0x5d65('0x12d')]===_0x5d65('0x12e')){delete this[_0x5d65('0x26')][_0x5e6b43[_0x5d65('0xc0')]];this['voiceQueues'][_0x18f922[_0x5d65('0xbf')]][_0x5d65('0xc4')]+=0x1;const _0x23bec2=new AgentComplete(_0x18f922,_0x5e6b43);_0x23bec2[_0x5d65('0xde')]=this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]]['id'];hopperUtils[_0x5d65('0xc9')](_0x23bec2)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xca')));hopperUtils[_0x5d65('0xcb')](_0x23bec2)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xcc')));}else{delete this[_0x5d65('0x26')][_0x5e6b43[_0x5d65('0xc0')]];this['updateOriginated'](this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]]);this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]]['outboundUnknownCallsDay']+=0x1;_0x5c6430=new Hangup(_0x18f922,_0x5e6b43);_0x5c6430[_0x5d65('0x71')]=0xc;_0x5c6430[_0x5d65('0x72')]=_0x5e6b43[_0x5d65('0x12d')];_0x5c6430[_0x5d65('0x10c')]=_0x5d65('0x12f');hopperUtils[_0x5d65('0xc9')](_0x5c6430)['catch'](loggerCatch(_0x5d65('0x12c')));hopperUtils[_0x5d65('0xcb')](_0x5c6430)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x128')));}}};Dialer[_0x5d65('0x19')][_0x5d65('0xa')]=function(_0x484063){var _0x201bc2=this;if(!_0x201bc2[_0x5d65('0x130')][_0x484063[_0x5d65('0x4a')]]){_0x201bc2[_0x5d65('0x130')][_0x484063[_0x5d65('0x4a')]]={'running':![]};}else if(_0x201bc2[_0x5d65('0x130')][_0x484063[_0x5d65('0x4a')]][_0x5d65('0x131')]===!![]){return;}else if(_0x201bc2['queuesSummary'][_0x484063[_0x5d65('0x4a')]][_0x5d65('0x131')]===![]){_0x201bc2[_0x5d65('0x130')][_0x484063[_0x5d65('0x4a')]]['running']=!![];}var _0x327b6b=_0x201bc2[_0x5d65('0xbe')][_0x484063[_0x5d65('0x4a')]];var _0x4d6502=_0x327b6b[_0x5d65('0x6c')]!==utils[_0x5d65('0x6d')]['INACTIVE'];var _0x4badbf=utils['isPreviewCampaign'](_0x327b6b);_0x327b6b['statusMessage']=utils['getQueueCampaignStatusMessage'](_0x327b6b,_0x201bc2[_0x5d65('0x21')]);Promise[_0x5d65('0xaa')]()[_0x5d65('0x42')](function(){if(_0x327b6b[_0x5d65('0x132')]===utils[_0x5d65('0x6d')][_0x5d65('0x80')]){if(_0x4d6502){clearPredictiveAttributes(_0x327b6b);_0x484063[_0x5d65('0x28')]=undefined;_0x484063[_0x5d65('0x29')]=undefined;}if(_0x327b6b[_0x5d65('0x132')]===utils['CAMPAIGN_STATUS'][_0x5d65('0x80')]){_0x484063[_0x5d65('0x133')]=0x0;_0x484063[_0x5d65('0xf2')]=0x0;_0x484063[_0x5d65('0x134')]=0x0;_0x484063[_0x5d65('0x135')]=0x0;_0x484063['pTalking']=0x0;}}else if(_0x327b6b[_0x5d65('0x132')]===utils[_0x5d65('0x6d')][_0x5d65('0x136')]&&!_0x4badbf){return _0x201bc2[_0x5d65('0x93')](_0x327b6b,!![])[_0x5d65('0x42')](function(){return _0x201bc2['ifTime'](_0x327b6b,![]);})[_0x5d65('0x42')](function(){return _0x201bc2[_0x5d65('0x137')](_0x327b6b);})['catch'](function(_0x5976c2){loggerSyncQueueSummary[_0x5d65('0x46')]('[syncQueueSummary]',util[_0x5d65('0x48')](_0x5976c2,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x327b6b);});}else{clearPredictiveAttributes(_0x327b6b);}})[_0x5d65('0x42')](function(){var _0x5e97da=_0x484063[_0x5d65('0x138')](_0x327b6b);if(_0x5e97da||_0x327b6b[_0x5d65('0x139')]){_0x327b6b[_0x5d65('0x139')]=![];_0x484063[_0x5d65('0x13a')](_0x327b6b);Object[_0x5d65('0x13b')](_0x327b6b,_0x484063);emitOutboundVoiceQueueSummary(_0x484063);}_0x201bc2[_0x5d65('0x130')][_0x327b6b['name']]['running']=![];})[_0x5d65('0xa1')](function(_0x200df9){logger['error'](_0x5d65('0x13c'),util[_0x5d65('0x48')](_0x200df9,{'showHidden':![],'depth':null}));_0x201bc2['queuesSummary'][_0x327b6b[_0x5d65('0x4a')]][_0x5d65('0x131')]=![];});};Dialer[_0x5d65('0x19')][_0x5d65('0x34')]=_[_0x5d65('0x13d')](function(){var _0x54c0c5=_[_0x5d65('0x13e')](this[_0x5d65('0xbe')],function(_0x194f16){return _0x194f16['dialPreviewRecallmeReminder'];});var _0x31685f=_[_0x5d65('0x13e')](this['agents'],function(_0x598fc2){return _0x598fc2[_0x5d65('0x13f')]&&_0x598fc2['status']===_0x5d65('0x8a');});if(_0x54c0c5['length']>0x0&&_0x31685f['length']>0x0){return Promise[_0x5d65('0xaa')]()[_0x5d65('0x42')](cmHopper[_0x5d65('0x140')](_['map'](_0x54c0c5,'id'),previewRecallmeReminderInterval,_['map'](_0x31685f,'id')))[_0x5d65('0x42')](function(_0x58ada5){for(var _0x1a28bf=0x0;_0x1a28bf<_0x58ada5[_0x5d65('0x99')];_0x1a28bf++){var _0x48aa85=_0x58ada5[_0x1a28bf]['Agent']['name'];if(_0x48aa85)io['to'](util[_0x5d65('0x49')](_0x5d65('0x141'),_0x48aa85))[_0x5d65('0x44')]('user:dialPreviewRecallReminder',{'hopper':_0x58ada5[_0x1a28bf]});}})[_0x5d65('0xa1')](function(_0x583375){logger[_0x5d65('0x67')]('checkPreviewRecallReminder',_0x583375);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x5d65('0x19')][_0x5d65('0x40')]=function(){var _0x457a75=this;setInterval(function(){_0x457a75[_0x5d65('0x142')](_0x457a75[_0x5d65('0x26')],_0x5d65('0x143'));_0x457a75[_0x5d65('0x142')](_0x457a75[_0x5d65('0x24')],_0x5d65('0x144'));},0x32c8);};Dialer[_0x5d65('0x19')]['clearZombieChannels']=function(_0x4d4c06,_0x7e65fe){var _0x5f3e34=this;for(var _0x42ea6c in _0x4d4c06){if(typeof _0x4d4c06[_0x42ea6c]!=='undefined'){this[_0x5d65('0x1d')][_0x5d65('0x1a')](function(){if(!_[_0x5d65('0xee')](_0x4d4c06[_0x42ea6c])){return ami[_0x5d65('0x9b')]({'action':_0x5d65('0x89'),'channel':_0x4d4c06[_0x42ea6c][_0x5d65('0xeb')]})[_0x5d65('0xa1')](function(_0x23425f){if(_0x23425f[_0x5d65('0x6c')]===_0x5d65('0x145')){setTimeout(function(){if(_0x4d4c06[_0x42ea6c]&&_0x4d4c06[_0x42ea6c]['type']!==_0x5d65('0xc1')){_0x5f3e34['updateOriginated'](_0x5f3e34[_0x5d65('0xbe')][_0x4d4c06[_0x42ea6c][_0x5d65('0xbf')]]);logger[_0x5d65('0x67')](_0x5d65('0x146'),_0x7e65fe,_0x42ea6c,_0x4d4c06[_0x42ea6c][_0x5d65('0xbf')]);delete _0x4d4c06[_0x42ea6c];}if(_0x4d4c06[_0x42ea6c]&&_0x4d4c06[_0x42ea6c]['type']===_0x5d65('0xc1')){_0x5f3e34[_0x5d65('0xcd')](_0x5f3e34[_0x5d65('0x1f')][_0x4d4c06[_0x42ea6c]['queue']]);logger['error']('[Dialer][checkChannel][ivr]',_0x7e65fe,_0x42ea6c,_0x4d4c06[_0x42ea6c]['queue']);delete _0x4d4c06[_0x42ea6c];}},0x2328);}});}});}}};Dialer[_0x5d65('0x19')]['getVoiceQueueRtPauses']=function(_0x1d8e83){return Promise[_0x5d65('0xaa')]()['then'](voiceQueueRt[_0x5d65('0x147')](_0x1d8e83))['catch'](loggerCatch(_0x5d65('0x148')));};Dialer[_0x5d65('0x19')][_0x5d65('0xcd')]=function(_0x48cb21){if(!_['isUndefined'](_0x48cb21)&&_0x48cb21!==null){if(typeof _0x48cb21[_0x5d65('0x7f')]!==_0x5d65('0x149')){if(_0x48cb21['originated']>0x0){_0x48cb21[_0x5d65('0x7f')]-=0x1;}else{logger[_0x5d65('0x67')](_0x5d65('0x14a'));}}}else{logger[_0x5d65('0x67')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x5d65('0x19')][_0x5d65('0x14b')]=function(_0x12b5ed,_0x281fdb){var _0x161d46=this;return function(_0x42d76a){_0x161d46[_0x5d65('0xcd')](_0x281fdb);logger['error'](_0x12b5ed,util[_0x5d65('0x48')](_0x42d76a,{'showHidden':![],'depth':null}));};};Dialer[_0x5d65('0x19')][_0x5d65('0x14c')]=function(_0x28911a,_0x4e08ce,_0x559100){var _0x249db4={'state':0x19,'statedesc':_0x5d65('0x14d')};this[_0x5d65('0xcd')](_0x4e08ce);this[_0x5d65('0x110')](_[_0x5d65('0x62')](_0x249db4,_[_0x5d65('0x76')](_0x559100,['ContactId',_0x5d65('0xdc'),'UserId','VoiceQueueId',_0x5d65('0xde')])),_0x5d65('0x14e'),'[emptyContact]');logger['error'](_0x28911a);};Dialer[_0x5d65('0x19')]['saveInDb']=function(_0x1a402a,_0x59c090,_0x39ba12){hopperUtils[_0x5d65('0xc9')](_0x1a402a)[_0x5d65('0xa1')](loggerCatch(_0x59c090));hopperUtils[_0x5d65('0xcb')](_0x1a402a)['catch'](loggerCatch(_0x39ba12));};Dialer[_0x5d65('0x19')][_0x5d65('0xd7')]=function(_0x11e446,_0x1351af){hopperUtils[_0x5d65('0xc9')](_0x11e446)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xca')));if(_0x1351af==0x0){hopperUtils[_0x5d65('0xcb')](_0x11e446)['catch'](loggerCatch(_0x5d65('0x14f')));}};Dialer[_0x5d65('0x19')]['checkPreviewRecallReminder']=function(_0x28d914){return Promise[_0x5d65('0xaa')]()[_0x5d65('0x42')](cmHopper['handlePreviewRecallNotifications'](_0x28d914['id'],previewRecallmeReminderInterval))[_0x5d65('0x42')](function(_0x12ef55){for(var _0x170f3d=0x0;_0x170f3d<_0x12ef55[_0x5d65('0x99')];_0x170f3d++){var _0x4b3e7a=_0x12ef55[_0x170f3d]['Agent'][_0x5d65('0x4a')];if(_0x4b3e7a)io['to'](util[_0x5d65('0x49')](_0x5d65('0x141'),_0x4b3e7a))[_0x5d65('0x44')]('user:dialPreviewRecallReminder',{'hopper':_0x12ef55[_0x170f3d]});}})[_0x5d65('0xa1')](function(){});};Dialer[_0x5d65('0x19')][_0x5d65('0xad')]=function(_0x148c19){var _0x1ae095=this;return function(){_0x1ae095['handleIvr'](_0x148c19);};};Dialer[_0x5d65('0x19')][_0x5d65('0x150')]=function(_0x749ab0,_0x2edd57){var _0x1433d4=this;var _0x5a98ca=uuid['v4']();this[_0x5d65('0x24')][_0x5a98ca]=new Action(_0x749ab0,_0x2edd57,_0x5a98ca);return new Promise(function(_0x5e4dc5,_0x32f69b){if(_['isUndefined'](_0x749ab0)&&typeof _0x749ab0!=='object'){return _0x32f69b(msgResponse(_0x5d65('0x151'),_0x5d65('0xa6'),_0x5d65('0x152')));}if(_['isUndefined'](_0x2edd57[_0x5d65('0x153')])||_0x2edd57[_0x5d65('0x153')]===null){return _0x32f69b(msgResponse(_0x5d65('0x151'),'Failure',_0x5d65('0x154')));}var _0x41b086={'XMD-CALLERID':_0x1433d4[_0x5d65('0x24')][_0x5a98ca][_0x5d65('0x155')](),'XMD-AGI':_0x749ab0['dialQueueProject']?util['format'](_0x5d65('0x156'),ipAgi,_0x749ab0[_0x5d65('0x129')]):_0x5d65('0x157'),'XMD-AGIAFTER':_0x749ab0[_0x5d65('0xc7')]?util[_0x5d65('0x49')](_0x5d65('0x156'),ipAgi,_0x749ab0[_0x5d65('0xc7')]):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x749ab0)?util[_0x5d65('0x49')]('\x22%s,%s%s,,,%s\x22',_0x749ab0[_0x5d65('0x4a')],_0x749ab0[_0x5d65('0x158')]||'',_0x749ab0[_0x5d65('0xc8')]?'c':'',_0x749ab0[_0x5d65('0x159')]||0x3):_0x5d65('0x157'),'XMD-CONTACTID':_0x2edd57[_0x5d65('0xdb')],'XMD-CDRTYPE':_0x5d65('0x8'),'CALLERID(all)':_0x1433d4[_0x5d65('0x24')][_0x5a98ca][_0x5d65('0x155')](),'XMD-AMD':_0x749ab0[_0x5d65('0x108')]?_0x5d65('0x136'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x749ab0[_0x5d65('0x108')]){_0x41b086[_0x5d65('0x15a')]=_0x749ab0[_0x5d65('0x15b')]||0x9c4;_0x41b086[_0x5d65('0x15c')]=_0x749ab0[_0x5d65('0x15d')]||0x5dc;_0x41b086[_0x5d65('0x15e')]=_0x749ab0[_0x5d65('0x15f')]||0x320;_0x41b086[_0x5d65('0x160')]=_0x749ab0['dialAMDTotalAnalysisTime']||0x1388;_0x41b086[_0x5d65('0x161')]=_0x749ab0['dialAMDMinWordLength']||0x64;_0x41b086['XMD-AMDBETWEENWORDSSILENCE']=_0x749ab0[_0x5d65('0x162')]||0x32;_0x41b086[_0x5d65('0x163')]=_0x749ab0[_0x5d65('0x164')]||0x3;_0x41b086[_0x5d65('0x165')]=_0x749ab0[_0x5d65('0x166')]||0x100;_0x41b086[_0x5d65('0x167')]=_0x749ab0[_0x5d65('0x168')]||0x1388;}if(utils[_0x5d65('0x169')](_0x749ab0)){_0x41b086[_0x5d65('0x16a')]=_0x2edd57[_0x5d65('0xdd')];}else{_0x41b086[_0x5d65('0x16b')]=_0x2edd57[_0x5d65('0xde')];}var _0x4d2d7e=utils['setXMDContactVariables'](_0x2edd57[_0x5d65('0x16c')]);Object[_0x5d65('0x13b')](_0x41b086,_0x4d2d7e);var _0x3ea22d=_0x1433d4[_0x5d65('0x86')](_0x749ab0[_0x5d65('0x8d')])?utils[_0x5d65('0x16d')](_0x749ab0[_0x5d65('0x8d')]['callerid'],_0x749ab0[_0x5d65('0x16e')],_0x749ab0[_0x5d65('0x16f')]>0x0?utils['getCallerIdRandom'](_0x749ab0[_0x5d65('0x170')],_0x749ab0[_0x5d65('0x16f')]):_0x749ab0[_0x5d65('0x170')]):utils[_0x5d65('0x16d')](_[_0x5d65('0xee')](_0x749ab0[_0x5d65('0x8e')])?_0x749ab0['Trunk'][_0x5d65('0x171')]:_0x749ab0[_0x5d65('0x8e')][_0x5d65('0x171')],_0x749ab0[_0x5d65('0x16e')],_0x749ab0['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x5d65('0x172')](_0x749ab0[_0x5d65('0x170')],_0x749ab0[_0x5d65('0x16f')]):_0x749ab0['dialOriginateCallerIdNumber']);if(_0x3ea22d){_0x41b086[_0x5d65('0x173')]=_0x1433d4[_0x5d65('0x24')][_0x5a98ca][_0x5d65('0x174')]=utils[_0x5d65('0x175')](_0x3ea22d);_0x41b086[_0x5d65('0x176')]=_0x2edd57[_0x5d65('0x153')];}_0x749ab0['variables']=_0x41b086;return ami[_0x5d65('0x9b')]({'actionid':_0x5a98ca,'action':'originate','channel':_0x1433d4[_0x5d65('0x86')](_0x749ab0[_0x5d65('0x8d')])?util[_0x5d65('0x49')](_0x5d65('0x177'),_0x749ab0[_0x5d65('0x8d')]['name'],isNotNull(_0x749ab0[_0x5d65('0x178')])?_0x749ab0[_0x5d65('0x178')][_0x5d65('0x179')]()||'':'',_0x749ab0['dialCutDigit']>0x0?_0x2edd57['phone'][_0x5d65('0x17a')](_0x749ab0[_0x5d65('0x17b')]):_0x2edd57['phone']):util[_0x5d65('0x49')]('SIP/%s/%s%s',_[_0x5d65('0xee')](_0x749ab0['TrunkBackup'])?_0x749ab0[_0x5d65('0x8d')][_0x5d65('0x4a')]:_0x749ab0[_0x5d65('0x8e')]['name'],isNotNull(_0x749ab0[_0x5d65('0x178')])?_0x749ab0['dialPrefix'][_0x5d65('0x179')]()||'':'',_0x749ab0[_0x5d65('0x17b')]>0x0?_0x2edd57[_0x5d65('0x153')][_0x5d65('0x17a')](_0x749ab0[_0x5d65('0x17b')]):_0x2edd57[_0x5d65('0x153')]),'callerid':_0x3ea22d,'Exten':_0x5d65('0x107'),'Context':_0x5d65('0x17c'),'Priority':'1','variable':_0x41b086,'timeout':(_0x749ab0[_0x5d65('0x17d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5a98ca})[_0x5d65('0x42')](function(_0x505b4a){return _0x5e4dc5(_0x505b4a);})[_0x5d65('0xa1')](function(_0x241ae4){_0x749ab0[_0x5d65('0x17e')]+=0x1;var _0xb788dc=new History(_0x1433d4[_0x5d65('0x24')][_0x5a98ca]);logger['error'](util[_0x5d65('0x49')](_0x5d65('0x17f'),JSON[_0x5d65('0x75')](_0x241ae4)));_0xb788dc['state']=0xe;_0xb788dc[_0x5d65('0x72')]=_0x5d65('0x180');_0xb788dc['starttime']=moment()[_0x5d65('0x49')](_0x5d65('0xc2'));_0xb788dc[_0x5d65('0x73')]=_0xb788dc[_0x5d65('0x74')];hopperUtils['createHistory'](_0xb788dc)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x181')));_0x1433d4[_0x5d65('0xcb')](_0xb788dc)[_0x5d65('0xa1')](loggerCatch('[originate][error]'))[_0x5d65('0x1c')](function(){delete _0x1433d4['actions'][_0x5a98ca];return _0x32f69b(msgResponse(_0x5d65('0x151'),_0x5d65('0x85'),'originate\x20action\x20Error'));});});});};Dialer[_0x5d65('0x19')][_0x5d65('0x182')]=function(_0x807b41,_0x1d1e44,_0x18a2d4){var _0x1ee969=new History(_0x1d1e44);if(_0x1ee969[_0x5d65('0x116')]+_0x1ee969['countcongestionretry']+_0x1ee969[_0x5d65('0x118')]+_0x1ee969[_0x5d65('0x119')]+_0x1ee969['countdropretry']+_0x1ee969[_0x5d65('0xe7')]+_0x1ee969[_0x5d65('0x114')]+_0x1ee969[_0x5d65('0x11a')]>=_0x18a2d4['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x807b41){case 0x3:if(_0x1ee969[_0x5d65('0x118')]>=_0x18a2d4[_0x5d65('0x183')]-0x1){return!![];}hopperUtils[_0x5d65('0xd8')]({'active':![],'countnoanswerretry':_0x1ee969[_0x5d65('0x118')]+=0x1,'scheduledat':moment()['add'](_0x18a2d4[_0x5d65('0x184')],'minutes')['format'](_0x5d65('0xc2')),'ContactId':_0x1ee969[_0x5d65('0xdb')],'ListId':_0x1ee969[_0x5d65('0xdc')],'VoiceQueueId':_0x1ee969[_0x5d65('0xdd')]||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x185')));break;case 0x5:if(_0x1ee969['countbusyretry']>=_0x18a2d4[_0x5d65('0x186')]-0x1){return!![];}hopperUtils[_0x5d65('0xd8')]({'active':![],'countbusyretry':_0x1ee969[_0x5d65('0x116')]+=0x1,'scheduledat':moment()[_0x5d65('0xe8')](_0x18a2d4[_0x5d65('0x187')],_0x5d65('0xda'))[_0x5d65('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1ee969[_0x5d65('0xdb')],'ListId':_0x1ee969['ListId'],'VoiceQueueId':_0x1ee969[_0x5d65('0xdd')]||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x1ee969[_0x5d65('0x117')]>=_0x18a2d4[_0x5d65('0x188')]-0x1){return!![];}hopperUtils[_0x5d65('0xd8')]({'active':![],'countcongestionretry':_0x1ee969['countcongestionretry']+=0x1,'scheduledat':moment()[_0x5d65('0xe8')](_0x18a2d4['dialCongestionRetryFrequency'],'minutes')['format'](_0x5d65('0xc2')),'ContactId':_0x1ee969['ContactId'],'ListId':_0x1ee969['ListId'],'VoiceQueueId':_0x1ee969['VoiceQueueId']||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x189')));break;case 0x0:if(_0x1ee969[_0x5d65('0x119')]>=_0x18a2d4['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x1ee969[_0x5d65('0x119')]+=0x1,'scheduledat':moment()[_0x5d65('0xe8')](_0x18a2d4[_0x5d65('0x18a')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1ee969[_0x5d65('0xdb')],'ListId':_0x1ee969[_0x5d65('0xdc')],'VoiceQueueId':_0x1ee969[_0x5d65('0xdd')]||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x1ee969[_0x5d65('0xd9')]>=_0x18a2d4[_0x5d65('0x18b')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x1ee969[_0x5d65('0xd9')]+=0x1,'scheduledat':moment()[_0x5d65('0xe8')](_0x18a2d4[_0x5d65('0xd3')],'minutes')[_0x5d65('0x49')](_0x5d65('0xc2')),'ContactId':_0x1ee969[_0x5d65('0xdb')],'ListId':_0x1ee969['ListId'],'VoiceQueueId':_0x1ee969[_0x5d65('0xdd')]||undefined,'CampaignId':_0x1ee969['CampaignId']||undefined})['catch'](loggerCatch(_0x5d65('0xdf')));break;case 0xb:if(_0x1ee969['countabandonedretry']>=_0x18a2d4[_0x5d65('0x18c')]-0x1){return!![];}hopperUtils[_0x5d65('0xd8')]({'active':![],'countabandonedretry':_0x1ee969[_0x5d65('0xe7')]+=0x1,'scheduledat':moment()[_0x5d65('0xe8')](_0x18a2d4['dialAbandonedRetryFrequency'],_0x5d65('0xda'))['format'](_0x5d65('0xc2')),'ContactId':_0x1ee969['ContactId'],'ListId':_0x1ee969[_0x5d65('0xdc')],'VoiceQueueId':_0x1ee969['VoiceQueueId']||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x1ee969[_0x5d65('0x114')]>=_0x18a2d4[_0x5d65('0x11e')]-0x1){return!![];}hopperUtils[_0x5d65('0xd8')]({'active':![],'countmachineretry':_0x1ee969['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x18a2d4[_0x5d65('0x120')],_0x5d65('0xda'))[_0x5d65('0x49')](_0x5d65('0xc2')),'ContactId':_0x1ee969[_0x5d65('0xdb')],'ListId':_0x1ee969['ListId'],'VoiceQueueId':_0x1ee969['VoiceQueueId']||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x1ee969['countagentrejectretry']>=_0x18a2d4['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x1ee969[_0x5d65('0x11a')]+=0x1,'scheduledat':moment()[_0x5d65('0xe8')](_0x18a2d4['dialAgentRejectRetryFrequency'],_0x5d65('0xda'))[_0x5d65('0x49')](_0x5d65('0xc2')),'ContactId':_0x1ee969[_0x5d65('0xdb')],'ListId':_0x1ee969[_0x5d65('0xdc')],'VoiceQueueId':_0x1ee969[_0x5d65('0xdd')]||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x5d65('0x19')][_0x5d65('0x103')]=function(_0x8d3dd1,_0x7e7e8,_0x30dd83){var _0x22b492=this;var _0x4ccae3=new History(_0x8d3dd1);var _0x592a74=![];var _0x564907;var _0x3906d4;return new Promise(function(_0x189f44,_0x586f00){if(_[_0x5d65('0x43')](_0x7e7e8)&&typeof _0x7e7e8!==_0x5d65('0x18d')){return _0x586f00(msgResponse('[callProgressDetecting]',_0x5d65('0xa6'),_0x5d65('0x18e')));}if(_[_0x5d65('0x43')](_0x30dd83)&&typeof _0x30dd83!=='object'){return _0x586f00(msgResponse(_0x5d65('0x18f'),_0x5d65('0xa6'),_0x5d65('0x190')));}hopperUtils[_0x5d65('0xd4')](_0x4ccae3,_0x30dd83[_0x5d65('0x191')],_0x7e7e8)[_0x5d65('0x42')](function(_0x51b0c2){if(_0x51b0c2[_0x5d65('0xd6')]==0x1)_0x592a74=!![];switch(_0x30dd83[_0x5d65('0x191')]){case'0':_0x7e7e8['outboundNoSuchCallsDay']+=0x1;_0x4ccae3[_0x5d65('0x71')]=0x0;_0x4ccae3[_0x5d65('0x72')]='NoSuchNumber';_0x4ccae3['countnosuchnumberretry']+=0x1;_0x4ccae3[_0x5d65('0xd2')]+=0x1;ami[_0x5d65('0x44')](_0x5d65('0x192'),ut[_0x5d65('0x10f')](_0x8d3dd1,_0x5d65('0x193')));_0x564907=_0x7e7e8[_0x5d65('0x18a')];_0x3906d4=_0x7e7e8['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x4ccae3)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x125')));if(_0x22b492[_0x5d65('0x182')](0x0,_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3[_0x5d65('0x119')]>=_0x7e7e8[_0x5d65('0x194')]){_0x22b492[_0x5d65('0x126')](_0x4ccae3,_0x189f44,_0x586f00,_0x5d65('0x195'));}else{_0x22b492[_0x5d65('0x11c')](_0x4ccae3,_0x189f44,_0x586f00,_0x5d65('0x195'));}}break;case'3':_0x7e7e8[_0x5d65('0x196')]+=0x1;_0x4ccae3[_0x5d65('0x71')]=0x3;_0x4ccae3['statedesc']=_0x5d65('0x197');_0x4ccae3['countnoanswerretry']+=0x1;_0x4ccae3['countglobal']+=0x1;var _0x19bc4d=ut[_0x5d65('0x198')](_0x8d3dd1,_0x7e7e8);ami[_0x5d65('0x44')]('custom:agentnoanswer',_0x19bc4d);_0x564907=_0x7e7e8[_0x5d65('0x184')];_0x3906d4=_0x7e7e8['callAdditionalPhoneAfterMin'];hopperUtils[_0x5d65('0xc9')](_0x4ccae3)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x199')));if(_0x22b492['checkRetriveMax'](0x3,_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3['countnoanswerretry']>=_0x7e7e8['dialNoAnswerMaxRetry']){_0x22b492[_0x5d65('0x126')](_0x4ccae3,_0x189f44,_0x586f00,'reason\x203\x20ringing\x20no\x20answer');}else{_0x22b492['stateGlobal'](_0x4ccae3,_0x189f44,_0x586f00,_0x5d65('0x19a'));}}break;case'5':_0x7e7e8[_0x5d65('0x19b')]+=0x1;_0x4ccae3[_0x5d65('0x71')]=0x5;_0x4ccae3[_0x5d65('0x72')]='Busy';_0x4ccae3[_0x5d65('0x116')]+=0x1;_0x4ccae3['countglobal']+=0x1;ami['emit'](_0x5d65('0x19c'),ut[_0x5d65('0x10f')](_0x8d3dd1,_0x5d65('0x19d')));_0x564907=_0x7e7e8[_0x5d65('0x187')];_0x3906d4=_0x7e7e8[_0x5d65('0xe6')];hopperUtils[_0x5d65('0xc9')](_0x4ccae3)['catch'](loggerCatch(_0x5d65('0x19e')));if(_0x22b492[_0x5d65('0x182')](0x5,_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3[_0x5d65('0x116')]>=_0x7e7e8['dialBusyMaxRetry']){_0x22b492['createStateFinal'](_0x4ccae3,_0x189f44,_0x586f00,'reason\x205\x20busy');}else{_0x22b492['stateGlobal'](_0x4ccae3,_0x189f44,_0x586f00,_0x5d65('0x19f'));}}break;case'8':_0x7e7e8[_0x5d65('0x1a0')]+=0x1;_0x4ccae3[_0x5d65('0x71')]=0x8;_0x4ccae3[_0x5d65('0x72')]=_0x5d65('0x1a1');_0x4ccae3[_0x5d65('0x117')]+=0x1;_0x4ccae3[_0x5d65('0xd2')]+=0x1;_0x564907=_0x7e7e8[_0x5d65('0x1a2')];_0x3906d4=_0x7e7e8['callAdditionalPhoneAfterMin'];ami[_0x5d65('0x44')]('custom:agentcongestion',ut['buildObj'](_0x8d3dd1,_0x5d65('0x1a3')));hopperUtils['createHistory'](_0x4ccae3)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x1a4')));if(_0x22b492[_0x5d65('0x182')](0x8,_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3[_0x5d65('0x117')]>=_0x7e7e8[_0x5d65('0x188')]){_0x22b492[_0x5d65('0x126')](_0x4ccae3,_0x189f44,_0x586f00,'reason\x208\x20congestion');}else{_0x22b492[_0x5d65('0x11c')](_0x4ccae3,_0x189f44,_0x586f00,'reason\x208\x20congestion');}}break;case'11':_0x7e7e8['outboundAbandonedCallsDay']+=0x1;_0x4ccae3[_0x5d65('0x71')]=0xb;_0x4ccae3[_0x5d65('0x72')]=_0x5d65('0xea');_0x4ccae3[_0x5d65('0xe7')]+=0x1;_0x4ccae3[_0x5d65('0xd2')]+=0x1;_0x564907=_0x7e7e8[_0x5d65('0xe9')];_0x3906d4=_0x7e7e8[_0x5d65('0xe6')];hopperUtils[_0x5d65('0xc9')](_0x4ccae3)['catch'](loggerCatch(_0x5d65('0x1a5')));if(_0x22b492['checkRetriveMax'](0xb,_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3[_0x5d65('0xe7')]>=_0x7e7e8['dialAbandonedMaxRetry']){_0x22b492[_0x5d65('0x126')](_0x4ccae3,_0x189f44,_0x586f00,'reason\x2011\x20abandoned');}else{_0x22b492[_0x5d65('0x11c')](_0x4ccae3,_0x189f44,_0x586f00,_0x5d65('0x1a6'));}}break;case'20':_0x7e7e8[_0x5d65('0x1a7')]+=0x1;_0x4ccae3[_0x5d65('0x71')]=0x14;_0x4ccae3[_0x5d65('0x72')]='AgentReject';_0x4ccae3['countagentrejectretry']+=0x1;_0x4ccae3['countglobal']+=0x1;_0x564907=_0x7e7e8[_0x5d65('0x1a8')];_0x3906d4=_0x7e7e8[_0x5d65('0xe6')];ami[_0x5d65('0x44')](_0x5d65('0x1a9'),ut[_0x5d65('0x10f')](_0x8d3dd1,_0x5d65('0x1aa')));hopperUtils[_0x5d65('0xc9')](_0x4ccae3)['catch'](loggerCatch(_0x5d65('0x1ab')));if(_0x22b492[_0x5d65('0x182')](0x14,_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3[_0x5d65('0x11a')]>=_0x7e7e8[_0x5d65('0x1ac')]){_0x22b492['createStateFinal'](_0x4ccae3,_0x189f44,_0x586f00,'reason\x2020\x20agentreject');}else{_0x22b492['stateGlobal'](_0x4ccae3,_0x189f44,_0x586f00,_0x5d65('0x1ad'));}}break;default:_0x7e7e8[_0x5d65('0x1ae')]+=0x1;_0x4ccae3[_0x5d65('0x71')]=0xc;_0x4ccae3[_0x5d65('0x72')]=_0x30dd83[_0x5d65('0x191')];_0x564907=_0x7e7e8['dialAgentRejectRetryFrequency'];_0x3906d4=_0x7e7e8[_0x5d65('0xe6')];hopperUtils[_0x5d65('0xc9')](_0x4ccae3)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x22b492[_0x5d65('0x182')](_0x30dd83[_0x5d65('0x191')],_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3[_0x5d65('0x116')]+_0x4ccae3[_0x5d65('0x117')]+_0x4ccae3[_0x5d65('0x118')]+_0x4ccae3[_0x5d65('0x119')]+_0x4ccae3[_0x5d65('0xd9')]+_0x4ccae3[_0x5d65('0xe7')]+_0x4ccae3[_0x5d65('0x114')]+_0x4ccae3[_0x5d65('0x11a')]>=_0x7e7e8['dialGlobalMaxRetry']){_0x22b492[_0x5d65('0x11c')](_0x4ccae3,_0x189f44,_0x586f00,_0x30dd83[_0x5d65('0x191')]);}else{_0x22b492[_0x5d65('0x126')](_0x4ccae3,_0x189f44,_0x586f00,_0x30dd83[_0x5d65('0x191')]);}}}})[_0x5d65('0x42')](function(){if(_0x592a74){hopperUtils[_0x5d65('0xe4')](_0x4ccae3,_0x564907,_0x3906d4)['then'](function(){return _0x189f44(0x1);});}});});};Dialer[_0x5d65('0x19')][_0x5d65('0x11c')]=function(_0x29f31b,_0x4adb35,_0xf6b0fb,_0x167289){var _0x433e8b=new Final(_0x29f31b);_0x433e8b[_0x5d65('0x71')]=0xf;_0x433e8b['statedesc']='Global';this['createStateFinal'](_0x433e8b,_0x4adb35,_0xf6b0fb,_0x167289);};Dialer[_0x5d65('0x19')][_0x5d65('0x126')]=function(_0x29eb6e,_0x26c4df,_0x4aaf4f,_0x127101){hopperUtils['moveContactManagedDialer'](_0x29eb6e)[_0x5d65('0x42')](function(){return _0x26c4df(msgResponse('[callProgressDetecting]',_0x5d65('0x1af'),_0x127101));})['catch'](function(){return _0x4aaf4f(msgResponse(_0x5d65('0x1b0'),_0x5d65('0xa6'),_0x5d65('0x1b1')));});};Dialer[_0x5d65('0x19')][_0x5d65('0x9')]=function(_0x3bef35){var _0x338725=_0x3bef35[_0x5d65('0x1b2')]/0x64;var _0x8f6158=_0x3bef35['outboundDropCallsDayTimeout']/(_0x3bef35['outboundDropCallsDayTimeout']+_0x3bef35[_0x5d65('0xc4')]);var _0x407c80=Math[_0x5d65('0x1b3')](_0x3bef35[_0x5d65('0x1b4')]*(_0x3bef35[_0x5d65('0x1b5')]/0x64));var _0x5f3fb0=Math[_0x5d65('0x1b3')](_0x3bef35[_0x5d65('0x1b4')]*(_0x3bef35[_0x5d65('0x1b6')]/0x64));var _0x16f563=_0x3bef35[_0x5d65('0x133')]+_0x3bef35[_0x5d65('0x135')];var _0x32f072=Math['floor'](_0x3bef35[_0x5d65('0x5d')]*_0x3bef35['erlangAbandonmentRate']*_0x3bef35['predictiveIntervalHitRate']*_0x3bef35['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x3bef35[_0x5d65('0x29')])){if(!_[_0x5d65('0x43')](_0x3bef35['startPredictive'])){_0x3bef35[_0x5d65('0x28')]=undefined;loggerPredictive['error'](_0x5d65('0x1b7'),_0x5d65('0x1b8'));}if(!_['isUndefined'](_0x3bef35[_0x5d65('0x65')])){loggerPredictive[_0x5d65('0x67')](_0x5d65('0x1b7'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3bef35[_0x5d65('0x65')]);_0x3bef35['handlePredictive']=undefined;}_0x3bef35[_0x5d65('0x29')]=moment()[_0x5d65('0x49')](_0x5d65('0xc2'));loggerPredictive[_0x5d65('0x4e')](_0x3bef35[_0x5d65('0x4a')],_0x5d65('0x1b9'),_0x3bef35[_0x5d65('0x29')]);this[_0x5d65('0xaf')](_0x3bef35,0x1);}else if(ifInterval(_0x3bef35['dialPredictiveInterval'],_0x3bef35[_0x5d65('0x29')])){this[_0x5d65('0xaf')](_0x3bef35,0x1);loggerPredictiveCalls['info'](_0x5d65('0x1ba'),_0x3bef35['startProgressive'],_0x3bef35[_0x5d65('0x4a')]);_0x3bef35['erlangCalls']=0x0;_0x3bef35[_0x5d65('0xd0')]=0x0;}else if(_0x338725<_0x8f6158&&_0x3bef35['dialPredictiveOptimization']===_0x5d65('0x1bb')){clearPredictiveAttributes(_0x3bef35);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x1bc'),_0x5d65('0x1bd'),_0x8f6158,'startProgressive',_0x3bef35[_0x5d65('0x4a')]);}else if(_0x32f072<_0x3bef35[_0x5d65('0xd0')]&&_0x3bef35['dialPredictiveOptimization']===_0x5d65('0x1bb')){clearPredictiveAttributes(_0x3bef35);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x5d65('0x1be'),_0x32f072,'Drop\x20in\x20this\x20interval',_0x3bef35[_0x5d65('0xd0')],_0x5d65('0x29'),_0x3bef35[_0x5d65('0x4a')]);}else if(!ifInterval(_0x3bef35[_0x5d65('0x1bf')],_0x3bef35[_0x5d65('0x29')])&&_[_0x5d65('0x43')](_0x3bef35[_0x5d65('0x28')])&&!_[_0x5d65('0x43')](_0x3bef35['startProgressive'])){_0x3bef35['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x5d65('0x4e')](_0x3bef35['name'],_0x5d65('0x1c0'),_0x3bef35[_0x5d65('0x28')]);hopperUtils[_0x5d65('0x1c1')](_0x3bef35['dialPredictiveInterval'])[_0x5d65('0x42')](this[_0x5d65('0x1c2')](_0x3bef35))[_0x5d65('0x42')](mergeDataErlangB(_0x3bef35))[_0x5d65('0x42')](this[_0x5d65('0x1c3')](_0x3bef35))[_0x5d65('0xa1')](loggerCatchPredictive(_0x5d65('0x1c4'),_0x3bef35));}else if(!ifInterval(_0x3bef35[_0x5d65('0x1bf')],_0x3bef35[_0x5d65('0x28')])){_0x3bef35[_0x5d65('0xd0')]=0x0;_0x3bef35[_0x5d65('0x28')]=moment()[_0x5d65('0x49')](_0x5d65('0xc2'));loggerPredictive['info'](_0x3bef35[_0x5d65('0x4a')],'recalculate\x20predictive\x20at',_0x3bef35[_0x5d65('0x28')]);clearInterval(_0x3bef35[_0x5d65('0x65')]);_0x3bef35[_0x5d65('0x65')]=undefined;hopperUtils[_0x5d65('0x1c1')](_0x3bef35['dialPredictiveInterval'])[_0x5d65('0x42')](this[_0x5d65('0x1c2')](_0x3bef35))['then'](mergeDataErlangB(_0x3bef35))[_0x5d65('0x42')](this[_0x5d65('0x1c3')](_0x3bef35))[_0x5d65('0xa1')](loggerCatchPredictive(_0x5d65('0x1c5'),_0x3bef35));}else if(_0x3bef35[_0x5d65('0x1b4')]&&_0x16f563<_0x3bef35[_0x5d65('0x1b4')]-_0x5f3fb0){clearPredictiveAttributes(_0x3bef35);loggerPredictive['info'](_0x3bef35[_0x5d65('0x4a')],_0x5d65('0x1c6'),_0x16f563,')\x20are\x20less\x20than\x20threshold\x20(',_0x3bef35[_0x5d65('0x1b4')],'-',_0x5f3fb0,'=',_0x3bef35[_0x5d65('0x1b4')]-_0x5f3fb0,')');}else if(_0x3bef35[_0x5d65('0x1b4')]&&_0x16f563>_0x3bef35[_0x5d65('0x1b4')]+_0x407c80){clearPredictiveAttributes(_0x3bef35);loggerPredictive[_0x5d65('0x4e')](_0x3bef35[_0x5d65('0x4a')],_0x5d65('0x1c6'),_0x16f563,_0x5d65('0x1c7'),_0x3bef35[_0x5d65('0x1b4')],'+',_0x407c80,'=',_0x3bef35['predictiveIntervalAvailable']+_0x407c80,')');}};Dialer[_0x5d65('0x19')][_0x5d65('0x1c2')]=function(_0x18dfa3){var _0x3d0fda=this;return function(_0x458415){return new Promise(function(_0x238013,_0x4693d6){_[_0x5d65('0x62')](_0x18dfa3,_0x458415[0x0]);if(checkGetDataPredictive(_0x458415[0x0])){var _0x1b6fdd=_0x18dfa3[_0x5d65('0x1b4')]=_0x18dfa3[_0x5d65('0x135')]+_0x18dfa3[_0x5d65('0x133')];var _0x4022de=_0x18dfa3[_0x5d65('0x1bf')]*0x3c;var _0x9259ce=_0x458415[0x0][_0x5d65('0x57')]+_0x458415[0x0][_0x5d65('0x5a')];var _0x458990=(_0x458415[0x0][_0x5d65('0x51')]+_0x458415[0x0][_0x5d65('0x53')]+_0x458415[0x0][_0x5d65('0x55')])/_0x458415[0x0][_0x5d65('0x50')];_0x18dfa3[_0x5d65('0x1c8')]=_0x458990>0x0?_0x458990:0x1;switch(_0x18dfa3[_0x5d65('0x1c9')]){case'dropRate':var _0x1f14e5=_0x18dfa3['dialPredictiveOptimizationPercentage']/0x64;return _0x3d0fda[_0x5d65('0x1ca')](_0x1b6fdd,_0x4022de,_0x9259ce,_0x458990,_0x1f14e5)[_0x5d65('0x42')](function(_0x34f90f){return _0x238013(_0x34f90f);});case _0x5d65('0x1cb'):var _0x3633d4=_0x18dfa3['dialPredictiveOptimizationPercentage']/0x64;return _0x3d0fda[_0x5d65('0x1cc')](_0x1b6fdd,_0x4022de,_0x9259ce,_0x458990,_0x3633d4)['then'](function(_0x2d173b){return _0x238013(_0x2d173b);});default:return _0x4693d6(msgResponse(_0x5d65('0x1cd'),_0x5d65('0xa6'),_0x5d65('0x1ce')));}}else{return _0x4693d6(msgResponse(_0x5d65('0x1cd'),'Failure','check\x20failure'));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x284381){var _0x52a0af=this;return function(_0x5cd4ec){return new Promise(function(_0x480783,_0x21274e){_[_0x5d65('0x62')](_0x284381,_0x5cd4ec[0x0]);if(checkGetDataPredictive(_0x5cd4ec[0x0])){loggerPredictive[_0x5d65('0x4e')](JSON['stringify'](_0x5cd4ec[0x0]));if(_0x284381[_0x5d65('0x1c9')]==='dropRate'){return _0x52a0af[_0x5d65('0x147')](_0x284381['id'])[_0x5d65('0x42')](function(_0x48a03f){var _0x36cb5b=_0x284381[_0x5d65('0x1cf')]-_0x48a03f[0x0][_0x5d65('0x1d0')];var _0x1d35c9=_0x284381[_0x5d65('0x1bf')]*0x3c;var _0x570a27=_0x5cd4ec[0x0]['predictiveIntervalAvgTalktime']+_0x5cd4ec[0x0]['predictiveIntervalAvgHoldtime'];var _0x24f1df=(_0x5cd4ec[0x0][_0x5d65('0x51')]+_0x5cd4ec[0x0][_0x5d65('0x53')]+_0x5cd4ec[0x0][_0x5d65('0x55')])/_0x5cd4ec[0x0][_0x5d65('0x50')];var _0x320023=_0x284381[_0x5d65('0x1b2')]/0x64;_0x284381[_0x5d65('0x1d1')]=_0x48a03f[0x0][_0x5d65('0x1d0')]||0x0;_0x284381[_0x5d65('0x1c8')]=_0x24f1df>0x0?_0x24f1df:0x1;return _0x52a0af[_0x5d65('0x1ca')](_0x36cb5b,_0x1d35c9,_0x570a27,_0x24f1df,_0x320023);})[_0x5d65('0x42')](function(_0x1b4ea3){return _0x480783(_0x1b4ea3);})[_0x5d65('0xa1')](function(_0x1bacbd){return _0x21274e(msgResponse(_0x5d65('0x1d2'),'Failure',JSON[_0x5d65('0x75')](_0x1bacbd)));});}if(_0x284381[_0x5d65('0x1c9')]===_0x5d65('0x1cb')){return _0x52a0af[_0x5d65('0x147')](_0x284381['id'])[_0x5d65('0x42')](function(_0x25efb3){var _0x1c49b7=_0x284381['loggedIn']-_0x25efb3[0x0][_0x5d65('0x1d0')];var _0x19e82b=_0x284381['dialPredictiveInterval']*0x3c;var _0x4c711a=_0x5cd4ec[0x0][_0x5d65('0x57')]+_0x5cd4ec[0x0][_0x5d65('0x5a')];var _0xc42ff5=(_0x5cd4ec[0x0][_0x5d65('0x51')]+_0x5cd4ec[0x0][_0x5d65('0x53')]+_0x5cd4ec[0x0][_0x5d65('0x55')])/_0x5cd4ec[0x0][_0x5d65('0x50')];var _0x3204db=_0x284381[_0x5d65('0x1b2')]/0x64;_0x284381[_0x5d65('0x1d1')]=_0x25efb3[0x0][_0x5d65('0x1d0')]||0x0;_0x284381['predictiveIntervalHitRate']=_0xc42ff5>0x0?_0xc42ff5:0x1;return _0x52a0af['busyFactor'](_0x1c49b7,_0x19e82b,_0x4c711a,_0xc42ff5,_0x3204db);})[_0x5d65('0x42')](function(_0x46d418){return _0x480783(_0x46d418);})[_0x5d65('0xa1')](function(_0x4a2583){return _0x21274e(msgResponse(_0x5d65('0x1d2'),_0x5d65('0xa6'),JSON[_0x5d65('0x75')](_0x4a2583)));});}}else{return _0x21274e(msgResponse(_0x5d65('0x1cd'),_0x5d65('0xa6'),'check\x20failure'));}});};};Dialer[_0x5d65('0x19')][_0x5d65('0x1c3')]=function(_0x4d2d17){var _0x179846=this;return function(){var _0x15c1e0=0x0;var _0x20d6bd=Math[_0x5d65('0x1d3')](_0x4d2d17[_0x5d65('0x5e')]*0x3e8);if(_0x20d6bd>0x0){_0x20d6bd=_0x20d6bd<0x64?0x64:_0x20d6bd;loggerPredictive['info'](_0x4d2d17['name'],_0x5d65('0x1d4'),_0x20d6bd,'milliseconds');_0x4d2d17['handlePredictive']=setInterval(function(){_0x179846[_0x5d65('0x65')](_0x4d2d17);loggerPredictiveCalls[_0x5d65('0x4e')](_0x5d65('0x1d5'),_0x15c1e0+=0x1);},_0x20d6bd);}else{loggerPredictive[_0x5d65('0x4e')](_0x4d2d17[_0x5d65('0x4a')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x5d65('0x19')][_0x5d65('0x1d6')]=function(_0x2e7ec1,_0x48ce1a){var _0x54165d=this;return function(_0x2ca176){if(_[_0x5d65('0x4c')](_0x2ca176)){if(_[_0x5d65('0xee')](_0x48ce1a['UserId'])||!_0x48ce1a['recallme']){if(_0x2e7ec1[_0x5d65('0xae')]===_0x5d65('0xb1')){_0x2e7ec1[_0x5d65('0x77')]=_[_0x5d65('0x43')](_0x2e7ec1[_0x5d65('0x77')])?!![]:_0x2e7ec1[_0x5d65('0x77')];var _0x7e1764=uuid['v4']();_0x54165d['actions'][_0x7e1764]=new Action(_0x2e7ec1,_0x48ce1a,_0x7e1764);loggerBooked[_0x5d65('0x4e')](_0x5d65('0x1d7'),_0x7e1764,_0x5d65('0x1d8'),JSON[_0x5d65('0x75')](_0x2e7ec1[_0x5d65('0x77')]),_0x5d65('0x1d9'),_0x2e7ec1[_0x5d65('0x4a')]);if(_0x2e7ec1[_0x5d65('0x77')]){_0x2e7ec1[_0x5d65('0x77')]=![];_0x54165d[_0x5d65('0x2b')][_0x54165d[_0x5d65('0x24')][_0x7e1764][_0x5d65('0xbf')]]=[];ami[_0x5d65('0x9b')]({'actionid':_0x7e1764,'action':_0x5d65('0x1da'),'queue':_0x2e7ec1[_0x5d65('0x4a')]})['catch'](function(){_0x54165d[_0x5d65('0xcd')](_0x2e7ec1);hopperUtils[_0x5d65('0xd8')]({'active':![],'ContactId':_0x54165d['actions'][_0x7e1764][_0x5d65('0xdb')],'ListId':_0x54165d[_0x5d65('0x24')][_0x7e1764][_0x5d65('0xdc')],'VoiceQueueId':_0x54165d[_0x5d65('0x24')][_0x7e1764]['VoiceQueueId']||undefined,'CampaignId':_0x54165d['actions'][_0x7e1764][_0x5d65('0xde')]||undefined})['catch'](loggerCatch(_0x5d65('0x1db')));delete _0x54165d[_0x5d65('0x24')][_0x7e1764];});}else{loggerBooked[_0x5d65('0x4e')](_0x5d65('0x1dc'),JSON['stringify'](_0x2e7ec1['queueStatusComplete']),'Queue:\x20',_0x2e7ec1[_0x5d65('0x4a')]);_0x54165d[_0x5d65('0xcd')](_0x2e7ec1);hopperUtils[_0x5d65('0xd8')]({'active':![],'ContactId':_0x54165d[_0x5d65('0x24')][_0x7e1764][_0x5d65('0xdb')],'ListId':_0x54165d['actions'][_0x7e1764]['ListId'],'VoiceQueueId':_0x54165d[_0x5d65('0x24')][_0x7e1764][_0x5d65('0xdd')]||undefined,'CampaignId':_0x54165d[_0x5d65('0x24')][_0x7e1764]['CampaignId']||undefined})['catch'](loggerCatch(_0x5d65('0x1db')));delete _0x54165d[_0x5d65('0x24')][_0x7e1764];}}else{return _0x54165d[_0x5d65('0x150')](_0x2e7ec1,_0x48ce1a);}}else{if(utils[_0x5d65('0x1dd')](undefined,_0x48ce1a[_0x5d65('0x1de')])<_0x2e7ec1[_0x5d65('0x1df')]*0x3c){if(_0x48ce1a[_0x5d65('0x1e0')]&&!_0x48ce1a['Agent'][_0x5d65('0x1e1')]){_0x54165d[_0x5d65('0x1e')][_0x5d65('0x1e2')](_0x48ce1a['id'])[_0x5d65('0x1c')](function(){_0x54165d[_0x5d65('0xcd')](_0x2e7ec1);});}else{hopperUtils[_0x5d65('0x1e3')]({'active':![]},_0x48ce1a['id'],0x1)[_0x5d65('0x1c')](function(){_0x54165d[_0x5d65('0xcd')](_0x2e7ec1);});}}else{_0x2e7ec1['outboundReCallsDay']+=0x1;_0x54165d['updateOriginated'](_0x2e7ec1);if(_0x2e7ec1[_0x5d65('0x1e4')]){hopperUtils[_0x5d65('0xd8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x48ce1a[_0x5d65('0xdb')],'ListId':_0x48ce1a[_0x5d65('0xdc')],'VoiceQueueId':_0x48ce1a[_0x5d65('0xdd')]||undefined,'CampaignId':_0x48ce1a[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x1e5')));hopperUtils['createHistory'](createObjHistory(_0x2e7ec1,_0x48ce1a,utils[_0x5d65('0x6d')]['QUEUE_RECALL'],0x17,_0x5d65('0x1e6')))[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x1e7')));}else{_0x54165d[_0x5d65('0x110')](createObjHistory(_0x2e7ec1,_0x48ce1a,utils[_0x5d65('0x6d')]['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0x5d65('0x1e8'),_0x5d65('0x1e9'));}}}}else{_0x2e7ec1[_0x5d65('0x1ea')]+=0x1;_0x54165d['saveInDb'](createObjHistory(_0x2e7ec1,_0x48ce1a,utils['CAMPAIGN_STATUS'][_0x5d65('0x1eb')],0xd,_0x5d65('0x1ec')),_0x5d65('0x1ed'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x5d65('0x19')][_0x5d65('0x1ee')]=function(_0x1fe28f){var _0x1fee52=this;var _0x1af0d3=_0x1fe28f[_0x5d65('0x1ef')]-_0x1fe28f[_0x5d65('0x7f')];emitCampaignSummary(_0x1fe28f);if(_0x1af0d3>0x0&&_0x1fe28f[_0x5d65('0x6a')]==0x0){if(_0x1af0d3>this[_0x5d65('0x22')]){_0x1af0d3=this[_0x5d65('0x22')];}_0x1fe28f['temp']=0x1;hopperUtils['getContactDialerIvr'](_0x1fe28f,_0x1af0d3)[_0x5d65('0x42')](function(_0x56e179){_0x1fe28f[_0x5d65('0x6a')]=0x0;if(_0x56e179){if(!utils[_0x5d65('0x1f0')](_0x56e179)){_0x1fe28f['message']=utils[_0x5d65('0x6d')][_0x5d65('0x70')];logger['info'](_0x5d65('0x1f1')+_0x1fe28f[_0x5d65('0x4a')]);}else{_0x1fe28f[_0x5d65('0x7f')]+=_0x56e179[_0x5d65('0x99')];_0x1fe28f[_0x5d65('0x6c')]=utils['CAMPAIGN_STATUS'][_0x5d65('0x1f2')];for(var _0x40a2c2=0x0;_0x40a2c2<_0x56e179[_0x5d65('0x99')];_0x40a2c2+=0x1){_0x1fe28f['ivrTotalCallsDays']+=0x1;if(_[_0x5d65('0xee')](_0x56e179[_0x40a2c2])||_[_0x5d65('0xee')](_0x56e179[_0x40a2c2]['Contact'])||_[_0x5d65('0xee')](_0x56e179[_0x40a2c2][_0x5d65('0x153')])){_0x1fee52[_0x5d65('0x14c')](_0x5d65('0x1f3'),_0x1fe28f,_0x56e179[_0x40a2c2]);}else{hopperUtils['checkIsBlackListIvr'](_['pick'](_0x56e179[_0x40a2c2],[_0x5d65('0xde'),_0x5d65('0x153')]))[_0x5d65('0x42')](_0x1fee52[_0x5d65('0x1d6')](_0x1fe28f,_0x56e179[_0x40a2c2]))[_0x5d65('0xa1')](_0x1fee52[_0x5d65('0x14b')](_0x5d65('0x1f4'),_0x1fe28f));}}}}})['catch'](loggerGetContactDialer(_0x5d65('0x1f5'),_0x1fe28f,_0x1af0d3));}};Dialer['prototype'][_0x5d65('0xaf')]=function(_0x38e0a5,_0x36dfdd){var _0x1e4156=this;var _0x1c9a45=[];if(_0x36dfdd<0x1||_0x38e0a5[_0x5d65('0xae')]==='booked'){_0x36dfdd=0x1;}var _0x5d42df=Math[_0x5d65('0x1d3')](_0x38e0a5['available']*_0x36dfdd)-_0x38e0a5['originated'];if(_0x38e0a5[_0x5d65('0x1f6')]>0x0){var _0x5deba4=_0x38e0a5[_0x5d65('0x1f6')]-_0x38e0a5['originated']-_0x38e0a5[_0x5d65('0x135')]-_0x38e0a5[_0x5d65('0x1f7')];if(_0x5d42df>_0x5deba4){_0x5d42df=_0x5deba4;}}if(_0x5d42df>0x0&&_0x38e0a5[_0x5d65('0x6a')]==0x0){if(_0x38e0a5[_0x5d65('0xae')]==='booked'){_0x5d42df=0x1;}if(_0x5d42df>this[_0x5d65('0x22')]){_0x5d42df=this[_0x5d65('0x22')];}for(var _0x31188b in this[_0x5d65('0x20')]){if(typeof this[_0x5d65('0x20')][_0x31188b]!=='undefined'){if(this[_0x5d65('0x20')][_0x31188b][_0x5d65('0x71')]===_0x5d65('0x1f8')&&this['agents'][_0x31188b][_0x5d65('0x89')]==='reachable'){_0x1c9a45['push'](this[_0x5d65('0x20')][_0x31188b]['id']);}}}_0x38e0a5[_0x5d65('0x6a')]=0x1;hopperUtils[_0x5d65('0x1f9')](_0x38e0a5,_0x1c9a45,_0x5d42df)[_0x5d65('0x42')](function(_0x2cd48c){_0x38e0a5[_0x5d65('0x6a')]=0x0;if(_0x2cd48c){if(!utils[_0x5d65('0x1f0')](_0x2cd48c)){hopperUtils['countReScheduled'](_0x38e0a5)[_0x5d65('0x42')](sendMessageReschedule(_0x38e0a5))[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x1fa')));}else{_0x38e0a5[_0x5d65('0x7f')]+=_0x2cd48c['length'];_0x38e0a5['message']=_0x38e0a5[_0x5d65('0xae')]===_0x5d65('0xb1')?utils[_0x5d65('0x6d')][_0x5d65('0x136')]:utils[_0x5d65('0x6d')][_0x5d65('0x1f2')];for(var _0x4eb1bf=0x0;_0x4eb1bf<_0x2cd48c[_0x5d65('0x99')];_0x4eb1bf+=0x1){if(_[_0x5d65('0xee')](_0x2cd48c[_0x4eb1bf])||_[_0x5d65('0xee')](_0x2cd48c[_0x4eb1bf][_0x5d65('0x16c')])||_[_0x5d65('0xee')](_0x2cd48c[_0x4eb1bf][_0x5d65('0x153')])){_0x1e4156[_0x5d65('0x14c')](_0x5d65('0x1f3'),_0x38e0a5,_0x2cd48c[_0x4eb1bf]);}else{hopperUtils['checkIsBlackList'](_[_0x5d65('0x76')](_0x2cd48c[_0x4eb1bf],[_0x5d65('0xdd'),'phone']))['then'](_0x1e4156[_0x5d65('0x1d6')](_0x38e0a5,_0x2cd48c[_0x4eb1bf]))[_0x5d65('0xa1')](_0x1e4156[_0x5d65('0x14b')](_0x5d65('0x1f3'),_0x38e0a5));}}}}})[_0x5d65('0xa1')](loggerGetContactDialer(_0x5d65('0x1fb'),_0x38e0a5,_0x5d42df));}};Dialer['prototype']['handlePredictive']=function(_0x50d486){if(_0x50d486[_0x5d65('0x1f6')]>0x0){var _0x497957=_0x50d486[_0x5d65('0x1f6')]-_0x50d486['originated']-_0x50d486[_0x5d65('0x135')];if(_0x497957>0x0&&_0x50d486[_0x5d65('0x6a')]==0x0){this[_0x5d65('0x1fc')](_0x50d486);}else{loggerPredictiveCalls[_0x5d65('0x4e')](_0x5d65('0x1fd'));}}else{this[_0x5d65('0x1fc')](_0x50d486);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x5a3bf9){var _0x5493ae=this;var _0x126208=[];_0x5a3bf9['originated']+=0x1;for(var _0x2089c8 in this[_0x5d65('0x20')]){if(typeof this[_0x5d65('0x20')][_0x2089c8]!==_0x5d65('0x149')){if(this[_0x5d65('0x20')][_0x2089c8][_0x5d65('0x71')]==='not_inuse'&&this[_0x5d65('0x20')][_0x2089c8]['status']==='reachable'){_0x126208[_0x5d65('0x9a')](this['agents'][_0x2089c8]['id']);}}}_0x5a3bf9[_0x5d65('0x6a')]=0x1;return this[_0x5d65('0x1f9')](_0x5a3bf9['id'],_0x126208,0x1,_0x5a3bf9[_0x5d65('0x1fe')],_0x5a3bf9)['then'](function(_0x34f80e){_0x5a3bf9[_0x5d65('0x6a')]=0x1;if(_0x34f80e){if(!utils['checkContactEmpty'](_0x34f80e)){utils[_0x5d65('0x69')](_0x5a3bf9,0x1,0x0);return hopperUtils['countReScheduled'](_0x5a3bf9)[_0x5d65('0x42')](sendMessageReschedule(_0x5a3bf9))['catch'](loggerCatch(_0x5d65('0x1fa')));}else{_0x5a3bf9[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x1f2')];if(_['isNil'](_0x34f80e[0x0])||_[_0x5d65('0xee')](_0x34f80e[0x0][_0x5d65('0x16c')])||_[_0x5d65('0xee')](_0x34f80e[0x0][_0x5d65('0x153')])){_0x5493ae[_0x5d65('0x14c')](_0x5d65('0x1f3'),_0x5a3bf9,_0x34f80e[0x0]);}else{return hopperUtils[_0x5d65('0x1ff')](_['pick'](_0x34f80e[0x0],['VoiceQueueId',_0x5d65('0x153')]))['then'](_0x5493ae[_0x5d65('0x1d6')](_0x5a3bf9,_0x34f80e[0x0]))[_0x5d65('0xa1')](_0x5493ae['loggerHandler'](_0x5d65('0x200'),_0x5a3bf9));}}}})['catch'](loggerGetContactDialer(_0x5d65('0x201'),_0x5a3bf9,0x1));};Dialer['prototype']['abandonmentRate']=function(_0x5ddfc5,_0x410fce,_0x476e84,_0x2a1ad0,_0xf5378f,_0x233127){loggerPredictive['info'](_0x5d65('0x202'));loggerPredictive['info'](_0x5d65('0x203'),_0x5ddfc5);loggerPredictive['info'](_0x5d65('0x204'),_0x410fce);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x476e84);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x205'),_0x2a1ad0);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x206'),_0xf5378f);loggerPredictive[_0x5d65('0x4e')]('---------------------------');return new Promise(function(_0x7e80e9,_0x1771d8){if(_0x5ddfc5<=0x0||isNaN(_0x5ddfc5)){return _0x1771d8(msgResponse('[abandonmentRate]',_0x5d65('0x85'),'m\x20=\x20'+_0x5ddfc5));}if(_0x476e84<=0x0||isNaN(_0x476e84)){return _0x1771d8(msgResponse(_0x5d65('0x207'),_0x5d65('0x85'),_0x5d65('0x208')+_0x476e84));}if(_0x2a1ad0<=0x0||isNaN(_0x2a1ad0)){return _0x1771d8(msgResponse(_0x5d65('0x207'),_0x5d65('0x85'),_0x5d65('0x209')+_0x2a1ad0));}if(_0x410fce<=0x0||isNaN(_0x410fce)){return _0x1771d8(msgResponse(_0x5d65('0x207'),_0x5d65('0x85'),_0x5d65('0x20a')+_0x410fce));}if(_0xf5378f<=0x0||isNaN(_0xf5378f)){return _0x1771d8(msgResponse(_0x5d65('0x207'),_0x5d65('0x85'),'Amax\x20=\x20'+_0xf5378f));}_0x233127=_0x233127||0x0;var _0x25e512=0x1/_0x476e84;var _0x318f10=0x0;var _0x52b614=0x0;var _0x5da34c=0x0;var _0x50f7c4=0x0;for(var _0x20ef8c=0x0;_0x5da34c<_0xf5378f;_0x20ef8c+=0x1){_0x52b614=_0x20ef8c/_0x410fce;_0x318f10=(_0x2a1ad0*_0x52b614+_0x233127)/_0x25e512;_0x5da34c=utils[_0x5d65('0x20b')](_0x318f10,_0x5ddfc5);_0x50f7c4=_0x318f10/_0x5ddfc5*(0x1-utils[_0x5d65('0x20b')](_0x318f10,_0x5ddfc5));}return _0x7e80e9({'erlangCalls':_0x20ef8c,'erlangCallToSecond':_0x410fce/_0x20ef8c,'erlangAbandonmentRate':_0x5da34c,'erlangBusyFactor':_0x50f7c4});});};Dialer[_0x5d65('0x19')][_0x5d65('0x1cc')]=function(_0x2718b0,_0x372a20,_0x2d9987,_0x3b4301,_0x346e82,_0x3ee6c0){loggerPredictive[_0x5d65('0x4e')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x203'),_0x2718b0);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x204'),_0x372a20);loggerPredictive[_0x5d65('0x4e')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2d9987);loggerPredictive['info'](_0x5d65('0x205'),_0x3b4301);loggerPredictive['info'](_0x5d65('0x20c'),_0x346e82);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x58'));return new Promise(function(_0x78fae1,_0x25c6e7){if(_0x2718b0<=0x0||isNaN(_0x2718b0)){return _0x25c6e7(msgResponse(_0x5d65('0x20d'),'Error','m\x20=\x20'+_0x2718b0));}if(_0x2d9987<=0x0||isNaN(_0x2d9987)){return _0x25c6e7(msgResponse(_0x5d65('0x20d'),'Error',_0x5d65('0x208')+_0x2d9987));}if(_0x3b4301<=0x0||isNaN(_0x3b4301)){return _0x25c6e7(msgResponse('[busyFactor]',_0x5d65('0x85'),_0x5d65('0x209')+_0x3b4301));}if(_0x372a20<=0x0||isNaN(_0x372a20)){return _0x25c6e7(msgResponse(_0x5d65('0x20d'),'Error',_0x5d65('0x20a')+_0x372a20));}if(_0x346e82<=0x0||isNaN(_0x346e82)){return _0x25c6e7(msgResponse(_0x5d65('0x20d'),_0x5d65('0x85'),_0x5d65('0x20e')+_0x346e82));}_0x3ee6c0=_0x3ee6c0||0x0;var _0x21413b=0x1/_0x2d9987;var _0x249e31=0x0;var _0x31d38c=0x0;var _0x1df7a6=0x0;var _0x37d055=0x0;for(var _0xe7bacb=0x0;_0x37d055<_0x346e82;_0xe7bacb+=0x1){_0x31d38c=_0xe7bacb/_0x372a20;_0x249e31=(_0x3b4301*_0x31d38c+_0x3ee6c0)/_0x21413b;_0x1df7a6=utils[_0x5d65('0x20b')](_0x249e31,_0x2718b0);_0x37d055=_0x249e31/_0x2718b0*(0x1-utils[_0x5d65('0x20b')](_0x249e31,_0x2718b0));}return _0x78fae1({'erlangCalls':_0xe7bacb,'erlangCallToSecond':_0x372a20/_0xe7bacb,'erlangAbandonmentRate':_0x1df7a6,'erlangBusyFactor':_0x37d055});});};module['exports']=Dialer; \ No newline at end of file +var _0x4749=['Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','countbusyretry','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Normal\x20Clearing','Unknow','queuesSummary','running','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','available','inUse','talking','pTalking','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','dialPreviewRecallmeReminder','online','resolve','Agent','user:%s','user:dialPreviewRecallReminder','clearZombieChannels','[uniqueid]','undefined','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','loggerHandler','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','launchHandleIvr','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','ACTIVE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','setXMDContactVariables','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','dialCongestionMaxRetry','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','dialAbandonedMaxRetry','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','dialGlobalMaxRetry','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','predictiveIntervalPauses','erlangCallToSecond','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','ivrTotalCallsDays','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','[countReScheduled]\x20','RUNNING','Contact','emptyContact','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','checkContactLowerLimitOriginate','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','lodash','ioredis','./utils','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','getSettings','then','previewRecallmeReminderInterval','emit','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','temp','contactsRescheduled','message','[getContactDialer2][ReScheduled]','contacts','CAMPAIGN_STATUS','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','\x20INTERVAL_IS_NULL','Interval','Intervals','NULL_INTERVAL','isEmpty','INACTIVE','format','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','Trunk','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','length','Action','command','iftime\x20%s,%s','interval','content','indexOf','catch','push','true','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','isIVRCampaignActive','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncCampaigns]','checkDialMethod','dialMethod','progressive','power','handlePower','dialPowerLevel','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','Error','queue','uniqueid','ivr','updateOriginated','answertime','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','moveContactManagedDialer','[syncAgentComplete]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','countdropretry','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','dialDropMaxRetry','queueCallerAbandonCreateState','additional','rescheduleContact','add','minutes','ContactId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','ListId','[rescheduleContact][Abandoned]','swapAdditionalPhones','channel','actionid','strategy','rrmemory','roundrobin','locked','paused','stateinterface','idHopper','preview','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','isNil','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','MACHINE'];(function(_0x556452,_0x6da702){var _0x1a41ae=function(_0x547fe0){while(--_0x547fe0){_0x556452['push'](_0x556452['shift']());}};_0x1a41ae(++_0x6da702);}(_0x4749,0x104));var _0x9474=function(_0x3950fc,_0x16b3ca){_0x3950fc=_0x3950fc-0x0;var _0x4f46ca=_0x4749[_0x3950fc];return _0x4f46ca;};'use strict';var util=require('util');var _=require(_0x9474('0x0'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var Redis=require(_0x9474('0x1'));var utils=require(_0x9474('0x2'));var hopperUtils=require(_0x9474('0x3'));var ut=require('../preview/util/util');var config=require(_0x9474('0x4'));var logger=require(_0x9474('0x5'))(_0x9474('0x6'));var loggerBooked=require(_0x9474('0x5'))(_0x9474('0x7'));var loggerPredictive=require(_0x9474('0x5'))(_0x9474('0x8'));var loggerPredictiveCalls=require('../../../config/logger')(_0x9474('0x9'));var loggerSyncQueueSummary=require(_0x9474('0x5'))(_0x9474('0xa'));var ami=require(_0x9474('0xb'));config[_0x9474('0xc')]=_[_0x9474('0xd')](config['redis'],{'host':_0x9474('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9474('0xc')]));var cmHopper=require(_0x9474('0xf'));var voiceQueueRt=require(_0x9474('0x10'));var RpcSetting=require(_0x9474('0x11'));var Interval=require(_0x9474('0x12'));var Action=require(_0x9474('0x13'));var History=require(_0x9474('0x14'));var Final=require(_0x9474('0x15'));var AgentComplete=require(_0x9474('0x16'));var QueueCallerAbandon=require(_0x9474('0x17'));var Hangup=require(_0x9474('0x18'));var ipAgi=process[_0x9474('0x19')][_0x9474('0x1a')]||_0x9474('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x9474('0x1c')][_0x9474('0x1d')]=function(_0x532f98){this[_0x9474('0x1e')]=this[_0x9474('0x1e')]?this['tail'][_0x9474('0x1f')](_0x532f98):_0x532f98();};function Dialer(_0x4695c8,_0x5ceddd){this['sequence']=new Sequence();this['preview']=_0x5ceddd;this[_0x9474('0x20')]=_0x4695c8[_0x9474('0x20')];this[_0x9474('0x21')]=_0x4695c8[_0x9474('0x21')];this[_0x9474('0x22')]=_0x4695c8['agents'];this[_0x9474('0x23')]=_0x4695c8[_0x9474('0x23')];this['maxNumberOriginate']=config[_0x9474('0x24')]||0x2;this[_0x9474('0x25')]={};this[_0x9474('0x26')]={};this['contactsId']={};this[_0x9474('0x27')]={};this[_0x9474('0x28')]={};this[_0x9474('0x29')]={};this[_0x9474('0x2a')]={};this[_0x9474('0x2b')]={};this[_0x9474('0x2c')]={};this['queueBookedRR']={};this['queuesSummary']={};ami['on'](_0x9474('0x2d'),this[_0x9474('0x2e')][_0x9474('0x2f')](this));ami['on'](_0x9474('0x30'),this[_0x9474('0x31')][_0x9474('0x2f')](this));ami['on'](_0x9474('0x32'),this[_0x9474('0x33')][_0x9474('0x2f')](this));ami['on'](_0x9474('0x34'),this[_0x9474('0x35')][_0x9474('0x2f')](this));ami['on'](_0x9474('0x36'),this[_0x9474('0xa')]['bind'](this));ami['on'](_0x9474('0x37'),this[_0x9474('0x38')]['bind'](this));ami['on'](_0x9474('0x39'),this[_0x9474('0x3a')][_0x9474('0x2f')](this));ami['on'](_0x9474('0x3b'),this[_0x9474('0x3c')][_0x9474('0x2f')](this));ami['on'](_0x9474('0x3d'),this['syncVarSet']['bind'](this));ami['on'](_0x9474('0x3e'),this[_0x9474('0x3f')][_0x9474('0x2f')](this));ami['on'](_0x9474('0x40'),this[_0x9474('0x41')]['bind'](this));this['loopCampaigns']();this['loopClearZombieChannels']();RpcSetting[_0x9474('0x42')]()[_0x9474('0x43')](function(_0x439cdc){previewRecallmeReminderInterval=_0x439cdc[_0x9474('0x44')];});}function isNotNull(_0x1353ff){return _0x1353ff!==null&&!_['isUndefined'](_0x1353ff);}function msgResponse(_0x1501fd,_0x521083,_0x5ba57b){return{'action':_0x1501fd,'response':_0x521083,'message':_0x5ba57b,'stack':_0x5ba57b};}function emit(_0x4a971a,_0x5bd327,_0x552980){io['to'](_0x4a971a)[_0x9474('0x45')](_0x5bd327,_0x552980);}function emitOutboundVoiceQueueSummary(_0x5d3ff2){if(_0x5d3ff2[_0x9474('0x46')]==='outbound'){logger[_0x9474('0x47')](_0x9474('0x48'),util[_0x9474('0x49')](_0x5d3ff2,{'showHidden':![],'depth':null}));emit(util['format'](_0x9474('0x4a'),_0x5d3ff2[_0x9474('0x4b')]),_0x9474('0x4c'),_0x5d3ff2);}}function checkGetDataPredictive(_0x37da36){if(isNotNull(_0x37da36)&&!_['isEmpty'](_0x37da36)){loggerPredictive[_0x9474('0x4d')](_0x9474('0x4e'));loggerPredictive[_0x9474('0x4d')](_0x9474('0x4f'),_0x37da36[_0x9474('0x50')]);loggerPredictive['info'](_0x9474('0x51'),_0x37da36[_0x9474('0x52')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x37da36[_0x9474('0x53')]);loggerPredictive[_0x9474('0x4d')](_0x9474('0x54'),_0x37da36[_0x9474('0x55')]);loggerPredictive[_0x9474('0x4d')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x37da36[_0x9474('0x56')]);loggerPredictive[_0x9474('0x4d')](_0x9474('0x57'),_0x37da36[_0x9474('0x58')]);loggerPredictive['info'](_0x9474('0x59'));if(_0x37da36[_0x9474('0x50')]>0x0){if(!_[_0x9474('0x5a')](_0x37da36['predictiveIntervalAvgTalktime'])&&_0x37da36['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x9474('0x4d')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x37da36[_0x9474('0x56')])&&_0x37da36[_0x9474('0x56')]>0x0){return!![];}loggerPredictive[_0x9474('0x4d')](_0x9474('0x5b'));}else{loggerPredictive[_0x9474('0x4d')](_0x9474('0x5c'));}}else{loggerPredictive[_0x9474('0x4d')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x4d215f){return function(_0x36989e){loggerPredictive[_0x9474('0x4d')](_0x9474('0x5d'));loggerPredictive[_0x9474('0x4d')](_0x9474('0x5e'),_0x36989e[_0x9474('0x5f')]);loggerPredictive['info'](_0x9474('0x60'),_0x36989e['erlangCallToSecond']);loggerPredictive[_0x9474('0x4d')](_0x9474('0x61'),_0x36989e[_0x9474('0x62')]);loggerPredictive[_0x9474('0x4d')](_0x9474('0x63'),_0x36989e['erlangBusyFactor']);loggerPredictive[_0x9474('0x4d')](_0x9474('0x61'),_0x36989e[_0x9474('0x62')]);loggerPredictive[_0x9474('0x4d')](_0x9474('0x59'));_[_0x9474('0x64')](_0x4d215f,_0x36989e);};}function ifInterval(_0x4cca9f,_0x2c8fe9){if(_[_0x9474('0x5a')](_0x2c8fe9)){return![];}return utils[_0x9474('0x65')](undefined,_0x2c8fe9)<_0x4cca9f*0x3c;}function clearPredictiveAttributes(_0x3d53df){if(_0x3d53df['startProgressive']){_0x3d53df[_0x9474('0x2a')]=undefined;loggerPredictive[_0x9474('0x47')](_0x3d53df['name'],'startProgressive\x20value\x20cleared');}if(_0x3d53df['startPredictive']){_0x3d53df[_0x9474('0x29')]=undefined;loggerPredictive[_0x9474('0x47')](_0x3d53df[_0x9474('0x4b')],_0x9474('0x66'));}if(_0x3d53df[_0x9474('0x67')]){clearInterval(_0x3d53df['handlePredictive']);_0x3d53df['handlePredictive']=undefined;loggerPredictive['debug'](_0x3d53df[_0x9474('0x4b')],_0x9474('0x68'));}}function loggerCatchPredictive(_0x53fd44,_0x869cc8){return function(_0x391c13){loggerPredictive['error'](_0x869cc8['name'],_0x53fd44);loggerPredictive[_0x9474('0x69')](_0x391c13['stack']);clearPredictiveAttributes(_0x869cc8);};}function loggerCatch(_0x1021bb){return function(_0x1867e1){logger[_0x9474('0x69')](_0x1021bb,util[_0x9474('0x49')](_0x1867e1,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x48ef79,_0x3d6de1,_0x59af5b){return function(_0x2ee94e){utils['checkContactLowerLimitOriginate'](_0x3d6de1,_0x59af5b,0x0);_0x3d6de1[_0x9474('0x6a')]=0x0;logger[_0x9474('0x69')](_0x48ef79,util['inspect'](_0x2ee94e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x9466c){return function(_0x50df81){if(isNotNull(_0x50df81)&&isNotNull(_0x50df81[0x0])){if(_0x50df81[0x0][_0x9474('0x6b')]>0x0){_0x9466c[_0x9474('0x6c')]=utils['CAMPAIGN_STATUS']['CONTACTS_RESCHEDULED'];logger['info'](_0x9474('0x6d')+_0x9466c[_0x9474('0x4b')],_0x50df81[0x0][_0x9474('0x6b')],_0x9474('0x6e'));}else{_0x9466c[_0x9474('0x6c')]=utils[_0x9474('0x6f')][_0x9474('0x70')];logger[_0x9474('0x4d')]('[getContactDialer2][Empty]'+_0x9466c[_0x9474('0x4b')]);}}};}function createObjHistory(_0xbf9516,_0xb4cc92,_0xbaf812,_0x384943,_0x389f05){_0xbf9516[_0x9474('0x6c')]=_0xbaf812;var _0x221501=new Action(_0xbf9516,_0xb4cc92);var _0x52739c=new History(_0x221501);_0x52739c[_0x9474('0x71')]=_0x384943;_0x52739c[_0x9474('0x72')]=_0x389f05;_0x52739c[_0x9474('0x73')]=_0x221501[_0x9474('0x74')];return _0x52739c;}function unlockQueueStatus(_0x3c58fe,_0x4a3111){setTimeout(function(){if(_['isUndefined'](_0x3c58fe[_0x9474('0x75')])){loggerBooked[_0x9474('0x69')](_0x9474('0x76'),_0x4a3111);}_0x3c58fe[_0x9474('0x75')]=!![];loggerBooked[_0x9474('0x4d')](_0x9474('0x77'),_0x4a3111,JSON[_0x9474('0x78')](_[_0x9474('0x79')](_0x3c58fe,[_0x9474('0x4b'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x7f59a2){return function(){if(!isNotNull(_0x7f59a2['Interval'])){_0x7f59a2[_0x9474('0x6c')]=utils[_0x9474('0x6f')]['NULL_INTERVAL'];throw _0x7f59a2[_0x9474('0x4b')]+_0x9474('0x7a');}if(!isNotNull(_0x7f59a2[_0x9474('0x7b')][_0x9474('0x7c')])){_0x7f59a2[_0x9474('0x6c')]=utils[_0x9474('0x6f')][_0x9474('0x7d')];throw _0x7f59a2[_0x9474('0x4b')]+_0x9474('0x7a');}if(!isNotNull(_[_0x9474('0x7e')](_0x7f59a2[_0x9474('0x7b')][_0x9474('0x7c')]))){_0x7f59a2[_0x9474('0x6c')]=utils[_0x9474('0x6f')][_0x9474('0x7d')];throw _0x7f59a2[_0x9474('0x4b')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x514e5f){return function(){if(!utils['isIVRCampaignActive'](_0x514e5f)){_0x514e5f['message']=utils[_0x9474('0x6f')][_0x9474('0x7f')];throw _0x514e5f['name']+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x4be073){if(utils['isIVRCampaign'](_0x4be073)){emit(util[_0x9474('0x80')]('campaign:ivr:%s',_0x4be073[_0x9474('0x4b')]),_0x9474('0x81'),_0x4be073);}}function loggerCatchQueueSummary(_0x5becab,_0x33b7d3){return function(_0x5e73b9){clearPredictiveAttributes(_0x33b7d3);emitCampaignSummary(_0x33b7d3);loggerSyncQueueSummary[_0x9474('0x47')](_0x5becab,util[_0x9474('0x49')](_0x5e73b9,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1aa943){if(_0x1aa943[_0x9474('0x82')]){if(_0x1aa943[_0x9474('0x83')]===0x0){_0x1aa943[_0x9474('0x82')]=![];_0x1aa943[_0x9474('0x6c')]=utils[_0x9474('0x6f')][_0x9474('0x7f')];loggerSyncQueueSummary[_0x9474('0x47')](_0x9474('0x84'),_0x1aa943[_0x9474('0x4b')],_0x9474('0x85'));}else{_0x1aa943[_0x9474('0x6c')]=utils[_0x9474('0x6f')][_0x9474('0x86')];loggerSyncQueueSummary['debug'](_0x9474('0x84'),_0x1aa943[_0x9474('0x4b')],_0x9474('0x87'));}emitCampaignSummary(_0x1aa943);}}function myreject(_0x2aa752){return function(_0x45526e){return _0x2aa752(msgResponse(_0x9474('0x88'),'Error',JSON[_0x9474('0x78')](_0x45526e)));};}Dialer[_0x9474('0x1c')][_0x9474('0x89')]=function(_0x59955c){return!_[_0x9474('0x5a')](_0x59955c)&&_0x59955c&&!_[_0x9474('0x5a')](_0x59955c['name'])&&!_[_0x9474('0x5a')](_0x59955c[_0x9474('0x8a')])&&_0x59955c[_0x9474('0x8a')]&&(this['trunks'][util[_0x9474('0x80')](_0x9474('0x8b'),_0x59955c['name'])][_0x9474('0x8c')]===_0x9474('0x8d')||this['trunks'][util[_0x9474('0x80')](_0x9474('0x8b'),_0x59955c['name'])]['status']===_0x9474('0x8e'));};Dialer['prototype']['checkIsTrunkReachable']=function(_0x470ba1){var _0x18e3fb=this;return function(){if(!_0x18e3fb[_0x9474('0x89')](_0x470ba1[_0x9474('0x8f')])){if(!_0x18e3fb[_0x9474('0x89')](_0x470ba1['TrunkBackup'])){_0x470ba1['message']=utils['CAMPAIGN_STATUS']['TRUNK_NOT_REACHABLE'];throw _0x470ba1['name']+_0x9474('0x90');}}};};Dialer[_0x9474('0x1c')]['checkIfTime']=function(_0x49f72b,_0x420f41,_0x4efe80,_0x1985c4){var _0x262cf4=this;return function(){var _0x10528e=!![];return _0x262cf4[_0x9474('0x91')](_0x49f72b,_0x420f41,_0x4efe80,_0x1985c4,_0x10528e);};};Dialer[_0x9474('0x1c')]['checkIfTimeIntervals']=function(_0x10ef04,_0x483290,_0xcbbc67,_0x34e990){var _0x174c3a=this;return function(){var _0x3cbb57=![];return _0x174c3a[_0x9474('0x91')](_0x10ef04[_0x9474('0x7c')],_0x483290,_0xcbbc67,_0x34e990,_0x3cbb57);};};Dialer[_0x9474('0x1c')][_0x9474('0x91')]=function(_0x1f2f10,_0x1676ee,_0x56f9d1,_0x1e67cf,_0x4e7c8c){var _0x2f5609=[];return new Promise(function(_0x216acd,_0x34b32a){if(!isNotNull(_0x1f2f10)){_0x1e67cf[_0x9474('0x6c')]=utils[_0x9474('0x6f')][_0x9474('0x7d')];return _0x34b32a(msgResponse(_0x9474('0x92'),_0x9474('0x93'),_0x56f9d1+_0x9474('0x94')));}if(_[_0x9474('0x7e')](_0x1f2f10)){_0x1e67cf[_0x9474('0x6c')]=utils['CAMPAIGN_STATUS']['EMPTY_INTERVAL'];return _0x34b32a(msgResponse(_0x9474('0x92'),_0x9474('0x93'),_0x56f9d1+_0x9474('0x95')));}if(_0x1676ee&&_[_0x9474('0x5a')](config[_0x9474('0x96')][_0x1676ee])){_0x1e67cf[_0x9474('0x6c')]=utils[_0x9474('0x6f')][_0x9474('0x97')];return _0x34b32a(msgResponse(_0x9474('0x92'),_0x9474('0x93'),_0x56f9d1+_0x9474('0x98')+_0x1676ee));}if(_['isArray'](_0x1f2f10)){for(var _0x25f1fc=0x0;_0x25f1fc<_0x1f2f10[_0x9474('0x99')];_0x25f1fc+=0x1){_0x2f5609['push'](ami[_0x9474('0x9a')]({'action':_0x9474('0x9b'),'command':util['format'](_0x9474('0x9c'),_0x1f2f10[_0x25f1fc][_0x9474('0x9d')],!_[_0x9474('0x5a')](config[_0x9474('0x96')][_0x1676ee])?_0x1676ee:'')})['then'](function(_0x355abd){return _0x355abd[_0x9474('0x9e')][_0x9474('0x9f')]('true')>=0x0;})[_0x9474('0xa0')](myreject(_0x34b32a)));}}else{_0x2f5609[_0x9474('0xa1')](ami[_0x9474('0x9a')]({'action':_0x9474('0x9b'),'command':util[_0x9474('0x80')](_0x9474('0x9c'),_0x1f2f10,!_[_0x9474('0x5a')](config['timezones'][_0x1676ee])?_0x1676ee:'')})[_0x9474('0x43')](function(_0x1081cf){return _0x1081cf[_0x9474('0x9e')][_0x9474('0x9f')](_0x9474('0xa2'))>=0x0;})[_0x9474('0xa0')](myreject(_0x34b32a)));}Promise[_0x9474('0xa3')](_0x2f5609)[_0x9474('0x43')](function(_0x5c7c09){var _0x426054=_[_0x9474('0xa4')](_0x5c7c09);if(_0x426054){return _0x216acd(_0x426054);}else{_0x1e67cf[_0x9474('0x6c')]=_0x4e7c8c?utils[_0x9474('0x6f')][_0x9474('0xa5')]:utils[_0x9474('0x6f')][_0x9474('0xa6')];return _0x34b32a(msgResponse(_0x9474('0xa7'),'Failure',_0x9474('0xa8')+_0x4e7c8c+'\x20'+_0x56f9d1+_0x9474('0xa9')+util[_0x9474('0x49')](_0x1f2f10,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x1676ee));}})['catch'](function(_0x182e85){return _0x34b32a(msgResponse('ifTime',_0x9474('0x93'),JSON['stringify'](_0x182e85)));});});};Dialer[_0x9474('0x1c')][_0x9474('0xaa')]=function(){var _0x1f742b=this;return cmHopper[_0x9474('0xab')]({'active':![]},{'where':{'active':!![]}})[_0x9474('0x43')](function(){setInterval(function(){_0x1f742b[_0x9474('0xac')]();},0x3e8);});};Dialer[_0x9474('0x1c')]['syncCampaigns']=function(){var _0x414e9d=this;var _0x20007b;for(var _0x3016b7 in this[_0x9474('0x21')]){if(typeof this[_0x9474('0x21')][_0x3016b7]!=='undefined'){_0x20007b=this[_0x9474('0x21')][_0x3016b7];if(utils['isIVRCampaign'](_0x20007b)&&utils[_0x9474('0xad')](_0x20007b)){_0x20007b[_0x9474('0x82')]=!![];Promise['resolve']()[_0x9474('0x43')](checkIsIVRCampaignActive(_0x20007b))[_0x9474('0x43')](checkInterval(_0x20007b))['then'](_0x414e9d[_0x9474('0xae')](_0x20007b))[_0x9474('0x43')](_0x414e9d['checkIfTime'](_0x20007b[_0x9474('0xaf')],_0x20007b[_0x9474('0xb0')],_0x20007b[_0x9474('0x4b')],_0x20007b))[_0x9474('0x43')](_0x414e9d[_0x9474('0xb1')](_0x20007b['Interval'],_0x20007b[_0x9474('0xb0')],_0x20007b['name'],_0x20007b))['then'](_0x414e9d['launchHandleIvr'](_0x20007b))[_0x9474('0xa0')](loggerCatchQueueSummary(_0x9474('0xb2'),_0x20007b));}else{notSendMessagesCampaign(_0x20007b);}}}};Dialer[_0x9474('0x1c')][_0x9474('0xb3')]=function(_0x5e2ff3){if(_0x5e2ff3[_0x9474('0xb4')]!==_0x9474('0x8')){clearPredictiveAttributes(_0x5e2ff3);}switch(_0x5e2ff3[_0x9474('0xb4')]){case _0x9474('0xb5'):this['handlePower'](_0x5e2ff3,0x1);break;case _0x9474('0xb6'):this[_0x9474('0xb7')](_0x5e2ff3,_0x5e2ff3[_0x9474('0xb8')]);break;case'predictive':this[_0x9474('0x8')](_0x5e2ff3);break;case _0x9474('0x7'):this[_0x9474('0xb7')](_0x5e2ff3,0x1);break;default:logger[_0x9474('0x69')]('Queue',_0x5e2ff3['name'],_0x9474('0xb9'));}};Dialer['prototype'][_0x9474('0x92')]=function(_0x136704,_0x3277dc){var _0x4b01b5=_0x136704[_0x9474('0xb0')];var _0x170d06=_0x3277dc?_0x136704[_0x9474('0xaf')]:_0x136704[_0x9474('0x7b')][_0x9474('0x7c')];logger[_0x9474('0xba')](_0x9474('0xbb'),_0x170d06,_0x4b01b5,_0x136704[_0x9474('0x4b')],util['format'](_0x9474('0xbc'),_0x136704['name'],_0x136704['id']));var _0x581675=null;return Interval[_0x9474('0xbd')](_0x170d06,_0x4b01b5)[_0x9474('0x43')](function(_0x5a396e){if(_0x5a396e===!![]){return _0x5a396e;}else{_0x136704['message']=_0x3277dc?utils[_0x9474('0x6f')][_0x9474('0xa5')]:utils[_0x9474('0x6f')][_0x9474('0xa6')];_0x581675=msgResponse(_0x9474('0xa7'),'Failure','Global:\x20'+_0x3277dc+'\x20'+_0x136704[_0x9474('0x4b')]+_0x9474('0xa9')+util[_0x9474('0x49')](_0x170d06,{'showHidden':![],'depth':null})+_0x9474('0xbe')+_0x4b01b5);}if(_0x581675!==null){logger[_0x9474('0xba')](_0x9474('0xbf'),_0x581675);_0x581675[_0x9474('0xc0')]=_0x3277dc;throw _0x581675;}})[_0x9474('0xa0')](function(_0x30cb66){logger[_0x9474('0x69')](_0x9474('0xc1'),_0x30cb66);throw msgResponse('[ifTime][Action]',_0x9474('0xc2'),util['inspect'](_0x30cb66,{'showHidden':![],'depth':null}));});};Dialer['prototype']['syncAgentConnect']=function(_0x2d7090){if(this[_0x9474('0x20')][_0x2d7090[_0x9474('0xc3')]]){if(this[_0x9474('0x27')][_0x2d7090[_0x9474('0xc4')]]&&this['uniqueId'][_0x2d7090[_0x9474('0xc4')]][_0x9474('0x46')]!==_0x9474('0xc5')){this[_0x9474('0xc6')](this['voiceQueues'][_0x2d7090['queue']]);this['uniqueId'][_0x2d7090[_0x9474('0xc4')]][_0x9474('0xc7')]=moment()[_0x9474('0x80')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x9474('0x1c')][_0x9474('0x35')]=function(_0x4f3cc3){var _0x2c916b=this[_0x9474('0x27')][_0x4f3cc3['uniqueid']];if(this[_0x9474('0x20')][_0x4f3cc3[_0x9474('0xc3')]]){if(_0x2c916b&&_0x2c916b[_0x9474('0x46')]!==_0x9474('0xc5')){delete this['uniqueId'][_0x4f3cc3['uniqueid']];this[_0x9474('0x20')][_0x4f3cc3[_0x9474('0xc3')]]['outboundAnswerCallsDay']+=0x1;var _0x3833f7=new AgentComplete(_0x2c916b,_0x4f3cc3);if(_0x4f3cc3[_0x9474('0xc8')]===_0x9474('0xc9')){_0x3833f7[_0x9474('0xca')]=this[_0x9474('0x20')][_0x4f3cc3[_0x9474('0xc3')]][_0x9474('0xcb')]&&this[_0x9474('0x20')][_0x4f3cc3['queue']][_0x9474('0xcc')]?moment()['format'](_0x9474('0xcd')):undefined;}hopperUtils[_0x9474('0xce')](_0x3833f7)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x9474('0xcf')](_0x3833f7)[_0x9474('0xa0')](loggerCatch(_0x9474('0xd0')));}}};Dialer[_0x9474('0x1c')][_0x9474('0x31')]=function(_0x49d0ee){var _0x146ba=this['uniqueId'][_0x49d0ee[_0x9474('0xc4')]];var _0x556737=this;var _0x29b63c=![];var _0x291de4;var _0x3d1f11;if(this['voiceQueues'][_0x49d0ee['queue']]){if(_0x146ba&&_0x146ba[_0x9474('0x46')]!==_0x9474('0xc5')){delete this['uniqueId'][_0x49d0ee[_0x9474('0xc4')]];this[_0x9474('0xc6')](this['voiceQueues'][_0x49d0ee['queue']]);_0x146ba[_0x9474('0xd1')]=moment()[_0x9474('0x80')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1c9483=new QueueCallerAbandon(_0x146ba,_0x49d0ee);if(utils[_0x9474('0x65')](_0x146ba['droptime'],_0x146ba[_0x9474('0xd2')])>=_0x146ba[_0x9474('0xd3')]){this['voiceQueues'][_0x49d0ee['queue']][_0x9474('0x53')]+=0x1;this['voiceQueues'][_0x49d0ee[_0x9474('0xc3')]][_0x9474('0xd4')]+=0x1;this[_0x9474('0x20')][_0x49d0ee[_0x9474('0xc3')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1c9483[_0x9474('0x71')]=0xa;_0x1c9483[_0x9474('0x72')]='Drop';_0x1c9483['dropreason']='TIMEOUT';_0x1c9483[_0x9474('0xca')]=this[_0x9474('0x20')][_0x49d0ee['queue']][_0x9474('0xcb')]?moment()[_0x9474('0x80')](_0x9474('0xcd')):undefined;_0x1c9483[_0x9474('0xd5')]+=0x1;_0x1c9483[_0x9474('0xd6')]+=0x1;_0x291de4=this[_0x9474('0x20')][_0x49d0ee[_0x9474('0xc3')]][_0x9474('0xd7')];_0x3d1f11=this[_0x9474('0x20')][_0x49d0ee[_0x9474('0xc3')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x9474('0xd8')](_0x1c9483,_0x1c9483[_0x9474('0x71')],_0x146ba['voiceQueue'])[_0x9474('0x43')](function(_0x5297ed){_0x29b63c=_0x5297ed['additional']==0x1;if(_0x1c9483['countdropretry']>=_0x556737[_0x9474('0x20')][_0x49d0ee[_0x9474('0xc3')]][_0x9474('0xd9')]){_0x556737[_0x9474('0xda')](_0x1c9483,_0x5297ed[_0x9474('0xdb')]);}else{hopperUtils[_0x9474('0xdc')]({'active':![],'countdropretry':_0x1c9483['countdropretry'],'scheduledat':moment()[_0x9474('0xdd')](_0x556737[_0x9474('0x20')][_0x49d0ee['queue']][_0x9474('0xd7')],_0x9474('0xde'))[_0x9474('0x80')](_0x9474('0xcd')),'ContactId':_0x146ba[_0x9474('0xdf')],'ListId':_0x146ba['ListId'],'VoiceQueueId':_0x146ba[_0x9474('0xe0')]||undefined,'CampaignId':_0x146ba[_0x9474('0xe1')]||undefined})[_0x9474('0xa0')](loggerCatch(_0x9474('0xe2')));var _0x476029=new History(_0x1c9483);_0x476029[_0x9474('0x71')]=0xa;_0x476029[_0x9474('0x72')]=_0x9474('0xe3');_0x476029[_0x9474('0x74')]=moment()[_0x9474('0x80')]('YYYY-MM-DD\x20HH:mm:ss');_0x476029[_0x9474('0x73')]=_0x476029[_0x9474('0x74')];_0x476029['calleridname']=_0x1c9483[_0x9474('0xe4')];_0x476029[_0x9474('0xe5')]=_0x1c9483[_0x9474('0xe5')];hopperUtils[_0x9474('0xce')](_0x476029)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x9474('0x43')](function(){if(_0x29b63c)hopperUtils['swapAdditionalPhones'](_0x1c9483,_0x291de4,_0x3d1f11)[_0x9474('0x43')](function(){return 0x1;});});}else{this[_0x9474('0x20')][_0x49d0ee[_0x9474('0xc3')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x49d0ee[_0x9474('0xc3')]][_0x9474('0xe6')]+=0x1;_0x1c9483[_0x9474('0x71')]=0xb;_0x1c9483['statedesc']=_0x9474('0xe7');_0x1c9483['dropreason']=_0x9474('0xe8');_0x1c9483[_0x9474('0xe9')]+=0x1;_0x1c9483['countglobal']+=0x1;_0x291de4=this[_0x9474('0x20')][_0x49d0ee[_0x9474('0xc3')]][_0x9474('0xea')];_0x3d1f11=this[_0x9474('0x20')][_0x49d0ee[_0x9474('0xc3')]][_0x9474('0xeb')];hopperUtils[_0x9474('0xd8')](_0x1c9483,_0x1c9483[_0x9474('0x71')],_0x146ba[_0x9474('0xec')])[_0x9474('0x43')](function(_0x4b7e71){if(_0x1c9483[_0x9474('0xe9')]>=_0x556737['voiceQueues'][_0x49d0ee[_0x9474('0xc3')]]['dialAbandonedMaxRetry']){_0x556737[_0x9474('0xda')](_0x1c9483,_0x4b7e71['additional']);}else{hopperUtils[_0x9474('0xdc')]({'active':![],'countabandonedretry':_0x1c9483[_0x9474('0xe9')],'scheduledat':moment()[_0x9474('0xdd')](_0x556737[_0x9474('0x20')][_0x49d0ee['queue']][_0x9474('0xea')],_0x9474('0xde'))[_0x9474('0x80')](_0x9474('0xcd')),'ContactId':_0x146ba['ContactId'],'ListId':_0x146ba[_0x9474('0xed')],'VoiceQueueId':_0x146ba[_0x9474('0xe0')]||undefined,'CampaignId':_0x146ba[_0x9474('0xe1')]||undefined})[_0x9474('0xa0')](loggerCatch(_0x9474('0xee')));var _0xc129b9=new History(_0x1c9483);_0xc129b9[_0x9474('0x71')]=0xb;_0xc129b9['statedesc']=_0x9474('0xe7');_0xc129b9[_0x9474('0x74')]=moment()[_0x9474('0x80')](_0x9474('0xcd'));_0xc129b9['endtime']=_0xc129b9[_0x9474('0x74')];_0xc129b9[_0x9474('0xe4')]=_0x1c9483['calleridname'];_0xc129b9['calleridnum']=_0x1c9483[_0x9474('0xe5')];hopperUtils[_0x9474('0xce')](_0xc129b9)[_0x9474('0xa0')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x9474('0x43')](function(){if(_0x29b63c)hopperUtils[_0x9474('0xef')](_0x1c9483,_0x291de4,_0x3d1f11)[_0x9474('0x43')](function(){return 0x1;});});}}}};Dialer['prototype']['syncNewExten']=function(_0x6f3348){if(this['actions'][_0x6f3348['uniqueid']]){this[_0x9474('0x26')][_0x6f3348['uniqueid']][_0x9474('0xf0')]=_0x6f3348['channel'];}if(this['uniqueId'][_0x6f3348[_0x9474('0xc4')]]){this['uniqueId'][_0x6f3348[_0x9474('0xc4')]][_0x9474('0xf0')]=_0x6f3348[_0x9474('0xf0')];}};Dialer[_0x9474('0x1c')][_0x9474('0x3f')]=function(_0xf66bb4){if(!this['actions'][_0xf66bb4[_0x9474('0xf1')]]){return;}var _0x267bcd=this['voiceQueues'][this['actions'][_0xf66bb4[_0x9474('0xf1')]]['queue']][_0x9474('0xf2')]||_0x9474('0xf3');if(_0x267bcd===_0x9474('0xf4')){if(this[_0x9474('0x26')][_0xf66bb4['actionid']]&&_['isNil'](this[_0x9474('0x26')][_0xf66bb4[_0x9474('0xf1')]][_0x9474('0xf5')])&&_0xf66bb4[_0x9474('0x8c')]==='1'&&_0xf66bb4[_0x9474('0xf6')]==='0'){if(this[_0x9474('0x22')][_0xf66bb4['stateinterface']]){if(!this[_0x9474('0x22')][_0xf66bb4[_0x9474('0xf7')]][_0x9474('0xf5')]){this[_0x9474('0x22')][_0xf66bb4[_0x9474('0xf7')]]['locked']=!![];this[_0x9474('0x26')][_0xf66bb4[_0x9474('0xf1')]]['locked']=!![];this[_0x9474('0x26')][_0xf66bb4[_0x9474('0xf1')]][_0x9474('0xf7')]=_0xf66bb4[_0x9474('0xf7')];}}}}else if(_0x267bcd===_0x9474('0xf3')){if(this['actions'][_0xf66bb4[_0x9474('0xf1')]]){if(this[_0x9474('0x22')][_0xf66bb4[_0x9474('0xf7')]]){this[_0x9474('0x26')][_0xf66bb4[_0x9474('0xf1')]][_0x9474('0xf7')]=_0xf66bb4[_0x9474('0xf7')];if(_['isNil'](this[_0x9474('0x2c')][this['actions'][_0xf66bb4[_0x9474('0xf1')]][_0x9474('0xc3')]])){this[_0x9474('0x2c')][this[_0x9474('0x26')][_0xf66bb4[_0x9474('0xf1')]]['queue']]=[];}this['queueBooked'][this[_0x9474('0x26')][_0xf66bb4[_0x9474('0xf1')]][_0x9474('0xc3')]][_0x9474('0xa1')](_[_0x9474('0x64')](_['pick'](this['actions'][_0xf66bb4[_0x9474('0xf1')]],[_0x9474('0xf8'),'stateinterface']),{'status':_0xf66bb4['status'],'paused':_0xf66bb4[_0x9474('0xf6')]}));}}}};Dialer[_0x9474('0x1c')][_0x9474('0x41')]=function(_0x964b6b){if(!this[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]]){return;}var _0x42b37a=this;var _0x3929ee=this[_0x9474('0x20')][this[_0x9474('0x26')][_0x964b6b['actionid']]['queue']];var _0x486ab0=_0x3929ee[_0x9474('0xf2')]||_0x9474('0xf3');if(_0x486ab0===_0x9474('0xf4')){if(this[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]]&&this[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]][_0x9474('0xf7')]){this[_0x9474('0xf9')][_0x9474('0xfa')](this[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]]['idHopper'],this[_0x9474('0x26')][_0x964b6b['actionid']][_0x9474('0xf7')])[_0x9474('0xa0')](function(_0x3deab3){logger[_0x9474('0x69')](_0x9474('0xfb'),util[_0x9474('0x49')](_0x3deab3,{'showHidden':![],'depth':null}));})[_0x9474('0x1f')](function(){_0x42b37a['updateOriginated'](_0x42b37a[_0x9474('0x20')][_0x42b37a[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]][_0x9474('0xc3')]]);_0x42b37a['agents'][_0x42b37a[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]]['stateinterface']][_0x9474('0xf5')]=![];delete _0x42b37a[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]];unlockQueueStatus(_0x3929ee);});}else{this[_0x9474('0xc6')](this[_0x9474('0x20')][this[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]][_0x9474('0xc3')]]);hopperUtils[_0x9474('0xdc')]({'active':![],'ContactId':this[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]][_0x9474('0xdf')],'ListId':this[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]][_0x9474('0xed')],'VoiceQueueId':this['actions'][_0x964b6b[_0x9474('0xf1')]][_0x9474('0xe0')]||undefined,'CampaignId':this[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x9474('0xfc')));delete this[_0x9474('0x26')][_0x964b6b['actionid']];unlockQueueStatus(_0x3929ee);}}else if(_0x486ab0===_0x9474('0xf3')){var _0x53a690;if(this[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]]&&!_[_0x9474('0x7e')](this[_0x9474('0x2c')][this['actions'][_0x964b6b['actionid']]['queue']])){if(this[_0x9474('0xfd')][_0x42b37a[_0x9474('0x26')][_0x964b6b['actionid']][_0x9474('0xc3')]]){this[_0x9474('0xfd')][_0x42b37a[_0x9474('0x26')][_0x964b6b['actionid']]['queue']]=this['queueBookedRR'][this['actions'][_0x964b6b[_0x9474('0xf1')]][_0x9474('0xc3')]]?this[_0x9474('0xfd')][this['actions'][_0x964b6b['actionid']][_0x9474('0xc3')]]:this[_0x9474('0x2c')][this[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]][_0x9474('0xc3')]]?this[_0x9474('0x2c')][this[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]]['queue']][_0x9474('0xfe')]||0x0:0x0;}this['queueBooked'][this[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]][_0x9474('0xc3')]][_0x9474('0xfe')]=this['queueBookedRR'][this[_0x9474('0x26')][_0x964b6b[_0x9474('0xf1')]][_0x9474('0xc3')]];for(var _0x1b8172=0x0;_0x1b8172=_0x284407['dialGlobalMaxRetry']){_0x273a8b[_0x9474('0x125')](_0x517046,_0x304ee6,_0x241015,_0x9474('0x126'));}else{if(_0x517046[_0x9474('0x11f')]>=_0x284407[_0x9474('0x127')]){_0x273a8b['createStateFinal'](_0x517046,_0x304ee6,_0x241015,_0x9474('0x128'));}else{hopperUtils[_0x9474('0xdc')]({'active':![],'countmachineretry':_0x517046['countmachineretry'],'scheduledat':moment()[_0x9474('0xdd')](_0x284407[_0x9474('0x129')],'minutes')['format'](_0x9474('0xcd')),'ContactId':_0x517046[_0x9474('0xdf')],'ListId':_0x517046[_0x9474('0xed')],'VoiceQueueId':_0x517046[_0x9474('0xe0')]||undefined,'CampaignId':_0x517046[_0x9474('0xe1')]||undefined})[_0x9474('0xa0')](loggerCatch(_0x9474('0x12a')));_0x304ee6({'reschedule':0x1});}}});}if(_0x4c2e48[_0x9474('0x46')]===_0x9474('0xc5')&&this[_0x9474('0x21')][_0x4c2e48[_0x9474('0xc3')]][_0x9474('0x111')]&&_0x46a389[_0x9474('0x112')]===_0x9474('0x113')){delete this['uniqueId'][_0x46a389[_0x9474('0xc4')]];this[_0x9474('0xc6')](this['campaigns'][_0x4c2e48[_0x9474('0xc3')]]);_0xa1f352=new Hangup(_0x4c2e48,_0x46a389);_0xa1f352[_0x9474('0x71')]=0x12;_0xa1f352['statedesc']=_0x9474('0x12b');_0xa1f352[_0x9474('0x116')]=_0x9474('0x117');ami[_0x9474('0x45')](_0x9474('0x118'),ut[_0x9474('0x119')](_0xa1f352,_0x9474('0x11a')));this['saveInDb'](_0xa1f352,_0x9474('0x12c'),'[syncHangupInAMDIvr]');}if(_0x4c2e48['type']===_0x9474('0xc5')&&this[_0x9474('0x21')][_0x4c2e48[_0x9474('0xc3')]][_0x9474('0x111')]&&_0x46a389['value']===_0x9474('0x11d')){return new Promise(function(_0x597f45,_0x3401bd){delete _0x273a8b['uniqueId'][_0x46a389[_0x9474('0xc4')]];_0x273a8b[_0x9474('0xc6')](_0x273a8b[_0x9474('0x21')][_0x4c2e48[_0x9474('0xc3')]]);_0x273a8b[_0x9474('0x21')][_0x4c2e48['queue']][_0x9474('0x114')]+=0x1;_0x273a8b['campaigns'][_0x4c2e48['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x10e1c7=_0x273a8b[_0x9474('0x21')][_0x4c2e48[_0x9474('0xc3')]];var _0x7e0281=new Hangup(_0x4c2e48,_0x46a389);_0x7e0281[_0x9474('0x71')]=0x13;_0x7e0281[_0x9474('0x72')]=_0x9474('0x11e');_0x7e0281[_0x9474('0x116')]=_0x9474('0x117');_0x7e0281[_0x9474('0x11f')]+=0x1;_0x7e0281[_0x9474('0xd6')]+=0x1;_0x7e0281[_0x9474('0x11a')]=!![];ami[_0x9474('0x45')](_0x9474('0x118'),ut[_0x9474('0x119')](_0x7e0281,_0x9474('0x11a')));hopperUtils[_0x9474('0xce')](_0x7e0281)[_0x9474('0xa0')](loggerCatch(_0x9474('0x120')));if(_0x7e0281[_0x9474('0x12d')]+_0x7e0281['countcongestionretry']+_0x7e0281[_0x9474('0x122')]+_0x7e0281[_0x9474('0x123')]+_0x7e0281[_0x9474('0xd5')]+_0x7e0281[_0x9474('0xe9')]+_0x7e0281[_0x9474('0x11f')]+_0x7e0281['countagentrejectretry']>=_0x10e1c7['dialGlobalMaxRetry']){_0x273a8b[_0x9474('0x125')](_0x7e0281,_0x597f45,_0x3401bd,_0x9474('0x126'));}else{if(_0x7e0281[_0x9474('0x11f')]>=_0x10e1c7[_0x9474('0x127')]){_0x273a8b[_0x9474('0x12e')](_0x7e0281,_0x597f45,_0x3401bd,_0x9474('0x128'));}else{hopperUtils[_0x9474('0xdc')]({'active':![],'countmachineretry':_0x7e0281[_0x9474('0x11f')],'scheduledat':moment()[_0x9474('0xdd')](_0x10e1c7[_0x9474('0x129')],_0x9474('0xde'))[_0x9474('0x80')](_0x9474('0xcd')),'ContactId':_0x7e0281[_0x9474('0xdf')],'ListId':_0x7e0281[_0x9474('0xed')],'VoiceQueueId':_0x7e0281[_0x9474('0xe0')]||undefined,'CampaignId':_0x7e0281['CampaignId']||undefined})[_0x9474('0xa0')](loggerCatch(_0x9474('0x12a')));_0x597f45({'reschedule':0x1});}}});}}};Dialer[_0x9474('0x1c')][_0x9474('0x3a')]=function(_0x2b50db){var _0x4473ab=this[_0x9474('0x27')][_0x2b50db[_0x9474('0xc4')]];var _0x4e1549;if(_0x4473ab&&_0x4473ab['type']===_0x9474('0xc5')){delete this[_0x9474('0x27')][_0x2b50db['uniqueid']];this[_0x9474('0xc6')](this[_0x9474('0x21')][_0x4473ab[_0x9474('0xc3')]]);this[_0x9474('0x21')][_0x4473ab[_0x9474('0xc3')]][_0x9474('0x12f')]+=0x1;_0x4e1549=new Hangup(_0x4473ab,_0x2b50db);hopperUtils[_0x9474('0xce')](_0x4e1549)[_0x9474('0xa0')](loggerCatch(_0x9474('0x130')));hopperUtils['moveContactManagedDialer'](_0x4e1549)[_0x9474('0xa0')](loggerCatch(_0x9474('0x131')));}if(_0x4473ab&&_0x4473ab[_0x9474('0x46')]!==_0x9474('0xc5')&&isNotNull(this[_0x9474('0x20')][_0x4473ab[_0x9474('0xc3')]][_0x9474('0x132')])){delete this[_0x9474('0x27')][_0x2b50db[_0x9474('0xc4')]];this[_0x9474('0xc6')](this[_0x9474('0x20')][_0x4473ab[_0x9474('0xc3')]]);this[_0x9474('0x20')][_0x4473ab['queue']][_0x9474('0x114')]+=0x1;this[_0x9474('0x20')][_0x4473ab[_0x9474('0xc3')]][_0x9474('0x115')]+=0x1;_0x4e1549=new Hangup(_0x4473ab,_0x2b50db);_0x4e1549[_0x9474('0x71')]=0x10;_0x4e1549[_0x9474('0x72')]=_0x9474('0x133');_0x4e1549[_0x9474('0x116')]='AGI';hopperUtils['createHistory'](_0x4e1549)[_0x9474('0xa0')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x9474('0xcf')](_0x4e1549)[_0x9474('0xa0')](loggerCatch(_0x9474('0x131')));}if(_0x4473ab&&_0x4473ab[_0x9474('0x46')]!==_0x9474('0xc5')&&!isNotNull(this[_0x9474('0x20')][_0x4473ab[_0x9474('0xc3')]]['dialQueueProject'])){if(_0x2b50db[_0x9474('0x134')]===_0x9474('0x135')){delete this[_0x9474('0x27')][_0x2b50db[_0x9474('0xc4')]];this[_0x9474('0x20')][_0x4473ab['queue']][_0x9474('0x114')]+=0x1;const _0x25ad40=new AgentComplete(_0x4473ab,_0x2b50db);_0x25ad40[_0x9474('0xe1')]=this[_0x9474('0x20')][_0x4473ab['queue']]['id'];hopperUtils[_0x9474('0xce')](_0x25ad40)[_0x9474('0xa0')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x9474('0xcf')](_0x25ad40)[_0x9474('0xa0')](loggerCatch(_0x9474('0xd0')));}else{delete this[_0x9474('0x27')][_0x2b50db[_0x9474('0xc4')]];this['updateOriginated'](this[_0x9474('0x20')][_0x4473ab[_0x9474('0xc3')]]);this[_0x9474('0x20')][_0x4473ab[_0x9474('0xc3')]]['outboundUnknownCallsDay']+=0x1;_0x4e1549=new Hangup(_0x4473ab,_0x2b50db);_0x4e1549[_0x9474('0x71')]=0xc;_0x4e1549[_0x9474('0x72')]=_0x2b50db[_0x9474('0x134')];_0x4e1549['membername']=_0x9474('0x136');hopperUtils[_0x9474('0xce')](_0x4e1549)[_0x9474('0xa0')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x9474('0xcf')](_0x4e1549)[_0x9474('0xa0')](loggerCatch(_0x9474('0x131')));}}};Dialer['prototype']['syncQueueSummary']=function(_0x1a3328){var _0x477faf=this;if(!_0x477faf[_0x9474('0x137')][_0x1a3328['name']]){_0x477faf[_0x9474('0x137')][_0x1a3328[_0x9474('0x4b')]]={'running':![]};}else if(_0x477faf[_0x9474('0x137')][_0x1a3328[_0x9474('0x4b')]][_0x9474('0x138')]===!![]){return;}else if(_0x477faf[_0x9474('0x137')][_0x1a3328[_0x9474('0x4b')]]['running']===![]){_0x477faf[_0x9474('0x137')][_0x1a3328[_0x9474('0x4b')]][_0x9474('0x138')]=!![];}var _0x80c7f4=_0x477faf[_0x9474('0x20')][_0x1a3328['name']];var _0x17a49d=_0x80c7f4['message']!==utils[_0x9474('0x6f')][_0x9474('0x7f')];var _0x1c1fce=utils[_0x9474('0x139')](_0x80c7f4);_0x80c7f4['statusMessage']=utils[_0x9474('0x13a')](_0x80c7f4,_0x477faf['trunks']);Promise['resolve']()['then'](function(){if(_0x80c7f4[_0x9474('0x13b')]===utils[_0x9474('0x6f')][_0x9474('0x7f')]){if(_0x17a49d){clearPredictiveAttributes(_0x80c7f4);_0x1a3328[_0x9474('0x29')]=undefined;_0x1a3328[_0x9474('0x2a')]=undefined;}if(_0x80c7f4[_0x9474('0x13b')]===utils[_0x9474('0x6f')]['INACTIVE']){_0x1a3328[_0x9474('0x13c')]=0x0;_0x1a3328[_0x9474('0xf6')]=0x0;_0x1a3328[_0x9474('0x13d')]=0x0;_0x1a3328[_0x9474('0x13e')]=0x0;_0x1a3328[_0x9474('0x13f')]=0x0;}}else if(_0x80c7f4[_0x9474('0x13b')]===utils[_0x9474('0x6f')]['ACTIVE']&&!_0x1c1fce){return _0x477faf['ifTime'](_0x80c7f4,!![])[_0x9474('0x43')](function(){return _0x477faf[_0x9474('0x92')](_0x80c7f4,![]);})[_0x9474('0x43')](function(){return _0x477faf[_0x9474('0xb3')](_0x80c7f4);})[_0x9474('0xa0')](function(_0x5bb86b){loggerSyncQueueSummary[_0x9474('0x47')](_0x9474('0x140'),util[_0x9474('0x49')](_0x5bb86b,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x80c7f4);});}else{clearPredictiveAttributes(_0x80c7f4);}})['then'](function(){var _0x6f3f7c=_0x1a3328[_0x9474('0x141')](_0x80c7f4);if(_0x6f3f7c||_0x80c7f4['queueSummaryCountersUpdated']){_0x80c7f4[_0x9474('0x142')]=![];_0x1a3328[_0x9474('0x143')](_0x80c7f4);Object[_0x9474('0x144')](_0x80c7f4,_0x1a3328);emitOutboundVoiceQueueSummary(_0x1a3328);}_0x477faf['queuesSummary'][_0x80c7f4[_0x9474('0x4b')]]['running']=![];})[_0x9474('0xa0')](function(_0x247e51){logger[_0x9474('0x69')]('[syncQueueSummary]',util['inspect'](_0x247e51,{'showHidden':![],'depth':null}));_0x477faf['queuesSummary'][_0x80c7f4['name']]['running']=![];});};Dialer['prototype'][_0x9474('0x38')]=_['throttle'](function(){var _0xca51db=_['filter'](this[_0x9474('0x20')],function(_0x3a7a80){return _0x3a7a80[_0x9474('0x145')];});var _0xfa9c15=_['filter'](this[_0x9474('0x22')],function(_0x4d0ea8){return _0x4d0ea8[_0x9474('0x146')]&&_0x4d0ea8[_0x9474('0x8c')]===_0x9474('0x8d');});if(_0xca51db['length']>0x0&&_0xfa9c15['length']>0x0){return Promise[_0x9474('0x147')]()['then'](cmHopper['handlePreviewRecallNotifications'](_['map'](_0xca51db,'id'),previewRecallmeReminderInterval,_['map'](_0xfa9c15,'id')))[_0x9474('0x43')](function(_0x1c1a01){for(var _0xdeb5b1=0x0;_0xdeb5b1<_0x1c1a01[_0x9474('0x99')];_0xdeb5b1++){var _0x5d2a96=_0x1c1a01[_0xdeb5b1][_0x9474('0x148')][_0x9474('0x4b')];if(_0x5d2a96)io['to'](util[_0x9474('0x80')](_0x9474('0x149'),_0x5d2a96))[_0x9474('0x45')](_0x9474('0x14a'),{'hopper':_0x1c1a01[_0xdeb5b1]});}})['catch'](function(_0x488a5b){logger[_0x9474('0x69')]('checkPreviewRecallReminder',_0x488a5b);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x9474('0x1c')]['loopClearZombieChannels']=function(){var _0x3f9b81=this;setInterval(function(){_0x3f9b81[_0x9474('0x14b')](_0x3f9b81['uniqueId'],_0x9474('0x14c'));_0x3f9b81[_0x9474('0x14b')](_0x3f9b81[_0x9474('0x26')],'[actions]');},0x32c8);};Dialer[_0x9474('0x1c')][_0x9474('0x14b')]=function(_0x150ab3,_0x5c464e){var _0x5ec1ed=this;for(var _0x45e1c3 in _0x150ab3){if(typeof _0x150ab3[_0x45e1c3]!==_0x9474('0x14d')){this['sequence'][_0x9474('0x1d')](function(){if(!_[_0x9474('0x103')](_0x150ab3[_0x45e1c3])){return ami[_0x9474('0x9a')]({'action':_0x9474('0x8c'),'channel':_0x150ab3[_0x45e1c3][_0x9474('0xf0')]})[_0x9474('0xa0')](function(_0x5e055e){if(_0x5e055e[_0x9474('0x6c')]===_0x9474('0x14e')){setTimeout(function(){if(_0x150ab3[_0x45e1c3]&&_0x150ab3[_0x45e1c3]['type']!=='ivr'){_0x5ec1ed['updateOriginated'](_0x5ec1ed[_0x9474('0x20')][_0x150ab3[_0x45e1c3]['queue']]);logger[_0x9474('0x69')](_0x9474('0x14f'),_0x5c464e,_0x45e1c3,_0x150ab3[_0x45e1c3]['queue']);delete _0x150ab3[_0x45e1c3];}if(_0x150ab3[_0x45e1c3]&&_0x150ab3[_0x45e1c3][_0x9474('0x46')]==='ivr'){_0x5ec1ed[_0x9474('0xc6')](_0x5ec1ed[_0x9474('0x21')][_0x150ab3[_0x45e1c3][_0x9474('0xc3')]]);logger['error'](_0x9474('0x150'),_0x5c464e,_0x45e1c3,_0x150ab3[_0x45e1c3]['queue']);delete _0x150ab3[_0x45e1c3];}},0x2328);}});}});}}};Dialer[_0x9474('0x1c')]['getVoiceQueueRtPauses']=function(_0x5931c9){return Promise[_0x9474('0x147')]()['then'](voiceQueueRt[_0x9474('0x151')](_0x5931c9))[_0x9474('0xa0')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0x9474('0xc6')]=function(_0x4c7414){if(!_[_0x9474('0x5a')](_0x4c7414)&&_0x4c7414!==null){if(typeof _0x4c7414[_0x9474('0x83')]!==_0x9474('0x14d')){if(_0x4c7414['originated']>0x0){_0x4c7414[_0x9474('0x83')]-=0x1;}else{logger[_0x9474('0x69')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x9474('0x152')]=function(_0x2bf70b,_0x7ee868){var _0x1ed889=this;return function(_0x56abc7){_0x1ed889[_0x9474('0xc6')](_0x7ee868);logger[_0x9474('0x69')](_0x2bf70b,util[_0x9474('0x49')](_0x56abc7,{'showHidden':![],'depth':null}));};};Dialer[_0x9474('0x1c')]['emptyContact']=function(_0x14b19f,_0x467271,_0x43fbca){var _0x87697c={'state':0x19,'statedesc':_0x9474('0x153')};this['updateOriginated'](_0x467271);this['saveInDb'](_[_0x9474('0x64')](_0x87697c,_[_0x9474('0x79')](_0x43fbca,[_0x9474('0xdf'),_0x9474('0xed'),_0x9474('0x154'),_0x9474('0xe0'),_0x9474('0xe1')])),_0x9474('0x155'),_0x9474('0x156'));logger[_0x9474('0x69')](_0x14b19f);};Dialer[_0x9474('0x1c')][_0x9474('0x11b')]=function(_0x30ae8e,_0x49b481,_0x5ac61b){hopperUtils['createHistory'](_0x30ae8e)['catch'](loggerCatch(_0x49b481));hopperUtils[_0x9474('0xcf')](_0x30ae8e)['catch'](loggerCatch(_0x5ac61b));};Dialer[_0x9474('0x1c')][_0x9474('0xda')]=function(_0x1e3ebd,_0x445077){hopperUtils[_0x9474('0xce')](_0x1e3ebd)[_0x9474('0xa0')](loggerCatch(_0x9474('0x157')));if(_0x445077==0x0){hopperUtils[_0x9474('0xcf')](_0x1e3ebd)[_0x9474('0xa0')](loggerCatch(_0x9474('0x158')));}};Dialer[_0x9474('0x1c')]['checkPreviewRecallReminder']=function(_0x5c4ee8){return Promise['resolve']()[_0x9474('0x43')](cmHopper['handlePreviewRecallNotifications'](_0x5c4ee8['id'],previewRecallmeReminderInterval))['then'](function(_0x3b1147){for(var _0x297474=0x0;_0x297474<_0x3b1147[_0x9474('0x99')];_0x297474++){var _0x344f1b=_0x3b1147[_0x297474][_0x9474('0x148')][_0x9474('0x4b')];if(_0x344f1b)io['to'](util[_0x9474('0x80')]('user:%s',_0x344f1b))[_0x9474('0x45')](_0x9474('0x14a'),{'hopper':_0x3b1147[_0x297474]});}})[_0x9474('0xa0')](function(){});};Dialer[_0x9474('0x1c')][_0x9474('0x159')]=function(_0x55b723){var _0x281f0d=this;return function(){_0x281f0d[_0x9474('0x15a')](_0x55b723);};};Dialer[_0x9474('0x1c')][_0x9474('0x15b')]=function(_0x151c62,_0x4bf616){var _0x265fc5=this;var _0x1b908f=uuid['v4']();this[_0x9474('0x26')][_0x1b908f]=new Action(_0x151c62,_0x4bf616,_0x1b908f);return new Promise(function(_0x549670,_0x42f073){if(_[_0x9474('0x5a')](_0x151c62)&&typeof _0x151c62!==_0x9474('0x15c')){return _0x42f073(msgResponse(_0x9474('0x15d'),'Failure',_0x9474('0x15e')));}if(_[_0x9474('0x5a')](_0x4bf616[_0x9474('0x15f')])||_0x4bf616[_0x9474('0x15f')]===null){return _0x42f073(msgResponse(_0x9474('0x15d'),'Failure','contact\x20is\x20undefine'));}var _0x57ec28={'XMD-CALLERID':_0x265fc5[_0x9474('0x26')][_0x1b908f][_0x9474('0x160')](),'XMD-AGI':_0x151c62['dialQueueProject']?util[_0x9474('0x80')](_0x9474('0x161'),ipAgi,_0x151c62['dialQueueProject']):_0x9474('0x162'),'XMD-AGIAFTER':_0x151c62[_0x9474('0xcb')]?util[_0x9474('0x80')](_0x9474('0x161'),ipAgi,_0x151c62[_0x9474('0xcb')]):_0x9474('0x162'),'XMD-QUEUE':utils[_0x9474('0x163')](_0x151c62)?util[_0x9474('0x80')](_0x9474('0x164'),_0x151c62[_0x9474('0x4b')],_0x151c62['dialQueueOptions']||'',_0x151c62[_0x9474('0xcc')]?'c':'',_0x151c62[_0x9474('0xd3')]||0x3):_0x9474('0x162'),'XMD-CONTACTID':_0x4bf616[_0x9474('0xdf')],'XMD-CDRTYPE':_0x9474('0x6'),'CALLERID(all)':_0x265fc5[_0x9474('0x26')][_0x1b908f][_0x9474('0x160')](),'XMD-AMD':_0x151c62['dialAMDActive']?_0x9474('0x165'):_0x9474('0x162'),'XMD-DESTINATION':_0x9474('0x110')};if(_0x151c62[_0x9474('0x111')]){_0x57ec28['XMD-AMDINITIALSILENCE']=_0x151c62['dialAMDInitialSilence']||0x9c4;_0x57ec28[_0x9474('0x166')]=_0x151c62['dialAMDGreeting']||0x5dc;_0x57ec28[_0x9474('0x167')]=_0x151c62[_0x9474('0x168')]||0x320;_0x57ec28[_0x9474('0x169')]=_0x151c62[_0x9474('0x16a')]||0x1388;_0x57ec28[_0x9474('0x16b')]=_0x151c62[_0x9474('0x16c')]||0x64;_0x57ec28[_0x9474('0x16d')]=_0x151c62['dialAMDBetweenWordsSilence']||0x32;_0x57ec28[_0x9474('0x16e')]=_0x151c62[_0x9474('0x16f')]||0x3;_0x57ec28[_0x9474('0x170')]=_0x151c62['dialAMDSilenceThreshold']||0x100;_0x57ec28[_0x9474('0x171')]=_0x151c62[_0x9474('0x172')]||0x1388;}if(utils[_0x9474('0x163')](_0x151c62)){_0x57ec28['XMD-VOICEQUEUEID']=_0x4bf616[_0x9474('0xe0')];}else{_0x57ec28[_0x9474('0x173')]=_0x4bf616[_0x9474('0xe1')];}var _0x37ff05=utils[_0x9474('0x174')](_0x4bf616['Contact']);Object['assign'](_0x57ec28,_0x37ff05);var _0x349ead=_0x265fc5[_0x9474('0x89')](_0x151c62['Trunk'])?utils['getCallerId'](_0x151c62[_0x9474('0x8f')][_0x9474('0x175')],_0x151c62[_0x9474('0x176')],_0x151c62[_0x9474('0x177')]>0x0?utils['getCallerIdRandom'](_0x151c62['dialOriginateCallerIdNumber'],_0x151c62[_0x9474('0x177')]):_0x151c62[_0x9474('0x178')]):utils['getCallerId'](_[_0x9474('0x103')](_0x151c62[_0x9474('0x179')])?_0x151c62[_0x9474('0x8f')][_0x9474('0x175')]:_0x151c62[_0x9474('0x179')][_0x9474('0x175')],_0x151c62[_0x9474('0x176')],_0x151c62[_0x9474('0x177')]>0x0?utils[_0x9474('0x17a')](_0x151c62['dialOriginateCallerIdNumber'],_0x151c62[_0x9474('0x177')]):_0x151c62[_0x9474('0x178')]);if(_0x349ead){_0x57ec28[_0x9474('0x17b')]=_0x265fc5[_0x9474('0x26')][_0x1b908f][_0x9474('0x17c')]=utils[_0x9474('0x17d')](_0x349ead);_0x57ec28['XMD-ORIGINATECALLERIDNUM']=_0x4bf616[_0x9474('0x15f')];}_0x151c62['variables']=_0x57ec28;return ami[_0x9474('0x9a')]({'actionid':_0x1b908f,'action':_0x9474('0x15d'),'channel':_0x265fc5['isTrunkReachable'](_0x151c62['Trunk'])?util['format'](_0x9474('0x17e'),_0x151c62[_0x9474('0x8f')][_0x9474('0x4b')],isNotNull(_0x151c62[_0x9474('0x17f')])?_0x151c62[_0x9474('0x17f')][_0x9474('0x180')]()||'':'',_0x151c62[_0x9474('0x181')]>0x0?_0x4bf616[_0x9474('0x15f')][_0x9474('0x182')](_0x151c62[_0x9474('0x181')]):_0x4bf616[_0x9474('0x15f')]):util[_0x9474('0x80')]('SIP/%s/%s%s',_[_0x9474('0x103')](_0x151c62['TrunkBackup'])?_0x151c62[_0x9474('0x8f')][_0x9474('0x4b')]:_0x151c62[_0x9474('0x179')][_0x9474('0x4b')],isNotNull(_0x151c62['dialPrefix'])?_0x151c62[_0x9474('0x17f')][_0x9474('0x180')]()||'':'',_0x151c62[_0x9474('0x181')]>0x0?_0x4bf616['phone'][_0x9474('0x182')](_0x151c62[_0x9474('0x181')]):_0x4bf616['phone']),'callerid':_0x349ead,'Exten':_0x9474('0x110'),'Context':'from-sip','Priority':'1','variable':_0x57ec28,'timeout':(_0x151c62[_0x9474('0x183')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1b908f})[_0x9474('0x43')](function(_0x2895ce){return _0x549670(_0x2895ce);})[_0x9474('0xa0')](function(_0x5569fa){_0x151c62['outboundOriginateFailureCallsDay']+=0x1;var _0x58718c=new History(_0x265fc5[_0x9474('0x26')][_0x1b908f]);logger[_0x9474('0x69')](util[_0x9474('0x80')](_0x9474('0x184'),JSON['stringify'](_0x5569fa)));_0x58718c[_0x9474('0x71')]=0xe;_0x58718c['statedesc']=_0x9474('0x185');_0x58718c[_0x9474('0x74')]=moment()['format'](_0x9474('0xcd'));_0x58718c[_0x9474('0x73')]=_0x58718c[_0x9474('0x74')];hopperUtils[_0x9474('0xce')](_0x58718c)[_0x9474('0xa0')](loggerCatch(_0x9474('0x186')));_0x265fc5['moveContactManagedDialer'](_0x58718c)[_0x9474('0xa0')](loggerCatch(_0x9474('0x186')))[_0x9474('0x1f')](function(){delete _0x265fc5[_0x9474('0x26')][_0x1b908f];return _0x42f073(msgResponse(_0x9474('0x15d'),_0x9474('0xc2'),_0x9474('0x187')));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x2c6c3e,_0x6a48cc,_0x47981c){var _0x4f5e25=new History(_0x6a48cc);if(_0x4f5e25['countbusyretry']+_0x4f5e25[_0x9474('0x121')]+_0x4f5e25[_0x9474('0x122')]+_0x4f5e25['countnosuchnumberretry']+_0x4f5e25[_0x9474('0xd5')]+_0x4f5e25[_0x9474('0xe9')]+_0x4f5e25['countmachineretry']+_0x4f5e25[_0x9474('0x124')]>=_0x47981c['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x2c6c3e){case 0x3:if(_0x4f5e25[_0x9474('0x122')]>=_0x47981c[_0x9474('0x188')]-0x1){return!![];}hopperUtils[_0x9474('0xdc')]({'active':![],'countnoanswerretry':_0x4f5e25[_0x9474('0x122')]+=0x1,'scheduledat':moment()['add'](_0x47981c[_0x9474('0x189')],_0x9474('0xde'))[_0x9474('0x80')](_0x9474('0xcd')),'ContactId':_0x4f5e25[_0x9474('0xdf')],'ListId':_0x4f5e25[_0x9474('0xed')],'VoiceQueueId':_0x4f5e25['VoiceQueueId']||undefined,'CampaignId':_0x4f5e25[_0x9474('0xe1')]||undefined})[_0x9474('0xa0')](loggerCatch(_0x9474('0x18a')));break;case 0x5:if(_0x4f5e25[_0x9474('0x12d')]>=_0x47981c[_0x9474('0x18b')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x4f5e25['countbusyretry']+=0x1,'scheduledat':moment()[_0x9474('0xdd')](_0x47981c[_0x9474('0x18c')],_0x9474('0xde'))[_0x9474('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f5e25[_0x9474('0xdf')],'ListId':_0x4f5e25[_0x9474('0xed')],'VoiceQueueId':_0x4f5e25[_0x9474('0xe0')]||undefined,'CampaignId':_0x4f5e25[_0x9474('0xe1')]||undefined})[_0x9474('0xa0')](loggerCatch(_0x9474('0x18d')));break;case 0x8:if(_0x4f5e25[_0x9474('0x121')]>=_0x47981c['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x9474('0xdc')]({'active':![],'countcongestionretry':_0x4f5e25['countcongestionretry']+=0x1,'scheduledat':moment()[_0x9474('0xdd')](_0x47981c[_0x9474('0x18e')],'minutes')['format'](_0x9474('0xcd')),'ContactId':_0x4f5e25[_0x9474('0xdf')],'ListId':_0x4f5e25[_0x9474('0xed')],'VoiceQueueId':_0x4f5e25['VoiceQueueId']||undefined,'CampaignId':_0x4f5e25[_0x9474('0xe1')]||undefined})[_0x9474('0xa0')](loggerCatch(_0x9474('0x18f')));break;case 0x0:if(_0x4f5e25['countnosuchnumberretry']>=_0x47981c['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x9474('0xdc')]({'active':![],'countnosuchnumberretry':_0x4f5e25['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x47981c[_0x9474('0x190')],_0x9474('0xde'))[_0x9474('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f5e25['ContactId'],'ListId':_0x4f5e25[_0x9474('0xed')],'VoiceQueueId':_0x4f5e25[_0x9474('0xe0')]||undefined,'CampaignId':_0x4f5e25['CampaignId']||undefined})[_0x9474('0xa0')](loggerCatch(_0x9474('0x191')));}break;case 0xa:if(_0x4f5e25[_0x9474('0xd5')]>=_0x47981c[_0x9474('0xd9')]-0x1){return!![];}hopperUtils[_0x9474('0xdc')]({'active':![],'countdropretry':_0x4f5e25[_0x9474('0xd5')]+=0x1,'scheduledat':moment()['add'](_0x47981c[_0x9474('0xd7')],_0x9474('0xde'))[_0x9474('0x80')](_0x9474('0xcd')),'ContactId':_0x4f5e25[_0x9474('0xdf')],'ListId':_0x4f5e25['ListId'],'VoiceQueueId':_0x4f5e25[_0x9474('0xe0')]||undefined,'CampaignId':_0x4f5e25[_0x9474('0xe1')]||undefined})[_0x9474('0xa0')](loggerCatch(_0x9474('0xe2')));break;case 0xb:if(_0x4f5e25[_0x9474('0xe9')]>=_0x47981c['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x4f5e25[_0x9474('0xe9')]+=0x1,'scheduledat':moment()[_0x9474('0xdd')](_0x47981c[_0x9474('0xea')],_0x9474('0xde'))[_0x9474('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f5e25[_0x9474('0xdf')],'ListId':_0x4f5e25[_0x9474('0xed')],'VoiceQueueId':_0x4f5e25[_0x9474('0xe0')]||undefined,'CampaignId':_0x4f5e25[_0x9474('0xe1')]||undefined})[_0x9474('0xa0')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x4f5e25['countmachineretry']>=_0x47981c[_0x9474('0x127')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4f5e25[_0x9474('0x11f')]+=0x1,'scheduledat':moment()[_0x9474('0xdd')](_0x47981c['dialMachineRetryFrequency'],_0x9474('0xde'))['format'](_0x9474('0xcd')),'ContactId':_0x4f5e25[_0x9474('0xdf')],'ListId':_0x4f5e25[_0x9474('0xed')],'VoiceQueueId':_0x4f5e25[_0x9474('0xe0')]||undefined,'CampaignId':_0x4f5e25['CampaignId']||undefined})[_0x9474('0xa0')](loggerCatch(_0x9474('0x12a')));break;case 0x14:if(_0x4f5e25['countagentrejectretry']>=_0x47981c[_0x9474('0x192')]-0x1){return!![];}hopperUtils[_0x9474('0xdc')]({'active':![],'countagentrejectretry':_0x4f5e25['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x47981c[_0x9474('0x193')],'minutes')[_0x9474('0x80')](_0x9474('0xcd')),'ContactId':_0x4f5e25[_0x9474('0xdf')],'ListId':_0x4f5e25[_0x9474('0xed')],'VoiceQueueId':_0x4f5e25[_0x9474('0xe0')]||undefined,'CampaignId':_0x4f5e25[_0x9474('0xe1')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x9474('0x1c')][_0x9474('0x10a')]=function(_0xac9966,_0x41a1ae,_0x30a43f){var _0x48c2df=this;var _0x154d24=new History(_0xac9966);var _0x526c66=![];var _0x358d49;var _0x11f474;return new Promise(function(_0x1394a7,_0x5cc4b0){if(_[_0x9474('0x5a')](_0x41a1ae)&&typeof _0x41a1ae!==_0x9474('0x15c')){return _0x5cc4b0(msgResponse(_0x9474('0x194'),_0x9474('0x93'),_0x9474('0x195')));}if(_[_0x9474('0x5a')](_0x30a43f)&&typeof _0x30a43f!=='object'){return _0x5cc4b0(msgResponse(_0x9474('0x194'),_0x9474('0x93'),'evt\x20is\x20undefine'));}hopperUtils['verifyAdditionalPhones'](_0x154d24,_0x30a43f[_0x9474('0xc8')],_0x41a1ae)['then'](function(_0x1a6a2f){if(_0x1a6a2f['additional']==0x1)_0x526c66=!![];switch(_0x30a43f[_0x9474('0xc8')]){case'0':_0x41a1ae['outboundNoSuchCallsDay']+=0x1;_0x154d24['state']=0x0;_0x154d24[_0x9474('0x72')]=_0x9474('0x196');_0x154d24['countnosuchnumberretry']+=0x1;_0x154d24[_0x9474('0xd6')]+=0x1;ami['emit'](_0x9474('0x197'),ut['buildObj'](_0xac9966,_0x9474('0x198')));_0x358d49=_0x41a1ae[_0x9474('0x190')];_0x11f474=_0x41a1ae[_0x9474('0xeb')];hopperUtils[_0x9474('0xce')](_0x154d24)['catch'](loggerCatch(_0x9474('0x120')));if(_0x48c2df[_0x9474('0x199')](0x0,_0xac9966,_0x41a1ae)&&!_0x526c66){if(_0x154d24['countnosuchnumberretry']>=_0x41a1ae[_0x9474('0x19a')]){_0x48c2df[_0x9474('0x12e')](_0x154d24,_0x1394a7,_0x5cc4b0,_0x9474('0x19b'));}else{_0x48c2df[_0x9474('0x125')](_0x154d24,_0x1394a7,_0x5cc4b0,_0x9474('0x19b'));}}break;case'3':_0x41a1ae[_0x9474('0x19c')]+=0x1;_0x154d24['state']=0x3;_0x154d24[_0x9474('0x72')]=_0x9474('0x19d');_0x154d24[_0x9474('0x122')]+=0x1;_0x154d24[_0x9474('0xd6')]+=0x1;var _0x2af9bc=ut[_0x9474('0x19e')](_0xac9966,_0x41a1ae);ami[_0x9474('0x45')](_0x9474('0x19f'),_0x2af9bc);_0x358d49=_0x41a1ae[_0x9474('0x189')];_0x11f474=_0x41a1ae[_0x9474('0xeb')];hopperUtils['createHistory'](_0x154d24)['catch'](loggerCatch(_0x9474('0x1a0')));if(_0x48c2df[_0x9474('0x199')](0x3,_0xac9966,_0x41a1ae)&&!_0x526c66){if(_0x154d24[_0x9474('0x122')]>=_0x41a1ae[_0x9474('0x188')]){_0x48c2df['createStateFinal'](_0x154d24,_0x1394a7,_0x5cc4b0,_0x9474('0x1a1'));}else{_0x48c2df[_0x9474('0x125')](_0x154d24,_0x1394a7,_0x5cc4b0,_0x9474('0x1a1'));}}break;case'5':_0x41a1ae[_0x9474('0x1a2')]+=0x1;_0x154d24[_0x9474('0x71')]=0x5;_0x154d24[_0x9474('0x72')]=_0x9474('0x1a3');_0x154d24[_0x9474('0x12d')]+=0x1;_0x154d24['countglobal']+=0x1;ami[_0x9474('0x45')]('custom:agentbusy',ut['buildObj'](_0xac9966,_0x9474('0x1a4')));_0x358d49=_0x41a1ae['dialBusyRetryFrequency'];_0x11f474=_0x41a1ae['callAdditionalPhoneAfterMin'];hopperUtils[_0x9474('0xce')](_0x154d24)['catch'](loggerCatch(_0x9474('0x1a5')));if(_0x48c2df['checkRetriveMax'](0x5,_0xac9966,_0x41a1ae)&&!_0x526c66){if(_0x154d24[_0x9474('0x12d')]>=_0x41a1ae[_0x9474('0x18b')]){_0x48c2df[_0x9474('0x12e')](_0x154d24,_0x1394a7,_0x5cc4b0,_0x9474('0x1a6'));}else{_0x48c2df[_0x9474('0x125')](_0x154d24,_0x1394a7,_0x5cc4b0,_0x9474('0x1a6'));}}break;case'8':_0x41a1ae['outboundCongestionCallsDay']+=0x1;_0x154d24[_0x9474('0x71')]=0x8;_0x154d24[_0x9474('0x72')]=_0x9474('0x1a7');_0x154d24[_0x9474('0x121')]+=0x1;_0x154d24[_0x9474('0xd6')]+=0x1;_0x358d49=_0x41a1ae['dialCongestionRetryFrequency'];_0x11f474=_0x41a1ae['callAdditionalPhoneAfterMin'];ami['emit'](_0x9474('0x1a8'),ut[_0x9474('0x119')](_0xac9966,_0x9474('0x1a9')));hopperUtils[_0x9474('0xce')](_0x154d24)[_0x9474('0xa0')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x48c2df['checkRetriveMax'](0x8,_0xac9966,_0x41a1ae)&&!_0x526c66){if(_0x154d24[_0x9474('0x121')]>=_0x41a1ae[_0x9474('0x1aa')]){_0x48c2df[_0x9474('0x12e')](_0x154d24,_0x1394a7,_0x5cc4b0,_0x9474('0x1ab'));}else{_0x48c2df['stateGlobal'](_0x154d24,_0x1394a7,_0x5cc4b0,_0x9474('0x1ab'));}}break;case'11':_0x41a1ae['outboundAbandonedCallsDay']+=0x1;_0x154d24[_0x9474('0x71')]=0xb;_0x154d24[_0x9474('0x72')]=_0x9474('0xe7');_0x154d24[_0x9474('0xe9')]+=0x1;_0x154d24['countglobal']+=0x1;_0x358d49=_0x41a1ae[_0x9474('0xea')];_0x11f474=_0x41a1ae[_0x9474('0xeb')];hopperUtils[_0x9474('0xce')](_0x154d24)[_0x9474('0xa0')](loggerCatch(_0x9474('0x1ac')));if(_0x48c2df[_0x9474('0x199')](0xb,_0xac9966,_0x41a1ae)&&!_0x526c66){if(_0x154d24[_0x9474('0xe9')]>=_0x41a1ae[_0x9474('0x1ad')]){_0x48c2df[_0x9474('0x12e')](_0x154d24,_0x1394a7,_0x5cc4b0,_0x9474('0x1ae'));}else{_0x48c2df['stateGlobal'](_0x154d24,_0x1394a7,_0x5cc4b0,'reason\x2011\x20abandoned');}}break;case'20':_0x41a1ae[_0x9474('0x1af')]+=0x1;_0x154d24[_0x9474('0x71')]=0x14;_0x154d24[_0x9474('0x72')]=_0x9474('0x1b0');_0x154d24['countagentrejectretry']+=0x1;_0x154d24['countglobal']+=0x1;_0x358d49=_0x41a1ae['dialAgentRejectRetryFrequency'];_0x11f474=_0x41a1ae[_0x9474('0xeb')];ami[_0x9474('0x45')](_0x9474('0x1b1'),ut[_0x9474('0x119')](_0xac9966,_0x9474('0x1b2')));hopperUtils[_0x9474('0xce')](_0x154d24)[_0x9474('0xa0')](loggerCatch(_0x9474('0x1b3')));if(_0x48c2df['checkRetriveMax'](0x14,_0xac9966,_0x41a1ae)&&!_0x526c66){if(_0x154d24[_0x9474('0x124')]>=_0x41a1ae['dialAgentRejectMaxRetry']){_0x48c2df[_0x9474('0x12e')](_0x154d24,_0x1394a7,_0x5cc4b0,'reason\x2020\x20agentreject');}else{_0x48c2df[_0x9474('0x125')](_0x154d24,_0x1394a7,_0x5cc4b0,_0x9474('0x1b4'));}}break;default:_0x41a1ae[_0x9474('0x1b5')]+=0x1;_0x154d24['state']=0xc;_0x154d24[_0x9474('0x72')]=_0x30a43f['reason'];_0x358d49=_0x41a1ae[_0x9474('0x193')];_0x11f474=_0x41a1ae[_0x9474('0xeb')];hopperUtils['createHistory'](_0x154d24)[_0x9474('0xa0')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x48c2df[_0x9474('0x199')](_0x30a43f[_0x9474('0xc8')],_0xac9966,_0x41a1ae)&&!_0x526c66){if(_0x154d24[_0x9474('0x12d')]+_0x154d24[_0x9474('0x121')]+_0x154d24['countnoanswerretry']+_0x154d24[_0x9474('0x123')]+_0x154d24['countdropretry']+_0x154d24[_0x9474('0xe9')]+_0x154d24[_0x9474('0x11f')]+_0x154d24[_0x9474('0x124')]>=_0x41a1ae[_0x9474('0x1b6')]){_0x48c2df[_0x9474('0x125')](_0x154d24,_0x1394a7,_0x5cc4b0,_0x30a43f[_0x9474('0xc8')]);}else{_0x48c2df[_0x9474('0x12e')](_0x154d24,_0x1394a7,_0x5cc4b0,_0x30a43f[_0x9474('0xc8')]);}}}})[_0x9474('0x43')](function(){if(_0x526c66){hopperUtils[_0x9474('0xef')](_0x154d24,_0x358d49,_0x11f474)[_0x9474('0x43')](function(){return _0x1394a7(0x1);});}});});};Dialer[_0x9474('0x1c')][_0x9474('0x125')]=function(_0x5eaa01,_0x515ccf,_0x39f844,_0x328714){var _0x250f81=new Final(_0x5eaa01);_0x250f81['state']=0xf;_0x250f81[_0x9474('0x72')]=_0x9474('0x1b7');this['createStateFinal'](_0x250f81,_0x515ccf,_0x39f844,_0x328714);};Dialer[_0x9474('0x1c')][_0x9474('0x12e')]=function(_0x40f1ea,_0x10836f,_0x1fa08c,_0x49b484){hopperUtils[_0x9474('0xcf')](_0x40f1ea)[_0x9474('0x43')](function(){return _0x10836f(msgResponse(_0x9474('0x194'),'Success',_0x49b484));})[_0x9474('0xa0')](function(){return _0x1fa08c(msgResponse(_0x9474('0x1b8'),_0x9474('0x93'),_0x9474('0x1b9')));});};Dialer[_0x9474('0x1c')]['predictive']=function(_0x4628a2){var _0x3eb5c9=_0x4628a2['dialPredictiveOptimizationPercentage']/0x64;var _0x47f173=_0x4628a2[_0x9474('0xd4')]/(_0x4628a2[_0x9474('0xd4')]+_0x4628a2[_0x9474('0x114')]);var _0x3aafb5=Math[_0x9474('0x1ba')](_0x4628a2[_0x9474('0x1bb')]*(_0x4628a2[_0x9474('0x1bc')]/0x64));var _0x1cf289=Math[_0x9474('0x1ba')](_0x4628a2[_0x9474('0x1bb')]*(_0x4628a2[_0x9474('0x1bd')]/0x64));var _0x5b7f38=_0x4628a2[_0x9474('0x13c')]+_0x4628a2[_0x9474('0x13e')];var _0x4a4e08=Math[_0x9474('0x1be')](_0x4628a2[_0x9474('0x5f')]*_0x4628a2[_0x9474('0x62')]*_0x4628a2[_0x9474('0x1bf')]*_0x4628a2['predictiveIntervalMultiplicativeFactor']);if(_[_0x9474('0x5a')](_0x4628a2[_0x9474('0x2a')])){if(!_['isUndefined'](_0x4628a2[_0x9474('0x29')])){_0x4628a2[_0x9474('0x29')]=undefined;loggerPredictive[_0x9474('0x69')]('[startMethodPredictive][StartProgressive]',_0x9474('0x1c0'));}if(!_['isUndefined'](_0x4628a2[_0x9474('0x67')])){loggerPredictive[_0x9474('0x69')]('[startMethodPredictive][StartProgressive]',_0x9474('0x1c1'));clearInterval(_0x4628a2[_0x9474('0x67')]);_0x4628a2[_0x9474('0x67')]=undefined;}_0x4628a2['startProgressive']=moment()[_0x9474('0x80')](_0x9474('0xcd'));loggerPredictive['info'](_0x4628a2['name'],_0x9474('0x1c2'),_0x4628a2[_0x9474('0x2a')]);this[_0x9474('0xb7')](_0x4628a2,0x1);}else if(ifInterval(_0x4628a2[_0x9474('0x1c3')],_0x4628a2[_0x9474('0x2a')])){this[_0x9474('0xb7')](_0x4628a2,0x1);loggerPredictiveCalls['info'](_0x9474('0x1c4'),_0x4628a2[_0x9474('0x2a')],_0x4628a2[_0x9474('0x4b')]);_0x4628a2['erlangCalls']=0x0;_0x4628a2[_0x9474('0x1c5')]=0x0;}else if(_0x3eb5c9<_0x47f173&&_0x4628a2['dialPredictiveOptimization']===_0x9474('0x1c6')){clearPredictiveAttributes(_0x4628a2);loggerPredictive[_0x9474('0x4d')](_0x9474('0x1c7'),'Dropped\x20calls\x20day',_0x47f173,'startProgressive',_0x4628a2[_0x9474('0x4b')]);}else if(_0x4a4e08<_0x4628a2['predictiveIntervalErlangCallsDroppedCalls']&&_0x4628a2[_0x9474('0x1c8')]===_0x9474('0x1c6')){clearPredictiveAttributes(_0x4628a2);loggerPredictive['info'](_0x9474('0x1c9'),'Max\x20Drop\x20',_0x4a4e08,_0x9474('0x1ca'),_0x4628a2['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x4628a2[_0x9474('0x4b')]);}else if(!ifInterval(_0x4628a2['dialPredictiveInterval'],_0x4628a2[_0x9474('0x2a')])&&_[_0x9474('0x5a')](_0x4628a2['startPredictive'])&&!_[_0x9474('0x5a')](_0x4628a2[_0x9474('0x2a')])){_0x4628a2[_0x9474('0x29')]=moment()[_0x9474('0x80')](_0x9474('0xcd'));loggerPredictive[_0x9474('0x4d')](_0x4628a2['name'],_0x9474('0x1cb'),_0x4628a2[_0x9474('0x29')]);hopperUtils[_0x9474('0x1cc')](_0x4628a2[_0x9474('0x1c3')])[_0x9474('0x43')](this[_0x9474('0x1cd')](_0x4628a2))['then'](mergeDataErlangB(_0x4628a2))['then'](this[_0x9474('0x1ce')](_0x4628a2))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x4628a2));}else if(!ifInterval(_0x4628a2[_0x9474('0x1c3')],_0x4628a2[_0x9474('0x29')])){_0x4628a2['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x4628a2[_0x9474('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x4628a2[_0x9474('0x4b')],_0x9474('0x1cf'),_0x4628a2['startPredictive']);clearInterval(_0x4628a2[_0x9474('0x67')]);_0x4628a2[_0x9474('0x67')]=undefined;hopperUtils[_0x9474('0x1cc')](_0x4628a2[_0x9474('0x1c3')])[_0x9474('0x43')](this['getDataPredictive'](_0x4628a2))[_0x9474('0x43')](mergeDataErlangB(_0x4628a2))[_0x9474('0x43')](this['startMethodPredictive'](_0x4628a2))[_0x9474('0xa0')](loggerCatchPredictive(_0x9474('0x1d0'),_0x4628a2));}else if(_0x4628a2['predictiveIntervalAvailable']&&_0x5b7f38<_0x4628a2[_0x9474('0x1bb')]-_0x1cf289){clearPredictiveAttributes(_0x4628a2);loggerPredictive[_0x9474('0x4d')](_0x4628a2[_0x9474('0x4b')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5b7f38,_0x9474('0x1d1'),_0x4628a2[_0x9474('0x1bb')],'-',_0x1cf289,'=',_0x4628a2[_0x9474('0x1bb')]-_0x1cf289,')');}else if(_0x4628a2[_0x9474('0x1bb')]&&_0x5b7f38>_0x4628a2['predictiveIntervalAvailable']+_0x3aafb5){clearPredictiveAttributes(_0x4628a2);loggerPredictive[_0x9474('0x4d')](_0x4628a2[_0x9474('0x4b')],_0x9474('0x1d2'),_0x5b7f38,_0x9474('0x1d3'),_0x4628a2[_0x9474('0x1bb')],'+',_0x3aafb5,'=',_0x4628a2[_0x9474('0x1bb')]+_0x3aafb5,')');}};Dialer[_0x9474('0x1c')][_0x9474('0x1cd')]=function(_0x1a9a1c){var _0x1d216b=this;return function(_0x3f4c88){return new Promise(function(_0x117ae2,_0x1dc898){_[_0x9474('0x64')](_0x1a9a1c,_0x3f4c88[0x0]);if(checkGetDataPredictive(_0x3f4c88[0x0])){var _0x5aaa31=_0x1a9a1c[_0x9474('0x1bb')]=_0x1a9a1c['talking']+_0x1a9a1c[_0x9474('0x13c')];var _0x2ac4c4=_0x1a9a1c[_0x9474('0x1c3')]*0x3c;var _0xf72d40=_0x3f4c88[0x0][_0x9474('0x58')]+_0x3f4c88[0x0][_0x9474('0x56')];var _0x106474=(_0x3f4c88[0x0][_0x9474('0x52')]+_0x3f4c88[0x0][_0x9474('0x53')]+_0x3f4c88[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3f4c88[0x0][_0x9474('0x50')];_0x1a9a1c[_0x9474('0x1bf')]=_0x106474>0x0?_0x106474:0x1;switch(_0x1a9a1c['dialPredictiveOptimization']){case _0x9474('0x1c6'):var _0x422770=_0x1a9a1c[_0x9474('0x1d4')]/0x64;return _0x1d216b[_0x9474('0x1d5')](_0x5aaa31,_0x2ac4c4,_0xf72d40,_0x106474,_0x422770)[_0x9474('0x43')](function(_0x5a7fa3){return _0x117ae2(_0x5a7fa3);});case'agentBusyFactor':var _0x1fdbdc=_0x1a9a1c[_0x9474('0x1d4')]/0x64;return _0x1d216b[_0x9474('0x1d6')](_0x5aaa31,_0x2ac4c4,_0xf72d40,_0x106474,_0x1fdbdc)[_0x9474('0x43')](function(_0x49627d){return _0x117ae2(_0x49627d);});default:return _0x1dc898(msgResponse(_0x9474('0x1d7'),'Failure',_0x9474('0x1d8')));}}else{return _0x1dc898(msgResponse(_0x9474('0x1d7'),_0x9474('0x93'),_0x9474('0x1d9')));}});};};Dialer[_0x9474('0x1c')][_0x9474('0x1da')]=function(_0x2ba090){var _0x2dbc23=this;return function(_0x439b4f){return new Promise(function(_0x32df5a,_0x1e8220){_[_0x9474('0x64')](_0x2ba090,_0x439b4f[0x0]);if(checkGetDataPredictive(_0x439b4f[0x0])){loggerPredictive[_0x9474('0x4d')](JSON[_0x9474('0x78')](_0x439b4f[0x0]));if(_0x2ba090[_0x9474('0x1c8')]===_0x9474('0x1c6')){return _0x2dbc23[_0x9474('0x151')](_0x2ba090['id'])[_0x9474('0x43')](function(_0x44ada7){var _0x37fd8c=_0x2ba090['loggedIn']-_0x44ada7[0x0][_0x9474('0x1db')];var _0x7d17c4=_0x2ba090[_0x9474('0x1c3')]*0x3c;var _0x45bbd9=_0x439b4f[0x0][_0x9474('0x58')]+_0x439b4f[0x0][_0x9474('0x56')];var _0x108470=(_0x439b4f[0x0][_0x9474('0x52')]+_0x439b4f[0x0][_0x9474('0x53')]+_0x439b4f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x439b4f[0x0][_0x9474('0x50')];var _0x4471db=_0x2ba090[_0x9474('0x1d4')]/0x64;_0x2ba090['predictiveIntervalPauses']=_0x44ada7[0x0]['outboundQueuePauses']||0x0;_0x2ba090[_0x9474('0x1bf')]=_0x108470>0x0?_0x108470:0x1;return _0x2dbc23[_0x9474('0x1d5')](_0x37fd8c,_0x7d17c4,_0x45bbd9,_0x108470,_0x4471db);})[_0x9474('0x43')](function(_0x287804){return _0x32df5a(_0x287804);})[_0x9474('0xa0')](function(_0x3b2c4){return _0x1e8220(msgResponse(_0x9474('0x1dc'),_0x9474('0x93'),JSON['stringify'](_0x3b2c4)));});}if(_0x2ba090[_0x9474('0x1c8')]===_0x9474('0x1dd')){return _0x2dbc23['getVoiceQueueRtPauses'](_0x2ba090['id'])[_0x9474('0x43')](function(_0x59d3ab){var _0x5b347b=_0x2ba090['loggedIn']-_0x59d3ab[0x0]['outboundQueuePauses'];var _0x171b27=_0x2ba090[_0x9474('0x1c3')]*0x3c;var _0x24a1a9=_0x439b4f[0x0][_0x9474('0x58')]+_0x439b4f[0x0]['predictiveIntervalAvgHoldtime'];var _0x282cfd=(_0x439b4f[0x0][_0x9474('0x52')]+_0x439b4f[0x0][_0x9474('0x53')]+_0x439b4f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x439b4f[0x0][_0x9474('0x50')];var _0x2110e7=_0x2ba090[_0x9474('0x1d4')]/0x64;_0x2ba090[_0x9474('0x1de')]=_0x59d3ab[0x0][_0x9474('0x1db')]||0x0;_0x2ba090[_0x9474('0x1bf')]=_0x282cfd>0x0?_0x282cfd:0x1;return _0x2dbc23[_0x9474('0x1d6')](_0x5b347b,_0x171b27,_0x24a1a9,_0x282cfd,_0x2110e7);})[_0x9474('0x43')](function(_0x2e5894){return _0x32df5a(_0x2e5894);})[_0x9474('0xa0')](function(_0x5eb917){return _0x1e8220(msgResponse(_0x9474('0x1dc'),'Failure',JSON[_0x9474('0x78')](_0x5eb917)));});}}else{return _0x1e8220(msgResponse('[getDataPredictive]',_0x9474('0x93'),_0x9474('0x1d9')));}});};};Dialer['prototype'][_0x9474('0x1ce')]=function(_0x3bfc21){var _0x3fe5f3=this;return function(){var _0x4be09c=0x0;var _0x5a608b=Math[_0x9474('0x1be')](_0x3bfc21[_0x9474('0x1df')]*0x3e8);if(_0x5a608b>0x0){_0x5a608b=_0x5a608b<0x64?0x64:_0x5a608b;loggerPredictive[_0x9474('0x4d')](_0x3bfc21['name'],_0x9474('0x1e0'),_0x5a608b,_0x9474('0x1e1'));_0x3bfc21['handlePredictive']=setInterval(function(){_0x3fe5f3['handlePredictive'](_0x3bfc21);loggerPredictiveCalls['info'](_0x9474('0x1e2'),_0x4be09c+=0x1);},_0x5a608b);}else{loggerPredictive[_0x9474('0x4d')](_0x3bfc21[_0x9474('0x4b')],_0x9474('0x1e3'));}};};Dialer['prototype'][_0x9474('0x1e4')]=function(_0x494bab,_0x255db8){var _0x4901c4=this;return function(_0x55b2b6){if(_['isEmpty'](_0x55b2b6)){if(_[_0x9474('0x103')](_0x255db8[_0x9474('0x154')])||!_0x255db8[_0x9474('0x1e5')]){if(_0x494bab['dialMethod']==='booked'){_0x494bab[_0x9474('0x75')]=_['isUndefined'](_0x494bab[_0x9474('0x75')])?!![]:_0x494bab[_0x9474('0x75')];var _0x1daec6=uuid['v4']();_0x4901c4[_0x9474('0x26')][_0x1daec6]=new Action(_0x494bab,_0x255db8,_0x1daec6);loggerBooked[_0x9474('0x4d')](_0x9474('0x1e6'),_0x1daec6,_0x9474('0x1e7'),JSON[_0x9474('0x78')](_0x494bab['queueStatusComplete']),_0x9474('0x1e8'),_0x494bab['name']);if(_0x494bab[_0x9474('0x75')]){_0x494bab[_0x9474('0x75')]=![];_0x4901c4[_0x9474('0x2c')][_0x4901c4[_0x9474('0x26')][_0x1daec6]['queue']]=[];ami[_0x9474('0x9a')]({'actionid':_0x1daec6,'action':_0x9474('0x1e9'),'queue':_0x494bab[_0x9474('0x4b')]})[_0x9474('0xa0')](function(){_0x4901c4[_0x9474('0xc6')](_0x494bab);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x4901c4[_0x9474('0x26')][_0x1daec6][_0x9474('0xdf')],'ListId':_0x4901c4['actions'][_0x1daec6][_0x9474('0xed')],'VoiceQueueId':_0x4901c4['actions'][_0x1daec6][_0x9474('0xe0')]||undefined,'CampaignId':_0x4901c4[_0x9474('0x26')][_0x1daec6][_0x9474('0xe1')]||undefined})[_0x9474('0xa0')](loggerCatch(_0x9474('0x1ea')));delete _0x4901c4[_0x9474('0x26')][_0x1daec6];});}else{loggerBooked['info'](_0x9474('0x1eb'),JSON[_0x9474('0x78')](_0x494bab[_0x9474('0x75')]),'Queue:\x20',_0x494bab[_0x9474('0x4b')]);_0x4901c4['updateOriginated'](_0x494bab);hopperUtils[_0x9474('0xdc')]({'active':![],'ContactId':_0x4901c4[_0x9474('0x26')][_0x1daec6]['ContactId'],'ListId':_0x4901c4[_0x9474('0x26')][_0x1daec6][_0x9474('0xed')],'VoiceQueueId':_0x4901c4['actions'][_0x1daec6]['VoiceQueueId']||undefined,'CampaignId':_0x4901c4[_0x9474('0x26')][_0x1daec6][_0x9474('0xe1')]||undefined})['catch'](loggerCatch(_0x9474('0x1ea')));delete _0x4901c4[_0x9474('0x26')][_0x1daec6];}}else{return _0x4901c4['actionOriginate'](_0x494bab,_0x255db8);}}else{if(utils[_0x9474('0x65')](undefined,_0x255db8[_0x9474('0x1ec')])<_0x494bab[_0x9474('0x1ed')]*0x3c){if(_0x255db8['Agent']&&!_0x255db8['Agent']['voicePause']){_0x4901c4[_0x9474('0xf9')][_0x9474('0xfa')](_0x255db8['id'])['finally'](function(){_0x4901c4[_0x9474('0xc6')](_0x494bab);});}else{hopperUtils['unlockContact']({'active':![]},_0x255db8['id'],0x1)['finally'](function(){_0x4901c4['updateOriginated'](_0x494bab);});}}else{_0x494bab[_0x9474('0x1ee')]+=0x1;_0x4901c4['updateOriginated'](_0x494bab);if(_0x494bab[_0x9474('0x1ef')]){hopperUtils[_0x9474('0xdc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x255db8[_0x9474('0xdf')],'ListId':_0x255db8[_0x9474('0xed')],'VoiceQueueId':_0x255db8['VoiceQueueId']||undefined,'CampaignId':_0x255db8['CampaignId']||undefined})[_0x9474('0xa0')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x9474('0xce')](createObjHistory(_0x494bab,_0x255db8,utils['CAMPAIGN_STATUS'][_0x9474('0x1f0')],0x17,_0x9474('0x1f1')))[_0x9474('0xa0')](loggerCatch(_0x9474('0x1f2')));}else{_0x4901c4['saveInDb'](createObjHistory(_0x494bab,_0x255db8,utils[_0x9474('0x6f')][_0x9474('0x1f3')],0x16,_0x9474('0x1f4')),_0x9474('0x1f5'),'[Originate][HistoryRecallClose]');}}}}else{_0x494bab[_0x9474('0x1f6')]+=0x1;_0x4901c4['saveInDb'](createObjHistory(_0x494bab,_0x255db8,utils[_0x9474('0x6f')][_0x9474('0x1f7')],0xd,_0x9474('0x1f8')),_0x9474('0x1f9'),_0x9474('0x1fa'));throw'inBlackList';}};};Dialer[_0x9474('0x1c')][_0x9474('0x15a')]=function(_0x312fbf){var _0x1ca7eb=this;var _0x1d8a19=_0x312fbf[_0x9474('0x1fb')]-_0x312fbf[_0x9474('0x83')];emitCampaignSummary(_0x312fbf);if(_0x1d8a19>0x0&&_0x312fbf[_0x9474('0x6a')]==0x0){if(_0x1d8a19>this[_0x9474('0x24')]){_0x1d8a19=this[_0x9474('0x24')];}_0x312fbf[_0x9474('0x6a')]=0x1;hopperUtils[_0x9474('0x1fc')](_0x312fbf,_0x1d8a19)[_0x9474('0x43')](function(_0x2dc277){_0x312fbf[_0x9474('0x6a')]=0x0;if(_0x2dc277){if(!utils[_0x9474('0x1fd')](_0x2dc277)){_0x312fbf[_0x9474('0x6c')]=utils[_0x9474('0x6f')][_0x9474('0x70')];logger['info'](_0x9474('0x1fe')+_0x312fbf[_0x9474('0x4b')]);}else{_0x312fbf[_0x9474('0x83')]+=_0x2dc277[_0x9474('0x99')];_0x312fbf[_0x9474('0x6c')]=utils[_0x9474('0x6f')]['RUNNING'];for(var _0x2b48e8=0x0;_0x2b48e8<_0x2dc277[_0x9474('0x99')];_0x2b48e8+=0x1){_0x312fbf[_0x9474('0x1ff')]+=0x1;if(_[_0x9474('0x103')](_0x2dc277[_0x2b48e8])||_[_0x9474('0x103')](_0x2dc277[_0x2b48e8]['Contact'])||_[_0x9474('0x103')](_0x2dc277[_0x2b48e8][_0x9474('0x15f')])){_0x1ca7eb['emptyContact']('[actionOriginate]\x20',_0x312fbf,_0x2dc277[_0x2b48e8]);}else{hopperUtils[_0x9474('0x200')](_['pick'](_0x2dc277[_0x2b48e8],[_0x9474('0xe1'),_0x9474('0x15f')]))[_0x9474('0x43')](_0x1ca7eb[_0x9474('0x1e4')](_0x312fbf,_0x2dc277[_0x2b48e8]))['catch'](_0x1ca7eb[_0x9474('0x152')](_0x9474('0x201'),_0x312fbf));}}}}})['catch'](loggerGetContactDialer(_0x9474('0x202'),_0x312fbf,_0x1d8a19));}};Dialer[_0x9474('0x1c')][_0x9474('0xb7')]=function(_0xb3e6ce,_0xa65a76){var _0x7d12c=this;var _0x26addc=[];if(_0xa65a76<0x1||_0xb3e6ce[_0x9474('0xb4')]==='booked'){_0xa65a76=0x1;}var _0x19e58a=Math['floor'](_0xb3e6ce[_0x9474('0x13c')]*_0xa65a76)-_0xb3e6ce[_0x9474('0x83')];if(_0xb3e6ce[_0x9474('0x203')]>0x0){var _0x203a53=_0xb3e6ce['dialLimitQueue']-_0xb3e6ce['originated']-_0xb3e6ce['talking']-_0xb3e6ce[_0x9474('0x13f')];if(_0x19e58a>_0x203a53){_0x19e58a=_0x203a53;}}if(_0x19e58a>0x0&&_0xb3e6ce[_0x9474('0x6a')]==0x0){if(_0xb3e6ce['dialMethod']===_0x9474('0x7')){_0x19e58a=0x1;}if(_0x19e58a>this[_0x9474('0x24')]){_0x19e58a=this[_0x9474('0x24')];}for(var _0x41f70f in this[_0x9474('0x22')]){if(typeof this[_0x9474('0x22')][_0x41f70f]!==_0x9474('0x14d')){if(this[_0x9474('0x22')][_0x41f70f][_0x9474('0x71')]===_0x9474('0x204')&&this[_0x9474('0x22')][_0x41f70f][_0x9474('0x8c')]===_0x9474('0x8d')){_0x26addc[_0x9474('0xa1')](this[_0x9474('0x22')][_0x41f70f]['id']);}}}_0xb3e6ce[_0x9474('0x6a')]=0x1;hopperUtils[_0x9474('0x205')](_0xb3e6ce,_0x26addc,_0x19e58a)[_0x9474('0x43')](function(_0x12a3da){_0xb3e6ce[_0x9474('0x6a')]=0x0;if(_0x12a3da){if(!utils[_0x9474('0x1fd')](_0x12a3da)){hopperUtils['countReScheduled'](_0xb3e6ce)['then'](sendMessageReschedule(_0xb3e6ce))[_0x9474('0xa0')](loggerCatch(_0x9474('0x206')));}else{_0xb3e6ce[_0x9474('0x83')]+=_0x12a3da[_0x9474('0x99')];_0xb3e6ce['message']=_0xb3e6ce['dialMethod']===_0x9474('0x7')?utils[_0x9474('0x6f')][_0x9474('0x165')]:utils[_0x9474('0x6f')][_0x9474('0x207')];for(var _0x260429=0x0;_0x260429<_0x12a3da[_0x9474('0x99')];_0x260429+=0x1){if(_[_0x9474('0x103')](_0x12a3da[_0x260429])||_[_0x9474('0x103')](_0x12a3da[_0x260429][_0x9474('0x208')])||_[_0x9474('0x103')](_0x12a3da[_0x260429]['phone'])){_0x7d12c[_0x9474('0x209')](_0x9474('0x20a'),_0xb3e6ce,_0x12a3da[_0x260429]);}else{hopperUtils[_0x9474('0x20b')](_['pick'](_0x12a3da[_0x260429],[_0x9474('0xe0'),_0x9474('0x15f')]))[_0x9474('0x43')](_0x7d12c[_0x9474('0x1e4')](_0xb3e6ce,_0x12a3da[_0x260429]))[_0x9474('0xa0')](_0x7d12c['loggerHandler']('[actionOriginate]\x20',_0xb3e6ce));}}}}})[_0x9474('0xa0')](loggerGetContactDialer(_0x9474('0x20c'),_0xb3e6ce,_0x19e58a));}};Dialer[_0x9474('0x1c')][_0x9474('0x67')]=function(_0x463107){if(_0x463107[_0x9474('0x203')]>0x0){var _0x3b3838=_0x463107[_0x9474('0x203')]-_0x463107[_0x9474('0x83')]-_0x463107[_0x9474('0x13e')];if(_0x3b3838>0x0&&_0x463107[_0x9474('0x6a')]==0x0){this[_0x9474('0x20d')](_0x463107);}else{loggerPredictiveCalls[_0x9474('0x4d')](_0x9474('0x20e'));}}else{this[_0x9474('0x20d')](_0x463107);}};Dialer[_0x9474('0x1c')][_0x9474('0x20d')]=function(_0x3ab047){var _0x17ba4f=this;var _0x2686c6=[];_0x3ab047['originated']+=0x1;for(var _0xcebcc in this['agents']){if(typeof this['agents'][_0xcebcc]!==_0x9474('0x14d')){if(this[_0x9474('0x22')][_0xcebcc][_0x9474('0x71')]===_0x9474('0x204')&&this['agents'][_0xcebcc]['status']==='reachable'){_0x2686c6['push'](this[_0x9474('0x22')][_0xcebcc]['id']);}}}_0x3ab047[_0x9474('0x6a')]=0x1;return this['getContactDialer'](_0x3ab047['id'],_0x2686c6,0x1,_0x3ab047[_0x9474('0x20f')],_0x3ab047)[_0x9474('0x43')](function(_0x1bb034){_0x3ab047[_0x9474('0x6a')]=0x1;if(_0x1bb034){if(!utils[_0x9474('0x1fd')](_0x1bb034)){utils[_0x9474('0x210')](_0x3ab047,0x1,0x0);return hopperUtils['countReScheduled'](_0x3ab047)['then'](sendMessageReschedule(_0x3ab047))[_0x9474('0xa0')](loggerCatch('[countReScheduled]\x20'));}else{_0x3ab047[_0x9474('0x6c')]=utils['CAMPAIGN_STATUS'][_0x9474('0x207')];if(_[_0x9474('0x103')](_0x1bb034[0x0])||_['isNil'](_0x1bb034[0x0][_0x9474('0x208')])||_['isNil'](_0x1bb034[0x0][_0x9474('0x15f')])){_0x17ba4f[_0x9474('0x209')]('[actionOriginate]\x20',_0x3ab047,_0x1bb034[0x0]);}else{return hopperUtils['checkIsBlackList'](_['pick'](_0x1bb034[0x0],[_0x9474('0xe0'),'phone']))[_0x9474('0x43')](_0x17ba4f[_0x9474('0x1e4')](_0x3ab047,_0x1bb034[0x0]))[_0x9474('0xa0')](_0x17ba4f[_0x9474('0x152')]('[actionOriginatePredictive]\x20',_0x3ab047));}}}})[_0x9474('0xa0')](loggerGetContactDialer(_0x9474('0x211'),_0x3ab047,0x1));};Dialer[_0x9474('0x1c')][_0x9474('0x1d5')]=function(_0x15a836,_0xfa02f3,_0x4575ee,_0x1d7c7,_0x3ce159,_0x160527){loggerPredictive[_0x9474('0x4d')](_0x9474('0x212'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x15a836);loggerPredictive[_0x9474('0x4d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xfa02f3);loggerPredictive[_0x9474('0x4d')]('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',_0x4575ee);loggerPredictive[_0x9474('0x4d')](_0x9474('0x213'),_0x1d7c7);loggerPredictive[_0x9474('0x4d')](_0x9474('0x214'),_0x3ce159);loggerPredictive[_0x9474('0x4d')](_0x9474('0x59'));return new Promise(function(_0x2d9f8a,_0x23b068){if(_0x15a836<=0x0||isNaN(_0x15a836)){return _0x23b068(msgResponse('[abandonmentRate]','Error',_0x9474('0x215')+_0x15a836));}if(_0x4575ee<=0x0||isNaN(_0x4575ee)){return _0x23b068(msgResponse(_0x9474('0x216'),'Error',_0x9474('0x217')+_0x4575ee));}if(_0x1d7c7<=0x0||isNaN(_0x1d7c7)){return _0x23b068(msgResponse(_0x9474('0x216'),_0x9474('0xc2'),_0x9474('0x218')+_0x1d7c7));}if(_0xfa02f3<=0x0||isNaN(_0xfa02f3)){return _0x23b068(msgResponse(_0x9474('0x216'),_0x9474('0xc2'),_0x9474('0x219')+_0xfa02f3));}if(_0x3ce159<=0x0||isNaN(_0x3ce159)){return _0x23b068(msgResponse('[abandonmentRate]',_0x9474('0xc2'),_0x9474('0x21a')+_0x3ce159));}_0x160527=_0x160527||0x0;var _0x421aed=0x1/_0x4575ee;var _0x40fe10=0x0;var _0x5838ce=0x0;var _0x4f4d5a=0x0;var _0x50096c=0x0;for(var _0x5efa54=0x0;_0x4f4d5a<_0x3ce159;_0x5efa54+=0x1){_0x5838ce=_0x5efa54/_0xfa02f3;_0x40fe10=(_0x1d7c7*_0x5838ce+_0x160527)/_0x421aed;_0x4f4d5a=utils['erlangb'](_0x40fe10,_0x15a836);_0x50096c=_0x40fe10/_0x15a836*(0x1-utils[_0x9474('0x21b')](_0x40fe10,_0x15a836));}return _0x2d9f8a({'erlangCalls':_0x5efa54,'erlangCallToSecond':_0xfa02f3/_0x5efa54,'erlangAbandonmentRate':_0x4f4d5a,'erlangBusyFactor':_0x50096c});});};Dialer[_0x9474('0x1c')]['busyFactor']=function(_0x26b634,_0x4e01a0,_0x5ca4a7,_0x39f760,_0x38be6c,_0x123f70){loggerPredictive[_0x9474('0x4d')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x9474('0x4d')](_0x9474('0x21c'),_0x26b634);loggerPredictive[_0x9474('0x4d')](_0x9474('0x21d'),_0x4e01a0);loggerPredictive[_0x9474('0x4d')]('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',_0x5ca4a7);loggerPredictive['info'](_0x9474('0x213'),_0x39f760);loggerPredictive[_0x9474('0x4d')](_0x9474('0x21e'),_0x38be6c);loggerPredictive['info'](_0x9474('0x59'));return new Promise(function(_0x38aa9d,_0x29dd86){if(_0x26b634<=0x0||isNaN(_0x26b634)){return _0x29dd86(msgResponse(_0x9474('0x21f'),_0x9474('0xc2'),_0x9474('0x215')+_0x26b634));}if(_0x5ca4a7<=0x0||isNaN(_0x5ca4a7)){return _0x29dd86(msgResponse('[busyFactor]',_0x9474('0xc2'),_0x9474('0x217')+_0x5ca4a7));}if(_0x39f760<=0x0||isNaN(_0x39f760)){return _0x29dd86(msgResponse(_0x9474('0x21f'),_0x9474('0xc2'),'p\x20=\x20'+_0x39f760));}if(_0x4e01a0<=0x0||isNaN(_0x4e01a0)){return _0x29dd86(msgResponse(_0x9474('0x21f'),_0x9474('0xc2'),_0x9474('0x219')+_0x4e01a0));}if(_0x38be6c<=0x0||isNaN(_0x38be6c)){return _0x29dd86(msgResponse(_0x9474('0x21f'),_0x9474('0xc2'),_0x9474('0x220')+_0x38be6c));}_0x123f70=_0x123f70||0x0;var _0x5b7657=0x1/_0x5ca4a7;var _0x2ddc9a=0x0;var _0x131c0f=0x0;var _0x280afd=0x0;var _0x2ef0b0=0x0;for(var _0x54ce70=0x0;_0x2ef0b0<_0x38be6c;_0x54ce70+=0x1){_0x131c0f=_0x54ce70/_0x4e01a0;_0x2ddc9a=(_0x39f760*_0x131c0f+_0x123f70)/_0x5b7657;_0x280afd=utils[_0x9474('0x21b')](_0x2ddc9a,_0x26b634);_0x2ef0b0=_0x2ddc9a/_0x26b634*(0x1-utils[_0x9474('0x21b')](_0x2ddc9a,_0x26b634));}return _0x38aa9d({'erlangCalls':_0x54ce70,'erlangCallToSecond':_0x4e01a0/_0x54ce70,'erlangAbandonmentRate':_0x280afd,'erlangBusyFactor':_0x2ef0b0});});};module[_0x9474('0x221')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 5f022d7..0a0e8cc 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x923b=['Contact','phone','firstName','number','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','ContactFirstName','starttime','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue','queue','moment','string','isNil'];(function(_0x292397,_0x4d59f5){var _0x29ba42=function(_0x2d71a2){while(--_0x2d71a2){_0x292397['push'](_0x292397['shift']());}};_0x29ba42(++_0x4d59f5);}(_0x923b,0x9d));var _0xb923=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0x923b[_0x516ffb];return _0x319667;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xb923('0x0'));function checkNameSurname(_0x3f2720,_0x1af706,_0x18eb81){var _0x1dcd8f='';if(!_['isNil'](_0x1af706)&&_0xb923('0x1')===typeof _0x1af706){_0x1dcd8f+=_0x1af706;}if(!_[_0xb923('0x2')](_0x18eb81)&&'string'===typeof _0x18eb81){_0x1dcd8f+='\x20'+_0x18eb81;}if(_0x1dcd8f!==''){return _0x1dcd8f;}return _0x3f2720;}function Action(_0x48b94c,_0x52191e,_0x5c8cbe){this['voiceQueue']=_0x48b94c;this['uniqueid']=_0x5c8cbe||undefined;this['name']=checkNameSurname(_0x52191e[_0xb923('0x3')][_0xb923('0x4')],_0x52191e[_0xb923('0x3')][_0xb923('0x5')],_0x52191e[_0xb923('0x3')]['lastName']);this[_0xb923('0x6')]=_0x52191e['phone'];this['queue']=_0x48b94c[_0xb923('0x7')];this[_0xb923('0x8')]=_0x52191e[_0xb923('0x8')]||![];this['type']=_0x48b94c[_0xb923('0x9')];this[_0xb923('0xa')]=_0x48b94c[_0xb923('0xa')]||0x3;this[_0xb923('0xb')]=_0x52191e[_0xb923('0xb')];this[_0xb923('0xc')]=_0x52191e[_0xb923('0xc')];this[_0xb923('0xd')]=_0x52191e['countcongestionretry'];this[_0xb923('0xe')]=_0x52191e['countnoanswerretry'];this['countnosuchnumberretry']=_0x52191e[_0xb923('0xf')];this['countdropretry']=_0x52191e[_0xb923('0x10')];this['countabandonedretry']=_0x52191e[_0xb923('0x11')];this[_0xb923('0x12')]=_0x52191e[_0xb923('0x12')];this[_0xb923('0x13')]=_0x52191e['countagentrejectretry'];this['ContactId']=_0x52191e[_0xb923('0x14')];this[_0xb923('0x15')]=_0x52191e[_0xb923('0x15')];this[_0xb923('0x16')]=_0x52191e[_0xb923('0x16')];this['VoiceQueueId']=_0x52191e[_0xb923('0x17')];this['CampaignId']=_0x52191e['CampaignId'];this[_0xb923('0x18')]=_0x52191e['id'];this[_0xb923('0x19')]=_0x52191e[_0xb923('0x3')][_0xb923('0x5')]||'';this[_0xb923('0x1a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xb923('0x1b')]=_0x52191e[_0xb923('0x1b')];this[_0xb923('0x1c')]=_0x52191e['callbackuniqueid'];this[_0xb923('0x1d')]=_0x52191e[_0xb923('0x1d')];this['recallme']=_0x52191e[_0xb923('0x1e')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xb923('0x1f')][_0xb923('0x20')]=function(){return util[_0xb923('0x21')](_0xb923('0x22'),this[_0xb923('0x7')],this[_0xb923('0x23')][_0xb923('0x24')]>0x0?this[_0xb923('0x6')][_0xb923('0x25')](this[_0xb923('0x23')][_0xb923('0x24')]):this['number']);};Action['prototype'][_0xb923('0x26')]=function(){return this[_0xb923('0x27')];};module['exports']=Action; \ No newline at end of file +var _0x71e1=['voiceQueue','name','Contact','phone','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','string'];(function(_0x588e08,_0x494086){var _0x2d1902=function(_0x54cbd6){while(--_0x54cbd6){_0x588e08['push'](_0x588e08['shift']());}};_0x2d1902(++_0x494086);}(_0x71e1,0x1ea));var _0x171e=function(_0x2bbf69,_0x28731d){_0x2bbf69=_0x2bbf69-0x0;var _0x25225d=_0x71e1[_0x2bbf69];return _0x25225d;};'use strict';var util=require(_0x171e('0x0'));var _=require(_0x171e('0x1'));var moment=require(_0x171e('0x2'));function checkNameSurname(_0xee50da,_0x4f21c9,_0xde0faf){var _0x5b2f94='';if(!_[_0x171e('0x3')](_0x4f21c9)&&_0x171e('0x4')===typeof _0x4f21c9){_0x5b2f94+=_0x4f21c9;}if(!_[_0x171e('0x3')](_0xde0faf)&&_0x171e('0x4')===typeof _0xde0faf){_0x5b2f94+='\x20'+_0xde0faf;}if(_0x5b2f94!==''){return _0x5b2f94;}return _0xee50da;}function Action(_0x15fe68,_0xd8b478,_0xfc551f){this[_0x171e('0x5')]=_0x15fe68;this['uniqueid']=_0xfc551f||undefined;this[_0x171e('0x6')]=checkNameSurname(_0xd8b478[_0x171e('0x7')][_0x171e('0x8')],_0xd8b478[_0x171e('0x7')]['firstName'],_0xd8b478[_0x171e('0x7')]['lastName']);this[_0x171e('0x9')]=_0xd8b478[_0x171e('0x8')];this[_0x171e('0xa')]=_0x15fe68[_0x171e('0x6')];this[_0x171e('0xb')]=_0xd8b478[_0x171e('0xb')]||![];this[_0x171e('0xc')]=_0x15fe68[_0x171e('0xc')];this[_0x171e('0xd')]=_0x15fe68[_0x171e('0xd')]||0x3;this[_0x171e('0xe')]=_0xd8b478[_0x171e('0xe')];this[_0x171e('0xf')]=_0xd8b478['countbusyretry'];this[_0x171e('0x10')]=_0xd8b478[_0x171e('0x10')];this[_0x171e('0x11')]=_0xd8b478[_0x171e('0x11')];this[_0x171e('0x12')]=_0xd8b478['countnosuchnumberretry'];this[_0x171e('0x13')]=_0xd8b478[_0x171e('0x13')];this[_0x171e('0x14')]=_0xd8b478[_0x171e('0x14')];this[_0x171e('0x15')]=_0xd8b478[_0x171e('0x15')];this[_0x171e('0x16')]=_0xd8b478[_0x171e('0x16')];this[_0x171e('0x17')]=_0xd8b478[_0x171e('0x17')];this[_0x171e('0x18')]=_0xd8b478[_0x171e('0x18')];this['UserId']=_0xd8b478[_0x171e('0x19')];this[_0x171e('0x1a')]=_0xd8b478[_0x171e('0x1a')];this[_0x171e('0x1b')]=_0xd8b478[_0x171e('0x1b')];this[_0x171e('0x1c')]=_0xd8b478['id'];this[_0x171e('0x1d')]=_0xd8b478[_0x171e('0x7')]['firstName']||'';this[_0x171e('0x1e')]=moment()[_0x171e('0x1f')](_0x171e('0x20'));this['callback']=_0xd8b478[_0x171e('0x21')];this[_0x171e('0x22')]=_0xd8b478[_0x171e('0x22')];this[_0x171e('0x23')]=_0xd8b478[_0x171e('0x23')];this['recallme']=_0xd8b478[_0x171e('0x24')];this[_0x171e('0x25')]='';this[_0x171e('0x26')]='';}Action[_0x171e('0x27')][_0x171e('0x28')]=function(){return util[_0x171e('0x1f')](_0x171e('0x29'),this[_0x171e('0x6')],this['voiceQueue'][_0x171e('0x2a')]>0x0?this[_0x171e('0x9')]['substring'](this[_0x171e('0x5')][_0x171e('0x2a')]):this[_0x171e('0x9')]);};Action['prototype'][_0x171e('0x2b')]=function(){return this['queue'];};module[_0x171e('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 4d30503..237d6af 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72c1=['reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','endtime','queue','membername'];(function(_0x3b52bb,_0x4f9aba){var _0x23defe=function(_0x245702){while(--_0x245702){_0x3b52bb['push'](_0x3b52bb['shift']());}};_0x23defe(++_0x4f9aba);}(_0x72c1,0x185));var _0x172c=function(_0x40a0e5,_0x5c9377){_0x40a0e5=_0x40a0e5-0x0;var _0x571500=_0x72c1[_0x40a0e5];return _0x571500;};'use strict';var moment=require('moment');var utils=require(_0x172c('0x0'));function AgentComplete(_0x62b25,_0x1b2ffd){this[_0x172c('0x1')]=0x4;this[_0x172c('0x2')]=_0x172c('0x3');this['scheduledat']=_0x62b25[_0x172c('0x4')];this[_0x172c('0x5')]=_0x62b25[_0x172c('0x5')];this[_0x172c('0x6')]=_0x62b25[_0x172c('0x5')]==='outbound'?'queue':_0x62b25[_0x172c('0x5')];this['countbusyretry']=_0x62b25['countbusyretry'];this[_0x172c('0x7')]=_0x62b25['countcongestionretry'];this[_0x172c('0x8')]=_0x62b25[_0x172c('0x8')];this[_0x172c('0x9')]=_0x62b25[_0x172c('0xa')]+_0x62b25['countcongestionretry']+_0x62b25[_0x172c('0x8')]+_0x62b25[_0x172c('0xb')]+_0x62b25[_0x172c('0xc')]+_0x62b25[_0x172c('0xd')]+_0x62b25[_0x172c('0xe')]+_0x62b25[_0x172c('0xf')];this[_0x172c('0xb')]=_0x62b25[_0x172c('0xb')];this[_0x172c('0xc')]=_0x62b25[_0x172c('0xc')];this[_0x172c('0xd')]=_0x62b25[_0x172c('0xd')];this[_0x172c('0xe')]=_0x62b25[_0x172c('0xe')];this[_0x172c('0xf')]=_0x62b25[_0x172c('0xf')];this[_0x172c('0x10')]=_0x1b2ffd['uniqueid'];this[_0x172c('0x11')]=_0x62b25[_0x172c('0x12')];this['calleridnum']=_0x62b25[_0x172c('0x13')];this[_0x172c('0x14')]=_0x62b25[_0x172c('0x14')];this[_0x172c('0x15')]=_0x62b25[_0x172c('0x15')];this['answertime']=_0x62b25[_0x172c('0x16')];this['endtime']=moment()[_0x172c('0x17')](_0x172c('0x18'));this[_0x172c('0x19')]=utils[_0x172c('0x1a')](_0x62b25[_0x172c('0x15')],_0x62b25[_0x172c('0x14')]);this['holdtime']=utils[_0x172c('0x1a')](_0x62b25['answertime'],_0x62b25[_0x172c('0x15')]);this[_0x172c('0x1b')]=utils[_0x172c('0x1a')](this[_0x172c('0x1c')],_0x62b25[_0x172c('0x16')]);this[_0x172c('0x1d')]=_0x1b2ffd['queue'];this[_0x172c('0x1e')]=_0x1b2ffd[_0x172c('0x1e')];this[_0x172c('0x1f')]=_0x1b2ffd[_0x172c('0x1f')];this[_0x172c('0x20')]=_0x62b25[_0x172c('0x20')];this['callbackuniqueid']=_0x62b25[_0x172c('0x21')];this[_0x172c('0x22')]=_0x62b25['callbackat'];this[_0x172c('0x23')]=_0x62b25['recallme'];this['ContactId']=_0x62b25[_0x172c('0x24')];this['ListId']=_0x62b25[_0x172c('0x25')];this[_0x172c('0x26')]=_0x62b25[_0x172c('0x26')];this['VoiceQueueId']=_0x62b25[_0x172c('0x27')];this['CampaignId']=_0x62b25[_0x172c('0x28')];this[_0x172c('0x29')]=_0x62b25[_0x172c('0x29')]||'';this['originatecalleridname']=_0x62b25['originatecalleridname']||'';this['agiafterat']=_0x62b25['agiafterat'];}module['exports']=AgentComplete; \ No newline at end of file +var _0x7bc3=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridname','agiafterat','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','talktime','queue','membername','reason'];(function(_0x5881be,_0x5edf5d){var _0x8e63bf=function(_0x4dd2b2){while(--_0x4dd2b2){_0x5881be['push'](_0x5881be['shift']());}};_0x8e63bf(++_0x5edf5d);}(_0x7bc3,0xb6));var _0x37bc=function(_0x577b2e,_0x21aee6){_0x577b2e=_0x577b2e-0x0;var _0x5ed28c=_0x7bc3[_0x577b2e];return _0x5ed28c;};'use strict';var moment=require(_0x37bc('0x0'));var utils=require(_0x37bc('0x1'));function AgentComplete(_0x728a47,_0x238022){this[_0x37bc('0x2')]=0x4;this[_0x37bc('0x3')]=_0x37bc('0x4');this[_0x37bc('0x5')]=_0x728a47[_0x37bc('0x5')];this['type']=_0x728a47[_0x37bc('0x6')];this[_0x37bc('0x7')]=_0x728a47[_0x37bc('0x6')]===_0x37bc('0x8')?'queue':_0x728a47['type'];this[_0x37bc('0x9')]=_0x728a47['countbusyretry'];this[_0x37bc('0xa')]=_0x728a47[_0x37bc('0xa')];this[_0x37bc('0xb')]=_0x728a47[_0x37bc('0xb')];this[_0x37bc('0xc')]=_0x728a47[_0x37bc('0x9')]+_0x728a47[_0x37bc('0xa')]+_0x728a47[_0x37bc('0xb')]+_0x728a47['countnosuchnumberretry']+_0x728a47['countdropretry']+_0x728a47['countabandonedretry']+_0x728a47[_0x37bc('0xd')]+_0x728a47[_0x37bc('0xe')];this[_0x37bc('0xf')]=_0x728a47[_0x37bc('0xf')];this[_0x37bc('0x10')]=_0x728a47[_0x37bc('0x10')];this[_0x37bc('0x11')]=_0x728a47[_0x37bc('0x11')];this[_0x37bc('0xd')]=_0x728a47[_0x37bc('0xd')];this[_0x37bc('0xe')]=_0x728a47[_0x37bc('0xe')];this[_0x37bc('0x12')]=_0x238022[_0x37bc('0x12')];this[_0x37bc('0x13')]=_0x728a47[_0x37bc('0x14')];this['calleridnum']=_0x728a47[_0x37bc('0x15')];this[_0x37bc('0x16')]=_0x728a47[_0x37bc('0x16')];this[_0x37bc('0x17')]=_0x728a47[_0x37bc('0x17')];this[_0x37bc('0x18')]=_0x728a47[_0x37bc('0x18')];this[_0x37bc('0x19')]=moment()[_0x37bc('0x1a')](_0x37bc('0x1b'));this['ringtime']=utils[_0x37bc('0x1c')](_0x728a47[_0x37bc('0x17')],_0x728a47['starttime']);this['holdtime']=utils[_0x37bc('0x1c')](_0x728a47[_0x37bc('0x18')],_0x728a47['responsetime']);this[_0x37bc('0x1d')]=utils['getSeconds'](this[_0x37bc('0x19')],_0x728a47[_0x37bc('0x18')]);this[_0x37bc('0x1e')]=_0x238022[_0x37bc('0x1e')];this['membername']=_0x238022[_0x37bc('0x1f')];this[_0x37bc('0x20')]=_0x238022[_0x37bc('0x20')];this['callback']=_0x728a47[_0x37bc('0x21')];this[_0x37bc('0x22')]=_0x728a47[_0x37bc('0x22')];this[_0x37bc('0x23')]=_0x728a47[_0x37bc('0x23')];this[_0x37bc('0x24')]=_0x728a47['recallme'];this[_0x37bc('0x25')]=_0x728a47[_0x37bc('0x25')];this[_0x37bc('0x26')]=_0x728a47['ListId'];this['UserId']=_0x728a47['UserId'];this[_0x37bc('0x27')]=_0x728a47[_0x37bc('0x27')];this[_0x37bc('0x28')]=_0x728a47[_0x37bc('0x28')];this['originatecalleridnum']=_0x728a47['originatecalleridnum']||'';this[_0x37bc('0x29')]=_0x728a47[_0x37bc('0x29')]||'';this[_0x37bc('0x2a')]=_0x728a47[_0x37bc('0x2a')];}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 44e57cb..3cfbfdc 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9bb=['ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xd9bb,0x1c9));var _0xbd9b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd9bb[_0x14add3];return _0x4a174f;};'use strict';function Final(_0x113282){this[_0xbd9b('0x0')]=_0x113282[_0xbd9b('0x0')];this[_0xbd9b('0x1')]=_0x113282['scheduledat'];this[_0xbd9b('0x2')]=_0x113282['type'];this[_0xbd9b('0x3')]=_0x113282['type']==='outbound'?'queue':_0x113282[_0xbd9b('0x2')];this[_0xbd9b('0x4')]=_0x113282[_0xbd9b('0x4')];this[_0xbd9b('0x5')]=_0x113282['countcongestionretry'];this[_0xbd9b('0x6')]=_0x113282[_0xbd9b('0x6')];this[_0xbd9b('0x7')]=_0x113282[_0xbd9b('0x4')]+_0x113282[_0xbd9b('0x5')]+_0x113282[_0xbd9b('0x6')]+_0x113282[_0xbd9b('0x8')]+_0x113282[_0xbd9b('0x9')]+_0x113282['countabandonedretry']+_0x113282['countmachineretry']+_0x113282['countagentrejectretry'];this[_0xbd9b('0x8')]=_0x113282[_0xbd9b('0x8')];this[_0xbd9b('0x9')]=_0x113282[_0xbd9b('0x9')];this[_0xbd9b('0xa')]=_0x113282['countabandonedretry'];this[_0xbd9b('0xb')]=_0x113282[_0xbd9b('0xb')];this[_0xbd9b('0xc')]=_0x113282['countagentrejectretry'];this[_0xbd9b('0xd')]=_0x113282[_0xbd9b('0xd')];this['calleridname']=_0x113282[_0xbd9b('0xe')];this[_0xbd9b('0xf')]=_0x113282[_0xbd9b('0xf')];this[_0xbd9b('0x10')]=_0x113282[_0xbd9b('0x10')];this[_0xbd9b('0x11')]=_0x113282['responsetime'];this[_0xbd9b('0x12')]=_0x113282[_0xbd9b('0x11')];this[_0xbd9b('0x13')]=_0x113282[_0xbd9b('0x13')]||0x0;this[_0xbd9b('0x14')]=_0x113282[_0xbd9b('0x14')]||0x0;this[_0xbd9b('0x15')]=_0x113282['talktime']||0x0;this['callback']=_0x113282[_0xbd9b('0x16')];this[_0xbd9b('0x17')]=_0x113282['callbackuniqueid'];this[_0xbd9b('0x18')]=_0x113282[_0xbd9b('0x18')];this[_0xbd9b('0x19')]=_0x113282[_0xbd9b('0x19')];this['ContactId']=_0x113282[_0xbd9b('0x1a')];this['ListId']=_0x113282['ListId'];this[_0xbd9b('0x1b')]=_0x113282['UserId'];this['VoiceQueueId']=_0x113282['VoiceQueueId'];this[_0xbd9b('0x1c')]=_0x113282['CampaignId'];this[_0xbd9b('0x1d')]=_0x113282[_0xbd9b('0x1d')]||'';this[_0xbd9b('0x1e')]=_0x113282[_0xbd9b('0x1e')]||'';this[_0xbd9b('0x1f')]=_0x113282[_0xbd9b('0x1f')];this[_0xbd9b('0x20')]=_0x113282['statedesc'];}module[_0xbd9b('0x21')]=Final; \ No newline at end of file +var _0xc6ce=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','holdtime'];(function(_0x2665a3,_0x3bac99){var _0x586de6=function(_0x1034d7){while(--_0x1034d7){_0x2665a3['push'](_0x2665a3['shift']());}};_0x586de6(++_0x3bac99);}(_0xc6ce,0x11f));var _0xec6c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc6ce[_0x3dd15e];return _0x231fd0;};'use strict';function Final(_0x5966ab){this[_0xec6c('0x0')]=_0x5966ab[_0xec6c('0x0')];this['scheduledat']=_0x5966ab['scheduledat'];this[_0xec6c('0x1')]=_0x5966ab[_0xec6c('0x1')];this[_0xec6c('0x2')]=_0x5966ab[_0xec6c('0x1')]===_0xec6c('0x3')?_0xec6c('0x4'):_0x5966ab[_0xec6c('0x1')];this[_0xec6c('0x5')]=_0x5966ab[_0xec6c('0x5')];this['countcongestionretry']=_0x5966ab[_0xec6c('0x6')];this[_0xec6c('0x7')]=_0x5966ab[_0xec6c('0x7')];this[_0xec6c('0x8')]=_0x5966ab[_0xec6c('0x5')]+_0x5966ab[_0xec6c('0x6')]+_0x5966ab[_0xec6c('0x7')]+_0x5966ab[_0xec6c('0x9')]+_0x5966ab[_0xec6c('0xa')]+_0x5966ab[_0xec6c('0xb')]+_0x5966ab[_0xec6c('0xc')]+_0x5966ab[_0xec6c('0xd')];this[_0xec6c('0x9')]=_0x5966ab[_0xec6c('0x9')];this[_0xec6c('0xa')]=_0x5966ab[_0xec6c('0xa')];this[_0xec6c('0xb')]=_0x5966ab[_0xec6c('0xb')];this[_0xec6c('0xc')]=_0x5966ab[_0xec6c('0xc')];this[_0xec6c('0xd')]=_0x5966ab[_0xec6c('0xd')];this['queue']=_0x5966ab[_0xec6c('0x4')];this['calleridname']=_0x5966ab[_0xec6c('0xe')];this[_0xec6c('0xf')]=_0x5966ab[_0xec6c('0xf')];this['starttime']=_0x5966ab[_0xec6c('0x10')];this[_0xec6c('0x11')]=_0x5966ab[_0xec6c('0x11')];this['endtime']=_0x5966ab[_0xec6c('0x11')];this['ringtime']=_0x5966ab['ringtime']||0x0;this[_0xec6c('0x12')]=_0x5966ab[_0xec6c('0x12')]||0x0;this['talktime']=_0x5966ab[_0xec6c('0x13')]||0x0;this['callback']=_0x5966ab[_0xec6c('0x14')];this[_0xec6c('0x15')]=_0x5966ab[_0xec6c('0x15')];this[_0xec6c('0x16')]=_0x5966ab['callbackat'];this['recallme']=_0x5966ab[_0xec6c('0x17')];this[_0xec6c('0x18')]=_0x5966ab[_0xec6c('0x18')];this[_0xec6c('0x19')]=_0x5966ab[_0xec6c('0x19')];this[_0xec6c('0x1a')]=_0x5966ab[_0xec6c('0x1a')];this[_0xec6c('0x1b')]=_0x5966ab['VoiceQueueId'];this['CampaignId']=_0x5966ab[_0xec6c('0x1c')];this[_0xec6c('0x1d')]=_0x5966ab[_0xec6c('0x1d')]||'';this['originatecalleridname']=_0x5966ab[_0xec6c('0x1e')]||'';this[_0xec6c('0x1f')]=_0x5966ab[_0xec6c('0x1f')];this[_0xec6c('0x20')]=_0x5966ab[_0xec6c('0x20')];}module[_0xec6c('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 44a5604..8b5892a 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f4f=['countdropretry','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','membername','IVR','reason','cause-txt','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','../utils','state','statedesc','scheduledat','type','queue','amd','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x21e2b9,_0x5af4bc){var _0x26ad06=function(_0x573609){while(--_0x573609){_0x21e2b9['push'](_0x21e2b9['shift']());}};_0x26ad06(++_0x5af4bc);}(_0x6f4f,0x19d));var _0xf6f4=function(_0x242e5b,_0x35c61e){_0x242e5b=_0x242e5b-0x0;var _0x97b24b=_0x6f4f[_0x242e5b];return _0x97b24b;};'use strict';var moment=require(_0xf6f4('0x0'));var utils=require(_0xf6f4('0x1'));function Hangup(_0x696210,_0x45b986){this[_0xf6f4('0x2')]=0x4;this[_0xf6f4('0x3')]='Answer';this[_0xf6f4('0x4')]=_0x696210[_0xf6f4('0x4')];this[_0xf6f4('0x5')]=_0x696210[_0xf6f4('0x5')];this['campaigntype']=_0x696210[_0xf6f4('0x5')]==='outbound'?_0xf6f4('0x6'):_0x696210['type'];this[_0xf6f4('0x7')]=_0x696210[_0xf6f4('0x7')]||![];this['countbusyretry']=_0x696210[_0xf6f4('0x8')];this['countcongestionretry']=_0x696210['countcongestionretry'];this[_0xf6f4('0x9')]=_0x696210[_0xf6f4('0x9')];this[_0xf6f4('0xa')]=_0x696210[_0xf6f4('0x8')]+_0x696210[_0xf6f4('0xb')]+_0x696210[_0xf6f4('0x9')]+_0x696210[_0xf6f4('0xc')]+_0x696210['countdropretry']+_0x696210[_0xf6f4('0xd')]+_0x696210[_0xf6f4('0xe')]+_0x696210[_0xf6f4('0xf')];this[_0xf6f4('0xc')]=_0x696210[_0xf6f4('0xc')];this['countdropretry']=_0x696210[_0xf6f4('0x10')];this[_0xf6f4('0xd')]=_0x696210['countabandonedretry'];this[_0xf6f4('0xe')]=_0x696210['countmachineretry'];this[_0xf6f4('0xf')]=_0x696210[_0xf6f4('0xf')];this['uniqueid']=_0x45b986['uniqueid'];this['calleridname']=_0x696210['name'];this[_0xf6f4('0x11')]=_0x696210[_0xf6f4('0x12')];this[_0xf6f4('0x13')]=_0x696210[_0xf6f4('0x13')];this[_0xf6f4('0x14')]=_0x696210[_0xf6f4('0x14')];this[_0xf6f4('0x15')]=moment()[_0xf6f4('0x16')](_0xf6f4('0x17'));this['ringtime']=utils[_0xf6f4('0x18')](_0x696210['responsetime'],_0x696210[_0xf6f4('0x13')]);this[_0xf6f4('0x19')]=0x0;this[_0xf6f4('0x1a')]=utils[_0xf6f4('0x18')](this[_0xf6f4('0x15')],_0x696210[_0xf6f4('0x14')]);this[_0xf6f4('0x6')]=_0x696210['queue'];this[_0xf6f4('0x1b')]=_0xf6f4('0x1c');this[_0xf6f4('0x1d')]=_0x45b986[_0xf6f4('0x1e')];this['callback']=_0x696210['callback'];this[_0xf6f4('0x1f')]=_0x696210[_0xf6f4('0x1f')];this[_0xf6f4('0x20')]=_0x696210['callbackat'];this[_0xf6f4('0x21')]=_0x696210[_0xf6f4('0x21')];this[_0xf6f4('0x22')]=_0x696210['ContactId'];this[_0xf6f4('0x23')]=_0x696210[_0xf6f4('0x23')];this['UserId']=_0x696210[_0xf6f4('0x24')];this[_0xf6f4('0x25')]=_0x696210[_0xf6f4('0x25')];this[_0xf6f4('0x26')]=_0x696210['CampaignId'];}module['exports']=Hangup; \ No newline at end of file +var _0xbc86=['talktime','endtime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','../utils','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds'];(function(_0x6b1508,_0x389db2){var _0x1921ed=function(_0x457ab4){while(--_0x457ab4){_0x6b1508['push'](_0x6b1508['shift']());}};_0x1921ed(++_0x389db2);}(_0xbc86,0xfe));var _0x6bc8=function(_0x5e2697,_0x12b23f){_0x5e2697=_0x5e2697-0x0;var _0xb396f4=_0xbc86[_0x5e2697];return _0xb396f4;};'use strict';var moment=require(_0x6bc8('0x0'));var utils=require(_0x6bc8('0x1'));function Hangup(_0x4eb2e3,_0x135f7b){this[_0x6bc8('0x2')]=0x4;this[_0x6bc8('0x3')]=_0x6bc8('0x4');this[_0x6bc8('0x5')]=_0x4eb2e3['scheduledat'];this[_0x6bc8('0x6')]=_0x4eb2e3[_0x6bc8('0x6')];this['campaigntype']=_0x4eb2e3[_0x6bc8('0x6')]===_0x6bc8('0x7')?_0x6bc8('0x8'):_0x4eb2e3[_0x6bc8('0x6')];this['amd']=_0x4eb2e3['amd']||![];this['countbusyretry']=_0x4eb2e3[_0x6bc8('0x9')];this[_0x6bc8('0xa')]=_0x4eb2e3[_0x6bc8('0xa')];this[_0x6bc8('0xb')]=_0x4eb2e3[_0x6bc8('0xb')];this[_0x6bc8('0xc')]=_0x4eb2e3['countbusyretry']+_0x4eb2e3[_0x6bc8('0xa')]+_0x4eb2e3[_0x6bc8('0xb')]+_0x4eb2e3['countnosuchnumberretry']+_0x4eb2e3['countdropretry']+_0x4eb2e3[_0x6bc8('0xd')]+_0x4eb2e3['countmachineretry']+_0x4eb2e3['countagentrejectretry'];this[_0x6bc8('0xe')]=_0x4eb2e3[_0x6bc8('0xe')];this[_0x6bc8('0xf')]=_0x4eb2e3['countdropretry'];this[_0x6bc8('0xd')]=_0x4eb2e3[_0x6bc8('0xd')];this[_0x6bc8('0x10')]=_0x4eb2e3[_0x6bc8('0x10')];this[_0x6bc8('0x11')]=_0x4eb2e3[_0x6bc8('0x11')];this[_0x6bc8('0x12')]=_0x135f7b[_0x6bc8('0x12')];this['calleridname']=_0x4eb2e3['name'];this[_0x6bc8('0x13')]=_0x4eb2e3[_0x6bc8('0x14')];this[_0x6bc8('0x15')]=_0x4eb2e3[_0x6bc8('0x15')];this[_0x6bc8('0x16')]=_0x4eb2e3['responsetime'];this['endtime']=moment()[_0x6bc8('0x17')](_0x6bc8('0x18'));this['ringtime']=utils[_0x6bc8('0x19')](_0x4eb2e3[_0x6bc8('0x16')],_0x4eb2e3['starttime']);this['holdtime']=0x0;this[_0x6bc8('0x1a')]=utils[_0x6bc8('0x19')](this[_0x6bc8('0x1b')],_0x4eb2e3[_0x6bc8('0x16')]);this[_0x6bc8('0x8')]=_0x4eb2e3[_0x6bc8('0x8')];this[_0x6bc8('0x1c')]='IVR';this[_0x6bc8('0x1d')]=_0x135f7b[_0x6bc8('0x1e')];this[_0x6bc8('0x1f')]=_0x4eb2e3[_0x6bc8('0x1f')];this['callbackuniqueid']=_0x4eb2e3[_0x6bc8('0x20')];this[_0x6bc8('0x21')]=_0x4eb2e3[_0x6bc8('0x21')];this[_0x6bc8('0x22')]=_0x4eb2e3[_0x6bc8('0x22')];this[_0x6bc8('0x23')]=_0x4eb2e3['ContactId'];this['ListId']=_0x4eb2e3[_0x6bc8('0x24')];this[_0x6bc8('0x25')]=_0x4eb2e3[_0x6bc8('0x25')];this[_0x6bc8('0x26')]=_0x4eb2e3[_0x6bc8('0x26')];this[_0x6bc8('0x27')]=_0x4eb2e3[_0x6bc8('0x27')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index b2fb6a6..111c0b3 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25b6=['type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','name','calleridnum','number','starttime','responsetime','endtime','getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x25b6,0x12f));var _0x625b=function(_0x53f04f,_0x419aa8){_0x53f04f=_0x53f04f-0x0;var _0x16a824=_0x25b6[_0x53f04f];return _0x16a824;};'use strict';var utils=require(_0x625b('0x0'));function History(_0x455394){this[_0x625b('0x1')]=_0x455394[_0x625b('0x1')];this['scheduledat']=_0x455394[_0x625b('0x2')]||undefined;this['type']=_0x455394[_0x625b('0x3')];this['campaigntype']=_0x455394[_0x625b('0x3')]===_0x625b('0x4')?'queue':_0x455394[_0x625b('0x3')];this['countbusyretry']=_0x455394[_0x625b('0x5')];this['countcongestionretry']=_0x455394[_0x625b('0x6')];this[_0x625b('0x7')]=_0x455394[_0x625b('0x7')];this['countglobal']=_0x455394[_0x625b('0x5')]+_0x455394[_0x625b('0x6')]+_0x455394[_0x625b('0x7')]+_0x455394[_0x625b('0x8')]+_0x455394[_0x625b('0x9')]+_0x455394[_0x625b('0xa')]+_0x455394[_0x625b('0xb')]+_0x455394[_0x625b('0xc')];this[_0x625b('0x8')]=_0x455394[_0x625b('0x8')];this[_0x625b('0x9')]=_0x455394[_0x625b('0x9')];this[_0x625b('0xa')]=_0x455394[_0x625b('0xa')];this['countmachineretry']=_0x455394[_0x625b('0xb')];this[_0x625b('0xc')]=_0x455394[_0x625b('0xc')];this[_0x625b('0xd')]=_0x455394['queue'];this['calleridname']=_0x455394[_0x625b('0xe')];this[_0x625b('0xf')]=_0x455394[_0x625b('0x10')];this['starttime']=_0x455394[_0x625b('0x11')];this[_0x625b('0x12')]=_0x455394[_0x625b('0x12')];this[_0x625b('0x13')]=_0x455394[_0x625b('0x12')];this['ringtime']=utils[_0x625b('0x14')](_0x455394[_0x625b('0x12')],_0x455394[_0x625b('0x11')]);this['holdtime']=0x0;this[_0x625b('0x15')]=0x0;this[_0x625b('0x16')]=_0x455394[_0x625b('0x16')];this[_0x625b('0x17')]=_0x455394[_0x625b('0x17')];this['callbackat']=_0x455394[_0x625b('0x18')];this['recallme']=_0x455394[_0x625b('0x19')];this['ContactId']=_0x455394['ContactId'];this[_0x625b('0x1a')]=_0x455394[_0x625b('0x1a')];this[_0x625b('0x1b')]=_0x455394[_0x625b('0x1b')];this['VoiceQueueId']=_0x455394['VoiceQueueId'];this[_0x625b('0x1c')]=_0x455394[_0x625b('0x1c')];this[_0x625b('0x1d')]=_0x455394[_0x625b('0x1d')]||'';this[_0x625b('0x1e')]=_0x455394[_0x625b('0x1e')]||'';this[_0x625b('0x1f')]=_0x455394[_0x625b('0x1f')];this[_0x625b('0x20')]=_0x455394[_0x625b('0x20')];}module[_0x625b('0x21')]=History; \ No newline at end of file +var _0xf856=['statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countmachineretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','getSeconds','holdtime','talktime','callback','callbackat','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state'];(function(_0x3bbf21,_0x4021c6){var _0x4d1047=function(_0x2152ac){while(--_0x2152ac){_0x3bbf21['push'](_0x3bbf21['shift']());}};_0x4d1047(++_0x4021c6);}(_0xf856,0x65));var _0x6f85=function(_0x1b15c1,_0xc1e271){_0x1b15c1=_0x1b15c1-0x0;var _0x2c9753=_0xf856[_0x1b15c1];return _0x2c9753;};'use strict';var utils=require('../utils');function History(_0x30859b){this[_0x6f85('0x0')]=_0x30859b[_0x6f85('0x0')];this['scheduledat']=_0x30859b[_0x6f85('0x1')]||undefined;this['type']=_0x30859b[_0x6f85('0x2')];this[_0x6f85('0x3')]=_0x30859b['type']===_0x6f85('0x4')?_0x6f85('0x5'):_0x30859b['type'];this[_0x6f85('0x6')]=_0x30859b['countbusyretry'];this[_0x6f85('0x7')]=_0x30859b[_0x6f85('0x7')];this[_0x6f85('0x8')]=_0x30859b['countnoanswerretry'];this['countglobal']=_0x30859b[_0x6f85('0x6')]+_0x30859b[_0x6f85('0x7')]+_0x30859b[_0x6f85('0x8')]+_0x30859b['countnosuchnumberretry']+_0x30859b['countdropretry']+_0x30859b['countabandonedretry']+_0x30859b[_0x6f85('0x9')]+_0x30859b['countagentrejectretry'];this['countnosuchnumberretry']=_0x30859b[_0x6f85('0xa')];this[_0x6f85('0xb')]=_0x30859b[_0x6f85('0xb')];this[_0x6f85('0xc')]=_0x30859b[_0x6f85('0xc')];this[_0x6f85('0x9')]=_0x30859b['countmachineretry'];this[_0x6f85('0xd')]=_0x30859b[_0x6f85('0xd')];this[_0x6f85('0x5')]=_0x30859b['queue'];this[_0x6f85('0xe')]=_0x30859b['name'];this[_0x6f85('0xf')]=_0x30859b[_0x6f85('0x10')];this[_0x6f85('0x11')]=_0x30859b[_0x6f85('0x11')];this[_0x6f85('0x12')]=_0x30859b[_0x6f85('0x12')];this['endtime']=_0x30859b[_0x6f85('0x12')];this['ringtime']=utils[_0x6f85('0x13')](_0x30859b[_0x6f85('0x12')],_0x30859b[_0x6f85('0x11')]);this[_0x6f85('0x14')]=0x0;this[_0x6f85('0x15')]=0x0;this['callback']=_0x30859b[_0x6f85('0x16')];this['callbackuniqueid']=_0x30859b['callbackuniqueid'];this[_0x6f85('0x17')]=_0x30859b[_0x6f85('0x17')];this['recallme']=_0x30859b['recallme'];this[_0x6f85('0x18')]=_0x30859b[_0x6f85('0x18')];this['ListId']=_0x30859b['ListId'];this[_0x6f85('0x19')]=_0x30859b[_0x6f85('0x19')];this[_0x6f85('0x1a')]=_0x30859b['VoiceQueueId'];this[_0x6f85('0x1b')]=_0x30859b[_0x6f85('0x1b')];this['originatecalleridnum']=_0x30859b[_0x6f85('0x1c')]||'';this[_0x6f85('0x1d')]=_0x30859b[_0x6f85('0x1d')]||'';this[_0x6f85('0x1e')]=_0x30859b[_0x6f85('0x1e')];this[_0x6f85('0x1f')]=_0x30859b['statedesc'];}module[_0x6f85('0x20')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 939e94d..d59cb69 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdfb9=['countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','dropreason','endtime','ringtime','getSeconds','holdtime','droptime','talktime','queue','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xdfb9,0x171));var _0x9dfb=function(_0x38b8aa,_0x16a874){_0x38b8aa=_0x38b8aa-0x0;var _0x25faf0=_0xdfb9[_0x38b8aa];return _0x25faf0;};'use strict';var utils=require(_0x9dfb('0x0'));function QueueCallerAbandon(_0x4a18e3,_0x22104c){this[_0x9dfb('0x1')]=_0x4a18e3[_0x9dfb('0x1')];this[_0x9dfb('0x2')]=_0x4a18e3[_0x9dfb('0x2')];this['campaigntype']=_0x4a18e3[_0x9dfb('0x2')]==='outbound'?'queue':_0x4a18e3[_0x9dfb('0x2')];this[_0x9dfb('0x3')]=_0x4a18e3[_0x9dfb('0x3')];this[_0x9dfb('0x4')]=_0x4a18e3[_0x9dfb('0x4')];this[_0x9dfb('0x5')]=_0x4a18e3[_0x9dfb('0x5')];this[_0x9dfb('0x6')]=_0x4a18e3[_0x9dfb('0x3')]+_0x4a18e3['countcongestionretry']+_0x4a18e3[_0x9dfb('0x5')]+_0x4a18e3[_0x9dfb('0x7')]+_0x4a18e3['countdropretry']+_0x4a18e3[_0x9dfb('0x8')]+_0x4a18e3[_0x9dfb('0x9')]+_0x4a18e3[_0x9dfb('0xa')];this[_0x9dfb('0x7')]=_0x4a18e3[_0x9dfb('0x7')];this[_0x9dfb('0xb')]=_0x4a18e3[_0x9dfb('0xb')];this[_0x9dfb('0x8')]=_0x4a18e3[_0x9dfb('0x8')];this[_0x9dfb('0x9')]=_0x4a18e3[_0x9dfb('0x9')];this['countagentrejectretry']=_0x4a18e3['countagentrejectretry'];this[_0x9dfb('0xc')]=_0x22104c['uniqueid'];this[_0x9dfb('0xd')]=_0x4a18e3['name'];this[_0x9dfb('0xe')]=_0x4a18e3[_0x9dfb('0xf')];this[_0x9dfb('0x10')]=_0x4a18e3[_0x9dfb('0x10')];this[_0x9dfb('0x11')]=_0x4a18e3['responsetime'];this['droptime']=_0x4a18e3['droptime'];this[_0x9dfb('0x12')]=_0x4a18e3[_0x9dfb('0x12')];this[_0x9dfb('0x13')]=this['droptime'];this[_0x9dfb('0x14')]=utils[_0x9dfb('0x15')](_0x4a18e3[_0x9dfb('0x11')],_0x4a18e3[_0x9dfb('0x10')]);this[_0x9dfb('0x16')]=utils[_0x9dfb('0x15')](this[_0x9dfb('0x17')],_0x4a18e3[_0x9dfb('0x11')]);this[_0x9dfb('0x18')]=0x0;this[_0x9dfb('0x19')]=_0x22104c['queue'];this[_0x9dfb('0x1a')]=_0x22104c[_0x9dfb('0x1b')];this['reason']=_0x22104c[_0x9dfb('0x1c')];this['callback']=_0x4a18e3['callback'];this['callbackuniqueid']=_0x4a18e3[_0x9dfb('0x1d')];this[_0x9dfb('0x1e')]=_0x4a18e3[_0x9dfb('0x1e')];this[_0x9dfb('0x1f')]=_0x4a18e3[_0x9dfb('0x1f')];this[_0x9dfb('0x20')]=_0x4a18e3[_0x9dfb('0x20')];this[_0x9dfb('0x21')]=_0x4a18e3[_0x9dfb('0x21')];this['UserId']=_0x4a18e3['UserId'];this['VoiceQueueId']=_0x4a18e3[_0x9dfb('0x22')];this[_0x9dfb('0x23')]=_0x4a18e3[_0x9dfb('0x23')];this[_0x9dfb('0x24')]=_0x4a18e3[_0x9dfb('0x24')]||'';this['originatecalleridname']=_0x4a18e3[_0x9dfb('0x25')]||'';this[_0x9dfb('0x26')]=_0x4a18e3['agiafterat'];this[_0x9dfb('0x27')]=_0x4a18e3['state'];this[_0x9dfb('0x28')]=_0x4a18e3[_0x9dfb('0x28')];}module[_0x9dfb('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0xf58e=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','talktime','membername','connectedlinename','callback','callbackuniqueid','callbackat'];(function(_0x2f6e2d,_0x3ba8a5){var _0x3d122c=function(_0x3f15ac){while(--_0x3f15ac){_0x2f6e2d['push'](_0x2f6e2d['shift']());}};_0x3d122c(++_0x3ba8a5);}(_0xf58e,0x1ba));var _0xef58=function(_0x2b3f56,_0x4ee051){_0x2b3f56=_0x2b3f56-0x0;var _0x23cea8=_0xf58e[_0x2b3f56];return _0x23cea8;};'use strict';var utils=require(_0xef58('0x0'));function QueueCallerAbandon(_0x534d97,_0x4cdc6e){this[_0xef58('0x1')]=_0x534d97[_0xef58('0x1')];this[_0xef58('0x2')]=_0x534d97[_0xef58('0x2')];this[_0xef58('0x3')]=_0x534d97[_0xef58('0x2')]==='outbound'?_0xef58('0x4'):_0x534d97[_0xef58('0x2')];this[_0xef58('0x5')]=_0x534d97[_0xef58('0x5')];this[_0xef58('0x6')]=_0x534d97[_0xef58('0x6')];this[_0xef58('0x7')]=_0x534d97[_0xef58('0x7')];this[_0xef58('0x8')]=_0x534d97[_0xef58('0x5')]+_0x534d97[_0xef58('0x6')]+_0x534d97['countnoanswerretry']+_0x534d97['countnosuchnumberretry']+_0x534d97[_0xef58('0x9')]+_0x534d97[_0xef58('0xa')]+_0x534d97['countmachineretry']+_0x534d97[_0xef58('0xb')];this[_0xef58('0xc')]=_0x534d97[_0xef58('0xc')];this[_0xef58('0x9')]=_0x534d97[_0xef58('0x9')];this['countabandonedretry']=_0x534d97['countabandonedretry'];this['countmachineretry']=_0x534d97[_0xef58('0xd')];this['countagentrejectretry']=_0x534d97['countagentrejectretry'];this[_0xef58('0xe')]=_0x4cdc6e['uniqueid'];this[_0xef58('0xf')]=_0x534d97[_0xef58('0x10')];this['calleridnum']=_0x534d97[_0xef58('0x11')];this[_0xef58('0x12')]=_0x534d97['starttime'];this[_0xef58('0x13')]=_0x534d97[_0xef58('0x13')];this[_0xef58('0x14')]=_0x534d97[_0xef58('0x14')];this[_0xef58('0x15')]=_0x534d97[_0xef58('0x15')];this[_0xef58('0x16')]=this[_0xef58('0x14')];this[_0xef58('0x17')]=utils[_0xef58('0x18')](_0x534d97[_0xef58('0x13')],_0x534d97[_0xef58('0x12')]);this['holdtime']=utils[_0xef58('0x18')](this['droptime'],_0x534d97[_0xef58('0x13')]);this[_0xef58('0x19')]=0x0;this[_0xef58('0x4')]=_0x4cdc6e[_0xef58('0x4')];this[_0xef58('0x1a')]=_0x4cdc6e[_0xef58('0x1b')];this['reason']=_0x4cdc6e['reason'];this[_0xef58('0x1c')]=_0x534d97[_0xef58('0x1c')];this[_0xef58('0x1d')]=_0x534d97[_0xef58('0x1d')];this[_0xef58('0x1e')]=_0x534d97['callbackat'];this[_0xef58('0x1f')]=_0x534d97[_0xef58('0x1f')];this[_0xef58('0x20')]=_0x534d97['ContactId'];this[_0xef58('0x21')]=_0x534d97['ListId'];this['UserId']=_0x534d97[_0xef58('0x22')];this[_0xef58('0x23')]=_0x534d97[_0xef58('0x23')];this[_0xef58('0x24')]=_0x534d97[_0xef58('0x24')];this[_0xef58('0x25')]=_0x534d97[_0xef58('0x25')]||'';this[_0xef58('0x26')]=_0x534d97[_0xef58('0x26')]||'';this[_0xef58('0x27')]=_0x534d97['agiafterat'];this['state']=_0x534d97[_0xef58('0x28')];this[_0xef58('0x29')]=_0x534d97[_0xef58('0x29')];}module[_0xef58('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index ab14649..a07a24d 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xacf4=['[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','getContactDialerIvr','[countReScheduled]','countReScheduled','rescheduleContact','[rescheduleContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr'];(function(_0x304466,_0x1a933f){var _0x1ea77f=function(_0x3a4156){while(--_0x3a4156){_0x304466['push'](_0x304466['shift']());}};_0x1ea77f(++_0x1a933f);}(_0xacf4,0xe7));var _0x4acf=function(_0x2ea046,_0x5ab912){_0x2ea046=_0x2ea046-0x0;var _0x433e5a=_0xacf4[_0x2ea046];return _0x433e5a;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0x4acf('0x0'));var cmHopper=require(_0x4acf('0x1'));var cmHopperAdditionalPhone=require(_0x4acf('0x2'));var cmHopperBlack=require(_0x4acf('0x3'));var cmHopperHistory=require(_0x4acf('0x4'));function inspectError(_0x4138f0){return util[_0x4acf('0x5')](_0x4138f0,{'showHidden':![],'depth':null});}function getContactDialer(_0x5cf22d,_0x380435,_0x2124c8){return cmHopper['getContactDialer'](_0x5cf22d['id'],_0x380435,_0x2124c8,_0x5cf22d[_0x4acf('0x6')])[_0x4acf('0x7')](function(_0x649ad2){_0x5cf22d[_0x4acf('0x8')]=0x0;logger[_0x4acf('0x9')]('[getContactDialer]',inspectError(_0x649ad2));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x41970b,_0x59f559){return cmHopper[_0x4acf('0xa')](_0x41970b['id'],_0x59f559,_0x41970b[_0x4acf('0x6')])[_0x4acf('0x7')](function(_0x4ff233){_0x41970b[_0x4acf('0x8')]=0x0;logger[_0x4acf('0x9')]('[getContactDialerIvr]',inspectError(_0x4ff233));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x1fe474){return cmHopper['countReScheduled'](_0x1fe474)['catch'](function(_0x1783d2){logger[_0x4acf('0x9')](_0x4acf('0xb'),inspectError(_0x1783d2));});}exports[_0x4acf('0xc')]=countReScheduled;function rescheduleContact(_0x18629e){return cmHopper[_0x4acf('0xd')](_0x18629e)[_0x4acf('0x7')](function(_0x15386a){logger[_0x4acf('0x9')](_0x4acf('0xe'),inspectError(_0x15386a));});}exports[_0x4acf('0xd')]=rescheduleContact;function unlockContact(_0x5f0260,_0x1b584a,_0x57d8e0){return cmHopper[_0x4acf('0xf')](_0x5f0260,_0x1b584a,_0x57d8e0)[_0x4acf('0x7')](function(_0xccf970){logger['error']('[unlockContact]',inspectError(_0xccf970));});}exports[_0x4acf('0xf')]=unlockContact;function moveContactManagedDialer(_0x40cb8d){return cmHopper[_0x4acf('0x10')](_0x40cb8d)['catch'](function(_0x2a678b){logger[_0x4acf('0x9')](_0x4acf('0x11'),inspectError(_0x2a678b));});}exports[_0x4acf('0x10')]=moveContactManagedDialer;function checkIsBlackList(_0x2f0cec){return cmHopperBlack[_0x4acf('0x12')](_0x2f0cec)[_0x4acf('0x7')](function(_0x16ae40){logger[_0x4acf('0x9')](_0x4acf('0x13'),inspectError(_0x16ae40));});}exports[_0x4acf('0x12')]=checkIsBlackList;function checkIsBlackListIvr(_0x5f0284){return cmHopperBlack[_0x4acf('0x14')](_0x5f0284)[_0x4acf('0x7')](function(_0x57ea46){logger[_0x4acf('0x9')](_0x4acf('0x15'),inspectError(_0x57ea46));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x3b26ac,_0x34d154,_0x433b7a){return cmHopperAdditionalPhone[_0x4acf('0x16')](_0x3b26ac,_0x34d154,_0x433b7a)['catch'](function(_0x1a2286){logger[_0x4acf('0x9')]('[verifyAdditionalPhone]',inspectError(_0x1a2286));});}exports[_0x4acf('0x16')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x1af4e9,_0x52a84a,_0x126522){return cmHopperAdditionalPhone[_0x4acf('0x17')](_0x1af4e9,_0x52a84a,_0x126522)[_0x4acf('0x7')](function(_0x16458f){logger['error']('[swapAdditionalPhone]',inspectError(_0x16458f));});}exports[_0x4acf('0x17')]=swapAdditionalPhones;function avgHandleTime(_0x3f548a){return cmHopperHistory[_0x4acf('0x18')](_0x3f548a)[_0x4acf('0x7')](function(_0x14086c){logger[_0x4acf('0x9')](_0x4acf('0x19'),inspectError(_0x14086c));});}exports[_0x4acf('0x18')]=avgHandleTime;function createHistory(_0x382c41){return cmHopperHistory[_0x4acf('0x1a')](_0x382c41)['catch'](function(_0x3521c2){logger[_0x4acf('0x9')](_0x4acf('0x1b'),inspectError(_0x3521c2));});}exports[_0x4acf('0x1a')]=createHistory; \ No newline at end of file +var _0x4819=['[unlockContact]','[moveContactManagedDialer]','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','avgHandleTime','createHistory','[createHistory]','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','temp','error','[getContactDialer]','dialOrderByScheduledAt','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','catch','rescheduleContact','[rescheduleContact]','unlockContact'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0x4819,0xcd));var _0x9481=function(_0x499001,_0x3f27ae){_0x499001=_0x499001-0x0;var _0x320c65=_0x4819[_0x499001];return _0x320c65;};'use strict';var util=require('util');var logger=require(_0x9481('0x0'))(_0x9481('0x1'));var cmHopper=require(_0x9481('0x2'));var cmHopperAdditionalPhone=require(_0x9481('0x3'));var cmHopperBlack=require(_0x9481('0x4'));var cmHopperHistory=require(_0x9481('0x5'));function inspectError(_0x40a703){return util[_0x9481('0x6')](_0x40a703,{'showHidden':![],'depth':null});}function getContactDialer(_0xc39edf,_0x16c617,_0x5ac51c){return cmHopper[_0x9481('0x7')](_0xc39edf['id'],_0x16c617,_0x5ac51c,_0xc39edf['dialOrderByScheduledAt'])['catch'](function(_0x14e05a){_0xc39edf[_0x9481('0x8')]=0x0;logger[_0x9481('0x9')](_0x9481('0xa'),inspectError(_0x14e05a));});}exports[_0x9481('0x7')]=getContactDialer;function getContactDialerIvr(_0x4c7d9c,_0x1818cf){return cmHopper['getContactDialerIvr'](_0x4c7d9c['id'],_0x1818cf,_0x4c7d9c[_0x9481('0xb')])['catch'](function(_0x411d24){_0x4c7d9c[_0x9481('0x8')]=0x0;logger[_0x9481('0x9')](_0x9481('0xc'),inspectError(_0x411d24));});}exports[_0x9481('0xd')]=getContactDialerIvr;function countReScheduled(_0x29515a){return cmHopper[_0x9481('0xe')](_0x29515a)[_0x9481('0xf')](function(_0xed8e9){logger['error']('[countReScheduled]',inspectError(_0xed8e9));});}exports[_0x9481('0xe')]=countReScheduled;function rescheduleContact(_0x150276){return cmHopper[_0x9481('0x10')](_0x150276)[_0x9481('0xf')](function(_0x3d23c2){logger[_0x9481('0x9')](_0x9481('0x11'),inspectError(_0x3d23c2));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x4220f1,_0x7a7ee,_0x5b1fe6){return cmHopper[_0x9481('0x12')](_0x4220f1,_0x7a7ee,_0x5b1fe6)['catch'](function(_0x34108d){logger[_0x9481('0x9')](_0x9481('0x13'),inspectError(_0x34108d));});}exports[_0x9481('0x12')]=unlockContact;function moveContactManagedDialer(_0x546fce){return cmHopper['moveContactManagedDialer'](_0x546fce)[_0x9481('0xf')](function(_0x50a559){logger['error'](_0x9481('0x14'),inspectError(_0x50a559));});}exports[_0x9481('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0x18c6f5){return cmHopperBlack[_0x9481('0x16')](_0x18c6f5)[_0x9481('0xf')](function(_0x3dc33f){logger['error'](_0x9481('0x17'),inspectError(_0x3dc33f));});}exports[_0x9481('0x16')]=checkIsBlackList;function checkIsBlackListIvr(_0x45f9df){return cmHopperBlack[_0x9481('0x18')](_0x45f9df)[_0x9481('0xf')](function(_0x56da97){logger[_0x9481('0x9')](_0x9481('0x19'),inspectError(_0x56da97));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2bcf37,_0xd1cd1a,_0x352b3a){return cmHopperAdditionalPhone[_0x9481('0x1a')](_0x2bcf37,_0xd1cd1a,_0x352b3a)[_0x9481('0xf')](function(_0x49ecfa){logger[_0x9481('0x9')](_0x9481('0x1b'),inspectError(_0x49ecfa));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x5eb4f5,_0x12b0c3,_0x299e28){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x5eb4f5,_0x12b0c3,_0x299e28)[_0x9481('0xf')](function(_0x20ff9a){logger[_0x9481('0x9')](_0x9481('0x1c'),inspectError(_0x20ff9a));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x14f03e){return cmHopperHistory[_0x9481('0x1d')](_0x14f03e)[_0x9481('0xf')](function(_0x587706){logger[_0x9481('0x9')]('[avgHandleTime]',inspectError(_0x587706));});}exports[_0x9481('0x1d')]=avgHandleTime;function createHistory(_0xe153ab){return cmHopperHistory[_0x9481('0x1e')](_0xe153ab)[_0x9481('0xf')](function(_0x2e5e63){logger['error'](_0x9481('0x1f'),inspectError(_0x2e5e63));});}exports[_0x9481('0x1e')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index e5cce02..d2acd88 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa004=['updatedAt','description','XMD-','toUpperCase','setXMDContactVariables','lodash','../../../../config/logger','dialer','../../../../config/environment/shared','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','isPreviewCampaign','ivr','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','ACTIVE','INACTIVE','DISACTIVED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','extractCalleridName','string','isEmpty','\x22%s\x22\x20<%s>','format','isUndefined','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','createdAt','tags'];(function(_0x20ff2b,_0x277560){var _0x463fa4=function(_0x32da1){while(--_0x32da1){_0x20ff2b['push'](_0x20ff2b['shift']());}};_0x463fa4(++_0x277560);}(_0xa004,0xb5));var _0x4a00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa004[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4a00('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0x4a00('0x1'))(_0x4a00('0x2'));var timezones=require(_0x4a00('0x3'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x4a00('0x4'),'CONTACTS_RESCHEDULED':_0x4a00('0x5'),'DEACTIVATED':_0x4a00('0x6'),'DISACTIVED':_0x4a00('0x7'),'EMPTY_INTERVAL':_0x4a00('0x8'),'INACTIVE':_0x4a00('0x9'),'NO_AGENTS_LOGGED':_0x4a00('0xa'),'NO_AVAILABLE_CONTACTS':_0x4a00('0xb'),'NULL_INTERVAL':_0x4a00('0xc'),'OVERTIME_INTERVAL':_0x4a00('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0x4a00('0xe'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x4a00('0xf'),'UNREACHABLE_TRUNK':_0x4a00('0x10')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x5efaf9){return _0x5efaf9[_0x4a00('0x11')]===_0x4a00('0x12');}exports[_0x4a00('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x4f6437){return _0x4f6437['type']===_0x4a00('0x14');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x350494){return _0x350494['type']===_0x4a00('0x15');}exports[_0x4a00('0x16')]=isOutboundQueue;function isQueueCampaignActive(_0x2f81e1){return _0x2f81e1[_0x4a00('0x17')];}exports[_0x4a00('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x8d072e){return _0x8d072e[_0x4a00('0x19')];}exports[_0x4a00('0x1a')]=isIVRCampaignActive;function getSeconds(_0x928b6c,_0x3a2fdc){var _0x5e86a4=moment(_0x928b6c)['milliseconds'](0x0);var _0x308a64=moment(_0x3a2fdc)[_0x4a00('0x1b')](0x0);return _0x5e86a4[_0x4a00('0x1c')](_0x308a64,_0x4a00('0x1d'));}exports[_0x4a00('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x451389,_0x1020d5){var _0x541f71=![];var _0xc1f65d=_0x451389[_0x4a00('0x11')]!==_0x1020d5[_0x4a00('0x11')]||_0x451389['dialActive']!==_0x1020d5[_0x4a00('0x17')]||_0x451389[_0x4a00('0x1f')]!==_0x1020d5['message'];var _0x297415=_0x451389[_0x4a00('0x20')]!==_0x1020d5[_0x4a00('0x20')]||_0x451389['loggedIn']!==_0x1020d5[_0x4a00('0x21')]||_0x451389[_0x4a00('0x22')]!==_0x1020d5[_0x4a00('0x22')]||_0x451389[_0x4a00('0x23')]!==_0x1020d5[_0x4a00('0x23')]||_0x451389['talking']!==_0x1020d5[_0x4a00('0x24')]||_0x451389[_0x4a00('0x25')]!==_0x1020d5[_0x4a00('0x25')]||_0x451389[_0x4a00('0x26')]!==_0x1020d5['waiting']||_0x451389['inUse']!==_0x1020d5[_0x4a00('0x27')]||_0x451389[_0x4a00('0x28')]!==_0x1020d5['originated'];if(_0x451389['Trunk']&&_0x1020d5['Trunk']){_0x541f71=_0x451389[_0x4a00('0x29')][_0x4a00('0x2a')]!==_0x1020d5[_0x4a00('0x29')]['name']||_0x451389[_0x4a00('0x29')][_0x4a00('0x19')]!==_0x1020d5['Trunk'][_0x4a00('0x19')];}return _0xc1f65d||_0x297415||_0x541f71;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x4e4b80){var _0x4da761=null;var _0x58b057=_0x4e4b80[_0x4a00('0x2b')];if(_[_0x4a00('0x2c')](_0x4e4b80[_0x4a00('0x2d')])||_[_0x4a00('0x2c')](_0x4e4b80[_0x4a00('0x2e')])||_[_0x4a00('0x2c')](_0x4e4b80[_0x4a00('0x2e')]['Intervals'])){_0x4da761=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_['isEmpty'](_0x4e4b80[_0x4a00('0x2d')])||_['isEmpty'](_0x4e4b80[_0x4a00('0x2e')][_0x4a00('0x2f')])){_0x4da761=CAMPAIGN_STATUS[_0x4a00('0x30')];}else if(_0x58b057&&!timezones[_0x58b057]){_0x4da761=CAMPAIGN_STATUS[_0x4a00('0x31')];}return _0x4da761;}function checkAnyValidTrunk(_0xf9aee9,_0x2a1e46){var _0xe522d1=null;var _0x336adb=_0x4a00('0x32');var _0x58db76=[_0x4a00('0x33'),_0x4a00('0x34')];var _0x27cbe7=!![];if(_0xf9aee9[_0x4a00('0x29')]&&_0xf9aee9[_0x4a00('0x29')][_0x4a00('0x19')]){_0x336adb+=_0xf9aee9[_0x4a00('0x29')][_0x4a00('0x2a')];_0xe522d1=_0x2a1e46[_0x336adb];_0x27cbe7=_0x58db76[_0x4a00('0x35')](_0xe522d1[_0x4a00('0x36')]);}else if(_0xf9aee9[_0x4a00('0x37')]&&_0xf9aee9[_0x4a00('0x37')][_0x4a00('0x19')]){_0x336adb+=_0xf9aee9[_0x4a00('0x37')][_0x4a00('0x2a')];_0xe522d1=_0x2a1e46[_0x336adb];_0x27cbe7=_0x58db76['includes'](_0xe522d1[_0x4a00('0x36')]);}return _0x27cbe7;}function getQueueCampaignStatusMessage(_0x160b03,_0x167416){var _0x575ac2=CAMPAIGN_STATUS[_0x4a00('0x38')];var _0x13f4a9=isPreviewCampaign(_0x160b03);if(!isQueueCampaignActive(_0x160b03)){if(_0x13f4a9){_0x575ac2=CAMPAIGN_STATUS[_0x4a00('0x39')];}else{if(_0x160b03['originated']===0x0&&_0x160b03[_0x4a00('0x24')]===0x0&&_0x160b03['waiting']===0x0&&(_0x160b03['pTalking']||0x0)===0x0){_0x575ac2=CAMPAIGN_STATUS['INACTIVE'];}else{_0x575ac2=CAMPAIGN_STATUS[_0x4a00('0x3a')];}}}else if(_0x160b03[_0x4a00('0x21')]===0x0){_0x575ac2=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x160b03,_0x167416)){_0x575ac2=CAMPAIGN_STATUS[_0x4a00('0x3b')];}else if(!isPreviewCampaign(_0x160b03)){var _0x2f663e=checkAnyValidQueueCampaignInterval(_0x160b03);if(_0x2f663e){_0x575ac2=_0x2f663e;}}return _0x575ac2;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x596b57){var _0x1161c5=CAMPAIGN_STATUS['DISACTIVED'];if(_0x596b57[_0x4a00('0x28')]===0x0&&_0x596b57[_0x4a00('0x24')]===0x0&&_0x596b57['waiting']===0x0&&(_0x596b57[_0x4a00('0x25')]||0x0)===0x0){_0x1161c5=CAMPAIGN_STATUS[_0x4a00('0x39')];}return _0x1161c5;}exports[_0x4a00('0x3c')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x53244b){var _0xcc0192=_0x53244b[_0x4a00('0x3d')](/"(.*?)"/);return _0xcc0192?_0xcc0192[0x1]:_0x53244b;}exports[_0x4a00('0x3e')]=extractCalleridName;function getCallerId(_0x366d33,_0x306e86,_0x168906){if(!_['isUndefined'](_0x168906)&&typeof _0x168906===_0x4a00('0x3f')&&!_[_0x4a00('0x40')](_0x168906)){if(!_['isUndefined'](_0x306e86)&&typeof _0x306e86===_0x4a00('0x3f')&&!_[_0x4a00('0x40')](_0x306e86)){return util['format'](_0x4a00('0x41'),_0x306e86,_0x168906);}return util[_0x4a00('0x42')]('\x22%s\x22\x20<%s>',_0x168906,_0x168906);}if(!_[_0x4a00('0x43')](_0x366d33)&&typeof _0x366d33===_0x4a00('0x3f')&&!_[_0x4a00('0x40')](_0x366d33)){return _0x366d33;}return _0x4a00('0x44');}exports[_0x4a00('0x45')]=getCallerId;function getCallerIdRandom(_0xa4076b,_0x3a7e9e){var _0x5f4d97;var _0x357fcb;var _0x4f2468;if(_0x3a7e9e<=0x0){_0x3a7e9e=0x1;}_0x5f4d97=new RegExp(_0x4a00('0x46')+_0x3a7e9e+'}$');_0x357fcb=Math[_0x4a00('0x47')](0xa,_0x3a7e9e-0x1);_0x4f2468=Math[_0x4a00('0x47')](0xa,_0x3a7e9e)-0x1;return util[_0x4a00('0x42')]('%s',_[_0x4a00('0x48')](_0xa4076b,_0x5f4d97,_[_0x4a00('0x49')](_0x357fcb,_0x4f2468)[_0x4a00('0x4a')]()));}exports[_0x4a00('0x4b')]=getCallerIdRandom;function decrementOriginate(_0x9c6c0a){if(_0x9c6c0a[_0x4a00('0x28')]&&_0x9c6c0a[_0x4a00('0x28')]>0x0){_0x9c6c0a['originated']-=0x1;}else{logger['error'](_0x4a00('0x4c'));}}exports[_0x4a00('0x4d')]=decrementOriginate;function checkContactEmpty(_0x34ab32){return _0x34ab32&&_0x34ab32[_0x4a00('0x4e')]>0x0;}exports[_0x4a00('0x4f')]=checkContactEmpty;function erlangb(_0xdc82a7,_0x128e16){if(_0x128e16===0x0){return 0x0;}var _0x3bae75=0x1;for(var _0x8d21cd=0x1;_0x8d21cd<=_0x128e16;_0x8d21cd+=0x1){_0x3bae75=0x1+_0x3bae75*_0x8d21cd/_0xdc82a7;}return 0x1/_0x3bae75;}exports[_0x4a00('0x50')]=erlangb;function checkContactLowerLimitOriginate(_0x1b3ac0,_0xf05eed,_0x56ab10){if(_0xf05eed>_0x56ab10){for(var _0x4f3f45=0x0;_0x4f3f45<_0xf05eed-_0x56ab10;_0x4f3f45+=0x1){decrementOriginate(_0x1b3ac0);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x168668){var _0x1fbad2={};var _0x2468c8=['id',_0x4a00('0x51'),_0x4a00('0x52'),_0x4a00('0x53')];const _0x346a3d=0xfa;if(_0x168668){for(var _0xa826c6 in _0x168668){if(typeof _0x168668[_0xa826c6]!=='undefined'){if(!_['isNil'](_0x168668[_0xa826c6])&&!_0x2468c8[_0x4a00('0x35')](_0xa826c6)){if(_0xa826c6===_0x4a00('0x54')&&_0x168668[_0xa826c6]['length']>_0x346a3d){_0x1fbad2[_0x4a00('0x55')+_0xa826c6[_0x4a00('0x56')]()]=_0x168668[_0xa826c6][_0x4a00('0x4a')]()['substring'](0x0,_0x346a3d);}else{_0x1fbad2[_0x4a00('0x55')+_0xa826c6['toUpperCase']()]=_0x168668[_0xa826c6];}}}}}return _0x1fbad2;}exports[_0x4a00('0x57')]=setXMDContactVariables; \ No newline at end of file +var _0x282c=['isQueueCampaignActive','isIVRCampaignActive','milliseconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','dialGlobalInterval','isNil','Interval','NULL_INTERVAL','isEmpty','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','waiting','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','erlangb','checkContactLowerLimitOriginate','createdAt','updatedAt','undefined','length','XMD-','toUpperCase','substring','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','isIVRCampaign','type','outbound','isOutboundQueue','dialActive'];(function(_0x53a82e,_0x4be9d0){var _0x5394b5=function(_0x563b69){while(--_0x563b69){_0x53a82e['push'](_0x53a82e['shift']());}};_0x5394b5(++_0x4be9d0);}(_0x282c,0x96));var _0xc282=function(_0x112e0f,_0x282488){_0x112e0f=_0x112e0f-0x0;var _0x16a48b=_0x282c[_0x112e0f];return _0x16a48b;};'use strict';var _=require(_0xc282('0x0'));var moment=require(_0xc282('0x1'));var util=require(_0xc282('0x2'));var logger=require(_0xc282('0x3'))(_0xc282('0x4'));var timezones=require(_0xc282('0x5'))[_0xc282('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0xc282('0x7'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0xc282('0x8'),'DEACTIVATED':_0xc282('0x9'),'DISACTIVED':_0xc282('0xa'),'EMPTY_INTERVAL':_0xc282('0xb'),'INACTIVE':_0xc282('0xc'),'NO_AGENTS_LOGGED':_0xc282('0xd'),'NO_AVAILABLE_CONTACTS':_0xc282('0xe'),'NULL_INTERVAL':_0xc282('0xf'),'OVERTIME_INTERVAL':_0xc282('0x10'),'OVERTIME_GLOBAL_INTERVAL':_0xc282('0x11'),'QUEUE_RECALL':_0xc282('0x12'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0xc282('0x13'),'UNKNOWN_TIMEZONE':_0xc282('0x14'),'UNREACHABLE_TRUNK':_0xc282('0x15')};exports[_0xc282('0x16')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x4ebcf8){return _0x4ebcf8[_0xc282('0x17')]==='preview';}exports[_0xc282('0x18')]=isPreviewCampaign;function isIVRCampaign(_0x1065a5){return _0x1065a5['type']==='ivr';}exports[_0xc282('0x19')]=isIVRCampaign;function isOutboundQueue(_0x1d26ea){return _0x1d26ea[_0xc282('0x1a')]===_0xc282('0x1b');}exports[_0xc282('0x1c')]=isOutboundQueue;function isQueueCampaignActive(_0x531321){return _0x531321[_0xc282('0x1d')];}exports[_0xc282('0x1e')]=isQueueCampaignActive;function isIVRCampaignActive(_0x4534ba){return _0x4534ba['active'];}exports[_0xc282('0x1f')]=isIVRCampaignActive;function getSeconds(_0x3494f4,_0x57e23a){var _0x229390=moment(_0x3494f4)[_0xc282('0x20')](0x0);var _0x586a96=moment(_0x57e23a)['milliseconds'](0x0);return _0x229390['diff'](_0x586a96,'seconds');}exports[_0xc282('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0x52eb55,_0x46a0ec){var _0x7db182=![];var _0x148038=_0x52eb55[_0xc282('0x17')]!==_0x46a0ec[_0xc282('0x17')]||_0x52eb55[_0xc282('0x1d')]!==_0x46a0ec[_0xc282('0x1d')]||_0x52eb55[_0xc282('0x22')]!==_0x46a0ec[_0xc282('0x22')];var _0xeb23ba=_0x52eb55[_0xc282('0x23')]!==_0x46a0ec[_0xc282('0x23')]||_0x52eb55[_0xc282('0x24')]!==_0x46a0ec[_0xc282('0x24')]||_0x52eb55['loggedInDb']!==_0x46a0ec[_0xc282('0x25')]||_0x52eb55[_0xc282('0x26')]!==_0x46a0ec[_0xc282('0x26')]||_0x52eb55['talking']!==_0x46a0ec[_0xc282('0x27')]||_0x52eb55[_0xc282('0x28')]!==_0x46a0ec[_0xc282('0x28')]||_0x52eb55['waiting']!==_0x46a0ec['waiting']||_0x52eb55['inUse']!==_0x46a0ec['inUse']||_0x52eb55[_0xc282('0x29')]!==_0x46a0ec[_0xc282('0x29')];if(_0x52eb55['Trunk']&&_0x46a0ec[_0xc282('0x2a')]){_0x7db182=_0x52eb55['Trunk']['name']!==_0x46a0ec['Trunk'][_0xc282('0x2b')]||_0x52eb55[_0xc282('0x2a')][_0xc282('0x2c')]!==_0x46a0ec['Trunk'][_0xc282('0x2c')];}return _0x148038||_0xeb23ba||_0x7db182;}exports[_0xc282('0x2d')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x17e309){var _0x359375=null;var _0x36e172=_0x17e309[_0xc282('0x2e')];if(_['isNil'](_0x17e309[_0xc282('0x2f')])||_[_0xc282('0x30')](_0x17e309[_0xc282('0x31')])||_[_0xc282('0x30')](_0x17e309['Interval']['Intervals'])){_0x359375=CAMPAIGN_STATUS[_0xc282('0x32')];}else if(_[_0xc282('0x33')](_0x17e309[_0xc282('0x2f')])||_[_0xc282('0x33')](_0x17e309['Interval'][_0xc282('0x34')])){_0x359375=CAMPAIGN_STATUS[_0xc282('0x35')];}else if(_0x36e172&&!timezones[_0x36e172]){_0x359375=CAMPAIGN_STATUS[_0xc282('0x36')];}return _0x359375;}function checkAnyValidTrunk(_0x2d12f5,_0x8f2bc8){var _0x2d4393=null;var _0x20644a='SIP/';var _0x381d22=[_0xc282('0x37'),_0xc282('0x38')];var _0x5dae97=!![];if(_0x2d12f5[_0xc282('0x2a')]&&_0x2d12f5[_0xc282('0x2a')]['active']){_0x20644a+=_0x2d12f5[_0xc282('0x2a')]['name'];_0x2d4393=_0x8f2bc8[_0x20644a];_0x5dae97=_0x381d22[_0xc282('0x39')](_0x2d4393[_0xc282('0x3a')]);}else if(_0x2d12f5[_0xc282('0x3b')]&&_0x2d12f5[_0xc282('0x3b')][_0xc282('0x2c')]){_0x20644a+=_0x2d12f5['TrunkBackup'][_0xc282('0x2b')];_0x2d4393=_0x8f2bc8[_0x20644a];_0x5dae97=_0x381d22['includes'](_0x2d4393[_0xc282('0x3a')]);}return _0x5dae97;}function getQueueCampaignStatusMessage(_0x40038c,_0x5c4c7e){var _0xe46ef0=CAMPAIGN_STATUS[_0xc282('0x7')];var _0x4f8904=isPreviewCampaign(_0x40038c);if(!isQueueCampaignActive(_0x40038c)){if(_0x4f8904){_0xe46ef0=CAMPAIGN_STATUS[_0xc282('0x3c')];}else{if(_0x40038c[_0xc282('0x29')]===0x0&&_0x40038c['talking']===0x0&&_0x40038c[_0xc282('0x3d')]===0x0&&(_0x40038c['pTalking']||0x0)===0x0){_0xe46ef0=CAMPAIGN_STATUS['INACTIVE'];}else{_0xe46ef0=CAMPAIGN_STATUS[_0xc282('0x3e')];}}}else if(_0x40038c[_0xc282('0x24')]===0x0){_0xe46ef0=CAMPAIGN_STATUS[_0xc282('0x3f')];}else if(!checkAnyValidTrunk(_0x40038c,_0x5c4c7e)){_0xe46ef0=CAMPAIGN_STATUS[_0xc282('0x40')];}else if(!isPreviewCampaign(_0x40038c)){var _0x5b241d=checkAnyValidQueueCampaignInterval(_0x40038c);if(_0x5b241d){_0xe46ef0=_0x5b241d;}}return _0xe46ef0;}exports[_0xc282('0x41')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x35a5fa){var _0x93ccf7=CAMPAIGN_STATUS[_0xc282('0x3e')];if(_0x35a5fa[_0xc282('0x29')]===0x0&&_0x35a5fa['talking']===0x0&&_0x35a5fa[_0xc282('0x3d')]===0x0&&(_0x35a5fa[_0xc282('0x28')]||0x0)===0x0){_0x93ccf7=CAMPAIGN_STATUS[_0xc282('0x3c')];}return _0x93ccf7;}exports[_0xc282('0x42')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x92f11){var _0x5c07f9=_0x92f11['match'](/"(.*?)"/);return _0x5c07f9?_0x5c07f9[0x1]:_0x92f11;}exports[_0xc282('0x43')]=extractCalleridName;function getCallerId(_0xddfc48,_0x303efa,_0x141568){if(!_[_0xc282('0x44')](_0x141568)&&typeof _0x141568===_0xc282('0x45')&&!_[_0xc282('0x33')](_0x141568)){if(!_[_0xc282('0x44')](_0x303efa)&&typeof _0x303efa===_0xc282('0x45')&&!_[_0xc282('0x33')](_0x303efa)){return util[_0xc282('0x46')]('\x22%s\x22\x20<%s>',_0x303efa,_0x141568);}return util[_0xc282('0x46')](_0xc282('0x47'),_0x141568,_0x141568);}if(!_['isUndefined'](_0xddfc48)&&typeof _0xddfc48==='string'&&!_[_0xc282('0x33')](_0xddfc48)){return _0xddfc48;}return'\x22\x22\x20<>';}exports[_0xc282('0x48')]=getCallerId;function getCallerIdRandom(_0xd343d4,_0x21dc45){var _0x27a305;var _0x468806;var _0x2a9f68;if(_0x21dc45<=0x0){_0x21dc45=0x1;}_0x27a305=new RegExp(_0xc282('0x49')+_0x21dc45+'}$');_0x468806=Math[_0xc282('0x4a')](0xa,_0x21dc45-0x1);_0x2a9f68=Math[_0xc282('0x4a')](0xa,_0x21dc45)-0x1;return util[_0xc282('0x46')]('%s',_[_0xc282('0x4b')](_0xd343d4,_0x27a305,_['random'](_0x468806,_0x2a9f68)[_0xc282('0x4c')]()));}exports[_0xc282('0x4d')]=getCallerIdRandom;function decrementOriginate(_0xe9b634){if(_0xe9b634[_0xc282('0x29')]&&_0xe9b634[_0xc282('0x29')]>0x0){_0xe9b634[_0xc282('0x29')]-=0x1;}else{logger[_0xc282('0x4e')](_0xc282('0x4f'));}}exports[_0xc282('0x50')]=decrementOriginate;function checkContactEmpty(_0x108d10){return _0x108d10&&_0x108d10['length']>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x15c4c2,_0x347c88){if(_0x347c88===0x0){return 0x0;}var _0x29dbd9=0x1;for(var _0x50e33d=0x1;_0x50e33d<=_0x347c88;_0x50e33d+=0x1){_0x29dbd9=0x1+_0x29dbd9*_0x50e33d/_0x15c4c2;}return 0x1/_0x29dbd9;}exports[_0xc282('0x51')]=erlangb;function checkContactLowerLimitOriginate(_0x547024,_0x117392,_0x3e077e){if(_0x117392>_0x3e077e){for(var _0x5cecf6=0x0;_0x5cecf6<_0x117392-_0x3e077e;_0x5cecf6+=0x1){decrementOriginate(_0x547024);}}}exports[_0xc282('0x52')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x2e9be9){var _0x309f2={};var _0x4f95bd=['id',_0xc282('0x53'),'tags',_0xc282('0x54')];const _0x5d3ddc=0xfa;if(_0x2e9be9){for(var _0x44ba5a in _0x2e9be9){if(typeof _0x2e9be9[_0x44ba5a]!==_0xc282('0x55')){if(!_[_0xc282('0x30')](_0x2e9be9[_0x44ba5a])&&!_0x4f95bd[_0xc282('0x39')](_0x44ba5a)){if(_0x44ba5a==='description'&&_0x2e9be9[_0x44ba5a][_0xc282('0x56')]>_0x5d3ddc){_0x309f2[_0xc282('0x57')+_0x44ba5a[_0xc282('0x58')]()]=_0x2e9be9[_0x44ba5a]['toString']()[_0xc282('0x59')](0x0,_0x5d3ddc);}else{_0x309f2[_0xc282('0x57')+_0x44ba5a[_0xc282('0x58')]()]=_0x2e9be9[_0x44ba5a];}}}}}return _0x309f2;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 465d2b1..2a6bfac 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(_0x55891a,_0x49cdf2){var _0x49f23e=function(_0x183575){while(--_0x183575){_0x55891a['push'](_0x55891a['shift']());}};_0x49f23e(++_0x49cdf2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x15b431,_0x1c183a){var _0xbee29e=function(_0x1c10ea){while(--_0x1c10ea){_0x15b431['push'](_0x15b431['shift']());}};_0xbee29e(++_0x1c183a);}(_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 7ec6987..75c38b2 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 _0x3cae=['[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','../rpc/faxMessage','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','context','from-voip-provider','localstationid','uniqueid','channels','channel','name','info','actions','\x20syncNewchannel\x20','prototype','syncVarSet','variable','hasOwnProperty','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','\x20syncFaxStatus\x20','pagestransferred','resolution','transferrate','filename','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','path','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable'];(function(_0x3480f2,_0x4947fa){var _0x1e4899=function(_0x4a884f){while(--_0x4a884f){_0x3480f2['push'](_0x3480f2['shift']());}};_0x1e4899(++_0x4947fa);}(_0x3cae,0x172));var _0xe3ca=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x3cae[_0x43b08];return _0x5e05f4;};'use strict';var util=require('util');var _=require(_0xe3ca('0x0'));var BPromise=require('bluebird');var uuid=require(_0xe3ca('0x1'));var moment=require(_0xe3ca('0x2'));var path=require('path');var tiff2pdf=require(_0xe3ca('0x3'));var gs=require(_0xe3ca('0x4'));var logger=require(_0xe3ca('0x5'))('fax');var ami=require(_0xe3ca('0x6'));var rpcDb=require('./rpcDb');var Channel=require(_0xe3ca('0x7'));var ut=require(_0xe3ca('0x8'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0xe3ca('0x9'));function Fax(_0x4f531f){this['channels']={};this[_0xe3ca('0xa')]=_0x4f531f['faxAccounts'];this[_0xe3ca('0xb')]=_0x4f531f['trunks'];this['actions']={};ami['on'](_0xe3ca('0xc'),this[_0xe3ca('0xd')][_0xe3ca('0xe')](this));ami['on'](_0xe3ca('0xf'),this['syncVarSet'][_0xe3ca('0xe')](this));ami['on'](_0xe3ca('0x10'),this[_0xe3ca('0x11')][_0xe3ca('0xe')](this));ami['on'](_0xe3ca('0x12'),this[_0xe3ca('0x13')][_0xe3ca('0xe')](this));ami['on'](_0xe3ca('0x14'),this['syncFaxStatus']['bind'](this));ami['on'](_0xe3ca('0x15'),this[_0xe3ca('0x16')][_0xe3ca('0xe')](this));ami['on'](_0xe3ca('0x17'),this[_0xe3ca('0x18')]['bind'](this));ami['on']('originateresponse',this[_0xe3ca('0x19')]['bind'](this));}Fax['prototype']['syncNewchannel']=function(_0x1a4c60){if(_0x1a4c60[_0xe3ca('0x1a')]===_0xe3ca('0x1b')){for(var _0x22e605 in this[_0xe3ca('0xa')]){if(this[_0xe3ca('0xa')]['hasOwnProperty'](_0x22e605)){if(_0x1a4c60['exten']===this[_0xe3ca('0xa')][_0x22e605][_0xe3ca('0x1c')]){this['channels'][_0x1a4c60[_0xe3ca('0x1d')]]={};this[_0xe3ca('0x1e')][_0x1a4c60[_0xe3ca('0x1d')]][_0xe3ca('0x1f')]=_0x1a4c60['channel'];this['channels'][_0x1a4c60[_0xe3ca('0x1d')]]['id']=this['faxAccounts'][_0x22e605]['id'];this[_0xe3ca('0x1e')][_0x1a4c60[_0xe3ca('0x1d')]][_0xe3ca('0x20')]=this[_0xe3ca('0xa')][_0x22e605][_0xe3ca('0x20')];logger[_0xe3ca('0x21')](_0x1a4c60[_0xe3ca('0x1d')],'\x20syncNewchannel\x20');}}}}if(this[_0xe3ca('0x22')][_0x1a4c60[_0xe3ca('0x1d')]]){this[_0xe3ca('0x1e')][_0x1a4c60[_0xe3ca('0x1d')]]={};this[_0xe3ca('0x1e')][_0x1a4c60[_0xe3ca('0x1d')]][_0xe3ca('0x1f')]=_0x1a4c60[_0xe3ca('0x1f')];logger['info'](_0x1a4c60['uniqueid'],_0xe3ca('0x23'));}};Fax[_0xe3ca('0x24')][_0xe3ca('0x25')]=function(_0x419c8a){if(this[_0xe3ca('0x1e')][_0x419c8a[_0xe3ca('0x1d')]]){for(var _0x28c4ae in _0x419c8a[_0xe3ca('0x26')]){if(_0x419c8a[_0xe3ca('0x26')][_0xe3ca('0x27')](_0x28c4ae)){this[_0xe3ca('0x1e')][_0x419c8a[_0xe3ca('0x1d')]][_0x28c4ae]=_0x419c8a[_0xe3ca('0x28')];}}}};Fax[_0xe3ca('0x24')]['syncNewState']=function(_0x319b58){if(this[_0xe3ca('0x1e')][_0x319b58['uniqueid']]){this[_0xe3ca('0x1e')][_0x319b58[_0xe3ca('0x1d')]][_0xe3ca('0x29')]=_0x319b58[_0xe3ca('0x29')];this[_0xe3ca('0x1e')][_0x319b58['uniqueid']][_0xe3ca('0x2a')]=_0x319b58[_0xe3ca('0x2a')];}};Fax[_0xe3ca('0x24')]['syncNewExten']=function(_0x2b7aa8){if(this['channels'][_0x2b7aa8[_0xe3ca('0x1d')]]){for(var _0x1bf8b5 in _0x2b7aa8[_0xe3ca('0x26')]){if(_0x2b7aa8['variable'][_0xe3ca('0x27')](_0x1bf8b5)){this['channels'][_0x2b7aa8['uniqueid']][_0x1bf8b5]=_0x2b7aa8[_0xe3ca('0x28')];}}}};Fax['prototype'][_0xe3ca('0x2b')]=function(_0x334f41){if(this['channels'][_0x334f41['uniqueid']]){this[_0xe3ca('0x1e')][_0x334f41['uniqueid']][_0xe3ca('0x2c')]=_0x334f41[_0xe3ca('0x2c')];this['channels'][_0x334f41[_0xe3ca('0x1d')]][_0xe3ca('0x2d')]=_0x334f41[_0xe3ca('0x2d')];this['channels'][_0x334f41[_0xe3ca('0x1d')]]['localstationid']=_0x334f41[_0xe3ca('0x1c')];this[_0xe3ca('0x1e')][_0x334f41[_0xe3ca('0x1d')]]['filename']=_0x334f41['filename'];logger['info'](_0x334f41[_0xe3ca('0x1d')],_0xe3ca('0x2e'));}};Fax[_0xe3ca('0x24')]['syncReceiveFax']=function(_0x3a9a5a){var _0x214e6d=this;if(this['channels'][_0x3a9a5a[_0xe3ca('0x1d')]]){var _0x3db100=this['channels'][_0x3a9a5a['uniqueid']]['id'];this[_0xe3ca('0x1e')][_0x3a9a5a[_0xe3ca('0x1d')]]['remotestationid']=_0x3a9a5a['remotestationid'];this[_0xe3ca('0x1e')][_0x3a9a5a[_0xe3ca('0x1d')]][_0xe3ca('0x2f')]=_0x3a9a5a[_0xe3ca('0x2f')];this[_0xe3ca('0x1e')][_0x3a9a5a['uniqueid']]['localstationid']=_0x3a9a5a[_0xe3ca('0x1c')];this[_0xe3ca('0x1e')][_0x3a9a5a[_0xe3ca('0x1d')]][_0xe3ca('0x30')]=_0x3a9a5a['resolution'];this[_0xe3ca('0x1e')][_0x3a9a5a[_0xe3ca('0x1d')]][_0xe3ca('0x31')]=_0x3a9a5a['transferrate'];this[_0xe3ca('0x1e')][_0x3a9a5a[_0xe3ca('0x1d')]][_0xe3ca('0x32')]=_0x3a9a5a[_0xe3ca('0x32')];this[_0xe3ca('0x1e')][_0x3a9a5a[_0xe3ca('0x1d')]]['calleridnum']=_0x3a9a5a[_0xe3ca('0x33')];if(this[_0xe3ca('0x1e')][_0x3a9a5a['uniqueid']][_0xe3ca('0x2f')]>0x0){tiff2pdf(_0x3a9a5a['filename'],_0xe3ca('0x34'),function(_0x622a51){logger[_0xe3ca('0x21')](_0x3a9a5a[_0xe3ca('0x1d')],_0xe3ca('0x35'),_0x622a51['message']);attachment[_0xe3ca('0x36')]({'name':path['parse'](_0x3a9a5a['filename'])[_0xe3ca('0x20')],'basename':path[_0xe3ca('0x37')](_0x3a9a5a[_0xe3ca('0x32')])[_0xe3ca('0x20')]+_0xe3ca('0x38'),'type':_0xe3ca('0x39')})[_0xe3ca('0x3a')](function(_0x5a63b8){faxAccount[_0xe3ca('0x3b')](_0x3db100,{'from':_0x3a9a5a['calleridnum'],'mapKey':_0xe3ca('0x3c'),'body':path[_0xe3ca('0x37')](_0x3a9a5a[_0xe3ca('0x32')])[_0xe3ca('0x20')]+_0xe3ca('0x38'),'AttachmentId':_0x5a63b8['id']})[_0xe3ca('0x3d')](function(_0x1d219d){logger[_0xe3ca('0x3e')](_0x3a9a5a[_0xe3ca('0x1d')],_0xe3ca('0x3f'),JSON[_0xe3ca('0x40')](_0x1d219d));});})[_0xe3ca('0x3d')](function(_0xbc091d){logger[_0xe3ca('0x3e')](_0x3a9a5a[_0xe3ca('0x1d')],'\x20receiveFax\x20',JSON[_0xe3ca('0x40')](_0xbc091d));});});}logger['info'](_0x3a9a5a[_0xe3ca('0x1d')],_0xe3ca('0x41'));}};Fax[_0xe3ca('0x24')]['syncOriginateResponse']=function(_0x9bb8b){if(this['actions'][_0x9bb8b[_0xe3ca('0x1d')]]){_['merge'](this[_0xe3ca('0x1e')][_0x9bb8b['uniqueid']],_[_0xe3ca('0x42')](_0x9bb8b,[_0xe3ca('0x43'),_0xe3ca('0x44')]));}};function updateStatus(_0x137165){if(_0x137165[_0xe3ca('0x45')]){faxMessage[_0xe3ca('0x46')](_0x137165[_0xe3ca('0x45')],{'failMessage':_0xe3ca('0x47')})[_0xe3ca('0x3a')](function(_0x34fe20){ut[_0xe3ca('0x48')](_0xe3ca('0x49'),_0x34fe20);})[_0xe3ca('0x3d')](function(_0x1cead4){ut[_0xe3ca('0x48')](_0xe3ca('0x4a'),_0x1cead4);});}else{ut['logger'](_0xe3ca('0x4b'));}}Fax[_0xe3ca('0x24')][_0xe3ca('0x4c')]=function(_0x49fda7,_0x551190,_0x192644){var _0x3af1ab=this;var _0x36f5fc={};if(_0x551190){_0x36f5fc={'read':_0x551190};}else{_0x36f5fc={'failMessage':_0x192644};}if(this[_0xe3ca('0x22')][_0x49fda7]['AttachmentId']){faxMessage['update'](this['actions'][_0x49fda7][_0xe3ca('0x45')],_0x36f5fc)[_0xe3ca('0x3a')](function(_0x3cd576){ut[_0xe3ca('0x48')](_0xe3ca('0x4d'),_0x3cd576);})['catch'](function(_0x493bd2){ut[_0xe3ca('0x48')](_0xe3ca('0x4e'),_0x493bd2);})[_0xe3ca('0x4f')](function(){delete _0x3af1ab[_0xe3ca('0x1e')][_0x49fda7];delete _0x3af1ab[_0xe3ca('0x22')][_0x49fda7];});}else{ut['logger'](_0xe3ca('0x50'));delete this[_0xe3ca('0x1e')][_0x49fda7];delete this[_0xe3ca('0x22')][_0x49fda7];}};Fax[_0xe3ca('0x24')][_0xe3ca('0x18')]=function(_0x5576e2){var _0x1eedce=this;if(this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]]){if(this['actions'][_0x5576e2[_0xe3ca('0x1d')]]){this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]]['id']=this['actions'][_0x5576e2[_0xe3ca('0x1d')]]['id'];this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]][_0xe3ca('0x20')]=this['actions'][_0x5576e2['uniqueid']][_0xe3ca('0x20')];}logger['info'](_0x5576e2[_0xe3ca('0x1d')],this['actions'][_0x5576e2[_0xe3ca('0x1d')]]?'\x20hangup\x20sendFile\x20':_0xe3ca('0x51'),JSON[_0xe3ca('0x40')](this['channels'][_0x5576e2['uniqueid']]));if(this['actions'][_0x5576e2['uniqueid']]){if(this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]][_0xe3ca('0x52')]>0x0&&this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]][_0xe3ca('0x14')]===_0xe3ca('0x53')){this['updateStatus'](_0x5576e2[_0xe3ca('0x1d')],!![]);}else{this['updateStatus'](_0x5576e2[_0xe3ca('0x1d')],![],this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]]['faxstatusstring']?_0xe3ca('0x54')+this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]][_0xe3ca('0x55')]:_0xe3ca('0x56'));}}}};Fax[_0xe3ca('0x24')][_0xe3ca('0x57')]=function(_0x3caba2){var _0xf427d9=this;return new BPromise(function(_0x22a972,_0x53d79f){_0xf427d9[_0xe3ca('0x58')](_0x3caba2,_0xf427d9[_0xe3ca('0xa')][_0x3caba2[_0xe3ca('0x59')]])['then'](function(_0x1d493d){ut[_0xe3ca('0x48')](_0xe3ca('0x5a'),_0x1d493d);_0x22a972(ut[_0xe3ca('0x5b')](_0xe3ca('0x5c')));})[_0xe3ca('0x3d')](function(_0x4dcea3){ut[_0xe3ca('0x48')](_0xe3ca('0x5d'),_0x4dcea3);updateStatus(_0x3caba2);_0x53d79f(ut[_0xe3ca('0x5b')]('Fax\x20failed'));});});};Fax[_0xe3ca('0x24')][_0xe3ca('0x5e')]=function(_0xe93fe0){var _0x1af8b9=this;return new BPromise(function(_0x5dbe9a,_0x2afc79){var _0x37d7ac=_0x1af8b9[_0xe3ca('0x5f')](_0x1af8b9[_0xe3ca('0xa')][_0xe93fe0[_0xe3ca('0x59')]][_0xe3ca('0x60')],_0xe93fe0);if(_0x37d7ac[_0xe3ca('0x61')]){_0x5dbe9a(ut[_0xe3ca('0x5b')](_0xe3ca('0x62')));}else{_0x2afc79(ut[_0xe3ca('0x5b')](_0x37d7ac[_0xe3ca('0x5b')]));}});};function originate(_0x371d09,_0x1e4677,_0xc3409){return new BPromise(function(_0x15c2bc,_0x1e56ed){if(_0xc3409){var _0x19c4a6=util[_0xe3ca('0x63')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xe3ca('0x37')](_0x371d09['path'])[_0xe3ca('0x20')],_0x371d09[_0xe3ca('0x64')]);gs[_0xe3ca('0x65')](_0x19c4a6)['then'](function(){_0x371d09['path']=util[_0xe3ca('0x63')](_0xe3ca('0x66'),path[_0xe3ca('0x37')](_0x371d09[_0xe3ca('0x64')])['dir'],path[_0xe3ca('0x37')](_0x371d09['path'])[_0xe3ca('0x20')]);_0x1e4677[_0xe3ca('0x67')]=_0x371d09[_0xe3ca('0x64')];ut[_0xe3ca('0x48')](_0xe3ca('0x68'),'');ami[_0xe3ca('0x69')](ut[_0xe3ca('0x6a')](_0x371d09,_0x1e4677))[_0xe3ca('0x3a')](function(_0x58df5a){_0x15c2bc(_0x58df5a);})[_0xe3ca('0x3d')](function(_0x22d5c7){_0x1e56ed(_0x22d5c7);});})[_0xe3ca('0x3d')](function(_0x537f8a){_0x1e56ed(_0x537f8a);});}else{ami[_0xe3ca('0x69')](ut['variablesAction'](_0x371d09,_0x1e4677))[_0xe3ca('0x3a')](function(_0x4efaa5){_0x15c2bc(_0x4efaa5);})[_0xe3ca('0x3d')](function(_0x3b56e3){_0x1e56ed(_0x3b56e3);});}});}Fax[_0xe3ca('0x24')][_0xe3ca('0x58')]=function(_0x4c9db7,_0x32ad35){var _0x31dcdc=this;return new BPromise(function(_0x27459b,_0x3ff2c1){var _0x3df7f1=uuid['v4']();var _0x4a6edc=ut[_0xe3ca('0x6b')](_0x4c9db7,_0x32ad35);_0x31dcdc[_0xe3ca('0x22')][_0x3df7f1]=new Action(_0x3df7f1,_0x32ad35,_0x4c9db7);var _0x260f69=_0x31dcdc['actions'][_0x3df7f1];if(path[_0xe3ca('0x37')](_0x4c9db7['path'])[_0xe3ca('0x6c')]==='.pdf'){originate(_0x260f69,_0x4a6edc,!![])[_0xe3ca('0x3a')](function(_0x517639){_0x27459b(_0x517639);})[_0xe3ca('0x3d')](function(_0x484a84){_0x3ff2c1(_0x484a84);});}else{originate(_0x260f69,_0x4a6edc,![])[_0xe3ca('0x3a')](function(_0x12b07c){_0x27459b(_0x12b07c);})['catch'](function(_0x2ad7d8){_0x3ff2c1(_0x2ad7d8);});}});};Fax[_0xe3ca('0x24')][_0xe3ca('0x6d')]=function(_0x231ad1){return!_[_0xe3ca('0x6e')](_0x231ad1)&&!_['isNil'](_0x231ad1[_0xe3ca('0x20')])&&!_[_0xe3ca('0x6e')](_0x231ad1[_0xe3ca('0x6f')])&&_0x231ad1['active']&&!_[_0xe3ca('0x6e')](this['trunks'][util['format'](_0xe3ca('0x70'),_0x231ad1[_0xe3ca('0x20')])])&&!_['isNil'](this[_0xe3ca('0xb')][util[_0xe3ca('0x63')]('SIP/%s',_0x231ad1[_0xe3ca('0x20')])]['status'])&&(this[_0xe3ca('0xb')][util['format'](_0xe3ca('0x70'),_0x231ad1['name'])][_0xe3ca('0x2d')]===_0xe3ca('0x71')||this[_0xe3ca('0xb')][util['format']('SIP/%s',_0x231ad1[_0xe3ca('0x20')])][_0xe3ca('0x2d')]==='unmonitored');};Fax['prototype'][_0xe3ca('0x5f')]=function(_0x2fabdc,_0x5d76a4){if(!this[_0xe3ca('0x6d')](_0x2fabdc)){ut[_0xe3ca('0x48')](_0xe3ca('0x72'),_[_0xe3ca('0x6e')](_0x2fabdc)?'':_0x2fabdc[_0xe3ca('0x20')]+_0xe3ca('0x73'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0x5d76a4[_0xe3ca('0x3c')])){ut['logger'](_0xe3ca('0x74'),JSON[_0xe3ca('0x40')](_0x5d76a4));return{'isValid':![],'message':_0xe3ca('0x75')};}if(_[_0xe3ca('0x6e')](_0x5d76a4[_0xe3ca('0x64')])){ut[_0xe3ca('0x48')](_0xe3ca('0x76'),JSON['stringify'](_0x5d76a4));return{'isValid':![],'message':_0xe3ca('0x77')};}return{'isValid':!![],'message':_0xe3ca('0x78')};};module['exports']=Fax; \ No newline at end of file +var _0x6258=['\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','trunks','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','uuid','moment','path','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','actions','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','channel','uniqueid','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','message','create','application/pdf','then','parse','.pdf','\x20notify\x20','catch','error','\x20receiveFax\x20','stringify','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]'];(function(_0x212e83,_0x747a29){var _0x416df8=function(_0x274c0c){while(--_0x274c0c){_0x212e83['push'](_0x212e83['shift']());}};_0x416df8(++_0x747a29);}(_0x6258,0x1f2));var _0x8625=function(_0x21bb4d,_0x166018){_0x21bb4d=_0x21bb4d-0x0;var _0x14fd8e=_0x6258[_0x21bb4d];return _0x14fd8e;};'use strict';var util=require(_0x8625('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x8625('0x1'));var moment=require(_0x8625('0x2'));var path=require(_0x8625('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x8625('0x4'))(_0x8625('0x5'));var ami=require(_0x8625('0x6'));var rpcDb=require('./rpcDb');var Channel=require(_0x8625('0x7'));var ut=require(_0x8625('0x8'));var Action=require(_0x8625('0x9'));var faxAccount=require(_0x8625('0xa'));var attachment=require(_0x8625('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0xaf8a0a){this[_0x8625('0xc')]={};this[_0x8625('0xd')]=_0xaf8a0a['faxAccounts'];this['trunks']=_0xaf8a0a['trunks'];this[_0x8625('0xe')]={};ami['on']('newchannel',this[_0x8625('0xf')][_0x8625('0x10')](this));ami['on'](_0x8625('0x11'),this[_0x8625('0x12')][_0x8625('0x10')](this));ami['on']('newstate',this[_0x8625('0x13')][_0x8625('0x10')](this));ami['on'](_0x8625('0x14'),this[_0x8625('0x15')]['bind'](this));ami['on'](_0x8625('0x16'),this[_0x8625('0x17')]['bind'](this));ami['on']('receivefax',this[_0x8625('0x18')][_0x8625('0x10')](this));ami['on']('hangup',this[_0x8625('0x19')]['bind'](this));ami['on'](_0x8625('0x1a'),this[_0x8625('0x1b')][_0x8625('0x10')](this));}Fax[_0x8625('0x1c')][_0x8625('0xf')]=function(_0x2e7da6){if(_0x2e7da6[_0x8625('0x1d')]==='from-voip-provider'){for(var _0xc0cdf3 in this[_0x8625('0xd')]){if(this['faxAccounts'][_0x8625('0x1e')](_0xc0cdf3)){if(_0x2e7da6[_0x8625('0x1f')]===this[_0x8625('0xd')][_0xc0cdf3][_0x8625('0x20')]){this[_0x8625('0xc')][_0x2e7da6['uniqueid']]={};this['channels'][_0x2e7da6['uniqueid']][_0x8625('0x21')]=_0x2e7da6[_0x8625('0x21')];this[_0x8625('0xc')][_0x2e7da6[_0x8625('0x22')]]['id']=this[_0x8625('0xd')][_0xc0cdf3]['id'];this[_0x8625('0xc')][_0x2e7da6[_0x8625('0x22')]][_0x8625('0x23')]=this[_0x8625('0xd')][_0xc0cdf3]['name'];logger[_0x8625('0x24')](_0x2e7da6[_0x8625('0x22')],_0x8625('0x25'));}}}}if(this[_0x8625('0xe')][_0x2e7da6[_0x8625('0x22')]]){this['channels'][_0x2e7da6['uniqueid']]={};this[_0x8625('0xc')][_0x2e7da6[_0x8625('0x22')]][_0x8625('0x21')]=_0x2e7da6[_0x8625('0x21')];logger[_0x8625('0x24')](_0x2e7da6['uniqueid'],_0x8625('0x25'));}};Fax['prototype']['syncVarSet']=function(_0x2714f7){if(this[_0x8625('0xc')][_0x2714f7['uniqueid']]){for(var _0x5ecd93 in _0x2714f7[_0x8625('0x26')]){if(_0x2714f7[_0x8625('0x26')]['hasOwnProperty'](_0x5ecd93)){this[_0x8625('0xc')][_0x2714f7['uniqueid']][_0x5ecd93]=_0x2714f7[_0x8625('0x27')];}}}};Fax[_0x8625('0x1c')][_0x8625('0x13')]=function(_0x50eb49){if(this[_0x8625('0xc')][_0x50eb49['uniqueid']]){this[_0x8625('0xc')][_0x50eb49['uniqueid']][_0x8625('0x28')]=_0x50eb49[_0x8625('0x28')];this['channels'][_0x50eb49[_0x8625('0x22')]]['channelstatedesc']=_0x50eb49[_0x8625('0x29')];}};Fax[_0x8625('0x1c')]['syncNewExten']=function(_0x5c5243){if(this[_0x8625('0xc')][_0x5c5243[_0x8625('0x22')]]){for(var _0x1e35ef in _0x5c5243[_0x8625('0x26')]){if(_0x5c5243[_0x8625('0x26')][_0x8625('0x1e')](_0x1e35ef)){this[_0x8625('0xc')][_0x5c5243['uniqueid']][_0x1e35ef]=_0x5c5243['value'];}}}};Fax['prototype'][_0x8625('0x17')]=function(_0x55ed57){if(this[_0x8625('0xc')][_0x55ed57['uniqueid']]){this[_0x8625('0xc')][_0x55ed57[_0x8625('0x22')]][_0x8625('0x2a')]=_0x55ed57['operation'];this[_0x8625('0xc')][_0x55ed57[_0x8625('0x22')]]['status']=_0x55ed57[_0x8625('0x2b')];this['channels'][_0x55ed57[_0x8625('0x22')]][_0x8625('0x20')]=_0x55ed57[_0x8625('0x20')];this['channels'][_0x55ed57[_0x8625('0x22')]][_0x8625('0x2c')]=_0x55ed57[_0x8625('0x2c')];logger[_0x8625('0x24')](_0x55ed57[_0x8625('0x22')],_0x8625('0x2d'));}};Fax[_0x8625('0x1c')][_0x8625('0x18')]=function(_0x589262){var _0x4f4169=this;if(this[_0x8625('0xc')][_0x589262['uniqueid']]){var _0x116fe0=this[_0x8625('0xc')][_0x589262[_0x8625('0x22')]]['id'];this[_0x8625('0xc')][_0x589262[_0x8625('0x22')]]['remotestationid']=_0x589262[_0x8625('0x2e')];this[_0x8625('0xc')][_0x589262['uniqueid']]['pagestransferred']=_0x589262['pagestransferred'];this[_0x8625('0xc')][_0x589262['uniqueid']][_0x8625('0x20')]=_0x589262[_0x8625('0x20')];this[_0x8625('0xc')][_0x589262['uniqueid']][_0x8625('0x2f')]=_0x589262[_0x8625('0x2f')];this[_0x8625('0xc')][_0x589262[_0x8625('0x22')]][_0x8625('0x30')]=_0x589262[_0x8625('0x30')];this[_0x8625('0xc')][_0x589262[_0x8625('0x22')]][_0x8625('0x2c')]=_0x589262[_0x8625('0x2c')];this[_0x8625('0xc')][_0x589262[_0x8625('0x22')]][_0x8625('0x31')]=_0x589262[_0x8625('0x31')];if(this['channels'][_0x589262[_0x8625('0x22')]][_0x8625('0x32')]>0x0){tiff2pdf(_0x589262[_0x8625('0x2c')],_0x8625('0x33'),function(_0x4bc505){logger[_0x8625('0x24')](_0x589262['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x4bc505[_0x8625('0x34')]);attachment[_0x8625('0x35')]({'name':path['parse'](_0x589262[_0x8625('0x2c')])[_0x8625('0x23')],'basename':path['parse'](_0x589262['filename'])['name']+'.pdf','type':_0x8625('0x36')})[_0x8625('0x37')](function(_0x47ead1){faxAccount['notify'](_0x116fe0,{'from':_0x589262[_0x8625('0x31')],'mapKey':'fax','body':path[_0x8625('0x38')](_0x589262[_0x8625('0x2c')])[_0x8625('0x23')]+_0x8625('0x39'),'AttachmentId':_0x47ead1['id']})['catch'](function(_0x3e9953){logger['error'](_0x589262[_0x8625('0x22')],_0x8625('0x3a'),JSON['stringify'](_0x3e9953));});})[_0x8625('0x3b')](function(_0x5d4c06){logger[_0x8625('0x3c')](_0x589262[_0x8625('0x22')],_0x8625('0x3d'),JSON[_0x8625('0x3e')](_0x5d4c06));});});}logger[_0x8625('0x24')](_0x589262[_0x8625('0x22')],'\x20receiveFax\x20');}};Fax[_0x8625('0x1c')][_0x8625('0x1b')]=function(_0x4e3ac3){if(this[_0x8625('0xe')][_0x4e3ac3[_0x8625('0x22')]]){_['merge'](this[_0x8625('0xc')][_0x4e3ac3[_0x8625('0x22')]],_[_0x8625('0x3f')](_0x4e3ac3,[_0x8625('0x40'),_0x8625('0x41')]));}};function updateStatus(_0x25b3f7){if(_0x25b3f7['AttachmentId']){faxMessage[_0x8625('0x42')](_0x25b3f7[_0x8625('0x43')],{'failMessage':_0x8625('0x44')})['then'](function(_0xb8552d){ut[_0x8625('0x45')](_0x8625('0x46'),_0xb8552d);})[_0x8625('0x3b')](function(_0x38e0d9){ut[_0x8625('0x45')]('[Fax][Message][Error][NoUpdate1]',_0x38e0d9);});}else{ut[_0x8625('0x45')](_0x8625('0x47'));}}Fax[_0x8625('0x1c')][_0x8625('0x48')]=function(_0x2b06f7,_0x95e22e,_0x4e560a){var _0x16ca2e=this;var _0x1d0ce4={};if(_0x95e22e){_0x1d0ce4={'read':_0x95e22e};}else{_0x1d0ce4={'failMessage':_0x4e560a};}if(this[_0x8625('0xe')][_0x2b06f7][_0x8625('0x43')]){faxMessage[_0x8625('0x42')](this[_0x8625('0xe')][_0x2b06f7][_0x8625('0x43')],_0x1d0ce4)[_0x8625('0x37')](function(_0x2a4c8f){ut[_0x8625('0x45')](_0x8625('0x49'),_0x2a4c8f);})[_0x8625('0x3b')](function(_0x9b7068){ut[_0x8625('0x45')](_0x8625('0x4a'),_0x9b7068);})[_0x8625('0x4b')](function(){delete _0x16ca2e[_0x8625('0xc')][_0x2b06f7];delete _0x16ca2e[_0x8625('0xe')][_0x2b06f7];});}else{ut['logger'](_0x8625('0x4c'));delete this['channels'][_0x2b06f7];delete this[_0x8625('0xe')][_0x2b06f7];}};Fax[_0x8625('0x1c')][_0x8625('0x19')]=function(_0x39f7bd){var _0x3b659b=this;if(this[_0x8625('0xc')][_0x39f7bd[_0x8625('0x22')]]){if(this[_0x8625('0xe')][_0x39f7bd['uniqueid']]){this[_0x8625('0xc')][_0x39f7bd['uniqueid']]['id']=this[_0x8625('0xe')][_0x39f7bd['uniqueid']]['id'];this[_0x8625('0xc')][_0x39f7bd[_0x8625('0x22')]][_0x8625('0x23')]=this[_0x8625('0xe')][_0x39f7bd[_0x8625('0x22')]][_0x8625('0x23')];}logger['info'](_0x39f7bd['uniqueid'],this[_0x8625('0xe')][_0x39f7bd[_0x8625('0x22')]]?_0x8625('0x4d'):_0x8625('0x4e'),JSON[_0x8625('0x3e')](this['channels'][_0x39f7bd[_0x8625('0x22')]]));if(this[_0x8625('0xe')][_0x39f7bd[_0x8625('0x22')]]){if(this[_0x8625('0xc')][_0x39f7bd[_0x8625('0x22')]]['faxpages']>0x0&&this[_0x8625('0xc')][_0x39f7bd[_0x8625('0x22')]][_0x8625('0x16')]===_0x8625('0x4f')){this['updateStatus'](_0x39f7bd[_0x8625('0x22')],!![]);}else{this[_0x8625('0x48')](_0x39f7bd['uniqueid'],![],this[_0x8625('0xc')][_0x39f7bd[_0x8625('0x22')]][_0x8625('0x50')]?_0x8625('0x51')+this[_0x8625('0xc')][_0x39f7bd[_0x8625('0x22')]]['faxstatusstring']:_0x8625('0x52'));}}}};Fax[_0x8625('0x1c')][_0x8625('0x53')]=function(_0x42715c){var _0x48e589=this;return new BPromise(function(_0x3e9beb,_0x2be1f3){_0x48e589[_0x8625('0x54')](_0x42715c,_0x48e589[_0x8625('0xd')][_0x42715c[_0x8625('0x55')]])[_0x8625('0x37')](function(_0x39aa36){ut['logger']('[Fax][execOriginate][success]',_0x39aa36);_0x3e9beb(ut[_0x8625('0x34')]('Fax\x20received'));})[_0x8625('0x3b')](function(_0x4fe8c4){ut[_0x8625('0x45')](_0x8625('0x56'),_0x4fe8c4);updateStatus(_0x42715c);_0x2be1f3(ut['message'](_0x8625('0x57')));});});};Fax['prototype'][_0x8625('0x58')]=function(_0xaf60b0){var _0x3e462e=this;return new BPromise(function(_0x286336,_0x48fb47){var _0x26c954=_0x3e462e[_0x8625('0x59')](_0x3e462e['faxAccounts'][_0xaf60b0[_0x8625('0x55')]][_0x8625('0x5a')],_0xaf60b0);if(_0x26c954['isValid']){_0x286336(ut[_0x8625('0x34')](_0x8625('0x5b')));}else{_0x48fb47(ut[_0x8625('0x34')](_0x26c954['message']));}});};function originate(_0x4935ae,_0x587d64,_0x2ac52c){return new BPromise(function(_0xa11f0d,_0x383292){if(_0x2ac52c){var _0x4dec6f=util[_0x8625('0x5c')](_0x8625('0x5d'),path[_0x8625('0x38')](_0x4935ae[_0x8625('0x3')])[_0x8625('0x23')],_0x4935ae[_0x8625('0x3')]);gs[_0x8625('0x5e')](_0x4dec6f)[_0x8625('0x37')](function(){_0x4935ae['path']=util[_0x8625('0x5c')]('%s/%s.tif',path['parse'](_0x4935ae[_0x8625('0x3')])['dir'],path[_0x8625('0x38')](_0x4935ae['path'])['name']);_0x587d64[_0x8625('0x5f')]=_0x4935ae[_0x8625('0x3')];ut[_0x8625('0x45')](_0x8625('0x60'),'');ami['Action'](ut[_0x8625('0x61')](_0x4935ae,_0x587d64))['then'](function(_0x14b58e){_0xa11f0d(_0x14b58e);})[_0x8625('0x3b')](function(_0x2d8d2e){_0x383292(_0x2d8d2e);});})[_0x8625('0x3b')](function(_0x2b85fe){_0x383292(_0x2b85fe);});}else{ami[_0x8625('0x62')](ut[_0x8625('0x61')](_0x4935ae,_0x587d64))[_0x8625('0x37')](function(_0x437ebe){_0xa11f0d(_0x437ebe);})[_0x8625('0x3b')](function(_0x1b4ef7){_0x383292(_0x1b4ef7);});}});}Fax[_0x8625('0x1c')]['execOriginate']=function(_0x35d99f,_0x168952){var _0x518269=this;return new BPromise(function(_0xaefd90,_0x414610){var _0x53566a=uuid['v4']();var _0x59e0d6=ut['addVariables'](_0x35d99f,_0x168952);_0x518269[_0x8625('0xe')][_0x53566a]=new Action(_0x53566a,_0x168952,_0x35d99f);var _0x41b8dc=_0x518269['actions'][_0x53566a];if(path[_0x8625('0x38')](_0x35d99f['path'])[_0x8625('0x63')]===_0x8625('0x39')){originate(_0x41b8dc,_0x59e0d6,!![])[_0x8625('0x37')](function(_0x4ceda5){_0xaefd90(_0x4ceda5);})[_0x8625('0x3b')](function(_0x22ad7e){_0x414610(_0x22ad7e);});}else{originate(_0x41b8dc,_0x59e0d6,![])[_0x8625('0x37')](function(_0x18db7f){_0xaefd90(_0x18db7f);})[_0x8625('0x3b')](function(_0x58a99a){_0x414610(_0x58a99a);});}});};Fax['prototype'][_0x8625('0x64')]=function(_0x7cfe3c){return!_[_0x8625('0x65')](_0x7cfe3c)&&!_[_0x8625('0x65')](_0x7cfe3c['name'])&&!_[_0x8625('0x65')](_0x7cfe3c[_0x8625('0x66')])&&_0x7cfe3c['active']&&!_[_0x8625('0x65')](this['trunks'][util[_0x8625('0x5c')](_0x8625('0x67'),_0x7cfe3c[_0x8625('0x23')])])&&!_[_0x8625('0x65')](this['trunks'][util[_0x8625('0x5c')](_0x8625('0x67'),_0x7cfe3c[_0x8625('0x23')])][_0x8625('0x2b')])&&(this['trunks'][util[_0x8625('0x5c')]('SIP/%s',_0x7cfe3c[_0x8625('0x23')])][_0x8625('0x2b')]===_0x8625('0x68')||this[_0x8625('0x69')][util[_0x8625('0x5c')]('SIP/%s',_0x7cfe3c[_0x8625('0x23')])][_0x8625('0x2b')]===_0x8625('0x6a'));};Fax[_0x8625('0x1c')]['checkTrunk']=function(_0x40fa56,_0xd2f20d){if(!this[_0x8625('0x64')](_0x40fa56)){ut[_0x8625('0x45')](_0x8625('0x6b'),_[_0x8625('0x65')](_0x40fa56)?'':_0x40fa56[_0x8625('0x23')]+_0x8625('0x6c'));return{'isValid':![],'message':_0x8625('0x6d')};}if(_[_0x8625('0x65')](_0xd2f20d['fax'])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x8625('0x3e')](_0xd2f20d));return{'isValid':![],'message':_0x8625('0x6e')};}if(_[_0x8625('0x65')](_0xd2f20d[_0x8625('0x3')])){ut[_0x8625('0x45')](_0x8625('0x6f'),JSON[_0x8625('0x3e')](_0xd2f20d));return{'isValid':![],'message':_0x8625('0x70')};}return{'isValid':!![],'message':_0x8625('0x71')};};module[_0x8625('0x72')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 302b1ae..bf726a5 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 _0x2346=['catch','[Notify]\x20','util','bluebird','preview','error','inspect','notify','resolve','then'];(function(_0x40534e,_0x1be148){var _0xf0cc8a=function(_0x1d5b2c){while(--_0x1d5b2c){_0x40534e['push'](_0x40534e['shift']());}};_0xf0cc8a(++_0x1be148);}(_0x2346,0x192));var _0x6234=function(_0x4bad6c,_0x29ec89){_0x4bad6c=_0x4bad6c-0x0;var _0x46ac3b=_0x2346[_0x4bad6c];return _0x46ac3b;};'use strict';var util=require(_0x6234('0x0'));var BPromise=require(_0x6234('0x1'));var logger=require('../../../config/logger')(_0x6234('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x3dffb0){return function(_0xe6ca2d){logger[_0x6234('0x3')](_0x3dffb0,util[_0x6234('0x4')](_0xe6ca2d,{'showHidden':![],'depth':null}));};}exports[_0x6234('0x5')]=function(_0x3fa24a,_0x11b24d){return BPromise[_0x6234('0x6')]()[_0x6234('0x7')](faxAccount[_0x6234('0x5')](_0x3fa24a,_0x11b24d))[_0x6234('0x8')](loggerCatch(_0x6234('0x9')));}; \ No newline at end of file +var _0xbae7=['[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','error','inspect','resolve','notify','catch'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xbae7,0xe8));var _0x7bae=function(_0x473b3a,_0x4889de){_0x473b3a=_0x473b3a-0x0;var _0x557b97=_0xbae7[_0x473b3a];return _0x557b97;};'use strict';var util=require(_0x7bae('0x0'));var BPromise=require(_0x7bae('0x1'));var logger=require(_0x7bae('0x2'))(_0x7bae('0x3'));var _=require(_0x7bae('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x27ab92){return function(_0x1ec1cb){logger[_0x7bae('0x5')](_0x27ab92,util[_0x7bae('0x6')](_0x1ec1cb,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x49ad22,_0x23b68a){return BPromise[_0x7bae('0x7')]()['then'](faxAccount[_0x7bae('0x8')](_0x49ad22,_0x23b68a))[_0x7bae('0x9')](loggerCatch(_0x7bae('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 3a14de6..f377475 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 _0xfff6=['inspect','util','../../../../config/logger','bluebird','exec','execute','\x20Error\x20:'];(function(_0x2eefec,_0x34f543){var _0x448213=function(_0x1dc7b7){while(--_0x1dc7b7){_0x2eefec['push'](_0x2eefec['shift']());}};_0x448213(++_0x34f543);}(_0xfff6,0x14a));var _0x6fff=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfff6[_0x17d9e3];return _0x14192d;};'use strict';var util=require(_0x6fff('0x0'));var logger=require(_0x6fff('0x1'))('fax');var BPromise=require(_0x6fff('0x2'));var exec=require('child_process')[_0x6fff('0x3')];exports[_0x6fff('0x4')]=function(_0x2df9d1){return new BPromise(function(_0x476a34,_0x1b803d){exec(_0x2df9d1,function(_0x58a78e,_0x47a434,_0x56a545){logger['info']('Exec\x20gs',_0x47a434);if(_0x58a78e){logger['info']('Exec\x20gs',_0x6fff('0x5'),util[_0x6fff('0x6')](_0x58a78e,{'showHidden':![],'depth':null}),_0x47a434,_0x56a545);_0x1b803d(_0x58a78e);}_0x476a34(_0x47a434);});});}; \ No newline at end of file +var _0x2ac7=['bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','fax'];(function(_0x263e31,_0x53c73a){var _0xcae6ae=function(_0x2c38dd){while(--_0x2c38dd){_0x263e31['push'](_0x263e31['shift']());}};_0xcae6ae(++_0x53c73a);}(_0x2ac7,0x1ca));var _0x72ac=function(_0x137207,_0x10b480){_0x137207=_0x137207-0x0;var _0x25f61f=_0x2ac7[_0x137207];return _0x25f61f;};'use strict';var util=require(_0x72ac('0x0'));var logger=require('../../../../config/logger')(_0x72ac('0x1'));var BPromise=require(_0x72ac('0x2'));var exec=require(_0x72ac('0x3'))[_0x72ac('0x4')];exports[_0x72ac('0x5')]=function(_0x4f9696){return new BPromise(function(_0x2e62b4,_0x565136){exec(_0x4f9696,function(_0x5b2a1d,_0x592d3f,_0x17613a){logger['info']('Exec\x20gs',_0x592d3f);if(_0x5b2a1d){logger[_0x72ac('0x6')](_0x72ac('0x7'),_0x72ac('0x8'),util[_0x72ac('0x9')](_0x5b2a1d,{'showHidden':![],'depth':null}),_0x592d3f,_0x17613a);_0x565136(_0x5b2a1d);}_0x2e62b4(_0x592d3f);});});}; \ 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 6b6637c..9552d50 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 _0xfc4b=['message','logger','info','addVariables','ecm','minrate','\x22%s\x22','gateway','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','headerinfo','util','lodash','../../../../config/logger'];(function(_0x3474ac,_0x22d0f7){var _0x5345ec=function(_0x45056e){while(--_0x45056e){_0x3474ac['push'](_0x3474ac['shift']());}};_0x5345ec(++_0x22d0f7);}(_0xfc4b,0x105));var _0xbfc4=function(_0x30d3ee,_0x45ce43){_0x30d3ee=_0x30d3ee-0x0;var _0x20c324=_0xfc4b[_0x30d3ee];return _0x20c324;};'use strict';var util=require(_0xbfc4('0x0'));var _=require(_0xbfc4('0x1'));var moment=require('moment');var logger=require(_0xbfc4('0x2'))('fax');exports[_0xbfc4('0x3')]=function(_0x549eed){return{'message':_0x549eed};};exports[_0xbfc4('0x4')]=function(_0x24201d,_0x2aa37e){logger[_0xbfc4('0x5')](_0x24201d,util['inspect'](_0x2aa37e,{'showHidden':![],'depth':null}));};exports[_0xbfc4('0x6')]=function(_0x12098d,_0x3bce56){var _0x491b73={'XMF-ECM':_0x3bce56[_0xbfc4('0x7')],'XMF-HEADERINFO':_0x3bce56['headerinfo'],'XMF-MINRATE':_0x3bce56[_0xbfc4('0x8')],'XMF-MAXRATE':_0x3bce56['maxrate'],'XMF-MODEM':util['format'](_0xbfc4('0x9'),_0x3bce56['modem']),'XMF-GATEWAY':_0x3bce56[_0xbfc4('0xa')],'XMF-FAXDETECT':_0x3bce56['faxdetect'],'XMF-T38TIMEOUT':_0x3bce56[_0xbfc4('0xb')],'XMF-LOCALSTATIONID':_0x3bce56[_0xbfc4('0xc')],'XMF-PATH':_0x12098d[_0xbfc4('0xd')]};return _0x491b73;};exports[_0xbfc4('0xe')]=function(_0x33cbd5,_0x30fed8){return{'actionid':_0x33cbd5[_0xbfc4('0xf')],'action':_0xbfc4('0x10'),'channel':_0x33cbd5[_0xbfc4('0x11')],'Exten':_0xbfc4('0x12'),'Context':_0xbfc4('0x13'),'Priority':'1','callerid':util[_0xbfc4('0x14')]('\x22%s\x22\x20<%s>',_0x33cbd5[_0xbfc4('0x15')]?_0x33cbd5[_0xbfc4('0x15')]:'',_0x33cbd5[_0xbfc4('0xc')]),'variable':_0x30fed8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x33cbd5['uniqueid']};}; \ No newline at end of file +var _0xd4c7=['headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','xcally-motion-fax','lodash','fax','logger','info','inspect','addVariables','ecm'];(function(_0x255441,_0x2fc341){var _0x208b2b=function(_0x4604f1){while(--_0x4604f1){_0x255441['push'](_0x255441['shift']());}};_0x208b2b(++_0x2fc341);}(_0xd4c7,0x1c7));var _0x7d4c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd4c7[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require('util');var _=require(_0x7d4c('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x7d4c('0x1'));exports['message']=function(_0x340074){return{'message':_0x340074};};exports[_0x7d4c('0x2')]=function(_0x1236af,_0x3844a4){logger[_0x7d4c('0x3')](_0x1236af,util[_0x7d4c('0x4')](_0x3844a4,{'showHidden':![],'depth':null}));};exports[_0x7d4c('0x5')]=function(_0x279f75,_0x55036){var _0x335042={'XMF-ECM':_0x55036[_0x7d4c('0x6')],'XMF-HEADERINFO':_0x55036[_0x7d4c('0x7')],'XMF-MINRATE':_0x55036[_0x7d4c('0x8')],'XMF-MAXRATE':_0x55036[_0x7d4c('0x9')],'XMF-MODEM':util[_0x7d4c('0xa')](_0x7d4c('0xb'),_0x55036[_0x7d4c('0xc')]),'XMF-GATEWAY':_0x55036['gateway'],'XMF-FAXDETECT':_0x55036[_0x7d4c('0xd')],'XMF-T38TIMEOUT':_0x55036[_0x7d4c('0xe')],'XMF-LOCALSTATIONID':_0x55036[_0x7d4c('0xf')],'XMF-PATH':_0x279f75[_0x7d4c('0x10')]};return _0x335042;};exports['variablesAction']=function(_0x5871b5,_0x4410b4){return{'actionid':_0x5871b5[_0x7d4c('0x11')],'action':_0x7d4c('0x12'),'channel':_0x5871b5[_0x7d4c('0x13')],'Exten':_0x7d4c('0x14'),'Context':'from-sip','Priority':'1','callerid':util[_0x7d4c('0xa')]('\x22%s\x22\x20<%s>',_0x5871b5['headerinfo']?_0x5871b5[_0x7d4c('0x7')]:'',_0x5871b5[_0x7d4c('0xf')]),'variable':_0x4410b4,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5871b5['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 138d1e7..dd25eba 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 _0x4bea=['getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','error','[index.js][main]','util','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','then','getAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x4bea,0x1a3));var _0xa4be=function(_0x1a0a9b,_0x2e52e0){_0x1a0a9b=_0x1a0a9b-0x0;var _0x5eb67c=_0x4bea[_0x1a0a9b];return _0x5eb67c;};'use strict';var util=require(_0xa4be('0x0'));var moment=require('moment');var server=require('./server');var Realtime=require(_0xa4be('0x1'));var Report=require(_0xa4be('0x2'));var Acw=require('./acw');var Trigger=require(_0xa4be('0x3'));var Dialer=require(_0xa4be('0x4'));var Preview=require(_0xa4be('0x5'));var Fax=require(_0xa4be('0x6'));var user=require(_0xa4be('0x7'));var voiceQueue=require(_0xa4be('0x8'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xa4be('0x9'));var trunk=require(_0xa4be('0xa'));var trigger=require(_0xa4be('0xb'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xa4be('0xc'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xa4be('0xd'));var zendesk=require(_0xa4be('0xe'));var salesforce=require(_0xa4be('0xf'));var sugarcrm=require(_0xa4be('0x10'));var freshdesk=require(_0xa4be('0x11'));var desk=require('./rpc/integrations/desk');var zoho=require(_0xa4be('0x12'));var vtiger=require(_0xa4be('0x13'));var freshsales=require(_0xa4be('0x14'));var servicenow=require(_0xa4be('0x15'));var dynamics365=require(_0xa4be('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xa4be('0x17'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xa4be('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa4be('0x18')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0xa4be('0x19')](user[_0xa4be('0x1a')]())[_0xa4be('0x19')](realtime['initAgents']())[_0xa4be('0x19')](user[_0xa4be('0x1b')]())[_0xa4be('0x19')](realtime['initTelephones']())[_0xa4be('0x19')](trunk[_0xa4be('0x1c')]())[_0xa4be('0x19')](realtime[_0xa4be('0x1d')]())[_0xa4be('0x19')](voiceQueue[_0xa4be('0x1e')]())[_0xa4be('0x19')](realtime[_0xa4be('0x1f')]())[_0xa4be('0x19')](trigger['getTriggers']())[_0xa4be('0x19')](realtime[_0xa4be('0x20')]())['then'](template[_0xa4be('0x21')]())[_0xa4be('0x19')](realtime[_0xa4be('0x22')]())[_0xa4be('0x19')](zendesk[_0xa4be('0x23')]())['then'](realtime['initZendeskAccounts']())[_0xa4be('0x19')](salesforce[_0xa4be('0x24')]())[_0xa4be('0x19')](realtime[_0xa4be('0x25')]())[_0xa4be('0x19')](sugarcrm[_0xa4be('0x26')]())['then'](realtime[_0xa4be('0x27')]())['then'](freshdesk[_0xa4be('0x28')]())[_0xa4be('0x19')](realtime['initFreshdeskAccounts']())[_0xa4be('0x19')](desk[_0xa4be('0x29')]())[_0xa4be('0x19')](realtime[_0xa4be('0x2a')]())['then'](zoho['getZohoAccounts']())[_0xa4be('0x19')](realtime[_0xa4be('0x2b')]())[_0xa4be('0x19')](vtiger[_0xa4be('0x2c')]())['then'](realtime[_0xa4be('0x2d')]())[_0xa4be('0x19')](freshsales[_0xa4be('0x2e')]())[_0xa4be('0x19')](realtime['initFreshsalesAccounts']())[_0xa4be('0x19')](servicenow['getServicenowAccounts']())[_0xa4be('0x19')](realtime['initServicenowAccounts']())[_0xa4be('0x19')](dynamics365['getDynamics365Accounts']())[_0xa4be('0x19')](realtime[_0xa4be('0x2f')]())['then'](campaign[_0xa4be('0x30')]())[_0xa4be('0x19')](realtime[_0xa4be('0x31')]())['then'](voiceExtension[_0xa4be('0x32')]())['then'](realtime[_0xa4be('0x33')]())['then'](faxAccount['getFaxAccounts']())['then'](realtime[_0xa4be('0x34')]())[_0xa4be('0x19')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0xa4be('0x19')](voiceQueueReport[_0xa4be('0x35')]())[_0xa4be('0x19')](realtime[_0xa4be('0x36')]())['then'](cmHopperHistory[_0xa4be('0x37')]())[_0xa4be('0x19')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0xa4be('0x19')](realtime[_0xa4be('0x38')]())['then'](voiceCallReport['getVoiceCallReports']())[_0xa4be('0x19')](realtime[_0xa4be('0x39')]())[_0xa4be('0x3a')](function(_0x48c28f){logger['error'](_0xa4be('0x3b'),util[_0xa4be('0x3c')](_0x48c28f,{'showHidden':![],'depth':null}));});}function main(){return server[_0xa4be('0x3d')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0xa4be('0x19')](function(){return initParams();})['then'](function(){report[_0xa4be('0x3e')]();setInterval(initRealtime,0x1388);})[_0xa4be('0x3a')](function(_0x52f27f){logger[_0xa4be('0x3f')](_0xa4be('0x40'),util[_0xa4be('0x3c')](_0x52f27f,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xb8b6=['./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','listen','sync','inspect','util','./server','./realtime','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0xb8b6,0xc5));var _0x6b8b=function(_0x27a8ef,_0x351bd8){_0x27a8ef=_0x27a8ef-0x0;var _0x601580=_0xb8b6[_0x27a8ef];return _0x601580;};'use strict';var util=require(_0x6b8b('0x0'));var moment=require('moment');var server=require(_0x6b8b('0x1'));var Realtime=require(_0x6b8b('0x2'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x6b8b('0x3'));var Dialer=require(_0x6b8b('0x4'));var Preview=require(_0x6b8b('0x5'));var Fax=require(_0x6b8b('0x6'));var user=require(_0x6b8b('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x6b8b('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x6b8b('0x9'));var trigger=require(_0x6b8b('0xa'));var template=require(_0x6b8b('0xb'));var cmHopperHistory=require(_0x6b8b('0xc'));var campaign=require(_0x6b8b('0xd'));var voiceExtension=require(_0x6b8b('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x6b8b('0xf'));var salesforce=require(_0x6b8b('0x10'));var sugarcrm=require(_0x6b8b('0x11'));var freshdesk=require(_0x6b8b('0x12'));var desk=require(_0x6b8b('0x13'));var zoho=require(_0x6b8b('0x14'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x6b8b('0x15'));var servicenow=require(_0x6b8b('0x16'));var dynamics365=require(_0x6b8b('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x6b8b('0x18')](_0x6b8b('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6b8b('0x18')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x6b8b('0x1a')]()['then'](user[_0x6b8b('0x1b')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x1d')]())[_0x6b8b('0x1c')](user[_0x6b8b('0x1e')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x1f')]())[_0x6b8b('0x1c')](trunk[_0x6b8b('0x20')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x21')]())[_0x6b8b('0x1c')](voiceQueue[_0x6b8b('0x22')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x23')]())[_0x6b8b('0x1c')](trigger[_0x6b8b('0x24')]())[_0x6b8b('0x1c')](realtime['initTriggers']())[_0x6b8b('0x1c')](template[_0x6b8b('0x25')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x26')]())[_0x6b8b('0x1c')](zendesk[_0x6b8b('0x27')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x28')]())[_0x6b8b('0x1c')](salesforce[_0x6b8b('0x29')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x2a')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x2b')]())[_0x6b8b('0x1c')](freshdesk[_0x6b8b('0x2c')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x2d')]())[_0x6b8b('0x1c')](desk[_0x6b8b('0x2e')]())[_0x6b8b('0x1c')](realtime['initDeskAccounts']())[_0x6b8b('0x1c')](zoho['getZohoAccounts']())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x2f')]())[_0x6b8b('0x1c')](vtiger[_0x6b8b('0x30')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x31')]())[_0x6b8b('0x1c')](freshsales[_0x6b8b('0x32')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x33')]())[_0x6b8b('0x1c')](servicenow['getServicenowAccounts']())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x34')]())[_0x6b8b('0x1c')](dynamics365[_0x6b8b('0x35')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x36')]())[_0x6b8b('0x1c')](campaign[_0x6b8b('0x37')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x38')]())[_0x6b8b('0x1c')](voiceExtension['getVoiceExtensions']())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x39')]())['then'](faxAccount['getFaxAccounts']())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x3a')]())[_0x6b8b('0x1c')](function(){return realtime;});}function initParams(){return Promise[_0x6b8b('0x1a')]()[_0x6b8b('0x1c')](voiceQueueReport['getVoiceQueueReports']())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x3b')]())['then'](cmHopperHistory[_0x6b8b('0x3c')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x3d')]())['then'](cmHopperHistory[_0x6b8b('0x3e')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x3f')]())[_0x6b8b('0x1c')](voiceCallReport[_0x6b8b('0x40')]())[_0x6b8b('0x1c')](realtime[_0x6b8b('0x41')]())[_0x6b8b('0x42')](function(_0x4e60e7){logger['error'](_0x6b8b('0x43'),util['inspect'](_0x4e60e7,{'showHidden':![],'depth':null}));});}function main(){return server[_0x6b8b('0x44')](realtime,preview,fax)[_0x6b8b('0x1c')](function(){return initRealtime();})[_0x6b8b('0x1c')](function(){return initParams();})['then'](function(){report[_0x6b8b('0x45')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x40b3f2){logger['error']('[index.js][main]',util[_0x6b8b('0x46')](_0x40b3f2,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index c2e30ef..e24a897 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 _0xeec6=['interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','state','toLowerCase','not_inuse','statePause','toNumber','format','stringify','user:%s','emit','user:ami:update','omit','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','email','accountcode','fullname','stateTime','status','unknown','address','phone','mobile'];(function(_0x3185d2,_0x56afa8){var _0x516c26=function(_0x31cdec){while(--_0x31cdec){_0x3185d2['push'](_0x3185d2['shift']());}};_0x516c26(++_0x56afa8);}(_0xeec6,0x126));var _0x6eec=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xeec6[_0x2576d7];return _0x16a08c;};'use strict';var _=require('lodash');var util=require(_0x6eec('0x0'));var moment=require(_0x6eec('0x1'));var md5=require(_0x6eec('0x2'));var Redis=require(_0x6eec('0x3'));var config=require(_0x6eec('0x4'));config[_0x6eec('0x5')]=_[_0x6eec('0x6')](config['redis'],{'host':_0x6eec('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6eec('0x5')]));function Agent(_0x4ebcb0){this['id']=_0x4ebcb0['id']||0x0;this[_0x6eec('0x8')]=_0x4ebcb0[_0x6eec('0x8')]||'';this['email']=_0x4ebcb0[_0x6eec('0x9')]||'';this[_0x6eec('0xa')]=_0x4ebcb0[_0x6eec('0xa')]||'';this[_0x6eec('0xb')]=_0x4ebcb0[_0x6eec('0xb')]||'';this['state']='unknown';this[_0x6eec('0xc')]=0x0;this[_0x6eec('0xd')]=_0x6eec('0xe');this[_0x6eec('0xf')]='';this[_0x6eec('0x10')]='';this[_0x6eec('0x11')]='';this[_0x6eec('0x12')]='';this[_0x6eec('0x13')]=_0x4ebcb0[_0x6eec('0x13')]||![];this[_0x6eec('0x14')]=_0x6eec('0xe');this[_0x6eec('0x15')]=0x0;this[_0x6eec('0x16')]='';this[_0x6eec('0x17')]='';this[_0x6eec('0x18')]=![];this[_0x6eec('0x19')]=![];this['md5']='';}Agent[_0x6eec('0x1a')]['updateStatusRealtime']=function(_0x20f5dc){var _0x3dd238;if(_0x20f5dc&&_0x20f5dc['state']){_0x3dd238=_0x20f5dc[_0x6eec('0x1b')][_0x6eec('0x1c')]();switch(_0x3dd238){case _0x6eec('0x1d'):_0x3dd238='idle';break;case'inuse':_0x3dd238='talking';break;}}if(_0x3dd238&&this[_0x6eec('0x14')]!==_0x3dd238||_0x20f5dc[_0x6eec('0x1e')]){this['voiceStatusTime']=_[_0x6eec('0x1f')](moment()[_0x6eec('0x20')]('x'));}if(_0x3dd238){this[_0x6eec('0x14')]=_0x3dd238;}var _0x4e8ddc={'id':this['id'],'name':this[_0x6eec('0x8')],'email':this[_0x6eec('0x9')],'accountcode':this['accountcode'],'fullname':this[_0x6eec('0xb')],'state':this['state'],'stateTime':this[_0x6eec('0xc')],'status':this[_0x6eec('0xd')],'address':this[_0x6eec('0xf')],'online':this[_0x6eec('0x13')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x6eec('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x6eec('0x12')],'onhold':this[_0x6eec('0x18')]};var _0x5b81af=md5(JSON[_0x6eec('0x21')](_0x4e8ddc));if(this[_0x6eec('0x2')]!==_0x5b81af){this[_0x6eec('0x2')]=_0x5b81af;io['to'](util[_0x6eec('0x20')](_0x6eec('0x22'),_0x4e8ddc['name']))[_0x6eec('0x23')](_0x6eec('0x24'),_[_0x6eec('0x25')](_0x4e8ddc,[_0x6eec('0x13')]));io[_0x6eec('0x23')]('user:presence',_0x4e8ddc);}};module[_0x6eec('0x26')]=Agent; \ No newline at end of file +var _0x81b2=['prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','statePause','toNumber','format','address','stringify','user:%s','emit','user:ami:update','user:presence','lodash','util','moment','md5','../../../config/environment','redis','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','phone','interface','online','voiceStatus','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local'];(function(_0x4e6beb,_0x20b50a){var _0x20460b=function(_0x1ea4b9){while(--_0x1ea4b9){_0x4e6beb['push'](_0x4e6beb['shift']());}};_0x20460b(++_0x20b50a);}(_0x81b2,0xec));var _0x281b=function(_0x2bf8f2,_0x27c758){_0x2bf8f2=_0x2bf8f2-0x0;var _0x1ba2fa=_0x81b2[_0x2bf8f2];return _0x1ba2fa;};'use strict';var _=require(_0x281b('0x0'));var util=require(_0x281b('0x1'));var moment=require(_0x281b('0x2'));var md5=require(_0x281b('0x3'));var Redis=require('ioredis');var config=require(_0x281b('0x4'));config[_0x281b('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x281b('0x6'))(new Redis(config[_0x281b('0x5')]));function Agent(_0x598a69){this['id']=_0x598a69['id']||0x0;this[_0x281b('0x7')]=_0x598a69[_0x281b('0x7')]||'';this[_0x281b('0x8')]=_0x598a69[_0x281b('0x8')]||'';this[_0x281b('0x9')]=_0x598a69[_0x281b('0x9')]||'';this[_0x281b('0xa')]=_0x598a69[_0x281b('0xa')]||'';this[_0x281b('0xb')]=_0x281b('0xc');this[_0x281b('0xd')]=0x0;this[_0x281b('0xe')]=_0x281b('0xc');this['address']='';this[_0x281b('0xf')]='';this['mobile']='';this[_0x281b('0x10')]='';this['online']=_0x598a69[_0x281b('0x11')]||![];this[_0x281b('0x12')]=_0x281b('0xc');this['voiceStatusTime']=0x0;this[_0x281b('0x13')]='';this[_0x281b('0x14')]='';this[_0x281b('0x15')]=![];this[_0x281b('0x16')]=![];this[_0x281b('0x3')]='';}Agent[_0x281b('0x17')][_0x281b('0x18')]=function(_0xb1e09c){var _0x446b53;if(_0xb1e09c&&_0xb1e09c[_0x281b('0xb')]){_0x446b53=_0xb1e09c[_0x281b('0xb')][_0x281b('0x19')]();switch(_0x446b53){case _0x281b('0x1a'):_0x446b53=_0x281b('0x1b');break;case'inuse':_0x446b53='talking';break;}}if(_0x446b53&&this['voiceStatus']!==_0x446b53||_0xb1e09c[_0x281b('0x1c')]){this['voiceStatusTime']=_[_0x281b('0x1d')](moment()[_0x281b('0x1e')]('x'));}if(_0x446b53){this[_0x281b('0x12')]=_0x446b53;}var _0x1f3509={'id':this['id'],'name':this[_0x281b('0x7')],'email':this['email'],'accountcode':this[_0x281b('0x9')],'fullname':this[_0x281b('0xa')],'state':this[_0x281b('0xb')],'stateTime':this[_0x281b('0xd')],'status':this[_0x281b('0xe')],'address':this[_0x281b('0x1f')],'online':this['online'],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x281b('0x13')],'voiceStatusQueue':this[_0x281b('0x14')],'interface':this['interface'],'onhold':this[_0x281b('0x15')]};var _0x1d440c=md5(JSON[_0x281b('0x20')](_0x1f3509));if(this['md5']!==_0x1d440c){this[_0x281b('0x3')]=_0x1d440c;io['to'](util[_0x281b('0x1e')](_0x281b('0x21'),_0x1f3509['name']))[_0x281b('0x22')](_0x281b('0x23'),_['omit'](_0x1f3509,[_0x281b('0x11')]));io[_0x281b('0x22')](_0x281b('0x24'),_0x1f3509);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index c768999..f9b34f9 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 _0x9a05=['type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name'];(function(_0x1dffaf,_0x43e4e6){var _0x483c1a=function(_0x126f60){while(--_0x126f60){_0x1dffaf['push'](_0x1dffaf['shift']());}};_0x483c1a(++_0x43e4e6);}(_0x9a05,0xc7));var _0x59a0=function(_0x460be0,_0x8de397){_0x460be0=_0x460be0-0x0;var _0x43ea41=_0x9a05[_0x460be0];return _0x43ea41;};'use strict';function Campaign(_0x2a1efd){this['id']=_0x2a1efd['id']||0x0;this[_0x59a0('0x0')]=_0x2a1efd['name']||'';this[_0x59a0('0x1')]=_0x2a1efd['type']||_0x59a0('0x2');this[_0x59a0('0x3')]=0x0;this[_0x59a0('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x59a0('0x5')]=0x0;this[_0x59a0('0x6')]='';this[_0x59a0('0x7')]=!![];this[_0x59a0('0x8')]=_0x2a1efd[_0x59a0('0x8')];this[_0x59a0('0x9')]=_0x2a1efd[_0x59a0('0x9')];this[_0x59a0('0xa')]=_0x2a1efd[_0x59a0('0xa')]||null;this[_0x59a0('0xb')]=_0x2a1efd['dialGlobalInterval']?_0x2a1efd['dialGlobalInterval']:null;this[_0x59a0('0xc')]=_0x2a1efd[_0x59a0('0xc')];this['dialOriginateCallerIdNumber']=_0x2a1efd['dialOriginateCallerIdNumber'];this[_0x59a0('0xd')]=_0x2a1efd[_0x59a0('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x2a1efd['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x2a1efd[_0x59a0('0xe')];this[_0x59a0('0xf')]=_0x2a1efd[_0x59a0('0xf')];this[_0x59a0('0x10')]=_0x2a1efd[_0x59a0('0x10')];this['dialNoAnswerMaxRetry']=_0x2a1efd[_0x59a0('0x11')];this[_0x59a0('0x12')]=_0x2a1efd[_0x59a0('0x12')];this[_0x59a0('0x13')]=_0x2a1efd[_0x59a0('0x13')];this[_0x59a0('0x14')]=_0x2a1efd[_0x59a0('0x14')]||0x3;this[_0x59a0('0x15')]=_0x2a1efd[_0x59a0('0x15')]||0x96;this[_0x59a0('0x16')]=_0x2a1efd[_0x59a0('0x16')]||0x3;this[_0x59a0('0x17')]=_0x2a1efd['dialDropRetryFrequency']||0x96;this[_0x59a0('0x18')]=_0x2a1efd[_0x59a0('0x18')]||0x3;this[_0x59a0('0x19')]=_0x2a1efd[_0x59a0('0x19')]||0x96;this[_0x59a0('0x1a')]=_0x2a1efd[_0x59a0('0x1a')]||0x3;this[_0x59a0('0x1b')]=_0x2a1efd[_0x59a0('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0x2a1efd[_0x59a0('0x1c')]||0x3;this[_0x59a0('0x1d')]=_0x2a1efd[_0x59a0('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x2a1efd[_0x59a0('0x1e')]||_0x59a0('0x1f');this[_0x59a0('0x20')]=_0x2a1efd[_0x59a0('0x20')]||undefined;this[_0x59a0('0x21')]=_0x2a1efd[_0x59a0('0x21')]||undefined;this['dialCutDigit']=_0x2a1efd['dialCutDigit']||undefined;this['TrunkBackup']=_0x2a1efd[_0x59a0('0x22')]?_0x2a1efd[_0x59a0('0x22')]:undefined;this[_0x59a0('0x23')]=_0x2a1efd[_0x59a0('0x23')]?_0x2a1efd[_0x59a0('0x23')]:undefined;this[_0x59a0('0x24')]=_0x2a1efd[_0x59a0('0x24')]?_0x2a1efd['Interval']:undefined;this[_0x59a0('0x25')]=_0x2a1efd[_0x59a0('0x25')]?_0x2a1efd[_0x59a0('0x25')]:undefined;this[_0x59a0('0x26')]=_0x2a1efd['SquareProject']?_0x2a1efd[_0x59a0('0x25')][_0x59a0('0x0')]:undefined;this[_0x59a0('0x27')]=_0x2a1efd[_0x59a0('0x27')]||![];this[_0x59a0('0x28')]=_0x2a1efd['dialAMDInitialSilence'];this[_0x59a0('0x29')]=_0x2a1efd[_0x59a0('0x29')];this[_0x59a0('0x2a')]=_0x2a1efd[_0x59a0('0x2a')];this['dialAMDTotalAnalysisTime']=_0x2a1efd[_0x59a0('0x2b')];this[_0x59a0('0x2c')]=_0x2a1efd['dialAMDMinWordLength'];this[_0x59a0('0x2d')]=_0x2a1efd[_0x59a0('0x2d')];this[_0x59a0('0x2e')]=_0x2a1efd[_0x59a0('0x2e')];this[_0x59a0('0x2f')]=_0x2a1efd[_0x59a0('0x2f')];this['dialAMDMaximumWordLength']=_0x2a1efd[_0x59a0('0x30')];}module[_0x59a0('0x31')]=Campaign; \ No newline at end of file +var _0xa780=['TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x92d934,_0x226e34){var _0x4397ab=function(_0x48f256){while(--_0x48f256){_0x92d934['push'](_0x92d934['shift']());}};_0x4397ab(++_0x226e34);}(_0xa780,0x71));var _0x0a78=function(_0x31d801,_0xed1163){_0x31d801=_0x31d801-0x0;var _0xdc0dcc=_0xa780[_0x31d801];return _0xdc0dcc;};'use strict';function Campaign(_0x331eb1){this['id']=_0x331eb1['id']||0x0;this[_0x0a78('0x0')]=_0x331eb1[_0x0a78('0x0')]||'';this[_0x0a78('0x1')]=_0x331eb1[_0x0a78('0x1')]||'campaign';this[_0x0a78('0x2')]=0x0;this[_0x0a78('0x3')]=0x0;this[_0x0a78('0x4')]=0x0;this[_0x0a78('0x5')]=0x0;this[_0x0a78('0x6')]='';this[_0x0a78('0x7')]=!![];this[_0x0a78('0x8')]=_0x331eb1[_0x0a78('0x8')];this[_0x0a78('0x9')]=_0x331eb1['limitCalls'];this[_0x0a78('0xa')]=_0x331eb1['dialTimezone']||null;this['dialGlobalInterval']=_0x331eb1[_0x0a78('0xb')]?_0x331eb1[_0x0a78('0xb')]:null;this[_0x0a78('0xc')]=_0x331eb1['dialOriginateCallerIdName'];this[_0x0a78('0xd')]=_0x331eb1[_0x0a78('0xd')];this[_0x0a78('0xe')]=_0x331eb1[_0x0a78('0xe')]||0x1e;this[_0x0a78('0xf')]=_0x331eb1[_0x0a78('0xf')];this[_0x0a78('0x10')]=_0x331eb1[_0x0a78('0x10')];this[_0x0a78('0x11')]=_0x331eb1['dialBusyMaxRetry'];this[_0x0a78('0x12')]=_0x331eb1[_0x0a78('0x12')];this['dialNoAnswerMaxRetry']=_0x331eb1[_0x0a78('0x13')];this[_0x0a78('0x14')]=_0x331eb1['dialNoAnswerRetryFrequency'];this[_0x0a78('0x15')]=_0x331eb1[_0x0a78('0x15')];this['dialNoSuchNumberMaxRetry']=_0x331eb1[_0x0a78('0x16')]||0x3;this[_0x0a78('0x17')]=_0x331eb1[_0x0a78('0x17')]||0x96;this[_0x0a78('0x18')]=_0x331eb1['dialDropMaxRetry']||0x3;this[_0x0a78('0x19')]=_0x331eb1['dialDropRetryFrequency']||0x96;this[_0x0a78('0x1a')]=_0x331eb1[_0x0a78('0x1a')]||0x3;this[_0x0a78('0x1b')]=_0x331eb1['dialAbandonedRetryFrequency']||0x96;this[_0x0a78('0x1c')]=_0x331eb1[_0x0a78('0x1c')]||0x3;this[_0x0a78('0x1d')]=_0x331eb1[_0x0a78('0x1d')]||0x96;this['dialAgentRejectMaxRetry']=_0x331eb1[_0x0a78('0x1e')]||0x3;this[_0x0a78('0x1f')]=_0x331eb1[_0x0a78('0x1f')]||0x96;this[_0x0a78('0x20')]=_0x331eb1['dialOrderByScheduledAt']||_0x0a78('0x21');this['dialPrefix']=_0x331eb1[_0x0a78('0x22')]||undefined;this[_0x0a78('0x23')]=_0x331eb1['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x0a78('0x24')]=_0x331eb1[_0x0a78('0x24')]||undefined;this[_0x0a78('0x25')]=_0x331eb1['TrunkBackup']?_0x331eb1['TrunkBackup']:undefined;this[_0x0a78('0x26')]=_0x331eb1[_0x0a78('0x26')]?_0x331eb1[_0x0a78('0x26')]:undefined;this['Interval']=_0x331eb1[_0x0a78('0x27')]?_0x331eb1['Interval']:undefined;this[_0x0a78('0x28')]=_0x331eb1[_0x0a78('0x28')]?_0x331eb1['SquareProject']:undefined;this['dialQueueProject']=_0x331eb1[_0x0a78('0x28')]?_0x331eb1[_0x0a78('0x28')][_0x0a78('0x0')]:undefined;this['dialAMDActive']=_0x331eb1[_0x0a78('0x29')]||![];this[_0x0a78('0x2a')]=_0x331eb1[_0x0a78('0x2a')];this['dialAMDGreeting']=_0x331eb1[_0x0a78('0x2b')];this[_0x0a78('0x2c')]=_0x331eb1['dialAMDAfterGreetingSilence'];this[_0x0a78('0x2d')]=_0x331eb1['dialAMDTotalAnalysisTime'];this[_0x0a78('0x2e')]=_0x331eb1[_0x0a78('0x2e')];this[_0x0a78('0x2f')]=_0x331eb1[_0x0a78('0x2f')];this[_0x0a78('0x30')]=_0x331eb1[_0x0a78('0x30')];this['dialAMDSilenceThreshold']=_0x331eb1['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x331eb1['dialAMDMaximumWordLength'];}module[_0x0a78('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index b547701..96d31a5 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 _0xbac2=['billableseconds','holdtime','type','tag','disposition','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xbac2,0xc6));var _0x2bac=function(_0x3ef4f1,_0x5f0f9b){_0x3ef4f1=_0x3ef4f1-0x0;var _0x69953c=_0xbac2[_0x3ef4f1];return _0x69953c;};'use strict';function Channel(){this[_0x2bac('0x0')]=null;this[_0x2bac('0x1')]='';this[_0x2bac('0x2')]='';this[_0x2bac('0x3')]=0x0;this[_0x2bac('0x4')]='';this[_0x2bac('0x5')]=undefined;this[_0x2bac('0x6')]=undefined;this[_0x2bac('0x7')]=0x0;this['context']='';this[_0x2bac('0x8')]=0x0;this[_0x2bac('0x9')]=0x0;this['exten']=0x0;this[_0x2bac('0xa')]=![];this[_0x2bac('0xb')]=null;this[_0x2bac('0xc')]=null;this[_0x2bac('0xd')]=![];this[_0x2bac('0xe')]=![];this[_0x2bac('0xf')]='';this[_0x2bac('0x10')]='';this[_0x2bac('0x11')]=0x0;this[_0x2bac('0x12')]=0x0;this[_0x2bac('0x13')]=0x0;this[_0x2bac('0x14')]=null;this[_0x2bac('0x15')]=null;this[_0x2bac('0x16')]=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x2bac('0x17')]=undefined;this[_0x2bac('0x18')]=undefined;this[_0x2bac('0x19')]=0x0;}module[_0x2bac('0x1a')]=Channel; \ No newline at end of file +var _0xdf62=['channel','destinationchannel','calleridnum','calleridname','connectedlinenum','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastdata','duration','billableseconds','holdtime','disposition','monitor','monitorFilename','queue','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime'];(function(_0x1c22ac,_0x4c86bd){var _0x4c867a=function(_0x370c7d){while(--_0x370c7d){_0x1c22ac['push'](_0x1c22ac['shift']());}};_0x4c867a(++_0x4c86bd);}(_0xdf62,0x151));var _0x2df6=function(_0x214d54,_0x133c72){_0x214d54=_0x214d54-0x0;var _0x44ca46=_0xdf62[_0x214d54];return _0x44ca46;};'use strict';function Channel(){this[_0x2df6('0x0')]=null;this[_0x2df6('0x1')]='';this[_0x2df6('0x2')]='';this[_0x2df6('0x3')]=0x0;this[_0x2df6('0x4')]='';this[_0x2df6('0x5')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x2df6('0x6')]='';this[_0x2df6('0x7')]=0x0;this[_0x2df6('0x8')]=0x0;this[_0x2df6('0x9')]=0x0;this[_0x2df6('0xa')]=![];this[_0x2df6('0xb')]=null;this[_0x2df6('0xc')]=null;this['unmanaged']=![];this[_0x2df6('0xd')]=![];this['lastapplication']='';this[_0x2df6('0xe')]='';this[_0x2df6('0xf')]=0x0;this[_0x2df6('0x10')]=0x0;this[_0x2df6('0x11')]=0x0;this['type']=null;this['tag']=null;this[_0x2df6('0x12')]=null;this[_0x2df6('0x13')]=![];this[_0x2df6('0x14')]=null;this[_0x2df6('0x15')]=null;this['monitors']=[];this[_0x2df6('0x16')]=undefined;this[_0x2df6('0x17')]=undefined;this['transferType']=undefined;this[_0x2df6('0x18')]=0x0;}module[_0x2df6('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index c1a6410..e74cb7b 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 _0x1b20=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x2ffb42,_0x1a53ac){var _0x26dfd7=function(_0x4388d5){while(--_0x4388d5){_0x2ffb42['push'](_0x2ffb42['shift']());}};_0x26dfd7(++_0x1a53ac);}(_0x1b20,0x1f4));var _0x01b2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1b20[_0x59ee6f];return _0x4c0979;};'use strict';function DeskAccount(_0x2b2bef){this['id']=_0x2b2bef['id']||0x0;this[_0x01b2('0x0')]=_0x2b2bef[_0x01b2('0x0')]||'';this[_0x01b2('0x1')]=_0x2b2bef['username']||'';this['remoteUri']=_0x2b2bef[_0x01b2('0x2')]||'';this[_0x01b2('0x3')]=_0x2b2bef[_0x01b2('0x3')]||'';this[_0x01b2('0x4')]=_0x2b2bef[_0x01b2('0x4')]||'';this[_0x01b2('0x5')]=_0x2b2bef[_0x01b2('0x5')]||'';this[_0x01b2('0x6')]=_0x2b2bef[_0x01b2('0x6')]||'';this[_0x01b2('0x7')]=_0x2b2bef[_0x01b2('0x7')]||'';this[_0x01b2('0x8')]=_0x2b2bef[_0x01b2('0x8')]||'';this['type']=_0x2b2bef[_0x01b2('0x9')]||'';this[_0x01b2('0xa')]=_0x2b2bef['serverUrl']||'';this[_0x01b2('0xb')]=_0x2b2bef[_0x01b2('0xb')]||{};}module[_0x01b2('0xc')]=DeskAccount; \ No newline at end of file +var _0xec3f=['authType','password','consumerKey','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xec3f,0x1ad));var _0xfec3=function(_0x37803b,_0x56bbdc){_0x37803b=_0x37803b-0x0;var _0x2e506=_0xec3f[_0x37803b];return _0x2e506;};'use strict';function DeskAccount(_0x3fc15a){this['id']=_0x3fc15a['id']||0x0;this[_0xfec3('0x0')]=_0x3fc15a[_0xfec3('0x0')]||'';this[_0xfec3('0x1')]=_0x3fc15a[_0xfec3('0x1')]||'';this[_0xfec3('0x2')]=_0x3fc15a[_0xfec3('0x2')]||'';this[_0xfec3('0x3')]=_0x3fc15a[_0xfec3('0x3')]||'';this[_0xfec3('0x4')]=_0x3fc15a[_0xfec3('0x4')]||'';this[_0xfec3('0x5')]=_0x3fc15a[_0xfec3('0x5')]||'';this['consumerSecret']=_0x3fc15a['consumerSecret']||'';this[_0xfec3('0x6')]=_0x3fc15a[_0xfec3('0x6')]||'';this[_0xfec3('0x7')]=_0x3fc15a[_0xfec3('0x7')]||'';this[_0xfec3('0x8')]=_0x3fc15a[_0xfec3('0x8')]||'';this['serverUrl']=_0x3fc15a[_0xfec3('0x9')]||'';this['Configurations']=_0x3fc15a[_0xfec3('0xa')]||{};}module[_0xfec3('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 1657f7f..f202012 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 _0xbf57=['Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xbf57,0x123));var _0x7bf5=function(_0x3bb43c,_0x5e18f3){_0x3bb43c=_0x3bb43c-0x0;var _0x1c5bf9=_0xbf57[_0x3bb43c];return _0x1c5bf9;};'use strict';function Dynamics365Account(_0x3270f4){this['id']=_0x3270f4['id']||0x0;this[_0x7bf5('0x0')]=_0x3270f4['name']||'';this['username']=_0x3270f4[_0x7bf5('0x1')]||'';this[_0x7bf5('0x2')]=_0x3270f4[_0x7bf5('0x2')]||'';this['remoteUri']=_0x3270f4[_0x7bf5('0x3')]||'';this[_0x7bf5('0x4')]=_0x3270f4[_0x7bf5('0x4')]||'';this[_0x7bf5('0x5')]=_0x3270f4[_0x7bf5('0x5')]||'';this['clientSecret']=_0x3270f4[_0x7bf5('0x6')]||{};this[_0x7bf5('0x7')]=_0x3270f4[_0x7bf5('0x7')]||'';this['modernAuthentication']=_0x3270f4[_0x7bf5('0x8')]||![];this[_0x7bf5('0x9')]=_0x3270f4['Configurations']||{};this[_0x7bf5('0xa')]=_0x3270f4['CloudProvider']||{};}module[_0x7bf5('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x6780=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username','remoteUri','tenantId'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x6780,0x88));var _0x0678=function(_0x479d11,_0x542769){_0x479d11=_0x479d11-0x0;var _0x46710e=_0x6780[_0x479d11];return _0x46710e;};'use strict';function Dynamics365Account(_0x25f524){this['id']=_0x25f524['id']||0x0;this[_0x0678('0x0')]=_0x25f524[_0x0678('0x0')]||'';this[_0x0678('0x1')]=_0x25f524[_0x0678('0x1')]||'';this['password']=_0x25f524['password']||'';this[_0x0678('0x2')]=_0x25f524[_0x0678('0x2')]||'';this[_0x0678('0x3')]=_0x25f524[_0x0678('0x3')]||'';this[_0x0678('0x4')]=_0x25f524[_0x0678('0x4')]||'';this[_0x0678('0x5')]=_0x25f524['clientSecret']||{};this[_0x0678('0x6')]=_0x25f524[_0x0678('0x6')]||'';this[_0x0678('0x7')]=_0x25f524[_0x0678('0x7')]||![];this[_0x0678('0x8')]=_0x25f524[_0x0678('0x8')]||{};this[_0x0678('0x9')]=_0x25f524['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 2fe9127..7a8da36 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 _0x27f3=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports'];(function(_0x19d6a7,_0x2b2b10){var _0x2f56b1=function(_0x5c8cad){while(--_0x5c8cad){_0x19d6a7['push'](_0x19d6a7['shift']());}};_0x2f56b1(++_0x2b2b10);}(_0x27f3,0x165));var _0x327f=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x27f3[_0x4fc80b];return _0x119dba;};'use strict';function FaxAccount(_0x472b68){this['id']=_0x472b68['id']||0x0;this[_0x327f('0x0')]=_0x472b68['name']||'';this[_0x327f('0x1')]=_0x472b68[_0x327f('0x1')];this[_0x327f('0x2')]=_0x472b68[_0x327f('0x2')];this[_0x327f('0x3')]=_0x472b68[_0x327f('0x3')];this['localstationid']=_0x472b68[_0x327f('0x4')];this[_0x327f('0x5')]=_0x472b68['minrate']||0x960;this[_0x327f('0x6')]=_0x472b68[_0x327f('0x6')]||0x3840;this[_0x327f('0x7')]=_0x472b68['modem']||'v17,v27,v29';this[_0x327f('0x8')]=_0x472b68['gateway']||'no';this['faxdetect']=_0x472b68[_0x327f('0x9')]||'no';this[_0x327f('0xa')]=_0x472b68[_0x327f('0xa')]||0x1388;this[_0x327f('0xb')]=_0x472b68[_0x327f('0xb')]||_0x327f('0xc');this[_0x327f('0xd')]=_0x472b68[_0x327f('0xd')]?_0x472b68[_0x327f('0xd')]:undefined;this[_0x327f('0xe')]=_0x472b68['ListId'];this[_0x327f('0xf')]=_0x472b68[_0x327f('0xf')];}module[_0x327f('0x10')]=FaxAccount; \ No newline at end of file +var _0xf528=['modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xf528,0xdb));var _0x8f52=function(_0x2e77c5,_0x2ebda4){_0x2e77c5=_0x2e77c5-0x0;var _0x54723b=_0xf528[_0x2e77c5];return _0x54723b;};'use strict';function FaxAccount(_0x118271){this['id']=_0x118271['id']||0x0;this[_0x8f52('0x0')]=_0x118271[_0x8f52('0x0')]||'';this[_0x8f52('0x1')]=_0x118271[_0x8f52('0x1')];this[_0x8f52('0x2')]=_0x118271[_0x8f52('0x2')];this[_0x8f52('0x3')]=_0x118271[_0x8f52('0x3')];this[_0x8f52('0x4')]=_0x118271['localstationid'];this[_0x8f52('0x5')]=_0x118271[_0x8f52('0x5')]||0x960;this['maxrate']=_0x118271['maxrate']||0x3840;this[_0x8f52('0x6')]=_0x118271[_0x8f52('0x6')]||'v17,v27,v29';this[_0x8f52('0x7')]=_0x118271[_0x8f52('0x7')]||'no';this[_0x8f52('0x8')]=_0x118271[_0x8f52('0x8')]||'no';this['t38timeout']=_0x118271[_0x8f52('0x9')]||0x1388;this[_0x8f52('0xa')]=_0x118271[_0x8f52('0xa')]||_0x8f52('0xb');this[_0x8f52('0xc')]=_0x118271['Trunk']?_0x118271[_0x8f52('0xc')]:undefined;this['ListId']=_0x118271[_0x8f52('0xd')];this['key']=_0x118271[_0x8f52('0xe')];}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 3e05ad7..3f466d0 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 _0x27d7=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x27d7,0x1ef));var _0x727d=function(_0xf27a5d,_0x5a3b2f){_0xf27a5d=_0xf27a5d-0x0;var _0x217da7=_0x27d7[_0xf27a5d];return _0x217da7;};'use strict';function FreshdeskAccount(_0x386dd3){this['id']=_0x386dd3['id']||0x0;this[_0x727d('0x0')]=_0x386dd3['name']||'';this[_0x727d('0x1')]=_0x386dd3[_0x727d('0x1')]||'';this['apiKey']=_0x386dd3['token']||'';this[_0x727d('0x2')]=_0x386dd3[_0x727d('0x2')]||'';this['serverUrl']=_0x386dd3[_0x727d('0x3')]||'';this[_0x727d('0x4')]=_0x386dd3['Configurations']||{};}module[_0x727d('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0x950d=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0xba5b7a,_0x4755bf){var _0x3d1d9a=function(_0x264405){while(--_0x264405){_0xba5b7a['push'](_0xba5b7a['shift']());}};_0x3d1d9a(++_0x4755bf);}(_0x950d,0xbd));var _0xd950=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x950d[_0x3054be];return _0x3df150;};'use strict';function FreshdeskAccount(_0x3c32d6){this['id']=_0x3c32d6['id']||0x0;this[_0xd950('0x0')]=_0x3c32d6[_0xd950('0x0')]||'';this[_0xd950('0x1')]=_0x3c32d6['username']||'';this[_0xd950('0x2')]=_0x3c32d6[_0xd950('0x3')]||'';this[_0xd950('0x4')]=_0x3c32d6[_0xd950('0x4')]||'';this[_0xd950('0x5')]=_0x3c32d6['serverUrl']||'';this[_0xd950('0x6')]=_0x3c32d6[_0xd950('0x6')]||{};}module[_0xd950('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 99c4a29..dd31472 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 _0xa9b1=['username','apiKey','token','remoteUri','Configurations','exports','name'];(function(_0x593713,_0x5cef2a){var _0x4bf4f3=function(_0x53a549){while(--_0x53a549){_0x593713['push'](_0x593713['shift']());}};_0x4bf4f3(++_0x5cef2a);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';function FreshsalesAccount(_0x32f8da){this['id']=_0x32f8da['id']||0x0;this['name']=_0x32f8da[_0x1a9b('0x0')]||'';this[_0x1a9b('0x1')]=_0x32f8da[_0x1a9b('0x1')]||'';this[_0x1a9b('0x2')]=_0x32f8da[_0x1a9b('0x3')]||'';this[_0x1a9b('0x4')]=_0x32f8da['remoteUri']||'';this['serverUrl']=_0x32f8da['serverUrl']||'';this[_0x1a9b('0x5')]=_0x32f8da[_0x1a9b('0x5')]||{};}module[_0x1a9b('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x1a44=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x192b1e,_0x578930){var _0x5db684=function(_0x3d89d6){while(--_0x3d89d6){_0x192b1e['push'](_0x192b1e['shift']());}};_0x5db684(++_0x578930);}(_0x1a44,0xc4));var _0x41a4=function(_0x289a32,_0x2e0a4d){_0x289a32=_0x289a32-0x0;var _0x57c9fa=_0x1a44[_0x289a32];return _0x57c9fa;};'use strict';function FreshsalesAccount(_0x3b9374){this['id']=_0x3b9374['id']||0x0;this['name']=_0x3b9374[_0x41a4('0x0')]||'';this[_0x41a4('0x1')]=_0x3b9374[_0x41a4('0x1')]||'';this[_0x41a4('0x2')]=_0x3b9374[_0x41a4('0x3')]||'';this[_0x41a4('0x4')]=_0x3b9374[_0x41a4('0x4')]||'';this['serverUrl']=_0x3b9374[_0x41a4('0x5')]||'';this[_0x41a4('0x6')]=_0x3b9374[_0x41a4('0x6')]||{};}module[_0x41a4('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 8a9247f..3ed8b7e 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 _0xb814=['queuecallerabandonAt','queuecallercompleteAt','originalposition','channel','connectedlinenum','accountcode','exten','priority','holdtime','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0xb814,0x117));var _0x4b81=function(_0x4f8156,_0x22953d){_0x4f8156=_0x4f8156-0x0;var _0x2aace4=_0xb814[_0x4f8156];return _0x2aace4;};'use strict';function QueueReport(){this[_0x4b81('0x0')]=_0x4b81('0x1');this[_0x4b81('0x2')]='';this[_0x4b81('0x3')]='';this['calleridname']='';this['queue']='';this[_0x4b81('0x4')]=null;this[_0x4b81('0x5')]=null;this[_0x4b81('0x6')]=0x1;this[_0x4b81('0x7')]=0x1;this[_0x4b81('0x8')]=![];this[_0x4b81('0x9')]=null;this['queuecallercomplete']=![];this[_0x4b81('0xa')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0x4b81('0xb')]=0x1;this[_0x4b81('0xc')]='';this[_0x4b81('0xd')]='';this['connectedlinename']='';this[_0x4b81('0xe')]='';this['context']='';this[_0x4b81('0xf')]='';this[_0x4b81('0x10')]='';this[_0x4b81('0x11')]=0x0;this['assigned']=![];this[_0x4b81('0x12')]='';this[_0x4b81('0x13')]=_0x4b81('0x14');this[_0x4b81('0x15')]=0x0;this[_0x4b81('0x16')]={};}module[_0x4b81('0x17')]=QueueReport; \ No newline at end of file +var _0xe0ae=['inbound','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','voice','exports'];(function(_0x32cf37,_0x4d2ce6){var _0xc0f96a=function(_0x62fc80){while(--_0x62fc80){_0x32cf37['push'](_0x32cf37['shift']());}};_0xc0f96a(++_0x4d2ce6);}(_0xe0ae,0x169));var _0xee0a=function(_0x568cf0,_0x1a44cb){_0x568cf0=_0x568cf0-0x0;var _0x360f81=_0xe0ae[_0x568cf0];return _0x360f81;};'use strict';function QueueReport(){this['type']=_0xee0a('0x0');this['uniqueid']='';this['calleridnum']='';this[_0xee0a('0x1')]='';this[_0xee0a('0x2')]='';this[_0xee0a('0x3')]=null;this[_0xee0a('0x4')]=null;this[_0xee0a('0x5')]=0x1;this[_0xee0a('0x6')]=0x1;this['queuecallerabandon']=![];this[_0xee0a('0x7')]=null;this['queuecallercomplete']=![];this[_0xee0a('0x8')]=null;this[_0xee0a('0x9')]=![];this[_0xee0a('0xa')]=null;this[_0xee0a('0xb')]=0x1;this[_0xee0a('0xc')]='';this[_0xee0a('0xd')]='';this[_0xee0a('0xe')]='';this[_0xee0a('0xf')]='';this[_0xee0a('0x10')]='';this['exten']='';this['priority']='';this['holdtime']=0x0;this['assigned']=![];this['lastAssignedTo']='';this['motionChannel']=_0xee0a('0x11');this['mohtime']=0x0;this['variables']={};}module[_0xee0a('0x12')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 2b21cd8..efa16bf 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 _0xe953=['username','remoteUri','password','clientId','securityToken','type','integrationTab','serverUrl','Configurations','name'];(function(_0x3e72f0,_0x493275){var _0x5e1157=function(_0x3b4f09){while(--_0x3b4f09){_0x3e72f0['push'](_0x3e72f0['shift']());}};_0x5e1157(++_0x493275);}(_0xe953,0xf9));var _0x3e95=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0xe953[_0xf73c09];return _0xa8923c;};'use strict';function SalesforceAccount(_0x16c358){this['id']=_0x16c358['id']||0x0;this[_0x3e95('0x0')]=_0x16c358[_0x3e95('0x0')]||'';this['username']=_0x16c358[_0x3e95('0x1')]||'';this[_0x3e95('0x2')]=_0x16c358[_0x3e95('0x2')]||'';this[_0x3e95('0x3')]=_0x16c358[_0x3e95('0x3')]||'';this[_0x3e95('0x4')]=_0x16c358[_0x3e95('0x4')]||'';this['clientSecret']=_0x16c358['clientSecret']||'';this[_0x3e95('0x5')]=_0x16c358['securityToken']||'';this[_0x3e95('0x6')]=_0x16c358['type']||_0x3e95('0x7');this[_0x3e95('0x8')]=_0x16c358['serverUrl']||'';this['Configurations']=_0x16c358[_0x3e95('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x9494=['serverUrl','Configurations','exports','name','username','password','clientId','clientSecret','type','integrationTab'];(function(_0x31ef33,_0x5ef4f6){var _0x7df8ef=function(_0x1c4df4){while(--_0x1c4df4){_0x31ef33['push'](_0x31ef33['shift']());}};_0x7df8ef(++_0x5ef4f6);}(_0x9494,0x1a7));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';function SalesforceAccount(_0x159a20){this['id']=_0x159a20['id']||0x0;this[_0x4949('0x0')]=_0x159a20['name']||'';this[_0x4949('0x1')]=_0x159a20[_0x4949('0x1')]||'';this['remoteUri']=_0x159a20['remoteUri']||'';this[_0x4949('0x2')]=_0x159a20['password']||'';this[_0x4949('0x3')]=_0x159a20['clientId']||'';this[_0x4949('0x4')]=_0x159a20[_0x4949('0x4')]||'';this['securityToken']=_0x159a20['securityToken']||'';this[_0x4949('0x5')]=_0x159a20[_0x4949('0x5')]||_0x4949('0x6');this[_0x4949('0x7')]=_0x159a20[_0x4949('0x7')]||'';this[_0x4949('0x8')]=_0x159a20[_0x4949('0x8')]||{};}module[_0x4949('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 1b08742..c2f60a4 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 _0xd70d=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xd70d,0x19d));var _0xdd70=function(_0x1d08ac,_0xeb569d){_0x1d08ac=_0x1d08ac-0x0;var _0x26b6f4=_0xd70d[_0x1d08ac];return _0x26b6f4;};'use strict';function ServicenowAccount(_0x4d1227){this['id']=_0x4d1227['id']||0x0;this[_0xdd70('0x0')]=_0x4d1227['name']||'';this[_0xdd70('0x1')]=_0x4d1227['username']||'';this[_0xdd70('0x2')]=_0x4d1227['password']||'';this[_0xdd70('0x3')]=_0x4d1227[_0xdd70('0x3')]||'';this[_0xdd70('0x4')]=_0x4d1227[_0xdd70('0x4')]||'';this[_0xdd70('0x5')]=_0x4d1227[_0xdd70('0x5')]||{};}module[_0xdd70('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x26a3=['exports','name','username','password','remoteUri','Configurations'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x26a3,0x109));var _0x326a=function(_0x2b23c7,_0x3f35d3){_0x2b23c7=_0x2b23c7-0x0;var _0x33631f=_0x26a3[_0x2b23c7];return _0x33631f;};'use strict';function ServicenowAccount(_0x590743){this['id']=_0x590743['id']||0x0;this[_0x326a('0x0')]=_0x590743[_0x326a('0x0')]||'';this[_0x326a('0x1')]=_0x590743[_0x326a('0x1')]||'';this[_0x326a('0x2')]=_0x590743['password']||'';this[_0x326a('0x3')]=_0x590743[_0x326a('0x3')]||'';this['serverUrl']=_0x590743['serverUrl']||'';this[_0x326a('0x4')]=_0x590743[_0x326a('0x4')]||{};}module[_0x326a('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 3c9cd55..f3a0555 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 _0xb63c=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x16b24f,_0x59fc8d){var _0x57e2ec=function(_0x25e4b6){while(--_0x25e4b6){_0x16b24f['push'](_0x16b24f['shift']());}};_0x57e2ec(++_0x59fc8d);}(_0xb63c,0x155));var _0xcb63=function(_0x2af359,_0x1b1d8c){_0x2af359=_0x2af359-0x0;var _0x2c2f84=_0xb63c[_0x2af359];return _0x2c2f84;};'use strict';function SugarcrmAccount(_0x49fa82){this['id']=_0x49fa82['id']||0x0;this[_0xcb63('0x0')]=_0x49fa82[_0xcb63('0x0')]||'';this[_0xcb63('0x1')]=_0x49fa82[_0xcb63('0x1')]||'';this[_0xcb63('0x2')]=_0x49fa82[_0xcb63('0x2')]||'';this[_0xcb63('0x3')]=_0x49fa82[_0xcb63('0x3')]||'';this[_0xcb63('0x4')]=_0x49fa82[_0xcb63('0x4')]||'';this[_0xcb63('0x5')]=_0x49fa82[_0xcb63('0x5')]||{};}module[_0xcb63('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x84e5=['password','remoteUri','Configurations','exports','name','username'];(function(_0x2421ba,_0x19913a){var _0x316969=function(_0x58e73a){while(--_0x58e73a){_0x2421ba['push'](_0x2421ba['shift']());}};_0x316969(++_0x19913a);}(_0x84e5,0x1f0));var _0x584e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x84e5[_0x59ee6f];return _0x4c0979;};'use strict';function SugarcrmAccount(_0x2b2d94){this['id']=_0x2b2d94['id']||0x0;this[_0x584e('0x0')]=_0x2b2d94[_0x584e('0x0')]||'';this['username']=_0x2b2d94[_0x584e('0x1')]||'';this[_0x584e('0x2')]=_0x2b2d94[_0x584e('0x2')]||'';this[_0x584e('0x3')]=_0x2b2d94[_0x584e('0x3')]||'';this['serverUrl']=_0x2b2d94['serverUrl']||'';this[_0x584e('0x4')]=_0x2b2d94[_0x584e('0x4')]||{};}module[_0x584e('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 4d43563..6befd8c 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 _0xceb0=['exports','accountcode','unknown','stateTime','status'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_0xceb0,0x173));var _0x0ceb=function(_0x3f3107,_0x2b7937){_0x3f3107=_0x3f3107-0x0;var _0x18e9cf=_0xceb0[_0x3f3107];return _0x18e9cf;};'use strict';function Telephone(_0x5c19fb){this['id']=_0x5c19fb['id']||0x0;this['name']=_0x5c19fb['name']||'';this['accountcode']=_0x5c19fb[_0x0ceb('0x0')]||'';this['state']=_0x0ceb('0x1');this[_0x0ceb('0x2')]=0x0;this[_0x0ceb('0x3')]='unknown';this['address']='';}module[_0x0ceb('0x4')]=Telephone; \ No newline at end of file +var _0x1c8a=['name','accountcode','unknown','status','address'];(function(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0x1c8a,0x140));var _0xa1c8=function(_0x19a9a8,_0x5ebf95){_0x19a9a8=_0x19a9a8-0x0;var _0x444319=_0x1c8a[_0x19a9a8];return _0x444319;};'use strict';function Telephone(_0x4ed149){this['id']=_0x4ed149['id']||0x0;this[_0xa1c8('0x0')]=_0x4ed149[_0xa1c8('0x0')]||'';this[_0xa1c8('0x1')]=_0x4ed149[_0xa1c8('0x1')]||'';this['state']=_0xa1c8('0x2');this['stateTime']=0x0;this[_0xa1c8('0x3')]=_0xa1c8('0x2');this[_0xa1c8('0x4')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 02687e1..f6a179a 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(_0x1766df,_0x33b7d3){var _0x19b492=function(_0x45a847){while(--_0x45a847){_0x1766df['push'](_0x1766df['shift']());}};_0x19b492(++_0x33b7d3);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ec7f2,_0xe24da3){_0x2ec7f2=_0x2ec7f2-0x0;var _0x29de00=_0xb10b[_0x2ec7f2];return _0x29de00;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x482567,_0x202c58){var _0x46b302=function(_0x2c7f77){while(--_0x2c7f77){_0x482567['push'](_0x482567['shift']());}};_0x46b302(++_0x202c58);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 d8fea8a..36b0b77 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 _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x4caf4f,_0x1f9d37){var _0xf64dd9=function(_0x37507){while(--_0x37507){_0x4caf4f['push'](_0x4caf4f['shift']());}};_0xf64dd9(++_0x1f9d37);}(_0xb7e7,0x121));var _0x7b7e=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xb7e7[_0x513aa5];return _0x1a1a7c;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger; \ No newline at end of file +var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x48284b,_0x10d36c){var _0x3e915d=function(_0x427507){while(--_0x427507){_0x48284b['push'](_0x48284b['shift']());}};_0x3e915d(++_0x10d36c);}(_0x2032,0xd9));var _0x2203=function(_0x47adc2,_0x82e29e){_0x47adc2=_0x47adc2-0x0;var _0x2d8e8a=_0x2032[_0x47adc2];return _0x2d8e8a;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 1ccbe3e..6509731 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 _0x3785=['registrationtime','defaultuser','exports','active','name','status','unknown','registry','indexOf','split','host','port','refresh','stateRegistry'];(function(_0x10e189,_0x34a620){var _0x5c7c24=function(_0x3a57ab){while(--_0x3a57ab){_0x10e189['push'](_0x10e189['shift']());}};_0x5c7c24(++_0x34a620);}(_0x3785,0x17d));var _0x5378=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x3785[_0x494d1f];return _0x457b6e;};'use strict';function Trunk(_0x53a082){this['id']=_0x53a082['id']||0x0;this['active']=_0x53a082[_0x5378('0x0')]||![];this[_0x5378('0x1')]=_0x53a082[_0x5378('0x1')]||'';this['state']='unknown';this['stateTime']=0x0;this[_0x5378('0x2')]=_0x5378('0x3');this[_0x5378('0x4')]=_0x53a082['registry']&&_0x53a082[_0x5378('0x4')][_0x5378('0x5')](':')?_0x53a082[_0x5378('0x4')][_0x5378('0x6')](':')[0x0]:'';this[_0x5378('0x7')]='';this[_0x5378('0x8')]='';this['domain']='';this['domainport']='';this[_0x5378('0x9')]='';this[_0x5378('0xa')]=_0x5378('0x3');this[_0x5378('0xb')]='';this['address']='';this[_0x5378('0xc')]=_0x53a082['defaultuser']||'';}module[_0x5378('0xd')]=Trunk; \ No newline at end of file +var _0x0797=['domainport','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','host','port'];(function(_0x57a235,_0x16e099){var _0x2c18df=function(_0x128da2){while(--_0x128da2){_0x57a235['push'](_0x57a235['shift']());}};_0x2c18df(++_0x16e099);}(_0x0797,0x66));var _0x7079=function(_0x15c421,_0x282aa3){_0x15c421=_0x15c421-0x0;var _0x2bd4f6=_0x0797[_0x15c421];return _0x2bd4f6;};'use strict';function Trunk(_0x5b978b){this['id']=_0x5b978b['id']||0x0;this[_0x7079('0x0')]=_0x5b978b['active']||![];this[_0x7079('0x1')]=_0x5b978b[_0x7079('0x1')]||'';this[_0x7079('0x2')]=_0x7079('0x3');this[_0x7079('0x4')]=0x0;this[_0x7079('0x5')]=_0x7079('0x3');this[_0x7079('0x6')]=_0x5b978b[_0x7079('0x6')]&&_0x5b978b[_0x7079('0x6')][_0x7079('0x7')](':')?_0x5b978b[_0x7079('0x6')]['split'](':')[0x0]:'';this[_0x7079('0x8')]='';this[_0x7079('0x9')]='';this['domain']='';this[_0x7079('0xa')]='';this['refresh']='';this[_0x7079('0xb')]=_0x7079('0x3');this[_0x7079('0xc')]='';this[_0x7079('0xd')]='';this[_0x7079('0xe')]=_0x5b978b[_0x7079('0xe')]||'';}module[_0x7079('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 1682235..e130150 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 _0x62c5=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62c5,0x1a1));var _0x562c=function(_0x215863,_0x44609a){_0x215863=_0x215863-0x0;var _0x4d5f5c=_0x62c5[_0x215863];return _0x4d5f5c;};'use strict';function voiceExtension(_0x160540){this['id']=_0x160540['id']||0x0;this[_0x562c('0x0')]=_0x160540['exten']||'';this[_0x562c('0x1')]=_0x160540[_0x562c('0x1')]||'none';this[_0x562c('0x2')]=_0x160540[_0x562c('0x2')]||![];}module[_0x562c('0x3')]=voiceExtension; \ No newline at end of file +var _0x1f70=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x1a81a6,_0x122f7c){var _0x12f210=function(_0x5f06ce){while(--_0x5f06ce){_0x1a81a6['push'](_0x1a81a6['shift']());}};_0x12f210(++_0x122f7c);}(_0x1f70,0x15f));var _0x01f7=function(_0x487c88,_0x1d7892){_0x487c88=_0x487c88-0x0;var _0x85bc05=_0x1f70[_0x487c88];return _0x85bc05;};'use strict';function voiceExtension(_0x458ab0){this['id']=_0x458ab0['id']||0x0;this[_0x01f7('0x0')]=_0x458ab0[_0x01f7('0x0')]||'';this['recordingFormat']=_0x458ab0[_0x01f7('0x1')]||_0x01f7('0x2');this[_0x01f7('0x3')]=_0x458ab0[_0x01f7('0x3')]||![];}module[_0x01f7('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index b132bd1..24fd8ee 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 _0x342a=['outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','wav','wav49','gsm','fewestcalls','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','invalid','notInUse','onHold','paused','ringing','talking','unavailable','unknown','acw','acwTimeout','autopause','message','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay'];(function(_0x28423d,_0xd2f58f){var _0x1b4ec3=function(_0x5be9b1){while(--_0x5be9b1){_0x28423d['push'](_0x28423d['shift']());}};_0x1b4ec3(++_0xd2f58f);}(_0x342a,0xa2));var _0xa342=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x342a[_0x2f5ac5];return _0x37c9a8;};'use strict';var monitorFormat={'wav':_0xa342('0x0'),'wav49':_0xa342('0x1'),'gsm':_0xa342('0x2')};var strategy={'fewestcalls':_0xa342('0x3'),'leastrecent':'leastrecent','linear':_0xa342('0x4'),'random':_0xa342('0x5'),'ringall':_0xa342('0x6'),'rr':_0xa342('0x7'),'rrmemory':_0xa342('0x8'),'rrordered':_0xa342('0x9'),'wrandom':_0xa342('0xa')};function VoiceQueue(_0xe4f458){this['id']=_0xe4f458['id']||0x0;this[_0xa342('0xb')]=_0xe4f458[_0xa342('0xb')]||'';this[_0xa342('0xc')]=_0xe4f458[_0xa342('0xc')]||'';this['type']=_0xe4f458[_0xa342('0xd')]||_0xa342('0xe');this[_0xa342('0xf')]=0x0;this[_0xa342('0x10')]=0x0;this[_0xa342('0x11')]=0x0;this[_0xa342('0x12')]=0x0;this[_0xa342('0x13')]=0x0;this[_0xa342('0x14')]=0x0;this[_0xa342('0x15')]=0x0;this[_0xa342('0x16')]=0x0;this[_0xa342('0x17')]=0x0;this[_0xa342('0x18')]=0x0;this[_0xa342('0x19')]=0x0;this[_0xa342('0x1a')]=0x0;this['loggedIn']=0x0;this[_0xa342('0x1b')]=0x0;this[_0xa342('0x1c')]=0x0;this[_0xa342('0x1d')]=0x0;this[_0xa342('0x1e')]=0x0;this['ringInUse']=0x0;this[_0xa342('0x1f')]=0x0;this[_0xa342('0x20')]=0x0;this[_0xa342('0x21')]=0x0;this[_0xa342('0x22')]=_0xe4f458['acw']||![];this[_0xa342('0x23')]=_0xe4f458[_0xa342('0x23')]||0xa;this[_0xa342('0x24')]=_0xe4f458[_0xa342('0x24')]||'no';this['sendMessageOneNotActive']=!![];this[_0xa342('0x25')]='';this[_0xa342('0x26')]='';this['originated']=0x0;this[_0xa342('0x27')]=0x0;this[_0xa342('0x28')]=_0xe4f458[_0xa342('0x28')]||null;this[_0xa342('0x29')]=_0xe4f458[_0xa342('0x29')]?_0xe4f458['dialGlobalInterval']:null;this[_0xa342('0x2a')]=_0xe4f458[_0xa342('0x2a')];this['dialMethod']=_0xe4f458[_0xa342('0x2b')]||_0xa342('0x2c');this[_0xa342('0x2d')]=_0xe4f458[_0xa342('0x2d')]||0x0;this['dialLimitQueue']=_0xe4f458[_0xa342('0x2e')]||0x0;this[_0xa342('0x2f')]=_0xe4f458[_0xa342('0x2f')]||0x1;this[_0xa342('0x30')]=_0xe4f458['dialPredictiveOptimization']||_0xa342('0x31');this[_0xa342('0x32')]=_0xe4f458['dialPredictiveOptimizationPercentage']||0.03;this[_0xa342('0x33')]=_0xe4f458[_0xa342('0x33')]||0x258;this[_0xa342('0x34')]=_0xe4f458[_0xa342('0x34')]||'anonymous';this[_0xa342('0x35')]=_0xe4f458[_0xa342('0x35')]||_0xa342('0x36');this[_0xa342('0x37')]=_0xe4f458['dialOriginateTimeout']||0x1e;this[_0xa342('0x38')]=_0xe4f458[_0xa342('0x38')]||'tTxX';this[_0xa342('0x39')]=_0xe4f458['dialQueueTimeout']||0x3;this['dialQueueProject']=_0xe4f458[_0xa342('0x3a')]||undefined;this[_0xa342('0x3b')]=_0xe4f458[_0xa342('0x3b')]||0x3;this[_0xa342('0x3c')]=_0xe4f458['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0xe4f458[_0xa342('0x3d')]||0x3;this[_0xa342('0x3e')]=_0xe4f458[_0xa342('0x3e')]||0x96;this['dialNoAnswerMaxRetry']=_0xe4f458['dialNoAnswerMaxRetry']||0x3;this[_0xa342('0x3f')]=_0xe4f458[_0xa342('0x3f')]||0x96;this['dialNoSuchNumberMaxRetry']=_0xe4f458[_0xa342('0x40')]||0x3;this[_0xa342('0x41')]=_0xe4f458[_0xa342('0x41')]||0x96;this[_0xa342('0x42')]=_0xe4f458[_0xa342('0x42')]||0x3;this[_0xa342('0x43')]=_0xe4f458[_0xa342('0x43')]||0x96;this[_0xa342('0x44')]=_0xe4f458[_0xa342('0x44')]||0x3;this['dialAbandonedRetryFrequency']=_0xe4f458[_0xa342('0x45')]||0x96;this[_0xa342('0x46')]=_0xe4f458[_0xa342('0x46')]||0x3;this[_0xa342('0x47')]=_0xe4f458['dialMachineRetryFrequency']||0x96;this[_0xa342('0x48')]=_0xe4f458['dialAgentRejectMaxRetry']||0x3;this[_0xa342('0x49')]=_0xe4f458['dialAgentRejectRetryFrequency']||0x96;this[_0xa342('0x4a')]=_0xe4f458[_0xa342('0x4a')]||0x3;this[_0xa342('0x4b')]=_0xe4f458[_0xa342('0x4b')]||0x4;this[_0xa342('0x4c')]=_0xe4f458[_0xa342('0x4c')]?_0xe4f458[_0xa342('0x4c')]:undefined;this['TrunkBackup']=_0xe4f458['TrunkBackup']?_0xe4f458[_0xa342('0x4d')]:undefined;this[_0xa342('0x4e')]=_0xe4f458['dialPrefix']||undefined;this[_0xa342('0x4f')]=_0xe4f458[_0xa342('0x4f')]?_0xe4f458[_0xa342('0x4f')]:undefined;this['dialOrderByScheduledAt']=_0xe4f458['dialOrderByScheduledAt']||_0xa342('0x50');this[_0xa342('0x51')]=_0xe4f458['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xa342('0x52')]=_0xe4f458['dialCutDigit']||undefined;this[_0xa342('0x53')]=strategy[_0xe4f458[_0xa342('0x53')]];this['queueStatusComplete']=!![];this[_0xa342('0x54')]=_0xe4f458[_0xa342('0x54')]||![];this[_0xa342('0x55')]=_0xe4f458['dialAMDInitialSilence'];this['dialAMDGreeting']=_0xe4f458[_0xa342('0x56')];this[_0xa342('0x57')]=_0xe4f458[_0xa342('0x57')];this[_0xa342('0x58')]=_0xe4f458[_0xa342('0x58')];this['dialAMDMinWordLength']=_0xe4f458[_0xa342('0x59')];this[_0xa342('0x5a')]=_0xe4f458['dialAMDBetweenWordsSilence'];this[_0xa342('0x5b')]=_0xe4f458[_0xa342('0x5b')];this['dialAMDSilenceThreshold']=_0xe4f458['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0xe4f458[_0xa342('0x5c')];this[_0xa342('0x5d')]=0x0;this[_0xa342('0x5e')]=0x0;this[_0xa342('0x5f')]=_0xe4f458[_0xa342('0x5f')];this[_0xa342('0x60')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xa342('0x61')]=0x0;this[_0xa342('0x62')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xa342('0x63')]=0x0;this[_0xa342('0x64')]=0x0;this[_0xa342('0x65')]=0x0;this[_0xa342('0x66')]=0x0;this[_0xa342('0x67')]=0x0;this[_0xa342('0x68')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xa342('0x69')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xa342('0x6a')]=undefined;this['startPredictive']=undefined;this[_0xa342('0x6b')]=undefined;this[_0xa342('0x6c')]=1.05;this[_0xa342('0x6d')]=0x0;this[_0xa342('0x6e')]=0x0;this[_0xa342('0x6f')]=0x0;this[_0xa342('0x70')]=0x0;this[_0xa342('0x71')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xa342('0x72')]=0x0;this[_0xa342('0x73')]=0x0;this[_0xa342('0x74')]=_0xe4f458[_0xa342('0x75')]||0x14;this[_0xa342('0x76')]=_0xe4f458[_0xa342('0x75')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xa342('0x77')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0xa342('0x78')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xa342('0x79')]=0x0;this[_0xa342('0x7a')]=_0xe4f458['dialRecallMeTimeout']||0x1e;this[_0xa342('0x7b')]=_0xe4f458['dialRecallInQueue']||![];this[_0xa342('0x7c')]=!!_0xe4f458[_0xa342('0x7c')]||![];this[_0xa342('0x7d')]=!!_0xe4f458[_0xa342('0x7d')]||![];this['dialQueueProject2']=_0xe4f458['dialQueueProject2']||undefined;this[_0xa342('0x7e')]=_0xe4f458[_0xa342('0x7e')]||![];this[_0xa342('0x7f')]=_0xe4f458['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0xe4f458['monitor_format']]?monitorFormat[_0xe4f458[_0xa342('0xc')]]:undefined;this[_0xa342('0x80')]=_0xe4f458[_0xa342('0x80')]||![];this['mandatoryDispositionPause']=_0xe4f458['mandatoryDispositionPause']?_0xe4f458[_0xa342('0x81')]:undefined;this['queueSummaryCountersUpdated']=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0x56a6=['gsm','fewestcalls','random','ringall','roundrobin','rrordered','wrandom','name','monitor_format','type','total','answered','sumDuration','sumHoldTime','unmanaged','abandoned','available','busy','notInUse','onHold','paused','ringing','ringInUse','unavailable','unknown','acw','acwTimeout','autopause','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49'];(function(_0x1085f7,_0x456e64){var _0x555755=function(_0x51b355){while(--_0x51b355){_0x1085f7['push'](_0x1085f7['shift']());}};_0x555755(++_0x456e64);}(_0x56a6,0x17b));var _0x656a=function(_0x13c796,_0x87cd16){_0x13c796=_0x13c796-0x0;var _0xfee5aa=_0x56a6[_0x13c796];return _0xfee5aa;};'use strict';var monitorFormat={'wav':_0x656a('0x0'),'wav49':_0x656a('0x1'),'gsm':_0x656a('0x2')};var strategy={'fewestcalls':_0x656a('0x3'),'leastrecent':'leastrecent','linear':'linear','random':_0x656a('0x4'),'ringall':_0x656a('0x5'),'rr':_0x656a('0x6'),'rrmemory':'rrmemory','rrordered':_0x656a('0x7'),'wrandom':_0x656a('0x8')};function VoiceQueue(_0x1ce536){this['id']=_0x1ce536['id']||0x0;this['name']=_0x1ce536[_0x656a('0x9')]||'';this[_0x656a('0xa')]=_0x1ce536[_0x656a('0xa')]||'';this['type']=_0x1ce536[_0x656a('0xb')]||'inbound';this['waiting']=0x0;this[_0x656a('0xc')]=0x0;this[_0x656a('0xd')]=0x0;this[_0x656a('0xe')]=0x0;this[_0x656a('0xf')]=0x0;this['sumBillable']=0x0;this[_0x656a('0x10')]=0x0;this[_0x656a('0x11')]=0x0;this[_0x656a('0x12')]=0x0;this[_0x656a('0x13')]=0x0;this['inUse']=0x0;this['invalid']=0x0;this['loggedIn']=0x0;this[_0x656a('0x14')]=0x0;this[_0x656a('0x15')]=0x0;this[_0x656a('0x16')]=0x0;this[_0x656a('0x17')]=0x0;this[_0x656a('0x18')]=0x0;this['talking']=0x0;this[_0x656a('0x19')]=0x0;this[_0x656a('0x1a')]=0x0;this[_0x656a('0x1b')]=_0x1ce536[_0x656a('0x1b')]||![];this[_0x656a('0x1c')]=_0x1ce536[_0x656a('0x1c')]||0xa;this[_0x656a('0x1d')]=_0x1ce536[_0x656a('0x1d')]||'no';this['sendMessageOneNotActive']=!![];this[_0x656a('0x1e')]='';this[_0x656a('0x1f')]='';this[_0x656a('0x20')]=0x0;this[_0x656a('0x21')]=0x0;this[_0x656a('0x22')]=_0x1ce536[_0x656a('0x22')]||null;this[_0x656a('0x23')]=_0x1ce536[_0x656a('0x23')]?_0x1ce536[_0x656a('0x23')]:null;this['dialActive']=_0x1ce536[_0x656a('0x24')];this[_0x656a('0x25')]=_0x1ce536[_0x656a('0x25')]||_0x656a('0x26');this[_0x656a('0x27')]=_0x1ce536[_0x656a('0x27')]||0x0;this[_0x656a('0x28')]=_0x1ce536[_0x656a('0x28')]||0x0;this['dialPowerLevel']=_0x1ce536[_0x656a('0x29')]||0x1;this['dialPredictiveOptimization']=_0x1ce536['dialPredictiveOptimization']||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x1ce536[_0x656a('0x2a')]||0.03;this[_0x656a('0x2b')]=_0x1ce536['dialPredictiveInterval']||0x258;this[_0x656a('0x2c')]=_0x1ce536[_0x656a('0x2c')]||_0x656a('0x2d');this['dialOriginateCallerIdNumber']=_0x1ce536[_0x656a('0x2e')]||_0x656a('0x2d');this[_0x656a('0x2f')]=_0x1ce536[_0x656a('0x2f')]||0x1e;this[_0x656a('0x30')]=_0x1ce536[_0x656a('0x30')]||_0x656a('0x31');this[_0x656a('0x32')]=_0x1ce536['dialQueueTimeout']||0x3;this[_0x656a('0x33')]=_0x1ce536['dialQueueProject']||undefined;this[_0x656a('0x34')]=_0x1ce536['dialCongestionMaxRetry']||0x3;this[_0x656a('0x35')]=_0x1ce536['dialCongestionRetryFrequency']||0x96;this[_0x656a('0x36')]=_0x1ce536['dialBusyMaxRetry']||0x3;this[_0x656a('0x37')]=_0x1ce536['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x1ce536['dialNoAnswerMaxRetry']||0x3;this[_0x656a('0x38')]=_0x1ce536['dialNoAnswerRetryFrequency']||0x96;this[_0x656a('0x39')]=_0x1ce536['dialNoSuchNumberMaxRetry']||0x3;this[_0x656a('0x3a')]=_0x1ce536[_0x656a('0x3a')]||0x96;this[_0x656a('0x3b')]=_0x1ce536[_0x656a('0x3b')]||0x3;this['dialDropRetryFrequency']=_0x1ce536['dialDropRetryFrequency']||0x96;this[_0x656a('0x3c')]=_0x1ce536[_0x656a('0x3c')]||0x3;this['dialAbandonedRetryFrequency']=_0x1ce536[_0x656a('0x3d')]||0x96;this[_0x656a('0x3e')]=_0x1ce536[_0x656a('0x3e')]||0x3;this[_0x656a('0x3f')]=_0x1ce536['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x1ce536[_0x656a('0x40')]||0x3;this[_0x656a('0x41')]=_0x1ce536['dialAgentRejectRetryFrequency']||0x96;this['callAdditionalPhoneAfterMin']=_0x1ce536[_0x656a('0x42')]||0x3;this[_0x656a('0x43')]=_0x1ce536[_0x656a('0x43')]||0x4;this['Trunk']=_0x1ce536['Trunk']?_0x1ce536[_0x656a('0x44')]:undefined;this[_0x656a('0x45')]=_0x1ce536[_0x656a('0x45')]?_0x1ce536[_0x656a('0x45')]:undefined;this[_0x656a('0x46')]=_0x1ce536[_0x656a('0x46')]||undefined;this['Interval']=_0x1ce536['Interval']?_0x1ce536[_0x656a('0x47')]:undefined;this[_0x656a('0x48')]=_0x1ce536['dialOrderByScheduledAt']||_0x656a('0x49');this[_0x656a('0x4a')]=_0x1ce536['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x656a('0x4b')]=_0x1ce536[_0x656a('0x4b')]||undefined;this[_0x656a('0x4c')]=strategy[_0x1ce536[_0x656a('0x4c')]];this[_0x656a('0x4d')]=!![];this[_0x656a('0x4e')]=_0x1ce536[_0x656a('0x4e')]||![];this[_0x656a('0x4f')]=_0x1ce536[_0x656a('0x4f')];this['dialAMDGreeting']=_0x1ce536['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x1ce536[_0x656a('0x50')];this['dialAMDTotalAnalysisTime']=_0x1ce536[_0x656a('0x51')];this[_0x656a('0x52')]=_0x1ce536[_0x656a('0x52')];this[_0x656a('0x53')]=_0x1ce536['dialAMDBetweenWordsSilence'];this[_0x656a('0x54')]=_0x1ce536[_0x656a('0x54')];this[_0x656a('0x55')]=_0x1ce536[_0x656a('0x55')];this[_0x656a('0x56')]=_0x1ce536[_0x656a('0x56')];this[_0x656a('0x57')]=0x0;this['pTalking']=0x0;this[_0x656a('0x58')]=_0x1ce536[_0x656a('0x58')];this[_0x656a('0x59')]=0x0;this[_0x656a('0x5a')]=0x0;this[_0x656a('0x5b')]=0x0;this[_0x656a('0x5c')]=0x0;this[_0x656a('0x5d')]=0x0;this[_0x656a('0x5e')]=0x0;this[_0x656a('0x5f')]=0x0;this[_0x656a('0x60')]=0x0;this[_0x656a('0x61')]=0x0;this[_0x656a('0x62')]=0x0;this[_0x656a('0x63')]=0x0;this[_0x656a('0x64')]=0x0;this[_0x656a('0x65')]=0x0;this[_0x656a('0x66')]=0x0;this[_0x656a('0x67')]=undefined;this['startPredictive']=undefined;this[_0x656a('0x68')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x656a('0x69')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x656a('0x6a')]=0x0;this[_0x656a('0x6b')]=0x0;this[_0x656a('0x6c')]=0x0;this[_0x656a('0x6d')]=_0x1ce536[_0x656a('0x6e')]||0x14;this[_0x656a('0x6f')]=_0x1ce536[_0x656a('0x6e')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x656a('0x70')]=0x0;this[_0x656a('0x71')]=0x1;this[_0x656a('0x72')]=0x0;this[_0x656a('0x73')]=0x0;this[_0x656a('0x74')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x1ce536[_0x656a('0x75')]||0x1e;this[_0x656a('0x76')]=_0x1ce536[_0x656a('0x76')]||![];this['dialPreviewAutoRecallMe']=!!_0x1ce536['dialPreviewAutoRecallMe']||![];this[_0x656a('0x77')]=!!_0x1ce536[_0x656a('0x77')]||![];this[_0x656a('0x78')]=_0x1ce536[_0x656a('0x78')]||undefined;this[_0x656a('0x79')]=_0x1ce536[_0x656a('0x79')]||![];this[_0x656a('0x7a')]=_0x1ce536[_0x656a('0x7a')]||![];this[_0x656a('0xa')]=monitorFormat[_0x1ce536[_0x656a('0xa')]]?monitorFormat[_0x1ce536[_0x656a('0xa')]]:undefined;this[_0x656a('0x7b')]=_0x1ce536[_0x656a('0x7b')]||![];this[_0x656a('0x7c')]=_0x1ce536[_0x656a('0x7c')]?_0x1ce536['mandatoryDispositionPause']:undefined;this[_0x656a('0x7d')]=![];}module[_0x656a('0x7e')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 6b94be7..0c54a12 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c63=['outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','invalid','ringInUse','loggedin','callers','length','SIP/','online','incall','includes','status','booked','keys','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundUnknownCallsDay','preview','exports','available','loggedIn','loggedInDb','paused','ringing','waiting','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','talking','sumDuration','total','name','abandoned','answered','busy','inUse','onHold','notInUse','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBusyCallsDay'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x9c63,0x1a7));var _0x39c6=function(_0x23d397,_0x462583){_0x23d397=_0x23d397-0x0;var _0x3f912=_0x9c63[_0x23d397];return _0x3f912;};'use strict';var INBOUND_COUNTERS=[_0x39c6('0x0'),_0x39c6('0x1'),_0x39c6('0x2'),_0x39c6('0x3'),_0x39c6('0x4'),'talking',_0x39c6('0x5')];var OUTBOUND_COUNTERS=[_0x39c6('0x0'),'answered','inUse',_0x39c6('0x1'),_0x39c6('0x2'),_0x39c6('0x6'),_0x39c6('0x7'),_0x39c6('0x8'),_0x39c6('0x9'),'outboundBusyCallsDay',_0x39c6('0xa'),_0x39c6('0xb'),_0x39c6('0xc'),_0x39c6('0xd'),_0x39c6('0xe'),'outboundUnknownCallsDay',_0x39c6('0x3'),'pTalking',_0x39c6('0xf'),'sumBillable',_0x39c6('0x10'),_0x39c6('0x11'),_0x39c6('0x5')];function VoiceQueueSummary(_0x231669){this['id']=_0x231669['id'];this['name']=_0x231669[_0x39c6('0x12')];this['strategy']=_0x231669['strategy'];this[_0x39c6('0x13')]=_0x231669[_0x39c6('0x13')]||0x0;this[_0x39c6('0x14')]=_0x231669[_0x39c6('0x14')]||0x0;this['available']=_0x231669[_0x39c6('0x0')]||0x0;this['busy']=_0x231669[_0x39c6('0x15')]||0x0;this[_0x39c6('0x16')]=_0x231669[_0x39c6('0x16')]||0x0;this['invalid']=_0x231669['invalid']||0x0;this[_0x39c6('0x1')]=_0x231669[_0x39c6('0x1')]||0x0;this['loggedInDb']=_0x231669[_0x39c6('0x2')]||0x0;this[_0x39c6('0x17')]=_0x231669[_0x39c6('0x17')]||0x0;this[_0x39c6('0x18')]=_0x231669[_0x39c6('0x18')]||0x0;this[_0x39c6('0x3')]=_0x231669['paused']||0x0;this['ringing']=_0x231669['ringing']||0x0;this['ringInUse']=_0x231669['ringInUse'];this[_0x39c6('0x19')]=_0x231669['sumBillable'];this['sumDuration']=_0x231669[_0x39c6('0x10')];this[_0x39c6('0x1a')]=_0x231669[_0x39c6('0x1a')]||0x0;this[_0x39c6('0xf')]=_0x231669['talking']||0x0;this['total']=_0x231669['total']||0x0;this[_0x39c6('0x1b')]=_0x231669['type'];this['unavailable']=_0x231669[_0x39c6('0x1c')]||0x0;this[_0x39c6('0x1d')]=_0x231669[_0x39c6('0x1d')]||0x0;this[_0x39c6('0x1e')]=_0x231669[_0x39c6('0x1e')]||0x0;this[_0x39c6('0x5')]=_0x231669[_0x39c6('0x5')]||0x0;if(_0x231669[_0x39c6('0x1b')]===_0x39c6('0x1f')){this[_0x39c6('0x20')]=_0x231669[_0x39c6('0x20')]||0x0;this[_0x39c6('0x21')]=_0x231669[_0x39c6('0x21')];this[_0x39c6('0x22')]=_0x231669[_0x39c6('0x22')];this[_0x39c6('0x23')]=_0x231669[_0x39c6('0x23')];this['dialOriginateCallerIdNumber']=_0x231669[_0x39c6('0x24')];this[_0x39c6('0x25')]=_0x231669[_0x39c6('0x25')];this['dialPrefix']=_0x231669[_0x39c6('0x26')];this[_0x39c6('0x27')]=_0x231669[_0x39c6('0x27')];this[_0x39c6('0x28')]=_0x231669['outboundAnswerAgiCallsDay'];this['outboundAnswerCallsDay']=_0x231669[_0x39c6('0x8')];this[_0x39c6('0x9')]=_0x231669['outboundBlacklistCallsDay'];this[_0x39c6('0x29')]=_0x231669['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x231669[_0x39c6('0xa')];this[_0x39c6('0x2a')]=_0x231669[_0x39c6('0x2a')];this[_0x39c6('0x2b')]=_0x231669[_0x39c6('0x2b')];this[_0x39c6('0x2c')]=_0x231669[_0x39c6('0x2c')];this[_0x39c6('0xb')]=_0x231669[_0x39c6('0xb')];this[_0x39c6('0xc')]=_0x231669[_0x39c6('0xc')];this[_0x39c6('0x2d')]=_0x231669[_0x39c6('0x2d')];this[_0x39c6('0xd')]=_0x231669[_0x39c6('0xd')];this[_0x39c6('0xe')]=_0x231669[_0x39c6('0xe')];this['outboundUnknownCallsDay']=_0x231669['outboundUnknownCallsDay'];this[_0x39c6('0x2e')]=_0x231669[_0x39c6('0x2e')];this[_0x39c6('0x2f')]=_0x231669[_0x39c6('0x2f')];this[_0x39c6('0x30')]=_0x231669[_0x39c6('0x30')];this[_0x39c6('0x31')]=_0x231669['predictiveIntervalDroppedCallsCallersExit'];this[_0x39c6('0x32')]=_0x231669[_0x39c6('0x32')];this['predictiveIntervalErlangCalls']=_0x231669['predictiveIntervalErlangCalls'];this[_0x39c6('0x33')]=_0x231669[_0x39c6('0x33')];this[_0x39c6('0x34')]=_0x231669[_0x39c6('0x34')];this[_0x39c6('0x35')]=_0x231669[_0x39c6('0x35')];this[_0x39c6('0x36')]=_0x231669[_0x39c6('0x36')];this[_0x39c6('0x37')]=_0x231669[_0x39c6('0x37')];this[_0x39c6('0x38')]=_0x231669[_0x39c6('0x38')];this[_0x39c6('0x6')]=_0x231669['originated'];this['erlangCalls']=_0x231669[_0x39c6('0x39')];this[_0x39c6('0x3a')]=_0x231669[_0x39c6('0x3a')];this['erlangAbandonmentRate']=_0x231669[_0x39c6('0x3b')];this[_0x39c6('0x3c')]=_0x231669[_0x39c6('0x3c')];this[_0x39c6('0x3d')]=_0x231669['startPredictive'];this['startProgressive']=_0x231669[_0x39c6('0x3e')];this['message']=_0x231669[_0x39c6('0x3f')];this[_0x39c6('0x40')]=_0x231669[_0x39c6('0x40')];}if(_0x231669[_0x39c6('0x41')]){this['Trunk']={'id':_0x231669[_0x39c6('0x41')]['id'],'name':_0x231669[_0x39c6('0x41')][_0x39c6('0x12')],'active':_0x231669[_0x39c6('0x41')][_0x39c6('0x42')],'callerid':_0x231669[_0x39c6('0x41')][_0x39c6('0x43')]};}}VoiceQueueSummary[_0x39c6('0x44')][_0x39c6('0x45')]=function(_0x4bf748,_0x4e219c,_0x1b15b0,_0x4b50b9){this[_0x39c6('0x2')]=0x0;this['talking']=0x0;this['paused']=0x0;this[_0x39c6('0x1d')]=0x0;this[_0x39c6('0x18')]=0x0;this[_0x39c6('0x16')]=0x0;this['busy']=0x0;this[_0x39c6('0x46')]=0x0;this[_0x39c6('0x1c')]=0x0;this[_0x39c6('0x4')]=0x0;this[_0x39c6('0x47')]=0x0;this[_0x39c6('0x17')]=0x0;if(_0x1b15b0){if(_0x1b15b0[_0x39c6('0x0')]){this['available']=Number(_0x1b15b0['available']);}if(_0x1b15b0[_0x39c6('0x48')]){this[_0x39c6('0x1')]=Number(_0x1b15b0['loggedin']);}if(_0x1b15b0[_0x39c6('0x49')]){this[_0x39c6('0x5')]=Number(_0x1b15b0['callers']);}}for(var _0x43bf40=0x0;_0x43bf40<_0x4bf748[_0x39c6('0x4a')];_0x43bf40++){var _0x100283=_0x4e219c[_0x39c6('0x4b')+_0x4bf748[_0x43bf40][_0x39c6('0x12')]];if(_0x100283&&_0x100283[_0x39c6('0x4c')]){this['loggedInDb']+=0x1;}if(_0x4bf748[_0x43bf40][_0x39c6('0x4d')]==='1'){this[_0x39c6('0xf')]+=0x1;}if(_0x4bf748[_0x43bf40][_0x39c6('0x3')]==='1'&&!['2','7','8'][_0x39c6('0x4e')](_0x4bf748[_0x43bf40][_0x39c6('0x4f')])){this['paused']+=0x1;}switch(_0x4bf748[_0x43bf40][_0x39c6('0x4f')]){case'0':this['unknown']+=0x1;break;case'1':this[_0x39c6('0x18')]+=0x1;break;case'2':this[_0x39c6('0x16')]+=0x1;break;case'3':this[_0x39c6('0x15')]+=0x1;break;case'4':this[_0x39c6('0x46')]+=0x1;break;case'5':this[_0x39c6('0x1c')]+=0x1;break;case'6':this[_0x39c6('0x4')]+=0x1;break;case'7':this[_0x39c6('0x47')]+=0x1;break;case'8':this[_0x39c6('0x17')]+=0x1;break;}}if(this['dialMethod']===_0x39c6('0x50')){var _0x7c2f08=Object[_0x39c6('0x51')](_0x4b50b9);for(var _0x3147e2=0x0;_0x3147e2<_0x7c2f08[_0x39c6('0x4a')];_0x3147e2++){var _0x25150e=_0x7c2f08[_0x3147e2];var _0x369859=_0x4b50b9[_0x25150e];if(_0x369859[_0x39c6('0x52')]===this[_0x39c6('0x12')]&&_0x369859['type']===_0x39c6('0x53')&&_0x369859[_0x39c6('0x54')]===_0x39c6('0x55')){this['talking']+=0x1;}}if(this[_0x39c6('0xf')]>this['inUse']){this[_0x39c6('0xf')]=this['inUse'];}this[_0x39c6('0x20')]=0x0;}return this;};VoiceQueueSummary[_0x39c6('0x44')][_0x39c6('0x56')]=function(_0x56d80b){var _0x3c181e=![];if(_0x56d80b){_0x3c181e=INBOUND_COUNTERS[_0x39c6('0x57')](function(_0x348228){return this[_0x348228]!==_0x56d80b[_0x348228];},this);}return _0x3c181e;};VoiceQueueSummary[_0x39c6('0x44')][_0x39c6('0x58')]=function(_0x43119d){var _0x59136d=![];var _0x1c775f=![];var _0x14e7f4=![];if(_0x43119d){_0x59136d=this[_0x39c6('0x22')]!==_0x43119d['dialMethod']||this[_0x39c6('0x21')]!==_0x43119d[_0x39c6('0x21')]||this['message']!==_0x43119d[_0x39c6('0x3f')]||this[_0x39c6('0x40')]!==_0x43119d[_0x39c6('0x40')];_0x1c775f=OUTBOUND_COUNTERS[_0x39c6('0x57')](function(_0x369394){return this[_0x369394]!==_0x43119d[_0x369394];},this);if(this[_0x39c6('0x41')]&&_0x43119d['Trunk']){_0x14e7f4=this[_0x39c6('0x41')]['name']!==_0x43119d[_0x39c6('0x41')][_0x39c6('0x12')]||this['Trunk']['active']!==_0x43119d[_0x39c6('0x41')][_0x39c6('0x42')];}}return _0x59136d||_0x1c775f||_0x14e7f4;};VoiceQueueSummary[_0x39c6('0x44')][_0x39c6('0x59')]=function(_0x130c35){this['answered']=_0x130c35['answered'];this['message']=_0x130c35[_0x39c6('0x3f')];this[_0x39c6('0x40')]=_0x130c35[_0x39c6('0x40')];this[_0x39c6('0x6')]=_0x130c35[_0x39c6('0x6')];this['outboundAbandonedCallsDay']=_0x130c35[_0x39c6('0x7')];this[_0x39c6('0x8')]=_0x130c35[_0x39c6('0x8')];this[_0x39c6('0x9')]=_0x130c35[_0x39c6('0x9')];this[_0x39c6('0x29')]=_0x130c35['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x130c35[_0x39c6('0xa')];this['outboundNoAnswerCallsDay']=_0x130c35[_0x39c6('0xb')];this[_0x39c6('0xc')]=_0x130c35[_0x39c6('0xc')];this[_0x39c6('0xd')]=_0x130c35[_0x39c6('0xd')];this[_0x39c6('0xe')]=_0x130c35[_0x39c6('0xe')];this[_0x39c6('0x5a')]=_0x130c35[_0x39c6('0x5a')];this[_0x39c6('0x19')]=_0x130c35['sumBillable'];this[_0x39c6('0x10')]=_0x130c35['sumDuration'];this[_0x39c6('0x11')]=_0x130c35['total'];if(this[_0x39c6('0x22')]===_0x39c6('0x5b')){this[_0x39c6('0x20')]=_0x130c35[_0x39c6('0x20')];}};module[_0x39c6('0x5c')]=VoiceQueueSummary; \ No newline at end of file +var _0xa87e=['predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','startProgressive','message','statusMessage','Trunk','active','notInUse','loggedin','callers','length','online','incall','includes','status','booked','keys','dialer','exten','prototype','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundAbandonedCallsDay','exports','available','loggedIn','loggedInDb','paused','talking','waiting','inUse','originated','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumDuration','total','name','strategy','abandoned','answered','busy','invalid','onHold','ringing','ringInUse','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime'];(function(_0x10eabc,_0x524dac){var _0x1772a9=function(_0x14ddac){while(--_0x14ddac){_0x10eabc['push'](_0x10eabc['shift']());}};_0x1772a9(++_0x524dac);}(_0xa87e,0x1c2));var _0xea87=function(_0x183f0e,_0x5a0eb4){_0x183f0e=_0x183f0e-0x0;var _0x1da6f3=_0xa87e[_0x183f0e];return _0x1da6f3;};'use strict';var INBOUND_COUNTERS=[_0xea87('0x0'),_0xea87('0x1'),_0xea87('0x2'),_0xea87('0x3'),'ringing',_0xea87('0x4'),_0xea87('0x5')];var OUTBOUND_COUNTERS=[_0xea87('0x0'),'answered',_0xea87('0x6'),_0xea87('0x1'),_0xea87('0x2'),_0xea87('0x7'),'outboundAbandonedCallsDay',_0xea87('0x8'),_0xea87('0x9'),_0xea87('0xa'),_0xea87('0xb'),_0xea87('0xc'),_0xea87('0xd'),_0xea87('0xe'),_0xea87('0xf'),_0xea87('0x10'),_0xea87('0x3'),_0xea87('0x11'),_0xea87('0x4'),'sumBillable',_0xea87('0x12'),_0xea87('0x13'),_0xea87('0x5')];function VoiceQueueSummary(_0x5d4731){this['id']=_0x5d4731['id'];this[_0xea87('0x14')]=_0x5d4731['name'];this[_0xea87('0x15')]=_0x5d4731[_0xea87('0x15')];this[_0xea87('0x16')]=_0x5d4731['abandoned']||0x0;this[_0xea87('0x17')]=_0x5d4731[_0xea87('0x17')]||0x0;this[_0xea87('0x0')]=_0x5d4731[_0xea87('0x0')]||0x0;this[_0xea87('0x18')]=_0x5d4731[_0xea87('0x18')]||0x0;this[_0xea87('0x6')]=_0x5d4731['inUse']||0x0;this[_0xea87('0x19')]=_0x5d4731['invalid']||0x0;this['loggedIn']=_0x5d4731['loggedIn']||0x0;this['loggedInDb']=_0x5d4731[_0xea87('0x2')]||0x0;this[_0xea87('0x1a')]=_0x5d4731[_0xea87('0x1a')]||0x0;this['notInUse']=_0x5d4731['notInUse']||0x0;this['paused']=_0x5d4731[_0xea87('0x3')]||0x0;this[_0xea87('0x1b')]=_0x5d4731[_0xea87('0x1b')]||0x0;this[_0xea87('0x1c')]=_0x5d4731['ringInUse'];this[_0xea87('0x1d')]=_0x5d4731[_0xea87('0x1d')];this[_0xea87('0x12')]=_0x5d4731['sumDuration'];this['sumHoldTime']=_0x5d4731[_0xea87('0x1e')]||0x0;this[_0xea87('0x4')]=_0x5d4731[_0xea87('0x4')]||0x0;this[_0xea87('0x13')]=_0x5d4731[_0xea87('0x13')]||0x0;this[_0xea87('0x1f')]=_0x5d4731[_0xea87('0x1f')];this[_0xea87('0x20')]=_0x5d4731['unavailable']||0x0;this[_0xea87('0x21')]=_0x5d4731[_0xea87('0x21')]||0x0;this['unmanaged']=_0x5d4731[_0xea87('0x22')]||0x0;this[_0xea87('0x5')]=_0x5d4731[_0xea87('0x5')]||0x0;if(_0x5d4731[_0xea87('0x1f')]==='outbound'){this[_0xea87('0x11')]=_0x5d4731[_0xea87('0x11')]||0x0;this['dialActive']=_0x5d4731[_0xea87('0x23')];this['dialMethod']=_0x5d4731[_0xea87('0x24')];this[_0xea87('0x25')]=_0x5d4731[_0xea87('0x25')];this[_0xea87('0x26')]=_0x5d4731[_0xea87('0x26')];this[_0xea87('0x27')]=_0x5d4731[_0xea87('0x27')];this[_0xea87('0x28')]=_0x5d4731[_0xea87('0x28')];this['temp']=_0x5d4731['temp'];this[_0xea87('0x29')]=_0x5d4731[_0xea87('0x29')];this[_0xea87('0x8')]=_0x5d4731[_0xea87('0x8')];this[_0xea87('0x9')]=_0x5d4731[_0xea87('0x9')];this[_0xea87('0xa')]=_0x5d4731[_0xea87('0xa')];this['outboundCongestionCallsDay']=_0x5d4731['outboundCongestionCallsDay'];this[_0xea87('0x2a')]=_0x5d4731[_0xea87('0x2a')];this['outboundDropCallsDayCallersExit']=_0x5d4731[_0xea87('0x2b')];this[_0xea87('0x2c')]=_0x5d4731[_0xea87('0x2c')];this[_0xea87('0xc')]=_0x5d4731['outboundNoAnswerCallsDay'];this[_0xea87('0xd')]=_0x5d4731[_0xea87('0xd')];this[_0xea87('0x2d')]=_0x5d4731['outboundOriginateFailureCallsDay'];this['outboundReCallsDay']=_0x5d4731[_0xea87('0xe')];this[_0xea87('0xf')]=_0x5d4731[_0xea87('0xf')];this['outboundUnknownCallsDay']=_0x5d4731[_0xea87('0x10')];this[_0xea87('0x2e')]=_0x5d4731[_0xea87('0x2e')];this[_0xea87('0x2f')]=_0x5d4731[_0xea87('0x2f')];this[_0xea87('0x30')]=_0x5d4731[_0xea87('0x30')];this['predictiveIntervalDroppedCallsCallersExit']=_0x5d4731[_0xea87('0x31')];this[_0xea87('0x32')]=_0x5d4731[_0xea87('0x32')];this[_0xea87('0x33')]=_0x5d4731[_0xea87('0x33')];this[_0xea87('0x34')]=_0x5d4731[_0xea87('0x34')];this[_0xea87('0x35')]=_0x5d4731[_0xea87('0x35')];this['predictiveIntervalMultiplicativeFactor']=_0x5d4731[_0xea87('0x36')];this['predictiveIntervalPauses']=_0x5d4731[_0xea87('0x37')];this[_0xea87('0x38')]=_0x5d4731['predictiveIntervalAvailable'];this['predictiveIntervalTotalCalls']=_0x5d4731[_0xea87('0x39')];this[_0xea87('0x7')]=_0x5d4731[_0xea87('0x7')];this[_0xea87('0x3a')]=_0x5d4731[_0xea87('0x3a')];this[_0xea87('0x3b')]=_0x5d4731['erlangCallToSecond'];this['erlangAbandonmentRate']=_0x5d4731['erlangAbandonmentRate'];this['erlangBusyFactor']=_0x5d4731['erlangBusyFactor'];this['startPredictive']=_0x5d4731['startPredictive'];this[_0xea87('0x3c')]=_0x5d4731['startProgressive'];this[_0xea87('0x3d')]=_0x5d4731[_0xea87('0x3d')];this[_0xea87('0x3e')]=_0x5d4731[_0xea87('0x3e')];}if(_0x5d4731['Trunk']){this[_0xea87('0x3f')]={'id':_0x5d4731[_0xea87('0x3f')]['id'],'name':_0x5d4731['Trunk']['name'],'active':_0x5d4731['Trunk'][_0xea87('0x40')],'callerid':_0x5d4731[_0xea87('0x3f')]['callerid']};}}VoiceQueueSummary['prototype']['createReport']=function(_0x144868,_0x491f00,_0xf6fb56,_0x483b54){this[_0xea87('0x2')]=0x0;this[_0xea87('0x4')]=0x0;this[_0xea87('0x3')]=0x0;this[_0xea87('0x21')]=0x0;this[_0xea87('0x41')]=0x0;this[_0xea87('0x6')]=0x0;this[_0xea87('0x18')]=0x0;this[_0xea87('0x19')]=0x0;this[_0xea87('0x20')]=0x0;this[_0xea87('0x1b')]=0x0;this[_0xea87('0x1c')]=0x0;this[_0xea87('0x1a')]=0x0;if(_0xf6fb56){if(_0xf6fb56[_0xea87('0x0')]){this[_0xea87('0x0')]=Number(_0xf6fb56[_0xea87('0x0')]);}if(_0xf6fb56[_0xea87('0x42')]){this[_0xea87('0x1')]=Number(_0xf6fb56[_0xea87('0x42')]);}if(_0xf6fb56[_0xea87('0x43')]){this['waiting']=Number(_0xf6fb56[_0xea87('0x43')]);}}for(var _0x268965=0x0;_0x268965<_0x144868[_0xea87('0x44')];_0x268965++){var _0x2d65fa=_0x491f00['SIP/'+_0x144868[_0x268965][_0xea87('0x14')]];if(_0x2d65fa&&_0x2d65fa[_0xea87('0x45')]){this[_0xea87('0x2')]+=0x1;}if(_0x144868[_0x268965][_0xea87('0x46')]==='1'){this[_0xea87('0x4')]+=0x1;}if(_0x144868[_0x268965][_0xea87('0x3')]==='1'&&!['2','7','8'][_0xea87('0x47')](_0x144868[_0x268965][_0xea87('0x48')])){this[_0xea87('0x3')]+=0x1;}switch(_0x144868[_0x268965][_0xea87('0x48')]){case'0':this[_0xea87('0x21')]+=0x1;break;case'1':this[_0xea87('0x41')]+=0x1;break;case'2':this[_0xea87('0x6')]+=0x1;break;case'3':this[_0xea87('0x18')]+=0x1;break;case'4':this[_0xea87('0x19')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0xea87('0x1b')]+=0x1;break;case'7':this[_0xea87('0x1c')]+=0x1;break;case'8':this[_0xea87('0x1a')]+=0x1;break;}}if(this[_0xea87('0x24')]===_0xea87('0x49')){var _0x298c61=Object[_0xea87('0x4a')](_0x483b54);for(var _0x5df2c4=0x0;_0x5df2c4<_0x298c61[_0xea87('0x44')];_0x5df2c4++){var _0x2f0c32=_0x298c61[_0x5df2c4];var _0x10507b=_0x483b54[_0x2f0c32];if(_0x10507b['queue']===this[_0xea87('0x14')]&&_0x10507b[_0xea87('0x1f')]===_0xea87('0x4b')&&_0x10507b[_0xea87('0x4c')]==='xcally-motion-preview'){this['talking']+=0x1;}}if(this[_0xea87('0x4')]>this[_0xea87('0x6')]){this['talking']=this[_0xea87('0x6')];}this[_0xea87('0x11')]=0x0;}return this;};VoiceQueueSummary[_0xea87('0x4d')]['compareToInboundQueue']=function(_0x51dda9){var _0xe24595=![];if(_0x51dda9){_0xe24595=INBOUND_COUNTERS[_0xea87('0x4e')](function(_0x72766a){return this[_0x72766a]!==_0x51dda9[_0x72766a];},this);}return _0xe24595;};VoiceQueueSummary[_0xea87('0x4d')][_0xea87('0x4f')]=function(_0xdffe9e){var _0x3d5dd0=![];var _0x7da1ab=![];var _0x2f5444=![];if(_0xdffe9e){_0x3d5dd0=this[_0xea87('0x24')]!==_0xdffe9e[_0xea87('0x24')]||this['dialActive']!==_0xdffe9e[_0xea87('0x23')]||this[_0xea87('0x3d')]!==_0xdffe9e[_0xea87('0x3d')]||this[_0xea87('0x3e')]!==_0xdffe9e[_0xea87('0x3e')];_0x7da1ab=OUTBOUND_COUNTERS[_0xea87('0x4e')](function(_0x2243a1){return this[_0x2243a1]!==_0xdffe9e[_0x2243a1];},this);if(this[_0xea87('0x3f')]&&_0xdffe9e['Trunk']){_0x2f5444=this['Trunk'][_0xea87('0x14')]!==_0xdffe9e[_0xea87('0x3f')][_0xea87('0x14')]||this[_0xea87('0x3f')][_0xea87('0x40')]!==_0xdffe9e[_0xea87('0x3f')][_0xea87('0x40')];}}return _0x3d5dd0||_0x7da1ab||_0x2f5444;};VoiceQueueSummary[_0xea87('0x4d')][_0xea87('0x50')]=function(_0xcf5422){this['answered']=_0xcf5422['answered'];this[_0xea87('0x3d')]=_0xcf5422[_0xea87('0x3d')];this[_0xea87('0x3e')]=_0xcf5422['statusMessage'];this[_0xea87('0x7')]=_0xcf5422[_0xea87('0x7')];this['outboundAbandonedCallsDay']=_0xcf5422[_0xea87('0x51')];this['outboundAnswerCallsDay']=_0xcf5422[_0xea87('0x8')];this['outboundBlacklistCallsDay']=_0xcf5422['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0xcf5422[_0xea87('0xa')];this['outboundCongestionCallsDay']=_0xcf5422[_0xea87('0xb')];this[_0xea87('0xc')]=_0xcf5422[_0xea87('0xc')];this[_0xea87('0xd')]=_0xcf5422['outboundNoSuchCallsDay'];this['outboundReCallsDay']=_0xcf5422['outboundReCallsDay'];this[_0xea87('0xf')]=_0xcf5422['outboundRejectCallsDay'];this[_0xea87('0x10')]=_0xcf5422[_0xea87('0x10')];this[_0xea87('0x1d')]=_0xcf5422[_0xea87('0x1d')];this[_0xea87('0x12')]=_0xcf5422['sumDuration'];this['total']=_0xcf5422['total'];if(this[_0xea87('0x24')]==='preview'){this[_0xea87('0x11')]=_0xcf5422['pTalking'];}};module[_0xea87('0x52')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index db83fbd..0743339 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 _0x25f9=['name','username','accessKey','remoteUri','serverUrl'];(function(_0x3ec1a9,_0x393d76){var _0x4e9778=function(_0x4acf80){while(--_0x4acf80){_0x3ec1a9['push'](_0x3ec1a9['shift']());}};_0x4e9778(++_0x393d76);}(_0x25f9,0x87));var _0x925f=function(_0x5b72b6,_0x5f5562){_0x5b72b6=_0x5b72b6-0x0;var _0x2f8117=_0x25f9[_0x5b72b6];return _0x2f8117;};'use strict';function VtigerAccount(_0x2d7e8d){this['id']=_0x2d7e8d['id']||0x0;this['name']=_0x2d7e8d[_0x925f('0x0')]||'';this[_0x925f('0x1')]=_0x2d7e8d[_0x925f('0x1')]||'';this[_0x925f('0x2')]=_0x2d7e8d[_0x925f('0x2')]||'';this[_0x925f('0x3')]=_0x2d7e8d[_0x925f('0x3')]||'';this[_0x925f('0x4')]=_0x2d7e8d[_0x925f('0x4')]||'';this['Configurations']=_0x2d7e8d['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x6d67=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x586dd4,_0x48c6d1){var _0x1fa401=function(_0x5d3eb4){while(--_0x5d3eb4){_0x586dd4['push'](_0x586dd4['shift']());}};_0x1fa401(++_0x48c6d1);}(_0x6d67,0xd5));var _0x76d6=function(_0x55c4db,_0x293304){_0x55c4db=_0x55c4db-0x0;var _0x58ba84=_0x6d67[_0x55c4db];return _0x58ba84;};'use strict';function VtigerAccount(_0x304edc){this['id']=_0x304edc['id']||0x0;this[_0x76d6('0x0')]=_0x304edc['name']||'';this[_0x76d6('0x1')]=_0x304edc[_0x76d6('0x1')]||'';this[_0x76d6('0x2')]=_0x304edc[_0x76d6('0x2')]||'';this[_0x76d6('0x3')]=_0x304edc[_0x76d6('0x3')]||'';this[_0x76d6('0x4')]=_0x304edc[_0x76d6('0x4')]||'';this[_0x76d6('0x5')]=_0x304edc['Configurations']||{};}module[_0x76d6('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 143838e..b9a8ca9 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 _0x0fd7=['Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x0fd7,0x120));var _0x70fd=function(_0x51b59b,_0x4b3e0d){_0x51b59b=_0x51b59b-0x0;var _0xd5dec0=_0x0fd7[_0x51b59b];return _0xd5dec0;};'use strict';function ZendeskAccount(_0x95aecd){this['id']=_0x95aecd['id']||0x0;this[_0x70fd('0x0')]=_0x95aecd[_0x70fd('0x0')]||'';this[_0x70fd('0x1')]=_0x95aecd[_0x70fd('0x1')]||'';this[_0x70fd('0x2')]=_0x95aecd[_0x70fd('0x2')]||'';this[_0x70fd('0x3')]=_0x95aecd['token']||'';this[_0x70fd('0x4')]=_0x95aecd[_0x70fd('0x4')]||'';this[_0x70fd('0x5')]=_0x95aecd[_0x70fd('0x5')]||'';this[_0x70fd('0x6')]=_0x95aecd['type']||_0x70fd('0x7');this[_0x70fd('0x8')]=_0x95aecd[_0x70fd('0x8')]||'';this[_0x70fd('0x9')]=_0x95aecd[_0x70fd('0x9')]||{};}module[_0x70fd('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xfd3d=['username','password','remoteUri','authType','type','integrationTab','serverUrl','exports','name'];(function(_0x49631b,_0x588788){var _0x41e96c=function(_0x1362d4){while(--_0x1362d4){_0x49631b['push'](_0x49631b['shift']());}};_0x41e96c(++_0x588788);}(_0xfd3d,0x131));var _0xdfd3=function(_0x11cd84,_0x31c5eb){_0x11cd84=_0x11cd84-0x0;var _0x5b8229=_0xfd3d[_0x11cd84];return _0x5b8229;};'use strict';function ZendeskAccount(_0xbb759c){this['id']=_0xbb759c['id']||0x0;this[_0xdfd3('0x0')]=_0xbb759c[_0xdfd3('0x0')]||'';this[_0xdfd3('0x1')]=_0xbb759c[_0xdfd3('0x1')]||'';this[_0xdfd3('0x2')]=_0xbb759c[_0xdfd3('0x2')]||'';this['token']=_0xbb759c['token']||'';this[_0xdfd3('0x3')]=_0xbb759c['remoteUri']||'';this[_0xdfd3('0x4')]=_0xbb759c['authType']||'';this[_0xdfd3('0x5')]=_0xbb759c[_0xdfd3('0x5')]||_0xdfd3('0x6');this['serverUrl']=_0xbb759c[_0xdfd3('0x7')]||'';this['Configurations']=_0xbb759c['Configurations']||{};}module[_0xdfd3('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 3a38f48..175f401 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 _0x0d15=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x4365a0,_0x1371a4){var _0x3b829d=function(_0x5538c1){while(--_0x5538c1){_0x4365a0['push'](_0x4365a0['shift']());}};_0x3b829d(++_0x1371a4);}(_0x0d15,0x9a));var _0x50d1=function(_0x1bfc33,_0x5c3574){_0x1bfc33=_0x1bfc33-0x0;var _0x1def7b=_0x0d15[_0x1bfc33];return _0x1def7b;};'use strict';function ZohoAccount(_0x420cb4){this['id']=_0x420cb4['id']||0x0;this[_0x50d1('0x0')]=_0x420cb4['name']||'';this[_0x50d1('0x1')]=_0x420cb4[_0x50d1('0x1')]||'';this['host']=_0x420cb4[_0x50d1('0x2')]||'';this['zone']=_0x420cb4[_0x50d1('0x3')]||'';this[_0x50d1('0x4')]=_0x420cb4[_0x50d1('0x4')]||'';this['clientSecret']=_0x420cb4[_0x50d1('0x5')]||'';this[_0x50d1('0x6')]=_0x420cb4[_0x50d1('0x6')]||'';this['code']=_0x420cb4[_0x50d1('0x7')]||'';this[_0x50d1('0x8')]=_0x420cb4[_0x50d1('0x8')]||'';this['Configurations']=_0x420cb4[_0x50d1('0x9')]||{};}module[_0x50d1('0xa')]=ZohoAccount; \ No newline at end of file +var _0xc803=['clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId'];(function(_0x38fd8c,_0x3f18b3){var _0x2af261=function(_0x5e4985){while(--_0x5e4985){_0x38fd8c['push'](_0x38fd8c['shift']());}};_0x2af261(++_0x3f18b3);}(_0xc803,0x145));var _0x3c80=function(_0x54ff19,_0x46b1f9){_0x54ff19=_0x54ff19-0x0;var _0x46b91b=_0xc803[_0x54ff19];return _0x46b91b;};'use strict';function ZohoAccount(_0xb615ab){this['id']=_0xb615ab['id']||0x0;this[_0x3c80('0x0')]=_0xb615ab['name']||'';this[_0x3c80('0x1')]=_0xb615ab[_0x3c80('0x1')]||'';this['host']=_0xb615ab[_0x3c80('0x2')]||'';this['zone']=_0xb615ab[_0x3c80('0x3')]||'';this['clientId']=_0xb615ab[_0x3c80('0x4')]||'';this[_0x3c80('0x5')]=_0xb615ab[_0x3c80('0x5')]||'';this[_0x3c80('0x6')]=_0xb615ab['serverUrl']||'';this[_0x3c80('0x7')]=_0xb615ab['code']||'';this[_0x3c80('0x8')]=_0xb615ab['refreshToken']||'';this[_0x3c80('0x9')]=_0xb615ab[_0x3c80('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 d7fbdc3..9fb15c1 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 _0x4bd3=['name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','idContact','queue'];(function(_0x545658,_0x2c9e2f){var _0x3bb509=function(_0x51e269){while(--_0x51e269){_0x545658['push'](_0x545658['shift']());}};_0x3bb509(++_0x2c9e2f);}(_0x4bd3,0x174));var _0x34bd=function(_0x1a09b9,_0x2c9f0a){_0x1a09b9=_0x1a09b9-0x0;var _0xe67872=_0x4bd3[_0x1a09b9];return _0xe67872;};'use strict';var util=require(_0x34bd('0x0'));var _=require('lodash');var moment=require(_0x34bd('0x1'));function checkNameSurname(_0x22a9f9,_0x5369c1,_0x4997bc){var _0x4cad21='';if(!_[_0x34bd('0x2')](_0x5369c1)&&_0x34bd('0x3')===typeof _0x5369c1){_0x4cad21+=_0x5369c1;}if(!_[_0x34bd('0x2')](_0x4997bc)&&'string'===typeof _0x4997bc){_0x4cad21+='\x20'+_0x4997bc;}if(_0x4cad21!==''){return _0x4cad21;}return _0x22a9f9;}function Action(_0x2133c5,_0x2a15a2,_0x5c2a7a,_0x3e8744,_0x213716){this['uniqueid']=_0x5c2a7a||undefined;this[_0x34bd('0x4')]=_0x2133c5['id'];this[_0x34bd('0x5')]=_0x2a15a2[_0x34bd('0x6')];this[_0x34bd('0x7')]=_0x2a15a2[_0x34bd('0x7')];this[_0x34bd('0x8')]='queue';this[_0x34bd('0x9')]=![];this[_0x34bd('0xa')]=_[_0x34bd('0x2')](_0x2133c5[_0x34bd('0xb')])?undefined:_0x2133c5['Agent']['name'];this[_0x34bd('0xc')]=this['membername']?util['format'](_0x34bd('0xd'),this[_0x34bd('0xa')]):_0x3e8744||undefined;this[_0x34bd('0xe')]=checkNameSurname(_0x2133c5[_0x34bd('0xf')][_0x34bd('0x10')],_0x2133c5[_0x34bd('0xf')][_0x34bd('0x11')],_0x2133c5[_0x34bd('0xf')][_0x34bd('0x12')]);this['active']=_0x2133c5[_0x34bd('0x13')]||![];this['calleridnum']=_0x2133c5['phone'];this[_0x34bd('0x14')]=_0x2133c5[_0x34bd('0x14')];this[_0x34bd('0x15')]=_0x2133c5[_0x34bd('0x15')]||0x0;this[_0x34bd('0x16')]=_0x2133c5[_0x34bd('0x16')]||0x0;this[_0x34bd('0x17')]=_0x2133c5[_0x34bd('0x17')]||0x0;this[_0x34bd('0x18')]=(_0x2133c5[_0x34bd('0x15')]||0x0)+(_0x2133c5[_0x34bd('0x16')]||0x0)+(_0x2133c5['countnoanswerretry']||0x0)+(_0x2133c5[_0x34bd('0x19')]||0x0)+(_0x2133c5[_0x34bd('0x1a')]||0x0)+(_0x2133c5[_0x34bd('0x1b')]||0x0)+(_0x2133c5[_0x34bd('0x1c')]||0x0)+(_0x2133c5[_0x34bd('0x1d')]||0x0);this[_0x34bd('0x19')]=_0x2133c5[_0x34bd('0x19')]||0x0;this[_0x34bd('0x1a')]=_0x2133c5[_0x34bd('0x1a')]||0x0;this['countabandonedretry']=_0x2133c5[_0x34bd('0x1b')]||0x0;this[_0x34bd('0x1c')]=_0x2133c5[_0x34bd('0x1c')]||0x0;this[_0x34bd('0x1d')]=_0x2133c5[_0x34bd('0x1d')]||0x0;this['callback']=_0x2133c5['callback'];this['callbackuniqueid']=_0x2133c5['callbackuniqueid'];this[_0x34bd('0x1e')]=_0x2133c5['callbackat'];this[_0x34bd('0x1f')]=_0x2133c5[_0x34bd('0x1f')];this[_0x34bd('0x20')]=_0x2133c5['ContactId'];this[_0x34bd('0x21')]=_0x2133c5[_0x34bd('0x21')];this[_0x34bd('0x22')]=_[_0x34bd('0x2')](_0x2133c5['Agent'])?_0x2133c5[_0x34bd('0x22')]:_0x2133c5[_0x34bd('0xb')]['id'];this[_0x34bd('0x23')]=_0x2133c5[_0x34bd('0x23')];this['originatecalleridnum']='';this[_0x34bd('0x24')]='';}Action[_0x34bd('0x25')]['getCaller']=function(){return util[_0x34bd('0x26')](_0x34bd('0x27'),this[_0x34bd('0xe')],this[_0x34bd('0x28')]);};module[_0x34bd('0x29')]=Action; \ No newline at end of file +var _0x1eba=['channelAgent','format','SIP/%s','calleridname','Contact','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','Agent','name'];(function(_0x130d8d,_0x44467d){var _0x5dbb35=function(_0x10b52a){while(--_0x10b52a){_0x130d8d['push'](_0x130d8d['shift']());}};_0x5dbb35(++_0x44467d);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0x1eba[_0x5471ec];return _0x121d4c;};'use strict';var util=require(_0xa1eb('0x0'));var _=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));function checkNameSurname(_0x2158d5,_0x3ef7ee,_0x5865fc){var _0x56c5f2='';if(!_[_0xa1eb('0x3')](_0x3ef7ee)&&_0xa1eb('0x4')===typeof _0x3ef7ee){_0x56c5f2+=_0x3ef7ee;}if(!_[_0xa1eb('0x3')](_0x5865fc)&&_0xa1eb('0x4')===typeof _0x5865fc){_0x56c5f2+='\x20'+_0x5865fc;}if(_0x56c5f2!==''){return _0x56c5f2;}return _0x2158d5;}function Action(_0x138789,_0x2933d0,_0x1d0d67,_0x2bfbb0,_0x39a5a3){this[_0xa1eb('0x5')]=_0x1d0d67||undefined;this[_0xa1eb('0x6')]=_0x138789['id'];this[_0xa1eb('0x7')]=_0x2933d0['name'];this[_0xa1eb('0x8')]=_0x2933d0['type'];this[_0xa1eb('0x9')]='queue';this[_0xa1eb('0xa')]=![];this['membername']=_[_0xa1eb('0x3')](_0x138789['Agent'])?undefined:_0x138789[_0xa1eb('0xb')][_0xa1eb('0xc')];this[_0xa1eb('0xd')]=this['membername']?util[_0xa1eb('0xe')](_0xa1eb('0xf'),this['membername']):_0x2bfbb0||undefined;this[_0xa1eb('0x10')]=checkNameSurname(_0x138789['Contact']['phone'],_0x138789[_0xa1eb('0x11')]['firstName'],_0x138789[_0xa1eb('0x11')][_0xa1eb('0x12')]);this[_0xa1eb('0x13')]=_0x138789[_0xa1eb('0x13')]||![];this[_0xa1eb('0x14')]=_0x138789[_0xa1eb('0x15')];this[_0xa1eb('0x16')]=_0x138789[_0xa1eb('0x16')];this[_0xa1eb('0x17')]=_0x138789['countbusyretry']||0x0;this[_0xa1eb('0x18')]=_0x138789['countcongestionretry']||0x0;this[_0xa1eb('0x19')]=_0x138789[_0xa1eb('0x19')]||0x0;this[_0xa1eb('0x1a')]=(_0x138789[_0xa1eb('0x17')]||0x0)+(_0x138789['countcongestionretry']||0x0)+(_0x138789[_0xa1eb('0x19')]||0x0)+(_0x138789[_0xa1eb('0x1b')]||0x0)+(_0x138789[_0xa1eb('0x1c')]||0x0)+(_0x138789[_0xa1eb('0x1d')]||0x0)+(_0x138789[_0xa1eb('0x1e')]||0x0)+(_0x138789[_0xa1eb('0x1f')]||0x0);this[_0xa1eb('0x1b')]=_0x138789[_0xa1eb('0x1b')]||0x0;this['countdropretry']=_0x138789[_0xa1eb('0x1c')]||0x0;this['countabandonedretry']=_0x138789[_0xa1eb('0x1d')]||0x0;this[_0xa1eb('0x1e')]=_0x138789[_0xa1eb('0x1e')]||0x0;this[_0xa1eb('0x1f')]=_0x138789['countagentrejectretry']||0x0;this['callback']=_0x138789[_0xa1eb('0x20')];this[_0xa1eb('0x21')]=_0x138789['callbackuniqueid'];this[_0xa1eb('0x22')]=_0x138789[_0xa1eb('0x22')];this[_0xa1eb('0x23')]=_0x138789[_0xa1eb('0x23')];this[_0xa1eb('0x24')]=_0x138789[_0xa1eb('0x24')];this[_0xa1eb('0x25')]=_0x138789[_0xa1eb('0x25')];this[_0xa1eb('0x26')]=_[_0xa1eb('0x3')](_0x138789[_0xa1eb('0xb')])?_0x138789[_0xa1eb('0x26')]:_0x138789['Agent']['id'];this[_0xa1eb('0x27')]=_0x138789[_0xa1eb('0x27')];this['originatecalleridnum']='';this[_0xa1eb('0x28')]='';}Action['prototype'][_0xa1eb('0x29')]=function(){return util[_0xa1eb('0xe')]('\x22%s\x22\x20<%s>',this[_0xa1eb('0x10')],this[_0xa1eb('0x2a')]);};module[_0xa1eb('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index af5d60c..0e77114 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x4f0ecb,_0x544eed){var _0x4594f0=function(_0x41f3a6){while(--_0x41f3a6){_0x4f0ecb['push'](_0x4f0ecb['shift']());}};_0x4594f0(++_0x544eed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x1c2380,_0x35a802){var _0x4c33b2=function(_0x50c985){while(--_0x50c985){_0x1c2380['push'](_0x1c2380['shift']());}};_0x4c33b2(++_0x35a802);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 51b3080..6ae363a 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 _0x536f=['createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','error','inspect','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','then','getContactPreview','[getContactPreview]\x20','createAgentHistory'];(function(_0x5d15d2,_0x51cd88){var _0x304bc0=function(_0x5eed0d){while(--_0x5eed0d){_0x5d15d2['push'](_0x5d15d2['shift']());}};_0x304bc0(++_0x51cd88);}(_0x536f,0x160));var _0xf536=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x536f[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xf536('0x0'));var BPromise=require(_0xf536('0x1'));var logger=require(_0xf536('0x2'))(_0xf536('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xf536('0x4'));var cmHopperBlack=require(_0xf536('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x116d97){return function(_0x409d87){logger[_0xf536('0x6')](_0x116d97,util[_0xf536('0x7')](_0x409d87,{'showHidden':![],'depth':null}));};}function create(_0xfa66cc){return cmHopperHistory[_0xf536('0x8')](_0xfa66cc)[_0xf536('0x9')](loggerCatch(_0xf536('0xa')));}function createAgent(_0x408f38){return BPromise[_0xf536('0xb')]()['then'](agentReportPreview[_0xf536('0x8')](_0x408f38))[_0xf536('0x9')](loggerCatch(_0xf536('0xa')));}function moveContact(_0x37e2ee){return cmHopper['moveContactManagedDialer'](_0x37e2ee,!![])['catch'](loggerCatch(_0xf536('0xc')));}exports[_0xf536('0xd')]=function(_0x2ea866){return cmHopperBlack['checkIsBlackList'](_0x2ea866)[_0xf536('0x9')](loggerCatch(_0xf536('0xe')));};exports['getContactPreview']=function(_0x15210d){return BPromise['resolve']()[_0xf536('0xf')](cmHopper[_0xf536('0x10')](_0x15210d))[_0xf536('0x9')](loggerCatch(_0xf536('0x11')));};exports[_0xf536('0x8')]=function(_0x116994,_0x30d1ee){create(_0x116994)[_0xf536('0x9')](loggerCatch(_0x30d1ee));moveContact(_0x116994)[_0xf536('0x9')](loggerCatch(_0x30d1ee));};exports[_0xf536('0x12')]=function(_0x125535,_0x3417cb){createAgent(_0x125535)['catch'](loggerCatch(_0x3417cb));};exports[_0xf536('0x13')]=function(_0x3852d0,_0x5d63c9){create(_0x3852d0)[_0xf536('0x9')](loggerCatch(_0x5d63c9));};exports[_0xf536('0x14')]=function(_0x174863,_0x104d07){moveContact(_0x174863)[_0xf536('0x9')](loggerCatch(_0x104d07));};exports[_0xf536('0x15')]=function(_0x30edff,_0x52c938,_0x1e1086){if(_0x52c938){_0x30edff['UserId']=null;}if(_0x1e1086){_0x30edff[_0xf536('0x16')]=![];}return cmHopper[_0xf536('0x15')](_0x30edff)[_0xf536('0x9')](loggerCatch(_0xf536('0x17')));};exports[_0xf536('0x18')]=function(_0x7141ae){return cmHopper[_0xf536('0x18')](_0x7141ae)[_0xf536('0x9')](loggerCatch(_0xf536('0x19')));};exports[_0xf536('0x1a')]=function(_0xc70578){return cmHopper[_0xf536('0x1a')]({'UserId':null},_0xc70578,0x1)[_0xf536('0x9')](loggerCatch(_0xf536('0x1b')));};exports['disableContact']=function(_0x119046){return cmHopper[_0xf536('0x1a')]({'active':![]},_0x119046,0x1)[_0xf536('0x9')](loggerCatch(_0xf536('0x1c')));};exports[_0xf536('0x1d')]=function(_0x102c6f){var _0x16e8e8={};_0x16e8e8[_0xf536('0x1e')]=_0x102c6f[_0xf536('0x1e')];_0x16e8e8[_0xf536('0x1f')]=_0x102c6f[_0xf536('0x1f')];_0x16e8e8[_0xf536('0x20')]=_0x102c6f[_0xf536('0x20')];_0x16e8e8['calleridname']=_0x102c6f[_0xf536('0x21')];_0x16e8e8[_0xf536('0x22')]=_0x102c6f[_0xf536('0x22')];_0x16e8e8[_0xf536('0x23')]=_0x102c6f[_0xf536('0x24')];_0x16e8e8['queuecallerleaveAt']=_0x102c6f[_0xf536('0x24')];_0x16e8e8[_0xf536('0x25')]=0x1;_0x16e8e8[_0xf536('0x26')]=_0x102c6f[_0xf536('0x27')];_0x16e8e8[_0xf536('0x28')]=_0x102c6f[_0xf536('0x29')];_0x16e8e8[_0xf536('0x2a')]=_0xf536('0x2b');_0x16e8e8[_0xf536('0x2c')]=_0xf536('0x2d');_0x16e8e8[_0xf536('0x2e')]=0x0;_0x16e8e8['assigned']=0x1;_0x16e8e8[_0xf536('0x2f')]=_0x102c6f[_0xf536('0x29')];_0x16e8e8[_0xf536('0x30')]=_0xf536('0x31');return BPromise['resolve']()[_0xf536('0xf')](voiceQueueReport['create'](_0x16e8e8))[_0xf536('0x9')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x24be54,_0x36a545){return BPromise[_0xf536('0xb')]()[_0xf536('0xf')](cmHopper[_0xf536('0x32')](_0x24be54,_0x36a545))[_0xf536('0x9')](loggerCatch(_0xf536('0x33')));};exports['rescheduleContactInQueue']=function(_0x322ce0){return cmHopper[_0xf536('0x15')](_0x322ce0,!![],!![])['catch'](loggerCatch(_0xf536('0x34')));}; \ No newline at end of file +var _0x59b9=['[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','resolve','then','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','disableContact','unlockContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','from-sip','exten','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20'];(function(_0x3d64e6,_0x419925){var _0x542087=function(_0x4d899d){while(--_0x4d899d){_0x3d64e6['push'](_0x3d64e6['shift']());}};_0x542087(++_0x419925);}(_0x59b9,0x1f0));var _0x959b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x59b9[_0x17d9e3];return _0x14192d;};'use strict';var util=require(_0x959b('0x0'));var BPromise=require(_0x959b('0x1'));var logger=require(_0x959b('0x2'))('preview');var cmHopper=require(_0x959b('0x3'));var cmHopperHistory=require(_0x959b('0x4'));var cmHopperBlack=require(_0x959b('0x5'));var agentReportPreview=require(_0x959b('0x6'));var voiceQueueReport=require(_0x959b('0x7'));function loggerCatch(_0x158fc7){return function(_0x5efea7){logger['error'](_0x158fc7,util[_0x959b('0x8')](_0x5efea7,{'showHidden':![],'depth':null}));};}function create(_0x22b9af){return cmHopperHistory[_0x959b('0x9')](_0x22b9af)['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x3cc0d2){return BPromise[_0x959b('0xa')]()[_0x959b('0xb')](agentReportPreview['createHistory'](_0x3cc0d2))[_0x959b('0xc')](loggerCatch(_0x959b('0xd')));}function moveContact(_0x31915e){return cmHopper['moveContactManagedDialer'](_0x31915e,!![])[_0x959b('0xc')](loggerCatch(_0x959b('0xe')));}exports[_0x959b('0xf')]=function(_0x444fa9){return cmHopperBlack[_0x959b('0xf')](_0x444fa9)[_0x959b('0xc')](loggerCatch(_0x959b('0x10')));};exports[_0x959b('0x11')]=function(_0x1337f3){return BPromise['resolve']()[_0x959b('0xb')](cmHopper[_0x959b('0x11')](_0x1337f3))[_0x959b('0xc')](loggerCatch(_0x959b('0x12')));};exports[_0x959b('0x9')]=function(_0x554ca,_0x321d02){create(_0x554ca)[_0x959b('0xc')](loggerCatch(_0x321d02));moveContact(_0x554ca)[_0x959b('0xc')](loggerCatch(_0x321d02));};exports[_0x959b('0x13')]=function(_0x408b65,_0x3d304d){createAgent(_0x408b65)[_0x959b('0xc')](loggerCatch(_0x3d304d));};exports[_0x959b('0x14')]=function(_0x3c9eb3,_0xbfbc5c){create(_0x3c9eb3)[_0x959b('0xc')](loggerCatch(_0xbfbc5c));};exports[_0x959b('0x15')]=function(_0x44db06,_0x1a94a6){moveContact(_0x44db06)[_0x959b('0xc')](loggerCatch(_0x1a94a6));};exports[_0x959b('0x16')]=function(_0x69e255,_0x1f919f,_0x315518){if(_0x1f919f){_0x69e255['UserId']=null;}if(_0x315518){_0x69e255[_0x959b('0x17')]=![];}return cmHopper[_0x959b('0x16')](_0x69e255)[_0x959b('0xc')](loggerCatch(_0x959b('0x18')));};exports[_0x959b('0x19')]=function(_0x5842fd){return cmHopper['countReScheduled'](_0x5842fd)['catch'](loggerCatch(_0x959b('0x1a')));};exports['unlockContact']=function(_0x255c41){return cmHopper['unlockContact']({'UserId':null},_0x255c41,0x1)[_0x959b('0xc')](loggerCatch(_0x959b('0x1b')));};exports[_0x959b('0x1c')]=function(_0x3f1598){return cmHopper[_0x959b('0x1d')]({'active':![]},_0x3f1598,0x1)[_0x959b('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0x959b('0x1e')]=function(_0x20b067){var _0x3e82da={};_0x3e82da[_0x959b('0x1f')]=_0x20b067['type'];_0x3e82da[_0x959b('0x20')]=_0x20b067[_0x959b('0x20')];_0x3e82da['calleridnum']=_0x20b067[_0x959b('0x21')];_0x3e82da[_0x959b('0x22')]=_0x20b067['calleridname'];_0x3e82da[_0x959b('0x23')]=_0x20b067[_0x959b('0x23')];_0x3e82da[_0x959b('0x24')]=_0x20b067[_0x959b('0x25')];_0x3e82da[_0x959b('0x26')]=_0x20b067['answertime'];_0x3e82da[_0x959b('0x27')]=0x1;_0x3e82da[_0x959b('0x28')]=_0x20b067[_0x959b('0x29')];_0x3e82da['connectedlinename']=_0x20b067['membername'];_0x3e82da['context']=_0x959b('0x2a');_0x3e82da[_0x959b('0x2b')]='xcally-motion-preview';_0x3e82da[_0x959b('0x2c')]=0x0;_0x3e82da[_0x959b('0x2d')]=0x1;_0x3e82da[_0x959b('0x2e')]=_0x20b067[_0x959b('0x2f')];_0x3e82da[_0x959b('0x30')]=_0x959b('0x31');return BPromise['resolve']()[_0x959b('0xb')](voiceQueueReport[_0x959b('0x32')](_0x3e82da))[_0x959b('0xc')](loggerCatch(_0x959b('0x33')));};exports[_0x959b('0x34')]=function(_0x216bc0,_0x174998){return BPromise[_0x959b('0xa')]()[_0x959b('0xb')](cmHopper['getContactRecallMe'](_0x216bc0,_0x174998))[_0x959b('0xc')](loggerCatch(_0x959b('0x35')));};exports['rescheduleContactInQueue']=function(_0x28cf21){return cmHopper['rescheduleContact'](_0x28cf21,!![],!![])[_0x959b('0xc')](loggerCatch(_0x959b('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 95a9713..11c6d2a 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 _0xbecc=['rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','util','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','logger','info','inspect','error','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','isNil','addVariables','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','endtime','logAgent','statedesc','ringtime','getSeconds','responsetime','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','Global','scheduledAt','scheduledat','add','minutes','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','interface','mandatoryDisposition','agentReadyId','status','reachable','getDiff','milliseconds','createBody','ListId','filterKey','idContact','type','campaigntype','dialAnswer','active','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosbridged'];(function(_0xa2bb69,_0x41803f){var _0x5e6eea=function(_0x460ecb){while(--_0x460ecb){_0xa2bb69['push'](_0xa2bb69['shift']());}};_0x5e6eea(++_0x41803f);}(_0xbecc,0x126));var _0xcbec=function(_0xca016f,_0x37994d){_0xca016f=_0xca016f-0x0;var _0x3f1ce1=_0xbecc[_0xca016f];return _0x3f1ce1;};'use strict';var util=require(_0xcbec('0x0'));var _=require(_0xcbec('0x1'));var moment=require('moment');var logger=require(_0xcbec('0x2'))(_0xcbec('0x3'));var ipAgi=process[_0xcbec('0x4')][_0xcbec('0x5')]||_0xcbec('0x6');var utils=require(_0xcbec('0x7'));exports['loggerCatch']=function(_0x261607){return function(_0x5483f3){logger['error'](_0x261607,util['inspect'](_0x5483f3,{'showHidden':![],'depth':null}));};};exports[_0xcbec('0x8')]=function(_0x1484c5,_0xe80129){logger[_0xcbec('0x9')](_0x1484c5,util[_0xcbec('0xa')](_0xe80129,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x1641a8,_0x5e2c66){logger[_0xcbec('0xb')](_0x1641a8,util['inspect'](_0x5e2c66,{'showHidden':![],'depth':null}));};exports[_0xcbec('0xc')]=function(_0x2a7c9e){return function(_0x48c8f9){logger['info'](_0x2a7c9e,util[_0xcbec('0xa')](_0x48c8f9,{'showHidden':![],'depth':null}));};};exports[_0xcbec('0xd')]=function(_0x36525c,_0x24ef04,_0x2be314){return{'message':_0x36525c,'unlock':_0x24ef04,'active':_0x2be314};};exports[_0xcbec('0xe')]=function(_0x19bea5,_0x5d3381,_0x441c5c){if(!_[_0xcbec('0xf')](_0x441c5c)&&_0xcbec('0x10')===typeof _0x441c5c&&!_['isEmpty'](_0x441c5c)){if(!_[_0xcbec('0xf')](_0x5d3381)&&_0xcbec('0x10')===typeof _0x5d3381&&!_[_0xcbec('0x11')](_0x5d3381)){return util['format'](_0xcbec('0x12'),_0x5d3381,_0x441c5c);}return util[_0xcbec('0x13')](_0xcbec('0x12'),_0x441c5c,_0x441c5c);}if(!_[_0xcbec('0xf')](_0x19bea5)&&_0xcbec('0x10')===typeof _0x19bea5&&!_[_0xcbec('0x11')](_0x19bea5)){return _0x19bea5;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x53f29b){if(_[_0xcbec('0x14')](_0x53f29b)){return![];}return _0x53f29b;};exports[_0xcbec('0x15')]=function(_0x559d7d,_0x3fb7d3,_0x2c0d9f,_0x13a188,_0x639e94,_0x32863){var _0x1105a5={'XMD-QUEUE':_0x3fb7d3[_0xcbec('0x16')]?_0x3fb7d3[_0xcbec('0x16')][_0xcbec('0x17')]:'','XMD-CALLERID':_0x13a188,'XMD-CALLERID-PREVIEW':_0x32863?util[_0xcbec('0x13')](_0xcbec('0x12'),_0x32863['calleridname'],_0x32863[_0xcbec('0x18')]):_0x13a188,'XMD-DIALID':_0x639e94,'XMD-CONTACTID':_0x3fb7d3[_0xcbec('0x19')],'XMD-CDRTYPE':_0xcbec('0x1a'),'CALLERID(all)':_0x13a188,'XMD-VOICEQUEUEID':_0x3fb7d3[_0xcbec('0x1b')],'XMD-DIALCHANNEL':_0x2c0d9f,'XMD-DIALTIMEOUT':_0x559d7d[_0xcbec('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xcbec('0x13')](_0xcbec('0x1d'),_0x559d7d['dialQueueProject2']?'g':'',_['isEmpty'](_0x559d7d[_0xcbec('0x1e')])?'':_0xcbec('0x1f')),'XMD-DIALURL':_0x559d7d[_0xcbec('0x20')]||'','XMD-AGI':_0x559d7d[_0xcbec('0x21')]?util['format'](_0xcbec('0x22'),ipAgi,_0x559d7d[_0xcbec('0x21')]):_0xcbec('0x23'),'XMD-AGIAFTER':_0x559d7d[_0xcbec('0x24')]?util[_0xcbec('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x559d7d['dialQueueProject2']):_0xcbec('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x32863?_0x32863[_0xcbec('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x32863?_0x32863[_0xcbec('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0xcbec('0x27')};if(!_[_0xcbec('0x11')](_0x559d7d[_0xcbec('0x1e')])){_0x1105a5[util[_0xcbec('0x13')]('%s',_0xcbec('0x28'))]=_0x559d7d['monitor_format'];_0x1105a5[util[_0xcbec('0x13')]('%s',_0xcbec('0x29'))]=_0x639e94;}return _0x1105a5;};exports['toLowerVariables']=function(_0x2743b2){var _0xb076b0={};for(var _0x38e60c in _0x2743b2){if(_0x2743b2[_0xcbec('0x2a')](_0x38e60c)){_0xb076b0[util[_0xcbec('0x13')]('%s',_[_0xcbec('0x2b')](_0x38e60c))]=_0x2743b2[_0x38e60c];}}return{'variables':_0xb076b0};};exports[_0xcbec('0x2c')]=function(_0xd88f91,_0x127672){if(!_[_0xcbec('0x14')](_0xd88f91)){if(_0xd88f91[_0xcbec('0x2a')](_0xcbec('0x2d'))){if(_0xd88f91[_0xcbec('0x2d')]>0x0){_0xd88f91[_0xcbec('0x2d')]-=0x1;}else{logger[_0xcbec('0xb')](_0xcbec('0x2e'),_0x127672);}}}else{logger[_0xcbec('0xb')](_0xcbec('0x2f'),_0x127672);}};exports[_0xcbec('0x30')]=function(_0x3640a5){var _0x1de261=moment()[_0xcbec('0x13')](_0xcbec('0x31'));_0x3640a5[_0xcbec('0x32')]=0xd;_0x3640a5['statedesc']=_0xcbec('0x33');_0x3640a5[_0xcbec('0x34')]=_0x1de261;_0x3640a5['responsetime']=_0x1de261;_0x3640a5[_0xcbec('0x35')]=_0x1de261;};exports[_0xcbec('0x36')]=function(_0x52bfde,_0xf9163b,_0x44feb4){var _0x389aa9=moment()[_0xcbec('0x13')](_0xcbec('0x31'));_0x52bfde['state']=_0xf9163b;_0x52bfde[_0xcbec('0x37')]=_0x44feb4;_0x52bfde['responsetime']=_0x389aa9;_0x52bfde[_0xcbec('0x38')]=utils[_0xcbec('0x39')](_0x52bfde[_0xcbec('0x3a')],_0x52bfde[_0xcbec('0x34')]);};exports['logLookAgent']=function(_0x75835a,_0x4ca3ff,_0x558a2b){_0x75835a['membername']=_0x4ca3ff;_0x75835a[_0xcbec('0x3b')]=_0x558a2b;};exports[_0xcbec('0x3c')]=function(_0x18f62f,_0x3fb2d2,_0x4cf286){var _0x21ef56=moment()['format'](_0xcbec('0x31'));_0x18f62f['state']=_0x3fb2d2;_0x18f62f['statedesc']=_0x4cf286;_0x18f62f[_0xcbec('0x3a')]=_0x18f62f[_0xcbec('0x3a')]?_0x18f62f[_0xcbec('0x3a')]:_0x21ef56;_0x18f62f[_0xcbec('0x35')]=_0x18f62f[_0xcbec('0x35')]?_0x18f62f[_0xcbec('0x35')]:_0x21ef56;_0x18f62f[_0xcbec('0x38')]=utils['getSeconds'](_0x18f62f[_0xcbec('0x3a')]||0x0,_0x18f62f[_0xcbec('0x34')]||0x0);_0x18f62f[_0xcbec('0x3d')]=_0x18f62f['answertime']?utils['getSeconds'](_0x18f62f[_0xcbec('0x35')],_0x18f62f[_0xcbec('0x3e')]):0x0;};exports[_0xcbec('0x3f')]=function(_0x13012a){return _0x13012a===_0xcbec('0x40');};exports[_0xcbec('0x41')]=function(_0xbc7442,_0x3b93fb,_0x50de2e,_0x2c235f,_0x56ca1){var _0x22798d=_0x2c235f?_0xcbec('0x42'):_0xbc7442[_0xcbec('0x43')];_0x22798d=_0x56ca1?'BOOKED':_0x22798d;return{'actionid':_0xbc7442[_0xcbec('0x44')],'action':_0xcbec('0x45'),'channel':_0xbc7442[_0xcbec('0x46')],'callerid':util['format'](_0xcbec('0x12'),_0x22798d,_0xbc7442['calleridnum']),'Exten':_0xcbec('0x47'),'Context':_0xcbec('0x48'),'Priority':'1','variable':_0x50de2e,'timeout':(_0x3b93fb[_0xcbec('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0xbc7442[_0xcbec('0x44')]};};exports[_0xcbec('0x4a')]=function(_0x242916){return _0x242916[_0xcbec('0x4b')]+_0x242916[_0xcbec('0x4c')]+_0x242916[_0xcbec('0x4d')]+_0x242916[_0xcbec('0x4e')]+_0x242916['countnosuchnumberretry'];};exports[_0xcbec('0x4f')]=function(_0x26a040){var _0x2d551c=_['clone'](_0x26a040);_0x2d551c[_0xcbec('0x32')]=0xf;_0x2d551c[_0xcbec('0x37')]=_0xcbec('0x50');return _0x2d551c;};exports[_0xcbec('0x51')]=function(_0x1566cc,_0x524319,_0x4b83c7){var _0x8a0a5c={};_0x8a0a5c[_0x524319]=_0x1566cc[_0x524319];_0x8a0a5c['active']=![];_0x8a0a5c[_0xcbec('0x52')]=moment()[_0xcbec('0x53')](_0x4b83c7,_0xcbec('0x54'))[_0xcbec('0x13')](_0xcbec('0x31'));_0x8a0a5c[_0xcbec('0x19')]=_0x1566cc['ContactId'];_0x8a0a5c['ListId']=_0x1566cc['ListId'];_0x8a0a5c[_0xcbec('0x1b')]=_0x1566cc['VoiceQueueId']||undefined;return _0x8a0a5c;};exports[_0xcbec('0x55')]=function(_0x3d422a,_0x1a707f){if(!_[_0xcbec('0x14')](_0x3d422a)){if(_0x3d422a[_0xcbec('0x56')]>0x0){_0x3d422a[_0xcbec('0x56')]-=0x1;}else{logger[_0xcbec('0xb')](_0x1a707f,_0xcbec('0x57'));}}else{logger['error'](_0x1a707f,_0xcbec('0x58'));}};exports[_0xcbec('0x59')]=function(_0x1b3359){if(_0x1b3359<=0x0){return!![];}return![];};function buildObj(_0x30b9fa,_0x3a14a0,_0x557b6b){_0x30b9fa['lastevent']=_0x3a14a0;_0x30b9fa['name']=_0x30b9fa[_0xcbec('0x5a')];_0x30b9fa[_0xcbec('0x5b')]=_0x30b9fa[_0xcbec('0x46')];_0x30b9fa['motionChannel']='voice';if(_0x557b6b){_0x30b9fa[_0xcbec('0x5c')]=_0x557b6b[_0xcbec('0x5c')];}return _0x30b9fa;}exports['buildObj']=buildObj;exports[_0xcbec('0x5d')]=function(_0x535639){var _0x4102fb=[];for(var _0x359be7 in _0x535639){if(_0x535639[_0xcbec('0x2a')](_0x359be7)){if(!_[_0xcbec('0x14')](_0x535639[_0x359be7])&&_0x535639[_0x359be7][_0xcbec('0x32')]==='not_inuse'&&_0x535639[_0x359be7][_0xcbec('0x5e')]===_0xcbec('0x5f')){_0x4102fb['push'](_0x535639[_0x359be7]['id']);}}}return _0x4102fb;};exports[_0xcbec('0x60')]=function(_0x560fab){var _0x204a0a=moment()[_0xcbec('0x61')](0x0);var _0x2812b6=moment(_0x560fab)[_0xcbec('0x61')](0x0);return _0x204a0a['diff'](_0x2812b6,'seconds');};exports[_0xcbec('0x62')]=function(_0x3fbae8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3fbae8[_0xcbec('0x19')],'ListId':_0x3fbae8[_0xcbec('0x63')],'VoiceQueueId':_0x3fbae8['VoiceQueueId']||undefined,'CampaignId':_0x3fbae8['CampaignId']||undefined};};exports[_0xcbec('0x64')]=function(_0x1f4be5){if(_0x1f4be5==='uniqueid'||_0x1f4be5===_0xcbec('0x65')||_0x1f4be5===_0xcbec('0x5a')||_0x1f4be5===_0xcbec('0x66')||_0x1f4be5===_0xcbec('0x67')||_0x1f4be5===_0xcbec('0x68')||_0x1f4be5==='membername'||_0x1f4be5==='channelAgent'||_0x1f4be5==='calleridname'||_0x1f4be5===_0xcbec('0x69')||_0x1f4be5===_0xcbec('0x18')||_0x1f4be5===_0xcbec('0x52')||_0x1f4be5==='countbusyretry'||_0x1f4be5==='countcongestionretry'||_0x1f4be5===_0xcbec('0x4d')||_0x1f4be5==='countglobal'||_0x1f4be5==='callback'||_0x1f4be5===_0xcbec('0x6a')||_0x1f4be5===_0xcbec('0x6b')||_0x1f4be5===_0xcbec('0x6c')||_0x1f4be5===_0xcbec('0x19')||_0x1f4be5===_0xcbec('0x63')||_0x1f4be5===_0xcbec('0x3b')||_0x1f4be5==='VoiceQueueId'||_0x1f4be5===_0xcbec('0x6d')||_0x1f4be5===_0xcbec('0x6e')||_0x1f4be5==='xmd-queue'||_0x1f4be5===_0xcbec('0x6f')||_0x1f4be5===_0xcbec('0x70')||_0x1f4be5===_0xcbec('0x71')||_0x1f4be5==='xmd-dialtimeout'||_0x1f4be5===_0xcbec('0x72')||_0x1f4be5==='xmd-dialid'||_0x1f4be5==='xmd-dialchannel'||_0x1f4be5===_0xcbec('0x73')||_0x1f4be5===_0xcbec('0x74')||_0x1f4be5==='xmd-callerid'||_0x1f4be5==='xmd-agiafter'||_0x1f4be5===_0xcbec('0x75')||_0x1f4be5===_0xcbec('0x76')||_0x1f4be5===_0xcbec('0x77')||_0x1f4be5===_0xcbec('0x78')||_0x1f4be5===_0xcbec('0x79')||_0x1f4be5===_0xcbec('0x7a')||_0x1f4be5===_0xcbec('0x7b')||_0x1f4be5==='rtpaudioqosrtt'||_0x1f4be5===_0xcbec('0x7c')||_0x1f4be5===_0xcbec('0x76')||_0x1f4be5===_0xcbec('0x77')||_0x1f4be5===_0xcbec('0x78')||_0x1f4be5==='rtpaudioqosjitterbridged'||_0x1f4be5===_0xcbec('0x7a')||_0x1f4be5===_0xcbec('0x7b')||_0x1f4be5===_0xcbec('0x7d')||_0x1f4be5==='rtpaudioqosrttbridged'||_0x1f4be5===_0xcbec('0x7e')||_0x1f4be5===_0xcbec('0x7f')||_0x1f4be5==='state'||_0x1f4be5===_0xcbec('0x37')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2deccc,_0x3f7f1e){var _0x49d151,_0x437a27,_0x56f25e;if(_0x3f7f1e<=0x0){_0x3f7f1e=0x1;}_0x49d151=new RegExp(_0xcbec('0x80')+_0x3f7f1e+'}$');_0x437a27=Math[_0xcbec('0x81')](0xa,_0x3f7f1e-0x1);_0x56f25e=Math[_0xcbec('0x81')](0xa,_0x3f7f1e)-0x1;return util[_0xcbec('0x13')]('%s',_['replace'](_0x2deccc,_0x49d151,_[_0xcbec('0x82')](_0x437a27,_0x56f25e)));};exports[_0xcbec('0x83')]=function(_0x401520){var _0x9207e5=_0x401520[_0xcbec('0x84')](/"(.*?)"/);return _0x9207e5?_0x9207e5[0x1]:_0x401520;};exports[_0xcbec('0x85')]=function(_0x209593){var _0x5a23ed=_0x209593[_0xcbec('0x84')](/<(.*?)>/);return _0x5a23ed?_0x5a23ed[0x1]:_0x209593;};function buildNoAnswerEventPayload(_0x225c73,_0x52fa78){var _0x1358e6=buildObj(_0x225c73,_0xcbec('0x86'));if(!_[_0xcbec('0x11')](_0x52fa78[_0xcbec('0x87')])){Object[_0xcbec('0x88')](_0x52fa78['variables'])[_0xcbec('0x89')](function(_0x175e6a){_0x1358e6[_0x175e6a['toLowerCase']()]=_0x52fa78['variables'][_0x175e6a];});}return _0x1358e6;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0xed42=['totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','clone','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','interface','motionChannel','voice','mandatoryDisposition','agentReadyId','status','reachable','getDiff','milliseconds','diff','createBody','filterKey','idContact','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','noanswer','variables','keys','forEach','buildNoAnswerEventPayload','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','../../dialer/utils','loggerCatch','inspect','logger','logger2','string','isEmpty','isUndefined','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','error','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','logLookAgent','membername','UserId','talktime','variablesAction','BOOKED','uniqueid','originate','xcally-motion-preview','timeout'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xed42,0x15d));var _0x2ed4=function(_0x3d6ef9,_0xa3ab19){_0x3d6ef9=_0x3d6ef9-0x0;var _0x43bbee=_0xed42[_0x3d6ef9];return _0x43bbee;};'use strict';var util=require(_0x2ed4('0x0'));var _=require('lodash');var moment=require(_0x2ed4('0x1'));var logger=require(_0x2ed4('0x2'))(_0x2ed4('0x3'));var ipAgi=process[_0x2ed4('0x4')][_0x2ed4('0x5')]||'127.0.0.1';var utils=require(_0x2ed4('0x6'));exports[_0x2ed4('0x7')]=function(_0x1a455e){return function(_0xc62e7){logger['error'](_0x1a455e,util[_0x2ed4('0x8')](_0xc62e7,{'showHidden':![],'depth':null}));};};exports[_0x2ed4('0x9')]=function(_0x57cda8,_0x6b7730){logger['info'](_0x57cda8,util[_0x2ed4('0x8')](_0x6b7730,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x54bfce,_0x3a255b){logger['error'](_0x54bfce,util[_0x2ed4('0x8')](_0x3a255b,{'showHidden':![],'depth':null}));};exports[_0x2ed4('0xa')]=function(_0x50ef26){return function(_0x2ea44a){logger['info'](_0x50ef26,util[_0x2ed4('0x8')](_0x2ea44a,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x2f6663,_0x502df9,_0x30631b){return{'message':_0x2f6663,'unlock':_0x502df9,'active':_0x30631b};};exports['getCallerId']=function(_0x32b8f2,_0x2eaee9,_0x2957c9){if(!_['isUndefined'](_0x2957c9)&&_0x2ed4('0xb')===typeof _0x2957c9&&!_[_0x2ed4('0xc')](_0x2957c9)){if(!_[_0x2ed4('0xd')](_0x2eaee9)&&'string'===typeof _0x2eaee9&&!_[_0x2ed4('0xc')](_0x2eaee9)){return util['format'](_0x2ed4('0xe'),_0x2eaee9,_0x2957c9);}return util[_0x2ed4('0xf')](_0x2ed4('0xe'),_0x2957c9,_0x2957c9);}if(!_[_0x2ed4('0xd')](_0x32b8f2)&&_0x2ed4('0xb')===typeof _0x32b8f2&&!_[_0x2ed4('0xc')](_0x32b8f2)){return _0x32b8f2;}return _0x2ed4('0x10');};exports[_0x2ed4('0x11')]=function(_0x233a62){if(_[_0x2ed4('0x12')](_0x233a62)){return![];}return _0x233a62;};exports[_0x2ed4('0x13')]=function(_0x2aa8f3,_0x52c520,_0x48ea05,_0x3e9f88,_0x3d052e,_0x27e31d){var _0x43f7ca={'XMD-QUEUE':_0x52c520[_0x2ed4('0x14')]?_0x52c520[_0x2ed4('0x14')]['name']:'','XMD-CALLERID':_0x3e9f88,'XMD-CALLERID-PREVIEW':_0x27e31d?util[_0x2ed4('0xf')]('\x22%s\x22\x20<%s>',_0x27e31d[_0x2ed4('0x15')],_0x27e31d[_0x2ed4('0x16')]):_0x3e9f88,'XMD-DIALID':_0x3d052e,'XMD-CONTACTID':_0x52c520['ContactId'],'XMD-CDRTYPE':_0x2ed4('0x17'),'CALLERID(all)':_0x3e9f88,'XMD-VOICEQUEUEID':_0x52c520[_0x2ed4('0x18')],'XMD-DIALCHANNEL':_0x48ea05,'XMD-DIALTIMEOUT':_0x2aa8f3[_0x2ed4('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0x2ed4('0xf')](_0x2ed4('0x1a'),_0x2aa8f3[_0x2ed4('0x1b')]?'g':'',_[_0x2ed4('0xc')](_0x2aa8f3[_0x2ed4('0x1c')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x2aa8f3[_0x2ed4('0x1d')]||'','XMD-AGI':_0x2aa8f3[_0x2ed4('0x1e')]?util[_0x2ed4('0xf')](_0x2ed4('0x1f'),ipAgi,_0x2aa8f3[_0x2ed4('0x1e')]):_0x2ed4('0x20'),'XMD-AGIAFTER':_0x2aa8f3[_0x2ed4('0x1b')]?util[_0x2ed4('0xf')](_0x2ed4('0x1f'),ipAgi,_0x2aa8f3['dialQueueProject2']):_0x2ed4('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x27e31d?_0x27e31d[_0x2ed4('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x27e31d?_0x27e31d[_0x2ed4('0x22')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x2ed4('0x23')};if(!_[_0x2ed4('0xc')](_0x2aa8f3['monitor_format'])){_0x43f7ca[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x2aa8f3['monitor_format'];_0x43f7ca[util[_0x2ed4('0xf')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x3d052e;}return _0x43f7ca;};exports[_0x2ed4('0x24')]=function(_0x4b0f71){var _0x48cb21={};for(var _0x582a4d in _0x4b0f71){if(_0x4b0f71[_0x2ed4('0x25')](_0x582a4d)){_0x48cb21[util['format']('%s',_[_0x2ed4('0x26')](_0x582a4d))]=_0x4b0f71[_0x582a4d];}}return{'variables':_0x48cb21};};exports['updateOriginated']=function(_0x1fe44a,_0x146132){if(!_[_0x2ed4('0x12')](_0x1fe44a)){if(_0x1fe44a[_0x2ed4('0x25')]('originated')){if(_0x1fe44a[_0x2ed4('0x27')]>0x0){_0x1fe44a[_0x2ed4('0x27')]-=0x1;}else{logger['error'](_0x2ed4('0x28'),_0x146132);}}}else{logger[_0x2ed4('0x29')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x146132);}};exports['logBlacklist']=function(_0x7c4d11){var _0x117b2c=moment()[_0x2ed4('0xf')](_0x2ed4('0x2a'));_0x7c4d11[_0x2ed4('0x2b')]=0xd;_0x7c4d11[_0x2ed4('0x2c')]=_0x2ed4('0x2d');_0x7c4d11[_0x2ed4('0x2e')]=_0x117b2c;_0x7c4d11[_0x2ed4('0x2f')]=_0x117b2c;_0x7c4d11[_0x2ed4('0x30')]=_0x117b2c;};exports[_0x2ed4('0x31')]=function(_0x8c790a,_0x3fbb53,_0x2cf083){var _0x58035b=moment()[_0x2ed4('0xf')](_0x2ed4('0x2a'));_0x8c790a[_0x2ed4('0x2b')]=_0x3fbb53;_0x8c790a[_0x2ed4('0x2c')]=_0x2cf083;_0x8c790a[_0x2ed4('0x2f')]=_0x58035b;_0x8c790a[_0x2ed4('0x32')]=utils[_0x2ed4('0x33')](_0x8c790a[_0x2ed4('0x2f')],_0x8c790a['starttime']);};exports[_0x2ed4('0x34')]=function(_0x590ae1,_0x5c0e2b,_0x4cdbcd){_0x590ae1[_0x2ed4('0x35')]=_0x5c0e2b;_0x590ae1[_0x2ed4('0x36')]=_0x4cdbcd;};exports['logCustomer']=function(_0x4c1238,_0x1c0bf3,_0x136f3a){var _0x26fe17=moment()[_0x2ed4('0xf')](_0x2ed4('0x2a'));_0x4c1238[_0x2ed4('0x2b')]=_0x1c0bf3;_0x4c1238[_0x2ed4('0x2c')]=_0x136f3a;_0x4c1238[_0x2ed4('0x2f')]=_0x4c1238[_0x2ed4('0x2f')]?_0x4c1238['responsetime']:_0x26fe17;_0x4c1238[_0x2ed4('0x30')]=_0x4c1238[_0x2ed4('0x30')]?_0x4c1238[_0x2ed4('0x30')]:_0x26fe17;_0x4c1238['ringtime']=utils[_0x2ed4('0x33')](_0x4c1238[_0x2ed4('0x2f')]||0x0,_0x4c1238[_0x2ed4('0x2e')]||0x0);_0x4c1238[_0x2ed4('0x37')]=_0x4c1238['answertime']?utils[_0x2ed4('0x33')](_0x4c1238[_0x2ed4('0x30')],_0x4c1238['answertime']):0x0;};exports['isFailure']=function(_0x1ce97b){return _0x1ce97b==='Failure';};exports[_0x2ed4('0x38')]=function(_0x3fc48e,_0x361b25,_0x44c2bb,_0x3e5a39,_0x10bc30){var _0x24ec81=_0x3e5a39?'RECALL':_0x3fc48e[_0x2ed4('0x15')];_0x24ec81=_0x10bc30?_0x2ed4('0x39'):_0x24ec81;return{'actionid':_0x3fc48e[_0x2ed4('0x3a')],'action':_0x2ed4('0x3b'),'channel':_0x3fc48e['channelAgent'],'callerid':util[_0x2ed4('0xf')](_0x2ed4('0xe'),_0x24ec81,_0x3fc48e[_0x2ed4('0x16')]),'Exten':_0x2ed4('0x3c'),'Context':'from-sip','Priority':'1','variable':_0x44c2bb,'timeout':(_0x361b25[_0x2ed4('0x3d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3fc48e[_0x2ed4('0x3a')]};};exports[_0x2ed4('0x3e')]=function(_0x488214){return _0x488214[_0x2ed4('0x3f')]+_0x488214[_0x2ed4('0x40')]+_0x488214[_0x2ed4('0x41')]+_0x488214[_0x2ed4('0x42')]+_0x488214['countnosuchnumberretry'];};exports['cloneAction']=function(_0x37478e){var _0x2aec73=_[_0x2ed4('0x43')](_0x37478e);_0x2aec73[_0x2ed4('0x2b')]=0xf;_0x2aec73['statedesc']=_0x2ed4('0x44');return _0x2aec73;};exports[_0x2ed4('0x45')]=function(_0x13ff7f,_0x3cfb93,_0x3370c5){var _0x23a5f8={};_0x23a5f8[_0x3cfb93]=_0x13ff7f[_0x3cfb93];_0x23a5f8[_0x2ed4('0x46')]=![];_0x23a5f8[_0x2ed4('0x47')]=moment()[_0x2ed4('0x48')](_0x3370c5,_0x2ed4('0x49'))['format'](_0x2ed4('0x2a'));_0x23a5f8[_0x2ed4('0x4a')]=_0x13ff7f[_0x2ed4('0x4a')];_0x23a5f8[_0x2ed4('0x4b')]=_0x13ff7f[_0x2ed4('0x4b')];_0x23a5f8[_0x2ed4('0x18')]=_0x13ff7f[_0x2ed4('0x18')]||undefined;return _0x23a5f8;};exports[_0x2ed4('0x4c')]=function(_0x21a9e4,_0x4d95c2){if(!_['isNil'](_0x21a9e4)){if(_0x21a9e4[_0x2ed4('0x4d')]>0x0){_0x21a9e4[_0x2ed4('0x4d')]-=0x1;}else{logger['error'](_0x4d95c2,_0x2ed4('0x4e'));}}else{logger[_0x2ed4('0x29')](_0x4d95c2,_0x2ed4('0x4f'));}};exports[_0x2ed4('0x50')]=function(_0x1f1a63){if(_0x1f1a63<=0x0){return!![];}return![];};function buildObj(_0x4ff7bb,_0x3e155e,_0x2105f4){_0x4ff7bb[_0x2ed4('0x51')]=_0x3e155e;_0x4ff7bb[_0x2ed4('0x52')]=_0x4ff7bb[_0x2ed4('0x53')];_0x4ff7bb[_0x2ed4('0x54')]=_0x4ff7bb['channelAgent'];_0x4ff7bb[_0x2ed4('0x55')]=_0x2ed4('0x56');if(_0x2105f4){_0x4ff7bb['mandatoryDisposition']=_0x2105f4[_0x2ed4('0x57')];}return _0x4ff7bb;}exports['buildObj']=buildObj;exports[_0x2ed4('0x58')]=function(_0x3614b8){var _0x48c96c=[];for(var _0x51c464 in _0x3614b8){if(_0x3614b8[_0x2ed4('0x25')](_0x51c464)){if(!_[_0x2ed4('0x12')](_0x3614b8[_0x51c464])&&_0x3614b8[_0x51c464][_0x2ed4('0x2b')]==='not_inuse'&&_0x3614b8[_0x51c464][_0x2ed4('0x59')]===_0x2ed4('0x5a')){_0x48c96c['push'](_0x3614b8[_0x51c464]['id']);}}}return _0x48c96c;};exports[_0x2ed4('0x5b')]=function(_0x1a7df9){var _0x3c8b5e=moment()[_0x2ed4('0x5c')](0x0);var _0x53e593=moment(_0x1a7df9)[_0x2ed4('0x5c')](0x0);return _0x3c8b5e[_0x2ed4('0x5d')](_0x53e593,'seconds');};exports[_0x2ed4('0x5e')]=function(_0x5c9ea3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5c9ea3[_0x2ed4('0x4a')],'ListId':_0x5c9ea3[_0x2ed4('0x4b')],'VoiceQueueId':_0x5c9ea3[_0x2ed4('0x18')]||undefined,'CampaignId':_0x5c9ea3['CampaignId']||undefined};};exports[_0x2ed4('0x5f')]=function(_0x55d6da){if(_0x55d6da===_0x2ed4('0x3a')||_0x55d6da===_0x2ed4('0x60')||_0x55d6da==='queue'||_0x55d6da===_0x2ed4('0x61')||_0x55d6da===_0x2ed4('0x62')||_0x55d6da===_0x2ed4('0x63')||_0x55d6da===_0x2ed4('0x35')||_0x55d6da==='channelAgent'||_0x55d6da===_0x2ed4('0x15')||_0x55d6da==='active'||_0x55d6da==='calleridnum'||_0x55d6da==='scheduledat'||_0x55d6da===_0x2ed4('0x3f')||_0x55d6da===_0x2ed4('0x40')||_0x55d6da===_0x2ed4('0x41')||_0x55d6da===_0x2ed4('0x64')||_0x55d6da===_0x2ed4('0x65')||_0x55d6da===_0x2ed4('0x66')||_0x55d6da===_0x2ed4('0x67')||_0x55d6da===_0x2ed4('0x68')||_0x55d6da===_0x2ed4('0x4a')||_0x55d6da===_0x2ed4('0x4b')||_0x55d6da===_0x2ed4('0x36')||_0x55d6da===_0x2ed4('0x18')||_0x55d6da===_0x2ed4('0x69')||_0x55d6da===_0x2ed4('0x6a')||_0x55d6da===_0x2ed4('0x6b')||_0x55d6da==='xmd-phone'||_0x55d6da==='xmd-listid'||_0x55d6da===_0x2ed4('0x6c')||_0x55d6da===_0x2ed4('0x6d')||_0x55d6da===_0x2ed4('0x6e')||_0x55d6da==='xmd-dialid'||_0x55d6da===_0x2ed4('0x6f')||_0x55d6da===_0x2ed4('0x70')||_0x55d6da==='xmd-cdrtype'||_0x55d6da==='xmd-callerid'||_0x55d6da===_0x2ed4('0x71')||_0x55d6da===_0x2ed4('0x72')||_0x55d6da===_0x2ed4('0x73')||_0x55d6da===_0x2ed4('0x74')||_0x55d6da===_0x2ed4('0x75')||_0x55d6da===_0x2ed4('0x76')||_0x55d6da===_0x2ed4('0x77')||_0x55d6da===_0x2ed4('0x78')||_0x55d6da==='rtpaudioqosrtt'||_0x55d6da===_0x2ed4('0x79')||_0x55d6da==='rtpaudioqos'||_0x55d6da==='rtpaudioqosbridged'||_0x55d6da===_0x2ed4('0x75')||_0x55d6da==='rtpaudioqosjitterbridged'||_0x55d6da===_0x2ed4('0x77')||_0x55d6da===_0x2ed4('0x78')||_0x55d6da===_0x2ed4('0x7a')||_0x55d6da===_0x2ed4('0x79')||_0x55d6da===_0x2ed4('0x7b')||_0x55d6da===_0x2ed4('0x7c')||_0x55d6da===_0x2ed4('0x2b')||_0x55d6da===_0x2ed4('0x2c')){return![];}return!![];};exports[_0x2ed4('0x7d')]=function(_0x413c40,_0x46bf8e){var _0x3ee969,_0x56e033,_0x2bcc36;if(_0x46bf8e<=0x0){_0x46bf8e=0x1;}_0x3ee969=new RegExp(_0x2ed4('0x7e')+_0x46bf8e+'}$');_0x56e033=Math[_0x2ed4('0x7f')](0xa,_0x46bf8e-0x1);_0x2bcc36=Math['pow'](0xa,_0x46bf8e)-0x1;return util[_0x2ed4('0xf')]('%s',_[_0x2ed4('0x80')](_0x413c40,_0x3ee969,_[_0x2ed4('0x81')](_0x56e033,_0x2bcc36)));};exports['extractCalleridName']=function(_0x4ce409){var _0x1fa817=_0x4ce409[_0x2ed4('0x82')](/"(.*?)"/);return _0x1fa817?_0x1fa817[0x1]:_0x4ce409;};exports[_0x2ed4('0x83')]=function(_0x5469ce){var _0x294569=_0x5469ce[_0x2ed4('0x82')](/<(.*?)>/);return _0x294569?_0x294569[0x1]:_0x5469ce;};function buildNoAnswerEventPayload(_0x2d0fca,_0x20085b){var _0x1db74b=buildObj(_0x2d0fca,_0x2ed4('0x84'));if(!_[_0x2ed4('0xc')](_0x20085b[_0x2ed4('0x85')])){Object[_0x2ed4('0x86')](_0x20085b[_0x2ed4('0x85')])[_0x2ed4('0x87')](function(_0x245708){_0x1db74b[_0x245708['toLowerCase']()]=_0x20085b['variables'][_0x245708];});}return _0x1db74b;}exports[_0x2ed4('0x88')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 8835938..4c6aa74 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 _0x91bb=['boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number'];(function(_0x28b5d9,_0x2d87b7){var _0x2a7fe1=function(_0x11d5f3){while(--_0x11d5f3){_0x28b5d9['push'](_0x28b5d9['shift']());}};_0x2a7fe1(++_0x2d87b7);}(_0x91bb,0x15d));var _0xb91b=function(_0x4921d5,_0x2e52c5){_0x4921d5=_0x4921d5-0x0;var _0x25a0fe=_0x91bb[_0x4921d5];return _0x25a0fe;};'use strict';exports['queueadd']={'queue':{'type':_0xb91b('0x0'),'required':!![]},'interface':{'type':_0xb91b('0x0'),'required':!![]},'membername':{'type':_0xb91b('0x0'),'required':!![]},'penalty':{'type':_0xb91b('0x1'),'required':![]},'paused':{'type':_0xb91b('0x2'),'required':![]}};exports[_0xb91b('0x3')]={'queue':{'type':_0xb91b('0x0'),'required':!![]},'interface':{'type':_0xb91b('0x0'),'required':!![]}};exports[_0xb91b('0x4')]={'interface':{'type':_0xb91b('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xb91b('0x0'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0xb91b('0x5')]={'uniqueid':{'type':_0xb91b('0x0'),'required':!![]}};exports[_0xb91b('0x6')]={'uniqueid':{'type':_0xb91b('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0xb91b('0x0')}};exports[_0xb91b('0x7')]={'uniqueid':{'type':_0xb91b('0x0'),'required':!![]}};exports[_0xb91b('0x8')]={'uniqueid':{'type':_0xb91b('0x0'),'required':!![]},'exten':{'type':_0xb91b('0x0'),'required':!![]},'context':{'type':_0xb91b('0x0')}}; \ No newline at end of file +var _0x4eb4=['boolean','queuepause','reload','voicechannel','voicequeuechannelhangup','queueadd','string','number'];(function(_0x473785,_0x312d68){var _0x360ea2=function(_0x2f063a){while(--_0x2f063a){_0x473785['push'](_0x473785['shift']());}};_0x360ea2(++_0x312d68);}(_0x4eb4,0x7d));var _0x44eb=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0x4eb4[_0x277fa3];return _0x2e4520;};'use strict';exports[_0x44eb('0x0')]={'queue':{'type':_0x44eb('0x1'),'required':!![]},'interface':{'type':_0x44eb('0x1'),'required':!![]},'membername':{'type':_0x44eb('0x1'),'required':!![]},'penalty':{'type':_0x44eb('0x2'),'required':![]},'paused':{'type':_0x44eb('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x44eb('0x1'),'required':!![]},'interface':{'type':_0x44eb('0x1'),'required':!![]}};exports[_0x44eb('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x44eb('0x3')},'reason':{'type':'string','required':![]}};exports[_0x44eb('0x5')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x44eb('0x1'),'required':!![]}};exports[_0x44eb('0x6')]={'uniqueid':{'type':_0x44eb('0x1'),'required':!![]},'filename':{'type':_0x44eb('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x44eb('0x1')}};exports[_0x44eb('0x7')]={'uniqueid':{'type':_0x44eb('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x44eb('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index bdde064..68ff83a 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 _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x5366ab,_0x4b8df7){var _0x35e82b=function(_0x2d0afd){while(--_0x2d0afd){_0x5366ab['push'](_0x5366ab['shift']());}};_0x35e82b(++_0x4b8df7);}(_0xb10b,0x12a));var _0xbb10=function(_0x2050aa,_0x2e48ea){_0x2050aa=_0x2050aa-0x0;var _0x5b03bd=_0xb10b[_0x2050aa];return _0x5b03bd;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file +var _0x5f66=['diff','seconds','disposition','ANSWERED','outbound','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','voiceQueues','triggers','templates','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','isNil','format','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','name','isUndefined','initTelephones','SIP/%s','initTriggers','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','sumDuration','queuecallercompleteAt','queuecallerexitAt'];(function(_0x208154,_0x9ca21b){var _0x20e75e=function(_0x44541b){while(--_0x44541b){_0x208154['push'](_0x208154['shift']());}};_0x20e75e(++_0x9ca21b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var util=require('util');var Agent=require(_0x65f6('0x1'));var Telephone=require(_0x65f6('0x2'));var Trunk=require(_0x65f6('0x3'));var VoiceQueue=require(_0x65f6('0x4'));var Trigger=require(_0x65f6('0x5'));var Template=require('../model/template');var Campaign=require(_0x65f6('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x65f6('0x7'));var SalesforceAccount=require(_0x65f6('0x8'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x65f6('0x9'));var DeskAccount=require(_0x65f6('0xa'));var VtigerAccount=require(_0x65f6('0xb'));var ServicenowAccount=require(_0x65f6('0xc'));var Dynamics365Account=require(_0x65f6('0xd'));var FreshsalesAccount=require(_0x65f6('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this['agents']={};this[_0x65f6('0xf')]={};this[_0x65f6('0x10')]={};this[_0x65f6('0x11')]={};this[_0x65f6('0x12')]={};this['campaigns']={};this[_0x65f6('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x65f6('0x14')]={};this['queueChannels']={};this[_0x65f6('0x15')]={};this['timers']={};this[_0x65f6('0x16')]={};this[_0x65f6('0x17')]={};this[_0x65f6('0x18')]={};this[_0x65f6('0x19')]={};this[_0x65f6('0x1a')]={};this[_0x65f6('0x1b')]={};this[_0x65f6('0x1c')]={};this[_0x65f6('0x1d')]={};this[_0x65f6('0x1e')]={};this[_0x65f6('0x1f')]={};this['freshsalesAccounts']={};this[_0x65f6('0x20')]={};}function freeIsNotKey(_0x49a913,_0x5dd324,_0x1693e6){var _0x5c69f8=_[_0x65f6('0x21')](_0x49a913,function(_0x1c955c){return _0x1c955c[_0x1693e6];});for(var _0x1b1cbb in _0x5dd324){if(_0x5dd324[_0x65f6('0x22')](_0x1b1cbb)){if(!_0x5c69f8[_0x1b1cbb]){delete _0x5dd324[_0x1b1cbb];}}}}function freeIsNotKeySip(_0xc8660c,_0x18380e){var _0x495dd6=_['mapKeys'](_0xc8660c,function(_0x2d538c){return util['format']('SIP/%s',_0x2d538c['name']);});for(var _0x365159 in _0x18380e){if(_0x18380e[_0x65f6('0x22')](_0x365159)){if(!_0x495dd6[_0x365159]){delete _0x18380e[_0x365159];}}}}function freeIsNotKeyAgent(_0x5114a4,_0x39e19f){var _0x270893=_[_0x65f6('0x21')](_0x5114a4,function(_0x3876ed){var _0x219ab2=_[_0x65f6('0x23')](_0x3876ed['interface'])?util[_0x65f6('0x24')]('SIP/%s',_0x3876ed['name']):_0x3876ed[_0x65f6('0x25')];return _0x219ab2;});for(var _0xd173f4 in _0x39e19f){if(_0x39e19f['hasOwnProperty'](_0xd173f4)){if(!_0x270893[_0xd173f4]){delete _0x39e19f[_0xd173f4];}}}}function clearVoiceCallReports(_0x1eeaaa){_0x1eeaaa[_0x65f6('0x26')]=0x0;_0x1eeaaa[_0x65f6('0x27')]=0x0;_0x1eeaaa[_0x65f6('0x28')]=0x0;_0x1eeaaa['sumDuration']=0x0;_0x1eeaaa[_0x65f6('0x29')]=0x0;}function clearCampaigns(_0x59ea32){if(!_[_0x65f6('0x2a')](_0x59ea32)){for(var _0x5963e0 in _0x59ea32){if(_0x59ea32['hasOwnProperty'](_0x5963e0)){_0x59ea32[_0x5963e0]['ivrTotalCallsDays']=0x0;_0x59ea32[_0x5963e0][_0x65f6('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x16cde8){if(!_['isEmpty'](_0x16cde8)){for(var _0x296cd9 in _0x16cde8){if(_0x16cde8[_0x65f6('0x22')](_0x296cd9)){_0x16cde8[_0x296cd9]['total']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x27')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2c')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2d')]=0x0;_0x16cde8[_0x296cd9]['sumHoldTime']=0x0;_0x16cde8[_0x296cd9]['sumDuration']=0x0;_0x16cde8[_0x296cd9]['sumBillable']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2e')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2f')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x30')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x31')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x32')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x33')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x34')]=0x0;_0x16cde8[_0x296cd9]['outboundDropCallsDayCallersExit']=0x0;_0x16cde8[_0x296cd9]['outboundBlacklistCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x35')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x36')]=0x0;_0x16cde8[_0x296cd9]['outboundReCallsDay']=0x0;_0x16cde8[_0x296cd9]['outboundAnswerAgiCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x37')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x38')]=!![];}}}}Realtime[_0x65f6('0x39')][_0x65f6('0x3a')]=function(_0x1217fd,_0x2d32be){for(var _0x5792a0 in _0x2d32be){if(_0x1217fd[_0x65f6('0x22')](_0x5792a0)){_0x1217fd[_0x5792a0]=_0x2d32be[_0x5792a0];}}};Realtime[_0x65f6('0x39')][_0x65f6('0x3b')]=function(){var _0x4bc037=this;return function(_0x217f35){if(_0x217f35){freeIsNotKeyAgent(_0x217f35,_0x4bc037[_0x65f6('0x3c')]);for(var _0xbaed3c=0x0,_0x45510a={};_0xbaed3c<_0x217f35[_0x65f6('0x3d')];_0xbaed3c+=0x1){_0x45510a=_0x217f35[_0xbaed3c];var _0x2f054c=_['isNil'](_0x45510a[_0x65f6('0x25')])?util[_0x65f6('0x24')]('SIP/%s',_0x45510a[_0x65f6('0x3e')]):_0x45510a['interface'];if(_[_0x65f6('0x3f')](_0x4bc037['agents'][_0x2f054c])){_0x4bc037[_0x65f6('0x3c')][_0x2f054c]=new Agent(_0x45510a);}else{_0x4bc037[_0x65f6('0x3a')](_0x4bc037['agents'][_0x2f054c],_0x45510a);}}}return _0x4bc037[_0x65f6('0x3c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x40')]=function(){var _0x515648=this;return function(_0x582c7e){if(_0x582c7e){freeIsNotKeySip(_0x582c7e,_0x515648[_0x65f6('0xf')]);for(var _0x4c0df4=0x0,_0x26de30={};_0x4c0df4<_0x582c7e['length'];_0x4c0df4+=0x1){_0x26de30=_0x582c7e[_0x4c0df4];if(_[_0x65f6('0x3f')](_0x515648[_0x65f6('0xf')][util['format'](_0x65f6('0x41'),_0x26de30['name'])])){_0x515648['telephones'][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])]=new Telephone(_0x26de30);}else{_0x515648[_0x65f6('0x3a')](_0x515648[_0x65f6('0xf')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])],_0x26de30);}}}return _0x515648['telephones'];};};Realtime[_0x65f6('0x39')]['initTrunks']=function(){var _0x12a589=this;return function(_0xa4394a){if(_0xa4394a){freeIsNotKeySip(_0xa4394a,_0x12a589[_0x65f6('0x10')]);for(var _0x2ea7f7=0x0,_0x5ef5c2={};_0x2ea7f7<_0xa4394a[_0x65f6('0x3d')];_0x2ea7f7+=0x1){_0x5ef5c2=_0xa4394a[_0x2ea7f7];if(_[_0x65f6('0x3f')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])])){_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2['name'])]=new Trunk(_0x5ef5c2);}else{_0x12a589[_0x65f6('0x3a')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])],_0x5ef5c2);}}}return _0x12a589[_0x65f6('0x10')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x42')]=function(){var _0x461393=this;return function(_0x2abbed){if(_0x2abbed){freeIsNotKey(_0x2abbed,_0x461393[_0x65f6('0x12')],'id');for(var _0x2c008a=0x0,_0x6c4d94={};_0x2c008a<_0x2abbed[_0x65f6('0x3d')];_0x2c008a+=0x1){_0x6c4d94=_0x2abbed[_0x2c008a];if(_[_0x65f6('0x3f')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']])){_0x461393['triggers'][_0x6c4d94['id']]=new Trigger(_0x6c4d94);}else{_0x461393[_0x65f6('0x3a')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']],_0x6c4d94);}}}return _0x461393[_0x65f6('0x12')];};};Realtime[_0x65f6('0x39')]['initTemplates']=function(){var _0x1bf5bf=this;return function(_0x2d0dac){if(_0x2d0dac){freeIsNotKey(_0x2d0dac,_0x1bf5bf[_0x65f6('0x13')],'id');for(var _0x5e69b4=0x0,_0x2dbab3={};_0x5e69b4<_0x2d0dac[_0x65f6('0x3d')];_0x5e69b4+=0x1){_0x2dbab3=_0x2d0dac[_0x5e69b4];if(_[_0x65f6('0x3f')](_0x1bf5bf[_0x65f6('0x13')][_0x2dbab3['id']])){_0x1bf5bf['templates'][_0x2dbab3['id']]=new Template(_0x2dbab3);}else{_0x1bf5bf[_0x65f6('0x3a')](_0x1bf5bf['templates'][_0x2dbab3['id']],_0x2dbab3);}}}return _0x1bf5bf[_0x65f6('0x13')];};};Realtime[_0x65f6('0x39')]['initZendeskAccounts']=function(){var _0xf754ee=this;return function(_0x5085db){if(_0x5085db){freeIsNotKey(_0x5085db,_0xf754ee[_0x65f6('0x17')],'id');for(var _0x4d9b76=0x0,_0x2d1706={};_0x4d9b76<_0x5085db[_0x65f6('0x3d')];_0x4d9b76+=0x1){_0x2d1706=_0x5085db[_0x4d9b76];if(_[_0x65f6('0x3f')](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']])){_0xf754ee['zendeskAccounts'][_0x2d1706['id']]=new ZendeskAccount(_0x2d1706);}else{_0xf754ee['mergeFromDatabase'](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']],_0x2d1706);}}}return _0xf754ee[_0x65f6('0x17')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x43')]=function(){var _0x3b907c=this;return function(_0x2d6ab9){if(_0x2d6ab9){freeIsNotKey(_0x2d6ab9,_0x3b907c[_0x65f6('0x18')],'id');for(var _0x41690c=0x0,_0x414f49={};_0x41690c<_0x2d6ab9['length'];_0x41690c+=0x1){_0x414f49=_0x2d6ab9[_0x41690c];if(_[_0x65f6('0x3f')](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']])){_0x3b907c[_0x65f6('0x18')][_0x414f49['id']]=new SalesforceAccount(_0x414f49);}else{_0x3b907c['mergeFromDatabase'](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']],_0x414f49);}}}return _0x3b907c[_0x65f6('0x18')];};};Realtime['prototype'][_0x65f6('0x44')]=function(){var _0x253d52=this;return function(_0x57eb04){if(_0x57eb04){freeIsNotKey(_0x57eb04,_0x253d52[_0x65f6('0x1a')],'id');for(var _0x4f96c4=0x0,_0x247be3={};_0x4f96c4<_0x57eb04[_0x65f6('0x3d')];_0x4f96c4+=0x1){_0x247be3=_0x57eb04[_0x4f96c4];if(_[_0x65f6('0x3f')](_0x253d52['freshdeskAccounts'][_0x247be3['id']])){_0x253d52[_0x65f6('0x1a')][_0x247be3['id']]=new FreshdeskAccount(_0x247be3);}else{_0x253d52[_0x65f6('0x3a')](_0x253d52['freshdeskAccounts'][_0x247be3['id']],_0x247be3);}}}return _0x253d52[_0x65f6('0x1a')];};};Realtime[_0x65f6('0x39')]['initZohoAccounts']=function(){var _0x34d6a9=this;return function(_0x344c0e){if(_0x344c0e){freeIsNotKey(_0x344c0e,_0x34d6a9[_0x65f6('0x1b')],'id');for(var _0x25d504=0x0,_0x234fa7={};_0x25d504<_0x344c0e[_0x65f6('0x3d')];_0x25d504+=0x1){_0x234fa7=_0x344c0e[_0x25d504];if(_[_0x65f6('0x3f')](_0x34d6a9[_0x65f6('0x1b')][_0x234fa7['id']])){_0x34d6a9['zohoAccounts'][_0x234fa7['id']]=new ZohoAccount(_0x234fa7);}else{_0x34d6a9['mergeFromDatabase'](_0x34d6a9['zohoAccounts'][_0x234fa7['id']],_0x234fa7);}}}return _0x34d6a9[_0x65f6('0x1b')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x45')]=function(){var _0x20c322=this;return function(_0x545445){if(_0x545445){freeIsNotKey(_0x545445,_0x20c322[_0x65f6('0x1c')],'id');for(var _0x2032b9=0x0,_0x9ff849={};_0x2032b9<_0x545445['length'];_0x2032b9+=0x1){_0x9ff849=_0x545445[_0x2032b9];if(_[_0x65f6('0x3f')](_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']])){_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']]=new DeskAccount(_0x9ff849);}else{_0x20c322['mergeFromDatabase'](_0x20c322['deskAccounts'][_0x9ff849['id']],_0x9ff849);}}}return _0x20c322[_0x65f6('0x1c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x46')]=function(){var _0x39364f=this;return function(_0x2a76b3){if(_0x2a76b3){freeIsNotKey(_0x2a76b3,_0x39364f[_0x65f6('0x19')],'id');for(var _0x35d77f=0x0,_0x138334={};_0x35d77f<_0x2a76b3[_0x65f6('0x3d')];_0x35d77f+=0x1){_0x138334=_0x2a76b3[_0x35d77f];if(_[_0x65f6('0x3f')](_0x39364f[_0x65f6('0x19')][_0x138334['id']])){_0x39364f[_0x65f6('0x19')][_0x138334['id']]=new SugarcrmAccount(_0x138334);}else{_0x39364f[_0x65f6('0x3a')](_0x39364f[_0x65f6('0x19')][_0x138334['id']],_0x138334);}}}return _0x39364f['sugarcrmAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x47')]=function(){var _0x42a805=this;return function(_0x4b4efe){if(_0x4b4efe){freeIsNotKey(_0x4b4efe,_0x42a805[_0x65f6('0x1d')],'id');for(var _0x16dec0=0x0,_0x4638c9={};_0x16dec0<_0x4b4efe[_0x65f6('0x3d')];_0x16dec0+=0x1){_0x4638c9=_0x4b4efe[_0x16dec0];if(_['isUndefined'](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']])){_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']]=new VtigerAccount(_0x4638c9);}else{_0x42a805[_0x65f6('0x3a')](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']],_0x4638c9);}}}return _0x42a805['vtigerAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x48')]=function(){var _0x5c55e4=this;return function(_0x28682b){if(_0x28682b){freeIsNotKey(_0x28682b,_0x5c55e4[_0x65f6('0x1e')],'id');for(var _0x36c316=0x0,_0x51549d={};_0x36c316<_0x28682b[_0x65f6('0x3d')];_0x36c316+=0x1){_0x51549d=_0x28682b[_0x36c316];if(_[_0x65f6('0x3f')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']])){_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']]=new ServicenowAccount(_0x51549d);}else{_0x5c55e4[_0x65f6('0x3a')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']],_0x51549d);}}}return _0x5c55e4['servicenowAccounts'];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x336a7d=this;return function(_0x367d95){if(_0x367d95){freeIsNotKey(_0x367d95,_0x336a7d[_0x65f6('0x1f')],'id');for(var _0x471bec=0x0,_0xab6f0={};_0x471bec<_0x367d95[_0x65f6('0x3d')];_0x471bec+=0x1){_0xab6f0=_0x367d95[_0x471bec];if(_['isUndefined'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']])){_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']]=new Dynamics365Account(_0xab6f0);}else{_0x336a7d['mergeFromDatabase'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']],_0xab6f0);}}}return _0x336a7d[_0x65f6('0x1f')];};};Realtime[_0x65f6('0x39')]['initFreshsalesAccounts']=function(){var _0x23c441=this;return function(_0x448c9a){if(_0x448c9a){freeIsNotKey(_0x448c9a,_0x23c441['freshsalesAccounts'],'id');for(var _0x271d76=0x0,_0x3edc6b={};_0x271d76<_0x448c9a[_0x65f6('0x3d')];_0x271d76+=0x1){_0x3edc6b=_0x448c9a[_0x271d76];if(_[_0x65f6('0x3f')](_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']])){_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']]=new FreshsalesAccount(_0x3edc6b);}else{_0x23c441[_0x65f6('0x3a')](_0x23c441['freshsalesAccounts'][_0x3edc6b['id']],_0x3edc6b);}}}return _0x23c441['freshsalesAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4a')]=function(){var _0x4a9524=this;return function(_0x417ba5){for(var _0x5f3df9=0x0;_0x5f3df9<_0x417ba5[_0x65f6('0x3d')];_0x5f3df9+=0x1){_['merge'](_0x4a9524[_0x65f6('0x11')][_0x417ba5[_0x5f3df9][_0x65f6('0x3e')]],_0x417ba5[_0x5f3df9]);}return _0x4a9524[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4b')]=function(){var _0x264e6c=this;return function(_0x1aaf75){clearVoiceQueues(_0x264e6c[_0x65f6('0x11')]);if(_0x1aaf75){_0x1aaf75=_[_0x65f6('0x4c')](_0x1aaf75,'uniqueid');for(var _0x480190 in _0x1aaf75){if(_0x1aaf75[_0x65f6('0x22')](_0x480190)){for(var _0x13ee4b=0x0;_0x13ee4b<_0x1aaf75[_0x480190][_0x65f6('0x3d')];_0x13ee4b+=0x1){var _0x51497f=_0x1aaf75[_0x480190][_0x13ee4b]['queue'];if(_0x264e6c[_0x65f6('0x11')][_0x51497f]){if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4d')]){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x2c')]+=0x1;}if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4e')]){_0x264e6c[_0x65f6('0x11')][_0x51497f]['abandoned']+=0x1;}_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4f')])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;if(_0x13ee4b===_0x1aaf75[_0x480190][_0x65f6('0x3d')]-0x1){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x52')]||_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerabandonAt']||_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x53')])[_0x65f6('0x54')](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x26')]+=0x1;if(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercomplete']){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x27')]+=0x1;_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x29')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercompleteAt'])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerleaveAt']),_0x65f6('0x55'))||0x0;}}else{_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]||0x0;}}}}}}return _0x264e6c[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')]['initVoiceCallReports']=function(){var _0x40d0f7=this;return function(_0x15809e){clearVoiceCallReports(_0x40d0f7['outbound']);if(_0x15809e){for(var _0x758e80=0x0;_0x758e80<_0x15809e[_0x65f6('0x3d')];_0x758e80+=0x1){_0x40d0f7['outbound'][_0x65f6('0x26')]+=0x1;_0x40d0f7['outbound'][_0x65f6('0x51')]+=_0x15809e[_0x758e80]['duration'];if(_0x15809e[_0x758e80][_0x65f6('0x56')]===_0x65f6('0x57')){_0x40d0f7['outbound'][_0x65f6('0x27')]+=0x1;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x28')]+=_0x15809e[_0x758e80][_0x65f6('0x59')]-_0x15809e[_0x758e80][_0x65f6('0x5a')]||0x0;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x29')]+=_0x15809e[_0x758e80][_0x65f6('0x5a')];}}}return _0x40d0f7[_0x65f6('0x58')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x5b')]=function(){var _0x574d84=this;return function(_0x10a661){if(_0x10a661){freeIsNotKey(_0x10a661,_0x574d84[_0x65f6('0x5c')],_0x65f6('0x3e'));for(var _0x219e42=0x0,_0x5694f9={};_0x219e42<_0x10a661[_0x65f6('0x3d')];_0x219e42+=0x1){_0x5694f9=_0x10a661[_0x219e42];if(_[_0x65f6('0x3f')](_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]])){_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]]=new Campaign(_0x5694f9);}else{_0x574d84['mergeFromDatabase'](_0x574d84[_0x65f6('0x5c')][_0x5694f9[_0x65f6('0x3e')]],_0x5694f9);_0x574d84['campaigns'][_0x5694f9['name']][_0x65f6('0x5d')]=_0x5694f9[_0x65f6('0x5e')]?_0x5694f9['SquareProject'][_0x65f6('0x3e')]:undefined;}}}return _0x574d84[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')]['initVoiceExtensions']=function(){var _0x1348ec=this;return function(_0x246510){if(_0x246510){freeIsNotKey(_0x246510,_0x1348ec['voiceExtensions'],'id');for(var _0x36b8de=0x0,_0x504b39={};_0x36b8de<_0x246510[_0x65f6('0x3d')];_0x36b8de+=0x1){_0x504b39=_0x246510[_0x36b8de];if(_['isUndefined'](_0x1348ec['voiceExtensions'][_0x504b39['id']])){_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']]=new VoiceExtension(_0x504b39);}else{_0x1348ec[_0x65f6('0x3a')](_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']],_0x504b39);}}}return _0x1348ec[_0x65f6('0x5f')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x60')]=function(){var _0x1ac46f=this;return function(_0x1f4e2c){clearCampaigns(_0x1ac46f['campaigns']);for(var _0x494904=0x0;_0x494904<_0x1f4e2c[_0x65f6('0x3d')];_0x494904+=0x1){_['merge'](_0x1ac46f[_0x65f6('0x5c')][_0x1f4e2c[_0x494904][_0x65f6('0x3e')]],_0x1f4e2c[_0x494904]);}return _0x1ac46f[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x61')]=function(){var _0x56bd9d=this;return function(_0x398cac){if(_0x398cac){freeIsNotKey(_0x398cac,_0x56bd9d[_0x65f6('0x20')],'id');for(var _0x14c908=0x0,_0x576ecd={};_0x14c908<_0x398cac[_0x65f6('0x3d')];_0x14c908+=0x1){_0x576ecd=_0x398cac[_0x14c908];if(_[_0x65f6('0x3f')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']])){_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']]=new FaxAccount(_0x576ecd);}else{_0x56bd9d[_0x65f6('0x3a')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']],_0x576ecd);}}}return _0x56bd9d['faxAccounts'];};};Realtime['prototype'][_0x65f6('0x62')]=function(){var _0x10d744=this;return function(_0x10c916){if(_0x10c916){freeIsNotKey(_0x10c916,_0x10d744[_0x65f6('0x11')],'name');for(var _0x4bda86=0x0,_0x336076={};_0x4bda86<_0x10c916[_0x65f6('0x3d')];_0x4bda86+=0x1){_0x336076=_0x10c916[_0x4bda86];if(_[_0x65f6('0x3f')](_0x10d744[_0x65f6('0x11')][_0x336076[_0x65f6('0x3e')]])){_0x10d744[_0x65f6('0x11')][_0x336076['name']]=new VoiceQueue(_0x336076);}else{_0x10d744['mergeFromDatabase'](_0x10d744['voiceQueues'][_0x336076[_0x65f6('0x3e')]],_0x336076);}}}return _0x10d744[_0x65f6('0x11')];};};module[_0x65f6('0x63')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 2a91504..305053e 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8310=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x13553b,_0x10b2c0){var _0x10bcd4=function(_0x2cfc93){while(--_0x2cfc93){_0x13553b['push'](_0x13553b['shift']());}};_0x10bcd4(++_0x10b2c0);}(_0x8310,0xd6));var _0x0831=function(_0x338f73,_0x1945c8){_0x338f73=_0x338f73-0x0;var _0x163fdf=_0x8310[_0x338f73];return _0x163fdf;};'use strict';function mergeDBDataToRealtime(_0x3fccb7,_0x5c98c7){var _0x303417=Object[_0x0831('0x0')]({},_0x3fccb7);for(var _0x543386 in _0x5c98c7){if(_0x303417[_0x0831('0x1')](_0x543386)){_0x303417[_0x543386]=_0x5c98c7[_0x543386];}}return _0x303417;}exports[_0x0831('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xb043=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0xb043,0x1e3));var _0x3b04=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0xb043[_0x396466];return _0x5e9ab4;};'use strict';function mergeDBDataToRealtime(_0x18a4db,_0x3c5b46){var _0x154d16=Object[_0x3b04('0x0')]({},_0x18a4db);for(var _0x23caad in _0x3c5b46){if(_0x154d16[_0x3b04('0x1')](_0x23caad)){_0x154d16[_0x23caad]=_0x3c5b46[_0x23caad];}}return _0x154d16;}exports[_0x3b04('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 6494b5e..5b1f2e3 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 _0xec78=['./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','accountcode','name','isNil','find','interface','length','connectedlinenum','lastAssignedTo','format','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','keys','channel','outbound','destination','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','split','membername','monitor','monitors','monitorFilename','createdAt','exten','connectedlinename','xcally-motion-dialer','forEach','voiceDialReport','Local','substring','indexOf','mobile','lastIndexOf','attendedTransfer','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xec78,0x109));var _0x8ec7=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0xec78[_0x4bd06e];return _0x85ebb;};'use strict';var _=require(_0x8ec7('0x0'));var moment=require(_0x8ec7('0x1'));var util=require('util');var config=require(_0x8ec7('0x2'));var ami=require(_0x8ec7('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x8ec7('0x4'));var RpcVoiceDialReport=require(_0x8ec7('0x5'));var RpcMemberReport=require(_0x8ec7('0x6'));var RpcVoiceQueueReport=require(_0x8ec7('0x7'));var RpcVoiceRecording=require(_0x8ec7('0x8'));var RpcVoiceTransferReport=require(_0x8ec7('0x9'));var VoiceQueueReport=require(_0x8ec7('0xa'));var VoiceCallReport=require(_0x8ec7('0xb'));var VoiceAgentReport=require(_0x8ec7('0xc'));var VoiceDialReport=require(_0x8ec7('0xd'));var UserReport=require(_0x8ec7('0xe'));function Report(_0x265d34){this['realtime']=_0x265d34;this[_0x8ec7('0xf')]=_0x265d34[_0x8ec7('0xf')];this[_0x8ec7('0x10')]=_0x265d34[_0x8ec7('0x10')];}Report[_0x8ec7('0x11')][_0x8ec7('0x12')]=function(_0x1ff17f){var _0x343584=new VoiceQueueReport(this['realtime']);var _0x3f2b76=new VoiceAgentReport(this[_0x8ec7('0x13')]);var _0x257401=new VoiceDialReport(this['realtime']);var _0x3bdd20=new VoiceCallReport(this['realtime']);var _0x1b10c8=new UserReport(this['realtime']);if(config[_0x8ec7('0x14')]&&config['xdr'][_0x8ec7('0x15')]){ami['on'](_0x8ec7('0x16'),this[_0x8ec7('0x17')][_0x8ec7('0x18')](this));ami['on']('custom:voiceCallReport',this[_0x8ec7('0x19')]['bind'](this));ami['on'](_0x8ec7('0x1a'),this[_0x8ec7('0x1b')][_0x8ec7('0x18')](this));ami['on'](_0x8ec7('0x1c'),this['voiceDialReport'][_0x8ec7('0x18')](this));ami['on'](_0x8ec7('0x1d'),this[_0x8ec7('0x1e')]['bind'](this));ami['on'](_0x8ec7('0x1f'),this['attendedTransfer'][_0x8ec7('0x18')](this));}};Report[_0x8ec7('0x11')][_0x8ec7('0x20')]=function(_0x701b92){var _0x58524a;_0x58524a=_['find'](this[_0x8ec7('0xf')],function(_0x5daa58){return _0x5daa58[_0x8ec7('0x21')]==_0x701b92||_0x5daa58[_0x8ec7('0x22')]==_0x701b92;});if(_[_0x8ec7('0x23')](_0x58524a)){var _0x4e41cc=_[_0x8ec7('0x24')](this[_0x8ec7('0x10')],function(_0x3871d6){return _0x3871d6[_0x8ec7('0x21')]==_0x701b92||_0x3871d6[_0x8ec7('0x22')]==_0x701b92;});if(_0x4e41cc){_0x58524a=_[_0x8ec7('0x24')](this[_0x8ec7('0xf')],function(_0x32d9bf){return _0x32d9bf[_0x8ec7('0x25')]==util['format']('SIP/%s',_0x4e41cc[_0x8ec7('0x22')]);});}}return _0x58524a;};Report['prototype'][_0x8ec7('0x17')]=function(_0x3a7da8){for(var _0x44aaca=0x0;_0x44aaca<_0x3a7da8[_0x8ec7('0x26')];_0x44aaca+=0x1){var _0x35a4e0=this[_0x8ec7('0x20')](_0x3a7da8[_0x44aaca][_0x8ec7('0x27')]);if(_0x35a4e0){_0x3a7da8[_0x44aaca][_0x8ec7('0x21')]=_0x35a4e0[_0x8ec7('0x21')];_0x3a7da8[_0x44aaca]['assigned']=!![];_0x3a7da8[_0x44aaca][_0x8ec7('0x28')]=_0x35a4e0['name'];_0x3a7da8[_0x44aaca][_0x8ec7('0x25')]=_['isNil'](_0x35a4e0[_0x8ec7('0x25')])?util[_0x8ec7('0x29')](_0x8ec7('0x2a'),_0x35a4e0[_0x8ec7('0x22')]):_0x35a4e0[_0x8ec7('0x25')];if(_0x3a7da8[_0x44aaca][_0x8ec7('0x2b')]){_0x3a7da8[_0x44aaca][_0x8ec7('0x2c')]=moment()[_0x8ec7('0x29')](_0x8ec7('0x2d'));}if(_0x3a7da8[_0x44aaca][_0x8ec7('0x2e')]){_0x3a7da8[_0x44aaca][_0x8ec7('0x2f')]=moment()[_0x8ec7('0x29')](_0x8ec7('0x2d'));}RpcMemberReport[_0x8ec7('0x17')](_0x3a7da8[_0x44aaca]);}RpcVoiceQueueReport[_0x8ec7('0x30')](_0x3a7da8[_0x44aaca]);}};function extractCalleridNumber(_0x1cb686){var _0x421362=_0x1cb686['match'](/<(.*?)>/);return _0x421362?_0x421362[0x1]:_0x1cb686;}Report[_0x8ec7('0x11')]['getAgentByInternal']=function(_0x473895){for(var _0x4fd9ff=0x0;_0x4fd9ff/);return _0x4f9d82?_0x4f9d82[0x1]:_0x4097ae;}Report[_0xf2bc('0x1b')][_0xf2bc('0x2e')]=function(_0x6b00d8){for(var _0xd23dc1=0x0;_0xd23dc1',_0x7f8e45[_0xf2bc('0x45')],_0x7f8e45['calleridnum']);}if(RpcVoiceTransferReport['transfers'][_0x7f8e45['linkedid']]){var _0x3aa160=RpcVoiceTransferReport[_0xf2bc('0x46')][_0x7f8e45['linkedid']];_0x3aa160[_0xf2bc('0x47')]=_0x7f8e45[_0xf2bc('0x48')];RpcVoiceTransferReport[_0xf2bc('0x49')](_0x3aa160);delete RpcVoiceTransferReport[_0xf2bc('0x46')][_0x7f8e45['linkedid']];}if(_[_0xf2bc('0x1f')](_0x7f8e45[_0xf2bc('0x36')])){_0x7f8e45[_0xf2bc('0x36')]=this['getCallType'](_0x7f8e45);}if(_[_0xf2bc('0x1f')](_0x7f8e45[_0xf2bc('0x4a')])){var _0x446d6f=_0x7f8e45[_0xf2bc('0x40')][_0xf2bc('0x30')]('-')[0x0];var _0x534012=this[_0xf2bc('0x10')][_0x446d6f];if(!_0x534012)_0x534012=this[_0xf2bc('0x2e')](_0x7f8e45[_0xf2bc('0x1e')]);if(_0x534012){_0x7f8e45[_0xf2bc('0x4a')]=_0x534012['id'];_0x7f8e45['membername']=_0x534012[_0xf2bc('0x20')];}}RpcVoiceCallReport[_0xf2bc('0x2c')](_0x7f8e45);if(_0x7f8e45[_0xf2bc('0x4b')]){for(var _0x4c4994=0x0;_0x4c4994<_0x7f8e45[_0xf2bc('0x4c')][_0xf2bc('0x22')];_0x4c4994+=0x1){_0x7f8e45['monitorFilename']=_0x7f8e45[_0xf2bc('0x4c')][_0x4c4994][_0xf2bc('0x4d')];_0x7f8e45[_0xf2bc('0x4e')]=_0x7f8e45['monitors'][_0x4c4994][_0xf2bc('0x4e')];if(_0x7f8e45[_0xf2bc('0x35')]==_0xf2bc('0x3d')){_0x7f8e45[_0xf2bc('0x31')]=_0x7f8e45[_0xf2bc('0x44')];_0x7f8e45['calleridname']=_0x7f8e45['connectedlinename'];_0x7f8e45[_0xf2bc('0x44')]=_0x7f8e45[_0xf2bc('0x1e')];_0x7f8e45['connectedlinename']=_0x7f8e45[_0xf2bc('0x4f')];_0x7f8e45[_0xf2bc('0x35')]=_0x7f8e45[_0xf2bc('0x41')];}else if(_0x7f8e45[_0xf2bc('0x35')]==_0xf2bc('0x50')){_0x7f8e45['calleridnum']=_0x7f8e45[_0xf2bc('0x34')];_0x7f8e45['exten']=_0x7f8e45[_0xf2bc('0x41')];}RpcVoiceRecording[_0xf2bc('0x2c')](_0x7f8e45);}}};Report[_0xf2bc('0x1b')]['voiceAgentReport']=function(_0x75c397){if(_[_0xf2bc('0x51')](_0x75c397)){_0x75c397[_0xf2bc('0x52')](function(_0x244b2c){RpcVoiceAgentReport[_0xf2bc('0x2c')](_0x244b2c);});}else{RpcVoiceAgentReport[_0xf2bc('0x2c')](_0x75c397);}};Report['prototype'][_0xf2bc('0x19')]=function(_0x2a923c){RpcVoiceDialReport[_0xf2bc('0x2c')](_0x2a923c);var _0x53bbb8;var _0x5c364a;var _0x51c4bc=_0x2a923c[_0xf2bc('0x40')];if(_[_0xf2bc('0x53')](_0x51c4bc,'Local')){_0x5c364a=_0x51c4bc[_0xf2bc('0x54')](_0x51c4bc[_0xf2bc('0x55')]('/')+0x1,_0x51c4bc[_0xf2bc('0x55')]('@'));_0x53bbb8=_[_0xf2bc('0x1d')](this['agents'],function(_0x2ea8bf){return _0x2ea8bf[_0xf2bc('0x56')]==_0x5c364a||_0x2ea8bf[_0xf2bc('0x57')]==_0x5c364a||_0x2ea8bf[_0xf2bc('0x1e')]==_0x5c364a;});}else{_0x5c364a=_0x51c4bc[_0xf2bc('0x54')](_0x51c4bc[_0xf2bc('0x55')]('/')+0x1,_0x51c4bc[_0xf2bc('0x58')]('-'));_0x53bbb8=this['findAgent'](_0x5c364a);}if(_0x53bbb8){_0x2a923c['interface']=_[_0xf2bc('0x1f')](_0x53bbb8[_0xf2bc('0x25')])?util[_0xf2bc('0x26')](_0xf2bc('0x27'),_0x53bbb8[_0xf2bc('0x20')]):_0x53bbb8[_0xf2bc('0x25')];_0x2a923c[_0xf2bc('0x4f')]=_0x53bbb8['name'];_0x2a923c[_0xf2bc('0x1e')]=_0x53bbb8[_0xf2bc('0x1e')];RpcMemberReport[_0xf2bc('0x19')](_0x2a923c);}};Report[_0xf2bc('0x1b')][_0xf2bc('0x49')]=function(_0x63be20){RpcVoiceTransferReport[_0xf2bc('0x46')][_0x63be20[_0xf2bc('0x59')]]=_0x63be20;};Report['prototype'][_0xf2bc('0x5a')]=function(_0x46ef6f){RpcVoiceTransferReport[_0xf2bc('0x5a')](_0x46ef6f);};module[_0xf2bc('0x5b')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 15ec35f..7238d31 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 _0x46e6=['inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','prototype','isUndefined','emit','isNotNull','info','state','debug','find','username','stateRegistry','merge','omit','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','substring','indexOf','mobile','phone','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','address','status','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','../ami','redis','localhost','trunks','agents','telephones','bind','registry','syncRegistry','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error'];(function(_0x1156b3,_0x3a5b09){var _0x21e503=function(_0x5c09fb){while(--_0x5c09fb){_0x1156b3['push'](_0x1156b3['shift']());}};_0x21e503(++_0x3a5b09);}(_0x46e6,0x1d8));var _0x646e=function(_0x56c592,_0xf82623){_0x56c592=_0x56c592-0x0;var _0x3a73a7=_0x46e6[_0x56c592];return _0x3a73a7;};'use strict';var _=require(_0x646e('0x0'));var moment=require(_0x646e('0x1'));var util=require(_0x646e('0x2'));var Redis=require(_0x646e('0x3'));var BPromise=require(_0x646e('0x4'));var config=require(_0x646e('0x5'));var logger=require(_0x646e('0x6'))('ami');var ami=require(_0x646e('0x7'));config['redis']=_['defaults'](config[_0x646e('0x8')],{'host':_0x646e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x646e('0x8')]));function UserReport(_0x1087a2){this['trunks']=_0x1087a2[_0x646e('0xa')];this[_0x646e('0xb')]=_0x1087a2['agents'];this[_0x646e('0xc')]=_0x1087a2['telephones'];ami['on']('registryentry',this['syncRegistry'][_0x646e('0xd')](this));ami['on'](_0x646e('0xe'),this[_0x646e('0xf')][_0x646e('0xd')](this));ami['on']('devicestatechange',this[_0x646e('0x10')][_0x646e('0xd')](this));ami['on'](_0x646e('0x11'),this[_0x646e('0x12')][_0x646e('0xd')](this));return this[_0x646e('0x13')]();}function showSipRegistrations(){Promise[_0x646e('0x14')]()[_0x646e('0x15')](ami[_0x646e('0x16')]())[_0x646e('0x17')](function(_0x2314c1){logger[_0x646e('0x18')]('[userReport][sipshowregistry]',util[_0x646e('0x19')](_0x2314c1,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x646e('0x14')]()[_0x646e('0x15')](ami[_0x646e('0x1a')]())['catch'](function(_0xe7e3eb){logger['error'](_0x646e('0x1b'),util['inspect'](_0xe7e3eb,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x646e('0x14')]()['then'](ami[_0x646e('0x1c')]())[_0x646e('0x17')](function(_0x341b07){logger[_0x646e('0x18')]('[userReport][sippeerstatus]',util['inspect'](_0x341b07,{'showHidden':![],'depth':null}));});}UserReport[_0x646e('0x1d')][_0x646e('0x13')]=function(){setInterval(function(){BPromise[_0x646e('0x14')]()['then'](showSipRegistrations())[_0x646e('0x15')](listDeviceStates())[_0x646e('0x15')](showPeersStatus());},0x32c8);};UserReport[_0x646e('0x1d')]['isNotNull']=function(_0x4c7775){return _0x4c7775!==null&&!_[_0x646e('0x1e')](_0x4c7775);};UserReport[_0x646e('0x1d')][_0x646e('0x1f')]=function(_0x24d429,_0x1be780,_0x524b8a){io['to'](_0x24d429)['emit'](_0x1be780,_0x524b8a);};UserReport[_0x646e('0x1d')][_0x646e('0xf')]=function(_0x2820d8){try{if(this[_0x646e('0x20')](_0x2820d8)){logger[_0x646e('0x21')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x2820d8['username'],_0x2820d8[_0x646e('0x22')]);logger[_0x646e('0x23')]('[userReport][registry]',util[_0x646e('0x19')](_0x2820d8,{'showHidden':![],'depth':null}));var _0x34a135=_[_0x646e('0x24')](this[_0x646e('0xa')],{'defaultuser':_0x2820d8[_0x646e('0x25')]});if(_0x34a135){_0x2820d8[_0x646e('0x26')]=_0x2820d8[_0x646e('0x22')];_[_0x646e('0x27')](_0x34a135,_[_0x646e('0x28')](_0x2820d8,[_0x646e('0x29'),'actionid','username',_0x646e('0x22')]));logger['debug'](_0x646e('0x2a'),util['inspect'](_0x34a135,{'showHidden':![],'depth':null}));this[_0x646e('0x1f')](util[_0x646e('0x2b')](_0x646e('0x2c'),_0x34a135[_0x646e('0x2d')]),_0x646e('0x2e'),_0x34a135);}}}catch(_0x3097dc){logger[_0x646e('0x18')]('[userReport][registry]',util['inspect'](_0x3097dc,{'showHidden':![],'depth':null}));}};UserReport[_0x646e('0x1d')][_0x646e('0x10')]=function(_0x436f1b){try{if(this[_0x646e('0x20')](_0x436f1b)){logger[_0x646e('0x21')](_0x646e('0x2f'),_0x436f1b[_0x646e('0x30')],_0x436f1b[_0x646e('0x22')]);logger['debug'](_0x646e('0x31'),util[_0x646e('0x19')](_0x436f1b,{'showHidden':![],'depth':null}));if(this[_0x646e('0xb')][_0x436f1b[_0x646e('0x30')]]){if(!this[_0x646e('0xb')][_0x436f1b[_0x646e('0x30')]][_0x646e('0x32')]||_0x436f1b[_0x646e('0x22')][_0x646e('0x33')]()=='inuse'){this['agents'][_0x436f1b['device']][_0x646e('0x32')]=![];if(this[_0x646e('0xb')][_0x436f1b[_0x646e('0x30')]][_0x646e('0x22')]!==_0x436f1b['state'][_0x646e('0x33')]()){this[_0x646e('0xb')][_0x436f1b[_0x646e('0x30')]][_0x646e('0x34')]=_[_0x646e('0x35')](moment()['format']('x'));}this[_0x646e('0xb')][_0x436f1b[_0x646e('0x30')]]['state']=_0x436f1b[_0x646e('0x22')]['toLowerCase']();this[_0x646e('0xb')][_0x436f1b[_0x646e('0x30')]][_0x646e('0x36')](_0x436f1b);}}else if(this[_0x646e('0xc')][_0x436f1b[_0x646e('0x30')]]){if(this[_0x646e('0xc')][_0x436f1b[_0x646e('0x30')]][_0x646e('0x22')]!==_0x436f1b[_0x646e('0x22')]['toLowerCase']()){this[_0x646e('0xc')][_0x436f1b[_0x646e('0x30')]][_0x646e('0x34')]=_[_0x646e('0x35')](moment()[_0x646e('0x2b')]('x'));}this[_0x646e('0xc')][_0x436f1b[_0x646e('0x30')]][_0x646e('0x22')]=_0x436f1b[_0x646e('0x22')][_0x646e('0x33')]();logger[_0x646e('0x23')](_0x646e('0x37'),util[_0x646e('0x19')](this[_0x646e('0xc')][_0x436f1b[_0x646e('0x30')]],{'showHidden':![],'depth':null}));this[_0x646e('0x1f')](util[_0x646e('0x2b')](_0x646e('0x38'),this[_0x646e('0xc')][_0x436f1b[_0x646e('0x30')]]['name']),_0x646e('0x39'),this[_0x646e('0xc')][_0x436f1b[_0x646e('0x30')]]);}else if(this[_0x646e('0xa')][_0x436f1b[_0x646e('0x30')]]){if(this[_0x646e('0xa')][_0x436f1b[_0x646e('0x30')]]['state']!==_0x436f1b['state'][_0x646e('0x33')]()){this[_0x646e('0xa')][_0x436f1b[_0x646e('0x30')]][_0x646e('0x34')]=_[_0x646e('0x35')](moment()[_0x646e('0x2b')]('x'));}this[_0x646e('0xa')][_0x436f1b['device']][_0x646e('0x22')]=_0x436f1b['state']['toLowerCase']();logger[_0x646e('0x23')](_0x646e('0x3a'),util[_0x646e('0x19')](this[_0x646e('0xa')][_0x436f1b[_0x646e('0x30')]],{'showHidden':![],'depth':null}));this[_0x646e('0x1f')](util[_0x646e('0x2b')](_0x646e('0x2c'),this['trunks'][_0x436f1b[_0x646e('0x30')]][_0x646e('0x2d')]),'trunk:save',this[_0x646e('0xa')][_0x436f1b[_0x646e('0x30')]]);}else if(_['startsWith'](_0x436f1b[_0x646e('0x30')],_0x646e('0x3b'))){var _0xed9a00=_0x436f1b[_0x646e('0x30')];var _0x48ce78=_0xed9a00[_0x646e('0x3c')](_0xed9a00['indexOf']('/')+0x1,_0xed9a00[_0x646e('0x3d')]('@'));var _0x477301=_[_0x646e('0x24')](this[_0x646e('0xb')],function(_0x424a88){return _0x424a88[_0x646e('0x3e')]==_0x48ce78||_0x424a88[_0x646e('0x3f')]==_0x48ce78||_0x424a88['accountcode']==_0x48ce78;});if(_0x477301){if(_0x477301['state']!==_0x436f1b[_0x646e('0x22')]['toLowerCase']()){_0x477301[_0x646e('0x34')]=_[_0x646e('0x35')](moment()['format']('x'));}_0x477301[_0x646e('0x22')]=_0x436f1b[_0x646e('0x22')][_0x646e('0x33')]();_0x477301[_0x646e('0x32')]=!![];_0x477301['updateStatusRealtime'](_0x436f1b);}}}}catch(_0x4559dc){logger[_0x646e('0x18')](_0x646e('0x31'),util[_0x646e('0x19')](_0x4559dc,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncPeerStatus']=function(_0xca7ebf){try{if(this['isNotNull'](_0xca7ebf)&&this[_0x646e('0x20')](_0xca7ebf[_0x646e('0x11')])){logger['info'](_0x646e('0x40'),_0xca7ebf[_0x646e('0x41')],_0xca7ebf['address'],_0xca7ebf[_0x646e('0x11')]);logger['debug'](_0x646e('0x42'),util[_0x646e('0x19')](_0xca7ebf,{'showHidden':![],'depth':null}));if(this[_0x646e('0xb')][_0xca7ebf['peer']]){if(!this[_0x646e('0xb')][_0xca7ebf[_0x646e('0x41')]][_0x646e('0x32')]||_0xca7ebf[_0x646e('0x11')][_0x646e('0x33')]()==_0x646e('0x43')){this['agents'][_0xca7ebf[_0x646e('0x41')]][_0x646e('0x32')]=![];this[_0x646e('0xb')][_0xca7ebf[_0x646e('0x41')]]['status']=_0xca7ebf[_0x646e('0x11')]['toLowerCase']();this['agents'][_0xca7ebf[_0x646e('0x41')]][_0x646e('0x44')]=_0xca7ebf[_0x646e('0x44')];this[_0x646e('0xb')][_0xca7ebf[_0x646e('0x41')]][_0x646e('0x36')](_0xca7ebf);}}else if(this[_0x646e('0xc')][_0xca7ebf[_0x646e('0x41')]]){this[_0x646e('0xc')][_0xca7ebf[_0x646e('0x41')]][_0x646e('0x45')]=_0xca7ebf[_0x646e('0x11')][_0x646e('0x33')]();this[_0x646e('0xc')][_0xca7ebf[_0x646e('0x41')]][_0x646e('0x44')]=_0xca7ebf['address'];logger[_0x646e('0x23')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x646e('0x19')](this['telephones'][_0xca7ebf[_0x646e('0x41')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('telephone:%s',this[_0x646e('0xc')][_0xca7ebf['peer']][_0x646e('0x2d')]),_0x646e('0x39'),this[_0x646e('0xc')][_0xca7ebf[_0x646e('0x41')]]);}else if(this[_0x646e('0xa')][_0xca7ebf[_0x646e('0x41')]]){this['trunks'][_0xca7ebf[_0x646e('0x41')]][_0x646e('0x45')]=_0xca7ebf['peerstatus'][_0x646e('0x33')]();this[_0x646e('0xa')][_0xca7ebf['peer']][_0x646e('0x44')]=_0xca7ebf[_0x646e('0x44')];logger[_0x646e('0x23')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x646e('0x19')](this[_0x646e('0xa')][_0xca7ebf['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0x646e('0x2b')](_0x646e('0x2c'),this[_0x646e('0xa')][_0xca7ebf[_0x646e('0x41')]][_0x646e('0x2d')]),_0x646e('0x2e'),this['trunks'][_0xca7ebf['peer']]);}}}catch(_0x473036){logger[_0x646e('0x18')](_0x646e('0x42'),util[_0x646e('0x19')](_0x473036,{'showHidden':![],'depth':null}));}};module[_0x646e('0x46')]=UserReport; \ No newline at end of file +var _0x6d2a=['peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','moment','util','../../../config/environment','../../../config/logger','../ami','redis','defaults','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','error','[userReport][sippeerstatus]','prototype','isNotNull','emit','info','username','state','debug','[userReport][registry]','stateRegistry','merge','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','inuse','toLowerCase','stateTime','toNumber','format','updateStatusRealtime','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','indexOf','find','mobile','phone','accountcode'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6d2a,0x124));var _0xa6d2=function(_0x51f492,_0x6b3e08){_0x51f492=_0x51f492-0x0;var _0x4c76eb=_0x6d2a[_0x51f492];return _0x4c76eb;};'use strict';var _=require('lodash');var moment=require(_0xa6d2('0x0'));var util=require(_0xa6d2('0x1'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0xa6d2('0x2'));var logger=require(_0xa6d2('0x3'))('ami');var ami=require(_0xa6d2('0x4'));config[_0xa6d2('0x5')]=_[_0xa6d2('0x6')](config[_0xa6d2('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function UserReport(_0x10216b){this[_0xa6d2('0x7')]=_0x10216b[_0xa6d2('0x7')];this[_0xa6d2('0x8')]=_0x10216b['agents'];this[_0xa6d2('0x9')]=_0x10216b[_0xa6d2('0x9')];ami['on'](_0xa6d2('0xa'),this[_0xa6d2('0xb')]['bind'](this));ami['on'](_0xa6d2('0xc'),this[_0xa6d2('0xb')][_0xa6d2('0xd')](this));ami['on'](_0xa6d2('0xe'),this['syncDeviceState'][_0xa6d2('0xd')](this));ami['on'](_0xa6d2('0xf'),this[_0xa6d2('0x10')][_0xa6d2('0xd')](this));return this[_0xa6d2('0x11')]();}function showSipRegistrations(){Promise[_0xa6d2('0x12')]()[_0xa6d2('0x13')](ami[_0xa6d2('0x14')]())[_0xa6d2('0x15')](function(_0x1e6c2c){logger['error'](_0xa6d2('0x16'),util[_0xa6d2('0x17')](_0x1e6c2c,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xa6d2('0x12')]()[_0xa6d2('0x13')](ami[_0xa6d2('0x18')]())['catch'](function(_0x160faf){logger['error'](_0xa6d2('0x19'),util['inspect'](_0x160faf,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0xa6d2('0x13')](ami['actionSipPeerStatus']())[_0xa6d2('0x15')](function(_0x1d4724){logger[_0xa6d2('0x1a')](_0xa6d2('0x1b'),util[_0xa6d2('0x17')](_0x1d4724,{'showHidden':![],'depth':null}));});}UserReport[_0xa6d2('0x1c')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0xa6d2('0x12')]()['then'](showSipRegistrations())[_0xa6d2('0x13')](listDeviceStates())[_0xa6d2('0x13')](showPeersStatus());},0x32c8);};UserReport[_0xa6d2('0x1c')][_0xa6d2('0x1d')]=function(_0x4c2baa){return _0x4c2baa!==null&&!_['isUndefined'](_0x4c2baa);};UserReport[_0xa6d2('0x1c')][_0xa6d2('0x1e')]=function(_0xb1d968,_0x4179e3,_0x47104f){io['to'](_0xb1d968)['emit'](_0x4179e3,_0x47104f);};UserReport[_0xa6d2('0x1c')]['syncRegistry']=function(_0x362c93){try{if(this[_0xa6d2('0x1d')](_0x362c93)){logger[_0xa6d2('0x1f')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x362c93[_0xa6d2('0x20')],_0x362c93[_0xa6d2('0x21')]);logger[_0xa6d2('0x22')](_0xa6d2('0x23'),util['inspect'](_0x362c93,{'showHidden':![],'depth':null}));var _0x44ec52=_['find'](this[_0xa6d2('0x7')],{'defaultuser':_0x362c93[_0xa6d2('0x20')]});if(_0x44ec52){_0x362c93[_0xa6d2('0x24')]=_0x362c93['state'];_[_0xa6d2('0x25')](_0x44ec52,_['omit'](_0x362c93,[_0xa6d2('0x26'),_0xa6d2('0x27'),_0xa6d2('0x20'),_0xa6d2('0x21')]));logger[_0xa6d2('0x22')](_0xa6d2('0x28'),util[_0xa6d2('0x17')](_0x44ec52,{'showHidden':![],'depth':null}));this[_0xa6d2('0x1e')](util['format'](_0xa6d2('0x29'),_0x44ec52[_0xa6d2('0x2a')]),_0xa6d2('0x2b'),_0x44ec52);}}}catch(_0x53dc63){logger['error'](_0xa6d2('0x23'),util[_0xa6d2('0x17')](_0x53dc63,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xa6d2('0x2c')]=function(_0x198c89){try{if(this['isNotNull'](_0x198c89)){logger['info'](_0xa6d2('0x2d'),_0x198c89[_0xa6d2('0x2e')],_0x198c89[_0xa6d2('0x21')]);logger[_0xa6d2('0x22')](_0xa6d2('0x2f'),util['inspect'](_0x198c89,{'showHidden':![],'depth':null}));if(this[_0xa6d2('0x8')][_0x198c89['device']]){if(!this['agents'][_0x198c89['device']][_0xa6d2('0x30')]||_0x198c89[_0xa6d2('0x21')]['toLowerCase']()==_0xa6d2('0x31')){this[_0xa6d2('0x8')][_0x198c89['device']][_0xa6d2('0x30')]=![];if(this['agents'][_0x198c89[_0xa6d2('0x2e')]]['state']!==_0x198c89[_0xa6d2('0x21')][_0xa6d2('0x32')]()){this['agents'][_0x198c89[_0xa6d2('0x2e')]][_0xa6d2('0x33')]=_[_0xa6d2('0x34')](moment()[_0xa6d2('0x35')]('x'));}this[_0xa6d2('0x8')][_0x198c89[_0xa6d2('0x2e')]][_0xa6d2('0x21')]=_0x198c89['state'][_0xa6d2('0x32')]();this[_0xa6d2('0x8')][_0x198c89[_0xa6d2('0x2e')]][_0xa6d2('0x36')](_0x198c89);}}else if(this[_0xa6d2('0x9')][_0x198c89[_0xa6d2('0x2e')]]){if(this['telephones'][_0x198c89[_0xa6d2('0x2e')]][_0xa6d2('0x21')]!==_0x198c89['state'][_0xa6d2('0x32')]()){this['telephones'][_0x198c89[_0xa6d2('0x2e')]][_0xa6d2('0x33')]=_[_0xa6d2('0x34')](moment()[_0xa6d2('0x35')]('x'));}this['telephones'][_0x198c89[_0xa6d2('0x2e')]][_0xa6d2('0x21')]=_0x198c89[_0xa6d2('0x21')][_0xa6d2('0x32')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xa6d2('0x17')](this[_0xa6d2('0x9')][_0x198c89['device']],{'showHidden':![],'depth':null}));this[_0xa6d2('0x1e')](util[_0xa6d2('0x35')]('telephone:%s',this['telephones'][_0x198c89['device']][_0xa6d2('0x2a')]),_0xa6d2('0x37'),this[_0xa6d2('0x9')][_0x198c89['device']]);}else if(this['trunks'][_0x198c89[_0xa6d2('0x2e')]]){if(this['trunks'][_0x198c89[_0xa6d2('0x2e')]][_0xa6d2('0x21')]!==_0x198c89[_0xa6d2('0x21')][_0xa6d2('0x32')]()){this[_0xa6d2('0x7')][_0x198c89[_0xa6d2('0x2e')]][_0xa6d2('0x33')]=_[_0xa6d2('0x34')](moment()[_0xa6d2('0x35')]('x'));}this[_0xa6d2('0x7')][_0x198c89[_0xa6d2('0x2e')]][_0xa6d2('0x21')]=_0x198c89[_0xa6d2('0x21')][_0xa6d2('0x32')]();logger['debug'](_0xa6d2('0x38'),util['inspect'](this['trunks'][_0x198c89['device']],{'showHidden':![],'depth':null}));this[_0xa6d2('0x1e')](util[_0xa6d2('0x35')]('trunk:%s',this[_0xa6d2('0x7')][_0x198c89[_0xa6d2('0x2e')]][_0xa6d2('0x2a')]),'trunk:save',this['trunks'][_0x198c89[_0xa6d2('0x2e')]]);}else if(_['startsWith'](_0x198c89[_0xa6d2('0x2e')],_0xa6d2('0x39'))){var _0x50086c=_0x198c89['device'];var _0x526a70=_0x50086c['substring'](_0x50086c[_0xa6d2('0x3a')]('/')+0x1,_0x50086c[_0xa6d2('0x3a')]('@'));var _0x252ddd=_[_0xa6d2('0x3b')](this[_0xa6d2('0x8')],function(_0x5291fc){return _0x5291fc[_0xa6d2('0x3c')]==_0x526a70||_0x5291fc[_0xa6d2('0x3d')]==_0x526a70||_0x5291fc[_0xa6d2('0x3e')]==_0x526a70;});if(_0x252ddd){if(_0x252ddd['state']!==_0x198c89[_0xa6d2('0x21')][_0xa6d2('0x32')]()){_0x252ddd[_0xa6d2('0x33')]=_['toNumber'](moment()[_0xa6d2('0x35')]('x'));}_0x252ddd[_0xa6d2('0x21')]=_0x198c89[_0xa6d2('0x21')][_0xa6d2('0x32')]();_0x252ddd[_0xa6d2('0x30')]=!![];_0x252ddd[_0xa6d2('0x36')](_0x198c89);}}}}catch(_0x439d06){logger['error'](_0xa6d2('0x2f'),util[_0xa6d2('0x17')](_0x439d06,{'showHidden':![],'depth':null}));}};UserReport[_0xa6d2('0x1c')]['syncPeerStatus']=function(_0x4378f7){try{if(this['isNotNull'](_0x4378f7)&&this[_0xa6d2('0x1d')](_0x4378f7[_0xa6d2('0xf')])){logger['info']('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x4378f7[_0xa6d2('0x3f')],_0x4378f7['address'],_0x4378f7[_0xa6d2('0xf')]);logger['debug'](_0xa6d2('0x40'),util[_0xa6d2('0x17')](_0x4378f7,{'showHidden':![],'depth':null}));if(this['agents'][_0x4378f7[_0xa6d2('0x3f')]]){if(!this[_0xa6d2('0x8')][_0x4378f7['peer']][_0xa6d2('0x30')]||_0x4378f7[_0xa6d2('0xf')][_0xa6d2('0x32')]()==_0xa6d2('0x41')){this[_0xa6d2('0x8')][_0x4378f7[_0xa6d2('0x3f')]][_0xa6d2('0x30')]=![];this[_0xa6d2('0x8')][_0x4378f7[_0xa6d2('0x3f')]][_0xa6d2('0x42')]=_0x4378f7[_0xa6d2('0xf')][_0xa6d2('0x32')]();this[_0xa6d2('0x8')][_0x4378f7[_0xa6d2('0x3f')]]['address']=_0x4378f7[_0xa6d2('0x43')];this[_0xa6d2('0x8')][_0x4378f7['peer']][_0xa6d2('0x36')](_0x4378f7);}}else if(this['telephones'][_0x4378f7[_0xa6d2('0x3f')]]){this[_0xa6d2('0x9')][_0x4378f7[_0xa6d2('0x3f')]][_0xa6d2('0x42')]=_0x4378f7[_0xa6d2('0xf')][_0xa6d2('0x32')]();this[_0xa6d2('0x9')][_0x4378f7['peer']]['address']=_0x4378f7['address'];logger['debug'](_0xa6d2('0x44'),util[_0xa6d2('0x17')](this[_0xa6d2('0x9')][_0x4378f7[_0xa6d2('0x3f')]],{'showHidden':![],'depth':null}));this[_0xa6d2('0x1e')](util[_0xa6d2('0x35')]('telephone:%s',this[_0xa6d2('0x9')][_0x4378f7['peer']][_0xa6d2('0x2a')]),'telephone:save',this[_0xa6d2('0x9')][_0x4378f7['peer']]);}else if(this[_0xa6d2('0x7')][_0x4378f7['peer']]){this['trunks'][_0x4378f7[_0xa6d2('0x3f')]]['status']=_0x4378f7[_0xa6d2('0xf')][_0xa6d2('0x32')]();this['trunks'][_0x4378f7[_0xa6d2('0x3f')]][_0xa6d2('0x43')]=_0x4378f7[_0xa6d2('0x43')];logger[_0xa6d2('0x22')](_0xa6d2('0x45'),util['inspect'](this['trunks'][_0x4378f7[_0xa6d2('0x3f')]],{'showHidden':![],'depth':null}));this[_0xa6d2('0x1e')](util[_0xa6d2('0x35')](_0xa6d2('0x29'),this[_0xa6d2('0x7')][_0x4378f7[_0xa6d2('0x3f')]]['name']),_0xa6d2('0x2b'),this[_0xa6d2('0x7')][_0x4378f7['peer']]);}}}catch(_0x525d6a){logger[_0xa6d2('0x1a')](_0xa6d2('0x40'),util[_0xa6d2('0x17')](_0x525d6a,{'showHidden':![],'depth':null}));}};module[_0xa6d2('0x46')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 8bbe047..3da72ba 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 _0xb4bd=['memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','substring','channel','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','lodash','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','interface','queue','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','voice','assign','omit','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','custom:agentcalled','calleridnum','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:called','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','merge','pick','name','exten','user:%s','user:agentconnect','agentcomplete','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','error','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','transfer','agent','talktime','acw','acwtime','agentacw','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','sipuri','bridgepeer','memberdynamic','memberinterface','memberpenalty'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xb4bd,0x14e));var _0xdb4b=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0xb4bd[_0x497b1e];return _0x3f72e1;};'use strict';var _=require(_0xdb4b('0x0'));var moment=require('moment');var util=require(_0xdb4b('0x1'));var Redis=require(_0xdb4b('0x2'));var config=require(_0xdb4b('0x3'));var logger=require(_0xdb4b('0x4'))('ami');var ami=require(_0xdb4b('0x5'));config[_0xdb4b('0x6')]=_[_0xdb4b('0x7')](config[_0xdb4b('0x6')],{'host':_0xdb4b('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceAgentReport(_0x7efdd1){this[_0xdb4b('0x9')]={};this[_0xdb4b('0xa')]=_0x7efdd1[_0xdb4b('0x9')];this['voiceQueues']=_0x7efdd1[_0xdb4b('0xb')];this[_0xdb4b('0xc')]=_0x7efdd1[_0xdb4b('0xc')];this[_0xdb4b('0xd')]={};ami['on'](_0xdb4b('0xe'),this[_0xdb4b('0xf')][_0xdb4b('0x10')](this));ami['on'](_0xdb4b('0x11'),this['syncAgentConnect'][_0xdb4b('0x10')](this));ami['on'](_0xdb4b('0x12'),this[_0xdb4b('0x13')][_0xdb4b('0x10')](this));ami['on'](_0xdb4b('0x14'),this[_0xdb4b('0x15')][_0xdb4b('0x10')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0xdb4b('0x10')](this));ami['on']('varset',this[_0xdb4b('0x16')][_0xdb4b('0x10')](this));ami['on'](_0xdb4b('0x17'),this[_0xdb4b('0x18')]['bind'](this));ami['on'](_0xdb4b('0x19'),this[_0xdb4b('0x1a')][_0xdb4b('0x10')](this));ami['on']('musiconholdstop',this[_0xdb4b('0x1b')][_0xdb4b('0x10')](this));ami['on'](_0xdb4b('0x1c'),this[_0xdb4b('0x1d')][_0xdb4b('0x10')](this));ami['on']('blindtransfer',this[_0xdb4b('0x1e')][_0xdb4b('0x10')](this));}VoiceAgentReport['prototype'][_0xdb4b('0x1f')]=function(_0x44a1c2,_0x515592,_0xf96777){io['to'](_0x44a1c2)[_0xdb4b('0x1f')](_0x515592,_0xf96777);};VoiceAgentReport[_0xdb4b('0x20')][_0xdb4b('0x21')]=function(_0x520941){return _0x520941!==null&&!_[_0xdb4b('0x22')](_0x520941);};VoiceAgentReport['prototype'][_0xdb4b('0xf')]=function(_0x21f691){try{if(this[_0xdb4b('0x21')](_0x21f691)){logger[_0xdb4b('0x23')](_0xdb4b('0x24'),_0x21f691['uniqueid'],_0x21f691[_0xdb4b('0x25')],_0x21f691[_0xdb4b('0x26')]);logger['debug'](_0xdb4b('0x27'),_0x21f691[_0xdb4b('0x28')],util['inspect'](_0x21f691,{'showHidden':![],'depth':null}));if(_[_0xdb4b('0x22')](this['channels'][_0x21f691[_0xdb4b('0x28')]])){this[_0xdb4b('0x9')][_0x21f691[_0xdb4b('0x28')]]={};}var _0x2f3892=this['agents'][_0x21f691[_0xdb4b('0x29')]];var _0x44f0db=this[_0xdb4b('0x9')][_0x21f691[_0xdb4b('0x28')]][_0x21f691['destuniqueid']];var _0x3bb8c5=this[_0xdb4b('0xb')][_0x21f691[_0xdb4b('0x2a')]];var _0x2f97c5=this['variables'][_0x21f691[_0xdb4b('0x28')]];if(_[_0xdb4b('0x22')](_0x44f0db)){_0x44f0db={'agentcalledAt':moment()['format'](_0xdb4b('0x2b')),'lastevent':_0xdb4b('0x2c'),'mandatoryDisposition':_0x3bb8c5&&_0x3bb8c5[_0xdb4b('0x2d')]?_0x3bb8c5[_0xdb4b('0x2d')]:![],'type':_0x3bb8c5&&_0x3bb8c5[_0xdb4b('0x2e')]?_0x3bb8c5[_0xdb4b('0x2e')]:_0xdb4b('0x2f'),'variables':_0x2f97c5,'motionChannel':_0xdb4b('0x30')};}Object[_0xdb4b('0x31')](_0x44f0db,_[_0xdb4b('0x32')](_0x21f691,[_0xdb4b('0x33'),'privilege']));this[_0xdb4b('0x9')][_0x21f691[_0xdb4b('0x28')]][_0x21f691['destuniqueid']]=_0x44f0db;logger['debug'](_0xdb4b('0x34'),_0x21f691[_0xdb4b('0x28')],util[_0xdb4b('0x35')](_0x44f0db,{'showHidden':![],'depth':null}));ami[_0xdb4b('0x1f')](_0xdb4b('0x36'),_0x44f0db);var _0x464c95={'id':_0x2f3892['id'],'calleridnum':_0x44f0db[_0xdb4b('0x37')],'queue':_0x44f0db[_0xdb4b('0x2a')],'variables':_0x44f0db[_0xdb4b('0xd')],'uniqueid':_0x21f691['uniqueid']};logger[_0xdb4b('0x38')](_0xdb4b('0x39'),_0x21f691['uniqueid'],util[_0xdb4b('0x35')](_0x464c95,{'showHidden':![],'depth':null}));this[_0xdb4b('0x1f')](util[_0xdb4b('0x3a')]('user:%s',_0x21f691[_0xdb4b('0x25')]),_0xdb4b('0x3b'),_0x464c95);}}catch(_0x4a0cfb){logger['error'](_0xdb4b('0x3c'),_0x21f691[_0xdb4b('0x28')],util[_0xdb4b('0x35')](_0x4a0cfb,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xdb4b('0x3d')]=function(_0x22b56b){try{if(this[_0xdb4b('0x21')](_0x22b56b)){if(this['channels'][_0x22b56b['uniqueid']]){for(var _0x154030 in this[_0xdb4b('0x9')][_0x22b56b[_0xdb4b('0x28')]]){if(this[_0xdb4b('0x9')][_0x22b56b[_0xdb4b('0x28')]][_0xdb4b('0x3e')](_0x154030)){if(_0x22b56b[_0xdb4b('0x26')]===_0x154030){logger[_0xdb4b('0x23')](_0xdb4b('0x3f'),_0x22b56b[_0xdb4b('0x28')],_0x22b56b[_0xdb4b('0x25')],_0x22b56b[_0xdb4b('0x26')]);this[_0xdb4b('0x9')][_0x22b56b[_0xdb4b('0x28')]][_0x154030][_0xdb4b('0x40')]=moment()[_0xdb4b('0x3a')](_0xdb4b('0x2b'));this[_0xdb4b('0x9')][_0x22b56b['uniqueid']][_0x154030][_0xdb4b('0x41')]=_0x22b56b[_0xdb4b('0x41')];this[_0xdb4b('0x9')][_0x22b56b[_0xdb4b('0x28')]][_0x154030][_0xdb4b('0x42')]=_0x22b56b[_0xdb4b('0x42')];this[_0xdb4b('0x9')][_0x22b56b[_0xdb4b('0x28')]][_0x154030][_0xdb4b('0x43')]=_0x22b56b[_0xdb4b('0x43')];this[_0xdb4b('0x9')][_0x22b56b['uniqueid']][_0x154030][_0xdb4b('0x44')]=_0x22b56b[_0xdb4b('0x44')];this[_0xdb4b('0x9')][_0x22b56b['uniqueid']][_0x154030][_0xdb4b('0x45')]=_0x22b56b['holdtime'];this['channels'][_0x22b56b[_0xdb4b('0x28')]][_0x154030][_0xdb4b('0x46')]=_0xdb4b('0x47');_[_0xdb4b('0x48')](this[_0xdb4b('0xc')][_0x22b56b[_0xdb4b('0x29')]],_[_0xdb4b('0x49')](_0x22b56b,[_0xdb4b('0x2a'),'destconnectedlinenum']));var _0x55cccb=this[_0xdb4b('0xc')][_0x22b56b['interface']];var _0x3493b9={'id':_0x55cccb['id'],'name':_0x55cccb[_0xdb4b('0x4a')],'agentconnected':!![],'destaccountcode':_0x55cccb['accountcode'],'destconnectedlinenum':this[_0xdb4b('0x9')][_0x22b56b['uniqueid']][_0x22b56b[_0xdb4b('0x26')]][_0xdb4b('0x4b')],'queue':this['channels'][_0x22b56b['uniqueid']][_0x22b56b['destuniqueid']][_0xdb4b('0x2a')],'uniqueid':this[_0xdb4b('0x9')][_0x22b56b[_0xdb4b('0x28')]][_0x22b56b[_0xdb4b('0x26')]][_0xdb4b('0x28')]};ami[_0xdb4b('0x1f')]('custom:agentconnect',this['channels'][_0x22b56b[_0xdb4b('0x28')]][_0x22b56b['destuniqueid']]);this[_0xdb4b('0x1f')](util[_0xdb4b('0x3a')](_0xdb4b('0x4c'),_0x22b56b['membername']),_0xdb4b('0x4d'),_0x3493b9);}else if(!this[_0xdb4b('0x9')][_0x22b56b[_0xdb4b('0x28')]][_0x154030]['agentringnoanswer']&&!this[_0xdb4b('0x9')][_0x22b56b[_0xdb4b('0x28')]][_0x154030][_0xdb4b('0x4e')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x22b56b[_0xdb4b('0x28')],this['channels'][_0x22b56b['uniqueid']][_0x154030][_0xdb4b('0x25')],_0x154030);this['channels'][_0x22b56b[_0xdb4b('0x28')]][_0x154030][_0xdb4b('0x12')]=!![];this[_0xdb4b('0x9')][_0x22b56b[_0xdb4b('0x28')]][_0x154030][_0xdb4b('0x4f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x22b56b[_0xdb4b('0x28')]][_0x154030][_0xdb4b('0x50')]=_0x22b56b[_0xdb4b('0x26')];this[_0xdb4b('0x9')][_0x22b56b['uniqueid']][_0x154030][_0xdb4b('0x51')]=_0x22b56b[_0xdb4b('0x25')];this['channels'][_0x22b56b[_0xdb4b('0x28')]][_0x154030][_0xdb4b('0x46')]='answered_elsewhere';this['channels'][_0x22b56b['uniqueid']][_0x154030]['reason']=_0xdb4b('0x52');logger[_0xdb4b('0x38')](_0xdb4b('0x53'),_0x22b56b[_0xdb4b('0x28')],util[_0xdb4b('0x35')](this['channels'][_0x22b56b[_0xdb4b('0x28')]][_0x154030],{'showHidden':![],'depth':null}));ami[_0xdb4b('0x1f')]('custom:agentansweredelsewhere',this[_0xdb4b('0x9')][_0x22b56b['uniqueid']][_0x154030]);}else{logger[_0xdb4b('0x38')](_0xdb4b('0x54'),_0x22b56b[_0xdb4b('0x28')]);}}}}}}catch(_0x1117c1){logger[_0xdb4b('0x55')](_0xdb4b('0x56'),_0x22b56b[_0xdb4b('0x28')],util[_0xdb4b('0x35')](_0x1117c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdb4b('0x20')]['syncAgentRingNoAnswer']=function(_0x259bbd){try{if(this['isNotNull'](_0x259bbd)){logger[_0xdb4b('0x38')](_0xdb4b('0x57'),_0x259bbd[_0xdb4b('0x28')],util['inspect'](_0x259bbd,{'showHidden':![],'depth':null}));if(this[_0xdb4b('0x9')][_0x259bbd[_0xdb4b('0x28')]]&&this[_0xdb4b('0x9')][_0x259bbd[_0xdb4b('0x28')]][_0x259bbd[_0xdb4b('0x26')]]){logger[_0xdb4b('0x23')](_0xdb4b('0x58'),_0x259bbd['uniqueid'],_0x259bbd[_0xdb4b('0x25')],_0x259bbd['destuniqueid']);var _0x20831b=this['agents'][_0x259bbd[_0xdb4b('0x29')]];var _0x5309be=this[_0xdb4b('0x9')][_0x259bbd[_0xdb4b('0x28')]][_0x259bbd['destuniqueid']];_0x5309be[_0xdb4b('0x12')]=!![];_0x5309be['agentringnoanswerAt']=moment()[_0xdb4b('0x3a')](_0xdb4b('0x2b'));_0x5309be[_0xdb4b('0x46')]=_0xdb4b('0x59');_0x5309be['reason']=_0xdb4b('0x59');var _0x260feb={'id':_0x20831b['id'],'name':_0x20831b[_0xdb4b('0x4a')],'queue':_0x5309be[_0xdb4b('0x2a')],'uniqueid':_0x5309be[_0xdb4b('0x28')]};logger[_0xdb4b('0x38')](_0xdb4b('0x5a'),_0x259bbd[_0xdb4b('0x28')],util[_0xdb4b('0x35')](_0x260feb,{'showHidden':![],'depth':null}));this[_0xdb4b('0x1f')](util[_0xdb4b('0x3a')](_0xdb4b('0x4c'),_0x20831b[_0xdb4b('0x4a')]),_0xdb4b('0x5b'),_0x260feb);ami['emit'](_0xdb4b('0x5c'),_0x5309be);this[_0xdb4b('0x9')][_0x259bbd[_0xdb4b('0x28')]][_0x259bbd[_0xdb4b('0x26')]]=Object[_0xdb4b('0x31')]({},_0x5309be);}}}catch(_0x3a0769){logger['error'](_0xdb4b('0x5d'),_0x259bbd[_0xdb4b('0x28')],util[_0xdb4b('0x35')](_0x3a0769,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdb4b('0x20')][_0xdb4b('0x15')]=function(_0x524cb6){try{if(this[_0xdb4b('0x21')](_0x524cb6)){logger['debug'](_0xdb4b('0x5e'),_0x524cb6['uniqueid'],util[_0xdb4b('0x35')](_0x524cb6,{'showHidden':![],'depth':null}));if(this['channels'][_0x524cb6[_0xdb4b('0x28')]]){for(var _0x22aa17 in this[_0xdb4b('0x9')][_0x524cb6[_0xdb4b('0x28')]]){if(this['channels'][_0x524cb6[_0xdb4b('0x28')]][_0xdb4b('0x3e')](_0x22aa17)&&!this[_0xdb4b('0x9')][_0x524cb6[_0xdb4b('0x28')]][_0x22aa17][_0xdb4b('0x12')]&&!this['channels'][_0x524cb6[_0xdb4b('0x28')]][_0x22aa17]['agentcomplete']){logger[_0xdb4b('0x23')](_0xdb4b('0x5f'),_0x524cb6['uniqueid'],this[_0xdb4b('0x9')][_0x524cb6[_0xdb4b('0x28')]][_0x22aa17][_0xdb4b('0x25')],_0x22aa17);this[_0xdb4b('0x9')][_0x524cb6[_0xdb4b('0x28')]][_0x22aa17][_0xdb4b('0x12')]=!![];this[_0xdb4b('0x9')][_0x524cb6[_0xdb4b('0x28')]][_0x22aa17]['agentringnoanswerAt']=moment()[_0xdb4b('0x3a')](_0xdb4b('0x2b'));this[_0xdb4b('0x9')][_0x524cb6['uniqueid']][_0x22aa17][_0xdb4b('0x46')]=_0xdb4b('0x60');this[_0xdb4b('0x9')][_0x524cb6[_0xdb4b('0x28')]][_0x22aa17][_0xdb4b('0x61')]='abandoned';logger[_0xdb4b('0x38')](_0xdb4b('0x62'),_0x524cb6['uniqueid'],util['inspect'](this[_0xdb4b('0x9')][_0x524cb6[_0xdb4b('0x28')]][_0x22aa17],{'showHidden':![],'depth':null}));ami[_0xdb4b('0x1f')]('custom:agentqueuecallerabandon',this[_0xdb4b('0x9')][_0x524cb6[_0xdb4b('0x28')]][_0x22aa17]);}}}}}catch(_0x4dfc32){logger['error'](_0xdb4b('0x63'),_0x524cb6['uniqueid'],util['inspect'](_0x4dfc32,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdb4b('0x20')]['syncAgentComplete']=function(_0x5a2735){try{if(this['isNotNull'](_0x5a2735)){logger[_0xdb4b('0x38')](_0xdb4b('0x64'),_0x5a2735[_0xdb4b('0x28')],util[_0xdb4b('0x35')](_0x5a2735,{'showHidden':![],'depth':null}));if(this['channels'][_0x5a2735[_0xdb4b('0x28')]]){for(var _0xcb1f00 in this['channels'][_0x5a2735['uniqueid']]){if(this[_0xdb4b('0x9')][_0x5a2735[_0xdb4b('0x28')]]['hasOwnProperty'](_0xcb1f00)){if(this[_0xdb4b('0x9')][_0x5a2735[_0xdb4b('0x28')]][_0xcb1f00][_0xdb4b('0x40')]&&!this[_0xdb4b('0x9')][_0x5a2735[_0xdb4b('0x28')]][_0xcb1f00][_0xdb4b('0x4e')]){logger[_0xdb4b('0x23')](_0xdb4b('0x65'),_0x5a2735['uniqueid'],this['channels'][_0x5a2735[_0xdb4b('0x28')]][_0xcb1f00][_0xdb4b('0x25')],_0xcb1f00);this[_0xdb4b('0x9')][_0x5a2735[_0xdb4b('0x28')]][_0xcb1f00][_0xdb4b('0x4e')]=!![];this[_0xdb4b('0x9')][_0x5a2735['uniqueid']][_0xcb1f00][_0xdb4b('0x66')]=moment()[_0xdb4b('0x3a')](_0xdb4b('0x2b'));this['channels'][_0x5a2735['uniqueid']][_0xcb1f00][_0xdb4b('0x46')]='complete';this[_0xdb4b('0x9')][_0x5a2735[_0xdb4b('0x28')]][_0xcb1f00][_0xdb4b('0x61')]=_0x5a2735[_0xdb4b('0x61')]==_0xdb4b('0x67')?_0xdb4b('0x68'):_0x5a2735[_0xdb4b('0x61')];this[_0xdb4b('0x9')][_0x5a2735[_0xdb4b('0x28')]][_0xcb1f00][_0xdb4b('0x69')]=_0x5a2735[_0xdb4b('0x69')];if(this[_0xdb4b('0xb')][_0x5a2735[_0xdb4b('0x2a')]]&&this[_0xdb4b('0xb')][_0x5a2735[_0xdb4b('0x2a')]][_0xdb4b('0x6a')]){this[_0xdb4b('0x9')][_0x5a2735['uniqueid']][_0xcb1f00][_0xdb4b('0x6b')]=this[_0xdb4b('0xb')][_0x5a2735['queue']]['acwTimeout'];this['channels'][_0x5a2735[_0xdb4b('0x28')]][_0xcb1f00][_0xdb4b('0x6c')]=!![];}this[_0xdb4b('0xc')][_0x5a2735[_0xdb4b('0x29')]]=_[_0xdb4b('0x32')](this[_0xdb4b('0xc')][_0x5a2735[_0xdb4b('0x29')]],[_0xdb4b('0x2a'),_0xdb4b('0x6d')]);logger['debug'](_0xdb4b('0x6e'),_0x5a2735[_0xdb4b('0x28')],util[_0xdb4b('0x35')](this['channels'][_0x5a2735[_0xdb4b('0x28')]][_0xcb1f00],{'showHidden':![],'depth':null}));ami[_0xdb4b('0x1f')](_0xdb4b('0x6f'),this[_0xdb4b('0x9')][_0x5a2735['uniqueid']][_0xcb1f00]);logger[_0xdb4b('0x38')](_0xdb4b('0x70'),_0x5a2735[_0xdb4b('0x28')],util[_0xdb4b('0x35')]({'id':this[_0xdb4b('0xc')][_0x5a2735[_0xdb4b('0x29')]]['id'],'destaccountcode':_0x5a2735[_0xdb4b('0x71')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xdb4b('0x3a')](_0xdb4b('0x4c'),_0x5a2735[_0xdb4b('0x25')]),_0xdb4b('0x72'),{'id':this['agents'][_0x5a2735[_0xdb4b('0x29')]]['id'],'destaccountcode':Number(_0x5a2735['destaccountcode'])});}}}}}}catch(_0x48752c){logger[_0xdb4b('0x55')](_0xdb4b('0x73'),_0x5a2735[_0xdb4b('0x28')],util[_0xdb4b('0x35')](_0x48752c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdb4b('0x20')][_0xdb4b('0x16')]=function(_0x220fe6){try{if(this[_0xdb4b('0x21')](_0x220fe6)){logger[_0xdb4b('0x38')](_0xdb4b('0x74'),_0x220fe6['uniqueid'],util['inspect'](_0x220fe6,{'showHidden':![],'depth':null}));this[_0xdb4b('0x75')](_0x220fe6[_0xdb4b('0x28')],_[_0xdb4b('0x76')](_0x220fe6[_0xdb4b('0x77')])[0x0],_0x220fe6[_0xdb4b('0x78')]);if(this[_0xdb4b('0x9')][_0x220fe6[_0xdb4b('0x28')]]){for(var _0x509981 in this[_0xdb4b('0x9')][_0x220fe6[_0xdb4b('0x28')]]){if(this[_0xdb4b('0x9')][_0x220fe6[_0xdb4b('0x28')]][_0xdb4b('0x3e')](_0x509981)){logger[_0xdb4b('0x23')](_0xdb4b('0x79'),_0x220fe6[_0xdb4b('0x28')],_0x509981,_[_0xdb4b('0x76')](_0x220fe6['variable'])[0x0],_0x220fe6[_0xdb4b('0x78')]);if(_[_0xdb4b('0x22')](this[_0xdb4b('0x9')][_0x220fe6['uniqueid']][_0x509981][_0xdb4b('0xd')])){this['channels'][_0x220fe6[_0xdb4b('0x28')]][_0x509981][_0xdb4b('0xd')]={};}this[_0xdb4b('0x9')][_0x220fe6['uniqueid']][_0x509981][_0xdb4b('0xd')]=this[_0xdb4b('0xd')][_0x220fe6[_0xdb4b('0x28')]];}}}}}catch(_0x56bd01){logger[_0xdb4b('0x55')]('[%s][voiceAgentReport][varset]',_0x220fe6[_0xdb4b('0x28')],util[_0xdb4b('0x35')](_0x56bd01,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdb4b('0x20')][_0xdb4b('0x75')]=function(_0x19a308,_0x509b90,_0x15a720){var _0x4268a6=['rtpaudioqos',_0xdb4b('0x7a'),_0xdb4b('0x7b'),_0xdb4b('0x7c'),'rtpaudioqosloss',_0xdb4b('0x7d'),'rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid',_0xdb4b('0x7e'),_0xdb4b('0x7f'),'bridgepvtcallid','membercalls',_0xdb4b('0x80'),_0xdb4b('0x81'),'memberlastcall','membername',_0xdb4b('0x82'),_0xdb4b('0x83')];if(!_[_0xdb4b('0x84')](_0x509b90)&&!_[_0xdb4b('0x85')](_0x4268a6,_0x509b90)){if(_[_0xdb4b('0x22')](this['variables'][_0x19a308])){this[_0xdb4b('0xd')][_0x19a308]={};}this[_0xdb4b('0xd')][_0x19a308][_0x509b90]=_0x15a720;}};VoiceAgentReport[_0xdb4b('0x20')][_0xdb4b('0x18')]=function(_0x47e733){try{if(this[_0xdb4b('0x21')](_0x47e733)){logger[_0xdb4b('0x38')]('[%s][voiceAgentReport][hangup]\x20event:',_0x47e733['uniqueid'],util['inspect'](_0x47e733,{'showHidden':![],'depth':null}));if(this[_0xdb4b('0x9')][_0x47e733[_0xdb4b('0x28')]]){for(var _0x187ff5 in this[_0xdb4b('0x9')][_0x47e733[_0xdb4b('0x28')]]){if(this['channels'][_0x47e733[_0xdb4b('0x28')]]['hasOwnProperty'](_0x187ff5)){if(this[_0xdb4b('0x9')][_0x47e733[_0xdb4b('0x28')]][_0x187ff5]['reason']==_0xdb4b('0x67')&&this[_0xdb4b('0x9')][_0x47e733[_0xdb4b('0x28')]][_0x187ff5][_0xdb4b('0x4e')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x47e733[_0xdb4b('0x28')],_0x187ff5);this[_0xdb4b('0x9')][_0x47e733['uniqueid']][_0x187ff5][_0xdb4b('0x66')]=moment()['format'](_0xdb4b('0x2b'));}}}logger[_0xdb4b('0x38')](_0xdb4b('0x86'),_0x47e733[_0xdb4b('0x28')],util[_0xdb4b('0x35')](_['values'](this[_0xdb4b('0x9')][_0x47e733[_0xdb4b('0x28')]]),{'showHidden':![],'depth':null}));ami[_0xdb4b('0x1f')]('custom:voiceAgentReport',_[_0xdb4b('0x87')](this['channels'][_0x47e733[_0xdb4b('0x28')]]));delete this[_0xdb4b('0x9')][_0x47e733[_0xdb4b('0x28')]];}if(this[_0xdb4b('0xd')][_0x47e733[_0xdb4b('0x28')]]){delete this[_0xdb4b('0xd')][_0x47e733[_0xdb4b('0x28')]];}}}catch(_0x5ec47f){logger[_0xdb4b('0x55')](_0xdb4b('0x88'),_0x47e733['uniqueid'],util['inspect'](_0x5ec47f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdb4b('0x20')][_0xdb4b('0x1d')]=function(_0x30554a){try{if(this[_0xdb4b('0x21')](_0x30554a)){logger[_0xdb4b('0x38')](_0xdb4b('0x89'),_0x30554a[_0xdb4b('0x28')],util['inspect'](_0x30554a,{'showHidden':![],'depth':null}));if(this['channels'][_0x30554a[_0xdb4b('0x8a')]]){for(var _0x562be4 in this[_0xdb4b('0x9')][_0x30554a[_0xdb4b('0x8a')]]){if(this['channels'][_0x30554a['transfereeuniqueid']]['hasOwnProperty'](_0x562be4)){if(_0x30554a[_0xdb4b('0x8b')]===_0x562be4){logger[_0xdb4b('0x23')](_0xdb4b('0x8c'),_0x30554a[_0xdb4b('0x28')],this[_0xdb4b('0x9')][_0x30554a[_0xdb4b('0x8a')]][_0x562be4]['membername'],_0x562be4);var _0x3e2165=moment();this['channels'][_0x30554a['transfereeuniqueid']][_0x562be4][_0xdb4b('0x4e')]=!![];this[_0xdb4b('0x9')][_0x30554a[_0xdb4b('0x8a')]][_0x562be4][_0xdb4b('0x66')]=moment()[_0xdb4b('0x3a')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x30554a['transfereeuniqueid']][_0x562be4][_0xdb4b('0x46')]='complete';this[_0xdb4b('0x9')][_0x30554a[_0xdb4b('0x8a')]][_0x562be4][_0xdb4b('0x61')]=_0xdb4b('0x67');this[_0xdb4b('0x9')][_0x30554a[_0xdb4b('0x8a')]][_0x562be4]['talktime']=_0x3e2165[_0xdb4b('0x8d')](this[_0xdb4b('0x9')][_0x30554a[_0xdb4b('0x8a')]][_0x562be4][_0xdb4b('0x40')],_0xdb4b('0x8e'));}}}}if(this[_0xdb4b('0x9')][_0x30554a[_0xdb4b('0x8f')]]){var _0x56f785=this['channels'][_0x30554a[_0xdb4b('0x8f')]];this[_0xdb4b('0x9')][_0x30554a[_0xdb4b('0x8f')]]=this[_0xdb4b('0x9')][_0x30554a[_0xdb4b('0x8a')]];this[_0xdb4b('0x9')][_0x30554a[_0xdb4b('0x8a')]]=_0x56f785;}}}catch(_0x32bcf8){logger[_0xdb4b('0x55')](_0xdb4b('0x90'),_0x30554a[_0xdb4b('0x28')],util[_0xdb4b('0x35')](_0x32bcf8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdb4b('0x20')][_0xdb4b('0x1e')]=function(_0x8eb348){try{if(this['isNotNull'](_0x8eb348)){logger[_0xdb4b('0x38')](_0xdb4b('0x91'),_0x8eb348['uniqueid'],util[_0xdb4b('0x35')](_0x8eb348,{'showHidden':![],'depth':null}));if(this['channels'][_0x8eb348['transfereeuniqueid']]){for(var _0x11a508 in this[_0xdb4b('0x9')][_0x8eb348[_0xdb4b('0x8a')]]){if(this[_0xdb4b('0x9')][_0x8eb348['transfereeuniqueid']]['hasOwnProperty'](_0x11a508)){if(_0x8eb348['transfereruniqueid']===_0x11a508){logger[_0xdb4b('0x23')](_0xdb4b('0x92'),_0x8eb348['uniqueid'],this[_0xdb4b('0x9')][_0x8eb348['transfereeuniqueid']][_0x11a508]['membername'],_0x11a508);var _0x1fcfd0=moment();this[_0xdb4b('0x9')][_0x8eb348['transfereeuniqueid']][_0x11a508][_0xdb4b('0x4e')]=!![];this[_0xdb4b('0x9')][_0x8eb348['transfereeuniqueid']][_0x11a508][_0xdb4b('0x66')]=_0x1fcfd0;this['channels'][_0x8eb348['transfereeuniqueid']][_0x11a508][_0xdb4b('0x46')]='complete';this[_0xdb4b('0x9')][_0x8eb348[_0xdb4b('0x8a')]][_0x11a508][_0xdb4b('0x61')]='transfer';this[_0xdb4b('0x9')][_0x8eb348[_0xdb4b('0x8a')]][_0x11a508]['talktime']=_0x1fcfd0[_0xdb4b('0x8d')](this[_0xdb4b('0x9')][_0x8eb348[_0xdb4b('0x8a')]][_0x11a508][_0xdb4b('0x40')],_0xdb4b('0x8e'));}}}}}}catch(_0xdd3ab8){logger[_0xdb4b('0x55')](_0xdb4b('0x93'),_0x8eb348[_0xdb4b('0x28')],util[_0xdb4b('0x35')](_0xdd3ab8,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xdb4b('0x1a')]=function(_0x76247f){var _0x184f15='';try{if(this['isNotNull'](_0x76247f)){logger[_0xdb4b('0x38')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x76247f['uniqueid'],util['inspect'](_0x76247f,{'showHidden':![],'depth':null}));if(_0x76247f['channel']){_0x184f15=_0x76247f['channel'][_0xdb4b('0x94')](0x0,_0x76247f[_0xdb4b('0x95')]['lastIndexOf']('-'));if(this[_0xdb4b('0xc')][_0x184f15]){logger['info'](_0xdb4b('0x96'),_0x76247f[_0xdb4b('0x28')],_0x184f15);this[_0xdb4b('0xc')][_0x184f15][_0xdb4b('0x97')]=!![];}}}}catch(_0x4d9572){logger[_0xdb4b('0x55')]('[%s][voiceAgentReport][musiconholdstart]',_0x76247f[_0xdb4b('0x28')],util[_0xdb4b('0x35')](_0x4d9572,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdb4b('0x20')][_0xdb4b('0x1b')]=function(_0x24e213){var _0x521b6e='';try{if(this[_0xdb4b('0x21')](_0x24e213)){logger['debug'](_0xdb4b('0x98'),_0x24e213[_0xdb4b('0x28')],util[_0xdb4b('0x35')](_0x24e213,{'showHidden':![],'depth':null}));if(_0x24e213[_0xdb4b('0x95')]){_0x521b6e=_0x24e213[_0xdb4b('0x95')]['substring'](0x0,_0x24e213[_0xdb4b('0x95')]['lastIndexOf']('-'));if(this['agents'][_0x521b6e]){logger['info'](_0xdb4b('0x99'),_0x24e213[_0xdb4b('0x28')],_0x521b6e);this[_0xdb4b('0xc')][_0x521b6e]['onhold']=![];}}}}catch(_0x12e6b5){logger['error'](_0xdb4b('0x9a'),_0x24e213['uniqueid'],util['inspect'](_0x12e6b5,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xb1b0=['[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','isUndefined','uniqueid','format','mandatoryDisposition','type','inbound','assign','event','privilege','debug','custom:agentcalled','calleridnum','queue','user:called','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','lastevent','connect','merge','interface','pick','name','accountcode','exten','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheremembername','reason','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','user:%s','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','agent','talktime','acw','acwtime','acwTimeout','agentacw','omit','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','exports','moment','util','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncBlindTransfer','prototype','emit','isNotNull','info'];(function(_0x1c5f93,_0x35de09){var _0x464e11=function(_0x425844){while(--_0x425844){_0x1c5f93['push'](_0x1c5f93['shift']());}};_0x464e11(++_0x35de09);}(_0xb1b0,0x1a3));var _0x0b1b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb1b0[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var moment=require(_0x0b1b('0x0'));var util=require(_0x0b1b('0x1'));var Redis=require('ioredis');var config=require(_0x0b1b('0x2'));var logger=require(_0x0b1b('0x3'))(_0x0b1b('0x4'));var ami=require('../ami');config[_0x0b1b('0x5')]=_[_0x0b1b('0x6')](config[_0x0b1b('0x5')],{'host':_0x0b1b('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceAgentReport(_0x2c9b13){this[_0x0b1b('0x8')]={};this[_0x0b1b('0x9')]=_0x2c9b13['channels'];this[_0x0b1b('0xa')]=_0x2c9b13[_0x0b1b('0xa')];this[_0x0b1b('0xb')]=_0x2c9b13[_0x0b1b('0xb')];this[_0x0b1b('0xc')]={};ami['on'](_0x0b1b('0xd'),this[_0x0b1b('0xe')][_0x0b1b('0xf')](this));ami['on']('agentconnect',this[_0x0b1b('0x10')][_0x0b1b('0xf')](this));ami['on'](_0x0b1b('0x11'),this[_0x0b1b('0x12')][_0x0b1b('0xf')](this));ami['on'](_0x0b1b('0x13'),this[_0x0b1b('0x14')]['bind'](this));ami['on'](_0x0b1b('0x15'),this[_0x0b1b('0x16')][_0x0b1b('0xf')](this));ami['on'](_0x0b1b('0x17'),this['syncVarSet'][_0x0b1b('0xf')](this));ami['on'](_0x0b1b('0x18'),this[_0x0b1b('0x19')][_0x0b1b('0xf')](this));ami['on']('musiconholdstart',this[_0x0b1b('0x1a')][_0x0b1b('0xf')](this));ami['on'](_0x0b1b('0x1b'),this[_0x0b1b('0x1c')][_0x0b1b('0xf')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x0b1b('0xf')](this));ami['on']('blindtransfer',this[_0x0b1b('0x1d')][_0x0b1b('0xf')](this));}VoiceAgentReport[_0x0b1b('0x1e')][_0x0b1b('0x1f')]=function(_0x20776c,_0x3be31,_0x235fb9){io['to'](_0x20776c)['emit'](_0x3be31,_0x235fb9);};VoiceAgentReport['prototype'][_0x0b1b('0x20')]=function(_0x5d92de){return _0x5d92de!==null&&!_['isUndefined'](_0x5d92de);};VoiceAgentReport['prototype'][_0x0b1b('0xe')]=function(_0x372ade){try{if(this[_0x0b1b('0x20')](_0x372ade)){logger[_0x0b1b('0x21')](_0x0b1b('0x22'),_0x372ade['uniqueid'],_0x372ade[_0x0b1b('0x23')],_0x372ade[_0x0b1b('0x24')]);logger['debug'](_0x0b1b('0x25'),_0x372ade['uniqueid'],util[_0x0b1b('0x26')](_0x372ade,{'showHidden':![],'depth':null}));if(_[_0x0b1b('0x27')](this[_0x0b1b('0x8')][_0x372ade[_0x0b1b('0x28')]])){this['channels'][_0x372ade[_0x0b1b('0x28')]]={};}var _0x1a18c3=this[_0x0b1b('0xb')][_0x372ade['interface']];var _0xafecb4=this[_0x0b1b('0x8')][_0x372ade[_0x0b1b('0x28')]][_0x372ade[_0x0b1b('0x24')]];var _0x11e73c=this[_0x0b1b('0xa')][_0x372ade['queue']];var _0x3efe80=this[_0x0b1b('0xc')][_0x372ade['uniqueid']];if(_[_0x0b1b('0x27')](_0xafecb4)){_0xafecb4={'agentcalledAt':moment()[_0x0b1b('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','mandatoryDisposition':_0x11e73c&&_0x11e73c[_0x0b1b('0x2a')]?_0x11e73c['mandatoryDisposition']:![],'type':_0x11e73c&&_0x11e73c[_0x0b1b('0x2b')]?_0x11e73c[_0x0b1b('0x2b')]:_0x0b1b('0x2c'),'variables':_0x3efe80,'motionChannel':'voice'};}Object[_0x0b1b('0x2d')](_0xafecb4,_['omit'](_0x372ade,[_0x0b1b('0x2e'),_0x0b1b('0x2f')]));this['channels'][_0x372ade['uniqueid']][_0x372ade[_0x0b1b('0x24')]]=_0xafecb4;logger[_0x0b1b('0x30')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x372ade['uniqueid'],util[_0x0b1b('0x26')](_0xafecb4,{'showHidden':![],'depth':null}));ami[_0x0b1b('0x1f')](_0x0b1b('0x31'),_0xafecb4);var _0x322b69={'id':_0x1a18c3['id'],'calleridnum':_0xafecb4[_0x0b1b('0x32')],'queue':_0xafecb4[_0x0b1b('0x33')],'variables':_0xafecb4['variables'],'uniqueid':_0x372ade[_0x0b1b('0x28')]};logger[_0x0b1b('0x30')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x372ade[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0x322b69,{'showHidden':![],'depth':null}));this[_0x0b1b('0x1f')](util[_0x0b1b('0x29')]('user:%s',_0x372ade[_0x0b1b('0x23')]),_0x0b1b('0x34'),_0x322b69);}}catch(_0x11df5e){logger[_0x0b1b('0x35')](_0x0b1b('0x36'),_0x372ade[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0x11df5e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0b1b('0x1e')][_0x0b1b('0x10')]=function(_0x6c0f9c){try{if(this[_0x0b1b('0x20')](_0x6c0f9c)){if(this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]]){for(var _0xf6d212 in this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]]){if(this[_0x0b1b('0x8')][_0x6c0f9c['uniqueid']][_0x0b1b('0x37')](_0xf6d212)){if(_0x6c0f9c[_0x0b1b('0x24')]===_0xf6d212){logger[_0x0b1b('0x21')](_0x0b1b('0x38'),_0x6c0f9c['uniqueid'],_0x6c0f9c[_0x0b1b('0x23')],_0x6c0f9c['destuniqueid']);this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212][_0x0b1b('0x39')]=moment()['format'](_0x0b1b('0x3a'));this['channels'][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212]['connectedlinename']=_0x6c0f9c[_0x0b1b('0x3b')];this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212][_0x0b1b('0x3c')]=_0x6c0f9c[_0x0b1b('0x3c')];this['channels'][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212][_0x0b1b('0x3d')]=_0x6c0f9c['destchannelstate'];this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212]['destchannelstatedesc']=_0x6c0f9c['destchannelstatedesc'];this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212]['holdtime']=_0x6c0f9c['holdtime'];this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212][_0x0b1b('0x3e')]=_0x0b1b('0x3f');_[_0x0b1b('0x40')](this['agents'][_0x6c0f9c[_0x0b1b('0x41')]],_[_0x0b1b('0x42')](_0x6c0f9c,[_0x0b1b('0x33'),'destconnectedlinenum']));var _0x4a0881=this[_0x0b1b('0xb')][_0x6c0f9c[_0x0b1b('0x41')]];var _0x3b4a9c={'id':_0x4a0881['id'],'name':_0x4a0881[_0x0b1b('0x43')],'agentconnected':!![],'destaccountcode':_0x4a0881[_0x0b1b('0x44')],'destconnectedlinenum':this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]][_0x6c0f9c[_0x0b1b('0x24')]][_0x0b1b('0x45')],'queue':this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]][_0x6c0f9c[_0x0b1b('0x24')]][_0x0b1b('0x33')],'uniqueid':this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]][_0x6c0f9c[_0x0b1b('0x24')]][_0x0b1b('0x28')]};ami[_0x0b1b('0x1f')]('custom:agentconnect',this['channels'][_0x6c0f9c[_0x0b1b('0x28')]][_0x6c0f9c['destuniqueid']]);this['emit'](util[_0x0b1b('0x29')]('user:%s',_0x6c0f9c[_0x0b1b('0x23')]),_0x0b1b('0x46'),_0x3b4a9c);}else if(!this[_0x0b1b('0x8')][_0x6c0f9c['uniqueid']][_0xf6d212][_0x0b1b('0x11')]&&!this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212][_0x0b1b('0x15')]){logger[_0x0b1b('0x21')](_0x0b1b('0x47'),_0x6c0f9c[_0x0b1b('0x28')],this[_0x0b1b('0x8')][_0x6c0f9c['uniqueid']][_0xf6d212]['membername'],_0xf6d212);this[_0x0b1b('0x8')][_0x6c0f9c['uniqueid']][_0xf6d212][_0x0b1b('0x11')]=!![];this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212][_0x0b1b('0x48')]=moment()[_0x0b1b('0x29')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0b1b('0x8')][_0x6c0f9c['uniqueid']][_0xf6d212]['answeredelsewheredestinationuniqueid']=_0x6c0f9c['destuniqueid'];this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212][_0x0b1b('0x49')]=_0x6c0f9c['membername'];this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212][_0x0b1b('0x3e')]='answered_elsewhere';this['channels'][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212][_0x0b1b('0x4a')]='answered_elsewhere';logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x6c0f9c[_0x0b1b('0x28')],util[_0x0b1b('0x26')](this[_0x0b1b('0x8')][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212],{'showHidden':![],'depth':null}));ami[_0x0b1b('0x1f')](_0x0b1b('0x4b'),this['channels'][_0x6c0f9c[_0x0b1b('0x28')]][_0xf6d212]);}else{logger[_0x0b1b('0x30')](_0x0b1b('0x4c'),_0x6c0f9c[_0x0b1b('0x28')]);}}}}}}catch(_0x3a2b16){logger[_0x0b1b('0x35')]('[%s][voiceAgentReport][agentconnect]',_0x6c0f9c[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0x3a2b16,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0b1b('0x1e')][_0x0b1b('0x12')]=function(_0x2c034e){try{if(this[_0x0b1b('0x20')](_0x2c034e)){logger['debug'](_0x0b1b('0x4d'),_0x2c034e[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0x2c034e,{'showHidden':![],'depth':null}));if(this[_0x0b1b('0x8')][_0x2c034e['uniqueid']]&&this[_0x0b1b('0x8')][_0x2c034e['uniqueid']][_0x2c034e['destuniqueid']]){logger['info'](_0x0b1b('0x4e'),_0x2c034e[_0x0b1b('0x28')],_0x2c034e[_0x0b1b('0x23')],_0x2c034e['destuniqueid']);var _0x3c6cda=this['agents'][_0x2c034e[_0x0b1b('0x41')]];var _0x24efd1=this[_0x0b1b('0x8')][_0x2c034e[_0x0b1b('0x28')]][_0x2c034e['destuniqueid']];_0x24efd1['agentringnoanswer']=!![];_0x24efd1[_0x0b1b('0x48')]=moment()[_0x0b1b('0x29')](_0x0b1b('0x3a'));_0x24efd1[_0x0b1b('0x3e')]='rejected';_0x24efd1['reason']=_0x0b1b('0x4f');var _0x3477a4={'id':_0x3c6cda['id'],'name':_0x3c6cda[_0x0b1b('0x43')],'queue':_0x24efd1[_0x0b1b('0x33')],'uniqueid':_0x24efd1[_0x0b1b('0x28')]};logger[_0x0b1b('0x30')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x2c034e[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0x3477a4,{'showHidden':![],'depth':null}));this[_0x0b1b('0x1f')](util['format'](_0x0b1b('0x50'),_0x3c6cda['name']),_0x0b1b('0x51'),_0x3477a4);ami['emit'](_0x0b1b('0x52'),_0x24efd1);this[_0x0b1b('0x8')][_0x2c034e[_0x0b1b('0x28')]][_0x2c034e['destuniqueid']]=Object['assign']({},_0x24efd1);}}}catch(_0x1bfc48){logger['error'](_0x0b1b('0x53'),_0x2c034e[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0x1bfc48,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0b1b('0x1e')][_0x0b1b('0x14')]=function(_0x3f3ad6){try{if(this['isNotNull'](_0x3f3ad6)){logger[_0x0b1b('0x30')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x3f3ad6[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0x3f3ad6,{'showHidden':![],'depth':null}));if(this[_0x0b1b('0x8')][_0x3f3ad6[_0x0b1b('0x28')]]){for(var _0x49aa32 in this[_0x0b1b('0x8')][_0x3f3ad6['uniqueid']]){if(this['channels'][_0x3f3ad6[_0x0b1b('0x28')]]['hasOwnProperty'](_0x49aa32)&&!this[_0x0b1b('0x8')][_0x3f3ad6[_0x0b1b('0x28')]][_0x49aa32]['agentringnoanswer']&&!this[_0x0b1b('0x8')][_0x3f3ad6[_0x0b1b('0x28')]][_0x49aa32][_0x0b1b('0x15')]){logger['info'](_0x0b1b('0x54'),_0x3f3ad6[_0x0b1b('0x28')],this[_0x0b1b('0x8')][_0x3f3ad6['uniqueid']][_0x49aa32][_0x0b1b('0x23')],_0x49aa32);this['channels'][_0x3f3ad6[_0x0b1b('0x28')]][_0x49aa32][_0x0b1b('0x11')]=!![];this['channels'][_0x3f3ad6[_0x0b1b('0x28')]][_0x49aa32][_0x0b1b('0x48')]=moment()[_0x0b1b('0x29')](_0x0b1b('0x3a'));this[_0x0b1b('0x8')][_0x3f3ad6[_0x0b1b('0x28')]][_0x49aa32]['lastevent']='abandoned';this[_0x0b1b('0x8')][_0x3f3ad6[_0x0b1b('0x28')]][_0x49aa32][_0x0b1b('0x4a')]=_0x0b1b('0x55');logger[_0x0b1b('0x30')](_0x0b1b('0x56'),_0x3f3ad6['uniqueid'],util[_0x0b1b('0x26')](this[_0x0b1b('0x8')][_0x3f3ad6[_0x0b1b('0x28')]][_0x49aa32],{'showHidden':![],'depth':null}));ami[_0x0b1b('0x1f')]('custom:agentqueuecallerabandon',this['channels'][_0x3f3ad6[_0x0b1b('0x28')]][_0x49aa32]);}}}}}catch(_0x4a027c){logger[_0x0b1b('0x35')](_0x0b1b('0x57'),_0x3f3ad6[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0x4a027c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0b1b('0x1e')]['syncAgentComplete']=function(_0x5b2008){try{if(this[_0x0b1b('0x20')](_0x5b2008)){logger[_0x0b1b('0x30')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x5b2008[_0x0b1b('0x28')],util['inspect'](_0x5b2008,{'showHidden':![],'depth':null}));if(this[_0x0b1b('0x8')][_0x5b2008[_0x0b1b('0x28')]]){for(var _0x8d421b in this[_0x0b1b('0x8')][_0x5b2008[_0x0b1b('0x28')]]){if(this[_0x0b1b('0x8')][_0x5b2008[_0x0b1b('0x28')]][_0x0b1b('0x37')](_0x8d421b)){if(this[_0x0b1b('0x8')][_0x5b2008[_0x0b1b('0x28')]][_0x8d421b]['agentconnectAt']&&!this[_0x0b1b('0x8')][_0x5b2008[_0x0b1b('0x28')]][_0x8d421b][_0x0b1b('0x15')]){logger[_0x0b1b('0x21')](_0x0b1b('0x58'),_0x5b2008[_0x0b1b('0x28')],this[_0x0b1b('0x8')][_0x5b2008[_0x0b1b('0x28')]][_0x8d421b][_0x0b1b('0x23')],_0x8d421b);this[_0x0b1b('0x8')][_0x5b2008['uniqueid']][_0x8d421b][_0x0b1b('0x15')]=!![];this[_0x0b1b('0x8')][_0x5b2008[_0x0b1b('0x28')]][_0x8d421b]['agentcompleteAt']=moment()[_0x0b1b('0x29')](_0x0b1b('0x3a'));this['channels'][_0x5b2008[_0x0b1b('0x28')]][_0x8d421b]['lastevent']=_0x0b1b('0x59');this[_0x0b1b('0x8')][_0x5b2008['uniqueid']][_0x8d421b][_0x0b1b('0x4a')]=_0x5b2008[_0x0b1b('0x4a')]=='transfer'?_0x0b1b('0x5a'):_0x5b2008[_0x0b1b('0x4a')];this[_0x0b1b('0x8')][_0x5b2008[_0x0b1b('0x28')]][_0x8d421b][_0x0b1b('0x5b')]=_0x5b2008[_0x0b1b('0x5b')];if(this[_0x0b1b('0xa')][_0x5b2008[_0x0b1b('0x33')]]&&this['voiceQueues'][_0x5b2008[_0x0b1b('0x33')]][_0x0b1b('0x5c')]){this[_0x0b1b('0x8')][_0x5b2008[_0x0b1b('0x28')]][_0x8d421b][_0x0b1b('0x5d')]=this[_0x0b1b('0xa')][_0x5b2008['queue']][_0x0b1b('0x5e')];this[_0x0b1b('0x8')][_0x5b2008[_0x0b1b('0x28')]][_0x8d421b][_0x0b1b('0x5f')]=!![];}this[_0x0b1b('0xb')][_0x5b2008[_0x0b1b('0x41')]]=_[_0x0b1b('0x60')](this[_0x0b1b('0xb')][_0x5b2008[_0x0b1b('0x41')]],[_0x0b1b('0x33'),_0x0b1b('0x61')]);logger[_0x0b1b('0x30')](_0x0b1b('0x62'),_0x5b2008[_0x0b1b('0x28')],util['inspect'](this[_0x0b1b('0x8')][_0x5b2008[_0x0b1b('0x28')]][_0x8d421b],{'showHidden':![],'depth':null}));ami[_0x0b1b('0x1f')](_0x0b1b('0x63'),this['channels'][_0x5b2008[_0x0b1b('0x28')]][_0x8d421b]);logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x5b2008[_0x0b1b('0x28')],util[_0x0b1b('0x26')]({'id':this[_0x0b1b('0xb')][_0x5b2008[_0x0b1b('0x41')]]['id'],'destaccountcode':_0x5b2008[_0x0b1b('0x64')]},{'showHidden':![],'depth':null}));this[_0x0b1b('0x1f')](util['format'](_0x0b1b('0x50'),_0x5b2008[_0x0b1b('0x23')]),_0x0b1b('0x65'),{'id':this[_0x0b1b('0xb')][_0x5b2008[_0x0b1b('0x41')]]['id'],'destaccountcode':Number(_0x5b2008[_0x0b1b('0x64')])});}}}}}}catch(_0xed198d){logger[_0x0b1b('0x35')](_0x0b1b('0x66'),_0x5b2008[_0x0b1b('0x28')],util['inspect'](_0xed198d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0b1b('0x1e')]['syncVarSet']=function(_0x292f75){try{if(this[_0x0b1b('0x20')](_0x292f75)){logger['debug'](_0x0b1b('0x67'),_0x292f75[_0x0b1b('0x28')],util['inspect'](_0x292f75,{'showHidden':![],'depth':null}));this[_0x0b1b('0x68')](_0x292f75[_0x0b1b('0x28')],_[_0x0b1b('0x69')](_0x292f75[_0x0b1b('0x6a')])[0x0],_0x292f75[_0x0b1b('0x6b')]);if(this[_0x0b1b('0x8')][_0x292f75[_0x0b1b('0x28')]]){for(var _0x51f1f7 in this[_0x0b1b('0x8')][_0x292f75[_0x0b1b('0x28')]]){if(this[_0x0b1b('0x8')][_0x292f75[_0x0b1b('0x28')]][_0x0b1b('0x37')](_0x51f1f7)){logger[_0x0b1b('0x21')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x292f75['uniqueid'],_0x51f1f7,_[_0x0b1b('0x69')](_0x292f75[_0x0b1b('0x6a')])[0x0],_0x292f75[_0x0b1b('0x6b')]);if(_[_0x0b1b('0x27')](this[_0x0b1b('0x8')][_0x292f75[_0x0b1b('0x28')]][_0x51f1f7][_0x0b1b('0xc')])){this['channels'][_0x292f75[_0x0b1b('0x28')]][_0x51f1f7][_0x0b1b('0xc')]={};}this[_0x0b1b('0x8')][_0x292f75[_0x0b1b('0x28')]][_0x51f1f7]['variables']=this[_0x0b1b('0xc')][_0x292f75['uniqueid']];}}}}}catch(_0x32a439){logger[_0x0b1b('0x35')](_0x0b1b('0x6c'),_0x292f75[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0x32a439,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0b1b('0x1e')][_0x0b1b('0x68')]=function(_0x3f7611,_0x1877a8,_0x41d254){var _0x2c03d0=[_0x0b1b('0x6d'),'rtpaudioqosbridged',_0x0b1b('0x6e'),_0x0b1b('0x6f'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x0b1b('0x70'),_0x0b1b('0x71'),_0x0b1b('0x72'),_0x0b1b('0x73'),'bridgepeer',_0x0b1b('0x74'),_0x0b1b('0x75'),'memberdynamic',_0x0b1b('0x76'),_0x0b1b('0x77'),_0x0b1b('0x23'),_0x0b1b('0x78'),'memberrealtime'];if(!_['isNil'](_0x1877a8)&&!_[_0x0b1b('0x79')](_0x2c03d0,_0x1877a8)){if(_[_0x0b1b('0x27')](this[_0x0b1b('0xc')][_0x3f7611])){this[_0x0b1b('0xc')][_0x3f7611]={};}this[_0x0b1b('0xc')][_0x3f7611][_0x1877a8]=_0x41d254;}};VoiceAgentReport[_0x0b1b('0x1e')]['syncHangup']=function(_0x298a70){try{if(this[_0x0b1b('0x20')](_0x298a70)){logger[_0x0b1b('0x30')](_0x0b1b('0x7a'),_0x298a70['uniqueid'],util[_0x0b1b('0x26')](_0x298a70,{'showHidden':![],'depth':null}));if(this[_0x0b1b('0x8')][_0x298a70[_0x0b1b('0x28')]]){for(var _0x564deb in this['channels'][_0x298a70[_0x0b1b('0x28')]]){if(this['channels'][_0x298a70[_0x0b1b('0x28')]][_0x0b1b('0x37')](_0x564deb)){if(this['channels'][_0x298a70[_0x0b1b('0x28')]][_0x564deb][_0x0b1b('0x4a')]==_0x0b1b('0x7b')&&this[_0x0b1b('0x8')][_0x298a70[_0x0b1b('0x28')]][_0x564deb]['agentcomplete']){logger[_0x0b1b('0x21')](_0x0b1b('0x7c'),_0x298a70[_0x0b1b('0x28')],_0x564deb);this[_0x0b1b('0x8')][_0x298a70[_0x0b1b('0x28')]][_0x564deb][_0x0b1b('0x7d')]=moment()[_0x0b1b('0x29')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0b1b('0x30')](_0x0b1b('0x7e'),_0x298a70[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_[_0x0b1b('0x7f')](this[_0x0b1b('0x8')][_0x298a70[_0x0b1b('0x28')]]),{'showHidden':![],'depth':null}));ami[_0x0b1b('0x1f')](_0x0b1b('0x80'),_['values'](this[_0x0b1b('0x8')][_0x298a70[_0x0b1b('0x28')]]));delete this['channels'][_0x298a70[_0x0b1b('0x28')]];}if(this[_0x0b1b('0xc')][_0x298a70[_0x0b1b('0x28')]]){delete this[_0x0b1b('0xc')][_0x298a70[_0x0b1b('0x28')]];}}}catch(_0x14d158){logger[_0x0b1b('0x35')](_0x0b1b('0x81'),_0x298a70[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0x14d158,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0b1b('0x82')]=function(_0x123d8d){try{if(this[_0x0b1b('0x20')](_0x123d8d)){logger[_0x0b1b('0x30')](_0x0b1b('0x83'),_0x123d8d[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0x123d8d,{'showHidden':![],'depth':null}));if(this[_0x0b1b('0x8')][_0x123d8d[_0x0b1b('0x84')]]){for(var _0x9e7d00 in this[_0x0b1b('0x8')][_0x123d8d[_0x0b1b('0x84')]]){if(this[_0x0b1b('0x8')][_0x123d8d[_0x0b1b('0x84')]][_0x0b1b('0x37')](_0x9e7d00)){if(_0x123d8d[_0x0b1b('0x85')]===_0x9e7d00){logger[_0x0b1b('0x21')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x123d8d[_0x0b1b('0x28')],this['channels'][_0x123d8d['transfereeuniqueid']][_0x9e7d00][_0x0b1b('0x23')],_0x9e7d00);var _0x928764=moment();this['channels'][_0x123d8d[_0x0b1b('0x84')]][_0x9e7d00][_0x0b1b('0x15')]=!![];this[_0x0b1b('0x8')][_0x123d8d[_0x0b1b('0x84')]][_0x9e7d00][_0x0b1b('0x7d')]=moment()['format'](_0x0b1b('0x3a'));this[_0x0b1b('0x8')][_0x123d8d[_0x0b1b('0x84')]][_0x9e7d00][_0x0b1b('0x3e')]='complete';this[_0x0b1b('0x8')][_0x123d8d[_0x0b1b('0x84')]][_0x9e7d00][_0x0b1b('0x4a')]='transfer';this[_0x0b1b('0x8')][_0x123d8d[_0x0b1b('0x84')]][_0x9e7d00][_0x0b1b('0x5b')]=_0x928764[_0x0b1b('0x86')](this[_0x0b1b('0x8')][_0x123d8d[_0x0b1b('0x84')]][_0x9e7d00]['agentconnectAt'],_0x0b1b('0x87'));}}}}if(this[_0x0b1b('0x8')][_0x123d8d[_0x0b1b('0x88')]]){var _0x55e125=this[_0x0b1b('0x8')][_0x123d8d[_0x0b1b('0x88')]];this[_0x0b1b('0x8')][_0x123d8d[_0x0b1b('0x88')]]=this['channels'][_0x123d8d[_0x0b1b('0x84')]];this['channels'][_0x123d8d[_0x0b1b('0x84')]]=_0x55e125;}}}catch(_0x123884){logger['error'](_0x0b1b('0x89'),_0x123d8d[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0x123884,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0b1b('0x1e')][_0x0b1b('0x1d')]=function(_0x518d86){try{if(this[_0x0b1b('0x20')](_0x518d86)){logger[_0x0b1b('0x30')](_0x0b1b('0x8a'),_0x518d86['uniqueid'],util['inspect'](_0x518d86,{'showHidden':![],'depth':null}));if(this[_0x0b1b('0x8')][_0x518d86[_0x0b1b('0x84')]]){for(var _0x28e29e in this[_0x0b1b('0x8')][_0x518d86[_0x0b1b('0x84')]]){if(this[_0x0b1b('0x8')][_0x518d86[_0x0b1b('0x84')]][_0x0b1b('0x37')](_0x28e29e)){if(_0x518d86[_0x0b1b('0x8b')]===_0x28e29e){logger[_0x0b1b('0x21')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x518d86[_0x0b1b('0x28')],this[_0x0b1b('0x8')][_0x518d86[_0x0b1b('0x84')]][_0x28e29e][_0x0b1b('0x23')],_0x28e29e);var _0x33389d=moment();this[_0x0b1b('0x8')][_0x518d86['transfereeuniqueid']][_0x28e29e]['agentcomplete']=!![];this[_0x0b1b('0x8')][_0x518d86[_0x0b1b('0x84')]][_0x28e29e][_0x0b1b('0x7d')]=_0x33389d;this[_0x0b1b('0x8')][_0x518d86[_0x0b1b('0x84')]][_0x28e29e][_0x0b1b('0x3e')]=_0x0b1b('0x59');this[_0x0b1b('0x8')][_0x518d86[_0x0b1b('0x84')]][_0x28e29e][_0x0b1b('0x4a')]=_0x0b1b('0x7b');this[_0x0b1b('0x8')][_0x518d86[_0x0b1b('0x84')]][_0x28e29e][_0x0b1b('0x5b')]=_0x33389d[_0x0b1b('0x86')](this['channels'][_0x518d86[_0x0b1b('0x84')]][_0x28e29e]['agentconnectAt'],'seconds');}}}}}}catch(_0xa3f77c){logger[_0x0b1b('0x35')](_0x0b1b('0x8c'),_0x518d86[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0xa3f77c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0b1b('0x1e')][_0x0b1b('0x1a')]=function(_0x5a5cc5){var _0x1ec1a7='';try{if(this[_0x0b1b('0x20')](_0x5a5cc5)){logger[_0x0b1b('0x30')](_0x0b1b('0x8d'),_0x5a5cc5[_0x0b1b('0x28')],util['inspect'](_0x5a5cc5,{'showHidden':![],'depth':null}));if(_0x5a5cc5[_0x0b1b('0x8e')]){_0x1ec1a7=_0x5a5cc5['channel'][_0x0b1b('0x8f')](0x0,_0x5a5cc5[_0x0b1b('0x8e')][_0x0b1b('0x90')]('-'));if(this['agents'][_0x1ec1a7]){logger[_0x0b1b('0x21')](_0x0b1b('0x91'),_0x5a5cc5['uniqueid'],_0x1ec1a7);this[_0x0b1b('0xb')][_0x1ec1a7][_0x0b1b('0x92')]=!![];}}}}catch(_0x28856b){logger[_0x0b1b('0x35')](_0x0b1b('0x93'),_0x5a5cc5['uniqueid'],util[_0x0b1b('0x26')](_0x28856b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0b1b('0x1e')][_0x0b1b('0x1c')]=function(_0x544827){var _0x413385='';try{if(this[_0x0b1b('0x20')](_0x544827)){logger[_0x0b1b('0x30')](_0x0b1b('0x94'),_0x544827[_0x0b1b('0x28')],util[_0x0b1b('0x26')](_0x544827,{'showHidden':![],'depth':null}));if(_0x544827[_0x0b1b('0x8e')]){_0x413385=_0x544827[_0x0b1b('0x8e')][_0x0b1b('0x8f')](0x0,_0x544827[_0x0b1b('0x8e')]['lastIndexOf']('-'));if(this[_0x0b1b('0xb')][_0x413385]){logger[_0x0b1b('0x21')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x544827[_0x0b1b('0x28')],_0x413385);this[_0x0b1b('0xb')][_0x413385][_0x0b1b('0x92')]=![];}}}}catch(_0x4d053d){logger[_0x0b1b('0x35')](_0x0b1b('0x95'),_0x544827['uniqueid'],util[_0x0b1b('0x26')](_0x4d053d,{'showHidden':![],'depth':null}));}};module[_0x0b1b('0x96')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 0c2fe05..265adf3 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 _0x6136=['diff','connectedlinenum','destinationchannel','UserId','membername','name','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','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','sipcalluniqueid','mixmonitor_filename','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','blindTransfers','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','length','user:agentcomplete','transferType','resolve','then','transferToInternal','getSettings','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','ATTENDED','origtransfererlinkedid','some','outbound','routeid','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','BlindTransfer','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','lodash','util','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','ANSWERED','BUSY','FAILED','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','newstate','varset','syncVarSet','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','inspect','isNotNull','isUndefined','emit','syncNewCallerId','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','uniqueid','pick','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','format','user:%s','accountcode','error','[%s][voiceCallReport][newcallerid]','prototype','[%s][voiceCallReport][newchannel]\x20event:','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','undefined','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','lastapplication','startsWith','cdr(','match','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime'];(function(_0x260f6f,_0x2648af){var _0x28f1a6=function(_0x317c4d){while(--_0x317c4d){_0x260f6f['push'](_0x260f6f['shift']());}};_0x28f1a6(++_0x2648af);}(_0x6136,0x137));var _0x6613=function(_0x3bbed4,_0x261aee){_0x3bbed4=_0x3bbed4-0x0;var _0x524762=_0x6136[_0x3bbed4];return _0x524762;};'use strict';var _=require(_0x6613('0x0'));var moment=require('moment');var util=require(_0x6613('0x1'));var path=require(_0x6613('0x2'));var Redis=require('ioredis');var config=require(_0x6613('0x3'));var logger=require(_0x6613('0x4'))(_0x6613('0x5'));var ami=require(_0x6613('0x6'));var Channel=require(_0x6613('0x7'));var RpcSetting=require(_0x6613('0x8'));var applications=[_0x6613('0x9'),_0x6613('0xa'),_0x6613('0xb'),_0x6613('0xc'),_0x6613('0xd'),_0x6613('0xe')];var dispositions=[_0x6613('0xf'),'FAILED','FAILED','NO\x20ANSWER',_0x6613('0xf'),_0x6613('0xf'),_0x6613('0x10'),_0x6613('0x11'),_0x6613('0x12'),_0x6613('0x12'),_0x6613('0x12')];config[_0x6613('0x13')]=_[_0x6613('0x14')](config['redis'],{'host':_0x6613('0x15'),'port':0x18eb});var io=require(_0x6613('0x16'))(new Redis(config[_0x6613('0x13')]));function VoiceCallReport(_0x4b89ec){this[_0x6613('0x17')]=_0x4b89ec[_0x6613('0x17')];this[_0x6613('0x18')]=_0x4b89ec[_0x6613('0x18')];this['blindTransfers']={};ami['on'](_0x6613('0x19'),this[_0x6613('0x1a')][_0x6613('0x1b')](this));ami['on']('newexten',this[_0x6613('0x1a')]['bind'](this));ami['on'](_0x6613('0x1c'),this[_0x6613('0x1d')][_0x6613('0x1b')](this));ami['on'](_0x6613('0x1e'),this['syncNewState']['bind'](this));ami['on'](_0x6613('0x1f'),this[_0x6613('0x20')][_0x6613('0x1b')](this));ami['on']('hangup',this['syncHangup'][_0x6613('0x1b')](this));ami['on'](_0x6613('0x21'),this['syncNewCallerId']['bind'](this));ami['on'](_0x6613('0x22'),this[_0x6613('0x23')][_0x6613('0x1b')](this));ami['on'](_0x6613('0x24'),this[_0x6613('0x25')]['bind'](this));ami['on'](_0x6613('0x26'),this[_0x6613('0x27')]['bind'](this));ami['on'](_0x6613('0x28'),this[_0x6613('0x29')]['bind'](this));try{logger[_0x6613('0x2a')](_0x6613('0x2b'));ami[_0x6613('0x2c')]();}catch(_0x40285d){logger['error']('[voiceCallReport][coreshowchannels]',util[_0x6613('0x2d')](_0x40285d,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x6613('0x2e')]=function(_0x2b4f78){return _0x2b4f78!==null&&!_[_0x6613('0x2f')](_0x2b4f78);};VoiceCallReport['prototype'][_0x6613('0x30')]=function(_0x1a5416,_0x1b7af8,_0x4a52ac){io['to'](_0x1a5416)[_0x6613('0x30')](_0x1b7af8,_0x4a52ac);};VoiceCallReport['prototype'][_0x6613('0x31')]=function(_0x29e3b5){try{if(this['isNotNull'](_0x29e3b5)){logger[_0x6613('0x2a')](_0x6613('0x32'),_0x29e3b5['uniqueid'],_0x29e3b5[_0x6613('0x33')],_0x29e3b5[_0x6613('0x34')]);logger[_0x6613('0x35')](_0x6613('0x36'),_0x29e3b5['uniqueid'],util['inspect'](_0x29e3b5,{'showHidden':![],'depth':null}));if(_0x29e3b5['uniqueid']===_0x29e3b5[_0x6613('0x37')]){if(!_[_0x6613('0x2f')](this[_0x6613('0x17')][_0x29e3b5['uniqueid']])){_[_0x6613('0x38')](this[_0x6613('0x17')][_0x29e3b5[_0x6613('0x39')]],_[_0x6613('0x3a')](_0x29e3b5,_[_0x6613('0x3b')](this['channels'][_0x29e3b5['uniqueid']])));}}if(_0x29e3b5[_0x6613('0x3c')]===_0x6613('0x3d')){var _0x50602f=this[_0x6613('0x18')][_0x29e3b5[_0x6613('0x3e')][_0x6613('0x3f')]('-')[0x0]];if(_0x50602f){if(_0x29e3b5[_0x6613('0x40')]==_0x6613('0x41')){_0x50602f[_0x6613('0x42')]=_0x29e3b5['connectedlinenum'];this[_0x6613('0x30')](util[_0x6613('0x43')](_0x6613('0x44'),_0x50602f['name']),'user:agentconnect',{'id':_0x50602f['id'],'destaccountcode':_0x50602f[_0x6613('0x45')],'destconnectedlinenum':_0x29e3b5['connectedlinenum']});}}}}}catch(_0x164888){logger[_0x6613('0x46')](_0x6613('0x47'),_0x29e3b5[_0x6613('0x39')],util[_0x6613('0x2d')](_0x164888,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6613('0x48')][_0x6613('0x1d')]=function(_0x39f40a){try{if(this[_0x6613('0x2e')](_0x39f40a)){logger[_0x6613('0x35')](_0x6613('0x49'),_0x39f40a[_0x6613('0x39')],util[_0x6613('0x2d')](_0x39f40a,{'showHidden':![],'depth':null}));if(this[_0x6613('0x17')][_0x39f40a[_0x6613('0x39')]]){return;}if(_0x39f40a[_0x6613('0x3e')]==='OutgoingSpoolFailed'){return;}if(_0x39f40a[_0x6613('0x39')]!==_0x39f40a[_0x6613('0x37')]&&!this['blindTransfers'][_0x39f40a[_0x6613('0x37')]]){return;}logger['info'](_0x6613('0x4a'),_0x39f40a[_0x6613('0x39')],_0x39f40a[_0x6613('0x3c')],_0x39f40a[_0x6613('0x40')]);this['channels'][_0x39f40a[_0x6613('0x39')]]=new Channel();this[_0x6613('0x17')][_0x39f40a['uniqueid']][_0x6613('0x4b')]=moment()['format'](_0x6613('0x4c'));this[_0x6613('0x17')][_0x39f40a[_0x6613('0x39')]][_0x6613('0x4d')]=dispositions[_[_0x6613('0x4e')](_0x39f40a[_0x6613('0x4f')])];_[_0x6613('0x38')](this[_0x6613('0x17')][_0x39f40a['uniqueid']],_['pick'](_0x39f40a,_[_0x6613('0x3b')](this[_0x6613('0x17')][_0x39f40a['uniqueid']])));if(_0x39f40a['context']===_0x6613('0x3d')){var _0x2fdd6e=this[_0x6613('0x18')][_0x39f40a['channel'][_0x6613('0x3f')]('-')[0x0]];if(_0x2fdd6e&&typeof _0x2fdd6e['destconnectedlinenum']===_0x6613('0x50')){_0x2fdd6e[_0x6613('0x42')]=_0x39f40a[_0x6613('0x40')];logger[_0x6613('0x35')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x39f40a[_0x6613('0x39')],util[_0x6613('0x2d')]({'id':_0x2fdd6e['id'],'destaccountcode':_0x2fdd6e[_0x6613('0x45')],'destconnectedlinenum':_0x39f40a[_0x6613('0x40')]},{'showHidden':![],'depth':null}));this[_0x6613('0x30')](util['format'](_0x6613('0x44'),_0x2fdd6e['name']),_0x6613('0x51'),{'id':_0x2fdd6e['id'],'destaccountcode':_0x2fdd6e['accountcode'],'destconnectedlinenum':_0x39f40a[_0x6613('0x40')]});}}}}catch(_0x40cd60){logger[_0x6613('0x46')](_0x6613('0x52'),_0x39f40a['uniqueid'],util['inspect'](_0x40cd60,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0x13be4b){try{if(this[_0x6613('0x2e')](_0x13be4b)){logger[_0x6613('0x35')](_0x6613('0x53'),_0x13be4b[_0x6613('0x39')],util[_0x6613('0x2d')](_0x13be4b,{'showHidden':![],'depth':null}));if(_0x13be4b[_0x6613('0x3e')]===_0x6613('0x54')||_0x13be4b[_0x6613('0x40')]==='h')return;if(_0x13be4b[_0x6613('0x39')]===_0x13be4b[_0x6613('0x37')]||this['blindTransfers'][_0x13be4b[_0x6613('0x37')]]){_0x13be4b[_0x6613('0x55')]=_0x13be4b[_0x6613('0x55')]?_0x13be4b[_0x6613('0x55')][_0x6613('0x56')]():undefined;_0x13be4b[_0x6613('0x57')]=_0x13be4b[_0x6613('0x58')]||_0x13be4b[_0x6613('0x57')];if(_0x13be4b[_0x6613('0x58')]&&_0x13be4b['application']!==_0x6613('0xa')){_0x13be4b[_0x6613('0x57')]=_0x13be4b[_0x6613('0x57')][_0x6613('0x56')]();}logger[_0x6613('0x2a')](_0x6613('0x59'),_0x13be4b[_0x6613('0x39')],_0x13be4b[_0x6613('0x55')],_0x13be4b[_0x6613('0x57')]);if(_['isUndefined'](this[_0x6613('0x17')][_0x13be4b[_0x6613('0x39')]])){this[_0x6613('0x17')][_0x13be4b[_0x6613('0x39')]]=new Channel();this[_0x6613('0x17')][_0x13be4b[_0x6613('0x39')]]['starttime']=_0x13be4b[_0x6613('0x5a')]?moment()[_0x6613('0x5b')](moment[_0x6613('0x5a')](_0x13be4b[_0x6613('0x5a')])[_0x6613('0x5c')](),_0x6613('0x5c'))[_0x6613('0x43')](_0x6613('0x4c')):moment()[_0x6613('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6613('0x17')][_0x13be4b['uniqueid']][_0x6613('0x4d')]=_0x6613('0xf');}_[_0x6613('0x38')](this[_0x6613('0x17')][_0x13be4b[_0x6613('0x39')]],_[_0x6613('0x3a')](_0x13be4b,_[_0x6613('0x3b')](this[_0x6613('0x17')][_0x13be4b[_0x6613('0x39')]])));if(_['includes'](applications,_0x13be4b['application'])){this[_0x6613('0x17')][_0x13be4b[_0x6613('0x39')]][_0x6613('0x5d')]=_0x13be4b[_0x6613('0x55')];this['channels'][_0x13be4b['uniqueid']]['lastdata']=_0x13be4b[_0x6613('0x57')];if(_0x13be4b[_0x6613('0x55')]==='set'&&_[_0x6613('0x5e')](_0x13be4b[_0x6613('0x57')][_0x6613('0x56')](),_0x6613('0x5f'))){var _0xced854=_0x13be4b[_0x6613('0x57')][_0x6613('0x3f')]('=');var _0xb037c2=_0xced854[0x0][_0x6613('0x56')]()[_0x6613('0x60')](/cdr\((.*)\)/);if(_0xb037c2){if(_0xb037c2[0x1]==='type'&&!_[_0x6613('0x61')](this[_0x6613('0x17')][_0x13be4b[_0x6613('0x39')]][_0xb037c2[0x1]]))return;this[_0x6613('0x17')][_0x13be4b['uniqueid']][_0xb037c2[0x1]]=_0xced854[0x1];}}else if(_0x13be4b[_0x6613('0x55')]==='queue'){this[_0x6613('0x17')][_0x13be4b['uniqueid']]['queue']=_0x13be4b['applicationdata']['split'](',')[0x0];}}}}}catch(_0xf9972e){logger[_0x6613('0x46')](_0x6613('0x62'),_0x13be4b[_0x6613('0x39')],util[_0x6613('0x2d')](_0xf9972e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6613('0x48')]['syncNewState']=function(_0x5005ca){try{if(this[_0x6613('0x2e')](_0x5005ca)){logger['info']('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x5005ca[_0x6613('0x39')],_0x5005ca['linkedid'],_0x5005ca[_0x6613('0x33')],_0x5005ca['calleridnum']);logger[_0x6613('0x35')](_0x6613('0x63'),_0x5005ca[_0x6613('0x39')],util[_0x6613('0x2d')](_0x5005ca,{'showHidden':![],'depth':null}));if(_0x5005ca[_0x6613('0x4f')]!=='6')return;var _0x34d82f=this[_0x6613('0x18')][_0x5005ca[_0x6613('0x3e')]['split']('-')[0x0]];if(_0x5005ca[_0x6613('0x39')]!==_0x5005ca[_0x6613('0x37')]){var _0x4b3402=moment();if(this[_0x6613('0x17')][_0x5005ca[_0x6613('0x37')]]){if(!this[_0x6613('0x17')][_0x5005ca[_0x6613('0x37')]]['answered']){this[_0x6613('0x17')][_0x5005ca['linkedid']][_0x6613('0x64')]=!![];this[_0x6613('0x17')][_0x5005ca[_0x6613('0x37')]][_0x6613('0x65')]=_0x4b3402[_0x6613('0x43')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x6613('0x17')][_0x5005ca[_0x6613('0x37')]][_0x6613('0x4b')]){this[_0x6613('0x17')][_0x5005ca[_0x6613('0x37')]][_0x6613('0x66')]=_0x4b3402[_0x6613('0x67')](this['channels'][_0x5005ca[_0x6613('0x37')]]['starttime'],_0x6613('0x5c'));}}this[_0x6613('0x17')][_0x5005ca[_0x6613('0x37')]][_0x6613('0x37')]=_0x5005ca[_0x6613('0x39')];if(_0x5005ca[_0x6613('0x34')]!==_0x6613('0x41')){this[_0x6613('0x17')][_0x5005ca[_0x6613('0x37')]][_0x6613('0x68')]=_0x5005ca[_0x6613('0x34')];}this[_0x6613('0x17')][_0x5005ca[_0x6613('0x37')]]['connectedlinename']=_0x5005ca['calleridname'];this[_0x6613('0x17')][_0x5005ca[_0x6613('0x37')]]['destinationchannel']=_0x5005ca['channel'];this[_0x6613('0x17')][_0x5005ca[_0x6613('0x37')]][_0x6613('0x4d')]=dispositions[_[_0x6613('0x4e')](_0x5005ca['channelstate'])];if(_0x34d82f){this['channels'][_0x5005ca[_0x6613('0x37')]]['UserId']=_0x34d82f['id'];this[_0x6613('0x17')][_0x5005ca[_0x6613('0x37')]]['membername']=_0x34d82f['name'];}}if(this['channels'][_0x5005ca[_0x6613('0x39')]]){if(!this['channels'][_0x5005ca[_0x6613('0x39')]][_0x6613('0x64')]){this['channels'][_0x5005ca[_0x6613('0x39')]][_0x6613('0x64')]=!![];this[_0x6613('0x17')][_0x5005ca[_0x6613('0x39')]][_0x6613('0x65')]=_0x4b3402['format'](_0x6613('0x4c'));if(this[_0x6613('0x17')][_0x5005ca['uniqueid']][_0x6613('0x4b')]){this[_0x6613('0x17')][_0x5005ca[_0x6613('0x39')]][_0x6613('0x66')]=_0x4b3402[_0x6613('0x67')](this[_0x6613('0x17')][_0x5005ca[_0x6613('0x39')]][_0x6613('0x4b')],_0x6613('0x5c'));}}if(_0x5005ca[_0x6613('0x34')]!==_0x6613('0x41')){this[_0x6613('0x17')][_0x5005ca[_0x6613('0x39')]]['connectedlinenum']=_0x5005ca[_0x6613('0x34')];}this['channels'][_0x5005ca['uniqueid']]['connectedlinename']=_0x5005ca[_0x6613('0x33')];this['channels'][_0x5005ca[_0x6613('0x39')]][_0x6613('0x69')]=_0x5005ca[_0x6613('0x3e')];this[_0x6613('0x17')][_0x5005ca[_0x6613('0x39')]][_0x6613('0x4d')]=dispositions[_[_0x6613('0x4e')](_0x5005ca['channelstate'])];}}else{if(this[_0x6613('0x17')][_0x5005ca['uniqueid']]){if(_0x34d82f){this[_0x6613('0x17')][_0x5005ca[_0x6613('0x39')]][_0x6613('0x6a')]=_0x34d82f['id'];this['channels'][_0x5005ca[_0x6613('0x39')]][_0x6613('0x6b')]=_0x34d82f[_0x6613('0x6c')];}}}if(_0x5005ca['context']===_0x6613('0x3d')){if(_0x34d82f){_0x34d82f[_0x6613('0x42')]=_0x5005ca[_0x6613('0x40')];var _0x2dabb6;if(this[_0x6613('0x17')][_0x5005ca['uniqueid']]){_0x2dabb6=this[_0x6613('0x17')][_0x5005ca[_0x6613('0x39')]][_0x6613('0xa')];}else if(this[_0x6613('0x17')][_0x5005ca[_0x6613('0x37')]]){_0x2dabb6=this[_0x6613('0x17')][_0x5005ca['linkedid']][_0x6613('0xa')];}_0x34d82f[_0x6613('0xa')]=_0x2dabb6;var _0x39329d={'id':_0x34d82f['id'],'name':_0x34d82f[_0x6613('0x6c')],'agentconnected':!![],'destaccountcode':_0x34d82f['accountcode'],'destconnectedlinenum':_0x5005ca['exten'],'queue':_0x2dabb6||undefined,'uniqueid':_0x5005ca[_0x6613('0x37')]};logger[_0x6613('0x35')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x5005ca[_0x6613('0x39')],util[_0x6613('0x2d')](_0x39329d,{'showHidden':![],'depth':null}));this[_0x6613('0x30')](util[_0x6613('0x43')](_0x6613('0x44'),_0x34d82f['name']),'user:agentconnect',_0x39329d);}}}}catch(_0x5508ee){logger[_0x6613('0x46')](_0x6613('0x6d'),_0x5005ca[_0x6613('0x39')],util[_0x6613('0x2d')](_0x5508ee,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x6613('0x6e')]=function(_0x37d3b3,_0x7b1b9){try{if(this['channels'][_0x37d3b3]){logger[_0x6613('0x2a')](_0x6613('0x6f'),_0x37d3b3,_0x7b1b9);this['channels'][_0x37d3b3][_0x6613('0x70')]=!![];if(_[_0x6613('0x71')](_0x7b1b9,_0x6613('0x72'))){_0x7b1b9=_0x7b1b9[_0x6613('0x73')](_0x6613('0x72'),_0x6613('0x74'));}this[_0x6613('0x17')][_0x37d3b3][_0x6613('0x75')]=_0x7b1b9;var _0x543b5b=_['find'](this[_0x6613('0x17')][_0x37d3b3][_0x6613('0x76')],{'filename':_0x7b1b9});if(_[_0x6613('0x61')](_0x543b5b)){this['channels'][_0x37d3b3][_0x6613('0x76')][_0x6613('0x77')]({'filename':_0x7b1b9,'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x6613('0x78')});}}}catch(_0x36ef84){logger[_0x6613('0x46')]('[%s][voiceCallReport][mixMonitorFilename]',_0x37d3b3,util['inspect'](_0x36ef84,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6613('0x48')][_0x6613('0x20')]=function(_0x4c3a62){try{if(this[_0x6613('0x2e')](_0x4c3a62)){logger[_0x6613('0x35')](_0x6613('0x79'),_0x4c3a62[_0x6613('0x39')],util[_0x6613('0x2d')](_0x4c3a62,{'showHidden':![],'depth':null}));if(this[_0x6613('0x17')][_0x4c3a62['uniqueid']]&&_0x4c3a62[_0x6613('0x3e')]!=_0x6613('0x54')){if(this[_0x6613('0x2e')](_0x4c3a62['variable'])){if(this[_0x6613('0x2e')](_0x4c3a62[_0x6613('0x7a')]['mixmonitor_filename'])){logger[_0x6613('0x2a')](_0x6613('0x7b'),_0x4c3a62['uniqueid'],_0x4c3a62[_0x6613('0x7c')]);this[_0x6613('0x6e')](_0x4c3a62[_0x6613('0x39')],_0x4c3a62['value']);}else if(this[_0x6613('0x2e')](_0x4c3a62[_0x6613('0x7a')]['xmd-phone'])){logger['info'](_0x6613('0x7d'),_0x4c3a62[_0x6613('0x39')],_0x4c3a62[_0x6613('0x7c')]);this[_0x6613('0x17')][_0x4c3a62['uniqueid']][_0x6613('0x34')]=_0x4c3a62[_0x6613('0x7c')];}else if(this[_0x6613('0x2e')](_0x4c3a62[_0x6613('0x7a')][_0x6613('0x7e')])){logger[_0x6613('0x2a')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x4c3a62[_0x6613('0x39')],_0x4c3a62[_0x6613('0x7c')]);this['channels'][_0x4c3a62[_0x6613('0x39')]][_0x6613('0x7f')]=_0x4c3a62['value'];}else if(this[_0x6613('0x2e')](_0x4c3a62[_0x6613('0x7a')][_0x6613('0x80')])){logger[_0x6613('0x2a')](_0x6613('0x81'),_0x4c3a62[_0x6613('0x39')],_0x4c3a62[_0x6613('0x7c')]);this[_0x6613('0x17')][_0x4c3a62[_0x6613('0x39')]][_0x6613('0x82')]=_0x4c3a62[_0x6613('0x7c')];}else if(this[_0x6613('0x2e')](_0x4c3a62['variable'][_0x6613('0x83')])){logger[_0x6613('0x2a')](_0x6613('0x84'),_0x4c3a62[_0x6613('0x39')],_0x4c3a62[_0x6613('0x7c')][_0x6613('0x3f')](',')[0x0]);this['channels'][_0x4c3a62[_0x6613('0x39')]]['queue']=_0x4c3a62[_0x6613('0x7c')]['split'](',')[0x0];}else if(this[_0x6613('0x2e')](_0x4c3a62[_0x6613('0x7a')]['xmd-originatecalleridnum'])){logger['info'](_0x6613('0x85'),_0x4c3a62[_0x6613('0x39')],_0x4c3a62[_0x6613('0x7c')]);this[_0x6613('0x17')][_0x4c3a62[_0x6613('0x39')]][_0x6613('0x86')]=_0x4c3a62[_0x6613('0x7c')];}else if(this[_0x6613('0x2e')](_0x4c3a62[_0x6613('0x7a')][_0x6613('0x87')])){logger['info'](_0x6613('0x88'),_0x4c3a62[_0x6613('0x39')],_0x4c3a62[_0x6613('0x7c')]);this[_0x6613('0x17')][_0x4c3a62[_0x6613('0x39')]][_0x6613('0x89')]=_0x4c3a62[_0x6613('0x7c')];}else if(this[_0x6613('0x2e')](_0x4c3a62['variable'][_0x6613('0x8a')])){logger[_0x6613('0x2a')](_0x6613('0x8b'),_0x4c3a62['uniqueid'],_0x4c3a62[_0x6613('0x7c')]);this[_0x6613('0x17')][_0x4c3a62['uniqueid']][_0x6613('0x8c')]=_0x4c3a62[_0x6613('0x7c')];}else if(this[_0x6613('0x2e')](_0x4c3a62[_0x6613('0x7a')][_0x6613('0x8d')])){logger[_0x6613('0x2a')](_0x6613('0x8e'),_0x4c3a62[_0x6613('0x39')],_0x4c3a62[_0x6613('0x7c')]);this[_0x6613('0x17')][_0x4c3a62[_0x6613('0x39')]][_0x6613('0xa')]=_0x4c3a62[_0x6613('0x7c')];}else if(this[_0x6613('0x2e')](_0x4c3a62['variable'][_0x6613('0x8f')])){logger['info'](_0x6613('0x90'),_0x4c3a62['uniqueid'],_0x4c3a62[_0x6613('0x7c')]);this[_0x6613('0x17')][_0x4c3a62['uniqueid']][_0x6613('0x91')]=_0x4c3a62['value'];}}}else if(this[_0x6613('0x2e')](_0x4c3a62['variable'][_0x6613('0x92')])){if(_0x4c3a62[_0x6613('0x7c')]){var _0x18b3fa=path[_0x6613('0x93')](_0x4c3a62[_0x6613('0x7c')])[_0x6613('0x6c')];logger['info'](_0x6613('0x7b'),_0x18b3fa,_0x4c3a62['value']);this[_0x6613('0x6e')](_0x18b3fa,_0x4c3a62['value']);}}else if(this[_0x6613('0x17')][_0x4c3a62[_0x6613('0x37')]]){if(this[_0x6613('0x2e')](_0x4c3a62[_0x6613('0x7a')])){if(this[_0x6613('0x2e')](_0x4c3a62[_0x6613('0x7a')]['sipcallid'])){logger[_0x6613('0x2a')](_0x6613('0x90'),_0x4c3a62[_0x6613('0x37')],_0x4c3a62['value']);this[_0x6613('0x17')][_0x4c3a62['linkedid']][_0x6613('0x94')]=_0x4c3a62[_0x6613('0x7c')];}}}}}catch(_0x36b06f){logger['error'](_0x6613('0x95'),_0x4c3a62[_0x6613('0x39')],util[_0x6613('0x2d')](_0x36b06f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6613('0x48')][_0x6613('0x96')]=function(_0xb421b7){try{if(this[_0x6613('0x2e')](_0xb421b7)){logger['debug'](_0x6613('0x97'),_0xb421b7[_0x6613('0x39')],util['inspect'](_0xb421b7,{'showHidden':![],'depth':null}));if(this[_0x6613('0x98')][_0xb421b7['linkedid']]){if(this[_0x6613('0x17')][this[_0x6613('0x98')][_0xb421b7['linkedid']][_0x6613('0x37')]]){this[_0x6613('0x17')][this[_0x6613('0x98')][_0xb421b7[_0x6613('0x37')]][_0x6613('0x37')]][_0x6613('0x39')]=_0xb421b7[_0x6613('0x39')];this[_0x6613('0x17')][this[_0x6613('0x98')][_0xb421b7[_0x6613('0x37')]][_0x6613('0x37')]][_0x6613('0x64')]=this[_0x6613('0x17')][_0xb421b7[_0x6613('0x39')]]['answered'];this['channels'][this['blindTransfers'][_0xb421b7[_0x6613('0x37')]]['linkedid']][_0x6613('0x65')]=this[_0x6613('0x17')][_0xb421b7['uniqueid']][_0x6613('0x65')];this[_0x6613('0x17')][this[_0x6613('0x98')][_0xb421b7[_0x6613('0x37')]]['linkedid']]['destinationchannel']=this['channels'][this[_0x6613('0x98')][_0xb421b7[_0x6613('0x37')]][_0x6613('0x37')]][_0x6613('0x3e')];this['channels'][this[_0x6613('0x98')][_0xb421b7[_0x6613('0x37')]][_0x6613('0x37')]][_0x6613('0x4d')]=this[_0x6613('0x17')][_0xb421b7['uniqueid']][_0x6613('0x4d')];this[_0x6613('0x17')][_0xb421b7['uniqueid']]=this[_0x6613('0x17')][this[_0x6613('0x98')][_0xb421b7[_0x6613('0x37')]][_0x6613('0x37')]];delete this['channels'][this[_0x6613('0x98')][_0xb421b7['linkedid']]['linkedid']];}else if(this[_0x6613('0x17')][this['blindTransfers'][_0xb421b7[_0x6613('0x37')]][_0x6613('0x39')]]){this[_0x6613('0x17')][this['blindTransfers'][_0xb421b7[_0x6613('0x37')]][_0x6613('0x39')]]['uniqueid']=[this['channels'][this['blindTransfers'][_0xb421b7['linkedid']][_0x6613('0x39')]][_0x6613('0x37')],this[_0x6613('0x17')][this[_0x6613('0x98')][_0xb421b7[_0x6613('0x37')]]['uniqueid']][_0x6613('0x37')]=this[_0x6613('0x17')][this[_0x6613('0x98')][_0xb421b7['linkedid']][_0x6613('0x39')]][_0x6613('0x39')]][0x0];this[_0x6613('0x17')][this['blindTransfers'][_0xb421b7[_0x6613('0x37')]]['uniqueid']][_0x6613('0x64')]=this[_0x6613('0x17')][_0xb421b7['uniqueid']][_0x6613('0x64')];this[_0x6613('0x17')][this[_0x6613('0x98')][_0xb421b7[_0x6613('0x37')]]['uniqueid']][_0x6613('0x65')]=this[_0x6613('0x17')][_0xb421b7[_0x6613('0x39')]]['answertime'];this[_0x6613('0x17')][this[_0x6613('0x98')][_0xb421b7[_0x6613('0x37')]]['uniqueid']]['destinationchannel']=this[_0x6613('0x17')][this['blindTransfers'][_0xb421b7[_0x6613('0x37')]][_0x6613('0x39')]]['channel'];this['channels'][this[_0x6613('0x98')][_0xb421b7['linkedid']][_0x6613('0x39')]][_0x6613('0x4d')]=this[_0x6613('0x17')][_0xb421b7['uniqueid']][_0x6613('0x4d')];this['channels'][_0xb421b7[_0x6613('0x39')]]=this[_0x6613('0x17')][this[_0x6613('0x98')][_0xb421b7[_0x6613('0x37')]]['uniqueid']];delete this['channels'][this['blindTransfers'][_0xb421b7[_0x6613('0x37')]][_0x6613('0x39')]];}}if(this[_0x6613('0x17')][_0xb421b7[_0x6613('0x39')]]){logger[_0x6613('0x2a')](_0x6613('0x99'),_0xb421b7['uniqueid'],_0xb421b7[_0x6613('0x9a')]);var _0x3d3d50=moment();this[_0x6613('0x17')][_0xb421b7[_0x6613('0x39')]][_0x6613('0x9b')]=_0x3d3d50['format'](_0x6613('0x4c'));this[_0x6613('0x17')][_0xb421b7[_0x6613('0x39')]][_0x6613('0x5a')]=_0x3d3d50[_0x6613('0x67')](this[_0x6613('0x17')][_0xb421b7[_0x6613('0x39')]][_0x6613('0x4b')],_0x6613('0x5c'));if(this[_0x6613('0x17')][_0xb421b7[_0x6613('0x39')]][_0x6613('0x64')]){this[_0x6613('0x17')][_0xb421b7[_0x6613('0x39')]][_0x6613('0x9c')]=_0x3d3d50[_0x6613('0x67')](this['channels'][_0xb421b7[_0x6613('0x39')]]['answertime'],_0x6613('0x5c'));this['channels'][_0xb421b7['uniqueid']]['holdtime']=this[_0x6613('0x17')][_0xb421b7[_0x6613('0x39')]]['duration']-this[_0x6613('0x17')][_0xb421b7[_0x6613('0x39')]][_0x6613('0x9c')];}if(_0xb421b7[_0x6613('0x3c')]===_0x6613('0x3d')){if(this[_0x6613('0x18')][_0xb421b7['channel'][_0x6613('0x3f')]('-')[0x0]]){this['agents'][_0xb421b7[_0x6613('0x3e')][_0x6613('0x3f')]('-')[0x0]]=_[_0x6613('0x9d')](this[_0x6613('0x18')][_0xb421b7[_0x6613('0x3e')][_0x6613('0x3f')]('-')[0x0]],[_0x6613('0x42')]);logger[_0x6613('0x35')](_0x6613('0x9e'),_0xb421b7[_0x6613('0x39')],util[_0x6613('0x2d')]({'id':this[_0x6613('0x18')][_0xb421b7[_0x6613('0x3e')][_0x6613('0x3f')]('-')[0x0]]['id'],'destaccountcode':this[_0x6613('0x18')][_0xb421b7[_0x6613('0x3e')][_0x6613('0x3f')]('-')[0x0]][_0x6613('0x45')]},{'showHidden':![],'depth':null}));this[_0x6613('0x30')](util[_0x6613('0x43')](_0x6613('0x44'),this['agents'][_0xb421b7['channel'][_0x6613('0x3f')]('-')[0x0]]['name']),'user:agentcomplete',{'id':this[_0x6613('0x18')][_0xb421b7['channel'][_0x6613('0x3f')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0xb421b7[_0x6613('0x3e')][_0x6613('0x3f')]('-')[0x0]]['accountcode']});for(var _0x4acdbc=0x0;_0x4acdbc0x0?!![]:![];if(!_0x5a806d){return this[_0x8fc2('0x16')](this[_0x8fc2('0x10')]['completeEvent']);}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x17')]=function(_0x24ce3f){var _0x4ae8c=this[_0x8fc2('0x10')]['id'];if(this[_0x8fc2('0x10')]['queuestatus'][_0x4ae8c]&&this['summary'][_0x8fc2('0x61')][_0x4ae8c][_0x24ce3f[_0x8fc2('0x69')]]){this[_0x8fc2('0x10')][_0x8fc2('0x61')][_0x4ae8c][_0x24ce3f[_0x8fc2('0x69')]][_0x8fc2('0xc')][_0x8fc2('0x6d')](_0x24ce3f);}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x13')]=function(_0x331ed0){var _0x2b94df=this;try{if(this[_0x8fc2('0x5b')](_0x331ed0)&&this['isNotNull'](_0x331ed0[_0x8fc2('0x4f')])){logger[_0x8fc2('0x4b')](_0x8fc2('0x6e'),util[_0x8fc2('0x43')](_0x331ed0,{'showHidden':![],'depth':null}));var _0x10d8d1=this[_0x8fc2('0xe')][_0x331ed0['queue']];if(_0x10d8d1){logger[_0x8fc2('0x4b')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x10d8d1['name']);this[_0x8fc2('0x10')][_0x8fc2('0x5d')][_0x10d8d1['name']]={'summaryEvent':_0x331ed0};this[_0x8fc2('0x10')][_0x8fc2('0x6c')]+=0x1;return ami[_0x8fc2('0x3e')]({'action':'queuestatus','queue':_0x10d8d1[_0x8fc2('0x63')]})[_0x8fc2('0x5f')](function(_0x1591eb){if(!_0x2b94df[_0x8fc2('0x10')][_0x8fc2('0x61')][_0x331ed0[_0x8fc2('0x69')]]){_0x2b94df[_0x8fc2('0x10')][_0x8fc2('0x61')][_0x331ed0[_0x8fc2('0x69')]]={};}_0x2b94df['summary']['queuestatus'][_0x331ed0['actionid']][_0x1591eb[_0x8fc2('0x69')]]={'queue':_0x10d8d1[_0x8fc2('0x63')],'agents':[]};})[_0x8fc2('0x5e')](function(_0x3ac16c){throw _0x3ac16c;});}}}catch(_0x956823){logger['error'](_0x8fc2('0x6f'),util[_0x8fc2('0x43')](_0x956823,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x16')]=function(_0x5d1fac){if(this[_0x8fc2('0x10')][_0x8fc2('0x6c')]>0x0){this[_0x8fc2('0x10')][_0x8fc2('0x70')]=_0x5d1fac;return;}logger['debug'](_0x8fc2('0x71'),util[_0x8fc2('0x43')](_0x5d1fac,{'showHidden':![],'depth':null}));this[_0x8fc2('0x10')]=initializeSummary();ami[_0x8fc2('0x49')](_0x8fc2('0x72'),{});};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x73')]=function(_0x58e8d8){try{if(this[_0x8fc2('0x5b')](_0x58e8d8)){logger[_0x8fc2('0x4b')](_0x8fc2('0x74'),_0x58e8d8[_0x8fc2('0x53')],util[_0x8fc2('0x43')](_0x58e8d8,{'showHidden':![],'depth':null}));if(_[_0x8fc2('0x5c')](this[_0x8fc2('0xb')][_0x58e8d8[_0x8fc2('0x53')]])){this[_0x8fc2('0xb')][_0x58e8d8[_0x8fc2('0x53')]]=[];}if(_[_0x8fc2('0x5c')](this[_0x8fc2('0xd')][_0x58e8d8[_0x8fc2('0x53')]])){this[_0x8fc2('0xd')][_0x58e8d8[_0x8fc2('0x53')]]={};}var _0x27ca33=new QueueReport();_0x27ca33[_0x8fc2('0x4f')]=_0x58e8d8[_0x8fc2('0x4f')];_0x27ca33['type']=this[_0x8fc2('0xe')][_0x27ca33[_0x8fc2('0x4f')]]&&this['voiceQueues'][_0x27ca33[_0x8fc2('0x4f')]]['type']?this[_0x8fc2('0xe')][_0x27ca33[_0x8fc2('0x4f')]][_0x8fc2('0x6a')]||'inbound':'inbound';_0x27ca33[_0x8fc2('0x75')]=moment()[_0x8fc2('0x4e')](_0x8fc2('0x76'));_0x27ca33[_0x8fc2('0x77')]=_0x58e8d8['position'];_0x27ca33[_0x8fc2('0x78')]=_0x58e8d8[_0x8fc2('0x78')];_0x27ca33[_0x8fc2('0x53')]=_0x58e8d8[_0x8fc2('0x53')];logger[_0x8fc2('0x79')](_0x8fc2('0x7a'),_0x27ca33['queue'],_0x27ca33[_0x8fc2('0x6a')]);Object[_0x8fc2('0x68')](_0x27ca33,_[_0x8fc2('0x7b')](_0x58e8d8,_[_0x8fc2('0x7c')](_0x27ca33)));this[_0x8fc2('0xb')][_0x58e8d8['uniqueid']][_0x8fc2('0x6d')](_0x27ca33);this['channels'][_0x58e8d8[_0x8fc2('0x53')]]=_0x27ca33;this['emitVoiceQueueChannelSave'](_0x27ca33,_0x8fc2('0x7d'));}}catch(_0x2196d9){logger[_0x8fc2('0x42')]('[%s][voiceQueueReport][queuecallerjoin]',_0x58e8d8['uniqueid'],util[_0x8fc2('0x43')](_0x2196d9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x7e')]=function(_0x26a2b8){try{if(this[_0x8fc2('0x5b')](_0x26a2b8)){logger[_0x8fc2('0x4b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x26a2b8['uniqueid'],util['inspect'](_0x26a2b8,{'showHidden':![],'depth':null}));if(this[_0x8fc2('0xb')][_0x26a2b8['uniqueid']]){var _0x4ae3c4=_[_0x8fc2('0x7f')](this['queueReports'][_0x26a2b8[_0x8fc2('0x53')]]);_0x4ae3c4[_0x8fc2('0x38')]=![];_0x4ae3c4[_0x8fc2('0x80')]=null;_0x4ae3c4['holdtime']=_0x26a2b8[_0x8fc2('0x81')];_0x4ae3c4[_0x8fc2('0x82')]=_0x26a2b8[_0x8fc2('0x82')];_0x4ae3c4[_0x8fc2('0x19')]=!![];_0x4ae3c4[_0x8fc2('0x83')]=moment()[_0x8fc2('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x4ae3c4[_0x8fc2('0x84')]=_0x8fc2('0x85');_0x4ae3c4[_0x8fc2('0x86')]=null;logger[_0x8fc2('0x79')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x4ae3c4[_0x8fc2('0x4f')],_0x4ae3c4['type']);this[_0x8fc2('0xd')][_0x26a2b8[_0x8fc2('0x53')]]=_0x4ae3c4;this['emitVoiceQueueChannelRemove'](_0x4ae3c4,_0x8fc2('0x19'));}}}catch(_0x377251){logger[_0x8fc2('0x42')](_0x8fc2('0x87'),_0x26a2b8[_0x8fc2('0x53')],util[_0x8fc2('0x43')](_0x377251,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x1b')]=function(_0xe5b791){try{if(this[_0x8fc2('0x5b')](_0xe5b791)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0xe5b791[_0x8fc2('0x53')],util[_0x8fc2('0x43')](_0xe5b791,{'showHidden':![],'depth':null}));if(this[_0x8fc2('0xb')][_0xe5b791[_0x8fc2('0x53')]]){var _0x196a4b=_[_0x8fc2('0x7f')](this['queueReports'][_0xe5b791['uniqueid']]);_0x196a4b['queuecallerleaveAt']=moment()[_0x8fc2('0x4e')](_0x8fc2('0x76'));_0x196a4b[_0x8fc2('0x88')]=_0xe5b791[_0x8fc2('0x88')];_0x196a4b[_0x8fc2('0x89')]=_0xe5b791[_0x8fc2('0x89')];logger[_0x8fc2('0x79')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x196a4b[_0x8fc2('0x4f')],_0x196a4b[_0x8fc2('0x6a')],_0xe5b791['connectedlinenum'],_0xe5b791[_0x8fc2('0x89')]);this['channels'][_0xe5b791[_0x8fc2('0x53')]]=_0x196a4b;this[_0x8fc2('0x4a')](_0x196a4b,_0x8fc2('0x1a'));}}}catch(_0x4c0929){logger['error'](_0x8fc2('0x8a'),_0xe5b791['uniqueid'],util[_0x8fc2('0x43')](_0x4c0929,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x1f')]=function(_0x3e02ec){try{if(this[_0x8fc2('0x5b')](_0x3e02ec)){logger['debug'](_0x8fc2('0x8b'),_0x3e02ec['uniqueid'],util[_0x8fc2('0x43')](_0x3e02ec,{'showHidden':![],'depth':null}));if(this[_0x8fc2('0xb')][_0x3e02ec['uniqueid']]){var _0x5a59fd=_['last'](this[_0x8fc2('0xb')][_0x3e02ec['uniqueid']]);_0x5a59fd[_0x8fc2('0x38')]=!![];_0x5a59fd[_0x8fc2('0x84')]=_0x8fc2('0x8c');logger[_0x8fc2('0x79')](_0x8fc2('0x8d'),_0x5a59fd[_0x8fc2('0x4f')],_0x5a59fd['type']);}}}catch(_0x369ac0){logger['error'](_0x8fc2('0x8b'),_0x3e02ec['uniqueid'],util[_0x8fc2('0x43')](_0x369ac0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x1d')]=function(_0x4ea802){try{if(this[_0x8fc2('0x5b')](_0x4ea802)){logger[_0x8fc2('0x4b')](_0x8fc2('0x8e'),_0x4ea802[_0x8fc2('0x53')],util[_0x8fc2('0x43')](_0x4ea802,{'showHidden':![],'depth':null}));if(this[_0x8fc2('0xb')][_0x4ea802['uniqueid']]){var _0x4cf84b=_[_0x8fc2('0x7f')](this[_0x8fc2('0xb')][_0x4ea802[_0x8fc2('0x53')]]);_0x4cf84b['queuecallerabandon']=![];_0x4cf84b[_0x8fc2('0x83')]=null;_0x4cf84b[_0x8fc2('0x8f')]=!![];_0x4cf84b[_0x8fc2('0x86')]=_0x4ea802['membername'];_0x4cf84b[_0x8fc2('0x81')]=_0x4ea802[_0x8fc2('0x81')];_0x4cf84b[_0x8fc2('0x38')]=!![];_0x4cf84b['queuecallerexit']=![];_0x4cf84b['queuecallerexitAt']=null;if(!_0x4cf84b[_0x8fc2('0x90')]){if(_0x4ea802[_0x8fc2('0x91')]=='transfer'){_0x4cf84b[_0x8fc2('0x84')]=_0x8fc2('0x92');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x4cf84b[_0x8fc2('0x4f')],_0x4cf84b[_0x8fc2('0x6a')]);}else{if(_[_0x8fc2('0x93')](_0x4ea802[_0x8fc2('0x94')][_0x8fc2('0x95')](),_0x8fc2('0x96'))){if(this[_0x8fc2('0xb')][_0x4ea802['linkedid']]){var _0x11484a=_[_0x8fc2('0x7f')](this['queueReports'][_0x4ea802[_0x8fc2('0x97')]]);_0x11484a[_0x8fc2('0x38')]=![];_0x11484a['queuecallerexit']=!![];_0x11484a[_0x8fc2('0x98')]=moment(_0x4cf84b['queuecallerjoinAt'])['add'](_0x4ea802[_0x8fc2('0x81')],'seconds')['format'](_0x8fc2('0x76'));_0x11484a[_0x8fc2('0x84')]=_0x8fc2('0x99');_0x11484a[_0x8fc2('0x90')]=!![];_0x11484a[_0x8fc2('0x9a')]=_0x8fc2('0x9b');_0x11484a[_0x8fc2('0x9c')]=_0x4ea802[_0x8fc2('0x9d')];_0x11484a[_0x8fc2('0x9e')]=_0x4ea802['uniqueid'];logger[_0x8fc2('0x79')](_0x8fc2('0x9f'),_0x11484a['queue'],_0x11484a[_0x8fc2('0x6a')]);var _0x4c02ef=this['queueReports'][_0x4ea802[_0x8fc2('0x97')]];this[_0x8fc2('0xb')][_0x4ea802[_0x8fc2('0x97')]]=this['queueReports'][_0x4ea802[_0x8fc2('0x53')]];this[_0x8fc2('0xb')][_0x4ea802['uniqueid']]=_0x4c02ef;}}else{_0x4cf84b['queuecallerexitreason']=_0x8fc2('0xa0')+_0x4ea802[_0x8fc2('0x91')][_0x8fc2('0xa1')]();logger[_0x8fc2('0x79')](_0x8fc2('0xa2'),_0x4cf84b[_0x8fc2('0x4f')],_0x4cf84b['type'],_0x4cf84b[_0x8fc2('0x84')]);}}}this[_0x8fc2('0xd')][_0x4ea802[_0x8fc2('0x53')]]=_0x4cf84b;}}}catch(_0x582f4a){logger[_0x8fc2('0x42')](_0x8fc2('0x8e'),_0x4ea802[_0x8fc2('0x53')],util['inspect'](_0x582f4a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8fc2('0x21')]=function(_0x2502ed){try{if(this['isNotNull'](_0x2502ed)){logger[_0x8fc2('0x4b')]('[%s][voiceQueueReport][varset]',_0x2502ed['uniqueid'],util[_0x8fc2('0x43')](_0x2502ed,{'showHidden':![],'depth':null}));this[_0x8fc2('0xa3')](_0x2502ed[_0x8fc2('0x53')],_['keys'](_0x2502ed[_0x8fc2('0xa4')])[0x0],_0x2502ed['value']);if(this['queueReports'][_0x2502ed[_0x8fc2('0x53')]]){var _0x587771=_['last'](this['queueReports'][_0x2502ed[_0x8fc2('0x53')]]);if(_0x587771){if(this[_0x8fc2('0x5b')](_0x2502ed['variable'])&&this[_0x8fc2('0x5b')](_0x2502ed[_0x8fc2('0xa4')][_0x8fc2('0x61')])){switch(_0x2502ed[_0x8fc2('0xa5')]){case'CONTINUE':_0x587771[_0x8fc2('0xa6')]=![];_0x587771[_0x8fc2('0x98')]=null;break;case _0x8fc2('0xa7'):_0x587771[_0x8fc2('0xa8')]='timeout';_0x587771[_0x8fc2('0xa6')]=!![];_0x587771[_0x8fc2('0x98')]=moment()[_0x8fc2('0x4e')](_0x8fc2('0x76'));_0x587771['queuecallerleaveAt']=moment()[_0x8fc2('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0x8fc2('0xa9'),_0x2502ed[_0x8fc2('0x53')],util['inspect'](_0x587771,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x587771);break;default:_0x587771[_0x8fc2('0xa6')]=!![];_0x587771[_0x8fc2('0x98')]=moment()[_0x8fc2('0x4e')](_0x8fc2('0x76'));_0x587771['queuecallerleaveAt']=moment()['format'](_0x8fc2('0x76'));}_0x587771[_0x8fc2('0x19')]=![];_0x587771[_0x8fc2('0x83')]=null;_0x587771[_0x8fc2('0x84')]=_0x2502ed[_0x8fc2('0xa5')];this[_0x8fc2('0xd')][_0x2502ed['uniqueid']]=_0x587771;this[_0x8fc2('0x47')](_0x587771,_0x8fc2('0x20'));}else if(this[_0x8fc2('0x5b')](_0x2502ed[_0x8fc2('0xa4')])&&this[_0x8fc2('0x5b')](_0x2502ed['variable'][_0x8fc2('0xaa')])){if(!_0x587771[_0x8fc2('0x19')]){_0x587771['queuecallerexit']=!![];_0x587771[_0x8fc2('0x98')]=moment()[_0x8fc2('0x4e')](_0x8fc2('0x76'));_0x587771[_0x8fc2('0x84')]=_0x8fc2('0xab');_0x587771[_0x8fc2('0xac')]=moment()[_0x8fc2('0x4e')](_0x8fc2('0x76'));this['channels'][_0x2502ed['uniqueid']]=_0x587771;}}logger['info'](_0x8fc2('0xad'),_0x2502ed[_0x8fc2('0x53')],_0x587771['queue'],_0x587771['type'],_[_0x8fc2('0x7c')](_0x2502ed[_0x8fc2('0xa4')])[0x0],_0x2502ed[_0x8fc2('0xa5')]);_0x587771[_0x8fc2('0x11')]=this['variables'][_0x2502ed[_0x8fc2('0x53')]];}}}}catch(_0x187ab0){logger[_0x8fc2('0x42')]('[%s][voiceQueueReport][varset]',_0x2502ed['uniqueid'],util[_0x8fc2('0x43')](_0x187ab0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fc2('0x8')]['addVariable']=function(_0x593f13,_0x4c9a5a,_0xce28dc){var _0x17a457=[_0x8fc2('0xae'),_0x8fc2('0xaf'),_0x8fc2('0xb0'),_0x8fc2('0xb1'),_0x8fc2('0xb2'),_0x8fc2('0xb3'),_0x8fc2('0xb4'),'rtpaudioqosrttbridged',_0x8fc2('0xb5'),_0x8fc2('0xb6'),'bridgepeer',_0x8fc2('0xb7'),_0x8fc2('0xb8'),'memberdynamic',_0x8fc2('0xb9'),'memberlastcall','membername',_0x8fc2('0xba'),_0x8fc2('0xbb')];if(!_[_0x8fc2('0x3d')](_0x4c9a5a)&&!_['includes'](_0x17a457,_0x4c9a5a)){if(_[_0x8fc2('0x5c')](this[_0x8fc2('0x11')][_0x593f13])){this[_0x8fc2('0x11')][_0x593f13]={};}this[_0x8fc2('0x11')][_0x593f13][_0x4c9a5a]=_0xce28dc;}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0xbc')]=function(_0x357611,_0x1034af,_0x49654a){try{var _0x3c288f={};if(this[_0x8fc2('0xb')][_0x357611]){for(var _0x246eb4=0x0;_0x246eb40x0?!![]:![];if(!_0xe63362){return this[_0x3866('0x18')](this['summary']['completeEvent']);}};VoiceQueueReport['prototype'][_0x3866('0x1a')]=function(_0x48bc80){var _0xf1fbd9=this['summary']['id'];if(this['summary'][_0x3866('0x68')][_0xf1fbd9]&&this[_0x3866('0x65')][_0x3866('0x68')][_0xf1fbd9][_0x48bc80[_0x3866('0x67')]]){this[_0x3866('0x65')][_0x3866('0x68')][_0xf1fbd9][_0x48bc80[_0x3866('0x67')]]['agents'][_0x3866('0x73')](_0x48bc80);}};VoiceQueueReport[_0x3866('0x48')][_0x3866('0x16')]=function(_0x529b24){var _0x59301c=this;try{if(this[_0x3866('0x61')](_0x529b24)&&this['isNotNull'](_0x529b24[_0x3866('0x53')])){logger['debug'](_0x3866('0x74'),util['inspect'](_0x529b24,{'showHidden':![],'depth':null}));var _0x11805a=this[_0x3866('0x4a')][_0x529b24[_0x3866('0x53')]];if(_0x11805a){logger[_0x3866('0x4e')](_0x3866('0x75'),_0x11805a[_0x3866('0x5f')]);this[_0x3866('0x65')][_0x3866('0x6a')][_0x11805a['name']]={'summaryEvent':_0x529b24};this[_0x3866('0x65')][_0x3866('0x72')]+=0x1;return ami['Action']({'action':'queuestatus','queue':_0x11805a[_0x3866('0x5f')]})['then'](function(_0x32b945){if(!_0x59301c[_0x3866('0x65')]['queuestatus'][_0x529b24[_0x3866('0x67')]]){_0x59301c[_0x3866('0x65')]['queuestatus'][_0x529b24['actionid']]={};}_0x59301c['summary'][_0x3866('0x68')][_0x529b24[_0x3866('0x67')]][_0x32b945[_0x3866('0x67')]]={'queue':_0x11805a['name'],'agents':[]};})['catch'](function(_0x20e93){throw _0x20e93;});}}}catch(_0x5243e4){logger['error'](_0x3866('0x76'),util['inspect'](_0x5243e4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3866('0x48')][_0x3866('0x18')]=function(_0x1580a9){if(this[_0x3866('0x65')][_0x3866('0x72')]>0x0){this['summary'][_0x3866('0x77')]=_0x1580a9;return;}logger[_0x3866('0x4e')](_0x3866('0x78'),util[_0x3866('0x45')](_0x1580a9,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0x3866('0x4d')](_0x3866('0x79'),{});};VoiceQueueReport[_0x3866('0x48')][_0x3866('0x1d')]=function(_0x29c78a){try{if(this['isNotNull'](_0x29c78a)){logger[_0x3866('0x4e')](_0x3866('0x7a'),_0x29c78a[_0x3866('0x51')],util[_0x3866('0x45')](_0x29c78a,{'showHidden':![],'depth':null}));if(_[_0x3866('0x7b')](this['queueReports'][_0x29c78a[_0x3866('0x51')]])){this[_0x3866('0xf')][_0x29c78a[_0x3866('0x51')]]=[];}if(_[_0x3866('0x7b')](this[_0x3866('0x12')][_0x29c78a[_0x3866('0x51')]])){this[_0x3866('0x12')][_0x29c78a[_0x3866('0x51')]]={};}var _0x3eed2a=new QueueReport();_0x3eed2a[_0x3866('0x53')]=_0x29c78a['queue'];_0x3eed2a[_0x3866('0x5d')]=this['voiceQueues'][_0x3eed2a['queue']]&&this['voiceQueues'][_0x3eed2a[_0x3866('0x53')]][_0x3866('0x5d')]?this['voiceQueues'][_0x3eed2a[_0x3866('0x53')]][_0x3866('0x5d')]||_0x3866('0x5e'):_0x3866('0x5e');_0x3eed2a['queuecallerjoinAt']=moment()['format'](_0x3866('0x7c'));_0x3eed2a['position']=_0x29c78a[_0x3866('0x7d')];_0x3eed2a[_0x3866('0x7e')]=_0x29c78a[_0x3866('0x7e')];_0x3eed2a[_0x3866('0x51')]=_0x29c78a[_0x3866('0x51')];logger[_0x3866('0x7f')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x3eed2a[_0x3866('0x53')],_0x3eed2a['type']);Object['assign'](_0x3eed2a,_[_0x3866('0x80')](_0x29c78a,_[_0x3866('0x81')](_0x3eed2a)));this[_0x3866('0xf')][_0x29c78a['uniqueid']][_0x3866('0x73')](_0x3eed2a);this[_0x3866('0x12')][_0x29c78a[_0x3866('0x51')]]=_0x3eed2a;this[_0x3866('0x82')](_0x3eed2a,_0x3866('0x1c'));}}catch(_0x5e54c9){logger[_0x3866('0x42')](_0x3866('0x7a'),_0x29c78a[_0x3866('0x51')],util['inspect'](_0x5e54c9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3866('0x1e')]=function(_0x1bcb21){try{if(this[_0x3866('0x61')](_0x1bcb21)){logger[_0x3866('0x4e')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1bcb21['uniqueid'],util[_0x3866('0x45')](_0x1bcb21,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1bcb21[_0x3866('0x51')]]){var _0xddc5dd=_[_0x3866('0x83')](this[_0x3866('0xf')][_0x1bcb21['uniqueid']]);_0xddc5dd[_0x3866('0x3a')]=![];_0xddc5dd[_0x3866('0x84')]=null;_0xddc5dd[_0x3866('0x85')]=_0x1bcb21[_0x3866('0x85')];_0xddc5dd[_0x3866('0x86')]=_0x1bcb21['originalposition'];_0xddc5dd[_0x3866('0x39')]=!![];_0xddc5dd[_0x3866('0x87')]=moment()['format'](_0x3866('0x7c'));_0xddc5dd[_0x3866('0x58')]=_0x3866('0x88');_0xddc5dd[_0x3866('0x89')]=null;logger['info'](_0x3866('0x8a'),_0xddc5dd['queue'],_0xddc5dd['type']);this[_0x3866('0x12')][_0x1bcb21['uniqueid']]=_0xddc5dd;this[_0x3866('0x56')](_0xddc5dd,_0x3866('0x39'));}}}catch(_0x32d695){logger['error'](_0x3866('0x8b'),_0x1bcb21[_0x3866('0x51')],util[_0x3866('0x45')](_0x32d695,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3866('0x48')][_0x3866('0x20')]=function(_0x5c7e05){try{if(this[_0x3866('0x61')](_0x5c7e05)){logger[_0x3866('0x4e')](_0x3866('0x8c'),_0x5c7e05[_0x3866('0x51')],util[_0x3866('0x45')](_0x5c7e05,{'showHidden':![],'depth':null}));if(this[_0x3866('0xf')][_0x5c7e05[_0x3866('0x51')]]){var _0x13ce14=_[_0x3866('0x83')](this[_0x3866('0xf')][_0x5c7e05[_0x3866('0x51')]]);_0x13ce14[_0x3866('0x8d')]=moment()[_0x3866('0x5a')](_0x3866('0x7c'));_0x13ce14[_0x3866('0x8e')]=_0x5c7e05[_0x3866('0x8e')];_0x13ce14[_0x3866('0x8f')]=_0x5c7e05['connectedlinename'];logger[_0x3866('0x7f')](_0x3866('0x90'),_0x13ce14['queue'],_0x13ce14[_0x3866('0x5d')],_0x5c7e05[_0x3866('0x8e')],_0x5c7e05[_0x3866('0x8f')]);this[_0x3866('0x12')][_0x5c7e05[_0x3866('0x51')]]=_0x13ce14;this[_0x3866('0x82')](_0x13ce14,_0x3866('0x1f'));}}}catch(_0x5c27cc){logger[_0x3866('0x42')](_0x3866('0x8c'),_0x5c7e05[_0x3866('0x51')],util[_0x3866('0x45')](_0x5c27cc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3866('0x48')][_0x3866('0x23')]=function(_0x5e34cf){try{if(this[_0x3866('0x61')](_0x5e34cf)){logger[_0x3866('0x4e')](_0x3866('0x91'),_0x5e34cf[_0x3866('0x51')],util[_0x3866('0x45')](_0x5e34cf,{'showHidden':![],'depth':null}));if(this[_0x3866('0xf')][_0x5e34cf['uniqueid']]){var _0x2504c8=_[_0x3866('0x83')](this[_0x3866('0xf')][_0x5e34cf[_0x3866('0x51')]]);_0x2504c8[_0x3866('0x3a')]=!![];_0x2504c8[_0x3866('0x58')]=_0x3866('0x92');logger['info'](_0x3866('0x93'),_0x2504c8[_0x3866('0x53')],_0x2504c8['type']);}}}catch(_0x416c1e){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x5e34cf['uniqueid'],util['inspect'](_0x416c1e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3866('0x48')][_0x3866('0x94')]=function(_0x50c00b){try{if(this[_0x3866('0x61')](_0x50c00b)){logger[_0x3866('0x4e')](_0x3866('0x95'),_0x50c00b[_0x3866('0x51')],util[_0x3866('0x45')](_0x50c00b,{'showHidden':![],'depth':null}));if(this[_0x3866('0xf')][_0x50c00b[_0x3866('0x51')]]){var _0x397ef6=_[_0x3866('0x83')](this[_0x3866('0xf')][_0x50c00b[_0x3866('0x51')]]);_0x397ef6[_0x3866('0x39')]=![];_0x397ef6[_0x3866('0x87')]=null;_0x397ef6[_0x3866('0x96')]=!![];_0x397ef6[_0x3866('0x89')]=_0x50c00b[_0x3866('0x97')];_0x397ef6[_0x3866('0x85')]=_0x50c00b[_0x3866('0x85')];_0x397ef6['queuecallercomplete']=!![];_0x397ef6[_0x3866('0x38')]=![];_0x397ef6['queuecallerexitAt']=null;if(!_0x397ef6[_0x3866('0x98')]){if(_0x50c00b[_0x3866('0x99')]=='transfer'){_0x397ef6[_0x3866('0x58')]='COMPLETED';logger[_0x3866('0x7f')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x397ef6[_0x3866('0x53')],_0x397ef6[_0x3866('0x5d')]);}else{if(_[_0x3866('0x9a')](_0x50c00b[_0x3866('0x3f')][_0x3866('0x9b')](),'local/')){if(this[_0x3866('0xf')][_0x50c00b['linkedid']]){var _0x305b49=_[_0x3866('0x83')](this[_0x3866('0xf')][_0x50c00b[_0x3866('0x9c')]]);_0x305b49['queuecallercomplete']=![];_0x305b49[_0x3866('0x38')]=!![];_0x305b49[_0x3866('0x9d')]=moment(_0x397ef6[_0x3866('0x9e')])['add'](_0x50c00b[_0x3866('0x85')],'seconds')[_0x3866('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x305b49[_0x3866('0x58')]='FORWARDTRANSFER';_0x305b49['transfer']=!![];_0x305b49[_0x3866('0x9f')]='FORWARD';_0x305b49['transferexten']=_0x50c00b[_0x3866('0xa0')];_0x305b49[_0x3866('0xa1')]=_0x50c00b[_0x3866('0x51')];logger[_0x3866('0x7f')](_0x3866('0xa2'),_0x305b49[_0x3866('0x53')],_0x305b49['type']);var _0x248233=this[_0x3866('0xf')][_0x50c00b[_0x3866('0x9c')]];this[_0x3866('0xf')][_0x50c00b[_0x3866('0x9c')]]=this['queueReports'][_0x50c00b[_0x3866('0x51')]];this[_0x3866('0xf')][_0x50c00b['uniqueid']]=_0x248233;}}else{_0x397ef6['queuecallerexitreason']=_0x3866('0xa3')+_0x50c00b['reason']['toUpperCase']();logger['info'](_0x3866('0xa4'),_0x397ef6[_0x3866('0x53')],_0x397ef6[_0x3866('0x5d')],_0x397ef6[_0x3866('0x58')]);}}}this[_0x3866('0x12')][_0x50c00b[_0x3866('0x51')]]=_0x397ef6;}}}catch(_0x37ee40){logger['error'](_0x3866('0x95'),_0x50c00b['uniqueid'],util['inspect'](_0x37ee40,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3866('0x48')][_0x3866('0x25')]=function(_0x12b19e){try{if(this[_0x3866('0x61')](_0x12b19e)){logger[_0x3866('0x4e')]('[%s][voiceQueueReport][varset]',_0x12b19e['uniqueid'],util[_0x3866('0x45')](_0x12b19e,{'showHidden':![],'depth':null}));this['addVariable'](_0x12b19e[_0x3866('0x51')],_[_0x3866('0x81')](_0x12b19e[_0x3866('0xa5')])[0x0],_0x12b19e['value']);if(this[_0x3866('0xf')][_0x12b19e[_0x3866('0x51')]]){var _0x59adc0=_[_0x3866('0x83')](this[_0x3866('0xf')][_0x12b19e[_0x3866('0x51')]]);if(_0x59adc0){if(this[_0x3866('0x61')](_0x12b19e['variable'])&&this[_0x3866('0x61')](_0x12b19e[_0x3866('0xa5')][_0x3866('0x68')])){switch(_0x12b19e[_0x3866('0xa6')]){case _0x3866('0xa7'):_0x59adc0[_0x3866('0x38')]=![];_0x59adc0[_0x3866('0x9d')]=null;break;case _0x3866('0xa8'):_0x59adc0[_0x3866('0xa9')]=_0x3866('0xaa');_0x59adc0[_0x3866('0x38')]=!![];_0x59adc0[_0x3866('0x9d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x59adc0['queuecallerleaveAt']=moment()[_0x3866('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0x3866('0xab'),_0x12b19e['uniqueid'],util[_0x3866('0x45')](_0x59adc0,{'showHidden':![],'depth':null}));ami[_0x3866('0x4d')](_0x3866('0xac'),_0x59adc0);break;default:_0x59adc0[_0x3866('0x38')]=!![];_0x59adc0['queuecallerexitAt']=moment()[_0x3866('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x59adc0[_0x3866('0x8d')]=moment()[_0x3866('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');}_0x59adc0[_0x3866('0x39')]=![];_0x59adc0[_0x3866('0x87')]=null;_0x59adc0['queuecallerexitreason']=_0x12b19e[_0x3866('0xa6')];this[_0x3866('0x12')][_0x12b19e[_0x3866('0x51')]]=_0x59adc0;this[_0x3866('0x56')](_0x59adc0,_0x3866('0x24'));}else if(this[_0x3866('0x61')](_0x12b19e[_0x3866('0xa5')])&&this[_0x3866('0x61')](_0x12b19e[_0x3866('0xa5')][_0x3866('0xad')])){if(!_0x59adc0[_0x3866('0x39')]){_0x59adc0[_0x3866('0x38')]=!![];_0x59adc0[_0x3866('0x9d')]=moment()[_0x3866('0x5a')](_0x3866('0x7c'));_0x59adc0[_0x3866('0x58')]=_0x3866('0xae');_0x59adc0[_0x3866('0x8d')]=moment()[_0x3866('0x5a')](_0x3866('0x7c'));this['channels'][_0x12b19e[_0x3866('0x51')]]=_0x59adc0;}}logger[_0x3866('0x7f')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x12b19e[_0x3866('0x51')],_0x59adc0[_0x3866('0x53')],_0x59adc0[_0x3866('0x5d')],_[_0x3866('0x81')](_0x12b19e[_0x3866('0xa5')])[0x0],_0x12b19e[_0x3866('0xa6')]);_0x59adc0[_0x3866('0x46')]=this[_0x3866('0x46')][_0x12b19e['uniqueid']];}}}}catch(_0x401d71){logger[_0x3866('0x42')]('[%s][voiceQueueReport][varset]',_0x12b19e[_0x3866('0x51')],util['inspect'](_0x401d71,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3866('0x48')]['addVariable']=function(_0x30445c,_0x20aa0b,_0x5bcdd3){var _0x126c50=[_0x3866('0xaf'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x3866('0xb0'),_0x3866('0xb1'),'rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged',_0x3866('0xb2'),_0x3866('0xb3'),_0x3866('0xb4'),'bridgepvtcallid','membercalls',_0x3866('0xb5'),_0x3866('0xb6'),_0x3866('0xb7'),_0x3866('0x97'),_0x3866('0xb8'),'memberrealtime'];if(!_[_0x3866('0x3c')](_0x20aa0b)&&!_[_0x3866('0xb9')](_0x126c50,_0x20aa0b)){if(_[_0x3866('0x7b')](this[_0x3866('0x46')][_0x30445c])){this['variables'][_0x30445c]={};}this[_0x3866('0x46')][_0x30445c][_0x20aa0b]=_0x5bcdd3;}};VoiceQueueReport[_0x3866('0x48')]['handleHangup']=function(_0x32db5b,_0x3c267a,_0x4ed69f){try{var _0xd6b688={};if(this['queueReports'][_0x32db5b]){for(var _0x1ebeb8=0x0;_0x1ebeb8=0x0?moment(_0x4dc2aa['endtime'])[_0xfff3('0xb')](_0x4dc2aa[_0xfff3('0x19')],_0xfff3('0xd')):null,'data1':_0xfff3('0x1a'),'data2':_0x4dc2aa['accountcode'],'data3':_0x4dc2aa['exten'],'data4':_0x4dc2aa['dialstring']||null,'role':_0xfff3('0x12'),'internal':_0x4dc2aa['accountcode']?_[_0xfff3('0x14')](_0x4dc2aa[_0xfff3('0x13')]):undefined,'uniqueid':_0x4dc2aa[_0xfff3('0x1b')]},'log':_0xfff3('0x5')});}; \ No newline at end of file +var _0x0535=['voice','lastAssignedTo','isNil','interface','SIP/%s','TALKING','queuecallerleaveAt','seconds','calleridnum','exten','queue','agent','accountcode','uniqueid','CreateMemberReport','membername','starttime','endtime','diff','outbound','dialstring','toNumber','moment','lodash','util','voiceQueueReport','queuecallerexitAt','Request'];(function(_0x1acc19,_0x250a98){var _0x553cc5=function(_0x43aeea){while(--_0x43aeea){_0x1acc19['push'](_0x1acc19['shift']());}};_0x553cc5(++_0x250a98);}(_0x0535,0x86));var _0x5053=function(_0x5be453,_0x3276e0){_0x5be453=_0x5be453-0x0;var _0x55d2b8=_0x0535[_0x5be453];return _0x55d2b8;};'use strict';var moment=require(_0x5053('0x0'));var _=require(_0x5053('0x1'));var util=require(_0x5053('0x2'));var client=require('../client');exports[_0x5053('0x3')]=function(_0x557cce){var _0x1b33ac=_0x557cce['queuecallercompleteAt']||_0x557cce[_0x5053('0x4')];return client[_0x5053('0x5')]('CreateMemberReport',{'body':{'channel':_0x5053('0x6'),'membername':_0x557cce[_0x5053('0x7')],'interface':_[_0x5053('0x8')](_0x557cce[_0x5053('0x9')])?util['format'](_0x5053('0xa'),_0x557cce[_0x5053('0x7')]):_0x557cce[_0x5053('0x9')],'type':_0x5053('0xb'),'enterAt':_0x557cce[_0x5053('0xc')],'exitAt':_0x1b33ac,'duration':moment(_0x1b33ac)['diff'](_0x557cce[_0x5053('0xc')],_0x5053('0xd')),'data1':'inbound','data2':_0x557cce[_0x5053('0xe')],'data3':_0x557cce[_0x5053('0xf')],'data4':null,'data5':_0x557cce[_0x5053('0x10')],'role':_0x5053('0x11'),'internal':_0x557cce[_0x5053('0x12')]?_['toNumber'](_0x557cce[_0x5053('0x12')]):undefined,'uniqueid':_0x557cce[_0x5053('0x13')]},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x4a8e0a){return client['Request'](_0x5053('0x14'),{'body':{'channel':_0x5053('0x6'),'membername':_0x4a8e0a[_0x5053('0x15')],'interface':_0x4a8e0a[_0x5053('0x9')],'type':_0x5053('0xb'),'enterAt':_0x4a8e0a[_0x5053('0x16')],'exitAt':_0x4a8e0a[_0x5053('0x17')],'duration':moment(_0x4a8e0a['endtime'])[_0x5053('0x18')](_0x4a8e0a[_0x5053('0x16')],'seconds')>=0x0?moment(_0x4a8e0a[_0x5053('0x17')])[_0x5053('0x18')](_0x4a8e0a[_0x5053('0x16')],'seconds'):null,'data1':_0x5053('0x19'),'data2':_0x4a8e0a[_0x5053('0x12')],'data3':_0x4a8e0a[_0x5053('0xf')],'data4':_0x4a8e0a[_0x5053('0x1a')]||null,'role':_0x5053('0x11'),'internal':_0x4a8e0a[_0x5053('0x12')]?_[_0x5053('0x1b')](_0x4a8e0a['accountcode']):undefined,'uniqueid':_0x4a8e0a[_0x5053('0x13')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index f88e767..179e3f8 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 _0x69d3=['Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','../client','getSettings'];(function(_0x562d84,_0x1759c2){var _0x28b33d=function(_0x42872d){while(--_0x42872d){_0x562d84['push'](_0x562d84['shift']());}};_0x28b33d(++_0x1759c2);}(_0x69d3,0xda));var _0x369d=function(_0x3c1ca2,_0x56dc2c){_0x3c1ca2=_0x3c1ca2-0x0;var _0x534caf=_0x69d3[_0x3c1ca2];return _0x534caf;};'use strict';var client=require(_0x369d('0x0'));exports[_0x369d('0x1')]=function(){return client[_0x369d('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x369d('0x3'),_0x369d('0x4')]},'log':'GetSettings'});}; \ No newline at end of file +var _0xa195=['getSettings','ShowSetting','stopRecordingOnTransfer','GetSettings','../client'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0xa195,0x1b2));var _0x5a19=function(_0x3fd0c2,_0x20d1e3){_0x3fd0c2=_0x3fd0c2-0x0;var _0xf9aaa1=_0xa195[_0x3fd0c2];return _0xf9aaa1;};'use strict';var client=require(_0x5a19('0x0'));exports[_0x5a19('0x1')]=function(){return client['Request'](_0x5a19('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5a19('0x3'),'previewRecallmeReminderInterval']},'log':_0x5a19('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index abdce7e..288d7a8 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 _0x560e=['html','getTemplates','GetTemplate','name'];(function(_0xa1b26f,_0x59a9de){var _0x2a5c3b=function(_0x26af7d){while(--_0x26af7d){_0xa1b26f['push'](_0xa1b26f['shift']());}};_0x2a5c3b(++_0x59a9de);}(_0x560e,0x141));var _0xe560=function(_0x438487,_0x41f017){_0x438487=_0x438487-0x0;var _0x4900ce=_0x560e[_0x438487];return _0x4900ce;};'use strict';var client=require('../client');exports[_0xe560('0x0')]=function(_0x14d043){return function(_0x549481){return client['Request'](_0xe560('0x1'),{'options':{'raw':!![],'attributes':['id',_0xe560('0x2'),_0xe560('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x5418=['getTemplates','Request','html','../client'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x5418,0xc7));var _0x8541=function(_0xbe9500,_0x1329aa){_0xbe9500=_0xbe9500-0x0;var _0x5c913c=_0x5418[_0xbe9500];return _0x5c913c;};'use strict';var client=require(_0x8541('0x0'));exports[_0x8541('0x1')]=function(_0x3c7034){return function(_0x4188d6){return client[_0x8541('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id','name',_0x8541('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 8b1bf87..eea9069 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 _0x7838=['GetTrigger','name','channel','AllConditions','field','value','AnyConditions','operator','Action','action','data1','data3','data4','data5','data6','data7','../client','getTriggers','Request'];(function(_0x184cc6,_0x4961ee){var _0x3f7435=function(_0x448fed){while(--_0x448fed){_0x184cc6['push'](_0x184cc6['shift']());}};_0x3f7435(++_0x4961ee);}(_0x7838,0x107));var _0x8783=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x7838[_0x521929];return _0x632436;};'use strict';var client=require(_0x8783('0x0'));exports[_0x8783('0x1')]=function(_0x2ed38d){return function(_0x1b321e){return client[_0x8783('0x2')](_0x8783('0x3'),{'options':{'raw':![],'attributes':['id',_0x8783('0x4'),_0x8783('0x5'),'status'],'include':[{'model':'Condition','as':_0x8783('0x6'),'attributes':['id',_0x8783('0x7'),'operator',_0x8783('0x8')]},{'model':'Condition','as':_0x8783('0x9'),'attributes':['id',_0x8783('0x7'),_0x8783('0xa'),_0x8783('0x8')]},{'model':_0x8783('0xb'),'as':'Actions','attributes':['id',_0x8783('0xc'),_0x8783('0xd'),'data2',_0x8783('0xe'),_0x8783('0xf'),_0x8783('0x10'),_0x8783('0x11'),_0x8783('0x12')]}]},'log':_0x8783('0x3')});};}; \ No newline at end of file +var _0xddcd=['data6','getTriggers','GetTrigger','channel','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data1','data2','data4','data5'];(function(_0x26a4ea,_0xa72fb8){var _0x1b669e=function(_0x4e8bba){while(--_0x4e8bba){_0x26a4ea['push'](_0x26a4ea['shift']());}};_0x1b669e(++_0xa72fb8);}(_0xddcd,0xde));var _0xdddc=function(_0x46f448,_0x36d0b8){_0x46f448=_0x46f448-0x0;var _0x413c11=_0xddcd[_0x46f448];return _0x413c11;};'use strict';var client=require('../client');exports[_0xdddc('0x0')]=function(_0xad11cf){return function(_0x2e6675){return client['Request'](_0xdddc('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xdddc('0x2'),'status'],'include':[{'model':_0xdddc('0x3'),'as':_0xdddc('0x4'),'attributes':['id',_0xdddc('0x5'),_0xdddc('0x6'),_0xdddc('0x7')]},{'model':_0xdddc('0x3'),'as':_0xdddc('0x8'),'attributes':['id',_0xdddc('0x5'),_0xdddc('0x6'),_0xdddc('0x7')]},{'model':_0xdddc('0x9'),'as':_0xdddc('0xa'),'attributes':['id',_0xdddc('0xb'),_0xdddc('0xc'),_0xdddc('0xd'),'data3',_0xdddc('0xe'),_0xdddc('0xf'),_0xdddc('0x10'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index c5bc2e5..561e9b9 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 _0x871b=['defaultuser','../client','getTrunks','GetTrunk','registry'];(function(_0x2d8667,_0x3a4ac6){var _0x2b6069=function(_0x166d2b){while(--_0x166d2b){_0x2d8667['push'](_0x2d8667['shift']());}};_0x2b6069(++_0x3a4ac6);}(_0x871b,0xe7));var _0xb871=function(_0x5b1e02,_0x229964){_0x5b1e02=_0x5b1e02-0x0;var _0x345810=_0x871b[_0x5b1e02];return _0x345810;};'use strict';var client=require(_0xb871('0x0'));exports[_0xb871('0x1')]=function(_0x642eb8){return function(_0x6b3e6){return client['Request'](_0xb871('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xb871('0x3'),_0xb871('0x4')]},'log':_0xb871('0x2')});};}; \ No newline at end of file +var _0xc4b6=['getTrunks','Request','name','registry','defaultuser'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0xc4b6,0x1b8));var _0x6c4b=function(_0x33b851,_0x11a9f0){_0x33b851=_0x33b851-0x0;var _0x3f9e27=_0xc4b6[_0x33b851];return _0x3f9e27;};'use strict';var client=require('../client');exports[_0x6c4b('0x0')]=function(_0x4404c6){return function(_0x4119ba){return client[_0x6c4b('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x6c4b('0x2'),_0x6c4b('0x3'),_0x6c4b('0x4')]},'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 724b15c..e2715b6 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 _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x1ad46d,_0x1dc3c5){var _0x3e90a1=function(_0x121f5f){while(--_0x121f5f){_0x1ad46d['push'](_0x1ad46d['shift']());}};_0x3e90a1(++_0x1dc3c5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 cd9772a..327eea2 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 _0xf98e=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x820b89,_0x364baa){var _0x2e32dc=function(_0x22353d){while(--_0x22353d){_0x820b89['push'](_0x820b89['shift']());}};_0x2e32dc(++_0x364baa);}(_0xf98e,0x19a));var _0xef98=function(_0x11f373,_0x200696){_0x11f373=_0x11f373-0x0;var _0xec7711=_0xf98e[_0x11f373];return _0xec7711;};'use strict';var client=require('../client');exports[_0xef98('0x0')]=function(_0x1108f3){return client[_0xef98('0x1')](_0xef98('0x2'),{'body':_0x1108f3,'log':'CreateVoiceAgentReport'});};exports[_0xef98('0x3')]=function(_0x1f9b0c,_0x207ddd,_0x35a4d9){return client[_0xef98('0x1')]('UpdateVoiceAgentReport',{'body':_0x1f9b0c,'options':{'where':{'uniqueid':_0x207ddd,'interface':_0x35a4d9,'agentcomplete':!![]}},'log':_0xef98('0x4')});}; \ No newline at end of file +var _0x4bfa=['update','Request','UpdateVoiceAgentReport','CreateVoiceAgentReport'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4bfa,0x157));var _0xa4bf=function(_0x2ea20d,_0x5e8e3c){_0x2ea20d=_0x2ea20d-0x0;var _0x3ba66a=_0x4bfa[_0x2ea20d];return _0x3ba66a;};'use strict';var client=require('../client');exports['create']=function(_0x5a22f2){return client['Request'](_0xa4bf('0x0'),{'body':_0x5a22f2,'log':_0xa4bf('0x0')});};exports[_0xa4bf('0x1')]=function(_0x3011a8,_0x5e47e8,_0x55c5b6){return client[_0xa4bf('0x2')](_0xa4bf('0x3'),{'body':_0x3011a8,'options':{'where':{'uniqueid':_0x5e47e8,'interface':_0x55c5b6,'agentcomplete':!![]}},'log':_0xa4bf('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 16d6dc8..d6b839a 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 _0x8718=['lodash','../client','create','CreateVoiceCallReport','merge','calleridnum','getVoiceCallReports','Request','GetVoiceCallReport','outbound','day','endOf','format','duration','billableseconds','moment','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8718,0x130));var _0x8871=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8718[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0x8871('0x0'));var util=require(_0x8871('0x1'));var _=require(_0x8871('0x2'));var client=require(_0x8871('0x3'));exports[_0x8871('0x4')]=function(_0x4b1583){return client['Request'](_0x8871('0x5'),{'body':_[_0x8871('0x6')](_0x4b1583,{'source':_0x4b1583[_0x8871('0x7')],'destinationcontext':_0x4b1583['context'],'callerid':_0x4b1583['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x8871('0x5')});};exports[_0x8871('0x8')]=function(){return function(){return client[_0x8871('0x9')](_0x8871('0xa'),{'options':{'where':{'type':[_0x8871('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x8871('0xc'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x8871('0xd')](_0x8871('0xc'))[_0x8871('0xe')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0x8871('0xf'),_0x8871('0x10')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xecc7=['calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','moment','util','lodash','create','Request','CreateVoiceCallReport','merge'];(function(_0x7f5123,_0x3062c5){var _0x10a02a=function(_0x48d0c9){while(--_0x48d0c9){_0x7f5123['push'](_0x7f5123['shift']());}};_0x10a02a(++_0x3062c5);}(_0xecc7,0xd5));var _0x7ecc=function(_0x32ed80,_0x3db315){_0x32ed80=_0x32ed80-0x0;var _0x212659=_0xecc7[_0x32ed80];return _0x212659;};'use strict';var moment=require(_0x7ecc('0x0'));var util=require(_0x7ecc('0x1'));var _=require(_0x7ecc('0x2'));var client=require('../client');exports[_0x7ecc('0x3')]=function(_0x1dc5a6){return client[_0x7ecc('0x4')](_0x7ecc('0x5'),{'body':_[_0x7ecc('0x6')](_0x1dc5a6,{'source':_0x1dc5a6[_0x7ecc('0x7')],'destinationcontext':_0x1dc5a6[_0x7ecc('0x8')],'callerid':_0x1dc5a6[_0x7ecc('0x9')],'amaflags':_0x7ecc('0xa')}),'log':_0x7ecc('0x5')});};exports[_0x7ecc('0xb')]=function(){return function(){return client[_0x7ecc('0x4')](_0x7ecc('0xc'),{'options':{'where':{'type':[_0x7ecc('0xd')],'createdAt':{'$between':[moment()[_0x7ecc('0xe')](_0x7ecc('0xf'))[_0x7ecc('0x10')](_0x7ecc('0x11')),moment()['endOf'](_0x7ecc('0xf'))['format'](_0x7ecc('0x11'))]}},'attributes':[_0x7ecc('0x12'),_0x7ecc('0x13'),_0x7ecc('0x14'),_0x7ecc('0x15')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 9bbde29..959ec5b 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 _0xe836=['../client','create','CreateVoiceDialReport'];(function(_0x190dda,_0x459b67){var _0x4e9f94=function(_0x122beb){while(--_0x122beb){_0x190dda['push'](_0x190dda['shift']());}};_0x4e9f94(++_0x459b67);}(_0xe836,0x162));var _0x6e83=function(_0x2a132a,_0x47c7d1){_0x2a132a=_0x2a132a-0x0;var _0x17957a=_0xe836[_0x2a132a];return _0x17957a;};'use strict';var client=require(_0x6e83('0x0'));exports[_0x6e83('0x1')]=function(_0x26b17b){return client['Request'](_0x6e83('0x2'),{'body':_0x26b17b,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x4d60=['Request','CreateVoiceDialReport','../client'];(function(_0x2bc1d3,_0x5c217e){var _0xb2f1c7=function(_0x4d61c8){while(--_0x4d61c8){_0x2bc1d3['push'](_0x2bc1d3['shift']());}};_0xb2f1c7(++_0x5c217e);}(_0x4d60,0x71));var _0x04d6=function(_0x36b09c,_0x17cc22){_0x36b09c=_0x36b09c-0x0;var _0xf7ad60=_0x4d60[_0x36b09c];return _0xf7ad60;};'use strict';var client=require(_0x04d6('0x0'));exports['create']=function(_0x55e4b4){return client[_0x04d6('0x1')](_0x04d6('0x2'),{'body':_0x55e4b4,'log':_0x04d6('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 50d8f0d..10a8dec 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 _0x3df4=['exten','recordingFormat','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x565ddf,_0x1ff463){var _0x2f1ac2=function(_0x485f0b){while(--_0x485f0b){_0x565ddf['push'](_0x565ddf['shift']());}};_0x2f1ac2(++_0x1ff463);}(_0x3df4,0x102));var _0x43df=function(_0x56893a,_0x57934b){_0x56893a=_0x56893a-0x0;var _0x234e33=_0x3df4[_0x56893a];return _0x234e33;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x43df('0x0')](_0x43df('0x1'),{'options':{'raw':!![],'attributes':['id',_0x43df('0x2'),_0x43df('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x43df('0x4')});};}; \ No newline at end of file +var _0x0e35=['exten','recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x1837ef,_0x310923){var _0x439631=function(_0xa52393){while(--_0xa52393){_0x1837ef['push'](_0x1837ef['shift']());}};_0x439631(++_0x310923);}(_0x0e35,0xc2));var _0x50e3=function(_0x3e247e,_0x4d9e5f){_0x3e247e=_0x3e247e-0x0;var _0xbdf3b7=_0x0e35[_0x3e247e];return _0xbdf3b7;};'use strict';var client=require(_0x50e3('0x0'));exports[_0x50e3('0x1')]=function(){return function(){return client[_0x50e3('0x2')](_0x50e3('0x3'),{'options':{'raw':!![],'attributes':['id',_0x50e3('0x4'),_0x50e3('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x50e3('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 1dd486c..1bcf203 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 _0x0191=['dialPreviewAutoRecallMe','Trunk','active','Pause','name','TrunkBackup','callerid','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold'];(function(_0x1ff575,_0xdba21f){var _0x48fc9e=function(_0x51cf97){while(--_0x51cf97){_0x1ff575['push'](_0x1ff575['shift']());}};_0x48fc9e(++_0xdba21f);}(_0x0191,0x144));var _0x1019=function(_0x2f7d18,_0x44bea6){_0x2f7d18=_0x2f7d18-0x0;var _0x425175=_0x0191[_0x2f7d18];return _0x425175;};'use strict';var client=require(_0x1019('0x0'));exports[_0x1019('0x1')]=function(){return function(){return client[_0x1019('0x2')](_0x1019('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x1019('0x4'),_0x1019('0x5'),_0x1019('0x6'),_0x1019('0x7'),_0x1019('0x8'),_0x1019('0x9'),_0x1019('0xa'),_0x1019('0xb'),'dialLimitQueue',_0x1019('0xc'),'dialPredictiveOptimization',_0x1019('0xd'),_0x1019('0xe'),_0x1019('0xf'),_0x1019('0x10'),'dialOriginateTimeout',_0x1019('0x11'),_0x1019('0x12'),_0x1019('0x13'),_0x1019('0x14'),_0x1019('0x15'),_0x1019('0x16'),'dialBusyRetryFrequency',_0x1019('0x17'),_0x1019('0x18'),_0x1019('0x19'),_0x1019('0x1a'),_0x1019('0x1b'),_0x1019('0x1c'),_0x1019('0x1d'),_0x1019('0x1e'),_0x1019('0x1f'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0x1019('0x20'),'dialAMDMinWordLength',_0x1019('0x21'),_0x1019('0x22'),_0x1019('0x23'),'dialAMDMaximumWordLength',_0x1019('0x24'),_0x1019('0x25'),'dialRecallInQueue','dialOrderByScheduledAt',_0x1019('0x26'),_0x1019('0x27'),_0x1019('0x28'),_0x1019('0x7'),_0x1019('0x29'),_0x1019('0x2a'),'dialCutDigit',_0x1019('0x2b'),'dialNoSuchNumberRetryFrequency',_0x1019('0x2c'),_0x1019('0x2d'),'dialAbandonedMaxRetry',_0x1019('0x2e'),_0x1019('0x2f'),_0x1019('0x30'),_0x1019('0x31'),_0x1019('0x32'),_0x1019('0x33'),_0x1019('0x34'),_0x1019('0x35'),_0x1019('0x36'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x1019('0x37'),'as':_0x1019('0x37'),'attributes':['id','name','callerid',_0x1019('0x38')]},{'model':_0x1019('0x39'),'as':'mandatoryDispositionPause','attributes':['id',_0x1019('0x3a')]},{'model':'Trunk','as':_0x1019('0x3b'),'attributes':['id',_0x1019('0x3a'),_0x1019('0x3c'),_0x1019('0x38')]},{'model':_0x1019('0x3d'),'as':'Interval','attributes':['id',_0x1019('0x3a')],'include':[{'model':_0x1019('0x3d'),'as':'Intervals','attributes':['id',_0x1019('0x3a'),_0x1019('0x3e')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x6a31=['callerid','active','Pause','Interval','interval','getVoiceQueues','../client','Request','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','name'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6a31,0xce));var _0x16a3=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x6a31[_0x3c8e9a];return _0x2d4c57;};'use strict';var client=require(_0x16a3('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x16a3('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name',_0x16a3('0x2'),_0x16a3('0x3'),'autopause',_0x16a3('0x4'),_0x16a3('0x5'),_0x16a3('0x6'),_0x16a3('0x7'),'dialLimitChannel',_0x16a3('0x8'),_0x16a3('0x9'),_0x16a3('0xa'),'dialPredictiveOptimizationPercentage',_0x16a3('0xb'),_0x16a3('0xc'),_0x16a3('0xd'),'dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject',_0x16a3('0xe'),'dialCongestionRetryFrequency',_0x16a3('0xf'),'dialBusyRetryFrequency',_0x16a3('0x10'),_0x16a3('0x11'),_0x16a3('0x12'),'dialTimezone',_0x16a3('0x13'),_0x16a3('0x14'),_0x16a3('0x15'),_0x16a3('0x16'),'dialAMDInitialSilence','dialAMDGreeting',_0x16a3('0x17'),_0x16a3('0x18'),'dialAMDMinWordLength',_0x16a3('0x19'),_0x16a3('0x1a'),_0x16a3('0x1b'),'dialAMDMaximumWordLength',_0x16a3('0x1c'),_0x16a3('0x1d'),'dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2',_0x16a3('0x4'),_0x16a3('0x1e'),'dialRandomLastDigitCallerIdNumber',_0x16a3('0x1f'),_0x16a3('0x20'),_0x16a3('0x21'),'dialDropMaxRetry',_0x16a3('0x22'),_0x16a3('0x23'),'dialAbandonedRetryFrequency','dialMachineMaxRetry',_0x16a3('0x24'),'dialAgentRejectMaxRetry',_0x16a3('0x25'),_0x16a3('0x26'),_0x16a3('0x27'),_0x16a3('0x28'),'dialPreviewAutoRecallMe',_0x16a3('0x29')],'include':[{'model':_0x16a3('0x2a'),'as':_0x16a3('0x2a'),'attributes':['id',_0x16a3('0x2b'),_0x16a3('0x2c'),_0x16a3('0x2d')]},{'model':_0x16a3('0x2e'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0x16a3('0x2a'),'as':'TrunkBackup','attributes':['id',_0x16a3('0x2b'),_0x16a3('0x2c'),_0x16a3('0x2d')]},{'model':_0x16a3('0x2f'),'as':'Interval','attributes':['id',_0x16a3('0x2b')],'include':[{'model':_0x16a3('0x2f'),'as':'Intervals','attributes':['id','name',_0x16a3('0x30')]}]}]},'log':_0x16a3('0x31')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 174578e..b36bc29 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(_0xd75b2,_0x23533b){var _0x2e0d82=function(_0x303abf){while(--_0x303abf){_0xd75b2['push'](_0xd75b2['shift']());}};_0x2e0d82(++_0x23533b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +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(_0x26e99f,_0x4fc8e2){var _0x40e139=function(_0x336841){while(--_0x336841){_0x26e99f['push'](_0x26e99f['shift']());}};_0x40e139(++_0x4fc8e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 a5187d6..cbfe40e 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 _0xb67e=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0xb67e,0xb7));var _0xeb67=function(_0x54d71b,_0x2edf62){_0x54d71b=_0x54d71b-0x0;var _0x4b9249=_0xb67e[_0x54d71b];return _0x4b9249;};'use strict';var client=require(_0xeb67('0x0'));exports[_0xeb67('0x1')]=function(_0x4a3942){return function(){return client[_0xeb67('0x2')](_0xeb67('0x3'),{'options':{'where':{'VoiceQueueId':_0x4a3942,'paused':!![]},'raw':!![]},'log':_0xeb67('0x1')});};}; \ No newline at end of file +var _0x433b=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x3835ac,_0x17f2b4){var _0x5876fd=function(_0x49c5d7){while(--_0x49c5d7){_0x3835ac['push'](_0x3835ac['shift']());}};_0x5876fd(++_0x17f2b4);}(_0x433b,0x104));var _0xb433=function(_0x36ae06,_0x57da2d){_0x36ae06=_0x36ae06-0x0;var _0x25ffc7=_0x433b[_0x36ae06];return _0x25ffc7;};'use strict';var client=require(_0xb433('0x0'));exports[_0xb433('0x1')]=function(_0x321572){return function(){return client[_0xb433('0x2')](_0xb433('0x3'),{'options':{'where':{'VoiceQueueId':_0x321572,'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 d886e39..d5f8640 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(_0x1ca313,_0x8ec7e1){var _0x163831=function(_0x3f35d0){while(--_0x3f35d0){_0x1ca313['push'](_0x1ca313['shift']());}};_0x163831(++_0x8ec7e1);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x56e477,_0xd55f56){var _0x515759=function(_0x505a66){while(--_0x505a66){_0x56e477['push'](_0x56e477['shift']());}};_0x515759(++_0xd55f56);}(_0x7a54,0x106));var _0x47a5=function(_0x3637ea,_0x836d2b){_0x3637ea=_0x3637ea-0x0;var _0xc12617=_0x7a54[_0x3637ea];return _0xc12617;};'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 26e4903..a637e88 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 _0x40fc=['Request','CreateVoiceTransferReport','result','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer'];(function(_0x2067c1,_0x4ad413){var _0x4c2968=function(_0x51df02){while(--_0x51df02){_0x2067c1['push'](_0x2067c1['shift']());}};_0x4c2968(++_0x4ad413);}(_0x40fc,0x1da));var _0xc40f=function(_0x354404,_0x141542){_0x354404=_0x354404-0x0;var _0x1c10f8=_0x40fc[_0x354404];return _0x1c10f8;};'use strict';var client=require('../client');exports[_0xc40f('0x0')]={};exports[_0xc40f('0x1')]=function(_0x400377){return client[_0xc40f('0x2')](_0xc40f('0x3'),{'body':{'result':_0x400377[_0xc40f('0x4')],'transfererchannel':_0x400377[_0xc40f('0x5')],'transferercalleridnum':_0x400377['transferercalleridnum'],'transferercalleridname':_0x400377['transferercalleridname'],'transfererconnectedlinenum':_0x400377[_0xc40f('0x6')],'transfererconnectedlinename':_0x400377[_0xc40f('0x7')],'transfereraccountcode':_0x400377[_0xc40f('0x8')],'transferercontext':_0x400377[_0xc40f('0x9')],'transfererexten':_0x400377['transfererexten'],'transfererlinkedid':_0x400377[_0xc40f('0xa')],'transfereechannel':_0x400377[_0xc40f('0xb')],'transfereecalleridnum':_0x400377['transfereecalleridnum'],'transfereecalleridname':_0x400377[_0xc40f('0xc')],'transfereeconnectedlinenum':_0x400377['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x400377['transfereeconnectedlinename'],'transfereeaccountcode':_0x400377[_0xc40f('0xd')],'transfereecontext':_0x400377[_0xc40f('0xe')],'transfereeexten':_0x400377[_0xc40f('0xf')],'transfereelinkedid':_0x400377['transfereelinkedid'],'isexternal':_0x400377[_0xc40f('0x10')],'context':_0x400377[_0xc40f('0x11')],'extension':_0x400377[_0xc40f('0x12')],'type':_0xc40f('0x13')},'log':_0xc40f('0x3')});};exports[_0xc40f('0x14')]=function(_0x427d9c){return client['Request'](_0xc40f('0x3'),{'body':{'result':_0x427d9c[_0xc40f('0x4')],'transfererchannel':_0x427d9c[_0xc40f('0x15')],'transferercalleridnum':_0x427d9c['origtransferercalleridnum'],'transferercalleridname':_0x427d9c[_0xc40f('0x16')],'transfererconnectedlinenum':_0x427d9c[_0xc40f('0x17')],'transfererconnectedlinename':_0x427d9c[_0xc40f('0x18')],'transfereraccountcode':_0x427d9c['origtransfereraccountcode'],'transferercontext':_0x427d9c['secondtransferercontext'],'transfererexten':_0x427d9c[_0xc40f('0x19')],'transfererlinkedid':_0x427d9c[_0xc40f('0x1a')],'transfereechannel':_0x427d9c['transfertargetchannel'],'transfereecalleridnum':_0x427d9c['transfertargetcalleridnum'],'transfereecalleridname':_0x427d9c[_0xc40f('0x1b')],'transfereeconnectedlinenum':_0x427d9c['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x427d9c[_0xc40f('0x1c')],'transfereeaccountcode':_0x427d9c[_0xc40f('0x1d')],'transfereecontext':_0x427d9c[_0xc40f('0x1e')],'transfereeexten':_0x427d9c['transfertargetexten'],'transfereelinkedid':_0x427d9c['transfertargetlinkedid'],'isexternal':_0x427d9c['isexternal'],'context':_0x427d9c[_0xc40f('0x1f')],'extension':_0x427d9c[_0xc40f('0x20')],'type':_0xc40f('0x21')},'log':_0xc40f('0x3')});}; \ No newline at end of file +var _0xbde7=['Request','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','extension','attendedTransfer'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0xbde7,0x92));var _0x7bde=function(_0x5d0557,_0x4720b1){_0x5d0557=_0x5d0557-0x0;var _0x4e6c53=_0xbde7[_0x5d0557];return _0x4e6c53;};'use strict';var client=require('../client');exports[_0x7bde('0x0')]={};exports[_0x7bde('0x1')]=function(_0x1f874e){return client['Request'](_0x7bde('0x2'),{'body':{'result':_0x1f874e[_0x7bde('0x3')],'transfererchannel':_0x1f874e[_0x7bde('0x4')],'transferercalleridnum':_0x1f874e['transferercalleridnum'],'transferercalleridname':_0x1f874e[_0x7bde('0x5')],'transfererconnectedlinenum':_0x1f874e['transfererconnectedlinenum'],'transfererconnectedlinename':_0x1f874e[_0x7bde('0x6')],'transfereraccountcode':_0x1f874e[_0x7bde('0x7')],'transferercontext':_0x1f874e[_0x7bde('0x8')],'transfererexten':_0x1f874e['transfererexten'],'transfererlinkedid':_0x1f874e[_0x7bde('0x9')],'transfereechannel':_0x1f874e['transfereechannel'],'transfereecalleridnum':_0x1f874e[_0x7bde('0xa')],'transfereecalleridname':_0x1f874e[_0x7bde('0xb')],'transfereeconnectedlinenum':_0x1f874e[_0x7bde('0xc')],'transfereeconnectedlinename':_0x1f874e['transfereeconnectedlinename'],'transfereeaccountcode':_0x1f874e[_0x7bde('0xd')],'transfereecontext':_0x1f874e[_0x7bde('0xe')],'transfereeexten':_0x1f874e['transfereeexten'],'transfereelinkedid':_0x1f874e[_0x7bde('0xf')],'isexternal':_0x1f874e[_0x7bde('0x10')],'context':_0x1f874e['context'],'extension':_0x1f874e[_0x7bde('0x11')],'type':'blind'},'log':_0x7bde('0x2')});};exports[_0x7bde('0x12')]=function(_0x1f2a14){return client[_0x7bde('0x13')](_0x7bde('0x2'),{'body':{'result':_0x1f2a14[_0x7bde('0x3')],'transfererchannel':_0x1f2a14[_0x7bde('0x14')],'transferercalleridnum':_0x1f2a14['origtransferercalleridnum'],'transferercalleridname':_0x1f2a14[_0x7bde('0x15')],'transfererconnectedlinenum':_0x1f2a14[_0x7bde('0x16')],'transfererconnectedlinename':_0x1f2a14['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1f2a14[_0x7bde('0x17')],'transferercontext':_0x1f2a14[_0x7bde('0x18')],'transfererexten':_0x1f2a14[_0x7bde('0x19')],'transfererlinkedid':_0x1f2a14['origtransfererlinkedid'],'transfereechannel':_0x1f2a14['transfertargetchannel'],'transfereecalleridnum':_0x1f2a14['transfertargetcalleridnum'],'transfereecalleridname':_0x1f2a14[_0x7bde('0x1a')],'transfereeconnectedlinenum':_0x1f2a14['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1f2a14[_0x7bde('0x1b')],'transfereeaccountcode':_0x1f2a14[_0x7bde('0x1c')],'transfereecontext':_0x1f2a14[_0x7bde('0x1d')],'transfereeexten':_0x1f2a14[_0x7bde('0x1e')],'transfereelinkedid':_0x1f2a14['transfertargetlinkedid'],'isexternal':_0x1f2a14[_0x7bde('0x10')],'context':_0x1f2a14[_0x7bde('0x1f')],'extension':_0x1f2a14[_0x7bde('0x20')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 5f01f40..e835e0b 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x23aa9e,_0x4994f4){var _0x5f50e0=function(_0x8276f0){while(--_0x8276f0){_0x23aa9e['push'](_0x23aa9e['shift']());}};_0x5f50e0(++_0x4994f4);}(_0xb10b,0x12a));var _0xbb10=function(_0x574ce3,_0x59eef4){_0x574ce3=_0x574ce3-0x0;var _0x3447a0=_0xb10b[_0x574ce3];return _0x3447a0;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x31715d,_0x5dc389){var _0x41a09d=function(_0x5dd71b){while(--_0x5dd71b){_0x31715d['push'](_0x31715d['shift']());}};_0x41a09d(++_0x5dc389);}(_0x7a54,0x106));var _0x47a5=function(_0x4f158b,_0x4d0c9a){_0x4f158b=_0x4f158b-0x0;var _0x371714=_0x7a54[_0x4f158b];return _0x371714;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+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 07f3f47..1849ca0 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 _0xb59b=['createContact','push','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','ioredis','util','../../../../config/environment','trigger','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','destcalleridnum','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridnum','firstName','calleridname','','Unknown','destcalleridname','then'];(function(_0x5606c1,_0x1b4d9e){var _0x43f9d9=function(_0x5ee9af){while(--_0x5ee9af){_0x5606c1['push'](_0x5606c1['shift']());}};_0x43f9d9(++_0x1b4d9e);}(_0xb59b,0xbd));var _0xbb59=function(_0x5ad153,_0x1b2d0e){_0x5ad153=_0x5ad153-0x0;var _0x21402c=_0xb59b[_0x5ad153];return _0x21402c;};'use strict';var _=require(_0xbb59('0x0'));var BPromise=require('bluebird');var Redis=require(_0xbb59('0x1'));var util=require(_0xbb59('0x2'));var config=require(_0xbb59('0x3'));var logger=require('../../../../config/logger')(_0xbb59('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0xbb59('0x5')]=_[_0xbb59('0x6')](config[_0xbb59('0x5')],{'host':_0xbb59('0x7'),'port':0x18eb});var io=require(_0xbb59('0x8'))(new Redis(config[_0xbb59('0x5')]));function emit(_0x55ee64,_0x2513e3,_0x29cfe2,_0x3ef7a6,_0x2028d0){logger[_0xbb59('0x9')](_0xbb59('0xa'),_0x55ee64,_0x2513e3['id'],_0x29cfe2,_0x3ef7a6,JSON[_0xbb59('0xb')](_0x2028d0));io['to'](_0x29cfe2)[_0xbb59('0xc')](_0x3ef7a6,_0x2028d0);}exports[_0xbb59('0xd')]=function(_0x1952ac,_0x2a9857,_0x48f25a,_0x24d052){var _0x1634f6,_0x545111;var _0x3a5931={};var _0x21ebb6;var _0x1e4e7e=Number(_0x48f25a[_0xbb59('0xe')]);var _0x281fb4=_0x48f25a[_0xbb59('0xf')]?Boolean(Number(_0x48f25a['data2'])):![];var _0x2ff03b;var _0x12b44f=![];if(!_[_0xbb59('0x10')](_0x48f25a[_0xbb59('0x11')])){if(_0x48f25a[_0xbb59('0x11')]=='1')_0x12b44f=!![];}if(!_0x12b44f){if(_0x24d052[_0xbb59('0x12')]){_0x3a5931['id']=_0x24d052['xmd-contactid'];}}if(!_0x3a5931['id']){_0x3a5931[_0xbb59('0x13')]=_0x1e4e7e;_0x2ff03b=_0x48f25a[_0xbb59('0x14')]&&_0x48f25a[_0xbb59('0x14')]!=='0'?_0x48f25a[_0xbb59('0x14')][_0xbb59('0x15')](','):[_0xbb59('0x16')];_0x3a5931[_0xbb59('0x17')]=_['map'](_0x2ff03b,function(_0x23b0ce){var _0x9eaa51={};_0x9eaa51[_0x23b0ce]=_0x24d052['routeId']?_0x24d052[_0xbb59('0x18')]:_0x24d052['calleridnum'];return _0x9eaa51;});_0x21ebb6=_0x24d052['routeId']?_0x24d052[_0xbb59('0x18')]:_0x24d052['calleridnum'];}var _0x5f5d9f=['id','firstName',_0xbb59('0x19'),_0xbb59('0x16'),_0xbb59('0x1a'),_0xbb59('0x1b'),_0xbb59('0x13'),_0xbb59('0x1c'),_0xbb59('0x1d'),_0xbb59('0x1e')];var _0x55d72b=_[_0xbb59('0x1f')](_0x5f5d9f,_0x2ff03b);BPromise[_0xbb59('0x20')]()['then'](cmContactRpc[_0xbb59('0x21')]({'attributes':_0x55d72b,'where':_0x3a5931,'phone':_0x21ebb6}))['then'](function(_0x488680){_0x545111=_0x488680;if(!_[_0xbb59('0x22')](_0x545111)){if(_0x545111[_0xbb59('0x23')]===0x1){_0x1634f6=_0x545111[0x0];logger[_0xbb59('0x9')](_0xbb59('0x24'),_0x24d052['uniqueid'],_0x2a9857['id'],_0x1634f6['id']);}else{logger[_0xbb59('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x24d052[_0xbb59('0x25')],_0x2a9857['id'],_[_0xbb59('0x26')](_0x545111,'id')[_0xbb59('0x27')](','));}return;}else{logger['info'](_0xbb59('0x28'),_0x24d052[_0xbb59('0x25')],_0x2a9857['id']);var _0x2aba43={'ListId':_0x1e4e7e};var _0x350556=_0x48f25a[_0xbb59('0x29')]&&_0x48f25a[_0xbb59('0x29')]!=='0'?_0x48f25a['data4']:'phone';if(_0x281fb4){logger[_0xbb59('0x9')](_0xbb59('0x2a'),_0x24d052[_0xbb59('0x25')],_0x2a9857['id']);_0x2aba43[_0x350556]=_[_0xbb59('0x10')](_0x24d052[_0xbb59('0x2b')])?_0x24d052[_0xbb59('0x2c')]:_0x24d052[_0xbb59('0x18')];if(_[_0xbb59('0x10')](_0x24d052[_0xbb59('0x2b')])){_0x2aba43[_0xbb59('0x2d')]=_0x24d052[_0xbb59('0x2e')]&&_0x24d052[_0xbb59('0x2e')]!==_0xbb59('0x2f')?_0x24d052[_0xbb59('0x2e')]:_0xbb59('0x30');}else{_0x2aba43[_0xbb59('0x2d')]=_0x24d052[_0xbb59('0x31')]&&_0x24d052[_0xbb59('0x31')]!==_0xbb59('0x2f')?_0x24d052[_0xbb59('0x31')]:_0xbb59('0x30');}return BPromise['resolve']()[_0xbb59('0x32')](cmContactRpc[_0xbb59('0x33')](_0x2aba43))[_0xbb59('0x32')](function(_0x5b7731){_0x1634f6=_0x5b7731;_0x545111[_0xbb59('0x34')](_0x5b7731);if(_0x1634f6){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x24d052[_0xbb59('0x25')],_0x2a9857['id'],_0x1634f6['id']);}return;});}else{logger[_0xbb59('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x24d052['uniqueid'],_0x2a9857['id']);_0x2aba43[_0x350556]=_[_0xbb59('0x10')](_0x24d052[_0xbb59('0x2b')])?_0x24d052[_0xbb59('0x2c')]:_0x24d052[_0xbb59('0x18')];if(_[_0xbb59('0x10')](_0x24d052[_0xbb59('0x2b')])){_0x2aba43['firstName']=_0x24d052[_0xbb59('0x2e')]&&_0x24d052[_0xbb59('0x2e')]!==_0xbb59('0x2f')?_0x24d052[_0xbb59('0x2e')]:'Unknown';}else{_0x2aba43['firstName']=_0x24d052[_0xbb59('0x31')]&&_0x24d052['destcalleridname']!==_0xbb59('0x2f')?_0x24d052[_0xbb59('0x31')]:_0xbb59('0x30');}_0x1634f6=_0x2aba43;_0x545111[_0xbb59('0x34')](_0x2aba43);return;}}})[_0xbb59('0x32')](function(){if(_0x1952ac){emit(_0x24d052['uniqueid'],_0x2a9857,util[_0xbb59('0x35')](_0xbb59('0x36'),_0x1952ac[_0xbb59('0x37')]),util[_0xbb59('0x35')](_0xbb59('0x38'),_0x48f25a[_0xbb59('0x39')][_0xbb59('0x3a')]()),{'evt':_[_0xbb59('0x3b')](_0x24d052,{'autoCreate':_0x281fb4}),'contact':_0x1634f6===undefined?{}:_0x1634f6,'contacts':_0x545111[_0xbb59('0x23')]===0x0?undefined:_0x545111});}});}; \ No newline at end of file +var _0x2e48=['data4','routeId','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','toLowerCase','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5','xmd-contactid','data3','phone','$or','map','calleridnum','destcalleridnum','firstName','lastName','mobile','ListId','createdAt','scheduledAt','union','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found'];(function(_0x54150f,_0x18df36){var _0x487ead=function(_0x131a28){while(--_0x131a28){_0x54150f['push'](_0x54150f['shift']());}};_0x487ead(++_0x18df36);}(_0x2e48,0x76));var _0x82e4=function(_0x59ae8f,_0x148344){_0x59ae8f=_0x59ae8f-0x0;var _0x3900b5=_0x2e48[_0x59ae8f];return _0x3900b5;};'use strict';var _=require(_0x82e4('0x0'));var BPromise=require(_0x82e4('0x1'));var Redis=require('ioredis');var util=require(_0x82e4('0x2'));var config=require(_0x82e4('0x3'));var logger=require(_0x82e4('0x4'))(_0x82e4('0x5'));var cmContactRpc=require(_0x82e4('0x6'));config[_0x82e4('0x7')]=_[_0x82e4('0x8')](config[_0x82e4('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x82e4('0x9'))(new Redis(config[_0x82e4('0x7')]));function emit(_0x43e4f8,_0x16d8b2,_0x1f96cb,_0x585e65,_0x3a9080){logger[_0x82e4('0xa')](_0x82e4('0xb'),_0x43e4f8,_0x16d8b2['id'],_0x1f96cb,_0x585e65,JSON[_0x82e4('0xc')](_0x3a9080));io['to'](_0x1f96cb)[_0x82e4('0xd')](_0x585e65,_0x3a9080);}exports[_0x82e4('0xe')]=function(_0x2a54d2,_0x293fd3,_0x4c192d,_0x51fb22){var _0x3ad2d0,_0x431e85;var _0x3ef30c={};var _0x5170a1;var _0x280700=Number(_0x4c192d['data1']);var _0x32fea5=_0x4c192d[_0x82e4('0xf')]?Boolean(Number(_0x4c192d['data2'])):![];var _0x129521;var _0x1d6b39=![];if(!_[_0x82e4('0x10')](_0x4c192d[_0x82e4('0x11')])){if(_0x4c192d[_0x82e4('0x11')]=='1')_0x1d6b39=!![];}if(!_0x1d6b39){if(_0x51fb22[_0x82e4('0x12')]){_0x3ef30c['id']=_0x51fb22[_0x82e4('0x12')];}}if(!_0x3ef30c['id']){_0x3ef30c['ListId']=_0x280700;_0x129521=_0x4c192d[_0x82e4('0x13')]&&_0x4c192d[_0x82e4('0x13')]!=='0'?_0x4c192d[_0x82e4('0x13')]['split'](','):[_0x82e4('0x14')];_0x3ef30c[_0x82e4('0x15')]=_[_0x82e4('0x16')](_0x129521,function(_0x5ed93a){var _0x2fff47={};_0x2fff47[_0x5ed93a]=_0x51fb22['routeId']?_0x51fb22['destcalleridnum']:_0x51fb22[_0x82e4('0x17')];return _0x2fff47;});_0x5170a1=_0x51fb22['routeId']?_0x51fb22[_0x82e4('0x18')]:_0x51fb22[_0x82e4('0x17')];}var _0x32fb4d=['id',_0x82e4('0x19'),_0x82e4('0x1a'),_0x82e4('0x14'),_0x82e4('0x1b'),'fax',_0x82e4('0x1c'),_0x82e4('0x1d'),_0x82e4('0x1e'),'updatedAt'];var _0xefc976=_[_0x82e4('0x1f')](_0x32fb4d,_0x129521);BPromise['resolve']()[_0x82e4('0x20')](cmContactRpc['getContacts']({'attributes':_0xefc976,'where':_0x3ef30c,'phone':_0x5170a1}))['then'](function(_0x1d238c){_0x431e85=_0x1d238c;if(!_['isEmpty'](_0x431e85)){if(_0x431e85[_0x82e4('0x21')]===0x1){_0x3ad2d0=_0x431e85[0x0];logger[_0x82e4('0xa')](_0x82e4('0x22'),_0x51fb22[_0x82e4('0x23')],_0x293fd3['id'],_0x3ad2d0['id']);}else{logger[_0x82e4('0xa')](_0x82e4('0x24'),_0x51fb22['uniqueid'],_0x293fd3['id'],_['map'](_0x431e85,'id')['join'](','));}return;}else{logger[_0x82e4('0xa')](_0x82e4('0x25'),_0x51fb22[_0x82e4('0x23')],_0x293fd3['id']);var _0x40f2e6={'ListId':_0x280700};var _0x324e51=_0x4c192d[_0x82e4('0x26')]&&_0x4c192d[_0x82e4('0x26')]!=='0'?_0x4c192d[_0x82e4('0x26')]:_0x82e4('0x14');if(_0x32fea5){logger[_0x82e4('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x51fb22[_0x82e4('0x23')],_0x293fd3['id']);_0x40f2e6[_0x324e51]=_['isNil'](_0x51fb22['routeId'])?_0x51fb22[_0x82e4('0x17')]:_0x51fb22['destcalleridnum'];if(_[_0x82e4('0x10')](_0x51fb22[_0x82e4('0x27')])){_0x40f2e6[_0x82e4('0x19')]=_0x51fb22['calleridname']&&_0x51fb22[_0x82e4('0x28')]!==_0x82e4('0x29')?_0x51fb22[_0x82e4('0x28')]:_0x82e4('0x2a');}else{_0x40f2e6[_0x82e4('0x19')]=_0x51fb22['destcalleridname']&&_0x51fb22[_0x82e4('0x2b')]!==_0x82e4('0x29')?_0x51fb22[_0x82e4('0x2b')]:_0x82e4('0x2a');}return BPromise['resolve']()[_0x82e4('0x20')](cmContactRpc['createContact'](_0x40f2e6))[_0x82e4('0x20')](function(_0x29ca8e){_0x3ad2d0=_0x29ca8e;_0x431e85[_0x82e4('0x2c')](_0x29ca8e);if(_0x3ad2d0){logger['info'](_0x82e4('0x2d'),_0x51fb22[_0x82e4('0x23')],_0x293fd3['id'],_0x3ad2d0['id']);}return;});}else{logger['info'](_0x82e4('0x2e'),_0x51fb22[_0x82e4('0x23')],_0x293fd3['id']);_0x40f2e6[_0x324e51]=_['isNil'](_0x51fb22[_0x82e4('0x27')])?_0x51fb22[_0x82e4('0x17')]:_0x51fb22[_0x82e4('0x18')];if(_[_0x82e4('0x10')](_0x51fb22[_0x82e4('0x27')])){_0x40f2e6[_0x82e4('0x19')]=_0x51fb22[_0x82e4('0x28')]&&_0x51fb22[_0x82e4('0x28')]!==''?_0x51fb22[_0x82e4('0x28')]:_0x82e4('0x2a');}else{_0x40f2e6[_0x82e4('0x19')]=_0x51fb22[_0x82e4('0x2b')]&&_0x51fb22['destcalleridname']!==_0x82e4('0x29')?_0x51fb22['destcalleridname']:_0x82e4('0x2a');}_0x3ad2d0=_0x40f2e6;_0x431e85[_0x82e4('0x2c')](_0x40f2e6);return;}}})[_0x82e4('0x20')](function(){if(_0x2a54d2){emit(_0x51fb22[_0x82e4('0x23')],_0x293fd3,util[_0x82e4('0x2f')](_0x82e4('0x30'),_0x2a54d2[_0x82e4('0x31')]),util[_0x82e4('0x2f')](_0x82e4('0x32'),_0x4c192d['action'][_0x82e4('0x33')]()),{'evt':_['merge'](_0x51fb22,{'autoCreate':_0x32fea5}),'contact':_0x3ad2d0===undefined?{}:_0x3ad2d0,'contacts':_0x431e85[_0x82e4('0x21')]===0x0?undefined:_0x431e85});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 4311292..65a10ce 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 _0x866e=['winApplication','winArguments','data3','user:%s','name','trigger:%s:%s','toLowerCase','jscripty','format','trigger:%s','merge','data1','exec','accounts','queue','routeId','script','parse','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','checkTrigger:\x20trigger','field','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','undefined','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./cmContact','./script','../../../config/environment','trigger','../ami','redis','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','syncCustomEvent','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','motionChannel','voice','inspect','interface','checkTriggers','hasOwnProperty','checkTrigger','variables','Actions','length','action','contactmanager','motionbar','browser','TemplateId','data2','render','html','template\x20not\x20found','buildUri','isNil','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6'];(function(_0x2c5fa3,_0x41f89e){var _0x5dcb19=function(_0x12d4e0){while(--_0x12d4e0){_0x2c5fa3['push'](_0x2c5fa3['shift']());}};_0x5dcb19(++_0x41f89e);}(_0x866e,0xaf));var _0xe866=function(_0x4027f0,_0x4a4cad){_0x4027f0=_0x4027f0-0x0;var _0x2fe029=_0x866e[_0x4027f0];return _0x2fe029;};'use strict';var util=require(_0xe866('0x0'));var _=require(_0xe866('0x1'));var url=require(_0xe866('0x2'));var Mustache=require(_0xe866('0x3'));var Redis=require(_0xe866('0x4'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require(_0xe866('0x5'));var script=require(_0xe866('0x6'));var config=require(_0xe866('0x7'));var logger=require('../../../config/logger')(_0xe866('0x8'));var ami=require(_0xe866('0x9'));config[_0xe866('0xa')]=_['defaults'](config[_0xe866('0xa')],{'host':_0xe866('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe866('0xa')]));var operators={'equals':function(_0x3b6c3c,_0x2da97d){return _0x3b6c3c==_0x2da97d;},'not_equals':function(_0x138395,_0x3a5680){return _0x138395!=_0x3a5680;}};var barAndWebActions=[_0xe866('0xc'),_0xe866('0x2'),_0xe866('0xd')];function Trigger(_0x543a97){this[_0xe866('0xe')]=_0x543a97[_0xe866('0xe')];this[_0xe866('0xf')]=_0x543a97[_0xe866('0xf')];this[_0xe866('0x10')]=_0x543a97[_0xe866('0x10')];this[_0xe866('0x11')]=_0x543a97[_0xe866('0x11')];this[_0xe866('0x12')]=_0x543a97[_0xe866('0x12')];this[_0xe866('0x13')]=_0x543a97[_0xe866('0x13')];this['freshdeskAccounts']=_0x543a97[_0xe866('0x14')];this[_0xe866('0x15')]=_0x543a97['salesforceAccounts'];this['sugarcrmAccounts']=_0x543a97[_0xe866('0x16')];this[_0xe866('0x17')]=_0x543a97[_0xe866('0x17')];this[_0xe866('0x18')]=_0x543a97[_0xe866('0x18')];this[_0xe866('0x19')]=_0x543a97['vtigerAccounts'];this[_0xe866('0x1a')]=_0x543a97[_0xe866('0x1a')];this[_0xe866('0x1b')]=_0x543a97[_0xe866('0x1b')];this[_0xe866('0x1c')]=_0x543a97[_0xe866('0x1c')];this['accounts']={'zendesk':this[_0xe866('0x13')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xe866('0x14')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xe866('0x17')],'desk':this[_0xe866('0x18')],'vtiger':this[_0xe866('0x19')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xe866('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0xe866('0x1d'),this['syncCustomEvent']['bind'](this));ami['on'](_0xe866('0x1e'),this['syncCustomEvent'][_0xe866('0x1f')](this));ami['on'](_0xe866('0x20'),this['syncCustomEvent'][_0xe866('0x1f')](this));ami['on'](_0xe866('0x21'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0xe866('0x22')][_0xe866('0x1f')](this));ami['on']('custom:agentnoanswer',this['syncCustomEvent'][_0xe866('0x1f')](this));ami['on'](_0xe866('0x23'),this[_0xe866('0x22')][_0xe866('0x1f')](this));ami['on'](_0xe866('0x24'),this[_0xe866('0x22')][_0xe866('0x1f')](this));ami['on']('custom:agentreject',this[_0xe866('0x22')][_0xe866('0x1f')](this));ami['on'](_0xe866('0x25'),this[_0xe866('0x22')]['bind'](this));ami['on'](_0xe866('0x26'),this['syncCustomEvent'][_0xe866('0x1f')](this));ami['on'](_0xe866('0x27'),this[_0xe866('0x22')][_0xe866('0x1f')](this));ami['on']('custom:dialbegin',this[_0xe866('0x28')][_0xe866('0x1f')](this));ami['on']('custom:dialconnect',this[_0xe866('0x28')][_0xe866('0x1f')](this));ami['on'](_0xe866('0x29'),this['syncAgentDial']['bind'](this));ami['on'](_0xe866('0x2a'),this[_0xe866('0x22')]['bind'](this));ami['on'](_0xe866('0x2b'),this['syncCustomEvent']['bind'](this));ami['on'](_0xe866('0x2c'),this[_0xe866('0x22')][_0xe866('0x1f')](this));ami['on']('custom:incomingmessage',this[_0xe866('0x22')][_0xe866('0x1f')](this));ami['on'](_0xe866('0x2d'),this['syncCustomEvent'][_0xe866('0x1f')](this));ami['on']('custom:acceptmessage',this[_0xe866('0x22')][_0xe866('0x1f')](this));ami['on'](_0xe866('0x2e'),this['syncCustomEvent'][_0xe866('0x1f')](this));ami['on'](_0xe866('0x2f'),this[_0xe866('0x22')][_0xe866('0x1f')](this));}Trigger[_0xe866('0x30')][_0xe866('0x31')]=function(_0xe16255,_0x4a58b6,_0x3cd094){logger[_0xe866('0x32')](_0xe16255,_0x4a58b6,JSON[_0xe866('0x33')](_0x3cd094));io['to'](_0xe16255)[_0xe866('0x31')](_0x4a58b6,_0x3cd094);};Trigger['prototype'][_0xe866('0x22')]=function(_0x27dd61){var _0x242e69=_['clone'](_0x27dd61);if(typeof _0x242e69[_0xe866('0x34')]==='undefined'){_0x242e69[_0xe866('0x34')]=_0xe866('0x35');}logger['debug'](_0xe866('0x22'),util[_0xe866('0x36')](_0x242e69,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x242e69);};Trigger[_0xe866('0x30')][_0xe866('0x28')]=function(_0x1fd8ca){if(this['agents'][_0x1fd8ca[_0xe866('0x37')]]){this[_0xe866('0x22')](_0x1fd8ca);}};Trigger[_0xe866('0x30')][_0xe866('0x38')]=function(_0x3e8eba){var _0x13d85c;for(var _0x50a2d1 in this[_0xe866('0xe')]){if(this[_0xe866('0xe')][_0xe866('0x39')](_0x50a2d1)){if(this[_0xe866('0xe')][_0x50a2d1]['status']){_0x13d85c=this[_0xe866('0x3a')](this['triggers'][_0x50a2d1],_0x3e8eba);if(_0x13d85c){_['merge'](_0x3e8eba,_0x3e8eba[_0xe866('0x3b')]);for(var _0x1cf2c0=0x0,_0x5e0520,_0x55ae16,_0x516c7a;_0x1cf2c00x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','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','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x4db963,_0x149c75){var _0x2150d2=function(_0x2ed06a){while(--_0x2ed06a){_0x4db963['push'](_0x4db963['shift']());}};_0x2150d2(++_0x149c75);}(_0x814b,0x1a2));var _0xb814=function(_0x24563c,_0x49d7cd){_0x24563c=_0x24563c-0x0;var _0x14796e=_0x814b[_0x24563c];return _0x14796e;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ 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 6da1d8e..9731d4c 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 _0xa422=['picklist','nameField','customField','idField','indexOf','content','assign','getString','/contacts(','Fields','ticketType','phonecall','callDirection','queue','Descriptions','odata-entityid','ticketId','format','user:%s','emit','trigger:browser:url','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','localhost','modernAuthentication','remoteUri','data7','CloudProvider','data2','resolve','data5','POST','clientId','username','clientSecret','access_token','catch','error',']\x20Wrong\x20credentials!','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','validateEmail','email','userEmail','length','internalemailaddress','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','calleridnum','contacts','/systemusers(','body','headers','substring','lastIndexOf','outbound','GET','contacts?$select=','&$filter=','replace','%2b','value','enduserId','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','string'];(function(_0x436a1a,_0x1c6be0){var _0x8e1d7b=function(_0x514831){while(--_0x514831){_0x436a1a['push'](_0x436a1a['shift']());}};_0x8e1d7b(++_0x1c6be0);}(_0xa422,0x160));var _0x2a42=function(_0x28c096,_0x148c62){_0x28c096=_0x28c096-0x0;var _0x2b3aa0=_0xa422[_0x28c096];return _0x2b3aa0;};'use strict';var _=require(_0x2a42('0x0'));var rp=require(_0x2a42('0x1'));var util=require(_0x2a42('0x2'));var intUtil=require(_0x2a42('0x3'));var md5=require(_0x2a42('0x4'));var Redis=require(_0x2a42('0x5'));var logger=require('../../../../config/logger')(_0x2a42('0x6'));var config=require(_0x2a42('0x7'));config[_0x2a42('0x8')]=_['defaults'](config[_0x2a42('0x8')],{'host':_0x2a42('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0x4535c2,_0x5ed5d0,_0x2e39dc){if(_0x4535c2[_0x2a42('0xa')]){_0x4535c2[_0x2a42('0xb')]=_0x4535c2['CloudProvider'][_0x2a42('0xc')];_0x4535c2['tenantId']=_0x4535c2[_0x2a42('0xd')][_0x2a42('0xe')];return Promise[_0x2a42('0xf')](_0x4535c2['CloudProvider'][_0x2a42('0x10')]);}var _0x1bded2={'method':_0x2a42('0x11'),'uri':_0x5ed5d0,'form':{'client_id':_0x4535c2[_0x2a42('0x12')],'resource':_0x4535c2[_0x2a42('0xb')],'username':_0x4535c2[_0x2a42('0x13')],'password':_0x4535c2['password'],'grant_type':'password','client_secret':_0x4535c2[_0x2a42('0x14')]},'json':!![]};return rp(_0x1bded2)['then'](function(_0x37f573){return _0x37f573[_0x2a42('0x15')];})[_0x2a42('0x16')](function(_0x5a92ca){logger[_0x2a42('0x17')]('['+[_0x2e39dc['toUpperCase']()]+_0x2a42('0x18'));return _0x5a92ca['message'];});}function getUser(_0x4a41cd,_0x1b1959,_0x436646,_0x2d9a19,_0x72dd16,_0x495c3e){return new Promise(function(_0x6f4ff3,_0x418eef){return getAuthToken(_0x1b1959,_0x2d9a19,_0x495c3e)[_0x2a42('0x19')](function(_0x21b84b){var _0x59bc20={'method':'GET','uri':_0x72dd16+_0x2a42('0x1a'),'headers':{'Authorization':_0x2a42('0x1b')+_0x21b84b,'OData-Version':_0x2a42('0x1c')},'json':!![]};return rp(_0x59bc20);})['then'](function(_0x1e8666){var _0x3282a2=_0x1e8666['value'];var _0x29cff4=![];var _0x240513=null;if(!_['isNil'](_0x436646)){if(intUtil[_0x2a42('0x1d')](_0x436646[_0x2a42('0x1e')])){_0x4a41cd[_0x2a42('0x1f')]=_0x436646['email'];for(_0x240513=0x0;_0x240513<_0x3282a2[_0x2a42('0x20')];_0x240513++){if(_0x3282a2[_0x240513][_0x2a42('0x21')]===_0x436646[_0x2a42('0x1e')]&&!_0x3282a2[_0x240513]['isdisabled']){_0x29cff4=!![];logger['info']('['+[_0x495c3e[_0x2a42('0x22')]()]+_0x2a42('0x23')+_0x3282a2[_0x240513][_0x2a42('0x24')]+'!');_0x4a41cd[_0x2a42('0x25')]=_0x3282a2[_0x240513][_0x2a42('0x24')];}}}}if(!_0x29cff4){logger[_0x2a42('0x26')]('['+[_0x495c3e[_0x2a42('0x22')]()]+_0x2a42('0x27'));_0x4a41cd['userEmail']=_0x1b1959[_0x2a42('0x13')];for(_0x240513=0x0;_0x240513<_0x3282a2[_0x2a42('0x20')];_0x240513++){if(_0x3282a2[_0x240513][_0x2a42('0x21')]===_0x1b1959[_0x2a42('0x13')]){_0x4a41cd[_0x2a42('0x25')]=_0x3282a2[_0x240513][_0x2a42('0x24')];}}}_0x6f4ff3(_0x4a41cd);})[_0x2a42('0x16')](function(_0x1cd411){_0x418eef(_0x1cd411[_0x2a42('0x28')]);});});}function createEndUser(_0x45422e,_0x107aad,_0x2f3059,_0x110ab1,_0x47b3b5,_0x3e8baf,_0x19528c){return new Promise(function(_0x2a59fd,_0x22b911){return getAuthToken(_0x107aad,_0x2f3059,_0x3e8baf)[_0x2a42('0x19')](function(_0x435a30){var _0x1a58e8=_0x3e8baf[_0x2a42('0x29')]()==='outbound'?_0x47b3b5['destcalleridnum']:_0x47b3b5[_0x2a42('0x2a')];var _0x342bd1={'method':_0x2a42('0x11'),'uri':_0x110ab1+_0x2a42('0x2b'),'body':{'fullname':_0x1a58e8,'firstname':_0x1a58e8,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2a42('0x2c')+_0x45422e[_0x2a42('0x25')]+')'},'headers':{'Authorization':_0x2a42('0x1b')+_0x435a30,'OData-Version':_0x2a42('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x342bd1[_0x2a42('0x2d')][_0x19528c]=_0x1a58e8;return rp(_0x342bd1);})[_0x2a42('0x19')](function(_0x15c36e){var _0xfa0af2=_0x15c36e[_0x2a42('0x2e')]['odata-entityid'];var _0x5f85c7=_0xfa0af2[_0x2a42('0x2f')](_0xfa0af2[_0x2a42('0x30')]('(')+0x1,_0xfa0af2[_0x2a42('0x30')](')'));_0x45422e['enduserId']=_0x5f85c7;_0x2a59fd(_0x45422e);})[_0x2a42('0x16')](function(_0x329c70){_0x22b911(_0x329c70['message']);});});}function getEndUser(_0x41c413,_0x275330,_0x4cac4b,_0x13578c,_0x5ccb86,_0x2123ce,_0x1633d7,_0x6ea8c5){var _0x80aa59=_0x2123ce[_0x2a42('0x29')]()===_0x2a42('0x31')?_0x5ccb86['destcalleridnum']:_0x5ccb86[_0x2a42('0x2a')];return getAuthToken(_0x275330,_0x4cac4b,_0x2123ce)['then'](function(_0x45e033){_0x6ea8c5=_0x6ea8c5?_0x6ea8c5:'telephone1';var _0x8465ad={'method':_0x2a42('0x32'),'uri':_0x13578c+_0x2a42('0x33')+_0x6ea8c5+_0x2a42('0x34')+_0x6ea8c5+'\x20eq\x20\x27'+_0x80aa59[_0x2a42('0x35')]('+',_0x2a42('0x36'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x45e033,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x8465ad);})[_0x2a42('0x19')](function(_0x8303ac){var _0x4e1f32=![];if(!_0x8303ac)return _0x4e1f32;var _0x4cf8cc=_0x8303ac[_0x2a42('0x37')];for(var _0x520ef5=0x0;_0x520ef5<_0x4cf8cc[_0x2a42('0x20')];_0x520ef5++){if(_0x4cf8cc[_0x520ef5][_0x6ea8c5]===_0x80aa59){_0x4e1f32=!![];_0x41c413[_0x2a42('0x38')]=_0x4cf8cc[_0x520ef5]['contactid'];}}return _0x4e1f32;})[_0x2a42('0x19')](function(_0x52cf47){if(_0x52cf47)return _0x41c413;if(_0x1633d7===_0x2a42('0x39')){logger[_0x2a42('0x26')]('['+[_0x2123ce[_0x2a42('0x22')]()]+_0x2a42('0x3a'));return _0x41c413;}return createEndUser(_0x41c413,_0x275330,_0x4cac4b,_0x13578c,_0x5ccb86,_0x2123ce,_0x6ea8c5)[_0x2a42('0x19')](function(_0x5c95e1){logger['info']('['+[_0x2123ce['toUpperCase']()]+']\x20Enduser\x20created!',_0x5c95e1[_0x2a42('0x38')]);return _0x5c95e1;});});}function getCustomFields(_0x3a2983,_0x4ab1ad,_0x5a4218){var _0x2d2725={};if(_0x3a2983[_0x2a42('0x20')]>0x0){_['forEach'](_0x3a2983,function(_0x1fc233){if(_['includes']([_0x2a42('0x3b'),_0x2a42('0x3c')],_0x1fc233['type'])&&_0x1fc233[_0x2a42('0x3d')]&&!_0x1fc233[_0x2a42('0x3e')]){var _0x5994c1=_0x1fc233[_0x2a42('0x3f')][_0x2a42('0x29')]();var _0x4e968e=_0x5994c1[_0x2a42('0x2f')](0x0,_0x5994c1[_0x2a42('0x40')]('_'));var _0x48bdaf=_0x5994c1[_0x2a42('0x2f')](_0x5994c1[_0x2a42('0x40')]('_')+0x1);if(_0x4e968e===_0x5a4218){_0x2d2725[_0x48bdaf]=_0x1fc233[_0x2a42('0x41')];}}});}return _0x2d2725;}function getTicket(_0x1c3abd,_0x392f70,_0x226248,_0x3509a7,_0x43daf8,_0x1c1448,_0x545de2){return new Promise(function(_0x125091,_0x35be30){var _0x5cb9a9;return getAuthToken(_0x392f70,_0x226248,_0x545de2)[_0x2a42('0x19')](function(_0x4a4930){if(_0x1c1448['ticketType']==='incident'){_0x5cb9a9={'method':_0x2a42('0x11'),'uri':_0x3509a7+'incidents','body':Object[_0x2a42('0x42')]({},{'title':intUtil['getString'](_0x1c1448['Subjects'],_0x43daf8,'\x20'),'description':intUtil[_0x2a42('0x43')](_0x1c1448['Descriptions'],_0x43daf8,'\x0a'),'customerid_contact@odata.bind':_0x1c3abd[_0x2a42('0x38')]?_0x2a42('0x44')+_0x1c3abd['enduserId']+')':undefined,'ownerid@odata.bind':_0x2a42('0x2c')+_0x1c3abd[_0x2a42('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x1c1448[_0x2a42('0x45')],_0x43daf8,_0x1c1448['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x4a4930,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1c1448[_0x2a42('0x46')]===_0x2a42('0x47')){var _0x221790=_0x1c3abd[_0x2a42('0x38')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x1c3abd['userId']+')','participationtypemask':_0x1c3abd[_0x2a42('0x48')]===_0x2a42('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x2a42('0x44')+_0x1c3abd[_0x2a42('0x38')]+')','participationtypemask':_0x1c3abd['callDirection']===_0x2a42('0x49')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x2a42('0x2c')+_0x1c3abd[_0x2a42('0x25')]+')','participationtypemask':_0x1c3abd[_0x2a42('0x48')]===_0x2a42('0x49')?0x2:0x1}];_0x5cb9a9={'method':_0x2a42('0x11'),'uri':_0x3509a7+'phonecalls','body':Object[_0x2a42('0x42')]({},{'subject':intUtil[_0x2a42('0x43')](_0x1c1448['Subjects'],_0x43daf8,'\x20'),'phonenumber':String(_0x43daf8['calleridnum']),'description':intUtil[_0x2a42('0x43')](_0x1c1448[_0x2a42('0x4a')],_0x43daf8,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1c3abd[_0x2a42('0x38')]?_0x2a42('0x44')+_0x1c3abd[_0x2a42('0x38')]+')':undefined,'ownerid@odata.bind':_0x2a42('0x2c')+_0x1c3abd['userId']+')','directioncode':_0x1c3abd[_0x2a42('0x48')]===_0x2a42('0x49')?![]:!![],'phonecall_activity_parties':_0x221790},getCustomFields(_0x1c1448[_0x2a42('0x45')],_0x43daf8,_0x1c1448[_0x2a42('0x46')])),'headers':{'Authorization':_0x2a42('0x1b')+_0x4a4930,'OData-Version':_0x2a42('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5cb9a9);})['then'](function(_0x1af00d){var _0x2f3d70=_0x1af00d[_0x2a42('0x2e')][_0x2a42('0x4b')];var _0x205960=_0x2f3d70[_0x2a42('0x2f')](_0x2f3d70[_0x2a42('0x30')]('(')+0x1,_0x2f3d70[_0x2a42('0x30')](')'));_0x1c3abd[_0x2a42('0x4c')]=_0x205960;_0x125091(_0x1c3abd);})[_0x2a42('0x16')](function(_0x1a3ade){_0x35be30(_0x1a3ade[_0x2a42('0x28')]);});});}function emit(_0x179bf0,_0x2cd065,_0x1e31b1,_0x2f3240){var _0x57eab0={'uri':util[_0x2a42('0x4d')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x179bf0,_0x1e31b1,_0x2f3240)};io['to'](util[_0x2a42('0x4d')](_0x2a42('0x4e'),_0x2cd065))[_0x2a42('0x4f')](_0x2a42('0x50'),_0x57eab0);}exports['cs']=function(_0x593462,_0x58175f,_0xea8766,_0x1d8c76,_0x1c8851,_0x275beb,_0xe9e3e6,_0x5b1127){var _0x55f324={};_0x275beb['remoteUri']=_0x275beb['modernAuthentication']?intUtil['stripTrailingSlash'](_0x275beb[_0x2a42('0xd')]['data7']):intUtil['stripTrailingSlash'](_0x275beb['remoteUri']);_0x275beb[_0x2a42('0x51')]=intUtil['stripTrailingSlash'](_0x275beb[_0x2a42('0x51')]);_0x55f324[_0x2a42('0x48')]=_0x5b1127==='queue'||_0x5b1127===_0x2a42('0x52')?_0x2a42('0x49'):_0x2a42('0x31');var _0x17a9d6=_0x275beb[_0x2a42('0xa')]?util['format'](_0x2a42('0x53'),_0x275beb[_0x2a42('0xd')][_0x2a42('0xc')]):util['format'](_0x2a42('0x53'),_0x275beb[_0x2a42('0xb')]);var _0x7fdfa8=util[_0x2a42('0x4d')](_0x2a42('0x54'),_0x275beb[_0x2a42('0x55')]);var _0x232c2a=util[_0x2a42('0x4d')](_0x2a42('0x56'),_0x275beb[_0x2a42('0x51')],_0x58175f[_0x2a42('0x57')],md5(_0x58175f[_0x2a42('0x57')]));if(_0x1c8851&&_0x1c8851[_0x2a42('0x58')]){logger[_0x2a42('0x26')]('[QUEUE]',_0x2a42('0x59'));_0x58175f[_0x2a42('0x5a')]=_0x232c2a;}else if(_0xe9e3e6&&_0xe9e3e6['recordingFormat']&&_0xe9e3e6['recordingFormat']!==_0x2a42('0x5b')){logger[_0x2a42('0x26')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x58175f[_0x2a42('0x5a')]=_0x232c2a;}else{_0x58175f[_0x2a42('0x5a')]='';}return getUser(_0x55f324,_0x275beb,_0x1d8c76,_0x7fdfa8,_0x17a9d6,_0x5b1127)[_0x2a42('0x19')](function(_0x5b261e){logger[_0x2a42('0x26')]('['+_0x5b1127[_0x2a42('0x22')]()+_0x2a42('0x5c'),_0x5b261e[_0x2a42('0x25')]);logger[_0x2a42('0x26')]('['+_0x5b1127[_0x2a42('0x22')]()+_0x2a42('0x5d'),_0x5b261e[_0x2a42('0x1f')]);return getEndUser(_0x5b261e,_0x275beb,_0x7fdfa8,_0x17a9d6,_0x58175f,_0x5b1127,_0xea8766[_0x2a42('0x5e')],_0xea8766[_0x2a42('0x5f')]);})['then'](function(_0x2eea68){logger[_0x2a42('0x26')]('['+_0x5b1127[_0x2a42('0x22')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x2eea68[_0x2a42('0x38')]);logger[_0x2a42('0x26')]('['+_0x5b1127[_0x2a42('0x22')]()+_0x2a42('0x60'),_0x58175f[_0x2a42('0x2a')]);return getTicket(_0x2eea68,_0x275beb,_0x7fdfa8,_0x17a9d6,_0x58175f,_0xea8766,_0x5b1127);})[_0x2a42('0x19')](function(_0x52e75b){logger[_0x2a42('0x26')](util[_0x2a42('0x4d')]('['+_0x5b1127[_0x2a42('0x22')]()+_0x2a42('0x61'),_0xea8766[_0x2a42('0x46')],_0x52e75b['ticketId']));logger[_0x2a42('0x26')](util[_0x2a42('0x4d')]('['+_0x5b1127['toUpperCase']()+_0x2a42('0x62'),_0x5b1127));if(_0x5b1127!=='unmanaged'&&_0xea8766[_0x2a42('0x63')]){logger[_0x2a42('0x26')]('['+_0x5b1127[_0x2a42('0x22')]()+']',_0x2a42('0x64'));emit(_0x275beb[_0x2a42('0xb')],_0x1d8c76['name'],_0xea8766[_0x2a42('0x46')],_0x52e75b[_0x2a42('0x4c')]);}})[_0x2a42('0x16')](function(_0x1d3b9d){logger[_0x2a42('0x17')]('['+_0x5b1127[_0x2a42('0x22')]()+_0x2a42('0x65'),_0x1d3b9d[_0x2a42('0x28')]);console[_0x2a42('0x17')](_0x2a42('0x66'),_0x1d3b9d);});}; \ No newline at end of file +var _0xd660=['/contacts(','Fields','phonecall','callDirection','queue','phonecalls','Descriptions','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','error','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','resolve','data5','POST','clientId','username','password','then','catch','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','email','userEmail','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','internalemailaddress','toLowerCase','outbound','calleridnum','/systemusers(','body','headers','odata-entityid','lastIndexOf','enduserId','destcalleridnum','telephone1','contacts?$select=','replace','%2b','contactid','nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','idField','substring','indexOf','ticketType','incident','incidents','assign','Subjects','getString'];(function(_0x22aa7f,_0x2f6ff6){var _0x591797=function(_0x20441f){while(--_0x20441f){_0x22aa7f['push'](_0x22aa7f['shift']());}};_0x591797(++_0x2f6ff6);}(_0xd660,0x93));var _0x0d66=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0xd660[_0x1e03a6];return _0x295b64;};'use strict';var _=require(_0x0d66('0x0'));var rp=require(_0x0d66('0x1'));var util=require(_0x0d66('0x2'));var intUtil=require(_0x0d66('0x3'));var md5=require('md5');var Redis=require(_0x0d66('0x4'));var logger=require('../../../../config/logger')(_0x0d66('0x5'));var config=require(_0x0d66('0x6'));config[_0x0d66('0x7')]=_[_0x0d66('0x8')](config[_0x0d66('0x7')],{'host':_0x0d66('0x9'),'port':0x18eb});var io=require(_0x0d66('0xa'))(new Redis(config[_0x0d66('0x7')]));function getAuthToken(_0x3c5607,_0x58d90a,_0x439c3b){if(_0x3c5607['modernAuthentication']){_0x3c5607[_0x0d66('0xb')]=_0x3c5607[_0x0d66('0xc')][_0x0d66('0xd')];_0x3c5607[_0x0d66('0xe')]=_0x3c5607['CloudProvider']['data2'];return Promise[_0x0d66('0xf')](_0x3c5607['CloudProvider'][_0x0d66('0x10')]);}var _0x4f8093={'method':_0x0d66('0x11'),'uri':_0x58d90a,'form':{'client_id':_0x3c5607[_0x0d66('0x12')],'resource':_0x3c5607[_0x0d66('0xb')],'username':_0x3c5607[_0x0d66('0x13')],'password':_0x3c5607[_0x0d66('0x14')],'grant_type':_0x0d66('0x14'),'client_secret':_0x3c5607['clientSecret']},'json':!![]};return rp(_0x4f8093)[_0x0d66('0x15')](function(_0x430c44){return _0x430c44['access_token'];})[_0x0d66('0x16')](function(_0x4dcadc){logger['error']('['+[_0x439c3b[_0x0d66('0x17')]()]+']\x20Wrong\x20credentials!');return _0x4dcadc[_0x0d66('0x18')];});}function getUser(_0x3d9770,_0x278b58,_0x70eeca,_0x761d6b,_0x3a3a48,_0x368fdd){return new Promise(function(_0x2fdd66,_0x250e9e){return getAuthToken(_0x278b58,_0x761d6b,_0x368fdd)['then'](function(_0x1ee1c6){var _0x41b129={'method':_0x0d66('0x19'),'uri':_0x3a3a48+_0x0d66('0x1a'),'headers':{'Authorization':_0x0d66('0x1b')+_0x1ee1c6,'OData-Version':_0x0d66('0x1c')},'json':!![]};return rp(_0x41b129);})[_0x0d66('0x15')](function(_0x523ac9){var _0x1dbd95=_0x523ac9['value'];var _0x40cd41=![];var _0xd08ec0=null;if(!_['isNil'](_0x70eeca)){if(intUtil['validateEmail'](_0x70eeca[_0x0d66('0x1d')])){_0x3d9770[_0x0d66('0x1e')]=_0x70eeca['email'];for(_0xd08ec0=0x0;_0xd08ec0<_0x1dbd95[_0x0d66('0x1f')];_0xd08ec0++){if(_0x1dbd95[_0xd08ec0]['internalemailaddress']===_0x70eeca['email']&&!_0x1dbd95[_0xd08ec0][_0x0d66('0x20')]){_0x40cd41=!![];logger[_0x0d66('0x21')]('['+[_0x368fdd[_0x0d66('0x17')]()]+_0x0d66('0x22')+_0x1dbd95[_0xd08ec0][_0x0d66('0x23')]+'!');_0x3d9770[_0x0d66('0x24')]=_0x1dbd95[_0xd08ec0]['systemuserid'];}}}}if(!_0x40cd41){logger[_0x0d66('0x21')]('['+[_0x368fdd[_0x0d66('0x17')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x3d9770['userEmail']=_0x278b58[_0x0d66('0x13')];for(_0xd08ec0=0x0;_0xd08ec0<_0x1dbd95[_0x0d66('0x1f')];_0xd08ec0++){if(_0x1dbd95[_0xd08ec0][_0x0d66('0x25')]===_0x278b58['username']){_0x3d9770[_0x0d66('0x24')]=_0x1dbd95[_0xd08ec0][_0x0d66('0x23')];}}}_0x2fdd66(_0x3d9770);})['catch'](function(_0x42d9ce){_0x250e9e(_0x42d9ce['message']);});});}function createEndUser(_0x3d53ad,_0x53a818,_0x5236dc,_0x5d1e0e,_0x517ec8,_0x1b6ed7,_0x3b1467){return new Promise(function(_0x4095cf,_0x3a846a){return getAuthToken(_0x53a818,_0x5236dc,_0x1b6ed7)[_0x0d66('0x15')](function(_0x40349d){var _0x23173b=_0x1b6ed7[_0x0d66('0x26')]()===_0x0d66('0x27')?_0x517ec8['destcalleridnum']:_0x517ec8[_0x0d66('0x28')];var _0x309364={'method':'POST','uri':_0x5d1e0e+'contacts','body':{'fullname':_0x23173b,'firstname':_0x23173b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x0d66('0x29')+_0x3d53ad[_0x0d66('0x24')]+')'},'headers':{'Authorization':_0x0d66('0x1b')+_0x40349d,'OData-Version':_0x0d66('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x309364[_0x0d66('0x2a')][_0x3b1467]=_0x23173b;return rp(_0x309364);})['then'](function(_0x5c1ad5){var _0xf90c8e=_0x5c1ad5[_0x0d66('0x2b')][_0x0d66('0x2c')];var _0x5c152c=_0xf90c8e['substring'](_0xf90c8e['lastIndexOf']('(')+0x1,_0xf90c8e[_0x0d66('0x2d')](')'));_0x3d53ad[_0x0d66('0x2e')]=_0x5c152c;_0x4095cf(_0x3d53ad);})['catch'](function(_0x47175c){_0x3a846a(_0x47175c[_0x0d66('0x18')]);});});}function getEndUser(_0x359504,_0x56928f,_0x35bc20,_0x46807a,_0x23190e,_0x4f6736,_0x54ca19,_0x5321b2){var _0x10537e=_0x4f6736[_0x0d66('0x26')]()===_0x0d66('0x27')?_0x23190e[_0x0d66('0x2f')]:_0x23190e['calleridnum'];return getAuthToken(_0x56928f,_0x35bc20,_0x4f6736)[_0x0d66('0x15')](function(_0x3034af){_0x5321b2=_0x5321b2?_0x5321b2:_0x0d66('0x30');var _0x3c1301={'method':_0x0d66('0x19'),'uri':_0x46807a+_0x0d66('0x31')+_0x5321b2+'&$filter='+_0x5321b2+'\x20eq\x20\x27'+_0x10537e[_0x0d66('0x32')]('+',_0x0d66('0x33'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x3034af,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3c1301);})[_0x0d66('0x15')](function(_0x17b893){var _0x304277=![];if(!_0x17b893)return _0x304277;var _0x32cd97=_0x17b893['value'];for(var _0x335177=0x0;_0x335177<_0x32cd97[_0x0d66('0x1f')];_0x335177++){if(_0x32cd97[_0x335177][_0x5321b2]===_0x10537e){_0x304277=!![];_0x359504['enduserId']=_0x32cd97[_0x335177][_0x0d66('0x34')];}}return _0x304277;})[_0x0d66('0x15')](function(_0x24e01a){if(_0x24e01a)return _0x359504;if(_0x54ca19===_0x0d66('0x35')){logger[_0x0d66('0x21')]('['+[_0x4f6736[_0x0d66('0x17')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x359504;}return createEndUser(_0x359504,_0x56928f,_0x35bc20,_0x46807a,_0x23190e,_0x4f6736,_0x5321b2)[_0x0d66('0x15')](function(_0x4f864f){logger[_0x0d66('0x21')]('['+[_0x4f6736[_0x0d66('0x17')]()]+_0x0d66('0x36'),_0x4f864f[_0x0d66('0x2e')]);return _0x4f864f;});});}function getCustomFields(_0x3563d8,_0x204342,_0x90a81c){var _0x5e513d={};if(_0x3563d8['length']>0x0){_[_0x0d66('0x37')](_0x3563d8,function(_0x55c2d9){if(_[_0x0d66('0x38')]([_0x0d66('0x39'),_0x0d66('0x3a')],_0x55c2d9[_0x0d66('0x3b')])&&_0x55c2d9[_0x0d66('0x3c')]&&!_0x55c2d9[_0x0d66('0x3d')]){var _0xbd52cf=_0x55c2d9[_0x0d66('0x3e')]['toLowerCase']();var _0x1fd114=_0xbd52cf[_0x0d66('0x3f')](0x0,_0xbd52cf[_0x0d66('0x40')]('_'));var _0x161d83=_0xbd52cf[_0x0d66('0x3f')](_0xbd52cf[_0x0d66('0x40')]('_')+0x1);if(_0x1fd114===_0x90a81c){_0x5e513d[_0x161d83]=_0x55c2d9['content'];}}});}return _0x5e513d;}function getTicket(_0x5da665,_0x1158d9,_0x351f3a,_0x8e9f52,_0x53e558,_0x115e32,_0x249fbd){return new Promise(function(_0x58400a,_0x21170d){var _0x30f29a;return getAuthToken(_0x1158d9,_0x351f3a,_0x249fbd)[_0x0d66('0x15')](function(_0x5afc35){if(_0x115e32[_0x0d66('0x41')]===_0x0d66('0x42')){_0x30f29a={'method':_0x0d66('0x11'),'uri':_0x8e9f52+_0x0d66('0x43'),'body':Object[_0x0d66('0x44')]({},{'title':intUtil['getString'](_0x115e32[_0x0d66('0x45')],_0x53e558,'\x20'),'description':intUtil[_0x0d66('0x46')](_0x115e32['Descriptions'],_0x53e558,'\x0a'),'customerid_contact@odata.bind':_0x5da665['enduserId']?_0x0d66('0x47')+_0x5da665['enduserId']+')':undefined,'ownerid@odata.bind':_0x0d66('0x29')+_0x5da665['userId']+')','caseorigincode':'1'},getCustomFields(_0x115e32[_0x0d66('0x48')],_0x53e558,_0x115e32['ticketType'])),'headers':{'Authorization':_0x0d66('0x1b')+_0x5afc35,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x115e32[_0x0d66('0x41')]===_0x0d66('0x49')){var _0x862ba3=_0x5da665[_0x0d66('0x2e')]?[{'partyid_systemuser@odata.bind':_0x0d66('0x29')+_0x5da665[_0x0d66('0x24')]+')','participationtypemask':_0x5da665[_0x0d66('0x4a')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x0d66('0x47')+_0x5da665[_0x0d66('0x2e')]+')','participationtypemask':_0x5da665[_0x0d66('0x4a')]===_0x0d66('0x4b')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x0d66('0x29')+_0x5da665[_0x0d66('0x24')]+')','participationtypemask':_0x5da665[_0x0d66('0x4a')]===_0x0d66('0x4b')?0x2:0x1}];_0x30f29a={'method':'POST','uri':_0x8e9f52+_0x0d66('0x4c'),'body':Object[_0x0d66('0x44')]({},{'subject':intUtil[_0x0d66('0x46')](_0x115e32['Subjects'],_0x53e558,'\x20'),'phonenumber':String(_0x53e558[_0x0d66('0x28')]),'description':intUtil[_0x0d66('0x46')](_0x115e32[_0x0d66('0x4d')],_0x53e558,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5da665[_0x0d66('0x2e')]?_0x0d66('0x47')+_0x5da665[_0x0d66('0x2e')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x5da665['userId']+')','directioncode':_0x5da665['callDirection']===_0x0d66('0x4b')?![]:!![],'phonecall_activity_parties':_0x862ba3},getCustomFields(_0x115e32[_0x0d66('0x48')],_0x53e558,_0x115e32['ticketType'])),'headers':{'Authorization':_0x0d66('0x1b')+_0x5afc35,'OData-Version':_0x0d66('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x30f29a);})[_0x0d66('0x15')](function(_0x2b0d3c){var _0x38605d=_0x2b0d3c[_0x0d66('0x2b')]['odata-entityid'];var _0x3f0940=_0x38605d[_0x0d66('0x3f')](_0x38605d[_0x0d66('0x2d')]('(')+0x1,_0x38605d[_0x0d66('0x2d')](')'));_0x5da665['ticketId']=_0x3f0940;_0x58400a(_0x5da665);})[_0x0d66('0x16')](function(_0x7af3f1){_0x21170d(_0x7af3f1[_0x0d66('0x18')]);});});}function emit(_0x2624bd,_0x3de6c0,_0x426c5c,_0x2bbdde){var _0x5d4f41={'uri':util[_0x0d66('0x4e')](_0x0d66('0x4f'),_0x2624bd,_0x426c5c,_0x2bbdde)};io['to'](util[_0x0d66('0x4e')](_0x0d66('0x50'),_0x3de6c0))[_0x0d66('0x51')](_0x0d66('0x52'),_0x5d4f41);}exports['cs']=function(_0x25c341,_0x3bb2ab,_0x2a6c95,_0x17783e,_0x3a5be9,_0xfcfb89,_0xcb2c7e,_0x160619){var _0x427ac9={};_0xfcfb89[_0x0d66('0xb')]=_0xfcfb89[_0x0d66('0x53')]?intUtil[_0x0d66('0x54')](_0xfcfb89[_0x0d66('0xc')][_0x0d66('0xd')]):intUtil[_0x0d66('0x54')](_0xfcfb89['remoteUri']);_0xfcfb89[_0x0d66('0x55')]=intUtil['stripTrailingSlash'](_0xfcfb89[_0x0d66('0x55')]);_0x427ac9[_0x0d66('0x4a')]=_0x160619===_0x0d66('0x4b')||_0x160619===_0x0d66('0x56')?'queue':_0x0d66('0x27');var _0x46d6b0=_0xfcfb89['modernAuthentication']?util[_0x0d66('0x4e')](_0x0d66('0x57'),_0xfcfb89[_0x0d66('0xc')][_0x0d66('0xd')]):util[_0x0d66('0x4e')](_0x0d66('0x57'),_0xfcfb89[_0x0d66('0xb')]);var _0x18bfdd=util[_0x0d66('0x4e')]('https://login.microsoftonline.com/%s/oauth2/token',_0xfcfb89[_0x0d66('0xe')]);var _0xc6b943=util[_0x0d66('0x4e')](_0x0d66('0x58'),_0xfcfb89[_0x0d66('0x55')],_0x3bb2ab[_0x0d66('0x59')],md5(_0x3bb2ab[_0x0d66('0x59')]));if(_0x3a5be9&&_0x3a5be9[_0x0d66('0x5a')]){logger[_0x0d66('0x21')](_0x0d66('0x5b'),'Recording\x20is\x20enabled!');_0x3bb2ab[_0x0d66('0x5c')]=_0xc6b943;}else if(_0xcb2c7e&&_0xcb2c7e[_0x0d66('0x5d')]&&_0xcb2c7e['recordingFormat']!==_0x0d66('0x5e')){logger[_0x0d66('0x21')](_0x0d66('0x5f'),_0x0d66('0x60'));_0x3bb2ab[_0x0d66('0x5c')]=_0xc6b943;}else{_0x3bb2ab[_0x0d66('0x5c')]='';}return getUser(_0x427ac9,_0xfcfb89,_0x17783e,_0x18bfdd,_0x46d6b0,_0x160619)['then'](function(_0x5c9cb7){logger[_0x0d66('0x21')]('['+_0x160619[_0x0d66('0x17')]()+']\x20The\x20User\x20ID\x20is:',_0x5c9cb7[_0x0d66('0x24')]);logger['info']('['+_0x160619[_0x0d66('0x17')]()+_0x0d66('0x61'),_0x5c9cb7[_0x0d66('0x1e')]);return getEndUser(_0x5c9cb7,_0xfcfb89,_0x18bfdd,_0x46d6b0,_0x3bb2ab,_0x160619,_0x2a6c95[_0x0d66('0x62')],_0x2a6c95[_0x0d66('0x63')]);})[_0x0d66('0x15')](function(_0x43fbbd){logger[_0x0d66('0x21')]('['+_0x160619['toUpperCase']()+_0x0d66('0x64'),_0x43fbbd['enduserId']);logger[_0x0d66('0x21')]('['+_0x160619[_0x0d66('0x17')]()+_0x0d66('0x65'),_0x3bb2ab['calleridnum']);return getTicket(_0x43fbbd,_0xfcfb89,_0x18bfdd,_0x46d6b0,_0x3bb2ab,_0x2a6c95,_0x160619);})[_0x0d66('0x15')](function(_0x52d012){logger['info'](util['format']('['+_0x160619[_0x0d66('0x17')]()+_0x0d66('0x66'),_0x2a6c95[_0x0d66('0x41')],_0x52d012[_0x0d66('0x67')]));logger[_0x0d66('0x21')](util['format']('['+_0x160619[_0x0d66('0x17')]()+_0x0d66('0x68'),_0x160619));if(_0x160619!==_0x0d66('0x56')&&_0x2a6c95[_0x0d66('0x69')]){logger[_0x0d66('0x21')]('['+_0x160619[_0x0d66('0x17')]()+']',_0x0d66('0x6a'));emit(_0xfcfb89[_0x0d66('0xb')],_0x17783e['name'],_0x2a6c95[_0x0d66('0x41')],_0x52d012['ticketId']);}})['catch'](function(_0x13a79c){logger['error']('['+_0x160619['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x13a79c[_0x0d66('0x18')]);console[_0x0d66('0x6b')](_0x0d66('0x6c'),_0x13a79c);});}; \ 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 1fa42e5..8502d6f 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 _0xdba2=['recordingFormat','none','Recording\x20is\x20enabled!','Authorization','destcalleridname','destcalleridnum','[OUTBOUND]','catch','unmanaged','monitor_format','lastevent','toUpperCase','calleridname','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','Subjects','getString','Descriptions','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','variable','variableName','idField','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound'];(function(_0x359313,_0x318562){var _0x413466=function(_0x9fea0b){while(--_0x9fea0b){_0x359313['push'](_0x359313['shift']());}};_0x413466(++_0x318562);}(_0xdba2,0x195));var _0x2dba=function(_0x34cefa,_0x5ab77b){_0x34cefa=_0x34cefa-0x0;var _0xcef7bc=_0xdba2[_0x34cefa];return _0xcef7bc;};'use strict';var _=require('lodash');var rp=require(_0x2dba('0x0'));var md5=require(_0x2dba('0x1'));var util=require(_0x2dba('0x2'));var Redis=require(_0x2dba('0x3'));var intUtil=require('./util');var config=require(_0x2dba('0x4'));var logger=require(_0x2dba('0x5'))(_0x2dba('0x6'));config[_0x2dba('0x7')]=_[_0x2dba('0x8')](config[_0x2dba('0x7')],{'host':_0x2dba('0x9'),'port':0x18eb});var io=require(_0x2dba('0xa'))(new Redis(config[_0x2dba('0x7')]));var headers={'Content-Type':'application/json','Accept':_0x2dba('0xb')};function emit(_0x23a225,_0x5ca9b8,_0x5496d4){io['to'](_0x23a225)[_0x2dba('0xc')](_0x5ca9b8,_0x5496d4);}function getTicket(_0x25fcea,_0x6e876d,_0x46d2ef,_0x3213b5,_0x2a8c61){logger[_0x2dba('0xd')](_0x2dba('0xe'));var _0x582d91=_[_0x2dba('0xf')]({'responder_id':_0x6e876d['id'],'requester_id':_0x46d2ef['id'],'name':util[_0x2dba('0x10')](_0x2dba('0x11'),_0x2a8c61['calleridname']),'phone':_0x2a8c61['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3213b5[_0x2dba('0x12')],_0x2a8c61,'\x20'),'description':intUtil[_0x2dba('0x13')](_0x3213b5[_0x2dba('0x14')],_0x2a8c61,'
'),'tags':getTags(_0x3213b5[_0x2dba('0x15')],_0x2dba('0x16'))},getCustomFields(_0x3213b5[_0x2dba('0x17')],_0x2a8c61));_0x582d91[_0x2dba('0x18')]=_[_0x2dba('0x19')](_[_0x2dba('0x1a')](_0x582d91[_0x2dba('0x18')],'id'),_0x2dba('0x1b'));return request({'uri':util['format'](_0x2dba('0x1c'),_0x25fcea['remoteUri']),'method':_0x2dba('0x1d'),'body':_0x582d91})[_0x2dba('0x1e')](function(_0x5e6740){logger['info'](_0x2dba('0x1f'));return _0x5e6740;});}function getUser(_0x1e211a,_0x213a55){if(intUtil[_0x2dba('0x20')](_0x213a55)){return request({'uri':util[_0x2dba('0x10')](_0x2dba('0x21'),_0x1e211a[_0x2dba('0x22')]),'qs':{'email':_0x213a55}})[_0x2dba('0x1e')](function(_0x3be874){if(_0x3be874[_0x2dba('0x23')]){logger[_0x2dba('0xd')](_0x2dba('0x24'));return _[_0x2dba('0x25')](_0x3be874,function(_0x435469){return _0x435469[_0x2dba('0x26')][_0x2dba('0x27')]===_0x213a55;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x2dba('0x28'),_0x1e211a[_0x2dba('0x22')])})[_0x2dba('0x1e')](function(_0x13fa87){logger['info']('Admin\x20account\x20selected.');return _0x13fa87;});}});}else{logger[_0x2dba('0xd')](_0x2dba('0x29'));return request({'uri':util['format'](_0x2dba('0x28'),_0x1e211a[_0x2dba('0x22')])})[_0x2dba('0x1e')](function(_0x4e5eb8){logger['info']('Admin\x20account\x20selected.');return _0x4e5eb8;});}}function getEndUser(_0x327b7a,_0xd3e23a,_0x5ac795){logger[_0x2dba('0xd')](_0x2dba('0x2a'),_0x5ac795);return request({'uri':util['format'](_0x2dba('0x2b'),_0x327b7a[_0x2dba('0x22')]),'qs':{'phone':_0x5ac795}})['then'](function(_0x574d94){if(_0x574d94[_0x2dba('0x23')]){logger[_0x2dba('0xd')](_0x2dba('0x2c'));return _['find'](_0x574d94,{'phone':_0x5ac795});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x2dba('0x2b'),_0x327b7a[_0x2dba('0x22')]),'method':_0x2dba('0x1d'),'body':{'name':_0xd3e23a,'phone':_0x5ac795}})[_0x2dba('0x1e')](function(_0x40b90d){logger['info'](_0x2dba('0x2d'));return _0x40b90d;});}});}function getAuth(_0x17d45c){return util[_0x2dba('0x10')](_0x2dba('0x2e'),new Buffer(_0x17d45c[_0x2dba('0x2f')]+':X')['toString'](_0x2dba('0x30')));}function request(_0xbf358c){logger[_0x2dba('0x31')](_0x2dba('0x32'),JSON[_0x2dba('0x33')](_0xbf358c));return rp(_[_0x2dba('0x8')](_0xbf358c,{'method':_0x2dba('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x2dac32,_0x27afb3){var _0x1341a0=[];if(_0x2dac32&&_0x2dac32[_0x2dba('0x23')]>0x0){_0x1341a0=_[_0x2dba('0x35')](_0x2dac32,_0x27afb3);}return _0x1341a0;}function getCustomFields(_0x4aab0f,_0x127049){var _0x528159=[];var _0x2d5bd8={'custom_fields':[]};if(_0x4aab0f[_0x2dba('0x23')]>0x0){_[_0x2dba('0x36')](_0x4aab0f,function(_0x3d2670){if(_[_0x2dba('0x37')]([_0x2dba('0x38'),_0x2dba('0x39')],_0x3d2670[_0x2dba('0x3a')])&&_0x3d2670[_0x2dba('0x3b')]&&!_0x3d2670[_0x2dba('0x3c')]){_0x2d5bd8[_0x3d2670['nameField'][_0x2dba('0x3d')]()]=_0x3d2670[_0x2dba('0x3e')][_0x2dba('0x3f')]();}else if(_[_0x2dba('0x37')]([_0x2dba('0x38'),_0x2dba('0x39')],_0x3d2670[_0x2dba('0x3a')])&&_0x3d2670['idField']&&_0x3d2670['customField']){_0x2d5bd8['custom_fields']['push']({'id':_0x3d2670['idField'],'value':_0x3d2670[_0x2dba('0x3e')][_0x2dba('0x3f')]()});}else if(_0x3d2670[_0x2dba('0x3a')]===_0x2dba('0x40')&&_0x3d2670[_0x2dba('0x41')]&&_0x3d2670[_0x2dba('0x42')]&&_0x3d2670['customField']){_0x127049[_0x3d2670[_0x2dba('0x41')]]&&_0x2d5bd8[_0x2dba('0x18')][_0x2dba('0x43')]({'id':_0x3d2670[_0x2dba('0x42')],'value':_0x127049[_0x3d2670[_0x2dba('0x41')]][_0x2dba('0x3f')]()});}else if(_0x3d2670[_0x2dba('0x3a')]===_0x2dba('0x44')&&_0x3d2670['Variable']&&_0x3d2670[_0x2dba('0x45')]['name']&&_0x3d2670[_0x2dba('0x42')]&&_0x3d2670[_0x2dba('0x3c')]){_0x127049[_0x3d2670['Variable'][_0x2dba('0x16')][_0x2dba('0x3d')]()]&&_0x2d5bd8[_0x2dba('0x18')][_0x2dba('0x43')]({'id':_0x3d2670[_0x2dba('0x42')],'value':_0x127049[_0x3d2670[_0x2dba('0x45')][_0x2dba('0x16')]['toLowerCase']()][_0x2dba('0x3f')]()});}});}return _0x2d5bd8;}exports[_0x2dba('0x46')]=function(_0x4bb122,_0x52af9d,_0x4cb919,_0x1f83bc,_0x83e9ff,_0x377a47){var _0x22d36a,_0x47fe6d;_0x377a47['remoteUri']=intUtil[_0x2dba('0x47')](_0x377a47[_0x2dba('0x22')]);_0x377a47[_0x2dba('0x48')]=intUtil[_0x2dba('0x47')](_0x377a47['serverUrl']);if(_0x83e9ff&&_0x83e9ff['monitor_format']){logger['info'](_0x2dba('0x49'),'Recording\x20is\x20enabled!');_0x52af9d['recordingURL']=util['format'](_0x2dba('0x4a'),_0x377a47[_0x2dba('0x48')],_0x52af9d['uniqueid'],md5(_0x52af9d[_0x2dba('0x4b')]));}else{_0x52af9d[_0x2dba('0x4c')]='';}headers['Authorization']=getAuth(_0x377a47);return getUser(_0x377a47,_0x1f83bc[_0x2dba('0x27')])['then'](function(_0x11f0ed){_0x22d36a=_0x11f0ed;logger[_0x2dba('0xd')](_0x2dba('0x4d'),_0x22d36a['id']);return getEndUser(_0x377a47,_0x52af9d['calleridname'],_0x52af9d[_0x2dba('0x4e')]);})['then'](function(_0x1cec2f){_0x47fe6d=_0x1cec2f;logger[_0x2dba('0xd')](_0x2dba('0x4f'),_0x47fe6d['id']);return getTicket(_0x377a47,_0x22d36a,_0x47fe6d,_0x4cb919,_0x52af9d);})[_0x2dba('0x1e')](function(_0x23ee10){if(_0x23ee10&&_0x23ee10['id']){logger[_0x2dba('0xd')](_0x2dba('0x1f'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x23ee10['id']);logger[_0x2dba('0xd')](_0x2dba('0x49'),_0x2dba('0x50'));emit(util[_0x2dba('0x10')](_0x2dba('0x51'),_0x1f83bc[_0x2dba('0x16')]),_0x2dba('0x52'),{'uri':util[_0x2dba('0x10')](_0x2dba('0x53'),_0x377a47[_0x2dba('0x22')],_0x23ee10['id'])});}})['catch'](function(_0x5f0052){logger['error'](_0x2dba('0x49'),JSON[_0x2dba('0x33')](_0x5f0052));});};exports[_0x2dba('0x54')]=function(_0x5b82aa,_0x42616b,_0x3e914c,_0x4d989d,_0x242e74,_0x3d7bd0,_0x4f4a20){var _0x34aaae,_0x4b26e7;_0x3d7bd0[_0x2dba('0x22')]=intUtil[_0x2dba('0x47')](_0x3d7bd0[_0x2dba('0x22')]);_0x3d7bd0[_0x2dba('0x48')]=intUtil[_0x2dba('0x47')](_0x3d7bd0['serverUrl']);if(_0x4f4a20&&_0x4f4a20['recordingFormat']&&_0x4f4a20[_0x2dba('0x55')]!==_0x2dba('0x56')){logger[_0x2dba('0xd')]('[OUTBOUND]',_0x2dba('0x57'));_0x42616b[_0x2dba('0x4c')]=util[_0x2dba('0x10')](_0x2dba('0x4a'),_0x3d7bd0[_0x2dba('0x48')],_0x42616b[_0x2dba('0x4b')],md5(_0x42616b['uniqueid']));}headers[_0x2dba('0x58')]=getAuth(_0x3d7bd0);return getUser(_0x3d7bd0,_0x4d989d[_0x2dba('0x27')])['then'](function(_0x525d68){_0x34aaae=_0x525d68;logger[_0x2dba('0xd')](_0x2dba('0x4d'),_0x34aaae['id']);return getEndUser(_0x3d7bd0,_0x42616b[_0x2dba('0x59')],_0x42616b[_0x2dba('0x5a')]);})[_0x2dba('0x1e')](function(_0x1d3588){_0x4b26e7=_0x1d3588;logger['info'](_0x2dba('0x4f'),_0x4b26e7['id']);return getTicket(_0x3d7bd0,_0x34aaae,_0x4b26e7,_0x3e914c,_0x42616b);})[_0x2dba('0x1e')](function(_0x43a1db){if(_0x43a1db&&_0x43a1db['id']){logger[_0x2dba('0xd')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x43a1db['id']);logger[_0x2dba('0xd')](_0x2dba('0x5b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2dba('0x10')](_0x2dba('0x51'),_0x4d989d[_0x2dba('0x16')]),_0x2dba('0x52'),{'uri':util[_0x2dba('0x10')](_0x2dba('0x53'),_0x3d7bd0[_0x2dba('0x22')],_0x43a1db['id'])});}})[_0x2dba('0x5c')](function(_0x5ed938){logger['error'](_0x2dba('0x5b'),JSON['stringify'](_0x5ed938));});};exports[_0x2dba('0x5d')]=function(_0xe58f4,_0x4ea616,_0x4ceebf,_0x1a189a,_0x4a2ecf,_0x3c41fb){var _0x50cc9c,_0x1bb90b;_0x3c41fb['remoteUri']=intUtil['stripTrailingSlash'](_0x3c41fb[_0x2dba('0x22')]);_0x3c41fb[_0x2dba('0x48')]=intUtil[_0x2dba('0x47')](_0x3c41fb[_0x2dba('0x48')]);if(_0x4a2ecf&&_0x4a2ecf[_0x2dba('0x5e')]){logger['info']('['+_0x4ea616[_0x2dba('0x5f')][_0x2dba('0x60')]()+']',_0x2dba('0x57'));_0x4ea616['recordingURL']=util['format'](_0x2dba('0x4a'),_0x3c41fb['serverUrl'],_0x4ea616[_0x2dba('0x4b')],md5(_0x4ea616[_0x2dba('0x4b')]));}else{_0x4ea616[_0x2dba('0x4c')]='';}headers[_0x2dba('0x58')]=getAuth(_0x3c41fb);return getUser(_0x3c41fb,'')[_0x2dba('0x1e')](function(_0xb44241){_0x50cc9c=_0xb44241;logger[_0x2dba('0xd')]('The\x20User\x20ID\x20is:',_0x50cc9c['id']);return getEndUser(_0x3c41fb,_0x4ea616[_0x2dba('0x61')],_0x4ea616[_0x2dba('0x4e')]);})[_0x2dba('0x1e')](function(_0x36e00e){_0x1bb90b=_0x36e00e;logger[_0x2dba('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1bb90b['id']);return getTicket(_0x3c41fb,_0x50cc9c,_0x1bb90b,_0x4ceebf,_0x4ea616);})[_0x2dba('0x1e')](function(_0x36426c){if(_0x36426c){logger[_0x2dba('0xd')](_0x2dba('0x1f'));logger[_0x2dba('0xd')]('The\x20Ticket\x20ID\x20is:',_0x36426c['id']);}})[_0x2dba('0x5c')](function(_0x408d1a){logger['error']('['+_0x4ea616[_0x2dba('0x5f')]['toUpperCase']()+']',JSON[_0x2dba('0x33')](_0x408d1a));});}; \ No newline at end of file +var _0x3079=['Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','toString','base64','debug','GET','map','includes','string','nameField','customField','toLowerCase','content','picklist','type','idField','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','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','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','getString','Subjects','
','Tags','name','custom_fields','mapValues','keyBy','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3079,0x90));var _0x9307=function(_0x5ee21d,_0x163480){_0x5ee21d=_0x5ee21d-0x0;var _0x442f38=_0x3079[_0x5ee21d];return _0x442f38;};'use strict';var _=require(_0x9307('0x0'));var rp=require(_0x9307('0x1'));var md5=require(_0x9307('0x2'));var util=require(_0x9307('0x3'));var Redis=require(_0x9307('0x4'));var intUtil=require(_0x9307('0x5'));var config=require(_0x9307('0x6'));var logger=require('../../../../config/logger')(_0x9307('0x7'));config[_0x9307('0x8')]=_[_0x9307('0x9')](config['redis'],{'host':_0x9307('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x9307('0xb'),'Accept':_0x9307('0xb')};function emit(_0x2c16aa,_0x18cee3,_0x2b70d5){io['to'](_0x2c16aa)[_0x9307('0xc')](_0x18cee3,_0x2b70d5);}function getTicket(_0x586b34,_0x2279fe,_0x4b5478,_0x3e110f,_0x2c9ec4){logger[_0x9307('0xd')](_0x9307('0xe'));var _0x1fc6b6=_[_0x9307('0xf')]({'responder_id':_0x2279fe['id'],'requester_id':_0x4b5478['id'],'name':util['format'](_0x9307('0x10'),_0x2c9ec4[_0x9307('0x11')]),'phone':_0x2c9ec4['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x9307('0x12')](_0x3e110f[_0x9307('0x13')],_0x2c9ec4,'\x20'),'description':intUtil[_0x9307('0x12')](_0x3e110f['Descriptions'],_0x2c9ec4,_0x9307('0x14')),'tags':getTags(_0x3e110f[_0x9307('0x15')],_0x9307('0x16'))},getCustomFields(_0x3e110f['Fields'],_0x2c9ec4));_0x1fc6b6[_0x9307('0x17')]=_[_0x9307('0x18')](_[_0x9307('0x19')](_0x1fc6b6[_0x9307('0x17')],'id'),'value');return request({'uri':util[_0x9307('0x1a')](_0x9307('0x1b'),_0x586b34[_0x9307('0x1c')]),'method':_0x9307('0x1d'),'body':_0x1fc6b6})[_0x9307('0x1e')](function(_0x46218f){logger[_0x9307('0xd')](_0x9307('0x1f'));return _0x46218f;});}function getUser(_0x36fec2,_0x3f85da){if(intUtil[_0x9307('0x20')](_0x3f85da)){return request({'uri':util[_0x9307('0x1a')](_0x9307('0x21'),_0x36fec2[_0x9307('0x1c')]),'qs':{'email':_0x3f85da}})[_0x9307('0x1e')](function(_0xa7782a){if(_0xa7782a[_0x9307('0x22')]){logger[_0x9307('0xd')](_0x9307('0x23'));return _[_0x9307('0x24')](_0xa7782a,function(_0x1140cd){return _0x1140cd['contact'][_0x9307('0x25')]===_0x3f85da;});}else{logger['info'](_0x9307('0x26'));return request({'uri':util[_0x9307('0x1a')](_0x9307('0x27'),_0x36fec2[_0x9307('0x1c')])})['then'](function(_0x56ed5b){logger[_0x9307('0xd')](_0x9307('0x28'));return _0x56ed5b;});}});}else{logger[_0x9307('0xd')](_0x9307('0x29'));return request({'uri':util['format'](_0x9307('0x27'),_0x36fec2[_0x9307('0x1c')])})[_0x9307('0x1e')](function(_0x57ca38){logger[_0x9307('0xd')](_0x9307('0x28'));return _0x57ca38;});}}function getEndUser(_0x2c1fad,_0x41fdd4,_0x128138){logger[_0x9307('0xd')]('Searching\x20enduser\x20with\x20phone',_0x128138);return request({'uri':util[_0x9307('0x1a')](_0x9307('0x2a'),_0x2c1fad[_0x9307('0x1c')]),'qs':{'phone':_0x128138}})[_0x9307('0x1e')](function(_0x435f77){if(_0x435f77[_0x9307('0x22')]){logger[_0x9307('0xd')](_0x9307('0x2b'));return _['find'](_0x435f77,{'phone':_0x128138});}else{logger['info'](_0x9307('0x2c'));return request({'uri':util[_0x9307('0x1a')](_0x9307('0x2a'),_0x2c1fad['remoteUri']),'method':_0x9307('0x1d'),'body':{'name':_0x41fdd4,'phone':_0x128138}})[_0x9307('0x1e')](function(_0x360cbe){logger[_0x9307('0xd')]('Enduser\x20created.');return _0x360cbe;});}});}function getAuth(_0x3aec2f){return util[_0x9307('0x1a')]('Basic\x20%s',new Buffer(_0x3aec2f[_0x9307('0x2d')]+':X')[_0x9307('0x2e')](_0x9307('0x2f')));}function request(_0x57cf28){logger[_0x9307('0x30')]('[HTTP]',JSON['stringify'](_0x57cf28));return rp(_[_0x9307('0x9')](_0x57cf28,{'method':_0x9307('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x559a54,_0xc8c8fb){var _0x2a36d7=[];if(_0x559a54&&_0x559a54[_0x9307('0x22')]>0x0){_0x2a36d7=_[_0x9307('0x32')](_0x559a54,_0xc8c8fb);}return _0x2a36d7;}function getCustomFields(_0xb3251a,_0x117b23){var _0x7d86e5=[];var _0x397660={'custom_fields':[]};if(_0xb3251a[_0x9307('0x22')]>0x0){_['forEach'](_0xb3251a,function(_0x33fce0){if(_[_0x9307('0x33')]([_0x9307('0x34'),'picklist'],_0x33fce0['type'])&&_0x33fce0[_0x9307('0x35')]&&!_0x33fce0[_0x9307('0x36')]){_0x397660[_0x33fce0[_0x9307('0x35')][_0x9307('0x37')]()]=_0x33fce0[_0x9307('0x38')][_0x9307('0x2e')]();}else if(_['includes']([_0x9307('0x34'),_0x9307('0x39')],_0x33fce0[_0x9307('0x3a')])&&_0x33fce0[_0x9307('0x3b')]&&_0x33fce0['customField']){_0x397660[_0x9307('0x17')][_0x9307('0x3c')]({'id':_0x33fce0['idField'],'value':_0x33fce0[_0x9307('0x38')][_0x9307('0x2e')]()});}else if(_0x33fce0[_0x9307('0x3a')]==='variable'&&_0x33fce0[_0x9307('0x3d')]&&_0x33fce0['idField']&&_0x33fce0[_0x9307('0x36')]){_0x117b23[_0x33fce0[_0x9307('0x3d')]]&&_0x397660['custom_fields'][_0x9307('0x3c')]({'id':_0x33fce0[_0x9307('0x3b')],'value':_0x117b23[_0x33fce0[_0x9307('0x3d')]][_0x9307('0x2e')]()});}else if(_0x33fce0[_0x9307('0x3a')]===_0x9307('0x3e')&&_0x33fce0[_0x9307('0x3f')]&&_0x33fce0[_0x9307('0x3f')]['name']&&_0x33fce0[_0x9307('0x3b')]&&_0x33fce0['customField']){_0x117b23[_0x33fce0['Variable'][_0x9307('0x16')][_0x9307('0x37')]()]&&_0x397660[_0x9307('0x17')][_0x9307('0x3c')]({'id':_0x33fce0['idField'],'value':_0x117b23[_0x33fce0[_0x9307('0x3f')][_0x9307('0x16')][_0x9307('0x37')]()][_0x9307('0x2e')]()});}});}return _0x397660;}exports[_0x9307('0x40')]=function(_0x4ea0d1,_0xe2fd49,_0x3d8e97,_0x26e815,_0x2a7284,_0x987bc1){var _0x58ce06,_0x15153e;_0x987bc1[_0x9307('0x1c')]=intUtil[_0x9307('0x41')](_0x987bc1[_0x9307('0x1c')]);_0x987bc1[_0x9307('0x42')]=intUtil['stripTrailingSlash'](_0x987bc1[_0x9307('0x42')]);if(_0x2a7284&&_0x2a7284['monitor_format']){logger[_0x9307('0xd')](_0x9307('0x43'),_0x9307('0x44'));_0xe2fd49[_0x9307('0x45')]=util[_0x9307('0x1a')](_0x9307('0x46'),_0x987bc1[_0x9307('0x42')],_0xe2fd49[_0x9307('0x47')],md5(_0xe2fd49[_0x9307('0x47')]));}else{_0xe2fd49[_0x9307('0x45')]='';}headers[_0x9307('0x48')]=getAuth(_0x987bc1);return getUser(_0x987bc1,_0x26e815['email'])[_0x9307('0x1e')](function(_0x2ae37e){_0x58ce06=_0x2ae37e;logger[_0x9307('0xd')](_0x9307('0x49'),_0x58ce06['id']);return getEndUser(_0x987bc1,_0xe2fd49[_0x9307('0x11')],_0xe2fd49[_0x9307('0x4a')]);})[_0x9307('0x1e')](function(_0x3d6fdf){_0x15153e=_0x3d6fdf;logger[_0x9307('0xd')](_0x9307('0x4b'),_0x15153e['id']);return getTicket(_0x987bc1,_0x58ce06,_0x15153e,_0x3d8e97,_0xe2fd49);})[_0x9307('0x1e')](function(_0x99ab48){if(_0x99ab48&&_0x99ab48['id']){logger[_0x9307('0xd')](_0x9307('0x1f'));logger[_0x9307('0xd')](_0x9307('0x4c'),_0x99ab48['id']);logger['info'](_0x9307('0x43'),_0x9307('0x4d'));emit(util[_0x9307('0x1a')](_0x9307('0x4e'),_0x26e815[_0x9307('0x16')]),_0x9307('0x4f'),{'uri':util[_0x9307('0x1a')](_0x9307('0x50'),_0x987bc1[_0x9307('0x1c')],_0x99ab48['id'])});}})[_0x9307('0x51')](function(_0x4f1e87){logger[_0x9307('0x52')](_0x9307('0x43'),JSON[_0x9307('0x53')](_0x4f1e87));});};exports[_0x9307('0x54')]=function(_0x18535f,_0xbb1313,_0x1d2ed2,_0x300d59,_0x2dda5e,_0x487de3,_0x3d4e42){var _0x583803,_0x70e4c7;_0x487de3[_0x9307('0x1c')]=intUtil['stripTrailingSlash'](_0x487de3[_0x9307('0x1c')]);_0x487de3[_0x9307('0x42')]=intUtil[_0x9307('0x41')](_0x487de3[_0x9307('0x42')]);if(_0x3d4e42&&_0x3d4e42[_0x9307('0x55')]&&_0x3d4e42[_0x9307('0x55')]!==_0x9307('0x56')){logger[_0x9307('0xd')](_0x9307('0x57'),_0x9307('0x44'));_0xbb1313[_0x9307('0x45')]=util[_0x9307('0x1a')](_0x9307('0x46'),_0x487de3[_0x9307('0x42')],_0xbb1313[_0x9307('0x47')],md5(_0xbb1313[_0x9307('0x47')]));}headers[_0x9307('0x48')]=getAuth(_0x487de3);return getUser(_0x487de3,_0x300d59[_0x9307('0x25')])[_0x9307('0x1e')](function(_0x564d13){_0x583803=_0x564d13;logger[_0x9307('0xd')](_0x9307('0x49'),_0x583803['id']);return getEndUser(_0x487de3,_0xbb1313[_0x9307('0x58')],_0xbb1313['destcalleridnum']);})['then'](function(_0x3168c4){_0x70e4c7=_0x3168c4;logger[_0x9307('0xd')](_0x9307('0x4b'),_0x70e4c7['id']);return getTicket(_0x487de3,_0x583803,_0x70e4c7,_0x1d2ed2,_0xbb1313);})[_0x9307('0x1e')](function(_0x179b67){if(_0x179b67&&_0x179b67['id']){logger[_0x9307('0xd')](_0x9307('0x1f'));logger[_0x9307('0xd')](_0x9307('0x4c'),_0x179b67['id']);logger[_0x9307('0xd')](_0x9307('0x57'),_0x9307('0x4d'));emit(util['format']('user:%s',_0x300d59[_0x9307('0x16')]),'trigger:browser:url',{'uri':util['format']('%s/helpdesk/tickets/%d',_0x487de3[_0x9307('0x1c')],_0x179b67['id'])});}})['catch'](function(_0x4d06b4){logger[_0x9307('0x52')]('[OUTBOUND]',JSON[_0x9307('0x53')](_0x4d06b4));});};exports[_0x9307('0x59')]=function(_0x25d160,_0xfbf95b,_0x53fb35,_0x31c0df,_0xa39db8,_0x27ff28){var _0x52dd2e,_0x1e122d;_0x27ff28[_0x9307('0x1c')]=intUtil[_0x9307('0x41')](_0x27ff28[_0x9307('0x1c')]);_0x27ff28['serverUrl']=intUtil['stripTrailingSlash'](_0x27ff28['serverUrl']);if(_0xa39db8&&_0xa39db8['monitor_format']){logger[_0x9307('0xd')]('['+_0xfbf95b[_0x9307('0x5a')][_0x9307('0x5b')]()+']',_0x9307('0x44'));_0xfbf95b[_0x9307('0x45')]=util[_0x9307('0x1a')](_0x9307('0x46'),_0x27ff28[_0x9307('0x42')],_0xfbf95b[_0x9307('0x47')],md5(_0xfbf95b['uniqueid']));}else{_0xfbf95b[_0x9307('0x45')]='';}headers[_0x9307('0x48')]=getAuth(_0x27ff28);return getUser(_0x27ff28,'')[_0x9307('0x1e')](function(_0x25caf9){_0x52dd2e=_0x25caf9;logger[_0x9307('0xd')]('The\x20User\x20ID\x20is:',_0x52dd2e['id']);return getEndUser(_0x27ff28,_0xfbf95b['calleridname'],_0xfbf95b['calleridnum']);})[_0x9307('0x1e')](function(_0xb22603){_0x1e122d=_0xb22603;logger[_0x9307('0xd')](_0x9307('0x4b'),_0x1e122d['id']);return getTicket(_0x27ff28,_0x52dd2e,_0x1e122d,_0x53fb35,_0xfbf95b);})[_0x9307('0x1e')](function(_0x442f38){if(_0x442f38){logger[_0x9307('0xd')](_0x9307('0x1f'));logger[_0x9307('0xd')](_0x9307('0x4c'),_0x442f38['id']);}})[_0x9307('0x51')](function(_0x55dcb1){logger[_0x9307('0x52')]('['+_0xfbf95b[_0x9307('0x5a')][_0x9307('0x5b')]()+']',JSON[_0x9307('0x53')](_0x55dcb1));});}; \ 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 445e35b..11361c6 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 _0xc1b8=['adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','toUpperCase','message','GET','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','email','userId','User\x20found:','userEmail','error','find','contacts','catch','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','add','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','destcalleridnum','unmanaged','queue','outbound','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','ioredis','../../../../config/environment','redis','socket.io-emitter','/api/selector/owners','Getting\x20admin\x20information','then','users','adminEmail'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xc1b8,0x128));var _0x8c1b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xc1b8[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x8c1b('0x0'));var rp=require(_0x8c1b('0x1'));var md5=require(_0x8c1b('0x2'));var util=require('util');var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x8c1b('0x3'));var intUtil=require('./util');var config=require(_0x8c1b('0x4'));var logger=require('../../../../config/logger')('freshsales');config[_0x8c1b('0x5')]=_['defaults'](config[_0x8c1b('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x8c1b('0x6'))(new Redis(config['redis']));function getAdminId(_0x3df475,_0x16661f,_0x2c8a22,_0x1e9afe){return new Promise(function(_0xfb661c,_0x340771){var _0x4ded96=![];var _0x8ffb3f={'method':'GET','uri':_0x1e9afe+_0x8c1b('0x7'),'json':!![]};_0x8ffb3f['headers']=_0x2c8a22;logger['info'](_0x8c1b('0x8'));return rp(_0x8ffb3f)[_0x8c1b('0x9')](function(_0x54a78f){if(_0x54a78f){var _0x50d68b=_0x54a78f[_0x8c1b('0xa')];var _0x18ba47=null;for(_0x18ba47=0x0;_0x18ba47<_0x50d68b['length'];_0x18ba47++){if(_0x50d68b[_0x18ba47]['email']===_0x3df475[_0x8c1b('0xb')]){_0x3df475[_0x8c1b('0xc')]=_0x50d68b[_0x18ba47]['id'];_0x4ded96=!![];}}if(_0x4ded96){logger[_0x8c1b('0xd')](_0x8c1b('0xe'),_0x3df475['adminId']);_0xfb661c(_0x3df475);}else{_0x340771({'statusCode':0x194,'message':_0x8c1b('0xf')});}}else{_0x340771({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x4d3958){logger['error']('['+[_0x16661f[_0x8c1b('0x10')]()]+']',_0x4d3958[_0x8c1b('0x11')]);_0x340771(_0x4d3958);});});}function getUser(_0x495e9c,_0x468ee3,_0x20672c){return function(_0x547faa){return new Promise(function(_0x53322d,_0x1f2ebf){var _0x8c495f={'method':_0x8c1b('0x12'),'uri':_0x20672c+'/api/selector/owners','json':!![]};_0x8c495f['headers']=_0x468ee3;logger['info'](_0x8c1b('0x13'));return rp(_0x8c495f)['then'](function(_0x15e2d3){if(_0x15e2d3){var _0x29b02a=_0x15e2d3[_0x8c1b('0xa')];var _0x36b441=![];var _0x593510=null;if(_0x547faa[_0x8c1b('0x14')]!==null){logger['info'](_0x8c1b('0x15'),_0x547faa[_0x8c1b('0x14')]);_0x547faa['userEmail']=_0x547faa[_0x8c1b('0x14')];for(_0x593510=0x0;_0x593510<_0x29b02a['length'];_0x593510++){if(_0x29b02a[_0x593510][_0x8c1b('0x16')]===_0x547faa[_0x8c1b('0x14')]){_0x36b441=!![];_0x547faa[_0x8c1b('0x17')]=_0x29b02a[_0x593510]['id'];logger[_0x8c1b('0xd')](_0x8c1b('0x18'),_0x547faa[_0x8c1b('0x17')]);}}}if(!_0x36b441){logger['info']('Admin\x20selected');_0x547faa[_0x8c1b('0x19')]=_0x547faa[_0x8c1b('0xb')];_0x547faa[_0x8c1b('0x17')]=_0x547faa[_0x8c1b('0xc')];_0x36b441=!![];}if(_0x36b441){_0x53322d(_0x547faa);}else{_0x1f2ebf({'statusCode':0x194,'message':_0x8c1b('0xf')});}}else{_0x1f2ebf({'statusCode':0x194,'message':_0x8c1b('0xf')});}})['catch'](function(_0x32a3b6){logger[_0x8c1b('0x1a')]('['+[_0x495e9c[_0x8c1b('0x10')]()]+']',_0x32a3b6[_0x8c1b('0x11')]);_0x1f2ebf(_0x32a3b6);});});};}function searchContact(_0x2eb8c3,_0xefe7f8,_0xf7efb4,_0xe5fdbe){return new Promise(function(_0x4dfbd7,_0x14a14c){var _0x56adac={'method':_0x8c1b('0x12'),'headers':_0xefe7f8,'uri':_0x2eb8c3+'/api/lookup?q='+_0xe5fdbe+'&f='+_0xf7efb4+'&entities=contact','json':!![]};rp(_0x56adac)['then'](function(_0xf2488f){var _0x2d103b=_[_0x8c1b('0x1b')](_0xf2488f[_0x8c1b('0x1c')]['contacts'],[_0xf7efb4,_0xe5fdbe]);_0x4dfbd7(_0x2d103b);})[_0x8c1b('0x1d')](function(_0x54a26d){_0x14a14c(_0x54a26d);});});}function getEndUser(_0x336c50,_0x2587d7,_0xc6029f){return function(_0x1ee8c2){return new Promise(function(_0x5eeb6c,_0x511839){logger[_0x8c1b('0xd')](util[_0x8c1b('0x1e')](_0x8c1b('0x1f'),_0x1ee8c2[_0x8c1b('0x20')]));searchContact(_0xc6029f,_0x2587d7,_0x8c1b('0x21'),_0x1ee8c2[_0x8c1b('0x20')])['then'](function(_0x47f475){if(_0x47f475){_0x1ee8c2[_0x8c1b('0x22')]=_0x47f475['id'];logger[_0x8c1b('0xd')](_0x8c1b('0x23'),_0x1ee8c2[_0x8c1b('0x22')]);return _0x5eeb6c(_0x1ee8c2);}searchContact(_0xc6029f,_0x2587d7,'work_number',_0x1ee8c2[_0x8c1b('0x20')])[_0x8c1b('0x9')](function(_0x227187){if(_0x227187){_0x1ee8c2[_0x8c1b('0x22')]=_0x227187['id'];logger['info'](_0x8c1b('0x24'),_0x1ee8c2[_0x8c1b('0x22')]);return _0x5eeb6c(_0x1ee8c2);}createEndUser(_0x1ee8c2,_0x336c50,_0x2587d7,_0xc6029f)[_0x8c1b('0x9')](function(_0x33db5c){logger['info']('Contact\x20created:',_0x33db5c['endUserId']);return _0x5eeb6c(_0x33db5c);});});})[_0x8c1b('0x1d')](function(_0x1d307e){_0x511839(_0x1d307e);});});};}function createEndUser(_0x590ebe,_0x4dcbce,_0x1791cf,_0x201fcf){return new Promise(function(_0x51cd0e,_0x416296){var _0x100ab8=moment();var _0x94f996={'method':_0x8c1b('0x25'),'uri':_0x201fcf+_0x8c1b('0x26'),'body':{'contact':{'last_name':_0x590ebe[_0x8c1b('0x20')],'work_number':_0x590ebe[_0x8c1b('0x20')],'mobile_number':_0x590ebe[_0x8c1b('0x20')],'owner_id':_0x590ebe[_0x8c1b('0x17')],'created_at':_0x100ab8[_0x8c1b('0x1e')](_0x8c1b('0x27'))}},'json':!![]};_0x94f996[_0x8c1b('0x28')]=_0x1791cf;logger[_0x8c1b('0xd')](_0x8c1b('0x29'));return rp(_0x94f996)['then'](function(_0x4faee9){_0x590ebe[_0x8c1b('0x22')]=_0x4faee9[_0x8c1b('0x2a')]['id'];_0x51cd0e(_0x590ebe);})[_0x8c1b('0x1d')](function(_0x5d1fca){logger[_0x8c1b('0x1a')]('['+[_0x4dcbce[_0x8c1b('0x10')]()]+']',_0x5d1fca['message']);_0x416296(_0x5d1fca[_0x8c1b('0x11')]);});});}function getTicket(_0x3a057f,_0x18facd,_0x1c070b,_0x47c250,_0x25946b){return function(_0xeb4cee){logger[_0x8c1b('0xd')](_0x8c1b('0x2b'));return new Promise(function(_0x14945b,_0x4cf80c){var _0x122d9d=moment();var _0x49d79c={'method':_0x8c1b('0x25'),'uri':_0x1c070b+_0x8c1b('0x2c'),'body':{'title':intUtil[_0x8c1b('0x2d')](_0x47c250[_0x8c1b('0x2e')],_0x25946b,'\x20'),'description':intUtil['getString'](_0x47c250[_0x8c1b('0x2f')],_0x25946b,'\x0a'),'owner_id':_0xeb4cee['userId'],'creater_id':_0xeb4cee['adminId'],'targetable_id':_0xeb4cee[_0x8c1b('0x22')],'targetable_type':'Contact','created_at':_0x122d9d[_0x8c1b('0x1e')](_0x8c1b('0x27')),'due_date':_0x122d9d[_0x8c1b('0x30')](0x1e,'m')[_0x8c1b('0x1e')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x49d79c[_0x8c1b('0x28')]=_0x18facd;return rp(_0x49d79c)[_0x8c1b('0x9')](function(_0x341af4){_0xeb4cee['ticketId']=_0x341af4[_0x8c1b('0x31')]['id'];logger[_0x8c1b('0xd')](_0x8c1b('0x32'),_0xeb4cee['ticketId']);_0x14945b(_0xeb4cee);})['catch'](function(_0x11a463){logger['error']('['+[_0x3a057f[_0x8c1b('0x10')]()]+']',_0x11a463['message']);_0x4cf80c(_0x11a463['message']);});});};}function emit(_0x35a6c4,_0x2db531,_0x2573ab){var _0x479ef6={'uri':_0x35a6c4+'/contacts/'+_0x2573ab};io['to'](util[_0x8c1b('0x1e')](_0x8c1b('0x33'),_0x2db531))[_0x8c1b('0x34')](_0x8c1b('0x35'),_0x479ef6);}exports['cs']=function(_0x3a9e31,_0x230180,_0x407d84,_0x5c6d08,_0x44c7f5,_0x49d161,_0x19081f,_0x5c2478){var _0x5d7d24={};var _0x1b62fa={'Authorization':_0x8c1b('0x36')+_0x49d161[_0x8c1b('0x37')]};_0x49d161['remoteUri']=intUtil[_0x8c1b('0x38')](_0x49d161[_0x8c1b('0x39')]);_0x49d161[_0x8c1b('0x3a')]=intUtil[_0x8c1b('0x38')](_0x49d161[_0x8c1b('0x3a')]);var _0x4dedd4=_0x49d161[_0x8c1b('0x39')];_0x5d7d24[_0x8c1b('0xb')]=_0x49d161[_0x8c1b('0x3b')];_0x5d7d24[_0x8c1b('0x20')]=_0x5c2478[_0x8c1b('0x3c')]()==='outbound'?_0x230180[_0x8c1b('0x3d')]:_0x230180['calleridnum'];_0x5d7d24['callDirection']=_0x5c2478==='queue'||_0x5c2478===_0x8c1b('0x3e')?_0x8c1b('0x3f'):_0x8c1b('0x40');if(_0x5c6d08){_0x5d7d24[_0x8c1b('0x14')]=_0x5c6d08[_0x8c1b('0x16')];}var _0x3ec420=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x49d161['serverUrl'],_0x230180[_0x8c1b('0x41')],md5(_0x230180['uniqueid']));if(_0x44c7f5&&_0x44c7f5[_0x8c1b('0x42')]){logger[_0x8c1b('0xd')](_0x8c1b('0x43'),_0x8c1b('0x44'));_0x230180[_0x8c1b('0x45')]=_0x3ec420;}else if(_0x19081f&&_0x19081f[_0x8c1b('0x46')]&&_0x19081f[_0x8c1b('0x46')]!==_0x8c1b('0x47')){logger[_0x8c1b('0xd')](_0x8c1b('0x48'),_0x8c1b('0x44'));_0x230180[_0x8c1b('0x45')]=_0x3ec420;}else{_0x230180[_0x8c1b('0x45')]='';}return getAdminId(_0x5d7d24,_0x5c2478,_0x1b62fa,_0x4dedd4)[_0x8c1b('0x9')](getUser(_0x5c2478,_0x1b62fa,_0x4dedd4))[_0x8c1b('0x9')](getEndUser(_0x5c2478,_0x1b62fa,_0x4dedd4))[_0x8c1b('0x9')](getTicket(_0x5c2478,_0x1b62fa,_0x4dedd4,_0x407d84,_0x230180))[_0x8c1b('0x9')](function(_0x2c4233){logger[_0x8c1b('0xd')](util[_0x8c1b('0x1e')](_0x8c1b('0x49'),_0x2c4233['ticketId']));if(_0x5c2478!==_0x8c1b('0x3e')){logger['info']('['+[_0x5c2478[_0x8c1b('0x10')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x4dedd4,_0x5c6d08[_0x8c1b('0x4a')],_0x2c4233[_0x8c1b('0x22')]);}})[_0x8c1b('0x1d')](function(_0x24d054){logger[_0x8c1b('0x1a')]('['+[_0x5c2478['toUpperCase']()]+_0x8c1b('0x4b'),util[_0x8c1b('0x4c')](_0x24d054,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xbc79=['callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','moment','bluebird','ioredis','../../../../config/environment','freshsales','defaults','redis','localhost','socket.io-emitter','/api/selector/owners','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','toUpperCase','message','GET','headers','info','agentEmail','Getting\x20user\x20with\x20email','email','User\x20found:','userId','userEmail','catch','&f=','&entities=contact','find','contacts','format','contactNumber','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','error','/api/tasks','getString','Subjects','Descriptions','Contact','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum'];(function(_0x31281c,_0x4d29eb){var _0x2c68c6=function(_0x5d042f){while(--_0x5d042f){_0x31281c['push'](_0x31281c['shift']());}};_0x2c68c6(++_0x4d29eb);}(_0xbc79,0x1e9));var _0x9bc7=function(_0xea3922,_0x49ef79){_0xea3922=_0xea3922-0x0;var _0x3b216f=_0xbc79[_0xea3922];return _0x3b216f;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x9bc7('0x0'));var util=require('util');var moment=require(_0x9bc7('0x1'));var Promise=require(_0x9bc7('0x2'));var Redis=require(_0x9bc7('0x3'));var intUtil=require('./util');var config=require(_0x9bc7('0x4'));var logger=require('../../../../config/logger')(_0x9bc7('0x5'));config['redis']=_[_0x9bc7('0x6')](config[_0x9bc7('0x7')],{'host':_0x9bc7('0x8'),'port':0x18eb});var io=require(_0x9bc7('0x9'))(new Redis(config['redis']));function getAdminId(_0x1bb04a,_0x39f836,_0x1abc44,_0x56ae36){return new Promise(function(_0x5abe2f,_0x4b1d83){var _0x3ba042=![];var _0x1d64a1={'method':'GET','uri':_0x56ae36+_0x9bc7('0xa'),'json':!![]};_0x1d64a1['headers']=_0x1abc44;logger['info'](_0x9bc7('0xb'));return rp(_0x1d64a1)[_0x9bc7('0xc')](function(_0x56341e){if(_0x56341e){var _0xa382e2=_0x56341e[_0x9bc7('0xd')];var _0x388470=null;for(_0x388470=0x0;_0x388470<_0xa382e2[_0x9bc7('0xe')];_0x388470++){if(_0xa382e2[_0x388470]['email']===_0x1bb04a[_0x9bc7('0xf')]){_0x1bb04a[_0x9bc7('0x10')]=_0xa382e2[_0x388470]['id'];_0x3ba042=!![];}}if(_0x3ba042){logger['info']('Admin\x20found:',_0x1bb04a[_0x9bc7('0x10')]);_0x5abe2f(_0x1bb04a);}else{_0x4b1d83({'statusCode':0x194,'message':_0x9bc7('0x11')});}}else{_0x4b1d83({'statusCode':0x194,'message':_0x9bc7('0x11')});}})['catch'](function(_0x26cacc){logger['error']('['+[_0x39f836[_0x9bc7('0x12')]()]+']',_0x26cacc[_0x9bc7('0x13')]);_0x4b1d83(_0x26cacc);});});}function getUser(_0x11b136,_0x993d0e,_0x1902bf){return function(_0x1e84f6){return new Promise(function(_0x1a2755,_0x7bb7ce){var _0x4cfbf2={'method':_0x9bc7('0x14'),'uri':_0x1902bf+_0x9bc7('0xa'),'json':!![]};_0x4cfbf2[_0x9bc7('0x15')]=_0x993d0e;logger[_0x9bc7('0x16')]('Getting\x20user\x20list');return rp(_0x4cfbf2)[_0x9bc7('0xc')](function(_0x41ac25){if(_0x41ac25){var _0x445b9a=_0x41ac25['users'];var _0x20a5db=![];var _0x3bef86=null;if(_0x1e84f6[_0x9bc7('0x17')]!==null){logger[_0x9bc7('0x16')](_0x9bc7('0x18'),_0x1e84f6[_0x9bc7('0x17')]);_0x1e84f6['userEmail']=_0x1e84f6[_0x9bc7('0x17')];for(_0x3bef86=0x0;_0x3bef86<_0x445b9a[_0x9bc7('0xe')];_0x3bef86++){if(_0x445b9a[_0x3bef86][_0x9bc7('0x19')]===_0x1e84f6[_0x9bc7('0x17')]){_0x20a5db=!![];_0x1e84f6['userId']=_0x445b9a[_0x3bef86]['id'];logger[_0x9bc7('0x16')](_0x9bc7('0x1a'),_0x1e84f6[_0x9bc7('0x1b')]);}}}if(!_0x20a5db){logger['info']('Admin\x20selected');_0x1e84f6[_0x9bc7('0x1c')]=_0x1e84f6[_0x9bc7('0xf')];_0x1e84f6[_0x9bc7('0x1b')]=_0x1e84f6[_0x9bc7('0x10')];_0x20a5db=!![];}if(_0x20a5db){_0x1a2755(_0x1e84f6);}else{_0x7bb7ce({'statusCode':0x194,'message':_0x9bc7('0x11')});}}else{_0x7bb7ce({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x9bc7('0x1d')](function(_0x1943a5){logger['error']('['+[_0x11b136[_0x9bc7('0x12')]()]+']',_0x1943a5[_0x9bc7('0x13')]);_0x7bb7ce(_0x1943a5);});});};}function searchContact(_0x34834f,_0x72c100,_0x170201,_0x3bd57e){return new Promise(function(_0x1c8ca9,_0x163d87){var _0x512dcf={'method':_0x9bc7('0x14'),'headers':_0x72c100,'uri':_0x34834f+'/api/lookup?q='+_0x3bd57e+_0x9bc7('0x1e')+_0x170201+_0x9bc7('0x1f'),'json':!![]};rp(_0x512dcf)[_0x9bc7('0xc')](function(_0x2e6264){var _0x3d7716=_[_0x9bc7('0x20')](_0x2e6264['contacts'][_0x9bc7('0x21')],[_0x170201,_0x3bd57e]);_0x1c8ca9(_0x3d7716);})['catch'](function(_0x5b1f8e){_0x163d87(_0x5b1f8e);});});}function getEndUser(_0x2c5c19,_0x3e8b43,_0x59974e){return function(_0x40325e){return new Promise(function(_0x260993,_0x32715d){logger['info'](util[_0x9bc7('0x22')]('Searching\x20contact\x20with\x20phone\x20%s',_0x40325e[_0x9bc7('0x23')]));searchContact(_0x59974e,_0x3e8b43,'mobile_number',_0x40325e['contactNumber'])[_0x9bc7('0xc')](function(_0x2b497a){if(_0x2b497a){_0x40325e[_0x9bc7('0x24')]=_0x2b497a['id'];logger[_0x9bc7('0x16')]('Contact\x20found\x20mobile_number:',_0x40325e[_0x9bc7('0x24')]);return _0x260993(_0x40325e);}searchContact(_0x59974e,_0x3e8b43,_0x9bc7('0x25'),_0x40325e[_0x9bc7('0x23')])[_0x9bc7('0xc')](function(_0x494997){if(_0x494997){_0x40325e['endUserId']=_0x494997['id'];logger[_0x9bc7('0x16')](_0x9bc7('0x26'),_0x40325e[_0x9bc7('0x24')]);return _0x260993(_0x40325e);}createEndUser(_0x40325e,_0x2c5c19,_0x3e8b43,_0x59974e)[_0x9bc7('0xc')](function(_0x2f80fe){logger[_0x9bc7('0x16')](_0x9bc7('0x27'),_0x2f80fe[_0x9bc7('0x24')]);return _0x260993(_0x2f80fe);});});})['catch'](function(_0x514047){_0x32715d(_0x514047);});});};}function createEndUser(_0x42bf33,_0x2a20c2,_0x33e83d,_0x1c45d1){return new Promise(function(_0x363aa3,_0x36f970){var _0x55f7e1=moment();var _0x25debf={'method':_0x9bc7('0x28'),'uri':_0x1c45d1+'/api/contacts','body':{'contact':{'last_name':_0x42bf33[_0x9bc7('0x23')],'work_number':_0x42bf33['contactNumber'],'mobile_number':_0x42bf33[_0x9bc7('0x23')],'owner_id':_0x42bf33['userId'],'created_at':_0x55f7e1['format'](_0x9bc7('0x29'))}},'json':!![]};_0x25debf[_0x9bc7('0x15')]=_0x33e83d;logger[_0x9bc7('0x16')](_0x9bc7('0x2a'));return rp(_0x25debf)[_0x9bc7('0xc')](function(_0x54414a){_0x42bf33[_0x9bc7('0x24')]=_0x54414a['contact']['id'];_0x363aa3(_0x42bf33);})['catch'](function(_0x17998a){logger[_0x9bc7('0x2b')]('['+[_0x2a20c2['toUpperCase']()]+']',_0x17998a[_0x9bc7('0x13')]);_0x36f970(_0x17998a[_0x9bc7('0x13')]);});});}function getTicket(_0x50cf60,_0x501f93,_0x260d37,_0x2ae0c4,_0x107a7f){return function(_0x39d7ff){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x49571f,_0x5af552){var _0x31bdbd=moment();var _0x3c449e={'method':'POST','uri':_0x260d37+_0x9bc7('0x2c'),'body':{'title':intUtil[_0x9bc7('0x2d')](_0x2ae0c4[_0x9bc7('0x2e')],_0x107a7f,'\x20'),'description':intUtil['getString'](_0x2ae0c4[_0x9bc7('0x2f')],_0x107a7f,'\x0a'),'owner_id':_0x39d7ff[_0x9bc7('0x1b')],'creater_id':_0x39d7ff[_0x9bc7('0x10')],'targetable_id':_0x39d7ff['endUserId'],'targetable_type':_0x9bc7('0x30'),'created_at':_0x31bdbd[_0x9bc7('0x22')](_0x9bc7('0x29')),'due_date':_0x31bdbd['add'](0x1e,'m')[_0x9bc7('0x22')](_0x9bc7('0x29'))},'json':!![]};_0x3c449e[_0x9bc7('0x15')]=_0x501f93;return rp(_0x3c449e)[_0x9bc7('0xc')](function(_0x4c4033){_0x39d7ff[_0x9bc7('0x31')]=_0x4c4033['task']['id'];logger[_0x9bc7('0x16')](_0x9bc7('0x32'),_0x39d7ff['ticketId']);_0x49571f(_0x39d7ff);})['catch'](function(_0x1ea8a8){logger[_0x9bc7('0x2b')]('['+[_0x50cf60[_0x9bc7('0x12')]()]+']',_0x1ea8a8['message']);_0x5af552(_0x1ea8a8[_0x9bc7('0x13')]);});});};}function emit(_0x59b421,_0x24b950,_0x1a4b47){var _0x83758f={'uri':_0x59b421+_0x9bc7('0x33')+_0x1a4b47};io['to'](util['format'](_0x9bc7('0x34'),_0x24b950))[_0x9bc7('0x35')](_0x9bc7('0x36'),_0x83758f);}exports['cs']=function(_0x45bd5f,_0x23d4da,_0x1abb5c,_0x5ad596,_0x16d851,_0x31771c,_0x58d46e,_0x2bf4d1){var _0x5080dd={};var _0x2be2ea={'Authorization':_0x9bc7('0x37')+_0x31771c[_0x9bc7('0x38')]};_0x31771c[_0x9bc7('0x39')]=intUtil[_0x9bc7('0x3a')](_0x31771c[_0x9bc7('0x39')]);_0x31771c[_0x9bc7('0x3b')]=intUtil[_0x9bc7('0x3a')](_0x31771c[_0x9bc7('0x3b')]);var _0x158b71=_0x31771c[_0x9bc7('0x39')];_0x5080dd[_0x9bc7('0xf')]=_0x31771c[_0x9bc7('0x3c')];_0x5080dd[_0x9bc7('0x23')]=_0x2bf4d1[_0x9bc7('0x3d')]()===_0x9bc7('0x3e')?_0x23d4da['destcalleridnum']:_0x23d4da[_0x9bc7('0x3f')];_0x5080dd[_0x9bc7('0x40')]=_0x2bf4d1===_0x9bc7('0x41')||_0x2bf4d1===_0x9bc7('0x42')?_0x9bc7('0x41'):_0x9bc7('0x3e');if(_0x5ad596){_0x5080dd['agentEmail']=_0x5ad596[_0x9bc7('0x19')];}var _0x45c0f6=util[_0x9bc7('0x22')](_0x9bc7('0x43'),_0x31771c[_0x9bc7('0x3b')],_0x23d4da[_0x9bc7('0x44')],md5(_0x23d4da['uniqueid']));if(_0x16d851&&_0x16d851[_0x9bc7('0x45')]){logger[_0x9bc7('0x16')](_0x9bc7('0x46'),'Recording\x20is\x20enabled!');_0x23d4da[_0x9bc7('0x47')]=_0x45c0f6;}else if(_0x58d46e&&_0x58d46e[_0x9bc7('0x48')]&&_0x58d46e[_0x9bc7('0x48')]!=='none'){logger['info']('[OUTBOUND]',_0x9bc7('0x49'));_0x23d4da[_0x9bc7('0x47')]=_0x45c0f6;}else{_0x23d4da[_0x9bc7('0x47')]='';}return getAdminId(_0x5080dd,_0x2bf4d1,_0x2be2ea,_0x158b71)[_0x9bc7('0xc')](getUser(_0x2bf4d1,_0x2be2ea,_0x158b71))[_0x9bc7('0xc')](getEndUser(_0x2bf4d1,_0x2be2ea,_0x158b71))['then'](getTicket(_0x2bf4d1,_0x2be2ea,_0x158b71,_0x1abb5c,_0x23d4da))[_0x9bc7('0xc')](function(_0xbd1878){logger['info'](util[_0x9bc7('0x22')](_0x9bc7('0x4a'),_0xbd1878[_0x9bc7('0x31')]));if(_0x2bf4d1!==_0x9bc7('0x42')){logger[_0x9bc7('0x16')]('['+[_0x2bf4d1[_0x9bc7('0x12')]()]+']',_0x9bc7('0x4b'));emit(_0x158b71,_0x5ad596[_0x9bc7('0x4c')],_0xbd1878['endUserId']);}})['catch'](function(_0x4b22a8){logger[_0x9bc7('0x2b')]('['+[_0x2bf4d1[_0x9bc7('0x12')]()]+_0x9bc7('0x4d'),util[_0x9bc7('0x4e')](_0x4b22a8,{'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 d61824a..0ed920e 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 _0xe748=['log','EVENT\x20UNKNOWN','unmanaged','salesforce','servicenow','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0xe748,0xcb));var _0x8e74=function(_0x1056ad,_0x52d38f){_0x1056ad=_0x1056ad-0x0;var _0x302574=_0xe748[_0x1056ad];return _0x302574;};'use strict';var _=require(_0x8e74('0x0'));var util=require('util');var zendesk=require(_0x8e74('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x8e74('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0x8e74('0x3'));var desk=require(_0x8e74('0x4'));var vtiger=require(_0x8e74('0x5'));var servicenow=require(_0x8e74('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0x8e74('0x7'));var integrations=[_0x8e74('0x8'),'salesforce',_0x8e74('0x9'),_0x8e74('0xa'),_0x8e74('0xb'),_0x8e74('0xc'),_0x8e74('0xd'),_0x8e74('0xe'),_0x8e74('0xf'),'servicenow'];exports['exec']=function(_0x594646,_0x420ee3,_0x3c585d,_0x160578,_0x14d4f2,_0x367a67){if(_0x3c585d){if(_[_0x8e74('0x10')](integrations,_0x594646[_0x8e74('0x11')][_0x8e74('0x12')]())){try{var _0x19dc65=null;var _0x58632a='';var _0x5bf1b1=_0x3c585d[_0x594646[_0x8e74('0x11')][_0x8e74('0x12')]()];if(_0x5bf1b1){var _0x5df380=_0x5bf1b1[_0x594646[_0x8e74('0x13')]];if(_0x5df380){var _0x313d7b=_[_0x8e74('0x14')](_0x5df380[_0x8e74('0x15')],{'id':parseInt(_0x594646['data3'],0xa)});if(_0x313d7b){if(_0x160578){if(_0x14d4f2&&_0x420ee3[_0x8e74('0x16')]){_0x58632a=_0x8e74('0x16');}else if(_0x420ee3[_0x8e74('0x17')]){_0x58632a=_0x8e74('0x18');}else{console[_0x8e74('0x19')](_0x8e74('0x1a'),_0x420ee3);}}else{_0x58632a=_0x8e74('0x1b');}switch(_0x594646[_0x8e74('0x11')][_0x8e74('0x12')]()){case _0x8e74('0x8'):zendesk[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0x1c'):salesforce[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0x9'):sugarcrm[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0xa'):freshdesk[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0xb'):zoho[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0xc'):desk[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0xd'):vtiger[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0xf'):freshsales['cs'](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67,_0x58632a);break;case _0x8e74('0x1d'):servicenow['cs'](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67,_0x58632a);break;case _0x8e74('0xe'):dynamics365['cs'](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67,_0x58632a);break;default:console[_0x8e74('0x19')](_0x8e74('0x1e'));}}else{_0x19dc65=require(_0x8e74('0x1f'))(_0x594646['data1'][_0x8e74('0x12')]());_0x19dc65[_0x8e74('0x20')](_0x8e74('0x21'),util[_0x8e74('0x22')](_0x8e74('0x23'),_0x594646[_0x8e74('0x11')]['toLowerCase'](),_0x594646[_0x8e74('0x24')]));}}else{_0x19dc65=require('../../../../config/logger')(_0x594646[_0x8e74('0x11')][_0x8e74('0x12')]());_0x19dc65['error'](_0x8e74('0x21'),util[_0x8e74('0x22')](_0x8e74('0x25'),_0x594646[_0x8e74('0x11')]['toLowerCase'](),_0x594646[_0x8e74('0x13')]));}}else{}}catch(_0x49a1ec){console[_0x8e74('0x20')](_0x49a1ec);}}}}; \ No newline at end of file +var _0xf22a=['EVENT\x20UNKNOWN','unmanaged','vtiger','freshsales','unknown\x20integration','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','error','%s\x20account\x20#%s\x20not\x20found','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','dynamics365','servicenow','toLowerCase','data1','data2','queue','routeId','log'];(function(_0xbbaa27,_0x36acd7){var _0x2ee4d4=function(_0x1e49a5){while(--_0x1e49a5){_0xbbaa27['push'](_0xbbaa27['shift']());}};_0x2ee4d4(++_0x36acd7);}(_0xf22a,0x160));var _0xaf22=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xf22a[_0x266618];return _0x54dbf5;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require('./zendesk');var salesforce=require(_0xaf22('0x0'));var sugarcrm=require(_0xaf22('0x1'));var freshdesk=require(_0xaf22('0x2'));var zoho=require(_0xaf22('0x3'));var desk=require(_0xaf22('0x4'));var vtiger=require(_0xaf22('0x5'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0xaf22('0x6'));var integrations=[_0xaf22('0x7'),'salesforce',_0xaf22('0x8'),_0xaf22('0x9'),_0xaf22('0xa'),_0xaf22('0xb'),'vtiger',_0xaf22('0xc'),'freshsales',_0xaf22('0xd')];exports['exec']=function(_0x1dd308,_0x4eeecb,_0x415166,_0x478b69,_0x5ae4c8,_0x1bb227){if(_0x415166){if(_['includes'](integrations,_0x1dd308['data1'][_0xaf22('0xe')]())){try{var _0x3e9b47=null;var _0x45f7e0='';var _0x44840f=_0x415166[_0x1dd308[_0xaf22('0xf')][_0xaf22('0xe')]()];if(_0x44840f){var _0x410a02=_0x44840f[_0x1dd308[_0xaf22('0x10')]];if(_0x410a02){var _0xe10699=_['find'](_0x410a02['Configurations'],{'id':parseInt(_0x1dd308['data3'],0xa)});if(_0xe10699){if(_0x478b69){if(_0x5ae4c8&&_0x4eeecb[_0xaf22('0x11')]){_0x45f7e0=_0xaf22('0x11');}else if(_0x4eeecb[_0xaf22('0x12')]){_0x45f7e0='outbound';}else{console[_0xaf22('0x13')](_0xaf22('0x14'),_0x4eeecb);}}else{_0x45f7e0=_0xaf22('0x15');}switch(_0x1dd308[_0xaf22('0xf')][_0xaf22('0xe')]()){case'zendesk':zendesk[_0x45f7e0](_0x1dd308,_0x4eeecb,_0xe10699,_0x478b69,_0x5ae4c8,_0x410a02,_0x1bb227);break;case'salesforce':salesforce[_0x45f7e0](_0x1dd308,_0x4eeecb,_0xe10699,_0x478b69,_0x5ae4c8,_0x410a02,_0x1bb227);break;case'sugarcrm':sugarcrm[_0x45f7e0](_0x1dd308,_0x4eeecb,_0xe10699,_0x478b69,_0x5ae4c8,_0x410a02,_0x1bb227);break;case'freshdesk':freshdesk[_0x45f7e0](_0x1dd308,_0x4eeecb,_0xe10699,_0x478b69,_0x5ae4c8,_0x410a02,_0x1bb227);break;case _0xaf22('0xa'):zoho[_0x45f7e0](_0x1dd308,_0x4eeecb,_0xe10699,_0x478b69,_0x5ae4c8,_0x410a02,_0x1bb227);break;case'desk':desk[_0x45f7e0](_0x1dd308,_0x4eeecb,_0xe10699,_0x478b69,_0x5ae4c8,_0x410a02,_0x1bb227);break;case _0xaf22('0x16'):vtiger[_0x45f7e0](_0x1dd308,_0x4eeecb,_0xe10699,_0x478b69,_0x5ae4c8,_0x410a02,_0x1bb227);break;case _0xaf22('0x17'):freshsales['cs'](_0x1dd308,_0x4eeecb,_0xe10699,_0x478b69,_0x5ae4c8,_0x410a02,_0x1bb227,_0x45f7e0);break;case _0xaf22('0xd'):servicenow['cs'](_0x1dd308,_0x4eeecb,_0xe10699,_0x478b69,_0x5ae4c8,_0x410a02,_0x1bb227,_0x45f7e0);break;case _0xaf22('0xc'):dynamics365['cs'](_0x1dd308,_0x4eeecb,_0xe10699,_0x478b69,_0x5ae4c8,_0x410a02,_0x1bb227,_0x45f7e0);break;default:console['log'](_0xaf22('0x18'));}}else{_0x3e9b47=require('../../../../config/logger')(_0x1dd308[_0xaf22('0xf')][_0xaf22('0xe')]());_0x3e9b47['error'](_0xaf22('0x19'),util[_0xaf22('0x1a')](_0xaf22('0x1b'),_0x1dd308[_0xaf22('0xf')][_0xaf22('0xe')](),_0x1dd308[_0xaf22('0x1c')]));}}else{_0x3e9b47=require('../../../../config/logger')(_0x1dd308[_0xaf22('0xf')][_0xaf22('0xe')]());_0x3e9b47[_0xaf22('0x1d')](_0xaf22('0x19'),util[_0xaf22('0x1a')](_0xaf22('0x1e'),_0x1dd308[_0xaf22('0xf')][_0xaf22('0xe')](),_0x1dd308[_0xaf22('0x10')]));}}else{}}catch(_0x4f4fee){console['error'](_0x4f4fee);}}}}; \ 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 b2cc024..473080d 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 _0x1ff8=['./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','ActivityDate','IsRecurrence','endUserType','contact','lead','WhoId','account','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','additionalSearchAccount','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variableName','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','unmanaged','lastevent',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5'];(function(_0x1aa28e,_0xf2300f){var _0x125078=function(_0x59833a){while(--_0x59833a){_0x1aa28e['push'](_0x1aa28e['shift']());}};_0x125078(++_0xf2300f);}(_0x1ff8,0x1f4));var _0x81ff=function(_0x519380,_0x7f196){_0x519380=_0x519380-0x0;var _0x60ba2c=_0x1ff8[_0x519380];return _0x60ba2c;};'use strict';var _=require('lodash');var rp=require(_0x81ff('0x0'));var moment=require(_0x81ff('0x1'));var BPromise=require(_0x81ff('0x2'));var md5=require(_0x81ff('0x3'));var jsforce=require('jsforce');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x81ff('0x4'));var config=require('../../../../config/environment');var logger=require(_0x81ff('0x5'))(_0x81ff('0x6'));config[_0x81ff('0x7')]=_[_0x81ff('0x8')](config[_0x81ff('0x7')],{'host':_0x81ff('0x9'),'port':0x18eb});var io=require(_0x81ff('0xa'))(new Redis(config[_0x81ff('0x7')]));function emit(_0x49382e,_0x39ebe8,_0x46a76d){io['to'](_0x49382e)[_0x81ff('0xb')](_0x39ebe8,_0x46a76d);}function getTicket(_0x2c0407,_0x4c646d,_0x4196f0,_0x175ff2,_0x28eb04,_0x5537bd,_0x7f2776,_0x5c4206){var _0x1e6164=Object[_0x81ff('0xc')]({},{'OwnerId':_0x4c646d['id'],'Subject':intUtil[_0x81ff('0xd')](_0x175ff2['Subjects'],_0x28eb04,'\x20'),'Description':intUtil[_0x81ff('0xd')](_0x175ff2[_0x81ff('0xe')],_0x28eb04,'\x0a')},getCustomFields(_0x5537bd,_0x28eb04));if(_0x4196f0){if(_0x175ff2[_0x81ff('0xf')]==='Task'){_0x1e6164[_0x81ff('0x10')]=moment['utc']();_0x1e6164['IsReminderSet']=![];_0x1e6164[_0x81ff('0x11')]=![];if(_0x4196f0[_0x81ff('0x12')]===_0x81ff('0x13')||_0x4196f0[_0x81ff('0x12')]===_0x81ff('0x14')){_0x1e6164[_0x81ff('0x15')]=_0x4196f0['id'];}else if(_0x4196f0['endUserType']===_0x81ff('0x16')){_0x1e6164['WhatId']=_0x4196f0['id'];}}else if(_0x175ff2['ticketType']===_0x81ff('0x17')){if(_0x4196f0[_0x81ff('0x12')]==='contact'){_0x1e6164[_0x81ff('0x18')]=_0x4196f0['id'];}else if(_0x4196f0[_0x81ff('0x12')]===_0x81ff('0x16')){_0x1e6164[_0x81ff('0x19')]=_0x4196f0['id'];}else if(_0x4196f0[_0x81ff('0x12')]===_0x81ff('0x14')&&_0x175ff2['leadId']){_0x1e6164[_0x175ff2[_0x81ff('0x1a')]]=_0x4196f0['id'];}else{logger[_0x81ff('0x1b')](_0x81ff('0x1c'));}}}return _0x7f2776[_0x81ff('0x1d')](_0x175ff2['ticketType'])[_0x81ff('0x1e')](_0x1e6164);}function getUser(_0x1f25b5,_0x2a3b39,_0x283489){if(!_[_0x81ff('0x1f')](_0x2a3b39)&&intUtil[_0x81ff('0x20')](_0x2a3b39)){var _0x2617f0={'Email':_0x2a3b39};var _0x57b696={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x283489[_0x81ff('0x1d')](_0x81ff('0x21'))[_0x81ff('0x22')](_0x2617f0,_0x57b696)[_0x81ff('0x23')]()['then'](function(_0xdcd3b5){if(_0xdcd3b5[_0x81ff('0x24')]){var _0x32bc63=_[_0x81ff('0x22')](_0xdcd3b5,function(_0x8e8787){return _0x8e8787['Email']===_0x2a3b39;});if(_0x32bc63){logger[_0x81ff('0x1b')](_0x81ff('0x25'),_0x2a3b39);return BPromise[_0x81ff('0x26')]({'id':_0x32bc63['Id'],'name':_0x32bc63[_0x81ff('0x27')]});}}else{logger['info'](_0x81ff('0x28'),_0x2a3b39);return _0x283489[_0x81ff('0x29')]()[_0x81ff('0x2a')](function(_0x237adf){return BPromise['resolve']({'id':_0x237adf[_0x81ff('0x2b')],'name':_0x237adf[_0x81ff('0x2c')]});});}});}else{logger['info'](_0x81ff('0x28'),_0x2a3b39);return _0x283489[_0x81ff('0x29')]()[_0x81ff('0x2a')](function(_0x34d27e){return BPromise[_0x81ff('0x26')]({'id':_0x34d27e['user_id'],'name':_0x34d27e[_0x81ff('0x2c')]});});}}function getEndUser(_0x2dfffe,_0x43f186,_0x12c9be,_0x17724b,_0x19613a){var _0x172dcf={'$or':{'Phone':_0x17724b}};var _0x592934={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x81ff('0x26')]()[_0x81ff('0x2a')](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x17724b,_0x43f186[_0x81ff('0x2d')]);switch(_0x43f186[_0x81ff('0x2d')]){case _0x81ff('0x2e'):var _0x5b1c1f=_[_0x81ff('0x2f')](_0x172dcf);if(_0x43f186[_0x81ff('0x30')]){var _0x2419b7={};_0x2419b7[_0x43f186[_0x81ff('0x30')]]=_0x17724b;_[_0x81ff('0x31')](_0x5b1c1f[_0x81ff('0x32')],_0x2419b7);}return _0x19613a['sobject'](_0x81ff('0x33'))[_0x81ff('0x22')](_0x5b1c1f,_0x592934)[_0x81ff('0x23')]()[_0x81ff('0x2a')](function(_0x2166f0){if(_0x2166f0&&_0x2166f0[_0x81ff('0x24')]){return _0x2166f0;}else{var _0x34cbc1=_[_0x81ff('0x2f')](_0x172dcf);if(_0x43f186[_0x81ff('0x34')]){var _0x39b108={};_0x39b108[_0x43f186[_0x81ff('0x34')]]=_0x17724b;_['merge'](_0x34cbc1[_0x81ff('0x32')],_0x39b108);}return _0x19613a[_0x81ff('0x1d')](_0x81ff('0x35'))[_0x81ff('0x22')](_0x34cbc1,_0x592934);}});case'account_contact_lead':var _0x599225=_[_0x81ff('0x2f')](_0x172dcf);if(_0x43f186['additionalSearchAccount']){var _0x2419b7={};_0x2419b7[_0x43f186[_0x81ff('0x36')]]=_0x17724b;_['merge'](_0x599225[_0x81ff('0x32')],_0x2419b7);}return _0x19613a[_0x81ff('0x1d')]('Account')[_0x81ff('0x22')](_0x599225,_0x592934)['execute']()[_0x81ff('0x2a')](function(_0xe0a93c){if(_0xe0a93c&&_0xe0a93c[_0x81ff('0x24')]){return _0xe0a93c;}else{var _0x162c24=_[_0x81ff('0x2f')](_0x172dcf);if(_0x43f186[_0x81ff('0x30')]){var _0x1a863e={};_0x1a863e[_0x43f186['additionalSearchContact']]=_0x17724b;_['merge'](_0x162c24['$or'],_0x1a863e);}return _0x19613a[_0x81ff('0x1d')](_0x81ff('0x33'))['find'](_0x162c24,_0x592934)[_0x81ff('0x2a')](function(_0x659be4){if(_0x659be4&&_0x659be4[_0x81ff('0x24')]){return _0x659be4;}else{var _0x1639fc=_[_0x81ff('0x2f')](_0x172dcf);if(_0x43f186[_0x81ff('0x34')]){var _0x194477={};_0x194477[_0x43f186[_0x81ff('0x34')]]=_0x17724b;_[_0x81ff('0x31')](_0x1639fc[_0x81ff('0x32')],_0x194477);}return _0x19613a[_0x81ff('0x1d')]('Lead')[_0x81ff('0x22')](_0x1639fc,_0x592934);}});}});case _0x81ff('0x13'):var _0x5b1c1f=_['cloneDeep'](_0x172dcf);if(_0x43f186[_0x81ff('0x30')]){var _0x2419b7={};_0x2419b7[_0x43f186['additionalSearchContact']]=_0x17724b;_[_0x81ff('0x31')](_0x5b1c1f[_0x81ff('0x32')],_0x2419b7);}return _0x19613a[_0x81ff('0x1d')](_0x81ff('0x33'))[_0x81ff('0x22')](_0x5b1c1f,_0x592934)[_0x81ff('0x23')]();case _0x81ff('0x14'):var _0x2c765d=_[_0x81ff('0x2f')](_0x172dcf);if(_0x43f186['additionalSearchLead']){var _0x2419b7={};_0x2419b7[_0x43f186[_0x81ff('0x34')]]=_0x17724b;_[_0x81ff('0x31')](_0x2c765d[_0x81ff('0x32')],_0x2419b7);}return _0x19613a['sobject'](_0x81ff('0x35'))[_0x81ff('0x22')](_0x2c765d,_0x592934);case _0x81ff('0x16'):var _0x599225=_['cloneDeep'](_0x172dcf);if(_0x43f186[_0x81ff('0x36')]){var _0x2419b7={};_0x2419b7[_0x43f186[_0x81ff('0x36')]]=_0x17724b;_[_0x81ff('0x31')](_0x599225[_0x81ff('0x32')],_0x2419b7);}return _0x19613a[_0x81ff('0x1d')]('Account')['find'](_0x599225,_0x592934);default:return null;}})[_0x81ff('0x2a')](function(_0x278760){if(_0x278760&&_0x278760[_0x81ff('0x24')]){var _0x2ce465=_[_0x81ff('0x37')](_0x278760);if(_0x2ce465){return BPromise[_0x81ff('0x26')]({'id':_0x2ce465['Id'],'name':_0x2ce465['Name'],'phone':_0x2ce465[_0x81ff('0x38')],'endUserType':_0x2ce465[_0x81ff('0x39')][_0x81ff('0x3a')][_0x81ff('0x3b')]()});}}})['then'](function(_0x5d6368){if(_0x5d6368){logger[_0x81ff('0x1b')](_0x81ff('0x3c'),_0x5d6368['endUserType'],_0x17724b);return BPromise['resolve'](_0x5d6368);}else{logger['info'](_0x81ff('0x3d'),_0x17724b);var _0x51fb41={'Phone':_0x17724b};if(_0x43f186[_0x81ff('0x3e')]){if(_0x43f186[_0x81ff('0x3e')]===_0x81ff('0x13')){logger[_0x81ff('0x1b')](_0x81ff('0x3f'),_0x17724b,_0x43f186[_0x81ff('0x3e')]);_0x51fb41[_0x81ff('0x40')]=_0x12c9be!==_0x81ff('0x41')?_0x12c9be:util[_0x81ff('0x42')]('Caller\x20-\x20%s',_0x17724b);}else if(_0x43f186['moduleCreate']==='lead'){logger[_0x81ff('0x1b')](_0x81ff('0x3f'),_0x17724b,_0x43f186['moduleCreate']);_0x51fb41[_0x81ff('0x40')]=_0x12c9be!==''?_0x12c9be:util[_0x81ff('0x42')](_0x81ff('0x43'),_0x17724b);_0x51fb41['Company']=_0x81ff('0x44');}else if(_0x43f186['moduleCreate']==='account'){logger[_0x81ff('0x1b')](_0x81ff('0x3f'),_0x17724b,_0x43f186[_0x81ff('0x3e')]);_0x51fb41[_0x81ff('0x27')]=_0x12c9be!==_0x81ff('0x41')?_0x12c9be:util[_0x81ff('0x42')](_0x81ff('0x43'),_0x17724b);}else{return null;}}return _0x19613a[_0x81ff('0x1d')](_[_0x81ff('0x45')](_0x43f186[_0x81ff('0x3e')]))[_0x81ff('0x1e')](_0x51fb41)[_0x81ff('0x2a')](function(_0x47bf1b){return BPromise[_0x81ff('0x26')]({'id':_0x47bf1b['id'],'endUserType':_0x43f186[_0x81ff('0x3e')]});});}});}function getCustomFields(_0x2a5968,_0x3717a3){var _0x32ce46={};if(_0x2a5968[_0x81ff('0x24')]>0x0){_[_0x81ff('0x46')](_0x2a5968,function(_0x3df886){if(_[_0x81ff('0x47')]([_0x81ff('0x48'),_0x81ff('0x49')],_0x3df886[_0x81ff('0x3a')])&&_0x3df886[_0x81ff('0x4a')]){_0x32ce46[_0x3df886[_0x81ff('0x4a')]]=_0x3df886[_0x81ff('0x4b')][_0x81ff('0x4c')]();}else if(_0x3df886['type']==='variable'&&_0x3df886[_0x81ff('0x4d')]&&_0x3df886[_0x81ff('0x4a')]){_0x3717a3[_0x3df886[_0x81ff('0x4d')]]&&(_0x32ce46[_0x3df886['idField']]=_0x3717a3[_0x3df886[_0x81ff('0x4d')]][_0x81ff('0x4c')]());}else if(_0x3df886[_0x81ff('0x3a')]==='customVariable'&&_0x3df886[_0x81ff('0x4e')]&&_0x3df886[_0x81ff('0x4e')][_0x81ff('0x4f')]&&_0x3df886['idField']){_0x3717a3[_0x3df886['Variable']['name'][_0x81ff('0x3b')]()]&&(_0x32ce46[_0x3df886[_0x81ff('0x4a')]]=_0x3717a3[_0x3df886[_0x81ff('0x4e')]['name'][_0x81ff('0x3b')]()]['toString']());}});}return _0x32ce46;}function getConnection(_0x12e4e3){var _0x449453=_0x12e4e3[_0x81ff('0x50')][_0x81ff('0x51')](_0x12e4e3[_0x81ff('0x52')]);var _0x396069=new jsforce[(_0x81ff('0x53'))]({'oauth2':{'loginUrl':_0x12e4e3[_0x81ff('0x54')]||_0x81ff('0x55'),'clientId':_0x12e4e3[_0x81ff('0x56')],'clientSecret':_0x12e4e3['clientSecret']}});return _0x396069[_0x81ff('0x57')](_0x12e4e3[_0x81ff('0x58')],_0x449453)[_0x81ff('0x2a')](function(){logger['info'](_0x81ff('0x59'));return _0x396069;});}exports[_0x81ff('0x5a')]=function(_0x502133,_0x108f6c,_0x26ec58,_0x50c399,_0x1cb2aa,_0x38f287){var _0x1c1658,_0x53c0a1,_0x514036,_0x855dfa;_0x38f287['serverUrl']=intUtil[_0x81ff('0x5b')](_0x38f287[_0x81ff('0x5c')]);_0x38f287[_0x81ff('0x54')]=intUtil[_0x81ff('0x5b')](_0x38f287[_0x81ff('0x54')]);if(_0x1cb2aa&&_0x1cb2aa[_0x81ff('0x5d')]){logger[_0x81ff('0x1b')](_0x81ff('0x5e'),_0x81ff('0x5f'));_0x108f6c['recordingURL']=util[_0x81ff('0x42')](_0x81ff('0x60'),_0x38f287[_0x81ff('0x5c')],_0x108f6c[_0x81ff('0x61')],md5(_0x108f6c[_0x81ff('0x61')]));}else{_0x108f6c['recordingURL']='';}return getConnection(_0x38f287)[_0x81ff('0x2a')](function(_0x47fec6){_0x855dfa=_0x47fec6;return getUser(_0x38f287,_0x50c399[_0x81ff('0x62')],_0x855dfa);})[_0x81ff('0x2a')](function(_0xf5b5c1){_0x1c1658=_0xf5b5c1;return getEndUser(_0x38f287,_0x26ec58,_0x108f6c[_0x81ff('0x63')],_0x108f6c[_0x81ff('0x64')],_0x855dfa);})['then'](function(_0x148a46){_0x53c0a1=_0x148a46;return getTicket(_0x38f287,_0x1c1658,_0x53c0a1,_0x26ec58,_0x108f6c,_0x26ec58[_0x81ff('0x65')],_0x855dfa,_0x81ff('0x5a'));})['then'](function(_0x27066e){_0x514036=_0x27066e;logger[_0x81ff('0x1b')](_0x81ff('0x66'),_0x514036['id']);logger[_0x81ff('0x1b')](_0x81ff('0x67'),_0x514036['id'],_0x50c399['name'],_0x38f287[_0x81ff('0x3a')]);switch(_0x38f287['type']){case _0x81ff('0x68'):emit(util['format'](_0x81ff('0x69'),_0x50c399[_0x81ff('0x4f')]),'trigger:salesforce:display',{'recordId':_0x514036['id']});break;case'newTab':emit(util[_0x81ff('0x42')](_0x81ff('0x69'),_0x50c399['name']),_0x81ff('0x6a'),{'uri':util[_0x81ff('0x42')](_0x81ff('0x6b'),_0x855dfa[_0x81ff('0x6c')],_0x514036['id'])});break;default:logger[_0x81ff('0x6d')](_0x81ff('0x6e'));}})[_0x81ff('0x6f')](function(_0x43b54a){logger[_0x81ff('0x6d')](_0x81ff('0x5e'),_0x43b54a);});};exports['outbound']=function(_0x222015,_0x4f1989,_0x67a39b,_0x203a1c,_0x41e24c,_0x13c098,_0x120e4c){var _0x11130a,_0x136d31,_0x259867,_0x750f87;_0x13c098[_0x81ff('0x5c')]=intUtil[_0x81ff('0x5b')](_0x13c098[_0x81ff('0x5c')]);_0x13c098[_0x81ff('0x54')]=intUtil['stripTrailingSlash'](_0x13c098[_0x81ff('0x54')]);if(_0x120e4c&&_0x120e4c[_0x81ff('0x70')]&&_0x120e4c['recordingFormat']!==_0x81ff('0x71')){logger[_0x81ff('0x1b')](_0x81ff('0x72'),_0x81ff('0x5f'));_0x4f1989[_0x81ff('0x73')]=util[_0x81ff('0x42')](_0x81ff('0x60'),_0x13c098['serverUrl'],_0x4f1989[_0x81ff('0x61')],md5(_0x4f1989['uniqueid']));}return getConnection(_0x13c098)[_0x81ff('0x2a')](function(_0x3f84f5){_0x750f87=_0x3f84f5;return getUser(_0x13c098,_0x203a1c[_0x81ff('0x62')],_0x750f87);})[_0x81ff('0x2a')](function(_0x3ce100){_0x11130a=_0x3ce100;return getEndUser(_0x13c098,_0x67a39b,_0x4f1989[_0x81ff('0x74')],_0x4f1989[_0x81ff('0x75')],_0x750f87);})[_0x81ff('0x2a')](function(_0x4614c6){_0x136d31=_0x4614c6;return getTicket(_0x13c098,_0x11130a,_0x136d31,_0x67a39b,_0x4f1989,_0x67a39b['Fields'],_0x750f87,'outbound');})['then'](function(_0xd33102){_0x259867=_0xd33102;logger[_0x81ff('0x1b')](_0x81ff('0x76'),_0x259867['id']);logger[_0x81ff('0x1b')](_0x81ff('0x77'),_0x259867['id'],_0x203a1c[_0x81ff('0x4f')],_0x13c098[_0x81ff('0x3a')]);switch(_0x13c098['type']){case _0x81ff('0x68'):emit(util[_0x81ff('0x42')](_0x81ff('0x69'),_0x203a1c[_0x81ff('0x4f')]),'trigger:salesforce:display',{'recordId':_0x259867['id']});break;case _0x81ff('0x78'):emit(util[_0x81ff('0x42')](_0x81ff('0x69'),_0x203a1c[_0x81ff('0x4f')]),'trigger:browser:url',{'uri':util[_0x81ff('0x42')](_0x81ff('0x6b'),_0x750f87['instanceUrl'],_0x259867['id'])});break;default:logger['error'](_0x81ff('0x72'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x81ff('0x6f')](function(_0x42f2b2){logger[_0x81ff('0x6d')](_0x81ff('0x72'),_0x42f2b2);});};exports[_0x81ff('0x79')]=function(_0x17e67d,_0x4f3d96,_0x7f0d6a,_0xc35442,_0x73cd49,_0x3f0d23){var _0xb16fbc,_0x2f976b,_0x3508de,_0x3df8d0;_0x3f0d23[_0x81ff('0x5c')]=intUtil[_0x81ff('0x5b')](_0x3f0d23[_0x81ff('0x5c')]);_0x3f0d23[_0x81ff('0x54')]=intUtil[_0x81ff('0x5b')](_0x3f0d23[_0x81ff('0x54')]);if(_0x73cd49&&_0x73cd49[_0x81ff('0x5d')]){logger[_0x81ff('0x1b')]('['+_0x4f3d96[_0x81ff('0x7a')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x4f3d96[_0x81ff('0x73')]=util['format'](_0x81ff('0x60'),_0x3f0d23['serverUrl'],_0x4f3d96[_0x81ff('0x61')],md5(_0x4f3d96[_0x81ff('0x61')]));}else{_0x4f3d96[_0x81ff('0x73')]='';}return getConnection(_0x3f0d23)[_0x81ff('0x2a')](function(_0x32f643){_0x3df8d0=_0x32f643;if(!_['isNil'](_0xc35442)){return getUser(_0x3f0d23,_0xc35442[_0x81ff('0x4f')],_0x3df8d0);}else{return getUser(_0x3f0d23,null,_0x3df8d0);}})[_0x81ff('0x2a')](function(_0x2efe26){_0xb16fbc=_0x2efe26;return getEndUser(_0x3f0d23,_0x7f0d6a,_0x4f3d96['calleridname'],_0x4f3d96['calleridnum'],_0x3df8d0);})['then'](function(_0x55e141){_0x2f976b=_0x55e141;return getTicket(_0x3f0d23,_0xb16fbc,_0x2f976b,_0x7f0d6a,_0x4f3d96,_0x7f0d6a[_0x81ff('0x65')],_0x3df8d0);})[_0x81ff('0x2a')](function(_0x33d41e){_0x3508de=_0x33d41e;logger['info']('['+_0x4f3d96[_0x81ff('0x7a')]['toUpperCase']()+_0x81ff('0x7b'),_0x3508de['id']);logger[_0x81ff('0x1b')]('['+_0x4f3d96[_0x81ff('0x7a')][_0x81ff('0x7c')]()+_0x81ff('0x7d'),_0x3f0d23[_0x81ff('0x3a')]);})[_0x81ff('0x6f')](function(_0x3e4d10){logger[_0x81ff('0x6d')]('['+_0x4f3d96[_0x81ff('0x7a')][_0x81ff('0x7c')]()+']',_0x3e4d10);});}; \ No newline at end of file +var _0x6c8b=['IsRecurrence','contact','endUserType','lead','WhoId','account','WhatId','AccountId','leadId','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','account_contact_lead','additionalSearchAccount','Lead','Account','first','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','util','./util','../../../../config/environment','redis','localhost','socket.io-emitter','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet'];(function(_0x466415,_0xab36f8){var _0x128c0d=function(_0x5b30bc){while(--_0x5b30bc){_0x466415['push'](_0x466415['shift']());}};_0x128c0d(++_0xab36f8);}(_0x6c8b,0x166));var _0xb6c8=function(_0x469c51,_0x478669){_0x469c51=_0x469c51-0x0;var _0x45d156=_0x6c8b[_0x469c51];return _0x45d156;};'use strict';var _=require(_0xb6c8('0x0'));var rp=require(_0xb6c8('0x1'));var moment=require(_0xb6c8('0x2'));var BPromise=require(_0xb6c8('0x3'));var md5=require('md5');var jsforce=require(_0xb6c8('0x4'));var util=require(_0xb6c8('0x5'));var Redis=require('ioredis');var intUtil=require(_0xb6c8('0x6'));var config=require(_0xb6c8('0x7'));var logger=require('../../../../config/logger')('salesforce');config[_0xb6c8('0x8')]=_['defaults'](config[_0xb6c8('0x8')],{'host':_0xb6c8('0x9'),'port':0x18eb});var io=require(_0xb6c8('0xa'))(new Redis(config[_0xb6c8('0x8')]));function emit(_0x6699e6,_0x500b76,_0x72f5a7){io['to'](_0x6699e6)['emit'](_0x500b76,_0x72f5a7);}function getTicket(_0x1022b7,_0x2b806a,_0x876e3f,_0x35ea0d,_0x276362,_0x25bd3e,_0x3d386c,_0x4dac6a){var _0x5ef5bd=Object[_0xb6c8('0xb')]({},{'OwnerId':_0x2b806a['id'],'Subject':intUtil['getString'](_0x35ea0d[_0xb6c8('0xc')],_0x276362,'\x20'),'Description':intUtil[_0xb6c8('0xd')](_0x35ea0d[_0xb6c8('0xe')],_0x276362,'\x0a')},getCustomFields(_0x25bd3e,_0x276362));if(_0x876e3f){if(_0x35ea0d[_0xb6c8('0xf')]===_0xb6c8('0x10')){_0x5ef5bd[_0xb6c8('0x11')]=moment[_0xb6c8('0x12')]();_0x5ef5bd[_0xb6c8('0x13')]=![];_0x5ef5bd[_0xb6c8('0x14')]=![];if(_0x876e3f['endUserType']===_0xb6c8('0x15')||_0x876e3f[_0xb6c8('0x16')]===_0xb6c8('0x17')){_0x5ef5bd[_0xb6c8('0x18')]=_0x876e3f['id'];}else if(_0x876e3f[_0xb6c8('0x16')]===_0xb6c8('0x19')){_0x5ef5bd[_0xb6c8('0x1a')]=_0x876e3f['id'];}}else if(_0x35ea0d[_0xb6c8('0xf')]==='Case'){if(_0x876e3f[_0xb6c8('0x16')]===_0xb6c8('0x15')){_0x5ef5bd['ContactId']=_0x876e3f['id'];}else if(_0x876e3f[_0xb6c8('0x16')]===_0xb6c8('0x19')){_0x5ef5bd[_0xb6c8('0x1b')]=_0x876e3f['id'];}else if(_0x876e3f[_0xb6c8('0x16')]===_0xb6c8('0x17')&&_0x35ea0d[_0xb6c8('0x1c')]){_0x5ef5bd[_0x35ea0d[_0xb6c8('0x1c')]]=_0x876e3f['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x3d386c[_0xb6c8('0x1d')](_0x35ea0d[_0xb6c8('0xf')])[_0xb6c8('0x1e')](_0x5ef5bd);}function getUser(_0x51607c,_0x35a3df,_0x19a426){if(!_[_0xb6c8('0x1f')](_0x35a3df)&&intUtil[_0xb6c8('0x20')](_0x35a3df)){var _0x59a8de={'Email':_0x35a3df};var _0x467ec1={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x19a426[_0xb6c8('0x1d')](_0xb6c8('0x21'))[_0xb6c8('0x22')](_0x59a8de,_0x467ec1)[_0xb6c8('0x23')]()[_0xb6c8('0x24')](function(_0x1614d1){if(_0x1614d1[_0xb6c8('0x25')]){var _0x25fbc5=_[_0xb6c8('0x22')](_0x1614d1,function(_0x393b94){return _0x393b94[_0xb6c8('0x26')]===_0x35a3df;});if(_0x25fbc5){logger[_0xb6c8('0x27')](_0xb6c8('0x28'),_0x35a3df);return BPromise['resolve']({'id':_0x25fbc5['Id'],'name':_0x25fbc5[_0xb6c8('0x29')]});}}else{logger[_0xb6c8('0x27')](_0xb6c8('0x2a'),_0x35a3df);return _0x19a426[_0xb6c8('0x2b')]()[_0xb6c8('0x24')](function(_0x593fda){return BPromise[_0xb6c8('0x2c')]({'id':_0x593fda[_0xb6c8('0x2d')],'name':_0x593fda[_0xb6c8('0x2e')]});});}});}else{logger[_0xb6c8('0x27')](_0xb6c8('0x2a'),_0x35a3df);return _0x19a426['identity']()['then'](function(_0x34e1bd){return BPromise[_0xb6c8('0x2c')]({'id':_0x34e1bd['user_id'],'name':_0x34e1bd['display_name']});});}}function getEndUser(_0x34e020,_0x59d3cb,_0x322126,_0x3bbd33,_0x37445d){var _0x40e3b0={'$or':{'Phone':_0x3bbd33}};var _0x1d9fab={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xb6c8('0x24')](function(){logger[_0xb6c8('0x27')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x3bbd33,_0x59d3cb[_0xb6c8('0x2f')]);switch(_0x59d3cb[_0xb6c8('0x2f')]){case'contact_lead':var _0x19cbc1=_[_0xb6c8('0x30')](_0x40e3b0);if(_0x59d3cb[_0xb6c8('0x31')]){var _0x5b05ee={};_0x5b05ee[_0x59d3cb[_0xb6c8('0x31')]]=_0x3bbd33;_[_0xb6c8('0x32')](_0x19cbc1[_0xb6c8('0x33')],_0x5b05ee);}return _0x37445d[_0xb6c8('0x1d')](_0xb6c8('0x34'))[_0xb6c8('0x22')](_0x19cbc1,_0x1d9fab)['execute']()[_0xb6c8('0x24')](function(_0x5adf67){if(_0x5adf67&&_0x5adf67[_0xb6c8('0x25')]){return _0x5adf67;}else{var _0x191973=_[_0xb6c8('0x30')](_0x40e3b0);if(_0x59d3cb[_0xb6c8('0x35')]){var _0x3495f2={};_0x3495f2[_0x59d3cb['additionalSearchLead']]=_0x3bbd33;_[_0xb6c8('0x32')](_0x191973[_0xb6c8('0x33')],_0x3495f2);}return _0x37445d[_0xb6c8('0x1d')]('Lead')['find'](_0x191973,_0x1d9fab);}});case _0xb6c8('0x36'):var _0xb5d950=_[_0xb6c8('0x30')](_0x40e3b0);if(_0x59d3cb['additionalSearchAccount']){var _0x5b05ee={};_0x5b05ee[_0x59d3cb[_0xb6c8('0x37')]]=_0x3bbd33;_[_0xb6c8('0x32')](_0xb5d950[_0xb6c8('0x33')],_0x5b05ee);}return _0x37445d[_0xb6c8('0x1d')]('Account')[_0xb6c8('0x22')](_0xb5d950,_0x1d9fab)[_0xb6c8('0x23')]()[_0xb6c8('0x24')](function(_0x430216){if(_0x430216&&_0x430216['length']){return _0x430216;}else{var _0x1507b1=_['cloneDeep'](_0x40e3b0);if(_0x59d3cb['additionalSearchContact']){var _0x274d23={};_0x274d23[_0x59d3cb[_0xb6c8('0x31')]]=_0x3bbd33;_[_0xb6c8('0x32')](_0x1507b1[_0xb6c8('0x33')],_0x274d23);}return _0x37445d[_0xb6c8('0x1d')](_0xb6c8('0x34'))[_0xb6c8('0x22')](_0x1507b1,_0x1d9fab)[_0xb6c8('0x24')](function(_0xfc2cff){if(_0xfc2cff&&_0xfc2cff[_0xb6c8('0x25')]){return _0xfc2cff;}else{var _0x20224c=_[_0xb6c8('0x30')](_0x40e3b0);if(_0x59d3cb['additionalSearchLead']){var _0x421bad={};_0x421bad[_0x59d3cb[_0xb6c8('0x35')]]=_0x3bbd33;_[_0xb6c8('0x32')](_0x20224c['$or'],_0x421bad);}return _0x37445d['sobject']('Lead')[_0xb6c8('0x22')](_0x20224c,_0x1d9fab);}});}});case _0xb6c8('0x15'):var _0x19cbc1=_[_0xb6c8('0x30')](_0x40e3b0);if(_0x59d3cb[_0xb6c8('0x31')]){var _0x5b05ee={};_0x5b05ee[_0x59d3cb[_0xb6c8('0x31')]]=_0x3bbd33;_[_0xb6c8('0x32')](_0x19cbc1[_0xb6c8('0x33')],_0x5b05ee);}return _0x37445d[_0xb6c8('0x1d')](_0xb6c8('0x34'))[_0xb6c8('0x22')](_0x19cbc1,_0x1d9fab)[_0xb6c8('0x23')]();case _0xb6c8('0x17'):var _0x3f156d=_[_0xb6c8('0x30')](_0x40e3b0);if(_0x59d3cb[_0xb6c8('0x35')]){var _0x5b05ee={};_0x5b05ee[_0x59d3cb[_0xb6c8('0x35')]]=_0x3bbd33;_[_0xb6c8('0x32')](_0x3f156d[_0xb6c8('0x33')],_0x5b05ee);}return _0x37445d[_0xb6c8('0x1d')](_0xb6c8('0x38'))[_0xb6c8('0x22')](_0x3f156d,_0x1d9fab);case _0xb6c8('0x19'):var _0xb5d950=_[_0xb6c8('0x30')](_0x40e3b0);if(_0x59d3cb['additionalSearchAccount']){var _0x5b05ee={};_0x5b05ee[_0x59d3cb[_0xb6c8('0x37')]]=_0x3bbd33;_['merge'](_0xb5d950[_0xb6c8('0x33')],_0x5b05ee);}return _0x37445d[_0xb6c8('0x1d')](_0xb6c8('0x39'))[_0xb6c8('0x22')](_0xb5d950,_0x1d9fab);default:return null;}})[_0xb6c8('0x24')](function(_0x189ced){if(_0x189ced&&_0x189ced[_0xb6c8('0x25')]){var _0x5d8f90=_[_0xb6c8('0x3a')](_0x189ced);if(_0x5d8f90){return BPromise[_0xb6c8('0x2c')]({'id':_0x5d8f90['Id'],'name':_0x5d8f90[_0xb6c8('0x29')],'phone':_0x5d8f90['Phone'],'endUserType':_0x5d8f90['attributes'][_0xb6c8('0x3b')][_0xb6c8('0x3c')]()});}}})[_0xb6c8('0x24')](function(_0x239fc3){if(_0x239fc3){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x239fc3['endUserType'],_0x3bbd33);return BPromise[_0xb6c8('0x2c')](_0x239fc3);}else{logger[_0xb6c8('0x27')](_0xb6c8('0x3d'),_0x3bbd33);var _0xd92460={'Phone':_0x3bbd33};if(_0x59d3cb['moduleCreate']){if(_0x59d3cb[_0xb6c8('0x3e')]==='contact'){logger[_0xb6c8('0x27')](_0xb6c8('0x3f'),_0x3bbd33,_0x59d3cb[_0xb6c8('0x3e')]);_0xd92460[_0xb6c8('0x40')]=_0x322126!==_0xb6c8('0x41')?_0x322126:util[_0xb6c8('0x42')](_0xb6c8('0x43'),_0x3bbd33);}else if(_0x59d3cb[_0xb6c8('0x3e')]===_0xb6c8('0x17')){logger[_0xb6c8('0x27')](_0xb6c8('0x3f'),_0x3bbd33,_0x59d3cb[_0xb6c8('0x3e')]);_0xd92460['LastName']=_0x322126!==''?_0x322126:util[_0xb6c8('0x42')](_0xb6c8('0x43'),_0x3bbd33);_0xd92460[_0xb6c8('0x44')]=_0xb6c8('0x45');}else if(_0x59d3cb['moduleCreate']==='account'){logger[_0xb6c8('0x27')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3bbd33,_0x59d3cb['moduleCreate']);_0xd92460[_0xb6c8('0x29')]=_0x322126!==_0xb6c8('0x41')?_0x322126:util[_0xb6c8('0x42')](_0xb6c8('0x43'),_0x3bbd33);}else{return null;}}return _0x37445d[_0xb6c8('0x1d')](_[_0xb6c8('0x46')](_0x59d3cb['moduleCreate']))[_0xb6c8('0x1e')](_0xd92460)[_0xb6c8('0x24')](function(_0x30b025){return BPromise['resolve']({'id':_0x30b025['id'],'endUserType':_0x59d3cb[_0xb6c8('0x3e')]});});}});}function getCustomFields(_0x1942eb,_0x33a44c){var _0x156126={};if(_0x1942eb[_0xb6c8('0x25')]>0x0){_[_0xb6c8('0x47')](_0x1942eb,function(_0x558992){if(_[_0xb6c8('0x48')]([_0xb6c8('0x49'),_0xb6c8('0x4a')],_0x558992['type'])&&_0x558992[_0xb6c8('0x4b')]){_0x156126[_0x558992[_0xb6c8('0x4b')]]=_0x558992[_0xb6c8('0x4c')][_0xb6c8('0x4d')]();}else if(_0x558992[_0xb6c8('0x3b')]===_0xb6c8('0x4e')&&_0x558992[_0xb6c8('0x4f')]&&_0x558992[_0xb6c8('0x4b')]){_0x33a44c[_0x558992[_0xb6c8('0x4f')]]&&(_0x156126[_0x558992[_0xb6c8('0x4b')]]=_0x33a44c[_0x558992[_0xb6c8('0x4f')]]['toString']());}else if(_0x558992[_0xb6c8('0x3b')]===_0xb6c8('0x50')&&_0x558992[_0xb6c8('0x51')]&&_0x558992[_0xb6c8('0x51')]['name']&&_0x558992[_0xb6c8('0x4b')]){_0x33a44c[_0x558992[_0xb6c8('0x51')][_0xb6c8('0x52')][_0xb6c8('0x3c')]()]&&(_0x156126[_0x558992[_0xb6c8('0x4b')]]=_0x33a44c[_0x558992[_0xb6c8('0x51')][_0xb6c8('0x52')][_0xb6c8('0x3c')]()][_0xb6c8('0x4d')]());}});}return _0x156126;}function getConnection(_0x303deb){var _0x5f1d2c=_0x303deb[_0xb6c8('0x53')][_0xb6c8('0x54')](_0x303deb[_0xb6c8('0x55')]);var _0x5bd77f=new jsforce[(_0xb6c8('0x56'))]({'oauth2':{'loginUrl':_0x303deb[_0xb6c8('0x57')]||'https://login.salesforce.com','clientId':_0x303deb['clientId'],'clientSecret':_0x303deb['clientSecret']}});return _0x5bd77f[_0xb6c8('0x58')](_0x303deb['username'],_0x5f1d2c)['then'](function(){logger[_0xb6c8('0x27')](_0xb6c8('0x59'));return _0x5bd77f;});}exports[_0xb6c8('0x5a')]=function(_0x3f006e,_0x4e9382,_0xd411eb,_0x490636,_0x37798a,_0x51a6cb){var _0x3acf7f,_0x4792a8,_0x2b93de,_0x41ee65;_0x51a6cb[_0xb6c8('0x5b')]=intUtil['stripTrailingSlash'](_0x51a6cb[_0xb6c8('0x5b')]);_0x51a6cb[_0xb6c8('0x57')]=intUtil[_0xb6c8('0x5c')](_0x51a6cb[_0xb6c8('0x57')]);if(_0x37798a&&_0x37798a[_0xb6c8('0x5d')]){logger[_0xb6c8('0x27')]('[QUEUE]',_0xb6c8('0x5e'));_0x4e9382[_0xb6c8('0x5f')]=util[_0xb6c8('0x42')](_0xb6c8('0x60'),_0x51a6cb[_0xb6c8('0x5b')],_0x4e9382['uniqueid'],md5(_0x4e9382[_0xb6c8('0x61')]));}else{_0x4e9382[_0xb6c8('0x5f')]='';}return getConnection(_0x51a6cb)[_0xb6c8('0x24')](function(_0x56ec19){_0x41ee65=_0x56ec19;return getUser(_0x51a6cb,_0x490636['email'],_0x41ee65);})[_0xb6c8('0x24')](function(_0x3cf12b){_0x3acf7f=_0x3cf12b;return getEndUser(_0x51a6cb,_0xd411eb,_0x4e9382[_0xb6c8('0x62')],_0x4e9382[_0xb6c8('0x63')],_0x41ee65);})[_0xb6c8('0x24')](function(_0xd7d618){_0x4792a8=_0xd7d618;return getTicket(_0x51a6cb,_0x3acf7f,_0x4792a8,_0xd411eb,_0x4e9382,_0xd411eb[_0xb6c8('0x64')],_0x41ee65,_0xb6c8('0x5a'));})[_0xb6c8('0x24')](function(_0x1ecbe6){_0x2b93de=_0x1ecbe6;logger[_0xb6c8('0x27')](_0xb6c8('0x65'),_0x2b93de['id']);logger['info'](_0xb6c8('0x66'),_0x2b93de['id'],_0x490636[_0xb6c8('0x52')],_0x51a6cb[_0xb6c8('0x3b')]);switch(_0x51a6cb[_0xb6c8('0x3b')]){case _0xb6c8('0x67'):emit(util['format']('user:%s',_0x490636[_0xb6c8('0x52')]),_0xb6c8('0x68'),{'recordId':_0x2b93de['id']});break;case _0xb6c8('0x69'):emit(util[_0xb6c8('0x42')]('user:%s',_0x490636[_0xb6c8('0x52')]),_0xb6c8('0x6a'),{'uri':util[_0xb6c8('0x42')](_0xb6c8('0x6b'),_0x41ee65['instanceUrl'],_0x2b93de['id'])});break;default:logger[_0xb6c8('0x6c')](_0xb6c8('0x6d'));}})[_0xb6c8('0x6e')](function(_0x3cefdb){logger[_0xb6c8('0x6c')]('[QUEUE]',_0x3cefdb);});};exports[_0xb6c8('0x6f')]=function(_0x46263a,_0x4df65a,_0x182d14,_0xe33c7a,_0x2f7c0b,_0x38f7a7,_0x676d54){var _0x423afc,_0x2cf7f3,_0x55cd6f,_0x291634;_0x38f7a7['serverUrl']=intUtil[_0xb6c8('0x5c')](_0x38f7a7[_0xb6c8('0x5b')]);_0x38f7a7[_0xb6c8('0x57')]=intUtil['stripTrailingSlash'](_0x38f7a7[_0xb6c8('0x57')]);if(_0x676d54&&_0x676d54[_0xb6c8('0x70')]&&_0x676d54[_0xb6c8('0x70')]!==_0xb6c8('0x71')){logger[_0xb6c8('0x27')](_0xb6c8('0x72'),_0xb6c8('0x5e'));_0x4df65a[_0xb6c8('0x5f')]=util[_0xb6c8('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38f7a7['serverUrl'],_0x4df65a[_0xb6c8('0x61')],md5(_0x4df65a[_0xb6c8('0x61')]));}return getConnection(_0x38f7a7)[_0xb6c8('0x24')](function(_0x365a0c){_0x291634=_0x365a0c;return getUser(_0x38f7a7,_0xe33c7a[_0xb6c8('0x73')],_0x291634);})[_0xb6c8('0x24')](function(_0x1ffa12){_0x423afc=_0x1ffa12;return getEndUser(_0x38f7a7,_0x182d14,_0x4df65a['destcalleridname'],_0x4df65a[_0xb6c8('0x74')],_0x291634);})[_0xb6c8('0x24')](function(_0x2d3722){_0x2cf7f3=_0x2d3722;return getTicket(_0x38f7a7,_0x423afc,_0x2cf7f3,_0x182d14,_0x4df65a,_0x182d14[_0xb6c8('0x64')],_0x291634,'outbound');})[_0xb6c8('0x24')](function(_0x1b1b57){_0x55cd6f=_0x1b1b57;logger[_0xb6c8('0x27')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x55cd6f['id']);logger[_0xb6c8('0x27')](_0xb6c8('0x75'),_0x55cd6f['id'],_0xe33c7a[_0xb6c8('0x52')],_0x38f7a7[_0xb6c8('0x3b')]);switch(_0x38f7a7[_0xb6c8('0x3b')]){case'integrationTab':emit(util[_0xb6c8('0x42')](_0xb6c8('0x76'),_0xe33c7a[_0xb6c8('0x52')]),_0xb6c8('0x68'),{'recordId':_0x55cd6f['id']});break;case _0xb6c8('0x69'):emit(util[_0xb6c8('0x42')](_0xb6c8('0x76'),_0xe33c7a[_0xb6c8('0x52')]),'trigger:browser:url',{'uri':util[_0xb6c8('0x42')]('%s/%s/e',_0x291634[_0xb6c8('0x77')],_0x55cd6f['id'])});break;default:logger[_0xb6c8('0x6c')](_0xb6c8('0x72'),_0xb6c8('0x78'));}})[_0xb6c8('0x6e')](function(_0x4b3ead){logger[_0xb6c8('0x6c')]('[OUTBOUND]',_0x4b3ead);});};exports[_0xb6c8('0x79')]=function(_0x138943,_0x42a328,_0x5b40f6,_0x171c69,_0x1faad7,_0x19d0e9){var _0x43712b,_0x20e8e6,_0x411968,_0x48cb31;_0x19d0e9[_0xb6c8('0x5b')]=intUtil[_0xb6c8('0x5c')](_0x19d0e9[_0xb6c8('0x5b')]);_0x19d0e9[_0xb6c8('0x57')]=intUtil['stripTrailingSlash'](_0x19d0e9[_0xb6c8('0x57')]);if(_0x1faad7&&_0x1faad7[_0xb6c8('0x5d')]){logger[_0xb6c8('0x27')]('['+_0x42a328[_0xb6c8('0x7a')][_0xb6c8('0x7b')]()+']',_0xb6c8('0x5e'));_0x42a328[_0xb6c8('0x5f')]=util[_0xb6c8('0x42')](_0xb6c8('0x60'),_0x19d0e9[_0xb6c8('0x5b')],_0x42a328[_0xb6c8('0x61')],md5(_0x42a328[_0xb6c8('0x61')]));}else{_0x42a328[_0xb6c8('0x5f')]='';}return getConnection(_0x19d0e9)[_0xb6c8('0x24')](function(_0x5ea626){_0x48cb31=_0x5ea626;if(!_[_0xb6c8('0x1f')](_0x171c69)){return getUser(_0x19d0e9,_0x171c69[_0xb6c8('0x52')],_0x48cb31);}else{return getUser(_0x19d0e9,null,_0x48cb31);}})[_0xb6c8('0x24')](function(_0x3bac6b){_0x43712b=_0x3bac6b;return getEndUser(_0x19d0e9,_0x5b40f6,_0x42a328[_0xb6c8('0x62')],_0x42a328[_0xb6c8('0x63')],_0x48cb31);})[_0xb6c8('0x24')](function(_0x1344ac){_0x20e8e6=_0x1344ac;return getTicket(_0x19d0e9,_0x43712b,_0x20e8e6,_0x5b40f6,_0x42a328,_0x5b40f6[_0xb6c8('0x64')],_0x48cb31);})[_0xb6c8('0x24')](function(_0x56ae35){_0x411968=_0x56ae35;logger[_0xb6c8('0x27')]('['+_0x42a328['lastevent']['toUpperCase']()+_0xb6c8('0x7c'),_0x411968['id']);logger[_0xb6c8('0x27')]('['+_0x42a328[_0xb6c8('0x7a')][_0xb6c8('0x7b')]()+_0xb6c8('0x7d'),_0x19d0e9[_0xb6c8('0x3b')]);})['catch'](function(_0x246c0f){logger['error']('['+_0x42a328[_0xb6c8('0x7a')][_0xb6c8('0x7b')]()+']',_0x246c0f);});}; \ 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 192969b..817ba82 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 _0x7f4a=['remoteUri','serverUrl','%s/api/now/table/','isNil','destcalleridnum','calleridnum','callDirection','queue','unmanaged','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','toUpperCase','],\x20getAdminUser\x20crm','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','length','],\x20createEndUser\x20crm','forEach','includes','picklist','type','customField','toLowerCase','content','toString','string','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','incident','assign','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','catch','label','Incident','ticketId','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','sysparm_limit=1'];(function(_0x49aaee,_0x1156dc){var _0x4e51c7=function(_0x23d961){while(--_0x23d961){_0x49aaee['push'](_0x49aaee['shift']());}};_0x4e51c7(++_0x1156dc);}(_0x7f4a,0x1c7));var _0xa7f4=function(_0x468ac5,_0x2edfd5){_0x468ac5=_0x468ac5-0x0;var _0x33a807=_0x7f4a[_0x468ac5];return _0x33a807;};'use strict';var _=require(_0xa7f4('0x0'));var Promise=require(_0xa7f4('0x1'));var rp=require('request-promise');var util=require(_0xa7f4('0x2'));var md5=require(_0xa7f4('0x3'));var Redis=require(_0xa7f4('0x4'));var intUtil=require(_0xa7f4('0x5'));var config=require(_0xa7f4('0x6'));var logger=require(_0xa7f4('0x7'))(_0xa7f4('0x8'));config[_0xa7f4('0x9')]=_[_0xa7f4('0xa')](config[_0xa7f4('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xa7f4('0xb'))(new Redis(config[_0xa7f4('0x9')]));function getAdminUser(_0x4368c9,_0x46cb60,_0x3fbfb5,_0x399f18,_0x12bae5,_0x492904){return new Promise(function(_0x5026a2,_0x1d3d1e){var _0x5c93e8={'method':_0xa7f4('0xc'),'uri':_0x399f18+_0xa7f4('0xd')+'&'+_0x12bae5+'&'+_0x492904,'auth':_0x46cb60,'json':!![]};return rp(_0x5c93e8)[_0xa7f4('0xe')](function(_0x4bf071){if(_0x4bf071['result']['length']>0x0){_0x3fbfb5['adminId']=_0x4bf071[_0xa7f4('0xf')][0x0][_0xa7f4('0x10')];}logger['info']('['+[_0x4368c9[_0xa7f4('0x11')]()]+_0xa7f4('0x12'),_0x3fbfb5);_0x5026a2(_0x3fbfb5);})['catch'](function(_0x511c8c){logger[_0xa7f4('0x13')]('['+[_0x4368c9[_0xa7f4('0x11')]()]+']',_0x511c8c[_0xa7f4('0x14')]);_0x1d3d1e(_0x511c8c[_0xa7f4('0x14')]);});});}function getUser(_0x873b3a,_0x3d2efd,_0x286c37,_0x598049,_0x28509a){return function(_0x25f211){logger[_0xa7f4('0x15')]('['+[_0x873b3a['toUpperCase']()]+_0xa7f4('0x16'),_0x25f211);return new Promise(function(_0x40a146,_0x1b3edd){if(intUtil[_0xa7f4('0x17')](_0x25f211[_0xa7f4('0x18')])){var _0x477faa={'method':'GET','uri':_0x286c37+_0xa7f4('0x19')+_0x25f211[_0xa7f4('0x18')]+'&'+_0x598049+'&'+_0x28509a,'auth':_0x3d2efd,'json':!![]};logger[_0xa7f4('0x15')]('['+[_0x873b3a[_0xa7f4('0x11')]()]+_0xa7f4('0x1a'),_0x477faa);return rp(_0x477faa)[_0xa7f4('0xe')](function(_0x359e1f){logger['info']('['+[_0x873b3a[_0xa7f4('0x11')]()]+_0xa7f4('0x1b'),_0x359e1f);if(_0x359e1f[_0xa7f4('0xf')]['length']>0x0&&String(_0x359e1f[_0xa7f4('0xf')][0x0]['active'])===_0xa7f4('0x1c')){_0x25f211[_0xa7f4('0x1d')]=_0x359e1f[_0xa7f4('0xf')][0x0]['sys_id'];}else{_0x25f211['userId']=_0x25f211[_0xa7f4('0x1e')];_0x25f211['userEmail']=_0x25f211[_0xa7f4('0x1f')];}logger['info']('['+[_0x873b3a[_0xa7f4('0x11')]()]+_0xa7f4('0x20'),_0x25f211);_0x40a146(_0x25f211);})['catch'](function(_0x4d0792){logger[_0xa7f4('0x13')]('['+[_0x873b3a[_0xa7f4('0x11')]()]+']',_0x4d0792[_0xa7f4('0x14')]);_0x1b3edd(_0x4d0792[_0xa7f4('0x14')]);});}else{logger[_0xa7f4('0x15')]('['+[_0x873b3a[_0xa7f4('0x11')]()]+_0xa7f4('0x21'));_0x25f211[_0xa7f4('0x1d')]=_0x25f211['adminId'];_0x25f211['userEmail']=_0x25f211['adminEmail'];_0x40a146(_0x25f211);}});};}function createEndUser(_0x6e5bd7,_0x4bd238,_0x24212f,_0x233336,_0x199308){logger['info']('['+[_0x6e5bd7['toUpperCase']()]+_0xa7f4('0x22'),_0x24212f);return new Promise(function(_0x459c22,_0x76a965){var _0x2e943b={'method':_0xa7f4('0x23'),'uri':_0x233336+_0xa7f4('0x24')+_0x199308,'body':{'user_name':_0x24212f[_0xa7f4('0x25')],'roles':_0xa7f4('0x26'),'first_name':_0x24212f[_0xa7f4('0x25')],'active':_0xa7f4('0x1c'),'date_format':_0xa7f4('0x27'),'phone':_0x24212f[_0xa7f4('0x25')]},'auth':_0x4bd238,'json':!![]};return rp(_0x2e943b)['then'](function(_0x5c7448){logger[_0xa7f4('0x15')]('['+[_0x6e5bd7[_0xa7f4('0x11')]()]+_0xa7f4('0x28'),_0x5c7448[_0xa7f4('0xf')]);_0x24212f['endUserId']=_0x5c7448[_0xa7f4('0xf')][_0xa7f4('0x10')];_0x459c22(_0x24212f);})['catch'](function(_0x34a937){logger[_0xa7f4('0x13')]('['+[_0x6e5bd7[_0xa7f4('0x11')]()]+']',_0x34a937[_0xa7f4('0x14')]);_0x76a965(_0x34a937['message']);});});}function getEndUser(_0x4b5446,_0x4dd9d3,_0x1db9ad,_0x12acb9,_0x1bcb12){return function(_0x55469d){logger[_0xa7f4('0x15')]('['+[_0x4b5446[_0xa7f4('0x11')]()]+_0xa7f4('0x29'),_0x55469d);return new Promise(function(_0x58a6c6,_0xc9cc56){var _0x19462a={'method':_0xa7f4('0xc'),'uri':_0x1db9ad+_0xa7f4('0x2a')+_0x55469d[_0xa7f4('0x25')]+'&'+_0x12acb9+'&'+_0x1bcb12,'auth':_0x4dd9d3,'json':!![]};return rp(_0x19462a)['then'](function(_0x4d0641){if(_0x4d0641[_0xa7f4('0xf')][_0xa7f4('0x2b')]>0x0){_0x55469d['endUserId']=_0x4d0641[_0xa7f4('0xf')][0x0]['sys_id'];logger[_0xa7f4('0x15')]('['+[_0x4b5446[_0xa7f4('0x11')]()]+'],\x20getEndUser\x20crm',_0x55469d);_0x58a6c6(_0x55469d);}else{return createEndUser(_0x4b5446,_0x4dd9d3,_0x55469d,_0x1db9ad,_0x12acb9)[_0xa7f4('0xe')](function(_0x1b06a9){logger[_0xa7f4('0x15')]('['+[_0x4b5446[_0xa7f4('0x11')]()]+_0xa7f4('0x2c'),_0x1b06a9);_0x58a6c6(_0x1b06a9);});}})['catch'](function(_0x1a09d5){logger['error']('['+[_0x4b5446['toUpperCase']()]+']',_0x1a09d5[_0xa7f4('0x14')]);_0xc9cc56(_0x1a09d5[_0xa7f4('0x14')]);});});};}function getCustomFields(_0x4f3414,_0x1f8b7f){var _0x43b6b1={};if(_0x4f3414[_0xa7f4('0x2b')]>0x0){_[_0xa7f4('0x2d')](_0x4f3414,function(_0x5ae69c){if(_[_0xa7f4('0x2e')](['string',_0xa7f4('0x2f')],_0x5ae69c[_0xa7f4('0x30')])&&_0x5ae69c['nameField']&&!_0x5ae69c[_0xa7f4('0x31')]){_0x43b6b1[_0x5ae69c['nameField'][_0xa7f4('0x32')]()]=_0x5ae69c[_0xa7f4('0x33')][_0xa7f4('0x34')]();}else if(_['includes']([_0xa7f4('0x35'),_0xa7f4('0x2f')],_0x5ae69c[_0xa7f4('0x30')])&&_0x5ae69c[_0xa7f4('0x36')]&&_0x5ae69c['customField']){_0x43b6b1[_0x5ae69c['idField'][_0xa7f4('0x32')]()]=_0x5ae69c['content'][_0xa7f4('0x34')]();}else if(_0x5ae69c[_0xa7f4('0x30')]===_0xa7f4('0x37')&&_0x5ae69c[_0xa7f4('0x38')]&&_0x5ae69c[_0xa7f4('0x36')]&&_0x5ae69c[_0xa7f4('0x31')]){_0x43b6b1[_0x5ae69c[_0xa7f4('0x36')][_0xa7f4('0x32')]()]=_0x1f8b7f[_0x5ae69c[_0xa7f4('0x38')]][_0xa7f4('0x34')]();}else if(_0x5ae69c[_0xa7f4('0x30')]===_0xa7f4('0x39')&&_0x5ae69c[_0xa7f4('0x3a')]&&_0x5ae69c[_0xa7f4('0x3a')][_0xa7f4('0x3b')]&&_0x5ae69c[_0xa7f4('0x36')]&&_0x5ae69c[_0xa7f4('0x31')]){_0x43b6b1[_0x5ae69c['idField']['toLowerCase']()]=_0x1f8b7f[_0x5ae69c[_0xa7f4('0x3a')][_0xa7f4('0x3b')][_0xa7f4('0x32')]()][_0xa7f4('0x34')]();}});}return _0x43b6b1;}function getTicket(_0x2553e2,_0x4344a2,_0x28cf44,_0x3d7531,_0x39d166,_0x49d3aa){return function(_0x95bf09){logger[_0xa7f4('0x15')]('['+[_0x2553e2[_0xa7f4('0x11')]()]+_0xa7f4('0x3c'),_0x95bf09);return new Promise(function(_0x4ba0a7,_0x2615dc){var _0x59bb69=_0x2553e2['toLowerCase']()===_0xa7f4('0x3d')?_0x95bf09[_0xa7f4('0x1d')]:_0x95bf09[_0xa7f4('0x3e')];var _0x46395a={'method':_0xa7f4('0x23'),'uri':_0x28cf44+_0xa7f4('0x3f')+'?'+_0x49d3aa,'body':Object[_0xa7f4('0x40')]({},{'active':_0xa7f4('0x1c'),'caller_id':_0x59bb69,'assigned_to':_0x95bf09['userId'],'short_description':intUtil['getString'](_0x3d7531[_0xa7f4('0x41')],_0x39d166,'\x20'),'description':intUtil[_0xa7f4('0x42')](_0x3d7531[_0xa7f4('0x43')],_0x39d166,'\x0a')},getCustomFields(_0x3d7531[_0xa7f4('0x44')],_0x39d166)),'auth':_0x4344a2,'json':!![]};return rp(_0x46395a)['then'](function(_0x345ef0){logger[_0xa7f4('0x15')]('['+[_0x2553e2[_0xa7f4('0x11')]()]+_0xa7f4('0x45'),_0x345ef0[_0xa7f4('0xf')]);_0x95bf09['ticketId']=_0x345ef0[_0xa7f4('0xf')][_0xa7f4('0x10')];_0x95bf09[_0xa7f4('0x46')]=_0x345ef0[_0xa7f4('0xf')][_0xa7f4('0x47')];logger[_0xa7f4('0x15')]('['+[_0x2553e2[_0xa7f4('0x11')]()]+_0xa7f4('0x48'),_0x95bf09);_0x4ba0a7(_0x95bf09);})[_0xa7f4('0x49')](function(_0x164ee1){logger[_0xa7f4('0x13')]('['+[_0x2553e2[_0xa7f4('0x11')]()]+']',_0x164ee1['message']);_0x2615dc(_0x164ee1[_0xa7f4('0x14')]);});});};}function createRemoteTag(_0x32c7bd,_0x37cf6c,_0x1e7131,_0x4898c3){return new Promise(function(_0x2a401d,_0x2ce1bb){var _0x5838fe={'method':_0xa7f4('0x23'),'uri':_0x1e7131+_0xa7f4('0x4a')+'?'+_0x4898c3,'body':{'short_description':_0x32c7bd,'global':!![],'active':!![],'name':_0x32c7bd},'auth':_0x37cf6c,'json':!![]};return rp(_0x5838fe)[_0xa7f4('0xe')](function(_0x5b9973){var _0x3fe9f2=_0x5b9973[_0xa7f4('0xf')][_0xa7f4('0x10')];_0x2a401d(_0x3fe9f2);});});}function getRemoteTag(_0x1fa5d2,_0x2c3f74,_0x4080a5,_0x2712e9,_0x489cd8){return new Promise(function(_0xb4c2ba,_0x3d56c0){var _0x11d550={'method':'GET','uri':_0x4080a5+'label'+'?sysparm_query=name%3D'+_0x1fa5d2+'&'+_0x2712e9,'auth':_0x2c3f74,'json':!![]};return rp(_0x11d550)[_0xa7f4('0xe')](function(_0x2b5bd4){if(_0x2b5bd4[_0xa7f4('0xf')][_0xa7f4('0x2b')]>0x0){var _0x53bef4=_0x2b5bd4[_0xa7f4('0xf')][0x0][_0xa7f4('0x10')];_0xb4c2ba(_0x53bef4);}else{return createRemoteTag(_0x1fa5d2,_0x2c3f74,_0x4080a5,_0x2712e9)['then'](function(_0x3e567c){_0xb4c2ba(_0x3e567c);});}});});}function assignTagToIncident(_0x13d24d,_0x5daf02,_0x3daa8b,_0x5a2923,_0x5ee7f5){return new Promise(function(_0xba5487,_0x56c16a){var _0x5e6784={'method':_0xa7f4('0x23'),'uri':_0x3daa8b+'label_entry'+'?'+_0x5ee7f5,'body':{'label':_0x13d24d,'table':_0xa7f4('0x3f'),'id_type':_0xa7f4('0x4b'),'table_key':_0x5a2923[_0xa7f4('0x4c')],'title':'Incident\x20-\x20'+_0x5a2923[_0xa7f4('0x46')],'id_display':_0x5a2923[_0xa7f4('0x46')]},'auth':_0x5daf02,'json':!![]};return rp(_0x5e6784)['then'](function(_0x5e7add){_0xba5487();})[_0xa7f4('0x49')](function(){_0xba5487();});});}function manageTags(_0x805f2b,_0x35a6fc,_0x22cf96,_0x192586,_0x39da37,_0x123803,_0xc9be0b){return new Promise(function(_0x5002d8,_0xef0e03){var _0x162fc7=[];_0x35a6fc[_0xa7f4('0x2d')](function(_0x2c2ecf){_0x162fc7[_0xa7f4('0x4d')](getRemoteTag(_0x2c2ecf,_0x22cf96,_0x192586,_0x123803,_0xc9be0b));});return Promise[_0xa7f4('0x4e')](_0x162fc7)[_0xa7f4('0xe')](function(_0x16bc4d){if(_0x16bc4d[_0xa7f4('0x2b')]){logger[_0xa7f4('0x15')]('['+[_0x805f2b[_0xa7f4('0x11')]()]+_0xa7f4('0x4f'),_0x16bc4d);var _0x1fa887=[];_0x16bc4d[_0xa7f4('0x2d')](function(_0x19c3e0){_0x1fa887[_0xa7f4('0x4d')](assignTagToIncident(_0x19c3e0,_0x22cf96,_0x192586,_0x39da37,_0x123803));});return Promise[_0xa7f4('0x4e')](_0x1fa887)['then'](function(){_0x5002d8();})[_0xa7f4('0x49')](function(){_0x5002d8();});}else{_0x5002d8();}});});}function getTags(_0x29df82,_0x2e4698,_0x5d619e,_0x1f1a32,_0x9af3f,_0x2a91bc){return function(_0x1c5335){return new Promise(function(_0x2dc6c6,_0x27fab6){var _0x5b4bbe=[];var _0x567504=_0x1f1a32['Tags'];if(_0x567504&&_0x567504[_0xa7f4('0x2b')]>0x0){_0x5b4bbe=_['map'](_0x567504,_0xa7f4('0x3b'));}if(_0x5b4bbe[_0xa7f4('0x2b')]>0x0){return manageTags(_0x29df82,_0x5b4bbe,_0x2e4698,_0x5d619e,_0x1c5335,_0x9af3f,_0x2a91bc)[_0xa7f4('0xe')](function(){_0x2dc6c6(_0x1c5335);});}else{_0x2dc6c6(_0x1c5335);}});};}function emit(_0xcb010a,_0x44a98f,_0x18845a){var _0x413295=_0xa7f4('0x50')+_0xa7f4('0x51')+_0xa7f4('0x52')+_0xa7f4('0x53');var _0x3559e2={'uri':_0xcb010a+_0xa7f4('0x54')+_0x18845a+_0x413295};io['to'](util[_0xa7f4('0x55')]('user:%s',_0x44a98f))[_0xa7f4('0x56')](_0xa7f4('0x57'),_0x3559e2);}exports['cs']=function(_0x355d61,_0x5c1b70,_0x549805,_0x5595a4,_0x3ffd2a,_0x281b45,_0x6ede5d,_0x2ef20f){var _0x4510f4={};var _0x586eb8={'user':_0x281b45[_0xa7f4('0x58')],'pass':_0x281b45['password']};var _0xe33fc8=_0xa7f4('0x59');var _0xa1b067='sysparm_display_value=true';_0x281b45[_0xa7f4('0x5a')]=intUtil['stripTrailingSlash'](_0x281b45[_0xa7f4('0x5a')]);_0x281b45[_0xa7f4('0x5b')]=intUtil['stripTrailingSlash'](_0x281b45[_0xa7f4('0x5b')]);var _0x20be22=util[_0xa7f4('0x55')](_0xa7f4('0x5c'),_0x281b45[_0xa7f4('0x5a')]);_0x4510f4[_0xa7f4('0x18')]=!_[_0xa7f4('0x5d')](_0x5595a4)?_0x5595a4['email']:null;_0x4510f4[_0xa7f4('0x1f')]=_0x281b45['email'];_0x4510f4[_0xa7f4('0x25')]=_0x2ef20f['toLowerCase']()===_0xa7f4('0x3d')?_0x5c1b70[_0xa7f4('0x5e')]:_0x5c1b70[_0xa7f4('0x5f')];_0x4510f4[_0xa7f4('0x60')]=_0x2ef20f===_0xa7f4('0x61')||_0x2ef20f===_0xa7f4('0x62')?_0xa7f4('0x61'):_0xa7f4('0x3d');var _0x4d34d2=util[_0xa7f4('0x55')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x281b45[_0xa7f4('0x5b')],_0x5c1b70['uniqueid'],md5(_0x5c1b70['uniqueid']));if(_0x3ffd2a&&_0x3ffd2a[_0xa7f4('0x63')]){logger[_0xa7f4('0x15')](_0xa7f4('0x64'),_0xa7f4('0x65'));_0x5c1b70['recordingURL']=_0x4d34d2;}else if(_0x6ede5d&&_0x6ede5d[_0xa7f4('0x66')]&&_0x6ede5d[_0xa7f4('0x66')]!=='none'){logger['info'](_0xa7f4('0x67'),'Recording\x20is\x20enabled!');_0x5c1b70[_0xa7f4('0x68')]=_0x4d34d2;}else{_0x5c1b70[_0xa7f4('0x68')]='';}return getAdminUser(_0x2ef20f,_0x586eb8,_0x4510f4,_0x20be22,_0xa1b067,_0xe33fc8)['then'](getUser(_0x2ef20f,_0x586eb8,_0x20be22,_0xa1b067,_0xe33fc8))[_0xa7f4('0xe')](getEndUser(_0x2ef20f,_0x586eb8,_0x20be22,_0xa1b067,_0xe33fc8))[_0xa7f4('0xe')](getTicket(_0x2ef20f,_0x586eb8,_0x20be22,_0x549805,_0x5c1b70,_0xa1b067))['then'](function(_0x5b3c49){logger[_0xa7f4('0x15')](util[_0xa7f4('0x55')](_0xa7f4('0x69'),_0x5b3c49[_0xa7f4('0x4c')]));logger[_0xa7f4('0x15')](util[_0xa7f4('0x55')](_0xa7f4('0x6a'),_0x2ef20f));if(_0x2ef20f!==_0xa7f4('0x62')){logger[_0xa7f4('0x15')]('['+[_0x2ef20f[_0xa7f4('0x11')]()]+']',_0xa7f4('0x6b'));emit(_0x281b45['remoteUri'],_0x5595a4[_0xa7f4('0x3b')],_0x5b3c49[_0xa7f4('0x4c')]);}})['catch'](function(_0x331095){logger[_0xa7f4('0x13')]('['+[_0x2ef20f[_0xa7f4('0x11')]()]+_0xa7f4('0x6c'),util['inspect'](_0x331095,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5a66=['incident','Incident','ticketId','Incident\x20-\x20',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','all','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user','error','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','nameField','toLowerCase','content','toString','type','customField','idField','variable','variableName','customVariable','name','Variable','outbound','assign','getString','Subjects','Descriptions','Fields','ticketNumber','label','?sysparm_query=name%3D','label_entry'];(function(_0x4ed9ef,_0x381176){var _0x2bb85b=function(_0x35c24d){while(--_0x35c24d){_0x4ed9ef['push'](_0x4ed9ef['shift']());}};_0x2bb85b(++_0x381176);}(_0x5a66,0x169));var _0x65a6=function(_0x29c93a,_0x349acc){_0x29c93a=_0x29c93a-0x0;var _0x4054e5=_0x5a66[_0x29c93a];return _0x4054e5;};'use strict';var _=require('lodash');var Promise=require(_0x65a6('0x0'));var rp=require(_0x65a6('0x1'));var util=require(_0x65a6('0x2'));var md5=require('md5');var Redis=require(_0x65a6('0x3'));var intUtil=require(_0x65a6('0x4'));var config=require(_0x65a6('0x5'));var logger=require(_0x65a6('0x6'))('servicenow');config[_0x65a6('0x7')]=_['defaults'](config[_0x65a6('0x7')],{'host':_0x65a6('0x8'),'port':0x18eb});var io=require(_0x65a6('0x9'))(new Redis(config[_0x65a6('0x7')]));function getAdminUser(_0x1e4073,_0x6869ba,_0x5936e4,_0x2fd4d3,_0x3bb687,_0x2c2d2f){return new Promise(function(_0x277237,_0x303db0){var _0x1de468={'method':_0x65a6('0xa'),'uri':_0x2fd4d3+_0x65a6('0xb')+'&'+_0x3bb687+'&'+_0x2c2d2f,'auth':_0x6869ba,'json':!![]};return rp(_0x1de468)[_0x65a6('0xc')](function(_0x1cbb33){if(_0x1cbb33['result'][_0x65a6('0xd')]>0x0){_0x5936e4[_0x65a6('0xe')]=_0x1cbb33[_0x65a6('0xf')][0x0][_0x65a6('0x10')];}logger[_0x65a6('0x11')]('['+[_0x1e4073[_0x65a6('0x12')]()]+_0x65a6('0x13'),_0x5936e4);_0x277237(_0x5936e4);})[_0x65a6('0x14')](function(_0x5d11a2){logger['error']('['+[_0x1e4073['toUpperCase']()]+']',_0x5d11a2[_0x65a6('0x15')]);_0x303db0(_0x5d11a2[_0x65a6('0x15')]);});});}function getUser(_0x1184aa,_0x2b4b64,_0x52b3b1,_0x5c212d,_0x3e583e){return function(_0x46fbbd){logger[_0x65a6('0x11')]('['+[_0x1184aa[_0x65a6('0x12')]()]+_0x65a6('0x16'),_0x46fbbd);return new Promise(function(_0x2c1ef6,_0x541393){if(intUtil[_0x65a6('0x17')](_0x46fbbd[_0x65a6('0x18')])){var _0x442dbc={'method':_0x65a6('0xa'),'uri':_0x52b3b1+_0x65a6('0x19')+_0x46fbbd[_0x65a6('0x18')]+'&'+_0x5c212d+'&'+_0x3e583e,'auth':_0x2b4b64,'json':!![]};logger[_0x65a6('0x11')]('['+[_0x1184aa[_0x65a6('0x12')]()]+'],\x20getUser\x20rp\x20obj',_0x442dbc);return rp(_0x442dbc)[_0x65a6('0xc')](function(_0xf20ba){logger[_0x65a6('0x11')]('['+[_0x1184aa[_0x65a6('0x12')]()]+'],\x20getUser\x20entity',_0xf20ba);if(_0xf20ba[_0x65a6('0xf')]['length']>0x0&&String(_0xf20ba[_0x65a6('0xf')][0x0][_0x65a6('0x1a')])===_0x65a6('0x1b')){_0x46fbbd[_0x65a6('0x1c')]=_0xf20ba[_0x65a6('0xf')][0x0][_0x65a6('0x10')];}else{_0x46fbbd[_0x65a6('0x1c')]=_0x46fbbd['adminId'];_0x46fbbd[_0x65a6('0x18')]=_0x46fbbd[_0x65a6('0x1d')];}logger[_0x65a6('0x11')]('['+[_0x1184aa[_0x65a6('0x12')]()]+_0x65a6('0x1e'),_0x46fbbd);_0x2c1ef6(_0x46fbbd);})[_0x65a6('0x14')](function(_0x530aa2){logger['error']('['+[_0x1184aa['toUpperCase']()]+']',_0x530aa2[_0x65a6('0x15')]);_0x541393(_0x530aa2[_0x65a6('0x15')]);});}else{logger[_0x65a6('0x11')]('['+[_0x1184aa[_0x65a6('0x12')]()]+_0x65a6('0x1f'));_0x46fbbd['userId']=_0x46fbbd[_0x65a6('0xe')];_0x46fbbd[_0x65a6('0x18')]=_0x46fbbd[_0x65a6('0x1d')];_0x2c1ef6(_0x46fbbd);}});};}function createEndUser(_0x290259,_0x384000,_0x5e339f,_0x3dcea8,_0x17d379){logger[_0x65a6('0x11')]('['+[_0x290259[_0x65a6('0x12')]()]+'],\x20createEndUser\x20input\x20crm',_0x5e339f);return new Promise(function(_0x1b6eb7,_0x57be32){var _0x574d34={'method':_0x65a6('0x20'),'uri':_0x3dcea8+_0x65a6('0x21')+_0x17d379,'body':{'user_name':_0x5e339f[_0x65a6('0x22')],'roles':_0x65a6('0x23'),'first_name':_0x5e339f[_0x65a6('0x22')],'active':_0x65a6('0x1b'),'date_format':'System','phone':_0x5e339f['endUserNumber']},'auth':_0x384000,'json':!![]};return rp(_0x574d34)['then'](function(_0x440e42){logger[_0x65a6('0x11')]('['+[_0x290259[_0x65a6('0x12')]()]+'],\x20EndUser\x20schema',_0x440e42[_0x65a6('0xf')]);_0x5e339f['endUserId']=_0x440e42['result'][_0x65a6('0x10')];_0x1b6eb7(_0x5e339f);})[_0x65a6('0x14')](function(_0x3b83f9){logger[_0x65a6('0x24')]('['+[_0x290259[_0x65a6('0x12')]()]+']',_0x3b83f9[_0x65a6('0x15')]);_0x57be32(_0x3b83f9['message']);});});}function getEndUser(_0x425cba,_0x5e68a0,_0xd6bd89,_0x49e661,_0x46bbfa){return function(_0xbd91e7){logger[_0x65a6('0x11')]('['+[_0x425cba[_0x65a6('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0xbd91e7);return new Promise(function(_0xc85111,_0xad2be7){var _0xc8e9e9={'method':'GET','uri':_0xd6bd89+_0x65a6('0x25')+_0xbd91e7[_0x65a6('0x22')]+'&'+_0x49e661+'&'+_0x46bbfa,'auth':_0x5e68a0,'json':!![]};return rp(_0xc8e9e9)[_0x65a6('0xc')](function(_0x571891){if(_0x571891[_0x65a6('0xf')]['length']>0x0){_0xbd91e7[_0x65a6('0x26')]=_0x571891[_0x65a6('0xf')][0x0]['sys_id'];logger[_0x65a6('0x11')]('['+[_0x425cba[_0x65a6('0x12')]()]+_0x65a6('0x27'),_0xbd91e7);_0xc85111(_0xbd91e7);}else{return createEndUser(_0x425cba,_0x5e68a0,_0xbd91e7,_0xd6bd89,_0x49e661)[_0x65a6('0xc')](function(_0x2fd897){logger['info']('['+[_0x425cba[_0x65a6('0x12')]()]+_0x65a6('0x28'),_0x2fd897);_0xc85111(_0x2fd897);});}})[_0x65a6('0x14')](function(_0xdef02d){logger['error']('['+[_0x425cba['toUpperCase']()]+']',_0xdef02d[_0x65a6('0x15')]);_0xad2be7(_0xdef02d['message']);});});};}function getCustomFields(_0x36de3e,_0x4d8223){var _0x35bd94={};if(_0x36de3e[_0x65a6('0xd')]>0x0){_[_0x65a6('0x29')](_0x36de3e,function(_0x553b3b){if(_[_0x65a6('0x2a')]([_0x65a6('0x2b'),_0x65a6('0x2c')],_0x553b3b['type'])&&_0x553b3b['nameField']&&!_0x553b3b['customField']){_0x35bd94[_0x553b3b[_0x65a6('0x2d')][_0x65a6('0x2e')]()]=_0x553b3b[_0x65a6('0x2f')][_0x65a6('0x30')]();}else if(_[_0x65a6('0x2a')]([_0x65a6('0x2b'),'picklist'],_0x553b3b[_0x65a6('0x31')])&&_0x553b3b['idField']&&_0x553b3b[_0x65a6('0x32')]){_0x35bd94[_0x553b3b[_0x65a6('0x33')]['toLowerCase']()]=_0x553b3b[_0x65a6('0x2f')][_0x65a6('0x30')]();}else if(_0x553b3b[_0x65a6('0x31')]===_0x65a6('0x34')&&_0x553b3b[_0x65a6('0x35')]&&_0x553b3b[_0x65a6('0x33')]&&_0x553b3b[_0x65a6('0x32')]){_0x35bd94[_0x553b3b['idField'][_0x65a6('0x2e')]()]=_0x4d8223[_0x553b3b[_0x65a6('0x35')]][_0x65a6('0x30')]();}else if(_0x553b3b['type']===_0x65a6('0x36')&&_0x553b3b['Variable']&&_0x553b3b['Variable'][_0x65a6('0x37')]&&_0x553b3b[_0x65a6('0x33')]&&_0x553b3b['customField']){_0x35bd94[_0x553b3b[_0x65a6('0x33')]['toLowerCase']()]=_0x4d8223[_0x553b3b[_0x65a6('0x38')][_0x65a6('0x37')][_0x65a6('0x2e')]()]['toString']();}});}return _0x35bd94;}function getTicket(_0x5ef48f,_0x778232,_0x1ff8f7,_0x116adf,_0x9b0d80,_0x37b49f){return function(_0x3f625b){logger[_0x65a6('0x11')]('['+[_0x5ef48f[_0x65a6('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x3f625b);return new Promise(function(_0x5d37e7,_0xa3077e){var _0x5ee429=_0x5ef48f['toLowerCase']()===_0x65a6('0x39')?_0x3f625b['userId']:_0x3f625b['endUserId'];var _0x514c48={'method':_0x65a6('0x20'),'uri':_0x1ff8f7+'incident'+'?'+_0x37b49f,'body':Object[_0x65a6('0x3a')]({},{'active':_0x65a6('0x1b'),'caller_id':_0x5ee429,'assigned_to':_0x3f625b[_0x65a6('0x1c')],'short_description':intUtil[_0x65a6('0x3b')](_0x116adf[_0x65a6('0x3c')],_0x9b0d80,'\x20'),'description':intUtil[_0x65a6('0x3b')](_0x116adf[_0x65a6('0x3d')],_0x9b0d80,'\x0a')},getCustomFields(_0x116adf[_0x65a6('0x3e')],_0x9b0d80)),'auth':_0x778232,'json':!![]};return rp(_0x514c48)[_0x65a6('0xc')](function(_0x46ac13){logger['info']('['+[_0x5ef48f['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x46ac13['result']);_0x3f625b['ticketId']=_0x46ac13[_0x65a6('0xf')][_0x65a6('0x10')];_0x3f625b[_0x65a6('0x3f')]=_0x46ac13[_0x65a6('0xf')]['number'];logger[_0x65a6('0x11')]('['+[_0x5ef48f[_0x65a6('0x12')]()]+']\x20getTicket\x20crm',_0x3f625b);_0x5d37e7(_0x3f625b);})[_0x65a6('0x14')](function(_0x304b39){logger[_0x65a6('0x24')]('['+[_0x5ef48f[_0x65a6('0x12')]()]+']',_0x304b39[_0x65a6('0x15')]);_0xa3077e(_0x304b39[_0x65a6('0x15')]);});});};}function createRemoteTag(_0x1bcf0b,_0x10dc7e,_0x738437,_0x10d8b8){return new Promise(function(_0x2d884b,_0x201e3b){var _0x3969da={'method':_0x65a6('0x20'),'uri':_0x738437+'label'+'?'+_0x10d8b8,'body':{'short_description':_0x1bcf0b,'global':!![],'active':!![],'name':_0x1bcf0b},'auth':_0x10dc7e,'json':!![]};return rp(_0x3969da)[_0x65a6('0xc')](function(_0x11a31e){var _0x13d527=_0x11a31e['result']['sys_id'];_0x2d884b(_0x13d527);});});}function getRemoteTag(_0x5d2468,_0x1d8adb,_0x4add8f,_0x5632ed,_0x2bc8c6){return new Promise(function(_0x3b1d80,_0x4287c3){var _0x19081f={'method':_0x65a6('0xa'),'uri':_0x4add8f+_0x65a6('0x40')+_0x65a6('0x41')+_0x5d2468+'&'+_0x5632ed,'auth':_0x1d8adb,'json':!![]};return rp(_0x19081f)[_0x65a6('0xc')](function(_0x48aae4){if(_0x48aae4[_0x65a6('0xf')]['length']>0x0){var _0x136e4c=_0x48aae4['result'][0x0][_0x65a6('0x10')];_0x3b1d80(_0x136e4c);}else{return createRemoteTag(_0x5d2468,_0x1d8adb,_0x4add8f,_0x5632ed)['then'](function(_0x2b47e6){_0x3b1d80(_0x2b47e6);});}});});}function assignTagToIncident(_0x507567,_0x23e0d8,_0x5b802b,_0x5f4c5a,_0x1e6d55){return new Promise(function(_0xf0f3e1,_0xae8b17){var _0x54b7c6={'method':_0x65a6('0x20'),'uri':_0x5b802b+_0x65a6('0x42')+'?'+_0x1e6d55,'body':{'label':_0x507567,'table':_0x65a6('0x43'),'id_type':_0x65a6('0x44'),'table_key':_0x5f4c5a[_0x65a6('0x45')],'title':_0x65a6('0x46')+_0x5f4c5a[_0x65a6('0x3f')],'id_display':_0x5f4c5a[_0x65a6('0x3f')]},'auth':_0x23e0d8,'json':!![]};return rp(_0x54b7c6)['then'](function(_0x58623b){_0xf0f3e1();})['catch'](function(){_0xf0f3e1();});});}function manageTags(_0x5e264d,_0x24939f,_0x2d89c1,_0x46b92a,_0x41cb18,_0x36e603,_0x1275c2){return new Promise(function(_0x4c2fec,_0x9d3ea){var _0x5ebd7e=[];_0x24939f[_0x65a6('0x29')](function(_0x44069c){_0x5ebd7e['push'](getRemoteTag(_0x44069c,_0x2d89c1,_0x46b92a,_0x36e603,_0x1275c2));});return Promise['all'](_0x5ebd7e)[_0x65a6('0xc')](function(_0x3d7047){if(_0x3d7047['length']){logger[_0x65a6('0x11')]('['+[_0x5e264d[_0x65a6('0x12')]()]+_0x65a6('0x47'),_0x3d7047);var _0x216116=[];_0x3d7047[_0x65a6('0x29')](function(_0x4e911b){_0x216116[_0x65a6('0x48')](assignTagToIncident(_0x4e911b,_0x2d89c1,_0x46b92a,_0x41cb18,_0x36e603));});return Promise[_0x65a6('0x49')](_0x216116)['then'](function(){_0x4c2fec();})['catch'](function(){_0x4c2fec();});}else{_0x4c2fec();}});});}function getTags(_0x59d730,_0x56f1f0,_0x51addb,_0x5369e6,_0x23afbb,_0x961a71){return function(_0x5e2e7c){return new Promise(function(_0x3c3f14,_0x40fae4){var _0x45e005=[];var _0x3a9b38=_0x5369e6['Tags'];if(_0x3a9b38&&_0x3a9b38[_0x65a6('0xd')]>0x0){_0x45e005=_[_0x65a6('0x4a')](_0x3a9b38,_0x65a6('0x37'));}if(_0x45e005[_0x65a6('0xd')]>0x0){return manageTags(_0x59d730,_0x45e005,_0x56f1f0,_0x51addb,_0x5e2e7c,_0x23afbb,_0x961a71)[_0x65a6('0xc')](function(){_0x3c3f14(_0x5e2e7c);});}else{_0x3c3f14(_0x5e2e7c);}});};}function emit(_0x39001e,_0x34078e,_0x39d66e){var _0xdcdaf5='%26sysparm_record_target%3Dincident'+_0x65a6('0x4b')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x65a6('0x4c');var _0x761bcc={'uri':_0x39001e+_0x65a6('0x4d')+_0x39d66e+_0xdcdaf5};io['to'](util[_0x65a6('0x4e')](_0x65a6('0x4f'),_0x34078e))[_0x65a6('0x50')](_0x65a6('0x51'),_0x761bcc);}exports['cs']=function(_0x235499,_0x1b04eb,_0x193363,_0x619bc4,_0x406647,_0x443317,_0x32ec5a,_0x582cb6){var _0x51f5c8={};var _0x450d71={'user':_0x443317['username'],'pass':_0x443317[_0x65a6('0x52')]};var _0x3996a2='sysparm_limit=1';var _0xa2b728=_0x65a6('0x53');_0x443317[_0x65a6('0x54')]=intUtil[_0x65a6('0x55')](_0x443317[_0x65a6('0x54')]);_0x443317[_0x65a6('0x56')]=intUtil[_0x65a6('0x55')](_0x443317['serverUrl']);var _0x537b29=util[_0x65a6('0x4e')](_0x65a6('0x57'),_0x443317['remoteUri']);_0x51f5c8[_0x65a6('0x18')]=!_[_0x65a6('0x58')](_0x619bc4)?_0x619bc4[_0x65a6('0x59')]:null;_0x51f5c8[_0x65a6('0x1d')]=_0x443317[_0x65a6('0x59')];_0x51f5c8[_0x65a6('0x22')]=_0x582cb6[_0x65a6('0x2e')]()==='outbound'?_0x1b04eb[_0x65a6('0x5a')]:_0x1b04eb[_0x65a6('0x5b')];_0x51f5c8[_0x65a6('0x5c')]=_0x582cb6===_0x65a6('0x5d')||_0x582cb6===_0x65a6('0x5e')?'queue':'outbound';var _0x51b9ce=util[_0x65a6('0x4e')](_0x65a6('0x5f'),_0x443317['serverUrl'],_0x1b04eb[_0x65a6('0x60')],md5(_0x1b04eb[_0x65a6('0x60')]));if(_0x406647&&_0x406647[_0x65a6('0x61')]){logger[_0x65a6('0x11')](_0x65a6('0x62'),_0x65a6('0x63'));_0x1b04eb['recordingURL']=_0x51b9ce;}else if(_0x32ec5a&&_0x32ec5a[_0x65a6('0x64')]&&_0x32ec5a[_0x65a6('0x64')]!=='none'){logger[_0x65a6('0x11')](_0x65a6('0x65'),_0x65a6('0x63'));_0x1b04eb['recordingURL']=_0x51b9ce;}else{_0x1b04eb[_0x65a6('0x66')]='';}return getAdminUser(_0x582cb6,_0x450d71,_0x51f5c8,_0x537b29,_0xa2b728,_0x3996a2)[_0x65a6('0xc')](getUser(_0x582cb6,_0x450d71,_0x537b29,_0xa2b728,_0x3996a2))[_0x65a6('0xc')](getEndUser(_0x582cb6,_0x450d71,_0x537b29,_0xa2b728,_0x3996a2))['then'](getTicket(_0x582cb6,_0x450d71,_0x537b29,_0x193363,_0x1b04eb,_0xa2b728))[_0x65a6('0xc')](function(_0x39d94d){logger[_0x65a6('0x11')](util['format'](_0x65a6('0x67'),_0x39d94d['ticketId']));logger[_0x65a6('0x11')](util['format'](_0x65a6('0x68'),_0x582cb6));if(_0x582cb6!==_0x65a6('0x5e')){logger[_0x65a6('0x11')]('['+[_0x582cb6[_0x65a6('0x12')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x443317[_0x65a6('0x54')],_0x619bc4[_0x65a6('0x37')],_0x39d94d['ticketId']);}})[_0x65a6('0x14')](function(_0x284310){logger[_0x65a6('0x24')]('['+[_0x582cb6[_0x65a6('0x12')]()]+_0x65a6('0x69'),util[_0x65a6('0x6a')](_0x284310,{'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 1a6d6a1..c792c92 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 _0x3958=['name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','content','custom_fields','variable','idField','Variable','toLowerCase','login','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','stripTrailingSlash','serverUrl','uri','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Inbound','Ticket\x20created!','users','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','catch','outbound','%s/service/v4_1/rest.php','recordingFormat','recordingURL','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','Outbound','The\x20Ticket\x20ID\x20is:','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','lastevent','toUpperCase','The\x20User\x20ID\x20is:','request-promise','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','variableName','push','set_entry','JSON','stringify','Calls','format','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find'];(function(_0x40c849,_0xbc22a1){var _0x7d3bef=function(_0x23df0c){while(--_0x23df0c){_0x40c849['push'](_0x40c849['shift']());}};_0x7d3bef(++_0xbc22a1);}(_0x3958,0x140));var _0x8395=function(_0x5ede82,_0x4754bc){_0x5ede82=_0x5ede82-0x0;var _0x57c35c=_0x3958[_0x5ede82];return _0x57c35c;};'use strict';var _=require('lodash');var rp=require(_0x8395('0x0'));var BPromise=require(_0x8395('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x8395('0x2'));var intUtil=require(_0x8395('0x3'));var config=require(_0x8395('0x4'));var logger=require(_0x8395('0x5'))('sugarcrm');config[_0x8395('0x6')]=_[_0x8395('0x7')](config['redis'],{'host':_0x8395('0x8'),'port':0x18eb});var io=require(_0x8395('0x9'))(new Redis(config[_0x8395('0x6')]));var def={'method':_0x8395('0xa'),'json':!![]};function emit(_0x326c4d,_0x5b0820,_0x818295){io['to'](_0x326c4d)[_0x8395('0xb')](_0x5b0820,_0x818295);}function getTicket(_0x144440,_0x55a6c0,_0xb2a42c,_0x46ac88,_0x36d0f0,_0x323c40,_0x385faf,_0x1255ad){logger[_0x8395('0xc')](_0x8395('0xd'));var _0x2e9d75=new Date();var _0x178da4=[{'name':_0x8395('0xe'),'value':intUtil[_0x8395('0xf')](_0x46ac88[_0x8395('0x10')],_0x36d0f0,'\x20')},{'name':_0x8395('0x11'),'value':_0x55a6c0['id']},{'name':_0x8395('0x12'),'value':_0x55a6c0['id']},{'name':_0x8395('0x13'),'value':intUtil[_0x8395('0xf')](_0x46ac88[_0x8395('0x14')],_0x36d0f0,'\x0a')},{'name':'date_start','value':_0x2e9d75[_0x8395('0x15')]()[_0x8395('0x16')](0x0,0x13)[_0x8395('0x17')]('T','\x20')},{'name':_0x8395('0x18'),'value':'0'},{'name':_0x8395('0x19'),'value':'15'},{'name':_0x8395('0x1a'),'value':_0xb2a42c['id']},{'name':_0x8395('0x1b'),'value':'Contacts'},{'name':_0x8395('0x1c'),'value':_0xb2a42c['name']},{'name':_0x8395('0x1d'),'value':_0x1255ad}];if(_0x323c40[_0x8395('0x1e')]){_['forEach'](_0x323c40,function(_0x4a88b1){if(_0x36d0f0[_0x4a88b1[_0x8395('0x1f')]]){_0x178da4[_0x8395('0x20')]({'name':_0x4a88b1['idField'],'value':_0x36d0f0[_0x4a88b1['variableName']]});}});}return request({'form':{'method':_0x8395('0x21'),'input_type':_0x8395('0x22'),'response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'session':_0x385faf['id'],'module_name':_0x8395('0x24'),'name_value_list':_0x178da4})}});}function getAuth(_0x32c66e){return util[_0x8395('0x25')]('Basic\x20%s',new Buffer(_0x32c66e['apiKey']+':X')[_0x8395('0x26')](_0x8395('0x27')));}function getServerInfo(_0x5a3d5a){return request({'form':{'method':_0x8395('0x28'),'input_type':_0x8395('0x22'),'response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'session':_0x5a3d5a['id']})}});}function getUser(_0x3e6030,_0x20be61,_0x49577f){if(!_[_0x8395('0x29')](_0x20be61)){logger['info'](_0x8395('0x2a'),_0x20be61);return request({'form':{'method':_0x8395('0x2b'),'input_type':'JSON','response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'session':_0x49577f['id'],'module_name':_0x8395('0x2c'),'query':util[_0x8395('0x25')](_0x8395('0x2d'),_0x20be61),'order_by':'','offset':'0','select_fields':['id',_0x8395('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8395('0x2e')](function(_0x37f3f7){if(_0x37f3f7[_0x8395('0x2f')][_0x8395('0x1e')]){var _0x3f777e=_[_0x8395('0x30')](_0x37f3f7[_0x8395('0x2f')],function(_0x3415fb){return _0x3415fb[_0x8395('0x31')]['user_name']['value']===_0x20be61;});if(_0x3f777e){logger['info'](_0x8395('0x32'));return BPromise[_0x8395('0x33')]({'id':_0x3f777e[_0x8395('0x31')]['id'][_0x8395('0x34')],'name':_0x3f777e[_0x8395('0x31')][_0x8395('0xe')][_0x8395('0x34')]});}}logger[_0x8395('0xc')](_0x8395('0x35'));return BPromise['resolve']({'id':_0x49577f['name_value_list'][_0x8395('0x36')][_0x8395('0x34')],'name':_0x49577f[_0x8395('0x31')][_0x8395('0x37')][_0x8395('0x34')]});});}else{logger['info'](_0x8395('0x38'));return BPromise['resolve']({'id':_0x49577f[_0x8395('0x31')]['user_id'][_0x8395('0x34')],'name':_0x49577f['name_value_list']['user_name']['value']});}}function getEndUser(_0x1cba85,_0x360db1,_0x2cae98,_0x28a0c7){logger[_0x8395('0xc')]('Searching\x20enduser\x20with\x20phone',_0x2cae98);return request({'form':{'method':_0x8395('0x2b'),'input_type':'JSON','response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'session':_0x28a0c7['id'],'module_name':_0x8395('0x39'),'query':util[_0x8395('0x25')](_0x8395('0x3a'),_0x2cae98),'order_by':'','offset':'0','select_fields':['id',_0x8395('0xe'),_0x8395('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8395('0x2e')](function(_0x200fbf){if(_0x200fbf[_0x8395('0x2f')][_0x8395('0x1e')]){var _0xa4e8db=_[_0x8395('0x30')](_0x200fbf[_0x8395('0x2f')],function(_0x1a6f1c){return _0x1a6f1c['name_value_list'][_0x8395('0x3b')][_0x8395('0x34')]===_0x2cae98;});if(_0xa4e8db){logger['info']('Enduser\x20found!');return BPromise[_0x8395('0x33')]({'id':_0xa4e8db[_0x8395('0x31')]['id'][_0x8395('0x34')],'name':_0xa4e8db['name_value_list']['name']['value'],'phone':_0xa4e8db['name_value_list'][_0x8395('0x3b')][_0x8395('0x34')]});}}else{logger[_0x8395('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x8395('0x21'),'input_type':_0x8395('0x22'),'response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'session':_0x28a0c7['id'],'module_name':_0x8395('0x39'),'name_value_list':[{'name':_0x8395('0x3c'),'value':_0x360db1!==_0x8395('0x3d')?_0x360db1:util[_0x8395('0x25')](_0x8395('0x3e'),_0x2cae98)},{'name':_0x8395('0x3b'),'value':_0x2cae98}]})}})[_0x8395('0x2e')](function(_0x352265){logger[_0x8395('0xc')](_0x8395('0x3f'));return BPromise['resolve']({'id':_0x352265['id'],'name':_0x352265[_0x8395('0x2f')][_0x8395('0x3c')][_0x8395('0x34')],'phone':_0x352265[_0x8395('0x2f')][_0x8395('0x3b')][_0x8395('0x34')]});});}});}function request(_0x4c5a7a){logger[_0x8395('0x40')](_0x8395('0x41'),JSON[_0x8395('0x23')](_0x4c5a7a));return rp(_[_0x8395('0x42')](def,_0x4c5a7a));}function getTags(_0x3d5fdc,_0x11d7fb){var _0x1ee4b2=[];if(_0x3d5fdc&&_0x3d5fdc['length']>0x0){_0x1ee4b2=_[_0x8395('0x43')](_0x3d5fdc,_0x11d7fb);}return _0x1ee4b2;}function getCustomFields(_0x2de832,_0x2ab2cd){var _0x10ec35=[];var _0x1378e9={'custom_fields':[]};if(_0x2de832[_0x8395('0x1e')]>0x0){_[_0x8395('0x44')](_0x2de832,function(_0xe47dfa){if(_0xe47dfa[_0x8395('0x45')]===_0x8395('0x46')&&_0xe47dfa[_0x8395('0x47')]&&!_0xe47dfa[_0x8395('0x48')]){_0x1378e9[_0xe47dfa[_0x8395('0x47')]['toLowerCase']()]=_0xe47dfa[_0x8395('0x49')][_0x8395('0x26')]();}else if(_0xe47dfa[_0x8395('0x45')]===_0x8395('0x46')&&_0xe47dfa['idField']&&_0xe47dfa[_0x8395('0x48')]){_0x1378e9[_0x8395('0x4a')]['push']({'id':_0xe47dfa['idField'],'value':_0xe47dfa['content'][_0x8395('0x26')]()});}else if(_0xe47dfa['type']===_0x8395('0x4b')&&_0xe47dfa[_0x8395('0x1f')]&&_0xe47dfa[_0x8395('0x4c')]&&_0xe47dfa[_0x8395('0x48')]){_0x2ab2cd[_0xe47dfa[_0x8395('0x1f')]]&&_0x1378e9[_0x8395('0x4a')][_0x8395('0x20')]({'id':_0xe47dfa['idField'],'value':_0x2ab2cd[_0xe47dfa['variableName']]['toString']()});}else if(_0xe47dfa[_0x8395('0x45')]==='customVariable'&&_0xe47dfa[_0x8395('0x4d')]&&_0xe47dfa[_0x8395('0x4d')]['name']&&_0xe47dfa[_0x8395('0x4c')]&&_0xe47dfa['customField']){_0x2ab2cd[_0xe47dfa[_0x8395('0x4d')][_0x8395('0xe')]['toLowerCase']()]&&_0x1378e9[_0x8395('0x4a')]['push']({'id':_0xe47dfa['idField'],'value':_0x2ab2cd[_0xe47dfa[_0x8395('0x4d')][_0x8395('0xe')][_0x8395('0x4e')]()][_0x8395('0x26')]()});}});}return _0x1378e9;}function getConnection(_0x152fde){return request({'method':_0x8395('0xa'),'form':{'method':_0x8395('0x4f'),'input_type':_0x8395('0x22'),'response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'user_auth':{'user_name':_0x152fde['username'],'password':_0x152fde[_0x8395('0x50')],'encryption':_0x8395('0x51')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x8395('0x2e')](function(_0x53fd73){var _0x3b6fa2=_0x53fd73;if(_0x3b6fa2['id']){def[_0x8395('0x52')]=_0x3b6fa2['id'];return BPromise[_0x8395('0x33')](_0x3b6fa2);}else{throw new Error(util['format'](_0x8395('0x53'),_0x152fde['id']));}});}function setRelationship(_0x19f469,_0x18a895,_0x29984e,_0x3d2cc1){return request({'form':{'method':'set_relationship','input_type':_0x8395('0x22'),'response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'session':_0x19f469['id'],'module_name':'Calls','module_id':_0x29984e['id'],'link_field_name':_0x3d2cc1,'related_ids':[_0x18a895['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x8395('0x54')]=function(_0x37f6f5,_0x1d38dd,_0x4acc24,_0x33a96d,_0x4fda60,_0xf3f05a){var _0xf0d050,_0x42ff8d,_0x113ba2,_0x4a4dcc;_0xf3f05a['remoteUri']=intUtil[_0x8395('0x55')](_0xf3f05a['remoteUri']);_0xf3f05a['serverUrl']=intUtil[_0x8395('0x55')](_0xf3f05a[_0x8395('0x56')]);def[_0x8395('0x57')]=util[_0x8395('0x25')]('%s/service/v4_1/rest.php',_0xf3f05a[_0x8395('0x58')]);if(_0x4fda60&&_0x4fda60[_0x8395('0x59')]){logger[_0x8395('0xc')](_0x8395('0x5a'),_0x8395('0x5b'));_0x1d38dd['recordingURL']=util[_0x8395('0x25')](_0x8395('0x5c'),_0xf3f05a[_0x8395('0x56')],_0x1d38dd[_0x8395('0x5d')],md5(_0x1d38dd[_0x8395('0x5d')]));}else{_0x1d38dd['recordingURL']='';}return getConnection(_0xf3f05a)['then'](function(_0x276d54){_0x4a4dcc=_0x276d54;return getUser(_0xf3f05a,_0x33a96d[_0x8395('0xe')],_0x4a4dcc);})[_0x8395('0x2e')](function(_0x2b38ee){_0xf0d050=_0x2b38ee;logger[_0x8395('0xc')]('The\x20User\x20ID\x20is:',_0xf0d050['id']);return getEndUser(_0xf3f05a,_0x1d38dd[_0x8395('0x5e')],_0x1d38dd[_0x8395('0x5f')],_0x4a4dcc);})['then'](function(_0x1b9d21){_0x42ff8d=_0x1b9d21;logger[_0x8395('0xc')]('The\x20Enduser\x20ID\x20is:',_0x42ff8d['id']);return getTicket(_0xf3f05a,_0xf0d050,_0x42ff8d,_0x4acc24,_0x1d38dd,_0x4acc24['Fields'],_0x4a4dcc,_0x8395('0x60'));})[_0x8395('0x2e')](function(_0x108562){_0x113ba2=_0x108562;logger[_0x8395('0xc')](_0x8395('0x61'));logger[_0x8395('0xc')]('The\x20Ticket\x20ID\x20is:',_0x113ba2['id']);return setRelationship(_0x4a4dcc,_0xf0d050,_0x113ba2,_0x8395('0x62'));})[_0x8395('0x2e')](function(){return setRelationship(_0x4a4dcc,_0x42ff8d,_0x113ba2,'contacts');})[_0x8395('0x2e')](function(){return getServerInfo(_0x4a4dcc);})[_0x8395('0x2e')](function(_0x43387b){var _0x48e328=parseInt(_0x43387b[_0x8395('0x63')][_0x8395('0x64')](0x0));var _0x3ad6f0=util[_0x8395('0x25')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0xf3f05a[_0x8395('0x58')],_0x113ba2['id']);if(_0x48e328>0x6){_0x3ad6f0=util[_0x8395('0x25')](_0x8395('0x65'),_0xf3f05a[_0x8395('0x58')],_0x113ba2['id']);}logger[_0x8395('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x33a96d[_0x8395('0xe')]),'trigger:browser:url',{'uri':_0x3ad6f0});})[_0x8395('0x66')](function(_0x195692){logger['error'](_0x8395('0x5a'),JSON['stringify'](_0x195692));});};exports[_0x8395('0x67')]=function(_0x39b679,_0x26b1a0,_0x384ce3,_0x4322d8,_0x302190,_0x5b4716,_0xb67cbc){var _0x55485e,_0x40f37c,_0x43a200,_0x54efdb;_0x5b4716['remoteUri']=intUtil['stripTrailingSlash'](_0x5b4716[_0x8395('0x58')]);_0x5b4716[_0x8395('0x56')]=intUtil[_0x8395('0x55')](_0x5b4716[_0x8395('0x56')]);def[_0x8395('0x57')]=util['format'](_0x8395('0x68'),_0x5b4716[_0x8395('0x58')]);if(_0xb67cbc&&_0xb67cbc[_0x8395('0x69')]&&_0xb67cbc[_0x8395('0x69')]!=='none'){logger['info']('[OUTBOUND]',_0x8395('0x5b'));_0x26b1a0[_0x8395('0x6a')]=util[_0x8395('0x25')](_0x8395('0x5c'),_0x5b4716[_0x8395('0x56')],_0x26b1a0[_0x8395('0x5d')],md5(_0x26b1a0[_0x8395('0x5d')]));}return getConnection(_0x5b4716)[_0x8395('0x2e')](function(_0x47b00e){_0x54efdb=_0x47b00e;return getUser(_0x5b4716,_0x4322d8[_0x8395('0xe')],_0x54efdb);})[_0x8395('0x2e')](function(_0x6eae58){_0x55485e=_0x6eae58;logger[_0x8395('0xc')]('The\x20User\x20ID\x20is:',_0x55485e['id']);return getEndUser(_0x5b4716,_0x26b1a0[_0x8395('0x6b')],_0x26b1a0[_0x8395('0x6c')],_0x54efdb);})[_0x8395('0x2e')](function(_0x52faaf){_0x40f37c=_0x52faaf;logger[_0x8395('0xc')](_0x8395('0x6d'),_0x40f37c['id']);return getTicket(_0x5b4716,_0x55485e,_0x40f37c,_0x384ce3,_0x26b1a0,_0x384ce3[_0x8395('0x6e')],_0x54efdb,_0x8395('0x6f'));})[_0x8395('0x2e')](function(_0x333aa0){_0x43a200=_0x333aa0;logger[_0x8395('0xc')]('Ticket\x20created!');logger[_0x8395('0xc')](_0x8395('0x70'),_0x43a200['id']);return setRelationship(_0x54efdb,_0x55485e,_0x43a200,_0x8395('0x62'));})['then'](function(){return setRelationship(_0x54efdb,_0x40f37c,_0x43a200,_0x8395('0x71'));})[_0x8395('0x2e')](function(){return getServerInfo(_0x54efdb);})[_0x8395('0x2e')](function(_0x289325){var _0x2f9260=parseInt(_0x289325[_0x8395('0x63')][_0x8395('0x64')](0x0));var _0x3749a1=util[_0x8395('0x25')](_0x8395('0x72'),_0x5b4716[_0x8395('0x58')],_0x43a200['id']);if(_0x2f9260>0x6){_0x3749a1=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5b4716[_0x8395('0x58')],_0x43a200['id']);}logger['info'](_0x8395('0x73'),_0x8395('0x74'));emit(util[_0x8395('0x25')](_0x8395('0x75'),_0x4322d8['name']),_0x8395('0x76'),{'uri':_0x3749a1});})['catch'](function(_0x3b5e74){logger[_0x8395('0x77')](_0x8395('0x73'),JSON[_0x8395('0x23')](_0x3b5e74));});};exports['unmanaged']=function(_0x3b5b33,_0x4b7862,_0x126a35,_0x4985d7,_0x9c6392,_0x47e409){var _0x4cc6db,_0x343dfb,_0x3043b9,_0x41e17b;_0x47e409[_0x8395('0x58')]=intUtil[_0x8395('0x55')](_0x47e409['remoteUri']);_0x47e409[_0x8395('0x56')]=intUtil[_0x8395('0x55')](_0x47e409[_0x8395('0x56')]);def[_0x8395('0x57')]=util['format'](_0x8395('0x68'),_0x47e409[_0x8395('0x58')]);if(_0x9c6392&&_0x9c6392[_0x8395('0x59')]){logger[_0x8395('0xc')]('['+_0x4b7862[_0x8395('0x78')][_0x8395('0x79')]()+']',_0x8395('0x5b'));_0x4b7862[_0x8395('0x6a')]=util[_0x8395('0x25')](_0x8395('0x5c'),_0x47e409[_0x8395('0x56')],_0x4b7862[_0x8395('0x5d')],md5(_0x4b7862[_0x8395('0x5d')]));}else{_0x4b7862[_0x8395('0x6a')]='';}return getConnection(_0x47e409)['then'](function(_0x30e7f9){_0x41e17b=_0x30e7f9;if(!_[_0x8395('0x29')](_0x4985d7)){return getUser(_0x47e409,_0x4985d7[_0x8395('0xe')],_0x41e17b);}else{return getUser(_0x47e409,null,_0x41e17b);}})[_0x8395('0x2e')](function(_0x2b99c0){_0x4cc6db=_0x2b99c0;logger[_0x8395('0xc')](_0x8395('0x7a'),_0x4cc6db['id']);return getEndUser(_0x47e409,_0x4b7862[_0x8395('0x5e')],_0x4b7862[_0x8395('0x5f')],_0x41e17b);})[_0x8395('0x2e')](function(_0x11e172){_0x343dfb=_0x11e172;logger[_0x8395('0xc')](_0x8395('0x6d'),_0x343dfb['id']);return getTicket(_0x47e409,_0x4cc6db,_0x343dfb,_0x126a35,_0x4b7862,_0x126a35['Fields'],_0x41e17b,'Inbound');})[_0x8395('0x2e')](function(_0x212a42){_0x3043b9=_0x212a42;logger['info'](_0x8395('0x61'));logger['info'](_0x8395('0x70'),_0x3043b9['id']);return setRelationship(_0x41e17b,_0x4cc6db,_0x3043b9,'users');})[_0x8395('0x2e')](function(){return setRelationship(_0x41e17b,_0x343dfb,_0x3043b9,_0x8395('0x71'));})['then'](function(){return getServerInfo(_0x41e17b);})[_0x8395('0x66')](function(_0x47d0f1){logger[_0x8395('0x77')]('['+_0x4b7862[_0x8395('0x78')][_0x8395('0x79')]()+']',JSON[_0x8395('0x23')](_0x47d0f1));});}; \ No newline at end of file +var _0xb837=['resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','type','string','nameField','customField','custom_fields','push','content','customVariable','Variable','toLowerCase','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Outbound','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','unmanaged','lastevent','isNil','toUpperCase','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','name','getString','Subjects','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_id','Contacts','parent_name','length','forEach','idField','variableName','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','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','name_value_list','value','Agent\x20found!'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0xb837,0x13d));var _0x7b83=function(_0xda6f7c,_0xc88e83){_0xda6f7c=_0xda6f7c-0x0;var _0x355e75=_0xb837[_0xda6f7c];return _0x355e75;};'use strict';var _=require(_0x7b83('0x0'));var rp=require(_0x7b83('0x1'));var BPromise=require(_0x7b83('0x2'));var md5=require(_0x7b83('0x3'));var util=require('util');var Redis=require(_0x7b83('0x4'));var intUtil=require(_0x7b83('0x5'));var config=require(_0x7b83('0x6'));var logger=require(_0x7b83('0x7'))(_0x7b83('0x8'));config[_0x7b83('0x9')]=_['defaults'](config[_0x7b83('0x9')],{'host':_0x7b83('0xa'),'port':0x18eb});var io=require(_0x7b83('0xb'))(new Redis(config[_0x7b83('0x9')]));var def={'method':_0x7b83('0xc'),'json':!![]};function emit(_0x277d45,_0x3ddc65,_0x318b50){io['to'](_0x277d45)[_0x7b83('0xd')](_0x3ddc65,_0x318b50);}function getTicket(_0x9e9f69,_0x1a8451,_0x4892be,_0x3ce528,_0x162737,_0x40f6ac,_0x2cf41b,_0x1823a9){logger[_0x7b83('0xe')]('Creating\x20new\x20ticket...');var _0x300676=new Date();var _0x1e3af9=[{'name':_0x7b83('0xf'),'value':intUtil[_0x7b83('0x10')](_0x3ce528[_0x7b83('0x11')],_0x162737,'\x20')},{'name':'assigned_user_id','value':_0x1a8451['id']},{'name':_0x7b83('0x12'),'value':_0x1a8451['id']},{'name':_0x7b83('0x13'),'value':intUtil[_0x7b83('0x10')](_0x3ce528[_0x7b83('0x14')],_0x162737,'\x0a')},{'name':_0x7b83('0x15'),'value':_0x300676[_0x7b83('0x16')]()[_0x7b83('0x17')](0x0,0x13)[_0x7b83('0x18')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x7b83('0x19'),'value':'15'},{'name':_0x7b83('0x1a'),'value':_0x4892be['id']},{'name':'parent_type','value':_0x7b83('0x1b')},{'name':_0x7b83('0x1c'),'value':_0x4892be['name']},{'name':'direction','value':_0x1823a9}];if(_0x40f6ac[_0x7b83('0x1d')]){_[_0x7b83('0x1e')](_0x40f6ac,function(_0x474029){if(_0x162737[_0x474029['variableName']]){_0x1e3af9['push']({'name':_0x474029[_0x7b83('0x1f')],'value':_0x162737[_0x474029[_0x7b83('0x20')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x7b83('0x21'),'response_type':'JSON','rest_data':JSON[_0x7b83('0x22')]({'session':_0x2cf41b['id'],'module_name':_0x7b83('0x23'),'name_value_list':_0x1e3af9})}});}function getAuth(_0x4c817d){return util[_0x7b83('0x24')]('Basic\x20%s',new Buffer(_0x4c817d[_0x7b83('0x25')]+':X')[_0x7b83('0x26')](_0x7b83('0x27')));}function getServerInfo(_0x1ef7a3){return request({'form':{'method':_0x7b83('0x28'),'input_type':_0x7b83('0x21'),'response_type':_0x7b83('0x21'),'rest_data':JSON[_0x7b83('0x22')]({'session':_0x1ef7a3['id']})}});}function getUser(_0x2d1f7a,_0x28655c,_0x590bf7){if(!_['isNil'](_0x28655c)){logger[_0x7b83('0xe')](_0x7b83('0x29'),_0x28655c);return request({'form':{'method':_0x7b83('0x2a'),'input_type':_0x7b83('0x21'),'response_type':_0x7b83('0x21'),'rest_data':JSON['stringify']({'session':_0x590bf7['id'],'module_name':_0x7b83('0x2b'),'query':util[_0x7b83('0x24')](_0x7b83('0x2c'),_0x28655c),'order_by':'','offset':'0','select_fields':['id',_0x7b83('0xf'),_0x7b83('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7b83('0x2e')](function(_0x1fe6b0){if(_0x1fe6b0[_0x7b83('0x2f')][_0x7b83('0x1d')]){var _0xc618d8=_[_0x7b83('0x30')](_0x1fe6b0[_0x7b83('0x2f')],function(_0x1d02d0){return _0x1d02d0[_0x7b83('0x31')]['user_name'][_0x7b83('0x32')]===_0x28655c;});if(_0xc618d8){logger['info'](_0x7b83('0x33'));return BPromise[_0x7b83('0x34')]({'id':_0xc618d8[_0x7b83('0x31')]['id']['value'],'name':_0xc618d8[_0x7b83('0x31')][_0x7b83('0xf')][_0x7b83('0x32')]});}}logger[_0x7b83('0xe')](_0x7b83('0x35'));return BPromise[_0x7b83('0x34')]({'id':_0x590bf7[_0x7b83('0x31')]['user_id'][_0x7b83('0x32')],'name':_0x590bf7[_0x7b83('0x31')][_0x7b83('0x2d')]['value']});});}else{logger[_0x7b83('0xe')](_0x7b83('0x36'));return BPromise[_0x7b83('0x34')]({'id':_0x590bf7[_0x7b83('0x31')][_0x7b83('0x37')][_0x7b83('0x32')],'name':_0x590bf7[_0x7b83('0x31')][_0x7b83('0x2d')][_0x7b83('0x32')]});}}function getEndUser(_0x3fc8fb,_0x4307b3,_0x4fecc8,_0x1da9ed){logger[_0x7b83('0xe')]('Searching\x20enduser\x20with\x20phone',_0x4fecc8);return request({'form':{'method':_0x7b83('0x2a'),'input_type':_0x7b83('0x21'),'response_type':_0x7b83('0x21'),'rest_data':JSON[_0x7b83('0x22')]({'session':_0x1da9ed['id'],'module_name':_0x7b83('0x1b'),'query':util[_0x7b83('0x24')](_0x7b83('0x38'),_0x4fecc8),'order_by':'','offset':'0','select_fields':['id',_0x7b83('0xf'),_0x7b83('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0xaa66){if(_0xaa66[_0x7b83('0x2f')][_0x7b83('0x1d')]){var _0xa2bc46=_[_0x7b83('0x30')](_0xaa66[_0x7b83('0x2f')],function(_0x118e10){return _0x118e10[_0x7b83('0x31')][_0x7b83('0x39')][_0x7b83('0x32')]===_0x4fecc8;});if(_0xa2bc46){logger[_0x7b83('0xe')](_0x7b83('0x3a'));return BPromise[_0x7b83('0x34')]({'id':_0xa2bc46['name_value_list']['id']['value'],'name':_0xa2bc46[_0x7b83('0x31')][_0x7b83('0xf')][_0x7b83('0x32')],'phone':_0xa2bc46[_0x7b83('0x31')][_0x7b83('0x39')]['value']});}}else{logger[_0x7b83('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x7b83('0x3b'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x1da9ed['id'],'module_name':_0x7b83('0x1b'),'name_value_list':[{'name':_0x7b83('0x3c'),'value':_0x4307b3!==_0x7b83('0x3d')?_0x4307b3:util[_0x7b83('0x24')](_0x7b83('0x3e'),_0x4fecc8)},{'name':_0x7b83('0x39'),'value':_0x4fecc8}]})}})[_0x7b83('0x2e')](function(_0xcdd745){logger[_0x7b83('0xe')](_0x7b83('0x3f'));return BPromise[_0x7b83('0x34')]({'id':_0xcdd745['id'],'name':_0xcdd745[_0x7b83('0x2f')][_0x7b83('0x3c')][_0x7b83('0x32')],'phone':_0xcdd745['entry_list'][_0x7b83('0x39')][_0x7b83('0x32')]});});}});}function request(_0x1d795a){logger['debug'](_0x7b83('0x40'),JSON['stringify'](_0x1d795a));return rp(_[_0x7b83('0x41')](def,_0x1d795a));}function getTags(_0x435e15,_0x351ef4){var _0x692b25=[];if(_0x435e15&&_0x435e15['length']>0x0){_0x692b25=_[_0x7b83('0x42')](_0x435e15,_0x351ef4);}return _0x692b25;}function getCustomFields(_0x3c8b3b,_0x555eb2){var _0x398d21=[];var _0x120c03={'custom_fields':[]};if(_0x3c8b3b['length']>0x0){_[_0x7b83('0x1e')](_0x3c8b3b,function(_0x2ad2cb){if(_0x2ad2cb[_0x7b83('0x43')]===_0x7b83('0x44')&&_0x2ad2cb[_0x7b83('0x45')]&&!_0x2ad2cb[_0x7b83('0x46')]){_0x120c03[_0x2ad2cb['nameField']['toLowerCase']()]=_0x2ad2cb['content']['toString']();}else if(_0x2ad2cb[_0x7b83('0x43')]===_0x7b83('0x44')&&_0x2ad2cb['idField']&&_0x2ad2cb[_0x7b83('0x46')]){_0x120c03[_0x7b83('0x47')][_0x7b83('0x48')]({'id':_0x2ad2cb[_0x7b83('0x1f')],'value':_0x2ad2cb[_0x7b83('0x49')][_0x7b83('0x26')]()});}else if(_0x2ad2cb[_0x7b83('0x43')]==='variable'&&_0x2ad2cb[_0x7b83('0x20')]&&_0x2ad2cb['idField']&&_0x2ad2cb[_0x7b83('0x46')]){_0x555eb2[_0x2ad2cb['variableName']]&&_0x120c03[_0x7b83('0x47')][_0x7b83('0x48')]({'id':_0x2ad2cb[_0x7b83('0x1f')],'value':_0x555eb2[_0x2ad2cb[_0x7b83('0x20')]][_0x7b83('0x26')]()});}else if(_0x2ad2cb['type']===_0x7b83('0x4a')&&_0x2ad2cb[_0x7b83('0x4b')]&&_0x2ad2cb[_0x7b83('0x4b')]['name']&&_0x2ad2cb['idField']&&_0x2ad2cb[_0x7b83('0x46')]){_0x555eb2[_0x2ad2cb[_0x7b83('0x4b')][_0x7b83('0xf')][_0x7b83('0x4c')]()]&&_0x120c03[_0x7b83('0x47')][_0x7b83('0x48')]({'id':_0x2ad2cb[_0x7b83('0x1f')],'value':_0x555eb2[_0x2ad2cb[_0x7b83('0x4b')][_0x7b83('0xf')][_0x7b83('0x4c')]()][_0x7b83('0x26')]()});}});}return _0x120c03;}function getConnection(_0x43de96){return request({'method':_0x7b83('0xc'),'form':{'method':_0x7b83('0x4d'),'input_type':_0x7b83('0x21'),'response_type':_0x7b83('0x21'),'rest_data':JSON[_0x7b83('0x22')]({'user_auth':{'user_name':_0x43de96[_0x7b83('0x4e')],'password':_0x43de96[_0x7b83('0x4f')],'encryption':_0x7b83('0x50')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x7b83('0x2e')](function(_0x558a1f){var _0x1f7114=_0x558a1f;if(_0x1f7114['id']){def[_0x7b83('0x51')]=_0x1f7114['id'];return BPromise['resolve'](_0x1f7114);}else{throw new Error(util['format'](_0x7b83('0x52'),_0x43de96['id']));}});}function setRelationship(_0x64aef1,_0x529f25,_0x519e9c,_0x27ea70){return request({'form':{'method':'set_relationship','input_type':_0x7b83('0x21'),'response_type':'JSON','rest_data':JSON[_0x7b83('0x22')]({'session':_0x64aef1['id'],'module_name':_0x7b83('0x23'),'module_id':_0x519e9c['id'],'link_field_name':_0x27ea70,'related_ids':[_0x529f25['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x7b83('0x53')]=function(_0x492678,_0x10b5a6,_0x3f6085,_0x357798,_0x3bf67e,_0x28af55){var _0x4922d7,_0x184912,_0x52a48e,_0x2d358a;_0x28af55[_0x7b83('0x54')]=intUtil[_0x7b83('0x55')](_0x28af55[_0x7b83('0x54')]);_0x28af55['serverUrl']=intUtil[_0x7b83('0x55')](_0x28af55[_0x7b83('0x56')]);def[_0x7b83('0x57')]=util[_0x7b83('0x24')](_0x7b83('0x58'),_0x28af55[_0x7b83('0x54')]);if(_0x3bf67e&&_0x3bf67e[_0x7b83('0x59')]){logger[_0x7b83('0xe')](_0x7b83('0x5a'),'Recording\x20is\x20enabled!');_0x10b5a6[_0x7b83('0x5b')]=util[_0x7b83('0x24')](_0x7b83('0x5c'),_0x28af55[_0x7b83('0x56')],_0x10b5a6['uniqueid'],md5(_0x10b5a6[_0x7b83('0x5d')]));}else{_0x10b5a6[_0x7b83('0x5b')]='';}return getConnection(_0x28af55)[_0x7b83('0x2e')](function(_0x4f7981){_0x2d358a=_0x4f7981;return getUser(_0x28af55,_0x357798['name'],_0x2d358a);})[_0x7b83('0x2e')](function(_0x51a9f5){_0x4922d7=_0x51a9f5;logger[_0x7b83('0xe')](_0x7b83('0x5e'),_0x4922d7['id']);return getEndUser(_0x28af55,_0x10b5a6[_0x7b83('0x5f')],_0x10b5a6[_0x7b83('0x60')],_0x2d358a);})['then'](function(_0x1851f7){_0x184912=_0x1851f7;logger[_0x7b83('0xe')](_0x7b83('0x61'),_0x184912['id']);return getTicket(_0x28af55,_0x4922d7,_0x184912,_0x3f6085,_0x10b5a6,_0x3f6085[_0x7b83('0x62')],_0x2d358a,_0x7b83('0x63'));})[_0x7b83('0x2e')](function(_0xf50e7e){_0x52a48e=_0xf50e7e;logger['info'](_0x7b83('0x64'));logger[_0x7b83('0xe')](_0x7b83('0x65'),_0x52a48e['id']);return setRelationship(_0x2d358a,_0x4922d7,_0x52a48e,_0x7b83('0x66'));})['then'](function(){return setRelationship(_0x2d358a,_0x184912,_0x52a48e,_0x7b83('0x67'));})['then'](function(){return getServerInfo(_0x2d358a);})['then'](function(_0x405607){var _0x4ae790=parseInt(_0x405607[_0x7b83('0x68')][_0x7b83('0x69')](0x0));var _0x1256fc=util[_0x7b83('0x24')](_0x7b83('0x6a'),_0x28af55[_0x7b83('0x54')],_0x52a48e['id']);if(_0x4ae790>0x6){_0x1256fc=util[_0x7b83('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x28af55['remoteUri'],_0x52a48e['id']);}logger[_0x7b83('0xe')]('[QUEUE]',_0x7b83('0x6b'));emit(util[_0x7b83('0x24')](_0x7b83('0x6c'),_0x357798[_0x7b83('0xf')]),_0x7b83('0x6d'),{'uri':_0x1256fc});})[_0x7b83('0x6e')](function(_0x57d553){logger[_0x7b83('0x6f')](_0x7b83('0x5a'),JSON[_0x7b83('0x22')](_0x57d553));});};exports[_0x7b83('0x70')]=function(_0x4fbcd2,_0x35df35,_0x24a023,_0xcfd778,_0x5eea9e,_0xb92b35,_0x5685e3){var _0xf444f4,_0x4af6bc,_0x451adc,_0x1cc8c0;_0xb92b35['remoteUri']=intUtil[_0x7b83('0x55')](_0xb92b35['remoteUri']);_0xb92b35[_0x7b83('0x56')]=intUtil[_0x7b83('0x55')](_0xb92b35['serverUrl']);def[_0x7b83('0x57')]=util[_0x7b83('0x24')](_0x7b83('0x58'),_0xb92b35[_0x7b83('0x54')]);if(_0x5685e3&&_0x5685e3['recordingFormat']&&_0x5685e3[_0x7b83('0x71')]!==_0x7b83('0x72')){logger[_0x7b83('0xe')](_0x7b83('0x73'),_0x7b83('0x74'));_0x35df35[_0x7b83('0x5b')]=util['format'](_0x7b83('0x5c'),_0xb92b35['serverUrl'],_0x35df35[_0x7b83('0x5d')],md5(_0x35df35['uniqueid']));}return getConnection(_0xb92b35)[_0x7b83('0x2e')](function(_0x448e0f){_0x1cc8c0=_0x448e0f;return getUser(_0xb92b35,_0xcfd778['name'],_0x1cc8c0);})['then'](function(_0x53d56e){_0xf444f4=_0x53d56e;logger[_0x7b83('0xe')]('The\x20User\x20ID\x20is:',_0xf444f4['id']);return getEndUser(_0xb92b35,_0x35df35['destcalleridname'],_0x35df35['destcalleridnum'],_0x1cc8c0);})['then'](function(_0xaec8d2){_0x4af6bc=_0xaec8d2;logger[_0x7b83('0xe')](_0x7b83('0x61'),_0x4af6bc['id']);return getTicket(_0xb92b35,_0xf444f4,_0x4af6bc,_0x24a023,_0x35df35,_0x24a023[_0x7b83('0x62')],_0x1cc8c0,_0x7b83('0x75'));})['then'](function(_0x5b74c3){_0x451adc=_0x5b74c3;logger[_0x7b83('0xe')]('Ticket\x20created!');logger[_0x7b83('0xe')](_0x7b83('0x65'),_0x451adc['id']);return setRelationship(_0x1cc8c0,_0xf444f4,_0x451adc,'users');})[_0x7b83('0x2e')](function(){return setRelationship(_0x1cc8c0,_0x4af6bc,_0x451adc,_0x7b83('0x67'));})[_0x7b83('0x2e')](function(){return getServerInfo(_0x1cc8c0);})['then'](function(_0x4f62f8){var _0x11fb5e=parseInt(_0x4f62f8[_0x7b83('0x68')][_0x7b83('0x69')](0x0));var _0x4a5cf3=util[_0x7b83('0x24')](_0x7b83('0x6a'),_0xb92b35['remoteUri'],_0x451adc['id']);if(_0x11fb5e>0x6){_0x4a5cf3=util['format'](_0x7b83('0x76'),_0xb92b35[_0x7b83('0x54')],_0x451adc['id']);}logger[_0x7b83('0xe')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7b83('0x24')](_0x7b83('0x6c'),_0xcfd778[_0x7b83('0xf')]),'trigger:browser:url',{'uri':_0x4a5cf3});})[_0x7b83('0x6e')](function(_0x5ca562){logger[_0x7b83('0x6f')](_0x7b83('0x73'),JSON[_0x7b83('0x22')](_0x5ca562));});};exports[_0x7b83('0x77')]=function(_0x37e541,_0x1c7d17,_0x44c836,_0x49d9f9,_0x338f54,_0x3e5caa){var _0x12e229,_0x171966,_0x491fc0,_0x4cd98f;_0x3e5caa[_0x7b83('0x54')]=intUtil['stripTrailingSlash'](_0x3e5caa[_0x7b83('0x54')]);_0x3e5caa[_0x7b83('0x56')]=intUtil['stripTrailingSlash'](_0x3e5caa['serverUrl']);def[_0x7b83('0x57')]=util[_0x7b83('0x24')](_0x7b83('0x58'),_0x3e5caa['remoteUri']);if(_0x338f54&&_0x338f54[_0x7b83('0x59')]){logger['info']('['+_0x1c7d17[_0x7b83('0x78')]['toUpperCase']()+']',_0x7b83('0x74'));_0x1c7d17[_0x7b83('0x5b')]=util[_0x7b83('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3e5caa[_0x7b83('0x56')],_0x1c7d17[_0x7b83('0x5d')],md5(_0x1c7d17[_0x7b83('0x5d')]));}else{_0x1c7d17['recordingURL']='';}return getConnection(_0x3e5caa)[_0x7b83('0x2e')](function(_0x15fa16){_0x4cd98f=_0x15fa16;if(!_[_0x7b83('0x79')](_0x49d9f9)){return getUser(_0x3e5caa,_0x49d9f9[_0x7b83('0xf')],_0x4cd98f);}else{return getUser(_0x3e5caa,null,_0x4cd98f);}})['then'](function(_0x514662){_0x12e229=_0x514662;logger[_0x7b83('0xe')](_0x7b83('0x5e'),_0x12e229['id']);return getEndUser(_0x3e5caa,_0x1c7d17['calleridname'],_0x1c7d17[_0x7b83('0x60')],_0x4cd98f);})[_0x7b83('0x2e')](function(_0x237902){_0x171966=_0x237902;logger[_0x7b83('0xe')]('The\x20Enduser\x20ID\x20is:',_0x171966['id']);return getTicket(_0x3e5caa,_0x12e229,_0x171966,_0x44c836,_0x1c7d17,_0x44c836[_0x7b83('0x62')],_0x4cd98f,_0x7b83('0x63'));})[_0x7b83('0x2e')](function(_0x10c2b8){_0x491fc0=_0x10c2b8;logger[_0x7b83('0xe')]('Ticket\x20created!');logger[_0x7b83('0xe')](_0x7b83('0x65'),_0x491fc0['id']);return setRelationship(_0x4cd98f,_0x12e229,_0x491fc0,_0x7b83('0x66'));})[_0x7b83('0x2e')](function(){return setRelationship(_0x4cd98f,_0x171966,_0x491fc0,_0x7b83('0x67'));})[_0x7b83('0x2e')](function(){return getServerInfo(_0x4cd98f);})[_0x7b83('0x6e')](function(_0x5ca6a4){logger[_0x7b83('0x6f')]('['+_0x1c7d17[_0x7b83('0x78')][_0x7b83('0x7a')]()+']',JSON['stringify'](_0x5ca6a4));});}; \ 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 70a30de..f576d8c 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 _0x51f4=['getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','lodash','util'];(function(_0x50a1fc,_0x340938){var _0x312628=function(_0x1d0878){while(--_0x1d0878){_0x50a1fc['push'](_0x50a1fc['shift']());}};_0x312628(++_0x340938);}(_0x51f4,0x1ae));var _0x451f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x51f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x451f('0x0'));var util=require(_0x451f('0x1'));exports[_0x451f('0x2')]=function(_0x2c1d60,_0x2e251b,_0x4c4e9b){var _0x42d43d=[];if(_0x2c1d60[_0x451f('0x3')]>0x0){var _0x35131e=_[_0x451f('0x4')](_0x2c1d60,['id']);for(var _0x4f76dd=0x0;_0x4f76dd<_0x35131e[_0x451f('0x3')];_0x4f76dd++){var _0x547912=_0x35131e[_0x4f76dd];if(_0x547912[_0x451f('0x5')]===_0x451f('0x6')){_0x42d43d[_0x451f('0x7')](_0x547912[_0x451f('0x8')]);}else if(_0x547912['type']===_0x451f('0x9')&&_0x547912[_0x451f('0xa')]){_0x2e251b[_0x547912['variableName']]&&_0x42d43d[_0x451f('0x7')](_0x2e251b[_0x547912[_0x451f('0xa')]][_0x451f('0xb')]());}else if(_0x547912[_0x451f('0x5')]===_0x451f('0xc')&&_0x547912[_0x451f('0xd')]&&_0x547912['Variable'][_0x451f('0xe')]){_0x2e251b[_0x547912['Variable'][_0x451f('0xe')][_0x451f('0xf')]()]&&_0x42d43d[_0x451f('0x7')](_0x2e251b[_0x547912['Variable'][_0x451f('0xe')]['toLowerCase']()][_0x451f('0xb')]());}else if(_0x547912[_0x451f('0x5')]===_0x451f('0x10')){if(_0x547912[_0x451f('0x11')]==='string'&&_0x547912[_0x451f('0x12')]){_0x42d43d[_0x451f('0x7')](util[_0x451f('0x13')](_0x451f('0x14'),_0x547912[_0x451f('0x12')],_0x547912['keyContent']));}else if(_0x547912[_0x451f('0x11')]===_0x451f('0x9')&&_0x547912['variableName']&&_0x547912['key']){_0x2e251b[_0x547912[_0x451f('0xa')]]&&_0x42d43d[_0x451f('0x7')](util[_0x451f('0x13')]('%s:\x20%s',_0x547912['key'],_0x2e251b[_0x547912[_0x451f('0xa')]]));}else if(_0x547912[_0x451f('0x11')]==='customVariable'&&_0x547912[_0x451f('0xd')]&&_0x547912[_0x451f('0xd')][_0x451f('0xe')]&&_0x547912[_0x451f('0x12')]){_0x2e251b[_0x547912[_0x451f('0xd')][_0x451f('0xe')][_0x451f('0xf')]()]&&_0x42d43d[_0x451f('0x7')](util[_0x451f('0x13')](_0x451f('0x14'),_0x547912['key'],_0x2e251b[_0x547912[_0x451f('0xd')][_0x451f('0xe')][_0x451f('0xf')]()]));}}}}return _0x42d43d['join'](_0x4c4e9b);};exports[_0x451f('0x15')]=function(_0x2db112){var _0x5ae4b3=_0x2db112[_0x451f('0x16')](-0x1);if(_0x5ae4b3==='/'){_0x2db112=_0x2db112[_0x451f('0x17')](0x0,_0x2db112[_0x451f('0x18')](_0x5ae4b3));}return _0x2db112;};exports['validateEmail']=function(_0x45f541){if(!_[_0x451f('0x19')](_0x45f541)&&_0x45f541!==''){var _0x104e62=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x104e62[_0x451f('0x1a')](String(_0x45f541)[_0x451f('0xf')]());}else{return![];}}; \ No newline at end of file +var _0x1e67=['string','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','key','format','keyContent','keyType','%s:\x20%s','customVariable','join','stripTrailingSlash','slice','lastIndexOf','isNil','lodash','util','getString','length','sortBy','type'];(function(_0x5d76fe,_0x27d349){var _0xc039a9=function(_0x4f525f){while(--_0x4f525f){_0x5d76fe['push'](_0x5d76fe['shift']());}};_0xc039a9(++_0x27d349);}(_0x1e67,0x66));var _0x71e6=function(_0x1db44d,_0x297b18){_0x1db44d=_0x1db44d-0x0;var _0x52b017=_0x1e67[_0x1db44d];return _0x52b017;};'use strict';var _=require(_0x71e6('0x0'));var util=require(_0x71e6('0x1'));exports[_0x71e6('0x2')]=function(_0x6b2878,_0xcd726d,_0x557378){var _0x208ac5=[];if(_0x6b2878[_0x71e6('0x3')]>0x0){var _0x2567cc=_[_0x71e6('0x4')](_0x6b2878,['id']);for(var _0x1f3cf0=0x0;_0x1f3cf0<_0x2567cc['length'];_0x1f3cf0++){var _0x3c5ae9=_0x2567cc[_0x1f3cf0];if(_0x3c5ae9[_0x71e6('0x5')]===_0x71e6('0x6')){_0x208ac5[_0x71e6('0x7')](_0x3c5ae9[_0x71e6('0x8')]);}else if(_0x3c5ae9[_0x71e6('0x5')]===_0x71e6('0x9')&&_0x3c5ae9[_0x71e6('0xa')]){_0xcd726d[_0x3c5ae9['variableName']]&&_0x208ac5['push'](_0xcd726d[_0x3c5ae9[_0x71e6('0xa')]][_0x71e6('0xb')]());}else if(_0x3c5ae9['type']==='customVariable'&&_0x3c5ae9[_0x71e6('0xc')]&&_0x3c5ae9[_0x71e6('0xc')][_0x71e6('0xd')]){_0xcd726d[_0x3c5ae9['Variable'][_0x71e6('0xd')][_0x71e6('0xe')]()]&&_0x208ac5['push'](_0xcd726d[_0x3c5ae9[_0x71e6('0xc')][_0x71e6('0xd')][_0x71e6('0xe')]()]['toString']());}else if(_0x3c5ae9[_0x71e6('0x5')]===_0x71e6('0xf')){if(_0x3c5ae9['keyType']===_0x71e6('0x6')&&_0x3c5ae9[_0x71e6('0x10')]){_0x208ac5[_0x71e6('0x7')](util[_0x71e6('0x11')]('%s:\x20%s',_0x3c5ae9[_0x71e6('0x10')],_0x3c5ae9[_0x71e6('0x12')]));}else if(_0x3c5ae9[_0x71e6('0x13')]==='variable'&&_0x3c5ae9[_0x71e6('0xa')]&&_0x3c5ae9['key']){_0xcd726d[_0x3c5ae9[_0x71e6('0xa')]]&&_0x208ac5[_0x71e6('0x7')](util[_0x71e6('0x11')](_0x71e6('0x14'),_0x3c5ae9['key'],_0xcd726d[_0x3c5ae9[_0x71e6('0xa')]]));}else if(_0x3c5ae9[_0x71e6('0x13')]===_0x71e6('0x15')&&_0x3c5ae9[_0x71e6('0xc')]&&_0x3c5ae9['Variable'][_0x71e6('0xd')]&&_0x3c5ae9[_0x71e6('0x10')]){_0xcd726d[_0x3c5ae9[_0x71e6('0xc')][_0x71e6('0xd')]['toLowerCase']()]&&_0x208ac5[_0x71e6('0x7')](util['format']('%s:\x20%s',_0x3c5ae9[_0x71e6('0x10')],_0xcd726d[_0x3c5ae9[_0x71e6('0xc')]['name']['toLowerCase']()]));}}}}return _0x208ac5[_0x71e6('0x16')](_0x557378);};exports[_0x71e6('0x17')]=function(_0x176468){var _0x150b75=_0x176468[_0x71e6('0x18')](-0x1);if(_0x150b75==='/'){_0x176468=_0x176468['substring'](0x0,_0x176468[_0x71e6('0x19')](_0x150b75));}return _0x176468;};exports['validateEmail']=function(_0x291fd2){if(!_[_0x71e6('0x1a')](_0x291fd2)&&_0x291fd2!==''){var _0x5c103b=/^(([^<>()\[\]\\.,;:\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 _0x5c103b['test'](String(_0x291fd2)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index ee53c05..20b2032 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 _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x4c70c4,_0x963969){var _0x437865=function(_0x54e323){while(--_0x54e323){_0x4c70c4['push'](_0x4c70c4['shift']());}};_0x437865(++_0x963969);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ No newline at end of file +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(_0x44b29d,_0x237542){var _0x41022a=function(_0x13791a){while(--_0x13791a){_0x44b29d['push'](_0x44b29d['shift']());}};_0x41022a(++_0x237542);}(_0x34e8,0x12c));var _0x834e=function(_0x22595d,_0x286883){_0x22595d=_0x22595d-0x0;var _0x10f944=_0x34e8[_0x22595d];return _0x10f944;};'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 diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 57ce640..b678efa 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 _0xc9d6=['find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','end-user','length','first','Enduser\x20found!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','type','customField','toLowerCase','content','idField','custom_fields','push','variableName','customVariable','Variable','name','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','[OUTBOUND]','Authorization','destcalleridname','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','localhost','redis','emit','application/json','info','%s/tickets.json','remoteUri','getString','Subjects','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!'];(function(_0x463ace,_0x21a674){var _0x10adbb=function(_0x4611a0){while(--_0x4611a0){_0x463ace['push'](_0x463ace['shift']());}};_0x10adbb(++_0x21a674);}(_0xc9d6,0x18a));var _0x6c9d=function(_0x5ad399,_0x2fc72a){_0x5ad399=_0x5ad399-0x0;var _0x5f0b40=_0xc9d6[_0x5ad399];return _0x5f0b40;};'use strict';var _=require(_0x6c9d('0x0'));var rp=require(_0x6c9d('0x1'));var md5=require(_0x6c9d('0x2'));var util=require(_0x6c9d('0x3'));var Redis=require(_0x6c9d('0x4'));var intUtil=require(_0x6c9d('0x5'));var config=require(_0x6c9d('0x6'));var logger=require(_0x6c9d('0x7'))('zendesk');config['redis']=_['defaults'](config['redis'],{'host':_0x6c9d('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6c9d('0x9')]));function emit(_0x3f228d,_0x256411,_0x595aae){io['to'](_0x3f228d)[_0x6c9d('0xa')](_0x256411,_0x595aae);}var headers={'Content-Type':_0x6c9d('0xb'),'Accept':_0x6c9d('0xb')};function getTicket(_0xbd3509,_0x2b1be5,_0x4c97dd,_0xdda139,_0x5e6f27){logger[_0x6c9d('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0x6c9d('0xd'),_0xbd3509[_0x6c9d('0xe')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x4c97dd['id'],'submitter_id':_0x2b1be5?_0x2b1be5['id']:undefined,'assignee_id':_0x2b1be5?_0x2b1be5['id']:undefined,'tags':getTags(_0xdda139['Tags'],'name'),'subject':intUtil[_0x6c9d('0xf')](_0xdda139[_0x6c9d('0x10')],_0x5e6f27,'\x20'),'description':intUtil[_0x6c9d('0xf')](_0xdda139['Descriptions'],_0x5e6f27,'\x0a'),'comment':{'public':![],'body':intUtil[_0x6c9d('0xf')](_0xdda139['Descriptions'],_0x5e6f27,'\x0a')}},getCustomFields(_0xdda139['Fields'],_0x5e6f27))}})[_0x6c9d('0x11')](function(_0x3723f0){logger[_0x6c9d('0xc')]('Ticket\x20created!');return _0x3723f0[_0x6c9d('0x12')];});}function getUser(_0x2ea87e,_0x2aa494){if(intUtil[_0x6c9d('0x13')](_0x2aa494)){logger['info'](_0x6c9d('0x14'),_0x2aa494);return request({'uri':util[_0x6c9d('0x15')](_0x6c9d('0x16'),_0x2ea87e[_0x6c9d('0xe')]),'qs':{'query':util['format'](_0x6c9d('0x17'),_0x2aa494)}})[_0x6c9d('0x11')](function(_0x40e62b){if(_0x40e62b[_0x6c9d('0x18')]){logger[_0x6c9d('0xc')](_0x6c9d('0x19'));return _[_0x6c9d('0x1a')](_0x40e62b[_0x6c9d('0x1b')],{'email':_0x2aa494,'role':'agent'});}else{logger[_0x6c9d('0xc')](_0x6c9d('0x1c'));return request({'uri':util[_0x6c9d('0x15')]('%s/users/me.json',_0x2ea87e[_0x6c9d('0xe')])})[_0x6c9d('0x11')](function(_0x293b2f){logger[_0x6c9d('0xc')](_0x6c9d('0x1d'));return _0x293b2f[_0x6c9d('0x1e')];});}});}else{logger[_0x6c9d('0xc')](_0x6c9d('0x1c'));return request({'uri':util['format']('%s/users/me.json',_0x2ea87e[_0x6c9d('0xe')])})[_0x6c9d('0x11')](function(_0x5dbd00){logger[_0x6c9d('0xc')](_0x6c9d('0x1d'));return _0x5dbd00[_0x6c9d('0x1e')];});}}function getEndUser(_0x5cd008,_0x51ab42,_0x269d62){logger[_0x6c9d('0xc')]('Searching\x20enduser\x20with\x20phone',_0x269d62);return request({'uri':util['format']('%s/search.json',_0x5cd008[_0x6c9d('0xe')]),'qs':{'query':util[_0x6c9d('0x15')](_0x6c9d('0x1f'),_0x269d62)}})[_0x6c9d('0x11')](function(_0x260998){var _0x4e58e1;if(_0x260998['results']['length']){_0x260998[_0x6c9d('0x1b')]=_['filter'](_0x260998[_0x6c9d('0x1b')],{'suspended':![],'role':_0x6c9d('0x20')});if(_0x260998[_0x6c9d('0x1b')][_0x6c9d('0x21')]){_0x4e58e1=_[_0x6c9d('0x22')](_0x260998[_0x6c9d('0x1b')]);}}if(_0x4e58e1){logger[_0x6c9d('0xc')](_0x6c9d('0x23'));return _0x4e58e1;}else{logger[_0x6c9d('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x6c9d('0x24'),_0x5cd008[_0x6c9d('0xe')]),'method':_0x6c9d('0x25'),'body':{'user':{'role':_0x6c9d('0x20'),'name':util[_0x6c9d('0x15')](_0x6c9d('0x26'),_0x51ab42||_0x269d62),'phone':_0x269d62}}})[_0x6c9d('0x11')](function(_0x56415a){logger[_0x6c9d('0xc')](_0x6c9d('0x27'));return _0x56415a[_0x6c9d('0x1e')];});}});}function getAuth(_0xc9eab2){var _0x1f1bf9;if(_0xc9eab2[_0x6c9d('0x28')]===_0x6c9d('0x29')){_0x1f1bf9=util['format'](_0x6c9d('0x2a'),_0xc9eab2[_0x6c9d('0x2b')],_0xc9eab2[_0x6c9d('0x29')]);}else if(_0xc9eab2[_0x6c9d('0x28')]==='token'){_0x1f1bf9=util['format']('%s/token:%s',_0xc9eab2[_0x6c9d('0x2b')],_0xc9eab2['token']);}return util[_0x6c9d('0x15')]('Basic\x20%s',new Buffer(_0x1f1bf9)[_0x6c9d('0x2c')](_0x6c9d('0x2d')));}function request(_0x42ddcd){logger[_0x6c9d('0x2e')](_0x6c9d('0x2f'),JSON[_0x6c9d('0x30')](_0x42ddcd));return rp(_[_0x6c9d('0x31')](_0x42ddcd,{'method':_0x6c9d('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x4c711c,_0x1a54c6){var _0x2b386a=[];if(_0x4c711c&&_0x4c711c[_0x6c9d('0x21')]>0x0){_0x2b386a=_[_0x6c9d('0x33')](_0x4c711c,_0x1a54c6);}return _0x2b386a;}function getCustomFields(_0x404e2f,_0x4ec756){var _0x2c67f0=[];var _0x133832={'custom_fields':[]};if(_0x404e2f[_0x6c9d('0x21')]>0x0){_[_0x6c9d('0x34')](_0x404e2f,function(_0x2a36cf){if(_[_0x6c9d('0x35')]([_0x6c9d('0x36'),_0x6c9d('0x37')],_0x2a36cf[_0x6c9d('0x38')])&&_0x2a36cf['nameField']&&!_0x2a36cf[_0x6c9d('0x39')]){_0x133832[_0x2a36cf['nameField'][_0x6c9d('0x3a')]()]=_0x2a36cf[_0x6c9d('0x3b')][_0x6c9d('0x2c')]();}else if(_[_0x6c9d('0x35')]([_0x6c9d('0x36'),_0x6c9d('0x37')],_0x2a36cf[_0x6c9d('0x38')])&&_0x2a36cf[_0x6c9d('0x3c')]&&_0x2a36cf['customField']){_0x133832[_0x6c9d('0x3d')][_0x6c9d('0x3e')]({'id':_0x2a36cf[_0x6c9d('0x3c')],'value':_0x2a36cf[_0x6c9d('0x3b')]['toString']()});}else if(_0x2a36cf[_0x6c9d('0x38')]==='variable'&&_0x2a36cf[_0x6c9d('0x3f')]&&_0x2a36cf['idField']&&_0x2a36cf['customField']){_0x4ec756[_0x2a36cf[_0x6c9d('0x3f')]]&&_0x133832['custom_fields'][_0x6c9d('0x3e')]({'id':_0x2a36cf[_0x6c9d('0x3c')],'value':_0x4ec756[_0x2a36cf[_0x6c9d('0x3f')]][_0x6c9d('0x2c')]()});}else if(_0x2a36cf[_0x6c9d('0x38')]===_0x6c9d('0x40')&&_0x2a36cf[_0x6c9d('0x41')]&&_0x2a36cf['Variable'][_0x6c9d('0x42')]&&_0x2a36cf[_0x6c9d('0x3c')]&&_0x2a36cf[_0x6c9d('0x39')]){_0x4ec756[_0x2a36cf[_0x6c9d('0x41')][_0x6c9d('0x42')][_0x6c9d('0x3a')]()]&&_0x133832[_0x6c9d('0x3d')][_0x6c9d('0x3e')]({'id':_0x2a36cf[_0x6c9d('0x3c')],'value':_0x4ec756[_0x2a36cf['Variable']['name'][_0x6c9d('0x3a')]()]['toString']()});}});}return _0x133832;}exports['queue']=function(_0x356552,_0x1d7da9,_0x43b783,_0x1d375c,_0x5700b7,_0x9ebb55){var _0x520790,_0x43d404;_0x9ebb55[_0x6c9d('0xe')]=intUtil[_0x6c9d('0x43')](_0x9ebb55[_0x6c9d('0xe')]);_0x9ebb55['serverUrl']=intUtil[_0x6c9d('0x43')](_0x9ebb55[_0x6c9d('0x44')]);if(_0x5700b7&&_0x5700b7[_0x6c9d('0x45')]){logger[_0x6c9d('0xc')](_0x6c9d('0x46'),_0x6c9d('0x47'));_0x1d7da9['recordingURL']=util['format'](_0x6c9d('0x48'),_0x9ebb55['serverUrl'],_0x1d7da9[_0x6c9d('0x49')],md5(_0x1d7da9[_0x6c9d('0x49')]));}else{_0x1d7da9[_0x6c9d('0x4a')]='';}headers['Authorization']=getAuth(_0x9ebb55);return getUser(_0x9ebb55,_0x1d375c[_0x6c9d('0x4b')])[_0x6c9d('0x11')](function(_0x8adaf){_0x520790=_0x8adaf;logger[_0x6c9d('0xc')](_0x6c9d('0x4c'),_0x520790['id']);return getEndUser(_0x9ebb55,_0x1d7da9[_0x6c9d('0x4d')],_0x1d7da9[_0x6c9d('0x4e')]);})[_0x6c9d('0x11')](function(_0x2c2b53){_0x43d404=_0x2c2b53;logger[_0x6c9d('0xc')](_0x6c9d('0x4f'),_0x43d404['id']);return getTicket(_0x9ebb55,_0x520790,_0x43d404,_0x43b783,_0x1d7da9);})[_0x6c9d('0x11')](function(_0x3ea94c){if(_0x3ea94c){logger[_0x6c9d('0xc')](_0x6c9d('0x50'),_0x3ea94c['id']);switch(_0x9ebb55[_0x6c9d('0x38')]){case _0x6c9d('0x51'):logger[_0x6c9d('0xc')]('[QUEUE]',_0x6c9d('0x52'));return request({'uri':util[_0x6c9d('0x15')](_0x6c9d('0x53'),_0x9ebb55[_0x6c9d('0xe')],_0x520790['id'],_0x3ea94c['id']),'method':_0x6c9d('0x25')});case _0x6c9d('0x54'):logger['info'](_0x6c9d('0x46'),_0x6c9d('0x55'));emit(util['format'](_0x6c9d('0x56'),_0x1d375c[_0x6c9d('0x42')]),_0x6c9d('0x57'),{'uri':util[_0x6c9d('0x15')](_0x6c9d('0x58'),_0x9ebb55[_0x6c9d('0xe')][_0x6c9d('0x59')](_0x6c9d('0x5a'),''),_0x3ea94c['id'])});break;default:logger[_0x6c9d('0x5b')](_0x6c9d('0x46'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x6c9d('0x5c')](function(_0x4fa0d8){logger[_0x6c9d('0x5b')](_0x6c9d('0x5d'),util[_0x6c9d('0x5e')](_0x4fa0d8,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x44d088,_0xcf9ca8,_0x534d2d,_0x320d8c,_0x118691,_0x111afc,_0x2bcb72){var _0x50c79f,_0x96439b;_0x111afc[_0x6c9d('0xe')]=intUtil[_0x6c9d('0x43')](_0x111afc['remoteUri']);_0x111afc[_0x6c9d('0x44')]=intUtil[_0x6c9d('0x43')](_0x111afc[_0x6c9d('0x44')]);if(_0x2bcb72&&_0x2bcb72[_0x6c9d('0x5f')]&&_0x2bcb72['recordingFormat']!=='none'){logger[_0x6c9d('0xc')](_0x6c9d('0x60'),_0x6c9d('0x47'));_0xcf9ca8[_0x6c9d('0x4a')]=util[_0x6c9d('0x15')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x111afc[_0x6c9d('0x44')],_0xcf9ca8[_0x6c9d('0x49')],md5(_0xcf9ca8[_0x6c9d('0x49')]));}headers[_0x6c9d('0x61')]=getAuth(_0x111afc);return getUser(_0x111afc,_0x320d8c[_0x6c9d('0x4b')])[_0x6c9d('0x11')](function(_0xecae77){_0x50c79f=_0xecae77;logger['info'](_0x6c9d('0x4c'),_0x50c79f['id']);return getEndUser(_0x111afc,_0xcf9ca8[_0x6c9d('0x62')],_0xcf9ca8['destcalleridnum']);})[_0x6c9d('0x11')](function(_0x287afc){_0x96439b=_0x287afc;logger[_0x6c9d('0xc')](_0x6c9d('0x4f'),_0x96439b['id']);return getTicket(_0x111afc,_0x50c79f,_0x96439b,_0x534d2d,_0xcf9ca8);})['then'](function(_0x3b4a55){if(_0x3b4a55){logger[_0x6c9d('0xc')](_0x6c9d('0x50'),_0x3b4a55['id']);switch(_0x111afc[_0x6c9d('0x38')]){case _0x6c9d('0x51'):logger[_0x6c9d('0xc')]('[OUTBOUND]',_0x6c9d('0x52'));return request({'uri':util[_0x6c9d('0x15')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x111afc[_0x6c9d('0xe')],_0x50c79f['id'],_0x3b4a55['id']),'method':_0x6c9d('0x25')});case _0x6c9d('0x54'):logger[_0x6c9d('0xc')](_0x6c9d('0x60'),_0x6c9d('0x55'));emit(util['format'](_0x6c9d('0x56'),_0x320d8c[_0x6c9d('0x42')]),_0x6c9d('0x57'),{'uri':util[_0x6c9d('0x15')](_0x6c9d('0x58'),_0x111afc[_0x6c9d('0xe')][_0x6c9d('0x59')]('/api/v2',''),_0x3b4a55['id'])});break;default:logger[_0x6c9d('0x5b')]('[OUTBOUND]',_0x6c9d('0x63'));}}})[_0x6c9d('0x5c')](function(_0x4da264){logger[_0x6c9d('0x5b')](_0x6c9d('0x64'),util[_0x6c9d('0x5e')](_0x4da264,{'showHidden':!![],'depth':null}));});};exports[_0x6c9d('0x65')]=function(_0x401f8b,_0x2b834a,_0x4c7dd4,_0x2505ec,_0x4ee0e6,_0x335385){var _0x4d5e9d,_0x273600;_0x335385[_0x6c9d('0xe')]=intUtil[_0x6c9d('0x43')](_0x335385[_0x6c9d('0xe')]);_0x335385[_0x6c9d('0x44')]=intUtil[_0x6c9d('0x43')](_0x335385[_0x6c9d('0x44')]);if(_0x4ee0e6&&_0x4ee0e6[_0x6c9d('0x45')]){logger[_0x6c9d('0xc')]('['+_0x2b834a[_0x6c9d('0x66')][_0x6c9d('0x67')]()+']','Recording\x20is\x20enabled!');_0x2b834a['recordingURL']=util[_0x6c9d('0x15')](_0x6c9d('0x48'),_0x335385[_0x6c9d('0x44')],_0x2b834a[_0x6c9d('0x49')],md5(_0x2b834a[_0x6c9d('0x49')]));}else{_0x2b834a[_0x6c9d('0x4a')]='';}headers['Authorization']=getAuth(_0x335385);return getUser(_0x335385)[_0x6c9d('0x11')](function(_0x121eb1){_0x4d5e9d=_0x121eb1;logger['info'](_0x6c9d('0x4c'),_0x4d5e9d['id']);return getEndUser(_0x335385,_0x2b834a[_0x6c9d('0x4d')],_0x2b834a[_0x6c9d('0x4e')]);})[_0x6c9d('0x11')](function(_0xb1f3f2){_0x273600=_0xb1f3f2;logger[_0x6c9d('0xc')](_0x6c9d('0x4f'),_0x273600['id']);return getTicket(_0x335385,_0x4d5e9d,_0x273600,_0x4c7dd4,_0x2b834a);})[_0x6c9d('0x11')](function(_0x55b855){if(_0x55b855){logger['info'](_0x6c9d('0x50'),_0x55b855['id']);}})[_0x6c9d('0x5c')](function(_0x5526ad){logger['error']('['+_0x2b834a[_0x6c9d('0x66')][_0x6c9d('0x67')]()+']'+_0x6c9d('0x68'),util[_0x6c9d('0x5e')](_0x5526ad,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9b99=['toLowerCase','content','idField','variable','variableName','push','customVariable','Variable','custom_fields','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','user:%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','The\x20Enduser\x20ID\x20is:','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','username','%s/token:%s','token','Basic\x20%s','toString','base64','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9b99,0xa3));var _0x99b9=function(_0x5e8dd1,_0x11e93c){_0x5e8dd1=_0x5e8dd1-0x0;var _0x6ad27a=_0x9b99[_0x5e8dd1];return _0x6ad27a;};'use strict';var _=require(_0x99b9('0x0'));var rp=require(_0x99b9('0x1'));var md5=require(_0x99b9('0x2'));var util=require('util');var Redis=require(_0x99b9('0x3'));var intUtil=require('./util');var config=require(_0x99b9('0x4'));var logger=require(_0x99b9('0x5'))(_0x99b9('0x6'));config[_0x99b9('0x7')]=_[_0x99b9('0x8')](config['redis'],{'host':_0x99b9('0x9'),'port':0x18eb});var io=require(_0x99b9('0xa'))(new Redis(config['redis']));function emit(_0x4012e0,_0x55bd48,_0x24b9f9){io['to'](_0x4012e0)[_0x99b9('0xb')](_0x55bd48,_0x24b9f9);}var headers={'Content-Type':_0x99b9('0xc'),'Accept':_0x99b9('0xc')};function getTicket(_0x5968cf,_0x4428a6,_0x38b038,_0x216541,_0x27c7ea){logger[_0x99b9('0xd')](_0x99b9('0xe'));return request({'uri':util[_0x99b9('0xf')](_0x99b9('0x10'),_0x5968cf[_0x99b9('0x11')]),'method':_0x99b9('0x12'),'body':{'ticket':_[_0x99b9('0x13')]({'requester_id':_0x38b038['id'],'submitter_id':_0x4428a6?_0x4428a6['id']:undefined,'assignee_id':_0x4428a6?_0x4428a6['id']:undefined,'tags':getTags(_0x216541[_0x99b9('0x14')],_0x99b9('0x15')),'subject':intUtil[_0x99b9('0x16')](_0x216541[_0x99b9('0x17')],_0x27c7ea,'\x20'),'description':intUtil[_0x99b9('0x16')](_0x216541['Descriptions'],_0x27c7ea,'\x0a'),'comment':{'public':![],'body':intUtil[_0x99b9('0x16')](_0x216541['Descriptions'],_0x27c7ea,'\x0a')}},getCustomFields(_0x216541[_0x99b9('0x18')],_0x27c7ea))}})[_0x99b9('0x19')](function(_0x335f71){logger[_0x99b9('0xd')](_0x99b9('0x1a'));return _0x335f71[_0x99b9('0x1b')];});}function getUser(_0x5541c7,_0x523c08){if(intUtil[_0x99b9('0x1c')](_0x523c08)){logger['info'](_0x99b9('0x1d'),_0x523c08);return request({'uri':util[_0x99b9('0xf')](_0x99b9('0x1e'),_0x5541c7[_0x99b9('0x11')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x523c08)}})[_0x99b9('0x19')](function(_0x54609f){if(_0x54609f[_0x99b9('0x1f')]){logger[_0x99b9('0xd')](_0x99b9('0x20'));return _['find'](_0x54609f[_0x99b9('0x21')],{'email':_0x523c08,'role':_0x99b9('0x22')});}else{logger[_0x99b9('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x99b9('0xf')](_0x99b9('0x23'),_0x5541c7[_0x99b9('0x11')])})[_0x99b9('0x19')](function(_0x4fa913){logger['info'](_0x99b9('0x24'));return _0x4fa913[_0x99b9('0x25')];});}});}else{logger[_0x99b9('0xd')](_0x99b9('0x26'));return request({'uri':util[_0x99b9('0xf')](_0x99b9('0x23'),_0x5541c7['remoteUri'])})[_0x99b9('0x19')](function(_0x880aba){logger[_0x99b9('0xd')](_0x99b9('0x24'));return _0x880aba[_0x99b9('0x25')];});}}function getEndUser(_0x2926f0,_0x5cfdd7,_0x2e1419){logger['info']('Searching\x20enduser\x20with\x20phone',_0x2e1419);return request({'uri':util['format']('%s/search.json',_0x2926f0[_0x99b9('0x11')]),'qs':{'query':util['format'](_0x99b9('0x27'),_0x2e1419)}})[_0x99b9('0x19')](function(_0x552979){var _0x44b645;if(_0x552979[_0x99b9('0x21')][_0x99b9('0x28')]){_0x552979[_0x99b9('0x21')]=_[_0x99b9('0x29')](_0x552979['results'],{'suspended':![],'role':_0x99b9('0x2a')});if(_0x552979[_0x99b9('0x21')][_0x99b9('0x28')]){_0x44b645=_[_0x99b9('0x2b')](_0x552979[_0x99b9('0x21')]);}}if(_0x44b645){logger['info'](_0x99b9('0x2c'));return _0x44b645;}else{logger[_0x99b9('0xd')](_0x99b9('0x2d'));return request({'uri':util[_0x99b9('0xf')]('%s/users.json',_0x2926f0[_0x99b9('0x11')]),'method':'POST','body':{'user':{'role':_0x99b9('0x2a'),'name':util[_0x99b9('0xf')](_0x99b9('0x2e'),_0x5cfdd7||_0x2e1419),'phone':_0x2e1419}}})[_0x99b9('0x19')](function(_0x19c18e){logger[_0x99b9('0xd')](_0x99b9('0x2f'));return _0x19c18e[_0x99b9('0x25')];});}});}function getAuth(_0xa08306){var _0x3f4ee6;if(_0xa08306[_0x99b9('0x30')]==='password'){_0x3f4ee6=util[_0x99b9('0xf')]('%s:%s',_0xa08306[_0x99b9('0x31')],_0xa08306['password']);}else if(_0xa08306['authType']==='token'){_0x3f4ee6=util[_0x99b9('0xf')](_0x99b9('0x32'),_0xa08306[_0x99b9('0x31')],_0xa08306[_0x99b9('0x33')]);}return util['format'](_0x99b9('0x34'),new Buffer(_0x3f4ee6)[_0x99b9('0x35')](_0x99b9('0x36')));}function request(_0x28eaec){logger['debug']('[HTTP]',JSON[_0x99b9('0x37')](_0x28eaec));return rp(_[_0x99b9('0x8')](_0x28eaec,{'method':_0x99b9('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x2ca35a,_0x5cd896){var _0x312bce=[];if(_0x2ca35a&&_0x2ca35a['length']>0x0){_0x312bce=_[_0x99b9('0x39')](_0x2ca35a,_0x5cd896);}return _0x312bce;}function getCustomFields(_0x5a0569,_0xf358d2){var _0x304825=[];var _0x363571={'custom_fields':[]};if(_0x5a0569['length']>0x0){_[_0x99b9('0x3a')](_0x5a0569,function(_0x59a781){if(_[_0x99b9('0x3b')]([_0x99b9('0x3c'),_0x99b9('0x3d')],_0x59a781[_0x99b9('0x3e')])&&_0x59a781[_0x99b9('0x3f')]&&!_0x59a781[_0x99b9('0x40')]){_0x363571[_0x59a781[_0x99b9('0x3f')][_0x99b9('0x41')]()]=_0x59a781[_0x99b9('0x42')][_0x99b9('0x35')]();}else if(_[_0x99b9('0x3b')]([_0x99b9('0x3c'),_0x99b9('0x3d')],_0x59a781[_0x99b9('0x3e')])&&_0x59a781[_0x99b9('0x43')]&&_0x59a781['customField']){_0x363571['custom_fields']['push']({'id':_0x59a781['idField'],'value':_0x59a781[_0x99b9('0x42')][_0x99b9('0x35')]()});}else if(_0x59a781[_0x99b9('0x3e')]===_0x99b9('0x44')&&_0x59a781['variableName']&&_0x59a781[_0x99b9('0x43')]&&_0x59a781['customField']){_0xf358d2[_0x59a781[_0x99b9('0x45')]]&&_0x363571['custom_fields'][_0x99b9('0x46')]({'id':_0x59a781[_0x99b9('0x43')],'value':_0xf358d2[_0x59a781[_0x99b9('0x45')]][_0x99b9('0x35')]()});}else if(_0x59a781[_0x99b9('0x3e')]===_0x99b9('0x47')&&_0x59a781['Variable']&&_0x59a781['Variable'][_0x99b9('0x15')]&&_0x59a781[_0x99b9('0x43')]&&_0x59a781['customField']){_0xf358d2[_0x59a781[_0x99b9('0x48')][_0x99b9('0x15')][_0x99b9('0x41')]()]&&_0x363571[_0x99b9('0x49')][_0x99b9('0x46')]({'id':_0x59a781['idField'],'value':_0xf358d2[_0x59a781[_0x99b9('0x48')][_0x99b9('0x15')][_0x99b9('0x41')]()][_0x99b9('0x35')]()});}});}return _0x363571;}exports[_0x99b9('0x4a')]=function(_0x5b0958,_0x13b9ef,_0x525df2,_0x33ad6c,_0x3576d7,_0x1f36fd){var _0x331cf0,_0x3fd0d0;_0x1f36fd[_0x99b9('0x11')]=intUtil[_0x99b9('0x4b')](_0x1f36fd[_0x99b9('0x11')]);_0x1f36fd[_0x99b9('0x4c')]=intUtil['stripTrailingSlash'](_0x1f36fd[_0x99b9('0x4c')]);if(_0x3576d7&&_0x3576d7[_0x99b9('0x4d')]){logger[_0x99b9('0xd')](_0x99b9('0x4e'),_0x99b9('0x4f'));_0x13b9ef[_0x99b9('0x50')]=util['format'](_0x99b9('0x51'),_0x1f36fd['serverUrl'],_0x13b9ef['uniqueid'],md5(_0x13b9ef[_0x99b9('0x52')]));}else{_0x13b9ef['recordingURL']='';}headers[_0x99b9('0x53')]=getAuth(_0x1f36fd);return getUser(_0x1f36fd,_0x33ad6c[_0x99b9('0x54')])[_0x99b9('0x19')](function(_0x4045e7){_0x331cf0=_0x4045e7;logger['info'](_0x99b9('0x55'),_0x331cf0['id']);return getEndUser(_0x1f36fd,_0x13b9ef[_0x99b9('0x56')],_0x13b9ef[_0x99b9('0x57')]);})[_0x99b9('0x19')](function(_0x53b2a1){_0x3fd0d0=_0x53b2a1;logger[_0x99b9('0xd')]('The\x20Enduser\x20ID\x20is:',_0x3fd0d0['id']);return getTicket(_0x1f36fd,_0x331cf0,_0x3fd0d0,_0x525df2,_0x13b9ef);})[_0x99b9('0x19')](function(_0x3e0e82){if(_0x3e0e82){logger[_0x99b9('0xd')](_0x99b9('0x58'),_0x3e0e82['id']);switch(_0x1f36fd[_0x99b9('0x3e')]){case _0x99b9('0x59'):logger[_0x99b9('0xd')](_0x99b9('0x4e'),_0x99b9('0x5a'));return request({'uri':util['format'](_0x99b9('0x5b'),_0x1f36fd[_0x99b9('0x11')],_0x331cf0['id'],_0x3e0e82['id']),'method':_0x99b9('0x12')});case _0x99b9('0x5c'):logger[_0x99b9('0xd')](_0x99b9('0x4e'),_0x99b9('0x5d'));emit(util[_0x99b9('0xf')]('user:%s',_0x33ad6c[_0x99b9('0x15')]),_0x99b9('0x5e'),{'uri':util[_0x99b9('0xf')](_0x99b9('0x5f'),_0x1f36fd[_0x99b9('0x11')][_0x99b9('0x60')](_0x99b9('0x61'),''),_0x3e0e82['id'])});break;default:logger[_0x99b9('0x62')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x32e743){logger[_0x99b9('0x62')](_0x99b9('0x63'),util['inspect'](_0x32e743,{'showHidden':!![],'depth':null}));});};exports[_0x99b9('0x64')]=function(_0x5865df,_0x5acb9f,_0x18686b,_0x16a9e7,_0x5c87d2,_0x122213,_0x166648){var _0x29143c,_0x1741b1;_0x122213[_0x99b9('0x11')]=intUtil[_0x99b9('0x4b')](_0x122213[_0x99b9('0x11')]);_0x122213['serverUrl']=intUtil[_0x99b9('0x4b')](_0x122213['serverUrl']);if(_0x166648&&_0x166648['recordingFormat']&&_0x166648[_0x99b9('0x65')]!==_0x99b9('0x66')){logger[_0x99b9('0xd')](_0x99b9('0x67'),_0x99b9('0x4f'));_0x5acb9f[_0x99b9('0x50')]=util['format'](_0x99b9('0x51'),_0x122213[_0x99b9('0x4c')],_0x5acb9f[_0x99b9('0x52')],md5(_0x5acb9f[_0x99b9('0x52')]));}headers[_0x99b9('0x53')]=getAuth(_0x122213);return getUser(_0x122213,_0x16a9e7[_0x99b9('0x54')])[_0x99b9('0x19')](function(_0x16f729){_0x29143c=_0x16f729;logger[_0x99b9('0xd')](_0x99b9('0x55'),_0x29143c['id']);return getEndUser(_0x122213,_0x5acb9f[_0x99b9('0x68')],_0x5acb9f['destcalleridnum']);})['then'](function(_0x582ed7){_0x1741b1=_0x582ed7;logger[_0x99b9('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1741b1['id']);return getTicket(_0x122213,_0x29143c,_0x1741b1,_0x18686b,_0x5acb9f);})[_0x99b9('0x19')](function(_0x1f55bd){if(_0x1f55bd){logger['info'](_0x99b9('0x58'),_0x1f55bd['id']);switch(_0x122213[_0x99b9('0x3e')]){case _0x99b9('0x59'):logger['info'](_0x99b9('0x67'),_0x99b9('0x5a'));return request({'uri':util['format'](_0x99b9('0x5b'),_0x122213[_0x99b9('0x11')],_0x29143c['id'],_0x1f55bd['id']),'method':_0x99b9('0x12')});case _0x99b9('0x5c'):logger[_0x99b9('0xd')](_0x99b9('0x67'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x99b9('0xf')](_0x99b9('0x69'),_0x16a9e7[_0x99b9('0x15')]),_0x99b9('0x5e'),{'uri':util[_0x99b9('0xf')](_0x99b9('0x5f'),_0x122213[_0x99b9('0x11')][_0x99b9('0x60')](_0x99b9('0x61'),''),_0x1f55bd['id'])});break;default:logger[_0x99b9('0x62')](_0x99b9('0x67'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x99b9('0x6a')](function(_0x4e3d87){logger['error'](_0x99b9('0x6b'),util[_0x99b9('0x6c')](_0x4e3d87,{'showHidden':!![],'depth':null}));});};exports[_0x99b9('0x6d')]=function(_0x506111,_0x134bf3,_0x302ba0,_0x22046f,_0x1547f7,_0x4dad47){var _0x70dd06,_0x25be6d;_0x4dad47[_0x99b9('0x11')]=intUtil[_0x99b9('0x4b')](_0x4dad47['remoteUri']);_0x4dad47[_0x99b9('0x4c')]=intUtil['stripTrailingSlash'](_0x4dad47['serverUrl']);if(_0x1547f7&&_0x1547f7['monitor_format']){logger[_0x99b9('0xd')]('['+_0x134bf3[_0x99b9('0x6e')]['toUpperCase']()+']',_0x99b9('0x4f'));_0x134bf3[_0x99b9('0x50')]=util[_0x99b9('0xf')](_0x99b9('0x51'),_0x4dad47[_0x99b9('0x4c')],_0x134bf3[_0x99b9('0x52')],md5(_0x134bf3[_0x99b9('0x52')]));}else{_0x134bf3[_0x99b9('0x50')]='';}headers[_0x99b9('0x53')]=getAuth(_0x4dad47);return getUser(_0x4dad47)[_0x99b9('0x19')](function(_0x29759c){_0x70dd06=_0x29759c;logger[_0x99b9('0xd')](_0x99b9('0x55'),_0x70dd06['id']);return getEndUser(_0x4dad47,_0x134bf3[_0x99b9('0x56')],_0x134bf3[_0x99b9('0x57')]);})[_0x99b9('0x19')](function(_0x298d9d){_0x25be6d=_0x298d9d;logger[_0x99b9('0xd')](_0x99b9('0x6f'),_0x25be6d['id']);return getTicket(_0x4dad47,_0x70dd06,_0x25be6d,_0x302ba0,_0x134bf3);})['then'](function(_0x3fc2a3){if(_0x3fc2a3){logger[_0x99b9('0xd')]('The\x20Ticket\x20ID\x20is:',_0x3fc2a3['id']);}})[_0x99b9('0x6a')](function(_0x253590){logger[_0x99b9('0x62')]('['+_0x134bf3[_0x99b9('0x6e')][_0x99b9('0x70')]()+']'+_0x99b9('0x71'),util[_0x99b9('0x6c')](_0x253590,{'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 5088907..1f82f46 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 _0x4d7f=['outbound','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','stack','err','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','email','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','host','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','unmanaged','toUpperCase','lodash','md5','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','defaults','redis','localhost','emit','[HTTP]','stringify','length','forEach','includes','picklist','type','idField','content','toString','variableName','Variable','name','toLowerCase','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','add','error','Failing\x20creating\x20the\x20access_token','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','then','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','POST','https://www.zohoapis.','startCase','moduleCreate','isNil','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','The\x20failing\x20result\x20is','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','lead','Creating\x20new\x20call...','profile','administrator','Subject','getString','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','mm:ss','Call_Duration','utc','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time'];(function(_0x22c46d,_0x443e4a){var _0x443881=function(_0x40803d){while(--_0x40803d){_0x22c46d['push'](_0x22c46d['shift']());}};_0x443881(++_0x443e4a);}(_0x4d7f,0xc1));var _0xf4d7=function(_0xb5dabc,_0x2b0598){_0xb5dabc=_0xb5dabc-0x0;var _0x5cffb9=_0x4d7f[_0xb5dabc];return _0x5cffb9;};'use strict';var _=require(_0xf4d7('0x0'));var rp=require('request-promise');var md5=require(_0xf4d7('0x1'));var util=require('util');var intUtil=require(_0xf4d7('0x2'));var moment=require(_0xf4d7('0x3'));var Redis=require(_0xf4d7('0x4'));var BPromise=require(_0xf4d7('0x5'));var config=require(_0xf4d7('0x6'));var logger=require('../../../../config/logger')(_0xf4d7('0x7'));config['redis']=_[_0xf4d7('0x8')](config[_0xf4d7('0x9')],{'host':_0xf4d7('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf4d7('0x9')]));function emit(_0x43036b,_0x5cfee6,_0x4370a7){io['to'](_0x43036b)[_0xf4d7('0xb')](_0x5cfee6,_0x4370a7);}function request(_0x473d45){logger['debug'](_0xf4d7('0xc'),JSON[_0xf4d7('0xd')](_0x473d45));return rp(_0x473d45);}function getCustomFields(_0x21cc59,_0x46ef3a){var _0x3be4b4={};if(_0x21cc59[_0xf4d7('0xe')]>0x0){_[_0xf4d7('0xf')](_0x21cc59,function(_0x50bd06){if(_[_0xf4d7('0x10')](['string',_0xf4d7('0x11')],_0x50bd06[_0xf4d7('0x12')])&&_0x50bd06[_0xf4d7('0x13')]){_0x3be4b4[_0x50bd06[_0xf4d7('0x13')]]=_0x50bd06[_0xf4d7('0x14')][_0xf4d7('0x15')]();}else if(_0x50bd06['type']==='variable'&&_0x50bd06[_0xf4d7('0x16')]&&_0x50bd06[_0xf4d7('0x13')]&&_0x46ef3a[_0x50bd06[_0xf4d7('0x16')]]){_0x3be4b4[_0x50bd06[_0xf4d7('0x13')]]=_0x46ef3a[_0x50bd06[_0xf4d7('0x16')]][_0xf4d7('0x15')]();}else if(_0x50bd06['type']==='customVariable'&&_0x50bd06[_0xf4d7('0x17')]&&_0x50bd06[_0xf4d7('0x17')]['name']&&_0x50bd06[_0xf4d7('0x13')]&&_0x46ef3a[_0x50bd06[_0xf4d7('0x17')][_0xf4d7('0x18')][_0xf4d7('0x19')]()]){_0x3be4b4[_0x50bd06['idField']]=_0x46ef3a[_0x50bd06[_0xf4d7('0x17')][_0xf4d7('0x18')][_0xf4d7('0x19')]()]['toString']();}});}return _0x3be4b4;}function getName(_0x3e324f){if(_0x3e324f['indexOf']('\x20')>0x0){var _0x2036c1=_0x3e324f['split'](/ (.+)/);if(_0x2036c1[0x1]){return _0x2036c1;}}return[_0x3e324f,_0x3e324f];}var accountsTokens={};function getAccessToken(_0x2dff78){return new Promise(function(_0x2609ba,_0xc0cb68){if(!_['isNil'](accountsTokens[_0x2dff78['id']])&&!_['isNil'](accountsTokens[_0x2dff78['id']][_0xf4d7('0x1a')])){if(moment()[_0xf4d7('0x1b')](accountsTokens[_0x2dff78['id']][_0xf4d7('0x1c')])){_0x2609ba(accountsTokens[_0x2dff78['id']][_0xf4d7('0x1a')]);}}var _0x538731;switch(_0x2dff78['zone']){case'US':_0x538731=_0xf4d7('0x1d');break;case'AU':_0x538731=_0xf4d7('0x1e');break;case'EU':_0x538731=_0xf4d7('0x1f');break;case'IN':_0x538731='https://accounts.zoho.in';break;case'CN':_0x538731=_0xf4d7('0x20');break;default:_0x538731=_0xf4d7('0x1f');break;}var _0x58733a={'method':'POST','uri':_0x538731+_0xf4d7('0x21'),'qs':{'refresh_token':_0x2dff78[_0xf4d7('0x22')],'client_id':_0x2dff78[_0xf4d7('0x23')],'client_secret':_0x2dff78[_0xf4d7('0x24')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x58733a)['then'](function(_0x5ee4be){accountsTokens[_0x2dff78['id']]={'access_token':_0x5ee4be[_0xf4d7('0x1a')],'expires_in':moment()[_0xf4d7('0x25')](_0x5ee4be['expires_in'],'seconds')};_0x2609ba(_0x5ee4be['access_token']);})['catch'](function(_0x242ea6){logger[_0xf4d7('0x26')](_0xf4d7('0x27'),_0x242ea6['stack']);_0xc0cb68(_0x242ea6);});});}function getUser(_0x326b45,_0x5b015a,_0x5a2fa6,_0x62ef51){logger[_0xf4d7('0x28')]('Search\x20user');return request({'method':_0xf4d7('0x29'),'uri':util[_0xf4d7('0x2a')](_0xf4d7('0x2b'),_0x5b015a),'qs':{'type':_0xf4d7('0x2c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x326b45},'json':!![]})[_0xf4d7('0x2d')](function(_0x1be151){if(_0x1be151[_0xf4d7('0x2e')]){var _0xe7f58=-0x1;if(_[_0xf4d7('0x2f')](_0x1be151[_0xf4d7('0x2e')])){if(!_['isNil'](_0x62ef51)){_0xe7f58=_[_0xf4d7('0x30')](_0x1be151['users'],function(_0x4651a6){return _0x4651a6['email']===_0x62ef51;});}if(_0xe7f58>=0x0){logger['info'](_0xf4d7('0x31'));}else{logger['info'](_0xf4d7('0x32'));_0xe7f58=_[_0xf4d7('0x30')](_0x1be151['users'],function(_0x3f1906){return _0x3f1906['profile']['name']===_0xf4d7('0x33');});}return _0x1be151[_0xf4d7('0x2e')][_0xe7f58];}else{if(_0x1be151['user']['profile'][_0xf4d7('0x18')]===_0xf4d7('0x33')){logger[_0xf4d7('0x28')](_0xf4d7('0x32'));user=_0x1be151[_0xf4d7('0x34')];return user;}else{logger[_0xf4d7('0x26')]('The\x20failing\x20result\x20is',JSON[_0xf4d7('0xd')](_0x1be151));throw new Error(_0xf4d7('0x35')+JSON['stringify'](_0x1be151));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xf4d7('0xd')](_0x1be151));throw new Error(_0xf4d7('0x35')+JSON[_0xf4d7('0xd')](_0x1be151));}})[_0xf4d7('0x36')](function(_0x2d4de1){console[_0xf4d7('0x26')](_0x2d4de1);});}function getZohoUser(_0x340a17,_0x1ef947){return new BPromise(function(_0x8c1b8e,_0x56822c){request(_0x340a17)['then'](function(_0x1b7c97){var _0x2fbcb9=null;if(_0x1b7c97){_0x2fbcb9=_0x1b7c97[_0xf4d7('0x37')][0x0];_0x2fbcb9[_0xf4d7('0x38')]=_0x1ef947;}_0x8c1b8e(_0x2fbcb9);})['catch'](function(_0x268829){_0x56822c(_0x268829);});});}function createEndUser(_0x5b8bf1,_0x5e8194,_0x3ca661,_0xb83cf8,_0x4a53b2,_0x1c6607){var _0x3ca661=getName(_0x3ca661);return request({'method':_0xf4d7('0x39'),'uri':_0xf4d7('0x3a')+_0x5e8194+'/crm/v2/'+_[_0xf4d7('0x3b')](_0x1c6607[_0xf4d7('0x3c')])+'s','body':{'data':[{'Last_Name':_0x3ca661[0x1],'First_Name':_0x3ca661[0x0],'Phone':_0xb83cf8,'Owner':{'name':!_[_0xf4d7('0x3d')](_0x4a53b2[_0xf4d7('0x3e')][_0xf4d7('0x18')])?_0x4a53b2[_0xf4d7('0x3e')][_0xf4d7('0x18')]:!_[_0xf4d7('0x3d')](_0x4a53b2[_0xf4d7('0x3f')])?_0x4a53b2['first_name']+'\x20'+_0x4a53b2[_0xf4d7('0x40')]:_0x4a53b2[_0xf4d7('0x40')],'id':_0x4a53b2['id']}}]},'headers':{'Authorization':_0xf4d7('0x41')+_0x5b8bf1},'json':!![]})[_0xf4d7('0x2d')](function(_0x33b6ab){if(_0x33b6ab&&_0x33b6ab[_0xf4d7('0x37')][0x0][_0xf4d7('0x42')]===_0xf4d7('0x43')){var _0x118ff1=_0x33b6ab[_0xf4d7('0x37')][0x0][_0xf4d7('0x44')];_0x118ff1[_0xf4d7('0x38')]=_[_0xf4d7('0x3b')](_0x1c6607[_0xf4d7('0x3c')])+'s';return _0x118ff1;}logger[_0xf4d7('0x26')](_0xf4d7('0x45'),JSON[_0xf4d7('0xd')](data));throw new Error(_0xf4d7('0x46')+JSON[_0xf4d7('0xd')](data));})[_0xf4d7('0x36')](function(_0x394e2c){console[_0xf4d7('0x47')](_0xf4d7('0x48'),_0x394e2c);});}function getEndUser(_0x2502e5,_0x394558,_0x4369f1,_0xb4ab48,_0x2f8891,_0xe268fb,_0x168990){var _0x3a90a2={'method':_0xf4d7('0x29'),'uri':'','headers':{'Authorization':_0xf4d7('0x41')+_0x2502e5},'json':!![]};switch(_0x168990[_0xf4d7('0x49')]){case _0xf4d7('0x4a'):_0x3a90a2[_0xf4d7('0x4b')]='https://www.zohoapis.'+_0x394558+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2f8891+'))';return getZohoUser(_0x3a90a2,'Contacts')[_0xf4d7('0x2d')](function(_0x4174ec){if(_0x4174ec)return _0x4174ec;_0x3a90a2['uri']=_0xf4d7('0x3a')+_0x394558+_0xf4d7('0x4c')+_0x2f8891+'))';return getZohoUser(_0x3a90a2,_0xf4d7('0x4d'))[_0xf4d7('0x2d')](function(_0xb1f2f8){if(_0xb1f2f8)return _0xb1f2f8;if(_0x168990[_0xf4d7('0x3c')]!=_0xf4d7('0x4e')){return createEndUser(_0x2502e5,_0x394558,_0xb4ab48,_0x2f8891,_0xe268fb,_0x168990);}else{return{};}});});break;case _0xf4d7('0x4f'):_0x3a90a2[_0xf4d7('0x4b')]=_0xf4d7('0x3a')+_0x394558+_0xf4d7('0x50')+_0x2f8891+'))';return getZohoUser(_0x3a90a2,_0xf4d7('0x51'))[_0xf4d7('0x2d')](function(_0x28ae50){if(_0x28ae50)return _0x28ae50;if(_0x168990['moduleCreate']!=_0xf4d7('0x4e')){return createEndUser(_0x2502e5,_0x394558,_0xb4ab48,_0x2f8891,_0xe268fb,_0x168990);}else{return{};}});break;case _0xf4d7('0x52'):_0x3a90a2['uri']=_0xf4d7('0x3a')+_0x394558+_0xf4d7('0x4c')+_0x2f8891+'))';return getZohoUser(_0x3a90a2,_0xf4d7('0x4d'))[_0xf4d7('0x2d')](function(_0x802879){if(_0x802879)return _0x802879;if(_0x168990[_0xf4d7('0x3c')]!=_0xf4d7('0x4e')){return createEndUser(_0x2502e5,_0x394558,_0xb4ab48,_0x2f8891,_0xe268fb,_0x168990);}else{return{};}});break;}}function getCall(_0x3d997d,_0x17dbc7,_0x16081,_0xccc830,_0x1ff861,_0x3041ff,_0x5b0934,_0x2b6bd9){logger['info'](_0xf4d7('0x53'));var _0x5bd162={};_0x5bd162['Owner']={'name':!_[_0xf4d7('0x3d')](_0xccc830[_0xf4d7('0x3e')][_0xf4d7('0x18')])&&!_['isNil'](_0xccc830[_0xf4d7('0x54')][_0xf4d7('0x18')])&&_0xccc830[_0xf4d7('0x54')][_0xf4d7('0x18')]===_0xf4d7('0x55')?_0xccc830[_0xf4d7('0x3e')][_0xf4d7('0x18')]:!_['isNil'](_0xccc830['first_name'])?_0xccc830[_0xf4d7('0x3f')]+'\x20'+_0xccc830[_0xf4d7('0x40')]:_0xccc830[_0xf4d7('0x40')],'id':_0xccc830['id']};_0x5bd162[_0xf4d7('0x56')]=intUtil[_0xf4d7('0x57')](_0x3041ff['Subjects'],_0x5b0934,'\x20');_0x5bd162[_0xf4d7('0x58')]=intUtil[_0xf4d7('0x57')](_0x3041ff[_0xf4d7('0x59')],_0x5b0934,'\x0a');if(_0x1ff861[_0xf4d7('0x38')]==='Contacts'){_0x5bd162['Who_Id']={'name':!_['isNil'](_0x1ff861[_0xf4d7('0x5a')])?_0x1ff861['Full_Name']:!_['isNil'](_0x1ff861[_0xf4d7('0x5b')])?_0x1ff861['First_Name']+'\x20'+_0x1ff861[_0xf4d7('0x5c')]:_0x1ff861['Last_Name'],'id':_0x1ff861['id']};}if(_0x1ff861[_0xf4d7('0x38')]===_0xf4d7('0x4d')){_0x5bd162[_0xf4d7('0x5d')]={'name':!_[_0xf4d7('0x3d')](_0x1ff861['Full_Name'])?_0x1ff861[_0xf4d7('0x5a')]:!_[_0xf4d7('0x3d')](_0x1ff861[_0xf4d7('0x5b')])?_0x1ff861['First_Name']+'\x20'+_0x1ff861['Last_Name']:_0x1ff861['Last_Name'],'id':_0x1ff861['id']};_0x5bd162[_0xf4d7('0x5e')]=_[_0xf4d7('0x3b')](_0x1ff861['enduserType']);}if(_0x5b0934[_0xf4d7('0x5f')]){_0x5bd162['Call_Duration']=moment['utc'](parseInt(_0x5b0934[_0xf4d7('0x5f')])*0x3e8)['format'](_0xf4d7('0x60'));}else if(_0x5b0934['answertime']&&_0x5b0934['endtime']){_0x5bd162[_0xf4d7('0x61')]=moment[_0xf4d7('0x62')](moment(_0x5b0934[_0xf4d7('0x63')],_0xf4d7('0x64'))[_0xf4d7('0x65')](moment(_0x5b0934[_0xf4d7('0x66')],_0xf4d7('0x64'))))[_0xf4d7('0x2a')](_0xf4d7('0x60'));}switch(_0x5b0934[_0xf4d7('0x67')]){case _0xf4d7('0x68'):_0x5bd162[_0xf4d7('0x69')]=_0xf4d7('0x6a');break;case _0xf4d7('0x6b'):case _0xf4d7('0x6c'):_0x5bd162[_0xf4d7('0x69')]=_0xf4d7('0x6d');break;case _0xf4d7('0x6e'):_0x5bd162[_0xf4d7('0x69')]=_0xf4d7('0x6f');break;case _0xf4d7('0x70'):_0x5bd162[_0xf4d7('0x69')]=_0xf4d7('0x71');break;case _0xf4d7('0x72'):_0x5bd162[_0xf4d7('0x69')]=_0xf4d7('0x73');default:}_0x5bd162[_0xf4d7('0x74')]=(_0x2b6bd9===_0xf4d7('0x75')?moment(_0x5b0934[_0xf4d7('0x66')])[_0xf4d7('0x2a')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x5b0934['agentcalledAt'])[_0xf4d7('0x2a')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xf4d7('0x2a')](_0xf4d7('0x64'));_0x5bd162['Call_Type']=_0x2b6bd9||_0xf4d7('0x76');_0x5bd162=_[_0xf4d7('0x77')](_0x5bd162,getCustomFields(_0x3041ff[_0xf4d7('0x78')],_0x5b0934));return request({'method':_0xf4d7('0x39'),'uri':'https://www.zohoapis.'+_0x17dbc7+_0xf4d7('0x79'),'headers':{'Authorization':_0xf4d7('0x41')+_0x3d997d},'body':{'data':[_0x5bd162]},'json':!![]})['then'](function(_0xd91286){if(_0xd91286&&_0xd91286['data'][0x0][_0xf4d7('0x42')]===_0xf4d7('0x43')){logger[_0xf4d7('0x28')](_0xf4d7('0x7a'));return{'id':_0xd91286['data'][0x0][_0xf4d7('0x44')]['id']};}})[_0xf4d7('0x36')](function(_0x1c65ff){logger[_0xf4d7('0x28')]('err',_0x1c65ff[_0xf4d7('0x7b')]);console[_0xf4d7('0x47')](_0xf4d7('0x7c'),_0x1c65ff);});}exports[_0xf4d7('0x7d')]=function(_0x5be115,_0x149479,_0x4c7ae7,_0x2fd4a5,_0x48c59d,_0x46f03a){var _0x1d4df9,_0x23ad66,_0x3c6328;_0x46f03a['host']=intUtil[_0xf4d7('0x7e')](_0x46f03a['host']);_0x46f03a['serverUrl']=intUtil[_0xf4d7('0x7e')](_0x46f03a[_0xf4d7('0x7f')]);if(_0x48c59d&&_0x48c59d[_0xf4d7('0x80')]){logger[_0xf4d7('0x28')](_0xf4d7('0x81'),_0xf4d7('0x82'));_0x149479[_0xf4d7('0x83')]=_0x46f03a[_0xf4d7('0x7f')]+_0xf4d7('0x84')+_0x149479['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x149479[_0xf4d7('0x85')]);}else{_0x149479[_0xf4d7('0x83')]='';}var _0x103549=_0x46f03a['host']===_0xf4d7('0x86')?'eu':_0xf4d7('0x87');return getAccessToken(_0x46f03a)['then'](function(_0x11db78){_0x3c6328=_0x11db78;return getUser(_0x3c6328,_0x103549,_0x46f03a,_0x2fd4a5[_0xf4d7('0x88')]);})[_0xf4d7('0x2d')](function(_0x112a94){_0x1d4df9=_0x112a94;logger['info']('The\x20User\x20ID\x20is:',_0x1d4df9['id']);return getEndUser(_0x3c6328,_0x103549,_0x46f03a,_0x149479[_0xf4d7('0x89')],_0x149479[_0xf4d7('0x8a')],_0x1d4df9,_0x4c7ae7);})['then'](function(_0x49aa80){_0x23ad66=_0x49aa80;return getCall(_0x3c6328,_0x103549,_0x46f03a,_0x1d4df9,_0x23ad66,_0x4c7ae7,_0x149479,_0xf4d7('0x76'));})[_0xf4d7('0x2d')](function(_0x688d89){if(_0x688d89){logger[_0xf4d7('0x28')](_0xf4d7('0x8b'),_0x688d89['id']);logger['info'](_0xf4d7('0x81'),_0xf4d7('0x8c'));emit(util['format'](_0xf4d7('0x8d'),_0x2fd4a5['name']),_0xf4d7('0x8e'),{'uri':_0xf4d7('0x8f')+_0x46f03a[_0xf4d7('0x90')]+_0xf4d7('0x91')+_0x688d89['id']});}})['catch'](function(_0x5234e1){logger[_0xf4d7('0x26')](_0xf4d7('0x81'),JSON[_0xf4d7('0xd')](_0x5234e1));});};exports[_0xf4d7('0x75')]=function(_0x2a92df,_0xacc727,_0x4cd97e,_0xb41b04,_0x145915,_0x26e062,_0x3fe844){var _0x5ebd67,_0x3daf11,_0x137ca8;_0x26e062['host']=intUtil['stripTrailingSlash'](_0x26e062[_0xf4d7('0x90')]);_0x26e062[_0xf4d7('0x7f')]=intUtil[_0xf4d7('0x7e')](_0x26e062[_0xf4d7('0x7f')]);if(_0x3fe844&&_0x3fe844[_0xf4d7('0x92')]&&_0x3fe844['recordingFormat']!==_0xf4d7('0x93')){logger[_0xf4d7('0x28')](_0xf4d7('0x94'),_0xf4d7('0x82'));_0xacc727[_0xf4d7('0x83')]=_0x26e062[_0xf4d7('0x7f')]+_0xf4d7('0x84')+_0xacc727[_0xf4d7('0x85')]+_0xf4d7('0x95')+md5(_0xacc727['uniqueid']);}var _0x15fc59=_0x26e062[_0xf4d7('0x90')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x26e062)[_0xf4d7('0x2d')](function(_0x430981){_0x137ca8=_0x430981;return getUser(_0x137ca8,_0x15fc59,_0x26e062,_0xb41b04[_0xf4d7('0x88')]);})['then'](function(_0xde905a){_0x5ebd67=_0xde905a;logger['info'](_0xf4d7('0x96'),_0x5ebd67['id']);return getEndUser(_0x137ca8,_0x15fc59,_0x26e062,_0xacc727['destcalleridname'],_0xacc727[_0xf4d7('0x97')],_0x5ebd67,_0x4cd97e);})[_0xf4d7('0x2d')](function(_0x446128){_0x3daf11=_0x446128;return getCall(_0x137ca8,_0x15fc59,_0x26e062,_0x5ebd67,_0x3daf11,_0x4cd97e,_0xacc727,_0xf4d7('0x98'));})['then'](function(_0x59a3c3){if(_0x59a3c3){logger[_0xf4d7('0x28')](_0xf4d7('0x8b'),_0x59a3c3['id']);logger[_0xf4d7('0x28')](_0xf4d7('0x94'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf4d7('0x2a')]('user:%s',_0xb41b04['name']),'trigger:browser:url',{'uri':_0xf4d7('0x8f')+_0x26e062[_0xf4d7('0x90')]+_0xf4d7('0x91')+_0x59a3c3['id']});}})[_0xf4d7('0x36')](function(_0x52169b){logger[_0xf4d7('0x26')]('[OUTBOUND]',JSON['stringify'](_0x52169b));});};exports[_0xf4d7('0x99')]=function(_0x569de3,_0x55372b,_0x38902,_0x31295d,_0x350cf5,_0x424035){var _0x7fad1c,_0x190353,_0x332add;_0x424035['host']=intUtil[_0xf4d7('0x7e')](_0x424035[_0xf4d7('0x90')]);_0x424035['serverUrl']=intUtil[_0xf4d7('0x7e')](_0x424035[_0xf4d7('0x7f')]);if(_0x350cf5&&_0x350cf5[_0xf4d7('0x80')]){logger[_0xf4d7('0x28')]('['+_0x55372b[_0xf4d7('0x67')][_0xf4d7('0x9a')]()+']',_0xf4d7('0x82'));_0x55372b['recordingURL']=_0x424035[_0xf4d7('0x7f')]+_0xf4d7('0x84')+_0x55372b[_0xf4d7('0x85')]+_0xf4d7('0x95')+md5(_0x55372b[_0xf4d7('0x85')]);}else{_0x55372b[_0xf4d7('0x83')]='';}var _0x2fa2e9=_0x424035['host']===_0xf4d7('0x86')?'eu':_0xf4d7('0x87');return getAccessToken(_0x424035)[_0xf4d7('0x2d')](function(_0x5ef752){_0x332add=_0x5ef752;return getUser(_0x332add,_0x2fa2e9,_0x424035);})[_0xf4d7('0x2d')](function(_0x246275){_0x7fad1c=_0x246275;logger[_0xf4d7('0x28')](_0xf4d7('0x96'),_0x7fad1c['id']);return getEndUser(_0x332add,_0x2fa2e9,_0x424035,_0x55372b[_0xf4d7('0x89')],_0x55372b[_0xf4d7('0x8a')],_0x7fad1c,_0x38902);})[_0xf4d7('0x2d')](function(_0x27838e){_0x190353=_0x27838e;return getCall(_0x332add,_0x2fa2e9,_0x424035,_0x7fad1c,_0x190353,_0x38902,_0x55372b,'Inbound');})['then'](function(_0x378411){if(_0x378411){logger[_0xf4d7('0x28')]('The\x20Call\x20ID\x20is:',_0x378411['id']);}})[_0xf4d7('0x36')](function(_0x16029d){logger['error']('['+_0x55372b[_0xf4d7('0x67')][_0xf4d7('0x9a')]()+']',JSON['stringify'](_0x16029d));});}; \ No newline at end of file +var _0x1b9f=['[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','zoho.eu','email','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','recordingURL','/downloads?type=uniqueid&token=','destcalleridname','The\x20Call\x20ID\x20is:','toUpperCase','The\x20User\x20ID\x20is:','lodash','request-promise','md5','./util','moment','ioredis','bluebird','zoho','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','stringify','length','string','picklist','idField','content','variable','variableName','toString','type','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','moduleCreate','role','first_name','last_name','code','SUCCESS','details','The\x20failing\x20result\x20is','Error:\x20','log','moduleSearch','contact_lead','https://www.zohoapis.','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Who_Id','Full_Name','First_Name','What_Id','Last_Name','$se_module','startCase','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','format','lastevent','called','Call_Result','connect','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','Fields','err','host','serverUrl','stripTrailingSlash','monitor_format'];(function(_0x3c0e22,_0x5c6506){var _0x108204=function(_0x1d97ea){while(--_0x1d97ea){_0x3c0e22['push'](_0x3c0e22['shift']());}};_0x108204(++_0x5c6506);}(_0x1b9f,0x141));var _0xf1b9=function(_0x34cf75,_0x5bf260){_0x34cf75=_0x34cf75-0x0;var _0x540270=_0x1b9f[_0x34cf75];return _0x540270;};'use strict';var _=require(_0xf1b9('0x0'));var rp=require(_0xf1b9('0x1'));var md5=require(_0xf1b9('0x2'));var util=require('util');var intUtil=require(_0xf1b9('0x3'));var moment=require(_0xf1b9('0x4'));var Redis=require(_0xf1b9('0x5'));var BPromise=require(_0xf1b9('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xf1b9('0x7'));config[_0xf1b9('0x8')]=_[_0xf1b9('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf1b9('0xa'))(new Redis(config[_0xf1b9('0x8')]));function emit(_0x5210bf,_0x361727,_0x1ca96e){io['to'](_0x5210bf)[_0xf1b9('0xb')](_0x361727,_0x1ca96e);}function request(_0x24a8fa){logger[_0xf1b9('0xc')](_0xf1b9('0xd'),JSON[_0xf1b9('0xe')](_0x24a8fa));return rp(_0x24a8fa);}function getCustomFields(_0x3b7ca8,_0x6a7b4f){var _0x2a2cd6={};if(_0x3b7ca8[_0xf1b9('0xf')]>0x0){_['forEach'](_0x3b7ca8,function(_0x2afcaa){if(_['includes']([_0xf1b9('0x10'),_0xf1b9('0x11')],_0x2afcaa['type'])&&_0x2afcaa[_0xf1b9('0x12')]){_0x2a2cd6[_0x2afcaa['idField']]=_0x2afcaa[_0xf1b9('0x13')]['toString']();}else if(_0x2afcaa['type']===_0xf1b9('0x14')&&_0x2afcaa['variableName']&&_0x2afcaa[_0xf1b9('0x12')]&&_0x6a7b4f[_0x2afcaa[_0xf1b9('0x15')]]){_0x2a2cd6[_0x2afcaa[_0xf1b9('0x12')]]=_0x6a7b4f[_0x2afcaa[_0xf1b9('0x15')]][_0xf1b9('0x16')]();}else if(_0x2afcaa[_0xf1b9('0x17')]===_0xf1b9('0x18')&&_0x2afcaa[_0xf1b9('0x19')]&&_0x2afcaa[_0xf1b9('0x19')]['name']&&_0x2afcaa[_0xf1b9('0x12')]&&_0x6a7b4f[_0x2afcaa[_0xf1b9('0x19')][_0xf1b9('0x1a')][_0xf1b9('0x1b')]()]){_0x2a2cd6[_0x2afcaa[_0xf1b9('0x12')]]=_0x6a7b4f[_0x2afcaa[_0xf1b9('0x19')][_0xf1b9('0x1a')]['toLowerCase']()][_0xf1b9('0x16')]();}});}return _0x2a2cd6;}function getName(_0x33dcfa){if(_0x33dcfa['indexOf']('\x20')>0x0){var _0x18aa66=_0x33dcfa[_0xf1b9('0x1c')](/ (.+)/);if(_0x18aa66[0x1]){return _0x18aa66;}}return[_0x33dcfa,_0x33dcfa];}var accountsTokens={};function getAccessToken(_0xf3a0cc){return new Promise(function(_0x35ceaf,_0x42c3c0){if(!_[_0xf1b9('0x1d')](accountsTokens[_0xf3a0cc['id']])&&!_[_0xf1b9('0x1d')](accountsTokens[_0xf3a0cc['id']][_0xf1b9('0x1e')])){if(moment()[_0xf1b9('0x1f')](accountsTokens[_0xf3a0cc['id']][_0xf1b9('0x20')])){_0x35ceaf(accountsTokens[_0xf3a0cc['id']][_0xf1b9('0x1e')]);}}var _0x3c5d14;switch(_0xf3a0cc[_0xf1b9('0x21')]){case'US':_0x3c5d14='https://accounts.zoho.com';break;case'AU':_0x3c5d14='https://accounts.zoho.com.au';break;case'EU':_0x3c5d14=_0xf1b9('0x22');break;case'IN':_0x3c5d14=_0xf1b9('0x23');break;case'CN':_0x3c5d14='https://accounts.zoho.com.cn';break;default:_0x3c5d14=_0xf1b9('0x22');break;}var _0xd0559e={'method':_0xf1b9('0x24'),'uri':_0x3c5d14+_0xf1b9('0x25'),'qs':{'refresh_token':_0xf3a0cc[_0xf1b9('0x26')],'client_id':_0xf3a0cc[_0xf1b9('0x27')],'client_secret':_0xf3a0cc[_0xf1b9('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0xd0559e)[_0xf1b9('0x29')](function(_0x589ebe){accountsTokens[_0xf3a0cc['id']]={'access_token':_0x589ebe[_0xf1b9('0x1e')],'expires_in':moment()[_0xf1b9('0x2a')](_0x589ebe[_0xf1b9('0x20')],_0xf1b9('0x2b'))};_0x35ceaf(_0x589ebe[_0xf1b9('0x1e')]);})[_0xf1b9('0x2c')](function(_0x38ef53){logger[_0xf1b9('0x2d')](_0xf1b9('0x2e'),_0x38ef53[_0xf1b9('0x2f')]);_0x42c3c0(_0x38ef53);});});}function getUser(_0x225e3d,_0x4bea9b,_0xd489a7,_0x177da7){logger[_0xf1b9('0x30')](_0xf1b9('0x31'));return request({'method':_0xf1b9('0x32'),'uri':util['format'](_0xf1b9('0x33'),_0x4bea9b),'qs':{'type':_0xf1b9('0x34')},'headers':{'Authorization':_0xf1b9('0x35')+_0x225e3d},'json':!![]})[_0xf1b9('0x29')](function(_0x2b4c85){if(_0x2b4c85[_0xf1b9('0x36')]){var _0x42db8b=-0x1;if(_[_0xf1b9('0x37')](_0x2b4c85[_0xf1b9('0x36')])){if(!_['isNil'](_0x177da7)){_0x42db8b=_[_0xf1b9('0x38')](_0x2b4c85[_0xf1b9('0x36')],function(_0x4f5ea2){return _0x4f5ea2['email']===_0x177da7;});}if(_0x42db8b>=0x0){logger['info'](_0xf1b9('0x39'));}else{logger['info'](_0xf1b9('0x3a'));_0x42db8b=_[_0xf1b9('0x38')](_0x2b4c85[_0xf1b9('0x36')],function(_0x468c68){return _0x468c68[_0xf1b9('0x3b')][_0xf1b9('0x1a')]===_0xf1b9('0x3c');});}return _0x2b4c85[_0xf1b9('0x36')][_0x42db8b];}else{if(_0x2b4c85[_0xf1b9('0x3d')]['profile'][_0xf1b9('0x1a')]===_0xf1b9('0x3c')){logger[_0xf1b9('0x30')]('Using\x20the\x20admin\x20account!');user=_0x2b4c85[_0xf1b9('0x3d')];return user;}else{logger[_0xf1b9('0x2d')]('The\x20failing\x20result\x20is',JSON[_0xf1b9('0xe')](_0x2b4c85));throw new Error(_0xf1b9('0x3e')+JSON[_0xf1b9('0xe')](_0x2b4c85));}}}else{logger[_0xf1b9('0x2d')]('The\x20failing\x20result\x20is',JSON[_0xf1b9('0xe')](_0x2b4c85));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xf1b9('0xe')](_0x2b4c85));}})[_0xf1b9('0x2c')](function(_0x2f1bb7){console[_0xf1b9('0x2d')](_0x2f1bb7);});}function getZohoUser(_0x22363f,_0x1d99e7){return new BPromise(function(_0x5eff81,_0x2eaf48){request(_0x22363f)[_0xf1b9('0x29')](function(_0x4fc0ae){var _0x531b1a=null;if(_0x4fc0ae){_0x531b1a=_0x4fc0ae[_0xf1b9('0x3f')][0x0];_0x531b1a[_0xf1b9('0x40')]=_0x1d99e7;}_0x5eff81(_0x531b1a);})['catch'](function(_0x40d1ec){_0x2eaf48(_0x40d1ec);});});}function createEndUser(_0x51486b,_0x56cd9d,_0x21505e,_0x333471,_0x11e732,_0x284c83){var _0x21505e=getName(_0x21505e);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x56cd9d+'/crm/v2/'+_['startCase'](_0x284c83[_0xf1b9('0x41')])+'s','body':{'data':[{'Last_Name':_0x21505e[0x1],'First_Name':_0x21505e[0x0],'Phone':_0x333471,'Owner':{'name':!_[_0xf1b9('0x1d')](_0x11e732[_0xf1b9('0x42')][_0xf1b9('0x1a')])?_0x11e732[_0xf1b9('0x42')][_0xf1b9('0x1a')]:!_[_0xf1b9('0x1d')](_0x11e732['first_name'])?_0x11e732[_0xf1b9('0x43')]+'\x20'+_0x11e732[_0xf1b9('0x44')]:_0x11e732[_0xf1b9('0x44')],'id':_0x11e732['id']}}]},'headers':{'Authorization':_0xf1b9('0x35')+_0x51486b},'json':!![]})[_0xf1b9('0x29')](function(_0x5c636f){if(_0x5c636f&&_0x5c636f[_0xf1b9('0x3f')][0x0][_0xf1b9('0x45')]===_0xf1b9('0x46')){var _0x301a51=_0x5c636f[_0xf1b9('0x3f')][0x0][_0xf1b9('0x47')];_0x301a51[_0xf1b9('0x40')]=_['startCase'](_0x284c83[_0xf1b9('0x41')])+'s';return _0x301a51;}logger[_0xf1b9('0x2d')](_0xf1b9('0x48'),JSON[_0xf1b9('0xe')](data));throw new Error(_0xf1b9('0x49')+JSON[_0xf1b9('0xe')](data));})[_0xf1b9('0x2c')](function(_0x39dbc1){console[_0xf1b9('0x4a')]('CREATE\x20ERROR',_0x39dbc1);});}function getEndUser(_0x375657,_0x51d1ce,_0x18fa41,_0x1eb79c,_0x1879ff,_0x4981b0,_0xfb772f){var _0x5aaf92={'method':_0xf1b9('0x32'),'uri':'','headers':{'Authorization':_0xf1b9('0x35')+_0x375657},'json':!![]};switch(_0xfb772f[_0xf1b9('0x4b')]){case _0xf1b9('0x4c'):_0x5aaf92['uri']=_0xf1b9('0x4d')+_0x51d1ce+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x1879ff+'))';return getZohoUser(_0x5aaf92,_0xf1b9('0x4e'))[_0xf1b9('0x29')](function(_0x9efa2){if(_0x9efa2)return _0x9efa2;_0x5aaf92[_0xf1b9('0x4f')]='https://www.zohoapis.'+_0x51d1ce+_0xf1b9('0x50')+_0x1879ff+'))';return getZohoUser(_0x5aaf92,_0xf1b9('0x51'))[_0xf1b9('0x29')](function(_0x27b26e){if(_0x27b26e)return _0x27b26e;if(_0xfb772f[_0xf1b9('0x41')]!='nothing'){return createEndUser(_0x375657,_0x51d1ce,_0x1eb79c,_0x1879ff,_0x4981b0,_0xfb772f);}else{return{};}});});break;case _0xf1b9('0x52'):_0x5aaf92[_0xf1b9('0x4f')]=_0xf1b9('0x4d')+_0x51d1ce+_0xf1b9('0x53')+_0x1879ff+'))';return getZohoUser(_0x5aaf92,'Contacts')[_0xf1b9('0x29')](function(_0x32f882){if(_0x32f882)return _0x32f882;if(_0xfb772f[_0xf1b9('0x41')]!=_0xf1b9('0x54')){return createEndUser(_0x375657,_0x51d1ce,_0x1eb79c,_0x1879ff,_0x4981b0,_0xfb772f);}else{return{};}});break;case _0xf1b9('0x55'):_0x5aaf92[_0xf1b9('0x4f')]='https://www.zohoapis.'+_0x51d1ce+_0xf1b9('0x50')+_0x1879ff+'))';return getZohoUser(_0x5aaf92,_0xf1b9('0x51'))[_0xf1b9('0x29')](function(_0x37c89d){if(_0x37c89d)return _0x37c89d;if(_0xfb772f[_0xf1b9('0x41')]!=_0xf1b9('0x54')){return createEndUser(_0x375657,_0x51d1ce,_0x1eb79c,_0x1879ff,_0x4981b0,_0xfb772f);}else{return{};}});break;}}function getCall(_0x4ef844,_0x92640d,_0x48e27d,_0x5661a0,_0x5c61fc,_0x9a59b9,_0x209cad,_0x35b90d){logger[_0xf1b9('0x30')](_0xf1b9('0x56'));var _0x4c6e9f={};_0x4c6e9f[_0xf1b9('0x57')]={'name':!_[_0xf1b9('0x1d')](_0x5661a0[_0xf1b9('0x42')][_0xf1b9('0x1a')])&&!_[_0xf1b9('0x1d')](_0x5661a0['profile'][_0xf1b9('0x1a')])&&_0x5661a0['profile'][_0xf1b9('0x1a')]===_0xf1b9('0x58')?_0x5661a0[_0xf1b9('0x42')][_0xf1b9('0x1a')]:!_[_0xf1b9('0x1d')](_0x5661a0['first_name'])?_0x5661a0[_0xf1b9('0x43')]+'\x20'+_0x5661a0[_0xf1b9('0x44')]:_0x5661a0[_0xf1b9('0x44')],'id':_0x5661a0['id']};_0x4c6e9f[_0xf1b9('0x59')]=intUtil[_0xf1b9('0x5a')](_0x9a59b9['Subjects'],_0x209cad,'\x20');_0x4c6e9f[_0xf1b9('0x5b')]=intUtil[_0xf1b9('0x5a')](_0x9a59b9['Descriptions'],_0x209cad,'\x0a');if(_0x5c61fc[_0xf1b9('0x40')]==='Contacts'){_0x4c6e9f[_0xf1b9('0x5c')]={'name':!_['isNil'](_0x5c61fc[_0xf1b9('0x5d')])?_0x5c61fc[_0xf1b9('0x5d')]:!_['isNil'](_0x5c61fc['First_Name'])?_0x5c61fc[_0xf1b9('0x5e')]+'\x20'+_0x5c61fc['Last_Name']:_0x5c61fc['Last_Name'],'id':_0x5c61fc['id']};}if(_0x5c61fc[_0xf1b9('0x40')]===_0xf1b9('0x51')){_0x4c6e9f[_0xf1b9('0x5f')]={'name':!_[_0xf1b9('0x1d')](_0x5c61fc[_0xf1b9('0x5d')])?_0x5c61fc[_0xf1b9('0x5d')]:!_[_0xf1b9('0x1d')](_0x5c61fc[_0xf1b9('0x5e')])?_0x5c61fc[_0xf1b9('0x5e')]+'\x20'+_0x5c61fc[_0xf1b9('0x60')]:_0x5c61fc['Last_Name'],'id':_0x5c61fc['id']};_0x4c6e9f[_0xf1b9('0x61')]=_[_0xf1b9('0x62')](_0x5c61fc[_0xf1b9('0x40')]);}if(_0x209cad[_0xf1b9('0x63')]){_0x4c6e9f[_0xf1b9('0x64')]=moment[_0xf1b9('0x65')](parseInt(_0x209cad['talktime'])*0x3e8)['format'](_0xf1b9('0x66'));}else if(_0x209cad[_0xf1b9('0x67')]&&_0x209cad[_0xf1b9('0x68')]){_0x4c6e9f[_0xf1b9('0x64')]=moment[_0xf1b9('0x65')](moment(_0x209cad['endtime'],_0xf1b9('0x69'))['diff'](moment(_0x209cad[_0xf1b9('0x6a')],_0xf1b9('0x69'))))[_0xf1b9('0x6b')](_0xf1b9('0x66'));}switch(_0x209cad[_0xf1b9('0x6c')]){case _0xf1b9('0x6d'):_0x4c6e9f[_0xf1b9('0x6e')]='Called';break;case'complete':case _0xf1b9('0x6f'):_0x4c6e9f['Call_Result']='Answered';break;case _0xf1b9('0x70'):_0x4c6e9f[_0xf1b9('0x6e')]=_0xf1b9('0x71');break;case _0xf1b9('0x72'):_0x4c6e9f[_0xf1b9('0x6e')]=_0xf1b9('0x73');break;case _0xf1b9('0x74'):_0x4c6e9f[_0xf1b9('0x6e')]=_0xf1b9('0x75');default:}_0x4c6e9f[_0xf1b9('0x76')]=(_0x35b90d===_0xf1b9('0x77')?moment(_0x209cad['starttime'])[_0xf1b9('0x6b')](_0xf1b9('0x69')):moment(_0x209cad['agentcalledAt'])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xf1b9('0x6b')]('YYYY-MM-DDTHH:mm:ss');_0x4c6e9f[_0xf1b9('0x78')]=_0x35b90d||_0xf1b9('0x79');_0x4c6e9f=_[_0xf1b9('0x7a')](_0x4c6e9f,getCustomFields(_0x9a59b9[_0xf1b9('0x7b')],_0x209cad));return request({'method':'POST','uri':_0xf1b9('0x4d')+_0x92640d+'/crm/v2/Calls','headers':{'Authorization':_0xf1b9('0x35')+_0x4ef844},'body':{'data':[_0x4c6e9f]},'json':!![]})[_0xf1b9('0x29')](function(_0x469428){if(_0x469428&&_0x469428[_0xf1b9('0x3f')][0x0][_0xf1b9('0x45')]===_0xf1b9('0x46')){logger[_0xf1b9('0x30')]('Call\x20created!');return{'id':_0x469428['data'][0x0][_0xf1b9('0x47')]['id']};}})[_0xf1b9('0x2c')](function(_0x205b0b){logger[_0xf1b9('0x30')](_0xf1b9('0x7c'),_0x205b0b['stack']);console[_0xf1b9('0x4a')](_0xf1b9('0x7c'),_0x205b0b);});}exports['queue']=function(_0x3adb03,_0x90b896,_0x283b68,_0x1a0648,_0x4a27f8,_0x2a9b08){var _0x2c5f4b,_0x272b2e,_0x4f584d;_0x2a9b08['host']=intUtil['stripTrailingSlash'](_0x2a9b08[_0xf1b9('0x7d')]);_0x2a9b08[_0xf1b9('0x7e')]=intUtil[_0xf1b9('0x7f')](_0x2a9b08[_0xf1b9('0x7e')]);if(_0x4a27f8&&_0x4a27f8[_0xf1b9('0x80')]){logger[_0xf1b9('0x30')](_0xf1b9('0x81'),_0xf1b9('0x82'));_0x90b896['recordingURL']=_0x2a9b08[_0xf1b9('0x7e')]+_0xf1b9('0x83')+_0x90b896[_0xf1b9('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x90b896['uniqueid']);}else{_0x90b896['recordingURL']='';}var _0x241f38=_0x2a9b08[_0xf1b9('0x7d')]===_0xf1b9('0x85')?'eu':'com';return getAccessToken(_0x2a9b08)[_0xf1b9('0x29')](function(_0x3f4cb3){_0x4f584d=_0x3f4cb3;return getUser(_0x4f584d,_0x241f38,_0x2a9b08,_0x1a0648[_0xf1b9('0x86')]);})[_0xf1b9('0x29')](function(_0x4a36d1){_0x2c5f4b=_0x4a36d1;logger[_0xf1b9('0x30')]('The\x20User\x20ID\x20is:',_0x2c5f4b['id']);return getEndUser(_0x4f584d,_0x241f38,_0x2a9b08,_0x90b896[_0xf1b9('0x87')],_0x90b896[_0xf1b9('0x88')],_0x2c5f4b,_0x283b68);})['then'](function(_0x396799){_0x272b2e=_0x396799;return getCall(_0x4f584d,_0x241f38,_0x2a9b08,_0x2c5f4b,_0x272b2e,_0x283b68,_0x90b896,_0xf1b9('0x79'));})['then'](function(_0x351a27){if(_0x351a27){logger[_0xf1b9('0x30')]('The\x20Call\x20ID\x20is:',_0x351a27['id']);logger[_0xf1b9('0x30')](_0xf1b9('0x81'),_0xf1b9('0x89'));emit(util[_0xf1b9('0x6b')](_0xf1b9('0x8a'),_0x1a0648['name']),_0xf1b9('0x8b'),{'uri':_0xf1b9('0x8c')+_0x2a9b08[_0xf1b9('0x7d')]+_0xf1b9('0x8d')+_0x351a27['id']});}})[_0xf1b9('0x2c')](function(_0x41dc55){logger[_0xf1b9('0x2d')](_0xf1b9('0x81'),JSON[_0xf1b9('0xe')](_0x41dc55));});};exports['outbound']=function(_0x4ff996,_0x200210,_0x5dc339,_0x72fb7,_0x7af573,_0x404999,_0x3b57ef){var _0x30f7cc,_0x257b9a,_0x24b36f;_0x404999['host']=intUtil[_0xf1b9('0x7f')](_0x404999['host']);_0x404999[_0xf1b9('0x7e')]=intUtil[_0xf1b9('0x7f')](_0x404999[_0xf1b9('0x7e')]);if(_0x3b57ef&&_0x3b57ef[_0xf1b9('0x8e')]&&_0x3b57ef[_0xf1b9('0x8e')]!=='none'){logger[_0xf1b9('0x30')](_0xf1b9('0x8f'),_0xf1b9('0x82'));_0x200210[_0xf1b9('0x90')]=_0x404999[_0xf1b9('0x7e')]+_0xf1b9('0x83')+_0x200210[_0xf1b9('0x84')]+_0xf1b9('0x91')+md5(_0x200210[_0xf1b9('0x84')]);}var _0x2e7ac9=_0x404999['host']===_0xf1b9('0x85')?'eu':'com';return getAccessToken(_0x404999)[_0xf1b9('0x29')](function(_0x2b010f){_0x24b36f=_0x2b010f;return getUser(_0x24b36f,_0x2e7ac9,_0x404999,_0x72fb7[_0xf1b9('0x86')]);})[_0xf1b9('0x29')](function(_0x582227){_0x30f7cc=_0x582227;logger[_0xf1b9('0x30')]('The\x20User\x20ID\x20is:',_0x30f7cc['id']);return getEndUser(_0x24b36f,_0x2e7ac9,_0x404999,_0x200210[_0xf1b9('0x92')],_0x200210['destcalleridnum'],_0x30f7cc,_0x5dc339);})['then'](function(_0x3b692e){_0x257b9a=_0x3b692e;return getCall(_0x24b36f,_0x2e7ac9,_0x404999,_0x30f7cc,_0x257b9a,_0x5dc339,_0x200210,'Outbound');})[_0xf1b9('0x29')](function(_0x284821){if(_0x284821){logger['info'](_0xf1b9('0x93'),_0x284821['id']);logger[_0xf1b9('0x30')](_0xf1b9('0x8f'),_0xf1b9('0x89'));emit(util['format']('user:%s',_0x72fb7[_0xf1b9('0x1a')]),_0xf1b9('0x8b'),{'uri':_0xf1b9('0x8c')+_0x404999[_0xf1b9('0x7d')]+_0xf1b9('0x8d')+_0x284821['id']});}})[_0xf1b9('0x2c')](function(_0x1a8d2d){logger['error']('[OUTBOUND]',JSON[_0xf1b9('0xe')](_0x1a8d2d));});};exports['unmanaged']=function(_0x5ce680,_0x4639c6,_0xaa7cb7,_0x5a07d4,_0x39e2c7,_0x5c1508){var _0x5807e4,_0x37b192,_0x3aa5e4;_0x5c1508[_0xf1b9('0x7d')]=intUtil[_0xf1b9('0x7f')](_0x5c1508[_0xf1b9('0x7d')]);_0x5c1508[_0xf1b9('0x7e')]=intUtil['stripTrailingSlash'](_0x5c1508['serverUrl']);if(_0x39e2c7&&_0x39e2c7['monitor_format']){logger[_0xf1b9('0x30')]('['+_0x4639c6[_0xf1b9('0x6c')][_0xf1b9('0x94')]()+']',_0xf1b9('0x82'));_0x4639c6['recordingURL']=_0x5c1508['serverUrl']+'/api/voice/recordings/'+_0x4639c6[_0xf1b9('0x84')]+_0xf1b9('0x91')+md5(_0x4639c6[_0xf1b9('0x84')]);}else{_0x4639c6[_0xf1b9('0x90')]='';}var _0x49047b=_0x5c1508[_0xf1b9('0x7d')]===_0xf1b9('0x85')?'eu':'com';return getAccessToken(_0x5c1508)[_0xf1b9('0x29')](function(_0x4fc04b){_0x3aa5e4=_0x4fc04b;return getUser(_0x3aa5e4,_0x49047b,_0x5c1508);})['then'](function(_0x4180eb){_0x5807e4=_0x4180eb;logger[_0xf1b9('0x30')](_0xf1b9('0x95'),_0x5807e4['id']);return getEndUser(_0x3aa5e4,_0x49047b,_0x5c1508,_0x4639c6[_0xf1b9('0x87')],_0x4639c6[_0xf1b9('0x88')],_0x5807e4,_0xaa7cb7);})[_0xf1b9('0x29')](function(_0x382e7b){_0x37b192=_0x382e7b;return getCall(_0x3aa5e4,_0x49047b,_0x5c1508,_0x5807e4,_0x37b192,_0xaa7cb7,_0x4639c6,_0xf1b9('0x79'));})[_0xf1b9('0x29')](function(_0x10031a){if(_0x10031a){logger[_0xf1b9('0x30')](_0xf1b9('0x93'),_0x10031a['id']);}})[_0xf1b9('0x2c')](function(_0x3cebaa){logger[_0xf1b9('0x2d')]('['+_0x4639c6[_0xf1b9('0x6c')]['toUpperCase']()+']',JSON[_0xf1b9('0xe')](_0x3cebaa));});}; \ 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 268c099..c7d7ac2 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 _0x271c=['format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','data3','render','error'];(function(_0x4ef09b,_0x2c6068){var _0x13b1e9=function(_0x55f97a){while(--_0x55f97a){_0x4ef09b['push'](_0x4ef09b['shift']());}};_0x13b1e9(++_0x2c6068);}(_0x271c,0x16f));var _0xc271=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x271c[_0x21a9d9];return _0x46adce;};'use strict';var util=require(_0xc271('0x0'));var sh=require(_0xc271('0x1'));var Mustache=require(_0xc271('0x2'));var logger=require(_0xc271('0x3'))(_0xc271('0x4'));exports[_0xc271('0x5')]=function(_0xbbde6d,_0x11f6b8){var _0x2448d8=_0xbbde6d[_0xc271('0x6')]?_0xbbde6d[_0xc271('0x6')]:'Script';var _0x499211=_0xbbde6d[_0xc271('0x7')]?Mustache[_0xc271('0x8')](_0xbbde6d[_0xc271('0x7')],_0x11f6b8):_0x11f6b8;sh[_0xc271('0x5')](_0x499211,function(_0x354cef,_0x9670ce,_0x329afb){if(_0x354cef!==0x0){logger[_0xc271('0x9')](util[_0xc271('0xa')](_0xc271('0xb'),_0x2448d8,_0x499211,_0x354cef,_0x329afb));}else{logger['info'](util[_0xc271('0xa')](_0xc271('0xc'),_0x2448d8,_0x499211,_0x9670ce));}});}; \ No newline at end of file +var _0x7291=['format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','trigger','exec','data2','data3','render'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x7291,0x1dc));var _0x1729=function(_0x39c022,_0x18637f){_0x39c022=_0x39c022-0x0;var _0x49fa80=_0x7291[_0x39c022];return _0x49fa80;};'use strict';var util=require('util');var sh=require(_0x1729('0x0'));var Mustache=require(_0x1729('0x1'));var logger=require(_0x1729('0x2'))(_0x1729('0x3'));exports[_0x1729('0x4')]=function(_0x1469e9,_0x295f29){var _0x3fe351=_0x1469e9[_0x1729('0x5')]?_0x1469e9[_0x1729('0x5')]:'Script';var _0x2c7eb6=_0x1469e9[_0x1729('0x6')]?Mustache[_0x1729('0x7')](_0x1469e9['data3'],_0x295f29):_0x295f29;sh['exec'](_0x2c7eb6,function(_0x153704,_0xc17860,_0x401353){if(_0x153704!==0x0){logger['error'](util[_0x1729('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x3fe351,_0x2c7eb6,_0x153704,_0x401353));}else{logger[_0x1729('0x9')](util['format'](_0x1729('0xa'),_0x3fe351,_0x2c7eb6,_0xc17860));}});}; \ 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 8b3f084..bf8689b 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 _0x0733=['%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','error','GET','DELETE','data7','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0733,0x137));var _0x3073=function(_0x3d1f46,_0x15c08a){_0x3d1f46=_0x3d1f46-0x0;var _0x5fa326=_0x0733[_0x3d1f46];return _0x5fa326;};'use strict';var rp=require(_0x3073('0x0'));var util=require(_0x3073('0x1'));var _=require(_0x3073('0x2'));var Mustache=require(_0x3073('0x3'));var logger=require(_0x3073('0x4'))(_0x3073('0x5'));exports[_0x3073('0x6')]=function(_0xa5c443,_0xc4ac25){var _0x4fe7be,_0x385ddc;var _0x21e4eb={'method':_0xa5c443[_0x3073('0x7')][_0x3073('0x8')](),'uri':Mustache[_0x3073('0x9')](_0xa5c443[_0x3073('0xa')],_0xc4ac25),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xa5c443['data5'])===_0x3073('0xb')&&parseInt(_0xa5c443[_0x3073('0xc')])>=0x1&&parseInt(_0xa5c443[_0x3073('0xc')])<=0xa?parseInt(_0xa5c443[_0x3073('0xc')])*0x3e8:0x5*0x3e8};try{_0x21e4eb[_0x3073('0xd')]=_0xa5c443[_0x3073('0xe')]?JSON[_0x3073('0xf')](Mustache[_0x3073('0x9')](_0xa5c443[_0x3073('0xe')],_0xc4ac25)):{};}catch(_0x207a61){logger[_0x3073('0x10')](_0x207a61['stack']);}switch(_0xa5c443[_0x3073('0x7')][_0x3073('0x8')]()){case _0x3073('0x11'):case _0x3073('0x12'):_0x4fe7be=null;_0x21e4eb['qs']=_0xc4ac25;break;case'POST':case'PUT':if(_0xa5c443[_0x3073('0x13')]){try{_0x4fe7be=JSON[_0x3073('0xf')](Mustache[_0x3073('0x9')](_0xa5c443[_0x3073('0x13')],_0xc4ac25));_0x21e4eb['body']=_0x4fe7be;}catch(_0x4fff47){logger[_0x3073('0x10')](_0x4fff47[_0x3073('0x14')]);logger[_0x3073('0x10')](_0x3073('0x15'));}}else{_0x4fe7be=_0xc4ac25;_0x21e4eb[_0x3073('0x16')]=_0x4fe7be;}break;}logger[_0x3073('0x17')](util[_0x3073('0x18')](_0x3073('0x19'),_0xa5c443['data1'],_0xa5c443[_0x3073('0xa')],JSON[_0x3073('0x1a')](_0x21e4eb)));rp(_0x21e4eb)['then'](function(_0x336d06){_0x4fe7be=!_[_0x3073('0x1b')](_0x4fe7be)?_0x3073('0x1c')+_0x4fe7be:'';_0x385ddc=typeof _0x336d06['body']==='object'?JSON['stringify'](_0x336d06[_0x3073('0x16')]):_0x336d06[_0x3073('0x16')];logger[_0x3073('0x17')](util[_0x3073('0x18')](_0x3073('0x1d'),_0xa5c443[_0x3073('0x7')],_0xa5c443[_0x3073('0xa')],_0x336d06[_0x3073('0x1e')],_0x385ddc));})['catch'](function(_0x272b58){logger[_0x3073('0x10')](util['format'](_0x3073('0x1f'),_0xa5c443[_0x3073('0x7')],_0xa5c443['data2'],_0x272b58['statusCode'],_0x272b58[_0x3073('0x20')],_0x272b58[_0x3073('0x21')]));});}; \ No newline at end of file +var _0x5090=['request-promise','util','mustache','../../../../config/logger','trigger','exec','toUpperCase','render','data5','headers','parse','data6','error','data1','GET','DELETE','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','message'];(function(_0x1ec3ba,_0x52593b){var _0x1225e5=function(_0x1000ac){while(--_0x1000ac){_0x1ec3ba['push'](_0x1ec3ba['shift']());}};_0x1225e5(++_0x52593b);}(_0x5090,0x9b));var _0x0509=function(_0x28ac79,_0x5c12ab){_0x28ac79=_0x28ac79-0x0;var _0x202f1f=_0x5090[_0x28ac79];return _0x202f1f;};'use strict';var rp=require(_0x0509('0x0'));var util=require(_0x0509('0x1'));var _=require('lodash');var Mustache=require(_0x0509('0x2'));var logger=require(_0x0509('0x3'))(_0x0509('0x4'));exports[_0x0509('0x5')]=function(_0x58a766,_0x2c5a93){var _0x313f43,_0x32d9b5;var _0x6746b8={'method':_0x58a766['data1'][_0x0509('0x6')](),'uri':Mustache[_0x0509('0x7')](_0x58a766['data2'],_0x2c5a93),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x58a766[_0x0509('0x8')])==='number'&&parseInt(_0x58a766[_0x0509('0x8')])>=0x1&&parseInt(_0x58a766['data5'])<=0xa?parseInt(_0x58a766[_0x0509('0x8')])*0x3e8:0x5*0x3e8};try{_0x6746b8[_0x0509('0x9')]=_0x58a766['data6']?JSON[_0x0509('0xa')](Mustache[_0x0509('0x7')](_0x58a766[_0x0509('0xb')],_0x2c5a93)):{};}catch(_0x57714d){logger[_0x0509('0xc')](_0x57714d['stack']);}switch(_0x58a766[_0x0509('0xd')][_0x0509('0x6')]()){case _0x0509('0xe'):case _0x0509('0xf'):_0x313f43=null;_0x6746b8['qs']=_0x2c5a93;break;case'POST':case _0x0509('0x10'):if(_0x58a766[_0x0509('0x11')]){try{_0x313f43=JSON[_0x0509('0xa')](Mustache['render'](_0x58a766['data7'],_0x2c5a93));_0x6746b8[_0x0509('0x12')]=_0x313f43;}catch(_0xfb457e){logger[_0x0509('0xc')](_0xfb457e['stack']);logger[_0x0509('0xc')](_0x0509('0x13'));}}else{_0x313f43=_0x2c5a93;_0x6746b8[_0x0509('0x12')]=_0x313f43;}break;}logger[_0x0509('0x14')](util[_0x0509('0x15')](_0x0509('0x16'),_0x58a766[_0x0509('0xd')],_0x58a766[_0x0509('0x17')],JSON[_0x0509('0x18')](_0x6746b8)));rp(_0x6746b8)[_0x0509('0x19')](function(_0x5a3e3c){_0x313f43=!_[_0x0509('0x1a')](_0x313f43)?_0x0509('0x1b')+_0x313f43:'';_0x32d9b5=typeof _0x5a3e3c[_0x0509('0x12')]==='object'?JSON['stringify'](_0x5a3e3c['body']):_0x5a3e3c[_0x0509('0x12')];logger['info'](util[_0x0509('0x15')](_0x0509('0x1c'),_0x58a766[_0x0509('0xd')],_0x58a766['data2'],_0x5a3e3c[_0x0509('0x1d')],_0x32d9b5));})['catch'](function(_0x51a68a){logger['error'](util[_0x0509('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x58a766['data1'],_0x58a766[_0x0509('0x17')],_0x51a68a[_0x0509('0x1d')],_0x51a68a['name'],_0x51a68a[_0x0509('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index d40686b..dfcfbdc 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 _0xc14b=['result','catch','rpc','exports','jayson/promise','bluebird','../../config/logger','routing','http','request','debug','error','message'];(function(_0x52ba15,_0x44132b){var _0x730d84=function(_0x262bad){while(--_0x262bad){_0x52ba15['push'](_0x52ba15['shift']());}};_0x730d84(++_0x44132b);}(_0xc14b,0xa0));var _0xbc14=function(_0xd40d77,_0x101b68){_0xd40d77=_0xd40d77-0x0;var _0x5f062a=_0xc14b[_0xd40d77];return _0x5f062a;};'use strict';var jayson=require(_0xbc14('0x0'));var BPromise=require(_0xbc14('0x1'));var logger=require(_0xbc14('0x2'))(_0xbc14('0x3'));var client=jayson['client'][_0xbc14('0x4')]({'port':0x2329});client['Request']=function(_0x2f6b84,_0x1ef0d5){return new BPromise(function(_0x46d5e0,_0x13476b){return client[_0xbc14('0x5')](_0x2f6b84,_0x1ef0d5)['then'](function(_0x355114){logger[_0xbc14('0x6')]('rpc',_0xbc14('0x3'),_0x2f6b84,_0x1ef0d5,_0x355114);if(_0x355114[_0xbc14('0x7')]){logger[_0xbc14('0x7')]('rpc','routing',_0x2f6b84,_0x355114['error']['message'],_0x1ef0d5);return _0x13476b(_0x355114['error'][_0xbc14('0x8')]);}else{return _0x46d5e0(_0x355114[_0xbc14('0x9')]);}})[_0xbc14('0xa')](function(_0x31f39f){logger['error'](_0xbc14('0xb'),'routing',_0x2f6b84,_0x31f39f,_0x1ef0d5);return _0x13476b(_0x31f39f);});});};module[_0xbc14('0xc')]=client; \ No newline at end of file +var _0x4346=['debug','error','rpc','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request'];(function(_0x56eed7,_0x3cb67d){var _0x23bb08=function(_0x432768){while(--_0x432768){_0x56eed7['push'](_0x56eed7['shift']());}};_0x23bb08(++_0x3cb67d);}(_0x4346,0x70));var _0x6434=function(_0x17249c,_0x168d62){_0x17249c=_0x17249c-0x0;var _0x324e7b=_0x4346[_0x17249c];return _0x324e7b;};'use strict';var jayson=require(_0x6434('0x0'));var BPromise=require(_0x6434('0x1'));var logger=require(_0x6434('0x2'))(_0x6434('0x3'));var client=jayson[_0x6434('0x4')][_0x6434('0x5')]({'port':0x2329});client[_0x6434('0x6')]=function(_0x5f3303,_0x2de610){return new BPromise(function(_0x1f8f21,_0x2215e3){return client[_0x6434('0x7')](_0x5f3303,_0x2de610)['then'](function(_0x3525df){logger[_0x6434('0x8')]('rpc',_0x6434('0x3'),_0x5f3303,_0x2de610,_0x3525df);if(_0x3525df[_0x6434('0x9')]){logger[_0x6434('0x9')](_0x6434('0xa'),_0x6434('0x3'),_0x5f3303,_0x3525df[_0x6434('0x9')]['message'],_0x2de610);return _0x2215e3(_0x3525df[_0x6434('0x9')][_0x6434('0xb')]);}else{return _0x1f8f21(_0x3525df[_0x6434('0xc')]);}})[_0x6434('0xd')](function(_0x2e1784){logger[_0x6434('0x9')](_0x6434('0xa'),_0x6434('0x3'),_0x5f3303,_0x2e1784,_0x2de610);return _0x2215e3(_0x2e1784);});});};module[_0x6434('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 956d4df..ab7b35e 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 _0x827a=['getMailAccounts','initMailAccounts','refresh','mailAccounts','getSettings','catch','error','Email\x20service\x20initialization','./server','./lib/email','./rpc/mailAccount','./rpc/setting','email','resolve','then'];(function(_0x4f617a,_0x2475f7){var _0x9d2059=function(_0x498fa6){while(--_0x498fa6){_0x4f617a['push'](_0x4f617a['shift']());}};_0x9d2059(++_0x2475f7);}(_0x827a,0xbc));var _0xa827=function(_0xf6eff,_0x1fc3c6){_0xf6eff=_0xf6eff-0x0;var _0x3959a0=_0x827a[_0xf6eff];return _0x3959a0;};'use strict';var server=require(_0xa827('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0xa827('0x1'));var mailAccount=require(_0xa827('0x2'));var setting=require(_0xa827('0x3'));var logger=require('../../config/logger')(_0xa827('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xa827('0x5')]()[_0xa827('0x6')](mailAccount[_0xa827('0x7')]())[_0xa827('0x6')](realtime[_0xa827('0x8')]())[_0xa827('0x6')](function(){email[_0xa827('0x9')](realtime[_0xa827('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xa827('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xa827('0xb')]();})[_0xa827('0x6')](function(_0x27a66b){return setInterval(initRealtime,_0x27a66b['loginMailFrequency']*0x3e8);})[_0xa827('0xc')](function(_0x14b854){logger[_0xa827('0xd')](_0xa827('0xe'),_0x14b854);});}main(); \ No newline at end of file +var _0x72be=['Email\x20service\x20initialization','./server','./lib/email','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','listen','getSettings','loginMailFrequency','catch','error'];(function(_0x36fe63,_0x13af61){var _0x33841c=function(_0x343e62){while(--_0x343e62){_0x36fe63['push'](_0x36fe63['shift']());}};_0x33841c(++_0x13af61);}(_0x72be,0xd3));var _0xe72b=function(_0x1e921d,_0x40b492){_0x1e921d=_0x1e921d-0x0;var _0x216006=_0x72be[_0x1e921d];return _0x216006;};'use strict';var server=require(_0xe72b('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0xe72b('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xe72b('0x2'));var logger=require(_0xe72b('0x3'))(_0xe72b('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xe72b('0x5')]()[_0xe72b('0x6')](mailAccount[_0xe72b('0x7')]())[_0xe72b('0x6')](realtime[_0xe72b('0x8')]())[_0xe72b('0x6')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xe72b('0x9')](realtime,email)[_0xe72b('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xe72b('0xa')]();})['then'](function(_0x43b45a){return setInterval(initRealtime,_0x43b45a[_0xe72b('0xb')]*0x3e8);})[_0xe72b('0xc')](function(_0x25104a){logger[_0xe72b('0xd')](_0xe72b('0xe'),_0x25104a);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index bb4cd39..7179153 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 _0xdf3b=['messageStatus','verifySmtp','Smtp','verify','verified','bluebird','md5','ioredis','../../../config/environment','email','redis','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','imapAccounts','smtp','prototype','mailAccounts','name','active','Imap','status','total','isNil','stringify','emit','mailAccount:update','refresh','service','provider','custom','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf3b,0x137));var _0xbdf3=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0xdf3b[_0x1daaa9];return _0x1dd221;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xbdf3('0x0'));var md5=require(_0xbdf3('0x1'));var Redis=require(_0xbdf3('0x2'));var config=require(_0xbdf3('0x3'));var logger=require('../../../config/logger')(_0xbdf3('0x4'));config[_0xbdf3('0x5')]=_['defaults'](config[_0xbdf3('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xbdf3('0x6'))(new Redis(config[_0xbdf3('0x5')]));var EmailImap=require(_0xbdf3('0x7'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xbdf3('0x8'));var md5Accounts={};function EmailChannel(_0x51c6e5){logger[_0xbdf3('0x9')](_0xbdf3('0xa'));this['mailAccounts']=_0x51c6e5['mailAccounts'];this[_0xbdf3('0xb')]={};this[_0xbdf3('0xc')]=new EmailSmtp();}EmailChannel[_0xbdf3('0xd')]['emit']=function(_0x295d35){var _0x4f2576=this[_0xbdf3('0xe')][_0x295d35];var _0xcf4fb2={'id':_0x4f2576['id'],'name':_0x4f2576[_0xbdf3('0xf')],'key':_0x4f2576['key'],'active':_0x4f2576[_0xbdf3('0x10')],'Imap':{'status':_0x4f2576[_0xbdf3('0x11')][_0xbdf3('0x12')],'messageStatus':_0x4f2576['Imap']['messageStatus'],'total':_0x4f2576[_0xbdf3('0x11')][_0xbdf3('0x13')]}};if(_[_0xbdf3('0x14')](md5Accounts[_0x295d35])){md5Accounts[_0x295d35]={};}var _0x334c6a=md5(JSON[_0xbdf3('0x15')](_0xcf4fb2));if(md5Accounts[_0x295d35][_0xbdf3('0x1')]!==_0x334c6a){md5Accounts[_0x295d35][_0xbdf3('0x1')]=_0x334c6a;io[_0xbdf3('0x16')](_0xbdf3('0x17'),_0xcf4fb2);}};EmailChannel['prototype'][_0xbdf3('0x18')]=function(_0x5e87c3){for(var _0x2f40c9 in _0x5e87c3){if(_0x5e87c3['hasOwnProperty'](_0x2f40c9)){if(_0x5e87c3[_0x2f40c9]['Imap']&&_0x5e87c3[_0x2f40c9]['active']){var _0x385619=_0x5e87c3[_0x2f40c9][_0xbdf3('0x11')];if(!_0x385619[_0xbdf3('0x19')]&&_0x5e87c3[_0x2f40c9][_0xbdf3('0x1a')]!==_0xbdf3('0x1b'))_0x385619[_0xbdf3('0x19')]=_0x5e87c3[_0x2f40c9][_0xbdf3('0x1a')];if(!this['imapAccounts']['hasOwnProperty'](_0x385619['id'])){this['imapAccounts'][_0x385619['id']]=new EmailImap(_0x385619,_0x5e87c3[_0x2f40c9][_0xbdf3('0x4')]);this['imapAccounts'][_0x385619['id']]['on'](_0xbdf3('0x1c'),this['handleImapBox'][_0xbdf3('0x1d')](this,_0x2f40c9));this[_0xbdf3('0xb')][_0x385619['id']]['on']('email',this[_0xbdf3('0x1e')][_0xbdf3('0x1d')](this,_0x2f40c9));this[_0xbdf3('0xb')][_0x385619['id']]['on'](_0xbdf3('0x1f'),this[_0xbdf3('0x20')][_0xbdf3('0x1d')](this,_0x2f40c9));this[_0xbdf3('0xb')][_0x385619['id']]['on'](_0xbdf3('0x21'),this[_0xbdf3('0x22')][_0xbdf3('0x1d')](this,_0x2f40c9));}}else{if(_[_0xbdf3('0x14')](this[_0xbdf3('0xe')][_0x2f40c9][_0xbdf3('0x11')])){this['mailAccounts'][_0x2f40c9][_0xbdf3('0x11')]={};}this[_0xbdf3('0xe')][_0x2f40c9][_0xbdf3('0x11')][_0xbdf3('0x12')]=_0xbdf3('0x23');this[_0xbdf3('0xe')][_0x2f40c9][_0xbdf3('0x11')]['messageStatus']='';this[_0xbdf3('0x16')](_0x2f40c9);}}}};EmailChannel['prototype'][_0xbdf3('0x24')]=function(_0x222f38,_0xb29ed3){if(this[_0xbdf3('0xe')][_0x222f38]){this[_0xbdf3('0xe')][_0x222f38][_0xbdf3('0x11')]['status']=_0xbdf3('0x25');this['mailAccounts'][_0x222f38][_0xbdf3('0x11')]['messageStatus']=_0xb29ed3[_0xbdf3('0xf')];if(_0xb29ed3[_0xbdf3('0x26')]){this[_0xbdf3('0xe')][_0x222f38][_0xbdf3('0x11')][_0xbdf3('0x13')]=_0xb29ed3[_0xbdf3('0x26')][_0xbdf3('0x13')];}return this[_0xbdf3('0x16')](_0x222f38);}};EmailChannel[_0xbdf3('0xd')][_0xbdf3('0x1e')]=function(_0x52aed5,_0x4a7f04){logger[_0xbdf3('0x9')](_0xbdf3('0x27'),_0x4a7f04[_0xbdf3('0x28')],_0x4a7f04['lastName'],_0x4a7f04['from'],_0x52aed5);if(this[_0xbdf3('0xe')][_0x52aed5]){return mailAccount[_0xbdf3('0x29')](_0x52aed5,_0x4a7f04)[_0xbdf3('0x2a')](function(_0x9ba072){if(_0x9ba072){logger[_0xbdf3('0x9')]('Mail\x20accepted\x20from\x20routing');}})[_0xbdf3('0x2b')](function(_0x1504dc){logger[_0xbdf3('0x21')](_0xbdf3('0x2c'),JSON[_0xbdf3('0x15')](_0x1504dc));});}};EmailChannel[_0xbdf3('0xd')][_0xbdf3('0x20')]=function(_0x27f691){if(this['mailAccounts'][_0x27f691]&&this['mailAccounts'][_0x27f691][_0xbdf3('0x11')]){if(this[_0xbdf3('0xb')][this[_0xbdf3('0xe')][_0x27f691][_0xbdf3('0x11')]['id']]){delete this[_0xbdf3('0xb')][this[_0xbdf3('0xe')][_0x27f691]['Imap']['id']];}this[_0xbdf3('0xe')][_0x27f691][_0xbdf3('0x11')][_0xbdf3('0x2d')]=moment();this[_0xbdf3('0x16')](_0x27f691);}};EmailChannel['prototype'][_0xbdf3('0x22')]=function(_0x1a1a92,_0x35b70a){if(this[_0xbdf3('0xe')][_0x1a1a92]){this[_0xbdf3('0xe')][_0x1a1a92][_0xbdf3('0x11')][_0xbdf3('0x12')]=_0xbdf3('0x21');this[_0xbdf3('0xe')][_0x1a1a92][_0xbdf3('0x11')][_0xbdf3('0x2e')]=_0x35b70a;return this[_0xbdf3('0x16')](_0x1a1a92);}};EmailChannel[_0xbdf3('0xd')]['sendMail']=function(_0x3fd333,_0x1e2074){return this['smtp']['send'](_0x3fd333,_0x1e2074);};EmailChannel[_0xbdf3('0xd')][_0xbdf3('0x2f')]=function(_0xbea14a){var _0x1e4211=this;if(this['mailAccounts'][_0xbea14a['id']]){if(_[_0xbdf3('0x14')](this[_0xbdf3('0xe')][_0xbea14a['id']][_0xbdf3('0x30')])){this['mailAccounts'][_0xbea14a['id']]['Smtp']={};}this[_0xbdf3('0xe')][_0xbea14a['id']][_0xbdf3('0x30')]['lastSync']=moment();return new BPromise(function(_0x406ba3,_0x555c42){return _0x1e4211[_0xbdf3('0xc')][_0xbdf3('0x31')](_0xbea14a)[_0xbdf3('0x2a')](function(_0x5a5f8c){_0x1e4211[_0xbdf3('0xe')][_0xbea14a['id']][_0xbdf3('0x30')][_0xbdf3('0x12')]=_0xbdf3('0x32');_0x1e4211['mailAccounts'][_0xbea14a['id']][_0xbdf3('0x30')]['messageStatus']='';_0x1e4211[_0xbdf3('0x16')](_0xbea14a['id']);_0x406ba3(_0x5a5f8c);})[_0xbdf3('0x2b')](function(_0x4787ba){_0x1e4211['mailAccounts'][_0xbea14a['id']][_0xbdf3('0x30')]['status']=_0xbdf3('0x21');_0x1e4211['mailAccounts'][_0xbea14a['id']][_0xbdf3('0x30')]['messageStatus']=_0x4787ba;_0x1e4211[_0xbdf3('0x16')](_0xbea14a['id']);_0x555c42(_0x4787ba);});});}return this['smtp']['verify'](_0xbea14a);};module['exports']=EmailChannel; \ No newline at end of file +var _0x79ef=['mailAccounts','smtp','prototype','emit','name','key','status','Imap','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','active','service','provider','imapAccounts','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','messageStatus','connected','total','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','lastSync','sendMail','verifySmtp','Smtp','verify','exports','moment','bluebird','md5','../../../config/environment','email','redis','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel'];(function(_0x57afde,_0x279aea){var _0x3b4235=function(_0x4f9f99){while(--_0x4f9f99){_0x57afde['push'](_0x57afde['shift']());}};_0x3b4235(++_0x279aea);}(_0x79ef,0x12d));var _0xf79e=function(_0x1c78aa,_0x35ce3b){_0x1c78aa=_0x1c78aa-0x0;var _0x4496d6=_0x79ef[_0x1c78aa];return _0x4496d6;};'use strict';var _=require('lodash');var moment=require(_0xf79e('0x0'));var BPromise=require(_0xf79e('0x1'));var md5=require(_0xf79e('0x2'));var Redis=require('ioredis');var config=require(_0xf79e('0x3'));var logger=require('../../../config/logger')(_0xf79e('0x4'));config[_0xf79e('0x5')]=_['defaults'](config[_0xf79e('0x5')],{'host':_0xf79e('0x6'),'port':0x18eb});var io=require(_0xf79e('0x7'))(new Redis(config[_0xf79e('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xf79e('0x8'));var mailAccount=require(_0xf79e('0x9'));var md5Accounts={};function EmailChannel(_0x13a2af){logger['info'](_0xf79e('0xa'));this[_0xf79e('0xb')]=_0x13a2af[_0xf79e('0xb')];this['imapAccounts']={};this[_0xf79e('0xc')]=new EmailSmtp();}EmailChannel[_0xf79e('0xd')][_0xf79e('0xe')]=function(_0x11c6e0){var _0x55d3ae=this[_0xf79e('0xb')][_0x11c6e0];var _0x4c71f4={'id':_0x55d3ae['id'],'name':_0x55d3ae[_0xf79e('0xf')],'key':_0x55d3ae[_0xf79e('0x10')],'active':_0x55d3ae['active'],'Imap':{'status':_0x55d3ae['Imap'][_0xf79e('0x11')],'messageStatus':_0x55d3ae[_0xf79e('0x12')]['messageStatus'],'total':_0x55d3ae['Imap']['total']}};if(_[_0xf79e('0x13')](md5Accounts[_0x11c6e0])){md5Accounts[_0x11c6e0]={};}var _0x19f9bb=md5(JSON[_0xf79e('0x14')](_0x4c71f4));if(md5Accounts[_0x11c6e0][_0xf79e('0x2')]!==_0x19f9bb){md5Accounts[_0x11c6e0][_0xf79e('0x2')]=_0x19f9bb;io[_0xf79e('0xe')](_0xf79e('0x15'),_0x4c71f4);}};EmailChannel[_0xf79e('0xd')][_0xf79e('0x16')]=function(_0x50d8ef){for(var _0xafd05f in _0x50d8ef){if(_0x50d8ef[_0xf79e('0x17')](_0xafd05f)){if(_0x50d8ef[_0xafd05f][_0xf79e('0x12')]&&_0x50d8ef[_0xafd05f][_0xf79e('0x18')]){var _0x351666=_0x50d8ef[_0xafd05f][_0xf79e('0x12')];if(!_0x351666[_0xf79e('0x19')]&&_0x50d8ef[_0xafd05f][_0xf79e('0x1a')]!=='custom')_0x351666[_0xf79e('0x19')]=_0x50d8ef[_0xafd05f][_0xf79e('0x1a')];if(!this[_0xf79e('0x1b')][_0xf79e('0x17')](_0x351666['id'])){this['imapAccounts'][_0x351666['id']]=new EmailImap(_0x351666,_0x50d8ef[_0xafd05f][_0xf79e('0x4')]);this[_0xf79e('0x1b')][_0x351666['id']]['on'](_0xf79e('0x1c'),this[_0xf79e('0x1d')][_0xf79e('0x1e')](this,_0xafd05f));this[_0xf79e('0x1b')][_0x351666['id']]['on'](_0xf79e('0x4'),this[_0xf79e('0x1f')]['bind'](this,_0xafd05f));this[_0xf79e('0x1b')][_0x351666['id']]['on'](_0xf79e('0x20'),this[_0xf79e('0x21')][_0xf79e('0x1e')](this,_0xafd05f));this['imapAccounts'][_0x351666['id']]['on'](_0xf79e('0x22'),this[_0xf79e('0x23')][_0xf79e('0x1e')](this,_0xafd05f));}}else{if(_[_0xf79e('0x13')](this[_0xf79e('0xb')][_0xafd05f]['Imap'])){this[_0xf79e('0xb')][_0xafd05f]['Imap']={};}this[_0xf79e('0xb')][_0xafd05f][_0xf79e('0x12')]['status']='disabled';this[_0xf79e('0xb')][_0xafd05f][_0xf79e('0x12')][_0xf79e('0x24')]='';this['emit'](_0xafd05f);}}}};EmailChannel[_0xf79e('0xd')][_0xf79e('0x1d')]=function(_0x7f3b32,_0x4ce193){if(this[_0xf79e('0xb')][_0x7f3b32]){this['mailAccounts'][_0x7f3b32][_0xf79e('0x12')][_0xf79e('0x11')]=_0xf79e('0x25');this[_0xf79e('0xb')][_0x7f3b32][_0xf79e('0x12')][_0xf79e('0x24')]=_0x4ce193[_0xf79e('0xf')];if(_0x4ce193['messages']){this[_0xf79e('0xb')][_0x7f3b32]['Imap'][_0xf79e('0x26')]=_0x4ce193['messages'][_0xf79e('0x26')];}return this[_0xf79e('0xe')](_0x7f3b32);}};EmailChannel[_0xf79e('0xd')]['handleImapEmail']=function(_0x169aa7,_0x591b1e){logger[_0xf79e('0x27')](_0xf79e('0x28'),_0x591b1e['firstName'],_0x591b1e[_0xf79e('0x29')],_0x591b1e[_0xf79e('0x2a')],_0x169aa7);if(this[_0xf79e('0xb')][_0x169aa7]){return mailAccount['notify'](_0x169aa7,_0x591b1e)[_0xf79e('0x2b')](function(_0x3c491d){if(_0x3c491d){logger[_0xf79e('0x27')](_0xf79e('0x2c'));}})[_0xf79e('0x2d')](function(_0x19e2cb){logger[_0xf79e('0x22')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xf79e('0x14')](_0x19e2cb));});}};EmailChannel[_0xf79e('0xd')][_0xf79e('0x21')]=function(_0x4bb89e){if(this[_0xf79e('0xb')][_0x4bb89e]&&this[_0xf79e('0xb')][_0x4bb89e][_0xf79e('0x12')]){if(this[_0xf79e('0x1b')][this[_0xf79e('0xb')][_0x4bb89e][_0xf79e('0x12')]['id']]){delete this[_0xf79e('0x1b')][this[_0xf79e('0xb')][_0x4bb89e][_0xf79e('0x12')]['id']];}this[_0xf79e('0xb')][_0x4bb89e]['Imap'][_0xf79e('0x2e')]=moment();this['emit'](_0x4bb89e);}};EmailChannel[_0xf79e('0xd')]['handleImapError']=function(_0x2729b1,_0x38c2f6){if(this[_0xf79e('0xb')][_0x2729b1]){this[_0xf79e('0xb')][_0x2729b1][_0xf79e('0x12')][_0xf79e('0x11')]='error';this[_0xf79e('0xb')][_0x2729b1]['Imap'][_0xf79e('0x24')]=_0x38c2f6;return this[_0xf79e('0xe')](_0x2729b1);}};EmailChannel[_0xf79e('0xd')][_0xf79e('0x2f')]=function(_0x14a9ed,_0x49f69c){return this[_0xf79e('0xc')]['send'](_0x14a9ed,_0x49f69c);};EmailChannel[_0xf79e('0xd')][_0xf79e('0x30')]=function(_0x7fece3){var _0x4479b6=this;if(this[_0xf79e('0xb')][_0x7fece3['id']]){if(_['isNil'](this[_0xf79e('0xb')][_0x7fece3['id']][_0xf79e('0x31')])){this[_0xf79e('0xb')][_0x7fece3['id']][_0xf79e('0x31')]={};}this[_0xf79e('0xb')][_0x7fece3['id']][_0xf79e('0x31')][_0xf79e('0x2e')]=moment();return new BPromise(function(_0x47599b,_0x5653cc){return _0x4479b6[_0xf79e('0xc')][_0xf79e('0x32')](_0x7fece3)['then'](function(_0x5dd982){_0x4479b6[_0xf79e('0xb')][_0x7fece3['id']]['Smtp']['status']='verified';_0x4479b6[_0xf79e('0xb')][_0x7fece3['id']][_0xf79e('0x31')][_0xf79e('0x24')]='';_0x4479b6[_0xf79e('0xe')](_0x7fece3['id']);_0x47599b(_0x5dd982);})[_0xf79e('0x2d')](function(_0x2ffd51){_0x4479b6[_0xf79e('0xb')][_0x7fece3['id']]['Smtp'][_0xf79e('0x11')]=_0xf79e('0x22');_0x4479b6['mailAccounts'][_0x7fece3['id']][_0xf79e('0x31')][_0xf79e('0x24')]=_0x2ffd51;_0x4479b6[_0xf79e('0xe')](_0x7fece3['id']);_0x5653cc(_0x2ffd51);});});}return this['smtp']['verify'](_0x7fece3);};module[_0xf79e('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 0e27a44..803fd59 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 _0x7033=['handleFetchError','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','bind','once','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','handleReady','handleOpenBox','emit','readUnseen','handleCloseBox','search','handleReadUnseen','length','message'];(function(_0x2644b4,_0xd4d01c){var _0x249b3c=function(_0x3524d7){while(--_0x3524d7){_0x2644b4['push'](_0x2644b4['shift']());}};_0x249b3c(++_0xd4d01c);}(_0x7033,0xc2));var _0x3703=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x7033[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x3703('0x0'));var util=require('util');var Imap=require(_0x3703('0x1'));var simpleParser=require('mailparser')[_0x3703('0x2')];var Iconv=require(_0x3703('0x3'))['Iconv'];var EventEmitter=require(_0x3703('0x4'))[_0x3703('0x5')];var utils=require(_0x3703('0x6'));var logger=require(_0x3703('0x7'))(_0x3703('0x8'));function EmailImap(_0x401e22,_0x3c421a){this[_0x3703('0x9')]=_0x401e22[_0x3703('0x9')];this[_0x3703('0xa')]=this[_0x3703('0xb')](_0x401e22,_0x3c421a);this[_0x3703('0x1')]=new Imap(this[_0x3703('0xa')]);this[_0x3703('0x1')]['once']('ready',this['handleReady'][_0x3703('0xc')](this));this[_0x3703('0x1')][_0x3703('0xd')](_0x3703('0xe'),this[_0x3703('0xf')][_0x3703('0xc')](this));this[_0x3703('0x1')]['on'](_0x3703('0x10'),this[_0x3703('0x11')]['bind'](this));this[_0x3703('0x1')][_0x3703('0x12')]();}util[_0x3703('0x13')](EmailImap,EventEmitter);EmailImap[_0x3703('0x14')][_0x3703('0xb')]=function(_0x366048,_0x16fb40){var _0x423449={'connTimeout':_0x366048['connTimeout']?_0x366048[_0x3703('0x15')]*0x3e8:0x2710,'authTimeout':_0x366048[_0x3703('0x16')]?_0x366048[_0x3703('0x16')]*0x3e8:0x1388};if(_0x366048[_0x3703('0x17')]){_0x423449[_0x3703('0x18')]=_0x366048[_0x3703('0x18')];if(_0x366048[_0x3703('0x19')]){_0x423449[_0x3703('0x1a')]=utils['generateXOAuth2Token'](_0x366048[_0x3703('0x1b')][_0x3703('0x1c')],_0x366048[_0x3703('0x18')]);}else{_0x423449[_0x3703('0x1d')]=_0x366048[_0x3703('0x1d')];}}else{if(_0x366048[_0x3703('0x1e')]){_0x423449[_0x3703('0x18')]=_0x366048[_0x3703('0x18')];_0x423449['password']=_0x366048[_0x3703('0x1d')];}}_0x423449[_0x3703('0x8')]=_0x16fb40||_0x366048[_0x3703('0x18')]||_0x3703('0x1f');_0x423449['host']=_0x366048[_0x3703('0x20')];_0x423449['port']=_0x366048[_0x3703('0x21')]||0x3e1;if(_0x366048[_0x3703('0x22')]){_0x423449[_0x3703('0x22')]=!![];}else{_0x423449[_0x3703('0x22')]=![];_0x423449[_0x3703('0x23')]=_0x3703('0x24');}return _0x423449;};EmailImap[_0x3703('0x14')][_0x3703('0x25')]=function(){this['imap']['openBox'](this[_0x3703('0x9')],![],this[_0x3703('0x26')]['bind'](this));};EmailImap[_0x3703('0x14')]['handleOpenBox']=function(_0x415ac2,_0x5a71f1){if(_0x415ac2){this[_0x3703('0x11')](_0x415ac2,!![]);}else{this[_0x3703('0x27')]('box',_0x5a71f1);this[_0x3703('0x28')]();}};EmailImap['prototype'][_0x3703('0x29')]=function(_0x101113){if(_0x101113){this[_0x3703('0x11')](_0x101113,!![]);}else{this[_0x3703('0x1')][_0x3703('0xe')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x3703('0x1')][_0x3703('0x2a')](['UNSEEN'],this['handleReadUnseen'][_0x3703('0xc')](this));};EmailImap['prototype'][_0x3703('0x2b')]=function(_0x5401a1,_0x1488a4){if(_0x5401a1){this[_0x3703('0x11')](_0x5401a1,!![]);}else{if(_0x1488a4[_0x3703('0x2c')]){try{var _0x5f354b=this[_0x3703('0x1')]['fetch'](_0x1488a4,{'bodies':'','markSeen':!![]});_0x5f354b['on'](_0x3703('0x2d'),this['handleFetchMessage'][_0x3703('0xc')](this));_0x5f354b[_0x3703('0xd')](_0x3703('0x10'),this[_0x3703('0x2e')][_0x3703('0xc')](this));_0x5f354b[_0x3703('0xd')]('end',this['handleFetchEnd'][_0x3703('0xc')](this));}catch(_0x302920){logger['error'](_0x302920);}}else{this[_0x3703('0x1')][_0x3703('0x2f')](!![],this[_0x3703('0x29')][_0x3703('0xc')](this));}}};EmailImap['prototype'][_0x3703('0x30')]=function(_0x2ac0e5){_0x2ac0e5['on']('body',this[_0x3703('0x31')][_0x3703('0xc')](this));_0x2ac0e5['once'](_0x3703('0x32'),this['handleMessageAttributes'][_0x3703('0xc')](this));_0x2ac0e5[_0x3703('0xd')]('end',this[_0x3703('0x33')][_0x3703('0xc')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x50f99e){simpleParser(_0x50f99e,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap[_0x3703('0x14')][_0x3703('0x33')]=function(){};EmailImap[_0x3703('0x14')][_0x3703('0x34')]=function(_0x1f7585,_0x3beb59){if(_0x1f7585){logger[_0x3703('0x10')](_0x1f7585);}else{var _0x283377=this;utils[_0x3703('0x35')](this[_0x3703('0xa')],_0x3beb59,function(_0x115e9f){_0x283377[_0x3703('0x27')](_0x3703('0x8'),_0x115e9f);});}};EmailImap['prototype'][_0x3703('0x36')]=function(){this[_0x3703('0x1')]['closeBox'](!![],this['handleCloseBox'][_0x3703('0xc')](this));};EmailImap[_0x3703('0x14')][_0x3703('0x2e')]=function(_0x4613f7){this['handleError'](_0x4613f7);this['imap']['closeBox'](!![],this[_0x3703('0x29')][_0x3703('0xc')](this));};EmailImap[_0x3703('0x14')][_0x3703('0xf')]=function(){this['emit']('end');};EmailImap['prototype']['handleError']=function(_0x273881,_0x49c0f2){logger[_0x3703('0x10')](_0x3703('0x11'),this[_0x3703('0xa')][_0x3703('0x8')],JSON[_0x3703('0x37')](_0x273881));var _0x4e14bf='';if(_0x273881){if(_0x273881[_0x3703('0x38')]){_0x4e14bf=_0x273881['textCode'];}else{for(var _0x8651b1 in _0x273881){if(_0x273881[_0x3703('0x39')](_0x8651b1)){_0x4e14bf+=_[_0x3703('0x3a')](_0x8651b1)+':\x20'+_0x273881[_0x8651b1]+'\x0a';}}}}if(_0x49c0f2){this[_0x3703('0x1')][_0x3703('0xe')]();}else{this['emit']('error',_0x4e14bf);this[_0x3703('0x27')](_0x3703('0xe'));}};module[_0x3703('0x3b')]=EmailImap; \ No newline at end of file +var _0x02dc=['handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','emit','stringify','textCode','upperFirst','exports','util','imap','simpleParser','iconv','Iconv','events','./utils','../../../config/logger','email','mailbox','account','getAccount','ready','handleReady','bind','once','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','xoauth2','generateXOAuth2Token','CloudProvider','password','authentication','anonymous@xcally.com','host','port','tls','required','openBox','handleOpenBox','readUnseen','handleCloseBox','search','UNSEEN','length','fetch','message','handleFetchMessage','handleFetchError'];(function(_0x311950,_0x5a74cd){var _0x5a628c=function(_0x4d7b17){while(--_0x4d7b17){_0x311950['push'](_0x311950['shift']());}};_0x5a628c(++_0x5a74cd);}(_0x02dc,0x1b0));var _0xc02d=function(_0x1b521b,_0x2dab51){_0x1b521b=_0x1b521b-0x0;var _0xb8093d=_0x02dc[_0x1b521b];return _0xb8093d;};'use strict';var _=require('lodash');var util=require(_0xc02d('0x0'));var Imap=require(_0xc02d('0x1'));var simpleParser=require('mailparser')[_0xc02d('0x2')];var Iconv=require(_0xc02d('0x3'))[_0xc02d('0x4')];var EventEmitter=require(_0xc02d('0x5'))['EventEmitter'];var utils=require(_0xc02d('0x6'));var logger=require(_0xc02d('0x7'))(_0xc02d('0x8'));function EmailImap(_0x4458c8,_0x236ffa){this[_0xc02d('0x9')]=_0x4458c8[_0xc02d('0x9')];this[_0xc02d('0xa')]=this[_0xc02d('0xb')](_0x4458c8,_0x236ffa);this['imap']=new Imap(this['account']);this[_0xc02d('0x1')]['once'](_0xc02d('0xc'),this[_0xc02d('0xd')][_0xc02d('0xe')](this));this[_0xc02d('0x1')][_0xc02d('0xf')](_0xc02d('0x10'),this[_0xc02d('0x11')][_0xc02d('0xe')](this));this[_0xc02d('0x1')]['on'](_0xc02d('0x12'),this[_0xc02d('0x13')][_0xc02d('0xe')](this));this['imap'][_0xc02d('0x14')]();}util[_0xc02d('0x15')](EmailImap,EventEmitter);EmailImap[_0xc02d('0x16')]['getAccount']=function(_0x5bee87,_0x4749b3){var _0x2bbd42={'connTimeout':_0x5bee87[_0xc02d('0x17')]?_0x5bee87[_0xc02d('0x17')]*0x3e8:0x2710,'authTimeout':_0x5bee87[_0xc02d('0x18')]?_0x5bee87['authTimeout']*0x3e8:0x1388};if(_0x5bee87[_0xc02d('0x19')]){_0x2bbd42[_0xc02d('0x1a')]=_0x5bee87[_0xc02d('0x1a')];if(_0x5bee87['modernAuthentication']){_0x2bbd42[_0xc02d('0x1b')]=utils[_0xc02d('0x1c')](_0x5bee87[_0xc02d('0x1d')]['data5'],_0x5bee87[_0xc02d('0x1a')]);}else{_0x2bbd42['password']=_0x5bee87[_0xc02d('0x1e')];}}else{if(_0x5bee87[_0xc02d('0x1f')]){_0x2bbd42[_0xc02d('0x1a')]=_0x5bee87[_0xc02d('0x1a')];_0x2bbd42['password']=_0x5bee87[_0xc02d('0x1e')];}}_0x2bbd42[_0xc02d('0x8')]=_0x4749b3||_0x5bee87['user']||_0xc02d('0x20');_0x2bbd42['host']=_0x5bee87[_0xc02d('0x21')];_0x2bbd42['port']=_0x5bee87[_0xc02d('0x22')]||0x3e1;if(_0x5bee87[_0xc02d('0x23')]){_0x2bbd42[_0xc02d('0x23')]=!![];}else{_0x2bbd42[_0xc02d('0x23')]=![];_0x2bbd42['autotls']=_0xc02d('0x24');}return _0x2bbd42;};EmailImap['prototype'][_0xc02d('0xd')]=function(){this[_0xc02d('0x1')][_0xc02d('0x25')](this['mailbox'],![],this[_0xc02d('0x26')][_0xc02d('0xe')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x46670b,_0x1ec229){if(_0x46670b){this[_0xc02d('0x13')](_0x46670b,!![]);}else{this['emit']('box',_0x1ec229);this[_0xc02d('0x27')]();}};EmailImap[_0xc02d('0x16')][_0xc02d('0x28')]=function(_0x1007af){if(_0x1007af){this['handleError'](_0x1007af,!![]);}else{this[_0xc02d('0x1')]['end']();}};EmailImap[_0xc02d('0x16')][_0xc02d('0x27')]=function(){this['imap'][_0xc02d('0x29')]([_0xc02d('0x2a')],this['handleReadUnseen'][_0xc02d('0xe')](this));};EmailImap[_0xc02d('0x16')]['handleReadUnseen']=function(_0x2ad68e,_0x57d458){if(_0x2ad68e){this['handleError'](_0x2ad68e,!![]);}else{if(_0x57d458[_0xc02d('0x2b')]){try{var _0x2b4259=this[_0xc02d('0x1')][_0xc02d('0x2c')](_0x57d458,{'bodies':'','markSeen':!![]});_0x2b4259['on'](_0xc02d('0x2d'),this[_0xc02d('0x2e')][_0xc02d('0xe')](this));_0x2b4259[_0xc02d('0xf')](_0xc02d('0x12'),this[_0xc02d('0x2f')]['bind'](this));_0x2b4259[_0xc02d('0xf')](_0xc02d('0x10'),this[_0xc02d('0x30')][_0xc02d('0xe')](this));}catch(_0x25d77e){logger[_0xc02d('0x12')](_0x25d77e);}}else{this[_0xc02d('0x1')][_0xc02d('0x31')](!![],this[_0xc02d('0x28')][_0xc02d('0xe')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x3be323){_0x3be323['on']('body',this[_0xc02d('0x32')][_0xc02d('0xe')](this));_0x3be323[_0xc02d('0xf')](_0xc02d('0x33'),this[_0xc02d('0x34')][_0xc02d('0xe')](this));_0x3be323['once'](_0xc02d('0x10'),this[_0xc02d('0x35')][_0xc02d('0xe')](this));};EmailImap['prototype'][_0xc02d('0x32')]=function(_0x162637){simpleParser(_0x162637,{'Iconv':Iconv},this['handleSimpleParser'][_0xc02d('0xe')](this));};EmailImap[_0xc02d('0x16')]['handleMessageAttributes']=function(){};EmailImap[_0xc02d('0x16')][_0xc02d('0x35')]=function(){};EmailImap[_0xc02d('0x16')][_0xc02d('0x36')]=function(_0x1bbd07,_0x18ef07){if(_0x1bbd07){logger[_0xc02d('0x12')](_0x1bbd07);}else{var _0x46abd4=this;utils['parser'](this['account'],_0x18ef07,function(_0x10329f){_0x46abd4[_0xc02d('0x37')]('email',_0x10329f);});}};EmailImap[_0xc02d('0x16')][_0xc02d('0x30')]=function(){this[_0xc02d('0x1')]['closeBox'](!![],this[_0xc02d('0x28')][_0xc02d('0xe')](this));};EmailImap[_0xc02d('0x16')][_0xc02d('0x2f')]=function(_0x11b999){this[_0xc02d('0x13')](_0x11b999);this[_0xc02d('0x1')][_0xc02d('0x31')](!![],this[_0xc02d('0x28')][_0xc02d('0xe')](this));};EmailImap[_0xc02d('0x16')][_0xc02d('0x11')]=function(){this[_0xc02d('0x37')](_0xc02d('0x10'));};EmailImap[_0xc02d('0x16')][_0xc02d('0x13')]=function(_0xe0471c,_0x115a24){logger[_0xc02d('0x12')](_0xc02d('0x13'),this[_0xc02d('0xa')][_0xc02d('0x8')],JSON[_0xc02d('0x38')](_0xe0471c));var _0x52cb89='';if(_0xe0471c){if(_0xe0471c[_0xc02d('0x39')]){_0x52cb89=_0xe0471c[_0xc02d('0x39')];}else{for(var _0x33e161 in _0xe0471c){if(_0xe0471c['hasOwnProperty'](_0x33e161)){_0x52cb89+=_[_0xc02d('0x3a')](_0x33e161)+':\x20'+_0xe0471c[_0x33e161]+'\x0a';}}}}if(_0x115a24){this[_0xc02d('0x1')][_0xc02d('0x10')]();}else{this[_0xc02d('0x37')]('error',_0x52cb89);this[_0xc02d('0x37')](_0xc02d('0x10'));}};module[_0xc02d('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index e96153d..2d63721 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 _0x5693=['compile','sendMail','toString','createTransport','verify','Not\x20verifired','exports','nodemailer','prototype','use'];(function(_0x2b2ce6,_0x2488d3){var _0x39b9c3=function(_0x118160){while(--_0x118160){_0x2b2ce6['push'](_0x2b2ce6['shift']());}};_0x39b9c3(++_0x2488d3);}(_0x5693,0x89));var _0x3569=function(_0x2f44ad,_0x317f33){_0x2f44ad=_0x2f44ad-0x0;var _0x3a681a=_0x5693[_0x2f44ad];return _0x3a681a;};'use strict';var nodemailer=require(_0x3569('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x3569('0x1')]['send']=function(_0x14922d,_0x3b34e0){return new Promise(function(_0x50c4b8,_0x3a8e03){var _0x351cab=nodemailer['createTransport'](_0x14922d);_0x351cab[_0x3569('0x2')](_0x3569('0x3'),inlineBase64());_0x351cab[_0x3569('0x4')](_0x3b34e0,function(_0x1a46b1,_0x159be0){if(_0x1a46b1){_0x3a8e03(_0x1a46b1[_0x3569('0x5')]());}else{_0x50c4b8(_0x159be0);}});});};EmailSmtp[_0x3569('0x1')]['verify']=function(_0xc6a2f4){return new Promise(function(_0x15b664,_0x902c4e){var _0x4ff938=nodemailer[_0x3569('0x6')](_0xc6a2f4);_0x4ff938[_0x3569('0x7')](function(_0x314066,_0x3a581c){if(_0x314066){_0x902c4e(_0x314066[_0x3569('0x5')]());}else{if(_0x3a581c){_0x15b664(_0x3a581c);}else{_0x902c4e(_0x3569('0x8'));}}});});};module[_0x3569('0x9')]=EmailSmtp; \ No newline at end of file +var _0x0bd4=['nodemailer-plugin-inline-base64','prototype','createTransport','compile','sendMail','toString','verify','nodemailer'];(function(_0x28a6d7,_0x106ff0){var _0xc65da7=function(_0x261b48){while(--_0x261b48){_0x28a6d7['push'](_0x28a6d7['shift']());}};_0xc65da7(++_0x106ff0);}(_0x0bd4,0x137));var _0x40bd=function(_0x324e86,_0x81b1cb){_0x324e86=_0x324e86-0x0;var _0x592846=_0x0bd4[_0x324e86];return _0x592846;};'use strict';var nodemailer=require(_0x40bd('0x0'));var inlineBase64=require(_0x40bd('0x1'));function EmailSmtp(){}EmailSmtp[_0x40bd('0x2')]['send']=function(_0x5e1373,_0x1fa13c){return new Promise(function(_0x503c51,_0x17b14f){var _0x210f68=nodemailer[_0x40bd('0x3')](_0x5e1373);_0x210f68['use'](_0x40bd('0x4'),inlineBase64());_0x210f68[_0x40bd('0x5')](_0x1fa13c,function(_0x384d68,_0x1d5d05){if(_0x384d68){_0x17b14f(_0x384d68[_0x40bd('0x6')]());}else{_0x503c51(_0x1d5d05);}});});};EmailSmtp[_0x40bd('0x2')][_0x40bd('0x7')]=function(_0x508040){return new Promise(function(_0x334339,_0x78dd2){var _0x11c715=nodemailer['createTransport'](_0x508040);_0x11c715['verify'](function(_0x4cb53c,_0xb815dd){if(_0x4cb53c){_0x78dd2(_0x4cb53c[_0x40bd('0x6')]());}else{if(_0xb815dd){_0x334339(_0xb815dd);}else{_0x78dd2('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index adcff6a..1433456 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 _0x6dd1=['isEmpty','message','originCc','bcc','attach','type','attachment','format','%s-%s','now','root','server/files/attachments/','writeFileSync','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','Attachments','Title','Data','

Empty\x20message

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

Empty\x20message

';if(_0x156ce4['Attachments']){for(var _0x5d92c2=0x0;_0x5d92c2<_0x156ce4[_0x16dd('0x43')]['length'];_0x5d92c2++){var _0x12cafc=_0x156ce4[_0x16dd('0x43')][_0x5d92c2];_0x7370d3['message'][_0x16dd('0x1b')]['push']({'filename':_0x12cafc[_0x16dd('0x44')],'content':Buffer['from'](_0x12cafc[_0x16dd('0x45')])});}}}_0x5ecb44(parseEmail(_0x5052ea,_0xb35bd7,_0x7370d3));});}else{_0xb35bd7[_0x16dd('0x17')]=_0x16dd('0x46');_0x5ecb44(parseEmail(_0x5052ea,_0xb35bd7,_0x7370d3));}}else{_0x5ecb44(parseEmail(_0x5052ea,_0xb35bd7,_0x7370d3));}};exports[_0x16dd('0x47')]=function(_0x16fad5,_0x40893d){var _0x487eef=[_0x16dd('0x48')+(_0x40893d||''),_0x16dd('0x49')+_0x16fad5,'',''];return Buffer[_0x16dd('0x3a')](_0x487eef[_0x16dd('0x14')](''),_0x16dd('0x4a'))[_0x16dd('0x4b')](_0x16dd('0x4c'));}; \ No newline at end of file +var _0xb68a=['generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','indexOf','split','length','slice','join','pop','isEmpty','html','test','replace','includes','attachments','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data'];(function(_0x17fcf2,_0x31864d){var _0x3aba59=function(_0x535603){while(--_0x535603){_0x17fcf2['push'](_0x17fcf2['shift']());}};_0x3aba59(++_0x31864d);}(_0xb68a,0x9e));var _0xab68=function(_0x50148e,_0x4c99c7){_0x50148e=_0x50148e-0x0;var _0x446e9d=_0xb68a[_0x50148e];return _0x446e9d;};'use strict';var _=require(_0xab68('0x0'));var moment=require(_0xab68('0x1'));var random=require(_0xab68('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xab68('0x3'));var tnef=require(_0xab68('0x4'));var logger=require(_0xab68('0x5'))(_0xab68('0x6'));var config=require(_0xab68('0x7'));function getAddress(_0x360f73){var _0x12f625=_[_0xab68('0x8')](_0x360f73[_0xab68('0x9')]);return _0x12f625&&_0x12f625['address']?_0x12f625[_0xab68('0xa')]:_0xab68('0xb')+random[_0xab68('0xc')](0x6)+_0xab68('0xd');}function getFirstName(_0x431389){var _0x23e939=_['head'](_0x431389['value']);if(_0x23e939&&_0x23e939[_0xab68('0xe')]){if(_0x23e939[_0xab68('0xe')]==_0x23e939[_0xab68('0xa')]){return _0x23e939['name']['substring'](0x0,_0x23e939[_0xab68('0xe')][_0xab68('0xf')]('@'));}var _0x329b47=_0x23e939[_0xab68('0xe')][_0xab68('0x10')](/\s+/);return _0x329b47[_0xab68('0x11')]>0x1?_0x329b47[_0xab68('0x12')](0x0,-0x1)[_0xab68('0x13')]('\x20'):_0x23e939['name'];}return'Anonymous';}function getLastName(_0x51100c){var _0x218bea=_[_0xab68('0x8')](_0x51100c[_0xab68('0x9')]);if(_0x218bea&&_0x218bea['name']){var _0x266264=_0x218bea['name'][_0xab68('0x10')](/\s+/);return _0x266264[_0xab68('0x11')]>0x1?_0x266264[_0xab68('0x14')]():'';}return'';}function getMails(_0x28d1b1,_0x193d12){var _0x54a35b='';for(var _0x2a45ef=0x0;_0x2a45ef<_0x193d12[_0xab68('0x9')][_0xab68('0x11')];_0x2a45ef+=0x1){if(_0x193d12[_0xab68('0x9')][_0x2a45ef][_0xab68('0xa')]!==_0x28d1b1){if(!_[_0xab68('0x15')](_0x54a35b)){_0x54a35b+=',';}_0x54a35b+=_0x193d12[_0xab68('0x9')][_0x2a45ef]['name']||_0x193d12[_0xab68('0x9')][_0x2a45ef]['address']||'';_0x54a35b+='\x20<';_0x54a35b+=_0x193d12[_0xab68('0x9')][_0x2a45ef][_0xab68('0xa')]?_0x193d12['value'][_0x2a45ef][_0xab68('0xa')]:_0xab68('0xb')+random[_0xab68('0xc')](0x6)+_0xab68('0xd');_0x54a35b+='>';}}return _0x54a35b;}function parseEmail(_0xe1a2d0,_0x5810d0,_0x5178b4){if(_0x5810d0[_0xab68('0x16')]){var _0x893713=/)<[^<]*)*<\/script>/gi;while(_0x893713[_0xab68('0x17')](_0x5810d0[_0xab68('0x16')])){_0x5810d0[_0xab68('0x16')]=_0x5810d0[_0xab68('0x16')][_0xab68('0x18')](_0x893713,'');}if(_0x5810d0[_0xab68('0x16')][_0xab68('0x19')]('{_0xd9bfe2[_0xab68('0x1c')](_0xc6188b[_0xab68('0x1d')]);});var _0x2d35f8=/]+>/g;var _0x5e0e9d=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2d405c=_0x5810d0[_0xab68('0x16')]['replace'](_0x5e0e9d,_0xab68('0x1e'));var _0x4b8639=_0x2d405c[_0xab68('0x18')](_0x2d35f8,_0xab68('0x1f'));for(let _0x6bfd82=0x0;_0x6bfd82<_0xd9bfe2[_0xab68('0x11')];_0x6bfd82++){var _0xbbf32d=_0x4b8639[_0xab68('0x18')](_0xab68('0x1f'),_0xab68('0x20')+_0xd9bfe2[_0x6bfd82]+_0xab68('0x21'));_0x4b8639=_0xbbf32d;}_0x5810d0[_0xab68('0x16')]=_0x4b8639;}_0x5178b4[_0xab68('0x22')]=_0x5810d0[_0xab68('0x16')];}else{_0x5178b4['body']=_0x5810d0[_0xab68('0x23')];}if(_0x5178b4[_0xab68('0x22')]){_0x5178b4[_0xab68('0x22')]=_0x5178b4[_0xab68('0x22')][_0xab68('0x18')](/0x0){var _0x3767b2=[_0xab68('0x33'),'X-Auto-Response-Suppress:\x20All',_0xab68('0x34')];for(var _0x1433ac=0x0;_0x1433ac<_0x5810d0['headerLines']['length'];_0x1433ac++){var _0x5168d6=_[_0xab68('0xf')](_0x3767b2,_0x5810d0[_0xab68('0x32')][_0x1433ac][_0xab68('0x35')]);if(_0x5168d6>=0x0){_0x5178b4[_0xab68('0x36')]=!![];}}}return _0x5178b4;}exports[_0xab68('0x37')]=function(_0x5e7a08,_0x362443,_0x2ad994){var _0x1cc531={'from':getAddress(_0x362443[_0xab68('0x38')]),'firstName':getFirstName(_0x362443[_0xab68('0x38')]),'lastName':getLastName(_0x362443[_0xab68('0x38')]),'mapKey':_0xab68('0x6'),'message':{'from':getMails(_0x5e7a08[_0xab68('0x6')],_0x362443[_0xab68('0x38')]),'to':_0x5e7a08[_0xab68('0x6')],'cc':'','subject':_0x362443[_0xab68('0x39')]||'','messageId':_0x362443[_0xab68('0x3a')],'inReplyTo':_0x362443[_0xab68('0x3b')],'sentAt':moment(_0x362443[_0xab68('0x3c')])[_0xab68('0x2c')](_0xab68('0x3d')),'attach':![],'attachments':[]}};if(!_0x362443[_0xab68('0x16')]&&!_0x362443[_0xab68('0x23')]){var _0x2ed947=_['filter'](_0x362443['attachments'],{'contentType':_0xab68('0x3e')});if(_0x2ed947[_0xab68('0x11')]){logger[_0xab68('0x3f')](util[_0xab68('0x2c')](_0xab68('0x40'),_0x362443[_0xab68('0x3a')]));tnef['parseBuffer'](_[_0xab68('0x41')](_0x2ed947)[_0xab68('0x30')],function(_0x69cfe2,_0x376d7e){if(_0x376d7e){_0x362443['html']=_0x376d7e['BodyHTML']||_0xab68('0x42');if(_0x376d7e[_0xab68('0x43')]){for(var _0xeeeaa4=0x0;_0xeeeaa4<_0x376d7e['Attachments'][_0xab68('0x11')];_0xeeeaa4++){var _0x5ab0b9=_0x376d7e[_0xab68('0x43')][_0xeeeaa4];_0x1cc531['message'][_0xab68('0x1a')][_0xab68('0x1c')]({'filename':_0x5ab0b9[_0xab68('0x44')],'content':Buffer['from'](_0x5ab0b9[_0xab68('0x45')])});}}}_0x2ad994(parseEmail(_0x5e7a08,_0x362443,_0x1cc531));});}else{_0x362443['html']=_0xab68('0x42');_0x2ad994(parseEmail(_0x5e7a08,_0x362443,_0x1cc531));}}else{_0x2ad994(parseEmail(_0x5e7a08,_0x362443,_0x1cc531));}};exports[_0xab68('0x46')]=function(_0xa9c5df,_0x33b39c){var _0x36749e=[_0xab68('0x47')+(_0x33b39c||''),_0xab68('0x48')+_0xa9c5df,'',''];return Buffer[_0xab68('0x38')](_0x36749e['join'](''),_0xab68('0x49'))[_0xab68('0x4a')](_0xab68('0x4b'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index c5dc57f..0c7eb88 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 _0xaf21=['name','Service','key','SERV','active','Imap','Smtp','exports','lodash'];(function(_0x5a082b,_0x329dfd){var _0x55ca3b=function(_0xb9ec19){while(--_0xb9ec19){_0x5a082b['push'](_0x5a082b['shift']());}};_0x55ca3b(++_0x329dfd);}(_0xaf21,0x131));var _0x1af2=function(_0x304de6,_0x4e4cdc){_0x304de6=_0x304de6-0x0;var _0x5005cb=_0xaf21[_0x304de6];return _0x5005cb;};'use strict';var _=require(_0x1af2('0x0'));function MailAccount(_0x4c739f){this['id']=_0x4c739f['id']||0x0;this[_0x1af2('0x1')]=_0x4c739f[_0x1af2('0x1')]||_0x1af2('0x2');this[_0x1af2('0x3')]=_0x4c739f['key']||_0x1af2('0x4');this[_0x1af2('0x5')]=_0x4c739f[_0x1af2('0x5')]||![];this[_0x1af2('0x6')]=_0x4c739f['Imap']||[];this['Smtp']=_0x4c739f[_0x1af2('0x7')]||[];}module[_0x1af2('0x8')]=MailAccount; \ No newline at end of file +var _0xdaf5=['active','Imap','Smtp','exports','name','Service','key','SERV'];(function(_0x42c797,_0x165107){var _0x58c201=function(_0x5f43a3){while(--_0x5f43a3){_0x42c797['push'](_0x42c797['shift']());}};_0x58c201(++_0x165107);}(_0xdaf5,0x164));var _0x5daf=function(_0x46003f,_0x18a160){_0x46003f=_0x46003f-0x0;var _0x373521=_0xdaf5[_0x46003f];return _0x373521;};'use strict';var _=require('lodash');function MailAccount(_0x4b11be){this['id']=_0x4b11be['id']||0x0;this[_0x5daf('0x0')]=_0x4b11be['name']||_0x5daf('0x1');this[_0x5daf('0x2')]=_0x4b11be[_0x5daf('0x2')]||_0x5daf('0x3');this[_0x5daf('0x4')]=_0x4b11be['active']||![];this[_0x5daf('0x5')]=_0x4b11be[_0x5daf('0x5')]||[];this[_0x5daf('0x6')]=_0x4b11be[_0x5daf('0x6')]||[];}module[_0x5daf('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 7584df1..9f89c54 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 _0x951e=['mapKeys','hasOwnProperty','prototype','initMailAccounts','length','lodash','mailAccounts'];(function(_0x27296a,_0x409e08){var _0x51de68=function(_0x634cb6){while(--_0x634cb6){_0x27296a['push'](_0x27296a['shift']());}};_0x51de68(++_0x409e08);}(_0x951e,0x1cc));var _0xe951=function(_0x2d4811,_0x153cec){_0x2d4811=_0x2d4811-0x0;var _0x4c5ab6=_0x951e[_0x2d4811];return _0x4c5ab6;};'use strict';var _=require(_0xe951('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xe951('0x1')]={};};function freeIsNotKey(_0x494950,_0x190c16,_0x5df210){var _0x28b5f6=_[_0xe951('0x2')](_0x494950,function(_0x53d287,_0x40175c){return _0x53d287[_0x5df210];});for(var _0x307630 in _0x190c16){if(_0x190c16[_0xe951('0x3')](_0x307630)){if(!_0x28b5f6[_0x307630]){delete _0x190c16[_0x307630];}}}}Realtime[_0xe951('0x4')]['mergeFromDatabase']=function(_0x52e972,_0x37959e){for(var _0x43a50a in _0x37959e){if(_0x52e972[_0xe951('0x3')](_0x43a50a)){_0x52e972[_0x43a50a]=_0x37959e[_0x43a50a];}}};Realtime[_0xe951('0x4')][_0xe951('0x5')]=function(){var _0x4d1e66=this;return function(_0x5686c3){if(_0x5686c3){freeIsNotKey(_0x5686c3,_0x4d1e66[_0xe951('0x1')],'id');for(var _0x36005d=0x0,_0x5e43ff={},_0x41ebf2={};_0x36005d<_0x5686c3[_0xe951('0x6')];_0x36005d+=0x1){_0x5e43ff=_0x5686c3[_0x36005d];if(_['isUndefined'](_0x4d1e66[_0xe951('0x1')][_0x5e43ff['id']])){_0x4d1e66[_0xe951('0x1')][_0x5e43ff['id']]=new MailAccount(_0x5e43ff);}else{_['merge'](_0x4d1e66[_0xe951('0x1')][_0x5e43ff['id']],_0x5e43ff);}}}return _0x4d1e66[_0xe951('0x1')];};};module['exports']=Realtime; \ No newline at end of file +var _0xe1fd=['mailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mapKeys','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xe1fd,0x7e));var _0xde1f=function(_0x3e72bb,_0x24a0f2){_0x3e72bb=_0x3e72bb-0x0;var _0x1c89dd=_0xe1fd[_0x3e72bb];return _0x1c89dd;};'use strict';var _=require(_0xde1f('0x0'));var MailAccount=require(_0xde1f('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x3bd3a7,_0x41616e,_0x5ee7dc){var _0x2a3615=_[_0xde1f('0x2')](_0x3bd3a7,function(_0x3dc47f,_0x32a036){return _0x3dc47f[_0x5ee7dc];});for(var _0x344dea in _0x41616e){if(_0x41616e[_0xde1f('0x3')](_0x344dea)){if(!_0x2a3615[_0x344dea]){delete _0x41616e[_0x344dea];}}}}Realtime[_0xde1f('0x4')][_0xde1f('0x5')]=function(_0x596fce,_0x47d683){for(var _0x2380a9 in _0x47d683){if(_0x596fce['hasOwnProperty'](_0x2380a9)){_0x596fce[_0x2380a9]=_0x47d683[_0x2380a9];}}};Realtime[_0xde1f('0x4')]['initMailAccounts']=function(){var _0x10e252=this;return function(_0x201b07){if(_0x201b07){freeIsNotKey(_0x201b07,_0x10e252[_0xde1f('0x6')],'id');for(var _0x171fec=0x0,_0x32a527={},_0x55160f={};_0x171fec<_0x201b07[_0xde1f('0x7')];_0x171fec+=0x1){_0x32a527=_0x201b07[_0x171fec];if(_[_0xde1f('0x8')](_0x10e252[_0xde1f('0x6')][_0x32a527['id']])){_0x10e252[_0xde1f('0x6')][_0x32a527['id']]=new MailAccount(_0x32a527);}else{_[_0xde1f('0x9')](_0x10e252[_0xde1f('0x6')][_0x32a527['id']],_0x32a527);}}}return _0x10e252[_0xde1f('0x6')];};};module[_0xde1f('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 1e41516..2b1f9d3 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 _0xff4f=['../client','getMailAccounts','Request','provider','service','email','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','MailServerOut','Smtp','data5','notify','NotifyMailAccount'];(function(_0x4423f7,_0x37bf8e){var _0x185595=function(_0x20d730){while(--_0x20d730){_0x4423f7['push'](_0x4423f7['shift']());}};_0x185595(++_0x37bf8e);}(_0xff4f,0x156));var _0xfff4=function(_0x434764,_0xf45a0f){_0x434764=_0x434764-0x0;var _0x416967=_0xff4f[_0x434764];return _0x416967;};'use strict';var client=require(_0xfff4('0x0'));exports[_0xfff4('0x1')]=function(){return function(){return client[_0xfff4('0x2')]('GetMailAccount',{'options':{'attributes':['id','name',_0xfff4('0x3'),_0xfff4('0x4'),_0xfff4('0x5'),'active',_0xfff4('0x6'),_0xfff4('0x7'),_0xfff4('0x8')],'raw':![],'include':[{'model':_0xfff4('0x9'),'as':_0xfff4('0xa'),'include':[{'model':_0xfff4('0xb'),'attributes':['id','name',_0xfff4('0x4'),_0xfff4('0xc'),'data5'],'as':_0xfff4('0xb')}]},{'model':_0xfff4('0xd'),'as':_0xfff4('0xe'),'include':[{'model':_0xfff4('0xb'),'attributes':['id','name',_0xfff4('0x4'),_0xfff4('0xc'),_0xfff4('0xf')],'as':_0xfff4('0xb')}]}]},'log':'getMailAccount'});};};exports[_0xfff4('0x10')]=function(_0x53bd65,_0xff1cf){return client[_0xfff4('0x2')](_0xfff4('0x11'),{'account':{'id':_0x53bd65},'body':_0xff1cf,'log':_0xfff4('0x11')});}; \ No newline at end of file +var _0x6f7c=['type','data5','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service','email','key','ListId','TemplateId','CloudProvider','Smtp'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x6f7c,0x137));var _0xc6f7=function(_0x5f2d35,_0x20ebd9){_0x5f2d35=_0x5f2d35-0x0;var _0x4a08b3=_0x6f7c[_0x5f2d35];return _0x4a08b3;};'use strict';var client=require(_0xc6f7('0x0'));exports[_0xc6f7('0x1')]=function(){return function(){return client[_0xc6f7('0x2')](_0xc6f7('0x3'),{'options':{'attributes':['id',_0xc6f7('0x4'),_0xc6f7('0x5'),_0xc6f7('0x6'),_0xc6f7('0x7'),'active',_0xc6f7('0x8'),_0xc6f7('0x9'),_0xc6f7('0xa')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0xc6f7('0xb'),'attributes':['id','name',_0xc6f7('0x6'),'type','data5'],'as':_0xc6f7('0xb')}]},{'model':'MailServerOut','as':_0xc6f7('0xc'),'include':[{'model':_0xc6f7('0xb'),'attributes':['id',_0xc6f7('0x4'),_0xc6f7('0x6'),_0xc6f7('0xd'),_0xc6f7('0xe')],'as':_0xc6f7('0xb')}]}]},'log':_0xc6f7('0xf')});};};exports[_0xc6f7('0x10')]=function(_0x488805,_0x1572ae){return client['Request'](_0xc6f7('0x11'),{'account':{'id':_0x488805},'body':_0x1572ae,'log':_0xc6f7('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 1e14438..37e48a9 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 _0xd253=['../client','getSettings','ShowSetting','GetSettings'];(function(_0x491cc1,_0x5245f6){var _0x5d2cce=function(_0x26fcee){while(--_0x26fcee){_0x491cc1['push'](_0x491cc1['shift']());}};_0x5d2cce(++_0x5245f6);}(_0xd253,0xc0));var _0x3d25=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xd253[_0x3c4737];return _0x2bb926;};'use strict';var client=require(_0x3d25('0x0'));exports[_0x3d25('0x1')]=function(){return client['Request'](_0x3d25('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x3d25('0x3')});}; \ No newline at end of file +var _0x0533=['loginMailFrequency','../client','getSettings','Request'];(function(_0x432b47,_0x24d3b7){var _0xb74e85=function(_0x333c4f){while(--_0x333c4f){_0x432b47['push'](_0x432b47['shift']());}};_0xb74e85(++_0x24d3b7);}(_0x0533,0xd5));var _0x3053=function(_0x3a06dd,_0x3ecb49){_0x3a06dd=_0x3a06dd-0x0;var _0x468e1e=_0x0533[_0x3a06dd];return _0x468e1e;};'use strict';var client=require(_0x3053('0x0'));exports[_0x3053('0x1')]=function(){return client[_0x3053('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3053('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 8cc0516..2ca3d09 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 a8d7bfa..05c7095 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 _0x5b27=['express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','defaults','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x5b27,0x17e));var _0x75b2=function(_0x4dec9d,_0x39f463){_0x4dec9d=_0x4dec9d-0x0;var _0x29d07d=_0x5b27[_0x4dec9d];return _0x29d07d;};'use strict';var _=require(_0x75b2('0x0'));var http=require(_0x75b2('0x1'));var express=require(_0x75b2('0x2'));var sticky=require(_0x75b2('0x3'));var Redis=require(_0x75b2('0x4'));var config=require(_0x75b2('0x5'));var app=express();var server=http[_0x75b2('0x6')](app);server[_0x75b2('0x7')]=0xdbba0;if(sticky[_0x75b2('0x8')](server,config[_0x75b2('0x9')])){var socketio=require(_0x75b2('0xa'))(server,{'transports':[_0x75b2('0xb'),'polling']});config['redis']=_[_0x75b2('0xc')](config['redis'],{'host':_0x75b2('0xd'),'port':0x18eb});socketio[_0x75b2('0xe')](require(_0x75b2('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0x75b2('0x10'))['default']();require(_0x75b2('0x11'))[_0x75b2('0x12')](socketio);require(_0x75b2('0x13'))[_0x75b2('0x12')](app);require('../../routes')['default'](app);}else{server['once'](_0x75b2('0x14'),function(){console[_0x75b2('0x15')](_0x75b2('0x16'),config[_0x75b2('0x9')]);});}exports=module[_0x75b2('0x17')]=app; \ No newline at end of file +var _0x6eb9=['Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express','../../routes','once','log'];(function(_0x241ac7,_0x1c3ee7){var _0x489cb1=function(_0x19b3fc){while(--_0x19b3fc){_0x241ac7['push'](_0x241ac7['shift']());}};_0x489cb1(++_0x1c3ee7);}(_0x6eb9,0x169));var _0x96eb=function(_0x24942b,_0x4310e2){_0x24942b=_0x24942b-0x0;var _0x335545=_0x6eb9[_0x24942b];return _0x335545;};'use strict';var _=require(_0x96eb('0x0'));var http=require(_0x96eb('0x1'));var express=require(_0x96eb('0x2'));var sticky=require('sticky-session');var Redis=require(_0x96eb('0x3'));var config=require(_0x96eb('0x4'));var app=express();var server=http[_0x96eb('0x5')](app);server[_0x96eb('0x6')]=0xdbba0;if(sticky[_0x96eb('0x7')](server,config[_0x96eb('0x8')])){var socketio=require(_0x96eb('0x9'))(server,{'transports':[_0x96eb('0xa'),_0x96eb('0xb')]});config[_0x96eb('0xc')]=_[_0x96eb('0xd')](config[_0x96eb('0xc')],{'host':_0x96eb('0xe'),'port':0x18eb});socketio[_0x96eb('0xf')](require(_0x96eb('0x10'))({'pubClient':new Redis(config[_0x96eb('0xc')]),'subClient':new Redis(config['redis'])}));require(_0x96eb('0x11'))[_0x96eb('0x12')]();require('../../config/socketio')[_0x96eb('0x12')](socketio);require(_0x96eb('0x13'))[_0x96eb('0x12')](app);require(_0x96eb('0x14'))[_0x96eb('0x12')](app);}else{server[_0x96eb('0x15')]('listening',function(){console[_0x96eb('0x16')](_0x96eb('0x17'),config[_0x96eb('0x8')]);});}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 3ed8fd5..0a68cc9 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 _0x1451=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','debug','rpc','routing','error','message'];(function(_0x2af353,_0x418430){var _0x3f3f4e=function(_0x186bb5){while(--_0x186bb5){_0x2af353['push'](_0x2af353['shift']());}};_0x3f3f4e(++_0x418430);}(_0x1451,0x189));var _0x1145=function(_0x5cdf3c,_0x233f63){_0x5cdf3c=_0x5cdf3c-0x0;var _0x515b20=_0x1451[_0x5cdf3c];return _0x515b20;};'use strict';var jayson=require(_0x1145('0x0'));var BPromise=require(_0x1145('0x1'));var logger=require(_0x1145('0x2'))('routing');var client=jayson[_0x1145('0x3')][_0x1145('0x4')]({'port':0x2329});client[_0x1145('0x5')]=function(_0x24b587,_0x3af2e0){return new BPromise(function(_0xf0f7a,_0x8cc85){return client[_0x1145('0x6')](_0x24b587,_0x3af2e0)['then'](function(_0x14b610){logger[_0x1145('0x7')](_0x1145('0x8'),_0x1145('0x9'),_0x24b587,_0x3af2e0,_0x14b610);if(_0x14b610[_0x1145('0xa')]){logger[_0x1145('0xa')](_0x1145('0x8'),_0x1145('0x9'),_0x24b587,_0x14b610[_0x1145('0xa')][_0x1145('0xb')],_0x3af2e0);return _0x8cc85(_0x14b610[_0x1145('0xa')]['message']);}else{return _0xf0f7a(_0x14b610[_0x1145('0xc')]);}})[_0x1145('0xd')](function(_0x914165){logger['error'](_0x1145('0x8'),'routing',_0x24b587,_0x914165,_0x3af2e0);return _0x8cc85(_0x914165);});});};module[_0x1145('0xe')]=client; \ No newline at end of file +var _0xd657=['routing','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','rpc'];(function(_0x256153,_0x2e7fcc){var _0x4e26e0=function(_0x50d217){while(--_0x50d217){_0x256153['push'](_0x256153['shift']());}};_0x4e26e0(++_0x2e7fcc);}(_0xd657,0x155));var _0x7d65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd657[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x7d65('0x0'));var BPromise=require(_0x7d65('0x1'));var logger=require(_0x7d65('0x2'))('routing');var client=jayson[_0x7d65('0x3')][_0x7d65('0x4')]({'port':0x2329});client[_0x7d65('0x5')]=function(_0x5d8e4d,_0x28956a){return new BPromise(function(_0x17fa7b,_0x538b02){return client[_0x7d65('0x6')](_0x5d8e4d,_0x28956a)[_0x7d65('0x7')](function(_0x16ad7c){logger['debug'](_0x7d65('0x8'),_0x7d65('0x9'),_0x5d8e4d,_0x28956a,_0x16ad7c);if(_0x16ad7c[_0x7d65('0xa')]){logger[_0x7d65('0xa')](_0x7d65('0x8'),_0x7d65('0x9'),_0x5d8e4d,_0x16ad7c[_0x7d65('0xa')][_0x7d65('0xb')],_0x28956a);return _0x538b02(_0x16ad7c[_0x7d65('0xa')][_0x7d65('0xb')]);}else{return _0x17fa7b(_0x16ad7c['result']);}})[_0x7d65('0xc')](function(_0x22903e){logger['error'](_0x7d65('0x8'),_0x7d65('0x9'),_0x5d8e4d,_0x22903e,_0x28956a);return _0x538b02(_0x22903e);});});};module[_0x7d65('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 660c80b..476f91a 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 _0x9743=['initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getMailQueues','initMailQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then'];(function(_0x237f45,_0x45987a){var _0x268b78=function(_0x5a24b1){while(--_0x5a24b1){_0x237f45['push'](_0x237f45['shift']());}};_0x268b78(++_0x45987a);}(_0x9743,0x1bd));var _0x3974=function(_0x3e0b25,_0x4c80dd){_0x3e0b25=_0x3e0b25-0x0;var _0x578c64=_0x9743[_0x3e0b25];return _0x578c64;};'use strict';var BPromise=require(_0x3974('0x0'));var server=require(_0x3974('0x1'));var Realtime=require(_0x3974('0x2'));var user=require(_0x3974('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x3974('0x4'));var smsQueue=require(_0x3974('0x5'));var mailQueue=require(_0x3974('0x6'));var faxQueue=require(_0x3974('0x7'));var whatsappQueue=require(_0x3974('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x3974('0x9')]()['then'](user['getAgents']())[_0x3974('0xa')](realtime[_0x3974('0xb')]())['then'](interval[_0x3974('0xc')]())[_0x3974('0xa')](realtime['initIntervals']())[_0x3974('0xa')](openchannelQueue[_0x3974('0xd')]())['then'](realtime[_0x3974('0xe')]())['then'](chatQueue[_0x3974('0xf')]())[_0x3974('0xa')](realtime[_0x3974('0x10')]())[_0x3974('0xa')](smsQueue['getSmsQueues']())[_0x3974('0xa')](realtime['initSmsQueues']())[_0x3974('0xa')](mailQueue[_0x3974('0x11')]())['then'](realtime[_0x3974('0x12')]())['then'](faxQueue['getFaxQueues']())['then'](realtime['initFaxQueues']())['then'](whatsappQueue[_0x3974('0x13')]())[_0x3974('0xa')](realtime[_0x3974('0x14')]())['then'](function(){return realtime;});}function main(){return server[_0x3974('0x15')](realtime)[_0x3974('0xa')](function(_0x25810d){return initRealtime();})[_0x3974('0xa')](function(_0x3f4eff){return setInterval(initRealtime,0x1388);})[_0x3974('0x16')](function(_0x49286d){console[_0x3974('0x17')](_0x49286d);});}main(); \ No newline at end of file +var _0x21ed=['./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','initIntervals','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue'];(function(_0x107e87,_0x20293b){var _0x267b1a=function(_0x34139e){while(--_0x34139e){_0x107e87['push'](_0x107e87['shift']());}};_0x267b1a(++_0x20293b);}(_0x21ed,0x1a2));var _0xd21e=function(_0x55bae4,_0x687d51){_0x55bae4=_0x55bae4-0x0;var _0x17d99e=_0x21ed[_0x55bae4];return _0x17d99e;};'use strict';var BPromise=require(_0xd21e('0x0'));var server=require('./server');var Realtime=require(_0xd21e('0x1'));var user=require('./rpc/user');var interval=require(_0xd21e('0x2'));var openchannelQueue=require(_0xd21e('0x3'));var chatQueue=require(_0xd21e('0x4'));var smsQueue=require(_0xd21e('0x5'));var mailQueue=require(_0xd21e('0x6'));var faxQueue=require(_0xd21e('0x7'));var whatsappQueue=require(_0xd21e('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xd21e('0x9')](user[_0xd21e('0xa')]())[_0xd21e('0x9')](realtime[_0xd21e('0xb')]())[_0xd21e('0x9')](interval[_0xd21e('0xc')]())[_0xd21e('0x9')](realtime[_0xd21e('0xd')]())[_0xd21e('0x9')](openchannelQueue['getOpenchannelQueues']())[_0xd21e('0x9')](realtime['initOpenchannelQueues']())[_0xd21e('0x9')](chatQueue[_0xd21e('0xe')]())['then'](realtime[_0xd21e('0xf')]())[_0xd21e('0x9')](smsQueue[_0xd21e('0x10')]())[_0xd21e('0x9')](realtime[_0xd21e('0x11')]())[_0xd21e('0x9')](mailQueue['getMailQueues']())['then'](realtime['initMailQueues']())['then'](faxQueue[_0xd21e('0x12')]())[_0xd21e('0x9')](realtime[_0xd21e('0x13')]())[_0xd21e('0x9')](whatsappQueue[_0xd21e('0x14')]())[_0xd21e('0x9')](realtime[_0xd21e('0x15')]())[_0xd21e('0x9')](function(){return realtime;});}function main(){return server[_0xd21e('0x16')](realtime)[_0xd21e('0x9')](function(_0xe7e844){return initRealtime();})[_0xd21e('0x9')](function(_0xa10ffc){return setInterval(initRealtime,0x1388);})[_0xd21e('0x17')](function(_0xe4f482){console[_0xd21e('0x18')](_0xe4f482);});}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 259d5ea..5266b73 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0xa5e821,_0x4dd2f6){var _0x62d0cd=function(_0x119f86){while(--_0x119f86){_0xa5e821['push'](_0xa5e821['shift']());}};_0x62d0cd(++_0x4dd2f6);}(_0x326f,0xd1));var _0xf326=function(_0x264338,_0x1a2343){_0x264338=_0x264338-0x0;var _0xbdd1c1=_0x326f[_0x264338];return _0xbdd1c1;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x132844,_0x98bc49){_0x132844=_0x132844-0x0;var _0x13c26f=_0x1261[_0x132844];return _0x13c26f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 4db0383..12c4329 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 _0x14a9=['jayson/promise','client','http','request','error','message','catch','sendMailMessage','SendMail'];(function(_0x25f7d9,_0x56c8f7){var _0x48f1d1=function(_0x447d99){while(--_0x447d99){_0x25f7d9['push'](_0x25f7d9['shift']());}};_0x48f1d1(++_0x56c8f7);}(_0x14a9,0x1c2));var _0x914a=function(_0x40bf27,_0x103e47){_0x40bf27=_0x40bf27-0x0;var _0x3356b2=_0x14a9[_0x40bf27];return _0x3356b2;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x914a('0x0'));var client=jayson[_0x914a('0x1')][_0x914a('0x2')]({'port':0x232b});function request(_0xfaafb5,_0xc20946){return new BPromise(function(_0x4dc683,_0x523946){return client[_0x914a('0x3')](_0xfaafb5,_0xc20946)['then'](function(_0x5b04b5){if(_0x5b04b5['error']){return _0x523946(_0x5b04b5[_0x914a('0x4')][_0x914a('0x5')]);}else{return _0x4dc683(_0x5b04b5['result']);}})[_0x914a('0x6')](function(_0x54692e){return _0x523946(_0x54692e);});});}exports[_0x914a('0x7')]=function(_0x26e210,_0x5db13d){return request(_0x914a('0x8'),{'account':_0x26e210,'message':_0x5db13d});}; \ No newline at end of file +var _0x4a70=['jayson/promise','client','http','then','error','message','result','catch','sendMailMessage','SendMail'];(function(_0x7cb10c,_0x2fcc3a){var _0x11df59=function(_0x75305f){while(--_0x75305f){_0x7cb10c['push'](_0x7cb10c['shift']());}};_0x11df59(++_0x2fcc3a);}(_0x4a70,0x15e));var _0x04a7=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0x4a70[_0x4b6778];return _0x22dbb9;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x04a7('0x0'));var client=jayson[_0x04a7('0x1')][_0x04a7('0x2')]({'port':0x232b});function request(_0x1eda33,_0x401330){return new BPromise(function(_0x32d8ce,_0x124084){return client['request'](_0x1eda33,_0x401330)[_0x04a7('0x3')](function(_0x15357a){if(_0x15357a[_0x04a7('0x4')]){return _0x124084(_0x15357a[_0x04a7('0x4')][_0x04a7('0x5')]);}else{return _0x32d8ce(_0x15357a[_0x04a7('0x6')]);}})[_0x04a7('0x7')](function(_0x2e1c90){return _0x124084(_0x2e1c90);});});}exports[_0x04a7('0x8')]=function(_0x323be7,_0x24046f){return request(_0x04a7('0x9'),{'account':_0x323be7,'message':_0x24046f});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 4ef2ca3..a797428 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 _0xffd6=['idle','mail','openchannel','fax','length','StatusTime','format','Status','chatStatusTime','chatCurrentCapacity','faxStatus','faxStatusTime','smsStatus','whatsappCurrentCapacity','openchannelStatus','busy','busyQueue','faxWaitingInteractions','whatsappWaitingInteractions','stringify','user:routing:update','omit','exports','lodash','md5','moment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity'];(function(_0x1be814,_0x335f53){var _0x1dd874=function(_0x4383aa){while(--_0x4383aa){_0x1be814['push'](_0x1be814['shift']());}};_0x1dd874(++_0x335f53);}(_0xffd6,0x97));var _0x6ffd=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xffd6[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x6ffd('0x0'));var md5=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x6ffd('0x3')]=_[_0x6ffd('0x4')](config[_0x6ffd('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x6ffd('0x5'))(new Redis(config[_0x6ffd('0x3')]));function Agent(_0x3b8a46){this['id']=_0x3b8a46['id']||0x0;this[_0x6ffd('0x6')]=_0x3b8a46['name']||'';this[_0x6ffd('0x7')]=_0x3b8a46[_0x6ffd('0x7')]||!![];this[_0x6ffd('0x8')]=_0x3b8a46[_0x6ffd('0x8')]||![];this[_0x6ffd('0x9')]=_0x3b8a46['chatPause']||![];this[_0x6ffd('0xa')]=_0x3b8a46[_0x6ffd('0xa')]||![];this['faxPause']=_0x3b8a46[_0x6ffd('0xb')]||![];this[_0x6ffd('0xc')]=_0x3b8a46[_0x6ffd('0xc')]||![];this[_0x6ffd('0xd')]=_0x3b8a46[_0x6ffd('0xd')]||![];this[_0x6ffd('0xe')]=_0x6ffd('0xf');this['chatStatusTime']=0x0;this[_0x6ffd('0x10')]=_0x3b8a46[_0x6ffd('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x6ffd('0x11')]=_0x6ffd('0xf');this[_0x6ffd('0x12')]=0x0;this[_0x6ffd('0x13')]=_0x3b8a46['mailCapacity']||0x0;this[_0x6ffd('0x14')]=0x0;this['faxStatus']=_0x6ffd('0xf');this['faxStatusTime']=0x0;this[_0x6ffd('0x15')]=_0x3b8a46[_0x6ffd('0x15')]||0x0;this[_0x6ffd('0x16')]=0x0;this['smsStatus']=_0x6ffd('0xf');this[_0x6ffd('0x17')]=0x0;this[_0x6ffd('0x18')]=_0x3b8a46[_0x6ffd('0x18')]||0x0;this[_0x6ffd('0x19')]=0x0;this[_0x6ffd('0x1a')]=_0x6ffd('0xf');this[_0x6ffd('0x1b')]=0x0;this['whatsappCapacity']=_0x3b8a46[_0x6ffd('0x1c')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x6ffd('0xf');this[_0x6ffd('0x1d')]=0x0;this['openchannelCapacity']=_0x3b8a46[_0x6ffd('0x1e')]||0x0;this[_0x6ffd('0x1f')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x6ffd('0x1')]='';this[_0x6ffd('0x20')]={};this['faxWaitingInteractions']={};this[_0x6ffd('0x21')]={};this[_0x6ffd('0x22')]={};this[_0x6ffd('0x23')]={};this['whatsappWaitingInteractions']={};this[_0x6ffd('0x24')]();}Agent[_0x6ffd('0x25')]['getChannelStatus']=function(_0x356c9c){if(this[_0x356c9c+_0x6ffd('0x26')]>0x0){if(this[_0x356c9c+'Capacity']>0x0&&this[_0x356c9c+_0x6ffd('0x26')]>=this[_0x356c9c+_0x6ffd('0x27')]){return _0x6ffd('0x28');}else{return'working';}}else{return _0x6ffd('0x29');}};Agent[_0x6ffd('0x25')][_0x6ffd('0x24')]=function(){var _0x4ae7ac=[_0x6ffd('0x2a'),'chat',_0x6ffd('0x2b'),_0x6ffd('0x2c'),'sms','whatsapp'];for(var _0x252201=0x0;_0x252201<_0x4ae7ac[_0x6ffd('0x2d')];_0x252201+=0x1){var _0x1934d4=this['getChannelStatus'](_0x4ae7ac[_0x252201]);if(this[_0x4ae7ac[_0x252201]+'Status']!==_0x1934d4){this[_0x4ae7ac[_0x252201]+_0x6ffd('0x2e')]=_['toNumber'](moment()[_0x6ffd('0x2f')]('x'));}this[_0x4ae7ac[_0x252201]+_0x6ffd('0x30')]=_0x1934d4;}var _0x51fdb6={'id':this['id'],'name':this[_0x6ffd('0x6')],'online':this[_0x6ffd('0x7')],'voicePause':this[_0x6ffd('0x8')],'chatPause':this[_0x6ffd('0x9')],'mailPause':this[_0x6ffd('0xa')],'smsPause':this[_0x6ffd('0xc')],'faxPause':this[_0x6ffd('0xb')],'openchannelPause':this[_0x6ffd('0xd')],'chatStatus':this[_0x6ffd('0xe')],'chatStatusTime':this[_0x6ffd('0x31')],'chatCapacity':this[_0x6ffd('0x10')],'chatCurrentCapacity':this[_0x6ffd('0x32')],'mailStatus':this[_0x6ffd('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x6ffd('0x33')],'faxStatusTime':this[_0x6ffd('0x34')],'faxCapacity':this[_0x6ffd('0x15')],'faxCurrentCapacity':this[_0x6ffd('0x16')],'smsStatus':this[_0x6ffd('0x35')],'smsStatusTime':this[_0x6ffd('0x17')],'smsCapacity':this[_0x6ffd('0x18')],'smsCurrentCapacity':this[_0x6ffd('0x19')],'whatsappStatus':this[_0x6ffd('0x1a')],'whatsappStatusTime':this[_0x6ffd('0x1b')],'whatsappCapacity':this[_0x6ffd('0x1c')],'whatsappCurrentCapacity':this[_0x6ffd('0x36')],'openchannelStatus':this[_0x6ffd('0x37')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x6ffd('0x1e')],'openchannelCurrentCapacity':this[_0x6ffd('0x1f')],'busy':this[_0x6ffd('0x38')],'busyQueue':this[_0x6ffd('0x39')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x6ffd('0x3a')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x6ffd('0x23')],'whatsappWaitingInteractions':this[_0x6ffd('0x3b')]};var _0x25bc7c=md5(JSON[_0x6ffd('0x3c')](_0x51fdb6));if(this['md5']!==_0x25bc7c){this[_0x6ffd('0x1')]=_0x25bc7c;io['emit'](_0x6ffd('0x3d'),_[_0x6ffd('0x3e')](_0x51fdb6,[_0x6ffd('0x7')]));}};module[_0x6ffd('0x3f')]=Agent; \ No newline at end of file +var _0x1a85=['whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','chatWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','CurrentCapacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','format','faxStatusTime','whatsappStatus','openchannelWaitingInteractions','stringify','emit','user:routing:update','omit','moment','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x1a85,0x178));var _0x51a8=function(_0x5e11ff,_0x247853){_0x5e11ff=_0x5e11ff-0x0;var _0x38498e=_0x1a85[_0x5e11ff];return _0x38498e;};'use strict';var _=require('lodash');var md5=require('md5');var moment=require(_0x51a8('0x0'));var Redis=require(_0x51a8('0x1'));var config=require(_0x51a8('0x2'));config['redis']=_['defaults'](config[_0x51a8('0x3')],{'host':_0x51a8('0x4'),'port':0x18eb});var io=require(_0x51a8('0x5'))(new Redis(config['redis']));function Agent(_0xaac0bf){this['id']=_0xaac0bf['id']||0x0;this['name']=_0xaac0bf[_0x51a8('0x6')]||'';this['online']=_0xaac0bf[_0x51a8('0x7')]||!![];this[_0x51a8('0x8')]=_0xaac0bf['voicePause']||![];this[_0x51a8('0x9')]=_0xaac0bf['chatPause']||![];this['mailPause']=_0xaac0bf[_0x51a8('0xa')]||![];this[_0x51a8('0xb')]=_0xaac0bf[_0x51a8('0xb')]||![];this[_0x51a8('0xc')]=_0xaac0bf[_0x51a8('0xc')]||![];this[_0x51a8('0xd')]=_0xaac0bf[_0x51a8('0xd')]||![];this[_0x51a8('0xe')]=_0x51a8('0xf');this[_0x51a8('0x10')]=0x0;this[_0x51a8('0x11')]=_0xaac0bf[_0x51a8('0x11')]||0x0;this[_0x51a8('0x12')]=0x0;this[_0x51a8('0x13')]=_0x51a8('0xf');this[_0x51a8('0x14')]=0x0;this[_0x51a8('0x15')]=_0xaac0bf['mailCapacity']||0x0;this[_0x51a8('0x16')]=0x0;this[_0x51a8('0x17')]=_0x51a8('0xf');this['faxStatusTime']=0x0;this[_0x51a8('0x18')]=_0xaac0bf['faxCapacity']||0x0;this[_0x51a8('0x19')]=0x0;this[_0x51a8('0x1a')]=_0x51a8('0xf');this[_0x51a8('0x1b')]=0x0;this[_0x51a8('0x1c')]=_0xaac0bf[_0x51a8('0x1c')]||0x0;this[_0x51a8('0x1d')]=0x0;this['whatsappStatus']=_0x51a8('0xf');this[_0x51a8('0x1e')]=0x0;this[_0x51a8('0x1f')]=_0xaac0bf[_0x51a8('0x1f')]||0x0;this[_0x51a8('0x20')]=0x0;this[_0x51a8('0x21')]='unknown';this[_0x51a8('0x22')]=0x0;this[_0x51a8('0x23')]=_0xaac0bf[_0x51a8('0x23')]||0x0;this[_0x51a8('0x24')]=0x0;this[_0x51a8('0x25')]=![];this[_0x51a8('0x26')]=undefined;this[_0x51a8('0x27')]='';this[_0x51a8('0x28')]={};this['faxWaitingInteractions']={};this[_0x51a8('0x29')]={};this['openchannelWaitingInteractions']={};this[_0x51a8('0x2a')]={};this[_0x51a8('0x2b')]={};this[_0x51a8('0x2c')]();}Agent[_0x51a8('0x2d')]['getChannelStatus']=function(_0xae3588){if(this[_0xae3588+'CurrentCapacity']>0x0){if(this[_0xae3588+'Capacity']>0x0&&this[_0xae3588+_0x51a8('0x2e')]>=this[_0xae3588+'Capacity']){return _0x51a8('0x2f');}else{return _0x51a8('0x30');}}else{return _0x51a8('0x31');}};Agent[_0x51a8('0x2d')][_0x51a8('0x2c')]=function(){var _0x2f2f05=[_0x51a8('0x32'),_0x51a8('0x33'),'openchannel',_0x51a8('0x34'),_0x51a8('0x35'),_0x51a8('0x36')];for(var _0x3da187=0x0;_0x3da187<_0x2f2f05[_0x51a8('0x37')];_0x3da187+=0x1){var _0x11aefc=this[_0x51a8('0x38')](_0x2f2f05[_0x3da187]);if(this[_0x2f2f05[_0x3da187]+_0x51a8('0x39')]!==_0x11aefc){this[_0x2f2f05[_0x3da187]+_0x51a8('0x3a')]=_[_0x51a8('0x3b')](moment()[_0x51a8('0x3c')]('x'));}this[_0x2f2f05[_0x3da187]+_0x51a8('0x39')]=_0x11aefc;}var _0x4a1548={'id':this['id'],'name':this[_0x51a8('0x6')],'online':this['online'],'voicePause':this[_0x51a8('0x8')],'chatPause':this[_0x51a8('0x9')],'mailPause':this[_0x51a8('0xa')],'smsPause':this[_0x51a8('0xc')],'faxPause':this[_0x51a8('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x51a8('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x51a8('0x11')],'chatCurrentCapacity':this[_0x51a8('0x12')],'mailStatus':this[_0x51a8('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x51a8('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x51a8('0x17')],'faxStatusTime':this[_0x51a8('0x3d')],'faxCapacity':this[_0x51a8('0x18')],'faxCurrentCapacity':this[_0x51a8('0x19')],'smsStatus':this[_0x51a8('0x1a')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x51a8('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x51a8('0x3e')],'whatsappStatusTime':this[_0x51a8('0x1e')],'whatsappCapacity':this[_0x51a8('0x1f')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x51a8('0x21')],'openchannelStatusTime':this[_0x51a8('0x22')],'openchannelCapacity':this[_0x51a8('0x23')],'openchannelCurrentCapacity':this[_0x51a8('0x24')],'busy':this[_0x51a8('0x25')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x51a8('0x29')],'openchannelWaitingInteractions':this[_0x51a8('0x3f')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0x51a8('0x2b')]};var _0x4ec0ac=md5(JSON[_0x51a8('0x40')](_0x4a1548));if(this[_0x51a8('0x27')]!==_0x4ec0ac){this[_0x51a8('0x27')]=_0x4ec0ac;io[_0x51a8('0x41')](_0x51a8('0x42'),_[_0x51a8('0x43')](_0x4a1548,['online']));}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 232dd04..81a6b82 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 _0xa3a2=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','chatPause','paused','available','format','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x567bcb,_0x4978c1){var _0x4eebc2=function(_0x42a456){while(--_0x42a456){_0x567bcb['push'](_0x567bcb['shift']());}};_0x4eebc2(++_0x4978c1);}(_0xa3a2,0x17e));var _0x2a3a=function(_0x5e75ef,_0x4ce765){_0x5e75ef=_0x5e75ef-0x0;var _0x3c28b2=_0xa3a2[_0x5e75ef];return _0x3c28b2;};'use strict';var _=require(_0x2a3a('0x0'));var md5=require(_0x2a3a('0x1'));var util=require(_0x2a3a('0x2'));var Redis=require('ioredis');var config=require(_0x2a3a('0x3'));config[_0x2a3a('0x4')]=_[_0x2a3a('0x5')](config[_0x2a3a('0x4')],{'host':_0x2a3a('0x6'),'port':0x18eb});var io=require(_0x2a3a('0x7'))(new Redis(config['redis']));function ChatQueue(_0xccaeba){this['id']=_0xccaeba['id']||0x0;this[_0x2a3a('0x8')]=_0xccaeba[_0x2a3a('0x8')]||'';this[_0x2a3a('0x9')]=_0xccaeba[_0x2a3a('0x9')]||0xa;this['strategy']=_0xccaeba[_0x2a3a('0xa')]||_0x2a3a('0xb');this['Agents']=_0xccaeba[_0x2a3a('0xc')];this[_0x2a3a('0xd')]={};this[_0x2a3a('0xe')]=0x0;this[_0x2a3a('0x1')]='';this[_0x2a3a('0xf')]();this[_0x2a3a('0x10')]();}ChatQueue[_0x2a3a('0x11')][_0x2a3a('0xf')]=function(){var _0x11d3cc=this[_0x2a3a('0xd')][_0x2a3a('0x12')];this[_0x2a3a('0xd')]=_[_0x2a3a('0x13')](this['Agents'],'id');this[_0x2a3a('0xd')][_0x2a3a('0x12')]=_0x11d3cc;};ChatQueue[_0x2a3a('0x11')][_0x2a3a('0x10')]=function(){this[_0x2a3a('0x14')]=0x0;this['paused']=0x0;for(var _0x32cf39=0x0;_0x32cf39=0x0?this[_0x2a3a('0x19')]:0x0;var _0x51d73b={'id':this['id'],'available':this[_0x2a3a('0x19')],'loggedIn':this['loggedIn'],'name':this[_0x2a3a('0x8')],'paused':this[_0x2a3a('0x18')],'waiting':this['waiting']};var _0x197df1=md5(JSON['stringify'](_0x51d73b));if(this['md5']!==_0x197df1){this[_0x2a3a('0x1')]=_0x197df1;io['to'](util[_0x2a3a('0x1a')](_0x2a3a('0x1b'),_0x51d73b[_0x2a3a('0x8')]))['emit'](_0x2a3a('0x1c'),_0x51d73b);}};module[_0x2a3a('0x1d')]=ChatQueue; \ No newline at end of file +var _0xc607=['updateRouting','prototype','mapAgentsId','_rr','map','updateRealtime','loggedIn','length','chatPause','available','stringify','chat:queue:%s','emit','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','name','timeout','beepall','Agents','waiting'];(function(_0x47df54,_0x1aeb61){var _0x261b87=function(_0x54bc77){while(--_0x54bc77){_0x47df54['push'](_0x47df54['shift']());}};_0x261b87(++_0x1aeb61);}(_0xc607,0x12c));var _0x7c60=function(_0x410815,_0x286831){_0x410815=_0x410815-0x0;var _0x19aa2f=_0xc607[_0x410815];return _0x19aa2f;};'use strict';var _=require(_0x7c60('0x0'));var md5=require(_0x7c60('0x1'));var util=require(_0x7c60('0x2'));var Redis=require(_0x7c60('0x3'));var config=require(_0x7c60('0x4'));config[_0x7c60('0x5')]=_[_0x7c60('0x6')](config[_0x7c60('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7c60('0x5')]));function ChatQueue(_0x4c6610){this['id']=_0x4c6610['id']||0x0;this[_0x7c60('0x7')]=_0x4c6610[_0x7c60('0x7')]||'';this[_0x7c60('0x8')]=_0x4c6610[_0x7c60('0x8')]||0xa;this['strategy']=_0x4c6610['strategy']||_0x7c60('0x9');this[_0x7c60('0xa')]=_0x4c6610[_0x7c60('0xa')];this['mapAgentsId']={};this[_0x7c60('0xb')]=0x0;this[_0x7c60('0x1')]='';this[_0x7c60('0xc')]();this['updateRealtime']();}ChatQueue[_0x7c60('0xd')][_0x7c60('0xc')]=function(){var _0x18502f=this[_0x7c60('0xe')][_0x7c60('0xf')];this[_0x7c60('0xe')]=_[_0x7c60('0x10')](this[_0x7c60('0xa')],'id');this['mapAgentsId'][_0x7c60('0xf')]=_0x18502f;};ChatQueue[_0x7c60('0xd')][_0x7c60('0x11')]=function(){this[_0x7c60('0x12')]=0x0;this['paused']=0x0;for(var _0x577e63=0x0;_0x577e63=0x0?this[_0x7c60('0x15')]:0x0;var _0x104d78={'id':this['id'],'available':this[_0x7c60('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x7c60('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x2f5f8c=md5(JSON[_0x7c60('0x16')](_0x104d78));if(this['md5']!==_0x2f5f8c){this['md5']=_0x2f5f8c;io['to'](util['format'](_0x7c60('0x17'),_0x104d78['name']))[_0x7c60('0x18')](_0x7c60('0x19'),_0x104d78);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index c0f6f59..da2efd2 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 _0x6e0e=['format','fax:queue:%s','fax_queue:save','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','faxPause','available','waiting','stringify'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x6e0e,0x17d));var _0xe6e0=function(_0x20c3da,_0x2a3ccb){_0x20c3da=_0x20c3da-0x0;var _0x2f9931=_0x6e0e[_0x20c3da];return _0x2f9931;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xe6e0('0x0'));var Redis=require(_0xe6e0('0x1'));var config=require('../../../config/environment');config[_0xe6e0('0x2')]=_['defaults'](config[_0xe6e0('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xe6e0('0x3'))(new Redis(config[_0xe6e0('0x2')]));function FaxQueue(_0x34d941){this['id']=_0x34d941['id']||0x0;this['name']=_0x34d941[_0xe6e0('0x4')]||'';this[_0xe6e0('0x5')]=_0x34d941[_0xe6e0('0x5')]||0xa;this[_0xe6e0('0x6')]=_0x34d941[_0xe6e0('0x6')]||_0xe6e0('0x7');this[_0xe6e0('0x8')]=_0x34d941[_0xe6e0('0x8')];this[_0xe6e0('0x9')]={};this['waiting']=0x0;this[_0xe6e0('0xa')]='';this[_0xe6e0('0xb')]();this['updateRealtime']();}FaxQueue[_0xe6e0('0xc')][_0xe6e0('0xb')]=function(){var _0x1011c5=this[_0xe6e0('0x9')]['_rr'];this['mapAgentsId']=_[_0xe6e0('0xd')](this[_0xe6e0('0x8')],'id');this[_0xe6e0('0x9')][_0xe6e0('0xe')]=_0x1011c5;};FaxQueue[_0xe6e0('0xc')][_0xe6e0('0xf')]=function(){this[_0xe6e0('0x10')]=0x0;this[_0xe6e0('0x11')]=0x0;for(var _0x3ba52a=0x0;_0x3ba52a=0x0?this[_0xe6e0('0x15')]:0x0;var _0x5b344a={'id':this['id'],'available':this[_0xe6e0('0x15')],'loggedIn':this[_0xe6e0('0x10')],'name':this[_0xe6e0('0x4')],'paused':this[_0xe6e0('0x11')],'waiting':this[_0xe6e0('0x16')]};var _0xc29406=md5(JSON[_0xe6e0('0x17')](_0x5b344a));if(this[_0xe6e0('0xa')]!==_0xc29406){this[_0xe6e0('0xa')]=_0xc29406;io['to'](util[_0xe6e0('0x18')](_0xe6e0('0x19'),_0x5b344a['name']))['emit'](_0xe6e0('0x1a'),_0x5b344a);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x642f=['timeout','strategy','beepall','mapAgentsId','waiting','md5','updateRouting','_rr','Agents','updateRealtime','paused','length','online','loggedIn','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','socket.io-emitter','name'];(function(_0x55472d,_0x13b1fc){var _0x48f7b5=function(_0x243acb){while(--_0x243acb){_0x55472d['push'](_0x55472d['shift']());}};_0x48f7b5(++_0x13b1fc);}(_0x642f,0x6d));var _0xf642=function(_0xa717c,_0x4e248c){_0xa717c=_0xa717c-0x0;var _0x40f249=_0x642f[_0xa717c];return _0x40f249;};'use strict';var _=require(_0xf642('0x0'));var md5=require('md5');var util=require(_0xf642('0x1'));var Redis=require('ioredis');var config=require(_0xf642('0x2'));config[_0xf642('0x3')]=_[_0xf642('0x4')](config[_0xf642('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xf642('0x5'))(new Redis(config[_0xf642('0x3')]));function FaxQueue(_0x2af936){this['id']=_0x2af936['id']||0x0;this[_0xf642('0x6')]=_0x2af936['name']||'';this[_0xf642('0x7')]=_0x2af936['timeout']||0xa;this[_0xf642('0x8')]=_0x2af936[_0xf642('0x8')]||_0xf642('0x9');this['Agents']=_0x2af936['Agents'];this[_0xf642('0xa')]={};this[_0xf642('0xb')]=0x0;this[_0xf642('0xc')]='';this[_0xf642('0xd')]();this['updateRealtime']();}FaxQueue['prototype'][_0xf642('0xd')]=function(){var _0x3bd70b=this['mapAgentsId'][_0xf642('0xe')];this[_0xf642('0xa')]=_['map'](this[_0xf642('0xf')],'id');this[_0xf642('0xa')][_0xf642('0xe')]=_0x3bd70b;};FaxQueue['prototype'][_0xf642('0x10')]=function(){this['loggedIn']=0x0;this[_0xf642('0x11')]=0x0;for(var _0xbc7613=0x0;_0xbc7613=0x0?this['available']:0x0;var _0x5ce91e={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf642('0x14')],'name':this[_0xf642('0x6')],'paused':this['paused'],'waiting':this[_0xf642('0xb')]};var _0x29ec58=md5(JSON[_0xf642('0x17')](_0x5ce91e));if(this[_0xf642('0xc')]!==_0x29ec58){this[_0xf642('0xc')]=_0x29ec58;io['to'](util[_0xf642('0x18')](_0xf642('0x19'),_0x5ce91e[_0xf642('0x6')]))[_0xf642('0x1a')](_0xf642('0x1b'),_0x5ce91e);}};module[_0xf642('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index ecc5edf..31f567c 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 _0x9413=['Intervals'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x9413,0xd1));var _0x3941=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0x9413[_0x5a99db];return _0x3aad62;};'use strict';function Interval(_0x377c01){this['id']=_0x377c01['id']||0x0;this['name']=_0x377c01['name']||'';this[_0x3941('0x0')]=_0x377c01[_0x3941('0x0')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x891e=['Intervals','exports','name'];(function(_0x113ad0,_0x2b86ef){var _0xa44f98=function(_0x30c5b5){while(--_0x30c5b5){_0x113ad0['push'](_0x113ad0['shift']());}};_0xa44f98(++_0x2b86ef);}(_0x891e,0xaa));var _0xe891=function(_0x109dbd,_0x290d2b){_0x109dbd=_0x109dbd-0x0;var _0x395644=_0x891e[_0x109dbd];return _0x395644;};'use strict';function Interval(_0x3bc205){this['id']=_0x3bc205['id']||0x0;this[_0xe891('0x0')]=_0x3bc205[_0xe891('0x0')]||'';this[_0xe891('0x1')]=_0x3bc205['Intervals']||{};}module[_0xe891('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 be98025..34f622d 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 _0x05a8=['_rr','map','online','loggedIn','paused','available','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype'];(function(_0x5bae91,_0x33da54){var _0x37547a=function(_0x4dcb73){while(--_0x4dcb73){_0x5bae91['push'](_0x5bae91['shift']());}};_0x37547a(++_0x33da54);}(_0x05a8,0x1c5));var _0x805a=function(_0x1dbd9b,_0x2da08e){_0x1dbd9b=_0x1dbd9b-0x0;var _0x1c1387=_0x05a8[_0x1dbd9b];return _0x1c1387;};'use strict';var _=require(_0x805a('0x0'));var md5=require('md5');var util=require(_0x805a('0x1'));var Redis=require('ioredis');var config=require(_0x805a('0x2'));config[_0x805a('0x3')]=_[_0x805a('0x4')](config[_0x805a('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x805a('0x5'))(new Redis(config[_0x805a('0x3')]));function MailQueue(_0x59c060){this['id']=_0x59c060['id']||0x0;this[_0x805a('0x6')]=_0x59c060['name']||'';this[_0x805a('0x7')]=_0x59c060[_0x805a('0x7')]||0xa;this['strategy']=_0x59c060['strategy']||'beepall';this['Agents']=_0x59c060[_0x805a('0x8')];this[_0x805a('0x9')]={};this[_0x805a('0xa')]=0x0;this[_0x805a('0xb')]='';this[_0x805a('0xc')]();this[_0x805a('0xd')]();}MailQueue[_0x805a('0xe')][_0x805a('0xc')]=function(){var _0x5a7582=this[_0x805a('0x9')][_0x805a('0xf')];this[_0x805a('0x9')]=_[_0x805a('0x10')](this['Agents'],'id');this[_0x805a('0x9')]['_rr']=_0x5a7582;};MailQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x40cf28=0x0;_0x40cf28=0x0?this[_0x805a('0x14')]:0x0;var _0x5a4985={'id':this['id'],'available':this[_0x805a('0x14')],'loggedIn':this[_0x805a('0x12')],'name':this[_0x805a('0x6')],'paused':this['paused'],'waiting':this[_0x805a('0xa')]};var _0x2dd3d2=md5(JSON['stringify'](_0x5a4985));if(this[_0x805a('0xb')]!==_0x2dd3d2){this[_0x805a('0xb')]=_0x2dd3d2;io['to'](util[_0x805a('0x15')](_0x805a('0x16'),_0x5a4985['name']))[_0x805a('0x17')](_0x805a('0x18'),_0x5a4985);}};module[_0x805a('0x19')]=MailQueue; \ No newline at end of file +var _0x8683=['mapAgentsId','waiting','prototype','updateRouting','_rr','map','Agents','updateRealtime','loggedIn','length','online','mailPause','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x8683,0xa9));var _0x3868=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x8683[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x3868('0x0'));var md5=require(_0x3868('0x1'));var util=require(_0x3868('0x2'));var Redis=require(_0x3868('0x3'));var config=require(_0x3868('0x4'));config[_0x3868('0x5')]=_[_0x3868('0x6')](config[_0x3868('0x5')],{'host':_0x3868('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3868('0x5')]));function MailQueue(_0x435083){this['id']=_0x435083['id']||0x0;this[_0x3868('0x8')]=_0x435083[_0x3868('0x8')]||'';this['timeout']=_0x435083[_0x3868('0x9')]||0xa;this[_0x3868('0xa')]=_0x435083[_0x3868('0xa')]||'beepall';this['Agents']=_0x435083['Agents'];this[_0x3868('0xb')]={};this[_0x3868('0xc')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x3868('0xd')][_0x3868('0xe')]=function(){var _0x315ccc=this[_0x3868('0xb')][_0x3868('0xf')];this[_0x3868('0xb')]=_[_0x3868('0x10')](this[_0x3868('0x11')],'id');this[_0x3868('0xb')]['_rr']=_0x315ccc;};MailQueue[_0x3868('0xd')][_0x3868('0x12')]=function(){this[_0x3868('0x13')]=0x0;this['paused']=0x0;for(var _0x2e28bf=0x0;_0x2e28bf=0x0?this[_0x3868('0x18')]:0x0;var _0x3bbeb3={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x3868('0x8')],'paused':this[_0x3868('0x17')],'waiting':this[_0x3868('0xc')]};var _0x4b0ece=md5(JSON[_0x3868('0x19')](_0x3bbeb3));if(this[_0x3868('0x1')]!==_0x4b0ece){this['md5']=_0x4b0ece;io['to'](util[_0x3868('0x1a')](_0x3868('0x1b'),_0x3bbeb3[_0x3868('0x8')]))[_0x3868('0x1c')](_0x3868('0x1d'),_0x3bbeb3);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 25be651..0bbb499 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 _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0x1261,0x144));var _0x1126=function(_0x3a441a,_0x43eb56){_0x3a441a=_0x3a441a-0x0;var _0x3128a2=_0x1261[_0x3a441a];return _0x3128a2;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc4aa[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index ef60669..edaa292 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 _0xc577=['loggedIn','available','stringify','format','sms:queue:%s','emit','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','map','paused','length','online'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xc577,0x172));var _0x7c57=function(_0x137c34,_0x2ebd98){_0x137c34=_0x137c34-0x0;var _0x145d9b=_0xc577[_0x137c34];return _0x145d9b;};'use strict';var _=require(_0x7c57('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x7c57('0x1'));var config=require(_0x7c57('0x2'));config[_0x7c57('0x3')]=_[_0x7c57('0x4')](config[_0x7c57('0x3')],{'host':_0x7c57('0x5'),'port':0x18eb});var io=require(_0x7c57('0x6'))(new Redis(config['redis']));function SmsQueue(_0x447d52){this['id']=_0x447d52['id']||0x0;this[_0x7c57('0x7')]=_0x447d52[_0x7c57('0x7')]||'';this[_0x7c57('0x8')]=_0x447d52[_0x7c57('0x8')]||0xa;this['strategy']=_0x447d52['strategy']||'beepall';this[_0x7c57('0x9')]=_0x447d52['Agents'];this[_0x7c57('0xa')]={};this[_0x7c57('0xb')]=0x0;this[_0x7c57('0xc')]='';this[_0x7c57('0xd')]();this['updateRealtime']();}SmsQueue[_0x7c57('0xe')][_0x7c57('0xd')]=function(){var _0x4b5b56=this[_0x7c57('0xa')][_0x7c57('0xf')];this[_0x7c57('0xa')]=_[_0x7c57('0x10')](this[_0x7c57('0x9')],'id');this[_0x7c57('0xa')][_0x7c57('0xf')]=_0x4b5b56;};SmsQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x7c57('0x11')]=0x0;for(var _0x373a4b=0x0;_0x373a4b=0x0?this['available']:0x0;var _0x20dd80={'id':this['id'],'available':this[_0x7c57('0x15')],'loggedIn':this[_0x7c57('0x14')],'name':this[_0x7c57('0x7')],'paused':this[_0x7c57('0x11')],'waiting':this[_0x7c57('0xb')]};var _0x2931c4=md5(JSON[_0x7c57('0x16')](_0x20dd80));if(this[_0x7c57('0xc')]!==_0x2931c4){this['md5']=_0x2931c4;io['to'](util[_0x7c57('0x17')](_0x7c57('0x18'),_0x20dd80[_0x7c57('0x7')]))[_0x7c57('0x19')]('sms_queue:save',_0x20dd80);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x495e=['paused','online','smsPause','available','stringify','format','emit','sms_queue:save','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','updateRealtime','loggedIn'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0x495e,0xfb));var _0xe495=function(_0x5aef17,_0x592cd4){_0x5aef17=_0x5aef17-0x0;var _0x43f9d0=_0x495e[_0x5aef17];return _0x43f9d0;};'use strict';var _=require(_0xe495('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xe495('0x1'));var config=require(_0xe495('0x2'));config[_0xe495('0x3')]=_[_0xe495('0x4')](config['redis'],{'host':_0xe495('0x5'),'port':0x18eb});var io=require(_0xe495('0x6'))(new Redis(config[_0xe495('0x3')]));function SmsQueue(_0x3da4aa){this['id']=_0x3da4aa['id']||0x0;this[_0xe495('0x7')]=_0x3da4aa[_0xe495('0x7')]||'';this[_0xe495('0x8')]=_0x3da4aa['timeout']||0xa;this['strategy']=_0x3da4aa['strategy']||_0xe495('0x9');this['Agents']=_0x3da4aa[_0xe495('0xa')];this[_0xe495('0xb')]={};this[_0xe495('0xc')]=0x0;this[_0xe495('0xd')]='';this[_0xe495('0xe')]();this['updateRealtime']();}SmsQueue[_0xe495('0xf')][_0xe495('0xe')]=function(){var _0x2325ea=this['mapAgentsId'][_0xe495('0x10')];this[_0xe495('0xb')]=_['map'](this['Agents'],'id');this[_0xe495('0xb')][_0xe495('0x10')]=_0x2325ea;};SmsQueue['prototype'][_0xe495('0x11')]=function(){this[_0xe495('0x12')]=0x0;this[_0xe495('0x13')]=0x0;for(var _0x14744d=0x0;_0x14744d=0x0?this['available']:0x0;var _0x1e602c={'id':this['id'],'available':this[_0xe495('0x16')],'loggedIn':this[_0xe495('0x12')],'name':this[_0xe495('0x7')],'paused':this[_0xe495('0x13')],'waiting':this['waiting']};var _0x4dfcb7=md5(JSON[_0xe495('0x17')](_0x1e602c));if(this[_0xe495('0xd')]!==_0x4dfcb7){this[_0xe495('0xd')]=_0x4dfcb7;io['to'](util[_0xe495('0x18')]('sms:queue:%s',_0x1e602c[_0xe495('0x7')]))[_0xe495('0x19')](_0xe495('0x1a'),_0x1e602c);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 5afad12..b15f2c5 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 _0x2cd3=['format','emit','whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','available','stringify'];(function(_0x3faf51,_0x4535f3){var _0x4685b7=function(_0x4c1839){while(--_0x4c1839){_0x3faf51['push'](_0x3faf51['shift']());}};_0x4685b7(++_0x4535f3);}(_0x2cd3,0x1ea));var _0x32cd=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x2cd3[_0x290fa6];return _0x47f1f3;};'use strict';var _=require(_0x32cd('0x0'));var md5=require(_0x32cd('0x1'));var util=require(_0x32cd('0x2'));var Redis=require('ioredis');var config=require(_0x32cd('0x3'));config[_0x32cd('0x4')]=_[_0x32cd('0x5')](config['redis'],{'host':_0x32cd('0x6'),'port':0x18eb});var io=require(_0x32cd('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x228ee2){this['id']=_0x228ee2['id']||0x0;this[_0x32cd('0x8')]=_0x228ee2[_0x32cd('0x8')]||'';this[_0x32cd('0x9')]=_0x228ee2[_0x32cd('0x9')]||0xa;this['strategy']=_0x228ee2['strategy']||_0x32cd('0xa');this[_0x32cd('0xb')]=_0x228ee2['Agents'];this[_0x32cd('0xc')]={};this[_0x32cd('0xd')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue[_0x32cd('0xe')]['updateRouting']=function(){var _0x2eed79=this[_0x32cd('0xc')][_0x32cd('0xf')];this[_0x32cd('0xc')]=_[_0x32cd('0x10')](this[_0x32cd('0xb')],'id');this[_0x32cd('0xc')]['_rr']=_0x2eed79;};WhatsappQueue['prototype'][_0x32cd('0x11')]=function(){this[_0x32cd('0x12')]=0x0;this[_0x32cd('0x13')]=0x0;for(var _0x3c1361=0x0;_0x3c1361=0x0?this[_0x32cd('0x15')]:0x0;var _0x14b819={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32cd('0x12')],'name':this[_0x32cd('0x8')],'paused':this[_0x32cd('0x13')],'waiting':this[_0x32cd('0xd')]};var _0x456dea=md5(JSON[_0x32cd('0x16')](_0x14b819));if(this[_0x32cd('0x1')]!==_0x456dea){this['md5']=_0x456dea;io['to'](util[_0x32cd('0x17')]('whatsapp:queue:%s',_0x14b819[_0x32cd('0x8')]))[_0x32cd('0x18')](_0x32cd('0x19'),_0x14b819);}};module[_0x32cd('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x538d=['ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','util'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0x538d,0x165));var _0xd538=function(_0x35a761,_0x23ee4d){_0x35a761=_0x35a761-0x0;var _0x34fcad=_0x538d[_0x35a761];return _0x34fcad;};'use strict';var _=require(_0xd538('0x0'));var md5=require(_0xd538('0x1'));var util=require(_0xd538('0x2'));var Redis=require(_0xd538('0x3'));var config=require(_0xd538('0x4'));config['redis']=_[_0xd538('0x5')](config[_0xd538('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xd538('0x7'))(new Redis(config[_0xd538('0x6')]));function WhatsappQueue(_0x423879){this['id']=_0x423879['id']||0x0;this['name']=_0x423879[_0xd538('0x8')]||'';this[_0xd538('0x9')]=_0x423879['timeout']||0xa;this['strategy']=_0x423879[_0xd538('0xa')]||'beepall';this[_0xd538('0xb')]=_0x423879[_0xd538('0xb')];this[_0xd538('0xc')]={};this[_0xd538('0xd')]=0x0;this[_0xd538('0x1')]='';this[_0xd538('0xe')]();this[_0xd538('0xf')]();}WhatsappQueue[_0xd538('0x10')]['updateRouting']=function(){var _0x319df1=this[_0xd538('0xc')][_0xd538('0x11')];this['mapAgentsId']=_[_0xd538('0x12')](this['Agents'],'id');this[_0xd538('0xc')][_0xd538('0x11')]=_0x319df1;};WhatsappQueue[_0xd538('0x10')][_0xd538('0xf')]=function(){this[_0xd538('0x13')]=0x0;this[_0xd538('0x14')]=0x0;for(var _0x1bade7=0x0;_0x1bade7=0x0?this[_0xd538('0x18')]:0x0;var _0x573fcb={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd538('0x13')],'name':this['name'],'paused':this[_0xd538('0x14')],'waiting':this[_0xd538('0xd')]};var _0x5caa0e=md5(JSON[_0xd538('0x19')](_0x573fcb));if(this['md5']!==_0x5caa0e){this['md5']=_0x5caa0e;io['to'](util[_0xd538('0x1a')](_0xd538('0x1b'),_0x573fcb['name']))['emit'](_0xd538('0x1c'),_0x573fcb);}};module[_0xd538('0x1d')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 1d88077..83428a8 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 _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x37b9e7,_0x2bfa2e){var _0x451f9c=function(_0x1939e2){while(--_0x1939e2){_0x37b9e7['push'](_0x37b9e7['shift']());}};_0x451f9c(++_0x2bfa2e);}(_0xb10b,0x12a));var _0xbb10=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0xb10b[_0x55d829];return _0x52163b;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index db025a3..65cbe6b 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 _0xd1e8=['update','Request','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x560408,_0x45c914){var _0x3fd4da=function(_0x47e9a9){while(--_0x47e9a9){_0x560408['push'](_0x560408['shift']());}};_0x3fd4da(++_0x45c914);}(_0xd1e8,0x15b));var _0x8d1e=function(_0x2cad4d,_0x286c70){_0x2cad4d=_0x2cad4d-0x0;var _0x1f0915=_0xd1e8[_0x2cad4d];return _0x1f0915;};'use strict';var client=require(_0x8d1e('0x0'));exports[_0x8d1e('0x1')]=function(_0x14fb21,_0x19563f){return client[_0x8d1e('0x2')]('UpdateChatInteraction',{'body':_0x19563f,'options':{'where':{'id':_0x14fb21}},'log':_0x8d1e('0x3')});};exports['addTags']=function(_0x5d2fbe,_0x17d11c){return client[_0x8d1e('0x2')](_0x8d1e('0x4'),{'body':_0x17d11c,'options':{'where':{'id':_0x5d2fbe}},'log':_0x8d1e('0x5')});}; \ No newline at end of file +var _0x3e9d=['addTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x4b3300,_0x1137f1){var _0x2d26d3=function(_0x4678b5){while(--_0x4678b5){_0x4b3300['push'](_0x4b3300['shift']());}};_0x2d26d3(++_0x1137f1);}(_0x3e9d,0xef));var _0xd3e9=function(_0x1711fb,_0x44bf0c){_0x1711fb=_0x1711fb-0x0;var _0x3eee25=_0x3e9d[_0x1711fb];return _0x3eee25;};'use strict';var client=require('../client');exports[_0xd3e9('0x0')]=function(_0x57d4f3,_0xfcb8e1){return client[_0xd3e9('0x1')](_0xd3e9('0x2'),{'body':_0xfcb8e1,'options':{'where':{'id':_0x57d4f3}},'log':_0xd3e9('0x3')});};exports[_0xd3e9('0x4')]=function(_0x33d0fd,_0x19e0c5){return client[_0xd3e9('0x1')](_0xd3e9('0x5'),{'body':_0x19e0c5,'options':{'where':{'id':_0x33d0fd}},'log':_0xd3e9('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index ea372c7..5d5b147 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 _0x1762=['create','CreateChatMessage','../client'];(function(_0x14510c,_0x86ac6b){var _0xb4d007=function(_0x2959b8){while(--_0x2959b8){_0x14510c['push'](_0x14510c['shift']());}};_0xb4d007(++_0x86ac6b);}(_0x1762,0x98));var _0x2176=function(_0x3dfb4a,_0x4c216a){_0x3dfb4a=_0x3dfb4a-0x0;var _0x144c5f=_0x1762[_0x3dfb4a];return _0x144c5f;};'use strict';var client=require(_0x2176('0x0'));exports[_0x2176('0x1')]=function(_0x1f258d){return client['Request'](_0x2176('0x2'),{'body':_0x1f258d,'log':'createChatMessage'});}; \ No newline at end of file +var _0x0c5f=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x2e38a8,_0x57e42b){var _0x8900b5=function(_0x324f39){while(--_0x324f39){_0x2e38a8['push'](_0x2e38a8['shift']());}};_0x8900b5(++_0x57e42b);}(_0x0c5f,0xf5));var _0xf0c5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0c5f[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xf0c5('0x0'));exports[_0xf0c5('0x1')]=function(_0x4e9fce){return client[_0xf0c5('0x2')](_0xf0c5('0x3'),{'body':_0x4e9fce,'log':_0xf0c5('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 7e6d304..f0f4022 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 _0xa992=['../client','getChatQueues','Request','GetChatQueue','timeout','strategy','User','Agents','name','online','chatPause'];(function(_0x49d9db,_0x41347b){var _0x5f049d=function(_0x2fb1ac){while(--_0x2fb1ac){_0x49d9db['push'](_0x49d9db['shift']());}};_0x5f049d(++_0x41347b);}(_0xa992,0x18c));var _0x2a99=function(_0xd09c56,_0x4aa28c){_0xd09c56=_0xd09c56-0x0;var _0x2009e7=_0xa992[_0xd09c56];return _0x2009e7;};'use strict';var client=require(_0x2a99('0x0'));exports[_0x2a99('0x1')]=function(){return function(){return client[_0x2a99('0x2')](_0x2a99('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2a99('0x4'),_0x2a99('0x5')],'include':[{'model':_0x2a99('0x6'),'as':_0x2a99('0x7'),'attributes':['id',_0x2a99('0x8'),_0x2a99('0x9'),_0x2a99('0xa')]}]},'log':_0x2a99('0x1')});};}; \ No newline at end of file +var _0x34e7=['User','Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34e7,0x164));var _0x734e=function(_0x5d7c7d,_0xb243cc){_0x5d7c7d=_0x5d7c7d-0x0;var _0x30ae4f=_0x34e7[_0x5d7c7d];return _0x30ae4f;};'use strict';var client=require(_0x734e('0x0'));exports[_0x734e('0x1')]=function(){return function(){return client[_0x734e('0x2')](_0x734e('0x3'),{'options':{'raw':![],'attributes':['id',_0x734e('0x4'),_0x734e('0x5'),_0x734e('0x6')],'include':[{'model':_0x734e('0x7'),'as':_0x734e('0x8'),'attributes':['id',_0x734e('0x4'),_0x734e('0x9'),_0x734e('0xa')]}]},'log':_0x734e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 9a78e8c..76214e7 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 _0xd404=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x2a68fc,_0xba0da6){var _0x22c819=function(_0x4f00c0){while(--_0x4f00c0){_0x2a68fc['push'](_0x2a68fc['shift']());}};_0x22c819(++_0xba0da6);}(_0xd404,0x15b));var _0x4d40=function(_0x27a8e1,_0x51ce9c){_0x27a8e1=_0x27a8e1-0x0;var _0x1c4267=_0xd404[_0x27a8e1];return _0x1c4267;};'use strict';var client=require(_0x4d40('0x0'));exports[_0x4d40('0x1')]=function(_0x5b9c2b){return client[_0x4d40('0x2')](_0x4d40('0x3'),{'body':_0x5b9c2b,'log':'CreateChatQueueReport'});};exports[_0x4d40('0x4')]=function(_0x610dbf,_0xba821){return client[_0x4d40('0x2')](_0x4d40('0x5'),{'body':_0xba821,'options':{'where':{'uniqueid':_0x610dbf},'order':[['id',_0x4d40('0x6')]],'limit':0x1},'log':_0x4d40('0x5')});}; \ No newline at end of file +var _0x8d53=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x3654c8,_0x4f989c){var _0x144e1c=function(_0x4a2e53){while(--_0x4a2e53){_0x3654c8['push'](_0x3654c8['shift']());}};_0x144e1c(++_0x4f989c);}(_0x8d53,0x1c2));var _0x38d5=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0x8d53[_0x258b93];return _0x35484b;};'use strict';var client=require(_0x38d5('0x0'));exports[_0x38d5('0x1')]=function(_0x5e0848){return client[_0x38d5('0x2')](_0x38d5('0x3'),{'body':_0x5e0848,'log':_0x38d5('0x3')});};exports[_0x38d5('0x4')]=function(_0x3a7660,_0x19c115){return client[_0x38d5('0x2')](_0x38d5('0x5'),{'body':_0x19c115,'options':{'where':{'uniqueid':_0x3a7660},'order':[['id','DESC']],'limit':0x1},'log':_0x38d5('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 07eb90d..f6e797a 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x7a54,0x106));var _0x47a5=function(_0x5e77d4,_0x4bd018){_0x5e77d4=_0x5e77d4-0x0;var _0x2d4e17=_0x7a54[_0x5e77d4];return _0x2d4e17;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x4e90e3,_0x570a1d){var _0x295e5b=function(_0x754043){while(--_0x754043){_0x4e90e3['push'](_0x4e90e3['shift']());}};_0x295e5b(++_0x570a1d);}(_0x7a54,0x106));var _0x47a5=function(_0x5e1403,_0x2fb755){_0x5e1403=_0x5e1403-0x0;var _0x269d87=_0x7a54[_0x5e1403];return _0x269d87;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 2c27687..40423b2 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 _0x80d9=['../client','create','Request','createFaxMessage'];(function(_0x24764a,_0x4b7466){var _0x39ebd8=function(_0x4f3fcb){while(--_0x4f3fcb){_0x24764a['push'](_0x24764a['shift']());}};_0x39ebd8(++_0x4b7466);}(_0x80d9,0x140));var _0x980d=function(_0x3722c8,_0x52df1f){_0x3722c8=_0x3722c8-0x0;var _0x4f8c9b=_0x80d9[_0x3722c8];return _0x4f8c9b;};'use strict';var client=require(_0x980d('0x0'));exports[_0x980d('0x1')]=function(_0x5f2dc2){return client[_0x980d('0x2')]('CreateFaxMessage',{'body':_0x5f2dc2,'log':_0x980d('0x3')});}; \ No newline at end of file +var _0xfa7b=['createFaxMessage','../client','create','Request'];(function(_0x3ccac1,_0x5cc7ea){var _0x10b20b=function(_0x4ed4f5){while(--_0x4ed4f5){_0x3ccac1['push'](_0x3ccac1['shift']());}};_0x10b20b(++_0x5cc7ea);}(_0xfa7b,0x75));var _0xbfa7=function(_0x56579c,_0xc9b976){_0x56579c=_0x56579c-0x0;var _0x52abde=_0xfa7b[_0x56579c];return _0x52abde;};'use strict';var client=require(_0xbfa7('0x0'));exports[_0xbfa7('0x1')]=function(_0x464656){return client[_0xbfa7('0x2')]('CreateFaxMessage',{'body':_0x464656,'log':_0xbfa7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index b8c8050..b3db840 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 _0x24b5=['timeout','strategy','User','Agents','online','faxPause','../client','getFaxQueues','name'];(function(_0xebb3a4,_0x17fc20){var _0x11babf=function(_0x16f78a){while(--_0x16f78a){_0xebb3a4['push'](_0xebb3a4['shift']());}};_0x11babf(++_0x17fc20);}(_0x24b5,0x141));var _0x524b=function(_0x4b2151,_0x36131b){_0x4b2151=_0x4b2151-0x0;var _0x3c113c=_0x24b5[_0x4b2151];return _0x3c113c;};'use strict';var client=require(_0x524b('0x0'));exports[_0x524b('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x524b('0x2'),_0x524b('0x3'),_0x524b('0x4')],'include':[{'model':_0x524b('0x5'),'as':_0x524b('0x6'),'attributes':['id',_0x524b('0x2'),_0x524b('0x7'),_0x524b('0x8')]}]},'log':_0x524b('0x1')});};}; \ No newline at end of file +var _0x959e=['strategy','User','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','timeout'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0x959e,0xc1));var _0xe959=function(_0x77d310,_0x2b2fe7){_0x77d310=_0x77d310-0x0;var _0x2cdce4=_0x959e[_0x77d310];return _0x2cdce4;};'use strict';var client=require(_0xe959('0x0'));exports[_0xe959('0x1')]=function(){return function(){return client[_0xe959('0x2')](_0xe959('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xe959('0x4'),_0xe959('0x5')],'include':[{'model':_0xe959('0x6'),'as':'Agents','attributes':['id','name',_0xe959('0x7'),_0xe959('0x8')]}]},'log':_0xe959('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index fe28e6b..f0829ef 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 _0x1047=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x5b5e4e,_0x3d257e){var _0x798ce1=function(_0x52dc3c){while(--_0x52dc3c){_0x5b5e4e['push'](_0x5b5e4e['shift']());}};_0x798ce1(++_0x3d257e);}(_0x1047,0x1c2));var _0x7104=function(_0x45abd9,_0x3d9abc){_0x45abd9=_0x45abd9-0x0;var _0x5e89ee=_0x1047[_0x45abd9];return _0x5e89ee;};'use strict';var client=require(_0x7104('0x0'));exports[_0x7104('0x1')]=function(_0x544dd1){return client[_0x7104('0x2')](_0x7104('0x3'),{'body':_0x544dd1,'log':'CreateFaxQueueReport'});};exports[_0x7104('0x4')]=function(_0x3a2856,_0x5bd6d3){return client[_0x7104('0x2')]('UpdateFaxQueueReport',{'body':_0x5bd6d3,'options':{'where':{'uniqueid':_0x3a2856},'order':[['id','DESC']],'limit':0x1},'log':_0x7104('0x5')});}; \ No newline at end of file +var _0x5188=['UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport','update','DESC'];(function(_0x5729f6,_0x49e34c){var _0x48d541=function(_0x243898){while(--_0x243898){_0x5729f6['push'](_0x5729f6['shift']());}};_0x48d541(++_0x49e34c);}(_0x5188,0x7f));var _0x8518=function(_0x4f8c04,_0x4c9252){_0x4f8c04=_0x4f8c04-0x0;var _0x216748=_0x5188[_0x4f8c04];return _0x216748;};'use strict';var client=require(_0x8518('0x0'));exports[_0x8518('0x1')]=function(_0x2bd7b1){return client[_0x8518('0x2')](_0x8518('0x3'),{'body':_0x2bd7b1,'log':_0x8518('0x3')});};exports[_0x8518('0x4')]=function(_0x3c8ef6,_0x349bb4){return client['Request']('UpdateFaxQueueReport',{'body':_0x349bb4,'options':{'where':{'uniqueid':_0x3c8ef6},'order':[['id',_0x8518('0x5')]],'limit':0x1},'log':_0x8518('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 138a1be..75a1007 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 _0x3127=['Request','GetInterval','name','Interval','Intervals','../client'];(function(_0x28ac58,_0x4614cb){var _0x1da86a=function(_0x24d6ae){while(--_0x24d6ae){_0x28ac58['push'](_0x28ac58['shift']());}};_0x1da86a(++_0x4614cb);}(_0x3127,0x1e5));var _0x7312=function(_0x5293a1,_0x351c64){_0x5293a1=_0x5293a1-0x0;var _0x5085aa=_0x3127[_0x5293a1];return _0x5085aa;};'use strict';var client=require(_0x7312('0x0'));exports['getIntervals']=function(){return function(){return client[_0x7312('0x1')](_0x7312('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x7312('0x3')],'include':[{'model':_0x7312('0x4'),'as':_0x7312('0x5'),'attributes':['id',_0x7312('0x3'),'interval']}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x4364=['getIntervals','Request','GetInterval','Intervals','name','../client'];(function(_0x4856f6,_0x1589df){var _0x39e04d=function(_0x2d665c){while(--_0x2d665c){_0x4856f6['push'](_0x4856f6['shift']());}};_0x39e04d(++_0x1589df);}(_0x4364,0xfb));var _0x4436=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x4364[_0x491a7f];return _0x3d8f44;};'use strict';var client=require(_0x4436('0x0'));exports[_0x4436('0x1')]=function(){return function(){return client[_0x4436('0x2')](_0x4436('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x4436('0x4'),'attributes':['id',_0x4436('0x5'),'interval']}]},'log':_0x4436('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 87335c1..c5948fb 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 _0x32b6=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x466c42,_0x17d7c1){var _0x2a833f=function(_0x17408a){while(--_0x17408a){_0x466c42['push'](_0x466c42['shift']());}};_0x2a833f(++_0x17d7c1);}(_0x32b6,0x1d1));var _0x632b=function(_0x42e25d,_0x215216){_0x42e25d=_0x42e25d-0x0;var _0x530107=_0x32b6[_0x42e25d];return _0x530107;};'use strict';var client=require(_0x632b('0x0'));exports[_0x632b('0x1')]=function(_0x4d7646,_0x1f0635){return client[_0x632b('0x2')]('UpdateMailInteraction',{'body':_0x1f0635,'options':{'where':{'id':_0x4d7646}},'log':'updateMailInteraction'});};exports[_0x632b('0x3')]=function(_0x3435e8,_0x3ba3a7){return client[_0x632b('0x2')](_0x632b('0x4'),{'body':_0x3ba3a7,'options':{'where':{'id':_0x3435e8}},'log':_0x632b('0x5')});}; \ No newline at end of file +var _0x6343=['AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x2139ba,_0x4b02a2){var _0x4d618b=function(_0x34da71){while(--_0x34da71){_0x2139ba['push'](_0x2139ba['shift']());}};_0x4d618b(++_0x4b02a2);}(_0x6343,0x168));var _0x3634=function(_0x424aa1,_0x20977e){_0x424aa1=_0x424aa1-0x0;var _0x545730=_0x6343[_0x424aa1];return _0x545730;};'use strict';var client=require('../client');exports['update']=function(_0x35bd8f,_0x26d852){return client['Request']('UpdateMailInteraction',{'body':_0x26d852,'options':{'where':{'id':_0x35bd8f}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x403aba,_0x420510){return client['Request'](_0x3634('0x0'),{'body':_0x420510,'options':{'where':{'id':_0x403aba}},'log':_0x3634('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 986e992..c113639 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 _0x0726=['createMailMessage','create','CreateMailMessage'];(function(_0x2ffa40,_0x1a23b0){var _0x2b8203=function(_0x49f740){while(--_0x49f740){_0x2ffa40['push'](_0x2ffa40['shift']());}};_0x2b8203(++_0x1a23b0);}(_0x0726,0x19f));var _0x6072=function(_0x8f66f,_0xe4d19f){_0x8f66f=_0x8f66f-0x0;var _0x93ce78=_0x0726[_0x8f66f];return _0x93ce78;};'use strict';var client=require('../client');exports[_0x6072('0x0')]=function(_0x5ac069){return client['Request'](_0x6072('0x1'),{'body':_0x5ac069,'log':_0x6072('0x2')});}; \ No newline at end of file +var _0x26ec=['createMailMessage','../client','create'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x26ec,0x76));var _0xc26e=function(_0x3733ac,_0x5c2e51){_0x3733ac=_0x3733ac-0x0;var _0x72a04a=_0x26ec[_0x3733ac];return _0x72a04a;};'use strict';var client=require(_0xc26e('0x0'));exports[_0xc26e('0x1')]=function(_0x4d987d){return client['Request']('CreateMailMessage',{'body':_0x4d987d,'log':_0xc26e('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 8694b25..4ad3c2b 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 _0x88ed=['online','mailPause','getMailQueues','../client','Request','name','timeout','Agents'];(function(_0x575217,_0x39ed2b){var _0x54517a=function(_0x459823){while(--_0x459823){_0x575217['push'](_0x575217['shift']());}};_0x54517a(++_0x39ed2b);}(_0x88ed,0xc3));var _0xd88e=function(_0x7f6653,_0xe6a1b5){_0x7f6653=_0x7f6653-0x0;var _0x94d3da=_0x88ed[_0x7f6653];return _0x94d3da;};'use strict';var client=require(_0xd88e('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xd88e('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xd88e('0x2'),_0xd88e('0x3'),'strategy'],'include':[{'model':'User','as':_0xd88e('0x4'),'attributes':['id',_0xd88e('0x2'),_0xd88e('0x5'),_0xd88e('0x6')]}]},'log':_0xd88e('0x7')});};}; \ No newline at end of file +var _0xdc1a=['strategy','User','name','online','mailPause','getMailQueues','Request','GetMailQueue','timeout'];(function(_0x2ec9ee,_0x30efdf){var _0x25ecec=function(_0xd9e741){while(--_0xd9e741){_0x2ec9ee['push'](_0x2ec9ee['shift']());}};_0x25ecec(++_0x30efdf);}(_0xdc1a,0x12f));var _0xadc1=function(_0x28ae4a,_0x53bb96){_0x28ae4a=_0x28ae4a-0x0;var _0x4488ca=_0xdc1a[_0x28ae4a];return _0x4488ca;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0xadc1('0x0')](_0xadc1('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xadc1('0x2'),_0xadc1('0x3')],'include':[{'model':_0xadc1('0x4'),'as':'Agents','attributes':['id',_0xadc1('0x5'),_0xadc1('0x6'),_0xadc1('0x7')]}]},'log':_0xadc1('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f7a6ef2..e7ebfd8 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 _0x2a0c=['DESC','../client','create','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0x10d52b,_0xc6a4f1){var _0x2bf44a=function(_0x286009){while(--_0x286009){_0x10d52b['push'](_0x10d52b['shift']());}};_0x2bf44a(++_0xc6a4f1);}(_0x2a0c,0xe5));var _0xc2a0=function(_0x4b1d4c,_0x4a5653){_0x4b1d4c=_0x4b1d4c-0x0;var _0x4bca87=_0x2a0c[_0x4b1d4c];return _0x4bca87;};'use strict';var client=require(_0xc2a0('0x0'));exports[_0xc2a0('0x1')]=function(_0x577c4d){return client[_0xc2a0('0x2')](_0xc2a0('0x3'),{'body':_0x577c4d,'log':_0xc2a0('0x3')});};exports['update']=function(_0x1301ec,_0xff8f46){return client[_0xc2a0('0x2')](_0xc2a0('0x4'),{'body':_0xff8f46,'options':{'where':{'uniqueid':_0x1301ec},'order':[['id',_0xc2a0('0x5')]],'limit':0x1},'log':_0xc2a0('0x4')});}; \ No newline at end of file +var _0x7570=['DESC','create','CreateMailQueueReport','update','Request','UpdateMailQueueReport'];(function(_0x4c6ad2,_0x51092b){var _0x215c13=function(_0xf76c84){while(--_0xf76c84){_0x4c6ad2['push'](_0x4c6ad2['shift']());}};_0x215c13(++_0x51092b);}(_0x7570,0x18d));var _0x0757=function(_0x527c11,_0x54e842){_0x527c11=_0x527c11-0x0;var _0x1f03e1=_0x7570[_0x527c11];return _0x1f03e1;};'use strict';var client=require('../client');exports[_0x0757('0x0')]=function(_0x422c36){return client['Request']('CreateMailQueueReport',{'body':_0x422c36,'log':_0x0757('0x1')});};exports[_0x0757('0x2')]=function(_0x4dcf72,_0x361659){return client[_0x0757('0x3')](_0x0757('0x4'),{'body':_0x361659,'options':{'where':{'uniqueid':_0x4dcf72},'order':[['id',_0x0757('0x5')]],'limit':0x1},'log':_0x0757('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index bcf440b..bdcc3c0 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 _0x9d32=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x24cd97,_0xb4d986){var _0x3ef07a=function(_0x6bed66){while(--_0x6bed66){_0x24cd97['push'](_0x24cd97['shift']());}};_0x3ef07a(++_0xb4d986);}(_0x9d32,0x11e));var _0x29d3=function(_0xd02bb,_0x26e2d0){_0xd02bb=_0xd02bb-0x0;var _0x1cdf23=_0x9d32[_0xd02bb];return _0x1cdf23;};'use strict';var client=require(_0x29d3('0x0'));exports[_0x29d3('0x1')]=function(_0xc43d98,_0x24ee23){return client[_0x29d3('0x2')](_0x29d3('0x3'),{'body':_0x24ee23,'options':{'where':{'id':_0xc43d98}},'log':_0x29d3('0x4')});};exports[_0x29d3('0x5')]=function(_0x3e627d,_0x5d3fc7){return client['Request'](_0x29d3('0x6'),{'body':_0x5d3fc7,'options':{'where':{'id':_0x3e627d}},'log':_0x29d3('0x7')});}; \ No newline at end of file +var _0x5505=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x504f7b,_0x1ac4e0){var _0x2b0904=function(_0x28e51d){while(--_0x28e51d){_0x504f7b['push'](_0x504f7b['shift']());}};_0x2b0904(++_0x1ac4e0);}(_0x5505,0x1e3));var _0x5550=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5505[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x5550('0x0'));exports[_0x5550('0x1')]=function(_0x3194f7,_0x471354){return client[_0x5550('0x2')](_0x5550('0x3'),{'body':_0x471354,'options':{'where':{'id':_0x3194f7}},'log':_0x5550('0x4')});};exports[_0x5550('0x5')]=function(_0x851325,_0x339548){return client[_0x5550('0x2')](_0x5550('0x6'),{'body':_0x339548,'options':{'where':{'id':_0x851325}},'log':_0x5550('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 0d0093a..d28214f 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 _0x8cc7=['CreateOpenchannelMessage'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0x8cc7,0x6d));var _0x78cc=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x8cc7[_0x2bf141];return _0x48277b;};'use strict';var client=require('../client');exports['create']=function(_0x5b39fe){return client['Request'](_0x78cc('0x0'),{'body':_0x5b39fe,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xb4fa=['createOpenchannelMessage','Request','CreateOpenchannelMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb4fa,0x1cc));var _0xab4f=function(_0x20ccba,_0x275e58){_0x20ccba=_0x20ccba-0x0;var _0x5b6dd2=_0xb4fa[_0x20ccba];return _0x5b6dd2;};'use strict';var client=require('../client');exports['create']=function(_0x135858){return client[_0xab4f('0x0')](_0xab4f('0x1'),{'body':_0x135858,'log':_0xab4f('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 5e52b96..56a4add 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 _0x5c13=['getOpenchannelQueues','Request','name','timeout','strategy','User','Agents','online','openchannelPause'];(function(_0x4525cc,_0x15b692){var _0x10775c=function(_0x1034e4){while(--_0x1034e4){_0x4525cc['push'](_0x4525cc['shift']());}};_0x10775c(++_0x15b692);}(_0x5c13,0x1ef));var _0x35c1=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0x5c13[_0x2a390b];return _0x5df10a;};'use strict';var client=require('../client');exports[_0x35c1('0x0')]=function(){return function(){return client[_0x35c1('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x35c1('0x2'),_0x35c1('0x3'),_0x35c1('0x4')],'include':[{'model':_0x35c1('0x5'),'as':_0x35c1('0x6'),'attributes':['id','name',_0x35c1('0x7'),_0x35c1('0x8')]}]},'log':_0x35c1('0x0')});};}; \ No newline at end of file +var _0x7511=['online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents'];(function(_0x43b71d,_0xb42303){var _0x84b0e5=function(_0x9ca702){while(--_0x9ca702){_0x43b71d['push'](_0x43b71d['shift']());}};_0x84b0e5(++_0xb42303);}(_0x7511,0x1d0));var _0x1751=function(_0x23cc7d,_0x553e85){_0x23cc7d=_0x23cc7d-0x0;var _0x41abb3=_0x7511[_0x23cc7d];return _0x41abb3;};'use strict';var client=require(_0x1751('0x0'));exports[_0x1751('0x1')]=function(){return function(){return client[_0x1751('0x2')](_0x1751('0x3'),{'options':{'raw':![],'attributes':['id',_0x1751('0x4'),_0x1751('0x5'),_0x1751('0x6')],'include':[{'model':_0x1751('0x7'),'as':_0x1751('0x8'),'attributes':['id','name',_0x1751('0x9'),_0x1751('0xa')]}]},'log':_0x1751('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 787156b..3795899 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 _0x2ceb=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x72eb91,_0x40296b){var _0x408230=function(_0xdee3db){while(--_0xdee3db){_0x72eb91['push'](_0x72eb91['shift']());}};_0x408230(++_0x40296b);}(_0x2ceb,0x110));var _0xb2ce=function(_0x2a65e5,_0x3ce826){_0x2a65e5=_0x2a65e5-0x0;var _0x2fc50d=_0x2ceb[_0x2a65e5];return _0x2fc50d;};'use strict';var client=require(_0xb2ce('0x0'));exports[_0xb2ce('0x1')]=function(_0x4a7860){return client[_0xb2ce('0x2')](_0xb2ce('0x3'),{'body':_0x4a7860,'log':_0xb2ce('0x3')});};exports[_0xb2ce('0x4')]=function(_0xa187b4,_0x35242f){return client['Request'](_0xb2ce('0x5'),{'body':_0x35242f,'options':{'where':{'uniqueid':_0xa187b4},'order':[['id',_0xb2ce('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x2edc=['DESC','../client','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x14b6a7,_0x2e8a46){var _0x48f809=function(_0x4c0371){while(--_0x4c0371){_0x14b6a7['push'](_0x14b6a7['shift']());}};_0x48f809(++_0x2e8a46);}(_0x2edc,0x1d5));var _0xc2ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2edc[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc2ed('0x0'));exports['create']=function(_0xbc6d78){return client[_0xc2ed('0x1')](_0xc2ed('0x2'),{'body':_0xbc6d78,'log':'CreateOpenchannelQueueReport'});};exports[_0xc2ed('0x3')]=function(_0x5f09f7,_0x44ca1a){return client[_0xc2ed('0x1')](_0xc2ed('0x4'),{'body':_0x44ca1a,'options':{'where':{'uniqueid':_0x5f09f7},'order':[['id',_0xc2ed('0x5')]],'limit':0x1},'log':_0xc2ed('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 8172424..e995411 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 _0x0dba=['addTags','AddTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0xeeeb66,_0xaa6265){var _0x191ef6=function(_0x225bc5){while(--_0x225bc5){_0xeeeb66['push'](_0xeeeb66['shift']());}};_0x191ef6(++_0xaa6265);}(_0x0dba,0x136));var _0xa0db=function(_0x4766d8,_0x1fbf51){_0x4766d8=_0x4766d8-0x0;var _0x2b0872=_0x0dba[_0x4766d8];return _0x2b0872;};'use strict';var client=require(_0xa0db('0x0'));exports[_0xa0db('0x1')]=function(_0x19a3c7,_0x39cde6){return client[_0xa0db('0x2')](_0xa0db('0x3'),{'body':_0x39cde6,'options':{'where':{'id':_0x19a3c7}},'log':_0xa0db('0x4')});};exports[_0xa0db('0x5')]=function(_0x20d00b,_0x4208b7){return client[_0xa0db('0x2')](_0xa0db('0x6'),{'body':_0x4208b7,'options':{'where':{'id':_0x20d00b}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xee39=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x5c8645,_0x31649e){var _0x417d97=function(_0x2c3019){while(--_0x2c3019){_0x5c8645['push'](_0x5c8645['shift']());}};_0x417d97(++_0x31649e);}(_0xee39,0x1e6));var _0x9ee3=function(_0x152007,_0x2436fe){_0x152007=_0x152007-0x0;var _0x322d31=_0xee39[_0x152007];return _0x322d31;};'use strict';var client=require(_0x9ee3('0x0'));exports[_0x9ee3('0x1')]=function(_0xe604cf,_0x58cf62){return client[_0x9ee3('0x2')](_0x9ee3('0x3'),{'body':_0x58cf62,'options':{'where':{'id':_0xe604cf}},'log':_0x9ee3('0x4')});};exports[_0x9ee3('0x5')]=function(_0x2724c7,_0x3a556a){return client[_0x9ee3('0x2')](_0x9ee3('0x6'),{'body':_0x3a556a,'options':{'where':{'id':_0x2724c7}},'log':_0x9ee3('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index afece52..e04a182 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 _0xf891=['createSmsMessage','../client','create','Request'];(function(_0x9cf9ca,_0x1f8738){var _0x13ba06=function(_0x3abc30){while(--_0x3abc30){_0x9cf9ca['push'](_0x9cf9ca['shift']());}};_0x13ba06(++_0x1f8738);}(_0xf891,0xd9));var _0x1f89=function(_0x2109bf,_0x1ce6d8){_0x2109bf=_0x2109bf-0x0;var _0x54b3dc=_0xf891[_0x2109bf];return _0x54b3dc;};'use strict';var client=require(_0x1f89('0x0'));exports[_0x1f89('0x1')]=function(_0x7db00){return client[_0x1f89('0x2')]('CreateSmsMessage',{'body':_0x7db00,'log':_0x1f89('0x3')});}; \ No newline at end of file +var _0x32bc=['CreateSmsMessage','createSmsMessage','create','Request'];(function(_0x1f7598,_0x278047){var _0x410a4a=function(_0x18eaa2){while(--_0x18eaa2){_0x1f7598['push'](_0x1f7598['shift']());}};_0x410a4a(++_0x278047);}(_0x32bc,0xa2));var _0xc32b=function(_0x3184a3,_0x20fa6f){_0x3184a3=_0x3184a3-0x0;var _0x2aace6=_0x32bc[_0x3184a3];return _0x2aace6;};'use strict';var client=require('../client');exports[_0xc32b('0x0')]=function(_0x210790){return client[_0xc32b('0x1')](_0xc32b('0x2'),{'body':_0x210790,'log':_0xc32b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index b9a6d9f..09cf07b 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 _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x780b4c,_0x483434){var _0x53aa14=function(_0x4f9aca){while(--_0x4f9aca){_0x780b4c['push'](_0x780b4c['shift']());}};_0x53aa14(++_0x483434);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x4287e4,_0x40a608){var _0x358390=function(_0x33dd1a){while(--_0x33dd1a){_0x4287e4['push'](_0x4287e4['shift']());}};_0x358390(++_0x40a608);}(_0xe706,0xa3));var _0x6e70=function(_0x401554,_0x34b410){_0x401554=_0x401554-0x0;var _0x5b70e9=_0xe706[_0x401554];return _0x5b70e9;};'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 diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index ddf0f70..fb0ed64 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(_0x572a44,_0x48b9b0){var _0x5e3a88=function(_0x52d656){while(--_0x52d656){_0x572a44['push'](_0x572a44['shift']());}};_0x5e3a88(++_0x48b9b0);}(_0x34e8,0x12c));var _0x834e=function(_0x4aa973,_0x571c28){_0x4aa973=_0x4aa973-0x0;var _0x987fb5=_0x34e8[_0x4aa973];return _0x987fb5;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x4fb797,_0x200ee6){var _0x34e096=function(_0x2c0f40){while(--_0x2c0f40){_0x4fb797['push'](_0x4fb797['shift']());}};_0x34e096(++_0x200ee6);}(_0x008c,0x188));var _0xc008=function(_0x529f79,_0x5b4c85){_0x529f79=_0x529f79-0x0;var _0x21e1d5=_0x008c[_0x529f79];return _0x21e1d5;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index e150737..36e1abe 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(_0x53832d,_0x49cec2){var _0x20efe2=function(_0x7fd41c){while(--_0x7fd41c){_0x53832d['push'](_0x53832d['shift']());}};_0x20efe2(++_0x49cec2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x39199a,_0xaf3346){var _0x971b90=function(_0x32d6c6){while(--_0x32d6c6){_0x39199a['push'](_0x39199a['shift']());}};_0x971b90(++_0xaf3346);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 412fad2..4bb245c 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 _0xe451=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x1ad07b,_0x551d55){var _0x2c447f=function(_0x43340b){while(--_0x43340b){_0x1ad07b['push'](_0x1ad07b['shift']());}};_0x2c447f(++_0x551d55);}(_0xe451,0xec));var _0x1e45=function(_0x24ddef,_0x352eb8){_0x24ddef=_0x24ddef-0x0;var _0x344daa=_0xe451[_0x24ddef];return _0x344daa;};'use strict';var client=require('../client');exports['update']=function(_0xfe805c,_0x479192){return client['Request']('UpdateWhatsappInteraction',{'body':_0x479192,'options':{'where':{'id':_0xfe805c}},'log':_0x1e45('0x0')});};exports[_0x1e45('0x1')]=function(_0x1f9061,_0x197c03){return client['Request'](_0x1e45('0x2'),{'body':_0x197c03,'options':{'where':{'id':_0x1f9061}},'log':_0x1e45('0x3')});}; \ No newline at end of file +var _0x0ec6=['../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x149b82,_0x15af5d){var _0x1952c9=function(_0x452b9b){while(--_0x452b9b){_0x149b82['push'](_0x149b82['shift']());}};_0x1952c9(++_0x15af5d);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x755f60,_0x43bbec){_0x755f60=_0x755f60-0x0;var _0x4d72c0=_0x0ec6[_0x755f60];return _0x4d72c0;};'use strict';var client=require(_0x60ec('0x0'));exports['update']=function(_0x50217e,_0x1bf878){return client[_0x60ec('0x1')](_0x60ec('0x2'),{'body':_0x1bf878,'options':{'where':{'id':_0x50217e}},'log':_0x60ec('0x3')});};exports[_0x60ec('0x4')]=function(_0x262ed6,_0x392a91){return client['Request'](_0x60ec('0x5'),{'body':_0x392a91,'options':{'where':{'id':_0x262ed6}},'log':_0x60ec('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 47c02b9..589b2d1 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 _0x18b2=['create','CreateWhatsappMessage','../client'];(function(_0x34e386,_0x4aa7b5){var _0x1de185=function(_0x3b547b){while(--_0x3b547b){_0x34e386['push'](_0x34e386['shift']());}};_0x1de185(++_0x4aa7b5);}(_0x18b2,0x1ac));var _0x218b=function(_0xa27382,_0x4f0b4f){_0xa27382=_0xa27382-0x0;var _0xcb86a6=_0x18b2[_0xa27382];return _0xcb86a6;};'use strict';var client=require(_0x218b('0x0'));exports[_0x218b('0x1')]=function(_0x5ab2ba){return client['Request'](_0x218b('0x2'),{'body':_0x5ab2ba,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x89de=['CreateWhatsappMessage','createWhatsappMessage','../client','create','Request'];(function(_0x31f8aa,_0x1d1aa1){var _0x5ef007=function(_0x517d11){while(--_0x517d11){_0x31f8aa['push'](_0x31f8aa['shift']());}};_0x5ef007(++_0x1d1aa1);}(_0x89de,0x17e));var _0xe89d=function(_0x25f0d5,_0xc2dbf1){_0x25f0d5=_0x25f0d5-0x0;var _0x3dac6b=_0x89de[_0x25f0d5];return _0x3dac6b;};'use strict';var client=require(_0xe89d('0x0'));exports[_0xe89d('0x1')]=function(_0x595e64){return client[_0xe89d('0x2')](_0xe89d('0x3'),{'body':_0x595e64,'log':_0xe89d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index e469669..8394e8c 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 _0x26b8=['timeout','strategy','User','Agents','name','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue'];(function(_0x145ec0,_0x3f40aa){var _0xc93ae9=function(_0x393193){while(--_0x393193){_0x145ec0['push'](_0x145ec0['shift']());}};_0xc93ae9(++_0x3f40aa);}(_0x26b8,0x1ab));var _0x826b=function(_0xcc580b,_0x4d47c0){_0xcc580b=_0xcc580b-0x0;var _0x4e164d=_0x26b8[_0xcc580b];return _0x4e164d;};'use strict';var client=require(_0x826b('0x0'));exports[_0x826b('0x1')]=function(){return function(){return client['Request'](_0x826b('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x826b('0x3'),_0x826b('0x4')],'include':[{'model':_0x826b('0x5'),'as':_0x826b('0x6'),'attributes':['id',_0x826b('0x7'),_0x826b('0x8'),_0x826b('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x8a3d=['timeout','User','online','../client','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0x8a3d,0xa3));var _0xd8a3=function(_0x403092,_0x4e89bf){_0x403092=_0x403092-0x0;var _0x1c18ca=_0x8a3d[_0x403092];return _0x1c18ca;};'use strict';var client=require(_0xd8a3('0x0'));exports[_0xd8a3('0x1')]=function(){return function(){return client[_0xd8a3('0x2')](_0xd8a3('0x3'),{'options':{'raw':![],'attributes':['id',_0xd8a3('0x4'),_0xd8a3('0x5'),'strategy'],'include':[{'model':_0xd8a3('0x6'),'as':'Agents','attributes':['id',_0xd8a3('0x4'),_0xd8a3('0x7'),'whatsappPause']}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 9f25f1c..b2cbdb8 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 _0xe152=['UpdateWhatsappQueueReport','../client','Request','CreateWhatsappQueueReport','update'];(function(_0x5b64a1,_0x2ec810){var _0x4b6f55=function(_0x44dd84){while(--_0x44dd84){_0x5b64a1['push'](_0x5b64a1['shift']());}};_0x4b6f55(++_0x2ec810);}(_0xe152,0xd8));var _0x2e15=function(_0x2549df,_0x5d53f6){_0x2549df=_0x2549df-0x0;var _0x14165b=_0xe152[_0x2549df];return _0x14165b;};'use strict';var client=require(_0x2e15('0x0'));exports['create']=function(_0x1cecdf){return client[_0x2e15('0x1')](_0x2e15('0x2'),{'body':_0x1cecdf,'log':_0x2e15('0x2')});};exports[_0x2e15('0x3')]=function(_0x31b81a,_0x59ff69){return client[_0x2e15('0x1')](_0x2e15('0x4'),{'body':_0x59ff69,'options':{'where':{'uniqueid':_0x31b81a},'order':[['id','DESC']],'limit':0x1},'log':_0x2e15('0x4')});}; \ No newline at end of file +var _0x1268=['update','DESC','UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x555ef8,_0x43e041){var _0x38cc30=function(_0x105961){while(--_0x105961){_0x555ef8['push'](_0x555ef8['shift']());}};_0x38cc30(++_0x43e041);}(_0x1268,0x15a));var _0x8126=function(_0x55642e,_0x4dea6e){_0x55642e=_0x55642e-0x0;var _0x38c0c8=_0x1268[_0x55642e];return _0x38c0c8;};'use strict';var client=require(_0x8126('0x0'));exports[_0x8126('0x1')]=function(_0x2004fd){return client[_0x8126('0x2')]('CreateWhatsappQueueReport',{'body':_0x2004fd,'log':_0x8126('0x3')});};exports[_0x8126('0x4')]=function(_0x2bf122,_0xc94fec){return client[_0x8126('0x2')]('UpdateWhatsappQueueReport',{'body':_0xc94fec,'options':{'where':{'uniqueid':_0x2bf122},'order':[['id',_0x8126('0x5')]],'limit':0x1},'log':_0x8126('0x6')});}; \ 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 9a8b0ea..b88c7e0 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 _0xc00d=['string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','length','error','map','message','agents','createQueue','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','./strategy'];(function(_0x5b7efb,_0x58efa4){var _0x16a5e4=function(_0x202b14){while(--_0x202b14){_0x5b7efb['push'](_0x5b7efb['shift']());}};_0x16a5e4(++_0x58efa4);}(_0xc00d,0xcc));var _0xdc00=function(_0x1033fc,_0x17c76c){_0x1033fc=_0x1033fc-0x0;var _0x160c4e=_0xc00d[_0x1033fc];return _0x160c4e;};'use strict';var schema=require(_0xdc00('0x0'));var _=require(_0xdc00('0x1'));var util=require(_0xdc00('0x2'));var seqqueue=require(_0xdc00('0x3'));var logger=require('../../../../config/logger')(_0xdc00('0x4'));var strategy=require(_0xdc00('0x5'));var queue=schema({'name':{'type':_0xdc00('0x6'),'required':!![],'message':_0xdc00('0x7')},'timeout':{'type':_0xdc00('0x8'),'message':_0xdc00('0x9')}});function writeLog(_0x14034a,_0x59e1c5,_0x4afe20){return logger[_0xdc00('0xa')](util[_0xdc00('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x14034a,_0x59e1c5[_0xdc00('0xc')],_0x4afe20));}function handleFindAgent(_0xe8294b){return function(_0xdf4d8){return _0xdf4d8[_0xdc00('0xc')][_0xdc00('0xd')]()===_0xe8294b[_0xdc00('0xd')]();};}exports[_0xdc00('0xe')]=function(_0x9e1ab,_0x445b08,_0x2b0ed5,_0x7452f2){return function(_0x1289d6){try{var _0x55d2f7={'name':_0x445b08[0x0],'timeout':_0x445b08[0x1]};var _0x5d71f1=queue[_0xdc00('0x0')](_0x55d2f7,{'typecast':!![]});if(_0x5d71f1[_0xdc00('0xf')]){logger[_0xdc00('0x10')]('[%s][AGENT]\x20%s',_0x9e1ab,_[_0xdc00('0x11')](_0x5d71f1,_0xdc00('0x12'))['join'](',\x20'));_0x1289d6['stop']();}else{var _0x4d005f=_['find'](_0x2b0ed5[_0xdc00('0x13')],handleFindAgent(_0x55d2f7[_0xdc00('0xc')]));if(_0x4d005f){var _0x183496=(_0x55d2f7['timeout']||0xa)*0x3e8;var _0x4c2515,_0x58a63f;var _0x3944c1=seqqueue[_0xdc00('0x14')](_0x183496);_0x3944c1['id']=_0x9e1ab;_0x3944c1[_0xdc00('0x15')]=_0x183496;_0x3944c1[_0xdc00('0x16')]=_0x7452f2[_0xdc00('0x16')];writeLog(_0x9e1ab,_0x4d005f,util[_0xdc00('0xb')](_0xdc00('0x17'),_0x183496));_0x2b0ed5[_0xdc00('0x18')][_0x9e1ab]['on']('end',function(){logger[_0xdc00('0xa')](_0xdc00('0x19'),_0x9e1ab);clearTimeout(_0x58a63f);_0x58a63f=undefined;_0x3944c1[_0xdc00('0x1a')]();if(_0x2b0ed5[_0xdc00('0x18')][_0x9e1ab]){delete _0x2b0ed5[_0xdc00('0x18')][_0x9e1ab];}_0x1289d6[_0xdc00('0x1b')]();});_0x2b0ed5['rules'][_0x9e1ab]['on'](_0xdc00('0x1c'),function(){if(_0x2b0ed5[_0xdc00('0x18')][_0x9e1ab]){delete _0x2b0ed5[_0xdc00('0x18')][_0x9e1ab];}});_0x58a63f=setTimeout(function(){logger[_0xdc00('0xa')](_0xdc00('0x1d'),_0x9e1ab);clearTimeout(_0x58a63f);_0x3944c1[_0xdc00('0x1a')]();_0x1289d6[_0xdc00('0x1e')]();},_0x183496);strategy[_0xdc00('0x1f')](_0x3944c1,_0x4d005f,_0x2b0ed5,_0x7452f2);}else{logger['error'](_0xdc00('0x20'),_0x9e1ab,_0x55d2f7['name']);_0x1289d6[_0xdc00('0x1b')]();}}}catch(_0x178959){console['log'](_0x178959);logger[_0xdc00('0x10')](_0xdc00('0x21'),_0x9e1ab,_0x178959[_0xdc00('0x22')]);_0x1289d6[_0xdc00('0x1b')]();}};}; \ No newline at end of file +var _0x3988=['complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','util','seq-queue','../../../../config/logger','routing','./strategy','string','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','stop','timeout','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close'];(function(_0x39fc06,_0x47d570){var _0x114117=function(_0x3793a1){while(--_0x3793a1){_0x39fc06['push'](_0x39fc06['shift']());}};_0x114117(++_0x47d570);}(_0x3988,0x139));var _0x8398=function(_0x16fe9c,_0x162e7d){_0x16fe9c=_0x16fe9c-0x0;var _0x397f63=_0x3988[_0x16fe9c];return _0x397f63;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x8398('0x0'));var seqqueue=require(_0x8398('0x1'));var logger=require(_0x8398('0x2'))(_0x8398('0x3'));var strategy=require(_0x8398('0x4'));var queue=schema({'name':{'type':_0x8398('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x8398('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x2ff193,_0x5d0c8f,_0x356251){return logger[_0x8398('0x7')](util[_0x8398('0x8')](_0x8398('0x9'),_0x2ff193,_0x5d0c8f[_0x8398('0xa')],_0x356251));}function handleFindAgent(_0x359759){return function(_0x3bc343){return _0x3bc343[_0x8398('0xa')][_0x8398('0xb')]()===_0x359759[_0x8398('0xb')]();};}exports[_0x8398('0xc')]=function(_0x5e6ea5,_0x5b9ac9,_0x209675,_0x578929){return function(_0x1fd1c5){try{var _0x116e8f={'name':_0x5b9ac9[0x0],'timeout':_0x5b9ac9[0x1]};var _0x12c144=queue[_0x8398('0xd')](_0x116e8f,{'typecast':!![]});if(_0x12c144[_0x8398('0xe')]){logger[_0x8398('0xf')](_0x8398('0x10'),_0x5e6ea5,_[_0x8398('0x11')](_0x12c144,_0x8398('0x12'))['join'](',\x20'));_0x1fd1c5[_0x8398('0x13')]();}else{var _0x2f7d77=_['find'](_0x209675['agents'],handleFindAgent(_0x116e8f[_0x8398('0xa')]));if(_0x2f7d77){var _0x5db7c8=(_0x116e8f[_0x8398('0x14')]||0xa)*0x3e8;var _0x4209b9,_0x1fd62a;var _0x968a28=seqqueue['createQueue'](_0x5db7c8);_0x968a28['id']=_0x5e6ea5;_0x968a28[_0x8398('0x15')]=_0x5db7c8;_0x968a28[_0x8398('0x16')]=_0x578929[_0x8398('0x16')];writeLog(_0x5e6ea5,_0x2f7d77,util[_0x8398('0x8')](_0x8398('0x17'),_0x5db7c8));_0x209675[_0x8398('0x18')][_0x5e6ea5]['on']('end',function(){logger[_0x8398('0x7')](_0x8398('0x19'),_0x5e6ea5);clearTimeout(_0x1fd62a);_0x1fd62a=undefined;_0x968a28[_0x8398('0x1a')]();if(_0x209675['rules'][_0x5e6ea5]){delete _0x209675[_0x8398('0x18')][_0x5e6ea5];}_0x1fd1c5[_0x8398('0x13')]();});_0x209675['rules'][_0x5e6ea5]['on'](_0x8398('0x1b'),function(){if(_0x209675[_0x8398('0x18')][_0x5e6ea5]){delete _0x209675[_0x8398('0x18')][_0x5e6ea5];}});_0x1fd62a=setTimeout(function(){logger[_0x8398('0x7')](_0x8398('0x1c'),_0x5e6ea5);clearTimeout(_0x1fd62a);_0x968a28['close']();_0x1fd1c5[_0x8398('0x1d')]();},_0x5db7c8);strategy[_0x8398('0x1e')](_0x968a28,_0x2f7d77,_0x209675,_0x578929);}else{logger['error'](_0x8398('0x1f'),_0x5e6ea5,_0x116e8f[_0x8398('0xa')]);_0x1fd1c5[_0x8398('0x13')]();}}}catch(_0x4608c6){console[_0x8398('0x20')](_0x4608c6);logger[_0x8398('0xf')]('[%s][QUEUE]\x20%s',_0x5e6ea5,_0x4608c6[_0x8398('0x21')]);_0x1fd1c5[_0x8398('0x13')]();}};}; \ 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 eb4e95d..7531b1c 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 _0x0e71=['providerResponse','then','dialogState','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','Message','create','body','catch','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','postText','message','providerName','amazonlex'];(function(_0x446834,_0x430ebf){var _0x16d7e0=function(_0x504707){while(--_0x504707){_0x446834['push'](_0x446834['shift']());}};_0x16d7e0(++_0x430ebf);}(_0x0e71,0xbf));var _0x10e7=function(_0x3222ec,_0x438791){_0x3222ec=_0x3222ec-0x0;var _0x19c92b=_0x0e71[_0x3222ec];return _0x19c92b;};'use strict';var _=require(_0x10e7('0x0'));var moment=require(_0x10e7('0x1'));var AWS=require(_0x10e7('0x2'));var utils=require('./utils');var logger=require(_0x10e7('0x3'))(_0x10e7('0x4'));var rpc={'chatMessage':require(_0x10e7('0x5')),'openchannelMessage':require(_0x10e7('0x6')),'mailMessage':require(_0x10e7('0x7')),'smsMessage':require(_0x10e7('0x8')),'faxMessage':require(_0x10e7('0x9')),'whatsappMessage':require(_0x10e7('0xa'))};exports['consequence']=function(_0xddf086,_0x4e4808){return function(_0x21e540){try{if(!_[_0x10e7('0xb')](this[_0x10e7('0xc')]['UserId'])){logger[_0x10e7('0xd')](_0x10e7('0xe'),_0xddf086,_0x10e7('0xf'));return _0x21e540[_0x10e7('0x10')]();}var _0x5b4675={'ContactId':this[_0x10e7('0x11')]['id'],'sentAt':moment()[_0x10e7('0x12')](_0x10e7('0x13')),'direction':'out'};if(this[_0x10e7('0x14')]===_0x10e7('0x15')||this[_0x10e7('0x14')]==='whatsapp'){_0x5b4675[_0x10e7('0x16')]=this[_0x10e7('0xc')][_0x10e7('0x16')];}var _0x55b702=this[_0x10e7('0x14')];if(_0x55b702==='chat'){_0x5b4675['ChatWebsiteId']=this[_0x10e7('0x17')]['id'];}else{_0x5b4675[_[_0x10e7('0x18')](_0x55b702)+'AccountId']=this[_0x10e7('0x17')]['id'];}_0x5b4675[_[_0x10e7('0x18')](_0x55b702)+_0x10e7('0x19')]=this[_0x10e7('0xc')]['id'];if(this[_0x10e7('0xc')][_0x10e7('0x1a')]){var _0x1feee9=_0x4e4808[0x4];if(!_[_0x10e7('0x1b')](_0x1feee9)){_0x5b4675['body']=utils[_0x10e7('0x1c')](_0x1feee9,this);return rpc[_0x55b702+_0x10e7('0x1d')][_0x10e7('0x1e')](_0x5b4675)['then'](function(_0x54626e){logger['info'](_0x10e7('0xe'),_0xddf086,_0x5b4675[_0x10e7('0x1f')]);})[_0x10e7('0x20')](function(_0x1babfc){logger[_0x10e7('0x21')](_0x10e7('0xe'),_0xddf086,JSON[_0x10e7('0x22')](_0x1babfc));})[_0x10e7('0x23')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xddf086);_0x21e540[_0x10e7('0x24')]();});}else{logger[_0x10e7('0xd')](_0x10e7('0x25'),_0xddf086);_0x21e540['stop']();}}else{var _0x5aa47e=this;var _0x5cce18=new AWS[(_0x10e7('0x26'))]({'accessKeyId':_0x4e4808[0x0],'secretAccessKey':_0x4e4808[0x1],'region':_0x4e4808[0x2]});var _0x45f8c6={'botAlias':_0x10e7('0x27'),'botName':_0x4e4808[0x3],'inputText':this['message'][_0x10e7('0x1f')],'userId':this[_0x10e7('0x14')]+':'+this[_0x10e7('0xc')]['id']['toString']()};_0x5cce18[_0x10e7('0x28')](_0x45f8c6,function(_0x4270cc,_0x2ea940){if(_0x4270cc){logger['error'](_0x10e7('0xe'),_0xddf086,_0x4270cc[_0x10e7('0x29')]);_0x21e540[_0x10e7('0x10')]();}else if(_0x2ea940&&_0x2ea940[_0x10e7('0x29')]){_0x5aa47e['body']['amazonlex']=_0x2ea940;_0x5b4675[_0x10e7('0x1f')]=_0x2ea940[_0x10e7('0x29')];_0x5b4675[_0x10e7('0x2a')]=_0x10e7('0x2b');_0x5b4675[_0x10e7('0x2c')]=JSON[_0x10e7('0x22')](_0x2ea940);return rpc[_0x55b702+_0x10e7('0x1d')][_0x10e7('0x1e')](_0x5b4675)[_0x10e7('0x2d')](function(_0x1e2a61){logger[_0x10e7('0xd')](_0x10e7('0xe'),_0xddf086,_0x5b4675['body']);if(_0x2ea940[_0x10e7('0x2e')]=='Failed'){_0x21e540[_0x10e7('0x10')]();}else{_0x21e540[_0x10e7('0x24')]();}})[_0x10e7('0x20')](function(_0x198877){logger['error'](_0x10e7('0xe'),_0xddf086,JSON['stringify'](_0x198877));_0x21e540[_0x10e7('0x10')]();});}else{_0x21e540[_0x10e7('0x10')]();}});}}catch(_0x1890f0){logger[_0x10e7('0x21')]('[%s][AMAZONLEX]\x20%s',_0xddf086,JSON[_0x10e7('0x22')](_0x1890f0));_0x21e540[_0x10e7('0x24')]();}};}; \ No newline at end of file +var _0xdfb4=['message','toString','amazonlex','stringify','dialogState','error','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','catch','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST'];(function(_0x2b367a,_0x386272){var _0x23d086=function(_0x3701f7){while(--_0x3701f7){_0x2b367a['push'](_0x2b367a['shift']());}};_0x23d086(++_0x386272);}(_0xdfb4,0x114));var _0x4dfb=function(_0x11b03e,_0x347e51){_0x11b03e=_0x11b03e-0x0;var _0x51df4f=_0xdfb4[_0x11b03e];return _0x51df4f;};'use strict';var _=require('lodash');var moment=require(_0x4dfb('0x0'));var AWS=require('aws-sdk');var utils=require(_0x4dfb('0x1'));var logger=require(_0x4dfb('0x2'))(_0x4dfb('0x3'));var rpc={'chatMessage':require(_0x4dfb('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4dfb('0x5')),'faxMessage':require(_0x4dfb('0x6')),'whatsappMessage':require(_0x4dfb('0x7'))};exports[_0x4dfb('0x8')]=function(_0x27216e,_0x499e10){return function(_0x48121c){try{if(!_[_0x4dfb('0x9')](this[_0x4dfb('0xa')][_0x4dfb('0xb')])){logger[_0x4dfb('0xc')](_0x4dfb('0xd'),_0x27216e,_0x4dfb('0xe'));return _0x48121c[_0x4dfb('0xf')]();}var _0x2720e9={'ContactId':this[_0x4dfb('0x10')]['id'],'sentAt':moment()[_0x4dfb('0x11')](_0x4dfb('0x12')),'direction':'out'};if(this[_0x4dfb('0x13')]==='sms'||this[_0x4dfb('0x13')]===_0x4dfb('0x14')){_0x2720e9[_0x4dfb('0x15')]=this[_0x4dfb('0xa')][_0x4dfb('0x15')];}var _0xcea37f=this['channel'];if(_0xcea37f===_0x4dfb('0x16')){_0x2720e9[_0x4dfb('0x17')]=this['account']['id'];}else{_0x2720e9[_[_0x4dfb('0x18')](_0xcea37f)+'AccountId']=this[_0x4dfb('0x19')]['id'];}_0x2720e9[_[_0x4dfb('0x18')](_0xcea37f)+_0x4dfb('0x1a')]=this[_0x4dfb('0xa')]['id'];if(this[_0x4dfb('0xa')][_0x4dfb('0x1b')]){var _0x113155=_0x499e10[0x4];if(!_[_0x4dfb('0x1c')](_0x113155)){_0x2720e9[_0x4dfb('0x1d')]=utils[_0x4dfb('0x1e')](_0x113155,this);return rpc[_0xcea37f+_0x4dfb('0x1f')]['create'](_0x2720e9)[_0x4dfb('0x20')](function(_0x5e4d86){logger[_0x4dfb('0xc')](_0x4dfb('0xd'),_0x27216e,_0x2720e9['body']);})[_0x4dfb('0x21')](function(_0x5baa22){logger['error']('[%s][AMAZONLEX]\x20%s',_0x27216e,JSON['stringify'](_0x5baa22));})[_0x4dfb('0x22')](function(){logger[_0x4dfb('0xc')](_0x4dfb('0x23'),_0x27216e);_0x48121c[_0x4dfb('0x24')]();});}else{logger[_0x4dfb('0xc')](_0x4dfb('0x25'),_0x27216e);_0x48121c[_0x4dfb('0x24')]();}}else{var _0x457212=this;var _0x1dee25=new AWS['LexRuntime']({'accessKeyId':_0x499e10[0x0],'secretAccessKey':_0x499e10[0x1],'region':_0x499e10[0x2]});var _0x26b268={'botAlias':_0x4dfb('0x26'),'botName':_0x499e10[0x3],'inputText':this[_0x4dfb('0x27')]['body'],'userId':this['channel']+':'+this['interaction']['id'][_0x4dfb('0x28')]()};_0x1dee25['postText'](_0x26b268,function(_0x47ecfd,_0x4e4a82){if(_0x47ecfd){logger['error'](_0x4dfb('0xd'),_0x27216e,_0x47ecfd[_0x4dfb('0x27')]);_0x48121c['next']();}else if(_0x4e4a82&&_0x4e4a82['message']){_0x457212[_0x4dfb('0x1d')][_0x4dfb('0x29')]=_0x4e4a82;_0x2720e9[_0x4dfb('0x1d')]=_0x4e4a82[_0x4dfb('0x27')];_0x2720e9['providerName']=_0x4dfb('0x29');_0x2720e9['providerResponse']=JSON[_0x4dfb('0x2a')](_0x4e4a82);return rpc[_0xcea37f+_0x4dfb('0x1f')]['create'](_0x2720e9)[_0x4dfb('0x20')](function(_0x58315){logger[_0x4dfb('0xc')]('[%s][AMAZONLEX]\x20%s',_0x27216e,_0x2720e9[_0x4dfb('0x1d')]);if(_0x4e4a82[_0x4dfb('0x2b')]=='Failed'){_0x48121c[_0x4dfb('0xf')]();}else{_0x48121c[_0x4dfb('0x24')]();}})[_0x4dfb('0x21')](function(_0x1df145){logger[_0x4dfb('0x2c')](_0x4dfb('0xd'),_0x27216e,JSON[_0x4dfb('0x2a')](_0x1df145));_0x48121c[_0x4dfb('0xf')]();});}else{_0x48121c[_0x4dfb('0xf')]();}});}}catch(_0x9ff042){logger['error'](_0x4dfb('0xd'),_0x27216e,JSON[_0x4dfb('0x2a')](_0x9ff042));_0x48121c['stop']();}};}; \ 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 5528b18..f918b14 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 _0x15df=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','html','','headers','auto-replied','All','auto_reply','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','stringify','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/mailInteraction','../../rpc/smsInteraction'];(function(_0x9f03b2,_0x456903){var _0x5df7eb=function(_0x21d518){while(--_0x21d518){_0x9f03b2['push'](_0x9f03b2['shift']());}};_0x5df7eb(++_0x456903);}(_0x15df,0xc9));var _0xf15d=function(_0x564122,_0x43ffb3){_0x564122=_0x564122-0x0;var _0x446554=_0x15df[_0x564122];return _0x446554;};'use strict';var _=require(_0xf15d('0x0'));var moment=require('moment');var utils=require(_0xf15d('0x1'));var logger=require(_0xf15d('0x2'))('routing');var rpc={'chatMessage':require(_0xf15d('0x3')),'openchannelMessage':require(_0xf15d('0x4')),'mailMessage':require(_0xf15d('0x5')),'smsMessage':require(_0xf15d('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xf15d('0x7')),'smsInteraction':require(_0xf15d('0x8')),'faxInteraction':require(_0xf15d('0x9')),'whatsappInteraction':require(_0xf15d('0xa'))};var mailRpc=require(_0xf15d('0xb'));exports[_0xf15d('0xc')]=function(_0x4846d1,_0xb0c97d,_0x172530,_0x57c43e){return function(_0xd5959b){try{var _0x28062a=this['channel'];if(_0x28062a===_0xf15d('0xd')&&_0x57c43e[_0xf15d('0xe')][_0xf15d('0xf')]){logger[_0xf15d('0x10')](_0xf15d('0x11'),_0x4846d1,_0xf15d('0x12'));return _0xd5959b['next']();}if(_0xb0c97d[0x0]==='1'&&(_[_0xf15d('0x13')](this[_0xf15d('0x14')][_0xf15d('0x15')])||!this[_0xf15d('0x14')][_0xf15d('0x15')])){logger[_0xf15d('0x10')]('[%s][AUTOREPLY]\x20%s',_0x4846d1,_0xf15d('0x16'));return _0xd5959b['next']();}if(_0xb0c97d[0x0]==='2'&&this[_0xf15d('0x14')][_0xf15d('0x17')]){logger['info'](_0xf15d('0x18'),_0x4846d1,_0xf15d('0x19'));return _0xd5959b[_0xf15d('0x1a')]();}var _0x2d5d59={'ContactId':this[_0xf15d('0x1b')]['id'],'sentAt':moment()[_0xf15d('0x1c')](_0xf15d('0x1d')),'direction':'out'};if(this[_0xf15d('0x1e')]===_0xf15d('0xd')){_0x2d5d59[_0xf15d('0xe')]=utils[_0xf15d('0x1f')](_0xb0c97d[0x2],this);}else{_0x2d5d59[_0xf15d('0xe')]=utils[_0xf15d('0x1f')](_0xb0c97d[0x1],this);}if(this['message']){_0x2d5d59['to']=this[_0xf15d('0x20')][_0xf15d('0x21')]||'';if(this[_0xf15d('0x1e')]===_0xf15d('0xd')&&_0xb0c97d[0x1]==='1'){_0x2d5d59['cc']=this[_0xf15d('0x20')]['cc']||'';}_0x2d5d59[_0xf15d('0x21')]=this[_0xf15d('0x20')]['to']||'';_0x2d5d59[_0xf15d('0x22')]=this[_0xf15d('0x20')]['phone']||'';_0x2d5d59[_0xf15d('0x23')]=!![];if(this[_0xf15d('0x20')][_0xf15d('0x24')]){_0x2d5d59[_0xf15d('0x24')]='';_0x2d5d59[_0xf15d('0x24')]+=_[_0xf15d('0x25')](this['message']['subject'],'Re:')?'':_0xf15d('0x26');_0x2d5d59[_0xf15d('0x24')]+=this['message'][_0xf15d('0x24')];}}if(this[_0xf15d('0x1e')]===_0xf15d('0x27')){_0x2d5d59[_0xf15d('0x28')]=this[_0xf15d('0x29')]['id'];}else{_0x2d5d59[_[_0xf15d('0x2a')](this['channel'])+_0xf15d('0x2b')]=this[_0xf15d('0x29')]['id'];}_0x2d5d59[_[_0xf15d('0x2a')](this[_0xf15d('0x1e')])+_0xf15d('0x2c')]=this[_0xf15d('0x14')]['id'];var _0x6b5ed2=this[_0xf15d('0x14')];if(rpc[this['channel']+_0xf15d('0x2d')]){if(this[_0xf15d('0x1e')]===_0xf15d('0xd')){_0x2d5d59[_0xf15d('0x2e')]=this['message']['messageId'];_0x2d5d59[_0xf15d('0x2f')]=''+_['replace'](_0x2d5d59[_0xf15d('0xe')],_0xf15d('0x30'),_0xf15d('0x31'))+_0xf15d('0x32');_0x2d5d59[_0xf15d('0x33')]={'Auto-Submitted':_0xf15d('0x34'),'X-Auto-Response-Suppress':_0xf15d('0x35'),'Precedence':_0xf15d('0x36')};return mailRpc['sendMailMessage'](this['account'][_0xf15d('0x37')],_0x2d5d59)[_0xf15d('0x38')](function(_0x3eb2d7){logger[_0xf15d('0x10')](_0xf15d('0x39'),_0x4846d1);_0x2d5d59[_0xf15d('0x3a')]=_0x3eb2d7[_0xf15d('0x20')][_0xf15d('0x3a')];return rpc[_0x28062a+_0xf15d('0x2d')][_0xf15d('0x3b')](_0x2d5d59);})[_0xf15d('0x38')](function(_0x333e16){logger[_0xf15d('0x10')](_0xf15d('0x11'),_0x4846d1,JSON['stringify'](_0x333e16));})[_0xf15d('0x3c')](function(_0x2cf510){logger[_0xf15d('0x3d')](_0xf15d('0x3e'),_0x4846d1,JSON['stringify'](_0x2cf510));})[_0xf15d('0x3f')](function(){Promise[_0xf15d('0x40')]()[_0xf15d('0x38')](function(){if(_0xb0c97d[0x0]!=='2'||_0x6b5ed2['autoreplyExecuted'])return;return rpc[_0x28062a+_0xf15d('0x41')][_0xf15d('0x42')](_0x6b5ed2['id'],{'autoreplyExecuted':!![]})[_0xf15d('0x38')](function(_0x40728c){logger[_0xf15d('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4846d1,JSON[_0xf15d('0x43')](_0x40728c));})[_0xf15d('0x3c')](function(_0x3bbbfb){logger['error'](_0xf15d('0x44'),_0x4846d1,JSON[_0xf15d('0x43')](_0x3bbbfb));});})[_0xf15d('0x38')](function(){_0xd5959b['next']();});});}else{return rpc[this[_0xf15d('0x1e')]+_0xf15d('0x2d')][_0xf15d('0x3b')](_0x2d5d59)[_0xf15d('0x38')](function(){logger[_0xf15d('0x10')](_0xf15d('0x11'),_0x4846d1,_0x2d5d59[_0xf15d('0xe')]);})[_0xf15d('0x3c')](function(_0x49bbf1){logger[_0xf15d('0x3d')](_0xf15d('0x11'),_0x4846d1,JSON['stringify'](_0x49bbf1));})[_0xf15d('0x3f')](function(){Promise[_0xf15d('0x40')]()[_0xf15d('0x38')](function(){if(_0xb0c97d[0x0]!=='2'||_0x6b5ed2[_0xf15d('0x17')])return;return rpc[_0x28062a+_0xf15d('0x41')][_0xf15d('0x42')](_0x6b5ed2['id'],{'autoreplyExecuted':!![]})[_0xf15d('0x38')](function(_0x59c189){logger[_0xf15d('0x10')](_0xf15d('0x18'),_0x4846d1,JSON[_0xf15d('0x43')](_0x59c189));})[_0xf15d('0x3c')](function(_0x46ed4f){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4846d1,JSON['stringify'](_0x46ed4f));});})[_0xf15d('0x38')](function(){_0xd5959b[_0xf15d('0x1a')]();});});}}}catch(_0x43ff41){logger[_0xf15d('0x3d')](_0xf15d('0x11'),_0x4846d1,JSON[_0xf15d('0x43')](_0x43ff41));_0xd5959b[_0xf15d('0x45')]();}};}; \ No newline at end of file +var _0x740b=['body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','mail','phone','read','subject','startsWith','Re:','ChatWebsiteId','account','upperFirst','AccountId','Message','inReplyTo','messageId','','';_0x2f1472['headers']={'Auto-Submitted':_0xb740('0x31'),'X-Auto-Response-Suppress':_0xb740('0x32'),'Precedence':'auto_reply'};return mailRpc[_0xb740('0x33')](this['account'][_0xb740('0x34')],_0x2f1472)['then'](function(_0x39ea83){logger['info'](_0xb740('0x35'),_0x5bb661);_0x2f1472[_0xb740('0x2d')]=_0x39ea83[_0xb740('0x1f')]['messageId'];return rpc[_0x1b2f61+_0xb740('0x2b')][_0xb740('0x36')](_0x2f1472);})[_0xb740('0x37')](function(_0x310687){logger[_0xb740('0x12')](_0xb740('0x13'),_0x5bb661,JSON[_0xb740('0x38')](_0x310687));})[_0xb740('0x39')](function(_0x1c384b){logger[_0xb740('0x3a')](_0xb740('0x3b'),_0x5bb661,JSON[_0xb740('0x38')](_0x1c384b));})[_0xb740('0x3c')](function(){Promise[_0xb740('0x3d')]()[_0xb740('0x37')](function(){if(_0x915dc9[0x0]!=='2'||_0x5bb85a[_0xb740('0x3e')])return;return rpc[_0x1b2f61+'Interaction'][_0xb740('0x3f')](_0x5bb85a['id'],{'autoreplyExecuted':!![]})[_0xb740('0x37')](function(_0x2cba20){logger[_0xb740('0x12')](_0xb740('0x19'),_0x5bb661,JSON[_0xb740('0x38')](_0x2cba20));})[_0xb740('0x39')](function(_0x5c5ed9){logger['error'](_0xb740('0x40'),_0x5bb661,JSON[_0xb740('0x38')](_0x5c5ed9));});})[_0xb740('0x37')](function(){_0x4a4a38['next']();});});}else{return rpc[this[_0xb740('0xf')]+_0xb740('0x2b')][_0xb740('0x36')](_0x2f1472)[_0xb740('0x37')](function(){logger['info'](_0xb740('0x13'),_0x5bb661,_0x2f1472[_0xb740('0x10')]);})['catch'](function(_0x3fa0d8){logger[_0xb740('0x3a')](_0xb740('0x13'),_0x5bb661,JSON[_0xb740('0x38')](_0x3fa0d8));})[_0xb740('0x3c')](function(){Promise[_0xb740('0x3d')]()[_0xb740('0x37')](function(){if(_0x915dc9[0x0]!=='2'||_0x5bb85a[_0xb740('0x3e')])return;return rpc[_0x1b2f61+_0xb740('0x41')]['update'](_0x5bb85a['id'],{'autoreplyExecuted':!![]})['then'](function(_0x1e3dbb){logger[_0xb740('0x12')](_0xb740('0x19'),_0x5bb661,JSON[_0xb740('0x38')](_0x1e3dbb));})['catch'](function(_0x459521){logger[_0xb740('0x3a')](_0xb740('0x40'),_0x5bb661,JSON[_0xb740('0x38')](_0x459521));});})[_0xb740('0x37')](function(){_0x4a4a38['next']();});});}}}catch(_0x38e915){logger[_0xb740('0x3a')](_0xb740('0x13'),_0x5bb661,JSON[_0xb740('0x38')](_0x38e915));_0x4a4a38['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 98b705f..39bd58c 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 _0x9d8b=['format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','finally','stop','stringify','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','[%s][CLOSE]\x20reason\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9d8b,0xf4));var _0xb9d8=function(_0x2872b0,_0x4b0855){_0x2872b0=_0x2872b0-0x0;var _0x58b379=_0x9d8b[_0x2872b0];return _0x58b379;};'use strict';var moment=require(_0xb9d8('0x0'));var logger=require(_0xb9d8('0x1'))(_0xb9d8('0x2'));var rpc={'chatInteraction':require(_0xb9d8('0x3')),'openchannelInteraction':require(_0xb9d8('0x4')),'smsInteraction':require(_0xb9d8('0x5')),'mailInteraction':require(_0xb9d8('0x6')),'faxInteraction':require(_0xb9d8('0x7')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x22e7a7,_0x3a4d18,_0x1c301b,_0x1c57c7){return function(_0x45d7fa){try{logger['info'](_0xb9d8('0x8'),_0x22e7a7,_0x3a4d18[0x0]);var _0xb355fa={'closed':0x1,'closedAt':moment()[_0xb9d8('0x9')](_0xb9d8('0xa')),'closeReason':_0xb9d8('0xb'),'disposition':_0x3a4d18[0x0]};if(rpc[_0x1c57c7[_0xb9d8('0xc')]+_0xb9d8('0xd')]){rpc[_0x1c57c7[_0xb9d8('0xc')]+_0xb9d8('0xd')][_0xb9d8('0xe')](_0x1c57c7[_0xb9d8('0xf')]['id'],_0xb355fa)[_0xb9d8('0x10')](function(_0x4edbef){logger[_0xb9d8('0x11')](_0xb9d8('0x12'),_0x22e7a7,_0x1c57c7['interaction']['id']);})['catch'](function(_0x7d3534){logger[_0xb9d8('0x13')]('[%s][CLOSE]\x20%s',_0x22e7a7,JSON['stringify'](_0x7d3534));})[_0xb9d8('0x14')](function(){_0x45d7fa[_0xb9d8('0x15')]();});}}catch(_0x175196){logger[_0xb9d8('0x13')]('[%s][CLOSE]\x20%s',_0x22e7a7,JSON[_0xb9d8('0x16')](_0x175196));_0x45d7fa[_0xb9d8('0x15')]();}};}; \ No newline at end of file +var _0x236e=['info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','finally','stop','[%s][CLOSE]\x20%s','stringify','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence'];(function(_0x57852a,_0x33d32e){var _0x25c5a7=function(_0x3c5a6a){while(--_0x3c5a6a){_0x57852a['push'](_0x57852a['shift']());}};_0x25c5a7(++_0x33d32e);}(_0x236e,0xd1));var _0xe236=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x236e[_0x298ed3];return _0x5aad28;};'use strict';var moment=require(_0xe236('0x0'));var logger=require(_0xe236('0x1'))('routing');var rpc={'chatInteraction':require(_0xe236('0x2')),'openchannelInteraction':require(_0xe236('0x3')),'smsInteraction':require(_0xe236('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xe236('0x5'))};exports[_0xe236('0x6')]=function(_0x5474e0,_0x453cb6,_0xdb4f0f,_0x4421af){return function(_0x2f0cdc){try{logger[_0xe236('0x7')](_0xe236('0x8'),_0x5474e0,_0x453cb6[0x0]);var _0x29271a={'closed':0x1,'closedAt':moment()[_0xe236('0x9')](_0xe236('0xa')),'closeReason':_0xe236('0xb'),'disposition':_0x453cb6[0x0]};if(rpc[_0x4421af[_0xe236('0xc')]+_0xe236('0xd')]){rpc[_0x4421af[_0xe236('0xc')]+_0xe236('0xd')][_0xe236('0xe')](_0x4421af[_0xe236('0xf')]['id'],_0x29271a)[_0xe236('0x10')](function(_0x5e3e77){logger[_0xe236('0x7')](_0xe236('0x11'),_0x5474e0,_0x4421af[_0xe236('0xf')]['id']);})[_0xe236('0x12')](function(_0x4ceb09){logger[_0xe236('0x13')]('[%s][CLOSE]\x20%s',_0x5474e0,JSON['stringify'](_0x4ceb09));})[_0xe236('0x14')](function(){_0x2f0cdc[_0xe236('0x15')]();});}}catch(_0x41b34e){logger[_0xe236('0x13')](_0xe236('0x16'),_0x5474e0,JSON[_0xe236('0x17')](_0x41b34e));_0x2f0cdc[_0xe236('0x15')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 82e25b7..6deb802 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 _0xf3a7=['providerName','providerResponse','Message','metadata','endConversation','next','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','contact','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','account','InteractionId','created','body','getMustacheRender','create','then','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech'];(function(_0x4588a0,_0x337469){var _0x5c8cef=function(_0x564b2a){while(--_0x564b2a){_0x4588a0['push'](_0x4588a0['shift']());}};_0x5c8cef(++_0x337469);}(_0xf3a7,0x99));var _0x7f3a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf3a7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var moment=require(_0x7f3a('0x0'));var apiai=require(_0x7f3a('0x1'));var md5=require(_0x7f3a('0x2'));var utils=require(_0x7f3a('0x3'));var logger=require(_0x7f3a('0x4'))(_0x7f3a('0x5'));var rpc={'chatMessage':require(_0x7f3a('0x6')),'openchannelMessage':require(_0x7f3a('0x7')),'mailMessage':require(_0x7f3a('0x8')),'smsMessage':require(_0x7f3a('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x7f3a('0xa'))};exports[_0x7f3a('0xb')]=function(_0x2a7d66,_0x2c6b8b){return function(_0x1dd804){try{if(!_[_0x7f3a('0xc')](this[_0x7f3a('0xd')]['UserId'])){logger[_0x7f3a('0xe')](_0x7f3a('0xf'),_0x2a7d66,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1dd804['next']();}var _0x265fb7={'ContactId':this[_0x7f3a('0x10')]['id'],'sentAt':moment()['format'](_0x7f3a('0x11')),'direction':'out'};if(this[_0x7f3a('0x12')]==='sms'||this[_0x7f3a('0x12')]===_0x7f3a('0x13')){_0x265fb7[_0x7f3a('0x14')]=this[_0x7f3a('0xd')][_0x7f3a('0x14')];}var _0x1ac26c=this[_0x7f3a('0x12')];if(_0x1ac26c===_0x7f3a('0x15')){_0x265fb7[_0x7f3a('0x16')]=this['account']['id'];}else{_0x265fb7[_[_0x7f3a('0x17')](_0x1ac26c)+'AccountId']=this[_0x7f3a('0x18')]['id'];}_0x265fb7[_[_0x7f3a('0x17')](_0x1ac26c)+_0x7f3a('0x19')]=this[_0x7f3a('0xd')]['id'];if(this[_0x7f3a('0xd')][_0x7f3a('0x1a')]){var _0x2ce340=_0x2c6b8b[0x2];if(!_['isEmpty'](_0x2ce340)){_0x265fb7[_0x7f3a('0x1b')]=utils[_0x7f3a('0x1c')](_0x2ce340,this);return rpc[_0x1ac26c+'Message'][_0x7f3a('0x1d')](_0x265fb7)[_0x7f3a('0x1e')](function(_0x235e64){logger[_0x7f3a('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x2a7d66,_0x265fb7['body']);})[_0x7f3a('0x1f')](function(_0x429d04){logger[_0x7f3a('0x20')](_0x7f3a('0xf'),_0x2a7d66,JSON[_0x7f3a('0x21')](_0x429d04));})['finally'](function(){logger[_0x7f3a('0xe')](_0x7f3a('0x22'),_0x2a7d66);_0x1dd804[_0x7f3a('0x23')]();});}else{logger[_0x7f3a('0xe')](_0x7f3a('0x24'),_0x2a7d66);_0x1dd804[_0x7f3a('0x23')]();}}else{var _0x7c55cb=this;var _0x203067=apiai(_0x2c6b8b[0x0],{'language':_0x2c6b8b[0x1]||'en'});return _0x203067[_0x7f3a('0x25')](this[_0x7f3a('0x26')]['body'],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0x22cb57){_0x7c55cb[_0x7f3a('0x1b')][_0x7f3a('0x27')]=_0x22cb57;_0x265fb7['body']=_0x22cb57[_0x7f3a('0x28')][_0x7f3a('0x29')][_0x7f3a('0x2a')];_0x265fb7[_0x7f3a('0x2b')]=_0x7f3a('0x27');_0x265fb7[_0x7f3a('0x2c')]=JSON[_0x7f3a('0x21')](_0x22cb57);return rpc[_0x1ac26c+_0x7f3a('0x2d')][_0x7f3a('0x1d')](_0x265fb7)['then'](function(_0x1d0b25){logger[_0x7f3a('0xe')](_0x7f3a('0xf'),_0x2a7d66,_0x265fb7[_0x7f3a('0x1b')]);if(_0x22cb57[_0x7f3a('0x28')][_0x7f3a('0x2e')][_0x7f3a('0x2f')]){_0x1dd804[_0x7f3a('0x30')]();}else{_0x1dd804[_0x7f3a('0x23')]();}})[_0x7f3a('0x1f')](function(_0x34e987){logger[_0x7f3a('0x20')](_0x7f3a('0xf'),_0x2a7d66,JSON[_0x7f3a('0x21')](_0x34e987));_0x1dd804['next']();});})[_0x7f3a('0x1f')](function(_0x1e1420){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x2a7d66,_0x1e1420[_0x7f3a('0x26')]);_0x1dd804[_0x7f3a('0x30')]();});}}catch(_0x21306f){logger['error'](_0x7f3a('0xf'),_0x2a7d66,JSON[_0x7f3a('0x21')](_0x21306f));_0x1dd804[_0x7f3a('0x23')]();}};}; \ No newline at end of file +var _0x6afc=['stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','providerName','providerResponse','create','metadata','lodash','apiai-promise','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','next','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','interaction','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','[%s][DIALOGFLOW]\x20%s','catch','error'];(function(_0xedd071,_0xb6c651){var _0x4f8d81=function(_0x3a13d7){while(--_0x3a13d7){_0xedd071['push'](_0xedd071['shift']());}};_0x4f8d81(++_0xb6c651);}(_0x6afc,0x16b));var _0xc6af=function(_0x2c4254,_0x4e230e){_0x2c4254=_0x2c4254-0x0;var _0x3ff482=_0x6afc[_0x2c4254];return _0x3ff482;};'use strict';var _=require(_0xc6af('0x0'));var moment=require('moment');var apiai=require(_0xc6af('0x1'));var md5=require('md5');var utils=require(_0xc6af('0x2'));var logger=require(_0xc6af('0x3'))('routing');var rpc={'chatMessage':require(_0xc6af('0x4')),'openchannelMessage':require(_0xc6af('0x5')),'mailMessage':require(_0xc6af('0x6')),'smsMessage':require(_0xc6af('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xc6af('0x8'))};exports[_0xc6af('0x9')]=function(_0x3c0485,_0x6d4994){return function(_0x3bfb71){try{if(!_[_0xc6af('0xa')](this['interaction'][_0xc6af('0xb')])){logger[_0xc6af('0xc')]('[%s][DIALOGFLOW]\x20%s',_0x3c0485,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3bfb71[_0xc6af('0xd')]();}var _0x305fde={'ContactId':this['contact']['id'],'sentAt':moment()[_0xc6af('0xe')](_0xc6af('0xf')),'direction':_0xc6af('0x10')};if(this['channel']===_0xc6af('0x11')||this['channel']===_0xc6af('0x12')){_0x305fde[_0xc6af('0x13')]=this[_0xc6af('0x14')][_0xc6af('0x13')];}var _0x1ffa2b=this[_0xc6af('0x15')];if(_0x1ffa2b===_0xc6af('0x16')){_0x305fde[_0xc6af('0x17')]=this['account']['id'];}else{_0x305fde[_[_0xc6af('0x18')](_0x1ffa2b)+_0xc6af('0x19')]=this[_0xc6af('0x1a')]['id'];}_0x305fde[_[_0xc6af('0x18')](_0x1ffa2b)+_0xc6af('0x1b')]=this[_0xc6af('0x14')]['id'];if(this[_0xc6af('0x14')][_0xc6af('0x1c')]){var _0x3b8b37=_0x6d4994[0x2];if(!_[_0xc6af('0x1d')](_0x3b8b37)){_0x305fde[_0xc6af('0x1e')]=utils[_0xc6af('0x1f')](_0x3b8b37,this);return rpc[_0x1ffa2b+_0xc6af('0x20')]['create'](_0x305fde)[_0xc6af('0x21')](function(_0x3d75b8){logger['info'](_0xc6af('0x22'),_0x3c0485,_0x305fde[_0xc6af('0x1e')]);})[_0xc6af('0x23')](function(_0x5ef3f7){logger[_0xc6af('0x24')]('[%s][DIALOGFLOW]\x20%s',_0x3c0485,JSON[_0xc6af('0x25')](_0x5ef3f7));})['finally'](function(){logger[_0xc6af('0xc')](_0xc6af('0x26'),_0x3c0485);_0x3bfb71[_0xc6af('0x27')]();});}else{logger[_0xc6af('0xc')](_0xc6af('0x28'),_0x3c0485);_0x3bfb71[_0xc6af('0x27')]();}}else{var _0x85cc2c=this;var _0x1e0e37=apiai(_0x6d4994[0x0],{'language':_0x6d4994[0x1]||'en'});return _0x1e0e37[_0xc6af('0x29')](this[_0xc6af('0x2a')][_0xc6af('0x1e')],{'sessionId':md5(this['interaction']['id'])})[_0xc6af('0x21')](function(_0x4b1b68){_0x85cc2c[_0xc6af('0x1e')][_0xc6af('0x2b')]=_0x4b1b68;_0x305fde[_0xc6af('0x1e')]=_0x4b1b68[_0xc6af('0x2c')][_0xc6af('0x2d')]['speech'];_0x305fde[_0xc6af('0x2e')]=_0xc6af('0x2b');_0x305fde[_0xc6af('0x2f')]=JSON[_0xc6af('0x25')](_0x4b1b68);return rpc[_0x1ffa2b+'Message'][_0xc6af('0x30')](_0x305fde)['then'](function(_0x1dfb41){logger[_0xc6af('0xc')](_0xc6af('0x22'),_0x3c0485,_0x305fde[_0xc6af('0x1e')]);if(_0x4b1b68[_0xc6af('0x2c')][_0xc6af('0x31')]['endConversation']){_0x3bfb71[_0xc6af('0xd')]();}else{_0x3bfb71[_0xc6af('0x27')]();}})[_0xc6af('0x23')](function(_0x165b64){logger[_0xc6af('0x24')](_0xc6af('0x22'),_0x3c0485,JSON['stringify'](_0x165b64));_0x3bfb71[_0xc6af('0xd')]();});})['catch'](function(_0x14a0a2){logger[_0xc6af('0x24')]('[%s][DIALOGFLOW]\x20%s',_0x3c0485,_0x14a0a2[_0xc6af('0x2a')]);_0x3bfb71[_0xc6af('0xd')]();});}}catch(_0x2314dc){logger['error'](_0xc6af('0x22'),_0x3c0485,JSON['stringify'](_0x2314dc));_0x3bfb71[_0xc6af('0x27')]();}};}; \ 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 f36c9dd..5387f67 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 _0x6d33=['routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','created','then','catch','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','length','push','all','stack','lodash','dialogflow','md5','bluebird','../../../../config/logger'];(function(_0x4f83ca,_0x46f67a){var _0x1fbac3=function(_0x19e401){while(--_0x19e401){_0x4f83ca['push'](_0x4f83ca['shift']());}};_0x1fbac3(++_0x46f67a);}(_0x6d33,0x10f));var _0x36d3=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0x6d33[_0xe1b5f6];return _0x44636e;};'use strict';var _=require(_0x36d3('0x0'));var dialogflow=require(_0x36d3('0x1'));var md5=require(_0x36d3('0x2'));var moment=require('moment');var Promise=require(_0x36d3('0x3'));var logger=require(_0x36d3('0x4'))(_0x36d3('0x5'));var utils=require(_0x36d3('0x6'));var rpc={'chatMessage':require(_0x36d3('0x7')),'openchannelMessage':require(_0x36d3('0x8')),'mailMessage':require(_0x36d3('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x36d3('0xa')),'whatsappMessage':require(_0x36d3('0xb'))};function createMessage(_0xfe6a73,_0x12822a,_0xac0117,_0x554937){return new Promise(function(_0x44a2fb,_0xbe952b){var _0xa4a008=_[_0x36d3('0xc')](_0xac0117);_0xa4a008[_0x36d3('0xd')]=_0x554937;return rpc[_0x12822a+_0x36d3('0xe')][_0x36d3('0xf')](_0xa4a008)['then'](function(){logger[_0x36d3('0x10')](_0x36d3('0x11'),_0xfe6a73,_0xa4a008['body']);_0x44a2fb();})['catch'](function(_0x295609){logger[_0x36d3('0x12')](_0x36d3('0x11'),_0xfe6a73,JSON[_0x36d3('0x13')](_0x295609));_0xbe952b(_0x295609);});});}exports['consequence']=function(_0x15f6bb,_0x156f39){return function(_0x35c68c){try{if(!_['isNil'](this[_0x36d3('0x14')][_0x36d3('0x15')])){logger[_0x36d3('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x15f6bb,_0x36d3('0x16'));return _0x35c68c[_0x36d3('0x17')]();}var _0x1f7299={'ContactId':this['contact']['id'],'sentAt':moment()[_0x36d3('0x18')](_0x36d3('0x19')),'direction':_0x36d3('0x1a')};if(this['channel']===_0x36d3('0x1b')||this[_0x36d3('0x1c')]===_0x36d3('0x1d')){_0x1f7299['phone']=this[_0x36d3('0x14')][_0x36d3('0x1e')];}var _0xb6ce79=this[_0x36d3('0x1c')];if(_0xb6ce79===_0x36d3('0x1f')){_0x1f7299[_0x36d3('0x20')]=this[_0x36d3('0x21')]['id'];}else{_0x1f7299[_['upperFirst'](_0xb6ce79)+_0x36d3('0x22')]=this['account']['id'];}_0x1f7299[_[_0x36d3('0x23')](_0xb6ce79)+'InteractionId']=this[_0x36d3('0x14')]['id'];if(this[_0x36d3('0x14')][_0x36d3('0x24')]){var _0x5ed0eb=_0x156f39[0x4];if(!_['isEmpty'](_0x5ed0eb)){_0x1f7299[_0x36d3('0xd')]=utils['getMustacheRender'](_0x5ed0eb,this);return rpc[_0xb6ce79+_0x36d3('0xe')][_0x36d3('0xf')](_0x1f7299)[_0x36d3('0x25')](function(_0x25f86d){logger[_0x36d3('0x10')](_0x36d3('0x11'),_0x15f6bb,_0x1f7299[_0x36d3('0xd')]);})[_0x36d3('0x26')](function(_0x149a30){logger['error'](_0x36d3('0x11'),_0x15f6bb,JSON[_0x36d3('0x13')](_0x149a30));})['finally'](function(){logger[_0x36d3('0x10')](_0x36d3('0x27'),_0x15f6bb);_0x35c68c[_0x36d3('0x28')]();});}else{logger[_0x36d3('0x10')](_0x36d3('0x29'),_0x15f6bb);_0x35c68c['stop']();}}else{var _0x59fda8=this;var _0x4cd259=_0x156f39[0x2]['replace'](/\\n/g,'\x0a');var _0x3a606c={'credentials':{'private_key':_0x4cd259,'client_email':_0x156f39[0x1]}};var _0x1a2678=new dialogflow[(_0x36d3('0x2a'))](_0x3a606c);var _0x4af058=_0x1a2678[_0x36d3('0x2b')](_0x156f39[0x0],md5(_0x59fda8[_0x36d3('0x14')]['id']));var _0x14e8e5={'session':_0x4af058,'queryInput':{'text':{'text':_0x59fda8[_0x36d3('0x2c')][_0x36d3('0xd')],'languageCode':_0x156f39[0x3]||'en'}}};return _0x1a2678[_0x36d3('0x2d')](_0x14e8e5)[_0x36d3('0x25')](function(_0x13c94e){if(_0x13c94e&&_0x13c94e['length']){_0x59fda8[_0x36d3('0xd')][_0x36d3('0x2e')]=_0x13c94e;var _0x2ce44f=_0x13c94e[0x0];var _0x413127=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x30')]&&_0x2ce44f[_0x36d3('0x2f')]['diagnosticInfo'][_0x36d3('0x31')]?_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x30')]['fields']['end_conversation'][_0x36d3('0x32')]:![];_0x59fda8[_0x36d3('0xd')]['DIALOGFLOWV2_ACTION']=_0x2ce44f['queryResult']['action'];_0x59fda8['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x2ce44f[_0x36d3('0x2f')]['allRequiredParamsPresent'];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x33')]=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x30')]&&_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x30')][_0x36d3('0x31')]?_0x2ce44f[_0x36d3('0x2f')]['diagnosticInfo']['fields'][_0x36d3('0x34')][_0x36d3('0x32')]:![];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x35')]=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x36')][_0x36d3('0x37')];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x38')]=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x36')][_0x36d3('0x39')];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x3a')]=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x36')]['isFallback'];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x3b')]=_0x2ce44f[_0x36d3('0x2f')]['languageCode'];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x3c')]=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x3d')];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x3e')]=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x3f')];_0x1f7299['providerName']=_0x36d3('0x2e');_0x1f7299[_0x36d3('0x40')]=JSON['stringify'](_0x13c94e);var _0x4bc258=[];for(var _0x47c584=0x0;_0x47c584<_0x13c94e[_0x36d3('0x41')];_0x47c584++){var _0x3e0ce0=_0x13c94e[_0x47c584];if(_0x3e0ce0&&_0x3e0ce0[_0x36d3('0x2f')]&&_0x3e0ce0['queryResult']['fulfillmentText']){_0x4bc258[_0x36d3('0x42')](createMessage(_0x15f6bb,_0xb6ce79,_0x1f7299,_0x3e0ce0[_0x36d3('0x2f')]['fulfillmentText']));}}return Promise[_0x36d3('0x43')](_0x4bc258)['then'](function(){if(_0x413127){_0x35c68c[_0x36d3('0x17')]();}else{_0x35c68c[_0x36d3('0x28')]();}})[_0x36d3('0x26')](function(_0x7626a){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x15f6bb,JSON[_0x36d3('0x13')](_0x7626a));_0x35c68c[_0x36d3('0x17')]();});}})[_0x36d3('0x26')](function(_0x4c593a){logger[_0x36d3('0x12')](_0x36d3('0x11'),_0x15f6bb,_0x4c593a['message'],_0x4c593a[_0x36d3('0x44')]);_0x35c68c['next']();});}}catch(_0x529c3f){logger[_0x36d3('0x12')](_0x36d3('0x11'),_0x15f6bb,JSON['stringify'](_0x529c3f));_0x35c68c[_0x36d3('0x28')]();}};}; \ No newline at end of file +var _0xd518=['../../rpc/whatsappMessage','body','Message','create','then','info','catch','error','[%s][DIALOGFLOWV2]\x20%s','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','account','upperFirst','AccountId','isEmpty','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','message','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','length','fulfillmentText','push','all','stack','lodash','md5','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0xd518,0x19f));var _0x8d51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd518[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8d51('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x8d51('0x1'));var moment=require(_0x8d51('0x2'));var Promise=require(_0x8d51('0x3'));var logger=require('../../../../config/logger')(_0x8d51('0x4'));var utils=require(_0x8d51('0x5'));var rpc={'chatMessage':require(_0x8d51('0x6')),'openchannelMessage':require(_0x8d51('0x7')),'mailMessage':require(_0x8d51('0x8')),'smsMessage':require(_0x8d51('0x9')),'faxMessage':require(_0x8d51('0xa')),'whatsappMessage':require(_0x8d51('0xb'))};function createMessage(_0x358382,_0x27df0b,_0x1516cd,_0xf5a339){return new Promise(function(_0x2143dd,_0x1a260b){var _0x30cc9b=_['clone'](_0x1516cd);_0x30cc9b[_0x8d51('0xc')]=_0xf5a339;return rpc[_0x27df0b+_0x8d51('0xd')][_0x8d51('0xe')](_0x30cc9b)[_0x8d51('0xf')](function(){logger[_0x8d51('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x358382,_0x30cc9b[_0x8d51('0xc')]);_0x2143dd();})[_0x8d51('0x11')](function(_0x199481){logger[_0x8d51('0x12')](_0x8d51('0x13'),_0x358382,JSON['stringify'](_0x199481));_0x1a260b(_0x199481);});});}exports[_0x8d51('0x14')]=function(_0x9021cb,_0x42f601){return function(_0x40328a){try{if(!_[_0x8d51('0x15')](this[_0x8d51('0x16')][_0x8d51('0x17')])){logger['info'](_0x8d51('0x13'),_0x9021cb,_0x8d51('0x18'));return _0x40328a[_0x8d51('0x19')]();}var _0x5d286a={'ContactId':this[_0x8d51('0x1a')]['id'],'sentAt':moment()[_0x8d51('0x1b')](_0x8d51('0x1c')),'direction':_0x8d51('0x1d')};if(this['channel']===_0x8d51('0x1e')||this[_0x8d51('0x1f')]===_0x8d51('0x20')){_0x5d286a[_0x8d51('0x21')]=this[_0x8d51('0x16')]['phone'];}var _0x1a7f9d=this[_0x8d51('0x1f')];if(_0x1a7f9d===_0x8d51('0x22')){_0x5d286a['ChatWebsiteId']=this[_0x8d51('0x23')]['id'];}else{_0x5d286a[_[_0x8d51('0x24')](_0x1a7f9d)+_0x8d51('0x25')]=this[_0x8d51('0x23')]['id'];}_0x5d286a[_['upperFirst'](_0x1a7f9d)+'InteractionId']=this[_0x8d51('0x16')]['id'];if(this['interaction']['created']){var _0xd0b5dd=_0x42f601[0x4];if(!_[_0x8d51('0x26')](_0xd0b5dd)){_0x5d286a[_0x8d51('0xc')]=utils['getMustacheRender'](_0xd0b5dd,this);return rpc[_0x1a7f9d+_0x8d51('0xd')][_0x8d51('0xe')](_0x5d286a)[_0x8d51('0xf')](function(_0x53cfe3){logger['info'](_0x8d51('0x13'),_0x9021cb,_0x5d286a[_0x8d51('0xc')]);})['catch'](function(_0x1a51ab){logger[_0x8d51('0x12')](_0x8d51('0x13'),_0x9021cb,JSON['stringify'](_0x1a51ab));})[_0x8d51('0x27')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x9021cb);_0x40328a[_0x8d51('0x28')]();});}else{logger[_0x8d51('0x10')](_0x8d51('0x29'),_0x9021cb);_0x40328a[_0x8d51('0x28')]();}}else{var _0x350d83=this;var _0xace82b=_0x42f601[0x2]['replace'](/\\n/g,'\x0a');var _0x417f58={'credentials':{'private_key':_0xace82b,'client_email':_0x42f601[0x1]}};var _0x33ffb7=new dialogflow[(_0x8d51('0x2a'))](_0x417f58);var _0x3a51ea=_0x33ffb7['sessionPath'](_0x42f601[0x0],md5(_0x350d83[_0x8d51('0x16')]['id']));var _0x35b43a={'session':_0x3a51ea,'queryInput':{'text':{'text':_0x350d83[_0x8d51('0x2b')][_0x8d51('0xc')],'languageCode':_0x42f601[0x3]||'en'}}};return _0x33ffb7['detectIntent'](_0x35b43a)[_0x8d51('0xf')](function(_0x4092ac){if(_0x4092ac&&_0x4092ac['length']){_0x350d83[_0x8d51('0xc')][_0x8d51('0x2c')]=_0x4092ac;var _0x76c211=_0x4092ac[0x0];var _0x37570d=_0x76c211[_0x8d51('0x2d')][_0x8d51('0x2e')]&&_0x76c211[_0x8d51('0x2d')]['diagnosticInfo']['fields']?_0x76c211[_0x8d51('0x2d')]['diagnosticInfo'][_0x8d51('0x2f')][_0x8d51('0x30')][_0x8d51('0x31')]:![];_0x350d83['body'][_0x8d51('0x32')]=_0x76c211[_0x8d51('0x2d')][_0x8d51('0x33')];_0x350d83[_0x8d51('0xc')][_0x8d51('0x34')]=_0x76c211[_0x8d51('0x2d')]['allRequiredParamsPresent'];_0x350d83[_0x8d51('0xc')][_0x8d51('0x35')]=_0x76c211[_0x8d51('0x2d')][_0x8d51('0x2e')]&&_0x76c211[_0x8d51('0x2d')]['diagnosticInfo']['fields']?_0x76c211[_0x8d51('0x2d')][_0x8d51('0x2e')]['fields'][_0x8d51('0x30')]['boolValue']:![];_0x350d83[_0x8d51('0xc')][_0x8d51('0x36')]=_0x76c211[_0x8d51('0x2d')][_0x8d51('0x37')]['name'];_0x350d83[_0x8d51('0xc')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x76c211[_0x8d51('0x2d')][_0x8d51('0x37')][_0x8d51('0x38')];_0x350d83[_0x8d51('0xc')][_0x8d51('0x39')]=_0x76c211['queryResult']['intent']['isFallback'];_0x350d83['body'][_0x8d51('0x3a')]=_0x76c211['queryResult'][_0x8d51('0x3b')];_0x350d83[_0x8d51('0xc')][_0x8d51('0x3c')]=_0x76c211['queryResult'][_0x8d51('0x3d')];_0x350d83[_0x8d51('0xc')][_0x8d51('0x3e')]=_0x76c211[_0x8d51('0x2d')][_0x8d51('0x3f')];_0x5d286a[_0x8d51('0x40')]=_0x8d51('0x2c');_0x5d286a[_0x8d51('0x41')]=JSON['stringify'](_0x4092ac);var _0x1ef72d=[];for(var _0x22d83f=0x0;_0x22d83f<_0x4092ac[_0x8d51('0x42')];_0x22d83f++){var _0x40a3e9=_0x4092ac[_0x22d83f];if(_0x40a3e9&&_0x40a3e9[_0x8d51('0x2d')]&&_0x40a3e9[_0x8d51('0x2d')][_0x8d51('0x43')]){_0x1ef72d[_0x8d51('0x44')](createMessage(_0x9021cb,_0x1a7f9d,_0x5d286a,_0x40a3e9[_0x8d51('0x2d')][_0x8d51('0x43')]));}}return Promise[_0x8d51('0x45')](_0x1ef72d)[_0x8d51('0xf')](function(){if(_0x37570d){_0x40328a[_0x8d51('0x19')]();}else{_0x40328a[_0x8d51('0x28')]();}})[_0x8d51('0x11')](function(_0xeedc61){logger[_0x8d51('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x9021cb,JSON['stringify'](_0xeedc61));_0x40328a[_0x8d51('0x19')]();});}})['catch'](function(_0xefdfd7){logger[_0x8d51('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x9021cb,_0xefdfd7[_0x8d51('0x2b')],_0xefdfd7[_0x8d51('0x46')]);_0x40328a[_0x8d51('0x19')]();});}}catch(_0x59fb17){logger[_0x8d51('0x12')](_0x8d51('0x13'),_0x9021cb,JSON['stringify'](_0x59fb17));_0x40328a[_0x8d51('0x28')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 3ce4a02..1bab7bc 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 _0x511f=['next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','error','message','join','stop','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x511f,0x114));var _0xf511=function(_0x1cc5e4,_0x8b1496){_0x1cc5e4=_0x1cc5e4-0x0;var _0x1d83c3=_0x511f[_0x1cc5e4];return _0x1d83c3;};'use strict';var schema=require(_0xf511('0x0'));var _=require(_0xf511('0x1'));var htmlToText=require(_0xf511('0x2'));var utils=require(_0xf511('0x3'));var logger=require(_0xf511('0x4'))(_0xf511('0x5'));var gotoif=schema({'condition':{'type':_0xf511('0x6'),'required':!![],'message':_0xf511('0x7')},'priorityTrue':{'type':_0xf511('0x8'),'message':_0xf511('0x9')},'priorityFalse':{'type':'number','message':_0xf511('0xa')}});exports[_0xf511('0xb')]=function(_0x397a6a,_0x5b4326){return function(_0x56967a){try{var _0x131b01={'condition':htmlToText[_0xf511('0xc')](utils[_0xf511('0xd')](_0x5b4326[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5b4326[0x1],'priorityFalse':_0x5b4326[0x2]};var _0x759695=gotoif['validate'](_0x131b01,{'typecast':!![]});if(_0x759695['length']){logger[_0xf511('0xe')]('[%s][GOTOIF]\x20%s',_0x397a6a,_['map'](_0x759695,_0xf511('0xf'))[_0xf511('0x10')](',\x20'));_0x56967a[_0xf511('0x11')]();}else{try{var _0x4d32eb=eval('('+_0x131b01['condition']+')');var _0x8dc9a8=_0x4d32eb?_0x131b01['priorityTrue']:_0x131b01['priorityFalse'];logger[_0xf511('0x12')](_0xf511('0x13'),_0x397a6a,_0x131b01[_0xf511('0x14')],_0x4d32eb,_0x8dc9a8||_0xf511('0x15'));if(_0x8dc9a8){var _0x597753=_[_0xf511('0x16')](_0x56967a['rules'](),{'p':_0x8dc9a8});if(_0x597753>=0x0){logger[_0xf511('0x12')](_0xf511('0x17'),_0x397a6a,_0x8dc9a8||_0xf511('0x15'),_0x597753);_0x56967a['next'](_0x597753);}else{logger[_0xf511('0x12')](_0xf511('0x18'),_0x397a6a,_0x8dc9a8||'next');_0x56967a[_0xf511('0x11')]();}}else{_0x56967a[_0xf511('0x15')]();}}catch(_0x5900e8){logger[_0xf511('0xe')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x397a6a,_0x5900e8[_0xf511('0xf')]);_0x56967a['stop']();}}}catch(_0x155dbd){logger[_0xf511('0xe')](_0xf511('0x19'),_0x397a6a,JSON[_0xf511('0x1a')](_0x155dbd));_0x56967a[_0xf511('0x11')]();}};}; \ No newline at end of file +var _0x4c0e=['[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','validate','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','length','error','[%s][GOTOIF]\x20%s','message','stop','priorityTrue','condition','next','findIndex','rules','info'];(function(_0xd15914,_0x5ad38f){var _0x5441d4=function(_0x5eaedf){while(--_0x5eaedf){_0xd15914['push'](_0xd15914['shift']());}};_0x5441d4(++_0x5ad38f);}(_0x4c0e,0x178));var _0xe4c0=function(_0x50b750,_0xe5817b){_0x50b750=_0x50b750-0x0;var _0x1b60a8=_0x4c0e[_0x50b750];return _0x1b60a8;};'use strict';var schema=require(_0xe4c0('0x0'));var _=require('lodash');var htmlToText=require(_0xe4c0('0x1'));var utils=require(_0xe4c0('0x2'));var logger=require(_0xe4c0('0x3'))(_0xe4c0('0x4'));var gotoif=schema({'condition':{'type':_0xe4c0('0x5'),'required':!![],'message':_0xe4c0('0x6')},'priorityTrue':{'type':'number','message':_0xe4c0('0x7')},'priorityFalse':{'type':_0xe4c0('0x8'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x356068,_0x7cae42){return function(_0xd01fa9){try{var _0x48943e={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x7cae42[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x7cae42[0x1],'priorityFalse':_0x7cae42[0x2]};var _0x1cffb6=gotoif[_0xe4c0('0x0')](_0x48943e,{'typecast':!![]});if(_0x1cffb6[_0xe4c0('0x9')]){logger[_0xe4c0('0xa')](_0xe4c0('0xb'),_0x356068,_['map'](_0x1cffb6,_0xe4c0('0xc'))['join'](',\x20'));_0xd01fa9[_0xe4c0('0xd')]();}else{try{var _0x364eb2=eval('('+_0x48943e['condition']+')');var _0x333f30=_0x364eb2?_0x48943e[_0xe4c0('0xe')]:_0x48943e['priorityFalse'];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x356068,_0x48943e[_0xe4c0('0xf')],_0x364eb2,_0x333f30||_0xe4c0('0x10'));if(_0x333f30){var _0x28e369=_[_0xe4c0('0x11')](_0xd01fa9[_0xe4c0('0x12')](),{'p':_0x333f30});if(_0x28e369>=0x0){logger[_0xe4c0('0x13')](_0xe4c0('0x14'),_0x356068,_0x333f30||_0xe4c0('0x10'),_0x28e369);_0xd01fa9[_0xe4c0('0x10')](_0x28e369);}else{logger[_0xe4c0('0x13')](_0xe4c0('0x15'),_0x356068,_0x333f30||_0xe4c0('0x10'));_0xd01fa9[_0xe4c0('0xd')]();}}else{_0xd01fa9[_0xe4c0('0x10')]();}}catch(_0x5c5261){logger[_0xe4c0('0xa')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x356068,_0x5c5261[_0xe4c0('0xc')]);_0xd01fa9[_0xe4c0('0xd')]();}}}catch(_0x538ebd){logger[_0xe4c0('0xa')](_0xe4c0('0xb'),_0x356068,JSON['stringify'](_0x538ebd));_0xd01fa9[_0xe4c0('0xd')]();}};}; \ 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 d7fe180..be3862e 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 _0x91eb=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][GOTOP]\x20%s','map','join','info','[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','error','stringify','../../../../config/logger'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x91eb,0x1af));var _0xb91e=function(_0x180fe2,_0x2767d7){_0x180fe2=_0x180fe2-0x0;var _0x45bcb6=_0x91eb[_0x180fe2];return _0x45bcb6;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0xb91e('0x0'))('routing');var gotop=schema({'priority':{'type':_0xb91e('0x1'),'required':!![],'message':_0xb91e('0x2')}});exports[_0xb91e('0x3')]=function(_0x5296d5,_0x2c49e4){return function(_0x942366){try{var _0x4f226a={'priority':_0x2c49e4[0x0]};var _0xaca9bf=gotop[_0xb91e('0x4')](_0x4f226a,{'typecast':!![]});if(_0xaca9bf[_0xb91e('0x5')]){logger['error'](_0xb91e('0x6'),_0x5296d5,_[_0xb91e('0x7')](_0xaca9bf,'message')[_0xb91e('0x8')](',\x20'));_0x942366['stop']();}else{logger[_0xb91e('0x9')](_0xb91e('0xa'),_0x5296d5,_0x4f226a[_0xb91e('0xb')]);if(_0x4f226a[_0xb91e('0xb')]){var _0x29fc7e=_['findIndex'](_0x942366['rules'](),{'p':_0x4f226a[_0xb91e('0xb')]});if(_0x29fc7e>=0x0){logger['info'](_0xb91e('0xc'),_0x5296d5,_0x4f226a[_0xb91e('0xb')]||_0xb91e('0xd'),_0x29fc7e);_0x942366[_0xb91e('0xd')](_0x29fc7e);}else{logger[_0xb91e('0x9')](_0xb91e('0xe'),_0x5296d5,_0x4f226a[_0xb91e('0xb')]||'next');_0x942366[_0xb91e('0xf')]();}}else{_0x942366[_0xb91e('0xd')]();}}}catch(_0x563d0e){logger[_0xb91e('0x10')]('[%s][GOTOP]\x20%s',_0x5296d5,JSON[_0xb91e('0x11')](_0x563d0e));_0x942366[_0xb91e('0xf')]();}};}; \ No newline at end of file +var _0x466c=['rules','next','validate','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','stop','info','priority'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0x466c,0xf0));var _0xc466=function(_0x4c654f,_0x1e0310){_0x4c654f=_0x4c654f-0x0;var _0x3d4491=_0x466c[_0x4c654f];return _0x3d4491;};'use strict';var schema=require(_0xc466('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0xc466('0x1'));var gotop=schema({'priority':{'type':_0xc466('0x2'),'required':!![],'message':_0xc466('0x3')}});exports[_0xc466('0x4')]=function(_0x3bfa32,_0x12ecf5){return function(_0x102248){try{var _0x24c4de={'priority':_0x12ecf5[0x0]};var _0xd4f41b=gotop[_0xc466('0x0')](_0x24c4de,{'typecast':!![]});if(_0xd4f41b[_0xc466('0x5')]){logger[_0xc466('0x6')](_0xc466('0x7'),_0x3bfa32,_[_0xc466('0x8')](_0xd4f41b,'message')['join'](',\x20'));_0x102248[_0xc466('0x9')]();}else{logger[_0xc466('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x3bfa32,_0x24c4de['priority']);if(_0x24c4de[_0xc466('0xb')]){var _0x66095b=_['findIndex'](_0x102248[_0xc466('0xc')](),{'p':_0x24c4de['priority']});if(_0x66095b>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3bfa32,_0x24c4de[_0xc466('0xb')]||_0xc466('0xd'),_0x66095b);_0x102248[_0xc466('0xd')](_0x66095b);}else{logger[_0xc466('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x3bfa32,_0x24c4de[_0xc466('0xb')]||_0xc466('0xd'));_0x102248[_0xc466('0x9')]();}}else{_0x102248[_0xc466('0xd')]();}}}catch(_0x241a3e){logger[_0xc466('0x6')](_0xc466('0x7'),_0x3bfa32,JSON['stringify'](_0x241a3e));_0x102248['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 f94deea..390abf5 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 _0x795a=['Message','create','then','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0x795a,0xeb));var _0xa795=function(_0x537d6c,_0x2e63b8){_0x537d6c=_0x537d6c-0x0;var _0x56c250=_0x795a[_0x537d6c];return _0x56c250;};'use strict';var _=require('lodash');var utils=require(_0xa795('0x0'));var logger=require(_0xa795('0x1'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xa795('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xa795('0x3')),'faxMessage':require(_0xa795('0x4')),'whatsappMessage':require(_0xa795('0x5'))};exports[_0xa795('0x6')]=function(_0x147dd8,_0x5c01f2){return function(_0x5e0f19){try{var _0x39e56e={'body':utils[_0xa795('0x7')](_0x5c01f2[0x0],this),'ContactId':this[_0xa795('0x8')]['id']};if(this[_0xa795('0x9')]===_0xa795('0xa')){_0x39e56e[_0xa795('0xb')]=this[_0xa795('0xc')]['id'];}else{_0x39e56e[_[_0xa795('0xd')](this[_0xa795('0x9')])+_0xa795('0xe')]=this[_0xa795('0xc')]['id'];}_0x39e56e[_[_0xa795('0xd')](this[_0xa795('0x9')])+_0xa795('0xf')]=this[_0xa795('0x10')]['id'];if(rpc[this[_0xa795('0x9')]+_0xa795('0x11')]){return rpc[this['channel']+_0xa795('0x11')][_0xa795('0x12')](_0x39e56e)[_0xa795('0x13')](function(_0x3d5a70){logger[_0xa795('0x14')]('[%s][MESSAGE]\x20%s',_0x147dd8,_0x39e56e[_0xa795('0x15')]);_0x5e0f19[_0xa795('0x16')]();})[_0xa795('0x17')](function(_0x5e73a6){logger[_0xa795('0x18')](_0xa795('0x19'),_0x147dd8,JSON[_0xa795('0x1a')](_0x5e73a6));_0x5e0f19[_0xa795('0x1b')]();});}}catch(_0x33f02e){logger['error'](_0xa795('0x19'),_0x147dd8,JSON[_0xa795('0x1a')](_0x33f02e));_0x5e0f19[_0xa795('0x1b')]();}};}; \ No newline at end of file +var _0x01d3=['[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','interaction','create','then','info'];(function(_0x2ef0fd,_0x5643a7){var _0x568221=function(_0xa0c5ad){while(--_0xa0c5ad){_0x2ef0fd['push'](_0x2ef0fd['shift']());}};_0x568221(++_0x5643a7);}(_0x01d3,0xa2));var _0x301d=function(_0x544025,_0x55a5f9){_0x544025=_0x544025-0x0;var _0x5ad9a4=_0x01d3[_0x544025];return _0x5ad9a4;};'use strict';var _=require(_0x301d('0x0'));var utils=require(_0x301d('0x1'));var logger=require(_0x301d('0x2'))(_0x301d('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x301d('0x4')),'mailMessage':require(_0x301d('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x301d('0x6')),'whatsappMessage':require(_0x301d('0x7'))};exports[_0x301d('0x8')]=function(_0x337347,_0x5d1462){return function(_0x318074){try{var _0x2d8fc2={'body':utils[_0x301d('0x9')](_0x5d1462[0x0],this),'ContactId':this[_0x301d('0xa')]['id']};if(this[_0x301d('0xb')]===_0x301d('0xc')){_0x2d8fc2[_0x301d('0xd')]=this[_0x301d('0xe')]['id'];}else{_0x2d8fc2[_[_0x301d('0xf')](this[_0x301d('0xb')])+'AccountId']=this[_0x301d('0xe')]['id'];}_0x2d8fc2[_[_0x301d('0xf')](this[_0x301d('0xb')])+'InteractionId']=this[_0x301d('0x10')]['id'];if(rpc[this[_0x301d('0xb')]+'Message']){return rpc[this['channel']+'Message'][_0x301d('0x11')](_0x2d8fc2)[_0x301d('0x12')](function(_0x467b08){logger[_0x301d('0x13')](_0x301d('0x14'),_0x337347,_0x2d8fc2[_0x301d('0x15')]);_0x318074[_0x301d('0x16')]();})['catch'](function(_0x50520c){logger[_0x301d('0x17')](_0x301d('0x14'),_0x337347,JSON[_0x301d('0x18')](_0x50520c));_0x318074['stop']();});}}catch(_0x4d89a0){logger['error']('[%s][MESSAGE]\x20%s',_0x337347,JSON[_0x301d('0x18')](_0x4d89a0));_0x318074[_0x301d('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 56b781f..eef7a67 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 _0x885c=['consequence','info','getMustacheRender','error','[%s][NOOP]\x20%s','stop','../../../../config/logger','routing'];(function(_0x3564ca,_0x401cf1){var _0x3bf55a=function(_0x652de2){while(--_0x652de2){_0x3564ca['push'](_0x3564ca['shift']());}};_0x3bf55a(++_0x401cf1);}(_0x885c,0x1be));var _0xc885=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0x885c[_0x5e6bec];return _0x5dc5cf;};'use strict';var utils=require('./utils');var logger=require(_0xc885('0x0'))(_0xc885('0x1'));exports[_0xc885('0x2')]=function(_0xb85833,_0x2f6fda){return function(_0x1b74d8){try{logger[_0xc885('0x3')]('[%s][NOOP]\x20%s',_0xb85833,utils[_0xc885('0x4')](_0x2f6fda[0x0],this));_0x1b74d8['next']();}catch(_0x3377f3){logger[_0xc885('0x5')](_0xc885('0x6'),_0xb85833,JSON['stringify'](_0x3377f3));_0x1b74d8[_0xc885('0x7')]();}};}; \ No newline at end of file +var _0xc8bf=['getMustacheRender','next','error','stringify','stop','./utils','../../../../config/logger','info','[%s][NOOP]\x20%s'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc8bf,0xb0));var _0xfc8b=function(_0x155ded,_0x4ab607){_0x155ded=_0x155ded-0x0;var _0x4a179b=_0xc8bf[_0x155ded];return _0x4a179b;};'use strict';var utils=require(_0xfc8b('0x0'));var logger=require(_0xfc8b('0x1'))('routing');exports['consequence']=function(_0x2aa94f,_0x18055d){return function(_0x20109e){try{logger[_0xfc8b('0x2')](_0xfc8b('0x3'),_0x2aa94f,utils[_0xfc8b('0x4')](_0x18055d[0x0],this));_0x20109e[_0xfc8b('0x5')]();}catch(_0x5d45d7){logger[_0xfc8b('0x6')](_0xfc8b('0x3'),_0x2aa94f,JSON[_0xfc8b('0x7')](_0x5d45d7));_0x20109e[_0xfc8b('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 ff2c1e3..ab0ba9a 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 _0xacf4=['remove','pick','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','MessageId','message','chat','AccountId','info','name','QueueReport','create','catch','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','interaction','then','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','stop','Queues','timeout','createQueue','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','error','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','./strategy','redis','localhost','socket.io-emitter','account','from','joinAt','emit','clone','queue_id','queue','capitalize','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s'];(function(_0x46d14b,_0x147907){var _0x367dfd=function(_0x117d8e){while(--_0x117d8e){_0x46d14b['push'](_0x46d14b['shift']());}};_0x367dfd(++_0x147907);}(_0xacf4,0x1e8));var _0x4acf=function(_0xcdfc4f,_0x8a111a){_0xcdfc4f=_0xcdfc4f-0x0;var _0x3f70d1=_0xacf4[_0xcdfc4f];return _0x3f70d1;};'use strict';var schema=require('validate');var _=require(_0x4acf('0x0'));var util=require(_0x4acf('0x1'));var seqqueue=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var Redis=require(_0x4acf('0x4'));var config=require(_0x4acf('0x5'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x4acf('0x6'));config[_0x4acf('0x7')]=_['defaults'](config[_0x4acf('0x7')],{'host':_0x4acf('0x8'),'port':0x18eb});var io=require(_0x4acf('0x9'))(new Redis(config[_0x4acf('0x7')]));var attributes=['id','queue_id',_0x4acf('0xa'),'queue',_0x4acf('0xb'),_0x4acf('0xc')];function emit(_0x359846,_0x494050,_0x202dd2){io['to'](_0x359846)[_0x4acf('0xd')](_0x494050,_0x202dd2);}function emitChannelQueueInteraction(_0x4ca4d1,_0x12fc2a,_0x345235,_0x49bb11,_0x352260,_0x1b9994,_0x2e7f82,_0x4288c9){var _0x8fba09=_[_0x4acf('0xe')](_0x345235);_0x8fba09[_0x4acf('0xf')]=_0x4288c9;_0x8fba09[_0x4acf('0x10')]=_0x12fc2a;_0x8fba09[_0x4acf('0xa')]=_0x49bb11;_0x8fba09['id']=_0x352260;if(_0x1b9994){attributes['push'](_[_0x4acf('0x11')](_0x4ca4d1)+'InteractionId');_0x2e7f82[util[_0x4acf('0x12')](_0x4acf('0x13'),_0x4ca4d1)][_0x352260]=_['pick'](_0x8fba09,attributes);}else{delete _0x2e7f82[util[_0x4acf('0x12')](_0x4acf('0x13'),_0x4ca4d1)][_0x352260];}emit(util[_0x4acf('0x12')](_0x4acf('0x14'),_0x4ca4d1,_0x12fc2a),util[_0x4acf('0x12')](_0x4acf('0x15'),_0x4ca4d1,_0x1b9994?'save':_0x4acf('0x16')),_[_0x4acf('0x17')](_0x8fba09,attributes));}var rpc={'openchannelQueueReport':require(_0x4acf('0x18')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x4acf('0x19')),'smsQueueReport':require(_0x4acf('0x1a')),'faxQueueReport':require(_0x4acf('0x1b')),'whatsappQueueReport':require(_0x4acf('0x1c')),'chatInteraction':require(_0x4acf('0x1d')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x4acf('0x1e')),'whatsappInteraction':require(_0x4acf('0x1f'))};var queue=schema({'name':{'type':_0x4acf('0x20'),'required':!![],'message':_0x4acf('0x21')},'timeout':{'type':_0x4acf('0x22'),'message':_0x4acf('0x23')}});function startRouting(_0x452023,_0x19f6b8,_0xbd0467,_0x123253){if(_0x452023&&_0x19f6b8&&_0xbd0467){_0x19f6b8['waiting']+=0x1;var _0x479861={'uniqueid':_0x452023,'from':_0xbd0467[_0x4acf('0x24')]?_0xbd0467['body'][_0x4acf('0xb')]:'','joinAt':moment()[_0x4acf('0x12')](_0x4acf('0x25')),'ContactId':_0xbd0467[_0x4acf('0x26')]?_0xbd0467[_0x4acf('0x26')]['id']:null,'ListId':_0xbd0467[_0x4acf('0x27')]?_0xbd0467['list']['id']:null};_0x479861[_[_0x4acf('0x28')](_0xbd0467['channel'])+_0x4acf('0x29')]=_0x19f6b8['id']||null;_0x479861[_[_0x4acf('0x28')](_0xbd0467[_0x4acf('0x2a')])+'InteractionId']=_0xbd0467['interaction']?_0xbd0467['interaction']['id']:null;_0x479861[_[_0x4acf('0x28')](_0xbd0467[_0x4acf('0x2a')])+_0x4acf('0x2b')]=_0xbd0467[_0x4acf('0x2c')]?_0xbd0467[_0x4acf('0x2c')]['id']:null;_0x479861[_[_0x4acf('0x28')](_0xbd0467[_0x4acf('0x2a')])+(_0xbd0467['channel']!==_0x4acf('0x2d')?_0x4acf('0x2e'):'WebsiteId')]=_0xbd0467[_0x4acf('0xa')]?_0xbd0467[_0x4acf('0xa')]['id']:null;logger[_0x4acf('0x2f')](util[_0x4acf('0x12')]('[%s][START:QUEUE][NAME:%s]',_0x452023,_0x19f6b8[_0x4acf('0x30')]));emitChannelQueueInteraction(_0xbd0467['channel'],_0x19f6b8['name'],_0x479861,_0xbd0467[_0x4acf('0xa')]['name'],_0xbd0467[_0x4acf('0x2c')]['id'],!![],_0x123253,_0x19f6b8['id']);if(rpc[_0xbd0467['channel']+_0x4acf('0x31')]){return rpc[_0xbd0467['channel']+_0x4acf('0x31')][_0x4acf('0x32')](_0x479861)[_0x4acf('0x33')](function(_0x577593){logger['error'](_0x4acf('0x34'),_0x577593);});}}}function stopRouting(_0x2d059b,_0x86f29c,_0x7c4cc1,_0x388144){if(_0x2d059b&&_0x86f29c){_0x86f29c[_0x4acf('0x35')]-=0x1;var _0x9f7fc0={'leaveAt':moment()['format'](_0x4acf('0x25')),'acceptAt':moment()[_0x4acf('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x4acf('0x36')};logger[_0x4acf('0x2f')](util[_0x4acf('0x12')](_0x4acf('0x37'),_0x2d059b,_0x86f29c[_0x4acf('0x30')]));emitChannelQueueInteraction(_0x7c4cc1[_0x4acf('0x2a')],_0x86f29c['name'],_0x7c4cc1['body'],_0x7c4cc1[_0x4acf('0xa')][_0x4acf('0x30')],_0x7c4cc1['message']['id'],![],_0x388144,_0x86f29c['id']);return rpc[_0x7c4cc1[_0x4acf('0x2a')]+_0x4acf('0x38')]['update'](_0x7c4cc1[_0x4acf('0x39')]['id'],{'queueId':_0x86f29c['id']})[_0x4acf('0x3a')](function(){if(rpc[_0x7c4cc1[_0x4acf('0x2a')]+'QueueReport']){return rpc[_0x7c4cc1[_0x4acf('0x2a')]+_0x4acf('0x31')][_0x4acf('0x3b')](_0x2d059b,_0x9f7fc0)['catch'](function(_0x56fcc1){logger['error'](_0x4acf('0x3c'),_0x56fcc1);});}});}}function endRouting(_0x153216,_0x3ad1c4,_0x16bf33,_0x5c90cd){if(_0x153216&&_0x3ad1c4){_0x3ad1c4['waiting']-=0x1;var _0x11e1b9={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x4acf('0x12')](_0x4acf('0x25')),'reason':'timeout'};logger[_0x4acf('0x2f')](util[_0x4acf('0x12')](_0x4acf('0x3d'),_0x153216,_0x3ad1c4[_0x4acf('0x30')]));emitChannelQueueInteraction(_0x16bf33[_0x4acf('0x2a')],_0x3ad1c4[_0x4acf('0x30')],_0x16bf33[_0x4acf('0x24')],_0x16bf33[_0x4acf('0xa')][_0x4acf('0x30')],_0x16bf33[_0x4acf('0x2c')]['id'],![],_0x5c90cd);if(rpc[_0x16bf33['channel']+_0x4acf('0x31')]){return rpc[_0x16bf33[_0x4acf('0x2a')]+_0x4acf('0x31')][_0x4acf('0x3b')](_0x153216,_0x11e1b9)[_0x4acf('0x33')](function(_0x21a179){logger['error'](_0x4acf('0x3c'),_0x21a179);});}}}function handleFindQueue(_0x145edc){return function(_0x35208c){return _0x35208c[_0x4acf('0x30')][_0x4acf('0x3e')]()===_0x145edc[_0x4acf('0x3e')]();};}exports[_0x4acf('0x3f')]=function(_0x2ebcb0,_0x5ab36f,_0xd51728,_0x5bb848){return function(_0x9fe63b){try{var _0x38ce55={'name':_0x5ab36f[0x0],'timeout':_0x5ab36f[0x1]};var _0x5f41d5=queue['validate'](_0x38ce55,{'typecast':!![]});if(_0x5f41d5['length']){logger['error'](_0x4acf('0x40'),_0x2ebcb0,_[_0x4acf('0x41')](_0x5f41d5,_0x4acf('0x2c'))[_0x4acf('0x42')](',\x20'));_0x9fe63b[_0x4acf('0x43')]();}else{var _0x3a72fc=_['find'](_0xd51728[_0x5bb848[_0x4acf('0x2a')]+_0x4acf('0x44')],handleFindQueue(_0x38ce55[_0x4acf('0x30')]));if(_0x3a72fc){startRouting(_0x2ebcb0,_0x3a72fc,_0x5bb848,_0xd51728);var _0x3a632e=(_0x3a72fc[_0x4acf('0x45')]||0xa)*0x3e8;var _0xa92639=(_0x38ce55[_0x4acf('0x45')]||0x14)*0x3e8;var _0x427267;if(_0x3a632e>_0xa92639){_0xa92639=_0x3a632e;}var _0x3834c0=seqqueue[_0x4acf('0x46')](_0x3a632e);_0x3834c0['id']=_0x2ebcb0;_0x3834c0[_0x4acf('0x47')]=_0x3a632e;_0x3834c0[_0x4acf('0x48')]=_0xa92639;_0x3834c0[_0x4acf('0x2a')]=_0x5bb848[_0x4acf('0x2a')];_0xd51728[_0x4acf('0x49')][_0x2ebcb0]['on'](_0x4acf('0x4a'),function(){logger[_0x4acf('0x2f')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x2ebcb0);stopRouting(_0x2ebcb0,_0x3a72fc,_0x5bb848,_0xd51728);clearTimeout(_0x427267);_0x427267=undefined;_0x3834c0[_0x4acf('0x4b')](!![]);if(_0xd51728[_0x4acf('0x49')][_0x2ebcb0]){delete _0xd51728[_0x4acf('0x49')][_0x2ebcb0];}_0x9fe63b[_0x4acf('0x43')]();});_0xd51728[_0x4acf('0x49')][_0x2ebcb0]['on'](_0x4acf('0x4c'),function(){if(_0xd51728[_0x4acf('0x49')][_0x2ebcb0]){delete _0xd51728[_0x4acf('0x49')][_0x2ebcb0];}});_0x427267=setTimeout(function(){logger[_0x4acf('0x2f')](_0x4acf('0x4d'),_0x2ebcb0);endRouting(_0x2ebcb0,_0x3a72fc,_0x5bb848,_0xd51728);clearTimeout(_0x427267);_0x3834c0[_0x4acf('0x4b')](!![]);_0x9fe63b[_0x4acf('0x4e')]();},_0xa92639);switch(_0x3a72fc[_0x4acf('0x4f')]){case _0x4acf('0x50'):strategy[_0x4acf('0x50')](_0x3834c0,_0x3a72fc,_0xd51728,_0x5bb848);break;default:strategy[_0x4acf('0x51')](_0x3834c0,_0x3a72fc,_0xd51728,_0x5bb848);}}else{logger[_0x4acf('0x52')](_0x4acf('0x53'),_0x2ebcb0,_0x38ce55['name']);_0x9fe63b[_0x4acf('0x43')]();}}}catch(_0x402085){logger[_0x4acf('0x52')](_0x4acf('0x40'),_0x2ebcb0,_0x402085[_0x4acf('0x54')]);_0x9fe63b[_0x4acf('0x43')]();}};}; \ No newline at end of file +var _0x1fbe=['info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','Interaction','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','emit','queue','push','InteractionId','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','interaction','MessageId','message','chat','AccountId','WebsiteId'];(function(_0x3dcc91,_0x1cce0d){var _0x303d13=function(_0x5310fb){while(--_0x5310fb){_0x3dcc91['push'](_0x3dcc91['shift']());}};_0x303d13(++_0x1cce0d);}(_0x1fbe,0x177));var _0xe1fb=function(_0x563af1,_0x37924c){_0x563af1=_0x563af1-0x0;var _0x58fccb=_0x1fbe[_0x563af1];return _0x58fccb;};'use strict';var schema=require(_0xe1fb('0x0'));var _=require(_0xe1fb('0x1'));var util=require(_0xe1fb('0x2'));var seqqueue=require(_0xe1fb('0x3'));var moment=require('moment');var Redis=require(_0xe1fb('0x4'));var config=require(_0xe1fb('0x5'));var logger=require(_0xe1fb('0x6'))(_0xe1fb('0x7'));var strategy=require(_0xe1fb('0x8'));config[_0xe1fb('0x9')]=_[_0xe1fb('0xa')](config[_0xe1fb('0x9')],{'host':_0xe1fb('0xb'),'port':0x18eb});var io=require(_0xe1fb('0xc'))(new Redis(config['redis']));var attributes=['id',_0xe1fb('0xd'),_0xe1fb('0xe'),'queue',_0xe1fb('0xf'),'joinAt'];function emit(_0x5b6b2e,_0x559255,_0x565a5f){io['to'](_0x5b6b2e)[_0xe1fb('0x10')](_0x559255,_0x565a5f);}function emitChannelQueueInteraction(_0x39dce1,_0x1b886c,_0x44c13a,_0x3e645d,_0x7f4b29,_0x34a64e,_0x103cda,_0x5d57f6){var _0x5f4d03=_['clone'](_0x44c13a);_0x5f4d03[_0xe1fb('0xd')]=_0x5d57f6;_0x5f4d03[_0xe1fb('0x11')]=_0x1b886c;_0x5f4d03[_0xe1fb('0xe')]=_0x3e645d;_0x5f4d03['id']=_0x7f4b29;if(_0x34a64e){attributes[_0xe1fb('0x12')](_['capitalize'](_0x39dce1)+_0xe1fb('0x13'));_0x103cda[util[_0xe1fb('0x14')]('%sQueuesWaitingInteractions',_0x39dce1)][_0x7f4b29]=_[_0xe1fb('0x15')](_0x5f4d03,attributes);}else{delete _0x103cda[util[_0xe1fb('0x14')](_0xe1fb('0x16'),_0x39dce1)][_0x7f4b29];}emit(util[_0xe1fb('0x14')](_0xe1fb('0x17'),_0x39dce1,_0x1b886c),util['format'](_0xe1fb('0x18'),_0x39dce1,_0x34a64e?_0xe1fb('0x19'):_0xe1fb('0x1a')),_[_0xe1fb('0x15')](_0x5f4d03,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xe1fb('0x1b')),'smsQueueReport':require(_0xe1fb('0x1c')),'faxQueueReport':require(_0xe1fb('0x1d')),'whatsappQueueReport':require(_0xe1fb('0x1e')),'chatInteraction':require(_0xe1fb('0x1f')),'faxInteraction':require(_0xe1fb('0x20')),'mailInteraction':require(_0xe1fb('0x21')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xe1fb('0x22')),'whatsappInteraction':require(_0xe1fb('0x23'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xe1fb('0x24')},'timeout':{'type':'number','message':_0xe1fb('0x25')}});function startRouting(_0x24c789,_0x3a95d9,_0x5494cd,_0x531cbd){if(_0x24c789&&_0x3a95d9&&_0x5494cd){_0x3a95d9[_0xe1fb('0x26')]+=0x1;var _0x107cd0={'uniqueid':_0x24c789,'from':_0x5494cd[_0xe1fb('0x27')]?_0x5494cd[_0xe1fb('0x27')][_0xe1fb('0xf')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5494cd['contact']?_0x5494cd[_0xe1fb('0x28')]['id']:null,'ListId':_0x5494cd[_0xe1fb('0x29')]?_0x5494cd[_0xe1fb('0x29')]['id']:null};_0x107cd0[_[_0xe1fb('0x2a')](_0x5494cd['channel'])+'QueueId']=_0x3a95d9['id']||null;_0x107cd0[_[_0xe1fb('0x2a')](_0x5494cd[_0xe1fb('0x2b')])+'InteractionId']=_0x5494cd['interaction']?_0x5494cd[_0xe1fb('0x2c')]['id']:null;_0x107cd0[_[_0xe1fb('0x2a')](_0x5494cd[_0xe1fb('0x2b')])+_0xe1fb('0x2d')]=_0x5494cd[_0xe1fb('0x2e')]?_0x5494cd[_0xe1fb('0x2e')]['id']:null;_0x107cd0[_[_0xe1fb('0x2a')](_0x5494cd[_0xe1fb('0x2b')])+(_0x5494cd[_0xe1fb('0x2b')]!==_0xe1fb('0x2f')?_0xe1fb('0x30'):_0xe1fb('0x31'))]=_0x5494cd['account']?_0x5494cd[_0xe1fb('0xe')]['id']:null;logger[_0xe1fb('0x32')](util[_0xe1fb('0x14')](_0xe1fb('0x33'),_0x24c789,_0x3a95d9[_0xe1fb('0x34')]));emitChannelQueueInteraction(_0x5494cd['channel'],_0x3a95d9[_0xe1fb('0x34')],_0x107cd0,_0x5494cd[_0xe1fb('0xe')]['name'],_0x5494cd[_0xe1fb('0x2e')]['id'],!![],_0x531cbd,_0x3a95d9['id']);if(rpc[_0x5494cd[_0xe1fb('0x2b')]+'QueueReport']){return rpc[_0x5494cd[_0xe1fb('0x2b')]+_0xe1fb('0x35')][_0xe1fb('0x36')](_0x107cd0)[_0xe1fb('0x37')](function(_0x1d1413){logger[_0xe1fb('0x38')]('create\x20queue\x20report',_0x1d1413);});}}}function stopRouting(_0x46d236,_0x1b77ee,_0x28c299,_0x5390af){if(_0x46d236&&_0x1b77ee){_0x1b77ee[_0xe1fb('0x26')]-=0x1;var _0x150276={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xe1fb('0x14')](_0xe1fb('0x39')),'reason':_0xe1fb('0x3a')};logger['info'](util[_0xe1fb('0x14')]('[%s][STOP:QUEUE][NAME:%s]',_0x46d236,_0x1b77ee[_0xe1fb('0x34')]));emitChannelQueueInteraction(_0x28c299[_0xe1fb('0x2b')],_0x1b77ee['name'],_0x28c299[_0xe1fb('0x27')],_0x28c299[_0xe1fb('0xe')][_0xe1fb('0x34')],_0x28c299[_0xe1fb('0x2e')]['id'],![],_0x5390af,_0x1b77ee['id']);return rpc[_0x28c299['channel']+_0xe1fb('0x3b')][_0xe1fb('0x3c')](_0x28c299[_0xe1fb('0x2c')]['id'],{'queueId':_0x1b77ee['id']})['then'](function(){if(rpc[_0x28c299['channel']+'QueueReport']){return rpc[_0x28c299['channel']+_0xe1fb('0x35')][_0xe1fb('0x3c')](_0x46d236,_0x150276)[_0xe1fb('0x37')](function(_0xd5011f){logger[_0xe1fb('0x38')](_0xe1fb('0x3d'),_0xd5011f);});}});}}function endRouting(_0x2c2140,_0x2cab45,_0x1db729,_0x3a5408){if(_0x2c2140&&_0x2cab45){_0x2cab45['waiting']-=0x1;var _0x4d126f={'leaveAt':moment()[_0xe1fb('0x14')](_0xe1fb('0x39')),'exitAt':moment()[_0xe1fb('0x14')](_0xe1fb('0x39')),'reason':_0xe1fb('0x3e')};logger[_0xe1fb('0x32')](util[_0xe1fb('0x14')](_0xe1fb('0x3f'),_0x2c2140,_0x2cab45['name']));emitChannelQueueInteraction(_0x1db729[_0xe1fb('0x2b')],_0x2cab45[_0xe1fb('0x34')],_0x1db729[_0xe1fb('0x27')],_0x1db729[_0xe1fb('0xe')][_0xe1fb('0x34')],_0x1db729[_0xe1fb('0x2e')]['id'],![],_0x3a5408);if(rpc[_0x1db729[_0xe1fb('0x2b')]+_0xe1fb('0x35')]){return rpc[_0x1db729[_0xe1fb('0x2b')]+'QueueReport'][_0xe1fb('0x3c')](_0x2c2140,_0x4d126f)[_0xe1fb('0x37')](function(_0x2c834b){logger['error'](_0xe1fb('0x3d'),_0x2c834b);});}}}function handleFindQueue(_0x2380fa){return function(_0x19556f){return _0x19556f[_0xe1fb('0x34')][_0xe1fb('0x40')]()===_0x2380fa['toLowerCase']();};}exports[_0xe1fb('0x41')]=function(_0x36aaec,_0x8fd960,_0x54f7df,_0x1f9776){return function(_0x13ccb4){try{var _0x10a514={'name':_0x8fd960[0x0],'timeout':_0x8fd960[0x1]};var _0x2dcc2f=queue[_0xe1fb('0x0')](_0x10a514,{'typecast':!![]});if(_0x2dcc2f[_0xe1fb('0x42')]){logger[_0xe1fb('0x38')](_0xe1fb('0x43'),_0x36aaec,_[_0xe1fb('0x44')](_0x2dcc2f,_0xe1fb('0x2e'))[_0xe1fb('0x45')](',\x20'));_0x13ccb4[_0xe1fb('0x46')]();}else{var _0x4f7e1e=_[_0xe1fb('0x47')](_0x54f7df[_0x1f9776[_0xe1fb('0x2b')]+_0xe1fb('0x48')],handleFindQueue(_0x10a514['name']));if(_0x4f7e1e){startRouting(_0x36aaec,_0x4f7e1e,_0x1f9776,_0x54f7df);var _0x5d4852=(_0x4f7e1e[_0xe1fb('0x3e')]||0xa)*0x3e8;var _0x3752f3=(_0x10a514['timeout']||0x14)*0x3e8;var _0x4bf469;if(_0x5d4852>_0x3752f3){_0x3752f3=_0x5d4852;}var _0x4d7eb4=seqqueue[_0xe1fb('0x49')](_0x5d4852);_0x4d7eb4['id']=_0x36aaec;_0x4d7eb4[_0xe1fb('0x4a')]=_0x5d4852;_0x4d7eb4[_0xe1fb('0x4b')]=_0x3752f3;_0x4d7eb4[_0xe1fb('0x2b')]=_0x1f9776[_0xe1fb('0x2b')];_0x54f7df['rules'][_0x36aaec]['on'](_0xe1fb('0x4c'),function(){logger[_0xe1fb('0x32')](_0xe1fb('0x4d'),_0x36aaec);stopRouting(_0x36aaec,_0x4f7e1e,_0x1f9776,_0x54f7df);clearTimeout(_0x4bf469);_0x4bf469=undefined;_0x4d7eb4['close'](!![]);if(_0x54f7df[_0xe1fb('0x4e')][_0x36aaec]){delete _0x54f7df[_0xe1fb('0x4e')][_0x36aaec];}_0x13ccb4[_0xe1fb('0x46')]();});_0x54f7df[_0xe1fb('0x4e')][_0x36aaec]['on']('complete',function(){if(_0x54f7df[_0xe1fb('0x4e')][_0x36aaec]){delete _0x54f7df['rules'][_0x36aaec];}});_0x4bf469=setTimeout(function(){logger[_0xe1fb('0x32')](_0xe1fb('0x4f'),_0x36aaec);endRouting(_0x36aaec,_0x4f7e1e,_0x1f9776,_0x54f7df);clearTimeout(_0x4bf469);_0x4d7eb4['close'](!![]);_0x13ccb4['next']();},_0x3752f3);switch(_0x4f7e1e[_0xe1fb('0x50')]){case _0xe1fb('0x51'):strategy[_0xe1fb('0x51')](_0x4d7eb4,_0x4f7e1e,_0x54f7df,_0x1f9776);break;default:strategy[_0xe1fb('0x52')](_0x4d7eb4,_0x4f7e1e,_0x54f7df,_0x1f9776);}}else{logger[_0xe1fb('0x38')](_0xe1fb('0x53'),_0x36aaec,_0x10a514['name']);_0x13ccb4['stop']();}}}catch(_0x585452){logger[_0xe1fb('0x38')](_0xe1fb('0x43'),_0x36aaec,_0x585452[_0xe1fb('0x54')]);_0x13ccb4[_0xe1fb('0x46')]();}};}; \ 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 0415786..b58dae5 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 _0xdb94=['agents','channel','busy','busyQueue','showNotification','notificationId','writeLog','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','exports','uuid','./util','routing','squeue','realtime','push','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xdb94,0xe5));var _0x4db9=function(_0x321b25,_0x558ca2){_0x321b25=_0x321b25-0x0;var _0x16516e=_0xdb94[_0x321b25];return _0x16516e;};'use strict';var _=require('lodash');var uuid=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var logger=require('../../../../../config/logger')(_0x4db9('0x2'));var Agent=function(_0x3b24a6,_0x25b510,_0x2e85f4,_0x1f05d4){this['notificationId']=uuid['v4']();this[_0x4db9('0x3')]=_0x3b24a6;this['agent']=_0x25b510;this[_0x4db9('0x4')]=_0x2e85f4;this[_0x4db9('0x2')]=_0x1f05d4;this[_0x4db9('0x3')][_0x4db9('0x5')](this[_0x4db9('0x6')]['bind'](this),this[_0x4db9('0x7')][_0x4db9('0x8')](this));this[_0x4db9('0x3')]['on'](_0x4db9('0x9'),this[_0x4db9('0x7')]['bind'](this));this[_0x4db9('0x3')]['on'](_0x4db9('0xa'),this[_0x4db9('0xb')][_0x4db9('0x8')](this));};Agent[_0x4db9('0xc')][_0x4db9('0x5')]=function(){this['squeue'][_0x4db9('0x5')](this[_0x4db9('0x6')]['bind'](this),this['handleTimeout'][_0x4db9('0x8')](this));};Agent[_0x4db9('0xc')][_0x4db9('0xb')]=function(){this['handleTimeout'](!![]);};Agent[_0x4db9('0xc')][_0x4db9('0x6')]=function(){logger[_0x4db9('0xd')](_0x4db9('0xe'),this[_0x4db9('0x3')]['id'],this['agent']['id']);if(_[_0x4db9('0xf')](this[_0x4db9('0x4')]['agents'][this[_0x4db9('0x10')]['id']])){logger[_0x4db9('0xd')](_0x4db9('0x11'),this['squeue']['id'],this[_0x4db9('0x10')]['id']);setTimeout(this[_0x4db9('0x5')]['bind'](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0x4db9('0x12')](this[_0x4db9('0x3')]['id'],this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']],this[_0x4db9('0x3')][_0x4db9('0x14')],![])){this[_0x4db9('0x4')][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']][_0x4db9('0x15')]=!![];this[_0x4db9('0x4')][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']][_0x4db9('0x16')]=undefined;util['saveWaitingNotification'](this[_0x4db9('0x4')],this[_0x4db9('0x2')],this['agent'],this[_0x4db9('0x3')][_0x4db9('0x14')]);util[_0x4db9('0x17')](this[_0x4db9('0x18')],this['squeue']['id'],this[_0x4db9('0x4')]['agents'][this[_0x4db9('0x10')]['id']],null,this[_0x4db9('0x2')]);util[_0x4db9('0x19')](this[_0x4db9('0x3')]['id'],this[_0x4db9('0x4')][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']],'RINGING'+(this['routing'][_0x4db9('0x1a')]?':FORCED':''));}else{logger[_0x4db9('0xd')](_0x4db9('0x1b'),this[_0x4db9('0x3')]['id'],this[_0x4db9('0x10')]['id']);setTimeout(this[_0x4db9('0x5')][_0x4db9('0x8')](this),0x3e8);}}};Agent[_0x4db9('0xc')][_0x4db9('0x7')]=function(_0x4c4a47){if(_[_0x4db9('0xf')](this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']])){return logger[_0x4db9('0xd')](_0x4db9('0x11'),this[_0x4db9('0x3')]['id'],this['agent']['id']);}else{logger[_0x4db9('0xd')](_0x4db9('0x1c'),this[_0x4db9('0x3')]['id'],this[_0x4db9('0x10')]['id']);util['hideNotification'](this['notificationId'],this[_0x4db9('0x3')]['id'],this[_0x4db9('0x4')]['agents'][this['agent']['id']],null,this[_0x4db9('0x2')]);this['realtime']['agents'][this[_0x4db9('0x10')]['id']][_0x4db9('0x15')]=![];this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']][_0x4db9('0x16')]=undefined;util[_0x4db9('0x1d')](this['realtime'],this[_0x4db9('0x2')],this['agent'],this['squeue']['channel']);util[_0x4db9('0x19')](this[_0x4db9('0x3')]['id'],this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']],_0x4c4a47?'STOP':'TIMEOUT');}if(!_0x4c4a47){setTimeout(this['push'][_0x4db9('0x8')](this),0x3e8);}};function agent(_0x52613e,_0x29dc69,_0x52711a,_0xaf383e){return new Agent(_0x52613e,_0x29dc69,_0x52711a,_0xaf383e);}module[_0x4db9('0x1e')]=agent; \ No newline at end of file +var _0x56a4=['saveWaitingNotification','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busy','removeWaitingNotification','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','agent','handleRun','bind','handleTimeout','drained','handleDrained','prototype','push','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busyQueue'];(function(_0x49157b,_0x5d8601){var _0x3ea5d4=function(_0x4c2905){while(--_0x4c2905){_0x49157b['push'](_0x49157b['shift']());}};_0x3ea5d4(++_0x5d8601);}(_0x56a4,0x11b));var _0x456a=function(_0x13b70f,_0x5c1116){_0x13b70f=_0x13b70f-0x0;var _0x51427c=_0x56a4[_0x13b70f];return _0x51427c;};'use strict';var _=require(_0x456a('0x0'));var uuid=require(_0x456a('0x1'));var util=require('./util');var logger=require(_0x456a('0x2'))(_0x456a('0x3'));var Agent=function(_0x5f3fe1,_0x478cac,_0x26a7c6,_0x3a11ee){this[_0x456a('0x4')]=uuid['v4']();this[_0x456a('0x5')]=_0x5f3fe1;this[_0x456a('0x6')]=_0x478cac;this['realtime']=_0x26a7c6;this[_0x456a('0x3')]=_0x3a11ee;this['squeue']['push'](this[_0x456a('0x7')][_0x456a('0x8')](this),this[_0x456a('0x9')]['bind'](this));this[_0x456a('0x5')]['on']('timeout',this[_0x456a('0x9')][_0x456a('0x8')](this));this[_0x456a('0x5')]['on'](_0x456a('0xa'),this[_0x456a('0xb')][_0x456a('0x8')](this));};Agent[_0x456a('0xc')][_0x456a('0xd')]=function(){this[_0x456a('0x5')][_0x456a('0xd')](this[_0x456a('0x7')]['bind'](this),this[_0x456a('0x9')]['bind'](this));};Agent['prototype'][_0x456a('0xb')]=function(){this[_0x456a('0x9')](!![]);};Agent[_0x456a('0xc')][_0x456a('0x7')]=function(){logger['debug'](_0x456a('0xe'),this[_0x456a('0x5')]['id'],this[_0x456a('0x6')]['id']);if(_[_0x456a('0xf')](this[_0x456a('0x10')][_0x456a('0x11')][this['agent']['id']])){logger[_0x456a('0x12')](_0x456a('0x13'),this[_0x456a('0x5')]['id'],this[_0x456a('0x6')]['id']);setTimeout(this['push'][_0x456a('0x8')](this),0x3e8);}else{if(this[_0x456a('0x3')][_0x456a('0x14')]||util['isAgentAvailable'](this[_0x456a('0x5')]['id'],this['realtime']['agents'][this[_0x456a('0x6')]['id']],this['squeue'][_0x456a('0x15')],![])){this['realtime'][_0x456a('0x11')][this[_0x456a('0x6')]['id']]['busy']=!![];this['realtime']['agents'][this[_0x456a('0x6')]['id']][_0x456a('0x16')]=undefined;util[_0x456a('0x17')](this['realtime'],this[_0x456a('0x3')],this['agent'],this['squeue']['channel']);util[_0x456a('0x18')](this[_0x456a('0x4')],this[_0x456a('0x5')]['id'],this['realtime'][_0x456a('0x11')][this[_0x456a('0x6')]['id']],null,this['routing']);util[_0x456a('0x19')](this['squeue']['id'],this['realtime'][_0x456a('0x11')][this['agent']['id']],_0x456a('0x1a')+(this['routing'][_0x456a('0x14')]?_0x456a('0x1b'):''));}else{logger[_0x456a('0x12')](_0x456a('0x1c'),this[_0x456a('0x5')]['id'],this[_0x456a('0x6')]['id']);setTimeout(this[_0x456a('0xd')][_0x456a('0x8')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x48205d){if(_[_0x456a('0xf')](this[_0x456a('0x10')]['agents'][this[_0x456a('0x6')]['id']])){return logger[_0x456a('0x12')](_0x456a('0x13'),this[_0x456a('0x5')]['id'],this[_0x456a('0x6')]['id']);}else{logger['debug'](_0x456a('0x1d'),this[_0x456a('0x5')]['id'],this[_0x456a('0x6')]['id']);util['hideNotification'](this[_0x456a('0x4')],this[_0x456a('0x5')]['id'],this['realtime'][_0x456a('0x11')][this[_0x456a('0x6')]['id']],null,this[_0x456a('0x3')]);this[_0x456a('0x10')][_0x456a('0x11')][this['agent']['id']][_0x456a('0x1e')]=![];this[_0x456a('0x10')][_0x456a('0x11')][this['agent']['id']]['busyQueue']=undefined;util[_0x456a('0x1f')](this['realtime'],this['routing'],this['agent'],this[_0x456a('0x5')][_0x456a('0x15')]);util[_0x456a('0x19')](this[_0x456a('0x5')]['id'],this['realtime'][_0x456a('0x11')][this[_0x456a('0x6')]['id']],_0x48205d?'STOP':_0x456a('0x20'));}if(!_0x48205d){setTimeout(this[_0x456a('0xd')][_0x456a('0x8')](this),0x3e8);}};function agent(_0x289c99,_0x97fda1,_0x5113da,_0x41d36d){return new Agent(_0x289c99,_0x97fda1,_0x5113da,_0x41d36d);}module[_0x456a('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 da1589c..9503b83 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 _0x4440=['busyQueue','name','saveWaitingNotification','debug','hideNotification','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','realtime','push','handleRun','bind','handleTimeout','squeue','drained','handleDrained','prototype','isNil','queue','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy'];(function(_0x5f284b,_0x4c8928){var _0x283585=function(_0x561adf){while(--_0x561adf){_0x5f284b['push'](_0x5f284b['shift']());}};_0x283585(++_0x4c8928);}(_0x4440,0xc7));var _0x0444=function(_0xfe1386,_0x4cf0d4){_0xfe1386=_0xfe1386-0x0;var _0x42b267=_0x4440[_0xfe1386];return _0x42b267;};'use strict';var _=require(_0x0444('0x0'));var uuid=require(_0x0444('0x1'));var util=require('./util');var logger=require(_0x0444('0x2'))(_0x0444('0x3'));var Beepall=function(_0x48ca59,_0x3b4808,_0x1a5fa7,_0x657c89){this[_0x0444('0x4')]=uuid['v4']();this['squeue']=_0x48ca59;this['queue']=_0x3b4808;this[_0x0444('0x5')]=_0x1a5fa7;this[_0x0444('0x3')]=_0x657c89;this['squeue'][_0x0444('0x6')](this[_0x0444('0x7')][_0x0444('0x8')](this),this[_0x0444('0x9')][_0x0444('0x8')](this));this[_0x0444('0xa')]['on']('timeout',this[_0x0444('0x9')][_0x0444('0x8')](this));this['squeue']['on'](_0x0444('0xb'),this[_0x0444('0xc')][_0x0444('0x8')](this));};Beepall[_0x0444('0xd')][_0x0444('0x6')]=function(){this[_0x0444('0xa')]['push'](this[_0x0444('0x7')][_0x0444('0x8')](this),this[_0x0444('0x9')][_0x0444('0x8')](this));};Beepall[_0x0444('0xd')][_0x0444('0xc')]=function(){this['handleTimeout'](!![]);};Beepall[_0x0444('0xd')][_0x0444('0x7')]=function(){var _0x2575d9=!![];if(!_[_0x0444('0xe')](this[_0x0444('0xf')])&&!_[_0x0444('0xe')](this[_0x0444('0xf')]['Agents'])&&this[_0x0444('0xf')][_0x0444('0x10')][_0x0444('0x11')]>0x0){for(var _0x5eae31=0x0,_0x461b5e;_0x5eae310x0){for(var _0x5c85f6=0x0,_0x51cf22;_0x5c85f60x0&&_0x2cbe81[_0x584779+_0xe7fe('0x24')]>=_0x2cbe81[_0x584779+_0xe7fe('0x23')]){writeLog(_0x3c3945,_0x2cbe81,_0x584779[_0xe7fe('0x25')]()+_0xe7fe('0x26'));return![];}}return!![];};exports[_0xe7fe('0x27')]=function(_0x3256be,_0x34652a,_0x452af3,_0x218dbd,_0x21504b){return sendNotification(!![],_0x3256be,_0x34652a,_0x452af3,_0x218dbd,_0x21504b);};exports[_0xe7fe('0x28')]=function(_0x22909d,_0x5d464e,_0x1d230d,_0x536bd9,_0x28d237){return sendNotification(![],_0x22909d,_0x5d464e,_0x1d230d,_0x536bd9,_0x28d237);};exports[_0xe7fe('0x29')]=function(_0x5a8650,_0x48fa94,_0x2adb68){var _0x115208=_0x48fa94[_0xe7fe('0x2a')][_0xe7fe('0x2b')];if(!_0x115208&&_0x2adb68){_0x115208=_0x2adb68['id'];}var _0x174b14=_['some'](_0x5a8650[_0x48fa94[_0xe7fe('0x2c')]+_0xe7fe('0x2d')],function(_0x48962d){var _0x4dcd4a=_[_0xe7fe('0x2e')](_0x48fa94[_0xe7fe('0x2c')])+'InteractionId';return _0x48962d[_0x4dcd4a]===_0x48fa94['interaction']['id'];});if(!_0x174b14&&_0x115208&&_0x5a8650[_0xe7fe('0x2f')][_0x115208]){_0x174b14=_['some'](_0x5a8650[_0xe7fe('0x2f')][_0x115208][_0x48fa94[_0xe7fe('0x2c')]+'WaitingInteractions'],function(_0x4cb436){return _0x4cb436['id']===_0x48fa94[_0xe7fe('0x2a')]['id'];});}return _0x174b14;};exports[_0xe7fe('0x30')]=function(_0x197893,_0xfcb0bd,_0xcb205b,_0x1e5f4b){if(_0xcb205b&&_0xcb205b['id']&&_0x197893[_0xe7fe('0x2f')]&&_0x197893[_0xe7fe('0x2f')][_0xcb205b['id']]){_0x197893[_0xe7fe('0x2f')][_0xcb205b['id']][_0x1e5f4b+_0xe7fe('0x31')][_0xfcb0bd['message']['id']]={'id':_0xfcb0bd[_0xe7fe('0x2a')]['id']};}};exports[_0xe7fe('0x32')]=function(_0x1d5ae1,_0x155556,_0x301ea2,_0x330d18){if(_0x301ea2&&_0x301ea2['id']&&_0x1d5ae1[_0xe7fe('0x2f')]&&_0x1d5ae1[_0xe7fe('0x2f')][_0x301ea2['id']]){delete _0x1d5ae1[_0xe7fe('0x2f')][_0x301ea2['id']][_0x330d18+_0xe7fe('0x31')][_0x155556[_0xe7fe('0x15')]['id']];}};exports[_0xe7fe('0x33')]=writeLog; \ No newline at end of file +var _0x2630=['online','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','message','removeWaitingNotification','WaitingInteractions','writeLog','lodash','util','../utils','../../../../../config/logger','routing','redis','defaults','localhost','split','\x20interaction','name','account','body','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','emit','notification:%s','remove','debug','isAgentAvailable','BUSY'];(function(_0x465c0e,_0x1ddf67){var _0x4415d3=function(_0xe51901){while(--_0xe51901){_0x465c0e['push'](_0x465c0e['shift']());}};_0x4415d3(++_0x1ddf67);}(_0x2630,0x79));var _0x0263=function(_0x419652,_0x1e3385){_0x419652=_0x419652-0x0;var _0x41661a=_0x2630[_0x419652];return _0x41661a;};'use strict';var _=require(_0x0263('0x0'));var util=require(_0x0263('0x1'));var utils=require(_0x0263('0x2'));var Redis=require('ioredis');var config=require('../../../../../config/environment');var logger=require(_0x0263('0x3'))(_0x0263('0x4'));config[_0x0263('0x5')]=_[_0x0263('0x6')](config[_0x0263('0x5')],{'host':_0x0263('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0263('0x5')]));function sendNotification(_0x1b8949,_0x49f6bd,_0x8053d9,_0xa22866,_0x3f1327,_0x18e639){var _0x445e08=_0x18e639||{};var _0x4b99bf=_0x8053d9[_0x0263('0x8')]('.');var _0x2830bd={'uniqueid':_0x49f6bd,'channel':_0x4b99bf[0x0],'id':_0x4b99bf[0x1],'title':_0x4b99bf[0x0]+_0x0263('0x9'),'interactionId':_0x4b99bf[0x2],'queue':_0x3f1327?_0x3f1327[_0x0263('0xa')]:null,'sound':_0x445e08[_0x0263('0xb')]['notificationSound'],'shake':_0x445e08[_0x0263('0xb')]['notificationShake']};try{if(!_0x445e08[_0x0263('0xc')]){_0x445e08[_0x0263('0xc')]={};}if(_0x3f1327){_0x445e08[_0x0263('0xc')]['queue']=_0x3f1327;}else if(_0x445e08[_0x0263('0xc')]['queue']){delete _0x445e08[_0x0263('0xc')]['queue'];}_0x2830bd[_0x0263('0xd')]=utils[_0x0263('0xe')](_0x445e08[_0x0263('0xb')][_0x0263('0xf')],_0x445e08);}catch(_0x192a23){_0x2830bd[_0x0263('0xd')]=_0x0263('0x10');logger[_0x0263('0x11')](util[_0x0263('0x12')](_0x0263('0x13'),_0x49f6bd,_0x192a23['message']));}io['to'](util['format']('user:%s',_0xa22866['name']))[_0x0263('0x14')](util['format'](_0x0263('0x15'),_0x1b8949?'save':_0x0263('0x16')),_0x2830bd);}function writeLog(_0x4955f1,_0x247658,_0x4e6aa3){return logger[_0x0263('0x17')](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x4955f1,_0x247658[_0x0263('0xa')],_0x4e6aa3));}exports[_0x0263('0x18')]=function(_0x167ee2,_0x40416b,_0x393d9f,_0x1e2311){if(_0x40416b['busy']){writeLog(_0x167ee2,_0x40416b,_0x0263('0x19'));return![];}if(!_0x40416b[_0x0263('0x1a')]){writeLog(_0x167ee2,_0x40416b,_0x0263('0x1b'));return![];}if(_0x40416b[_0x393d9f+_0x0263('0x1c')]){writeLog(_0x167ee2,_0x40416b,_0x0263('0x1d'));return![];}if(_0x1e2311&&_0x40416b[_0x0263('0x1e')](_0x393d9f+'Capacity')&&_0x40416b[_0x0263('0x1e')](_0x393d9f+_0x0263('0x1f'))){if(_0x40416b[_0x393d9f+_0x0263('0x20')]>0x0&&_0x40416b[_0x393d9f+_0x0263('0x1f')]>=_0x40416b[_0x393d9f+_0x0263('0x20')]){writeLog(_0x167ee2,_0x40416b,_0x393d9f[_0x0263('0x21')]()+_0x0263('0x22'));return![];}}return!![];};exports['showNotification']=function(_0x305018,_0x3ec532,_0x41b743,_0x1a15bc,_0x26e66c){return sendNotification(!![],_0x305018,_0x3ec532,_0x41b743,_0x1a15bc,_0x26e66c);};exports[_0x0263('0x23')]=function(_0x3ef70f,_0x2552d2,_0x1e7296,_0x333184,_0x121f50){return sendNotification(![],_0x3ef70f,_0x2552d2,_0x1e7296,_0x333184,_0x121f50);};exports[_0x0263('0x24')]=function(_0x30d1f0,_0x52a2f5,_0x508cfc){var _0x1c331d=_0x52a2f5[_0x0263('0x25')][_0x0263('0x26')];if(!_0x1c331d&&_0x508cfc){_0x1c331d=_0x508cfc['id'];}var _0x4485a8=_[_0x0263('0x27')](_0x30d1f0[_0x52a2f5[_0x0263('0x28')]+_0x0263('0x29')],function(_0x2033ca){var _0x273d6f=_[_0x0263('0x2a')](_0x52a2f5[_0x0263('0x28')])+_0x0263('0x2b');return _0x2033ca[_0x273d6f]===_0x52a2f5[_0x0263('0x25')]['id'];});if(!_0x4485a8&&_0x1c331d&&_0x30d1f0['agents'][_0x1c331d]){_0x4485a8=_[_0x0263('0x27')](_0x30d1f0[_0x0263('0x2c')][_0x1c331d][_0x52a2f5[_0x0263('0x28')]+'WaitingInteractions'],function(_0x313591){return _0x313591['id']===_0x52a2f5['interaction']['id'];});}return _0x4485a8;};exports['saveWaitingNotification']=function(_0x1a01eb,_0x22f86a,_0x281cf4,_0x22db35){if(_0x281cf4&&_0x281cf4['id']&&_0x1a01eb[_0x0263('0x2c')]&&_0x1a01eb['agents'][_0x281cf4['id']]){_0x1a01eb['agents'][_0x281cf4['id']][_0x22db35+'WaitingInteractions'][_0x22f86a[_0x0263('0x2d')]['id']]={'id':_0x22f86a['interaction']['id']};}};exports[_0x0263('0x2e')]=function(_0x106cee,_0x518aa6,_0x5e8e1c,_0x2d661e){if(_0x5e8e1c&&_0x5e8e1c['id']&&_0x106cee[_0x0263('0x2c')]&&_0x106cee[_0x0263('0x2c')][_0x5e8e1c['id']]){delete _0x106cee[_0x0263('0x2c')][_0x5e8e1c['id']][_0x2d661e+_0x0263('0x2f')][_0x518aa6[_0x0263('0x2d')]['id']];}};exports[_0x0263('0x30')]=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 9406834..59d8599 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 _0x5615=['replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','validate','shelljs','../../../../config/logger','routing','string','consequence','length','[%s][SYSTEM]\x20%s','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x5615,0xa0));var _0x5561=function(_0x279a51,_0xf5640b){_0x279a51=_0x279a51-0x0;var _0x29c2b5=_0x5615[_0x279a51];return _0x29c2b5;};'use strict';var schema=require(_0x5561('0x0'));var sh=require(_0x5561('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0x5561('0x2'))(_0x5561('0x3'));var system=schema({'command':{'type':_0x5561('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x5561('0x5')]=function(_0x389854,_0x35f851){return function(_0x4b281a){try{var _0x3aaddb={'command':_0x35f851[0x0]};var _0x1ef83c=system[_0x5561('0x0')](_0x3aaddb,{'typecast':!![]});if(_0x1ef83c[_0x5561('0x6')]){logger['error'](_0x5561('0x7'),_0x389854,_['map'](_0x1ef83c,_0x5561('0x8'))['join'](',\x20'));logger[_0x5561('0x9')](_0x5561('0xa'),_0x389854);_0x4b281a[_0x5561('0xb')]();}else{var _0x30bac3=this;var _0x4fcb27=utils[_0x5561('0xc')](_0x35f851[0x0],this);logger['info'](_0x5561('0xd'),_0x389854,_0x4fcb27);sh['exec'](_[_0x5561('0xe')](_0x4fcb27),function(_0x15f695,_0x346689){logger[_0x5561('0x9')](_0x5561('0xf'),_0x389854,_0x15f695);if(_0x15f695==0x0){var _0x2428e7=_0x346689[_0x5561('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x5561('0x11')](_0x35f851[0x1])||_[_0x5561('0x12')](_0x35f851[0x1])){logger[_0x5561('0x9')]('[%s][SYSTEM]\x20no\x20variable',_0x389854);_0x30bac3[_0x5561('0x13')][_0x35f851[0x1]]=_0x2428e7;}else{logger[_0x5561('0x9')](_0x5561('0x14'),_0x389854,_0x35f851[0x1],_0x2428e7);_0x30bac3[_0x5561('0x13')][_0x35f851[0x1]]=_0x2428e7;}}_0x4b281a['next']();});}}catch(_0x1b18f1){logger[_0x5561('0x15')](_0x5561('0x7'),_0x389854,_['isObject'](_0x1b18f1)?JSON['stringify'](_0x1b18f1):_0x1b18f1);logger[_0x5561('0x9')](_0x5561('0xa'),_0x389854);_0x4b281a[_0x5561('0xb')]();}};}; \ No newline at end of file +var _0xd2c4=['routing','string','consequence','validate','length','[%s][SYSTEM]\x20%s','map','message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','lodash','./utils','../../../../config/logger'];(function(_0x406115,_0x19f7a1){var _0xbbabdb=function(_0x28554d){while(--_0x28554d){_0x406115['push'](_0x406115['shift']());}};_0xbbabdb(++_0x19f7a1);}(_0xd2c4,0x110));var _0x4d2c=function(_0x3b413c,_0x59c11d){_0x3b413c=_0x3b413c-0x0;var _0x2db3b6=_0xd2c4[_0x3b413c];return _0x2db3b6;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x4d2c('0x0'));var utils=require(_0x4d2c('0x1'));var logger=require(_0x4d2c('0x2'))(_0x4d2c('0x3'));var system=schema({'command':{'type':_0x4d2c('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x4d2c('0x5')]=function(_0x57047f,_0x3cd718){return function(_0x3fe95b){try{var _0x134ef0={'command':_0x3cd718[0x0]};var _0x42dfff=system[_0x4d2c('0x6')](_0x134ef0,{'typecast':!![]});if(_0x42dfff[_0x4d2c('0x7')]){logger['error'](_0x4d2c('0x8'),_0x57047f,_[_0x4d2c('0x9')](_0x42dfff,_0x4d2c('0xa'))[_0x4d2c('0xb')](',\x20'));logger[_0x4d2c('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x57047f);_0x3fe95b[_0x4d2c('0xd')]();}else{var _0x100d77=this;var _0x19b827=utils[_0x4d2c('0xe')](_0x3cd718[0x0],this);logger[_0x4d2c('0xc')](_0x4d2c('0xf'),_0x57047f,_0x19b827);sh[_0x4d2c('0x10')](_[_0x4d2c('0x11')](_0x19b827),function(_0x28cb74,_0x149955){logger['info'](_0x4d2c('0x12'),_0x57047f,_0x28cb74);if(_0x28cb74==0x0){var _0x573853=_0x149955[_0x4d2c('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x4d2c('0x14')](_0x3cd718[0x1])||_[_0x4d2c('0x15')](_0x3cd718[0x1])){logger[_0x4d2c('0xc')](_0x4d2c('0x16'),_0x57047f);_0x100d77['body'][_0x3cd718[0x1]]=_0x573853;}else{logger['info'](_0x4d2c('0x17'),_0x57047f,_0x3cd718[0x1],_0x573853);_0x100d77['body'][_0x3cd718[0x1]]=_0x573853;}}_0x3fe95b[_0x4d2c('0xd')]();});}}catch(_0x36124d){logger['error'](_0x4d2c('0x8'),_0x57047f,_['isObject'](_0x36124d)?JSON[_0x4d2c('0x18')](_0x36124d):_0x36124d);logger[_0x4d2c('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x57047f);_0x3fe95b[_0x4d2c('0xd')]();}};}; \ 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 bcc2fbb..b41aef7 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 _0x155b=['error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','catch','stringify','finally','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x558b27,_0x420951){var _0x1caf94=function(_0x3a8c3e){while(--_0x3a8c3e){_0x558b27['push'](_0x558b27['shift']());}};_0x1caf94(++_0x420951);}(_0x155b,0x1d0));var _0xb155=function(_0xf35672,_0x3833af){_0xf35672=_0xf35672-0x0;var _0x26afcf=_0x155b[_0xf35672];return _0x26afcf;};'use strict';var schema=require(_0xb155('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xb155('0x1')),'openchannelInteraction':require(_0xb155('0x2')),'smsInteraction':require(_0xb155('0x3')),'mailInteraction':require(_0xb155('0x4')),'faxInteraction':require(_0xb155('0x5')),'whatsappInteraction':require(_0xb155('0x6'))};var logger=require(_0xb155('0x7'))('routing');var tag=schema({'tag':{'type':_0xb155('0x8'),'required':!![],'message':_0xb155('0x9')}});exports[_0xb155('0xa')]=function(_0x58390a,_0x1ffd34,_0x20ce1a,_0x35c7b4){return function(_0x4b0943){try{var _0x20fc43={'tag':_0x1ffd34[0x0]};var _0x1e9e24=tag[_0xb155('0x0')](_0x20fc43,{'typecast':!![]});if(_0x1e9e24[_0xb155('0xb')]){logger[_0xb155('0xc')](_0xb155('0xd'),_0x58390a,_[_0xb155('0xe')](_0x1e9e24,_0xb155('0xf'))[_0xb155('0x10')](',\x20'));logger[_0xb155('0x11')](_0xb155('0x12'),_0x58390a);_0x4b0943[_0xb155('0x13')]();}else{var _0x4d034f={'ids':[_0x1ffd34[0x0]]};if(rpc[_0x35c7b4[_0xb155('0x14')]+'Interaction']){rpc[_0x35c7b4['channel']+_0xb155('0x15')]['addTags'](_0x35c7b4[_0xb155('0x16')]['id'],_0x4d034f)[_0xb155('0x17')](function(_0x2b55d6){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x58390a,_0x1ffd34[0x1],_0x35c7b4['channel'],_0x35c7b4[_0xb155('0x16')]['id']);})[_0xb155('0x18')](function(_0x5bbaa4){logger[_0xb155('0xc')](_0xb155('0xd'),_0x58390a,JSON[_0xb155('0x19')](_0x5bbaa4));logger[_0xb155('0x11')](_0xb155('0x12'),_0x58390a);})[_0xb155('0x1a')](function(){_0x4b0943[_0xb155('0x13')]();});}}}catch(_0x448ec9){logger[_0xb155('0xc')](_0xb155('0xd'),_0x58390a,_[_0xb155('0x1b')](_0x448ec9)?JSON[_0xb155('0x19')](_0x448ec9):_0x448ec9);logger[_0xb155('0x11')](_0xb155('0x12'),_0x58390a);_0x4b0943[_0xb155('0x13')]();}};}; \ No newline at end of file +var _0x1b93=['info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','message','join'];(function(_0x50a87d,_0x4731b4){var _0x36b11e=function(_0x2a05ca){while(--_0x2a05ca){_0x50a87d['push'](_0x50a87d['shift']());}};_0x36b11e(++_0x4731b4);}(_0x1b93,0xec));var _0x31b9=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x1b93[_0xefd519];return _0x4bb882;};'use strict';var schema=require(_0x31b9('0x0'));var _=require(_0x31b9('0x1'));var rpc={'chatInteraction':require(_0x31b9('0x2')),'openchannelInteraction':require(_0x31b9('0x3')),'smsInteraction':require(_0x31b9('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x31b9('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x31b9('0x6'))(_0x31b9('0x7'));var tag=schema({'tag':{'type':_0x31b9('0x8'),'required':!![],'message':_0x31b9('0x9')}});exports['consequence']=function(_0x2d5aad,_0x495416,_0x215ccb,_0x2ac982){return function(_0x238f5a){try{var _0x5741c4={'tag':_0x495416[0x0]};var _0x526001=tag[_0x31b9('0x0')](_0x5741c4,{'typecast':!![]});if(_0x526001['length']){logger[_0x31b9('0xa')](_0x31b9('0xb'),_0x2d5aad,_['map'](_0x526001,_0x31b9('0xc'))[_0x31b9('0xd')](',\x20'));logger[_0x31b9('0xe')](_0x31b9('0xf'),_0x2d5aad);_0x238f5a[_0x31b9('0x10')]();}else{var _0x49b900={'ids':[_0x495416[0x0]]};if(rpc[_0x2ac982[_0x31b9('0x11')]+_0x31b9('0x12')]){rpc[_0x2ac982['channel']+_0x31b9('0x12')][_0x31b9('0x13')](_0x2ac982[_0x31b9('0x14')]['id'],_0x49b900)['then'](function(_0x4d8c11){logger['info'](_0x31b9('0x15'),_0x2d5aad,_0x495416[0x1],_0x2ac982['channel'],_0x2ac982[_0x31b9('0x14')]['id']);})[_0x31b9('0x16')](function(_0xf58043){logger[_0x31b9('0xa')](_0x31b9('0xb'),_0x2d5aad,JSON[_0x31b9('0x17')](_0xf58043));logger[_0x31b9('0xe')](_0x31b9('0xf'),_0x2d5aad);})[_0x31b9('0x18')](function(){_0x238f5a['next']();});}}}catch(_0x39ebeb){logger[_0x31b9('0xa')](_0x31b9('0xb'),_0x2d5aad,_['isObject'](_0x39ebeb)?JSON[_0x31b9('0x17')](_0x39ebeb):_0x39ebeb);logger[_0x31b9('0xe')](_0x31b9('0xf'),_0x2d5aad);_0x238f5a['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 2011e17..1f2ed06 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d25=['replace','\x20-\x20','includes','urlOnAnswer','?params=','urlOnRing','jsonrpc','2.0','method','push','params','stringify','utf8','POST','application/json-rpc','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','then','info','stop','error','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence'];(function(_0x291947,_0x5d7a8e){var _0x40f240=function(_0x222fbf){while(--_0x222fbf){_0x291947['push'](_0x291947['shift']());}};_0x40f240(++_0x5d7a8e);}(_0x8d25,0xc1));var _0x58d2=function(_0x15b899,_0x531c4b){_0x15b899=_0x15b899-0x0;var _0x12ad71=_0x8d25[_0x15b899];return _0x12ad71;};'use strict';var rp=require(_0x58d2('0x0'));var logger=require(_0x58d2('0x1'))(_0x58d2('0x2'));var _=require(_0x58d2('0x3'));var arr=[];exports[_0x58d2('0x4')]=function(_0x1758f2,_0xcda1af){return function(_0x1c3f2d){var _0x2c4d83=_0xcda1af[0xa];var _0x1ad766=_0xcda1af[0xb];var _0x1a1640=_0xcda1af[0xc];var _0x33a355=_0xcda1af[0xd];var _0x434439=_0xcda1af[0xe];var _0x17cabf=_0xcda1af[0xf][_0x58d2('0x5')](/\n/g,_0x58d2('0x6'));var _0x19ffcc=_0xcda1af[0x10][_0x58d2('0x5')](/\n/g,'\x20');if(!arr[_0x58d2('0x7')](_0x1ad766)){arr['push'](_0x1ad766);var _0x48833a=_0xcda1af[0x3];var _0x262349=_0xcda1af[0x4];var _0x1e96c0=_0xcda1af[0x1];var _0x203820=_0xcda1af[0x0];var _0x77d130={};_0x77d130[_0x58d2('0x8')]=_0xcda1af[0x8]+_0x58d2('0x9')+_0x1a1640+'|'+_0x2c4d83+'|'+_0x33a355+'|'+_0x1ad766+'|'+_0x434439;_0x77d130[_0x58d2('0xa')]=_0xcda1af[0x7]+'?params='+_0x1a1640+'|'+_0x2c4d83+'|'+_0x33a355+'|'+_0x1ad766+'|'+_0x434439+'|'+_0x17cabf+'|'+_0x19ffcc;_0x77d130['title']=_0xcda1af[0x9];var _0x16501d={};_0x16501d[_0x58d2('0xb')]=_0x58d2('0xc');_0x16501d[_0x58d2('0xd')]='login';var _0x37ec60=[];_0x37ec60['push'](_0xcda1af[0x2]);_0x37ec60[_0x58d2('0xe')](_0xcda1af[0x5]);_0x37ec60[_0x58d2('0xe')](_0xcda1af[0x6]);_0x16501d[_0x58d2('0xf')]=_0x37ec60;_0x16501d['id']=0x1;var _0x2caf27=JSON[_0x58d2('0x10')](_0x16501d);var _0x10d639={'encoding':_0x58d2('0x11'),'method':_0x58d2('0x12'),'timeout':0x2710,'url':_0x48833a,'headers':{'Content-Type':_0x58d2('0x13')},'body':_0x2caf27};return rp(_0x10d639)['then'](function(_0x22b76f){const _0x29eedb=JSON[_0x58d2('0x14')](_0x22b76f);if(!_0x29eedb['result'][_0x58d2('0x15')]){throw new Error(_0x58d2('0x16'));}var _0x19a095=_0x1ad766;var _0x291682=_0x58d2('0x17')+_0x1e96c0+_0x58d2('0x18')+_0x203820+'&sessionId='+_0x19a095+_0x58d2('0x19')+JSON[_0x58d2('0x10')](_0x77d130);var _0x41a39f=_0x262349+'?'+_0x291682;return rp(_0x41a39f);})[_0x58d2('0x1a')](function(_0x29989d){logger[_0x58d2('0x1b')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x1758f2,_0x29989d);_0x1c3f2d[_0x58d2('0x1c')]();})['catch'](function(_0x198661){logger[_0x58d2('0x1d')](_0x58d2('0x1e'),_0x1758f2,_['isObject'](_0x198661)?JSON['stringify'](_0x198661):_0x198661);_0x1c3f2d[_0x58d2('0x1c')]();});}else{logger[_0x58d2('0x1b')](_0x58d2('0x1f'),_0x1758f2);_0x1c3f2d[_0x58d2('0x20')]();}};}; \ No newline at end of file +var _0x382d=['replace','\x20-\x20','includes','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','push','stringify','utf8','POST','application/json-rpc','then','parse','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','consequence'];(function(_0xc58cb4,_0xbf8e14){var _0x40251a=function(_0x782be3){while(--_0x782be3){_0xc58cb4['push'](_0xc58cb4['shift']());}};_0x40251a(++_0xbf8e14);}(_0x382d,0xab));var _0xd382=function(_0x2239c1,_0x5595e5){_0x2239c1=_0x2239c1-0x0;var _0x3cd347=_0x382d[_0x2239c1];return _0x3cd347;};'use strict';var rp=require(_0xd382('0x0'));var logger=require(_0xd382('0x1'))(_0xd382('0x2'));var _=require('lodash');var arr=[];exports[_0xd382('0x3')]=function(_0x561792,_0x1a243b){return function(_0x61e15e){var _0xb9935e=_0x1a243b[0xa];var _0x1bea4f=_0x1a243b[0xb];var _0x2556b1=_0x1a243b[0xc];var _0x5a0bde=_0x1a243b[0xd];var _0x34933c=_0x1a243b[0xe];var _0x303a74=_0x1a243b[0xf][_0xd382('0x4')](/\n/g,_0xd382('0x5'));var _0xcdb29e=_0x1a243b[0x10][_0xd382('0x4')](/\n/g,'\x20');if(!arr[_0xd382('0x6')](_0x1bea4f)){arr['push'](_0x1bea4f);var _0x265f48=_0x1a243b[0x3];var _0x36462d=_0x1a243b[0x4];var _0x4ab5a8=_0x1a243b[0x1];var _0x15412d=_0x1a243b[0x0];var _0xe4d3fe={};_0xe4d3fe[_0xd382('0x7')]=_0x1a243b[0x8]+_0xd382('0x8')+_0x2556b1+'|'+_0xb9935e+'|'+_0x5a0bde+'|'+_0x1bea4f+'|'+_0x34933c;_0xe4d3fe[_0xd382('0x9')]=_0x1a243b[0x7]+_0xd382('0x8')+_0x2556b1+'|'+_0xb9935e+'|'+_0x5a0bde+'|'+_0x1bea4f+'|'+_0x34933c+'|'+_0x303a74+'|'+_0xcdb29e;_0xe4d3fe[_0xd382('0xa')]=_0x1a243b[0x9];var _0x5b4e45={};_0x5b4e45[_0xd382('0xb')]=_0xd382('0xc');_0x5b4e45[_0xd382('0xd')]=_0xd382('0xe');var _0x194f2c=[];_0x194f2c[_0xd382('0xf')](_0x1a243b[0x2]);_0x194f2c[_0xd382('0xf')](_0x1a243b[0x5]);_0x194f2c[_0xd382('0xf')](_0x1a243b[0x6]);_0x5b4e45['params']=_0x194f2c;_0x5b4e45['id']=0x1;var _0x1f78dd=JSON[_0xd382('0x10')](_0x5b4e45);var _0x3e47cc={'encoding':_0xd382('0x11'),'method':_0xd382('0x12'),'timeout':0x2710,'url':_0x265f48,'headers':{'Content-Type':_0xd382('0x13')},'body':_0x1f78dd};return rp(_0x3e47cc)[_0xd382('0x14')](function(_0x10ce36){const _0x58d880=JSON[_0xd382('0x15')](_0x10ce36);if(!_0x58d880['result']['logged']){throw new Error(_0xd382('0x16'));}var _0x1b2e84=_0x1bea4f;var _0x3b6190=_0xd382('0x17')+_0x4ab5a8+_0xd382('0x18')+_0x15412d+_0xd382('0x19')+_0x1b2e84+_0xd382('0x1a')+JSON['stringify'](_0xe4d3fe);var _0x18b184=_0x36462d+'?'+_0x3b6190;return rp(_0x18b184);})[_0xd382('0x14')](function(_0x2f6979){logger[_0xd382('0x1b')](_0xd382('0x1c'),_0x561792,_0x2f6979);_0x61e15e['stop']();})[_0xd382('0x1d')](function(_0x30a035){logger[_0xd382('0x1e')](_0xd382('0x1f'),_0x561792,_[_0xd382('0x20')](_0x30a035)?JSON['stringify'](_0x30a035):_0x30a035);_0x61e15e[_0xd382('0x21')]();});}else{logger[_0xd382('0x1b')](_0xd382('0x22'),_0x561792);_0x61e15e['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 5551432..96a8b2e 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 _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x525aeb,_0xedc6db){var _0x228693=function(_0x547161){while(--_0x547161){_0x525aeb['push'](_0x525aeb['shift']());}};_0x228693(++_0xedc6db);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x107899,_0x135ff0){var _0x35feb0=function(_0x498259){while(--_0x498259){_0x107899['push'](_0x107899['shift']());}};_0x35feb0(++_0x135ff0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index d79edb7..feb42f9 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 _0x1751=['mailQueues','waiting','openchannelQueues','paused','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','message','checkWaitingNotifications','transfer','applications','isArray','length','join','app','.js','toLowerCase','appdata','split','channel','mail','push','slice','dialogflow','amazonlex','tag','tvox','getMustacheRender','account','notificationTemplate','interaction','ChatWebsiteId','ContactId','body','%s:%s:%s','condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','chatQueues','available','loggedIn','name'];(function(_0x1c546b,_0x304e8f){var _0x18398a=function(_0x56b036){while(--_0x56b036){_0x1c546b['push'](_0x1c546b['shift']());}};_0x18398a(++_0x304e8f);}(_0x1751,0x76));var _0x1175=function(_0x41a09f,_0x27bb47){_0x41a09f=_0x41a09f-0x0;var _0x287766=_0x1751[_0x41a09f];return _0x287766;};'use strict';var _=require(_0x1175('0x0'));var util=require(_0x1175('0x1'));var path=require(_0x1175('0x2'));var fs=require('fs');var jayson=require(_0x1175('0x3'));var BPromise=require('bluebird');var utils=require(_0x1175('0x4'));var sUtils=require(_0x1175('0x5'));var logger=require(_0x1175('0x6'))(_0x1175('0x7'));var rpc={'openchannelQueueReport':require(_0x1175('0x8')),'mailQueueReport':require(_0x1175('0x9')),'chatQueueReport':require(_0x1175('0xa')),'smsQueueReport':require(_0x1175('0xb')),'faxQueueReport':require(_0x1175('0xc')),'whatsappQueueReport':require(_0x1175('0xd'))};var RuleEngine=require(_0x1175('0xe'));function getId(_0x37c744,_0x434f79,_0xf4d43d){return util[_0x1175('0xf')](_0x1175('0x10'),_0x37c744,_0x434f79||0x0,_0xf4d43d||0x0);}function getIntervals(_0x470b89,_0xbd22d9){var _0x1daa12=[];if(!_[_0x1175('0x11')](_0xbd22d9[_0x1175('0x12')])&&!_[_0x1175('0x11')](_0x470b89[_0xbd22d9[_0x1175('0x12')]])&&!_[_0x1175('0x11')](_0x470b89[_0xbd22d9[_0x1175('0x12')]][_0x1175('0x13')])){_0x1daa12=_['map'](_0x470b89[_0xbd22d9['IntervalId']][_0x1175('0x13')],_0x1175('0x14'));}else if(!_['isNil'](_0xbd22d9[_0x1175('0x14')])){_0x1daa12=[_0xbd22d9[_0x1175('0x14')]];}return _0x1daa12;}exports[_0x1175('0x15')]=function(_0x5068d9){_0x5068d9[_0x1175('0x16')]={};return new BPromise(function(_0x42671f,_0x16979a){var _0x57cea4={'Start':function(_0x1fab4e){var _0x5cf0b5=this;return new Promise(function(_0x14be3c,_0x43b6b1){if(_0x1fab4e){try{var _0x2a9bc4=[];var _0x2585be=getId(_0x1fab4e['channel'],_0x1fab4e[_0x1175('0x17')]?_0x1fab4e[_0x1175('0x17')]['id']:0x0,_0x1fab4e['interaction']?_0x1fab4e['interaction']['id']:0x0);var _0x40b685=sUtils[_0x1175('0x18')](_0x5068d9,_0x1fab4e);if(_0x1fab4e[_0x1175('0x19')]||!_0x40b685&&_0x1fab4e[_0x1175('0x1a')]&&_[_0x1175('0x1b')](_0x1fab4e['applications'])&&_0x1fab4e[_0x1175('0x1a')][_0x1175('0x1c')]){for(var _0x3eae78=0x0;_0x3eae78<_0x1fab4e[_0x1175('0x1a')][_0x1175('0x1c')];_0x3eae78+=0x1){var _0x2f303e=_0x1fab4e['applications'][_0x3eae78];if(fs['existsSync'](path[_0x1175('0x1d')](__dirname,_0x1175('0x1a'),_0x2f303e[_0x1175('0x1e')]+_0x1175('0x1f')))){var _0x4542c7=[];switch(_0x2f303e[_0x1175('0x1e')][_0x1175('0x20')]()){case'autoreply':var _0x3bcac9=_0x2f303e[_0x1175('0x21')][_0x1175('0x22')](',');if(_0x1fab4e[_0x1175('0x23')]===_0x1175('0x24')){_0x4542c7[_0x1175('0x25')](_0x3bcac9[0x0]);_0x4542c7[_0x1175('0x25')](_0x3bcac9[0x1]);_0x4542c7[_0x1175('0x25')](_0x3bcac9[_0x1175('0x26')](0x2,_0x3bcac9[_0x1175('0x1c')])[_0x1175('0x1d')](','));}else{_0x4542c7['push'](_0x3bcac9[0x0]);_0x4542c7['push'](_0x3bcac9['slice'](0x1,_0x3bcac9[_0x1175('0x1c')])[_0x1175('0x1d')](','));}break;case _0x1175('0x27'):var _0x5e4ac6=_0x2f303e['appdata']['split'](',');_0x4542c7['push'](_0x5e4ac6[0x0]);_0x4542c7[_0x1175('0x25')](_0x5e4ac6[0x1]);_0x4542c7[_0x1175('0x25')](_0x5e4ac6[_0x1175('0x26')](0x2,_0x5e4ac6[_0x1175('0x1c')])['join'](','));break;case'dialogflowv2':var _0x225279=_0x2f303e[_0x1175('0x21')]['split'](',');_0x4542c7['push'](_0x225279[0x0]);_0x4542c7['push'](_0x225279[0x1]);_0x4542c7[_0x1175('0x25')](_0x225279[0x2]);_0x4542c7[_0x1175('0x25')](_0x225279[0x3]);_0x4542c7['push'](_0x225279[_0x1175('0x26')](0x4,_0x225279[_0x1175('0x1c')])[_0x1175('0x1d')](','));break;case _0x1175('0x28'):var _0x239b73=_0x2f303e[_0x1175('0x21')]['split'](',');_0x4542c7[_0x1175('0x25')](_0x239b73[0x0]);_0x4542c7[_0x1175('0x25')](_0x239b73[0x1]);_0x4542c7[_0x1175('0x25')](_0x239b73[0x2]);_0x4542c7[_0x1175('0x25')](_0x239b73[0x3]);_0x4542c7['push'](_0x239b73[_0x1175('0x26')](0x4,_0x239b73['length'])[_0x1175('0x1d')](','));break;case _0x1175('0x17'):_0x4542c7[_0x1175('0x25')](_0x2f303e[_0x1175('0x21')]);break;case _0x1175('0x29'):_0x4542c7[_0x1175('0x25')](_0x2f303e['TagId']);_0x4542c7['push'](_0x2f303e['appdata']);break;case _0x1175('0x2a'):var _0x3fd639=utils[_0x1175('0x2b')](_0x1fab4e[_0x1175('0x2c')][_0x1175('0x2d')],_0x1fab4e);var _0x2beda3=_0x2f303e['appdata']['split'](',');_0x4542c7[_0x1175('0x25')](_0x2beda3[0x0]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0x1]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0x2]);_0x4542c7['push'](_0x2beda3[0x3]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0x4]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0x5]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0x6]);_0x4542c7['push'](_0x2beda3[0x7]);_0x4542c7['push'](_0x2beda3[0x8]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0x9]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0xa]);_0x4542c7['push'](_0x1fab4e[_0x1175('0x2e')]['id']);_0x4542c7[_0x1175('0x25')](_0x1fab4e[_0x1175('0x17')]['id']);_0x4542c7[_0x1175('0x25')](_0x2f303e[_0x1175('0x2f')]);_0x4542c7[_0x1175('0x25')](_0x1fab4e[_0x1175('0x2e')][_0x1175('0x30')]);_0x4542c7[_0x1175('0x25')](_0x1fab4e[_0x1175('0x31')][_0x1175('0x31')]);_0x4542c7[_0x1175('0x25')](_0x3fd639);break;default:_0x4542c7=_[_0x1175('0x11')](_0x2f303e[_0x1175('0x21')])?[]:_0x2f303e[_0x1175('0x21')][_0x1175('0x22')](',');}var _0x4fdb83={'id':util[_0x1175('0xf')](_0x1175('0x32'),_0x2585be,_0x2f303e['id'],_0x2f303e[_0x1175('0x1e')]),'condition':require('./interval')[_0x1175('0x33')](_0x2585be,getIntervals(_0x5068d9[_0x1175('0x34')],_0x2f303e),_0x5068d9),'consequence':require(_0x1175('0x35')+_0x2f303e[_0x1175('0x1e')])[_0x1175('0x36')](_0x2585be,_0x4542c7,_0x5068d9,_0x1fab4e),'p':_0x2f303e['priority']||0x0};logger[_0x1175('0x37')](_0x1175('0x38'),_0x4fdb83['id'],_0x1175('0x39'),getIntervals(_0x5068d9[_0x1175('0x34')],_0x2f303e)['join'](_0x1175('0x3a')));_0x2a9bc4[_0x1175('0x25')](_0x4fdb83);}else{logger[_0x1175('0x3b')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x1175('0x1d')](__dirname,'applications',_0x2f303e[_0x1175('0x1e')]+_0x1175('0x1f')));}}_0x5068d9[_0x1175('0x16')][_0x2585be]=new RuleEngine(_0x2a9bc4);_0x5068d9[_0x1175('0x16')][_0x2585be][_0x1175('0x3c')](_0x1fab4e,function(_0x1ec471){logger[_0x1175('0x37')](_0x1175('0x3d'),JSON[_0x1175('0x3e')](_0x1ec471[_0x1175('0x3f')]));if(_0x5068d9['rules'][_0x2585be]){_0x5068d9['rules'][_0x2585be][_0x1175('0x40')](_0x1175('0x41'));}});return _0x14be3c({'code':0xc8,'message':_0x1fab4e});}else{if(_0x40b685){logger['info'](util[_0x1175('0xf')](_0x1175('0x42'),_0x2585be));}else{logger['info'](_0x1175('0x43'));}return _0x14be3c({'code':0xc8,'message':_0x1fab4e});}}catch(_0x1ed96f){logger[_0x1175('0x3b')](_0x1ed96f[_0x1175('0x44')]);return _0x43b6b1(_0x5cf0b5[_0x1175('0x3b')](0x1f4,_0x1ed96f));}}return _0x43b6b1(_0x1175('0x45'));});},'AcceptMessage':function(_0x2acc28){var _0xde8a9b=this;return new Promise(function(_0x17a04c,_0x36da8f){if(_0x2acc28[_0x1175('0x46')]&&_0x2acc28[_0x1175('0x46')]['id']){if(_0x5068d9[_0x1175('0x47')][_0x2acc28[_0x1175('0x46')]['id']]){_0x5068d9[_0x1175('0x47')][_0x2acc28[_0x1175('0x46')]['id']][_0x1175('0x48')]=![];_0x5068d9['agents'][_0x2acc28['agent']['id']][_0x1175('0x49')]=undefined;}}if(_0x2acc28[_0x1175('0x17')]&&_0x2acc28[_0x1175('0x17')]['id']){try{var _0x4b3a70=getId(_0x2acc28[_0x1175('0x23')],_0x2acc28[_0x1175('0x17')]?_0x2acc28[_0x1175('0x17')]['id']:0x0,_0x2acc28[_0x1175('0x2e')]?_0x2acc28[_0x1175('0x2e')]['id']:0x0);if(_0x5068d9[_0x1175('0x16')][_0x4b3a70]){_0x5068d9['rules'][_0x4b3a70][_0x1175('0x40')](_0x1175('0x4a'));if(rpc[_0x2acc28[_0x1175('0x23')]+_0x1175('0x4b')]){rpc[_0x2acc28[_0x1175('0x23')]+_0x1175('0x4b')][_0x1175('0x4c')](_0x4b3a70,{'UserId':_0x2acc28[_0x1175('0x17')][_0x1175('0x4d')]})['catch'](function(){logger['error'](_0x1175('0x4e'));});}}return _0x17a04c({'code':0xc8,'message':_0x2acc28});}catch(_0x82478b){logger[_0x1175('0x3b')](_0x82478b[_0x1175('0x44')]);return _0x36da8f(_0xde8a9b['error'](0x1f4,_0x82478b));}}logger[_0x1175('0x3b')]('message\x20is\x20empty');return _0x36da8f(_0xde8a9b['error'](0x1f4,_0x1175('0x4f')));});},'RejectMessage':function(_0x2d85dd){var _0x425110=this;return new Promise(function(_0x5cdedb,_0x38d9b4){if(_0x2d85dd[_0x1175('0x46')]&&_0x2d85dd[_0x1175('0x46')]['id']){try{if(_0x5068d9['agents'][_0x2d85dd['agent']['id']]){_0x5068d9[_0x1175('0x47')][_0x2d85dd[_0x1175('0x46')]['id']][_0x1175('0x48')]=![];_0x5068d9[_0x1175('0x47')][_0x2d85dd[_0x1175('0x46')]['id']][_0x1175('0x49')]=undefined;}return _0x5cdedb({'code':0xc8,'message':_0x2d85dd});}catch(_0x3c5d47){logger[_0x1175('0x3b')](_0x3c5d47[_0x1175('0x44')]);return _0x38d9b4(_0x425110[_0x1175('0x3b')](0x1f4,_0x3c5d47));}}logger[_0x1175('0x3b')](_0x1175('0x4f'));return _0x38d9b4(_0x425110['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x30c2bc){var _0x3bebe9=this;return new Promise(function(_0x527c58,_0x306160){if(_0x30c2bc['channel']&&_0x30c2bc['interaction']&&_0x30c2bc[_0x1175('0x2e')]['id']){try{var _0x112b22=getId(_0x30c2bc[_0x1175('0x23')],_0x30c2bc[_0x1175('0x17')]?_0x30c2bc[_0x1175('0x17')]['id']:0x0,_0x30c2bc['interaction']?_0x30c2bc['interaction']['id']:0x0);if(_0x5068d9['rules'][_0x112b22]){_0x5068d9['rules'][_0x112b22][_0x1175('0x40')](_0x1175('0x4a'));}return _0x527c58({'code':0xc8,'message':_0x30c2bc});}catch(_0x50a84c){logger[_0x1175('0x3b')](_0x50a84c[_0x1175('0x44')]);return _0x306160(_0x3bebe9[_0x1175('0x3b')](0x1f4,_0x50a84c));}}logger[_0x1175('0x3b')](_0x1175('0x4f'));return _0x306160(_0x3bebe9[_0x1175('0x3b')](0x1f4,_0x1175('0x4f')));});},'AgentCapacity':function(_0x23316e){var _0x326696=this;return new Promise(function(_0xce19ef,_0x541f3d){if(_0x5068d9[_0x1175('0x47')][_0x1175('0x50')](_0x23316e['id'])){for(var _0x493b43 in _0x23316e[_0x1175('0x51')]){if(_0x23316e[_0x1175('0x51')][_0x1175('0x50')](_0x493b43)){if(_0x5068d9[_0x1175('0x47')][_0x23316e['id']][_0x1175('0x50')](_0x493b43+_0x1175('0x52'))){_0x5068d9[_0x1175('0x47')][_0x23316e['id']][_0x493b43+'CurrentCapacity']=parseInt(_0x23316e[_0x1175('0x51')][_0x493b43],0xa);}}}_0x5068d9[_0x1175('0x47')][_0x23316e['id']]['updateRealtime']();return _0xce19ef({'code':0xc8,'message':_0x5068d9[_0x1175('0x47')][_0x23316e['id']]});}else{return _0x541f3d(_0x326696[_0x1175('0x3b')](0x1f4,_0x1175('0x53')));}});},'Agents':function(_0x178885){return new Promise(function(_0x45e30b){var _0x5c9483=_['values'](_0x5068d9[_0x1175('0x47')]);if(_0x178885&&_0x178885['id']){var _0xecadee=_['find'](_0x5c9483,function(_0x1ee26f){return _0x1ee26f['id']===_0x178885['id'];});_0x45e30b(_0xecadee);}else{_0x45e30b({'count':_0x5c9483['length'],'rows':_0x5c9483});}});},'ChatQueues':function(){return new Promise(function(_0x580c4d){var _0xa161a9=[];for(var _0x2d59dc in _0x5068d9['chatQueues']){if(_0x5068d9[_0x1175('0x54')][_0x1175('0x50')](_0x2d59dc)){var _0xa3f39f=_0x5068d9[_0x1175('0x54')][_0x2d59dc];var _0x3f3a7={'id':_0xa3f39f['id'],'available':_0xa3f39f[_0x1175('0x55')],'loggedIn':_0xa3f39f[_0x1175('0x56')],'name':_0xa3f39f[_0x1175('0x57')],'paused':_0xa3f39f['paused'],'waiting':_0xa3f39f['waiting']};_0xa161a9[_0x1175('0x25')](_0x3f3a7);}}_0x580c4d({'count':_0xa161a9['length'],'rows':_0xa161a9});});},'MailQueues':function(){return new Promise(function(_0x1ab407){var _0x277a9a=[];for(var _0x1d46ab in _0x5068d9['mailQueues']){if(_0x5068d9[_0x1175('0x58')]['hasOwnProperty'](_0x1d46ab)){var _0x486e29=_0x5068d9[_0x1175('0x58')][_0x1d46ab];var _0x19c907={'id':_0x486e29['id'],'available':_0x486e29[_0x1175('0x55')],'loggedIn':_0x486e29[_0x1175('0x56')],'name':_0x486e29['name'],'paused':_0x486e29['paused'],'waiting':_0x486e29[_0x1175('0x59')]};_0x277a9a[_0x1175('0x25')](_0x19c907);}}_0x1ab407({'count':_0x277a9a['length'],'rows':_0x277a9a});});},'OpenchannelQueues':function(){return new Promise(function(_0x256114){var _0x569cbd=[];for(var _0x2ffb1e in _0x5068d9[_0x1175('0x5a')]){if(_0x5068d9['openchannelQueues']['hasOwnProperty'](_0x2ffb1e)){var _0x233387=_0x5068d9['openchannelQueues'][_0x2ffb1e];var _0x3e2380={'id':_0x233387['id'],'available':_0x233387[_0x1175('0x55')],'loggedIn':_0x233387[_0x1175('0x56')],'name':_0x233387[_0x1175('0x57')],'paused':_0x233387[_0x1175('0x5b')],'waiting':_0x233387[_0x1175('0x59')]};_0x569cbd[_0x1175('0x25')](_0x3e2380);}}_0x256114({'count':_0x569cbd[_0x1175('0x1c')],'rows':_0x569cbd});});},'SmsQueues':function(){return new Promise(function(_0xb3329b){var _0x14a347=[];for(var _0x23ef26 in _0x5068d9[_0x1175('0x5c')]){if(_0x5068d9['smsQueues']['hasOwnProperty'](_0x23ef26)){var _0x1c3d8d=_0x5068d9['smsQueues'][_0x23ef26];var _0x23de44={'id':_0x1c3d8d['id'],'available':_0x1c3d8d['available'],'loggedIn':_0x1c3d8d[_0x1175('0x56')],'name':_0x1c3d8d[_0x1175('0x57')],'paused':_0x1c3d8d[_0x1175('0x5b')],'waiting':_0x1c3d8d[_0x1175('0x59')]};_0x14a347[_0x1175('0x25')](_0x23de44);}}_0xb3329b({'count':_0x14a347[_0x1175('0x1c')],'rows':_0x14a347});});},'FaxQueues':function(){return new Promise(function(_0x31226c){var _0xd1dbd9=[];for(var _0x4d640f in _0x5068d9[_0x1175('0x5d')]){if(_0x5068d9[_0x1175('0x5d')]['hasOwnProperty'](_0x4d640f)){var _0x1a4241=_0x5068d9[_0x1175('0x5d')][_0x4d640f];var _0x49428a={'id':_0x1a4241['id'],'available':_0x1a4241[_0x1175('0x55')],'loggedIn':_0x1a4241[_0x1175('0x56')],'name':_0x1a4241[_0x1175('0x57')],'paused':_0x1a4241[_0x1175('0x5b')],'waiting':_0x1a4241[_0x1175('0x59')]};_0xd1dbd9[_0x1175('0x25')](_0x49428a);}}_0x31226c({'count':_0xd1dbd9[_0x1175('0x1c')],'rows':_0xd1dbd9});});},'WhatsappQueues':function(){return new Promise(function(_0x272ebb){var _0x5dc15e=[];for(var _0x5649fb in _0x5068d9[_0x1175('0x5e')]){if(_0x5068d9[_0x1175('0x5e')][_0x1175('0x50')](_0x5649fb)){var _0x225d65=_0x5068d9[_0x1175('0x5e')][_0x5649fb];var _0x233053={'id':_0x225d65['id'],'available':_0x225d65[_0x1175('0x55')],'loggedIn':_0x225d65[_0x1175('0x56')],'name':_0x225d65[_0x1175('0x57')],'paused':_0x225d65['paused'],'waiting':_0x225d65['waiting']};_0x5dc15e[_0x1175('0x25')](_0x233053);}}_0x272ebb({'count':_0x5dc15e[_0x1175('0x1c')],'rows':_0x5dc15e});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x56fc3f){var _0x2c049f=_[_0x1175('0x5f')](_0x5068d9[_0x1175('0x60')]);_0x56fc3f({'count':_0x2c049f[_0x1175('0x1c')],'rows':_0x2c049f});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4251f9){var _0x593109=_[_0x1175('0x5f')](_0x5068d9[_0x1175('0x61')]);_0x4251f9({'count':_0x593109[_0x1175('0x1c')],'rows':_0x593109});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xf88c98){var _0x146b12=_[_0x1175('0x5f')](_0x5068d9[_0x1175('0x62')]);_0xf88c98({'count':_0x146b12[_0x1175('0x1c')],'rows':_0x146b12});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2d66c4){var _0x2ccbb2=_['values'](_0x5068d9['smsQueuesWaitingInteractions']);_0x2d66c4({'count':_0x2ccbb2['length'],'rows':_0x2ccbb2});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x18f788){var _0x136fce=_[_0x1175('0x5f')](_0x5068d9['faxQueuesWaitingInteractions']);_0x18f788({'count':_0x136fce[_0x1175('0x1c')],'rows':_0x136fce});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1f9722){var _0x72e058=_[_0x1175('0x5f')](_0x5068d9['whatsappQueuesWaitingInteractions']);_0x1f9722({'count':_0x72e058[_0x1175('0x1c')],'rows':_0x72e058});});}};var _0xf99c77=jayson[_0x1175('0x63')](_0x57cea4)[_0x1175('0x64')]();_0xf99c77['on']('error',function(_0x2566d8){logger[_0x1175('0x3b')](JSON['stringify'](_0x2566d8));return _0x16979a(_0x2566d8);});_0xf99c77['listen'](0x232c,'127.0.0.1',function(){console[_0x1175('0x65')](_0x1175('0x66'),0x232c);return _0x42671f('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x17bb=['name','waiting','mailQueues','paused','openchannelQueues','loggedIn','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','join','app','.js','autoreply','appdata','split','mail','push','slice','dialogflowv2','amazonlex','tag','tvox','getMustacheRender','notificationTemplate','body','./interval','intervals','priority','info','Push\x20new\x20rule','rules','Applications\x20executed','stringify','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','find','chatQueues','available'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x17bb,0x188));var _0xb17b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x17bb[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xb17b('0x0'));var util=require(_0xb17b('0x1'));var path=require(_0xb17b('0x2'));var fs=require('fs');var jayson=require(_0xb17b('0x3'));var BPromise=require(_0xb17b('0x4'));var utils=require(_0xb17b('0x5'));var sUtils=require('./applications/strategy/util');var logger=require(_0xb17b('0x6'))(_0xb17b('0x7'));var rpc={'openchannelQueueReport':require(_0xb17b('0x8')),'mailQueueReport':require(_0xb17b('0x9')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xb17b('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xb17b('0xb'))};var RuleEngine=require(_0xb17b('0xc'));function getId(_0x8e2647,_0x500f96,_0x30604f){return util[_0xb17b('0xd')](_0xb17b('0xe'),_0x8e2647,_0x500f96||0x0,_0x30604f||0x0);}function getIntervals(_0xfcdd38,_0x420689){var _0x32a3ab=[];if(!_[_0xb17b('0xf')](_0x420689[_0xb17b('0x10')])&&!_[_0xb17b('0xf')](_0xfcdd38[_0x420689['IntervalId']])&&!_[_0xb17b('0xf')](_0xfcdd38[_0x420689['IntervalId']][_0xb17b('0x11')])){_0x32a3ab=_[_0xb17b('0x12')](_0xfcdd38[_0x420689[_0xb17b('0x10')]]['Intervals'],'interval');}else if(!_[_0xb17b('0xf')](_0x420689[_0xb17b('0x13')])){_0x32a3ab=[_0x420689[_0xb17b('0x13')]];}return _0x32a3ab;}exports[_0xb17b('0x14')]=function(_0x1e8d03){_0x1e8d03['rules']={};return new BPromise(function(_0x4abbf2,_0x4e7875){var _0x52b6d8={'Start':function(_0x4b3086){var _0x1a8345=this;return new Promise(function(_0x518482,_0x428426){if(_0x4b3086){try{var _0x56b821=[];var _0x40c600=getId(_0x4b3086[_0xb17b('0x15')],_0x4b3086[_0xb17b('0x16')]?_0x4b3086[_0xb17b('0x16')]['id']:0x0,_0x4b3086['interaction']?_0x4b3086[_0xb17b('0x17')]['id']:0x0);var _0x20853d=sUtils[_0xb17b('0x18')](_0x1e8d03,_0x4b3086);if(_0x4b3086[_0xb17b('0x19')]||!_0x20853d&&_0x4b3086[_0xb17b('0x1a')]&&_[_0xb17b('0x1b')](_0x4b3086[_0xb17b('0x1a')])&&_0x4b3086[_0xb17b('0x1a')][_0xb17b('0x1c')]){for(var _0xcb3d3a=0x0;_0xcb3d3a<_0x4b3086[_0xb17b('0x1a')][_0xb17b('0x1c')];_0xcb3d3a+=0x1){var _0x5e5a81=_0x4b3086[_0xb17b('0x1a')][_0xcb3d3a];if(fs['existsSync'](path[_0xb17b('0x1d')](__dirname,'applications',_0x5e5a81[_0xb17b('0x1e')]+_0xb17b('0x1f')))){var _0x477293=[];switch(_0x5e5a81[_0xb17b('0x1e')]['toLowerCase']()){case _0xb17b('0x20'):var _0x205e39=_0x5e5a81[_0xb17b('0x21')][_0xb17b('0x22')](',');if(_0x4b3086[_0xb17b('0x15')]===_0xb17b('0x23')){_0x477293[_0xb17b('0x24')](_0x205e39[0x0]);_0x477293[_0xb17b('0x24')](_0x205e39[0x1]);_0x477293[_0xb17b('0x24')](_0x205e39[_0xb17b('0x25')](0x2,_0x205e39[_0xb17b('0x1c')])['join'](','));}else{_0x477293[_0xb17b('0x24')](_0x205e39[0x0]);_0x477293[_0xb17b('0x24')](_0x205e39['slice'](0x1,_0x205e39[_0xb17b('0x1c')])[_0xb17b('0x1d')](','));}break;case'dialogflow':var _0x32a3b6=_0x5e5a81['appdata'][_0xb17b('0x22')](',');_0x477293['push'](_0x32a3b6[0x0]);_0x477293[_0xb17b('0x24')](_0x32a3b6[0x1]);_0x477293[_0xb17b('0x24')](_0x32a3b6['slice'](0x2,_0x32a3b6[_0xb17b('0x1c')])[_0xb17b('0x1d')](','));break;case _0xb17b('0x26'):var _0x2d7703=_0x5e5a81[_0xb17b('0x21')][_0xb17b('0x22')](',');_0x477293[_0xb17b('0x24')](_0x2d7703[0x0]);_0x477293[_0xb17b('0x24')](_0x2d7703[0x1]);_0x477293[_0xb17b('0x24')](_0x2d7703[0x2]);_0x477293[_0xb17b('0x24')](_0x2d7703[0x3]);_0x477293[_0xb17b('0x24')](_0x2d7703['slice'](0x4,_0x2d7703[_0xb17b('0x1c')])['join'](','));break;case _0xb17b('0x27'):var _0x4b3fa4=_0x5e5a81[_0xb17b('0x21')][_0xb17b('0x22')](',');_0x477293[_0xb17b('0x24')](_0x4b3fa4[0x0]);_0x477293[_0xb17b('0x24')](_0x4b3fa4[0x1]);_0x477293['push'](_0x4b3fa4[0x2]);_0x477293['push'](_0x4b3fa4[0x3]);_0x477293[_0xb17b('0x24')](_0x4b3fa4[_0xb17b('0x25')](0x4,_0x4b3fa4['length'])[_0xb17b('0x1d')](','));break;case _0xb17b('0x16'):_0x477293[_0xb17b('0x24')](_0x5e5a81[_0xb17b('0x21')]);break;case _0xb17b('0x28'):_0x477293[_0xb17b('0x24')](_0x5e5a81['TagId']);_0x477293['push'](_0x5e5a81[_0xb17b('0x21')]);break;case _0xb17b('0x29'):var _0x5042f7=utils[_0xb17b('0x2a')](_0x4b3086['account'][_0xb17b('0x2b')],_0x4b3086);var _0x2b44ec=_0x5e5a81['appdata'][_0xb17b('0x22')](',');_0x477293['push'](_0x2b44ec[0x0]);_0x477293[_0xb17b('0x24')](_0x2b44ec[0x1]);_0x477293[_0xb17b('0x24')](_0x2b44ec[0x2]);_0x477293[_0xb17b('0x24')](_0x2b44ec[0x3]);_0x477293['push'](_0x2b44ec[0x4]);_0x477293['push'](_0x2b44ec[0x5]);_0x477293[_0xb17b('0x24')](_0x2b44ec[0x6]);_0x477293[_0xb17b('0x24')](_0x2b44ec[0x7]);_0x477293[_0xb17b('0x24')](_0x2b44ec[0x8]);_0x477293[_0xb17b('0x24')](_0x2b44ec[0x9]);_0x477293[_0xb17b('0x24')](_0x2b44ec[0xa]);_0x477293['push'](_0x4b3086[_0xb17b('0x17')]['id']);_0x477293[_0xb17b('0x24')](_0x4b3086[_0xb17b('0x16')]['id']);_0x477293[_0xb17b('0x24')](_0x5e5a81['ChatWebsiteId']);_0x477293[_0xb17b('0x24')](_0x4b3086[_0xb17b('0x17')]['ContactId']);_0x477293['push'](_0x4b3086['body'][_0xb17b('0x2c')]);_0x477293[_0xb17b('0x24')](_0x5042f7);break;default:_0x477293=_[_0xb17b('0xf')](_0x5e5a81[_0xb17b('0x21')])?[]:_0x5e5a81[_0xb17b('0x21')][_0xb17b('0x22')](',');}var _0x418103={'id':util[_0xb17b('0xd')]('%s:%s:%s',_0x40c600,_0x5e5a81['id'],_0x5e5a81['app']),'condition':require(_0xb17b('0x2d'))['condition'](_0x40c600,getIntervals(_0x1e8d03[_0xb17b('0x2e')],_0x5e5a81),_0x1e8d03),'consequence':require('./applications/'+_0x5e5a81[_0xb17b('0x1e')])['consequence'](_0x40c600,_0x477293,_0x1e8d03,_0x4b3086),'p':_0x5e5a81[_0xb17b('0x2f')]||0x0};logger[_0xb17b('0x30')](_0xb17b('0x31'),_0x418103['id'],'on\x20interval',getIntervals(_0x1e8d03[_0xb17b('0x2e')],_0x5e5a81)['join']('\x20|\x20'));_0x56b821[_0xb17b('0x24')](_0x418103);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0xb17b('0x1d')](__dirname,_0xb17b('0x1a'),_0x5e5a81[_0xb17b('0x1e')]+_0xb17b('0x1f')));}}_0x1e8d03[_0xb17b('0x32')][_0x40c600]=new RuleEngine(_0x56b821);_0x1e8d03[_0xb17b('0x32')][_0x40c600]['execute'](_0x4b3086,function(_0x181cf8){logger['info'](_0xb17b('0x33'),JSON[_0xb17b('0x34')](_0x181cf8['matchPath']));if(_0x1e8d03[_0xb17b('0x32')][_0x40c600]){_0x1e8d03[_0xb17b('0x32')][_0x40c600][_0xb17b('0x35')](_0xb17b('0x36'));}});return _0x518482({'code':0xc8,'message':_0x4b3086});}else{if(_0x20853d){logger[_0xb17b('0x30')](util['format'](_0xb17b('0x37'),_0x40c600));}else{logger['info'](_0xb17b('0x38'));}return _0x518482({'code':0xc8,'message':_0x4b3086});}}catch(_0x186596){logger[_0xb17b('0x39')](_0x186596[_0xb17b('0x3a')]);return _0x428426(_0x1a8345['error'](0x1f4,_0x186596));}}return _0x428426('routing\x20is\x20empty');});},'AcceptMessage':function(_0x81a020){var _0x17d9d8=this;return new Promise(function(_0x55d17c,_0x4d010e){if(_0x81a020[_0xb17b('0x3b')]&&_0x81a020[_0xb17b('0x3b')]['id']){if(_0x1e8d03[_0xb17b('0x3c')][_0x81a020['agent']['id']]){_0x1e8d03['agents'][_0x81a020['agent']['id']][_0xb17b('0x3d')]=![];_0x1e8d03[_0xb17b('0x3c')][_0x81a020['agent']['id']][_0xb17b('0x3e')]=undefined;}}if(_0x81a020[_0xb17b('0x16')]&&_0x81a020[_0xb17b('0x16')]['id']){try{var _0x356509=getId(_0x81a020[_0xb17b('0x15')],_0x81a020[_0xb17b('0x16')]?_0x81a020[_0xb17b('0x16')]['id']:0x0,_0x81a020[_0xb17b('0x17')]?_0x81a020['interaction']['id']:0x0);if(_0x1e8d03['rules'][_0x356509]){_0x1e8d03[_0xb17b('0x32')][_0x356509]['emit'](_0xb17b('0x3f'));if(rpc[_0x81a020[_0xb17b('0x15')]+_0xb17b('0x40')]){rpc[_0x81a020['channel']+_0xb17b('0x40')][_0xb17b('0x41')](_0x356509,{'UserId':_0x81a020['message'][_0xb17b('0x42')]})[_0xb17b('0x43')](function(){logger[_0xb17b('0x39')](_0xb17b('0x44'));});}}return _0x55d17c({'code':0xc8,'message':_0x81a020});}catch(_0x5a13ac){logger[_0xb17b('0x39')](_0x5a13ac[_0xb17b('0x3a')]);return _0x4d010e(_0x17d9d8['error'](0x1f4,_0x5a13ac));}}logger['error'](_0xb17b('0x45'));return _0x4d010e(_0x17d9d8[_0xb17b('0x39')](0x1f4,_0xb17b('0x45')));});},'RejectMessage':function(_0x5261e7){var _0x12acaa=this;return new Promise(function(_0x34938f,_0x3ffb31){if(_0x5261e7[_0xb17b('0x3b')]&&_0x5261e7['agent']['id']){try{if(_0x1e8d03['agents'][_0x5261e7[_0xb17b('0x3b')]['id']]){_0x1e8d03[_0xb17b('0x3c')][_0x5261e7['agent']['id']][_0xb17b('0x3d')]=![];_0x1e8d03[_0xb17b('0x3c')][_0x5261e7[_0xb17b('0x3b')]['id']][_0xb17b('0x3e')]=undefined;}return _0x34938f({'code':0xc8,'message':_0x5261e7});}catch(_0x37834e){logger[_0xb17b('0x39')](_0x37834e['stack']);return _0x3ffb31(_0x12acaa[_0xb17b('0x39')](0x1f4,_0x37834e));}}logger['error']('message\x20is\x20empty');return _0x3ffb31(_0x12acaa[_0xb17b('0x39')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x529c2b){var _0x2b715c=this;return new Promise(function(_0xbc27fe,_0x200161){if(_0x529c2b[_0xb17b('0x15')]&&_0x529c2b[_0xb17b('0x17')]&&_0x529c2b[_0xb17b('0x17')]['id']){try{var _0x41008e=getId(_0x529c2b[_0xb17b('0x15')],_0x529c2b[_0xb17b('0x16')]?_0x529c2b[_0xb17b('0x16')]['id']:0x0,_0x529c2b['interaction']?_0x529c2b['interaction']['id']:0x0);if(_0x1e8d03[_0xb17b('0x32')][_0x41008e]){_0x1e8d03['rules'][_0x41008e][_0xb17b('0x35')](_0xb17b('0x3f'));}return _0xbc27fe({'code':0xc8,'message':_0x529c2b});}catch(_0x441908){logger[_0xb17b('0x39')](_0x441908[_0xb17b('0x3a')]);return _0x200161(_0x2b715c[_0xb17b('0x39')](0x1f4,_0x441908));}}logger[_0xb17b('0x39')](_0xb17b('0x45'));return _0x200161(_0x2b715c[_0xb17b('0x39')](0x1f4,_0xb17b('0x45')));});},'AgentCapacity':function(_0xbddd73){var _0x311424=this;return new Promise(function(_0x16ad97,_0x2390b8){if(_0x1e8d03[_0xb17b('0x3c')][_0xb17b('0x46')](_0xbddd73['id'])){for(var _0x3bc87e in _0xbddd73[_0xb17b('0x47')]){if(_0xbddd73[_0xb17b('0x47')]['hasOwnProperty'](_0x3bc87e)){if(_0x1e8d03[_0xb17b('0x3c')][_0xbddd73['id']][_0xb17b('0x46')](_0x3bc87e+'CurrentCapacity')){_0x1e8d03[_0xb17b('0x3c')][_0xbddd73['id']][_0x3bc87e+_0xb17b('0x48')]=parseInt(_0xbddd73[_0xb17b('0x47')][_0x3bc87e],0xa);}}}_0x1e8d03['agents'][_0xbddd73['id']][_0xb17b('0x49')]();return _0x16ad97({'code':0xc8,'message':_0x1e8d03[_0xb17b('0x3c')][_0xbddd73['id']]});}else{return _0x2390b8(_0x311424['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x4ab178){return new Promise(function(_0x33242c){var _0x1f0f3d=_[_0xb17b('0x4a')](_0x1e8d03[_0xb17b('0x3c')]);if(_0x4ab178&&_0x4ab178['id']){var _0x3f20e9=_[_0xb17b('0x4b')](_0x1f0f3d,function(_0x334934){return _0x334934['id']===_0x4ab178['id'];});_0x33242c(_0x3f20e9);}else{_0x33242c({'count':_0x1f0f3d['length'],'rows':_0x1f0f3d});}});},'ChatQueues':function(){return new Promise(function(_0x474f9f){var _0x1ab3d2=[];for(var _0x23e4e9 in _0x1e8d03['chatQueues']){if(_0x1e8d03[_0xb17b('0x4c')][_0xb17b('0x46')](_0x23e4e9)){var _0x20f613=_0x1e8d03[_0xb17b('0x4c')][_0x23e4e9];var _0x33a623={'id':_0x20f613['id'],'available':_0x20f613[_0xb17b('0x4d')],'loggedIn':_0x20f613['loggedIn'],'name':_0x20f613[_0xb17b('0x4e')],'paused':_0x20f613['paused'],'waiting':_0x20f613[_0xb17b('0x4f')]};_0x1ab3d2['push'](_0x33a623);}}_0x474f9f({'count':_0x1ab3d2['length'],'rows':_0x1ab3d2});});},'MailQueues':function(){return new Promise(function(_0xea4dc4){var _0x5a2780=[];for(var _0x3aa994 in _0x1e8d03[_0xb17b('0x50')]){if(_0x1e8d03[_0xb17b('0x50')][_0xb17b('0x46')](_0x3aa994)){var _0x5e8da9=_0x1e8d03[_0xb17b('0x50')][_0x3aa994];var _0x11f31f={'id':_0x5e8da9['id'],'available':_0x5e8da9['available'],'loggedIn':_0x5e8da9['loggedIn'],'name':_0x5e8da9['name'],'paused':_0x5e8da9[_0xb17b('0x51')],'waiting':_0x5e8da9['waiting']};_0x5a2780[_0xb17b('0x24')](_0x11f31f);}}_0xea4dc4({'count':_0x5a2780[_0xb17b('0x1c')],'rows':_0x5a2780});});},'OpenchannelQueues':function(){return new Promise(function(_0x4b1e38){var _0x2789c8=[];for(var _0x335cab in _0x1e8d03[_0xb17b('0x52')]){if(_0x1e8d03[_0xb17b('0x52')][_0xb17b('0x46')](_0x335cab)){var _0x2b21ac=_0x1e8d03['openchannelQueues'][_0x335cab];var _0x3baeca={'id':_0x2b21ac['id'],'available':_0x2b21ac['available'],'loggedIn':_0x2b21ac[_0xb17b('0x53')],'name':_0x2b21ac[_0xb17b('0x4e')],'paused':_0x2b21ac['paused'],'waiting':_0x2b21ac[_0xb17b('0x4f')]};_0x2789c8['push'](_0x3baeca);}}_0x4b1e38({'count':_0x2789c8[_0xb17b('0x1c')],'rows':_0x2789c8});});},'SmsQueues':function(){return new Promise(function(_0x587d2b){var _0x5aa8f1=[];for(var _0x5e7801 in _0x1e8d03['smsQueues']){if(_0x1e8d03[_0xb17b('0x54')][_0xb17b('0x46')](_0x5e7801)){var _0x4b3158=_0x1e8d03[_0xb17b('0x54')][_0x5e7801];var _0x72cedb={'id':_0x4b3158['id'],'available':_0x4b3158[_0xb17b('0x4d')],'loggedIn':_0x4b3158[_0xb17b('0x53')],'name':_0x4b3158[_0xb17b('0x4e')],'paused':_0x4b3158[_0xb17b('0x51')],'waiting':_0x4b3158['waiting']};_0x5aa8f1[_0xb17b('0x24')](_0x72cedb);}}_0x587d2b({'count':_0x5aa8f1[_0xb17b('0x1c')],'rows':_0x5aa8f1});});},'FaxQueues':function(){return new Promise(function(_0x4765da){var _0x3cf7d1=[];for(var _0x33aa50 in _0x1e8d03['faxQueues']){if(_0x1e8d03[_0xb17b('0x55')][_0xb17b('0x46')](_0x33aa50)){var _0x473aaa=_0x1e8d03[_0xb17b('0x55')][_0x33aa50];var _0x40691e={'id':_0x473aaa['id'],'available':_0x473aaa[_0xb17b('0x4d')],'loggedIn':_0x473aaa[_0xb17b('0x53')],'name':_0x473aaa['name'],'paused':_0x473aaa[_0xb17b('0x51')],'waiting':_0x473aaa['waiting']};_0x3cf7d1[_0xb17b('0x24')](_0x40691e);}}_0x4765da({'count':_0x3cf7d1[_0xb17b('0x1c')],'rows':_0x3cf7d1});});},'WhatsappQueues':function(){return new Promise(function(_0x449e84){var _0x410049=[];for(var _0x3c28fa in _0x1e8d03[_0xb17b('0x56')]){if(_0x1e8d03['whatsappQueues']['hasOwnProperty'](_0x3c28fa)){var _0x1ea928=_0x1e8d03['whatsappQueues'][_0x3c28fa];var _0x2892e5={'id':_0x1ea928['id'],'available':_0x1ea928[_0xb17b('0x4d')],'loggedIn':_0x1ea928[_0xb17b('0x53')],'name':_0x1ea928[_0xb17b('0x4e')],'paused':_0x1ea928[_0xb17b('0x51')],'waiting':_0x1ea928['waiting']};_0x410049[_0xb17b('0x24')](_0x2892e5);}}_0x449e84({'count':_0x410049[_0xb17b('0x1c')],'rows':_0x410049});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x3d2588){var _0x55e951=_['values'](_0x1e8d03[_0xb17b('0x57')]);_0x3d2588({'count':_0x55e951[_0xb17b('0x1c')],'rows':_0x55e951});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4e4e54){var _0x3eaa41=_[_0xb17b('0x4a')](_0x1e8d03[_0xb17b('0x58')]);_0x4e4e54({'count':_0x3eaa41[_0xb17b('0x1c')],'rows':_0x3eaa41});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x5caec8){var _0x4cbcd3=_[_0xb17b('0x4a')](_0x1e8d03[_0xb17b('0x59')]);_0x5caec8({'count':_0x4cbcd3[_0xb17b('0x1c')],'rows':_0x4cbcd3});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x5ec247){var _0x42a606=_[_0xb17b('0x4a')](_0x1e8d03[_0xb17b('0x5a')]);_0x5ec247({'count':_0x42a606['length'],'rows':_0x42a606});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x452b6d){var _0x37ccef=_[_0xb17b('0x4a')](_0x1e8d03['faxQueuesWaitingInteractions']);_0x452b6d({'count':_0x37ccef[_0xb17b('0x1c')],'rows':_0x37ccef});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x8b15ea){var _0x4f5397=_['values'](_0x1e8d03[_0xb17b('0x5b')]);_0x8b15ea({'count':_0x4f5397[_0xb17b('0x1c')],'rows':_0x4f5397});});}};var _0x304a6e=jayson['server'](_0x52b6d8)['http']();_0x304a6e['on']('error',function(_0x3fc093){logger[_0xb17b('0x39')](JSON[_0xb17b('0x34')](_0x3fc093));return _0x4e7875(_0x3fc093);});_0x304a6e[_0xb17b('0x14')](0x232c,'127.0.0.1',function(){console[_0xb17b('0x5c')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x4abbf2(_0xb17b('0x5d')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 80044cc..68d8a68 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 _0x0ed1=['lodash','../../../config/logger','client','then','message','result','catch','condition','rules','info','stop','length','push','Command','iftime\x20%s','indexOf','error','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','join','util','bluebird'];(function(_0x31ff46,_0x48fc21){var _0x1c564e=function(_0x2dff32){while(--_0x2dff32){_0x31ff46['push'](_0x31ff46['shift']());}};_0x1c564e(++_0x48fc21);}(_0x0ed1,0x9a));var _0x10ed=function(_0x941677,_0x3d1039){_0x941677=_0x941677-0x0;var _0x3b1eb6=_0x0ed1[_0x941677];return _0x3b1eb6;};'use strict';var util=require(_0x10ed('0x0'));var BPromise=require(_0x10ed('0x1'));var jayson=require('jayson/promise');var _=require(_0x10ed('0x2'));var logger=require(_0x10ed('0x3'))('routing');var client=jayson[_0x10ed('0x4')]['http']({'port':0x232a});function request(_0x4050f2,_0x40af92){return new BPromise(function(_0x524924,_0x5965b7){return client['request'](_0x4050f2,_0x40af92)[_0x10ed('0x5')](function(_0xe18bf3){if(_0xe18bf3['error']){return _0x5965b7(_0xe18bf3['error'][_0x10ed('0x6')]);}else{return _0x524924(_0xe18bf3[_0x10ed('0x7')]);}})[_0x10ed('0x8')](function(_0x3b57b2){return _0x5965b7(_0x3b57b2);});});}exports[_0x10ed('0x9')]=function(_0x5edab5,_0x452c83,_0x1356e8){return function(_0x4cb4c0){if(_0x1356e8[_0x10ed('0xa')]&&!_0x1356e8[_0x10ed('0xa')][_0x5edab5]){logger[_0x10ed('0xb')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x5edab5);return _0x4cb4c0[_0x10ed('0xc')]();}var _0x13b928=[];for(var _0x5440be=0x0;_0x5440be<_0x452c83[_0x10ed('0xd')];_0x5440be+=0x1){_0x13b928[_0x10ed('0xe')](request(_0x10ed('0xf'),{'command':util['format'](_0x10ed('0x10'),_0x452c83[_0x5440be])})[_0x10ed('0x5')](function(_0x251519){return _0x251519&&_0x251519[_0x10ed('0x6')]&&_0x251519[_0x10ed('0x6')][_0x10ed('0x11')]('true')>=0x0?!![]:![];})[_0x10ed('0x8')](function(){logger[_0x10ed('0x12')](_0x10ed('0x13'),_0x5edab5,_0x452c83[_0x5440be]);}));}BPromise[_0x10ed('0x14')](_0x13b928)[_0x10ed('0x5')](function(_0x4bab62){var _0x1368fd=_[_0x10ed('0x15')](_0x4bab62);logger['info'](_0x10ed('0x16'),_0x5edab5,_0x452c83['join'](_0x10ed('0x17')),_0x1368fd);_0x4cb4c0[_0x10ed('0x18')](_0x1368fd);})[_0x10ed('0x8')](function(_0x4cb288){logger[_0x10ed('0x12')](_0x10ed('0x16'),_0x5edab5,_0x452c83[_0x10ed('0x19')]('\x20|\x20'),_0x4cb288['stack']);_0x4cb4c0[_0x10ed('0xc')]();});};}; \ No newline at end of file +var _0x3982=['jayson/promise','../../../config/logger','routing','client','http','then','error','message','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','Command','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','info','join','when','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','util','bluebird'];(function(_0x8d996c,_0x434d5c){var _0x442e8d=function(_0x299f04){while(--_0x299f04){_0x8d996c['push'](_0x8d996c['shift']());}};_0x442e8d(++_0x434d5c);}(_0x3982,0x85));var _0x2398=function(_0x54ac96,_0x3ed0a9){_0x54ac96=_0x54ac96-0x0;var _0x1f7ee5=_0x3982[_0x54ac96];return _0x1f7ee5;};'use strict';var util=require(_0x2398('0x0'));var BPromise=require(_0x2398('0x1'));var jayson=require(_0x2398('0x2'));var _=require('lodash');var logger=require(_0x2398('0x3'))(_0x2398('0x4'));var client=jayson[_0x2398('0x5')][_0x2398('0x6')]({'port':0x232a});function request(_0x352dbc,_0x4d2ff0){return new BPromise(function(_0xb3f0cd,_0x1a00c0){return client['request'](_0x352dbc,_0x4d2ff0)[_0x2398('0x7')](function(_0x3d4726){if(_0x3d4726[_0x2398('0x8')]){return _0x1a00c0(_0x3d4726[_0x2398('0x8')][_0x2398('0x9')]);}else{return _0xb3f0cd(_0x3d4726['result']);}})[_0x2398('0xa')](function(_0xb184e3){return _0x1a00c0(_0xb184e3);});});}exports[_0x2398('0xb')]=function(_0x37d9c4,_0x55cb6d,_0x8bdf5f){return function(_0x2e0cf6){if(_0x8bdf5f['rules']&&!_0x8bdf5f[_0x2398('0xc')][_0x37d9c4]){logger['info'](_0x2398('0xd'),_0x37d9c4);return _0x2e0cf6[_0x2398('0xe')]();}var _0x32bb52=[];for(var _0x406bcb=0x0;_0x406bcb<_0x55cb6d['length'];_0x406bcb+=0x1){_0x32bb52['push'](request(_0x2398('0xf'),{'command':util[_0x2398('0x10')](_0x2398('0x11'),_0x55cb6d[_0x406bcb])})[_0x2398('0x7')](function(_0x2fe92f){return _0x2fe92f&&_0x2fe92f[_0x2398('0x9')]&&_0x2fe92f[_0x2398('0x9')]['indexOf'](_0x2398('0x12'))>=0x0?!![]:![];})[_0x2398('0xa')](function(){logger[_0x2398('0x8')](_0x2398('0x13'),_0x37d9c4,_0x55cb6d[_0x406bcb]);}));}BPromise[_0x2398('0x14')](_0x32bb52)['then'](function(_0x28f336){var _0x2e057b=_[_0x2398('0x15')](_0x28f336);logger[_0x2398('0x16')]('[%s][INTERVAL]\x20%s\x20%s',_0x37d9c4,_0x55cb6d[_0x2398('0x17')]('\x20|\x20'),_0x2e057b);_0x2e0cf6[_0x2398('0x18')](_0x2e057b);})['catch'](function(_0x3d7d49){logger[_0x2398('0x8')](_0x2398('0x19'),_0x37d9c4,_0x55cb6d['join'](_0x2398('0x1a')),_0x3d7d49['stack']);_0x2e0cf6['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 90cb226..e20a327 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 _0x2547=['transfertargetuniqueid','clone','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','lastevent','getVoiceQueueByName','then','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','timeout','holdtime','ringtime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','agentconnect','[%s][agents][agentconnect]','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','secondtransfererexten'];(function(_0x1db87f,_0x27574f){var _0xaa0552=function(_0x19da18){while(--_0x19da18){_0x1db87f['push'](_0x1db87f['shift']());}};_0xaa0552(++_0x27574f);}(_0x2547,0x1cd));var _0x7254=function(_0x286a51,_0x462c82){_0x286a51=_0x286a51-0x0;var _0x35cf8c=_0x2547[_0x286a51];return _0x35cf8c;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var utils=require(_0x7254('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x44b692,_0x3ea6e6){utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x4'),_0x44b692[_0x7254('0x5')],_0x44b692['channel'],_0x44b692[_0x7254('0x6')],_0x44b692[_0x7254('0x7')],_0x44b692[_0x7254('0x8')],_0x44b692[_0x7254('0x9')],_0x44b692['connectedlinenum'],_0x44b692[_0x7254('0xa')]));if(_0x44b692[_0x7254('0x6')]){utils[_0x7254('0xb')](_0x44b692['queue'])[_0x7254('0xc')](function(_0x555b2e){if(_0x555b2e){_0x44b692['type']=_0x555b2e['type'];_0x44b692[_0x7254('0xd')]=_0x44b692[_0x7254('0xe')]?_0x555b2e[_0x7254('0xf')]:![];_0x44b692[_0x7254('0x10')]=_0x44b692[_0x7254('0xd')]?_0x555b2e[_0x7254('0x11')]:0x0;}utils['request'](_0x7254('0x12'),_0x44b692);});}else{utils['request'](_0x7254('0x12'),_0x44b692);}if(_0x3ea6e6){delete transfers[_0x44b692['uniqueid']];}else{delete agents[_0x44b692[_0x7254('0x13')]];}}exports[_0x7254('0x14')]=function(_0x348d4e){try{utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x16'),_0x348d4e[_0x7254('0x5')]),_0x348d4e);agents[_0x348d4e[_0x7254('0x13')]]=_0x348d4e;agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x17')]=utils[_0x7254('0x18')]();agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0xa')]='called';agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x19')]=null;agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x1a')]=null;utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x1b'),_0x348d4e['uniqueid'],agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x7')],_0x348d4e[_0x7254('0x13')]));}catch(_0x45aa93){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x16'),_0x348d4e[_0x7254('0x5')]),_0x45aa93);}};exports[_0x7254('0x1d')]=function(_0x3b6cb6){try{if(!_[_0x7254('0x1e')](agents[_0x3b6cb6[_0x7254('0x13')]])){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x1f'),_0x3b6cb6[_0x7254('0x5')]),_0x3b6cb6);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x20'),_0x3b6cb6[_0x7254('0x5')],agents[_0x3b6cb6[_0x7254('0x13')]]['membername'],_0x3b6cb6['destuniqueid']));agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x1d')]=!![];agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x21')]=utils[_0x7254('0x18')]();agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0xa')]='timeout';agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x22')]=_0x7254('0x23');agents[_0x3b6cb6['destuniqueid']][_0x7254('0x24')]=_0x3b6cb6['ringtime']?parseInt(_0x3b6cb6[_0x7254('0x25')])/0x3e8:0x0;agents[_0x3b6cb6[_0x7254('0x13')]]['talktime']=0x0;unanswered[_0x7254('0x26')](_0x3b6cb6[_0x7254('0x13')]);}}catch(_0x4f684c){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x1f'),_0x3b6cb6[_0x7254('0x5')]),_0x4f684c);}};exports[_0x7254('0x27')]=function(_0xfe02ea){try{_['forIn'](agents,function(_0x146028,_0x2dba3f){if(_0x146028['uniqueid']==_0xfe02ea[_0x7254('0x5')]&&!_[_0x7254('0x28')](unanswered,_0x146028[_0x7254('0x13')])){utils['debug'](util[_0x7254('0x3')](_0x7254('0x29'),_0xfe02ea[_0x7254('0x5')]),_0xfe02ea);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x2a'),_0xfe02ea[_0x7254('0x5')],_0x146028['membername'],_0x146028[_0x7254('0x13')]));_0x146028['agentringnoanswer']=!![];_0x146028['agentringnoanswerAt']=utils[_0x7254('0x18')]();_0x146028[_0x7254('0xa')]=_0x7254('0x2b');_0x146028[_0x7254('0x22')]=_0x7254('0x2b');_0x146028[_0x7254('0x24')]=_0xfe02ea[_0x7254('0x24')];_0x146028[_0x7254('0x2c')]=0x0;writeDB(_0x146028);}});}catch(_0x447515){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x29'),_0xfe02ea[_0x7254('0x5')]),_0x447515);}};exports[_0x7254('0x2d')]=function(_0x57a7d4){try{if(agents[_0x57a7d4[_0x7254('0x13')]]){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x2e'),_0x57a7d4[_0x7254('0x5')]),_0x57a7d4);utils['info'](util[_0x7254('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x57a7d4[_0x7254('0x5')],agents[_0x57a7d4[_0x7254('0x13')]][_0x7254('0x7')],_0x57a7d4[_0x7254('0x13')]));agents[_0x57a7d4[_0x7254('0x13')]]['agentconnectAt']=utils[_0x7254('0x18')]();agents[_0x57a7d4['destuniqueid']][_0x7254('0x19')]=_0x57a7d4[_0x7254('0x19')];agents[_0x57a7d4['destuniqueid']][_0x7254('0x1a')]=_0x57a7d4[_0x7254('0x1a')];agents[_0x57a7d4[_0x7254('0x13')]][_0x7254('0x24')]=_0x57a7d4[_0x7254('0x25')];agents[_0x57a7d4[_0x7254('0x13')]]['lastevent']=_0x7254('0x2f');_[_0x7254('0x30')](agents,function(_0x105b8c,_0x4eca7a){if(_0x105b8c[_0x7254('0x13')]!=_0x57a7d4[_0x7254('0x13')]&&_0x105b8c[_0x7254('0x5')]==_0x57a7d4['uniqueid']){_0x105b8c[_0x7254('0x2c')]=0x0;_0x105b8c[_0x7254('0x24')]=_0x57a7d4[_0x7254('0x25')];_0x105b8c[_0x7254('0x1d')]=!![];_0x105b8c[_0x7254('0x21')]=utils['now']();_0x105b8c['lastevent']=_0x7254('0x31');_0x105b8c[_0x7254('0x22')]=_0x7254('0x31');_0x105b8c[_0x7254('0x32')]=_0x57a7d4['destuniqueid'];_0x105b8c['answeredelsewheremembername']=_0x57a7d4[_0x7254('0x7')];writeDB(_0x105b8c);}});}}catch(_0x565cd8){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x2e'),_0x57a7d4[_0x7254('0x5')]),_0x565cd8);}};exports['agentcomplete']=function(_0x4adf34){try{if(!_[_0x7254('0x1e')](agents[_0x4adf34[_0x7254('0x13')]])){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x33'),_0x4adf34['uniqueid']),_0x4adf34);utils['info'](util[_0x7254('0x3')](_0x7254('0x34'),_0x4adf34[_0x7254('0x5')],agents[_0x4adf34['destuniqueid']][_0x7254('0x7')],_0x4adf34[_0x7254('0x13')]));agents[_0x4adf34['destuniqueid']][_0x7254('0xe')]=!![];agents[_0x4adf34[_0x7254('0x13')]][_0x7254('0x35')]=utils[_0x7254('0x18')]();agents[_0x4adf34['destuniqueid']][_0x7254('0x2c')]=utils[_0x7254('0x36')](agents[_0x4adf34['destuniqueid']][_0x7254('0x35')],agents[_0x4adf34[_0x7254('0x13')]][_0x7254('0x37')]);agents[_0x4adf34['destuniqueid']][_0x7254('0x22')]=_0x4adf34[_0x7254('0x22')];agents[_0x4adf34['destuniqueid']]['lastevent']=_0x7254('0x38');writeDB(agents[_0x4adf34['destuniqueid']]);}}catch(_0x2e437c){utils[_0x7254('0x1c')](util['format']('[%s][agents][agentcomplete]',_0x4adf34[_0x7254('0x5')]),_0x2e437c);}};exports[_0x7254('0x39')]=function(_0x38bcd5){try{if(!_[_0x7254('0x1e')](agents[_0x38bcd5[_0x7254('0x3a')]])){utils[_0x7254('0x15')](util['format'](_0x7254('0x3b'),_0x38bcd5['uniqueid']),_0x38bcd5);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x3c'),_0x38bcd5['uniqueid'],agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x7')],agents[_0x38bcd5[_0x7254('0x3a')]]['uniqueid']));agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x3d')]=!![];agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x3e')]=_0x7254('0x3f');agents[_0x38bcd5['transfereruniqueid']]['transferexten']=_0x38bcd5[_0x7254('0x40')];agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x41')]=agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x5')];}}catch(_0x4c6838){utils['error'](util[_0x7254('0x3')](_0x7254('0x3b'),_0x38bcd5[_0x7254('0x5')]),_0x4c6838);}};exports[_0x7254('0x42')]=function(_0x5061be){try{utils[_0x7254('0x15')](util[_0x7254('0x3')]('[%s][agents][attendedtransfer]',_0x5061be[_0x7254('0x43')]),_0x5061be);if(_0x5061be['origtransfereruniqueid']==_0x5061be[_0x7254('0x44')]){if(!_['isNil'](agents[_0x5061be[_0x7254('0x45')]])){utils['info'](util['format'](_0x7254('0x46'),_0x5061be[_0x7254('0x43')],agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x7')]));agents[_0x5061be['secondtransfereruniqueid']][_0x7254('0x3d')]=!![];agents[_0x5061be['secondtransfereruniqueid']][_0x7254('0x3e')]=_0x7254('0x47');agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x48')]=_0x5061be[_0x7254('0x49')];agents[_0x5061be[_0x7254('0x45')]]['transferuniqueid']=_0x5061be[_0x7254('0x43')];}if(_0x5061be[_0x7254('0x4a')]&&agents[_0x5061be[_0x7254('0x4a')]]){agents[_0x5061be[_0x7254('0x4a')]][_0x7254('0x4b')]=0x1;transfers[_0x5061be[_0x7254('0x4a')]]=_['clone'](agents[_0x5061be[_0x7254('0x4a')]]);transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x9')]=agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x9')];transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x4c')]=agents[_0x5061be['secondtransfereruniqueid']]['calleridname'];transfers[_0x5061be[_0x7254('0x4a')]]['agentcalledAt']=utils['now']();transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x37')]=utils[_0x7254('0x18')]();transfers[_0x5061be['transfereeuniqueid']][_0x7254('0x24')]=0x0;transfers[_0x5061be['transfereeuniqueid']][_0x7254('0x4b')]=0x2;}}else if(_0x5061be[_0x7254('0x45')]==_0x5061be[_0x7254('0x4d')]){if(!_[_0x7254('0x1e')](agents[_0x5061be[_0x7254('0x43')]])){utils['info'](util[_0x7254('0x3')](_0x7254('0x46'),_0x5061be[_0x7254('0x43')],agents[_0x5061be[_0x7254('0x43')]]['membername']));agents[_0x5061be['origtransfereruniqueid']][_0x7254('0x3d')]=!![];agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x3e')]=_0x7254('0x47');agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x48')]=_0x5061be[_0x7254('0x4e')];agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x41')]=_0x5061be[_0x7254('0x45')];}if(_0x5061be[_0x7254('0x4f')]&&agents[_0x5061be[_0x7254('0x4f')]]){agents[_0x5061be[_0x7254('0x4f')]]['agententerreason']=0x1;transfers[_0x5061be[_0x7254('0x4f')]]=_[_0x7254('0x50')](agents[_0x5061be[_0x7254('0x4f')]]);transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x9')]=agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x9')];transfers[_0x5061be[_0x7254('0x4f')]]['calleridname']=agents[_0x5061be[_0x7254('0x43')]]['calleridname'];transfers[_0x5061be[_0x7254('0x4f')]][_0x7254('0x17')]=utils[_0x7254('0x18')]();transfers[_0x5061be[_0x7254('0x4f')]]['agentconnectAt']=utils[_0x7254('0x18')]();transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x24')]=0x0;transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x4b')]=0x2;}}}catch(_0x42dc64){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x51'),_0x5061be[_0x7254('0x43')]),_0x42dc64);}};exports[_0x7254('0x52')]=function(_0x23b89a){try{utils['debug'](util[_0x7254('0x3')]('[%s][agents][hangup]',_0x23b89a[_0x7254('0x5')]),_0x23b89a);if(agents[_0x23b89a[_0x7254('0x5')]]&&agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]===_0x7254('0x23')){if(_0x23b89a[_0x7254('0x53')]==='21'){agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]='rejected';agents[_0x23b89a[_0x7254('0x5')]]['lastevent']=_0x7254('0x54');}utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x55'),_0x23b89a[_0x7254('0x5')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x7')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(agents[_0x23b89a[_0x7254('0x5')]]);var _0x3f7be7=unanswered[_0x7254('0x56')](_0x23b89a[_0x7254('0x5')]);if(_0x3f7be7>-0x1){unanswered[_0x7254('0x57')](_0x3f7be7,0x1);}}if(transfers[_0x23b89a[_0x7254('0x5')]]){transfers[_0x23b89a['uniqueid']]['agentcomplete']=!![];transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')]=utils['now']();transfers[_0x23b89a['uniqueid']]['talktime']=utils[_0x7254('0x36')](transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')],transfers[_0x23b89a[_0x7254('0x5')]]['agentconnectAt']);transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]='agent';transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]=_0x7254('0x38');utils['info'](util['format'](_0x7254('0x55'),_0x23b89a[_0x7254('0x5')],transfers[_0x23b89a['uniqueid']][_0x7254('0x7')],transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')],transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(transfers[_0x23b89a['uniqueid']],!![]);}if(agents[_0x23b89a[_0x7254('0x5')]]&&agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x37')]){agents[_0x23b89a['uniqueid']][_0x7254('0xe')]=!![];agents[_0x23b89a['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0x23b89a[_0x7254('0x5')]]['talktime']=utils['diffTime'](agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')],agents[_0x23b89a[_0x7254('0x5')]]['agentconnectAt']);agents[_0x23b89a[_0x7254('0x5')]]['reason']=agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x3d')]?'transfer':_0x7254('0x58');agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]=_0x7254('0x38');utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x55'),_0x23b89a['uniqueid'],agents[_0x23b89a[_0x7254('0x5')]]['membername'],agents[_0x23b89a['uniqueid']][_0x7254('0x22')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(agents[_0x23b89a[_0x7254('0x5')]]);}}catch(_0x54c7d5){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x59'),_0x23b89a[_0x7254('0x5')]),_0x54c7d5);}}; \ No newline at end of file +var _0xe706=['then','type','agentacw','agentcomplete','acw','acwtime','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','now','called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','agentcalledAt','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName'];(function(_0x5adbc4,_0x5ac917){var _0x2efadd=function(_0x21f119){while(--_0x21f119){_0x5adbc4['push'](_0x5adbc4['shift']());}};_0x2efadd(++_0x5ac917);}(_0xe706,0xa3));var _0x6e70=function(_0xaff1bd,_0x5380c4){_0xaff1bd=_0xaff1bd-0x0;var _0x52ad89=_0xe706[_0xaff1bd];return _0x52ad89;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var utils=require(_0x6e70('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e8446,_0x2cae77){utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x5'),_0x5e8446[_0x6e70('0x6')],_0x5e8446[_0x6e70('0x7')],_0x5e8446[_0x6e70('0x8')],_0x5e8446[_0x6e70('0x9')],_0x5e8446[_0x6e70('0xa')],_0x5e8446[_0x6e70('0xb')],_0x5e8446[_0x6e70('0xc')],_0x5e8446[_0x6e70('0xd')]));if(_0x5e8446[_0x6e70('0x8')]){utils[_0x6e70('0xe')](_0x5e8446[_0x6e70('0x8')])[_0x6e70('0xf')](function(_0x954545){if(_0x954545){_0x5e8446[_0x6e70('0x10')]=_0x954545[_0x6e70('0x10')];_0x5e8446[_0x6e70('0x11')]=_0x5e8446[_0x6e70('0x12')]?_0x954545[_0x6e70('0x13')]:![];_0x5e8446[_0x6e70('0x14')]=_0x5e8446[_0x6e70('0x11')]?_0x954545['acwTimeout']:0x0;}utils['request'](_0x6e70('0x15'),_0x5e8446);});}else{utils[_0x6e70('0x16')](_0x6e70('0x15'),_0x5e8446);}if(_0x2cae77){delete transfers[_0x5e8446[_0x6e70('0x6')]];}else{delete agents[_0x5e8446[_0x6e70('0x17')]];}}exports[_0x6e70('0x18')]=function(_0xa1eb74){try{utils[_0x6e70('0x19')](util['format']('[%s][agents][agentcalled]',_0xa1eb74['uniqueid']),_0xa1eb74);agents[_0xa1eb74[_0x6e70('0x17')]]=_0xa1eb74;agents[_0xa1eb74['destuniqueid']]['agentcalledAt']=utils[_0x6e70('0x1a')]();agents[_0xa1eb74[_0x6e70('0x17')]]['lastevent']=_0x6e70('0x1b');agents[_0xa1eb74['destuniqueid']][_0x6e70('0xc')]=null;agents[_0xa1eb74[_0x6e70('0x17')]]['connectedlinename']=null;utils['info'](util[_0x6e70('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0xa1eb74[_0x6e70('0x6')],agents[_0xa1eb74[_0x6e70('0x17')]]['membername'],_0xa1eb74['destuniqueid']));}catch(_0xc238ba){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x1d'),_0xa1eb74[_0x6e70('0x6')]),_0xc238ba);}};exports[_0x6e70('0x1e')]=function(_0x1b2453){try{if(!_[_0x6e70('0x1f')](agents[_0x1b2453[_0x6e70('0x17')]])){utils[_0x6e70('0x19')](util['format'](_0x6e70('0x20'),_0x1b2453[_0x6e70('0x6')]),_0x1b2453);utils[_0x6e70('0x3')](util['format'](_0x6e70('0x21'),_0x1b2453[_0x6e70('0x6')],agents[_0x1b2453[_0x6e70('0x17')]]['membername'],_0x1b2453[_0x6e70('0x17')]));agents[_0x1b2453['destuniqueid']]['agentringnoanswer']=!![];agents[_0x1b2453['destuniqueid']][_0x6e70('0x22')]=utils[_0x6e70('0x1a')]();agents[_0x1b2453['destuniqueid']][_0x6e70('0xd')]=_0x6e70('0x23');agents[_0x1b2453['destuniqueid']][_0x6e70('0x24')]=_0x6e70('0x23');agents[_0x1b2453[_0x6e70('0x17')]]['holdtime']=_0x1b2453['ringtime']?parseInt(_0x1b2453[_0x6e70('0x25')])/0x3e8:0x0;agents[_0x1b2453[_0x6e70('0x17')]][_0x6e70('0x26')]=0x0;unanswered[_0x6e70('0x27')](_0x1b2453[_0x6e70('0x17')]);}}catch(_0x5d772a){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x20'),_0x1b2453[_0x6e70('0x6')]),_0x5d772a);}};exports[_0x6e70('0x28')]=function(_0x20a225){try{_[_0x6e70('0x29')](agents,function(_0x24114a,_0x3a0821){if(_0x24114a[_0x6e70('0x6')]==_0x20a225['uniqueid']&&!_[_0x6e70('0x2a')](unanswered,_0x24114a['destuniqueid'])){utils[_0x6e70('0x19')](util['format'](_0x6e70('0x2b'),_0x20a225[_0x6e70('0x6')]),_0x20a225);utils[_0x6e70('0x3')](util['format'](_0x6e70('0x2c'),_0x20a225[_0x6e70('0x6')],_0x24114a['membername'],_0x24114a[_0x6e70('0x17')]));_0x24114a[_0x6e70('0x1e')]=!![];_0x24114a['agentringnoanswerAt']=utils[_0x6e70('0x1a')]();_0x24114a[_0x6e70('0xd')]=_0x6e70('0x2d');_0x24114a[_0x6e70('0x24')]=_0x6e70('0x2d');_0x24114a[_0x6e70('0x2e')]=_0x20a225[_0x6e70('0x2e')];_0x24114a[_0x6e70('0x26')]=0x0;writeDB(_0x24114a);}});}catch(_0xf146fd){utils[_0x6e70('0x1c')](util['format'](_0x6e70('0x2b'),_0x20a225['uniqueid']),_0xf146fd);}};exports[_0x6e70('0x2f')]=function(_0x3222a2){try{if(agents[_0x3222a2[_0x6e70('0x17')]]){utils[_0x6e70('0x19')](util[_0x6e70('0x4')](_0x6e70('0x30'),_0x3222a2[_0x6e70('0x6')]),_0x3222a2);utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x31'),_0x3222a2[_0x6e70('0x6')],agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0x9')],_0x3222a2['destuniqueid']));agents[_0x3222a2['destuniqueid']]['agentconnectAt']=utils[_0x6e70('0x1a')]();agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0xc')]=_0x3222a2[_0x6e70('0xc')];agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0x32')]=_0x3222a2['connectedlinename'];agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0x2e')]=_0x3222a2[_0x6e70('0x25')];agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0xd')]=_0x6e70('0x33');_[_0x6e70('0x29')](agents,function(_0x16fc7d,_0x5be100){if(_0x16fc7d[_0x6e70('0x17')]!=_0x3222a2[_0x6e70('0x17')]&&_0x16fc7d[_0x6e70('0x6')]==_0x3222a2[_0x6e70('0x6')]){_0x16fc7d[_0x6e70('0x26')]=0x0;_0x16fc7d[_0x6e70('0x2e')]=_0x3222a2[_0x6e70('0x25')];_0x16fc7d['agentringnoanswer']=!![];_0x16fc7d['agentringnoanswerAt']=utils['now']();_0x16fc7d[_0x6e70('0xd')]=_0x6e70('0x34');_0x16fc7d[_0x6e70('0x24')]=_0x6e70('0x34');_0x16fc7d[_0x6e70('0x35')]=_0x3222a2['destuniqueid'];_0x16fc7d[_0x6e70('0x36')]=_0x3222a2[_0x6e70('0x9')];writeDB(_0x16fc7d);}});}}catch(_0x2a2aca){utils['error'](util['format']('[%s][agents][agentconnect]',_0x3222a2[_0x6e70('0x6')]),_0x2a2aca);}};exports['agentcomplete']=function(_0x42f49a){try{if(!_[_0x6e70('0x1f')](agents[_0x42f49a[_0x6e70('0x17')]])){utils[_0x6e70('0x19')](util['format'](_0x6e70('0x37'),_0x42f49a['uniqueid']),_0x42f49a);utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x38'),_0x42f49a[_0x6e70('0x6')],agents[_0x42f49a['destuniqueid']][_0x6e70('0x9')],_0x42f49a[_0x6e70('0x17')]));agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x12')]=!![];agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x39')]=utils[_0x6e70('0x1a')]();agents[_0x42f49a['destuniqueid']][_0x6e70('0x26')]=utils[_0x6e70('0x3a')](agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x39')],agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x3b')]);agents[_0x42f49a[_0x6e70('0x17')]]['reason']=_0x42f49a[_0x6e70('0x24')];agents[_0x42f49a['destuniqueid']][_0x6e70('0xd')]=_0x6e70('0x3c');writeDB(agents[_0x42f49a['destuniqueid']]);}}catch(_0x53efc3){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x37'),_0x42f49a['uniqueid']),_0x53efc3);}};exports['blindtransfer']=function(_0x238ebb){try{if(!_[_0x6e70('0x1f')](agents[_0x238ebb[_0x6e70('0x3d')]])){utils[_0x6e70('0x19')](util[_0x6e70('0x4')](_0x6e70('0x3e'),_0x238ebb['uniqueid']),_0x238ebb);utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x3f'),_0x238ebb[_0x6e70('0x6')],agents[_0x238ebb[_0x6e70('0x3d')]]['membername'],agents[_0x238ebb['transfereruniqueid']][_0x6e70('0x6')]));agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x40')]=!![];agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x41')]='blind';agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x42')]=_0x238ebb[_0x6e70('0x43')];agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x44')]=agents[_0x238ebb['transfereruniqueid']][_0x6e70('0x6')];}}catch(_0x1dd242){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x3e'),_0x238ebb[_0x6e70('0x6')]),_0x1dd242);}};exports['attendedtransfer']=function(_0x40e7c6){try{utils[_0x6e70('0x19')](util['format'](_0x6e70('0x45'),_0x40e7c6[_0x6e70('0x46')]),_0x40e7c6);if(_0x40e7c6['origtransfereruniqueid']==_0x40e7c6[_0x6e70('0x47')]){if(!_[_0x6e70('0x1f')](agents[_0x40e7c6[_0x6e70('0x48')]])){utils[_0x6e70('0x3')](util[_0x6e70('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x40e7c6[_0x6e70('0x46')],agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x9')]));agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x40')]=!![];agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x41')]=_0x6e70('0x49');agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x42')]=_0x40e7c6[_0x6e70('0x4a')];agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x44')]=_0x40e7c6[_0x6e70('0x46')];}if(_0x40e7c6[_0x6e70('0x4b')]&&agents[_0x40e7c6[_0x6e70('0x4b')]]){agents[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x4c')]=0x1;transfers[_0x40e7c6[_0x6e70('0x4b')]]=_[_0x6e70('0x4d')](agents[_0x40e7c6['transfereeuniqueid']]);transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0xb')]=agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0xb')];transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x4e')]=agents[_0x40e7c6['secondtransfereruniqueid']][_0x6e70('0x4e')];transfers[_0x40e7c6[_0x6e70('0x4b')]]['agentcalledAt']=utils[_0x6e70('0x1a')]();transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x3b')]=utils['now']();transfers[_0x40e7c6['transfereeuniqueid']][_0x6e70('0x2e')]=0x0;transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x4c')]=0x2;}}else if(_0x40e7c6[_0x6e70('0x48')]==_0x40e7c6[_0x6e70('0x4f')]){if(!_[_0x6e70('0x1f')](agents[_0x40e7c6[_0x6e70('0x46')]])){utils['info'](util['format'](_0x6e70('0x50'),_0x40e7c6[_0x6e70('0x46')],agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0x9')]));agents[_0x40e7c6['origtransfereruniqueid']]['transfer']=!![];agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0x41')]='ATTENDED';agents[_0x40e7c6['origtransfereruniqueid']][_0x6e70('0x42')]=_0x40e7c6['secondtransfererexten'];agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0x44')]=_0x40e7c6[_0x6e70('0x48')];}if(_0x40e7c6[_0x6e70('0x51')]&&agents[_0x40e7c6[_0x6e70('0x51')]]){agents[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x4c')]=0x1;transfers[_0x40e7c6[_0x6e70('0x51')]]=_['clone'](agents[_0x40e7c6[_0x6e70('0x51')]]);transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0xb')]=agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0xb')];transfers[_0x40e7c6['transfertargetuniqueid']]['calleridname']=agents[_0x40e7c6['origtransfereruniqueid']][_0x6e70('0x4e')];transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x52')]=utils['now']();transfers[_0x40e7c6['transfertargetuniqueid']][_0x6e70('0x3b')]=utils[_0x6e70('0x1a')]();transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x2e')]=0x0;transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x4c')]=0x2;}}}catch(_0x5eb6f0){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x45'),_0x40e7c6[_0x6e70('0x46')]),_0x5eb6f0);}};exports['hangup']=function(_0xce964b){try{utils['debug'](util['format'](_0x6e70('0x53'),_0xce964b[_0x6e70('0x6')]),_0xce964b);if(agents[_0xce964b[_0x6e70('0x6')]]&&agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]===_0x6e70('0x23')){if(_0xce964b['cause']==='21'){agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]=_0x6e70('0x54');agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]=_0x6e70('0x54');}utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x55'),_0xce964b[_0x6e70('0x6')],agents[_0xce964b['uniqueid']][_0x6e70('0x9')],agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')],agents[_0xce964b['uniqueid']]['lastevent']));writeDB(agents[_0xce964b[_0x6e70('0x6')]]);var _0x18ecf0=unanswered[_0x6e70('0x56')](_0xce964b[_0x6e70('0x6')]);if(_0x18ecf0>-0x1){unanswered[_0x6e70('0x57')](_0x18ecf0,0x1);}}if(transfers[_0xce964b['uniqueid']]){transfers[_0xce964b['uniqueid']][_0x6e70('0x12')]=!![];transfers[_0xce964b[_0x6e70('0x6')]]['agentcompleteAt']=utils[_0x6e70('0x1a')]();transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x26')]=utils[_0x6e70('0x3a')](transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x39')],transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x3b')]);transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]=_0x6e70('0x58');transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]=_0x6e70('0x3c');utils['info'](util['format'](_0x6e70('0x55'),_0xce964b['uniqueid'],transfers[_0xce964b[_0x6e70('0x6')]]['membername'],transfers[_0xce964b['uniqueid']][_0x6e70('0x24')],transfers[_0xce964b['uniqueid']]['lastevent']));writeDB(transfers[_0xce964b[_0x6e70('0x6')]],!![]);}if(agents[_0xce964b[_0x6e70('0x6')]]&&agents[_0xce964b[_0x6e70('0x6')]]['agentconnectAt']){agents[_0xce964b['uniqueid']]['agentcomplete']=!![];agents[_0xce964b[_0x6e70('0x6')]]['agentcompleteAt']=utils[_0x6e70('0x1a')]();agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x26')]=utils[_0x6e70('0x3a')](agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x39')],agents[_0xce964b[_0x6e70('0x6')]]['agentconnectAt']);agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]=agents[_0xce964b[_0x6e70('0x6')]]['transfer']?_0x6e70('0x40'):_0x6e70('0x58');agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]=_0x6e70('0x3c');utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x55'),_0xce964b[_0x6e70('0x6')],agents[_0xce964b['uniqueid']][_0x6e70('0x9')],agents[_0xce964b[_0x6e70('0x6')]]['reason'],agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]));writeDB(agents[_0xce964b['uniqueid']]);}}catch(_0x596d71){utils[_0x6e70('0x1c')](util['format'](_0x6e70('0x53'),_0xce964b['uniqueid']),_0x596d71);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index ec070ee..453d2aa 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 _0x67d0=['xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','includes','hangup','execif','gotoif','lodash','./utils','FAILED','NO\x20ANSWER','ANSWERED','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','membername','interface','getUserByInternal','UserId','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','accountcode','calleridnum','exten','DOCUMENTATION','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','error','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','starttime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','localtwolinkedid','secondtransfererchannel','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','mohtime','diffTime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview'];(function(_0x993a27,_0x2374b1){var _0x2cc9ba=function(_0x596ba8){while(--_0x596ba8){_0x993a27['push'](_0x993a27['shift']());}};_0x2cc9ba(++_0x2374b1);}(_0x67d0,0xeb));var _0x067d=function(_0x530db2,_0x2193ed){_0x530db2=_0x530db2-0x0;var _0x23654d=_0x67d0[_0x530db2];return _0x23654d;};'use strict';var _=require(_0x067d('0x0'));var util=require('util');var utils=require(_0x067d('0x1'));var dispositions=['NO\x20ANSWER',_0x067d('0x2'),_0x067d('0x2'),_0x067d('0x3'),'NO\x20ANSWER','NO\x20ANSWER',_0x067d('0x4'),'BUSY',_0x067d('0x2'),_0x067d('0x2'),'FAILED'];var channels={};function writeDB(_0x391ccb){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x7'),_0x391ccb[_0x067d('0x8')],_0x391ccb['channel'],_0x391ccb['queue'],_0x391ccb[_0x067d('0x9')],_0x391ccb[_0x067d('0xa')],_0x391ccb['calleridnum'],_0x391ccb['connectedlinenum'],_0x391ccb['lastevent']));if(_0x391ccb['accountcode']){utils[_0x067d('0xb')](_0x391ccb['accountcode'])['then'](function(_0x215505){if(_0x215505){_0x391ccb[_0x067d('0xc')]=_0x215505['id'];}utils['request'](_0x067d('0xd'),_0x391ccb);});}else{utils[_0x067d('0xe')](_0x067d('0xd'),_0x391ccb);}if(channels[_0x391ccb[_0x067d('0x8')]]){delete channels[_0x391ccb[_0x067d('0x8')]];}}exports[_0x067d('0xf')]=function(_0xc6fe1c){try{utils[_0x067d('0x10')](util['format'](_0x067d('0x11'),_0xc6fe1c[_0x067d('0x8')]),_0xc6fe1c);if(_0xc6fe1c['uniqueid']==_0xc6fe1c[_0x067d('0x12')]&&_0xc6fe1c[_0x067d('0x13')]!=_0x067d('0x14')){utils['info'](util[_0x067d('0x6')](_0x067d('0x15'),_0xc6fe1c['uniqueid'],_0xc6fe1c[_0x067d('0x16')],_0xc6fe1c['exten']));channels[_0xc6fe1c[_0x067d('0x8')]]={'uniqueid':_0xc6fe1c[_0x067d('0x8')],'accountcode':_0xc6fe1c[_0x067d('0x17')],'source':_0xc6fe1c[_0x067d('0x18')],'destination':_0xc6fe1c[_0x067d('0x19')],'destinationcontext':_0xc6fe1c[_0x067d('0x16')],'channel':_0xc6fe1c[_0x067d('0x13')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x067d('0x3'),'amaflags':_0x067d('0x1a')};}}catch(_0x24c1d1){utils['error'](util[_0x067d('0x6')](_0x067d('0x11'),_0xc6fe1c[_0x067d('0x8')]),_0x24c1d1);}};exports['newstate']=function(_0x277880){try{utils['debug'](util[_0x067d('0x6')](_0x067d('0x1b'),_0x277880[_0x067d('0x8')]),_0x277880);if(!_[_0x067d('0x1c')](channels[_0x277880['uniqueid']])&&_0x277880[_0x067d('0x1d')]==0x6){utils['info'](util['format'](_0x067d('0x1e'),_0x277880[_0x067d('0x8')],_0x277880[_0x067d('0x16')],_0x277880[_0x067d('0x13')]));if(_[_0x067d('0x1c')](channels[_0x277880[_0x067d('0x8')]]['systemanswertime'])){channels[_0x277880['uniqueid']][_0x067d('0x1f')]=utils[_0x067d('0x20')]();}}else if(!_[_0x067d('0x1c')](channels[_0x277880['linkedid']])&&_0x277880[_0x067d('0x1d')]==0x6&&_0x277880['context']!=_0x067d('0x21')){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x22'),_0x277880[_0x067d('0x8')],_0x277880[_0x067d('0x12')],_0x277880[_0x067d('0x16')],_0x277880['channel']));channels[_0x277880[_0x067d('0x12')]][_0x067d('0x17')]=_0x277880[_0x067d('0x17')];channels[_0x277880[_0x067d('0x12')]]['destinationchannel']=_0x277880['channel'];if(_['isNil'](channels[_0x277880['linkedid']]['answertime'])){channels[_0x277880[_0x067d('0x12')]][_0x067d('0x23')]=utils[_0x067d('0x20')]();}channels[_0x277880['linkedid']][_0x067d('0x24')]=dispositions[_['toNumber'](_0x277880[_0x067d('0x1d')])]||'ANSWERED';}}catch(_0x10324c){utils[_0x067d('0x25')](util[_0x067d('0x6')](_0x067d('0x1b'),_0x277880[_0x067d('0x8')]),_0x10324c);}};exports['hangup']=function(_0x5286d7){try{if(!_[_0x067d('0x1c')](channels[_0x5286d7['uniqueid']])){utils[_0x067d('0x10')](util[_0x067d('0x6')](_0x067d('0x26'),_0x5286d7[_0x067d('0x8')]),_0x5286d7);if(_[_0x067d('0x1c')](channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x27')])){channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x27')]=_0x5286d7[_0x067d('0x28')]+'\x20<'+_0x5286d7[_0x067d('0x18')]+'>';}utils['info'](util[_0x067d('0x6')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x5286d7[_0x067d('0x8')],channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x27')],_0x5286d7[_0x067d('0x29')]));channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x2a')]=utils[_0x067d('0x20')]();channels[_0x5286d7['uniqueid']][_0x067d('0x2b')]=utils['diffTime'](channels[_0x5286d7[_0x067d('0x8')]]['endtime'],channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x2c')]);channels[_0x5286d7[_0x067d('0x8')]]['billableseconds']=channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x23')]?utils['diffTime'](channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x2a')],channels[_0x5286d7['uniqueid']][_0x067d('0x23')]):0x0;writeDB(channels[_0x5286d7[_0x067d('0x8')]]);}}catch(_0x28a38d){utils[_0x067d('0x25')](util[_0x067d('0x6')](_0x067d('0x26'),_0x5286d7[_0x067d('0x8')]),_0x28a38d);}};exports[_0x067d('0x2d')]=function(_0x2f00a4){try{if(!_[_0x067d('0x1c')](channels[_0x2f00a4['localtwolinkedid']])){utils[_0x067d('0x10')](util[_0x067d('0x6')](_0x067d('0x2e'),_0x2f00a4[_0x067d('0x2f')]),_0x2f00a4);if(channels[_0x2f00a4['localtwolinkedid']]['channel']==_0x2f00a4[_0x067d('0x30')]){utils[_0x067d('0x5')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2f00a4['origtransfereruniqueid'],_0x2f00a4[_0x067d('0x31')],_0x2f00a4[_0x067d('0x32')]));channels[_0x2f00a4[_0x067d('0x31')]]['destinationchannel']=_0x2f00a4[_0x067d('0x32')];channels[_0x2f00a4['localtwolinkedid']]['userfield']=_0x067d('0x33');}else if(channels[_0x2f00a4[_0x067d('0x31')]]['channel']=_0x2f00a4[_0x067d('0x34')]){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x35'),_0x2f00a4[_0x067d('0x2f')],_0x2f00a4[_0x067d('0x31')],_0x2f00a4[_0x067d('0x36')]));channels[_0x2f00a4['localtwolinkedid']]['destinationchannel']=_0x2f00a4[_0x067d('0x36')];channels[_0x2f00a4[_0x067d('0x31')]]['userfield']=_0x067d('0x33');}}}catch(_0x5ca736){utils[_0x067d('0x25')](util[_0x067d('0x6')](_0x067d('0x2e'),_0x2f00a4[_0x067d('0x2f')]),_0x5ca736);}};exports[_0x067d('0x37')]=function(_0x150a4d){try{if(!_[_0x067d('0x1c')](channels[_0x150a4d[_0x067d('0x8')]])){utils['debug'](util['format'](_0x067d('0x38'),_0x150a4d[_0x067d('0x8')]),_0x150a4d);channels[_0x150a4d[_0x067d('0x8')]][_0x067d('0x39')]=utils[_0x067d('0x20')]();utils[_0x067d('0x5')](util[_0x067d('0x6')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x150a4d[_0x067d('0x8')],channels[_0x150a4d[_0x067d('0x8')]][_0x067d('0x39')]));}}catch(_0x3485fb){utils[_0x067d('0x25')](util[_0x067d('0x6')](_0x067d('0x38'),_0x150a4d[_0x067d('0x8')]),_0x3485fb);}};exports[_0x067d('0x3a')]=function(_0x4f9c9b){try{if(!_[_0x067d('0x1c')](channels[_0x4f9c9b['uniqueid']])){utils[_0x067d('0x10')](util[_0x067d('0x6')]('[%s][calls][musiconholdstop]',_0x4f9c9b[_0x067d('0x8')]),_0x4f9c9b);if(!_[_0x067d('0x1c')](channels[_0x4f9c9b[_0x067d('0x8')]][_0x067d('0x39')])){channels[_0x4f9c9b[_0x067d('0x8')]][_0x067d('0x3b')]+=utils[_0x067d('0x3c')](utils['now'](),channels[_0x4f9c9b[_0x067d('0x8')]][_0x067d('0x39')]);utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x3d'),_0x4f9c9b['uniqueid'],channels[_0x4f9c9b[_0x067d('0x8')]]['mohtime']));delete channels[_0x4f9c9b[_0x067d('0x8')]][_0x067d('0x39')];}}}catch(_0x5c27fa){utils[_0x067d('0x25')](util['format']('[%s][calls][musiconholdstop]',_0x4f9c9b[_0x067d('0x8')]),_0x5c27fa);}};exports['varset']=function(_0x2a3697){try{if(!_[_0x067d('0x1c')](channels[_0x2a3697[_0x067d('0x8')]])){utils[_0x067d('0x10')](util['format'](_0x067d('0x3e'),_0x2a3697[_0x067d('0x8')]),_0x2a3697);if(!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')][_0x067d('0x40')])){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x41'),_0x2a3697[_0x067d('0x8')],_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x43')]=_0x2a3697[_0x067d('0x42')];}if(!_['isNil'](_0x2a3697[_0x067d('0x3f')][_0x067d('0x44')])){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x45'),_0x2a3697[_0x067d('0x8')],_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x46')]=_0x2a3697['value'];channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x27')]='\x22'+_0x2a3697[_0x067d('0x42')]+_0x067d('0x47')+_0x2a3697[_0x067d('0x42')]+'>';}if(!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')]['xmd-callerid-preview'])||!_[_0x067d('0x1c')](_0x2a3697['variable']['xmd-callerid'])){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x48'),_0x2a3697[_0x067d('0x8')],!_['isNil'](_0x2a3697[_0x067d('0x3f')][_0x067d('0x49')])?_0x067d('0x49'):_0x067d('0x4a'),_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x27')]=_0x2a3697[_0x067d('0x42')];}if(!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')][_0x067d('0x4b')])||!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')]['xmcs-queue'])){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x48'),_0x2a3697[_0x067d('0x8')],!_['isNil'](_0x2a3697[_0x067d('0x3f')][_0x067d('0x4b')])?'xmd-queue':_0x067d('0x4c'),_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x4d')]=_0x067d('0x4e');channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x4f')]=_0x2a3697['value'];channels[_0x2a3697['uniqueid']]['queue']=!![];}if(!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')][_0x067d('0x50')])){utils[_0x067d('0x5')](util['format'](_0x067d('0x51'),_0x2a3697[_0x067d('0x8')],_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x52')]=_0x2a3697[_0x067d('0x42')];}if(!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')][_0x067d('0x53')])){utils[_0x067d('0x5')](util['format'](_0x067d('0x54'),_0x2a3697[_0x067d('0x8')],_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x55')]=_0x2a3697[_0x067d('0x42')];}if(!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')]['outboundrouteid'])){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x56'),_0x2a3697[_0x067d('0x8')],_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x57')]=_0x2a3697['value'];}if(!_[_0x067d('0x1c')](_0x2a3697['variable'][_0x067d('0x58')])){utils['info'](util[_0x067d('0x6')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x2a3697[_0x067d('0x8')],_0x2a3697['value']));channels[_0x2a3697[_0x067d('0x8')]]['sipcallid']=_0x2a3697['value'];}}}catch(_0x329be7){utils['error'](util[_0x067d('0x6')](_0x067d('0x3e'),_0x2a3697[_0x067d('0x8')]),_0x329be7);}};exports[_0x067d('0x59')]=function(_0x482989){try{if(!_[_0x067d('0x1c')](channels[_0x482989[_0x067d('0x8')]])){utils[_0x067d('0x10')](util['format'](_0x067d('0x5a'),_0x482989[_0x067d('0x8')]),_0x482989);utils['info'](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x482989[_0x067d('0x8')],_0x482989[_0x067d('0x5b')],_0x482989[_0x067d('0x5c')]));if(_0x482989[_0x067d('0x5b')][_0x067d('0x5d')]()==_0x067d('0x5e')&&_[_0x067d('0x5f')](_0x482989[_0x067d('0x5c')][_0x067d('0x5d')](),'cdr')){var _0x3e2cec=_0x482989['appdata'][_0x067d('0x60')]('=');var _0x3bc8c3=_0x3e2cec[0x0][_0x067d('0x61')](_0x3e2cec[0x0][_0x067d('0x62')]('(')+0x1,_0x3e2cec[0x0][_0x067d('0x62')](')'));var _0x108c00=_0x3e2cec[0x1];channels[_0x482989[_0x067d('0x8')]][_0x3bc8c3]=_0x108c00;}if(!_[_0x067d('0x63')]([_0x067d('0x64'),'noop',_0x067d('0x65'),_0x067d('0x5e'),_0x067d('0x66')],_0x482989[_0x067d('0x5b')]['toLowerCase']())){channels[_0x482989[_0x067d('0x8')]][_0x067d('0x4d')]=_0x482989[_0x067d('0x5b')];channels[_0x482989['uniqueid']][_0x067d('0x4f')]=_0x482989['appdata'];}}}catch(_0x1f2385){utils[_0x067d('0x25')](util['format'](_0x067d('0x5a'),_0x482989['uniqueid']),_0x1f2385);}}; \ No newline at end of file +var _0xd9b6=['BUSY','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','connectedlinenum','lastevent','getUserByInternal','accountcode','then','request','CreateVoiceCallReport','newchannel','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','channelstate','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','diffTime','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','noop','lastdata','util','./utils','NO\x20ANSWER','FAILED','ANSWERED'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xd9b6,0x64));var _0x6d9b=function(_0xc838b8,_0x2f4309){_0xc838b8=_0xc838b8-0x0;var _0x18c0be=_0xd9b6[_0xc838b8];return _0x18c0be;};'use strict';var _=require('lodash');var util=require(_0x6d9b('0x0'));var utils=require(_0x6d9b('0x1'));var dispositions=[_0x6d9b('0x2'),_0x6d9b('0x3'),_0x6d9b('0x3'),_0x6d9b('0x2'),_0x6d9b('0x2'),'NO\x20ANSWER',_0x6d9b('0x4'),_0x6d9b('0x5'),'FAILED',_0x6d9b('0x3'),'FAILED'];var channels={};function writeDB(_0xbccca1){utils[_0x6d9b('0x6')](util['format'](_0x6d9b('0x7'),_0xbccca1[_0x6d9b('0x8')],_0xbccca1[_0x6d9b('0x9')],_0xbccca1[_0x6d9b('0xa')],_0xbccca1[_0x6d9b('0xb')],_0xbccca1[_0x6d9b('0xc')],_0xbccca1['calleridnum'],_0xbccca1[_0x6d9b('0xd')],_0xbccca1[_0x6d9b('0xe')]));if(_0xbccca1['accountcode']){utils[_0x6d9b('0xf')](_0xbccca1[_0x6d9b('0x10')])[_0x6d9b('0x11')](function(_0x65786e){if(_0x65786e){_0xbccca1['UserId']=_0x65786e['id'];}utils[_0x6d9b('0x12')](_0x6d9b('0x13'),_0xbccca1);});}else{utils[_0x6d9b('0x12')](_0x6d9b('0x13'),_0xbccca1);}if(channels[_0xbccca1['uniqueid']]){delete channels[_0xbccca1[_0x6d9b('0x8')]];}}exports[_0x6d9b('0x14')]=function(_0x2e65bf){try{utils[_0x6d9b('0x15')](util[_0x6d9b('0x16')](_0x6d9b('0x17'),_0x2e65bf[_0x6d9b('0x8')]),_0x2e65bf);if(_0x2e65bf['uniqueid']==_0x2e65bf[_0x6d9b('0x18')]&&_0x2e65bf[_0x6d9b('0x9')]!=_0x6d9b('0x19')){utils[_0x6d9b('0x6')](util[_0x6d9b('0x16')](_0x6d9b('0x1a'),_0x2e65bf[_0x6d9b('0x8')],_0x2e65bf[_0x6d9b('0x1b')],_0x2e65bf[_0x6d9b('0x1c')]));channels[_0x2e65bf[_0x6d9b('0x8')]]={'uniqueid':_0x2e65bf['uniqueid'],'accountcode':_0x2e65bf[_0x6d9b('0x10')],'source':_0x2e65bf[_0x6d9b('0x1d')],'destination':_0x2e65bf[_0x6d9b('0x1c')],'destinationcontext':_0x2e65bf[_0x6d9b('0x1b')],'channel':_0x2e65bf[_0x6d9b('0x9')],'starttime':utils[_0x6d9b('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x6d9b('0x1f')};}}catch(_0x1a122b){utils[_0x6d9b('0x20')](util[_0x6d9b('0x16')](_0x6d9b('0x17'),_0x2e65bf[_0x6d9b('0x8')]),_0x1a122b);}};exports[_0x6d9b('0x21')]=function(_0x2a5e81){try{utils['debug'](util[_0x6d9b('0x16')](_0x6d9b('0x22'),_0x2a5e81[_0x6d9b('0x8')]),_0x2a5e81);if(!_[_0x6d9b('0x23')](channels[_0x2a5e81[_0x6d9b('0x8')]])&&_0x2a5e81['channelstate']==0x6){utils[_0x6d9b('0x6')](util[_0x6d9b('0x16')](_0x6d9b('0x24'),_0x2a5e81[_0x6d9b('0x8')],_0x2a5e81[_0x6d9b('0x1b')],_0x2a5e81[_0x6d9b('0x9')]));if(_['isNil'](channels[_0x2a5e81[_0x6d9b('0x8')]][_0x6d9b('0x25')])){channels[_0x2a5e81[_0x6d9b('0x8')]][_0x6d9b('0x25')]=utils[_0x6d9b('0x1e')]();}}else if(!_['isNil'](channels[_0x2a5e81[_0x6d9b('0x18')]])&&_0x2a5e81['channelstate']==0x6&&_0x2a5e81[_0x6d9b('0x1b')]!='transfer'){utils[_0x6d9b('0x6')](util[_0x6d9b('0x16')](_0x6d9b('0x26'),_0x2a5e81[_0x6d9b('0x8')],_0x2a5e81['linkedid'],_0x2a5e81['context'],_0x2a5e81[_0x6d9b('0x9')]));channels[_0x2a5e81['linkedid']][_0x6d9b('0x10')]=_0x2a5e81['accountcode'];channels[_0x2a5e81['linkedid']][_0x6d9b('0x27')]=_0x2a5e81[_0x6d9b('0x9')];if(_[_0x6d9b('0x23')](channels[_0x2a5e81[_0x6d9b('0x18')]][_0x6d9b('0x28')])){channels[_0x2a5e81[_0x6d9b('0x18')]][_0x6d9b('0x28')]=utils[_0x6d9b('0x1e')]();}channels[_0x2a5e81['linkedid']][_0x6d9b('0x29')]=dispositions[_[_0x6d9b('0x2a')](_0x2a5e81[_0x6d9b('0x2b')])]||_0x6d9b('0x4');}}catch(_0x33fbc5){utils['error'](util[_0x6d9b('0x16')](_0x6d9b('0x22'),_0x2a5e81['uniqueid']),_0x33fbc5);}};exports[_0x6d9b('0x2c')]=function(_0xe0de51){try{if(!_['isNil'](channels[_0xe0de51[_0x6d9b('0x8')]])){utils[_0x6d9b('0x15')](util[_0x6d9b('0x16')](_0x6d9b('0x2d'),_0xe0de51[_0x6d9b('0x8')]),_0xe0de51);if(_['isNil'](channels[_0xe0de51['uniqueid']][_0x6d9b('0x2e')])){channels[_0xe0de51[_0x6d9b('0x8')]]['callerid']=_0xe0de51[_0x6d9b('0x2f')]+'\x20<'+_0xe0de51['calleridnum']+'>';}utils[_0x6d9b('0x6')](util[_0x6d9b('0x16')](_0x6d9b('0x30'),_0xe0de51[_0x6d9b('0x8')],channels[_0xe0de51[_0x6d9b('0x8')]]['callerid'],_0xe0de51[_0x6d9b('0x31')]));channels[_0xe0de51[_0x6d9b('0x8')]][_0x6d9b('0x32')]=utils[_0x6d9b('0x1e')]();channels[_0xe0de51['uniqueid']][_0x6d9b('0x33')]=utils['diffTime'](channels[_0xe0de51[_0x6d9b('0x8')]][_0x6d9b('0x32')],channels[_0xe0de51[_0x6d9b('0x8')]][_0x6d9b('0x34')]);channels[_0xe0de51[_0x6d9b('0x8')]][_0x6d9b('0x35')]=channels[_0xe0de51[_0x6d9b('0x8')]][_0x6d9b('0x28')]?utils[_0x6d9b('0x36')](channels[_0xe0de51['uniqueid']][_0x6d9b('0x32')],channels[_0xe0de51['uniqueid']][_0x6d9b('0x28')]):0x0;writeDB(channels[_0xe0de51[_0x6d9b('0x8')]]);}}catch(_0x5047e0){utils[_0x6d9b('0x20')](util[_0x6d9b('0x16')]('[%s][calls][hangup]',_0xe0de51[_0x6d9b('0x8')]),_0x5047e0);}};exports['attendedtransfer']=function(_0x2fc907){try{if(!_['isNil'](channels[_0x2fc907[_0x6d9b('0x37')]])){utils['debug'](util['format'](_0x6d9b('0x38'),_0x2fc907['origtransfereruniqueid']),_0x2fc907);if(channels[_0x2fc907[_0x6d9b('0x37')]][_0x6d9b('0x9')]==_0x2fc907[_0x6d9b('0x39')]){utils[_0x6d9b('0x6')](util['format'](_0x6d9b('0x3a'),_0x2fc907[_0x6d9b('0x3b')],_0x2fc907[_0x6d9b('0x37')],_0x2fc907[_0x6d9b('0x3c')]));channels[_0x2fc907[_0x6d9b('0x37')]][_0x6d9b('0x27')]=_0x2fc907[_0x6d9b('0x3c')];channels[_0x2fc907[_0x6d9b('0x37')]][_0x6d9b('0x3d')]=_0x6d9b('0x3e');}else if(channels[_0x2fc907['localtwolinkedid']]['channel']=_0x2fc907['transfertargetchannel']){utils[_0x6d9b('0x6')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2fc907[_0x6d9b('0x3b')],_0x2fc907[_0x6d9b('0x37')],_0x2fc907[_0x6d9b('0x3f')]));channels[_0x2fc907[_0x6d9b('0x37')]]['destinationchannel']=_0x2fc907[_0x6d9b('0x3f')];channels[_0x2fc907[_0x6d9b('0x37')]][_0x6d9b('0x3d')]=_0x6d9b('0x3e');}}}catch(_0x1ef137){utils[_0x6d9b('0x20')](util[_0x6d9b('0x16')](_0x6d9b('0x38'),_0x2fc907['origtransfereruniqueid']),_0x1ef137);}};exports['musiconholdstart']=function(_0x13993d){try{if(!_['isNil'](channels[_0x13993d[_0x6d9b('0x8')]])){utils[_0x6d9b('0x15')](util[_0x6d9b('0x16')]('[%s][calls][musiconholdstart]',_0x13993d[_0x6d9b('0x8')]),_0x13993d);channels[_0x13993d[_0x6d9b('0x8')]]['musiconholdstartAt']=utils[_0x6d9b('0x1e')]();utils[_0x6d9b('0x6')](util[_0x6d9b('0x16')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x13993d[_0x6d9b('0x8')],channels[_0x13993d['uniqueid']][_0x6d9b('0x40')]));}}catch(_0x133a09){utils[_0x6d9b('0x20')](util[_0x6d9b('0x16')](_0x6d9b('0x41'),_0x13993d['uniqueid']),_0x133a09);}};exports[_0x6d9b('0x42')]=function(_0x387862){try{if(!_[_0x6d9b('0x23')](channels[_0x387862[_0x6d9b('0x8')]])){utils[_0x6d9b('0x15')](util[_0x6d9b('0x16')]('[%s][calls][musiconholdstop]',_0x387862[_0x6d9b('0x8')]),_0x387862);if(!_[_0x6d9b('0x23')](channels[_0x387862[_0x6d9b('0x8')]][_0x6d9b('0x40')])){channels[_0x387862[_0x6d9b('0x8')]][_0x6d9b('0x43')]+=utils[_0x6d9b('0x36')](utils[_0x6d9b('0x1e')](),channels[_0x387862[_0x6d9b('0x8')]][_0x6d9b('0x40')]);utils[_0x6d9b('0x6')](util[_0x6d9b('0x16')](_0x6d9b('0x44'),_0x387862[_0x6d9b('0x8')],channels[_0x387862['uniqueid']][_0x6d9b('0x43')]));delete channels[_0x387862[_0x6d9b('0x8')]][_0x6d9b('0x40')];}}}catch(_0x542ce5){utils[_0x6d9b('0x20')](util[_0x6d9b('0x16')]('[%s][calls][musiconholdstop]',_0x387862[_0x6d9b('0x8')]),_0x542ce5);}};exports[_0x6d9b('0x45')]=function(_0x4ca643){try{if(!_['isNil'](channels[_0x4ca643[_0x6d9b('0x8')]])){utils['debug'](util[_0x6d9b('0x16')](_0x6d9b('0x46'),_0x4ca643[_0x6d9b('0x8')]),_0x4ca643);if(!_['isNil'](_0x4ca643[_0x6d9b('0x47')][_0x6d9b('0x48')])){utils[_0x6d9b('0x6')](util[_0x6d9b('0x16')](_0x6d9b('0x49'),_0x4ca643[_0x6d9b('0x8')],_0x4ca643['value']));channels[_0x4ca643['uniqueid']][_0x6d9b('0x4a')]=_0x4ca643[_0x6d9b('0x4b')];}if(!_[_0x6d9b('0x23')](_0x4ca643[_0x6d9b('0x47')]['xmd-phone'])){utils['info'](util[_0x6d9b('0x16')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x4ca643[_0x6d9b('0x8')],_0x4ca643[_0x6d9b('0x4b')]));channels[_0x4ca643[_0x6d9b('0x8')]]['destination']=_0x4ca643[_0x6d9b('0x4b')];channels[_0x4ca643[_0x6d9b('0x8')]]['callerid']='\x22'+_0x4ca643[_0x6d9b('0x4b')]+'\x22\x20<'+_0x4ca643[_0x6d9b('0x4b')]+'>';}if(!_['isNil'](_0x4ca643[_0x6d9b('0x47')][_0x6d9b('0x4c')])||!_[_0x6d9b('0x23')](_0x4ca643[_0x6d9b('0x47')][_0x6d9b('0x4d')])){utils[_0x6d9b('0x6')](util[_0x6d9b('0x16')](_0x6d9b('0x4e'),_0x4ca643[_0x6d9b('0x8')],!_[_0x6d9b('0x23')](_0x4ca643[_0x6d9b('0x47')][_0x6d9b('0x4c')])?_0x6d9b('0x4c'):_0x6d9b('0x4d'),_0x4ca643['value']));channels[_0x4ca643['uniqueid']]['callerid']=_0x4ca643[_0x6d9b('0x4b')];}if(!_[_0x6d9b('0x23')](_0x4ca643[_0x6d9b('0x47')][_0x6d9b('0x4f')])||!_[_0x6d9b('0x23')](_0x4ca643[_0x6d9b('0x47')]['xmcs-queue'])){utils[_0x6d9b('0x6')](util[_0x6d9b('0x16')](_0x6d9b('0x4e'),_0x4ca643[_0x6d9b('0x8')],!_['isNil'](_0x4ca643[_0x6d9b('0x47')]['xmd-queue'])?_0x6d9b('0x4f'):_0x6d9b('0x50'),_0x4ca643[_0x6d9b('0x4b')]));channels[_0x4ca643[_0x6d9b('0x8')]][_0x6d9b('0x51')]=_0x6d9b('0x52');channels[_0x4ca643[_0x6d9b('0x8')]]['lastdata']=_0x4ca643[_0x6d9b('0x4b')];channels[_0x4ca643[_0x6d9b('0x8')]][_0x6d9b('0xa')]=!![];}if(!_[_0x6d9b('0x23')](_0x4ca643['variable'][_0x6d9b('0x53')])){utils['info'](util[_0x6d9b('0x16')](_0x6d9b('0x54'),_0x4ca643[_0x6d9b('0x8')],_0x4ca643[_0x6d9b('0x4b')]));channels[_0x4ca643[_0x6d9b('0x8')]]['ContactId']=_0x4ca643['value'];}if(!_['isNil'](_0x4ca643['variable'][_0x6d9b('0x55')])){utils[_0x6d9b('0x6')](util[_0x6d9b('0x16')](_0x6d9b('0x56'),_0x4ca643[_0x6d9b('0x8')],_0x4ca643['value']));channels[_0x4ca643[_0x6d9b('0x8')]]['type']=_0x4ca643['value'];}if(!_[_0x6d9b('0x23')](_0x4ca643[_0x6d9b('0x47')][_0x6d9b('0x57')])){utils[_0x6d9b('0x6')](util[_0x6d9b('0x16')](_0x6d9b('0x58'),_0x4ca643[_0x6d9b('0x8')],_0x4ca643[_0x6d9b('0x4b')]));channels[_0x4ca643[_0x6d9b('0x8')]]['routeid']=_0x4ca643['value'];}if(!_[_0x6d9b('0x23')](_0x4ca643[_0x6d9b('0x47')]['sipcallid'])){utils['info'](util[_0x6d9b('0x16')](_0x6d9b('0x59'),_0x4ca643[_0x6d9b('0x8')],_0x4ca643[_0x6d9b('0x4b')]));channels[_0x4ca643[_0x6d9b('0x8')]]['sipcallid']=_0x4ca643[_0x6d9b('0x4b')];}}}catch(_0x43807f){utils[_0x6d9b('0x20')](util[_0x6d9b('0x16')](_0x6d9b('0x46'),_0x4ca643[_0x6d9b('0x8')]),_0x43807f);}};exports[_0x6d9b('0x5a')]=function(_0x6ccbb1){try{if(!_[_0x6d9b('0x23')](channels[_0x6ccbb1[_0x6d9b('0x8')]])){utils['debug'](util[_0x6d9b('0x16')](_0x6d9b('0x5b'),_0x6ccbb1[_0x6d9b('0x8')]),_0x6ccbb1);utils[_0x6d9b('0x6')](util[_0x6d9b('0x16')](_0x6d9b('0x5c'),_0x6ccbb1[_0x6d9b('0x8')],_0x6ccbb1['application'],_0x6ccbb1['appdata']));if(_0x6ccbb1[_0x6d9b('0x5d')][_0x6d9b('0x5e')]()==_0x6d9b('0x5f')&&_[_0x6d9b('0x60')](_0x6ccbb1[_0x6d9b('0x61')][_0x6d9b('0x5e')](),_0x6d9b('0x62'))){var _0x55a46f=_0x6ccbb1[_0x6d9b('0x61')][_0x6d9b('0x63')]('=');var _0x4fc404=_0x55a46f[0x0][_0x6d9b('0x64')](_0x55a46f[0x0][_0x6d9b('0x65')]('(')+0x1,_0x55a46f[0x0]['lastIndexOf'](')'));var _0x4c1edf=_0x55a46f[0x1];channels[_0x6ccbb1[_0x6d9b('0x8')]][_0x4fc404]=_0x4c1edf;}if(!_[_0x6d9b('0x66')]([_0x6d9b('0x2c'),_0x6d9b('0x67'),'execif',_0x6d9b('0x5f'),'gotoif'],_0x6ccbb1[_0x6d9b('0x5d')][_0x6d9b('0x5e')]())){channels[_0x6ccbb1[_0x6d9b('0x8')]][_0x6d9b('0x51')]=_0x6ccbb1[_0x6d9b('0x5d')];channels[_0x6ccbb1['uniqueid']][_0x6d9b('0x68')]=_0x6ccbb1[_0x6d9b('0x61')];}}}catch(_0x2e92d4){utils[_0x6d9b('0x20')](util[_0x6d9b('0x16')]('[%s][calls][newexten]',_0x6ccbb1[_0x6d9b('0x8')]),_0x2e92d4);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 255781e..40d6e18 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 _0xa1b9=['info','[core]\x20connected','fullybooted','[core]\x20fullybooted','[core]\x20error','close','[core]\x20close','managerevent'];(function(_0x5e77db,_0x356d1c){var _0x34b675=function(_0x4914b5){while(--_0x4914b5){_0x5e77db['push'](_0x5e77db['shift']());}};_0x34b675(++_0x356d1c);}(_0xa1b9,0x170));var _0x9a1b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa1b9[_0x5c351c];return _0x26f3b3;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x9a1b('0x0')](_0x9a1b('0x1'));};exports['shutdown']=function(){utils[_0x9a1b('0x0')]('[core]\x20shutdown');};exports[_0x9a1b('0x2')]=function(){utils[_0x9a1b('0x0')](_0x9a1b('0x3'));};exports['error']=function(_0x1383da){utils['error'](_0x9a1b('0x4'),_0x1383da);};exports[_0x9a1b('0x5')]=function(){utils['info'](_0x9a1b('0x6'));};exports[_0x9a1b('0x7')]=function(_0x13d155){}; \ No newline at end of file +var _0xb72f=['[core]\x20shutdown','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected'];(function(_0x5a33e5,_0xf91e32){var _0x3e73dd=function(_0x56660f){while(--_0x56660f){_0x5a33e5['push'](_0x5a33e5['shift']());}};_0x3e73dd(++_0xf91e32);}(_0xb72f,0xf6));var _0xfb72=function(_0x29a29f,_0x155ce7){_0x29a29f=_0x29a29f-0x0;var _0x443ea3=_0xb72f[_0x29a29f];return _0x443ea3;};'use strict';var utils=require(_0xfb72('0x0'));exports[_0xfb72('0x1')]=function(){utils[_0xfb72('0x2')](_0xfb72('0x3'));};exports['shutdown']=function(){utils[_0xfb72('0x2')](_0xfb72('0x4'));};exports['fullybooted']=function(){utils[_0xfb72('0x2')]('[core]\x20fullybooted');};exports[_0xfb72('0x5')]=function(_0x1be9f7){utils[_0xfb72('0x5')](_0xfb72('0x6'),_0x1be9f7);};exports[_0xfb72('0x7')]=function(){utils[_0xfb72('0x2')](_0xfb72('0x8'));};exports[_0xfb72('0x9')]=function(_0x290312){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index cb60a1b..0cb2993 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 _0xcb7d=['format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','dialstatus','CreateVoiceDialReport','debug','[%s][dials][newexten]','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','info','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','endtime','holdtime','diffTime','lodash','util','./utils'];(function(_0x14beb8,_0x3e7f13){var _0x1a17ce=function(_0x37ea4b){while(--_0x37ea4b){_0x14beb8['push'](_0x14beb8['shift']());}};_0x1a17ce(++_0x3e7f13);}(_0xcb7d,0xbd));var _0xdcb7=function(_0x529a0f,_0x1cf35a){_0x529a0f=_0x529a0f-0x0;var _0x158329=_0xcb7d[_0x529a0f];return _0x158329;};'use strict';var _=require(_0xdcb7('0x0'));var util=require(_0xdcb7('0x1'));var utils=require(_0xdcb7('0x2'));var dials={};function writeDB(_0x2a2e33){utils['info'](util[_0xdcb7('0x3')](_0xdcb7('0x4'),_0x2a2e33[_0xdcb7('0x5')],_0x2a2e33[_0xdcb7('0x6')],_0x2a2e33[_0xdcb7('0x7')],_0x2a2e33[_0xdcb7('0x8')],_0x2a2e33['connectedlinenum'],_0x2a2e33[_0xdcb7('0x9')]));utils['request'](_0xdcb7('0xa'),_0x2a2e33);delete dials[_0x2a2e33[_0xdcb7('0x5')]];}exports['newexten']=function(_0x335313){try{utils[_0xdcb7('0xb')](util[_0xdcb7('0x3')](_0xdcb7('0xc'),_0x335313['uniqueid']),_0x335313);utils['info'](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x335313[_0xdcb7('0x5')],_0x335313[_0xdcb7('0xd')],_0x335313[_0xdcb7('0xe')]));if(_0x335313[_0xdcb7('0xd')][_0xdcb7('0xf')]()==_0xdcb7('0x10')&&_[_0xdcb7('0x11')](_0x335313[_0xdcb7('0xe')][_0xdcb7('0xf')](),_0xdcb7('0x12'))){var _0xb6577d=_0x335313['appdata'][_0xdcb7('0x13')]('=');dials[_0x335313[_0xdcb7('0x5')]]={'routeId':_0xb6577d[0x1]};}}catch(_0x37ec00){utils[_0xdcb7('0x14')](util['format'](_0xdcb7('0xc'),_0x335313['uniqueid']),_0x37ec00);}};exports[_0xdcb7('0x15')]=function(_0x20b0f6){try{utils[_0xdcb7('0xb')](util[_0xdcb7('0x3')](_0xdcb7('0x16'),_0x20b0f6['uniqueid']),_0x20b0f6);if(!_[_0xdcb7('0x17')](_0x20b0f6['variable']['outboundrouteid'])){utils[_0xdcb7('0x18')](util[_0xdcb7('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x20b0f6[_0xdcb7('0x5')],_0x20b0f6[_0xdcb7('0x19')]));dials[_0x20b0f6['uniqueid']]={'routeId':_0x20b0f6[_0xdcb7('0x19')]};}}catch(_0x1419a4){utils['error'](util[_0xdcb7('0x3')](_0xdcb7('0x16'),_0x20b0f6[_0xdcb7('0x5')]),_0x1419a4);}};exports['dialbegin']=function(_0x59df13){try{if(!_[_0xdcb7('0x17')](dials[_0x59df13[_0xdcb7('0x5')]])){utils[_0xdcb7('0xb')](util['format'](_0xdcb7('0x1a'),_0x59df13[_0xdcb7('0x5')]),_0x59df13);dials[_0x59df13[_0xdcb7('0x5')]]=_[_0xdcb7('0x1b')](dials[_0x59df13[_0xdcb7('0x5')]],_0x59df13);dials[_0x59df13[_0xdcb7('0x5')]][_0xdcb7('0x1c')]=utils[_0xdcb7('0x1d')]();dials[_0x59df13[_0xdcb7('0x5')]][_0xdcb7('0x1e')]=_0xdcb7('0x1f');utils[_0xdcb7('0x18')](util[_0xdcb7('0x3')](_0xdcb7('0x20'),_0x59df13[_0xdcb7('0x5')],dials[_0x59df13['uniqueid']][_0xdcb7('0x1c')]));}}catch(_0x23b0c8){utils[_0xdcb7('0x14')](util['format']('[%s][dials][dialbegin]',_0x59df13[_0xdcb7('0x5')]),_0x23b0c8);}};exports[_0xdcb7('0x21')]=function(_0x3b6c8c){try{if(!_[_0xdcb7('0x17')](dials[_0x3b6c8c[_0xdcb7('0x5')]])){utils[_0xdcb7('0xb')](util[_0xdcb7('0x3')](_0xdcb7('0x22'),_0x3b6c8c[_0xdcb7('0x5')]),_0x3b6c8c);dials[_0x3b6c8c[_0xdcb7('0x5')]][_0xdcb7('0x9')]=_0x3b6c8c[_0xdcb7('0x9')];if(_0x3b6c8c['dialstatus']==_0xdcb7('0x23')){dials[_0x3b6c8c[_0xdcb7('0x5')]]=_[_0xdcb7('0x1b')](dials[_0x3b6c8c[_0xdcb7('0x5')]],_0x3b6c8c);dials[_0x3b6c8c[_0xdcb7('0x5')]][_0xdcb7('0x24')]=utils[_0xdcb7('0x1d')]();dials[_0x3b6c8c[_0xdcb7('0x5')]]['lastevent']=_0xdcb7('0x25');utils[_0xdcb7('0x18')](util[_0xdcb7('0x3')](_0xdcb7('0x26'),_0x3b6c8c[_0xdcb7('0x5')],_0x3b6c8c['dialstatus'],dials[_0x3b6c8c[_0xdcb7('0x5')]][_0xdcb7('0x24')]));}else{utils[_0xdcb7('0x18')](util[_0xdcb7('0x3')](_0xdcb7('0x27'),_0x3b6c8c['uniqueid'],_0x3b6c8c[_0xdcb7('0x9')]));}}}catch(_0x289616){utils['error'](util['format'](_0xdcb7('0x22'),_0x3b6c8c[_0xdcb7('0x5')]),_0x289616);}};exports[_0xdcb7('0x28')]=function(_0x2921a2){try{if(!_[_0xdcb7('0x17')](dials[_0x2921a2[_0xdcb7('0x5')]])){utils[_0xdcb7('0xb')](util['format']('[%s][dials][hangup]',_0x2921a2['uniqueid']),_0x2921a2);utils[_0xdcb7('0x18')](util[_0xdcb7('0x3')](_0xdcb7('0x29'),_0x2921a2[_0xdcb7('0x5')],_0x2921a2['calleridnum'],_0x2921a2[_0xdcb7('0x2a')],_0x2921a2[_0xdcb7('0x2b')]));dials[_0x2921a2[_0xdcb7('0x5')]]=_[_0xdcb7('0x1b')](dials[_0x2921a2[_0xdcb7('0x5')]],{'endtime':utils[_0xdcb7('0x1d')](),'lastevent':_0xdcb7('0x2c')});dials[_0x2921a2['uniqueid']]['duration']=utils['diffTime'](dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x2d')],dials[_0x2921a2['uniqueid']][_0xdcb7('0x1c')]);dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x2e')]=utils[_0xdcb7('0x2f')](dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x24')]||dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x2d')],dials[_0x2921a2[_0xdcb7('0x5')]]['starttime']);dials[_0x2921a2[_0xdcb7('0x5')]]['billableseconds']=dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x24')]?utils['diffTime'](dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x2d')],dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x24')]):0x0;writeDB(dials[_0x2921a2[_0xdcb7('0x5')]]);}}catch(_0x46543d){utils['error'](util[_0xdcb7('0x3')]('[%s][dials][hangup]',_0x2921a2[_0xdcb7('0x5')]),_0x46543d);}}; \ No newline at end of file +var _0x94a6=['ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','complete','duration','diffTime','endtime','billableseconds','[%s][dials][hangup]','lodash','./utils','info','format','channel','connectedlinenum','request','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','application','appdata','toLowerCase','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','dialstatus'];(function(_0x3d56ca,_0xe40508){var _0x211cd0=function(_0x28709e){while(--_0x28709e){_0x3d56ca['push'](_0x3d56ca['shift']());}};_0x211cd0(++_0xe40508);}(_0x94a6,0x72));var _0x694a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94a6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x694a('0x0'));var util=require('util');var utils=require(_0x694a('0x1'));var dials={};function writeDB(_0x58e25a){utils[_0x694a('0x2')](util[_0x694a('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x58e25a['uniqueid'],_0x58e25a[_0x694a('0x4')],_0x58e25a['dialstring'],_0x58e25a['calleridnum'],_0x58e25a[_0x694a('0x5')],_0x58e25a['dialstatus']));utils[_0x694a('0x6')](_0x694a('0x7'),_0x58e25a);delete dials[_0x58e25a[_0x694a('0x8')]];}exports[_0x694a('0x9')]=function(_0x35a899){try{utils[_0x694a('0xa')](util[_0x694a('0x3')](_0x694a('0xb'),_0x35a899[_0x694a('0x8')]),_0x35a899);utils[_0x694a('0x2')](util[_0x694a('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x35a899[_0x694a('0x8')],_0x35a899[_0x694a('0xc')],_0x35a899[_0x694a('0xd')]));if(_0x35a899[_0x694a('0xc')][_0x694a('0xe')]()=='set'&&_['startsWith'](_0x35a899[_0x694a('0xd')][_0x694a('0xe')](),'cdr(routeid)')){var _0x2ac6b6=_0x35a899[_0x694a('0xd')][_0x694a('0xf')]('=');dials[_0x35a899[_0x694a('0x8')]]={'routeId':_0x2ac6b6[0x1]};}}catch(_0x29e3f0){utils[_0x694a('0x10')](util[_0x694a('0x3')](_0x694a('0xb'),_0x35a899[_0x694a('0x8')]),_0x29e3f0);}};exports[_0x694a('0x11')]=function(_0x1910ea){try{utils['debug'](util[_0x694a('0x3')](_0x694a('0x12'),_0x1910ea[_0x694a('0x8')]),_0x1910ea);if(!_[_0x694a('0x13')](_0x1910ea[_0x694a('0x14')][_0x694a('0x15')])){utils[_0x694a('0x2')](util[_0x694a('0x3')](_0x694a('0x16'),_0x1910ea[_0x694a('0x8')],_0x1910ea[_0x694a('0x17')]));dials[_0x1910ea[_0x694a('0x8')]]={'routeId':_0x1910ea[_0x694a('0x17')]};}}catch(_0x5402eb){utils[_0x694a('0x10')](util[_0x694a('0x3')](_0x694a('0x12'),_0x1910ea['uniqueid']),_0x5402eb);}};exports[_0x694a('0x18')]=function(_0x4b6042){try{if(!_[_0x694a('0x13')](dials[_0x4b6042['uniqueid']])){utils[_0x694a('0xa')](util['format'](_0x694a('0x19'),_0x4b6042[_0x694a('0x8')]),_0x4b6042);dials[_0x4b6042['uniqueid']]=_[_0x694a('0x1a')](dials[_0x4b6042[_0x694a('0x8')]],_0x4b6042);dials[_0x4b6042[_0x694a('0x8')]][_0x694a('0x1b')]=utils[_0x694a('0x1c')]();dials[_0x4b6042[_0x694a('0x8')]]['lastevent']=_0x694a('0x1d');utils[_0x694a('0x2')](util[_0x694a('0x3')](_0x694a('0x1e'),_0x4b6042['uniqueid'],dials[_0x4b6042['uniqueid']]['starttime']));}}catch(_0x2a319b){utils['error'](util['format']('[%s][dials][dialbegin]',_0x4b6042[_0x694a('0x8')]),_0x2a319b);}};exports['dialend']=function(_0x35f10f){try{if(!_[_0x694a('0x13')](dials[_0x35f10f['uniqueid']])){utils[_0x694a('0xa')](util[_0x694a('0x3')](_0x694a('0x1f'),_0x35f10f[_0x694a('0x8')]),_0x35f10f);dials[_0x35f10f[_0x694a('0x8')]]['dialstatus']=_0x35f10f[_0x694a('0x20')];if(_0x35f10f['dialstatus']==_0x694a('0x21')){dials[_0x35f10f[_0x694a('0x8')]]=_[_0x694a('0x1a')](dials[_0x35f10f[_0x694a('0x8')]],_0x35f10f);dials[_0x35f10f['uniqueid']][_0x694a('0x22')]=utils[_0x694a('0x1c')]();dials[_0x35f10f[_0x694a('0x8')]]['lastevent']=_0x694a('0x23');utils[_0x694a('0x2')](util['format'](_0x694a('0x24'),_0x35f10f[_0x694a('0x8')],_0x35f10f[_0x694a('0x20')],dials[_0x35f10f[_0x694a('0x8')]][_0x694a('0x22')]));}else{utils['info'](util['format'](_0x694a('0x25'),_0x35f10f['uniqueid'],_0x35f10f[_0x694a('0x20')]));}}}catch(_0x5852e){utils[_0x694a('0x10')](util['format'](_0x694a('0x1f'),_0x35f10f[_0x694a('0x8')]),_0x5852e);}};exports[_0x694a('0x26')]=function(_0x146f2a){try{if(!_[_0x694a('0x13')](dials[_0x146f2a[_0x694a('0x8')]])){utils['debug'](util[_0x694a('0x3')]('[%s][dials][hangup]',_0x146f2a['uniqueid']),_0x146f2a);utils['info'](util[_0x694a('0x3')](_0x694a('0x27'),_0x146f2a[_0x694a('0x8')],_0x146f2a[_0x694a('0x28')],_0x146f2a[_0x694a('0x29')],_0x146f2a[_0x694a('0x2a')]));dials[_0x146f2a[_0x694a('0x8')]]=_[_0x694a('0x1a')](dials[_0x146f2a[_0x694a('0x8')]],{'endtime':utils[_0x694a('0x1c')](),'lastevent':_0x694a('0x2b')});dials[_0x146f2a[_0x694a('0x8')]][_0x694a('0x2c')]=utils[_0x694a('0x2d')](dials[_0x146f2a['uniqueid']][_0x694a('0x2e')],dials[_0x146f2a[_0x694a('0x8')]][_0x694a('0x1b')]);dials[_0x146f2a[_0x694a('0x8')]]['holdtime']=utils['diffTime'](dials[_0x146f2a[_0x694a('0x8')]][_0x694a('0x22')]||dials[_0x146f2a[_0x694a('0x8')]][_0x694a('0x2e')],dials[_0x146f2a['uniqueid']][_0x694a('0x1b')]);dials[_0x146f2a[_0x694a('0x8')]][_0x694a('0x2f')]=dials[_0x146f2a[_0x694a('0x8')]][_0x694a('0x22')]?utils[_0x694a('0x2d')](dials[_0x146f2a[_0x694a('0x8')]]['endtime'],dials[_0x146f2a[_0x694a('0x8')]][_0x694a('0x22')]):0x0;writeDB(dials[_0x146f2a['uniqueid']]);}}catch(_0x592b4e){utils[_0x694a('0x10')](util[_0x694a('0x3')](_0x694a('0x30'),_0x146f2a[_0x694a('0x8')]),_0x592b4e);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 04e86c3..4632c0c 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 _0xeefd=['[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','port','info','XDR\x20DISABLED','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','device','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup'];(function(_0x252ef1,_0x2e0041){var _0x25817c=function(_0x243776){while(--_0x243776){_0x252ef1['push'](_0x252ef1['shift']());}};_0x25817c(++_0x2e0041);}(_0xeefd,0x123));var _0xdeef=function(_0x2dbfbe,_0x119e32){_0x2dbfbe=_0x2dbfbe-0x0;var _0x375c84=_0xeefd[_0x2dbfbe];return _0x375c84;};var AsteriskManager=require(_0xdeef('0x0'));var config=require(_0xdeef('0x1'));var utils=require(_0xdeef('0x2'));var util=require(_0xdeef('0x3'));var isXDREnabled=config[_0xdeef('0x4')]&&config[_0xdeef('0x4')][_0xdeef('0x5')]?!config[_0xdeef('0x4')][_0xdeef('0x5')]:!![];var isProduction=config[_0xdeef('0x6')]===_0xdeef('0x7')||![];var isLocalAsterisk=config[_0xdeef('0x4')]&&config[_0xdeef('0x4')][_0xdeef('0x8')]===!![]||![];var ami=new AsteriskManager(config[_0xdeef('0x9')][_0xdeef('0xa')],config['asterisk']['ip'],config[_0xdeef('0x9')]['username'],config['asterisk']['password'],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xdeef('0xb')](_0xdeef('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xdeef('0xb')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0xdeef('0xd'));var recordings=require(_0xdeef('0xe'));var members=require(_0xdeef('0xf'));var dials=require(_0xdeef('0x10'));var transfers=require(_0xdeef('0x11'));var core=require('./core.controller');ami['on'](_0xdeef('0x12'),core[_0xdeef('0x12')]);ami['on']('shutdown',core[_0xdeef('0x13')]);ami['on'](_0xdeef('0x14'),core[_0xdeef('0x14')]);ami['on'](_0xdeef('0x15'),core[_0xdeef('0x15')]);ami['on'](_0xdeef('0x16'),core[_0xdeef('0x16')]);ami['on'](_0xdeef('0x17'),core[_0xdeef('0x17')]);ami['on']('devicestatechange',function(_0x53800a){try{utils[_0xdeef('0x18')](util['format']('[%s][index][devicestatechange]',_0x53800a[_0xdeef('0x19')]),_0x53800a);members['devicestatechange'](_0x53800a);}catch(_0x8506ca){utils['error'](util[_0xdeef('0x1a')](_0xdeef('0x1b'),_0x53800a['device']),_0x8506ca);}});ami['on'](_0xdeef('0x1c'),function(_0x2fc7de){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x1d'),_0x2fc7de['uniqueid']),_0x2fc7de);agents[_0xdeef('0x1c')](_0x2fc7de);}catch(_0x2f030e){utils['error'](util['format'](_0xdeef('0x1d'),_0x2fc7de[_0xdeef('0x1e')]),_0x2f030e);}});ami['on'](_0xdeef('0x1f'),function(_0x189a24){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')]('[%s][index][agentringnoanswer]',_0x189a24[_0xdeef('0x1e')]),_0x189a24);agents['agentringnoanswer'](_0x189a24);}catch(_0x26ad30){utils[_0xdeef('0x15')](util['format'](_0xdeef('0x20'),_0x189a24[_0xdeef('0x1e')]),_0x26ad30);}});ami['on']('agentconnect',function(_0x316e1b){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x21'),_0x316e1b[_0xdeef('0x1e')]),_0x316e1b);agents['agentconnect'](_0x316e1b);queues[_0xdeef('0x22')](_0x316e1b);}catch(_0x1c18e6){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x21'),_0x316e1b['uniqueid']),_0x1c18e6);}});ami['on']('agentcomplete',function(_0x3dee4d){try{utils[_0xdeef('0x18')](util['format']('[%s][index][agentcomplete]',_0x3dee4d[_0xdeef('0x1e')]),_0x3dee4d);agents[_0xdeef('0x23')](_0x3dee4d);queues[_0xdeef('0x23')](_0x3dee4d);members[_0xdeef('0x23')](_0x3dee4d);}catch(_0x1c0317){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x24'),_0x3dee4d[_0xdeef('0x1e')]),_0x1c0317);}});ami['on'](_0xdeef('0x25'),function(_0x52bc80){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x26'),_0x52bc80['uniqueid']),_0x52bc80);agents[_0xdeef('0x25')](_0x52bc80);queues['queuecallerabandon'](_0x52bc80);}catch(_0x27e314){utils['error'](util[_0xdeef('0x1a')]('[%s][index][queuecallerabandon]',_0x52bc80[_0xdeef('0x1e')]),_0x27e314);}});ami['on'](_0xdeef('0x27'),function(_0x49b2df){try{utils[_0xdeef('0x18')](util['format'](_0xdeef('0x28'),_0x49b2df[_0xdeef('0x1e')]),_0x49b2df);queues[_0xdeef('0x27')](_0x49b2df);recordings[_0xdeef('0x27')](_0x49b2df);}catch(_0x30e6de){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x28'),_0x49b2df[_0xdeef('0x1e')]),_0x30e6de);}});ami['on']('queuecallerleave',function(_0x475f85){try{utils['debug'](util[_0xdeef('0x1a')](_0xdeef('0x29'),_0x475f85['uniqueid']),_0x475f85);queues['queuecallerleave'](_0x475f85);}catch(_0x2f3187){utils['error'](util['format'](_0xdeef('0x29'),_0x475f85[_0xdeef('0x1e')]),_0x2f3187);}});ami['on'](_0xdeef('0x2a'),function(_0x2ef8de){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')]('[%s][index][musiconholdstart]',_0x2ef8de[_0xdeef('0x1e')]),_0x2ef8de);queues[_0xdeef('0x2a')](_0x2ef8de);calls[_0xdeef('0x2a')](_0x2ef8de);}catch(_0x2b2712){utils['error'](util[_0xdeef('0x1a')](_0xdeef('0x2b'),_0x2ef8de[_0xdeef('0x1e')]),_0x2b2712);}});ami['on']('musiconholdstop',function(_0x440da6){try{utils['debug'](util[_0xdeef('0x1a')](_0xdeef('0x2c'),_0x440da6['uniqueid']),_0x440da6);queues[_0xdeef('0x2d')](_0x440da6);calls[_0xdeef('0x2d')](_0x440da6);}catch(_0x26d147){utils['error'](util[_0xdeef('0x1a')]('[%s][index][musiconholdstop]',_0x440da6['uniqueid']),_0x26d147);}});ami['on'](_0xdeef('0x2e'),function(_0x37dc7f){try{utils[_0xdeef('0x18')](util['format'](_0xdeef('0x2f'),_0x37dc7f['uniqueid']),_0x37dc7f);calls[_0xdeef('0x2e')](_0x37dc7f);recordings[_0xdeef('0x2e')](_0x37dc7f);}catch(_0x13986e){utils[_0xdeef('0x15')](util['format'](_0xdeef('0x2f'),_0x37dc7f[_0xdeef('0x1e')]),_0x13986e);}});ami['on']('hangup',function(_0x18612d){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')]('[%s][index][hangup]',_0x18612d[_0xdeef('0x1e')]),_0x18612d);calls[_0xdeef('0x30')](_0x18612d);recordings['hangup'](_0x18612d);dials[_0xdeef('0x30')](_0x18612d);agents[_0xdeef('0x30')](_0x18612d);queues[_0xdeef('0x30')](_0x18612d);}catch(_0x2cf472){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x31'),_0x18612d['uniqueid']),_0x2cf472);}});ami['on'](_0xdeef('0x32'),function(_0x55cc5a){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x33'),_0x55cc5a['uniqueid']),_0x55cc5a);members[_0xdeef('0x32')](_0x55cc5a);}catch(_0x5247b3){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x33'),_0x55cc5a[_0xdeef('0x1e')]),_0x5247b3);}});ami['on'](_0xdeef('0x34'),function(_0xe2737d){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x35'),_0xe2737d['uniqueid']),_0xe2737d);queues[_0xdeef('0x34')](_0xe2737d);agents['blindtransfer'](_0xe2737d);transfers[_0xdeef('0x34')](_0xe2737d);}catch(_0x1c7d14){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x35'),_0xe2737d['uniqueid']),_0x1c7d14);}});ami['on'](_0xdeef('0x36'),function(_0xc5e375){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x37'),_0xc5e375[_0xdeef('0x38')]),_0xc5e375);queues[_0xdeef('0x36')](_0xc5e375);transfers['attendedtransfer'](_0xc5e375);agents[_0xdeef('0x36')](_0xc5e375);calls[_0xdeef('0x36')](_0xc5e375);}catch(_0x238465){utils['error'](util[_0xdeef('0x1a')](_0xdeef('0x37'),_0xc5e375[_0xdeef('0x38')]),_0x238465);}});ami['on']('varset',function(_0x124aa5){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')]('[%s][index][varset]',_0x124aa5['uniqueid']),_0x124aa5);queues[_0xdeef('0x39')](_0x124aa5);recordings[_0xdeef('0x39')](_0x124aa5);calls[_0xdeef('0x39')](_0x124aa5);dials[_0xdeef('0x39')](_0x124aa5);}catch(_0x5dfcb1){utils['error'](util[_0xdeef('0x1a')](_0xdeef('0x3a'),_0x124aa5['uniqueid']),_0x5dfcb1);}});ami['on']('newexten',function(_0x243586){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')]('[%s][index][newexten]',_0x243586[_0xdeef('0x1e')]),_0x243586);calls['newexten'](_0x243586);recordings[_0xdeef('0x3b')](_0x243586);dials['newexten'](_0x243586);}catch(_0x18fcdf){utils[_0xdeef('0x15')](util['format'](_0xdeef('0x3c'),_0x243586[_0xdeef('0x1e')]),_0x18fcdf);}});ami['on'](_0xdeef('0x3d'),function(_0x17f668){try{utils['debug'](util['format'](_0xdeef('0x3e'),_0x17f668[_0xdeef('0x1e')]),_0x17f668);calls['newchannel'](_0x17f668);recordings[_0xdeef('0x3d')](_0x17f668);}catch(_0x36bea5){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')]('[%s][index][newchannel]',_0x17f668[_0xdeef('0x1e')]),_0x36bea5);}});ami['on'](_0xdeef('0x3f'),function(_0x3c2173){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x40'),_0x3c2173[_0xdeef('0x1e')]),_0x3c2173);dials[_0xdeef('0x3f')](_0x3c2173);}catch(_0x26535e){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x41'),_0x3c2173[_0xdeef('0x1e')]),_0x26535e);}});ami['on'](_0xdeef('0x42'),function(_0x38d611){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x43'),_0x38d611['uniqueid']),_0x38d611);dials['dialend'](_0x38d611);}catch(_0x2451d6){utils[_0xdeef('0x15')](util['format'](_0xdeef('0x43'),_0x38d611[_0xdeef('0x1e')]),_0x2451d6);}});} \ No newline at end of file +var _0x79fd=['[%s][index][newexten]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][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]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten'];(function(_0x5bf31c,_0x28ba2f){var _0x11fd5b=function(_0x586dc8){while(--_0x586dc8){_0x5bf31c['push'](_0x5bf31c['shift']());}};_0x11fd5b(++_0x28ba2f);}(_0x79fd,0x160));var _0xd79f=function(_0x2ca2e9,_0x12d615){_0x2ca2e9=_0x2ca2e9-0x0;var _0x102a5a=_0x79fd[_0x2ca2e9];return _0x102a5a;};var AsteriskManager=require(_0xd79f('0x0'));var config=require(_0xd79f('0x1'));var utils=require(_0xd79f('0x2'));var util=require(_0xd79f('0x3'));var isXDREnabled=config[_0xd79f('0x4')]&&config['xdr'][_0xd79f('0x5')]?!config[_0xd79f('0x4')][_0xd79f('0x5')]:!![];var isProduction=config['env']===_0xd79f('0x6')||![];var isLocalAsterisk=config[_0xd79f('0x4')]&&config[_0xd79f('0x4')][_0xd79f('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xd79f('0x8')][_0xd79f('0x9')],config[_0xd79f('0x8')]['ip'],config[_0xd79f('0x8')][_0xd79f('0xa')],config['asterisk'][_0xd79f('0xb')],!![]);ami[_0xd79f('0xc')]();if(!isXDREnabled){utils[_0xd79f('0xd')](_0xd79f('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xd79f('0xd')](_0xd79f('0xf'));}else{var agents=require(_0xd79f('0x10'));var calls=require('./calls.controller');var queues=require(_0xd79f('0x11'));var recordings=require(_0xd79f('0x12'));var members=require(_0xd79f('0x13'));var dials=require('./dials.controller');var transfers=require(_0xd79f('0x14'));var core=require('./core.controller');ami['on'](_0xd79f('0x15'),core['connect']);ami['on'](_0xd79f('0x16'),core[_0xd79f('0x16')]);ami['on'](_0xd79f('0x17'),core[_0xd79f('0x17')]);ami['on']('error',core[_0xd79f('0x18')]);ami['on'](_0xd79f('0x19'),core['close']);ami['on'](_0xd79f('0x1a'),core[_0xd79f('0x1a')]);ami['on'](_0xd79f('0x1b'),function(_0x4c2c31){try{utils[_0xd79f('0x1c')](util[_0xd79f('0x1d')](_0xd79f('0x1e'),_0x4c2c31['device']),_0x4c2c31);members['devicestatechange'](_0x4c2c31);}catch(_0x512ea6){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')](_0xd79f('0x1e'),_0x4c2c31['device']),_0x512ea6);}});ami['on'](_0xd79f('0x1f'),function(_0x20111c){try{utils[_0xd79f('0x1c')](util[_0xd79f('0x1d')]('[%s][index][agentcalled]',_0x20111c['uniqueid']),_0x20111c);agents[_0xd79f('0x1f')](_0x20111c);}catch(_0x34e9b4){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')](_0xd79f('0x20'),_0x20111c[_0xd79f('0x21')]),_0x34e9b4);}});ami['on']('agentringnoanswer',function(_0x1c0dd5){try{utils[_0xd79f('0x1c')](util[_0xd79f('0x1d')](_0xd79f('0x22'),_0x1c0dd5[_0xd79f('0x21')]),_0x1c0dd5);agents[_0xd79f('0x23')](_0x1c0dd5);}catch(_0x3a4710){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')](_0xd79f('0x22'),_0x1c0dd5[_0xd79f('0x21')]),_0x3a4710);}});ami['on'](_0xd79f('0x24'),function(_0x22a055){try{utils[_0xd79f('0x1c')](util[_0xd79f('0x1d')](_0xd79f('0x25'),_0x22a055[_0xd79f('0x21')]),_0x22a055);agents[_0xd79f('0x24')](_0x22a055);queues[_0xd79f('0x24')](_0x22a055);}catch(_0x15a89f){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')](_0xd79f('0x25'),_0x22a055[_0xd79f('0x21')]),_0x15a89f);}});ami['on'](_0xd79f('0x26'),function(_0x4dd991){try{utils[_0xd79f('0x1c')](util[_0xd79f('0x1d')]('[%s][index][agentcomplete]',_0x4dd991[_0xd79f('0x21')]),_0x4dd991);agents[_0xd79f('0x26')](_0x4dd991);queues[_0xd79f('0x26')](_0x4dd991);members[_0xd79f('0x26')](_0x4dd991);}catch(_0x6b06db){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')](_0xd79f('0x27'),_0x4dd991['uniqueid']),_0x6b06db);}});ami['on']('queuecallerabandon',function(_0x596ad7){try{utils[_0xd79f('0x1c')](util[_0xd79f('0x1d')](_0xd79f('0x28'),_0x596ad7[_0xd79f('0x21')]),_0x596ad7);agents[_0xd79f('0x29')](_0x596ad7);queues[_0xd79f('0x29')](_0x596ad7);}catch(_0xe4e39c){utils[_0xd79f('0x18')](util['format'](_0xd79f('0x28'),_0x596ad7[_0xd79f('0x21')]),_0xe4e39c);}});ami['on'](_0xd79f('0x2a'),function(_0x449033){try{utils['debug'](util['format'](_0xd79f('0x2b'),_0x449033[_0xd79f('0x21')]),_0x449033);queues['queuecallerjoin'](_0x449033);recordings[_0xd79f('0x2a')](_0x449033);}catch(_0x33243e){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')](_0xd79f('0x2b'),_0x449033['uniqueid']),_0x33243e);}});ami['on'](_0xd79f('0x2c'),function(_0x1f4d06){try{utils['debug'](util[_0xd79f('0x1d')](_0xd79f('0x2d'),_0x1f4d06[_0xd79f('0x21')]),_0x1f4d06);queues['queuecallerleave'](_0x1f4d06);}catch(_0x336547){utils['error'](util[_0xd79f('0x1d')](_0xd79f('0x2d'),_0x1f4d06['uniqueid']),_0x336547);}});ami['on'](_0xd79f('0x2e'),function(_0x3c6df7){try{utils['debug'](util[_0xd79f('0x1d')]('[%s][index][musiconholdstart]',_0x3c6df7[_0xd79f('0x21')]),_0x3c6df7);queues[_0xd79f('0x2e')](_0x3c6df7);calls[_0xd79f('0x2e')](_0x3c6df7);}catch(_0x39f2f6){utils['error'](util[_0xd79f('0x1d')](_0xd79f('0x2f'),_0x3c6df7[_0xd79f('0x21')]),_0x39f2f6);}});ami['on'](_0xd79f('0x30'),function(_0x441225){try{utils['debug'](util[_0xd79f('0x1d')](_0xd79f('0x31'),_0x441225[_0xd79f('0x21')]),_0x441225);queues['musiconholdstop'](_0x441225);calls[_0xd79f('0x30')](_0x441225);}catch(_0x6663b3){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')]('[%s][index][musiconholdstop]',_0x441225[_0xd79f('0x21')]),_0x6663b3);}});ami['on'](_0xd79f('0x32'),function(_0x314360){try{utils[_0xd79f('0x1c')](util['format'](_0xd79f('0x33'),_0x314360['uniqueid']),_0x314360);calls[_0xd79f('0x32')](_0x314360);recordings[_0xd79f('0x32')](_0x314360);}catch(_0x242b5a){utils['error'](util[_0xd79f('0x1d')](_0xd79f('0x33'),_0x314360[_0xd79f('0x21')]),_0x242b5a);}});ami['on'](_0xd79f('0x34'),function(_0x55aada){try{utils[_0xd79f('0x1c')](util[_0xd79f('0x1d')](_0xd79f('0x35'),_0x55aada['uniqueid']),_0x55aada);calls[_0xd79f('0x34')](_0x55aada);recordings[_0xd79f('0x34')](_0x55aada);dials[_0xd79f('0x34')](_0x55aada);agents['hangup'](_0x55aada);queues[_0xd79f('0x34')](_0x55aada);}catch(_0xf4c099){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')](_0xd79f('0x35'),_0x55aada[_0xd79f('0x21')]),_0xf4c099);}});ami['on'](_0xd79f('0x36'),function(_0x141b6b){try{utils['debug'](util['format'](_0xd79f('0x37'),_0x141b6b[_0xd79f('0x21')]),_0x141b6b);members[_0xd79f('0x36')](_0x141b6b);}catch(_0x24a7f2){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')]('[%s][index][cdr]',_0x141b6b[_0xd79f('0x21')]),_0x24a7f2);}});ami['on'](_0xd79f('0x38'),function(_0x8fca8c){try{utils[_0xd79f('0x1c')](util[_0xd79f('0x1d')]('[%s][index][blindtransfer]',_0x8fca8c[_0xd79f('0x21')]),_0x8fca8c);queues[_0xd79f('0x38')](_0x8fca8c);agents[_0xd79f('0x38')](_0x8fca8c);transfers[_0xd79f('0x38')](_0x8fca8c);}catch(_0x482bc9){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')]('[%s][index][blindtransfer]',_0x8fca8c[_0xd79f('0x21')]),_0x482bc9);}});ami['on'](_0xd79f('0x39'),function(_0x316312){try{utils[_0xd79f('0x1c')](util[_0xd79f('0x1d')]('[%s][index][attendedtransfer]',_0x316312[_0xd79f('0x3a')]),_0x316312);queues[_0xd79f('0x39')](_0x316312);transfers[_0xd79f('0x39')](_0x316312);agents[_0xd79f('0x39')](_0x316312);calls[_0xd79f('0x39')](_0x316312);}catch(_0x29cc88){utils['error'](util[_0xd79f('0x1d')]('[%s][index][attendedtransfer]',_0x316312[_0xd79f('0x3a')]),_0x29cc88);}});ami['on'](_0xd79f('0x3b'),function(_0x24f95e){try{utils['debug'](util[_0xd79f('0x1d')](_0xd79f('0x3c'),_0x24f95e[_0xd79f('0x21')]),_0x24f95e);queues[_0xd79f('0x3b')](_0x24f95e);recordings[_0xd79f('0x3b')](_0x24f95e);calls[_0xd79f('0x3b')](_0x24f95e);dials['varset'](_0x24f95e);}catch(_0x35d2d1){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')]('[%s][index][varset]',_0x24f95e[_0xd79f('0x21')]),_0x35d2d1);}});ami['on'](_0xd79f('0x3d'),function(_0x3efe9a){try{utils[_0xd79f('0x1c')](util[_0xd79f('0x1d')](_0xd79f('0x3e'),_0x3efe9a[_0xd79f('0x21')]),_0x3efe9a);calls[_0xd79f('0x3d')](_0x3efe9a);recordings['newexten'](_0x3efe9a);dials[_0xd79f('0x3d')](_0x3efe9a);}catch(_0x5afc16){utils['error'](util[_0xd79f('0x1d')](_0xd79f('0x3e'),_0x3efe9a['uniqueid']),_0x5afc16);}});ami['on']('newchannel',function(_0x22d5b7){try{utils['debug'](util['format']('[%s][index][newchannel]',_0x22d5b7['uniqueid']),_0x22d5b7);calls[_0xd79f('0x3f')](_0x22d5b7);recordings['newchannel'](_0x22d5b7);}catch(_0x26085b){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')]('[%s][index][newchannel]',_0x22d5b7['uniqueid']),_0x26085b);}});ami['on'](_0xd79f('0x40'),function(_0x393cb0){try{utils[_0xd79f('0x1c')](util[_0xd79f('0x1d')](_0xd79f('0x41'),_0x393cb0[_0xd79f('0x21')]),_0x393cb0);dials[_0xd79f('0x40')](_0x393cb0);}catch(_0x2a32a6){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')](_0xd79f('0x42'),_0x393cb0[_0xd79f('0x21')]),_0x2a32a6);}});ami['on'](_0xd79f('0x43'),function(_0x1ff694){try{utils[_0xd79f('0x1c')](util['format'](_0xd79f('0x44'),_0x1ff694[_0xd79f('0x21')]),_0x1ff694);dials[_0xd79f('0x43')](_0x1ff694);}catch(_0x311b4e){utils[_0xd79f('0x18')](util[_0xd79f('0x1d')](_0xd79f('0x44'),_0x1ff694[_0xd79f('0x21')]),_0x311b4e);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 4bbdbc2..815b1af 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 _0xd6e1=['assign','[%s][members][agentcomplete]','data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data2','destinationchannel','lodash','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','then','name','internal','CreateMemberReport','getUserByName','split','request','error','startsWith','devicestatechange','debug','device','state','INUSE','BUSY','now','agent','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','isNil','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue'];(function(_0x2b8722,_0x50d540){var _0x20c180=function(_0x595b40){while(--_0x595b40){_0x2b8722['push'](_0x2b8722['shift']());}};_0x20c180(++_0x50d540);}(_0xd6e1,0x17a));var _0x1d6e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd6e1[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x1d6e('0x0'));var util=require('util');var utils=require(_0x1d6e('0x1'));var members={};var exclude=[_0x1d6e('0x2'),'Queue:'];function writeDB(_0x592c52){utils[_0x1d6e('0x3')](util[_0x1d6e('0x4')](_0x1d6e('0x5'),_0x592c52[_0x1d6e('0x6')],_0x592c52[_0x1d6e('0x7')],_0x592c52[_0x1d6e('0x8')],_0x592c52['data2'],_0x592c52[_0x1d6e('0x9')],_0x592c52['type']));if(_0x592c52[_0x1d6e('0x7')]){utils['getUserByInterface'](_0x592c52[_0x1d6e('0x7')])[_0x1d6e('0xa')](function(_0x3289f4){if(_0x3289f4){_0x592c52[_0x1d6e('0x9')]=_0x3289f4[_0x1d6e('0xb')];_0x592c52[_0x1d6e('0xc')]=_0x3289f4[_0x1d6e('0xc')];utils['request'](_0x1d6e('0xd'),_0x592c52);}else{utils[_0x1d6e('0xe')](_0x592c52[_0x1d6e('0x7')][_0x1d6e('0xf')]('/')[0x1])[_0x1d6e('0xa')](function(_0x890851){if(_0x890851){_0x592c52['membername']=_0x890851[_0x1d6e('0xb')];_0x592c52[_0x1d6e('0xc')]=_0x890851[_0x1d6e('0xc')];utils[_0x1d6e('0x10')](_0x1d6e('0xd'),_0x592c52);}});}})['catch'](function(_0x3e7dc8){utils[_0x1d6e('0x11')](util[_0x1d6e('0x4')]('[%s][members][writeDB]',_0x592c52[_0x1d6e('0x6')]),_0x3e7dc8);});}delete members[_0x592c52['interface']];}function startsWith(_0x55729d,_0x36bc0e){return _['some'](_0x55729d,function(_0x38e3ac){return _[_0x1d6e('0x12')](_0x36bc0e,_0x38e3ac);});}exports[_0x1d6e('0x13')]=function(_0x269861){try{utils[_0x1d6e('0x14')](util['format']('[%s][members][devicestatechange]',members[_0x269861[_0x1d6e('0x15')]]?members[_0x269861['device']][_0x1d6e('0x6')]:_0x269861[_0x1d6e('0x15')]),_0x269861);utils[_0x1d6e('0x3')](util[_0x1d6e('0x4')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x269861[_0x1d6e('0x15')]]?members[_0x269861[_0x1d6e('0x15')]][_0x1d6e('0x6')]:_0x269861['device'],_0x269861[_0x1d6e('0x16')],_0x269861[_0x1d6e('0x15')]));switch(_0x269861[_0x1d6e('0x16')]){case _0x1d6e('0x17'):case _0x1d6e('0x18'):if(!startsWith(exclude,_0x269861[_0x1d6e('0x15')])){members[_0x269861[_0x1d6e('0x15')]]={'channel':'voice','interface':_0x269861[_0x1d6e('0x15')],'type':'TALKING','enterAt':utils[_0x1d6e('0x19')](),'role':_0x1d6e('0x1a')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x269861[_0x1d6e('0x15')]])){members[_0x269861[_0x1d6e('0x15')]][_0x1d6e('0x1b')]=utils['now']();members[_0x269861['device']][_0x1d6e('0x1c')]=utils[_0x1d6e('0x1d')](members[_0x269861[_0x1d6e('0x15')]][_0x1d6e('0x1b')],members[_0x269861[_0x1d6e('0x15')]][_0x1d6e('0x1e')]);if(members[_0x269861['device']][_0x1d6e('0x6')]){writeDB(members[_0x269861[_0x1d6e('0x15')]]);}}break;default:break;}}catch(_0x13978e){utils[_0x1d6e('0x11')](util[_0x1d6e('0x4')](_0x1d6e('0x1f'),members[_0x269861[_0x1d6e('0x15')]]?members[_0x269861[_0x1d6e('0x15')]]['uniqueid']:_0x269861[_0x1d6e('0x15')]),_0x13978e);}};exports[_0x1d6e('0x20')]=function(_0x94980e){try{if(!_[_0x1d6e('0x21')](members[_0x94980e[_0x1d6e('0x7')]])){utils['debug'](util[_0x1d6e('0x4')]('[%s][members][agentcomplete]',_0x94980e[_0x1d6e('0x6')]),_0x94980e);utils[_0x1d6e('0x3')](util[_0x1d6e('0x4')](_0x1d6e('0x22'),_0x94980e[_0x1d6e('0x6')],_0x94980e[_0x1d6e('0x7')],_0x94980e[_0x1d6e('0x23')]));members[_0x94980e[_0x1d6e('0x7')]]=_[_0x1d6e('0x24')](members[_0x94980e[_0x1d6e('0x7')]],{'data4':_0x94980e[_0x1d6e('0x23')],'uniqueid':_0x94980e[_0x1d6e('0x6')]});}}catch(_0x3b3f39){utils[_0x1d6e('0x11')](util[_0x1d6e('0x4')](_0x1d6e('0x25'),_0x94980e[_0x1d6e('0x6')]),_0x3b3f39);}};exports['cdr']=function(_0x24044a){try{utils[_0x1d6e('0x14')](util[_0x1d6e('0x4')]('[%s][members][cdr]',_0x24044a[_0x1d6e('0x6')]),_0x24044a);if(_0x24044a[_0x1d6e('0x8')]){var _0x5d04cc=_0x24044a['channel']['split']('-')[0x0];if(!_['isNil'](members[_0x5d04cc])){members[_0x5d04cc]=_[_0x1d6e('0x24')](members[_0x5d04cc],{'data1':members[_0x5d04cc][_0x1d6e('0x26')]||_0x24044a[_0x1d6e('0x27')],'data2':members[_0x5d04cc]['data2']||_0x24044a[_0x1d6e('0x28')],'data3':members[_0x5d04cc][_0x1d6e('0x29')]||_0x24044a[_0x1d6e('0x2a')],'uniqueid':members[_0x5d04cc][_0x1d6e('0x6')]||_0x24044a[_0x1d6e('0x6')]});utils[_0x1d6e('0x3')](util[_0x1d6e('0x4')](_0x1d6e('0x2b'),_0x24044a[_0x1d6e('0x6')],members[_0x5d04cc]['data1'],members[_0x5d04cc][_0x1d6e('0x2c')],members[_0x5d04cc][_0x1d6e('0x29')]));if(members[_0x5d04cc][_0x1d6e('0x1b')]){writeDB(members[_0x5d04cc]);}}}if(_0x24044a[_0x1d6e('0x2d')]){var _0x38d57c=_0x24044a[_0x1d6e('0x2d')][_0x1d6e('0xf')]('-')[0x0];if(!_[_0x1d6e('0x21')](members[_0x38d57c])){members[_0x38d57c]=_[_0x1d6e('0x24')](members[_0x38d57c],{'data1':members[_0x38d57c][_0x1d6e('0x26')]||_0x24044a['type'],'data2':members[_0x38d57c][_0x1d6e('0x2c')]||_0x24044a[_0x1d6e('0x28')],'data3':members[_0x38d57c][_0x1d6e('0x29')]||_0x24044a['destination'],'uniqueid':members[_0x38d57c]['uniqueid']||_0x24044a[_0x1d6e('0x6')]});utils[_0x1d6e('0x3')](util[_0x1d6e('0x4')](_0x1d6e('0x2b'),_0x24044a[_0x1d6e('0x6')],members[_0x38d57c]['data1'],members[_0x38d57c][_0x1d6e('0x2c')],members[_0x38d57c][_0x1d6e('0x29')]));if(members[_0x38d57c][_0x1d6e('0x1b')]){writeDB(members[_0x38d57c]);}}}}catch(_0x442e50){utils[_0x1d6e('0x11')](util[_0x1d6e('0x4')]('[%s][members][cdr]',_0x24044a[_0x1d6e('0x6')]),_0x442e50);}}; \ No newline at end of file +var _0xe81b=['duration','exitAt','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','debug','[%s][members][cdr]','channel','split','data1','data2','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destination','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','membername','type','name','internal','request','CreateMemberReport','getUserByName','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','now','agent','NOT_INUSE','isNil'];(function(_0xb5eb06,_0x2c7549){var _0x1b048a=function(_0x9f7d69){while(--_0x9f7d69){_0xb5eb06['push'](_0xb5eb06['shift']());}};_0x1b048a(++_0x2c7549);}(_0xe81b,0xde));var _0xbe81=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe81b[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xbe81('0x0'));var util=require(_0xbe81('0x1'));var utils=require('./utils');var members={};var exclude=[_0xbe81('0x2'),_0xbe81('0x3')];function writeDB(_0x22d168){utils[_0xbe81('0x4')](util[_0xbe81('0x5')](_0xbe81('0x6'),_0x22d168[_0xbe81('0x7')],_0x22d168[_0xbe81('0x8')],_0x22d168['channel'],_0x22d168['data2'],_0x22d168[_0xbe81('0x9')],_0x22d168[_0xbe81('0xa')]));if(_0x22d168['interface']){utils['getUserByInterface'](_0x22d168[_0xbe81('0x8')])['then'](function(_0x20b77b){if(_0x20b77b){_0x22d168[_0xbe81('0x9')]=_0x20b77b[_0xbe81('0xb')];_0x22d168['internal']=_0x20b77b[_0xbe81('0xc')];utils[_0xbe81('0xd')](_0xbe81('0xe'),_0x22d168);}else{utils[_0xbe81('0xf')](_0x22d168[_0xbe81('0x8')]['split']('/')[0x1])['then'](function(_0x355faa){if(_0x355faa){_0x22d168['membername']=_0x355faa[_0xbe81('0xb')];_0x22d168['internal']=_0x355faa['internal'];utils['request']('CreateMemberReport',_0x22d168);}});}})[_0xbe81('0x10')](function(_0x36a442){utils[_0xbe81('0x11')](util['format'](_0xbe81('0x12'),_0x22d168[_0xbe81('0x7')]),_0x36a442);});}delete members[_0x22d168[_0xbe81('0x8')]];}function startsWith(_0x2db20e,_0x3b107c){return _[_0xbe81('0x13')](_0x2db20e,function(_0x39789f){return _[_0xbe81('0x14')](_0x3b107c,_0x39789f);});}exports[_0xbe81('0x15')]=function(_0x31f879){try{utils['debug'](util[_0xbe81('0x5')](_0xbe81('0x16'),members[_0x31f879[_0xbe81('0x17')]]?members[_0x31f879[_0xbe81('0x17')]][_0xbe81('0x7')]:_0x31f879[_0xbe81('0x17')]),_0x31f879);utils['info'](util[_0xbe81('0x5')](_0xbe81('0x18'),members[_0x31f879[_0xbe81('0x17')]]?members[_0x31f879[_0xbe81('0x17')]]['uniqueid']:_0x31f879[_0xbe81('0x17')],_0x31f879[_0xbe81('0x19')],_0x31f879[_0xbe81('0x17')]));switch(_0x31f879[_0xbe81('0x19')]){case _0xbe81('0x1a'):case'BUSY':if(!startsWith(exclude,_0x31f879[_0xbe81('0x17')])){members[_0x31f879[_0xbe81('0x17')]]={'channel':_0xbe81('0x1b'),'interface':_0x31f879['device'],'type':_0xbe81('0x1c'),'enterAt':utils[_0xbe81('0x1d')](),'role':_0xbe81('0x1e')};}break;case _0xbe81('0x1f'):if(!_[_0xbe81('0x20')](members[_0x31f879['device']])){members[_0x31f879[_0xbe81('0x17')]]['exitAt']=utils[_0xbe81('0x1d')]();members[_0x31f879[_0xbe81('0x17')]][_0xbe81('0x21')]=utils['diffTime'](members[_0x31f879[_0xbe81('0x17')]][_0xbe81('0x22')],members[_0x31f879[_0xbe81('0x17')]][_0xbe81('0x23')]);if(members[_0x31f879[_0xbe81('0x17')]][_0xbe81('0x7')]){writeDB(members[_0x31f879[_0xbe81('0x17')]]);}}break;default:break;}}catch(_0x341118){utils[_0xbe81('0x11')](util[_0xbe81('0x5')](_0xbe81('0x16'),members[_0x31f879[_0xbe81('0x17')]]?members[_0x31f879['device']][_0xbe81('0x7')]:_0x31f879[_0xbe81('0x17')]),_0x341118);}};exports['agentcomplete']=function(_0x4942d4){try{if(!_[_0xbe81('0x20')](members[_0x4942d4[_0xbe81('0x8')]])){utils['debug'](util['format'](_0xbe81('0x24'),_0x4942d4[_0xbe81('0x7')]),_0x4942d4);utils[_0xbe81('0x4')](util['format'](_0xbe81('0x25'),_0x4942d4[_0xbe81('0x7')],_0x4942d4[_0xbe81('0x8')],_0x4942d4[_0xbe81('0x26')]));members[_0x4942d4[_0xbe81('0x8')]]=_[_0xbe81('0x27')](members[_0x4942d4['interface']],{'data4':_0x4942d4[_0xbe81('0x26')],'uniqueid':_0x4942d4[_0xbe81('0x7')]});}}catch(_0x2a5978){utils[_0xbe81('0x11')](util[_0xbe81('0x5')](_0xbe81('0x24'),_0x4942d4[_0xbe81('0x7')]),_0x2a5978);}};exports[_0xbe81('0x28')]=function(_0x4dae37){try{utils[_0xbe81('0x29')](util[_0xbe81('0x5')](_0xbe81('0x2a'),_0x4dae37[_0xbe81('0x7')]),_0x4dae37);if(_0x4dae37[_0xbe81('0x2b')]){var _0x5e7621=_0x4dae37[_0xbe81('0x2b')][_0xbe81('0x2c')]('-')[0x0];if(!_['isNil'](members[_0x5e7621])){members[_0x5e7621]=_[_0xbe81('0x27')](members[_0x5e7621],{'data1':members[_0x5e7621][_0xbe81('0x2d')]||_0x4dae37[_0xbe81('0xa')],'data2':members[_0x5e7621][_0xbe81('0x2e')]||_0x4dae37[_0xbe81('0x2f')],'data3':members[_0x5e7621][_0xbe81('0x30')]||_0x4dae37['destination'],'uniqueid':members[_0x5e7621][_0xbe81('0x7')]||_0x4dae37['uniqueid']});utils[_0xbe81('0x4')](util['format'](_0xbe81('0x31'),_0x4dae37[_0xbe81('0x7')],members[_0x5e7621]['data1'],members[_0x5e7621][_0xbe81('0x2e')],members[_0x5e7621]['data3']));if(members[_0x5e7621][_0xbe81('0x22')]){writeDB(members[_0x5e7621]);}}}if(_0x4dae37['destinationchannel']){var _0x4bf71d=_0x4dae37['destinationchannel']['split']('-')[0x0];if(!_[_0xbe81('0x20')](members[_0x4bf71d])){members[_0x4bf71d]=_['assign'](members[_0x4bf71d],{'data1':members[_0x4bf71d][_0xbe81('0x2d')]||_0x4dae37[_0xbe81('0xa')],'data2':members[_0x4bf71d][_0xbe81('0x2e')]||_0x4dae37[_0xbe81('0x2f')],'data3':members[_0x4bf71d][_0xbe81('0x30')]||_0x4dae37[_0xbe81('0x32')],'uniqueid':members[_0x4bf71d]['uniqueid']||_0x4dae37['uniqueid']});utils['info'](util[_0xbe81('0x5')](_0xbe81('0x31'),_0x4dae37['uniqueid'],members[_0x4bf71d][_0xbe81('0x2d')],members[_0x4bf71d][_0xbe81('0x2e')],members[_0x4bf71d][_0xbe81('0x30')]));if(members[_0x4bf71d][_0xbe81('0x22')]){writeDB(members[_0x4bf71d]);}}}}catch(_0x133c45){utils[_0xbe81('0x11')](util[_0xbe81('0x5')]('[%s][members][cdr]',_0x4dae37[_0xbe81('0x7')]),_0x133c45);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 6eb97c1..e4c619f 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 _0x7aca=['attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','isNil','value','CONTINUE','queuecallerabandon','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleave','holdtime','diffTime','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension'];(function(_0x41daeb,_0x3f138d){var _0x5b142d=function(_0x195224){while(--_0x195224){_0x41daeb['push'](_0x41daeb['shift']());}};_0x5b142d(++_0x3f138d);}(_0x7aca,0x151));var _0xa7ac=function(_0xbac413,_0x3fab3a){_0xbac413=_0xbac413-0x0;var _0x23e833=_0x7aca[_0xbac413];return _0x23e833;};'use strict';var _=require(_0xa7ac('0x0'));var util=require('util');var utils=require(_0xa7ac('0x1'));var queues={};function writeDB(_0x596e2a){utils[_0xa7ac('0x2')](util['format'](_0xa7ac('0x3'),_0x596e2a[_0xa7ac('0x4')],_0x596e2a[_0xa7ac('0x5')],_0x596e2a[_0xa7ac('0x6')],_0x596e2a[_0xa7ac('0x7')],_0x596e2a[_0xa7ac('0x8')],_0x596e2a[_0xa7ac('0x9')],_0x596e2a[_0xa7ac('0xa')]));if(_0x596e2a[_0xa7ac('0x6')]){utils[_0xa7ac('0xb')](_0x596e2a[_0xa7ac('0x6')])[_0xa7ac('0xc')](function(_0x260910){if(_0x260910){_0x596e2a[_0xa7ac('0xd')]=_0x260910[_0xa7ac('0xd')];}utils[_0xa7ac('0xe')](_0xa7ac('0xf'),_0x596e2a);});}else{utils[_0xa7ac('0xe')](_0xa7ac('0xf'),_0x596e2a);}if(_0x596e2a[_0xa7ac('0x10')]){delete queues[_0x596e2a[_0xa7ac('0x10')]];}else{delete queues[_0x596e2a['uniqueid']];}}exports[_0xa7ac('0x11')]=function(_0x9f8241){try{utils[_0xa7ac('0x12')](util[_0xa7ac('0x13')](_0xa7ac('0x14'),_0x9f8241['uniqueid']),_0x9f8241);utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x15'),_0x9f8241[_0xa7ac('0x4')],_0x9f8241[_0xa7ac('0x6')],_0x9f8241[_0xa7ac('0x16')]));queues[_0x9f8241['uniqueid']]=_[_0xa7ac('0x17')](_0x9f8241,{'originalposition':_0x9f8241[_0xa7ac('0x16')],'queuecallerjoinAt':utils[_0xa7ac('0x18')](),'mohtime':0x0});}catch(_0x33a00e){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')](_0xa7ac('0x14'),_0x9f8241[_0xa7ac('0x4')]),_0x33a00e);}};exports[_0xa7ac('0x1a')]=function(_0x31625b){try{if(!_['isNil'](queues[_0x31625b[_0xa7ac('0x4')]])){utils[_0xa7ac('0x12')](util[_0xa7ac('0x13')](_0xa7ac('0x1b'),_0x31625b[_0xa7ac('0x4')]),_0x31625b);if(queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0x1c')]){if(!queues[_0x31625b['uniqueid']]['queuecallerabandon']&&!queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0x1d')]){queues[_0x31625b['uniqueid']][_0xa7ac('0x1e')]=!![];queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0x1f')]=utils['now']();queues[_0x31625b['uniqueid']][_0xa7ac('0xa')]=_0xa7ac('0x20');}utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x21'),_0x31625b['uniqueid'],queues[_0x31625b[_0xa7ac('0x4')]]['name'],queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0xa')]));writeDB(queues[_0x31625b[_0xa7ac('0x4')]]);}else if(queues[_0x31625b[_0xa7ac('0x4')]]['transfereduniqueid']){utils['info'](util['format'](_0xa7ac('0x22'),_0x31625b[_0xa7ac('0x4')],queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0x23')],queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0x10')]));queues[queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0x10')]]=queues[_0x31625b['uniqueid']];queues[queues[_0x31625b['uniqueid']][_0xa7ac('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x31625b['uniqueid']];}}}catch(_0x15017d){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')](_0xa7ac('0x1b'),_0x31625b[_0xa7ac('0x4')]),_0x15017d);}};exports['varset']=function(_0x1a75fb){try{utils['debug'](util[_0xa7ac('0x13')]('[%s][queues][varset]',_0x1a75fb[_0xa7ac('0x4')]),_0x1a75fb);if(!_[_0xa7ac('0x24')](_0x1a75fb['variable']['queuestatus'])&&_0x1a75fb[_0xa7ac('0x25')]['toUpperCase']()!==_0xa7ac('0x26')){if(!_[_0xa7ac('0x24')](queues[_0x1a75fb[_0xa7ac('0x4')]])){queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0x27')]=![];queues[_0x1a75fb['uniqueid']]['queuecallerabandonAt']=null;queues[_0x1a75fb[_0xa7ac('0x4')]]['queuecallerexit']=!![];queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0x28')]=utils[_0xa7ac('0x18')]();queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0xa')]=_0x1a75fb[_0xa7ac('0x25')]['toUpperCase']();utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x29'),_0x1a75fb[_0xa7ac('0x4')],queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0x23')],_0x1a75fb['value'],queues[_0x1a75fb['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x1a75fb['uniqueid']]);}}else if(!_[_0xa7ac('0x24')](_0x1a75fb['variable']['queueposition'])){if(!_[_0xa7ac('0x24')](queues[_0x1a75fb[_0xa7ac('0x4')]])&&!queues[_0x1a75fb[_0xa7ac('0x4')]]['queuecallerabandon']){queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0x27')]=![];queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0x2a')]=null;queues[_0x1a75fb[_0xa7ac('0x4')]]['queuecallerexit']=!![];queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0x28')]=utils[_0xa7ac('0x18')]();queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0xa')]=_0xa7ac('0x2b');utils['info'](util[_0xa7ac('0x13')](_0xa7ac('0x2c'),_0x1a75fb['uniqueid'],queues[_0x1a75fb['uniqueid']][_0xa7ac('0x23')],_0x1a75fb[_0xa7ac('0x25')],queues[_0x1a75fb['uniqueid']]['queuecallerexitreason']));}}}catch(_0x199a04){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')](_0xa7ac('0x2d'),_0x1a75fb[_0xa7ac('0x4')]),_0x199a04);}};exports[_0xa7ac('0x27')]=function(_0x501f53){try{if(!_[_0xa7ac('0x24')](queues[_0x501f53[_0xa7ac('0x4')]])){utils['debug'](util['format'](_0xa7ac('0x2e'),_0x501f53[_0xa7ac('0x4')]),_0x501f53);queues[_0x501f53[_0xa7ac('0x4')]][_0xa7ac('0x1d')]=![];queues[_0x501f53['uniqueid']][_0xa7ac('0x28')]=null;queues[_0x501f53[_0xa7ac('0x4')]]['queuecallerabandon']=!![];queues[_0x501f53['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x501f53[_0xa7ac('0x4')]][_0xa7ac('0xa')]=_0xa7ac('0x2f');utils[_0xa7ac('0x2')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x501f53[_0xa7ac('0x4')],queues[_0x501f53['uniqueid']][_0xa7ac('0x23')],queues[_0x501f53['uniqueid']][_0xa7ac('0xa')]));}}catch(_0x122680){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')](_0xa7ac('0x2e'),_0x501f53['uniqueid']),_0x122680);}};exports['queuecallerleave']=function(_0xa2254a){try{if(!_['isNil'](queues[_0xa2254a['uniqueid']])){utils[_0xa7ac('0x12')](util[_0xa7ac('0x13')](_0xa7ac('0x30'),_0xa2254a[_0xa7ac('0x4')]),_0xa2254a);utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x31'),_0xa2254a[_0xa7ac('0x4')],queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x23')],_0xa2254a[_0xa7ac('0x32')],_0xa2254a['connectedlinename']));queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x33')]=!![];queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x1c')]=utils['now']();queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x34')]=utils[_0xa7ac('0x35')](queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x1c')],queues[_0xa2254a[_0xa7ac('0x4')]]['queuecallerjoinAt']);queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x16')]=_0xa2254a['position'];queues[_0xa2254a['uniqueid']][_0xa7ac('0x36')]=_0xa2254a[_0xa7ac('0x36')];queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x32')]=_0xa2254a[_0xa7ac('0x32')];queues[_0xa2254a[_0xa7ac('0x4')]]['connectedlinename']=_0xa2254a[_0xa7ac('0x37')];}}catch(_0x215b24){utils['error'](util[_0xa7ac('0x13')](_0xa7ac('0x30'),_0xa2254a[_0xa7ac('0x4')]),_0x215b24);}};exports[_0xa7ac('0x38')]=function(_0x4266a3){try{if(!_[_0xa7ac('0x24')](queues[_0x4266a3['uniqueid']])){utils[_0xa7ac('0x12')](util[_0xa7ac('0x13')](_0xa7ac('0x39'),_0x4266a3[_0xa7ac('0x4')]),_0x4266a3);utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x3a'),_0x4266a3[_0xa7ac('0x4')],queues[_0x4266a3[_0xa7ac('0x4')]]['name'],_0x4266a3[_0xa7ac('0x3b')],_0x4266a3[_0xa7ac('0x3c')]));queues[_0x4266a3[_0xa7ac('0x4')]][_0xa7ac('0x27')]=![];queues[_0x4266a3['uniqueid']]['queuecallerabandon']=![];queues[_0x4266a3['uniqueid']][_0xa7ac('0x2a')]=null;queues[_0x4266a3['uniqueid']][_0xa7ac('0x1d')]=![];queues[_0x4266a3[_0xa7ac('0x4')]][_0xa7ac('0xa')]=null;queues[_0x4266a3[_0xa7ac('0x4')]]['queuecallerexitAt']=null;queues[_0x4266a3[_0xa7ac('0x4')]][_0xa7ac('0x3d')]=!![];queues[_0x4266a3[_0xa7ac('0x4')]][_0xa7ac('0x9')]=_0x4266a3[_0xa7ac('0x3c')];queues[_0x4266a3['uniqueid']][_0xa7ac('0x7')]=_0x4266a3[_0xa7ac('0x3b')];}}catch(_0xd469d4){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')]('[%s][queues][agentconnect]',_0x4266a3[_0xa7ac('0x4')]),_0xd469d4);}};exports[_0xa7ac('0x3e')]=function(_0x3b3422){try{if(!_[_0xa7ac('0x24')](queues[_0x3b3422[_0xa7ac('0x4')]])){if(queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x1c')]){utils[_0xa7ac('0x12')](util['format'](_0xa7ac('0x3f'),_0x3b3422[_0xa7ac('0x4')]),_0x3b3422);queues[_0x3b3422['uniqueid']][_0xa7ac('0x27')]=![];queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x27')]=![];queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x2a')]=null;queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x1d')]=![];queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x28')]=null;queues[_0x3b3422[_0xa7ac('0x4')]]['assigned']=!![];queues[_0x3b3422['uniqueid']][_0xa7ac('0x7')]=_0x3b3422[_0xa7ac('0x3b')];queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x1e')]=!![];queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x1f')]=utils[_0xa7ac('0x18')]();if(_0x3b3422[_0xa7ac('0x40')]==_0xa7ac('0x41')){if(!queues[_0x3b3422['uniqueid']][_0xa7ac('0x41')]){queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0xa')]=_0xa7ac('0x42');}}else{queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0xa')]=_0xa7ac('0x43')+_0x3b3422[_0xa7ac('0x40')][_0xa7ac('0x44')]();}utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x45'),_0x3b3422[_0xa7ac('0x4')],queues[_0x3b3422[_0xa7ac('0x4')]]['name'],_0x3b3422[_0xa7ac('0x3b')],queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0xa')]));writeDB(queues[_0x3b3422[_0xa7ac('0x4')]]);}}}catch(_0x4737d2){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')](_0xa7ac('0x3f'),_0x3b3422[_0xa7ac('0x4')]),_0x4737d2);}};exports[_0xa7ac('0x46')]=function(_0x4d84d3){try{if(!_[_0xa7ac('0x24')](queues[_0x4d84d3['transfereeuniqueid']])){utils[_0xa7ac('0x12')](util[_0xa7ac('0x13')](_0xa7ac('0x47'),_0x4d84d3[_0xa7ac('0x4')]),_0x4d84d3);queues[_0x4d84d3[_0xa7ac('0x48')]][_0xa7ac('0x41')]=!![];queues[_0x4d84d3[_0xa7ac('0x48')]][_0xa7ac('0x49')]='BLIND';queues[_0x4d84d3[_0xa7ac('0x48')]][_0xa7ac('0x4a')]=_0x4d84d3['extension'];queues[_0x4d84d3[_0xa7ac('0x48')]][_0xa7ac('0x4b')]=_0x4d84d3[_0xa7ac('0x48')];queues[_0x4d84d3[_0xa7ac('0x48')]][_0xa7ac('0xa')]=_0xa7ac('0x4c');utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x4d'),_0x4d84d3['uniqueid'],queues[_0x4d84d3[_0xa7ac('0x48')]][_0xa7ac('0x23')],_0x4d84d3[_0xa7ac('0x48')],_0x4d84d3[_0xa7ac('0x4e')]));}}catch(_0x517636){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')]('[%s][queues][blindtransfer]',_0x4d84d3[_0xa7ac('0x4')]),_0x517636);}};exports[_0xa7ac('0x4f')]=function(_0x4671a0){try{utils[_0xa7ac('0x12')](util['format'](_0xa7ac('0x50'),_0x4671a0[_0xa7ac('0x51')]),_0x4671a0);if(_0x4671a0[_0xa7ac('0x51')]==_0x4671a0[_0xa7ac('0x52')]){if(!_[_0xa7ac('0x24')](queues[_0x4671a0[_0xa7ac('0x53')]])){utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4671a0[_0xa7ac('0x51')],queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x23')],_0x4671a0[_0xa7ac('0x54')]));queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x41')]=!![];queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x49')]=_0xa7ac('0x55');queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x4a')]=_0x4671a0['origtransfererexten'];queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x4b')]=_0x4671a0['origtransfereruniqueid'];queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0xa')]=_0xa7ac('0x56');}if(!_[_0xa7ac('0x24')](queues[_0x4671a0[_0xa7ac('0x52')]])){if(_0x4671a0[_0xa7ac('0x57')]&&queues[_0x4671a0[_0xa7ac('0x57')]]){queues[_0x4671a0[_0xa7ac('0x57')]][_0xa7ac('0x58')]=0x1;queues[_0x4671a0['transfereeuniqueid']]=_[_0xa7ac('0x59')](queues[_0x4671a0[_0xa7ac('0x57')]]);queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x10')]=_0x4671a0[_0xa7ac('0x5a')];queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x58')]=0x2;queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x8')]=queues[_0x4671a0['secondtransfererlinkedid']][_0xa7ac('0x8')];queues[_0x4671a0['transfereeuniqueid']]['calleridname']=queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x5b')];queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x5c')]=utils['now']();queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x1c')]=utils[_0xa7ac('0x18')]();queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x34')]=0x0;queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x5d')]=0x0;utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x5e'),_0x4671a0[_0xa7ac('0x51')],queues[_0x4671a0['transfereeuniqueid']][_0xa7ac('0x23')],queues[_0x4671a0['transfereeuniqueid']][_0xa7ac('0x8')],queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x5b')]));}else{utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4671a0[_0xa7ac('0x51')],queues[_0x4671a0['origtransfererlinkedid']][_0xa7ac('0x23')],_0x4671a0['secondtransfererlinkedid']));queues[_0x4671a0[_0xa7ac('0x52')]][_0xa7ac('0x10')]=_0x4671a0[_0xa7ac('0x53')];}}}else if(_0x4671a0[_0xa7ac('0x5f')]==_0x4671a0[_0xa7ac('0x53')]){if(!_[_0xa7ac('0x24')](queues[_0x4671a0[_0xa7ac('0x52')]])){utils['info'](util['format'](_0xa7ac('0x60'),_0x4671a0['origtransfereruniqueid'],queues[_0x4671a0[_0xa7ac('0x52')]]['name'],_0x4671a0[_0xa7ac('0x5f')],_0x4671a0[_0xa7ac('0x61')]));queues[_0x4671a0[_0xa7ac('0x52')]][_0xa7ac('0x41')]=!![];queues[_0x4671a0[_0xa7ac('0x52')]][_0xa7ac('0x49')]='ATTENDED';queues[_0x4671a0[_0xa7ac('0x52')]][_0xa7ac('0x4a')]=_0x4671a0['secondtransfererexten'];queues[_0x4671a0[_0xa7ac('0x52')]]['transferuniqueid']=_0x4671a0[_0xa7ac('0x5f')];queues[_0x4671a0['origtransfererlinkedid']][_0xa7ac('0xa')]=_0xa7ac('0x56');}if(!_[_0xa7ac('0x24')](queues[_0x4671a0[_0xa7ac('0x53')]])){if(_0x4671a0[_0xa7ac('0x62')]&&queues[_0x4671a0['transfertargetlinkedid']]){queues[_0x4671a0['transfertargetlinkedid']][_0xa7ac('0x58')]=0x1;queues[_0x4671a0[_0xa7ac('0x5a')]]=_[_0xa7ac('0x59')](queues[_0x4671a0[_0xa7ac('0x62')]]);queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x10')]=_0x4671a0[_0xa7ac('0x5a')];queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x58')]=0x2;queues[_0x4671a0[_0xa7ac('0x5a')]]['calleridnum']=queues[_0x4671a0[_0xa7ac('0x52')]][_0xa7ac('0x8')];queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x5b')]=queues[_0x4671a0[_0xa7ac('0x52')]][_0xa7ac('0x5b')];queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x5c')]=utils[_0xa7ac('0x18')]();queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x1c')]=utils['now']();queues[_0x4671a0['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x5d')]=0x0;utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x4671a0[_0xa7ac('0x51')],queues[_0x4671a0[_0xa7ac('0x5a')]]['name'],queues[_0x4671a0[_0xa7ac('0x5a')]]['transfereduniqueid'],queues[_0x4671a0['transfertargetuniqueid']]['calleridnum'],queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x5b')]));}else{utils['info'](util[_0xa7ac('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4671a0[_0xa7ac('0x51')],queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x23')],_0x4671a0[_0xa7ac('0x52')]));queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x10')]=_0x4671a0['origtransfererlinkedid'];}}}}catch(_0x482fde){utils[_0xa7ac('0x19')](util['format'](_0xa7ac('0x50'),_0x4671a0['origtransfereruniqueid']),_0x482fde);}};exports['musiconholdstart']=function(_0x48cb57){try{if(!_[_0xa7ac('0x24')](queues[_0x48cb57[_0xa7ac('0x4')]])){utils[_0xa7ac('0x12')](util['format'](_0xa7ac('0x63'),_0x48cb57[_0xa7ac('0x4')]),_0x48cb57);queues[_0x48cb57['uniqueid']][_0xa7ac('0x64')]=utils[_0xa7ac('0x18')]();utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x48cb57[_0xa7ac('0x4')],queues[_0x48cb57[_0xa7ac('0x4')]]['name'],queues[_0x48cb57['uniqueid']][_0xa7ac('0x64')]));}}catch(_0x29d246){utils['error'](util[_0xa7ac('0x13')](_0xa7ac('0x63'),_0x48cb57[_0xa7ac('0x4')]),_0x29d246);}};exports[_0xa7ac('0x65')]=function(_0x196b98){try{if(!_['isNil'](queues[_0x196b98[_0xa7ac('0x4')]])){if(!_['isNil'](queues[_0x196b98[_0xa7ac('0x4')]]['musiconholdstartAt'])){utils[_0xa7ac('0x12')](util[_0xa7ac('0x13')](_0xa7ac('0x66'),_0x196b98[_0xa7ac('0x4')]),_0x196b98);queues[_0x196b98[_0xa7ac('0x4')]][_0xa7ac('0x5d')]+=utils['diffTime'](utils[_0xa7ac('0x18')](),queues[_0x196b98[_0xa7ac('0x4')]][_0xa7ac('0x64')]);utils['info'](util[_0xa7ac('0x13')](_0xa7ac('0x67'),_0x196b98['uniqueid'],queues[_0x196b98[_0xa7ac('0x4')]][_0xa7ac('0x23')],queues[_0x196b98[_0xa7ac('0x4')]][_0xa7ac('0x5d')]));delete queues[_0x196b98[_0xa7ac('0x4')]]['musiconholdstartAt'];}}}catch(_0x361a43){utils[_0xa7ac('0x19')](util['format'](_0xa7ac('0x66'),_0x196b98['uniqueid']),_0x361a43);}}; \ No newline at end of file +var _0x002c=['uniqueid','queuecallerjoin','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','debug','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','queueposition','queuecallerexit','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','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','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x002c,0x130));var _0xc002=function(_0x30ac36,_0x3afd03){_0x30ac36=_0x30ac36-0x0;var _0x32c2fb=_0x002c[_0x30ac36];return _0x32c2fb;};'use strict';var _=require('lodash');var util=require(_0xc002('0x0'));var utils=require(_0xc002('0x1'));var queues={};function writeDB(_0x288529){utils[_0xc002('0x2')](util['format'](_0xc002('0x3'),_0x288529['uniqueid'],_0x288529[_0xc002('0x4')],_0x288529[_0xc002('0x5')],_0x288529[_0xc002('0x6')],_0x288529['calleridnum'],_0x288529[_0xc002('0x7')],_0x288529[_0xc002('0x8')]));if(_0x288529[_0xc002('0x5')]){utils[_0xc002('0x9')](_0x288529['queue'])['then'](function(_0x46c42b){if(_0x46c42b){_0x288529['type']=_0x46c42b[_0xc002('0xa')];}utils[_0xc002('0xb')](_0xc002('0xc'),_0x288529);});}else{utils[_0xc002('0xb')](_0xc002('0xc'),_0x288529);}if(_0x288529['transfereduniqueid']){delete queues[_0x288529[_0xc002('0xd')]];}else{delete queues[_0x288529[_0xc002('0xe')]];}}exports[_0xc002('0xf')]=function(_0x3d1ddd){try{utils['debug'](util[_0xc002('0x10')](_0xc002('0x11'),_0x3d1ddd[_0xc002('0xe')]),_0x3d1ddd);utils[_0xc002('0x2')](util[_0xc002('0x10')](_0xc002('0x12'),_0x3d1ddd[_0xc002('0xe')],_0x3d1ddd[_0xc002('0x5')],_0x3d1ddd[_0xc002('0x13')]));queues[_0x3d1ddd[_0xc002('0xe')]]=_[_0xc002('0x14')](_0x3d1ddd,{'originalposition':_0x3d1ddd['position'],'queuecallerjoinAt':utils[_0xc002('0x15')](),'mohtime':0x0});}catch(_0x3a8551){utils[_0xc002('0x16')](util['format']('[%s][queues][queuecallerjoin]',_0x3d1ddd[_0xc002('0xe')]),_0x3a8551);}};exports[_0xc002('0x17')]=function(_0x51825f){try{if(!_[_0xc002('0x18')](queues[_0x51825f[_0xc002('0xe')]])){utils[_0xc002('0x19')](util[_0xc002('0x10')]('[%s][queues][hangup]',_0x51825f[_0xc002('0xe')]),_0x51825f);if(queues[_0x51825f[_0xc002('0xe')]][_0xc002('0x1a')]){if(!queues[_0x51825f[_0xc002('0xe')]][_0xc002('0x1b')]&&!queues[_0x51825f[_0xc002('0xe')]]['queuecallerexit']){queues[_0x51825f[_0xc002('0xe')]][_0xc002('0x1c')]=!![];queues[_0x51825f[_0xc002('0xe')]][_0xc002('0x1d')]=utils[_0xc002('0x15')]();queues[_0x51825f[_0xc002('0xe')]][_0xc002('0x8')]=_0xc002('0x1e');}utils[_0xc002('0x2')](util[_0xc002('0x10')](_0xc002('0x1f'),_0x51825f['uniqueid'],queues[_0x51825f[_0xc002('0xe')]][_0xc002('0x20')],queues[_0x51825f[_0xc002('0xe')]][_0xc002('0x8')]));writeDB(queues[_0x51825f['uniqueid']]);}else if(queues[_0x51825f['uniqueid']]['transfereduniqueid']){utils[_0xc002('0x2')](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x51825f[_0xc002('0xe')],queues[_0x51825f[_0xc002('0xe')]][_0xc002('0x20')],queues[_0x51825f[_0xc002('0xe')]][_0xc002('0xd')]));queues[queues[_0x51825f[_0xc002('0xe')]][_0xc002('0xd')]]=queues[_0x51825f['uniqueid']];queues[queues[_0x51825f[_0xc002('0xe')]][_0xc002('0xd')]][_0xc002('0x21')]=0x2;delete queues[_0x51825f[_0xc002('0xe')]];}}}catch(_0x4b6039){utils['error'](util['format'](_0xc002('0x22'),_0x51825f[_0xc002('0xe')]),_0x4b6039);}};exports[_0xc002('0x23')]=function(_0x5653d9){try{utils['debug'](util[_0xc002('0x10')](_0xc002('0x24'),_0x5653d9[_0xc002('0xe')]),_0x5653d9);if(!_[_0xc002('0x18')](_0x5653d9[_0xc002('0x25')][_0xc002('0x26')])&&_0x5653d9[_0xc002('0x27')][_0xc002('0x28')]()!==_0xc002('0x29')){if(!_['isNil'](queues[_0x5653d9[_0xc002('0xe')]])){queues[_0x5653d9[_0xc002('0xe')]][_0xc002('0x1b')]=![];queues[_0x5653d9['uniqueid']][_0xc002('0x2a')]=null;queues[_0x5653d9[_0xc002('0xe')]]['queuecallerexit']=!![];queues[_0x5653d9['uniqueid']][_0xc002('0x2b')]=utils[_0xc002('0x15')]();queues[_0x5653d9[_0xc002('0xe')]][_0xc002('0x8')]=_0x5653d9[_0xc002('0x27')][_0xc002('0x28')]();utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x5653d9[_0xc002('0xe')],queues[_0x5653d9[_0xc002('0xe')]]['name'],_0x5653d9[_0xc002('0x27')],queues[_0x5653d9[_0xc002('0xe')]][_0xc002('0x8')]));writeDB(queues[_0x5653d9['uniqueid']]);}}else if(!_[_0xc002('0x18')](_0x5653d9[_0xc002('0x25')][_0xc002('0x2c')])){if(!_[_0xc002('0x18')](queues[_0x5653d9[_0xc002('0xe')]])&&!queues[_0x5653d9[_0xc002('0xe')]][_0xc002('0x1b')]){queues[_0x5653d9[_0xc002('0xe')]]['queuecallerabandon']=![];queues[_0x5653d9['uniqueid']][_0xc002('0x2a')]=null;queues[_0x5653d9[_0xc002('0xe')]][_0xc002('0x2d')]=!![];queues[_0x5653d9['uniqueid']]['queuecallerexitAt']=utils[_0xc002('0x15')]();queues[_0x5653d9['uniqueid']][_0xc002('0x8')]=_0xc002('0x2e');utils['info'](util['format'](_0xc002('0x2f'),_0x5653d9[_0xc002('0xe')],queues[_0x5653d9[_0xc002('0xe')]][_0xc002('0x20')],_0x5653d9['value'],queues[_0x5653d9[_0xc002('0xe')]][_0xc002('0x8')]));}}}catch(_0x57e1fb){utils[_0xc002('0x16')](util[_0xc002('0x10')](_0xc002('0x24'),_0x5653d9[_0xc002('0xe')]),_0x57e1fb);}};exports['queuecallerabandon']=function(_0x3b3465){try{if(!_[_0xc002('0x18')](queues[_0x3b3465[_0xc002('0xe')]])){utils[_0xc002('0x19')](util['format'](_0xc002('0x30'),_0x3b3465[_0xc002('0xe')]),_0x3b3465);queues[_0x3b3465['uniqueid']][_0xc002('0x2d')]=![];queues[_0x3b3465[_0xc002('0xe')]][_0xc002('0x2b')]=null;queues[_0x3b3465[_0xc002('0xe')]][_0xc002('0x1b')]=!![];queues[_0x3b3465[_0xc002('0xe')]][_0xc002('0x2a')]=utils[_0xc002('0x15')]();queues[_0x3b3465[_0xc002('0xe')]][_0xc002('0x8')]=_0xc002('0x31');utils[_0xc002('0x2')](util[_0xc002('0x10')](_0xc002('0x32'),_0x3b3465['uniqueid'],queues[_0x3b3465[_0xc002('0xe')]][_0xc002('0x20')],queues[_0x3b3465[_0xc002('0xe')]]['queuecallerexitreason']));}}catch(_0x41a5f4){utils[_0xc002('0x16')](util[_0xc002('0x10')](_0xc002('0x30'),_0x3b3465[_0xc002('0xe')]),_0x41a5f4);}};exports[_0xc002('0x33')]=function(_0xba9327){try{if(!_[_0xc002('0x18')](queues[_0xba9327['uniqueid']])){utils[_0xc002('0x19')](util[_0xc002('0x10')](_0xc002('0x34'),_0xba9327[_0xc002('0xe')]),_0xba9327);utils[_0xc002('0x2')](util[_0xc002('0x10')](_0xc002('0x35'),_0xba9327['uniqueid'],queues[_0xba9327[_0xc002('0xe')]][_0xc002('0x20')],_0xba9327[_0xc002('0x36')],_0xba9327[_0xc002('0x37')]));queues[_0xba9327[_0xc002('0xe')]][_0xc002('0x33')]=!![];queues[_0xba9327[_0xc002('0xe')]][_0xc002('0x1a')]=utils[_0xc002('0x15')]();queues[_0xba9327['uniqueid']]['holdtime']=utils[_0xc002('0x38')](queues[_0xba9327[_0xc002('0xe')]]['queuecallerleaveAt'],queues[_0xba9327['uniqueid']][_0xc002('0x39')]);queues[_0xba9327[_0xc002('0xe')]][_0xc002('0x13')]=_0xba9327['position'];queues[_0xba9327[_0xc002('0xe')]][_0xc002('0x3a')]=_0xba9327[_0xc002('0x3a')];queues[_0xba9327['uniqueid']][_0xc002('0x36')]=_0xba9327[_0xc002('0x36')];queues[_0xba9327[_0xc002('0xe')]][_0xc002('0x37')]=_0xba9327[_0xc002('0x37')];}}catch(_0x1ed90a){utils['error'](util['format']('[%s][queues][queuecallerleave]',_0xba9327['uniqueid']),_0x1ed90a);}};exports['agentconnect']=function(_0xf779fd){try{if(!_[_0xc002('0x18')](queues[_0xf779fd[_0xc002('0xe')]])){utils[_0xc002('0x19')](util[_0xc002('0x10')]('[%s][queues][agentconnect]',_0xf779fd[_0xc002('0xe')]),_0xf779fd);utils[_0xc002('0x2')](util[_0xc002('0x10')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0xf779fd[_0xc002('0xe')],queues[_0xf779fd[_0xc002('0xe')]]['name'],_0xf779fd[_0xc002('0x3b')],_0xf779fd[_0xc002('0x3c')]));queues[_0xf779fd[_0xc002('0xe')]][_0xc002('0x1b')]=![];queues[_0xf779fd[_0xc002('0xe')]][_0xc002('0x1b')]=![];queues[_0xf779fd['uniqueid']][_0xc002('0x2a')]=null;queues[_0xf779fd[_0xc002('0xe')]][_0xc002('0x2d')]=![];queues[_0xf779fd[_0xc002('0xe')]][_0xc002('0x8')]=null;queues[_0xf779fd[_0xc002('0xe')]][_0xc002('0x2b')]=null;queues[_0xf779fd['uniqueid']][_0xc002('0x3d')]=!![];queues[_0xf779fd['uniqueid']][_0xc002('0x7')]=_0xf779fd['destaccountcode'];queues[_0xf779fd[_0xc002('0xe')]]['lastAssignedTo']=_0xf779fd[_0xc002('0x3b')];}}catch(_0x51eafc){utils[_0xc002('0x16')](util[_0xc002('0x10')]('[%s][queues][agentconnect]',_0xf779fd['uniqueid']),_0x51eafc);}};exports[_0xc002('0x3e')]=function(_0x6c768d){try{if(!_[_0xc002('0x18')](queues[_0x6c768d[_0xc002('0xe')]])){if(queues[_0x6c768d[_0xc002('0xe')]][_0xc002('0x1a')]){utils[_0xc002('0x19')](util[_0xc002('0x10')](_0xc002('0x3f'),_0x6c768d['uniqueid']),_0x6c768d);queues[_0x6c768d[_0xc002('0xe')]][_0xc002('0x1b')]=![];queues[_0x6c768d[_0xc002('0xe')]]['queuecallerabandon']=![];queues[_0x6c768d[_0xc002('0xe')]]['queuecallerabandonAt']=null;queues[_0x6c768d['uniqueid']][_0xc002('0x2d')]=![];queues[_0x6c768d['uniqueid']][_0xc002('0x2b')]=null;queues[_0x6c768d['uniqueid']]['assigned']=!![];queues[_0x6c768d[_0xc002('0xe')]][_0xc002('0x6')]=_0x6c768d[_0xc002('0x3b')];queues[_0x6c768d[_0xc002('0xe')]][_0xc002('0x1c')]=!![];queues[_0x6c768d[_0xc002('0xe')]]['queuecallercompleteAt']=utils[_0xc002('0x15')]();if(_0x6c768d[_0xc002('0x40')]=='transfer'){if(!queues[_0x6c768d['uniqueid']]['transfer']){queues[_0x6c768d[_0xc002('0xe')]][_0xc002('0x8')]=_0xc002('0x41');}}else{queues[_0x6c768d[_0xc002('0xe')]]['queuecallerexitreason']=_0xc002('0x42')+_0x6c768d['reason'][_0xc002('0x28')]();}utils[_0xc002('0x2')](util[_0xc002('0x10')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x6c768d['uniqueid'],queues[_0x6c768d[_0xc002('0xe')]][_0xc002('0x20')],_0x6c768d['membername'],queues[_0x6c768d[_0xc002('0xe')]][_0xc002('0x8')]));writeDB(queues[_0x6c768d['uniqueid']]);}}}catch(_0x2d94ca){utils['error'](util[_0xc002('0x10')](_0xc002('0x3f'),_0x6c768d[_0xc002('0xe')]),_0x2d94ca);}};exports[_0xc002('0x43')]=function(_0x1b946c){try{if(!_[_0xc002('0x18')](queues[_0x1b946c[_0xc002('0x44')]])){utils['debug'](util[_0xc002('0x10')](_0xc002('0x45'),_0x1b946c['uniqueid']),_0x1b946c);queues[_0x1b946c[_0xc002('0x44')]][_0xc002('0x46')]=!![];queues[_0x1b946c[_0xc002('0x44')]][_0xc002('0x47')]=_0xc002('0x48');queues[_0x1b946c['transfereeuniqueid']][_0xc002('0x49')]=_0x1b946c[_0xc002('0x4a')];queues[_0x1b946c[_0xc002('0x44')]][_0xc002('0x4b')]=_0x1b946c[_0xc002('0x44')];queues[_0x1b946c[_0xc002('0x44')]][_0xc002('0x8')]=_0xc002('0x4c');utils[_0xc002('0x2')](util[_0xc002('0x10')](_0xc002('0x4d'),_0x1b946c[_0xc002('0xe')],queues[_0x1b946c[_0xc002('0x44')]]['name'],_0x1b946c[_0xc002('0x44')],_0x1b946c['extension']));}}catch(_0x3c8531){utils[_0xc002('0x16')](util[_0xc002('0x10')](_0xc002('0x45'),_0x1b946c[_0xc002('0xe')]),_0x3c8531);}};exports[_0xc002('0x4e')]=function(_0x477db7){try{utils['debug'](util[_0xc002('0x10')](_0xc002('0x4f'),_0x477db7['origtransfereruniqueid']),_0x477db7);if(_0x477db7[_0xc002('0x50')]==_0x477db7[_0xc002('0x51')]){if(!_[_0xc002('0x18')](queues[_0x477db7[_0xc002('0x52')]])){utils[_0xc002('0x2')](util[_0xc002('0x10')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x477db7['origtransfereruniqueid'],queues[_0x477db7[_0xc002('0x52')]][_0xc002('0x20')],_0x477db7[_0xc002('0x53')]));queues[_0x477db7['secondtransfererlinkedid']][_0xc002('0x46')]=!![];queues[_0x477db7[_0xc002('0x52')]][_0xc002('0x47')]=_0xc002('0x54');queues[_0x477db7[_0xc002('0x52')]][_0xc002('0x49')]=_0x477db7[_0xc002('0x53')];queues[_0x477db7[_0xc002('0x52')]]['transferuniqueid']=_0x477db7[_0xc002('0x50')];queues[_0x477db7[_0xc002('0x52')]][_0xc002('0x8')]=_0xc002('0x55');}if(!_[_0xc002('0x18')](queues[_0x477db7[_0xc002('0x51')]])){if(_0x477db7[_0xc002('0x56')]&&queues[_0x477db7[_0xc002('0x56')]]){queues[_0x477db7[_0xc002('0x56')]][_0xc002('0x21')]=0x1;queues[_0x477db7[_0xc002('0x44')]]=_['clone'](queues[_0x477db7[_0xc002('0x56')]]);queues[_0x477db7[_0xc002('0x44')]][_0xc002('0xd')]=_0x477db7[_0xc002('0x57')];queues[_0x477db7[_0xc002('0x44')]][_0xc002('0x21')]=0x2;queues[_0x477db7[_0xc002('0x44')]][_0xc002('0x58')]=queues[_0x477db7[_0xc002('0x52')]][_0xc002('0x58')];queues[_0x477db7[_0xc002('0x44')]][_0xc002('0x59')]=queues[_0x477db7[_0xc002('0x52')]][_0xc002('0x59')];queues[_0x477db7[_0xc002('0x44')]][_0xc002('0x39')]=utils['now']();queues[_0x477db7[_0xc002('0x44')]][_0xc002('0x1a')]=utils[_0xc002('0x15')]();queues[_0x477db7[_0xc002('0x44')]]['holdtime']=0x0;queues[_0x477db7[_0xc002('0x44')]][_0xc002('0x5a')]=0x0;utils[_0xc002('0x2')](util[_0xc002('0x10')](_0xc002('0x5b'),_0x477db7[_0xc002('0x50')],queues[_0x477db7[_0xc002('0x44')]][_0xc002('0x20')],queues[_0x477db7[_0xc002('0x44')]][_0xc002('0x58')],queues[_0x477db7['transfereeuniqueid']][_0xc002('0x59')]));}else{utils[_0xc002('0x2')](util[_0xc002('0x10')](_0xc002('0x5c'),_0x477db7[_0xc002('0x50')],queues[_0x477db7[_0xc002('0x51')]][_0xc002('0x20')],_0x477db7[_0xc002('0x52')]));queues[_0x477db7[_0xc002('0x51')]]['transfereduniqueid']=_0x477db7[_0xc002('0x52')];}}}else if(_0x477db7[_0xc002('0x5d')]==_0x477db7[_0xc002('0x52')]){if(!_[_0xc002('0x18')](queues[_0x477db7[_0xc002('0x51')]])){utils['info'](util[_0xc002('0x10')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x477db7[_0xc002('0x50')],queues[_0x477db7[_0xc002('0x51')]]['name'],_0x477db7['secondtransfereruniqueid'],_0x477db7[_0xc002('0x5e')]));queues[_0x477db7[_0xc002('0x51')]][_0xc002('0x46')]=!![];queues[_0x477db7[_0xc002('0x51')]][_0xc002('0x47')]=_0xc002('0x54');queues[_0x477db7['origtransfererlinkedid']][_0xc002('0x49')]=_0x477db7[_0xc002('0x5e')];queues[_0x477db7[_0xc002('0x51')]][_0xc002('0x4b')]=_0x477db7[_0xc002('0x5d')];queues[_0x477db7['origtransfererlinkedid']]['queuecallerexitreason']=_0xc002('0x55');}if(!_['isNil'](queues[_0x477db7[_0xc002('0x52')]])){if(_0x477db7['transfertargetlinkedid']&&queues[_0x477db7[_0xc002('0x5f')]]){queues[_0x477db7[_0xc002('0x5f')]][_0xc002('0x21')]=0x1;queues[_0x477db7[_0xc002('0x57')]]=_[_0xc002('0x60')](queues[_0x477db7[_0xc002('0x5f')]]);queues[_0x477db7[_0xc002('0x57')]]['transfereduniqueid']=_0x477db7[_0xc002('0x57')];queues[_0x477db7[_0xc002('0x57')]][_0xc002('0x21')]=0x2;queues[_0x477db7['transfertargetuniqueid']]['calleridnum']=queues[_0x477db7['origtransfererlinkedid']]['calleridnum'];queues[_0x477db7[_0xc002('0x57')]][_0xc002('0x59')]=queues[_0x477db7[_0xc002('0x51')]][_0xc002('0x59')];queues[_0x477db7[_0xc002('0x57')]][_0xc002('0x39')]=utils[_0xc002('0x15')]();queues[_0x477db7[_0xc002('0x57')]][_0xc002('0x1a')]=utils[_0xc002('0x15')]();queues[_0x477db7['transfertargetuniqueid']][_0xc002('0x61')]=0x0;queues[_0x477db7['transfertargetuniqueid']][_0xc002('0x5a')]=0x0;utils[_0xc002('0x2')](util[_0xc002('0x10')](_0xc002('0x62'),_0x477db7[_0xc002('0x50')],queues[_0x477db7['transfertargetuniqueid']][_0xc002('0x20')],queues[_0x477db7[_0xc002('0x57')]][_0xc002('0xd')],queues[_0x477db7[_0xc002('0x57')]][_0xc002('0x58')],queues[_0x477db7[_0xc002('0x57')]][_0xc002('0x59')]));}else{utils['info'](util[_0xc002('0x10')](_0xc002('0x5c'),_0x477db7[_0xc002('0x50')],queues[_0x477db7[_0xc002('0x52')]][_0xc002('0x20')],_0x477db7[_0xc002('0x51')]));queues[_0x477db7[_0xc002('0x52')]][_0xc002('0xd')]=_0x477db7[_0xc002('0x51')];}}}}catch(_0x2c300c){utils['error'](util[_0xc002('0x10')](_0xc002('0x4f'),_0x477db7['origtransfereruniqueid']),_0x2c300c);}};exports[_0xc002('0x63')]=function(_0x1467ac){try{if(!_[_0xc002('0x18')](queues[_0x1467ac[_0xc002('0xe')]])){utils['debug'](util[_0xc002('0x10')](_0xc002('0x64'),_0x1467ac['uniqueid']),_0x1467ac);queues[_0x1467ac[_0xc002('0xe')]]['musiconholdstartAt']=utils[_0xc002('0x15')]();utils[_0xc002('0x2')](util['format'](_0xc002('0x65'),_0x1467ac[_0xc002('0xe')],queues[_0x1467ac[_0xc002('0xe')]][_0xc002('0x20')],queues[_0x1467ac[_0xc002('0xe')]][_0xc002('0x66')]));}}catch(_0x18c743){utils[_0xc002('0x16')](util[_0xc002('0x10')]('[%s][queues][musiconholdstart]',_0x1467ac[_0xc002('0xe')]),_0x18c743);}};exports[_0xc002('0x67')]=function(_0x42bf71){try{if(!_['isNil'](queues[_0x42bf71[_0xc002('0xe')]])){if(!_[_0xc002('0x18')](queues[_0x42bf71[_0xc002('0xe')]][_0xc002('0x66')])){utils[_0xc002('0x19')](util[_0xc002('0x10')]('[%s][queues][musiconholdstop]',_0x42bf71[_0xc002('0xe')]),_0x42bf71);queues[_0x42bf71[_0xc002('0xe')]]['mohtime']+=utils[_0xc002('0x38')](utils[_0xc002('0x15')](),queues[_0x42bf71[_0xc002('0xe')]]['musiconholdstartAt']);utils[_0xc002('0x2')](util[_0xc002('0x10')](_0xc002('0x68'),_0x42bf71['uniqueid'],queues[_0x42bf71[_0xc002('0xe')]][_0xc002('0x20')],queues[_0x42bf71['uniqueid']]['mohtime']));delete queues[_0x42bf71[_0xc002('0xe')]][_0xc002('0x66')];}}}catch(_0xae284d){utils[_0xc002('0x16')](util[_0xc002('0x10')](_0xc002('0x69'),_0x42bf71[_0xc002('0xe')]),_0xae284d);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 2d36b2c..8947d9d 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 _0xd31b=['membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr','appdata','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then'];(function(_0x4e0851,_0x2ff50c){var _0x49e8cb=function(_0x566bb4){while(--_0x566bb4){_0x4e0851['push'](_0x4e0851['shift']());}};_0x49e8cb(++_0x2ff50c);}(_0xd31b,0x1af));var _0xbd31=function(_0x562593,_0x53e7e9){_0x562593=_0x562593-0x0;var _0x2a4117=_0xd31b[_0x562593];return _0x2a4117;};'use strict';var _=require(_0xbd31('0x0'));var util=require(_0xbd31('0x1'));var utils=require(_0xbd31('0x2'));var recordings={};function writeDB(_0xd65f26){utils[_0xbd31('0x3')](util[_0xbd31('0x4')](_0xbd31('0x5'),_0xd65f26[_0xbd31('0x6')]));if(_0xd65f26[_0xbd31('0x7')]){utils[_0xbd31('0x8')](_0xd65f26[_0xbd31('0x7')])[_0xbd31('0x9')](function(_0x4ea3a8){if(_0x4ea3a8){_0xd65f26[_0xbd31('0xa')]=_0x4ea3a8[_0xbd31('0xb')];_0xd65f26[_0xbd31('0xc')]=_0x4ea3a8['id'];}utils[_0xbd31('0xd')](_0xbd31('0xe'),_0xd65f26);});}else{utils['request'](_0xbd31('0xe'),_0xd65f26);}}exports[_0xbd31('0xf')]=function(_0x3095df){try{utils[_0xbd31('0x10')](util[_0xbd31('0x4')](_0xbd31('0x11'),_0x3095df[_0xbd31('0x6')]),_0x3095df);if(_0x3095df[_0xbd31('0x6')]==_0x3095df[_0xbd31('0x12')]){utils['info'](util[_0xbd31('0x4')](_0xbd31('0x13'),_0x3095df[_0xbd31('0x6')],_0x3095df[_0xbd31('0x14')],_0x3095df[_0xbd31('0x15')]));recordings[_0x3095df[_0xbd31('0x6')]]={'uniqueid':_0x3095df[_0xbd31('0x6')],'accountcode':_0x3095df[_0xbd31('0x7')],'exten':_0x3095df[_0xbd31('0x15')],'context':_0x3095df[_0xbd31('0x14')],'channel':_0x3095df[_0xbd31('0x16')],'monitors':[]};}}catch(_0x198d83){utils['error'](util['format'](_0xbd31('0x11'),_0x3095df[_0xbd31('0x6')]),_0x198d83);}};exports['newstate']=function(_0x387df5){try{utils[_0xbd31('0x10')](util[_0xbd31('0x4')](_0xbd31('0x17'),_0x387df5[_0xbd31('0x6')]),_0x387df5);if(!_[_0xbd31('0x18')](recordings[_0x387df5[_0xbd31('0x6')]])&&_0x387df5[_0xbd31('0x19')]==0x6){utils[_0xbd31('0x3')](util[_0xbd31('0x4')](_0xbd31('0x1a'),_0x387df5[_0xbd31('0x6')],_0x387df5[_0xbd31('0x14')],_0x387df5[_0xbd31('0x16')]));}else if(!_[_0xbd31('0x18')](recordings[_0x387df5['linkedid']])&&_0x387df5['channelstate']==0x6&&_0x387df5['context']!=_0xbd31('0x1b')){utils['info'](util['format'](_0xbd31('0x1c'),_0x387df5[_0xbd31('0x6')],_0x387df5[_0xbd31('0x12')],_0x387df5['context'],_0x387df5[_0xbd31('0x16')]));recordings[_0x387df5[_0xbd31('0x12')]][_0xbd31('0x7')]=_0x387df5['accountcode'];}}catch(_0x71f7d){utils[_0xbd31('0x1d')](util[_0xbd31('0x4')](_0xbd31('0x17'),_0x387df5[_0xbd31('0x6')]),_0x71f7d);}};exports[_0xbd31('0x1e')]=function(_0x1652a3){try{if(!_['isNil'](_0x1652a3[_0xbd31('0x1f')])&&!_[_0xbd31('0x18')](_0x1652a3[_0xbd31('0x1f')]['mixmonitor_filename'])){utils[_0xbd31('0x10')](util[_0xbd31('0x4')](_0xbd31('0x20'),_0x1652a3[_0xbd31('0x6')]),_0x1652a3);utils['info'](util[_0xbd31('0x4')](_0xbd31('0x21'),_0x1652a3[_0xbd31('0x6')],_0x1652a3[_0xbd31('0x1f')],_0x1652a3[_0xbd31('0x22')]));if(_[_0xbd31('0x23')](_0x1652a3[_0xbd31('0x22')],_0xbd31('0x24'))){_0x1652a3[_0xbd31('0x22')]=_0x1652a3[_0xbd31('0x22')][_0xbd31('0x25')](_0xbd31('0x24'),_0xbd31('0x26'));}if(recordings[_0x1652a3[_0xbd31('0x12')]]){var _0x2e8843=_[_0xbd31('0x27')](recordings[_0x1652a3[_0xbd31('0x12')]][_0xbd31('0x28')],{'value':_0x1652a3[_0xbd31('0x22')]});if(_[_0xbd31('0x18')](_0x2e8843)){recordings[_0x1652a3[_0xbd31('0x12')]][_0xbd31('0x28')][_0xbd31('0x29')]({'value':_0x1652a3[_0xbd31('0x22')]});}}}}catch(_0x6bc7e3){utils[_0xbd31('0x1d')](util['format'](_0xbd31('0x20'),_0x1652a3[_0xbd31('0x6')]),_0x6bc7e3);}};exports[_0xbd31('0x2a')]=function(_0x332356){try{if(!_[_0xbd31('0x18')](recordings[_0x332356[_0xbd31('0x6')]])){utils[_0xbd31('0x10')](util['format'](_0xbd31('0x2b'),_0x332356['uniqueid']),_0x332356);utils[_0xbd31('0x3')](util[_0xbd31('0x4')](_0xbd31('0x2c'),_0x332356[_0xbd31('0x6')],_0x332356['calleridnum'],_0x332356['calleridname'],_0x332356['cause-txt']));recordings[_0x332356[_0xbd31('0x6')]]['calleridnum']=_0x332356[_0xbd31('0x2d')];recordings[_0x332356[_0xbd31('0x6')]]['calleridname']=_0x332356[_0xbd31('0x2e')];recordings[_0x332356[_0xbd31('0x6')]]['connectedlinenum']=_0x332356[_0xbd31('0x2f')];recordings[_0x332356[_0xbd31('0x6')]][_0xbd31('0x30')]=_0x332356['connectedlinename'];if(recordings[_0x332356[_0xbd31('0x6')]]['type']=='outbound'&&recordings[_0x332356[_0xbd31('0x6')]][_0xbd31('0x7')]){recordings[_0x332356['uniqueid']][_0xbd31('0x2f')]=recordings[_0x332356[_0xbd31('0x6')]][_0xbd31('0x7')];recordings[_0x332356[_0xbd31('0x6')]]['connectedlinename']='';}recordings[_0x332356[_0xbd31('0x6')]][_0xbd31('0x28')]['forEach'](function(_0x29fee5){var _0x5a5589=_[_0xbd31('0x31')](recordings[_0x332356[_0xbd31('0x6')]]);_0x5a5589[_0xbd31('0x22')]=_0x29fee5[_0xbd31('0x22')];writeDB(_0x5a5589);});delete recordings[_0x332356[_0xbd31('0x6')]];}}catch(_0x48c1e6){utils['error'](util[_0xbd31('0x4')](_0xbd31('0x2b'),_0x332356[_0xbd31('0x6')]),_0x48c1e6);}};exports['newexten']=function(_0x3e3079){try{if(!_[_0xbd31('0x18')](recordings[_0x3e3079[_0xbd31('0x6')]])){utils[_0xbd31('0x10')](util[_0xbd31('0x4')](_0xbd31('0x32'),_0x3e3079['uniqueid']),_0x3e3079);utils[_0xbd31('0x3')](util[_0xbd31('0x4')](_0xbd31('0x33'),_0x3e3079[_0xbd31('0x6')],_0x3e3079[_0xbd31('0x34')],_0x3e3079['appdata']));if(_0x3e3079[_0xbd31('0x34')][_0xbd31('0x35')]()==_0xbd31('0x36')&&_[_0xbd31('0x37')](_0x3e3079['appdata'][_0xbd31('0x35')](),_0xbd31('0x38'))){var _0x3c3d24=_0x3e3079[_0xbd31('0x39')]['split']('=');var _0x4ef973=_0x3c3d24[0x0][_0xbd31('0x3a')](_0x3c3d24[0x0][_0xbd31('0x3b')]('(')+0x1,_0x3c3d24[0x0][_0xbd31('0x3b')](')'));var _0x3cde21=_0x3c3d24[0x1];recordings[_0x3e3079[_0xbd31('0x6')]][_0x4ef973]=_0x3cde21;}}}catch(_0x280a07){utils[_0xbd31('0x1d')](util['format'](_0xbd31('0x32'),_0x3e3079[_0xbd31('0x6')]),_0x280a07);}};exports[_0xbd31('0x3c')]=function(_0x2f0fb6){try{if(!_['isNil'](recordings[_0x2f0fb6['uniqueid']])){utils[_0xbd31('0x10')](util['format'](_0xbd31('0x3d'),_0x2f0fb6['uniqueid']),_0x2f0fb6);utils[_0xbd31('0x3')](util[_0xbd31('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x2f0fb6[_0xbd31('0x6')],_0x2f0fb6[_0xbd31('0x3e')]));recordings[_0x2f0fb6[_0xbd31('0x6')]][_0xbd31('0x3e')]=_0x2f0fb6[_0xbd31('0x3e')];}}catch(_0x5032a6){utils[_0xbd31('0x1d')](util[_0xbd31('0x4')](_0xbd31('0x3d'),_0x2f0fb6[_0xbd31('0x6')]),_0x5032a6);}}; \ No newline at end of file +var _0xd207=['.WAV','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','uniqueid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','[%s][recordings][newchannel]','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','info','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','channel','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xd207,0x110));var _0x7d20=function(_0x170b26,_0x57595e){_0x170b26=_0x170b26-0x0;var _0x22c11d=_0xd207[_0x170b26];return _0x22c11d;};'use strict';var _=require(_0x7d20('0x0'));var util=require(_0x7d20('0x1'));var utils=require(_0x7d20('0x2'));var recordings={};function writeDB(_0x503eef){utils['info'](util[_0x7d20('0x3')](_0x7d20('0x4'),_0x503eef['uniqueid']));if(_0x503eef[_0x7d20('0x5')]){utils[_0x7d20('0x6')](_0x503eef[_0x7d20('0x5')])[_0x7d20('0x7')](function(_0x37d1f0){if(_0x37d1f0){_0x503eef[_0x7d20('0x8')]=_0x37d1f0[_0x7d20('0x9')];_0x503eef[_0x7d20('0xa')]=_0x37d1f0['id'];}utils[_0x7d20('0xb')](_0x7d20('0xc'),_0x503eef);});}else{utils[_0x7d20('0xb')](_0x7d20('0xc'),_0x503eef);}}exports[_0x7d20('0xd')]=function(_0x38a523){try{utils['debug'](util[_0x7d20('0x3')]('[%s][recordings][newchannel]',_0x38a523['uniqueid']),_0x38a523);if(_0x38a523[_0x7d20('0xe')]==_0x38a523['linkedid']){utils['info'](util['format'](_0x7d20('0xf'),_0x38a523[_0x7d20('0xe')],_0x38a523[_0x7d20('0x10')],_0x38a523[_0x7d20('0x11')]));recordings[_0x38a523[_0x7d20('0xe')]]={'uniqueid':_0x38a523[_0x7d20('0xe')],'accountcode':_0x38a523[_0x7d20('0x5')],'exten':_0x38a523[_0x7d20('0x11')],'context':_0x38a523[_0x7d20('0x10')],'channel':_0x38a523['channel'],'monitors':[]};}}catch(_0x4a14b3){utils[_0x7d20('0x12')](util[_0x7d20('0x3')](_0x7d20('0x13'),_0x38a523['uniqueid']),_0x4a14b3);}};exports[_0x7d20('0x14')]=function(_0x453426){try{utils[_0x7d20('0x15')](util[_0x7d20('0x3')](_0x7d20('0x16'),_0x453426[_0x7d20('0xe')]),_0x453426);if(!_[_0x7d20('0x17')](recordings[_0x453426['uniqueid']])&&_0x453426[_0x7d20('0x18')]==0x6){utils[_0x7d20('0x19')](util[_0x7d20('0x3')](_0x7d20('0x1a'),_0x453426[_0x7d20('0xe')],_0x453426[_0x7d20('0x10')],_0x453426['channel']));}else if(!_[_0x7d20('0x17')](recordings[_0x453426['linkedid']])&&_0x453426[_0x7d20('0x18')]==0x6&&_0x453426[_0x7d20('0x10')]!=_0x7d20('0x1b')){utils[_0x7d20('0x19')](util[_0x7d20('0x3')](_0x7d20('0x1c'),_0x453426['uniqueid'],_0x453426[_0x7d20('0x1d')],_0x453426[_0x7d20('0x10')],_0x453426[_0x7d20('0x1e')]));recordings[_0x453426[_0x7d20('0x1d')]][_0x7d20('0x5')]=_0x453426[_0x7d20('0x5')];}}catch(_0x4e3f64){utils[_0x7d20('0x12')](util[_0x7d20('0x3')](_0x7d20('0x16'),_0x453426[_0x7d20('0xe')]),_0x4e3f64);}};exports[_0x7d20('0x1f')]=function(_0x4efb23){try{if(!_['isNil'](_0x4efb23[_0x7d20('0x20')])&&!_[_0x7d20('0x17')](_0x4efb23['variable'][_0x7d20('0x21')])){utils['debug'](util['format']('[%s][recordings][varset]',_0x4efb23[_0x7d20('0xe')]),_0x4efb23);utils[_0x7d20('0x19')](util[_0x7d20('0x3')](_0x7d20('0x22'),_0x4efb23['uniqueid'],_0x4efb23[_0x7d20('0x20')],_0x4efb23[_0x7d20('0x23')]));if(_[_0x7d20('0x24')](_0x4efb23[_0x7d20('0x23')],'.wav49')){_0x4efb23[_0x7d20('0x23')]=_0x4efb23[_0x7d20('0x23')]['replace'](_0x7d20('0x25'),_0x7d20('0x26'));}if(recordings[_0x4efb23['linkedid']]){var _0x50403b=_['find'](recordings[_0x4efb23[_0x7d20('0x1d')]][_0x7d20('0x27')],{'value':_0x4efb23['value']});if(_['isNil'](_0x50403b)){recordings[_0x4efb23[_0x7d20('0x1d')]][_0x7d20('0x27')][_0x7d20('0x28')]({'value':_0x4efb23[_0x7d20('0x23')]});}}}}catch(_0x3a757a){utils[_0x7d20('0x12')](util[_0x7d20('0x3')]('[%s][recordings][varset]',_0x4efb23[_0x7d20('0xe')]),_0x3a757a);}};exports[_0x7d20('0x29')]=function(_0x19d4f5){try{if(!_['isNil'](recordings[_0x19d4f5[_0x7d20('0xe')]])){utils[_0x7d20('0x15')](util[_0x7d20('0x3')]('[%s][recordings][hangup]',_0x19d4f5[_0x7d20('0xe')]),_0x19d4f5);utils[_0x7d20('0x19')](util[_0x7d20('0x3')](_0x7d20('0x2a'),_0x19d4f5[_0x7d20('0xe')],_0x19d4f5[_0x7d20('0x2b')],_0x19d4f5[_0x7d20('0x2c')],_0x19d4f5['cause-txt']));recordings[_0x19d4f5['uniqueid']]['calleridnum']=_0x19d4f5[_0x7d20('0x2b')];recordings[_0x19d4f5[_0x7d20('0xe')]][_0x7d20('0x2c')]=_0x19d4f5[_0x7d20('0x2c')];recordings[_0x19d4f5['uniqueid']][_0x7d20('0x2d')]=_0x19d4f5[_0x7d20('0x2d')];recordings[_0x19d4f5[_0x7d20('0xe')]][_0x7d20('0x2e')]=_0x19d4f5[_0x7d20('0x2e')];if(recordings[_0x19d4f5[_0x7d20('0xe')]][_0x7d20('0x2f')]=='outbound'&&recordings[_0x19d4f5['uniqueid']][_0x7d20('0x5')]){recordings[_0x19d4f5[_0x7d20('0xe')]][_0x7d20('0x2d')]=recordings[_0x19d4f5[_0x7d20('0xe')]][_0x7d20('0x5')];recordings[_0x19d4f5[_0x7d20('0xe')]]['connectedlinename']='';}recordings[_0x19d4f5['uniqueid']][_0x7d20('0x27')][_0x7d20('0x30')](function(_0x28d01e){var _0x1f1210=_[_0x7d20('0x31')](recordings[_0x19d4f5['uniqueid']]);_0x1f1210[_0x7d20('0x23')]=_0x28d01e[_0x7d20('0x23')];writeDB(_0x1f1210);});delete recordings[_0x19d4f5[_0x7d20('0xe')]];}}catch(_0xf91c95){utils['error'](util[_0x7d20('0x3')]('[%s][recordings][hangup]',_0x19d4f5[_0x7d20('0xe')]),_0xf91c95);}};exports[_0x7d20('0x32')]=function(_0x518c7c){try{if(!_[_0x7d20('0x17')](recordings[_0x518c7c[_0x7d20('0xe')]])){utils['debug'](util[_0x7d20('0x3')](_0x7d20('0x33'),_0x518c7c['uniqueid']),_0x518c7c);utils['info'](util[_0x7d20('0x3')](_0x7d20('0x34'),_0x518c7c['uniqueid'],_0x518c7c[_0x7d20('0x35')],_0x518c7c['appdata']));if(_0x518c7c[_0x7d20('0x35')][_0x7d20('0x36')]()=='set'&&_['startsWith'](_0x518c7c['appdata']['toLowerCase'](),_0x7d20('0x37'))){var _0x1b5867=_0x518c7c['appdata']['split']('=');var _0x139f23=_0x1b5867[0x0][_0x7d20('0x38')](_0x1b5867[0x0][_0x7d20('0x39')]('(')+0x1,_0x1b5867[0x0][_0x7d20('0x39')](')'));var _0x1cee5f=_0x1b5867[0x1];recordings[_0x518c7c[_0x7d20('0xe')]][_0x139f23]=_0x1cee5f;}}}catch(_0x31a547){utils['error'](util['format'](_0x7d20('0x33'),_0x518c7c[_0x7d20('0xe')]),_0x31a547);}};exports[_0x7d20('0x3a')]=function(_0x58830f){try{if(!_[_0x7d20('0x17')](recordings[_0x58830f[_0x7d20('0xe')]])){utils['debug'](util[_0x7d20('0x3')](_0x7d20('0x3b'),_0x58830f[_0x7d20('0xe')]),_0x58830f);utils[_0x7d20('0x19')](util[_0x7d20('0x3')](_0x7d20('0x3c'),_0x58830f[_0x7d20('0xe')],_0x58830f['queue']));recordings[_0x58830f[_0x7d20('0xe')]][_0x7d20('0x3d')]=_0x58830f['queue'];}}catch(_0x4a291b){utils[_0x7d20('0x12')](util[_0x7d20('0x3')](_0x7d20('0x3b'),_0x58830f['uniqueid']),_0x4a291b);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index e152a39..bc01eb2 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 _0x81bd=['transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','blind','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x530597,_0x18fb5a){var _0x5e351b=function(_0x2180d2){while(--_0x2180d2){_0x530597['push'](_0x530597['shift']());}};_0x5e351b(++_0x18fb5a);}(_0x81bd,0x1bf));var _0xd81b=function(_0x10d73b,_0xb2bc5){_0x10d73b=_0x10d73b-0x0;var _0x22f7c2=_0x81bd[_0x10d73b];return _0x22f7c2;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var utils=require(_0xd81b('0x2'));function writeDB(_0x2832e0){utils[_0xd81b('0x3')](util[_0xd81b('0x4')](_0xd81b('0x5'),_0x2832e0[_0xd81b('0x6')]===_0xd81b('0x7')?_0x2832e0[_0xd81b('0x8')]:_0x2832e0[_0xd81b('0x9')],_0x2832e0['type']));utils['request'](_0xd81b('0xa'),_0x2832e0);}exports['blindtransfer']=function(_0x1c7960){try{utils['debug'](util['format'](_0xd81b('0xb'),_0x1c7960['uniqueid']),_0x1c7960);utils['info'](util[_0xd81b('0x4')](_0xd81b('0xc'),_0x1c7960['uniqueid'],_0x1c7960[_0xd81b('0xd')],_0x1c7960['transferercalleridname'],_0x1c7960['transfereecalleridnum'],_0x1c7960['transfereecalleridname']));_0x1c7960['type']=_0xd81b('0xe');writeDB(_0x1c7960);}catch(_0x5b0865){utils['error'](util[_0xd81b('0x4')](_0xd81b('0xb'),_0x1c7960['uniqueid']),_0x5b0865);}};exports['attendedtransfer']=function(_0x583dd4){try{utils[_0xd81b('0xf')](util[_0xd81b('0x4')](_0xd81b('0x10'),_0x583dd4[_0xd81b('0x8')]),_0x583dd4);utils[_0xd81b('0x3')](util[_0xd81b('0x4')](_0xd81b('0x11'),_0x583dd4[_0xd81b('0x8')],_0x583dd4[_0xd81b('0x12')],_0x583dd4['origtransferercalleridname'],_0x583dd4[_0xd81b('0x13')],_0x583dd4[_0xd81b('0x14')]));_0x583dd4=_[_0xd81b('0x15')](_0x583dd4,{'transfererchannel':_0x583dd4['origtransfererchannel'],'transferercalleridnum':_0x583dd4['origtransferercalleridnum'],'transferercalleridname':_0x583dd4[_0xd81b('0x16')],'transfererconnectedlinenum':_0x583dd4[_0xd81b('0x17')],'transfererconnectedlinename':_0x583dd4[_0xd81b('0x18')],'transfereraccountcode':_0x583dd4[_0xd81b('0x19')],'transferercontext':_0x583dd4[_0xd81b('0x1a')],'transfererexten':_0x583dd4['secondtransfererexten'],'transfererlinkedid':_0x583dd4['origtransfererlinkedid'],'context':_0x583dd4[_0xd81b('0x1b')],'extension':_0x583dd4['origtransfererexten'],'type':_0xd81b('0x7')});if(_[_0xd81b('0x1c')](_0x583dd4[_0xd81b('0x1d')])){_0x583dd4=_[_0xd81b('0x15')](_0x583dd4,{'transfereechannel':_0x583dd4[_0xd81b('0x1e')],'transfereecalleridnum':_0x583dd4[_0xd81b('0x13')],'transfereecalleridname':_0x583dd4[_0xd81b('0x14')],'transfereeconnectedlinenum':_0x583dd4[_0xd81b('0x1f')],'transfereeconnectedlinename':_0x583dd4[_0xd81b('0x20')],'transfereeaccountcode':_0x583dd4[_0xd81b('0x21')],'transfereecontext':_0x583dd4[_0xd81b('0x22')],'transfereeexten':_0x583dd4[_0xd81b('0x23')],'transfereelinkedid':_0x583dd4[_0xd81b('0x24')]});}writeDB(_0x583dd4);}catch(_0x204424){utils['error'](util['format'](_0xd81b('0x10'),_0x583dd4[_0xd81b('0x8')]),_0x204424);}}; \ No newline at end of file +var _0xa3bc=['[%s][transfers][attendedtransfer]','origtransfereruniqueid','info','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','format','type','attended','uniqueid','request','CreateVoiceTransferReport','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridname','blind','error','debug'];(function(_0x150d70,_0x2da39b){var _0x57dff4=function(_0x22b265){while(--_0x22b265){_0x150d70['push'](_0x150d70['shift']());}};_0x57dff4(++_0x2da39b);}(_0xa3bc,0xe7));var _0xca3b=function(_0x5f3f53,_0xd5e998){_0x5f3f53=_0x5f3f53-0x0;var _0x248a70=_0xa3bc[_0x5f3f53];return _0x248a70;};'use strict';var _=require(_0xca3b('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x3f1bfc){utils['info'](util[_0xca3b('0x1')]('[%s][transfers][writeDB]\x20type:%s',_0x3f1bfc[_0xca3b('0x2')]===_0xca3b('0x3')?_0x3f1bfc['origtransfereruniqueid']:_0x3f1bfc[_0xca3b('0x4')],_0x3f1bfc[_0xca3b('0x2')]));utils[_0xca3b('0x5')](_0xca3b('0x6'),_0x3f1bfc);}exports['blindtransfer']=function(_0x407693){try{utils['debug'](util['format'](_0xca3b('0x7'),_0x407693['uniqueid']),_0x407693);utils['info'](util[_0xca3b('0x1')](_0xca3b('0x8'),_0x407693[_0xca3b('0x4')],_0x407693['transferercalleridnum'],_0x407693[_0xca3b('0x9')],_0x407693['transfereecalleridnum'],_0x407693[_0xca3b('0xa')]));_0x407693[_0xca3b('0x2')]=_0xca3b('0xb');writeDB(_0x407693);}catch(_0x1cbfbe){utils[_0xca3b('0xc')](util[_0xca3b('0x1')](_0xca3b('0x7'),_0x407693[_0xca3b('0x4')]),_0x1cbfbe);}};exports['attendedtransfer']=function(_0x3d0969){try{utils[_0xca3b('0xd')](util[_0xca3b('0x1')](_0xca3b('0xe'),_0x3d0969[_0xca3b('0xf')]),_0x3d0969);utils[_0xca3b('0x10')](util[_0xca3b('0x1')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3d0969[_0xca3b('0xf')],_0x3d0969[_0xca3b('0x11')],_0x3d0969[_0xca3b('0x12')],_0x3d0969[_0xca3b('0x13')],_0x3d0969[_0xca3b('0x14')]));_0x3d0969=_[_0xca3b('0x15')](_0x3d0969,{'transfererchannel':_0x3d0969['origtransfererchannel'],'transferercalleridnum':_0x3d0969[_0xca3b('0x11')],'transferercalleridname':_0x3d0969[_0xca3b('0x12')],'transfererconnectedlinenum':_0x3d0969[_0xca3b('0x16')],'transfererconnectedlinename':_0x3d0969[_0xca3b('0x17')],'transfereraccountcode':_0x3d0969[_0xca3b('0x18')],'transferercontext':_0x3d0969['secondtransferercontext'],'transfererexten':_0x3d0969[_0xca3b('0x19')],'transfererlinkedid':_0x3d0969[_0xca3b('0x1a')],'context':_0x3d0969[_0xca3b('0x1b')],'extension':_0x3d0969['origtransfererexten'],'type':'attended'});if(_[_0xca3b('0x1c')](_0x3d0969['transfereechannel'])){_0x3d0969=_[_0xca3b('0x15')](_0x3d0969,{'transfereechannel':_0x3d0969[_0xca3b('0x1d')],'transfereecalleridnum':_0x3d0969[_0xca3b('0x13')],'transfereecalleridname':_0x3d0969[_0xca3b('0x14')],'transfereeconnectedlinenum':_0x3d0969[_0xca3b('0x1e')],'transfereeconnectedlinename':_0x3d0969[_0xca3b('0x1f')],'transfereeaccountcode':_0x3d0969[_0xca3b('0x20')],'transfereecontext':_0x3d0969[_0xca3b('0x21')],'transfereeexten':_0x3d0969[_0xca3b('0x22')],'transfereelinkedid':_0x3d0969['transfertargetlinkedid']});}writeDB(_0x3d0969);}catch(_0x37e5fa){utils[_0xca3b('0xc')](util[_0xca3b('0x1')](_0xca3b('0xe'),_0x3d0969['origtransfereruniqueid']),_0x37e5fa);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 19c996b..9f637fe 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 _0xd553=['[utils][request]\x20name:%s','GetUser','name','interface','stringify','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','result','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diff','now','isAfter','jayson/promise','moment','client','http','info','inspect','debug','error','request','then'];(function(_0x2056b2,_0x2dbfed){var _0x3e1bc2=function(_0x48a18e){while(--_0x48a18e){_0x2056b2['push'](_0x2056b2['shift']());}};_0x3e1bc2(++_0x2dbfed);}(_0xd553,0xc8));var _0x3d55=function(_0x1af98d,_0x3c608e){_0x1af98d=_0x1af98d-0x0;var _0x3553ea=_0xd553[_0x1af98d];return _0x3553ea;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x3d55('0x0'));var moment=require(_0x3d55('0x1'));var util=require('util');var client=jayson[_0x3d55('0x2')][_0x3d55('0x3')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0x3d55('0x4')]=function(_0x1c8aa5,_0x1c2f1e){logger[_0x3d55('0x4')](_0x1c8aa5,_0x1c2f1e?util[_0x3d55('0x5')](_0x1c2f1e,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x56d4fb,_0x34d5df){logger[_0x3d55('0x6')](_0x56d4fb,_0x34d5df?util[_0x3d55('0x5')](_0x34d5df,{'showHidden':![],'depth':null}):'');};exports[_0x3d55('0x7')]=function(_0x34e190,_0x4d1aba){logger[_0x3d55('0x7')](_0x34e190,_0x4d1aba?util[_0x3d55('0x5')](_0x4d1aba,{'showHidden':![],'depth':null}):'');};exports[_0x3d55('0x8')]=function(_0x42e2ce,_0x212208){return client[_0x3d55('0x8')](_0x42e2ce,{'body':_0x212208})[_0x3d55('0x9')](function(_0x286924){logger['debug'](_0x3d55('0xa'),_0x42e2ce,_0x286924?util[_0x3d55('0x5')](_0x286924,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x55e119){logger[_0x3d55('0x7')](_0x3d55('0xa'),_0x42e2ce,_0x55e119?util[_0x3d55('0x5')](_0x55e119,{'showHidden':![],'depth':null}):'');});};function getUser(_0x12d8bc){return client['request'](_0x3d55('0xb'),{'options':{'raw':!![],'attributes':['id','internal',_0x3d55('0xc'),_0x3d55('0xd')],'where':_0x12d8bc,'limit':0x1}})['then'](function(_0x5341aa){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0x3d55('0xe')](_0x12d8bc),_0x5341aa?util[_0x3d55('0x5')](_0x5341aa,{'showHidden':![],'depth':null}):'');return _0x5341aa['result'][_0x3d55('0xf')]?_0x5341aa['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x290c21){return new BPromise(function(_0x1c829e,_0x320f1b){if(_0x290c21){return getUser({'internal':_0x290c21})[_0x3d55('0x9')](function(_0x3e8748){logger['info'](_0x3d55('0x10'),_0x290c21,_0x3e8748?_0x3d55('0x11'):_0x3d55('0x12'));return _0x1c829e(_0x3e8748);})[_0x3d55('0x13')](function(_0x150ee4){logger['error'](_0x3d55('0x14'),_0x150ee4?util[_0x3d55('0x5')](_0x150ee4,{'showHidden':![],'depth':null}):'');return _0x1c829e(null);});}return _0x1c829e(null);});};exports[_0x3d55('0x15')]=function(_0x4eeb5b){return new BPromise(function(_0x435a0d,_0x5adb37){if(_0x4eeb5b){return getUser({'interface':_0x4eeb5b})[_0x3d55('0x9')](function(_0x539c8b){logger['info'](_0x3d55('0x16'),_0x4eeb5b,_0x539c8b?_0x3d55('0x11'):_0x3d55('0x12'));return _0x435a0d(_0x539c8b);})['catch'](function(_0x2d096f){logger[_0x3d55('0x7')]('[utils][getUserByInterface]',_0x2d096f?util[_0x3d55('0x5')](_0x2d096f,{'showHidden':![],'depth':null}):'');return _0x435a0d(null);});}return _0x435a0d(null);});};exports[_0x3d55('0x17')]=function(_0x54296b){return new BPromise(function(_0x194683,_0x36edb8){if(_0x54296b){return getUser({'name':_0x54296b})[_0x3d55('0x9')](function(_0x151322){logger[_0x3d55('0x4')](_0x3d55('0x18'),_0x54296b,_0x151322?_0x3d55('0x11'):_0x3d55('0x12'));return _0x194683(_0x151322);})[_0x3d55('0x13')](function(_0x366f02){logger['error']('[utils][getUserByName]',_0x366f02?util[_0x3d55('0x5')](_0x366f02,{'showHidden':![],'depth':null}):'');return _0x194683(null);});}return _0x194683(null);});};exports[_0x3d55('0x19')]=function(_0x12331c){return new BPromise(function(_0x54f1cd,_0x2eefb3){if(_0x12331c){return client[_0x3d55('0x8')](_0x3d55('0x1a'),{'options':{'raw':!![],'attributes':['id',_0x3d55('0xc'),_0x3d55('0x1b'),_0x3d55('0x1c'),_0x3d55('0x1d')],'where':{'name':_0x12331c},'limit':0x1}})[_0x3d55('0x9')](function(_0x583bd5){logger[_0x3d55('0x6')](_0x3d55('0x1e'),_0x12331c,_0x583bd5?util[_0x3d55('0x5')](_0x583bd5,{'showHidden':![],'depth':null}):'');logger[_0x3d55('0x4')](_0x3d55('0x1f'),_0x12331c,_0x583bd5?_0x3d55('0x11'):_0x3d55('0x12'));return _0x54f1cd(_0x583bd5[_0x3d55('0x20')]['length']?_0x583bd5[_0x3d55('0x20')][0x0]:null);})[_0x3d55('0x13')](function(_0x52b8cc){logger[_0x3d55('0x7')]('[utils][getVoiceQueueByName]',_0x52b8cc?util[_0x3d55('0x5')](_0x52b8cc,{'showHidden':![],'depth':null}):'');return _0x54f1cd(null);});}return _0x54f1cd(null);});};exports['addTime']=function(_0x566bea,_0x35f00f){return moment(_0x566bea)[_0x3d55('0x21')](_0x35f00f,_0x3d55('0x22'))['format'](_0x3d55('0x23'));};exports[_0x3d55('0x24')]=function(_0x440fc6,_0x551caf){return moment(_0x440fc6)[_0x3d55('0x25')](_0x551caf,'seconds')[_0x3d55('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x2ddf00,_0x403d63){return moment(_0x2ddf00)[_0x3d55('0x27')](moment(_0x403d63),_0x3d55('0x22'));};exports['sumTime']=function(_0x38067e,_0x92fd8c){return parseInt(_0x38067e,0xa)+parseInt(_0x92fd8c,0xa);};exports[_0x3d55('0x28')]=function(){return moment()[_0x3d55('0x26')](_0x3d55('0x23'));};exports[_0x3d55('0x29')]=function(_0x15cf8f,_0xbd8daa){if(_0xbd8daa){return moment(_0x15cf8f)[_0x3d55('0x29')](_0xbd8daa);}return!![];};exports['isBefore']=function(_0x1bce67,_0x461698){if(_0x461698){return moment(_0x1bce67)['isBefore'](_0x461698);}else if(_0x1bce67){return!![];}return![];}; \ No newline at end of file +var _0x58ea=['stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','sumTime','isAfter','isBefore','bluebird','moment','http','../../config/logger','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s'];(function(_0x5ea505,_0x431511){var _0xd8502a=function(_0x1d7f57){while(--_0x1d7f57){_0x5ea505['push'](_0x5ea505['shift']());}};_0xd8502a(++_0x431511);}(_0x58ea,0xe7));var _0xa58e=function(_0x29b7d1,_0x5ae279){_0x29b7d1=_0x29b7d1-0x0;var _0x48b02b=_0x58ea[_0x29b7d1];return _0x48b02b;};'use strict';var BPromise=require(_0xa58e('0x0'));var jayson=require('jayson/promise');var moment=require(_0xa58e('0x1'));var util=require('util');var client=jayson['client'][_0xa58e('0x2')]({'port':0x2329});var logger=require(_0xa58e('0x3'))('xdr');exports[_0xa58e('0x4')]=function(_0x54be28,_0x5a3685){logger[_0xa58e('0x4')](_0x54be28,_0x5a3685?util['inspect'](_0x5a3685,{'showHidden':![],'depth':null}):'');};exports[_0xa58e('0x5')]=function(_0x2b8ddb,_0x10b23d){logger[_0xa58e('0x5')](_0x2b8ddb,_0x10b23d?util[_0xa58e('0x6')](_0x10b23d,{'showHidden':![],'depth':null}):'');};exports[_0xa58e('0x7')]=function(_0x23fa02,_0x3a65b7){logger[_0xa58e('0x7')](_0x23fa02,_0x3a65b7?util[_0xa58e('0x6')](_0x3a65b7,{'showHidden':![],'depth':null}):'');};exports[_0xa58e('0x8')]=function(_0x2dfcef,_0x54ac01){return client['request'](_0x2dfcef,{'body':_0x54ac01})[_0xa58e('0x9')](function(_0x1b84a3){logger[_0xa58e('0x5')]('[utils][request]\x20name:%s',_0x2dfcef,_0x1b84a3?util[_0xa58e('0x6')](_0x1b84a3,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x18434a){logger[_0xa58e('0x7')](_0xa58e('0xa'),_0x2dfcef,_0x18434a?util[_0xa58e('0x6')](_0x18434a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x229948){return client[_0xa58e('0x8')](_0xa58e('0xb'),{'options':{'raw':!![],'attributes':['id',_0xa58e('0xc'),_0xa58e('0xd'),'interface'],'where':_0x229948,'limit':0x1}})[_0xa58e('0x9')](function(_0x11bbe1){logger[_0xa58e('0x5')](_0xa58e('0xe'),JSON[_0xa58e('0xf')](_0x229948),_0x11bbe1?util[_0xa58e('0x6')](_0x11bbe1,{'showHidden':![],'depth':null}):'');return _0x11bbe1[_0xa58e('0x10')][_0xa58e('0x11')]?_0x11bbe1[_0xa58e('0x10')][0x0]:null;});}exports[_0xa58e('0x12')]=function(_0x18bb18){return new BPromise(function(_0x4a276a,_0x16e8f9){if(_0x18bb18){return getUser({'internal':_0x18bb18})['then'](function(_0x562f6a){logger['info'](_0xa58e('0x13'),_0x18bb18,_0x562f6a?_0xa58e('0x14'):_0xa58e('0x15'));return _0x4a276a(_0x562f6a);})[_0xa58e('0x16')](function(_0x5c3e08){logger[_0xa58e('0x7')]('[utils][getUserByInternal]',_0x5c3e08?util['inspect'](_0x5c3e08,{'showHidden':![],'depth':null}):'');return _0x4a276a(null);});}return _0x4a276a(null);});};exports[_0xa58e('0x17')]=function(_0x45e919){return new BPromise(function(_0x65102c,_0x4bd3b5){if(_0x45e919){return getUser({'interface':_0x45e919})[_0xa58e('0x9')](function(_0x3fffa2){logger[_0xa58e('0x4')](_0xa58e('0x18'),_0x45e919,_0x3fffa2?_0xa58e('0x14'):_0xa58e('0x15'));return _0x65102c(_0x3fffa2);})[_0xa58e('0x16')](function(_0x41707f){logger[_0xa58e('0x7')]('[utils][getUserByInterface]',_0x41707f?util[_0xa58e('0x6')](_0x41707f,{'showHidden':![],'depth':null}):'');return _0x65102c(null);});}return _0x65102c(null);});};exports[_0xa58e('0x19')]=function(_0x47f5dd){return new BPromise(function(_0x1a77c2,_0x29352f){if(_0x47f5dd){return getUser({'name':_0x47f5dd})[_0xa58e('0x9')](function(_0x176df6){logger[_0xa58e('0x4')](_0xa58e('0x1a'),_0x47f5dd,_0x176df6?'found':_0xa58e('0x15'));return _0x1a77c2(_0x176df6);})[_0xa58e('0x16')](function(_0xbe3dbd){logger['error'](_0xa58e('0x1b'),_0xbe3dbd?util[_0xa58e('0x6')](_0xbe3dbd,{'showHidden':![],'depth':null}):'');return _0x1a77c2(null);});}return _0x1a77c2(null);});};exports[_0xa58e('0x1c')]=function(_0x11849b){return new BPromise(function(_0x599372,_0x11db77){if(_0x11849b){return client[_0xa58e('0x8')](_0xa58e('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xa58e('0xd'),_0xa58e('0x1e'),'acw',_0xa58e('0x1f')],'where':{'name':_0x11849b},'limit':0x1}})['then'](function(_0x325456){logger[_0xa58e('0x5')]('[utils][getVoiceQueueByName]\x20name:%s',_0x11849b,_0x325456?util[_0xa58e('0x6')](_0x325456,{'showHidden':![],'depth':null}):'');logger[_0xa58e('0x4')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x11849b,_0x325456?'found':_0xa58e('0x15'));return _0x599372(_0x325456[_0xa58e('0x10')][_0xa58e('0x11')]?_0x325456[_0xa58e('0x10')][0x0]:null);})[_0xa58e('0x16')](function(_0x2e1745){logger[_0xa58e('0x7')]('[utils][getVoiceQueueByName]',_0x2e1745?util[_0xa58e('0x6')](_0x2e1745,{'showHidden':![],'depth':null}):'');return _0x599372(null);});}return _0x599372(null);});};exports[_0xa58e('0x20')]=function(_0x27d8b6,_0x221c2d){return moment(_0x27d8b6)[_0xa58e('0x21')](_0x221c2d,'seconds')[_0xa58e('0x22')](_0xa58e('0x23'));};exports[_0xa58e('0x24')]=function(_0x3c564a,_0x10063a){return moment(_0x3c564a)['subtract'](_0x10063a,_0xa58e('0x25'))['format'](_0xa58e('0x23'));};exports['diffTime']=function(_0x57151d,_0x22c83b){return moment(_0x57151d)['diff'](moment(_0x22c83b),_0xa58e('0x25'));};exports[_0xa58e('0x26')]=function(_0x10d26e,_0x23a66c){return parseInt(_0x10d26e,0xa)+parseInt(_0x23a66c,0xa);};exports['now']=function(){return moment()[_0xa58e('0x22')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa58e('0x27')]=function(_0x30b54c,_0x3f79c0){if(_0x3f79c0){return moment(_0x30b54c)[_0xa58e('0x27')](_0x3f79c0);}return!![];};exports[_0xa58e('0x28')]=function(_0x3936ab,_0x478515){if(_0x478515){return moment(_0x3936ab)[_0xa58e('0x28')](_0x478515);}else if(_0x3936ab){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 910e557..ceb35a1 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x03b7=['statusCode','responseTime','role','inspect','use','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_name','setupLoggers','fs-extra','lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','xcally','name','ensureDir','then','client','catch','log','user','data','timestamp','error','api','auth','set','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','remoteAddress','url'];(function(_0x584026,_0x169166){var _0x113901=function(_0x1d6240){while(--_0x1d6240){_0x584026['push'](_0x584026['shift']());}};_0x113901(++_0x169166);}(_0x03b7,0x98));var _0x703b=function(_0xe132e3,_0xc413b7){_0xe132e3=_0xe132e3-0x0;var _0x4234e5=_0x03b7[_0xe132e3];return _0x4234e5;};var fs=require(_0x703b('0x0'));var _=require(_0x703b('0x1'));var ewinston=require('express-winston');var path=require(_0x703b('0x2'));var util=require(_0x703b('0x3'));var fileLogger=require(_0x703b('0x4'))[_0x703b('0x5')];var safeTemplate=require(_0x703b('0x6'))[_0x703b('0x7')];var maskSensitiveData=require(_0x703b('0x8'))['maskSensitiveData'];function ClientSideLogger(){function _0x3a2854(_0x561b55){var _0x3fdda3=path[_0x703b('0x9')](_0x703b('0xa'),'log',_0x703b('0xb'));var _0x5dd2fa=path['join']('client',_0x561b55['role']+'-'+_0x561b55[_0x703b('0xc')]);return fs[_0x703b('0xd')](path[_0x703b('0x9')](_0x3fdda3,_0x5dd2fa))[_0x703b('0xe')](function(){var _0x226211=fileLogger(_0x703b('0xf'),path[_0x703b('0x9')](_0x3fdda3,_0x5dd2fa));return _0x226211;})[_0x703b('0x10')](function(_0x1d7ae7){throw _0x1d7ae7;});}this[_0x703b('0x11')]=function(_0xec8807,_0x11c004,_0x1e619b,_0x246975){return _0x3a2854(_0xec8807[_0x703b('0x12')])[_0x703b('0xe')](function(_0x43e8f7){var _0x44d1c1=_0x43e8f7[_0x11c004];return _0x44d1c1;})[_0x703b('0xe')](function(_0x47c5c9){var _0x3337f6=_0xec8807[_0x703b('0x12')]?_0xec8807[_0x703b('0x12')]['id']:'no-user';var _0x473ea3=_0x246975[_0x703b('0x13')];var _0x22b1fd=_0x246975[_0x703b('0x14')];var _0x218010=new Date(Number(_0x22b1fd));return _0x47c5c9(_0x3337f6,_0x218010,_0x1e619b,_0x473ea3);})[_0x703b('0x10')](function(_0x1fba39){fileLogger(_0x703b('0xf'))[_0x703b('0x15')](_0x1fba39);});};}function setupLoggers(_0x4d86ab){return new Promise(function(_0x362ea2){var _0x4d55cc=new ClientSideLogger();var _0x54577d=fileLogger(_0x703b('0x16'));var _0x584a1f=fileLogger(_0x703b('0x17'));_0x4d86ab[_0x703b('0x18')](_0x703b('0x19'),_0x4d55cc);_0x4d86ab['use'](ewinston[_0x703b('0x1a')]({'winstonInstance':_0x54577d,'meta':![],'statusLevels':!![],'msg':function(_0x23a5e0,_0x1e861c){var _0x36c955=_0x703b('0x1b');if(!_['isEmpty'](_0x23a5e0[_0x703b('0x1c')])){_0x36c955+=_0x703b('0x1d');var _0x75a62=_0x23a5e0[_0x703b('0x1c')];maskSensitiveData(_0x75a62);}return safeTemplate(util[_0x703b('0x1e')](_0x36c955,_0x23a5e0[_0x703b('0x1f')],_0x23a5e0[_0x703b('0x20')][_0x703b('0x21')]?_0x23a5e0['headers'][_0x703b('0x21')]:_0x23a5e0['connection'][_0x703b('0x22')]||_0x23a5e0['ip'],_0x23a5e0[_0x703b('0x23')],_0x1e861c[_0x703b('0x24')],_0x1e861c[_0x703b('0x25')],_0x23a5e0['user']?_0x23a5e0[_0x703b('0x12')]['id']:null,_0x23a5e0[_0x703b('0x12')]?_0x23a5e0['user'][_0x703b('0xc')]:null,_0x23a5e0[_0x703b('0x12')]?_0x23a5e0[_0x703b('0x12')][_0x703b('0x26')]:null,_0x75a62?util[_0x703b('0x27')](_0x75a62,![],null):''));}}));_0x4d86ab[_0x703b('0x28')](ewinston[_0x703b('0x1a')]({'winstonInstance':_0x584a1f,'meta':![],'statusLevels':!![],'msg':function(_0x3c8a1c,_0x5953ad){var _0x385774='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x3c8a1c['body']&&_0x3c8a1c[_0x703b('0x1c')][_0x703b('0x29')]&&_0x3c8a1c[_0x703b('0x1c')][_0x703b('0x2a')]){_0x385774=_0x703b('0x2b');}return util[_0x703b('0x1e')](_0x385774,_0x3c8a1c[_0x703b('0x1f')],_0x3c8a1c['headers']['x-forwarded-for']?_0x3c8a1c[_0x703b('0x20')]['x-forwarded-for']:_0x3c8a1c['connection'][_0x703b('0x22')]||_0x3c8a1c['ip'],_0x3c8a1c['url'],_0x5953ad[_0x703b('0x24')],_0x5953ad['responseTime'],_0x3c8a1c[_0x703b('0x12')]?_0x3c8a1c['user']['id']:null,_0x3c8a1c[_0x703b('0x12')]?_0x3c8a1c[_0x703b('0x12')][_0x703b('0xc')]:null,_0x3c8a1c['user']?_0x3c8a1c[_0x703b('0x12')][_0x703b('0x26')]:null,_0x3c8a1c['body']&&_0x3c8a1c['body'][_0x703b('0x29')]?_0x3c8a1c[_0x703b('0x1c')][_0x703b('0x29')]:_0x703b('0x2c'),_0x3c8a1c[_0x703b('0x1c')]&&_0x3c8a1c[_0x703b('0x1c')][_0x703b('0x2a')]?_0x3c8a1c[_0x703b('0x1c')][_0x703b('0x2a')]:'',_0x3c8a1c['body']&&_0x3c8a1c['body'][_0x703b('0x2d')]?_0x3c8a1c['body']['agent_name']:'');},'ignoreRoute':function(_0x488375){var _0x4a0980=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4a0980['test'](_0x488375['url']);}}));return _0x362ea2();});}exports[_0x703b('0x2e')]=setupLoggers; \ No newline at end of file +var _0xcd8d=['\x20body=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','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)','format','other','agent_name','test','setupLoggers','fs-extra','express-winston','path','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','data','timestamp','error','set','client-side-logger','use','isEmpty','body'];(function(_0x287f1d,_0x638798){var _0x1c13ab=function(_0x3ccab3){while(--_0x3ccab3){_0x287f1d['push'](_0x287f1d['shift']());}};_0x1c13ab(++_0x638798);}(_0xcd8d,0x76));var _0xdcd8=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0xcd8d[_0x2bddf9];return _0x3f3ae9;};var fs=require(_0xdcd8('0x0'));var _=require('lodash');var ewinston=require(_0xdcd8('0x1'));var path=require(_0xdcd8('0x2'));var util=require(_0xdcd8('0x3'));var fileLogger=require(_0xdcd8('0x4'))['fileLogger'];var safeTemplate=require(_0xdcd8('0x5'))[_0xdcd8('0x6')];var maskSensitiveData=require(_0xdcd8('0x7'))[_0xdcd8('0x8')];function ClientSideLogger(){function _0x425352(_0x1b84ff){var _0x39c94c=path[_0xdcd8('0x9')](_0xdcd8('0xa'),_0xdcd8('0xb'),_0xdcd8('0xc'));var _0x120a46=path[_0xdcd8('0x9')](_0xdcd8('0xd'),_0x1b84ff[_0xdcd8('0xe')]+'-'+_0x1b84ff[_0xdcd8('0xf')]);return fs[_0xdcd8('0x10')](path[_0xdcd8('0x9')](_0x39c94c,_0x120a46))[_0xdcd8('0x11')](function(){var _0x1ef6bd=fileLogger(_0xdcd8('0xd'),path['join'](_0x39c94c,_0x120a46));return _0x1ef6bd;})[_0xdcd8('0x12')](function(_0x3aa552){throw _0x3aa552;});}this['log']=function(_0xaced65,_0x3a8104,_0x644b40,_0x501df6){return _0x425352(_0xaced65['user'])[_0xdcd8('0x11')](function(_0x4c6c8d){var _0x1d26e8=_0x4c6c8d[_0x3a8104];return _0x1d26e8;})[_0xdcd8('0x11')](function(_0xd31afb){var _0x2277d7=_0xaced65[_0xdcd8('0x13')]?_0xaced65[_0xdcd8('0x13')]['id']:_0xdcd8('0x14');var _0x2f5891=_0x501df6[_0xdcd8('0x15')];var _0xf3f4eb=_0x501df6[_0xdcd8('0x16')];var _0xe7dcce=new Date(Number(_0xf3f4eb));return _0xd31afb(_0x2277d7,_0xe7dcce,_0x644b40,_0x2f5891);})['catch'](function(_0x17de4e){fileLogger(_0xdcd8('0xd'))[_0xdcd8('0x17')](_0x17de4e);});};}function setupLoggers(_0x49c91a){return new Promise(function(_0x421236){var _0x3faa84=new ClientSideLogger();var _0x33bd98=fileLogger('api');var _0x3c19f7=fileLogger('auth');_0x49c91a[_0xdcd8('0x18')](_0xdcd8('0x19'),_0x3faa84);_0x49c91a[_0xdcd8('0x1a')](ewinston['logger']({'winstonInstance':_0x33bd98,'meta':![],'statusLevels':!![],'msg':function(_0xbec9b,_0x55d7a0){var _0x2a68eb='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xdcd8('0x1b')](_0xbec9b[_0xdcd8('0x1c')])){_0x2a68eb+=_0xdcd8('0x1d');var _0x58a3e2=_0xbec9b[_0xdcd8('0x1c')];maskSensitiveData(_0x58a3e2);}return safeTemplate(util['format'](_0x2a68eb,_0xbec9b[_0xdcd8('0x1e')],_0xbec9b[_0xdcd8('0x1f')]['x-forwarded-for']?_0xbec9b['headers'][_0xdcd8('0x20')]:_0xbec9b[_0xdcd8('0x21')][_0xdcd8('0x22')]||_0xbec9b['ip'],_0xbec9b[_0xdcd8('0x23')],_0x55d7a0[_0xdcd8('0x24')],_0x55d7a0[_0xdcd8('0x25')],_0xbec9b['user']?_0xbec9b['user']['id']:null,_0xbec9b[_0xdcd8('0x13')]?_0xbec9b[_0xdcd8('0x13')][_0xdcd8('0xf')]:null,_0xbec9b['user']?_0xbec9b[_0xdcd8('0x13')][_0xdcd8('0xe')]:null,_0x58a3e2?util[_0xdcd8('0x26')](_0x58a3e2,![],null):''));}}));_0x49c91a[_0xdcd8('0x1a')](ewinston[_0xdcd8('0x27')]({'winstonInstance':_0x3c19f7,'meta':![],'statusLevels':!![],'msg':function(_0x16ae47,_0x3a1d86){var _0x2de6f7=_0xdcd8('0x28');if(_0x16ae47[_0xdcd8('0x1c')]&&_0x16ae47['body'][_0xdcd8('0x29')]&&_0x16ae47[_0xdcd8('0x1c')][_0xdcd8('0x2a')]){_0x2de6f7=_0xdcd8('0x2b');}return util[_0xdcd8('0x2c')](_0x2de6f7,_0x16ae47[_0xdcd8('0x1e')],_0x16ae47[_0xdcd8('0x1f')][_0xdcd8('0x20')]?_0x16ae47[_0xdcd8('0x1f')][_0xdcd8('0x20')]:_0x16ae47['connection'][_0xdcd8('0x22')]||_0x16ae47['ip'],_0x16ae47[_0xdcd8('0x23')],_0x3a1d86[_0xdcd8('0x24')],_0x3a1d86[_0xdcd8('0x25')],_0x16ae47[_0xdcd8('0x13')]?_0x16ae47[_0xdcd8('0x13')]['id']:null,_0x16ae47[_0xdcd8('0x13')]?_0x16ae47[_0xdcd8('0x13')][_0xdcd8('0xf')]:null,_0x16ae47[_0xdcd8('0x13')]?_0x16ae47[_0xdcd8('0x13')][_0xdcd8('0xe')]:null,_0x16ae47[_0xdcd8('0x1c')]&&_0x16ae47[_0xdcd8('0x1c')][_0xdcd8('0x29')]?_0x16ae47[_0xdcd8('0x1c')][_0xdcd8('0x29')]:_0xdcd8('0x2d'),_0x16ae47['body']&&_0x16ae47['body'][_0xdcd8('0x2a')]?_0x16ae47[_0xdcd8('0x1c')][_0xdcd8('0x2a')]:'',_0x16ae47[_0xdcd8('0x1c')]&&_0x16ae47[_0xdcd8('0x1c')][_0xdcd8('0x2e')]?_0x16ae47[_0xdcd8('0x1c')][_0xdcd8('0x2e')]:'');},'ignoreRoute':function(_0x19d76a){var _0x54e95c=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x54e95c[_0xdcd8('0x2f')](_0x19d76a['url']);}}));return _0x421236();});}exports[_0xdcd8('0x30')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index edf9e3d..c282a28 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x746e=['split','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','circularDoWInterval','concat','circularMonthInterval','clone','hours','minutes','day','endOf','isBetween','format','ddd','dowCompare','daysInMonth','max','min','domCompare','MMM','includes','monthCompare','guess','test','isMoment','padStart','length','iftime','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x746e,0xd4));var _0xe746=function(_0x343e44,_0x519af9){_0x343e44=_0x343e44-0x0;var _0xa5130e=_0x746e[_0x343e44];return _0xa5130e;};var _=require('lodash');var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xe746('0x0')](function(_0x2b5e0e){return _0x2b5e0e['source'];})[_0xe746('0x1')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xe746('0x2');var EINVALID_DATE=_0xe746('0x3');function throwIfDateNotValid(_0x24dd3f){if(!_0x24dd3f['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x26cef0){var _0x5d50f9=_0x26cef0[_0xe746('0x4')](':')['map'](function(_0x3b1802){return parseInt(_0x3b1802,0xa);});var _0xbd27d0=_0x5d50f9[0x0];var _0xc49b34=_0x5d50f9[0x1];if(_0xbd27d0<0x0||_0xbd27d0>0x17||_0xc49b34<0x0||_0xc49b34>0x3b){throw new Error(EINVALID_DATE);}return[_0xbd27d0,_0xc49b34];}function circularDoWInterval(_0x1da8f3,_0x4e2609){if(_0x1da8f3===_0x4e2609){return[_0x1da8f3];}else{var _0x4de10e=moment[_0xe746('0x5')]();moment[_0xe746('0x5')]('en');var _0x12402a=moment[_0xe746('0x6')]()[_0xe746('0x0')](function(_0x1987f6){return _0x1987f6[_0xe746('0x7')]();});moment['locale'](_0x4de10e);var _0x373c7e=_0x12402a[_0xe746('0x8')](_0x1da8f3);var _0x3d303e=_0x12402a[_0xe746('0x8')](_0x4e2609);if(_0x3d303e>_0x373c7e){return _0x12402a[_0xe746('0x9')](_0x373c7e,_0x3d303e+0x1);}else{var _0x39329d=_0x12402a[_0xe746('0x9')](0x0,_0x3d303e+0x1);var _0x1644e0=_0x12402a[_0xe746('0x9')](_0x373c7e);return _0x1644e0['concat'](_0x39329d);}}}module[_0xe746('0xa')][_0xe746('0xb')]=circularDoWInterval;function circularMonthInterval(_0x1bde4c,_0x599225){if(_0x1bde4c===_0x599225){return[_0x1bde4c];}else{var _0x3fd154=moment[_0xe746('0x5')]();moment[_0xe746('0x5')]('en');var _0x39b290=moment['monthsShort']()[_0xe746('0x0')](function(_0x143e61){return _0x143e61[_0xe746('0x7')]();});moment[_0xe746('0x5')](_0x3fd154);var _0x20c141=_0x39b290['indexOf'](_0x1bde4c);var _0x4414b3=_0x39b290[_0xe746('0x8')](_0x599225);if(_0x4414b3>_0x20c141){return _0x39b290['slice'](_0x20c141,_0x4414b3+0x1);}else{var _0x3e945c=_0x39b290[_0xe746('0x9')](0x0,_0x4414b3+0x1);var _0x518f80=_0x39b290[_0xe746('0x9')](_0x20c141);return _0x518f80[_0xe746('0xc')](_0x3e945c);}}}module[_0xe746('0xa')][_0xe746('0xd')]=circularMonthInterval;function parseDom(_0x50a800){var _0x2d8ef7=parseInt(_0x50a800,0xa);if(_0x2d8ef7<0x1||_0x2d8ef7>0x1f){throw new Error(EINVALID_DATE);}return _0x2d8ef7;}function timeCompare(_0x25586e,_0x9edce3,_0x345190){var _0x5bb7f7=_0x25586e[_0xe746('0xe')]();var _0x42a4d0=extractTime(_0x9edce3);var _0x4b9f4d=_0x42a4d0[0x0];var _0x1a868e=_0x42a4d0[0x1];var _0x1ea930=_0x25586e[_0xe746('0xe')]()[_0xe746('0xf')](_0x4b9f4d)[_0xe746('0x10')](_0x1a868e);throwIfDateNotValid(_0x1ea930);var _0x34897a=extractTime(_0x345190);var _0x3de6ec=_0x34897a[0x0];var _0x179e4d=_0x34897a[0x1];var _0x3363d5=_0x25586e[_0xe746('0xe')]()[_0xe746('0xf')](_0x3de6ec)[_0xe746('0x10')](_0x179e4d);throwIfDateNotValid(_0x3363d5);if(_0x3363d5['isBefore'](_0x1ea930)){var _0x50ed63=_0x5bb7f7[_0xe746('0xe')]()['startOf'](_0xe746('0x11'));var _0x44b8aa=_0x5bb7f7[_0xe746('0xe')]()[_0xe746('0x12')](_0xe746('0x11'));return _0x5bb7f7[_0xe746('0x13')](_0x1ea930,_0x44b8aa,undefined,'[]')||_0x5bb7f7['isBetween'](_0x50ed63,_0x3363d5,undefined,'[]');}else{return _0x5bb7f7['isBetween'](_0x1ea930,_0x3363d5,undefined,'[]');}}module[_0xe746('0xa')]['timeCompare']=timeCompare;function dowCompare(_0x576174,_0x64b7a0,_0x4c1e89){var _0x1fb133=_0x576174['locale']('en')[_0xe746('0x14')](_0xe746('0x15'))['toLowerCase']();return circularDoWInterval(_0x64b7a0,_0x4c1e89)['includes'](_0x1fb133);}module[_0xe746('0xa')][_0xe746('0x16')]=dowCompare;function domCompare(_0x4a1c7a,_0x5d39ce,_0x1296e9){var _0x54cc2f=_0x4a1c7a['date']();if(_0x5d39ce===_0x1296e9){return _0x54cc2f===_0x5d39ce;}else{var _0xf7956e=_0x4a1c7a[_0xe746('0x17')]();var _0x2de00f=_0x5d39ce<_0x1296e9;let _0x526827=![];var _0x5e24c7=0x0;var _0x3f7199=0x0;if(_0x2de00f){_0x5e24c7=Math[_0xe746('0x18')](0x1,_0x5d39ce);_0x3f7199=Math[_0xe746('0x19')](_0x1296e9,_0xf7956e);_0x526827=_0x54cc2f>=_0x5e24c7&&_0x54cc2f<=_0x3f7199;}else{_0x5e24c7=Math[_0xe746('0x19')](_0x5d39ce,_0xf7956e);_0x3f7199=Math[_0xe746('0x18')](0x1,_0x1296e9);_0x526827=_0x54cc2f>=_0x5e24c7||_0x54cc2f<=_0x3f7199;}return _0x526827;}}module[_0xe746('0xa')][_0xe746('0x1a')]=domCompare;function monthCompare(_0x519bf9,_0x2969a6,_0x139464){var _0x4bf9f3=_0x519bf9[_0xe746('0x5')]('en')[_0xe746('0x14')](_0xe746('0x1b'))[_0xe746('0x7')]();return circularMonthInterval(_0x2969a6,_0x139464)[_0xe746('0x1c')](_0x4bf9f3);}module[_0xe746('0xa')][_0xe746('0x1d')]=monthCompare;function iftime(_0x26546e,_0x50f080=moment['tz'][_0xe746('0x1e')](),_0x747569=moment()){if(!validateRx[_0xe746('0x1f')](_0x26546e)){throw new Error(EINVALID_STRING);}else{var _0x52fb94=(moment[_0xe746('0x20')](_0x747569)?_0x747569[_0xe746('0xe')]():moment(_0x747569))['tz'](_0x50f080)['locale']('en');throwIfDateNotValid(_0x52fb94);var _0x56f838=_0x26546e[_0xe746('0x4')](',');var _0x4040ca=_0x56f838[0x0];var _0x568314=_0x56f838[0x1];var _0x29b282=_0x56f838[0x2];var _0x350b4e=_0x56f838[0x3];let _0x688f82=!![];if(_0x4040ca!=='*'){var _0x22b40a=_0x4040ca['split']('-');var _0x55f655=_[_0xe746('0x21')](_0x22b40a[0x0],0x5,'0');var _0x50cb13=_0x22b40a['length']===0x2?_['padStart'](_0x22b40a[0x1],0x5,'0'):_0x55f655;_0x688f82=timeCompare(_0x52fb94,_0x55f655,_0x50cb13);}let _0x8e714=!![];if(_0x568314!=='*'){var _0x3d7947=_0x568314[_0xe746('0x4')]('-');var _0xe80344=_0x3d7947[0x0];var _0x3b7030=_0x3d7947[_0xe746('0x22')]===0x2?_0x3d7947[0x1]:_0xe80344;_0x8e714=dowCompare(_0x52fb94,_0xe80344,_0x3b7030);}let _0x4613c2=!![];if(_0x29b282!=='*'){var _0x3e0746=_0x29b282[_0xe746('0x4')]('-');var _0x491609=parseDom(_0x3e0746[0x0]);var _0x2f72bf=_0x3e0746[_0xe746('0x22')]===0x2?parseDom(_0x3e0746[0x1]):_0x491609;_0x4613c2=domCompare(_0x52fb94,_0x491609,_0x2f72bf);}let _0x20e04f=!![];if(_0x350b4e!=='*'){var _0x55a9f4=_0x350b4e['split']('-');var _0x5bb3ae=_0x55a9f4[0x0];var _0x29c613=_0x55a9f4[_0xe746('0x22')]===0x2?_0x55a9f4[0x1]:_0x55a9f4[0x0];_0x20e04f=monthCompare(_0x52fb94,_0x5bb3ae,_0x29c613);}return _0x688f82&&_0x8e714&&_0x4613c2&&_0x20e04f;}}module['exports'][_0xe746('0x23')]=iftime; \ No newline at end of file +var _0xa015=['startOf','day','endOf','isBetween','timeCompare','ddd','includes','dowCompare','daysInMonth','max','min','domCompare','format','MMM','guess','test','isMoment','padStart','length','iftime','moment-timezone','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','indexOf','slice','concat','exports','circularDoWInterval','toLowerCase','circularMonthInterval','clone','hours','minutes','isBefore'];(function(_0x281ad3,_0x1602e0){var _0x30a754=function(_0x1e040c){while(--_0x1e040c){_0x281ad3['push'](_0x281ad3['shift']());}};_0x30a754(++_0x1602e0);}(_0xa015,0xb4));var _0x5a01=function(_0x1bfb55,_0x2f0205){_0x1bfb55=_0x1bfb55-0x0;var _0x59fe7d=_0xa015[_0x1bfb55];return _0x59fe7d;};var _=require('lodash');var moment=require(_0x5a01('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x5a01('0x1')](function(_0x1aeec8){return _0x1aeec8['source'];})[_0x5a01('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x5a01('0x3');var EINVALID_DATE=_0x5a01('0x4');function throwIfDateNotValid(_0x56bd10){if(!_0x56bd10[_0x5a01('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x316778){var _0x5a270c=_0x316778[_0x5a01('0x6')](':')[_0x5a01('0x1')](function(_0x55d973){return parseInt(_0x55d973,0xa);});var _0xfc519e=_0x5a270c[0x0];var _0x497d1c=_0x5a270c[0x1];if(_0xfc519e<0x0||_0xfc519e>0x17||_0x497d1c<0x0||_0x497d1c>0x3b){throw new Error(EINVALID_DATE);}return[_0xfc519e,_0x497d1c];}function circularDoWInterval(_0x5aedfd,_0x4fbd8b){if(_0x5aedfd===_0x4fbd8b){return[_0x5aedfd];}else{var _0x2a5e34=moment[_0x5a01('0x7')]();moment['locale']('en');var _0xaa955e=moment[_0x5a01('0x8')]()[_0x5a01('0x1')](function(_0x48a54d){return _0x48a54d['toLowerCase']();});moment[_0x5a01('0x7')](_0x2a5e34);var _0x251fc0=_0xaa955e[_0x5a01('0x9')](_0x5aedfd);var _0x27bb76=_0xaa955e[_0x5a01('0x9')](_0x4fbd8b);if(_0x27bb76>_0x251fc0){return _0xaa955e[_0x5a01('0xa')](_0x251fc0,_0x27bb76+0x1);}else{var _0x2e1178=_0xaa955e[_0x5a01('0xa')](0x0,_0x27bb76+0x1);var _0x486b64=_0xaa955e['slice'](_0x251fc0);return _0x486b64[_0x5a01('0xb')](_0x2e1178);}}}module[_0x5a01('0xc')][_0x5a01('0xd')]=circularDoWInterval;function circularMonthInterval(_0x33205e,_0x453947){if(_0x33205e===_0x453947){return[_0x33205e];}else{var _0x51779b=moment[_0x5a01('0x7')]();moment[_0x5a01('0x7')]('en');var _0x42653d=moment['monthsShort']()[_0x5a01('0x1')](function(_0x3e161e){return _0x3e161e[_0x5a01('0xe')]();});moment[_0x5a01('0x7')](_0x51779b);var _0x4fe5b7=_0x42653d[_0x5a01('0x9')](_0x33205e);var _0x101b78=_0x42653d['indexOf'](_0x453947);if(_0x101b78>_0x4fe5b7){return _0x42653d[_0x5a01('0xa')](_0x4fe5b7,_0x101b78+0x1);}else{var _0x510dd4=_0x42653d[_0x5a01('0xa')](0x0,_0x101b78+0x1);var _0x1e3a04=_0x42653d[_0x5a01('0xa')](_0x4fe5b7);return _0x1e3a04[_0x5a01('0xb')](_0x510dd4);}}}module['exports'][_0x5a01('0xf')]=circularMonthInterval;function parseDom(_0x28d017){var _0x21fd8a=parseInt(_0x28d017,0xa);if(_0x21fd8a<0x1||_0x21fd8a>0x1f){throw new Error(EINVALID_DATE);}return _0x21fd8a;}function timeCompare(_0x635c14,_0x45294c,_0x19d336){var _0x3a702b=_0x635c14[_0x5a01('0x10')]();var _0x292d2c=extractTime(_0x45294c);var _0xb9b47d=_0x292d2c[0x0];var _0x466032=_0x292d2c[0x1];var _0x14ef78=_0x635c14[_0x5a01('0x10')]()[_0x5a01('0x11')](_0xb9b47d)['minutes'](_0x466032);throwIfDateNotValid(_0x14ef78);var _0x49df85=extractTime(_0x19d336);var _0x5e5db7=_0x49df85[0x0];var _0x26485e=_0x49df85[0x1];var _0x934174=_0x635c14[_0x5a01('0x10')]()['hours'](_0x5e5db7)[_0x5a01('0x12')](_0x26485e);throwIfDateNotValid(_0x934174);if(_0x934174[_0x5a01('0x13')](_0x14ef78)){var _0x142b01=_0x3a702b[_0x5a01('0x10')]()[_0x5a01('0x14')](_0x5a01('0x15'));var _0x424162=_0x3a702b[_0x5a01('0x10')]()[_0x5a01('0x16')](_0x5a01('0x15'));return _0x3a702b[_0x5a01('0x17')](_0x14ef78,_0x424162,undefined,'[]')||_0x3a702b['isBetween'](_0x142b01,_0x934174,undefined,'[]');}else{return _0x3a702b[_0x5a01('0x17')](_0x14ef78,_0x934174,undefined,'[]');}}module['exports'][_0x5a01('0x18')]=timeCompare;function dowCompare(_0x468dee,_0x5cae93,_0x1ddd23){var _0xee839d=_0x468dee[_0x5a01('0x7')]('en')['format'](_0x5a01('0x19'))['toLowerCase']();return circularDoWInterval(_0x5cae93,_0x1ddd23)[_0x5a01('0x1a')](_0xee839d);}module[_0x5a01('0xc')][_0x5a01('0x1b')]=dowCompare;function domCompare(_0x2686ce,_0x4e4631,_0x21502e){var _0x61f4d8=_0x2686ce['date']();if(_0x4e4631===_0x21502e){return _0x61f4d8===_0x4e4631;}else{var _0x4aa230=_0x2686ce[_0x5a01('0x1c')]();var _0x2498fe=_0x4e4631<_0x21502e;let _0x207f18=![];var _0x36d2f9=0x0;var _0x405421=0x0;if(_0x2498fe){_0x36d2f9=Math[_0x5a01('0x1d')](0x1,_0x4e4631);_0x405421=Math[_0x5a01('0x1e')](_0x21502e,_0x4aa230);_0x207f18=_0x61f4d8>=_0x36d2f9&&_0x61f4d8<=_0x405421;}else{_0x36d2f9=Math[_0x5a01('0x1e')](_0x4e4631,_0x4aa230);_0x405421=Math[_0x5a01('0x1d')](0x1,_0x21502e);_0x207f18=_0x61f4d8>=_0x36d2f9||_0x61f4d8<=_0x405421;}return _0x207f18;}}module['exports'][_0x5a01('0x1f')]=domCompare;function monthCompare(_0x36c0d2,_0x12f674,_0x1fa08b){var _0x4a2a66=_0x36c0d2[_0x5a01('0x7')]('en')[_0x5a01('0x20')](_0x5a01('0x21'))['toLowerCase']();return circularMonthInterval(_0x12f674,_0x1fa08b)[_0x5a01('0x1a')](_0x4a2a66);}module[_0x5a01('0xc')]['monthCompare']=monthCompare;function iftime(_0x244571,_0xfb22f7=moment['tz'][_0x5a01('0x22')](),_0x13f825=moment()){if(!validateRx[_0x5a01('0x23')](_0x244571)){throw new Error(EINVALID_STRING);}else{var _0x4197cb=(moment[_0x5a01('0x24')](_0x13f825)?_0x13f825[_0x5a01('0x10')]():moment(_0x13f825))['tz'](_0xfb22f7)[_0x5a01('0x7')]('en');throwIfDateNotValid(_0x4197cb);var _0x15fb62=_0x244571[_0x5a01('0x6')](',');var _0x3819e3=_0x15fb62[0x0];var _0x4d062f=_0x15fb62[0x1];var _0xc31ace=_0x15fb62[0x2];var _0x1eb5ae=_0x15fb62[0x3];let _0x115213=!![];if(_0x3819e3!=='*'){var _0x2768c5=_0x3819e3[_0x5a01('0x6')]('-');var _0x28ad39=_['padStart'](_0x2768c5[0x0],0x5,'0');var _0x1a35d1=_0x2768c5['length']===0x2?_[_0x5a01('0x25')](_0x2768c5[0x1],0x5,'0'):_0x28ad39;_0x115213=timeCompare(_0x4197cb,_0x28ad39,_0x1a35d1);}let _0x18ec9f=!![];if(_0x4d062f!=='*'){var _0x69b651=_0x4d062f[_0x5a01('0x6')]('-');var _0x357549=_0x69b651[0x0];var _0x3dc0e8=_0x69b651[_0x5a01('0x26')]===0x2?_0x69b651[0x1]:_0x357549;_0x18ec9f=dowCompare(_0x4197cb,_0x357549,_0x3dc0e8);}let _0x2066ab=!![];if(_0xc31ace!=='*'){var _0x243ec0=_0xc31ace[_0x5a01('0x6')]('-');var _0xa75cb6=parseDom(_0x243ec0[0x0]);var _0x52f2ff=_0x243ec0[_0x5a01('0x26')]===0x2?parseDom(_0x243ec0[0x1]):_0xa75cb6;_0x2066ab=domCompare(_0x4197cb,_0xa75cb6,_0x52f2ff);}let _0x40a088=!![];if(_0x1eb5ae!=='*'){var _0x5dbd45=_0x1eb5ae[_0x5a01('0x6')]('-');var _0x4d8601=_0x5dbd45[0x0];var _0x209181=_0x5dbd45[_0x5a01('0x26')]===0x2?_0x5dbd45[0x1]:_0x5dbd45[0x0];_0x40a088=monthCompare(_0x4197cb,_0x4d8601,_0x209181);}return _0x115213&&_0x18ec9f&&_0x2066ab&&_0x40a088;}}module[_0x5a01('0xc')][_0x5a01('0x27')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index a68128e..6bdaabe 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbd6=['[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','Console','warn','%s-%s','error','File','fileLogger','util','moment','../config/environment','debugLevel','info','red','bold\x20yellow','white','bold\x20green','gray','bold\x20blue','bold\x20cyan','addColors','join','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','meta','keys','stringify'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xfbd6,0x1d1));var _0x6fbd=function(_0x1d6cd5,_0x1a595a){_0x1d6cd5=_0x1d6cd5-0x0;var _0x345c82=_0xfbd6[_0x1d6cd5];return _0x345c82;};'use strict';var path=require('path');var util=require(_0x6fbd('0x0'));var moment=require(_0x6fbd('0x1'));var winston=require('winston');var config=require(_0x6fbd('0x2'));var debugLevel=config[_0x6fbd('0x3')]?config[_0x6fbd('0x3')]['toLowerCase']():_0x6fbd('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x6fbd('0x5'),'warn':_0x6fbd('0x6'),'info':_0x6fbd('0x7'),'print':'bold\x20white','success':_0x6fbd('0x8'),'http':_0x6fbd('0x9'),'verbose':'bold\x20magenta','debug':_0x6fbd('0xa'),'silly':_0x6fbd('0xb')};winston[_0x6fbd('0xc')](XC_LOG_COLORS);function getLogFileName(_0x3a7916,_0x1839a5,_0x48df09){var _0x389db8=_0x3a7916||'/var/log/xcally';return path[_0x6fbd('0xd')](_0x389db8,util[_0x6fbd('0xe')](_0x6fbd('0xf'),_0x1839a5,_0x48df09));}function formatter(_0x4aaf1b,_0x103521){_0x103521[_0x6fbd('0x10')]=_0x103521[_0x6fbd('0x10')][_0x6fbd('0x11')](/@@{/g,'{{{')['replace'](/}@@/g,_0x6fbd('0x12'))[_0x6fbd('0x11')](/@{/g,'{{')[_0x6fbd('0x11')](/}@/g,'}}');return util['format'](_0x6fbd('0x13'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x103521[_0x6fbd('0x14')][_0x6fbd('0x15')](),_0x4aaf1b,_0x103521[_0x6fbd('0x10')]);}function fileFormat(_0x2f2984,_0x12a21b){_0x12a21b[_0x6fbd('0x10')]=_0x12a21b[_0x6fbd('0x10')]['replace'](/@@{/g,'{{{')[_0x6fbd('0x11')](/}@@/g,_0x6fbd('0x12'))['replace'](/@{/g,'{{')[_0x6fbd('0x11')](/}@/g,'}}');var _0x342dd1=_0x12a21b[_0x6fbd('0x16')]&&Object[_0x6fbd('0x17')](_0x12a21b[_0x6fbd('0x16')])['length']?'\x0a\x09'+JSON[_0x6fbd('0x18')](_0x12a21b[_0x6fbd('0x16')]):'';return util[_0x6fbd('0xe')](_0x6fbd('0x19'),moment()[_0x6fbd('0xe')](_0x6fbd('0x1a')),_0x12a21b[_0x6fbd('0x14')][_0x6fbd('0x15')](),_0x2f2984,_0x12a21b['message'],_0x342dd1);}function consoleLogger(){var _0x3ccfbf=new winston[(_0x6fbd('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x6fbd('0x1c'))][(_0x6fbd('0x1d'))]({'level':_0x6fbd('0x1e'),'json':![],'formatter':function(_0x5a0681){return formatter('',_0x5a0681);}})]});return _0x3ccfbf;}function fileLogger(_0x2e23c8,_0x2594ba){var _0x3d0b61=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x6fbd('0x1c'))]['File']({'name':util[_0x6fbd('0xe')](_0x6fbd('0x1f'),_0x2e23c8,_0x6fbd('0x20')),'filename':getLogFileName(_0x2594ba,_0x2e23c8,_0x6fbd('0x20')),'level':_0x6fbd('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xb1dd85){return fileFormat(_0x2e23c8,_0xb1dd85);}}),new winston[(_0x6fbd('0x1c'))][(_0x6fbd('0x21'))]({'name':util[_0x6fbd('0xe')](_0x6fbd('0x1f'),_0x2e23c8,debugLevel),'filename':getLogFileName(_0x2594ba,_0x2e23c8,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x147fb9){return fileFormat(_0x2e23c8,_0x147fb9);}}),new winston['transports']['Console']({'level':_0x6fbd('0x1e'),'json':![],'formatter':function(_0x1c0e75){return fileFormat(_0x2e23c8,_0x1c0e75);}})]});return _0x3d0b61;}exports['consoleLogger']=consoleLogger;exports[_0x6fbd('0x22')]=fileLogger; \ No newline at end of file +var _0xf0af=['stringify','Logger','warn','transports','%s-%s','error','Console','consoleLogger','path','util','moment','debugLevel','info','redBG\x20white','red','bold\x20yellow','white','bold\x20green','gray','bold\x20magenta','bold\x20blue','addColors','format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','}}}','meta','keys'];(function(_0x2465c6,_0x412a0a){var _0x28b33c=function(_0x52220f){while(--_0x52220f){_0x2465c6['push'](_0x2465c6['shift']());}};_0x28b33c(++_0x412a0a);}(_0xf0af,0x6b));var _0xff0a=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xf0af[_0x18cd5b];return _0x5eaa52;};'use strict';var path=require(_0xff0a('0x0'));var util=require(_0xff0a('0x1'));var moment=require(_0xff0a('0x2'));var winston=require('winston');var config=require('../config/environment');var debugLevel=config[_0xff0a('0x3')]?config[_0xff0a('0x3')]['toLowerCase']():_0xff0a('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xff0a('0x5'),'error':_0xff0a('0x6'),'warn':_0xff0a('0x7'),'info':_0xff0a('0x8'),'print':'bold\x20white','success':_0xff0a('0x9'),'http':_0xff0a('0xa'),'verbose':_0xff0a('0xb'),'debug':_0xff0a('0xc'),'silly':'bold\x20cyan'};winston[_0xff0a('0xd')](XC_LOG_COLORS);function getLogFileName(_0xbcc094,_0x5529a9,_0x42da41){var _0x424b31=_0xbcc094||'/var/log/xcally';return path['join'](_0x424b31,util[_0xff0a('0xe')](_0xff0a('0xf'),_0x5529a9,_0x42da41));}function formatter(_0x4ea0ff,_0x2940d4){_0x2940d4[_0xff0a('0x10')]=_0x2940d4[_0xff0a('0x10')][_0xff0a('0x11')](/@@{/g,_0xff0a('0x12'))[_0xff0a('0x11')](/}@@/g,'}}}')[_0xff0a('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xff0a('0xe')](_0xff0a('0x13'),moment()[_0xff0a('0xe')](_0xff0a('0x14')),_0x2940d4[_0xff0a('0x15')]['toUpperCase'](),_0x4ea0ff,_0x2940d4[_0xff0a('0x10')]);}function fileFormat(_0x42b2b4,_0x1b1b88){_0x1b1b88[_0xff0a('0x10')]=_0x1b1b88[_0xff0a('0x10')][_0xff0a('0x11')](/@@{/g,'{{{')[_0xff0a('0x11')](/}@@/g,_0xff0a('0x16'))[_0xff0a('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x52afce=_0x1b1b88[_0xff0a('0x17')]&&Object[_0xff0a('0x18')](_0x1b1b88['meta'])['length']?'\x0a\x09'+JSON[_0xff0a('0x19')](_0x1b1b88[_0xff0a('0x17')]):'';return util[_0xff0a('0xe')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0xff0a('0xe')](_0xff0a('0x14')),_0x1b1b88['level']['toUpperCase'](),_0x42b2b4,_0x1b1b88['message'],_0x52afce);}function consoleLogger(){var _0x264bbe=new winston[(_0xff0a('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':_0xff0a('0x1b'),'json':![],'formatter':function(_0x5c8e88){return formatter('',_0x5c8e88);}})]});return _0x264bbe;}function fileLogger(_0x4e543f,_0x553373){var _0x5c3445=new winston[(_0xff0a('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xff0a('0x1c'))]['File']({'name':util[_0xff0a('0xe')](_0xff0a('0x1d'),_0x4e543f,_0xff0a('0x1e')),'filename':getLogFileName(_0x553373,_0x4e543f,'error'),'level':_0xff0a('0x1e'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x535c0d){return fileFormat(_0x4e543f,_0x535c0d);}}),new winston[(_0xff0a('0x1c'))]['File']({'name':util[_0xff0a('0xe')](_0xff0a('0x1d'),_0x4e543f,debugLevel),'filename':getLogFileName(_0x553373,_0x4e543f,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x9cb896){return fileFormat(_0x4e543f,_0x9cb896);}}),new winston[(_0xff0a('0x1c'))][(_0xff0a('0x1f'))]({'level':_0xff0a('0x1b'),'json':![],'formatter':function(_0x404362){return fileFormat(_0x4e543f,_0x404362);}})]});return _0x5c3445;}exports[_0xff0a('0x20')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 44a90fe..aaa9a8f 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda2d=['@@{','replace','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','user','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','isString'];(function(_0x34cd48,_0x507b08){var _0x5d6ae1=function(_0xf7b576){while(--_0xf7b576){_0x34cd48['push'](_0x34cd48['shift']());}};_0x5d6ae1(++_0x507b08);}(_0xda2d,0x102));var _0xdda2=function(_0x17d581,_0x3b01b6){_0x17d581=_0x17d581-0x0;var _0x3c57d3=_0xda2d[_0x17d581];return _0x3c57d3;};var _=require('lodash');var sensitiveFields=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2'),_0xdda2('0x3'),_0xdda2('0x4'),'lastName','street','phone',_0xdda2('0x5'),_0xdda2('0x6'),_0xdda2('0x7'),_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'channelSecret',_0xdda2('0xf'),_0xdda2('0x10'),'authToken',_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0x13'),_0xdda2('0x14'),_0xdda2('0x15'),_0xdda2('0x16'),_0xdda2('0x17'),_0xdda2('0x18'),'privateKey','accesskeyid','secretaccesskey',_0xdda2('0x19'),_0xdda2('0x1a'),_0xdda2('0x1b'),_0xdda2('0x1c'),_0xdda2('0x1d'),_0xdda2('0x1e'),_0xdda2('0x1f'),'registry',_0xdda2('0x20')];function maskSensitiveData(_0x4b0220){const _0xbef148=/(?!^)[\s\S](?!$)/g;if(_[_0xdda2('0x21')](_0x4b0220)){for(const _0x3553d5 in _0x4b0220){if(_[_0xdda2('0x22')](_0x4b0220[_0x3553d5])){for(let _0x1922b1=0x0;_0x1922b1<_0x4b0220[_0x3553d5]['length'];_0x1922b1++){maskSensitiveData(_0x4b0220[_0x3553d5][_0x1922b1]);}}else if(_['isPlainObject'](_0x4b0220[_0x3553d5])){maskSensitiveData(_0x4b0220[_0x3553d5]);}else if(_[_0xdda2('0x23')](_0x4b0220[_0x3553d5])){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5]['replace'](/{{{/g,_0xdda2('0x24'))[_0xdda2('0x25')](/}}}/g,_0xdda2('0x26'))[_0xdda2('0x25')](/{{/g,'@{')[_0xdda2('0x25')](/}}/g,'}@');if(_[_0xdda2('0x27')](sensitiveFields,_0x3553d5)){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5][_0xdda2('0x25')](_0xbef148,'*');}}}}}module[_0xdda2('0x28')][_0xdda2('0x29')]=maskSensitiveData; \ No newline at end of file +var _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a54,0x106));var _0x47a5=function(_0x43a42b,_0x397447){_0x43a42b=_0x43a42b-0x0;var _0x35b88e=_0x7a54[_0x43a42b];return _0x35b88e;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/misc.js b/server/utils/misc.js index dab6d43..6af7367 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['\x5c$&','exports','replace'];(function(_0x104efc,_0x2673db){var _0xce58b3=function(_0x9e53f0){while(--_0x9e53f0){_0x104efc['push'](_0x104efc['shift']());}};_0xce58b3(++_0x2673db);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3baaa2,_0x238b35){_0x3baaa2=_0x3baaa2-0x0;var _0x21a72d=_0x5f2f[_0x3baaa2];return _0x21a72d;};module[_0xf5f2('0x0')]={'escapeRegExp'(_0x423dd9,_0x2dcf60=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x423dd9[_0xf5f2('0x1')](_0x2dcf60,_0xf5f2('0x2'));}}; \ No newline at end of file +var _0xf494=['exports','\x5c$&'];(function(_0x27d418,_0x570754){var _0x383470=function(_0x1978b2){while(--_0x1978b2){_0x27d418['push'](_0x27d418['shift']());}};_0x383470(++_0x570754);}(_0xf494,0x1c6));var _0x4f49=function(_0x164f3a,_0x90b36a){_0x164f3a=_0x164f3a-0x0;var _0x4b1a40=_0xf494[_0x164f3a];return _0x4b1a40;};module[_0x4f49('0x0')]={'escapeRegExp'(_0x32e808,_0x3063f3=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x32e808['replace'](_0x3063f3,_0x4f49('0x1'));}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index f689646..778665a 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb62e=['map','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x55cbb6,_0x4387ec){var _0x28699c=function(_0x54c7ab){while(--_0x54c7ab){_0x55cbb6['push'](_0x55cbb6['shift']());}};_0x28699c(++_0x4387ec);}(_0xb62e,0x1de));var _0xeb62=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb62e[_0x5b644e];return _0x49c6bf;};var _=require(_0xeb62('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x46335b){return _0x46335b==='{{'?_0xeb62('0x1'):_0xeb62('0x2');}function safeTemplate(_0x57a5ba){var _0x3dfdef=_0x57a5ba;if(typeof _0x57a5ba===_0xeb62('0x3')){_0x3dfdef=_0x57a5ba[_0xeb62('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xeb62('0x5')](_0x57a5ba)){_0x3dfdef=_0x57a5ba[_0xeb62('0x6')](function(_0x1ebdbb){return safeTemplate(_0x1ebdbb);});}else if(_['isPlainObject'](_0x57a5ba)){_0x3dfdef=Object[_0xeb62('0x7')](_0x57a5ba)[_0xeb62('0x8')](function(_0x31f5ea,_0x5e0dc4){_0x31f5ea[_0x5e0dc4]=safeTemplate(_0x57a5ba[_0x5e0dc4]);return _0x31f5ea;},{});}return _0x3dfdef;}module[_0xeb62('0x9')][_0xeb62('0xa')]=safeTemplate; \ No newline at end of file +var _0x4024=['exports','lodash','\x20}\x20}','string','isArray','map','keys','reduce'];(function(_0x1e11fd,_0x4c92b6){var _0x3ac35d=function(_0x19fa62){while(--_0x19fa62){_0x1e11fd['push'](_0x1e11fd['shift']());}};_0x3ac35d(++_0x4c92b6);}(_0x4024,0x89));var _0x4402=function(_0x14955b,_0x277b57){_0x14955b=_0x14955b-0x0;var _0x46ca83=_0x4024[_0x14955b];return _0x46ca83;};var _=require(_0x4402('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x10e0ef){return _0x10e0ef==='{{'?'{\x20{\x20':_0x4402('0x1');}function safeTemplate(_0x2b36c7){var _0x49a2e2=_0x2b36c7;if(typeof _0x2b36c7===_0x4402('0x2')){_0x49a2e2=_0x2b36c7['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x4402('0x3')](_0x2b36c7)){_0x49a2e2=_0x2b36c7[_0x4402('0x4')](function(_0x5bdb3f){return safeTemplate(_0x5bdb3f);});}else if(_['isPlainObject'](_0x2b36c7)){_0x49a2e2=Object[_0x4402('0x5')](_0x2b36c7)[_0x4402('0x6')](function(_0x168acd,_0x4ed77d){_0x168acd[_0x4ed77d]=safeTemplate(_0x2b36c7[_0x4ed77d]);return _0x168acd;},{});}return _0x49a2e2;}module[_0x4402('0x7')]['safeTemplate']=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 9c5d639..561b8c1 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9913=['fs-extra','path','../config/environment','root','resolve','server/app.json','legacy-libs','isArray','apps','findIndex','motion2','env','NODE_PATH','pathExists','readJSON','then','updated','info','Updating\x20app.json','exports'];(function(_0x22e0e2,_0x3523ca){var _0x48143a=function(_0x50adfa){while(--_0x50adfa){_0x22e0e2['push'](_0x22e0e2['shift']());}};_0x48143a(++_0x3523ca);}(_0x9913,0x1e0));var _0x3991=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0x9913[_0x2bc3f4];return _0x14ac53;};var fs=require(_0x3991('0x0'));var path=require(_0x3991('0x1'));var config=require(_0x3991('0x2'));var root=config[_0x3991('0x3')];var APP_JSON_PATH=path[_0x3991('0x4')](root,_0x3991('0x5'));var NODEPATH=path[_0x3991('0x4')](root,_0x3991('0x6'));function setLegacyLibsNodeEnvPath(_0x1a314f){let _0x2e5c8b=![];if(Array[_0x3991('0x7')](_0x1a314f[_0x3991('0x8')])){var _0x5a182c=_0x1a314f[_0x3991('0x8')][_0x3991('0x9')](function(_0x38f651){return _0x38f651['name']===_0x3991('0xa');});if(_0x5a182c>-0x1){var _0x3024a0=_0x1a314f[_0x3991('0x8')][_0x5a182c];if(typeof _0x3024a0['env']['NODE_PATH']!=='string'){_0x3024a0[_0x3991('0xb')][_0x3991('0xc')]=NODEPATH;_0x2e5c8b=!![];}}return{'appConfig':_0x1a314f,'updated':_0x2e5c8b};}}function updateAppConfig(_0x353244){return fs[_0x3991('0xd')](APP_JSON_PATH)['then'](function(_0x3cde2e){if(_0x3cde2e){return fs[_0x3991('0xe')](APP_JSON_PATH)[_0x3991('0xf')](function(_0x3571e1){var _0x539df4=setLegacyLibsNodeEnvPath(_0x3571e1);if(_0x539df4[_0x3991('0x10')]){_0x353244[_0x3991('0x11')](_0x3991('0x12'));return fs['writeJSON'](APP_JSON_PATH,_0x3571e1,{'spaces':0x2});}else{return Promise[_0x3991('0x4')]();}});}else{return Promise[_0x3991('0x4')]();}});}module[_0x3991('0x13')]=updateAppConfig; \ No newline at end of file +var _0x81c2=['motion2','string','env','pathExists','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','root','resolve','server/app.json','legacy-libs','isArray','apps','findIndex','name'];(function(_0x1b3291,_0x12394f){var _0x3769d2=function(_0x115790){while(--_0x115790){_0x1b3291['push'](_0x1b3291['shift']());}};_0x3769d2(++_0x12394f);}(_0x81c2,0x19a));var _0x281c=function(_0x112db5,_0x38a06d){_0x112db5=_0x112db5-0x0;var _0x1d7d06=_0x81c2[_0x112db5];return _0x1d7d06;};var fs=require(_0x281c('0x0'));var path=require(_0x281c('0x1'));var config=require('../config/environment');var root=config[_0x281c('0x2')];var APP_JSON_PATH=path[_0x281c('0x3')](root,_0x281c('0x4'));var NODEPATH=path[_0x281c('0x3')](root,_0x281c('0x5'));function setLegacyLibsNodeEnvPath(_0x7abdbe){let _0x25c267=![];if(Array[_0x281c('0x6')](_0x7abdbe['apps'])){var _0x56c1d0=_0x7abdbe[_0x281c('0x7')][_0x281c('0x8')](function(_0x2a3c98){return _0x2a3c98[_0x281c('0x9')]===_0x281c('0xa');});if(_0x56c1d0>-0x1){var _0x3d9ca9=_0x7abdbe[_0x281c('0x7')][_0x56c1d0];if(typeof _0x3d9ca9['env']['NODE_PATH']!==_0x281c('0xb')){_0x3d9ca9[_0x281c('0xc')]['NODE_PATH']=NODEPATH;_0x25c267=!![];}}return{'appConfig':_0x7abdbe,'updated':_0x25c267};}}function updateAppConfig(_0x34d731){return fs[_0x281c('0xd')](APP_JSON_PATH)[_0x281c('0xe')](function(_0x29610f){if(_0x29610f){return fs[_0x281c('0xf')](APP_JSON_PATH)['then'](function(_0x45a01c){var _0x287a9f=setLegacyLibsNodeEnvPath(_0x45a01c);if(_0x287a9f[_0x281c('0x10')]){_0x34d731[_0x281c('0x11')](_0x281c('0x12'));return fs[_0x281c('0x13')](APP_JSON_PATH,_0x45a01c,{'spaces':0x2});}else{return Promise[_0x281c('0x3')]();}});}else{return Promise[_0x281c('0x3')]();}});}module[_0x281c('0x14')]=updateAppConfig; \ No newline at end of file